aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-22 21:39:00 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-22 21:39:00 +0000
commit2e9c0dc38e2692b04281844366dbb367ae1294e1 (patch)
treee56f44693864144d87710daeab9743d4e76b6037
parent780b7d9b87ddf306aa31c750d5eb9d96a9cb69ea (diff)
This commit was manufactured by cvs2svn to create tagobjc-improvements-candidate-20030922
'objc-improvements-candidate-20030922'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/objc-improvements-candidate-20030922@71666 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog217
-rw-r--r--MAINTAINERS41
-rw-r--r--Makefile.in124
-rw-r--r--Makefile.tpl34
-rw-r--r--README.SCO27
-rw-r--r--boehm-gc/BCC_MAKEFILE58
-rw-r--r--boehm-gc/ChangeLog131
-rw-r--r--boehm-gc/Mac_files/MacOS_Test_config.h2
-rw-r--r--boehm-gc/Mac_files/MacOS_config.h4
-rw-r--r--boehm-gc/Makefile.am22
-rw-r--r--boehm-gc/Makefile.direct107
-rw-r--r--boehm-gc/Makefile.dj20
-rw-r--r--boehm-gc/Makefile.in88
-rw-r--r--boehm-gc/aix_irix_threads.c (renamed from boehm-gc/irix_threads.c)409
-rw-r--r--boehm-gc/allchblk.c16
-rw-r--r--boehm-gc/alloc.c69
-rw-r--r--boehm-gc/alpha_mach_dep.S (renamed from boehm-gc/alpha_mach_dep.s)1
-rw-r--r--boehm-gc/backgraph.c1
-rwxr-xr-xboehm-gc/configure582
-rw-r--r--boehm-gc/configure.host26
-rw-r--r--boehm-gc/configure.in170
-rw-r--r--boehm-gc/cord/cordbscs.c8
-rw-r--r--boehm-gc/cord/cordprnt.c16
-rw-r--r--boehm-gc/cord/de_win.c2
-rw-r--r--boehm-gc/darwin_stop_world.c209
-rw-r--r--boehm-gc/dbg_mlc.c153
-rwxr-xr-xboehm-gc/depcomp436
-rw-r--r--boehm-gc/doc/README19
-rw-r--r--boehm-gc/doc/README.DGUX386215
-rw-r--r--boehm-gc/doc/README.MacOSX28
-rw-r--r--boehm-gc/doc/README.arm.cross68
-rw-r--r--boehm-gc/doc/README.changes436
-rw-r--r--boehm-gc/doc/README.darwin106
-rw-r--r--boehm-gc/doc/README.environment58
-rw-r--r--boehm-gc/doc/README.ews48006
-rw-r--r--boehm-gc/doc/README.linux19
-rw-r--r--boehm-gc/doc/README.macros13
-rw-r--r--boehm-gc/doc/README.win3220
-rw-r--r--boehm-gc/doc/debugging.html8
-rw-r--r--boehm-gc/doc/gcdescr.html166
-rw-r--r--boehm-gc/doc/gcinterface.html203
-rw-r--r--boehm-gc/doc/leak.html197
-rw-r--r--boehm-gc/doc/scale.html210
-rw-r--r--boehm-gc/doc/tree.html5
-rw-r--r--boehm-gc/dyn_load.c284
-rw-r--r--boehm-gc/finalize.c37
-rw-r--r--boehm-gc/gc_cpp.cc22
-rw-r--r--boehm-gc/gc_dlopen.c20
-rw-r--r--boehm-gc/gcj_mlc.c1
-rw-r--r--boehm-gc/if_mach.c2
-rw-r--r--boehm-gc/include/Makefile.in11
-rw-r--r--boehm-gc/include/gc.h236
-rw-r--r--boehm-gc/include/gc_allocator.h232
-rw-r--r--boehm-gc/include/gc_config_macros.h147
-rw-r--r--boehm-gc/include/gc_cpp.h72
-rw-r--r--boehm-gc/include/gc_local_alloc.h3
-rw-r--r--boehm-gc/include/gc_mark.h4
-rw-r--r--boehm-gc/include/gc_pthread_redirects.h17
-rw-r--r--boehm-gc/include/gc_typed.h32
-rw-r--r--boehm-gc/include/new_gc_alloc.h8
-rw-r--r--boehm-gc/include/private/darwin_semaphore.h68
-rw-r--r--boehm-gc/include/private/darwin_stop_world.h15
-rw-r--r--boehm-gc/include/private/dbg_mlc.h10
-rw-r--r--boehm-gc/include/private/gc_hdrs.h2
-rw-r--r--boehm-gc/include/private/gc_locks.h245
-rw-r--r--boehm-gc/include/private/gc_pmark.h39
-rw-r--r--boehm-gc/include/private/gc_priv.h166
-rw-r--r--boehm-gc/include/private/gcconfig.h507
-rw-r--r--boehm-gc/include/private/pthread_stop_world.h12
-rw-r--r--boehm-gc/include/private/pthread_support.h97
-rw-r--r--boehm-gc/include/private/solaris_threads.h3
-rw-r--r--boehm-gc/include/private/specific.h2
-rw-r--r--boehm-gc/mach_dep.c49
-rw-r--r--boehm-gc/malloc.c22
-rw-r--r--boehm-gc/mallocx.c56
-rw-r--r--boehm-gc/mark.c216
-rw-r--r--boehm-gc/mark_rts.c74
-rw-r--r--boehm-gc/mips_sgi_mach_dep.s (renamed from boehm-gc/mips_sgi_mach_dep.S)5
-rw-r--r--boehm-gc/misc.c246
-rw-r--r--boehm-gc/os_dep.c1480
-rw-r--r--boehm-gc/powerpc_darwin_mach_dep.s84
-rw-r--r--boehm-gc/powerpc_macosx_mach_dep.s95
-rw-r--r--boehm-gc/pthread_stop_world.c445
-rw-r--r--boehm-gc/pthread_support.c (renamed from boehm-gc/linux_threads.c)815
-rw-r--r--boehm-gc/ptr_chck.c4
-rw-r--r--boehm-gc/reclaim.c62
-rw-r--r--boehm-gc/solaris_pthreads.c3
-rw-r--r--boehm-gc/solaris_threads.c12
-rw-r--r--boehm-gc/sparc_mach_dep.S2
-rw-r--r--boehm-gc/tests/test.c332
-rw-r--r--boehm-gc/tests/test_cpp.cc33
-rw-r--r--boehm-gc/threadlibs.c16
-rw-r--r--boehm-gc/typd_mlc.c7
-rw-r--r--boehm-gc/version.h27
-rw-r--r--boehm-gc/win32_threads.c404
-rw-r--r--config-ml.in35
-rw-r--r--config.if51
-rw-r--r--config/no-executables.m461
-rwxr-xr-xconfigure260
-rw-r--r--configure.in122
-rw-r--r--contrib/ChangeLog21
-rwxr-xr-xcontrib/gcc_build12
-rwxr-xr-xcontrib/gcc_update2
-rw-r--r--contrib/regression/ChangeLog10
-rwxr-xr-xcontrib/regression/btest-gcc.sh8
-rwxr-xr-xcontrib/test_installed11
-rwxr-xr-xcontrib/texi2pod.pl8
-rw-r--r--fastjar/ChangeLog14
-rw-r--r--fastjar/Makefile.am1
-rw-r--r--fastjar/Makefile.in56
-rw-r--r--fastjar/README3
-rw-r--r--fastjar/fastjar.texi54
-rwxr-xr-xfastjar/mkinstalldirs111
-rw-r--r--gcc/ChangeLog28156
-rw-r--r--gcc/ChangeLog.921488
-rw-r--r--gcc/Makefile.in697
-rw-r--r--gcc/aclocal.m4115
-rw-r--r--gcc/ada/ChangeLog47
-rw-r--r--gcc/ada/Make-lang.in2
-rw-r--r--gcc/ada/Makefile.in29
-rw-r--r--gcc/ada/lang.opt6
-rw-r--r--gcc/ada/misc.c5
-rw-r--r--gcc/alias.c71
-rw-r--r--gcc/alloc-pool.c4
-rw-r--r--gcc/attribs.c39
-rw-r--r--gcc/basic-block.h3
-rw-r--r--gcc/bitmap.c3
-rw-r--r--gcc/bitmap.h4
-rw-r--r--gcc/bt-load.c21
-rw-r--r--gcc/builtin-attrs.def60
-rw-r--r--gcc/builtin-types.def109
-rw-r--r--gcc/builtins.c1550
-rw-r--r--gcc/builtins.def1358
-rw-r--r--gcc/c-common.c772
-rw-r--r--gcc/c-common.h139
-rw-r--r--gcc/c-decl.c3366
-rw-r--r--gcc/c-errors.c18
-rw-r--r--gcc/c-format.c41
-rw-r--r--gcc/c-incpath.c29
-rw-r--r--gcc/c-lang.c78
-rw-r--r--gcc/c-lex.c29
-rw-r--r--gcc/c-objc-common.c223
-rw-r--r--gcc/c-opts.c232
-rw-r--r--gcc/c-parse.in417
-rw-r--r--gcc/c-pch.c18
-rw-r--r--gcc/c-ppoutput.c40
-rw-r--r--gcc/c-pragma.c29
-rw-r--r--gcc/c-pragma.h5
-rw-r--r--gcc/c-pretty-print.c2017
-rw-r--r--gcc/c-pretty-print.h189
-rw-r--r--gcc/c-semantics.c3
-rw-r--r--gcc/c-tree.h54
-rw-r--r--gcc/c-typeck.c1841
-rw-r--r--gcc/c.opt205
-rw-r--r--gcc/calls.c307
-rw-r--r--gcc/cfg.c98
-rw-r--r--gcc/cfganal.c30
-rw-r--r--gcc/cfgbuild.c6
-rw-r--r--gcc/cfgcleanup.c64
-rw-r--r--gcc/cfglayout.c26
-rw-r--r--gcc/cfgloop.c14
-rw-r--r--gcc/cfgloopanal.c8
-rw-r--r--gcc/cfgloopmanip.c37
-rw-r--r--gcc/cfgrtl.c43
-rw-r--r--gcc/cgraph.c164
-rw-r--r--gcc/cgraph.h73
-rw-r--r--gcc/cgraphunit.c1200
-rw-r--r--gcc/collect2.c22
-rw-r--r--gcc/combine.c284
-rw-r--r--gcc/common.opt163
-rw-r--r--gcc/config.build131
-rw-r--r--gcc/config.gcc420
-rw-r--r--gcc/config.host610
-rw-r--r--gcc/config.in58
-rw-r--r--gcc/config/alpha/alpha.c8
-rw-r--r--gcc/config/alpha/alpha.md34
-rw-r--r--gcc/config/alpha/linux.h5
-rw-r--r--gcc/config/alpha/openbsd.h16
-rw-r--r--gcc/config/alpha/t-osf-pthread5
-rw-r--r--gcc/config/alpha/t-osf44
-rw-r--r--gcc/config/arc/t-arc10
-rw-r--r--gcc/config/arm/README-interworking2
-rw-r--r--gcc/config/arm/arm.c16
-rw-r--r--gcc/config/arm/arm.h8
-rw-r--r--gcc/config/arm/arm.md28
-rw-r--r--gcc/config/arm/coff.h3
-rw-r--r--gcc/config/arm/ieee754-df.S1214
-rw-r--r--gcc/config/arm/ieee754-sf.S815
-rw-r--r--gcc/config/arm/lib1funcs.asm177
-rw-r--r--gcc/config/arm/linux-elf.h5
-rw-r--r--gcc/config/arm/pe.c4
-rw-r--r--gcc/config/arm/t-arm-elf31
-rw-r--r--gcc/config/arm/t-linux3
-rw-r--r--gcc/config/arm/t-netbsd5
-rw-r--r--gcc/config/arm/t-semi3
-rw-r--r--gcc/config/avr/avr.c9
-rw-r--r--gcc/config/avr/avr.h3
-rw-r--r--gcc/config/avr/avr.md2
-rw-r--r--gcc/config/darwin-c.c21
-rw-r--r--gcc/config/darwin-protos.h159
-rw-r--r--gcc/config/darwin.c335
-rw-r--r--gcc/config/darwin.h74
-rw-r--r--gcc/config/fp-bit.c2
-rw-r--r--gcc/config/frv/frv-asm.h10
-rw-r--r--gcc/config/frv/frv.c49
-rw-r--r--gcc/config/frv/frv.h6
-rw-r--r--gcc/config/frv/t-frv4
-rw-r--r--gcc/config/h8300/coff.h56
-rw-r--r--gcc/config/h8300/elf.h47
-rw-r--r--gcc/config/h8300/h8300-protos.h1
-rw-r--r--gcc/config/h8300/h8300.c17
-rw-r--r--gcc/config/h8300/h8300.h42
-rw-r--r--gcc/config/h8300/h8300.md67
-rw-r--r--gcc/config/i370/i370.md8
-rw-r--r--gcc/config/i370/linux.h8
-rw-r--r--gcc/config/i370/mvs.h8
-rw-r--r--gcc/config/i370/oe.h7
-rw-r--r--gcc/config/i386/cygming.h62
-rw-r--r--gcc/config/i386/cygwin.h6
-rw-r--r--gcc/config/i386/cygwin2.c10
-rw-r--r--gcc/config/i386/darwin.h10
-rw-r--r--gcc/config/i386/freebsd.h36
-rw-r--r--gcc/config/i386/gthr-win32.c2
-rw-r--r--gcc/config/i386/i386-interix.h4
-rw-r--r--gcc/config/i386/i386.c337
-rw-r--r--gcc/config/i386/i386.h6
-rw-r--r--gcc/config/i386/i386.md80
-rw-r--r--gcc/config/i386/linux.h12
-rw-r--r--gcc/config/i386/linux64.h2
-rw-r--r--gcc/config/i386/nto.h99
-rw-r--r--gcc/config/i386/scodbx.h84
-rw-r--r--gcc/config/i386/sol2.h4
-rw-r--r--gcc/config/i386/t-nto7
-rw-r--r--gcc/config/i386/winnt.c203
-rw-r--r--gcc/config/i386/xm-dgux.h4
-rw-r--r--gcc/config/i386/xm-mingw32.h30
-rw-r--r--gcc/config/i386/xm-sun.h21
-rw-r--r--gcc/config/i386/xm-sysv3.h3
-rw-r--r--gcc/config/i386/xm-vsta.h11
-rw-r--r--gcc/config/i960/i960.c2
-rw-r--r--gcc/config/ia64/hpux.h27
-rw-r--r--gcc/config/ia64/ia64-c.c10
-rw-r--r--gcc/config/ia64/ia64-protos.h211
-rw-r--r--gcc/config/ia64/ia64.c1445
-rw-r--r--gcc/config/ia64/ia64.h67
-rw-r--r--gcc/config/ia64/ia64.md40
-rw-r--r--gcc/config/ia64/libgcc-ia64.ver3
-rw-r--r--gcc/config/ia64/unwind-ia64.c8
-rw-r--r--gcc/config/linux.h5
-rw-r--r--gcc/config/lynx.h7
-rw-r--r--gcc/config/m68hc11/m68hc11.c12
-rw-r--r--gcc/config/m68k/coff.h12
-rw-r--r--gcc/config/m68k/hp310.h5
-rw-r--r--gcc/config/m68k/hp310g.h12
-rw-r--r--gcc/config/m68k/hp320.h34
-rw-r--r--gcc/config/m68k/hp320base.h40
-rw-r--r--gcc/config/m68k/hp320g.h12
-rw-r--r--gcc/config/m68k/hpux7.h7
-rw-r--r--gcc/config/m68k/lb1sf68.asm362
-rw-r--r--gcc/config/m68k/linux.h19
-rw-r--r--gcc/config/m68k/m68k-aout.h7
-rw-r--r--gcc/config/m68k/m68k-coff.h31
-rw-r--r--gcc/config/m68k/m68k-none.h75
-rw-r--r--gcc/config/m68k/m68k-protos.h80
-rw-r--r--gcc/config/m68k/m68k.c724
-rw-r--r--gcc/config/m68k/m68k.h309
-rw-r--r--gcc/config/m68k/m68k.md550
-rw-r--r--gcc/config/m68k/m68kelf.h8
-rw-r--r--gcc/config/m68k/m68kv4.h17
-rw-r--r--gcc/config/m68k/netbsd-elf.h4
-rw-r--r--gcc/config/m68k/netbsd.h9
-rw-r--r--gcc/config/m68k/openbsd.h12
-rw-r--r--gcc/config/m68k/sgs.h12
-rw-r--r--gcc/config/m68k/t-m68kbare2
-rw-r--r--gcc/config/m68k/t-m68kelf11
-rw-r--r--gcc/config/m68k/t-rtems6
-rw-r--r--gcc/config/mcore/mcore-pe.h7
-rw-r--r--gcc/config/mcore/mcore-protos.h3
-rw-r--r--gcc/config/mcore/mcore.c174
-rw-r--r--gcc/config/mcore/mcore.h11
-rw-r--r--gcc/config/mcore/mcore.md231
-rw-r--r--gcc/config/mips/5400.md9
-rw-r--r--gcc/config/mips/5500.md9
-rw-r--r--gcc/config/mips/7000.md211
-rw-r--r--gcc/config/mips/9000.md154
-rw-r--r--gcc/config/mips/elf.h80
-rw-r--r--gcc/config/mips/elf64.h47
-rw-r--r--gcc/config/mips/iris5.h25
-rw-r--r--gcc/config/mips/iris5gas.h1
-rw-r--r--gcc/config/mips/iris6-o32-as.h11
-rw-r--r--gcc/config/mips/iris6-o32.h42
-rw-r--r--gcc/config/mips/iris6.h44
-rw-r--r--gcc/config/mips/irix6-libc-compat.c86
-rw-r--r--gcc/config/mips/linux.h50
-rw-r--r--gcc/config/mips/linux64.h6
-rw-r--r--gcc/config/mips/mips-protos.h252
-rw-r--r--gcc/config/mips/mips.c2380
-rw-r--r--gcc/config/mips/mips.h711
-rw-r--r--gcc/config/mips/mips.md2956
-rw-r--r--gcc/config/mips/netbsd.h13
-rw-r--r--gcc/config/mips/openbsd-be.h21
-rw-r--r--gcc/config/mips/openbsd.h25
-rw-r--r--gcc/config/mips/sdb.h89
-rw-r--r--gcc/config/mips/sr71k.md9
-rw-r--r--gcc/config/mips/t-rtems5
-rw-r--r--gcc/config/mmix/mmix-protos.h151
-rw-r--r--gcc/config/mmix/mmix.c478
-rw-r--r--gcc/config/mn10300/linux.h116
-rw-r--r--gcc/config/mn10300/mn10300-protos.h2
-rw-r--r--gcc/config/mn10300/mn10300.c675
-rw-r--r--gcc/config/mn10300/mn10300.h168
-rw-r--r--gcc/config/mn10300/mn10300.md528
-rw-r--r--gcc/config/mn10300/t-linux11
-rw-r--r--gcc/config/mn10300/t-mn103004
-rw-r--r--gcc/config/pa/elf.h10
-rw-r--r--gcc/config/pa/fptr.c10
-rw-r--r--gcc/config/pa/lib2funcs.asm8
-rw-r--r--gcc/config/pa/long_double.h10
-rw-r--r--gcc/config/pa/milli64.S6
-rw-r--r--gcc/config/pa/pa-64.h10
-rw-r--r--gcc/config/pa/pa-hpux.h17
-rw-r--r--gcc/config/pa/pa-hpux10.h17
-rw-r--r--gcc/config/pa/pa-hpux11.h31
-rw-r--r--gcc/config/pa/pa-linux.h10
-rw-r--r--gcc/config/pa/pa-modes.def10
-rw-r--r--gcc/config/pa/pa-osf.h10
-rw-r--r--gcc/config/pa/pa-pro-end.h10
-rw-r--r--gcc/config/pa/pa-protos.h236
-rw-r--r--gcc/config/pa/pa.c804
-rw-r--r--gcc/config/pa/pa.h29
-rw-r--r--gcc/config/pa/pa.md122
-rw-r--r--gcc/config/pa/pa32-linux.h8
-rw-r--r--gcc/config/pa/pa64-hpux.h12
-rw-r--r--gcc/config/pa/pa64-linux.h8
-rw-r--r--gcc/config/pa/pa64-regs.h12
-rw-r--r--gcc/config/pa/quadlib.c8
-rw-r--r--gcc/config/pa/rtems.h8
-rw-r--r--gcc/config/pa/som.h10
-rw-r--r--gcc/config/rs6000/aix.h55
-rw-r--r--gcc/config/rs6000/altivec.h4
-rw-r--r--gcc/config/rs6000/darwin.h29
-rw-r--r--gcc/config/rs6000/host-darwin.c73
-rw-r--r--gcc/config/rs6000/linux.h3
-rw-r--r--gcc/config/rs6000/linux64.h54
-rw-r--r--gcc/config/rs6000/lynx.h25
-rw-r--r--gcc/config/rs6000/lynxbase.h45
-rw-r--r--gcc/config/rs6000/ppc64-fp.c2
-rw-r--r--gcc/config/rs6000/rs6000-c.c6
-rw-r--r--gcc/config/rs6000/rs6000-protos.h316
-rw-r--r--gcc/config/rs6000/rs6000.c1528
-rw-r--r--gcc/config/rs6000/rs6000.h12
-rw-r--r--gcc/config/rs6000/rs6000.md26
-rw-r--r--gcc/config/rs6000/spe.h1
-rw-r--r--gcc/config/rs6000/spe.md7
-rw-r--r--gcc/config/rs6000/sysv4.h6
-rw-r--r--gcc/config/s390/s390-protos.h131
-rw-r--r--gcc/config/s390/s390.c2359
-rw-r--r--gcc/config/s390/s390.h138
-rw-r--r--gcc/config/s390/s390.md2957
-rw-r--r--gcc/config/sh/embed-elf.h4
-rw-r--r--gcc/config/sh/lib1funcs.asm30
-rw-r--r--gcc/config/sh/linux.h31
-rw-r--r--gcc/config/sh/sh-protos.h8
-rw-r--r--gcc/config/sh/sh.c1273
-rw-r--r--gcc/config/sh/sh.h375
-rw-r--r--gcc/config/sh/sh.md22
-rw-r--r--gcc/config/sol2.h15
-rw-r--r--gcc/config/sparc/linux.h25
-rw-r--r--gcc/config/sparc/linux64.h14
-rw-r--r--gcc/config/sparc/openbsd.h6
-rw-r--r--gcc/config/sparc/sol2-c1.asm4
-rw-r--r--gcc/config/sparc/sparc-protos.h165
-rw-r--r--gcc/config/sparc/sparc.c1505
-rw-r--r--gcc/config/sparc/sparc.h180
-rw-r--r--gcc/config/sparc/sparc.md625
-rw-r--r--gcc/config/stormy16/stormy16.c2
-rw-r--r--gcc/config/stormy16/stormy16.h6
-rw-r--r--gcc/config/v850/t-v8509
-rw-r--r--gcc/config/v850/t-v850e96
-rw-r--r--gcc/config/v850/v850.c8
-rw-r--r--gcc/config/v850/v850.h14
-rw-r--r--gcc/config/vax/vax-protos.h12
-rw-r--r--gcc/config/vax/vax.c64
-rw-r--r--gcc/config/xtensa/crti.asm16
-rw-r--r--gcc/config/xtensa/crtn.asm14
-rw-r--r--gcc/config/xtensa/elf.h15
-rw-r--r--gcc/config/xtensa/lib1funcs.asm85
-rw-r--r--gcc/config/xtensa/lib2funcs.S2
-rw-r--r--gcc/config/xtensa/linux.h15
-rw-r--r--gcc/config/xtensa/t-xtensa8
-rw-r--r--gcc/config/xtensa/xtensa.c35
-rw-r--r--gcc/config/xtensa/xtensa.h169
-rw-r--r--gcc/config/xtensa/xtensa.md1104
-rwxr-xr-xgcc/configure2164
-rw-r--r--gcc/configure.frag77
-rw-r--r--gcc/configure.in1246
-rw-r--r--gcc/conflict.c10
-rw-r--r--gcc/convert.c30
-rw-r--r--gcc/coverage.c22
-rw-r--r--gcc/cp/ChangeLog1939
-rw-r--r--gcc/cp/Make-lang.in25
-rw-r--r--gcc/cp/NEWS70
-rw-r--r--gcc/cp/call.c474
-rw-r--r--gcc/cp/cfns.gperf1
-rw-r--r--gcc/cp/cfns.h482
-rw-r--r--gcc/cp/class.c406
-rw-r--r--gcc/cp/cp-lang.c52
-rw-r--r--gcc/cp/cp-tree.def24
-rw-r--r--gcc/cp/cp-tree.h288
-rw-r--r--gcc/cp/cvt.c161
-rw-r--r--gcc/cp/cxx-pretty-print.c1739
-rw-r--r--gcc/cp/cxx-pretty-print.h54
-rw-r--r--gcc/cp/decl.c1526
-rw-r--r--gcc/cp/decl2.c321
-rw-r--r--gcc/cp/dump.c17
-rw-r--r--gcc/cp/error.c887
-rw-r--r--gcc/cp/except.c34
-rw-r--r--gcc/cp/expr.c7
-rw-r--r--gcc/cp/friend.c56
-rw-r--r--gcc/cp/g++spec.c8
-rw-r--r--gcc/cp/init.c505
-rw-r--r--gcc/cp/lex.c269
-rw-r--r--gcc/cp/mangle.c2
-rw-r--r--gcc/cp/method.c130
-rw-r--r--gcc/cp/name-lookup.c95
-rw-r--r--gcc/cp/name-lookup.h1
-rw-r--r--gcc/cp/operators.def4
-rw-r--r--gcc/cp/optimize.c35
-rw-r--r--gcc/cp/parser.c1578
-rw-r--r--gcc/cp/pt.c1382
-rw-r--r--gcc/cp/ptree.c6
-rw-r--r--gcc/cp/rtti.c56
-rw-r--r--gcc/cp/search.c149
-rw-r--r--gcc/cp/semantics.c1171
-rw-r--r--gcc/cp/tree.c302
-rw-r--r--gcc/cp/typeck.c1070
-rw-r--r--gcc/cp/typeck2.c91
-rw-r--r--gcc/cppcharset.c774
-rw-r--r--gcc/cpperror.c51
-rw-r--r--gcc/cppexp.c7
-rw-r--r--gcc/cppfiles.c1761
-rw-r--r--gcc/cpphash.c10
-rw-r--r--gcc/cpphash.h97
-rw-r--r--gcc/cppinit.c117
-rw-r--r--gcc/cpplex.c26
-rw-r--r--gcc/cpplib.c101
-rw-r--r--gcc/cpplib.h66
-rw-r--r--gcc/cppmacro.c17
-rw-r--r--gcc/cpppch.c9
-rw-r--r--gcc/cppspec.c2
-rw-r--r--gcc/cpptrad.c16
-rw-r--r--gcc/cse.c40
-rw-r--r--gcc/cselib.c6
-rw-r--r--gcc/dbxout.c29
-rw-r--r--gcc/defaults.h2
-rw-r--r--gcc/df.c6
-rw-r--r--gcc/diagnostic.c885
-rw-r--r--gcc/diagnostic.def2
-rw-r--r--gcc/diagnostic.h162
-rw-r--r--gcc/doc/c-tree.texi25
-rw-r--r--gcc/doc/contrib.texi12
-rw-r--r--gcc/doc/cpp.texi8
-rw-r--r--gcc/doc/cppopts.texi18
-rw-r--r--gcc/doc/extend.texi574
-rw-r--r--gcc/doc/fragments.texi3
-rw-r--r--gcc/doc/gcov.texi38
-rw-r--r--gcc/doc/hostconfig.texi33
-rw-r--r--gcc/doc/include/texinfo.tex1725
-rw-r--r--gcc/doc/install.texi207
-rw-r--r--gcc/doc/invoke.texi605
-rw-r--r--gcc/doc/makefile.texi27
-rw-r--r--gcc/doc/md.texi22
-rw-r--r--gcc/doc/passes.texi5
-rw-r--r--gcc/doc/rtl.texi6
-rw-r--r--gcc/doc/sourcebuild.texi48
-rw-r--r--gcc/doc/tm.texi249
-rw-r--r--gcc/doc/trouble.texi52
-rw-r--r--gcc/dojump.c43
-rw-r--r--gcc/dominance.c8
-rw-r--r--gcc/dwarf2asm.c9
-rw-r--r--gcc/dwarf2out.c141
-rw-r--r--gcc/dwarfout.c42
-rw-r--r--gcc/emit-rtl.c60
-rw-r--r--gcc/except.c68
-rw-r--r--gcc/explow.c29
-rw-r--r--gcc/expmed.c37
-rw-r--r--gcc/expr.c441
-rw-r--r--gcc/expr.h61
-rw-r--r--gcc/f/ChangeLog58
-rw-r--r--gcc/f/com.c37
-rw-r--r--gcc/f/data.c4
-rw-r--r--gcc/f/expr.c3
-rw-r--r--gcc/f/ffe.texi14
-rw-r--r--gcc/f/fini.c2
-rw-r--r--gcc/f/g77.texi7
-rw-r--r--gcc/f/g77spec.c2
-rw-r--r--gcc/f/global.c17
-rw-r--r--gcc/f/lab.c2
-rw-r--r--gcc/f/lang-specs.h2
-rw-r--r--gcc/f/lang.opt86
-rw-r--r--gcc/f/lex.c15
-rw-r--r--gcc/f/name.c5
-rw-r--r--gcc/f/news.texi6
-rw-r--r--gcc/f/sta.c18
-rw-r--r--gcc/f/stc.c2
-rw-r--r--gcc/f/std.c16
-rw-r--r--gcc/f/storag.c3
-rw-r--r--gcc/f/stt.c44
-rw-r--r--gcc/f/stw.c6
-rw-r--r--gcc/f/symbol.c15
-rw-r--r--gcc/f/target.c5
-rw-r--r--gcc/f/type.c13
-rw-r--r--gcc/final.c63
-rw-r--r--gcc/fix-header.c98
-rw-r--r--gcc/fixinc/fixfixes.c37
-rwxr-xr-xgcc/fixinc/fixinc.svr4276
-rw-r--r--gcc/fixinc/fixincl.c110
-rwxr-xr-xgcc/fixinc/fixincl.sh4
-rw-r--r--gcc/fixinc/fixincl.x241
-rw-r--r--gcc/fixinc/fixlib.c32
-rw-r--r--gcc/fixinc/fixlib.h20
-rw-r--r--gcc/fixinc/fixtests.c16
-rw-r--r--gcc/fixinc/inclhack.def239
-rwxr-xr-xgcc/fixinc/mkfixinc.sh24
-rw-r--r--gcc/fixinc/procopen.c13
-rw-r--r--gcc/fixinc/server.c27
-rw-r--r--gcc/fixinc/server.h11
-rw-r--r--gcc/fixinc/tests/base/math.h1
-rw-r--r--gcc/fixinc/tests/base/pthread.h7
-rw-r--r--gcc/fixinc/tests/base/regexp.h18
-rw-r--r--gcc/fixinc/tests/base/string.h6
-rw-r--r--gcc/fixinc/tests/base/sys/regset.h2
-rw-r--r--gcc/fixinc/tests/base/sys/signal.h7
-rw-r--r--gcc/flags.h9
-rw-r--r--gcc/flow.c21
-rw-r--r--gcc/fold-const.c1123
-rw-r--r--gcc/fp-test.c4
-rw-r--r--gcc/function.c445
-rw-r--r--gcc/function.h42
-rw-r--r--gcc/gcc.c239
-rwxr-xr-xgcc/gccbug.in4
-rw-r--r--gcc/gccspec.c2
-rw-r--r--gcc/gcov-dump.c33
-rw-r--r--gcc/gcov-io.c74
-rw-r--r--gcc/gcov-io.h69
-rw-r--r--gcc/gcov.c76
-rw-r--r--gcc/gcse.c577
-rw-r--r--gcc/genattr.c3
-rw-r--r--gcc/genattrtab.c65
-rw-r--r--gcc/genautomata.c15
-rw-r--r--gcc/genconditions.c2
-rw-r--r--gcc/genemit.c5
-rw-r--r--gcc/genextract.c18
-rw-r--r--gcc/gengtype-lex.l2
-rw-r--r--gcc/gengtype.c16
-rw-r--r--gcc/genoutput.c8
-rw-r--r--gcc/genrecog.c11
-rw-r--r--gcc/gensupport.c9
-rw-r--r--gcc/ggc-common.c129
-rw-r--r--gcc/ggc-page.c117
-rw-r--r--gcc/ggc-simple.c2
-rw-r--r--gcc/ggc.h15
-rw-r--r--gcc/global.c27
-rw-r--r--gcc/graph.c13
-rw-r--r--gcc/gthr-posix.c207
-rw-r--r--gcc/gthr-posix.h12
-rw-r--r--gcc/haifa-sched.c30
-rw-r--r--gcc/hard-reg-set.h4
-rw-r--r--gcc/hashtable.c83
-rw-r--r--gcc/hashtable.h7
-rw-r--r--gcc/hooks.c15
-rw-r--r--gcc/hooks.h2
-rw-r--r--gcc/hosthooks-def.h6
-rw-r--r--gcc/hosthooks.h3
-rw-r--r--gcc/ifcvt.c47
-rw-r--r--gcc/input.h4
-rw-r--r--gcc/integrate.c46
-rw-r--r--gcc/integrate.h8
-rw-r--r--gcc/intl.h2
-rw-r--r--gcc/java/ChangeLog199
-rw-r--r--gcc/java/Make-lang.in9
-rw-r--r--gcc/java/builtins.c27
-rw-r--r--gcc/java/check-init.c4
-rw-r--r--gcc/java/class.c91
-rw-r--r--gcc/java/decl.c78
-rw-r--r--gcc/java/except.c34
-rw-r--r--gcc/java/expr.c28
-rw-r--r--gcc/java/gcj.texi37
-rw-r--r--gcc/java/java-tree.h47
-rw-r--r--gcc/java/jcf-parse.c8
-rw-r--r--gcc/java/jcf-write.c57
-rw-r--r--gcc/java/jcf.h3
-rw-r--r--gcc/java/jvspec.c18
-rw-r--r--gcc/java/lang.c23
-rw-r--r--gcc/java/lang.opt26
-rw-r--r--gcc/java/mangle.c19
-rw-r--r--gcc/java/parse.h1
-rw-r--r--gcc/java/parse.y330
-rw-r--r--gcc/java/typeck.c184
-rw-r--r--gcc/java/win32-host.c2
-rw-r--r--gcc/jump.c4
-rw-r--r--gcc/langhooks-def.h40
-rw-r--r--gcc/langhooks.c120
-rw-r--r--gcc/langhooks.h88
-rw-r--r--gcc/lcm.c18
-rw-r--r--gcc/libgcc-std.ver12
-rw-r--r--gcc/libgcov.c219
-rw-r--r--gcc/line-map.c47
-rw-r--r--gcc/line-map.h28
-rw-r--r--gcc/local-alloc.c30
-rw-r--r--gcc/longlong.h53
-rw-r--r--gcc/loop-unswitch.c4
-rw-r--r--gcc/loop.c234
-rw-r--r--gcc/mips-tdump.c88
-rw-r--r--gcc/mips-tfile.c56
-rw-r--r--gcc/mkdeps.c13
-rw-r--r--gcc/mkheaders.in14
-rw-r--r--gcc/mkinstalldirs111
-rw-r--r--gcc/mklibgcc.in12
-rw-r--r--gcc/mkmap-symver.awk16
-rw-r--r--gcc/objc/Make-lang.in10
-rw-r--r--gcc/objc/config-lang.in2
-rw-r--r--gcc/objc/lang-specs.h4
-rw-r--r--gcc/objc/objc-act.c4199
-rw-r--r--gcc/objc/objc-act.h167
-rw-r--r--gcc/objc/objc-lang.c12
-rw-r--r--gcc/objc/objc-tree.def4
-rw-r--r--gcc/optabs.c60
-rw-r--r--gcc/opts.c308
-rw-r--r--gcc/opts.h10
-rw-r--r--gcc/opts.sh20
-rw-r--r--gcc/output.h29
-rw-r--r--gcc/params.c6
-rw-r--r--gcc/params.def31
-rw-r--r--gcc/po/exgettext15
-rw-r--r--gcc/postreload.c14
-rw-r--r--gcc/predict.c4
-rw-r--r--gcc/prefix.c6
-rw-r--r--gcc/pretty-print.c547
-rw-r--r--gcc/pretty-print.h273
-rw-r--r--gcc/print-tree.c12
-rw-r--r--gcc/profile.c64
-rw-r--r--gcc/protoize.c432
-rw-r--r--gcc/ra-build.c351
-rw-r--r--gcc/ra-colorize.c292
-rw-r--r--gcc/ra-debug.c82
-rw-r--r--gcc/ra-rewrite.c161
-rw-r--r--gcc/ra.c76
-rw-r--r--gcc/ra.h110
-rw-r--r--gcc/real.c24
-rw-r--r--gcc/real.h9
-rw-r--r--gcc/recog.c12
-rw-r--r--gcc/reg-stack.c50
-rw-r--r--gcc/regclass.c71
-rw-r--r--gcc/regmove.c10
-rw-r--r--gcc/regrename.c9
-rw-r--r--gcc/regs.h2
-rw-r--r--gcc/reload.c4
-rw-r--r--gcc/reload1.c67
-rw-r--r--gcc/reorg.c20
-rw-r--r--gcc/resource.c7
-rw-r--r--gcc/rtl.c2
-rw-r--r--gcc/rtl.def6
-rw-r--r--gcc/rtl.h15
-rw-r--r--gcc/rtlanal.c35
-rw-r--r--gcc/sbitmap.c6
-rw-r--r--gcc/sched-deps.c26
-rw-r--r--gcc/sched-ebb.c27
-rw-r--r--gcc/sched-int.h5
-rw-r--r--gcc/sched-rgn.c56
-rw-r--r--gcc/sched-vis.c2
-rw-r--r--gcc/sdbout.c6
-rw-r--r--gcc/simplify-rtx.c432
-rw-r--r--gcc/ssa-ccp.c4
-rw-r--r--gcc/ssa.c17
-rw-r--r--gcc/stmt.c168
-rw-r--r--gcc/stor-layout.c123
-rw-r--r--gcc/stringpool.c4
-rw-r--r--gcc/stub-objc.c71
-rw-r--r--gcc/system.h10
-rw-r--r--gcc/target-def.h26
-rw-r--r--gcc/target.h17
-rw-r--r--gcc/targhooks.c191
-rw-r--r--gcc/targhooks.h31
-rw-r--r--gcc/testsuite/ChangeLog1188
-rw-r--r--gcc/testsuite/g++.dg/README1
-rw-r--r--gcc/testsuite/g++.dg/abi/bitfield11.C14
-rw-r--r--gcc/testsuite/g++.dg/abi/bitfield12.C5
-rw-r--r--gcc/testsuite/g++.dg/abi/layout4.C18
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/bitfield1_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/bitfield1_y.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/bitfield2_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/bitfield2_y.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-10_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-10_y.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-21_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-21_y.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-22_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-22_y.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-4_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/abi/vbase8-4_y.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/break/bitfield7_x.C2
-rw-r--r--gcc/testsuite/g++.dg/compat/break/bitfield7_y.C2
-rw-r--r--gcc/testsuite/g++.dg/conversion/cond6.C18
-rw-r--r--gcc/testsuite/g++.dg/conversion/ptrmem1.C13
-rw-r--r--gcc/testsuite/g++.dg/debug/debug8.C2
-rw-r--r--gcc/testsuite/g++.dg/eh/crossjump1.C31
-rw-r--r--gcc/testsuite/g++.dg/eh/delayslot1.C47
-rw-r--r--gcc/testsuite/g++.dg/eh/simd-2.C1
-rw-r--r--gcc/testsuite/g++.dg/expr/call1.C16
-rw-r--r--gcc/testsuite/g++.dg/expr/call2.C14
-rw-r--r--gcc/testsuite/g++.dg/expr/comma1.C21
-rw-r--r--gcc/testsuite/g++.dg/expr/cond2.C12
-rw-r--r--gcc/testsuite/g++.dg/expr/cond3.C6
-rw-r--r--gcc/testsuite/g++.dg/expr/crash-1.C15
-rw-r--r--gcc/testsuite/g++.dg/expr/enum1.C10
-rw-r--r--gcc/testsuite/g++.dg/expr/lval1.C7
-rw-r--r--gcc/testsuite/g++.dg/expr/ptrmem1.C33
-rw-r--r--gcc/testsuite/g++.dg/expr/static_cast4.C11
-rw-r--r--gcc/testsuite/g++.dg/expr/static_cast5.C17
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-1.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/dll-MI1.h39
-rw-r--r--gcc/testsuite/g++.dg/ext/dllexport-MI1.C51
-rw-r--r--gcc/testsuite/g++.dg/ext/dllimport-MI1.C53
-rw-r--r--gcc/testsuite/g++.dg/ext/flexary1.C33
-rw-r--r--gcc/testsuite/g++.dg/ext/fnname1.C26
-rw-r--r--gcc/testsuite/g++.dg/ext/fnname2.C31
-rw-r--r--gcc/testsuite/g++.dg/ext/fnname3.C65
-rw-r--r--gcc/testsuite/g++.dg/ext/label1.C8
-rw-r--r--gcc/testsuite/g++.dg/ext/label2.C11
-rw-r--r--gcc/testsuite/g++.dg/ext/lvcast.C11
-rw-r--r--gcc/testsuite/g++.dg/ext/packed2.C11
-rw-r--r--gcc/testsuite/g++.dg/ext/packed3.C25
-rw-r--r--gcc/testsuite/g++.dg/ext/packed4.C80
-rw-r--r--gcc/testsuite/g++.dg/ext/stmtexpr1.C54
-rw-r--r--gcc/testsuite/g++.dg/inherit/access4.C8
-rw-r--r--gcc/testsuite/g++.dg/inherit/access5.C4
-rw-r--r--gcc/testsuite/g++.dg/inherit/conv1.C23
-rw-r--r--gcc/testsuite/g++.dg/inherit/multiple1.C20
-rw-r--r--gcc/testsuite/g++.dg/init/array11.C28
-rw-r--r--gcc/testsuite/g++.dg/init/enum2.C9
-rw-r--r--gcc/testsuite/g++.dg/init/init-ref4.C22
-rw-r--r--gcc/testsuite/g++.dg/init/new8.C17
-rw-r--r--gcc/testsuite/g++.dg/init/ref8.C10
-rw-r--r--gcc/testsuite/g++.dg/init/ref9.C36
-rw-r--r--gcc/testsuite/g++.dg/init/struct1.C6
-rw-r--r--gcc/testsuite/g++.dg/lookup/crash1.C31
-rw-r--r--gcc/testsuite/g++.dg/lookup/koenig2.C15
-rw-r--r--gcc/testsuite/g++.dg/lookup/scoped7.C20
-rw-r--r--gcc/testsuite/g++.dg/lookup/struct1.C4
-rw-r--r--gcc/testsuite/g++.dg/lookup/using7.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/call1.C21
-rw-r--r--gcc/testsuite/g++.dg/opt/cfg1.C36
-rw-r--r--gcc/testsuite/g++.dg/opt/cfg3.C61
-rw-r--r--gcc/testsuite/g++.dg/opt/inline4.C13
-rw-r--r--gcc/testsuite/g++.dg/opt/longbranch2.C62
-rw-r--r--gcc/testsuite/g++.dg/opt/ptrmem3.C23
-rw-r--r--gcc/testsuite/g++.dg/opt/reg-stack2.C34
-rw-r--r--gcc/testsuite/g++.dg/opt/static3.C35
-rw-r--r--gcc/testsuite/g++.dg/opt/tmp1.C48
-rw-r--r--gcc/testsuite/g++.dg/opt/vtgc1.C136
-rw-r--r--gcc/testsuite/g++.dg/other/crash-1.C3
-rw-r--r--gcc/testsuite/g++.dg/other/error2.C2
-rw-r--r--gcc/testsuite/g++.dg/other/field1.C25
-rw-r--r--gcc/testsuite/g++.dg/other/gc2.C38
-rw-r--r--gcc/testsuite/g++.dg/other/opaque-1.C29
-rw-r--r--gcc/testsuite/g++.dg/other/opaque-2.C18
-rw-r--r--gcc/testsuite/g++.dg/other/opaque-3.C11
-rw-r--r--gcc/testsuite/g++.dg/other/packed1.C2
-rw-r--r--gcc/testsuite/g++.dg/other/static1.C17
-rw-r--r--gcc/testsuite/g++.dg/overload/VLA.C16
-rw-r--r--gcc/testsuite/g++.dg/overload/addr1.C50
-rw-r--r--gcc/testsuite/g++.dg/overload/builtin3.C10
-rw-r--r--gcc/testsuite/g++.dg/overload/operator1.C34
-rw-r--r--gcc/testsuite/g++.dg/overload/prom1.C9
-rw-r--r--gcc/testsuite/g++.dg/overload/template1.C12
-rw-r--r--gcc/testsuite/g++.dg/parse/access3.C14
-rw-r--r--gcc/testsuite/g++.dg/parse/access4.C20
-rw-r--r--gcc/testsuite/g++.dg/parse/access5.C18
-rw-r--r--gcc/testsuite/g++.dg/parse/access6.C24
-rw-r--r--gcc/testsuite/g++.dg/parse/ambig3.C12
-rw-r--r--gcc/testsuite/g++.dg/parse/args1.C12
-rw-r--r--gcc/testsuite/g++.dg/parse/condexpr1.C13
-rw-r--r--gcc/testsuite/g++.dg/parse/constant3.C7
-rw-r--r--gcc/testsuite/g++.dg/parse/constant4.C40
-rw-r--r--gcc/testsuite/g++.dg/parse/crash10.C13
-rw-r--r--gcc/testsuite/g++.dg/parse/crash11.C34
-rw-r--r--gcc/testsuite/g++.dg/parse/crash12.C24
-rw-r--r--gcc/testsuite/g++.dg/parse/crash7.C10
-rw-r--r--gcc/testsuite/g++.dg/parse/crash9.C9
-rw-r--r--gcc/testsuite/g++.dg/parse/def-tmpl-arg1.C9
-rw-r--r--gcc/testsuite/g++.dg/parse/defarg5.C15
-rw-r--r--gcc/testsuite/g++.dg/parse/dtor2.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/elab2.C7
-rw-r--r--gcc/testsuite/g++.dg/parse/friend3.C10
-rw-r--r--gcc/testsuite/g++.dg/parse/funptr1.C13
-rw-r--r--gcc/testsuite/g++.dg/parse/invalid-op1.C13
-rw-r--r--gcc/testsuite/g++.dg/parse/non-dependent2.C37
-rw-r--r--gcc/testsuite/g++.dg/parse/operator2.C15
-rw-r--r--gcc/testsuite/g++.dg/parse/operator3.C11
-rw-r--r--gcc/testsuite/g++.dg/parse/operator4.C1
-rw-r--r--gcc/testsuite/g++.dg/parse/qualified2.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/ret-type2.C5
-rw-r--r--gcc/testsuite/g++.dg/parse/template10.C15
-rw-r--r--gcc/testsuite/g++.dg/parse/template11.C15
-rw-r--r--gcc/testsuite/g++.dg/parse/template12.C10
-rw-r--r--gcc/testsuite/g++.dg/parse/template8.C16
-rw-r--r--gcc/testsuite/g++.dg/parse/template9.C5
-rw-r--r--gcc/testsuite/g++.dg/parse/typedef3.C7
-rw-r--r--gcc/testsuite/g++.dg/parse/typedef4.C12
-rw-r--r--gcc/testsuite/g++.dg/parse/typedef5.C6
-rw-r--r--gcc/testsuite/g++.dg/parse/using2.C8
-rw-r--r--gcc/testsuite/g++.dg/parse/using3.C22
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid2.C15
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid3.C11
-rw-r--r--gcc/testsuite/g++.dg/template/access12.C13
-rw-r--r--gcc/testsuite/g++.dg/template/anon1.C21
-rw-r--r--gcc/testsuite/g++.dg/template/call1.C17
-rw-r--r--gcc/testsuite/g++.dg/template/class1.C9
-rw-r--r--gcc/testsuite/g++.dg/template/crash10.C27
-rw-r--r--gcc/testsuite/g++.dg/template/crash11.C9
-rw-r--r--gcc/testsuite/g++.dg/template/crash4.C12
-rw-r--r--gcc/testsuite/g++.dg/template/crash6.C8
-rw-r--r--gcc/testsuite/g++.dg/template/crash7.C13
-rw-r--r--gcc/testsuite/g++.dg/template/crash8.C20
-rw-r--r--gcc/testsuite/g++.dg/template/crash9.C12
-rw-r--r--gcc/testsuite/g++.dg/template/deduce2.C30
-rw-r--r--gcc/testsuite/g++.dg/template/defarg3.C16
-rw-r--r--gcc/testsuite/g++.dg/template/dependent-expr2.C23
-rw-r--r--gcc/testsuite/g++.dg/template/dependent-name2.C18
-rw-r--r--gcc/testsuite/g++.dg/template/dtor2.C10
-rw-r--r--gcc/testsuite/g++.dg/template/elab1.C13
-rw-r--r--gcc/testsuite/g++.dg/template/error2.C28
-rw-r--r--gcc/testsuite/g++.dg/template/explicit2.C10
-rw-r--r--gcc/testsuite/g++.dg/template/explicit3.C22
-rw-r--r--gcc/testsuite/g++.dg/template/explicit4.C14
-rw-r--r--gcc/testsuite/g++.dg/template/explicit5.C14
-rw-r--r--gcc/testsuite/g++.dg/template/friend15.C19
-rw-r--r--gcc/testsuite/g++.dg/template/friend20.C15
-rw-r--r--gcc/testsuite/g++.dg/template/friend21.C16
-rw-r--r--gcc/testsuite/g++.dg/template/friend22.C15
-rw-r--r--gcc/testsuite/g++.dg/template/friend23.C38
-rw-r--r--gcc/testsuite/g++.dg/template/friend24.C27
-rw-r--r--gcc/testsuite/g++.dg/template/init3.C11
-rw-r--r--gcc/testsuite/g++.dg/template/koenig1.C8
-rw-r--r--gcc/testsuite/g++.dg/template/koenig2.C25
-rw-r--r--gcc/testsuite/g++.dg/template/lookup1.C17
-rw-r--r--gcc/testsuite/g++.dg/template/lookup2.C18
-rw-r--r--gcc/testsuite/g++.dg/template/memclass1.C2
-rw-r--r--gcc/testsuite/g++.dg/template/memtmpl1.C20
-rw-r--r--gcc/testsuite/g++.dg/template/memtmpl2.C15
-rw-r--r--gcc/testsuite/g++.dg/template/nested4.C10
-rw-r--r--gcc/testsuite/g++.dg/template/non-dependent1.C21
-rw-r--r--gcc/testsuite/g++.dg/template/non-dependent2.C16
-rw-r--r--gcc/testsuite/g++.dg/template/non-dependent3.C15
-rw-r--r--gcc/testsuite/g++.dg/template/non-dependent4.C4
-rw-r--r--gcc/testsuite/g++.dg/template/non-type-template-argument-1.C12
-rw-r--r--gcc/testsuite/g++.dg/template/nontype2.C11
-rw-r--r--gcc/testsuite/g++.dg/template/operator1.C49
-rw-r--r--gcc/testsuite/g++.dg/template/overload1.C1
-rw-r--r--gcc/testsuite/g++.dg/template/overload2.C15
-rw-r--r--gcc/testsuite/g++.dg/template/partial2.C14
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem6.C10
-rw-r--r--gcc/testsuite/g++.dg/template/qualified-id1.C26
-rw-r--r--gcc/testsuite/g++.dg/template/scope1.C12
-rw-r--r--gcc/testsuite/g++.dg/template/scope2.C34
-rw-r--r--gcc/testsuite/g++.dg/template/sizeof5.C15
-rw-r--r--gcc/testsuite/g++.dg/template/ttp3.C6
-rw-r--r--gcc/testsuite/g++.dg/template/type2.C16
-rw-r--r--gcc/testsuite/g++.dg/template/using1.C42
-rw-r--r--gcc/testsuite/g++.dg/template/using2.C30
-rw-r--r--gcc/testsuite/g++.dg/template/using3.C42
-rw-r--r--gcc/testsuite/g++.dg/template/using4.C39
-rw-r--r--gcc/testsuite/g++.dg/template/using5.C17
-rw-r--r--gcc/testsuite/g++.dg/template/using6.C14
-rw-r--r--gcc/testsuite/g++.dg/template/using7.C21
-rw-r--r--gcc/testsuite/g++.dg/template/warn1.C36
-rw-r--r--gcc/testsuite/g++.dg/warn/Winline-1.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wsign-compare-1.C6
-rw-r--r--gcc/testsuite/g++.dg/warn/Wunused-4.C30
-rw-r--r--gcc/testsuite/g++.dg/warn/noeffect2.C18
-rw-r--r--gcc/testsuite/g++.dg/warn/noeffect4.C88
-rw-r--r--gcc/testsuite/g++.dg/warn/pedantic1.C11
-rw-r--r--gcc/testsuite/g++.dg/warn/template-1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/tem06.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib5.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/pretty2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/pretty3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/access17.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/overload33.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template36.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility13.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p1989.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.niklas/t135.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash18.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl5.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash36.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/defarg8.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/derived3.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/lookup2.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/overload8.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp20.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp21.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp41.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp43.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp44.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/typename13.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/union2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb133.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb42.C19
-rw-r--r--gcc/testsuite/g77.f-torture/compile/12002.f5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030707-1.c13
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030708-1.c13
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030725-1.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030804-1.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030821-1.c24
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030903-1.c33
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030904-1.c94
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030907-1.c25
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030921-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/mangle-1.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/mipscop-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/mipscop-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/mipscop-3.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/mipscop-4.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/zero-strct-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030714-1.c193
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030715-1.c35
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030717-1.c69
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030718-1.c13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030811-1.c35
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030821-1.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030914-1.c26
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030914-2.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030920-1.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c19
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/string-9-lib.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/string-9.c79
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/string-opt-10.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/string-opt-8.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/string-opt-9.c55
-rw-r--r--gcc/testsuite/gcc.dg/20020313-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/20021018-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/20030505.c3
-rw-r--r--gcc/testsuite/gcc.dg/20030702-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/20030711-1.c25
-rw-r--r--gcc/testsuite/gcc.dg/20030717-1.c24
-rw-r--r--gcc/testsuite/gcc.dg/20030721-1.c41
-rw-r--r--gcc/testsuite/gcc.dg/20030804-1.c75
-rw-r--r--gcc/testsuite/gcc.dg/20030811-1.c59
-rw-r--r--gcc/testsuite/gcc.dg/20030815-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/20030820-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/20030826-1.c33
-rw-r--r--gcc/testsuite/gcc.dg/20030826-2.c64
-rw-r--r--gcc/testsuite/gcc.dg/20030906-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/20030906-2.c21
-rw-r--r--gcc/testsuite/gcc.dg/20030909-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c26
-rw-r--r--gcc/testsuite/gcc.dg/Wold-style-definition-1.c24
-rw-r--r--gcc/testsuite/gcc.dg/asm-8.c9
-rw-r--r--gcc/testsuite/gcc.dg/asm-names.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-warn-unused-result.c188
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply1.c9
-rw-r--r--gcc/testsuite/gcc.dg/builtins-1.c217
-rw-r--r--gcc/testsuite/gcc.dg/builtins-27.c47
-rw-r--r--gcc/testsuite/gcc.dg/builtins-3.c90
-rw-r--r--gcc/testsuite/gcc.dg/builtins-4.c25
-rw-r--r--gcc/testsuite/gcc.dg/builtins-5.c45
-rw-r--r--gcc/testsuite/gcc.dg/c99-bool-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-8.c97
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-9.c101
-rw-r--r--gcc/testsuite/gcc.dg/compat/mixed-struct-check.h28
-rw-r--r--gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h14
-rw-r--r--gcc/testsuite/gcc.dg/compat/mixed-struct-init.h26
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c17
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c178
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c105
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c16
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c166
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c99
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-19_main.c16
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-19_x.c123
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-19_y.c70
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-20_main.c14
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-20_x.c111
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-20_y.c64
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-1_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-1_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-2_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-2_y.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/import1.c16
-rw-r--r--gcc/testsuite/gcc.dg/cpp/import1.h6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/import2.c11
-rw-r--r--gcc/testsuite/gcc.dg/cpp/import2.h4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/include2.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/separate-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/cpp/spacing1.c15
-rw-r--r--gcc/testsuite/gcc.dg/darwin-ld-6.c11
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/i386-387-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/i386-387-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/i386-asm-1.c24
-rw-r--r--gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c9
-rw-r--r--gcc/testsuite/gcc.dg/ia64-types1.c41
-rw-r--r--gcc/testsuite/gcc.dg/ia64-types2.c20
-rw-r--r--gcc/testsuite/gcc.dg/intermod-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/20030818-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/incomplete-2.c12
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/label-1.c175
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/pack-test-3.c44
-rw-r--r--gcc/testsuite/gcc.dg/pch/inline-3.c5
-rw-r--r--gcc/testsuite/gcc.dg/pch/inline-3.hs7
-rw-r--r--gcc/testsuite/gcc.dg/pch/inline-4.c5
-rw-r--r--gcc/testsuite/gcc.dg/pch/inline-4.hs4
-rw-r--r--gcc/testsuite/gcc.dg/pch/warn-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/pch/warn-1.hs5
-rw-r--r--gcc/testsuite/gcc.dg/spe1.c14
-rw-r--r--gcc/testsuite/gcc.dg/struct-in-proto-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tls/opt-7.c13
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-attr-1.c375
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-explog-1.c185
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-math-1.c131
-rw-r--r--gcc/testsuite/gcc.dg/ultrasp10.c25
-rw-r--r--gcc/testsuite/gcc.dg/uninit-D.c9
-rw-r--r--gcc/testsuite/gcc.dg/uninit-E.c9
-rw-r--r--gcc/testsuite/gcc.dg/uninit-F.c9
-rw-r--r--gcc/testsuite/gcc.dg/uninit-G.c9
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-10b.c16
-rw-r--r--gcc/testsuite/gcc.misc-tests/i386-prefetch.exp28
-rw-r--r--gcc/testsuite/gcc.misc-tests/linkage.exp5
-rw-r--r--gcc/testsuite/lib/compat.exp108
-rw-r--r--gcc/testsuite/lib/dg-pch.exp4
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp2
-rw-r--r--gcc/testsuite/lib/objc.exp8
-rw-r--r--gcc/testsuite/objc.dg/anon-1.m14
-rw-r--r--gcc/testsuite/objc.dg/bitfield-2.m2
-rw-r--r--gcc/testsuite/objc.dg/bitfield-3.m50
-rw-r--r--gcc/testsuite/objc.dg/bitfield-4.m29
-rw-r--r--gcc/testsuite/objc.dg/call-super-1.m76
-rw-r--r--gcc/testsuite/objc.dg/call-super-2.m139
-rw-r--r--gcc/testsuite/objc.dg/call-super-3.m54
-rw-r--r--gcc/testsuite/objc.dg/category-1.m43
-rw-r--r--gcc/testsuite/objc.dg/class-2.m5
-rw-r--r--gcc/testsuite/objc.dg/comp-types-1.m2
-rw-r--r--gcc/testsuite/objc.dg/comp-types-4.m5
-rw-r--r--gcc/testsuite/objc.dg/const-str-1.m9
-rw-r--r--gcc/testsuite/objc.dg/const-str-3.m46
-rw-r--r--gcc/testsuite/objc.dg/const-str-4.m31
-rw-r--r--gcc/testsuite/objc.dg/const-str-5.m27
-rw-r--r--gcc/testsuite/objc.dg/const-str-6.m27
-rw-r--r--gcc/testsuite/objc.dg/desig-init-1.m5
-rw-r--r--gcc/testsuite/objc.dg/encode-1.m25
-rw-r--r--gcc/testsuite/objc.dg/encode-2.m97
-rw-r--r--gcc/testsuite/objc.dg/encode-3.m66
-rw-r--r--gcc/testsuite/objc.dg/encode-4.m73
-rw-r--r--gcc/testsuite/objc.dg/func-ptr-1.m48
-rw-r--r--gcc/testsuite/objc.dg/gnu-runtime-1.m19
-rw-r--r--gcc/testsuite/objc.dg/headers.m15
-rw-r--r--gcc/testsuite/objc.dg/image-info.m38
-rw-r--r--gcc/testsuite/objc.dg/method-1.m12
-rw-r--r--gcc/testsuite/objc.dg/method-10.m32
-rw-r--r--gcc/testsuite/objc.dg/method-11.m33
-rw-r--r--gcc/testsuite/objc.dg/method-12.m25
-rw-r--r--gcc/testsuite/objc.dg/method-2.m9
-rw-r--r--gcc/testsuite/objc.dg/method-3.m45
-rw-r--r--gcc/testsuite/objc.dg/method-4.m25
-rw-r--r--gcc/testsuite/objc.dg/method-5.m18
-rw-r--r--gcc/testsuite/objc.dg/method-6.m26
-rw-r--r--gcc/testsuite/objc.dg/method-7.m27
-rw-r--r--gcc/testsuite/objc.dg/method-8.m14
-rw-r--r--gcc/testsuite/objc.dg/method-9.m43
-rw-r--r--gcc/testsuite/objc.dg/missing-proto-1.m6
-rw-r--r--gcc/testsuite/objc.dg/missing-proto-2.m5
-rw-r--r--gcc/testsuite/objc.dg/missing-proto-3.m26
-rw-r--r--gcc/testsuite/objc.dg/nested-func-1.m37
-rw-r--r--gcc/testsuite/objc.dg/proto-hier-1.m6
-rw-r--r--gcc/testsuite/objc.dg/proto-lossage-1.m7
-rw-r--r--gcc/testsuite/objc.dg/proto-lossage-2.m20
-rw-r--r--gcc/testsuite/objc.dg/proto-qual-1.m48
-rw-r--r--gcc/testsuite/objc.dg/sizeof-1.m33
-rw-r--r--gcc/testsuite/objc.dg/special/unclaimed-category-1.h5
-rw-r--r--gcc/testsuite/objc.dg/special/unclaimed-category-1.m3
-rw-r--r--gcc/testsuite/objc.dg/static-1.m33
-rw-r--r--gcc/testsuite/objc.dg/symtab-1.m24
-rw-r--r--gcc/testsuite/objc.dg/try-catch-1.m44
-rw-r--r--gcc/testsuite/objc.dg/try-catch-2.m85
-rw-r--r--gcc/testsuite/objc.dg/try-catch-3.m19
-rw-r--r--gcc/testsuite/objc.dg/try-catch-4.m26
-rw-r--r--gcc/testsuite/objc.dg/type-size-1.m17
-rw-r--r--gcc/testsuite/objc.dg/type-size-2.m58
-rw-r--r--gcc/testsuite/objc.dg/zero-link-1.m28
-rw-r--r--gcc/testsuite/objc.dg/zero-link-2.m28
-rw-r--r--gcc/testsuite/objc/execute/IMP.m2
-rw-r--r--gcc/testsuite/objc/execute/_cmd.m5
-rw-r--r--gcc/testsuite/objc/execute/bf-common.h6
-rw-r--r--gcc/testsuite/objc/execute/bycopy-3.m4
-rw-r--r--gcc/testsuite/objc/execute/cascading-1.m33
-rw-r--r--gcc/testsuite/objc/execute/class-1.m2
-rw-r--r--gcc/testsuite/objc/execute/class-10.m5
-rw-r--r--gcc/testsuite/objc/execute/class-11.m5
-rw-r--r--gcc/testsuite/objc/execute/class-12.m5
-rw-r--r--gcc/testsuite/objc/execute/class-13.m5
-rw-r--r--gcc/testsuite/objc/execute/class-14.m5
-rw-r--r--gcc/testsuite/objc/execute/class-2.m2
-rw-r--r--gcc/testsuite/objc/execute/class-3.m2
-rw-r--r--gcc/testsuite/objc/execute/class-4.m5
-rw-r--r--gcc/testsuite/objc/execute/class-5.m5
-rw-r--r--gcc/testsuite/objc/execute/class-6.m5
-rw-r--r--gcc/testsuite/objc/execute/class-7.m12
-rw-r--r--gcc/testsuite/objc/execute/class-8.m5
-rw-r--r--gcc/testsuite/objc/execute/class-9.m5
-rw-r--r--gcc/testsuite/objc/execute/class-tests-2.h2
-rw-r--r--gcc/testsuite/objc/execute/class_self-1.m3
-rw-r--r--gcc/testsuite/objc/execute/class_self-2.m6
-rw-r--r--gcc/testsuite/objc/execute/function-message-1.m33
-rw-r--r--gcc/testsuite/objc/execute/many_args_method.m3
-rw-r--r--gcc/testsuite/objc/execute/nested-3.m3
-rw-r--r--gcc/testsuite/objc/execute/next_mapping.h851
-rw-r--r--gcc/testsuite/objc/execute/np-2.m3
-rw-r--r--gcc/testsuite/objc/execute/object_is_class.m2
-rw-r--r--gcc/testsuite/objc/execute/object_is_meta_class.m2
-rw-r--r--gcc/testsuite/objc/execute/redefining_self.m3
-rw-r--r--gcc/testsuite/objc/execute/root_methods.m5
-rw-r--r--gcc/testsuite/objc/execute/static-1.m3
-rw-r--r--gcc/testsuite/objc/execute/static-2.m3
-rw-r--r--gcc/testsuite/objc/execute/string1.m5
-rw-r--r--gcc/testsuite/objc/execute/string2.m5
-rw-r--r--gcc/testsuite/objc/execute/string3.m5
-rw-r--r--gcc/testsuite/objc/execute/string4.m5
-rw-r--r--gcc/testsuite/objc/execute/va_method.m4
-rw-r--r--gcc/timevar.c5
-rw-r--r--gcc/tlink.c4
-rw-r--r--gcc/toplev.c1067
-rw-r--r--gcc/toplev.h78
-rw-r--r--gcc/tree-dump.c4
-rw-r--r--gcc/tree-inline.c457
-rw-r--r--gcc/tree-inline.h2
-rw-r--r--gcc/tree-optimize.c240
-rw-r--r--gcc/tree.c161
-rw-r--r--gcc/tree.def48
-rw-r--r--gcc/tree.h127
-rw-r--r--gcc/treelang/ChangeLog59
-rw-r--r--gcc/treelang/Make-lang.in35
-rw-r--r--gcc/treelang/config-lang.in2
-rw-r--r--gcc/treelang/lang.opt5
-rw-r--r--gcc/treelang/parse.y5
-rw-r--r--gcc/treelang/tree-convert.c107
-rw-r--r--gcc/treelang/tree1.c16
-rw-r--r--gcc/treelang/treetree.c875
-rw-r--r--gcc/unroll.c33
-rw-r--r--gcc/unwind-c.c9
-rw-r--r--gcc/unwind-dw2-fde-darwin.c45
-rw-r--r--gcc/unwind-dw2-fde.c8
-rw-r--r--gcc/unwind-dw2.c121
-rw-r--r--gcc/unwind-pe.h9
-rw-r--r--gcc/unwind-sjlj.c13
-rw-r--r--gcc/unwind.h3
-rw-r--r--gcc/unwind.inc11
-rw-r--r--gcc/value-prof.c11
-rw-r--r--gcc/value-prof.h4
-rw-r--r--gcc/varasm.c251
-rw-r--r--gcc/varray.c8
-rw-r--r--gcc/varray.h8
-rw-r--r--gcc/version.c3
-rw-r--r--gcc/vmsdbgout.c26
-rw-r--r--gcc/xcoffout.c2
-rw-r--r--include/ChangeLog21
-rw-r--r--include/floatformat.h22
-rw-r--r--include/xtensa-config.h75
-rwxr-xr-xinstall-sh169
-rw-r--r--libf2c/ChangeLog11
-rwxr-xr-xlibf2c/configure2
-rw-r--r--libf2c/libU77/fnum_.c4
-rw-r--r--libf2c/libU77/fstat_.c2
-rw-r--r--libf2c/libU77/isatty_.c1
-rw-r--r--libffi/ChangeLog206
-rw-r--r--libffi/Makefile.am14
-rw-r--r--libffi/Makefile.in213
-rw-r--r--libffi/README10
-rwxr-xr-xlibffi/configure364
-rw-r--r--libffi/configure.in12
-rw-r--r--libffi/include/Makefile.in11
-rw-r--r--libffi/src/java_raw_api.c1
-rw-r--r--libffi/src/powerpc/aix.S28
-rw-r--r--libffi/src/powerpc/aix_closure.S29
-rw-r--r--libffi/src/powerpc/darwin.S83
-rw-r--r--libffi/src/powerpc/darwin_closure.S148
-rw-r--r--libffi/src/powerpc/ffi.c50
-rw-r--r--libffi/src/powerpc/ffi_darwin.c536
-rw-r--r--libffi/src/powerpc/linux64.S19
-rw-r--r--libffi/src/powerpc/linux64_closure.S127
-rw-r--r--libffi/src/prep_cif.c9
-rw-r--r--libffi/src/sh/ffi.c16
-rw-r--r--libffi/src/sh/sysv.S29
-rw-r--r--libffi/src/sparc/ffi.c2
-rw-r--r--libffi/src/sparc/v9.S42
-rw-r--r--libffi/src/types.c7
-rw-r--r--libiberty/ChangeLog62
-rw-r--r--libiberty/aclocal.m495
-rwxr-xr-xlibiberty/configure7932
-rw-r--r--libiberty/configure.in36
-rw-r--r--libiberty/cp-demangle.c4
-rw-r--r--libiberty/fibheap.c2
-rw-r--r--libiberty/floatformat.c119
-rw-r--r--libjava/ChangeLog1620
-rw-r--r--libjava/Makefile.am126
-rw-r--r--libjava/Makefile.in194
-rw-r--r--libjava/acconfig.h166
-rw-r--r--libjava/acinclude.m46
-rw-r--r--libjava/aclocal.m411
-rw-r--r--libjava/boehm.cc46
-rwxr-xr-xlibjava/configure920
-rw-r--r--libjava/configure.host16
-rw-r--r--libjava/configure.in259
-rw-r--r--libjava/defineclass.cc37
-rw-r--r--libjava/exception.cc23
-rw-r--r--libjava/gcj/Makefile.in1
-rw-r--r--libjava/gij.cc16
-rw-r--r--libjava/gnu/awt/j2d/AbstractGraphicsState.java10
-rw-r--r--libjava/gnu/awt/j2d/Graphics2DImpl.java20
-rw-r--r--libjava/gnu/awt/j2d/IntegerGraphicsState.java133
-rw-r--r--libjava/gnu/awt/xlib/XCanvasPeer.java2
-rw-r--r--libjava/gnu/awt/xlib/XEventLoop.java88
-rw-r--r--libjava/gnu/awt/xlib/XGraphics.java27
-rw-r--r--libjava/gnu/awt/xlib/XGraphicsConfiguration.java2
-rw-r--r--libjava/gnu/awt/xlib/XOffScreenImage.java175
-rw-r--r--libjava/gnu/gcj/Core.java7
-rw-r--r--libjava/gnu/gcj/convert/natIconv.cc42
-rw-r--r--libjava/gnu/gcj/natCore.cc96
-rw-r--r--libjava/gnu/gcj/protocol/core/Connection.java4
-rw-r--r--libjava/gnu/gcj/runtime/NameFinder.java16
-rw-r--r--libjava/gnu/gcj/runtime/SharedLibHelper.java144
-rw-r--r--libjava/gnu/gcj/runtime/SharedLibLoader.java68
-rw-r--r--libjava/gnu/gcj/runtime/StackTrace.java2
-rw-r--r--libjava/gnu/gcj/runtime/VMClassLoader.java30
-rw-r--r--libjava/gnu/gcj/runtime/natSharedLibLoader.cc74
-rw-r--r--libjava/gnu/gcj/runtime/natStackTrace.cc17
-rw-r--r--libjava/gnu/gcj/runtime/natVMClassLoader.cc18
-rw-r--r--libjava/gnu/gcj/xlib/Drawable.java2
-rw-r--r--libjava/gnu/gcj/xlib/GC.java31
-rw-r--r--libjava/gnu/gcj/xlib/WMSizeHints.java20
-rw-r--r--libjava/gnu/gcj/xlib/WindowAttributes.java24
-rw-r--r--libjava/gnu/gcj/xlib/XAnyEvent.java42
-rw-r--r--libjava/gnu/gcj/xlib/natDrawable.cc20
-rw-r--r--libjava/gnu/gcj/xlib/natGC.cc15
-rw-r--r--libjava/gnu/java/awt/EmbeddedWindow.java96
-rw-r--r--libjava/gnu/java/awt/EmbeddedWindowSupport.java65
-rw-r--r--libjava/gnu/java/awt/natEmbeddedWindow.cc18
-rw-r--r--libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java46
-rw-r--r--libjava/gnu/java/awt/peer/GLightweightPeer.java (renamed from libjava/gnu/java/awt/GLightweightPeer.java)161
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java3
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics.java14
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java1146
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java217
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java10
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java3
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkClipboard.java16
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java10
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java59
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java14
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkImage.java11
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkListPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java4
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java27
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java11
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkToolkit.java20
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java27
-rw-r--r--libjava/gnu/java/lang/ArrayHelper.java30
-rw-r--r--libjava/gnu/java/locale/LocaleInformation_de.java2
-rw-r--r--libjava/gnu/java/locale/LocaleInformation_en.java2
-rw-r--r--libjava/gnu/java/locale/LocaleInformation_nl.java2
-rw-r--r--libjava/gnu/java/nio/NIODatagramSocket.java71
-rw-r--r--libjava/gnu/java/nio/NIOSocket.java76
-rw-r--r--libjava/gnu/java/rmi/rmic/Compile_gcj.java25
-rw-r--r--libjava/gnu/java/rmi/rmic/Compile_jikes.java56
-rw-r--r--libjava/gnu/java/rmi/rmic/Compile_kjc.java56
-rw-r--r--libjava/gnu/java/rmi/rmic/Compiler.java14
-rw-r--r--libjava/gnu/java/rmi/rmic/CompilerProcess.java65
-rw-r--r--libjava/gnu/java/rmi/rmic/RMIC.java139
-rw-r--r--libjava/gnu/java/rmi/rmic/RMICException.java66
-rw-r--r--libjava/gnu/java/rmi/server/UnicastRef.java44
-rw-r--r--libjava/gnu/java/rmi/server/UnicastServerRef.java11
-rw-r--r--libjava/include/Makefile.in1
-rw-r--r--libjava/include/config.h.in287
-rw-r--r--libjava/include/i386-signal.h43
-rw-r--r--libjava/include/jvm.h109
-rw-r--r--libjava/include/win32-threads.h26
-rw-r--r--libjava/include/win32.h108
-rw-r--r--libjava/java/awt/BasicStroke.java44
-rw-r--r--libjava/java/awt/Color.java2
-rw-r--r--libjava/java/awt/Component.java48
-rw-r--r--libjava/java/awt/Container.java23
-rw-r--r--libjava/java/awt/Dialog.java28
-rw-r--r--libjava/java/awt/EventQueue.java47
-rw-r--r--libjava/java/awt/Font.java784
-rw-r--r--libjava/java/awt/Frame.java25
-rw-r--r--libjava/java/awt/GridBagLayout.java686
-rw-r--r--libjava/java/awt/GridBagLayoutInfo.java70
-rw-r--r--libjava/java/awt/MediaTracker.java4
-rw-r--r--libjava/java/awt/Toolkit.java49
-rw-r--r--libjava/java/awt/Window.java121
-rw-r--r--libjava/java/awt/event/KeyEvent.java72
-rw-r--r--libjava/java/awt/geom/AffineTransform.java8
-rw-r--r--libjava/java/awt/geom/Arc2D.java214
-rw-r--r--libjava/java/awt/geom/CubicCurve2D.java54
-rw-r--r--libjava/java/awt/geom/Line2D.java4
-rw-r--r--libjava/java/awt/geom/QuadCurve2D.java52
-rw-r--r--libjava/java/awt/geom/Rectangle2D.java2
-rw-r--r--libjava/java/awt/im/InputContext.java3
-rw-r--r--libjava/java/awt/image/BufferedImage.java28
-rw-r--r--libjava/java/awt/image/MemoryImageSource.java5
-rw-r--r--libjava/java/beans/PropertyEditorManager.java14
-rw-r--r--libjava/java/io/FileInputStream.java2
-rw-r--r--libjava/java/io/FileOutputStream.java2
-rw-r--r--libjava/java/io/FilePermission.java8
-rw-r--r--libjava/java/io/LineNumberReader.java2
-rw-r--r--libjava/java/io/ObjectInputStream.java48
-rw-r--r--libjava/java/io/ObjectOutputStream.java71
-rw-r--r--libjava/java/io/ObjectStreamClass.java2
-rw-r--r--libjava/java/io/PrintStream.java39
-rw-r--r--libjava/java/io/RandomAccessFile.java2
-rw-r--r--libjava/java/io/natFileDescriptorPosix.cc60
-rw-r--r--libjava/java/io/natFileDescriptorWin32.cc152
-rw-r--r--libjava/java/io/natFilePosix.cc65
-rw-r--r--libjava/java/io/natFileWin32.cc118
-rw-r--r--libjava/java/lang/Class.h7
-rw-r--r--libjava/java/lang/Class.java46
-rw-r--r--libjava/java/lang/ClassLoader.java20
-rw-r--r--libjava/java/lang/InheritableThreadLocal.java13
-rw-r--r--libjava/java/lang/Math.java4
-rw-r--r--libjava/java/lang/Runtime.java4
-rw-r--r--libjava/java/lang/StrictMath.java4
-rw-r--r--libjava/java/lang/String.java3
-rw-r--r--libjava/java/lang/StringBuffer.java5
-rw-r--r--libjava/java/lang/Thread.java13
-rw-r--r--libjava/java/lang/ThreadGroup.java1
-rw-r--r--libjava/java/lang/ThreadLocal.java9
-rw-r--r--libjava/java/lang/Win32Process.java8
-rw-r--r--libjava/java/lang/natClass.cc87
-rw-r--r--libjava/java/lang/natRuntime.cc8
-rw-r--r--libjava/java/lang/natString.cc7
-rw-r--r--libjava/java/lang/natSystem.cc6
-rw-r--r--libjava/java/lang/natWin32Process.cc87
-rw-r--r--libjava/java/lang/ref/Reference.java42
-rw-r--r--libjava/java/lang/ref/natReference.cc21
-rw-r--r--libjava/java/lang/reflect/Constructor.java236
-rw-r--r--libjava/java/lang/reflect/Field.java28
-rw-r--r--libjava/java/lang/reflect/Method.java228
-rw-r--r--libjava/java/lang/reflect/Proxy.java27
-rw-r--r--libjava/java/lang/reflect/natArray.cc33
-rw-r--r--libjava/java/lang/reflect/natConstructor.cc22
-rw-r--r--libjava/java/lang/reflect/natField.cc43
-rw-r--r--libjava/java/lang/reflect/natMethod.cc124
-rw-r--r--libjava/java/math/BigDecimal.java73
-rw-r--r--libjava/java/net/DatagramSocket.java56
-rw-r--r--libjava/java/net/InetAddress.java140
-rw-r--r--libjava/java/net/JarURLConnection.java29
-rw-r--r--libjava/java/net/PlainDatagramSocketImpl.java272
-rw-r--r--libjava/java/net/PlainSocketImpl.java395
-rw-r--r--libjava/java/net/ServerSocket.java82
-rw-r--r--libjava/java/net/Socket.java123
-rw-r--r--libjava/java/net/SocketImpl.java3
-rw-r--r--libjava/java/net/SocketInputStream.java204
-rw-r--r--libjava/java/net/SocketOutputStream.java165
-rw-r--r--libjava/java/net/URL.java59
-rw-r--r--libjava/java/net/URLClassLoader.java131
-rw-r--r--libjava/java/net/URLEncoder.java27
-rw-r--r--libjava/java/net/URLStreamHandler.java4
-rw-r--r--libjava/java/net/natInetAddressWin32.cc265
-rw-r--r--libjava/java/net/natNetworkInterfaceWin32.cc210
-rw-r--r--libjava/java/net/natPlainDatagramSocketImplNoNet.cc119
-rw-r--r--libjava/java/net/natPlainDatagramSocketImplPosix.cc750
-rw-r--r--libjava/java/net/natPlainDatagramSocketImplWin32.cc872
-rw-r--r--libjava/java/net/natPlainSocketImplNoNet.cc128
-rw-r--r--libjava/java/net/natPlainSocketImplPosix.cc856
-rw-r--r--libjava/java/net/natPlainSocketImplWin32.cc1019
-rw-r--r--libjava/java/nio/ByteBufferImpl.java202
-rw-r--r--libjava/java/nio/DirectByteBufferImpl.java124
-rw-r--r--libjava/java/nio/MappedByteBufferImpl.java61
-rw-r--r--libjava/java/nio/channels/FileChannelImpl.java396
-rw-r--r--libjava/java/nio/channels/natFileChannelImpl.cc94
-rw-r--r--libjava/java/security/acl/Acl.java2
-rw-r--r--libjava/java/sql/Timestamp.java2
-rw-r--r--libjava/java/text/DateFormatSymbols.java74
-rw-r--r--libjava/java/text/DecimalFormat.java10
-rw-r--r--libjava/java/text/SimpleDateFormat.java12
-rw-r--r--libjava/java/util/Arrays.java219
-rw-r--r--libjava/java/util/Calendar.java19
-rw-r--r--libjava/java/util/GregorianCalendar.java14
-rw-r--r--libjava/java/util/HashMap.java3
-rw-r--r--libjava/java/util/Locale.java2
-rw-r--r--libjava/java/util/Properties.java2
-rw-r--r--libjava/java/util/PropertyResourceBundle.java4
-rw-r--r--libjava/java/util/TimeZone.java1386
-rw-r--r--libjava/java/util/Timer.java2
-rw-r--r--libjava/java/util/WeakHashMap.java4
-rw-r--r--libjava/java/util/logging/Handler.java2
-rw-r--r--libjava/java/util/logging/LogManager.java35
-rw-r--r--libjava/java/util/logging/Logger.java34
-rw-r--r--libjava/java/util/logging/SimpleFormatter.java4
-rw-r--r--libjava/java/util/zip/ZipFile.java2
-rw-r--r--libjava/javax/naming/CompoundName.java8
-rw-r--r--libjava/javax/naming/InitialContext.java280
-rw-r--r--libjava/javax/naming/spi/NamingManager.java26
-rw-r--r--libjava/javax/swing/AbstractButton.java1463
-rw-r--r--libjava/javax/swing/ButtonModel.java8
-rw-r--r--libjava/javax/swing/SwingUtilities.java97
-rw-r--r--libjava/javax/swing/UIManager.java389
-rw-r--r--libjava/javax/swing/border/BevelBorder.java6
-rw-r--r--libjava/javax/swing/border/EtchedBorder.java6
-rw-r--r--libjava/javax/swing/border/LineBorder.java4
-rw-r--r--libjava/javax/swing/border/MatteBorder.java12
-rw-r--r--libjava/javax/swing/border/SoftBevelBorder.java6
-rw-r--r--libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java174
-rw-r--r--libjava/javax/swing/event/AncestorEvent.java4
-rw-r--r--libjava/javax/swing/event/InternalFrameEvent.java4
-rw-r--r--libjava/javax/swing/plaf/BorderUIResource.java52
-rw-r--r--libjava/javax/swing/plaf/ComponentUI.java2
-rw-r--r--libjava/javax/swing/plaf/TreeUI.java4
-rw-r--r--libjava/javax/swing/plaf/basic/BasicBorders.java57
-rw-r--r--libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java14
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLabelUI.java43
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLookAndFeel.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java17
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextUI.java32
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTreeUI.java4
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLookAndFeel.java10
-rw-r--r--libjava/jni.cc64
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c33
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c1069
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c236
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c8
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c65
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c65
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c826
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c12
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c26
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c13
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c100
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c26
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c92
-rw-r--r--libjava/jni/gtk-peer/gtkpeer.h269
-rw-r--r--libjava/libart.m45
-rw-r--r--libjava/libltdl/ChangeLog5
-rwxr-xr-xlibjava/libltdl/configure133
-rw-r--r--libjava/libltdl/configure.in3
-rw-r--r--libjava/mauve-libgcj3
-rw-r--r--libjava/prims.cc36
-rw-r--r--libjava/resolve.cc26
-rw-r--r--libjava/testsuite/ChangeLog97
-rw-r--r--libjava/testsuite/Makefile.in1
-rw-r--r--libjava/testsuite/lib/libjava.exp78
-rw-r--r--libjava/testsuite/libjava.cni/PR9577.java14
-rw-r--r--libjava/testsuite/libjava.cni/PR9577.out1
-rw-r--r--libjava/testsuite/libjava.cni/natPR9577.cc9
-rw-r--r--libjava/testsuite/libjava.compile/PR11600.java7
-rw-r--r--libjava/testsuite/libjava.compile/PR11600.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/PR5641.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/abstr.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/compile.exp2
-rw-r--r--libjava/testsuite/libjava.jacks/jacks.exp11
-rw-r--r--libjava/testsuite/libjava.jacks/jacks.xfail16
-rw-r--r--libjava/testsuite/libjava.jni/pr11951.c16
-rw-r--r--libjava/testsuite/libjava.jni/pr11951.java14
-rw-r--r--libjava/testsuite/libjava.jni/pr11951.out1
-rw-r--r--libjava/testsuite/libjava.lang/PR12350.java20
-rw-r--r--libjava/testsuite/libjava.lang/PR12350.out1
-rw-r--r--libjava/testsuite/libjava.lang/PR7482.java35
-rw-r--r--libjava/testsuite/libjava.lang/PR7482.out0
-rw-r--r--libjava/testsuite/libjava.lang/SyncTest.java5
-rw-r--r--libjava/testsuite/libjava.lang/lang.exp2
-rw-r--r--libjava/testsuite/libjava.lang/pr8823.xfail1
-rw-r--r--libjava/testsuite/libjava.mauve/mauve.exp35
-rw-r--r--libjava/verify.cc542
-rw-r--r--libjava/win32-threads.cc87
-rw-r--r--libjava/win32.cc158
-rw-r--r--libobjc/ChangeLog19
-rw-r--r--libobjc/Makefile.in2
-rw-r--r--libobjc/aclocal.m42
-rwxr-xr-xlibobjc/configure4
-rw-r--r--libobjc/sendmsg.c72
-rw-r--r--libstdc++-v3/ChangeLog1051
-rw-r--r--libstdc++-v3/Makefile.am22
-rw-r--r--libstdc++-v3/Makefile.in621
-rw-r--r--libstdc++-v3/README2
-rw-r--r--libstdc++-v3/acconfig.h15
-rw-r--r--libstdc++-v3/acinclude.m42852
-rw-r--r--libstdc++-v3/aclocal.m43797
-rw-r--r--libstdc++-v3/config.h.in859
-rw-r--r--libstdc++-v3/config/abi/x86_64-linux-gnu/baseline_symbols.txt36
-rw-r--r--libstdc++-v3/config/cpu/hppa/atomicity.h4
-rw-r--r--libstdc++-v3/config/cpu/m68k/atomicity.h73
-rw-r--r--libstdc++-v3/config/io/basic_file_stdio.cc58
-rw-r--r--libstdc++-v3/config/io/basic_file_stdio.h10
-rw-r--r--libstdc++-v3/config/linker-map.gnu11
-rw-r--r--libstdc++-v3/config/locale/generic/c_locale.h23
-rw-r--r--libstdc++-v3/config/locale/generic/messages_members.h4
-rw-r--r--libstdc++-v3/config/locale/generic/monetary_members.cc98
-rw-r--r--libstdc++-v3/config/locale/generic/time_members.cc200
-rw-r--r--libstdc++-v3/config/locale/generic/time_members.h13
-rw-r--r--libstdc++-v3/config/locale/gnu/c_locale.h23
-rw-r--r--libstdc++-v3/config/locale/gnu/messages_members.h4
-rw-r--r--libstdc++-v3/config/locale/gnu/monetary_members.cc226
-rw-r--r--libstdc++-v3/config/locale/gnu/time_members.cc384
-rw-r--r--libstdc++-v3/config/locale/gnu/time_members.h15
-rw-r--r--libstdc++-v3/config/os/hpux/os_defines.h7
-rwxr-xr-xlibstdc++-v3/configure69395
-rw-r--r--libstdc++-v3/configure.ac345
-rw-r--r--libstdc++-v3/configure.host38
-rw-r--r--libstdc++-v3/configure.in602
-rw-r--r--libstdc++-v3/crossconfig.m4262
-rw-r--r--libstdc++-v3/docs/doxygen/TODO6
-rw-r--r--libstdc++-v3/docs/doxygen/doxygroups.cc8
-rw-r--r--libstdc++-v3/docs/doxygen/guide.html107
-rw-r--r--libstdc++-v3/docs/doxygen/mainpage.html65
-rw-r--r--libstdc++-v3/docs/doxygen/run_doxygen63
-rw-r--r--libstdc++-v3/docs/doxygen/user.cfg.in16
-rw-r--r--libstdc++-v3/docs/html/17_intro/confdeps.dot14
-rw-r--r--libstdc++-v3/docs/html/17_intro/confdeps.pngbin0 -> 3486 bytes
-rw-r--r--libstdc++-v3/docs/html/17_intro/configury.html285
-rw-r--r--libstdc++-v3/docs/html/17_intro/headers_cc.txt2
-rw-r--r--libstdc++-v3/docs/html/17_intro/howto.html8
-rw-r--r--libstdc++-v3/docs/html/17_intro/porting.html90
-rw-r--r--libstdc++-v3/docs/html/17_intro/porting.texi2
-rw-r--r--libstdc++-v3/docs/html/22_locale/howto.html5
-rw-r--r--libstdc++-v3/docs/html/27_io/howto.html7
-rw-r--r--libstdc++-v3/docs/html/Makefile4
-rw-r--r--libstdc++-v3/docs/html/abi.txt8
-rw-r--r--libstdc++-v3/docs/html/configopts.html10
-rw-r--r--libstdc++-v3/docs/html/debug.html4
-rw-r--r--libstdc++-v3/docs/html/ext/howto.html17
-rw-r--r--libstdc++-v3/docs/html/faq/index.html7
-rw-r--r--libstdc++-v3/docs/html/faq/index.txt6
-rw-r--r--libstdc++-v3/docs/html/install.html8
-rw-r--r--libstdc++-v3/docs/html/test.html50
-rw-r--r--libstdc++-v3/fragment.am26
-rw-r--r--libstdc++-v3/include/Makefile.am141
-rw-r--r--libstdc++-v3/include/Makefile.in490
-rw-r--r--libstdc++-v3/include/bits/basic_ios.h25
-rw-r--r--libstdc++-v3/include/bits/basic_ios.tcc8
-rw-r--r--libstdc++-v3/include/bits/basic_string.h1207
-rw-r--r--libstdc++-v3/include/bits/boost_concept_check.h7
-rw-r--r--libstdc++-v3/include/bits/c++config40
-rw-r--r--libstdc++-v3/include/bits/char_traits.h194
-rw-r--r--libstdc++-v3/include/bits/demangle.h26
-rw-r--r--libstdc++-v3/include/bits/deque.tcc14
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc179
-rw-r--r--libstdc++-v3/include/bits/ios_base.h72
-rw-r--r--libstdc++-v3/include/bits/istream.tcc76
-rw-r--r--libstdc++-v3/include/bits/locale_classes.h8
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h398
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc330
-rw-r--r--libstdc++-v3/include/bits/ostream.tcc44
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h339
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h16
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h20
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h2
-rw-r--r--libstdc++-v3/include/bits/stl_heap.h76
-rw-r--r--libstdc++-v3/include/bits/stl_list.h113
-rw-r--r--libstdc++-v3/include/bits/stl_tempbuf.h4
-rw-r--r--libstdc++-v3/include/bits/stl_tree.h552
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h6
-rw-r--r--libstdc++-v3/include/bits/valarray_array.h13
-rw-r--r--libstdc++-v3/include/bits/valarray_array.tcc234
-rw-r--r--libstdc++-v3/include/bits/vector.tcc6
-rw-r--r--libstdc++-v3/include/c/std_cctype.h6
-rw-r--r--libstdc++-v3/include/c/std_cerrno.h6
-rw-r--r--libstdc++-v3/include/c/std_cfloat.h6
-rw-r--r--libstdc++-v3/include/c/std_climits.h6
-rw-r--r--libstdc++-v3/include/c/std_clocale.h6
-rw-r--r--libstdc++-v3/include/c/std_cmath.h6
-rw-r--r--libstdc++-v3/include/c/std_csetjmp.h6
-rw-r--r--libstdc++-v3/include/c/std_csignal.h6
-rw-r--r--libstdc++-v3/include/c/std_cstdarg.h6
-rw-r--r--libstdc++-v3/include/c/std_cstddef.h6
-rw-r--r--libstdc++-v3/include/c/std_cstdio.h6
-rw-r--r--libstdc++-v3/include/c/std_cstdlib.h6
-rw-r--r--libstdc++-v3/include/c/std_cstring.h4
-rw-r--r--libstdc++-v3/include/c/std_ctime.h6
-rw-r--r--libstdc++-v3/include/c/std_cwchar.h6
-rw-r--r--libstdc++-v3/include/c/std_cwctype.h6
-rw-r--r--libstdc++-v3/include/c_std/cmath.tcc8
-rw-r--r--libstdc++-v3/include/c_std/std_cctype.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cerrno.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cfloat.h4
-rw-r--r--libstdc++-v3/include/c_std/std_climits.h4
-rw-r--r--libstdc++-v3/include/c_std/std_clocale.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cmath.h9
-rw-r--r--libstdc++-v3/include/c_std/std_csetjmp.h4
-rw-r--r--libstdc++-v3/include/c_std/std_csignal.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cstdarg.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cstddef.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cstdio.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cstdlib.h8
-rw-r--r--libstdc++-v3/include/c_std/std_cstring.h4
-rw-r--r--libstdc++-v3/include/c_std/std_ctime.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cwchar.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cwctype.h4
-rw-r--r--libstdc++-v3/include/ext/hash_map4
-rw-r--r--libstdc++-v3/include/ext/hash_set8
-rw-r--r--libstdc++-v3/include/ext/pod_char_traits.h14
-rw-r--r--libstdc++-v3/include/ext/rope49
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h6
-rw-r--r--libstdc++-v3/include/ext/stdio_filebuf.h8
-rw-r--r--libstdc++-v3/include/ext/stdio_sync_filebuf.h60
-rw-r--r--libstdc++-v3/include/std/std_algorithm.h6
-rw-r--r--libstdc++-v3/include/std/std_bitset.h6
-rw-r--r--libstdc++-v3/include/std/std_complex.h6
-rw-r--r--libstdc++-v3/include/std/std_deque.h13
-rw-r--r--libstdc++-v3/include/std/std_fstream.h43
-rw-r--r--libstdc++-v3/include/std/std_functional.h6
-rw-r--r--libstdc++-v3/include/std/std_iomanip.h6
-rw-r--r--libstdc++-v3/include/std/std_ios.h7
-rw-r--r--libstdc++-v3/include/std/std_iosfwd.h6
-rw-r--r--libstdc++-v3/include/std/std_iostream.h6
-rw-r--r--libstdc++-v3/include/std/std_istream.h15
-rw-r--r--libstdc++-v3/include/std/std_iterator.h6
-rw-r--r--libstdc++-v3/include/std/std_limits.h6
-rw-r--r--libstdc++-v3/include/std/std_list.h12
-rw-r--r--libstdc++-v3/include/std/std_locale.h6
-rw-r--r--libstdc++-v3/include/std/std_map.h6
-rw-r--r--libstdc++-v3/include/std/std_memory.h6
-rw-r--r--libstdc++-v3/include/std/std_numeric.h6
-rw-r--r--libstdc++-v3/include/std/std_ostream.h15
-rw-r--r--libstdc++-v3/include/std/std_queue.h10
-rw-r--r--libstdc++-v3/include/std/std_set.h6
-rw-r--r--libstdc++-v3/include/std/std_sstream.h11
-rw-r--r--libstdc++-v3/include/std/std_stack.h12
-rw-r--r--libstdc++-v3/include/std/std_stdexcept.h6
-rw-r--r--libstdc++-v3/include/std/std_streambuf.h17
-rw-r--r--libstdc++-v3/include/std/std_string.h11
-rw-r--r--libstdc++-v3/include/std/std_utility.h6
-rw-r--r--libstdc++-v3/include/std/std_valarray.h6
-rw-r--r--libstdc++-v3/include/std/std_vector.h12
-rw-r--r--libstdc++-v3/libmath/Makefile.am12
-rw-r--r--libstdc++-v3/libmath/Makefile.in478
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am60
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in615
-rw-r--r--libstdc++-v3/libsupc++/eh_term_handler.cc24
-rw-r--r--libstdc++-v3/libsupc++/vec.cc8
-rw-r--r--libstdc++-v3/linkage.m4522
-rw-r--r--libstdc++-v3/po/Makefile.am38
-rw-r--r--libstdc++-v3/po/Makefile.in375
-rw-r--r--libstdc++-v3/po/libstdc++.pot31
-rwxr-xr-xlibstdc++-v3/scripts/extract_symvers7
-rwxr-xr-xlibstdc++-v3/scripts/testsuite_flags.in8
-rw-r--r--libstdc++-v3/src/Makefile.am93
-rw-r--r--libstdc++-v3/src/Makefile.in675
-rw-r--r--libstdc++-v3/src/globals.cc36
-rw-r--r--libstdc++-v3/src/ios.cc4
-rw-r--r--libstdc++-v3/src/locale-inst.cc54
-rw-r--r--libstdc++-v3/src/locale.cc51
-rw-r--r--libstdc++-v3/src/localename.cc62
-rw-r--r--libstdc++-v3/src/stl_tree.cc386
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_ciso646.cc10
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits.cc17
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc5
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc3
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc5
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc5
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/collate_byname/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/facet/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/5.cc14
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/7.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/7222-env.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/messages_byname/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/11528.cc (renamed from libstdc++-v3/testsuite/23_containers/vector_bool.cc)45
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/11528.cc (renamed from libstdc++-v3/testsuite/23_containers/vector_resize.cc)50
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/5.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/6.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/5.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_1.cc78
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_2.cc90
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_1.cc78
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_2.cc90
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc6
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset_ctor.cc126
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset_members.cc79
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset_shift.cc130
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque_ctor.cc539
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque_operators.cc85
-rw-r--r--libstdc++-v3/testsuite/23_containers/list_capacity.cc70
-rw-r--r--libstdc++-v3/testsuite/23_containers/list_ctor.cc332
-rw-r--r--libstdc++-v3/testsuite/23_containers/list_modifiers.cc273
-rw-r--r--libstdc++-v3/testsuite/23_containers/list_operators.cc211
-rw-r--r--libstdc++-v3/testsuite/23_containers/map_insert.cc70
-rw-r--r--libstdc++-v3/testsuite/23_containers/map_operators_neg.cc49
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset.cc74
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_capacity.cc178
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_ctor.cc664
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_modifiers.cc88
-rw-r--r--libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc7
-rw-r--r--libstdc++-v3/testsuite/24_iterators/iterator.cc7
-rw-r--r--libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc7
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/lower_bound.cc17
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc15
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc4
-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.cc2
-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.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc136
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc89
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc2
-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/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc110
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-3.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-4.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc111
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc116
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc (renamed from libstdc++-v3/testsuite/23_containers/vector_element_access.cc)58
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc73
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_fstream/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/fpos/1.cc2
-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/objects/char/12048-1.cc (renamed from libstdc++-v3/testsuite/23_containers/set_operators_neg.cc)38
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc41
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc39
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc40
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc55
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc17
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc109
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc119
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc (renamed from libstdc++-v3/testsuite/23_containers/map_operators.cc)40
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc42
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc (renamed from libstdc++-v3/testsuite/23_containers/adaptors.cc)64
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc41
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc53
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc118
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc2
-rw-r--r--libstdc++-v3/testsuite/Makefile.am42
-rw-r--r--libstdc++-v3/testsuite/Makefile.in644
-rw-r--r--libstdc++-v3/testsuite/data/cin_unget-1.txt1
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/01.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/02.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/03.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/04.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/05.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/06.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/07.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/08.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/09.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/10.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/11.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/12.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/13.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/14.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/15.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/16.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/17.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/18.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/19.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/20.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/21.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/22.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/23.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/24.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/25.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/26.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/01.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/02.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/03.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/04.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/05.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/06.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/07.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/08.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/09.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/10.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/11.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/12.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/13.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/14.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/3111-1.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-02.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-03.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-04.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-05.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-06.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-07.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-08.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-09.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-10.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-11.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-12.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/8897.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-01.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-02.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-03.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-04.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-05.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-06.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-07.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-08.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-09.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-10.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-11.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-12.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-13.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-14.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/old.cc2
-rw-r--r--libstdc++-v3/testsuite/ext/pod_char_traits.cc5
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_filebuf.cc2
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc78
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc78
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp (renamed from libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp)152
-rw-r--r--libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp37
-rw-r--r--libstdc++-v3/testsuite/performance/allocator.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/complex_norm.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/cout_insert_int.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/filebuf_copy.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/filebuf_sputc.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/fstream_seek_write.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/ifstream_getline.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/list_create_fill_sort.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/map_create_fill.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/ofstream_insert_float.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/ofstream_insert_int.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/string_append.cc4
-rw-r--r--libstdc++-v3/testsuite/testsuite_allocator.cc2
-rw-r--r--libstdc++-v3/testsuite/testsuite_allocator.h4
-rw-r--r--libstdc++-v3/testsuite/testsuite_hooks.cc12
-rw-r--r--libstdc++-v3/testsuite/testsuite_hooks.h57
-rw-r--r--libstdc++-v3/testsuite/testsuite_io.h4
-rw-r--r--libstdc++-v3/testsuite/testsuite_performance.h13
-rw-r--r--libstdc++-v3/testsuite/thread/pthread1.cc4
-rw-r--r--libstdc++-v3/testsuite/thread/pthread2.cc4
-rw-r--r--libstdc++-v3/testsuite/thread/pthread3.cc4
-rw-r--r--libstdc++-v3/testsuite/thread/pthread4.cc4
-rw-r--r--libstdc++-v3/testsuite/thread/pthread5.cc4
-rw-r--r--libstdc++-v3/testsuite/thread/pthread6.cc4
-rw-r--r--libstdc++-v3/testsuite/thread/pthread7-rope.cc6
-rw-r--r--libtool.m42
-rw-r--r--maintainer-scripts/ChangeLog58
-rw-r--r--maintainer-scripts/crontab3
-rwxr-xr-xmaintainer-scripts/gcc_release85
-rw-r--r--maintainer-scripts/snapshot-README22
-rw-r--r--maintainer-scripts/snapshot-index.html18
-rwxr-xr-xmissing166
-rwxr-xr-xmkinstalldirs113
-rwxr-xr-xsymlink-tree25
-rw-r--r--zlib/ChangeLog.gcj14
-rw-r--r--zlib/README3
-rwxr-xr-xzlib/configure84
-rw-r--r--zlib/configure.in2
2249 files changed, 198813 insertions, 112224 deletions
diff --git a/ChangeLog b/ChangeLog
index 64d9b7c4351..f1b1b5b7fd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,220 @@
+2003-09-21 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Pass a computed --program-transform-name
+ to subconfigures.
+ * configure: Regenerated.
+
+2003-09-20 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.tpl: Don't pass down obsolete ENQUIRE variable.
+ * Makefile.in: Regenerate.
+
+ * Makefile.tpl: Don't pass (unused) DLLTOOL or WINDRES to gcc.
+ * Makefile.in: Regenerate.
+
+2003-09-19 Ziemowit Laski <zlaski@apple.com>
+
+ * MAINTAINERS: Move myself from 'Write After Approval'
+ to 'Various Maintainers' (objective-c) section.
+
+2003-09-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS, baseargs): Fix
+ quoting.
+ * configure: Regenerated.
+
+2003-09-16 Joel Brobecker <brobecker@gnat.com>
+
+ * MAINTAINERS (Write After Approval): Add myself to write after
+ approval list.
+
+2003-09-16 Dorit Naishlos <dorit@il.ibm.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2003-09-09 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * MAINTAINERS: Update my e-mail address.
+
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * libtool.m4 (LD): Correct powerpc64 host match.
+
+2003-09-06 James E Wilson <wilson@tuliptree.org>
+
+ * MAINTAINTERS: Update my affiliation and email address.
+
+2003-09-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2003-09-04 DJ Delorie <dj@redhat.com>
+
+ * configure: Regenerate.
+
+2003-09-04 Robert Millan <robertmh@gnu.org>
+
+ * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet.
+
+2003-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in: Ensure arguments to sed are properly spaced.
+ * configure: Regenerate.
+
+2003-08-30 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * MAINTAINERS: Update my e-mail address.
+
+2003-08-28 Mohan Embar <gnustuff@thisiscool.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Set RAW_CXX_FOR_TARGET if unset.
+ * configure: Regenerated.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/no-executables.m4: New file.
+
+2003-08-23 Marek Michalkiewicz <marekm@amelek.gda.pl>
+
+ * MAINTAINERS: Update my email address.
+
+2003-08-23 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in: Use newline instead of semicolon when assuming
+ shell arguments in a for loop.
+ * configure: Regenerated.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * MAINTAINERS: Resurrect the i860 maintainer.
+
+2003-08-20 Geoffrey Keating <geoffk@apple.com>
+
+ PR 8180
+ * configure.in: When testing with_libs and with_headers, treat
+ 'no' as unset. Based on a patch by Dan Kegel <dank@kegel.com>.
+ * configure: Regenerate.
+
+ * configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS): Quote properly for
+ make, shell, etc.
+ (baseargs): Likewise.
+ * configure: Regenerate.
+
+2003-08-20 Bernardo Innocenti <bernie@develer.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2003-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ * configure.in: Disable libgcj for darwin not on powerpc.
+ * configure: Rebuild.
+
+2003-08-14 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * config-ml.in, symlink-tree: Add license.
+
+2003-08-03 Richard Stallman <rms@gnu.org>
+ Eben Moglen <moglen@columbia.edu>
+
+ * README.SCO: New file.
+
+2003-08-01 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * Makefile.tpl (check, check-c++): Express dependencies using
+ dependencies rather than commands.
+ * Makefile.in: Regenerate.
+
+2003-08-01 Andrew Cagney <cagney@redhat.com>
+
+ * configure.in (noconfigdirs): Do not add GDB when m32r-*-*.
+ * configure: Ditto.
+
+2003-07-31 Geoffrey Keating <geoffk@apple.com>
+
+ * Makefile.tpl (libsubdir): Use gcc instead of gcc-lib.
+ * Makefile.in: Update.
+
+2003-07-30 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * configure.in: Enable libgcj for darwin.
+ * configure: Rebuild.
+
+2003-07-29 Phil Edwards <pme@gcc.gnu.org>
+
+ * config-ml.in: Use ac_configure_args directly instead of
+ ml_arguments. Only set ml_norecursion if --no[-]recursion is
+ actually seen.
+
+2003-07-27 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.tpl: Use 'mkinstalldirs' rather than 'mkdir' when
+ creating target and build subdirs to build all parent dirs as needed.
+ * Makefile.in: Rebuild.
+ * configure.in: Don't build dirs explicitly here.
+ * configure: Rebuild.
+
+2003-07-26 Paul Brook <paul@nowt.org>
+
+ * MAINTAINERS (fortran 95): Add myself, Steven Bosscher and Toon Moene.
+
+2003-07-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.tpl (all-make): Depend on intl.
+ * Makefile.in: Rebuilt.
+
+2003-07-20 Phil Edwards <pme@gcc.gnu.org>
+
+ * install-sh: Update to newer upstream versions (associated with
+ aclocal 1.7).
+ * mkinstalldirs: Likewise.
+ * missing: Likewise, plus $1Help2man -> $1 typo fix.
+
+2003-07-16 Andrew Pinski <pinskia@gcc.gnu.org>
+
+ * MAINTAINERS: Move self from Bug database only accounts
+ to write-after-approval.
+
+2003-07-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.if: Remove unused libc_interface determination.
+
+2003-07-14 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * MAINTAINERS: Move self from write-after-approval to
+ build machinery (*.in).
+
+2003-07-13 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR bootstrap/11273
+ PR bootstrap/11408
+ * Makefile.tpl: Set INSTALL and friends using autoconf. Remove
+ unused INSTALL_PROGRAM_ARGS.
+ * configure.in: Use AC_PROG_INSTALL.
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+
+2003-07-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * MAINTAINERS: Alphabetize.
+
+2003-07-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure: Rebuilt.
+ 2001-09-26 Alexandre Oliva <aoliva@redhat.com>
+ * configure.in (noconfigdirs) [am33_2.0-*-linux*]: Don't build
+ newlib nor libgloss.
+ Wed May 9 10:07:19 2001 Alexandre Oliva <aoliva@redhat.com>
+ * configure.in (am33_2.0-*-linux*): Added.
+
+2003-07-09 Bob Wilson <bob.wilson@acm.org>
+
+ * configure.in: Add ${libgcj} to noconfigdirs for xtensa-*-* targets.
+ * configure: Regenerate.
+
2003-07-07 Zack Weinberg <zack@codesourcery.com>
* Makefile.tpl (configure-gcc): Depend on maybe-configure-intl.
diff --git a/MAINTAINERS b/MAINTAINERS
index 00e9eeec9ec..c7107e16bf8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -25,13 +25,13 @@ Richard Henderson rth@redhat.com
Geoffrey Keating geoffk@geoffk.org
Richard Kenner kenner@nyu.edu
Jeff Law law@redhat.com
-Jason Merrill jason@redhat.com
Michael Meissner gnu@the-meissners.org
+Jason Merrill jason@redhat.com
David S. Miller davem@redhat.com
Mark Mitchell mark@codesourcery.com
Bernd Schmidt bernds@redhat.com
Zack Weinberg zack@codesourcery.com
-Jim Wilson wilson@tuliptree.org
+Jim Wilson wilson@specifixinc.com
CPU Port Maintainers (CPU alphabetical order)
@@ -40,7 +40,7 @@ alpha port Richard Henderson rth@redhat.com
arm port Nick Clifton nickc@redhat.com
arm port Richard Earnshaw rearnsha@arm.com
avr port Denis Chertykov denisc@overta.ru
-avr port Marek Michalkiewicz marekm@linux.org.pl
+avr port Marek Michalkiewicz marekm@amelek.gda.pl
c4x port Michael Hayes m.hayes@elec.canterbury.ac.nz
cris port Hans-Peter Nilsson hp@axis.com
fr30 port Nick Clifton nickc@redhat.com
@@ -49,8 +49,9 @@ h8 port Kazu Hirata kazu@cs.umass.edu
hppa port Jeff Law law@redhat.com
hppa port Dave Anglin dave.anglin@nrc.ca
i386 port Richard Henderson rth@redhat.com
-i960 port Jim Wilson wilson@tuliptree.org
-ia64 port Jim Wilson wilson@tuliptree.org
+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
m32r port Nick Clifton nickc@redhat.com
m68hc11 port Stephane Carrez stcarrez@nerim.fr
@@ -62,6 +63,7 @@ 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
rs6000 port Geoff Keating geoffk@geoffk.org
rs6000 port David Edelsohn dje@watson.ibm.com
rs6000 vector extns Aldy Hernandez aldyh@redhat.com
@@ -94,6 +96,9 @@ Ada front end Geert Bosch bosch@gnat.com
Ada front end Robert Dewar dewar@gnat.com
fortran Richard Henderson rth@redhat.com
fortran Toon Moene toon@moene.indiv.nluug.nl
+fortran 95 Paul Brook paul@nowt.org
+fortran 95 Steven Bosscher steven@gcc.gnu.org
+fortran 95 Toon Moene toon@moene.indiv.nluug.nl
c++ Jason Merrill jason@redhat.com
c++ Mark Mitchell mark@codesourcery.com
cpplib Dave Brolley brolley@redhat.com
@@ -107,15 +112,16 @@ libgcj Bryce McKinlay bryce@gcc.gnu.org
mercury Fergus Henderson fjh@cs.mu.oz.au
objective-c Stan Shebs shebs@apple.com
objective-c Ovidiu Predescu ovidiu@cup.hp.com
+objective-c Ziemowit Laski zlaski@apple.com
alias analysis John Carr jfc@mit.edu
-loop unrolling Jim Wilson wilson@tuliptree.org
+loop unrolling Jim Wilson wilson@specifixinc.com
loop discovery Michael Hayes m.hayes@elec.canterbury.ac.nz
-scheduler (+ haifa) Jim Wilson wilson@tuliptree.org
+scheduler (+ haifa) Jim Wilson wilson@specifixinc.com
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
-debugging code Jim Wilson wilson@tuliptree.org
+debugging code Jim Wilson wilson@specifixinc.com
dwarf debugging code Jason Merrill jason@redhat.com
c++ runtime libs Paolo Carlini pcarlini@unitus.it
c++ runtime libs Gabriel Dos Reis gdr@integrable-solutions.net
@@ -129,7 +135,7 @@ fixincludes Bruce Korb bkorb@gnu.org
gcse.c Jeff Law law@redhat.com
global opt framework Jeff Law law@redhat.com
jump.c David S. Miller davem@redhat.com
-web pages Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
+web pages Gerald Pfeifer gerald@pfeifer.com
web pages Janis Johnson janis187@us.ibm.com
config.sub/config.guess Ben Elliston config-patches@gnu.org
basic block reordering Jason Eckhardt jle@rice.edu
@@ -139,8 +145,9 @@ windows, cygwin, mingw Christopher Faylor cgf@redhat.com
DJGPP DJ Delorie dj@delorie.com
libiberty DJ Delorie dj@redhat.com
build machinery (*.in) DJ Delorie dj@redhat.com
+build machinery (*.in) Nathanael Nerode neroden@gcc.gnu.org
build machinery (*.in) Alexandre Oliva aoliva@redhat.com
-docs co-maintainer Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
+docs co-maintainer Gerald Pfeifer gerald@pfeifer.com
docs co-maintainer Joseph Myers jsm28@cam.ac.uk
Pico-Java port Steve Chamberlain sac@transmeta.com
RTEMS Ports Joel Sherrill joel@oarcorp.com
@@ -170,16 +177,18 @@ Eric Blake ericb@gcc.gnu.org
Jim Blandy jimb@redhat.com
Phil Blundell pb@futuretv.com
Hans Boehm hboehm@gcc.gnu.org
-Steven Bosscher steven@gcc.gnu.org
Eric Botcazou ebotcazou@libertysurf.fr
+Joel Brobecker brobecker@gnat.com
Kevin Buettner kevinb@redhat.com
Andrew Cagney cagney@redhat.com
Chandra Chavva cchavva@redhat.com
William Cohen wcohen@redhat.com
Christian Cornelssen ccorn@cs.tu-berlin.de
Chris Demetriou cgd@broadcom.com
+Zdenek Dvorak dvorakz@suse.cz
Steve Ellcey sje@cup.hp.com
Ben Elliston bje@wasabisystems.com
+Mohan Embar gnustuff@thisiscool.com
Marc Espie espie@cvs.openbsd.org
Ansgar Esztermann ansgar@thphy.uni-duesseldorf.de
Doug Evans dje@transmeta.com
@@ -191,6 +200,7 @@ Olivier Hainque hainque@act-europe.fr
Stuart Hastings stuart@apple.com
Matthew Hiller hiller@redhat.com
Manfred Hollstein mh@suse.com
+Bernardo Innocenti bernie@develer.com
Andreas Jaeger aj@suse.de
Fariborz Jahanian fjahanian@apple.com
Dale Johannesen dalej@apple.com
@@ -201,11 +211,10 @@ Matthias Klose doko@debian.org
Jeff Knaggs jknaggs@redhat.com
Paul Koning ni1d@arrl.net
Matt Kraai kraai@alumni.cmu.edu
-Ziemowit Laski zlaski@apple.com
Marc Lehmann pcg@goof.com
Alan Lehotsky apl@alum.mit.edu
-Warren Levy warrenl@cruzio.com
Kriang Lerdsuwanakij lerdsuwa@users.sourceforge.net
+Warren Levy warrenl@cruzio.com
Don Lindsay dlindsay@redhat.com
Dave Love d.love@dl.ac.uk
Martin v. Löwis loewis@informatik.hu-berlin.de
@@ -216,8 +225,8 @@ Greg McGary gkm@gnu.org
Adam Megacz adam@xwt.org
Alan Modra amodra@bigpond.net.au
Catherine Moore clm@redhat.com
+Dorit Naishlos dorit@il.ibm.com
Adam Nemet anemet@lnxw.com
-Nathanael Nerode neroden@gcc.gnu.org
Diego Novillo dnovillo@redhat.com
David O'Brien obrien@FreeBSD.org
Turly O'Connor turly@apple.com
@@ -227,6 +236,7 @@ Devang Patel dpatel@apple.com
Nicola Pero n.pero@mi.flashnet.it
Graeme Peterson gp@qnx.com
Alexandre Petit-Bianco apbianco@redhat.com
+Andrew Pinski pinskia@physics.uc.edu
Sebastian Pop s.pop@laposte.net
Clinton Popetz cpopetz@cpopetz.com
Rolf Rasmussen rolfwr@gcc.gnu.org
@@ -248,7 +258,7 @@ Richard Stallman rms@gnu.org
Graham Stott graham.stott@btinternet.com
Mike Stump mrs@apple.com
Jeff Sturm jsturm@gcc.gnu.org
-Ian Taylor ian@airs.com
+Ian Taylor ian@wasabisystems.com
Michael Tiemann tiemann@redhat.com
Kresten Krab Thorup krab@gcc.gnu.org
Andreas Tobler andreast@gcc.gnu.org
@@ -266,7 +276,6 @@ James Dennett jdennett@acm.org
Christian Ehrhardt ehrhardt@mathematik.uni-ulm.de
Dara Hazeghi dhazeghi@yahoo.com
Falk Hueffner falk.hueffner@student.uni-tuebingen.de
-Andrew Pinski pinskia@physics.uc.edu
Peter Bienstman(?)
Benjamin Chelf(?)
diff --git a/Makefile.in b/Makefile.in
index 136a4f82746..d08c169ab97 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -61,14 +61,10 @@ man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
-# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
-# cygwin host.
-INSTALL_PROGRAM_ARGS =
-
-INSTALL = $(SHELL) $$s/install-sh -c
-INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
-INSTALL_SCRIPT = $(INSTALL)
-INSTALL_DATA = $(INSTALL) -m 644
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
# -------------------------------------------------
# Miscellaneous non-standard autoconf-set variables
@@ -89,7 +85,7 @@ tooldir = @tooldir@
build_tooldir = @build_tooldir@
# Directory in which the compiler finds executables, libraries, etc.
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
GDB_NLM_DEPS =
# This is the name of the environment variable used for the path to
@@ -519,12 +515,10 @@ EXTRA_GCC_FLAGS = \
'AS=$(AS)' \
'CC=$(CC)' \
'CXX=$(CXX)' \
- 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
'BUILD_PREFIX=$(BUILD_PREFIX)' \
'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
'NM=$(NM)' \
'RANLIB=$(RANLIB)' \
- 'WINDRES=$$(WINDRES_FOR_TARGET)' \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
@@ -533,7 +527,6 @@ EXTRA_GCC_FLAGS = \
"`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
@@ -17291,8 +17284,7 @@ clean-target-libgcc:
# Check target.
.PHONY: check do-check
-check:
- $(MAKE) do-check
+check: do-check
# Only include modules actually being configured and built.
do-check: maybe-check-gcc \
@@ -17614,8 +17606,7 @@ TAGS: do-TAGS
maybe-configure-build-libiberty:
configure-build-libiberty:
@test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \
- [ -d $(BUILD_SUBDIR)/libiberty ] || \
- mkdir $(BUILD_SUBDIR)/libiberty;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libiberty ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
AR="$(AR_FOR_BUILD)"; export AR; \
@@ -21897,15 +21888,13 @@ maybe-configure-target-libstdc++-v3:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libstdc++-v3/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \
- mkdir $(TARGET_SUBDIR)/libstdc++-v3; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \
rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
@test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \
- mkdir $(TARGET_SUBDIR)/libstdc++-v3;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22001,15 +21990,13 @@ maybe-configure-target-newlib:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/newlib/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/newlib ] || \
- mkdir $(TARGET_SUBDIR)/newlib; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \
rm -f $(TARGET_SUBDIR)/newlib/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/newlib/multilib.out
configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out
@test ! -f $(TARGET_SUBDIR)/newlib/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/newlib ] || \
- mkdir $(TARGET_SUBDIR)/newlib;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22104,15 +22091,13 @@ maybe-configure-target-libf2c:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libf2c/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libf2c ] || \
- mkdir $(TARGET_SUBDIR)/libf2c; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libf2c ; \
rm -f $(TARGET_SUBDIR)/libf2c/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libf2c/multilib.out
configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out
@test ! -f $(TARGET_SUBDIR)/libf2c/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libf2c ] || \
- mkdir $(TARGET_SUBDIR)/libf2c;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libf2c ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22207,15 +22192,13 @@ maybe-configure-target-libobjc:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libobjc ] || \
- mkdir $(TARGET_SUBDIR)/libobjc; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \
rm -f $(TARGET_SUBDIR)/libobjc/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libobjc/multilib.out
configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out
@test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libobjc ] || \
- mkdir $(TARGET_SUBDIR)/libobjc;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22310,15 +22293,13 @@ maybe-configure-target-libtermcap:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libtermcap/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libtermcap ] || \
- mkdir $(TARGET_SUBDIR)/libtermcap; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \
rm -f $(TARGET_SUBDIR)/libtermcap/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libtermcap/multilib.out
configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out
@test ! -f $(TARGET_SUBDIR)/libtermcap/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libtermcap ] || \
- mkdir $(TARGET_SUBDIR)/libtermcap;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22409,15 +22390,13 @@ maybe-configure-target-winsup:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/winsup/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/winsup ] || \
- mkdir $(TARGET_SUBDIR)/winsup; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \
rm -f $(TARGET_SUBDIR)/winsup/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/winsup/multilib.out
configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out
@test ! -f $(TARGET_SUBDIR)/winsup/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/winsup ] || \
- mkdir $(TARGET_SUBDIR)/winsup;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22512,15 +22491,13 @@ maybe-configure-target-libgloss:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libgloss/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libgloss ] || \
- mkdir $(TARGET_SUBDIR)/libgloss; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \
rm -f $(TARGET_SUBDIR)/libgloss/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libgloss/multilib.out
configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out
@test ! -f $(TARGET_SUBDIR)/libgloss/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libgloss ] || \
- mkdir $(TARGET_SUBDIR)/libgloss;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22611,15 +22588,13 @@ maybe-configure-target-libiberty:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libiberty/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libiberty ] || \
- mkdir $(TARGET_SUBDIR)/libiberty; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \
rm -f $(TARGET_SUBDIR)/libiberty/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libiberty/multilib.out
configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out
@test ! -f $(TARGET_SUBDIR)/libiberty/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libiberty ] || \
- mkdir $(TARGET_SUBDIR)/libiberty;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22714,15 +22689,13 @@ maybe-configure-target-gperf:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/gperf/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/gperf ] || \
- mkdir $(TARGET_SUBDIR)/gperf; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \
rm -f $(TARGET_SUBDIR)/gperf/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/gperf/multilib.out
configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out
@test ! -f $(TARGET_SUBDIR)/gperf/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/gperf ] || \
- mkdir $(TARGET_SUBDIR)/gperf;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22817,15 +22790,13 @@ maybe-configure-target-examples:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/examples/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/examples ] || \
- mkdir $(TARGET_SUBDIR)/examples; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \
rm -f $(TARGET_SUBDIR)/examples/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/examples/multilib.out
configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out
@test ! -f $(TARGET_SUBDIR)/examples/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/examples ] || \
- mkdir $(TARGET_SUBDIR)/examples;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -22912,15 +22883,13 @@ maybe-configure-target-libffi:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libffi/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libffi ] || \
- mkdir $(TARGET_SUBDIR)/libffi; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \
rm -f $(TARGET_SUBDIR)/libffi/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libffi/multilib.out
configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out
@test ! -f $(TARGET_SUBDIR)/libffi/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libffi ] || \
- mkdir $(TARGET_SUBDIR)/libffi;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -23015,15 +22984,13 @@ maybe-configure-target-libjava:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/libjava/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/libjava ] || \
- mkdir $(TARGET_SUBDIR)/libjava; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \
rm -f $(TARGET_SUBDIR)/libjava/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/libjava/multilib.out
configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out
@test ! -f $(TARGET_SUBDIR)/libjava/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/libjava ] || \
- mkdir $(TARGET_SUBDIR)/libjava;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -23119,15 +23086,13 @@ maybe-configure-target-zlib:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/zlib/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/zlib ] || \
- mkdir $(TARGET_SUBDIR)/zlib; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \
rm -f $(TARGET_SUBDIR)/zlib/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/zlib/multilib.out
configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out
@test ! -f $(TARGET_SUBDIR)/zlib/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/zlib ] || \
- mkdir $(TARGET_SUBDIR)/zlib;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -23222,15 +23187,13 @@ maybe-configure-target-boehm-gc:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/boehm-gc/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/boehm-gc ] || \
- mkdir $(TARGET_SUBDIR)/boehm-gc; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \
rm -f $(TARGET_SUBDIR)/boehm-gc/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/boehm-gc/multilib.out
configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out
@test ! -f $(TARGET_SUBDIR)/boehm-gc/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/boehm-gc ] || \
- mkdir $(TARGET_SUBDIR)/boehm-gc;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -23325,15 +23288,13 @@ maybe-configure-target-qthreads:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/qthreads/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/qthreads ] || \
- mkdir $(TARGET_SUBDIR)/qthreads; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \
rm -f $(TARGET_SUBDIR)/qthreads/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/qthreads/multilib.out
configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out
@test ! -f $(TARGET_SUBDIR)/qthreads/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/qthreads ] || \
- mkdir $(TARGET_SUBDIR)/qthreads;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -23428,15 +23389,13 @@ maybe-configure-target-rda:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/rda/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/rda ] || \
- mkdir $(TARGET_SUBDIR)/rda; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \
rm -f $(TARGET_SUBDIR)/rda/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/rda/multilib.out
configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out
@test ! -f $(TARGET_SUBDIR)/rda/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/rda ] || \
- mkdir $(TARGET_SUBDIR)/rda;\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -23691,8 +23650,7 @@ check-gcc-c++:
fi
.PHONY: check-c++
-check-c++:
- $(MAKE) check-target-libstdc++-v3 check-gcc-c++
+check-c++: check-target-libstdc++-v3 check-gcc-c++
.PHONY: install-gcc maybe-install-gcc
maybe-install-gcc:
@@ -23801,7 +23759,7 @@ all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc
all-gzip: maybe-all-libiberty
all-hello: maybe-all-libiberty
all-m4: maybe-all-libiberty maybe-all-texinfo
-all-make: maybe-all-libiberty
+all-make: maybe-all-libiberty maybe-all-intl
all-patch: maybe-all-libiberty
all-prms: maybe-all-libiberty
all-recode: maybe-all-libiberty
diff --git a/Makefile.tpl b/Makefile.tpl
index c34fcb552e4..05626e7450a 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -64,14 +64,10 @@ man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
-# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
-# cygwin host.
-INSTALL_PROGRAM_ARGS =
-
-INSTALL = $(SHELL) $$s/install-sh -c
-INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
-INSTALL_SCRIPT = $(INSTALL)
-INSTALL_DATA = $(INSTALL) -m 644
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
# -------------------------------------------------
# Miscellaneous non-standard autoconf-set variables
@@ -92,7 +88,7 @@ tooldir = @tooldir@
build_tooldir = @build_tooldir@
# Directory in which the compiler finds executables, libraries, etc.
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
GDB_NLM_DEPS =
# This is the name of the environment variable used for the path to
@@ -462,12 +458,10 @@ EXTRA_GCC_FLAGS = \
'AS=$(AS)' \
'CC=$(CC)' \
'CXX=$(CXX)' \
- 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
'BUILD_PREFIX=$(BUILD_PREFIX)' \
'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
'NM=$(NM)' \
'RANLIB=$(RANLIB)' \
- 'WINDRES=$$(WINDRES_FOR_TARGET)' \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
@@ -476,7 +470,6 @@ EXTRA_GCC_FLAGS = \
"`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
@@ -669,8 +662,7 @@ clean-target-libgcc:
# Check target.
.PHONY: check do-check
-check:
- $(MAKE) do-check
+check: do-check
# Only include modules actually being configured and built.
do-check: maybe-check-gcc [+
@@ -783,8 +775,7 @@ TAGS: do-TAGS
maybe-configure-build-[+module+]:
configure-build-[+module+]:
@test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
- [ -d $(BUILD_SUBDIR)/[+module+] ] || \
- mkdir $(BUILD_SUBDIR)/[+module+];\
+ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
AR="$(AR_FOR_BUILD)"; export AR; \
@@ -954,15 +945,13 @@ maybe-configure-target-[+module+]:
# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
$(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
- @[ -d $(TARGET_SUBDIR)/[+module+] ] || \
- mkdir $(TARGET_SUBDIR)/[+module+]; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \
cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out
configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
@test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \
- [ -d $(TARGET_SUBDIR)/[+module+] ] || \
- mkdir $(TARGET_SUBDIR)/[+module+];\
+ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
@@ -1236,8 +1225,7 @@ check-gcc-c++:
fi
.PHONY: check-c++
-check-c++:
- $(MAKE) check-target-libstdc++-v3 check-gcc-c++
+check-c++: check-target-libstdc++-v3 check-gcc-c++
.PHONY: install-gcc maybe-install-gcc
maybe-install-gcc:
@@ -1346,7 +1334,7 @@ all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc
all-gzip: maybe-all-libiberty
all-hello: maybe-all-libiberty
all-m4: maybe-all-libiberty maybe-all-texinfo
-all-make: maybe-all-libiberty
+all-make: maybe-all-libiberty maybe-all-intl
all-patch: maybe-all-libiberty
all-prms: maybe-all-libiberty
all-recode: maybe-all-libiberty
diff --git a/README.SCO b/README.SCO
new file mode 100644
index 00000000000..f86b82b689c
--- /dev/null
+++ b/README.SCO
@@ -0,0 +1,27 @@
+As all users of GCC will know, SCO has recently made claims concerning
+alleged copyright infringement by recent versions of the operating
+system kernel called Linux. SCO has made irresponsible public
+statements about this supposed copyright infringement without
+releasing any evidence of the infringement, and has demanded that
+users of Linux, the kernel most often used with the GNU system, pay
+for a license. This license is incompatible with the GPL, and in the
+opinion of the Free Software Foundation such a demand unquestionably
+violates the GNU General Public License under which the kernel is
+distributed.
+
+We have been urged to drop support for SCO Unix from this release of
+GCC, as a protest against this irresponsible aggression against free
+software and GNU/Linux. However, the direct effect of this action
+would fall on users of GCC rather than on SCO. For the moment, we
+have decided not to take that action. The Free Software Foundation's
+overriding goal is to protect the freedom of the free software
+community, including developers and users, but we also want to serve
+users. Protecting the community from an attack sometimes requires
+steps that will inconvenience some in the community. Such a step is
+not yet necessary, in our view, but we cannot indefinitely continue to
+ignore the aggression against our community taken by a party that has
+long profited from the commercial distribution of our programs. We
+urge users of SCO Unix to make clear to SCO their disapproval of the
+company's aggression against the free software community. We will
+have a further announcement concerning continuing support of SCO Unix
+by GCC before our next release.
diff --git a/boehm-gc/BCC_MAKEFILE b/boehm-gc/BCC_MAKEFILE
index a8e06827ebc..3f86ed56fc4 100644
--- a/boehm-gc/BCC_MAKEFILE
+++ b/boehm-gc/BCC_MAKEFILE
@@ -1,29 +1,31 @@
-# Makefile for Borland C++ 4.5 on NT
-# For Borland 5.0, replace bc45 by bc5.
+# Makefile for Borland C++ 5.5 on NT
# If you have the Borland assembler, remove "-DUSE_GENERIC"
#
-bc= c:\bc45
-bcbin= $(bc)\bin
-bclib= $(bc)\lib
+bc= c:\Borland\BCC55
+bcbin= $(bc)\bin
+bclib= $(bc)\lib
bcinclude= $(bc)\include
-cc= $(bcbin)\bcc32
-rc= $(bcbin)\brc32
-lib= $(bcbin)\tlib
-link= $(bcbin)\tlink32
-cflags= -R -v -vi -H -H=gc.csm -I$(bcinclude);cord -L$(bclib) \
- -w-pro -w-aus -w-par -w-ccc -w-rch -a4 -D__STDC__=0
+gcinclude1 = $(bc)\gc6.2\include
+gcinclude2 = $(bc)\gc6.2\cord
+
+cc= $(bcbin)\bcc32
+rc= $(bcbin)\brc32
+lib= $(bcbin)\tlib
+link= $(bcbin)\ilink32
+cflags= -O2 -R -v- -vi -H -H=gc.csm -I$(bcinclude);$(gcinclude1);$(gcinclude2) -L$(bclib) \
+ -w-pro -w-aus -w-par -w-ccc -w-rch -a4 -D__STDC__=0
#defines= -DSILENT
-defines= -DSMALL_CONFIG -DSILENT -DALL_INTERIOR_POINTERS -DUSE_GENERIC
+defines= -DSMALL_CONFIG -DSILENT -DALL_INTERIOR_POINTERS -DUSE_GENERIC -DNO_GETENV -DJAVA_FINALIZATION -DGC_OPERATOR_NEW_ARRAY
.c.obj:
$(cc) @&&|
- $(cdebug) $(cflags) $(cvars) $(defines) -o$* -c $*.c
+ $(cdebug) $(cflags) $(cvars) $(defines) -o$* -c $*.c
|
.cpp.obj:
$(cc) @&&|
- $(cdebug) $(cflags) $(cvars) $(defines) -o$* -c $*.cpp
+ $(cdebug) $(cflags) $(cvars) $(defines) -o$* -c $*.cpp
|
.rc.res:
@@ -39,31 +41,31 @@ OBJS= $(XXXOBJS:XXX=)
all: gctest.exe cord\de.exe test_cpp.exe
-$(OBJS) test.obj: gc_priv.h gc_hdrs.h gc.h gcconfig.h MAKEFILE
+$(OBJS) test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h MAKEFILE
gc.lib: $(OBJS)
- -del gc.lib
- tlib $* @&&|
- $(XXXOBJS:XXX=+)
+ del gc.lib
+ $(lib) $* @&&|
+ $(XXXOBJS:XXX=+)
|
gctest.exe: tests\test.obj gc.lib
$(cc) @&&|
- $(cflags) -W -e$* tests\test.obj gc.lib
+ $(cflags) -W -e$* tests\test.obj gc.lib
|
-cord\de.obj cord\de_win.obj: cord\cord.h cord\private\cord_pos.h cord\de_win.h \
+cord\de.obj cord\de_win.obj: include\cord.h include\private\cord_pos.h cord\de_win.h \
cord\de_cmds.h
cord\de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\de.obj cord\de_win.obj \
- cord\de_win.res gc.lib
+ cord\de_win.res gc.lib
$(cc) @&&|
- $(cflags) -W -e$* cord\cordbscs.obj cord\cordxtra.obj \
- cord\de.obj cord\de_win.obj gc.lib
+ $(cflags) -W -e$* cord\cordbscs.obj cord\cordxtra.obj \
+ cord\de.obj cord\de_win.obj gc.lib
|
$(rc) cord\de_win.res cord\de.exe
-gc_cpp.obj: gc_cpp.h gc.h
+gc_cpp.obj: include\gc_cpp.h include\gc.h
gc_cpp.cpp: gc_cpp.cc
copy gc_cpp.cc gc_cpp.cpp
@@ -71,12 +73,16 @@ gc_cpp.cpp: gc_cpp.cc
test_cpp.cpp: tests\test_cpp.cc
copy tests\test_cpp.cc test_cpp.cpp
-test_cpp.exe: test_cpp.obj gc_cpp.h gc.h gc.lib
+test_cpp.exe: test_cpp.obj include\gc_cpp.h include\gc.h gc.lib
$(cc) @&&|
- $(cflags) -W -e$* test_cpp.obj gc.lib
+ $(cflags) -W -e$* test_cpp.obj gc.lib
|
scratch:
-del *.obj *.res *.exe *.csm cord\*.obj cord\*.res cord\*.exe cord\*.csm
+clean:
+ del gc.lib
+ del *.obj
+ del tests\test.obj
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index f3d34f22ca2..2d6d229b971 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,134 @@
+2003-09-22 Anthony Green <green@redhat.com>
+
+ * os_dep.c: Fix GC_get_stack_base build problem for vanilla elf
+ "NOSYS" targets.
+
+2003-09-20 <green@redhat.com>
+
+ * include/private/gcconfig.h: Don't check for __XSCALE__. Instead
+ check for __arm__ or __thumb__.
+
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2003-08-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+ Roger Sayle <roger@eyesopen.com>
+
+ * configure.in: Set INCLUDES to absolute path.
+ Save $INCLUDES in boehm-cflags, too.
+ Set INCLUDES so it's available to config.status.
+ * configure: Regenerate.
+
+2003-07-31 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/gc.h (GC_CreateThread): Declare with WINAPI
+ attribute.
+ * win32_threads.c (GC_CreateThread): Make definitions consistent
+ with declaration. Cast &thread_table[i].handle to PHANDLE
+ in call to DuplicateHandle
+ (thread_start): Declare as static.
+
+2003-07-30 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * dyn_load.c: Define __private_extern__ to match Apple's system
+ header.
+
+2003-07-28 Loren J. Rittle <ljrittle@acm.org>
+
+ * os_dep.c: Remove redundancy introduced in last merge.
+
+2003-07-28 Jeff Sturm <jsturm@one-point.com>
+
+ Import GC 6.3alpha1.
+ * BCC_MAKEFILE: Merge with GC 6.3alpha1 release.
+ * ChangeLog: Likewise.
+ * Makefile.am: Likewise.
+ * Makefile.direct: Likewise.
+ * Makefile.dj: Likewise.
+ * allchblk.c: Likewise.
+ * alloc.c: Likewise.
+ * backgraph.c: Likewise.
+ * configure.host: Likewise.
+ * configure.in: Likewise.
+ * dbg_mlc.c: Likewise.
+ * dyn_load.c: Likewise.
+ * finalize.c: Likewise.
+ * gc_cpp.cc: Likewise.
+ * gc_dlopen.c: Likewise.
+ * gcj_mlc.c: Likewise.
+ * if_mach.c: Likewise.
+ * mach_dep.c: Likewise.
+ * malloc.c: Likewise.
+ * mallocx.c: Likewise.
+ * mark.c: Likewise.
+ * mark_rts.c: Likewise.
+ * misc.c: Likewise.
+ * os_dep.c: Likewise.
+ * ptr_chck.c: Likewise.
+ * reclaim.c: Likewise.
+ * solaris_pthreads.c: Likewise.
+ * solaris_threads.c: Likewise.
+ * sparc_mach_dep.S: Likewise.
+ * threadlibs.c: Likewise.
+ * typd_mlc.c: Likewise.
+ * version.h: Likewise.
+ * win32_threads.c: Likewise.
+ * Mac_files/MacOS_Test_config.h: Likewise.
+ * Mac_files/MacOS_config.h: Likewise.
+ * cord/cordbscs.c: Likewise.
+ * cord/cordprnt.c: Likewise.
+ * cord/de_win.c: Likewise.
+ * doc/README: Likewise.
+ * doc/README.MacOSX: Likewise.
+ * doc/README.changes: Likewise.
+ * doc/README.environment: Likewise.
+ * doc/README.ews4800: Likewise.
+ * doc/README.linux: Likewise.
+ * doc/README.macros: Likewise.
+ * doc/README.win32: Likewise.
+ * doc/debugging.html: Likewise.
+ * doc/gcdescr.html: Likewise.
+ * doc/tree.html: Likewise.
+ * include/Makefile.in: Likewise.
+ * include/gc.h: Likewise.
+ * include/gc_cpp.h: Likewise.
+ * include/gc_local_alloc.h: Likewise.
+ * include/gc_mark.h: Likewise.
+ * include/gc_pthread_redirects.h: Likewise.
+ * include/gc_typed.h: Likewise.
+ * include/new_gc_alloc.h: Likewise.
+ * include/private/dbg_mlc.h: Likewise.
+ * include/private/gc_hdrs.h: Likewise.
+ * include/private/gc_locks.h: Likewise.
+ * include/private/gc_pmark.h: Likewise.
+ * include/private/gc_priv.h: Likewise.
+ * include/private/gcconfig.h: Likewise.
+ * include/private/solaris_threads.h: Likewise.
+ * include/private/specific.h: Likewise.
+ * tests/test.c: Likewise.
+ * tests/test_cpp.cc: Likewise.
+
+ * configure: Rebuild.
+ * Makefile.in: Rebuild.
+
+ * mips_sgi_mach_dep.s: Add.
+
+ * alpha_mach_dep.s: Remove.
+ * irix_threads.c: Remove.
+ * linux_threads.c: Remove.
+ * mips_sgi_mach_dep.S: Remove.
+ * missing: Remove.
+ * powerpc_macosx_mach_dep.s: Remove.
+ * doc/Makefile.am: Remove.
+ * doc/Makefile.in: Remove.
+
+2003-07-25 Roger Sayle <roger@eyesopen.com>
+
+ * configure.host: Only use +ESdbgasm when using the HPUX native
+ compiler on PA-Risc. It isn't recognized by GCC and is silently
+ ignored by HP's compilers on ia64.
+
2003-04-28 Mohan Embar <gnustuff@thisiscool.com>
* configure.in: define GC_DLL under mingw if --enable-shared
diff --git a/boehm-gc/Mac_files/MacOS_Test_config.h b/boehm-gc/Mac_files/MacOS_Test_config.h
index c95f4bb2f3e..4e5d2527788 100644
--- a/boehm-gc/Mac_files/MacOS_Test_config.h
+++ b/boehm-gc/Mac_files/MacOS_Test_config.h
@@ -74,7 +74,7 @@
// implementations, and it sometimes has a significant performance
// impact. However, it is dangerous for many not-quite-ANSI C
// programs that call things like printf in asynchronous signal handlers.
-// -DOPERATOR_NEW_ARRAY declares that the C++ compiler supports the
+// -DGC_OPERATOR_NEW_ARRAY declares that the C++ compiler supports the
// new syntax "operator new[]" for allocating and deleting arrays.
// See gc_cpp.h for details. No effect on the C part of the collector.
// This is defined implicitly in a few environments.
diff --git a/boehm-gc/Mac_files/MacOS_config.h b/boehm-gc/Mac_files/MacOS_config.h
index 93c3c97a955..407bdf154a2 100644
--- a/boehm-gc/Mac_files/MacOS_config.h
+++ b/boehm-gc/Mac_files/MacOS_config.h
@@ -72,7 +72,7 @@
// implementations, and it sometimes has a significant performance
// impact. However, it is dangerous for many not-quite-ANSI C
// programs that call things like printf in asynchronous signal handlers.
-// -DOPERATOR_NEW_ARRAY declares that the C++ compiler supports the
+// -DGC_OPERATOR_NEW_ARRAY declares that the C++ compiler supports the
// new syntax "operator new[]" for allocating and deleting arrays.
// See gc_cpp.h for details. No effect on the C part of the collector.
// This is defined implicitly in a few environments.
@@ -86,4 +86,4 @@
// since some ports use malloc or calloc to obtain system memory.
// (Probably works for UNIX, and win32.)
// -DNO_DEBUG removes GC_dump and the debugging routines it calls.
-// Reduces code size slightly at the expense of debuggability. \ No newline at end of file
+// Reduces code size slightly at the expense of debuggability.
diff --git a/boehm-gc/Makefile.am b/boehm-gc/Makefile.am
index 4c22a0f3dac..717af6e4ac1 100644
--- a/boehm-gc/Makefile.am
+++ b/boehm-gc/Makefile.am
@@ -18,15 +18,23 @@ MULTICLEAN = true
noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
+if POWERPC_DARWIN
+asm_libgc_sources = powerpc_darwin_mach_dep.s
+else
+asm_libgc_sources =
+endif
+
GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
-dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c irix_threads.c \
-linux_threads.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
+dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c \
+malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
-backgraph.c win32_threads.c
+backgraph.c win32_threads.c \
+pthread_support.c pthread_stop_world.c darwin_stop_world.c \
+$(asm_libgc_sources)
-EXTRA_GC_SOURCES = alpha_mach_dep.s \
-mips_sgi_mach_dep.S mips_ultrix_mach_dep.s powerpc_macosx_mach_dep.s \
+EXTRA_GC_SOURCES = alpha_mach_dep.S \
+mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
@@ -63,7 +71,9 @@ TESTS = gctest
## FIXME: relies on internal code generated by automake.
all_objs = @addobjs@ $(libgcjgc_la_OBJECTS)
$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
-include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h
+include/private/gc_hdrs.h include/gc.h include/gc_gcj.h \
+include/gc_pthread_redirects.h include/gc_config_macros.h \
+include/gc_mark.h @addincludes@
## FIXME: we shouldn't have to do this, but automake forces us to.
.s.lo:
diff --git a/boehm-gc/Makefile.direct b/boehm-gc/Makefile.direct
index af6192ebc45..a884ee5e0bf 100644
--- a/boehm-gc/Makefile.direct
+++ b/boehm-gc/Makefile.direct
@@ -27,8 +27,11 @@ CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_
# To build the parallel collector on Linux, add to the above:
# -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC
-# To build the parallel collector n a static library on HP/UX, add to the above:
+# To build the parallel collector in a static library on HP/UX,
+# add to the above:
# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -DUSE_HPUX_TLS -D_POSIX_C_SOURCE=199506L
+# To build the thread-safe collector on Tru64, add to the above:
+# -pthread -DGC_OSF1_THREADS
# HOSTCC and HOSTCFLAGS are used to build executables that will be run as
# part of the build process, i.e. on the build machine. These will usually
@@ -60,6 +63,16 @@ HOSTCFLAGS=$(CFLAGS)
# Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp.
# -DGC_LINUX_THREADS enables support for Xavier Leroy's Linux threads.
# see README.linux. -D_REENTRANT may also be required.
+# -DGC_OSF1_THREADS enables support for Tru64 pthreads. Untested.
+# -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads. Untested.
+# Appeared to run into some underlying thread problems.
+# -DGC_DARWIN_THREADS enables support for Mac OS X pthreads. Untested.
+# -DGC_DGUX386_THREADS enables support for DB/UX on I386 threads.
+# See README.DGUX386.
+# -DGC_WIN32_THREADS enables support for win32 threads. That makes sense
+# for this Makefile only under Cygwin.
+# -DGC_THREADS should set the appropriate one of the above macros.
+# It assumes pthreads for Solaris.
# -DALL_INTERIOR_POINTERS allows all pointers to the interior
# of objects to be recognized. (See gc_priv.h for consequences.)
# Alternatively, GC_all_interior_pointers can be set at process
@@ -93,13 +106,15 @@ HOSTCFLAGS=$(CFLAGS)
# See gc_cpp.h for details. No effect on the C part of the collector.
# This is defined implicitly in a few environments. Must also be defined
# by clients that use gc_cpp.h.
-# -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be
-# defined as aliases for X, GC_realloc, and GC_free, respectively.
+# -DREDIRECT_MALLOC=X causes malloc to be defined as alias for X.
+# Unless the following macros are defined, realloc is also redirected
+# to GC_realloc, and free is redirected to GC_free.
# Calloc and strdup are redefined in terms of the new malloc. X should
# be either GC_malloc or GC_malloc_uncollectable, or
# GC_debug_malloc_replacement. (The latter invokes GC_debug_malloc
# with dummy source location information, but still results in
-# properly remembered call stacks on Linux/X86 and Solaris/SPARC.)
+# properly remembered call stacks on Linux/X86 and Solaris/SPARC.
+# It requires that the following two macros also be used.)
# The former is occasionally useful for working around leaks in code
# you don't want to (or can't) look at. It may not work for
# existing code, but it often does. Neither works on all platforms,
@@ -111,6 +126,9 @@ HOSTCFLAGS=$(CFLAGS)
# The canonical use is -DREDIRECT_REALLOC=GC_debug_realloc_replacement,
# together with -DREDIRECT_MALLOC=GC_debug_malloc_replacement to
# generate leak reports with call stacks for both malloc and realloc.
+# This also requires the following:
+# -DREDIRECT_FREE=X causes free to be redirected to X. The
+# canonical use is -DREDIRECT_FREE=GC_debug_free.
# -DIGNORE_FREE turns calls to free into a noop. Only useful with
# -DREDIRECT_MALLOC.
# -DNO_DEBUGGING removes GC_dump and the debugging routines it calls.
@@ -197,8 +215,11 @@ HOSTCFLAGS=$(CFLAGS)
# 15% or so.
# -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style
# prefetch instructions. Same restrictions as USE_I686_PREFETCH.
-# UNTESTED!!
-# -DGC_USE_LD_WRAP in combination with the gld flags listed in README.linux
+# Minimally tested. Didn't appear to be an obvious win on a K6-2/500.
+# -DUSE_PPC_PREFETCH causes the collector to issue PowerPC style
+# prefetch instructions. No effect except on PowerPC OS X platforms.
+# Performance impact untested.
+# -DGC_USE_LD_WRAP in combination with the old flags listed in README.linux
# causes the collector some system and pthread calls in a more transparent
# fashion than the usual macro-based approach. Requires GNU ld, and
# currently probably works only with Linux.
@@ -226,6 +247,24 @@ HOSTCFLAGS=$(CFLAGS)
# -DSTUBBORN_ALLOC allows allocation of "hard to change" objects, and thus
# makes incremental collection easier. Was enabled by default until 6.0.
# Rarely used, to my knowledge.
+# -DHANDLE_FORK attempts to make GC_malloc() work in a child process fork()ed
+# from a multithreaded parent. Currently only supported by pthread_support.c.
+# (Similar code should work on Solaris or Irix, but it hasn't been tried.)
+# -DTEST_WITH_SYSTEM_MALLOC causes gctest to allocate (and leak) large chunks
+# of memory with the standard system malloc. This will cause the root
+# set and collected heap to grow significantly if malloced memory is
+# somehow getting traced by the collector. This has no impact on the
+# generated library; it only affects the test.
+# -DPOINTER_MASK=0x... causes candidate pointers to be ANDed with the
+# given mask before being considered. If either this or the following
+# macro is defined, it will be assumed that all pointers stored in
+# the heap need to be processed this way. Stack and register pointers
+# will be considered both with and without processing.
+# These macros are normally needed only to support systems that use
+# high-order pointer tags. EXPERIMENTAL.
+# -DPOINTER_SHIFT=n causes the collector to left shift candidate pointers
+# by the indicated amount before trying to interpret them. Applied
+# after POINTER_MASK. EXPERIMENTAL. See also the preceding macro.
#
CXXFLAGS= $(CFLAGS)
@@ -233,15 +272,15 @@ AR= ar
RANLIB= ranlib
-OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o
+OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o aix_irix_threads.o pthread_support.o pthread_stop_world.o darwin_stop_world.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o win32_threads.o
-CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c
+CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c aix_irix_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c win32_threads.c
CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c include/cord.h include/ec.h include/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC
CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
-SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \
+SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.S \
sparc_mach_dep.S include/gc.h include/gc_typed.h \
include/private/gc_hdrs.h include/private/gc_priv.h \
include/private/gcconfig.h include/private/gc_pmark.h \
@@ -249,14 +288,17 @@ SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \
threadlibs.c if_mach.c if_not_there.c gc_cpp.cc include/gc_cpp.h \
gcname.c include/weakpointer.h include/private/gc_locks.h \
gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h \
- include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \
- sparc_netbsd_mach_dep.s \
+ include/new_gc_alloc.h include/gc_allocator.h \
+ include/javaxfc.h sparc_sunos4_mach_dep.s sparc_netbsd_mach_dep.s \
include/private/solaris_threads.h include/gc_backptr.h \
hpux_test_and_clear.s include/gc_gcj.h \
include/gc_local_alloc.h include/private/dbg_mlc.h \
- include/private/specific.h powerpc_macosx_mach_dep.s \
+ include/private/specific.h powerpc_darwin_mach_dep.s \
include/leak_detector.h include/gc_amiga_redirects.h \
- include/gc_pthread_redirects.h $(CORD_SRCS)
+ include/gc_pthread_redirects.h ia64_save_regs_in_stack.s \
+ include/gc_config_macros.h include/private/pthread_support.h \
+ include/private/pthread_stop_world.h include/private/darwin_semaphore.h \
+ include/private/darwin_stop_world.h $(CORD_SRCS)
DOC_FILES= README.QUICK doc/README.Mac doc/README.MacOSX doc/README.OS2 \
doc/README.amiga doc/README.cords doc/debugging.html \
@@ -265,15 +307,19 @@ DOC_FILES= README.QUICK doc/README.Mac doc/README.MacOSX doc/README.OS2 \
doc/README.win32 doc/barrett_diagram doc/README \
doc/README.contributors doc/README.changes doc/gc.man \
doc/README.environment doc/tree.html doc/gcdescr.html \
- doc/README.autoconf doc/README.macros doc/README.ews4800
+ doc/README.autoconf doc/README.macros doc/README.ews4800 \
+ doc/README.DGUX386 doc/README.arm.cross doc/leak.html \
+ doc/scale.html doc/gcinterface.html doc/README.darwin
TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \
tests/leak_test.c tests/thread_leak_test.c
GNU_BUILD_FILES= configure.in Makefile.am configure acinclude.m4 \
libtool.m4 install-sh configure.host Makefile.in \
- aclocal.m4 config.sub config.guess ltconfig \
- ltmain.sh mkinstalldirs
+ ltconfig aclocal.m4 config.sub config.guess \
+ include/Makefile.am include/Makefile.in \
+ doc/Makefile.am doc/Makefile.in \
+ ltmain.sh mkinstalldirs depcomp missing
OTHER_MAKEFILES= OS2_MAKEFILE NT_MAKEFILE NT_THREADS_MAKEFILE gc.mak \
BCC_MAKEFILE EMX_MAKEFILE WCC_MAKEFILE Makefile.dj \
@@ -285,7 +331,7 @@ OTHER_FILES= Makefile setjmp_t.c callprocs pc_excludes \
MacProjects.sit.hqx MacOS.c \
Mac_files/datastart.c Mac_files/dataend.c \
Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \
- add_gc_prefix.c gc_cpp.cpp win32_threads.c \
+ add_gc_prefix.c gc_cpp.cpp \
version.h AmigaOS.c \
$(TESTS) $(GNU_BUILD_FILES) $(OTHER_MAKEFILES)
@@ -330,16 +376,16 @@ mach_dep.o $(SRCS)
$(OBJS) tests/test.o dyn_load.o dyn_load_sunos53.o: \
$(srcdir)/include/private/gc_priv.h \
$(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/private/gc_locks.h \
- $(srcdir)/include/gc.h \
+ $(srcdir)/include/gc.h $(srcdir)/include/gc_pthread_redirects.h \
$(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \
- Makefile
+ $(srcdir)/include/gc_config_macros.h Makefile
# The dependency on Makefile is needed. Changing
# options such as -DSILENT affects the size of GC_arrays,
# invalidating all .o files that rely on gc_priv.h
mark.o typd_mlc.o finalize.o ptr_chck.o: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h
-specific.o linux_threads.o: $(srcdir)/include/private/specific.h
+specific.o pthread_support.o: $(srcdir)/include/private/specific.h
solaris_threads.o solaris_pthreads.o: $(srcdir)/include/private/solaris_threads.h
@@ -434,17 +480,18 @@ liblinuxgc.so: $(OBJS) dyn_load.o
# gcc -shared -Wl,-soname=libgc.so.0 -o libgc.so.0 $(LIBOBJS) dyn_load.lo
# touch liblinuxgc.so
-mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s \
- $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_macosx_mach_dep.s $(UTILS)
+mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s \
+ $(srcdir)/mips_ultrix_mach_dep.s \
+ $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_darwin_mach_dep.s \
+ $(srcdir)/sparc_mach_dep.S $(srcdir)/sparc_sunos4_mach_dep.s \
+ $(srcdir)/ia64_save_regs_in_stack.s \
+ $(srcdir)/sparc_netbsd_mach_dep.s $(UTILS)
rm -f mach_dep.o
- ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s
+ ./if_mach MIPS IRIX5 $(CC) -c -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s
./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
- ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s
- ./if_mach POWERPC MACOSX $(AS) -o mach_dep.o $(srcdir)/powerpc_macosx_mach_dep.s
-# ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s
-# alpha_mach_dep.s assumes that pointers are not saved in fp registers.
-# Gcc on a 21264 can spill pointers to fp registers. Oops.
+ ./if_mach POWERPC DARWIN $(AS) -o mach_dep.o $(srcdir)/powerpc_darwin_mach_dep.s
+ ./if_mach ALPHA LINUX $(CC) -c -o mach_dep.o $(srcdir)/alpha_mach_dep.S
./if_mach SPARC SUNOS5 $(CC) -c -o mach_dep.o $(srcdir)/sparc_mach_dep.S
./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s
./if_mach SPARC OPENBSD $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s
@@ -491,7 +538,7 @@ cord/de: $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(UTILS)
./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -lucb `./threadlibs`
./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -ldld `./threadlibs`
./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses
- ./if_mach POWERPC MACOSX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a
+ ./if_mach POWERPC DARWIN $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a
./if_mach I386 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
@@ -510,7 +557,7 @@ if_not_there: $(srcdir)/if_not_there.c
clean:
rm -f gc.a *.o *.exe tests/*.o gctest gctest_dyn_link test_cpp \
setjmp_test mon.out gmon.out a.out core if_not_there if_mach \
- threadlibs $(CORD_OBJS) cord/cordtest cord/de
+ threadlibs $(CORD_OBJS) cord/cordtest cord/de
-rm -f *~
gctest: tests/test.o gc.a $(UTILS)
diff --git a/boehm-gc/Makefile.dj b/boehm-gc/Makefile.dj
index 7aadaf34b44..6097293ff0e 100644
--- a/boehm-gc/Makefile.dj
+++ b/boehm-gc/Makefile.dj
@@ -152,7 +152,7 @@ CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DALL_INTERIO
# currently probably works only with Linux.
-CXXFLAGS= $(CFLAGS) -DOPERATOR_NEW_ARRAY
+CXXFLAGS= $(CFLAGS) -DGC_OPERATOR_NEW_ARRAY
AR= ar
RANLIB= ranlib
@@ -165,8 +165,8 @@ CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordt
CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
-SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \
- sparc_mach_dep.s include/gc.h include/gc_typed.h \
+SRCS= $(CSRCS) mips_sgi_mach_dep.S rs6000_mach_dep.s alpha_mach_dep.S \
+ sparc_mach_dep.S include/gc.h include/gc_typed.h \
include/private/gc_hdrs.h include/private/gc_priv.h \
include/private/gcconfig.h include/private/gc_mark.h \
include/gc_inl.h include/gc_inline.h gc.man \
@@ -177,7 +177,7 @@ SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \
include/private/solaris_threads.h include/gc_backptr.h \
hpux_test_and_clear.s include/gc_gcj.h \
include/gc_local_alloc.h include/private/dbg_mlc.h \
- include/private/specific.h powerpc_macosx_mach_dep.s \
+ include/private/specific.h powerpc_darwin_mach_dep.s \
include/leak_detector.h $(CORD_SRCS)
OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \
@@ -284,16 +284,16 @@ liblinuxgc.so: $(OBJS) dyn_load.o
gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o -lo
ln liblinuxgc.so libgc.so
-mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s \
- $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_macosx_mach_dep.s $(UTILS)
+mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.S $(srcdir)/mips_ultrix_mach_dep.s \
+ $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_darwin_mach_dep.s $(UTILS)
rm -f mach_dep.o
- ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s
+ ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.S
./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s
- ./if_mach POWERPC MACOSX $(AS) -o mach_dep.o $(srcdir)/powerpc_macosx_mach_dep.s
- ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s
- ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.s
+ ./if_mach POWERPC MACOSX $(AS) -o mach_dep.o $(srcdir)/powerpc_darwin_mach_dep.s
+ ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.S
+ ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.S
./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s
./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
diff --git a/boehm-gc/Makefile.in b/boehm-gc/Makefile.in
index edecc834988..4e5bb369e7a 100644
--- a/boehm-gc/Makefile.in
+++ b/boehm-gc/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -66,9 +66,11 @@ target_triplet = @target@
AR = @AR@
AS = @AS@
CC = @CC@
+CFLAGS = @CFLAGS@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
CXXINCLUDES = @CXXINCLUDES@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
@@ -89,7 +91,10 @@ RANLIB = @RANLIB@
STRIP = @STRIP@
THREADLIBS = @THREADLIBS@
VERSION = @VERSION@
+addincludes = @addincludes@
+addlibs = @addlibs@
addobjs = @addobjs@
+addtests = @addtests@
gc_basedir = @gc_basedir@
mkinstalldirs = @mkinstalldirs@
target_all = @target_all@
@@ -109,17 +114,21 @@ MULTIDO = true
MULTICLEAN = true
noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
+@POWERPC_DARWIN_TRUE@asm_libgc_sources = @POWERPC_DARWIN_TRUE@powerpc_darwin_mach_dep.s
+@POWERPC_DARWIN_FALSE@asm_libgc_sources =
GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
-dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c irix_threads.c \
-linux_threads.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
+dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c \
+malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
-backgraph.c win32_threads.c
+backgraph.c win32_threads.c \
+pthread_support.c pthread_stop_world.c darwin_stop_world.c \
+$(asm_libgc_sources)
-EXTRA_GC_SOURCES = alpha_mach_dep.s \
-mips_sgi_mach_dep.S mips_ultrix_mach_dep.s powerpc_macosx_mach_dep.s \
+EXTRA_GC_SOURCES = alpha_mach_dep.S \
+mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
@@ -213,24 +222,53 @@ DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-libgcjgc_la_OBJECTS = allchblk.lo alloc.lo blacklst.lo checksums.lo \
-dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
-irix_threads.lo linux_threads.lo malloc.lo mallocx.lo mark.lo \
-mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo pcr_interface.lo \
-ptr_chck.lo real_malloc.lo reclaim.lo solaris_pthreads.lo \
-solaris_threads.lo specific.lo stubborn.lo typd_mlc.lo backgraph.lo \
-win32_threads.lo
+@POWERPC_DARWIN_FALSE@libgcjgc_la_OBJECTS = allchblk.lo alloc.lo \
+@POWERPC_DARWIN_FALSE@blacklst.lo checksums.lo dbg_mlc.lo dyn_load.lo \
+@POWERPC_DARWIN_FALSE@finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
+@POWERPC_DARWIN_FALSE@aix_irix_threads.lo malloc.lo mallocx.lo mark.lo \
+@POWERPC_DARWIN_FALSE@mark_rts.lo misc.lo new_hblk.lo obj_map.lo \
+@POWERPC_DARWIN_FALSE@os_dep.lo pcr_interface.lo ptr_chck.lo \
+@POWERPC_DARWIN_FALSE@real_malloc.lo reclaim.lo solaris_pthreads.lo \
+@POWERPC_DARWIN_FALSE@solaris_threads.lo specific.lo stubborn.lo \
+@POWERPC_DARWIN_FALSE@typd_mlc.lo backgraph.lo win32_threads.lo \
+@POWERPC_DARWIN_FALSE@pthread_support.lo pthread_stop_world.lo \
+@POWERPC_DARWIN_FALSE@darwin_stop_world.lo
+@POWERPC_DARWIN_TRUE@libgcjgc_la_OBJECTS = allchblk.lo alloc.lo \
+@POWERPC_DARWIN_TRUE@blacklst.lo checksums.lo dbg_mlc.lo dyn_load.lo \
+@POWERPC_DARWIN_TRUE@finalize.lo gc_dlopen.lo gcj_mlc.lo headers.lo \
+@POWERPC_DARWIN_TRUE@aix_irix_threads.lo malloc.lo mallocx.lo mark.lo \
+@POWERPC_DARWIN_TRUE@mark_rts.lo misc.lo new_hblk.lo obj_map.lo \
+@POWERPC_DARWIN_TRUE@os_dep.lo pcr_interface.lo ptr_chck.lo \
+@POWERPC_DARWIN_TRUE@real_malloc.lo reclaim.lo solaris_pthreads.lo \
+@POWERPC_DARWIN_TRUE@solaris_threads.lo specific.lo stubborn.lo \
+@POWERPC_DARWIN_TRUE@typd_mlc.lo backgraph.lo win32_threads.lo \
+@POWERPC_DARWIN_TRUE@pthread_support.lo pthread_stop_world.lo \
+@POWERPC_DARWIN_TRUE@darwin_stop_world.lo powerpc_darwin_mach_dep.lo
libgcjgc_convenience_la_LDFLAGS =
-libgcjgc_convenience_la_OBJECTS = allchblk.lo alloc.lo blacklst.lo \
-checksums.lo dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
-headers.lo irix_threads.lo linux_threads.lo malloc.lo mallocx.lo \
-mark.lo mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo \
-pcr_interface.lo ptr_chck.lo real_malloc.lo reclaim.lo \
-solaris_pthreads.lo solaris_threads.lo specific.lo stubborn.lo \
-typd_mlc.lo backgraph.lo win32_threads.lo
+@POWERPC_DARWIN_FALSE@libgcjgc_convenience_la_OBJECTS = allchblk.lo \
+@POWERPC_DARWIN_FALSE@alloc.lo blacklst.lo checksums.lo dbg_mlc.lo \
+@POWERPC_DARWIN_FALSE@dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
+@POWERPC_DARWIN_FALSE@headers.lo aix_irix_threads.lo malloc.lo \
+@POWERPC_DARWIN_FALSE@mallocx.lo mark.lo mark_rts.lo misc.lo \
+@POWERPC_DARWIN_FALSE@new_hblk.lo obj_map.lo os_dep.lo pcr_interface.lo \
+@POWERPC_DARWIN_FALSE@ptr_chck.lo real_malloc.lo reclaim.lo \
+@POWERPC_DARWIN_FALSE@solaris_pthreads.lo solaris_threads.lo \
+@POWERPC_DARWIN_FALSE@specific.lo stubborn.lo typd_mlc.lo backgraph.lo \
+@POWERPC_DARWIN_FALSE@win32_threads.lo pthread_support.lo \
+@POWERPC_DARWIN_FALSE@pthread_stop_world.lo darwin_stop_world.lo
+@POWERPC_DARWIN_TRUE@libgcjgc_convenience_la_OBJECTS = allchblk.lo \
+@POWERPC_DARWIN_TRUE@alloc.lo blacklst.lo checksums.lo dbg_mlc.lo \
+@POWERPC_DARWIN_TRUE@dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
+@POWERPC_DARWIN_TRUE@headers.lo aix_irix_threads.lo malloc.lo \
+@POWERPC_DARWIN_TRUE@mallocx.lo mark.lo mark_rts.lo misc.lo new_hblk.lo \
+@POWERPC_DARWIN_TRUE@obj_map.lo os_dep.lo pcr_interface.lo ptr_chck.lo \
+@POWERPC_DARWIN_TRUE@real_malloc.lo reclaim.lo solaris_pthreads.lo \
+@POWERPC_DARWIN_TRUE@solaris_threads.lo specific.lo stubborn.lo \
+@POWERPC_DARWIN_TRUE@typd_mlc.lo backgraph.lo win32_threads.lo \
+@POWERPC_DARWIN_TRUE@pthread_support.lo pthread_stop_world.lo \
+@POWERPC_DARWIN_TRUE@darwin_stop_world.lo powerpc_darwin_mach_dep.lo
check_PROGRAMS = gctest$(EXEEXT)
gctest_DEPENDENCIES = ./libgcjgc.la
-CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
DIST_COMMON = ChangeLog Makefile.am Makefile.in acinclude.m4 aclocal.m4 \
@@ -368,7 +406,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
- test "$$subdir" = "." && dot_seen=yes; \
+ test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@@ -598,7 +636,9 @@ mostlyclean distclean maintainer-clean
test.o: tests/test.c
$(COMPILE) -c $(srcdir)/tests/test.c
$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
-include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h
+include/private/gc_hdrs.h include/gc.h include/gc_gcj.h \
+include/gc_pthread_redirects.h include/gc_config_macros.h \
+include/gc_mark.h @addincludes@
.s.lo:
$(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $<
diff --git a/boehm-gc/irix_threads.c b/boehm-gc/aix_irix_threads.c
index 75b7c63125e..d8ac3454af9 100644
--- a/boehm-gc/irix_threads.c
+++ b/boehm-gc/aix_irix_threads.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
- * Copyright (c) 1999 by Hewlett-Packard Company. All rights reserved.
+ * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved.
*
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
@@ -13,22 +13,24 @@
* modified is included with the above copyright notice.
*/
/*
- * Support code for Irix (>=6.2) Pthreads. This relies on properties
+ * Support code for Irix (>=6.2) Pthreads and for AIX pthreads.
+ * This relies on properties
* not guaranteed by the Pthread standard. It may or may not be portable
* to other implementations.
*
- * This now also includes an initial attempt at thread support for
- * HP/UX 11.
+ * Note that there is a lot of code duplication between this file and
+ * (pthread_support.c, pthread_stop_world.c). They should be merged.
+ * Pthread_support.c should be directly usable.
*
- * Note that there is a lot of code duplication between linux_threads.c
- * and irix_threads.c; any changes made here may need to be reflected
- * there too.
+ * Please avoid adding new ports here; use the generic pthread support
+ * as a base instead.
*/
-# if defined(GC_IRIX_THREADS)
+# if defined(GC_IRIX_THREADS) || defined(GC_AIX_THREADS)
# include "private/gc_priv.h"
# include <pthread.h>
+# include <assert.h>
# include <semaphore.h>
# include <time.h>
# include <errno.h>
@@ -39,7 +41,10 @@
#undef pthread_create
#undef pthread_sigmask
#undef pthread_join
-#undef pthread_detach
+
+#if defined(GC_IRIX_THREADS) && !defined(MUTEX_RECURSIVE_NP)
+#define MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+#endif
void GC_thr_init();
@@ -82,13 +87,10 @@ typedef struct GC_Thread_Rep {
word flags;
# define FINISHED 1 /* Thread has exited. */
# define DETACHED 2 /* Thread is intended to be detached. */
-# define CLIENT_OWNS_STACK 4
- /* Stack was supplied by client. */
- ptr_t stack;
- ptr_t stack_ptr; /* Valid only when stopped. */
+ ptr_t stack_cold; /* cold end of the stack */
+ ptr_t stack_hot; /* Valid only when stopped. */
/* But must be within stack region at */
/* all times. */
- size_t stack_size; /* 0 for original thread. */
void * status; /* Used only to avoid premature */
/* reclamation of any data it might */
/* reference. */
@@ -100,8 +102,14 @@ GC_thread GC_lookup_thread(pthread_t id);
* The only way to suspend threads given the pthread interface is to send
* signals. Unfortunately, this means we have to reserve
* a signal, and intercept client calls to change the signal mask.
- * We use SIG_SUSPEND, defined in gc_priv.h.
*/
+#if 0 /* DOB: 6.1 */
+# if defined(GC_AIX_THREADS)
+# define SIG_SUSPEND SIGUSR1
+# else
+# define SIG_SUSPEND (SIGRTMIN + 6)
+# endif
+#endif
pthread_mutex_t GC_suspend_lock = PTHREAD_MUTEX_INITIALIZER;
/* Number of threads stopped so far */
@@ -128,7 +136,7 @@ void GC_suspend_handler(int sig)
return;
}
pthread_mutex_lock(&GC_suspend_lock);
- me -> stack_ptr = (ptr_t)(&dummy);
+ me -> stack_hot = (ptr_t)(&dummy);
me -> stop = STOPPED;
pthread_cond_signal(&GC_suspend_ack_cv);
pthread_cond_wait(&GC_continue_cv, &GC_suspend_lock);
@@ -139,66 +147,6 @@ void GC_suspend_handler(int sig)
GC_bool GC_thr_initialized = FALSE;
-size_t GC_min_stack_sz;
-
-# define N_FREE_LISTS 25
-ptr_t GC_stack_free_lists[N_FREE_LISTS] = { 0 };
- /* GC_stack_free_lists[i] is free list for stacks of */
- /* size GC_min_stack_sz*2**i. */
- /* Free lists are linked through first word. */
-
-/* Return a stack of size at least *stack_size. *stack_size is */
-/* replaced by the actual stack size. */
-/* Caller holds allocation lock. */
-ptr_t GC_stack_alloc(size_t * stack_size)
-{
- register size_t requested_sz = *stack_size;
- register size_t search_sz = GC_min_stack_sz;
- register int index = 0; /* = log2(search_sz/GC_min_stack_sz) */
- register ptr_t result;
-
- while (search_sz < requested_sz) {
- search_sz *= 2;
- index++;
- }
- if ((result = GC_stack_free_lists[index]) == 0
- && (result = GC_stack_free_lists[index+1]) != 0) {
- /* Try next size up. */
- search_sz *= 2; index++;
- }
- if (result != 0) {
- GC_stack_free_lists[index] = *(ptr_t *)result;
- } else {
- result = (ptr_t) GC_scratch_alloc(search_sz + 2*GC_page_size);
- result = (ptr_t)(((word)result + GC_page_size) & ~(GC_page_size - 1));
- /* Protect hottest page to detect overflow. */
-# ifdef STACK_GROWS_UP
- /* mprotect(result + search_sz, GC_page_size, PROT_NONE); */
-# else
- /* mprotect(result, GC_page_size, PROT_NONE); */
- result += GC_page_size;
-# endif
- }
- *stack_size = search_sz;
- return(result);
-}
-
-/* Caller holds allocation lock. */
-void GC_stack_free(ptr_t stack, size_t size)
-{
- register int index = 0;
- register size_t search_sz = GC_min_stack_sz;
-
- while (search_sz < size) {
- search_sz *= 2;
- index++;
- }
- if (search_sz != size) ABORT("Bad stack size");
- *(ptr_t *)stack = GC_stack_free_lists[index];
- GC_stack_free_lists[index] = stack;
-}
-
-
# define THREAD_TABLE_SZ 128 /* Must be power of 2 */
volatile GC_thread GC_threads[THREAD_TABLE_SZ];
@@ -217,13 +165,14 @@ GC_thread GC_new_thread(pthread_t id)
static struct GC_Thread_Rep first_thread;
static GC_bool first_thread_used = FALSE;
+ GC_ASSERT(I_HOLD_LOCK());
if (!first_thread_used) {
result = &first_thread;
first_thread_used = TRUE;
/* Dont acquire allocation lock, since we may already hold it. */
} else {
result = (struct GC_Thread_Rep *)
- GC_INTERNAL_MALLOC(sizeof(struct GC_Thread_Rep), NORMAL);
+ GC_generic_malloc_inner(sizeof(struct GC_Thread_Rep), NORMAL);
}
if (result == 0) return(0);
result -> id = id;
@@ -237,24 +186,8 @@ GC_thread GC_new_thread(pthread_t id)
/* Delete a thread from GC_threads. We assume it is there. */
/* (The code intentionally traps if it wasn't.) */
/* Caller holds allocation lock. */
-void GC_delete_thread(pthread_t id)
-{
- int hv = ((word)id) % THREAD_TABLE_SZ;
- register GC_thread p = GC_threads[hv];
- register GC_thread prev = 0;
-
- while (!pthread_equal(p -> id, id)) {
- prev = p;
- p = p -> next;
- }
- if (prev == 0) {
- GC_threads[hv] = p -> next;
- } else {
- prev -> next = p -> next;
- }
-}
-
-/* If a thread has been joined, but we have not yet */
+/* We explicitly pass in the GC_thread we're looking for, since */
+/* if a thread has been joined, but we have not yet */
/* been notified, then there may be more than one thread */
/* in the table with the same pthread id. */
/* This is OK, but we need a way to delete a specific one. */
@@ -264,6 +197,7 @@ void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
register GC_thread p = GC_threads[hv];
register GC_thread prev = 0;
+ GC_ASSERT(I_HOLD_LOCK());
while (p != gc_id) {
prev = p;
p = p -> next;
@@ -286,10 +220,53 @@ GC_thread GC_lookup_thread(pthread_t id)
int hv = ((word)id) % THREAD_TABLE_SZ;
register GC_thread p = GC_threads[hv];
+ /* I either hold the lock, or i'm being called from the stop-the-world
+ * handler. */
+#if defined(GC_AIX_THREADS)
+ GC_ASSERT(I_HOLD_LOCK()); /* no stop-the-world handler needed on AIX */
+#endif
while (p != 0 && !pthread_equal(p -> id, id)) p = p -> next;
return(p);
}
+#if defined(GC_AIX_THREADS)
+void GC_stop_world()
+{
+ pthread_t my_thread = pthread_self();
+ register int i;
+ register GC_thread p;
+ register int result;
+ struct timespec timeout;
+
+ GC_ASSERT(I_HOLD_LOCK());
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> id != my_thread) {
+ pthread_suspend_np(p->id);
+ }
+ }
+ }
+ /* GC_printf1("World stopped 0x%x\n", pthread_self()); */
+}
+
+void GC_start_world()
+{
+ GC_thread p;
+ unsigned i;
+ pthread_t my_thread = pthread_self();
+
+ /* GC_printf0("World starting\n"); */
+ GC_ASSERT(I_HOLD_LOCK());
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> id != my_thread) {
+ pthread_continue_np(p->id);
+ }
+ }
+ }
+}
+
+#else /* GC_AIX_THREADS */
/* Caller holds allocation lock. */
void GC_stop_world()
@@ -300,6 +277,7 @@ void GC_stop_world()
register int result;
struct timespec timeout;
+ GC_ASSERT(I_HOLD_LOCK());
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (p -> id != my_thread) {
@@ -355,6 +333,7 @@ void GC_start_world()
unsigned i;
/* GC_printf0("World starting\n"); */
+ GC_ASSERT(I_HOLD_LOCK());
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
p -> stop = NOT_STOPPED;
@@ -367,25 +346,8 @@ void GC_start_world()
pthread_cond_broadcast(&GC_continue_cv);
}
-# ifdef MMAP_STACKS
---> not really supported yet.
-int GC_is_thread_stack(ptr_t addr)
-{
- register int i;
- register GC_thread p;
+#endif /* GC_AIX_THREADS */
- for (i = 0; i < THREAD_TABLE_SZ; i++) {
- for (p = GC_threads[i]; p != 0; p = p -> next) {
- if (p -> stack_size != 0) {
- if (p -> stack <= addr &&
- addr < p -> stack + p -> stack_size)
- return 1;
- }
- }
- }
- return 0;
-}
-# endif
/* We hold allocation lock. Should do exactly the right thing if the */
/* world is stopped. Should not fail if it isn't. */
@@ -393,33 +355,59 @@ void GC_push_all_stacks()
{
register int i;
register GC_thread p;
- register ptr_t sp = GC_approx_sp();
register ptr_t hot, cold;
pthread_t me = pthread_self();
- if (!GC_thr_initialized) GC_thr_init();
+ /* GC_init() should have been called before GC_push_all_stacks is
+ * invoked, and GC_init calls GC_thr_init(), which sets
+ * GC_thr_initialized. */
+ GC_ASSERT(GC_thr_initialized);
+
/* GC_printf1("Pushing stacks from thread 0x%x\n", me); */
+ GC_ASSERT(I_HOLD_LOCK());
for (i = 0; i < THREAD_TABLE_SZ; i++) {
for (p = GC_threads[i]; p != 0; p = p -> next) {
if (p -> flags & FINISHED) continue;
+ cold = p->stack_cold;
+ if (!cold) cold=GC_stackbottom; /* 0 indicates 'original stack' */
if (pthread_equal(p -> id, me)) {
hot = GC_approx_sp();
} else {
- hot = p -> stack_ptr;
+# ifdef GC_AIX_THREADS
+ /* AIX doesn't use signals to suspend, so we need to get an */
+ /* accurate hot stack pointer. */
+ /* See http://publib16.boulder.ibm.com/pseries/en_US/libs/basetrf1/pthread_getthrds_np.htm */
+ pthread_t id = p -> id;
+ struct __pthrdsinfo pinfo;
+ int regbuf[64];
+ int val = sizeof(regbuf);
+ int retval = pthread_getthrds_np(&id, PTHRDSINFO_QUERY_ALL, &pinfo,
+ sizeof(pinfo), regbuf, &val);
+ if (retval != 0) {
+ printf("ERROR: pthread_getthrds_np() failed in GC\n");
+ abort();
+ }
+ /* according to the AIX ABI,
+ "the lowest possible valid stack address is 288 bytes (144 + 144)
+ less than the current value of the stack pointer. Functions may
+ use this stack space as volatile storage which is not preserved
+ across function calls."
+ ftp://ftp.penguinppc64.org/pub/people/amodra/PPC-elf64abi.txt.gz
+ */
+ hot = (ptr_t)(unsigned long)pinfo.__pi_ustk-288;
+ cold = (ptr_t)pinfo.__pi_stackend; /* more precise */
+ /* push the registers too, because they won't be on stack */
+ GC_push_all_eager((ptr_t)&pinfo.__pi_context,
+ (ptr_t)((&pinfo.__pi_context)+1));
+ GC_push_all_eager((ptr_t)regbuf, ((ptr_t)regbuf)+val);
+# else
+ hot = p -> stack_hot;
+# endif
}
- if (p -> stack_size != 0) {
-# ifdef STACK_GROWS_UP
- cold = p -> stack;
-# else
- cold = p -> stack + p -> stack_size;
-# endif
- } else {
- /* The original stack. */
- cold = GC_stackbottom;
- }
# ifdef STACK_GROWS_UP
GC_push_all_stack(cold, hot);
# else
+ /* printf("thread 0x%x: hot=0x%08x cold=0x%08x\n", p -> id, hot, cold); */
GC_push_all_stack(hot, cold);
# endif
}
@@ -434,8 +422,14 @@ void GC_thr_init()
struct sigaction act;
if (GC_thr_initialized) return;
+#if 0
+ /* unfortunately, GC_init_inner calls us without the lock, so
+ * this assertion is not always true. */
+ /* Why doesn't GC_init_inner hold the lock? - HB */
+ GC_ASSERT(I_HOLD_LOCK());
+#endif
GC_thr_initialized = TRUE;
- GC_min_stack_sz = HBLKSIZE;
+#ifndef GC_AIX_THREADS
(void) sigaction(SIG_SUSPEND, 0, &act);
if (act.sa_handler != SIG_DFL)
ABORT("Previously installed SIG_SUSPEND handler");
@@ -445,10 +439,13 @@ void GC_thr_init()
(void) sigemptyset(&act.sa_mask);
if (0 != sigaction(SIG_SUSPEND, &act, 0))
ABORT("Failed to install SIG_SUSPEND handler");
+#endif
/* Add the initial thread, so we can stop it. */
t = GC_new_thread(pthread_self());
- t -> stack_size = 0;
- t -> stack_ptr = (ptr_t)(&t);
+ /* use '0' to indicate GC_stackbottom, since GC_init() has not
+ * completed by the time we are called (from GC_init_inner()) */
+ t -> stack_cold = 0; /* the original stack. */
+ t -> stack_hot = (ptr_t)(&t);
t -> flags = DETACHED;
}
@@ -456,6 +453,10 @@ int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
{
sigset_t fudged_set;
+#ifdef GC_AIX_THREADS
+ return(pthread_sigmask(how, set, oset));
+#endif
+
if (set != NULL && (how == SIG_BLOCK || how == SIG_SETMASK)) {
fudged_set = *set;
sigdelset(&fudged_set, SIG_SUSPEND);
@@ -468,10 +469,9 @@ struct start_info {
void *(*start_routine)(void *);
void *arg;
word flags;
- ptr_t stack;
- size_t stack_size;
- sem_t registered; /* 1 ==> in our thread table, but */
- /* parent hasn't yet noticed. */
+ pthread_mutex_t registeredlock;
+ pthread_cond_t registered;
+ int volatile registereddone;
};
void GC_thread_exit_proc(void *arg)
@@ -480,10 +480,10 @@ void GC_thread_exit_proc(void *arg)
LOCK();
me = GC_lookup_thread(pthread_self());
+ me -> flags |= FINISHED;
+ /* reclaim DETACHED thread right away; otherwise wait until join() */
if (me -> flags & DETACHED) {
- GC_delete_thread(pthread_self());
- } else {
- me -> flags |= FINISHED;
+ GC_delete_gc_thread(pthread_self(), me);
}
UNLOCK();
}
@@ -498,42 +498,22 @@ int GC_pthread_join(pthread_t thread, void **retval)
/* This is guaranteed to be the intended one, since the thread id */
/* cant have been recycled by pthreads. */
UNLOCK();
+ GC_ASSERT(!(thread_gc_id->flags & DETACHED));
result = pthread_join(thread, retval);
/* Some versions of the Irix pthreads library can erroneously */
/* return EINTR when the call succeeds. */
if (EINTR == result) result = 0;
- if (result == 0) {
- LOCK();
- /* Here the pthread thread id may have been recycled. */
- GC_delete_gc_thread(thread, thread_gc_id);
- UNLOCK();
- }
- return result;
-}
-
-int GC_pthread_detach(pthread_t thread)
-{
- int result;
- GC_thread thread_gc_id;
-
+ GC_ASSERT(thread_gc_id->flags & FINISHED);
LOCK();
- thread_gc_id = GC_lookup_thread(thread);
+ /* Here the pthread thread id may have been recycled. */
+ GC_delete_gc_thread(thread, thread_gc_id);
UNLOCK();
- result = pthread_detach(thread);
- if (result == 0) {
- LOCK();
- thread_gc_id -> flags |= DETACHED;
- /* Here the pthread thread id may have been recycled. */
- if (thread_gc_id -> flags & FINISHED) {
- GC_delete_gc_thread(thread, thread_gc_id);
- }
- UNLOCK();
- }
return result;
}
void * GC_start_routine(void * arg)
{
+ int dummy;
struct start_info * si = arg;
void * result;
GC_thread me;
@@ -556,17 +536,21 @@ void * GC_start_routine(void * arg)
/* doesn't try to do a pthread_join before we're registered. */
me = GC_new_thread(my_pthread);
me -> flags = si -> flags;
- me -> stack = si -> stack;
- me -> stack_size = si -> stack_size;
- me -> stack_ptr = (ptr_t)si -> stack + si -> stack_size - sizeof(word);
+ me -> stack_cold = (ptr_t) &dummy; /* this now the 'start of stack' */
+ me -> stack_hot = me->stack_cold;/* this field should always be sensible */
UNLOCK();
start = si -> start_routine;
start_arg = si -> arg;
- sem_post(&(si -> registered));
+
+ pthread_mutex_lock(&(si->registeredlock));
+ si->registereddone = 1;
+ pthread_cond_signal(&(si->registered));
+ pthread_mutex_unlock(&(si->registeredlock));
+ /* si went away as soon as we did this unlock */
+
pthread_cleanup_push(GC_thread_exit_proc, 0);
result = (*start)(start_arg);
me -> status = result;
- me -> flags |= FINISHED;
pthread_cleanup_pop(1);
/* This involves acquiring the lock, ensuring that we can't exit */
/* while a collection that thinks we're alive is trying to stop */
@@ -574,8 +558,6 @@ void * GC_start_routine(void * arg)
return(result);
}
-# define copy_attr(pa_ptr, source) *(pa_ptr) = *(source)
-
int
GC_pthread_create(pthread_t *new_thread,
const pthread_attr_t *attr,
@@ -583,69 +565,54 @@ GC_pthread_create(pthread_t *new_thread,
{
int result;
GC_thread t;
- void * stack;
- size_t stacksize;
- pthread_attr_t new_attr;
int detachstate;
word my_flags = 0;
- struct start_info * si = GC_malloc(sizeof(struct start_info));
- /* This is otherwise saved only in an area mmapped by the thread */
- /* library, which isn't visible to the collector. */
+ struct start_info * si;
+ /* This is otherwise saved only in an area mmapped by the thread */
+ /* library, which isn't visible to the collector. */
+ LOCK();
+ /* GC_INTERNAL_MALLOC implicitly calls GC_init() if required */
+ si = (struct start_info *)GC_INTERNAL_MALLOC(sizeof(struct start_info),
+ NORMAL);
+ GC_ASSERT(GC_thr_initialized); /* initialized by GC_init() */
+ UNLOCK();
if (0 == si) return(ENOMEM);
- if (0 != sem_init(&(si -> registered), 0, 0)) {
- ABORT("sem_init failed");
- }
+ pthread_mutex_init(&(si->registeredlock), NULL);
+ pthread_cond_init(&(si->registered),NULL);
+ pthread_mutex_lock(&(si->registeredlock));
si -> start_routine = start_routine;
si -> arg = arg;
- LOCK();
- if (!GC_is_initialized) GC_init();
- if (NULL == attr) {
- stack = 0;
- (void) pthread_attr_init(&new_attr);
- } else {
- copy_attr(&new_attr, attr);
- pthread_attr_getstackaddr(&new_attr, &stack);
- }
- pthread_attr_getstacksize(&new_attr, &stacksize);
- pthread_attr_getdetachstate(&new_attr, &detachstate);
- if (stacksize < GC_min_stack_sz) ABORT("Stack too small");
- if (0 == stack) {
- stack = (void *)GC_stack_alloc(&stacksize);
- if (0 == stack) {
- UNLOCK();
- return(ENOMEM);
- }
- pthread_attr_setstackaddr(&new_attr, stack);
- } else {
- my_flags |= CLIENT_OWNS_STACK;
- }
+
+ pthread_attr_getdetachstate(attr, &detachstate);
if (PTHREAD_CREATE_DETACHED == detachstate) my_flags |= DETACHED;
si -> flags = my_flags;
- si -> stack = stack;
- si -> stack_size = stacksize;
- result = pthread_create(new_thread, &new_attr, GC_start_routine, si);
- if (0 == new_thread && !(my_flags & CLIENT_OWNS_STACK)) {
- GC_stack_free(stack, stacksize);
- }
- UNLOCK();
+ result = pthread_create(new_thread, attr, GC_start_routine, si);
+
/* Wait until child has been added to the thread table. */
/* This also ensures that we hold onto si until the child is done */
/* with it. Thus it doesn't matter whether it is otherwise */
/* visible to the collector. */
- while (0 != sem_wait(&(si -> registered))) {
- if (errno != EINTR) {
- GC_printf1("Sem_wait: errno = %ld\n", (unsigned long) errno);
- ABORT("sem_wait failed");
- }
- }
- sem_destroy(&(si -> registered));
- pthread_attr_destroy(&new_attr); /* Probably unnecessary under Irix */
+
+ if (0 == result) {
+ si->registereddone = 0;
+ while (!si->registereddone)
+ pthread_cond_wait(&(si->registered), &(si->registeredlock));
+ }
+ pthread_mutex_unlock(&(si->registeredlock));
+
+ pthread_cond_destroy(&(si->registered));
+ pthread_mutex_destroy(&(si->registeredlock));
+ LOCK();
+ GC_INTERNAL_FREE(si);
+ UNLOCK();
+
return(result);
}
-VOLATILE GC_bool GC_collecting = 0;
- /* A hint that we're in the collector and */
+/* For now we use the pthreads locking primitives on HP/UX */
+
+VOLATILE GC_bool GC_collecting = 0; /* A hint that we're in the collector and */
/* holding the allocation lock for an */
/* extended period. */
@@ -654,9 +621,9 @@ VOLATILE GC_bool GC_collecting = 0;
#define SLEEP_THRESHOLD 3
-unsigned long GC_allocate_lock = 0;
-# define GC_TRY_LOCK() !GC_test_and_set(&GC_allocate_lock)
-# define GC_LOCK_TAKEN GC_allocate_lock
+volatile unsigned int GC_allocate_lock = 0;
+#define GC_TRY_LOCK() !GC_test_and_set(&GC_allocate_lock)
+#define GC_LOCK_TAKEN GC_allocate_lock
void GC_lock()
{
@@ -716,11 +683,11 @@ yield:
}
}
-# else
+# else /* !GC_IRIX_THREADS && !GC_AIX_THREADS */
#ifndef LINT
int GC_no_Irix_threads;
#endif
-# endif /* GC_IRIX_THREADS */
+# endif /* IRIX_THREADS */
diff --git a/boehm-gc/allchblk.c b/boehm-gc/allchblk.c
index 7d4cbd82f13..2b039397e1c 100644
--- a/boehm-gc/allchblk.c
+++ b/boehm-gc/allchblk.c
@@ -47,12 +47,16 @@ GC_bool GC_use_entire_heap = 0;
struct hblk * GC_hblkfreelist[N_HBLK_FLS+1] = { 0 };
#ifndef USE_MUNMAP
+
word GC_free_bytes[N_HBLK_FLS+1] = { 0 };
/* Number of free bytes on each list. */
/* Is bytes + the number of free bytes on lists n .. N_HBLK_FLS */
/* > GC_max_large_allocd_bytes? */
- GC_bool GC_enough_large_bytes_left(bytes,n)
+# ifdef __GNUC__
+ __inline__
+# endif
+ static GC_bool GC_enough_large_bytes_left(bytes,n)
word bytes;
int n;
{
@@ -583,11 +587,11 @@ int n;
if (!GC_use_entire_heap
&& size_avail != size_needed
&& USED_HEAP_SIZE >= GC_requested_heapsize
- && !GC_incremental && GC_should_collect()) {
+ && !TRUE_INCREMENTAL && GC_should_collect()) {
# ifdef USE_MUNMAP
continue;
# else
- /* If we enough large blocks left to cover any */
+ /* If we have enough large blocks left to cover any */
/* previous request for large blocks, we go ahead */
/* and split. Assuming a steady state, that should */
/* be safe. It means that we can use the full */
@@ -595,6 +599,12 @@ int n;
if (!GC_enough_large_bytes_left(GC_large_allocd_bytes, n)) {
continue;
}
+ /* If we are deallocating lots of memory from */
+ /* finalizers, fail and collect sooner rather */
+ /* than later. */
+ if (GC_finalizer_mem_freed > (GC_heapsize >> 4)) {
+ continue;
+ }
# endif /* !USE_MUNMAP */
}
/* If the next heap block is obviously better, go on. */
diff --git a/boehm-gc/alloc.c b/boehm-gc/alloc.c
index f2e5af05720..f53061f872d 100644
--- a/boehm-gc/alloc.c
+++ b/boehm-gc/alloc.c
@@ -72,6 +72,13 @@ int GC_full_freq = 19; /* Every 20th collection is a full */
GC_bool GC_need_full_gc = FALSE;
/* Need full GC do to heap growth. */
+#ifdef THREADS
+ GC_bool GC_world_stopped = FALSE;
+# define IF_THREADS(x) x
+#else
+# define IF_THREADS(x)
+#endif
+
word GC_used_heap_size_after_full = 0;
char * GC_copyright[] =
@@ -160,7 +167,7 @@ static word min_words_allocd()
+ (GC_large_free_bytes >> 2)
/* use a bit more of large empty heap */
+ total_root_size);
- if (GC_incremental) {
+ if (TRUE_INCREMENTAL) {
return scan_size / (2 * GC_free_space_divisor);
} else {
return scan_size / GC_free_space_divisor;
@@ -182,7 +189,8 @@ word GC_adj_words_allocd()
/* managed object should not alter result, assuming the client */
/* is playing by the rules. */
result = (signed_word)GC_words_allocd
- - (signed_word)GC_mem_freed - expl_managed;
+ - (signed_word)GC_mem_freed
+ + (signed_word)GC_finalizer_mem_freed - expl_managed;
if (result > (signed_word)GC_words_allocd) {
result = GC_words_allocd;
/* probably client bug or unfortunate scheduling */
@@ -250,7 +258,6 @@ void GC_maybe_gc()
if (GC_should_collect()) {
if (!GC_incremental) {
- GC_notify_full_gc();
GC_gcollect_inner();
n_partial_gcs = 0;
return;
@@ -302,10 +309,14 @@ void GC_maybe_gc()
/*
* Stop the world garbage collection. Assumes lock held, signals disabled.
* If stop_func is not GC_never_stop_func, then abort if stop_func returns TRUE.
+ * Return TRUE if we successfully completed the collection.
*/
GC_bool GC_try_to_collect_inner(stop_func)
GC_stop_func stop_func;
{
+# ifdef CONDPRINT
+ CLOCK_TYPE start_time, current_time;
+# endif
if (GC_dont_gc) return FALSE;
if (GC_incremental && GC_collection_in_progress()) {
# ifdef CONDPRINT
@@ -320,8 +331,10 @@ GC_stop_func stop_func;
GC_collect_a_little_inner(1);
}
}
+ if (stop_func == GC_never_stop_func) GC_notify_full_gc();
# ifdef CONDPRINT
if (GC_print_stats) {
+ if (GC_print_stats) GET_TIME(start_time);
GC_printf2(
"Initiating full world-stop collection %lu after %ld allocd bytes\n",
(unsigned long) GC_gc_no+1,
@@ -360,6 +373,13 @@ GC_stop_func stop_func;
return(FALSE);
}
GC_finish_collection();
+# if defined(CONDPRINT)
+ if (GC_print_stats) {
+ GET_TIME(current_time);
+ GC_printf1("Complete collection took %lu msecs\n",
+ MS_TIME_DIFF(current_time,start_time));
+ }
+# endif
return(TRUE);
}
@@ -430,6 +450,7 @@ int GC_collect_a_little GC_PROTO(())
result = (int)GC_collection_in_progress();
UNLOCK();
ENABLE_SIGNALS();
+ if (!result && GC_debugging_started) GC_print_all_smashed();
return(result);
}
@@ -448,16 +469,17 @@ GC_stop_func stop_func;
CLOCK_TYPE start_time, current_time;
# endif
-# if defined(REGISTER_LIBRARIES_EARLY)
- GC_cond_register_dynamic_libraries();
-# endif
- STOP_WORLD();
# ifdef PRINTTIMES
GET_TIME(start_time);
# endif
# if defined(CONDPRINT) && !defined(PRINTTIMES)
if (GC_print_stats) GET_TIME(start_time);
# endif
+# if defined(REGISTER_LIBRARIES_EARLY)
+ GC_cond_register_dynamic_libraries();
+# endif
+ STOP_WORLD();
+ IF_THREADS(GC_world_stopped = TRUE);
# ifdef CONDPRINT
if (GC_print_stats) {
GC_printf1("--> Marking for collection %lu ",
@@ -488,6 +510,7 @@ GC_stop_func stop_func;
}
# endif
GC_deficit = i; /* Give the mutator a chance. */
+ IF_THREADS(GC_world_stopped = FALSE);
START_WORLD();
return(FALSE);
}
@@ -521,6 +544,8 @@ GC_stop_func stop_func;
(*GC_check_heap)();
}
+ IF_THREADS(GC_world_stopped = FALSE);
+ START_WORLD();
# ifdef PRINTTIMES
GET_TIME(current_time);
GC_printf1("World-stopped marking took %lu msecs\n",
@@ -534,7 +559,6 @@ GC_stop_func stop_func;
}
# endif
# endif
- START_WORLD();
return(TRUE);
}
@@ -611,6 +635,7 @@ void GC_finish_collection()
GC_print_address_map();
}
# endif
+ COND_DUMP;
if (GC_find_leak) {
/* Mark all objects on the free list. All objects should be */
/* marked when we're done. */
@@ -707,6 +732,7 @@ void GC_finish_collection()
GC_words_allocd = 0;
GC_words_wasted = 0;
GC_mem_freed = 0;
+ GC_finalizer_mem_freed = 0;
# ifdef USE_MUNMAP
GC_unmap_old();
@@ -730,6 +756,7 @@ void GC_finish_collection()
int result;
DCL_LOCK_STATE;
+ if (GC_debugging_started) GC_print_all_smashed();
GC_INVOKE_FINALIZERS();
DISABLE_SIGNALS();
LOCK();
@@ -741,14 +768,17 @@ void GC_finish_collection()
EXIT_GC();
UNLOCK();
ENABLE_SIGNALS();
- if(result) GC_INVOKE_FINALIZERS();
+ if(result) {
+ if (GC_debugging_started) GC_print_all_smashed();
+ GC_INVOKE_FINALIZERS();
+ }
return(result);
}
void GC_gcollect GC_PROTO(())
{
- GC_notify_full_gc();
(void)GC_try_to_collect(GC_never_stop_func);
+ if (GC_have_errors) GC_print_all_errors();
}
word GC_n_heap_sects = 0; /* Number of sections currently in heap. */
@@ -950,7 +980,6 @@ GC_bool ignore_off_page;
{
if (!GC_incremental && !GC_dont_gc &&
(GC_dont_expand && GC_words_allocd > 0 || GC_should_collect())) {
- GC_notify_full_gc();
GC_gcollect_inner();
} else {
word blocks_to_get = GC_heapsize/(HBLKSIZE*GC_free_space_divisor)
@@ -975,7 +1004,6 @@ GC_bool ignore_off_page;
&& !GC_expand_hp_inner(needed_blocks)) {
if (GC_fail_count++ < GC_max_retries) {
WARN("Out of Memory! Trying to continue ...\n", 0);
- GC_notify_full_gc();
GC_gcollect_inner();
} else {
# if !defined(AMIGA) || !defined(GC_AMIGA_FASTALLOC)
@@ -1005,29 +1033,38 @@ ptr_t GC_allocobj(sz, kind)
word sz;
int kind;
{
- register ptr_t * flh = &(GC_obj_kinds[kind].ok_freelist[sz]);
+ ptr_t * flh = &(GC_obj_kinds[kind].ok_freelist[sz]);
+ GC_bool tried_minor = FALSE;
if (sz == 0) return(0);
while (*flh == 0) {
ENTER_GC();
/* Do our share of marking work */
- if(GC_incremental && !GC_dont_gc) GC_collect_a_little_inner(1);
+ if(TRUE_INCREMENTAL) GC_collect_a_little_inner(1);
/* Sweep blocks for objects of this size */
- GC_continue_reclaim(sz, kind);
+ GC_continue_reclaim(sz, kind);
EXIT_GC();
if (*flh == 0) {
GC_new_hblk(sz, kind);
}
if (*flh == 0) {
ENTER_GC();
- if (!GC_collect_or_expand((word)1,FALSE)) {
+ if (GC_incremental && GC_time_limit == GC_TIME_UNLIMITED
+ && ! tried_minor ) {
+ GC_collect_a_little_inner(1);
+ tried_minor = TRUE;
+ } else {
+ if (!GC_collect_or_expand((word)1,FALSE)) {
EXIT_GC();
return(0);
+ }
}
EXIT_GC();
}
}
+ /* Successful allocation; reset failure count. */
+ GC_fail_count = 0;
return(*flh);
}
diff --git a/boehm-gc/alpha_mach_dep.s b/boehm-gc/alpha_mach_dep.S
index a21f77ad54c..a6f0b8506f5 100644
--- a/boehm-gc/alpha_mach_dep.s
+++ b/boehm-gc/alpha_mach_dep.S
@@ -1,3 +1,4 @@
+ # $Id: alpha_mach_dep.S,v 1.1 2003/07/28 03:46:09 jsturm Exp $
.arch ev6
.text
diff --git a/boehm-gc/backgraph.c b/boehm-gc/backgraph.c
index 01ab738f2f2..0fe1c8f7d36 100644
--- a/boehm-gc/backgraph.c
+++ b/boehm-gc/backgraph.c
@@ -307,6 +307,7 @@ static void add_back_edges(ptr_t p, word n_words, word gc_descr)
}
while (currentp < (word *)(p + gc_descr)) {
word current = *currentp++;
+ FIXUP_POINTER(current);
if (current >= (word)GC_least_plausible_heap_addr &&
current <= (word)GC_greatest_plausible_heap_addr) {
ptr_t target = GC_base((GC_PTR)current);
diff --git a/boehm-gc/configure b/boehm-gc/configure
index ef1a1a76331..0ef1af8e771 100755
--- a/boehm-gc/configure
+++ b/boehm-gc/configure
@@ -41,7 +41,12 @@ ac_help="$ac_help
ac_help="$ac_help
--with-ecos enable runtime eCos target support"
ac_help="$ac_help
- --enable-shared[=PKGS] build shared libraries [default=no]"
+ --enable-shared[=PKGS] build shared libraries [default=yes]"
+ac_help="$ac_help
+ --with-target-subdir=SUBDIR
+ configuring with a cross compiler"
+ac_help="$ac_help
+ --with-cross-host=HOST configuring with a cross compiler"
ac_help="$ac_help
--enable-full-debug include full support for pointer backtracing etc."
@@ -61,7 +66,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -176,7 +180,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -347,11 +350,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -517,16 +515,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -604,7 +598,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# 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:608: checking for a BSD compatible install" >&5
+echo "configure:602: 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
@@ -657,7 +651,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:661: checking whether build environment is sane" >&5
+echo "configure:655: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -714,7 +708,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:718: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:712: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -747,12 +741,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:751: checking for Cygwin environment" >&5
+echo "configure:745: 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 756 "configure"
+#line 750 "configure"
#include "confdefs.h"
int main() {
@@ -763,7 +757,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -780,19 +774,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:784: checking for mingw32 environment" >&5
+echo "configure:778: 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 789 "configure"
+#line 783 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -903,7 +897,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:907: checking host system type" >&5
+echo "configure:901: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -924,7 +918,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:928: checking target system type" >&5
+echo "configure:922: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -942,7 +936,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:946: checking build system type" >&5
+echo "configure:940: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -982,7 +976,7 @@ fi
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:986: checking for working aclocal" >&5
+echo "configure:980: 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.
@@ -995,7 +989,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:999: checking for working autoconf" >&5
+echo "configure:993: 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.
@@ -1008,7 +1002,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1012: checking for working automake" >&5
+echo "configure:1006: 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.
@@ -1021,7 +1015,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1025: checking for working autoheader" >&5
+echo "configure:1019: 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.
@@ -1034,7 +1028,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1038: checking for working makeinfo" >&5
+echo "configure:1032: 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.
@@ -1060,7 +1054,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:1064: checking for $ac_word" >&5
+echo "configure:1058: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1090,7 +1084,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:1094: checking for $ac_word" >&5
+echo "configure:1088: 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
@@ -1139,7 +1133,7 @@ fi
fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1143: checking whether we are using GNU C" >&5
+echo "configure:1137: 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
@@ -1148,7 +1142,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1152: \"$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:1146: \"$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
@@ -1163,7 +1157,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1167: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1161: 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
@@ -1200,7 +1194,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:1204: checking for $ac_word" >&5
+echo "configure:1198: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1233,7 +1227,7 @@ test -n "$CXX" || CXX="gcc"
test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1237: checking whether we are using GNU C++" >&5
+echo "configure:1231: 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
@@ -1242,7 +1236,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1246: \"$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:1240: \"$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
@@ -1257,7 +1251,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:1261: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1255: 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
@@ -1290,7 +1284,7 @@ fi
# NEWLIB_CONFIGURE, which doesn't work because that means that it will
# be run before AC_CANONICAL_HOST.
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1294: checking build system type" >&5
+echo "configure:1288: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1311,7 +1305,7 @@ echo "$ac_t""$build" 1>&6
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1315: checking for $ac_word" >&5
+echo "configure:1309: 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
@@ -1343,7 +1337,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:1347: checking for $ac_word" >&5
+echo "configure:1341: 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
@@ -1375,7 +1369,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:1379: checking for $ac_word" >&5
+echo "configure:1373: 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
@@ -1407,7 +1401,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:1411: checking for $ac_word" >&5
+echo "configure:1405: 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
@@ -1452,7 +1446,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:1456: checking for a BSD compatible install" >&5
+echo "configure:1450: 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
@@ -1506,7 +1500,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:1510: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1504: 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"
@@ -1544,7 +1538,7 @@ if false; then
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1548: checking for executable suffix" >&5
+echo "configure:1542: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1554,10 +1548,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -1676,7 +1670,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:1680: checking for ld used by GCC" >&5
+echo "configure:1674: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1706,10 +1700,10 @@ echo "configure:1680: 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:1710: checking for GNU ld" >&5
+echo "configure:1704: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1713: checking for non-GNU ld" >&5
+echo "configure:1707: 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
@@ -1744,7 +1738,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:1748: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1742: 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
@@ -1761,7 +1755,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:1765: checking for $LD option to reload object files" >&5
+echo "configure:1759: 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
@@ -1773,7 +1767,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:1777: checking for BSD-compatible nm" >&5
+echo "configure:1771: 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
@@ -1811,7 +1805,7 @@ NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1815: checking whether ln -s works" >&5
+echo "configure:1809: 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
@@ -1832,7 +1826,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1836: checking how to recognise dependant libraries" >&5
+echo "configure:1830: 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
@@ -2005,13 +1999,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:2009: checking for object suffix" >&5
+echo "configure:2003: 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:2015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -2035,7 +2029,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:2039: checking for ${ac_tool_prefix}file" >&5
+echo "configure:2033: 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
@@ -2097,7 +2091,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:2101: checking for file" >&5
+echo "configure:2095: 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
@@ -2168,7 +2162,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:2172: checking for $ac_word" >&5
+echo "configure:2166: 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
@@ -2200,7 +2194,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:2204: checking for $ac_word" >&5
+echo "configure:2198: 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
@@ -2235,7 +2229,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:2239: checking for $ac_word" >&5
+echo "configure:2233: 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
@@ -2267,7 +2261,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:2271: checking for $ac_word" >&5
+echo "configure:2265: 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
@@ -2334,8 +2328,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 2338 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2332 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2333: \"$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*)
@@ -2368,7 +2362,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2384,14 +2378,14 @@ 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:2388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -2428,7 +2422,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:2432: checking whether the C compiler needs -belf" >&5
+echo "configure:2426: 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
@@ -2441,14 +2435,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 2445 "configure"
+#line 2439 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2446: \"$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
@@ -2478,7 +2472,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:2482: checking how to run the C++ preprocessor" >&5
+echo "configure:2476: 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
@@ -2491,12 +2485,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 2495 "configure"
+#line 2489 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2494: \"$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
:
@@ -2643,7 +2637,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2647: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2641: 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"
@@ -2676,7 +2670,7 @@ if false; then
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2680: checking for executable suffix" >&5
+echo "configure:2674: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2686,10 +2680,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:2690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:2684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -2709,7 +2703,7 @@ ac_exeext=$EXEEXT
fi
echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
-echo "configure:2713: checking for thread model used by GCC" >&5
+echo "configure:2707: checking for thread model used by GCC" >&5
THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
if test -z "$THREADS"; then
THREADS=no
@@ -2728,7 +2722,7 @@ if test "${enable_parallel_mark+set}" = set; then
fi
-INCLUDES=-I${srcdir}/include
+INCLUDES="-I`cd $srcdir && ${PWDCMD-pwd}`/include"
THREADLIBS=
case "$THREADS" in
no | none | single)
@@ -2738,7 +2732,7 @@ case "$THREADS" in
THREADS=posix
THREADLIBS=-lpthread
case "$host" in
- x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
+ x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux*)
cat >> confdefs.h <<\EOF
#define GC_LINUX_THREADS 1
EOF
@@ -2747,7 +2741,7 @@ EOF
#define _REENTRANT 1
EOF
- if test "${enable_parallel_mark}"; then
+ if test "${enable_parallel_mark}" = yes; then
cat >> confdefs.h <<\EOF
#define PARALLEL_MARK 1
EOF
@@ -2768,6 +2762,16 @@ EOF
EOF
;;
+ *-*-aix*)
+ cat >> confdefs.h <<\EOF
+#define GC_AIX_THREADS 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
+ ;;
*-*-hpux*)
echo "configure: warning: "Only HP/UX 11 threads are supported."" 1>&2
cat >> confdefs.h <<\EOF
@@ -2816,7 +2820,46 @@ EOF
;;
*-*-cygwin*)
- THREADLIBS=
+ cat >> confdefs.h <<\EOF
+#define GC_WIN32_THREADS 1
+EOF
+
+ ;;
+ *-*-darwin*)
+ cat >> confdefs.h <<\EOF
+#define GC_DARWIN_THREADS 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define THREAD_LOCAL_ALLOC 1
+EOF
+
+ if test "${enable_parallel_mark}" = yes; then
+ cat >> confdefs.h <<\EOF
+#define PARALLEL_MARK 1
+EOF
+
+ fi
+ ;;
+ *-*-osf*)
+ cat >> confdefs.h <<\EOF
+#define GC_OSF1_THREADS 1
+EOF
+
+ if test "${enable_parallel_mark}" = yes; then
+ cat >> confdefs.h <<\EOF
+#define PARALLEL_MARK 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define THREAD_LOCAL_ALLOC 1
+EOF
+
+ # May want to enable it in other cases, too.
+ # Measurements havent yet been done.
+ fi
+ INCLUDES="$INCLUDES -pthread"
+ THREADLIBS="-lpthread -lrt"
;;
esac
;;
@@ -2825,16 +2868,48 @@ EOF
#define GC_WIN32_THREADS 1
EOF
- cat >> confdefs.h <<\EOF
+ cat >> confdefs.h <<\EOF
#define NO_GETENV 1
EOF
- if test $enable_shared = yes; then
- cat >> confdefs.h <<\EOF
-#define GC_DLL 1
+ ;;
+ dgux386)
+ THREADS=dgux386
+echo "$ac_t""$THREADLIBS" 1>&6
+ # Use pthread GCC switch
+ THREADLIBS=-pthread
+ if test "${enable_parallel_mark}" = yes; then
+ cat >> confdefs.h <<\EOF
+#define PARALLEL_MARK 1
EOF
fi
+ cat >> confdefs.h <<\EOF
+#define THREAD_LOCAL_ALLOC 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define GC_DGUX386_THREADS 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define DGUX_THREADS 1
+EOF
+
+ # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
+ INCLUDES="-pthread $INCLUDES"
+ ;;
+ aix)
+ THREADS=posix
+ THREADLIBS=-lpthread
+ cat >> confdefs.h <<\EOF
+#define GC_AIX_THREADS 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
;;
decosf1 | irix | mach | os2 | solaris | dce | vxworks)
{ echo "configure: error: thread package $THREADS not yet supported" 1>&2; exit 1; }
@@ -2845,8 +2920,28 @@ EOF
esac
-echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2850: checking for dlopen in -ldl" >&5
+case "$host" in
+ powerpc-*-darwin*)
+ powerpc_darwin=true
+ ;;
+esac
+
+
+if test x$powerpc_darwin = xtrue; then
+ POWERPC_DARWIN_TRUE=
+ POWERPC_DARWIN_FALSE='#'
+else
+ POWERPC_DARWIN_TRUE='#'
+ POWERPC_DARWIN_FALSE=
+fi
+
+# We never want libdl on darwin. It is a fake libdl that just ends up making
+# dyld calls anyway
+case "$host" in
+ *-*-darwin*) ;;
+ *)
+ echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:2945: 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
@@ -2854,7 +2949,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2858 "configure"
+#line 2953 "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
@@ -2865,7 +2960,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2964: \"$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
@@ -2885,6 +2980,9 @@ else
echo "$ac_t""no" 1>&6
fi
+ ;;
+esac
+
target_all=libgcjgc.la
@@ -2901,6 +2999,9 @@ fi
addobjs=
+addlibs=
+addincludes=
+addtests=
CXXINCLUDES=
case "$TARGET_ECOS" in
no)
@@ -2915,17 +3016,31 @@ EOF
;;
esac
+if test "${enable_cplusplus}" = yes; then
+ addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
+ addtests="$addtests test_cpp"
+fi
+if test "${enable_cplusplus}" = yes; then
+ CPLUSPLUS_TRUE=
+ CPLUSPLUS_FALSE='#'
+else
+ CPLUSPLUS_TRUE='#'
+ CPLUSPLUS_FALSE=
+fi
-machdep=
-case "$host" in
- alpha*-*-openbsd*)
- machdep="alpha_mach_dep.lo"
- if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
- echo "configure: warning: OpenBSD/Alpha without dlopen(). Shared library support is disabled" 1>&2
- # Check whether --enable-shared or --disable-shared was given.
+
+
+
+
+
+# Configuration of shared libraries
+#
+echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
+echo "configure:3043: checking whether to build shared libraries" >&5
+# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
p=${PACKAGE-default}
@@ -2945,12 +3060,33 @@ no) enable_shared=no ;;
;;
esac
else
- enable_shared=no
+ enable_shared=yes
fi
+
+case "$host" in
+ alpha-*-openbsd*)
+ enable_shared=no
+ echo "$ac_t""no" 1>&6
+ ;;
+ *)
+ echo "$ac_t""yes" 1>&6
+ ;;
+esac
+
+# Configuration of machine-dependent code
+#
+echo $ac_n "checking which machine-dependent code should be used""... $ac_c" 1>&6
+echo "configure:3081: checking which machine-dependent code should be used" >&5
+machdep=
+case "$host" in
+ alpha*-*-openbsd*)
+ machdep="alpha_mach_dep.lo"
+ if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
+ echo "configure: warning: OpenBSD/Alpha without dlopen(). Shared library support is disabled" 1>&2
fi
;;
- alpha*-*-*)
+ alpha*-*-linux*)
machdep="alpha_mach_dep.lo"
;;
i?86-*-solaris2.[89]*)
@@ -2973,8 +3109,10 @@ EOF
mips-dec-ultrix*)
machdep="mips_ultrix_mach-dep.lo"
;;
- mips*-*-linux*)
+ mips-nec-sysv*|mips-unknown-sysv*)
;;
+ mips*-*-linux*)
+ ;;
mips-*-*)
machdep="mips_sgi_mach_dep.lo"
cat >> confdefs.h <<\EOF
@@ -2982,6 +3120,9 @@ EOF
EOF
;;
+ sparc-*-netbsd*)
+ machdep="sparc_netbsd_mach_dep.lo"
+ ;;
sparc-sun-solaris2.3*)
machdep="sparc_mach_dep.lo"
cat >> confdefs.h <<\EOF
@@ -2997,14 +3138,217 @@ EOF
;;
esac
if test x"$machdep" = x; then
+echo "$ac_t""$machdep" 1>&6
machdep="mach_dep.lo"
fi
addobjs="$addobjs $machdep"
+
+
+
+
+
+
+
+
+
+#
+# Check for AViiON Machines running DGUX
+#
+echo $ac_n "checking if host is AViiON running DGUX""... $ac_c" 1>&6
+echo "configure:3161: checking if host is AViiON running DGUX" >&5
+ac_is_dgux=no
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:3164: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 3179 "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:3185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 3196 "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:3202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 3213 "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:3219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+ac_safe=`echo "sys/dg_sys_info.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6
+echo "configure:3245: checking for sys/dg_sys_info.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 3250 "configure"
+#include "confdefs.h"
+#include <sys/dg_sys_info.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3255: \"$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_is_dgux=yes;
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+echo "$ac_t""$ac_is_dgux" 1>&6
+ ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
+if test $ac_is_dgux = yes; then
+ if test "$enable_full_debug" = "yes"; then
+ CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ else
+ CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ fi
+
+
+fi
+
+# Check whether --with-target-subdir or --without-target-subdir was given.
+if test "${with_target_subdir+set}" = set; then
+ withval="$with_target_subdir"
+ :
+fi
+
+# Check whether --with-cross-host or --without-cross-host was given.
+if test "${with_cross_host+set}" = set; then
+ withval="$with_cross_host"
+ :
+fi
+
+
+# automake wants to see AC_EXEEXT. But we don't need it. And having
+# it is actually a problem, because the compiler we're passed can't
+# necessarily do a full link. So we fool automake here.
+if false; then
+ # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
+ # to nothing, so nothing would remain between `then' and `fi' if it
+ # were not for the `:' below.
+ :
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:3315: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:3325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+fi
+
+echo $ac_n "checking whether Solaris gcc optimization fix is necessary""... $ac_c" 1>&6
+echo "configure:3348: checking whether Solaris gcc optimization fix is necessary" >&5
case "$host" in
- sparc-sun-solaris2*)
+ sparc-sun-solaris2*|*aix*)
if test "$GCC" = yes; then
+ echo "$ac_t""yes" 1>&6
new_CFLAGS=
for i in $CFLAGS; do
case "$i" in
@@ -3016,8 +3360,11 @@ case "$host" in
esac
done
CFLAGS="$new_CFLAGS"
+ else
+ echo "$ac_t""no" 1>&6
fi
;;
+ *) echo "$ac_t""no" 1>&6 ;;
esac
MY_CFLAGS="$CFLAGS"
@@ -3095,6 +3442,12 @@ EOF
EOF
;;
+ i345686-*-dgux*)
+ cat >> confdefs.h <<\EOF
+#define MAKE_BACK_GRAPH 1
+EOF
+
+ ;;
esac
fi
fi
@@ -3311,11 +3664,19 @@ s%@STRIP@%$STRIP%g
s%@LIBTOOL@%$LIBTOOL%g
s%@CXXCPP@%$CXXCPP%g
s%@THREADLIBS@%$THREADLIBS%g
+s%@POWERPC_DARWIN_TRUE@%$POWERPC_DARWIN_TRUE%g
+s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g
s%@EXTRA_TEST_LIBS@%$EXTRA_TEST_LIBS%g
s%@target_all@%$target_all%g
+s%@CPLUSPLUS_TRUE@%$CPLUSPLUS_TRUE%g
+s%@CPLUSPLUS_FALSE@%$CPLUSPLUS_FALSE%g
s%@INCLUDES@%$INCLUDES%g
s%@CXXINCLUDES@%$CXXINCLUDES%g
s%@addobjs@%$addobjs%g
+s%@addincludes@%$addincludes%g
+s%@addlibs@%$addlibs%g
+s%@addtests@%$addtests%g
+s%@CPP@%$CPP%g
s%@MY_CFLAGS@%$MY_CFLAGS%g
s%@toolexecdir@%$toolexecdir%g
s%@toolexeclibdir@%$toolexeclibdir%g
@@ -3327,7 +3688,7 @@ 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=60 # Maximum number of lines to put in a sed script.
+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.
@@ -3431,11 +3792,12 @@ gc_basedir=${gc_basedir}
CC="${CC}"
ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
DEFS="$DEFS"
+INCLUDES="$INCLUDES"
EOF
cat >> $CONFIG_STATUS <<\EOF
-echo "$DEFS" > boehm-cflags
+echo "$INCLUDES $DEFS" > boehm-cflags
if test -n "$CONFIG_FILES"; then
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
diff --git a/boehm-gc/configure.host b/boehm-gc/configure.host
index da2b5b31a0e..a98a0a7cb30 100644
--- a/boehm-gc/configure.host
+++ b/boehm-gc/configure.host
@@ -14,20 +14,28 @@
# host The configuration host
# host_cpu The configuration host CPU
# target_optspace --enable-target-optspace ("yes", "no", "")
+# GCC should be "yes" if using gcc
# It sets the following shell variables:
# gc_cflags Special CFLAGS to use when building
+gc_cflags=""
+
# We should set -fexceptions if we are using gcc and might be used
# inside something like gcj. This is the zeroth approximation:
-case "$host" in
- *-*-linux* )
- gc_cflags=-fexceptions
- ;;
- *-*-hpux* )
- gc_cflags=+ESdbgasm
- ;;
-esac
+if test :"$GCC": = :yes: ; then
+ gc_cflags="${gc_cflags} -fexceptions"
+else
+ case "$host" in
+ hppa*-*-hpux* )
+ if test :$GCC: != :"yes": ; then
+ gc_cflags="${gc_flags} +ESdbgasm"
+ fi
+ # :TODO: actaully we should check using Autoconf if
+ # the compiler supports this option.
+ ;;
+ esac
+fi
case "${target_optspace}:${host}" in
yes:*)
@@ -46,7 +54,7 @@ esac
case "${host}" in
mips-tx39-*|mipstx39-unknown-*)
- boehm_gc_cflags="${boehm_gc_cflags} -G 0"
+ gc_cflags="${gc_cflags} -G 0"
;;
*)
;;
diff --git a/boehm-gc/configure.in b/boehm-gc/configure.in
index 95e9d7cf06e..637c8ad35fd 100644
--- a/boehm-gc/configure.in
+++ b/boehm-gc/configure.in
@@ -63,7 +63,7 @@ AC_ARG_ENABLE(parallel-mark,
esac]
)
-INCLUDES=-I${srcdir}/include
+INCLUDES="-I`cd $srcdir && ${PWDCMD-pwd}`/include"
THREADLIBS=
case "$THREADS" in
no | none | single)
@@ -73,10 +73,10 @@ case "$THREADS" in
THREADS=posix
THREADLIBS=-lpthread
case "$host" in
- x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
+ x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux*)
AC_DEFINE(GC_LINUX_THREADS)
AC_DEFINE(_REENTRANT)
- if test "${enable_parallel_mark}"; then
+ if test "${enable_parallel_mark}" = yes; then
AC_DEFINE(PARALLEL_MARK)
fi
AC_DEFINE(THREAD_LOCAL_ALLOC)
@@ -85,6 +85,10 @@ case "$THREADS" in
AC_DEFINE(GC_LINUX_THREADS)
AC_DEFINE(_REENTRANT)
;;
+ *-*-aix*)
+ AC_DEFINE(GC_AIX_THREADS)
+ AC_DEFINE(_REENTRANT)
+ ;;
*-*-hpux*)
AC_MSG_WARN("Only HP/UX 11 threads are supported.")
AC_DEFINE(GC_HPUX_THREADS)
@@ -109,16 +113,52 @@ case "$THREADS" in
AC_DEFINE(GC_IRIX_THREADS)
;;
*-*-cygwin*)
- THREADLIBS=
+ AC_DEFINE(GC_WIN32_THREADS)
+ ;;
+ *-*-darwin*)
+ AC_DEFINE(GC_DARWIN_THREADS)
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ if test "${enable_parallel_mark}" = yes; then
+ AC_DEFINE(PARALLEL_MARK)
+ fi
+ ;;
+ *-*-osf*)
+ AC_DEFINE(GC_OSF1_THREADS)
+ if test "${enable_parallel_mark}" = yes; then
+ AC_DEFINE(PARALLEL_MARK)
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ # May want to enable it in other cases, too.
+ # Measurements havent yet been done.
+ fi
+ INCLUDES="$INCLUDES -pthread"
+ THREADLIBS="-lpthread -lrt"
;;
esac
;;
win32)
AC_DEFINE(GC_WIN32_THREADS)
+ dnl Wine getenv may not return NULL for missing entry
AC_DEFINE(NO_GETENV)
- if test $enable_shared = yes; then
- AC_DEFINE(GC_DLL)
+ ;;
+ dgux386)
+ THREADS=dgux386
+AC_MSG_RESULT($THREADLIBS)
+ # Use pthread GCC switch
+ THREADLIBS=-pthread
+ if test "${enable_parallel_mark}" = yes; then
+ AC_DEFINE(PARALLEL_MARK)
fi
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ AC_DEFINE(GC_DGUX386_THREADS)
+ AC_DEFINE(DGUX_THREADS)
+ # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
+ INCLUDES="-pthread $INCLUDES"
+ ;;
+ aix)
+ THREADS=posix
+ THREADLIBS=-lpthread
+ AC_DEFINE(GC_AIX_THREADS)
+ AC_DEFINE(_REENTRANT)
;;
decosf1 | irix | mach | os2 | solaris | dce | vxworks)
AC_MSG_ERROR(thread package $THREADS not yet supported)
@@ -129,7 +169,22 @@ case "$THREADS" in
esac
AC_SUBST(THREADLIBS)
-AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
+case "$host" in
+ powerpc-*-darwin*)
+ powerpc_darwin=true
+ ;;
+esac
+AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
+
+# We never want libdl on darwin. It is a fake libdl that just ends up making
+# dyld calls anyway
+case "$host" in
+ *-*-darwin*) ;;
+ *)
+ AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
+ ;;
+esac
+
AC_SUBST(EXTRA_TEST_LIBS)
target_all=libgcjgc.la
@@ -147,6 +202,9 @@ TARGET_ECOS="$with_ecos"
)
addobjs=
+addlibs=
+addincludes=
+addtests=
CXXINCLUDES=
case "$TARGET_ECOS" in
no)
@@ -157,21 +215,46 @@ case "$TARGET_ECOS" in
addobjs="$addobjs ecos.lo"
;;
esac
+
+if test "${enable_cplusplus}" = yes; then
+ addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
+ addtests="$addtests test_cpp"
+fi
+
+AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
+
AC_SUBST(CXX)
AC_SUBST(INCLUDES)
AC_SUBST(CXXINCLUDES)
+# Configuration of shared libraries
+#
+AC_MSG_CHECKING(whether to build shared libraries)
+AC_ENABLE_SHARED
+
+case "$host" in
+ alpha-*-openbsd*)
+ enable_shared=no
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+ ;;
+esac
+
+# Configuration of machine-dependent code
+#
+AC_MSG_CHECKING(which machine-dependent code should be used)
machdep=
case "$host" in
alpha*-*-openbsd*)
machdep="alpha_mach_dep.lo"
if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
- AM_DISABLE_SHARED
fi
;;
- alpha*-*-*)
+ alpha*-*-linux*)
machdep="alpha_mach_dep.lo"
;;
i?86-*-solaris2.[[89]]*)
@@ -185,12 +268,17 @@ case "$host" in
mips-dec-ultrix*)
machdep="mips_ultrix_mach-dep.lo"
;;
- mips*-*-linux*)
+ mips-nec-sysv*|mips-unknown-sysv*)
;;
+ mips*-*-linux*)
+ ;;
mips-*-*)
machdep="mips_sgi_mach_dep.lo"
AC_DEFINE(NO_EXECUTE_PERMISSION)
;;
+ sparc-*-netbsd*)
+ machdep="sparc_netbsd_mach_dep.lo"
+ ;;
sparc-sun-solaris2.3*)
machdep="sparc_mach_dep.lo"
AC_DEFINE(SUNOS53_SHARED_LIB)
@@ -203,16 +291,65 @@ case "$host" in
;;
esac
if test x"$machdep" = x; then
+AC_MSG_RESULT($machdep)
machdep="mach_dep.lo"
fi
addobjs="$addobjs $machdep"
AC_SUBST(addobjs)
+AC_SUBST(addincludes)
+AC_SUBST(addlibs)
+AC_SUBST(addtests)
+
+AC_PROG_LIBTOOL
+
+#
+# Check for AViiON Machines running DGUX
+#
+AC_MSG_CHECKING(if host is AViiON running DGUX)
+ac_is_dgux=no
+AC_CHECK_HEADER(sys/dg_sys_info.h,
+[ac_is_dgux=yes;])
+
+AC_MSG_RESULT($ac_is_dgux)
+ ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
+if test $ac_is_dgux = yes; then
+ if test "$enable_full_debug" = "yes"; then
+ CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ else
+ CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ fi
+ AC_SUBST(CFLAGS)
+ AC_SUBST(CXXFLAGS)
+fi
+
+dnl We use these options to decide which functions to include.
+AC_ARG_WITH(target-subdir,
+[ --with-target-subdir=SUBDIR
+ configuring with a cross compiler])
+AC_ARG_WITH(cross-host,
+[ --with-cross-host=HOST configuring with a cross compiler])
+
+# automake wants to see AC_EXEEXT. But we don't need it. And having
+# it is actually a problem, because the compiler we're passed can't
+# necessarily do a full link. So we fool automake here.
+if false; then
+ # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
+ # to nothing, so nothing would remain between `then' and `fi' if it
+ # were not for the `:' below.
+ :
+ AC_EXEEXT
+fi
dnl As of 4.13a2, the collector will not properly work on Solaris when
dnl built with gcc and -O. So we remove -O in the appropriate case.
+dnl
+AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
case "$host" in
- sparc-sun-solaris2*)
+ sparc-sun-solaris2*|*aix*)
if test "$GCC" = yes; then
+ AC_MSG_RESULT(yes)
new_CFLAGS=
for i in $CFLAGS; do
case "$i" in
@@ -224,8 +361,11 @@ case "$host" in
esac
done
CFLAGS="$new_CFLAGS"
+ else
+ AC_MSG_RESULT(no)
fi
;;
+ *) AC_MSG_RESULT(no) ;;
esac
dnl We need to override the top-level CFLAGS. This is how we do it.
@@ -267,6 +407,9 @@ AC_ARG_ENABLE(full-debug,
AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
AC_DEFINE(SAVE_CALL_COUNT, 8)
;;
+ i[3456]86-*-dgux*)
+ AC_DEFINE(MAKE_BACK_GRAPH)
+ ;;
esac ]
fi)
@@ -293,8 +436,8 @@ else
fi
AC_OUTPUT(Makefile include/Makefile, [
-dnl Put all the -D options in a file.
-echo "$DEFS" > boehm-cflags
+dnl Put all the -I and -D options in a file.
+echo "$INCLUDES $DEFS" > boehm-cflags
if test -n "$CONFIG_FILES"; then
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
@@ -310,4 +453,5 @@ gc_basedir=${gc_basedir}
CC="${CC}"
ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
DEFS="$DEFS"
+INCLUDES="$INCLUDES"
)
diff --git a/boehm-gc/cord/cordbscs.c b/boehm-gc/cord/cordbscs.c
index 9fc894d4946..d83f4067de7 100644
--- a/boehm-gc/cord/cordbscs.c
+++ b/boehm-gc/cord/cordbscs.c
@@ -219,7 +219,7 @@ CORD CORD_cat_char_star(CORD x, const char * y, size_t leny)
result->len = result_len;
result->left = x;
result->right = y;
- if (depth > MAX_DEPTH) {
+ if (depth >= MAX_DEPTH) {
return(CORD_balance((CORD)result));
} else {
return((CORD) result);
@@ -260,7 +260,11 @@ CORD CORD_cat(CORD x, CORD y)
result->len = result_len;
result->left = x;
result->right = y;
- return((CORD) result);
+ if (depth >= MAX_DEPTH) {
+ return(CORD_balance((CORD)result));
+ } else {
+ return((CORD) result);
+ }
}
}
diff --git a/boehm-gc/cord/cordprnt.c b/boehm-gc/cord/cordprnt.c
index 8d57f0467fb..6ecc00e8410 100644
--- a/boehm-gc/cord/cordprnt.c
+++ b/boehm-gc/cord/cordprnt.c
@@ -233,7 +233,7 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args)
if (width == NONE && prec == NONE) {
register char c;
- c = va_arg(args, int);
+ c = (char)va_arg(args, int);
CORD_ec_append(result, c);
goto done;
}
@@ -255,12 +255,18 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args)
/* Use standard sprintf to perform conversion */
{
register char * buf;
- va_list vsprintf_args = args;
- /* The above does not appear to be sanctioned */
- /* by the ANSI C standard. */
+ va_list vsprintf_args;
int max_size = 0;
int res;
-
+# ifdef __va_copy
+ __va_copy(vsprintf_args, args);
+# else
+# if defined(__GNUC__) /* and probably in other cases */
+ va_copy(vsprintf_args, args);
+# else
+ vsprintf_args = args;
+# endif
+# endif
if (width == VARIABLE) width = va_arg(args, int);
if (prec == VARIABLE) prec = va_arg(args, int);
if (width != NONE) max_size = width;
diff --git a/boehm-gc/cord/de_win.c b/boehm-gc/cord/de_win.c
index fedbfbe67c2..0bbd676a335 100644
--- a/boehm-gc/cord/de_win.c
+++ b/boehm-gc/cord/de_win.c
@@ -249,7 +249,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
case IDM_HELPABOUT:
if( DialogBox( hInstance, "ABOUTBOX",
- hwnd, lpfnAboutBox ) );
+ hwnd, lpfnAboutBox ) )
InvalidateRect( hwnd, NULL, TRUE );
return( 0 );
case IDM_HELPCONTENTS:
diff --git a/boehm-gc/darwin_stop_world.c b/boehm-gc/darwin_stop_world.c
new file mode 100644
index 00000000000..bc2247fa4e7
--- /dev/null
+++ b/boehm-gc/darwin_stop_world.c
@@ -0,0 +1,209 @@
+#include "private/pthread_support.h"
+
+# if defined(GC_DARWIN_THREADS)
+
+#define DEBUG_THREADS 0
+
+/* From "Inside Mac OS X - Mach-O Runtime Architecture" published by Apple
+ Page 49:
+ "The space beneath the stack pointer, where a new stack frame would normally
+ be allocated, is called the red zone. This area as shown in Figure 3-2 may
+ be used for any purpose as long as a new stack frame does not need to be
+ added to the stack."
+
+ Page 50: "If a leaf procedure's red zone usage would exceed 224 bytes, then
+ it must set up a stack frame just like routines that call other routines."
+*/
+#define PPC_RED_ZONE_SIZE 224
+
+void GC_push_all_stacks() {
+ int i;
+ kern_return_t r;
+ GC_thread p;
+ pthread_t me;
+ ptr_t lo, hi;
+# if defined(POWERPC)
+ ppc_thread_state_t state;
+# else
+# error FIXME for non-ppc OS X
+# endif
+ mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
+
+ me = pthread_self();
+ if (!GC_thr_initialized) GC_thr_init();
+
+ for(i=0;i<THREAD_TABLE_SZ;i++) {
+ for(p=GC_threads[i];p!=0;p=p->next) {
+ if(p -> flags & FINISHED) continue;
+ if(pthread_equal(p->id,me)) {
+ lo = GC_approx_sp();
+ } else {
+ /* Get the thread state (registers, etc) */
+ r = thread_get_state(
+ p->stop_info.mach_thread,
+ MACHINE_THREAD_STATE,
+ (natural_t*)&state,
+ &thread_state_count);
+ if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
+
+ #ifdef POWERPC
+ lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);
+
+ GC_push_one(state.r0);
+ GC_push_one(state.r2);
+ GC_push_one(state.r3);
+ GC_push_one(state.r4);
+ GC_push_one(state.r5);
+ GC_push_one(state.r6);
+ GC_push_one(state.r7);
+ GC_push_one(state.r8);
+ GC_push_one(state.r9);
+ GC_push_one(state.r10);
+ GC_push_one(state.r11);
+ GC_push_one(state.r12);
+ GC_push_one(state.r13);
+ GC_push_one(state.r14);
+ GC_push_one(state.r15);
+ GC_push_one(state.r16);
+ GC_push_one(state.r17);
+ GC_push_one(state.r18);
+ GC_push_one(state.r19);
+ GC_push_one(state.r20);
+ GC_push_one(state.r21);
+ GC_push_one(state.r22);
+ GC_push_one(state.r23);
+ GC_push_one(state.r24);
+ GC_push_one(state.r25);
+ GC_push_one(state.r26);
+ GC_push_one(state.r27);
+ GC_push_one(state.r28);
+ GC_push_one(state.r29);
+ GC_push_one(state.r30);
+ GC_push_one(state.r31);
+ #else
+ # error FIXME for non-PPC darwin
+ #endif /* !POWERPC */
+ } /* p != me */
+ if(p->flags & MAIN_THREAD)
+ hi = GC_stackbottom;
+ else
+ hi = p->stack_end;
+ #if DEBUG_THREADS
+ GC_printf3("Darwin: Stack for thread 0x%lx = [%lx,%lx)\n",
+ (unsigned long) p -> id,
+ (unsigned long) lo,
+ (unsigned long) hi
+ );
+ #endif
+ GC_push_all_stack(lo,hi);
+ } /* for(p=GC_threads[i]...) */
+ } /* for(i=0;i<THREAD_TABLE_SZ...) */
+}
+
+/* Caller holds allocation lock. */
+void GC_stop_world()
+{
+ int i;
+ GC_thread p;
+ pthread_t my_thread = pthread_self();
+ kern_return_t kern_result;
+
+ #if DEBUG_THREADS
+ GC_printf1("Stopping the world from 0x%lx\n", pthread_self());
+ #endif
+
+ /* Make sure all free list construction has stopped before we start. */
+ /* No new construction can start, since free list construction is */
+ /* required to acquire and release the GC lock before it starts, */
+ /* and we have the lock. */
+# ifdef PARALLEL_MARK
+ GC_acquire_mark_lock();
+ GC_ASSERT(GC_fl_builder_count == 0);
+ /* We should have previously waited for it to become zero. */
+# endif /* PARALLEL_MARK */
+
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> id == my_thread) continue;
+ if (p -> flags & FINISHED) continue;
+ if (p -> thread_blocked) /* Will wait */ continue;
+
+ #if DEBUG_THREADS
+ GC_printf1("Suspending thread 0x%lx\n", p -> id);
+ #endif
+
+ /* Suspend the thread */
+ kern_result = thread_suspend(p->stop_info.mach_thread);
+ if(kern_result != KERN_SUCCESS) ABORT("thread_suspend failed");
+
+ /* This is only needed if we are modifying the threads
+ state. thread_abort_safely should also be used
+ if this code is ever added in again.
+
+ kern_result = thread_abort(p->stop_info.mach_thread);
+ if(kern_result != KERN_SUCCESS)
+ ABORT("thread_abort failed (%ul)",kern_result);
+ */
+ }
+ }
+
+# ifdef MPROTECT_VDB
+ if(GC_incremental) {
+ extern void GC_mprotect_stop();
+ GC_mprotect_stop();
+ }
+# endif
+
+# ifdef PARALLEL_MARK
+ GC_release_mark_lock();
+# endif
+ #if DEBUG_THREADS
+ GC_printf1("World stopped from 0x%lx\n", pthread_self());
+ #endif
+}
+
+/* Caller holds allocation lock, and has held it continuously since */
+/* the world stopped. */
+void GC_start_world()
+{
+ pthread_t my_thread = pthread_self();
+ int i;
+ GC_thread p;
+ kern_return_t kern_result;
+
+# if DEBUG_THREADS
+ GC_printf0("World starting\n");
+# endif
+
+# ifdef MPROTECT_VDB
+ if(GC_incremental) {
+ extern void GC_mprotect_resume();
+ GC_mprotect_resume();
+ }
+# endif
+
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> id == my_thread) continue;
+ if (p -> flags & FINISHED) continue;
+ if (p -> thread_blocked) continue;
+
+ #if DEBUG_THREADS
+ GC_printf1("Resuming 0x%lx\n", p -> id);
+ #endif
+
+ /* Resume the thread */
+ kern_result = thread_resume(p->stop_info.mach_thread);
+ if(kern_result != KERN_SUCCESS) ABORT("thread_resume failed");
+ }
+ }
+ #if DEBUG_THREADS
+ GC_printf0("World started\n");
+ #endif
+}
+
+void GC_stop_init() {
+
+}
+
+#endif
diff --git a/boehm-gc/dbg_mlc.c b/boehm-gc/dbg_mlc.c
index 57de3dab28c..f640930d901 100644
--- a/boehm-gc/dbg_mlc.c
+++ b/boehm-gc/dbg_mlc.c
@@ -60,7 +60,7 @@ ptr_t p;
# include <stdlib.h>
# if defined(LINUX) || defined(SUNOS4) || defined(SUNOS5) \
- || defined(HPUX) || defined(IRIX) || defined(OSF1)
+ || defined(HPUX) || defined(IRIX5) || defined(OSF1)
# define RANDOM() random()
# else
# define RANDOM() (long)rand()
@@ -228,6 +228,8 @@ ptr_t p;
#endif /* KEEP_BACK_PTRS */
+# define CROSSES_HBLK(p, sz) \
+ (((word)(p + sizeof(oh) + sz - 1) ^ (word)p) >= HBLKSIZE)
/* Store debugging info into p. Return displaced pointer. */
/* Assumes we don't hold allocation lock. */
ptr_t GC_store_debug_info(p, sz, string, integer)
@@ -243,6 +245,8 @@ word integer;
/* But that's expensive. And this way things should only appear */
/* inconsistent while we're in the handler. */
LOCK();
+ GC_ASSERT(GC_size(p) >= sizeof(oh) + sz);
+ GC_ASSERT(!(SMALL_OBJ(sz) && CROSSES_HBLK(p, sz)));
# ifdef KEEP_BACK_PTRS
((oh *)p) -> oh_back_ptr = HIDE_BACK_PTR(NOT_MARKED);
# endif
@@ -275,6 +279,8 @@ word integer;
/* There is some argument that we should disable signals here. */
/* But that's expensive. And this way things should only appear */
/* inconsistent while we're in the handler. */
+ GC_ASSERT(GC_size(p) >= sizeof(oh) + sz);
+ GC_ASSERT(!(SMALL_OBJ(sz) && CROSSES_HBLK(p, sz)));
# ifdef KEEP_BACK_PTRS
((oh *)p) -> oh_back_ptr = HIDE_BACK_PTR(NOT_MARKED);
# endif
@@ -324,10 +330,11 @@ ptr_t p;
{
register oh * ohdr = (oh *)GC_base(p);
+ GC_ASSERT(!I_HOLD_LOCK());
GC_err_printf1("0x%lx (", ((unsigned long)ohdr + sizeof(oh)));
GC_err_puts(ohdr -> oh_string);
# ifdef SHORT_DBG_HDRS
- GC_err_printf1(":%ld, sz=%ld)\n", (unsigned long)(ohdr -> oh_int));
+ GC_err_printf1(":%ld)\n", (unsigned long)(ohdr -> oh_int));
# else
GC_err_printf2(":%ld, sz=%ld)\n", (unsigned long)(ohdr -> oh_int),
(unsigned long)(ohdr -> oh_sz));
@@ -342,6 +349,7 @@ ptr_t p;
ptr_t p;
# endif
{
+ GC_ASSERT(!I_HOLD_LOCK());
if (GC_HAS_DEBUG_INFO(p)) {
GC_print_obj(p);
} else {
@@ -355,6 +363,7 @@ ptr_t p, clobbered_addr;
{
register oh * ohdr = (oh *)GC_base(p);
+ GC_ASSERT(!I_HOLD_LOCK());
GC_err_printf2("0x%lx in object at 0x%lx(", (unsigned long)clobbered_addr,
(unsigned long)p);
if (clobbered_addr <= (ptr_t)(&(ohdr -> oh_sz))
@@ -376,14 +385,18 @@ ptr_t p, clobbered_addr;
void GC_check_heap_proc GC_PROTO((void));
+void GC_print_all_smashed_proc GC_PROTO((void));
+
void GC_do_nothing() {}
void GC_start_debugging()
{
# ifndef SHORT_DBG_HDRS
GC_check_heap = GC_check_heap_proc;
+ GC_print_all_smashed = GC_print_all_smashed_proc;
# else
GC_check_heap = GC_do_nothing;
+ GC_print_all_smashed = GC_do_nothing;
# endif
GC_print_heap_obj = GC_debug_print_heap_obj_proc;
GC_debugging_started = TRUE;
@@ -429,6 +442,62 @@ void GC_start_debugging()
return (GC_store_debug_info(result, (word)lb, s, (word)i));
}
+# ifdef __STDC__
+ GC_PTR GC_debug_malloc_ignore_off_page(size_t lb, GC_EXTRA_PARAMS)
+# else
+ GC_PTR GC_debug_malloc_ignore_off_page(lb, s, i)
+ size_t lb;
+ char * s;
+ int i;
+# ifdef GC_ADD_CALLER
+ --> GC_ADD_CALLER not implemented for K&R C
+# endif
+# endif
+{
+ GC_PTR result = GC_malloc_ignore_off_page(lb + DEBUG_BYTES);
+
+ if (result == 0) {
+ GC_err_printf1("GC_debug_malloc_ignore_off_page(%ld) returning NIL (",
+ (unsigned long) lb);
+ GC_err_puts(s);
+ GC_err_printf1(":%ld)\n", (unsigned long)i);
+ return(0);
+ }
+ if (!GC_debugging_started) {
+ GC_start_debugging();
+ }
+ ADD_CALL_CHAIN(result, ra);
+ return (GC_store_debug_info(result, (word)lb, s, (word)i));
+}
+
+# ifdef __STDC__
+ GC_PTR GC_debug_malloc_atomic_ignore_off_page(size_t lb, GC_EXTRA_PARAMS)
+# else
+ GC_PTR GC_debug_malloc_atomic_ignore_off_page(lb, s, i)
+ size_t lb;
+ char * s;
+ int i;
+# ifdef GC_ADD_CALLER
+ --> GC_ADD_CALLER not implemented for K&R C
+# endif
+# endif
+{
+ GC_PTR result = GC_malloc_atomic_ignore_off_page(lb + DEBUG_BYTES);
+
+ if (result == 0) {
+ GC_err_printf1("GC_debug_malloc_atomic_ignore_off_page(%ld)"
+ " returning NIL (", (unsigned long) lb);
+ GC_err_puts(s);
+ GC_err_printf1(":%ld)\n", (unsigned long)i);
+ return(0);
+ }
+ if (!GC_debugging_started) {
+ GC_start_debugging();
+ }
+ ADD_CALL_CHAIN(result, ra);
+ return (GC_store_debug_info(result, (word)lb, s, (word)i));
+}
+
# ifdef DBG_HDRS_ALL
/*
* An allocation function for internal use.
@@ -447,7 +516,7 @@ void GC_start_debugging()
(unsigned long) lb);
return(0);
}
- ADD_CALL_CHAIN(result, ra);
+ ADD_CALL_CHAIN(result, GC_RETURN_ADDR);
return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", (word)0));
}
@@ -461,7 +530,7 @@ void GC_start_debugging()
(unsigned long) lb);
return(0);
}
- ADD_CALL_CHAIN(result, ra);
+ ADD_CALL_CHAIN(result, GC_RETURN_ADDR);
return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", (word)0));
}
# endif
@@ -592,7 +661,7 @@ GC_PTR p;
int i;
# endif
{
- GC_PTR result = GC_malloc_uncollectable(lb + DEBUG_BYTES);
+ GC_PTR result = GC_malloc_uncollectable(lb + UNCOLLECTABLE_DEBUG_BYTES);
if (result == 0) {
GC_err_printf1("GC_debug_malloc_uncollectable(%ld) returning NIL (",
@@ -618,7 +687,8 @@ GC_PTR p;
int i;
# endif
{
- GC_PTR result = GC_malloc_atomic_uncollectable(lb + DEBUG_BYTES);
+ GC_PTR result =
+ GC_malloc_atomic_uncollectable(lb + UNCOLLECTABLE_DEBUG_BYTES);
if (result == 0) {
GC_err_printf1(
@@ -774,6 +844,45 @@ void GC_debug_free_inner(GC_PTR p)
}
#ifndef SHORT_DBG_HDRS
+
+/* List of smashed objects. We defer printing these, since we can't */
+/* always print them nicely with the allocation lock held. */
+/* We put them here instead of in GC_arrays, since it may be useful to */
+/* be able to look at them with the debugger. */
+#define MAX_SMASHED 20
+ptr_t GC_smashed[MAX_SMASHED];
+unsigned GC_n_smashed = 0;
+
+# if defined(__STDC__) || defined(__cplusplus)
+ void GC_add_smashed(ptr_t smashed)
+# else
+ void GC_add_smashed(smashed)
+ ptr_t smashed;
+#endif
+{
+ GC_ASSERT(GC_is_marked(GC_base(smashed)));
+ GC_smashed[GC_n_smashed] = smashed;
+ if (GC_n_smashed < MAX_SMASHED - 1) ++GC_n_smashed;
+ /* In case of overflow, we keep the first MAX_SMASHED-1 */
+ /* entries plus the last one. */
+ GC_have_errors = TRUE;
+}
+
+/* Print all objects on the list. Clear the list. */
+void GC_print_all_smashed_proc ()
+{
+ unsigned i;
+
+ GC_ASSERT(!I_HOLD_LOCK());
+ if (GC_n_smashed == 0) return;
+ GC_err_printf0("GC_check_heap_block: found smashed heap objects:\n");
+ for (i = 0; i < GC_n_smashed; ++i) {
+ GC_print_smashed_obj(GC_base(GC_smashed[i]), GC_smashed[i]);
+ GC_smashed[i] = 0;
+ }
+ GC_n_smashed = 0;
+}
+
/* Check all marked objects in the given block for validity */
/*ARGSUSED*/
# if defined(__STDC__) || defined(__cplusplus)
@@ -802,11 +911,7 @@ void GC_debug_free_inner(GC_PTR p)
&& GC_HAS_DEBUG_INFO((ptr_t)p)) {
ptr_t clobbered = GC_check_annotated_obj((oh *)p);
- if (clobbered != 0) {
- GC_err_printf0(
- "GC_check_heap_block: found smashed location at ");
- GC_print_smashed_obj((ptr_t)p, clobbered);
- }
+ if (clobbered != 0) GC_add_smashed(clobbered);
}
word_no += sz;
p += sz;
@@ -819,9 +924,11 @@ void GC_debug_free_inner(GC_PTR p)
void GC_check_heap_proc()
{
# ifndef SMALL_CONFIG
- if (sizeof(oh) & (2 * sizeof(word) - 1) != 0) {
- ABORT("Alignment problem: object header has inappropriate size\n");
- }
+# ifdef ALIGN_DOUBLE
+ GC_STATIC_ASSERT((sizeof(oh) & (2 * sizeof(word) - 1)) == 0);
+# else
+ GC_STATIC_ASSERT((sizeof(oh) & (sizeof(word) - 1)) == 0);
+# endif
# endif
GC_apply_to_all_blocks(GC_check_heap_block, (word)0);
}
@@ -842,12 +949,12 @@ struct closure {
# endif
{
struct closure * result =
-# ifdef DBG_HDRS_ALL
- (struct closure *) GC_debug_malloc(sizeof (struct closure),
- GC_EXTRAS);
-# else
- (struct closure *) GC_malloc(sizeof (struct closure));
-# endif
+# ifdef DBG_HDRS_ALL
+ (struct closure *) GC_debug_malloc(sizeof (struct closure),
+ GC_EXTRAS);
+# else
+ (struct closure *) GC_malloc(sizeof (struct closure));
+# endif
result -> cl_fn = fn;
result -> cl_data = data;
@@ -908,7 +1015,7 @@ GC_PTR *ocd;
ptr_t base = GC_base(obj);
if (0 == base || (ptr_t)obj - base != sizeof(oh)) {
GC_err_printf1(
- "GC_register_finalizer called with non-base-pointer 0x%lx\n",
+ "GC_debug_register_finalizer called with non-base-pointer 0x%lx\n",
obj);
}
if (0 == fn) {
@@ -940,7 +1047,7 @@ GC_PTR *ocd;
ptr_t base = GC_base(obj);
if (0 == base || (ptr_t)obj - base != sizeof(oh)) {
GC_err_printf1(
- "GC_register_finalizer_no_order called with non-base-pointer 0x%lx\n",
+ "GC_debug_register_finalizer_no_order called with non-base-pointer 0x%lx\n",
obj);
}
if (0 == fn) {
@@ -973,7 +1080,7 @@ GC_PTR *ocd;
ptr_t base = GC_base(obj);
if (0 == base || (ptr_t)obj - base != sizeof(oh)) {
GC_err_printf1(
- "GC_register_finalizer_ignore_self called with non-base-pointer 0x%lx\n",
+ "GC_debug_register_finalizer_ignore_self called with non-base-pointer 0x%lx\n",
obj);
}
if (0 == fn) {
diff --git a/boehm-gc/depcomp b/boehm-gc/depcomp
new file mode 100755
index 00000000000..3480ce4e96d
--- /dev/null
+++ b/boehm-gc/depcomp
@@ -0,0 +1,436 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 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, 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 Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+if test -z "$depfile"; then
+ base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+ dir=`echo "$object" | sed 's,/.*$,/,'`
+ if test "$dir" = "$object"; then
+ dir=
+ fi
+ # FIXME: should be _deps on DOS.
+ depfile="$dir.deps/$base"
+fi
+
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. This file always lives in the current directory.
+ # Also, the AIX compiler puts `$object:' at the start of each line;
+ # $object doesn't have directory information.
+ stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ outname="$stripped.o"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+
+ base=`echo "$object" | sed -e 's/\.o$//' -e 's/\.lo$//'`
+ tmpdepfile1="$base.o.d"
+ tmpdepfile2="$base.d"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-MD
+ else
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ fi
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a space and a tab in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ test -z "$dashmflag" && dashmflag=-M
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*) # this is libtool, let us make it quiet
+ for arg
+ do # cycle over the arguments
+ case "$arg" in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ # X makedepend
+ (
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in no)
+ set ""; shift
+ cleared=yes
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift;;
+ -*)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/boehm-gc/doc/README b/boehm-gc/doc/README
index 6ac37c6c8ce..29d954f023e 100644
--- a/boehm-gc/doc/README
+++ b/boehm-gc/doc/README
@@ -1,7 +1,7 @@
Copyright (c) 1988, 1989 Hans-J. Boehm, Alan J. Demers
Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved.
Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
-Copyright (c) 1999-2001 by Hewlett-Packard Company. All rights reserved.
+Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved.
The file linux_threads.c is also
Copyright (c) 1998 by Fergus Henderson. All rights reserved.
@@ -9,8 +9,9 @@ Copyright (c) 1998 by Fergus Henderson. All rights reserved.
The files Makefile.am, and configure.in are
Copyright (c) 2001 by Red Hat Inc. All rights reserved.
-The files config.guess and a few others are copyrighted by the Free
-Software Foundation.
+Several files supporting GNU-style builds are copyrighted by the Free
+Software Foundation, and carry a different license from that given
+below.
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
@@ -27,7 +28,7 @@ are GPL'ed, but with an exception that should cover all uses in the
collector. (If you are concerned about such things, I recommend you look
at the notice in config.guess or ltmain.sh.)
-This is version 6.1alpha3 of a conservative garbage collector for C and C++.
+This is version 6.3alpha1 of a conservative garbage collector for C and C++.
You might find a more recent version of this at
@@ -228,10 +229,12 @@ and several of those are compatible with the collector.
or equivalent is supplied. Many of these have separate README.system
files.
- Dynamic libraries are completely supported only under SunOS
+ Dynamic libraries are completely supported only under SunOS/Solaris,
(and even that support is not functional on the last Sun 3 release),
-Linux, IRIX 5&6, HP-PA, Win32 (not Win32S) and OSF/1 on DEC AXP machines.
-On other machines we recommend that you do one of the following:
+Linux, FreeBSD, NetBSD, IRIX 5&6, HP/UX, Win32 (not Win32S) and OSF/1
+on DEC AXP machines plus perhaps a few others listed near the top
+of dyn_load.c. On other machines we recommend that you do one of
+the following:
1) Add dynamic library support (and send us the code).
2) Use static versions of the libraries.
@@ -245,6 +248,8 @@ On other machines we recommend that you do one of the following:
In all cases we assume that pointer alignment is consistent with that
enforced by the standard C compilers. If you use a nonstandard compiler
you may have to adjust the alignment parameters defined in gc_priv.h.
+Note that this may also be an issue with packed records/structs, if those
+enforce less alignment for pointers.
A port to a machine that is not byte addressed, or does not use 32 bit
or 64 bit addresses will require a major effort. A port to plain MSDOS
diff --git a/boehm-gc/doc/README.DGUX386 b/boehm-gc/doc/README.DGUX386
new file mode 100644
index 00000000000..9d6d84788ef
--- /dev/null
+++ b/boehm-gc/doc/README.DGUX386
@@ -0,0 +1,215 @@
+ Garbage Collector (parallel iversion) for ix86 DG/UX Release R4.20MU07
+
+
+ *READ* the file README.QUICK.
+
+ You need the GCC-3.0.3 rev (DG/UX) compiler to build this tree.
+ This compiler has the new "dgux386" threads package implemented.
+ It also supports the switch "-pthread" needed to link correctly
+ the DG/UX's -lrte -lthread with -lgcc and the system's -lc.
+ Finally we support parralleli-mark for the SMP DG/UX machines.
+ To build the garbage collector do:
+
+ ./configure --enable-parallel-mark
+ make
+ make gctest
+
+ Before you run "gctest" you need to set your LD_LIBRARY_PATH
+ correctly so that "gctest" can find the shared library libgc.
+ Alternatively you can do a configuration
+
+ ./configure --enable-parallel-mark --disable-shared
+
+ to build only the static version of libgc.
+
+ To enable debugging messages please do:
+ 1) Add the "--enable-full-debug" flag during configuration.
+ 2) Edit the file linux-threads.c and uncommnect the line:
+
+ /* #define DEBUG_THREADS 1 */ to --->
+
+ #define DEBUG_THREADS 1
+
+ Then give "make" as usual.
+
+ In a machine with 4 CPUs (my own machine) the option parallel
+ mark (aka --enable-parallel-mark) makes a BIG difference.
+
+ Takis Psarogiannakopoulos
+ University of Cambridge
+ Centre for Mathematical Sciences
+ Department of Pure Mathematics
+ Wilberforce Road
+ Cambridge CB3 0WB ,UK , <takis@XFree86.Org>
+ January 2002
+
+
+Note (HB):
+ The integration of this patch is currently not complete.
+ The following patches against 6.1alpha3 where hard to move
+ to alpha4, and are not integrated. There may also be minor
+ problems with stylistic corrections made by me.
+
+
+--- ltconfig.ORIG Mon Jan 28 20:22:18 2002
++++ ltconfig Mon Jan 28 20:44:00 2002
+@@ -689,6 +689,11 @@
+ pic_flag=-Kconform_pic
+ fi
+ ;;
++ dgux*)
++ pic_flag='-fPIC'
++ link_static='-Bstatic'
++ wl='-Wl,'
++ ;;
+ *)
+ pic_flag='-fPIC'
+ ;;
+@@ -718,6 +723,12 @@
+ # We can build DLLs from non-PIC.
+ ;;
+
++ dgux*)
++ pic_flag='-KPIC'
++ link_static='-Bstatic'
++ wl='-Wl,'
++ ;;
++
+ osf3* | osf4* | osf5*)
+ # All OSF/1 code is PIC.
+ wl='-Wl,'
+@@ -1154,6 +1165,22 @@
+ fi
+ ;;
+
++ dgux*)
++ ld_shlibs=yes
++ # For both C/C++ ommit the deplibs. This is because we relying on the fact
++ # that compilation of execitables will put them in correct order
++ # in any case and sometimes are wrong when listed as deplibs (or missing some deplibs)
++ # However when GNU ld and --whole-archive needs to be used we have the problem
++ # that if the -fPIC *_s.a archive is linked through deplibs list we ommiting crucial
++ # .lo/.o files from the created shared lib. This I think is not the case here.
++ archive_cmds='$CC -shared -h $soname -o $lib $libobjs $linkopts'
++ thread_safe_flag_spec='-pthread'
++ wlarc=
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ac_cv_archive_cmds_needs_lc=no
++ ;;
++
+ cygwin* | mingw*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+@@ -1497,7 +1524,7 @@
+ ;;
+
+ dgux*)
+- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
++ archive_cmds='$CC -shared -h $soname -o $lib $libobjs $linkopts'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+@@ -2092,12 +2119,17 @@
+ ;;
+
+ dgux*)
+- version_type=linux
++ version_type=dgux
+ 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'
++ library_names_spec='$libname.so$versuffix'
++ soname_spec='$libname.so$versuffix'
+ shlibpath_var=LD_LIBRARY_PATH
++ thread_safe_flag_spec='-pthread'
++ wlarc=
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ac_cv_archive_cmds_needs_lc=no
+ ;;
+
+ sysv4*MP*)
+
+
+--- ltmain.sh.ORIG Mon Jan 28 20:31:18 2002
++++ ltmain.sh Tue Jan 29 00:11:29 2002
+@@ -1072,11 +1072,38 @@
+ esac
+ ;;
+
++ -thread*)
++ # DG/UX GCC 2.95.x, 3.x.x rev (DG/UX) links -lthread
++ # with the switch -threads
++ if test "$arg" = "-threads"; then
++ case "$host" in
++ i[3456]86-*-dgux*)
++ deplibs="$deplibs $arg"
++ continue
++ ;;
++ esac
++ fi
++ ;;
++
++ -pthread*)
++ # DG/UX GCC 2.95.x, 3.x.x rev (DG/UX) links -lthread
++ # with the switch -pthread
++ if test "$arg" = "-pthread"; then
++ case "$host" in
++ i[3456]86-*-dgux*)
++ deplibs="$deplibs $arg"
++ continue
++ ;;
++ esac
++ fi
++ ;;
++
+ -l*)
+ if test "$arg" = "-lc"; then
+ case "$host" in
+- *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
++ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | i[3456]86-*-dgux*)
+ # These systems don't actually have c library (as such)
++ # It is wrong in DG/UX to add -lc when creating shared/dynamic objs/libs
+ continue
+ ;;
+ esac
+@@ -1248,6 +1275,12 @@
+ temp_deplibs=
+ for deplib in $dependency_libs; do
+ case "$deplib" in
++ -thread*)
++ temp_deplibs="$temp_deplibs $deplib"
++ ;;
++ -pthread)
++ temp_deplibs="$temp_deplibs $deplib"
++ ;;
+ -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ case " $rpath $xrpath " in
+ *" $temp_xrpath "*) ;;
+@@ -1709,6 +1742,13 @@
+ done
+ ;;
+
++ dgux)
++ # Leave mostly blank for DG/UX
++ major=
++ versuffix=".$current.$revision";
++ verstring=
++ ;;
++
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+@@ -1792,8 +1832,9 @@
+
+ dependency_libs="$deplibs"
+ case "$host" in
+- *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
++ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | i[3456]86-*-dgux*)
+ # these systems don't actually have a c library (as such)!
++ # It is wrong in DG/UX to add -lc when creating shared/dynamic objs/libs
+ ;;
+ *)
+ # Add libc to deplibs on all other systems.
diff --git a/boehm-gc/doc/README.MacOSX b/boehm-gc/doc/README.MacOSX
index 2abf0b400f7..f5333d51ad6 100644
--- a/boehm-gc/doc/README.MacOSX
+++ b/boehm-gc/doc/README.MacOSX
@@ -1,27 +1 @@
-While the GC should work on MacOS X Server, MacOS X and Darwin, I only tested
-it on MacOS X Server.
-I've added a PPC assembly version of GC_push_regs(), thus the setjmp() hack is
-no longer necessary. Incremental collection is supported via mprotect/signal.
-The current solution isn't really optimal because the signal handler must decode
-the faulting PPC machine instruction in order to find the correct heap address.
-Further, it must poke around in the register state which the kernel saved away
-in some obscure register state structure before it calls the signal handler -
-needless to say the layout of this structure is no where documented.
-Threads and dynamic libraries are not yet supported (adding dynamic library
-support via the low-level dyld API shouldn't be that hard).
-
-The original MacOS X port was brought to you by Andrew Stone.
-
-
-June, 1 2000
-
-Dietmar Planitzer
-dave.pl@ping.at
-
-Note from Andrew Begel:
-
-One more fix to enable gc.a to link successfully into a shared library for
-MacOS X. You have to add -fno-common to the CFLAGS in the Makefile. MacOSX
-disallows common symbols in anything that eventually finds its way into a
-shared library. (I don't completely understand why, but -fno-common seems to
-work and doesn't mess up the garbage collector's functionality).
+See README.darwin for the latest Darwin/MacOSX information.
diff --git a/boehm-gc/doc/README.arm.cross b/boehm-gc/doc/README.arm.cross
new file mode 100644
index 00000000000..96744edaf67
--- /dev/null
+++ b/boehm-gc/doc/README.arm.cross
@@ -0,0 +1,68 @@
+From: Margaret Fleck
+
+Here's the key details of what worked for me, in case anyone else needs them.
+There may well be better ways to do some of this, but ....
+ -- Margaret
+
+
+The badge4 has a StrongArm-1110 processor and a StrongArm-1111 coprocessor.
+
+Assume that the garbage collector distribution is unpacked into /home/arm/gc6.0,
+which is visible to both the ARM machine and a linux desktop (e.g. via NFS mounting).
+
+Assume that you have a file /home/arm/config.site with contents something like the
+example attached below. Notice that our local ARM toolchain lives in
+/skiff/local.
+
+Go to /home/arm/gc6.0 directory. Do
+ CONFIG_SITE=/home/arm/config.site ./configure --target=arm-linux
+--prefix=/home/arm/gc6.0
+
+On your desktop, do:
+ make
+ make install
+The main garbage collector library should now be in ../gc6.0/lib/libgc.so.
+
+To test the garbage collector, first do the following on your desktop
+ make gctest
+ ./gctest
+Then do the following on the ARM machine
+ cd .libs
+ ./lt-gctest
+
+Do not try to do "make test" (the usual way of running the test
+program). This does not work and seems to erase some of the important
+files.
+
+The gctest program claims to have succeeded. Haven't run any further tests
+with it, though I'll be doing so in the near future.
+
+-------------------------------
+# config.site for configure
+
+# Modified from the one provided by Bradley D. LaRonde
+# Edited by Andrej Cedilnik <acedil1@csee.umbc.edu>
+# Used some of solutions by Tilman Vogel <Tilman.Vogel@web.de>
+# Ported for iPAQ Familiar by Oliver Kurth <oliver.kurth@innominate.com>
+# Further modified by Margaret Fleck for the badge4
+
+HOSTCC=gcc
+
+# Names of the cross-compilers
+CC=/skiff/local/bin/arm-linux-gcc
+CXX=/skiff/local/bin/arm-linux-gcc
+
+# The cross compiler specific options
+CFLAGS="-O2 -fno-exceptions"
+CXXFLAGS="-O2 -fno-exceptions"
+CPPFLAGS="-O2 -fno-exceptions"
+LDFLAGS=""
+
+# Some other programs
+AR=/skiff/local/bin/arm-linux-ar
+RANLIB=/skiff/local/bin/arm-linux-ranlib
+NM=/skiff/local/bin/arm-linux-nm
+ac_cv_path_NM=/skiff/local/bin/arm-linux-nm
+ac_cv_func_setpgrp_void=yes
+x_includes=/skiff/local/arm-linux/include/X11
+x_libraries=/skiff/local/arm-linux/lib/X11
diff --git a/boehm-gc/doc/README.changes b/boehm-gc/doc/README.changes
index 232938b4375..619ea2e4a49 100644
--- a/boehm-gc/doc/README.changes
+++ b/boehm-gc/doc/README.changes
@@ -1469,8 +1469,439 @@ Since 6.1 alpha2:
- Caused the Solaris and Irix thread creation primitives to call
GC_init_inner().
+Since 6.1alpha3:
+ - Fixed typo in sparc_mach_dep.S, preventing the 64-bit version from
+ building. Increased 64-bit heap size limit in test.c slightly, since
+ a functional SPARC collector seems to slightly exceed the old limits.
+ (Thanks again to Jeff Sturm.)
+ - Use NPRGREG in solaris_threads.c, thus printing all registers if things
+ go wrong.
+ - Added GC_MARKERS environment variable to allow use of a single marker
+ thread on an MP without confusing the lock implementation.
+ - Collect much less aggressively in incremental mode with GC_TIME_UNLIMITED.
+ This is really a purely generational mode, and we can afford to
+ postpone the collection until the heap is (nearly) full.
+ - Remove read() wrapper for MPROTECT_VDB. It was causing more harm than
+ good. It is often no longer needed if system calls avoid writing to
+ pointerfull heap objects.
+ - Fix MACOSX test in gcconfig.h. (Thanks to John Clements.)
+ - Change GC_test_and_set so that it consistently has one argument.
+ Add spaces to ::: in powerpc assembly code in gc_locks.h.
+ (Thanks to Ryan Murray.)
+ - Fixed a formatting error in dbg_mlc.c. Added prototype to GC_abort()
+ declaration. (Thanks to Michael Smith.)
+ - Removed "source" argument to GC_find_start(). Eliminate GC_FIND_START().
+ - Added win32 recognition code in configure.in. Changed some of the
+ dllimport/export defines in gc.h. (Thanks to Adam Megacz.)
+ - GC_malloc_many didn't set hb_last_reclaimed when it called
+ GC_reclaim_generic. (I'm not sure this matters much, but ...)
+ - Allocating uncollectable objects with debug information sometimes
+ allocated objects that were one byte too small, since uncollectable
+ objects don't have the extra byte added at the end. (Thanks to
+ Wink Saville for pointing this out.)
+ - Added a bit more assertion checking to make sure that gcj objects
+ on free lists never have a nonzero second word.
+ - Replaced BCC_MAKEFILE with an up-to-date one. (Thanks to
+ Andre Leiradella.)
+ - Upgraded libtool, cinfigure.in and some related files to hopefully
+ support NetBSD/SPARC. (Thanks to Adrian Bunk.) Unfortunately,
+ libtool 1.4.2 seemed to be buggy due to missing quotes in several
+ "test" invocations. Fixed those in the ltmain.sh script.
+ - Some win32-specific patches, including the introduction of
+ GC_CreateThread. (Thanks to Adam Megacz.)
+ - Merged in gcj changes from Anthony Green to support embedded systems.
+ - Tried to consistently rename preprocessed assembly files with a capital
+ .S extension.
+ - Use alpha_mach_dep.S on ALPHA again. It doesn't really matter, but this
+ makes our distribution consistent with the gcc one, avoiding future merge
+ problems.
+ - Move GET_MEM definition into gcconfig.h. Include gcconfig.h slightly
+ later in gc_priv.h to avoid forward references to ptr_t.
+ - Add some testing of local allocation to test.c.
+ - Change definition of INVALID_QTID in specific.h. The -1 value was used
+ inconsistently, and too likely to collide with a valid stack address.
+ Some general clean-up of specific.[ch]. Added assertions. (Thanks
+ to Michael Smith for tracking down an intermittent bug to this
+ general area. I'm not sure it has been squashed yet, however.)
+ - On Pthread systems it was not safe to call GC_malloc() between fork()
+ and exec(). According to the applicable standards, it doesn't appear
+ to be safe to call malloc() or many other libc functions either, thus
+ it's not clear this is fixable. Added experimental support for
+ -DHANDLE_FORK in linux_threads.c which tries to support it. It may
+ succeed if libc does the right thing. I'm not sure whether it does.
+ (Thanks to Kenneth Schalk for pointing out this issue.)
+ - Documented thread local allocation primitives to require an
+ explicit GC_init call. GC_init_parallel is no longer declared to
+ be a constructor function, since that isn't portable and often
+ seems to lead to initialization order problems.
+ - Changed gc_cpp.cc and gc_cpp.h in one more attempt to make them
+ compatible with Visual C++ 6. (Thanks to Wink Saville for the
+ patch.)
+ - Some more patches for Linux on HP PA-RISC.
+ - Added include/gc_allocator.h. It implements (hopefully) standard
+ conforming (as opposed to SGI-style) allocators that allocate
+ collectable (gc_allocator) or GC-traceable, but not collectable
+ (traceable_allocator) objects. This borrows heavily from libstc++,
+ which borrows heavily from the SGI implementation, this part of
+ which was written by Matt Austern. Changed test_cpp.cc to very
+ minimally test this.
+ - On Linux/X86, retry mmap with a different start argument. That should
+ allow the collector to use more (closer to 3GB) of the address space.
+ (Thanks to Jeffrey Mark Siskind for tracking this down.)
+ - Force 64 bit alignment with GCJ support. (Reflects Bryce McKinley's
+ patch to the gcc tree.)
+ - Refined the choice of sa_handler vs. sa_sigaction in GC_dirty_init
+ to accomodate some glibc5 systems. (Thanks to Dan Fandrich for the
+ patch.)
+ - Compensated for the fact that current versions of glibc set
+ __libc_stack_end incorrectly on Linux/IA64 while initialization code
+ is running. This could cause the collector to miss 16 bytes of
+ the memory stack if GC_malloc or friends where called before main().
+ - Mostly integrated Takis Psarogiannakopoulos' port to DG/UX Inix 86.
+ This will probably take another iteration to work, since his
+ patch conflicted with the libtool upgrade.
+ - Added README.arm.cross containing some information about cross-
+ compiling to an ARM processor from Margaret Fleck.
+
+Since 6.1alpha4:
+ - Added GC_finalizer_mem_freed, and changed some of the code that
+ decided on heap expansion to look at it. Memory explicitly
+ deallocated by finalizers essentially needs to be counted as reclaimed
+ by the GC. Otherwise there are cases in which the heap can grow
+ unboundedly. (Thanks to Mark Reichert for the test case.)
+ - Integrated Adam Megacz patches to not scan dynamic libraries if
+ we are compiling with gcc on win32. Otherwise we need structured
+ exception handling to deal with asynchronously unmapped root
+ segments, and gcc doesn't directly support that.
+ - Integrated Anthony Green's patch to support Wine.
+ - GC_OPERATOR_NEW_ARRAY was misspelled OPERATOR_NEW_ARRAY in several
+ places, including gc_cpp.cc. (Thanks to Wink Saville for pointing
+ this out.)
+ - Integrated Loren James Rittle's Alpha FreeBSD patches. In
+ response to Richard Henderson's suggestion, these also
+ changed the declarations of symbols like _end on many platforms to
+ that they wouldn't mistakenly be declared as short data symbols.
+ - Integrated changes from the Debian distribution. (Thanks to Ryan Murray
+ for pointing these out.) Fix C++ comments in POWERPC port. Add ARM32
+ incremental GC support. Get rid of USE_GENERIC_PUSH_REGS for alpha/Linux,
+ this time for real. Use va_copy to get rid of cord printf problems
+ (finally).
+ - Close file descriptor used to count cpus. Thanks to Jeff Sturm for
+ pointing out the omission.
+ - Don't just drop gcj free lists in GC_start_reclaim, since that can
+ eventually cause the marker to see a bogus mark descriptor in the
+ dropped objects. The usual symptom was a very intermittent segmentation
+ fault in the marker. This mattered only if one of the GC_gcj_malloc
+ variants was used. (Thanks to Michael Smith, Jeff Sturm, Bryce
+ McKinley and Tom Tromey for helping to track this down.)
+ - Fixed Linux and Solaris/64 SPARC configuration. (Thanks to David Miller,
+ Jeff Sturm, Tom Tromey, and Christian Joensson.)
+ - Fixed a typo in strdup definition. (Thanks to Gerard A Allan.)
+ - Changed Makefile.direct to invoke $(CC) to assemble alpha_mach_dep.S.
+ This is needed on Linux. I'm not sure whether it's better or worse
+ on Tru64.
+ - Changed gc_cpp.h once more to declare operator new and friends only in
+ a Microsoft environment. This may need further fine tuning. (Thanks to
+ Johannes Schmidt for pointing out that the older code breaks on gcc3.0.4.)
+ - Don't ever override strdup if it's already macro defined. (Thanks to
+ Adnan Ali for pointing out the problem.)
+ - Changed gc_cpp.h yet again to also overload placement new. Due to the
+ C++ overloading rules, the other overloaded new operations otherwise hide
+ placement new, which causes many STL uses to break. (Thanks to Reza
+ Shahidi for reporting this, and to Matt Austern for proposing a fix.)
+ - Integrated cygwin pthreads support from Dan Bonachea.
+ - Turn on DYNAMIC_LOADING for NetBSD. (Thanks to Krister Walfridsson.)
+ - Changed printing code to print more complete GC times.
+ - Applied Mark Mitchell's Irix patch to correct some bitrot.
+ - Clarified which object-printing routines in dbg_mlc.c should hold
+ the allocation lock. Restructured the code to allow reasonable object
+ printing with -DREDIRECT_MALLOC.
+ - Fix the Linux mmap code to always start with 0x1000 as the initial hint.
+ Minor patches for 64-bit AIX, particularly to STACKBOTTOM.
+ (Thanks again to Jeffrey Mark Siskind.)
+ - Renamed "SUSPENDED" flag for Solaris threads support to avoid a conflict
+ with a system header. (Thanks to Philp Brown.)
+ - Cause win32_threads.c to handle an out of range stack pointer correctly,
+ though currently with a warning. (Thanks to Jonathan Clark for
+ observing that win32 applications may temporarily use the stack
+ pointer for other purposes, and suggesting a fix. Unfortunately, it's
+ not clear that there is a complete solution to this problem.)
+
+Since 6.1alpha5:
+ - Added GC_MAXIMUM_HEAP_SIZE environment variable.
+ - Fix configure.in for MIPS/LINUX. (Thanks to H.J. Lu.)
+ - Double page hash table size for -DLARGE_CONFIG.
+ - Integrated Bo Thorsen's X86-64 support.
+ - STACKBOTTOM definition for LINUX/MIPS was partially changed back.
+ (Thanks to H.J. Lu and Hiroshi Kawashima for resolving this.)
+ - Replaced all occurrences of LINUX_DATA_START in gcconfig.h with
+ SEARCH_FOR_DATA_START. It doesn't hurt to falll back to a search.
+ And __data_start doesn't seem to get defined correctly of the GC
+ library is loaded with LD_PRELOAD, e.g. for leak detection.
+ - If the GC_find_leak environment variable is set, do a
+ atexit(GC_gcollect) to give us at least one chance to detect leaks.
+ This may report some very benign leaks, but ...
+ - Addeded REDIRECT_FREE. It's necessary if we want leak detection with
+ LD_PRELOAD.
+ - Defer printing of leaked objects, as for smashed objects.
+ - Fixed process and descriptor leak in GC_print_callers. Try for
+ line number even if we got function name.)
+ - Ported parallel GC support and thread local allocation to Alpha.
+ Not yet well-tested.
+ - Added GC_DUMP_REGULARLY and added finalization statistics to GC_dump().
+ - Fixed Makefile.am to mention alpha_mach_dep.S instead of the defunct
+ alpha_mach_dep.s. (Thanks to Fergus Henderson.)
+ - Incorporated a change to new_gc_alloc.h, suggested by Johannes Schmidt,
+ which should make it work with gcc3.1. (I would still like to encourage
+ use of gc_allocator.h instead.)
+ - Use alpha_mach_dep.S only on Linux. (It's not clear that this is
+ optimal, but it otherwise didn't build on Tru64. Thanks to Fergus
+ Henderson.)
+ - Added ifdef to guard free() in os_dep.c. Otherwise we get a
+ compilation error on Irix. (Thanks to Dai Sato.)
+ - Added an experimental version of GC_memalign to mallocx.c. This can't
+ always work, since we don't handle alignment requests in the hblk-level
+ allocator, and we can't handle arbitrary pointer displacements unless
+ GC_all_interior_pointers is enabled. But it should work for alignment
+ requests up to HBLKSIZE. This is not yet documented in the standard
+ places.
+ - Finally debugged the OSF1/Tru64 thread support. This needs more testing,
+ since I needed to add a somewhat unconvincing workaround for signal
+ delivery issues that I don't yet completely understand. But it does
+ pass my tests, even in parallel GC mode. Incremental GC support is
+ disabled if thread support is enabled, due to the signal issues.
+ - Eliminated name-space-incorrect definition of _cdecl from gc_cpp.h.
+ - Added GC_debug_malloc_replacement and GC_debug_realloc_replacement
+ declarations to gc.h. On IA64, this is required for REDIRECT_MALLOC
+ to work correctly with these.
+ - Fixed Linux USE_PROC_FOR_LIBRARIES to work with a 64-bit /proc format.
+
+Since 6.1:
+ - Guard the test for GC_DUMP_REGULARLY in misc.c with
+ "#ifndef NO_DEBUGGING". Otherwise it fails to build with NO_DEBUGGING
+ defined. (Thanks to Manuel Serrano.)
+ - Message about retrying suspend signals was incorrectly generated even when
+ flag was not set.
+ - Cleaned up MACOSX/NEXT root registration code. There was apparently a
+ separate ifdef case in GC_register_data_segments() for no reason.
+ - Removed MPROTECT_VDB for MACOSX port, based on one negative report.
+ - Arrange for gc.h and friends to be correctly installed with GNU-style
+ "make install".
+ - Enable the GNU-style build facility include C++ support in the library
+ with --enable-cplusplus. (Thanks to Thomas Maier for some of the patch.)
+ - Mark from GC_thread_key in linux_threads.c, in case that's allocated
+ from the garbage collected heap, as it is with our own thread-specific
+ storage implementation. (Thanks to Jeff Sturm.)
+ - Mark all free list header blocks if they are heap allocated. This avoids
+ some unnecessary tracing. And it remains correct if we clear the
+ root set. (Thanks to Jeff Sturm for identifying the bug.)
+ - Improved S390/Linux support. Add S390/Linux 64-bit support. (Thanks
+ to Ulrich Weigand.)
+ - Corrected the spelling of GC_{M,C}ALLOC_EXPLICTLY_TYPED to
+ GC_{M,C}ALLOC_EXPLICITLY_TYPED in gc_typed.h. This is technically
+ an interface change. Based on the fact that nobody reported this,
+ I suspect/hope there were no clients.
+ - Cleaned up gc_typed.h so that (1) it adds an extern "C" declaration
+ when appropriate, (2) doesn't generate references to undefined internal
+ macros, and (3) allows easier manual construction of descriptors.
+ - Close the file descriptor used by GC_print_address_map().
+ - Set the "close-on-exec" bit for various file descriptors maintained
+ for the collector's internal use.
+ - Added a hack to find memory segments owned by the system allocator
+ under win32. Based on my tests, this tends to eventually find all
+ segments, though it may take a while. There appear to be cleaner,
+ but slower solutions under NT/XP. But they rely on an API that's
+ unsupported under 9X.
+ - Changed Linux PowerPC stack finding to LINUX_STACKBOTTOM. (Thanks
+ to Akira Tagoh for pointing out that HEURISTIC1 doesn't work on
+ 64-bit kernels.)
+ - Added GC_set_free_space_divisor to avoid some Windows dll issues.
+ - Added FIXUP_POINTER, POINTER_SHIFT, POINTER_MASK to allow preprocessing
+ of candidate pointers for tagging, etc.
+ - Always lock around GC_notify_full_gc(). Simplified code for
+ invoking GC_notify_full_gc().
+ - Changed the way DATASTART is defined on FreeBSD to be robust against
+ an unmapped page after etext. (Thanks to Hironori Sakamoto for
+ tracking down the intermittent failure.)
+ - Made GC_enable() and GC_disable() official. Deprecated direct update
+ of GC_dont_gc. Changed GC_gcollect to be a noop when garbage collection
+ is disabled.
+ - Call GC_register_dynamic_libraries before stopping the world on Linux,
+ in order to avoid a potential deadlock due to the dl_iterate_phdr lock.
+ - Introduced a more general mechanism for platform-dependent code to
+ decide whether the main data segment should be handled separately
+ from dynamic libraries, or registered by GC_register_dynamic_libraries.
+ The latter is more reliable and easier on Linux with dl_iterate_phdr.
+
+Since 6.2alpha1:
+ - Fixed the completely broken FreeBSD code in 6.2alpha1. (Thanks to
+ Hironori Sakamoto for the patch.)
+ - Changed IRIX reference in dbg_mlc.c to IRIX5. (Thanks to Marcus Herbert.)
+ - Attempted to work around the problems with .S filenames and the SGI
+ compiler. (Reported by several people. Untested.)
+ - Worked around an HP/UX make issue with the GNU-style build process.
+ - Fixed the --enable-cplusplus build machinery to allow builds without
+ a C++ compiler. (That was always the intent ...)
+ - Changed the debugging allocation macros to explicitly pass the return
+ address for Linux and XXXBSD on hardware for which we can't get stack
+ traces. Use __builtin_return_address(0) to generate it when possible.
+ Some of the configuration work was cleaned up (good) and moved to gc.h
+ (bad, but necessary). This should make leak detection more useful
+ on a number of platforms. (Thanks to Fabian Thylman for the suggestion.)
+ - Fixed compilation problems in dbg_mlc.c with GC_ADD_CALLER.
+ - Bumped revision number for dynamic library.
+
+Since 6.2alpha2:
+ - Don't include execinfo.h in os_dep.c when it's not needed, and may not exist.
+
+Since 6.2alpha3:
+ - Use LINUX_STACKBOTTOM for >= glibc2.2 on Linux/MIPS. (See Debian bug
+ # 177204)
+ - Integrated Jeff Sturm and Jesse Rosenstock's MACOSX threads patches.
+ - Integrated Grzegorz Jakacki's substantial GNU build patch. "Make dist"
+ should now work for the GNU build process. Documentation files
+ are installed under share/gc.
+ - Tweaked gc_cpp.h to again support the Borland compiler. (Thanks to
+ Rene Girard for pointing out the problems.)
+ - Updated BCC_MAKEFILE (thanks to Rene Girard).
+ - Added GC_ASSERT check for minimum thread stack size.
+ - Added --enable-gc-assertions.
+ - Added some web documentation to the distribution. Updated it in the
+ process.
+ - Separate gc_conf_macros.h from gc.h.
+ - Added generic GC_THREADS client-defined macro to set the appropriate
+ GC_XXX_THREADS internal macro. (gc_config_macros.h.)
+ - Add debugging versions of _ignore_off_page allocation primitves.
+ - Moved declarations of GC_make_closure and GC_debug_invoke_finalizer
+ from gc.h to gc_priv.h.
+ - Reset GC_fail_count even if only a small allocation succeeds.
+ - Integrated Brian Alliet's patch for dynamic library support on Darwin.
+ - gc_cpp.h's gc_cleanup destructor called GC_REGISTER_FINALIZER_IGNORE_SELF
+ when it should have called the lower case version, since it was
+ explicitly computing a base pointer.
+
+Since 6.2alpha4:
+ - GC_invoke_finalizers could, under rare conditions, set
+ GC_finalizer_mem_freed to an essentially random value. This could
+ possibly cause unbounded heap growth for long-running applications
+ under some conditions. (The bug was introduced in 6.1alpha5, and
+ is not in gcc3.3. Thanks to Ben Hutchings for finding it.)
+ - Attempted to sanitize the various DLL macros. GC_USE_DLL disappeared.
+ GC_DLL is used instead. All internal tests are now on GC_DLL.
+ README.macros is now more precise about the intended meaning.
+ - Include DllMain in the multithreaded win32 version only if the
+ collector is actually built as a dll. (Thanks to Mohan Embar for
+ a version of the patch.)
+ - Hide the cygwin threadAttach/Detach functions. They were violating our
+ namespace rules.
+ - Fixed an assertion in GC_check_heap_proc. Added GC_STATIC_ASSERT.
+ (Thanks again to Ben Hutchings.)
+ - Removed some obsolete definitions for Linux/PowerPC in gcconfig.h.
+ - CORD_cat was not rebalancing unbalanced trees in some cases, violating
+ a CORD invariant. Also tweaked the rebalancing rule for
+ CORD_cat_char_star. (Thanks to Alexandr Petrosian for the bug report
+ and patch.)
+ - Added hand-coded structured exception handling support to mark.c.
+ This should enable support of dynamic libraries under win32 with
+ gcc-compiled code. (Thanks to Ranjit Mathew for the patch.)
+ Turned on dynamic library scanning for win32/gcc.
+ - Removed some remnants of read wrapping. (Thanks to Kenneth Schalk.)
+ GC_USE_LD_WRAP ws probably broken in recent versions.
+ - The build could fail on some platforms since gcconfig.h could include
+ declarations mentioning ptr_t, which was not defined, e.g. when if_mach
+ was built. (Thanks to Yann Dirson for pointing this out.) Also
+ cleaned up tests for GC_PRIVATE_H in gcconfig.h a bit.
+ - The GC_LOOP_ON_ABORT environment variable interfered with incremental
+ collection, since the write fault handler was erroneously overridden.
+ Handlers are now set up in the correct order.
+ - It used to be possible to call GC_mark_thread_local_free_lists() while
+ the world was not stopped during an incremental GC. This was not safe.
+ Fortunately, it was also unnecessary. Added GC_world_stopped flag
+ to avoid it. (This caused occasional crashes in GC_set_fl_marks
+ with thread local allocation and incremental GC. This probably happened
+ primarily on old, slow multiprocessors.)
+ - Allowed overriding of MAX_THREADS in win32_threads.c from the build
+ command line. (Patch from Yannis Bres.)
+ - Taught the IA64/linux code to determine the register backing store base from
+ /proc/self/maps after checking the __libc symbol, but before guessing.
+ (__libc symbols are on the endangered list, and the guess is likely to not
+ always be right for 2.6 kernels.) Restructured the code to read and parse
+ /proc/self/maps so it only exists in one place (all platforms).
+ - The -DUSE_PROC_FOR_LIBRARIES code was broken on Linux. It claimed that it
+ also registered the main data segment, but didn't actually do so. (I don't
+ think anyone actually uses this configuration, but ...)
+ - Made another attempt to get --enablecplusplus to do the right thing.
+ Since there are unavoidable problems with C programs linking against a
+ dynamic library that includes C++ code, I separated out the c++ code into
+ libgccpp.
+
+Since 6.2alpha5:
+ - There was extra underscore in the name of GC_save_registers_in_stack
+ for NetBSD/SPARC. (Thanks to Jaap Boender for the patch.)
+ - Integrated Brian Alliet's patch for Darwin. This restructured the
+ linuxthreads/pthreads support to separate generic pthreads support
+ from more the system-dependent thread-stopping code. I believe this
+ should make it easier to eliminate the code duplication between
+ pthreads platforms in the future. The patch included some other
+ code cleanups.
+ - Integrated Dan Bonachea's patch to support AIX threads. This required
+ substantial manual integration, mostly due to conflicts with other
+ recent threads changes. It may take another iteration to
+ get it to work.
+ - Removed HPUX/PA-RISC support from aix_irix_threads.c. It wasn't used
+ anyway and it cluttered up the code. And anything we can do to migrate
+ towards generic pthreads support is a good thing.
+ - Added a more explicit test for tracing of function arguments to test.c.
+ (Thanks to Dan Grayson.)
+ - Added Akira Tagoh's PowerPC64 patch.
+ - Fixed some bit rot in the Cygwin port. (Thanks to Dan Bonachea for
+ pointing it out.) Gc.h now includes just windows.h, not winbase.h.
+ - Declared GC_save_regs_in_stack() in gc_priv.h. Remove other declarations.
+ - Changed --enable-cplusplus to use automake consitionals. The old way
+ confused libtool. "Make install" didn't work correctly for the old version.
+ Previously --enable-cplusplus was broken on cygwin.
+ - Changed the C version of GC_push_regs to fail at compile time if it is
+ generated with an empty body. This seems to have been the cause of one
+ or two subtle failures on unusual platforms. Those failures should
+ now occur at build time and be easily fixable.
+
+Since 6.2alpha6:
+ - Integrated a second round of Irix/AIX patches from Dan Bonachea.
+ Renamed mips_sgi_mach_dep.S back to mips_sgi_mach_dep.s, since it requires
+ the Irix assembler to do the C preprocessing; gcc -E doesn't work.
+ - Fixed Makefile.direct for DARWIN. (Thanks to Manuel Serrano.)
+ - There was a race between GC_pthread_detach and thread exit that could
+ result in a thread structure being deallocated by GC_pthread_detach
+ eventhough it was still needed by the thread exit code. (Thanks to
+ Dick Porter for the small test case that allowed this to be debugged.)
+ - Fixed version parsing for non-alpha versions in acinclude.m4 and
+ version checking in version.h.
+
+Since 6.2:
+ - Integrated some NetBSD patches forwarded to me by Marc Recht. These
+ were already in the NetBSD package.
+ - GC_pthread_create waited for the semaphore even if pthread_create failed.
+ Thanks to Dick Porter for the pthread_support.c patch. Applied the
+ analogous fix for aix_irix_threads.c.
+ - Added Rainer Orth's Tru64 fixes.
+ - The check for exceeding the thread table size in win32 threadDetach
+ was incorrect. (Thanks to Alexandr Petrosian for the patch.)
+ - Applied Andrew Begel's patch to correct some reentrancy issues
+ with dynamic loading on Darwin.
+ - GC_CreateThread() was neglecting to duplicate the thread handle in
+ the table. (Thanks to Tum Nguyen for the patch.)
+ - Pass +ESdbgasm only on PA-RISC machines with vendor compiler.
+ (Thanks to Roger Sayle for the patch.)
+ - Applied more AIX threads patches from Scott Ananian.
To do:
+ - A dynamic libgc.so references dlopen unconditionally, but doesn't link
+ against libdl.
+ - GC_proc_fd for Solaris is not correctly updated in response to a
+ fork() call. Thus incremental collection in the child won't work
+ correctly. (Thanks to Ben Cottrell for pointing this out.)
+ - --enable-redirect-malloc is mostly untested and known not to work
+ on some platforms.
- There seem to be outstanding issues on Solaris/X86, possibly with
finding the data segment starting address. Information/patches would
be appreciated.
@@ -1488,7 +1919,4 @@ To do:
- Incremental collector should handle large objects better. Currently,
it looks like the whole object is treated as dirty if any part of it
is.
- - Cord/cordprnt.c doesn't build on a few platforms (notably PowerPC), since
- we make some unwarranted assumptions about how varargs are handled. This
- currently makes the cord-aware versions of printf unusable on some platforms.
- Fixing this is unfortunately not trivial.
+
diff --git a/boehm-gc/doc/README.darwin b/boehm-gc/doc/README.darwin
new file mode 100644
index 00000000000..3cd1b818b19
--- /dev/null
+++ b/boehm-gc/doc/README.darwin
@@ -0,0 +1,106 @@
+Darwin/MacOSX Support - July 22, 2003
+====================================
+
+Important Usage Notes
+=====================
+
+GC_init() MUST be called before calling any other GC functions. This
+is necessary to properly register segments in dynamic libraries. This
+call is required even if you code does not use dynamic libraries as the
+dyld code handles registering all data segments.
+
+When your use of the garbage collector is confined to dylibs and you
+cannot call GC_init() before your libraries' static initializers have
+run and perhaps called GC_malloc(), create an initialization routine
+for each library to call GC_init():
+
+#include <gc/gc.h>
+void my_library_init() { GC_init(); }
+
+Compile this code into a my_library_init.o, and link it into your
+dylib. When you link the dylib, pass the -init argument with
+_my_library_init (e.g. gcc -dynamiclib -o my_library.dylib a.o b.o c.o
+my_library_init.o -init _my_library_init). This causes
+my_library_init() to be called before any static initializers, and
+will initialize the garbage collector properly.
+
+Note: It doesn't hurt to call GC_init() more than once, so it's best,
+if you have an application or set of libraries that all use the
+garbage collector, to create an initialization routine for each of
+them that calls GC_init(). Better safe than sorry.
+
+The incremental collector is still a bit flaky on darwin. It seems to
+work reliably with workarounds for a few possible bugs in place however
+these workaround may not work correctly in all cases. There may also
+be additional problems that I have not found.
+
+Implementation Information
+==========================
+Darwin/MacOSX support is nearly complete. Thread support is reliable on
+Darwin 6.x (MacOSX 10.2) and there have been reports of success on older
+Darwin versions (MacOSX 10.1). Shared library support had also been
+added and the gc can be run from a shared library. There is currently only
+support for Darwin/PPC although adding x86 support should be trivial.
+
+Thread support is implemented in terms of mach thread_suspend and
+thread_resume calls. These provide a very clean interface to thread
+suspension. This implementation doesn't rely on pthread_kill so the
+code works on Darwin < 6.0 (MacOSX 10.1). All the code to stop the
+world is located in darwin_stop_world.c.
+
+The original incremental collector support unfortunatelly no longer works
+on recent Darwin versions. It also relied on some undocumented kernel
+structures. Mach, however, does have a very clean interface to exception
+handing. The current implementation uses Mach's exception handling.
+
+Much thanks goes to Andrew Stone, Dietmar Planitzer, Andrew Begel,
+Jeff Sturm, and Jesse Rosenstock for all their work on the
+Darwin/OS X port.
+
+-Brian Alliet
+brian@brianweb.net
+
+
+Older Information (Most of this no longer applies to the current code)
+======================================================================
+
+While the GC should work on MacOS X Server, MacOS X and Darwin, I only tested
+it on MacOS X Server.
+I've added a PPC assembly version of GC_push_regs(), thus the setjmp() hack is
+no longer necessary. Incremental collection is supported via mprotect/signal.
+The current solution isn't really optimal because the signal handler must decode
+the faulting PPC machine instruction in order to find the correct heap address.
+Further, it must poke around in the register state which the kernel saved away
+in some obscure register state structure before it calls the signal handler -
+needless to say the layout of this structure is no where documented.
+Threads and dynamic libraries are not yet supported (adding dynamic library
+support via the low-level dyld API shouldn't be that hard).
+
+The original MacOS X port was brought to you by Andrew Stone.
+
+
+June, 1 2000
+
+Dietmar Planitzer
+dave.pl@ping.at
+
+Note from Andrew Begel:
+
+One more fix to enable gc.a to link successfully into a shared library for
+MacOS X. You have to add -fno-common to the CFLAGS in the Makefile. MacOSX
+disallows common symbols in anything that eventually finds its way into a
+shared library. (I don't completely understand why, but -fno-common seems to
+work and doesn't mess up the garbage collector's functionality).
+
+Feb 26, 2003
+
+Jeff Sturm and Jesse Rosenstock provided a patch that adds thread support.
+GC_MACOSX_THREADS should be defined in the build and in clients. Real
+dynamic library support is still missing, i.e. dynamic library data segments
+are still not scanned. Code that stores pointers to the garbage collected
+heap in statically allocated variables should not reside in a dynamic
+library. This still doesn't appear to be 100% reliable.
+
+Mar 10, 2003
+Brian Alliet contributed dynamic library support for MacOSX. It could also
+use more testing.
diff --git a/boehm-gc/doc/README.environment b/boehm-gc/doc/README.environment
index c7daddb0aca..d1f3b5c053b 100644
--- a/boehm-gc/doc/README.environment
+++ b/boehm-gc/doc/README.environment
@@ -5,6 +5,8 @@ platforms.
GC_INITIAL_HEAP_SIZE=<bytes> - Initial heap size in bytes. May speed up
process start-up.
+GC_MAXIMUM_HEAP_SIZE=<bytes> - Maximum collected heap size.
+
GC_LOOP_ON_ABORT - Causes the collector abort routine to enter a tight loop.
This may make it easier to debug, such a process, especially
for multithreaded platforms that don't produce usable core
@@ -19,6 +21,11 @@ GC_PRINT_STATS - Turn on as much logging as is easily feasible without
by setting GC_quiet. On by default if the collector
was built without -DSILENT.
+GC_DUMP_REGULARLY - Generate a GC debugging dump GC_dump() on startup
+ and during every collection. Very verbose. Useful
+ if you have a bug to report, but please include only the
+ last complete dump.
+
GC_PRINT_ADDRESS_MAP - Linux only. Dump /proc/self/maps, i.e. various address
maps for the process, to stderr on every GC. Useful for
mapping root addresses to source for deciphering leak
@@ -27,7 +34,14 @@ GC_PRINT_ADDRESS_MAP - Linux only. Dump /proc/self/maps, i.e. various address
GC_NPROCS=<n> - Linux w/threads only. Explicitly sets the number of processors
that the GC should expect to use. Note that setting this to 1
when multiple processors are available will preserve
- correctness, but may lead to really horrible performance.
+ correctness, but may lead to really horrible performance,
+ since the lock implementation will immediately yield without
+ first spinning.
+
+GC_MARKERS=<n> - Linux w/threads and parallel marker only. Set the number
+ of marker threads. This is normaly set to the number of
+ processors. It is safer to adjust GC_MARKERS than GC_NPROCS,
+ since GC_MARKERS has no impact on the lock implementation.
GC_NO_BLACKLIST_WARNING - Prevents the collector from issuing
warnings about allocations of very large blocks.
@@ -62,6 +76,20 @@ GC_PRINT_BACK_HEIGHT - Print max length of chain through unreachable objects
of Conservative Garbage Collectors", POPL 2001, or
http://lib.hpl.hp.com/techpubs/2001/HPL-2001-251.html .
+GC_RETRY_SIGNALS, GC_NO_RETRY_SIGNALS - Try to compensate for lost
+ thread suspend signals in linux_threads.c. On by
+ default for GC_OSF1_THREADS, off otherwise. Note
+ that this does not work around a possible loss of
+ thread restart signals. This seems to be necessary for
+ some versions of Tru64. Since we've previously seen
+ similar issues on some other operating systems, it
+ was turned into a runtime flag to enable last-minute
+ work-arounds.
+
+The following turn on runtime flags that are also program settable. Checked
+only during initialization. We expect that they will usually be set through
+other means, but this may help with debugging and testing:
+
GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup. Note that,
depending on platform and collector configuration, this
may involve write protecting pieces of the heap to
@@ -71,22 +99,20 @@ GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup. Note that,
Use with caution.
GC_PAUSE_TIME_TARGET - Set the desired garbage collector pause time in msecs.
- This only has an effect if incremental collection is enabled.
- If a collection requires appreciably more time than this,
- the client will be restarted, and the collector will need
- to do additional work to compensate. The special value
- "999999" indicates that pause time is unlimited, and the
- incremental collector will behave completely like a
- simple generational collector. If the collector is
- configured for parallel marking, and run on a multiprocessor,
- incremental collection should only be used with unlimited
- pause time.
-
-The following turn on runtime flags that are also program settable. Checked
-only during initialization. We expect that they will usually be set through
-other means, but this may help with debugging and testing:
+ This only has an effect if incremental collection is
+ enabled. If a collection requires appreciably more time
+ than this, the client will be restarted, and the collector
+ will need to do additional work to compensate. The
+ special value "999999" indicates that pause time is
+ unlimited, and the incremental collector will behave
+ completely like a simple generational collector. If
+ the collector is configured for parallel marking, and
+ run on a multiprocessor, incremental collection should
+ only be used with unlimited pause time.
-GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection.
+GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection. Forces a
+ collection at program termination to detect leaks that would
+ otherwise occur after the last GC.
GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interior
pointer recognition.
diff --git a/boehm-gc/doc/README.ews4800 b/boehm-gc/doc/README.ews4800
index bced2438285..80bca2b3d95 100644
--- a/boehm-gc/doc/README.ews4800
+++ b/boehm-gc/doc/README.ews4800
@@ -73,3 +73,9 @@ GC on EWS4800
--
Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
+When using the new "configure; make" build process, please
+run configure with the --disable-shared option. "Make check" does not
+yet pass with dynamic libraries. Ther reasons for that are not yet
+understood. (HB, paraphrasing message from Hironori SAKAMOTO.)
+
diff --git a/boehm-gc/doc/README.linux b/boehm-gc/doc/README.linux
index efd0a26bfb8..1d0fd4c3fb6 100644
--- a/boehm-gc/doc/README.linux
+++ b/boehm-gc/doc/README.linux
@@ -1,21 +1,18 @@
See README.alpha for Linux on DEC AXP info.
-This file applies mostly to Linux/Intel IA32. Ports to Linux on an M68K
-and PowerPC are also integrated. They should behave similarly, except that
-the PowerPC port lacks incremental GC support, and it is unknown to what
-extent the Linux threads code is functional. See below for M68K specific
-notes.
+This file applies mostly to Linux/Intel IA32. Ports to Linux on an M68K, IA64,
+SPARC, MIPS, Alpha and PowerPC are also integrated. They should behave
+similarly, except that the PowerPC port lacks incremental GC support, and
+it is unknown to what extent the Linux threads code is functional.
+See below for M68K specific notes.
-Incremental GC is supported on Intel IA32 and M68K.
+Incremental GC is generally supported.
Dynamic libraries are supported on an ELF system. A static executable
should be linked with the gcc option "-Wl,-defsym,_DYNAMIC=0".
-The collector appears to work with Linux threads. We have seen
-intermittent hangs in sem_wait. So far we have been unable to reproduce
-these unless the process was being debugged or traced. Thus it's
-possible that the only real issue is that the debugger loses
-signals on rare occasions.
+The collector appears to work reliably with Linux threads, but beware
+of older versions of glibc and gdb.
The garbage collector uses SIGPWR and SIGXCPU if it is used with
Linux threads. These should not be touched by the client program.
diff --git a/boehm-gc/doc/README.macros b/boehm-gc/doc/README.macros
index d9df8dd31a6..b5fe6796cc2 100644
--- a/boehm-gc/doc/README.macros
+++ b/boehm-gc/doc/README.macros
@@ -51,7 +51,18 @@ _DLL Defined by Visual C++ if dynamic libraries are being built
__declspec(dllexport) needs to be added to declarations
to support the case in which the collector is in a dll.
-GC_DLL User-settable macro that forces the effect of _DLL.
+GC_DLL User-settable macro that forces the effect of _DLL. Set
+ by gc.h if _DLL is defined and GC_NOT_DLL is undefined.
+ This is the macro that is tested internally to determine
+ whether the GC is in its own dynamic library. May need
+ to be set by clients before including gc.h. Note that
+ inside the GC implementation it indicates that the
+ collector is in its own dynamic library, should export
+ its symbols, etc. But in clients it indicates that the
+ GC resides in a different DLL, its entry points should
+ be referenced accordingly, and precautions may need to
+ be taken to properly deal with statically allocated
+ variables in the main program. Used only for MS Windows.
GC_NOT_DLL User-settable macro that overrides _DLL, e.g. if dynamic
libraries are used, but the collector is in a static library.
diff --git a/boehm-gc/doc/README.win32 b/boehm-gc/doc/README.win32
index b1a6ec59664..a40b375f550 100644
--- a/boehm-gc/doc/README.win32
+++ b/boehm-gc/doc/README.win32
@@ -21,6 +21,13 @@ registrations are ignored, but not terribly quickly.)
pointers. And the VirtualQuery call has different semantics under
the two systems, and under different versions of win32s.)
+Win32 applications compiled with some flavor of gcc currently behave
+like win32s applications, in that dynamic library data segments are
+not scanned. (Gcc does not directly support Microsoft's "structured
+exception handling". It turns out that use of this feature is
+unavoidable if you scan arbitrary memory segments obtained from
+VirtualQuery.)
+
The collector test program "gctest" is linked as a GUI application,
but does not open any windows. Its output appears in the file
"gc.log". It may be started from the file manager. The hour glass
@@ -50,13 +57,20 @@ This appears to cause problems under Windows NT and Windows 2000 (but
not Windows 95/98) if the memory is later passed to CreateDIBitmap.
To work around this problem, build the collector with -DUSE_GLOBAL_ALLOC.
This is currently incompatible with -DUSE_MUNMAP. (Thanks to Jonathan
-Clark for tracking this down.)
+Clark for tracking this down. There's some chance this may be fixed
+in 6.1alpha4, since we now separate heap sections with an unused page.)
For Microsoft development tools, rename NT_MAKEFILE as
MAKEFILE. (Make sure that the CPU environment variable is defined
to be i386.) In order to use the gc_cpp.h C++ interface, all
client code should include gc_cpp.h.
+If you would prefer a VC++.NET project file, ask boehm@acm.org. One has
+been contributed, but it seems to contain some absolute paths etc., so
+it can presumably only be a starting point, and is not in the standard
+distribution. It is unclear (to me, Hans Boehm) whether it is feasible to
+change that.
+
Clients may need to define GC_NOT_DLL before including gc.h, if the
collector was built as a static library (as it normally is in the
absence of thread support).
@@ -64,7 +78,7 @@ absence of thread support).
For GNU-win32, use the regular makefile, possibly after uncommenting
the line "include Makefile.DLLs". The latter should be necessary only
if you want to package the collector as a DLL. The GNU-win32 port is
-believed to work only for b18, not b19, probably dues to linker changes
+believed to work only for b18, not b19, probably due to linker changes
in b19. This is probably fixable with a different definition of
DATASTART and DATAEND in gcconfig.h.
@@ -147,7 +161,7 @@ To compile the collector and testing programs use the command:
All programs using gc should be compiled with 4-byte alignment.
For further explanations on this see comments about Borland.
-If gc compiled as dll, the macro ``GC_DLL'' should be defined before
+If the gc is compiled as dll, the macro ``GC_DLL'' should be defined before
including "gc.h" (for example, with -DGC_DLL compiler option). It's
important, otherwise resulting programs will not run.
diff --git a/boehm-gc/doc/debugging.html b/boehm-gc/doc/debugging.html
index 04773fa66a3..22273fed4bc 100644
--- a/boehm-gc/doc/debugging.html
+++ b/boehm-gc/doc/debugging.html
@@ -248,8 +248,12 @@ The <TT>hb_last_reclaimed</tt> field will identify the collection number
during which its block was last swept.
<LI> Verify that the offending object still has its correct contents at
this point.
-The call <TT>GC_is_marked(p)</tt> from the debugger to verify that the
-object has not been marked, and is about to be reclaimed.
+Then call <TT>GC_is_marked(p)</tt> from the debugger to verify that the
+object has not been marked, and is about to be reclaimed. Note that
+<TT>GC_is_marked(p)</tt> expects the real address of an object (the
+address of the debug header if there is one), and thus it may
+be more appropriate to call <TT>GC_is_marked(GC_base(p))</tt>
+instead.
<LI> Determine a path from a root, i.e. static variable, stack, or
register variable,
to the reclaimed object. Call <TT>GC_is_marked(q)</tt> for each object
diff --git a/boehm-gc/doc/gcdescr.html b/boehm-gc/doc/gcdescr.html
index 65e8a8f61c9..8ecbac8db62 100644
--- a/boehm-gc/doc/gcdescr.html
+++ b/boehm-gc/doc/gcdescr.html
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<TITLE> Conservative GC Algorithmic Overview </TITLE>
- <AUTHOR> Hans-J. Boehm, Silicon Graphics</author>
+ <AUTHOR> Hans-J. Boehm, HP Labs (Much of this was written at SGI)</author>
</HEAD>
<BODY>
<H1> <I>This is under construction</i> </h1>
@@ -96,20 +96,24 @@ typically on the order of the page size.
<P>
Large block sizes are rounded up to
the next multiple of <TT>HBLKSIZE</tt> and then allocated by
-<TT>GC_allochblk</tt>. This uses roughly what Paul Wilson has termed
-a "next fit" algorithm, i.e. first-fit with a rotating pointer.
-The implementation does check for a better fitting immediately
-adjacent block, which gives it somewhat better fragmentation characteristics.
-I'm now convinced it should use a best fit algorithm. The actual
+<TT>GC_allochblk</tt>. Recent versions of the collector
+use an approximate best fit algorithm by keeping free lists for
+several large block sizes.
+The actual
implementation of <TT>GC_allochblk</tt>
is significantly complicated by black-listing issues
(see below).
<P>
-Small blocks are allocated in blocks of size <TT>HBLKSIZE</tt>.
-Each block is
+Small blocks are allocated in chunks of size <TT>HBLKSIZE</tt>.
+Each chunk is
dedicated to only one object size and kind. The allocator maintains
separate free lists for each size and kind of object.
<P>
+Once a large block is split for use in smaller objects, it can only
+be used for objects of that size, unless the collector discovers a completely
+empty chunk. Completely empty chunks are restored to the appropriate
+large block free list.
+<P>
In order to avoid allocating blocks for too many distinct object sizes,
the collector normally does not directly allocate objects of every possible
request size. Instead request are rounded up to one of a smaller number
@@ -139,27 +143,35 @@ expand the heap. Otherwise, we initiate a garbage collection. This ensures
that the amount of garbage collection work per allocated byte remains
constant.
<P>
-The above is in fat an oversimplification of the real heap expansion
-heuristic, which adjusts slightly for root size and certain kinds of
-fragmentation. In particular, programs with a large root set size and
+The above is in fact an oversimplification of the real heap expansion
+and GC triggering heuristic, which adjusts slightly for root size
+and certain kinds of
+fragmentation. In particular:
+<UL>
+<LI> Programs with a large root set size and
little live heap memory will expand the heap to amortize the cost of
-scanning the roots.
-<P>
-Versions 5.x of the collector actually collect more frequently in
+scanning the roots.
+<LI> Versions 5.x of the collector actually collect more frequently in
nonincremental mode. The large block allocator usually refuses to split
large heap blocks once the garbage collection threshold is
reached. This often has the effect of collecting well before the
heap fills up, thus reducing fragmentation and working set size at the
-expense of GC time. 6.x will chose an intermediate strategy depending
+expense of GC time. Versions 6.x choose an intermediate strategy depending
on how much large object allocation has taken place in the past.
(If the collector is configured to unmap unused pages, versions 6.x
-will use the 5.x strategy.)
-<P>
-(It has been suggested that this should be adjusted so that we favor
+use the 5.x strategy.)
+<LI> In calculating the amount of allocation since the last collection we
+give partial credit for objects we expect to be explicitly deallocated.
+Even if all objects are explicitly managed, it is often desirable to collect
+on rare occasion, since that is our only mechanism for coalescing completely
+empty chunks.
+</ul>
+<P>
+It has been suggested that this should be adjusted so that we favor
expansion if the resulting heap still fits into physical memory.
In many cases, that would no doubt help. But it is tricky to do this
in a way that remains robust if multiple application are contending
-for a single pool of physical memory.)
+for a single pool of physical memory.
<H2>Mark phase</h2>
@@ -204,7 +216,7 @@ changes to
<LI> <TT>MS_NONE</tt> indicating that reachable objects are marked.
</ol>
-The core mark routine <TT>GC_mark_from_mark_stack</tt>, is called
+The core mark routine <TT>GC_mark_from</tt>, is called
repeatedly by several of the sub-phases when the mark stack starts to fill
up. It is also called repeatedly in <TT>MS_ROOTS_PUSHED</tt> state
to empty the mark stack.
@@ -213,6 +225,12 @@ each call, so that it can also be used by the incremental collector.
It is fairly carefully tuned, since it usually consumes a large majority
of the garbage collection time.
<P>
+The fact that it perform a only a small amount of work per call also
+allows it to be used as the core routine of the parallel marker. In that
+case it is normally invoked on thread-private mark stacks instead of the
+global mark stack. More details can be found in
+<A HREF="scale.html">scale.html</a>
+<P>
The marker correctly handles mark stack overflows. Whenever the mark stack
overflows, the mark state is reset to <TT>MS_INVALID</tt>.
Since there are already marked objects in the heap,
@@ -281,7 +299,8 @@ Unmarked large objects are immediately returned to the large object free list.
Each small object page is checked to see if all mark bits are clear.
If so, the entire page is returned to the large object free list.
Small object pages containing some reachable object are queued for later
-sweeping.
+sweeping, unless we determine that the page contains very little free
+space, in which case it is not examined further.
<P>
This initial sweep pass touches only block headers, not
the blocks themselves. Thus it does not require significant paging, even
@@ -341,12 +360,16 @@ object itself becomes marked, we have uncovered
a cycle involving the object. This usually results in a warning from the
collector. Such objects are not finalized, since it may be
unsafe to do so. See the more detailed
-<A HREF="finalization.html"> discussion of finalization semantics</a>.
+<A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/finalization.html"> discussion of finalization semantics</a>.
<P>
Any objects remaining unmarked at the end of this process are added to
a queue of objects whose finalizers can be run. Depending on collector
configuration, finalizers are dequeued and run either implicitly during
allocation calls, or explicitly in response to a user request.
+(Note that the former is unfortunately both the default and not generally safe.
+If finalizers perform synchronization, it may result in deadlocks.
+Nontrivial finalizers generally need to perform synchronization, and
+thus require a different collector configuration.)
<P>
The collector provides a mechanism for replacing the procedure that is
used to mark through objects. This is used both to provide support for
@@ -354,13 +377,14 @@ Java-style unordered finalization, and to ignore certain kinds of cycles,
<I>e.g.</i> those arising from C++ implementations of virtual inheritance.
<H2>Generational Collection and Dirty Bits</h2>
-We basically use the parallel and generational GC algorithm described in
-<A HREF="papers/pldi91.ps.gz">"Mostly Parallel Garbage Collection"</a>,
+We basically use the concurrent and generational GC algorithm described in
+<A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/papers/pldi91.ps.Z">"Mostly Parallel Garbage Collection"</a>,
by Boehm, Demers, and Shenker.
<P>
The most significant modification is that
-the collector always runs in the allocating thread.
-There is no separate garbage collector thread.
+the collector always starts running in the allocating thread.
+There is no separate garbage collector thread. (If parallel GC is
+enabled, helper threads may also be woken up.)
If an allocation attempt either requests a large object, or encounters
an empty small object free list, and notices that there is a collection
in progress, it immediately performs a small amount of marking work
@@ -389,50 +413,108 @@ cannot be satisfied from small object free lists. When marking completes,
the set of modified pages is retrieved, and we mark once again from
marked objects on those pages, this time with the mutator stopped.
<P>
-We keep track of modified pages using one of three distinct mechanisms:
+We keep track of modified pages using one of several distinct mechanisms:
<OL>
<LI>
Through explicit mutator cooperation. Currently this requires
-the use of <TT>GC_malloc_stubborn</tt>.
+the use of <TT>GC_malloc_stubborn</tt>, and is rarely used.
<LI>
-By write-protecting physical pages and catching write faults. This is
+(<TT>MPROTECT_VDB</tt>) By write-protecting physical pages and
+catching write faults. This is
implemented for many Unix-like systems and for win32. It is not possible
in a few environments.
<LI>
-By retrieving dirty bit information from /proc. (Currently only Sun's
+(<TT>PROC_VDB</tt>) By retrieving dirty bit information from /proc.
+(Currently only Sun's
Solaris supports this. Though this is considerably cleaner, performance
may actually be better with mprotect and signals.)
+<LI>
+(<TT>PCR_VDB</tt>) By relying on an external dirty bit implementation, in this
+case the one in Xerox PCR.
+<LI>
+(<TT>DEFAULT_VDB</tt>) By treating all pages as dirty. This is the default if
+none of the other techniques is known to be usable, and
+<TT>GC_malloc_stubborn</tt> is not used. Practical only for testing, or if
+the vast majority of objects use <TT>GC_malloc_stubborn</tt>.
</ol>
+<H2>Black-listing</h2>
+
+The collector implements <I>black-listing</i> of pages, as described
+in
+<A HREF="http://www.acm.org/pubs/citations/proceedings/pldi/155090/p197-boehm/">
+Boehm, ``Space Efficient Conservative Collection'', PLDI '93</a>, also available
+<A HREF="papers/pldi93.ps.Z">here</a>.
+<P>
+During the mark phase, the collector tracks ``near misses'', i.e. attempts
+to follow a ``pointer'' to just outside the garbage-collected heap, or
+to a currently unallocated page inside the heap. Pages that have been
+the targets of such near misses are likely to be the targets of
+misidentified ``pointers'' in the future. To minimize the future
+damage caused by such misidentifications they will be allocated only to
+small pointerfree objects.
+<P>
+The collector understands two different kinds of black-listing. A
+page may be black listed for interior pointer references
+(<TT>GC_add_to_black_list_stack</tt>), if it was the target of a near
+miss from a location that requires interior pointer recognition,
+<I>e.g.</i> the stack, or the heap if <TT>GC_all_interior_pointers</tt>
+is set. In this case, we also avoid allocating large blocks that include
+this page.
+<P>
+If the near miss came from a source that did not require interior
+pointer recognition, it is black-listed with
+<TT>GC_add_to_black_list_normal</tt>.
+A page black-listed in this way may appear inside a large object,
+so long as it is not the first page of a large object.
+<P>
+The <TT>GC_allochblk</tt> routine respects black-listing when assigning
+a block to a particular object kind and size. It occasionally
+drops (i.e. allocates and forgets) blocks that are completely black-listed
+in order to avoid excessively long large block free lists containing
+only unusable blocks. This would otherwise become an issue
+if there is low demand for small pointerfree objects.
+
<H2>Thread support</h2>
We support several different threading models. Unfortunately Pthreads,
the only reasonably well standardized thread model, supports too narrow
an interface for conservative garbage collection. There appears to be
-no portable way to allow the collector to coexist with various Pthreads
+no completely portable way to allow the collector to coexist with various Pthreads
implementations. Hence we currently support only a few of the more
common Pthreads implementations.
<P>
In particular, it is very difficult for the collector to stop all other
threads in the system and examine the register contents. This is currently
-accomplished with very different mechanisms for different Pthreads
+accomplished with very different mechanisms for some Pthreads
implementations. The Solaris implementation temporarily disables much
of the user-level threads implementation by stopping kernel-level threads
-("lwp"s). The Irix implementation sends signals to individual Pthreads
-and has them wait in the signal handler. The Linux implementation
-is similar in spirit to the Irix one.
+("lwp"s). The Linux/HPUX/OSF1 and Irix implementations sends signals to
+individual Pthreads and has them wait in the signal handler.
<P>
-The Irix implementation uses
-only documented Pthreads calls, but relies on extensions to their semantics,
-notably the use of mutexes and condition variables from signal
-handlers. The Linux implementation should be far closer to
-portable, though impirically it is not completely portable.
+The Linux and Irix implementations use
+only documented Pthreads calls, but rely on extensions to their semantics.
+The Linux implementation <TT>linux_threads.c</tt> relies on only very
+mild extensions to the pthreads semantics, and already supports a large number
+of other Unix-like pthreads implementations. Our goal is to make this the
+only pthread support in the collector.
+<P>
+(The Irix implementation is separate only for historical reasons and should
+clearly be merged. The current Solaris implementation probably performs
+better in the uniprocessor case, but does not support thread operations in the
+collector. Hence it cannot support the parallel marker.)
<P>
All implementations must
intercept thread creation and a few other thread-specific calls to allow
enumeration of threads and location of thread stacks. This is current
-accomplished with <TT># define</tt>'s in <TT>gc.h</tt>, or optionally
+accomplished with <TT># define</tt>'s in <TT>gc.h</tt>
+(really <TT>gc_pthread_redirects.h</tt>), or optionally
by using ld's function call wrapping mechanism under Linux.
<P>
Comments are appreciated. Please send mail to
-<A HREF="mailto:boehm@acm.org"><TT>boehm@acm.org</tt></a>
+<A HREF="mailto:boehm@acm.org"><TT>boehm@acm.org</tt></a> or
+<A HREF="mailto:Hans.Boehm@hp.com"><TT>Hans.Boehm@hp.com</tt></a>
+<P>
+This is a modified copy of a page written while the author was at SGI.
+The original was <A HREF="http://reality.sgi.com/boehm/gcdescr.html">here</a>.
</body>
+</html>
diff --git a/boehm-gc/doc/gcinterface.html b/boehm-gc/doc/gcinterface.html
new file mode 100644
index 00000000000..7b336ec811b
--- /dev/null
+++ b/boehm-gc/doc/gcinterface.html
@@ -0,0 +1,203 @@
+<!DOCTYPE HTML>
+<HEAD>
+<TITLE>Garbage Collector Interface</TITLE>
+</HEAD>
+<BODY>
+<H1>C Interface</h1>
+On many platforms, a single-threaded garbage collector library can be built
+to act as a plug-in malloc replacement. (Build with -DREDIRECT_MALLOC=GC_malloc
+-DIGNORE_FREE.) This is often the best way to deal with third-party libraries
+which leak or prematurely free objects. -DREDIRECT_MALLOC is intended
+primarily as an easy way to adapt old code, not for new development.
+<P>
+New code should use the interface discussed below.
+<P>
+Code must be linked against the GC library. On most UNIX platforms,
+this will be gc.a.
+<P>
+The following describes the standard C interface to the garbage collector.
+It is not a complete definition of the interface. It describes only the
+most commonly used functionality, approximately in decreasing order of
+frequency of use. The description assumes an ANSI C compiler.
+The full interface is described in
+<A HREF="http://hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gch.txt">gc.h</a>
+or <TT>gc.h</tt> in the distribution.
+<P>
+Clients should include gc.h.
+<P>
+In the case of multithreaded code,
+gc.h should be included after the threads header file, and
+after defining the appropriate GC_XXXX_THREADS macro.
+(For 6.2alpha4 and later, simply defining GC_THREADS should suffice.)
+Gc.h must be included
+in files that use either GC or threads primitives, since threads primitives
+will be redefined to cooperate with the GC on many platforms.
+<DL>
+<DT> <B>void * GC_MALLOC(size_t <I>nbytes</i>)</b>
+<DD>
+Allocates and clears <I>nbytes</i> of storage.
+Requires (amortized) time proportional to <I>nbytes</i>.
+The resulting object will be automatically deallocated when unreferenced.
+References from objects allocated with the system malloc are usually not
+considered by the collector. (See GC_MALLOC_UNCOLLECTABLE, however.)
+GC_MALLOC is a macro which invokes GC_malloc by default or, if GC_DEBUG
+is defined before gc.h is included, a debugging version that checks
+occasionally for overwrite errors, and the like.
+<DT> <B>void * GC_MALLOC_ATOMIC(size_t <I>nbytes</i>)</b>
+<DD>
+Allocates <I>nbytes</i> of storage.
+Requires (amortized) time proportional to <I>nbytes</i>.
+The resulting object will be automatically deallocated when unreferenced.
+The client promises that the resulting object will never contain any pointers.
+The memory is not cleared.
+This is the preferred way to allocate strings, floating point arrays,
+bitmaps, etc.
+More precise information about pointer locations can be communicated to the
+collector using the interface in
+<A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc_typedh.txt">gc_typed.h</a> in the distribution.
+<DT> <B>void * GC_MALLOC_UNCOLLECTABLE(size_t <I>nbytes</i>)</b>
+<DD>
+Identical to GC_MALLOC, except that the resulting object is not automatically
+deallocated. Unlike the system-provided malloc, the collector does
+scan the object for pointers to garbage-collectable memory, even if the
+block itself does not appear to be reachable. (Objects allocated in this way
+are effectively treated as roots by the collector.)
+<DT> <B> void * GC_REALLOC(void *old, size_t new_size) </b>
+<DD>
+Allocate a new object of the indicated size and copy (a prefix of) the
+old object into the new object. The old object is reused in place if
+convenient. If the original object was allocated with GC_malloc_atomic,
+the new object is subject to the same constraints. If it was allocated
+as an uncollectable object, then the new object is uncollectable, and
+the old object (if different) is deallocated.
+(Use GC_REALLOC with GC_MALLOC, etc.)
+<DT> <B> void GC_FREE(void *dead) </b>
+<DD>
+Explicitly deallocate an object. Typically not useful for small
+collectable objects. (Use GC_FREE with GC_MALLOC, etc.)
+<DT> <B> void * GC_MALLOC_IGNORE_OFF_PAGE(size_t <I>nbytes</i>) </b>
+<DD>
+<DT> <B> void * GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(size_t <I>nbytes</i>) </b>
+<DD>
+Analogous to GC_MALLOC and GC_MALLOC_ATOMIC, except that the client
+guarantees that as long
+as the resulting object is of use, a pointer is maintained to someplace
+inside the first 512 bytes of the object. This pointer should be declared
+volatile to avoid interference from compiler optimizations.
+(Other nonvolatile pointers to the object may exist as well.)
+This is the
+preferred way to allocate objects that are likely to be > 100KBytes in size.
+It greatly reduces the risk that such objects will be accidentally retained
+when they are no longer needed. Thus space usage may be significantly reduced.
+<DT> <B> void GC_gcollect(void) </b>
+<DD>
+Explicitly force a garbage collection.
+<DT> <B> void GC_enable_incremental(void) </b>
+<DD>
+Cause the garbage collector to perform a small amount of work
+every few invocations of GC_malloc or the like, instead of performing
+an entire collection at once. This is likely to increase total
+running time. It will improve response on a platform that either has
+suitable support in the garbage collector (Irix and most other Unix
+versions, win32 if the collector was suitably built) or if "stubborn"
+allocation is used (see <A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gch.txt">gc.h</a>).
+On many platforms this interacts poorly with system calls
+that write to the garbage collected heap.
+<DT> <B> GC_warn_proc GC_set_warn_proc(GC_warn_proc p) </b>
+<DD>
+Replace the default procedure used by the collector to print warnings.
+The collector
+may otherwise write to sterr, most commonly because GC_malloc was used
+in a situation in which GC_malloc_ignore_off_page would have been more
+appropriate. See <A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gch.txt">gc.h</a> for details.
+<DT> <B> void GC_register_finalizer(...) </b>
+<DD>
+Register a function to be called when an object becomes inaccessible.
+This is often useful as a backup method for releasing system resources
+(<I>e.g.</i> closing files) when the object referencing them becomes
+inaccessible.
+It is not an acceptable method to perform actions that must be performed
+in a timely fashion.
+See <A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gch.txt">gc.h</a> for details of the interface.
+See <A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/finalization.html">here</a> for a more detailed discussion
+of the design.
+<P>
+Note that an object may become inaccessible before client code is done
+operating on its fields. Suitable synchronization is usually required.
+See <A HREF="http://portal.acm.org/citation.cfm?doid=604131.604153">here</a>
+or <A HREF="http://www.hpl.hp.com/techreports/2002/HPL-2002-335.html">here</a>
+for details.
+</dl>
+<P>
+If you are concerned with multiprocessor performance and scalability,
+you should consider enabling and using thread local allocation (<I>e.g.</i>
+GC_LOCAL_MALLOC, see <TT>gc_local_alloc.h</tt>. If your platform
+supports it, you should build the collector with parallel marking support
+(-DPARALLEL_MARK, or --enable-parallel-mark).
+<P>
+If the collector is used in an environment in which pointer location
+information for heap objects is easily available, this can be passed on
+to the colllector using the interfaces in either <TT>gc_typed.h</tt>
+or <TT>gc_gcj.h</tt>.
+<P>
+The collector distribution also includes a <B>string package</b> that takes
+advantage of the collector. For details see
+<A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/cordh.txt">cord.h</a>
+
+<H1>C++ Interface</h1>
+There are three distinct ways to use the collector from C++:
+<DL>
+<DT> <B> STL allocators </b>
+<DD>
+Users of the <A HREF="http://www.sgi.com/tech/stl">SGI extended STL</a>
+can include <TT>new_gc_alloc.h</tt> before including
+STL header files.
+(<TT>gc_alloc.h</tt> corresponds to now obsolete versions of the
+SGI STL.)
+This defines SGI-style allocators
+<UL>
+<LI> alloc
+<LI> single_client_alloc
+<LI> gc_alloc
+<LI> single_client_gc_alloc
+</ul>
+which may be used either directly to allocate memory or to instantiate
+container templates. The first two allocate uncollectable but traced
+memory, while the second two allocate collectable memory.
+The single_client versions are not safe for concurrent access by
+multiple threads, but are faster.
+<P>
+For an example, click <A HREF="http://hpl.hp.com/personal/Hans_Boehm/gc/gc_alloc_exC.txt">here</a>.
+<P>
+Recent versions of the collector also include a more standard-conforming
+allocator implemention in <TT>gc_allocator.h</tt>. It defines
+<UL>
+<LI> traceable_allocator
+<LI> gc_allocator
+</ul>
+Again the former allocates uncollectable but traced memory.
+This should work with any fully standard-conforming C++ compiler.
+<DT> <B> Class inheritance based interface </b>
+<DD>
+Users may include gc_cpp.h and then cause members of certain classes to
+be allocated in garbage collectable memory by inheriting from class gc.
+For details see <A HREF="http://hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc_cpph.txt">gc_cpp.h</a>.
+<DT> <B> C interface </b>
+<DD>
+It is also possible to use the C interface from
+<A HREF="http://hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gch.txt">gc.h</a> directly.
+On platforms which use malloc to implement ::new, it should usually be possible
+to use a version of the collector that has been compiled as a malloc
+replacement. It is also possible to replace ::new and other allocation
+functions suitably.
+<P>
+Note that user-implemented small-block allocation often works poorly with
+an underlying garbage-collected large block allocator, since the collector
+has to view all objects accessible from the user's free list as reachable.
+This is likely to cause problems if GC_malloc is used with something like
+the original HP version of STL.
+This approach works with the SGI versions of the STL only if the
+<TT>malloc_alloc</tt> allocator is used.
+</dl>
+</body>
+</html>
diff --git a/boehm-gc/doc/leak.html b/boehm-gc/doc/leak.html
new file mode 100644
index 00000000000..91fa8ea8402
--- /dev/null
+++ b/boehm-gc/doc/leak.html
@@ -0,0 +1,197 @@
+<HTML>
+<HEAD>
+<TITLE>Using the Garbage Collector as Leak Detector</title>
+</head>
+<BODY>
+<H1>Using the Garbage Collector as Leak Detector</h1>
+The garbage collector may be used as a leak detector.
+In this case, the primary function of the collector is to report
+objects that were allocated (typically with <TT>GC_MALLOC</tt>),
+not deallocated (normally with <TT>GC_FREE</tt>), but are
+no longer accessible. Since the object is no longer accessible,
+there in normally no way to deallocate the object at a later time;
+thus it can safely be assumed that the object has been "leaked".
+<P>
+This is substantially different from counting leak detectors,
+which simply verify that all allocated objects are eventually
+deallocated. A garbage-collector based leak detector can provide
+somewhat more precise information when an object was leaked.
+More importantly, it does not report objects that are never
+deallocated because they are part of "permanent" data structures.
+Thus it does not require all objects to be deallocated at process
+exit time, a potentially useless activity that often triggers
+large amounts of paging.
+<P>
+All non-ancient versions of the garbage collector provide
+leak detection support. Version 5.3 adds the following
+features:
+<OL>
+<LI> Leak detection mode can be initiated at run-time by
+setting GC_find_leak instead of building the collector with FIND_LEAK
+defined. This variable should be set to a nonzero value
+at program startup.
+<LI> Leaked objects should be reported and then correctly garbage collected.
+Prior versions either reported leaks or functioned as a garbage collector.
+</ol>
+For the rest of this description we will give instructions that work
+with any reasonable version of the collector.
+<P>
+To use the collector as a leak detector, follow the following steps:
+<OL>
+<LI> Build the collector with -DFIND_LEAK. Otherwise use default
+build options.
+<LI> Change the program so that all allocation and deallocation goes
+through the garbage collector.
+<LI> Arrange to call <TT>GC_gcollect</tt> at appropriate points to check
+for leaks.
+(For sufficiently long running programs, this will happen implicitly,
+but probably not with sufficient frequency.)
+</ol>
+The second step can usually be accomplished with the
+<TT>-DREDIRECT_MALLOC=GC_malloc</tt> option when the collector is built,
+or by defining <TT>malloc</tt>, <TT>calloc</tt>,
+<TT>realloc</tt> and <TT>free</tt>
+to call the corresponding garbage collector functions.
+But this, by itself, will not yield very informative diagnostics,
+since the collector does not keep track of information about
+how objects were allocated. The error reports will include
+only object addresses.
+<P>
+For more precise error reports, as much of the program as possible
+should use the all uppercase variants of these functions, after
+defining <TT>GC_DEBUG</tt>, and then including <TT>gc.h</tt>.
+In this environment <TT>GC_MALLOC</tt> is a macro which causes
+at least the file name and line number at the allocation point to
+be saved as part of the object. Leak reports will then also include
+this information.
+<P>
+Many collector features (<I>e.g</i> stubborn objects, finalization,
+and disappearing links) are less useful in this context, and are not
+fully supported. Their use will usually generate additional bogus
+leak reports, since the collector itself drops some associated objects.
+<P>
+The same is generally true of thread support. However, as of 6.0alpha4,
+correct leak reports should be generated with linuxthreads.
+<P>
+On a few platforms (currently Solaris/SPARC, Irix, and, with -DSAVE_CALL_CHAIN,
+Linux/X86), <TT>GC_MALLOC</tt>
+also causes some more information about its call stack to be saved
+in the object. Such information is reproduced in the error
+reports in very non-symbolic form, but it can be very useful with the
+aid of a debugger.
+<H2>An Example</h2>
+The following header file <TT>leak_detector.h</tt> is included in the
+"include" subdirectory of the distribution:
+<PRE>
+#define GC_DEBUG
+#include "gc.h"
+#define malloc(n) GC_MALLOC(n)
+#define calloc(m,n) GC_MALLOC((m)*(n))
+#define free(p) GC_FREE(p)
+#define realloc(p,n) GC_REALLOC((p),(n))
+#define CHECK_LEAKS() GC_gcollect()
+</pre>
+<P>
+Assume the collector has been built with -DFIND_LEAK. (For very
+new versions of the collector, we could instead add the statement
+<TT>GC_find_leak = 1</tt> as the first statement in <TT>main</tt>.
+<P>
+The program to be tested for leaks can then look like:
+<PRE>
+#include "leak_detector.h"
+
+main() {
+ int *p[10];
+ int i;
+ /* GC_find_leak = 1; for new collector versions not */
+ /* compiled with -DFIND_LEAK. */
+ for (i = 0; i < 10; ++i) {
+ p[i] = malloc(sizeof(int)+i);
+ }
+ for (i = 1; i < 10; ++i) {
+ free(p[i]);
+ }
+ for (i = 0; i < 9; ++i) {
+ p[i] = malloc(sizeof(int)+i);
+ }
+ CHECK_LEAKS();
+}
+</pre>
+<P>
+On an Intel X86 Linux system this produces on the stderr stream:
+<PRE>
+Leaked composite object at 0x806dff0 (leak_test.c:8, sz=4)
+</pre>
+(On most unmentioned operating systems, the output is similar to this.
+If the collector had been built on Linux/X86 with -DSAVE_CALL_CHAIN,
+the output would be closer to the Solaris example. For this to work,
+the program should not be compiled with -fomit_frame_pointer.)
+<P>
+On Irix it reports
+<PRE>
+Leaked composite object at 0x10040fe0 (leak_test.c:8, sz=4)
+ Caller at allocation:
+ ##PC##= 0x10004910
+</pre>
+and on Solaris the error report is
+<PRE>
+Leaked composite object at 0xef621fc8 (leak_test.c:8, sz=4)
+ Call chain at allocation:
+ args: 4 (0x4), 200656 (0x30FD0)
+ ##PC##= 0x14ADC
+ args: 1 (0x1), -268436012 (0xEFFFFDD4)
+ ##PC##= 0x14A64
+</pre>
+In the latter two cases some additional information is given about
+how malloc was called when the leaked object was allocated. For
+Solaris, the first line specifies the arguments to <TT>GC_debug_malloc</tt>
+(the actual allocation routine), The second the program counter inside
+main, the third the arguments to <TT>main</tt>, and finally the program
+counter inside the caller to main (i.e. in the C startup code).
+<P>
+In the Irix case, only the address inside the caller to main is given.
+<P>
+In many cases, a debugger is needed to interpret the additional information.
+On systems supporting the "adb" debugger, the <TT>callprocs</tt> script
+can be used to replace program counter values with symbolic names.
+As of version 6.1, the collector tries to generate symbolic names for
+call stacks if it knows how to do so on the platform. This is true on
+Linux/X86, but not on most other platforms.
+<H2>Simplified leak detection under Linux</h2>
+Since version 6.1, it should be possible to run the collector in leak
+detection mode on a program a.out under Linux/X86 as follows:
+<OL>
+<LI> Ensure that a.out is a single-threaded executable. This doesn't yet work
+for multithreaded programs.
+<LI> If possible, ensure that the addr2line program is installed in
+/usr/bin. (It comes with RedHat Linux.)
+<LI> If possible, compile a.out with full debug information.
+This will improve the quality of the leak reports. With this approach, it is
+no longer necessary to call GC_ routines explicitly, though that can also
+improve the quality of the leak reports.
+<LI> Build the collector and install it in directory <I>foo</i> as follows:
+<UL>
+<LI> configure --prefix=<I>foo</i> --enable-full-debug --enable-redirect-malloc
+--disable-threads
+<LI> make
+<LI> make install
+</ul>
+<LI> Set environment variables as follows:
+<UL>
+<LI> LD_PRELOAD=<I>foo</i>/lib/libgc.so
+<LI> GC_FIND_LEAK
+<LI> You may also want to set GC_PRINT_STATS (to confirm that the collector
+is running) and/or GC_LOOP_ON_ABORT (to facilitate debugging from another
+window if something goes wrong).
+</ul
+<LI> Simply run a.out as you normally would. Note that if you run anything
+else (<I>e.g.</i> your editor) with those environment variables set,
+it will also be leak tested. This may or may not be useful and/or
+embarrassing. It can generate
+mountains of leak reports if the application wasn't designed to avoid leaks,
+<I>e.g.</i> because it's always short-lived.
+</ol>
+This has not yet been thropughly tested on large applications, but it's known
+to do the right thing on at least some small ones.
+</body>
+</html>
diff --git a/boehm-gc/doc/scale.html b/boehm-gc/doc/scale.html
new file mode 100644
index 00000000000..2e70148dfb7
--- /dev/null
+++ b/boehm-gc/doc/scale.html
@@ -0,0 +1,210 @@
+<HTML>
+<HEAD>
+<TITLE>Garbage collector scalability</TITLE>
+</HEAD>
+<BODY>
+<H1>Garbage collector scalability</h1>
+In its default configuration, the Boehm-Demers-Weiser garbage collector
+is not thread-safe. It can be made thread-safe for a number of environments
+by building the collector with the appropriate
+<TT>-D</tt><I>XXX</i><TT>-THREADS</tt> compilation
+flag. This has primarily two effects:
+<OL>
+<LI> It causes the garbage collector to stop all other threads when
+it needs to see a consistent memory state.
+<LI> It causes the collector to acquire a lock around essentially all
+allocation and garbage collection activity.
+</ol>
+Since a single lock is used for all allocation-related activity, only one
+thread can be allocating or collecting at one point. This inherently
+limits performance of multi-threaded applications on multiprocessors.
+<P>
+On most platforms, the allocator/collector lock is implemented as a
+spin lock with exponential back-off. Longer wait times are implemented
+by yielding and/or sleeping. If a collection is in progress, the pure
+spinning stage is skipped. This has the advantage that uncontested and
+thus most uniprocessor lock acquisitions are very cheap. It has the
+disadvantage that the application may sleep for small periods of time
+even when there is work to be done. And threads may be unnecessarily
+woken up for short periods. Nonetheless, this scheme empirically
+outperforms native queue-based mutual exclusion implementations in most
+cases, sometimes drastically so.
+<H2>Options for enhanced scalability</h2>
+Version 6.0 of the collector adds two facilities to enhance collector
+scalability on multiprocessors. As of 6.0alpha1, these are supported
+only under Linux on X86 and IA64 processors, though ports to other
+otherwise supported Pthreads platforms should be straightforward.
+They are intended to be used together.
+<UL>
+<LI>
+Building the collector with <TT>-DPARALLEL_MARK</tt> allows the collector to
+run the mark phase in parallel in multiple threads, and thus on multiple
+processors. The mark phase typically consumes the large majority of the
+collection time. Thus this largely parallelizes the garbage collector
+itself, though not the allocation process. Currently the marking is
+performed by the thread that triggered the collection, together with
+<I>N</i>-1 dedicated
+threads, where <I>N</i> is the number of processors detected by the collector.
+The dedicated threads are created once at initialization time.
+<P>
+A second effect of this flag is to switch to a more concurrent
+implementation of <TT>GC_malloc_many</tt>, so that free lists can be
+built, and memory can be cleared, by more than one thread concurrently.
+<LI>
+Building the collector with -DTHREAD_LOCAL_ALLOC adds support for thread
+local allocation. It does not, by itself, cause thread local allocation
+to be used. It simply allows the use of the interface in
+<TT>gc_local_alloc.h</tt>.
+<P>
+Memory returned from thread-local allocators is completely interchangeable
+with that returned by the standard allocators. It may be used by other
+threads. The only difference is that, if the thread allocates enough
+memory of a certain kind, it will build a thread-local free list for
+objects of that kind, and allocate from that. This greatly reduces
+locking. The thread-local free lists are refilled using
+<TT>GC_malloc_many</tt>.
+<P>
+An important side effect of this flag is to replace the default
+spin-then-sleep lock to be replace by a spin-then-queue based implementation.
+This <I>reduces performance</i> for the standard allocation functions,
+though it usually improves performance when thread-local allocation is
+used heavily, and thus the number of short-duration lock acquisitions
+is greatly reduced.
+</ul>
+<P>
+The easiest way to switch an application to thread-local allocation is to
+<OL>
+<LI> Define the macro <TT>GC_REDIRECT_TO_LOCAL</tt>,
+and then include the <TT>gc.h</tt>
+header in each client source file.
+<LI> Invoke <TT>GC_thr_init()</tt> before any allocation.
+<LI> Allocate using <TT>GC_MALLOC</tt>, <TT>GC_MALLOC_ATOMIC</tt>,
+and/or <TT>GC_GCJ_MALLOC</tt>.
+</ol>
+<H2>The Parallel Marking Algorithm</h2>
+We use an algorithm similar to
+<A HREF="http://www.yl.is.s.u-tokyo.ac.jp/gc/">that developed by
+Endo, Taura, and Yonezawa</a> at the University of Tokyo.
+However, the data structures and implementation are different,
+and represent a smaller change to the original collector source,
+probably at the expense of extreme scalability. Some of
+the refinements they suggest, <I>e.g.</i> splitting large
+objects, were also incorporated into out approach.
+<P>
+The global mark stack is transformed into a global work queue.
+Unlike the usual case, it never shrinks during a mark phase.
+The mark threads remove objects from the queue by copying them to a
+local mark stack and changing the global descriptor to zero, indicating
+that there is no more work to be done for this entry.
+This removal
+is done with no synchronization. Thus it is possible for more than
+one worker to remove the same entry, resulting in some work duplication.
+<P>
+The global work queue grows only if a marker thread decides to
+return some of its local mark stack to the global one. This
+is done if the global queue appears to be running low, or if
+the local stack is in danger of overflowing. It does require
+synchronization, but should be relatively rare.
+<P>
+The sequential marking code is reused to process local mark stacks.
+Hence the amount of additional code required for parallel marking
+is minimal.
+<P>
+It should be possible to use generational collection in the presence of the
+parallel collector, by calling <TT>GC_enable_incremental()</tt>.
+This does not result in fully incremental collection, since parallel mark
+phases cannot currently be interrupted, and doing so may be too
+expensive.
+<P>
+Gcj-style mark descriptors do not currently mix with the combination
+of local allocation and incremental collection. They should work correctly
+with one or the other, but not both.
+<P>
+The number of marker threads is set on startup to the number of
+available processors (or to the value of the <TT>GC_NPROCS</tt>
+environment variable). If only a single processor is detected,
+parallel marking is disabled.
+<P>
+Note that setting GC_NPROCS to 1 also causes some lock acquisitions inside
+the collector to immediately yield the processor instead of busy waiting
+first. In the case of a multiprocessor and a client with multiple
+simultaneously runnable threads, this may have disastrous performance
+consequences (e.g. a factor of 10 slowdown).
+<H2>Performance</h2>
+We conducted some simple experiments with a version of
+<A HREF="gc_bench.html">our GC benchmark</a> that was slightly modified to
+run multiple concurrent client threads in the same address space.
+Each client thread does the same work as the original benchmark, but they share
+a heap.
+This benchmark involves very little work outside of memory allocation.
+This was run with GC 6.0alpha3 on a dual processor Pentium III/500 machine
+under Linux 2.2.12.
+<P>
+Running with a thread-unsafe collector, the benchmark ran in 9
+seconds. With the simple thread-safe collector,
+built with <TT>-DLINUX_THREADS</tt>, the execution time
+increased to 10.3 seconds, or 23.5 elapsed seconds with two clients.
+(The times for the <TT>malloc</tt>/i<TT>free</tt> version
+with glibc <TT>malloc</tt>
+are 10.51 (standard library, pthreads not linked),
+20.90 (one thread, pthreads linked),
+and 24.55 seconds respectively. The benchmark favors a
+garbage collector, since most objects are small.)
+<P>
+The following table gives execution times for the collector built
+with parallel marking and thread-local allocation support
+(<TT>-DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC</tt>). We tested
+the client using either one or two marker threads, and running
+one or two client threads. Note that the client uses thread local
+allocation exclusively. With -DTHREAD_LOCAL_ALLOC the collector
+switches to a locking strategy that is better tuned to less frequent
+lock acquisition. The standard allocation primitives thus peform
+slightly worse than without -DTHREAD_LOCAL_ALLOC, and should be
+avoided in time-critical code.
+<P>
+(The results using <TT>pthread_mutex_lock</tt>
+directly for allocation locking would have been worse still, at
+least for older versions of linuxthreads.
+With THREAD_LOCAL_ALLOC, we first repeatedly try to acquire the
+lock with pthread_mutex_try_lock(), busy_waiting between attempts.
+After a fixed number of attempts, we use pthread_mutex_lock().)
+<P>
+These measurements do not use incremental collection, nor was prefetching
+enabled in the marker. We used the C version of the benchmark.
+All measurements are in elapsed seconds on an unloaded machine.
+<P>
+<TABLE BORDER ALIGN="CENTER">
+<TR><TH>Number of threads</th><TH>1 marker thread (secs.)</th>
+<TH>2 marker threads (secs.)</th></tr>
+<TR><TD>1 client</td><TD ALIGN="CENTER">10.45</td><TD ALIGN="CENTER">7.85</td>
+<TR><TD>2 clients</td><TD ALIGN="CENTER">19.95</td><TD ALIGN="CENTER">12.3</td>
+</table>
+<PP>
+The execution time for the single threaded case is slightly worse than with
+simple locking. However, even the single-threaded benchmark runs faster than
+even the thread-unsafe version if a second processor is available.
+The execution time for two clients with thread local allocation time is
+only 1.4 times the sequential execution time for a single thread in a
+thread-unsafe environment, even though it involves twice the client work.
+That represents close to a
+factor of 2 improvement over the 2 client case with the old collector.
+The old collector clearly
+still suffered from some contention overhead, in spite of the fact that the
+locking scheme had been fairly well tuned.
+<P>
+Full linear speedup (i.e. the same execution time for 1 client on one
+processor as 2 clients on 2 processors)
+is probably not achievable on this kind of
+hardware even with such a small number of processors,
+since the memory system is
+a major constraint for the garbage collector,
+the processors usually share a single memory bus, and thus
+the aggregate memory bandwidth does not increase in
+proportion to the number of processors.
+<P>
+These results are likely to be very sensitive to both hardware and OS
+issues. Preliminary experiments with an older Pentium Pro machine running
+an older kernel were far less encouraging.
+
+</body>
+</html>
diff --git a/boehm-gc/doc/tree.html b/boehm-gc/doc/tree.html
index 89c515da765..c46a281cc67 100644
--- a/boehm-gc/doc/tree.html
+++ b/boehm-gc/doc/tree.html
@@ -1,13 +1,14 @@
<HTML>
<HEAD>
<TITLE> Two-Level Tree Structure for Fast Pointer Lookup</TITLE>
- <AUTHOR> Hans-J. Boehm, Silicon Graphics</author>
+ <AUTHOR> Hans-J. Boehm, Silicon Graphics (now at HP)</author>
</HEAD>
<BODY>
<H1>Two-Level Tree Structure for Fast Pointer Lookup</h1>
<P>
The conservative garbage collector described
-<A HREF="gc.html">here</a> uses a 2-level tree
+<A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/">here</a>
+uses a 2-level tree
data structure to aid in fast pointer identification.
This data structure is described in a bit more detail here, since
<OL>
diff --git a/boehm-gc/dyn_load.c b/boehm-gc/dyn_load.c
index 71ad5fb1d78..1f4a63646b1 100644
--- a/boehm-gc/dyn_load.c
+++ b/boehm-gc/dyn_load.c
@@ -55,9 +55,10 @@
!defined(MSWIN32) && !defined(MSWINCE) && \
!(defined(ALPHA) && defined(OSF1)) && \
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
- !defined(RS6000) && !defined(SCO_ELF) && \
+ !defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
!(defined(FREEBSD) && defined(__ELF__)) && \
- !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD)
+ !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
+ !defined(DARWIN)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
@@ -80,7 +81,7 @@
#endif
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(FREEBSD) && defined(__ELF__)) || \
+ (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
# include <stddef.h>
# include <elf.h>
@@ -264,7 +265,7 @@ void GC_register_dynamic_libraries()
# endif /* SUNOS */
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(FREEBSD) && defined(__ELF__)) || \
+ (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
@@ -282,56 +283,23 @@ extern ssize_t GC_repeat_read(int fd, char *buf, size_t count);
/* Repeatedly read until buffer is filled, or EOF is encountered */
/* Defined in os_dep.c. */
-static char *parse_map_entry(char *buf_ptr, word *start, word *end,
- char *prot_buf, unsigned int *maj_dev);
+char *GC_parse_map_entry(char *buf_ptr, word *start, word *end,
+ char *prot_buf, unsigned int *maj_dev);
+word GC_apply_to_maps(word (*fn)(char *));
+ /* From os_dep.c */
-void GC_register_dynamic_libraries()
+word GC_register_map_entries(char *maps)
{
- int f;
- int result;
char prot_buf[5];
- int maps_size;
- char maps_temp[32768];
- char *maps_buf;
- char *buf_ptr;
+ char *buf_ptr = maps;
int count;
word start, end;
- unsigned int maj_dev, min_dev;
+ unsigned int maj_dev;
word least_ha, greatest_ha;
unsigned i;
word datastart = (word)(DATASTART);
- /* Read /proc/self/maps */
- /* Note that we may not allocate, and thus can't use stdio. */
- f = open("/proc/self/maps", O_RDONLY);
- if (-1 == f) ABORT("Couldn't open /proc/self/maps");
- /* stat() doesn't work for /proc/self/maps, so we have to
- read it to find out how large it is... */
- maps_size = 0;
- do {
- result = GC_repeat_read(f, maps_temp, sizeof(maps_temp));
- if (result <= 0) ABORT("Couldn't read /proc/self/maps");
- maps_size += result;
- } while (result == sizeof(maps_temp));
-
- if (maps_size > sizeof(maps_temp)) {
- /* If larger than our buffer, close and re-read it. */
- close(f);
- f = open("/proc/self/maps", O_RDONLY);
- if (-1 == f) ABORT("Couldn't open /proc/self/maps");
- maps_buf = alloca(maps_size);
- if (NULL == maps_buf) ABORT("/proc/self/maps alloca failed");
- result = GC_repeat_read(f, maps_buf, maps_size);
- if (result <= 0) ABORT("Couldn't read /proc/self/maps");
- } else {
- /* Otherwise use the fixed size buffer */
- maps_buf = maps_temp;
- }
-
- close(f);
- maps_buf[result] = '\0';
- buf_ptr = maps_buf;
- /* Compute heap bounds. Should be done by add_to_heap? */
+ /* Compute heap bounds. FIXME: Should be done by add_to_heap? */
least_ha = (word)(-1);
greatest_ha = 0;
for (i = 0; i < GC_n_heap_sects; ++i) {
@@ -342,11 +310,10 @@ void GC_register_dynamic_libraries()
}
if (greatest_ha < (word)GC_scratch_last_end_ptr)
greatest_ha = (word)GC_scratch_last_end_ptr;
- for (;;) {
-
- buf_ptr = parse_map_entry(buf_ptr, &start, &end, prot_buf, &maj_dev);
- if (buf_ptr == NULL) return;
+ for (;;) {
+ buf_ptr = GC_parse_map_entry(buf_ptr, &start, &end, prot_buf, &maj_dev);
+ if (buf_ptr == NULL) return 1;
if (prot_buf[1] == 'w') {
/* This is a writable mapping. Add it to */
/* the root set unless it is already otherwise */
@@ -358,16 +325,7 @@ void GC_register_dynamic_libraries()
# ifdef THREADS
if (GC_segment_is_thread_stack(start, end)) continue;
# endif
- /* The rest of this assumes that there is no mapping */
- /* spanning the beginning of the data segment, or extending */
- /* beyond the entire heap at both ends. */
- /* Empirically these assumptions hold. */
-
- if (start < (word)DATAEND && end > (word)DATAEND) {
- /* Rld may use space at the end of the main data */
- /* segment. Thus we add that in. */
- start = (word)DATAEND;
- }
+ /* We no longer exclude the main data segment. */
if (start < least_ha && end > least_ha) {
end = least_ha;
}
@@ -377,7 +335,14 @@ void GC_register_dynamic_libraries()
if (start >= least_ha && end <= greatest_ha) continue;
GC_add_roots_inner((char *)start, (char *)end, TRUE);
}
- }
+ }
+ return 1;
+}
+
+void GC_register_dynamic_libraries()
+{
+ if (!GC_apply_to_maps(GC_register_map_entries))
+ ABORT("Failed to read /proc for library registration.");
}
/* We now take care of the main data segment ourselves: */
@@ -387,60 +352,6 @@ GC_bool GC_register_main_static_data()
}
# define HAVE_REGISTER_MAIN_STATIC_DATA
-//
-// parse_map_entry parses an entry from /proc/self/maps so we can
-// locate all writable data segments that belong to shared libraries.
-// The format of one of these entries and the fields we care about
-// is as follows:
-// XXXXXXXX-XXXXXXXX r-xp 00000000 30:05 260537 name of mapping...\n
-// ^^^^^^^^ ^^^^^^^^ ^^^^ ^^
-// start end prot maj_dev
-// 0 9 18 32
-//
-// The parser is called with a pointer to the entry and the return value
-// is either NULL or is advanced to the next entry(the byte after the
-// trailing '\n'.)
-//
-#define OFFSET_MAP_START 0
-#define OFFSET_MAP_END 9
-#define OFFSET_MAP_PROT 18
-#define OFFSET_MAP_MAJDEV 32
-
-static char *parse_map_entry(char *buf_ptr, word *start, word *end,
- char *prot_buf, unsigned int *maj_dev)
-{
- int i;
- unsigned int val;
- char *tok;
-
- if (buf_ptr == NULL || *buf_ptr == '\0') {
- return NULL;
- }
-
- memcpy(prot_buf, buf_ptr+OFFSET_MAP_PROT, 4); // do the protections first
- prot_buf[4] = '\0';
-
- if (prot_buf[1] == 'w') { // we can skip all of this if it's not writable
-
- tok = buf_ptr;
- buf_ptr[OFFSET_MAP_START+8] = '\0';
- *start = strtoul(tok, NULL, 16);
-
- tok = buf_ptr+OFFSET_MAP_END;
- buf_ptr[OFFSET_MAP_END+8] = '\0';
- *end = strtoul(tok, NULL, 16);
-
- buf_ptr += OFFSET_MAP_MAJDEV;
- tok = buf_ptr;
- while (*buf_ptr != ':') buf_ptr++;
- *buf_ptr++ = '\0';
- *maj_dev = strtoul(tok, NULL, 16);
- }
-
- while (*buf_ptr && *buf_ptr++ != '\n');
-
- return buf_ptr;
-}
#endif /* USE_PROC_FOR_LIBRARIES */
@@ -508,6 +419,7 @@ GC_bool GC_register_dynamic_libraries_dl_iterate_phdr()
GC_add_roots_inner(DATASTART2, (char *)(DATAEND2), TRUE);
# endif
}
+
return TRUE;
} else {
return FALSE;
@@ -534,6 +446,16 @@ GC_bool GC_register_main_static_data()
#if defined(NETBSD)
# include <sys/exec_elf.h>
+/* for compatibility with 1.4.x */
+# ifndef DT_DEBUG
+# define DT_DEBUG 21
+# endif
+# ifndef PT_LOAD
+# define PT_LOAD 1
+# endif
+# ifndef PF_W
+# define PF_W 2
+# endif
#else
# include <elf.h>
#endif
@@ -1048,7 +970,7 @@ void GC_register_dynamic_libraries()
len = ldi->ldinfo_next;
GC_add_roots_inner(
ldi->ldinfo_dataorg,
- (unsigned long)ldi->ldinfo_dataorg
+ (ptr_t)(unsigned long)ldi->ldinfo_dataorg
+ ldi->ldinfo_datasize,
TRUE);
ldi = len ? (struct ld_info *)((char *)ldi + len) : 0;
@@ -1056,7 +978,139 @@ void GC_register_dynamic_libraries()
}
#endif /* RS6000 */
+#ifdef DARWIN
+
+#ifndef __private_extern__
+#define __private_extern__ extern
+#include <mach-o/dyld.h>
+#undef __private_extern__
+#else
+#include <mach-o/dyld.h>
+#endif
+#include <mach-o/getsect.h>
+
+/*#define DARWIN_DEBUG*/
+
+const static struct {
+ const char *seg;
+ const char *sect;
+} GC_dyld_sections[] = {
+ { SEG_DATA, SECT_DATA },
+ { SEG_DATA, SECT_BSS },
+ { SEG_DATA, SECT_COMMON }
+};
+
+#ifdef DARWIN_DEBUG
+static const char *GC_dyld_name_for_hdr(struct mach_header *hdr) {
+ unsigned long i,c;
+ c = _dyld_image_count();
+ for(i=0;i<c;i++) if(_dyld_get_image_header(i) == hdr)
+ return _dyld_get_image_name(i);
+ return NULL;
+}
+#endif
+
+/* This should never be called by a thread holding the lock */
+static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) {
+ unsigned long start,end,i;
+ const struct section *sec;
+ for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
+ sec = getsectbynamefromheader(
+ hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
+ if(sec == NULL || sec->size == 0) continue;
+ start = slide + sec->addr;
+ end = start + sec->size;
+# ifdef DARWIN_DEBUG
+ GC_printf4("Adding section at %p-%p (%lu bytes) from image %s\n",
+ start,end,sec->size,GC_dyld_name_for_hdr(hdr));
+# endif
+ GC_add_roots((char*)start,(char*)end);
+ }
+# ifdef DARWIN_DEBUG
+ GC_print_static_roots();
+# endif
+}
+
+/* This should never be called by a thread holding the lock */
+static void GC_dyld_image_remove(struct mach_header* hdr, unsigned long slide) {
+ unsigned long start,end,i;
+ const struct section *sec;
+ for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
+ sec = getsectbynamefromheader(
+ hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
+ if(sec == NULL || sec->size == 0) continue;
+ start = slide + sec->addr;
+ end = start + sec->size;
+# ifdef DARWIN_DEBUG
+ GC_printf4("Removing section at %p-%p (%lu bytes) from image %s\n",
+ start,end,sec->size,GC_dyld_name_for_hdr(hdr));
+# endif
+ GC_remove_roots((char*)start,(char*)end);
+ }
+# ifdef DARWIN_DEBUG
+ GC_print_static_roots();
+# endif
+}
+
+void GC_register_dynamic_libraries() {
+ /* Currently does nothing. The callbacks are setup by GC_init_dyld()
+ The dyld library takes it from there. */
+}
+
+/* The _dyld_* functions have an internal lock so no _dyld functions
+ can be called while the world is stopped without the risk of a deadlock.
+ Because of this we MUST setup callbacks BEFORE we ever stop the world.
+ This should be called BEFORE any thread in created and WITHOUT the
+ allocation lock held. */
+
+void GC_init_dyld() {
+ static GC_bool initialized = FALSE;
+ char *bind_fully_env = NULL;
+
+ if(initialized) return;
+
+# ifdef DARWIN_DEBUG
+ GC_printf0("Registering dyld callbacks...\n");
+# endif
+
+ /* Apple's Documentation:
+ When you call _dyld_register_func_for_add_image, the dynamic linker runtime
+ calls the specified callback (func) once for each of the images that is
+ currently loaded into the program. When a new image is added to the program,
+ your callback is called again with the mach_header for the new image, and the
+ virtual memory slide amount of the new image.
+
+ This WILL properly register already linked libraries and libraries
+ linked in the future
+ */
+
+ _dyld_register_func_for_add_image(GC_dyld_image_add);
+ _dyld_register_func_for_remove_image(GC_dyld_image_remove);
+
+ /* Set this early to avoid reentrancy issues. */
+ initialized = TRUE;
+
+ bind_fully_env = getenv("DYLD_BIND_AT_LAUNCH");
+
+ if (bind_fully_env == NULL) {
+# ifdef DARWIN_DEBUG
+ GC_printf0("Forcing full bind of GC code...\n");
+# endif
+
+ if(!_dyld_bind_fully_image_containing_address((unsigned long*)GC_malloc))
+ GC_abort("_dyld_bind_fully_image_containing_address failed");
+ }
+
+}
+
+#define HAVE_REGISTER_MAIN_STATIC_DATA
+GC_bool GC_register_main_static_data()
+{
+ /* Already done through dyld callbacks */
+ return FALSE;
+}
+#endif /* DARWIN */
#else /* !DYNAMIC_LOADING */
diff --git a/boehm-gc/finalize.c b/boehm-gc/finalize.c
index a316010a680..3b9d9f5ea1e 100644
--- a/boehm-gc/finalize.c
+++ b/boehm-gc/finalize.c
@@ -207,7 +207,8 @@ signed_word * log_size_ptr;
UNLOCK();
ENABLE_SIGNALS();
# endif
- new_dl = GC_oom_fn(sizeof(struct disappearing_link));
+ new_dl = (struct disappearing_link *)
+ GC_oom_fn(sizeof(struct disappearing_link));
if (0 == new_dl) {
GC_finalization_failures++;
return(0);
@@ -433,7 +434,8 @@ finalization_mark_proc * mp;
UNLOCK();
ENABLE_SIGNALS();
# endif
- new_fo = GC_oom_fn(sizeof(struct finalizable_object));
+ new_fo = (struct finalizable_object *)
+ GC_oom_fn(sizeof(struct finalizable_object));
if (0 == new_fo) {
GC_finalization_failures++;
return;
@@ -759,8 +761,9 @@ int GC_should_invoke_finalizers GC_PROTO((void))
/* Should be called without allocation lock. */
int GC_invoke_finalizers()
{
- register struct finalizable_object * curr_fo;
- register int count = 0;
+ struct finalizable_object * curr_fo;
+ int count = 0;
+ word mem_freed_before;
DCL_LOCK_STATE;
while (GC_finalize_now != 0) {
@@ -768,6 +771,9 @@ int GC_invoke_finalizers()
DISABLE_SIGNALS();
LOCK();
# endif
+ if (count == 0) {
+ mem_freed_before = GC_mem_freed;
+ }
curr_fo = GC_finalize_now;
# ifdef THREADS
if (curr_fo != 0) GC_finalize_now = fo_next(curr_fo);
@@ -789,6 +795,11 @@ int GC_invoke_finalizers()
GC_free((GC_PTR)curr_fo);
# endif
}
+ if (count != 0 && mem_freed_before != GC_mem_freed) {
+ LOCK();
+ GC_finalizer_mem_freed += (GC_mem_freed - mem_freed_before);
+ UNLOCK();
+ }
return count;
}
@@ -801,7 +812,9 @@ void GC_notify_or_invoke_finalizers GC_PROTO((void))
if (GC_finalize_now == 0) return;
if (!GC_finalize_on_demand) {
(void) GC_invoke_finalizers();
- GC_ASSERT(GC_finalize_now == 0);
+# ifndef THREADS
+ GC_ASSERT(GC_finalize_now == 0);
+# endif /* Otherwise GC can run concurrently and add more */
return;
}
if (GC_finalizer_notifier != (void (*) GC_PROTO((void)))0
@@ -839,3 +852,17 @@ void GC_notify_or_invoke_finalizers GC_PROTO((void))
return(result);
}
+#if !defined(NO_DEBUGGING)
+
+void GC_print_finalization_stats()
+{
+ struct finalizable_object *fo = GC_finalize_now;
+ size_t ready = 0;
+
+ GC_printf2("%lu finalization table entries; %lu disappearing links\n",
+ GC_fo_entries, GC_dl_entries);
+ for (; 0 != fo; fo = fo_next(fo)) ++ready;
+ GC_printf1("%lu objects are eligible for immediate finalization\n", ready);
+}
+
+#endif /* NO_DEBUGGING */
diff --git a/boehm-gc/gc_cpp.cc b/boehm-gc/gc_cpp.cc
index a97091c817c..f8b803a8baa 100644
--- a/boehm-gc/gc_cpp.cc
+++ b/boehm-gc/gc_cpp.cc
@@ -26,15 +26,13 @@ Authors: John R. Ellis and Jesse Hull
#include "gc_cpp.h"
-#ifndef _MSC_VER
-/* In the Visual C++ case, we moved this into the header. */
void* operator new( size_t size ) {
return GC_MALLOC_UNCOLLECTABLE( size );}
void operator delete( void* obj ) {
GC_FREE( obj );}
-#ifdef OPERATOR_NEW_ARRAY
+#ifdef GC_OPERATOR_NEW_ARRAY
void* operator new[]( size_t size ) {
return GC_MALLOC_UNCOLLECTABLE( size );}
@@ -42,8 +40,22 @@ void* operator new[]( size_t size ) {
void operator delete[]( void* obj ) {
GC_FREE( obj );}
-#endif /* OPERATOR_NEW_ARRAY */
+#endif /* GC_OPERATOR_NEW_ARRAY */
-#endif /* _MSC_VER */
+#ifdef _MSC_VER
+
+// This new operator is used by VC++ in case of Debug builds !
+void* operator new( size_t size,
+ int ,//nBlockUse,
+ const char * szFileName,
+ int nLine )
+{
+#ifndef GC_DEBUG
+ return GC_malloc_uncollectable( size );
+#else
+ return GC_debug_malloc_uncollectable(size, szFileName, nLine);
+#endif
+}
+#endif /* _MSC_VER */
diff --git a/boehm-gc/gc_dlopen.c b/boehm-gc/gc_dlopen.c
index eafaa2b1b46..4c690edcfe4 100644
--- a/boehm-gc/gc_dlopen.c
+++ b/boehm-gc/gc_dlopen.c
@@ -19,12 +19,14 @@
/*
* This used to be in dyn_load.c. It was extracted into a separate file
* to avoid having to link against libdl.{a,so} if the client doesn't call
- * dlopen. -HB
+ * dlopen. Of course this fails if the collector is in a dynamic
+ * library. -HB
*/
#include "private/gc_priv.h"
-# if defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS)
+# if (defined(GC_PTHREADS) && !defined(GC_DARWIN_THREADS)) \
+ || defined(GC_SOLARIS_THREADS)
# if defined(dlopen) && !defined(GC_USE_LD_WRAP)
/* To support various threads pkgs, gc.h interposes on dlopen by */
@@ -44,19 +46,14 @@
/* calls in either a multithreaded environment, or if the library */
/* initialization code allocates substantial amounts of GC'ed memory. */
/* But I don't know of a better solution. */
- /* This can still deadlock if the client explicitly starts a GC */
- /* during the dlopen. He shouldn't do that. */
- static GC_bool disable_gc_for_dlopen()
+ static void disable_gc_for_dlopen()
{
- GC_bool result;
LOCK();
- result = GC_dont_gc;
while (GC_incremental && GC_collection_in_progress()) {
GC_collect_a_little_inner(1000);
}
- GC_dont_gc = TRUE;
+ ++GC_dont_gc;
UNLOCK();
- return(result);
}
/* Redefine dlopen to guarantee mutual exclusion with */
@@ -74,10 +71,9 @@
#endif
{
void * result;
- GC_bool dont_gc_save;
# ifndef USE_PROC_FOR_LIBRARIES
- dont_gc_save = disable_gc_for_dlopen();
+ disable_gc_for_dlopen();
# endif
# ifdef GC_USE_LD_WRAP
result = (void *)__real_dlopen(path, mode);
@@ -85,7 +81,7 @@
result = dlopen(path, mode);
# endif
# ifndef USE_PROC_FOR_LIBRARIES
- GC_dont_gc = dont_gc_save;
+ GC_enable(); /* undoes disable_gc_for_dlopen */
# endif
return(result);
}
diff --git a/boehm-gc/gcj_mlc.c b/boehm-gc/gcj_mlc.c
index 89f0d728a57..a10a66f926e 100644
--- a/boehm-gc/gcj_mlc.c
+++ b/boehm-gc/gcj_mlc.c
@@ -157,6 +157,7 @@ DCL_LOCK_STATE;
GC_words_allocd += lw;
}
*(void **)op = ptr_to_struct_containing_descr;
+ GC_ASSERT(((void **)op)[1] == 0);
UNLOCK();
} else {
LOCK();
diff --git a/boehm-gc/if_mach.c b/boehm-gc/if_mach.c
index fd6009e1c35..3dcccf21f5a 100644
--- a/boehm-gc/if_mach.c
+++ b/boehm-gc/if_mach.c
@@ -14,7 +14,7 @@ char ** envp;
if (strcmp(MACH_TYPE, argv[1]) != 0) return(0);
if (strcmp(OS_TYPE, "") != 0 && strcmp(argv[2], "") != 0
&& strcmp(OS_TYPE, argv[2]) != 0) return(0);
- printf("^^^^Starting command^^^^\n");
+ fprintf(stderr, "^^^^Starting command^^^^\n");
fflush(stdout);
execvp(argv[3], argv+3);
perror("Couldn't execute");
diff --git a/boehm-gc/include/Makefile.in b/boehm-gc/include/Makefile.in
index 65bd34e2e33..94ece1a258a 100644
--- a/boehm-gc/include/Makefile.in
+++ b/boehm-gc/include/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -66,9 +66,11 @@ target_triplet = @target@
AR = @AR@
AS = @AS@
CC = @CC@
+CFLAGS = @CFLAGS@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
CXXINCLUDES = @CXXINCLUDES@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
@@ -89,10 +91,15 @@ RANLIB = @RANLIB@
STRIP = @STRIP@
THREADLIBS = @THREADLIBS@
VERSION = @VERSION@
+addincludes = @addincludes@
+addlibs = @addlibs@
addobjs = @addobjs@
+addtests = @addtests@
gc_basedir = @gc_basedir@
mkinstalldirs = @mkinstalldirs@
target_all = @target_all@
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
AUTOMAKE_OPTIONS = foreign
diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
index 69075b0669e..4444e991ff3 100644
--- a/boehm-gc/include/gc.h
+++ b/boehm-gc/include/gc.h
@@ -30,91 +30,7 @@
# define _GC_H
-/*
- * Some tests for old macros. These violate our namespace rules and will
- * disappear shortly. Use the GC_ names.
- */
-#if defined(SOLARIS_THREADS) || defined(_SOLARIS_THREADS)
-# define GC_SOLARIS_THREADS
-#endif
-#if defined(_SOLARIS_PTHREADS)
-# define GC_SOLARIS_PTHREADS
-#endif
-#if defined(IRIX_THREADS)
-# define GC_IRIX_THREADS
-#endif
-#if defined(HPUX_THREADS)
-# define GC_HPUX_THREADS
-#endif
-#if defined(OSF1_THREADS)
-# define GC_OSF1_THREADS
-#endif
-#if defined(LINUX_THREADS)
-# define GC_LINUX_THREADS
-#endif
-#if defined(WIN32_THREADS)
-# define GC_WIN32_THREADS
-#endif
-#if defined(USE_LD_WRAP)
-# define GC_USE_LD_WRAP
-#endif
-
-#if !defined(_REENTRANT) && (defined(GC_SOLARIS_THREADS) \
- || defined(GC_SOLARIS_PTHREADS) \
- || defined(GC_HPUX_THREADS) \
- || defined(GC_LINUX_THREADS))
-# define _REENTRANT
- /* Better late than never. This fails if system headers that */
- /* depend on this were previously included. */
-#endif
-
-#if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)
-# define GC_SOLARIS_THREADS
-#endif
-
-# if defined(GC_SOLARIS_PTHREADS) || defined(GC_FREEBSD_THREADS) || \
- defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
- defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
-# define GC_PTHREADS
-# endif
-
-# define __GC
-# include <stddef.h>
-# ifdef _WIN32_WCE
-/* Yet more kluges for WinCE */
-# include <stdlib.h> /* size_t is defined here */
- typedef long ptrdiff_t; /* ptrdiff_t is not defined */
-# endif
-
-#if defined(__MINGW32__) &&defined(_DLL) && !defined(GC_NOT_DLL)
-# ifdef GC_BUILD
-# define GC_API __declspec(dllexport)
-# else
-# define GC_API __declspec(dllimport)
-# endif
-#endif
-
-#if (defined(__DMC__) || defined(_MSC_VER)) \
- && (defined(_DLL) && !defined(GC_NOT_DLL) \
- || defined(GC_DLL))
-# ifdef GC_BUILD
-# define GC_API extern __declspec(dllexport)
-# else
-# define GC_API __declspec(dllimport)
-# endif
-#endif
-
-#if defined(__WATCOMC__) && defined(GC_DLL)
-# ifdef GC_BUILD
-# define GC_API extern __declspec(dllexport)
-# else
-# define GC_API extern __declspec(dllimport)
-# endif
-#endif
-
-#ifndef GC_API
-#define GC_API extern
-#endif
+# include "gc_config_macros.h"
# if defined(__STDC__) || defined(__cplusplus)
# define GC_PROTO(args) args
@@ -154,7 +70,7 @@ GC_API int GC_parallel; /* GC is parallelized for performance on */
/* Env variable GC_NPROC is set to > 1, or */
/* GC_NPROC is not set and this is an MP. */
/* If GC_parallel is set, incremental */
- /* collection is aonly partially functional, */
+ /* collection is only partially functional, */
/* and may not be desirable. */
@@ -215,8 +131,14 @@ GC_API void (* GC_finalizer_notifier)();
/* thread, which will call GC_invoke_finalizers */
/* in response. */
-GC_API int GC_dont_gc; /* Dont collect unless explicitly requested, e.g. */
- /* because it's not safe. */
+GC_API int GC_dont_gc; /* != 0 ==> Dont collect. In versions 6.2a1+, */
+ /* this overrides explicit GC_gcollect() calls. */
+ /* Used as a counter, so that nested enabling */
+ /* and disabling work correctly. Should */
+ /* normally be updated with GC_enable() and */
+ /* GC_disable() calls. */
+ /* Direct assignment to GC_dont_gc is */
+ /* deprecated. */
GC_API int GC_dont_expand;
/* Dont expand heap unless explicitly requested */
@@ -316,9 +238,18 @@ GC_API unsigned long GC_time_limit;
/* enabled. */
# define GC_TIME_UNLIMITED 999999
/* Setting GC_time_limit to this value */
- /* will disable the "pause time exceeded */
+ /* will disable the "pause time exceeded"*/
/* tests. */
+/* Public procedures */
+
+/* Initialize the collector. This is only required when using thread-local
+ * allocation, since unlike the regular allocation routines, GC_local_malloc
+ * is not self-initializing. If you use GC_local_malloc you should arrange
+ * to call this somehow (e.g. from a constructor) before doing any allocation.
+ */
+GC_API void GC_init GC_PROTO((void));
+
/*
* general purpose allocation routines, with roughly malloc calling conv.
* The atomic versions promise that no relevant pointers are contained
@@ -419,17 +350,21 @@ GC_API void GC_clear_roots GC_PROTO((void));
GC_API void GC_add_roots GC_PROTO((char * low_address,
char * high_address_plus_1));
+/* Remove a root segment. Wizards only. */
+GC_API void GC_remove_roots GC_PROTO((char * low_address,
+ char * high_address_plus_1));
+
/* Add a displacement to the set of those considered valid by the */
/* collector. GC_register_displacement(n) means that if p was returned */
/* by GC_malloc, then (char *)p + n will be considered to be a valid */
-/* pointer to n. N must be small and less than the size of p. */
+/* pointer to p. N must be small and less than the size of p. */
/* (All pointers to the interior of objects from the stack are */
/* considered valid in any case. This applies to heap objects and */
/* static data.) */
/* Preferably, this should be called before any other GC procedures. */
/* Calling it later adds to the probability of excess memory */
/* retention. */
-/* This is a no-op if the collector was compiled with recognition of */
+/* This is a no-op if the collector has recognition of */
/* arbitrary interior pointers enabled, which is now the default. */
GC_API void GC_register_displacement GC_PROTO((GC_word n));
@@ -464,9 +399,18 @@ GC_API size_t GC_get_free_bytes GC_PROTO((void));
GC_API size_t GC_get_bytes_since_gc GC_PROTO((void));
/* Return the total number of bytes allocated in this process. */
-/* Never decreases. */
+/* Never decreases, except due to wrapping. */
GC_API size_t GC_get_total_bytes GC_PROTO((void));
+/* Disable garbage collection. Even GC_gcollect calls will be */
+/* ineffective. */
+GC_API void GC_disable GC_PROTO((void));
+
+/* Reenable garbage collection. GC_disable() and GC_enable() calls */
+/* nest. Garbage collection is enabled if the number of calls to both */
+/* both functions is equal. */
+GC_API void GC_enable GC_PROTO((void));
+
/* Enable incremental/generational collection. */
/* Not advisable unless dirty bits are */
/* available or most heap objects are */
@@ -474,7 +418,11 @@ GC_API size_t GC_get_total_bytes GC_PROTO((void));
/* Don't use in leak finding mode. */
/* Ignored if GC_dont_gc is true. */
/* Only the generational piece of this is */
-/* functional if GC_parallel is TRUE. */
+/* functional if GC_parallel is TRUE */
+/* or if GC_time_limit is GC_TIME_UNLIMITED. */
+/* Causes GC_local_gcj_malloc() to revert to */
+/* locked allocation. Must be called */
+/* before any GC_local_gcj_malloc() calls. */
GC_API void GC_enable_incremental GC_PROTO((void));
/* Does incremental mode write-protect pages? Returns zero or */
@@ -518,6 +466,42 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
# define GC_RETURN_ADDR (GC_word)__return_address
#endif
+#ifdef __linux__
+# include <features.h>
+# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+ && !defined(__ia64__)
+# define GC_HAVE_BUILTIN_BACKTRACE
+# define GC_CAN_SAVE_CALL_STACKS
+# endif
+# if defined(__i386__) || defined(__x86_64__)
+# define GC_CAN_SAVE_CALL_STACKS
+# endif
+#endif
+
+#if defined(__sparc__)
+# define GC_CAN_SAVE_CALL_STACKS
+#endif
+
+/* If we're on an a platform on which we can't save call stacks, but */
+/* gcc is normally used, we go ahead and define GC_ADD_CALLER. */
+/* We make this decision independent of whether gcc is actually being */
+/* used, in order to keep the interface consistent, and allow mixing */
+/* of compilers. */
+/* This may also be desirable if it is possible but expensive to */
+/* retrieve the call chain. */
+#if (defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) \
+ || defined(__FreeBSD__)) & !defined(GC_CAN_SAVE_CALL_STACKS)
+# define GC_ADD_CALLER
+# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+ /* gcc knows how to retrieve return address, but we don't know */
+ /* how to generate call stacks. */
+# define GC_RETURN_ADDR (GC_word)__builtin_return_address(0)
+# else
+ /* Just pass 0 for gcc compatibility. */
+# define GC_RETURN_ADDR 0
+# endif
+#endif
+
#ifdef GC_ADD_CALLER
# define GC_EXTRAS GC_RETURN_ADDR, __FILE__, __LINE__
# define GC_EXTRA_PARAMS GC_word ra, GC_CONST char * s, int i
@@ -536,18 +520,42 @@ GC_API GC_PTR GC_debug_malloc_uncollectable
GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS));
GC_API GC_PTR GC_debug_malloc_stubborn
GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS));
+GC_API GC_PTR GC_debug_malloc_ignore_off_page
+ GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS));
+GC_API GC_PTR GC_debug_malloc_atomic_ignore_off_page
+ GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS));
GC_API void GC_debug_free GC_PROTO((GC_PTR object_addr));
GC_API GC_PTR GC_debug_realloc
GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes,
GC_EXTRA_PARAMS));
-
GC_API void GC_debug_change_stubborn GC_PROTO((GC_PTR));
GC_API void GC_debug_end_stubborn_change GC_PROTO((GC_PTR));
+
+/* Routines that allocate objects with debug information (like the */
+/* above), but just fill in dummy file and line number information. */
+/* Thus they can serve as drop-in malloc/realloc replacements. This */
+/* can be useful for two reasons: */
+/* 1) It allows the collector to be built with DBG_HDRS_ALL defined */
+/* even if some allocation calls come from 3rd party libraries */
+/* that can't be recompiled. */
+/* 2) On some platforms, the file and line information is redundant, */
+/* since it can be reconstructed from a stack trace. On such */
+/* platforms it may be more convenient not to recompile, e.g. for */
+/* leak detection. This can be accomplished by instructing the */
+/* linker to replace malloc/realloc with these. */
+GC_API GC_PTR GC_debug_malloc_replacement GC_PROTO((size_t size_in_bytes));
+GC_API GC_PTR GC_debug_realloc_replacement
+ GC_PROTO((GC_PTR object_addr, size_t size_in_bytes));
+
# ifdef GC_DEBUG
# define GC_MALLOC(sz) GC_debug_malloc(sz, GC_EXTRAS)
# define GC_MALLOC_ATOMIC(sz) GC_debug_malloc_atomic(sz, GC_EXTRAS)
-# define GC_MALLOC_UNCOLLECTABLE(sz) GC_debug_malloc_uncollectable(sz, \
- GC_EXTRAS)
+# define GC_MALLOC_UNCOLLECTABLE(sz) \
+ GC_debug_malloc_uncollectable(sz, GC_EXTRAS)
+# define GC_MALLOC_IGNORE_OFF_PAGE(sz) \
+ GC_debug_malloc_ignore_off_page(sz, GC_EXTRAS)
+# define GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(sz) \
+ GC_debug_malloc_atomic_ignore_off_page(sz, GC_EXTRAS)
# define GC_REALLOC(old, sz) GC_debug_realloc(old, sz, GC_EXTRAS)
# define GC_FREE(p) GC_debug_free(p)
# define GC_REGISTER_FINALIZER(p, f, d, of, od) \
@@ -566,6 +574,10 @@ GC_API void GC_debug_end_stubborn_change GC_PROTO((GC_PTR));
# define GC_MALLOC(sz) GC_malloc(sz)
# define GC_MALLOC_ATOMIC(sz) GC_malloc_atomic(sz)
# define GC_MALLOC_UNCOLLECTABLE(sz) GC_malloc_uncollectable(sz)
+# define GC_MALLOC_IGNORE_OFF_PAGE(sz) \
+ GC_malloc_ignore_off_page(sz)
+# define GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(sz) \
+ GC_malloc_atomic_ignore_off_page(sz)
# define GC_REALLOC(old, sz) GC_realloc(old, sz)
# define GC_FREE(p) GC_free(p)
# define GC_REGISTER_FINALIZER(p, f, d, of, od) \
@@ -644,7 +656,8 @@ GC_API void GC_debug_register_finalizer
/* itself. There is a stylistic argument that this is wrong, */
/* but it's unavoidable for C++, since the compiler may */
/* silently introduce these. It's also benign in that specific */
-/* case. */
+/* case. And it helps if finalizable objects are split to */
+/* avoid cycles. */
/* Note that cd will still be viewed as accessible, even if it */
/* refers to the object itself. */
GC_API void GC_register_finalizer_ignore_self
@@ -717,11 +730,6 @@ GC_API int GC_unregister_disappearing_link GC_PROTO((GC_PTR * /* link */));
/* Undoes a registration by either of the above two */
/* routines. */
-/* Auxiliary fns to make finalization work correctly with displaced */
-/* pointers introduced by the debugging allocators. */
-GC_API GC_PTR GC_make_closure GC_PROTO((GC_finalization_proc fn, GC_PTR data));
-GC_API void GC_debug_invoke_finalizer GC_PROTO((GC_PTR obj, GC_PTR data));
-
/* Returns !=0 if GC_invoke_finalizers has something to do. */
GC_API int GC_should_invoke_finalizers GC_PROTO((void));
@@ -738,6 +746,10 @@ GC_API int GC_invoke_finalizers GC_PROTO((void));
typedef void (*GC_warn_proc) GC_PROTO((char *msg, GC_word arg));
GC_API GC_warn_proc GC_set_warn_proc GC_PROTO((GC_warn_proc p));
/* Returns old warning procedure. */
+
+GC_API GC_word GC_set_free_space_divisor GC_PROTO((GC_word value));
+ /* Set free_space_divisor. See above for definition. */
+ /* Returns old value. */
/* The following is intended to be used by a higher level */
/* (e.g. Java-like) finalization facility. It is expected */
@@ -873,14 +885,17 @@ extern void GC_thr_init(); /* Needed for Solaris/X86 */
#endif /* THREADS && !SRC_M3 */
-#if defined(GC_WIN32_THREADS)
+#if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
# include <windows.h>
/*
* All threads must be created using GC_CreateThread, so that they will be
- * recorded in the thread table.
+ * recorded in the thread table. For backwards compatibility, this is not
+ * technically true if the GC is built as a dynamic library, since it can
+ * and does then use DllMain to keep track of thread creations. But new code
+ * should be built to call GC_CreateThread.
*/
- HANDLE WINAPI GC_CreateThread(
+ GC_API HANDLE WINAPI GC_CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId );
@@ -902,7 +917,7 @@ extern void GC_thr_init(); /* Needed for Solaris/X86 */
# endif
# endif /* defined(_WIN32_WCE) */
-#endif /* defined(GC_WIN32_THREADS) */
+#endif /* defined(GC_WIN32_THREADS) && !cygwin */
/*
* If you are planning on putting
@@ -914,13 +929,18 @@ extern void GC_thr_init(); /* Needed for Solaris/X86 */
# define GC_INIT() { extern end, etext; \
GC_noop(&end, &etext); }
#else
-# if (defined(__CYGWIN32__) && defined(GC_USE_DLL)) || defined (_AIX)
+# if defined(__CYGWIN32__) && defined(GC_DLL) || defined (_AIX)
/*
- * Similarly gnu-win32 DLLs need explicit initialization
+ * Similarly gnu-win32 DLLs need explicit initialization from
+ * the main program, as does AIX.
*/
# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); }
# else
+# if defined(__APPLE__) && defined(__MACH__)
+# define GC_INIT() { GC_init(); }
+# else
# define GC_INIT()
+# endif
# endif
#endif
diff --git a/boehm-gc/include/gc_allocator.h b/boehm-gc/include/gc_allocator.h
new file mode 100644
index 00000000000..87c85099381
--- /dev/null
+++ b/boehm-gc/include/gc_allocator.h
@@ -0,0 +1,232 @@
+/*
+ * 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.
+ *
+ * Copyright (c) 2002
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/*
+ * This implements standard-conforming allocators that interact with
+ * the garbage collector. Gc_alloctor<T> allocates garbage-collectable
+ * objects of type T. Traceable_allocator<T> allocates objects that
+ * are not temselves garbage collected, but are scanned by the
+ * collector for pointers to collectable objects. Traceable_alloc
+ * should be used for explicitly managed STL containers that may
+ * point to collectable objects.
+ *
+ * This code was derived from an earlier version of the GNU C++ standard
+ * library, which itself was derived from the SGI STL implementation.
+ */
+
+#include "gc.h" // For size_t
+
+/* First some helpers to allow us to dispatch on whether or not a type
+ * is known to be pointerfree.
+ * These are private, except that the client may invoke the
+ * GC_DECLARE_PTRFREE macro.
+ */
+
+struct GC_true_type {};
+struct GC_false_type {};
+
+template <class GC_tp>
+struct GC_type_traits {
+ GC_false_type GC_is_ptr_free;
+};
+
+# define GC_DECLARE_PTRFREE(T) \
+template<> struct GC_type_traits<T> { GC_true_type GC_is_ptr_free; }
+
+GC_DECLARE_PTRFREE(signed char);
+GC_DECLARE_PTRFREE(unsigned char);
+GC_DECLARE_PTRFREE(signed short);
+GC_DECLARE_PTRFREE(unsigned short);
+GC_DECLARE_PTRFREE(signed int);
+GC_DECLARE_PTRFREE(unsigned int);
+GC_DECLARE_PTRFREE(signed long);
+GC_DECLARE_PTRFREE(unsigned long);
+GC_DECLARE_PTRFREE(float);
+GC_DECLARE_PTRFREE(double);
+/* The client may want to add others. */
+
+// In the following GC_Tp is GC_true_type iff we are allocating a
+// pointerfree object.
+template <class GC_Tp>
+inline void * GC_selective_alloc(size_t n, GC_Tp) {
+ return GC_MALLOC(n);
+}
+
+template <>
+inline void * GC_selective_alloc<GC_true_type>(size_t n, GC_true_type) {
+ return GC_MALLOC_ATOMIC(n);
+}
+
+/* Now the public gc_allocator<T> class:
+ */
+template <class GC_Tp>
+class gc_allocator {
+public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef GC_Tp* pointer;
+ typedef const GC_Tp* const_pointer;
+ typedef GC_Tp& reference;
+ typedef const GC_Tp& const_reference;
+ typedef GC_Tp value_type;
+
+ template <class GC_Tp1> struct rebind {
+ typedef gc_allocator<GC_Tp1> other;
+ };
+
+ gc_allocator() {}
+# ifndef _MSC_VER
+ // I'm not sure why this is needed here in addition to the following.
+ // The standard specifies it for the standard allocator, but VC++ rejects
+ // it. -HB
+ gc_allocator(const gc_allocator&) throw() {}
+# endif
+ template <class GC_Tp1> gc_allocator(const gc_allocator<GC_Tp1>&) throw() {}
+ ~gc_allocator() throw() {}
+
+ pointer address(reference GC_x) const { return &GC_x; }
+ const_pointer address(const_reference GC_x) const { return &GC_x; }
+
+ // GC_n is permitted to be 0. The C++ standard says nothing about what
+ // the return value is when GC_n == 0.
+ GC_Tp* allocate(size_type GC_n, const void* = 0) {
+ GC_type_traits<GC_Tp> traits;
+ return static_cast<GC_Tp *>
+ (GC_selective_alloc(GC_n * sizeof(GC_Tp),
+ traits.GC_is_ptr_free));
+ }
+
+ // __p is not permitted to be a null pointer.
+ void deallocate(pointer __p, size_type GC_n)
+ { GC_FREE(__p); }
+
+ size_type max_size() const throw()
+ { return size_t(-1) / sizeof(GC_Tp); }
+
+ void construct(pointer __p, const GC_Tp& __val) { new(__p) GC_Tp(__val); }
+ void destroy(pointer __p) { __p->~GC_Tp(); }
+};
+
+template<>
+class gc_allocator<void> {
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef void* pointer;
+ typedef const void* const_pointer;
+ typedef void value_type;
+
+ template <class GC_Tp1> struct rebind {
+ typedef gc_allocator<GC_Tp1> other;
+ };
+};
+
+
+template <class GC_T1, class GC_T2>
+inline bool operator==(const gc_allocator<GC_T1>&, const gc_allocator<GC_T2>&)
+{
+ return true;
+}
+
+template <class GC_T1, class GC_T2>
+inline bool operator!=(const gc_allocator<GC_T1>&, const gc_allocator<GC_T2>&)
+{
+ return false;
+}
+
+/*
+ * And the public traceable_allocator class.
+ */
+
+// Note that we currently don't specialize the pointer-free case, since a
+// pointer-free traceable container doesn't make that much sense,
+// though it could become an issue due to abstraction boundaries.
+template <class GC_Tp>
+class traceable_allocator {
+public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef GC_Tp* pointer;
+ typedef const GC_Tp* const_pointer;
+ typedef GC_Tp& reference;
+ typedef const GC_Tp& const_reference;
+ typedef GC_Tp value_type;
+
+ template <class GC_Tp1> struct rebind {
+ typedef traceable_allocator<GC_Tp1> other;
+ };
+
+ traceable_allocator() throw() {}
+# ifndef _MSC_VER
+ traceable_allocator(const traceable_allocator&) throw() {}
+# endif
+ template <class GC_Tp1> traceable_allocator
+ (const traceable_allocator<GC_Tp1>&) throw() {}
+ ~traceable_allocator() throw() {}
+
+ pointer address(reference GC_x) const { return &GC_x; }
+ const_pointer address(const_reference GC_x) const { return &GC_x; }
+
+ // GC_n is permitted to be 0. The C++ standard says nothing about what
+ // the return value is when GC_n == 0.
+ GC_Tp* allocate(size_type GC_n, const void* = 0) {
+ return static_cast<GC_Tp*>(GC_MALLOC_UNCOLLECTABLE(GC_n * sizeof(GC_Tp)));
+ }
+
+ // __p is not permitted to be a null pointer.
+ void deallocate(pointer __p, size_type GC_n)
+ { GC_FREE(__p); }
+
+ size_type max_size() const throw()
+ { return size_t(-1) / sizeof(GC_Tp); }
+
+ void construct(pointer __p, const GC_Tp& __val) { new(__p) GC_Tp(__val); }
+ void destroy(pointer __p) { __p->~GC_Tp(); }
+};
+
+template<>
+class traceable_allocator<void> {
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef void* pointer;
+ typedef const void* const_pointer;
+ typedef void value_type;
+
+ template <class GC_Tp1> struct rebind {
+ typedef traceable_allocator<GC_Tp1> other;
+ };
+};
+
+
+template <class GC_T1, class GC_T2>
+inline bool operator==(const traceable_allocator<GC_T1>&, const traceable_allocator<GC_T2>&)
+{
+ return true;
+}
+
+template <class GC_T1, class GC_T2>
+inline bool operator!=(const traceable_allocator<GC_T1>&, const traceable_allocator<GC_T2>&)
+{
+ return false;
+}
+
diff --git a/boehm-gc/include/gc_config_macros.h b/boehm-gc/include/gc_config_macros.h
new file mode 100644
index 00000000000..0c836d876c8
--- /dev/null
+++ b/boehm-gc/include/gc_config_macros.h
@@ -0,0 +1,147 @@
+/*
+ * This should never be included directly. It is included only from gc.h.
+ * We separate it only to make gc.h more suitable as documentation.
+ *
+ * Some tests for old macros. These violate our namespace rules and will
+ * disappear shortly. Use the GC_ names.
+ */
+#if defined(SOLARIS_THREADS) || defined(_SOLARIS_THREADS)
+# define GC_SOLARIS_THREADS
+#endif
+#if defined(_SOLARIS_PTHREADS)
+# define GC_SOLARIS_PTHREADS
+#endif
+#if defined(IRIX_THREADS)
+# define GC_IRIX_THREADS
+#endif
+#if defined(DGUX_THREADS)
+# if !defined(GC_DGUX386_THREADS)
+# define GC_DGUX386_THREADS
+# endif
+#endif
+#if defined(AIX_THREADS)
+# define GC_AIX_THREADS
+#endif
+#if defined(HPUX_THREADS)
+# define GC_HPUX_THREADS
+#endif
+#if defined(OSF1_THREADS)
+# define GC_OSF1_THREADS
+#endif
+#if defined(LINUX_THREADS)
+# define GC_LINUX_THREADS
+#endif
+#if defined(WIN32_THREADS)
+# define GC_WIN32_THREADS
+#endif
+#if defined(USE_LD_WRAP)
+# define GC_USE_LD_WRAP
+#endif
+
+#if !defined(_REENTRANT) && (defined(GC_SOLARIS_THREADS) \
+ || defined(GC_SOLARIS_PTHREADS) \
+ || defined(GC_HPUX_THREADS) \
+ || defined(GC_AIX_THREADS) \
+ || defined(GC_LINUX_THREADS))
+# define _REENTRANT
+ /* Better late than never. This fails if system headers that */
+ /* depend on this were previously included. */
+#endif
+
+#if defined(GC_DGUX386_THREADS) && !defined(_POSIX4A_DRAFT10_SOURCE)
+# define _POSIX4A_DRAFT10_SOURCE 1
+#endif
+
+# if defined(GC_SOLARIS_PTHREADS) || defined(GC_FREEBSD_THREADS) || \
+ defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
+ defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
+ defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
+ defined(GC_AIX_THREADS) || \
+ (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
+# define GC_PTHREADS
+# endif
+
+#if defined(GC_THREADS) && !defined(GC_PTHREADS)
+# if defined(__linux__)
+# define GC_LINUX_THREADS
+# define GC_PTHREADS
+# endif
+# if !defined(LINUX) && (defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
+ || defined(hppa) || defined(__HPPA))
+# define GC_HPUX_THREADS
+# define GC_PTHREADS
+# endif
+# if !defined(__linux__) && (defined(__alpha) || defined(__alpha__))
+# define GC_OSF1_THREADS
+# define GC_PTHREADS
+# endif
+# if defined(__mips) && !defined(__linux__)
+# define GC_IRIX_THREADS
+# define GC_PTHREADS
+# endif
+# if defined(__sparc) && !defined(__linux__)
+# define GC_SOLARIS_PTHREADS
+# define GC_PTHREADS
+# endif
+# if defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
+# define GC_DARWIN_THREADS
+# define GC_PTHREADS
+# endif
+# if !defined(GC_PTHREADS) && defined(__FreeBSD__)
+# define GC_FREEBSD_THREADS
+# define GC_PTHREADS
+# endif
+# if defined(DGUX) && (defined(i386) || defined(__i386__))
+# define GC_DGUX386_THREADS
+# define GC_PTHREADS
+# endif
+#endif /* GC_THREADS */
+
+#if defined(GC_THREADS) && !defined(GC_PTHREADS) && defined(MSWIN32)
+# define GC_WIN32_THREADS
+#endif
+
+#if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)
+# define GC_SOLARIS_THREADS
+#endif
+
+# define __GC
+# include <stddef.h>
+# ifdef _WIN32_WCE
+/* Yet more kluges for WinCE */
+# include <stdlib.h> /* size_t is defined here */
+ typedef long ptrdiff_t; /* ptrdiff_t is not defined */
+# endif
+
+#if defined(_DLL) && !defined(GC_NOT_DLL) && !defined(GC_DLL)
+# define GC_DLL
+#endif
+
+#if defined(__MINGW32__) && defined(GC_DLL)
+# ifdef GC_BUILD
+# define GC_API __declspec(dllexport)
+# else
+# define GC_API __declspec(dllimport)
+# endif
+#endif
+
+#if (defined(__DMC__) || defined(_MSC_VER)) && defined(GC_DLL)
+# ifdef GC_BUILD
+# define GC_API extern __declspec(dllexport)
+# else
+# define GC_API __declspec(dllimport)
+# endif
+#endif
+
+#if defined(__WATCOMC__) && defined(GC_DLL)
+# ifdef GC_BUILD
+# define GC_API extern __declspec(dllexport)
+# else
+# define GC_API extern __declspec(dllimport)
+# endif
+#endif
+
+#ifndef GC_API
+#define GC_API extern
+#endif
+
diff --git a/boehm-gc/include/gc_cpp.h b/boehm-gc/include/gc_cpp.h
index ceb73f50a65..d789a3731e3 100644
--- a/boehm-gc/include/gc_cpp.h
+++ b/boehm-gc/include/gc_cpp.h
@@ -134,7 +134,9 @@ by UseGC. GC is an alias for UseGC, unless GC_NAME_CONFLICT is defined.
#include "gc.h"
#ifndef THINK_CPLUS
-#define _cdecl
+# define GC_cdecl
+#else
+# define GC_cdecl _cdecl
#endif
#if ! defined( GC_NO_OPERATOR_NEW_ARRAY ) \
@@ -159,12 +161,22 @@ enum GCPlacement {UseGC,
class gc {public:
inline void* operator new( size_t size );
inline void* operator new( size_t size, GCPlacement gcp );
+ inline void* operator new( size_t size, void *p );
+ /* Must be redefined here, since the other overloadings */
+ /* hide the global definition. */
inline void operator delete( void* obj );
+# ifndef __BORLANDC__ /* Confuses the Borland compiler. */
+ inline void operator delete( void*, void* );
+# endif
#ifdef GC_OPERATOR_NEW_ARRAY
inline void* operator new[]( size_t size );
inline void* operator new[]( size_t size, GCPlacement gcp );
+ inline void* operator new[]( size_t size, void *p );
inline void operator delete[]( void* obj );
+# ifndef __BORLANDC__
+ inline void gc::operator delete[]( void*, void* );
+# endif
#endif /* GC_OPERATOR_NEW_ARRAY */
};
/*
@@ -176,7 +188,7 @@ class gc_cleanup: virtual public gc {public:
inline gc_cleanup();
inline virtual ~gc_cleanup();
private:
- inline static void _cdecl cleanup( void* obj, void* clientData );};
+ inline static void GC_cdecl cleanup( void* obj, void* clientData );};
/*
Instances of classes derived from "gc_cleanup" will be allocated
in the collected heap by default. When the collector discovers an
@@ -211,7 +223,6 @@ inline void* operator new(
classes derived from "gc_cleanup" or containing members derived
from "gc_cleanup". */
-#ifdef GC_OPERATOR_NEW_ARRAY
#ifdef _MSC_VER
/** This ensures that the system default operator new[] doesn't get
@@ -220,42 +231,24 @@ inline void* operator new(
* There seems to be really redirect new in this environment without
* including this everywhere.
*/
- inline void *operator new[]( size_t size )
- {
- return GC_MALLOC_UNCOLLECTABLE( size );
- }
-
- inline void operator delete[](void* obj)
- {
- GC_FREE(obj);
- };
-
- inline void* operator new( size_t size)
- {
- return GC_MALLOC_UNCOLLECTABLE( size);
- };
+ void *operator new[]( size_t size );
+
+ void operator delete[](void* obj);
- inline void operator delete(void* obj)
- {
- GC_FREE(obj);
- };
+ void* operator new( size_t size);
+ void operator delete(void* obj);
-// This new operator is used by VC++ in case of Debug builds !
- inline void* operator new( size_t size,
+ // This new operator is used by VC++ in case of Debug builds !
+ void* operator new( size_t size,
int ,//nBlockUse,
const char * szFileName,
- int nLine
- ) {
-# ifndef GC_DEBUG
- return GC_malloc_uncollectable( size );
-# else
- return GC_debug_malloc_uncollectable(size, szFileName, nLine);
-# endif
- }
-
+ int nLine );
#endif /* _MSC_VER */
+
+#ifdef GC_OPERATOR_NEW_ARRAY
+
inline void* operator new[](
size_t size,
GCPlacement gcp,
@@ -283,9 +276,15 @@ inline void* gc::operator new( size_t size, GCPlacement gcp ) {
else
return GC_MALLOC_UNCOLLECTABLE( size );}
+inline void* gc::operator new( size_t size, void *p ) {
+ return p;}
+
inline void gc::operator delete( void* obj ) {
GC_FREE( obj );}
+#ifndef __BORLANDC__
+ inline void gc::operator delete( void*, void* ) {}
+#endif
#ifdef GC_OPERATOR_NEW_ARRAY
@@ -295,14 +294,21 @@ inline void* gc::operator new[]( size_t size ) {
inline void* gc::operator new[]( size_t size, GCPlacement gcp ) {
return gc::operator new( size, gcp );}
+inline void* gc::operator new[]( size_t size, void *p ) {
+ return p;}
+
inline void gc::operator delete[]( void* obj ) {
gc::operator delete( obj );}
+
+#ifndef __BORLANDC__
+ inline void gc::operator delete[]( void*, void* ) {}
+#endif
#endif /* GC_OPERATOR_NEW_ARRAY */
inline gc_cleanup::~gc_cleanup() {
- GC_REGISTER_FINALIZER_IGNORE_SELF( GC_base(this), 0, 0, 0, 0 );}
+ GC_register_finalizer_ignore_self( GC_base(this), 0, 0, 0, 0 );}
inline void gc_cleanup::cleanup( void* obj, void* displ ) {
((gc_cleanup*) ((char*) obj + (ptrdiff_t) displ))->~gc_cleanup();}
diff --git a/boehm-gc/include/gc_local_alloc.h b/boehm-gc/include/gc_local_alloc.h
index 1e58730cfe8..88e29e9a11f 100644
--- a/boehm-gc/include/gc_local_alloc.h
+++ b/boehm-gc/include/gc_local_alloc.h
@@ -33,6 +33,9 @@
* -DTHREAD_LOCAL_ALLOC, which is currently supported only on Linux.
*
* The debugging allocators use standard, not thread-local allocation.
+ *
+ * These routines normally require an explicit call to GC_init(), though
+ * that may be done from a constructor function.
*/
#ifndef GC_LOCAL_ALLOC_H
diff --git a/boehm-gc/include/gc_mark.h b/boehm-gc/include/gc_mark.h
index 0856d16fdae..9ddba2ca527 100644
--- a/boehm-gc/include/gc_mark.h
+++ b/boehm-gc/include/gc_mark.h
@@ -129,7 +129,9 @@ extern GC_PTR GC_greatest_plausible_heap_addr;
/* be reserved for exceptional cases. That will ensure that */
/* performance of this call is not extremely performance critical. */
/* (Otherwise we would need to inline GC_mark_and_push completely, */
-/* which would tie the client code to a fixed colllector version.) */
+/* which would tie the client code to a fixed collector version.) */
+/* Note that mark procedures should explicitly call FIXUP_POINTER() */
+/* if required. */
struct GC_ms_entry *GC_mark_and_push
GC_PROTO((GC_PTR obj,
struct GC_ms_entry * mark_stack_ptr,
diff --git a/boehm-gc/include/gc_pthread_redirects.h b/boehm-gc/include/gc_pthread_redirects.h
index 47284fbc97a..842518cfcc4 100644
--- a/boehm-gc/include/gc_pthread_redirects.h
+++ b/boehm-gc/include/gc_pthread_redirects.h
@@ -52,15 +52,30 @@
int GC_pthread_create(pthread_t *new_thread,
const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg);
+#ifndef GC_DARWIN_THREADS
int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
+#endif
int GC_pthread_join(pthread_t thread, void **retval);
int GC_pthread_detach(pthread_t thread);
+#if defined(GC_OSF1_THREADS) \
+ && defined(_PTHREAD_USE_MANGLED_NAMES_) && !defined(_PTHREAD_USE_PTDNAM_)
+/* Unless the compiler supports #pragma extern_prefix, the Tru64 UNIX
+ <pthread.h> redefines some POSIX thread functions to use mangled names.
+ If so, undef them before redefining. */
+# undef pthread_create
+# undef pthread_join
+# undef pthread_detach
+#endif
+
# define pthread_create GC_pthread_create
-# define pthread_sigmask GC_pthread_sigmask
# define pthread_join GC_pthread_join
# define pthread_detach GC_pthread_detach
+
+#ifndef GC_DARWIN_THREADS
+# define pthread_sigmask GC_pthread_sigmask
# define dlopen GC_dlopen
+#endif
#endif /* GC_xxxxx_THREADS */
diff --git a/boehm-gc/include/gc_typed.h b/boehm-gc/include/gc_typed.h
index 2e0598f204c..905734b8da0 100644
--- a/boehm-gc/include/gc_typed.h
+++ b/boehm-gc/include/gc_typed.h
@@ -29,14 +29,21 @@
# include "gc.h"
# endif
+#ifdef __cplusplus
+ extern "C" {
+#endif
typedef GC_word * GC_bitmap;
/* The least significant bit of the first word is one if */
/* the first word in the object may be a pointer. */
+# define GC_WORDSZ (8*sizeof(GC_word))
# define GC_get_bit(bm, index) \
- (((bm)[divWORDSZ(index)] >> modWORDSZ(index)) & 1)
+ (((bm)[index/GC_WORDSZ] >> (index%GC_WORDSZ)) & 1)
# define GC_set_bit(bm, index) \
- (bm)[divWORDSZ(index)] |= (word)1 << modWORDSZ(index)
+ (bm)[index/GC_WORDSZ] |= ((GC_word)1 << (index%GC_WORDSZ))
+# define GC_WORD_OFFSET(t, f) (offsetof(t,f)/sizeof(GC_word))
+# define GC_WORD_LEN(t) (sizeof(t)/ sizeof(GC_word))
+# define GC_BITMAP_SIZE(t) ((GC_WORD_LEN(t) + GC_WORDSZ-1)/GC_WORDSZ)
typedef GC_word GC_descr;
@@ -57,6 +64,16 @@ GC_API GC_descr GC_make_descriptor GC_PROTO((GC_bitmap bm, size_t len));
/* is intended to be called once per type, not once */
/* per allocation. */
+/* It is possible to generate a descriptor for a C type T with */
+/* word aligned pointer fields f1, f2, ... as follows: */
+/* */
+/* GC_descr T_descr; */
+/* GC_word T_bitmap[GC_BITMAP_SIZE(T)] = {0}; */
+/* GC_set_bit(T_bitmap, GC_WORD_OFFSET(T,f1)); */
+/* GC_set_bit(T_bitmap, GC_WORD_OFFSET(T,f2)); */
+/* ... */
+/* T_descr = GC_make_descriptor(T_bitmap, GC_WORD_LEN(T)); */
+
GC_API GC_PTR GC_malloc_explicitly_typed
GC_PROTO((size_t size_in_bytes, GC_descr d));
/* Allocate an object whose layout is described by d. */
@@ -79,15 +96,18 @@ GC_API GC_PTR GC_calloc_explicitly_typed
/* Returned object is cleared. */
#ifdef GC_DEBUG
-# define GC_MALLOC_EXPLICTLY_TYPED(bytes, d) GC_MALLOC(bytes)
-# define GC_CALLOC_EXPLICTLY_TYPED(n, bytes, d) GC_MALLOC(n*bytes)
+# define GC_MALLOC_EXPLICITLY_TYPED(bytes, d) GC_MALLOC(bytes)
+# define GC_CALLOC_EXPLICITLY_TYPED(n, bytes, d) GC_MALLOC(n*bytes)
#else
-# define GC_MALLOC_EXPLICTLY_TYPED(bytes, d) \
+# define GC_MALLOC_EXPLICITLY_TYPED(bytes, d) \
GC_malloc_explicitly_typed(bytes, d)
-# define GC_CALLOC_EXPLICTLY_TYPED(n, bytes, d) \
+# define GC_CALLOC_EXPLICITLY_TYPED(n, bytes, d) \
GC_calloc_explicitly_typed(n, bytes, d)
#endif /* !GC_DEBUG */
+#ifdef __cplusplus
+ } /* matches extern "C" */
+#endif
#endif /* _GC_TYPED_H */
diff --git a/boehm-gc/include/new_gc_alloc.h b/boehm-gc/include/new_gc_alloc.h
index aad9446543e..20a2fabf83c 100644
--- a/boehm-gc/include/new_gc_alloc.h
+++ b/boehm-gc/include/new_gc_alloc.h
@@ -64,6 +64,14 @@
#endif
#endif
+/* A hack to deal with gcc 3.1. If you are using gcc3.1 and later, */
+/* you should probably really use gc_allocator.h instead. */
+#if defined (__GNUC__) && \
+ (__GNUC > 3 || (__GNUC__ == 3 && (__GNUC_MINOR__ >= 1)))
+# define simple_alloc __simple_alloc
+#endif
+
+
#define GC_ALLOC_H
diff --git a/boehm-gc/include/private/darwin_semaphore.h b/boehm-gc/include/private/darwin_semaphore.h
new file mode 100644
index 00000000000..0f43982d5c1
--- /dev/null
+++ b/boehm-gc/include/private/darwin_semaphore.h
@@ -0,0 +1,68 @@
+#ifndef GC_DARWIN_SEMAPHORE_H
+#define GC_DARWIN_SEMAPHORE_H
+
+#if !defined(GC_DARWIN_THREADS)
+#error darwin_semaphore.h included with GC_DARWIN_THREADS not defined
+#endif
+
+/*
+ This is a very simple semaphore implementation for darwin. It
+ is implemented in terms of pthreads calls so it isn't async signal
+ safe. This isn't a problem because signals aren't used to
+ suspend threads on darwin.
+*/
+
+typedef struct {
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ int value;
+} sem_t;
+
+static int sem_init(sem_t *sem, int pshared, int value) {
+ int ret;
+ if(pshared)
+ GC_abort("sem_init with pshared set");
+ sem->value = value;
+
+ ret = pthread_mutex_init(&sem->mutex,NULL);
+ if(ret < 0) return -1;
+ ret = pthread_cond_init(&sem->cond,NULL);
+ if(ret < 0) return -1;
+ return 0;
+}
+
+static int sem_post(sem_t *sem) {
+ if(pthread_mutex_lock(&sem->mutex) < 0)
+ return -1;
+ sem->value++;
+ if(pthread_cond_signal(&sem->cond) < 0) {
+ pthread_mutex_unlock(&sem->mutex);
+ return -1;
+ }
+ if(pthread_mutex_unlock(&sem->mutex) < 0)
+ return -1;
+ return 0;
+}
+
+static int sem_wait(sem_t *sem) {
+ if(pthread_mutex_lock(&sem->mutex) < 0)
+ return -1;
+ while(sem->value == 0) {
+ pthread_cond_wait(&sem->cond,&sem->mutex);
+ }
+ sem->value--;
+ if(pthread_mutex_unlock(&sem->mutex) < 0)
+ return -1;
+ return 0;
+}
+
+static int sem_destroy(sem_t *sem) {
+ int ret;
+ ret = pthread_cond_destroy(&sem->cond);
+ if(ret < 0) return -1;
+ ret = pthread_mutex_destroy(&sem->mutex);
+ if(ret < 0) return -1;
+ return 0;
+}
+
+#endif
diff --git a/boehm-gc/include/private/darwin_stop_world.h b/boehm-gc/include/private/darwin_stop_world.h
new file mode 100644
index 00000000000..9924297ec77
--- /dev/null
+++ b/boehm-gc/include/private/darwin_stop_world.h
@@ -0,0 +1,15 @@
+#ifndef GC_DARWIN_STOP_WORLD_H
+#define GC_DARWIN_STOP_WORLD_H
+
+#if !defined(GC_DARWIN_THREADS)
+#error darwin_stop_world.h included without GC_DARWIN_THREADS defined
+#endif
+
+#include <mach/mach.h>
+#include <mach/thread_act.h>
+
+struct thread_stop_info {
+ mach_port_t mach_thread;
+};
+
+#endif
diff --git a/boehm-gc/include/private/dbg_mlc.h b/boehm-gc/include/private/dbg_mlc.h
index 5378835811c..e2003e6c44f 100644
--- a/boehm-gc/include/private/dbg_mlc.h
+++ b/boehm-gc/include/private/dbg_mlc.h
@@ -115,16 +115,24 @@ typedef struct {
#ifdef SHORT_DBG_HDRS
# define DEBUG_BYTES (sizeof (oh))
+# define UNCOLLECTABLE_DEBUG_BYTES DEBUG_BYTES
#else
/* Add space for END_FLAG, but use any extra space that was already */
/* added to catch off-the-end pointers. */
-# define DEBUG_BYTES (sizeof (oh) + sizeof (word) - EXTRA_BYTES)
+ /* For uncollectable objects, the extra byte is not added. */
+# define UNCOLLECTABLE_DEBUG_BYTES (sizeof (oh) + sizeof (word))
+# define DEBUG_BYTES (UNCOLLECTABLE_DEBUG_BYTES - EXTRA_BYTES)
#endif
#define USR_PTR_FROM_BASE(p) ((ptr_t)(p) + sizeof(oh))
/* Round bytes to words without adding extra byte at end. */
#define SIMPLE_ROUNDED_UP_WORDS(n) BYTES_TO_WORDS((n) + WORDS_TO_BYTES(1) - 1)
+/* ADD_CALL_CHAIN stores a (partial) call chain into an object */
+/* header. It may be called with or without the allocation */
+/* lock. */
+/* PRINT_CALL_CHAIN prints the call chain stored in an object */
+/* to stderr. It requires that we do not hold the lock. */
#ifdef SAVE_CALL_CHAIN
# define ADD_CALL_CHAIN(base, ra) GC_save_callers(((oh *)(base)) -> oh_ci)
# define PRINT_CALL_CHAIN(base) GC_print_callers(((oh *)(base)) -> oh_ci)
diff --git a/boehm-gc/include/private/gc_hdrs.h b/boehm-gc/include/private/gc_hdrs.h
index dd615455f3b..96749ab1bf0 100644
--- a/boehm-gc/include/private/gc_hdrs.h
+++ b/boehm-gc/include/private/gc_hdrs.h
@@ -70,7 +70,7 @@ extern hdr * GC_invalid_header; /* header for an imaginary block */
#define ADVANCE(p, hhdr, source) \
{ \
hdr * new_hdr = GC_invalid_header; \
- p = GC_FIND_START(p, hhdr, &new_hdr, (word)source); \
+ p = GC_find_start(p, hhdr, &new_hdr); \
hhdr = new_hdr; \
}
diff --git a/boehm-gc/include/private/gc_locks.h b/boehm-gc/include/private/gc_locks.h
index 9b91ada917a..775176b3151 100644
--- a/boehm-gc/include/private/gc_locks.h
+++ b/boehm-gc/include/private/gc_locks.h
@@ -141,23 +141,24 @@
# if defined(POWERPC)
inline static int GC_test_and_set(volatile unsigned int *addr) {
int oldval;
- int temp = 1; // locked value
+ int temp = 1; /* locked value */
__asm__ __volatile__(
- "1:\tlwarx %0,0,%3\n" // load and reserve
- "\tcmpwi %0, 0\n" // if load is
- "\tbne 2f\n" // non-zero, return already set
- "\tstwcx. %2,0,%1\n" // else store conditional
- "\tbne- 1b\n" // retry if lost reservation
- "2:\t\n" // oldval is zero if we set
+ "1:\tlwarx %0,0,%3\n" /* load and reserve */
+ "\tcmpwi %0, 0\n" /* if load is */
+ "\tbne 2f\n" /* non-zero, return already set */
+ "\tstwcx. %2,0,%1\n" /* else store conditional */
+ "\tbne- 1b\n" /* retry if lost reservation */
+ "\tsync\n" /* import barrier */
+ "2:\t\n" /* oldval is zero if we set */
: "=&r"(oldval), "=p"(addr)
: "r"(temp), "1"(addr)
- : "memory");
- return (int)oldval;
+ : "cr0","memory");
+ return oldval;
}
# define GC_TEST_AND_SET_DEFINED
inline static void GC_clear(volatile unsigned int *addr) {
- __asm__ __volatile__("eieio" ::: "memory");
+ __asm__ __volatile__("eieio" : : : "memory");
*(addr) = 0;
}
# define GC_CLEAR_DEFINED
@@ -174,12 +175,18 @@
" bne %2,2f\n"
" xor %0,%3,%0\n"
" stl_c %0,%1\n"
+# ifdef __ELF__
" beq %0,3f\n"
+# else
+ " beq %0,1b\n"
+# endif
" mb\n"
"2:\n"
+# ifdef __ELF__
".section .text2,\"ax\"\n"
"3: br 1b\n"
".previous"
+# endif
:"=&r" (temp), "=m" (*addr), "=&r" (oldvalue)
:"Ir" (1), "m" (*addr)
:"memory");
@@ -187,8 +194,11 @@
return oldvalue;
}
# define GC_TEST_AND_SET_DEFINED
- /* Should probably also define GC_clear, since it needs */
- /* a memory barrier ?? */
+ inline static void GC_clear(volatile unsigned int *addr) {
+ __asm__ __volatile__("mb" : : : "memory");
+ *(addr) = 0;
+ }
+# define GC_CLEAR_DEFINED
# endif /* ALPHA */
# ifdef ARM32
inline static int GC_test_and_set(volatile unsigned int *addr) {
@@ -206,22 +216,30 @@
# define GC_TEST_AND_SET_DEFINED
# endif /* ARM32 */
# ifdef S390
- inline static int GC_test_and_set(volatile unsigned int *addr) {
- int ret;
- __asm__ __volatile__ (
- " l %0,0(%2)\n"
- "0: cs %0,%1,0(%2)\n"
- " jl 0b"
- : "=&d" (ret)
- : "d" (1), "a" (addr)
- : "cc", "memory");
- return ret;
- }
+ inline static int GC_test_and_set(volatile unsigned int *addr) {
+ int ret;
+ __asm__ __volatile__ (
+ " l %0,0(%2)\n"
+ "0: cs %0,%1,0(%2)\n"
+ " jl 0b"
+ : "=&d" (ret)
+ : "d" (1), "a" (addr)
+ : "cc", "memory");
+ return ret;
+ }
# endif
# endif /* __GNUC__ */
# if (defined(ALPHA) && !defined(__GNUC__))
-# define GC_test_and_set(addr) __cxx_test_and_set_atomic(addr, 1)
+# ifndef OSF1
+ --> We currently assume that if gcc is not used, we are
+ --> running under Tru64.
+# endif
+# include <machine/builtins.h>
+# include <c_asm.h>
+# define GC_test_and_set(addr) __ATOMIC_EXCH_LONG(addr, 1)
# define GC_TEST_AND_SET_DEFINED
+# define GC_clear(addr) { asm("mb"); *(volatile unsigned *)addr = 0; }
+# define GC_CLEAR_DEFINED
# endif
# if defined(MSWIN32)
# define GC_test_and_set(addr) InterlockedExchange((LPLONG)addr,1)
@@ -234,14 +252,51 @@
# define GC_TEST_AND_SET_DEFINED
# elif __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) \
|| !defined(_COMPILER_VERSION) || _COMPILER_VERSION < 700
-# define GC_test_and_set(addr) test_and_set(addr, 1)
+# ifdef __GNUC__
+# define GC_test_and_set(addr) _test_and_set((void *)addr,1)
+# else
+# define GC_test_and_set(addr) test_and_set((void *)addr,1)
+# endif
# else
-# define GC_test_and_set(addr) __test_and_set(addr,1)
+# define GC_test_and_set(addr) __test_and_set32((void *)addr,1)
# define GC_clear(addr) __lock_release(addr);
# define GC_CLEAR_DEFINED
# endif
# define GC_TEST_AND_SET_DEFINED
# endif /* MIPS */
+# if defined(_AIX)
+# include <sys/atomic_op.h>
+# if (defined(_POWER) || defined(_POWERPC))
+# if defined(__GNUC__)
+ inline static void GC_memsync() {
+ __asm__ __volatile__ ("sync" : : : "memory");
+ }
+# else
+# ifndef inline
+# define inline __inline
+# endif
+# pragma mc_func GC_memsync { \
+ "7c0004ac" /* sync (same opcode used for dcs)*/ \
+ }
+# endif
+# else
+# error dont know how to memsync
+# endif
+ inline static int GC_test_and_set(volatile unsigned int * addr) {
+ int oldvalue = 0;
+ if (compare_and_swap((void *)addr, &oldvalue, 1)) {
+ GC_memsync();
+ return 0;
+ } else return 1;
+ }
+# define GC_TEST_AND_SET_DEFINED
+ inline static void GC_clear(volatile unsigned int *addr) {
+ GC_memsync();
+ *(addr) = 0;
+ }
+# define GC_CLEAR_DEFINED
+
+# endif
# if 0 /* defined(HP_PA) */
/* The official recommendation seems to be to not use ldcw from */
/* user mode. Since multithreaded incremental collection doesn't */
@@ -275,7 +330,7 @@
# endif
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
- && !defined(GC_IRIX_THREADS)
+ && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS)
# define NO_THREAD (pthread_t)(-1)
# include <pthread.h>
# if defined(PARALLEL_MARK)
@@ -306,12 +361,12 @@
{
char result;
__asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1"
- : "=m"(*(addr)), "=r"(result)
- : "r" (new_val), "0"(*(addr)), "a"(old) : "memory");
+ : "+m"(*(addr)), "=r"(result)
+ : "r" (new_val), "a"(old) : "memory");
return (GC_bool) result;
}
# endif /* !GENERIC_COMPARE_AND_SWAP */
- inline static void GC_memory_write_barrier()
+ inline static void GC_memory_barrier()
{
/* We believe the processor ensures at least processor */
/* consistent ordering. Thus a compiler barrier */
@@ -319,6 +374,37 @@
__asm__ __volatile__("" : : : "memory");
}
# endif /* I386 */
+
+# if defined(POWERPC)
+# if !defined(GENERIC_COMPARE_AND_SWAP)
+ /* Returns TRUE if the comparison succeeded. */
+ inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
+ GC_word old, GC_word new_val)
+ {
+ int result, dummy;
+ __asm__ __volatile__(
+ "1:\tlwarx %0,0,%5\n"
+ "\tcmpw %0,%4\n"
+ "\tbne 2f\n"
+ "\tstwcx. %3,0,%2\n"
+ "\tbne- 1b\n"
+ "\tsync\n"
+ "\tli %1, 1\n"
+ "\tb 3f\n"
+ "2:\tli %1, 0\n"
+ "3:\t\n"
+ : "=&r" (dummy), "=r" (result), "=p" (addr)
+ : "r" (new_val), "r" (old), "2"(addr)
+ : "cr0","memory");
+ return (GC_bool) result;
+ }
+# endif /* !GENERIC_COMPARE_AND_SWAP */
+ inline static void GC_memory_barrier()
+ {
+ __asm__ __volatile__("sync" : : : "memory");
+ }
+# endif /* POWERPC */
+
# if defined(IA64)
# if !defined(GENERIC_COMPARE_AND_SWAP)
inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
@@ -330,31 +416,71 @@
# endif /* !GENERIC_COMPARE_AND_SWAP */
# if 0
/* Shouldn't be needed; we use volatile stores instead. */
- inline static void GC_memory_write_barrier()
+ inline static void GC_memory_barrier()
{
__sync_synchronize ();
}
# endif /* 0 */
# endif /* IA64 */
+# if defined(ALPHA)
+# if !defined(GENERIC_COMPARE_AND_SWAP)
+# if defined(__GNUC__)
+ inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
+ GC_word old, GC_word new_val)
+ {
+ unsigned long was_equal;
+ unsigned long temp;
+
+ __asm__ __volatile__(
+ "1: ldq_l %0,%1\n"
+ " cmpeq %0,%4,%2\n"
+ " mov %3,%0\n"
+ " beq %2,2f\n"
+ " stq_c %0,%1\n"
+ " beq %0,1b\n"
+ "2:\n"
+ " mb\n"
+ :"=&r" (temp), "=m" (*addr), "=&r" (was_equal)
+ : "r" (new_val), "Ir" (old)
+ :"memory");
+ return was_equal;
+ }
+# else /* !__GNUC__ */
+ inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
+ GC_word old, GC_word new_val)
+ {
+ return __CMP_STORE_QUAD(addr, old, new_val, addr);
+ }
+# endif /* !__GNUC__ */
+# endif /* !GENERIC_COMPARE_AND_SWAP */
+# ifdef __GNUC__
+ inline static void GC_memory_barrier()
+ {
+ __asm__ __volatile__("mb" : : : "memory");
+ }
+# else
+# define GC_memory_barrier() asm("mb")
+# endif /* !__GNUC__ */
+# endif /* ALPHA */
# if defined(S390)
# if !defined(GENERIC_COMPARE_AND_SWAP)
- inline static GC_bool GC_compare_and_exchange(volatile C_word *addr,
- GC_word old, GC_word new_val)
- {
- int retval;
- __asm__ __volatile__ (
-# ifndef __s390x__
- " cs %1,%2,0(%3)\n"
-# else
- " csg %1,%2,0(%3)\n"
-# endif
- " ipm %0\n"
- " srl %0,28\n"
- : "=&d" (retval), "+d" (old)
- : "d" (new_val), "a" (addr)
- : "cc", "memory");
- return retval == 0;
- }
+ inline static GC_bool GC_compare_and_exchange(volatile C_word *addr,
+ GC_word old, GC_word new_val)
+ {
+ int retval;
+ __asm__ __volatile__ (
+# ifndef __s390x__
+ " cs %1,%2,0(%3)\n"
+# else
+ " csg %1,%2,0(%3)\n"
+# endif
+ " ipm %0\n"
+ " srl %0,28\n"
+ : "=&d" (retval), "+d" (old)
+ : "d" (new_val), "a" (addr)
+ : "cc", "memory");
+ return retval == 0;
+ }
# endif
# endif
# if !defined(GENERIC_COMPARE_AND_SWAP)
@@ -427,8 +553,12 @@
{ GC_ASSERT(I_HOLD_LOCK()); UNSET_LOCK_HOLDER(); \
pthread_mutex_unlock(&GC_allocate_ml); }
# else /* !GC_ASSERTIONS */
+# if defined(NO_PTHREAD_TRYLOCK)
+# define LOCK() GC_lock();
+# else /* !defined(NO_PTHREAD_TRYLOCK) */
# define LOCK() \
{ if (0 != pthread_mutex_trylock(&GC_allocate_ml)) GC_lock(); }
+# endif
# define UNLOCK() pthread_mutex_unlock(&GC_allocate_ml)
# endif /* !GC_ASSERTIONS */
# endif /* USE_PTHREAD_LOCKS */
@@ -450,7 +580,7 @@
/* on Irix anymore. */
# include <mutex.h>
- extern unsigned long GC_allocate_lock;
+ extern volatile unsigned int GC_allocate_lock;
/* This is not a mutex because mutexes that obey the (optional) */
/* POSIX scheduling rules are subject to convoys in high contention */
/* applications. This is basically a spin lock. */
@@ -471,11 +601,18 @@
}
# define EXIT_GC() GC_collecting = 0;
# endif /* GC_IRIX_THREADS */
-# ifdef GC_WIN32_THREADS
-# include <windows.h>
- GC_API CRITICAL_SECTION GC_allocate_ml;
-# define LOCK() EnterCriticalSection(&GC_allocate_ml);
-# define UNLOCK() LeaveCriticalSection(&GC_allocate_ml);
+# if defined(GC_WIN32_THREADS)
+# if defined(GC_PTHREADS)
+# include <pthread.h>
+ extern pthread_mutex_t GC_allocate_ml;
+# define LOCK() pthread_mutex_lock(&GC_allocate_ml)
+# define UNLOCK() pthread_mutex_unlock(&GC_allocate_ml)
+# else
+# include <windows.h>
+ GC_API CRITICAL_SECTION GC_allocate_ml;
+# define LOCK() EnterCriticalSection(&GC_allocate_ml);
+# define UNLOCK() LeaveCriticalSection(&GC_allocate_ml);
+# endif
# endif
# ifndef SET_LOCK_HOLDER
# define SET_LOCK_HOLDER()
diff --git a/boehm-gc/include/private/gc_pmark.h b/boehm-gc/include/private/gc_pmark.h
index 872065702f0..c109738203a 100644
--- a/boehm-gc/include/private/gc_pmark.h
+++ b/boehm-gc/include/private/gc_pmark.h
@@ -137,7 +137,7 @@ extern mse * GC_mark_stack;
#ifdef __STDC__
# ifdef PRINT_BLACK_LIST
ptr_t GC_find_start(ptr_t current, hdr *hhdr, hdr **new_hdr_p,
- ptr_t source);
+ word source);
# else
ptr_t GC_find_start(ptr_t current, hdr *hhdr, hdr **new_hdr_p);
# endif
@@ -145,7 +145,7 @@ extern mse * GC_mark_stack;
ptr_t GC_find_start();
#endif
-mse *GC_signal_mark_stack_overflow(mse *msp);
+mse * GC_signal_mark_stack_overflow GC_PROTO((mse *msp));
# ifdef GATHERSTATS
# define ADD_TO_ATOMIC(sz) GC_atomic_in_use += (sz)
@@ -174,14 +174,6 @@ mse *GC_signal_mark_stack_overflow(mse *msp);
} \
}
-#ifdef PRINT_BLACK_LIST
-# define GC_FIND_START(current, hhdr, new_hdr_p, source) \
- GC_find_start(current, hhdr, new_hdr_p, source)
-#else
-# define GC_FIND_START(current, hhdr, new_hdr_p, source) \
- GC_find_start(current, hhdr, new_hdr_p)
-#endif
-
/* Push the contents of current onto the mark stack if it is a valid */
/* ptr to a currently unmarked object. Mark it. */
/* If we assumed a standard-conforming compiler, we could probably */
@@ -195,8 +187,7 @@ mse *GC_signal_mark_stack_overflow(mse *msp);
GET_HDR(my_current, my_hhdr); \
if (IS_FORWARDING_ADDR_OR_NIL(my_hhdr)) { \
hdr * new_hdr = GC_invalid_header; \
- my_current = GC_FIND_START(my_current, my_hhdr, \
- &new_hdr, (word)source); \
+ my_current = GC_find_start(my_current, my_hhdr, &new_hdr); \
my_hhdr = new_hdr; \
} \
PUSH_CONTENTS_HDR(my_current, mark_stack_top, mark_stack_limit, \
@@ -290,21 +281,39 @@ exit_label: ; \
/*
* Push a single value onto mark stack. Mark from the object pointed to by p.
+ * Invoke FIXUP_POINTER(p) before any further processing.
* P is considered valid even if it is an interior pointer.
* Previously marked objects are not pushed. Hence we make progress even
* if the mark stack overflows.
*/
-# define GC_PUSH_ONE_STACK(p, source) \
- if ((ptr_t)(p) >= (ptr_t)GC_least_plausible_heap_addr \
+
+# if NEED_FIXUP_POINTER
+ /* Try both the raw version and the fixed up one. */
+# define GC_PUSH_ONE_STACK(p, source) \
+ if ((ptr_t)(p) >= (ptr_t)GC_least_plausible_heap_addr \
&& (ptr_t)(p) < (ptr_t)GC_greatest_plausible_heap_addr) { \
PUSH_ONE_CHECKED_STACK(p, source); \
- }
+ } \
+ FIXUP_POINTER(p); \
+ if ((ptr_t)(p) >= (ptr_t)GC_least_plausible_heap_addr \
+ && (ptr_t)(p) < (ptr_t)GC_greatest_plausible_heap_addr) { \
+ PUSH_ONE_CHECKED_STACK(p, source); \
+ }
+# else /* !NEED_FIXUP_POINTER */
+# define GC_PUSH_ONE_STACK(p, source) \
+ if ((ptr_t)(p) >= (ptr_t)GC_least_plausible_heap_addr \
+ && (ptr_t)(p) < (ptr_t)GC_greatest_plausible_heap_addr) { \
+ PUSH_ONE_CHECKED_STACK(p, source); \
+ }
+# endif
+
/*
* As above, but interior pointer recognition as for
* normal for heap pointers.
*/
# define GC_PUSH_ONE_HEAP(p,source) \
+ FIXUP_POINTER(p); \
if ((ptr_t)(p) >= (ptr_t)GC_least_plausible_heap_addr \
&& (ptr_t)(p) < (ptr_t)GC_greatest_plausible_heap_addr) { \
GC_mark_stack_top = GC_mark_and_push( \
diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h
index b09c4840945..ffa398b308b 100644
--- a/boehm-gc/include/private/gc_priv.h
+++ b/boehm-gc/include/private/gc_priv.h
@@ -30,14 +30,20 @@
# define BSD_TIME
#endif
+#ifdef DGUX
+# include <sys/types.h>
+# include <sys/time.h>
+# include <sys/resource.h>
+#endif /* DGUX */
+
#ifdef BSD_TIME
# include <sys/types.h>
# include <sys/time.h>
# include <sys/resource.h>
#endif /* BSD_TIME */
-# ifndef GC_H
-# include "gc.h"
+# ifndef _GC_H
+# include "../gc.h"
# endif
# ifndef GC_MARK_H
@@ -206,11 +212,10 @@ typedef char * ptr_t; /* A generic pointer to which we can add */
#endif
#if defined(GC_GCJ_SUPPORT) && ALIGNMENT < 8 && !defined(ALIGN_DOUBLE)
- /* GCJ's Hashtable synchronization code requires 64-bit alignment. */
+ /* GCJ's Hashtable synchronization code requires 64-bit alignment. */
# define ALIGN_DOUBLE
#endif
-
/* ALIGN_DOUBLE requires MERGE_SIZES at present. */
# if defined(ALIGN_DOUBLE) && !defined(MERGE_SIZES)
# define MERGE_SIZES
@@ -347,7 +352,8 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
# include <string.h>
# define BCOPY_EXISTS
# endif
-# if defined(MACOSX)
+# if defined(DARWIN)
+# include <string.h>
# define BCOPY_EXISTS
# endif
@@ -360,68 +366,6 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
# define BZERO(x,n) bzero((char *)(x),(int)(n))
# endif
-/* HBLKSIZE aligned allocation. 0 is taken to mean failure */
-/* space is assumed to be cleared. */
-/* In the case os USE_MMAP, the argument must also be a */
-/* physical page size. */
-/* GET_MEM is currently not assumed to retrieve 0 filled space, */
-/* though we should perhaps take advantage of the case in which */
-/* does. */
-struct hblk; /* See below. */
-# ifdef PCR
- char * real_malloc();
-# define GET_MEM(bytes) HBLKPTR(real_malloc((size_t)bytes + GC_page_size) \
- + GC_page_size-1)
-# else
-# ifdef OS2
- void * os2_alloc(size_t bytes);
-# define GET_MEM(bytes) HBLKPTR((ptr_t)os2_alloc((size_t)bytes \
- + GC_page_size) \
- + GC_page_size-1)
-# else
-# if defined(NEXT) || defined(MACOSX) || defined(DOS4GW) || \
- (defined(AMIGA) && !defined(GC_AMIGA_FASTALLOC)) || \
- (defined(SUNOS5) && !defined(USE_MMAP))
-# define GET_MEM(bytes) HBLKPTR((size_t) \
- calloc(1, (size_t)bytes + GC_page_size) \
- + GC_page_size-1)
-# else
-# ifdef MSWIN32
- extern ptr_t GC_win32_get_mem();
-# define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes)
-# else
-# ifdef MACOS
-# if defined(USE_TEMPORARY_MEMORY)
- extern Ptr GC_MacTemporaryNewPtr(size_t size,
- Boolean clearMemory);
-# define GET_MEM(bytes) HBLKPTR( \
- GC_MacTemporaryNewPtr(bytes + GC_page_size, true) \
- + GC_page_size-1)
-# else
-# define GET_MEM(bytes) HBLKPTR( \
- NewPtrClear(bytes + GC_page_size) + GC_page_size-1)
-# endif
-# else
-# ifdef MSWINCE
- extern ptr_t GC_wince_get_mem();
-# define GET_MEM(bytes) (struct hblk *)GC_wince_get_mem(bytes)
-# else
-# if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
- extern void *GC_amiga_get_mem(size_t size);
- define GET_MEM(bytes) HBLKPTR((size_t) \
- GC_amiga_get_mem((size_t)bytes + GC_page_size) \
- + GC_page_size-1)
-# else
- extern ptr_t GC_unix_get_mem();
-# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-
/* Delay any interrupts or signals that may abort this thread. Data */
/* structures are in a consistent state outside this pair of calls. */
/* ANSI C allows both to be empty (though the standard isn't very */
@@ -486,7 +430,7 @@ struct hblk; /* See below. */
# ifdef SMALL_CONFIG
# define ABORT(msg) abort();
# else
- GC_API void GC_abort();
+ GC_API void GC_abort GC_PROTO((GC_CONST char * msg));
# define ABORT(msg) GC_abort(msg);
# endif
# endif
@@ -646,9 +590,10 @@ extern GC_warn_proc GC_current_warn_proc;
*/
# ifdef LARGE_CONFIG
-# define LOG_PHT_ENTRIES 19 /* Collisions likely at 512K blocks, */
- /* which is >= 2GB. Each table takes */
- /* 64KB. */
+# define LOG_PHT_ENTRIES 20 /* Collisions likely at 1M blocks, */
+ /* which is >= 4GB. Each table takes */
+ /* 128KB, some of which may never be */
+ /* touched. */
# else
# ifdef SMALL_CONFIG
# define LOG_PHT_ENTRIES 14 /* Collisions are likely if heap grows */
@@ -656,7 +601,7 @@ extern GC_warn_proc GC_current_warn_proc;
/* Each hash table occupies 2K bytes. */
# else /* default "medium" configuration */
# define LOG_PHT_ENTRIES 16 /* Collisions are likely if heap grows */
- /* to more than 16K hblks >= 256MB. */
+ /* to more than 64K hblks >= 256MB. */
/* Each hash table occupies 8K bytes. */
# endif
# endif
@@ -897,6 +842,10 @@ struct _GC_arrays {
word _mem_freed;
/* Number of explicitly deallocated words of memory */
/* since last collection. */
+ word _finalizer_mem_freed;
+ /* Words of memory explicitly deallocated while */
+ /* finalizers were running. Used to approximate mem. */
+ /* explicitly deallocated by finalizers. */
ptr_t _scratch_end_ptr;
ptr_t _scratch_last_end_ptr;
/* Used by headers.c, and can easily appear to point to */
@@ -957,7 +906,7 @@ struct _GC_arrays {
/* OFFSET_TOO_BIG if the value j would be too */
/* large to fit in the entry. (Note that the */
/* size of these entries matters, both for */
- /* space consumption and for cache utilization. */
+ /* space consumption and for cache utilization.) */
# define OFFSET_TOO_BIG 0xfe
# define OBJ_INVALID 0xff
# define MAP_ENTRY(map, bytes) (map)[bytes]
@@ -1067,6 +1016,7 @@ GC_API GC_FAR struct _GC_arrays GC_arrays;
# define GC_words_finalized GC_arrays._words_finalized
# define GC_non_gc_bytes_at_gc GC_arrays._non_gc_bytes_at_gc
# define GC_mem_freed GC_arrays._mem_freed
+# define GC_finalizer_mem_freed GC_arrays._finalizer_mem_freed
# define GC_scratch_end_ptr GC_arrays._scratch_end_ptr
# define GC_scratch_last_end_ptr GC_arrays._scratch_last_end_ptr
# define GC_mark_procs GC_arrays._mark_procs
@@ -1201,17 +1151,19 @@ extern struct hblk * GC_hblkfreelist[];
/* header structure associated with */
/* block. */
-extern GC_bool GC_is_initialized; /* GC_init() has been run. */
-
extern GC_bool GC_objects_are_marked; /* There are marked objects in */
/* the heap. */
#ifndef SMALL_CONFIG
extern GC_bool GC_incremental;
/* Using incremental/generational collection. */
+# define TRUE_INCREMENTAL \
+ (GC_incremental && GC_time_limit != GC_TIME_UNLIMITED)
+ /* True incremental, not just generational, mode */
#else
# define GC_incremental FALSE
/* Hopefully allow optimizer to remove some code. */
+# define TRUE_INCREMENTAL FALSE
#endif
extern GC_bool GC_dirty_maintained;
@@ -1229,6 +1181,10 @@ extern long GC_large_alloc_warn_interval;
extern long GC_large_alloc_warn_suppressed;
/* Number of warnings suppressed so far. */
+#ifdef THREADS
+ extern GC_bool GC_world_stopped;
+#endif
+
/* Operations */
# ifndef abs
# define abs(x) ((x) < 0? (-(x)) : (x))
@@ -1403,6 +1359,11 @@ extern void (*GC_start_call_back) GC_PROTO((void));
# else
void GC_push_regs GC_PROTO((void));
# endif
+# if defined(SPARC) || defined(IA64)
+ /* Cause all stacked registers to be saved in memory. Return a */
+ /* pointer to the top of the corresponding memory stack. */
+ word GC_save_regs_in_stack GC_PROTO((void));
+# endif
/* Push register contents onto mark stack. */
/* If NURSERY is defined, the default push */
/* action can be overridden with GC_push_proc */
@@ -1452,6 +1413,7 @@ void GC_set_fl_marks GC_PROTO((ptr_t p));
/* Set all mark bits associated with */
/* a free list. */
void GC_add_roots_inner GC_PROTO((char * b, char * e, GC_bool tmp));
+void GC_remove_roots_inner GC_PROTO((char * b, char * e));
GC_bool GC_is_static_root GC_PROTO((ptr_t p));
/* Is the address p in one of the registered static */
/* root sections? */
@@ -1462,11 +1424,10 @@ GC_bool GC_is_tmp_root GC_PROTO((ptr_t p));
# endif
void GC_register_dynamic_libraries GC_PROTO((void));
/* Add dynamic library data sections to the root set. */
-
GC_bool GC_register_main_static_data GC_PROTO((void));
- /* We need to register the main data segment. Returns */
- /* TRUE unless this is done implicitly as part of */
- /* dynamic library registration. */
+ /* We need to register the main data segment. Returns */
+ /* TRUE unless this is done implicitly as part of */
+ /* dynamic library registration. */
/* Machine dependent startup routines */
ptr_t GC_get_stack_base GC_PROTO((void)); /* Cold end of stack */
@@ -1624,6 +1585,8 @@ GC_bool GC_collect_or_expand GC_PROTO(( \
/* until the blocks are available or */
/* until it fails by returning FALSE. */
+extern GC_bool GC_is_initialized; /* GC_init() has been run. */
+
#if defined(MSWIN32) || defined(MSWINCE)
void GC_deinit GC_PROTO((void));
/* Free any resources allocated by */
@@ -1665,6 +1628,8 @@ ptr_t GC_allocobj GC_PROTO((word sz, int kind));
/* Make the indicated */
/* free list nonempty, and return its */
/* head. */
+
+void GC_free_inner(GC_PTR p);
void GC_init_headers GC_PROTO((void));
struct hblkhdr * GC_install_header GC_PROTO((struct hblk *h));
@@ -1694,6 +1659,12 @@ void GC_notify_or_invoke_finalizers GC_PROTO((void));
/* Call *GC_finalizer_notifier if there are */
/* finalizers to be run, and we haven't called */
/* this procedure yet this GC cycle. */
+
+GC_API GC_PTR GC_make_closure GC_PROTO((GC_finalization_proc fn, GC_PTR data));
+GC_API void GC_debug_invoke_finalizer GC_PROTO((GC_PTR obj, GC_PTR data));
+ /* Auxiliary fns to make finalization work */
+ /* correctly with displaced pointers introduced */
+ /* by the debugging allocators. */
void GC_add_to_heap GC_PROTO((struct hblk *p, word bytes));
/* Add a HBLKSIZE aligned chunk to the heap. */
@@ -1704,16 +1675,36 @@ void GC_print_obj GC_PROTO((ptr_t p));
/* description of the object to stderr. */
extern void (*GC_check_heap) GC_PROTO((void));
/* Check that all objects in the heap with */
- /* debugging info are intact. Print */
- /* descriptions of any that are not. */
+ /* debugging info are intact. */
+ /* Add any that are not to GC_smashed list. */
+extern void (*GC_print_all_smashed) GC_PROTO((void));
+ /* Print GC_smashed if it's not empty. */
+ /* Clear GC_smashed list. */
+extern void GC_print_all_errors GC_PROTO((void));
+ /* Print smashed and leaked objects, if any. */
+ /* Clear the lists of such objects. */
extern void (*GC_print_heap_obj) GC_PROTO((ptr_t p));
/* If possible print s followed by a more */
/* detailed description of the object */
/* referred to by p. */
+#if defined(LINUX) && defined(__ELF__) && !defined(SMALL_CONFIG)
+ void GC_print_address_map GC_PROTO((void));
+ /* Print an address map of the process. */
+#endif
+extern GC_bool GC_have_errors; /* We saw a smashed or leaked object. */
+ /* Call error printing routine */
+ /* occasionally. */
extern GC_bool GC_print_stats; /* Produce at least some logging output */
/* Set from environment variable. */
+#ifndef NO_DEBUGGING
+ extern GC_bool GC_dump_regularly; /* Generate regular debugging dumps. */
+# define COND_DUMP if (GC_dump_regularly) GC_dump();
+#else
+# define COND_DUMP
+#endif
+
/* Macros used for collector internal allocation. */
/* These assume the collector lock is held. */
#ifdef DBG_HDRS_ALL
@@ -1785,6 +1776,7 @@ void GC_print_block_list GC_PROTO((void));
void GC_print_hblkfreelist GC_PROTO((void));
void GC_print_heap_sects GC_PROTO((void));
void GC_print_static_roots GC_PROTO((void));
+void GC_print_finalization_stats GC_PROTO((void));
void GC_dump GC_PROTO((void));
#ifdef KEEP_BACK_PTRS
@@ -1866,6 +1858,16 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
# define GC_ASSERT(expr)
# endif
+/* Check a compile time assertion at compile time. The error */
+/* message for failure is a bit baroque, but ... */
+#if defined(mips) && !defined(__GNUC__)
+/* DOB: MIPSPro C gets an internal error taking the sizeof an array type.
+ This code works correctly (ugliness is to avoid "unused var" warnings) */
+# define GC_STATIC_ASSERT(expr) do { if (0) { char j[(expr)? 1 : -1]; j[0]='\0'; j[0]=j[0]; } } while(0)
+#else
+# define GC_STATIC_ASSERT(expr) sizeof(char[(expr)? 1 : -1])
+#endif
+
# if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC)
/* We need additional synchronization facilities from the thread */
/* support. We believe these are less performance critical */
@@ -1911,7 +1913,7 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
/* in Linux glibc, but it's not exported.) Thus we continue to use */
/* the same hard-coded signals we've always used. */
# if !defined(SIG_SUSPEND)
-# if defined(GC_LINUX_THREADS)
+# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
# if defined(SPARC) && !defined(SIGPWR)
/* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
* It is aliased to SIGLOST in asm/signal.h, though. */
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index 809887f8219..45386d78570 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -13,11 +13,25 @@
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
+
+/*
+ * This header is private to the gc. It is almost always included from
+ * gc_priv.h. However it is possible to include it by itself if just the
+ * configuration macros are needed. In that
+ * case, a few declarations relying on types declared in gc_priv.h will be
+ * omitted.
+ */
#ifndef GCCONFIG_H
# define GCCONFIG_H
+# ifndef GC_PRIVATE_H
+ /* Fake ptr_t declaration, just to avoid compilation errors. */
+ /* This avoids many instances if "ifndef GC_PRIVATE_H" below. */
+ typedef struct GC_undefined_struct * ptr_t;
+# endif
+
/* Machine dependent parameters. Some tuning parameters can be found */
/* near the top of gc_private.h. */
@@ -25,7 +39,9 @@
/* First a unified test for Linux: */
# if defined(linux) || defined(__linux__)
+# ifndef LINUX
# define LINUX
+# endif
# endif
/* And one for NetBSD: */
@@ -46,7 +62,7 @@
/* Determine the machine type: */
# if defined(__arm__) || defined(__thumb__)
# define ARM32
-# if !defined(LINUX) && !defined(NETBSD)
+# if !defined(LINUX)
# define NOSYS
# define mach_type_known
# endif
@@ -69,7 +85,7 @@
# define SPARC
# define mach_type_known
# endif
-# if defined(NETBSD) && defined(m68k)
+# if defined(NETBSD) && (defined(m68k) || defined(__m68k__))
# define M68K
# define mach_type_known
# endif
@@ -77,7 +93,7 @@
# define POWERPC
# define mach_type_known
# endif
-# if defined(NETBSD) && defined(__arm__)
+# if defined(NETBSD) && (defined(__arm32__) || defined(__arm__))
# define ARM32
# define mach_type_known
# endif
@@ -90,6 +106,10 @@
# endif
# define mach_type_known
# endif
+# if defined(__NetBSD__) && defined(__vax__)
+# define VAX
+# define mach_type_known
+# endif
# if defined(mips) || defined(__mips) || defined(_mips)
# define MIPS
# if defined(nec_ews) || defined(_nec_ews)
@@ -109,6 +129,13 @@
# endif /* !LINUX */
# define mach_type_known
# endif
+# if defined(DGUX) && (defined(i386) || defined(__i386__))
+# define I386
+# ifndef _USING_DGUX
+# define _USING_DGUX
+# endif
+# define mach_type_known
+# endif
# if defined(sequent) && (defined(i386) || defined(__i386__))
# define I386
# define SEQUENT
@@ -198,7 +225,11 @@
# define IA64
# define mach_type_known
# endif
-# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__))
+# if defined(LINUX) && defined(__arm__)
+# define ARM32
+# define mach_type_known
+# endif
+# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || defined(powerpc64) || defined(__powerpc64__))
# define POWERPC
# define mach_type_known
# endif
@@ -237,19 +268,19 @@
# define MACOS
# define mach_type_known
# endif
-# if defined(__MWERKS__) && defined(__powerc)
+# if defined(__MWERKS__) && defined(__powerc) && !defined(__MACH__)
# define POWERPC
# define MACOS
# define mach_type_known
# endif
# if defined(macosx) || \
defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
-# define MACOSX
+# define DARWIN
# define POWERPC
# define mach_type_known
# endif
# if defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
-# define MACOSX
+# define DARWIN
# define I386
--> Not really supported, but at least we recognize it.
# endif
@@ -291,7 +322,7 @@
# define CX_UX
# define mach_type_known
# endif
-# if defined(DGUX)
+# if defined(DGUX) && defined(m88k)
# define M88K
/* DGUX defined */
# define mach_type_known
@@ -419,17 +450,18 @@
/* (CX_UX and DGUX) */
/* S370 ==> 370-like machine */
/* running Amdahl UTS4 */
- /* S390 ==> 390-like machine */
- /* running LINUX */
+ /* S390 ==> 390-like machine */
+ /* running LINUX */
/* ARM32 ==> Intel StrongARM */
/* IA64 ==> Intel IPF */
/* (e.g. Itanium) */
/* (LINUX and HPUX) */
- /* IA64_32 ==> IA64 w/32 bit ABI */
- /* (HPUX) */
/* SH ==> Hitachi SuperH */
/* (LINUX & MSWINCE) */
/* X86_64 ==> AMD x86-64 */
+ /* POWERPC ==> IBM/Apple PowerPC */
+ /* (MACOS(<=9),DARWIN(incl.MACOSX),*/
+ /* LINUX, NETBSD, NOSYS variants) */
/*
@@ -450,7 +482,12 @@
* defining it to be 1 will always work, but perform poorly.
*
* DATASTART is the beginning of the data segment.
- * On UNIX systems, the collector will scan the area between DATASTART
+ * On some platforms SEARCH_FOR_DATA_START is defined.
+ * SEARCH_FOR_DATASTART will cause GC_data_start to
+ * be set to an address determined by accessing data backwards from _end
+ * until an unmapped page is found. DATASTART will be defined to be
+ * GC_data_start.
+ * On UNIX-like systems, the collector will scan the area between DATASTART
* and DATAEND for root pointers.
*
* DATAEND, if not `end' where `end' is defined as ``extern int end[];''.
@@ -470,8 +507,13 @@
* 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and
* 2) define exactly one of
* STACKBOTTOM (should be defined to be an expression)
+ * LINUX_STACKBOTTOM
* HEURISTIC1
* HEURISTIC2
+ * If STACKBOTTOM is defined, then it's value will be used directly as the
+ * stack base. If LINUX_STACKBOTTOM is defined, then it will be determined
+ * with a method appropriate for most Linux systems. Currently we look
+ * first for __libc_stack_end, and if that fails read it from /proc.
* If either of the last two macros are defined, then STACKBOTTOM is computed
* during collector startup using one of the following two heuristics:
* HEURISTIC1: Take an address inside GC_init's frame, and round it up to
@@ -536,6 +578,9 @@
* An architecture may also define CLEAR_DOUBLE(x) to be a fast way to
* clear the two words at GC_malloc-aligned address x. By default,
* word stores of 0 are used instead.
+ *
+ * HEAP_START may be defined as the initial address hint for mmap-based
+ * allocation.
*/
/* If we are using a recent version of gcc, we can use __builtin_unwind_init()
@@ -560,18 +605,25 @@
# 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
# endif
# ifdef LINUX
# define OS_TYPE "LINUX"
# define STACKBOTTOM ((ptr_t)0xf0000000)
+# define USE_GENERIC_PUSH_REGS
+ /* We never got around to the assembly version. */
/* # define MPROTECT_VDB - Reported to not work 9/17/01 */
# ifdef __ELF__
# define DYNAMIC_LOADING
# include <features.h>
# if defined(__GLIBC__)&& __GLIBC__>=2
-# define LINUX_DATA_START
+# define SEARCH_FOR_DATA_START
# else /* !GLIBC2 */
extern char **__environ;
# define DATASTART ((ptr_t)(&__environ))
@@ -666,26 +718,49 @@
# define DATAEND /* not needed */
# endif
# ifdef LINUX
-# define ALIGNMENT 4 /* Guess. Can someone verify? */
+# if (defined (powerpc64) || defined(__powerpc64__))
+# define ALIGNMENT 8
+# define CPP_WORDSZ 64
+# else
+# define ALIGNMENT 4 /* Guess. Can someone verify? */
/* This was 2, but that didn't sound right. */
+# endif
# define OS_TYPE "LINUX"
-# define DYNAMIC_LOADING
+ /* HEURISTIC1 has been reliably reported to fail for a 32-bit */
+ /* executable on a 64 bit kernel. */
# define LINUX_STACKBOTTOM
- /* Stack usually starts at 0x80000000 */
-# define LINUX_DATA_START
+# define DYNAMIC_LOADING
+# define SEARCH_FOR_DATA_START
extern int _end[];
# define DATAEND (_end)
# endif
-# ifdef MACOSX
- /* There are reasons to suspect this may not be reliable. */
+# ifdef DARWIN
# define ALIGNMENT 4
-# define OS_TYPE "MACOSX"
+# define OS_TYPE "DARWIN"
+# define DYNAMIC_LOADING
+ /* XXX: see get_end(3), get_etext() and get_end() should not be used.
+ These aren't used when dyld support is enabled (it is by default) */
# define DATASTART ((ptr_t) get_etext())
+# define DATAEND ((ptr_t) get_end())
# define STACKBOTTOM ((ptr_t) 0xc0000000)
-# define DATAEND /* not needed */
-# undef MPROTECT_VDB
+# define USE_MMAP
+# define USE_MMAP_ANON
+# define USE_ASM_PUSH_REGS
+ /* This is potentially buggy. It needs more testing. See the comments in
+ os_dep.c */
+# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
+# if defined(USE_PPC_PREFETCH) && defined(__GNUC__)
+ /* The performance impact of prefetches is untested */
+# define PREFETCH(x) \
+ __asm__ __volatile__ ("dcbt 0,%0" : : "r" ((const void *) (x)))
+# define PREFETCH_FOR_WRITE(x) \
+ __asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x)))
+# endif
+ /* There seems to be some issues with trylock hanging on darwin. This
+ should be looked into some more */
+# define NO_PTHREAD_TRYLOCK
# endif
# ifdef NETBSD
# define ALIGNMENT 4
@@ -746,8 +821,8 @@
# define OS_TYPE "SUNOS5"
extern int _etext[];
extern int _end[];
- extern char * GC_SysVGetDataStart();
-# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext)
+ extern ptr_t GC_SysVGetDataStart();
+# define DATASTART GC_SysVGetDataStart(0x10000, _etext)
# define DATAEND (_end)
# if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
# define USE_MMAP
@@ -801,9 +876,9 @@
# endif
# ifdef DRSNX
# define OS_TYPE "DRSNX"
- extern char * GC_SysVGetDataStart();
+ extern ptr_t GC_SysVGetDataStart();
extern int etext[];
-# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, etext)
+# define DATASTART GC_SysVGetDataStart(0x10000, etext)
# define MPROTECT_VDB
# define STACKBOTTOM ((ptr_t) 0xdfff0000)
# define DYNAMIC_LOADING
@@ -819,13 +894,14 @@
extern int _etext[];
# define DATAEND (_end)
# define SVR4
+ extern ptr_t GC_SysVGetDataStart();
# ifdef __arch64__
+# define DATASTART GC_SysVGetDataStart(0x100000, _etext)
/* libc_stack_end is not set reliably for sparc64 */
-# define STACKBOTTOM ((ptr_t) 0x80000000000)
-# define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, _etext)
+# define STACKBOTTOM ((ptr_t) 0x80000000000ULL)
# else
-# define LINUX_STACKBOTTOM
-# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext)
+# define DATASTART GC_SysVGetDataStart(0x10000, _etext)
+# define LINUX_STACKBOTTOM
# endif
# endif
# ifdef OPENBSD
@@ -876,7 +952,7 @@
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
extern int _etext[], _end[];
- extern char * GC_SysVGetDataStart();
+ extern ptr_t GC_SysVGetDataStart();
# define DATASTART GC_SysVGetDataStart(0x1000, _etext)
# define DATAEND (_end)
/* # define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7, */
@@ -921,6 +997,28 @@
# define DYNAMIC_LOADING
# define ELF_CLASS ELFCLASS32
# endif
+# ifdef DGUX
+# define OS_TYPE "DGUX"
+ extern int _etext, _end;
+ extern ptr_t GC_SysVGetDataStart();
+# define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
+# define DATAEND (&_end)
+# define STACK_GROWS_DOWN
+# define HEURISTIC2
+# include <unistd.h>
+# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
+# define DYNAMIC_LOADING
+# ifndef USE_MMAP
+# define USE_MMAP
+# endif /* USE_MMAP */
+# define MAP_FAILED (void *) -1
+# ifdef USE_MMAP
+# define HEAP_START (ptr_t)0x40000000
+# else /* USE_MMAP */
+# define HEAP_START DATAEND
+# endif /* USE_MMAP */
+# endif /* DGUX */
+
# ifdef LINUX
# ifndef __GNUC__
/* The Intel compiler doesn't like inline assembly */
@@ -944,6 +1042,9 @@
/* possibly because Linux threads is itself a malloc client */
/* and can't deal with the signals. */
# endif
+# define HEAP_START 0x1000
+ /* This encourages mmap to give us low addresses, */
+ /* thus allowing the heap to grow to ~3GB */
# ifdef __ELF__
# define DYNAMIC_LOADING
# ifdef UNDEFINED /* includes ro data */
@@ -952,7 +1053,7 @@
# endif
# include <features.h>
# if defined(__GLIBC__) && __GLIBC__ >= 2
-# define LINUX_DATA_START
+# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
# define DATASTART ((ptr_t)(&__environ))
@@ -1006,8 +1107,12 @@
/* DATAEND = _data_end__ */
/* To get it right for both, we take the */
/* minumum/maximum of the two. */
+# ifndef MAX
# define MAX(x,y) ((x) > (y) ? (x) : (y))
+# endif
+# ifndef MIN
# define MIN(x,y) ((x) < (y) ? (x) : (y))
+# endif
# define DATASTART ((ptr_t) MIN(_data_start__, _bss_start__))
# define DATAEND ((ptr_t) MAX(_data_end__, _bss_end__))
# undef STACK_GRAN
@@ -1061,16 +1166,9 @@
# ifdef __ELF__
# define DYNAMIC_LOADING
# endif
-/* Handle unmapped hole i386*-*-freebsd[45]* may put between etext and edata. */
extern char etext[];
- extern char edata[];
- extern char end[];
-# define NEED_FIND_LIMIT
-# define DATASTART ((ptr_t)(etext))
-# define MIN(x,y) ((x) < (y) ? (x) : (y))
-# define DATAEND (MIN (GC_find_limit (DATASTART, TRUE), DATASTART2))
-# define DATASTART2 ((ptr_t)(edata))
-# define DATAEND2 ((ptr_t)(end))
+ extern char * GC_FreeBSDGetDataStart();
+# define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
@@ -1149,7 +1247,11 @@
# define DATASTART ((ptr_t)(__data_start))
# define ALIGNMENT 4
# define USE_GENERIC_PUSH_REGS
-# define LINUX_STACKBOTTOM
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
+# define LINUX_STACKBOTTOM
+# else
+# define STACKBOTTOM 0x80000000
+# endif
# endif /* Linux */
# ifdef EWS4800
# define HEURISTIC2
@@ -1203,7 +1305,8 @@
/* heap sections so they're not */
/* considered as roots. */
# define OS_TYPE "IRIX5"
-# define MPROTECT_VDB
+/*# define MPROTECT_VDB DOB: this should work, but there is evidence */
+/* of recent breakage. */
# ifdef _MIPS_SZPTR
# define CPP_WORDSZ _MIPS_SZPTR
# define ALIGNMENT (_MIPS_SZPTR/8)
@@ -1226,28 +1329,46 @@
# define ALIGNMENT 4
# define HEURISTIC2
# define USE_GENERIC_PUSH_REGS
- extern int _fdata[];
-# define DATASTART ((ptr_t)(_fdata))
- extern int _end[];
-# define DATAEND ((ptr_t)(_end))
-# define DYNAMIC_LOADING
+# ifdef __ELF__
+ extern int etext[];
+# define DATASTART GC_data_start
+# define NEED_FIND_LIMIT
+# define DYNAMIC_LOADING
+# else
+# define DATASTART ((ptr_t) 0x10000000)
+# define STACKBOTTOM ((ptr_t) 0x7ffff000)
+# endif /* _ELF_ */
# endif
# endif
# ifdef RS6000
# define MACH_TYPE "RS6000"
+# ifdef ALIGNMENT
+# undef ALIGNMENT
+# endif
+# ifdef IA64
+# undef IA64 /* DOB: some AIX installs stupidly define IA64 in /usr/include/sys/systemcfg.h */
+# endif
# ifdef __64BIT__
# define ALIGNMENT 8
# define CPP_WORDSZ 64
+# define STACKBOTTOM ((ptr_t)0x1000000000000000)
# else
# define ALIGNMENT 4
# define CPP_WORDSZ 32
-# endif
+# define STACKBOTTOM ((ptr_t)((ulong)&errno))
+# endif
+ /* From AIX linker man page:
+ _text Specifies the first location of the program.
+ _etext Specifies the first location after the program.
+ _data Specifies the first location of the data.
+ _edata Specifies the first location after the initialized data
+ _end or end Specifies the first location after all data.
+ */
extern int _data[], _end[];
# define DATASTART ((ptr_t)((ulong)_data))
# define DATAEND ((ptr_t)((ulong)_end))
extern int errno;
-# define STACKBOTTOM ((ptr_t)((ulong)&errno))
# define USE_GENERIC_PUSH_REGS
# define DYNAMIC_LOADING
/* For really old versions of AIX, this may have to be removed. */
@@ -1311,15 +1432,23 @@
# define OS_TYPE "LINUX"
# define LINUX_STACKBOTTOM
# define DYNAMIC_LOADING
-# define LINUX_DATA_START
+# define SEARCH_FOR_DATA_START
extern int _end[];
-# define DATAEND (_end)
+# define DATAEND (&_end)
# endif /* LINUX */
# endif /* HP_PA */
# ifdef ALPHA
# define MACH_TYPE "ALPHA"
# define ALIGNMENT 8
+# define CPP_WORDSZ 64
+# ifndef LINUX
+# define USE_GENERIC_PUSH_REGS
+ /* Gcc and probably the DEC/Compaq compiler spill pointers to preserved */
+ /* fp registers in some cases when the target is a 21264. The assembly */
+ /* code doesn't handle that yet, and version dependencies make that a */
+ /* bit tricky. Do the easy thing for now. */
+# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# define HEURISTIC2
@@ -1327,13 +1456,11 @@
# define ELFCLASS32 32
# define ELFCLASS64 64
# define ELF_CLASS ELFCLASS64
-# define CPP_WORDSZ 64
# define DYNAMIC_LOADING
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
# define HEURISTIC2
-# define CPP_WORDSZ 64
# ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */
# define DATASTART GC_data_start
# define ELFCLASS32 32
@@ -1357,17 +1484,16 @@
extern char edata[];
extern char end[];
# define NEED_FIND_LIMIT
-# define DATASTART ((ptr_t)(etext))
+# define DATASTART ((ptr_t)(&etext))
# define DATAEND (GC_find_limit (DATASTART, TRUE))
-# define DATASTART2 ((ptr_t)(edata))
-# define DATAEND2 ((ptr_t)(end))
-# define CPP_WORDSZ 64
+# define DATASTART2 ((ptr_t)(&edata))
+# define DATAEND2 ((ptr_t)(&end))
# endif
# ifdef OSF1
# define OS_TYPE "OSF1"
# define DATASTART ((ptr_t) 0x140000000)
extern int _end[];
-# define DATAEND ((ptr_t) _end)
+# define DATAEND ((ptr_t) &_end)
extern char ** environ;
/* round up from the value of environ to the nearest page boundary */
/* Probably breaks if putenv is called before collector */
@@ -1378,19 +1504,19 @@
/* the text segment immediately follows the stack. */
/* Hence we give an upper pound. */
/* This is currently unused, since we disabled HEURISTIC2 */
- extern int __start[];
+ extern int __start[];
# define HEURISTIC2_LIMIT ((ptr_t)((word)(__start) & ~(getpagesize()-1)))
-# define CPP_WORDSZ 64
-# define MPROTECT_VDB
+# ifndef GC_OSF1_THREADS
+ /* Unresolved signal issues with threads. */
+# define MPROTECT_VDB
+# endif
# define DYNAMIC_LOADING
# endif
# ifdef LINUX
# define OS_TYPE "LINUX"
-# define CPP_WORDSZ 64
# define STACKBOTTOM ((ptr_t) 0x120000000)
# ifdef __ELF__
# define SEARCH_FOR_DATA_START
-# define DATASTART GC_data_start
# define DYNAMIC_LOADING
# else
# define DATASTART ((ptr_t) 0x140000000)
@@ -1468,7 +1594,6 @@
extern char * GC_register_stackbottom;
# define BACKING_STORE_BASE ((ptr_t)GC_register_stackbottom)
# define SEARCH_FOR_DATA_START
-# define DATASTART GC_data_start
# ifdef __GNUC__
# define DYNAMIC_LOADING
# else
@@ -1502,23 +1627,25 @@
# endif
# ifdef DGUX
# define OS_TYPE "DGUX"
- extern char * GC_SysVGetDataStart();
-# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, etext)
+ extern ptr_t GC_SysVGetDataStart();
+# define DATASTART GC_SysVGetDataStart(0x10000, etext)
# endif
# define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
# endif
# ifdef S370
+ /* If this still works, and if anyone cares, this should probably */
+ /* be moved to the S390 category. */
# define MACH_TYPE "S370"
# define ALIGNMENT 4 /* Required by hardware */
# define USE_GENERIC_PUSH_REGS
# ifdef UTS4
# define OS_TYPE "UTS4"
- extern int etext[];
+ extern int etext[];
extern int _etext[];
extern int _end[];
- extern char * GC_SysVGetDataStart();
-# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext)
+ extern ptr_t GC_SysVGetDataStart();
+# define DATASTART GC_SysVGetDataStart(0x10000, _etext)
# define DATAEND (_end)
# define HEURISTIC2
# endif
@@ -1528,23 +1655,23 @@
# define MACH_TYPE "S390"
# define USE_GENERIC_PUSH_REGS
# ifndef __s390x__
-# define ALIGNMENT 4
-# define CPP_WORDSZ 32
+# define ALIGNMENT 4
+# define CPP_WORDSZ 32
# else
-# define ALIGNMENT 8
-# define CPP_WORDSZ 64
-# define HBLKSIZE 4096
+# define ALIGNMENT 8
+# define CPP_WORDSZ 64
+# define HBLKSIZE 4096
# endif
# ifdef LINUX
# define OS_TYPE "LINUX"
# define LINUX_STACKBOTTOM
# define DYNAMIC_LOADING
- extern int __data_start[];
+ extern int __data_start[];
# define DATASTART ((ptr_t)(__data_start))
- extern int _end[];
-# define DATAEND (_end)
-# define CACHE_LINE_SIZE 256
-# define GETPAGESIZE() 4096
+ extern int _end[];
+# define DATAEND (_end)
+# define CACHE_LINE_SIZE 256
+# define GETPAGESIZE() 4096
# endif
# endif
@@ -1562,13 +1689,8 @@
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# define HEURISTIC2
-# ifdef __ELF__
-# define DATASTART GC_data_start
-# define DYNAMIC_LOADING
-# else
- extern char etext[];
-# define DATASTART ((ptr_t)(etext))
-# endif
+ extern char etext[];
+# define DATASTART ((ptr_t)(etext))
# define USE_GENERIC_PUSH_REGS
# endif
# ifdef LINUX
@@ -1581,7 +1703,7 @@
# define DYNAMIC_LOADING
# include <features.h>
# if defined(__GLIBC__) && __GLIBC__ >= 2
-# define LINUX_DATA_START
+# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
# define DATASTART ((ptr_t)(&__environ))
@@ -1628,7 +1750,7 @@
# define STACKBOTTOM ((ptr_t) 0x7c000000)
# define USE_GENERIC_PUSH_REGS
# define DYNAMIC_LOADING
-# define LINUX_DATA_START
+# define SEARCH_FOR_DATA_START
extern int _end[];
# define DATAEND (_end)
# endif
@@ -1645,7 +1767,9 @@
# define MACH_TYPE "X86_64"
# define ALIGNMENT 8
# define CPP_WORDSZ 64
-# define HBLKSIZE 4096
+# ifndef HBLKSIZE
+# define HBLKSIZE 4096
+# endif
# define CACHE_LINE_SIZE 64
# define USE_GENERIC_PUSH_REGS
# ifdef LINUX
@@ -1665,7 +1789,7 @@
# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
# endif
# include <features.h>
-# define LINUX_DATA_START
+# define SEARCH_FOR_DATA_START
extern int _end[];
# define DATAEND (_end)
# else
@@ -1679,19 +1803,6 @@
# endif
# endif
-#ifdef LINUX_DATA_START
- /* Some Linux distributions arrange to define __data_start. Some */
- /* define data_start as a weak symbol. The latter is technically */
- /* broken, since the user program may define data_start, in which */
- /* case we lose. Nonetheless, we try both, prefering __data_start. */
- /* We assume gcc. */
-# pragma weak __data_start
- extern int __data_start[];
-# pragma weak data_start
- extern int data_start[];
-# define DATASTART ((ptr_t)(__data_start != 0? __data_start : data_start))
-#endif
-
#if defined(LINUX) && defined(REDIRECT_MALLOC)
/* Rld appears to allocate some memory with its own allocator, and */
/* some through malloc, which might be redirected. To make this */
@@ -1730,15 +1841,15 @@
# endif
# if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
- /* OS has SVR4 generic features. Probably others also qualify. */
+ /* OS has SVR4 generic features. Probably others also qualify. */
# define SVR4
# endif
# if defined(SUNOS5) || defined(DRSNX)
- /* OS has SUNOS5 style semi-undocumented interface to dynamic */
- /* loader. */
+ /* OS has SUNOS5 style semi-undocumented interface to dynamic */
+ /* loader. */
# define SUNOS5DL
- /* OS has SUNOS5 style signal handlers. */
+ /* OS has SUNOS5 style signal handlers. */
# define SUNOS5SIGS
# endif
@@ -1747,13 +1858,14 @@
# endif
# if defined(SVR4) || defined(LINUX) || defined(IRIX) || defined(HPUX) \
- || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
- || defined(BSD) || defined(_AIX) || defined(MACOSX) || defined(OSF1)
+ || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
+ || defined(DGUX) || defined(BSD) \
+ || defined(_AIX) || defined(DARWIN) || defined(OSF1)
# define UNIX_LIKE /* Basic Unix-like system calls work. */
# endif
# if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
- -> bad word size
+ -> bad word size
# endif
# ifdef PCR
@@ -1767,13 +1879,13 @@
# endif
# ifdef SRC_M3
-/* Postponed for now. */
+ /* Postponed for now. */
# undef PROC_VDB
# undef MPROTECT_VDB
# endif
# ifdef SMALL_CONFIG
-/* Presumably not worth the space it takes. */
+ /* Presumably not worth the space it takes. */
# undef PROC_VDB
# undef MPROTECT_VDB
# endif
@@ -1813,49 +1925,50 @@
/* platforms as well, though it should be avoided in win32. */
# endif /* LINUX */
-# if defined(SEARCH_FOR_DATA_START) && defined(GC_PRIVATE_H)
+# if defined(SEARCH_FOR_DATA_START)
extern ptr_t GC_data_start;
+# define DATASTART GC_data_start
# endif
# ifndef CLEAR_DOUBLE
# define CLEAR_DOUBLE(x) \
- ((word*)x)[0] = 0; \
- ((word*)x)[1] = 0;
+ ((word*)x)[0] = 0; \
+ ((word*)x)[1] = 0;
# endif /* CLEAR_DOUBLE */
-/* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */
+ /* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */
# if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)
# define GC_SOLARIS_THREADS
# endif
# if defined(GC_IRIX_THREADS) && !defined(IRIX5)
---> inconsistent configuration
+ --> inconsistent configuration
# endif
# if defined(GC_LINUX_THREADS) && !defined(LINUX)
---> inconsistent configuration
+ --> inconsistent configuration
# endif
# if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)
---> inconsistent configuration
+ --> inconsistent configuration
# endif
# if defined(GC_HPUX_THREADS) && !defined(HPUX)
---> inconsistent configuration
+ --> inconsistent configuration
+# endif
+# if defined(GC_AIX_THREADS) && !defined(_AIX)
+ --> inconsistent configuration
# endif
-# if defined(GC_WIN32_THREADS) && !defined(MSWIN32)
- /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect */
- /* the necessary code is mostly there, but nobody has actually made */
- /* sure the right combination of pieces is compiled in, etc. */
---> inconsistent configuration
+# if defined(GC_WIN32_THREADS) && !defined(MSWIN32) && !defined(CYGWIN32)
+ --> inconsistent configuration
# endif
# if defined(PCR) || defined(SRC_M3) || \
- defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) || \
- defined(GC_PTHREADS)
+ defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) || \
+ defined(GC_PTHREADS)
# define THREADS
# endif
-# if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(MACOSX) \
- || defined(LINT) || defined(MSWINCE) \
- || (defined(I386) && defined(__LCC__))
+# if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(DARWIN) \
+ || defined(LINT) || defined(MSWINCE) || defined(ARM32) \
+ || (defined(I386) && defined(__LCC__))
/* Use setjmp based hack to mark from callee-save registers. */
/* The define should move to the individual platform */
/* descriptions. */
@@ -1867,36 +1980,26 @@
/* include assembly code to do it well. */
# endif
-/* Can we save call chain in objects for debugging? */
-/* SET NFRAMES (# of saved frames) and NARGS (#of args for each frame) */
-/* to reasonable values for the platform. */
-/* Set SAVE_CALL_CHAIN if we can. SAVE_CALL_COUNT can be specified at */
-/* build time, though we feel free to adjust it slightly. */
-/* Define NEED_CALLINFO if we either save the call stack or */
-/* GC_ADD_CALLER is defined. */
-#ifdef LINUX
-# include <features.h>
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2
-# define HAVE_BUILTIN_BACKTRACE
-# endif
-#endif
+ /* Can we save call chain in objects for debugging? */
+ /* SET NFRAMES (# of saved frames) and NARGS (#of args for each */
+ /* frame) to reasonable values for the platform. */
+ /* Set SAVE_CALL_CHAIN if we can. SAVE_CALL_COUNT can be specified */
+ /* at build time, though we feel free to adjust it slightly. */
+ /* Define NEED_CALLINFO if we either save the call stack or */
+ /* GC_ADD_CALLER is defined. */
+ /* GC_CAN_SAVE_CALL_STACKS is set in gc.h. */
#if defined(SPARC)
-# define CAN_SAVE_CALL_STACKS
# define CAN_SAVE_CALL_ARGS
#endif
#if (defined(I386) || defined(X86_64)) && defined(LINUX)
- /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
- /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
-# define CAN_SAVE_CALL_STACKS
+ /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
+ /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
# define CAN_SAVE_CALL_ARGS
#endif
-#if defined(HAVE_BUILTIN_BACKTRACE) && !defined(CAN_SAVE_CALL_STACKS)
-# define CAN_SAVE_CALL_STACKS
-#endif
# if defined(SAVE_CALL_COUNT) && !defined(GC_ADD_CALLER) \
- && defined(CAN_SAVE_CALL_STACKS)
+ && defined(GC_CAN_SAVE_CALL_STACKS)
# define SAVE_CALL_CHAIN
# endif
# ifdef SAVE_CALL_CHAIN
@@ -1909,7 +2012,7 @@
# ifdef SAVE_CALL_CHAIN
# ifndef SAVE_CALL_COUNT
# define NFRAMES 6 /* Number of frames to save. Even for */
- /* alignment reasons. */
+ /* alignment reasons. */
# else
# define NFRAMES ((SAVE_CALL_COUNT + 1) & ~1)
# endif
@@ -1925,4 +2028,96 @@
# define DBG_HDRS_ALL
# endif
+# if defined(POINTER_MASK) && !defined(POINTER_SHIFT)
+# define POINTER_SHIFT 0
+# endif
+
+# if defined(POINTER_SHIFT) && !defined(POINTER_MASK)
+# define POINTER_MASK ((GC_word)(-1))
+# endif
+
+# if !defined(FIXUP_POINTER) && defined(POINTER_MASK)
+# define FIXUP_POINTER(p) (p) = ((p) & (POINTER_MASK) << POINTER_SHIFT)
+# endif
+
+# if defined(FIXUP_POINTER)
+# define NEED_FIXUP_POINTER 1
+# else
+# define NEED_FIXUP_POINTER 0
+# define FIXUP_POINTER(p)
+# endif
+
+#ifdef GC_PRIVATE_H
+ /* This relies on some type definitions from gc_priv.h, from */
+ /* where it's normally included. */
+ /* */
+ /* How to get heap memory from the OS: */
+ /* Note that sbrk()-like allocation is preferred, since it */
+ /* usually makes it possible to merge consecutively allocated */
+ /* chunks. It also avoids unintented recursion with */
+ /* -DREDIRECT_MALLOC. */
+ /* GET_MEM() returns a HLKSIZE aligned chunk. */
+ /* 0 is taken to mean failure. */
+ /* In the case os USE_MMAP, the argument must also be a */
+ /* physical page size. */
+ /* GET_MEM is currently not assumed to retrieve 0 filled space, */
+ /* though we should perhaps take advantage of the case in which */
+ /* does. */
+ struct hblk; /* See gc_priv.h. */
+# ifdef PCR
+ char * real_malloc();
+# define GET_MEM(bytes) HBLKPTR(real_malloc((size_t)bytes + GC_page_size) \
+ + GC_page_size-1)
+# else
+# ifdef OS2
+ void * os2_alloc(size_t bytes);
+# define GET_MEM(bytes) HBLKPTR((ptr_t)os2_alloc((size_t)bytes \
+ + GC_page_size) \
+ + GC_page_size-1)
+# else
+# if defined(NEXT) || defined(DOS4GW) || \
+ (defined(AMIGA) && !defined(GC_AMIGA_FASTALLOC)) || \
+ (defined(SUNOS5) && !defined(USE_MMAP))
+# define GET_MEM(bytes) HBLKPTR((size_t) \
+ calloc(1, (size_t)bytes + GC_page_size) \
+ + GC_page_size-1)
+# else
+# ifdef MSWIN32
+ extern ptr_t GC_win32_get_mem();
+# define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes)
+# else
+# ifdef MACOS
+# if defined(USE_TEMPORARY_MEMORY)
+ extern Ptr GC_MacTemporaryNewPtr(size_t size,
+ Boolean clearMemory);
+# define GET_MEM(bytes) HBLKPTR( \
+ GC_MacTemporaryNewPtr(bytes + GC_page_size, true) \
+ + GC_page_size-1)
+# else
+# define GET_MEM(bytes) HBLKPTR( \
+ NewPtrClear(bytes + GC_page_size) + GC_page_size-1)
+# endif
+# else
+# ifdef MSWINCE
+ extern ptr_t GC_wince_get_mem();
+# define GET_MEM(bytes) (struct hblk *)GC_wince_get_mem(bytes)
+# else
+# if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
+ extern void *GC_amiga_get_mem(size_t size);
+# define GET_MEM(bytes) HBLKPTR((size_t) \
+ GC_amiga_get_mem((size_t)bytes + GC_page_size) \
+ + GC_page_size-1)
+# else
+ extern ptr_t GC_unix_get_mem();
+# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+
+#endif /* GC_PRIVATE_H */
+
# endif /* GCCONFIG_H */
diff --git a/boehm-gc/include/private/pthread_stop_world.h b/boehm-gc/include/private/pthread_stop_world.h
new file mode 100644
index 00000000000..054c7a0eacd
--- /dev/null
+++ b/boehm-gc/include/private/pthread_stop_world.h
@@ -0,0 +1,12 @@
+#ifndef GC_PTHREAD_STOP_WORLD_H
+#define GC_PTHREAD_STOP_WORLD_H
+
+struct thread_stop_info {
+ int signal;
+ word last_stop_count; /* GC_last_stop_count value when thread */
+ /* last successfully handled a suspend */
+ /* signal. */
+ ptr_t stack_ptr; /* Valid only when stopped. */
+};
+
+#endif
diff --git a/boehm-gc/include/private/pthread_support.h b/boehm-gc/include/private/pthread_support.h
new file mode 100644
index 00000000000..0ef917e7ef0
--- /dev/null
+++ b/boehm-gc/include/private/pthread_support.h
@@ -0,0 +1,97 @@
+#ifndef GC_PTHREAD_SUPPORT_H
+#define GC_PTHREAD_SUPPORT_H
+
+# include "private/gc_priv.h"
+
+# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+ && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS)
+
+#if defined(GC_DARWIN_THREADS)
+# include "private/darwin_stop_world.h"
+#else
+# include "private/pthread_stop_world.h"
+#endif
+
+/* We use the allocation lock to protect thread-related data structures. */
+
+/* The set of all known threads. We intercept thread creation and */
+/* joins. */
+/* Protected by allocation/GC lock. */
+/* Some of this should be declared volatile, but that's inconsistent */
+/* with some library routine declarations. */
+typedef struct GC_Thread_Rep {
+ struct GC_Thread_Rep * next; /* More recently allocated threads */
+ /* with a given pthread id come */
+ /* first. (All but the first are */
+ /* guaranteed to be dead, but we may */
+ /* not yet have registered the join.) */
+ pthread_t id;
+ /* Extra bookkeeping information the stopping code uses */
+ struct thread_stop_info stop_info;
+
+ short flags;
+# define FINISHED 1 /* Thread has exited. */
+# define DETACHED 2 /* Thread is intended to be detached. */
+# define MAIN_THREAD 4 /* True for the original thread only. */
+ short thread_blocked; /* Protected by GC lock. */
+ /* Treated as a boolean value. If set, */
+ /* thread will acquire GC lock before */
+ /* doing any pointer manipulations, and */
+ /* has set its sp value. Thus it does */
+ /* not need to be sent a signal to stop */
+ /* it. */
+ ptr_t stack_end; /* Cold end of the stack. */
+# ifdef IA64
+ ptr_t backing_store_end;
+ ptr_t backing_store_ptr;
+# endif
+ void * status; /* The value returned from the thread. */
+ /* Used only to avoid premature */
+ /* reclamation of any data it might */
+ /* reference. */
+# ifdef THREAD_LOCAL_ALLOC
+# if CPP_WORDSZ == 64 && defined(ALIGN_DOUBLE)
+# define GRANULARITY 16
+# define NFREELISTS 49
+# else
+# define GRANULARITY 8
+# define NFREELISTS 65
+# endif
+ /* The ith free list corresponds to size i*GRANULARITY */
+# define INDEX_FROM_BYTES(n) ((ADD_SLOP(n) + GRANULARITY - 1)/GRANULARITY)
+# define BYTES_FROM_INDEX(i) ((i) * GRANULARITY - EXTRA_BYTES)
+# define SMALL_ENOUGH(bytes) (ADD_SLOP(bytes) <= \
+ (NFREELISTS-1)*GRANULARITY)
+ ptr_t ptrfree_freelists[NFREELISTS];
+ ptr_t normal_freelists[NFREELISTS];
+# ifdef GC_GCJ_SUPPORT
+ ptr_t gcj_freelists[NFREELISTS];
+# endif
+ /* Free lists contain either a pointer or a small count */
+ /* reflecting the number of granules allocated at that */
+ /* size. */
+ /* 0 ==> thread-local allocation in use, free list */
+ /* empty. */
+ /* > 0, <= DIRECT_GRANULES ==> Using global allocation, */
+ /* too few objects of this size have been */
+ /* allocated by this thread. */
+ /* >= HBLKSIZE => pointer to nonempty free list. */
+ /* > DIRECT_GRANULES, < HBLKSIZE ==> transition to */
+ /* local alloc, equivalent to 0. */
+# define DIRECT_GRANULES (HBLKSIZE/GRANULARITY)
+ /* Don't use local free lists for up to this much */
+ /* allocation. */
+# endif
+} * GC_thread;
+
+# define THREAD_TABLE_SZ 128 /* Must be power of 2 */
+extern volatile GC_thread GC_threads[THREAD_TABLE_SZ];
+
+extern GC_bool GC_thr_initialized;
+
+GC_thread GC_lookup_thread(pthread_t id);
+
+void GC_stop_init();
+
+#endif /* GC_PTHREADS && !GC_SOLARIS_THREADS.... etc */
+#endif /* GC_PTHREAD_SUPPORT_H */
diff --git a/boehm-gc/include/private/solaris_threads.h b/boehm-gc/include/private/solaris_threads.h
index 1464bc14fd7..7d49c2987e0 100644
--- a/boehm-gc/include/private/solaris_threads.h
+++ b/boehm-gc/include/private/solaris_threads.h
@@ -16,7 +16,8 @@
# define DETACHED 2 /* Thread is intended to be detached. */
# define CLIENT_OWNS_STACK 4
/* Stack was supplied by client. */
-# define SUSPENDED 8 /* Currently suspended. */
+# define SUSPNDED 8 /* Currently suspended. */
+ /* SUSPENDED is used insystem header. */
ptr_t stack;
size_t stack_size;
cond_t join_cv;
diff --git a/boehm-gc/include/private/specific.h b/boehm-gc/include/private/specific.h
index 399f84f58d6..a0e6ae0ebc1 100644
--- a/boehm-gc/include/private/specific.h
+++ b/boehm-gc/include/private/specific.h
@@ -85,7 +85,7 @@ static __inline__ void * PREFIXED(getspecific) (tsd * key) {
unsigned hash_val = CACHE_HASH(qtid);
tse * volatile * entry_ptr = key -> cache + hash_val;
tse * entry = *entry_ptr; /* Must be loaded only once. */
- if (entry -> qtid == qtid) {
+ if (EXPECT(entry -> qtid == qtid, 1)) {
GC_ASSERT(entry -> thread == pthread_self());
return entry -> value;
}
diff --git a/boehm-gc/mach_dep.c b/boehm-gc/mach_dep.c
index a741058d70e..3dc5f0b27b9 100644
--- a/boehm-gc/mach_dep.c
+++ b/boehm-gc/mach_dep.c
@@ -74,7 +74,8 @@ asm static void PushMacRegisters()
/* on your architecture. Run the test_setjmp program to see whether */
/* there is any chance it will work. */
-#ifndef USE_GENERIC_PUSH_REGS
+#if !defined(USE_GENERIC_PUSH_REGS) && !defined(USE_ASM_PUSH_REGS)
+#undef HAVE_PUSH_REGS
void GC_push_regs()
{
# ifdef RT
@@ -91,6 +92,7 @@ void GC_push_regs()
asm("pushl r8"); asm("calls $1,_GC_push_one");
asm("pushl r7"); asm("calls $1,_GC_push_one");
asm("pushl r6"); asm("calls $1,_GC_push_one");
+# define HAVE_PUSH_REGS
# endif
# if defined(M68K) && (defined(SUNOS4) || defined(NEXT))
/* M68K SUNOS - could be replaced by generic code */
@@ -113,6 +115,7 @@ void GC_push_regs()
asm("movl d7,sp@"); asm("jbsr _GC_push_one");
asm("addqw #0x4,sp"); /* put stack back where it was */
+# define HAVE_PUSH_REGS
# endif
# if defined(M68K) && defined(HP)
@@ -135,6 +138,7 @@ void GC_push_regs()
asm("mov.l %d7,(%sp)"); asm("jsr _GC_push_one");
asm("addq.w &0x4,%sp"); /* put stack back where it was */
+# define HAVE_PUSH_REGS
# endif /* M68K HP */
# if defined(M68K) && defined(AMIGA)
@@ -158,6 +162,7 @@ void GC_push_regs()
asm("mov.l %d7,(%sp)"); asm("jsr _GC_push_one");
asm("addq.w &0x4,%sp"); /* put stack back where it was */
+# define HAVE_PUSH_REGS
# else /* !__GNUC__ */
GC_push_one(getreg(REG_A2));
GC_push_one(getreg(REG_A3));
@@ -174,6 +179,7 @@ void GC_push_regs()
GC_push_one(getreg(REG_D5));
GC_push_one(getreg(REG_D6));
GC_push_one(getreg(REG_D7));
+# define HAVE_PUSH_REGS
# endif /* !__GNUC__ */
# endif /* AMIGA */
@@ -196,10 +202,12 @@ void GC_push_regs()
PushMacReg(d7);
add.w #4,sp ; fix stack.
}
+# define HAVE_PUSH_REGS
# undef PushMacReg
# endif /* THINK_C */
# if defined(__MWERKS__)
PushMacRegisters();
+# define HAVE_PUSH_REGS
# endif /* __MWERKS__ */
# endif /* MACOS */
@@ -222,13 +230,15 @@ void GC_push_regs()
asm("pushl %esi"); asm("call _GC_push_one"); asm("addl $4,%esp");
asm("pushl %edi"); asm("call _GC_push_one"); asm("addl $4,%esp");
asm("pushl %ebx"); asm("call _GC_push_one"); asm("addl $4,%esp");
+# define HAVE_PUSH_REGS
# endif
# if ( defined(I386) && defined(LINUX) && defined(__ELF__) ) \
|| ( defined(I386) && defined(FREEBSD) && defined(__ELF__) ) \
|| ( defined(I386) && defined(NETBSD) && defined(__ELF__) ) \
|| ( defined(I386) && defined(OPENBSD) && defined(__ELF__) ) \
- || ( defined(I386) && defined(HURD) && defined(__ELF__) )
+ || ( defined(I386) && defined(HURD) && defined(__ELF__) ) \
+ || ( defined(I386) && defined(DGUX) )
/* This is modified for Linux with ELF (Note: _ELF_ only) */
/* This section handles FreeBSD with ELF. */
@@ -243,6 +253,7 @@ void GC_push_regs()
asm("pushl %esi; call GC_push_one; addl $4,%esp");
asm("pushl %edi; call GC_push_one; addl $4,%esp");
asm("pushl %ebx; call GC_push_one; addl $4,%esp");
+# define HAVE_PUSH_REGS
# endif
# if ( defined(I386) && defined(BEOS) && defined(__ELF__) )
@@ -254,6 +265,7 @@ void GC_push_regs()
asm("pushl %esi; call GC_push_one; addl $4,%esp");
asm("pushl %edi; call GC_push_one; addl $4,%esp");
asm("pushl %ebx; call GC_push_one; addl $4,%esp");
+# define HAVE_PUSH_REGS
# endif
# if defined(I386) && defined(MSWIN32) && !defined(__MINGW32__) \
@@ -280,6 +292,7 @@ void GC_push_regs()
__asm push edi
__asm call GC_push_one
__asm add esp,4
+# define HAVE_PUSH_REGS
# endif
# if defined(I386) && (defined(SVR4) || defined(SCO) || defined(SCO_ELF))
@@ -291,6 +304,7 @@ void GC_push_regs()
asm("pushl %ebp"); asm("call GC_push_one"); asm("addl $4,%esp");
asm("pushl %esi"); asm("call GC_push_one"); asm("addl $4,%esp");
asm("pushl %edi"); asm("call GC_push_one"); asm("addl $4,%esp");
+# define HAVE_PUSH_REGS
# endif
# ifdef NS32K
@@ -299,14 +313,12 @@ void GC_push_regs()
asm ("movd r5, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
asm ("movd r6, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
asm ("movd r7, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
+# define HAVE_PUSH_REGS
# endif
# if defined(SPARC)
- {
- word GC_save_regs_in_stack();
-
- GC_save_regs_ret_val = GC_save_regs_in_stack();
- }
+ GC_save_regs_ret_val = GC_save_regs_in_stack();
+# define HAVE_PUSH_REGS
# endif
# ifdef RT
@@ -322,6 +334,7 @@ void GC_push_regs()
asm("cas r11, r13, r0"); GC_push_one(TMP_SP); /* through */
asm("cas r11, r14, r0"); GC_push_one(TMP_SP); /* r15 */
asm("cas r11, r15, r0"); GC_push_one(TMP_SP);
+# define HAVE_PUSH_REGS
# endif
# if defined(M68K) && defined(SYSV)
@@ -345,6 +358,7 @@ void GC_push_regs()
asm("movl %d7,%sp@"); asm("jbsr GC_push_one");
asm("addqw #0x4,%sp"); /* put stack back where it was */
+# define HAVE_PUSH_REGS
# else /* !__GNUC__*/
asm("subq.w &0x4,%sp"); /* allocate word on top of stack */
@@ -362,6 +376,7 @@ void GC_push_regs()
asm("mov.l %d7,(%sp)"); asm("jsr GC_push_one");
asm("addq.w &0x4,%sp"); /* put stack back where it was */
+# define HAVE_PUSH_REGS
# endif /* !__GNUC__ */
# endif /* M68K/SYSV */
@@ -371,21 +386,19 @@ void GC_push_regs()
extern int *__libc_stack_end;
GC_push_all_stack (sp, __libc_stack_end);
+# define HAVE_PUSH_REGS
+ /* Isn't this redundant with the code to push the stack? */
}
# endif
/* other machines... */
-# if !defined(M68K) && !defined(VAX) && !defined(RT)
-# if !defined(SPARC) && !defined(I386) && !defined(NS32K)
-# if !defined(POWERPC) && !defined(UTS4)
-# if !defined(PJ) && !(defined(MIPS) && defined(LINUX))
- --> bad news <--
-# endif
-# endif
-# endif
+# if !defined(HAVE_PUSH_REGS)
+ --> We just generated an empty GC_push_regs, which
+ --> is almost certainly broken. Try defining
+ --> USE_GENERIC_PUSH_REGS instead.
# endif
}
-#endif /* !USE_GENERIC_PUSH_REGS */
+#endif /* !USE_GENERIC_PUSH_REGS && !USE_ASM_PUSH_REGS */
#if defined(USE_GENERIC_PUSH_REGS)
void GC_generic_push_regs(cold_gc_frame)
@@ -427,8 +440,6 @@ ptr_t cold_gc_frame;
/* needed on IA64, since some non-windowed registers are */
/* preserved. */
{
- word GC_save_regs_in_stack();
-
GC_save_regs_ret_val = GC_save_regs_in_stack();
/* On IA64 gcc, could use __builtin_ia64_flushrs() and */
/* __builtin_ia64_flushrs(). The latter will be done */
@@ -445,7 +456,7 @@ ptr_t cold_gc_frame;
/* the stack. Return sp. */
# ifdef SPARC
asm(" .seg \"text\"");
-# ifdef SVR4
+# if defined(SVR4) || defined(NETBSD)
asm(" .globl GC_save_regs_in_stack");
asm("GC_save_regs_in_stack:");
asm(" .type GC_save_regs_in_stack,#function");
diff --git a/boehm-gc/malloc.c b/boehm-gc/malloc.c
index 5ac21421bea..f5c8f06b0dd 100644
--- a/boehm-gc/malloc.c
+++ b/boehm-gc/malloc.c
@@ -182,6 +182,7 @@ register int k;
ptr_t result;
DCL_LOCK_STATE;
+ if (GC_have_errors) GC_print_all_errors();
GC_INVOKE_FINALIZERS();
if (SMALL_OBJ(lb)) {
DISABLE_SIGNALS();
@@ -294,6 +295,11 @@ DCL_LOCK_STATE;
return(GENERAL_MALLOC((word)lb, NORMAL));
}
/* See above comment on signals. */
+ GC_ASSERT(0 == obj_link(op)
+ || (word)obj_link(op)
+ <= (word)GC_greatest_plausible_heap_addr
+ && (word)obj_link(op)
+ >= (word)GC_least_plausible_heap_addr);
*opp = obj_link(op);
obj_link(op) = 0;
GC_words_allocd += lw;
@@ -338,6 +344,7 @@ DCL_LOCK_STATE;
return((GC_PTR)REDIRECT_MALLOC(n*lb));
}
+#ifndef strdup
# include <string.h>
# ifdef __STDC__
char *strdup(const char *s)
@@ -346,11 +353,16 @@ DCL_LOCK_STATE;
char *s;
# endif
{
- size_t len = strlen + 1;
+ size_t len = strlen(s) + 1;
char * result = ((char *)REDIRECT_MALLOC(len+1));
BCOPY(s, result, len+1);
return result;
}
+#endif /* !defined(strdup) */
+ /* If strdup is macro defined, we assume that it actually calls malloc, */
+ /* and thus the right thing will happen even without overriding it. */
+ /* This seems to be true on most Linux systems. */
+
# endif /* REDIRECT_MALLOC */
/* Explicitly deallocate an object p. */
@@ -373,6 +385,7 @@ DCL_LOCK_STATE;
/* Required by ANSI. It's not my fault ... */
h = HBLKPTR(p);
hhdr = HDR(h);
+ GC_ASSERT(GC_base(p) == p);
# if defined(REDIRECT_MALLOC) && \
(defined(GC_SOLARIS_THREADS) || defined(GC_LINUX_THREADS) \
|| defined(__MINGW32__)) /* Should this be MSWIN32 in general? */
@@ -454,7 +467,10 @@ void GC_free_inner(GC_PTR p)
}
#endif /* THREADS */
-# ifdef REDIRECT_MALLOC
+# if defined(REDIRECT_MALLOC) && !defined(REDIRECT_FREE)
+# define REDIRECT_FREE GC_free
+# endif
+# ifdef REDIRECT_FREE
# ifdef __STDC__
void free(GC_PTR p)
# else
@@ -463,7 +479,7 @@ void GC_free_inner(GC_PTR p)
# endif
{
# ifndef IGNORE_FREE
- GC_free(p);
+ REDIRECT_FREE(p);
# endif
}
# endif /* REDIRECT_MALLOC */
diff --git a/boehm-gc/mallocx.c b/boehm-gc/mallocx.c
index 031fcaf91a8..06f45622dfb 100644
--- a/boehm-gc/mallocx.c
+++ b/boehm-gc/mallocx.c
@@ -142,7 +142,11 @@ int obj_kind;
}
}
-# if defined(REDIRECT_MALLOC) || defined(REDIRECT_REALLOC)
+# if defined(REDIRECT_MALLOC) && !defined(REDIRECT_REALLOC)
+# define REDIRECT_REALLOC GC_realloc
+# endif
+
+# ifdef REDIRECT_REALLOC
# ifdef __STDC__
GC_PTR realloc(GC_PTR p, size_t lb)
# else
@@ -151,13 +155,9 @@ int obj_kind;
size_t lb;
# endif
{
-# ifdef REDIRECT_REALLOC
- return(REDIRECT_REALLOC(p, lb));
-# else
- return(GC_realloc(p, lb));
-# endif
+ return(REDIRECT_REALLOC(p, lb));
}
-# endif /* REDIRECT_MALLOC */
+# endif /* REDIRECT_REALLOC */
/* The same thing, except caller does not hold allocation lock. */
@@ -177,6 +177,7 @@ register int k;
lw = ROUNDED_UP_WORDS(lb);
n_blocks = OBJ_SZ_TO_BLOCKS(lw);
init = GC_obj_kinds[k].ok_init;
+ if (GC_have_errors) GC_print_all_errors();
GC_INVOKE_FINALIZERS();
DISABLE_SIGNALS();
LOCK();
@@ -286,6 +287,7 @@ register struct obj_kind * kind = GC_obj_kinds + k;
register ptr_t op;
DCL_LOCK_STATE;
+ if (GC_have_errors) GC_print_all_errors();
GC_INVOKE_FINALIZERS();
DISABLE_SIGNALS();
LOCK();
@@ -354,6 +356,7 @@ DCL_LOCK_STATE;
return;
}
lw = ALIGNED_WORDS(lb);
+ if (GC_have_errors) GC_print_all_errors();
GC_INVOKE_FINALIZERS();
DISABLE_SIGNALS();
LOCK();
@@ -375,6 +378,7 @@ DCL_LOCK_STATE;
while ((hbp = *rlh) != 0) {
hhdr = HDR(hbp);
*rlh = hhdr -> hb_next;
+ hhdr -> hb_last_reclaimed = (unsigned short) GC_gc_no;
# ifdef PARALLEL_MARK
{
signed_word my_words_allocd_tmp = GC_words_allocd_tmp;
@@ -575,6 +579,44 @@ DCL_LOCK_STATE;
}
}
+#ifdef __STDC__
+/* Not well tested nor integrated. */
+/* Debug version is tricky and currently missing. */
+#include <limits.h>
+
+GC_PTR GC_memalign(size_t align, size_t lb)
+{
+ size_t new_lb;
+ size_t offset;
+ ptr_t result;
+
+# ifdef ALIGN_DOUBLE
+ if (align <= WORDS_TO_BYTES(2) && lb > align) return GC_malloc(lb);
+# endif
+ if (align <= WORDS_TO_BYTES(1)) return GC_malloc(lb);
+ if (align >= HBLKSIZE/2 || lb >= HBLKSIZE/2) {
+ if (align > HBLKSIZE) return GC_oom_fn(LONG_MAX-1024) /* Fail */;
+ return GC_malloc(lb <= HBLKSIZE? HBLKSIZE : lb);
+ /* Will be HBLKSIZE aligned. */
+ }
+ /* We could also try to make sure that the real rounded-up object size */
+ /* is a multiple of align. That would be correct up to HBLKSIZE. */
+ new_lb = lb + align - 1;
+ result = GC_malloc(new_lb);
+ offset = (word)result % align;
+ if (offset != 0) {
+ offset = align - offset;
+ if (!GC_all_interior_pointers) {
+ if (offset >= VALID_OFFSET_SZ) return GC_malloc(HBLKSIZE);
+ GC_register_displacement(offset);
+ }
+ }
+ result = (GC_PTR) ((ptr_t)result + offset);
+ GC_ASSERT((word)result % align == 0);
+ return result;
+}
+#endif
+
# ifdef ATOMIC_UNCOLLECTABLE
/* Allocate lb bytes of pointerfree, untraced, uncollectable data */
/* This is normally roughly equivalent to the system malloc. */
diff --git a/boehm-gc/mark.c b/boehm-gc/mark.c
index eb5b9eeb34d..ca947290291 100644
--- a/boehm-gc/mark.c
+++ b/boehm-gc/mark.c
@@ -19,6 +19,10 @@
# include <stdio.h>
# include "private/gc_pmark.h"
+#if defined(MSWIN32) && defined(__GNUC__)
+# include <excpt.h>
+#endif
+
/* We put this here to minimize the risk of inlining. */
/*VARARGS*/
#ifdef __WATCOMC__
@@ -261,20 +265,20 @@ static void alloc_mark_stack();
/* remains valid until all marking is complete. */
/* A zero value indicates that it's OK to miss some */
/* register values. */
-GC_bool GC_mark_some(cold_gc_frame)
-ptr_t cold_gc_frame;
+/* We hold the allocation lock. In the case of */
+/* incremental collection, the world may not be stopped.*/
+#ifdef MSWIN32
+ /* For win32, this is called after we establish a structured */
+ /* exception handler, in case Windows unmaps one of our root */
+ /* segments. See below. In either case, we acquire the */
+ /* allocator lock long before we get here. */
+ GC_bool GC_mark_some_inner(cold_gc_frame)
+ ptr_t cold_gc_frame;
+#else
+ GC_bool GC_mark_some(cold_gc_frame)
+ ptr_t cold_gc_frame;
+#endif
{
-#if defined(MSWIN32) && !defined(__GNUC__)
- /* Windows 98 appears to asynchronously create and remove writable */
- /* memory mappings, for reasons we haven't yet understood. Since */
- /* we look for writable regions to determine the root set, we may */
- /* try to mark from an address range that disappeared since we */
- /* started the collection. Thus we have to recover from faults here. */
- /* This code does not appear to be necessary for Windows 95/NT/2000. */
- /* Note that this code should never generate an incremental GC write */
- /* fault. */
- __try {
-#endif /* defined(MSWIN32) && !defined(__GNUC__) */
switch(GC_mark_state) {
case MS_NONE:
return(FALSE);
@@ -395,23 +399,130 @@ ptr_t cold_gc_frame;
ABORT("GC_mark_some: bad state");
return(FALSE);
}
-#if defined(MSWIN32) && !defined(__GNUC__)
- } __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
- EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
-# ifdef CONDPRINT
- if (GC_print_stats) {
- GC_printf0("Caught ACCESS_VIOLATION in marker. "
- "Memory mapping disappeared.\n");
+}
+
+
+#ifdef MSWIN32
+
+# ifdef __GNUC__
+
+ typedef struct {
+ EXCEPTION_REGISTRATION ex_reg;
+ void *alt_path;
+ } ext_ex_regn;
+
+
+ static EXCEPTION_DISPOSITION mark_ex_handler(
+ struct _EXCEPTION_RECORD *ex_rec,
+ void *est_frame,
+ struct _CONTEXT *context,
+ void *disp_ctxt)
+ {
+ if (ex_rec->ExceptionCode == STATUS_ACCESS_VIOLATION) {
+ ext_ex_regn *xer = (ext_ex_regn *)est_frame;
+
+ /* Unwind from the inner function assuming the standard */
+ /* function prologue. */
+ /* Assumes code has not been compiled with */
+ /* -fomit-frame-pointer. */
+ context->Esp = context->Ebp;
+ context->Ebp = *((DWORD *)context->Esp);
+ context->Esp = context->Esp - 8;
+
+ /* Resume execution at the "real" handler within the */
+ /* wrapper function. */
+ context->Eip = (DWORD )(xer->alt_path);
+
+ return ExceptionContinueExecution;
+
+ } else {
+ return ExceptionContinueSearch;
+ }
+ }
+# endif /* __GNUC__ */
+
+
+ GC_bool GC_mark_some(cold_gc_frame)
+ ptr_t cold_gc_frame;
+ {
+ GC_bool ret_val;
+
+# ifndef __GNUC__
+ /* Windows 98 appears to asynchronously create and remove */
+ /* writable memory mappings, for reasons we haven't yet */
+ /* understood. Since we look for writable regions to */
+ /* determine the root set, we may try to mark from an */
+ /* address range that disappeared since we started the */
+ /* collection. Thus we have to recover from faults here. */
+ /* This code does not appear to be necessary for Windows */
+ /* 95/NT/2000. Note that this code should never generate */
+ /* an incremental GC write fault. */
+
+ __try {
+
+# else /* __GNUC__ */
+
+ /* Manually install an exception handler since GCC does */
+ /* not yet support Structured Exception Handling (SEH) on */
+ /* Win32. */
+
+ ext_ex_regn er;
+
+ er.alt_path = &&handle_ex;
+ er.ex_reg.handler = mark_ex_handler;
+ asm volatile ("movl %%fs:0, %0" : "=r" (er.ex_reg.prev));
+ asm volatile ("movl %0, %%fs:0" : : "r" (&er));
+
+# endif /* __GNUC__ */
+
+ ret_val = GC_mark_some_inner(cold_gc_frame);
+
+# ifndef __GNUC__
+
+ } __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
+ EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
+
+# else /* __GNUC__ */
+
+ /* Prevent GCC from considering the following code unreachable */
+ /* and thus eliminating it. */
+ if (er.alt_path != 0)
+ goto rm_handler;
+
+handle_ex:
+ /* Execution resumes from here on an access violation. */
+
+# endif /* __GNUC__ */
+
+# ifdef CONDPRINT
+ if (GC_print_stats) {
+ GC_printf0("Caught ACCESS_VIOLATION in marker. "
+ "Memory mapping disappeared.\n");
+ }
+# endif /* CONDPRINT */
+
+ /* We have bad roots on the stack. Discard mark stack. */
+ /* Rescan from marked objects. Redetermine roots. */
+ GC_invalidate_mark_state();
+ scan_ptr = 0;
+
+ ret_val = FALSE;
+
+# ifndef __GNUC__
+
}
-# endif /* CONDPRINT */
- /* We have bad roots on the stack. Discard mark stack. */
- /* Rescan from marked objects. Redetermine roots. */
- GC_invalidate_mark_state();
- scan_ptr = 0;
- return FALSE;
+
+# else /* __GNUC__ */
+
+rm_handler:
+ /* Uninstall the exception handler */
+ asm volatile ("mov %0, %%fs:0" : : "r" (er.ex_reg.prev));
+
+# endif /* __GNUC__ */
+
+ return ret_val;
}
-#endif /* defined(MSWIN32) && !defined(__GNUC__) */
-}
+#endif /* MSWIN32 */
GC_bool GC_mark_stack_empty()
@@ -434,13 +545,7 @@ GC_bool GC_mark_stack_empty()
/* for the large object. */
/* - just return current if it does not point to a large object. */
/*ARGSUSED*/
-# ifdef PRINT_BLACK_LIST
- ptr_t GC_find_start(current, hhdr, new_hdr_p, source)
- ptr_t source;
-# else
- ptr_t GC_find_start(current, hhdr, new_hdr_p)
-# define source 0
-# endif
+ptr_t GC_find_start(current, hhdr, new_hdr_p)
register ptr_t current;
register hdr *hhdr, **new_hdr_p;
{
@@ -468,7 +573,6 @@ register hdr *hhdr, **new_hdr_p;
} else {
return(current);
}
-# undef source
}
void GC_invalidate_mark_state()
@@ -546,8 +650,8 @@ mse * mark_stack_limit;
/* Large length. */
/* Process part of the range to avoid pushing too much on the */
/* stack. */
- GC_ASSERT(descr < GC_greatest_plausible_heap_addr
- - GC_least_plausible_heap_addr);
+ GC_ASSERT(descr < (word)GC_greatest_plausible_heap_addr
+ - (word)GC_least_plausible_heap_addr);
# ifdef PARALLEL_MARK
# define SHARE_BYTES 2048
if (descr > SHARE_BYTES && GC_parallel
@@ -578,6 +682,7 @@ mse * mark_stack_limit;
while (descr != 0) {
if ((signed_word)descr < 0) {
current = *current_p;
+ FIXUP_POINTER(current);
if ((ptr_t)current >= least_ha && (ptr_t)current < greatest_ha) {
PREFETCH(current);
HC_PUSH_CONTENTS((ptr_t)current, mark_stack_top,
@@ -652,6 +757,7 @@ mse * mark_stack_limit;
PREFETCH((ptr_t)limit - PREF_DIST*CACHE_LINE_SIZE);
GC_ASSERT(limit >= current_p);
deferred = *limit;
+ FIXUP_POINTER(deferred);
limit = (word *)((char *)limit - ALIGNMENT);
if ((ptr_t)deferred >= least_ha && (ptr_t)deferred < greatest_ha) {
PREFETCH(deferred);
@@ -661,6 +767,7 @@ mse * mark_stack_limit;
/* Unroll once, so we don't do too many of the prefetches */
/* based on limit. */
deferred = *limit;
+ FIXUP_POINTER(deferred);
limit = (word *)((char *)limit - ALIGNMENT);
if ((ptr_t)deferred >= least_ha && (ptr_t)deferred < greatest_ha) {
PREFETCH(deferred);
@@ -675,6 +782,7 @@ mse * mark_stack_limit;
/* Since HC_PUSH_CONTENTS expands to a lot of code, */
/* we don't. */
current = *current_p;
+ FIXUP_POINTER(current);
PREFETCH((ptr_t)current_p + PREF_DIST*CACHE_LINE_SIZE);
if ((ptr_t)current >= least_ha && (ptr_t)current < greatest_ha) {
/* Prefetch the contents of the object we just pushed. It's */
@@ -726,22 +834,33 @@ mse * GC_steal_mark_stack(mse * low, mse * high, mse * local,
mse *top = local - 1;
unsigned i = 0;
+ /* Make sure that prior writes to the mark stack are visible. */
+ /* On some architectures, the fact that the reads are */
+ /* volatile should suffice. */
+# if !defined(IA64) && !defined(HP_PA) && !defined(I386)
+ GC_memory_barrier();
+# endif
GC_ASSERT(high >= low-1 && high - low + 1 <= GC_mark_stack_size);
for (p = low; p <= high && i <= max; ++p) {
word descr = *(volatile word *) &(p -> mse_descr);
+ /* In the IA64 memory model, the following volatile store is */
+ /* ordered after this read of descr. Thus a thread must read */
+ /* the original nonzero value. HP_PA appears to be similar, */
+ /* and if I'm reading the P4 spec correctly, X86 is probably */
+ /* also OK. In some other cases we need a barrier. */
+# if !defined(IA64) && !defined(HP_PA) && !defined(I386)
+ GC_memory_barrier();
+# endif
if (descr != 0) {
*(volatile word *) &(p -> mse_descr) = 0;
+ /* More than one thread may get this entry, but that's only */
+ /* a minor performance problem. */
++top;
top -> mse_descr = descr;
top -> mse_start = p -> mse_start;
GC_ASSERT( top -> mse_descr & GC_DS_TAGS != GC_DS_LENGTH ||
top -> mse_descr < GC_greatest_plausible_heap_addr
- GC_least_plausible_heap_addr);
- /* There is no synchronization here. We assume that at */
- /* least one thread will see the original descriptor. */
- /* Otherwise we need a barrier. */
- /* More than one thread may get this entry, but that's only */
- /* a minor performance problem. */
/* If this is a big object, count it as */
/* size/256 + 1 objects. */
++i;
@@ -778,7 +897,7 @@ void GC_return_mark_stack(mse * low, mse * high)
BCOPY(low, my_start, stack_size * sizeof(mse));
GC_ASSERT(GC_mark_stack_top = my_top);
# if !defined(IA64) && !defined(HP_PA)
- GC_memory_write_barrier();
+ GC_memory_barrier();
# endif
/* On IA64, the volatile write acts as a release barrier. */
GC_mark_stack_top = my_top + stack_size;
@@ -1342,8 +1461,8 @@ ptr_t top;
# define GC_least_plausible_heap_addr least_ha
if (top == 0) return;
- /* check all pointers in range and put in push if they appear */
- /* to be valid. */
+ /* check all pointers in range and push if they appear */
+ /* to be valid. */
lim = t - 1 /* longword */;
for (p = b; p <= lim; p = (word *)(((char *)p) + ALIGNMENT)) {
q = *p;
@@ -1366,7 +1485,7 @@ ptr_t bottom;
ptr_t top;
ptr_t cold_gc_frame;
{
- if (GC_all_interior_pointers) {
+ if (!NEED_FIXUP_POINTER && GC_all_interior_pointers) {
# define EAGER_BYTES 1024
/* Push the hot end of the stack eagerly, so that register values */
/* saved inside GC frames are marked before they disappear. */
@@ -1375,6 +1494,7 @@ ptr_t cold_gc_frame;
GC_push_all_stack(bottom, top);
return;
}
+ GC_ASSERT(bottom <= cold_gc_frame && cold_gc_frame <= top);
# ifdef STACK_GROWS_DOWN
GC_push_all(cold_gc_frame - sizeof(ptr_t), top);
GC_push_all_eager(bottom, cold_gc_frame);
@@ -1395,7 +1515,7 @@ void GC_push_all_stack(bottom, top)
ptr_t bottom;
ptr_t top;
{
- if (GC_all_interior_pointers) {
+ if (!NEED_FIXUP_POINTER && GC_all_interior_pointers) {
GC_push_all(bottom, top);
} else {
GC_push_all_eager(bottom, top);
diff --git a/boehm-gc/mark_rts.c b/boehm-gc/mark_rts.c
index f663dcd55c3..55eb5d54339 100644
--- a/boehm-gc/mark_rts.c
+++ b/boehm-gc/mark_rts.c
@@ -275,33 +275,72 @@ void GC_clear_roots GC_PROTO((void))
}
/* Internal use only; lock held. */
+static void GC_remove_root_at_pos(i)
+int i;
+{
+ GC_root_size -= (GC_static_roots[i].r_end - GC_static_roots[i].r_start);
+ GC_static_roots[i].r_start = GC_static_roots[n_root_sets-1].r_start;
+ GC_static_roots[i].r_end = GC_static_roots[n_root_sets-1].r_end;
+ GC_static_roots[i].r_tmp = GC_static_roots[n_root_sets-1].r_tmp;
+ n_root_sets--;
+}
+
+#if !defined(MSWIN32) && !defined(MSWINCE)
+static void GC_rebuild_root_index()
+{
+ register int i;
+
+ for (i = 0; i < RT_SIZE; i++) GC_root_index[i] = 0;
+ for (i = 0; i < n_root_sets; i++)
+ add_roots_to_index(GC_static_roots + i);
+}
+#endif
+
+/* Internal use only; lock held. */
void GC_remove_tmp_roots()
{
register int i;
for (i = 0; i < n_root_sets; ) {
if (GC_static_roots[i].r_tmp) {
- GC_root_size -=
- (GC_static_roots[i].r_end - GC_static_roots[i].r_start);
- GC_static_roots[i].r_start = GC_static_roots[n_root_sets-1].r_start;
- GC_static_roots[i].r_end = GC_static_roots[n_root_sets-1].r_end;
- GC_static_roots[i].r_tmp = GC_static_roots[n_root_sets-1].r_tmp;
- n_root_sets--;
+ GC_remove_root_at_pos(i);
} else {
i++;
- }
}
-# if !defined(MSWIN32) && !defined(MSWINCE)
- {
- register int i;
-
- for (i = 0; i < RT_SIZE; i++) GC_root_index[i] = 0;
- for (i = 0; i < n_root_sets; i++)
- add_roots_to_index(GC_static_roots + i);
}
-# endif
+ #if !defined(MSWIN32) && !defined(MSWINCE)
+ GC_rebuild_root_index();
+ #endif
+}
+
+#if !defined(MSWIN32) && !defined(MSWINCE)
+void GC_remove_roots(b, e)
+char * b; char * e;
+{
+ DCL_LOCK_STATE;
+ DISABLE_SIGNALS();
+ LOCK();
+ GC_remove_roots_inner(b, e);
+ UNLOCK();
+ ENABLE_SIGNALS();
+}
+
+/* Should only be called when the lock is held */
+void GC_remove_roots_inner(b,e)
+char * b; char * e;
+{
+ int i;
+ for (i = 0; i < n_root_sets; ) {
+ if (GC_static_roots[i].r_start >= (ptr_t)b && GC_static_roots[i].r_end <= (ptr_t)e) {
+ GC_remove_root_at_pos(i);
+ } else {
+ i++;
+ }
+ }
+ GC_rebuild_root_index();
}
+#endif /* !defined(MSWIN32) && !defined(MSWINCE) */
#if defined(MSWIN32) || defined(_WIN32_WCE_EMULATION)
/* Workaround for the OS mapping and unmapping behind our back: */
@@ -573,8 +612,11 @@ ptr_t cold_gc_frame;
/* Mark thread local free lists, even if their mark */
/* descriptor excludes the link field. */
+ /* If the world is not stopped, this is unsafe. It is */
+ /* also unnecessary, since we will do this again with the */
+ /* world stopped. */
# ifdef THREAD_LOCAL_ALLOC
- GC_mark_thread_local_free_lists();
+ if (GC_world_stopped) GC_mark_thread_local_free_lists();
# endif
/*
diff --git a/boehm-gc/mips_sgi_mach_dep.S b/boehm-gc/mips_sgi_mach_dep.s
index bae9b5ebfe4..56390280a71 100644
--- a/boehm-gc/mips_sgi_mach_dep.S
+++ b/boehm-gc/mips_sgi_mach_dep.s
@@ -1,5 +1,10 @@
#include <sys/regdef.h>
#include <sys/asm.h>
+/* This file must be preprocessed. But the SGI assembler always does */
+/* that. Furthermore, a generic preprocessor won't do, since some of */
+/* the SGI-supplied include files rely on behavior of the MIPS */
+/* assembler. Hence we treat and name this file as though it required */
+/* no preprocessing. */
# define call_push(x) move $4,x; jal GC_push_one
diff --git a/boehm-gc/misc.c b/boehm-gc/misc.c
index 8f83ff3ab53..814fa41ab24 100644
--- a/boehm-gc/misc.c
+++ b/boehm-gc/misc.c
@@ -46,8 +46,10 @@
# ifdef GC_SOLARIS_THREADS
mutex_t GC_allocate_ml; /* Implicitly initialized. */
# else
-# ifdef GC_WIN32_THREADS
-# if !defined(GC_NOT_DLL) && (defined(_DLL) || defined(GC_DLL))
+# if defined(GC_WIN32_THREADS)
+# if defined(GC_PTHREADS)
+ pthread_mutex_t GC_allocate_ml = PTHREAD_MUTEX_INITIALIZER;
+# elif defined(GC_DLL)
__declspec(dllexport) CRITICAL_SECTION GC_allocate_ml;
# else
CRITICAL_SECTION GC_allocate_ml;
@@ -75,8 +77,8 @@
#undef STACKBASE
#endif
-/* Dont unnecessarily call GC_register_main_static_data() in case */
-/* dyn_load.c isn't linked in. */
+/* Dont unnecessarily call GC_register_main_static_data() in case */
+/* dyn_load.c isn't linked in. */
#ifdef DYNAMIC_LOADING
# define GC_REGISTER_MAIN_STATIC_DATA() GC_register_main_static_data()
#else
@@ -90,6 +92,7 @@ GC_bool GC_debugging_started = FALSE;
/* defined here so we don't have to load debug_malloc.o */
void (*GC_check_heap) GC_PROTO((void)) = (void (*) GC_PROTO((void)))0;
+void (*GC_print_all_smashed) GC_PROTO((void)) = (void (*) GC_PROTO((void)))0;
void (*GC_start_call_back) GC_PROTO((void)) = (void (*) GC_PROTO((void)))0;
@@ -109,6 +112,10 @@ GC_bool GC_print_stats = 0;
GC_bool GC_print_back_height = 0;
+#ifndef NO_DEBUGGING
+ GC_bool GC_dump_regularly = 0; /* Generate regular debugging dumps. */
+#endif
+
#ifdef FIND_LEAK
int GC_find_leak = 1;
#else
@@ -137,6 +144,13 @@ GC_PTR (*GC_oom_fn) GC_PROTO((size_t bytes_requested)) = GC_default_oom_fn;
extern signed_word GC_mem_found;
+void * GC_project2(arg1, arg2)
+void *arg1;
+void *arg2;
+{
+ return arg2;
+}
+
# ifdef MERGE_SIZES
/* Set things up so that GC_size_map[i] >= words(i), */
/* but not too much bigger */
@@ -455,7 +469,7 @@ void GC_init()
DISABLE_SIGNALS();
-#ifdef MSWIN32
+#if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS)
if (!GC_is_initialized) InitializeCriticalSection(&GC_allocate_ml);
#endif /* MSWIN32 */
@@ -473,6 +487,15 @@ void GC_init()
GC_init_parallel();
}
# endif /* PARALLEL_MARK || THREAD_LOCAL_ALLOC */
+
+# if defined(DYNAMIC_LOADING) && defined(DARWIN)
+ {
+ /* This must be called WITHOUT the allocation lock held
+ and before any threads are created */
+ extern void GC_init_dyld();
+ GC_init_dyld();
+ }
+# endif
}
#if defined(MSWIN32) || defined(MSWINCE)
@@ -485,6 +508,22 @@ void GC_init()
extern void GC_setpagesize();
+
+#ifdef MSWIN32
+extern GC_bool GC_no_win32_dlls;
+#else
+# define GC_no_win32_dlls FALSE
+#endif
+
+void GC_exit_check GC_PROTO((void))
+{
+ GC_gcollect();
+}
+
+#ifdef SEARCH_FOR_DATA_START
+ extern void GC_init_linux_data_start GC_PROTO((void));
+#endif
+
#ifdef UNIX_LIKE
extern void GC_set_and_save_fault_handler GC_PROTO((void (*handler)(int)));
@@ -495,12 +534,23 @@ int sig;
GC_err_printf1("Caught signal %d: looping in handler\n", sig);
for(;;);
}
-#endif
-#ifdef MSWIN32
-extern GC_bool GC_no_win32_dlls;
-#else
-# define GC_no_win32_dlls FALSE
+static GC_bool installed_looping_handler = FALSE;
+
+void maybe_install_looping_handler()
+{
+ /* Install looping handler before the write fault handler, so we */
+ /* handle write faults correctly. */
+ if (!installed_looping_handler && 0 != GETENV("GC_LOOP_ON_ABORT")) {
+ GC_set_and_save_fault_handler(looping_handler);
+ installed_looping_handler = TRUE;
+ }
+}
+
+#else /* !UNIX_LIKE */
+
+# define maybe_install_looping_handler()
+
#endif
void GC_init_inner()
@@ -515,14 +565,21 @@ void GC_init_inner()
GC_print_stats = 1;
# endif
# if defined(MSWIN32) || defined(MSWINCE)
- InitializeCriticalSection(&GC_write_cs);
+ InitializeCriticalSection(&GC_write_cs);
# endif
-
if (0 != GETENV("GC_PRINT_STATS")) {
GC_print_stats = 1;
}
+# ifndef NO_DEBUGGING
+ if (0 != GETENV("GC_DUMP_REGULARLY")) {
+ GC_dump_regularly = 1;
+ }
+# endif
if (0 != GETENV("GC_FIND_LEAK")) {
GC_find_leak = 1;
+# ifdef __STDC__
+ atexit(GC_exit_check);
+# endif
}
if (0 != GETENV("GC_ALL_INTERIOR_POINTERS")) {
GC_all_interior_pointers = 1;
@@ -560,11 +617,7 @@ void GC_init_inner()
}
}
}
-# ifdef UNIX_LIKE
- if (0 != GETENV("GC_LOOP_ON_ABORT")) {
- GC_set_and_save_fault_handler(looping_handler);
- }
-# endif
+ maybe_install_looping_handler();
/* Adjust normal object descriptor for extra allocation. */
if (ALIGNMENT > GC_DS_TAGS && EXTRA_BYTES != 0) {
GC_obj_kinds[NORMAL].ok_descriptor = ((word)(-ALIGNMENT) | GC_DS_LENGTH);
@@ -599,11 +652,21 @@ void GC_init_inner()
# if defined(LINUX) && defined(IA64)
GC_register_stackbottom = GC_get_register_stack_base();
# endif
+ } else {
+# if defined(LINUX) && defined(IA64)
+ if (GC_register_stackbottom == 0) {
+ WARN("GC_register_stackbottom should be set with GC_stackbottom", 0);
+ /* The following is likely to fail, since we rely on */
+ /* alignment properties that may not hold with a user set */
+ /* GC_stackbottom. */
+ GC_register_stackbottom = GC_get_register_stack_base();
+ }
+# endif
}
# endif
- GC_ASSERT(sizeof (ptr_t) == sizeof(word));
- GC_ASSERT(sizeof (signed_word) == sizeof(word));
- GC_ASSERT(sizeof (struct hblk) == HBLKSIZE);
+ GC_STATIC_ASSERT(sizeof (ptr_t) == sizeof(word));
+ GC_STATIC_ASSERT(sizeof (signed_word) == sizeof(word));
+ GC_STATIC_ASSERT(sizeof (struct hblk) == HBLKSIZE);
# ifndef THREADS
# if defined(STACK_GROWS_UP) && defined(STACK_GROWS_DOWN)
ABORT(
@@ -642,6 +705,18 @@ void GC_init_inner()
initial_heap_sz = divHBLKSZ(initial_heap_sz);
}
}
+ {
+ char * sz_str = GETENV("GC_MAXIMUM_HEAP_SIZE");
+ if (sz_str != NULL) {
+ word max_heap_sz = (word)atol(sz_str);
+ if (max_heap_sz < initial_heap_sz * HBLKSIZE) {
+ WARN("Bad maximum heap size %s - ignoring it.\n",
+ sz_str);
+ }
+ if (0 == GC_max_retries) GC_max_retries = 2;
+ GC_set_max_heap_size(max_heap_sz);
+ }
+ }
if (!GC_expand_hp_inner(initial_heap_sz)) {
GC_err_printf0("Can't start up: not enough memory\n");
EXIT();
@@ -677,6 +752,7 @@ void GC_init_inner()
GC_incremental = TRUE;
}
# endif /* !SMALL_CONFIG */
+ COND_DUMP;
/* Get black list set up and/or incrmental GC started */
if (!GC_dont_precollect || GC_incremental) GC_gcollect_inner();
GC_is_initialized = TRUE;
@@ -712,8 +788,9 @@ void GC_enable_incremental GC_PROTO(())
if (GC_incremental) goto out;
GC_setpagesize();
if (GC_no_win32_dlls) goto out;
-# ifndef GC_SOLARIS_THREADS
- GC_dirty_init();
+# ifndef GC_SOLARIS_THREADS
+ maybe_install_looping_handler(); /* Before write fault handler! */
+ GC_dirty_init();
# endif
if (!GC_is_initialized) {
GC_init_inner();
@@ -932,6 +1009,17 @@ GC_warn_proc GC_current_warn_proc = GC_default_warn_proc;
return(result);
}
+# if defined(__STDC__) || defined(__cplusplus)
+ GC_word GC_set_free_space_divisor (GC_word value)
+# else
+ GC_word GC_set_free_space_divisor (value)
+ GC_word value;
+# endif
+{
+ GC_word old = GC_free_space_divisor;
+ GC_free_space_divisor = value;
+ return old;
+}
#ifndef PCR
void GC_abort(msg)
@@ -958,122 +1046,18 @@ GC_CONST char * msg;
}
#endif
-#ifdef NEED_CALLINFO
-
-#ifdef HAVE_BUILTIN_BACKTRACE
-# include <execinfo.h>
-# ifdef LINUX
-# include <unistd.h>
-# endif
-#endif
-
-void GC_print_callers (info)
-struct callinfo info[NFRAMES];
-{
- register int i;
-
-# if NFRAMES == 1
- GC_err_printf0("\tCaller at allocation:\n");
-# else
- GC_err_printf0("\tCall chain at allocation:\n");
-# endif
- for (i = 0; i < NFRAMES; i++) {
- if (info[i].ci_pc == 0) break;
-# if NARGS > 0
- {
- int j;
-
- GC_err_printf0("\t\targs: ");
- for (j = 0; j < NARGS; j++) {
- if (j != 0) GC_err_printf0(", ");
- GC_err_printf2("%d (0x%X)", ~(info[i].ci_arg[j]),
- ~(info[i].ci_arg[j]));
- }
- GC_err_printf0("\n");
- }
-# endif
-# if defined(HAVE_BUILTIN_BACKTRACE) && !defined(REDIRECT_MALLOC)
- /* Unfortunately backtrace_symbols calls malloc, which makes */
- /* it dangersous if that has been redirected. */
- {
- char **sym_name =
- backtrace_symbols((void **)(&(info[i].ci_pc)), 1);
- char *name = sym_name[0];
- GC_bool found_it = (strchr(name, '(') != 0);
- FILE *pipe;
-# ifdef LINUX
- if (!found_it) {
-# define EXE_SZ 100
- static char exe_name[EXE_SZ];
-# define CMD_SZ 200
- char cmd_buf[CMD_SZ];
-# define RESULT_SZ 200
- static char result_buf[RESULT_SZ];
- size_t result_len;
- static GC_bool found_exe_name = FALSE;
- static GC_bool will_fail = FALSE;
- int ret_code;
- /* Unfortunately, this is the common case for the */
- /* main executable. */
- /* Try to get it via a hairy and expensive scheme. */
- /* First we get the name of the executable: */
- if (will_fail) goto out;
- if (!found_exe_name) {
- ret_code = readlink("/proc/self/exe", exe_name, EXE_SZ);
- if (ret_code < 0 || ret_code >= EXE_SZ || exe_name[0] != '/') {
- will_fail = TRUE; /* Dont try again. */
- goto out;
- }
- exe_name[ret_code] = '\0';
- found_exe_name = TRUE;
- }
- /* Then we use popen to start addr2line -e <exe> <addr> */
- /* There are faster ways to do this, but hopefully this */
- /* isn't time critical. */
- sprintf(cmd_buf, "/usr/bin/addr2line -e %s 0x%lx", exe_name,
- (unsigned long)info[i].ci_pc);
- pipe = popen(cmd_buf, "r");
- if (pipe < 0 || fgets(result_buf, RESULT_SZ, pipe) == 0) {
- will_fail = TRUE;
- goto out;
- }
- result_len = strlen(result_buf);
- if (result_buf[result_len - 1] == '\n') --result_len;
- if (result_buf[0] == '?'
- || result_buf[result_len-2] == ':'
- && result_buf[result_len-1] == '0')
- goto out;
- if (result_len < RESULT_SZ - 25) {
- /* Add in hex address */
- sprintf(result_buf + result_len, " [0x%lx]",
- (unsigned long)info[i].ci_pc);
- }
- name = result_buf;
- pclose(pipe);
- out:
- }
-# endif
- GC_err_printf1("\t\t%s\n", name);
- free(sym_name);
- }
-# else
- GC_err_printf1("\t\t##PC##= 0x%lx\n", info[i].ci_pc);
-# endif
- }
-}
-
-#endif /* SAVE_CALL_CHAIN */
-
-/* Needed by SRC_M3, gcj, and should perhaps be the official interface */
-/* to GC_dont_gc. */
void GC_enable()
{
+ LOCK();
GC_dont_gc--;
+ UNLOCK();
}
void GC_disable()
{
+ LOCK();
GC_dont_gc++;
+ UNLOCK();
}
#if !defined(NO_DEBUGGING)
@@ -1088,6 +1072,8 @@ void GC_dump()
GC_print_hblkfreelist();
GC_printf0("\n***Blocks in use:\n");
GC_print_block_list();
+ GC_printf0("\n***Finalization statistics:\n");
+ GC_print_finalization_stats();
}
#endif /* NO_DEBUGGING */
diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index 82386ec4fba..fd195e1c806 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -80,12 +80,15 @@
# define NEED_FIND_LIMIT
# endif
-#ifdef NEED_FIND_LIMIT
-# include <setjmp.h>
-#endif
-
#if defined(FREEBSD) && defined(I386)
# include <machine/trap.h>
+# if !defined(PCR)
+# define NEED_FIND_LIMIT
+# endif
+#endif
+
+#ifdef NEED_FIND_LIMIT
+# include <setjmp.h>
#endif
#ifdef AMIGA
@@ -129,6 +132,11 @@
# define jmp_buf sigjmp_buf
#endif
+#ifdef DARWIN
+/* for get_etext and friends */
+#include <mach-o/getsect.h>
+#endif
+
#ifdef DJGPP
/* Apparently necessary for djgpp 2.01. May cause problems with */
/* other versions. */
@@ -147,6 +155,156 @@
# define OPT_PROT_EXEC 0
#endif
+#if defined(LINUX) && \
+ (defined(USE_PROC_FOR_LIBRARIES) || defined(IA64) || !defined(SMALL_CONFIG))
+
+/* We need to parse /proc/self/maps, either to find dynamic libraries, */
+/* and/or to find the register backing store base (IA64). Do it once */
+/* here. */
+
+#define READ read
+
+/* Repeatedly perform a read call until the buffer is filled or */
+/* we encounter EOF. */
+ssize_t GC_repeat_read(int fd, char *buf, size_t count)
+{
+ ssize_t num_read = 0;
+ ssize_t result;
+
+ while (num_read < count) {
+ result = READ(fd, buf + num_read, count - num_read);
+ if (result < 0) return result;
+ if (result == 0) break;
+ num_read += result;
+ }
+ return num_read;
+}
+
+/*
+ * Apply fn to a buffer containing the contents of /proc/self/maps.
+ * Return the result of fn or, if we failed, 0.
+ */
+
+word GC_apply_to_maps(word (*fn)(char *))
+{
+ int f;
+ int result;
+ int maps_size;
+ char maps_temp[32768];
+ char *maps_buf;
+
+ /* Read /proc/self/maps */
+ /* Note that we may not allocate, and thus can't use stdio. */
+ f = open("/proc/self/maps", O_RDONLY);
+ if (-1 == f) return 0;
+ /* stat() doesn't work for /proc/self/maps, so we have to
+ read it to find out how large it is... */
+ maps_size = 0;
+ do {
+ result = GC_repeat_read(f, maps_temp, sizeof(maps_temp));
+ if (result <= 0) return 0;
+ maps_size += result;
+ } while (result == sizeof(maps_temp));
+
+ if (maps_size > sizeof(maps_temp)) {
+ /* If larger than our buffer, close and re-read it. */
+ close(f);
+ f = open("/proc/self/maps", O_RDONLY);
+ if (-1 == f) return 0;
+ maps_buf = alloca(maps_size);
+ if (NULL == maps_buf) return 0;
+ result = GC_repeat_read(f, maps_buf, maps_size);
+ if (result <= 0) return 0;
+ } else {
+ /* Otherwise use the fixed size buffer */
+ maps_buf = maps_temp;
+ }
+
+ close(f);
+ maps_buf[result] = '\0';
+
+ /* Apply fn to result. */
+ return fn(maps_buf);
+}
+
+#endif /* Need GC_apply_to_maps */
+
+#if defined(LINUX) && (defined(USE_PROC_FOR_LIBRARIES) || defined(IA64))
+//
+// GC_parse_map_entry parses an entry from /proc/self/maps so we can
+// locate all writable data segments that belong to shared libraries.
+// The format of one of these entries and the fields we care about
+// is as follows:
+// XXXXXXXX-XXXXXXXX r-xp 00000000 30:05 260537 name of mapping...\n
+// ^^^^^^^^ ^^^^^^^^ ^^^^ ^^
+// start end prot maj_dev
+// 0 9 18 32
+//
+// For 64 bit ABIs:
+// 0 17 34 56
+//
+// The parser is called with a pointer to the entry and the return value
+// is either NULL or is advanced to the next entry(the byte after the
+// trailing '\n'.)
+//
+#if CPP_WORDSZ == 32
+# define OFFSET_MAP_START 0
+# define OFFSET_MAP_END 9
+# define OFFSET_MAP_PROT 18
+# define OFFSET_MAP_MAJDEV 32
+# define ADDR_WIDTH 8
+#endif
+
+#if CPP_WORDSZ == 64
+# define OFFSET_MAP_START 0
+# define OFFSET_MAP_END 17
+# define OFFSET_MAP_PROT 34
+# define OFFSET_MAP_MAJDEV 56
+# define ADDR_WIDTH 16
+#endif
+
+/*
+ * Assign various fields of the first line in buf_ptr to *start, *end,
+ * *prot_buf and *maj_dev. Only *prot_buf may be set for unwritable maps.
+ */
+char *GC_parse_map_entry(char *buf_ptr, word *start, word *end,
+ char *prot_buf, unsigned int *maj_dev)
+{
+ int i;
+ char *tok;
+
+ if (buf_ptr == NULL || *buf_ptr == '\0') {
+ return NULL;
+ }
+
+ memcpy(prot_buf, buf_ptr+OFFSET_MAP_PROT, 4);
+ /* do the protections first. */
+ prot_buf[4] = '\0';
+
+ if (prot_buf[1] == 'w') {/* we can skip all of this if it's not writable. */
+
+ tok = buf_ptr;
+ buf_ptr[OFFSET_MAP_START+ADDR_WIDTH] = '\0';
+ *start = strtoul(tok, NULL, 16);
+
+ tok = buf_ptr+OFFSET_MAP_END;
+ buf_ptr[OFFSET_MAP_END+ADDR_WIDTH] = '\0';
+ *end = strtoul(tok, NULL, 16);
+
+ buf_ptr += OFFSET_MAP_MAJDEV;
+ tok = buf_ptr;
+ while (*buf_ptr != ':') buf_ptr++;
+ *buf_ptr++ = '\0';
+ *maj_dev = strtoul(tok, NULL, 16);
+ }
+
+ while (*buf_ptr && *buf_ptr++ != '\n');
+
+ return buf_ptr;
+}
+
+#endif /* Need to parse /proc/self/maps. */
+
#if defined(SEARCH_FOR_DATA_START)
/* The I386 case can be handled without a search. The Alpha case */
/* used to be handled differently as well, but the rules changed */
@@ -154,6 +312,11 @@
/* cover all versions. */
# ifdef LINUX
+ /* Some Linux distributions arrange to define __data_start. Some */
+ /* define data_start as a weak symbol. The latter is technically */
+ /* broken, since the user program may define data_start, in which */
+ /* case we lose. Nonetheless, we try both, prefering __data_start. */
+ /* We assume gcc-compatible pragmas. */
# pragma weak __data_start
extern int __data_start[];
# pragma weak data_start
@@ -169,16 +332,16 @@
# ifdef LINUX
/* Try the easy approaches first: */
- if (__data_start != 0) {
- GC_data_start = (ptr_t)__data_start;
+ if ((ptr_t)__data_start != 0) {
+ GC_data_start = (ptr_t)(__data_start);
return;
}
- if (data_start != 0) {
- GC_data_start = (ptr_t)data_start;
+ if ((ptr_t)data_start != 0) {
+ GC_data_start = (ptr_t)(data_start);
return;
}
# endif /* LINUX */
- GC_data_start = GC_find_limit((ptr_t)_end, FALSE);
+ GC_data_start = GC_find_limit((ptr_t)(_end), FALSE);
}
#endif
@@ -617,7 +780,8 @@ ptr_t GC_get_stack_base()
}
/* Return the first nonaddressible location > p (up) or */
- /* the smallest location q s.t. [q,p] is addressible (!up). */
+ /* the smallest location q s.t. [q,p) is addressable (!up). */
+ /* We assume that p (up) or p-1 (!up) is addressable. */
ptr_t GC_find_limit(p, up)
ptr_t p;
GC_bool up;
@@ -650,18 +814,18 @@ ptr_t GC_get_stack_base()
}
# endif
-# if defined(ECOS) || defined(NOSYS)
-ptr_t GC_get_stack_base()
-{
- return STACKBOTTOM;
-}
-
-#else
+#if defined(ECOS) || defined(NOSYS)
+ ptr_t GC_get_stack_base()
+ {
+ return STACKBOTTOM;
+ }
+#endif
#ifdef LINUX_STACKBOTTOM
#include <sys/types.h>
#include <sys/stat.h>
+#include <ctype.h>
# define STAT_SKIP 27 /* Number of fields preceding startstack */
/* field in /proc/self/stat */
@@ -670,6 +834,33 @@ ptr_t GC_get_stack_base()
extern ptr_t __libc_stack_end;
# ifdef IA64
+ /* Try to read the backing store base from /proc/self/maps. */
+ /* We look for the writable mapping with a 0 major device, */
+ /* which is as close to our frame as possible, but below it.*/
+ static word backing_store_base_from_maps(char *maps)
+ {
+ char prot_buf[5];
+ char *buf_ptr = maps;
+ word start, end;
+ unsigned int maj_dev;
+ word current_best = 0;
+ word dummy;
+
+ for (;;) {
+ buf_ptr = GC_parse_map_entry(buf_ptr, &start, &end, prot_buf, &maj_dev);
+ if (buf_ptr == NULL) return current_best;
+ if (prot_buf[1] == 'w' && maj_dev == 0) {
+ if (end < (word)(&dummy) && start > current_best) current_best = start;
+ }
+ }
+ return current_best;
+ }
+
+ static word backing_store_base_from_proc(void)
+ {
+ return GC_apply_to_maps(backing_store_base_from_maps);
+ }
+
# pragma weak __libc_ia64_register_backing_store_base
extern ptr_t __libc_ia64_register_backing_store_base;
@@ -679,13 +870,19 @@ ptr_t GC_get_stack_base()
&& 0 != __libc_ia64_register_backing_store_base) {
/* Glibc 2.2.4 has a bug such that for dynamically linked */
/* executables __libc_ia64_register_backing_store_base is */
- /* defined but ininitialized during constructor calls. */
+ /* defined but uninitialized during constructor calls. */
/* Hence we check for both nonzero address and value. */
return __libc_ia64_register_backing_store_base;
} else {
- word result = (word)GC_stackbottom - BACKING_STORE_DISPLACEMENT;
- result += BACKING_STORE_ALIGNMENT - 1;
- result &= ~(BACKING_STORE_ALIGNMENT - 1);
+ word result = backing_store_base_from_proc();
+ if (0 == result) {
+ /* Use dumb heuristics. Works only for default configuration. */
+ result = (word)GC_stackbottom - BACKING_STORE_DISPLACEMENT;
+ result += BACKING_STORE_ALIGNMENT - 1;
+ result &= ~(BACKING_STORE_ALIGNMENT - 1);
+ /* Verify that it's at least readable. If not, we goofed. */
+ GC_noop1(*(word *)result);
+ }
return (ptr_t)result;
}
}
@@ -697,11 +894,8 @@ ptr_t GC_get_stack_base()
/* using direct I/O system calls in order to avoid calling malloc */
/* in case REDIRECT_MALLOC is defined. */
# define STAT_BUF_SIZE 4096
-# if defined(GC_USE_LD_WRAP)
-# define STAT_READ __real_read
-# else
-# define STAT_READ read
-# endif
+# define STAT_READ read
+ /* Should probably call the real read, if read is wrapped. */
char stat_buf[STAT_BUF_SIZE];
int f;
char c;
@@ -710,7 +904,16 @@ ptr_t GC_get_stack_base()
/* First try the easy way. This should work for glibc 2.2 */
if (0 != &__libc_stack_end) {
- return __libc_stack_end;
+# ifdef IA64
+ /* Some versions of glibc set the address 16 bytes too */
+ /* low while the initialization code is running. */
+ if (((word)__libc_stack_end & 0xfff) + 0x10 < 0x1000) {
+ return __libc_stack_end + 0x10;
+ } /* Otherwise it's not safe to add 16 bytes and we fall */
+ /* back to using /proc. */
+# else
+ return __libc_stack_end;
+# endif
}
f = open("/proc/self/stat", O_RDONLY);
if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) {
@@ -760,12 +963,15 @@ ptr_t GC_get_stack_base()
#endif /* FREEBSD_STACKBOTTOM */
#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
- && !defined(MSWINCE) && !defined(OS2)
+ && !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS)
ptr_t GC_get_stack_base()
{
+# if defined(HEURISTIC1) || defined(HEURISTIC2) || \
+ defined(LINUX_STACKBOTTOM) || defined(FREEBSD_STACKBOTTOM)
word dummy;
ptr_t result;
+# endif
# define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1)
@@ -814,9 +1020,8 @@ ptr_t GC_get_stack_base()
return(result);
# endif /* STACKBOTTOM */
}
-# endif /* NOSYS ECOS */
-# endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS */
+# endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS, !NOSYS, !ECOS */
/*
* Register static data segment(s) as roots.
@@ -924,15 +1129,14 @@ void GC_register_data_segments()
/* Unfortunately, we have to handle win32s very differently from NT, */
/* Since VirtualQuery has very different semantics. In particular, */
/* under win32s a VirtualQuery call on an unmapped page returns an */
- /* invalid result. Under GC_register_data_segments is a noop and */
+ /* invalid result. Under NT, GC_register_data_segments is a noop and */
/* all real work is done by GC_register_dynamic_libraries. Under */
/* win32s, we cannot find the data segments associated with dll's. */
- /* We rgister the main data segment here. */
-# ifdef __GCC__
- GC_bool GC_no_win32_dlls = TRUE; /* GCC can't do SEH, so we can't use VirtualQuery */
-# else
+ /* We register the main data segment here. */
GC_bool GC_no_win32_dlls = FALSE;
-# endif
+ /* This used to be set for gcc, to avoid dealing with */
+ /* the structured exception handling issues. But we now have */
+ /* assembly code to do that right. */
void GC_init_win32()
{
@@ -964,36 +1168,102 @@ void GC_register_data_segments()
return(p);
}
# endif
+
+# ifndef REDIRECT_MALLOC
+ /* We maintain a linked list of AllocationBase values that we know */
+ /* correspond to malloc heap sections. Currently this is only called */
+ /* during a GC. But there is some hope that for long running */
+ /* programs we will eventually see most heap sections. */
+
+ /* In the long run, it would be more reliable to occasionally walk */
+ /* the malloc heap with HeapWalk on the default heap. But that */
+ /* apparently works only for NT-based Windows. */
+
+ /* In the long run, a better data structure would also be nice ... */
+ struct GC_malloc_heap_list {
+ void * allocation_base;
+ struct GC_malloc_heap_list *next;
+ } *GC_malloc_heap_l = 0;
+
+ /* Is p the base of one of the malloc heap sections we already know */
+ /* about? */
+ GC_bool GC_is_malloc_heap_base(ptr_t p)
+ {
+ struct GC_malloc_heap_list *q = GC_malloc_heap_l;
+
+ while (0 != q) {
+ if (q -> allocation_base == p) return TRUE;
+ q = q -> next;
+ }
+ return FALSE;
+ }
+
+ void *GC_get_allocation_base(void *p)
+ {
+ MEMORY_BASIC_INFORMATION buf;
+ DWORD result = VirtualQuery(p, &buf, sizeof(buf));
+ if (result != sizeof(buf)) {
+ ABORT("Weird VirtualQuery result");
+ }
+ return buf.AllocationBase;
+ }
+
+ size_t GC_max_root_size = 100000; /* Appr. largest root size. */
+
+ void GC_add_current_malloc_heap()
+ {
+ struct GC_malloc_heap_list *new_l =
+ malloc(sizeof(struct GC_malloc_heap_list));
+ void * candidate = GC_get_allocation_base(new_l);
+
+ if (new_l == 0) return;
+ if (GC_is_malloc_heap_base(candidate)) {
+ /* Try a little harder to find malloc heap. */
+ size_t req_size = 10000;
+ do {
+ void *p = malloc(req_size);
+ if (0 == p) { free(new_l); return; }
+ candidate = GC_get_allocation_base(p);
+ free(p);
+ req_size *= 2;
+ } while (GC_is_malloc_heap_base(candidate)
+ && req_size < GC_max_root_size/10 && req_size < 500000);
+ if (GC_is_malloc_heap_base(candidate)) {
+ free(new_l); return;
+ }
+ }
+# ifdef CONDPRINT
+ if (GC_print_stats)
+ GC_printf1("Found new system malloc AllocationBase at 0x%lx\n",
+ candidate);
+# endif
+ new_l -> allocation_base = candidate;
+ new_l -> next = GC_malloc_heap_l;
+ GC_malloc_heap_l = new_l;
+ }
+# endif /* REDIRECT_MALLOC */
/* Is p the start of either the malloc heap, or of one of our */
/* heap sections? */
GC_bool GC_is_heap_base (ptr_t p)
{
- register unsigned i;
+ unsigned i;
# ifndef REDIRECT_MALLOC
- static ptr_t malloc_heap_pointer = 0;
+ static word last_gc_no = -1;
- if (0 == malloc_heap_pointer) {
- MEMORY_BASIC_INFORMATION buf;
- void *pTemp = malloc( 1 );
- register DWORD result = VirtualQuery(pTemp, &buf, sizeof(buf));
-
- free( pTemp );
-
-
- if (result != sizeof(buf)) {
- ABORT("Weird VirtualQuery result");
- }
- malloc_heap_pointer = (ptr_t)(buf.AllocationBase);
+ if (last_gc_no != GC_gc_no) {
+ GC_add_current_malloc_heap();
+ last_gc_no = GC_gc_no;
}
- if (p == malloc_heap_pointer) return(TRUE);
+ if (GC_root_size > GC_max_root_size) GC_max_root_size = GC_root_size;
+ if (GC_is_malloc_heap_base(p)) return TRUE;
# endif
for (i = 0; i < GC_n_heap_bases; i++) {
- if (GC_heap_bases[i] == p) return(TRUE);
+ if (GC_heap_bases[i] == p) return TRUE;
}
- return(FALSE);
+ return FALSE ;
}
# ifdef MSWIN32
@@ -1043,7 +1313,7 @@ void GC_register_data_segments()
# if (defined(SVR4) || defined(AUX) || defined(DGUX) \
|| (defined(LINUX) && defined(SPARC))) && !defined(PCR)
-char * GC_SysVGetDataStart(max_page_size, etext_addr)
+ptr_t GC_SysVGetDataStart(max_page_size, etext_addr)
int max_page_size;
int * etext_addr;
{
@@ -1069,12 +1339,45 @@ int * etext_addr;
/* string constants in the text segment, but after etext. */
/* Use plan B. Note that we now know there is a gap between */
/* text and data segments, so plan A bought us something. */
- result = (char *)GC_find_limit((ptr_t)(DATAEND) - MIN_PAGE_SIZE, FALSE);
+ result = (char *)GC_find_limit((ptr_t)(DATAEND), FALSE);
}
- return((char *)result);
+ return((ptr_t)result);
}
# endif
+# if defined(FREEBSD) && defined(I386) && !defined(PCR)
+/* Its unclear whether this should be identical to the above, or */
+/* whether it should apply to non-X86 architectures. */
+/* For now we don't assume that there is always an empty page after */
+/* etext. But in some cases there actually seems to be slightly more. */
+/* This also deals with holes between read-only data and writable data. */
+ptr_t GC_FreeBSDGetDataStart(max_page_size, etext_addr)
+int max_page_size;
+int * etext_addr;
+{
+ word text_end = ((word)(etext_addr) + sizeof(word) - 1)
+ & ~(sizeof(word) - 1);
+ /* etext rounded to word boundary */
+ VOLATILE word next_page = (text_end + (word)max_page_size - 1)
+ & ~((word)max_page_size - 1);
+ VOLATILE ptr_t result = (ptr_t)text_end;
+ GC_setup_temporary_fault_handler();
+ if (setjmp(GC_jmp_buf) == 0) {
+ /* Try reading at the address. */
+ /* This should happen before there is another thread. */
+ for (; next_page < (word)(DATAEND); next_page += (word)max_page_size)
+ *(VOLATILE char *)next_page;
+ GC_reset_fault_handler();
+ } else {
+ GC_reset_fault_handler();
+ /* As above, we go to plan B */
+ result = GC_find_limit((ptr_t)(DATAEND), FALSE);
+ }
+ return(result);
+}
+
+# endif
+
#ifdef AMIGA
@@ -1086,8 +1389,7 @@ int * etext_addr;
void GC_register_data_segments()
{
-# if !defined(PCR) && !defined(SRC_M3) && !defined(NEXT) && !defined(MACOS) \
- && !defined(MACOSX)
+# if !defined(PCR) && !defined(SRC_M3) && !defined(MACOS)
# if defined(REDIRECT_MALLOC) && defined(GC_SOLARIS_THREADS)
/* As of Solaris 2.3, the Solaris threads implementation */
/* allocates the data structure for the initial thread with */
@@ -1104,9 +1406,6 @@ void GC_register_data_segments()
# endif
# endif
# endif
-# if !defined(PCR) && (defined(NEXT) || defined(MACOSX))
- GC_add_roots_inner(DATASTART, (char *) get_end(), FALSE);
-# endif
# if defined(MACOS)
{
# if defined(THINK_C)
@@ -1216,18 +1515,28 @@ word bytes;
ptr_t GC_unix_get_mem(bytes)
word bytes;
{
- static GC_bool initialized = FALSE;
- static int fd;
void *result;
static ptr_t last_addr = HEAP_START;
- if (!initialized) {
- fd = open("/dev/zero", O_RDONLY);
- initialized = TRUE;
- }
+# ifndef USE_MMAP_ANON
+ static GC_bool initialized = FALSE;
+ static int fd;
+
+ if (!initialized) {
+ fd = open("/dev/zero", O_RDONLY);
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+ initialized = TRUE;
+ }
+# endif
+
if (bytes & (GC_page_size -1)) ABORT("Bad GET_MEM arg");
- result = mmap(last_addr, bytes, PROT_READ | PROT_WRITE | OPT_PROT_EXEC,
- GC_MMAP_FLAGS, fd, 0/* offset */);
+# ifdef USE_MMAP_ANON
+ result = mmap(last_addr, bytes, PROT_READ | PROT_WRITE | OPT_PROT_EXEC,
+ GC_MMAP_FLAGS | MAP_ANON, -1, 0/* offset */);
+# else
+ result = mmap(last_addr, bytes, PROT_READ | PROT_WRITE | OPT_PROT_EXEC,
+ GC_MMAP_FLAGS, fd, 0/* offset */);
+# endif
if (result == MAP_FAILED) return(0);
last_addr = (ptr_t)result + bytes + GC_page_size - 1;
last_addr = (ptr_t)((word)last_addr & ~(GC_page_size - 1));
@@ -1322,7 +1631,15 @@ word bytes;
result = (ptr_t) GlobalAlloc(0, bytes + HBLKSIZE);
result = (ptr_t)(((word)result + HBLKSIZE) & ~(HBLKSIZE-1));
} else {
- result = (ptr_t) VirtualAlloc(NULL, bytes,
+ /* VirtualProtect only works on regions returned by a */
+ /* single VirtualAlloc call. Thus we allocate one */
+ /* extra page, which will prevent merging of blocks */
+ /* in separate regions, and eliminate any temptation */
+ /* to call VirtualProtect on a range spanning regions. */
+ /* This wastes a small amount of memory, and risks */
+ /* increased fragmentation. But better alternatives */
+ /* would require effort. */
+ result = (ptr_t) VirtualAlloc(NULL, bytes + 1,
MEM_COMMIT | MEM_RESERVE,
PAGE_EXECUTE_READWRITE);
}
@@ -1378,6 +1695,10 @@ word bytes;
/* Reserve more pages */
word res_bytes = (bytes + GC_sysinfo.dwAllocationGranularity-1)
& ~(GC_sysinfo.dwAllocationGranularity-1);
+ /* If we ever support MPROTECT_VDB here, we will probably need to */
+ /* ensure that res_bytes is strictly > bytes, so that VirtualProtect */
+ /* never spans regions. It seems to be OK for a VirtualFree argument */
+ /* to span regions, so we should be OK for now. */
result = (ptr_t) VirtualAlloc(NULL, res_bytes,
MEM_RESERVE | MEM_TOP_DOWN,
PAGE_EXECUTE_READWRITE);
@@ -1508,6 +1829,7 @@ void GC_remap(ptr_t start, word bytes)
}
# else
if (-1 == zero_descr) zero_descr = open("/dev/zero", O_RDWR);
+ fcntl(zero_descr, F_SETFD, FD_CLOEXEC);
if (0 == start_addr) return;
result = mmap(start_addr, len, PROT_READ | PROT_WRITE | OPT_PROT_EXEC,
MAP_FIXED | MAP_PRIVATE, zero_descr, 0);
@@ -1694,7 +2016,6 @@ void (*GC_push_other_roots) GC_PROTO((void)) = GC_default_push_other_roots;
* make sure that other system calls are similarly protected
* or write only to the stack.
*/
-
GC_bool GC_dirty_maintained = FALSE;
# ifdef DEFAULT_VDB
@@ -1708,6 +2029,9 @@ GC_bool GC_dirty_maintained = FALSE;
/* Initialize virtual dirty bit implementation. */
void GC_dirty_init()
{
+# ifdef PRINTSTATS
+ GC_printf0("Initializing DEFAULT_VDB...\n");
+# endif
GC_dirty_maintained = TRUE;
}
@@ -1776,17 +2100,21 @@ GC_bool is_ptrfree;
/*
* This implementation maintains dirty bits itself by catching write
* faults and keeping track of them. We assume nobody else catches
- * SIGBUS or SIGSEGV. We assume no write faults occur in system calls
- * except as a result of a read system call. This means clients must
- * either ensure that system calls do not touch the heap, or must
- * provide their own wrappers analogous to the one for read.
+ * SIGBUS or SIGSEGV. We assume no write faults occur in system calls.
+ * This means that clients must ensure that system calls don't write
+ * to the write-protected heap. Probably the best way to do this is to
+ * ensure that system calls write at most to POINTERFREE objects in the
+ * heap, and do even that only if we are on a platform on which those
+ * are not protected. Another alternative is to wrap system calls
+ * (see example for read below), but the current implementation holds
+ * a lock across blocking calls, making it problematic for multithreaded
+ * applications.
* We assume the page size is a multiple of HBLKSIZE.
- * This implementation is currently SunOS 4.X and IRIX 5.X specific, though we
- * tried to use portable code where easily possible. It is known
- * not to work under a number of other systems.
+ * We prefer them to be the same. We avoid protecting POINTERFREE
+ * objects only if they are the same.
*/
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(DARWIN)
# include <sys/mman.h>
# include <signal.h>
@@ -1805,6 +2133,23 @@ GC_bool is_ptrfree;
# else
+# ifdef DARWIN
+ /* Using vm_protect (mach syscall) over mprotect (BSD syscall) seems to
+ decrease the likelihood of some of the problems described below. */
+ #include <mach/vm_map.h>
+ extern mach_port_t GC_task_self;
+ #define PROTECT(addr,len) \
+ if(vm_protect(GC_task_self,(vm_address_t)(addr),(vm_size_t)(len), \
+ FALSE,VM_PROT_READ) != KERN_SUCCESS) { \
+ ABORT("vm_portect failed"); \
+ }
+ #define UNPROTECT(addr,len) \
+ if(vm_protect(GC_task_self,(vm_address_t)(addr),(vm_size_t)(len), \
+ FALSE,VM_PROT_READ|VM_PROT_WRITE) != KERN_SUCCESS) { \
+ ABORT("vm_portect failed"); \
+ }
+# else
+
# ifndef MSWINCE
# include <signal.h>
# endif
@@ -1822,20 +2167,22 @@ GC_bool is_ptrfree;
&protect_junk)) { \
ABORT("un-VirtualProtect failed"); \
}
-
-# endif
+# endif /* !DARWIN */
+# endif /* MSWIN32 || MSWINCE || DARWIN */
#if defined(SUNOS4) || defined(FREEBSD)
typedef void (* SIG_PF)();
-#endif
+#endif /* SUNOS4 || FREEBSD */
+
#if defined(SUNOS5SIGS) || defined(OSF1) || defined(LINUX) \
- || defined(MACOSX) || defined(HURD)
+ || defined(HURD)
# ifdef __STDC__
typedef void (* SIG_PF)(int);
# else
typedef void (* SIG_PF)();
# endif
-#endif
+#endif /* SUNOS5SIGS || OSF1 || LINUX || HURD */
+
#if defined(MSWIN32)
typedef LPTOP_LEVEL_EXCEPTION_FILTER SIG_PF;
# undef SIG_DFL
@@ -1849,7 +2196,8 @@ GC_bool is_ptrfree;
#if defined(IRIX5) || defined(OSF1) || defined(HURD)
typedef void (* REAL_SIG_PF)(int, int, struct sigcontext *);
-#endif
+#endif /* IRIX5 || OSF1 || HURD */
+
#if defined(SUNOS5SIGS)
# ifdef HPUX
# define SIGINFO __siginfo
@@ -1861,13 +2209,14 @@ GC_bool is_ptrfree;
# else
typedef void (* REAL_SIG_PF)();
# endif
-#endif
+#endif /* SUNOS5SIGS */
+
#if defined(LINUX)
# if __GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2
typedef struct sigcontext s_c;
# else /* glibc < 2.2 */
# include <linux/version.h>
-# if (LINUX_VERSION_CODE >= 0x20100) && !defined(M68K) || defined(ALPHA)
+# if (LINUX_VERSION_CODE >= 0x20100) && !defined(M68K) || defined(ALPHA) || defined(ARM32)
typedef struct sigcontext s_c;
# else
typedef struct sigcontext_struct s_c;
@@ -1895,139 +2244,14 @@ GC_bool is_ptrfree;
return (char *)faultaddr;
}
# endif /* !ALPHA */
-# endif
-
-# if defined(MACOSX) /* Should also test for PowerPC? */
- typedef void (* REAL_SIG_PF)(int, int, struct sigcontext *);
-
-/* Decodes the machine instruction which was responsible for the sending of the
- SIGBUS signal. Sadly this is the only way to find the faulting address because
- the signal handler doesn't get it directly from the kernel (although it is
- available on the Mach level, but droppped by the BSD personality before it
- calls our signal handler...)
- This code should be able to deal correctly with all PPCs starting from the
- 601 up to and including the G4s (including Velocity Engine). */
-#define EXTRACT_OP1(iw) (((iw) & 0xFC000000) >> 26)
-#define EXTRACT_OP2(iw) (((iw) & 0x000007FE) >> 1)
-#define EXTRACT_REGA(iw) (((iw) & 0x001F0000) >> 16)
-#define EXTRACT_REGB(iw) (((iw) & 0x03E00000) >> 21)
-#define EXTRACT_REGC(iw) (((iw) & 0x0000F800) >> 11)
-#define EXTRACT_DISP(iw) ((short *) &(iw))[1]
-
-static char *get_fault_addr(struct sigcontext *scp)
-{
- unsigned int instr = *((unsigned int *) scp->sc_ir);
- unsigned int * regs = &((unsigned int *) scp->sc_regs)[2];
- int disp = 0, tmp;
- unsigned int baseA = 0, baseB = 0;
- unsigned int addr, alignmask = 0xFFFFFFFF;
-
-#ifdef GC_DEBUG_DECODER
- GC_err_printf1("Instruction: 0x%lx\n", instr);
- GC_err_printf1("Opcode 1: d\n", (int)EXTRACT_OP1(instr));
-#endif
- switch(EXTRACT_OP1(instr)) {
- case 38: /* stb */
- case 39: /* stbu */
- case 54: /* stfd */
- case 55: /* stfdu */
- case 52: /* stfs */
- case 53: /* stfsu */
- case 44: /* sth */
- case 45: /* sthu */
- case 47: /* stmw */
- case 36: /* stw */
- case 37: /* stwu */
- tmp = EXTRACT_REGA(instr);
- if(tmp > 0)
- baseA = regs[tmp];
- disp = EXTRACT_DISP(instr);
- break;
- case 31:
-#ifdef GC_DEBUG_DECODER
- GC_err_printf1("Opcode 2: %d\n", (int)EXTRACT_OP2(instr));
-#endif
- switch(EXTRACT_OP2(instr)) {
- case 86: /* dcbf */
- case 54: /* dcbst */
- case 1014: /* dcbz */
- case 247: /* stbux */
- case 215: /* stbx */
- case 759: /* stfdux */
- case 727: /* stfdx */
- case 983: /* stfiwx */
- case 695: /* stfsux */
- case 663: /* stfsx */
- case 918: /* sthbrx */
- case 439: /* sthux */
- case 407: /* sthx */
- case 661: /* stswx */
- case 662: /* stwbrx */
- case 150: /* stwcx. */
- case 183: /* stwux */
- case 151: /* stwx */
- case 135: /* stvebx */
- case 167: /* stvehx */
- case 199: /* stvewx */
- case 231: /* stvx */
- case 487: /* stvxl */
- tmp = EXTRACT_REGA(instr);
- if(tmp > 0)
- baseA = regs[tmp];
- baseB = regs[EXTRACT_REGC(instr)];
- /* determine Altivec alignment mask */
- switch(EXTRACT_OP2(instr)) {
- case 167: /* stvehx */
- alignmask = 0xFFFFFFFE;
- break;
- case 199: /* stvewx */
- alignmask = 0xFFFFFFFC;
- break;
- case 231: /* stvx */
- alignmask = 0xFFFFFFF0;
- break;
- case 487: /* stvxl */
- alignmask = 0xFFFFFFF0;
- break;
- }
- break;
- case 725: /* stswi */
- tmp = EXTRACT_REGA(instr);
- if(tmp > 0)
- baseA = regs[tmp];
- break;
- default: /* ignore instruction */
-#ifdef GC_DEBUG_DECODER
- GC_err_printf("Ignored by inner handler\n");
-#endif
- return NULL;
- break;
- }
- break;
- default: /* ignore instruction */
-#ifdef GC_DEBUG_DECODER
- GC_err_printf("Ignored by main handler\n");
-#endif
- return NULL;
- break;
- }
-
- addr = (baseA + baseB) + disp;
- addr &= alignmask;
-#ifdef GC_DEBUG_DECODER
- GC_err_printf1("BaseA: %d\n", baseA);
- GC_err_printf1("BaseB: %d\n", baseB);
- GC_err_printf1("Disp: %d\n", disp);
- GC_err_printf1("Address: %d\n", addr);
-#endif
- return (char *)addr;
-}
-#endif /* MACOSX */
+# endif /* LINUX */
+#ifndef DARWIN
SIG_PF GC_old_bus_handler;
SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
+#endif /* !DARWIN */
-#ifdef THREADS
+#if defined(THREADS)
/* We need to lock around the bitmap update in the write fault handler */
/* in order to avoid the risk of losing a bit. We do this with a */
/* test-and-set spin lock if we know how to do that. Otherwise we */
@@ -2076,6 +2300,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
#endif /* !THREADS */
/*ARGSUSED*/
+#if !defined(DARWIN)
# if defined (SUNOS4) || defined(FREEBSD)
void GC_write_fault_handler(sig, code, scp, addr)
int sig, code;
@@ -2091,7 +2316,8 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
# define SIG_OK (sig == SIGBUS)
# define CODE_OK (code == BUS_PAGE_FAULT)
# endif
-# endif
+# endif /* SUNOS4 || FREEBSD */
+
# if defined(IRIX5) || defined(OSF1) || defined(HURD)
# include <errno.h>
void GC_write_fault_handler(int sig, int code, struct sigcontext *scp)
@@ -2107,7 +2333,8 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
# define SIG_OK (sig == SIGBUS || sig == SIGSEGV)
# define CODE_OK TRUE
# endif
-# endif
+# endif /* IRIX5 || OSF1 || HURD */
+
# if defined(LINUX)
# if defined(ALPHA) || defined(M68K)
void GC_write_fault_handler(int sig, int code, s_c * sc)
@@ -2115,7 +2342,11 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
# if defined(IA64) || defined(HP_PA)
void GC_write_fault_handler(int sig, siginfo_t * si, s_c * scp)
# else
- void GC_write_fault_handler(int sig, s_c sc)
+# if defined(ARM32)
+ void GC_write_fault_handler(int sig, int a2, int a3, int a4, s_c sc)
+# else
+ void GC_write_fault_handler(int sig, s_c sc)
+# endif
# endif
# endif
# define SIG_OK (sig == SIGSEGV)
@@ -2123,7 +2354,8 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
/* Empirically c.trapno == 14, on IA32, but is that useful? */
/* Should probably consider alignment issues on other */
/* architectures. */
-# endif
+# endif /* LINUX */
+
# if defined(SUNOS5SIGS)
# ifdef __STDC__
void GC_write_fault_handler(int sig, struct SIGINFO *scp, void * context)
@@ -2144,13 +2376,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
# define SIG_OK (sig == SIGSEGV)
# define CODE_OK (scp -> si_code == SEGV_ACCERR)
# endif
-# endif
-
-# if defined(MACOSX)
- void GC_write_fault_handler(int sig, int code, struct sigcontext *scp)
-# define SIG_OK (sig == SIGBUS)
-# define CODE_OK (code == 0 /* experimentally determined */)
-# endif
+# endif /* SUNOS5SIGS */
# if defined(MSWIN32) || defined(MSWINCE)
LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info)
@@ -2158,7 +2384,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
STATUS_ACCESS_VIOLATION)
# define CODE_OK (exc_info -> ExceptionRecord -> ExceptionInformation[0] == 1)
/* Write fault */
-# endif
+# endif /* MSWIN32 || MSWINCE */
{
register unsigned i;
# if defined(HURD)
@@ -2218,16 +2444,17 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
# if defined(POWERPC)
char * addr = (char *) (sc.regs->dar);
# else
- --> architecture not supported
+# if defined(ARM32)
+ char * addr = (char *)sc.fault_address;
+# else
+ --> architecture not supported
+# endif
# endif
# endif
# endif
# endif
# endif
# endif
-# if defined(MACOSX)
- char * addr = get_fault_addr(scp);
-# endif
# if defined(MSWIN32) || defined(MSWINCE)
char * addr = (char *) (exc_info -> ExceptionRecord
-> ExceptionInformation[1]);
@@ -2291,9 +2518,6 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
(*(REAL_SIG_PF)old_handler) (sig, code, scp);
return;
# endif
-# ifdef MACOSX
- (*(REAL_SIG_PF)old_handler) (sig, code, scp);
-# endif
# ifdef MSWIN32
return((*old_handler)(exc_info));
# endif
@@ -2335,10 +2559,11 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
ABORT("Unexpected bus error or segmentation fault");
#endif
}
+#endif /* !DARWIN */
/*
* We hold the allocation lock. We expect block h to be written
- * shortly. Ensure that all pages cvontaining any part of the n hblks
+ * shortly. Ensure that all pages containing any part of the n hblks
* starting at h are no longer protected. If is_ptrfree is false,
* also ensure that they will subsequently appear to be dirty.
*/
@@ -2367,6 +2592,7 @@ GC_bool is_ptrfree;
UNPROTECT(h_trunc, (ptr_t)h_end - (ptr_t)h_trunc);
}
+#if !defined(DARWIN)
void GC_dirty_init()
{
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(LINUX) || \
@@ -2389,13 +2615,6 @@ void GC_dirty_init()
(void)sigaddset(&act.sa_mask, SIG_SUSPEND);
# endif /* SIG_SUSPEND */
# endif
-# if defined(MACOSX)
- struct sigaction act, oldact;
-
- act.sa_flags = SA_RESTART;
- act.sa_handler = GC_write_fault_handler;
- sigemptyset(&act.sa_mask);
-# endif
# ifdef PRINTSTATS
GC_printf0("Inititalizing mprotect virtual dirty bit implementation\n");
# endif
@@ -2435,9 +2654,12 @@ void GC_dirty_init()
sigaction(SIGSEGV, 0, &oldact);
sigaction(SIGSEGV, &act, 0);
# else
- sigaction(SIGSEGV, &act, &oldact);
+ {
+ int res = sigaction(SIGSEGV, &act, &oldact);
+ if (res != 0) ABORT("Sigaction failed");
+ }
# endif
-# if defined(_sigargs) || defined(HURD)
+# if defined(_sigargs) || defined(HURD) || !defined(SA_SIGINFO)
/* This is Irix 5.x, not 6.x. Irix 5.x does not have */
/* sa_sigaction. */
GC_old_segv_handler = oldact.sa_handler;
@@ -2458,7 +2680,7 @@ void GC_dirty_init()
# endif
}
# endif
-# if defined(MACOSX) || defined(HPUX) || defined(LINUX) || defined(HURD)
+# if defined(HPUX) || defined(LINUX) || defined(HURD)
sigaction(SIGBUS, &act, &oldact);
GC_old_bus_handler = oldact.sa_handler;
if (GC_old_bus_handler == SIG_IGN) {
@@ -2470,7 +2692,7 @@ void GC_dirty_init()
GC_err_printf0("Replaced other SIGBUS handler\n");
# endif
}
-# endif /* MACOS || HPUX || LINUX */
+# endif /* HPUX || LINUX || HURD */
# if defined(MSWIN32)
GC_old_segv_handler = SetUnhandledExceptionFilter(GC_write_fault_handler);
if (GC_old_segv_handler != NULL) {
@@ -2482,6 +2704,7 @@ void GC_dirty_init()
}
# endif
}
+#endif /* !DARWIN */
int GC_incremental_protection_needs()
{
@@ -2628,15 +2851,23 @@ word len;
((ptr_t)end_block - (ptr_t)start_block) + HBLKSIZE);
}
-#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(THREADS) \
- && !defined(GC_USE_LD_WRAP)
-/* Replacement for UNIX system call. */
-/* Other calls that write to the heap should be handled similarly. */
-/* Note that this doesn't work well for blocking reads: It will hold */
-/* tha allocation lock for the entur duration of the call. Multithreaded */
-/* clients should really ensure that it won't block, either by setting */
-/* the descriptor nonblocking, or by calling select or poll first, to */
-/* make sure that input is available. */
+#if 0
+
+/* We no longer wrap read by default, since that was causing too many */
+/* problems. It is preferred that the client instead avoids writing */
+/* to the write-protected heap with a system call. */
+/* This still serves as sample code if you do want to wrap system calls.*/
+
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(GC_USE_LD_WRAP)
+/* Replacement for UNIX system call. */
+/* Other calls that write to the heap should be handled similarly. */
+/* Note that this doesn't work well for blocking reads: It will hold */
+/* the allocation lock for the entire duration of the call. Multithreaded */
+/* clients should really ensure that it won't block, either by setting */
+/* the descriptor nonblocking, or by calling select or poll first, to */
+/* make sure that input is available. */
+/* Another, preferred alternative is to ensure that system calls never */
+/* write to the protected heap (see above). */
# if defined(__STDC__) && !defined(SUNOS4)
# include <unistd.h>
# include <sys/uio.h>
@@ -2706,6 +2937,8 @@ word len;
/* actually calls. */
#endif
+#endif /* 0 */
+
/*ARGSUSED*/
GC_bool GC_page_was_ever_dirty(h)
struct hblk *h;
@@ -2721,13 +2954,6 @@ word n;
{
}
-# else /* !MPROTECT_VDB */
-
-# ifdef GC_USE_LD_WRAP
- ssize_t __wrap_read(int fd, void *buf, size_t nbyte)
- { return __real_read(fd, buf, nbyte); }
-# endif
-
# endif /* MPROTECT_VDB */
# ifdef PROC_VDB
@@ -2806,6 +3032,7 @@ void GC_dirty_init()
}
GC_proc_fd = syscall(SYS_ioctl, fd, PIOCOPENPD, 0);
close(fd);
+ syscall(SYS_fcntl, GC_proc_fd, F_SETFD, FD_CLOEXEC);
if (GC_proc_fd < 0) {
ABORT("/proc ioctl failed");
}
@@ -3045,6 +3272,552 @@ GC_bool is_ptrfree;
# endif /* PCR_VDB */
+#if defined(MPROTECT_VDB) && defined(DARWIN)
+/* The following sources were used as a *reference* for this exception handling
+ code:
+ 1. Apple's mach/xnu documentation
+ 2. Timothy J. Wood's "Mach Exception Handlers 101" post to the
+ omnigroup's macosx-dev list.
+ www.omnigroup.com/mailman/archive/macosx-dev/2000-June/002030.html
+ 3. macosx-nat.c from Apple's GDB source code.
+*/
+
+/* The bug that caused all this trouble should now be fixed. This should
+ eventually be removed if all goes well. */
+/* define BROKEN_EXCEPTION_HANDLING */
+
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+
+/* These are not defined in any header, although they are documented */
+extern boolean_t exc_server(mach_msg_header_t *,mach_msg_header_t *);
+extern kern_return_t exception_raise(
+ mach_port_t,mach_port_t,mach_port_t,
+ exception_type_t,exception_data_t,mach_msg_type_number_t);
+extern kern_return_t exception_raise_state(
+ mach_port_t,mach_port_t,mach_port_t,
+ exception_type_t,exception_data_t,mach_msg_type_number_t,
+ thread_state_flavor_t*,thread_state_t,mach_msg_type_number_t,
+ thread_state_t,mach_msg_type_number_t*);
+extern kern_return_t exception_raise_state_identity(
+ mach_port_t,mach_port_t,mach_port_t,
+ exception_type_t,exception_data_t,mach_msg_type_number_t,
+ thread_state_flavor_t*,thread_state_t,mach_msg_type_number_t,
+ thread_state_t,mach_msg_type_number_t*);
+
+
+#define MAX_EXCEPTION_PORTS 16
+
+static mach_port_t GC_task_self;
+
+static struct {
+ mach_msg_type_number_t count;
+ exception_mask_t masks[MAX_EXCEPTION_PORTS];
+ exception_handler_t ports[MAX_EXCEPTION_PORTS];
+ exception_behavior_t behaviors[MAX_EXCEPTION_PORTS];
+ thread_state_flavor_t flavors[MAX_EXCEPTION_PORTS];
+} GC_old_exc_ports;
+
+static struct {
+ mach_port_t exception;
+#if defined(THREADS)
+ mach_port_t reply;
+#endif
+} GC_ports;
+
+typedef struct {
+ mach_msg_header_t head;
+} GC_msg_t;
+
+typedef enum {
+ GC_MP_NORMAL, GC_MP_DISCARDING, GC_MP_STOPPED
+} GC_mprotect_state_t;
+
+/* FIXME: 1 and 2 seem to be safe to use in the msgh_id field,
+ but it isn't documented. Use the source and see if they
+ should be ok. */
+#define ID_STOP 1
+#define ID_RESUME 2
+
+/* These values are only used on the reply port */
+#define ID_ACK 3
+
+#if defined(THREADS)
+
+GC_mprotect_state_t GC_mprotect_state;
+
+/* The following should ONLY be called when the world is stopped */
+static void GC_mprotect_thread_notify(mach_msg_id_t id) {
+ struct {
+ GC_msg_t msg;
+ mach_msg_trailer_t trailer;
+ } buf;
+ mach_msg_return_t r;
+ /* remote, local */
+ buf.msg.head.msgh_bits =
+ MACH_MSGH_BITS(MACH_MSG_TYPE_MAKE_SEND,0);
+ buf.msg.head.msgh_size = sizeof(buf.msg);
+ buf.msg.head.msgh_remote_port = GC_ports.exception;
+ buf.msg.head.msgh_local_port = MACH_PORT_NULL;
+ buf.msg.head.msgh_id = id;
+
+ r = mach_msg(
+ &buf.msg.head,
+ MACH_SEND_MSG|MACH_RCV_MSG|MACH_RCV_LARGE,
+ sizeof(buf.msg),
+ sizeof(buf),
+ GC_ports.reply,
+ MACH_MSG_TIMEOUT_NONE,
+ MACH_PORT_NULL);
+ if(r != MACH_MSG_SUCCESS)
+ ABORT("mach_msg failed in GC_mprotect_thread_notify");
+ if(buf.msg.head.msgh_id != ID_ACK)
+ ABORT("invalid ack in GC_mprotect_thread_notify");
+}
+
+/* Should only be called by the mprotect thread */
+static void GC_mprotect_thread_reply() {
+ GC_msg_t msg;
+ mach_msg_return_t r;
+ /* remote, local */
+ msg.head.msgh_bits =
+ MACH_MSGH_BITS(MACH_MSG_TYPE_MAKE_SEND,0);
+ msg.head.msgh_size = sizeof(msg);
+ msg.head.msgh_remote_port = GC_ports.reply;
+ msg.head.msgh_local_port = MACH_PORT_NULL;
+ msg.head.msgh_id = ID_ACK;
+
+ r = mach_msg(
+ &msg.head,
+ MACH_SEND_MSG,
+ sizeof(msg),
+ 0,
+ MACH_PORT_NULL,
+ MACH_MSG_TIMEOUT_NONE,
+ MACH_PORT_NULL);
+ if(r != MACH_MSG_SUCCESS)
+ ABORT("mach_msg failed in GC_mprotect_thread_reply");
+}
+
+void GC_mprotect_stop() {
+ GC_mprotect_thread_notify(ID_STOP);
+}
+void GC_mprotect_resume() {
+ GC_mprotect_thread_notify(ID_RESUME);
+}
+
+#else /* !THREADS */
+/* The compiler should optimize away any GC_mprotect_state computations */
+#define GC_mprotect_state GC_MP_NORMAL
+#endif
+
+static void *GC_mprotect_thread(void *arg) {
+ mach_msg_return_t r;
+ /* These two structures contain some private kernel data. We don't need to
+ access any of it so we don't bother defining a proper struct. The
+ correct definitions are in the xnu source code. */
+ struct {
+ mach_msg_header_t head;
+ char data[256];
+ } reply;
+ struct {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+ } msg;
+
+ mach_msg_id_t id;
+
+ for(;;) {
+ r = mach_msg(
+ &msg.head,
+ MACH_RCV_MSG|MACH_RCV_LARGE|
+ (GC_mprotect_state == GC_MP_DISCARDING ? MACH_RCV_TIMEOUT : 0),
+ 0,
+ sizeof(msg),
+ GC_ports.exception,
+ GC_mprotect_state == GC_MP_DISCARDING ? 0 : MACH_MSG_TIMEOUT_NONE,
+ MACH_PORT_NULL);
+
+ id = r == MACH_MSG_SUCCESS ? msg.head.msgh_id : -1;
+
+#if defined(THREADS)
+ if(GC_mprotect_state == GC_MP_DISCARDING) {
+ if(r == MACH_RCV_TIMED_OUT) {
+ GC_mprotect_state = GC_MP_STOPPED;
+ GC_mprotect_thread_reply();
+ continue;
+ }
+ if(r == MACH_MSG_SUCCESS && (id == ID_STOP || id == ID_RESUME))
+ ABORT("out of order mprotect thread request");
+ }
+#endif
+
+ if(r != MACH_MSG_SUCCESS) {
+ GC_err_printf2("mach_msg failed with %d %s\n",
+ (int)r,mach_error_string(r));
+ ABORT("mach_msg failed");
+ }
+
+ switch(id) {
+#if defined(THREADS)
+ case ID_STOP:
+ if(GC_mprotect_state != GC_MP_NORMAL)
+ ABORT("Called mprotect_stop when state wasn't normal");
+ GC_mprotect_state = GC_MP_DISCARDING;
+ break;
+ case ID_RESUME:
+ if(GC_mprotect_state != GC_MP_STOPPED)
+ ABORT("Called mprotect_resume when state wasn't stopped");
+ GC_mprotect_state = GC_MP_NORMAL;
+ GC_mprotect_thread_reply();
+ break;
+#endif /* THREADS */
+ default:
+ /* Handle the message (calls catch_exception_raise) */
+ if(!exc_server(&msg.head,&reply.head))
+ ABORT("exc_server failed");
+ /* Send the reply */
+ r = mach_msg(
+ &reply.head,
+ MACH_SEND_MSG,
+ reply.head.msgh_size,
+ 0,
+ MACH_PORT_NULL,
+ MACH_MSG_TIMEOUT_NONE,
+ MACH_PORT_NULL);
+ if(r != MACH_MSG_SUCCESS) {
+ /* This will fail if the thread dies, but the thread shouldn't
+ die... */
+ #ifdef BROKEN_EXCEPTION_HANDLING
+ GC_err_printf2(
+ "mach_msg failed with %d %s while sending exc reply\n",
+ (int)r,mach_error_string(r));
+ #else
+ ABORT("mach_msg failed while sending exception reply");
+ #endif
+ }
+ } /* switch */
+ } /* for(;;) */
+ /* NOT REACHED */
+ return NULL;
+}
+
+/* All this SIGBUS code shouldn't be necessary. All protection faults should
+ be going throught the mach exception handler. However, it seems a SIGBUS is
+ occasionally sent for some unknown reason. Even more odd, it seems to be
+ meaningless and safe to ignore. */
+#ifdef BROKEN_EXCEPTION_HANDLING
+
+typedef void (* SIG_PF)();
+static SIG_PF GC_old_bus_handler;
+
+/* Updates to this aren't atomic, but the SIGBUSs seem pretty rare.
+ Even if this doesn't get updated property, it isn't really a problem */
+static int GC_sigbus_count;
+
+static void GC_darwin_sigbus(int num,siginfo_t *sip,void *context) {
+ if(num != SIGBUS) ABORT("Got a non-sigbus signal in the sigbus handler");
+
+ /* Ugh... some seem safe to ignore, but too many in a row probably means
+ trouble. GC_sigbus_count is reset for each mach exception that is
+ handled */
+ if(GC_sigbus_count >= 8) {
+ ABORT("Got more than 8 SIGBUSs in a row!");
+ } else {
+ GC_sigbus_count++;
+ GC_err_printf0("GC: WARNING: Ignoring SIGBUS.\n");
+ }
+}
+#endif /* BROKEN_EXCEPTION_HANDLING */
+
+void GC_dirty_init() {
+ kern_return_t r;
+ mach_port_t me;
+ pthread_t thread;
+ pthread_attr_t attr;
+ exception_mask_t mask;
+
+# ifdef PRINTSTATS
+ GC_printf0("Inititalizing mach/darwin mprotect virtual dirty bit "
+ "implementation\n");
+# endif
+# ifdef BROKEN_EXCEPTION_HANDLING
+ GC_err_printf0("GC: WARNING: Enabling workarounds for various darwin "
+ "exception handling bugs.\n");
+# endif
+ GC_dirty_maintained = TRUE;
+ if (GC_page_size % HBLKSIZE != 0) {
+ GC_err_printf0("Page size not multiple of HBLKSIZE\n");
+ ABORT("Page size not multiple of HBLKSIZE");
+ }
+
+ GC_task_self = me = mach_task_self();
+
+ r = mach_port_allocate(me,MACH_PORT_RIGHT_RECEIVE,&GC_ports.exception);
+ if(r != KERN_SUCCESS) ABORT("mach_port_allocate failed (exception port)");
+
+ r = mach_port_insert_right(me,GC_ports.exception,GC_ports.exception,
+ MACH_MSG_TYPE_MAKE_SEND);
+ if(r != KERN_SUCCESS)
+ ABORT("mach_port_insert_right failed (exception port)");
+
+ #if defined(THREADS)
+ r = mach_port_allocate(me,MACH_PORT_RIGHT_RECEIVE,&GC_ports.reply);
+ if(r != KERN_SUCCESS) ABORT("mach_port_allocate failed (reply port)");
+ #endif
+
+ /* The exceptions we want to catch */
+ mask = EXC_MASK_BAD_ACCESS;
+
+ r = task_get_exception_ports(
+ me,
+ mask,
+ GC_old_exc_ports.masks,
+ &GC_old_exc_ports.count,
+ GC_old_exc_ports.ports,
+ GC_old_exc_ports.behaviors,
+ GC_old_exc_ports.flavors
+ );
+ if(r != KERN_SUCCESS) ABORT("task_get_exception_ports failed");
+
+ r = task_set_exception_ports(
+ me,
+ mask,
+ GC_ports.exception,
+ EXCEPTION_DEFAULT,
+ MACHINE_THREAD_STATE
+ );
+ if(r != KERN_SUCCESS) ABORT("task_set_exception_ports failed");
+
+ if(pthread_attr_init(&attr) != 0) ABORT("pthread_attr_init failed");
+ if(pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED) != 0)
+ ABORT("pthread_attr_setdetachedstate failed");
+
+# undef pthread_create
+ /* This will call the real pthread function, not our wrapper */
+ if(pthread_create(&thread,&attr,GC_mprotect_thread,NULL) != 0)
+ ABORT("pthread_create failed");
+ pthread_attr_destroy(&attr);
+
+ /* Setup the sigbus handler for ignoring the meaningless SIGBUSs */
+ #ifdef BROKEN_EXCEPTION_HANDLING
+ {
+ struct sigaction sa, oldsa;
+ sa.sa_handler = (SIG_PF)GC_darwin_sigbus;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_RESTART|SA_SIGINFO;
+ if(sigaction(SIGBUS,&sa,&oldsa) < 0) ABORT("sigaction");
+ GC_old_bus_handler = (SIG_PF)oldsa.sa_handler;
+ if (GC_old_bus_handler != SIG_DFL) {
+# ifdef PRINTSTATS
+ GC_err_printf0("Replaced other SIGBUS handler\n");
+# endif
+ }
+ }
+ #endif /* BROKEN_EXCEPTION_HANDLING */
+}
+
+/* The source code for Apple's GDB was used as a reference for the exception
+ forwarding code. This code is similar to be GDB code only because there is
+ only one way to do it. */
+static kern_return_t GC_forward_exception(
+ mach_port_t thread,
+ mach_port_t task,
+ exception_type_t exception,
+ exception_data_t data,
+ mach_msg_type_number_t data_count
+) {
+ int i;
+ kern_return_t r;
+ mach_port_t port;
+ exception_behavior_t behavior;
+ thread_state_flavor_t flavor;
+
+ thread_state_data_t thread_state;
+ mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
+
+ for(i=0;i<GC_old_exc_ports.count;i++)
+ if(GC_old_exc_ports.masks[i] & (1 << exception))
+ break;
+ if(i==GC_old_exc_ports.count) ABORT("No handler for exception!");
+
+ port = GC_old_exc_ports.ports[i];
+ behavior = GC_old_exc_ports.behaviors[i];
+ flavor = GC_old_exc_ports.flavors[i];
+
+ if(behavior != EXCEPTION_DEFAULT) {
+ r = thread_get_state(thread,flavor,thread_state,&thread_state_count);
+ if(r != KERN_SUCCESS)
+ ABORT("thread_get_state failed in forward_exception");
+ }
+
+ switch(behavior) {
+ case EXCEPTION_DEFAULT:
+ r = exception_raise(port,thread,task,exception,data,data_count);
+ break;
+ case EXCEPTION_STATE:
+ r = exception_raise_state(port,thread,task,exception,data,
+ data_count,&flavor,thread_state,thread_state_count,
+ thread_state,&thread_state_count);
+ break;
+ case EXCEPTION_STATE_IDENTITY:
+ r = exception_raise_state_identity(port,thread,task,exception,data,
+ data_count,&flavor,thread_state,thread_state_count,
+ thread_state,&thread_state_count);
+ break;
+ default:
+ r = KERN_FAILURE; /* make gcc happy */
+ ABORT("forward_exception: unknown behavior");
+ break;
+ }
+
+ if(behavior != EXCEPTION_DEFAULT) {
+ r = thread_set_state(thread,flavor,thread_state,thread_state_count);
+ if(r != KERN_SUCCESS)
+ ABORT("thread_set_state failed in forward_exception");
+ }
+
+ return r;
+}
+
+#define FWD() GC_forward_exception(thread,task,exception,code,code_count)
+
+/* This violates the namespace rules but there isn't anything that can be done
+ about it. The exception handling stuff is hard coded to call this */
+kern_return_t
+catch_exception_raise(
+ mach_port_t exception_port,mach_port_t thread,mach_port_t task,
+ exception_type_t exception,exception_data_t code,
+ mach_msg_type_number_t code_count
+) {
+ kern_return_t r;
+ char *addr;
+ struct hblk *h;
+ int i;
+#ifdef POWERPC
+ thread_state_flavor_t flavor = PPC_EXCEPTION_STATE;
+ mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE_COUNT;
+ ppc_exception_state_t exc_state;
+#else
+# error FIXME for non-ppc darwin
+#endif
+
+
+ if(exception != EXC_BAD_ACCESS || code[0] != KERN_PROTECTION_FAILURE) {
+ #ifdef DEBUG_EXCEPTION_HANDLING
+ /* We aren't interested, pass it on to the old handler */
+ GC_printf3("Exception: 0x%x Code: 0x%x 0x%x in catch....\n",
+ exception,
+ code_count > 0 ? code[0] : -1,
+ code_count > 1 ? code[1] : -1);
+ #endif
+ return FWD();
+ }
+
+ r = thread_get_state(thread,flavor,
+ (natural_t*)&exc_state,&exc_state_count);
+ if(r != KERN_SUCCESS) {
+ /* The thread is supposed to be suspended while the exception handler
+ is called. This shouldn't fail. */
+ #ifdef BROKEN_EXCEPTION_HANDLING
+ GC_err_printf0("thread_get_state failed in "
+ "catch_exception_raise\n");
+ return KERN_SUCCESS;
+ #else
+ ABORT("thread_get_state failed in catch_exception_raise");
+ #endif
+ }
+
+ /* This is the address that caused the fault */
+ addr = (char*) exc_state.dar;
+
+ if((HDR(addr)) == 0) {
+ /* Ugh... just like the SIGBUS problem above, it seems we get a bogus
+ KERN_PROTECTION_FAILURE every once and a while. We wait till we get
+ a bunch in a row before doing anything about it. If a "real" fault
+ ever occurres it'll just keep faulting over and over and we'll hit
+ the limit pretty quickly. */
+ #ifdef BROKEN_EXCEPTION_HANDLING
+ static char *last_fault;
+ static int last_fault_count;
+
+ if(addr != last_fault) {
+ last_fault = addr;
+ last_fault_count = 0;
+ }
+ if(++last_fault_count < 32) {
+ if(last_fault_count == 1)
+ GC_err_printf1(
+ "GC: WARNING: Ignoring KERN_PROTECTION_FAILURE at %p\n",
+ addr);
+ return KERN_SUCCESS;
+ }
+
+ GC_err_printf1("Unexpected KERN_PROTECTION_FAILURE at %p\n",addr);
+ /* Can't pass it along to the signal handler because that is
+ ignoring SIGBUS signals. We also shouldn't call ABORT here as
+ signals don't always work too well from the exception handler. */
+ GC_err_printf0("Aborting\n");
+ exit(EXIT_FAILURE);
+ #else /* BROKEN_EXCEPTION_HANDLING */
+ /* Pass it along to the next exception handler
+ (which should call SIGBUS/SIGSEGV) */
+ return FWD();
+ #endif /* !BROKEN_EXCEPTION_HANDLING */
+ }
+
+ #ifdef BROKEN_EXCEPTION_HANDLING
+ /* Reset the number of consecutive SIGBUSs */
+ GC_sigbus_count = 0;
+ #endif
+
+ if(GC_mprotect_state == GC_MP_NORMAL) { /* common case */
+ h = (struct hblk*)((word)addr & ~(GC_page_size-1));
+ UNPROTECT(h, GC_page_size);
+ for (i = 0; i < divHBLKSZ(GC_page_size); i++) {
+ register int index = PHT_HASH(h+i);
+ async_set_pht_entry_from_index(GC_dirty_pages, index);
+ }
+ } else if(GC_mprotect_state == GC_MP_DISCARDING) {
+ /* Lie to the thread for now. No sense UNPROTECT()ing the memory
+ when we're just going to PROTECT() it again later. The thread
+ will just fault again once it resumes */
+ } else {
+ /* Shouldn't happen, i don't think */
+ GC_printf0("KERN_PROTECTION_FAILURE while world is stopped\n");
+ return FWD();
+ }
+ return KERN_SUCCESS;
+}
+#undef FWD
+
+/* These should never be called, but just in case... */
+kern_return_t catch_exception_raise_state(mach_port_name_t exception_port,
+ int exception, exception_data_t code, mach_msg_type_number_t codeCnt,
+ int flavor, thread_state_t old_state, int old_stateCnt,
+ thread_state_t new_state, int new_stateCnt)
+{
+ ABORT("catch_exception_raise_state");
+ return(KERN_INVALID_ARGUMENT);
+}
+kern_return_t catch_exception_raise_state_identity(
+ mach_port_name_t exception_port, mach_port_t thread, mach_port_t task,
+ int exception, exception_data_t code, mach_msg_type_number_t codeCnt,
+ int flavor, thread_state_t old_state, int old_stateCnt,
+ thread_state_t new_state, int new_stateCnt)
+{
+ ABORT("catch_exception_raise_state_identity");
+ return(KERN_INVALID_ARGUMENT);
+}
+
+
+#endif /* DARWIN && MPROTECT_VDB */
+
# ifndef HAVE_INCREMENTAL_PROTECTION_NEEDS
int GC_incremental_protection_needs()
{
@@ -3105,19 +3878,20 @@ GC_bool is_ptrfree;
# endif
#endif /* SPARC */
-#ifdef SAVE_CALL_CHAIN
+#ifdef NEED_CALLINFO
/* Fill in the pc and argument information for up to NFRAMES of my */
/* callers. Ignore my frame and my callers frame. */
#ifdef LINUX
-# include <features.h>
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2
-# define HAVE_BUILTIN_BACKTRACE
-# endif
+# include <unistd.h>
#endif
+#endif /* NEED_CALLINFO */
+
+#ifdef SAVE_CALL_CHAIN
+
#if NARGS == 0 && NFRAMES % 2 == 0 /* No padding */ \
- && defined(HAVE_BUILTIN_BACKTRACE)
+ && defined(GC_HAVE_BUILTIN_BACKTRACE)
#include <execinfo.h>
@@ -3163,8 +3937,6 @@ struct callinfo info[NFRAMES];
asm("movl %%ebp,%0" : "=r"(frame));
fp = frame;
# else
- word GC_save_regs_in_stack();
-
frame = (struct frame *) GC_save_regs_in_stack ();
fp = (struct frame *)((long) frame -> FR_SAVFP + BIAS);
#endif
@@ -3188,31 +3960,139 @@ struct callinfo info[NFRAMES];
#endif /* SAVE_CALL_CHAIN */
-#if defined(LINUX) && defined(__ELF__) && \
- (!defined(SMALL_CONFIG) || defined(USE_PROC_FOR_LIBRARIES))
-#ifdef GC_USE_LD_WRAP
-# define READ __real_read
-#else
-# define READ read
-#endif
+#ifdef NEED_CALLINFO
-
-/* Repeatedly perform a read call until the buffer is filled or */
-/* we encounter EOF. */
-ssize_t GC_repeat_read(int fd, char *buf, size_t count)
+/* Print info to stderr. We do NOT hold the allocation lock */
+void GC_print_callers (info)
+struct callinfo info[NFRAMES];
{
- ssize_t num_read = 0;
- ssize_t result;
+ register int i;
+ static int reentry_count = 0;
+ GC_bool stop = FALSE;
+
+ LOCK();
+ ++reentry_count;
+ UNLOCK();
- while (num_read < count) {
- result = READ(fd, buf + num_read, count - num_read);
- if (result < 0) return result;
- if (result == 0) break;
- num_read += result;
+# if NFRAMES == 1
+ GC_err_printf0("\tCaller at allocation:\n");
+# else
+ GC_err_printf0("\tCall chain at allocation:\n");
+# endif
+ for (i = 0; i < NFRAMES && !stop ; i++) {
+ if (info[i].ci_pc == 0) break;
+# if NARGS > 0
+ {
+ int j;
+
+ GC_err_printf0("\t\targs: ");
+ for (j = 0; j < NARGS; j++) {
+ if (j != 0) GC_err_printf0(", ");
+ GC_err_printf2("%d (0x%X)", ~(info[i].ci_arg[j]),
+ ~(info[i].ci_arg[j]));
+ }
+ GC_err_printf0("\n");
+ }
+# endif
+ if (reentry_count > 1) {
+ /* We were called during an allocation during */
+ /* a previous GC_print_callers call; punt. */
+ GC_err_printf1("\t\t##PC##= 0x%lx\n", info[i].ci_pc);
+ continue;
+ }
+ {
+# ifdef LINUX
+ FILE *pipe;
+# endif
+# if defined(GC_HAVE_BUILTIN_BACKTRACE)
+ char **sym_name =
+ backtrace_symbols((void **)(&(info[i].ci_pc)), 1);
+ char *name = sym_name[0];
+# else
+ char buf[40];
+ char *name = buf;
+ sprintf(buf, "##PC##= 0x%lx", info[i].ci_pc);
+# endif
+# if defined(LINUX) && !defined(SMALL_CONFIG)
+ /* Try for a line number. */
+ {
+# define EXE_SZ 100
+ static char exe_name[EXE_SZ];
+# define CMD_SZ 200
+ char cmd_buf[CMD_SZ];
+# define RESULT_SZ 200
+ static char result_buf[RESULT_SZ];
+ size_t result_len;
+ static GC_bool found_exe_name = FALSE;
+ static GC_bool will_fail = FALSE;
+ int ret_code;
+ /* Try to get it via a hairy and expensive scheme. */
+ /* First we get the name of the executable: */
+ if (will_fail) goto out;
+ if (!found_exe_name) {
+ ret_code = readlink("/proc/self/exe", exe_name, EXE_SZ);
+ if (ret_code < 0 || ret_code >= EXE_SZ
+ || exe_name[0] != '/') {
+ will_fail = TRUE; /* Dont try again. */
+ goto out;
+ }
+ exe_name[ret_code] = '\0';
+ found_exe_name = TRUE;
+ }
+ /* Then we use popen to start addr2line -e <exe> <addr> */
+ /* There are faster ways to do this, but hopefully this */
+ /* isn't time critical. */
+ sprintf(cmd_buf, "/usr/bin/addr2line -f -e %s 0x%lx", exe_name,
+ (unsigned long)info[i].ci_pc);
+ pipe = popen(cmd_buf, "r");
+ if (pipe == NULL
+ || (result_len = fread(result_buf, 1, RESULT_SZ - 1, pipe))
+ == 0) {
+ if (pipe != NULL) pclose(pipe);
+ will_fail = TRUE;
+ goto out;
+ }
+ if (result_buf[result_len - 1] == '\n') --result_len;
+ result_buf[result_len] = 0;
+ if (result_buf[0] == '?'
+ || result_buf[result_len-2] == ':'
+ && result_buf[result_len-1] == '0') {
+ pclose(pipe);
+ goto out;
+ }
+ /* Get rid of embedded newline, if any. Test for "main" */
+ {
+ char * nl = strchr(result_buf, '\n');
+ if (nl != NULL && nl < result_buf + result_len) {
+ *nl = ':';
+ }
+ if (strncmp(result_buf, "main", nl - result_buf) == 0) {
+ stop = TRUE;
+ }
+ }
+ if (result_len < RESULT_SZ - 25) {
+ /* Add in hex address */
+ sprintf(result_buf + result_len, " [0x%lx]",
+ (unsigned long)info[i].ci_pc);
+ }
+ name = result_buf;
+ pclose(pipe);
+ out:;
+ }
+# endif /* LINUX */
+ GC_err_printf1("\t\t%s\n", name);
+# if defined(GC_HAVE_BUILTIN_BACKTRACE)
+ free(sym_name); /* May call GC_free; that's OK */
+# endif
+ }
}
- return num_read;
+ LOCK();
+ --reentry_count;
+ UNLOCK();
}
-#endif /* LINUX && ... */
+
+#endif /* NEED_CALLINFO */
+
#if defined(LINUX) && defined(__ELF__) && !defined(SMALL_CONFIG)
@@ -3220,20 +4100,16 @@ ssize_t GC_repeat_read(int fd, char *buf, size_t count)
/* Dump /proc/self/maps to GC_stderr, to enable looking up names for
addresses in FIND_LEAK output. */
+static word dump_maps(char *maps)
+{
+ GC_err_write(maps, strlen(maps));
+ return 1;
+}
+
void GC_print_address_map()
{
- int f;
- int result;
- char maps_temp[32768];
GC_err_printf0("---------- Begin address map ----------\n");
- f = open("/proc/self/maps", O_RDONLY);
- if (-1 == f) ABORT("Couldn't open /proc/self/maps");
- do {
- result = GC_repeat_read(f, maps_temp, sizeof(maps_temp));
- if (result <= 0) ABORT("Couldn't read /proc/self/maps");
- GC_err_write(maps_temp, result);
- } while (result == sizeof(maps_temp));
-
+ GC_apply_to_maps(dump_maps);
GC_err_printf0("---------- End address map ----------\n");
}
diff --git a/boehm-gc/powerpc_darwin_mach_dep.s b/boehm-gc/powerpc_darwin_mach_dep.s
new file mode 100644
index 00000000000..92f2c93ca8d
--- /dev/null
+++ b/boehm-gc/powerpc_darwin_mach_dep.s
@@ -0,0 +1,84 @@
+
+; GC_push_regs function. Under some optimization levels GCC will clobber
+; some of the non-volatile registers before we get a chance to save them
+; therefore, this can't be inline asm.
+
+.text
+ .align 2
+ .globl _GC_push_regs
+_GC_push_regs:
+
+ ; Prolog
+ mflr r0
+ stw r0,8(r1)
+ stwu r1,-80(r1)
+
+ ; Push r13-r31
+ mr r3,r13
+ bl L_GC_push_one$stub
+ mr r3,r14
+ bl L_GC_push_one$stub
+ mr r3,r15
+ bl L_GC_push_one$stub
+ mr r3,r16
+ bl L_GC_push_one$stub
+ mr r3,r17
+ bl L_GC_push_one$stub
+ mr r3,r18
+ bl L_GC_push_one$stub
+ mr r3,r19
+ bl L_GC_push_one$stub
+ mr r3,r20
+ bl L_GC_push_one$stub
+ mr r3,r21
+ bl L_GC_push_one$stub
+ mr r3,r22
+ bl L_GC_push_one$stub
+ mr r3,r23
+ bl L_GC_push_one$stub
+ mr r3,r24
+ bl L_GC_push_one$stub
+ mr r3,r25
+ bl L_GC_push_one$stub
+ mr r3,r26
+ bl L_GC_push_one$stub
+ mr r3,r27
+ bl L_GC_push_one$stub
+ mr r3,r28
+ bl L_GC_push_one$stub
+ mr r3,r29
+ bl L_GC_push_one$stub
+ mr r3,r30
+ bl L_GC_push_one$stub
+ mr r3,r31
+ bl L_GC_push_one$stub
+
+ ;
+ lwz r0,88(r1)
+ addi r1,r1,80
+ mtlr r0
+
+ ; Return
+ blr
+
+; PIC stuff, generated by GCC
+
+.data
+.picsymbol_stub
+L_GC_push_one$stub:
+ .indirect_symbol _GC_push_one
+ mflr r0
+ bcl 20,31,L0$_GC_push_one
+L0$_GC_push_one:
+ mflr r11
+ addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
+ mtlr r0
+ lwz r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
+ mtctr r12
+ addi r11,r11,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
+ bctr
+.data
+.lazy_symbol_pointer
+L_GC_push_one$lazy_ptr:
+ .indirect_symbol _GC_push_one
+ .long dyld_stub_binding_helper
diff --git a/boehm-gc/powerpc_macosx_mach_dep.s b/boehm-gc/powerpc_macosx_mach_dep.s
deleted file mode 100644
index 92f06286e73..00000000000
--- a/boehm-gc/powerpc_macosx_mach_dep.s
+++ /dev/null
@@ -1,95 +0,0 @@
-
-.text
-
- .set linkageArea,24
- .set params,4
- .set alignment,4
-
- .set spaceToSave,linkageArea+params+alignment
- .set spaceToSave8,spaceToSave+8
-
-; Mark from machine registers that are saved by C compiler
- .globl _GC_push_regs
-_GC_push_regs:
- ; PROLOG
- mflr r0 ; get return address
- stw r0,8(r1) ; save return address
- stwu r1,-spaceToSave(r1) ; skip over caller save area
- ;
- mr r3,r2 ; mark from r2. Well Im not really sure
- ; that this is necessary or even the right
- ; thing to do - at least it doesnt harm...
- ; According to Apples docs it points to
- ; the direct data area, whatever that is...
- bl L_GC_push_one$stub
- mr r3,r13 ; mark from r13-r31
- bl L_GC_push_one$stub
- mr r3,r14
- bl L_GC_push_one$stub
- mr r3,r15
- bl L_GC_push_one$stub
- mr r3,r16
- bl L_GC_push_one$stub
- mr r3,r17
- bl L_GC_push_one$stub
- mr r3,r18
- bl L_GC_push_one$stub
- mr r3,r19
- bl L_GC_push_one$stub
- mr r3,r20
- bl L_GC_push_one$stub
- mr r3,r21
- bl L_GC_push_one$stub
- mr r3,r22
- bl L_GC_push_one$stub
- mr r3,r23
- bl L_GC_push_one$stub
- mr r3,r24
- bl L_GC_push_one$stub
- mr r3,r25
- bl L_GC_push_one$stub
- mr r3,r26
- bl L_GC_push_one$stub
- mr r3,r27
- bl L_GC_push_one$stub
- mr r3,r28
- bl L_GC_push_one$stub
- mr r3,r29
- bl L_GC_push_one$stub
- mr r3,r30
- bl L_GC_push_one$stub
- mr r3,r31
- bl L_GC_push_one$stub
- ; EPILOG
- lwz r0,spaceToSave8(r1) ; get return address back
- mtlr r0 ; reset link register
- addic r1,r1,spaceToSave ; restore stack pointer
- blr
-
-.data
-.picsymbol_stub
-L_GC_push_one$stub:
- .indirect_symbol _GC_push_one
- mflr r0
- bcl 20,31,L0$_GC_push_one
-L0$_GC_push_one:
- mflr r11
- addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
- mtlr r0
- lwz r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
- mtctr r12
- addi r11,r11,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
- bctr
-.data
-.lazy_symbol_pointer
-L_GC_push_one$lazy_ptr:
- .indirect_symbol _GC_push_one
- .long dyld_stub_binding_helper
-.non_lazy_symbol_pointer
-L_GC_push_one$non_lazy_ptr:
- .indirect_symbol _GC_push_one
- .long 0
-
-
-
-
diff --git a/boehm-gc/pthread_stop_world.c b/boehm-gc/pthread_stop_world.c
new file mode 100644
index 00000000000..5dfd26d319a
--- /dev/null
+++ b/boehm-gc/pthread_stop_world.c
@@ -0,0 +1,445 @@
+#include "private/pthread_support.h"
+
+#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+ && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
+ && !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS)
+
+#include <signal.h>
+#include <semaphore.h>
+#include <errno.h>
+#include <unistd.h>
+
+#if DEBUG_THREADS
+
+#ifndef NSIG
+# if defined(MAXSIG)
+# define NSIG (MAXSIG+1)
+# elif defined(_NSIG)
+# define NSIG _NSIG
+# elif defined(__SIGRTMAX)
+# define NSIG (__SIGRTMAX+1)
+# else
+ --> please fix it
+# endif
+#endif
+
+void GC_print_sig_mask()
+{
+ sigset_t blocked;
+ int i;
+
+ if (pthread_sigmask(SIG_BLOCK, NULL, &blocked) != 0)
+ ABORT("pthread_sigmask");
+ GC_printf0("Blocked: ");
+ for (i = 1; i < NSIG; i++) {
+ if (sigismember(&blocked, i)) { GC_printf1("%ld ",(long) i); }
+ }
+ GC_printf0("\n");
+}
+
+#endif
+
+word GC_stop_count; /* Incremented at the beginning of GC_stop_world. */
+
+#ifdef GC_OSF1_THREADS
+ GC_bool GC_retry_signals = TRUE;
+#else
+ GC_bool GC_retry_signals = FALSE;
+#endif
+
+/*
+ * We use signals to stop threads during GC.
+ *
+ * Suspended threads wait in signal handler for SIG_THR_RESTART.
+ * That's more portable than semaphores or condition variables.
+ * (We do use sem_post from a signal handler, but that should be portable.)
+ *
+ * The thread suspension signal SIG_SUSPEND is now defined in gc_priv.h.
+ * Note that we can't just stop a thread; we need it to save its stack
+ * pointer(s) and acknowledge.
+ */
+
+#ifndef SIG_THR_RESTART
+# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
+# ifdef _SIGRTMIN
+# define SIG_THR_RESTART _SIGRTMIN + 5
+# else
+# define SIG_THR_RESTART SIGRTMIN + 5
+# endif
+# else
+# define SIG_THR_RESTART SIGXCPU
+# endif
+#endif
+
+sem_t GC_suspend_ack_sem;
+
+void GC_suspend_handler(int sig)
+{
+ int dummy;
+ pthread_t my_thread = pthread_self();
+ GC_thread me;
+ sigset_t mask;
+# ifdef PARALLEL_MARK
+ word my_mark_no = GC_mark_no;
+ /* Marker can't proceed until we acknowledge. Thus this is */
+ /* guaranteed to be the mark_no correspending to our */
+ /* suspension, i.e. the marker can't have incremented it yet. */
+# endif
+ word my_stop_count = GC_stop_count;
+
+ if (sig != SIG_SUSPEND) ABORT("Bad signal in suspend_handler");
+
+#if DEBUG_THREADS
+ GC_printf1("Suspending 0x%lx\n", my_thread);
+#endif
+
+ me = GC_lookup_thread(my_thread);
+ /* The lookup here is safe, since I'm doing this on behalf */
+ /* of a thread which holds the allocation lock in order */
+ /* to stop the world. Thus concurrent modification of the */
+ /* data structure is impossible. */
+ if (me -> stop_info.last_stop_count == my_stop_count) {
+ /* Duplicate signal. OK if we are retrying. */
+ if (!GC_retry_signals) {
+ WARN("Duplicate suspend signal in thread %lx\n",
+ pthread_self());
+ }
+ return;
+ }
+# ifdef SPARC
+ me -> stop_info.stack_ptr = (ptr_t)GC_save_regs_in_stack();
+# else
+ me -> stop_info.stack_ptr = (ptr_t)(&dummy);
+# endif
+# ifdef IA64
+ me -> backing_store_ptr = (ptr_t)GC_save_regs_in_stack();
+# endif
+
+ /* Tell the thread that wants to stop the world that this */
+ /* thread has been stopped. Note that sem_post() is */
+ /* the only async-signal-safe primitive in LinuxThreads. */
+ sem_post(&GC_suspend_ack_sem);
+ me -> stop_info.last_stop_count = my_stop_count;
+
+ /* Wait until that thread tells us to restart by sending */
+ /* this thread a SIG_THR_RESTART signal. */
+ /* SIG_THR_RESTART should be masked at this point. Thus there */
+ /* is no race. */
+ if (sigfillset(&mask) != 0) ABORT("sigfillset() failed");
+ if (sigdelset(&mask, SIG_THR_RESTART) != 0) ABORT("sigdelset() failed");
+# ifdef NO_SIGNALS
+ if (sigdelset(&mask, SIGINT) != 0) ABORT("sigdelset() failed");
+ if (sigdelset(&mask, SIGQUIT) != 0) ABORT("sigdelset() failed");
+ if (sigdelset(&mask, SIGTERM) != 0) ABORT("sigdelset() failed");
+ if (sigdelset(&mask, SIGABRT) != 0) ABORT("sigdelset() failed");
+# endif
+ do {
+ me->stop_info.signal = 0;
+ sigsuspend(&mask); /* Wait for signal */
+ } while (me->stop_info.signal != SIG_THR_RESTART);
+ /* If the RESTART signal gets lost, we can still lose. That should be */
+ /* less likely than losing the SUSPEND signal, since we don't do much */
+ /* between the sem_post and sigsuspend. */
+ /* We'd need more handshaking to work around that, since we don't want */
+ /* to accidentally leave a RESTART signal pending, thus causing us to */
+ /* continue prematurely in a future round. */
+
+#if DEBUG_THREADS
+ GC_printf1("Continuing 0x%lx\n", my_thread);
+#endif
+}
+
+void GC_restart_handler(int sig)
+{
+ pthread_t my_thread = pthread_self();
+ GC_thread me;
+
+ if (sig != SIG_THR_RESTART) ABORT("Bad signal in suspend_handler");
+
+ /* Let the GC_suspend_handler() know that we got a SIG_THR_RESTART. */
+ /* The lookup here is safe, since I'm doing this on behalf */
+ /* of a thread which holds the allocation lock in order */
+ /* to stop the world. Thus concurrent modification of the */
+ /* data structure is impossible. */
+ me = GC_lookup_thread(my_thread);
+ me->stop_info.signal = SIG_THR_RESTART;
+
+ /*
+ ** Note: even if we didn't do anything useful here,
+ ** it would still be necessary to have a signal handler,
+ ** rather than ignoring the signals, otherwise
+ ** the signals will not be delivered at all, and
+ ** will thus not interrupt the sigsuspend() above.
+ */
+
+#if DEBUG_THREADS
+ GC_printf1("In GC_restart_handler for 0x%lx\n", pthread_self());
+#endif
+}
+
+# ifdef IA64
+# define IF_IA64(x) x
+# else
+# define IF_IA64(x)
+# endif
+/* We hold allocation lock. Should do exactly the right thing if the */
+/* world is stopped. Should not fail if it isn't. */
+void GC_push_all_stacks()
+{
+ int i;
+ GC_thread p;
+ ptr_t lo, hi;
+ /* On IA64, we also need to scan the register backing store. */
+ IF_IA64(ptr_t bs_lo; ptr_t bs_hi;)
+ pthread_t me = pthread_self();
+
+ if (!GC_thr_initialized) GC_thr_init();
+ #if DEBUG_THREADS
+ GC_printf1("Pushing stacks from thread 0x%lx\n", (unsigned long) me);
+ #endif
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> flags & FINISHED) continue;
+ if (pthread_equal(p -> id, me)) {
+# ifdef SPARC
+ lo = (ptr_t)GC_save_regs_in_stack();
+# else
+ lo = GC_approx_sp();
+# endif
+ IF_IA64(bs_hi = (ptr_t)GC_save_regs_in_stack();)
+ } else {
+ lo = p -> stop_info.stack_ptr;
+ IF_IA64(bs_hi = p -> backing_store_ptr;)
+ }
+ if ((p -> flags & MAIN_THREAD) == 0) {
+ hi = p -> stack_end;
+ IF_IA64(bs_lo = p -> backing_store_end);
+ } else {
+ /* The original stack. */
+ hi = GC_stackbottom;
+ IF_IA64(bs_lo = BACKING_STORE_BASE;)
+ }
+ #if DEBUG_THREADS
+ GC_printf3("Stack for thread 0x%lx = [%lx,%lx)\n",
+ (unsigned long) p -> id,
+ (unsigned long) lo, (unsigned long) hi);
+ #endif
+ if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
+# ifdef STACK_GROWS_UP
+ /* We got them backwards! */
+ GC_push_all_stack(hi, lo);
+# else
+ GC_push_all_stack(lo, hi);
+# endif
+# ifdef IA64
+ if (pthread_equal(p -> id, me)) {
+ GC_push_all_eager(bs_lo, bs_hi);
+ } else {
+ GC_push_all_stack(bs_lo, bs_hi);
+ }
+# endif
+ }
+ }
+}
+
+/* There seems to be a very rare thread stopping problem. To help us */
+/* debug that, we save the ids of the stopping thread. */
+pthread_t GC_stopping_thread;
+int GC_stopping_pid;
+
+/* We hold the allocation lock. Suspend all threads that might */
+/* still be running. Return the number of suspend signals that */
+/* were sent. */
+int GC_suspend_all()
+{
+ int n_live_threads = 0;
+ int i;
+ GC_thread p;
+ int result;
+ pthread_t my_thread = pthread_self();
+
+ GC_stopping_thread = my_thread; /* debugging only. */
+ GC_stopping_pid = getpid(); /* debugging only. */
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> id != my_thread) {
+ if (p -> flags & FINISHED) continue;
+ if (p -> stop_info.last_stop_count == GC_stop_count) continue;
+ if (p -> thread_blocked) /* Will wait */ continue;
+ n_live_threads++;
+ #if DEBUG_THREADS
+ GC_printf1("Sending suspend signal to 0x%lx\n", p -> id);
+ #endif
+
+ result = pthread_kill(p -> id, SIG_SUSPEND);
+ switch(result) {
+ case ESRCH:
+ /* Not really there anymore. Possible? */
+ n_live_threads--;
+ break;
+ case 0:
+ break;
+ default:
+ ABORT("pthread_kill failed");
+ }
+ }
+ }
+ }
+ return n_live_threads;
+}
+
+/* Caller holds allocation lock. */
+void GC_stop_world()
+{
+ int i;
+ int n_live_threads;
+ int code;
+
+ #if DEBUG_THREADS
+ GC_printf1("Stopping the world from 0x%lx\n", pthread_self());
+ #endif
+
+ /* Make sure all free list construction has stopped before we start. */
+ /* No new construction can start, since free list construction is */
+ /* required to acquire and release the GC lock before it starts, */
+ /* and we have the lock. */
+# ifdef PARALLEL_MARK
+ GC_acquire_mark_lock();
+ GC_ASSERT(GC_fl_builder_count == 0);
+ /* We should have previously waited for it to become zero. */
+# endif /* PARALLEL_MARK */
+ ++GC_stop_count;
+ n_live_threads = GC_suspend_all();
+
+ if (GC_retry_signals) {
+ unsigned long wait_usecs = 0; /* Total wait since retry. */
+# define WAIT_UNIT 3000
+# define RETRY_INTERVAL 100000
+ for (;;) {
+ int ack_count;
+
+ sem_getvalue(&GC_suspend_ack_sem, &ack_count);
+ if (ack_count == n_live_threads) break;
+ if (wait_usecs > RETRY_INTERVAL) {
+ int newly_sent = GC_suspend_all();
+
+# ifdef CONDPRINT
+ if (GC_print_stats) {
+ GC_printf1("Resent %ld signals after timeout\n",
+ newly_sent);
+ }
+# endif
+ sem_getvalue(&GC_suspend_ack_sem, &ack_count);
+ if (newly_sent < n_live_threads - ack_count) {
+ WARN("Lost some threads during GC_stop_world?!\n",0);
+ n_live_threads = ack_count + newly_sent;
+ }
+ wait_usecs = 0;
+ }
+ usleep(WAIT_UNIT);
+ wait_usecs += WAIT_UNIT;
+ }
+ }
+ for (i = 0; i < n_live_threads; i++) {
+ if (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
+ GC_err_printf1("Sem_wait returned %ld\n", (unsigned long)code);
+ ABORT("sem_wait for handler failed");
+ }
+ }
+# ifdef PARALLEL_MARK
+ GC_release_mark_lock();
+# endif
+ #if DEBUG_THREADS
+ GC_printf1("World stopped from 0x%lx\n", pthread_self());
+ #endif
+ GC_stopping_thread = 0; /* debugging only */
+}
+
+/* Caller holds allocation lock, and has held it continuously since */
+/* the world stopped. */
+void GC_start_world()
+{
+ pthread_t my_thread = pthread_self();
+ register int i;
+ register GC_thread p;
+ register int n_live_threads = 0;
+ register int result;
+
+# if DEBUG_THREADS
+ GC_printf0("World starting\n");
+# endif
+
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> id != my_thread) {
+ if (p -> flags & FINISHED) continue;
+ if (p -> thread_blocked) continue;
+ n_live_threads++;
+ #if DEBUG_THREADS
+ GC_printf1("Sending restart signal to 0x%lx\n", p -> id);
+ #endif
+
+ result = pthread_kill(p -> id, SIG_THR_RESTART);
+ switch(result) {
+ case ESRCH:
+ /* Not really there anymore. Possible? */
+ n_live_threads--;
+ break;
+ case 0:
+ break;
+ default:
+ ABORT("pthread_kill failed");
+ }
+ }
+ }
+ }
+ #if DEBUG_THREADS
+ GC_printf0("World started\n");
+ #endif
+}
+
+void GC_stop_init() {
+ struct sigaction act;
+
+ if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
+ ABORT("sem_init failed");
+
+ act.sa_flags = SA_RESTART;
+ if (sigfillset(&act.sa_mask) != 0) {
+ ABORT("sigfillset() failed");
+ }
+# ifdef NO_SIGNALS
+ if (sigdelset(&act.sa_mask, SIGINT) != 0
+ || sigdelset(&act.sa_mask, SIGQUIT != 0)
+ || sigdelset(&act.sa_mask, SIGABRT != 0)
+ || sigdelset(&act.sa_mask, SIGTERM != 0)) {
+ ABORT("sigdelset() failed");
+ }
+# endif
+
+ /* SIG_THR_RESTART is unmasked by the handler when necessary. */
+ act.sa_handler = GC_suspend_handler;
+ if (sigaction(SIG_SUSPEND, &act, NULL) != 0) {
+ ABORT("Cannot set SIG_SUSPEND handler");
+ }
+
+ act.sa_handler = GC_restart_handler;
+ if (sigaction(SIG_THR_RESTART, &act, NULL) != 0) {
+ ABORT("Cannot set SIG_THR_RESTART handler");
+ }
+
+ /* Check for GC_RETRY_SIGNALS. */
+ if (0 != GETENV("GC_RETRY_SIGNALS")) {
+ GC_retry_signals = TRUE;
+ }
+ if (0 != GETENV("GC_NO_RETRY_SIGNALS")) {
+ GC_retry_signals = FALSE;
+ }
+# ifdef CONDPRINT
+ if (GC_print_stats && GC_retry_signals) {
+ GC_printf0("Will retry suspend signal if necessary.\n");
+ }
+# endif
+}
+
+#endif
diff --git a/boehm-gc/linux_threads.c b/boehm-gc/pthread_support.c
index c968e7cbfd4..b302817bfdf 100644
--- a/boehm-gc/linux_threads.c
+++ b/boehm-gc/pthread_support.c
@@ -26,13 +26,11 @@
* and thread support for some of the other Posix platforms; any changes
* made here may need to be reflected there too.
*/
+ /* DG/UX ix86 support <takis@xfree86.org> */
/*
* Linux_threads.c now also includes some code to support HPUX and
- * OSF1 (Compaq Tru64 Unix, really). The OSF1 support is not yet
- * functional. The OSF1 code is based on Eric Benson's
- * patch, though that was originally against hpux_irix_threads. The code
- * here is completely untested. With 0.0000001% probability, it might
- * actually work.
+ * OSF1 (Compaq Tru64 Unix, really). The OSF1 support is based on Eric Benson's
+ * patch.
*
* Eric also suggested an alternate basis for a lock implementation in
* his code:
@@ -46,22 +44,33 @@
* + # define GC_LOCK_TAKEN GC_allocate_lock
*/
-/* #define DEBUG_THREADS 1 */
+/*#define DEBUG_THREADS 1*/
+/*#define GC_ASSERTIONS*/
-/* ANSI C requires that a compilation unit contains something */
-
-# include "gc.h"
+# include "private/pthread_support.h"
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
- && !defined(GC_IRIX_THREADS)
-
-# include "private/gc_priv.h"
+ && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
+ && !defined(GC_AIX_THREADS)
# if defined(GC_HPUX_THREADS) && !defined(USE_PTHREAD_SPECIFIC) \
&& !defined(USE_HPUX_TLS)
# define USE_HPUX_TLS
# endif
+# if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
+ defined(GC_DARWIN_THREADS)) && !defined(USE_PTHREAD_SPECIFIC)
+# define USE_PTHREAD_SPECIFIC
+# endif
+
+# if defined(GC_DGUX386_THREADS) && !defined(_POSIX4A_DRAFT10_SOURCE)
+# define _POSIX4A_DRAFT10_SOURCE 1
+# endif
+
+# if defined(GC_DGUX386_THREADS) && !defined(_USING_POSIX4A_DRAFT10)
+# define _USING_POSIX4A_DRAFT10 1
+# endif
+
# ifdef THREAD_LOCAL_ALLOC
# if !defined(USE_PTHREAD_SPECIFIC) && !defined(USE_HPUX_TLS)
# include "private/specific.h"
@@ -87,12 +96,29 @@
# include <unistd.h>
# include <sys/mman.h>
# include <sys/time.h>
-# include <semaphore.h>
-# include <signal.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
+#if defined(GC_DARWIN_THREADS)
+# include "private/darwin_semaphore.h"
+#else
+# include <semaphore.h>
+#endif /* !GC_DARWIN_THREADS */
+
+#if defined(GC_DARWIN_THREADS)
+# include <sys/sysctl.h>
+#endif /* GC_DARWIN_THREADS */
+
+
+
+#if defined(GC_DGUX386_THREADS)
+# include <sys/dg_sys_info.h>
+# include <sys/_int_psem.h>
+ /* sem_t is an uint in DG/UX */
+ typedef unsigned int sem_t;
+#endif /* GC_DGUX386_THREADS */
+
#ifndef __GNUC__
# define __inline__
#endif
@@ -102,106 +128,28 @@
# define REAL_FUNC(f) __real_##f
#else
# define WRAP_FUNC(f) GC_##f
-# define REAL_FUNC(f) f
+# if !defined(GC_DGUX386_THREADS)
+# define REAL_FUNC(f) f
+# else /* GC_DGUX386_THREADS */
+# define REAL_FUNC(f) __d10_##f
+# endif /* GC_DGUX386_THREADS */
# undef pthread_create
-# undef pthread_sigmask
+# if !defined(GC_DARWIN_THREADS)
+# undef pthread_sigmask
+# endif
# undef pthread_join
# undef pthread_detach
+# if defined(GC_OSF1_THREADS) && defined(_PTHREAD_USE_MANGLED_NAMES_) \
+ && !defined(_PTHREAD_USE_PTDNAM_)
+/* Restore the original mangled names on Tru64 UNIX. */
+# define pthread_create __pthread_create
+# define pthread_join __pthread_join
+# define pthread_detach __pthread_detach
+# endif
#endif
-
void GC_thr_init();
-#if 0
-void GC_print_sig_mask()
-{
- sigset_t blocked;
- int i;
-
- if (pthread_sigmask(SIG_BLOCK, NULL, &blocked) != 0)
- ABORT("pthread_sigmask");
- GC_printf0("Blocked: ");
- for (i = 1; i <= MAXSIG; i++) {
- if (sigismember(&blocked, i)) { GC_printf1("%ld ",(long) i); }
- }
- GC_printf0("\n");
-}
-#endif
-
-
-/* We use the allocation lock to protect thread-related data structures. */
-
-/* The set of all known threads. We intercept thread creation and */
-/* joins. */
-/* Protected by allocation/GC lock. */
-/* Some of this should be declared volatile, but that's inconsistent */
-/* with some library routine declarations. */
-typedef struct GC_Thread_Rep {
- struct GC_Thread_Rep * next; /* More recently allocated threads */
- /* with a given pthread id come */
- /* first. (All but the first are */
- /* guaranteed to be dead, but we may */
- /* not yet have registered the join.) */
- pthread_t id;
- short flags;
-# define FINISHED 1 /* Thread has exited. */
-# define DETACHED 2 /* Thread is intended to be detached. */
-# define MAIN_THREAD 4 /* True for the original thread only. */
- short thread_blocked; /* Protected by GC lock. */
- /* Treated as a boolean value. If set, */
- /* thread will acquire GC lock before */
- /* doing any pointer manipulations, and */
- /* has set its sp value. Thus it does */
- /* not need to be sent a signal to stop */
- /* it. */
- ptr_t stack_end; /* Cold end of the stack. */
- ptr_t stack_ptr; /* Valid only when stopped. */
-# ifdef IA64
- ptr_t backing_store_end;
- ptr_t backing_store_ptr;
-# endif
- int signal;
- void * status; /* The value returned from the thread. */
- /* Used only to avoid premature */
- /* reclamation of any data it might */
- /* reference. */
-# ifdef THREAD_LOCAL_ALLOC
-# if CPP_WORDSZ == 64 && defined(ALIGN_DOUBLE)
-# define GRANULARITY 16
-# define NFREELISTS 49
-# else
-# define GRANULARITY 8
-# define NFREELISTS 65
-# endif
- /* The ith free list corresponds to size i*GRANULARITY */
-# define INDEX_FROM_BYTES(n) ((ADD_SLOP(n) + GRANULARITY - 1)/GRANULARITY)
-# define BYTES_FROM_INDEX(i) ((i) * GRANULARITY - EXTRA_BYTES)
-# define SMALL_ENOUGH(bytes) (ADD_SLOP(bytes) <= \
- (NFREELISTS-1)*GRANULARITY)
- ptr_t ptrfree_freelists[NFREELISTS];
- ptr_t normal_freelists[NFREELISTS];
-# ifdef GC_GCJ_SUPPORT
- ptr_t gcj_freelists[NFREELISTS];
-# endif
- /* Free lists contain either a pointer or a small count */
- /* reflecting the number of granules allocated at that */
- /* size. */
- /* 0 ==> thread-local allocation in use, free list */
- /* empty. */
- /* > 0, <= DIRECT_GRANULES ==> Using global allocation, */
- /* too few objects of this size have been */
- /* allocated by this thread. */
- /* >= HBLKSIZE => pointer to nonempty free list. */
- /* > DIRECT_GRANULES, < HBLKSIZE ==> transition to */
- /* local alloc, equivalent to 0. */
-# define DIRECT_GRANULES (HBLKSIZE/GRANULARITY)
- /* Don't use local free lists for up to this much */
- /* allocation. */
-# endif
-} * GC_thread;
-
-GC_thread GC_lookup_thread(pthread_t id);
-
static GC_bool parallel_initialized = FALSE;
void GC_init_parallel();
@@ -292,8 +240,11 @@ void GC_init_thread_local(GC_thread p)
/* We hold the allocator lock. */
void GC_destroy_thread_local(GC_thread p)
{
- /* We currently only do this from the thread itself. */
- GC_ASSERT(GC_getspecific(GC_thread_key) == (void *)p);
+ /* We currently only do this from the thread itself or from */
+ /* the fork handler for a child process. */
+# ifndef HANDLE_FORK
+ GC_ASSERT(GC_getspecific(GC_thread_key) == (void *)p);
+# endif
return_freelists(p -> ptrfree_freelists, GC_aobjfreelist);
return_freelists(p -> normal_freelists, GC_objfreelist);
# ifdef GC_GCJ_SUPPORT
@@ -311,11 +262,12 @@ GC_PTR GC_local_malloc(size_t bytes)
int index = INDEX_FROM_BYTES(bytes);
ptr_t * my_fl;
ptr_t my_entry;
+# if defined(REDIRECT_MALLOC) && !defined(USE_PTHREAD_SPECIFIC)
GC_key_t k = GC_thread_key;
+# endif
void * tsd;
-# if defined(REDIRECT_MALLOC) && !defined(USE_PTHREAD_SPECIFIC) \
- || !defined(__GNUC__)
+# if defined(REDIRECT_MALLOC) && !defined(USE_PTHREAD_SPECIFIC)
if (EXPECT(0 == k, 0)) {
/* This can happen if we get called when the world is */
/* being initialized. Whether we can actually complete */
@@ -359,13 +311,14 @@ GC_PTR GC_local_malloc_atomic(size_t bytes)
ptr_t * my_fl = ((GC_thread)GC_getspecific(GC_thread_key))
-> ptrfree_freelists + index;
ptr_t my_entry = *my_fl;
+
if (EXPECT((word)my_entry >= HBLKSIZE, 1)) {
GC_PTR result = (GC_PTR)my_entry;
*my_fl = obj_link(my_entry);
return result;
} else if ((word)my_entry - 1 < DIRECT_GRANULES) {
*my_fl = my_entry + index + 1;
- return GC_malloc_atomic(bytes);
+ return GC_malloc_atomic(bytes);
} else {
GC_generic_malloc_many(BYTES_FROM_INDEX(index), PTRFREE, my_fl);
/* *my_fl is updated while the collector is excluded; */
@@ -417,7 +370,9 @@ GC_PTR GC_local_gcj_malloc(size_t bytes,
*(void * volatile *)result = ptr_to_struct_containing_descr;
return result;
} else if ((word)my_entry - 1 < DIRECT_GRANULES) {
- *my_fl = my_entry + index + 1;
+ if (!GC_incremental) *my_fl = my_entry + index + 1;
+ /* In the incremental case, we always have to take this */
+ /* path. Thus we leave the counter alone. */
return GC_gcj_malloc(bytes, ptr_to_struct_containing_descr);
} else {
GC_generic_malloc_many(BYTES_FROM_INDEX(index), GC_gcj_kind, my_fl);
@@ -435,28 +390,6 @@ GC_PTR GC_local_gcj_malloc(size_t bytes,
# endif /* !THREAD_LOCAL_ALLOC */
-/*
- * We use signals to stop threads during GC.
- *
- * Suspended threads wait in signal handler for SIG_THR_RESTART.
- * That's more portable than semaphores or condition variables.
- * (We do use sem_post from a signal handler, but that should be portable.)
- *
- * The thread suspension signal SIG_SUSPEND is now defined in gc_priv.h.
- * Note that we can't just stop a thread; we need it to save its stack
- * pointer(s) and acknowledge.
- */
-
-#ifndef SIG_THR_RESTART
-# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
-# define SIG_THR_RESTART _SIGRTMIN + 5
-# else
-# define SIG_THR_RESTART SIGXCPU
-# endif
-#endif
-
-sem_t GC_suspend_ack_sem;
-
#if 0
/*
To make sure that we're using LinuxThreads and not some other thread
@@ -471,10 +404,6 @@ actually work for something else.
void (*dummy_var_to_force_linux_threads)() = pthread_kill_other_threads_np;
#endif /* 0 */
-#if defined(SPARC) || defined(IA64)
- extern word GC_save_regs_in_stack();
-#endif
-
long GC_nprocs = 1; /* Number of processors. We may not have */
/* access to all of them, but this is as good */
/* a guess as any ... */
@@ -533,7 +462,7 @@ static void start_mark_threads()
if (0 != pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
ABORT("pthread_attr_setdetachstate failed");
-# ifdef HPUX
+# if defined(HPUX) || defined(GC_DGUX386_THREADS)
/* Default stack size is usually too small: fix it. */
/* Otherwise marker threads or GC may run out of */
/* space. */
@@ -549,7 +478,7 @@ static void start_mark_threads()
ABORT("pthread_attr_setstacksize failed\n");
}
}
-# endif /* HPUX */
+# endif /* HPUX || GC_DGUX386_THREADS */
# ifdef CONDPRINT
if (GC_print_stats) {
GC_printf1("Starting %ld marker threads\n", GC_markers - 1);
@@ -571,96 +500,6 @@ static __inline__ void start_mark_threads()
#endif /* !PARALLEL_MARK */
-void GC_suspend_handler(int sig)
-{
- int dummy;
- pthread_t my_thread = pthread_self();
- GC_thread me;
- sigset_t all_sigs;
- sigset_t old_sigs;
- int i;
- sigset_t mask;
-# ifdef PARALLEL_MARK
- word my_mark_no = GC_mark_no;
- /* Marker can't proceed until we acknowledge. Thus this is */
- /* guaranteed to be the mark_no correspending to our */
- /* suspension, i.e. the marker can't have incremented it yet. */
-# endif
-
- if (sig != SIG_SUSPEND) ABORT("Bad signal in suspend_handler");
-
-#if DEBUG_THREADS
- GC_printf1("Suspending 0x%x\n", my_thread);
-#endif
-
- me = GC_lookup_thread(my_thread);
- /* The lookup here is safe, since I'm doing this on behalf */
- /* of a thread which holds the allocation lock in order */
- /* to stop the world. Thus concurrent modification of the */
- /* data structure is impossible. */
-# ifdef SPARC
- me -> stack_ptr = (ptr_t)GC_save_regs_in_stack();
-# else
- me -> stack_ptr = (ptr_t)(&dummy);
-# endif
-# ifdef IA64
- me -> backing_store_ptr = (ptr_t)GC_save_regs_in_stack();
-# endif
-
- /* Tell the thread that wants to stop the world that this */
- /* thread has been stopped. Note that sem_post() is */
- /* the only async-signal-safe primitive in LinuxThreads. */
- sem_post(&GC_suspend_ack_sem);
-
- /* Wait until that thread tells us to restart by sending */
- /* this thread a SIG_THR_RESTART signal. */
- /* SIG_THR_RESTART should be masked at this point. Thus there */
- /* is no race. */
- if (sigfillset(&mask) != 0) ABORT("sigfillset() failed");
- if (sigdelset(&mask, SIG_THR_RESTART) != 0) ABORT("sigdelset() failed");
-# ifdef NO_SIGNALS
- if (sigdelset(&mask, SIGINT) != 0) ABORT("sigdelset() failed");
- if (sigdelset(&mask, SIGQUIT) != 0) ABORT("sigdelset() failed");
- if (sigdelset(&mask, SIGTERM) != 0) ABORT("sigdelset() failed");
- if (sigdelset(&mask, SIGABRT) != 0) ABORT("sigdelset() failed");
-# endif
- do {
- me->signal = 0;
- sigsuspend(&mask); /* Wait for signal */
- } while (me->signal != SIG_THR_RESTART);
-
-#if DEBUG_THREADS
- GC_printf1("Continuing 0x%x\n", my_thread);
-#endif
-}
-
-void GC_restart_handler(int sig)
-{
- GC_thread me;
-
- if (sig != SIG_THR_RESTART) ABORT("Bad signal in suspend_handler");
-
- /* Let the GC_suspend_handler() know that we got a SIG_THR_RESTART. */
- /* The lookup here is safe, since I'm doing this on behalf */
- /* of a thread which holds the allocation lock in order */
- /* to stop the world. Thus concurrent modification of the */
- /* data structure is impossible. */
- me = GC_lookup_thread(pthread_self());
- me->signal = SIG_THR_RESTART;
-
- /*
- ** Note: even if we didn't do anything useful here,
- ** it would still be necessary to have a signal handler,
- ** rather than ignoring the signals, otherwise
- ** the signals will not be delivered at all, and
- ** will thus not interrupt the sigsuspend() above.
- */
-
-#if DEBUG_THREADS
- GC_printf1("In GC_restart_handler for 0x%x\n", pthread_self());
-#endif
-}
-
/* Defining INSTALL_LOOPING_SEGV_HANDLER causes SIGSEGV and SIGBUS to */
/* result in an infinite loop in a signal handler. This can be very */
/* useful for debugging, since (as of RH7) gdb still seems to have */
@@ -676,12 +515,15 @@ void GC_looping_handler(int sig)
GC_bool GC_thr_initialized = FALSE;
-# define THREAD_TABLE_SZ 128 /* Must be power of 2 */
volatile GC_thread GC_threads[THREAD_TABLE_SZ];
void GC_push_thread_structures GC_PROTO((void))
{
GC_push_all((ptr_t)(GC_threads), (ptr_t)(GC_threads)+sizeof(GC_threads));
+# if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL)
+ GC_push_all((ptr_t)(&GC_thread_key),
+ (ptr_t)(&GC_thread_key)+sizeof(&GC_thread_key));
+# endif
}
#ifdef THREAD_LOCAL_ALLOC
@@ -712,13 +554,14 @@ void GC_mark_thread_local_free_lists(void)
}
#endif /* THREAD_LOCAL_ALLOC */
+static struct GC_Thread_Rep first_thread;
+
/* Add a thread to GC_threads. We assume it wasn't already there. */
/* Caller holds allocation lock. */
GC_thread GC_new_thread(pthread_t id)
{
int hv = ((word)id) % THREAD_TABLE_SZ;
GC_thread result;
- static struct GC_Thread_Rep first_thread;
static GC_bool first_thread_used = FALSE;
if (!first_thread_used) {
@@ -794,175 +637,37 @@ GC_thread GC_lookup_thread(pthread_t id)
return(p);
}
-/* There seems to be a very rare thread stopping problem. To help us */
-/* debug that, we save the ids of the stopping thread. */
-pthread_t GC_stopping_thread;
-int GC_stopping_pid;
-
-/* Caller holds allocation lock. */
-void GC_stop_world()
-{
- pthread_t my_thread = pthread_self();
- register int i;
- register GC_thread p;
- register int n_live_threads = 0;
- register int result;
-
- GC_stopping_thread = my_thread; /* debugging only. */
- GC_stopping_pid = getpid(); /* debugging only. */
- /* Make sure all free list construction has stopped before we start. */
- /* No new construction can start, since free list construction is */
- /* required to acquire and release the GC lock before it starts, */
- /* and we have the lock. */
-# ifdef PARALLEL_MARK
- GC_acquire_mark_lock();
- GC_ASSERT(GC_fl_builder_count == 0);
- /* We should have previously waited for it to become zero. */
-# endif /* PARALLEL_MARK */
- for (i = 0; i < THREAD_TABLE_SZ; i++) {
- for (p = GC_threads[i]; p != 0; p = p -> next) {
- if (p -> id != my_thread) {
- if (p -> flags & FINISHED) continue;
- if (p -> thread_blocked) /* Will wait */ continue;
- n_live_threads++;
- #if DEBUG_THREADS
- GC_printf1("Sending suspend signal to 0x%x\n", p -> id);
- #endif
- result = pthread_kill(p -> id, SIG_SUSPEND);
- switch(result) {
- case ESRCH:
- /* Not really there anymore. Possible? */
- n_live_threads--;
- break;
- case 0:
- break;
- default:
- ABORT("pthread_kill failed");
- }
- }
- }
- }
- for (i = 0; i < n_live_threads; i++) {
- if (0 != sem_wait(&GC_suspend_ack_sem))
- ABORT("sem_wait in handler failed");
- }
-# ifdef PARALLEL_MARK
- GC_release_mark_lock();
-# endif
- #if DEBUG_THREADS
- GC_printf1("World stopped 0x%x\n", pthread_self());
- #endif
- GC_stopping_thread = 0; /* debugging only */
-}
-
-/* Caller holds allocation lock, and has held it continuously since */
-/* the world stopped. */
-void GC_start_world()
+#ifdef HANDLE_FORK
+/* Remove all entries from the GC_threads table, except the */
+/* one for the current thread. We need to do this in the child */
+/* process after a fork(), since only the current thread */
+/* survives in the child. */
+void GC_remove_all_threads_but_me(void)
{
- pthread_t my_thread = pthread_self();
- register int i;
- register GC_thread p;
- register int n_live_threads = 0;
- register int result;
-
-# if DEBUG_THREADS
- GC_printf0("World starting\n");
-# endif
-
- for (i = 0; i < THREAD_TABLE_SZ; i++) {
- for (p = GC_threads[i]; p != 0; p = p -> next) {
- if (p -> id != my_thread) {
- if (p -> flags & FINISHED) continue;
- if (p -> thread_blocked) continue;
- n_live_threads++;
- #if DEBUG_THREADS
- GC_printf1("Sending restart signal to 0x%x\n", p -> id);
- #endif
- result = pthread_kill(p -> id, SIG_THR_RESTART);
- switch(result) {
- case ESRCH:
- /* Not really there anymore. Possible? */
- n_live_threads--;
- break;
- case 0:
- break;
- default:
- ABORT("pthread_kill failed");
- }
- }
- }
- }
- #if DEBUG_THREADS
- GC_printf0("World started\n");
- #endif
- GC_stopping_thread = 0; /* debugging only */
-}
-
-# ifdef IA64
-# define IF_IA64(x) x
-# else
-# define IF_IA64(x)
-# endif
-/* We hold allocation lock. Should do exactly the right thing if the */
-/* world is stopped. Should not fail if it isn't. */
-void GC_push_all_stacks()
-{
- int i;
- GC_thread p;
- ptr_t sp = GC_approx_sp();
- ptr_t lo, hi;
- /* On IA64, we also need to scan the register backing store. */
- IF_IA64(ptr_t bs_lo; ptr_t bs_hi;)
- pthread_t me = pthread_self();
-
- if (!GC_thr_initialized) GC_thr_init();
- #if DEBUG_THREADS
- GC_printf1("Pushing stacks from thread 0x%lx\n", (unsigned long) me);
- #endif
- for (i = 0; i < THREAD_TABLE_SZ; i++) {
- for (p = GC_threads[i]; p != 0; p = p -> next) {
- if (p -> flags & FINISHED) continue;
- if (pthread_equal(p -> id, me)) {
-# ifdef SPARC
- lo = (ptr_t)GC_save_regs_in_stack();
-# else
- lo = GC_approx_sp();
-# endif
- IF_IA64(bs_hi = (ptr_t)GC_save_regs_in_stack();)
+ pthread_t self = pthread_self();
+ int hv;
+ GC_thread p, next, me;
+
+ for (hv = 0; hv < THREAD_TABLE_SZ; ++hv) {
+ me = 0;
+ for (p = GC_threads[hv]; 0 != p; p = next) {
+ next = p -> next;
+ if (p -> id == self) {
+ me = p;
+ p -> next = 0;
} else {
- lo = p -> stack_ptr;
- IF_IA64(bs_hi = p -> backing_store_ptr;)
+# ifdef THREAD_LOCAL_ALLOC
+ if (!(p -> flags & FINISHED)) {
+ GC_destroy_thread_local(p);
+ }
+# endif /* THREAD_LOCAL_ALLOC */
+ if (p != &first_thread) GC_INTERNAL_FREE(p);
}
- if ((p -> flags & MAIN_THREAD) == 0) {
- hi = p -> stack_end;
- IF_IA64(bs_lo = p -> backing_store_end);
- } else {
- /* The original stack. */
- hi = GC_stackbottom;
- IF_IA64(bs_lo = BACKING_STORE_BASE;)
- }
- #if DEBUG_THREADS
- GC_printf3("Stack for thread 0x%lx = [%lx,%lx)\n",
- (unsigned long) p -> id,
- (unsigned long) lo, (unsigned long) hi);
- #endif
- if (0 == lo) ABORT("GC_push_all_stacks: sp not set!\n");
-# ifdef STACK_GROWS_UP
- /* We got them backwards! */
- GC_push_all_stack(hi, lo);
-# else
- GC_push_all_stack(lo, hi);
-# endif
-# ifdef IA64
- if (pthread_equal(p -> id, me)) {
- GC_push_all_eager(bs_lo, bs_hi);
- } else {
- GC_push_all_stack(bs_lo, bs_hi);
- }
-# endif
}
+ GC_threads[hv] = me;
}
}
+#endif /* HANDLE_FORK */
#ifdef USE_PROC_FOR_LIBRARIES
int GC_segment_is_thread_stack(ptr_t lo, ptr_t hi)
@@ -998,14 +703,11 @@ int GC_get_nprocs()
/* appears to be buggy in many cases. */
/* We look for lines "cpu<n>" in /proc/stat. */
# define STAT_BUF_SIZE 4096
-# if defined(GC_USE_LD_WRAP)
-# define STAT_READ __real_read
-# else
-# define STAT_READ read
-# endif
+# define STAT_READ read
+ /* If read is wrapped, this may need to be redefined to call */
+ /* the real one. */
char stat_buf[STAT_BUF_SIZE];
int f;
- char c;
word result = 1;
/* Some old kernels only have a single "cpu nnnn ..." */
/* entry in /proc/stat. We identify those as */
@@ -1017,7 +719,6 @@ int GC_get_nprocs()
WARN("Couldn't read /proc/stat\n", 0);
return -1;
}
- close(f);
for (i = 0; i < len - 100; ++i) {
if (stat_buf[i] == '\n' && stat_buf[i+1] == 'c'
&& stat_buf[i+2] == 'p' && stat_buf[i+3] == 'u') {
@@ -1025,59 +726,144 @@ int GC_get_nprocs()
if (cpu_no >= result) result = cpu_no + 1;
}
}
+ close(f);
return result;
}
#endif /* GC_LINUX_THREADS */
-/* We hold the allocation lock. */
-void GC_thr_init()
+/* We hold the GC lock. Wait until an in-progress GC has finished. */
+/* Repeatedly RELEASES GC LOCK in order to wait. */
+/* If wait_for_all is true, then we exit with the GC lock held and no */
+/* collection in progress; otherwise we just wait for the current GC */
+/* to finish. */
+extern GC_bool GC_collection_in_progress();
+void GC_wait_for_gc_completion(GC_bool wait_for_all)
{
- int dummy;
- GC_thread t;
- struct sigaction act;
+ if (GC_incremental && GC_collection_in_progress()) {
+ int old_gc_no = GC_gc_no;
- if (GC_thr_initialized) return;
- GC_thr_initialized = TRUE;
+ /* Make sure that no part of our stack is still on the mark stack, */
+ /* since it's about to be unmapped. */
+ while (GC_incremental && GC_collection_in_progress()
+ && (wait_for_all || old_gc_no == GC_gc_no)) {
+ ENTER_GC();
+ GC_collect_a_little_inner(1);
+ EXIT_GC();
+ UNLOCK();
+ sched_yield();
+ LOCK();
+ }
+ }
+}
- if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
- ABORT("sem_init failed");
+#ifdef HANDLE_FORK
+/* Procedures called before and after a fork. The goal here is to make */
+/* it safe to call GC_malloc() in a forked child. It's unclear that is */
+/* attainable, since the single UNIX spec seems to imply that one */
+/* should only call async-signal-safe functions, and we probably can't */
+/* quite guarantee that. But we give it our best shot. (That same */
+/* spec also implies that it's not safe to call the system malloc */
+/* between fork() and exec(). Thus we're doing no worse than it. */
+
+/* Called before a fork() */
+void GC_fork_prepare_proc(void)
+{
+ /* Acquire all relevant locks, so that after releasing the locks */
+ /* the child will see a consistent state in which monitor */
+ /* invariants hold. Unfortunately, we can't acquire libc locks */
+ /* we might need, and there seems to be no guarantee that libc */
+ /* must install a suitable fork handler. */
+ /* Wait for an ongoing GC to finish, since we can't finish it in */
+ /* the (one remaining thread in) the child. */
+ LOCK();
+# if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC)
+ GC_wait_for_reclaim();
+# endif
+ GC_wait_for_gc_completion(TRUE);
+# if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC)
+ GC_acquire_mark_lock();
+# endif
+}
- act.sa_flags = SA_RESTART;
- if (sigfillset(&act.sa_mask) != 0) {
- ABORT("sigfillset() failed");
- }
-# ifdef NO_SIGNALS
- if (sigdelset(&act.sa_mask, SIGINT) != 0
- || sigdelset(&act.sa_mask, SIGQUIT != 0)
- || sigdelset(&act.sa_mask, SIGABRT != 0)
- || sigdelset(&act.sa_mask, SIGTERM != 0)) {
- ABORT("sigdelset() failed");
- }
+/* Called in parent after a fork() */
+void GC_fork_parent_proc(void)
+{
+# if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC)
+ GC_release_mark_lock();
# endif
+ UNLOCK();
+}
- /* SIG_THR_RESTART is unmasked by the handler when necessary. */
- act.sa_handler = GC_suspend_handler;
- if (sigaction(SIG_SUSPEND, &act, NULL) != 0) {
- ABORT("Cannot set SIG_SUSPEND handler");
- }
+/* Called in child after a fork() */
+void GC_fork_child_proc(void)
+{
+ /* Clean up the thread table, so that just our thread is left. */
+# if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC)
+ GC_release_mark_lock();
+# endif
+ GC_remove_all_threads_but_me();
+# ifdef PARALLEL_MARK
+ /* Turn off parallel marking in the child, since we are probably */
+ /* just going to exec, and we would have to restart mark threads. */
+ GC_markers = 1;
+ GC_parallel = FALSE;
+# endif /* PARALLEL_MARK */
+ UNLOCK();
+}
+#endif /* HANDLE_FORK */
- act.sa_handler = GC_restart_handler;
- if (sigaction(SIG_THR_RESTART, &act, NULL) != 0) {
- ABORT("Cannot set SIG_THR_RESTART handler");
- }
-# ifdef INSTALL_LOOPING_SEGV_HANDLER
- act.sa_handler = GC_looping_handler;
- if (sigaction(SIGSEGV, &act, NULL) != 0
- || sigaction(SIGBUS, &act, NULL) != 0) {
- ABORT("Cannot set SIGSEGV or SIGBUS looping handler");
- }
-# endif /* INSTALL_LOOPING_SEGV_HANDLER */
+#if defined(GC_DGUX386_THREADS)
+/* Return the number of processors, or i<= 0 if it can't be determined. */
+int GC_get_nprocs()
+{
+ /* <takis@XFree86.Org> */
+ int numCpus;
+ struct dg_sys_info_pm_info pm_sysinfo;
+ int status =0;
+
+ status = dg_sys_info((long int *) &pm_sysinfo,
+ DG_SYS_INFO_PM_INFO_TYPE, DG_SYS_INFO_PM_CURRENT_VERSION);
+ if (status < 0)
+ /* set -1 for error */
+ numCpus = -1;
+ else
+ /* Active CPUs */
+ numCpus = pm_sysinfo.idle_vp_count;
+
+# ifdef DEBUG_THREADS
+ GC_printf1("Number of active CPUs in this system: %d\n", numCpus);
+# endif
+ return(numCpus);
+}
+#endif /* GC_DGUX386_THREADS */
+/* We hold the allocation lock. */
+void GC_thr_init()
+{
+# ifndef GC_DARWIN_THREADS
+ int dummy;
+# endif
+ GC_thread t;
+
+ if (GC_thr_initialized) return;
+ GC_thr_initialized = TRUE;
+
+# ifdef HANDLE_FORK
+ /* Prepare for a possible fork. */
+ pthread_atfork(GC_fork_prepare_proc, GC_fork_parent_proc,
+ GC_fork_child_proc);
+# endif /* HANDLE_FORK */
/* Add the initial thread, so we can stop it. */
t = GC_new_thread(pthread_self());
- t -> stack_ptr = (ptr_t)(&dummy);
+# ifdef GC_DARWIN_THREADS
+ t -> stop_info.mach_thread = mach_thread_self();
+# else
+ t -> stop_info.stack_ptr = (ptr_t)(&dummy);
+# endif
t -> flags = DETACHED | MAIN_THREAD;
+ GC_stop_init();
+
/* Set GC_nprocs. */
{
char * nprocs_string = GETENV("GC_NPROCS");
@@ -1088,10 +874,20 @@ void GC_thr_init()
# if defined(GC_HPUX_THREADS)
GC_nprocs = pthread_num_processors_np();
# endif
-# if defined(GC_OSF1_THREADS) || defined(GC_FREEBSD_THREADS)
+# if defined(GC_OSF1_THREADS)
+ GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
+ if (GC_nprocs <= 0) GC_nprocs = 1;
+# endif
+# if defined(GC_FREEBSD_THREADS)
GC_nprocs = 1;
# endif
-# if defined(GC_LINUX_THREADS)
+# if defined(GC_DARWIN_THREADS)
+ int ncpus = 1;
+ size_t len = sizeof(ncpus);
+ sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0);
+ GC_nprocs = ncpus;
+# endif
+# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
GC_nprocs = GC_get_nprocs();
# endif
}
@@ -1103,7 +899,14 @@ void GC_thr_init()
# endif
} else {
# ifdef PARALLEL_MARK
- GC_markers = GC_nprocs;
+ {
+ char * markers_string = GETENV("GC_MARKERS");
+ if (markers_string != NULL) {
+ GC_markers = atoi(markers_string);
+ } else {
+ GC_markers = GC_nprocs;
+ }
+ }
# endif
}
# ifdef PARALLEL_MARK
@@ -1122,6 +925,8 @@ void GC_thr_init()
# endif
} else {
GC_parallel = TRUE;
+ /* Disable true incremental collection, but generational is OK. */
+ GC_time_limit = GC_TIME_UNLIMITED;
}
# endif
}
@@ -1129,14 +934,15 @@ void GC_thr_init()
/* Perform all initializations, including those that */
/* may require allocation. */
-/* Called as constructor without allocation lock. */
+/* Called without allocation lock. */
/* Must be called before a second thread is created. */
/* Called without allocation lock. */
void GC_init_parallel()
{
if (parallel_initialized) return;
parallel_initialized = TRUE;
- /* GC_init() calls us back, so set flag first. */
+
+ /* GC_init() calls us back, so set flag first. */
if (!GC_is_initialized) GC_init();
/* If we are using a parallel marker, start the helper threads. */
# ifdef PARALLEL_MARK
@@ -1151,6 +957,7 @@ void GC_init_parallel()
}
+#if !defined(GC_DARWIN_THREADS)
int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
{
sigset_t fudged_set;
@@ -1162,6 +969,7 @@ int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
}
return(REAL_FUNC(pthread_sigmask)(how, set, oset));
}
+#endif /* !GC_DARWIN_THREADS */
/* Wrappers for functions that are likely to block for an appreciable */
/* length of time. Must be called in pairs, if at all. */
@@ -1175,25 +983,29 @@ void GC_start_blocking(void) {
me = GC_lookup_thread(pthread_self());
GC_ASSERT(!(me -> thread_blocked));
# ifdef SPARC
- me -> stack_ptr = (ptr_t)GC_save_regs_in_stack();
+ me -> stop_info.stack_ptr = (ptr_t)GC_save_regs_in_stack();
# else
- me -> stack_ptr = (ptr_t)GC_approx_sp();
+# ifndef GC_DARWIN_THREADS
+ me -> stop_info.stack_ptr = (ptr_t)GC_approx_sp();
+# endif
# endif
# ifdef IA64
me -> backing_store_ptr = (ptr_t)GC_save_regs_in_stack() + SP_SLOP;
# endif
/* Add some slop to the stack pointer, since the wrapped call may */
/* end up pushing more callee-save registers. */
+# ifndef GC_DARWIN_THREADS
# ifdef STACK_GROWS_UP
- me -> stack_ptr += SP_SLOP;
+ me -> stop_info.stack_ptr += SP_SLOP;
# else
- me -> stack_ptr -= SP_SLOP;
+ me -> stop_info.stack_ptr -= SP_SLOP;
+# endif
# endif
me -> thread_blocked = TRUE;
UNLOCK();
}
-GC_end_blocking(void) {
+void GC_end_blocking(void) {
GC_thread me;
LOCK(); /* This will block if the world is stopped. */
me = GC_lookup_thread(pthread_self());
@@ -1202,6 +1014,10 @@ GC_end_blocking(void) {
UNLOCK();
}
+#if defined(GC_DGUX386_THREADS)
+#define __d10_sleep sleep
+#endif /* GC_DGUX386_THREADS */
+
/* A wrapper for the standard C sleep function */
int WRAP_FUNC(sleep) (unsigned int seconds)
{
@@ -1242,21 +1058,7 @@ void GC_thread_exit_proc(void *arg)
&& !defined(USE_HPUX_TLS) && !defined(DBG_HDRS_ALL)
GC_remove_specific(GC_thread_key);
# endif
- if (GC_incremental && GC_collection_in_progress()) {
- int old_gc_no = GC_gc_no;
-
- /* Make sure that no part of our stack is still on the mark stack, */
- /* since it's about to be unmapped. */
- while (GC_incremental && GC_collection_in_progress()
- && old_gc_no == GC_gc_no) {
- ENTER_GC();
- GC_collect_a_little_inner(1);
- EXIT_GC();
- UNLOCK();
- sched_yield();
- LOCK();
- }
- }
+ GC_wait_for_gc_completion(FALSE);
UNLOCK();
}
@@ -1331,8 +1133,12 @@ void * GC_start_routine(void * arg)
# endif
LOCK();
me = GC_new_thread(my_pthread);
+#ifdef GC_DARWIN_THREADS
+ me -> stop_info.mach_thread = mach_thread_self();
+#else
+ me -> stop_info.stack_ptr = 0;
+#endif
me -> flags = si -> flags;
- me -> stack_ptr = 0;
/* me -> stack_end = GC_linux_stack_base(); -- currently (11/99) */
/* doesn't work because the stack base in /proc/self/stat is the */
/* one for the main thread. There is a strong argument that that's */
@@ -1340,12 +1146,14 @@ void * GC_start_routine(void * arg)
# ifdef STACK_GROWS_DOWN
me -> stack_end = (ptr_t)(((word)(&dummy) + (GC_page_size - 1))
& ~(GC_page_size - 1));
- me -> stack_ptr = me -> stack_end - 0x10;
+# ifndef GC_DARWIN_THREADS
+ me -> stop_info.stack_ptr = me -> stack_end - 0x10;
+# endif
/* Needs to be plausible, since an asynchronous stack mark */
/* should not crash. */
# else
me -> stack_end = (ptr_t)((word)(&dummy) & ~(GC_page_size - 1));
- me -> stack_ptr = me -> stack_end + 0x10;
+ me -> stop_info.stack_ptr = me -> stack_end + 0x10;
# endif
/* This is dubious, since we may be more than a page into the stack, */
/* and hence skip some of it, though it's not clear that matters. */
@@ -1361,9 +1169,6 @@ void * GC_start_routine(void * arg)
GC_printf1("start_routine = 0x%lx\n", start);
# endif
start_arg = si -> arg;
-# ifdef DEBUG_THREADS
- GC_printf1("sem_post from 0x%lx\n", my_pthread);
-# endif
sem_post(&(si -> registered)); /* Last action on si. */
/* OK to deallocate. */
pthread_cleanup_push(GC_thread_exit_proc, 0);
@@ -1377,7 +1182,6 @@ void * GC_start_routine(void * arg)
GC_printf1("Finishing thread 0x%x\n", pthread_self());
#endif
me -> status = result;
- me -> flags |= FINISHED;
pthread_cleanup_pop(1);
/* Cleanup acquires lock, ensuring that we can't exit */
/* while a collection that thinks we're alive is trying to stop */
@@ -1391,16 +1195,19 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
void *(*start_routine)(void *), void *arg)
{
int result;
- GC_thread t;
- pthread_t my_new_thread;
int detachstate;
word my_flags = 0;
struct start_info * si;
/* This is otherwise saved only in an area mmapped by the thread */
/* library, which isn't visible to the collector. */
+ /* We resist the temptation to muck with the stack size here, */
+ /* even if the default is unreasonably small. That's the client's */
+ /* responsibility. */
+
LOCK();
- si = (struct start_info *)GC_INTERNAL_MALLOC(sizeof(struct start_info), NORMAL);
+ si = (struct start_info *)GC_INTERNAL_MALLOC(sizeof(struct start_info),
+ NORMAL);
UNLOCK();
if (!parallel_initialized) GC_init_parallel();
if (0 == si) return(ENOMEM);
@@ -1409,9 +1216,25 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
si -> arg = arg;
LOCK();
if (!GC_thr_initialized) GC_thr_init();
+# ifdef GC_ASSERTIONS
+ {
+ int stack_size;
+ if (NULL == attr) {
+ pthread_attr_t my_attr;
+ pthread_attr_init(&my_attr);
+ pthread_attr_getstacksize(&my_attr, &stack_size);
+ } else {
+ pthread_attr_getstacksize(attr, &stack_size);
+ }
+ GC_ASSERT(stack_size >= (8*HBLKSIZE*sizeof(word)));
+ /* Our threads may need to do some work for the GC. */
+ /* Ridiculously small threads won't work, and they */
+ /* probably wouldn't work anyway. */
+ }
+# endif
if (NULL == attr) {
detachstate = PTHREAD_CREATE_JOINABLE;
- } else {
+ } else {
pthread_attr_getdetachstate(attr, &detachstate);
}
if (PTHREAD_CREATE_DETACHED == detachstate) my_flags |= DETACHED;
@@ -1421,7 +1244,9 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
GC_printf1("About to start new thread from thread 0x%X\n",
pthread_self());
# endif
+
result = REAL_FUNC(pthread_create)(new_thread, attr, GC_start_routine, si);
+
# ifdef DEBUG_THREADS
GC_printf1("Started thread 0x%X\n", *new_thread);
# endif
@@ -1429,17 +1254,16 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
/* This also ensures that we hold onto si until the child is done */
/* with it. Thus it doesn't matter whether it is otherwise */
/* visible to the collector. */
- while (0 != sem_wait(&(si -> registered))) {
- if (EINTR != errno) ABORT("sem_wait failed");
+ if (0 == result) {
+ while (0 != sem_wait(&(si -> registered))) {
+ if (EINTR != errno) ABORT("sem_wait failed");
}
-# ifdef DEBUG_THREADS
- GC_printf1("sem_wait complete from thread 0x%X\n",
- pthread_self());
-# endif
- sem_destroy(&(si -> registered));
- LOCK();
- GC_INTERNAL_FREE(si);
- UNLOCK();
+ }
+ sem_destroy(&(si -> registered));
+ LOCK();
+ GC_INTERNAL_FREE(si);
+ UNLOCK();
+
return(result);
}
@@ -1477,7 +1301,9 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
void GC_pause()
{
int i;
- volatile word dummy = 0;
+# ifndef __GNUC__
+ volatile word dummy = 0;
+# endif
for (i = 0; i < 10; ++i) {
# ifdef __GNUC__
@@ -1516,6 +1342,7 @@ VOLATILE GC_bool GC_collecting = 0;
void GC_generic_lock(pthread_mutex_t * lock)
{
+#ifndef NO_PTHREAD_TRYLOCK
unsigned pause_length = 1;
unsigned i;
@@ -1533,6 +1360,7 @@ void GC_generic_lock(pthread_mutex_t * lock)
ABORT("Unexpected error from pthread_mutex_trylock");
}
}
+#endif /* !NO_PTHREAD_TRYLOCK */
pthread_mutex_lock(lock);
}
@@ -1588,8 +1416,12 @@ yield:
return;
}
# define SLEEP_THRESHOLD 12
- /* nanosleep(<= 2ms) just spins under Linux. We */
- /* want to be careful to avoid that behavior. */
+ /* Under Linux very short sleeps tend to wait until */
+ /* the current time quantum expires. On old Linux */
+ /* kernels nanosleep(<= 2ms) just spins under Linux. */
+ /* (Under 2.4, this happens only for real-time */
+ /* processes.) We want to minimize both behaviors */
+ /* here. */
if (i < SLEEP_THRESHOLD) {
sched_yield();
} else {
@@ -1606,14 +1438,17 @@ yield:
}
#else /* !USE_SPINLOCK */
-
void GC_lock()
{
+#ifndef NO_PTHREAD_TRYLOCK
if (1 == GC_nprocs || GC_collecting) {
pthread_mutex_lock(&GC_allocate_ml);
} else {
GC_generic_lock(&GC_allocate_ml);
}
+#else /* !NO_PTHREAD_TRYLOCK */
+ pthread_mutex_lock(&GC_allocate_ml);
+#endif /* !NO_PTHREAD_TRYLOCK */
}
#endif /* !USE_SPINLOCK */
diff --git a/boehm-gc/ptr_chck.c b/boehm-gc/ptr_chck.c
index af49d5f5b79..d83d730d343 100644
--- a/boehm-gc/ptr_chck.c
+++ b/boehm-gc/ptr_chck.c
@@ -79,7 +79,7 @@ void (*GC_same_obj_print_proc) GC_PROTO((GC_PTR, GC_PTR))
return(p);
}
sz = WORDS_TO_BYTES(hhdr -> hb_sz);
- if (sz > WORDS_TO_BYTES(MAXOBJSZ)) {
+ if (sz > MAXOBJBYTES) {
base = (ptr_t)HBLKPTR(p);
limit = base + sz;
if ((ptr_t)p >= limit) {
@@ -165,7 +165,7 @@ void (*GC_is_valid_displacement_print_proc) GC_PROTO((GC_PTR)) =
pdispl = HBLKDISPL(p);
map_entry = MAP_ENTRY((hhdr -> hb_map), pdispl);
if (map_entry == OBJ_INVALID
- || sz > MAXOBJSZ && (ptr_t)p >= (ptr_t)h + sz) {
+ || sz > MAXOBJBYTES && (ptr_t)p >= (ptr_t)h + sz) {
goto fail;
}
return(p);
diff --git a/boehm-gc/reclaim.c b/boehm-gc/reclaim.c
index 0418e9dea65..323d420fa40 100644
--- a/boehm-gc/reclaim.c
+++ b/boehm-gc/reclaim.c
@@ -27,23 +27,61 @@ signed_word GC_mem_found = 0;
/* nonzero. */
#endif /* PARALLEL_MARK */
-static void report_leak(p, sz)
-ptr_t p;
-word sz;
+/* We defer printing of leaked objects until we're done with the GC */
+/* cycle, since the routine for printing objects needs to run outside */
+/* the collector, e.g. without the allocation lock. */
+#define MAX_LEAKED 40
+ptr_t GC_leaked[MAX_LEAKED];
+unsigned GC_n_leaked = 0;
+
+GC_bool GC_have_errors = FALSE;
+
+void GC_add_leaked(leaked)
+ptr_t leaked;
{
- if (HDR(p) -> hb_obj_kind == PTRFREE) {
- GC_err_printf0("Leaked atomic object at ");
- } else {
- GC_err_printf0("Leaked composite object at ");
+ if (GC_n_leaked < MAX_LEAKED) {
+ GC_have_errors = TRUE;
+ GC_leaked[GC_n_leaked++] = leaked;
+ /* Make sure it's not reclaimed this cycle */
+ GC_set_mark_bit(leaked);
}
- GC_print_heap_obj(p);
- GC_err_printf0("\n");
}
+static GC_bool printing_errors = FALSE;
+/* Print all objects on the list after printing any smashed objs. */
+/* Clear both lists. */
+void GC_print_all_errors ()
+{
+ unsigned i;
+
+ LOCK();
+ if (printing_errors) {
+ UNLOCK();
+ return;
+ }
+ printing_errors = TRUE;
+ UNLOCK();
+ if (GC_debugging_started) GC_print_all_smashed();
+ for (i = 0; i < GC_n_leaked; ++i) {
+ ptr_t p = GC_leaked[i];
+ if (HDR(p) -> hb_obj_kind == PTRFREE) {
+ GC_err_printf0("Leaked atomic object at ");
+ } else {
+ GC_err_printf0("Leaked composite object at ");
+ }
+ GC_print_heap_obj(p);
+ GC_err_printf0("\n");
+ GC_free(p);
+ GC_leaked[i] = 0;
+ }
+ GC_n_leaked = 0;
+ printing_errors = FALSE;
+}
+
+
# define FOUND_FREE(hblk, word_no) \
{ \
- report_leak((ptr_t)hblk + WORDS_TO_BYTES(word_no), \
- HDR(hblk) -> hb_sz); \
+ GC_add_leaked((ptr_t)hblk + WORDS_TO_BYTES(word_no)); \
}
/*
@@ -866,7 +904,7 @@ void GC_print_block_list()
* Clear *flp.
* This must be done before dropping a list of free gcj-style objects,
* since may otherwise end up with dangling "descriptor" pointers.
- * It may help for other pointer-containg objects.
+ * It may help for other pointer-containing objects.
*/
void GC_clear_fl_links(flp)
ptr_t *flp;
diff --git a/boehm-gc/solaris_pthreads.c b/boehm-gc/solaris_pthreads.c
index bd63e6c612c..bae77193593 100644
--- a/boehm-gc/solaris_pthreads.c
+++ b/boehm-gc/solaris_pthreads.c
@@ -13,9 +13,8 @@
/*
* Support code for Solaris threads. Provides functionality we wish Sun
* had provided. Relies on some information we probably shouldn't rely on.
- * Modified Peter C. for Solaris Posix Threads.
+ * Modified by Peter C. for Solaris Posix Threads.
*/
-/* Boehm, September 14, 1994 4:44 pm PDT */
# if defined(GC_SOLARIS_PTHREADS)
# include "private/gc_priv.h"
diff --git a/boehm-gc/solaris_threads.c b/boehm-gc/solaris_threads.c
index 2b520d3d085..5f05b19e008 100644
--- a/boehm-gc/solaris_threads.c
+++ b/boehm-gc/solaris_threads.c
@@ -37,6 +37,10 @@
# include <unistd.h>
# include <errno.h>
+#ifdef HANDLE_FORK
+ --> Not yet supported. Try porting the code from linux_threads.c.
+#endif
+
/*
* This is the default size of the LWP arrays. If there are more LWPs
* than this when a stop-the-world GC happens, set_max_lwps will be
@@ -361,7 +365,7 @@ static void restart_all_lwps()
sizeof (prgregset_t)) != 0) {
int j;
- for(j = 0; j < NGREG; j++)
+ for(j = 0; j < NPRGREG; j++)
{
GC_printf3("%i: %x -> %x\n", j,
GC_lwp_registers[i][j],
@@ -821,7 +825,7 @@ int GC_thr_suspend(thread_t target_thread)
if (result == 0) {
t = GC_lookup_thread(target_thread);
if (t == 0) ABORT("thread unknown to GC");
- t -> flags |= SUSPENDED;
+ t -> flags |= SUSPNDED;
}
UNLOCK();
return(result);
@@ -837,7 +841,7 @@ int GC_thr_continue(thread_t target_thread)
if (result == 0) {
t = GC_lookup_thread(target_thread);
if (t == 0) ABORT("thread unknown to GC");
- t -> flags &= ~SUSPENDED;
+ t -> flags &= ~SUSPNDED;
}
UNLOCK();
return(result);
@@ -923,7 +927,7 @@ GC_thr_create(void *stack_base, size_t stack_size,
my_flags |= CLIENT_OWNS_STACK;
}
if (flags & THR_DETACHED) my_flags |= DETACHED;
- if (flags & THR_SUSPENDED) my_flags |= SUSPENDED;
+ if (flags & THR_SUSPENDED) my_flags |= SUSPNDED;
result = thr_create(stack, stack_size, start_routine,
arg, flags & ~THR_DETACHED, &my_new_thread);
if (result == 0) {
diff --git a/boehm-gc/sparc_mach_dep.S b/boehm-gc/sparc_mach_dep.S
index 860eeb666f3..06a0f3b4673 100644
--- a/boehm-gc/sparc_mach_dep.S
+++ b/boehm-gc/sparc_mach_dep.S
@@ -37,7 +37,7 @@ loop:
stx %g0,[%o3] ! *(long *)p = 0
cmp %o3,%o1
bgu,pt %xcc, loop ! if (p > limit) goto loop
- add %o3,-8,%o3 ! p -= 8 (delay slot)
+ add %o3,-8,%o3 ! p -= 8 (delay slot)
retl
mov %o2,%sp ! Restore sp., delay slot
#else /* 32 bit SPARC */
diff --git a/boehm-gc/tests/test.c b/boehm-gc/tests/test.c
index 7cb4d0c768f..cfe23c0efde 100644
--- a/boehm-gc/tests/test.c
+++ b/boehm-gc/tests/test.c
@@ -43,7 +43,7 @@
# include "gc_local_alloc.h"
# endif
# include "private/gc_priv.h" /* For output, locking, MIN_WORDS, */
- /* and some statistics. */
+ /* and some statistics. */
# include "private/gcconfig.h"
# if defined(MSWIN32) || defined(MSWINCE)
@@ -68,14 +68,14 @@
# include <pthread.h>
# endif
-# ifdef GC_WIN32_THREADS
-# ifndef MSWINCE
-# include <process.h>
-# define GC_CreateThread(a,b,c,d,e,f) ((HANDLE) _beginthreadex(a,b,c,d,e,f))
-# endif
+# if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS)
static CRITICAL_SECTION incr_cs;
# endif
+#ifdef __STDC__
+# include <stdarg.h>
+#endif
+
/* Allocation Statistics */
int stubborn_count = 0;
@@ -205,40 +205,6 @@ sexpr y;
}
# endif
-sexpr small_cons (x, y)
-sexpr x;
-sexpr y;
-{
- register sexpr r;
-
- collectable_count++;
- r = (sexpr) GC_MALLOC(sizeof(struct SEXPR));
- if (r == 0) {
- (void)GC_printf0("Out of memory\n");
- exit(1);
- }
- r -> sexpr_car = x;
- r -> sexpr_cdr = y;
- return(r);
-}
-
-sexpr small_cons_uncollectable (x, y)
-sexpr x;
-sexpr y;
-{
- register sexpr r;
-
- uncollectable_count++;
- r = (sexpr) GC_MALLOC_UNCOLLECTABLE(sizeof(struct SEXPR));
- if (r == 0) {
- (void)GC_printf0("Out of memory\n");
- exit(1);
- }
- r -> sexpr_car = x;
- r -> sexpr_cdr = (sexpr)(~(unsigned long)y);
- return(r);
-}
-
#ifdef GC_GCJ_SUPPORT
#include "gc_mark.h"
@@ -279,6 +245,93 @@ struct GC_ms_entry * fake_gcj_mark_proc(word * addr,
return(mark_stack_ptr);
}
+#endif /* GC_GCJ_SUPPORT */
+
+#ifdef THREAD_LOCAL_ALLOC
+
+#undef GC_REDIRECT_TO_LOCAL
+#include "gc_local_alloc.h"
+
+sexpr local_cons (x, y)
+sexpr x;
+sexpr y;
+{
+ register sexpr r;
+ register int *p;
+ register int my_extra = extra_count;
+ static int my_random = 0;
+
+ collectable_count++;
+ r = (sexpr) GC_LOCAL_MALLOC(sizeof(struct SEXPR) + my_extra);
+# ifdef GC_GCJ_SUPPORT
+ if (collectable_count % 2 == 0) {
+ r = (sexpr) GC_LOCAL_GCJ_MALLOC(sizeof(struct SEXPR) + sizeof(GC_word) + my_extra,
+ &gcj_class_struct1);
+ r = (sexpr) ((GC_word *)r + 1);
+ }
+# endif
+ if (r == 0) {
+ (void)GC_printf0("Out of memory\n");
+ exit(1);
+ }
+ for (p = (int *)r;
+ ((char *)p) < ((char *)r) + my_extra + sizeof(struct SEXPR); p++) {
+ if (*p) {
+ (void)GC_printf1("Found nonzero at 0x%lx (local) - allocator is broken\n",
+ (unsigned long)p);
+ FAIL;
+ }
+ *p = 13;
+ }
+ r -> sexpr_car = x;
+ r -> sexpr_cdr = y;
+ my_extra++;
+ if ( my_extra >= 5000 || my_extra == 200 && ++my_random % 37 != 0) {
+ extra_count = 0;
+ } else {
+ extra_count = my_extra;
+ }
+ return(r);
+}
+#endif /* THREAD_LOCAL_ALLOC */
+
+sexpr small_cons (x, y)
+sexpr x;
+sexpr y;
+{
+ register sexpr r;
+
+ collectable_count++;
+ r = (sexpr) GC_MALLOC(sizeof(struct SEXPR));
+ if (r == 0) {
+ (void)GC_printf0("Out of memory\n");
+ exit(1);
+ }
+ r -> sexpr_car = x;
+ r -> sexpr_cdr = y;
+ return(r);
+}
+
+sexpr small_cons_uncollectable (x, y)
+sexpr x;
+sexpr y;
+{
+ register sexpr r;
+
+ uncollectable_count++;
+ r = (sexpr) GC_MALLOC_UNCOLLECTABLE(sizeof(struct SEXPR));
+ if (r == 0) {
+ (void)GC_printf0("Out of memory\n");
+ exit(1);
+ }
+ r -> sexpr_car = x;
+ r -> sexpr_cdr = (sexpr)(~(unsigned long)y);
+ return(r);
+}
+
+#ifdef GC_GCJ_SUPPORT
+
+
sexpr gcj_cons(x, y)
sexpr x;
sexpr y;
@@ -323,6 +376,9 @@ sexpr x, y;
sexpr reverse(x)
sexpr x;
{
+# ifdef TEST_WITH_SYSTEM_MALLOC
+ malloc(100000);
+# endif
return( reverse1(x, nil) );
}
@@ -365,6 +421,35 @@ int low, up;
}
#endif /* GC_GCJ_SUPPORT */
+#ifdef THREAD_LOCAL_ALLOC
+/* Return reverse(x) concatenated with y */
+sexpr local_reverse1(x, y)
+sexpr x, y;
+{
+ if (is_nil(x)) {
+ return(y);
+ } else {
+ return( local_reverse1(cdr(x), local_cons(car(x), y)) );
+ }
+}
+
+sexpr local_reverse(x)
+sexpr x;
+{
+ return( local_reverse1(x, nil) );
+}
+
+sexpr local_ints(low, up)
+int low, up;
+{
+ if (low > up) {
+ return(nil);
+ } else {
+ return(local_cons(local_cons(INT_TO_SEXPR(low), nil), local_ints(low+1, up)));
+ }
+}
+#endif /* THREAD_LOCAL_ALLOC */
+
/* To check uncollectable allocation we build lists with disguised cdr */
/* pointers, and make sure they don't go away. */
sexpr uncollectable_ints(low, up)
@@ -435,25 +520,24 @@ sexpr x;
}
}
-/* Try to force a to be strangely aligned */
-struct {
- char dummy;
- sexpr aa;
-} A;
-#define a A.aa
-
/*
* A tiny list reversal test to check thread creation.
*/
#ifdef THREADS
-# ifdef GC_WIN32_THREADS
- unsigned __stdcall tiny_reverse_test(void * arg)
+# if defined(GC_WIN32_THREADS) && !defined(CYGWIN32)
+ DWORD __stdcall tiny_reverse_test(void * arg)
# else
void * tiny_reverse_test(void * arg)
# endif
{
- check_ints(reverse(reverse(ints(1,10))), 1, 10);
+ int i;
+ for (i = 0; i < 5; ++i) {
+ check_ints(reverse(reverse(ints(1,10))), 1, 10);
+# ifdef THREAD_LOCAL_ALLOC
+ check_ints(local_reverse(local_reverse(local_ints(1,10))), 1, 10);
+# endif
+ }
return 0;
}
@@ -477,7 +561,7 @@ struct {
# elif defined(GC_WIN32_THREADS)
void fork_a_thread()
{
- unsigned thread_id;
+ DWORD thread_id;
HANDLE h;
h = GC_CreateThread(NULL, 0, tiny_reverse_test, 0, 0, &thread_id);
if (h == (HANDLE)NULL) {
@@ -506,6 +590,13 @@ struct {
#endif
+/* Try to force a to be strangely aligned */
+struct {
+ char dummy;
+ sexpr aa;
+} A;
+#define a A.aa
+
/*
* Repeatedly reverse lists built out of very different sized cons cells.
* Check that we didn't lose anything.
@@ -563,7 +654,9 @@ void reverse_test()
h = (sexpr *)GC_REALLOC((GC_PTR)h, 2000 * sizeof(sexpr));
# ifdef GC_GCJ_SUPPORT
h[1999] = gcj_ints(1,200);
- h[1999] = gcj_reverse(h[1999]);
+ for (i = 0; i < 51; ++i)
+ h[1999] = gcj_reverse(h[1999]);
+ /* Leave it as the reveresed list for now. */
# else
h[1999] = ints(1,200);
# endif
@@ -594,6 +687,9 @@ void reverse_test()
/* 49 integers. Thus this is thread safe without locks, */
/* assuming atomic pointer assignments. */
a = reverse(reverse(a));
+# ifdef THREAD_LOCAL_ALLOC
+ a = local_reverse(local_reverse(a));
+# endif
# if !defined(AT_END) && !defined(THREADS)
/* This is not thread safe, since realloc explicitly deallocates */
if (i & 1) {
@@ -621,6 +717,8 @@ void reverse_test()
b = c = 0;
}
+#undef a
+
/*
* The rest of this builds balanced binary trees, checks that they don't
* disappear, and tests finalization.
@@ -655,15 +753,17 @@ VOLATILE int dropped_something = 0;
# if defined(GC_PTHREADS)
static pthread_mutex_t incr_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_lock(&incr_lock);
-# endif
-# ifdef GC_WIN32_THREADS
- EnterCriticalSection(&incr_cs);
+# else
+# ifdef GC_WIN32_THREADS
+ EnterCriticalSection(&incr_cs);
+# endif
# endif
if ((int)(GC_word)client_data != t -> level) {
(void)GC_printf0("Wrong finalization data - collector is broken\n");
FAIL;
}
finalized_count++;
+ t -> level = -1; /* detect duplicate finalization immediately */
# ifdef PCR
PCR_ThCrSec_ExitSys();
# endif
@@ -672,9 +772,10 @@ VOLATILE int dropped_something = 0;
# endif
# if defined(GC_PTHREADS)
pthread_mutex_unlock(&incr_lock);
-# endif
-# ifdef GC_WIN32_THREADS
- LeaveCriticalSection(&incr_cs);
+# else
+# ifdef GC_WIN32_THREADS
+ LeaveCriticalSection(&incr_cs);
+# endif
# endif
}
@@ -746,9 +847,10 @@ int n;
# if defined(GC_PTHREADS)
static pthread_mutex_t incr_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_lock(&incr_lock);
-# endif
-# ifdef GC_WIN32_THREADS
- EnterCriticalSection(&incr_cs);
+# else
+# ifdef GC_WIN32_THREADS
+ EnterCriticalSection(&incr_cs);
+# endif
# endif
/* Losing a count here causes erroneous report of failure. */
finalizable_count++;
@@ -761,9 +863,10 @@ int n;
# endif
# if defined(GC_PTHREADS)
pthread_mutex_unlock(&incr_lock);
-# endif
-# ifdef GC_WIN32_THREADS
- LeaveCriticalSection(&incr_cs);
+# else
+# ifdef GC_WIN32_THREADS
+ LeaveCriticalSection(&incr_cs);
+# endif
# endif
}
@@ -1068,6 +1171,25 @@ void fail_proc1(GC_PTR x)
fail_count++;
}
+static void uniq(void *p, ...) {
+ va_list a;
+ void *q[100];
+ int n = 0, i, j;
+ q[n++] = p;
+ va_start(a,p);
+ for (;(q[n] = va_arg(a,void *));n++) ;
+ va_end(a);
+ for (i=0; i<n; i++)
+ for (j=0; j<i; j++)
+ if (q[i] == q[j]) {
+ GC_printf0(
+ "Apparently failed to mark form some function arguments.\n"
+ "Perhaps GC_push_regs was configured incorrectly?\n"
+ );
+ FAIL;
+ }
+}
+
#endif /* __STDC__ */
#ifdef THREADS
@@ -1148,6 +1270,19 @@ void run_one_test()
"GC_is_valid_displacement produced incorrect result\n");
FAIL;
}
+# if defined(__STDC__) && !defined(MSWIN32) && !defined(MSWINCE)
+ /* Harder to test under Windows without a gc.h declaration. */
+ {
+ size_t i;
+ extern void *GC_memalign();
+
+ GC_malloc(17);
+ for (i = sizeof(GC_word); i < 512; i *= 2) {
+ GC_word result = (GC_word) GC_memalign(i, 17);
+ if (result % i != 0 || result == 0 || *(int *)result != 0) FAIL;
+ }
+ }
+# endif
# ifndef ALL_INTERIOR_POINTERS
# if defined(RS6000) || defined(POWERPC)
if (!TEST_FAIL_COUNT(1)) {
@@ -1168,6 +1303,21 @@ void run_one_test()
GC_REGISTER_DISPLACEMENT(sizeof(struct fake_vtable *));
GC_init_gcj_malloc(0, (void *)fake_gcj_mark_proc);
# endif
+ /* Make sure that fn arguments are visible to the collector. */
+# ifdef __STDC__
+ uniq(
+ GC_malloc(12), GC_malloc(12), GC_malloc(12),
+ (GC_gcollect(),GC_malloc(12)),
+ GC_malloc(12), GC_malloc(12), GC_malloc(12),
+ (GC_gcollect(),GC_malloc(12)),
+ GC_malloc(12), GC_malloc(12), GC_malloc(12),
+ (GC_gcollect(),GC_malloc(12)),
+ GC_malloc(12), GC_malloc(12), GC_malloc(12),
+ (GC_gcollect(),GC_malloc(12)),
+ GC_malloc(12), GC_malloc(12), GC_malloc(12),
+ (GC_gcollect(),GC_malloc(12)),
+ (void *)0);
+# endif
/* Repeated list reversal test. */
reverse_test();
# ifdef PRINTSTATS
@@ -1183,6 +1333,15 @@ void run_one_test()
LOCK();
n_tests++;
UNLOCK();
+# if defined(THREADS) && defined(HANDLE_FORK)
+ if (fork() == 0) {
+ GC_gcollect();
+ tiny_reverse_test(0);
+ GC_gcollect();
+ GC_printf0("Finished a child process\n");
+ exit(0);
+ }
+# endif
/* GC_printf1("Finished %x\n", pthread_self()); */
}
@@ -1202,7 +1361,7 @@ void check_heap_stats()
}
# else
if (sizeof(char *) > 4) {
- max_heap_sz = 15000000;
+ max_heap_sz = 19000000;
} else {
max_heap_sz = 11000000;
}
@@ -1212,7 +1371,7 @@ void check_heap_stats()
# ifdef SAVE_CALL_CHAIN
max_heap_sz *= 3;
# ifdef SAVE_CALL_COUNT
- max_heap_sz *= SAVE_CALL_COUNT/4;
+ max_heap_sz += max_heap_sz * SAVE_CALL_COUNT/4;
# endif
# endif
# endif
@@ -1327,6 +1486,10 @@ void SetMinimumStack(long minSize)
# endif
n_tests = 0;
+#if defined(__APPLE__) && defined(__MACH__)
+ GC_INIT();
+#endif
+
# if defined(DJGPP)
/* No good way to determine stack base from library; do it */
/* manually on this platform. */
@@ -1340,13 +1503,18 @@ void SetMinimumStack(long minSize)
# endif
GC_INIT(); /* Only needed if gc is dynamic library. */
(void) GC_set_warn_proc(warn_proc);
-# if (defined(MPROTECT_VDB) || defined(PROC_VDB)) && !defined(MAKE_BACK_GRAPH)
+# if (defined(MPROTECT_VDB) || defined(PROC_VDB)) \
+ && !defined(MAKE_BACK_GRAPH)
GC_enable_incremental();
(void) GC_printf0("Switched to incremental mode\n");
# if defined(MPROTECT_VDB)
(void)GC_printf0("Emulating dirty bits with mprotect/signals\n");
# else
+# ifdef PROC_VDB
(void)GC_printf0("Reading dirty bits from /proc\n");
+# else
+ (void)GC_printf0("Using DEFAULT_VDB dirty bit implementation\n");
+# endif
# endif
# endif
run_one_test();
@@ -1378,9 +1546,9 @@ void SetMinimumStack(long minSize)
}
# endif
-#ifdef GC_WIN32_THREADS
+#if defined(GC_WIN32_THREADS) && !defined(CYGWIN32)
-unsigned __stdcall thr_run_one_test(void *arg)
+DWORD __stdcall thr_run_one_test(void *arg)
{
run_one_test();
return 0;
@@ -1412,7 +1580,7 @@ LRESULT CALLBACK window_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return ret;
}
-unsigned __stdcall thr_window(void *arg)
+DWORD __stdcall thr_window(void *arg)
{
WNDCLASS win_class = {
CS_NOCLOSE,
@@ -1474,10 +1642,11 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev, LPSTR cmd, int n)
# ifdef MSWINCE
HANDLE win_thr_h;
# endif
- unsigned thread_id;
+ DWORD thread_id;
# if 0
GC_enable_incremental();
# endif
+ GC_init();
InitializeCriticalSection(&incr_cs);
(void) GC_set_warn_proc(warn_proc);
# ifdef MSWINCE
@@ -1625,15 +1794,30 @@ main()
(void)GC_printf0("pthread_default_stacksize_np failed.\n");
}
# endif /* GC_HPUX_THREADS */
+# if defined(__APPLE__) && defined(__MACH__)
+ GC_INIT();
+# endif
+
pthread_attr_init(&attr);
-# if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS)
+# if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
+ || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
pthread_attr_setstacksize(&attr, 1000000);
# endif
n_tests = 0;
-# if defined(MPROTECT_VDB) && !defined(PARALLEL_MARK) &&!defined(REDIRECT_MALLOC) && !defined(MAKE_BACK_GRAPH)
+# if (defined(MPROTECT_VDB)) \
+ && !defined(PARALLEL_MARK) &&!defined(REDIRECT_MALLOC) \
+ && !defined(MAKE_BACK_GRAPH)
GC_enable_incremental();
(void) GC_printf0("Switched to incremental mode\n");
- (void) GC_printf0("Emulating dirty bits with mprotect/signals\n");
+# if defined(MPROTECT_VDB)
+ (void)GC_printf0("Emulating dirty bits with mprotect/signals\n");
+# else
+# ifdef PROC_VDB
+ (void)GC_printf0("Reading dirty bits from /proc\n");
+# else
+ (void)GC_printf0("Using DEFAULT_VDB dirty bit implementation\n");
+# endif
+# endif
# endif
(void) GC_set_warn_proc(warn_proc);
if ((code = pthread_key_create(&fl_key, 0)) != 0) {
diff --git a/boehm-gc/tests/test_cpp.cc b/boehm-gc/tests/test_cpp.cc
index 75fd3668605..7e50e8aa0fd 100644
--- a/boehm-gc/tests/test_cpp.cc
+++ b/boehm-gc/tests/test_cpp.cc
@@ -28,7 +28,10 @@ few minutes to complete.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef __GNUC__
+#define USE_STD_ALLOCATOR
+#ifdef USE_STD_ALLOCATOR
+# include "gc_allocator.h"
+#elif __GNUC__
# include "new_gc_alloc.h"
#else
# include "gc_alloc.h"
@@ -189,25 +192,32 @@ int APIENTRY WinMain(
# endif
#endif
+ GC_init();
+
# if defined(MACOS) // MacOS
char* argv_[] = {"test_cpp", "10"}; // doesn't
argv = argv_; // have a
argc = sizeof(argv_)/sizeof(argv_[0]); // commandline
# endif
int i, iters, n;
-# if !defined(MACOS)
+# ifdef USE_STD_ALLOCATOR
+ int *x = gc_allocator<int>().allocate(1);
+ int **xptr = traceable_allocator<int *>().allocate(1);
+# else
# ifdef __GNUC__
- int *x = (int *)gc_alloc::allocate(sizeof(int));
+ int *x = (int *)gc_alloc::allocate(sizeof(int));
# else
- int *x = (int *)alloc::allocate(sizeof(int));
+ int *x = (int *)alloc::allocate(sizeof(int));
# endif
-
- *x = 29;
- x -= 3;
+# endif
+ *x = 29;
+# ifdef USE_STD_ALLOCATOR
+ *xptr = x;
+ x = 0;
# endif
if (argc != 2 || (0 >= (n = atoi( argv[ 1 ] )))) {
- GC_printf0( "usage: test_cpp number-of-iterations\n" );
- exit( 1 );}
+ GC_printf0( "usage: test_cpp number-of-iterations\nAssuming 10 iters\n" );
+ n = 10;}
for (iters = 1; iters <= n; iters++) {
GC_printf1( "Starting iteration %d\n", iters );
@@ -268,9 +278,10 @@ int APIENTRY WinMain(
D::Test();
F::Test();}
-# if !defined(__GNUC__) && !defined(MACOS)
- my_assert (29 == x[3]);
+# ifdef USE_STD_ALLOCATOR
+ x = *xptr;
# endif
+ my_assert (29 == x[0]);
GC_printf0( "The test appears to have succeeded.\n" );
return( 0 );}
diff --git a/boehm-gc/threadlibs.c b/boehm-gc/threadlibs.c
index 99968a94a6c..247d3c652ec 100644
--- a/boehm-gc/threadlibs.c
+++ b/boehm-gc/threadlibs.c
@@ -4,13 +4,14 @@
int main()
{
# if defined(GC_USE_LD_WRAP)
- printf("-Wl,--wrap -Wl,read -Wl,--wrap -Wl,dlopen "
+ printf("-Wl,--wrap -Wl,dlopen "
"-Wl,--wrap -Wl,pthread_create -Wl,--wrap -Wl,pthread_join "
"-Wl,--wrap -Wl,pthread_detach "
"-Wl,--wrap -Wl,pthread_sigmask -Wl,--wrap -Wl,sleep\n");
# endif
# if defined(GC_LINUX_THREADS) || defined(GC_IRIX_THREADS) \
- || defined(GC_FREEBSD_THREADS) || defined(GC_SOLARIS_PTHREADS)
+ || defined(GC_FREEBSD_THREADS) || defined(GC_SOLARIS_PTHREADS) \
+ || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
printf("-lpthread\n");
# endif
# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
@@ -19,6 +20,17 @@ int main()
# if defined(GC_SOLARIS_THREADS) && !defined(GC_SOLARIS_PTHREADS)
printf("-lthread -ldl\n");
# endif
+# if defined(GC_WIN32_THREADS) && defined(CYGWIN32)
+ printf("-lpthread\n");
+# endif
+# if defined(GC_OSF1_THREADS)
+ printf("-pthread -lrt"); /* DOB: must be -pthread, not -lpthread */
+# endif
+ /* You need GCC 3.0.3 to build this one! */
+ /* DG/UX native gcc doesnt know what "-pthread" is */
+# if defined(GC_DGUX386_THREADS)
+ printf("-ldl -pthread\n");
+# endif
return 0;
}
diff --git a/boehm-gc/typd_mlc.c b/boehm-gc/typd_mlc.c
index 07717001e9d..a081c9797c3 100644
--- a/boehm-gc/typd_mlc.c
+++ b/boehm-gc/typd_mlc.c
@@ -437,6 +437,7 @@ void GC_init_explicit_typing()
for (; bm != 0; bm >>= 1, current_p++) {
if (bm & 1) {
current = *current_p;
+ FIXUP_POINTER(current);
if ((ptr_t)current >= least_ha && (ptr_t)current <= greatest_ha) {
PUSH_CONTENTS((ptr_t)current, mark_stack_ptr,
mark_stack_limit, current_p, exit1);
@@ -674,9 +675,9 @@ DCL_LOCK_STATE;
if( !FASTLOCK_SUCCEEDED() || (op = *opp) == 0 ) {
FASTUNLOCK();
op = (ptr_t)GENERAL_MALLOC((word)lb, GC_explicit_kind);
- if (0 == op) return(0);
+ if (0 == op) return 0;
# ifdef MERGE_SIZES
- lw = GC_size_map[lb]; /* May have been uninitialized. */
+ lw = GC_size_map[lb]; /* May have been uninitialized. */
# endif
} else {
*opp = obj_link(op);
@@ -720,7 +721,7 @@ DCL_LOCK_STATE;
FASTUNLOCK();
op = (ptr_t)GENERAL_MALLOC_IOP(lb, GC_explicit_kind);
# ifdef MERGE_SIZES
- lw = GC_size_map[lb]; /* May have been uninitialized. */
+ lw = GC_size_map[lb]; /* May have been uninitialized. */
# endif
} else {
*opp = obj_link(op);
diff --git a/boehm-gc/version.h b/boehm-gc/version.h
index 96b7e64cbbe..9d858b2aaa6 100644
--- a/boehm-gc/version.h
+++ b/boehm-gc/version.h
@@ -1,11 +1,30 @@
-#define GC_VERSION_MAJOR 6
-#define GC_VERSION_MINOR 1
-#define GC_ALPHA_VERSION 3
+/* The version here should match that in configure/configure.in */
+/* Eventually this one may become unnecessary. For now we need */
+/* it to keep the old-style build process working. */
+#define GC_TMP_VERSION_MAJOR 6
+#define GC_TMP_VERSION_MINOR 3
+#define GC_TMP_ALPHA_VERSION 1
+#ifndef GC_NOT_ALPHA
# define GC_NOT_ALPHA 0xff
+#endif
+
+#if defined(GC_VERSION_MAJOR)
+# if GC_TMP_VERSION_MAJOR != GC_VERSION_MAJOR || \
+ GC_TMP_VERSION_MINOR != GC_VERSION_MINOR || \
+ defined(GC_ALPHA_VERSION) != (GC_TMP_ALPHA_VERSION != GC_NOT_ALPHA) || \
+ defined(GC_ALPHA_VERSION) && GC_TMP_ALPHA_VERSION != GC_ALPHA_VERSION
+# error Inconsistent version info. Check version.h and configure.in.
+# endif
+#else
+# define GC_VERSION_MAJOR GC_TMP_VERSION_MAJOR
+# define GC_VERSION_MINOR GC_TMP_VERSION_MINOR
+# define GC_ALPHA_VERSION GC_TMP_ALPHA_VERSION
+#endif
+
#ifndef GC_NO_VERSION_VAR
-unsigned GC_version = ((GC_VERSION_MAJOR << 16) | (GC_VERSION_MINOR << 8) | GC_ALPHA_VERSION);
+unsigned GC_version = ((GC_VERSION_MAJOR << 16) | (GC_VERSION_MINOR << 8) | GC_TMP_ALPHA_VERSION);
#endif /* GC_NO_VERSION_VAR */
diff --git a/boehm-gc/win32_threads.c b/boehm-gc/win32_threads.c
index 954b18d7018..10cfef9d9eb 100644
--- a/boehm-gc/win32_threads.c
+++ b/boehm-gc/win32_threads.c
@@ -1,13 +1,28 @@
-#if defined(GC_WIN32_THREADS)
+#if defined(GC_WIN32_THREADS)
#include "private/gc_priv.h"
-
-#if 0
-#define STRICT
#include <windows.h>
+
+#ifdef CYGWIN32
+# include <errno.h>
+
+ /* Cygwin-specific forward decls */
+# undef pthread_create
+# undef pthread_sigmask
+# undef pthread_join
+# undef dlopen
+
+# define DEBUG_CYGWIN_THREADS 0
+
+ GC_bool GC_thr_initialized = FALSE;
+ void * GC_start_routine(void * arg);
+ void GC_thread_exit_proc(void *arg);
+
#endif
-#define MAX_THREADS 64
+#ifndef MAX_THREADS
+# define MAX_THREADS 64
+#endif
struct thread_entry {
LONG in_use;
@@ -18,6 +33,12 @@ struct thread_entry {
/* !in_use ==> stack == 0 */
CONTEXT context;
GC_bool suspended;
+
+# ifdef CYGWIN32
+ void *status; /* hold exit value until join in case it's a pointer */
+ pthread_t pthread_id;
+# endif
+
};
volatile GC_bool GC_please_stop = FALSE;
@@ -29,6 +50,12 @@ void GC_push_thread_structures GC_PROTO((void))
/* Unlike the other threads implementations, the thread table here */
/* contains no pointers to the collectable heap. Thus we have */
/* no private structures we need to preserve. */
+# ifdef CYGWIN32
+ { int i; /* pthreads may keep a pointer in the thread exit value */
+ for (i = 0; i < MAX_THREADS; i++)
+ if (thread_table[i].in_use) GC_push_all((ptr_t)&(thread_table[i].status),(ptr_t)(&(thread_table[i].status)+1));
+ }
+# endif
}
void GC_stop_world()
@@ -36,6 +63,10 @@ void GC_stop_world()
DWORD thread_id = GetCurrentThreadId();
int i;
+#ifdef CYGWIN32
+ if (!GC_thr_initialized) ABORT("GC_stop_world() called before GC_thr_init()");
+#endif
+
GC_please_stop = TRUE;
for (i = 0; i < MAX_THREADS; i++)
if (thread_table[i].stack != 0
@@ -53,11 +84,15 @@ void GC_stop_world()
DWORD exitCode;
if (GetExitCodeThread(thread_table[i].handle,&exitCode) &&
exitCode != STILL_ACTIVE) {
- thread_table[i].stack = 0;
+ thread_table[i].stack = 0; /* prevent stack from being pushed */
+# ifndef CYGWIN32
+ /* this breaks pthread_join on Cygwin, which is guaranteed to */
+ /* only see user pthreads */
thread_table[i].in_use = FALSE;
CloseHandle(thread_table[i].handle);
BZERO((void *)(&thread_table[i].context), sizeof(CONTEXT));
- continue;
+# endif
+ continue;
}
if (SuspendThread(thread_table[i].handle) == (DWORD)-1)
ABORT("SuspendThread failed");
@@ -335,9 +370,13 @@ void GC_get_next_stack(char *start, char **lo, char **hi)
if (*lo < start) *lo = start;
}
-#if !defined(MSWINCE) && !(defined(__MINGW32__) && !defined(_DLL))
+#if !defined(CYGWIN32)
-HANDLE WINAPI GC_CreateThread(
+#if !defined(MSWINCE) && defined(GC_DLL)
+
+/* We register threads from DllMain */
+
+GC_API HANDLE WINAPI GC_CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId )
@@ -346,7 +385,10 @@ HANDLE WINAPI GC_CreateThread(
lpParameter, dwCreationFlags, lpThreadId);
}
-#else /* !defined(MSWINCE) && !(defined(__MINGW32__) && !defined(_DLL)) */
+#else /* defined(MSWINCE) || !defined(GC_DLL)) */
+
+/* We have no DllMain to take care of new threads. Thus we */
+/* must properly intercept thread creation. */
typedef struct {
HANDLE child_ready_h, parent_ready_h;
@@ -355,9 +397,9 @@ typedef struct {
LPVOID param;
} thread_args;
-DWORD WINAPI thread_start(LPVOID arg);
+static DWORD WINAPI thread_start(LPVOID arg);
-HANDLE WINAPI GC_CreateThread(
+GC_API HANDLE WINAPI GC_CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId )
@@ -400,7 +442,17 @@ HANDLE WINAPI GC_CreateThread(
/* fill in ID and handle; tell child this is done */
thread_table[i].id = *lpThreadId;
- thread_table[i].handle = thread_h;
+ if (!DuplicateHandle(GetCurrentProcess(),
+ thread_h,
+ GetCurrentProcess(),
+ (PHANDLE) &thread_table[i].handle,
+ 0,
+ 0,
+ DUPLICATE_SAME_ACCESS)) {
+ DWORD last_error = GetLastError();
+ GC_printf1("Last error code: %lx\n", last_error);
+ ABORT("DuplicateHandle failed");
+ }
SetEvent (parent_ready_h);
/* wait for child to fill in stack and copy args */
@@ -470,7 +522,9 @@ static DWORD WINAPI thread_start(LPVOID arg)
return ret;
}
-#endif /* !defined(MSWINCE) && !(defined(__MINGW32__) && !defined(_DLL)) */
+#endif /* !defined(MSWINCE) && !(defined(__MINGW32__) && !defined(_DLL)) */
+
+#endif /* !CYGWIN32 */
#ifdef MSWINCE
@@ -527,13 +581,255 @@ DWORD WINAPI main_thread_start(LPVOID arg)
LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info);
-#ifdef GC_DLL
+/* threadAttach/threadDetach routines used by both CYGWIN and DLL
+ * implementation, since both recieve explicit notification on thread
+ * creation/destruction.
+ */
+static void threadAttach() {
+ int i;
+ /* It appears to be unsafe to acquire a lock here, since this */
+ /* code is apparently not preeemptible on some systems. */
+ /* (This is based on complaints, not on Microsoft's official */
+ /* documentation, which says this should perform "only simple */
+ /* inititalization tasks".) */
+ /* Hence we make do with nonblocking synchronization. */
+
+ /* The following should be a noop according to the win32 */
+ /* documentation. There is empirical evidence that it */
+ /* isn't. - HB */
+# if defined(MPROTECT_VDB)
+ if (GC_incremental) SetUnhandledExceptionFilter(GC_write_fault_handler);
+# endif
+ /* cast away volatile qualifier */
+ for (i = 0; InterlockedExchange((LONG*)&thread_table[i].in_use,1) != 0; i++) {
+ /* Compare-and-swap would make this cleaner, but that's not */
+ /* supported before Windows 98 and NT 4.0. In Windows 2000, */
+ /* InterlockedExchange is supposed to be replaced by */
+ /* InterlockedExchangePointer, but that's not really what I */
+ /* want here. */
+ if (i == MAX_THREADS - 1)
+ ABORT("too many threads");
+ }
+ thread_table[i].id = GetCurrentThreadId();
+# ifdef CYGWIN32
+ thread_table[i].pthread_id = pthread_self();
+# endif
+ if (!DuplicateHandle(GetCurrentProcess(),
+ GetCurrentThread(),
+ GetCurrentProcess(),
+ (HANDLE*)&thread_table[i].handle,
+ 0,
+ 0,
+ DUPLICATE_SAME_ACCESS)) {
+ DWORD last_error = GetLastError();
+ GC_printf1("Last error code: %lx\n", last_error);
+ ABORT("DuplicateHandle failed");
+ }
+ thread_table[i].stack = GC_get_stack_base();
+ if (thread_table[i].stack == NULL)
+ ABORT("Failed to find stack base in threadAttach");
+ /* If this thread is being created while we are trying to stop */
+ /* the world, wait here. Hopefully this can't happen on any */
+ /* systems that don't allow us to block here. */
+ while (GC_please_stop) Sleep(20);
+}
+
+static void threadDetach(DWORD thread_id) {
+ int i;
+
+ LOCK();
+ for (i = 0;
+ i < MAX_THREADS &&
+ (!thread_table[i].in_use || thread_table[i].id != thread_id);
+ i++) {}
+ if (i >= MAX_THREADS ) {
+ WARN("thread %ld not found on detach", (GC_word)thread_id);
+ } else {
+ thread_table[i].stack = 0;
+ thread_table[i].in_use = FALSE;
+ CloseHandle(thread_table[i].handle);
+ /* cast away volatile qualifier */
+ BZERO((void *)&thread_table[i].context, sizeof(CONTEXT));
+ }
+ UNLOCK();
+}
+
+#ifdef CYGWIN32
+
+/* Called by GC_init() - we hold the allocation lock. */
+void GC_thr_init() {
+ if (GC_thr_initialized) return;
+ GC_thr_initialized = TRUE;
+
+#if 0
+ /* this might already be handled in GC_init... */
+ InitializeCriticalSection(&GC_allocate_ml);
+#endif
+
+ /* Add the initial thread, so we can stop it. */
+ threadAttach();
+}
+
+struct start_info {
+ void *(*start_routine)(void *);
+ void *arg;
+};
+
+int GC_pthread_join(pthread_t pthread_id, void **retval) {
+ int result;
+ int i;
+
+# if DEBUG_CYGWIN_THREADS
+ GC_printf3("thread 0x%x(0x%x) is joining thread 0x%x.\n",(int)pthread_self(),
+ GetCurrentThreadId(), (int)pthread_id);
+# endif
+
+ /* Can't do any table lookups here, because thread being joined
+ might not have registered itself yet */
+
+ result = pthread_join(pthread_id, retval);
+
+ LOCK();
+ for (i = 0; !thread_table[i].in_use || thread_table[i].pthread_id != pthread_id;
+ i++) {
+ if (i == MAX_THREADS - 1) {
+ GC_printf1("Failed to find thread 0x%x in pthread_join()\n", pthread_id);
+ ABORT("thread not found on detach");
+ }
+ }
+ UNLOCK();
+ threadDetach(thread_table[i].id);
+
+# if DEBUG_CYGWIN_THREADS
+ GC_printf3("thread 0x%x(0x%x) completed join with thread 0x%x.\n",
+ (int)pthread_self(), GetCurrentThreadId(), (int)pthread_id);
+# endif
+
+ return result;
+}
+
+/* Cygwin-pthreads calls CreateThread internally, but it's not
+ * easily interceptible by us..
+ * so intercept pthread_create instead
+ */
+int
+GC_pthread_create(pthread_t *new_thread,
+ const pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg) {
+ int result;
+ struct start_info * si;
+
+ if (!GC_is_initialized) GC_init();
+ /* make sure GC is initialized (i.e. main thread is attached) */
+
+ /* This is otherwise saved only in an area mmapped by the thread */
+ /* library, which isn't visible to the collector. */
+ si = GC_malloc_uncollectable(sizeof(struct start_info));
+ if (0 == si) return(EAGAIN);
+
+ si -> start_routine = start_routine;
+ si -> arg = arg;
+
+# if DEBUG_CYGWIN_THREADS
+ GC_printf2("About to create a thread from 0x%x(0x%x)\n",(int)pthread_self(),
+ GetCurrentThreadId);
+# endif
+ result = pthread_create(new_thread, attr, GC_start_routine, si);
+
+ if (result) { /* failure */
+ GC_free(si);
+ }
+
+ return(result);
+}
+
+void * GC_start_routine(void * arg)
+{
+ struct start_info * si = arg;
+ void * result;
+ void *(*start)(void *);
+ void *start_arg;
+ pthread_t pthread_id;
+ int i;
+
+# if DEBUG_CYGWIN_THREADS
+ GC_printf2("thread 0x%x(0x%x) starting...\n",(int)pthread_self(),
+ GetCurrentThreadId());
+# endif
+
+ /* If a GC occurs before the thread is registered, that GC will */
+ /* ignore this thread. That's fine, since it will block trying to */
+ /* acquire the allocation lock, and won't yet hold interesting */
+ /* pointers. */
+ LOCK();
+ /* We register the thread here instead of in the parent, so that */
+ /* we don't need to hold the allocation lock during pthread_create. */
+ threadAttach();
+ UNLOCK();
+
+ start = si -> start_routine;
+ start_arg = si -> arg;
+ pthread_id = pthread_self();
+
+ GC_free(si); /* was allocated uncollectable */
+
+ pthread_cleanup_push(GC_thread_exit_proc, pthread_id);
+ result = (*start)(start_arg);
+ pthread_cleanup_pop(0);
+
+# if DEBUG_CYGWIN_THREADS
+ GC_printf2("thread 0x%x(0x%x) returned from start routine.\n",
+ (int)pthread_self(),GetCurrentThreadId());
+# endif
+
+ LOCK();
+ for (i = 0; thread_table[i].pthread_id != pthread_id; i++) {
+ if (i == MAX_THREADS - 1)
+ ABORT("thread not found on exit");
+ }
+ thread_table[i].status = result;
+ UNLOCK();
+
+ return(result);
+}
+
+void GC_thread_exit_proc(void *arg)
+{
+ pthread_t pthread_id = (pthread_t)arg;
+ int i;
+
+# if DEBUG_CYGWIN_THREADS
+ GC_printf2("thread 0x%x(0x%x) called pthread_exit().\n",
+ (int)pthread_self(),GetCurrentThreadId());
+# endif
+
+ LOCK();
+ for (i = 0; thread_table[i].pthread_id != pthread_id; i++) {
+ if (i == MAX_THREADS - 1)
+ ABORT("thread not found on exit");
+ }
+ UNLOCK();
+
+#if 0
+ /* TODO: we need a way to get the exit value after a pthread_exit so we can stash it safely away */
+ thread_table[i].status = ???
+#endif
+}
+
+/* nothing required here... */
+int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) {
+ return pthread_sigmask(how, set, oset);
+}
+int GC_pthread_detach(pthread_t thread) {
+ return pthread_detach(thread);
+}
+#else /* !CYGWIN32 */
/*
- * This isn't generally safe, since DllMain is not premptible.
- * If another thread holds the lock while this runs we're in trouble.
+ * We avoid acquiring locks here, since this doesn't seem to be preemptable.
* Pontus Rydin suggests wrapping the thread start routine instead.
*/
+#ifdef GC_DLL
BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
{
switch (reason) {
@@ -542,75 +838,13 @@ BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
GC_init(); /* Force initialization before thread attach. */
/* fall through */
case DLL_THREAD_ATTACH:
- {
- int i;
- /* It appears to be unsafe to acquire a lock here, since this */
- /* code is apparently not preeemptible on some systems. */
- /* (This is based on complaints, not on Microsoft's official */
- /* documentation, which says this should perform "only simple */
- /* inititalization tasks".) */
- /* Hence we make do with nonblocking synchronization. */
-
- /* The following should be a noop according to the win32 */
- /* documentation. There is empirical evidence that it */
- /* isn't. - HB */
-# ifdef MPROTECT_VDB
- if (GC_incremental) SetUnhandledExceptionFilter(GC_write_fault_handler);
-# endif
-
- for (i = 0;
- /* cast away volatile qualifier */
- InterlockedExchange((LPLONG) &thread_table[i].in_use, 1) != 0;
- i++) {
- /* Compare-and-swap would make this cleaner, but that's not */
- /* supported before Windows 98 and NT 4.0. In Windows 2000, */
- /* InterlockedExchange is supposed to be replaced by */
- /* InterlockedExchangePointer, but that's not really what I */
- /* want here. */
- if (i == MAX_THREADS - 1)
- ABORT("too many threads");
- }
- thread_table[i].id = GetCurrentThreadId();
- if (!DuplicateHandle(GetCurrentProcess(),
- GetCurrentThread(),
- GetCurrentProcess(),
- /* cast away volatile qualifier */
- (HANDLE *) &thread_table[i].handle,
- 0,
- 0,
- DUPLICATE_SAME_ACCESS)) {
- DWORD last_error = GetLastError();
- GC_printf1("Last error code: %lx\n", last_error);
- ABORT("DuplicateHandle failed");
- }
- thread_table[i].stack = GC_get_stack_base();
- /* If this thread is being created while we are trying to stop */
- /* the world, wait here. Hopefully this can't happen on any */
- /* systems that don't allow us to block here. */
- while (GC_please_stop) Sleep(20);
- }
+ threadAttach();
break;
+
case DLL_THREAD_DETACH:
- {
- int i;
- DWORD thread_id = GetCurrentThreadId();
- LOCK();
- for (i = 0;
- i < MAX_THREADS &&
- (thread_table[i].stack == 0 || thread_table[i].id != thread_id);
- i++) {}
- if (i >= MAX_THREADS) {
- WARN("thread %ld not found on detach", (GC_word)thread_id);
- } else {
- thread_table[i].stack = 0;
- thread_table[i].in_use = FALSE;
- CloseHandle(thread_table[i].handle);
- /* cast away volatile qualifier */
- BZERO((void *) &thread_table[i].context, sizeof(CONTEXT));
- }
- UNLOCK();
- }
+ threadDetach(GetCurrentThreadId());
break;
+
case DLL_PROCESS_DETACH:
{
int i;
@@ -636,8 +870,8 @@ BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
}
return TRUE;
}
-
-# endif /* GC_DLL */
+#endif /* GC_DLL */
+#endif /* !CYGWIN32 */
# endif /* !MSWINCE */
diff --git a/config-ml.in b/config-ml.in
index 1e474d3e4bc..06752b7a67d 100644
--- a/config-ml.in
+++ b/config-ml.in
@@ -1,6 +1,32 @@
# Configure fragment invoked in the post-target section for subdirs
# wanting multilib support.
#
+# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 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 report bugs to <gcc-bugs@gnu.org>
+# and send patches to <gcc-patches@gnu.org>.
+
# It is advisable to support a few --enable/--disable options to let the
# user select which libraries s/he really wants.
#
@@ -75,13 +101,12 @@
Makefile=${ac_file-Makefile}
ml_config_shell=${CONFIG_SHELL-/bin/sh}
-ml_arguments="${ac_configure_args}"
ml_realsrcdir=${srcdir}
# Scan all the arguments and set all the ones we need.
ml_verbose=--verbose
-for option in ${ml_arguments}
+for option in ${ac_configure_args}
do
case $option in
--*) ;;
@@ -107,7 +132,7 @@ do
enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
eval $enableopt="$optarg"
;;
- --norecursion | --no*)
+ --norecursion | --no-recursion)
ml_norecursion=yes
;;
--silent | --sil* | --quiet | --q*)
@@ -744,7 +769,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
fi
# find compiler flag corresponding to ${ml_dir}
- for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
+ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
dir=`echo $i | sed -e 's/;.*$//'`
if [ "${dir}" = "${ml_dir}" ]; then
flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
@@ -834,7 +859,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
- ${ml_arguments} ${ml_srcdiroption} ; then
+ ${ac_configure_args} ${ml_srcdiroption} ; then
true
else
exit 1
diff --git a/config.if b/config.if
index c38b59c841e..2655bc3b56a 100644
--- a/config.if
+++ b/config.if
@@ -3,7 +3,6 @@
# determine:
#
# 1. libstcxx_incdir: the interface name for libstdc++.
-# 2. libc_interface: the interface name for libc.
#
# Get the top level src dir.
@@ -36,53 +35,3 @@ if test -z "$gcc_version"; then
fi
libstdcxx_incdir=c++/${gcc_version}
-# The trickiest part is libc_interface.
-if [ -z "${libc_interface}" ]
-then
- case ${target_os} in
- *linux*libc1*|*linux*libc5*)
- case ${target_alias} in
- *alpha*|*powerpc*)
- libc_interface=-libc5.9-
- ;;
- *)
- libc_interface=-libc5-
- ;;
- esac
- ;;
- *linux*gnu*)
- # We have to work harder to figure it out.
- if [ ${target_alias} = ${build_alias} ]
- then
- dummy=if$$
- cat >$dummy.c <<EOF
-#include <features.h>
-main(argc, argv)
- int argc;
- char *argv[];
-{
- printf("%d\n", __GLIBC_MINOR__);
- return 0;
-}
-EOF
- ${CC-cc} $dummy.c -o $dummy 2>/dev/null
- if [ "$?" = 0 ]
- then
- libc_interface=-libc6.`./$dummy`-
- rm -f $dummy.c $dummy
- else
- # It should never happen.
- echo "Cannot find the GNU C library minor version number." >&2
- rm -f $dummy.c $dummy
- exit 1
- fi
- else
- # Cross compiling. Assume glibc 2.1.
- libc_interface=-libc6.1-
- fi
- ;;
- *)
- libc_interface=-
- ;;
- esac
-fi
diff --git a/config/no-executables.m4 b/config/no-executables.m4
new file mode 100644
index 00000000000..ca26b7112c6
--- /dev/null
+++ b/config/no-executables.m4
@@ -0,0 +1,61 @@
+# GCC_NO_EXECUTABLES
+# -----------------
+# FIXME: The GCC team has specific needs which the current Autoconf
+# framework cannot solve elegantly. This macro implements a dirty
+# hack until Autoconf is able to provide the services its users
+# need.
+#
+# Several of the support libraries that are often built with GCC can't
+# assume the tool-chain is already capable of linking a program: the
+# compiler often expects to be able to link with some of such
+# libraries.
+#
+# In several of these libraries, workarounds have been introduced to
+# avoid the AC_PROG_CC_WORKS test, that would just abort their
+# configuration. The introduction of AC_EXEEXT, enabled either by
+# libtool or by CVS autoconf, have just made matters worse.
+#
+# Unlike the previous AC_NO_EXECUTABLES, this test does not
+# disable link tests at autoconf time, but at configure time.
+# This allows AC_NO_EXECUTABLES to be invoked conditionally.
+AC_DEFUN_ONCE([GCC_NO_EXECUTABLES],
+[m4_divert_push([KILL])
+
+AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
+AC_BEFORE([$0], [AC_LINK_IFELSE])
+
+m4_define([_AC_COMPILER_EXEEXT],
+AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+# FIXME: Cleanup?
+AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes])
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+else
+ m4_defn([_AC_COMPILER_EXEEXT])dnl
+fi
+)
+
+m4_define([AC_LINK_IFELSE],
+if test x$gcc_no_link = xyes; then
+ AC_MSG_ERROR([Link tests are not allowed after [[$0]].])
+fi
+m4_defn([AC_LINK_IFELSE]))
+
+dnl This is a shame. We have to provide a default for some link tests,
+dnl similar to the default for run tests.
+m4_define([AC_FUNC_MMAP],
+if test x$gcc_no_link = xyes; then
+ if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+ ac_cv_func_mmap_fixed_mapped=no
+ fi
+fi
+if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+ m4_defn([AC_FUNC_MMAP])
+fi)
+
+m4_divert_pop()dnl
+])# GCC_NO_EXECUTABLES
diff --git a/configure b/configure
index 7f4c2f1f022..1c4da1021ae 100755
--- a/configure
+++ b/configure
@@ -658,6 +658,72 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+# Get 'install' or 'install-sh' and its variants.
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:675: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
# Autoconf M4 include file defining utility macros for complex Canadian
# cross builds.
@@ -728,8 +794,14 @@ progname=$0
# if PWD already has a value, it is probably wrong.
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
-# Export original configure arguments for use by sub-configures.
-TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
+# Export original configure arguments for use by sub-configures. These
+# will be expanded by make, so quote '$'.
+tmp="$progname $@"
+sed -e 's,\$,$$,g' <<EOF_SED > conftestsed.out
+$tmp
+EOF_SED
+TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out`
+rm -f conftestsed.out
moveifchange=${srcdir}/move-if-change
@@ -854,7 +926,7 @@ else
is_cross_compiler=yes
fi
-# Find the build and target subdirs.
+# Find the build and target subdir names.
case ${build_alias} in
"") build_noncanonical=${build} ;;
*) build_noncanonical=${build_alias} ;;
@@ -878,24 +950,6 @@ host_subdir=.
target_subdir=${target_noncanonical}
-if test ! -d ${target_subdir} ; then
- if mkdir ${target_subdir} ; then true
- else
- echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2
- exit 1
- fi
-fi
-
-if test x"${build_alias}" != x"${host}" ; then
- if test ! -d ${build_subdir} ; then
- if mkdir ${build_subdir} ; then true
- else
- echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2
- exit 1
- fi
- fi
-fi
-
# Skipdirs are removed silently.
skipdirs=
# Noconfigdirs are removed loudly.
@@ -943,7 +997,8 @@ esac
# If both --with-headers and --with-libs are specified, default to
# --without-newlib.
-if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers} != xno \
+ && test x"${with_libs}" != x && test x"${with_libs} != xno ; then
if test x"${with_newlib}" = x ; then
with_newlib=no
fi
@@ -1020,6 +1075,10 @@ case "${target}" in
*-*-chorusos)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ powerpc-*-darwin*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs target-libobjc"
+ ;;
*-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
@@ -1075,13 +1134,16 @@ case "${target}" in
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
- alpha*-*-freebsd*)
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
alpha*-*-*)
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
sh-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
@@ -1193,7 +1255,7 @@ case "${target}" in
i[3456789]86-*-coff | i[3456789]86-*-elf)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
- i[3456789]86-*-freebsd*)
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
i[3456789]86-*-linux*)
@@ -1260,7 +1322,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
m32r-*-*)
- noconfigdirs="$noconfigdirs ${libgcj} gdb"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
@@ -1395,6 +1457,9 @@ case "${target}" in
vax-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ xtensa-*-*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
ip2k-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
@@ -1617,7 +1682,7 @@ copy_dirs=
# Handle --with-headers=XXX. If the value is not "yes", the contents of
# the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-headers is only supported when cross compiling
exit 1
@@ -1634,7 +1699,7 @@ fi
# Handle --with-libs=XXX. If the value is not "yes", the contents of
# the name directories are copied to $(tooldir)/lib. Multiple directories
# are permitted.
-if test x"${with_libs}" != x ; then
+if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-libs is only supported when cross compiling
exit 1
@@ -2445,21 +2510,53 @@ serialization_dependencies=serdep.tmp
# Base args. Strip norecursion, cache-file, srcdir, host, build,
# target and nonopt. These are the ones we might not want to pass
-# down to subconfigures.
-baseargs=`echo " ${ac_configure_args} " | \
- sed -e 's/ --no[^ ]* / /' \
- -e 's/ --c[a-z-]*[= ][^ ]* / /' \
- -e 's/ --sr[a-z-]*[= ][^ ]* / /' \
- -e 's/ --ho[a-z-]*[= ][^ ]* / /' \
- -e 's/ --bu[a-z-]*[= ][^ ]* / /' \
- -e 's/ --t[a-z-]*[= ][^ ]* / /' \
- -e 's/ -cache-file[= ][^ ]* / /' \
- -e 's/ -srcdir[= ][^ ]* / /' \
- -e 's/ -host[= ][^ ]* / /' \
- -e 's/ -build[= ][^ ]* / /' \
- -e 's/ -target[= ][^ ]* / /' \
- -e "s/ [^' -][^ ]* / /" \
- -e 's/^ *//;s/ *$//'`
+# down to subconfigures. Also strip program-prefix, program-suffix,
+# and program-transform-name, so that we can pass down a consistent
+# program-transform-name. If autoconf has put single quotes around
+# any of these arguments (because they contain shell metacharacters)
+# then this will fail; in practice this only happens for
+# --program-transform-name, so be sure to override --program-transform-name
+# at the end of the argument list.
+# These will be expanded by make, so quote '$'.
+cat <<\EOF_SED > conftestsed
+s/ --no[^ ]* / /
+s/ --c[a-z-]*[= ][^ ]* / /
+s/ --sr[a-z-]*[= ][^ ]* / /
+s/ --ho[a-z-]*[= ][^ ]* / /
+s/ --bu[a-z-]*[= ][^ ]* / /
+s/ --t[a-z-]*[= ][^ ]* / /
+s/ --program-[pst][a-z-]*[= ][^ ]* / /
+s/ -cache-file[= ][^ ]* / /
+s/ -srcdir[= ][^ ]* / /
+s/ -host[= ][^ ]* / /
+s/ -build[= ][^ ]* / /
+s/ -target[= ][^ ]* / /
+s/ -program-prefix[= ][^ ]* / /
+s/ -program-suffix[= ][^ ]* / /
+s/ -program-transform-name[= ][^ ]* / /
+s/ [^' -][^ ]* / /
+s/^ *//;s/ *$//
+s,\$,$$,g
+EOF_SED
+sed -f conftestsed <<EOF_SED > conftestsed.out
+ ${ac_configure_args}
+EOF_SED
+baseargs=`cat conftestsed.out`
+rm -f conftestsed conftestsed.out
+
+# Add in --program-transform-name, after --program-prefix and
+# --program-suffix have been applied to it. Autoconf has already
+# doubled dollar signs and backslashes in program_transform_name; we want
+# the backslashes un-doubled, and then the entire thing wrapped in single
+# quotes, because this will be expanded first by make and then by the shell.
+# Also, because we want to override the logic in subdir configure scripts to
+# choose program_transform_name, replace any s,x,x, with s,y,y,.
+sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
+${program_transform_name}
+EOF_SED
+gcc_transform_name=`cat conftestsed.out`
+rm -f conftestsed.out
+baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
# For the build-side libraries, we just need to pretend we're native,
# and not use the same cache file. Multilibs are neither needed nor
@@ -2614,7 +2711,9 @@ libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_
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
+ RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
+ fi
elif test -d ${srcdir}/gcc; then
# We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
# of g++ for linking C++ or Java, because g++ has -shared-libgcc by
@@ -2708,7 +2807,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:2712: checking for $ac_word" >&5
+echo "configure:2811: 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
@@ -2741,7 +2840,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:2745: checking for $ac_word" >&5
+echo "configure:2844: 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
@@ -2780,7 +2879,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:2784: checking for $ac_word" >&5
+echo "configure:2883: 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
@@ -2813,7 +2912,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:2817: checking for $ac_word" >&5
+echo "configure:2916: 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
@@ -2852,7 +2951,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:2856: checking for $ac_word" >&5
+echo "configure:2955: 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
@@ -2885,7 +2984,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:2889: checking for $ac_word" >&5
+echo "configure:2988: 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
@@ -2924,7 +3023,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:2928: checking for $ac_word" >&5
+echo "configure:3027: 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
@@ -2957,7 +3056,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:2961: checking for $ac_word" >&5
+echo "configure:3060: 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
@@ -2996,7 +3095,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:3000: checking for $ac_word" >&5
+echo "configure:3099: 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
@@ -3029,7 +3128,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:3033: checking for $ac_word" >&5
+echo "configure:3132: 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
@@ -3068,7 +3167,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:3072: checking for $ac_word" >&5
+echo "configure:3171: 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
@@ -3101,7 +3200,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:3105: checking for $ac_word" >&5
+echo "configure:3204: 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
@@ -3140,7 +3239,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:3144: checking for $ac_word" >&5
+echo "configure:3243: 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
@@ -3173,7 +3272,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:3177: checking for $ac_word" >&5
+echo "configure:3276: 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
@@ -3212,7 +3311,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:3216: checking for $ac_word" >&5
+echo "configure:3315: 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
@@ -3245,7 +3344,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:3249: checking for $ac_word" >&5
+echo "configure:3348: 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
@@ -3284,7 +3383,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:3288: checking for $ac_word" >&5
+echo "configure:3387: 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
@@ -3317,7 +3416,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:3321: checking for $ac_word" >&5
+echo "configure:3420: 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
@@ -3365,7 +3464,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:3369: checking for $ac_word" >&5
+echo "configure:3468: 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
@@ -3398,7 +3497,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:3402: checking for $ac_word" >&5
+echo "configure:3501: 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
@@ -3437,7 +3536,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:3441: checking for $ac_word" >&5
+echo "configure:3540: 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
@@ -3470,7 +3569,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:3474: checking for $ac_word" >&5
+echo "configure:3573: 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
@@ -3509,7 +3608,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:3513: checking for $ac_word" >&5
+echo "configure:3612: 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
@@ -3542,7 +3641,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:3546: checking for $ac_word" >&5
+echo "configure:3645: 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
@@ -3581,7 +3680,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:3585: checking for $ac_word" >&5
+echo "configure:3684: 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
@@ -3614,7 +3713,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:3618: checking for $ac_word" >&5
+echo "configure:3717: 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
@@ -3653,7 +3752,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:3657: checking for $ac_word" >&5
+echo "configure:3756: 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
@@ -3686,7 +3785,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:3690: checking for $ac_word" >&5
+echo "configure:3789: 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
@@ -3725,7 +3824,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:3729: checking for $ac_word" >&5
+echo "configure:3828: 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
@@ -3758,7 +3857,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:3762: checking for $ac_word" >&5
+echo "configure:3861: 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
@@ -3797,7 +3896,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:3801: checking for $ac_word" >&5
+echo "configure:3900: 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
@@ -3830,7 +3929,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:3834: checking for $ac_word" >&5
+echo "configure:3933: 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
@@ -3897,7 +3996,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:3901: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4000: 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"
@@ -4029,6 +4128,7 @@ do
done
ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
@@ -4077,6 +4177,9 @@ 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%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g
s%@build_subdir@%$build_subdir%g
s%@host_subdir@%$host_subdir%g
@@ -4242,6 +4345,10 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
echo creating "$ac_file"
rm -f "$ac_file"
@@ -4257,6 +4364,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
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*
diff --git a/configure.in b/configure.in
index 1ace2dca056..3d30f62b792 100644
--- a/configure.in
+++ b/configure.in
@@ -23,6 +23,9 @@ AC_PREREQ(2.13)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
+# Get 'install' or 'install-sh' and its variants.
+AC_PROG_INSTALL
+
sinclude(config/acx.m4)
### we might need to use some other shell than /bin/sh for running subshells
@@ -63,8 +66,14 @@ progname=$0
# if PWD already has a value, it is probably wrong.
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
-# Export original configure arguments for use by sub-configures.
-TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
+# Export original configure arguments for use by sub-configures. These
+# will be expanded by make, so quote '$'.
+tmp="$progname $@"
+sed -e 's,\$,$$,g' <<EOF_SED > conftestsed.out
+$tmp
+EOF_SED
+TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out`
+rm -f conftestsed.out
AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
moveifchange=${srcdir}/move-if-change
@@ -189,27 +198,9 @@ else
is_cross_compiler=yes
fi
-# Find the build and target subdirs.
+# Find the build and target subdir names.
GCC_TOPLEV_SUBDIRS
-if test ! -d ${target_subdir} ; then
- if mkdir ${target_subdir} ; then true
- else
- echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2
- exit 1
- fi
-fi
-
-if test x"${build_alias}" != x"${host}" ; then
- if test ! -d ${build_subdir} ; then
- if mkdir ${build_subdir} ; then true
- else
- echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2
- exit 1
- fi
- fi
-fi
-
# Skipdirs are removed silently.
skipdirs=
# Noconfigdirs are removed loudly.
@@ -257,7 +248,8 @@ esac
# If both --with-headers and --with-libs are specified, default to
# --without-newlib.
-if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers} != xno \
+ && test x"${with_libs}" != x && test x"${with_libs} != xno ; then
if test x"${with_newlib}" = x ; then
with_newlib=no
fi
@@ -334,6 +326,10 @@ case "${target}" in
*-*-chorusos)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ powerpc-*-darwin*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs target-libobjc"
+ ;;
*-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
@@ -389,13 +385,16 @@ case "${target}" in
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
- alpha*-*-freebsd*)
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
alpha*-*-*)
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
sh-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
@@ -507,7 +506,7 @@ case "${target}" in
i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
- i[[3456789]]86-*-freebsd*)
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
i[[3456789]]86-*-linux*)
@@ -574,7 +573,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
m32r-*-*)
- noconfigdirs="$noconfigdirs ${libgcj} gdb"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
@@ -709,6 +708,9 @@ case "${target}" in
vax-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ xtensa-*-*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
ip2k-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
@@ -931,7 +933,7 @@ copy_dirs=
# Handle --with-headers=XXX. If the value is not "yes", the contents of
# the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-headers is only supported when cross compiling
exit 1
@@ -948,7 +950,7 @@ fi
# Handle --with-libs=XXX. If the value is not "yes", the contents of
# the name directories are copied to $(tooldir)/lib. Multiple directories
# are permitted.
-if test x"${with_libs}" != x ; then
+if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-libs is only supported when cross compiling
exit 1
@@ -1758,21 +1760,53 @@ AC_SUBST_FILE(serialization_dependencies)
# Base args. Strip norecursion, cache-file, srcdir, host, build,
# target and nonopt. These are the ones we might not want to pass
-# down to subconfigures.
-baseargs=`echo " ${ac_configure_args} " | \
- sed -e 's/ --no[[^ ]]* / /' \
- -e 's/ --c[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --sr[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --ho[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --bu[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --t[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ -cache-file[[= ]][[^ ]]* / /' \
- -e 's/ -srcdir[[= ]][[^ ]]* / /' \
- -e 's/ -host[[= ]][[^ ]]* / /' \
- -e 's/ -build[[= ]][[^ ]]* / /' \
- -e 's/ -target[[= ]][[^ ]]* / /' \
- -e "s/ [[^' -][^ ]*] / /" \
- -e 's/^ *//;s/ *$//'`
+# down to subconfigures. Also strip program-prefix, program-suffix,
+# and program-transform-name, so that we can pass down a consistent
+# program-transform-name. If autoconf has put single quotes around
+# any of these arguments (because they contain shell metacharacters)
+# then this will fail; in practice this only happens for
+# --program-transform-name, so be sure to override --program-transform-name
+# at the end of the argument list.
+# These will be expanded by make, so quote '$'.
+cat <<\EOF_SED > conftestsed
+s/ --no[[^ ]]* / /
+s/ --c[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --sr[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --ho[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --bu[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --t[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / /
+s/ -cache-file[[= ]][[^ ]]* / /
+s/ -srcdir[[= ]][[^ ]]* / /
+s/ -host[[= ]][[^ ]]* / /
+s/ -build[[= ]][[^ ]]* / /
+s/ -target[[= ]][[^ ]]* / /
+s/ -program-prefix[[= ]][[^ ]]* / /
+s/ -program-suffix[[= ]][[^ ]]* / /
+s/ -program-transform-name[[= ]][[^ ]]* / /
+s/ [[^' -][^ ]*] / /
+s/^ *//;s/ *$//
+s,\$,$$,g
+EOF_SED
+sed -f conftestsed <<EOF_SED > conftestsed.out
+ ${ac_configure_args}
+EOF_SED
+baseargs=`cat conftestsed.out`
+rm -f conftestsed conftestsed.out
+
+# Add in --program-transform-name, after --program-prefix and
+# --program-suffix have been applied to it. Autoconf has already
+# doubled dollar signs and backslashes in program_transform_name; we want
+# the backslashes un-doubled, and then the entire thing wrapped in single
+# quotes, because this will be expanded first by make and then by the shell.
+# Also, because we want to override the logic in subdir configure scripts to
+# choose program_transform_name, replace any s,x,x, with s,y,y,.
+sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
+${program_transform_name}
+EOF_SED
+gcc_transform_name=`cat conftestsed.out`
+rm -f conftestsed.out
+baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
# For the build-side libraries, we just need to pretend we're native,
# and not use the same cache file. Multilibs are neither needed nor
@@ -1927,7 +1961,9 @@ libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_
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
+ RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
+ fi
elif test -d ${srcdir}/gcc; then
# We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
# of g++ for linking C++ or Java, because g++ has -shared-libgcc by
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 6cde5eeb3a8..f472267833c 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,24 @@
+2003-08-21 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_build: Fix handling of -t option. Add -x option.
+
+2003-07-31 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * texi2pod.pl: Remove extra line.
+
+2003-07-15 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * texi2pod.pl: Default @itemize's parameter to @bullet.
+
+2003-07-12 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc_update: gcc/acconfig.h no longer exists.
+
+2003-07-11 Matthias Klose <doko@debian.org>
+
+ * test_installed: Add options to run objc tests.
+ In generated site.exp, initialize rootme, CFLAGS, CXXFLAGS.
+
2003-07-04 Zack Weinberg <zack@codesourcery.com>
* gcc_update: Remove gcc/intl/plural.c from list.
diff --git a/contrib/gcc_build b/contrib/gcc_build
index 21379fb9de1..b36685eeea3 100755
--- a/contrib/gcc_build
+++ b/contrib/gcc_build
@@ -66,6 +66,7 @@ gcc_build [-c configure_options]
[-u username]
[-p protocol]
[-t tarfile]
+ [-x make_check_options]
[bootstrap]
[build]
[checkout]
@@ -174,7 +175,7 @@ test_gcc() {
changedir ${OBJDIR}
echo "Running tests... This will take a while."
- ${MAKE} -k check
+ eval \${MAKE} -k ${MAKE_CHECK_OPTIONS} check
${DESTINATION}/contrib/test_summary
}
@@ -233,8 +234,10 @@ TARFILE="${HOME}/dev/gcc.tgz"
CONFIGURE_OPTIONS=
# The `make' program.
MAKE=${MAKE:-make}
-# Options to pass to make.
+# Options to pass to "make bootstrap".
MAKE_BOOTSTRAP_OPTIONS=
+# Options to pass to "make check".
+MAKE_CHECK_OPTIONS=
# Modes of operation
BOOTSTRAP=0
@@ -250,14 +253,15 @@ UPDATE=0
########################################################################
# Parse the options.
-while getopts "c:d:m:o:p:t:u:" ARG; do
+while getopts "c:d:m:o:p:t:u:x:" ARG; do
case $ARG in
c) CONFIGURE_OPTIONS="${OPTARG}";;
d) DESTINATION="${OPTARG}";;
m) MAKE_BOOTSTRAP_OPTIONS="${OPTARG}";;
o) OBJDIR="${OPTARG}";;
p) CVS_PROTOCOL="${OPTARG}";;
- t) CVS_TARGFILE="${OPTARG}";;
+ t) TARFILE="${OPTARG}";;
+ x) MAKE_CHECK_OPTIONS="${OPTARG}";;
u) CVS_USERNAME="${OPTARG}";;
\?) usage;;
esac
diff --git a/contrib/gcc_update b/contrib/gcc_update
index 0563c1d1c1a..3792807c285 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -72,7 +72,7 @@ intl/configure: intl/configure.in intl/aclocal.m4
intl/config.h.in: intl/configure.in intl/aclocal.m4
# Now, proceed to gcc automatically generated files
gcc/configure: gcc/configure.in
-gcc/cstamp-h.in: gcc/configure.in gcc/acconfig.h
+gcc/cstamp-h.in: gcc/configure.in
gcc/config.in: gcc/cstamp-h.in
gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def
# And then, language-specific files
diff --git a/contrib/regression/ChangeLog b/contrib/regression/ChangeLog
index b7759bc96b7..09c920aa8e2 100644
--- a/contrib/regression/ChangeLog
+++ b/contrib/regression/ChangeLog
@@ -1,3 +1,11 @@
+2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * btest-gcc.sh: Add make check-target-libffi.
+
+2003-07-31 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * btest-gcc.sh: Add make check-target-libjava.
+
2002-10-22 Geoffrey Keating <geoffk@apple.com>
* btest-gcc.sh: Add gdb.sum to TESTLOGS only when GDB testsuite is run.
@@ -27,5 +35,3 @@
* site.exp: New file.
* ChangeLog: New file.
* README: New file.
-
-
diff --git a/contrib/regression/btest-gcc.sh b/contrib/regression/btest-gcc.sh
index 524dfd9cffd..4978c49e083 100755
--- a/contrib/regression/btest-gcc.sh
+++ b/contrib/regression/btest-gcc.sh
@@ -101,6 +101,8 @@ gcc/testsuite/g++.sum
gcc/testsuite/g77.sum
gcc/testsuite/objc.sum"
# $H_TARGET/libstdc++-v3/testsuite/libstdc++-v3.sum
+# $H_TARGET/libjava/testsuite/libjava.sum
+# $H_TARGET/libffi/testsuite/libffi.sum
# Build.
echo build > $RESULT
@@ -124,6 +126,12 @@ make -k check-gcc
# Test libstd++-v3
make check-target-libstdc++-v3
+# Test libffi
+make check-target-libffi
+
+# Test libjava
+make check-target-libjava
+
# Test the just-built GCC with the GDB testsuite.
if [ -d $GDB_TESTSUITE ] ; then
mkdir test-gdb || exit 1
diff --git a/contrib/test_installed b/contrib/test_installed
index b4c32835d9c..7a363d6872b 100755
--- a/contrib/test_installed
+++ b/contrib/test_installed
@@ -1,6 +1,6 @@
#! /bin/sh
-# (C) 1998, 2000, 2002 Free Software Foundation
+# (C) 1998, 2000, 2002, 2003 Free Software Foundation
# Originally by Alexandre Oliva <oliva@dcc.unicamp.br>
# This script is Free Software, and it can be copied, distributed and
@@ -54,11 +54,12 @@ while true; do
--without-gcc) GCC_UNDER_TEST=no; shift;;
--without-g++) GXX_UNDER_TEST=no; shift;;
--without-g77) G77_UNDER_TEST=no; shift;;
+ --without-objc) OBJC_UNDER_TEST=no; shift;;
--tmpdir=*) tmpdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--help) cat <<\EOF
-Runs the testsuite for an installed version of gcc/g++/g77
+Runs the testsuite for an installed version of gcc/g++/g77/objc
Copyright (C) 1998 Free Software Foundation
by Alexandre Oliva <oliva@dcc.unicamp.br>
@@ -77,6 +78,7 @@ Supported arguments:
--without-gcc do not run gcc testsuite
--without-g++ do not run g++ testsuite
--without-g77 do not run g77 testsuite
+--without-objc do not run objc testsuite
--tmpdir=/some/dir create temporaries and leave failed programs
at specified directory [.]
@@ -100,15 +102,20 @@ if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then
fi
cat >site.exp <<EOF
+set rootme "."
set tmpdir "${tmpdir-`${PWDCMD-pwd}`}"
set srcdir "${testsuite-${srcdir}/gcc/testsuite}"
+set CFLAGS ""
+set CXXFLAGS ""
set GCC_UNDER_TEST "${GCC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}g++}"
set G77_UNDER_TEST "${G77_UNDER_TEST-${prefix}${prefix+/bin/}g77}"
+set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
EOF
test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"}
test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"}
test x"${G77_UNDER_TEST}" = x"no" || runtest --tool g77 ${1+"$@"}
+test x"${OBJC_UNDER_TEST}" = x"no" || runtest --tool objc ${1+"$@"}
exit 0
diff --git a/contrib/texi2pod.pl b/contrib/texi2pod.pl
index 8c63ba29200..9d4bb541903 100755
--- a/contrib/texi2pod.pl
+++ b/contrib/texi2pod.pl
@@ -241,10 +241,14 @@ while(<$inf>) {
and $_ = "\n=head3 $1\n";
# Block command handlers:
- /^\@itemize\s+(\@[a-z]+|\*|-)/ and do {
+ /^\@itemize(?:\s+(\@[a-z]+|\*|-))?/ and do {
push @endwstack, $endw;
push @icstack, $ic;
- $ic = $1;
+ if (defined $1) {
+ $ic = $1;
+ } else {
+ $ic = '@bullet';
+ }
$_ = "\n=over 4\n";
$endw = "itemize";
};
diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog
index ff91e9c2b3b..2653d1725e3 100644
--- a/fastjar/ChangeLog
+++ b/fastjar/ChangeLog
@@ -1,3 +1,17 @@
+2003-08-13 Matthias Klose <doko@debian.org>
+
+ * fastjar.texi: License manual under the GPL.
+ * Makefile.am: Remove reference to fdl.texi
+ * Makefile.in: Regenerate
+
+2003-07-29 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * mkinstalldirs: Import autoconf 2.57 / automake 1.7 version.
+
+2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README: Note that FastJar is not part of GCC.
+
2003-07-02 Nathanael Nerode <neroden@gcc.gnu.org>
PR java/9532
diff --git a/fastjar/Makefile.am b/fastjar/Makefile.am
index 74f491e850c..fa31b9235fb 100644
--- a/fastjar/Makefile.am
+++ b/fastjar/Makefile.am
@@ -62,7 +62,6 @@ TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
info_TEXINFOS = fastjar.texi
fastjar_TEXINFOS = \
../gcc/doc/include/gcc-common.texi \
- ../gcc/doc/include/fdl.texi \
../gcc/doc/include/gpl.texi
man_MANS = jar.1 grepjar.1
EXTRA_DIST = $(man_MANS)
diff --git a/fastjar/Makefile.in b/fastjar/Makefile.in
index fe294dcd42f..b79a3ade06e 100644
--- a/fastjar/Makefile.in
+++ b/fastjar/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -80,40 +80,7 @@ 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
@@ -121,14 +88,12 @@ 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)
@@ -137,10 +102,7 @@ AM_CFLAGS = @fastjar_warn_cflags@
TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
info_TEXINFOS = fastjar.texi
-fastjar_TEXINFOS = \
- ../gcc/doc/include/gcc-common.texi \
- ../gcc/doc/include/fdl.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)
@@ -185,7 +147,7 @@ missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
SOURCES = $(jar_SOURCES) $(grepjar_SOURCES)
OBJECTS = $(jar_OBJECTS) $(grepjar_OBJECTS)
@@ -369,7 +331,7 @@ uninstall-info:
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- test -z "$ii" \
+ test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
@@ -464,7 +426,7 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
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)
+ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP))
mostlyclean-tags:
diff --git a/fastjar/README b/fastjar/README
index d3f87a8b860..a16a501829d 100644
--- a/fastjar/README
+++ b/fastjar/README
@@ -1,3 +1,6 @@
+This directory contains the FastJar package, which is not part of GCC but
+shipped with GCC as convenience.
+
=======
FastJar 0.90
diff --git a/fastjar/fastjar.texi b/fastjar/fastjar.texi
index b7c1259f05a..e033da8b400 100644
--- a/fastjar/fastjar.texi
+++ b/fastjar/fastjar.texi
@@ -32,35 +32,19 @@
@end format
@c man begin COPYRIGHT
-Copyright (C) @value{copyrights-fastjar} Free Software Foundation, Inc.
+Copyright (C) @value{copyrights-fastjar} Matthias Klose
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version. A copy of the license is included in the
@c man end
-section entitled
-``GNU Free Documentation License''.
+section entitled ``GNU General Public License''.
@ignore
@c man begin COPYRIGHT
-man page gfdl(7).
+man page gpl(7).
@c man end
@end ignore
-
-@c man begin COPYRIGHT
-
-(a) The FSF's Front-Cover Text is:
-
- A GNU Manual
-
-(b) The FSF's Back-Cover Text is:
-
- You have freedom to copy and modify this GNU Manual, like GNU
- software. Copies published by the Free Software Foundation raise
- funds for GNU development.
-@c man end
@end ifinfo
@titlepage
@@ -69,7 +53,7 @@ man page gfdl(7).
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc.
+Copyright @copyright{} @value{copyrights-gcj} Matthias Klose
@sp 2
For the @value{which-gcj} Version*
@sp 1
@@ -78,22 +62,10 @@ Published by the Free Software Foundation @*
Boston, MA 02111-1307, USA@*
@sp 1
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
-
-(a) The FSF's Front-Cover Text is:
-
- A GNU Manual
-
-(b) The FSF's Back-Cover Text is:
-
- You have freedom to copy and modify this GNU Manual, like GNU
- software. Copies published by the Free Software Foundation raise
- funds for GNU development.
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version. A copy of the license is included in the
+section entitled ``GNU General Public License''.
@end titlepage
@contents
@page
@@ -108,8 +80,6 @@ This manual describes how to use @command{jar} and @command{grepjar}.
* Invoking jar:: Options supported by @command{jar}
* Invoking grepjar:: Options supported by @command{grepjar}
* Copying:: The GNU General Public License
-* GNU Free Documentation License::
- How you can share and copy this manual
@end menu
@node Invoking jar
@@ -260,6 +230,4 @@ Print version number, then exit.
@include gpl.texi
-@include fdl.texi
-
@bye
diff --git a/fastjar/mkinstalldirs b/fastjar/mkinstalldirs
index 4f58503ea4e..d2d5f21b611 100755
--- a/fastjar/mkinstalldirs
+++ b/fastjar/mkinstalldirs
@@ -4,37 +4,108 @@
# Created: 1993-05-16
# 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
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
for file
do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
+ 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
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
+ mkdir "$pathcomp" || lasterr=$?
- 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=$?
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
- pathcomp="$pathcomp/"
- done
+ pathcomp="$pathcomp/"
+ done
done
exit $errstatus
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
# mkinstalldirs ends here
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d3cde5c85d3..9d6f3b41d6f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,6650 @@
-Wed Jul 9 16:16:30 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-09-22 Bernardo Innocenti <bernie@develer.com>
+
+ * doc/contrib.texi: Add Peter Barada, Paul Dale and myself.
+
+2003-09-22 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k.h (MASK_RTD, TARGET_RTD, RETURN_POPS_ARGS):
+ Resurrect -mrtd option.
+
+2003-09-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/12281
+ * config/darwin.c (machopic_validate_stub_or_non_lazy_ptr): Call
+ mark_referenced instead of setting TREE_SYMBOL_REFERENCED.
+
+2003-09-22 Olivier Hainque <hainque@act-europe.fr>
+
+ PR target/9786
+ * reg-stack.c (convert_regs_1): Purge possible dead eh edges
+ after potential deletion of trapping insn. Avoids later ICE
+ from call to fixup_abnormal_edges.
+ (convert_regs_2): Stack the current block successors before
+ processing this block, that is, before the potential deletion of
+ dead edges by convert_regs_1, because these edges have been used
+ to initialize the predecessors count.
+
+2003-09-22 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * real.c: Fix several nits in the head comment.
+
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * tree.h c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c,
+ diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c,
+ print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c,
+ tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c,
+ config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Revert.
+
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
+ (TREE_FILENAME, TREE_LINENO): Likewise.
+ (set_tree_locus, copy_tree_locus, set_tree_file_line): New.
+ (TREE_LOCUS_SET_P): New.
+ * c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c,
+ diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c,
+ print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c,
+ tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c,
+ config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match.
+
+2003-09-21 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/vax/vax-protos.h: Convert to ISO C90.
+ * config/vax/vax.c: Convert to ISO C90.
+
+2003-09-21 Graham Stott <grahams@btinternet.com>
+
+ PR target/12353
+ * config/i386/i386.md(ffs_no_cmove): Fix operand 2 constraint.
+
+2003-09-21 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/12301
+ * reorg.c (stop_search_p): Return 1 for insns that can
+ throw internally.
+
+2003-09-20 Richard Henderson <rth@redhat.com>
+
+ * c-format.c (gcc_diag_char_table): Add %J.
+ (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
+ (check_format_types): Fix wanted_type name lookup.
+ (init_dynamic_diag_info): Setup %J.
+ * diagnostic.c (text_specifies_location): Implement %J.
+ * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
+ dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
+ tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
+ config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
+ config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.
+
+ * tree-inline.c: Include intl.h
+ (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
+ * Makefile.in (tree-inline.o): Update.
+
+2003-09-20 Roger Sayle <roger@eyesopen.com>
+
+ * config/i386/i386.c (ix86_expand_carry_flag_compare): Fix
+ transformation of a>=0 into (unsigned)a<0x80000000.
+
+2003-09-20 Andrew Pinski <apinski@apple.com>
+
+ * config/darwin.c (machopic_select_rtx_section): Fix check for PIC code.
+
+2003-09-20 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.in: Don't set (unused) DLLTOOL.
+
+ * config/arm/t-linux, config/arm/t-netbsd, config/arm-t-semi:
+ Remove obsolete references to ENQUIRE.
+
+2003-09-19 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Remove --with-elf, which doesn't work.
+ * configure: Regenerate.
+ * config.gcc: Remove references to $elf, which does nothing.
+
+ * config/i386/xm-vsta.h: Remove xm-file believed useless.
+ * config.build (i386-vsta): Remove reference to it.
+ * config.host (i386-vsta): Remove reference to it.
+
+2003-09-19 Phil Edwards <phil@codesourcery.com>
+
+ * doc/install.texi: Document the multiple testsuite options.
+
+2003-09-19 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/install.texi (Specific): Add the specific versions of GCC
+ where support for FreeBSD 1, HP-UX version 9 and older, and AIX
+ version 3 and older was discontinued.
+
+2003-09-19 Joel Sherrill <joel@oarcorp.com>
+
+ * config/m68k/t-m68kbare, config/m68k/t-rtems: Change 68681 to
+ 68881.
+
+2003-09-19 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k.h (TARGET_CPU_CPP_PREDEFINES): Add predefines
+ for -m68030, -m68020-60 and -m68020-40.
+ * config/m68k/m68k.h (TARGET_68030): New target flag.
+ * config/m68k/m68k.h (MASK_RTD, TARGET_RTD, MASK_REGPARM,
+ TARGET_REGPARM): Remove.
+ * config/m68k/m68k.h: Regroup and renumber target flags.
+ * config/m68k/m68k.h (TARGET_SWITCHES): Fix some tabulations.
+ * config/m68k/m68k.h (RETURN_POPS_ARGS): Always evaluate to 0.
+ * config/m68k/m68k.h (FUNCTION_ARG): Likewise.
+ * config/m68k/m68k.h (FUNCTION_ARG_PARTIAL_NREGS): Likewise.
+ * config/m68k/m68k-none.h: Use MASK_xxx values in M68K_CPU_xxx macros.
+
+2003-09-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * config/m68k/t-rtems (m68k-*-rtems*): New.
+ * config.gcc: Use config/m68k/t-rtems.
+
+2003-09-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * config/mips/t-rtems: New.
+ * config.gcc (mips*-*-rtems*): Use config/mips/t-rtems.
+
+2003-09-19 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * cgraph.c: Fix typo in debugging output.
+
+2003-09-19 T. Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+ Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/12166
+ * config/sparc/sol2-c1.asm (start): Set __Argv if GCRT1.
+
+2003-09-18 Mike Stump <mrs@apple.com>
+
+ * c-ppoutput.c (print): Use fileline typedef for field 'line'.
+ (print_line, maybe_print_line, cb_define, cb_undef, cb_include,
+ cb_ident, cb_def_pragma): Use fileline typedef.
+ * cpphash.h (struct cpp_reader): Likewise for field out.first_line.
+
+2003-09-18 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/winnt.c (gen_stdcall_suffix): Quit summation of
+ total parm size if a parm has incomplete type.
+ (gen_fastcall_suffix): Likewise.
+
+2003-09-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * except.c (output_function_exception_table): Adjust last change
+ to handle TYPE of INTEGER_CST.
+
+2003-09-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR target/11184
+ * builtins.c (expand_builtin_apply): Use convert_memory_address
+ before returning the value.
+
+ * alias.c (find_base_value): Simplify use of
+ convert_memory_address.
+ (find_base_term): Likewise.
+ * builtins.c (expand_builtin_stejmp_setup): Likewise.
+ (expand_builtin_longjmp): Likewise.
+ (expand_builtin_prefetch): Likewise.
+ (get_memory_rtx): Likewise.
+ (expand_builtin_return): Likewise.
+ (expand_builtin_memcpy): Likewise.
+ (expand_builtin_strncpy): Likewise.
+ (expand_builtin_memset): Likewise.
+ (expand_builtin_va_arg): Likewise.
+ (expand_builtin_va_copy): Likewise.
+ (expand_builtin_alloca): Likewise.
+ * calls.c (expand_call): Likewise.
+ * except.c (expand_builtin_extract_return_addr): Likewise.
+ (expand_builtin_eh_return): Likewise.
+ * explow.c (convert_memory_address): Define even when
+ POINTER_EXTEND_UNSIGNED is not defined. Do nothing if the address
+ is already in the right mode.
+ * explow.c (memory_address): Simplify use of convert_memory_address.
+ (probe_stack_range): Likewise.
+ * expmed.c (make_tree): Likewise.
+ * expr.c (emit_block_move_in_libcall): Likewise.
+ (expand_assignment): Likewise.
+ (expand_expr): Likewise.
+ * function.c (assign_parms): Likewise.
+ (expand_function_end): Likewise.
+ * integrate.c (copy_rtx_and_substitute): Likewise.
+ * stmt.c (expand_computed_goto): Likewise.
+
+2003-09-18 Roger Sayle <roger@eyesopen.com>
+
+ * simplify-rtx.c (simplify_unary_operation): Only transform
+ (not (eq X Y)) into (ne X Y) when mode is BImode or STORE_FLAG_VALUE
+ is -1. RTL "not" is a bit-wise not, "~", not a logical not "!".
+
+2003-09-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR target/11674
+ * config/i386/i386.c (x86_emit_floatuns): Also handle SImode operand.
+
+2003-09-18 Roger Sayle <roger@eyesopen.com>
+
+ * tree.def (FFS_EXPR, CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR,
+ PARITY_EXPR): Delete unused tree codes.
+ * c-common.c (c_common_truthvalue_conversion): Delete references
+ to FFS_EXPR and POPCOUNT_EXPR.
+ * c-pretty-print.c (pp_c_postfix_expression): Remove FFS_EXPR.
+ (pp_c_expression): Likewise.
+ * expr.c (expand_expr): Delete RTL expansion of FFS_EXPR, CLZ_EXPR,
+ CTZ_EXPR, POPCOUNT_EXPR and PARITY_EXPR.
+ * fold-const.c (tree_expr_nonnegative_p): Remove FFS_EXPR, CLZ_EXPR,
+ CTZ_EXPR, POPCOUNT_EXPR and PARITY_EXPR. Add support for calls to
+ BUILT_IN_FFS, BUILT_IN_PARITY and BUILT_IN_POPCOUNT and their long
+ and long long variants.
+
+2003-09-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-pretty-print.h (pp_type_specifier_seq): Fix thinko.
+ * c-pretty-print.c: Fix formatting.
+ (pp_c_integer_constant): Append type annotation to literals. Tidy.
+ (pp_c_type_specifier): Tidy.
+ (pp_c_compound_literal): New function.
+ (pp_c_initializer): Simplify..
+ (pp_c_initializer_list): Likewise.
+ (pp_c_brace_enclosed_initializer_list): New function.
+ (pp_c_postfix_expression): Simplify.
+
+2003-09-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mn10300/mn10300.md (andsi3, iorsi3, xorsi3,
+ one_complsi2, bit-clear, bit-set, iorqi3): Make them set_zn.
+
+2003-09-17 Richard Henderson <rth@redhat.com>
+
+ * tree-optimize.c (tree_rest_of_compilation): Save and restore
+ input_location.
+
+2003-09-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/rs6000/sysv4.h (LIB_LINUX_SPEC): Give -lpthread before -lc.
+
+2003-09-17 Richard Henderson <rth@redhat.com>
+
+ * cfg.c (dump_flow_info): Skip register dump if reg_n_info null.
+
+2003-09-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (gcc_cv_ld_hidden): Don't test gnu_ld_flag.
+ * configure: Regenerate.
+
+2003-09-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/12066
+ * dbxout.c (dbxout_init): Use a langhook to find builtin types.
+ * langhooks-def.h (lhd_return_null_tree_v): New function.
+ (LANG_HOOKS_BUILTIN_TYPE_DECLS): New macro.
+ (LANG_HOOKS_DECLS): Add it to the intializer.
+ * langhooks.c (lhd_return_null_tree_v): New function.
+ * langhooks.h (lang_hooks_for_decls): Add builtin_type_decls.
+
+2003-09-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Quote gcc_config_arguments for configargs.h.
+ * configure: Regenerated.
+ * gccbug.in: Don't shell-expand gcc_config_arguments.
+
+2003-09-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/11357
+ * c-pretty-print.c (pp_c_floating_constant): Append
+ type-annotation to floating constants.
+
+2003-09-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/iris5.h (TARGET_OS_CPP_BUILTINS): Define _LONGLONG.
+ Define _ABIO32.
+ Use it for _MIPS_SIM.
+ * config/mips/iris6-o32.h (TARGET_OS_CPP_BUILTINS): Removed.
+
+ * config/mips/iris6-o32-as.h (SUBTARGET_ASM_OPTIMIZING_SPEC):
+ Moved ...
+ * config/mips/iris5.h (SUBTARGET_ASM_OPTIMIZING_SPEC): ... here,
+ updating comment.
+ Fixes PR target/10190.
+
+2003-09-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/rs6000/sysv4.h (LIB_LINUX_SPEC): Make -pthread apply
+ to shared libraries.
+
+2003-09-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11646
+ * cfgrtl.c (purge_dead_edges) [JUMP_INSN]: Rematerialize the
+ EDGE_ABNORMAL flag for EH edges.
+ * toplev.c (rest_of_handle_cse): Delete unreachable blocks
+ if dead edges were purged.
+
+2003-09-16 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Add target predefines.
+ * config/m68k/m68k-none.h (CPP_CPU_DEFAULT_SPEC): Kill all definitions.
+ * config/m68k/m68k-none.h (CPP_FPU_SPEC): Remove.
+ * config/m68k/m68k-none.h (CPP_SPEC): Likewise.
+
+2003-09-16 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cfgcleanup.c (label_is_jump_target_p): Correct use of table
+ returned by tablejump_p.
+
+2003-09-16 Joel Brobecker <brobecker@gnat.com>
+
+ * dwarf2asm.c (dw2_asm_output_nstring): Add comment.
+
+2003-09-16 Roger Sayle <roger@eyesopen.com>
+
+ PR bootstrap/12269
+ * simplify-rtx.c (simplify_gen_relational): Allow the cmp_mode
+ argument to be VOIDmode, taking the mode of the comparison from
+ the operands. Only call simplify_relational_operation if we
+ know the mode of the comparison. Honor FLOAT_STORE_FLAG_VALUE
+ if comparison has a floating point result. Ensure that the
+ result is always of the specified mode.
+ (simplify_replace_rtx): Simplify call to simplify_gen_relational.
+ (simplify_unary_operation): Ensure the correct mode and cmp_mode
+ are always passed to simplify_gen_relational. Simplify NOT of
+ comparison operator in any mode, not just BImode.
+ (simplify_ternary_operation): Correct tests on the return value
+ of simplify_relational_operation to use const_true_rtx, not
+ const1_rtx. Abort if it ever returns a non-constant result.
+
+ * cfgloopanal.c (count_strange_loop_iterations): Use the function
+ simplify_relational_operation, not simplify_gen_relational, if
+ we're only interested in constant comparisons and will ignore
+ non-constant results.
+
+2003-09-16 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (tree_swap_operands_p): New function to determine
+ the prefered ordering of operands.
+ (fold): Numerous clean-ups. Use tree_swap_operands_p when swapping
+ operands to commutative, comparison or ternary operators. Replace
+ uses of TREE_SET_CODE with recursive call to fold. Remove duplicate
+ transformation of A ? B : C into !A ? C : B.
+
+2003-09-16 Jakub Jelinek <jakub@redhat.com>
+
+ * config/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+ * config/alpha/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+ * config/arm/linux-elf.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+ * config/rs6000/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+ * config/rs6000/linux64.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+ * config/sh/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+ * config/sparc/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+ * config/sparc/linux64.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+
+2003-09-16 Jason Merrill <jason@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * c-common.c (handle_warn_unused_result_attribute): New function.
+ (c_common_attribute_table): Add warn_unused_result.
+ (c_expand_expr): Issue warning when result of inlined function
+ with warn_unused_result attribute is ignored.
+ * calls.c (expand_call): Issue warning when result of function
+ with warn_unused_result attribute is ignored.
+ * c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Define.
+ * expr.c (expr_wfl_stack): Define.
+ (expand_expr) <case EXPR_WITH_FILE_LOCATION>: If ignore,
+ pass const0_rtx as target. Chain locations into expr_wfl_stack.
+ * tree-inline.c (expand_call_inline): Set STMT_EXPR_WARN_UNUSED_RESULT
+ bit if inlined function has warn_unused_result attribute.
+ * input.h (expr_wfl_stack): Declare.
+ * doc/extend.texi: Document warn_unused_result attribute.
+
+2003-09-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * cpplib.c (do_pragma): Remove unnecessary cb_line_change.
+
+2003-09-15 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_multibss_section_type_flags): Add
+ ATTRIBUTE_UNUSED.
+ (call_insn_operand): For PIC, don't allow a direct call to a
+ function in a different section than the current one.
+
+2003-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * doc/invoke.texi (Warning Options): Add missing hyphen before
+ "Wimport". Change "-Wno-endif-labels" to "-Wendif-labels".
+ Move "-Wold-style-definition" to the C-only section.
+ Fix the ordering of the warning options.
+
+2003-09-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+ Jeff Law <law@redhat.com>
+
+ * gcse.c (remove_reachable_equiv_notes): New.
+ replace_store_insn): Call it. Update antic list.
+ (store_killed_in_insn): Take REG_EQUAL notes into account.
+ (build_store_vectors, delete_store): Add parameter to
+ replace_store_insn call.
+
+2003-09-15 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.h (LEGITIMATE_PIC_OPERAND_P): Use
+ SYMBOL_REF_LOCAL_P.
+
+2003-09-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * expr.h (DEFAULT_FUNCTION_ARG_PADDING): New.
+ (FUNCTION_ARG_PADDING): Use DEFAULT_FUNCTION_ARG_PADDING.
+ * config/ia64/ia64.c (ia64_hpux_function_arg_padding):
+ Likewise.
+ * config/m68hc11/m68hc11.c (m68hc11_function_arg_padding):
+ Likewise.
+ * config/rs6000/rs6000.c (function_arg_padding): Likewise.
+ * config/sparc/sparc.c (function_arg_padding): Likewise.
+
+2003-09-15 Vladimir Makarov <vmakarov@redhat.com>
+
+ * haifa-sched.c (schedule_block): Use ready_remove_first instead
+ of choose_ready for non-dfa insn scheduling.
+
+2003-09-15 Andreas Jaeger <aj@suse.de>
+ Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * doc/invoke.texi (Warning Options): Describe -Wold-style-definition.
+ * c-opts.c (c_common_handle_option): Handle OPT_Wold_style_definition.
+ * c-parse.in: Warn about old-style parameter definition.
+ * c-common.c: Define warn_old_style_defintion.
+ * c-common.h: Declare it.
+ * c.opt: Add Wold-style-defintion.
+
+2003-09-15 Andreas Jaeger <aj@suse.de>
+
+ * config/rs6000/altivec.h: Convert () prototypes to ISO C90.
+ * config/rs6000/rs6000.c: Likewise.
+
+2003-09-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR optimization/10914
+ * expr.h (get_condition, canonicalize_condition): Declaration changed.
+ * cfgloopanal.c (simple_loop_exit_p): Add parameter to a get_condition
+ and canonicalize_condition calls.
+ * gcse.c (fis_get_condition, delete_null_pointer_checks_1,
+ delete_null_pointer_checks): Ditto.
+ * ifcvt.c (noce_get_alt_condition, noce_get_condition): Ditto.
+ * predict.c (estimate_probability, expected_value_to_br_prob): Ditto.
+ * loop.c (check_dbra_loop, get_condition_for_loop): Ditto.
+ (canonicalize_condition, get_condition): Allow to return comparisons
+ of cc mode registers.
+ * loop-unswitch.c (may_unswitch_on_p, unswitch_single_loop): Allow
+ cc mode registers comparison in condition.
+
+2003-09-12 Mark Mitchell <mark@codesourcery.com>
+
+ * coverage.c (create_coverage): Do not call pushlevel/poplevel.
+ * langhooks-def.h (lhd_do_nothing_iii_return_null_tree): New
+ function.
+ * langhooks.c (lhd_do_nothing_iii_return_null_tree): Define it.
+
+2003-09-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (simplify_comparison): Convert
+ (ne (and (lshiftrt (xor X CST) Y) 1) 0) into
+ (eq (and (lshiftrt X Y) 1) 0).
+
+2003-09-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * alias.c: Follow spelling conventions.
+ * cpphash.h: Likewise.
+ * fold-const.c: Likewise.
+
+2003-09-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * c-ppoutput.c (cb_line_change): Revert 2003-08-04's change.
+ * c-lex.c (cb_line_change): Skip line changing whenever
+ c-ppoutput.c would.
+
+2003-09-14 Steven Bosscher <steven@gcc.gnu.org>
+
+ * ra.c: Convert to ISO C90 prototypes.
+ * ra-build.c: Likewise.
+ * ra-colorize.c: Likewise.
+ * ra-debug.c: Likewise.
+ * ra-rewrite.c: Likewise.
+
+2003-09-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * Makefile.in (%.dvi): Remove excess $(docdir).
+
+2003-09-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * function.c (STACK_BYTES): Move definition to head of file.
+ (assign_parms): Don't pass current_function_pretend_args_size
+ directly to SETUP_INCOMING_VARARGS. For partial register arguments,
+ round current_function_pretend_args_size up to STACK_BYTES. Skip any
+ excess before laying out the argument.
+
+2003-09-14 Andreas Jaeger <aj@suse.de>
+
+ * objc/objc-act.c: Convert to ISO C90 prototypes.
+ * objc/objc-act.h: Likewise.
+
+2003-09-14 Olaf Hering <olh@suse.de>
+
+ * config/rs6000/rs6000.c: Fix typo: Remove extra ')'.
+
+2003-09-13 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/12021
+ * config/m68k/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Remove the asserts
+ as they already are done in config/m68k/m68k.h.
+ * config/m68k/netbsd.h (TARGET_OS_CPP_BUILTINS): Likewise
+
+ * config/rs6000/rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Remove.
+ (machopic_output_stub): Only generate pic base symbols when using pic
+ and generate them in the form L00000000$spb.
+
+2003-09-13 Richard Henderson <rth@redhat.com>
+
+ * cgraphunit.c (cgraph_assemble_pending_functions): Export.
+ (cgraph_finalize_function): Revert TREE_ASM_WRITTEN check.
+ * cgraph.h: Update.
+
+2003-09-12 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c: Fix typos in previous.
+
+2003-09-12 Ziemowit Laski <zlaski@apple.com>
+
+ * pretty-print.c (pp_construct): Use xcalloc instead of xmalloc
+ when allocating pp->buffer.
+
+2003-09-12 Geoffrey Keating <geoffk@apple.com>
+
+ * config/darwin.c (machopic_select_rtx_section): Use
+ const_data_section for things that might require relocation.
+
+2003-09-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/12264
+ * tree-inline.c (inline_forbidden_p_1): Cast the 3rd arg to tree.
+
+2003-09-12 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/elf.h (ASM_SPEC): Remove no-density option. Reformat.
+ * config/xtensa/linux.h (ASM_SPEC): Likewise.
+ * config/xtensa/xtensa.h (TARGET_SWITCHES): Remove -mbig-endian,
+ -mlittle-endian, -m[no-]density, -m[no-]abs, -m[no-]addx, -m[no-]mac16,
+ -m[no-]mul16, -m[no-]mul32, -m[no-]nsa, -m[no-]minmax, -m[no-]sext,
+ -m[no-]booleans, -mhard-float, -msoft-float, -m[no-]hard-float-div,
+ -m[no-]hard-float-recip, -m[no-]hard-float-sqrt, and
+ -m[no-]hard-float-rsqrt options. Delete corresponding MASK_* macros
+ and redefine corresponding TARGET_* macros with constants from the
+ xtensa-config.h header.
+ * doc/invoke.texi (Option Summary, Xtensa Options): Remove documention
+ for the options listed above.
+
+2003-09-12 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000-protos.h: Use C90 prototypes.
+ * config/rs6000/rs6000-c.c: Ditto.
+ * config/rs6000/rs6000.c: Ditto.
+ * config/rs6000/ sysv4.h: Ditto.
+
+2003-09-12 Chris Lattner <sabre@nondot.org>
+
+ * loop.c: Move comments describing BIV's and GIV's to top of file
+
+2003-09-12 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/8967
+ * alias.c (write_dependence_p): Modify to take an additional constp
+ argument that controls whether the UNCHANGING_RTX_P flags are used.
+ (anti_dependence, output_dependence): Adjust write_dependence_p
+ callers to pass this additional argument, to return the same result.
+ (unchanging_anti_dependence): New variant of anti_dependence that
+ ignores the UNCHANGING_RTX_P property on memory references.
+ * rtl.h (unchaning_anti_dependence): Prototype here.
+ * flow.c (init_propagate_block): Place fake constant mem writes on
+ the mem_set_list so that dead writes to const variables are deleted.
+ (insn_dead_p): Change anti_dependence to unchanging_anti_dependence.
+ (mark_used_regs): Likewise.
+
+2003-09-12 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mcore/mcore-protos.h (mcore_r15_operand_p): Declare.
+ (mcore_secondary_reload_class): Declare.
+ (mcore_output_inline_const_forced): Remove.
+ * config/mcore/mcore.md (movsi): Remove the code that forced
+ non-inlineable constants into a register if the target was r15
+ or the stack pointer. Remove constant restrictions from the main
+ define_insn. Remove r <- I, r <- M and r <- N alternatives in favor
+ of an r <- P alternative. Remove fallback define_insn for reload.
+ (movhi, movqi): Use gen_lowpart rather than gen_SUBREG. Remove reload
+ define_insn. Use mcore_output_move in the remaining define_insn.
+ Adjust condition and constraints in the way as for movsi.
+ (movdi): Always split unacceptable constants into two. Use
+ simplify_gen_subreg instead of operand_subword{,_force}.
+ * config/mcore/mcore.c (mcore_output_inline_const_forced): Remove.
+ (mcore_output_move): Support HImode and QImode moves as well.
+ (mcore_m15_operand_p): New function.
+ (mcore_reload_class): Use it to detect cases where LRW_REGS are better.
+ (mcore_secondary_reload_class): New function.
+ * config/mcore/mcore.h (SECONDARY_RELOAD_CLASS): Redefine in
+ terms of mcore_secondary_reload_class.
+
+2003-09-11 Mike Stump <mrs@apple.com>
+
+ * c-lex.c (fe_file_change): Don't transform to_line with SOURCE_LINE.
+
+2003-09-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (fold_builtin_logarithm): if N can't be truncated to
+ MODE exactly, then only convert logN(N) -> 1.0 if
+ flag_unsafe_math_optimizations is set.
+
+ * builtins.c (builtin_dconsts_init, dconstpi, dconste,
+ init_builtin_dconsts): Delete.
+ * emit-rtl.c (dconstpi, dconste): Define.
+ (init_emit_once): Initialize dconstpi & dconste.
+ * real.h (dconstpi, dconste): Declare.
+
+2003-09-11 Alexandre Oliva <aoliva@redhat.com>
+
+ PR fortran/11522
+ * dwarf2out.c (gen_inlined_subroutine_die): Emit abstract function
+ for ultimate origin even if block is abstract.
+
+2003-09-11 Roger Sayle <roger@eyesopen.com>
+
+ * combine.c (combine_simplify_rtx): Move several NOT and NEG
+ optimizations from here...
+ * simplify-rtx.c (simplify_unary_operation): to here. Recursively
+ simplify expressions using simplify_gen_*ary instead of gen_rtx_*.
+
+2003-09-11 Richard Henderson <rth@redhat.com>
+
+ * cgraphunit.c (cgraph_finalize_function): Add nested arg.
+ Tweek tests for function already generated.
+ (cgraph_expand_function): Don't double announce in !unit-at-a-time.
+ * cgraph.h (cgraph_finalize_function): Update for extra arg.
+ * c-decl.c (finish_function): Likewise.
+
+2003-09-10 Joe Buck <jbuck@welsh-buck.org>
+
+ * c-decl.c (poplevel): Eliminate use of |= in function_body assignment.
+
+2003-09-10 Jerry Quinn <jlquinn@optonline.net>
+
+ * real.c: Update URL to VAX floating point docs.
+ (decode_vax_d): Extract 8 exponent bits instead of 7.
+
+2003-09-10 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * combine.c (force_to_mode): Set fuller_mask based only on mask,
+ not op_mode.
+
+2003-09-11 Jan Hubicka <jh@suse.cz>
+
+ * c-objc-common.c (c_cannot_inline_tree_fn): Warn
+ on why function is not inlinable; do not check
+ the body.
+ (inline_forbidden_p): Move to...
+ * tree-inline.c (inline_forbidden_p_1): ... here; Add warnings;
+ deal with alloca, longjmp.
+ (inline_forbidden_p): New static function.
+ (find_alloca_call_1, find_alloca_call, find_builtin_longjmp_call_1,
+ find_builtin_longjmp_call): Kill.
+
+2003-09-10 Richard Henderson <rth@redhat.com>
+
+ * cgraph.h (struct cgraph_node): Rename lowered to analyzed.
+ * cgraphunit.c: Update to match.
+ (record_call_1): Rearrange. Call lang hook for language nodes.
+ (cgraph_analyze_function): Don't call lower_function.
+ * langhooks.h (struct lang_hooks_for_callgraph): Replace
+ lower_function with analyze_expr.
+ * langhooks-def.h: Update to match.
+ * langhooks.c (lhd_callgraph_analyze_expr): New.
+
+2003-09-10 Martin Husemann <martin@duskware.de>
+
+ PR target/11965
+ * config/sparc/sparc.c (sparc_v8plus_shift): Protect against
+ constants greater than 63.
+ * config/sparc/sparc.md (ashlsi3, ashrsi3, lshrsi3): Protect
+ against constants greater than 31.
+ (*ashldi3_sp64, *ashrdi3_sp64, *lshrdi3_sp64): Protect against
+ constants greater than 63.
+
+2003-09-09 Richard Henderson <rth@redhat.com>
+
+ * cgraphunit.c (cgraph_finalize_function): Remove unused argument.
+ * cgraph.h (cgraph_finalize_function): Update.
+ * c-decl.c (finish_function): Update.
+
+2003-09-09 Devang Patel <dpatel@apple.com>
+
+ * config/darwin.h (LINK_SPEC): Pass -nofixprebinding to linker.
+ * doc/invoke.texi: Document new Darwin linker option -nofixprebinding.
+
+2003-09-09 Eric Christopher <echristo@redhat.com>
+
+ * configure.in: Change usage of 'head' to 'sed 1q'.
+ * configure: Regenerate.
+
+2003-09-09 Richard Henderson <rth@redhat.com>
+
+ * except.c: Include cgraph.h.
+ (output_function_exception_table): Invoke
+ cgraph_varpool_mark_needed_node.
+ * Makefile.in (except.o): Update.
+
+2003-09-07 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * Makefile.in: Define REMAKEFLAGS for LANGUAGES & BOOT_CFLAGS
+ and use it throughout.
+
+2003-09-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (real_dconstp, fold_builtin_logarithm,
+ fold_builtin_exponent): New, split out from fold_builtin. Also
+ generalize to add log2, log10, exp2 and exp10/pow10 equivalents.
+ * emit-rtl.c (dconst3, dconst10, dconstthird): New.
+ (init_emit_once): Initialize new dconsts, use ARRAY_SIZE in lieu
+ of hardcoded array size.
+ * fold-const.c (fold): Add cases for exp2, exp10 and pow10.
+ (tree_expr_nonnegative_p): Likewise.
+ * real.h (dconst3, dconst10, dconstthird): New.
+
+2003-09-09 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (cgraph_finalize_function): Fix handling of extern
+ inline functions.
+ (cgraph_finalize_compilation_unit): Fix crash when dealing with lost
+ DECL_SAVED_TREE.
+
+2003-09-09 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (fold_builtin_cabs): Protect the complex argument
+ against multiple evaluation when optimizing cabs* into sqrt*.
+
+2003-09-09 Jan Hubicka <jh@suse.cz>
+
+ * varasm.c (notice_global_symbol): Properly deal with weak symbols.
+
+2003-09-08 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * Makefile.in: Revert yesterday's change.
+
+2003-09-08 Bernardo Innocenti <bernie@develer.com>
+ Peter Barada <peter@baradas.org>
+
+ * config/m68k/coff.h (REGISTER_NAMES): Add fake register `argptr'
+ * config/m68k/hp320.h (REGISTER_NAMES): Likewise.
+ * config/m68k/linux.h (REGISTER_NAMES): Likewise.
+ * config/m68k/m68kelf.h (REGISTER_NAMES): Likewise.
+ * gcc/config/m68k/sgs.h (REGISTER_NAMES): Likewise.
+ * config/m68k/m68k-protos.h (m68k_initial_elimination_offset): Add prototype.
+ * config/m68k/m68k.c (m68k_frame): New struct, simular to ix86 back-end.
+ (m68k_compute_frame_layout): New function.
+ (m68k_initial_elimination_offset): New function.
+ (m68k_output_function_prologue): ColdFire-specific movem handling.
+ (m68k_output_function_epilogue): Likewise.
+ * config/m68k/m68k.h (FIRST_PSEOUDO_REGISTER): Make room for argptr reg.
+ (ARG_POINTER_REGNUM): Add new definition.
+ (INITIAL_FRAME_POINTER_OFFSET): Remove macro.
+ (ELIMINABLE_REGS): Define new macro, like in ix86 back-end.
+ (CAN_ELIMINATE): Likewise.
+ (INITIAL_ELIMINATION_OFFSET): Likewise.
+
+2003-09-08 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k.c (m68k_output_function_prologue): Simplify
+ by removing redundant variable cfa_store_offset.
+
+2003-09-08 Mark Mitchell <mark@codesourcery.com>
+
+ * langhooks-def.h (lhd_register_builtin_type): New function.
+ (LANG_HOOKS_REGISTER_BUILTIN_TYPE): New macro.
+ (LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
+ * langhooks.h (lang_hooks_for_types): Add register_builtin_type.
+ * langhooks.c (lhd_register_builtin_type): New function.
+ * c-common.h (c_register_builtin_type): Declare.
+ * c-common.c (c_register_builtin_type): New function.
+ * c-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
+ c_register_builtin_type.
+ * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Remove __fpreg,
+ __float80, and __float128 macros.
+ * config/ia64/ia64.c (ia64_init_builtins): Create __fpreg,
+ __float80, and __float128 types.
+
+2003-09-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-types.def
+ (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE,
+ BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
+ BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT): New.
+ * builtins.def (BUILT_IN_CACOS, BUILT_IN_CACOSF, BUILT_IN_CACOSH,
+ BUILT_IN_CACOSHF, BUILT_IN_CACOSHL, BUILT_IN_CACOSL,
+ BUILT_IN_CARG, BUILT_IN_CARGF, BUILT_IN_CARGL, BUILT_IN_CASIN,
+ BUILT_IN_CASINF, BUILT_IN_CASINH, BUILT_IN_CASINHF,
+ BUILT_IN_CASINHL, BUILT_IN_CASINL, BUILT_IN_CATAN,
+ BUILT_IN_CATANF, BUILT_IN_CATANH, BUILT_IN_CATANHF,
+ BUILT_IN_CATANHL, BUILT_IN_CATANL, BUILT_IN_CCOS, BUILT_IN_CCOSF,
+ BUILT_IN_CCOSH, BUILT_IN_CCOSHF, BUILT_IN_CCOSHL, BUILT_IN_CCOSL,
+ BUILT_IN_CEXP, BUILT_IN_CEXPF, BUILT_IN_CEXPL, BUILT_IN_CPOW,
+ BUILT_IN_CPOWF, BUILT_IN_CPOWL, BUILT_IN_CPROJ, BUILT_IN_CPROJF,
+ BUILT_IN_CPROJL, BUILT_IN_CSIN, BUILT_IN_CSINF, BUILT_IN_CSINH,
+ BUILT_IN_CSINHF, BUILT_IN_CSINHL, BUILT_IN_CSINL, BUILT_IN_CSQRT,
+ BUILT_IN_CSQRTF, BUILT_IN_CSQRTL, BUILT_IN_CTAN, BUILT_IN_CTANF,
+ BUILT_IN_CTANH, BUILT_IN_CTANHF, BUILT_IN_CTANHL, BUILT_IN_CTANL):
+ New.
+ * doc/extend.texi: Document new builtins.
+
+2003-09-09 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_varpool_finalize_decl): Sanity check duplicated
+ finalization.
+ * cgraphunit.c (decide_is_fnction_needed): Avoid special case of nested
+ functions, check for COMDAT.
+ (cgraph_assemble_pending_functions): Break out from...
+ (cgraph_finalize_function): ... here; allow redefinig of extern inline
+ functions.
+ (record_call_1): Record function references only in non-unit-at-a-time
+ mode.
+ (cgraph_analyze_function): Reset current_function_decl.
+ (cgraph_finalize_compilation_unit): Assemble pending functions.
+
+2003-09-08 Mark Mitchell <mark@codesourcery.com>
+
+ * mklibgcc.in (libcc.a): Depend on stmp-dirs.
+ (libgov.a): Likewise.
+ (libgcc_eh.a): Likewise.
+
+2003-09-08 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (operand_equal_p): Clarify documentation.
+
+2003-09-08 Richard Henderson <rth@redhat.com>
+
+ * c-decl.c (c_expand_body_1): Push and pop function context here.
+ * tree-optimize.c (tree_rest_of_compilation): ... not here. Take
+ nested argument instead of computing nesting ourselves.
+
+2003-09-08 Jakub Jelinek <jakub@redhat.com>
+
+ * toplev.c (rest_of_handle_stack_regs): Call split_all_insns before
+ regstack if optimizing but not scheduling after reload.
+
+2003-09-08 Jakub Jelinek <jakub@redhat.com>
+
+ * config/sparc/sparc.c (struct machine_function): New type.
+ (TARGET_HAVE_TLS, TARGET_CANNOT_FORCE_CONST_MEM): Define.
+ (sparc_override_options): Initialize init_machine_status.
+ (tls_symbolic_operand, tgd_symbolic_operand, tld_symbolic_operand,
+ tie_symbolic_operand, tle_symbolic_operand): New functions.
+ (symbolic_operand): Disallow tls_symbolic_operand.
+ (symbolic_memory_operand): Likewise.
+ (tls_call_delay, sparc_cannot_force_const_mem, legitimate_constant_p,
+ constant_address_p, legitimate_pic_operand_p, legitimate_address_p):
+ New functions.
+ (sparc_tls_symbol): New variable.
+ (sparc_tls_get_addr, sparc_tls_got, legitimize_tls_address,
+ legitimize_address): New functions.
+ (print_operand): Handle %&.
+ (sparc_init_machine_status, get_some_local_dynamic_name,
+ get_some_local_dynamic_name_1): New functions.
+ (sparc_output_dwarf_dtprel): New function.
+ * config/sparc/sparc.h (CONSTANT_ADDRESS_P): Moved into
+ constant_address_p.
+ (LEGITIMATE_PIC_OPERAND_P): Moved into legitimate_pic_operand_p.
+ (LEGITIMATE_CONSTANT_P): Moved into legitimate_constant_p.
+ (GO_IF_LEGITIMATE_ADDRESS): Moved into legitimate_address_p.
+ (LEGITIMIZE_ADDRESS): Moved into legitimize_address.
+ (PRINT_OPERAND_PUNCT_VALID_P): Add '&'.
+ (TARGET_TLS, TARGET_SUN_TLS, TARGET_GNU_TLS): Define.
+ (ASM_OUTPUT_DWARF_DTPREL): Define.
+ (PREDICATE_CODES): Add tgd_symbolic_operand, tld_symbolic_operand,
+ tie_symbolic_operand, tle_symbolic_operand.
+ * config/sparc/sparc.md (UNSPEC_TLSGD, UNSPEC_TLSLDM, UNSPEC_TLSLDO,
+ UNSPEC_TLSIE, UNSPEC_TLSLE, UNSPEC_TLSLD_BASE): New constants.
+ (tls_call_delay): New attribute.
+ (in_call_delay): Use it.
+ (movqi, movhi, movsi, movdi): Call legitimize_tls_address if needed.
+ (tgd_hi22, tgd_lo10, tgd_add32, tgd_add64, tgd_call32, tgd_call64,
+ tldm_hi22, tldm_lo10, tldm_add32, tldm_add64, tldm_call32, tldm_call64,
+ tldo_hix22, tldo_lox10, tldo_add32, tldo_add64, tie_hi22, tie_lo10,
+ tie_ld32, tie_ld64, tie_add32, tie_add64, tle_hix22_sp32,
+ tle_lox10_sp32, tle_hix22_sp64, tle_lox10_sp64): New insns.
+ (tldo_ldub_sp32, tldo_ldub1_sp32, tldo_ldub2_sp32, tldo_ldsb1_sp32,
+ tldo_ldsb2_sp32, tldo_ldub_sp64, tldo_ldub1_sp64, tldo_ldub2_sp64,
+ tldo_ldub3_sp64, tldo_ldsb1_sp64, tldo_ldsb2_sp64, tldo_ldsb3_sp64,
+ tldo_lduh_sp32, tldo_lduh1_sp32, tldo_ldsh1_sp32, tldo_lduh_sp64,
+ tldo_lduh1_sp64, tldo_lduh2_sp64, tldo_ldsh1_sp64, tldo_ldsh2_sp64,
+ tldo_lduw_sp32, tldo_lduw_sp64, tldo_lduw1_sp64, tldo_ldsw1_sp64,
+ tldo_ldx_sp64, tldo_stb_sp32, tldo_stb_sp64, tldo_sth_sp32,
+ tldo_sth_sp64, tldo_stw_sp32, tldo_stw_sp64, tldo_stx_sp64): New
+ insns.
+ * config/sparc/sparc-protos.h (legitimate_constant_p,
+ constant_address_p, legitimate_pic_operand_p, legitimate_address_p,
+ legitimize_tls_address, legitimize_address, tls_symbolic_operand,
+ tls_call_delay, sparc_output_dwarf_dtprel): New prototypes.
+ * config/sparc/linux.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Define.
+ * config/sparc/linux64.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Likewise.
+ * configure.in (sparc*-*-*): Add TLS check.
+ * configure: Rebuilt.
+
+2003-09-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/11689
+ * config/i386/i386.c (memory_address_length): Fix computation when
+ the base is esp or ebp.
+
+2003-09-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11852
+ * varasm.c (initializer_constant_valid_p): Correct logic for
+ CONSTRUCTORs.
+
+2003-09-07 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (expand_operands): New function to expand an operand pair.
+ (expand_expr): Call expand_operands whenever we need to expand both
+ operands of a binary operator.
+ (do_store_flag): Likewise for operands of comparison operations.
+
+2003-09-07 Roger Sayle <roger@eyesopen.com>
+
+ * combine.c (combine_simplify_rtx): Don't convert -(A*B) into
+ (-A)*B if we care about sign-dependent rounding.
+
+2003-09-07 Gabriel Dos Reis <gcc@integrable-solutions.net>
+
+ * c-pretty-print.h (pp_c_left_brace): Declare.
+ (pp_c_right_brace): Likewise.
+ * c-pretty-print.c (pp_c_left_brace): Now a function
+ (pp_c_right_brace): Likewise.
+
+2003-09-07 Jan Hubicka <jh@suse.cz>
+
+ * cfgcleanup.c (try_simplify_condjump): Fix again the preivous patch.
+
+2003-09-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.c (warn_deprecated_use): Move to toplev.c
+
+2003-09-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * langhooks.c (lhd_print_error_function): Move from diagnostic.c.
+ * Makefile.in (langhooks.o): Depend on diagnostic.h
+
+2003-09-06 James E Wilson <wilson@tuliptree.org>
+
+ * loop.c (loop_regs_update): Delete else clause for PATTERN rtx and
+ simplify.
+
+2003-09-07 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * Makefile.in: Define $REMAKE to be $MAKE with LANGUAGES & BOOT_CFLAGS
+ and use it throughout.
+
+2003-09-07 Jan Hubicka <jh@suse.cz>
+
+ * cfgcleanup.c (try_simplify_condjump): Fix my previous patch.
+
+ * toplev.c (rest_of_decl_compilation): Do not finalize external
+ virables.
+
+ * cgraph.c (cgraph_mark_reachable_node): Only enqueue finalized
+ functions.
+ (cgraph_varpool_finalize_decl): Notice global symbol when needed.
+
+2003-09-06 Jan Hubicka <jh@suse.cz>
+
+ PR target/12070
+ * calls.c (emit_library_call_value_1): Fix saving of BLKmode arguments.
+
+ PR opt/12082
+ * cfgcleanup.c (try_simplify_condjump): Avoid unreachable code warning.
+
+2003-09-06 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.c (announce_function): Move to toplev.c.
+
+2003-09-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcse.c (expr_equiv_p): Don't consider anything to be equal to
+ volatile mem.
+
+2003-09-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ggc-common.c (init_ggc_heuristics): Don't use the heuristics
+ when gc checking is enabled.
+
+2003-09-06 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c/9862
+ * c-decl.c (c_expand_body_1): Move return warning from here...
+ (finish_function): ...to here.
+
+2003-09-05 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/darwin.h (PREFERRED_RELOAD_CLASS): Always return
+ a subset of the input class.
+
+2003-09-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/i860/i860.c: Follow spelling conventions.
+ * config/i860/i860.h: Likewise.
+ * config/sh/sh.h: Likewise.
+
+2003-09-05 Nitin Yewale <NitinY@KPITCummins.com>
+
+ * config/h8300/h8300-protos.h: Declare h8300_hard_regno_rename_ok
+ * config/h8300/h8300.h (HARD_REGNO_RENAME_OK): New.
+ * config/h8300/h8300.c (h8300_hard_regno_rename_ok): New.
+
+2003-09-05 Roger Sayle <roger@eyesopen.com>
+ Richard Henderson <rth@redhat.com>
+
+ PR optimization/1823
+ * expmed.c (expand_divmod <EXACT_DIV_EXPR>): Use an unsigned
+ multiplication to implement division by constant integer.
+
+2003-09-05 Jan Hubicka <jh@suse.cz>
+
+ * opts.c (decode_options): Enable unit-at-a-time at -O2.
+ * params.def (max-inline-insns-single): Set to 500
+ (max-inline-insns-auto): Set to 150
+ * invoke.texi (max-inline-insns-single, max-inline-insns-auto): Update.
+
+2003-09-04 Richard Henderson <rth@redhat.com>
+
+ * cgraph.c (cgraph_mark_reachable_node): Split out from ...
+ (cgraph_mark_needed_node): Remove needed argument.
+ * cgraph.h: Update to match.
+ * cgraphunit.c (decide_is_function_needed): Split out from ...
+ (cgraph_finalize_function): Reorg. Avoid deferred_inline_function
+ if we generated the function.
+ (record_call_1): Update for cgraph_mark_reachable_node.
+ * varasm.c (mark_referenced): Likewise.
+ * objc/objc-act.c (mark_referenced_methods): Likewise.
+
+2003-09-04 DJ Delorie <dj@redhat.com>
+
+ * targhooks.c: Add comment explaining the migration process.
+
+2003-09-04 Eric Christopher <echristo@redhat.com>
+
+ * config/frv/t-frv: Fix path for frv-abi.h.
+ * config/frv/frv-asm.h: Fix string concatenation.
+
+2003-09-04 DJ Delorie <dj@redhat.com>
+
+ * builtins.c (apply_args_size): Guard against a NULL cfun.
+ (expand_builtin_apply_args_1): Likewise.
+ (expand_builtin_apply): Likewise.
+ Fixes PR bootstrap/12172.
+
+2003-09-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (gcc_cv_as_ix86_cmov_sun_syntax): Check if
+ assembler supports Sun syntax for cmov.
+ * configure: Regenerate.
+ * config.in: Likewise.
+ * config/i386/i386.c: Rename CMOV_SUN_AS_SYNTAX to
+ HAVE_AS_IX86_CMOV_SUN_SYNTAX.
+ * config/i386/sol2.h (CMOV_SUN_AS_SYNTAX): Remove.
+ Fixes PR target/12101.
+
+2003-09-04 Matt Austern <austern@apple.com>
+
+ * c-common.c (fname_as_string): Use lang_hooks.decl_printable_name
+ with verbosity 0, instead of DECL_NAME, for human-readable string.
+
+2003-09-04 Eric Christopher <echristo@redhat.com>
+
+ * targhooks.c (default_return_in_memory): Allow
+ unconverted ports.
+
+2003-09-04 Eric Christopher <echristo@redhat.com>
+
+ * targhooks.c (default_return_in_memory): Fix typo
+ in last checkin.
+
+2003-09-04 Eric Christopher <echristo@redhat.com>
+
+ * targhooks.c (default_return_in_memory): Fix default
+ definition.
+
+2003-09-04 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k.c (m68k_coff_asm_named_section): Restore
+ deleted function.
+ * config/m68k/coff.h (M68K_TARGET_COFF): Add flag used to
+ enable coff-only code in m68k.c.
+
+2003-09-04 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc: Add v850e1 target. Allow --with-cpu to accept
+ v850e1.
+ * config/v850/v850.h: Accept v850e1 as a default CPU.
+ Accept -mv850e1 as a command line option.
+ * doc/invoke.texi: Document new -mv850e1 command line switch.
+ * config/v850/t-v850: Treat -mv850e1 as a multilib alias for
+ -mv850e.
+
+2003-09-04 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc (v850e-*-*): Use t-v850e makefile fragment.
+ * config/v850/t-v850: Only produce one extra multilib - for
+ the v850e.
+ * config/v850/t-v850e: New file: Only produce one extra
+ multilib - for the v850.
+
+2003-09-04 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/libgcc-ia64.ver: Export _Unwind_GetBSP@@GCC_3.3.2.
+ * config/ia64/unwind-ia64.c (_Unwind_GetBSP): New function.
+ * unwind.h (_Unwind_GetBSP): New prototype.
+ * libgcc-std.ver: Add empty GCC_3.3.2 version.
+ * mkmap-symver.awk: For symbol versions with no exported symbols,
+ don't put anything into version script, just change all symbol
+ versions which inherit from it to inherit from its ancestor.
+
+2003-09-04 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips.c (mips_expand_prologue): Convert to
+ calls.struct_value_rtx hook.
+ (reg_or_const_float_1_operand): New.
+ * config/mips/mips.h: Update Comments.
+ (mips_arg): Add reg_or_const_float_1_operand.
+ * config/mips/mips.md (divdf3); Convert to expander.
+ (divsf3): Ditto.
+ (*divdf3): New pattern.
+ (*divsf3): Ditto.
+
+2003-09-04 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (wrapup_global_declarations): Fix final pass in
+ unit-at-atime mode.
+
+2003-09-04 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/extend.texi: Document removal of cast-as-lvalue extension in
+ C++.
+
+2003-09-04 Nicolas Roche <roche@act-europe.fr>
+
+ * gcc.c (process_command): Fix typo.
+
+2003-09-03 David O'Brien <obrien@FreeBSD.org>
+
+ optimization/11980
+ * config/i386/freebsd.h (SIZE_TYPE): Support TARGET_64BIT.
+ (PTRDIFF_TYPE): Likewise.
+ (WCHAR_TYPE_SIZE): Likewise.
+
+2003-09-03 DJ Delorie <dj@redhat.com>
+
+ * targhooks.c: New file.
+ * targhooks.h: New file.
+ * Makefile.in: Add targhooks.o support.
+ (function.o): Depend on$(TARGET_H).
+ (stmt.o): Likewise.
+ (combine.o): Depend on $(TREE_H) and $(TARGET_H).
+ * builtins.c (apply_args_size, expand_builtin_apply_args_1,
+ expand_builtin_apply): Convert to calls.struct_value_rtx hook.
+ (expand_builtin_saveregs): Convert to
+ calls.expand_builtin_saveregs hook.
+ * c-decl.c (start_decl): Handle new calls.promote_prototypes hook
+ here, instead of ...
+ (get_parm_info) ... here.
+ (store_parm_decls_oldstyle): Convert to calls.promote_prototypes
+ hook.
+ (finish_function): Handle calls.promote_prototypes hook here too.
+ * c-typeck.c (convert_arguments): Convert to
+ calls.promote_prototypes hook.
+ (c_convert_parm_for_inlining): Likewise.
+ * calls.c (initialize_argument_information): Convert to
+ calls.promote_function_args hook.
+ (expand_call): Convert to calls.struct_value_rtx,
+ calls.strict_argument_naming,
+ calls.pretend_outgoing_varargs_named, and
+ calls.promote_function_return hooks. Pass fndecl to
+ aggregate_value_p. Initialize CUMULATIVE_ARGS before calling
+ hooks, so they can use that.
+ (emit_library_call_value_1): Likewise.
+ * combine.c (setup_incoming_promotions): Convert to
+ calls.promote_function_args hook.
+ * emit-rtl.c: Convert to calls.struct_value_rtx hook.
+ * expr.c (expand_assignment): Pass call to aggregate_value_p.
+ (expand_expr): Likewise.
+ * expr.h: Remove support for SETUP_INCOMING_VARARGS,
+ STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED,
+ RETURN_IN_MEMORY macro defaults.
+ * final.c (profile_function): Convert to calls.struct_value_rtx
+ hook.
+ * function.c (aggregate_value_p): Accept function type tree as
+ second parameter; try to deduce fntype from it. Convert to
+ calls.return_in_memory hook.
+ (assign_parms): Convert to calls.setup_incoming_varargs,
+ calls.strict_argument_naming, calls.promote_function_args,
+ calls.pretend_outgoing_varargs_named hooks. Pass fndecl to
+ aggregate_value_p.
+ (expand_function_start): Likewise. Convert to
+ calls.struct_value_rtx hook.
+ (expand_function_end): Convert to calls.promote_function_return hook.
+ (allocate_struct_function): Pass fndecl to aggregate_value_p.
+ * hard-reg-set.h: Update comments to new hook names.
+ * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p.
+ * reg-stack.c (stack_result): Likewise.
+ * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete.
+ * stmt.c (expand_value_return): Convert to
+ calls.promote_function_return hook.
+ * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS,
+ TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES,
+ TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY,
+ TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS,
+ TARGET_STRICT_ARGUMENT_NAMING,
+ TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS.
+ * target.h: Likewise.
+ * tree.h (aggregate_value_p): Also takes a tree to deduce function
+ attributes from (for target hooks).
+ * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN,
+ PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM,
+ STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING,
+ EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS,
+ STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert
+ to hooks.
+
+ * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function
+ to aggregate_value_p.
+ * config/arm/arm.c (arm_init_cumulative_args,
+ arm_output_mi_thunk): Likewise.
+ * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter):
+ Likewise.
+ * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue,
+ mips_can_use_return_insn): Likewise.
+ * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
+ * config/s390/s390.c (s390_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to
+ aggregate_value_p.
+ * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass
+ function to aggregate_value_p.
+ * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to
+ aggregate_value_p.
+
+ * config/sh/sh-protos.h (sh_builtin_saveregs): Remove.
+ (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg,
+ sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c
+ (sh_handle_renesas_attribute, sh_promote_prototypes,
+ sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs,
+ sh_setup_incoming_varargs, sh_strict_argument_naming,
+ sh_pretend_outgoing_varargs_named): New decls.
+ (targetm): Add new hooks.
+ (calc_live_regs): Save MACL and MACH if the function has the
+ renesas attribute.
+ (sh_expand_prologue): Support renesas attribute.
+ (sh_builtin_saveregs): Make static.
+ (sh_build_va_list): Support renesas attribute.
+ (sh_va_start): Likewise.
+ (sh_va_arg): Likewise.
+ (sh_promote_prototypes): New.
+ (sh_function_arg): New, moved from sh.h. Support renesas
+ attribute.
+ (sh_function_arg_advance): Likewise.
+ (sh_return_in_memory): Likewise.
+ (sh_strict_argument_naming): Likewise.
+ (sh_pretend_outgoing_varargs_named): Likewise.
+ (sh_struct_value_rtx): New.
+ (sh_attribute): Add renesas attribute.
+ (sh_handle_renesas_attribute): New.
+ (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New.
+ (sh_ms_bitfield_layout_p): Support renesas attribute also.
+ (sh_output_mi_thunk): Pass function to aggregate_value_p. *
+ config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for
+ -mhitachi.
+ (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to
+ target hooks.
+ (sh_args): Add renesas_abi flag.
+ (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p.
+ (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c.
+ (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the
+ stack for the renesas abi.
+ (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED,
+ SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS,
+ PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set
+ call cookie to indicate renesas calls.
+
+2003-09-03 Mostafa Hagog <mustafa@il.ibm.com>
+
+ * gcse.c (replace_one_set): New function.
+ (pre_insert_copy_insn): Change the order of copying
+ to make copy propagation discover additional PRE opportunities.
+
+2003-09-03 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/11700.
+ * simplify-rtx.c (simplify_subreg): Check that the subreg offset
+ of a hard register is representable before trying to simplify it
+ using subreg_hard_regno.
+
+2003-09-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (gcc_cv_ld_hidden): Disable unless using GNU ld.
+ * configure: Regenerate.
+
+2003-09-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * intl.h (N_): Remove parentheses.
+
+2003-09-03 Bernardo Innocenti <bernie@develer.com>
+
+ * config.gcc (m68k-*-linux*): Remove definition of LINUX_DEFAULT_ELF.
+ * config/i370/linux.h (LINUX_DEFAULT_ELF): Remove unconditional
+ definition and code blocks compiled when not defined.
+ * config/i386/linux.h (LINUX_DEFAULT_ELF): Likewise.
+ * config/i386/linux64.h (LINUX_DEFAULT_ELF): Likewise.
+ * config/sparc/linux.h: (LINUX_DEFAULT_ELF): Likewise.
+ * config/sparc/linux64.h: (LINUX_DEFAULT_ELF): Likewise.
+
+2003-09-03 Jeff Sturm <jsturm@one-point.com>
+
+ * cgraphunit.c (visited_nodes): New static variable.
+ (record_call_1): Use walk_tree with visited_nodes.
+ (cgraph_create_edges): Use walk_tree with visited_nodes.
+ Setup/teardown visited_nodes hashtable.
+
+2003-09-03 Roger Sayle <roger@eyesopen.com>
+
+ * toplev.c (flag_rounding_math): New global variable.
+ (f_options): Add to the list of language independent options.
+ * flags.h (flag_rounding_math): Prototype here.
+ (HONOR_SIGN_DEPENDENT_ROUNDING): Use flag_rounding_math instead.
+ * common.opt (frounding-math): New common command line option.
+ * opts.c (common_handle_option): Handle OPT_frounding_math.
+ (set_fast_math_flags): -ffast-math clears flag_rounding_math.
+
+ * doc/invoke.texi: Document this new command line option.
+
+2003-09-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/sol2.h (NO_IMPLICIT_EXTERN_C): Update comment.
+
+2003-09-03 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (c-objc-common.o): Kill gt-c-objc-common.h dependency.
+ * c-decl.c (finish_function): Kill arguments, always use cgraph path.
+ * c-objc-common.c: Kill include of gt-c-objc-common.h
+ (expand_deferred_fns, deffer_fn): Kill function.
+ (deferred_fns): Kill variable.
+ (finish_cdtor): Update finish_function call.
+ (c_objc_common_finish_file): Always call cgraph code.
+ * c-parse.c: Regenerate.
+ * c-parse.y: Regenerate.
+ * c-tree.h (finish_function): Update prototype.
+ * objc-acct.c (build_module_descriptor, finish_method_def):
+ Update call of finish_function.
+ * cgraphunit.c (cgraph_default_inline_p, cgraph_analyze_function): Add
+ forward prototype.
+ (cgraph_finalize_function): In non-unit-at-a-time mode analyze the
+ function and assemble it if needed.
+ (cgraph_finalize_compilation_unit): Do nothing in non-unit-at-a-time
+ mode.
+ (cgraph_optimize): Likewise.
+ (cgraph_expand_function): In non-unit-at-a-time mode keep function body
+ even when it has no inline callees.
+ * c-parse.in: Update calls to finish_function.
+
+2003-09-03 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.h: Handle TARGET_CPU_iwmmxt.
+ Use #error to generate the message if TARGET_DEFAULT is not
+ recognised.
+
+2003-09-03 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (MASK_UNUSED1): Remove.
+ (MASK_XGOT, TARGET_XGOT): Define.
+ (TARGET_SWITCHES): Add an entry for -mxgot.
+ (ASM_SPEC): Map -mxgot to -xgot.
+ * config/mips/mips.c (mips_symbol_insns): Use TARGET_XGOT to decide
+ whether we're using a big-GOT sequences.
+ (mips_legitimize_const_move, mips_expand_call): Likewise.
+ (override_options): Revert 2003-01-09 change.
+ * doc/invoke.texi: Document -mxgot.
+
+2003-09-02 Jason Merrill <jason@redhat.com>
+
+ * config/sol2.h (NO_IMPLICIT_EXTERN_C): Define here.
+ * config/sparc/sol2.h: Not here.
+
+2003-09-02 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (expand_expr): The code following both_summands performs
+ the same task as simplify_gen_binary. Replace all gotos to
+ both_summands with a call to simplify_gen_binary and delete the
+ now unused label.
+
+2003-09-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/7327
+ * config/sparc/sol2.h (NO_IMPLICIT_EXTERN_C): Define.
+
+2003-09-02 Jeff Sturm <jsturm@one-point.com>
+
+ * cgraphunit.c (record_call_1): Use walk_tree_without_duplicates.
+ (cgraph_optimize_function): Set current_function_decl to the
+ fndecl we're integrating from.
+
+2003-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def: Break out _Complex math functions into their
+ own category.
+
+2003-09-02 Andreas Jaeger <aj@suse.de>
+
+ * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_STMT): Cast properly.
+
+2003-09-02 Josef Zlomek <zlomekj@suse.cz>
+
+ * cfgbuild.c (compute_outgoing_frequencies): Use NOTE instead of
+ finding the note again.
+
+2003-09-02 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Remove host-specific rewrites of target_alias.
+
+2003-09-01 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (genprogs): Fix typo.
+
+ * Makefile.in (gencheck.o): Remove build commands.
+ (dummy-conditions.o): Likewise.
+ (read-rtl.o): Likewise.
+ (gensupport.o): Likewise.
+ (genconfig$(build_exeext)): Remove rule.
+ (genconfig.o): Remove build commands.
+ (genflags$(build_exeext)): Remove rule.
+ (genflags.o): Remove build commands.
+ (gencodes$(build_exeext)): Remove rule.
+ (gencodes.o): Remove build commands.
+ (genconstants.o): Remove build commands.
+ (genemit$(build_exeext)): Remove rule.
+ (genemit.o): Remove build commands.
+ (genrecog$(build_exeext)): Remove rule.
+ (genrecog.o): Remove build commands.
+ (genextract$(build_exeext)): Remove rule.
+ (genextract.o): Remove build commands.
+ (genpeep$(build_exeext)): Remove rule.
+ (genpeep.o): Remove build commands.
+ (genattr$(build_exeext)): Remove rule.
+ (genattr.o): Remove build commands.
+ (genprognames): New variable.
+ (genprogs): Likewise.
+ (genobjs): Likewise.
+ (genprogs): New rule.
+ (genobjs): Likewise.
+ (genattrtab.o): Remove build commands.
+ (genautomata.o): Likewise.
+ (genoutput$(build_exeext)): Remove rule.
+ (genoutput.o): Remove build commands.
+ (gengenrtl.o): Likewise.
+ (genpreds.o): Likewise.
+ (gengtype.o): Likewise.
+ (genconditions.o): Likewise.
+ (gen-protos.o): Likewise.
+ (scan.o): Likewise.
+ (fix-header.o): Likewise.
+ (scan-decls.o): Likewise.
+ (check-g++): Combine with other check targets.
+ (check-gcc): Likewise.
+ (check-g77): Likewise.
+ (check-objc): Likewise.
+
+2003-09-01 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Remove host-specific stuff which is unused here
+ since the introduction of config.host.
+
+ * doc/fragments.texi: Mention config.host.
+ * doc/sourcebuild.texi: Mention config.host. Give brief descriptions
+ of config.build, config.host, and config.gcc.
+
+2003-09-01 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (pushdecl): Don't put variables on
+ C_TYPE_INCOMPLETE_VARS of a type unless that type is itself
+ incomplete.
+
+2003-09-01 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.host: New file.
+ * config.gcc: Remove some host-specific stuff and some
+ logic needed only for repeated invocation.
+ * configure.in: Use config.host.
+ * configure: Regenerate.
+
+2003-09-01 Josef Zlomek <zlomekj@suse.cz>
+
+ * c-typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR.
+ * convert.c (convert_to_integer): Kill BIT_ANDTC_EXPR.
+ * fold-const.c (int_const_binop): Kill BIT_ANDTC_EXPR.
+ (fold): Kill BIT_ANDTC_EXPR and label bit_and.
+ * tree.def (BIT_ANDTC_EXPR): Kill.
+
+2003-08-31 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Remove uses of "for x in .. ${foo}" idiom.
+ * configure: Regenerate.
+
+ * config.gcc: Remove references to install_headers_dir, now unused
+ since introduction of config.build.
+ * config.gcc (i860-*-sysv4*): Don't set unused USG, SVR3 defines.
+
+ * doc/fragments.texi, doc/sourcebuild.texi: Mention new file
+ config.build.
+
+ * config.build: New file.
+ * config.gcc: Remove some build-specific stuff.
+ * configure.in: Use config.build.
+ * configure: Regnerate.
+
+2003-08-31 Steven Bosscher <steven@gcc.gnu.org>
+ Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/11823
+ * stmt.c (expand_end_case_type): Only use jump tables for dense
+ switch statements when optimizing for size.
+
+2003-08-31 Olivier Hainque <hainque@act-europe.fr>
+
+ * builtins.c (expand_builtin_setjmp): Use emit_jump to jump around
+ the != 0 case, which ensures pending stack adjustments are flushed.
+
+2003-08-30 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.frag: Delete file.
+ * configure.in: Rename the substitution variables
+ dep_host_xmake_file and dep_tmake_file to xmake_file and
+ tmake_file respectively. Do not expand $srcdir in the
+ value of these; leave that for Make. Introduce a new
+ substitution varaible, all_lang_makefrags, which lists
+ subdirectory Make-lang.in files; exclude these from
+ all_lang_makefiles, which is now only for subdirectory
+ outputs. Do not invoke configure.frag. Do not set nor
+ AC_SUBST_FILE target_overrides, host_overrides, or
+ language_fragments. Create build subdirectories in
+ config.status extra commands.
+ * configure: Regenerate.
+ * Makefile.in: Update substitutions to match changes to
+ configure. Use include directives instead of @-insertions
+ to read in host, target, and language fragments.
+ (Makefile rule): Do not invoke configure.frag. Do not copy
+ config.status to config.run before executing it. Set
+ CONFIG_HEADERS and CONFIG_FILES so that only Makefile gets
+ regenerated.
+ (cstamp-h rule): Set CONFIG_FILES as well as CONFIG_HEADERS.
+
+2003-08-30 Zack Weinberg <zack@codesourcery.com>
+
+ * c-tree.h: Delete COMPARE_DIFFERENT_TU from enumeration.
+ * c-typeck.c (same_translation_unit_p): New function.
+ (comptypes): Use it instead of flags parameter to identify
+ structure types from different translation units.
+ * c-decl.c (duplicate_decls): Always call comptypes with
+ COMPTYPE_STRICT flags argument.
+ (c_reset_state): Set BLOCK_SUPERCONTEXT of the block formed
+ to file_scope_decl.
+
+2003-08-30 Zack Weinberg <zack@codesourcery.com>
+
+ * c-tree.h (C_TYPE_INCOMPLETE_VARS): New macro.
+ * c-decl.c (struct c_scope): Remove "incomplete" field.
+ (pushdecl): Attach variables with incomplete types to
+ the TYPE_MAIN_VARIANT of the incomplete type in question.
+ (finish_struct): Look at C_TYPE_INCOMPLETE_VARS for variables
+ to complete, not at current_scope->incomplete. All such
+ variables do need completion.
+
+2003-08-30 Richard Earnshaw <rearnsha@arm.com>
+ Nicolas Pitre <nico@cam.org>
+
+ * arm/lib1funcs.asm (RETCOND): Delete.
+ (RETLDM): New assembler macro. Use it for returning with ldm/ldr.
+ (ARM_LDIV0, THUMB_LDIV0): Collapse multiple definitions.
+ (__ARM_ARCH__): Move here from ieee754-?f.S.
+ (RET, RETc): Clean up definitions.
+ (DIV_FUNC_END): Renamed from FUNC_END. All uses changed.
+ (FUNC_END): New macro that marks the end of any function.
+ (ARM_FUNC_START): New macro that allows an assembler routine to be
+ implemented in ARM code even if a Thumb-only build.
+ Unconditionally include ieee754-?f.S.
+ * arm/ieee754-df.S: Delete macros moved to lib1funcs.asm.
+ Mark ends of functions.
+ Split into separate conditionally-compiled units.
+ Use RETLDM to return from routines.
+ * arm/ieee754-sf.S: Similarly.
+ * t-arm-elf (LIB1ASMFUNCS): Remove _ieee754_dp and _ieee754_sp.
+ Add _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2
+ _fixsfsi and _fixunssfsi.
+
+ * arm/ieee754-df.S (__muldf3): Fix bug when result of a
+ multiplication underflows to zero.
+ (__adddf3): Fix bug when using VFP ordering on little-endian
+ processors.
+ (__fixdfsi): Use rrx to extract the carry into a register instead of
+ MRS instruction. Optimize later use of result.
+ * arm/ieee754-sf.S (__fixsfsi): Likewise.
+ (__fixunssfsi): Use a better sequence for handling negative-or-zero.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+
+ * tree-optimize.c: New file.
+ * Makefile.in (OBJS-archive): Add tree-optimize.o.
+ (tree-optimize.o): New.
+ * c-decl.c (store_parm_decls): Use allocate_struct_function.
+ (finish_function): Don't free_after_parsing or free_after_compilation.
+ (set_save_expr_context): Move to tree-optimize.c.
+ (c_expand_body_1): Use tree_rest_of_compilation.
+ * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
+ * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
+ * c-objc-common.c (expand_deferred_fns): Don't emit unused inlines;
+ iterate until closure.
+ * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_START,
+ LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END): New.
+ (LANG_HOOKS_RTL_EXPAND_INITIALIZER): New.
+ * langhooks.h (struct lang_hooks_for_rtl_expansion): New.
+ * toplev.h (tree_rest_of_compilation): Declare it.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+
+ * function.h (struct function): Add rtl_inline_init, saved_for_inline.
+ * integrate.c (save_for_inline): Set saved_for_inline.
+ * c-semantics.c (genrtl_scope_stmt): Check it.
+ * toplev.c (wrapup_global_declarations): Check it.
+ (rest_of_handle_inlining): Set and check rtl_inline_init.
+ (rest_of_compilation): Remove out of date comment.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+
+ * function.c (allocate_struct_function): New, split out of ...
+ (prepare_function_start, init_function_start): ... here.
+ * expr.c (init_expr): Use ggc_alloc_cleared.
+ * stmt.c (init_stmt_for_function): Likewise.
+ * tree.h (allocate_struct_function): Declare.
+
+2003-08-29 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Don't use negated character class in shell case
+ clause.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+
+ * function.h (struct function): Move function_frequency and
+ max_jumptable_ents before start of bit field members.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+
+ * builtins.c (expand_builtin_constant_p): Check cse_not_expected here,
+ (fold_builtin_constant_p) ... not here.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+
+ * c-tree.h (C_DECL_FILE_SCOPE): Move ...
+ * tree.h (DECL_FILE_SCOPE_P): ... here, and rename.
+ * c-decl.c, c-objc-common.c, c-typeck.c: Update to match.
+
+2003-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def: Fix typos.
+ (ATTR_MATHFN_FPROUNDING_STORE): New macro.
+ (BUILT_IN_FREXP, BUILT_IN_FREXPF, BUILT_IN_FREXPL, BUILT_IN_MODF,
+ BUILT_IN_MODFF, BUILT_IN_MODFL, BUILT_IN_REMQUO, BUILT_IN_REMQUOF,
+ BUILT_IN_REMQUOL, BUILT_IN_SINCOS, BUILT_IN_SINCOSF,
+ BUILT_IN_SINCOSL): Use ATTR_MATHFN_FPROUNDING_STORE.
+
+ * builtins.def (BUILT_IN_ERFC, BUILT_IN_ERFCF, BUILT_IN_ERFCL):
+ Use ATTR_MATHFN_FPROUNDING_ERRNO.
+
+2003-08-29 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc (i386-*-vsta): Fix obvious bogosity.
+
+ * fixinc/inclhack.def: Remove special cases for unsupported
+ PTX 1 and PTX 2 (including i[34567]86-sequent-sysv3).
+ * fixinc/fixincl.x: Regenerate.
+
+2003-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (cpp.info): Just state dependencies.
+ (gcc.info): Likewise.
+ (gccint.info): Likewise.
+ (gccinstall.info): Likewise.
+ (cppinternals.info): Likewise.
+ (cpp.dvi): Likewise.
+ (gcc.dvi): Likewise.
+ (gccint.dvi): Likewise.
+ (gccinstall.dvi): Likewise.
+ (cppinternals.dvi): Likewise.
+ (gcov.1): Likewise.
+ (cpp.1): Likewise.
+ (gcc.1): Likewise.
+ (gfdl.7): Likewise.
+ (gpl.7): Likewise.
+ (fsf-funding.7): Likewise.
+ ($(objdir)/%.info): New pattern rule.
+ (%.dvi): Likewise.
+
+2003-08-29 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * Makefile.in (restage1): Pass BOOT_CFLAGS to recursive make.
+ (restage2): Likewise.
+ (restage3): Likewise.
+ (restage4): Likewise.
+ (restageprofile): Likewise.
+ (restagefeedback): Likewise.
+ (bubblestrap): Likewise.
+
+2003-08-29 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Narrow unsupported target match to avoid clobbering
+ i?86-sequent-sysv4*.
+
+2003-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (mathfn_built_in): Handle new math builtins.
+
+2003-08-28 Per Bothner <per@bothner.com>
+
+ Fix (hopefully temporary) for breakage caused by my 08-21 patch.
+ * cpplex.c (_cpp_get_fresh_line): Check for null buffer.
+ (_cpp_lex_buffer): Likewise.
+ * cpptrad.c (_cpp_read_logical_line_trad): Likewise.
+
+2003-08-28 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("*mulsi3_sign"): New insn.
+ ("mulsidi3" expander, "mulsi_6432" insn): Remove, replace by ...
+ ("mulsidi3"): ... this new insn.
+ ("umulsidi3"): New insn.
+ ("divmoddi3", "divmodtidi3", "divmodtisi3"): Simplify by using
+ mixed-mode matching constraints.
+ ("udivmodsi4", "udivmoddisi3"): New insns.
+ ("udivsi3", "umodsi3"): Use only in ESA/390 mode.
+
+2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-types.def (BT_INT_PTR, BT_FLOAT_PTR, BT_DOUBLE_PTR,
+ BT_LONGDOUBLE_PTR, BT_FN_FLOAT_FLOAT_FLOATPTR,
+ BT_FN_DOUBLE_DOUBLE_DOUBLEPTR,
+ BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR,
+ BT_FN_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_INTPTR,
+ BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR,
+ BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR,
+ BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR,
+ BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR,
+ BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR,
+ BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR): New.
+ * builtins.def (BUILT_IN_FREXP, BUILT_IN_FREXPF, BUILT_IN_FREXPL,
+ BUILT_IN_MODF, BUILT_IN_MODFF, BUILT_IN_MODFL, BUILT_IN_REMQUO,
+ BUILT_IN_REMQUOF, BUILT_IN_REMQUOL, BUILT_IN_SINCOS,
+ BUILT_IN_SINCOSF, BUILT_IN_SINCOSL): New.
+ * tree.c: Assign new type_nodes.
+ * tree.h (tree_index): Add TI_FLOAT_PTR_TYPE, TI_DOUBLE_PTR_TYPE,
+ TI_LONG_DOUBLE_PTR_TYPE, TI_INTEGER_PTR_TYPE.
+ (float_ptr_type_node, double_ptr_type_node,
+ long_double_ptr_type_node, integer_ptr_type_node): New type_nodes.
+
+ * doc/extend.texi: Document new builtins.
+
+2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-types.def (BT_FN_FLOAT_INT_FLOAT,
+ BT_FN_DOUBLE_INT_DOUBLE, BT_FN_LONGDOUBLE_INT_LONGDOUBLE): New.
+
+ * builtins.def (BUILT_IN_ERF, BUILT_IN_ERFC, BUILT_IN_ERFCF,
+ BUILT_IN_ERFCL, BUILT_IN_ERFF, BUILT_IN_ERFL, BUILT_IN_GAMMA,
+ BUILT_IN_GAMMAF, BUILT_IN_GAMMAL, BUILT_IN_J0, BUILT_IN_J0F,
+ BUILT_IN_J0L, BUILT_IN_J1, BUILT_IN_J1F, BUILT_IN_J1L,
+ BUILT_IN_JN, BUILT_IN_JNF, BUILT_IN_JNL, BUILT_IN_LGAMMA,
+ BUILT_IN_LGAMMAF, BUILT_IN_LGAMMAL, BUILT_IN_SIGNIFICAND,
+ BUILT_IN_SIGNIFICANDF, BUILT_IN_SIGNIFICANDL, BUILT_IN_TGAMMA,
+ BUILT_IN_TGAMMAF, BUILT_IN_TGAMMAL, BUILT_IN_Y0, BUILT_IN_Y0F,
+ BUILT_IN_Y0L, BUILT_IN_Y1, BUILT_IN_Y1F, BUILT_IN_Y1L,
+ BUILT_IN_YN, BUILT_IN_YNF, BUILT_IN_YNL): New.
+
+ * doc/extend.texi: Document new builtins.
+
+2003-08-28 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/mkfixinc.sh: Remove special case code for unsupported
+ variants of i?86, powerpcle, and thumb.
+ * fixinc/mkfixinc.sh: Remove special case code for unsupported
+ arm and hppa variants.
+
+2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-types.def (BT_FN_INT_FLOAT, BT_FN_INT_DOUBLE,
+ BT_FN_INT_LONGDOUBLE, BT_FN_LONG_FLOAT, BT_FN_LONG_DOUBLE,
+ BT_FN_LONG_LONGDOUBLE, BT_FN_LONGLONG_FLOAT,
+ BT_FN_LONGLONG_DOUBLE, BT_FN_LONGLONG_LONGDOUBLE,
+ BT_FN_FLOAT_FLOAT_LONGDOUBLE, BT_FN_DOUBLE_DOUBLE_LONGDOUBLE,
+ BT_FN_FLOAT_FLOAT_INT, BT_FN_DOUBLE_DOUBLE_INT,
+ BT_FN_LONGDOUBLE_LONGDOUBLE_INT, BT_FN_FLOAT_FLOAT_LONG,
+ BT_FN_DOUBLE_DOUBLE_LONG, BT_FN_LONGDOUBLE_LONGDOUBLE_LONG,
+ BT_FN_FLOAT_FLOAT_FLOAT_FLOAT, BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE,
+ BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE): New.
+
+ * builtins.def (BUILT_IN_ACOS, BUILT_IN_ACOSF, BUILT_IN_ACOSH,
+ BUILT_IN_ACOSHF, BUILT_IN_ACOSHL, BUILT_IN_ACOSL, BUILT_IN_ASIN,
+ BUILT_IN_ASINF, BUILT_IN_ASINH, BUILT_IN_ASINHF, BUILT_IN_ASINHL,
+ BUILT_IN_ASINL, BUILT_IN_ATANH, BUILT_IN_ATANHF, BUILT_IN_ATANHL,
+ BUILT_IN_CBRT, BUILT_IN_CBRTF, BUILT_IN_CBRTL, BUILT_IN_COPYSIGN,
+ BUILT_IN_COPYSIGNF, BUILT_IN_COPYSIGNL, BUILT_IN_COSH,
+ BUILT_IN_COSHF, BUILT_IN_COSHL, BUILT_IN_DREM, BUILT_IN_DREMF,
+ BUILT_IN_DREML, BUILT_IN_EXP10, BUILT_IN_EXP10F, BUILT_IN_EXP10L,
+ BUILT_IN_EXP2, BUILT_IN_EXP2F, BUILT_IN_EXP2L, BUILT_IN_EXPM1,
+ BUILT_IN_EXPM1F, BUILT_IN_EXPM1L, BUILT_IN_FDIM, BUILT_IN_FDIMF,
+ BUILT_IN_FDIML, BUILT_IN_FMA, BUILT_IN_FMAF, BUILT_IN_FMAL,
+ BUILT_IN_FMAX, BUILT_IN_FMAXF, BUILT_IN_FMAXL, BUILT_IN_FMIN,
+ BUILT_IN_FMINF, BUILT_IN_FMINL, BUILT_IN_HYPOT, BUILT_IN_HYPOTF,
+ BUILT_IN_HYPOTL, BUILT_IN_ILOGB, BUILT_IN_ILOGBF, BUILT_IN_ILOGBL,
+ BUILT_IN_LDEXP, BUILT_IN_LDEXPF, BUILT_IN_LDEXPL, BUILT_IN_LLRINT,
+ BUILT_IN_LLRINTF, BUILT_IN_LLRINTL, BUILT_IN_LLROUND,
+ BUILT_IN_LLROUNDF, BUILT_IN_LLROUNDL, BUILT_IN_LOG10,
+ BUILT_IN_LOG10F, BUILT_IN_LOG10L, BUILT_IN_LOG1P, BUILT_IN_LOG1PF,
+ BUILT_IN_LOG1PL, BUILT_IN_LOG2, BUILT_IN_LOG2F, BUILT_IN_LOG2L,
+ BUILT_IN_LOGB, BUILT_IN_LOGBF, BUILT_IN_LOGBL, BUILT_IN_LRINT,
+ BUILT_IN_LRINTF, BUILT_IN_LRINTL, BUILT_IN_LROUND,
+ BUILT_IN_LROUNDF, BUILT_IN_LROUNDL, BUILT_IN_NEXTAFTER,
+ BUILT_IN_NEXTAFTERF, BUILT_IN_NEXTAFTERL, BUILT_IN_NEXTTOWARD,
+ BUILT_IN_NEXTTOWARDF, BUILT_IN_NEXTTOWARDL, BUILT_IN_POW10,
+ BUILT_IN_POW10F, BUILT_IN_POW10L, BUILT_IN_REMAINDER,
+ BUILT_IN_REMAINDERF, BUILT_IN_REMAINDERL, BUILT_IN_RINT,
+ BUILT_IN_RINTF, BUILT_IN_RINTL, BUILT_IN_SCALB, BUILT_IN_SCALBF,
+ BUILT_IN_SCALBL, BUILT_IN_SCALBLN, BUILT_IN_SCALBLNF,
+ BUILT_IN_SCALBLNL, BUILT_IN_SCALBN, BUILT_IN_SCALBNF,
+ BUILT_IN_SCALBNL, BUILT_IN_SINH, BUILT_IN_SINHF, BUILT_IN_SINHL,
+ BUILT_IN_TANH, BUILT_IN_TANHF, BUILT_IN_TANHL): New.
+
+ * doc/extend.texi: Document new builtins.
+
+2003-08-28 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (legitmate_constant_p): Use LARL on
+ zSeries machines even in 31-bit addressing mode.
+ (legitimate_reload_constant_p): Likewise.
+ (legitimize_pic_address): Likewise.
+ (legitimize_tls_address): Likewise.
+ (s390_split_branches): Likewise.
+ (s390_dump_pool): Likewise.
+ (s390_mainpool_finish): Likewise.
+ (s390_chunkify_start): Likewise.
+ (s390_select_rtx_section): Likewise.
+ * config/s390/s390.md ("doloop_si"): Likewise.
+ ("pool_start_31", "pool_end_31"): Likewise.
+ ("pool_start_64", "pool_end_64"): Likewise.
+ ("main_base_31_small", "main_base_31_large"): Likewise.
+ ("main_base_64"): Likewise.
+ ("reload_base_31", "reload_base_64"): Likewise.
+ ("*movsi_larl"): New insn.
+ ("cjump", "icjump"): Use long branches on zSeries machines.
+ ("jump"): Likewise.
+ ("call"): Use BRASL on zSeries machines.
+ ("call_value", "call_value_tls"): Likewise.
+ ("brasl", "bras", "basr_64", "basr_31", "bas_64", "bas_31"): Remove
+ and replace by ...
+ ("*bras", "*brasl", "*basr") ... these new insns.
+ ("brasl_r", "bras_r", "basr_64_r", "basr_31_r", "bas_64_r",
+ "bas_31_r"): Remove and replace by ...
+ ("*bras_r", "*brasl_r", "*basr_r") ... these new insns.
+ ("brasl_tls", "bras_tls", "basr_64_tls", "basr_31_tls",
+ "bas_64_tls", "bas_31_tls"): Remove and replace by ...
+ ("*bras_tls", "*brasl_tls", "*basr_tls") ... these new insns.
+ ("*return_si", "*return_di"): Remove and replace by ...
+ ("*return"): ... this new insn.
+ ("rotlsi3"): Allow on zSeries machines.
+
+ * config/s390/s390.c (legitimize_reload_constant_p): Use
+ LL/LH type instructions in z/Architecture mode.
+ * config/s390/s390.md ("*movsi_lli"): Likewise.
+ ("*andsi3_ni", "*andhi3_ni", "*andqi3_ni"): Likewise.
+ ("*iorsi3_ni", "*iorhi3_ni", "*iorqi3_ni"): Likewise.
+ ("*extendqisi2"): Use LB in z/Architecture mode.
+ ("*zero_extendqisi2_64", "*zero_extendqisi2_31"): Use LLGC in
+ z/Architecture mode.
+ ("zero_extendqihi2", "*zero_extendqihi2_64", "*zero_extendqihi2_31"):
+ Likewise.
+
+ * config/s390/s390.md ("*tmdi_ext"): Allow in both 64-bit
+ and 31-bit mode.
+ ("ptr_extend"): Allow only in 64-bit mode.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * gcc.c (STANDARD_EXEC_PREFIX, STANDARD_STARTFILE_PREFIX)
+ (TOOLDIR_BASE_PREFIX, STANDARD_BINDIR_PREFIX): Remove unnecessary
+ definitions.
+ (main): Only use standard_startfile_prefix if native.
+ * doc/tm.texi (STANDARD_STARTFILE_PREFIX): Update.
+
+2003-08-27 Per Bothner <pbothner@apple.com>
+
+ * cpperror.c (print_location): Don't check for !pfile->buffer. That
+ test fails following my 08-21 change, and it seems unnecessary anyway.
+ (cpp_error): Likewise.
+
+2003-08-27 Jason Merrill <jason@redhat.com>
+
+ * real.c (do_multiply): Initialize with memset.
+
+2003-08-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcov.c (typedef struct arc_info): New field cs_count.
+ (accumulate_line_counts): Find cycles correctly.
+
+2003-08-27 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (struct machine_function): Remove member
+ literal_pool_label.
+ (s390_optimize_prolog): Replace TEMP_REG argument with
+ TEMP_USED and BASE_USED. Do not check get_pool_size ().
+ (general_s_operand): Accept all immediates before reload if
+ ALLOW_IMMEDIATE. If not ALLOW_IMMEDIATE, reject literal pool
+ references.
+ (s390_output_symbolic_const): Remove UNSPEC_LTREL_OFFSET handling.
+ (find_constant_pool_ref): Ignore UNSPECV_POOL_ENTRY insns.
+ (s390_alloc_pool): New function.
+ (s390_new_pool): Call it.
+ (s390_dump_pool): Add REMOTE_LABEL argument.
+ (s390_chunkify_start): Add BASE_REG argument. Do not check
+ get_pool_size ().
+ (s390_chunkify_finish): Add BASE_REG argument. Adapt
+ s390_dump_pool call.
+ (s390_pool_count, s390_nr_constants): Remove.
+ (s390_output_constant_pool): Remove.
+ (s390_mainpool_start): New function.
+ (s390_mainpool_finish): New function.
+ (s390_mainpool_cancel): New function.
+ (s390_reorg): Implement main literal pool handling.
+ (s390_emit_prologue): Emit main_pool placeholder instead of
+ literal_pool_31 / literal_pool_64 insns.
+ * config/s390/s390.h (s390_pool_count, s390_nr_constants): Remove.
+ (ASM_OUTPUT_POOL_PROLOGUE, ASM_OUTPUT_SPECIAL_POOL_ENTRY): Remove.
+ * config/s390/s390.md (UNSPEC_MAIN_BASE): New symbolic constant.
+ ("main_base_31_small", "main_base_31_large"): New insns.
+ ("main_base_64", "main_pool"): New insns.
+ ("literal_pool_31", "literal_pool_64"): Remove.
+
+2003-08-27 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (ptx_netswap): New disabled fix, ported from
+ fixinc.ptx.
+ * fixinc/inclhack.def (undefine_null): Don't generate \r characters.
+ Prettify a little.
+ * fixinc/fixincl.x: Regenerate.
+
+2003-08-27 Richard Earnshaw <rearnsha@arm.com>
+
+ * lib1funcs.asm (L_ieee754_sp): New. Include ieee754-sf.S.
+ (L_ieee754_dp): New. Include ieee754-df.S.
+ * arm/ieee754-sf.S: Rework to allow interworking, calling from Thumb,
+ and compilation in apcs-26 mode.
+ * arm/ieee754-df.S: Likewise.
+ * t-arm-elf (DPBIT, FPBIT, fp-bit.c dp-bit.c): Delete rules
+ (LIB1ASMFUNCS): Add _ieee754_sp and _ieee754_dp targets.
+
+2003-08-27 Nicolas Pitre <nico@cam.org>
+
+ * arm/ieee754-sf.S: New.
+ * arm/ieee754-df.S: New.
+
+2003-08-27 Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (expand_builtin_expect_jump): Save pending_stack_adjust
+ and restore it if returning NULL.
+
+2003-08-27 Richard Sandiford <rsandifo@redhat.com>
+
+ * calls.c (initialize_argument_information): If an argument has no
+ stack space associated with it, and BLOCK_REG_PADDING is defined,
+ use it to decide at which end the argument should be padded.
+ * function.c (assign_parms): Allocate BLKmode stack slots.
+ * config/mips/mips-protos.h (mips_pad_arg_upward): Declare.
+ (mips_pad_reg_upward): Declare.
+ * config/mips/mips.h (PAD_VARARGS_DOWN): Use FUNCTION_ARG_PADDING.
+ (CUMULATIVE_ARGS): Remove num_adjusts and adjusts.
+ (FUNCTION_ARG_PADDING): Use mips_pad_arg_upward.
+ (BLOCK_REG_PADDING): Use mips_pad_reg_upward.
+ * config/mips/mips.c (struct mips_arg_info): Remove struct_p.
+ (mips_expand_call): Remove code for generating structure shifts.
+ (mips_arg_info): Don't set struct_p. Don't set fpr_p for non-float
+ types unless using the EABI.
+ (function_arg_advance): Don't generate shift instructions.
+ (function_arg): Don't return them. Don't short-circuit the
+ check for double structure chunks for DFmode arguments.
+ (mips_pad_arg_upward, mips_pad_reg_upward): New functions.
+ (mips_expand_prologue): Remove code to emit structure shifts.
+ * config/mips/irix6-libc-compat.c: Remove workarounds for buggy
+ structure passing (inet_ntoa, inet_lnaof, inet_netof). Update
+ comments to say that only structure returns are a problem.
+
+2003-08-26 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/tests/base/string.h, fixinc/tests/base/sys/regset.h:
+ Fix to match produced versions.
+ * fixinc/inclhack.def (longlong_t): New disabled test, ported
+ from fixinc.svr4.
+ * fixinc/inclhack.def (ptx_pwd_h): New disabled fix, ported
+ from fixinc.ptx.
+ * fixinc/inclhack.def (ptx_sys_mc_param_h): New disabled fix,
+ ported from fixinc.ptx.
+
+2003-08-26 Per Bothner <pbothner@apple.com>
+
+ * cpplib.h (struct cpp_token): Change type of field line to fileline.
+ (cpp_error_with_line): Use fileline for appropriate parameter.
+ * cpphash.h (struct cpp_macro): Change type of field line to fileline.
+ (struct cpp_reader): Likewise for fields line and directive_line.
+ (_cpp_begin_message): Use fileline for appropriate parameter.
+ * cpperror.c (print_location, _cpp_begin_message, cpp_error_with_line,
+ cpp_error): Use fileline for appropriate parameters and variables.
+ (print_location): New local lin, since it is not a fileline.
+
+2003-08-26 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/12002
+ * tree.h (SCALAR_FLOAT_TYPE_P, COMPLEX_FLOAT_TYPE_P): New macros.
+ (FLOAT_TYPE_P): Define in terms of these two new macros.
+ * fold-const.c (fold <PLUS_EXPR>): Don't convert x+x into x*2.0
+ for complex floating point types.
+
+2003-08-26 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (emit_prologue): Don't check literal pool size.
+ * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Call
+ s390_output_pool_entry.
+
+2003-08-26 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (svr4_preproc_lint_on,
+ svr4_preproc_lint_off, svr4_preproc_machine): New disabled
+ fixes, ported from fixinc.svr4.
+
+2003-08-26 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/install.texi (Prerequisites): Mention GNU make requirement.
+
+ * Makefile.in (AR_FOR_TARGET): Export it.
+ (AR_CREATE_FOR_TARGET): Likewise.
+ (AR_FLAGS_FOR_TARGET): Likewise.
+ (AR_EXTRACT_FOR_TARGET): Likewise.
+ (AWK): Likewise.
+ (BUILD_PREFIX): Likewise.
+ (BUILD_PREFIX_1): Likewise.
+ (DESTDIR): Likewise.
+ (GCC_FOR_TARGET): Likewise.
+ (INCLUDES): Likewise.
+ (INSTALL_DATA): Likewise.
+ (LIB1ASMSRC): Likewise.
+ (LIBGCC2_CFLAGS): Likewise.
+ (MACHMODE_H): Likewise.
+ (NM_FOR_TARGET): Likewise.
+ (RANLIB_FOR_TARGET): Likewise.
+ (libsubdir): Likewise.
+ (slibdir): Likewise.
+ (ORDINARY_FLAGS_TO_PASS): Remove stuff that we're
+ exporting.
+ (libgcc.a): Don't pass them here.
+ (stmp-multilib): Or here.
+ (install-libgcc): Or here.
+ (install-multilib): Or here.
+ (POSTSTAGE1_FLAGS_TO_PASS): Or here.
+ (stage1_build): Or here.
+
+2003-08-26 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.md ("*llgt_sisi", "*llgt_sisi_split", "*llgt_didi",
+ "*llgt_didi_split", "*llgt_sidi", "*llgt_sidi_split"): New insns.
+
+2003-08-26 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.md ("*fmadddf", "*fmsubdf",
+ "*fmaddsf", "*fmsubsf"): New insns.
+
+2003-08-26 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold <MULT_EXPR>): Optimize (C1/X)*C2 into
+ (C1*C2)/X when unsafe math optimizations are allowed.
+ (fold <RDIV_EXPR>): Optimize C1/(X*C2) into (C1/C2)/X with unsafe
+ math optimizations. Minor code clean-ups. Recursively call
+ fold when constructing sub-expressions.
+
+2003-08-26 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (fold_builtin_bitop): New function to perform constant
+ folding of ffs, clz, ctz, popcount and parity builtin functions
+ and their long and long long variants (such as ffsl and ffsll).
+ (fold_builtin): fold_builtin_bitop when appropriate.
+ * simplify-rtx.c (simplify_unary_operation): Honor both
+ CLZ_DEFINED_VALUE_AT_ZERO and CTZ_DEFINED_VALUE_AT_ZERO when
+ evaluating clz and ctz at compile-time, for operands wider
+ than HOST_WIDE_INT.
+
+2003-08-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * builtins.c (build_function_call_expr): Don't set
+ TREE_SIDE_EFFECTS here.
+ * expr.c (emit_block_move_via_libcall): Likewise.
+ (clear_storage_via_libcall): Likewise.
+ * tree.c (build): Set TREE_SIDE_EFFECTS for non-const, non-pure
+ CALL_EXPRs.
+
+ * gcse.c (is_too_expensive): New function.
+ (gcse_main, delete_null_pointer_checks, bypass_jumps): Use it.
+
+2003-08-25 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc (hppa*-*-hpux11*, ia64*-*-hpux*): Remove
+ commented-out logic to use DCE threads (if present), add
+ support for POSIX threads.
+ * config/ia64/hpux.h: Define CPP_SPEC to set appropriate
+ #defines for -pthread. Add -lpthread to LIB_SPEC when
+ -pthread. In both cases take -mt as a synonym for -pthread
+ for acc compatibility.
+ Define GTHREAD_USE_WEAK to 0.
+ * config/pa/pa-hpux11.h: Likewise for CPP_SPEC and LIB_SPEC.
+ Remove old logic for DCE threads from LIB_SPEC.
+ * config/pa/pa64-hpux.h: Define GTHREAD_USE_WEAK to 0.
+
+2003-08-25 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin_mathfn): Rearrange so that we only
+ return 0 for invalid argument types. Instead drop through to a
+ call of expand_call at the bottom of function. If op is SQRT,
+ try attaching a SQRT rtx as the REQ_EQUAL note of the libcall.
+
+2003-08-25 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_tls_address): Properly truncate
+ result when op0 is SImode.
+
+2003-08-25 Nathanael Nerode <neroden@twcny.rr.com>
+
+ * fixinc/inclhack.def (svr4_sighandler_type): New fix, ported
+ from fixinc.svr4.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/tests/base/sys/signal.h: Regenerate.
+
+2003-08-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * combine.c (simplify_comparison): Re-enable widening of comparisons
+ with non-paradoxical subregs of non-REG expressions.
+
+2003-08-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * combine.c (distribute_notes): Handle REG_ALWAYS_RETURN.
+
+2003-08-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * combine.c (combine_simplify_rtx): Fix RTL sharing bug.
+
+2003-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * pretty-print.h (pp_maybe_newline_and_indent): New macro.
+ * c-pretty-print.h (c_pretty_printer): Now typedef to the
+ structure. Be consistent with pretty-print.h abd cxx-pretty-print.h
+ (struct c_pretty_print_info): Document. Add new fields.
+ (pp_type_specifier_seq): Rename from pp_c_type_specifier.
+ (pp_direct_abstract_declarator): New macro.
+ (pp_ptr_operator): Likewise.
+ (pp_simple_type_specifier): Likewise.
+ (pp_expression): Likewise.
+ (pp_parameter_list): Rename from pp_parameter_declaration.
+ * c-pretty-print.c (pp_c_whitespace): Now a function.
+ (pp_c_left_paren): Likewise.
+ (pp_c_right_paren): Likewise.
+ (pp_c_dot): Likewise.
+ (pp_c_ampersand): Likewise.
+ (pp_c_arrow): Likewise.
+ (pp_c_semicolon): Likewise.
+ (pp_c_type_cast): New function.
+ (pp_c_space_for_pointer_operator): Likewise.
+ (pp_c_call_argument_list): Likewise.
+ (pp_c_cv_qualifier): Adjust prototype.
+ (pp_c_type_qualifier_list): Likewise.
+ (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here.
+ (pp_c_type_specifier): Rename from pp_c_simple_type_specifier.
+ Adjust to follow standard grammar.
+ (pp_c_specifier_qualifier_list): Adjusr prototype. Handle
+ REFERENCE_TYPE. Tidy.
+ (pp_c_parameter_type_list): Adjust prototype. Tidy.
+ (pp_c_parameter_declaration): Remove.
+ (pp_c_abstract_declarator): Adjust prototype.
+ (pp_c_direct_abstract_declarator): Likewise.
+ (pp_c_type_id): Likewise.
+ (pp_c_storage_class_specifier): Likewise.
+ (pp_c_function_specifier): Likewise.
+ (pp_c_declaration_specifiers): Likewise.
+ (pp_c_direct_declarator): Likewise.
+ (pp_c_declarator): Likewise.
+ (pp_c_declarator): Likewise.
+ (pp_c_declaration): Likewise.
+ (pp_c_attributes): Likewise. Tidy.
+ (pp_c_function_definition): Adjust prototype.
+ (pp_c_char): Likewise.
+ (pp_c_string_literal): Likewise.
+ (pp_c_integer_constant): Likewise.
+ (pp_c_character_constant): Likewise.
+ (pp_c_bool_constant): Likewise.
+ (pp_c_enumeration_constant): Likewise.
+ (pp_c_floating_constant): Likewise.
+ (pp_c_constant): Likewise.
+ (pp_c_identifier): Likewise.
+ (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy.
+ (pp_c_initializer): Adjust prototype.
+ (pp_c_init_declarator): Likewise.
+ (pp_c_initializer_list): Likewise.
+ (pp_c_id_expression): Likewise.
+ (pp_c_postfix_expression): Likewise.
+ (pp_c_expression_list): Likewise.
+ (pp_c_unary_expression): Likewise.
+ (pp_c_cast_expression): Likewise.
+ (pp_c_multiplicative_expression): Likewise.
+ (pp_c_additive_expression): Likewise.
+ (pp_c_shift_expression): Likewise.
+ (pp_c_relational_expression): Likewise.
+ (pp_c_equality_expression): Likewise.
+ (pp_c_and_expression): Likewise.
+ (pp_c_exclusive_or_expression): Likewise.
+ (pp_c_inclusive_or_expression): Likewise.
+ (pp_c_logical_and_expression): Likewise.
+ (pp_c_logical_or_expression): Likewise.
+ (pp_c_conditional_expression): Likewise.
+ (pp_c_assignment_expression): Likewise.
+ (pp_c_expression): Likewise. Tidy.
+ (pp_c_statement): Likewise. Document.
+ (pp_c_pretty_printer_init): Adjust prototype. Tidy.
+
+ * c-lang.c (c_initialize_diagnostics): Update.
+ * c-common.h (strip_pointer_operator): Declare.
+ * c-common.c (strip_pointer_operator): Define.
+
+2003-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8795
+ * tree.h (build_method_type_directly): Declare.
+ * c-common.c (handle_vector_size_attributes): Handle METHOD_TYPEs.
+ (vector_size_helper): Likewise.
+ * tree.c (build_method_type_directly): New function.
+ (build_method_type): Use it.
+
+2003-08-24 Richard Henderson <rth@redhat.com>
+
+ * config/i386.i386.c (ix86_return_in_memory): Reformat. Return true
+ for 16-byte vector modes if sse not enabled; warn for abi change.
+ (ix86_value_regno): Only return xmm0 for 16-byte vector types.
+
+2003-08-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * rtlanal.c (may_trap_p): Simplify an integer comparison.
+
+2003-08-24 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (AAB_svr4_replace_byteorder): Enhance
+ comment. Enable for DYNIX/ptx systems (when they switch to
+ regular fixincludes).
+ * fixinc/fixincl.x: Regenerate.
+
+2003-08-23 Jason Eckhardt <jle@rice.edu>
+
+ * config/i860/t-i860: New.
+ * config.gcc (i860-*-sysv4*): Add t-i860 to tmake_file.
+
+2003-08-23 Jakub Jelinek <jakub@redhat.com>
+
+ * c-decl.c (pushdecl): Only put decls which finish_struct will do
+ something about onto incomplete chain.
+ (finish_struct): If not removing type from incomplete
+ list, update prev.
+
+2003-08-20 Jan Hubicka <jh@suse.cz>
+
+ PR target/11369
+ * i386.c (ix86_expand_carry_flag_compare): Validate operand.
+
+ PR target/11031
+ * i386.c (const_0_to_3_operand, const_0_to_7_operand,
+ const_0_to_15_operand, const_0_to_255_operand): New predicates.
+ * i386.h (PREDICATE_CODES): Add these.
+ * i386.c (pinsrw and pextrw patterns): Use them.
+
+ PR target/10984
+ * i386.c (ix86_expand_binop_builtin): Behave sanely for VOIDmodes.
+
+ PR target/8869
+ * expr.c (convert_modes): Deal properly with integer to vector
+ constant conversion.
+
+ PR target/8871
+ * i386.md (zero_extendsidi2*): Add MMX and SSE alternatives.
+
+2003-08-23 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.h (LOAD_EXTEND_OP): Remove.
+ * config/s390/s390.md ("movhi"): New expander; old insn renamed to ...
+ ("*movhi"): ... this.
+ ("movqi", "*movqi"): Likewise.
+ ("movqi_64"): Remove.
+ ("*zero_extendhisi2_31"): Change predicate to s_operand.
+
+2003-08-23 Dale Johannesen <dalej@apple.com>
+ * calls.c (emit_library_call_value_1): Fix obvious errors in
+ arguments to emit_group_store.
+
+2003-08-23 Jason Eckhardt <jle@rice.edu>
+
+ * calls.c (emit_library_call_value_1): Remove code related
+ to LIBGCC_NEEDS_DOUBLE.
+ * config/stormy16/stormy16.h: Remove mention of LIBGCC_NEEDS_DOUBLE.
+ * doc/tm.texi: Likewise.
+ * system.h: Poison the LIBGCC_NEEDS_DOUBLE macro.
+
+2003-08-23 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/linux64.h (STARTFILE_PREFIX_SPEC): Remove.
+
+2003-08-23 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_setup_incoming_varargs): Handle o32 and o64
+ as well. Put memory references in the varargs alias set.
+ (mips_expand_prologue): Remove varargs handling from here.
+
+2003-08-23 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_expand_movstr, s390_expand_clrstr,
+ s390_expand_cmpmem, s390_output_constant_pool, s390_build_va_list,
+ s390_function_profiler, s390_output_mi_thunk): Use ISO C syntax
+ for function pointer calls.
+ * config/s390/s390.md ("*negdi2_31"): Likewise.
+
+2003-08-23 Roger Sayle <roger@eyesopen.com>
+
+ * combine.c (apply_distributive_law): Correct comment.
+
+2003-08-23 Jason Eckhardt <jle@rice.edu>
+
+ * config/i860/i860.h: Remove comment mentioning LIBGCC_NEEDS_DOUBLE.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * config/i860/i860.c (i860_build_va_list): Create the va_decl
+ declaration. Document the va_list structure.
+ (i860_va_start): Initialize the va_list structure.
+ (i860_va_arg): Rewrite completely.
+ * config/i860/i860.h (LIBGCC_NEEDS_DOUBLE): Don't define.
+ * config/i860/varargs.asm: Do not allocate or initialize
+ a va_list. Return the address of the register save area.
+
+2003-08-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/iq2000/iq2000.c: Fix comment typos.
+ * config/iq2000/iq2000.md: Likewise.
+
+2003-08-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/iq2000/iq2000.c: Follow spelling conventions.
+ * config/iq2000/iq2000.h: Likewise.
+ * config/mn10300/mn10300.c: Likewise.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * config/i860/i860.c (output_move_double): Don't set latehalf
+ to zero for CONST_INT (since it could be, e.g., -1).
+
+ * config/i860/i860.h (REMSI3_LIBCALL): Replace this macro...
+ (MODSI3_LIBCALL): ...with this one.
+ (UREMSI3_LIBCALL): Replace this macro...
+ (UMODSI3_LIBCALL): ...with this one.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * config/i860/i860-protos.h (output_delay_insn): Remove prototype.
+ (output_delayed_branch): Remove prototype.
+ (single_insn_src_p): Remove prototype.
+ * config/i860/i860.c (single_insn_src_p): Remove function.
+ (output_delayed_branch): Remove function.
+ (output_delay_insn): Remove function.
+ (va_start): Remove unconditional test and dead code, re-format.
+ Fix coding style and spelling problems in various comments.
+ * config/i860/i860.md (UNSPECV_BLOCKAGE): Define constant...
+ (blockage pattern): ...and use it here.
+ (all define_peephole patterns related to delayed branches): Remove.
+ Fix coding style and spelling problems in various comments.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * config/i860/i860.c: Replace all occurrences of 'GNU CC' with 'GCC'.
+ Remove all uses of the PARAMS macro. Remove superflous prototypes.
+ Convert all function definitions from traditional to ISO C90 syntax.
+ * config/i860/i860-protos.h: Replace all occurrences of 'GNU CC'
+ with 'GCC'. Remove all uses of the PARAMS macro.
+ * config/i860/i860.h: Replace all occurrences of 'GNU CC' with 'GCC'.
+ * config/i860/i860.md: Likewise.
+ * config/i860/sysv4.h: Likewise.
+ * config/i860/varargs.asm: Likewise.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * config/i860/i860-protos.h (i860_va_start): Remove 'stdarg_p'
+ argument.
+ (tdesc_section): Add prototype.
+ Update copyright dates.
+ * config/i860/i860.c: Include coretypes.h, tm.h, and toplev.h.
+ (TARGET_ASM_FUNCTION_PROLOGUE): Move definition to end of file.
+ (TARGET_ASM_FUNCTION_EPILOGUE): Likewise.
+ (targetm): Likewise.
+ (i860_output_function_prologue): Substitute HOST_WIDE_INT_PRINT_DEC
+ for '%d' where necessary.
+ (i860_va_start): Remove 'stdarg_p' argument. Make conditional checks
+ on 'stdarg_p' unconditional. Divide current_function_args_info.ints
+ by UNITS_PER_WORD when referencing (likewise for .floats).
+ (I860_SVR4_VARARGS): Rename...
+ (I860_SVR4_VA_LIST): ...to this.
+ Call build() with 't' rather than 'field'.
+ (i860_rtx_costs): New function.
+ (TARGET_RTX_COSTS): Define.
+ (i860_internal_label): New function.
+ (TARGET_ASM_INTERNAL_LABEL): Define.
+ (i860_file_start): New function.
+ Update copyright dates.
+ * config/i860/i860.h (CPP_PREDEFINES): Remove.
+ (TARGET_CPU_CPP_BUILTINS): Define.
+ (EXPAND_BUILTIN_VA_START): Remove 'stdarg' argument.
+ (CONST_COSTS): Remove (and move code to i860_rtx_costs).
+ (ASM_FILE_START): Remove.
+ (ASM_FILE_START_1): Remove.
+ (ASM_GLOBALIZE_LABEL): Remove.
+ (ASM_OUTPUT_INTERNAL_LABEL): Remove.
+ (ASM_OUTPUT_CASE_LABEL): Replace call of ASM_OUTPUT_INTERNAL_LABEL
+ with targetm.asm_out.internal_label.
+ Update copyright dates.
+ * config/i860/sysv4.h (USER_LABEL_PREFIX): Define.
+ (CPP_PREDEFINES): Remove.
+ (TARGET_OS_CPP_BUILTINS): Define.
+ (GLOBAL_ASM_OP): Define.
+ (ASM_FILE_START): Remove.
+ (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Define.
+ (TARGET_ASM_FILE_START): Define.
+ Update copyright dates.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * gcc/config.gcc (i860-*-sysv4*): Add target.
+ * config/i860/i860-protos.h: New.
+ * config/i860/i860.c: New.
+ * config/i860/i860.h: New.
+ * config/i860/i860.md: New.
+ * config/i860/sysv4.h: New.
+ * config/i860/varargs.asm: New.
+ * config/i860/x-sysv4: New.
+
+2003-08-22 Jason Eckhardt <jle@rice.edu>
+
+ * config/pa/pa.c: Replace 'GNU CC' with 'GCC'.
+ Remove all uses of PARAMS macro.
+ Convert all function definitions to ISO C90 syntax.
+ * config/pa/elf.h: Replace 'GNU CC' with 'GCC'.
+ * config/pa/fptr.c: Likewise.
+ * config/pa/lib2funcs.asm: Likewise.
+ * config/pa/long_double.h: Likewise.
+ * config/pa/milli64.S: Likewise.
+ * config/pa/pa-64.h: Likewise.
+ * config/pa/pa-hpux.h: Likewise.
+ * config/pa/pa-hpux10.h: Likewise.
+ * config/pa/pa-hpux11.h: Likewise.
+ * config/pa/pa-linux.h: Likewise.
+ * config/pa/pa-modes.def: Likewise.
+ * config/pa/pa-osf.h: Likewise.
+ * config/pa/pa-pro-end.h: Likewise.
+ * config/pa/pa.md: Likewise.
+ * config/pa/pa32-linux.h: Likewise.
+ * config/pa/pa64-linux.h: Likewise.
+ * config/pa/pa64-hpux.h: Likewise.
+ * config/pa/pa64-regs.h: Likewise.
+ * config/pa/quadlib.c: Likewise.
+ * config/pa/rtems.h: Likewise.
+ * config/pa/pa-protos.h: Replace 'GNU CC' with 'GCC' and remove
+ all uses of the PARAMS macro.
+ * config/pa/pa.h: Likewise.
+ * config/pa/som.h: Likewise.
+
+ * config/iq2000/iq2000.c: Replace 'GNU CC' with 'GCC'.
+ Remove all uses of PARAMS macro.
+ Convert all function definitions to ISO C90 syntax.
+ * config/iq2000-protos.h: Replace 'GNU CC' with 'GCC'.
+ Remove all uses of PARAMS macro.
+ * config/iq2000.h: Remove all uses of PARAMS macro.
+ * config/iq2000/iq2000.md: Replace 'GNU CC' with 'GCC'.
+
+2003-08-23 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390-protos.h (s390_output_pool_entry): Declare.
+ * config/s390/s390.c (gen_consttable): Remove.
+ (s390_dump_pool): Use UNSPECV_POOL_ENTRY for pool entry insns.
+ (s390_output_pool_entry): New function.
+ * config/s390/s390.md (UNSPECV_POOL_QI, UNSPECV_POOL_HI,
+ UNSPECV_POOL_SI, UNSPECV_POOL_DI, UNSPECV_POOL_TI,
+ UNSPECV_POOL_SF, UNSPECV_POOL_DF): Remove, replace by ...
+ (UNSPECV_POOL_ENTRY): ... this new constant.
+ ("consttable_qi", "consttable_hi", "consttable_si", "consttable_di",
+ "consttable_ti", "consttable_sf", "consttable_df"): Remove ...
+ ("*pool_entry"): ... and replace by this new insn.
+ ("literal_pool_31"): Do not emit anchor label if pool empty.
+
+ * config/s390/s390.c (struct machine_function): Add save_return_addr_p.
+ (s390_optimize_prolog): Save RETURN_REGNUM if save_return_addr_p.
+ (s390_fixup_clobbered_return_reg): Remove.
+ (s390_reorg): Don't call s390_fixup_clobbered_return_reg.
+ (s390_return_addr_rtx): Always retrieve return address from save area
+ slot. Use save_return_addr_p to force slot to be filled.
+ (s390_emit_prologue): Remove has_hard_reg_initial_val test.
+
+2003-08-22 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/mips.h (MASK_FIX_SB1, TARGET_FIX_SB1): New defines.
+ (TARGET_SWITCHES): Add -mfix-sb1 and -mno-fix-sb1.
+ * config/mips/mips.md (divdf3, divsf3, sqrtdf2, sqrtsf2): Work
+ around SB-1 errata if TARGET_FIX_SB1 is set.
+ (recip.d insn, recip.s insn, rsqrt.d insn, rsqrt.s insn): Likewise.
+ * doc/invoke.texi: Document MIPS -mfix-sb1 and -mno-fix-sb1.
+
+2003-08-22 Roger Sayle <roger@eyesopen.com>
+
+ * hashtable.c (ht_expand): Avoid calculating rehash for the common
+ case that the first probe hits an empty hash table slot.
+
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * config/ia64/hpux.h (SUPPORTS_INIT_PRIORITY): Define to 0.
+
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * config/ia64/ia64.md (*ptr_extend_plus_1): Rename to ...
+ (ptr_extend_plus_imm): ... this.
+ * config/ia64/ia64.c (addp4_optimize_ok): Do not disable addp4
+ optimization in C++.
+ (ia64_output_mi_thunk): Support ILP32 mode.
+
+2003-08-22 Bernardo Innocenti <bernie@develer.com>
+
+ * gcc/config/m68k/m68k.c (m68k_coff_asm_named_section): remove unused
+ function.
+ * gcc/config/m68k/m68k.c (-m68k_svr3_asm_out_constructor): likewise.
+
+2003-08-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/i386/i386.c (const_int_1_operand): Simplify an
+ integer comparison.
+
+2003-08-22 Alan Modra <amodra@bigpond.net.au>
+
+ * config/fp-bit.c: Specify config/ dir for include of fp-bit.h.
+ * config/rs6000/ppc64-fp.c: Likewise.
+
+2003-08-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cfgcleanup.c: Fix comment typos.
+ * emit-rtl.c: Likewise.
+ * optabs.c: Likewise.
+ * ra-build.c: Likewise.
+ * rtlanal.c: Likewise.
+ * tree.h: Likewise.
+
+2003-08-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * c-decl.c: Fix comment formatting.
+ * cfgrtl.c: Likewise.
+ * combine.c: Likewise.
+ * convert.c: Likewise.
+ * dominance.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * dwarfout.c: Likewise.
+ * expmed.c: Likewise.
+ * fold-const.c: Likewise.
+ * gcov.c: Likewise.
+ * genattrtab.c: Likewise.
+ * ggc-common.c: Likewise.
+ * mips-tfile.c: Likewise.
+ * regmove.c: Likewise.
+
+2003-08-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * builtin-attrs.def: Fix comment formatting.
+ * c-pretty-print.c: Likewise.
+ * diagnostic.h: Likewise.
+ * langhooks.h: Likewise.
+ * recog.c: Likewise.
+ * simplify-rtx.c: Likewise.
+ * tree.def: Likewise.
+
+2003-08-22 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k-protos.h: Convert to ISO C90.
+ * config/m68k/m68k.c: Likewise.
+
+2003-08-21 Bernardo Innocenti <bernie@develer.com>
+ Paul Dale <pauli@snapgear.com>
+ Peter Barada <peter@baradas.org>
+
+ * config/m68k/m68k.c (m68k_rtx_costs): Adjust mul/div costs for
+ ColdFire cores.
+
+2003-08-21 Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in (INCLUDES): Remove -I$(srcdir)/config.
+ * config.gcc (*-*-openbsd): Don't set tm_file.
+ (alpha*-*-openbsd, arm*-*-coff*, arm*-wince-pe*,
+ arm-*-pe*, avr-*-*, h8300-*-rtems*, h8300-*-elf*,
+ h8300-*-*, hppa*-*-osf*, hppa*-*-bsd*, hppa*-*-hpux*,
+ i370-*-opened*, i370-*-mvs*, i370-*-linux*, i?86-*-openbsd*,
+ i?86-*-lynxos, i?86-*-nto-qnx*, iq2000*-*-elf*, m68000-hp-hpux*,
+ m68k-hp-hpux*, m68k-*-aout*, m68k-*-coff*, m68020-*-elf*,
+ m68k-*-elf*, m68k*-*-netbsd*, m68k*-*-openbsd*, m68k-*-sysv4*,
+ m68k-*-linux*, m68k-*-rtems*, mcore-*-pe*, mips*-*-netbsd*,
+ mips*-*-openbsd*, rs6000-*-lynxos*, sh*-*-elf*, sh*-*-ka,
+ sh-*-rtemself, sparc-*-openbsd*, strongarm-*-pe, vax-*-openbsd*,
+ xscale-*-coff): Use explicit and complete lists of target headers
+ to include. Move definitions to tm_defines where appropriate.
+ (hppa*-*-openbsd*, powerpc-*-openbsd*): Comment out stanza for
+ not-yet-contributed configuration.
+
+ * config/lynx.h, config/alpha/openbsd.h, config/arm/coff.h
+ * config/avr/avr.h, config/frv/frv.h, config/h8300/elf.h
+ * config/i370/linux.h, config/i370/mvs.h, config/i370/oe.h
+ * config/i386/nto.h, config/iq2000/iq2000.h,
+ * config/m68k/coff.h, config/m68k/hp310.h, config/m68k/hp320.h
+ * config/m68k/linux.h, config/m68k/m68k-aout.h
+ * config/m68k/m68k-none.h, config/m68k/m68kv4.h
+ * config/m68k/netbsd.h, config/m68k/openbsd.h
+ * config/m68k/sgs.h, config/mcore/mcore-pe.h,
+ * config/mips/netbsd.h, config/mips/openbsd.h, config/pa/pa.h,
+ * config/rs6000/lynx.h, config/sh/embed-elf.h, config/sparc/openbsd.h:
+ Remove includes of other target config headers, and
+ definitions of macros moved to tm_defines lists. Add #undefs
+ where now necessary to prevent redefinition warnings.
+
+ * config/h8300/coff.h: New file split out of...
+ * config/h8300/elf.h: ...here.
+ * config/m68k/hp320base.h: New file split out of...
+ * config/m68k/hp320.h: ...here.
+ * config/rs6000/lynxbase.h: New file split out of...
+ * config/rs6000/lynx.h: ...here.
+
+ * config/m68k/hp310g.h, config/m68k/hp320g.h, config/m68k/hpux7.h
+ * config/m68k/m68k-coff.h, config/mips/openbsd-be.h: Delete file.
+
+ * config/sol2.h: Remove #if 0-ed #include of sys/mman.h.
+ * config/m68k/m68kelf.h: Remove commented out #include of m68k/sgs.h.
+ * config/mcore/mcore.h: Don't include hwint.h nor machmode.h.
+ Remove unnecessary #ifndef.
+ * config/s390/s390.h: Prefix #include of s390/fixdfdi.h
+ [under IN_LIBGCC2] with config/.
+
+2003-08-21 Per Bothner <pbothner@apple.com>
+
+ * cppfiles.c (stack_file): Correctly pass return_at_eof parameter
+ to cpp_push_buffer.
+ * cpplex.c (_cpp_get_fresh_line): Don't buffer->prev - handled
+ by return_at_eof check. Always call _cpp_pop_buffer at end.
+
+2003-08-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/11805
+ * config/h8300/h8300.md (two anonymous patterns): Remove.
+
+2003-08-21 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause.
+ * config/mips/mips.c (function_arg_pass_by_reference): Never return
+ true for n32 & n64.
+
+2003-08-21 Josef Zlomek <zlomekj@suse.cz>
+
+ * fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0
+ and similarly in (A | C) == D where C & ~D != 0.
+
+2003-08-20 Geoffrey Keating <geoffk@apple.com>
+
+ PR 8180
+ * configure.in: When testing with_libs and with_headers, treat
+ 'no' as unset. Based on a patch by Dan Kegel <dank@kegel.com>.
+ * configure: Regenerate.
+
+2003-08-20 Peter Barada <peter@baradas.org>
+
+ * longlong.h (umul_ppmm): Add ColdFire support.
+
+2003-08-20 Peter Barada <peter@baradas.org>
+ Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k-none.h: Introduce new ColdFire archs.
+ * config/m68k/m68k.h: Likewise.
+ * config/m68k/lb1sf68.asm: Rename __mcf5200__ to __mcoldfire__.
+ * config/m68k/coff.h: Rename TARGET_5200 to TARGET_COLDFIRE.
+ * config/m68k/linux.h: Likewise.
+ * config/m68k/m68k.c: Likewise.
+ * config/m68k/m68k.md: Likewise.
+ * config/m68k/m68kelf.h: Likewise.
+ * config/m68k/netbsd-elf.h: Likewise.
+ * config/m68k/t-m68kelf: Add multilib targets for new ColdFire archs.
+
+2003-08-20 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k.c: Strip away code depending on NO_ADDSUB_Q definition.
+ * config/m68k/m68k.md: Likewise.
+
+2003-08-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR java/11996
+ Revert this change:
+ 2003-08-19 Mark Mitchell <mark@codesourcery.com>
+ * c-common.c (c_common_signed_or_unsigned_type): Correctly handle
+ types with precisions other than those given by native machine
+ modes.
+
+2003-08-20 Gunther Nikl <gni@gecko.de>
+
+ * config/m68k/m68k.md (anonymous define_insn): remove obsolete code
+ selected by FSGLMUL_USE_S and FSGLDIV_USE_S
+ * config/m68k/m68k.c (output_move_himode): remove SGS_NO_LI check
+ * config/m68k/m68k.md (anonymous define_insn): Likewise
+ * config/m68k/m68k.md (anonymous define_insn): remove ISI_OV check
+ * config/m68k/m68k.c (standard_68881_constant_p): remove obsolete
+ code selected by NO_ASM_FMOVECR
+
+2003-08-20 Gunther Nikl <gni@gecko.de>
+
+ * config/m68k/m68k.c (output_move_const_into_data_reg,
+ output_move_himode): unify MOTOROLA/MIT handling of moveq
+ * config/m68k/m68k.md (movsi_const0, anonymous define_insn):
+ Likewise
+
+2003-08-20 Gunther Nikl <gni@gecko.de>
+
+ * config/m68k/m68k.c (m68k_output_function_prologue): use %U in
+ label name
+ * config/m68k/m68k.c (m68k_output_function_epilogue): replace
+ HOST_WIDE_INT_PRINT_DEC with %wd
+
+2003-08-20 Loren James Rittle <ljrittle@acm.org>
+
+ * config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Handle
+ redefine warning.
+
+2003-08-20 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/11984
+ * fold-const.c (fold <PLUS_EXPR>): Check for integer constant
+ operands before calling tree_int_cst_lt when performing associative
+ transformations.
+
+2003-08-20 Jason Merrill <jason@redhat.com>
+
+ * tree.h (IS_EXPR_CODE_CLASS): Also include 'r' and 's'.
+ (EXPR_CHECK): Don't check for 'r' or 's' if we're
+ checking IS_EXPR_CODE_CLASS.
+ * calls.c (calls_function_1): Likewise.
+ * fold-const.c (fold): Likewise.
+ * tree.c (iterative_hash_expr): Likewise.
+ * tree-inline.c (walk_tree, copy_tree_r): Likewise.
+
+2003-08-20 Gunther Nikl <gni@gecko.de>
+
+ * config/m68k/m68k.c (m68k_output_mi_thunk): delete obsolete code
+ depending on MOTOROLA_BSR
+ * config/m68k/m68k.md (anonymous define_insn): Likewise
+
+2003-08-20 Jason Merrill <jason@redhat.com>
+
+ * builtins.c (expand_builtin_mathfn): Use get_callee_fndecl.
+ (expand_builtin_mathfn2, expand_builtin, builtin_mathfn_code,
+ fold_trunc_transparent_mathfn, fold_builtin): Likewise.
+ * dojump.c (do_jump): Likewise.
+ * fold-const.c (operand_equal_p, fold): Likewise.
+ (tree_expr_nonnegative_p): Likewise.
+
+ * stor-layout.c (do_type_align): Only copy DECL_USER_ALIGN from
+ TYPE_USER_ALIGN for FIELD_DECLs.
+
+ * attribs.c (decl_attributes): Rebuild the function pointer type after
+ changing the target type.
+ * tree.c (get_qualified_type): Also check that the attributes match.
+
+2003-08-19 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * Makefile.in (STAGESTUFF): Move cc1obj$(exeext) from here ...
+ * objc/config-lang.in (stagestuff): ... to here.
+
+2003-08-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11946
+ * convert.c (convert_to_integer): Use CONVERT_EXPR (instead of
+ NOP_EXPR) when necessary.
+ * c-common.c (c_common_signed_or_unsigned_type): Correctly handle
+ types with precisions other than those given by native machine
+ modes.
+
+2003-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ * cpppch.c (cpp_valid_state): Re-add warning about PCH not used
+ because some macro is defined.
+
+ * config/darwin.h (LINK_COMMAND_SPEC): Add -arch and -arch_only
+ options.
+ * config/i386/darwin.h (ASM_SPEC): New.
+ (SUBTARGET_EXTRA_SPECS): New.
+ * config/rs6000/darwin.h (ASM_SPEC): New.
+ (SUBTARGET_EXTRA_SPECS): New.
+ * configure.in: Don't set CROSS or SYSTEM_HEADER_DIR when building
+ a cross-compiler between two different processors on Darwin.
+ * configure: Regenerate.
+
+2003-08-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * builtins.c: Fix comment typos.
+ * c-common.c: Likewise.
+ * c-decl.c: Likewise.
+ * c-pretty-print.c: Likewise.
+ * cfgbuild.c: Likewise.
+ * cfglayout.c: Likewise.
+ * cfgloopanal.c: Likewise.
+ * cgraphunit.c: Likewise.
+ * cppfiles.c: Likewise.
+ * dwarfout.c: Likewise.
+ * expr.c: Likewise.
+ * fold-const.c: Likewise.
+ * gcse.c: Likewise.
+ * ggc-page.c: Likewise.
+ * haifa-sched.c: Likewise.
+ * pretty-print.c: Likewise.
+ * tree.c: Likewise.
+ * tree.h: Likewise.
+ * value-prof.c: Likewise.
+
+2003-08-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * c-decl.c: Follow spelling conventions.
+ * cppfiles.c: Likewise.
+
+2003-08-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * c-common.c: Fix comment formatting.
+ * c-common.h: Likewise.
+ * c-decl.c: Likewise.
+ * cppinit.c: Likewise.
+ * cpplib.h: Likewise.
+ * emit-rtl.c: Likewise.
+ * input.h: Likewise.
+ * line-map.h: Likewise.
+ * opts.c: Likewise.
+ * opts.h: Likewise.
+ * simplify-rtx.c: Likewise.
+
+2003-08-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * unwind-c.c: Add libgcc-style exception.
+ * unwind-dw2.c: Likewise.
+ * unwind-pe.h: Likewise.
+ * unwind-sjlj.c: Likewise.
+ * unwind.inc: Likewise.
+
+2003-08-19 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c/5582 PR c++/10538
+ * langhooks-def.h (lhd_decl_uninit): Declare.
+ (LANG_HOOKS_DECL_UNINIT): New macro.
+ (LANG_HOOKS_INITIALIZER): Adjust.
+ * langhooks.h (struct lang_hooks): Add new field
+ decl_uninit.
+ * langhooks.c (lhd_decl_uninit): Define.
+ * c-common.c (c_decl_uninit_1): New function.
+ (c_decl_uninit): New function.
+ (warn_init_self): Define.
+ * c-common.h (c_decl_uninit): Declare.
+ (warn_init_self): Declare.
+ * c.opt: Introduce -Winit-self.
+ * c-opts.c (c_common_handle_options): Set warn_init_self.
+ * c-lang.c (LANG_HOOKS_DECL_UNINIT): Define.
+ * objc/objc-lang.c (LANG_HOOKS_DECL_UNINIT): Define.
+ * function.c (uninitialized_vars_warning): Call the language hook.
+ * doc/invoke.texi: Document -Winit-self.
+
+2003-08-19 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/mips.md: Adjust SI-mode "trap_if" instruction
+ to use better predicates and constraints. Define new
+ instruction to handle "trap_if" with DI-mode arguments.
+ (conditional_trap): FAIL if trap code is not 0.
+
+2003-08-19 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/i386/i386.c (legitimate_pic_address_disp_p): Change the
+ strstr with $pb to a strcompare with "<pic base>"
+ (ix86_output_addr_diff_elt): Output the real pic base.
+
+2003-08-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * langhooks-def.h (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling.
+ (LANG_HOOKS_INITIALIZER): Correct.
+ * c-lang.c: Likewise.
+
+2003-08-19 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_mark_needed_node): Call notice_global_symbol.
+ (cgraph_varpool_mark_needed_node): Likewise.
+ * cgraph.h (notice_global_symbol): Declare
+ * varasm.c (notice_global_symbol): Break out from ...
+ (assemble_start_function): ... here; update for variables.
+ (assemble_variable): Use notice_global_symbol.
+
+2003-08-19 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_va_arg): If EABI_FLOAT_VARARGS_P,
+ expect SFmode and DFmode arguments to be passed in FPRs,
+ regardless of the underlying type.
+
+2003-08-19 Richard Sandiford <rsandifo@redhat.com>
+
+ PR target/11924
+ * config/mips/mips.c (INTERNAL_SYMBOL_P): New macro.
+ (mips_classify_symbol, m16_usym8_4, m16_usym5_4): Use it.
+
+2003-08-18 Matt Kraai <kraai@alumni.cmu.edu>
+
+ PR c/11207
+ * c-typeck.c (set_init_index): Check for negative index.
+
+2003-08-18 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/crti.asm (_init, _fini): Add alternate code for new
+ call0 ABI.
+ * config/xtensa/crtn.asm (_init, _fini): Likewise.
+ * config/xtensa/lib1funcs.asm (__mulsi3, __udivsi3, __divsi3,
+ __umodsi3, __modsi3): Likewise.
+ * config/xtensa/t-xtensa (crti.o, crtn.o): Add $(GCC_CFLAGS) and
+ $(INCLUDES).
+
+2003-08-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.md ("*nabssf2_gpr"): New.
+
+2003-08-18 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md: Quote C code in braces. Remove use of
+ fake const0_rtx operands. Remove double backslashes. Use \;.
+ Remove workarounds for bogus warnings.
+
+2003-08-18 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (muldf3, mulsf3): Don't call a gen_* function.
+ (muldf3_internal, muldf3_r4300): Select based on TARGET_4300_MUL_FIX
+ rather than TARGET_MIPS4300.
+ (mulsf3_internal, mulsf3_r4300): Likewise.
+
+2003-08-18 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md: Renumber unspecs. Clean up comments.
+
+2003-08-17 Roger Sayle <roger@eyesopen.com>
+
+ * simplify-rtx.c (associative_constant_p): New function to test
+ whether an RTX expression is an immediate constant.
+ (simplify_associative_operation): New function to perform some
+ reassociation optimizations of associative binary expressions.
+ (simplify_binary_operation): Use simplify_associative_operation
+ to simplify PLUS, MULT, AND, IOR, XOR, SMIN, SMAX, UMIN and UMAX.
+ Floating point expressions are only reassociated when unsafe
+ math optimizations are permitted.
+
+2003-08-17 Andreas Jaeger <aj@suse.de>
+
+ * config/alpha/alpha.md: Remove usage of PARAMS.
+
+ * config/i386/cygwin.h: Convert K&R prototypes to ISO C90.
+ * config/i386/i386-interix.h: Likewise.
+ * config/i386/winnt.c: Likewise.
+ * config/i386/cygming.h: Likewise.
+ * config/i386/cygwin2.c: Likewise.
+ * config/darwin.c: Likewise.
+ * config/darwin-c.c: Likewise.
+ * config/darwin-protos.h: Likewise.
+ * config/darwin.h: Likewise.
+ * config/s390/s390-protos.h: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/ia64/ia64.c: Likewse
+ * config/ia64/ia64-protos.h: Likewise.
+ * config/ia64/ia64-c.c: Likewise.
+
+2003-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/sparc/sparc.c: Convert to ISO C.
+
+ * config/sparc/sparc-protos.h: Don't use the PARAMS macro.
+ * config/sparc/sparc.c: Likewise.
+
+2003-08-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11512
+ * stmt.c (expand_expr_stmt_value): Don't warn about any void
+ typed expression.
+
+2003-08-16 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_fntype_regparm): Rename from ...
+ (ix86_function_regparm): ... this one; add fastcall and local
+ functions.
+ (ix86_function_ok_for_sibcall): Update.
+ (ix86_return_pops_args): Likewise.
+ (init_cumulative_args): Likewise.
+ (x86_can_output_mi_thunk): Likewise.
+ (function_arg): Fix formating.
+ (x86_this_parameter): Fix fastcall.
+ (x86_output_mi_thunk): Likewise.
+
+ * cgraph.c (cgraph_mark_needed_node): Do not mark functions without
+ body as reachable; mark nested functions as needed too.
+ (dump_cgraph): Do not output global.calls.
+ * cgraph.h (cgraph_global_info): Kill.
+ * cgraphunit.c (cgraph_finalize_function): Enqueue needed functions.
+ (record_call_1): Speedup.
+ (cgraph_analyze_function): Break out from ...; compute inlining
+ parameters.
+ (cgraph_finalize_compilation_unit): ... here.
+ (cgraph_mark_inline): Kill computation of calls.
+ (cgraph_decide_inlining): Do not compute most of initial values.
+
+2003-08-14 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (negate_expr_p): MULT_EXPRs and RDIV_EXPRs are easy
+ to negate if either operand is easy to negate, if we don't care
+ about sign-dependent rounding.
+ (negate_expr): Make the logic to negate a REAL_CST explicit.
+ Attempt to negate a MULT_EXPR or RDIV_EXPR by negating an operand
+ that's easy to negate, if we don't honor sign-dependent rounding.
+ (fold <MULT_EXPR>): Optimize -A * B as A * -B if B is easy to
+ negate, and the symmetric A * -B as -A * B if A is easy to negate.
+ (fold <RDIV_EXPR>): Likewise, optimize -A/B and C/-D as A/-B and
+ -C/D if B and C are cheap to negate. Add an explicit rule to
+ optimize X/-1.0 as -X when we don't care about signaling NaNs.
+
+2003-08-14 Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in (tm_file): Rename tm_include_list.
+ (tm_p_file): Rename tm_p_include_list.
+ (build_xm_file): Rename build_xm_include_list.
+ (host_xm_file): Rename host_xm_include_list.
+ (xm_file): Rename xm_include_list.
+ (xm_file_list): Add to be substituted.
+ (cs-config.h, cs-bconfig.h, cs-tconfig.h, cs-tm.h, cs-tm_p.h):
+ Update to match.
+ (bt-load.o): Add missing dependency on $(TM_H).
+ * configure.in: Prefix value of EXTRA_MODES_FILE with config/.
+ For each of tm_file, tm_p_file, xm_file, host_xm_file, and
+ build_xm_file, generate both *_file_list and *_include_list
+ values from it. (xm_file_list was formerly not being generated.)
+ In *_include_list, prefix the names of all headers found in
+ $(srcdir)/config with config/. In each loop, consider only
+ the special case files that can actually appear in that list.
+ AC_SUBST all *_file_list and all *_include_list variables; do
+ not AC_SUBST the plain *_file variables.
+ * configure: Regenerate.
+
+2003-08-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfg.c (dump_edge_info): Add name of loop_exit edge flag.
+
+2003-08-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (pa_adjust_insn_length): Delete adjustment for delay slot in
+ direct calls.
+ (attr_length_call): Include it here. Improve length estimate for
+ local calls.
+ (output_call): Use targetm.binds_local_p.
+
+2003-08-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (CASE_MATHFN): New helper macro.
+ (mathfn_built_in): Simplify and sort.
+
+ * protoize.c (substr): Delete, callers changed to `strstr'.
+
+2003-08-13 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc (iq2000*-*-elf*): Don't set xm_file.
+ * config/iq2000/xm-iq2000.h: Delete file.
+
+2003-08-13 Geoffrey Keating <geoffk@apple.com>
+
+ * gengtype.c (walk_type): Process a subobject before processing
+ the pointer that points to the subobject.
+
+2003-08-13 Per Bothner <pbothner@apple.com>
+
+ * regclass.c (init_reg_modes): Make non-static.
+ Rename to init_reg_modes_once per new naming convention.
+ (init_regs): Don't call init_reg_modes here.
+ * emit-rtl.c (init_emit_once): Call init_reg_modes_once here instead.
+ * rtl.h (init_reg_modes_once): New declaration.
+ * toplev.c (backend_init): Call init_regs after init_emit_once.
+
+2003-08-13 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/linux.h (DBX_REGISTER_NUMBER): Define so to map a
+ special index for MD_FALLBACK_FRAME_STATE_FOR to itself.
+
+2003-08-13 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (sh_get_pr_initial_val): Always wrap in unspec for TARGET_SH1.
+ * sh.md (load_ra): Change insn predicate to TARGET_SH1.
+
+2003-08-13 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.md (ctrsi, ctrdi): Reenable
+ handling of decrement-and-branch farther than 32 bits.
+
+2003-08-12 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * configure.in (make_compare_target): Move test to ...
+ * aclocal.m4 (gcc_AC_PROG_CMP_IGNORE_INITIAL): here.
+ * configure: Regenerate.
+
+2003-08-12 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/iris6.h: Convert to C90 prototypes.
+ * config/mips/irix6-libc-compat.c: Likewise.
+ * config/mips/mips-protos.h: Likewise.
+ * config/mips/mips.c: Likewise.
+
+2003-08-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ fixinc/inclhack.def (svr4_krnl): Rename from svr4_kernel. Enable
+ for selected machines. Comment heavily.
+ fixinc/fixincl.x: Rebuild.
+ fixinc/tests/base/fs/rfs/rf_cache.h: New file.
+
+2003-08-12 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h: Tweak various comments.
+ * config/mips/mips.c: Likewise.
+
+2003-08-11 James E Wilson <wilson@tuliptree.org>
+
+ PR optimization/11319
+ PR target/10021
+ * alias.c (find_base_value, case REG): Return 0 not src if no base
+ found.
+
+2003-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcse.c (gmalloc): Fix last change.
+
+2003-08-11 Roger Sayle <roger@eyesopen.com>
+
+ * simplify-rtx.c (simplify_binary_operation): Replace calls to
+ gen_rtx_NEG and gen_rtx_NOT with calls to simplify_gen_unary,
+ and calls to gen_rtx_PLUS, gen_rtx_MULT, gen_rtx_LSHIFTRT,
+ gen_rtx_ASHIFT and gen_rtx_AND with calls to simplify_gen_binary.
+
+2003-08-11 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (expand_expr): If an ABS_EXPR has a complex type, abort.
+ * c-typeck.c (build_unary_op): COMPLEX_TYPE is not a valid
+ typecode for an ABS_EXPR.
+
+ * doc/c-tree.texi: Document ABS_EXPR.
+
+2003-08-11 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold): Optimize any associative floating point
+ operator with -funsafe-math-optimizations, not just MULT_EXPR.
+
+2003-08-11 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/lib1funcs.asm (__udivdi3): Add .type and .size
+ information in SHmedia case too.
+ (__divdi3, __umoddi3, __moddi3, __init_trampoline, __ic_invalidate):
+ Likewise.
+ (__set_fpscr): Use an access via GOT for PIC case.
+
+2003-08-11 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * configure.in (intermodule): Make switch test more portable.
+ * configure: Regenerate.
+
+2003-08-11 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * Makefile.in (cleanstrap): Pass BOOT_CFLAGS to bootstrap.
+ (restrap): Likewise.
+
+2003-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcse.c (gmalloc): Argument is a size_t. Add ATTRIBUTE_MALLOC.
+ (grealloc): Size argument is a size_t.
+ (gcalloc): New function. Use throughout in lieu of
+ gmalloc/memset.
+
+ * config/avr/avr.c (avr_init_once): Use xcalloc in lieu of
+ xmalloc/memset.
+ * config/ia64/ia64.c (ia64_reorg): Likewise.
+ * conflict.c (conflict_graph_new): Likewise.
+ * fixinc/fixincl.c (run_compiles): Likewise.
+ * genattrtab.c (optimize_attrs): Likewise.
+ * genrecog.c (new_decision): Likewise.
+ * haifa-sched.c (schedule_block): Likewise.
+ * hashtable.c (ht_create): Likewise.
+
+2003-08-11 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/lib2funcs.S: Fix whitespace.
+ * config/xtensa/xtensa.md (all insns and expanders): Use brace block
+ syntax where appropriate. Remove unnecessary backslash escapes.
+ Reformat comments and fix some code formatting.
+ (extendqisi2): Rearrange conditional.
+ (*btrue, *bfalse, *ubtrue, *ubfalse, *bittrue, *bitfalse, *masktrue,
+ *maskfalse, movsicc_internal0, movsfcc_internal0): Call abort instead
+ of fatal_insn.
+
+2003-08-11 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c: Various formatting fixes.
+ (override_options): Resync -mtune handling with gas.
+ (mips_issue_rate): Rearrange like mips_use_dfa_pipeline_interface.
+ * config/mips/mips.h: More formatting fixes.
+ (mips_abi): Move declaration.
+ * config/mips/mips.md (exception_receiver): Add mode to
+ unspec_volatile.
+
+2003-08-11 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (spe_init_builtins): Handle evsplati and
+ evsplatfi here.
+ (bdesc_1arg): Remove evsplati and evsplatfi.
+
+2003-08-11 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * dwarf2asm.c (dw2_output_indirect_constant_1): Take user_label_prefix
+ into account.
+
+2003-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (expand_builtin_strcat): Optimize constant strings.
+
+2003-08-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * pretty-print.c (pp_base_indent): Rename from pp_indent.
+ * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype.
+ (struct c_pretty_print_info): Add more fields.
+ (pp_c_left_paren): Move to c-pretty-print.c.
+ (pp_c_right_paren): Likewise.
+ (pp_c_left_brace): Likewise.
+ (pp_c_right_brace): Likewise.
+ (pp_c_left_bracket): Likewise.
+ (pp_c_right_bracket): Likewise.
+ (pp_c_declarator): Declare.
+ (pp_c_direct_declarator): Likewise.
+ (pp_c_specifier_qualifier_list): Likewise.
+ (pp_c_type_id): Likewise.
+ * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework..
+ (pp_c_type_qualifier_list): New.
+ (pp_c_pointer): Likewise.
+ (pp_c_parameter_type_list): Likewise.
+ (pp_c_function_definition): Likewise.
+ (pp_c_id_expression): Likewise.
+ (pp_c_simple_type_specifier): Tidy.
+ (pp_c_unary_expression): Likewise.
+ (pp_c_expression): Likewise.
+ (pp_c_pretty_printer_init): Likewise.
+ (pp_c_specifier_qualifier_list): Rework..
+ (pp_c_abstract_declarator): Likewise.
+ (pp_c_postfix_expression): Likewise.
+ (pp_c_primary_expression): Likewise.
+ (pp_c_cast_expression): Likewise.
+ (pp_c_direct_abstract_declarator): Likewise.
+ (pp_c_storage_class_specifier): Likewise.
+ (pp_c_function_specifier): Likewise.
+ (pp_c_declaration_specifiers): Likewise.
+ (pp_c_direct_declarator): Likewise.
+ (pp_c_declarator): Likewise.
+ (pp_c_declaration): Likewise.
+ (pp_c_statement): Likewise.
+ (pp_c_integer_constant): Rename from pp_c_integer_literal.
+ (pp_c_character_constant): Rename from pp_c_character_literal.
+ (pp_c_bool_constant): Rename from pp_c_bool_literal.
+ (pp_c_enumeration_constant): Rename from pp_c_enumerator.
+ (pp_c_floating_constant): Rename from pp_c_real_literal.
+ (pp_c_constant): Rename from pp_c_literal.
+ * c-lang.c: Include diagnostic.h and c-pretty-print.h
+ (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define.
+ (c_initialize_diagnostics): New.
+ * Makefile.in (c-lang.o): Update dependency.
+
+2003-08-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-typeck.c (digest_init): Add conversion for VECTOR_TYPEs.
+
+2003-08-10 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_no_mips16_string): Remove.
+ (override_options): Don't handle -mips16 as part of -mipsN.
+ * config/mips/mips.h (mips_no_mips16_string): Remove declaration.
+ (TARGET_SWITCHES): Add -mips16 and -mno-mips16 entries.
+ (TARGET_OPTIONS): Remove -mno-mips16.
+
+2003-08-10 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (coprocessor_operand): Remove declaration.
+ (coprocessor2_operand): Likewise.
+ * config/mips/mips.c (STAB_CODE_TYPE): Remove.
+ (lookup_name): Remove declaration.
+ (abort_with_insn): Remove. Replace all uses with fatal_insn.
+ (mips16, mips_abicalls): Remove.
+ (mips_char_to_class): Remove initialiser: all entries are NO_REGS.
+ (arith32_operand, large_int, true_reg_or_0_operand): Remove.
+ (coprocessor_operand, coprocessor2_operand): Remove.
+ (override_options): Don't set mips16 or mips_abicalls.
+ (print_operand): Don't expect SIGN_EXTEND operands.
+ (mips_secondary_reload_class): Likewise.
+ (mips_output_conditional_branch): Remove disabled long-branch code.
+ * config/mips/mips.h (call_used_regs): Remove declaration.
+ (may_call_alloca): Likewise.
+ (mips_cpu_attr, mips_abicalls_type, mips_abicalls_attr): Remove.
+ (mips_abicalls, mips16): Remove declarations.
+ (ASM_FINAL_SPEC, LIB_SPEC): Remove.
+ (CC1_SPEC): Remove outdated comment.
+ (MIPS_VERSION, MACHINE_TYPE): Remove.
+ (TARGET_VERSION_INTERNAL, TARGET_VERSION): Remove.
+ (PC_REGNUM, STACK_POINTER_OFFSET): Remove disabled definitions.
+ (STRUCT_VALUE_RETURN_REGNUM, STACK_DYNAMIC_OFFSET): Likewise.
+ (PUSH_ROUNDING): Likewise.
+ (ASSEMBLER_SCRATCH_REGNUM): Remove.
+ * config/mips/mips.md: Replace mips_cpu_attr with mips_tune
+ and mips16 with TARGET_MIPS16.
+
+2003-08-09 Per Bothner <pbothner@apple.com>
+
+ * cppinit.c (cpp_read_main_file): Split out source-independent
+ initialization to separate function ...
+ (cpp_post_options): New function.
+ * cppfiles.c (cpp_stack_file): Rename public name to ...
+ (_cpp_stack_file): New internal function name.
+ * cpplib.h: Update accordingly.
+ * cppinit.c: (cpp_create_reader): Initialize cpp_readers line here.
+ (cpp_read_main_file): Don't initialize line here.
+ * c-opts.c (c_common_post_options): Call cpp_post_options.
+ (c_common_parse_file): Call cpp_read_main_file, not cpp_stack_file.
+ * fix-header.c (read_scan_file): Call cpp_post_options.
+
+2003-08-09 Per Bothner <per@bothner.com>
+
+ * c-decl.c (SCOPE_LIST_APPEND): Remove bogus line continuation.
+
+2003-08-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (pa_asm_output_mi_thunk): Fix typo.
+
+2003-08-09 Neil Booth <neil@daikokuya.co.uk>
+
+ PR preprocessor/11839
+ * cppfiles.c (open_file): Handle ENOTDIR.
+
+2003-08-09 Richard Sandiford <rsandifo@redhat.com>
+
+ PR target/11699
+ * config/mips/mips.c (override_options): Reject -mabi=eabi -mabicalls.
+
+2003-08-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.md (extzv, extv, insv): Fix operand limit checks. Fail if
+ source/destination is not a register operand.
+
+2003-08-08 Richard Henderson <rth@redhat.com>
+
+ PR target/11535
+ * config/ia64/ia64.c (ia64_initial_elimination_offset): Remove
+ RETURN_ADDRESS_POINTER_REGNUM.
+ (ia64_expand_prologue): Don't frob it.
+ (ia64_output_function_epilogue): Likewise.
+ (ia64_return_addr_rtx): New.
+ (ia64_split_return_addr_rtx): New.
+ * config/ia64/ia64-protos.h: Update.
+ * config/ia64/ia64.h (FIRST_PSEUDO_REGISTER): Decrement.
+ (RETURN_ADDRESS_POINTER_REGNUM): Remove.
+ (GENERAL_REGNO_P): Don't check it.
+ (AR_*_REGNUM): Renumber.
+ (FIXED_REGISTERS): Remove RETURN_ADDRESS_POINTER_REGNUM.
+ (CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Likewise.
+ (REG_ALLOC_ORDER, REG_CLASS_CONTENTS): Likewise.
+ (ELIMINABLE_REGS, REGISTER_NAMES): Likewise.
+ (RETURN_ADDR_RTX): Use ia64_return_addr_rtx.
+ * config/ia64/ia64.md (UNSPEC_RET_ADDR): New.
+ (movdi_ret_addr): New.
+
+2003-08-08 Geoffrey Keating <geoffk@apple.com>
+
+ * config.gcc (powerpc-*-darwin*): Don't build a soft-float multilib.
+
+2003-08-08 Roger Sayle <roger@eyesopen.com>
+
+ * tree.h (get_identifier) Define a macro form of get_identifier
+ that calls get_identifier_with_length when the string is constant.
+ (get_identifier_with_length): Change type of second argument to
+ size_t in prototype.
+ * stringpool.c (get_identifier): Undefine the macro before giving
+ the function definition.
+ (get_identifier_with_length): Change type of second argument to
+ size_t in function definition.
+ * hashtable.c (calc_hash): Change type of second argument to size_t.
+ (ht_lookup): Change type of third argument to size_t. Reorganize
+ to speed-up the cases where the hash table slot is empty, or the
+ first probe matches (i.e. there isn't a collision).
+ * hashtable.h (ht_lookup): Adjust function prototype.
+
+2003-08-08 Bernardo Innocenti <bernie@develer.com>
+
+ PR target/9697
+ PR target/11777
+ * longlong.h (count_leading_zeros): Exclude on __mcpu32__.
+
+2003-08-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * common.opt: Add debug switches.
+ * flags.h (use_gnu_debug_info_extensions): Boolify.
+ * opts.c (write_symbols, debug_info_level,
+ use_gnu_debug_info_extensions): Move from toplev.c.
+ (set_debug_level): New.
+ (common_handle_options): Handle debug switches.
+ (print_help): Display target options directly.
+ * toplev.c (debug_hooks): Don't initialize.
+ (write_symbols, debug_info_level,
+ use_gnu_debug_info_extensions): Move to opts.c.
+ (debug_args, display_help, decode_g_option): Remove.
+ (process_options): Set no debug if level zero here,
+ and no-debug-hooks. Error here if impossible debug format selected.
+ * toplev.h (display_help, decode_g_option): Remove.
+
+2003-08-08 Richard Sandiford <rsandifo@redhat.com>
+
+ * tree.c (get_file_function_name_long): Fix size of alloca() area.
+
+2003-08-08 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * configure.in (gcc_cv_prog_cmp_skip): Flipflop make_compare_target
+ and gcc_cv_prog_cmp_skip.
+ * configure: Regenerate.
+
+2003-08-08 Stan Cox <scox@redhat.com>
+
+ * config/iq2000: New port.
+ * config.gcc (iq2000-*-elf): Added.
+ * doc/install.texi (Specific): Add iq2000 description.
+
+2003-08-08 Andreas Schwab <schwab@suse.de>
+
+ * configure.in (gcc_cv_as_ia64_ltoffx_ldxmov_relocs): Fix quoting
+ and insert missing empty argument.
+ * configure: Regenerate.
+
+2003-08-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (update_total_code_bytes): Use new macro IN_NAMED_SECTION_P.
+ (attr_length_millicode_call): Likewise.
+ (attr_length_call): Likewise. Revise some maximum insn lengths.
+ (attr_length_indirect_call): Likewise.
+ (output_call): Fix thinko that added extra nop.
+ * pa.h (IN_NAMED_SECTION_P): Define.
+
+ PR c++/11712
+ * pa-hpux.h, pa-hpux10.h, pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define
+ __STDC_EXT__ when using C++ dialect.
+
+2003-08-07 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (calc_live_regs): If the return address pointer is live,
+ force pr live.
+ (sh5_schedule_saves): Exclude PR_MEDIA_REG from being a temp register
+ for saves / restores.
+ (sh_expand_epilogue): If sh_media_register_for_return returns a
+ register number, flag the instructions that restores PR_MEDIA_REG
+ as possibly dead.
+ Remove dead update of offset.
+ (sh_get_pr_initial_val): Use UNSPEC_RA if we don't know yet if
+ we can use the result of get_hard_reg_initial_val.
+ * sh.md (UNSPEC_RA): New constant.
+ (movsi_i_lowpart+1): Changed into a define_insn_and_split, named:
+ (load_ra). Handle UNSPEC_RA.
+ (sibcall_media): Use PR_MEDIA_REG.
+
+ * sh.h (CALL_USED_REGISTERS): Include PR_REG and PR_MEDIA_REG.
+ * sh.c (calc_live_regs): Use sh_pr_n_sets to determine if pr
+ needs saving on SHmedia.
+
+2003-08-07 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md: Replace all occurrences of \\t with \t.
+
+2003-08-07 Richard Sandiford <rsandifo@redhat.com>
+
+ * local-alloc.c (combine_regs): Fix comment typo.
+
+2003-08-06 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (builtin_decls): Replace with first_builtin_decl
+ and last_builtin_decl.
+ (c_init_decl_processing): Initialize both.
+ (c_reset_state): Iterate from first_builtin_decl to
+ last_builtin_decl inclusive to reintroduce builtins.
+
+2003-08-06 David Mosberger <davidm@hpl.hp.com>
+
+ * doc/extend.texi (Function Attributes): Document the IA-64 version
+ of the "model" attribute.
+
+ * config/ia64/ia64.h (SYMBOL_FLAG_SMALL_ADDR): New macro.
+ (SYMBOL_REF_SMALL_ADDR_P): Ditto.
+ (PREDICATE_CODES): Mention "small_addr_symbolic_operand".
+
+ * config/ia64/ia64.c (ia64_handle_model_attribute): New function.
+ (ia64_encode_section_info): Likewise.
+ (ia64_attribute_table): Add "model" attribute.
+ (TARGET_ENCODE_SECTION_INFO): Define.
+ (small_addr_symbolic_operand): New function.
+ (got_symbolic_operand): Return 0 for a symbolref to an object
+ in the small address area.
+ (enum ia64_addr_area): New type.
+ (small_ident1): New variable.
+ (small_ident2): Likewise.
+ (init_idents): New function.
+ (ia64_get_addr_area): Likewise.
+ (ia64_encode_addr_area): Likewise.
+ (ia64_encode_section_info): Likewise.
+ (ia64_expand_load_address): For symbolic references to objects in
+ the small-address-area, load the address via gen_rtx_SET() (which,
+ eventually, will expand into "addl").
+
+2003-08-06 Per Bothner <pbothner@apple.com>
+
+ * line-map.h (fileline): New typedef.
+ (struct line_map, linemap_add, linemap_lookup): Use it.
+ * input.h (struct location_s): Comment notes that long-term we want
+ to replace it by fileline.
+
+2003-08-06 J"orn Rennecke <joern.rennecke@superh.com>
+
+ Fix SHcompact exception handling:
+ * sh.c (sh_get_pr_initial_val): If PR is or miight be clobbered
+ by the prologue, return a MEM with return_address_pointer_rtx
+ as address.
+ * sh.h (HARD_REGNO_MODE_OK): PR is OK for SImode.
+ (RETURN_ADDR_OFFSET): Don't define.
+ (SH_DBX_REGISTER_NUMBER): Use SHmedia numbers for SHmedia
+ registers that are visible in compact mode. Show that SHmedia
+ registers still exist in compact mode, even if there are not
+ readily accessible.
+ (ASM_PREFERRED_EH_DATA_FORMAT): Supply DW_EH_PE_indirect
+ if GLOBAL. Use DW_EH_PE_textrel (nominally) for CODE,
+ and DW_EH_PE_pcrel for pic data.
+ (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): If DW_EH_PE_textrel,
+ set SYMBOL_FLAG_FUNCTION in symbol, and actually use
+ DW_EH_PE_pcrel / DW_EH_PE_absptr encoding.
+ (ALLOCATE_INITIAL_VALUE): Put PR on stack if prologue clobbers it.
+ * sh.md (movsi_media-1): New splitter.
+
+2003-08-06 Graeme Peterson <gp@qnx.com>
+
+ * config/i386/nto.h: New.
+ * config/i386/t-nto: New.
+ * config.gcc (i[34567]86-*-nto-qnx*): New.
+
+2003-08-06 Phil Edwards <pme@gcc.gnu.org>
+
+ * doc/install.texi (*-*-solaris2*): Refine configure instructions.
+
+2003-08-06 Alan Modra <amodra@bigpond.net.au>
+
+ * calls.c (load_register_parameters): Arrange for call_fusage to
+ report the whole register as used when shifting to the msb.
+
+2003-08-05 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin): When not optimizing, call the library
+ function for all builtins that have library functions (except alloca).
+
+2003-08-05 Alexandre Oliva <aoliva@redhat.com>
+
+ * c.opt: Introduce -fworking-directory.
+ * doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it.
+ * c-common.h (flag_working_directory): Declare.
+ * c-common.c (flag_working_directory): Define.
+ * c-opts.c (c_common_handle_options): Set it.
+ (sanitize_cpp_opts): Set...
+ * cpplib.h (struct cpp_options): ... working_directory option.
+ (struct cpp_callbacks): Add dir_change.
+ * cppinit.c (read_original_filename): Call...
+ (read_original_directory): New. Look for # 1 "directory//"
+ and process it.
+ (cpp_read_main_file): Call dir_change callback if working_directory
+ option is set.
+ * gcc.c (cpp_unique_options): Pass -g*.
+ * c-lex.c (cb_dir_change): New.
+ (init_c_lex): Set dir_change callback.
+ * toplev.c (src_pwd): New static variable.
+ (set_src_pwd, get_src_pwd): New functions.
+ * toplev.h (get_src_pwd, set_src_pwd): Declare.
+ * dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd().
+ * dwarf2out.c (gen_compile_unit_die): Likewise.
+ * dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise.
+
+2003-08-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * pretty-print.h (pp_set_line_maximum_length): Make macro.
+ (pp_set_prefix): Likewise.
+ (pp_destroy_prefix): Likewise.
+ (pp_remaining_character_count_for_line): Likewise.
+ (pp_clear_output_area): Likewise.
+ (pp_formatted_text): Likewise.
+ (pp_last_position_in_text): Likewise.
+ (pp_emit_prefix): Likewise.
+ (pp_append_text): Likewise.
+ (pp_flush): Likewise.
+ (pp_format_text): Likewise.
+ (pp_format_verbatim): Likewise.
+ (pp_tree_identifier): Tidy.
+ * pretty-print.c (pp_base_format_text): Rename from pp_format_text.
+ (pp_base_format_verbatim): Rename from pp_format_verbatim.
+ (pp_base_flush): Rename from pp_flush.
+ (pp_base_set_line_maximum_length): Rename from
+ pp_set_line_maximum_length.
+ (pp_base_clear_output_area): Rename from pp_clear_output_area.
+ (pp_base_set_prefix): Rename from pp_set_prefix.
+ (pp_base_destroy_prefix): Rename from pp_destroy_prefix.
+ (pp_base_emit_prefix): Rename from pp_emit_prefix.
+ (pp_base_append_text): Rename from pp_append_text.
+ (pp_base_formatted_text): Rename from pp_formatted_text.
+ (pp_base_last_position_in_text): Rename from pp_last_position_in_text.
+ (pp_base_remaining_character_count_for_line): Rename from
+ pp_remaining_character_count_for_line.
+ * diagnostic.h (diagnostic_format_decoder): Tidy.
+ (diagnostic_flush_buffer): Likewise.
+ * c-pretty-print.h: (pp_c_string_literal): Declare.
+ (pp_c_real_literal): Likewise.
+ (pp_c_integer_literal): Likewise.
+ * c-pretty-print.c (pp_c_char): Use pp_string in lieu of
+ pp_identifier.
+ (pp_c_character_literal): Tidy.
+ (pp_c_string_literal): Make public.
+ (pp_c_bool_literal): Likewise.
+ (pp_c_integer_literal): Likewise.
+ (pp_c_real_literal): Likewise.
+
+ * Makefile.in (C_PRETTY_PRINT_H): New variable.
+ (c-pretty-print.o): Update dependence.
+
+2003-08-05 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/mips.md (fix_truncdfsi2_macro): Properly restore
+ ".set nomacro" state.
+ (fix_truncsfsi2_macro): Likewise.
+
+2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
+
+ * tree.h (DID_INLINE_FUNC): Remove macro.
+ (DECL_DECLARED_INLINE_P): Move from c-tree.h and cp/cp-tree.h,
+ add tree check for FUNCTION_DECL.
+ (DECL_ESTIMATED_INSNS): Move from c-common.h and java/java-tree.h.
+ (struct tree_decl): Rename inlined_function_flag to
+ declared_inline_flag.
+ * c-common.h (c_lang_decl): Remove.
+ (DECL_ESTIMATED_INSNS): Remove.
+ * c-tree.h (struct lang_decl): Don't include c_lang_decl.
+ (DECL_DECLARED_INLINE_P): Remove.
+ * c-decl.c (grokdeclarator): Update comment. With -finline-functions,
+ do not reset DECL_DECLARED_INLINE_P. Don't use DID_INLINE_FUNC.
+ (finish_function): Make uninlinable a bool. Fixup call to
+ tree_inlinable_function_p() and fix some code style issues.
+ * cgraph.h (disgread_inline_limits): Fix spelling: `disregard'.
+ * cgraph.c (dump_cgraph): Likewise.
+ * cgraphunit.c (cgraph_decide_inlining): Likewise
+ (cgraph_finalize_compilation_unit): Likewise.
+ Also update call to tree_inlinable_function_p().
+ (cgraph_default_inline_p): Don't use DID_INLINE_FUNC. Instead
+ look at DECL_DECLARED_INLINE and reverse logic.
+ * print-tree.c (print_node): Likewise.
+ * toplev.c (rest_of_handle_inlining): Don't use DID_INLINE_FUNC.
+ * tree-inline.h (tree_inlinable_function_p): Make a bool. Update
+ prototype.
+ * tree-inline.c (inlinable_function_p): Split up in this function to
+ check for basic inlining inhibiting conditions, and new
+ limits_allow_inlining() function. Warn if inlining is impossible
+ because the inline candidate calls alloca or uses sjlj exceptions.
+ (limits_allow_inlining): this new function to check if the inlining
+ limits are satisfied. Throttle from currfn_max_inline_insns, not from
+ MAX_INLINE_INSNS_SINGLE. The latter only makes sense if
+ MAX_INLINE_INSNS_AUTO and MAX_INLINE_INSNS_SINGLE are equal.
+ Update prototypes.
+ (tree_inlinable_function_p): Make a bool. Update call to
+ inlinable_function_p
+ (expand_call_inline): Use limits_allow_inlining() when not in
+ unit-at-a-time mode to decide on inlining. Don't use DID_INLINE_FUNC,
+ instead see if the function was declared `inline'.
+
+2003-08-05 Josef Zlomek <zlomekj@suse.cz>
+
+ * gcse.c (try_replace_reg): Fix updating of note.
+
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/11771
+ * fold-const.c (negate_expr_p <MINUS_EXPR>): Change to match the
+ logic in negate_expr, i.e. we don't invert (A-B) for floating
+ point types unless flag_unsafe_math_optimizations.
+
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold <PLUS_EXPR>): Transform x+x into x*2.0.
+ Optimize x*c+x and x+x*c into x*(c+1) and x*c1+x*c2 into x*(c1+c2)
+ for floating point expressions with -ffast-math.
+ (fold <MULT_EXPR>): Don't transform x*2.0 into x+x.
+ * expmed.c (expand_mult): Wrap long line. Expand x*2.0 as x+x.
+
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ * c-common.c (flag_noniso_default_format_attributes): Delete.
+ (built_in_attribute): Don't define/undefine DEF_FN_ATTR.
+ (c_attrs_initialized): Delete.
+ (c_common_nodes_and_builtins): Don't test c_attrs_initialized,
+ always call c_init_attributes.
+ (c_init_attributes): Don't define/undefine DEF_FN_ATTR. Don't
+ set c_attrs_initialized when done.
+ (c_common_insert_default_attributes): Delete.
+ * c-common.h (flag_noniso_default_format_attributes): Delete.
+ (c_coomon_insert_default_attributes): Delete prototype.
+ * c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set
+ flag_noniso_default_format_attributes.
+
+ * c-decl.c (c_insert_default_attributes): Delete.
+ * c-tree.h (c_insert_default_attributes): Delete prototype.
+
+ * attribs.c (decl_attributes): Don't call insert_default_attributes
+ langhook. Update function description comment.
+ * langhooks.h (lang_hooks): Remove insert_default_attributes field.
+ * langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete.
+ * c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
+ * system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro.
+
+ * objc/objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't
+ define.
+
+2003-08-04 Richard Sandiford <rsandif@redhat.com>
+
+ * config/mips/mips.c (override_options): Disable -G on targets that
+ have no .section support.
+ (mips_select_section): Use default_select_section for such targets.
+
+2003-08-04 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (svr4_undeclared_getrnge): Introduce and enable.
+ * fixinc/inclhack.def (static_getrnge): Remove disabled hack.
+ * fixinc/fixincl.x: Rebuild.
+ * fixinc/tests/base/regexp.h: New test.
+
+2003-08-04 Alexandre Oliva <aoliva@redhat.com>
+
+ * c-ppoutput.c (cb_line_change): Don't skip line changing while
+ parsing macro arguments in the top-level context.
+
+2003-08-04 Neil Booth <neil@daikokuya.co.uk>
+
+ * config.in: Remove HAVE_LSTAT.
+ * configure, configure.in: Don't test for lstat.
+
+2003-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * opts.c (decode_options): Do language-specific initialization for
+ the global diagnostic context.
+ * langhooks-def.h (lhd_initialize_diagnostics): Declare.
+ (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): New macro.
+ (LANG_HOOKS_INITIALIZER): Adjust.
+ * langhooks.h (struct lang_hooks): Add new field
+ initialize_diagnostics.
+ * langhooks.c (lhd_initialize_diagnostics): Define.
+
+2003-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * pretty-print.h: Adjust macro definitions.
+ * pretty-print.c (pp_newline): Rename to pp_base_newline.
+ (pp_character): Rename to pp_base_character.
+ (pp_string): Rename to pp_base_string.
+ * c-pretty-print.c (pp_buffer): Move to pretty-print.h
+ (pp_newline): Likewise. Adjust.
+ (pp_c_char): Adjust.
+
+2003-08-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def (BUILT_IN_ABS, BUILT_IN_IMAXABS, BUILT_IN_LABS,
+ BUILT_IN_LLABS): Move to miscellaneous section.
+
+2003-08-03 Neil Booth <neil@daikokuya.co.uk>
+
+ PR preprocessor/11534
+ * cppexp.c (parse_defined): Warn only if -pedantic.
+
+2003-08-03 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppfiles.c (stack_file): Use file path.
+
+2003-08-02 Roger Sayle <roger@eyesopen.com>
+
+ * builtin-types.def (BT_SSIZE): New primitive type.
+ (BT_FN_INT_PTR_CONST_STRING_VALIST_ARG,
+ BT_FN_STRING_CONST_STRING_CONST_STRING_INT,
+ BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR,
+ BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR): New function types.
+ * builtins.def (BUILT_IN_DCGETTEXT, BUILT_IN_DGETTEXT,
+ BUILT_IN_FSCANF, BUILT_IN_GETTEXT, BUILT_IN_STRFMON,
+ BUILT_IN_STRFTIME, BUILT_IN_VFPRINTF, BUILT_IN_VFSCANF): New builtins.
+ * builtin-attrs.def: Remove DEF_FN_ATTR construct and the last
+ few functions that define default attributes using it.
+ * c-common.c (c_common_insert_default_attributes): Do nothing.
+
+ * doc/extend.texi: Document these "new" builtins.
+
+2003-08-02 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/linux.h (SUBTARGET_LINK_SPEC): Don't set rpath.
+ (LIB_SPEC): Set -lpthread always when -pthread set. Set -lieee
+ when -mieee-fp set and -shared not set.
+ (SH_FALLBACK_FRAME_FLOAT_STATE): Don't define for SH5.
+
+2003-08-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppfiles.c (struct _cpp_file): Rename once_only_next to
+ next_file. Remove import and pragma_once, add once_only.
+ (find_file): Add new file structures to the all_files list.
+ (should_stack_file): Mark #import-ed files once-only, and
+ don't stack them if the file has already been stacked.
+ (_cp_mark_file_once_only): Simplify.
+ * cpphash.h (struct cpp_reader): Rename once_only_files
+ to all_files. Rename saw_pragma_once to seen_once_only.
+ (_cpp_mark_file_once_only): Update prototype.
+ * cpplib.c (do_pragma_once): Update.
+
+2003-08-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppfiles.c (ENOTDIR): Remove.
+ (open_file_in_dir): Rename find_file_in_dir. Handle errors
+ other than ENOENT here.
+ (once_only_file_p): Rename should_stack_file.
+ (find_file, open_file_failed, read_file_guts): Report errors
+ with full path name.
+ (read_file): Move pch handling to should_stack_file.
+ (should_stack_file): Handle PCH and once-only issues, and
+ reading the file.
+ (stack_file): Don't do file reads.
+
+2003-08-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * libgcov.c (gcov_exit): Cleanup and fix.
+ * profile.c (compute_value_histograms): Don't try to read profiles
+ that are not present.
+
+2003-08-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def: Categorize.
+
+ * builtins.def (BUILT_IN_CABS, BUILT_IN_CABSF, BUILT_IN_CABSL):
+ Mind fp rounding.
+ (BUILT_IN_FFSL): Use DEF_EXT_LIB_BUILTIN.
+
+2003-08-02 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * config.gcc: Enable posix threads by default on darwin.
+
+2003-08-01 Jakub Jelinek <jakub@redhat.com>
+
+ * cfgcleanup.c (outgoing_edges_match): Check REG_EH_REGION notes
+ even if nehedges1 is 0.
+
+2003-08-01 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/fixfixes.c, fixinc/fixlib.c, fixinc/fixlib.h,
+ fixinc/fixtests.c, fixinc/procopen.c, fixinc/server.c,
+ fixinc/server.h, fixinc/fixincl.c: ANSIfy function prototypes
+ and defintions.
+
+ * fixinc/inclhack.def (broken_cabs): Make matching more generous.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/tests/base/math.h: Regenerate to match test_text change.
+
+2003-08-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ggc-common.c (gt_pch_restore): Case MAP_FAILED to void *.
+
+2003-08-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * except.c (sjlj_emit_dispatch_table): Use ptr_mode, not Pmode,
+ for accesses to exc_ptr.
+
+2003-08-01 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/sourcebuild.texi (Front End Directory): Don't make references
+ to libsubdir, it's not part of the interface to frontends.
+ * doc/install.texi (Configuration): Help users read faster by saying
+ that GCC's configure options are the standard autoconf ones.
+ Mention --libdir. Update the default rules for finding the
+ assembler. Don't use libsubdir since we haven't said what it means.
+ (Specific): In the Solaris 7 notes, update the place to put the
+ assembler.
+ * doc/invoke.texi: Update lib/gcc-lib to lib/gcc.
+ * doc/cpp.texi (Search Path): Actually, the search path
+ depends on libdir, which can relocate with cpp.
+ * doc/tm.texi (Driver): Don't document STANDARD_EXEC_PREFIX, it's
+ now a private interface between the Makefile and the driver.
+
+2003-08-01 Richard Henderson <rth@redhat.com>
+
+ * system.h: Poison ASM_SIMPLIFY_DWARF_ADDR.
+
+ * varasm.c (lookup_constant_def): New function.
+ * rtl.h (lookup_constant_def): Declare it.
+ * dwarf2out.c (loc_descriptor_from_tree): Use it.
+ Use targetm.delegitimize_address, not ASM_SIMPLIFY_DWARF_ADDR.
+
+2003-08-01 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (gettags, pushdecl_function_level): Delete.
+ (last_function_parm_vars): Rename last_function_parm_others.
+ (current_function_parm_vars): Rename current_function_parm_others.
+ (struct c_scope): Rewrite comment explaining this data structure.
+ Add names_last, blocks_last, parms_last fields. Rename
+ incomplete_list to incomplete.
+ (SCOPE_LIST_APPEND, SCOPE_LIST_CONCAT): New macros.
+ (poplevel): Ignore second argument. No need to nreverse
+ anything. Restructure such that each list is processed
+ exactly once. Use 'const location_t *locus' syntactic sugar
+ variable where useful. Issue unused variable warnings
+ ourselves, do not rely on function.c.
+ (insert_block, pushdecl, bind_label): Use SCOPE_LIST_APPEND.
+ (pushdecl_top_level): Likewise. Don't call duplicate_decls.
+ (implicitly_declare): decl cannot be error_mark_node.
+ (undeclared_variable): Manipulate scope structure directly.
+ (c_make_fname_decl): Likewise.
+ (getdecls, c_init_decl_processing): Fix comment.
+ (mark_forward_parm_decls): Use SCOPE_LIST_CONCAT. No need
+ for 'last' variable.
+ (grokparms): No need to nreverse parms list.
+ (store_parm_decls_newstyle): Set up the parms_last and
+ names_last fields of the new scope too.
+ (store_parm_decls_oldstyle): Can assume DECL_WEAK is not set
+ on parms to begin with; check this under ENABLE_CHECKING. Set
+ up parms_last.
+ (check_for_loop_decls): Refer directly to current_scope->tags.
+ Use consistent quote style in diagnostics.
+ (c_write_global_declarations): The names list is not backward.
+
+ * c-common.h: Don't prototype gettags.
+ * c-parse.in: Call poplevel with second argument 0 always.
+
+2003-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def: Resort builtins.
+
+2003-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def (DEF_GCC_BUILTIN, DEF_LIB_BUILTIN,
+ DEF_EXT_LIB_BUILTIN, DEF_C99_BUILTIN, DEF_C99_C90RES_BUILTIN):
+ Prepend "__builtin_" onto NAME with string concatenation. Remove
+ explicit "__builtin_" from each macro call.
+
+ Reformat entire file.
+
+2003-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.def (ATTR_MATHFN_ERRNO, ATTR_MATHFN_FPROUNDING,
+ ATTR_MATHFN_FPROUNDING_ERRNO): New macros. Use throughout.
+
+2003-08-01 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.c (s390_select_ccmode): Do not attempt to use CCL,
+ CCL1, or CCL2 modes with floating point operations.
+
+ * config/s390/s390.md ("*addsf3_cc", "*addsf3_cconly", "*adddf3_cc",
+ "*adddf3_cconly", "*subsf3_cc", "*subsf3_cconly", "*subdf3_cc",
+ "*subdf3_cconly"): New insns.
+ ("*negabssi2", "*negabsdi2", "*negabsdf2", "*negabssf2"): Likewise.
+
+2003-08-01 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Refine dependencies.
+ * c-opts.c (c_common_handle_option): Do nothing for -Wimport.
+ * c.opt: Update help for -Wimport.
+ * cppfiles.c: Include hashtab.h. Update comments.
+ (stack_file): Read the file before updating dependencies.
+ (once_only_file_p): Be smarter about marking once-only files.
+ (_cpp_mark_file_once_only): Correct the check for existence on
+ the list.
+ (open_file_failed): Use name not path, which is NULL.
+ * cpphash.h: Don't include hashtab.h.
+ (struct _cpp_file): Remove.
+ (struct cpp_reader): Update.
+ * cppinit.c (cpp_create_reader): Don't initialize warn_import.
+ * cpplib.h (struct cpp_options): Remove warn_import.
+ (cpp_simplify_path): Remove.
+
+2003-08-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11295
+ * doc/extend.texi (Statement Expressions): Document C++ semantics.
+
+2003-07-31 SUGIOKA Toshinobu <sugioka@itonet.co.jp>
+
+ * config.gcc (sh-*-linux*): Do not override sh/t-linux with sh/t-le.
+
+2003-07-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-types.def: Use `LONGDOUBLE' instead of `LONG_DOUBLE'
+ throughout.
+ * builtins.def: Likewise.
+
+2003-07-31 Jason Merrill <jason@redhat.com>
+
+ * Makefile.in (bubblestrap): Don't require a previous full
+ bootstrap.
+
+ * expr.c (mostly_zeros_p): No longer static.
+ * tree.h: Declare it.
+ * stmt.c (resolve_asm_operand_names): Don't copy the pattern
+ unless we need to do substitutions.
+
+2003-07-31 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold <MULT_EXPR>): Optimize both x*pow(x,c) and
+ pow(x,c)*x as pow(x,c+1) for constant values c. Optimize x*x
+ as pow(x,2.0) when the latter will be expanded back into x*x.
+ (fold <RDIV_EXPR>): Optimize pow(x,c)/x as pow(x,c-1).
+ * builtins.c (expand_builtin_pow): Ignore flag_errno_math as
+ pow can never set errno when used with an integer exponent.
+ Always use expand_powi when exponent is -1, 0, 1 or 2.
+ (fold_builtin): Don't rewrite pow(x,2.0) as x*x nor pow(x,-2.0)
+ as 1.0/(x*x). This avoids unbounded recursion as we now prefer
+ the pow forms of these expressions.
+
+2003-07-31 Geoffrey Keating <geoffk@apple.com>
+
+ * Makefile.in (libexecdir): New.
+ (libsubdir): Use gcc instead of gcc-lib.
+ (libexecsubdir): New.
+ (ORDINARY_FLAGS_TO_PASS): Add libexecsubdir.
+ (DRIVER_DEFINES): Add STANDARD_LIBEXEC_PREFIX, use gcc instead of
+ gcc-lib.
+ (installdirs): Make libexecsubdir.
+ (install-common): Put executables in libexecsubdir.
+ (itoolsdir): Use libexecsubdir.
+ (itoolsdatadir): New.
+ (install-mkheaders): Separate data files and executables.
+ (install-collect2): Put executables in libexecsubdir.
+ (uninstall): Remove libexecsubdir.
+ * mkheaders.in: Update for new arrangement of files.
+ (libexecdir): New.
+ (libexecsubdir): New.
+ (itoolsdir): Use libexecsubdir.
+ (itoolsdatadir): New.
+ * gcc.c (gcc_libexec_prefix): New.
+ (STANDARD_LIBEXEC_PREFIX): Use gcc instead of gcc-lib.
+ (standard_exec_prefix_1): Use libexec.
+ (standard_exec_prefix_2): New.
+ (standard_libexec_prefix): New.
+ (process_command): Update for new arrangement of files. Compute
+ gcc_libexec_prefix. Update for change from gcc-lib to gcc.
+
+2003-07-31 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * inclhack.def (stdio_va_list): Avoid bogus replacement which
+ triggers on Interix.
+ * fixincl.x: Regenerate.
+
+2003-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (legitimate_pic_address_disp_p): Disallow TLS
+ SYMBOL_REFs not inside UNSPEC even in PLUS rtx.
+
+2003-07-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * dwarf2out.c (loc_descriptor_from_tree, case CONSTRUCTOR): New case.
+
+2003-07-31 Per Bothner <pbothner@apple.com>
+
+ * opts.c (in_fnames, num_in_fnames): Moved here from c-opts.
+ (add_input_filename): New function.
+ (handle_options): Call add_input_filename directly instead of
+ with a lang hook.
+ * opts.h (in_fnames, num_in_fnames): Moved here.
+ (add_input_filename): Declare.
+ * c-decl.c: Need to #include opts.h.
+ * Makefile.in (c-decl.o): Also depends on opts.h.
+ * c-opts.c (in_fnames, num_in_fnames): Moved to opts.c.
+ (c_common_handle_filename): Replaced by add_input_filename.
+ * c-common.h (in_fnames, num_in_fnames, c_common_handle_filename):
+ Remove.
+ * langhooks.h (struct lang_hooks): Remove handle_filename hook.
+ * langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME): Remove macro.
+ (LANG_HOOKS_INITIALIZER): Remove use of LANG_HOOKS_HANDLE_FILENAME.
+ * c-lang.c (LANG_HOOKS_HANDLE_FILENAME): Remove macro.
+
+2003-07-31 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * combine.c (try_combine): Set JUMP_LABEL for newly created
+ unconditional jump.
+
+2003-07-31 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * fold-const.c (fold): Fold some comparisons of bit operations.
+
+2003-07-31 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (create_edge): Fix typo.
+ * i386.c (pic_symbolic_operand): Reorder tests.
+
+2003-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * doc/gcov.texi (Invoking Gcov): Describe output name mangling
+ more fully.
+ (Gcov Data Files): Update.
+
+2003-07-31 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config.gcc (alpha*-dec-osf[45]*): Enable POSIX thread support by
+ default.
+
+ * gthr-posix.c: New file.
+ * gthr-posix.h: Define _REENTRANT if missing.
+ Make _LIBOBJC #pragma weak visible with _LIBOBJC_WEAK.
+
+ * config/alpha/t-osf4 (SHLIB_LINK): Hide dummy functions provided
+ by gthr-posix.o.
+ * config/alpha/t-osf-pthread: New file.
+
+ * fixinc/inclhack.def (alpha_pthread): New fix.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/tests/base/pthread.h [ALPHA_PTHREAD_CHECK]: New testcase.
+
+ * doc/install.texi (alpha*-dec-osf*): Remove --enable-threads
+ warning.
+ Fixes PR bootstrap/9330.
+
+2003-07-31 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (gcc_cv_ld_hidden): Also disable on mips-sgi-irix5*
+ without GNU ld.
+ Update comment.
+ * configure: Regenerate.
+
+2003-07-31 Vladimir Makarov <vmakarov@redhat.com>
+
+ * sched-deps.c (sched_analyze_2): Prevent interblock move of CC0
+ setter.
+
+2003-07-30 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def: Alphabetize.
+
+2003-07-30 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * doc/c-tree.texi: Normalize spellings of "lowercase" and
+ "uppercase".
+ * doc/cpp.texi: Likewise.
+ * doc/md.texi: Likewise.
+ * doc/rtl.texi: Likewise.
+ * doc/tm.texi: Likewise.
+
+2003-07-30 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * objc/Make-lang.in (objc.stage1, objc.stage2, objc.stage3)
+ (objc.stage4, objc.stageprofile, objc.stagefeedback): Remove moves
+ of cc1obj.
+
+2003-07-30 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/mips.h (SIZE_TYPE, PTRDIFF_TYPE): Undef these
+ macros before defining them.
+
+2003-07-31 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md (UNSPEC_ROUND, UNSPEC_SETHIGH,
+ UNSPECV_BLOCKAGE): New constants.
+ ("*sethighqisi", "*sethighhisi", "*sethiqidi_64", "*sethiqidi_31",
+ "*extractqi", "*extracthi", "*extendqidi2" splitter, "*extendqisi2"
+ splitter, "fix_truncdfdi2_ieee", "fix_truncdfsi2_ieee",
+ "fix_truncsfdi2", "fix_truncsfsi2", "blockage"): Use them.
+
+ (all insns and expanders): Write output control string as brace block
+ where appropriate. Remove \-escapes for doublequote characters.
+
+2003-07-31 Jan Hubicka <jh@suse.cz>
+
+ * gcse.c (insert_store): Fix typo in previous patch.
+
+2003-07-30 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppfiles.c (stack_file, open_file_failed): Use path for deps.
+
+2003-07-30 Andi Kleen <ak@muc.de>
+
+ * loop.c (check_dbra_loop): Allow LTU in the loop condition.
+
+2003-07-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * combine.c (distribute_notes): Cancel REG_VALUE_PROFILE notes.
+ * gcov-io.h (GCOV_FIRST_VALUE_COUNTER, GCOV_LAST_VALUE_COUNTER,
+ GCOV_N_VALUE_COUNTERS): New.
+ * profile.c (compute_value_histograms): New static function.
+ (branch_prob): Read back the value histograms.
+ * rtl.c (reg_note_name): Add name for REG_VALUE_PROFILE note.
+ * rtl.h (enum reg_note): Add REG_VALUE_PROFILE note.
+ * value-prof.c: Add comment on reading the profile.
+ * value-prof.h (COUNTER_FOR_HIST_TYPE, HIST_TYPE_FOR_COUNTER): New.
+ * doc/invoke.texi (-fprofile-values): Document behavior with
+ -fbranch-probabilities.
+
+2003-07-30 David Edelsohn <edelsohn@gnu.org>
+
+ * longlong.h (PowerPC umul_ppmm): Do not test __vxworks__.
+
+2003-07-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.h (EH_RETURN_HANDLER_RTX): Compute offset
+ symbolically.
+
+2003-07-30 Jan Hubicka <jh@suse.cz>
+
+ * gcse.c (insert_store): Ignore fake edges.
+
+ * c-common.c (flag_vtable_gc): Kill.
+ * c-common.g (flag_vtable_gc): Kill.
+ * c-opts (c_common_handle_option): Kill.
+ * c.opt (fvtable-gc): Kill.
+ * final.c (final_scan_insn): Do not call assemble_vtable_entry.
+ * output.h (assemble_vtable_entry, assemble_vtable_inherit): Kill.
+ * varasm.c (assemble_vtable_entry, assemble_vtable_inherit): Kill.
+
+ * invoke.texi (-ftable-gc): Kill documentation.
+
+ * tree-inline.c (inlinable_function_p): Don't set DECL_UNINLINABLE
+ just because function body is missing.
+
+ * i386.c (pic_symbolic_operand): Properly detect RIP relative unspecs.
+
+2003-07-30 Ranjit Mathew <rmathew@hotmail.com>
+
+ * unwind-sjlj.c: Fix typo in file description.
+
+2003-07-30 Alan Modra <amodra@bigpond.net.au>
+
+ * calls.c (load_register_parameters): When shifting reg sized values
+ to the msb, move the value to a reg first.
+
+2003-07-29 Geoffrey Keating <geoffk@apple.com>
+
+ * cppfiles.c (stack_file): Leave filename as "" rather than "<stdin>".
+ * line-map.h (linemap_add): Update comments.
+ * line-map.c (linemap_add): Update comments, interpret zero-length
+ filename as "<stdin>".
+
+2003-07-29 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * mkinstalldirs: Import autoconf 2.57 / automake 1.7 version.
+
+2003-07-29 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (last_function_parm_vars, current_function_parm_vars):
+ New static variables.
+ (struct c_scope): Add parms and warned_forward_parm_decls
+ fields; remove parm_order.
+ (storedecls, storetags): Delete.
+ (poplevel): Also clear bindings on the parms chain.
+ (pushdecl): Handle forward declarations of parameters, and
+ chain PARM_DECLs on the parms list, not the names list.
+ (lookup_name_current_level): Check for PARM_DECLs on the parms
+ list too.
+ (push_parm_decl): Don't update parm_order.
+ (clear_parm_order): Rename mark_forward_parm_decls. Issue the
+ warning, only once per parameter list, and set TREE_ASM_WRITTEN
+ on the decls here. Then move the forward decls to the names list.
+ (grokparms): Set last_function_parm_vars.
+ (get_parm_info): Don't use gettags or getdecls. No need to
+ extract non-parms from the parms list, or reorganize the parms
+ list. Feed nonparms back in the TREE_TYPE of the list node
+ returned. Issue only one error per parameter list for "void"
+ appearing more than once in said parameter list. Collapse
+ parmlist_tags_warning into this function to avoid double scan
+ of tags list.
+ (start_function): Set current_function_parm_vars.
+ (store_parm_decls_newstyle): Bypass pushdecl, manipulate scope
+ directly. Get non-parms from current_function_parm_vars; no
+ need to extract them from the parms chain. Properly bind tags
+ in the new scope.
+ (store_parm_decls_oldstyle): No need to extract non-parameters
+ from the parms chain, nor to store them back afterward. Move
+ declaration to top of function, restructure code reordering
+ DECL_ARGUMENTS.
+ (store_parm_decls): No need to save and restore warn_shadow.
+ * c-parse.in: Don't call parmlist_tags_warning nor
+ clear_parm_order. Call mark_forward_parm_decls when forward
+ parm decls are encountered.
+ * c-tree.h: Prototype mark_forward_parm_decls; not
+ clear_parm_order or parmlist_tags_warning.
+
+2003-07-29 Geoffrey Keating <geoffk@apple.com>
+
+ * c-common.c (allow_pch): Remove.
+ * c-common.h (allow_pch): Remove.
+ (c_common_no_more_pch): Declare.
+ * c-lex.c (c_lex): Call c_common_no_more_pch when appropriate.
+ * c-pch.c: Include hosthooks.h.
+ (c_common_valid_pch): Don't check allow_pch.
+ (c_common_read_pch): Clear valid_pch to prevent reading PCH files.
+ (c_common_no_more_pch): New.
+ * ggc-common.c: Include hosthooks.h.
+ (gt_pch_save): Call gt_pch_get_address.
+ (gt_pch_restore): Call gt_pch_use_address.
+ * hooks.c (hook_voidp_size_t_null): New.
+ (hook_bool_voidp_size_t_false): New.
+ * hooks.h (hook_voidp_size_t_null): New.
+ (hook_bool_voidp_size_t_false): New.
+ * hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): New.
+ (HOST_HOOKS_GT_PCH_USE_ADDRESS): New.
+ (HOST_HOOKS_INITIALIZER): Add HOST_HOOKS_GT_PCH_GET_ADDRESS,
+ HOST_HOOKS_GT_PCH_USE_ADDRESS.
+ * hosthooks.h (struct host_hooks): Add gt_pch_get_address,
+ gt_pch_use_address.
+ * doc/hostconfig.texi (Host Common): Document
+ HOST_HOOKS_GT_PCH_GET_ADDRESS, HOST_HOOKS_GT_PCH_USE_ADDRESS.
+ * Makefile.in (c-pch.o): Depend on hosthooks.h.
+ (ggc-common.o): Likewise.
+
+ * config/rs6000/host-darwin.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Define.
+ (HOST_HOOKS_GT_PCH_USE_ADDRESS): Define.
+ (pch_address_space): New.
+ (darwin_rs6000_gt_pch_get_address): New.
+ (darwin_rs6000_gt_pch_use_address): New.
+
+2003-07-29 Neil Booth <neil@daikokuya.co.uk>
+
+ PR preprocessor/11569
+ PR preprocessor/11649
+ * Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.
+ * cppfiles.c: Completely rewritten.
+ * c-incpath.c (free_path, remove_duplicates, heads, tails, add_path):
+ struct cpp_path is now struct cpp_dir.
+ (remove_duplicates): Don't simplify path names.
+ * c-opts.c (c_common_parse_file): cpp_read_next_file renamed
+ cpp_stack_file.
+ * cpphash.h: Include hashtab.h.
+ (_cpp_file): Declare.
+ (struct cpp_buffer): struct include_file is now struct _cpp_file,
+ and struct cpp_path is now struct cpp_dir. Rename members.
+ (struct cpp_reader): Similarly. New members once_only_files,
+ file_hash, file_hash_entries, quote_ignores_source_dir,
+ no_search_path, saw_pragma_once. Remove all_include_files and
+ max_include_len. Make some members bool.
+ (_cpp_mark_only_only): Renamed from _cpp_never_reread.
+ (_cpp_stack_file): Renamed from _cpp_read_file.
+ (_cpp_stack_include): Renamed from _cpp_execute_include.
+ (_cpp_init_files): Renamed from _cpp_init_includes.
+ (_cpp_cleanup_files): Renamed from _cpp_cleanup_includes.
+ * cppinit.c (cpp_create_reader): Initialize no_search_path. Update.
+ (cpp_read_next_file): Rename and move to cppfiles.c.
+ (cpp_read_main_file): Update.
+ * cpplib.c (run_directive): Update for renamed members.
+ (do_include_common, _cpp_pop_buffer): Update.
+ (do_import): Undeprecate #import.
+ (do_pragma_once): Undeprecate. Use _cpp_mark_file_once_only.
+ * cpplib.h: Remove file_name_map_list.
+ (cpp_options): Remove map_list.
+ (cpp_dir): Rename from cpp_path. New datatype for name_map.
+ (cpp_set_include_chains, cpp_stack_file, cpp_included): Update.
+
+2003-07-29 Phil Edwards <pme@gcc.gnu.org>
+
+ * Makefile.in: Make stamp-objdir safe for parallel builds.
+
+2003-07-29 Phil Edwards <pme@gcc.gnu.org>
+
+ * Makefile.in (stmp-docobjdir): New target; ensure $docobjdir exists.
+ (info): Depend on stmp-docobjdir.
+
+2003-07-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure: Regenerate.
+
+2003-07-29 Jan Hubicka <jh@suse.cz>
+
+ PR C++/11131
+ * tree-inline.c (expand_call_inline): Always call inlinable_function_p
+ in !unit-at-a-time mode.
+
+2003-07-28 Geoffrey Keating <geoffk@apple.com>
+
+ * c-decl.c (c_expand_body_1): Use C_DECL_FILE_SCOPE to detect
+ main function.
+
+2003-07-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11667
+ * c-common.c (shorten_compare): Take into account differences
+ between C and C++ representation for enumeration types.
+ * tree.h (set_min_and_max_values_for_integral_type): Declare.
+ * stor-layout.c (set_min_and_max_values_for_integral_type): New
+ function, broken out from ...
+ (fixup_signed_type): ... here and ...
+ (fixup_unsigned_type): ... here.
+
+2003-07-28 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c: Update commentary, adjust blank lines throughout.
+ (struct c_scope): Fix indentation. Reorder members so
+ outer-context pointers come first, booleans last.
+ (duplicate_decls, define_label): Use a 'locus' variable for
+ diagnostic locations in a few more places.
+ (warn_if_shadowing): Un-split a conditional that fits on one line.
+ (c_init_decl_processing): No need to clear current_scope and
+ current_function_scope.
+ (start_decl): Merge if/else if statements with same action.
+ (push_parm_decl): Rename old_immediate_size_expand to use
+ save_foo convention; save/restore around entire function.
+ (grokdeclarator): Remove unnecessary braces.
+
+2003-07-28 Hans-Peter Nilsson <hp@bitrange.com>
+ Michael Culbertson <Michael.J.Culbertson@wheaton.edu>
+
+ * c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn
+ when warn_declaration_after_statement. Call pedwarn_c90, not
+ pedwarn. Correct message: it's "ISO C90", not "ISO C89".
+ * c-common.c (warn_declaration_after_statement): Define.
+ * c-common.h (warn_declaration_after_statement): Declare.
+ * c.opt (Wdeclaration-after-statement): New.
+ * c-errors.c (pedwarn_c90): New function.
+ * c-opts.c (c_common_handle_option) <case
+ OPT_Wdeclaration_after_statement>: New.
+ * c-tree.h (pedwarn_c90): Declare.
+ * doc/invoke.texi (Option Summary): Document
+ -Wdeclaration-after-statement.
+ (Warning Options): Ditto.
+
+2003-07-28 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (memory attribute) Avoid accessing uninitialized memory
+ for ishift1 type instructions.
+
+2003-07-28 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.in (--enable-checking): Add fold category.
+ (ENABLE_FOLD_CHECKING): Define if requested.
+ * configure: Rebuilt.
+ * config.in: Rebuilt.
+ * doc/install.texi: Document it.
+ * fold-const.c: Include md5.h.
+ [ENABLE_FOLD_CHECKING] (fold): Define to fold_1.
+ [ENABLE_FOLD_CHECKING] (fold, fold_checksum_tree, fold_check_failed,
+ print_fold_checksum): New functions.
+
+ * fold-const.c (fold): Never modify argument passed to fold, instead
+ change a copy and return it.
+ * convert.c (convert_to_integer): Likewise.
+
+2003-07-27 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/fixinc.svr4: Remove dead code. Remove now-unnecessary
+ cleanup of junk after #else and #endif directives. Collapse repeated
+ clauses into for statment.
+
+ * fixinc/fixincl.sh: GNU C -> GCC. Add usage comment.
+
+2003-07-27 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (struct c_scope): Remove keep_if_subblocks field.
+ (keep_next_if_subblocks): Rename next_is_function_body.
+ (pushlevel): Adjust commentary. Always set ->keep on the
+ outermost level of a function. Don't set ->keep_if_subblocks.
+ (poplevel): Adjust commentary. Don't look at ->keep_if_subblocks.
+ (store_parm_decls): Adjust to match.
+ (finish_function): Adjust to match.
+ Call poplevel with all three arguments zero.
+
+ * c-decl.c (store_parm_decls_newstyle, store_parm_decls_oldstyle):
+ New functions split out of store_parm_decls.
+ Avoid unnecessary work. Use local variables consistently.
+ (store_parm_decls): Likewise.
+
+ (finish_function): No need to set functionbody flag on call to
+ poplevel.
+ (struct language_function): Remove scope field.
+ (c_push_function_context, c_pop_function_context): No need to
+ save and restore current_scope.
+
+2003-07-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * doc/extend.texi (Deprecated Features): Implicit typename is
+ gone. Default args on types is going.
+
+2003-07-26 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * Makefile.in (ifcvt.o): Depend on target.h
+ * ifcvt.c (target.h): Include.
+ (if_convert): Don't call mark_loop_exit_edges if we can't
+ modify jumps.
+
+2003-07-26 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Testing): Adjust required versions of DejaGnu.
+
+2003-07-26 Richard Henderson <rth@redhat.com>
+
+ PR inline-asm/11676
+ * cse.c (count_reg_usage): Handle asm_operands properly.
+
+2003-07-26 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def (DEF_FALLBACK_BUILTIN): Delete.
+ (DEF_EXT_FALLBACK_BUILTIN): Delete.
+ (BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Declare using
+ the regular DEF_EXT_LIB_BUILTIN macro.
+ (BUILT_IN_FPUTC, BUILT_IN_FPUTS, BUILT_IN_FWRITE): Declare using
+ the regular DEF_LIB_BUILTIN macro.
+ (BUILT_IN_PUTCHAR_UNLOCKED, BUILT_IN_PUTS_UNLOCKED,
+ BUILT_IN_FPUTC_UNLOCKED, BUILT_IN_FPUTS_UNLOCKED,
+ BUILT_IN_FWRITE_UNLOCKED): Declare using the regular
+ DEF_EXT_LIB_BUILTIN macro.
+
+ * c-decl.c (duplicate_decls): Remove code to handle builtin
+ functions prototyped without an argument list.
+
+2003-07-26 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/winnt.c: Revert 2003-07-08 change.
+ (i386_pe_section_type_flags): Remove error_with_decl here too.
+
+2003-07-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * config/arm/pe.c (arm_mark_dllimport): Don't use xxx_with_decl.
+ * config/mcore/mcore.c (mcore_mark_dllimport): Likewise.
+ * config/v850/v850.c (v850_handle_data_area_attribute): Likewise.
+ (v850_handle_data_area_attribute): Likewise.
+
+2003-07-26 Geoffrey Keating <geoffk@apple.com>
+
+ * varasm.c (output_constant_def_contents): Use
+ ASM_DECLARE_CONSTANT_NAME if defined.
+ * doc/tm.texi (Label Output): Document ASM_DECLARE_CONSTANT_NAME.
+ * config/darwin.h (ASM_DECLARE_OBJECT_NAME): Ensure zero-sized
+ objects get at least one byte to prevent assembler problems.
+ (ASM_DECLARE_CONSTANT_NAME): New.
+
+ * Makefile.in (libbackend.o): Remove options_.h.
+ (mostlyclean): Likewise.
+
+ * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't
+ insert a label at the end of an function under Mach-O.
+
+ * c-decl.c (c_static_assembler_name): Remove TREE_STATIC test.
+
+2003-07-25 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (is_ev64_opaque_type): Only check pointer
+ equality.
+ (spe_init_builtins): Declare __ev64_opaque__ as a builtin type.
+
+ * config/rs6000/spe.h: Remove __ev64_opaque__ definition.
+
+2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * doc/passes.texi (Passes): Mention pretty-printing and
+ diagnostic files.
+
+2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * doc/extend.texi (Function Attributes): GNU C++ does now allow
+ unused parameter decls.
+ (Attribute Syntax): GNU C++ does not allow label attributes to be
+ after the ':'.
+
+2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * objc/objc-act.c (objc_check_decl): Don't use xxx_with_decl.
+ (objc_declare_class): Likewise.
+ (error_with_ivar): Likewise.
+ (start_class): Likewise.
+ (warn_with_method): Likewise.
+
+2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Remove pedwarn_with_decl, warning_with_decl and error_with_decl
+ from GCC.
+ * calls.c (try_to_integrate): Don't use xxx_with_decl.
+ (expand_call): Likewise.
+ * dwarfout.c (output_reg_number): Likewise.
+ * expr.c (expand_expr): Likewise.
+ * function.c (assign_temp): Likewise.
+ (uninitialized_vars_warning): Likewise.
+ (setjmp_args_warning): Likewise.
+ (expand_function_end): Likewise.
+ * stmt.c (fixup_gotos): Likewise.
+ (warn_about_unused_variables): Likewise.
+ (expand_end_bindings): Likewise.
+ * stor-layout.c (layout_decl): Likewise.
+ (place_field): Likewise.
+ * toplev.c (check_global_declarations): Likewise.
+ (rest_of_handle_inlining): Likewise.
+ (default_tree_printer): New function.
+ (general_init): Initialize diagnostic machinery before routing
+ signals to the ICE machinery. Set default tree printer.
+ * toplev.h (pedwarn_with_decl): Remove declaration.
+ (warning_with_decl): Likewise.
+ (error_with_decl): Likewise.
+ (pedwarn): Remove attribute for the time being.
+ * tree-inline.c (expand_call_inline): Don't use xxx_with_decl.
+ * varasm.c (named_section): Likewise.
+ (make_decl_rtl): Likewise.
+ (assemble_variable): Likewise.
+ (merge_weak): Likewise.
+ (declare_weak): Likewise.
+
+ * diagnostic.h: Move non-diagnostic stuff into pretty-print.h.
+ * diagnostic.c: Move non-diagnostic stuff into pretty-print.c.
+ (format_with_decl): Remove.
+ (diagnostic_for_decl): Likewise.
+ (pedwarn_with_decl): Likewise.
+ (warning_with_decl): Likewise.
+ (error_with_decl): Likewise.
+ (diagnostic_initialize): Adjust.
+ (diagnostic_count_diagnostic): Likewise.
+ (announce_function): Likewise.
+ (lhd_print_error_function): Likewise.
+ (diagnostic_report_current_module): Likewise.
+ (default_diagnostic_starter): Likewise.
+ (diagnostic_report_diagnostic): Likewise.
+ (default_diagnostic_finalizer): Likewise.
+ (verbatim): Likewise.
+ (error): Likewise.
+ (warning): Likewise.
+ * opts.c (common_handle_option): Likewise.
+ * pretty-print.c: New file.
+ * c-pretty-print.h (pp_base): Override.
+ * c-pretty-print.c: Adjust use of macros throughout.
+ (pp_buffer): New macro.
+ (pp_newline): Likewise.
+ * c-objc-common.c (c_tree_printer): Adjust prototype. Tidy.
+ * Makefile.in (DIAGNOSTIC_H): New variable.
+ (c-errors.o): Use it.
+ (c-objc-common.o): Likewise.
+ (c-common.o): Likewise.
+ (c-opts.o): Likewise.
+ (c-format.o): Likewise.
+ (diagnostic.o): Likewise.
+ (opts.o): Likewise.
+ (toplev.o): Likewise.
+ (rtl-error.o): Likewise.
+ (dwarf2out.o): Likewise.
+ (jump.o): Likewise.
+ (pretty-print.o): New rule.
+
+2003-07-24 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def (BUILT_IN_PRINTF, BUILT_IN_FPRINTF): Changed from
+ front-end builtins to normal builtins, using DEF_LIB_BUILTIN.
+ (BUILT_IN_PRINTF_UNLOCKED, BUILT_IN_FPRINTF_UNLOCKED): Changed
+ from front-end to normal builtins, using DEF_EXT_LIB_BUILTIN.
+ (DEF_FRONT_END_LIB_BUILTIN): Delete.
+ (DEF_EXT_FRONT_END_LIB_BUILTIN): Delete.
+ (BUILT_IN_FWRITE_UNLOCKED): Wrap long line.
+
+ * builtins.c (build_string_literal): New function to construct
+ a char* pointer to a string literal.
+ (expand_builtin_fputs): Change 2nd argument from "int ignore" to
+ "rtx target" to be consistent with other expand_builtin_* functions.
+ Change 3rd argument from "int unlocked" to "bool unlocked".
+ (expand_builtin_printf): Rewrite of c_expand_builtin_printf from
+ c-common.c to avoid front-end dependencies. Optimize printf("")
+ as a no-op when the result isn't required. Handle embedded NULs
+ in format string.
+ (expand_builtin_fprintf): A rewrite of c_expand_builtin_fprintf
+ from c-common.c to avoid front-end dependencies. Likewise, optimize
+ fprintf(fp,"") as a no-op when the result isn't required, evaluating
+ fp for side-effects. Handle embedded NULs in format string.
+ (expand_builtin_sprintf): Fix typo.
+ (expand_builtin): Don't expand BUILT_IN_FPRINT{,_UNLOCKED} when not
+ optimizing. Adjust calls of expand_builtin_fputs to match the API
+ change. Expand BUILT_IN_PRINTF and BUILT_IN_PRINTF_UNLOCKED using
+ expand_builtin_printf. Likewise, expand BUILT_IN_FPRINTF_UNLOCKED
+ and BUILT_IN_FPRINTF using expand_builtin_fprintf.
+
+ * c-common.c (is_valid_printf_arglist): Delete.
+ (c_expand_builtin): Delete.
+ (c_expand_builtin_printf): Moved to builtins.c. Delete.
+ (c_expand_builtin_fprintf): Moved to builtins.c. Delete.
+ (c_expand_expr): No longer treat CALL_EXPRs specially.
+ (CALLED_AS_BUILT_IN): Delete.
+
+2003-07-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR optimization/11631
+ * gcse.c (store_motion): Connect infinite loops to exit.
+
+2003-07-24 Jason Merrill <jason@redhat.com>
+
+ * tree.h (boolean_type_node): Move from C/C++/Java frontends.
+ (boolean_true_node, boolean_false_node): Likewise.
+ (enum tree_index): Add TI_BOOLEAN_{TYPE,FALSE,TRUE}.
+ * tree.c (build_common_tree_nodes): Init boolean_type_node.
+ (build_common_tree_nodes_2): Init boolean_{true,false}_node.
+ * stor-layout.c (set_sizetype): Handle an early BOOLEAN_TYPE.
+ * c-common.h (truthvalue_type_node): Renamed from boolean_type_node.
+ (truthvalue_true_node): Renamed from boolean_true_node.
+ (truthvalue_false_node): Renamed from boolean_false_node.
+ * c-decl.c: Just set truthvalue_* to integer_*.
+ * c-*.[ch]: s/boolean/truthvalue/. s/c_bool/boolean/.
+
+2003-07-24 Roger Sayle <roger@eyesopen.com>
+
+ * c-decl.c (match_builtin_function_types): New subroutine of
+ duplicate_decls to test whether a redeclaration of a builtin
+ function is suitably close, i.e. the return type and all of
+ the argument types have the same modes as the builtin expects.
+ (duplicate_decls): Fuzzy type matching for builtin functions
+ moved to match_builtin_function_types.
+
+2003-07-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloopmanip.c (duplicate_loop_to_header_edge): Update irreducible
+ flag correctly.
+
+2003-07-24 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c: Search-and-replace change 'binding level' to
+ 'scope' in commentary.
+ (struct binding_level): Now struct c_scope.
+ (current_binding_level): Now current_scope.
+ (free_binding_level): Now scope_freelist.
+ (current_function_level): Now current_function_scope.
+ (global_binding_level): Now global_scope.
+ (make_binding_level): Now make_scope.
+ (pop_binding_level): Now pop_scope.
+
+2003-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (libgcc_visibility): Add missing whitespace.
+
+2003-07-24 Richard Henderson <rth@redhat.com>
+
+ * libgcc-std.ver (GCC_3.3.1): Export __gcc_personality_sj0,
+ __gcc_personality_v0.
+
+2003-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * Makefile.in: Replace pwd by ${PWD_COMMAND}.
+
+2003-07-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * doc/invoke.texi (-fprofile-arcs, -ftest-coverage): Update
+ documentation missed from my 2003-07-09 patch.
+
+2003-07-24 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * aclocal.m4 (_gcc_COMPUTE_GAS_VERSION): Set patch level to 0 if
+ it's not provided.
+ * configure: Rebuild.
+
+2003-07-24 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c/10602
+ * c-typeck.c (type_lists_compatible_p): Do not compare
+ arguments if one of them is an error_mark_node
+
+2003-07-24 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Save fp regs inline
+ if current_function_calls_eh_return.
+
+2003-07-23 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/c-tree.texi (OFFSET_TYPE): Update description.
+
+2003-07-23 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/crti.asm (_init, _fini): Increase frame size to 64.
+ * config/xtensa/lib1funcs.asm (__mulsi3, __udivsi3, __divsi3,
+ __umodsi3, __modsi3): Increase frame size to 32.
+
+2003-07-23 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/host-darwin.c: ANSIfy, update comment for sigaltstack
+ prototype.
+
+2003-07-23 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/c-tree.texi (Types): Update documentation for OFFSET_TYPE.
+
+ PR optimization/10679
+ * tree-inline.c (inlinable_function_p): Honor MIN_INLINE_INSNS.
+
+2003-07-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/11607 and PR target/11516
+ * pa.md (extzv, extv, insv): Revert latter half of last patch.
+
+2003-07-22 Mark Mitchell <mark@codesourcery.com>
+
+ * fold-const.c (force_fit_type): Handle OFFSET_TYPE.
+ * varasam.c (output_constant): Likewise.
+
+2003-07-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * alias.c: Fix comment formatting.
+ * c-common.c: Likewise.
+ * c-decl.c: Likewise.
+ * c-opts.c: Likewise.
+ * combine.c: Likewise.
+ * cpplib.c: Likewise.
+ * diagnostic.c: Likewise.
+ * dojump.c: Likewise.
+ * final.c: Likewise.
+ * fold-const.c: Likewise.
+ * gcc.c: Likewise.
+ * gcse.c: Likewise.
+ * ggc-page.c: Likewise.
+ * jump.c: Likewise.
+ * loop.c: Likewise.
+ * mips-tfile.c: Likewise.
+ * recog.c: Likewise.
+ * regclass.c: Likewise.
+ * regmove.c: Likewise.
+ * tree.c: Likewise.
+ * tree.h: Likewise.
+
+2003-07-22 Per Bothner <pbothner@apple.com>
+
+ * line-map.c (add_line_map): Handle invalid LEAVE request.
+ Fixes PR preprocessor/11361.
+
+2003-07-22 Per Bothner <pbothner@apple.com>
+
+ * diagnostic.c.(diagnostic_report_current_module): Update to match
+ 2003-06-05 changes to push_srcloc and pop_srcloc.
+
+2003-07-22 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * doc/trouble.texi: Better document two-stage name lookup.
+
+2003-07-22 Eric Christopher <echristo@redhat.com>
+
+ * config/s390.c (s390_valid_pointer_mode): New.
+ (TARGET_VALID_POINTER_MODE): Use.
+ (s390_emit_prologue): Add tpf profiling hooks.
+ (s390_emit_epilogue): Ditto.
+ * config/s390.h (MASK_TPF): New.
+ (TARGET_TPF): Use.
+ (POINTERS_EXTEND_UNSIGNED): Define.
+ * config/s390.md (ptr_extend): New pattern.
+
+2003-07-22 Zack Weinberg <zack@codesourcery.com>
+
+ * hashtable.c (approx_sqrt): Make static.
+ * hashtable.h: Don't prototype approx_sqrt.
+ * line-map.c (init_line_maps): Rename linemap_init.
+ (free_line_maps): Rename linemap_free.
+ (add_line_map): Rename linemap_add.
+ (lookup_line): Rename linemap_lookup.
+ (print_containing_files): Rename linemap_print_containing_files.
+ * linemap.h: Update to match.
+
+ * cpperror.c, cppinit.c, cpplib.c, cppmacro.c: Update calls to
+ linemap routines to use new names.
+
+2003-07-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-common.c (handle_packed_attribute): Don't pack a struct via a
+ typedef. Propagate packedness from a main variant.
+
+2003-07-22 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.in (install-common): Add dependency on installdirs.
+
+2003-07-21 Alexandre Oliva <aoliva@redhat.com>
+
+ * c-common.c (c_common_type_for_mode): Return integer types for
+ pointer modes.
+
+2003-07-22 Geoffrey Keating <geoffk@apple.com>
+
+ * c-decl.c (start_decl): Don't call maybe_apply_pragma_weak here.
+ (finish_decl): Call maybe_apply_pragma_weak here.
+ (grokdeclarator): Check that DECL_ASSEMBLER_NAME isn't set before
+ TREE_PUBLIC and TREE_STATIC are decided.
+ (start_function): Move call to maybe_apply_pragma_weak. Check that
+ DECL_ASSEMBLER_NAME isn't set too early.
+
+ * cpplex.c (_cpp_process_line_notes): Mention option name in
+ trigraphs warning.
+
+2003-07-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (if_then_else_cond): Simplify the comparison of
+ rtx against -1, 0, and 1.
+ * loop.c (check_dbra_loop): Likewise.
+ * optabs.c (emit_conditional_move): Likewise.
+ (emit_conditional_add): Likewise.
+ * config/i386/i386.md (*movsi_or): Likewise.
+ (*movdi_or_rex6): Likewise.
+
+2003-07-22 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (cgraph_finalize_compilation_unit): Remove redundant if.
+
+2003-07-21 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppfiles.c (open_file_pch): Don't put unused entries in the
+ splay tree. Remove dead code.
+
+2003-07-21 Geoffrey Keating <geoffk@apple.com>
+
+ * c-common.h (num_in_fnames): Declare.
+ (c_static_assembler_name): Move from here...
+ * c-tree.h (c_static_assembler_name): ... to here.
+ * c-opts.c: Don't include langhooks-def.h.
+ (c_static_assembler_name): Move to c-decl.c.
+ (num_in_fnames): Make externally visible.
+ * c-decl.c: Include langhooks-def.h.
+ (c_static_assembler_name): Move from c-opts.c.
+ * Makefile.in (c-decl.o): Add $(LANGHOOKS_DEF_H).
+ (c-opts.o): Remove $(LANGHOOKS_DEF_H).
+
+ * c-pragma.c (maybe_apply_pragma_weak): Don't get DECL_ASSEMBLER_NAME
+ when it's not needed.
+
+2003-07-21 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/rs6000.h (machine_function): Add ra_need_lr.
+ * config/rs6000/rs6000.c (rs6000_return_addr): Set it.
+ (rs6000_emit_prologue): Save FPRs inline if set.
+
+2003-07-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/ia64/ia64.md (prefetch): Support predicate.
+
+2003-07-21 Josef Zlomek <zlomekj@suse.cz>
+
+ * cfgcleanup.c (merge_blocks_move_successor_nojumps): Use tablejump_p.
+ * rtlanal.c (tablejump_p): Use next_active_insn for finding the jump
+ table.
+
+2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11536
+ * unroll.c (loop_iterations): Do not replace a register holding
+ the final value by its equivalent before the loop if it is not
+ invariant.
+
+2003-07-21 Dave Fluri <dave.fluri@onlink.net>
+
+ * doc/extend.texi: Fixes to spelling, grammar, and diction.
+
+2003-07-21 Ben Elliston <bje@wasabisystems.com>
+
+ * doc/invoke.texi (Optimize Options): Replace "it's" with "its".
+ (V850 Options): Spelling fixes.
+
+2003-07-20 Lisa M. Goldstein <opus@gnu.org>
+
+ * doc/invoke.texi: Fixes to style, grammar and diction.
+
+2003-07-20 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def (BUILT_IN_ALLOCA): Remove "#if SMALL_STACK" form.
+ * system.h (SMALL_STACK): Poison obsolete target macro.
+ * doc/tm.texi (SMALL_STACK): Remove target macro documentation.
+
+2003-07-20 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in: Cache the results of testing for cmp's capabilities.
+ * configure: Regenerate.
+
+2003-07-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/11279
+ * dwarf2out.c (gen_enumeration_type_die): Remember that
+ enumerators can be unsigned.
+
+2003-07-19 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (named_labels, shadowed_labels, label_level_chain)
+ (push_label_level, pop_label_level): Kill.
+ (struct binding_level): Rename level_chain to outer.
+ Add outer_function field. Change parm_flag, function_body,
+ keep, keep_if_subblocks to 1-bit bitfields of type bool.
+ (current_function_level): New variable.
+ (keep_next_level_flag, keep_next_if_subblocks): Change type to bool.
+ (keep_next_level, declare_parm_level, warn_if_shadowing):
+ Update to match.
+ (struct language_function): Kill named_labels, shadowed_labels fields.
+ (c_init_decl_processing, start_function, c_push__function_context)
+ (c_pop_function_context): No need to muck with named_labels nor
+ shadowed_labels.
+
+ (make_binding_level): No need to clear the structure here.
+ (pop_binding_level): Always operate on current_binding_level.
+ Update current_function_level if necessary.
+ (pushlevel): Don't clear named_labels. Update current_function_level
+ if necessary. Use "true" and "false" where appropriate.
+ (poplevel): Diagnose labels defined but not used, or vice
+ versa, and clear out label-meanings leaving scope, while
+ walking down the decls list, for all binding levels.
+ Handle LABEL_DECLs appearing in the shadowed list.
+ pop_binding_level takes no arguments.
+ (pushdecl_function_level): Use current_function_level.
+
+ (make_label, bind_label): New static functions.
+ (declare_label): New exported function.
+ (lookup_label, define_label): Rewritten for new data structure.
+ (shadow_label): Kill.
+
+ * c-tree.h: Prototype declare_label; don't prototype
+ push_label_level, pop_label_level, nor shadow_label.
+ * c-parse.in: Remove all calls to push_label_level and
+ pop_label_level. Use declare_label for __label__ decls.
+
+ * doc/extend.texi: Clarify that __label__ can be used to
+ declare labels with local scope in any nested block, not
+ just statement expressions. Cross-reference nested functions
+ section from local labels section.
+
+2003-07-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * sched-rgn.c (find_rgns): Initialize current_edge correctly.
+
+2003-07-19 Phil Edwards <pme@gcc.gnu.org>
+
+ * doc/makefile.texi (restrap, profiledbootstrap): Document targets.
+
+2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * fixinc/fixfixes.c fixinc/fixincl.c fixinc/fixlib.c
+ fixinc/server.c objc/objc-act.c: Remove unnecessary casts.
+
+2003-07-19 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (legitimize_pic_address): Access local symbols
+ relative to the GOT instead of relative to the literal pool base.
+ (s390_output_symbolic_const): Handle new GOT-relative accesses.
+ * config/s390/s390.md ("call"): Access local functions and PLT stubs
+ relative to the GOT instead of relative to the literal pool base.
+ ("call_value"): Likewise.
+ ("call_value_tls"): Likewise.
+
+ * config/s390/s390.c (s390_chunkify_start): Remove pool anchor
+ reloading. Support LTREL_BASE / LTREL_OFFSET construct.
+ (s390_chunkify_finish): Likewise.
+ (s390_chunkify_cancel): Likewise.
+ (s390_reorg): Adapt caller.
+ (find_base_register_in_addr,
+ find_base_register_ref, replace_base_register_ref): Delete.
+ (find_ltrel_base, replace_ltrel_base): New functions.
+ (find_constant_pool_ref): Handle LTREL_BASE unspecs.
+ (s390_decompose_address): Handle LTREL_BASE unspecs. Optimize
+ base vs. index register usage.
+ (struct constant_pool): Remove 'anchor'.
+ (s390_add_anchor): Delete.
+ (s390_dump_pool): Remove anchor handling.
+ * config/s390/s390.md ("reload_anchor"): Remove.
+
+ * config/s390/s390.c (s390_split_branches): Use LTREL_BASE/OFFSET.
+ (s390_load_got): New function. Use LTREL_BASE/OFFSET.
+ (s390_emit_prologue): Use it.
+ * config/s390/s390.md ("builtin_longjmp", "builtin_setjmp_setup",
+ "builtin_setjmp_receiver"): Cleanup. Use s390_load_got. Do not
+ hard-code register 14.
+ * config/s390/s390-protos.h (s390_load_got): Declare.
+
+ * config/s390/s390.c (NR_C_MODES, constant_modes, gen_consttable):
+ Support TImode constants.
+ * config/s390/s390.md ("consttable_ti"): New.
+ ("consttable_si", "consttable_di"): Handle TLS symbols correctly.
+
+ * config/s390/s390.md (UNSPEC_LTREL_OFFSET, UNSPEC_LTREL_BASE,
+ UNSPEC_GOTENT, UNSPEC_GOT, UNSPEC_GOTOFF, UNSPEC_PLT, UNSPEC_PLTOFF,
+ UNSPEC_RELOAD_BASE, UNSPECV_POOL, UNSPECV_POOL_START, UNSPECV_POOL_END,
+ UNSPECV_POOL_QI, UNSPECV_POOL_HI, UNSPECV_POOL_SI, UNSPECV_POOL_DI,
+ UNSPECV_POOL_TI, UNSPECV_POOL_SF, UNSPECV_POOL_DF, UNSPECV_MAIN_POOL):
+ New symbolic constants.
+ ("consttable_qi", "consttable_hi", "consttable_si", "consttable_di",
+ "consttable_sf", "consttable_df", "pool_start_31", "pool_end_31",
+ "pool_start_64", "pool_end_64", "reload_base_31", "reload_base_64",
+ "pool", "literal_pool_31", "literal_pool_64"): Cleanup. Use
+ symbolic UNSPEC values.
+ * config/s390/s390.c (larl_operand, s390_short_displacement,
+ bras_sym_operand, s390_cannot_force_const_mem,
+ s390_delegitimize_address, s390_decompose_address,
+ legitimize_pic_address, s390_output_symbolic_const,
+ s390_function_profiler): Use symbolic UNSPEC values.
+
+2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
+ c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
+ c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
+ collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
+ cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
+ cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
+ dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
+ fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
+ gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
+ genemit.c genextract.c genoutput.c genrecog.c gensupport.c
+ ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
+ integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
+ loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
+ postreload.c prefix.c print-tree.c protoize.c ra-build.c
+ ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
+ regmove.c regrename.c reload.c reload1.c reorg.c resource.c
+ sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
+ simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
+ tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
+ varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
+ casts.
+
+2003-07-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-pragma.c (apply_pragma_weak): Don't use warning_with_decl.
+ * toplev.h (warning): Remove attribute.
+
+2003-07-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-decl.c (c_finish_incomplete_decl): Don't use xxx_with_decl.
+ (pop_label_level): Likewise.
+ (duplicate_decls): Likewise.
+ (implicitly_declare): Likewise.
+ (shadow_label): Likewise.
+ (start_decl): Likewise.
+ (finish_decl): Likewise.
+ (grokdeclarator): Likewise.
+ (get_parm_info): Likewise.
+ (detect_field_duplicates): Likewise.
+ (finish_struct): Likewise.
+ (start_function): Likewise.
+ (store_parm_decls): Likewise.
+ (finish_function): Likewise.
+ (c_expand_body_1): Likewise.
+ (check_for_loop_decls): Likewise.
+ (merge_translation_unit_decls): Likewise.
+
+2003-07-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * common.opt: Document --param.
+ * opts.c (columns, undocumented_msg): New.
+ (print_help): Get number of columns from environment. Print
+ --param help. Tweak newline handling.
+ (print_param_help): New.
+ (print_filtered_help): Better handling of duplicates. Complain
+ about undocumented switches.
+ (print_switch): New.
+ (wrap_help): Improve wrapping, use COLUMNS.
+ * opts.sh: Ignore comments in records.
+ * params.def: Fix typos and remove trailing periods.
+ * toplev.c (display_help): Don't dump --param help.
+ * doc/sourcebuild.texi: Update.
+
+2003-07-18 Richard Henderson <rth@redhat.com>
+
+ PR target/11556
+ * optabs.c (prepare_operand): Fail gracefully instead of abort
+ if the predicate doesn't satisfy.
+ (gen_cond_trap): Allow prepare_operand to fail.
+
+2003-07-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-common.c: Don't undefine GCC_DIAG_STYLE.
+ (fname_decl): Don't use xxx_with_decl.
+ (c_add_case_label): Likewise.
+ (handle_section_attribute): Likewise.
+ (handle_alias_attribute): Likewise.
+ (handle_no_instrument_function_attribute): Likewise.
+ (handle_no_limit_stack_attribute): Likewise.
+ * c-objc-common.c (c_tree_printer): Print IDENTIFIER_NODEs.
+ * c-format.c (gcc_cdiag_char_table): Add '%E' format-specifier.
+
+2003-07-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (ifcvt.o): Add cfgloop.h.
+ * basic-block.h (EDGE_LOOP_EXIT): New flag.
+ * cfgrtl.c (rtl_verify_flow_info_1): Handle it correctly.
+ * ifcvt.c: Include cfgloop.h.
+ (mark_loop_exit_edges): New static function.
+ (if_convert): Call it.
+ (find_if_header): Ignore branches out of loops.
+
+2003-07-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (simplify_comparison): Don't share rtx when converting
+ (ne (and (not X) 1) 0) to (eq (and X 1) 0).
+
+2003-07-18 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/aix.h (AGGREGATE_PADDING_FIXED): Define.
+ (AGGREGATES_PAD_UPWARD_ALWAYS): Define.
+ (MUST_PASS_IN_STACK): Define.
+ (BLOCK_REG_PADDING): Define.
+
+2003-07-18 Richard Henderson <rth@redhat.com>
+
+ * cfgrtl.c (force_nonfallthru_and_redirect): Use tablejump_p
+ to skip the addr_vec.
+
+2003-07-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * combine.c (combinable_i3pat): Don't forbid occurrences of
+ i2dest or i1dest in inner_dest if inner_dest is a mem.
+
+2003-07-18 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_remove_node): Clear the hash table slot.
+
+2003-07-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/11087
+ * loop.c (basic_induction_var): Check if convert_modes emitted any
+ instructions. Remove them and return 0 if so.
+
+2003-07-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11083
+ * toplev.c (rest_of_handle_addresof): Rename into
+ rest_of_handle_addressof. Delete unreachable blocks
+ if dead edges were purged after the addressof pass.
+
+2003-07-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in, configure, configure.in: Remove handling of
+ lang-options.h and options_.h.
+ * toplev.c (struct lang_opt, documented_lang_options): Remove.
+ (display_help): Don't use documented_lang_options.
+
+2003-07-17 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (pushdecl_function_level): Make static, return nothing.
+ (kept_level_p): Fold into poplevel.
+ (undeclared_variable): Moved here from c-typeck.c. Export.
+ * c-tree.h (KEEP_YES, KEEP_NO, KEEP_MAYBE): New #defines.
+ (undeclared_variable): Prototype here. Don't prototype
+ kept_level_p nor pushdecl_function_level.
+ * c-parse.in: Change first argument to poplevel from
+ "kept_level_p()" to "KEEP_MAYBE".
+ * c-typeck.c (undeclared_variable): Moved to c-decl.c.
+
+2003-07-17 Roger Sayle <roger@eyesopen.com>
+
+ * simplify-rtx.c (simplify_rtx): Use simplify_gen_binary to swap
+ commutative operands instead of modifying the RTL in-place.
+
+2003-07-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR optimization/11557
+ * calls.c (flags_from_decl_or_type): Do not set ECF_LIBCALL_BLOCK
+ unless we know which function is being called.
+
+2003-07-17 Roger Sayle <roger@eyesopen.com>
+
+ * cse.c (fold_rtx): Use swap_commutative_operands_p to determine
+ whether to reorder the operands of a commutative binary operator.
+
+2003-07-17 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (const_binop): Avoid performing the FP operation at
+ compile-time, if either operand is NaN and we honor signaling NaNs,
+ or if we're dividing by zero and either flag_trapping_math is set
+ or the desired mode doesn't support infinities.
+ (fold_initializer): New function to fold an expression ignoring any
+ potential run-time exceptions or traps.
+ * tree.h (fold_initializer): Prototype here.
+ * c-typeck.c (build_binary_op): Move to the end of the file so
+ that intializer_stack is in scope. If constructing an initializer,
+ i.e. when initializer_stack is not NULL, use fold_initializer to
+ fold expressions.
+ * simplify-rtx.c (simplify_binary_operation): Likewise, avoid
+ performing FP operations at compile-time, if they would raise an
+ exception at run-time.
+
+2003-07-17 Geoffrey Keating <geoffk@apple.com>
+
+ PR 11498
+ * Makefile.in (c-opts.o): Add $(LANGHOOKS_DEF_H).
+ (langhooks.o): Add $(GGC_H), gt-langhooks.h.
+ (GTFILES): Add langhooks.c.
+ (gt-langhooks.h): New.
+ * c-common.h (c_static_assembler_name): Prototype.
+ * c-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define.
+ * objc/objc-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define.
+ * c-opts.c: Include langhooks-def.h.
+ (c_static_assembler_name): New.
+ * langhooks.c: Include ggc.h. Include gt-langhooks.h.
+ (var_labelno): New.
+ (lhd_set_decl_assembler_name): Give static objects with context
+ unique names.
+ * varasm.c (var_labelno): Delete.
+ (make_decl_rtl): Don't change the assembler name once it's set.
+
+ * c-opts.c (this_input_filename): New.
+ (finish_options): Take new parameter, name of file being compiled.
+ Update callers. Set this_input_filename.
+ (push_command_line_include): Use this_input_filename not
+ main_input_filename.
+
+2003-07-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Depend .pot generation on options.c.
+ * po/exgettext: Add an extra_files variable containing additional
+ files to scan.
+
+2003-07-17 Zack Weinberg <zack@codesourcery.com>
+
+ * objc/objc-lang.c: Override LANG_HOOKS_WRITE_GLOBALS to
+ c_write_global_declarations.
+
+ * c-decl.c: Fix typos in several comments. Remove all
+ #if 0 blocks; reindent as needed. Remove unused argument
+ to declare_parm_level; all callers changed.
+ * c-parse.in: Update calls to declare_parm_level. Avoid
+ issuing a double warning in some circumstances.
+ * c-typeck.c: Update calls to declare_parm_level.
+ * c-tree.h: Update prototype of declare_parm_level.
+
+ * c-pragma.c (apply_pragma_weak): Don't complain about a
+ redundant #pragma weak.
+
+ * objc/objc-act.c (forward_declare_categories,
+ build_selector_reference_decl, build_class_reference_decl,
+ build_objc_string_decl, synth_forward_declarations,
+ build_protocol_reference): Set TREE_PUBLIC on synthetic
+ forward decl to 0, consistent with eventual definition.
+ Correct comments to match.
+
+ * fixinc/inclhack.def (solaris_mutex_init_2): Escape braces
+ in regexp that don't form a range expression.
+ * fixinc/fixincl.def: Regenerate.
+
+2003-07-17 Richard Henderson <rth@redhat.com>
+
+ PR target/10907
+ * config/ia64/ia64.c (ia64_epilogue_uses): GP is live at end
+ even with !TARGET_CONST_GP.
+ (ia64_function_ok_for_sibcall): Reject non-local functions.
+
+2003-07-17 Steven Bosscher <steven@gcc.gnu.org>
+
+ * c-common.c (c_estimate_num_insns_1): Don't handle
+ METHOD_CALL_EXPR.
+ * expr.c (safe_from_p): Likewise.
+ * gengtype.c (adjust_field_tree_exp): Likewise.
+ * stmt.c (warn_if_unused_value): Likewise
+ * tree.c (first_rtl_op): Likewise.
+ * tree.def: Don't define METHOD_CALL_EXPR.
+ * java/lang.c (java_estimate_num_insns_1): Don't handle
+ METHOD_CALL_EXPR.
+
+2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR other/11466
+ * doc/invoke.texi (SPARC Options): Document "-mlittle-endian"
+ and its restrictions for the SPARC64 port.
+ Move the entry of "-mimpure-text" before that of "-mv8".
+
+2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Phil Edwards <phil@jaj.com>
+
+ * doc/install.texi (*-*-solaris2*): Document the step-by-step
+ procedure to bootstrap and install.
+ Document the preference for the legacy Sun tools in /usr/bin
+ over the POSIX tools in /usr/xpg4/bin for the build process.
+
+2003-07-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * c.opt: Document Uncodumented; use it. Document ObjC options.
+ * opts.c (print_filtered_help): Skip undocumented switches.
+ * opts.h (CL_UNDOCUMENTED): New.
+ * opts.sh: Handle Undocumented.
+ * toplev.c (documented_lang_options): Prevent its becoming empty.
+objc:
+ * lang-options.h: Remove.
+
+2003-07-16 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * loop.c (check_ext_dependent_givs): Pass const struct loop *
+ instead of struct loop_info * as argument. Accept BIVs with
+ increment +/- 1 provided there is a friendly exit test against
+ a loop-invariant value.
+ (strength_reduce): Adapt call to check_ext_dependent_givs.
+
+2003-07-16 J"orn Rennecke <joern.rennecke@superh.com>
+ Con Bradley <con.bradley@superh.com>
+
+ * sh-protos.h (sh_get_pr_initial_val): Declare.
+ * sh.c (regno_reg_class): Make its elements type enum reg_class.
+ (output_stack_adjust): Remove emit_fn argument. Add epilogue_p
+ and live_regs_mask arguments. Changed all callers.
+ (save_schedule_s): New structure.
+ (save_schedule): New typedef.
+ (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions.
+ (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p.
+ In interrupts handlers, also save registers that are usually
+ partially saved, and make sure there is at least one general purpose
+ register saved if a target register needs saving.
+ Add casts in comparisons to avoid warnings.
+ (sh_media_register_for_return): return -1 for interrupt handlers.
+ (MAX_SAVED_REGS, MAX_TEMPS): New defines.
+ (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp
+ registers used are available.
+ Set RTX_FRAME_RELATED_P where appropriate.
+ Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing.
+ (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves.
+ (initial_elimination_offset): Likewise.
+ * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4.
+ (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings.
+ (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO.
+ (XD_REGISTER_P, TARGET_REGISTER_P): Likewise.
+ (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15,
+ and for target registers.
+ (RETURN_IN_MEMORY): Add parentheses to avoid warnings.
+ (regno_reg_class): Make its elements type enum reg_class.
+ (CONSTRAINT_LEN): Don't use isdigit.
+ (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings.
+ (FUNCTION_ARG): Add parentheses to avoid warnings.
+ (RETURN_ADDR_RTX): Use sh_get_pr_initial_val.
+ (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5.
+ (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings.
+ (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings.
+ * sh.md (xordi3+1): Remove unused variable regno.
+ (return_media): Check that tr0 is available before using it.
+
+2003-07-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * c.opt: Document more options.
+
+2003-07-16 Roger Sayle <roger@eyesopen.com>
+
+ * combine.c (subst): Also handle (subreg (const_double ...)) case
+ if created by a substitution, by using the original inner mode.
+
+2003-07-16 Roger Sayle <roger@eyesopen.com>
+
+ * simplify-rtx.c (simplify_replace_rtx): Convert constant comparisons
+ to MODE_FLOAT constants if FLOAT_STORE_FLAG_VALUE is defined.
+ (simplify_rtx): Likewise. Simplify (lo_sum (high X) X) as X.
+
+2003-07-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * doc/install.texi (--without-headers): New.
+
+ Partial Fix PR/10129
+ * config/darwin.c (machopic_function_base_name): Only Return "<pic base>".
+ (machopic_output_function_base_name): New; print the true pic label.
+ (machopic_classify_ident): Pic Base is always a defined data.
+ * config/darwin.h (ASM_OUTPUT_LABELREF): Support the pic base label.
+ * config/darwin-proto.h (machopic_output_function_base_name): Prototype.
+
+ * gcse.c (gcse_constant_p): COMPARE of the same registers is a constant
+ if they are not floating point registers.
+
+ PR c/10962
+ * ggc.h: Add header guards.
+ * c-decl.c (finish_struct): Sort fields if
+ number greater than 15 and there are no
+ anonymous structs/unions.
+ * c-common.h: Include ggc.h.
+ (sorted_fields_type): New struct.
+ (field_decl_cmp): New prototype.
+ (resort_sorted_fields): New prototype.
+ (DECL_DECLARES_TYPE_NON_TEMPLATE_P): New macro.
+ * c-tree.h: (lang_type): Use pointer to sorted_fields_type
+ as s, removing other fields.
+ * c-typeck.c (lookup_field): Use s in lang_type.
+ These were mostly moved from cp/class.c:
+ * c-common.c (field_decl_cmp): New static function.
+ (field_decl_cmp): New function.
+ (resort_sorted_fields): New function.
+
+2003-07-16 Geoffrey Keating <geoffk@apple.com>
+
+ * config/darwin.c (machopic_select_section): Use decl_readonly_section
+ to do most of the work.
+
+2003-07-16 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/mmix/mmix-protos.h: Convert prototypes to ISO C90.
+ * config/mmix/mmix.c: Convert functions to ISO C90.
+ (mmix_eh_return_handler_rtx, mmix_output_shifted_value): Tweak
+ formatting.
+ (mmix_get_hard_reg_initial_val): Tweak section head comment.
+
+2003-07-16 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * c-pragma.h (HANDLE_PRAGMA_WEAK): Always define to SUPPORTS_WEAK.
+
+2003-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ * unwind-dw2.c (MD_FROB_UPDATE_CONTEXT): Define.
+ (uw_update_context_1): Use it.
+ * config/rs6000/rs6000.c (insn_after_throw): Remove.
+ (rs6000_aix_emit_builtin_unwind_init): Save $r2 to its location
+ in parent frame if _Unwind_* called directly instead of through
+ .plt.
+ (rs6000_emit_eh_toc_restore): Remove.
+ (rs6000_emit_prologue): Update stack pointer before doing any saving
+ if current_function_calls_eh_return. Generate unwind info for $r2.
+ (rs6000_emit_epilogue): Restore stack pointer after doing all
+ restoring if current_function_calls_eh_return. Restore $r2.
+ * config/rs6000/rs6000-protos.h (rs6000_emit_eh_toc_restore): Remove.
+ * config/rs6000/rs6000.md (eh_return): Remove call to
+ rs6000_emit_eh_toc_restore.
+ * config/rs6000/linux64.h (MD_FROB_UPDATE_CONTEXT): Define.
+ * config/rs6000/aix.h (MD_FROB_UPDATE_CONTEXT): Define.
+
+2003-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ * expr.c (emit_block_move): Don't move anything if size is const 0.
+ (clear_storage): Test against const0_rtx instead of comparing INTVAL
+ against 0.
+
+2003-07-15 David S. Miller <davem@redhat.com>
+
+ * config/sparc/sparc.c (sparc_nonflat_function_epilogue): Only
+ emit nop if the last real insn is CALL_INSN.
+
+2003-07-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/xm-mingw32.h (HOST_BIT_BUCKET): Define
+ as "nul".
+ * config/i386/xm-mingw32.h: Change GNU CC to GCC.
+
+2003-07-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/winnt.c (associated_type): Artificial methods are not
+ affected by the import/export status of their class unless they are
+ COMDAT.
+ (i386_pe_dllimport_p): Do not mark artificial methods as dllimport.
+
+ * config/i386/winnt.c: Fix GCC copyright comment.
+
+2003-07-16 Gabriel Dos Reis <gcc@integrable-solutions.net>
+
+ PR c++/11531
+ * diagnostic.c (diagnostic_report_diagnostic): Don't ICE if we're
+ not recursing on hard error.
+ (diagnostic_for_decl): Likewise.
+ * diagnostic.def: Rearrange.
+
+2003-07-15 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes):
+ If DWARF_FRAME_RETURN_COLUMN doesn't have a register mode, use Pmode.
+
+2003-07-15 J"orn Rennecke <joern.rennecke@superh.com>
+ Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2.c (_Unwind_GetGR): Use dwarf_reg_size_table
+ to decide if to access a _Unwind_Ptr or a _Unwind_Word.
+ (_Unwind_SetGR): Likewise.
+ (_Unwind_GetPtr, _Unwind_SetSpColumn): New functions.
+ (Unwind_SpTmp): New typedef.
+ (uw_update_context_1): Use _Unwind_SetSpColumn and _Unwind_GetPtr.
+ (uw_update_context): Use _Unwind_GetPtr.
+ (init_dwarf_reg_size_table): Move above uw_init_context_1.
+ (uw_init_context_1): Initialize dwarf_reg_size_table if necessary.
+ Use _Unwind_SetSpColumn.
+ (uw_install_context_1): Don't initialize dwarf_reg_size_table.
+ Use _Unwind_GetPtr.
+
+2003-07-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * c.opt: Document more options.
+ * toplev.c (documented_lang_options): Remove all local help strings.
+
+2003-07-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/11473
+ * dbxout.c (dbxout_type): Use TYPE_SIZE to determine the sizes of
+ base classes.
+
+2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/10795
+ * config/i386/i386.c (ix86_expand_carry_flag_compare): Don't
+ swap comparison operands if doing so would generate an
+ unrecognizable insn.
+
+2003-07-15 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11320
+ * sched-int.h (struct deps) [reg_conditional_sets]: New field.
+ (struct sched_info) [compute_jump_reg_dependencies]: New prototype.
+ * sched-deps.c (sched_analyze_insn) [JUMP_INSN]: Update call to
+ current_sched_info->compute_jump_reg_dependencies. Record which
+ registers are used and which registers are set by the jump.
+ Clear deps->reg_conditional_sets after a barrier.
+ Set deps->reg_conditional_sets if the insn is a COND_EXEC.
+ Clear deps->reg_conditional_sets if the insn is not a COND_EXEC.
+ (init_deps): Initialize reg_conditional_sets.
+ (free_deps): Clear reg_conditional_sets.
+ * sched-ebb.c (compute_jump_reg_dependencies): New prototype.
+ Mark registers live on entry of the fallthrough block and conditionally
+ set as set by the jump. Mark registers live on entry of non-fallthrough
+ blocks as used by the jump.
+ * sched-rgn.c (compute_jump_reg_dependencies): New prototype.
+ Mark new parameters as unused.
+
+2003-07-15 Richard Sandiford <rsandifo@redhat.com>
+
+ * doc/invoke.texi: Resync MIPS -march documentation.
+
+2003-07-15 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (PROCESSOR_R9000): New processor_type.
+ (TARGET_MIPS9000, TUNE_MIPS9000): New macros.
+ (GENERATE_MULT3_SI): True for TARGET_MIPS9000.
+ * config/mips/mips.c (mips_cpu_info_table): Add rm9000 entry.
+ (mips_rtx_costs): Adjust integer multiplication costs for the rm9000.
+ (mips_issue_rate): Handle PROCESSOR_R9000.
+ (mips_use_dfa_pipeline_interface): Likewise.
+ * config/mips/9000.md: New file.
+ * config/mips/mips.md: Include it.
+ (define_attr cpu): Add r9000.
+ (mulsi3_mult3): Use "mul" for rm9000 code.
+
+2003-07-15 Stan Cox <scox@redhat.com>
+
+ * config/mips/mips.h (PROCESSOR_R7000): New processor_type.
+ (TARGET_MIPS7000, TUNE_MIPS7000): New macros.
+ (GENERATE_MULT3_SI): True for TARGET_MIPS7000.
+ * config/mips/mips.c (mips_cpu_info_table): Add rm7000 entry.
+ (mips_rtx_costs): Adjust integer multiplication costs for the rm7000.
+ (mips_issue_rate): Handle PROCESSOR_R7000.
+ (mips_use_dfa_pipeline_interface): Likewise.
+ * config/mips/7000.md: New file.
+ * config/mips/mips.md: Include it.
+ (define_attr cpu): Add r7000.
+ (mulsi3_mult3): Use "mul" for rm7000 code.
+
+2003-07-15 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (define_attr type): Add condmove. Use it for
+ the conditional move patterns.
+ * config/mips/5400.md (ir_vr54_move): Rename to ir_vr54_condmove.
+ Check for condmove type.
+ (ir_vr54_arith): Add move type.
+ * config/mips/5500.md (ir_vr55_move, ir_vr55_arith): Likewise.
+ * config/mips/sr71k.md (ir_sr70_move, ir_sr70_arith): Likewise.
+
+2003-07-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (print_help): Remove.
+ (c_common_handle_option): Don't handle --help.
+ * c.opt: Document some options.
+ (--help): Remove.
+ * opts.c (print_filtered_help): New.
+ (print_help): Use it.
+
+2003-07-14 Geoffrey Keating <geoffk@apple.com>
+
+ * c-common.c (c_common_type_for_mode): Handle V4DFmode.
+ * tree.c: (build_common_tree_nodes_2): Likewise.
+ * tree.h (enum tree_index): Add TI_V4DF_TYPE.
+ (V4DF_type_node): New.
+
+ * c-opts.c (push_command_line_include): Don't free deferred_opts,
+ we'll need it.
+ (finish_options): Reset init_cursor.
+
+2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * expr.c (expand_assignment): Remove an unused argument
+ SUGGEST_REG.
+ * expr.h: Update the prototype.
+ * function.c: Update the callers.
+ * stmt.c: Likewise.
+
+2003-07-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/11098
+ * integrate.c (copy_decl_for_inlining): Do not mark copied decls
+ as DECL_ABSTRACT.
+
+2003-07-14 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (avoid_bool_define, avoid_bool_type): Bypass
+ with __cplusplus, not "we must use the C++ compiler's type"
+ * fixinc/inclhack.def (void_null): Note that Interix needs this.
+ * fixinc/fixincl.x: Regenerate.
+
+2003-07-14 Geoffrey Keating <geoffk@apple.com>
+
+ * unwind-dw2-fde-darwin.c (live_image_destructor): Get seen_objects
+ and unseen_objects from the global data before calling
+ __deregister_frame_info_bases.
+ (examine_objects): Insert objects into the seen_objects list,
+ not unseen_objects.
+ (_Unwind_Find_FDE): Always unlock the global object lists, even if
+ we couldn't allocate a data structure to put in it.
+
+ * objc/objc-act.h (CLASS_SUPER_NAME): Add a little typechecking.
+ (TYPE_PROTOCOL_LIST): Share use of type.context with C frontend.
+ (SET_TYPE_PROTOCOL_LIST): New.
+ * objc/objc-act.c (get_static_reference): Use SET_TYPE_PROTOCOL_LIST.
+ (get_object_reference): Likewise.
+
+2003-07-14 Jan Hubicka <jh@suse.cz>
+
+ * cfglayout.c (locator_file): Break out from ....
+ (insn_file): ... here.
+ (locator_line): Break out from ....
+ (insn_line): ... here.
+ * rtl.h (locator_file, locator_line): Declare.
+ (final_start_function): Set proper line/file info.
+
+2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-pretty-print.c (pp_c_unary_expression): A CONVERT_EXPR is
+ handled by pp_c_cast_expression.
+
+2003-07-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_expand_prologue): Use a single insn to
+ allocate 32768 bytes of stack. Use addition rather than subtraction
+ when a single insn is enough.
+ * config/mips/mips.md: Remove insns and splitters for subtracting
+ constants.
+ (subsi3): Only accept register operands.
+ (subsi3_internal): Likewise. Use for TARGET_MIPS16 as well.
+ (subdi3_internal_3, subsi3_internal_2): Likewise.
+ (casesi): Use expand_binop to subtract the lower bound.
+
+2003-07-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_in_small_data_p): Don't handle
+ TARGET_MIPS16 specially.
+
+2003-07-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Use
+ mips_output_aligned_bss.
+ * config/mips/linux.h: Likewise.
+ * config/mips/mips-protos.h (mips_output_aligned_bss): Declare.
+ * config/mips/mips.c (mips_output_aligned_bss): New function.
+
+ * config/mips/elf.h (DBX_DEBUGGING_INFO): Delete.
+ * config/mips/elf64.h: Likewise.
+
+ * config/mips/elf.h (ASM_DECLARE_OBJECT_NAME): Use
+ mips_declare_object_name.
+ (ASM_FINISH_DECLARE_OBJECT): Likewise mips_finish_declare_object.
+ * config/mips/elf64.h: As for elf.h.
+ * config/mips/iris6.h: Likewise.
+ * config/mips/linux.h (ASM_DECLARE_OBJECT_NAME): As for elf.h.
+ * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Remove unnecessary
+ do...while (0) block.
+ * config/mips/mips-protos.h (mips_declare_object_name): Declare.
+ (mips_finish_declare_object): Declare.
+ * config/mips/mips.c (mips_declare_object_name): New function.
+ (mips_finish_declare_object): New function.
+
+ * config/mips/elf.h (SBSS_SECTION_ASM_OP): Delete.
+ * config/mips/linux.h: Likewise.
+
+ * config/mips/mips.c (inside_function): Delete.
+ (file_in_function_warning, ignore_line_number): Delete.
+ (mips_output_filename): Don't warn about changing filenames within
+ a function.
+ (mips_output_lineno): Update accordingly.
+ (mips_output_function_prologue): Don't reset the deleted variables.
+ * config/mips/mips.h (inside_function): Delete.
+ (file_in_function_warning, ignore_line_number): Delete.
+
+ * config/mips/elf.h (OBJECT_FORMAT_COFF, EXTENDED_COFF): Remove undefs.
+ * config/mips/elf64.h: Likewise.
+ * config/mips/openbsd.h: Likewise.
+ * config/mips/iris5.h (OBJECT_FORMAT_COFF): Remove undefs.
+ * config/mips/linux.h: Likewise.
+ * config/mips/mips.h (OBJECT_FORMAT_COFF, EXTENDED_COFF): Delete.
+ (CODE_MASK, MIPS_IS_STAB, MIPS_MARK_STAB, MIPS_UNMARK_STAB): Delete.
+
+ * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Add mips/sdb.h
+ to the list of include files when using gas.
+ (mips*el-*-openbsd*, mips*-*-openbsd*): Add mips/sdb.h unconditionally.
+ * config/mips/elf.h: Remove #undef SDB_DEBUGGING_INFO.
+ * config/mips/elf64.h: Likewise.
+ * config/mips/iris5.h: Likewise.
+ * config/mips/linux.h: Likewise.
+ * config/mips/iris5gas.h (SDB_DEBUGGING_INFO): Remove definition.
+ * config/mips/mips.h (PREFERRED_DEBUGGING_TYPE): Likewise.
+ (SDB_DEBUGGING_INFO, sdb*, SDB_ALLOW_*, PUT_SDB*): Move to...
+ * config/mips/sdb.h: ...this new file.
+
+2003-07-14 Douglas Rupp <rupp@gnat.com>
+
+ * fixinc/server.c (server_setup): Don't use non-POSIX NULL first
+ argument to getcwd; use fixed buffer instead.
+
+2003-07-14 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/mkfixinc.sh: Treat OpenBSD normally.
+ * fixinc/fixinc.wrap: Delete.
+
+2003-07-14 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * ggc-page.c (extra_order_size_table): Insns have 9 slots. Regs
+ don't have 2.
+
+2003-07-14 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * ggc-page.c (struct globals): Add new fields to keep track of the
+ total allocated memory and overhead.
+ (ggc_print_statistics): Print them.
+ (ggc_alloc): Keep track of the total allocated memory and the
+ overhead.
+
+ * tree.c (dump_tree_statistics): Increase spacing.
+ (enum tree_node_kind): Move to ...
+ * tree.h (enum tree_node_kind): ... here.
+ (tree_node_counts, tree_node_sizes): Declare.
+
+2003-07-14 James A. Morrison <ja2morri@student.math.uwaterloo.ca>
+
+ * doc/include/texinfo.tex: Upgrade to texinfo 4.6.
+
+2003-07-14 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR optimization/11440
+ * gcse.c (try_replace_reg): Don't attach notes to ZERO_EXTRACT or
+ SIGN_EXTRACT SETs.
+
+2003-07-14 Alan Modra <amodra@bigpond.net.au>
+
+ * doc/tm.texi (BLOCK_REG_PADDING): Describe.
+ * expr.h (struct locate_and_pad_arg_data): Add where_pad.
+ (emit_group_load, emit_group_store): Adjust declarations.
+ Remove most occurrences of #ifdef TREE_CODE.
+ * expr.c (emit_group_load): Add "type" param, and use
+ BLOCK_REG_PADDING to determine need for a shift. Optimize non-
+ aligned accesses if !SLOW_UNALIGNED_ACCESS.
+ (emit_group_store): Likewise.
+ (emit_push_insn, expand_assignment, store_expr, expand_expr): Adjust
+ emit_group_load and emit_group_store calls.
+ * calls.c (store_unaligned_arguments_into_pseudos): Tidy. Use
+ BLOCK_REG_PADDING to determine whether we need endian_correction.
+ (load_register_parameters): Localize vars. Handle shifting of
+ small values to the correct end of regs. Adjust emit_group_load
+ call.
+ (expand_call, emit_library_call_value_1): Adjust emit_group_load
+ and emit_group_store calls.
+ * function.c (assign_parms): Set mem alignment for stack slots.
+ Adjust emit_group_store call. Store values at the "wrong" end
+ of regs to the stack. Use BLOCK_REG_PADDING.
+ (locate_and_pad_parm): Save where_pad.
+ (expand_function_end): Adjust emit_group_load call.
+ * stmt.c (expand_value_return): Adjust emit_group_load call.
+ * Makefile.in (calls.o): Depend on $(OPTABS_H).
+ * config/rs6000/linux64.h (TARGET_LITTLE_ENDIAN): Redefine as 0.
+ (AGGREGATE_PADDING_FIXED, AGGREGATES_PAD_UPWARD_ALWAYS): Define.
+ (MUST_PASS_IN_STACK): Define.
+ (BLOCK_REG_PADDING): Define.
+ * config/rs6000/rs6000.h (struct rs6000_args): Remove orig_nargs.
+ (PAD_VARARGS_DOWN): Define in terms of FUNCTION_ARG_PADDING.
+ * config/rs6000/rs6000.c (init_cumulative_args): Don't set orig_nargs.
+ (function_arg_padding): !AGGREGATE_PADDING_FIXED compatibility code.
+ Act on AGGREGATES_PAD_UPWARD_ALWAYS.
+
+2003-07-13 Aaron W. LaFramboise <awlaframboise@aol.com>
+
+ * config/i386/gthr-win32.c (__GTHREAD_HIDE_WIN32API): Define to 1.
+
+2003-07-13 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * expr.c (expand_expr, case COMPONENT_REF): If reg, copy OP0 to MEM
+ both if OFFSET specified and if result BLKmode for ARRAY_RANGE_REF.
+
+2003-07-13 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR other/11123
+ * toplev.c: Don't cut off option names.
+
+2003-07-13 Andreas Jaeger <aj@suse.de>
+
+ * c-decl.c (link_hash_hash): Avoid warning about casting pointer
+ to integer of different size.
+
+2003-07-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (simplify_comparison): Convert (ne (and (not X) 1) 0)
+ to (eq (and X 1) 0).
+
+2003-07-13 Andreas Jaeger <aj@suse.de>
+
+ * config.gcc: Add pmmintrin.h for x86_64-*-*.
+
+2003-07-13 Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H).
+ (hashtable.o, line-map.o, mkdeps.o): Likewise, from dependency
+ list. Move these all together down by cpplib.
+
+ * cpplib.h: Don't refer to MAX_WCHAR_TYPE_SIZE when determining
+ definition of CPPCHAR_SIGNED_T.
+
+ * cppcharset.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c
+ * cpplex.c, cpplib.c, cppmacro.c, cpppch.c, cpptrad.c, hashtable.c
+ * line-map.c, mkdeps.c: Don't include coretypes.h or tm.h.
+
+ * cpphash.c (_cpp_init_hashtable): Don't use gcc_obstack_init.
+ * cppinit.c (cpp_create_reader): Likewise.
+
+ * cpphash.h (scan_out_logical_line): Rename _cpp_scan_out_logical_line.
+ * cpptrad.c: Likewise. All callers changed.
+ * cpplib.c: All callers changed.
+ * c-ppoutput.c: Replace 'uchar' with 'unsigned char' throughout.
+ * hashtable.h: Define GTY(x) to nothing here too.
+
+2003-07-13 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * stor-layout.c (compute_record_mode): Remove very obsolete test
+ that forces BLKmode for records with fields crossing word boundary.
+
+2003-07-13 Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in: Remove orphan reference to acconfig.h.
+
+2003-07-13 Andreas Jaeger <aj@suse.de>
+
+ * cgraphunit.c: Convert prototypes to ISO C90.
+
+2003-07-13 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (avoid_wchar_t_type): Use __cplusplus bypass
+ (for OpenBSD).
+ * fixinc/fixincl.x: Rebuild.
+
+2003-07-12 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.in: Always define HAVE_AS_GOTOFF_IN_DATA for
+ i?86-*-*. Use correct name of cache variable.
+ * configure: Regenerate.
+
+2003-07-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/alpha/alpha.c: Fix comment typos.
+ * config/alpha/alpha.md: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/arm/arm.md: Likewise.
+ * config/arm/lib1funcs.asm: Likewise.
+ * config/avr/avr.md: Likewise.
+ * config/arm/README-interworking: Fix typos.
+
+2003-07-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * c-format.c: Fix comment formatting.
+ * c-typeck.c: Likewise.
+ * coverage.c: Likewise.
+ * cppcharset.c: Likewise.
+ * cpplib.c: Likewise.
+ * dbxout.c: Likewise.
+ * gcov-io.h: Likewise.
+ * toplev.c: Likewise.
+
+2003-07-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (alpha_sbrk): Note that OpenBSD needs this
+ fix.
+
+2003-07-12 Zack Weinberg <zack@codesourcery.com>
+
+ * aclocal.m4 (gcc_AC_CHECK_TYPE): Clone of AC_CHECK_TYPE,
+ uses three-argument AC_DEFINE so no acconfig.h entries are
+ needed.
+ (_gcc_COMPUTE_GAS_VERSION): Also provide gcc_cv_gas_vers
+ which contains the GAS version number as a scaled integer.
+ (gcc_GAS_VERSION_GTE_IFELSE): Use gcc_cv_gas_vers. Add
+ ability to check for ELF assembler.
+ (gcc_GAS_CHECK_FEATURE): New macro.
+ * configure.in: Use gcc_AC_CHECK_TYPE. Rewrite all
+ assembler feature checks using gcc_GAS_CHECK_FEATURE.
+ Use three-argument AC_DEFINE everywhere.
+ * acconfig.h: Deleted.
+ * config.in, configure: Regenerate.
+
+2003-07-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/inclhack.def (struct_sockaddr): Avoid "fixing" sockaddr_in
+ (on OpenBSD).
+ * fixinc/fixincl.x: Regenerate.
+
+ * fixinc/inclhack.def (gnu_types): Improve comment.
+
+2003-07-12 Andreas Jaeger <aj@suse.de>
+
+ * fp-test.c (main): Use ISO C90 prototype.
+
+ * version.c: Remove unneded include of ansidecl.h.
+
+ * cgraph.h: Convert prototypes to ISO C90.
+ * cgraph.c: Likewise.
+ * fix-header.c: Likewise.
+ * ra.h: Likewise.
+ * protoize.c: Likewise.
+
+2003-07-12 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (cgraph_inlined_into, cgraph_inlined_calees): Fix
+ warning.
+
+2003-07-12 Jan Hubicka <jh@suse.cz>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * cgraph.c (cgraph_max_uid): New global variable.
+ (cgraph_node): Set uid field.
+ (create_edge): Keep inline flags consistent.
+ (dump_cgraph): Dump more info.
+ * cgraph.h (struct cgraph_local_info): Remove inline_many and
+ can_inline_once; add inlinable, disgread_inline_limits, and self_insn
+ (struct cgraph_global_info): Add insns, calls, cloned_times,
+ will_be_output.
+ (struct cgraph_node): Add uid.
+ (struct cgraph_edge): Add inline_call.
+ (cgraph_max_uid, cgraph_inline_p): Declare.
+ * cgraph.c: Include params.h and fibheap.h
+ (cgraph_mark_functions_to_inline_once): Kill.
+ (INSNS_PER_CALL): New constant.
+ (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New
+ static variables.
+ (cgraph_finalize_function): Do not analyze inlining.
+ (cgraph_finalize_compilation_unit): Set inlining attributes.
+ (cgraph_mark_functions_to_output): More consistency checks.
+ (cgraph_optimize_function): Set current_function_decl to NULL.
+ (cgraph_expand_function): Use new inline flags.
+ (cgraph_postorder): Expand from cgraph_expand_functions.
+ (INLINED_TIMES, SET_INLINED_TIMES): New macros.
+ (cgraph_inlined_into, cgraph_inlined_callees,
+ cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
+ cgraph_mark_inline, cgraph_check_inline_limits,
+ cgraph_default_inline_p, cgraph_decide_inling_of_small_functions,
+ cgraph_decide_inlining, cgraph_inline_p): New functions.
+ * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH,
+ PARAM_INLINE_UNIT_GROWTH): New parameters.
+ * tree-inline.c (struct inline_data): New field current_decl.
+ (expand_call_inline): Avoid forward declarations; use
+ inlinable_function_p.
+ (optimize_inline_calls): Set id.current_decl.
+
+2003-07-11 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * configure.in: Remove wrongly added definition of
+ local_prefix.
+ * configure: Regenerate.
+
+2003-07-11 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * rtl.def (NOTE): Do not use padding.
+
+2003-07-11 Dara Hazeghi <dhazeghi@yahoo.com>
+
+ * doc/install.tex: Update required binutils for i?86-*-linux*
+
+2003-07-11 Richard Henderson <rth@redhat.com>
+
+ * Makefile.in (stage1_build): Force OBJS-onestep=OBJS.
+
+2003-07-11 Mark Mitchell <mark@codesourcery.com>
+
+ * varasm.c (make_decl_rtl): Treat decls with a DECL_CONTEXT of
+ TRANSLATION_UNIT_DECL as top_level.
+
+2003-07-11 Jakub Jelinek <jakub@redhat.com>
+
+ * optabs.c (prepare_cmp_insn): Try cmpmemM first if it exists,
+ then fall back to cmpstrM.
+ * builtins.c (expand_builtin_memcmp): Likewise.
+ * config/s390/s390-protos.h (s390_expand_cmpstr): Rename to...
+ (s390_expand_cmpmem): ... this.
+ * config/s390/s390.md (cmpmemdi, cmpmemsi, cmpmem_short_64,
+ cmpmem_short_31, cmpmem_long_64, cmpmem_long_31): Renamed
+ from cmpstr* patterns. Rename call to s390_expand_cmpstr
+ to s390_expand_cmpmem.
+ * config/s390/s390.c (s390_expand_cmpstr): Rename to...
+ (s390_expand_cmpstr): ... this. Rename cmpstr* instructions
+ to cmpmem*.
+ * config/i370/i370.md (cmpmemsi, cmpmemsi_1): Renamed from
+ cmpstr* patterns.
+ * doc/md.texi (cmpstrM): Describe as String compare insn, not
+ Block compare insn.
+ (cmpmemM): Add.
+
+2003-07-11 Loren James Rittle <ljrittle@acm.org>
+
+ * config/i386/freebsd.h (SET_ASM_OP): Remove.
+ (SUBTARGET_OVERRIDE_OPTIONS): Handle TARGET_64BIT case.
+ (ASM_COMMENT_START, ASM_APP_ON, ASM_APP_OFF, DBX_REGISTER_NUMBER
+ MCOUNT_NAME, SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE_SIZE): Whitespace.
+
+2003-07-11 Richard Henderson <rth@redhat.com>
+
+ * function.c (assign_parms): Don't recombine complex args if
+ fnargs is unchanged from orig_fnargs.
+ (split_complex_args): Return args without complex before copying.
+ Re-layout the modified parameters.
+
+2003-07-11 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * regclass.c (choose_hard_reg_mode): Add third argument.
+ Changed all callers.
+ * rtl.h (choose_hard_reg_mode): Update declaration.
+ * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes):
+ Take HARD_REGNO_CALL_PART_CLOBBERED into account.
+
+2003-07-11 Geoffrey Keating <geoffk@apple.com>
+
+ * c-decl.c (finish_decl): Handle 'used' here...
+ * cgraphunit.c (cgraph_finalize_function): ... and here ...
+ * c-common.c: (handle_used_attribute): ... not here.
+
+ * configure.in (onstep): Support --enable-intermodule.
+ * Makefile.in (OBJS-common): New.
+ (OBJS-md): New.
+ (OBJS-archive): New.
+ (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive.
+ (OBJS-onestep): New.
+ (libbackend.a): Support @onestep@.
+ (libbackend.o): New.
+ * configure: Regenerate.
+
+ * c-common.h (c_reset_state): New prototype.
+ (c_parse_file): New prototype.
+ (finish_file): Move prototype from c-tree.h.
+ * c-decl.c: Include <hashtab.h>.
+ (builtin_decls): New.
+ (current_file_decl): New.
+ (duplicate_decls): Add extra parameter. Change all callers. Don't
+ output duplicate common symbols.
+ (link_hash_hash): New.
+ (link_hash_eq): New.
+ (poplevel): Handle popping of the top level.
+ (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL.
+ (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate.
+ (pushdecl_top_level): Likewise.
+ (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL.
+ (c_init_decl_processing): Create TRANSLATION_UNIT_DECL.
+ (finish_decl): Handle TRANSLATION_UNIT_DECL.
+ (merge_translation_unit_decls): New.
+ (c_write_global_declarations): New.
+ (c_reset_state): New.
+ (implicitly_declare): Handle TRANSLATION_UNIT_DECL.
+ * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New.
+ * c-objc-common.c (c_cannot_inline_tree_fn): Handle
+ TRANSLATION_UNIT_DECL.
+ (c_objc_common_finish_file): Call merge_translation_unit_decls.
+ * c-opts.c (in_fnames): Rename from in_fname.
+ (c_common_decode_option): Handle multiple input filenames.
+ (c_common_post_options): Likewise.
+ (c_common_parse_file): Likewise; also, call c_parse_file rather than
+ yyparse.
+ * c-parse.in: Move cleanup code to c_parse_file.
+ (free_parser_stacks): Move contents to c_parse_file.
+ (c_parse_file): New.
+ * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT
+ for integer types.
+ (C_DECL_FILE_SCOPE): New.
+ (finish_file): Move prototype to c-common.h.
+ (merge_translation_unit_decls): New prototype.
+ (comptypes): Add extra parameter to prototype.
+ (c_write_global_declarations): New prototype.
+ * c-typeck.c (tagged_types_tu_compatible_p): New.
+ (function_types_compatible_p): Add extra parameter, change all callers.
+ (type_lists_compatible_p): Likewise.
+ (comptypes): Likewise.
+ (struct tagged_tu_seen): New.
+ (tagged_tu_seen_base): New.
+ (build_unary_op): Handle TRANSLATION_UNIT_DECL.
+ (c_mark_addressable): Remove #if 0 code.
+ * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add
+ comment explaining why it shouldn't have to.
+ * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY
+ options.
+ * cppinit.c (cpp_read_next_file): New.
+ (cpp_read_main_file): Use it.
+ * cpplib.c (undefine_macros): New.
+ (cpp_undef_all): New.
+ * cpplib.h (cpp_read_next_file): Prototype.
+ (cpp_undef_all): Prototype.
+ * langhooks-def.h (write_global_declarations): Remove prototype.
+ * toplev.h (write_global_declarations): Add prototype.
+ * tree.c (decl_type_context): Use switch statement, handle
+ TRANSLATION_UNIT_DECL.
+ * tree.def: Update documentation for TRANSLATION_UNIT_DECL.
+ (TRANSLATION_UNIT_DECL): New kind of tree.
+ * tree.h: Update documentation for TRANSLATION_UNIT_DECL.
+ * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies.
+ * doc/invoke.texi: Make attempt to document new functionality.
+
+ 2003-05-19 Per Bothner <bothner@apple.com>
+
+ * gcc.c (combine_inputs): New.
+ (process_command): Set combine_inputs.
+ (do_spec_1): Handle combine_inputs.
+ (main): Likewise.
+
+2003-07-10 James E Wilson <wilson@tuliptree.org>
+
+ PR optimization/9745
+ * loop.c (loop_iv_add_mult_emit_before): Call loop_regs_update before
+ loop_insn_emit_before.
+ (loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise.
+
+2003-07-10 Zack Weinberg <zack@codesourcery.com>
+
+ * cppcharset.c: Fix comment.
+ (iconv_close [!HAVE_ICONV]): #define to (void)0 to prevent warning.
+ (EILSEQ): #define to EINVAL if not already defined.
+ (convert_using_iconv): #if out when !HAVE_ICONV.
+ (init_iconv_desc): Handle !HAVE_ICONV here...
+ (cpp_init_iconv): ...not here.
+
+2003-07-11 Neil Booth <neil@daikokuya.co.uk>
+
+ * common.opt: More --help messages.
+ * opts.c (print_help): Use puts().
+ * toplev.c (f_options): Remove help text.
+ (display_help): Don't dump f_options.
+
+2003-07-11 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/mkfixinc.sh: Drop reference to unsupported alpha-*-interix*.
+ Move i?86-*-interix* to the don't-fix list.
+ * fixinc/fixinc.interix: Delete with extreme prejudice.
+
+2003-07-10 Dara Hazeghi <dhazeghi@yahoo.com>
+
+ PR bootstrap/10758
+ * doc/install.texi: Document requirements for ia64-*-hpux* target.
+
+2003-07-10 Roger Sayle <roger@eyesopen.com>
+
+ * config/ia64/hpux.h (TARGET_C99_FUNCTIONS): Define.
+
+2003-07-10 Zack Weinberg <zack@codesourcery.com>
+
+ * cppcharset.c (one_utf8_to_cppchar, one_cppchar_to_utf8,
+ one_utf8_to_utf32, one_utf32_to_utf8, one_utf8_to_utf16,
+ one_utf16_to_utf8, conversion_loop, convert_utf8_utf16,
+ convert_utf8_utf32, convert_utf16_utf8, convert_utf32_utf8,
+ convert_no_conversion, convert_using_iconv): New functions.
+ (APPLY_CONVERSION): New macro.
+ (struct conversion, conversion_tab): New data structure.
+ (init_iconv_desc): Check conversion_tab for a custom conversion
+ primitive before trying to use iconv.
+ (convert_cset): Deleted.
+ (cpp_init_iconv): Use UTF- terminology, not UCS-.
+ (_cpp_destroy_iconv): Update to match.
+ (_cpp_valid_ucn): We don't need iconv to implement UCNs.
+ (convert_ucn): Use one_cppchar_to_utf8 and APPLY_CONVERSION.
+ (convert_escape, cpp_interpret_string): Use APPLY_CONVERSION.
+ (_cpp_interpret_string_notranslate): New function, moved here
+ from cpplib.c.
+
+ * cpphash.h (convert_f, struct cset_converter): New types.
+ (struct cpp_reader): narrow_cset_desc and wide_cset_desc
+ are now struct cset_converter, not bare iconv_t.
+ Update prototypes.
+ * cpplib.c (interpret_string_notranslate): Moved to cppcharset.c;
+ all callers changed.
+
+2003-07-10 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * Makefile.in (options.h): Depend on Makefile. Add move-if-change
+ to opts.sh command line.
+ * opts.sh: Write to temporary files with a move-if-change at the end.
+
+2003-07-10 Denis Chertykov <denisc@overta.ru>
+ Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * combine.c (gen_binary): Handle the CLOBBER rtx and
+ don't build a binary operation with it.
+
+2003-07-10 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcse.c (load_kills_store, find_loads, store_killed_in_insn,
+ store_killed_after, store_killed_before): Keep track of the correct
+ dependency function to use.
+
+2003-07-10 Steven Bosscher <steven@gcc.gnu.org>
+ * toplev.c (do_compile): Don't try to open dump files before
+ lang_dependent_init initializes dump_base_name.
+
+2003-07-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/arm/arm.c (arm_init_iwmmxt_builtins, arm_expand_builtin):
+ Use ARRAY_SIZE.
+ * config/frv/frv.c (frv_expand_builtin): Likewise.
+ * config/sh/sh.c (sh_media_init_builtins): Likewise.
+
+2003-07-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10032
+ * doc/invoke.texi (C++ Dialect Options): Change documentation of
+ -fpermissive.
+
+2003-07-10 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * tm.texi (RETURN_ADDR_OFFSET): Document.
+
+2003-07-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov-io.h: Update documentation.
+ (GCOV_UNSIGNED2STRING): New.
+ (GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH,
+ GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH,
+ GCOV_TAG_SUMMARY_LENGTH): Adjust.
+ (GCOV_TAG_BLOCKS_NUM, GCOV_TAG_ARCS_NUM,
+ GCOV_TAG_COUNTER_NUM): New.
+ (GCOV_BLOCK_SIZE): Number of words.
+ (gcov_var): Adjust buffer type.
+ * gcov-io.c (gcov_write_bytes, gcov_read_bytes): Rename to ...
+ (gcov_write_words, gcov_read_words): ... here. Take a 4-byte word
+ count, not byte count.
+ (gcov_open): Adjust overread init.
+ (gcov_allocate, gcov_write_unsigned, gcov_write_counter,
+ gcov_write_string, gcov_write_tag, gcov_write_length,
+ gcov_write_tag_length): Adjust.
+ (gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust.
+ (gcov_sync, gcov_seek): Adjust.
+ * gcov-dump.c (print_usage): Show gcc version only.
+ (dump_file): Use GCOV_UNSIGNED2STRING.
+ (tag_blocks, tag_arcs, tag_counters): Use GCOV_TAG_*_NUM macros.
+ * gcov.c (print_version): Show gcc version only.
+ (read_graph_file): Use GCOV_UNSIGNED2STRING. Use
+ GCOV_TAG_*_NUM macros.
+ (read_count_file): Use GCOV_UNSIGNED2STRING. Use
+ GCOV_TAG_COUNTER_LENGTH.
+ * coverage.c (read_counts_file): Use GCOV_UNSIGNED2STRING.
+ Use GCOV_TAG_COUNTER_NUM.
+ * libgcov.c (gcov_version): Use GCOV_UNSIGNED2STRING.
+ (__gcov_merge_single, __gcov_merge_delta): Use GCOV_CHECK.
+
+2003-07-10 Andreas Schwab <schwab@suse.de>
+
+ * gcov-dump.c (dump_file): Fix missing address operator.
+
+2003-07-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR c/11449
+ * fold-const.c (sign_bit_p): Return EXP if VAL is the sign bit
+ of HOST_WIDE_INT.
+ (fold_single_bit_test): If sign_bit_p() fails, assume that the
+ bit being tested is not a sign bit.
+
+2003-07-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-07-10 Alexandre Oliva <aoliva@redhat.com>
+
+ 2001-12-13 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/linux.h (LINK_SPEC): Rename the dynamic linker
+ from ld-linux.so.2 to ld.so.1.
+ 2001-11-18 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/linux.h (LINK_SPEC): -lpthread, not -lthread.
+ * config/mn10300/linux.h (LINK_SPEC): Don't handle -Wl,-rpath
+ nor -Wl,-rpath-link.
+ (LIB_SPEC): Add -rpath-link if !static.
+ 2001-08-22 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.c (mn10300_protect_label): New
+ variable.
+ * config/mn10300/linux.h (PRINT_OPERAND,
+ PRINT_OPERAND_ADDRESS): Set it during their execution.
+ (ASM_OUTPUT_LABELREF): Output `+' before symbol name if
+ mn10300_protect_label is set.
+ * config/mn10300/linux.h (LINK_SPEC): Recognize -Wl,-rpath and
+ -Wl,-rpath-link.
+ (LIB_SPEC, STARTFILE_SPEC): Define.
+ 2001-05-11 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/t-linux (dp-bit.c, fp-bit.c): Don't define
+ FLOAT_BIT_ORDER_MISMATCH.
+ 2001-05-09 Alexandre Oliva <aoliva@redhat.com>
+ * config.gcc (am33_2.0-*-linux*): Added.
+ * config/mn10300/linux.h: New.
+ * config/mn10300/t-linux: New.
+
+2003-07-10 Andreas Jaeger <aj@suse.de>
+
+ * fold-const.c: Properly wrap prototypes.
+
+2003-07-09 Alexandre Oliva <aoliva@redhat.com>
+
+ 2003-06-16 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.c (mn10300_unspec_int_label_counter):
+ Moved from...
+ * config/mn10300/mn10300.md (GOTaddr2picreg): ... here.
+ * config/mn10300/mn10300.h: GTY-declare it.
+ 2003-06-11 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.c (mn10300_encode_section_info): Fix
+ prototype. Use incoming RTL argument.
+ 2002-12-12 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.md (int_label): Move C statements...
+ (GOTaddr2picreg): ... here.
+ 2002-08-15 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.h (ENCODE_SECTION_INFO): Move...
+ * config/mn10300/mn10300.c (mn10300_encode_section_info):
+ ... here. New function.
+ (TARGET_ENCODE_SECTION_INFO): Define to it.
+ 2001-11-04 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.md (builtin_setjmp_receiver): Fix typo in
+ pattern name.
+ (mn10300_loadPC): Define as insn splittable after reload.
+ 2001-05-13 Alexandre Oliva <aoliva@redhat.com>
+ * config/sh/mn10300.h (JUMP_TABLES_IN_TEXT_SECTION): Let them
+ be defined in .rodata even in PIC, now that the assembler
+ supports that.
+ 2001-05-09 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.h (GOT_SYMBOL_NAME): Don't let the
+ symbol take an underscore prefix.
+ 2001-04-14 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300-protos.h (legitimate_pic_operand_p,
+ legitimize_pic_address): Declare.
+ * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Mark
+ the PIC register as fixed.
+ (EXTRA_CONSTRAINT): Match UNSPEC_PLT and UNSPEC_PIC for 'S'.
+ (GO_IF_LEGITIMATE_ADDRESS): Require legitimate_pic_operand for
+ PIC.
+ (LEGITIMATE_PIC_OPERAND_P): Define.
+ (PIC_OFFSET_TABLE_REGNUM): Define.
+ (GOT_SYMBOL_NAME): Define.
+ (SYMBOLIC_CONST_P): Define.
+ (ENCODE_SECTION_INFO): Use SYMBOL_REF_FLAG to mark local
+ symbols.
+ (MN10300_GLOBAL_P): Test it.
+ (OUTPUT_ADDR_CONST_EXTRA): Handle PIC-related unspecs.
+ (JUMP_TABLES_IN_TEXT_SECTION): Enable for PIC.
+ * config/mn10300/mn10300.c (print_operand): Handle unspec.
+ (expand_prologue): Set PIC register.
+ (call_address_operand): Don't match SYMBOL_REFs in PIC.
+ (legitimize_address): Call legitimize_pic_address.
+ (legitimize_pic_address): New fn.
+ (legitimate_pic_operand_p): New fn.
+ * config/mn10300/mn10300.md (PIC_REG, SP_REG): New constants.
+ (UNSPEC_INT_LABEL, UNSPEC_PIC, UNSPEC_GOT, UNSPEC_GOTOFF,
+ UNSPEC_PLT): New constants.
+ (pop_pic_reg): New insn.
+ (movsi): Adjust non-PIC addresses.
+ (builtin_setjmp_receiver): Restore the PIC register.
+ (casesi): New insn.
+ (call): Adjust non-PIC addresses.
+ (int_label, GOTaddr2picreg): New expands.
+ (am33_loadPC): New insn.
+ (mn10300_loadPC): New expand.
+ (call_next_insn): New insn.
+ (add_GOT_to_pic_reg): New expand.
+ (symGOT2reg, symGOT2reg_i): New expands.
+ (symGOTOFF2reg, symGOTOFF2reg_i): New expands.
+ (sym2PIC, sym2PLT): New expands.
+
+2003-07-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mn10300/mn10300.h (PREDICATE_CODES): Define.
+ 2001-05-01 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.md (sqrtsf2): flag_fast_math was renamed
+ to flag_unsafe_math_optimizations.
+ 2001-04-14 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.c (expand_prologue): Mark
+ FP-register-saving insns as frame-related.
+ 2001-02-13 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.c
+ (mn10300_get_live_callee_saved_regs): Don't search past
+ LAST_EXTENDED_REGNUM.
+ (mn10300_gen_multiple_store, store_multiple_operation): Likewise.
+ * config/mn10300/mn10300.md: Remove excessive line breaks from
+ `@' output patterns that were accounted as additional
+ alternatives.
+ * config/mn10300/mn10300.md, config/mn10300/mn10300.c:
+ Re-introduce changes accidentally removed in Richard Sandiford's
+ 2000-12-05's patch.
+ * config/mn10300/t-mn10300 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES):
+ Re-instate am33-2 lost in merge from net GCC.
+ 2000-08-26 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.h (DBX_REGISTER_NUMBER): Added
+ floating-point registers.
+ 2000-08-07 Alexandre Oliva <aoliva@redhat.com>
+ * config/mn10300/mn10300.md (movdf): Revert some am33-specific
+ pessimizations that had gone in on 2000-05-08.
+ 2000-06-28 Graham Stott <grahams@cygnus.co.uk>
+ * config/mn10300/mn10300.h (REG_CLASS_CONTENTS): Fix typo.
+ 2000-06-22 Graham Stott <grahams@cygnus.co.uk>
+ * config/mn10300/mn10300.md (movqi): Use nonimmediate_operand for
+ operand 0.
+ * (movhi): Likewise.
+ * (movsi): Likewise.
+ * (movsf): Likewise.
+ * (movdi): Likewise.
+ * (movdf): Likewise.
+ 2000-05-24 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.c (fp_regs_to_save): New function.
+ (can_use_return_insn, initial_offset): Add fp_regs_to_save.
+ (expand_prologue, expand_epilogue): Save and restore FP regs.
+ 2000-05-20 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.md (movdi, movdf): 64-bit clean-up.
+ 2000-05-13 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.md (abssf2, negsf2, rsqrtsf2, addsf3,
+ subsf3, mulsf3, divsf3, fmaddsf4, fmsubsf4, fnmaddsf4, fnmsubsf4):
+ Do not clobber cc0.
+ 2000-05-12 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.md (abssf2, negsf2, rsqrtsf2):
+ Discourage the two-argument, longer opcodes.
+ (addsf3, subsf3, mulsf3, divsf3): Likewise for three-argument
+ ones.
+ * config/mn10300/mn10300.h (struct mn10300_cc_status_mdep): New.
+ (CC_STATUS_MDEP, CC_STATUS_MDEP_INIT): Define.
+ * config/mn10300/mn10300.md (cmpsf): New pattern.
+ (branch): Test mdep.fpCC and output fbCC.
+ * config/mn10300/mn10300.c (print_operand): Output conditions.
+ (notice_cc_update): Recognize fcmp and set mdep.fpCC.
+ 2000-05-10 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.md (movsf, movdf, addsf3, subsf3,
+ mulsf3, divsf3): Use the `F' constraint for FP values.
+ * config/mn10300/mn10300.c (const_1f_operand): New function.
+ * config/mn10300/mn10300-protos.h (const_1f_operand): Declare.
+ * config/mn10300/mn10300.md (sqrtsf2): New expand.
+ (rsqrtsf2): New insn.
+ 2000-05-09 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.md (movdf): Oops, I missed it in my
+ previous check-in.
+ 2000-05-08 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.md (abssf2, negdf2): On
+ TARGET_AM33_2, expand to...
+ (abssf2_am33_2, negdf2_am33_2): New insns.
+ (addsf3, subsf3, mulsf3, divsf3): Likewise.
+ (fmaddsf4, fmsubsf4, fnmaddsf4, fnmsubsf4): Likewise.
+ * config/mn10300/mn10300.md (movqi, movhi, movsi, movsf,
+ movdi, movdf): Added FP regs.
+ * invoke.texi (-mam33-2, -mno-am33-2): Document.
+ 2000-04-29 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.h (FIRST_FP_REGNUM, LAST_FP_REGNUM):
+ New macros.
+ (REGNO_AM33_2_FP_P): Renamed to...
+ (REGNO_FP_P): Redefine in terms of FIRST_* and LAST_*.
+ (CONDITIONAL_REGISTER_USAGE, REGNO_REG_CLASS): Likewise.
+ 2000-04-27 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.h (REG_CLASS_CONTENTS): Remove FP
+ regs from GENERAL_REGS.
+ 2000-04-27 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.h (REGNO_AM33_2_FP_P): New macro.
+ * config/mn10300/mn10300.c (mn10300_address_cost): Added FP_REGS.
+ * config/mn10300/mn10300.h (REGISTER_MOVE_COST): Added FP_REGS.
+ 2000-04-23 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.h (CLASS_CANNOT_CHANGE_SIZE): Defined
+ as FP_REGS.
+ 2000-04-21 Alexandre Oliva <aoliva@cygnus.com>
+ * config/mn10300/mn10300.h (OK_FOR_Q): New macro.
+ (EXTRA_CONSTRAINT): Added OK_FOR_Q.
+ * config/mn10300/mn10300.c (secondary_reload_class): Adjust.
+ * config/mn10300/mn10300.c (print_operand): Support `D' for doubles.
+ * config/mn10300/mn10300.h (FIRST_PSEUDO_REGISTER): Adjust.
+ (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER): Added
+ AM33/2.0 floating-point registers.
+ (CONDITIONAL_REGISTER_USAGE): Adjust.
+ (enum reg_class, REG_CLASS_NAMES): Added FP_REGS and FP_ACC_REGS.
+ (REG_CLASS_CONTENTS, REGNO_REG_CLASS): Adjust.
+ (REG_CLASS_FROM_LETTER): Added `f' and `A'.
+ (REGISTER_NAMES, ADDITIONAL_REGISTER_NAMES): Adjust.
+ * config/mn10300/t-mn10300 (MULTILIB_OPTIONS): Added am33-2.
+ (MULTILIB_DIRNAMES): Likewise.
+ * config/mn10300/mn10300.h (CPP_SPEC): Define `__AM33__=2' and
+ `__AM33_2__' when `-mam33-2' is given.
+ (TARGET_AM33_2): Define.
+ (TARGET_SWITCHES): Adjust.
+ * config/mn10300/mn10300.c (asm_file_start): Print `.am33_2'
+ when appropriate.
+
+2003-07-09 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * doc/install.texi: Add missing @.
+
+2003-07-09 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.h (CRT_CALL_STATIC_FUNCTION): Define.
+
+2003-07-09 Aldy Hernandez <aldyh@redhat.com>
+
+ PR/11144
+ * config/i386/i386.c (ix86_function_arg_boundary): Remove abort.
+
+2003-07-09 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR bootstrap/11043
+ * config/arc/t-arc: Replace bogus references to "x-crtinit.o",
+ "x-crtfini.o" with "crtinit.o", "crtfini.o".
+
+ * fixinc/inclhack.def (limits_ifndefs): Add select test.
+ * fixinc/fixincl.x: Rebuild.
+
+ * fixinc/inclhack.def (math_exception): Improve bypass and comment.
+ * fixinc/fixincl.x: Rebuild.
+
+2003-07-09 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * doc/install.texi (Configuration): Document the valgrind option
+ to --enable-checking.
+
+2003-07-09 Jan Hubicka <jh@suse.cz>
* objc-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
@@ -73,7 +6719,7 @@ Wed Jul 9 16:16:30 CEST 2003 Jan Hubicka <jh@suse.cz>
* config/i386/i386.md: Remove an old comment about
NOTICE_UPDATE_CC.
-Wed Jul 9 03:00:10 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-09 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_node_name): New function.
(dump_cgraph): Use it.
@@ -129,7 +6775,7 @@ Wed Jul 9 03:00:10 CEST 2003 Jan Hubicka <jh@suse.cz>
Use attr `special' macros in all calls to make_internal_attr.
* genautomata.c: Likewise.
-Wed Jul 9 02:25:39 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-09 Jan Hubicka <jh@suse.cz>
* c-common.c (c_estimate_num_insns_1): New static function.
(c_estimate_num_insns): New global function.
@@ -498,7 +7144,7 @@ Wed Jul 9 02:25:39 CEST 2003 Jan Hubicka <jh@suse.cz>
* config/m68k/m68k.md (movxf): Add reload_in_progress guard. Add
comment about confused support for XFmode constants.
-Mon Jul 7 02:03:56 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-07 Jan Hubicka <jh@suse.cz>
* cfglayout.c (fixup_reorder_chain): Call delete_dead_jumptables.
@@ -792,7 +7438,7 @@ Mon Jul 7 02:03:56 CEST 2003 Jan Hubicka <jh@suse.cz>
* cppcharset.c: Use the correct return type for the fallback iconv
macro.
-Sat Jul 5 16:18:53 CEST 2003 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+2003-07-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
Blame to Jan Hubicka <jh@suse.cz>
* cfglayout.c (record_effective_endpoints): Split insns before
@@ -1092,7 +7738,7 @@ Sat Jul 5 16:18:53 CEST 2003 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
SPARC_INT_ARG_MAX to determine where to split unnamed
complex FP arguments.
-Thu Jul 3 20:36:47 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-03 Jan Hubicka <jh@suse.cz>
* basic-block.h (create_basic_block, merge_blocks_nomove): Kill.
* cfgcleanup.c (merge_blocks): Rename to merge_blocks_move.
@@ -1387,7 +8033,7 @@ Thu Jul 3 20:36:47 CEST 2003 Jan Hubicka <jh@suse.cz>
(exception_receiver): Explicitly set $28.
(hazard_nop): New pattern.
-Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-02 Jan Hubicka <jh@suse.cz>
* cgraphunit.c (cgraph_finalize_unit): Set current_function_decl
before calling tree_inlinable_function_p.
@@ -1436,7 +8082,7 @@ Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz>
* config/mips/iris6.h: Move explicit includes ...
* config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here.
-Wed Jul 2 02:16:48 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-02 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_mark_needed_node, cgraph_varpool_mark_needed_node,
cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls):
@@ -1445,7 +8091,7 @@ Wed Jul 2 02:16:48 CEST 2003 Jan Hubicka <jh@suse.cz>
(cgraph_varpool_node): Add next_needed; remove aux.
* cgraphunit.c (cgraph_finalize_compilation_unit): Use next_needed.
-Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-02 Jan Hubicka <jh@suse.cz>
* cgraphunit.c (cgraph_finalize_function): Set finalized.
(cgraph_finalize_function): Do not examine inlinablility.
@@ -1618,21494 +8264,4 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz>
* gcov-io.c: Likewise.
* gcov-io.h: Likewise.
-2003-06-30 Bruno Haible <bruno@clisp.org>
-
- PR middle-end/6578
- * libgcc2.c (__subvsi3): Remove simplification that would not work
- when subtracting -0x80000000.
- (__subvdi3): Remove simplification that would return a wrong result.
- (__mulvsi3): Fix overflow check.
- (__absvdi2): Fix simplification that would return a wrong result.
- (__mulvdi3): Fix overflow check.
-
-2003-06-30 Jeff Law <law@redhat.com>
-
- * stmt.c (any_pending_cleanups): Lose argument THIS_CONTOUR, it
- was always passed in the value '1'. Simplify body appropriately.
- * tree.h (any_pending_cleanups): Corresponding changes.
- * calls.c: (expand_call): Corresponding changes.
-
-2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * combine.c (distribute_notes): Don't bother REG_WAS_0.
- * cse.c (cse_insn): Likewise.
- * final.c (final_scan_insn): Likewise.
- * jump.c (duplicate_loop_exit_test): Likewise.
- * rtl.c (reg_note_name): Remove REG_WAS_0.
- * rtl.h (REG_WAS_0): Remove.
- * unroll.c (final_reg_note_copy): Don't bother REG_WAS_0.
- * config/avr/avr.c (output_movqi): Don't use reg_was_0.
- (output_movhi): Likewise.
- (output_movsisf): Likewise.
- (reg_was_0): Remove.
- * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Don't use
- REG_WAS_0.
- (m68hc11_gen_movqi): Likewise.
- * config/vax/vax-protos.h: Remove the prototype for
- reg_was_0_p.
- * config/vax/vax.c (follows_p): Remove.
- (reg_was_0_p): Likewise.
- * config/vax/vax.md (movsi): Don't use reg_was_0_p.
- (movhi): Likewise.
- (movqi): Likewise.
- * doc/rtl.texi (REG_WAS_0): Remove.
-
-2003-06-30 Mark Mitchell <mark@codesourcery.com>
-
- * config/rs6000/spe.h (__ev_set_spefscr_frmc): Set the flag.
-
-2003-06-30 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/lib1funcs.asm: Use "xtensa-config.h" from
- top-level include directory.
- * config/xtensa/lib2funcs.S: Likewise.
- * config/xtensa/xtensa.h: Likewise.
- * config/xtensa/xtensa-config.h: Remove.
- * doc/install.texi: Update location of "xtensa-config.h" header.
-
-2003-06-30 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_extra_constraint): New function.
- * config/s390/s390-protos.h (s390_extra_constraint): Declare it.
- * config/s390/s390.h (EXTRA_CONSTRAINT): Use it.
- * config/s390/s390.c (q_constraint): Remove.
- * config/s390/s390-protos.h (q_constraint): Likewise.
- * config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Add 'R', 'S', 'T'.
- (EXTRA_ADDRESS_CONSTRAINT): Define.
-
- * config/s390/s390.c (larl_operand): Refuse out-of-range operands.
- (DISP_IN_RANGE, s390_short_displacement): New.
- (legitimate_reload_operand_p): Support long displacements.
- (s390_decompose_address): Likewise.
- (legitimize_pic_address): Likewise.
- (legitimize_address): Likewise.
- (s390_fixup_clobbered_return_reg): Likewise.
- (s390_emit_prologue, s390_emit_epilogue): Likewise.
- (s390_output_mi_thunk): Likewise.
-
- * config/s390/s390.md (attr "op_type"): Add "RXY", "RSY", "SIY".
- (attr "atype", attr "length"): Add defaults for new op_types.
- (all insns): Change op_type attribute where appropriate.
-
- ("*movdi_lay", "*movsi_lay", "*extendqidi2", "*extendqisi2"): New insns.
- ("*tmqi_ext", "*tmdi_mem", "*tmsi_mem", "*tmhi_mem", *tmqi_mem",
- "*tstsi", "*tstsi_cconly", "*tsthiCCT", "*tsthiCCT_cconly",
- "*tsthi", "*tsthi_cconly", "*tstqiCCT", "*tstqiCCT_cconly",
- "*tstqi", "*tstqi_cconly", "*cmpsi_ccs_sign", "*cmpsi_ccs",
- "*cmpsi_ccu", "*cmphi_ccu", "*cmpqi_ccu", "*cli",
- "movti", "*movdi_64", "*movdi_31", "*movsi", "movhi", "movqi_64",
- "movqi", "*movstrictqi", "*movstricthi", "movstrictsi",
- "*movdf_64", "*movdf_31", "*movsf",
- "*load_multiple_si", "*store_multiple_di",
- "*sethighqisi", "*sethighhisi", "*sethighqidi_31", "*extendhisi2",
- "*la_64", "*la_31", "*la_31_and", "force_la_31",
- "*addsi3_carry1_cc", *addsi3_carry1_cconly",
- "*addsi3_carry2_cc", *addsi3_carry2_cconly",
- "*addsi3_cc", "*addsi3_cconly", "*addsi3_cconly2",
- "*addsi3_sign", "*addsi3_sub", "addsi3",
- "*subsi3_borrow_cc", "*subsi3_borrow_cconly", "*subsi3_cc",
- "*subsi3_cconly", "*subsi3_sign", "*subsi3_sub", "subsi3",
- "mulsi3"
- "*andsi3_cc", "*andsi3_cconly", "andsi3",
- "*andqi3_ss", "*andqi3_ss_inv",
- "*iorsi3_cc", "*iorsi3_cconly", "iorsi3",
- "*iorqi3_ss", "*iorqi3_ss_inv",
- "*xorsi3_cc", "*xorsi3_cconly", "xorsi3",
- "*xorqi3_ss", "*xorqi3_ss_inv",
- "*tls_load_31"): Add alternatives for long-displacement instructions.
-
- ("*cmpdf_ccs", "*cmpdf_ccs_ibm", "*cmpsf_ccs", "*cmpsf_ccs_ibm",
- "*load_multiple_di", "*store_multiple_di",
- "*sethighqidi_64", "*zero_extendhisi2_31",
- "truncdfsf2_ibm", "extendsfdf2_ieee", "extendsfdf2_ibm",
- "adddf3", "*adddf3", "*adddf3_ibm",
- "addsf3", "*addsf3", "*addsf3_ibm",
- "subdf3", "*subdf3", "*subdf3_ibm",
- "subsf3", "*subsf3", "*subsf3_ibm",
- "mulsi_6432", "divmoddisi3",
- "muldf3", "*muldf3", "*muldf3_ibm",
- "mulsf3", "*mulsf3", "*mulsf3_ibm",
- "divdf3", "*divdf3", "*divdf3_ibm",
- "divsf3", "div*sf3", "*divsf3_ibm",
- "sqrtdf2", "sqrtsf2",
- "*cjump_long", "*icjump_long", "indirect_jump", "casesi_jump",
- "*doloop_si_long", "*doloop_di_long", "bas_64", "bas_31",
- "bas_r_64", "bas_r_31", "bas_tls_31", "bas_tls_64"): Adapt memory
- and address constraints for instructions that do not accept long
- displacements.
-
-2003-06-30 Hartmut Penner <hpenner@de.ibm.com>
- Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/2084.md: New file.
- * config/s390/s390.md: Include it.
- * config/s390/s390.c (s390_adjust_priority): New function.
- (TARGET_SCHED_ADJUST_PRIORITY): Define.
- (s390_first_cycle_multipass_dfa_lookahead): New function.
- (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Define.
- (s390_sched_reorder2): New function.
- (TARGET_SCHED_REORDER2): Define.
- (s390_adjust_cost): Support PROCESSOR_2084_Z990 cpu type.
- (s390_issue_rate): Likewise.
-
-Mon Jun 30 23:47:33 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * Makefile.in (GTFILES): Add cgraph.h.
- * cgraph.c (known_decls): Remove.
- (cgraph_hash, cgraph_nodes, cgraph_nodes_queue,
- cgraph_varpool_hash, cgraph_varpool_nodes_queue): GTYize.
- (cgraph_node): Do not allocate known_decls; use polutate hashtable.
- (cgraph_varpool_node): Likewise; add next pointer.
- (cgraph_varpool_nodes): New static variable.
- * cgraph.h (cgraph_local_info, cgraph_global_info, cgraph_rtl_info,
- cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_nodes, cgraph_n_nodes,
- cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): GTYize.
- * gengtype.c (open_base_files): Include cgraph.h
-
-2003-06-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * Changelog: Remove ">>>>>>>" from previous change.
-
-2003-06-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * config/cris/cris.c: Fix spelling for "testcase".
- * config/cris/cris.h: Likewise.
- * config/cris/cris.md: Likewise.
- * config/mmix/crti.asm: Likewise.
- * config/mmix/mmix.h: Likewise.
- * config/mmix/mmix.md: Likewise.
-
-2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Make it always
- 1.
-
-2003-06-30 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config.gcc [s390*-*-*]: Support --with-arch, --with-tune, and
- --with-mode configure options.
- * config/s390/s390.h (OPTION_DEFAULT_SPECS): Define.
- (DRIVER_SELF_SPECS): Define.
- * config/s390/linux.h (ASM_SPEC): Pass architecture mode and cpu
- architecture to assembler.
- (LINK_SPEC): Merge 31-bit and 64-bit variants.
- (LINK_ARCH31_SPEC, LINK_ARCH64_SPEC, EXTRA_SPECS): Remove.
- * config/s390/s390.c (override_options): New default rules for
- architecture mode and cpu architecture selection.
- * doc/invoke.texi (-mesa, -mzarch, -march, -mtune): Document
- new default rules.
-
- * config/s390/s390.h (enum processor_type): Add PROCESSOR_2084_Z990.
- * config/s390/s390.md (attr "cpu"): Add "z990" processor type.
- * config/s390/s390.c (override_options): Add "z990" to
- processor_alias_table.
- * doc/invoke.texi (-march): Document "z990" processor type.
-
- * config/s390/s390.c (s390_tune_flags, s390_arch_flags): New variables.
- * config/s390/s390.h (s390_tune_flags, s390_arch_flags): Declare.
- (enum processor_flags, TARGET_CPU_IEEE_FLOAT, TARGET_CPU_ZARCH,
- TARGET_CPU_LONG_DISPLACEMENT, TARGET_LONG_DISPLACEMENT): New.
- * config/s390/s390.c (override_options): Replace enum pta_flags by
- enum processor_flags. Fill in s390_tune_flags and s390_arch_flags.
-
- * config/s390/s390.c (s390_cpu): Rename to ...
- (s390_tune): ... this.
- * config/s390/s390.h (s390_cpu, s390_tune): Likewise.
- * config/s390/s390.c (s390_issue_rate, override_options): Likewise.
- * config/s390/s390.md (attr "cpu"): Likewise.
-
-2003-06-30 Neil Booth <neil@daikokuya.co.uk>
-
- * c-common.c (enum c_language_kind, flag_objc): Remove.
- (fix_string_type, check_case_value, c_common_nodes_and_builtins,
- c_add_case_label, finish_label_addr_expr, boolean_increment):
- Use c_dialect_ macros.
- * c-common.h (enum c_language_kind): Extend.
- (c_dialect_cxx, c_dialect_objc): New.
- (flag_objc): Remove.
- (c_common_init_options): Update prototype.
- * c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
- macros.
- * c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
- macros.
- * c-format.c (C_STD_VER, C_STD_NAME): Similarly.
- * c-lang.c (c_init_options): Remove.
- (c_language): Define.
- (LANG_HOOKS_INIT_OPTIONS): Use common hook.
- * c-lex.c (lex_charconst): Use c_dialect_ macros.
- * c-opts.c (lang_flags): Make function-local.
- (c_common_init_options): Use c_dialect_ macros. Handle
- C++ diagnostic requirements.
- (c_common_handle_option, c_common_post_options): Use flag_cxx.
- * c-parse.in (init_reswords): Use c_dialect_objc ().
- * c-pch.c (get_ident): Use c_language.
- * c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
- * c-typeck.c (comptypes, build_c_cast): Similarly.
- * objc/objc-lang.c (c_language): Define.
- (LANG_HOOKS_INIT_OPTIONS): Use common hook.
- (objc_init_options): Remove.
-
-2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/alpha/alpha.h (FUNCTION_ARG_PADDING): Remove.
- * config/alpha/unicosmk.h: Don't #undef FUNCTION_ARG_PADDING.
-
-2003-06-30 Wolfgang Bangerth <bangerth@dealii.org>
-
- * doc/sourcebuild.texi: Don't reference gnats.html any more.
-
-2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (compute_mov_length): Fix length of
- mov:SF on H8/300.
-
-2003-06-30 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.h (BIGGEST_FIELD_ALIGNMENT): Make defintion
- constant.
-
-Mon Jun 30 15:36:29 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- (fyl2x_sfxf3, fyl2x_dfxf3, fscale_sfxf3, fscale_dfxf3): Fix condition.
-
-2003-06-30 Hartmut Penner <hpenner@de.ibm.com>
-
- * config/rs6000/rs6000.c (rs6000_split_altivec_in_gprs): New function.
- (altivec_in_gprs_p): New function.
-
- * config/rs6000/rs6000-protos (rs6000_split_altivec_in_gprs): New
- prototype.
- (altivec_in_gprs_p): New prototype.
-
- * config/rs6000/altivec.md (*movv4si_internal): Change
- multi-assembler alternative to '#'. Add postreload splitter to
- handle this cases.
- (*movv4hi_internal): Likewise.
- (*movv4qi_internal): Likewise.
- (*movv4sf_internal): Likewise.
-
-2003-06-30 Jason Merrill <jason@redhat.com>
-
- * defaults.h (PUSH_ARGS_REVERSED): Define default here.
- * calls.c: Not here.
-
-2003-06-30 Ben Elliston <bje@wasabisystems.com>
-
- * config/arm/arm.c (arm_rtx_costs): Remove #if 0 block.
- (bad_signed_byte_operand): Likewise.
- (arm_output_epilogue): Likewise.
- (arm_final_prescan_insn): Likewise.
-
-2003-06-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * cfgrtl.c (mark_killed_regs): Cast HARD_REGNO_NREGS to int.
-
-2003-06-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * c-pch.c (c_common_write_pch): Flush asm_out_file to allow for
- subsequent writes.
-
-Mon Jun 30 10:03:02 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * cfgrtl.c (verify_flow_info): Accept degenerated condjumps
- in cfglayout mode.
-
-Mon Jun 30 09:52:39 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (standard_80387_constant_p): Accept TFmode constants too.
- (init_ext_80387_constants): Likewise.
- (standard_80387_constant_rtx): Likewise.
- * i386.md (atanxf): Disable for TARGET_128BIT_LONG_LONG
- (atantf): Disable for !TARGET_128BIT_LONG_LONG
- (fyl2x_sfxf3, fyl2x_dfxf3): Accept TFmode operands.
- (fyl2x_xfxf3, fyl2x_tfxf3): Enable/disable as needed.
- (fscale_sfxf3, fscale_dfxf3): Accept TFmode operands.
- (fscale_xfxf3, fscale_tfxf3): Enable/disable as needed.
- (frndinttf2): New.
- (f2xm1tf2): New.
- (exp?f2): Use expsf2_tf when needed.
- (exp?f2_tf): New.
- (exptf): New.
-
-2003-06-29 Uwe Stieber <uwe@kaos-group.de>
-
- * config.gcc (sh*-*-kaos*): Put tm_file setting in separate case
- statement from tmake_file set.
-
-2003-06-29 James E Wilson <wilson@tuliptree.org>
-
- * reload.c (find_reloads): Change push_reloads to push_reload in
- comment.
- * reload1.c (eliminate_regs): Likewise.
- (dump_needs): Delete prototype for deleted function.
-
-2003-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtin-attrs.def (gcc_diag, gcc_cdiag, gcc_cxxdiag): New
- format attributes.
- * c-format.c (enum format_type): Add gcc_diag_format_type,
- gcc_cdiag_format_type, and gcc_cxxdiag_format_type.
- (gcc_diag_length_specs, gcc_cdiag_length_specs,
- gcc_cxxdiag_length_specs, gcc_diag_flag_pairs,
- gcc_cdiag_flag_pairs, gcc_cxxdiag_flag_pairs, gcc_diag_flag_specs,
- gcc_cdiag_flag_specs, gcc_cxxdiag_flag_specs, gcc_diag_char_table,
- gcc_cdiag_char_table, gcc_cxxdiag_char_table): New.
- (format_types_orig): Add new data.
- (find_char_info_specifier_index, init_dynamic_diag_info): New
- functions.
- (handle_format_attribute): Update to handle new format attributes.
-
-2003-06-29 Aaron W. LaFramboise <awlaframboise@aol.com>
-
- * config/i386/gthr-win32.h (__GTHREAD_HIDE_WIN32API): Define to 1.
-
-2003-06-29 Dara Hazeghi <dhazeghi@yahoo.com>
-
- * doc/install.texi: Remove install documentation for obsoleted targets
- i?86-*-sco, i?86-*-sco3.2v4, powerpcle-*-pe, powerpcle-*-winnt,
- arm-*-aof.
- Update information about IA64 toolchain, AIX make requirements,
- and binutils for m68k-*-hpux and *-*-linuxaout targets.
-
-Mon Jun 30 00:50:43 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * regmove.c (regmove_optimize): Don't try to make src and dst match
- when they are in different modes.
-
-Sun Jun 29 23:06:32 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid
- busy work when builtin is not supported by the backend.
-
-2003-06-29 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * loop.c (count_one_set): Fix detection of registers set in more
- than one basic block.
-
-2003-06-29 Andreas Jaeger <aj@suse.de>
-
- * target-def.h: Remove usage of OBJECT_FORMAT_ROSE.
- * system.h: Poison OBJ_FORMAT_ROSE.
- * doc/tm.texi (Macros for Initialization): Remove documentatin of
- OBJECT_FORMAT_ROSE.
- * config/rs6000/lynx.h: Remove undef of OBJECT_FORMAT_ROSE.
- * collect2.c: Remove usage of OBJECT_FORMAT_ROSE.
-
-2003-06-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.c (update_total_code_bytes): New function.
- (last_address): Number of bytes output for a function and its
- associated thunks.
- (compute_frame_size): Use BITS_PER_UNIT.
- (pa_output_function_epilogue): Compute last_address. Use
- update_total_code_bytes.
- (output_lbranch): Handle long branch on portable runtime.
- (attr_length_millicode_call, attr_length_call,
- attr_length_indirect_call): Only use total_code_bytes for calls in
- the text section.
- (output_call): Only use an indirect call sequence when the target is
- not local.
- (pa_asm_output_mi_thunk): Handle updating of total_code_bytes. Improve
- test to determine when an IA-relative branch can be used. Add various
- long branch sequences. Avoid using an indirect branch on all ports
- except SOM.
-
-2003-06-29 Ulrich Weigand <uweigand@de.ibm.com>
-
- * expr.c (clear_by_pieces): Fix prototype.
-
-2003-06-29 Andreas Jaeger <aj@suse.de>
-
- * cse.c: Convert prototypes to ISO C90.
- * cselib.c: Likewise.
- * cselib.h: Likewise.
- * dbxout.c: Likewise.
- * debug.c: Likewise.
- * df.c: Likewise.
- * df.h: Likewise.
- * dojump.c: Likewise.
- * doloop.c: Likewise.
- * dominance.c: Likewise.
- * dwarf2asm.c: Likewise.
- * dwarf2out.c: Likewise.
- * dwarf2out.h: Likewise.
- * dwarfout.c: Likewise.
- * except.c: Likewise.
- * except.h: Likewise.
- * emit-rtl.c: Likewise.
- * et-forest.c: Likewise.
- * et-forest.h: Likewise.
- * except.c: Likewise.
- * explow.c: Likewise.
- * expmed.c: Likewise.
- * expr.c: Likewise.
- * expr.h: Likewise.
-
-2003-06-29 Kazu Hirata <kazu@cs.umass.edu>
-
- * alloc-pool.c: Fix comment formatting.
- * bitmap.c: Likewise.
- * bitmap.h: Likewise.
- * bt-load.c: Likewise.
- * builtins.c: Likewise.
- * caller-save.c: Likewise.
- * cfganal.c: Likewise.
- * cfgrtl.c: Likewise.
- * collect2.c: Likewise.
- * cse.c: Likewise.
- * df.c: Likewise.
- * diagnostic.c: Likewise.
- * dwarf2out.c: Likewise.
- * dwarfout.c: Likewise.
- * expmed.c: Likewise.
- * final.c: Likewise.
- * flags.h: Likewise.
- * fold-const.c: Likewise.
- * gcc.c: Likewise.
- * gcov-io.h: Likewise.
- * gcov.c: Likewise.
- * genattrtab.c: Likewise.
- * genautomata.c: Likewise.
- * libgcov.c: Likewise.
- * mips-tfile.c: Likewise.
- * optabs.c: Likewise.
- * prefix.c: Likewise.
- * rtlanal.c: Likewise.
- * stmt.c: Likewise.
- * stor-layout.c: Likewise.
- * toplev.c: Likewise.
- * varasm.c: Likewise.
- * vmsdbgout.c: Likewise.
-
-2003-06-29 Kazu Hirata <kazu@cs.umass.edu>
-
- * expr.c (emit_single_push_insn): If padding is needed
- downward, adjust the stack pointer first, and then store the
- data into the stack location using an offset.
-
-2003-06-29 Andreas Jaeger <aj@suse.de>
-
- * collect2.h: Convert prototypes to ISO C90.
- * collect2.c: Likewise.
- * conflict.c: Likewise.
- * coverage.c: Likewise.
- * convert.h: Likewise.
- * convert.c: Likewise.
-
-2003-06-29 Nathan Sidwell <nathan@codesourcery.com>
-
- * c-decl.c (c_init_decl_processing): Use a location_t. Set input
- filename to <internal>.
- * tree.c (make_node): Just copy the current location.
-
-2003-06-29 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/11210
- * fold-const (decode_field_reference): Revert 2003-06-26 patch.
-
-2003-06-29 Neil Booth <neil@daikokuya.co.uk>
-
- * toplev.c (flag_dummy): Remove.
- (f_options): Restore flag pointers.
-
-2003-06-29 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (processor_target_table): Add 970.
- * config.gcc: Add 970.
-
-2003-06-29 Kazu Hirata <kazu@cs.umass.edu>
-
- * dwarf2out.c (add_AT_string): Replace ggc_alloc_string (X,
- -1) with ggc_strdup.
- * stmt.c (expand_asm_operands): Likewise.
- * config/rs6000/rs6000.md (builtin_setjmp_receiver): Likewise.
-
-2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/ip2k/ip2k.c (ip2k_reorg): Use INSN_P instead of its
- definition.
-
-2003-06-29 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * opts.c: Include insn-attr.h.
- * Makefile.in (opts.o): Depend on INSN_ATTR_H.
-
-2003-06-27 J"orn Rennecke <joern.rennecke@superh.com>
-
- * flow.c (propagate_one_insn): Use proper test for a register
- being part of the return value.
-
-2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/avr/avr.c: Fix a comment typo.
-
-2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/avr/avr-protos.h: Replace avr_simplify_comparision_p
- with avr_simplify_comparison_p.
- * config/avr/avr.c: Likewise.
-
-2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * builtins.c: Follow spelling conventions.
- * cgraph.c: Likewise.
- * cpplex.c: Likewise.
- * config/arm/arm.c: Likewise.
- * config/arm/iwmmxt.md: Likewise.
- * config/c4x/c4x-modes.def: Likewise.
- * config/c4x/c4x.c: Likewise.
- * config/c4x/c4x.h: Likewise.
- * config/c4x/c4x.md: Likewise.
- * config/i386/i386-interix.h: Likewise.
- * config/mips/mips.h: Likewise.
-
-2003-06-28 Neil Booth <neil@daikokuya.co.uk>
-
- * config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Predicate
- __mc68020__ on TARGET_68020.
-
-2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c: Fix a comment typo.
-
-2003-06-28 Nathan Sidwell <nathan@codesourcery.com>
-
- * c-parse.in (yylexstring): Use a location_t.
-
- * diagnostic.h (diagnostic_set_info): Replace file and lineno
- parameters with a location_t.
- * diagnostic.c (diagnostic_set_info): Replace file and lineno
- parameters with a location_t.
- (inform, warning, pedwarn, error, sorry, fatal_error,
- internal_error, warning_with_decl, pedwarn_with_decl,
- error_with_decl): Adjust.
- * c-error.c (pedwarn_c99): Adjust.
- * c-format.c (status_warning): Adjust.
- * rtl-error.c (file_and_line_for_asm): Rename to ...
- (location_for_asm): Return a location_t.
- (diagnostic_for_asm): Adjust.
-
-2003-06-28 Neil Booth <neil@daikokuya.co.uk>
-
- * cpptrad.c (skip_macro_block_comment): New.
- (copy_comment): Use it if appropriate.
-
-2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * gcse.c (compute_ld_motion_mems): Use INSN_P instead of its
- definition.
- (store_killed_in_insn): Likewise.
- * print-rtl.c (print_rtx): Likewise.
- * config/frv/frv.c (frv_final_prescan_insn): Likewise.
- * config/m68hc11/m68hc11.c (dead_register_here): Likewise.
- (m68hc11_reassign_regs): Likewise.
- (m68hc11_reorg): Likewise.
-
-2003-06-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * diagnostic.c (output_integer_with_precision): New macro.
- (output_format): Use it. Handle more format specifiers.
- (output_long_decimal): Remove.
- (output_unsigned_decimal): Likewise.
- (output_long_unsigned_decimal): Likewise.
- (output_octal): Likewise.
- (output_long_octal): Likewise.
- (output_hexadecimal): Likewise.
- (output_long_hexadecimal): Likewise.
- (output_long_long_decimal): Likewise.
-
-2003-06-28 Andreas Schwab <schwab@suse.de>
-
- * config/ia64/ia64.md: Follow recent emit_note API change.
-
-2003-06-28 Nathan Sidwell <nathan@codesourcery.com>
-
- * c-parse.in (%union): Replace filename & lineno with location.
- (save_filename, save_lineno): Remove.
- (save_location): New.
- (fndef, old_style_parm_decls_1, lineno_datadecl, lineno_decl,
- nested_function, notype_nested_function, if_prefix, lineno_stmt,
- lineno_label, label): Adjust.
-
-2003-06-28 Jakub Jelinek <jakub@redhat.com>
-
- * builtins.c (c_strlen): Add only_value argument.
- Handle COND_EXPR and COMPOUND_EXPR.
- (expand_builtin_strlen): Optimize also strlen (i++ ? "foo" : "bar").
- Adjust c_strlen callers.
- (expand_builtin_strcpy, expand_builtin_strncpy,
- expand_builtin_strcmp, expand_builtin_strncmp,
- expand_builtin_fputs, expand_builtin_sprintf,
- fold_builtin): Adjust c_strlen callers.
-
-2003-06-28 Josef Zlomek <zlomekj@suse.cz>
-
- * bb-reorder.c (find_traces_1_round): Do not send basic block
- to next round when we are in the last round.
-
-2003-06-28 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * opts.c: Include tm_p.h.
- (handle_options): Make static.
- (decode_options): Copied from toplev.c.
- * opts.h (decode_options): New.
- * toplev.c (parse_options_and_default_flags): Move most to opts.c,
- some to...
- (general_init): ...here.
- (toplev_main): Use decode_options instead.
- * toplev.h (save_argc, save_argv): New.
-
-2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * explow.c (find_next_ref): Remove.
- * rtl.h: Remove the prototype for find_next_ref.
-
-2003-06-27 Roger Sayle <roger@eyesopen.com>
-
- * config/alpha/alpha.md (anonymous define_split): Adjust emit_note
- call to match recent API change.
-
-2003-06-27 Zack Weinberg <zack@codesourcery.com>
-
- * dbxout.c (flag_debug_only_used_symbols): Delete redundant
- declaration.
-
- * c-format.c (check_format_string, get_constant)
- * cfgrtl.c (rtl_split_edge):
- Mark the definition static, matching the forward declaration.
-
-2003-06-27 Gunther Nikl <gni@gecko.de>
-
- * unwind-c.c (PERSONALITY_FUNCTION): Delete duplicate define.
-
- PR target/11014
- * config/m68k/m68k.c (m68k_output_mi_thunk): Use correct assembly
- syntax for MIT / MOTOROLA.
-
- PR other/10240
- * configure.in: Removed $(XCFLAGS) from BUILD_CFLAGS for build != host.
- * configure: Rebuilt.
-
-2003-06-27 Chris Demetriou <cgd@broadcom.com>
-
- * config/mips/mips.c (mips_build_va_list): Make padding in
- va_list structure explicit to avoid -Wpadded warnings.
-
-2003-06-27 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.h (SECONDARY_OUTPUT_RELOAD_CLASS): Define.
- * config/s390/s390.c (s390_secondary_output_reload_class): New function.
- * config/s390/s390-protos.h (s390_secondary_output_reload_class):
- Declare it.
- * config/s390/s390.md ("reload_outti", "reload_outdi",
- "reload_outdf"): New expanders.
-
- * config/s390/s390.md ("movti" + splitters): Handle non-offsettable
- memory operands as source.
- ("movdi" + splitters): Likewise.
- ("movdf" + splitters): Likewise.
- * config/s390/s390.c (s390_split_ok_p): New function.
- * config/s390/s390-protos.h (s390_split_ok_p): Declare it.
-
-2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * combine.c (force_to_mode): Replace the equality comparison
- of INTVALs with a pointer equality comparison.
- (simplify_comparison): Likewise.
-
-2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * jump.c (rtx_renumbered_equal_p): Replace an expression that
- is known to be 0 with 0.
-
-2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * gcse.c (expr_equiv_p): Replace expressions that are known to
- be 0 with 0.
-
-2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * cse.c (fold_rtx): Replace the equality comparison of INTVALs
- with a pointer equality comparison.
-
-2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * rtlanal.c (reg_mentioned_p): Return 0 earlier if REG and IN
- are known to be not equivalent.
-
-2003-06-27 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (function_arg): Don't pass small aggregates
- in floating point registers. Validate that we don't receive complex
- values here. Use #elif.
- (return_in_memory, function_value): New.
- (alpha_va_arg): Handle complex values as two arguments.
- * config/alpha/alpha.h (RETURN_IN_MEMORY): Use return_in_memory.
- (FUNCTION_VALUE, LIBCALL_VALUE): Use function_value.
- (SPLIT_COMPLEX_ARGS): New.
- * config/alpha/alpha-protos.h: Update.
-
-2003-06-27 Ulrich Weigand <uweigand@de.ibm.com>
-
- * ggc-page.c (inverse_table): Change type of mult to size_t.
- (compute_inverse): Compute inverse using size_t, not unsigned int.
- Compute inverse also for sizes larger than half a machine page.
-
-Fri Jun 27 18:36:12 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * toplev.c (rest_of_decl_compilation): Only varpoolize argument
- when called before cgraph_optimize.
-
-2003-06-27 Zack Weinberg <zack@codesourcery.com>
-
- * config/darwin.h, config/elfos.h, config/i960/i960-coff.h
- * config/m68k/coff.h: ASM_FILE_START_FILE_DIRECTIVE should
- be TARGET_ASM_FILE_START_FILE_DIRECTIVE.
-
-Fri Jun 27 17:41:16 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * cgraph.c (cgraph_node, cgraph_varpool_node): Avoid re-initializing
- of known_decls.
-
-2003-06-27 Hans-Peter Nilsson <hp@axis.com>
-
- * defaults.h (REGISTER_MOVE_COST): Define default here.
- * regclass.c: Don't define default REGISTER_MOVE_COST here.
- * reload.c, reload1.c: Ditto.
-
-2003-06-27 Richard Earnshaw <rearnsha@arm.com>
-
- * flags.h: Really install previous change.
-
-2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
-
- * rtl.h (emit_note): Remove FILE parameter.
- * emit-rtl.c (emit_line_note): Adjust emit_note call.
- (emit_note): Remove FILE parameter. Adjust.
- * builtins.c (expand_builtin_expect): Adjust emit_note call.
- * c-semantics.c (genrtl_scope_stmt): Likewise.
- (expand_stmt): Likewise.
- * cfglayout.c (reemit_insn_block_notes): Likewise.
- (duplicate_insn_chain): Likewise.
- * except.c (expand_eh_region_start, expand_eh_region_end,
- sjlj_emit_function_enter): Likewise.
- * explow.c (probe_stack_range): Likewise.
- * expr.c (emit_block_move_via_loop): Likewise.
- * function.c (init_function_start, expand_function_start,
- expand_function_end, thread_prologue_and_epilogue_insns): Likewise.
- * integrate.c (expand_inline_function, copy_insn_list): Likewise.
- * reg-stack.c (compensate_edge): Likewise.
- * reload1.c (reload): Likewise.
- * rtlanal.c (hoist_insn_to_edge): Likewise.
- * stmt.c (expand_fixup, expand_start_loop, expand_start_null_loop,
- expand_loop_continue_here, expand_end_loop, expand_continue_loop,
- expand_exit_loop_top_cond, expand_value_return,
- expand_start_bindings_and_block, expand_end_bindings,
- expand_decl_cleanup, expand_start_case): Likewise.
- * unroll.c (copy_loop_body
- * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
- * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
- * config/rs6000/rs6000.c (rs6000_emit_eh_toc_restore,
- rs6000_emit_allocate_stack, rs6000_output_function_prologue,
- rs6000_output_function_epilogue, rs6000_output_mi_thunk): Likewise.
- * config/sh/sh.c (sh_output_mi_thunk): Likewise.
- * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
-
-2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
-
- * c-tree.h (grokfield): Remove unused filename and line parameters.
- * c-decl.c (grokfield): Remove unused filename and line parameters.
- * c-parse.in (component_decl): Adjust field grokking rules, adjust
- grokfield calls.
- (component_declarator): Likewise.
- (component_notype_declarator): Likewise.
- * objc/objc-act.c (build_module_descriptor): Adjust grokfield
- calls.
- (build_protocol_template, build_method_prototype_list_template,
- build_method_prototype_template, build_category_template,
- build_selector_template, build_class_template,
- build_super_template, build_ivar_template,
- build_ivar_list_template, build_method_list_template,
- build_method_template, add_instance_variable): Likewise.
-
-2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * stmt.c (do_jump_if_equal): Return 0 earlier if OP1 and
- OP2 are known to be not equivalent.
-
-2003-06-26 Devang Patel <dpatel@apple.com>
-
- * final.c (debug_flush_symbol_queue): New function.
- (debug_queue_symbol): New function.
- (debug_free_queue): New function.
- (debug_nesting): New variable.
- (symbol_queue): New variable.
- (symbol_queue_index): Same.
- (symbol_queue_size): Same.
- * debug.h (debug_flush_symbol_queue): New.
- (debug_queue_symbol): New.
- (debug_free_queue): New.
- (debug_nesting): New.
- (symbol_queue_index): New.
- * dbxout.c (DBXOUT_DECR_NESTING): New macro.
- (DBXOUT_DECR_NESTING_AND_RETURN): New macro.
- (dbxout_init): Delay symbol output.
- (dbxout_global_decl): Save, set and reset TREE_USED bit around
- dbxout_symbol() call.
- (dbxout_begin_function): Same.
- (dbxout_finish): Free symbol queue.
- (dbxout_type): Put appropriate symbols in queue.
- (dbxout_symbol): Put info for symbol's type in queue.
- Decrement/Increment nesting counts flush symbol queue appropriately.
- (dbxout_parms): Increment dbxout nesting.
- (dbxout_reg_parms): Same.
- * flags.h (flag_debug_only_used_symbols): New.
- * toplev.c (flag_debug_only_used_symbols): New variable.
- (lang_independent_options): Add entries for new option
- -feliminate-unused-debug-symbols.
- * common.opt: Add entry for -feliminate-unused-debug-symbols.
- * opts.c (common_handle_options): Same.
- * config/rs6000/darwin.h (CC1_SPEC): Interpret -gused as
- -feliminate-unused-debug-symbols.
- * doc/invoke.texi (Debugging Options): Document
- -feliminate-unused-debug-symbols.
-
-2003-06-26 Roger Sayle <roger@eyesopen.com>
- Jakub Jelinek <jakub@redhat.com>
-
- * builtins.c (expand_builtin_sprintf): Use c_getstr and strlen to
- obtain the format string instead of using TREE_STRING_POINTER and
- TREE_STRING_LENGTH. Only optimize sprintf(dst,"%s",src) when the
- return value is unused or the length of src is a known constant.
-
-2003-06-26 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.h (REGISTER_NAMES): R0 is really AP.
-
-2003-06-26 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (ia64_expand_call): Don't add ar.pfs for sibcalls.
- (ia64_split_call): Only load descriptor for GP register inputs.
- (ia64_expand_epilogue): Check current_frame_info.mask not
- current_function_is_leaf to restore ar.pfs.
-
-2003-06-26 Richard Henderson <rth@redhat.com>
-
- * emit-rtl.c (try_split): Append to new CALL_INSN_FUNCTION_USAGE
- instead of replacing it.
-
-2003-06-26 Richard Henderson <rth@redhat.com>
-
- * flow.c (propagate_one_insn): Kill function return value
- registers across tail calls.
-
- * flow.c (propagate_one_insn): Preserve live-at-end registers
- across tail calls.
-
-2003-06-26 J"orn Rennecke <joern.rennecke@superh.com>
-
- * reload.c (can_reload_into): New function.
- (push_reload): Use it.
-
-2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (compute_a_rotate_length): Fix the
- references to the amount of a rotation.
-
-2003-06-26 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/sh/coff.h: Don't include dbxcoff.h.
- * config.gcc: List it here.
-
-2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * postreload.c (reload_cse_simplify_set): Call cselib_lookup
- earlier. Don't check if SRC is a constant.
-
-2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * Makefile.in (OBJS): Add postreload.o.
- Remove cselib.h from the dependency list for reload1.o.
- Add a dependency list for postreload.o.
- * reload.h: Change the comment for the prototype of
- reload_cse_regs.
- * reload1.c: Don't include cselib.h.
- (reload_cse_regs): Move to postreload.c
- (reload_cse_regs_1): Likewise.
- (reload_cse_noop_set_p): Likewise.
- (reload_cse_simplify_set): Likewise.
- (reload_cse_simplify_operands): Likewise.
- (RELOAD_COMBINE_MAX_USES): Likewise.
- (reload_combine_ruid): Likewise.
- (LABEL_LIVE): Likewise.
- (reload_combine): Likewise.
- (reload_combine_note_use): Likewise.
- (reload_combine_note_store): Likewise.
- (reg_set_luid): Likewise.
- (reg_offset): Likewise.
- (reg_base_reg): Likewise.
- (reg_mode): Likewise.
- (move2add_luid): Likewise.
- (move2add_last_label_luid): Likewise.
- (MODES_OK_FOR_MOVE2ADD): Likewise.
- (reload_cse_move2add): Likewise.
- (move2add_note_store): Likewise.
- (reload_cse_simplify): Likewise.
- * postreload.c: New.
-
-2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/avr/avr.c (final_prescan_insn): Remove support for
- -mrtl.
- * config/avr/avr.h (MASK_RTL_DUMP): Remove.
- (TARGET_RTL_DUMP): Likewise.
- (TARGET_SWITCHES): Remove -mrtl.
-
-2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Change emit_a_rotate to
- output_a_rotate. Add a prototype for compute_a_rotate_length.
- * config/h8300/h8300.c (emit_a_rotate): Change to
- output_a_rotate.
- (compute_a_rotate_length): New.
- (h8300_adjust_insn_length): Remove.
- * config/h8300/h8300.h (ADJUST_INSN_LENGTH): Remove.
- * config/h8300/h8300.md (adjust_length): Remove.
- (*rotlqi3_1): Use output_a_rotate and compute_a_rotate_length.
- (*rotlhi3_1): Likewise.
- (*rotlsi3_1): Likewise.
-
-2003-06-26 Roger Sayle <roger@eyesopen.com>
- Richard Henderson <rth@redhat.com>
-
- * builtins.c (expand_builtin_mathfn): Always stabilize the argument
- list against re-evaluation. If expand_unop fails, call expand_call
- with the stabilized argument list rather than return NULL_RTX.
- (expand_builtin_mathfn2): Likewise, always stabilize the argument
- list, and call expand_call ourselves if expand_binop fails.
-
-2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/11210
- * fold-const (decode_field_reference): Strip only NOPs that
- don't affect the sign.
-
-2003-06-26 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
-
- * gcc/config/sh/sh.md (push_fpscr): Enable for TARGET_SH2E.
- (pop_fpscr, fpu_switch): Likewise.
-
-2003-06-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * value-prof.c: New.
- * value-prof.h: New.
- * Makefile.in (value-prof.o): New.
- (LIBGCOV): Add _gcov_merge_single and _gcov_merge_delta
- (profile.o): Add value-prof.h and tree.h dependency.
- * flags.h (flag_profile_values): Declare.
- * gcov-io.h (GCOV_COUNTERS, GCOV_COUNTER_NAMES, GCOV_MERGE_FUNCTIONS):
- Add new counters.
- (GCOV_COUNTER_V_INTERVAL, GCOV_COUNTER_V_POW2, GCOV_COUNTER_V_SINGLE,
- GCOV_COUNTER_V_DELTA): New counter sections.
- (__gcov_merge_single, __gcov_merge_delta): Declare.
- * flow.c (mark_used_regs): Set subregs_of_mode only when the
- structure is initialized.
- * libgcov.c (__gcov_merge_single, __gcov_merge_delta): New functions.
- * profile.c: Include value-prof.h and tree.h.
- (gen_interval_profiler, gen_pow2_profiler, gen_one_value_profiler,
- gen_const_delta_profiler, instrument_values): New static functions.
- (get_exec_counts): Fix comment.
- (branch_prob): Invoke instrument_values.
- * toplev.c (flag_profile_values): New flag.
- * doc/invoke.texi (-fprofile-values): Document.
-
-2003-06-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * Makefile.in (cfgrtl.o): Add expr.h dependency.
- * cfgrtl.c: Include expr.h.
- (mark_killed_regs, safe_insert_insn_on_edge): New
- functions.
- * config/i386/i386.h (AVOID_CCMODE_COPIES): Define.
- * basic-block.h (safe_insert_insn_on_edge): Declare.
-
-2003-06-26 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (missing_arg): Make non-static.
- (c_common_handle_option): Don't check for missing arguments.
- * opts.c (handle_option): Check for missing arguments.
-
-2003-06-26 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/power4.md (power4-veccomplex): Correct latency.
-
-2003-06-25 Loren James Rittle <ljrittle@acm.org>
-
- * configure.in (ld_vers): Portability [sed].
- * configure: Regenerate with autoconf213.
-
-2003-06-25 H.J. Lu <hongjiu.lu@intel.com>
-
- * doc/extend.texi: Document new builtin functions for Intel
- Prescott New Intrunctions.
-
- * doc/invoke.texi: Document new command-line options, -mpni and
- -mno-pni, for Intel Prescott New Intrunctions.
-
- * config.gcc (extra_headers): Add pmmintrin.h for i[34567]86-*-*.
-
- * config/i386/i386.c (override_options): Turn on MASK_SSE2
- for -mpni. Turn on MASK_SSE for -msse2.
- (bdesc_2arg): Add PNI builtins with 2 args.
- (bdesc_1arg): Add PNI builtins with 1 arg.
- (ix86_init_mmx_sse_builtins): Handle PNI builtins.
- (ix86_expand_builtin): Likewise.
-
- * config/i386/i386.h (MASK_3DNOW, MASK_3DNOW_A,
- MASK_128BIT_LONG_DOUBLE, MASK_64BIT, MASK_MS_BITFIELD_LAYOUT,
- MASK_TLS_DIRECT_SEG_REFS): Renumbered.
- (TARGET_PNI): New.
- (TARGET_SWITCHES): Don't enable MASK_SSE for -msse2 here. Add
- -mpni and -mno-pni.
- (TARGET_CPU_CPP_BUILTINS): Defined __PNI__ for PNI.
- (ix86_builtins): Add PNI builtins.
- (config/i386/i386.md): Add PNI patterns.
-
- * config/i386/pmmintrin.h: New file.
-
-2003-06-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (call): Fix the insn lengths.
- (call_value): Likewise.
-
-Thu Jun 26 00:13:35 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * c-common.c (handle_used_attribute): Use mark_referenced.
- * varasm.c (mark_referenced): Break out from ...
- (assemble_name): ... here.
- * tree.h (mark_referenced): Declare.
-
-2003-06-25 Wolfgang Bangerth <bangerth@dealii.org>
-
- * gccbug.in: Add PCH to list of categories.
-
-2003-06-25 Martin Schaffner <schaffner@gmx.li>
-
- * cppfiles.c: Clarify comments.
- * cpphash.h: Likewise.
- * cpplib.h: Likewise.
- * cppmacro.c: Likewise.
- * mkdeps.h: Likewise.
-
-2003-06-25 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (complain_wrong_lang, write_langs): Remove.
- (c_common_handle_option): Complaints about wrong language are
- handled in opts.c now.
- * opts.c (complain_wrong_lang, write_langs, handle_options): New.
- (find_opt): Fix thinko.
- (handle_option): Update prototype. Complain about switches for
- a different front end.
- * opts.h (lang_names, handle_options): New.
- (handle_option): Remove.
- * opts.sh: Write out language names array.
- * toplev.c (parse_options_and_default_flags): Use handle_options.
-
-2003-06-25 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/i386/i386.c (MASK_SSE1): Removed.
- (MASK_SSE164): Removed.
- (MASK_SSE264): Removed.
- (bdesc_2arg): Replace MASK_SSE1 with MASK_SSE. Replace
- MASK_SSE164 with MASK_SSE | MASK_64BIT. Replace MASK_SSE264
- with MASK_SSE2 | MASK_64BIT.
- (bdesc_1arg): Likewise.
- (ix86_init_mmx_sse_builtins): Likewise.
-
- * config/i386/i386.h (TARGET_SSE): Remove MASK_SSE2.
- (TARGET_SWITCHES): Enable both MASK_SSE and MASK_SSE2 for
- -msse2.
-
-2003-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * hwint.h (HOST_WIDE_INT_PRINT, HOST_WIDE_INT_PRINT_C): New macros.
- (HOST_WIDE_INT_PRINT_DEC_SPACE,
- HOST_WIDE_INT_PRINT_UNSIGNED_SPACE,
- HOST_WIDEST_INT_PRINT_DEC_SPACE,
- HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE): Delete.
- (HOST_WIDE_INT_PRINT_DEC, HOST_WIDE_INT_PRINT_DEC_C,
- HOST_WIDE_INT_PRINT_UNSIGNED, HOST_WIDE_INT_PRINT_HEX): Define in
- terms of HOST_WIDE_INT_PRINT and possibly HOST_WIDE_INT_PRINT_C.
-
- * final.c (asm_fprintf): Use HOST_WIDE_INT_PRINT.
- * ra-debug.c (dump_static_insn_cost): Likewise.
-
-2003-06-26 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.h (BIGGEST_FIELD_ALIGNMENT): Define instead
- of ADJUST_FIELD_ALIGN if IN_TARGET_LIBS.
- Replace occurances of '???' with 'XXX' incase they are
- mistaken for trigraphs.
- (THUMB_PRINT_OPERAND_ADDRESS): abort if a compound address
- does not have a register for the first operand.
-
-2003-06-25 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
-
- * config/sh/sh.c (sh_register_move_cost):
- Add case for moving between MAC_REGS.
-
-2003-06-25 Zack Weinberg <zack@codesourcery.com>
-
- PR 10178
- * langhooks.h (struct lang_hooks): Add no_body_blocks bool.
- * langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): New; default false.
- * c-lang.c, objc/objc-lang.c: Override LANG_HOOKS_NO_BODY_BLOCKS
- to true.
- * stmt.c (is_body_block): If lang_hooks.no_body_blocks, always
- return 0.
-
-2003-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (bt-load.o): Depend on $(TM_P_H).
- * bt-load.c: Include "tm_p.h".
-
-2003-06-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (compute_mov_length): Adjust for the
- new optimization.
- * config/h8300/h8300.md (*movsi_h8300): Optimize the load of
- an SImode constant whose upper and lower are the same.
-
-Wed Jun 25 11:31:59 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * varasm.c (assemble_name): Mark needed variables even when
- global info is ready.
-
-2003-06-24 Jerry Quinn <jlquinn@optonline.net>
-
- PR other/11280
- * gcc/doc/invoke.texi (Optimization Options): Remove -Os from
- -freorder-functions description.
-
-2003-06-25 Josef Zlomek <zlomekj@suse.cz>
-
- * dwarf2out.c (gen_field_die): Return if type of decl is error mark.
-
-2003-06-25 Neil Booth <neil@daikokuya.co.uk>
-
- * opts.c (common_handle_option): Add missing break;s.
-
-2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- compute_mov_length.
- * config/h8300/h8300.c (compute_mov_length): New.
- * config/h8300/h8300.md (*movqi_h8300): Use it.
- (*movqi_h8300hs): Likewise.
- (movstrictqi): Likewise.
- (*movhi_h8300): Likewise.
- (*movhi_h8300hs): Likewise.
- (movstricthi): Likewise.
- (*movsi_h8300): Likewise.
- (*movsf_h8300): Likewise.
- (*movsi_h8300hs): Likewise.
- (*movsf_h8300hs): Likewise.
-
-2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
-
- * jump.c (next_nondeleted_insn): Remove.
- * rtl.h: Remove the prototype for next_nondeleted_insn.
-
-2003-06-24 Roger Sayle <roger@eyesopen.com>
-
- PR optimization/11311
- * builtins.c (powi_cost): Fix typo. The number of multiplications
- required is the number to reduce the argument, result, plus the
- cost of calculating the residual, val [not n, the original value].
-
-2003-06-24 Roger Sayle <roger@eyesopen.com>
-
- * config/alpha/osf5.h (TARGET_C99_FUNCTIONS): Define.
-
-2003-06-24 Richard Henderson <rth@redhat.com>
- (blame to: Loren James Rittle <ljrittle@acm.org>)
-
- * real.h (ieee_extended_intel_96_round_53_format): New.
- * real.c (ieee_extended_intel_96_round_53_format): New.
- * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Use it
- for XFmode and TFmode.
-
-2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (4 anonymous patterns): Give internal
- names.
- (movsi_h8300): Change the name to *movsi_h8300.
- (movsi_h8300hs): Change the name to *movsi_h8300hs.
- (movsf_h8300): Change the name to *movsf_h8300.
- (movsf_h8300hs): Change the name to *movsf_h8300hs.
-
-2003-06-24 Jakub Jelinek <jakub@redhat.com>
-
- * builtins.c (expand_builtin_strcpy): Don't evaluate side-effects in
- src twice.
-
-2003-06-24 J"orn Rennecke <joern.rennecke@superh.com>
-
- Back out these patches:
- 2003-06-02 J"orn Rennecke <joern.rennecke@superh.com>
- * sh.h (OLD_ARG_MODE): New macro.
- (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
- (FUNCTION_ARG_1): Break out of:
- (FUNCTION_ARG). Use OLD_ARG_MODE.
- 2003-06-06 J"orn Rennecke <joern.rennecke@superh.com>
- * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode
- of the generated register.
-
- * sh.h (FUNCTION_ARG_SCmode_WART): Define.
- (FUNCTION_ARG): Unless FUNCTION_ARG_SCmode_WART is defined and
- an even number of floating point regs are in use, use the same
- sequence of argument passing registers for SCmode as would be
- used for two SFmode values.
- * sh.c (sh_va_arg): If FUNCTION_ARG_SCmode_WART is defined,
- swap real / imaginary parts in incoming SCmode values passed
- in registers.
-
-2003-06-24 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
-
- PR target/11260
- * config/alpha/alpha.md (sqrtdf2): Fix operand substitution.
-
-Tue Jun 24 18:49:33 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * Makefile.in (cgraph.o): Depend on output.h, not depend on
- tree-inline.h
- * cgraph.c: Do not include tree-inline.h; include output.h
- (known_fns): Rename to ...
- (known_decls): ... this one; update all uses.
- (cgraph_varpool_hash): New static variable.
- (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): New global
- variables.
- (cgraph_varpool_hash_node, eq_cgraph_varpool_node, cgraph_varpool_node,
- cgraph_varpool_node_for_identifier, cgraph_varpool_mark_needed_node,
- cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls):
- New functions.
- * cgraph.h (cgraph_varpool_node): New structure.
- (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): Declare.
- (cgraph_varpool_node, cgraph_varpool_node_for_identifier,
- cgraph_varpool_finalize_decl, cgraph_varpool_mark_needed_node,
- cgraph_varpool_asemble_pending_decls): Declare.
- * cgraphunit.c (record_call_1): Notice variable references.
- (cgraph_finalize_compilation_unit): Assemble pending variables.
- * toplev.c (wrapup_global_declarations): Use varpool.
- (compile_file): Assemble pending declarations.
- (rest_of_decl_compilation): Use varpool in unit-at-a-time mode.
- * varasm.c (assemble_name): Notice varpool references.
-
-Tue Jun 24 13:52:11 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro.
- * langhooks.h (lang_hooks_for_decls): Add prepare_assemble_variable.
- * varasm.c (assemble_variable): Call prepare_assemble_variable.
-
-2003-06-23 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (expand_builtin): Use expand_builtin_pow to expand
- calls for pow, powf, powl and their __builtin_ variants.
- (expand_builtin_pow): If the second argument is a constant
- integer and compiling with -ffast-math, use expand_powi to
- generate RTL if powi_cost is less than POWI_MAX_MULTS.
- (powi_cost): New function to return the number of multiplications
- necessary to evaluate an Nth power, for integer constant N.
- (expand_powi): New function to expand the RTL for evaluating
- the Nth power of a floating point value, for integer constant N.
-
- * doc/tm.texi (POWI_MAX_MULTS): Document new target macro.
-
-Mon Jun 23 23:07:35 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * cgraph.c (cgraph_nodes_queue): Declare.
- (eq_node): Take identifier as p2.
- (cgraph_node): Update htab_find_slot_with_hash call.
- (cgraph_node_for_identifier): New.
- (cgraph_mark_needed_node): Move here from cgraphunit.c.
- * cgraph.h (cgraph_nodes_queue): Declare.
- (cgraph_node_for_identifier): Declare.
- * cgraphunit.c (cgraph_finalize_function): Collect entry points here
- instead of in cgraph_finalize_compilation_unit; constructors and
- destructors are entry points.
- (cgraph_finalize_compilation_unit): Reorganize debug outout;
- examine nested functions after lowerng; call collect_functions hook.
- (cgraph_mark_local_functions): DECL_COMDAT functions are not local.
- (cgraph_finalize_compilation_unit): Do not collect entry points.
- * varasm.c: Include cgraph.h
- (assemble_name): Mark referenced identifier as needed.
-
- * cgraphunit.c (record_call_1): Use get_callee_fndecl.
-
-2003-06-23 Jakub Jelinek <jakub@redhat.com>
-
- * config/i386/i386.c (x86_output_mi_thunk): Don't pass MEM to %P0,
- just SYMBOL_REF.
- * config/s390/s390.c (s390_output_mi_thunk): Avoid .plt in -m31
- mode, as it requires pic register loaded.
-
- * varasm.c (resolve_unique_section): Remove prototype. No longer
- static.
- * tree.h (resolve_unique_section): New prototype.
-
-2003-06-23 Andreas Schwab <schwab@suse.de>
-
- PR debug/9905
- * dwarf2out.c (loc_descriptor_from_tree): Handle MODIFY_EXPR by
- recursing through first argument.
-
-2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * ChangeLog.1: Fix a typo.
- * cfgrtl.c: Fix comment typos.
- * dwarf2out.c: Likewise.
- * expmed.c: Likewise.
- * genrecog.c: Likewise.
- * jump.c: Likewise.
- * rtlanal.c: Likewise.
- * ssa-dce.c: Likewise.
- * toplev.c: Likewise.
-
-2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/extend.texi: Fix typos.
- * doc/md.texi: Likewise.
- * doc/tm.texi: Likewise.
-
-2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * basic-block.h: Fix comment formatting.
- * bt-load.c: Likewise.
- * builtins.c: Likewise.
- * c-common.c: Likewise.
- * c-common.h: Likewise.
- * c-format.c: Likewise.
- * coverage.c: Likewise.
- * cpplib.h: Likewise.
- * cpppch.c: Likewise.
- * dbxout.c: Likewise.
- * diagnostic.c: Likewise.
- * dwarf2out.c: Likewise.
- * expr.c: Likewise.
- * fold-const.c: Likewise.
- * function.c: Likewise.
- * gcc.c: Likewise.
- * gcov-io.c: Likewise.
- * gcov-io.h: Likewise.
- * gcov.c: Likewise.
- * profile.c: Likewise.
- * real.h: Likewise.
- * sched-deps.c: Likewise.
-
-2003-06-23 Roger Sayle <roger@eyesopen.com>
- Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Add a note on testing and
- remove duplicates from testers list.
-
-2003-06-23 Nick Clifton <nickc@redhat.com>
-
- * read-rtl.c (read_braced_string): Check for EOF. If
- encountered issue an error message.
-
-2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Document dump options, dT and dW.
-
-2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * genrecog.c (pred_table): Remove the entry for
- mode_independent_operand.
- * recog.c (next_insns_test_no_inequality): Remove.
- (mode_independent_operand): Likewise.
- * recog.h: Remove the prototype for mode_independent_operand.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_simode_bld): Use rotxl.l to
- store into bit 0.
- * config/h8300/h8300.md (*extzv_1_r_h8300hs): Change cc of the
- second alternative to set_znv.
- (*extzv_1_r_inv_h8300hs): Likewise.
-
-2003-06-23 Hans-Peter Nilsson <hp@bitrange.com>
-
- * configure.in (in_tree_gas): Find out here whether GAS is ELF,
- set in_tree_gas_is_elf accordingly.
- (in_tree_ld): Find out whether LD emulation is ELF, set
- in_tree_ld_is_elf accordingly.
- (gcc_cv_as_subsections, gcc_cv_as_hidden, gcc_cv_as_leb128)
- (gcc_cv_as_eh_frame, gcc_cv_as_shf_merge)
- (gcc_cv_as_dwarf2_debug_line, gcc_cv_as_gdwarf2_flag)
- (gcc_cv_as_gstabs_flag): Use $in_tree_gas_is_elf instead of
- grepping gas/Makefile.
- (gcc_cv_ld_ro_rw_mix, gcc_cv_ld_eh_frame_hdr, gcc_cv_ld_pie): Use
- $in_tree_ld_is_elf instead of grepping ld/Makefile.
- * configure: Regenerate.
-
-2003-06-22 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (expand_builtin_mathfn_2): Use tree_cons to build
- up the stabilized argument list, not build_tree_list.
- (expand_builtin_strcpy): Construct new argument list manually
- instead of using chainon to modify the original argument list.
- (expand_builtin_stpcpy): Construct new argument list manually
- instead of using copy_list and chainon.
- (expand_builtin_sprintf): New function. Optimize calls to
- sprintf when the format is "%s" or doesn't contain a '%'.
- (expand_builtin): Expand BUILT_IN_SPRINTF using the new function
- expand_builtin_sprintf.
-
-2003-06-22 Andreas Schwab <schwab@suse.de>
-
- * function.c (set_insn_locators): Mark as unused.
-
-2003-06-22 Neil Booth <neil@daikokuya.co.uk>
-
- * common.opt: Add -finline-limit.
- * opts.c (common_handle_options): Handle it.
- * opts.sh: Temporary kludge for -finline-limit.
- * toplev.c (decode_f_option, independent_decode_option): Die.
- (parse_options_and_default_flags): No independent_decode_option.
-
-2003-06-22 Andreas Jaeger <aj@suse.de>
-
- * calls.c (emit_call_1): Readd lost ATTRIBUTE_UNUSED.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Document dumps, .btl, .cfg, and .bypass.
-
-2003-06-22 Andreas Schwab <schwab@suse.de>
-
- * doc/invoke.texi: Remove leading `-' from options in index.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * bt-load.c: Follow spelling conventions.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * expr.c (emit_move_insn_1): Fix a comment typo.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Alphabetize dump options.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Remove a duplicate -dk.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Update dump file names.
-
-2003-06-22 Zack Weinberg <zack@codesourcery.com>
-
- * config/i370/i370.c, config/i370/i370.h: Use HOST_CHARSET_ASCII
- and HOST_CHARSET_EBCDIC, not HC_ASCII and HC_EBCDIC.
-
-2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/rtl.texi: Fix the @findex for pre_modify.
-
-2003-06-22 Andreas Jaeger <aj@suse.de>
-
- * caller-save.c: Convert to ISO C90.
- * calls.c: Likewise.
- * cfg.c: Likewise.
- * cfganal.c: Likewise.
- * cfgbuild.c: Likewise.
- * cfgcleanup.c: Likewise.
- * cfghooks.c: Likewise.
- * cfglayout.c: Likewise.
- * cfglayout.h: Likewise.
- * cfgloop.c: Likewise.
- * cfgloop.h: Likewise.
- * cfgloopanal.c: Likewise.
- * cfgloopmainip.c: Likewise.
- * cfgrtl.c: Likewise.
-
-2003-06-22 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.h (BIGGEST_ALIGNMENT): Use TARGET_REALLY_IWMMXT for selecting
- 64-bit alignment.
-
-2003-06-22 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (all call_value patterns): Remove register constraints on
- value operand.
-
-2003-06-22 Neil Booth <neil@daikokuya.co.uk>
-
- * common.opt: More -f switches.
- * opts.c (common_handle_options): Handle them.
- * toplev.c (time_report): Make extern.
- (f_options): USe flag_dummy.
- (decode_f_option): No need to use f_options now.
- * toplev.h (flag_cprop_registers, flag_ssa, flag_ssa_ccp,
- flag_ssa_dce, time_report, flag_new_regalloc): Make extern.
-
-2003-06-22 Andreas Jaeger <aj@suse.de>
-
- * c-lex.c: Convert to ISO C90.
- * c-objc-common.c: Likewise.
- * c-opts.c: Likewise.
- * c-pch.c: Likewise.
- * c-ppoutput.c: Likewise.
- * c-pragma.h: Likewise.
- * c-pretty-print.c: Likewise.
- * c-pretty-print.h: Likewise.
- * c-semantics.c: Likewise.
- * c-tree.h: Likewise.
- * c-typeck.c: Likewise.
-
- * c-lang.c: Convert to ISO C90.
-
-2003-06-22 Neil Booth <neil@daikokuya.co.uk>
-
- * opts.c (find_opt): Fix to always guarantee a find of a
- switch with joined parameter.
- * opts.h (struct cl_option): New member back_chain.
- * opts.sh: Update to calculate and add back_chain member.
-
-2003-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * diagnostic.h (output_host_wide_integer): Declare.
- * diagnostic.c (output_long_long_decicaml): New function.
- (output_host_wide_integer): Likewise.
- (output_format): Use them. Handle "%ll" and "%w".
-
-2003-06-21 Jason Thorpe <thorpej@wasabisystems.com>
-
- * config.gcc (*-*-netbsd*): Add t-libgcc-pic to tmake_file.
-
-2003-06-21 Zack Weinberg <zack@codesourcery.com>
-
- * aclocal.m4 (gcc_AC_C_CHARSET): Delete.
- * configure.in: Don't use gcc_AC_C_CHARSET.
- * configure, config.in: Regenerate.
- * config/i370/i370.c, config/i370/i370.h: Use
- (HOST_CHARSET == HC_EBCDIC) or (HOST_CHARSET == HC_ASCII)
- instead of HOST_EBCDIC or !HOST_EBCDIC. Clarify comments a tad.
-
-2003-06-21 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * common.opt: New switches.
- * opts.c: Include diagnostic.h.
- (common_handle_option): Handle new switches.
- * toplev.c (flag_loop_optimize, flag_crossjumping, flag_if_conversion,
- flag_if_conversion2, flag_delete_null_pointer_checks,
- flag_rerun_cse_after_loop): Make extern.
- (flag_dummy): New.
- (f_options): Update to use flag_dummy for moved options.
- (decode_f_option): Some switches moved to opts.c.
- * toplev.h (flag_loop_optimize, flag_crossjumping, flag_if_conversion,
- flag_if_conversion2, flag_delete_null_pointer_checks,
- flag_rerun_cse_after_loop, flag_keep_static_consts, flag_peel_loops,
- flag_tracer, flag_thread_jumps, flag_unroll_loops,
- flag_unroll_all_loops, flag_unswitch_loops): New.
-
-Sat Jun 21 13:41:00 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_va_arg): Fix allocation of temporary slot.
-
-2003-06-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- same_cmp_preceding_p.
- * config/h8300/h8300.c (same_cmp_preceding): New.
- * config/h8300/h8300.md: Extend peephole2's that transform
- compare:SI into shorter sequences so that they can deal with
- signed comparisons.
-
-2003-06-21 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Use Windows instead of Win32.
-
- Update Andreas Jaeger's entry.
-
- Merge the two entries of Kaveh Ghazi, David Edelsohn, and
- Loren J. Rittle.
-
-2003-06-21 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * mkconfig.sh: Add multiple inclusion guards to generated headers.
-
-2003-06-20 Neil Booth <neil@daikokuya.co.uk>
-
- * c-decl.c (store_parm_decls): Make saved_warn_shadow boolean.
- * common.opt: Add remaining -W options and -g.
- * diagnostic.c (warnings_are_errors): Remove.
- * flags.h: Make most warning flags boolean.
- * opts.c (common_handle_option): Handle remaining -W options, and -g.
- Move many warning flags from toplev.c, making them boolean.
- * toplev.c: Remove many warning flags.
- (decode_W_option): Remove.
- (decode_g_option): Make extern. Error on unknown switch.
- (lang_independent_W_options): Use warn_dummy.
- (independent_decode_option): Just handle -f switches now.
- * toplev.h (decode_g_option): New.
-
-2003-06-20 Aldy Hernandez <aldyh@redhat.com>
-
- PR/11092
- * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Adjust for
- vectors.
-
-2003-06-20 Kelley Cook <kelleycook@wideopenwest.com>
-
- * opts.sh: Tweak awk script for portability.
-
-2003-06-20 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/10888
- * tree-inline.c (expand_call_inline): Do not warn about failing to
- inline functions declared in system headers.
- * doc/invoke.texi (-Winline): Expand on documentation.
-
-2003-06-20 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (alpha_file_start): Disable
- file_start_file_directive for ELF and not MDEBUG.
-
-2003-06-20 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (ROUND_TYPE_ALIGN): Remove.
-
-2003-06-20 Richard Henderson <rth@redhat.com>
-
- * hooks.c (hook_int_void_no_regs): Rename from
- hook_reg_class_void_no_regs; change return type.
- * hooks.h: Update.
- * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Update.
- * target.h (branch_target_register_class): Change return type to int.
- Add documentation.
- * config/sh/sh.c (sh_target_reg_class): Change return type.
- * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise.
-
-2003-06-20 Andreas Tobler <toa@pop.agri.ch>
-
- * c-format.c: Change _Bool to bool reverting part of the last
- patch.
-
-2003-06-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * som.h (ASM_OUTPUT_SOURCE_LINE): Use targetm.strip_name_encoding to
- strip name encoding.
-
-2003-06-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * configure.in (gcc_cv_as_gstabs_flag): Disable if assembler warns.
- * configure: Regenerate.
- Fixes PR driver/9362.
-
-2003-06-20 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * config/alpha/alpha.c (alpha_file_start): Fix typo.
-
-2003-06-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/mips/mips.h (PUT_SDB_FUNCTION_END): Pass 0 as third arg
- to ASM_OUTPUT_SOURCE_LINE.
-
-2003-06-20 Daniel Egger <degger@fhm.edu>
- Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Building): Correct and improve statement
- about parallel builds.
-
-2003-06-20 Andreas Jaeger <aj@suse.de>
-
- * c-common.c: Change _Bool to bool reverting part of the last
- patch.
-
-2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
-
- * tree.h (expand_function_end): Remove all parameters.
- * function.c (expand_function_end): Remove all parameters.
- Use input_location. Never expand_end_bindings.
- * c-decl.c (c_expand_body_1): Adjust expand_function_end call.
- * coverage.c (create_coverage): Likewise.
-
-2003-06-20 Nick Clifton <nickc@redhat.com>
-
- * doc/extend.texi (ARM Built-in Functions): New node. Document
- ARM builtin functions for iWMMXt support.
-
-2003-06-20 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/install.texi (--with-gnu-as): Mention SPARC/Solaris and
- SPARC64/Solaris as platforms where --with-gnu-as makes a difference.
- (--with-as): Add @anchor.
- (--with-gnu-ld): Fix typo.
- (--with-ld): Add @uref to --with-as.
-
-2003-06-19 Zack Weinberg <zack@codesourcery.com>
-
- * doc/tm.texi: Uniformly use @defmac for macros, rather than
- @table items. Minor formatting and editorial corrections.
-
-2003-06-20 Neil Booth <neil@daikokuya.co.uk>
-
- * line-map.c, line-map.h: Convert to ISO prototypes.
-
-2003-06-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * gcse.c (store_killed_in_insn): Fix.
-
-2003-06-19 Zack Weinberg <zack@codesourcery.com>
-
- * target.h (asm_out.file_start, file_start_app_off,
- file_start_file_directive): New hooks.
- * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE,
- TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START):
- New hook-definition macros.
- * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START.
- * varasm.c (default_file_start): New.
- * output.h: Prototype it.
- * toplev.c (init_asm_output): Use targetm.asm_out.file_start.
- * system.h: Poison ASM_FILE_START.
-
- * config/alpha/alpha.c (alpha_write_verstamp): Delete.
- (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK.
- (unicosmk_asm_file_start): Rename unicosmk_file_start,
- make static, take no arguments.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END,
- TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate.
- * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor
- TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in
- comment.
- * config/arc/arc.c (arc_asm_file_start): Rename
- arc_file_start, take no arguments, make static.
- (TARGET_ASM_FILE_START): Set it.
- * config/arm/arm.c (aof_file_start): New static function.
- (TARGET_ASM_FILE_START): Set it, when appropriate.
- * config/arm/coff.h, config/arm/elf.h:
- Set TARGET_ASM_FILE_START_APP_OFF to true.
- * config/avr/avr.c (asm_file_start): Rename avr_file_start,
- take no arguments, make static.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
- Set them.
- * config/c4x/c4x.c (c4x_file_start): New static function.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
- Set them.
- * config/cris/cris.c (cris_file_start): New static function.
- (TARGET_ASM_FILE_START): Set it.
- * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename
- dsp16xx_file_start, make static.
- (luxworks_dsp16xx_file_start): Delete.
- (TARGET_ASM_FILE_START): Set it.
- * config/h8300/h8300.c (asm_file_start): Rename
- h8300_file_start, make static, take no arguments.
- (TARGET_ASM_FILE_START): Set it.
- * config/i370/i370.c (i370_file_start): New static function.
- (TARGET_ASM_FILE_START): Set it.
- * config/i386/i386.c (x86_file_start): New static function.
- (TARGET_ASM_FILE_START): Set it.
- * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE,
- X86_FILE_START_FLTUSED): New macros, default to false.
- * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1.
- * config/i386/sysv4.h, config/i386/sco5.h: Override
- X86_FILE_START_VERSION_DIRECTIVE to true.
- * config/ia64/ia64.c (ia64_file_start): New static function.
- (TARGET_ASM_FILE_START): Set it.
- (emit_safe_across_calls): Take no arguments.
- * config/ia64/ia64.md: Update to match.
- * config/m32r/m32r.c (m32r_asm_file_start): Rename
- m32r_file_start, make static, take no arguments.
- (TARGET_ASM_FILE_START): Set it.
- * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename
- m68hc11_file_start, make static, take no arguments.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
- (print_options): Delete.
- * config/m68k/m68k.c (m68k_hp320_file_start): New static function.
- (TARGET_ASM_FILE_START_APP_OFF): Set.
- * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to
- m68k_hp320_file_start.
- * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start):
- Make static, take no arguments.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
- * config/mmix/mmix.c (mmix_asm_file_start): Rename
- mmix_file_start, make static, take no arguments.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
- * config/mn10300/mn10300.c (asm_file_start): Rename
- mn10300_file_start, make static, take no arguments.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
- * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set.
- * config/pa/pa.c (pa_file_start_level, pa_file_start_space,
- pa_file_start_file, pa_file_start_mcount, pa_elf_file_start,
- pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start,
- pa_hpux64_hpas_file_start): New static functions.
- * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start.
- * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to
- pa_linux_file_start.
- * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to
- pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as
- appropriate.
- * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start.
- * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF.
- (rs6000_file_start): Make static, take no arguments. Reset
- default_cpu under certain conditions.
- (rs6000_xcoff_file_start): New function.
- * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set.
- * config/rs6000/xcoff.h (TARGET_ASM_FILE_START,
- TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override.
- * config/sh/sh.c (output_file_start): Rename
- sh_file_start, make static, take no arguments. Merge in old
- code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
- * config/sh/sh.c (TARGET_ELF): Define to 0.
- * config/sh/elf.h (TARGET_ELF): Redefine to 1.
- * config/v850/v850.c (asm_file_start): Delete.
- (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
- * config/vax/vax.c (vax_file_start): New static function.
- (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set.
-
- * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false.
- * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h
- * config/i386/att.h, config/i386/gas.h, config/i386/linux.h
- * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h
- * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h
- * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true.
-
- * config/darwin.h, config/elfos.h, config/alpha/elf.h
- * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h
- * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h
- * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h
- * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h
- * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h
- * config/i370/i370.h, config/i386/att.h, config/i386/gas.h
- * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h
- * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h
- * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h
- * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h
- * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h
- * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h
- * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h
- * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h
- * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h
- * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h
- * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START.
-
- * config/alpha/alpha-protos.h, config/arc/arc-protos.h
- * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h
- * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
- * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h
- * config/mips/mips-protos.h, config/mmix/mmix-protos.h
- * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h
- * config/sh/sh-protos.h, config/v850/v850-protos.h: Update.
-
- * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h:
- Remove reference to ASM_FILE_START in comment.
- * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h
- * config/arm/linux-gas.h, config/arm/netbsd-elf.h
- * config/arm/netbsd.h: Delete definition of ARM_OS_NAME.
-
-2003-06-19 Graeme Peterson <gp@qnx.com>
-
- * gcc.c (target_sysroot_suffix, target_sysroot_hdrs_suffix,
- SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC, sysroot_suffix_spec,
- sysroot_hdrs_suffix_spec): New.
- (static_specs): Initialize new variables.
- (add_sysroot_suffix_prefix, do_spec_1, main): Use new variables.
- * doc/tm.texi (SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC):
- New macros.
-
-2003-06-19 Andreas Jaeger <aj@suse.de>
-
- * c-aux-info.c: Convert to ISO C90.
- * c-pragma.c: Likewise.
- * c-common.c: Likewise.
- * c-common.h: Likewise.
- * c-convert.c: Likewise.
- * c-cppbuiltin.c: Likewise.
- * c-dump.c: Likewise.
- * c-decl.c: Likewise
- * c-format.c: Likewise.
- * c-incpath.c: Likewise.
- * c-incpath.h: Likewise.
-
-2003-06-19 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (expand_errno_check): Assume that flag_errno_math
- and HONOR_NANS have been tested before calling here. Only try
- to set errno ourselves if the decl can't throw an exception.
- (expand_builtin_mathfn): Move the code to stabilize the arg
- after the main switch, so that that its only done when needed.
- BUILT_IN_SQRT{,F,L} doesn't set errno if its arg is nonnegative.
- Don't modify the original expr when stabilizing the argument.
- (expand_builtin_mathfn_2): Likewise, move the code to stabilize
- the args after the main switch, and don't modify the orginal exp.
-
-2003-06-19 Aldy Hernandez <aldyh@redhat.com>
-
- * expr.c (const_vector_from_tree): Initialize remaining elements
- to 0.
-
-2003-06-19 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.md ("spe_evfscfsi"): Change operand types.
- Change "fix" to "float".
-
-2003-06-19 Andreas Jaeger <aj@suse.de>
-
- * c-tree.h: Remove declaration of poplevel.
-
- * tree.h: Remove declaration of approx_sqrt.
-
- * c-lex.c: Remove redundant declaration of asm_out_file.
-
- * flags.h: Remove declaration of warn_unknown_pragma and
- main_input_filename.
-
- * rtl.h: Remove functions from fold-const.c since they're already
- declared in tree.h.
-
- * regs.h: Remove redundant declaration of reg_names.
-
- * bt-load.c (migrate_btr_defs): Correct printf arguments.
-
- * protoize.c: Fix breakage from last patch.
-
-2003-06-19 J"orn Rennecke <joern.rennecke@superh.com>
-
- * hooks.h (hook_reg_class_void_no_regs): Only declare if tm.h
- has been included.
-
-2003-06-18 James A Morrison <ja2morri@student.math.uwaterloo.ca>
-
- * config/sparc/sparc.c: Update copyright year.
-
-2003-06-19 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (init_cumulative_args): Limit CALL_LIBCALL
- to ABI_V4.
-
-2003-06-18 Joseph S. Myers <jsm@polyomino.org.uk>
-
- PR bootstrap/4068
- * config/i386/liunx.h: Don't include sys/ucontext.h for glibc 2.0.
-
-2003-06-19 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (TARGET_INITIALIZER and friends): Move
- to the end of the file. Remove unnecessary prototypes.
-
-2003-06-19 Hans-Peter Nilsson <hp@axis.com>
-
- * bt-load.c (migrate_btr_def) [INSN_SCHEDULING]: Conditionalize
- calls to insn_default_latency and result_ready_cost. Initialize
- def_latency to 1.
-
-2003-06-18 Richard Henderson <rth@redhat.com>
-
- * config/ia64/unwind-ia64.c (_Unwind_GetCFA): New.
- (_Unwind_FindEnclosingFunction): Implement.
-
-2003-06-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * toplev.c (rest_of_handle_sched): Hide the entire function if
- INSN_SCHEDULING is not defined.
- (rest_of_compilation): Call rest_of_handle_sched() only when
- INSN_SCHEDULING is defined.
-
-2003-06-18 Stephen Clarke <stephen.clarke@superh.com>
- J"orn Rennecke <joern.rennecke@superh.com>
-
- * bt-load.c: New file.
- * Makefile.in (OBJS): Include bt-load.o
- (bt-load.o): Add dependencies.
- * flags.h (flag_branch_target_load_optimize): Declare.
- (flag_branch_target_load_optimize2): Likewise.
- * hooks.c (hook_reg_class_void_no_regs): New function.
- (hook_bool_bool_false): Likewise.
- * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare.
- * rtl.h (branch_target_load_optimize): Declare.
- * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define.
- (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
- (TARGET_INITIALIZER): Include these.
- * target.h (struct gcc_target): Add branch_target_register_class
- and branch_target_register_callee_saved members.
- * toplev.c (enum dump_file_index): Add DFI_branch_target_load
- (dump_file) Add "tars" entry.
- (flag_branch_target_load_optimize): New variable.
- (flag_branch_target_load_optimize2): Likewise.
- (lang_independent_options): Add entries for new options.
- (rest_of_compilation): Call branch_target_load_optimize.
- * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document.
- (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
- * doc/invoke.texi: Document -fbranch-target-load-optimize and
- -fbranch-target-load-optimize2.
- * rtl.h (epilogue_completed): Declare.
- * recog.c (epilogue_completed): New variable.
- * toplev.c (rest_of_compilation): Set it.
- * flow.c (mark_regs_live_at_end): Use it.
- * config/ia64/ia64.c (ia64_output_mi_thunk): Set it.
- * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
- * config/sh/sh.c (sh_output_mi_thunk): Likewise.
- * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
-
- * sh.c (shmedia_space_reserved_for_target_registers): New variable.
- (sh_target_reg_class): New function.
- (sh_optimize_target_register_callee_saved): Likwise.
- (shmedia_target_regs_stack_space): Likewise.
- (shmedia_reserve_space_for_target_registers_p): Likewise.
- (shmedia_target_regs_stack_adjust): Likewise.
- (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override.
- (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
- (calc_live_regs): If flag_branch_target_load_optimize2 and
- TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved
- for target registers, make sure that we save all target registers.
- (sh_expand_prologue, sh_expand_epilogue): Take target register
- optimizations into account. Collapse stack adjustments if that
- is beneficial.
- (initial_elimination_offset): Reserve space for target registers
- if necessary.
- * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define.
- (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize.
-
-2003-06-18 Nick Clifton <nickc@redhat.com>
-
- * config.gcc: Add an extra_header for ARM targets.
- Support configuring with --with-cpu=iwmmxt.
- * doc/invoke.texi: Document new value for -mcpu= ARM switch.
- * config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
- names. Fix formatting.
- * config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
- names.
- * config/arm/arm-protos.h (arm_emit_vector_const): New
- prototype.
- (arm_output_load_gr): New prototype.
- * config/arm/arm.c (extra_reg_names1): Delete.
- (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT,
- * arch_is_iwmmxt): Define.
- (all_cores, all_architecture): Add entry for iwmmxt.
- (arm_override_options): Add support for iwmmxt.
- (use_return_insn, arm_function_arg, arm_legitimate_index_p,
- arm_print_value, arm_rtx_costs_1, output_move_double,
- arm_compute_save_reg_mask, arm_output_epilogue,
- arm_get_frame_size, arm_expand_prologue, arm_print_operand,
- arm_assemble_integer, arm_hard_regno_ok, arm_regno_class):
- Likewise.
- (arm_init_cumulative_args): Count iwmmxt registers.
- (arm_function_ok_for_sibcall): Return false of sibcall_blocked
- has been set.
- (struct minipool_node): Add fix_size field.
- (add_minipool_forward_ref): Add support for 8-byte aligning of
- the pool.
- (add_minipool_backward_ref, add_minipool_offsets,
- dump_minipool, push_minipool_fix): Likewise.
- (struct builtin_description): New struct.
- (builtin_description): New array of iwmmxt builtin functions.
- (arm_init_iwmmxt_builtins): New function.
- (arm_init_builtins): New function.
- (safe_vector_operand): New function.
- (arm_expand_binop_builtin): New function.
- (arm_expand_unop_builtin): New function.
- (arm_expand_builtin): New function.
- (arm_emit_vector_const): New function.
- (arm_output_load_gr): New function.
- * config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT,
- TARGET_REALLY_IWMMXT, arm_arch_iwmmxt, IWMMXT_ALIGNMENT,
- TYPE_NEEDS_IWMMXT_ALIGNMENT, ADJUST_FIELD_ALIGN,
- DATA_ALIGNMENT, LOCAL_ALIGNMENT, VECTOR_MODE_SUPPORTED_P): Define.
- (BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled.
- (CPP_CPU_ARCH_SPEC): Add entries for iwmmxt.
- (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER,
- reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
- REG_CLASS_FOR_LETTER): Add iwmmxt registers.
- (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt
- registers unless the iwmmxt target is selected.
- (FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM,
- FIRST_IWMMXT_REGNUM, LAST_IWMMXT_REGNUM, IS_IWMMXT_REGNUM,
- IS_IWMMXT_GR_REGNUM): Define.
- (FIRST_PSEUDO_REGISTER): Bump to 63.
- (struct machine_function): Add sibcall_blocked field.
- (Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and
- nargs fields.
- (enum arm_builtins): New enum list.
- * config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC,
- UNSPEC_TMOVMSK, UNSPEC_WSAD, UNSPEC_WSADZ, UNSPEC_WMACS,
- UNSPEC_WMACU, UNSPEC_WMACSZ, UNSPEC_WMACUZ, UNSPEC_CLRDI,
- UNSPEC_WMADDS, UNSPEC_WMADDU): New unspecs.
- (VUNSPEC_TMRC, VUNSPEC_TMCR, VUNSPEC_ALIGN8, VUNSPEC_WCMP_EQ,
- VUNSPEC_WCMP_GTU, VUNSPEC_WCMP_GT): New vunspecs.
- (movv2si, movv4hi, movv8qi): New expands for vector moves.
- Include iwmmxt.md.
- * config/arm/t-xscale-elf (MULTILIB_OPITONS): Add iwmmxt
- multilib.
- (MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise.
- * config/arm/mmintrin.h: New ARM specific header file.
- * config/arm/iwmmx.md: New iWMMXt specific machine patterns.
-
-2003-06-18 J"orn Rennecke <joern.rennecke@superh.com>
-
- * toplev.c (Remaining -d letters summary): Update.
-
-2003-06-18 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * config/rs6000/rs6000.c (init_cumulative_args): Add and handle LIBCALL
- argument.
- (function_arg): Handle CALL_LIBCALL flag.
- * config/rs6000/rs6000-protos.h (init_cumulative_args): Update
- prototype.
- * config/rs6000/rs6000.h (CALL_LIBCALL): New macro.
- (INIT_CUMULATIVE_LIBCALL_ARGS): New macro.
- (INIT_CUMULATIVE_ARGS): Add LIBCALL argument.
- (INIT_CUMULATIVE_INCOMING_ARGS): Likewise.
-
-2003-06-18 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * common.opt: New options.
- * opts.c (maybe_warn_unused_parameter, set_Wextra, handle_param,
- set_Wunused): New.
- (common_handle_option): Handle new options.
- * toplev.c (set_target_switch): Export.
- (set_Wextra, set_Wunused, maybe_warn_unused_parameter): Move to opts.c.
- (decode_W_option): -Wunused and -Wextra handled in opts.c now.
- (independent_decode_option): More options handled in opts.c now.
- Change prototype.
- * toplev.h (set_target_switch): New.
-
-2003-06-17 Robert Abeles <rabeles@archaelogic.com>
-
- PR debug/4252
- * c-opts.c (c_common_handle_option): Pass -fdump argument suffix
- to dump_switch_p().
- * tree-dump.c (dump_switch_p): Remove redundant 'dump-' prefix
- from static strings in dump_files.
-
-2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * system.h (ANSI_PROTOTYPES, PTR_CONST, LONG_DOUBLE, VPARAMS,
- VA_OPEN, VA_FIXEDARG, VA_CLOSE, VA_START): undef and poison these
- libiberty macros.
-
-2003-06-17 Jason Merrill <jason@redhat.com>
-
- PR c++/10929
- * tree-inline.c (expand_call_inline): Don't warn about failing to
- inline a function which was made inline by -finline-functions.
-
-2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Update to ISO C.
- * config/h8300/h8300.c: Likewise.
- * config/h8300/h8300.h: Likewise.
- * config/h8300/h8300.md: Likewise.
-
-2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * configure.in: Replace BUILD_CC references with CC_FOR_BUILD.
- * configure: Regenerate.
- * Makefile.in: Replace BUILD_CC references with CC_FOR_BUILD.
-
-2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
-
- * install.texi (Testing): Add information on how to run Java
- runtime tests separately.
-
-2003-06-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/mips/mips.md (trap): Use break 0 when !TARGET_GAS.
-
- * config/mips/iris6-o32.h (MIPS_ISA_DEFAULT): Remove.
- (MIPS_CPU_STRING_DEFAULT): Redefine to mips2.
-
-2003-06-17 Christopher Faylor <cgf@redhat.com>
-
- * doc/install.texi: Add msvc rebuild caveat.
-
-2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/sh/coff.h: Replace Hitachi with Renesas.
- * config/sh/elf.h: Likewise.
- * config/sh/embed-elf.h: Likewise.
- * config/sh/lib1funcs.asm: Likewise.
- * config/sh/sh-protos.h: Likewise.
- * config/sh/sh.c: Likewise.
- * config/sh/sh.h: Likewise.
- * config/sh/sh.md: Likewise.
-
-2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * ChangeLog.3: Fix comment typos.
- * ChangeLog.6: Likewise.
- * config/d30v/d30v.c: Likewise.
- * config/h8300/h8300.md: Likewise.
- * config/m32r/m32r.md: Likewise.
- * config/mips/mips.c: Likewise.
- * config/mips/mips.md: Likewise.
- * config/ns32k/NOTES: Likewise.
-
-2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
- Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/sourcebuild.texi (libgcj Tests): Simplify instructions on how
- to run Java runtime tests separately.
-
-2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Update a comment.
-
-2003-06-17 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (ROUND_TYPE_ALIGN, LOCAL_ALIGNMENT): Complex modes
- are aligned like integral modes.
- (SH5_WOULD_BE_PARTIAL_NREGS): Also test for CDImode and DCmode.
-
- * sh.h (EXTRA_CONSTRAINT_Csy): Allow PIC_DIRECT_ADDR_P.
- (LEGITIMATE_PIC_OPERAND_P): Allow LABEL_REF.
- * sh.md (*pt): Remove.
-
- * sh.h (REG_ALLOC_ORDER): Avoid squandering call-saved registers.
-
- * sh.md (return_media_rte): New pattern.
- (return_media): Use it.
-
-2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/contrib.texi: Replace Hitachi with Renesas.
- * doc/install.texi: Likewise.
- * doc/invoke.texi: Likewise.
-
-2003-06-17 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (CONST_OK_FOR_J16): Fix HOST_BITS_PER_WIDE_INT >= 64
- behaviour.
-
-2003-06-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * doc/tm.texi (MD_FALLBACK_FRAME_STATE_FOR): Mention MAKE_THROW_FRAME.
-
- * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Partly revert
- 2003-01-23 patch. Corrected to handle kernels with changed ucontext.
-
- * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Error on invalid
- -msdata=eabi usages.
-
- * gcc/config/rs6000/sysv4.h (USE_LIBC_1): Delete all uses.
-
-2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * alloc-pool.c: Don't check HAVE_LONG_DOUBLE.
- * fixinc/gnu-regex.c: Don't define `volatile'.
- * ggc-page.c: Don't check HAVE_LONG_DOUBLE.
- * ggc-simple.c: Likewise.
- * system.h: Don't define `volatile'.
-
- * aclocal.m4 (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Delete.
- * configure.in (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Don't
- call these macros.
- * config.in, configure: Regenerated.
-
-2003-06-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * config/ia64/ia64.c (ia64_expand_builtin, case IA64_BUILTIN_BSP):
- Handle POINTERS_EXTEND_UNSIGNED.
-
-2003-06-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/mips/mips.c (TARGET_ASM_UNALIGNED_DI_OP) [TARGET_IRIX5 &&
- !TARGET_IRIX6]: Define as NULL.
-
-2003-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * config/sparc/sparc.c (sparc_va_arg): Don't align 16-byte+ structures.
-
-2003-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * dbxout.c (dbxout_source_line_counter): New global variable.
- Mark it with GTY(()).
- (dbxout_source_line): Increment dbxout_source_line_counter
- and pass it to ASM_OUTPUT_SOURCE_LINE.
- * sdbout.c (sdbout_source_line_counter): New global variable.
- Mark it with GTY(()).
- (unnamed_struct_number): Mark it with GTY(()).
- (sdbout_source_line): Increment sdbout_source_line_counter
- and pass it to ASM_OUTPUT_SOURCE_LINE.
- * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Add third parameter
- (xcoffout_source_line): Pass 0 as third argument to
- ASM_OUTPUT_SOURCE_LINE.
- (xcoffout_begin_prologue): Likewise.
- * config/dbxout.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
- Use it instead of 'sym_lineno' but without incrementing it.
- * config/dbxelf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/lynx.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/ptx4.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/alpha/alpha.c (alpha_start_function): Pass 0 as third
- argument to ASM_OUTPUT_SOURCE_LINE.
- * config/alpha/alpha.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
- * config/arm/aout.h: Remove useless comment.
- * config/avr/avr.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
- * config/i960/i960.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
- Use it instead of 'sym_lineno' but without incrementing it.
- * config/m68k/hp320.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
- * config/mcore/mcore-pe.h (ASM_OUTPUT_SOURCE_LINE): Add third
- parameter. Use it instead of 'sym_lineno' but without incrementing it.
- * config/mips/mips.c (mips_output_function_prologue): Pass 0 as third
- argument to ASM_OUTPUT_SOURCE_LINE.
- * config/mips/mips.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
- * config/mmix/mmix.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/pa/som.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
- Use it instead of 'sym_lineno' but without incrementing it.
- * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/sh/elf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/sparc/aout.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * config/sparc/pbd.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
- * doc/tm.texi (ASM_OUTPUT_SOURCE_LINE): Document third parameter.
-
-2003-06-17 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_expand_block_move): Declare.
- (expand_block_move, output_block_move): Remove.
- * config/mips/mips.h (enum block_move_type): Remove.
- * config/mips/mips.c (block_move_call, output_block_move): Remove.
- (mips_block_move_straight, mips_adjust_block_mem): New function.
- (mips_block_move_loop): Renamed and reworked from block_move_loop.
- (mips_expand_block_move): Likewise expand_block_move. Return false
- to fall back on the target-independent code.
- * config/mips/mips.md (movstrsi): Use mips_expand_block_move.
- (movstrsi_internal*): Remove.
-
-2003-06-16 Zack Weinberg <zack@codesourcery.com>
-
- * cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c
- * cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c
- * cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to
- ISO C: new-style function declarations, no need for PARAMS,
- no special punctuation on indirect function calls, use string
- constant concatenation where convenient.
-
-2003-06-17 Andreas Jaeger <aj@suse.de>
-
- * rtl.h: Remove declarations from coverage.h.
- * toplev.c: Include coverage.h.
- * Makefile.in (toplev.o): Depend on coverage.h.
-
- * toplev.h: Remove extra declaration of print_time.
-
- * gengtype.c (close_output_files): Remove duplicated declaration.
-
-2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/sparc/sysv4.h: Remove target-independent comment;
- replace "GNU CC" with "GCC".
- * config/vxworks.h: Replace "GNU compiler" with "GCC".
- * config/sparc/aout.h, config/sparc/biarch64.h, config/sparc/elf.h,
- config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h,
- config/sparc/lite.h, config/sparc/litecoff.h, config/sparc/liteelf.h,
- config/sparc/netbsd-elf.h, config/sparc/openbsd.h,
- config/sparc/rtemself.h, config/sparc/sol2-64.h,
- config/sparc/sol2-bi.h, config/sparc/sol2-gas-bi.h,
- config/sparc/sol2-gld-bi.h, config/sparc/sol2-gld.h,
- config/sparc/sol2.h, config/sparc/sp64-aout.h,
- config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h,
- config/sparc/sparc-protos.h, config/sparc/sysv4-only.h: Replace
- "GNU compiler", "GNU CC" with "GCC".
- * config/sparc/cypress.md, config/sparc/hypersparc.md,
- config/sparc/sparc-modes.def, config/sparc/sparc.c,
- config/sparc/sparc.md, config/sparc/sparclet.md,
- config/sparc/supersparc.md, config/sparc/ultra1_2.md,
- config/sparc/ultra3.md: Replace "GNU CC", "GNU Compiler", and
- "GNU C Compiler" with "GCC".
- * config/ip2k/ip2k.h: Replace "GNU CC" and "GNU compiler" with "GCC".
-
-2003-06-16 Aldy Hernandez <aldyh@redhat.com>
-
- * simplify-rtx.c (simplify_subreg): Do not over-extend vector
- constants.
-
- * testsuite/gcc.c-torture/execute/simd-4.c: New.
-
-2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/ip2k/ip2k.h: Remove target-independent comments.
-
- * config.gcc: Explicitly mention elfos.h in ip2k entry.
- * config/ip2k/ip2k.h: Don't #include it here.
-
-2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
- config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
- dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
- function.c, gcc.c, genoutput.c, gensupport.c, global.c,
- haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
- loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
- read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
- stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
- the PTR macro.
-
- * gengtype.c: Don't use UNION_INIT_ZERO.
- * system.h (UNION_INIT_ZERO): Delete.
-
-2003-06-16 Richard Henderson <rth@redhat.com>
-
- * simplify-rtx.c (simplify_subreg): Use GET_MODE_SIZE instead of
- GET_MODE_UNIT_SIZE when simplifying constant vectors.
-
-2003-06-16 Andreas Jaeger <aj@suse.de>
-
- * timevar.c (get_run_time): Remove function provided also by
- libiberty.
- * timevar.h: Remove get_run_time declaration.
-
-2003-06-16 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): Remove
- unreachable code.
-
-2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c,
- cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't
- use macros from "symcat.h", instead rely on ISO C.
-
- * system.h: Don't include "symcat.h".
- * configure.in (AC_C_STRINGIZE): Delete.
- * config.in, configure: Regenerate.
-
-2003-06-16 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (install-mkheaders): Use INSTALL_SCRIPT for scripts.
-
- * tree.h (STMT_CHECK): New macro.
- Also upper-case argument names on all checking macros and
- fix some whitespace problems; assume CODE argument does not
- have side-effects.
-
-2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * scan.h: Convert to ISO C.
- * system.h: Likewise.
-
- * c-format.c (dynamic_format_types): New pointer for dynamic data.
- (find_length_info_modifier_index, init_dynamic_asm_fprintf_info):
- New functions split out of...
- (handle_format_attribute): ...here.
-
-2003-06-16 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (REG_CLASS_FROM_LETTER): Change to:
- (REG_CLASS_FROM_CONSTRAINT).
- (CONST_OK_FOR_I): Rename to:
- (CONST_OK_FOR_I08). Changed all users.
- (CONST_OK_FOR_J): Rename to:
- (CONST_OK_FOR_I16). Changed all users.
- (CONST_OK_FOR_K): Rename to:
- (CONST_OK_FOR_P27). Changed all users.
- (CONST_OK_FOR_L): Rename to:
- (CONST_OK_FOR_K08). Changed all users.
- (CONST_OK_FOR_O): Rename to:
- (CONST_OK_FOR_I06). Changed all users.
- (CONST_OK_FOR_P): Rename to:
- (CONST_OK_FOR_I10). Changed all users.
- (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define.
- (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise.
- (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise.
- (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise.
- (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise.
- (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise.
- (CONST_OK_FOR_LETTER_P): Replace with
- (CONST_OK_FOR_CONSTRAINT_P).
- (EXTRA_CONSTRAINT_S): Rename to:
- (EXTRA_CONSTRAINT_C16). Changed all users.
- (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses.
- (EXTRA_CONSTRAINT_T): Rename to:
- (EXTRA_CONSTRAINT_Csy). Changed all users.
- (EXTRA_CONSTRAINT_Z): Remove.
- (EXTRA_CONSTRAINT): Replace with:
- (EXTRA_CONSTRAINT_STR).
- (EXTRA_CONSTRAINT_U): Rename to:
- (EXTRA_CONSTRAINT_Z). Changed all users.
- * sh.c (and_operand): Use CONST_OK_FOR_J16.
- * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints.
- (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise.
- (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise.
- (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise.
- (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise.
- (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise.
- (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise.
- (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise.
- (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise.
- (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise.
- (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise.
- (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise.
- (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise.
- (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise.
- (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise.
- (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise.
- (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise.
- (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise.
- (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise.
- (sssubv4hi3): Likewise.
- (movsf_i): Change I[08]/r to G/r.
- (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc.
-
- * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD.
-
-2003-06-16 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/i386/i386.c (ix86_memory_move_cost): Fix typo.
-
-2003-06-16 Andreas Jaeger <aj@suse.de>
-
- * basic-block.h: Remove duplicate prototype of
- note_prediction_to_br_prob.
-
- * tree.h: Remove duplicate prototype of strip_float_extensions.
-
-2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * config/c4x/c4x.c: Don't include "c-tree.h".
- * config/pa/pa.c: Likewise.
- * langhooks.c: Likewise.
- * tree.h (poplevel): Declare.
-
-2003-06-16 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (const_costs): Move this to ...
- (h8300_rtx_costs): ... here.
-
-2003-06-16 Roger Sayle <roger@eyesopen.com>
-
- * optabs.h (enum optab_index): Add new OTI_tan and OTI_atan.
- (tan_optab, atan_optab): Define corresponding macros.
- * optabs.c (init_optabs): Initialize tan_optab and atan_optab.
- * genopinit.c (optabs): Implement tan_optab and atan_optab
- using tan?f2 and atan?f2 patterns.
- * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_TAN{,F,L}
- using tan_optab, and BUILT_IN_ATAN{,F,L} using atan_optab.
- Change the default value of errno_set to false.
- (expand_builtin): Expand BUILT_IN_TAN{,F,L} and BUILT_IN_ATAN{,F,L}
- using expand_builtin_mathfn.
-
- * config/i386/i386.md (atansf2, atandf2, atanxf2, atantf2): New
- expander patterns implemented using existing atan2?f3 patterns.
-
-2003-06-16 Roger Sayle <roger@eyesopen.com>
-
- * expr.c (expand_expr <PLUS_EXPR>): If operand_equal_p considers
- both operands of the addition equal, reuse the expanded RTL.
- (expand_expr <MULT_EXPR>): Likewise for multiplication.
-
-2003-06-16 Roger Sayle <roger@eyesopen.com>
- Jeff Law <law@redhat.com>
-
- * fold-const.c (operand_equal_p): Consider two calls to "const"
- functions with identical non-volatile arguments to be equal.
- Consider the FUNCTION_DECL for the "__builtin_foo" form of a
- built-in function to be equal to the "foo" form.
-
-2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/rs6000/sysv4le.h: Remove target-independent comment.
- Replace "GNU compiler" with "GCC" in comment.
-
-2003-06-16 Andreas Jaeger <aj@suse.de>
-
- * tracer.c: Remove duplicate declaration.
-
- * toplev.c: Remove extra declaration of decode_d_option.
-
- * ssa.c: Remove duplicate declaration.
-
- * sreal.c: Remove extra declaration of dump_sreal.
-
- * reload1.c: Remove duplicate declarations.
-
- * integrate.c: Remove extra declaration of
- set_decl_abstract_flags.
-
- * flow.c: Remove extra declaration of dump_flow_info.
-
- * alias.c: Remove extra declaration of get_addr.
-
-2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/rtems.h, config/sol2.h, config/svr4.h, config/usegas.h,
- config/vxworks.h: GNU CC -> GCC.
-
- * convert.c, dwarf2out.c, dwarfout.c, emit-rtl.c, function.c,
- lists.c, print-rtl.c, print-tree.c, read-rtl.c, rtl-error.c,
- stmt.c, toplev.c, integrate.h, loop.h, machmode.h, rtl.h,
- ssa.h, tree.def: Replace overly specific references to "GNU C"
- and "GNU C Compiler" with references to "GCC".
-
-2003-06-16 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (prepare_move_operand): Check if operand 0 is an invalid
- memory reference. Fix test that checks if operand 1 is using r0.
- * sh.md (movhi_i): Don't allow st.w r0,@(rX,rY) .
-
- * defaults.h (REG_CLASS_FROM_CONSTRAINT): Only define if not already
- defined.
-
-2003-06-15 Nathan Sidwell <nathan@codesourcery.com>
-
- * function.h (struct emit_status): Remove x_last_linenum,
- x_last_filename. Add x_last_location.
- * rtl.h: #include "input.h".
- (NOTE_DATA): New.
- * cfglayout.c (duplicate_insn_chain): Use emit_line_note for line
- number notes.
- * emit-rtl.c (last_linenum, last_filename): Remove.
- (last_location): New.
- (emit_line_note_after): LINE must always be >= 0.
- (emit_line_note): Likewise. Check not duplicate here...
- (emit_note): ... rather than here.
- (emit_line_note_force, force_next_line_note, init_emit): Adjust.
- * integrate.c (expand_inline_function): Use emit_line_note for
- line number notes.
- (copy_insn_list): Likewise.
- * unroll.c (copy_loop_body): Likewise.
- * Makefile.in (RTL_H): Add input.h.
-
-2003-06-16 Richard Sandiford <rsandifo@redhat.com>
-
- * optabs.c (emit_libcall_block): Don't hoist insns past a label.
-
-2003-06-16 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha-protos.h, config/alpha/elf.h,
- config/alpha/osf.h, config/alpha/unicosmk.h, config/alpha/vms.h,
- config/alpha/vms-cc.c, config/alpha/vms-ld.c: Update to ISO C.
- * config/alpha/alpha.c: Likewise. Move targetm init to end of file.
- Remove unneeded static function decls.
-
-2003-06-16 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (c_common_handle_option): s/on/value/.
- (OPT_fabi_version_, OPT_ftabstop_, OPT_ftemplate_depth_): Use value
- directly rather than converting the argument.
- * c.opt: Update docs. Use UInteger where appropriate.
- * common.opt: Use UInteger where appropriate.
- * opts.c (integral_argument): New.
- (handle_argument): Handle integral arguments, and optional
- joined arguments.
- (common_handle_option): Update.
- * opts.h (CL_MISSING_OK, CL_UINTEGER): New.
- * opts.sh: Handle JoinedOrMissing and UInteger flags.
-
-2003-06-16 Neil Booth <neil@daikokuya.co.uk>
-
- * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Remove
- unnecessary extern declaration.
-
-2003-06-15 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/gofast.h, config/interix.h, config/interix3.h,
- config/libgloss.h, config/linux-aout.h, config/linux.h,
- config/lynx-ng.h, config/lynx.h: GNU CC -> GCC.
- * config/kaos.h: "GNU compiler" -> GCC.
- * config/linux-aout.h, config/lynx.h: Clarify comment describing file.
-
- * config/ip2k/crt0.S, config/ip2k/ip2k-protos.h,
- config/ip2k/ip2k.c, config/ip2k/ip2k.md, config/ip2k/libgcc.S:
- GNU CC -> GCC.
-
- * config/svr3.h: Remove #if 0 code, misleading comments.
- GNU CC -> GCC.
-
-2003-06-15 Zack Weinberg <zack@codesourcery.com>
-
- * vmsdbgout.c (vmsdbgout_finish): Rename parameter to
- main_input_filename to avoid conflict with input_filename macro.
-
-2003-06-15 Neil Booth <neil@daikokuya.co.uk>
-
- * config/mips/mips.h (asm_file_name, g_switch_set,
- g_switch_value): Remove.
- * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Remove
- unnecessary extern declarations.
-
-2003-06-15 Neil Booth <neil@daikokuya.co.uk>
-
- * config/frv/frv.h: Remove declaration of g_switch_value.
- * config/m32r/m32r.h: Remove declaration of g_switch_value.
- * config/m68hc11/m68hc11.c: Remove declaration of asm_file_name.
-
-2003-06-15 Neil Booth <neil@daikokuya.co.uk>
-
- * opts.sh: Quote '+' in regex.
-
-2003-06-15 Andrew Pinski <pinskia@physics.uc.edu>
-
- * config/rs6000/t-rs6000: Add dependence of cfglayout.h to rs6000.o.
- * config/rs6000/rs6000.c: Include cfglayout.h.
- * config/alpha/alpha.c: Likewise.
- * config/ia64/ia64.c: Likewise.
- * config/sparc/sparc.c: Likewise.
- * config/sh/sh.c: Likewise.
-
-2003-06-15 Neil Booth <neil@daikokuya.co.uk>
-
- * opts.sh: Quote '+' in regex.
-
-2003-06-15 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (lang_flags): Update for new spelling of flags.
- (write_langs): Similarly.
- * c.opt: Specify languages.
- * opts.h: Remove languages.
- * opts.sh: Recognise front-end defined languages.
- * doc/sourcebuild.texi: Update.
-
-2003-06-15 Andreas Jaeger <aj@suse.de>
-
- * alloc-pool.c: Convert to ISO C90 prototypes.
- * alloc-pool.h: Likewise.
- * alias.c: Likewise.
- * attribs.c: Likewise.
- * bb-reorder.c: Likewise.
- * bitmap.h: Likewise.
- * bitmap.c: Likewise.
- * builtins.c: Likewise.
-
- * tree.h: Convert prototypes of attribs.c to ISO C90.
- * basic-block.h: Convert prototypes of bb-reorder.c to ISO C90.
- * rtl.h: Convert prototypes of alias.c and builtins.c to ISO C90.
- * expr.h: Convert prototypes of builtins.c to ISO C90.
-
-2003-06-15 Roger Sayle <roger@eyesopen.com>
-
- * config/i386/i386.md (expsf2, expdf2, expxf2): New patterns to
- implement exp, expf and expl built-ins as inline x87 intrinsics.
- (UNSPEC_FSCALE, UNSPEC_FRNDINT, UNSPEC_F2XM1): New unspecs to
- represent x87's fscale, frndint and f2xm1 insns respectively.
- (*fscale_sfxf3, *fscale_dfxf3, *fscale_xf3): New insn patterns
- to encode x87's "fscale" instruction followed by a pop.
- (*frndintxf2): New insn pattern for "frndint".
- (*f2xm1xf2): New insn pattern for "f2xm1".
-
- * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FRNDINT and
- UNSPEC_F2XM1 like UNSPEC_{SIN,COS} and handle UNSPEC_FSCALE like
- UNSPEC_FPATAN.
-
-2003-06-15 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * gencheck.c (main): Avoid generating duplicate macros.
-
- * Makefile.in (stagefeedback-start): Use $(SUBDIRS) instead of
- knowing names of language subdirectories.
-
-2003-06-15 Neil Booth <neil@daikokuya.co.uk>
-
- * c-pch.c (asm_file_name): Remove.
- * common.opt: Add more switches.
- * flags.h (g_switch_set): Boolify.
- * opts.c (g_switch_value, g_switch_set, exit_after_options,
- version_flag): Move from toplev.c.
- (common_handle_option): Handle more switches from toplev.c.
- * toplev.c (display_help, display_target_options, decode_d_option,
- print_version): Make non-static, remove prototypes.
- (aux_base_name, asm_file_name, aux_info_file_name): Constify.
- (version_flag, g_switch_value, g_switch_set, exit_after_options):
- Remove.
- (independent_decode_option): Move some handlers to opts.c.
- * toplev.h (aux_info_file_name, aux_base_name, asm_file_name,
- exit_after_options, version_flag, display_help, display_target_options,
- print_version, decode_d_option): New.
-
-2003-06-15 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/alpha/alpha.md: Follow spelling conventions.
- * config/arm/arm.c: Likewise.
- * config/arm/arm.h: Likewise.
- * config/arm/arm.md: Likewise.
- * config/arm/crtn.asm: Likewise.
- * config/m32r/m32r.c: Likewise.
- * config/m32r/m32r.md: Likewise.
- * config/rs6000/rs6000.c: Likewise.
-
-2003-06-15 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Call
- insn_locators_initialize.
- * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
- * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
- * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
- * config/sh/sh.c (sh_output_mi_thunk): Do it later.
-
-2003-06-15 Kazu Hirata <kazu@cs.umass.edu>
-
- * builtins.c (expand_builtin_expect_jump): Remove redundant
- tests that are also in any_condjump_p().
-
-2003-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * libgcc2.c: Delete sysV68 L_trampoline section.
- * config/m68k/mot3300-crt0.S: Delete file.
- * config/m68k/mot3300Mcrt0.S: Likewise.
-
-2003-06-15 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/aoutos.h: Remove.
- * config.gcc: Remove reference to aoutos.h.
- * config/m68k/m68k-aout.h: Remove reference to aoutos.h.
-
-2003-06-14 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/install.texi: Follow spelling conventions.
- * doc/tm.texi: Likewise.
- * config/fp-bit.c: Likewise.
- * config/arm/arm.c: Likewise.
- * config/frv/frv.c: Likewise.
- * config/ns32k/NOTES: Likewise.
- * config/ns32k/STATUS: Likewise.
-
-2003-06-14 Roger Sayle <roger@eyesopen.com>
- Zack Weinberg <zack@codesourcery.com>
-
- * rtl.h (STORE_FLAG_VALUE): Remove default definition from here.
- * defaults.h (STORE_FLAG_VALUE): Move default definition to here.
- * doc/tm.texi (STORE_FLAG_VALUE): Document the default value.
-
- * config/alpha/alpha.h (STORE_FLAG_VALUE): Remove definition.
- * config/arc/arc.h (STORE_FLAG_VALUE): Likewise.
- * config/arm/arm.h (STORE_FLAG_VALUE): Likewise.
- * config/cris/cris.h (STORE_FLAG_VALUE): Likewise.
- * config/i370/i370.h (STORE_FLAG_VALUE): Likewise.
- * config/i386/i386.h (STORE_FLAG_VALUE): Likewise.
- * config/i960/i960.h (STORE_FLAG_VALUE): Likewise.
- * config/ia64/ia64.h (STORE_FLAG_VALUE): Likewise.
- * config/ip2k/ip2k.h (STORE_FLAG_VALUE): Likewise.
- * config/m32r/m32r.h (STORE_FLAG_VALUE): Likewise.
- * config/mcore/mcore.h (STORE_FLAG_VALUE): Likewise.
- * config/mips/mips.h (STORE_FLAG_VALUE): Likewise.
- * config/mmix/mmix.h (STORE_FLAG_VALUE): Likewise.
- * config/ns32k/ns32k.h (STORE_FLAG_VALUE): Likewise.
- * config/pa/pa.h (STORE_FLAG_VALUE): Likewise.
- * config/pdp11/pdp11.h (STORE_FLAG_VALUE): Likewise.
- * config/sh/sh.h (STORE_FLAG_VALUE): Likewise.
- * config/sparc/sparc.h (STORE_FLAG_VALUE): Likewise.
- * config/v850/v850.h (STORE_FLAG_VALUE): Likewise.
- * config/xtensa/xtensa.h (STORE_FLAG_VALUE): Likewise.
-
-2003-06-14 Nathan Sidwell <nathan@codesourcery.com>
-
- * opts.sh (POSIXLY_CORRECT): Unset it.
-
- * tree.h (init_function_start): Remove filename and line paramters.
- * function.c (init_function_start): Remove filename and line
- parameters. Use DECL_SOURCE_LOCATION.
- * c-decl.c (store_parm_decls): Adjust init_function_start call.
- (c_expand_body_1): Likewise.
- * coverage.c (create_coverage): Likewise.
- * objc/objc-act.c (build_tmp_function_decl): Set line number to
- zero.
- (hack_method_prototype): Adjust init_function_start call.
-
-2003-06-14 Richard Earnshaw <rearnsha@arm.com>
-
- PR target/3724
- * arm/linux-elf.h (PROFILE_HOOK): Define.
-
-2003-06-14 Richard Earnshaw <rearnsha@arm.com>
-
- PR target/11183
- * arm.h (CANNOT_CHANGE_MODE_CLASS): Define.
-
-2003-06-14 Roger Sayle <roger@eyesopen.com>
-
- * opts.sh: Work around a mysterious feature in cygwin's gawk
- where specifying the input files explicitly has a different
- behavior to piping them via stdin.
-
-2003-06-14 Neil Booth <neil@daikokuya.co.uk>
-
- * doc/sourcebuild.texi: Update.
-
-2003-06-14 Richard Earnshaw <rearnsha@arm.com>
-
- PR target/11183
- * arm.c (output_move_double): Pass SImode to adjust_address.
-
-2003-06-14 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update to use common.opt and lang_opt_files.
- (c-options.c, c-options.h): Remove.
- (options.c, options.h): Add.
- * c-opts.c: Include options.h not c-options.h.
- * common.opt: New file.
- * configure, configure.in: Add lang_opt_files.
- * opts.c: Include flags.h and diagnostic.h.
- (common_handle_option): New.
- (handle_option): Update to recognize common options and all
- language-dependent options.
- * opts.h (CL_F77, CL_JAVA, CL_ADA, CL_COMMON, CL_TREELANG): New.
- (struct cl_option): Make flags of type int.
- * opts.h: Flag option with front ends to which it applies.
- Handle duplicate options.
- * toplev.c (filename): Remove.
- (independent_decode_option): Don't handle filenames and -quiet.
- (process_options, do_compile): Update.
-
-2003-06-14 Nick Clifton <nickc@redhat.com>
-
- * doc/install.texi (Specific): Add description of different
- ARM supported file format targets.
-
-Sat Jun 14 11:12:04 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * reorg.c (emit_delay_sequence, dbr_schedule): Clear insn locators
- inside delay slots.
-
-2003-06-13 Matt Kraai <kraai@alumni.cmu.edu>
-
- * unwind-c.c: Define NO_SIZE_OF_ENCODED_VALUE.
- * unwind-pe.h (size_of_encoded_value): Do not define if
- NO_SIZE_OF_ENCODED_VALUE is defined.
-
-2003-06-13 Roger Sayle <roger@eyesopen.com>
-
- * expr.c (expand_expr <COMPLEX_CST>): Handle the case of
- expanding a complex constant into a CONCAT target.
-
-2003-06-13 Zack Weinberg <zack@codesourcery.com>
-
- * config/svr3.h (ASM_FILE_START): Don't use ASM_FILE_START_1.
- (ASM_FILE_START_1): Delete.
- * config/i386/att.h, config/i386/sco5.h,
- config/i386/sysv3.h
- (ASM_FILE_START_1): Delete.
-
-2003-06-13 Kelley Cook <kelleycook@wideopenwest.com>
-
- * config/i386/bsd.h: Remove ASM_FILE_START.
- * config/i386/djgpp.h: Likewise.
- * config/i386/gas.h (ASM_FILE_START): Output .file before .intel_syntax.
-
- * config/i386/djgpp.h: Move included unix.h, bsd.h, gas.h to ...
- * config.gcc (i[34567]86-pc-msdosdjgpp): ... here.
-
-2003-06-13 Vladimir Makarov <vmakarov@redhat.com>
-
- PR bootstrap/10835
- * haifa-sched.c (max_lookahead_tries,
- cached_first_cycle_multipass_dfa_lookahead,
- cached_issue_rate): New variables.
- (max_issue): Check the number of tries.
- (choose_ready): Calculate max_lookahead_tries.
- (sched_init): Check cached_issue_rate.
-
-2003-06-13 Richard Henderson <rth@redhat.com>
-
- * cfgbuild.c (make_edges): Set ABNORMAL with SIBCALL.
- * cfgrtl.c (purge_dead_edges): Expect it too.
-
-2003-06-13 Jim Wilson <wilson@tuliptree.org>
- Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR bootstrap/10983
- * combine.c (make_extraction): Use gen_lowpart_for_combine
- when extracting from a REG and not in the destination of a SET.
-
-2003-06-13 Doug Evans <dje@sebabeach.org>
-
- * tsystem.h (abort): Declare in inhibit_libc case to remove build
- warnings for addvsi3, et.al.
-
-2003-06-13 Aldy Hernandez <aldyh@redhat.com>
-
- * c-common.c (handle_mode_attribute): Use VECTOR_MODE_P macro.
-
- * simplify-rtx.c (simplify_subreg): Same.
-
- * emit-rtl.c (gen_lowpart_common): Same.
-
-2003-06-13 Kazu Hirata <kazu@cs.umass.edu>
-
- * builtins.c: Fix comment typos.
- * fold-const.c: Likewise.
-
-2003-06-13 Doug Evans <dje@sebabeach.org>
- Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
-
- * config/m32r/m32r-protos.h (m32r_pass_by_reference): Declare.
- * config/m32r/m32r.c (m32r_pass_by_reference): New fn.
- (m32r_va_arg): Use it.
- * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Ditto.
- (RETURN_IN_MEMORY): Ditto.
-
-2003-06-13 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * c-typeck.c: Remove #if 0 clauses.
-
- PR other/1494
- * config/alpha/openbsd.h, config/i386/openbsd.h,
- config/m68k/openbsd.h, config/sparc/openbsd.h: Remove
- residual reference to EGCS.
-
-2003-06-13 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (output_call_mem): If the address references the link-register
- use an instruction sequence that avoids early-clobbering IP.
- (eliminate_lr2ip): Delete.
-
-2003-06-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-format.c (format_types_orig): Disallow '*' width/precision in
- asm_fprintf format checks.
-
-2003-06-13 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_va_arg): Fix alignment when retrieving
- non-integral types from integer register save area slots.
-
-2003-06-13 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/i386/svr3dbx.h: GNU CC -> GCC; Intel 385 -> Intel 386.
-
-2003-06-13 Florian Weimer <fw@deneb.enyo.de>
-
- * doc/invoke.texi (SPARC Options): Document ``-mimpure-text''.
-
-2003-06-13 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * config/sh/linux.h (TARGET_ASM_FILE_END): Set TARGET_ASM_FILE_END
- to file_end_indicate_exec_stack.
-
-2003-06-12 Richard Henderson <rth@redhat.com>
-
- PR target/11089
- * config/i386/i386.md (sse_movaps): Use an expander to force
- one operand to be a register.
- (sse_movups): Likewise.
-
-2003-06-13 Doug Evans <dje@sebabeach.org>
-
- Remove some build warnings.
- * config/m32r/initfini.c (__CTOR_LIST__,__DTOR_LIST__): Attribute used.
- (__do_global_ctors,__do_global_dtors): Ditto.
-
-2003-06-12 Richard Henderson <rth@redhat.com>
-
- PR middle-end/10557
- * rtlanal.c (subreg_offset_representable_p): Relax subreg check.
-
-2003-06-13 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/m32r/m32r.md: Fix a comment typo.
-
-2003-06-13 Eric Botcazou <ebotcazou@libertysurf.fr>
- Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
-
- PR target/10142
- * config/sparc/sparc.c (function_arg_record_value_parms): Add
- new 'stack' field.
- (function_arg_record_value_1): Set 'stack' to 1 if we run out of
- integer slots for an integer field.
- (function_arg_record_value_3): Shift vector index.
- (function_arg_record_value_2): Likewise.
- (function_arg_record_value): Initialize 'stack' to 0.
- Set 'stack' to 1 if we run out of integer slots for an integer field.
- Generate (parallel [(expr_list (nil) ...) ...]) if 'stack' is set to 1.
-
-2003-06-13 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/10955
- * unroll.c (unroll_loop): Fix off-by-one bug.
-
-2003-06-12 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (function_arg): Remove typo.
-
-2003-06-12 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.c (legitimate_constant_p): Handle UNSPEC_NTPOFF
- and UNSPEC_DTPOFF.
-
-2003-06-12 Richard Henderson <rth@redhat.com>
-
- PR middle-end/10475
- * expmed.c (emit_store_flag): Use simplify_gen_subreg directly
- for extracting sub-words.
-
-2003-06-12 Richard Henderson <rth@redhat.com>
-
- PR target/7594
- * config/m68k/m68k.md (zero_extendhisi2): Use gen_lowpart_SUBREG.
- (zero_extendqihi2, zero_extendqisi2): Likewise.
-
-2003-06-12 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (function_arg): Always split vectors for
- e500 if it's a stdarg function.
- (function_arg_advance): Advance 2 registers for vectors in a
- stdarg function.
- (init_cumulative_args): Initialize stdarg.
- (rs6000_spe_function_arg): New.
-
- * config/rs6000/rs6000.h (rs6000_args): Add stdarg.
-
-2003-06-12 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.h (MODES_TIEABLE_P): Add SPE vectors.
-
-2003-06-12 Roger Sayle <roger@eyesopen.com>
-
- PR middle-end/168
- * fold-const.c (tree_expr_nonnegative_p): Handle addition
- and multiplication of zero extensions, floating point division,
- and integer<->fp, fp<->fp and zero extension conversions.
- The built-in ceil and floor functions preserve signedness.
-
-2003-06-12 Kazu Hirata <kazu@cs.umass.edu>
-
- * ChangeLog: Follow spelling conventions.
- * ChangeLog.2: Likewise.
- * c-decl.c: Likewise.
- * cfgloop.h: Likewise.
- * cgraph.c: Likewise.
- * coverage.c: Likewise.
- * cppcharset.c: Likewise.
- * cpphash.h: Likewise.
- * cpplex.c: Likewise.
- * cpplib.c: Likewise.
- * dbxout.c: Likewise.
- * df.c: Likewise.
- * dwarf2out.c: Likewise.
- * dwarfout.c: Likewise.
- * emit-rtl.c: Likewise.
- * explow.c: Likewise.
- * gcov-io.c: Likewise.
- * gcov-io.h: Likewise.
- * gcov.c: Likewise.
- * gengtype.c: Likewise.
- * ggc.h: Likewise.
- * opts.c: Likewise.
- * real.c: Likewise.
- * reload.c: Likewise.
- * stmt.c: Likewise.
-
-2003-06-12 Janis Johnson <janis187@us.ibm.com>
-
- * doc/install.texi (m32r-*-elf): Change company to Renesas.
-
-Thu Jun 12 20:00:55 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * basic-block.h (flow_delete_block_noexpunge): Kill.
- * cfgrtl.c (flow_delete_block_noexpunge): Merge to
- rtl_delete_block.
-
-2003-06-10 Richard Henderson <rth@redhat.com>
-
- PR inline-asm/4823
- * reg-stack.c (any_malformed_asm): New.
- (check_asm_stack_operands): Set it.
- (convert_regs_1): Check it before aborting.
-
-2003-06-12 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.md: Change all clobbers of the accumulator to sets.
-
-2003-06-12 Jakub Jelinek <jakub@redhat.com>
-
- * c-opts.c (complain_wrong_lang): Add on argument.
- Print no- switch if on is false.
- (c_common_decode_option): Adjust caller.
-
-2003-06-12 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_emit_prologue): Use LA instead of AR
- to initialize GOT register.
-
-2003-06-12 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (tree_expr_nonnegative_p): Add support for
- floating point constants, addition and multiplication.
-
-2003-06-12 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.md (adddi3_compact, subdi3_compact): Add earlyclobber
- constraint modifier for operand 0.
-
-2003-06-12 Hans-Peter Nilsson <hp@axis.com>
-
- Don't warn on dollars in builtin macro definitions,
- e.g. __REGISTER_PREFIX__.
- * cpphash.h (struct cpp_reader): Move member warn_dollars...
- * cpplib.h (struct cpp_options): ...to here. Change type to
- unsigned char.
- * cppinit.c (cpp_create_reader): Set it to 1 here.
- (post_options): Don't set it here.
- * c-opts.c (c_common_init_options): Reset it to 0 here.
- (finish_options): Set it here.
- * cpplex.c (forms_identifier_p): Tweak for new location of
- warn_dollars.
-
- * configure.in (assembler dwarf2 debug_line support): Define insn
- for cris-*-* and mmix-*-*.
- * configure: Regenerate.
-
-2003-06-11 Uwe Stieber <uwe@kaos-group.de>
-
- * config.gcc (arm*-*-kaos*, i[34567]86-*-kaos*, powerpc-*-kaos*,
- powerpcle-*-kaos*, strongarm-*-kaos*): New targets.
- (sh-*-elf*): Add sh*-*-kaos* support.
- * config/kaos.h, config/arm/kaos-strongarm.h, config/arm/kaos-arm.h,
- config/i386/kaos-i386.h, config/rs6000/kaos-ppc.h,
- config/sh/kaos-sh.h: New files.
-
-2003-06-12 Kazu Hirata <kazu@cs.umass.edu>
-
- * gcse.c (fis_get_condition): Make it a global function.
- * reload1.c (reload_cse_move2add): Detect implicit sets.
- * rtl.h: Add a prototype for fis_get_condition.
-
-2003-06-11 Richard Henderson <rth@redhat.com>
-
- * stmt.c (expand_asm_operands): Don't warn for memories with
- queued addresses.
-
-2003-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * config/sh/sh.h (SUBTARGET_ASM_RELAX_SPEC): Rewrite without
- brackets.
-
-2003-06-11 Neil Booth <neil@daikokuya.co.uk>
-
- * hooks.c (hook_int_size_t_constcharptr_int_0): New.
- * hooks.h (hook_int_size_t_constcharptr_int_0): New.
- * langhooks-def.h (lhd_decode_option, LANG_HOOKS_DECODE_OPTION): Die.
- (LANG_HOOKS_HANDLE_OPTION, LANG_HOOKS_INITIALIZER): Update.
- * langhooks.c (lhd_decode_option): Remove.
- * langhooks.h (struct lang_hooks): Remove decode_option.
- * opts.c (handle_option): No longer use decode_option.
-
-2003-06-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cfgloopanal.c (variable_initial_value): Update the set of altered
- registers correctly.
-
-2003-06-11 Roger Sayle <roger@eyesopen.com>
- Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * config/d30v/d30v.h: Delete reference to ASM_FINAL_SPEC.
- * config/i386/netbsd-elf.h: Likewise.
- * config/m32r/m32r.h: Likewise.
- * config/mn10300/mn10300.h: Likewise.
- * config/stormy16/stormy16.h: Likewise.
- * config/v850/v850.h: Likewise.
- * config/vax/netbsd-elf.h: Likewise.
- * config/xtensa/elf.h: Likewise.
- * config/xtensa/linux.h: Likewise.
-
-2003-06-11 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/mips/iris5gas.h (MDEBUG_ASM_SPEC): Override to match
- DWARF 2 default.
-
- * config/mips/dbxmdebug.h: New file.
- * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Use it with
- gas and --with-stabs.
-
-2003-06-11 Ulrich Weigand <uweigand@de.ibm.com>
-
- * expr.c (can_move_by_pieces): align argument may be unused.
-
-2003-06-11 J"orn Rennecke <joern.rennecke@superh.com>
-
- * expr.c (convert_move): Handle moves between two CONCATs.
-
-2003-06-11 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.h (RETURN_IN_MEMORY): Accept DImode if
- !TARGET_H8300.
-
-2003-06-11 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (final_prescan_insn): Don't dump rtl.
- * config/h8300/h8300.h (MASK_RTL_DUMP): Remove.
- (TARGET_RTL_DUMP): Likewise.
- (TARGET_SWITHCES): Remove -mrtl-dump.
-
-2003-06-10 Richard Henderson <rth@redhat.com>
-
- * optabs.c (gen_cond_trap): Fix prepare_operand typo.
-
-2003-06-10 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.md (call_gp): Fix memory mode.
-
-2003-06-10 James E Wilson <wilson@tuliptree.org>
-
- PR target/8812
- * reload1.c (choose_reload_regs): For equiv reg, add loop over all
- hard regs for reload_reg_used_at_all and reg_class_contents checks.
-
-2003-06-10 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (print_operand): Remove support for
- operand character 'b'.
- Add the AND case to operand character 'c'.
- * config/h8300/h8300.md (two anonymous patterns): Replace
- operand character 'b' with 'c'.
-
-2003-06-10 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (print_operand): Remove support for
- operand character 'u'.
-
-2003-06-10 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * configure.in: Fix typo.
- * configure: Regenerate.
-
-2003-06-10 Loren James Rittle <ljrittle@acm.org>
-
- * config/alpha/alpha.c (unicosmk_file_end): Add conditional
- compilation guard.
-
-2003-06-10 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh-protos.h (function_symbol): Declare.
- * sh.c (expand_block_move, expand_ashiftrt): Use it.
- (sh_expand_prologue, sh_expand_epilogue): Likewise.
- (sh_initialize_trampoline): Likewise.
- (function_symbol): New function.
- * sh.md (udivsi3, divsi3, mulsi3, ic_invalidate_line): Use it.
- (initialize_trampoline, call, call_pop, call_value, sibcall): Likewise.
- (call_value_pop, shcompact_return_tramp): Likewise.
-
- * sh.h (OVERRIDE_OPTIONS): Don't suppress --profile-arc-flag.
-
- * sh.md (GOTaddr2picreg): Use gen_lowpart to get lowpart of
- target register.
-
-2003-06-10 DJ Delorie <dj@redhat.com>
-
- * doc/md.texi (Machine Constraints): Document stormy's Z
- constraint.
-
-2003-06-10 Geoffrey Keating <geoffk@apple.com>
-
- * except.c (call_site_base): Mark with GTY.
-
-2003-06-10 Richard Earnshaw <rearnsha@arm.com>
-
- * arm-proto.h: Convert to ISO C90 prototypes.
- * arm.c: Likewise.
-
-2003-06-10 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (sh_output_mi_thunk): Call insn_locators_initialize.
-
-2003-06-10 Steve Ellcey <sje@cup.hp.com>
-
- * calls.c (expand_call): Convert structure_value_addr to Pmode if
- necessary.
-
-2003-06-10 Andrew Haley <aph@redhat.com>
-
- * langhooks-def.h (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
- (LANG_HOOKS_DECLS): Add LANG_HOOKS_DECL_OK_FOR_SIBCALL.
- (lhd_decl_ok_for_sibcall): New.
- * langhooks.c (lhd_decl_ok_for_sibcall): New.
- * langhooks.h (lang_hooks_for_decls.ok_for_sibcall): New field.
- * calls.c (expand_call): Check lang_hook before generating a
- sibcall.
-
-2003-06-10 DJ Delorie <dj@redhat.com>
-
- * config/stormy16/stormy16.c (xstormy16_extra_constraint_p): Add Z,
- which matches (const_int 0) for addhi3.
- * config/stormy16/stormy16.md: Document known constraints.
- (addhi3): Handle adding zero.
-
-2003-06-10 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
-
- * config/m32r/m32r.h (HARD_REGNO_RENAME_OK): New.
- * config/m32r/m32r.c (m32r_hard_regno_rename_ok): New.
- * config/m32r/m32r-protos.h: Prototype it.
-
-2003-06-10 Janis Johnson <janis187@us.ibm.com>
-
- * config/rs6000/eabi.h (TARGET_OS_CPP_BUILTINS): Define builtins
- common to rs6000 sysv targets.
- * config/rs6000/eabisim.h (TARGET_OS_CPP_BUILTINS): Ditto.
- * config/rs6000/rtems.h (TARGET_OS_CPP_BUILTINS): Ditto.
-
-2003-06-10 Nick Clifton <nickc@redhat.com>
-
- * config.gcc: Add arm-wince-pe target.
- * config/arm/pe.h (MULTILIB_DEFAULTS): Define.
- Add comment about default apcs26 support.
- * config/arm/t-pe (MULTILIB_OPTIONS): Add an -mapcs-32
- multilib.
- (MULTILIB_DIRNAMES): Add 'apcs32'.
- * config/arm/t-wince-pe: New makefile fragment.
- * config/arm/wince-pe.h: New file. Overrides a few definitions
- in arm/pe.h
-
-2003-06-10 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (fold_builtin): Optimize cos(-x) as cos(x).
- * fold-const.c (fold <NEGATE_EXPR>): Convert -f(x) into f(-x)
- when x is easily negated and f is sin, tan or atan.
- (fold <MULT_EXPR>): Optimize tan(x)*cos(x) and cos(x)*tan(x) as
- sin(x) with flag_unsafe_math_optimizations.
- (fold <RDIV_EXPR>): With flag_unsafe_math_optimizations fold
- sin(x)/cos(x) as tan(x) and cos(x)/sin(x) as 1.0/tan(x).
-
-2003-06-10 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (fold <EQ_EXPR>): Don't fold x == x only if x
- is a floating point type *and* we currently honor NaNs.
- (fold <NE_EXPR>): Likewise.
-
-2003-06-10 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/11131
- * tree-inline.c (inlinable_function_p): Call the language-specific
- hook early.
-
-2003-06-09 David Taylor <dtaylor@emc.com>
-
- * config/rs6000/rs6000.c (rs6000_va_start, rs6000_va_arg): Skip over
- the f_res field.
-
-2003-06-09 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * configure.in: Remove references to host_truncate_target.
- * configure: Regenerate.
- * config.gcc: Remove references to truncate_target,
- host_truncate_target.
-
- * Makefile.in, configure.in, config/m68hc11/t-m68hc11-gas:
- Replace "build_canonical" with build, "host_canonical" with host.
- * configure.in: Use GCC_TOPLEV_SUBDIRS.
- * aclocal.m4: Include ../config/acx.m4.
- * configure: Regenerate.
-
-2003-06-09 David Taylor <dtaylor@emc.com>
-
- * config/rs6000/rs6000.c (rs6000_build_va_list): Give the two
- bytes of padding in the __va_list_tag structure a name (reserved).
-
-2003-06-09 Jason Merrill <jason@redhat.com>
-
- * fold-const.c (operand_equal_p): Handle ADDR_EXPR and TRUTH_NOT_EXPR.
-
-2003-06-09 Osku Salerma <osku@iki.fi>
-
- * c-format.c (check_format_string, get_constant): New.
- (handle_format_attribute, handle_format_arg_attribute,
- decode_format_attr): Change to use above functions.
-
-2003-06-09 Richard Henderson <rth@redhat.com>
-
- * stmt.c (expand_asm_operands): Re-word warning.
-
-2003-06-08 Andrew Pinski <pinskia@physics.uc.edu>
-
- PR target/8787
- * config/i386/djgpp.h (ASM_FILE_START): emit `.intel_syntax'
- if -masm=intel.
-
-2003-06-09 James E Wilson <wilson@tuliptree.org>
-
- * config/frv/cmovc.c, config/frv/cmovh.c, config/frv/cmovw.c,
- config/frv/frvbegin.c, config/frv/frvend.c, config/frv/lib1funcs.asm:
- Add libgcc exception.
-
-2003-06-09 David Edelsohn <edelsohn@gnu.org>
- Ayal Zaks <gcchaifa@us.ibm.com>
-
- * config/rs6000/rs6000.md (define_attr "type"): Add insert_word.
- (insvsi*): Add insert_word attribute.
- * config/rs6000/rs6000.c (rs6000_variable_issue): Add TYPE_INSERT_WORD.
- * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md,
- power4.md,rios1.md,rios2.md,rs64.md}: Add insert_word.
-
-2003-06-09 Kazu Hirata <kazu@cs.umass.edu>
-
- * fold-const.c (fold): Fix a comment typo.
-
-2003-06-09 Nathan Sidwell <nathan@codesourcery.com>
-
- * tree-inline.c (expand_call_inline): DECL_SOURCE_LINE_FIRST is
- removed.
-
-2003-06-09 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (gen_block_redirect): Use locators.
-
-2003-06-09 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.h (THUMB_PRINT_OPERAND_ADDRESS): Use %wd in format and remove
- cast to int.
-
-2003-06-09 Richard Sandiford <rsandifo@redhat.com>
-
- * configure.in: Assume gas 2.14 and above can handle MIPS relocation
- operators.
- * configure: Regenerated.
-
-2003-06-09 Richard Sandiford <rsandifo@redhat.com>
- Alexandre Oliva <aoliva@redhat.com>
-
- * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro.
- (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload.
- (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for
- n32/64 PIC.
- (MUST_SAVE_REGISTERS): Delete.
- * config/mips/mips.c (mips_frame_info): Remove extra_size field.
- (machine_function): Add global_pointer field.
- (mips_classify_constant): Check for (const $gp) using pointer equality
- with pic_offset_table_rtx.
- (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO.
- (mips_restore_gp): Use current_function_outgoing_args_size.
- (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of
- GP_REG_FIRST + 28. Handle relocation strings that have
- more than one '('.
- (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO.
- (mips_global_pointer): New function.
- (mips_save_reg_p): New function, mostly split out from...
- (compute_frame_size): ...here. Remove handling of extra_size.
- Reclaim args_size if no variables depend on it. Don't treat gp
- as a special case: handle it in the main GPR loop.
- (mips_initial_elimination_offset): Fix comment.
- (save_restore_insns): Save every register in the GPR mask,
- removing distinction between mask and real_mask.
- (mips_output_function_prologue): Update .frame psuedo-op after
- the removal of extra_size. Move the SVR4 PIC stack allocation
- and cprestore instructions to mips_expand_prologue.
- (mips_gp_insn): New function.
- (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to
- the chosen global pointer. Handle SVR4 PIC stack allocation
- in the same way as other ABIs. Adjust varargs code accordingly.
- Emit a cprestore insn after allocating the stack. Use mips_gp_insn
- to emit the loadgp sequence. Follow it with a loadgp_blockage
- if not using explicit relocs.
- (mips_output_function_epilogue): Reinstate the default gp register.
- (mips16_gp_pseudo_reg): Use pic_offset_table_rtx.
- (mips16_optimize_gp): Likewise.
- * config/mips/mips.md (UNSPEC_LOADGP): Remove.
- (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove.
- (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New.
- (loadgp): Remove.
- (loadgp_blockage, cprestore): New instructions.
- (builtin_setjmp_setup): Implement using emit_move_insn. Use
- pic_offset_table_rtx.
- (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove.
- (builtin_longjmp): Use gen_raw_REG to force use of $28.
-
-2003-06-09 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_output_division): Declare.
- * config/mips/mips.h (MASK_CHECK_RANGE_DIV): Remove.
- (MASK_BRANCHLIKELY): Use MASK_CHECK_RANGE_DIV's old number.
- (TARGET_NO_CHECK_ZERO_DIV, TARGET_CHECK_RANGE_DIV): Remove.
- (TARGET_CHECK_ZERO_DIV): New macro.
- (TARGET_SWITCHES): Remove -mcheck-range-div & -mno-check-range-div.
- * config/mips/mips.c (mips_output_division): New function.
- * config/mips/mips.md (length): Take TARGET_CHECK_ZERO_DIV into
- account when calculating the default length of a division.
- (divmodsi4, divmoddi4, udivmodsi4, udivmoddi4): Turn into define_insns.
- Enable regardless of optimization level. Use mips_output_division.
- (divmodsi4_internal, divmoddi4_internal, udivmodsi4_internal,
- udivmoddi4_internal, div_trap, div_trap_normal, div_trap_mips16,
- divsi3, divsi3_internal, divdi3, divdi3_internal, modsi3,
- modsi3_internal, moddi3, moddi3_internal, udivsi3, udivsi3_internal,
- udivdi3, udivdi3_internal, umodsi3, umodsi3_internal, umoddi3,
- umoddi3_internal): Remove.
-
-2003-06-09 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips_reg_names): Change hilo entry to "".
- (mips_sw_reg_names): Likewise.
- (mips_regno_to_class): Change hilo entry to NO_REGS.
- (hilo_operand): Use MD_REG_P.
- (extend_operator): New predicate.
- (override_options): Remove 'a' constraint.
- (mips_secondary_reload_class): Remove hilo handling. Also remove
- handling of (plus sp reg) reloads for mips16.
- (mips_register_move_cost): Remove hilo handling.
- * config/mips/mips.h (FIXED_REGISTERS): Make hilo entry fixed.
- (MD_REG_LAST): Remove hilo from range.
- (HILO_REGNUM): Delete.
- (reg_class): Remove HILO_REG and HILO_AND_GR_REGS.
- (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly.
- (PREDICATE_CODES): Add entry for extend_operator.
- (DEBUG_REGISTER_NAMES): Change hilo entry to "".
- * config/mips/mips.md: Remove hilo clobbers wherever they occur.
- Remove constraints from multiplication define_expands. Remove
- clobbers from "decorative" define_expand patterns.
- (UNSPEC_HILO_DELAY): Delete.
- (*mul_acc_si, *mul_sub_si): Add early-clobber to operand 6.
- (mulsidi3, umulsidi3): Change pattern to match the TARGET_64BIT case.
- Adjust C code to just emit insns for !TARGET_64BIT.
- (mulsidi3_internal): Rename to mulsidi3_32bit.
- (mulsidi3_64bit): Use a "d" constraint for the destination.
- Use extend_operator so that the pattern can handle umulsidi3 as well.
- Split the instruction after reload.
- (*mulsidi3_64bit_parts): New pattern, generated by mulsidi3_64bit.
- (umulsidi3_internal): Rename to umulsidi3_32bit.
- (umulsidi3_64bit): Remove.
- (*smsac_di, *umsac_di): Line-wrap fixes.
- (udivsi3_internal): Don't allow operand 2 to be constant.
- (udivdi3_internal, umodsi3_internal, umoddi3_internal): Likewise.
- (movdi_internal2, movsi_internal): Remove hilo alternatives.
- (reload_in[sd]i, reload_out[sd]i, hilo_delay): Remove.
-
-2003-06-09 Richard Sandiford <rsandifo@redhat.com>
-
- PR target/10913
- * config/mips/mips.h (TARGET_FILE_SWITCHING, NO_DBX_FUNCTION_END,
- PUT_SDB_SCL, PUT_SDB_INT_VAL, PUT_SDB_VAL, PUT_SDB_ENDEF,
- PUT_SDB_TYPE, PUT_SDB_SIZE, PUT_SDB_DIM, PUT_SDB_START_DIM,
- PUT_SDB_NEXT_DIM, PUT_SDB_LAST_DIM, PUT_SDB_TAG, PUT_SDB_SRC_FILE,
- SDB_GENERATE_FAKE, TEXT_SECTION): Delete.
- (PUT_SDB_DEF, PUT_SDB_PLAIN_DEF, PUT_SDB_BLOCK_START,
- PUT_SDB_BLOCK_END, PUT_SDB_FUNCTION_END): Replace use of
- asm_out_text_file with asm_out_file.
- * config/mips/iris5gas.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Likewise.
- * config/mips/elf.h (TEXT_SECTION): Undefine.
- * config/mips/elf64.h (TEXT_SECION): Undefine.
- * config/mips/openbsd.h (TEXT_SECION): Undefine.
- * config/mips/mips.c (asm_out_text_file, asm_out_data_file): Delete.
- (override_options): Disable small-data optimizations unless using
- gas or explicit relocations.
- (mips_asm_file_start, mips_asm_file_end, mips_output_function_epilogue,
- iris6_asm_named_section, iris6_asm_file_start): Remove code for
- handling TARGET_FILE_SWITCHING.
- (copy_file_data): Move into TARGET_IRIX6 block.
-
-2003-06-08 Richard Henderson <rth@redhat.com>
-
- * expr.h (EXPAND_MEMORY): New.
- * expr.c (expand_expr): Check it.
- * stmt.c (expand_asm_operands): Provide it when the constraint
- requires a memory. Warn for memory input constraints without
- a memory operand.
-
-2003-06-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * varasm.c: Don't include c-tree.h.
-
-2003-06-08 Andreas Jaeger <aj@suse.de>
-
- * predict.h: Convert to ISO C90 prototypes.
- * predict.c: Likewise.
- * tree-dump.h: Likewise.
- * tree-dump.c: Likewise.
- * diagnostic.h: Likewise.
- * diagnostic.c: Likewise.
- * combine.c: Likewise.
-
- * rtl.h: Convert prototypes of combine.c to ISO C90.
-
-Sun Jun 8 21:27:41 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * cfglayout.c (insn_scope): New static function
- (block_locators_*, line_locators*, file_locators*): New static varrays.
- (scope_to_insns_initialize): Use them.
- (insn_line, insn_file): New functions.
- (scope_to_insns_finalize): Use insn_scope.
- (prologue_locator, epilogue_locator): New global variables.
- * emit-rt.c (try_split, make_insn_raw, make_jump_insn_raw,
- make_call_insn_raw, emit_copy_of_insn_after): Use locators.
- (emit_insn_after_scope, emit_insn_before_scope
- emit_jump_insn_after_scope, emit_jump_insn_before_scope
- emit_call_insn_after_scope, emit_call_insn_before_scope): Rename to...
- (emit_insn_after_setloc, emit_insn_before_setloc
- emit_jump_insn_after_setloc, emit_jump_insn_before_setloc
- emit_call_insn_after_setloc, emit_call_insn_before_setloc): ... these;
- use locators.
- * final.c (notice_source_line): Use locators.
- (final_start_function): Set initial source file and line.
- (final_scan_insn): Use locators.
- * ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants,
- noce_try_addcc, noce_try_store_flag_mask, noce_try_cmove,
- noce_try_cmove_arith, noce_try_minmax, noce_try_abs,
- noce_process_if_block, find_cond_trap): Likewise.
- * integrate.c (copy_insn_list): Likewise.
- * jump.c (duplicate_loop_exit_test): LIkewise.
- * print-rtl.c (print_rtx): Print locators.
- * recog.c (peephole2_optimize): Likewise.
- * rtl.h (INSN_SCOPE): Remove.
- (emit_insn_after_scope, emit_insn_before_scope
- emit_jump_insn_after_scope, emit_jump_insn_before_scope
- emit_call_insn_after_scope, emit_call_insn_before_scope): Rename to...
- (emit_insn_after_setloc, emit_insn_before_setloc
- emit_jump_insn_after_setloc, emit_jump_insn_before_setloc
- emit_call_insn_after_setloc, emit_call_insn_before_setloc): ... these;
- (insn_file, insn_line, prologue_locator, epilogue_locator): Declare.
- * unroll.c (copy_loop_body): Use locators.
- * function.c (set_insn_locators): New function.
- (thread_prologue_and_epilogue_insns): Set the locators accordingly.
-
-2003-06-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.h (LONG_LONG_TYPE_SIZE): Set to 64.
- * config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _floatdisf
- _fixsfdi _fixunssfdi.
- (LIB2FUNCS_EXTRA): Add entries for clzhi2, ctzhi2, parityhi2,
- popcounthi2.
- (TARGET_LIBGCC2_CFLAGS): Remove -DDI=SI.
- * config/h8300/clzhi2.c: New.
- * config/h8300/ctzhi2.c: Likewise.
- * config/h8300/parityhi2.c: Likewise.
- * config/h8300/popcounthi2.c: Likewise.
-
-Sun Jun 8 15:52:17 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.md (subsi_3_zext, sse2_nandv2di3): Fix predicates.
- * i386.c (k8_avoid_jump_misspredicts): Fix debug output.
-
- * cfg.c (verify_flow_info): Move IL independent checks from cfgrtl here.
- (dump_bb): New based on old dump_bb in cfgrtl.c
- (debug_bb, debug_bb_n): Move the functions from cfgrtl.c here.
- * cfghooks.h (cfgh_verify_flow_info): Return status.
- * cfglayout.c (cfg_layout_finalize): Verify CFG correctness.
- * cfgrtl.c (debug_bb, debug_bb_n): Move to cfg.c
- (dump_bb): Remove generic parts.
- (rtl_verify_flow_info_1): Break out from rtl_verify_flow_info.
- (rtl_verify_flow_info): Only check things dependeing on linearized RTL.
-
-2003-06-08 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Rename options.c and options.h to c-options.c and
- c-options.h.
- (OBJS): Remove options.o.
- * c-opts.c: Don'tInclude c-options.h instead of options.h.
- * opts.c: Don't include options.h.
- (find_opt): Can't use enum opt_code or N_OPTS.
- * opts.h (struct cl_option, cl_options, cl_options_count): Move from...
- * opts.sh: ... here.
-
-2003-06-07 Eric Botcazou <ebotcazou@libertysurf.fr>
- Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
-
- PR pch/9830
- * ggc-common.c (HAVE_MMAP_FILE): Include sys/types.h
- if HAVE_MINCORE is defined.
- (MAP_FAILED): Define if not defined.
- (gt_pch_save): Test against MAP_FAILED.
- (gt_pch_restore): If HAVE_MINCORE, use MAP_FIXED to force
- the mapping address to the preferred base after checking it
- is possible to do so. Test against MAP_FAILED.
- * configure.in: Test for the presence of mincore in libc.
- * config.in: Regenerate.
- * configure: Regenerate.
-
-2003-06-07 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (alpha_setup_incoming_varargs): Fix
- conditional compilation guard.
-
-2003-06-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * optabs.c (expand_abs): Set result_unsignedp to 1 if
- flag_trav is zero.
-
-2003-06-07 Richard Henderson <rth@redhat.com>
-
- * c-cppbuiltin.c (c_cpp_builtins): Define __EXCEPTIONS for C also.
-
-2003-06-07 Richard Henderson <rth@redhat.com>
-
- * basic-block.h (EDGE_SIBCALL): New.
- (EDGE_ALL_FLAGS): Update.
- * cfg.c (dump_edge_info): Add sibcall name.
- * cfgbuild.c (make_edges): Use EDGE_SIBCALL.
- * cfgrtl.c (purge_dead_edges): Handle sibcalls.
-
-2003-06-07 Andreas Jaeger <aj@suse.de>
-
- * mklibgcc.in (lib2funcs): Remove _exit.
- * libgcc2.c: Remove L_exit.
- * gbl-ctors.h: Remove declarations dependend on NEED_ATEXIT.
-
- * system.h: Poison NEED_ATEXIT, ON_EXIT, EXIT_BODY.
-
- * doc/tm.texi (Misc): Remove NEED_ATEXIT, ON_EXIT, EXIT_BODY.
-
- * ggc.h: Convert to ISO C90 prototypes.
- * ggc-none.c: Likewise.
- * ggc-common.c: Likewise.
- * ggc-page.c: Likewise.
- * ggc-simple.c: Likewise.
-
- * crtstuff.c: Remove undefined usage of INIT_SECTION_PREAMBLE.
-
- * system.h: Poison INIT_SECTION_PREAMBLE.
-
-2003-06-07 Zack Weinberg <zack@codesourcery.com>
-
- * config.gcc (with_cpu handling): Translate sparc64 in
- $machine to --with-cpu=v9.
- * config/alpha/alpha.c
- (TARGET_ASM_GLOBALIZE_LABEL [TARGET_ABI_UNICOSMK]): Correct definition.
- (alpha_setup_incoming_varargs): #ifdef out when TARGET_ABI_UNICOSMK.
-
- * target.h: New hook asm_out.file_end.
- * target.h: Update to match. New hook macro TARGET_ASM_FILE_END.
- * toplev.c (compile_file): Use targetm.asm_out.file_end.
- * system.h: Poison ASM_FILE_END.
- * varasm.c (file_end_indicate_exec_stack): New.
- * output.h: Prototype it.
- * doc/tm.texi: Document TARGET_ASM_FILE_END and
- file_end_indicate_exec_stack. Delete references to attasm.h.
-
- * config/darwin.h (TARGET_ASM_FILE_END): Reset to darwin_file_end.
- (ASM_FILE_END): Delete; move code...
- * config/darwin.c (darwin_file_end): Here; new function.
- * config/darwin-protos.h: Prototype it.
- * config/alpha/alpha.c (unicosmk_asm_file_end): Make static,
- rename unicosmk_file_end.
- * config/arm/aof.h (ASM_FILE_END): Delete; move code...
- * config/arm/arm.c (aof_file_end): ... here; new static function.
- Set TARGET_ASM_FILE_END to aof_file_end if AOF_ASSEMBLER.
- Make aof_dump_imports and aof_dump_pic_table static.
- * config/avr/avr.c (asm_file_end): Rename avr_file_end, make static.
- Set TARGET_ASM_FILE_END to avr_file_end.
- * config/c4x/c4x.c (c4x_file_end): Make static. Take no arguments.
- Set TARGET_ASM_FILE_END to c4x_file_end.
- * config/h8300/h8300.c (asm_file_end): Rename h8300_file_end,
- make static. Take no arguments. Set TARGET_ASM_FILE_END to
- h8300_file_end.
- * config/i370/i370.h (ASM_FILE_END): Delete; move code...
- * config/i370/i370.c (i370_file_end): ... here; new static function.
- Set TARGET_ASM_FILE_END to i370_file_end.
- * config/i386/i386.c (ix86_asm_file_end): Rename ix86_file_end.
- Take no arguments. Call file_end_indicate_exec_stack if
- NEED_INDICATE_EXEC_STACK; don't use SUBTARGET_FILE_END.
- * config/i386/i386.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END.
- Define NEED_INDICATE_EXEC_STACK to 0.
- * config/i386/linux.h, config/i386/linux64.h: Redefine
- NEED_INDICATE_EXEC_STACK to 1 instead of setting SUBTARGET_FILE_END.
- * config/i386/winnt.c (i386_pe_asm_file_end): Rename to
- i386_pe_file_end. Take no arguments. Use ix86_file_end.
- * config/ia64/ia64.c (ia64_hpux_asm_file_end): Rename to
- ia64_hpux_file_end, make static. Take no arguments.
- * config/ip2k/ip2k.c (asm_file_start, asm_file_end,
- commands_in_prologues, commands_in_epilogues): Delete.
- (function_epilogue): Update to match.
- * config/mips/mips.c (mips_asm_file_end): Rename mips_file_end,
- make static. Take no arguments.
- (iris6_asm_file_end): Rename iris6_file_end, make static, use
- mips_file_end, take no arguments.
- Set TARGET_ASM_FILE_END to iris6_file_end or mips_file_end as
- appropriate.
- * config/mmix/mmix.c (mmix_asm_file_end): Rename mmix_file_end,
- make static, take no arguments. Set TARGET_ASM_FILE_END to
- mmix_file_end.
- * config/pa/pa.c (output_deferred_plabels): Make static, take
- no arguments. Set TARGET_ASM_FILE_END to output_deferred_plabels.
- * config/rs6000/xcoff.h (TARGET_ASM_FILE_END): Set it.
- (ASM_FILE_END): Delete; move code...
- * config/rs6000/rs6000.c (rs6000_xcoff_file_end): ... here;
- new static function.
-
- * config/avr/avr.h, config/cris/cris.h, config/h8300/h8300.h
- * config/mmix/mmix.h, config/mips/iris6.h, config/mips/mips.h:
- Don't set ASM_FILE_END.
- * config/alpha/linux-elf.h, config/m68k/linux.h, config/rs6000/linux.h
- * config/rs6000/linux64.h, config/s390/linux.h, config/sparc/linux.h
- * config/sparc/linux64.h: Set TARGET_ASM_FILE_END to
- file_end_indicate_exec_stack; don't set ASM_FILE_END.
- * config/alpha/unicosmk.h, config/i386/cygming.h
- * config/ia64/hpux.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END.
- * config/arm/arm-protos.h, config/alpha/alpha-protos.h
- * config/avr/avr-protos.h, config/c4x/c4x-protos.h
- * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
- * config/ip2k/ip2k-protos.h, config/mips/mips-protos.h
- * config/mmix/mmix-protos.h, config/pa/pa-protos.h: Update.
-
-Sat Jun 7 18:32:13 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.h (OPTION_DEFAULT_SPECS): Avoid -mcpu default when -march is
- specified.
-
-Sat Jun 7 15:20:01 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * Makefile.in (stageprofile_build): Kill redundant target.
- * i386.c (mdep_reorg): Don't pad jumps for Athlon.
-
-2003-06-07 Andreas Jaeger <aj@suse.de>
-
- * doc/tm.texi (Costs): Remove DONT_REDUCE_ADDR documentation.
-
- * config/avr/avr.h: Remove comment regarding DONT_REDUCE_ADDR.
- * config/dsp16xx/dsp16xx.h: Likewise.
- * config/i386/i386.h: Likewise.
- * config/ip2k/ip2k.h: Likewise.
-
-2003-06-07 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (OJBS, c-opts.o): Update.
- (c-options.c, c-options.h): Rename options.h and options.c.
- (options.h): Rename options_.h.
- (opts.o): New.
- * c-common.h (c_common_handle_option): Replace c_common_decode_option.
- (c_common_init_options): Update prototype.
- * c-lang.c (c_init_options): Update prototype.
- (LANG_HOOKS_HANDLE_OPTION): Override.
- (LANG_HOOKS_DECODE_OPTION): Drop.
- * c-opts.c: Include opts.h and options.h instead of c-options.h
- and c-options.c.
- (lang_flags): Move to file scope.
- (find_opt, c_common_decode_option): Remove.
- (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE,
- CL_REJECT_NEGATIVE): Move to opts.h.
- (missing_arg): Update prototype.
- (c_common_init_options): Update for new prototype.
- (c_common_handle_options): Filenames are passed as N_OPTS.
- * hooks.c (hook_int_void_0): New.
- * hooks.h (hook_int_void_0): New.
- * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default.
- (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now.
- (LANG_HOOKS_INITIALIZER): Update.
- * langhooks.h (init_options): Update.
- (handle_option): New.
- * opts.c, opts.h: New files.
- * opts.sh: Update c file to include opts.h and options.h.
- * toplev.c: Include opts.h; change options.h to options_.h.
- (parse_options_and_default_flags): Get lang_mask, use
- handle_option for language-specific handling.
- * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop.
- (LANG_HOOKS_HANDLE_OPTION): Override.
- (objc_init_options): Update.
-
-2003-06-07 Magnus Kreth <magnus.kreth@gmx.de>
- Thibaud Gaillard <thibaud.gaillard@nto.atmel.com>
-
- PR other/7031
- * Makefile.in (install-common): Remove GCOV_INSTALL_NAME instead of
- gcov.
-
-2003-06-07 Kelley Cook <kelleycook@wideopenwest.com>
-
- * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Remove quotes in
- section names.
- * configure: Regenerate.
-
-2003-06-07 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define.
-
-2003-06-06 James E Wilson <wilson@tuliptree.org>
-
- PR inline-asm/10890
- * reload1.c (merge_assigned_reloads): Abort only if two reloads have
- different in fields.
-
-2003-06-06 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * configure.in: Make $(target_subdir) correspond with top level usage.
- * Makefile.in: Likewise.
- * configure: Regenerate.
-
-2003-06-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_COMMON,
- ASM_OUTPUT_ALIGNED_LOCAL): Cast `SIZE' and `ALIGNED' parameters to
- unsigned HOST_WIDE_INT.
- * pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMOM, ASM_OUTPUT_ALIGNED_LOCAL):
- Likewise.
- * pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON, ASM_OUTPUT_ALIGNED_LOCAL):
- Likewise.
-
-2003-06-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * doc/install.texi (Prerequisites): New section documenting
- tools and packages necessary prior to building and/or
- modifying GCC.
- * doc/install.texi2html: Also generate prerequisites.html.
-
-2003-06-06 Richard Earnshaw <rearnsha@arm.com>
-
- PR target/11052
- * ifcvt.c (noce_process_if_block): Fail if the destination has
- side-effects.
-
-2003-06-06 Jason Merrill <jason@redhat.com>
-
- * stmt.c (resolve_asm_operand_names): Rename from
- resolve_operand_names. No longer static. Avoid needless copying.
- Don't build array of constraints.
- (expand_asm_operands): Build it here.
- * tree.h: Declare resolve_asm_operand_names.
-
- * stmt.c (expand_decl): Put artificial vars into registers even
- when not optimizing, and don't mark the regs as user vars.
-
-2003-06-06 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode
- of the generated register.
-
-2003-06-06 Daniel Jacobowitz <drow@mvista.com>
-
- * config.gcc: Add a missing sparc64 case.
-
-2003-06-06 Jakub Jelinek <jakub@redhat.com>
-
- * mklibgcc.in: Propagate .note.GNU-stack section if needed into
- the .hidden assembly stubs.
-
-2003-06-06 H.J. Lu <hongjiu.lu@intel.com>
-
- * config.gcc (extra_headers): Add emmintrin.h for i[34567]86-*-*
- and x86_64-*-*.
-
- * config/i386/mmintrin.h: Update version and add alternate
- intrinsic names.
- * config/i386/xmmintrin.h: Likewise.
-
- * config/i386/xmmintrin.h: Include <emmintrin.h>. Move SSE2
- intrinsics to ...
- * config/i386/emmintrin.h: Here. New file.
-
-2003-06-06 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (fold <ABS_EXPR>): Re-fold the result of folding
- fabs(-x) into fabs(x). Use tree_expr_nonnegative_p to determine
- when the ABS_EXPR (fabs or abs) is not required.
- (tree_expr_nonnegative_p): Move the logic that sqrt and exp are
- always nonnegative from fold to here. Additionally, cabs and fabs
- are always non-negative, and pow and atan are non-negative if
- their first argument is non-negative.
-
- * builtins.c (fold_builtin_cabs): New function to fold cabs{,f,l}.
- Evaluate cabs of a constant at compile-time. Convert cabs of a
- non-complex argument into fabs. Convert cabs(z) into
- sqrt(z.r*z.r + z.i*z.i) at the tree-level with -ffast-math or
- -funsafe-math-optimizations or -ffast-math.
- (fold_builtin): Convert BUILT_IN_FABS{,F,L} into an ABS_EXPR.
- Fold BUILT_IN_CABS{,F,L} using fold_builtin_cabs.
-
-Thu Jun 5 20:51:09 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * sourcebuild.texi (Front End Directory): Document new hooks.
-
-Fri Jun 6 11:02:35 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * function.c (FLOOR_ROUND, CEIL_ROUND): Fix.
- * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic
- stack frames.
- (pro_epilogue_adjust_stack_rex64_2): New pattern
-
-Fri Jun 6 11:03:14 CEST 2003 Jan Hubicka <jh@suse.cz>
- Pop Sebastian
- Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cfghooks.h, cfghooks.c: New files.
- * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h.
- (OBJS): Add cfghooks.o.
- (cfghooks.o): New rule.
- * basic-block.h (split_edge): Rename to rtl_split_edge.
- (verify_flow_info): Rename to rtl_verify_flow_info.
- (cfghooks.h): Included here.
- * cfgrtl.c (split_edge): Renamed rtl_split_edge.
- (verify_flow_info): Renamed rtl_verify_flow_info.
- * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks.
-
- * basic-block.h (split_block, split_edge, flow_delete_block,
- redirect_edge_and_branch, redirect_edge_and_branch_force): Delete.
- (flow_delete_block_noexpunge): Return void.
- * cfg.c (verify_flow_info): New function.
- * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match,
- try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks):
- Use delete_block.
- * cfglayout.c (function_footer): Rename to...
- (cfg_layout_function_footer): ... this variable
- (unlink_insn_chain): Make global.
- (fixup_reorder_chain, record_effective_endpoints): Update.
- (cleanup_unconditional_jumps): Use delete_block.
- (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c
- (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force.
- (cfg_layout_initialize, cfg_layout_finalize): Update hooks.
- * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete.
- (cfg_layout_function_footer): Declare.
- * cfgloopmanip (split_loop_bb): Do not update RBI.
- (remove_bbs): Use delete_block.
- (loop_reidrect_edge, loop_delete_branch_edge): Use
- redirect_edge_and_branch.
- (create_preheader): Use split_block and redirect_edge_and_branch_force.
- (split_edge_with): Likewise.
- * cfgrtl.c: Include cfglayout.h
- (split_edge): Rename to ...
- (rtl_split_edge) ... this one; make local.
- (redirect_edge_and_branch): Rename to ...
- (rtl_redirect_edge_and_branch) ... this one; make local.
- (redirect_edge_and_branch_force): Rename to ...
- (rtl_redirect_edge_and_branch_force) ... this one; make local.
- (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New.
- (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from
- cfglayout.c; update to directly call RTL counterparts.
- (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions.
- * ifcvt.c (find_cond_trap): Use delete_block.
- (find_if_case_1): Use delete_block.
- (find_if_case_2): Use delete_block.
- * rtl.h (unlink_insn_chain): Declare.
- * toplev.c (rtl_reigster_cfg_hooks): New.
-
-2003-06-05 Richard Henderson <rth@redhat.com>
-
- * recog.c (peephole2_optimize): Revert last change.
-
-2003-06-05 Richard Henderson <rth@redhat.com>
-
- * recog.c (peephole2_optimize): Don't split block unless
- can_throw_internal.
-
-2003-06-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (get_shift_alg): Correct the syntax of rotxl.
- * config/h8300/h8300.md (*addsi3_lshiftrt_16_zexthi): Likewise.
-
-2003-06-05 Kelley Cook <kelleycook@wideopenwest.com>
-
- PR optimization/4490
- * config/i386/i386.md: Don't use XFMode if TARGET_128BIT_LONG_DOUBLE.
- * doc/invoke.texi (m96bit-long-double, m128bit-long-double): Reword
- documentation to accurately reflect what these options do.
-
-2003-06-06 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * config/sh/linux.h (STARTFILE_SPEC): Handle -pie. Simplify.
- (ENDFILE_SPEC): Redefine to handle -pie.
-
-2003-06-05 Phil Edwards <phil@jaj.com>
-
- * Makefile.in (qmtest-g++): Use target_alias, not target.
-
-2003-06-05 Per Bothner <pbothner@apple.com>
-
- * toplev.c (push_srcloc): Simplify behavior to save current location
- and set current location to parameters.
- (pop_srcloc): Simplify semantics.
- (lang_dependent_init): Remove now-useless initial push_srcloc.
-
-2003-05-06 Richard Henderson <rth@redhat.com>
-
- * dwarf2out.c (loc_descriptor_from_tree): Return 0 for
- language-specific tree codes.
-
-2003-06-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR middle-end/9986
- * pa.c (pa_init_builtins): Also set implicit_built_in_decls for
- BUILT_IN_FPUTC_UNLOCKED to NULL_TREE.
-
-Thu Jun 5 18:32:46 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * install.tex: Document profiledbootstrap.
-
- * configure.in: Add support for lang.stageprofile and
- lang.stagefeedback
- * Makefile.in (clean, distclean): Kill new stages
- (POSTSTAGE1_FLAGS_TO_PASS): Break from ...
- (STAGE2_FLAGS_TO_PASS): ... this one.
- (STAGEPROFILE_FLAGS_TO_PASS, STAGEFEEDBACK_FLAGS_TO_PASS): New.
- (stage[2-4]_build): Add POSTSTAGE1_FLAGS_TO_PASS.
- (stageprofile_build, stageprofile_copy, stagefeedback_build,
- stagefeedback_copy): New.
- (restageprofile, restagefeedback, stageprofile-start,
- stageprofile, stagefeedback-start): Likewise.
-
-2003-06-05 David Miller <davem@redhat.com>
- Richard Henderson <rth@redhat.com>
-
- * optabs.c (HAVE_conditional_trap): Provide default.
- (gen_conditional_trap): Likewise.
- (init_optabs): Merge init_traps.
- (gen_cond_trap): Use prepare_operand. Restructure and avoid ifdef.
-
-Thu Jun 5 14:59:44 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * combine.c (simplify_if_then_else): (IF_THEN_ELSE (NE REG 0) (0) (8))
- is REG for nonzero_bits (REG) == 8.
-
-Thu Jun 5 13:23:51 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.md (align): Fix warning; clarify what to do when no p2align
- is available.
-
-2003-06-05 Nick Clifton <nickc@redhat.com>
-
- * config.gcc (m32r-elf): Revert previous delta.
- * config/m32r/t-m32r (crtinit.o): Fix rule to work with
- multilibs. Remove m32rx specific version.
- (crtfini.o): Likewise.
- (EXTRA_MULTILIB_PARTS): Define.
-
-2003-06-05 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/md.texi (Machine Constraints): Correct the meaning of
- constraints related to floating-point registers on SPARC.
-
-2003-06-05 Eric Botcazou <ebotcazou@libertysurf.fr>
- Paolo Bonzini <bonzini@gnu.org>
-
- PR target/10663
- * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Redirect
- assembler and linker output to /dev/null.
- Use a 'sed' construct instead of 'grep -A1'.
- * configure: Regenerate.
-
-2003-06-04 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.c (struct ix86_address): Add seg.
- (no_seg_address_operand): New.
- (ix86_decompose_address): Restructure PLUS loop. Accept one
- UNSPEC_TP if TARGET_TLS_DIRECT_SEG_REFS. Adjust ESP swap test
- to test for a regnum, not stack_pointer_rtx.
- (ix86_address_cost): Reduce cost if non-default segment.
- (legitimate_address_p): Remove UNSPEC_TP check.
- (get_thread_pointer): Add to_reg argument. Don't represent
- the thread pointer as a memory load.
- (legitimize_tls_address): Split out of ...
- (legitimize_address): ... here.
- (print_operand_address): Handle parts.seg.
- (ix86_expand_move): Use legitimize_tls_address.
- (ix86_rtx_costs): Handle UNSPEC_TP.
- * config/i386/i386.h (MASK_TLS_DIRECT_SEG_REFS): New.
- (TARGET_TLS_DIRECT_SEG_REFS): New.
- (TARGET_SWITCHES): Add tls-direct-seg-refs.
- (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): Default.
- (PREDICATE_CODES): Add no_seg_address_operand.
- * config/i386/i386.md (lea_1): Use it.
- (lea_1_rex64, lea_1_zext, lea_2_rex64): Likewise.
- (load_tp_si, add_tp_si, load_tp_di, add_tp_di): New.
- * config/i386/linux.h (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): New.
- * config/i386/linux64.h (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): New.
- * doc/invoke.texi: Add -mtls-direct-seg-refs.
-
-2003-06-04 Mark Mitchell <mark@codesourcery.com>
-
- * Makefile.in (QMTESTRUNFLAGS): Set for DejaGNU emulation.
- (QMTEST_GPP_TESTS): Use "g++" by default.
- (stamp-qmtest): Tweak database creation.
- (QMTEST_DIR/context): Update context file format.
- (qmtest-g++): Tweak command-line.
-
-2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (varasm.o): Don't set -Wno-error.
- * rs6000/t-rs6000 (varasm.o, out_object_file): Don't clear.
-
-2003-06-04 Zack Weinberg <zack@codesourcery.com>
-
- PR bootstrap/3163
- * aclocal.m4 (AC_FUNC_MMAP_ANYWHERE, AC_FUNC_MMAP_FILE): Delete.
- (gcc_AC_FUNC_MMAP_BLACKLIST): New.
- * configure.in: Check for sys/mman.h and mmap in AC_CHECK_HEADERS
- and AC_CHECK_FUNCS lists, respectively. Use
- gcc_AC_FUNC_MMAP_BLACKLIST, not AC_FUNC_MMAP_ANYWHERE nor
- AC_FUNC_MMAP_FILE.
- * configure, config.in: Regenerate.
-
-2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * arm/aout.h (ASM_OUTPUT_SKIP): Fix cast for format specifier warning.
- * arm.c (arm_output_function_prologue): Fix format specifiers.
- * arm.h (ARM_PRINT_OPERAND_ADDRESS): Likewise.
- * m68k.c (m68k_output_mi_thunk): Use more readable %wd instead of
- HOST_WIDE_INT_PRINT_DEC.
- * vax.c (vax_output_function_prologue): Fix format specifiers.
-
-2003-06-04 Richard Henderson <rth@redhat.com>
-
- * cse.c (find_best_addr): Consider binary operators even if second
- argument is not CONST_INT.
-
-2003-06-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * doc/invoke.texi (max-cse-path-length): Document.
-
-2003-06-04 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.md (align): Use ASM_OUTPUT_*ALIGN macros.
-
-2003-06-04 Andrew Pinski <pinskia@physics.uc.edu>
-
- * config/rs6000/darwin.h (RS6000_OUTPUT_BASENAME):
- Remove semi-colon at the end of the expression.
-
-2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * i370.c (mvs_function_name_length): Fix signed/unsigned warnings.
- * i370.h (mvs_function_name_length): Likewise.
- * i960.h (CONSTANT_ALIGNMENT): Likewise.
- * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
- * pa/pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
- * pa.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
- * rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Delete unused
- variable.
-
-2003-06-04 Daniel Jacobowitz <drow@mvista.com>
-
- * config.gcc: Reorganize --with-cpu logic. Set
- configure_default_options according to the default CPU, --with-cpu,
- --with-arch, --with-tune, --with-schedule, --with-abi, and
- --with-float. Check for legal values of various options.
- * configure.in: Define configure_default_options in configargs.h.
- * configure: Regenerated.
- * config/mips/mips.h (TARGET_DEFAULT_ARCH_P)
- (TARGET_DEFAULT_FLOAT_P): New macros.
- * gcc.c (do_option_spec): New function.
- (struct default_spec, option_default_specs): New.
- (main): Call do_option_spec.
- * config/alpha/alpha.h, config/arm/arm.h, config/i386/i386.h,
- config/mips/mips.h, config/pa/pa.h, config/rs6000/rs6000.h,
- config/sparc/sparc.h (OPTION_DEFAULT_SPECS): Define.
-
- * doc/install.texi: Update --with-cpu documentation. Mention
- --with-arch, --with-schedule, --with-tune, --with-abi, and
- --with-float.
- * doc/tm.texi (Driver): Document OPTION_DEFAULT_SPECS.
-
-2003-06-04 Daniel Jacobowitz <drow@mvista.com>
-
- * config.gcc: Only process --with-cpu logic in the third pass.
-
-2003-06-04 Daniel Jacobowitz <drow@mvista.com>
-
- * config.gcc: Reorganize --with-cpu section. Remove an
- obsolete comment about the default CPU for x86-64. Fix
- a typo for the ep9312. Update the list of supported PowerPC
- CPUs. Support a limited set of new --with-cpu options
- for i386.
-
-2003-06-04 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_complex_function_value): Unpack
- complex numbers <= 32 bits into two registers.
-
-2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * alpha.c (print_operand_address): Fix format specifier warnings.
- * alpha/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
- * alpha/vms.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
- * arm/aof.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise.
- * arm/pe.h (ASM_OUTPUT_COMMON): Likewise.
- * avr.h (ASM_OUTPUT_COMMON, ASM_GENERATE_INTERNAL_LABEL,
- ASM_OUTPUT_SKIP): Likewise.
- * c4x.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
- * dsp16xx.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
- * h8300.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_COMMON):
- Likewise.
- * i370.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
- * i386/cygming.h (ASM_OUTPUT_COMMON): Likewise.
- * i386/darwin.h (ASM_OUTPUT_COMMON): Likewise.
- * i960.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
- * m68k/hp320.h (PRINT_OPERAND_ADDRESS): Likewise.
- * mcore.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
- * pdp11.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
- * ptx4.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
- * sparc/freebsd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
- * svr3.h (ASM_OUTPUT_COMMON): Likewise.
-
-2003-06-04 J"orn Rennecke <joern.rennecke@superh.com>
-
- * c-decl.c (c_init_decl_processing): Clear input_file_name
- while building common nodes.
- * dwarf2out.c (gen_compile_unit_die, dwarf2out_finish):
- Don't add working directory for strings like <built-in> .
-
-2003-06-04 David Edelsohn <edelsohn@gnu.org>
-
- * doc/install.texi (*-ibm-aix*): Native as and ld required
- to bootstrap on AIX 5L.
-
-2003-06-04 Richard Henderson <rth@redhat.com>
-
- * c-common.c (handle_cleanup_attribute): New.
- (c_common_attributes): Add it.
- * c-decl.c (finish_decl): Honor the cleanup attribute.
- * doc/extend.texi (Variable Attributes): Document it.
-
- * unwind-c.c: New file.
- * Makefile.in (LIB2ADDEH): Add it.
- * config/t-darwin, config/t-linux, config/t-linux-gnulibc1,
- config/ia64/t-ia64: Likewise.
-
-2003-06-04 Jakub Jelinek <jakub@redhat.com>
-
- * function.c (trampolines_created): New variable.
- (expand_function_end): Set it when doing INITIALIZE_TRAMPOLINE.
- * function.h (trampolines_created): Add.
- * config/s390/linux.h (ASM_FILE_END): Define.
- * config/alpha/linux-elf.h (ASM_FILE_END): Define.
- * config/m68k/linux.h (ASM_FILE_END): Define.
- * config/rs6000/linux.h (ASM_FILE_END): Define.
- * config/rs6000/linux64.h (ASM_FILE_END): Define.
- * config/rs6000/ppc-asm.h: Add .note.GNU-stack on powerpc-linux.
- * config/sparc/linux.h (ASM_FILE_END): Define.
- * config/sparc/linux64.h (ASM_FILE_END): Define.
- * config/i386/i386.c (ix86_asm_file_end): Use SUBTARGET_FILE_END.
- * config/i386/linux.h (SUBTARGET_FILE_END): Define.
- * config/i386/linux64.h (SUBTARGET_FILE_END): Define.
-
-Wed Jun 4 18:39:33 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (min_insn_size, k8_avoid_jump_misspredicts): New functions
- (ix86_reorg): Use it.
- * i386.md (align): New insn pattern.
-
-2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * toplev.c (rest_of_type_compilation): Fix typo.
-
-2003-06-04 Jakub Jelinek <jakub@redhat.com>
- Alan Modra <amodra@bigpond.net.au>
-
- * config/i386/linux.h (NO_PROFILE_COUNTERS): Define to 1.
- * config/i386/freebsd.h (NO_PROFILE_COUNTERS): Likewise.
- * config/i386/netbsd-elf.h (NO_PROFILE_COUNTERS): Likewise.
- * config/xtensa/xtensa.h (NO_PROFILE_COUTNERS): Likewise.
- * config/darwin.h (NO_PROFILE_COUNTERS): Likewise.
- * final.c (NO_PROFILE_COUNTERS): Define to 0 if not defined.
- (profile_function): Allow NO_PROFILE_COUNTERS to be non-constant.
- * config/rs6000/rs6000.c (output_profile_hook): Likewise.
-
- * configure.in (powerpc*-*, s390*-*): Set tls_as_opt.
- Pass it to $gcc_cv_as.
- * configure: Rebuilt.
-
- * config/rs6000/rs6000.c (rs6000_abi_name): Remove initializer.
- (print_operand): Allow TARGET_AIX to be non-constant.
- (rs6000_aix_emit_builtin_unwind_init, rs6000_emit_eh_toc_restore):
- Define unconditionally.
- (rs6000_elf_declare_function_name): New function.
- * config/rs6000/rs6000.md (eh_return): Allow TARGET_AIX to be
- non-constant.
- * config/rs6000/linux64.h [!RS6000_BI_ARCH] (TARGET_64BIT): Define
- to 1.
- (DEFAULT_ARCH64_P, RS6000_BI_ARCH_P): Define.
- [IN_LIBGCC2] (TARGET_64BIT): Define based on whether __powerpc64__
- is defined.
- (TARGET_AIX): Define to 1 if TARGET_64BIT.
- (PROCESSOR_DEFAULT): Remove.
- (TARGET_RELOCATABLE, RS6000_ABI_NAME, INVALID_64BIT,
- INVALID_32BIT, SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
- [RS6000_BI_ARCH] (OVERRIDE_OPTIONS, ASM_FILE_START): Define.
- (ASM_DEFAULT_SPEC, ASM_SPEC, LINK_OS_LINUX_SPEC): Define for both
- -m32 and -m64.
- (MULTILIB_DEFAULTS): Define.
- (SUBSUBTARGET_EXTRA_SPECS): Define.
- (ASM_SPEC32, ASM_SPEC64, ASM_SPEC_COMMON): Define.
- (TARGET_TOC): Define only if !RS6000_BI_ARCH.
- (TARGET_NO_TOC): Remove.
- [!RS6000_BI_ARCH] (TARGET_RELOCATABLE, TARGET_EABI,
- TARGET_PROTOTYPE): Define to 0.
- (NO_PROFILE_COUNTERS): Define to TARGET_64BIT.
- (PROFILE_HOOK): Only call output_profile_hook if TARGET_64BIT.
- (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Adjust to work properly
- if !TARGET_64BIT.
- (USER_LABEL_PREFIX): Remove.
- (JUMP_TABLES_IN_TEXT_SECTION): Define to TARGET_64BIT.
- (SETUP_FRAME_ADDRESSES): Only call rs6000_aix_emit_builtin_unwind_init
- if TARGET_64BIT.
- (TARGET_OS_CPP_BUILTINS): Handle both -m32 and -m64.
- (LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Define.
- (STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Remove.
- (TOC_SECTION_ASM_OP): Define depending on TARGET_64BIT.
- (MINIMAL_TOC_SECTION_ASM_OP): Likewise.
- (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Define depending on
- TARGET_64BIT.
- (RS6000_CALL_GLUE): Likewise.
- (SAVE_FP_PREFIX, SAVE_FP_SUFFIX, RESTORE_FP_PREFIX,
- RESTORE_FP_SUFFIX): Likewise.
- (ASM_DECLARE_FUNCTION_NAME): Remove.
- (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_SOURCE_LINE,
- DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Only output dot before function
- name if TARGET_64BIT.
- (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Handle both TARGET_64BIT and
- !TARGET_64BIT.
- (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Remove undefs.
- (ASM_PREFERRED_EH_DATA_FORMAT): Take TARGET_64BIT into account.
- (DRAFT_V4_STRUCT_RET): Define.
- (SIGNAL_FRAMESIZE): New enum value.
- (MD_FALLBACK_FRAME_STATE_FOR): Define.
- * config/rs6000/default64.h: New file.
- * config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -m32 and -m64
- options.
- (SUBTARGET_OVERRIDE_OPTIONS): If rs6000_abi_name is NULL, set it
- to RS6000_ABI_NAME. Only disallow mixing of -fPIC with -mcall-aixdesc
- if !TARGET_64BIT.
- [!RS6000_BI_ARCH] (SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
- (ASM_DECLARE_FUNCTION_NAME): Use rs6000_elf_declare_function_name
- function.
- (TARGET_OS_SYSV_CPP_BUILTINS): Define.
- (TARGET_OS_CPP_BUILTINS): Use it.
- (CPP_SYSV_SPEC): Remove.
- (CPP_SPEC): Remove cpp_sysv.
- (SUBTARGET_EXTRA_SPECS): Remove cpp_sysv.
- Add SUBSUBTARGET_EXTRA_SPECS.
- (SUBSUBTARGET_EXTRA_SPECS): Define.
- * config/rs6000/biarch64.h: New file.
- * config/rs6000/rs6000-protos.h (rs6000_elf_declare_function_name):
- New prototype.
- * config/rs6000/x-linux64: New file.
- * config/rs6000/t-linux64: Build -m64, -m32 and -m32 -msoft-float
- multilibs.
- * config/rs6000/eabi-ci.asm: Protect with #ifndef __powerpc64__.
- * config/rs6000/eabi-cn.asm: Likewise.
- * config/rs6000/tramp.asm: Likewise.
- * config/rs6000/sol-ci.asm: Likewise.
- * config/rs6000/sol-cn.asm: Likewise.
- * config/rs6000/linux.h (TARGET_64BIT): Define to 0.
- (TARGET_OS_CPP_BUILTINS): Use TARGET_OS_SYSV_CPP_BUILTINS.
- * config/rs6000/ppc-asm.h: Move __powerpc64__ section before
- _CALL_AIXDESC section.
- * config.gcc (powerpc64-*-linux*): Configure a bi-arch compiler,
- defaulting to -m64 unless --with-cpu= is one of the 32-bit CPUs
- or default32.
-
-2003-06-04 Daniel Jacobowitz <drow@mvista.com>
-
- * config.gcc: Revert accidentally committed ARM changes.
-
-2003-06-04 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (dconstpi, dconste): New mathematical constants.
- (init_builtin_dconsts): New function to initialize dconstpi
- and dconste.
- (fold_builtin): Optimize exp(1.0) = e. Evaluate exp(x) at
- compile time with -ffast-math when x is an integer constant.
- Optimize tan(0.0) = 0.0. Optimize atan(0.0) = 0.0,
- atan(1.0) = pi/4 and tan(atan(x)) = x with -ffast-math.
-
-2003-06-04 Roger Sayle <roger@eyesopen.com>
-
- * calls.c (expand_call): Avoid calling pure or const functions
- when the result is ignored (or void) and none of the arguments
- are volatile. Move warning diagnostic earlier in function.
-
-2003-06-04 Andreas Jaeger <aj@suse.de>
-
- * system.h: Do not poison TDESC_SECTION_ASM_OP,
- RDATA_SECTION_ASM_OP and SUBTARGET_PROLOGUE.
-
-2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * final.c (asm_fprintf): Update comments, accept "-+ #0" flags,
- optimize '%' case, handle %c, don't accept %p, %e, %f or %g,
- handle %ll, optimize regular character case.
-
-2003-06-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * Makefile.in (cse.o): Add params.h dependency.
- * cse.c: Include params.h.
- (PATHLENGTH): Removed.
- (struct cse_basic_block_data): Make path array dynamic.
- (cse_end_of_basic_block): Use PARAM_MAX_CSE_PATH_LENGTH instead
- of PATHLENGTH.
- (cse_main, cse_basic_block): Allocate path array.
- * params.def (PARAM_MAX_CSE_PATH_LENGTH): New.
-
-Wed Jun 4 09:49:21 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_reorg): Replace the jump instead of adding nop.
- * i386.md (UNSPEC_REP): New constant.
- (return_internal_long): New pattern.
-
-2003-06-04 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/11018
- * config/sparc/sparc.c (sparc_v8plus_shift): Use which_alternative
- consistently to decide whether the scratch register is really
- required.
-
-2003-06-04 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/10876
- * config/sparc/sparc.h (CONST_OK_FOR_LETTER): Add
- new 'O' constraint for constant 4096.
- (CONST_DOUBLE_OK_FOR_LETTER_P): Likewise.
- * config/sparc/sparc.md (adddi3 expander): Canonicalize pattern.
- Do not transform into MINUS insn for constant 4096.
- (*adddi3_sp64 insn): Canonicalize pattern. Add new alternative
- for constant 4096 as third operand.
- (addsi3 expander): Remove.
- (*addsi3 insn): Rename into 'addsi3'. Canonicalize pattern. Add
- new alternative for constant 4096 as third operand.
- (subdi3 expander): Do not transform into PLUS insn for constant 4096.
- (*subdi3_sp64 insn): Add new alternative for constant 4096 as third
- operand.
- (subsi3 expander): Remove.
- (*subsi3 insn): Rename into 'subsi3'. Add new alternative for
- constant 4096 as third operand.
- * doc/md.texi (Machine Constraints): Document new 'O' constraint for
- the SPARC port.
-
-2003-06-03 Chris Demetriou <cgd@broadcom.com>
-
- * config/mips/t-linux64 (CRTSTUFF_T_CFLAGS_S): Define.
-
-2003-06-04 Andreas Jaeger <aj@suse.de>
-
- * config/i386/uwin.h: Remove SUBTARGET_PROLOGUE.
-
- * config/i386/i386.c (ix86_expand_prologue): Do not use
- SUBTARGET_PROLOGUE.
-
- * system.h: Poision SUBTARGET_PROLOGUE.
-
- * config/arm/arm-protos.h: Remove unused rdate_section prototype.
-
- * output.h: Remove TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP
- dependend code.
-
- * system.h: Poison TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP.
-
- * system.h: Poison INSN_CACHE_DEPTH, INSN_CACHE_SIZE and
- INSN_CACHE_LINE_WIDTH.
-
- * libgcc2.c (INSN_CACHE_PLANE_SIZE): Removed.
- (__clear_cache): Remove code dependend on INSN_CACHE_DEPTH,
- INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH.
-
- * doc/tm.texi (Trampolines): Remove INSN_CACHE_DEPTH,
- INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH.
-
- * dbxout.c (dbxout_type): Remove usage of DBX_OUTPUT_ENUM.
- (dbxout_symbol): Remove usage of DBX_OUTPUT_CONSTANT_SYMBOL.
- (dbxout_block): Remove usage of DBX_OUTPUT_CATCH.
- (dbxout_block): Remove usage of DBX_LBRAC_FIRST.
- (dbxout_source_file): Remove usage of DBX_OUTPUT_SOURCE_FILENAME.
- (dbxout_init): Remove test for DBX_WORKING_DIRECTORY.
-
- * doc/tm.texi (DBX Options): Do not document DBX_LBRAC_FIRST,
- DBX_OUTPUT_SOURCE_FILENAME and DBX_OUTPUT_ENUM and
- DBX_WORKING_DIRECTORY.
-
- * system.h: Poison DBX_LBRAC_FIRST, DBX_OUTPUT_ENUM,
- DBX_OUTPUT_SOURCE_FILENAME and DBX_WORKING_DIRECTORY.
-
- * config/frv/frv-protos.h: Remove unused const_section
- declaration.
- * config/vax/vax-protos.h: Likewise.
-
- * output.h: Remove CONST_SECTION_ASM_OP usage.
-
- * system.h: Poison CONST_SECTION_ASM_OP.
-
- * crtstuff.c (__do_global_dtors_aux): Remove usage of
- CRT_GET_RFIB_TEXT.
- (frame_dummy): Likewise.
- * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise.
- * system.h: Poison CRT_GET_RFIB_TEXT.
-
- * collect2.c (is_ctor_dtor): Remove CFRONT_LOSSAGE dependend code.
-
- * fix-header.c: Remove ADD_MISSING_EXTERN_C dependend variables.
- (write_lbrac): Remove ADD_MISSING_EXTERN_C dependend code.
- (recognized_function): Likewise.
- (read_scan_file): Likewise.
-
-2003-06-03 Roger Sayle <roger@eyesopen.com>
-
- * optabs.c (expand_binop): Optimize complex multiplication for
- the case of squaring a complex argument.
-
-2003-06-03 Roger Sayle <roger@eyesopen.com>
-
- * optabs.c (expand_binop): Attempt to reuse pseudos for duplicate
- non-volatile operands of binary operations.
- (prepare_cmp_insn): Likewise.
-
-2003-06-03 Roger Sayle <roger@eyesopen.com>
-
- * varasm.c (force_const_mem): Handle alignment of constants not
- representable as a type in the front-end language.
-
-2003-06-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * flow.c (initialize_uninitialized_subregs): Use
- emit_move_insn instead of emitting a hardcoded move.
-
-2003-06-03 Richard Henderson <rth@redhat.com>
-
- * optabs.c (expand_abs_nojump): Split out from ...
- (expand_abs): ... here.
- * optabs.h (expand_abs_nojump): Declare.
- * ifcvt.c: (noce_try_abs): Use expand_abs_nojump.
- * Makefile.in (ifcvt.o): Depend on optabs.h.
-
-2003-06-03 Alan Modra <amodra@bigpond.net.au>
-
- * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Heed flag_merge_constants.
-
-2003-06-03 Jason Thorpe <thorpej@wasabisystems.com>
-
- * config.gcc (default_use_cxa_atexit): New variable, defaults to no.
- (*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*): Set default_use_cxa_atexit
- to yes.
- * configure.in: Allow default_use_cxa_atexit to determine the
- value of DEFAULT_USE_CXA_ATEXIT if not explicitly enabled or
- disabled.
- * configure: Regenerate.
-
-2003-06-03 Douglas B Rupp <rupp@gnat.com>
-
- * Makefile.in (TEXI_GCC_FILES): Remove vms.texi entry.
- * doc/gcc.texi: Remove vms.texi section.
- * doc/vms.texi: Remove obsolete file.
-
-2003-05-23 J"orn Rennecke <joern.rennecke@superh.com>
-
- * configure.in (inhibit_libc): Don't define when configuring
- with --with-newlib --with-headers.
- * configure: Regenerate.
-
- * t-sh: Remove LIB2FUNCS_EXTRA and embed-bb.c rules.
-
-2003-06-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * configure.in (gcc_cv_as_hidden): Disable .hidden completely on
- IRIX 6 without GNU ld.
- * configure: Regenerate.
-
-2003-06-03 Roger Sayle <roger@eyesopen.com>
-
- * expr.c (emit_move_insn_1): Use emit_move_insn to move the parts
- of a complex number rather than invoke mov_optab directly.
-
-2003-06-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * combine.c (simplify_set): Don't move a subreg in SET_SRC to
- SET_DEST if WORD_REGISTER_OPERATIONS is not defined.
-
-2003-06-03 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/i386/x86-64.h: Remove two target-independent comments;
- replace "GNU CC" with "GCC".
-
-2003-06-03 Anthony Green <green@redhat.com>
-
- * config/frv/t-frv (EXTRA_HEADERS): Remove media.h
-
-2003-06-03 Roger Sayle <roger@eyesopen.com>
-
- * builtins.def (BUILT_IN_CABS, BUILT_IN_CABSF, BUILT_IN_CABSL):
- New builtins representing ISO C99's cabs, cabsf and cabsl.
- * builtins.c (expand_builtin_fabs): New function.
- (expand_builtin_cabs): New function.
- (expand_builtin): Expand BUILT_IN_FABS{,F,L} and BUILT_IN_CABS{,F,L}
- using expand_builtin_fabs and expand_builtin_cabs respectively.
-
- * doc/extend.texi: Document new cabs, cabsf and cabsl builtins.
-
-2003-06-03 Aldy Hernandez <aldyh@redhat.com>
-
- * function.c (assign_parms): Split complex arguments.
-
- * doc/tm.texi (SPLIT_COMPLEX_ARGS): Document.
-
- * expr.h (SPLIT_COMPLEX_ARGS): Define.
- (split_complex_types): Protoize.
- (split_complex_values): Protoize.
-
- * calls.c (expand_call): Split complex arguments on architectures
- that require it.
- (split_complex_values): New.
- (split_complex_types): New.
-
- * config/rs6000/rs6000.c (rs6000_libcall_value): New.
- (rs6000_function_value): Handle complex values on AIX.
- (rs6000_complex_function_value): New.
-
- * config/rs6000/rs6000-protos.h (rs6000_libcall_value): Protoize.
-
- * config/rs6000/rs6000.h (LIBCALL_VALUE): Call function.
- (SPLIT_COMPLEX_ARGS): New.
-
-2003-06-03 Jakub Jelinek <jakub@redhat.com>
-
- * configure.in (HAVE_LD_PIE): Check for ld -pie.
- * config.in: Rebuilt.
- * configure: Rebuilt.
- * toplev.c (flag_pie, flag_shlib): New variables.
- (f_options): Add -fpie and -fPIE.
- (parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE.
- Set flag_shlib if flag_pic and not -fpie/-fPIE.
- * flags.h (flag_pic, flag_shlib): Add.
- * varasm.c (default_binds_local_p): Use flag_shlib instead of
- flag_pic.
- * gcc.c (LINK_PIE_SPEC): Define.
- (LINK_COMMAND_SPEC): Use LINK_PIE_SPEC.
- (option_map): Add --pie -> -pie mapping.
- * config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic
- and -fPIE the same way as -fPIC.
- * config/openbsd.h (ASM_SPEC): Likewise.
- * config/frv/frv.h (ASM_SPEC): Likewise.
- * config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise.
- * config/arm/semi.h (ASM_SPEC): Likewise.
- * config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise.
- * config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise.
- * config/i386/beos-elf.h (CC1_SPEC): Likewise.
- * config/i386/freebsd-aout.h (ASM_SPEC): Likewise.
- * config/m68k/linux.h (CPP_SPEC): Likewise.
- * config/m68k/netbsd.h (ASM_SPEC): Likewise.
- * config/m68k/openbsd.h (ASM_SPEC): Likewise.
- * config/m68k/netbsd-elf.h (ASM_SPEC): Likewise.
- * config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise.
- * config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise.
- * config/pa/pa-linux.h (CPP_SPEC): Likewise.
- * config/netbsd-aout.h (ASM_SPEC): Likewise.
- * config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise.
- * config/rs6000/vxworks.h (CPP_SPEC): Likewise.
- * config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
- * config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
- * config/sparc/sparc.h (ASM_SPEC): Likewise.
- * config/sparc/sp64-elf.h (ASM_SPEC): Likewise.
- * config/sparc/sysv4.h (ASM_SPEC): Likewise.
- * config/sparc/netbsd-elf.h (ASM_SPEC): Likewise.
- * config/sparc/openbsd64.h (ASM_SPEC): Likewise.
- * config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise.
- * config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie.
- Simplify.
- * config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
- * config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
- * config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
- * config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
- * config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
- * config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
- * config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
- * doc/invoke.texi: Document -pie, -fpie and -fPIE options.
-
-2003-06-03 Jakub Jelinek <jakub@redhat.com>
-
- * builtins.c (expand_builtin_memcpy): Remove endp argument and endp
- != 0 handling. Pass 0 to store_by_pieces.
- (expand_builtin_mempcpy): Add endp argument. Don't call
- expand_builtin_memcpy, call store_by_pieces resp. move_by_pieces
- directly. If ignoring result, only do expand_call.
- (expand_builtin_stpcpy): Likewise. Call expand_builtin_mempcpy
- otherwise.
- (expand_builtin_strncpy, expand_builtin_memset): Adjust
- store_by_pices callers.
- (expand_builtin): Adjust expand_builtin_memcpy and
- expand_builtin_mempcpy callers.
- * expr.c (can_move_by_pieces): New function.
- (move_by_pieces): Add endp argument, return to resp. memory at end
- or one byte earlier depending on endp.
- (store_by_pieces): Likewise.
- (emit_block_move): Adjust call to move_by_pieces.
- (emit_push_insn): Adjust move_by_pieces caller.
- * expr.h (can_move_by_pieces): New prototype.
- (store_by_pieces): Adjust prototypes.
- * rtl.h (move_by_pieces): Adjust prototype.
- * config/mips/mips.c (expand_block_move): Adjust move_by_pieces
- caller.
-
-2003-06-03 Ben Elliston <bje@wasabisystems.com>
-
- * doc/md.texi (Processor pipeline description): Improve wording.
-
-2003-06-03 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (c_common_handle_option): New, pulled out of
- c_common_decode_option. Substitute uses of argv.
- (c_common_decode_option): Broken into two.
-
-2003-06-02 Roger Sayle <roger@eyesopen.com>
- Zack Weinberg <zack@codesourcery.com>
-
- * emit-rtl.c (gen_complex_constant_part): Remove unnecessary
- test of TREE_CONSTANT_POOL_ADDRESS_P.
-
-2003-06-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * mips.c: Don't include output.h twice.
- * stormy16.c: Likewise.
- * xtensa.c: Likewise.
- * output.h: Protect against multiple inclusion.
-
-2003-06-02 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (OLD_ARG_MODE): New macro.
- (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
- (FUNCTION_ARG_1): Break out of:
- (FUNCTION_ARG). Use OLD_ARG_MODE.
-
-2003-06-02 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
-
- * gcc/config.gcc Add support multilib parts for m32rx processor.
-
-2003-06-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (c-options.c): Pass in $(AWK) to opts.sh.
- (mostlyclean): Delete c-options.c and c-options.h.
-
-2003-06-02 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (CL_REJECT_NEGATIVE): New.
- (c_common_decode_option): Update to use it.
- * c.opt: Update documentation; use RejectNegative.
- * opts.sh: Handle RejectNegative.
-
-2003-06-01 Zack Weinberg <zack@codesourcery.com>
-
- * ggc-page.c (init_ggc): Give better diagnostics on failure to
- open /dev/zero.
- * toplev.c (crash_signal): Reset handling for received signal
- to SIG_DFL.
-
-2003-06-02 Ben Elliston <bje@wasabisystems.com>
-
- * config/arm/arm.c (arm_use_dfa_pipeline_interface): Declare.
- (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define if not already.
- (arm_use_dfa_pipeline_interface): Implement.
- * config/arm/arm.md (arm): New automaton.
- (write_buf): Remove function units; new cpu unit.
- (write_blockage): Remove function units; new cpu unit.
- (core): Remove function units; new cpu unit.
- (r_mem_f_wbuf): New instruction reservation.
- (store1_wbuf, store2_wbuf, store3_wbuf, store4_wbuf): Likewise.
- (store1_ldsched, store2, store3, store4): Likewise.
- (load_ldsched, load_ldsched_xscale, load_or_store): Likewise.
- (mult, mult_ldsched, mult_ldsched_strongarm): Likewise.
- (multi_cycle, single_cycle): Likewise.
- * config/arm/fpa.md (armfp): New automaton.
- (fpa): Remove function units; new cpu unit.
- (fpa_mem): Remove function unit; new cpu unit.
- (fdivx, fdivd, fdivs, fmul, ffmul, farith, ffarith): New reservations.
- (r_2_f, f_2_r, f_load, f_store, r_mem_f, f_mem_r): Likewise.
-
-2003-06-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtin-attrs.def (ATTR_ASM_FPRINTF): New.
- * c-format.c (enum format_type): Add asm_fprintf_format_type.
- (NOARGUMENTS, asm_fprintf_length_specs, asm_fprintf_flag_specs,
- asm_fprintf_flag_pairs, asm_fprintf_char_table): New.
- (format_types_orig): Renamed from format_types. Add new data.
- (format_types): Declare as pointer.
- (handle_format_attribute): Move later in file so we have all
- necessary declarations. Add section to capture HOST_WIDE_INT.
- * output.h (ATTRIBUTE_ASM_FPRINTF, __gcc_host_wide_int__): New.
- (asm_fprintf): Mark with ATTRIBUTE_ASM_FPRINTF.
-
-2003-06-01 Andreas Jaeger <aj@suse.de>
-
- * doc/tm.texi (Storage Layout): Remove ROUND_TYPE_SIZE and
- ROUND_TYPE_SIZE_UNIT.
-
- * stor-layout.c (finalize_record_size): Remove usages of
- ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.
- (finalize_type_size): Likewise.
- (layout_type): Likewise.
-
- * system.h: Poison ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.
-
- * loop.c (check_insn_for_givs): Remove DONT_REDUCE_ADDR macro.
-
- * config/d30v/d30v.h: Remove text copied from the manual.
-
-2003-06-01 Roger Sayle <roger@eyesopen.com>
- John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
- Geoffrey Keating <geoffk@apple.com>
-
- * emit-rtl.c (gen_lowpart_common): Handle interpreting integer
- constants as condition code values.
-
-2003-06-01 DJ Delorie <dj@redhat.com>
-
- * cppmacro.c (warn_of_redefinition): Handle cases where the two
- definitions have different numbers of tokens.
-
-2003-06-01 Andreas Jaeger <aj@suse.de>
-
- * gen-protos.c (main): Readd unused attribute for argc.
-
-2003-06-01 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (c-options.c, c-options.h): Parallel make safe.
- * c.opt: End in blank line.
- * opts.sh: Take AWK from environment if available; use C locale.
-
-2003-06-01 Andreas Schwab <schwab@suse.de>
-
- * config/m68k/linux.h: Remove code protected by USE_GNULIBC_1.
-
-2003-06-01 Andreas Jaeger <aj@suse.de>
-
- * gen-protos.c (main): Revert patch to check for argument.
-
-2003-06-01 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR target/11044
- * config/i386/i386.md (length attribute): Set length to 4
- for instructions of type "fcmp".
-
-2003-06-01 Andreas Jaeger <aj@suse.de>
-
- * toplev.c: Use ISO C90 prototypes.
-
- * toplev.h: Use ISO C90 prototypes.
-
- * genrecog.c: Use ISO C90 prototypes.
- (nodes_identical): Correct declaration to match prototype.
- (maybe_both_true): Likewise.
- (merge_trees): Likewise.
-
- * genpeep.c (gen_peephole): Remove #if 0 code.
- Use ISO C90 prototypes.
-
- * genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code.
- Remove #if 0'ed function simplify_by_alternatives.
- (optimize_attrs): Remove #if 0'ed code.
- Remove ^L.
- Use ISO C90 prototypes.
- (make_canonical): Remove #if 0'ed code.
- (convert_const_symbol_ref): Remove #if 0'ed function.
-
- * gen-protos.c (main): Check for argument.
-
- * rtl.h: Use ISO C90 prototypes for functions from lists.c.
-
- * params.h: Use ISO C90 prototypes.
- * params.c: Likewise.
- * intl.c: Likewise.
- * intl.h: Likewise.
- * lists.c: Likewise.
- * errors.c: Likewise.
- * errors.h: Likewise.
- * gencodes.c: Likewise.
- * genpreds.c: Likewise.
- * genattr.c: Likewise.
- * gen-protos.c: Likewise.
- * genflags.c: Likewise
- * genconditions.c: Likewise.
- * genautomata.c: Likewise.
- * gencheck.c: Likewise.
- * genconfig.c: Likewise.
- * genconstants.c: Likewise.
- * genemit.c: Likewise.
- * genextract.c: Likewise.
- * gengenrtl.c: Likewise.
- * gengtype.c: Likewise.
- * gengtype.h: Likewise.
- * genopinit.c: Likewise.
- * genoutput.c: Likewise.
- * gensupport.c: Likewise.
- * gensupport.h: Likewise.
-
- * sdbout.h: Use ISO C90 prototypes.
-
- * sdbout.c (CONTIN): Removed empty macro.
- (sdbout_one_type): Remove CONTIN usages.
- Remove ^Ls.
- (tag_of_ru_type): Remove #if 0'ed function.
- (sdbout_symbol): Remove #if 0'ed code.
- (sdbout_one_type): Remove a #if 1.
- (sdbout_one_type): Remove #if 0'ed code.
- (sdbout_init): Remove RMS_QUICK_HACK_1 code.
- Remove PARAMS, use ISO C90 prototypes for all functions.
-
-2003-06-01 Josef Zlomek <zlomekj@suse.cz>
-
- * rtl.def (CONST_DOUBLE): Update comment.
-
-2003-06-01 Neil Booth <neil@daikokuya.co.uk>
-
- * opts.sh: Remove path from sort.
-
-2003-06-01 Aldy Hernandez <aldyh@redhat.com>
-
- PR/9680
- * config/rs6000/rs6000.h (CANNOT_CHANGE_MODE_CLASS): Require
- TARGET_SPE for SPE_VECTOR_MODE.
-
-2003-05-31 Aldy Hernandez <aldyh@redhat.com>
-
- * toplev.c (botch): Remove.
- (do_abort): Remove.
- (set_Wunused): Comment.
- (set_Wextra): Comment.
- Remove ^L's.
- (rest_of_compilation): Factor out common code into functions.
- (rest_of_handle_inlining): New.
- (rest_of_handle_ssa): New.
- (rest_of_handle_cse): New.
- (rest_of_handle_gcse): New.
- (rest_of_handle_loop_optimize): New.
- (rest_of_handle_jump_bypass): New.
- (rest_of_handle_sibling_calls): New.
- (rest_of_handle_null_pointer): New.
- (rest_of_handle_addresof): New.
- (rest_of_handle_flow): New.
- (rest_of_handle_branch_prob): New.
- (rest_of_handle_if_conversion): New.
- (rest_of_handle_tracer): New.
- (rest_of_handle_loop2): New.
- (rest_of_handle_cse2): New.
- (rest_of_handle_life): New.
- (rest_of_handle_combine): New.
- (rest_of_handle_if_after_combine): New.
- (rest_of_handle_regmove): New.
- (rest_of_handle_sched): New.
- (rest_of_handle_old_regalloc): New.
- (rest_of_handle_new_regalloc): New.
- (rest_of_handle_regrename): New.
- (rest_of_handle_reorder_blocks): New.
- (rest_of_handle_sched2): New.
- (rest_of_handle_new_regalloc): New.
- (rest_of_handle_old_regalloc): New.
- (rest_of_handle_regrename): New.
- (rest_of_handle_reorder_blocks): New.
- (rest_of_handle_stack_regs): New.
- (rest_of_handle_machine_reorg): New.
- (rest_of_handle_delay_slots): New.
- (rest_of_handle_final): New.
-
- * toplev.h (botch): Remove prototype.
- (do_abort): Same.
-
-2003-05-31 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (c-opts.o, c-options.h): Update dependencies.
- * c-opts.c: Include c-options.h and c-options.c.
- (CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
- Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
- (CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
- OPT, opt_comp): Remove.
- (missing_arg, c_common_init_options, c_common_decode_option,
- write_langs): Update for macro redefinitions and enumeration
- name changes.
- * c.opt, opts.sh: New files.
- * doc/passes.texi: Update.
-
-2003-05-31 Andreas Jaeger <aj@suse.de>
-
- * function.c (trampoline_address): Remove ALLOCATE_TRAMPOLINE
- usage.
-
- * doc/tm.texi (Trampolines): Remove ALLOCATE_TRAMPOLINE.
-
- * config/d30v/d30v.h: Remove traces of ALLOCATE_TRAMPOLINE.
-
- * system.h: Poison ALLOCATE_TRAMPOLINE.
-
- * doc/tm.texi (Misc): Remove HANDLE_PRAGMA.
- * system.h: Poison HANDLE_PRAGMA.
-
-2003-05-31 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Update dump file names.
-
-2003-05-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-format.c (format_length_info, format_char_info,
- format_flag_spec, format_flag_pair, format_kind_info):
- De-const-ify structure members.
-
-2003-05-31 Roger Sayle <roger@eyesopen.com>
-
- * flags.h (flag_wrapv): New flag controlling overflow semantics.
- * toplev.c (flag_wrapv): Declare the variable with default false.
- (lang_independent_options): New option "-fwrapv" to set the above.
-
- * fold-const.c (extract_muldiv_1): Disable optimization of (2*x)/2
- as x, when signed arithmetic overflow wraps around.
- (fold): Optimize "-A - B" as "-B - A" if overflow wraps around.
- * loop.c (basic_induction_var): Ignore BIVs that rely on undefined
- overflow when flag_wrapv is true.
-
- * doc/invoke.texi: Document new -fwrapv command line option.
- * doc/c-tree.texi: Mention that the overflow semantics of
- NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR and MULT_EXPR is dependent
- upon both flag_wrapv and flag_trapv.
-
-2003-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/install.texi (mips-sgi-irix5): Add missing
- HTML <hr> marker.
-
-2003-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/md.texi (Machine Constraints): Document
- missing SPARC constraints.
-
-2003-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/md.texi (Automaton pipeline description): Use
- "type" instead of "cpu" as the attribute in the examples.
-
-2003-05-30 Stan Shebs <shebs@apple.com>
-
- * system.h: Poison OBJC_PROLOGUE.
-
-2003-05-30 Roger Sayle <roger@eyesopen.com>
-
- * emit-rtl.c (gen_complex_constant_part): New function for getting
- the constant real or imaginary part of a complex constant.
- (gen_realpart): Use it.
- (gen_imagpart): Likewise.
-
-2003-05-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Fix typos.
- * doc/rtl.texi: Likewise.
-
-2003-05-30 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
-
- * config/h8300/crti.asm: Use .h8300hn and .h8300sn for normal
- mode.
- * config/h8300/crtn.asm: Likewise.
- * config/h8300/lib1funcs.asm: Likewise.
- * config/h8300/h8300.c (asm_file_start): Likewise.
- * config/h8300/elf.h (LINK_SPEC): Use h8300hnelf and
- h8300snelf emulations for normal mode.
- * config/h8300/h8300.h (LINK_SPEC): Use h8300hn and h8300sn
- emulations for normal mode.
-
-2003-05-30 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
-
- * config/h8300/h8300.c (h8300_tiny_constant_address_p): Return
- true if TARGET_NORMAL_MODE.
-
-2003-05-30 Roger Sayle <roger@eyesopen.com>
-
- * cse.c (cse_insn): Simplify REG_EQUAL note on libcalls when
- making a substitution.
- (dead_libcall_p): If directly replacing a libcall with a
- constant value produces an invalid instruction, also try forcing
- the constant into the constant pool.
- * expr.c (emit_move_insn): Add a REG_EQUAL note when it is not
- obvious that the source is a constant.
- (compress_float_constant): Use set_unique_reg_note to place
- REG_EQUAL notes on instructions.
-
-2003-05-30 Eric Christopher <echristo@redhat.com>
-
- * config/mips/mips.c (extern_list): Add GTY marker.
- (extern_head): Separate out definition. Add marker.
- (mips_output_external): Use ggc_alloc for extern_list
- allocation.
- (mips_output_external_libcall): Ditto.
-
-2003-05-30 Florian Weimer <fw@deneb.enyo.de>
-
- * doc/install.texi: Ada-enabled bootstrap requires GNAT 3.14 or
- later.
-
-2003-05-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * vax.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier
- warnings.
- (PRINT_OPERAND): Likewise.
-
-2003-05-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Move
- -mdebug/-no-mdebug switches ...
- (MDEBUG_ASM_SPEC): ... here.
- Use only with gas.
- (EXTRA_SPECS): Initialize mdebug_asm_spec.
-
-2003-05-29 Matt Kraai <kraai@alumni.cmu.edu>
-
- * gthr-gnat.c: Remove #undef UNUSED.
- (__gnat_default_lock, __gnat_default_unlock): Prototype.
- (__gnat_task_lock, __gnat_task_unlock): Make declarations
- prototypes.
- (__gnat_install_locks): Convert declaration to ISO C90, make
- parameter declarations prototypes, and remove blank line.
- * gthr-gnat.h (__gnat_install_locks): Make parameter
- declarations prototypes.
-
-2003-05-29 Jason Merrill <jason@redhat.com>
-
- * Makefile.in (unstrap): Remove stage_last after make unstage1.
-
-2003-05-29 Roger Sayle <roger@eyesopen.com>
-
- * mips-tfile.c (PAGE_SIZE): Increase page size to 32K.
-
-2003-05-29 Roger Sayle <roger@eyesopen.com>
- Kaveh Ghazi <ghazi@caip.rutgers.edu>
-
- PR bootstrap/10169
- * mips-tfile.c (main): Use getopt_long instead of getopt.
- Add new command line option --version to display version.
- Treat --verbose like -v to report a single line version.
- (options): New global variable for getopt_long.
- * mips-tdump.c (main): Use getopt_long instead of getopt.
- New command line options -v, --version and -verbose to display
- the program version number (to match mips-tfile's behavior).
- (options): New global variable for getopt_long.
-
- * gcov.c (options): Zero-terminate getopt_long array.
- * gcov-dump.c (options): Likewise.
-
- * Makefile.in (mips-tdump.o): Add dependency on version.h.
-
-2003-05-29 Stan Shebs <shebs@apple.com>
-
- Remove OBJC_PROLOGUE everywhere.
- * objc/objc-act.c (finish_objc): Remove use of OBJC_PROLOGUE.
- * config/avr/avr.h: Remove no-op ref to OBJC_PROLOGUE.
- * config/d30v/d30v.h: Similarly.
- * config/ip2k/ip2k.h: Similarly.
- * doc/tm.texi: Remove doc of OBJC_PROLOGUE.
-
-2003-05-29 Roger Sayle <roger@eyesopen.com>
-
- * c-semantics.c (genrtl_do_stmt_1): New function split out from...
- (gen_rtl_do_stmt): ... here. Call genrtl_do_stmt_1.
- (expand_unreachable_stmt): Expand unreachable while statements
- using genrtl_do_stmt_1.
-
-2003-05-29 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_output_load_label): Declare.
- * config/mips/mips.c (mips_output_load_label): New function.
- (mips_output_conditional_branch): Use it.
- * config/mips/mips.md (jump): And here.
-
-2003-05-28 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa-protos.h (smalloffset_double_mem_p): Delete.
- (xtensa_split_operand_pair): New proto.
- * config/xtensa/xtensa.c (move_operand): Handle DFmode and DImode.
- (smalloffset_double_mem_p): Delete.
- (gen_float_relational, printx, print_operand, xtensa_va_arg):
- Fix whitespace.
- (xtensa_split_operand_pair): New.
- (xtensa_dbx_register_number): Fix formatting.
- * config/xtensa/xtensa.h (EXTRA_CONSTRAINT): Remove 'S' constraint.
- * config/xtensa/xtensa.md (movdi, movdf): Force constants to memory
- instead of splitting them into single-word moves. Remove unnecessary
- checks for reload_in_progress and reload_completed.
- (movdi_internal, movdf_internal): Change to post-reload split patterns.
- Add constraints to allow constant operands.
- (movsf_internal): Allow CONST_INT operands.
-
-2003-05-27 Danny Smith <dannysmith@users.sourceforge.net>
-
- * config.gcc (i[34567]86-*-mingw32*): Add host makefile
- fragment i386/x-mingw32.
- * config/i386/x-mingw32: New file. Make local_includedir
- relative to EXEC_PREFIX.
-
-2003-05-27 Aaron W. LaFramboise <awlaframboise@aol.com>
-
- * config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Update.
- (MD_STARTFILE_PREFIX): Define.
-
-2003-05-27 Denis Chertykov <denisc@overta.ru>
-
- * cselib.c (cselib_invalidate_regno): Abort if hardreg have a
- VOIDmode.
- * cselib.c (cselib_process_insn): Pass reg_raw_mode for hardreg in
- call of cselib_invalidate_regno.
-
-2003-05-28 Daniel Jacobowitz <drow@mvista.com>
-
- * config/mips/linux.h (LIB_SPEC): Add missing -lc and correct
- -lthread to -lpthread.
-
-2003-05-28 Eric Botcazou <ebotcazou@libertysurf.fr>
- Bruce Korb <bkorb@gnu.org>
- Arno Klaassen <arno@heho.snv.jussieu.fr>
-
- * fixinc/inclhack.def: Add missing declaration of getpagesize()
- to unistd.h on Solaris 2.5.1.
- Fix prototype of recv() and send() in sys/socket.h on
- Solaris 2.5.1 and 2.6.
- * fixinc/tests/base/unistd.h: Add solaris_unistd fix test.
- * fixinc/tests/base/sys/socket.h: Add solaris_socket test.
- * fixinc/check.tpl: Use 'diff -c', not 'diff -u'.
- * fixinc/fixincl.x: Regenerate.
-
-2003-05-27 Jason Merrill <jason@redhat.com>
-
- * tree.c (expr_first, expr_length): New fns.
- * tree.h: Declare them.
-
- * tree.c (iterative_hash_expr): Hash commutative expressions
- consistently.
-
-2003-05-27 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * tree.h (contains_placeholder_p): Now returns bool.
- (CONTAINS_PLACEHOLDER_P): New macro.
- (type_contains_placeholder_p): New function.
- * tree.c (save_expr): Remove code avoiding folding COMPONENT_REF.
- (contains_placeholder_p): Now returns bool.
- Rework to use CONTAINS_PLACEHOLDER_P macro.
- (type_contains_placeholder_p): New function.
- * fold-const.c (fold, case COMPONENT_REF): Don't fold if
- type_contains_placeholder_p.
- (fold_range_test, fold_mathfn_compare, fold_inf_compare, fold):
- Use CONTAINS_PLACEHOLDER_P macro.
- * builtins.c (fold_builtin): Likewise.
- * calls.c (initialize_argument_information): Likewise.
- * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
- * explow.c (expr_size): Likewise.
- * expr.c (store_constructor, get_inner_reference): Likewise.
- * function.c (assign_parms): Likewise.
- * stor-layout.c (variable_size): Likewise.
-
-2003-05-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * diagnostic.h (output_verbatim, verbatim): Remove printf
- attribute.
-
-2003-05-25 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Update Kean Johnston.
-
-2003-05-24 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.md (save_fpregs_{si,di}): Add length attribute.
-
-2003-05-24 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/rs6000/440.md, config/stormy16/stormy16protos.h,
- config/stormy16/stormy16.c, config/stormy16/stormy16.md:
- Replace "GNU CC" with "GCC".
-
-2003-05-24 Matt Kraai <kraai@alumni.cmu.edu>
-
- * builtins.c (expand_builtin_memcpy): Use mode of dest_addr for
- intermediate computation.
-
-2003-05-23 Eric Christopher <echristo@redhat.com>
-
- * config/mips/mips.md (clzsi, clzdi): New patterns.
-
-2003-05-23 Geoffrey Keating <geoffk@apple.com>
-
- * gcc.c (default_compilers): Use -o to specify preprocessor's output
- file. Make -no-integrated-cpp work when building PCH files.
- * objc/lang-specs.h: Likewise.
-
-2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * fixinc/Makefile.in: Correct description.
- * fixinc/Makefile.in, fixinc/fixfixes.c, fixinc/fixincl.c,
- fixinc/fixlib.c, fixinc/fixlib.h, fixinc/fixtests.c,
- fixinc/genfixes: Replace "GNU CC" with "GCC".
-
-2003-05-23 Roger Sayle <roger@eyesopen.com>
-
- * builtins.def: Define atan, atanf, atanl, tan, tanf and tanl
- builtin functions (and their __builtin_* variants).
- * builtins.c (mathfn_built_in): Handle tan{,f,l} and atan{,f,l}.
- (expand_builtin): Don't expand tan{,f,l} or atan{,f,l} when not
- optimizing.
-
- * doc/extend.texi: Document new tan and atan builtins, and
- their float and long double variants.
-
-2003-05-23 Jason Thorpe <thorpej@wasabisystems.com>
-
- * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define
- __sparcv9 in the TARGET_ARCH64 case.
-
-Fri May 23 22:17:32 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_reorg): Calls are also jumps.
-
-2003-05-23 J"orn Rennecke <joern.rennecke@superh.com>
-
- * cse.c (count_reg_usage): When processing an INSNs REG_EQUAL
- note containing an EXPR_LIST, process all the arguments.
-
-Fri May 23 21:19:31 CEST 2003 Jan Hubicka <jh@suse.cz>
- Andreas Jaeger <aj@suse.de>
-
- * i386.h (TARGET_CPU_CPP_BUILTINS): Define __amd64 and __amd64__;
- do not use assertion.
-
-2003-05-23 Mike Stump <mrs@apple.com>
-
- * tlink.c (scan_linker_output): Add support for darwin linker, as it
- emits unresolved symbols one per line, consuming the entire line.
-
-2003-05-23 Larin Hennessy <larin@science.oregonstate.edu>
- Zack Weinberg <zack@codesourcery.com>
-
- * explow.c (allocate_dynamic_stack_space): Remove call to gen_probe.
- * config/m68k/m68k.c (m68k_output_function_prologue):
- Remove code under #if NEED_PROBE.
- * config/m68k/m68k.h: Don't define NEED_PROBE.
- * config/m68k/m68k.md: Remove "probe" insn.
- * doc/md.texi: Remove documentation of "probe" pattern.
-
-2003-05-23 Dorit Naishlos <gcchaifa@il.ibm.com>
-
- * config/rs6000/rs6000.md (save_fpregs_{si,di}): Add branch attribute.
-
-2003-05-23 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/install.texi: Remove sparc64-*-*. Add sparc64-*-solaris2*.
- Document sparcv9-*-solaris2* as a synonym for sparc64-*-solaris2*.
-
-2003-05-22 Roger Sayle <roger@eyesopen.com>
-
- * real.c (real_maxval): New function to return the largest finite
- value representable in a given mode (i.e. FLT_MAX and DBL_MAX).
- * real.h (real_maxval): Prototype here.
- * fold-const.c (fold_inf_compare): Transform comparisons against
- +-Infinity into comparisons against DBL_MAX (or equivalent).
-
-2003-05-22 Mike Stump <mrs@apple.com>
-
- * config.gcc (*-*-darwin*): Remove use_collect2=no, as it is the
- default.
-
-2003-05-22 DJ Delorie <dj@redhat.com>
-
- * calls.c (expand_call): If the arg block is going to grow
- downward, we need argblock to point to the top of the block,
- not the bottom.
-
-2003-05-22 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-decl.c (duplicate_decls): Test DECL for ERROR_MARK.
-
- * expr.c (expand_expr, case CONSTRUCTOR): Put into memory if
- constant and EXPAND_CONST_ADDRESS, not just EXPAND_INITIALIZER.
-
-2003-05-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * m68hc11.c: Don't use the `0' flag for asm_fprintf specifiers.
- * m68k.c: Likewise.
- * m68k.h: Likewise.
-
-2003-05-22 Zack Weinberg <zack@codesourcery.com>
-
- PR other/2873
- * fixinc/inclhack.def (avoid_wchar_t_type): Add bypass
- expressions to prevent triggering on recent curses.h,
- linux/nls.h, or X11/Xlib.h.
- (stdio_va_list): Add _G_va_list to bypass pattern.
- (strict_ansi_not): Add bypass pattern for __SCO_VERSION__.
- * fixinc/fixincl.x: Regenerate.
-
-2003-05-22 Rekha Bhintade <rekhad@kpitcummins.com>
-
- * gcc/config/sh/sh.h (TARGET_SWITCHES): Display all the target
- switches when --target-help option is specified.
-
-2003-05-22 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR bootstrap/10805
- * doc/install.texi (sparc-sun-solaris2.7): Document bootstrap
- failure with Sun assembler 5.0 Alpha 03/27/98.
-
-2003-05-21 Loren James Rittle <ljrittle@acm.org>
-
- * config/sparc/freebsd.h (CPP_CPU64_DEFAULT_SPEC): Add -D__sparcv9
- to match system compiler convention.
-
-2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * gthr-win32.h (__GTHREAD_HIDE_WIN32API): Test for nonzero
- value, not just if defined.
- Update copyright year.
-
-2003-05-21 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR target/6428
- * pa-hpux10.h (LINK_SPEC, LIB_SPEC): Move -L options for profiling
- directories from LIB_SPEC to LINK_SPEC. Emit warning if `-p' or `-pg'
- option is used without `-static'.
- * pa-hpux11.h (LINK_SPEC, LIB_SPEC): Likewise.
- * pa64-hpux.h (LINK_SPEC, LIB_SPEC): Likewise.
-
-2003-05-21 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.h (MASK_SERIALIZE_VOLATILE,
- TARGET_SERIALIZE_VOLATILE): Delete.
- (MASK_CONST16, MASK_ABS, MASK_ADDX): Renumber flag bits.
- (TARGET_DEFAULT): Remove MASK_SERIALIZE_VOLATILE.
- (TARGET_SWITCHES): Remove "-mserialize-volatile" and
- "-mno-serialize-volatile".
- * config/xtensa/xtensa.c (print_operand): Remove checks of
- TARGET_SERIALIZE_VOLATILE.
- * config/xtensa/xtensa.md (*lsiu, *ssiu): Likewise.
- * doc/invoke.texi (Option Summary, Xtensa Options): Remove
- "-mserialize-volatile" and "-mno-serialize-volatile" options.
-
-2003-05-21 Nathan Sidwell <nathan@codesourcery.com>
-
- * c-parse.in (fndef): Set DECL_SOURCE_LINE and FILE earlier.
- (nested_function): Likewise.
- (notype_nested_function): Likewise.
-
-2003-05-21 Nick Clifton <nickc@redhat.com>
-
- * config/stormy16/stormy-abi: Update overflow type for
- R_XSTORMY16_16 reloc.
-
-2003-05-21 Nathan Sidwell <nathan@codesourcery.com>
-
- * c-common.h (enum rid): Remove RID_BOUNDED, RID_UNBOUNDED.
- * c-parse.in (reswords): Remove __bounded__ and __unbounded__.
- (rid_to_yy): Remove RID_BOUNDED, RID_UNBOUNDED slots.
- * print-tree.c (print_node): Remove ambient-boundedness.
- * tree.h (tree_common): Remove bounded_flag.
- (BOUNDED_INDIRECT_YPE_P, BOUNDED_POINTER_TYPE_P,
- BOUNDED_REFERENCE_TYPE_P, MAYBE_BOUNDED_INDIRECT_TYPE_P,
- MAYBE_BOUNDED_POINTER_TYPE_P, MAYBE_BOUNDED_REFERENCE_TYPE_P,
- TREE_BOUNDED, TYPE_MAIN_VARIANTS_PHYSICALLY_EQUAL_P,
- TYPE_MAIN_PHYSICAL_VARIANT, TYPE_BOUNDED, TYPE_QUAL_BOUNDED):
- Remove.
- (TYPE_QUALS): Remove BOUNDED.
- (TREE_EXPR_QUALS, TREE_FUNC_QUALS): Remove.
- (TYPE_BOUNDED_VALUE, TYPE_BOUNDED_BASE, TYPE_BOUNDED_EXTENT,
- TYPE_BOUNDED_SUBTYPE, TYPE_UNBOUNDED_VARIANT, TYPE_POINTER_DEPTH,
- TYPE_AMBIENT_BOUNDEDNESS, MAX_POINTER_DEPT,
- VA_LIST_POINTER_DEPTH): Remove.
- (struct tree_type): Remove pointer_depth.
-
-2003-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-pretty-print.c (pp_c_integer_literal): Use
- HOST_WIDE_INT_PRINT_DOUBLE_HEX.
-
-2003-05-20 Roger Sayle <roger@eyesopen.com>
- Kazu Hirata <kazu@cs.umass.edu>
- Joern Rennecke <joern.rennecke@superh.com>
-
- * gcse.c (cprop_jump): Make use of REG_EQUAL notes on both
- setcc and jump, if they exist. If substituted instruction
- fails to validate, store current effort in a REG_EQUAL note.
- (cprop_insn): Don't attempt further substitutions if the
- current instruction has been deleted.
- (local_cprop_pass): Likewise.
-
- * jump.c (redirect_jump): Also update REG_EQUAL note, if
- one is attached to the jump instruction.
- (invert_jump): Delete REG_EQUAL note on jump, if one exists.
-
-2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- PR c++/9738
- * config/i386/winnt.c (i386_pe_encode_section_info): Enable
- even if not first.
-
-2003-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * genautomata.c (output_description, output_automaton_units,
- output_state_arcs): Add missing specifiers.
-
-2003-05-20 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/lib1funcs.asm: Avoid use of .Lfe* in .size directives.
- (do_abs, do_addx2, do_addx4, do_addx8): New assembler macros.
- (__mulsi3): Use do_addx* instead of ADDX* instructions. Formatting.
- (nsau): Rename to do_nsau. Provide alternate version for use when
- the NSAU instruction is available.
- (__udivsi3, __divsi3, __umodsi3, __modsi3): Use do_nsau macro.
- (__divsi3, __modsi3): Use do_abs macro instead of ABS instruction.
- * config/xtensa/xtensa-config.h: Update comments to match binutils.
- (XCHAL_HAVE_ABS, XCHAL_HAVE_ADDX): Define.
- * config/xtensa/xtensa.h (MASK_ABS, MASK_ADDX): Define.
- (TARGET_ABS, TARGET_ADDX): Define.
- (TARGET_DEFAULT): Conditionally add MASK_ABS and MASK_ADDX.
- (TARGET_SWITCHES): Add "abs", "no-abs", "addx", and "no-addx".
- * config/xtensa/xtensa.md (*addx2, *addx4, *addx8, *subx2, *subx4,
- *subx8): Set predicate condition to TARGET_ADDX.
- (abssi2): Set predicate condition to TARGET_ABS.
- * doc/invoke.texi (Option Summary): Document new "-mabs", "-mno-abs",
- "-maddx", and "-mno-addx" options.
- (Xtensa Options): Likewise. Also tag some opcode names with @code.
-
-2003-05-20 Kevin Ryde <user42@zip.com.au>
- Wolfgang Bangerth <bangerth@dealii.org>
-
- PR/10355
- * doc/extend.texi: Put a warning into the documentation
- of attribute regparm.
-
-2003-05-20 Jason Merrill <jason@redhat.com>
-
- * tree.c (expr_last): New fn.
- * tree.h: Declare it.
- * objc/objc-act (expr_last): Rename to objc_expr_last.
-
-2003-05-20 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (sh_register_move_cost): Add clase for moving between
- FP registers and MAC registers.
-
-2003-05-19 John David Anglin <dave.anglin@nrc-gnrc.gc.ca>
-
- * pa/milli64.S ($$mulI): Fix typo.
-
-2003-05-19 Matt Kraai <kraai@alumni.cmu.edu>
-
- * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p)
- (nonlocal_set_p): Remove initial blank line.
- * dwarf2out.c (simple_type_size_in_bits): Likewise.
- * et-forest.c (et_forest_create): Likewise.
- * explow.c (stabilize): Likewise.
- * fix-header.c (write_lbrac): Likewise.
- * graph.c (start_fct, node_data): Likewise.
- * jump.c (only_sets_cc0_p, sets_cc0_p): Likewise.
- * rtlanal.c (global_reg_mentioned_p): Likewise.
- * tree.c (bit_position): Likewise.
-
-2003-05-19 Alexandre Oliva <aoliva@redhat.com>
-
- * config/mips/linux64.h (LIB_SPEC): Add missing -lc and correct
- -lthread to -lpthread.
-
-2003-05-19 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (c_common_decode_option): Don't accept dollars
- as identifier characters in assembly.
- * doc/cpp.texi: Document this.
-
-2003-05-19 Seth Arnold <sarnold@wirex.com>
- Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_stack_info): Do not add
- vrsave_size twice.
-
-2003-05-19 Aldy Hernandez <aldyh@redhat.com>
-
- * doc/tm.texi (function_arg): Fix typo.
-
-2003-05-19 Matt Austern <austern@apple.com>
-
- * c-opts.c (COMMAND_LINE_OPTIONS): Add -Winvalid-offsetof option.
- * c-common.h (warn_invalid_offsetof): Declare.
- * c-common.c (warn_invalid_offsetof): Define.
- * doc/invoke.texi: Document -Winvalid-offsetof.
- * testsuite/g++.dg/other/offsetof3.C: New.
- * testsuite/g++.dg/other/offsetof4.C: New.
-
-2003-05-19 Kevin B. Hendricks <kevin.hendricks@sympatico.ca>
- David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (rs6000_alignment_string,
- rs6000_alignment_flags): New variables.
- (rs6000_parse_alignment_option): New function.
- (rs6000_override_options): Call it.
- * config/rs6000/rs6000.h (TARGET_OPTIONS): Add -malign-XXX option.
- (MASK_ALIGN_POWER, MASK_ALIGN_NATURAL, TARGET_ALIGN_NATURAL): New
- macros.
- * config/rs6000/aix.h (ADJUST_FIELD_ALIGN): Always use COMPUTED
- natural alignment if TARGET_NATURAL_ALIGNMENT
- (ROUND_TYPE_ALIGN): Always use default record alignment if
- TAGET_NATURAL_ALIGNMENT.
- * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Same
- (ROUND_TYPE_ALIGN): Same.
- * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Same
- (ROUND_TYPE_ALIGN): Same.
- * doc/invoke.texi (Option Summary, PowerPC Options): Document
- new options.
-
-2003-05-19 J"orn Rennecke <joern.rennecke@superh.com>
-
- * c-decl.c (finish_decl): When setting the DECL_ASSEMBLER_NAME
- of a function using ASMSPEC, prepend a star.
-
-2003-05-19 Jason Merrill <jason@redhat.com>
-
- * tree-inline.c (copy_body_r): Avoid generating &* during inline
- substitution.
-
-2003-05-19 Andrew Macleod <amacleod@redhat.com>
-
- * config/stormy16/stormy16.c (xstormy16_expand_prologue): Do
- not mark assignments to the hard frame pointer as being stack
- frame related.
- (xstormy16_expand_epilogue): Mark adjustments to the stack
- pointer as being stack frame related.
-
-2003-05-19 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (ISA_HAS_LOAD_DELAY, ISA_HAS_XFER_DELAY,
- ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): New macros.
- (PREDICATE_CODES): Add hilo_operand.
- * config/mips/mips.c (hilo_operand): New predicate.
- (mips_adjust_insn_length): Account for the number nops that might
- be needed to avoid hardware hazards.
- * config/mips/mips.md (dslot): Remove attribute.
- (hazard): New attribute.
- (can_delay): Use it. Check for calls, branches & jumps.
- (muldi3): Use the standard dmult pattern for mips16 code.
- (muldi3_internal, muldi3_internal2): Adjust conditions accordingly.
-
-2003-05-19 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (final_prescan_insn,
- mips_count_memory_refs, mips_fill_delay_slot): Remove.
- * config/mips/mips.h (delay_type, dslots_load_total,
- dslots_load_filled, dslots_jump_total, dslots_jump_filled,
- dslots_number_nops, num_refs, mips_load_reg, mips_load_reg2,
- mips_load_reg3, mips_load_reg4): Remove.
- (MASK_STATS): Remove.
- (MASK_EXPLICIT_RELOCS): Reuse its value.
- (TARGET_STATS): Remove.
- (TARGET_SWITCHES): Turn -mstats and -mno-stats into no-ops.
- Warn that -mstats is now ignored.
- (FINAL_PRESCAN_INSN): Undefine.
- (DBR_OUTPUT_SEQEND): Remove handling of dslot statistics.
- (ASM_OUTPUT_REG_POP): Likewise.
- * config/mips/mips.c (dslots_load_total, dslots_load_filled,
- dslots_jump_total, dslots_jump_filled, dslots_number_nops, num_refs,
- mips_load_reg, mips_load_reg2, mips_load_reg3, mips_load_reg4,
- mips_fill_delay_slot, mips_count_memory_refs,
- final_prescan_insn): Remove.
- (output_block_move): Remove calls to mips_count_memory_refs.
- (print_operand): Remove printing of #nop for TARGET_STATS.
- (mips_output_function_epilogue): Remove TARGET_STATS code.
- Reorganize setting of fnnmae.
- * config/mips/mips.md: Remove handling of dslot statistics
- throughout file. Change all fcmp patterns into normal asm
- templates, removing calls to mips_fill_delay_slot.
- * doc/invoke.texi: Remove documentation of -mstats.
-
-2003-05-19 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips_class_max_nregs): Return the number of
- words in the mode.
-
-2003-05-19 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (override_options): Disable explicit
- relocs for old ABIs unless using gas.
-
-2003-05-18 Eric Christopher <echristo@redhat.com>
-
- * config/mips/mips.h: Remove definition of g_switch_value.
-
-2003-05-18 Matt Kraai <kraai@alumni.cmu.edu>
-
- * flags.h (g_switch_value): Change to an unsigned
- HOST_WIDE_INT.
- * toplev.c (g_switch_value): Likewise.
-
- * config/alpha/alpha.c (small_symbolic_operand): Remove
- g_switch_value cast.
- (alpha_in_small_data_p): Cast size to an unsigned
- HOST_WIDE_INT.
-
- * config/frv/frv.c (frv_in_small_data_p): Cast size to an
- unsigned HOST_WIDE_INT.
- * config/frv/frv.h (g_switch_value, g_switch_set): Remove.
- (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Declare g_switch_set.
-
- * config/m32r/m32r.c (m32r_in_small_data_p): Cast size to an
- unsigned HOST_WIDE_INT.
- (m32r_asm_file_start): Use HOST_WIDE_INT_PRINT_UNSIGNED.
- * config/m32r/m32r.h (g_switch_value, g_switch_set): Remove.
- (ASM_OUTPUT_ALIGNED_COMMON): Declare g_switch_value.
-
- * config/rs6000/rs6000.c (rs6000_file_start): Use
- HOST_WIDE_INT_PRINT_UNSIGNED.
- (small_data_operand): Cast summand to unsigned HOST_WIDE_INT.
- (rs6000_elf_in_small_data_p): Cast size to unsigned
- HOST_WIDE_INT.
- * config/rs6000/sysv4.h (g_switch_value, g_switch_set):
- Remove.
- (SUBTARGET_OVERRIDE_OPTIONS): Declare g_switch_value and
- g_switch_set.
- (ASM_OUTPUT_ALIGNED_LOCAL): Declare g_switch_value and remove
- g_switch_value cast.
-
-2003-05-18 Roger Sayle <roger@eyesopen.com>
- Zack Weinberg <zack@codesourcery.com>
-
- PR middle-end/10472
- * builtins.c (expand_builtin_memcpy): Call force_operand on
- expressions and use simplify_gen_binary to create the addition.
-
-2003-05-18 Andreas Schwab <schwab@suse.de>
-
- * config/m68k/m68k.md: Use define_constants for unspec numbers.
-
-2003-05-18 Neil Booth <neil@daikokuya.co.uk>
-
- * config/sparc/sparc.h: Define sparc for now.
-
-2003-05-18 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config.gcc: Clear xm_file, md_file at the beginning of each pass.
-
- * config/stormy16/stormy16.h: Remove about 3000 lines of
- target-independent comments. Update copyright notice.
-
- * doc/collect2.texi: GNU CC -> GCC.
- * doc/headerdirs.texi: GNU CC -> GCC.
-
-2003-05-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * hashtable.h (struct ht_identifier): Add data member "hash_value".
- * hashtable.c (ht_lookup): Use it when searching, remember.
- (ht_expand): Do not recompute.
- * tree.h (IDENTIFIER_HASH_VALUE): New macro.
-
-2003-05-18 Nathan Sidwell <nathan@codesourcery.com>
-
- * gcov-io.c (gcov_read_bytes): Fix fread thinko.
-
-2003-05-18 Neil Booth <neil@daikokuya.co.uk>
-
- * c-cppbuiltin.c (TARGET_OS_CPP_BUILTINS, TARGET_OBJFMT_CPP_BUILTINS):
- Default here.
- (c_cpp_builtins): Invoke TARGET_OBJFMT_CPP_BUILTINS().
- * defaults.h: Don't default TARGET_OS_CPP_BUILTINS here.
- * config/elfos.h (TARGET_OBJFMT_CPP_BUILTINS): Define __ELF__.
- * config/freebsd-spec.h, config/netbsd-elf.h, config/alpha/gnu.h,
- config/arm/linux-elf.h, config/arm/rtems-elf.h,
- config/arm/unknown-elf.h, config/cris/cris.h, config/cris/linux.h,
- config/h8300/elf.h, config/i370/linux.h, config/i386/beos-elf.h,
- config/i386/gnu.h, config/i386/linux.h, config/i386/linux64.h,
- config/i386/moss.h, config/i386/rtemself.h, config/ia64/ia64.h,
- config/m68k/rtemself.h, config/mcore/mcore-elf.h, config/mips/linux.h,
- config/pa/pa-linux.h, config/rs6000/linux.h, config/rs6000/linux64.h,
- config/rs6000/sysv4.h, config/rs6000/vxworks.h, config/s390/linux.h,
- config/sh/coff.h, config/sh/elf.h, config/sh/rtemself.h,
- config/sh/sh.h, config/sparc/linux.h, config/sparc/linux64.h,
- config/sparc/openbsd64.h, config/sparc/sp64-elf.h,
- config/sparc/sp86x-elf.h, config/xtensa/elf.h, config/xtensa/linux.h:
- Don't define __ELF__.
- * config/alpha.h, config/m68k/linux.h (TARGET_OBJFMT_CPP_BUILTINS):
- Define __ELF__.
- * doc/cpp.texi: Document __ELF__.
- * doc/tm.texi: Document TARGET_OBJFMT_CPP_BUILTINS. *
-
-2003-05-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
- always use stdarg.
- * c-errors.c (pedwarn_c99): Likewise.
- * c-format.c (status_warning): Likewise.
- * c-semantics.c (build_stmt): Likewise.
- * calls.c (emit_library_call, emit_library_call_value): Likewise.
- * collect2.c (notice, fatal_perror, fatal, error): Likewise.
- * cpperror.c (cpp_error, cpp_error_with_line): Likewise.
- * diagnostic.c (build_message_string, output_printf,
- output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
- fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
- error_with_decl, fnotice): Likewise.
- * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
- dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
- dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
- dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
- dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
- dw2_asm_output_encoded_addr_rtx): Likewise.
- * emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
- * errors.c (warning, error, fatal, internal_error): Likewise.
- * final.c (output_operand_lossage, asm_fprintf): Likewise.
- * fix-header.c (fatal): Likewise.
- * gcc.c (fatal, error, notice): Likewise.
- * gcov.c (fnotice): Likewise.
- * genattrtab.c (attr_rtx, attr_printf): Likewise.
- * gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
- * gensupport.c (message_with_line): Likewise.
- * mips-tfile.c (fatal, error): Likewise.
- * protoize.c (notice): Likewise.
- * ra-debug.c (ra_debug_msg): Likewise.
- * read-rtl.c (fatal_with_file_and_line): Likewise.
- * rtl-error.c (error_for_asm, warning_for_asm): Likewise.
- * tree.c (build, build_nt, build_function_type_list): Likewise.
-
-2003-05-17 Neil Booth <neil@daikokuya.co.uk>
-
- * defaults.h (TARGET_CPU_CPP_BUILTINS, CPP_PREDEFINES): Remove.
- * gcc.c (cpp_predefines): Remove.
- (cpp_unique_options, do_spec_1): Remove handling of CPP_PREDEFINES.
- (static_specs): Remove predefines.
- * system.h: Poison CPP_PREDEFINES.
- * config/freebsd.h, config/openbsd.h, config/ptx4.h, config/svr3.h,
- config/svr4.h, doc/tm.texi: Remove references to CPP_PREDEFINES.
-
-2003-05-17 Neil Booth <neil@daikokuya.co.uk>
-
- * config/m68k/hp320.h, config/m68k/linux.h, config/m68k/m68k-none.h,
- config/m68k/m68k.h, config/m68k/m68kemb.h, config/m68k/m68kv4.h,
- config/m68k/openbsd.h, config/m68k/rtemself.h: Remove CPP_PREDEFINES,
- use TARGET_OS_CPP_BUILTINS and TARGET_CPU_CPP_BUILTINS instead.
-
-2003-05-17 Neil Booth <neil@daikokuya.co.uk>
-
- PR c/9209
- * c-common.c, c-common.h (dollars_in_ident): Remove.
- * c-opts.c (DOLLARS_IN_IDENTIFIERS): Default to true.
- (c_common_init_options, c_common_decode_option): Set dollars_in_ident.
- * cpphash.h (warned_dollar): Rename warn_dollars.
- * cppinit.c (struct lang_flags, lang_defaults, cpp_set_lang)
- Permit dollars regardless of -std=.
- (post_options): Set warn_dollars.
- * cpplex.c (forms_identifier_p): Use warn_dollars.
- * config/darwin.h, config/alpha/vms.h, config/m68hc11/m68hc11.h:
- Remove redundant definitions of DOLLARS_IN_IDENTIFIERS.
- * doc/cpp.texi, doc/cppopts.texi, doc/invoke.texi, doc/tm.texi:
- Update documentation.
-
-2003-05-17 Andreas Schwab <schwab@suse.de>
-
- * config/m68k/m68k.c (m68k_output_function_prologue): Use
- HOST_WIDE_INT_PRINT_DEC for fprintf and %wd for asm_fprintf when
- formatting a HOST_WIDE_INT.
- (m68k_output_function_epilogue): Likewise.
-
-2003-05-17 Zack Weinberg <zack@codesourcery.com>
-
- * doc/install.texi: Remove information about desupported targets.
-
-2003-05-17 Andreas Schwab <schwab@suse.de>
-
- * config/m68k/coff.h: Remove support for Sun FPA and Sun SKY board.
- * config/m68k/linux.h: Likewise.
- * config/m68k/m68k-none.h: Likewise.
- * config/m68k/netbsd-elf.h: Likewise.
- * config/m68k/sgs.h: Likewise.
- * config/m68k/m68k.h: Likewise.
- * config/m68k/m68k.md: Likewise.
- * config/m68k/m68k.c: Likewise.
- * doc/md.texi (Machine Constraints): Remove Sun FPA specific
- constraints.
- * doc/invoke.texi (Option Summary): Remove -mfpa.
- (M680x0 Options): Likewise.
-
-2003-05-17 David Edelsohn <edelsohn@gnu.org>
-
- * rs6000.c (rs6000_function_value): Simplify REAL_TYPE logic.
-
-2003-05-17 Neil Booth <neil@daikokuya.co.uk>
-
- * config/sol2.h: Add TARGET_SUB_OS_CPP_BUILTINS.
- * config/sparc/liteelf.h, config/sparc/openbsd64.h,
- config/sparc/rtemself.h, config/sparc/sol2-64.h,
- config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h:
- Update for use of TARGET_SUB_OS_CPP_BUILTINS.
-
-2003-05-17 Neil Booth <neil@daikokuya.co.uk>
-
- * i960/i960.h, i960/rtems.h: Use TARGET_OS_CPP_BUILTINS and
- TARGET_CPU_CPP_BUILTINS in preference to CPP_PREDEFINES.
-
-2003-05-17 Neil Booth <neil@daikokuya.co.uk>
-
- * config.gcc (sparc-*-sysv4*): Add sparc/sysv4-only.h.
- * sparc/aout.h, sparc/elf.h, sparc/freebsd.h, sparc/linux.h,
- sparc/linux64.h, sparc/lite.h, sparc/litecoff.h, sparc/liteelf.h,
- sparc/netbsd-elf.h, sparc/openbsd.h, sparc/openbsd64.h,
- sparc/pbd.h, sparc/rtemself.h, sparc/sol2-64.h, sparc/sol2-bi.h,
- sparc/sol2.h, sparc/sp64-elf.h, sparc/sp86-elf.h, sparc/sparc.h,
- sparc/sysv4.h,
- * sparc/sysv4-only.h: New.
-
-2003-05-17 Alan Modra <amodra@bigpond.net.au>
-
- * function.c (assign_parms): Check for zero size args.
-
-2003-05-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * cfgloopanal.c (test_for_iteration): Use string concatentation on
- HOST_WIDE_INT_PRINT_* format specifier to collapse multiple
- function calls into one.
- * dbxout.c (dbxout_symbol): Likewise.
- * defaults.h (ASM_OUTPUT_SIZE_DIRECTIVE): Likewise.
- * dwarf2asm.c (dw2_asm_output_data_uleb128,
- dw2_asm_output_data_sleb128): Likewise.
- * genrecog.c (debug_decision_2): Likewise.
- * loop.c (emit_prefetch_instructions): Likewise.
- * print-rtl.c (print_rtx): Likewise.
- * print-tree.c (print_node_brief, print_node): Likewise.
- * ra-debug.c (dump_igraph, dump_graph_cost,
- dump_static_insn_cost): Likewise.
- * ra-rewrite.c (dump_cost): Likewise.
- * sdbout.c (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise.
- * sreal.c (dump_sreal): Likewise.
- * unroll.c (unroll_loop, precondition_loop_p): Likewise.
- * varasm.c (assemble_vtable_entry): Likewise.
-
- * avr.c (avr_output_function_prologue,
- avr_output_function_epilogue, print_operand): Fix format specifier
- warnings.
- (init_cumulative_args): Mark parameter with ATTRIBUTE_UNUSED.
- * avr.h (FUNCTION_VALUE_REGNO_P): Fix signed/unsigned warnings.
-
-2003-05-16 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/rs6000.c (expand_block_move): Unify the TARGET_STRING
- and ! TARGET_STRING cases.
-
- * doc/cppopts.texi (-undef): Fix texinfo warning.
-
- * doc/cppopts.texi (-H): Document that -H works for PCH files too.
- * cppfiles.c (validate_pch): When -H is used, print some information
- about PCH files found.
-
-2003-05-16 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * config/mips/t-elf: Remove obsolete rules adding dependencies on tm.h.
- * config/mips/t-isa3264, config/mips/t-r3900: Likewise.
- * config/mips/t-sr71k: Likewise.
-
-2003-05-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * arc.c (arc_output_function_prologue,
- arc_output_function_epilogue): Fix format specifier warnings.
- * arc.h (LARGE_INT): Fix signed/unsigned warnings.
-
- * v850.c (print_operand): Fix format specifier warnings.
-
- * ns32k.c (ADJSP, ns32k_output_function_prologue): Fix format
- specifier warnings.
-
- * mcore.c (mcore_print_operand_address, mcore_print_operand): Fix
- format specifier warnings.
-
- * ip2k.c (function_prologue, function_epilogue, print_operand):
- Fix format specifier warnings.
- * ip2k.md: Likewise.
-
- * i960.c (i960_output_function_prologue, i960_print_operand,
- i960_print_operand_addr): Fix format specifier warnings.
-
- * i370.c (ascebc, ebcasc): Wrap in macros controlling usage.
- (i370_output_function_prologue): Fix format specifier warnings.
- * i370.h (PRINT_OPERAND): Likewise.
-
- * fr30.c (fr30_print_operand): Fix format specifier warnings.
-
- * dsp16xx.c (print_operand_address): Fix format specifier warning.
- * dsp16xx.h (INCLUDE_DEFAULTS): Add missing initializers.
-
- * c4x.c (c4x_print_operand, c4x_print_operand_address): Fix format
- specifier warnings.
-
- * alpha.c (print_operand_address, alpha_start_function,
- unicosmk_output_ssib): Use string concatentation on
- HOST_WIDE_INT_PRINT_* format specifier to collapse multiple
- function calls into one.
- * arm.c (arm_print_operand): Likewise.
- * cris.c (cris_asm_output_mi_thunk): Likewise.
- * frv.c (frv_asm_output_mi_thunk): Likewise.
- * ia64.c (ia64_print_operand, process_set): Likewise.
- * m68k.c (m68k_output_function_epilogue, m68k_output_mi_thunk):
- Likewise.
- * mips/iris5gas.h (PUT_SDB_SIZE): Likewise.
- * mips.h (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise.
- * pa.c (output_div_insn, pa_asm_output_mi_thunk): Likewise.
- * pa.h (PRINT_OPERAND_ADDRESS): Likewise.
- * rs6000.c (rs6000_va_start, print_operand_address): Likewise.
- * s390.c (s390_assemble_integer): Likewise.
- * sparc.c (sparc_flat_function_prologue,
- sparc_flat_function_epilogue): Likewise.
- * stormy16.c (xstormy16_print_operand_address, xstormy16_print_operand): Likewise.
- * vax.c (vax_output_mi_thunk): Likewise.
-
- * frv.c (frv_print_operand_memory_reference): Fix format specifier
- warning.
- (frv_rtx_costs): Mark parameter with ATTRIBUTE_UNUSED.
-
- * m68k.c (m68k_output_function_epilogue): Fix format specifier
- warnings.
-
- * stormy16-protos.h (xs_hi_general_operand,
- xs_hi_nonmemory_operand): Prototype.
- * stormy16.c (xstormy16_output_shift): Fix format specifier
- warnings.
-
- * cris.c: Fix format specifier warnings.
-
-2003-05-16 Nick Clifton <nickc@redhat.com>
-
- * config/arm/lib1funcs.asm: Fix typo: LSM instead of LSYM.
-
-2003-05-16 Wolfgang Bangerth <bangerth@dealii.org>
-
- * doc/bugreport.texi: Remove most of the of the preface of the
- bugs section.
-
-2003-05-16 Jakub Jelinek <jakub@redhat.com>
-
- * config/ia64/unwind-ia64.c (uw_update_reg_address): Handle
- .save XX, r0.
-
-2003-05-15 Roger Sayle <roger@eyesopen.com>
-
- * config/alpha/alpha.h (ASM_OUTPUT_SKIP): Fix typo.
-
-2003-05-15 Eric Christopher <echristo@redhat.com>
-
- * cfgcleanup.c (merge_blocks): Fix return value.
-
-2003-05-15 Eric Christopher <echristo@redhat.com>
-
- * combine.c (expand_compound_operation): Make sure
- that zero_extend operation is profitable.
-
-2003-05-15 Richard Henderson <rth@redhat.com>
-
- * config/alpha/linux.h, config/alpha/linux-elf.h: Remove
- code protected by USE_GNULIBC_1.
-
-2003-05-15 Zack Weinberg <zack@codesourcery.com>
-
- * config.gcc: Purge all targets obsoleted in GCC 3.3. Also
- remove hppa*-*-mpeix* which could not be built, and prune
- files from tmake_file= or tm_file= lists that don't exist.
-
- * config/alpha/alpha-interix.h, config/alpha/alpha32.h
- * config/alpha/t-interix, config/arm/conix-elf.h
- * config/arm/t-arm-aout, config/arm/t-strongarm-coff
- * config/arm/unknown-elf-oabi.h, config/i386/win32.h
- * config/m68k/3b1.h, config/m68k/3b1g.h, config/m68k/amix.h
- * config/m68k/atari.h, config/m68k/ccur-GAS.h, config/m68k/crds.h
- * config/m68k/hp2bsd.h, config/m68k/hp3bsd.h
- * config/m68k/hp3bsd44.h, config/m68k/linux-aout.h
- * config/m68k/m68k-psos.h, config/m68k/mot3300.h
- * config/m68k/pbb.h, config/m68k/plexus.h, config/m68k/sun2.h
- * config/m68k/sun2o4.h, config/m68k/sun3.h, config/m68k/sun3mach.h
- * config/m68k/sun3n.h, config/m68k/sun3n3.h, config/m68k/sun3o3.h
- * config/m68k/t-mot3300, config/m68k/t-mot3300-gald
- * config/m68k/t-mot3300-gas, config/m68k/t-mot3300-gld
- * config/m68k/tower-as.h, config/m68k/tower.h
- * config/m88k/aout-dbx.h, config/m88k/m88k-aout.h
- * config/m88k/m88k-modes.def, config/m88k/m88k-move.sh
- * config/m88k/m88k-protos.h, config/m88k/m88k.c
- * config/m88k/m88k.h, config/m88k/m88k.md, config/m88k/openbsd.h
- * config/m88k/sysv4.h, config/m88k/t-luna, config/m88k/t-luna-gas
- * config/m88k/t-m88k, config/m88k/t-sysv4, config/mcore/gfloat.h
- * config/mips/rtems64.h, config/mips/sni-gas.h
- * config/mips/sni-svr4.h, config/mips/t-ecoff
- * config/mn10200/lib1funcs.asm, config/mn10200/mn10200-protos.h
- * config/mn10200/mn10200.c, config/mn10200/mn10200.h
- * config/mn10200/mn10200.md, config/mn10200/t-mn10200
- * config/pa/pa-hiux.h, config/pa/pa-hpux7.h, config/pa/pa-hpux9.h
- * config/pa/pa-oldas.h, config/pa/t-mpeix, config/psos.h
- * config/romp/romp-protos.h, config/romp/romp.c
- * config/romp/romp.h, config/romp/romp.md, config/rs6000/aix31.h
- * config/rs6000/aix3newas.h, config/rs6000/mach.h
- * config/sparc/bsd.h, config/sparc/hal.h
- * config/sparc/linux-aout.h, config/sparc/lynx-ng.h
- * config/sparc/lynx.h, config/sparc/netbsd.h
- * config/sparc/sp86x-aout.h, config/sparc/splet.h
- * config/sparc/sun4gas.h, config/sparc/sun4o3.h
- * config/sparc/sunos4.h, config/sparc/t-chorus-elf
- * config/sparc/t-halos, config/sparc/t-sparcbare
- * config/sparc/t-splet, config/sparc/t-sunos41
- * config/v850/rtems.h: Delete file.
-
-2003-05-15 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000-protos.h (function_value): Protoize.
-
- * config/rs6000/rs6000.h (FUNCTION_VALUE): Call function.
-
- * config/rs6000/rs6000.c (rs6000_function_value): New.
-
-2003-05-15 Philip Blundell <philb@gnu.org>
-
- * config/arm/arm.c (arm_is_xscale): Rename to arm_arch_xscale.
- All uses updated.
- (arm_tune_xscale): New variable.
- (arm_override_options): Set it.
- (arm_adjust_cost): Use it in place of arm_arch_xscale.
- (arm_gen_load_multiple): Likewise.
- (arm_gen_store_multiple): Likewise.
- * config/arm/arm.md (is_xscale): Likewise.
- * config/arm/arm.h (arm_tune_xscale): Declare.
-
-2003-05-15 Philip Blundell <philb@gnu.org>
-
- PR target/10730
- * config/arm/arm.c (adjacent_mem_locations): Reject offsets
- involving invalid constants.
-
-2003-05-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.c (hppa_expand_prologue): Remove blockage.
-
-2003-05-15 Wolfgang Bangerth <bangerth@dealii.org>
-
- * doc/bugreport.texi: Remove most of the bug reporting
- instructions and merge them into bugs.html.
-
-2003-05-14 Matt Kraai <kraai@alumni.cmu.edu>
-
- * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Cast
- g_switch_value to unsigned HOST_WIDE_INT.
-
-2003-05-14 Eric Christopher <echristo@redhat.com>
-
- * combine.c: Fix header comments.
- (distribute_notes): Remove usage of elim_i1, elim_i2. Propagate
- to all calls and prototype.
-
-2003-05-14 Roger Sayle <roger@eyesopen.com>
-
- PR optimization/10764
- * config/i386/i386.md (atan2df3, atan2sf3, atan2xf3, atan2tf3):
- Add an explicit clobber to show that UNSPEC_FPATAN clobbers st(1).
- (*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3): Likewise,
- add an explicit clobber to show that UNSPEC_FYL2X clobbers st(1).
- (logsf2, logdf2, logxf2, logtf2): Update expander patterns to match
- the corresponding *fyl2x_?fxf3 instructions.
-
-2003-05-14 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/lib2funcs.S (TRAMPOLINE_SIZE): Change from 49 to 59.
- * config/xtensa/xtensa-config.h (XCHAL_HAVE_CONST16,
- XCHAL_HAVE_L32R): New.
- * config/xtensa/xtensa-protos.h (non_const_move_operand,
- xtensa_load_constant, xtensa_function_prologue,
- xtensa_function_epilogue): Delete prototypes.
- (xtensa_expand_prologue): New.
- * config/xtensa/xtensa.c (frame_size_const,
- TARGET_ASM_FUNCTION_PROLOGUE, TARGET_MACHINE_DEPENDENT_REORG,
- non_const_move_operand, xtensa_load_constant, xtensa_reorg,
- xtensa_function_prologue): Delete.
- (add_operand, xtensa_mem_offset): Formatting.
- (move_operand): If the const16 option is available, allow any SFmode
- and SImode constants.
- (xtensa_emit_move_sequence): Inline the former contents of
- xtensa_load_constant with modifications to handle the const16 option.
- (override_options): Add xtensa_char_to_class['W'] and set it to
- the general register class only if the const16 option is enabled.
- Fix formatting. Disallow PIC when using the const16 option.
- (print_operand): Reorganize to switch on "letter" instead of the
- RTL code. Add output_operand_lossage calls for invalid cases.
- Add support for 't' and 'b' letters.
- (xtensa_expand_prologue): New function to replace
- xtensa_function_prologue and xtensa_reorg.
- (xtensa_function_epilogue): Declare this as static. Delete code
- to print the retw.n or retw instruction.
- (xtensa_return_addr): Use A0_REG instead of 0.
- (xtensa_rtx_costs): Add costs for using the const16 option.
- * config/xtensa/xtensa.h (MASK_CONST16, TARGET_CONST16): New.
- (TARGET_DEFAULT): Add CONST16 if L32R instructions not available.
- (TARGET_SWITCHES): Add "const16" and "no-const16".
- (REG_CLASS_FROM_LETTER): Add comment about new 'W' letter.
- (EXTRA_CONSTRAINT): Change 'T' constraint to only apply when not
- using the const16 option.
- (TRAMPOLINE_TEMPLATE): Rewrite to avoid hardwired use of l32r insn.
- (TRAMPOLINE_SIZE): Change from 49 to 59.
- (INITIALIZE_TRAMPOLINE): Adjust offsets to match new trampoline.
- (GO_IF_LEGITIMATE_ADDRESS): Do not allow constant pool addresses
- when using the const16 option.
- (PREDICATE_CODES): Delete non_const_move_operand.
- * config/xtensa/xtensa.md (define_constants): Add A1_REG, A8_REG, and
- UNSPECV_ENTRY.
- (movdi, movdf): If the source is a constant, always expand to a
- sequence of movsi insns.
- (movdi_internal, movdf_internal): Remove alternative using l32r insns.
- (movsi_internal, movsf_internal): Add alternative using const16 insns.
- (movsf): Add const16 support.
- (entry, prologue, epilogue): New.
- (set_frame_ptr): Add missing mode for unspec_volatile operation.
- Likewise for subsequent split pattern.
- * doc/invoke.texi (Option Summary, Xtensa Options): Document new
- "-mconst16" and "-mno-const16" options.
-
-2003-05-14 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (ia64_expand_load_address): Force destination
- to be DImode register. Merge load_symptr.
- * config/ia64/ia64.md (load_symptr): Remove.
-
-2003-05-14 Richard Henderson <rth@redhat.com>
-
- * rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): Rename from
- DEFERRED_CONSTANT_P.
- * integrate.c (copy_rtx_and_substitute): Update use.
- * varasm.c (build_constant_desc): Set SYMBOL_REF_DECL
- to the copy generated.
- (maybe_output_constant_def_contents): Examine TREE_ASM_WRITTEN
- of the constant to see if we should emit.
- (mark_constant): Similarly.
- (output_constant_def_contents): Set TREE_ASM_WRITTEN.
-
-2003-05-14 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.md (movsi_internal2): Use compare for self
- move record condition.
- (movdi_internal2): Same.
-
-2003-05-14 Nathan Sidwell <nathan@codesourcery.com>
-
- * gcov-io.h (gcov_write_bytes, gcov_read_bytes): Remove here.
- (GCOV_TAG_*) Force type to gcov_unsigned_t.
- (GCOV_CHECK, GCOV_CHECK_READING, GCOV_CHECK_WRITING): New.
- (struct gcov_var): Remove modified. Add start, length, offset,
- overread. Have buffer array for libgcov.
- (gcov_sync, gcov_seek): Definitions moved to gcov-io.c.
- (gcov_position, gcov_rewrite, gcov_is_eof): Adjust.
- * gcov-io.c (gcov_open): Set mode, do not read anything.
- (gcov_close): Write final block.
- (gcov_write_block, gcov_allocate): New.
- (gcov_write_bytes): Make static. Write or allocate buffer.
- (gcov_write_unsigned, gcov_write_counter): Buffer can never be
- null.
- (gcov_write_string): Adjust.
- (gcov_write_tag)
- (gcov_write_length): Adjust. Flush the block.
- (gcov_write_tag_length): Buffer can never be null.
- (gcov_read_bytes): Make static. Read in block.
- (gcov_sync): Moved here. Adjust.
- (gcov_seek): Moved here. Adjust.
- * coverage.c (read_counts_file): Adjust.
- * gcov-dump.c (print_prefix): Add position parameter.
- (flag_dump_positions): New flag.
- (options, main, print_usage): Add it.
- (dump_file, tag_blocks, tag_arcs, tag_lines, tag_counters,
- tag_summary): Adjust.
- * gcov.c (read_graph_file, read_count_file): Adjust.
- * libgcov.c (gcov_exit): Adjust.
-
- * Makefile.in (LIBGCC_DEPS): Use $(srcdir) on gcov files
- (libgcov.a): Depend on libgcc.a.
- (gcov.o, gcov-dump.o): Add gcov-io.c.
- * mklibgcc.in (libgcov_c_dep): Use $(srcdir).
-
- * loop.c (check_dbra_loop): Factor common test.
-
-2003-05-14 Ben Elliston <bje@wasabisystems.com>
-
- * doc/md.texi (Automaton pipeline description): Grammar fixes.
-
-2003-05-14 Richard Sandiford <rsandifo@redhat.com>
-
- * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (TARGET_INITIALIZER): Include it.
- * target.h (struct gcc_target): Add machine_dependent_reorg field.
- * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg.
- * system.h: Poison MACHINE_DEPENDENT_REORG.
-
- * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration.
- * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (alpha_handle_trap_shadows): Remove "first insn" parameter.
- (alpha_align_insns): Likewise.
- (alpha_reorg): Likewise. Make static. Update calls to above
- functions.
-
- * config/arm/arm-protos.h (arm_reorg): Remove declaration.
- * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (arm_reorg): Remove parameter. Make static.
-
- * config/avr/avr-protos.h (machine_dependent_reorg): Remove.
- * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (avr_reorg): Renamed from machine_dependent_reorg. Make static.
- Remove parameter.
-
- * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove.
- * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (c4x_reorg): Renamed from c4x_process_after_reload. Make static.
- Remove parameter.
-
- * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove.
- * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove.
-
- * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove.
- * config/frv/frv.c: Remove orphaned comment.
-
- * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove.
- * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static.
- Remove parameter.
-
- * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration.
- * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (emit_insn_group_barriers): Remove "first insn" parameter.
- (emit_all_insn_group_barriers): Likewise.
- (ia64_reorg): Likewise. Make static. Update calls to above functions.
- (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers.
-
- * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove.
- * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (ip2k_reorg): Renamed from machine_dependent_reorg. Make static.
- Remove parameter.
-
- * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration.
- * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (m68hc11_reorg): Make static. Remove parameter.
-
- * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove.
- * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (conditionalize_optimization): Remove parameter.
- (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter.
- Make static. Update call to conditionalize_optimization.
-
- * config/mips/mips-protos.h (machine_dependent_reorg): Remove.
- * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter.
- Make static.
-
- * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove.
- * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static.
- Remove parameter.
-
- * config/pa/pa-protos.h (pa_reorg): Remove declaration.
- * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (pa_combine_instructions): Remove "first insn" parameter.
- (remove_useless_addtr_insns): Likewise.
- (pa_reorg): Likewise. Make static. Update calls to above functions.
-
- * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove
- commented-out definition.
-
- * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove.
- * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static.
- Remove parameter.
-
- * config/sh/sh-protos.h (machine_dependent_reorg): Remove.
- * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (sh_reorg): Renamed from machine_dependent_reorg. Make static.
- Remove parameter.
- (sh_output_mi_thunk): Call sh_reorg directly.
- * config/sh/sh.md: Update comment.
-
- * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove
- commented-out definition.
-
- * config/v850/v850-protos.h (v850_reorg): Remove declaration.
- * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (v850_reorg): Make static. Remove parameter.
-
- * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration.
- * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove.
- * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
- (xtensa_reorg): Make static. Remove parameter.
-
- * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove.
- (TARGET_MACHINE_DEPENDENT_REORG): Document.
-
-2003-05-13 Richard Henderson <rth@redhat.com>
-
- * c-decl.c (duplicate_decls): Re-invoke make_decl_rtl if
- the old decl had instantiated DECL_RTL.
-
-2003-05-13 Mike Stump <mrs@apple.com>
-
- * doc/invoke.texi (Option Summary): Kill off documentation for -$.
-
-2003-05-13 Janis Johnson <janis187@us.ibm.com>
-
- * config/rs6000/sysv4.h (OUTPUT_ASM_ALIGNED_LOCAL): Expect
- HOST_WIDE_INT argument.
-
-2003-05-13 Jason Merrill <jason@redhat.com>
-
- * tree.h (STRIP_MAIN_TYPE_NOPS): New macro.
-
- * tree.c (iterative_hash_expr): New fn.
-
- * c-semantics.c (emit_local_var): Don't mess with temp slots if
- there's no initializer.
-
-2003-05-13 Richard Sandiford <rsandifo@redhat.com>
-
- * final.c (final_scan_insn): Apply the effects of frame-related
- delay slot insns before emitting a delayed branch.
-
-2003-05-13 Nick Clifton <nickc@redhat.com>
-
- * config/mcore/mcore.md (jump): Use emit_jump_insn.
-
-2003-05-13 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Second
- parameter of ASM_OUTPUT_SKIP must have type unsigned HOST_WIDE_INT.
-
-2003-05-12 DJ Delorie <dj@redhat.com>
-
- * expr.c (move_by_pieces): Honor the alignment of TO and FROM.
- (emit_push_insn): Don't use push when the source alignment is less
- than the stack's push rounding.
-
-2003-05-13 Zack Weinberg <zack@codesourcery.com>
-
- * diagnostic.c (output_format): Add support for %m.
- (output_printf, output_verbatim, diagnostic_set_info,
- verbatim): Set err_no field of the text_info structure being
- initialized.
- (fatal_io_error): Delete function.
- * diagnostic.h (text_info): Add err_no field.
- * toplev.h (fatal_io_error): Delete prototype.
-
- * c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
- * toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
- * objc/objc-act.c: Replace all calls to fatal_io_error with
- calls to fatal_error; add ": %m" to the end of all the affected
- error messages.
-
-2003-05-13 Zack Weinberg <zack@codesourcery.com>
-
- * varasm.c (notice_rtl_inlining_of_deferred_constant): New function.
- * rtl.h: Prototype it.
- * integrate.c (copy_rtx_and_substitute <SYMBOL_REF>): Call it
- when appropriate.
-
-2003-05-13 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.md ("*iordi3_oi"): Do not mark commutative.
- ("*iorsi3_oi"): Likewise.
-
-2003-05-13 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (compare_scc): Use shorter sequence for EQ case.
- (ior_scc_scc_cmp, and_scc_scc_cmp): New insn-and-split patterns.
- (and_scc_scc): Ensure split only applies when there is a dominance
- of the comparisons.
- (and_scc_scc_nodom): New insn-and-split pattern.
-
-2003-05-13 Richard Sandiford <rsandifo@redhat.com>
-
- * unwind-dw2.c (uw_init_context_1): Don't pass &outer_cfa directly
- to _Unwind_SetGRPtr().
-
-2003-05-13 Michael Eager <eager@mvista.com>
-
- * Makefile.in: Initialize program_transform_cross_name from
- @program_transform_name@ instead of target_alias.
-
-2003-05-12 Janis Johnson <janis187@us.ibm.com>
- Alan Modra <amodra@bigpond.net.au>
- Jakub Jelinek <jakub@redhat.com>
-
- * configure.in (HAVE_AS_TLS): Add powerpc and powerpc64 tests.
- * configure: Rebuild.
- * config/rs6000/rs6000-protos.h: Update.
- * config/rs6000/rs6000.c (rs6000_tls_size): New.
- (rs6000_tls_size_string): New.
- (rs6000_parse_tls_size_option): New.
- (rs6000_legitimize_tls_address): New.
- (rs6000_tls_get_addr): New.
- (rs6000_got_sym): New.
- (rs6000_tls_symbol_ref): New.
- (rs6000_tls_symbol_ref_1): New.
- (rs6000_get_some_local_dynamic_name): New.
- (rs6000_get_some_local_dynamic_name_1): New.
- (TARGET_HAVE_TLS): New.
- (TARGET_CANNOT_FORCE_CONST_MEM): New.
- (rs6000_override_options): Handle -mtls-size option.
- (constant_pool_expr_1): Handle TLS symbols.
- (rs6000_legitimize_address): Handle TLS symbols.
- (rs6000_tls_referenced_p): New.
- (rs6000_legitimate_address): Handle TLS symbols.
- (rs6000_emit_move): Handle TLS symbols.
- (print_operand): Handle TLS symbols.
- (uses_TOC): Handle TLS symbols.
- (rs6000_emit_prologue): Use symbol for unspec constant.
- * config/rs6000/rs6000.h (HAVE_AS_TLS): New.
- (some_ld_name): New.
- (LEGITIMATE_CONSTANT_P): Handle TLS symbols.
- (PRINT_OPERAND_PUNCT_VALID_P): Handle TLS symbols.
- (PREDICATE_CODES): Add rs6000_tls_symbol_ref.
- * config/rs6000/rs6000.md (load_toc_v4_PIC_1, load_toc_v4_PIC_1b):
- Support TLS.
- (tls_gd_32, tls_gd_64, tls_ld_32, tls_ld_64, tls_dtprel_32,
- tls_dtprel_64, tls_dtprel_ha_32, tls_dtprel_ha_64, tls_dtprel_lo_32,
- tls_dtprel_lo_64, tls_got_dtprel_32, tls_got_dtprel_64, tls_tprel_32,
- tls_tprel_64, tls_tprel_ha_32, tls_tprel_ha_64, tls_tprel_lo_32,
- tls_tprel_lo_64, tls_got_tprel_32, tls_got_tprel_64, tls_tls_32,
- tls_tls_64): New.
- * config/rs6000/sysv4.h (SUBTARGET_OPTIONS): Add tls_size.
-
-2003-05-12 Neil Booth <neil@cat.daikokuya.co.uk>
-
- * Makefile.in (stage2_build, stage3_build, stage4_build):
- Set BUILD_CC to the same as CC.
-
-2003-05-12 Neil Booth <neil@daikokuya.co.uk>
-
- * alloc-pool.c (last_id): Put in ENABLE_CHECKING guards.
-
-2003-05-12 Andreas Schwab <schwab@suse.de>
-
- * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Mark 'exp'
- as unused.
- (bundling): Initialize 'pos'.
- (ia64_expand_builtin): Initialize 'rmode'.
-
-2003-05-12 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/xcoff.h (ASM_OUTPUT_SKIP): Accept HOST_WIDE_INT.
- (ASM_OUTPUT_ALIGNED_COMMON): Same.
- (ASM_OUTPUT_LOCAL): Same.
-
-Mon May 12 21:53:29 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * varasm.c (output_constant): Fix underflow.
-
-2003-05-12 Mark Mitchell <mark@codesourcery.com>
-
- PR other/10745
- * configure.in: Correct detection of GNU ld version number.
- * configure: Regenerated.
-
-2003-05-12 Zack Weinberg <zack@codesourcery.com>
-
- * diagnostic.c (diagnostic_for_decl): Take a
- diagnostic_context argument. Restructure to be consistent
- with diagnostic_report_diagnostic.
- (diagnostic_count_diagnostic): Now static. Take a
- diagnostic_info argument, not just a diagnostic_t. Some code
- moved here from internal_error. Move a case label for
- clarity.
- (diagnostic_action_after_output): New function. Code moved
- here from internal_error and fatal_error.
- (bug_report_request): New #define so that this text appears in
- only one place.
- (diagnostic_report_diagnostic): Update to match changes to
- diagnostic_count_diagnostic. Call diagnostic_action_after_output.
- (diagnostic_set_info): Call gettext here.
-
- (pedwarn): Update comment. Don't call gettext here.
- (sorry): Use report_diagnostic. Don't call gettext here.
- (fatal_error): Remove final fnotice and exit, but call
- real_abort to prevent warnings about noreturn function returning.
- (internal_error): Likewise. Don't do ICE suppression here nor
- call context->internal_error.
- (warning_with_decl): Suppress for decls in system headers.
- Adjust call to diagnostic_for_decl.
- (pedwarn_with_decl): Likewise.
- (error_with_decl): Adjust call to diagnostic_for_decl.
- (error_recursion): Use bug_report_request.
-
- * diagnostic.h: Remove prototype of diagnostic_count_diagnostic.
- * objc/objc-act.c (error_with_ivar, warn_with_method): Don't call
- diagnostic_count_diagnostic.
-
-2003-05-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON): Correct last patch.
-
-Mon May 12 15:57:54 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * rs6000/darwin.h (ASM_OUTPUT_COMMON): Accept HOST_WIDE_INT
- * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Fix warning.
- * mips/mips.h (ASM_OUTPUT_SKIP): Fix typo in the previous patch.
-
-2003-05-12 Roger Sayle <roger@eyesopen.com>
-
- * doc/rtl.texi: Document zero_extract as a valid destination
- of a set insn.
-
-2003-05-12 Richard Earnshaw <rearnsha@arm.com>
-
- * arm/lib1funcs.asm (LSYM): Define -- on ELF prefix a local symbol with
- '.'. Change all local symbol definitions and references to use LSYM.
-
-Mon May 12 11:32:53 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * expr.h (assemble_static_space): Update prototype.
- * output.h (assemble_zeros, output_constant): Likewise.
- * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean
- * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make
- it 64bit clean.
- * elf.h (ASM_OTUPUT_SKIP): Likewise.
- * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise.
- * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
- Expect HOST_WIDE_INT operand.
- * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
- Expect HOST_WIDE_INT operand.
- * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
- Expect HOST_WIDE_INT operand.
- * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect
- HOST_WIDE_INT operand.
- * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP,
- ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand.
- * aout.h (ASM_OTUPUT_SKIP): Likewise.
- * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise.
- * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise.
- * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise.
- * frv.h (ASM_OTUPUT_SKIP): Likewise.
- * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise.
- * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
- Make it 64bit
- clean.
- * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand.
- * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
- Make it 64bit clean.
- * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean..
- * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect
- HOST_WIDE_INT operand
- * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
- Expect HOST_WIDE_INT operand
- * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand
- * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON,
- ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand
- * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
- Likewise.
- * m32r.h (ASM_OUTPUT_COMMON): Likewise.
- * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
- Likewise.
- * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise.
- * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise.
- * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
- ASM_OUTPUT_SKIP): Likewise.
- * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
- Likewise.
- * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
- ASM_OUTPUT_SKIP): Likewise.
- * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
- ASM_OUTPUT_SKIP): Likewise.
- * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise.
- * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON,
- ASM_OUTPUT_SKIP): Likewise.
- * sgs.h (ASM_OUTPUT_SKIP): Likewise.
- * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON,
- ASM_OUTPUT_SKIP): Likewise.
- * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP):
- Likewise.
- * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise.
- * iris.h (ASM_OUTPUT_LOCAL): Likewise.
- * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise.
- * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
- ASM_OUTPUT_SKIP): Make it 64bit clean.
- * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL):
- Make it 64bit clean.
- * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL,
- ASM_OUTPUT_SKIP): Make it 64bit clean.
- * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it
- 64bit clean.
- * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect
- HOST_WIDE_INT argument
- * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument.
- * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect
- HOST_WIDE_INT argument
- * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument
- * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument
- * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument
- * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
- HOST_WIDE_INT argument
- * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument
- * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument
- * varasm.c (asm_output_bss, asm_output_aligned_bss,
- asm_emit_uninitialized, assemble_zeros, assemble_static_space):
- HOST_WIDE_INT argument
-
-2003-05-10 Steven Bosscher <steven@gcc.gnu.org>
-
- * cgraphunit.c (cgraph_create_edges): Drop walk_tree in
- favor of walk_tree_without_duplicates. Add comments.
-
-2003-05-12 Josef Zlomek <zlomekj@suse.cz>
-
- * alloc-pool.h (ALLOC_POOL_ID_TYPE): New type.
- (struct alloc_pool_def): New element 'id'.
- * alloc-pool.c (fancy_abort): Extern function prototype.
- (abort): Macro which uses fancy_abort.
- (struct allocation_object_def): New structure.
- (ALLOCATION_OBJECT_PTR_FROM_USER_PTR): New macro.
- (USER_PTR_FROM_ALLOCATION_OBJECT_PTR): New macro.
- (last_id): New variable.
- (create_alloc_pool): Add the offset of u.data to size of element,
- increase and use last_id.
- (free_alloc_pool): Do the checking only when ENABLE_CHECKING.
- (pool_alloc): Likewise. Set ID for elements.
- (pool_free): Check whether the PTR was allocated from POOL.
-
-2003-05-11 Richard Henderson <rth@redhat.com>
-
- PR c/10675
- * c-decl.c: Include hashtab.h.
- (detect_field_duplicates): New.
- (finish_struct): Use it.
- * Makefile.in (c-decl.o): Update.
- * c-parse.in (structsp_attr): Nreverse component_decl_list results.
- (component_decl_list, component_decl_list2,
- components, components_notype): Build list in reverse order.
- (enumlist): Clarify docs. Use TREE_CHAIN not chainon.
-
- * tree.c (chainon): Special case op2 null as well.
- Reorg for clarity.
-
-2003-05-11 Roger Sayle <roger@eyesopen.com>
-
- * config/i386/i386.md (logsf2, logdf2, logxf2, logdf2): New patterns
- to implement log, logf and logl built-ins as inline x87 intrinsics.
- (UNSPEC_FYL2X): New unspec to represent x87's "fyl2x" instruction.
- (*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3): New insn
- patterns for x87's "fyl2x" instruction, used by log?f2 patterns.
-
- * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FYL2X like
- UNSPEC_FPATAN, i.e. replaces two stack operands with single result.
-
-2003-05-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (out_object_file): Don't set -Wno-error for ${cpu}.o.
-
- * sparc.c (print_operand): Fix uninitialized warning.
-
-2003-05-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cfgloopanal.c (num_loop_insns, average_num_loop_insns): Count only
- real insns.
- * loop-unroll.c (unroll_loop_runtime_iterations): Remove superfluous
- condition.
-
-2003-05-11 Neil Booth <neil@cat.daikokuya.co.uk>
-
- * doc/cpp.texi: Fix typos.
-
-2003-05-11 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_function_arg_float): New function.
- (s390_function_arg_pass_by_reference): Use it.
- (s390_function_arg_advance): Likewise.
- (s390_function_arg): Likewise.
- (s390_va_arg): Likewise
-
-2003-05-11 Nathan Sidwell <nathan@codesourcery.com>
-
- * coverage.h (coverage_counter_alloc): New function.
- * function.h (struct function): Remove arc_profile flag.
- * coverage.c (fn_ident): Remove.
- (fn_b_ctrs, no_coverage): New.
- (get_coverage_counts): Use current_function_funcdef_no.
- (coverage_counter_alloc): New.
- (coverage_counter_ref): Adjust.
- (coverage_begin_output): Check no_coverage. Use
- current_function_funcdef_no.
- (coverage_end_function): Likewise.
- (create_coverage): Set no_coverage. Set DECL_UNINLINEABLE rather
- than clearing flag_inline_functions. Do not clear arc_profile
- flag.
- * function.c (prepare_function_start): Do not set arc_profile
- flag.
- * profile.c (instrument_edges): Return number of instrumented
- edges. Use a for loop.
- (branch_prob): Call coverage_counter_alloc. Make BB_TO_GCOV_INDEX
- local to here and simplify. Use profile_arc_flag not arc_profile
- flag.
- (find_spanning_tree): Reformat.
- * toplev.c (rest_of_compilation): Use profile_arc_flags and
- flag_test_coverage rather than arc_profile flag.
-
-2003-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * doc/invoke.texi (Wctor-dtor-privacy): Update documentation.
-
-2003-05-11 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * varasm.c (copy_constant, case VIEW_CONVERT_EXPR): New case.
-
-2003-05-11 Bruno Haible <bruno@clisp.org>
-
- * cppfiles.c (find_or_create_entry): Preserve errno.
-
-2003-05-11 Neil Booth <neil@cat.daikokuya.co.uk>
-
- * c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into
- cpplib as it's a Standard Predefined Macro.
- * c-opts.c (finish_options): Pass flag_hosted to cpp_init_builtins.
- * cppinit.c (_cpp_init_builtins): Take HOSTED. Define
- __STDC_HOSTED__ appropriately.
- * cpplib.h (_cpp_init_builtins): Update.
- * fix-header.c (read_scan_file): Update.
- * doc/cpp.texi, doc/cppopts.texi: Update documentation.
-
-2003-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- PR C++/689
- PR C++/9257
- * c-opts.c (c_common_decode_option): Don't set
- warn_ctor_dtor_privacy wen -Wall.
- * c-common.c (warn_ctor_dtor_privacy): Don't turn on by default.
-
-2003-05-10 Alexandre Oliva <aoliva@redhat.com>
-
- * reload1.c (reload_cse_move2add): Revert part of my 2003-05-09's
- patch.
-
-2003-05-10 Zack Weinberg <zack@codesourcery.com>
-
- * diagnostic.c: Reorder functions for clarity, putting all the
- functions in the "error" family next to each other, and
- likewise all the functions in the "error_with_decl" family.
- Some other routines were moved too. Add comments.
- (vbuild_message_string): Fold into sole caller.
-
-
-2003-05-11 Ulrich Weigand <uweigand@de.ibm.com>
-
- * except.c (EH_RETURN_STACKADJ_RTX): Do not define.
- (EH_RETURN_HANDLER_RTX): Likewise.
- (expand_builtin_eh_return): Do not copy stack adjustment
- if EH_RETURN_STACKADJ_RTX is not defined.
- (expand_eh_return): Likewise. Also, do not pass stack
- adjustment as argument to the eh_return pattern.
- * except.h (MUST_USE_SJLJ_EXCEPTIONS): Do not define just
- because EH_RETURN_STACKADJ_RTX is not defined.
- * unwind-dw.c (uw_update_context_1): If EH_RETURN_STACKADJ_RTX
- is not defined, treat stack pointer like a regular register.
- (uw_init_context_1): Set up fake initial stack pointer register.
- (uw_install_context_1): Do not compute stack adjustment if
- EH_RETURN_STACKADJ_RTX is not defined.
-
- * config/i386/i386.md ("eh_return"): Remove first argument.
- * config/mips/mips.md ("eh_return"): Likewise.
- * config/rs6000/rs6000.md ("eh_return"): Likewise.
- * config/sh/sh.md ("eh_return"): Likewise.
-
- * config/s390/s390.h (EH_RETURN_STACKADJ_RTX): Remove.
-
-2003-05-10 Alexander Aganichev <aaganichev@yandex.ru>
-
- * config/i386/i386.h (MODES_TIEABLE_P): Fix typo.
-
-2003-05-10 Nathan Sidwell <nathan@codesourcery.com>
-
- * defaults.h (GCOV_TYPE_SIZE): Remove.
- * gcov-io.h (gcov_type): Set to specific mode int on target.
- (gcov_unsigned_t, gcov_position_t): New.
- (GCOV_TYPE_NODE): New.
- (GCOV_TAG_SUMMARY_LENGTH): Adjust.
- (GCOV_COUNTERS_SUMMABLE): New.
- (gcov_ctr_summary, gcov_sumary, gcov_fn_info, gcov_merge_fn,
- gcov_ctr_info, gcov_info): Adjust types.
- (gcov_var): Adjust types.
- (gcov_write_unsigned, gcov_write_tag,
- gcov_write_length, gcov_write_tag_length, gcov_write_summary,
- gcov_read_unsigned, gcov_read_summary): Adjust gcov types.
- (gcov_position, gcov_sync, gcov_seek): Adjust gcov types.
- * gcov-io.c (gcov_write_unsigned, gcov_write_tag,
- gcov_write_length, gcov_write_tag_length, gcov_write_summary,
- gcov_read_unsigned, gcov_read_summary): Adjust gcov types.
- * libgcov.c (gcov_crc32, gcov_version_mismatch, gcov_exit,
- __gcov_init, __gcov_merge_add): Adjust gcov types.
- * coverage.c (ctr_merge_functions): Constify.
- (ctr_names): New.
- (read_counts_file): Adjust gcov types. Only summarize & merge
- summable counters.
- (coverage_counter_ref): Use GCOV_TYPE_NODE.
- (build_fn_info_type, build_fn_info_value, build_ctr_info_type,
- build_ctr_info_value, build_gcov_info): Adjust types.
- * profile.c (branch_prob): Adjust gcov types.
- * gcov_dump (dump_file): Adjust gcov types.
-
-2003-05-10 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (DOM_CC_X_AND_Y, DOM_CC_NX_OR_Y, DOM_CC_X_OR_Y): New
- constants.
- (ior_scc_scc, and_scc_scc): New insn_and_split patterns.
- * arm.c (arm_select_dominance_cc_mode): Renamed from
- select_dominance_cc_mode, no-longer static. Use DOM_CC... constants.
- Callers updated.
- * arm-protos.h (arm_select_dominance_cc_mode): Add prototype.
-
-2003-05-09 Roger Sayle <roger@eyesopen.com>
-
- * config/alpha/alpha.c (alpha_start_function): Declare frame_size
- as unsigned to avoid signed/unsigned comparison warnings.
-
-2003-05-09 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.c (xtensa_emit_loop_end): Only use "nop.n"
- instruction if the Xtensa density option is enabled.
-
-2003-05-09 Matt Kraai <kraai@alumni.cmu.edu>
-
- * mklibgcc.in: Remove extra quotes.
-
-2003-05-09 Mark Mitchell <mark@codesourcery.com>
-
- * config/rs6000/rs6000.c (spe_init_builtins): Fix typo in creation
- of int_ftype_void.
-
-2003-05-09 Alexandre Oliva <aoliva@redhat.com>
-
- * reload1.c (reload_cse_move2add): Don't turn an implicit
- truncation into a self-set in the narrow mode.
-
-2003-05-09 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (clzsi2): The CLZ instruction is predicable.
-
-2003-05-09 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.c: Formatting.
-
-2003-05-09 Diego Novillo <dnovillo@redhat.com>
-
- * tree-dump.c (dequeue_and_dump): Use CONSTRUCTOR_ELTS,
- instead of TREE_OPERAND to access the operand of a
- CONSTRUCTOR node.
-
-2003-05-09 Diego Novillo <dnovillo@redhat.com>
-
- * tree-dump.c (dequeue_and_dump): CONSTRUCTOR nodes contain only
- one operand.
-
-2003-05-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * toplev.h (warning_with_file_and_line): Don't declare.
- (error_with_file_and_line): Likewise.
- * diagnostic.c (error_with_file_and_line): Remove.
- (warning_with_file_and_line): Likewise.
-
-2003-05-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * c-parse.in (if_stmt_locus): New object.
- (if_prefix rule): Use it. Don't use warning_with_file_and_line.
- (select_or_iter_stmt rule): Likewise.
- (if_stmt_file): Remove.
- (if_stmt_line): Likewise.
- * jump.c: include "diagnostic.h"
- (never_reached_warning): Don't use warning_with_file_and_line.
- * Makefile.in (jump.o): Add dependce on diagnostic.h
-
-2003-05-09 Alan Modra <amodra@bigpond.net.au>
-
- * expr.c (move_block_from_reg): Remove "size" parm. Localize vars.
- Move code handling pieces not larger than a word to..
- * function.c (assign_parms): ..here, but use change_address instead
- of adjust_address and operand_subword, and expand_binop instead of
- expand_shift. Adjust calls to move_block_from_reg.
- * expr.h (move_block_from_reg): Update declaration.
- (copy_blkmode_from_reg): Formatting.
- * Makefile.in (function.o): Add $(OPTABS_H) to deps.
- * config/alpha/alpha.c (alpha_setup_incoming_varargs): Adjust
- move_block_from_reg calls.
- * config/arc/arc.c (arc_setup_incoming_varargs): Likewise.
- * config/i960/i960.c (i960_setup_incoming_varargs): Likewise.
- * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise.
- * config/m88k/m88k.c (m88k_builtin_saveregsk): Likewise.
- * config/mips/mips.c (mips_setup_incoming_varargs): Likewise.
- * config/pa/pa.c (hppa_builtin_saveregs): Likewise.
- * config/romp/romp.h (SETUP_INCOMING_VARARGS): Likewise.
- * config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
- * config/sh/sh.c (sh_builtin_saveregs): Likewise.
-
-2003-05-08 DJ Delorie <dj@redhat.com>
-
- * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_arg): Fix
- to handle arguments for which MUST_PASS_IN_STACK is true (e.g.,
- variable-sized types).
- (xstormy16_function_arg): New. Pass them that way too.
- * config/stormy16/stormy16-protos.h (xstormy16_function_arg): New.
- * config/stormy16/stormy16.h (FUNCTION_ARG): Call it.
-
-2003-05-08 Aldy Hernandez <aldyh@redhat.com>
-
- * mklibgcc.in: Use mkinstalldirs when installing multilib
- directories.
-
-2003-05-08 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (gen_block_redirect, split_branches): Use CODE_FOR_jump_compact
- instead of CODE_FOR_jump
-
-2003-05-08 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * objc/objc-act.c (error_with_ivar): Don't use
- error_with_file_and_line.
- (warn_with_method): Don't use warning_with_file_and_line.
-
-2003-05-08 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * stmt.c (emit_locus): New macro.
- (emit_filename): Remove.
- (emit_lineno): Likewise.
- (struct stmt_status): Replace members x_emit_filename and
- x_emit_lineno with x_emit_locus.
- (set_file_and_line_for_stmt): Adjust.
- (expand_expr_stmt_value): Don't use warning_with_file_and_line.
- (warn_if_unused_value): Likewise.
- (check_seenlabel): Likewise.
-
-2003-05-08 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * c-decl.c (define_label): Tidy. Don't use any of
- error_with_file_and_line or warning_with_file_and_file.
- (pending_xref_error): Likewise.
- (store_parm_decls): Likewise.
- (current_function_prototype_locus): New object. Package from
- current_function_prototype_file and current_function_prototype_line.
- (start_function): Use it.
- (current_function_prototype_file): Remove.
- (current_function_prototype_line): Remove;
-
-2003-05-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtins.c (readonly_data_expr): New function.
- (expand_builtin_memmove): Optimize any rodata source, not just
- strings.
-
-2003-05-07 David Mosberger <davidm@hpl.hp.com>
-
- * unwind-libunwind.c (_Unwind_FindEnclosingFunction): New.
-
-2003-05-07 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.c (ix86_split_long_move): Fix base register
- mode for XFmode splits for TARGET_64BIT.
-
-2003-05-07 Richard Henderson <rth@redhat.com>
-
- * sched-ebb.c (schedule_ebb): Supply the correct starting
- block number to save_line_notes.
-
-2003-05-07 Richard Henderson <rth@redhat.com>
-
- * toplev.c (enum dump_file_index): Swap DFI_ce3, DFI_bbro.
- (dump_file): Likewise.
-
-2003-05-07 David Mosberger <davidm@hpl.hp.com>
-
- * config/ia64/crtbegin.asm (__do_jv_register_classes): Don't
- forget to preserve gp.
- * config/ia64/crtend.asm (__do_global_ctors_au): Ditto.
-
- * config/ia64/crtbegin.asm (__do_jv_register_classes): Add missing
- .prologue directive.
- Use .skip instead of data8 for .bss section to make Intel
- Assembler (ias) happy. Minor whitespace fixups. Make "nop 0"
- explicit in the .mib bundles and remove the unnecessary stop
- bits. Replace local labels with normal labels, to make ias
- happy. Don't register __do_global_ctors_aux here, do it in
- crtend.asm instead.
-
- * config/ia64/crtend.asm [HAVE_INIT_FINI_ARRAY]: Register
- __do_global_ctors_aux in .init_array section instead of
- declaring it as a hidden global. Replace local labels with
- ordinary labels to make ias happy.
-
-2003-05-07 Richard Henderson <rth@redhat.com>
-
- PR c++/10570
- * except.c: Revert 04-01 and 04-02 forced-unwind changes.
- * flags.h, toplev.c, doc/invoke.texi: Likewise.
-
- * unwind-dw2.c (_Unwind_GetCFA): Fix ptr->int conversion warning.
- * unwind.inc (_Unwind_DeleteException): Check for null
- exception_cleanup.
-
- * unwind-sjlj.c (_Unwind_SjLj_Resume_or_Rethrow): New.
- * unwind.inc (_Unwind_Resume_or_Rethrow): New.
- * unwind.h: Declare them.
- * libgcc-std.ver (GCC_3.3): Export them.
-
-2003-05-07 Richard Henderson <rth@redhat.com>
-
- * unwind-dw2.c (_Unwind_GetCFA): Cast pointer to _Unwind_Ptr,
- not _Unwind_Word.
-
-2003-05-07 Zack Weinberg <zack@codesourcery.com>
-
- * stmt.c (force_label_rtx): New function, based on logic
- formerly found in expand_expr.
- * expr.h: Prototype it.
- * expr.c (expand_expr <LABEL_DECL>): Use force_label_rtx if
- appropriate.
- * varasm.c (decode_addr_const <LABEL_DECL>): Use force_label_rtx.
-
- * print-tree.c (debug_tree): Free the table after we're done
- with it. Use putc.
-
-2003-05-07 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.h: Reverse arguments for __ev_subfw.
- Unreverse arguments for __ev_subw.
-
- * config/rs6000/spe.md (evsubfw): Reverse arguments of assembly.
-
-2003-05-07 Nick Clifton <nickc@redhat.com>
-
- * config/stormy16/stormy-abi: Update to include
- R_XSTORMY16_FPTR16, R_XSTORMY16_LO16, R_XSTORMY16_HI16 and
- R_XSTORMY16_12 relocs.
-
-2003-05-07 Alan Modra <amodra@bigpond.net.au>
-
- * function.c (assign_parms): Correct reversed reg_parm_stack_space
- test. Add partial in-regs size to stack_args_size.
-
-2003-05-07 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/invoke.texi (Warning Options): Mark -Wmissing-declarations
- as a C only option.
-
-2003-05-07 Nathan Sidwell <nathan@codesourcery.com>
-
- * gcov-io.h (GCOV_LOCKED): New #define.
- (GCOV_LINKAGE): Make sure it is #defined.
- (gcov_write_string, gcov_write_tag, gcov_write_length,
- gcov_read_string, gcov_time): Poison in libgcov.
- (gcov_seek_end): Remove.
- (gcov_write_tag_length, gcov_sync, gcov_rewrite): New.
- (GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH,
- GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH,
- GCOV_TAG_SUMMARY_LENGTH): New #defines.
- (gcov_write_tag, gcov_write_length): Not in libgcov.
- * gcov-io.c (gcov_open): Use GCOV_LOCKED.
- (gcov_write_tag, gcov_write_length): Not in libgcov.
- (gcov_write_tag_length): New.
- (gcov_write_summary): Use gcov_write_tag_length.
- * libgcov.c: Always #include gcov-io.h.
- (IN_LIBGCOV): -1 for inhibit_libc, +1 otherwise.
- (GCOV_LINKAGE): Define to nothing for L_gcov.
- (gcov_exit): Replace gcov_write_tag, gcov_write_length with
- gcov_write_tag_length. Use gcov_rewrite & gcov_seek.
- * gcov.c (read_graph_file): Replace gcov_seek by gcov_sync.
- (read_count_file): Likewise.
- * gcov-dump.c (dump_file): Likewise.
- * coverag.c (read_counts_file): Likewise.
-
-2003-05-06 Mark Mitchell <mark@codesourcery.com>
-
- PR other/10658
- * gcc.c (process_command): Update copyright date.
-
-2003-05-06 Phil Edwards <pme@gcc.gnu.org>
-
- * doc/install.texi (mips-*-*): Add note about libstdc++.
-
-2003-05-06 DJ Delorie <dj@redhat.com>
-
- * config/stormy16/stormy16.c (xstormy16_function_profiler): New.
- * config/stormy16/stormy16.h (FUNCTION_PROFILER): Call it.
- * config/stormy16/stormy16-protos.h (xstormy16_function_profiler): New.
-
-2003-05-06 <neil@cat.daikokuya.co.uk>
-
- * c-opts.c (COMMAND_LINE_OPTIONS): Reject -Wmissing-prototypes
- and -Wstrict-prototypes if C++.
-
-2003-05-06 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/linuxspe.h: New file.
-
- * config.gcc: Add powerpc-*-linux-gnuspe* target.
-
-2003-05-06 Richard Henderson <rth@redhat.com>
-
- * unwind-dw2.c (uw_update_context_1): Only set cfa as sp if
- previous frame didn't save sp. Clear sp for next frame.
- (uw_install_context_1): Honor saved sp from frame.
-
-2003-05-06 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare.
- (mips_move_1word, mips_move_2words): Remove declaration.
- (mips_split_64bit_move_p, mips_split_64bit_move): Declare.
- (mips_restore_gp): Remove insn argument.
- * config/mips/mips.h (FP_REG_RTX_P): New macro.
- * config/mips/mips.c (volatile_buffer): Remove.
- (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New.
- (mips_move_1word, mips_move_2words): Remove, replacing with...
- (mips_output_move): ...this new function.
- (mips_restore_gp): Remove insn argument. Adjust for above changes.
- (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove
- handling of floating-point constants. Handle zero CONST_DOUBLE
- arguments.
- (mips_annotate_frame_insn): Replace with...
- (mips_set_frame_expr): ...this, which just takes one argument.
- (mips_frame_set): Change the register argument to an rtx.
- (mips_emit_frame_related_store): Use mips_split_64bit_move_p to
- check whether moves should be split. Use mips_split_64bit_move
- to split them. Use mips_subword to generate the high and low
- parts of a paired FPR. Adjust calls to frame_set and
- mips_set_frame_expr.
- (mips_expand_prologue): Simplify due to above changes.
- * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit
- targets, replacing xisting register-only versions.
- (UNSPEC_STORE_DF_HIGH): New unspec.
- (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs.
- (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word.
- (*paradoxical_extendhidi2): Remove.
- (movdi_internal, movdi_internal2): Use mips_output_move.
- (*movdi_internal2_mips16, movsi_internal, movcc): Likewise.
- (movsf_internal1, movsf_internal2): Likewise.
- (movdf_internal1a): Likewise. Fix length and type of f <- G case.
- (movdf_internal1b): Use mips_output_move. Fix type of f <- G case.
- (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves.
- Add m <- G alternative.
- (load_df_low, load_df_high, store_df_low): New patterns.
- (movhi_internal): Use @ template instead of calling a function.
- Remove unnecessary 'z' alternatives.
- (movqi_internal): Likewise.
- (exception_receiver): Update call to mips_restore_gp.
-
-2003-05-06 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_simplify_dwarf_addr): Remove.
- (mips_delegitimize_address): Declare.
- * config/mips/mips.h (ASM_SIMPLIFY_DWARF_ADDR): Undefine.
- (FIND_BASE_TERM): Define.
- * config/mips/mips.c (TARGET_DELEGITIMIZE_ADDRESS): Defi~e.
- (mips_delegitimize_address): Renamed from mips_simplify_dwarf_addr.
- Handle small-data addresses.
-
-2003-05-05 Roger Sayle <roger@eyesopen.com>
-
- * real.c (real_powi): New function to calculate the value of
- a real raised to an integer power, i.e. pow(x,n) for int n.
- (real_sqrt): Convert to using the faster do_add, do_multiply
- and do_divide API for consistency with the rest of real.c.
- * real.h (real_powi): Prototype here.
- * builtins.c (fold_builtin): Avoid local variable mode when
- evaluating sqrt at compile time. Attempt to evaluate pow at
- compile-time, by checking for an integral exponent.
-
-2003-05-05 Richard Henderson <rth@redhat.com>
-
- * doc/extend.texi (Variable Attributes): Re-sort table and tidy.
-
-2003-05-05 David O'Brien <obrien@FreeBSD.org>
-
- * config/rs6000/sysv4.h (CPP_OS_FREEBSD_SPEC): Add __ELF__ to mirror
- other FreeBSD ports.
- (LINK_OS_FREEBSD_SPEC): Mirror conventions on other FreeBSD ports.
- (_LITTLE_ENDIAN): Use __LITTLE_ENDIAN__ instead.
-
-2003-05-05 Janis Johnson <janis187@us.ibm.com>
-
- * Makefile.in: (site.exp): Add ALT_CC_UNDER_TEST, add quotes around
- expanded variables.
- * doc/sourcebuild.texi (C tests): Describe gcc.dg/compat tests.
-
-2003-05-05 Zack Weinberg <zack@codesourcery.com>
-
- * rtl.h (STRING_POOL_ADDRESS_P): Rename to DEFERRED_CONSTANT_P.
- * varasm.c (struct varasm_status): Add deferred_constants field.
- (n_deferred_strings): Delete variable.
- (n_deferred_constants): New #define.
- (struct constant_descriptor_tree): Kill next and label fields.
- (const_hash_table, MAX_HASH_TABLE): Delete.
- (const_desc_htab): New static variable.
- (const_hash): Rename const_desc_hash, and make it fit the
- hashtab.h interface.
- (const_desc_eq): New.
- (const_hash_1, compare_constant): Const-ify arguments.
- (build_constant_desc): Set DEFERRED_CONSTANT_P on all new
- SYMBOL_REFs. Clarify comments. Don't set desc->label.
- (output_constant_def): Do the lookup/insert using the
- hashtab.h interface. Don't muck with n_deferred_constants or
- DEFERRED_CONSTANT_P here.
- Always call maybe_output_constant_def_contents.
- (maybe_output_constant_def_contents): Take a pointer to the
- descriptor, not the EXP and RTL separately. Return
- immediately if this constant is not deferred. Defer output of
- everything, except writable string constants. Update
- n_deferred_constants here.
- (output_constant_def_contents): Now takes just one argument,
- an rtx. Clear DEFERRED_CONSTANT_P here.
- (mark_constant_pool): Update for rename of n_deferred_strings.
- (mark_constant): Don't clear DEFERRED_CONSTANT_P here.
-
- (init_varasm_status): Clear p->deferred_constants.
- (init_varasm_once): Call htab_create_ggc for const_desc_htab.
-
-2003-05-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtins.c (expand_builtin_stpcpy): Only expand when the length
- of the source string can be evaluated at compile-time.
-
-2003-05-05 Aldy Hernandez <aldyh@redhat.com>
-
- * testsuite/gcc.c-torture/compile/simd-6.c: New.
-
- * c-typeck.c (digest_init): Handle arrays of vector constants.
-
-2003-05-05 Jakub Jelinek <jakub@redhat.com>
-
- * builtins.c (expand_builtin_mempcpy): New function.
- (expand_builtin_stpcpy): Optimize stpcpy whose return value is
- ignored into strcpy no matter what arguments it has.
- (expand_builtin) <case BUILT_IN_MEMPCPY>: Call
- expand_builtin_mempcpy.
-
-2003-05-05 Aldy Hernandez <aldyh@redhat.com>
-
- * testsuite/gcc.dg/20030505.c: New.
-
- * c-typeck.c (convert_for_assignment): Opaque pointers can
- interconvert.
-
- * config/rs6000/rs6000.c: New global opaque_p_V2SI_type_node.
- (rs6000_init_builtins): Initialize opaque_p_V2SI_type_node.
- (spe_init_builtins): Rename all pv2si_type_node to
- opaque_p_V2SI_type_node.
- Remove declaration of pv2si_type_node.
- (is_ev64_opaque_type): Accept opaque pointers.
-
-2003-05-05 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/rs6000.c (validate_condition_mode): Use
- flag_finite_math_only.
- (rs6000_reverse_condition): Never return UNKNOWN; use
- flag_finite_math_only.
- (rs6000_generate_compare): Use flag_finite_math_only.
- (rs6000_emit_cmove): Handle UNLE. Support UNEQ under -ffast-math.
- Use HONOR_* rather than flag_unsafe_math_optimizations. Correct
- UNGE and GT cases. Handle UNEQ and LTGT when ! HONOR_NANS.
-
- * toplev.c (check_global_declarations): Suppress not-used warning
- for volatile variables.
-
-2003-05-05 Olivier Hainque <hainque@act-europe.fr>
-
- * expr.c (expand_expr, case BIT_FIELD_REF): Refine the test forcing
- usage of bitfield instructions for mode1 != BLKmode, only ignoring
- SLOW_UNALIGNED_ACCESS if the field is not byte aligned.
- (store_field): Likewise.
-
-2003-05-05 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add
- evsubifw to builtins accepting 5-bit unsigned constants.
- (easy_vector_constant): Return if V1DImode. Fix typo.
-
-2003-05-05 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.h: Revert licensing change from last patch.
-
-2003-05-05 DJ Delorie <dj@redhat.com>
-
- * config/stormy16/stormy16.md (negsi2): Allocate the pseudos
- before reload, but defer the split until after.
- * config/stormy16/stormy16.c (xstormy16_expand_arith): Modify
- to match.
-
-2003-05-05 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add 440 support.
- * config/rs6000/vxworks.h (CC1_SPEC): Use -mcpu=440 for t440.
-
-2003-05-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc
- is defined.
-
-2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtin-attrs.def (ATTR_NOTHROW_NONNULL_1,
- ATTR_NOTHROW_NONNULL_2, ATTR_NOTHROW_NONNULL_3): Renamed from
- ATTR_NONNULL_1, ATTR_NONNULL_2 and ATTR_NONNULL_3.
-
- (ATTR_NOTHROW_NONNULL_1_2, ATTR_NOTHROW_NONNULL_1_4,
- ATTR_CONST_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1,
- ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_MALLOC_NOTHROW_NONNULL_1):
- New.
-
- * builtins.def (DEF_EXT_FALLBACK_BUILTIN): Accept ATTRS argument.
- (BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Update comment
-
- (BUILT_IN_INDEX, BUILT_IN_RINDEX, BUILT_IN_MEMCPY,
- BUILT_IN_MEMMOVE, BUILT_IN_MEMCMP, BUILT_IN_MEMSET,
- BUILT_IN_MEMPCPY, BUILT_IN_STRCAT, BUILT_IN_STRNCAT,
- BUILT_IN_STPCPY, BUILT_IN_STRCPY, BUILT_IN_STRNCPY,
- BUILT_IN_STRCMP, BUILT_IN_STRNCMP, BUILT_IN_STRLEN,
- BUILT_IN_STRSTR, BUILT_IN_STRPBRK, BUILT_IN_STRSPN,
- BUILT_IN_STRCSPN, BUILT_IN_STRCHR, BUILT_IN_STRRCHR, BUILT_IN_NAN,
- BUILT_IN_NANF, BUILT_IN_NANL, BUILT_IN_NANS, BUILT_IN_NANSF,
- BUILT_IN_NANSL, BUILT_IN_PUTS, BUILT_IN_FPUTC, BUILT_IN_FPUTS,
- BUILT_IN_FWRITE, BUILT_IN_PUTS_UNLOCKED, BUILT_IN_FPUTC_UNLOCKED,
- BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FWRITE_UNLOCKED,
- BUILT_IN_STRDUP): Add "nonnull" attribute.
-
-2003-05-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (store_field): Don't clobber TEMP in shift: it might be
- a variable.
- (get_inner_reference): Don't go through a VIEW_CONVERT_EXPR
- whose purpose is to step up the alignment.
- (expand_expr, case ADDR_EXPR): Force LO_SUM into memory, just like REG.
-
- * stor-layout.c (compute_record_mode): Relax restriction
- on fields crossing word boundaries forcing BLKmode.
-
-2003-05-04 Neil Booth <neil@daikokuya.co.uk>
-
- * cppinit.c (cpp_create_reader, post_options): Warn about
- trigraphs unless explicity set or -trigraphs.
- * cpplex.c (warn_in_comment): New.
- (_cpp_process_line_notes): Better handling of -Wtrigraphs.
- (_cpp_skip_block_comment): Add call to _cpp_process_line_notes.
- * doc/cppopts.texi, doc/cpp.texi: Update.
-
-2003-05-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * Makefile.in (LIBGCOV): Add _gcov_merge_add.
- * gcov-io.h: Make GCOV_LINKAGE extern in libgcov and prevent resulting
- namespace clash.
- (GCOV_MERGE_FUNCTIONS): New.
- (gcov_merge_fn): Declare.
- (struct gcov_ctr_info): New field "merge".
- (__gcov_merge_add): Declare.
- * coverage.c (ctr_merge_functions): New.
- (build_ctr_info_type, build_ctr_info_value): Initialize merge field
- of gcov_ctr_info type.
- * libgcov.c (__gcov_merge_add): New.
- (gcov_exit): Call a hook to merge values of counters.
-
-2003-05-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * toplev.h (pedwarn_with_file_and_line): Don't declare.
- * diagnostic.c (pedwarn_with_file_and_line): Remove.
-
-2003-05-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * varasm.c (assemble_variable): Don't use error_with_file_and_line.
-
-2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtins.c (expand_builtin_constant_p, expand_builtin_strlen,
- expand_builtin_frame_address): Update prototypes.
- (expand_builtin_constant_p, expand_builtin_strlen,
- expand_builtin_strcpy, expand_builtin_memset,
- expand_builtin_bzero, expand_builtin_args_info,
- expand_builtin_frame_address): Pass in just the argument(s)
- needed, not the entire expression `exp'.
- (expand_builtin): Update all calls to these functions.
-
-2003-05-03 Richard Henderson <rth@redhat.com>
-
- * builtins.c (expand_builtin) <BUILT_IN_DWARF_FP_REGNUM>: Remove.
- <BUILT_IN_DWARF_SP_COLUMN>: New.
- * builtins.def (BUILT_IN_DWARF_FP_REGNUM): Remove.
- (BUILT_IN_DWARF_SP_COLUMN): New.
- * dwarf2out.c (expand_builtin_dwarf_fp_regnum): Remove.
- (expand_builtin_dwarf_sp_column): New.
- * except.h: Update to match.
- * unwind-dw2.c (execute_stack_op): Correct stack push typo.
- (execute_cfa_program): Record location expression address
- before extracting length.
- (uw_update_context_1): Install old CFA into stack pointer column.
- (uw_init_context_1): Set cfa_reg to stack pointer column.
-
-2003-05-03 Richard Henderson <rth@redhat.com>
-
- * config/rs6000/rs6000.c (constant_pool_expr_p): Make static and
- return bool.
- (toc_relative_expr_p): Likewise.
- (SPE_CONST_OFFSET_OK): Move from rs6000.h.
- (legitimate_constant_pool_address_p): Move from rs6000.h, change
- into a function, downcase all users.
- (legitimate_small_data_p): Likewise.
- (legitimate_offset_address_p): Likewise.
- (legitimate_indexed_address_p): Likewise.
- (legitimate_indirect_address_p): Likewise.
- (legitimate_lo_sum_address_p): Likewise.
- (rs6000_mode_dependent_address): Likewise.
- * rs6000.h (CONSTANT_POOL_EXPR_P, TOC_RELATIVE_EXPR_P): Remove.
- (SPE_CONST_OFFSET_OK, LEGITIMATE_CONSTANT_POOL_ADDRESS_P,
- LEGITIMATE_SMALL_DATA_P, LEGITIMATE_OFFSET_ADDRESS_P,
- LEGITIMATE_INDEXED_ADDRESS_P, LEGITIMATE_INDIRECT_ADDRESS_P,
- LEGITIMATE_LO_SUM_ADDRESS_P): Move into rs6000.c.
- (LEGITIMATE_ADDRESS_INTEGER_P): Remove.
- (GO_IF_MODE_DEPENDENT_ADDRESS): Use rs6000_mode_dependent_address.
- * config/rs6000/rs6000-protos.h: Update.
-
-2003-05-03 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/rs6000.h (REVERSIBLE_CC_MODE): Define.
- (REVERSE_CONDITION): Define.
-
- * config/rs6000/rs6000.c (scc_comparison_operator): Make equivalent
- to branch_positive_comparison_operator.
- (ccr_bit): Check that sCOND conditions are actually a positive bit.
- (print_operand): Remove %D substitution.
- (rs6000_emit_sCOND): Generate complement operation to ensure that
- sCOND input is a positive bit.
- * config/rs6000/rs6000.md: Rearrange sCOND templates to be in the
- same order as bCOND, and add the missing ones. Remove the %D
- substitutions from the scc patterns.
-
- * simplify-rtx.c (simplify_relational_operation): Add case for
- ! (fabs(x) < 0.0).
-
-2003-05-03 Bruce Korb <bkorb@gnu.org>
-
- * gcc/fixinc/fixincl.tpl(dne): restore this to force merge conflicts
- in fixincl.x
- * gcc/fixinc/inclhack.def(bsd_stdio_attrs_conflict): fix placement
-
-2003-05-03 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.h: Remove unecessary casts. Misc cleanups.
-
-2003-05-03 Zack Weinberg <zack@codesourcery.com>
-
- PR c/10604
- * c-common.c (warn_sign_compare): Initialize to -1.
- * c-opts.c (c_common_init_options): Don't set warn_sign_compare here.
- (c_common_decode_option <OPT_Wall>): Set warn_sign_compare
- for C++ only.
- (c_common_post_options): Set warn_sign_compare from extra_warnings
- if it's still -1 at this point.
-
- * toplev.c (maybe_warn_unused_parameter): New static variable.
- (set_Wextra): New static function.
- (W_options): Remove "extra".
- (decode_W_option): Call set_Wextra.
- (independent_decode_option): Likewise.
- (set_Wunused): Cooperate with set_Wextra in setting
- warn_unused_parameter.
- (rest_of_compilation): No need to check extra_warnings as
- well as warn_uninitialized.
-
- * c-typeck.c (build_binary_op, build_conditional_expr):
- No need to check extra_warnings as well as warn_sign_compare.
- (internal_build_compound_expr): No need to check extra_warnings
- as well as warn_unused_value.
- * function.c (expand_function_end): No need to check extra_warnings
- as well as warn_unused_parameter.
- * stmt.c (expand_expr_stmt_value): No need to check extra_warnings
- as well as warn_unused_value.
-
- * doc/invoke.texi: Clarify documentation of -Wsign-compare.
-
- * Makefile.in: Disable -Werror for gengtype-lex.o.
-
-2003-05-03 Olivier Hainque <hainque@act-europe.fr>
-
- * emit-rtl.c (last_call_insn, add_function_usage_to): New functions.
- * rtl.h (last_call_insn, add_function_usage_to): New prototypes.
- * builtins.c (expand_builtin_apply): Use the new emit-rtl functions.
- * calls.c (emit_call_1): Likewise.
- (expand_call): For calls initializing constant memory, replace
- emission of standalone mem /u clobber with function usage entry.
- * expr.c (emit_block_move_via_libcall): Likewise.
- * cse.c (count_reg_usage, case EXPR_LIST): New case.
- * flow.c (propagate_one_insn): Pass entire operand of
- CALL_INSN_FUNCTION_USAGE to mark_used_regs.
- * integrate.c (try_constants): For CALL_INSNs, substitute constants
- within the FUNCTION_USAGE also.
- * loop.c (prescan_loop): Note clobbers of const mem mentioned in
- FUNCTION_USAGE lists.
- * reload1.c (replace_pseudos_in): Renamed.
- (reload): Use it for clobbers surviving until the end of the reload.
-
-2003-05-03 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_expr, case VIEW_CONVERT_EXPR): Don't use
- gen_lowpart on non-integer modes.
-
- * stor-layout.c (place_field): When adjusting offset_align, use
- desired_align, not DECL_ALIGN.
-
-2003-05-03 Nathan Sidwell <nathan@codesourcery.com>
-
- * c-decl.c (pending_invalid_xref_file): Remove.
- (pending_invalid_xref_line): Remove.
- (pending_invalid_xref_location): New.
- (lookup_label): Use location_t and input_location directly.
- (lookup_tag): Likewise.
- (pending_xref_error): Likewise.
- (c_expand_body_1): Likewise.
- * c-common.c (x_expand_start_cond): Likewise.
- * c-semantics.c (genrtl_for_stmt): Likewise.
- (find_reachable_label): Likewise.
- * expr.c (expand_expr): Likewise.
- * integrate.c (output_inline_function): Likewise.
- * tree-inline.c (find_alloca_call): Likewise.
- (find_builtin_longjmp_call): Likewise.
- * gcc.c (input_filename): Make static.
-
-2003-05-03 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md: Fix comment typo.
-
- * config/mips/mips.c (mips_integer_op): New structure.
- (MIPS_MAX_INTEGER_OPS): Define.
- (mips_const_insns): Use mips_build_integer to determine the number
- of instructions needed to load a CONST_INT.
- (move_operand): Reject compound CONST_INTs.
- (mips_build_shift, mips_build_lower, mips_build_integer): New fns.
- (mips_move_integer): New fn.
- (mips_legitimize_const_move): Pass CONST_INTs to mips_move_integer.
- (mips_legitimize_move): Only legitimize constants when moving
- word or subword values.
-
-2003-05-02 Matt Kraai <kraai@alumni.cmu.edu>
-
- * Makefile.in (gcov-iov.h): Use move-if-change and a stamp.
-
-2003-05-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtins.c (expand_builtin_stpcpy): Copy `arglist' before
- modifying it.
-
-2003-05-03 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
- Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Add Zdenek Dvorak, Aldy
- Hernandez, and Kazu Hirata. Update Richard Henderson.
-
-2003-05-02 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/rs6000.c (rs6000_attribute_table): Add 'extern'
- to tentative declaration.
-
- * config/rs6000/sysv4.h (SYMBOL_FLAG_SMALL_V4): Delete.
- (SYMBOL_FLAG_SMALL_V4): Delete.
- * config/rs6000/rs6000.c (small_data_operand): Use SYMBOL_REF_SMALL_P.
- (rs6000_elf_encode_section_info): Don't set SYMBOL_FLAG_SMALL_V4.
- (rs6000_elf_in_small_data_p): Add extra section names. Add
- comment about TREE_PUBLIC test.
-
- * c-semantics.c (genrtl_switch_stmt, genrtl_if_stmt): Call
- expand_stmt on result of expand_unreachable_stmt.
-
-2003-05-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Add Daniel Berlin.
-
-2003-05-02 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/{603.md,6xx.md,7450.md,7xx.md,rs64.md}: Decrease
- number of automata.
-
- * config/rs6000/rs6000.c (symbol_ref_operand): Check
- SYMBOL_REF_FUNCTION_P on AIX.
- (current_file_function_operand): Same.
- * config/rs6000/rs6000.md (call,call_value): Force non-function
- symbol_ref into register on AIX.
-
-2003-05-02 Alan Modra <amodra@bigpond.net.au>
-
- * calls.c (struct arg_data): Move offset, slot_offset, size and
- alignment_pad to struct locate_and_pad_arg_data. Update all refs.
- (initialize_argument_information): Adjust call to locate_and_pad_parm.
- Delete alignment_pad var. Don't calculate slot_offset here.
- (emit_library_call_value_1): Delete alignment_pad, offset and size
- vars. Use struct locate_and_pad_arg_data instead. Adjust refs.
- Adjust call to locate_and_pad_parm. Don't tweak arg size for
- partial in-regs here. Formatting fixes.
- * expr.h (struct locate_and_pad_arg_data): New struct.
- (locate_and_pad_parm): Adjust declaration.
- * function.c (assign_parms): Localize vars. Use "locate" instead of
- other arg location vars. Don't invoke FUNCTION_ARG or
- FUNCTION_INCOMING_ARG unless pretend_named is different from
- named_arg. Heed MUST_PASS_IN_STACK and set up "partial" before
- calling locate_and_pad_parm. Adjust locate_and_pad_parm call.
- Use slot_offset for stack home of reg parms. Correct test for
- parm passed in memory. Formatting fixes.
- (locate_and_pad_parm): Add "partial" to params. Replace offset_ptr
- arg_size_ptr and alignment pad with "locate". Set slot_offset here.
- Correct initial_offset_ptr handling. Localize vars. Always pad
- locate->offset even when in_regs.
-
-2003-05-02 Nathan Sidwell <nathan@codesourcery.com>
-
- * Makefile.in (TREE_H): Replace location.h with input.h.
- (GTFILES) Remove location.h
- (gt-lists.h): Replace gt-location.h with gt-input.h
- * input.h (input_filename, input_line): Remove variables.
- (location_s, location_t): Move from location.h.
- (input_location): New.
- (input_filename, input_line): New #defines.
- * location.h: Remove.
- * tree.h: Replace location.h with input.h.
- (input_filename, input_line): Remove.
- * diagnostic.h: Replace location.h with input.h.
- * gcc.h (input_filename, input_filename_length): Remove declarations.
- * toplev.c (input_filename, input_line): Remove.
- (input_location): Define.
- (push_srcloc, pop_srcloc): Adjust.
- * diagnostic.c (diagnostic_report_current_module): Adjust.
-
-2003-05-02 Nick Clifton <nickc@redhat.com>
-
- * configure.in: Add xstormy16 to list of targets that has a nop
- instruction and hence which can be tested to see if the
- assembler supports the --gdwarf2 switch.
- * configure: Regenerate.
-
-2003-05-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
-
- PR target/8257
- * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue,
- alpha_start_function, alpha_expand_epilogue, unicosmk_gen_dsib):
- Avoid undefined shifts by making the shift operand unsigned.
-
-2003-05-01 DJ Delorie <dj@redhat.com>
-
- * reload.c (find_reloads): Also check that all of a multi-reg
- value is in the class.
-
-2003-05-01 Nathan Sidwell <nathan@codesourcery.com>
-
- * scan.h (lineno): Revert the rename here.
-
-2003-05-01 Stan Shebs <shebs@apple.com>
-
- * config/darwin.c (darwin_encode_section_info): Call
- default_encode_section_info.
-
-2003-05-01 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.md (define_attr "type"): Add mfjmpr.
- (movsi_internal1): Use new mfjmpr attribute.
- (movhi_internal): Same.
- (movqi_internal): Same.
- (movcc_internal1): Same.
- (movdi_internal64): Same.
- * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md,
- power4.md,rios1.md,rios2.md,rs64.md}: Add mfjmpr.
- * config/rs6000/40x.md: Add fpu_405.
- * config/rs6000/power4.md: Merge power4lsu and power4disp automata
- into power4misc automata. Remove extraneous parentheses.
- * config/rs6000/440.md: New file.
- * config/rs6000/rs6000.c (processor_target_table): Add 440,
- 440fp. Rename 405f to 405fp.
- (function_arg_padding): Correct formatting.
- (rs6000_rtx_costs): Add PROCESSOR_PPC440 cases.
-
-2003-05-01 Nathan Sidwell <nathan@codesourcery.com>
-
- * input.h (lineno): Rename to ...
- (input_line): ... here.
- * tree.h (lineno): Rename to ...
- (input_line): ... here.
- * scan.h (lineno): Rename to ...
- (input_line): ... here.
- * toplev.c (lineno): Rename to ...
- (input_line): ... here.
- (push_srcloc, pop_srcloc): Rename lineno to input_line.
- * c-common.c (c_expand_start_cond, fname_decl): Likewise.
- * c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag,
- store_parm_decls, c_expand_body_1): Likewise.
- * c-errors.c (pedwarn_c99): Likewise.
- * c-format.c (status_warning): Likewise.
- * c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise.
- * c-opts.c (c_common_post_options, c_common_parse_file): Likewise.
- * c-parse.in (save_filename, maybe_type_qual, ifc): Likwise.
- * c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var,
- gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt,
- genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt,
- genrtl_return_stmt, genrtl_for_stmt, build_break_stmt,
- build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt,
- prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise.
- * coverage.c (create_coverage): Likewise.
- * diagnostic.c (pedwarn, sorry, error, fatal_error,
- internal_error, warning, diagnostic_report_current_module,
- inform): Likewise.
- * expr.c (expand_expr): Likewise.
- * integrate.c (expand_inline_function,
- output_inline_function): Likewise.
- * rtl-error.c (file_and_line_for_asm): Likewise.
- * tree-inline.c (find_alloca_call, find_builtin_longjmp_call,
- walk_tree): Likewise.
- * tree.c (make_node): Likewise.
- * ada, cp, f, java, objc, treelang: Likewise.
- * objc/objc-act.c (objc_init): Rename lineno to input_line.
- (build_module_descriptor, build_selector_translation_table,
- build_protocol_template, build_method_prototype_list_template,
- build_category_template, build_selector_table,
- build_class_template, build_super_template, build_ivar_template,
- build_ivar_list_template, build_method_list_template,
- build_method_template, add_instance_variable): Likewise.
-
- * dwarf2out.c (dwarf2out_init, dwarf2out_finish): Change parameter
- name from input_filename.
-
-2003-04-30 Eric Christopher <echristo@redhat.com>
- Richard Sandiford <rsandifo@redhat.com>
-
- * configure: Regenerate from patches below.
- * combine.c (gen_lowpart_for_combine): Fix comment and add tests
- for all symbolic operands.
- * config/mips/mips.c: Migrate RTX_COSTS and CONST_COSTS
- to function.
- * config/mips/linux.h: Fix typo.
- * Merge from mips-3_4-rewrite branch:
-
- 2003-04-07 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips_classify_symbol): Add catch-all case for
- handling local labels when TARGET_ABICALLS.
-
- 2003-04-04 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_expand_epilogue): Add an
- integer argument.
- (mips_expand_call): Likewise.
- * config/mips/mips.h (TARGET_SIBCALLS): New macro.
- (FIXED_REGISTERS): Clear $31 entry.
- (CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTER): Likewise.
- (EPILOGUE_USES): Define.
- * config/mips/mips.c (mips_function_ok_for_sibcall): New function.
- (TARGET_FUNCTION_OK_FOR_SIBCALL): Use it.
- (override_options): Add a 'j' register class.
- (mips_expand_call): Handle sibcalls
- (mips_expand_epilogue): Handle epilogues for sibcalls.
- * config/mips/mips.md (epilogue): Adjust call to mips_expand_epilogue.
- (sibcall_epilogue): New pattern.
- (call, call_value): Adjust calls to mips_expand_call.
- (sibcall, sibcall_value): New expanders.
- (sibcall_internal, sibcall_value_internal): New patterns.
- (sibcall_value_multiple_internal): New pattern.
-
- 2003-03-25 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md (extended_mips16): New attribute.
- (define_attr length): Default to 8 if extended_mips16 == yes.
- (truncdisi2): Set extended_mips16 to yes for the sll alternative.
- (truncdihi2, truncdiqi2, *extendsidi2): Likewise.
- (call_internal): Set extended_mips16 to yes for direct jumps.
- Remove redundant mode attribute.
- (call_value_internal, call_value_multiple_internal): Likewise.
- (call_split): Remove redundant mode attribute.
- (call_value_split, call_value_multiple_split): Likewise.
-
- * config/mips/mips.c (mips_symbol_insns): Rework. Fix handling
- of unaligned offsets.
-
- * config/mips/mips.c (mips_splittable_symbol_p): Fix handling
- of SYMBOL_GENERAL.
-
- 2003-03-22 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (TARGET_EXPLICIT_RELOCS): Add commentary.
- * config/mips/mips.c (override_options): Disable -mexplicit-relocs
- for mips16 code.
-
- 2003-03-22 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (ADDRESS_COST): Define.
-
- 2003-03-20 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (EXTRA_CONSTRAINT): Give existing meaning of
- 'R' to 'U'. Make 'R' mean a single-instruction memory reference.
- * config/mips/mips.md: Replace 'R' constraints with 'U'.
-
- 2003-03-18 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md (truncdisi2): Add commentary. Use sll instead
- of a two-instruction sequence. Add register->memory alternative.
- (truncdihi2, truncdiqi2): Likewise.
- Rework shift/truncate instructions so that they only handle right
- shifts of 32 (or more, in the case of arithmetic shifts).
- Add patterns for truncate/sign-extend.
-
- 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
-
- * configure.in (mips*-*-*): Check for explicit relocation support.
- * configure: Regenerate.
-
- 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (TARGET_SWITCHES): Add -mexplicit-relocs
- and -mno-explicit-relocs.
- (MASK_EXPLICIT_RELOCS): Define.
- (TARGET_EXPLICIT_RELOCS): Use it.
- (mips_split_addresses): Remove declaration.
- * config/mips/mips.c (override_options): Update comment for
- mips_split_addresses. Clear MASK_EXPLICIT_RELOCS for non-PIC n64.
-
- 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
-
- * combine.c (gen_lowpart_for_combine): Treat the lowpart Pmode of
- a CONST as identity. Check the return value of gen_lowpart_common.
-
- 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips_legitimize_symbol): Handle small data
- references for TARGET_EXPLICIT_RELOCS.
- (mips_reloc_string): Return "%gp_rel(" for RELOC_GPREL16 if
- !TARGET_MIPS16.
-
- 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md: Replace 'IQ' mips16 constraints with just 'Q'.
- (addsi3): Remove redundant constraints.
- (addsi3_internal): Use separate register & constant alternatives.
- Use a 'Q' constraint and "addiu" insn for the latter.
- (adddi3_internal_3, addsi3_internal_2): Likewise.
-
- 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_expand_unaligned_load): Declare.
- (mips_expand_unaligned_store): Declare.
- * config/mips/mips.c (mips_get_unaligned_mem): New fn.
- (mips_expand_unaligned_load, mips_expand_unaligned_store): New fns.
- * config/mips/mips.md (UNSPEC_ULW, UNSPEC_USW): Remove.
- (UNSPEC_ULD, UNSPEC_USD): Remove.
- (UNSPEC_LWL, UNSPEC_LWR, UNSPEC_SWL, UNSPEC_SWR): New.
- (UNSPEC_LDL, UNSPEC_LDR, UNSPEC_SDL, UNSPEC_SDR): New.
- (extv, extzv): Use mips_expand_unaligned_load.
- (insv): Use mips_expand_unaligned_store. Use a reg_or_0_operand
- predicate for operand 3.
- (movsi_ulw, movsi_usw): Replace with...
- (mov_lwl, mov_lwr, mov_swl, move_swr): ...these new insns.
- (movdi_uld, movdi_usd): Likewise replace with...
- (mov_ldl, mov_ldr, mov_sdl, move_sdr): ...these insns.
-
- 2003-02-26 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_global_pic_constant_p): Declare.
- * config/mips/mips.h (LEA_REGS): New register class.
- (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add entries for it.
- (GR_REG_CLASS_P): Include LEA_REGS.
- (DANGEROUS_FOR_LA25_P): New macro.
- (EXTRA_CONSTRAINT): Add !DANGEROUS_FOR_LA25_P to R's condition.
- Add a T constraint for the DANGEROUS_FOR_LA25_P case.
- * config/mips/mips.c (mips_regno_to_class): Change GR_REGS
- entries to LEA_REGS.
- (mips_global_pic_constant_p): New function.
- (override_options): Add 'e' register constraint.
- (mips_secondary_reload_class): Return LEA_REGS when reloading
- a dangerous constant into a class containing $25.
- * config/mips/mips.md (movdi_internal2): Add an e <- T alternative.
- (movsi_internal): Likewise.
-
- 2003-02-23 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (TARGET_SPLIT_CALLS): New macro.
- * config/mips/mips.md (call_split): New insn.
- (call_value_split, call_value_multiple_split): New insns.
- (call_internal): Turn into a define_insn_and_split. Split the
- instruction into a call and $gp load if TARGET_SPLIT_CALLS.
- (call_value_internal, call_value_multiple_internal): Likewise.
-
- 2003-02-23 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips_reloc_string): Return "%got(" for
- RELOC_GOT_PAGE and RELOC_GOT_DISP if !TARGET_NEWABI.
- (mips_encode_section_info): Don't take symbol visibility into
- account if TARGET_ABICALLS. Add more commentary.
- * config/mips/mips.md: Add commentary above reloc constants.
-
- 2003-02-12 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips_legitimize_const_move): New, extracted
- from mips_legitimize_move. Legitimize constant pool references.
- (mips_legitimize_move): Call mips_legitimize_const_move. Attach
- a REG_EQUAL note to the last instruction.
-
- 2003-02-11 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_simplify_dwarf_addr): Declare.
- * config/mips/mips.h (TARGET_EXPLICIT_RELOCS, TARGET_NEWABI): New.
- (ASM_SIMPLIFY_DWARF_ADDR): Define to mips_simplify_dwarf_addr.
- (EXTRA_CONSTRAINT): Allow symbolic call addresses for TARGET_ABICALLS.
- * config/mips/mips.md (UNSPEC_HIGH): New constant.
- (UNSPEC_RELOC_GPREL16): Rename to...
- (RELOC_GPREL16): ...this.
- (RELOC_GOT_HI, RELOC_GOT_LO, RELOC_GOT_PAGE, RELOC_GOT_DISP): New.
- (RELOC_CALL16, RELOC_CALL_HI, RELOC_CALL_LO): New.
- (macro_calls): New attribute.
- (length): Use it to set the default length of calls. Don't allow
- calls to have delay slots if macro_calls is "yes".
- (luisi, luidi): New patterns.
- (lowsi, lowdi): Use '%R' to print the relocation.
- (lowdi_extend): Remove.
- (loadgp): Remove mode from operand 0. Use '%0' instead of '%a0'.
- (call_internal): Merge alternatives. Always use "jal".
- (call_value_internal, call_value_multiple_internal): Likewise.
- (reloc_gprel16): Remove.
- * config/mips/mips.c (mips_got_alias_set): New variable.
- (mips_classify_constant): Handle the new relocation constants.
- (mips_classify_symbol): Reverse the sense of SYMBOL_REF_FLAG for PIC.
- (mips_symbolic_address_p): Return false if generating explicit relocs.
- Otherwise allow local PIC symbols to have an offset.
- (mips_splittable_symbol_p): New function.
- (mips_classify_address): Use it to check whether a LO_SUM is valid.
- (mips_const_insns): Always accept HIGH.
- (call_insn_operand): Don't accept global symbols if using explicit
- relocs.
- (move_operand): Don't accept HIGH when generating PIC.
- (mips_reloc, mips_lui_reloc): New functions.
- (mips_force_temporary): Remove MODE argument. Expect VALUE to
- be a valid right-hand-side for a SET pattern.
- (mips_load_got, mips_load_got16, mips_load_got32): New functions.
- (mips_emit_high): New function.
- (mips_legitimize_symbol): Use mips_reloc for the mips16 gp-relative
- case. Use mips_splittable_symbol_p to check whether a LO_SUM
- address should be used. Use mips_emit_high to generate the
- high part of such an address. Adjust the global symbol + offset
- case to match the change to mips_force_temprorary.
- (mips_legitimize_move): Shuffle call to mips_legitimize_symbol.
- If generating explicit-reloc PIC, load the address of global
- symbols from the GOT. Use mips_emit_high to emit the high part
- of an address.
- (mips_simplify_dwarf_addr): New function.
- (mips_move_1word): Use lwc1 instead of l.s and swc1 instead of s.s.
- (mips_move_2words): Likewise ldc1/l.d and sdc1/s.d if TARGET_64BIT.
- (mips_expand_call): Load the addresses of global functions using
- %call* relocs if generating explicit-reloc PIC. Don't generate
- an exception_receiver pattern.
- (override_options): Initialize mips_got_alias_set.
- (print_relocation): Remove in favor of...
- (mips_reloc_string): ...this new function.
- (print_operand): Handle '%R'. Use mips_reloc_string.
- (print_operand_address): Use print_operand to print the symbolic
- part of a LO_SUM address.
- (mips_output_function_prologue): Use .cprestore, reverting last patch.
- (mips_encode_section_info): Factor out DECL_RTL accesses. Reverse
- sense of SYMBOL_REF_FLAG for PIC, using binds_local_p to check
- for local symbols.
-
- 2003-02-02 Eric Christopher <echristo@redhat.com>
-
- * config/mips/mips.c (mips_sign_extend): Remove.
- * config/mips/mips-protos.h: Ditto.
- * config/mips/mips.md (movdi_internal2_extend): Remove.
- (extendsidi2): Fix mode of convert_memory_address.
-
- 2003-01-24 Eric Christopher <echristo@redhat.com>
-
- * config/mips/mips.md: Rewrite zero_extend* and extend*
- patterns. Use explicit instructions and split after reload
- for register extensions.
- (ashlsi3_internal1_extend): New combiner pattern for
- shift and extend combinations.
- * config/mips/mips.h: Change Pmode back to ptr_mode
- for performance enhancement.
- * combine.c (expand_compound_operation): Make sure
- that zero_extend operation is profitable.
-
- 2003-01-14 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (TRAMPOLINE_TEMPLATE): Make size of stored
- addresses depend on ptr_mode rather than Pmode.
- (TRAMPOLINE_SIZE, TRAMPOLINE_ALIGNMENT): Update acoordingly.
- (INITIALIZE_TRAMPOLINE): Rework to handle Pmode != ptr_mode.
- (CASE_VECTOR_MODE): Use ptr_mode for !TARGET_MIPS16.
- (ASM_OUTPUT_ADDR_VEC_ELT): Update accordingly.
- * config/mips/mips.md (tablejump): Likewise. Remove Pmode
- condition for selecting cpaddsi or cpadddi: use cpadd instead.
- (tablejump_internal1): Remove condition.
- (tablejump_internal2): Change condition to TARGET_64BIT.
- (cpaddsi): Rename to...
- (cpadd): ...this.
- (cpadddi): Remove.
-
- 2003-01-09 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips16_constant_after_function_p,
- mips_address_cost, mips_check_split, double_memory_operand,
- mips16_gp_offset, mips16_gp_offset_p, mips16_constant,
- pic_address_needs_scratch, symbolic_operand): Remove declarations.
- (mips_legitimate_address_p): Return bool.
- (mips_address_insns, mips_fetch_insns, mips_const_insns,
- mips_legitimize_address, mips_legitimize_move,
- mips_expand_call): Declare.
- (mips_return_addr): Move outside #ifdef RTX_CODE.
-
- * config/mips/mips.h (ABI_HAS_64BIT_SYMBOLS): New macro.
- (PIC_FN_ADDR_REG): New reg_class.
- (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add corresponding entries.
- (GR_REG_CLASS_P): True for PIC_FN_ADDR_REG.
- (SMALL_OPERAND, SMALL_OPERAND_UNSIGNED, LUI_OPERAND,
- CONST_HIGH_PART, CONST_LOW_PART, LUI_INT): New macros.
- (SMALL_INT, SMALL_INT_UNSIGNED, CONST_OK_FOR_LETTER_P): Use new macros.
- (EXTRA_CONSTRAINTS): Give new meanings to Q, R and S.
- (CONSTANT_ADDRESS_P): Use mips_legitimate_address_p.
- (LEGITIMATE_PIC_OPERAND): Undefine.
- (LEGITIMATE_CONSTANT_P): Use mips_const_insns.
- (LEGITIMIZE_ADDRESS): Use mips_legitimize_address.
- (CONSTANT_AFTER_FUNCTION_P): Remove definition in #if 0 block.
- (FUNCTION_MODE): Change to SImode.
- (CONST_COSTS): Use mips_const_insns to calculate the cost of
- most constants. Treat const_artih_operands specially if they
- occur in a PLUS or MINUS.
- (CONSTANT_POOL_COST): New macro.
- (RTX_COSTS): Use mips_address_insns for MEMs, with a base cost of 2.
- Add LO_SUM handling.
- (ADDRESS_COST): Undefine.
- (PREDICATE_CODES): Add symbolic_operand and const_arith_operand.
- Add CONST to the list of codes for arith_operand. Add LABEL_REF
- to call_insn_operand and remove CONST_INT.
-
- * config/mips/mips.c: Include integrate.h.
- (SINGLE_WORD_MODE_P): New macro.
- (mips_constant_type, mips_symbol_type, mips_address_type): New enums.
- (mips_constant_info, mips_address_info): New structs.
- (mips_regno_to_class): Map $25 to PIC_FN_ADDR_REG.
- (mips_classify_constant, mips_classify_symbol,
- mips_valid_base_register_p, mips_symbolic_address_p,
- mips_classify_address, mips_symbol_insns,
- mips16_unextended_reference_p, mips_address_insns, mips_const_insns,
- mips_fetch_insns, mips_force_temporary, mips_add_offset,
- mips_legitimize_symbol, mips_legitimize_address, mips_legitimize_move,
- mips_print_relocation): New functions.
- (const_arith_operand): New operand predicate.
- (arith_operand): Use it.
- (mips_const_double_ok, mips16_simple_memory_operand,
- simple_memory_operand, double_memory_operand, mips_check_split,
- mips_address_cost, pic_address_needs_scratch, mips16_gp_offset,
- mips16_gp_offset_p, mips16_output_gp_offset,
- mips16_constant_after_function_p, mips16_constant): Remove.
- (call_insn_operand): Be more fussy about symbolic constants.
- Use register_operand.
- (move_operand): Use mips_symbolic_address_p to check symbolic
- operands and general_operand to check the rest.
- (symbolic_operand): Use mips_classify_constant.
- (mips_legitimate_address_p): Use mips_classify_address.
- (mips_move_1word): Combine handling of symbolic addresses.
- Remove special treatment of gp-relative loads for TARGET_MIPS16.
- (move_move_2words): Likewise. Assume addresses are offsettable
- if they need to refer to more than one word. Add HIGH handling.
- (mips_restore_gp): Use ptr_mode for the GP save slot.
- (mips_expand_call): New function, combining the old mips.md
- call and call_internal define_expands. If the address isn't
- a call_insn_operand, force it into a register. For SVR4 PIC,
- emit an exception_receiver instruction after the call.
- (override_options): Only override flag_pic for TARGET_ABICALLS
- if it is currently zero. Allow mips_split_addresses when
- Pmode == DImode too, except when ABI_HAS_64BIT_SYMBOLS.
- Add new register class letter, 'c'.
- (print_operand): Use mips_classify_constant for constant operands.
- (print_operand_address): Use mips_classify_address.
- (mips_output_function_prologue): Don't use .cprestore.
- (mips_expand_epilogue): For TARGET_MIPS16, only adjust the stack
- via the frame pointer if current_function_calls_eh_return.
- (mips_encode_section_info): For TARGET_ABICALLS, use SYMBOL_REF_FLAG
- to mark whether a symbol is local or global.
- (build_mips16_call_stub): Expect the address of the function rather
- than a MEM reference to it. Update call generation sequences.
- (mips16_optimize_gp): Remove Pmode checks. Temporarily disable
- small-data adjustments.
-
- * config/mips/mips.md: Remove 'R'/'m' memory distinction. Use default
- length for loads and stores.
- (UNSPEC_CPADD, UNSPEC_RELOC_GPREL16): New constants.
- (define_attr type): Add const and prefetch.
- (define_attr length): Use mips_const_insns for const instructions.
- Use mips_fetch_insns for load and store instructions.
- (define_attr single_insn): New.
- (define_attr can_delay): Use it.
- (define_attr abicalls): Remove.
- (define_delay): Use can_delay. Always allow calls to have delay slots.
- (addsi3_internal_2): Add 'Q' constraint.
- (movsi_ulw, movsi_usw, movdi_uld, movdi_usd): Set length to 8.
- (high): Remove.
- (lowsi): Renamed from low.
- (lowdi): New pattern.
- (movdi, movsi): Use mips_legitimize_move. Remove define_split.
- (lwxc1, ldxc1, swxc1, sdxc1): Set length to 4.
- (loadgp): Change operand 0 to an immediate_operand.
- (tablejump): Use the same patterns for SVR4 PIC but emit a cpadd
- beforehand.
- (cpaddsi, cpadddi): New patterns.
- (tablejump_internal3, tablejump_internal4): Remove define_expands
- and associated define_splits.
- (call, call_value): Use mips_expand_call.
- (call_internal): New, replacing all existing call_internal* insns.
- (call_value_internal): Likewise call_value_internal*.
- (call_value_multiple_internal): Likewise call_value_multiple_internal*.
- (untyped_call): Remove if (operands[0]) magic.
- (prefetch_si_address, prefetch_si): Change type to "prefetch".
- (prefetch_di_address, prefetch_di): Likewise.
- (leasi, leadi): Remove.
- (reloc_gprel16): New.
-
- * config/mips/5400.md (ir_vr54_hilo): Include const type.
- * config/mips/5500.md (ir_vr55_hilo): Likewise.
- * config/mips/sr71k.md (ir_sr70_hilo): Likewise.
-
- 2003-01-08 Eric Christopher <echristo@redhat.com>
-
- * config.gcc (mipsisa32*): Change ABI_MEABI to ABI_EABI.
- * config/mips/elf.h (STARTFILE_SPEC): Remove ABI_MEABI references and
- configure check for libgloss.
- * config/mips/elf64.h: Ditto.
- * config/mips/mips.c: Remove ABI_MEABI.
- * config/mips/mips.h: Ditto.
-
- 2002-11-05 Richard Sandiford <rsandifo@redhat.com>
-
- Fix merge fallout.
- * config/mips/mips.md (mul_acc_si): Reapply 2002-10-16 change.
- (muldi3_internal): Remove outdated comment.
- (*muls_di, *umuls_di): Fix comment and 64-bitness.
- (*smsac_di, *umsac_di): Likewise. Reformat.
- (umulsi3_highpart): Minor formatting tweaks.
- (umulsi3_highpart_internal): Use only if !ISA_HAS_MULHI. Remove
- redundant scratch operand. Minor formatting tweak.
- (umulsi3_highpart_mulhi_internal): Use for !TARGET_64BIT as well.
- (umulsi3_highpart_neg_mulhi_internal): Likewise. Fix asm template.
- (smulsi3_highpart): As for the unsigned version.
- (smulsi3_highpart_internal): Likewise.
- (smulsi3_highpart_mulhi_internal): Likewise.
- (smulsi3_highpart_neg_mulhi_internal): Likewise.
- (smuldi3_highpart, umuldi3_highpart): Minor formatting tweaks.
- (*smul_acc_di): Remove duplicated pattern.
- (*umul_acc_di, *smul_acc_di): Reapply 2002-10-16 change.
- (anddi3) [unnamed mips16 pattern]: Remove reintroduced length.
- (zero_extendsidi2_internal2): Remove new, but commented-out pattern.
-
- 2002-10-22 Eric Christopher <echristo@redhat.com>
-
- * config/mips/mips-protos.h (mips_return_addr): New.
- * config/mips/mips.c (mips_return_addr): New.
- (movdi_operand): Remove.
- (se_register_operand): Ditto.
- (se_reg_or_0_operand): Ditto.
- (se_uns_arith_operand): Ditto.
- (se_arith_operand): Ditto.
- (se_nonmemory_operand): Ditto.
- (extend_operator): Ditto.
- (highpart_shift_operator): Ditto.
- (mips_initial_elimination_offset): Remove return address pointer
- elimination.
- (mips_reg_names): Remove $ra.
- (mips_regno_to_class): Ditto.
- * config/mips/mips.h (POINTER_SIZE): Define based on TARGET_LONG64
- and TARGET_64BIT.
- (POINTER_BOUNDARY): Remove.
- (POINTERS_EXTEND_UNSIGNED): Define to 0.
- (PROMOTE_MODE): Promote to Pmode.
- (SHORT_IMMEDIATES_SIGN_EXTEND): Define.
- (Pmode): Define to TARGET_64BIT.
- (FUNCTION_MODE): Define as Pmode.
- (mips_args): Remove deleted functions.
- (SIZE_TYPE): Depend on POINTER_SIZE.
- (PTRDIFF_TYPE): Ditto.
- (FIXED_REGISTERS): Fix extra registers.
- (CALL_USED_REGISTERS): Ditto.
- (CALL_REALLY_USED_REGISTERS): Ditto.
- (RAP_REG_NUM): Remove.
- (RETURN_ADDRESS_POINTER_REGNUM): Ditto.
- (RETURN_ADDR_RTX): Define to mips_return_addr.
- (ELIMINABLE_REGS): Remove RETURN_ADDRESS_POINTER_REGNUM.
- (CAN_ELIMINATE): Ditto.
- * config/mips/mips.md: For DImode patterns, take into account
- deletions above. Split mulsidi patterns into sign_extend and
- zero_extend.
-
- 2002-10-16 Richard Sandiford <rsandifo@redhat.com>
- Michael Meissner <meissner@redhat.com>
-
- * config/mips/mips.h (ISA_HAS_MACC): True for normal-mode vr4120 code.
- * config/mips/mips.md (mulsi3_mult3): Add a define_peephole2 to
- mop up unnecessarly moves through LO.
- (*mul_acc_si): Remove vr5400 and vr5500 handling from here.
- (*macc): New pattern for ISA_HAS_MACC. Add define_peephole2s to
- change mtlo/macc sequences into mul/add sequences when a three-
- address mul is available.
- (*macc2): New pattern. Add a define_peephole2 to generate it.
- (*mul_sub_si): Fix contraint for operand 5.
- (*muls): Use in 32-bit code as well.
- (*msac): Likewise. Use msub instead of msac in vr5500 code
- if the destination is LO. Remove duplicate define_split.
- (*muls_di): Use only in 32-bit code. Adjust rtl accordingly.
- (*msac_di): Likewise. Fix formatting.
- (smulsi3_highpart, umulsi3_highpart): Use mulhi in 32-bit code too.
- (*xmulsi3_highpart_internal): Use only if !ISA_HAS_MULHI.
- (*xmulsi3_highpart_mulhi): Use even if !TARGET_64BIT.
- (*xmulsi3_neg_highpart_mulhi): Likewise.
- (*mul_acc_64bit_di): Remove.
- (*mul_acc_di): Use only in 32-bit code. Handle ISA_HAS_MACC as well.
-
- 2002-10-14 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/vr.h (DRIVER_SELF_SPECS): Define.
- * config/mips/t-vr (MULTILIB_OPTIONS): Remove mlong32.
- (MULTILIB_DIRNAMES): Remove long32.
- (MULTILIB_EXCEPTIONS): Don't build -mabi=32 -mgp32 multilibs.
- (MULTILIB_REDUNDANT_DIRS): Remove.
-
- 2002-10-14 Richard Sandiford <rsandifo@redhat.com>
-
- * doc/tm.texi (DRIVER_SELF_SPECS): Document.
- * gcc.c (driver_self_specs): New variable.
- (do_self_spec): New function.
- (main): Use it to process driver_self_specs.
-
- 2002-10-09 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md (one_cmpldi2): Use only if TARGET_64BIT.
- Remove DImode define_split for !TARGET_64BIT.
- (anddi3): Remove !TARGET_64BIT support from here as well.
- Change operand 2's predicate to se_uns_arith_operand.
- Add constant alternatives to define_insn.
- (iordi3, xordi3, *nordi3): Likewise.
- (anddi3_internal1, xordi3_immed): Remove.
-
- 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (PROCESSOR_R4121): Rename to PROCESSOR_R4120.
- (TARGET_MIPS4121): Rename to TARGET_MIPS4120.
- * config/mips/mips.c (mips_cpu_info): Rename vr4121 to vr4120.
- * config/mips/mips.md: Apply same renaming here.
-
- 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (PROCESSOR_R4320, TARGET_MIPS4320): Remove.
- (GENERATE_MULT3_SI): Remove use of TARGET_MIPS4320.
- * config/mips/mips.c (mips_cpu_info): Remove vr4320 entry.
- * config/mips/mips.md (define_attr cpu): Remove r4320.
- Remove vr4320 scheduler and uses of TARGET_MIPS4320.
-
- 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips16_strings): New variable.
- (mips_output_function_epilogue): Clear the SYMBOL_REF_FLAG of every
- symbol in mips16_strings. Free the list.
- (mips_encode_section_info): Keep track of local strings.
-
- 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md (bunge, bltgt, bungt): New define_expands.
- (sordered_df, sordered_sf): Remove.
- * config/mips/mips.c (get_float_compare_codes): New fn.
- (gen_int_relational, gen_conditional_move): Use it.
-
- 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips-protos.h (mips_emit_fcc_reload): Declare.
- * config/mips/mips.h (PREDICATE_CODES): Add fcc_register_operand.
- * config/mips/mips.c (fcc_register_operand): New function.
- (mips_emit_fcc_reload): New function, extracted from reload_incc.
- (override_options): Allow TFmode values in float registers
- if ISA_HAS_8CC.
- * cnfig/mips/mips.md (reload_incc): Change destination prediate
- to fcc_register_operand. Remove misleading source constraint.
- Use mips_emit_fcc_reload.
- (reload_outcc): Duplicate reload_incc.
-
-
-2003-04-30 Diego Novillo <dnovillo@redhat.com>
-
- * builtins.def (BUILTIN_CONSTANT_P): Mark as constant.
-
-2003-04-30 Geoffrey Keating <geoffk@apple.com>
-
- * tree-inline.c (inlinable_function_p): Back out last change, it's
- unnecessary.
-
-2003-04-30 Steven Bosscher <steven@gcc.gnu.org>
-
- * ggc-page.c (TREE_EXP_SIZE): Define.
- (extra_order_size_table): New entry for expr trees with
- two operands.
-
-2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * c-common.c (if_elt): Use location_t in lieu of "file, line" pair.
- (c_expand_start_cond): Adjust.
- (c_expand_end_cond): Don't use warning_with_file_and_file.
- (shadow_warning): Likewise.
-
-2003-04-30 Nathan Sidwell <nathan@codesourcery.com>
-
- * tree.h (DECL_POINTER_DEPTH): Remove.
- (struct tree_decl): Remove pointer_depth.
-
-2003-04-30 Janis Johnson <janis187@us.ibm.com>
-
- * config/rs6000/linux64.h (ASM_OUTPUT_LABELREF): Remove.
- * config/rs6000/rs6000.c (rs6000_elf_strip_name_encoding): Remove.
- (rs6000_xcoff_encode_section_info): Remove.
- (current_file_function_operand): Use SYMBOL_REF_FLAGS; fix latent bug.
- (rs6000_output_mi_thunk): Remove dead code; use SYMBOL_REF_FLAGS.
- (small_data_operand, rs6000_emit_move, rs6000_elf_in_small_data_p,):
- Use SYMBOL_REF_FLAGS.
- (rs6000_elf_encode_section_info): Call default_encode_section_info for
- generic flags, use SYMBOL_REF_FLAGS; code cleanups.
- * sysv4.h (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
- (SYMBOL_FLAG_SMALL_V4, SYMBOL_REF_SMALL_V4_P): New.
- * xcoff.h (TARGET_ENCODE_SECTION_INFO): Remove.
- (ASM_DECLARE_FUNCTION_NAME): Remove setting of SYMBOL_REF_FLAG.
-
-2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * diagnostic.c (output_pointer): Use HOST_PTR_PRINTF.
-
-2003-04-30 Andreas Schwab <schwab@suse.de>
-
- * doc/extend.texi (Other Builtins): Enclose multiple word data
- type in braces for @deftypefn.
-
-2003-04-30 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stor-layout.c (mode_for_size_tree): Use BLKmode if SIZE overflows.
-
- * doc/install.texi (--enable-threads): Document "gnat" option.
-
-2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * diagnostic.h (output_formatted_scalar): Tweak.
- * diagnostic.c (output_long_decimal): Likewise.
- (output_unsigned_decimal): Likewise.
- (output_long_unsigned_decimal): Likewise.
- (output_octal): Likewise.
- (output_long_octal): Likewise.
- (output_hexadecimal): Likewise.
- (output_long_hexadecimal): Likewise.
- (output_pointer): New function.
- (output_format): Use it. Recognize "%p" format specifier.
-
-2003-04-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * function.c (purge_addressof_1): Postpone insn in fewer cases.
-
-2003-04-29 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/host-darwin.c (segv_handler): When -dH is used,
- call abort() after running out of stack space.
-
- * c-typeck.c (function_types_compatible_p): Ignore incompatible
- 'volatile' qualifiers on a function's return type in GNU mode.
-
-2003-04-29 Aldy Hernandez <aldyh@redhat.com>
-
- * expr.c (emit_group_load): Dump parallels of simd types to
- memory.
-
-2003-04-29 Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (add_vect): Check undefined value for range type
- too.
-
-2003-04-29 Phil Edwards <pme@gcc.gnu.org>
-
- * configure.in: More general test for cmp --ignore-initial.
- * configure: Regenerate.
-
-2003-04-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stor-layout.c (mode_for_size_tree): Use tree_low_cst.
- (layout_decl, place_field): Likewise.
- Also make minor type and whitespace changes.
-
- * tree.c (save_expr): Don't fold a COMPONENT_REF.
-
-2003-04-29 Olivier Hainque <hainque@act-europe.fr>
-
- * calls.c (expand_call): When modes of target and valreg match, force
- sibcall failure when target is a MEM.
-
-2003-04-29 Geoffrey Keating <geoffk@apple.com>
-
- * tree-inline.c (inlinable_function_p): Don't support inlining
- functions using varargs.
-
- * doc/invoke.texi (Overall Options): Mention -x objective-c-header.
-
- * dwarf2out.c (output_call_frame_info): No need to output EH
- unwind information if all_throwers_are_sibcalls.
-
- * c-semantics.c (expand_unreachable_stmt): Return a tree.
- (expand_stmt): Update for change to expand_unreachable_stmt.
- (expand_unreachable_if_stmt): Likewise.
-
- * Makefile.in (quickstrap): Pass BOOT_CFLAGS to submake.
-
-2003-04-29 Jason Merrill <jason@redhat.com>
-
- PR middle-end/10336
- * jump.c (never_reached_warning): Really stop looking if we reach
- the beginning of the function.
-
-2003-04-29 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/elf.h (SIZE_TYPE, PTRDIFF_TYPE, USER_LABEL_PREFIX):
- Remove redundant macros.
- (WCHAR_TYPE, WCHAR_TYPE_SIZE): Change to "short unsigned int".
- (LOCAL_LABEL_PREFIX): Define unconditionally.
- (NO_DOT_IN_LABEL): Clarify comment.
- * config/xtensa/linux.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Add explicit
- definition to "long int".
-
-2003-04-29 Alexander Kabaev <kan@FreeBSD.ORG>
-
- bootstrap/10452
- * gengtype-yacc.y: Improve portability.
-
-2003-04-29 Zack Weinberg <zack@codesourcery.com>
-
- * config.gcc: Install obsolete target list for GCC 3.3.
- * doc/install.texi: Mention in specific-target instructions
- that certain configurations are deprecated.
-
-2003-04-29 Zack Weinberg <zack@codesourcery.com>
-
- * tree.h: Delete no-checking definition of CST_OR_CONSTRUCTOR_CHECK.
-
-2003-04-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- * c-pragma.c (maybe_apply_renaming_pragma): Fix typo.
- * gcc.c (display_help): Likewise.
- * toplev.c (f_options): Likewise.
- * params.def (PARAM_MAX_INLINE_SCOPE): Likewise.
- * config/c4x/c4x.h (TARGET_SWITCHES): Likewise.
- * config/mcore/mcore.h (TARGET_SWITCHES): Likewise.
- * config/s390/s390.h (TARGET_SWITCHES): Likewise.
- * config/v850/v850.h (TARGET_SWITCHES): Likewise.
-
-2003-04-29 J"orn Rennecke <joern.rennecke@superh.com>
-
- * varasm.c (default_assemble_visibility): Use assemble_name.
-
-2003-04-29 David O'Brien <obrien@FreeBSD.org>
-
- * config/i386/freebsd64.h (LINK_SPEC): Mirror FreeBSD linker.
- * config/rs6000/freebsd.h (LINK_SHLIB_SPEC): New macro.
- (SIZE_TYPE): New macro.
- * config/i386/freebsd-aout.h (NO_PROFILE_COUNTERS): New macro.
- (SET_ASM_OP): New macro.
- (HANDLE_SYSV_PRAGMA): New macro.
- (ASM_WEAKEN_LABEL): New macro.
-
-2003-04-28 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/10180
- * tree-inline.c (expand_call_inline): Call push_srcloc when
- encountering EXPR_WITH_FILE_LOCATION. Honor warn_inline.
-
-2003-04-28 Mike Stump <mrs@apple.com>
-
- * gdbinit.in: Update to reflect new identifier structure.
-
-2003-04-28 Zack Weinberg <zack@codesourcery.com>
-
- * tree.h (TREE_CST_RTL, CST_OR_CONSTRUCTOR_CHECK): Delete.
- (struct tree_int_cst, struct tree_real_cst, struct tree_string,
- struct tree_complex, struct tree_vector): Remove RTL field.
- (CONSTRUCTOR_ELTS): Use elt 0.
- * tree.def (CONSTRUCTOR): Delete first of its two operands.
- * varasm.c (output_constant_def): Remove early exit if
- TREE_CST_RTL is set. Don't set TREE_CST_RTL.
- (decode_addr_const): Don't mention TREE_CST_RTL in comment.
- * target.h (select_section): Don't mention TREE_CST_RTL in comment.
- * doc/tm.texi (encode_section_info): Don't talk about TREE_CST_RTL.
-
-2003-04-28 Jakub Jelinek <jakub@redhat.com>
-
- * c-decl.c (finish_decl): When prototype with asmspec is found
- for built-in, adjust built_in_decls as well as expr.c decls.
- * expr.c (init_block_move_fn, init_block_clear_fn): New functions.
- (emit_block_move_libcall_fn, clear_storage_libcall_fn): Use it.
- * expr.c (init_block_move_fn, init_block_clear_fn): New prototypes.
-
-2003-04-28 Richard Henderson <rth@redhat.com>
-
- * config/sparc/sparc.c (print_operand): Add 's' to sign-extend.
- * config/sparc/sparc.md (const_mulsidi3_v8plus): Fix mode of
- integral constant mult operand.
- (const_mulsidi3_sp32, const_mulsidi3_sp64): Likewise.
- (const_smulsi3_highpart_v8plus): Likewise.
- (const_smulsi3_highpart): Likewise.
- (const_umulsidi3_sp32): Likewise; sign-extend it in the output.
- (const_umulsidi3_sp64, const_umulsidi3_v8plus): Likewise.
- (const_umulsi3_highpart_v8plus): Likewise.
- (const_umulsi3_highpart): Likewise.
-
-2003-04-28 David O'Brien <obrien@FreeBSD.org>
-
- * config/i386/x86-64.h (NO_PROFILE_COUNTERS, HAVE_AS_DWARF2_DEBUG_LINE):
- Define as 1.
-
-2003-04-28 David O'Brien <obrien@FreeBSD.org>
-
- * config/i386/i386.h (builtin_define): Add __amd64 and __amd64__.
-
-2003-04-28 Jakub Jelinek <jakub@redhat.com>
-
- * builtins.def (BUILT_IN_BCOPY, BUILT_IN_MEMMOVE): New.
- * builtin-types.def (BT_FN_VOID_CONST_PTR_PTR_SIZE): New.
- * builtins.c (expand_builtin_memmove, expand_builtin_bcopy): New
- functions.
- (expand_builtin): Handle BUILT_IN_BCOPY and BUILT_IN_MEMMOVE.
-
-2003-04-28 Nick Clifton <nickc@redhat.com>
-
- * config/arm/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Remove definition.
-
-2003-04-27 Zack Weinberg <zack@codesourcery.com>
-
- * expr.c (expand_expr <COMPLEX_CST, STRING_CST>): Always call
- output_constant_def, use its result instead of TREE_CST_RTL (exp).
- Can assume it has the form (mem (symbol_ref ".LCxxx")).
- (expand_expr <COMPONENT_REF>): Can always just extract the
- relevant field of a CONSTRUCTOR.
- (expand_expr <ARRAY_REF, COMPONENT_REF, BIT_FIELD_REF,
- ARRAY_RANGE_REF>): Make control flow explicit.
- * varasm.c (output_constant_def): Can look at TREE_CST_RTL of
- an INTEGER_CST.
-
-2003-04-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * reload1.c (reg_set_luid): Fix a comment typo.
-
-2003-04-27 Zack Weinberg <zack@codesourcery.com>
-
- * varasm.c (const_str_htab_hash, const_str_htab_eq, STRHASH,
- struct deferred_string, const_str_htab): Kill.
- (n_deferred_strings): New static variable.
- (build_constant_desc): Set SYMBOL_REF_DECL of the new
- symbol_ref to point to the constant.
- (output_constant_def): When a deferred string is forced out,
- just clear STRING_POOL_ADDRESS_P and decrement n_deferred_strings.
- (mark_constant): Likewise.
- (maybe_output_constant_def_contents): When deferring a string
- constant, just set STRING_POOL_ADDRESS_P and increment
- n_deferred_strings.
- (mark_constant_pool): Check n_deferred_strings, not the size
- of const_str_htab.
- (init_varasm_once): No need to create const_str_htab.
-
- * rtl.def, rtl.h, doc/rtl.texi: Document possibility that
- SYMBOL_REF_DECL points to a constant.
-
-2003-04-26 Zack Weinberg <zack@codesourcery.com>
-
- * varasm.c (output_constant_def): Split out two new static
- functions, build_constant_desc and maybe_output_constant_def_contents.
- Restructure for comprehensibility. Don't call
- output_addressed_constants. Treat defstr being non-NULL for
- STRING_POOL_ADDRESS_P constants as an invariant.
- (struct deferred_string): Remove labelno field.
- (output_constant_def_contents): Kill labelno argument. Call
- output_addressed_constants here. Use ASM_OUTPUT_LABEL, not
- asm_out.internal_label.
- (mark_constant): Update call to output_constant_def_contents.
- Treat defstr being non-NULL for STRING_POOL_ADDRESS_P
- constants as an invariant.
-
-2003-04-26 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.c (output_pic_addr_const): Use SYMBOL_REF_LOCAL_P.
- (ix86_expand_call, ix86_rtx_consts): Likewise.
-
-2003-04-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * doc/md.texi (cmpstr): Document additional restrictions.
-
-2003-04-26 Neil Booth <neil@daikokuya.co.uk>
-
- * flags.h (time_report): Remove.
- * timevar.c (timevar_enable): New.
- (TIMEVAR_ENABLE): Remove, use timevar_enable.
- (timevar_init): Rename from init_timevar.
- * timevar.h (timevar_init): Rename from init_timevar.
- * toplev.c (time_report): Make static.
- (do_compile): Conditionally call init_timevar first.
- (preprocess_options): Move some code to do_compile.
-
-2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
-
- * doc/install.texi (Binaries): Mention binaries for HC11/HC12.
-
-2003-04-26 Neil Booth <neil@daikokuya.co.uk>
-
- * _cpp_lex_direct: Remove pointless code.
-
-2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
-
- * doc/extend.texi (Function Attributes): Document "near" and "far"
- for 68HC11 and 68HC12.
-
-2003-04-25 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (store_field): When making temporary for store, don't
- make it TYPE_QUAL_CONST.
-
-2003-04-25 Phil Edwards <pme@gcc.gnu.org>
-
- * toplev.c (read_integral_parameter): Use "argument" in error
- message to distinguish it from actual invalid options.
-
-2003-04-25 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Back out previous
- addition of __PIC__ and __pic__ macros.
- * config/xtensa/xtensa.h: Clean up indentation.
-
-2003-04-25 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Remove definition of
- _GNU_SOURCE. Add definitions of __PIC__ and __pic__.
- (SUBTARGET_CPP_SPEC): Define.
- (LIB_SPEC): Delete.
- * config/xtensa/xtensa-protos.h (xtensa_declare_object): Delete.
- * config/xtensa/xtensa.c (xtensa_declare_object): Delete.
- * config/xtensa/xtensa.h (CPP_SPEC, SUBTARGET_CPP_SPEC, EXTRA_SPECS):
- Define.
- (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Delete.
- (ASM_OUTPUT_ALIGNED_BSS, BSS_SECTION_ASM_OP): Define.
-
-2003-04-25 H.J. Lu <hjl@gnu.org>
-
- * config/ia64/ia64.c (ia64_expand_compare_and_swap): Add rmode
- for return mode.
- (ia64_expand_builtin): Set rmode to SImode for
- IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI,
- IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI and
- IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI. Set remode to DImode
- for IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI.
-
-2003-04-25 Phil Edwards <pme@gcc.gnu.org>
-
- * configure.in (make_compare_target): Test for GNU cmp and set this
- variable appropriately.
- * Makefile.in (compare, compare3, compare4, compare-lean, compare3-lean,
- compare4-lean): Rename actual targets to slowcompare*. New compare*
- targets depend on names based on make_compare_target.
- * configure: Regenerated.
-
-2003-04-25 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (ia64_compute_frame_size): Allow inline asm
- to clobber ar.pfs and ar.unat.
- (ia64_expand_prologue): Force alloc instruction if ar.pfs saved;
- fix test for spilling ar.pfs to the stack.
-
-2003-04-25 Richard Henderson <rth@redhat.com>
-
- PR opt/10315
- * config/rs6000/rs6000.c (rs6000_emit_move): Only elide proper
- checks during reload; use validize_mem instead of adjust_address.
-
-2003-04-26 Ben Elliston <bje@wasabisystems.com>
-
- * config/arm/arm.c (arm_adjust_cost): Correct logic that tests the
- return values from recog_memoized().
-
-2003-04-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR opt/8705
- * gcse.c (try_replace_reg): On a successful substitution of a constant
- into a single set, try to simplify the source of the set.
- * loop.c (scan_loop): Don't try to optimize a MODE_CC set with a
- constant source.
-
-2003-04-24 Neil Booth <neil@daikokuya.co.uk>
-
- * cpplex.c (cpp_token_len): Tighten up.
- (cpp_token_as_text): Need extra byte now.
- * cpplib.c (glue_header_name): Need extra 2 bytes.
- * cppmacro.c (cpp_macro_definition): Need extra byte.
-
-2003-04-24 Alexander Kabaev <kan@FreeBSD.ORG>
-
- * config/sparc/sparc.md (umulsidi3, mulsidi3): Avoid using
- const_umulsidi3_sp32 and const_mulsidi3_sp32 on 64bit targets
- where they might be not present. Use their _sp64 equivalent
- instead.
-
-Thu Apr 24 20:42:12 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.md (cvtsi2sdq): Fix typo in previous patch.
-
-2003-04-24 Krister Walfridsson <cato@df.lth.se>
-
- * configure.in: Check whether mbstowcs works.
- * configure, config.in: Regenerate.
- * intl.c: Use HAVE_WORKING_MBSTOWCS.
-
-2003-04-24 H.J. Lu <hjl@gnu.org>
-
- * config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di
- for __sync_bool_compare_and_swap_di for int return type.
-
- * config/ia64/ia64intrin.h (__sync_bool_compare_and_swap_di):
- Change return type to int.
- (__sync_bool_compare_and_swap): Likewise.
-
-Thu Apr 24 16:55:26 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * cfgbuild.c (make_edges): Do not use next_nonnote_insn when
- looking for fallthru edge.
-
- * athlon.md (athlon-agu, athlon-store, athlon-fany, athlon-faddmul):
- Fix.
- (athlon-load2, athlon-store2, athlon-fpsched, athlon-fpload,
- athlon-fvector): New.
- (athlon_*): Revisit to match new optimization guide.
- * i386.c (ix86_adjust_cost): Fix memory operand costs on Athlon/k8
- * i386.md (cvt??2?? patterns): Fix modes.
- (fistp patterns): Set modes.
-
- Accidentaly commited with my earlier reload patch:
- PR c/10308
- * reload.c (find_reloads_address_1): Reload plus at the place of
- index register.
-
-2003-04-24 Nathan Sidwell <nathan@codesourcery.com>
-
- New GCOV_TAG_FUNCTION layout
- * coverage.c (struct function_list): Replace name with ident.
- (struct counts_entry): Likewise.
- (fn_ident): New.
- (htab_counts_entry_hash, htab_counts_entry_eq,
- htab_counts_entry_del): Adjust.
- (reads_count_file, get_coverage_counts,
- coverage_begin_output, coverage_end_function): Adjust.
- (build_fn_info_type, build_fn_info_value): Likewise.
- * gcov-dump.c (tag_function): Adjust.
- * gcov-io.c (gcov_write_string, gcov_read_string): Not in LIBGCOV.
- * gcov-io.h (gcov_write_string, gcov_read_string): Not in LIBGCOV.
- * gcov.c (struct function_info): Add ident.
- (read_graph_file, read_count_file): Adjust.
- * libgcov.c (gcov_exit): Adjust.
-
-2003-04-23 Richard Henderson <rth@redhat.com>
-
- PR opt/8300
- * toplev.c (rest_of_compilation): Delay no_new_pseudos until
- after initialize_uninitialized_subregs; update reg info assuming
- new pseudos were created.
-
-2003-04-23 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (c-lex.o, LIBCPP_OBJS, cpplex.o): Update.
- * c-lex.c (MULTIBYTE_CHARS): Remove conditionals.
- (lex_string): Take cpp_string with full spelling.
- (cb_ident): Update.
- (c_lex): Update diagnostics.
- * cpplex.c (SPELL_NUMBER, SPELL_STRING): Combine into SPELL_LITERAL.
- (create_literal): New.
- (lex_string): Unterminated literals have type CPP_OTHER.
- (_cpp_lex_direct): Update calls to lex_string. Use create_literal
- for CPP_OTHER.
- (cpp_token_len, cpp_spell_token, cpp_output_token): Simplify.
- (_cpp_equiv_tokens, cpp_interpret_charconst): Update.
- * cpplib.c (parse_include, do_line, do_linemarker,
- destringize_and_run): Update for token storing full spelling.
- * cpplib.h: Update token spelling types.
- * cppmacro.c (stringify_arg, check_trad_stringification):
- Update for token storing full spelling.
-
-2003-04-23 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_expand_cmpstr): Disable CLC loop.
-
-2003-04-23 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.h (TARGET_OPTIONS): Add value field.
-
-2003-04-23 Mark Mitchell <mark@codesourcery.com>
-
- * doc/extend.texi: Remove duplicate 2003 copyright date.
-
-2003-04-23 Nathan Sidwell <nathan@codesourcery.com>
-
- * Makefile.in (LIBGCC_DEPS): Add gcov headers.
- (libgcov.a): Depends on LIBGCC_DEPS.
- * basic-block.h (profile_info): Moved here from coverage.h. Made
- a pointer.
- * coverage.c (struct function_list): Fixed array of counter types.
- (struct counts_entry): Keyed by counter type, contains summary.
- (profile_info): Moved to profile.c.
- (prg_ctr_mask, prg_n_ctrs, fn_ctr_mask, fn_n_ctrs): New global
- vars.
- (profiler_label): Remove.
- (ctr_labels): New.
- (set_purpose, label_for_tag, build_counter_section_fields,
- build_counter_section_value, build_counter_section_data_fields,
- build_counter_section_data_values, build_function_info_fields,
- build_function_info_value, gcov_info_fields, gcov_info_value): Remove.
- (build_fn_info_type, build_fn_info_value, build_ctr_info_type,
- build_ctr_info_value, build_gcov_info): New.
- (htab_counts_entry_hash, htab_counts_entry_eq): Adjust.
- (reads_counts_file): Adjust.
- (get_coverage_counts): Takes counter number. Add summary
- parameter. Adjust.
- (coverage_counter_ref): Tkaes counter number. Adjust. Lazily
- create counter array labels.
- (coverage_end_function): Adjust.
- (create_coverage): Adjust.
- (find_counters_section): Remove.
- * coverage.h (MAX_COUNTER_SECTIONS): Remove.
- (struct section_info, struct profile_info): Remove.
- (profile_info): Moved to basic-block.h.
- (coverage_counter_ref): Takes a counter number.
- (get_coverage_counts): Takes a counter number. Added summary
- parameter.
- (find_counters_section): Remove.
- * gcov-dump.c (tag_arc_counts): Rename to ...
- (tag_counters): ... here. Adjust.
- (tag_table): Move tag_counters to 3rd entry. Remove
- PROGRAM_PLACEHOLDER and PROGRAM_INCORRECT entries.
- (dump_file): Check for counter tag values here.
- (tag_summary): Adjust.
- * gcov-io.c (gcov_write_summary, gcov_read_summary): Adjust.
- * gcov-io.h (GCOV_LOCKED): New.
- (GCOV_TAG_ARC_COUNTS): Rename to ...
- (GCOV_TAG_COUNTS_BASE): ... here.
- (GCOV_TAG_PLACEHOLDER_SUMMARY, GCOV_TAG_INCORRECT_SUMMARY):
- Remove.
- (GCOV_COUNTER_ARCS, GCOV_COUNTERS, GCOV_NAMES): New.
- (GCOV_TAG_FOR_COUNTER, GCOV_COUNTER_FOR_TAG,
- GCOV_TAG_IS_COUNTER): New.
- (struct gcov_ctr_summary): New.
- (struct gcov_summary): Adjust.
- (struct gcov_counter_section): Remove.
- struct gcov_counter_section_data): Remove.
- (struct gcov_function_info): Rename to ...
- (struct gcov_fn_info): ... here. Adjust.
- (struct gcov_ctr_info): New.
- (struct gcov_info): Adjust.
- * gcov.c (read_count_file): Adjust.
- (output_lines): Adjust.
- * libgcov.c (gcov_exit): Adjust.
- (__gcov_flush): Adjust.
- * mklibgcc.in (libgcc2_c_dep): Add gcov headers.
- * predict.c (maybe_hot_bb_p, probably_cold_bb_p,
- probably_never_executed_bb_p, compute_frequency_function): Adjust
- profile_info use.
- * profile.c (struct counts_entry): Remove.
- (profile_info): Define here.
- (get_exec_counts): Adjust get_coverage_counts call.
- (compute_branch_probablilities): Remove find_counters_section
- call.
- (gen_edge_profiler): Adjust coverage_counter_ref call.
- * tracer.c (tail_duplicate): Adjust profile_info use.
-
-2003-04-23 Roger Sayle <roger@eyesopen.com>
-
- PR optimization/10339
- * builtins.c (expand_builtin_strcmp): Try to emit cmpstrsi insn
- directly instead of unsafely transforming call into a memcmp.
- (expand_builtin_strncmp): Likewise.
-
-2003-04-22 Roger Sayle <roger@eyesopen.com>
-
- * alias.c (mark_constant_function): Check for constancy and
- purity even of void functions. Update both the function decl
- and the cgraph RTL info with the results.
-
-2003-04-22 Roger Sayle <roger@eyesopen.com>
-
- * real.c (do_add): Change to return a bool indicating that the
- result of the operation may be inexact due to loss of precision.
- (do_multiply): Likewise.
- (do_divide): Likewise.
-
-2003-04-22 Geoffrey Keating <geoffk@apple.com>
- Loren James Rittle <ljrittle@acm.org>
-
- * dwarf2out.c (fde_table_allocated): Mark with GTY.
- (decl_die_table_allocated): Likewise.
- (abbrev_die_table_allocated): Likewise.
- (line_info_table_allocated): Likewise.
- (separate_line_info_table_allocated): Likewise.
- (pubname_table_allocated): Likewise.
- (arange_table_allocated): Likewise.
- (ranges_table_allocated): Likewise.
- (decl_die_table_in_use): Unconditionalize; mark with GTY.
- (abbrev_die_table_in_use): Likewise.
- (line_info_table_in_use): Likewise.
- (separate_line_info_table_in_use): Likewise.
- (pubname_table_in_use): Likewise.
- (arange_table_in_use): Likewise.
- (ranges_table_in_use): Likewise.
- (have_location_lists): Likewise.
- (emitcount): New GTY-marked static, moved...
- (maybe_emit_file): ...from here.
- (label_num): New GTY-marked static, moved...
- (gen_internal_sym): ...from here.
-
-2003-04-22 Richard Henderson <rth@redhat.com>
-
- PR 8866
- * rtl.h (MEM_NOTRAP_P): New.
- (MEM_COPY_ATTRIBUTES): Copy it.
- * rtlanal.c (may_trap_p): Check it.
- * expr.c (do_tablejump): Set it.
- * doc/rtl.texi (Flags): Document it.
-
- * cfgrtl.c (try_redirect_by_replacing_jump): Revert last three changes.
-
-2003-04-22 Olivier Hainque <hainque@act-europe.fr>
-
- * config/alpha/alpha.c (alpha_expand_prologue [OPEN_VMS_ABI]): Don't
- set FRP on stack adjustment for outgoing args if frame_pointer_needed.
-
-2003-04-22 Vincent Celier <celier@gnat.com>
-
- * gthr-gnat.h, gthr-gnat.c: new sources for implementation of
- --enable-threads=gnat.
- * Makefile.in: Add gthr-gnat.c to LIB2ADDEH.
- * configure.in: Add gnat to the list of thread packages
- * configure: Rebuild.
- * config/t-linux: Add gthr-gnat.c to LIB2ADDEH and LIB2ADDEHDEP
-
-2003-04-22 Neil Booth <neil@daikokuya.co.uk>
-
- * cpplex.c (_cpp_get_fresh_line): Pop the buffer if return_at_eof.
-
-2003-04-22 Devang Patel <dpatel@apple.com>
-
- * cpptrad.c (_cpp_replacement_text_len): Add check for macro
- parameter count.
- (_cpp_copy_replacement_text): Same.
-
-2003-04-22 Neil Booth <neil@daikokuya.co.uk>
-
- * c-lex.c (c_lex): Handle CPP_OTHER differently.
- * cppexp.c (_cpp_parse_expr): Similarly.
- * cpplex.c (SPELL_CHAR): Remove.
- (_cpp_lex_direct): Stray chars are saved as byte strings.
- (cpp_spell_token, cpp_output_token, _cpp_equiv_token): Don't
- handle SPELL_CHAR.
- (cpp_avoid_paste): Update handling of CPP_OTHER.
- * cpplib.h: Spell CPP_OTHER like a number.
- (struct cpp_token): Remove member c.
- * cppmacro.c (stringify_arg): Update handling of CPP_OTHER.
-
-2003-04-22 David Turner <novalis@gnu.org>
-
- * gbl-ctors.h: Add special license exception.
- * libgcc2.h: Likewise.
- * tsystem.h: Likewise.
- * gcov-io.h: Likewise.
-
-2003-04-22 David Edelsohn <edelsohn@gnu.org>
-
- * fold-const.c (fold_range_test): Use RANGE_TEST_NON_SHORT_CIRCUIT
- macro defaulting to original BRANCH_COST heuristic.
- * doc/tm.texi (RANGE_TEST_NON_SHORT_CIRCUIT): Document.
-
- * config/rs6000/rs6000.h (RANGE_TEST_NON_SHORT_CIRCUIT): Define.
-
-2003-04-22 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/t-spe: Merge in t-fprules into file.
-
- * config.gcc: Add t-spe to powerpc-eabispe.
-
-2003-04-22 Kean Johnston <jkj@sco.com>
-
- * tlink.c (recompile_files): Add missing '=' to putenv calls
-
-2003-04-22 Nathan Sidwell <nathan@codesourcery.com>
-
- * ginclude/stddef.h: Provide C++ safe offsetof.
-
-2003-04-22 J"orn Rennecke <joern.rennecke@superh.com>
-
- * function.c (purge_addressof_1): In (mem (addressof (reg))) case
- for reg notes, if there are no substitutions, just use a SUBREG.
-
-2003-04-21 Mark Mitchell <mark@codesourcery.com>
-
- * Makefile.in (calls.o): Depend on except.h.
- * calls.c: Include except.h.
- (emit_call_1): Call note_eh_region_may_contain_throw if
- appropriate.
- * except.c (eh_region): Add may_contain_throw.
- (expand_eh_region_end_cleanup): Do not include handler code when
- it cannot be reached.
- (note_eh_region_may_contain_throw): New function.
- * except.h (note_eh_region_may_contain_throw): New function.
-
-2003-04-21 Mark Mitchell <mark@codesourcery.com>
-
- * config/i386/winnt.c (i386_pe_mark_dllimport): Revert previous
- changes.
-
-2003-04-21 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_override_options): No SPE means
- 64-bit long doubles.
-
-2003-04-21 Olivier Hainque <hainque@act-europe.fr>
-
- * fold-const.c (fold, case PLUS_EXPR and case MULT_EXPR): Restore
- a number of conversions required for type consistency and previously
- stripped off by STRIP_NOPS.
-
- * calls.c (expand_call): Prevent sibcall optimization for calls to
- nested subprograms.
-
- * expmed.c (extract_bit_field): Reverse operands of && condition to
- prevent a potential division by zero in the previously first branch.
- * config/pa/pa.md (extv, extzv): FAIL if the bitfield length is zero.
-
-2003-04-21 Joel Brobecker <brobecker@gnat.com>
-
- * dwarf2out.c (is_ada, is_ada_subrange_type): New functions.
- (subrange_type_die): Likewise.
- (modified_type_die): Emit a subrange_type DIE for Ada subrange types.
- (is_c_family, is_cxx, is_java, is_fortran): Return bool and clean up.
-
-2003-04-21 Nathan Sidwell <nathan@codesourcery.com>
-
- Break out coverage routines to new file.
- * Makefile.in (COVERAGE_H): New variable
- (C_OBJS): Add coverage.o
- (coverage.o): New target.
- (profile.o, loop-init.o, sched-ebb.o, predict.o, tracer.o): Adjust
- dependencies.
- (GTFILES): Adjust.
- (gt-coverage.h): New target.
- (gt-profile.h): Remove.
- * profile.h: Remove. Move to ...
- * coverage.h: ... here. New. #include gcov-io.h.
- * gcov-io.h: Move function definitions to ...
- * gcov-io.c: ... here. New.
- * profile.c: Move coverage routines to coverage.c.
- (instrument_edges, get_exec_counts, branch_prob, init_branch_prob,
- end_branch_prob): Adjust.
- * coverage.c: New. Coverage routines from profile.c
- (coverage_counter_ref, coverage_init, coverage_finish,
- coverage_end_function, coverage_begin_output,
- coverage_counter_ref, get_coverage_counts): Define.
- * gcov-dump.c, gcov.c: #include gcov-io.c.
- * libgcov.c: Likewise. Adjust.
- * loop-init.c: Don't #include profile.h
- * tracer.c, predict.c, sched-ebb.c: Adjust #includes.
- * rtl.h: Add coverage prototypes.
- * toplev.c (compile_file): Init coverage, not branch_prob.
- Always call coverage_finish.
- (rest_of_compilation): Call coverage_end_function.
-
-2003-04-21 Matt Kraai <kraai@alumni.cmu.edu>
-
- * config/rs6000/rs6000.md (*movsf_softfloat): Add "h" <- "0" case.
-
-2003-04-21 Neil Booth <neil@daikokuya.co.uk>
-
- * c-ppoutput.c (cb_include): Don't take a cpp_token.
- * cppfiles.c: Don't undef strcmp.
- (find_include_file): Don't take a cpp_token. Check for empty
- file names.
- (_cpp_execute_include, _cpp_compare_file_date): Don't take a cpp_token.
- (cpp_push_include): Simplify.
- * cpphash.h (_cpp_execute_include, _cpp_compare_file_date): Update.
- * cpplib.c (glue_header_name): Return the file name, not a cpp_token.
- (parse_include): Similary. Don't check for zero-length filenames.
- (do_include_common, do_pragma_dependency): Update accordingly.
- * cpplib.h (struct cpp_callbacks): Change prototype of include.
-
-2003-04-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * doc/rtl.texi (RTX_UNCHANGING_P): Point to true_dependence for
- details of conflict handling.
-
- * fold-const.c (extract_muldiv, case CONVERT_EXPR): Detect case
- when conversion overflows.
-
- * stor-layout.c (layout_decl): Don't set DECL_SIZE_UNIT if already set.
-
- * expr.c (store_constructor): Set RTX_UNCHANGING_P if readonly_field_p
- before clearing.
-
-2003-04-21 Mark Mitchell <mark@codesourcery.com>
-
- * config/i386/winnt.c (i386_pe_mark_dllimport): Make the new RTL
- have the same form as the old RTL.
-
-2003-04-21 Andreas Jaeger <aj@suse.de>
-
- * cppcharset.c (_cpp_valid_ucn): Cast field precision to int.
-
-2003-04-20 Chris Lattner <sabre@nondot.org>
- Zack Weinberg <zack@codesourcery.com>
-
- * c-common.h, c-semantics.c: Rename genrtl_decl_cleanup to
- genrtl_cleanup_stmt. Correct comment at head of
- genrtl_cleanup_stmt (no such thing as a DECL_CLEANUP).
-
- * stmt.c (struct nesting): Kill n_function_calls.
- (expand_start_bindings): Don't set
- thisblock->data.block.n_function_calls.
- (expand_end_bindings): Compare function_call_count against 0.
- (expand_cleanups): Kill DONT_DO argument; all callers passed
- NULL_TREE. All callers updated to match.
-
-2003-04-20 Zack Weinberg <zack@codesourcery.com>
-
- * varasm.c (struct deferred_constant, defer_addressed_constants_flag)
- (defer_addressed_constants, output_deferred_addressed_constants): Kill.
- (output_constant_def): Remove code predicated on
- defer_addressed_constants_flag.
-
- * output.h: Remove prototypes of deleted functions.
- * c-typeck.c (constructor_subconstants_deferred): Kill.
- (struct initializer_stack): Remove 'deferred' field.
- (start_init): Remove all references to the above.
- (finish_init): Likewise. Also remove never-executed call to
- output_deferred_addressed_constants. Pull assignment to
- defstr out of if expression.
-
-2003-04-20 Neil Booth <neil@daikokuya.co.uk>
-
- * cpphash.h (NOTE_ESC_NL, NOTE_ESC_SPACE_NL, NOTE_TRIGRAPH,
- NOTE_NEWLINE): Remove.
- * cpplex.c (_cpp_clean_line, _cpp_process_line_notes): Update
- to handle new form of line note type.
-
-2003-04-20 Zack Weinberg <zack@codesourcery.com>
-
- * target.h (encode_section_info): Add new argument carrying
- the RTL to be modified by the hook.
-
- * varasm.c (make_decl_rtl, output_constant_def): Update calls
- to encode_section_info.
- (default_encode_section_info): Take and use RTL argument,
- don't use TREE_CST_RTL or DECL_RTL.
- * output.h: Update prototype of default_encode_section_info.
- * config/darwin.h (ASM_DECLARE_OBJECT_NAME)
- (ASM_DECLARE_FUNCTION_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL):
- Update calls to encode_section_info.
-
- * config/darwin.c, config/arm/arm.c, config/arm/pe.c
- * config/h8300/h8300.c, config/i386/winnt.c, config/m32r/m32r.c
- * config/m68hc11/m68hc11.c, config/m88k/m88k.c, config/mcore/mcore.c
- * config/mips/mips.c, config/mmix/mmix.c, config/pa/pa.c
- * config/romp/romp.c, config/rs6000/rs6000.c, config/s390/s390.c
- * config/v850/v850.c (TARGET_ENCODE_SECTION_INFO definitions):
- Take and use RTL argument, don't use TREE_CST_RTL or DECL_RTL,
- except for PE dllimport/dllexport. Update calls to
- default_encode_section_info.
-
- * config/darwin-protos.h, config/arm/arm-protos.h, config/i386-protos.h:
- Update prototypes.
-
- * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update.
-
-2003-04-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR/8705
- * pa.md (movccfp): New expander.
- (setccfp0, setccfp1): Rename to movccfp0 and movccfp1, respectively.
- Reverse fcmp conditions.
-
-2003-04-20 Marek Michalkiewicz <marekm@amelek.gda.pl>
-
- * config/avr/avr.md (*cmpqi_sign_extend): Handle negative values
- of operand 1 correctly.
-
-2003-04-20 Nathan Sidwell <nathan@codesourcery.com>
-
- * cpplex.c (_cpp_lex_direct): Set BOL for CPP_EOF tokens.
- * gcov.c (output_lines): Don't be so fussy about going past EOF.
-
-2003-04-20 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (LIBCPP_OBJS): Add cppcharset.o.
- (cppcharset.o): New target.
- * c-lex.c (is_extended_char): Move to cppcharset.c.
- (utf8_extend_token): Delete.
- * cppcharset.c: New file.
- * cpphash.h (_cpp_valid_ucn): New.
- * cpplex.c (lex_identifier): Update prototype.
- (continues_identifier_p): Rename forms_identifier_p. Handle UCN
- escapes.
- (maybe_read_ucs): Rename maybe_read_ucn. Update to use code
- in cppcharset.c.
- (lex_number, lex_identifier, cpp_parse_escape): Update.
- (_cpp_lex_direct): Update to handle UCNs.
- (cpp_avoid_paste): Don't paste to form a UCN.
-
-2003-04-19 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (expand_builtin): Don't expand a pure or const
- built-in function if the result will be ignored and none of
- its arguments are volatile.
-
-2003-04-19 Kean Johnston <jkj@sco.com>
-
- * unwind-dw2.c (_Unwind_GetCFA): cast return to avoid warning
- * config.gcc: make SCO use dbxelf.h and elfos.h; only use one
- target fragment now: t-sco5; dont compile crti.o.
- * config/i386/sco5.h: major overhaul to remove all COFF remnants
- and to use elfos.h for most definitions.
- (BSS_SECTION_ASM_OP): set correct segment attributes.
- (PREFERED_DEBUGGING_TYPE): set to DWARF-2.
- (DWARF2_UNWIND_INFO): Always set to 1.
- (MD_STARTFILE_PREFIX): Make /usr/gnu/lib the default.
- (MD_STARTFILE_PREFIX_1): Define.
- (MD_EXEC_PREFIX): Adjust to /usr/gnu/bin if using GAS.
- (DEFAULT_LINKER): Define if not specified to configure.
- (CTORS_SECTION_ASM_OP): Remove COFF crud.
- (DTORS_SECTION_ASM_OP): Remove COFF crud.
- (WINT_TYPE): Define.
- (SDB_DEBUGGING_INFO): Remove.
- (EXTRA_SECTIONS): Likewise.
- (EXTRA_SECTION_FUNCTIONS): Likewise.
- (CTOR_LIST_BEGIN): Likewise.
- (CTOR_LIST_END): Likewise.
- (INIT_SECTION_FUNCTION): Likewise.
- (FINI_SECTION_FUNCTION): Likewise.
- (SUBTARGET_FRAME_POINTER_REQUIRED): Likewise.
- (LOCAL_LABEL_PREFIX): Likewise.
- (NON_SAVING_SETJMP): Likewise.
- (RETURN_POPS_ARGS): Likewise.
- (ASM_OUTPUT_SKIP): Likewise.
- (TARGET_ASM_NAMED_SECTION): Likewise.
- (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
- (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise.
- (ASM_OUTPUT_IDENT): Likewise.
- (ASM_OUTPUT_CASE_LABEL): Likewise.
- (ASM_OUTPUT_ASCII): Likewise.
- (ASM_OUTPUT_LIMITED_STRING): Likewise.
- (ASM_OUTPUT_ALIGNED_LOCAL): Likewise.
- (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
- (ASM_GENERATE_INTERNAL_LABEL): Likewise.
- (ASM_FINISH_DECLARE_OBJECT): Likewise.
- (ASM_DECLARE_OBJECT_NAME): Likewise.
- (ASM_DECLARE_FUNCTION_SIZE): Likewise.
- (ASM_DECLARE_FUNCTION_NAME): Likewise.
- (ASM_DECLARE_RESULT): Likewise.
- (ASM_WEAKEN_LABEL): Likewise.
- (SUPPORTS_WEAK): Likewise.
- (APPLY_RESULT_SIZE): Likewise.
- (LPREFIX): Likewise.
- (ALIGN_ASM_OP): Likewise.
- (ASCII_DATA_ASM_OP): Likewise.
- (IDENT_ASM_OP): Likewise.
- (ASM_SHORT): Likewise.
- (ASM_LONG): Likewise.
- (TYPE_ASM_OP): Likewise.
- (SIZE_ASM_OP): Likewise.
- (STRING_ASM_OP): Likewise.
- (SKIP_ASM_OP): Likewise.
- (EH_FRAME_SECTION_ASM_OP): Likewise.
- (READONLY_DATA_SECTION_ASM_OP): Likewise.
- (INIT_SECTION_ASM_OP): Likewise.
- (FINI_SECTION_ASM_OP): Likewise.
- (TEXT_SECTION_ASM_OP): Likewise.
- (DATA_SECTION_ASM_OP): Likewise.
- (TYPE_OPERANT_FORMAT): Likewise.
- (ASM_SPEC): Remove COFF code.
- (STARTFILE_SPEC): Likewise. Always use crti.o; add -p and -pp support;
- cause -pg to emit an error; use pcrt1elf.o with -pp
- (ENDFILE_SPEC): Likewise.
- (TARGET_OS_CPP_BUILTINS): Add _SCO_DS_LL.
- (CPP_SPEC): Remove COFF crud; always look in /usr/gnu/include first.
- (LINK_SPEC): Remove COFF crud; use -E for environment switch not -R;
- add -z alt_resolve to support weak symbols the way GCC wants them.
- (LIB_SPEC): Use the profiler libraries in -p or -pp mode.
- (LIBGCC_SPEC): Dont use -lgcc in -G mode.
- (ASM_PREFERED_EH_DATA_FORMAT): Remove.
- * config/i386/t-sco5 (TARGET_LIBGCC2_CFLAGS): Remove.
- (CRTSTUFF_T_CFLAGS_S): Define.
- (MULTILIB_OPTIONS): Likewise.
- (MULTILIB_DIRNAMES): Likewise.
- (MULTILIB_MATCHES): Likewise.
- (MULTILIB_EXTRA_OPTS): Likewise.
- (LIBGCC): Likewise.
- (INSTALL_LIBGCC): Likewise.
- (crti.o): Remove.
- * config/i386/t-sco5gas: Remove.
- * doc/install.texi: Updated for new OpenServer instructions.
- * testsuite/gcc.dg/nest.c: Allow failure on SCO (-pg not supported)
-
-2003-04-19 Kean Johnston <jkj@sco.com>
-
- * fixinc/check.tpl: Allow user to over-ride diff program.
- * fixinc/inclhack.def: Removed extraneous #ifndef SVR5.
- (sco_math): Added test for SCO math header files.
- (sco_regset): Added check for conflicts with ieeefp.h.
- (svr4_disable_opt): Removed extraneous #ifdef SVR4.
- * fixinc/fixincl.x: Regenerated
- * fixinc/tests/base/math.h: Added sco_math tests.
- * fixinc/tests/base/string.h: New file.
- * fixinc/tests/base/sys/regset.h: New file.
-
-2003-04-19 Neil Booth <neil@daikokuya.co.uk>
-
- * cpphash.h (struct cpp_buffer): Remove backup_to.
- * cpplex.c (BACKUP, get_effective_char): Die.
- (_cpp_skip_block_comment): Assume '*' is location on entry.
- (continues_identifier_p): Respect -fno-dollars-in-identifiers.
- (IF_NEXT_IS): Update.
- (_cpp_lex_direct): Don't use backup_to; look ahead directly.
-
-2003-04-19 Matt Kraai <kraai@alumni.cmu.edu>
-
- * README.Portability: Move to a new section and obsolete K+R
- portability issues.
-
-Sat Apr 19 14:56:17 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * rtlanal.c (subreg_offset_representable_p): Fix call of
- subreg_lowpart.
-
-2003-04-19 Neil Booth <neil@daikokuya.co.uk>
-
- * cpphash.h (struct cpp_reader): New member warned_dollar.
- * cpplex.c (continues_identifier_p): New function.
- (parse_identifier, parse_number, parse_string): Rename lex_identifer,
- lex_number and lex_string, and simplify.
- (parse_slow, unescaped_terminator_p): Die.
- (_cpp_lex_direct): Update.
-
-2003-04-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * calls.c (expand_call): Provide init for old_stack_pointer_delta.
-
-2003-04-19 Nathan Sidwell <nathan@codesourcery.com>
-
- * doc/invoke.texi (-fprofile-arcs): Mention -lgcov, locking and
- fork behavior.
-
-2003-04-19 Neil Booth <neil@daikokuya.co.uk>
-
- * cppexp.c (eval_token): Permit true and false even if pedantic.
-
-2003-04-19 Neil Booth <neil@daikokuya.co.uk>
-
- * cpplex.c (skip_whitespace): Rearrange to avoid stage1 ICE.
-
-2003-04-19 Neil Booth <neil@daikokuya.co.uk>
-
- * cppfiles.c (ENABLE_VALGRIND_CHECKING, VALGRIND_DISCARD,
- MMAP_THRESHOLD, TEST_THRESHOLD, SHOULD_MMAP): Remove.
- (struct include_file): Remove fefcnt, mapped members.
- (open_file, stack_include_file, _cpp_pop_file_buffer): Disable caching.
- (read_include_file): Don't use mmap, terminate buffers in '\r'.
- (purge_cache): Don't use munmap.
- * cpphash.h (CPP_BUF_COLUMN): Update.
- (lexer_state): Remove lexing_comment.
- (struct _cpp_line_note): New.
- (struct cpp_buffer): New members cur_note, notes_used, notes_cap,
- next_line and need_line. Remove col_adjust and saved_flags.
- (_cpp_process_line_notes, _cpp_clean_line, _cpp_get_fresh_line,
- _cpp_skip_block_comment, scan_out_logical_line): New.
- (_cpp_init_mbchar): Remove.
- * cppinit.c (init_library): Remove call to _cpp_init_mbchar.
- (cpp_read_main_file): Set line to 1 earlier.
- (post_options): -traditional-cpp doesn't want trigraphs.
- * cpplex.c (MULTIBYTE_CHARS): Remove code predicated on this.
- (add_line_note, _cpp_clean_line, _cpp_process_line_notes,
- _cpp_get_fresh_line): New.
- (handle_newline, skip_escaped_newlines, trigraph_p,
- continue_after_nul, _cpp_init_mbchar): Remove.
- (get_effective_char): Update.
- (_cpp_skip_block_comment): Rename from skip_block_comment, simplify.
- (skip_line_comment): Simplify.
- (skip_whitespace, parse_identifier, parse_slow, parse_number,
- parse_string): Update.
- (cpp_lex_direct): Use clean lines and process line notes. Update.
- (cpp_interpret_charconst): No MULTIBYTE_CHARS.
- * cpplib.c (prepare_directive_trad): Call scan_out_logical_line
- directly.
- (_cpp_handle_directive): Don't set saved_flags.
- (run_directive, destringize_and_run, cpp_define, cpp_define_builtin,
- cpp_undef, handle_assertion, cpp_push_buffer): Update.
- (_cpp_pop_buffer): Free notes.
- * cppmacro.c (builtin_macro, paste_tokens): \n terminate buffer.
- * cpppch.c (cpp_read_state): \n terminate buffer.
- * cpptrad.c (skip_escaped_newlines, handle_newline): Remove.
- (copy_comment): Use _cpp_skip_block_comment.
- (skip_whitespace, lex_identifier, _cpp_read_logical_line_trad):
- Simplify.
- (_cpp_overlay_buffer, _cpp_remove_overlay, push_replacement_text,
- save_replacement_text): Update.
- (scan_out_logical_line): Update to use clean lines and process
- line notes.
- * fix-header.c (read_scan_file): Update.
-
-2003-04-18 Douglas B Rupp <rupp@gnat.com>
-
- * unwind-dw2-fde.c (__register_frame_info_bases): Check for
- null begin parameter (as well as pointer to null).
- (__deregister_frame_info_bases): Likewise.
-
-2003-04-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * function.c (purge_addressof_1): For ADDRESSOF, see if SUB is a
- hard or virtual register and copy into pseudo if replacement fails.
-
- * cfgcleanup.c (flow_find_cross_jump): Use INSN_P, not active_insn_p.
-
- * expmed.c (mask_rtx): Avoid undefined shifts for BITSIZE of 0.
-
-2003-04-18 Olivier Hainque <hainque@act-europe.fr>
-
- * calls.c (expand_call): Move special case for constructor calls
- to right place. Ensures constructor calls used to initialize
- arguments get a clean outgoing argument block for themselves.
- Move check for stack deallocation completeness until after last
- deallocation. Add stack_pointer_delta to set of state
- variables saved and restored along with current stack_level.
-
- * integrate.c (expand_inline_function): Ensure non-const actuals
- don't end up const in the caller's flow after conversion to possibly
- const formal type.
-
-2003-04-18 Vincent Celier <celier@gnat.com>
-
- * dwarf2out.c (loc_descriptor_from_tree): Treat all *_MOD_EXPR
- and *_DIV_EXPR as TRUNC_*_EXPR.
-
-2003-04-18 Mark Mitchell <mark@codesourcery.com>
-
- * cfgrtl.c (try_redirect_by_replacing_jump): Create a basic block
- for orphaned jump tables.
-
-2003-04-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * reload1.c: Revert my previous patch on 2002-04-17.
-
-2003-04-18 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Prefer "bug fix" over "bugfix".
- Add Segher Boessenkool.
-
-2003-04-18 Alexander Sotirov <sluncho@mirizma.org>
-
- PR c/9177
- * c-decl.c (c_expand_body): Don't garbage collect the function
- body if we are going to dump it later.
-
-2003-04-18 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP): Remove.
- (alpha_end_function): Don't set them.
- (decl_in_text_section): Remove.
- (alpha_encode_section_info): Remove.
- (samegp_function_operand): Use SYMBOL_REF LOCAL_P and EXTERNAL_P.
- (direct_call_operand): Use SYMBOL_REF_DECL and compare actual
- sections, rather than decl_in_text_section results.
-
-2003-04-18 Roger Sayle <roger@eyesopen.com>
-
- * rtlanal.c (reg_overlap_mentioned_p): Handle ZERO_EXTRACT
- and SIGN_EXTRACT.
-
-2003-04-18 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/7675
- * c-typeck.c (build_external_ref): Set the DECL_NONLOCAL flag
- on VAR_DECL, PARM_DECL and FUNCTION_DECL from within
- nested functions if they refer to declarations from parent functions.
- * stmt.c (expand_decl): Don't put automatic variables in registers
- if the DECL_NONLOCAL flag is set.
-
-2003-04-18 Hans-Peter Nilsson <hp@bitrange.com>
-
- * gcse.c (compute_ld_motion_mems): For MEM destinations, only
- consider those to be movable where the source matches
- want_to_gcse_p.
- (update_ld_motion_stores): In comment, refer to
- compute_ld_motion_mems for validity of replacement.
-
-Fri Apr 18 01:28:51 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * gcov-dump.c (tag_summary): Remove max_sum
- * gcov-io.h (gcov_summary, gcov_write_summary,
- gcov_read_summary): Kill max_sum.
- * libgcov.c (gcov_exit): Do one pass over the data. Make error
- message more verbose.
-
- * emit-rtl.c (subreg_hard_regno): Check that register is
- representable.
-
- * reload.c (reload_inner_reg_of_subreg): When register is not
- representable, reload the whole thing.
- (find_reloads): Likewsie.
- * rtlanal.c (subreg_representable_p): New function.
-
- * profile.c (compute_branch_probabilities): Cleanup sanity checking;
- allow negative probabilities for edges from the call to exit.
- (branch_prob): Do not add fake edges for functions that may return
- twice.
-
-2003-04-17 DJ Delorie <dj@redhat.com>
-
- * toplev.c (target_options): Add value field.
- (set_target_switch): Handle target options with values.
- * doc/tm.texi: Document how fixed vs variable target
- options work.
- * config/alpha/alpha.h, config/arc/arc.h, config/avr/avr.h,
- config/c4x/c4x.h, config/cris/aout.h, config/cris/cris.h,
- config/d30v/d30v.h, config/dsp16xx/dsp16xx.h,
- config/frv/frv.h, config/i386/i386.h, config/ia64/ia64.h,
- config/m32r/m32r.h, config/m68hc11/m68hc11.h,
- config/m68k/m68k.h, config/m88k/m88k.h, config/mcore/mcore.h,
- config/mips/mips.h, config/mmix/mmix.h, config/pa/pa.h,
- config/rs6000/rs6000.h, config/rs6000/sysv4.h,
- config/s390/s390.h, config/sparc/sparc.h, config/v850/v850.h:
- Add value initializer to target options.
-
-2003-04-07 Loren James Rittle <ljrittle@acm.org>
-
- * cpppch.c (cpp_valid_state): Unconditionally initialize nl.
-
-2003-04-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * reload1.c (move2add_last_cc0): New.
- (reload_cse_move2add): Detect implicit sets.
- (move2add_note_store): Notice a store into cc0.
-
-2003-04-17 Roger Sayle <roger@eyesopen.com>
-
- PR c/10375
- * c-decl.c (duplicate_decls): Preserve "const" and "noreturn"
- function attributes.
-
-2003-04-17 Janis Johnson <janis187@us.ibm.com>
-
- * doc/sourcebuild.texi (Test Suites): Document support for testing
- binary compatibility (moved from testsuite/README.compat).
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (ia64_in_small_data_p): Disallow strings.
-
-2003-04-17 Simon Law <sfllaw@engmail.uwaterloo.ca>
-
- * doc/include/gpl.texi: Fix double-spacing after "MA" to match
- the one provided by the FSF.
-
-2003-04-17 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Binaries): Update URL and list of platforms
- provided by ftp.thewrittenword.com.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/xtensa/xtensa.c (xtensa_encode_section_info): Remove.
- (call_insn_operand): Use SYMBOL_REF_LOCAL_P.
- * config/xtensa/xtensa.md (call, call_value): Likewise.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/v850/v850.c (print_operand): Use SYMBOL_REF_[ZST]DA.
- (print_operand_address): Likewise.
- (ep_memory_operand): Likewise.
- (special_symbolref_operand): Likewise.
- (v850_encode_data_area): Use SYMBOL_REF_FLAGS.
- (v850_encode_section_info): Call default_encode_section_info.
- (v850_strip_name_encoding): Remove.
- * config/v850/v850.h (EXTRA_CONSTRAINT): Use SYMBOL_REF_[ZST]DA.
- (ASM_OUTPUT_LABELREF): Remove.
- (ZDA_NAME_FLAG_CHAR, ZDA_NAME_P): Remove.
- (SDA_NAME_FLAG_CHAR, SDA_NAME_P): Remove.
- (TDA_NAME_FLAG_CHAR, TDA_NAME_P): Remove.
- (ENCODED_NAME_P): Remove.
- (SYMBOL_FLAG_ZDA, SYMBOL_REF_ZDA_P): New.
- (SYMBOL_FLAG_SDA, SYMBOL_REF_SDA_P): New.
- (SYMBOL_FLAG_TDA, SYMBOL_REF_TDA_P): New.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/stormy16/stormy16.c (xstormy16_encode_section_info): Kill.
- * config/stormy16/stormy16.h (ASM_OUTPUT_SYMBOL_REF): Use
- SYMBOL_REF_FUNCTION_P.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/sparc/sparc.c (sparc_encode_section_info): Remove.
- (data_segment_operand): Use SYMBOL_REF_FUNCTION_P.
- (text_segment_operand): Likewise.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/sh/sh.c (gen_datalabel_ref): Don't add SH_DATALABEL_ENCODING.
- (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
- (legitimize_pic_address): Use SYMBOL_REF_LOCAL_P.
- (sh_encode_section_info): Remove.
- (sh_strip_name_encoding): Remove.
- * config/sh/sh.h (SH_DATALABEL_ENCODING): Remove.
- (DATALABEL_SYMNAME_P, STRIP_DATALABEL_ENCODING): Remove.
- (SH_TLS_ENCODING, TLS_SYMNAME_P, STRIP_TLS_ENCODING): Remove.
- (ASM_OUTPUT_LABELREF): Remove.
- (ASM_OUTPUT_SYMBOL_REF): Use SYMBOL_REF_FUNCTION_P.
- * config/sh/sh.md (*): Use SYMBOL_REF_LOCAL_P.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/s390/s390.c (SYMBOL_FLAG_ALIGN1): New.
- (tls_model_chars): Remove.
- (larl_operand): Use SYMBOL_REF_FLAGS.
- (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
- (legitimize_pic_address): Use SYMBOL_REF_LOCAL_P.
- (s390_output_mi_thunk): Likewise.
- (s390_emit_prologue): Set SYMBOL_FLAG_LOCAL as needed.
- (s390_function_profiler): Likewise.
- (s390_encode_section_info): Use default_encode_section_info
- and SYMBOL_FLAG_ALIGN1.
- (s390_strip_name_encoding): Remove.
- * config/s390/s390.h (ASM_OUTPUT_LABELREF): Remove.
- * config/s390/s390.md (call, call_value): Use SYMBOL_REF_LOCAL_P.
- (builtin_setjmp_receiver): Set SYMBOL_FLAG_LOCAL as needed.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/ns32k/ns32k.c (ns32k_encode_section_info): Remove.
- (global_symbolic_reference_mentioned_p): Use SYMBOL_REF_LOCAL_P.
- (print_operand_address): Likewise.
-
- * config/ns32k/ns32k.h (CANNOT_CHANGE_MODE_CLASS): Add CLASS argument.
- * config/ns32k/ns32k.c (expand_block_move): Don't check
- flag_unroll_loops.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/mcore/mcore.c (mcore_encode_section_info): Don't set
- SYMBOL_REF_FLAG.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * rtl.h (SYMBOL_FLAG_MACH_DEP_SHIFT): New.
-
- * config/m32r/m32r.c (SYMBOL_FLAG_MODEL_SHIFT): New.
- (SYMBOL_REF_MODEL): New.
- (LIT_NAME_P): Move from m32r.h.
- (m32r_select_section): Remove.
- (m32r_encode_section_info): Use SYMBOL_REF_FLAGS.
- (m32r_strip_name_encoding): Remove.
- (m32r_in_small_data_p): New.
- (small_data_operand): Use SYMBOL_REF_SMALL_P.
- (addr24_operand): Use SYMBOL_REF_MODEL.
- (call26_operand): Likewise.
- (addr32_operand): Tidy.
- (m32r_print_operand): Use HOST_WIDE_INT_PRINT_HEX.
- * config/m32r/m32r.h (RODATA_SECTION_ASM_OP): Remove.
- (SDATA_SECTION_ASM_OP, SBSS_SECTION_ASM_OP): Remove.
- (READONLY_DATA_SECTION_ASM_OP): Remove.
- (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove.
- (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Remove.
- (TARGET_ASM_SELECT_SECTION): Remove.
- (SDATA_FLAG_CHAR, MEDIUM_FLAG_CHAR, LARGE_FLAG_CHAR): Remove.
- (SDATA_NAME_P, SMALL_NAME_P, MEDIUM_NAME_P): Remove.
- (LARGE_NAME_P, ENCODED_NAME_P): Remove.
- (ASM_OUTPUT_LABELREF): Remove.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/ip2k/ip2k.c (is_regfile_address): Use SYMBOL_REF_FUNCTION_P.
- (encode_section_info): Remove.
- * config/ip2k/ip2k-protos.h: Update.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * varasm.c (default_encode_section_info): Don't set
- SYMBOL_FLAG_EXTERNAL if not TREE_PUBLIC.
- * config/i370/i370.c (i370_encode_section_info): Remove.
- * config/i370/i370.h (CONSTANT_ADDRESS_P): Use SYMBOL_REF_EXTERNAL_P.
- (PRINT_OPERAND, PRINT_OPERAND_ADDRESS): Likewise.
- * config/i370/i370.md (movsi): Likewise.
-
- * config/i370/t-i370: Add missing backslash.
-
-2003-04-17 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/invoke.texi (inline-limit): Fix pasto.
-
-2003-04-17 Richard Henderson <rth@redhat.com>
-
- * config/h8300/h8300.c (SYMBOL_FLAG_FUNCVEC_FUNCTION): New.
- (small_call_insn_operand): Use it.
- (SYMBOL_FLAG_EIGHTBIT_DATA): New.
- (h8300_eightbit_constant_address_p): Use it.
- (SYMBOL_FLAG_TINY_DATA): New.
- (h8300_tiny_constant_address_p): Use it.
- (h8300_encode_label, h8300_strip_name_encoding): Remove.
- (h8300_encode_section_info): Set SYMBOL_REF_FLAGS.
- * config/h8300/h8300.h (TINY_DATA_NAME_P): Remove.
- (ASM_OUTPUT_LABELREF): Remove.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * config/frv/frv.c (symbol_ref_small_data_p): Remove. Replace
- all users with SYMBOL_REF_SMALL_P.
- (const_small_data_p): Use SYMBOL_REF_SMALL_P.
- (frv_encode_section_info): Remove.
- (frv_strip_name_encoding): Remove.
- (frv_in_small_data_p): Merge tests from encode_section_info.
- (frv_print_operand): Use '@' not SDATA_FLAG_CHAR.
- * config/frv/frv.h (SDATA_FLAG_CHAR): Remove.
- (SDATA_NAME_P): Remove.
- (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use SIZE not SDATA_NAME_P.
- (ASM_OUTPUT_LABELREF): Remove.
- (PRINT_OPERAND_PUNCT_VALID_P): Use '@' not SDATA_FLAG_CHAR.
-
- * config/frv/frv.c (frv_asm_out_constructor): New.
- (frv_asm_out_destructor): New.
- * config/frv/frv.h (CTORS_SECTION_ASM_OP): New.
- (DTORS_SECTION_ASM_OP): New.
- (ASM_OUTPUT_CONSTRUCTOR): Remove.
- (ASM_OUTPUT_DESTRUCTOR): Remove.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * config/cris/cris.c (cris_gotless_symbol, cris_got_symbol): Use
- SYMBOL_REF_LOCAL_P; abort if not pic.
- (cris_encode_section_info): Remove.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * config/c4x/c4x.c (c4x_encode_section_info): Remove.
- (c4x_T_constraint): Use SYMBOL_REF_FUNCTION_P.
-
- * config/c4x/c4x.h (TARGET_CPU_CPP_BUILTINS): Declare
- flag_inline_trees.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * config/avr/avr.c (avr_encode_section_info): Remove.
- (avr_insert_attributes): New.
- (print_operand_address): Use SYMBOL_REF_FUNCTION_P.
- (avr_assemble_integer): Likewise.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * arc.c (arc_encode_section_info): Remove.
- (arc_assemble_integer): Use SYMBOL_REF_FUNCTION_P.
- (arc_print_operand, arc_print_operand_address): Likewise.
- * arc.h (EXTRA_CONSTRAINT): Likewise.
-
-2003-04-16 Roger Sayle <roger@eyesopen.com>
-
- * c-semantics.c (find_reachable_label): New function to find a
- potentially reachable label in an expression.
- (expand_unreachable_if_stmt): Similar to expand_if_stmt but
- assumes the start of the IF_STMT is unreachable (dead) code.
- (expand_unreachable_stmt): Similar to expand_stmt but assumes
- the start of the statement list is unreachable (dead) code.
- (genrtl_if_stmt): If the controlling expression of the IF
- is constant, use expand_unreachable_stmt for the THEN or ELSE
- clause as appropriate.
- (genrtl_switch_stmt): Use expand_unreachable_stmt to expand
- the body of a SWITCH statement.
- (expand_stmt): The code immediately following a "return",
- "break", "continue" or "goto" is unreachable.
- * Makefile.in (c-semantics.o): Depend upon tree-inline.h.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * rtl.h (MEM_ALIAS_SET): Update documentation.
- * doc/rtl.texi (Special Accessors): New node.
- (SYMBOL_REF_FLAG): Note relationship with SYMBOL_REF_FLAGS.
-
-2003-04-16 Alexandre Oliva <aoliva@redhat.com>
-
- * reload1.c (reload_cse_noop_set_p): Return false if mode of
- SET_DEST is not the same as that returned by...
- * cselib.h (cselib_reg_set_mode): ... new function.
- * cselib.c (cselib_reg_set_mode): Define it.
- (REG_VALUES): Document semantics of first element as set mode.
- (cselib_subst_to_values): Skip first element if ELT is NULL.
- (cselib_lookup): Likewise. Insert past the first element.
- (cselib_invalidate_regno): NULLify first element.
- (cselib_record_set): Set first element.
-
-2003-04-16 Olivier Hainque <hainque@act-europe.fr>
-
- * tree.c (skip_simple_arithmetics_at, saved_expr_p): New functions.
- (save_expr): Replace loop by call to skip_simple_arithmetics_at.
- * tree.h: Add prototypes for the two new functions.
- * fold-const.c (fold_binary_op_with_conditional_arg): Replace test
- updates introduced in the previous revision by call to saved_expr_p.
- * stor-layout.c (put_pending_size): Use skip_simple_arithmetics_at.
-
- * expr.c (store_field): Force usage of bitfield instructions when
- the field position requires it, whatever SLOW_UNALIGNED_ACCESS.
- (expand_expr, case BIT_FIELD_REF): likewise.
-
-2003-04-16 Mark Mitchell <mark@codesourcery.com>
-
- PR middle-end/8866
- * cfgtrl.c (try_redirect_by_replacing_jump): Do not delete
- jumptables.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (sdata_symbolic_operand): Use
- SYMBOL_REF_SMALL_P and SYMBOL_REF_LOCAL_P.
- (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
- (function_operand): Use SYMBOL_REF_FUNCTION_P.
- (ia64_expand_load_address): Likewise.
- (ia64_assemble_integer): Likewise.
- (ia64_encode_section_info): Remove.
- (ia64_strip_name_encoding): Remove.
- * config/ia64/ia64.h (ENCODE_SECTION_INFO_CHAR): Remove.
- * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Don't strip it.
-
-2003-04-16 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP): New.
- (samegp_function_operand): Use SYMBOL_FLAG_SAMEGP.
- (direct_call_operand): Use SYMBOL_FLAG_NEAR.
- (local_symbolic_operand): Use SYMBOL_REF_LOCAL_P.
- (small_symbolic_operand): Use SYMBOL_REF_SMALL_P.
- (global_symbolic_operand): Similarly.
- (tls_symbolic_operand_1): Use SYMBOL_REF_TLS_MODEL.
- (tls_symbolic_operand_type): Likewise.
- (alpha_encode_section_info): Use default_encode_section_info.
- (alpha_strip_name_encoding): Remove.
- (get_tls_get_addr): Split out from ...
- (alpha_legitimize_address): ... here.
- (alpha_emit_xfloating_libcall): Use init_one_libfunc.
- (get_some_local_dynamic_name_1): Use SYMBOL_REF_TLS_MODEL.
- (alpha_initialize_trampoline): Use init_one_libfunc.
- (alpha_setup_incoming_varargs): Mark unused parameters.
- (alpha_initial_elimination_offset): Likewise.
- (alpha_end_function): Use SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP.
- (unicosmk_unique_section): Use default_strip_name_encoding.
- (unicosmk_ssib_name, unicosmk_output_externs): Likewise.
-
-2003-04-16 Aldy Hernandez <aldyh@redhat.com>
-
- * config.gcc: Add t-spe for eabispe.
-
- * config/rs6000/t-spe: New.
-
-2003-04-16 J"orn Rennecke <joern.rennecke@superh.com>
-
- Re-apply this patch:
-
- 2002-05-16 Dale Johannesen <dalej@apple.com>
- * combine.c (cant_combine_insn_p): Reenable combinations
- involving hard regs unless CLASS_LIKELY_SPILLED_P.
-
-2003-04-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR/10271
- * pa-protos.h (function_arg): Remove last argument.
- * pa.c (function_arg): Likewise. Use CUMULATIVE_ARGS struct instead.
- * pa.h (struct hppa_args): Add member incoming.
- (INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Initialize
- member incoming.
- (FUNCTION_ARG): Revise call to function_arg.
- (FUNCTION_INCOMING_ARG): Delete.
-
-2003-04-15 Zack Weinberg <zack@codesourcery.com>
-
- * configure.in: Unify the code which creates symlinks to a
- just-built as, ld, objdump, and nm with the code that detects
- their presence for purposes of feature tests.
- * configure: Regenerate.
-
-2003-04-15 Zack Weinberg <zack@codesourcery.com>
-
- * varasm.c (output_constant_def): Do not consult
- CONSTANT_AFTER_FUNCTION_P. Remove all code predicated on it.
- (after_function_constants, output_after_function_constants): Delete.
- * doc/tm.texi: Delete documentation of CONSTANT_AFTER_FUNCTION_P.
- * config/mips/mips-protos.h, config/mips/mips.c
- (mips16_constant_after_function_p): Delete.
- * config/mips/mips.h: Delete #if-0-ed definition of
- CONSTANT_AFTER_FUNCTION_P.
- * config/d30v/d30v.h, config/stormy16/stormy16.h: Remove
- mention of CONSTANT_AFTER_FUNCTION_P in comment.
-
-2003-04-15 Geoffrey Keating <geoffk@apple.com>
-
- * tree.c (next_decl_uid): Mark with GTY.
- (next_type_uid): Likewise.
-
-2003-04-15 J"orn Rennecke <joern.rennecke@superh.com>
-
- PR target/9594:
- * sh.c (barrier_align): Also recognize stuff_delay_slot as
- an indicator that a barrier was created by branch splitting.
-
-2003-04-15 Mark Mitchell <mark@codesourcery.com>
-
- * c-decl.c (implicitly_declare): Copy declarations that are going
- to be placed in a local scope.
-
-2003-04-15 James A. Morrison <ja2morri@uwaterloo.ca>
-
- * invoke.texi (Spec Files): Wrap if-exists-else example.
- (MCore): Remove duplicate @itemx entries and @opindex entries.
-
-2003-04-15 Ulrich Weigand <uweigand@de.ibm.com>
-
- * unwind.inc (_Unwind_Backtrace): New function.
- * unwind.h (_Unwind_Backtrace): Declare it.
- * libgcc-std.ver (_Unwind_Backtrace): Export it.
-
-2003-04-14 Jason Merrill <jason@redhat.com>
-
- PR middle-end/10336, c++/10401
- * jump.c (never_reached_warning): Also stop looking if we reach the
- beginning of the function.
-
-2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- PR target/10338
- PR bootstrap/10198
- PR bootstrap/10140
- * fixinc/gnu-regex.c (regerror): Use mempcpy not __mempcpy.
-
-2003-04-15 J"orn Rennecke <joern.rennecke@superh.com>
-
- * i386.md (abssf2_if+1): Make condition agree with abssf2_1 .
-
-2003-04-15 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * optabs.c (expand_binop): In multi-word add cases, ensure
- XTARGET is copied to TARGET if they are different.
-
-2003-04-15 Olivier Hainque <hainque@act-europe.fr>
-
- * except.c (resolve_fixup_regions): Avoid dereferencing null pointer
- to region, possible after integration of function with unreachable
- regions that were optimized away.
-
-2003-04-15 Jakub Jelinek <jakub@redhat.com>
-
- * config/rs6000/rs6000.h (EPILOGUE_USES): Use register 2,
- instead of TOC_REGISTER in epilogue in
- current_function_calls_eh_return functions.
-
-2003-04-14 Mark Mitchell <mark@codesourcery.com>
-
- * doc/extend.texi (Empty Structures): Correct description of G++'s
- handling of these structures.
-
- * c-decl.c (grokdeclarator): Reject extern redeclarations of
- static variables.
-
-2003-04-14 Janis Johnson <janis287@us.ibm.com>
-
- * config/rs6000/rs6000.md (define_constants): Define constants for
- all UNSPEC usage, including new values for TLS support.
- (aux_truncdfsf2, fctiwz, movsi_got, movsi_got_internal,
- load_toc_aix_si, load_toc_aix_di, load_toc_v4_pic_si,
- load_toc_v4_PIC_1, load_toc_v4_PIC_1b, load_macho_picbase,
- macho_correct_pic, blockage, move_from_CR_ov_bit, movesi_from_cr,
- stack_tie, movsi_to_cr_one, movsi_to_cr, mtcrfsi, eh_set_lr_si,
- eh_set_lr_di): Use them.
- * rs6000.c: (mtcrf_operation, uses_TOC, rs6000_emit_prologue,
- rs6000_emit_epilogue) Use them.
-
- * rtl.h (SYMBOL_REF_TLS_MODEL): Fix mask value.
-
-2003-04-14 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (c-opts.o): Use custom action.
-
-2003-04-14 Douglas B Rupp <rupp@gnat.com>
-
- * ifcvt.c (noce_process_if_block): Fail on BLKmode move.
-
-2003-04-14 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stor-layout.c (layout_type, case ARRAY_TYPE): Add missing code to
- handle "superflat arrays" in Ada.
-
- * integrate.c (expand_inline_function): Don't inline if would
- lose /u on a BLKmode TARGET.
-
-2003-04-14 Joel Brobecker <brobecker@gnat.com>
-
- * dbxout.c (print_int_cst_bounds_in_octal_p): New function,
- extracted from dbxout_type.
- (dbxout_range_type): print large bounds in octal format.
- (dbxout_type): Replace extracted code by call to
- print_int_cst_bounds_in_octal_p.
-
- * dwarf2out.c (gen_compile_unit_die): Emit DW_LANG_Ada95 instead
- of DW_LANG_Ada83 for Ada units.
-
-2003-04-14 Olivier Hainque <hainque@act-europe.fr>
-
- * explow.c (round_push): Use HOST_WIDE_INT instead of int for the
- temporary used to round CONST_INT sizes.
-
- * tree.c (int_fits_type_p): Extract generic checks from the case
- of constant type bounds. Refine the checks against constant type
- bounds to allow for possible decisions against each of these bounds
- without requiring both bounds to be constant.
- (tree_int_cst_msb): Put back.
- * tree.h (tree_int_cst_msb): Likewise.
-
- * global.c (global_conflicts): Prevent allocation of call clobbered
- hard regs to pseudos live across abnormal edges, as later passes are
- not ready to handle them.
-
- * fold-const.c (fold): Reorder tests for conditional expressions.
-
- * expr.c (highest_pow2_factor): Return unsigned.
- * expr.h (offset_address): Likewise.
- * emit-rtl.c (offset_address): POW2 argument now unsigned.
-
-2003-04-14 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (expand_builtin_strlen): Evaluate the lengths of
- string literals at compile-time.
-
-2003-04-14 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (fold): Transform (c1 - x) cmp c2, where cmp is a
- comparison operation and c1/c2 are floating point constants into
- x swap(cmp) (c1 - c2).
-
-2003-04-14 Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (output_translate_vect): Fix a typo in loop
- condition.
-
-2003-04-14 Hans-Peter Nilsson <hp@axis.com>
-
- PR target/10377
- * config/cris/cris.md ("*mov_sideqi", "*mov_sidehi")
- ("*mov_sidesi", "*mov_sideqi_mem", "*mov_sidehi_mem")
- ("*mov_sidesi_mem", "*clear_sidesi", "*clear_sidehi")
- ("*clear_sideqi", "*ext_sideqihi", "*ext_sideqisi")
- ("*ext_sidehisi", "*op_sideqi", "*op_sidehi", "*op_sidesi")
- ("*op_swap_sideqi", "*op_swap_sidehi", "*op_swap_sidesi")
- ("*extopqihi_side", "*extopqisi_side", "*extophisi_side")
- ("*extopqihi_swap_side", "*extopqisi_swap_side")
- ("*extophisi_swap_side", 8th, 9th, 10th, 11th, 14th peepholes):
- When next to constraint R, replace constraint i with n.
-
-Mon Apr 14 16:18:37 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- PR opt/10024
- * cfgrtl.c (force_nonfallthru_and_redirect): Use unchecked_make_edge.
-
-2003-04-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
-
- * doc/contrib.texi (Contributors): Correct my entry.
-
-2003-04-13 Roger Sayle <roger@eyesopen.com>
-
- * tree.h (DECL_BUILT_IN_NONANSI): Remove.
- * c-common.c (builtin_function_2): Don't set DECL_BUILT_IN_NONANSI.
- * c-decl.c (duplicate_decls): Use invariant DECL_BUILT_IN_NONANSI
- implies DECL_BUILT_IN to simplify logic.
- * print-tree.c (print_node): Don't dump DECL_BUILT_IN_NONANSI.
-
-2003-04-13 Roger Sayle <roger@eyesopen.com>
-
- * builtin-types.def (BT_FN_STRING_CONST_STRING): New builtin type.
- (BT_FN_PTR_SIZE_SIZE): Likewise.
- * builtins.def (BUILT_IN_MALLOC, BUILT_IN_CALLOC, BUILT_IN_STRDUP):
- New built-in functions for malloc, calloc and strdup respectively.
- * calls.c (special_function_p): No need to handle malloc-like
- functions any longer. ECF_MALLOC is set via built-in attributes.
-
- * c-decl.c (duplicate_decls): Preserve pure and malloc attributes.
-
- * doc/extend.texi: Document these new built-in functions.
-
-2003-04-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * builtins.c (expand_builtin_memcpy): Add `endp' argument, use it.
- (expand_builtin_stpcpy): New.
- (expand_builtin): Add BUILT_IN_MEMPCPY & BUILT_IN_STPCPY.
- * builtins.def: Add mempcpy & stpcpy support.
- * doc/extend.texi (mempcpy, stpcpy): Document new builtins.
-
-2003-04-13 Nick Clifton <nickc@redhat.com>
-
- * config/rs6000/rs6000.c: Replace occurrences of "GNU CC" with
- "GCC".
- * config/rs6000/40x.md, config/rs6000/603.md,
- config/rs6000/6xx.md, config/rs6000/7450.md, config/rs6000/7xx.md,
- config/rs6000/8540.md, config/rs6000/aix.h, config/rs6000/aix31.h,
- config/rs6000/aix3newas.h, config/rs6000/aix41.h,
- config/rs6000/aix43.h, config/rs6000/aix51.h,
- config/rs6000/aix52.h, config/rs6000/altivec-defs.h,
- config/rs6000/altivec.h, config/rs6000/altivec.md,
- config/rs6000/beos.h, config/rs6000/darwin.h,
- config/rs6000/eabi.h, config/rs6000/eabialtivec.h,
- config/rs6000/eabisim.h, config/rs6000/eabispe.h,
- config/rs6000/freebsd.h, config/rs6000/gnu.h,
- config/rs6000/host-darwin.c, config/rs6000/linux.h,
- config/rs6000/linux64.h, config/rs6000/linuxaltivec.h,
- config/rs6000/lynx.h, config/rs6000/mach.h, config/rs6000/mpc.md,
- config/rs6000/netbsd.h, config/rs6000/power4.md,
- config/rs6000/rios1.md, config/rs6000/rios2.md,
- config/rs6000/rs6000-c.c, config/rs6000/rs6000-modes.def,
- config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c,
- config/rs6000/rs6000.h, config/rs6000/rs6000.md,
- config/rs6000/rs64.md, config/rs6000/rtems.h, config/rs6000/spe.h,
- config/rs6000/spe.md, config/rs6000/sysv4.h,
- config/rs6000/sysv4le.h, config/rs6000/vxworks.h,
- config/rs6000/windiss.h, config/rs6000/xcoff.h: Likewise.
-
-2003-04-13 Nick Clifton <nickc@redhat.com>
-
- * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Delete
- support for -mcall-aix switch.
- * config/rs6000/eabiaix.h: Delete.
- * config/rs6000/rs6000.h (rs6000_abi): Remove ABI_AIX_NODESC.
- (RS6000_REG_SAVE, RS6000_SAVE_AREA, FP_ARGS_MAX_REG,
- RETURN_ADDRESS_OFFSET): Remove use of ABI_AIX_NODESC.
- * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Likewise.
- * config/rs6000/rs6000.c (print_operand, rs6000_stack_info,
- debug_stack_info, output_function_profiler,
- rs6000_trampoline_size, rs6000_initialise_trampoline): Likewise.
- * config/rs6000/rs6000.md (call, call_value, call_nonlocal_sysv,
- call_indirect_nonlocal_sysv, call_value_indirect_nonlocal_sysv,
- call_value_nonlocal_sysv, sibcall_value_nonlocal_sysv,
- sibcall_nonlocal_sysv, sibcall_value_local64): Likewise.
- * config/rs6000/t-ppcgas (MULTILIB_OPTIONS): Remove mcall-aix
- multilibs.
- (MULTILIB_DIRNAMES): Remove mcall-aix directories.
- (MULTILIB_EXCEPTIONS): Delete.
- (MULTILIB_MATCHES): Remove mcall-aix matches.
-
- * doc/fragments.texi: Replace -mcall-aix example with an ARM
- one.
- * doc/install.texi: Delete powerpc-*-eabiaix target.
- * doc/invoke.texi: Remove documentation of mcall-aix switch.
- * doc/tm.texi: Remove mcall-aix from example CPP_SPEC.
- * config.gcc: Delete powerpc-*-eabiaix target.
-
-2003-04-13 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/invoke.texi: Fix typos.
- * doc/tm.texi: Likewise.
-
-2003-04-12 Zack Weinberg <zack@codesourcery.com>
-
- * c-typeck.c (digest_init, push_init_level): Use CONSTRUCTOR_ELTS.
-
-2003-04-12 Zack Weinberg <zack@codesourcery.com>
-
- * tree.c (build_constructor): New function.
- * tree.h: Prototype it.
-
- * c-typeck.c (build_c_cast, pop_init_level)
- * profile.c (build_function_info_value, build_gcov_info_value)
- (create_profiler):
- Use build_constructor.
-
- * builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
-
- * objc/objc-act.c (build_constructor):
- Rename objc_build_constructor. Use build_constructor.
- (build_objc_string_object, objc_add_static_instance)
- (init_def_list, init_objc_symtab, init_module_descriptor)
- (generate_static_references, build_selector_translation_table)
- (build_descriptor_table_initializer, generate_descriptor_table)
- (build_protocol_initializer, build_ivar_list_initializer)
- (generate_ivars_list, build_dispatch_table_initializer)
- (generate_dispatch_table, generate_protocol_list)
- (build_category_initializer, build_shared_structure_initializer):
- Update to match.
-
-2003-04-12 Zack Weinberg <zack@codesourcery.com>
-
- * intl.h: #define gcc_gettext_width to strlen when !ENABLE_NLS.
-
-2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11-protos.h
- (m68hc11_eq_compare_operator): Declare
- * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register new predicate.
- * config/m68hc11/m68hc11.c (m68hc11_eq_compare_operator): New predicate
- (d_register_operand): Check the operand mode.
- (hard_addr_reg_operand): Likewise.
-
-2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.md ("decrement_and_branch_until_zero"): New
- pattern for dbcc/ibcc generation for 68HC12.
- ("doloop_end"): New pattern.
- ("m68hc12_dbcc_dec_hi"): New pattern for dbeq/dbne.
- ("m68hc12_dbcc_inc_hi"): New pattern for ibeq/ibne.
- ("m68hc12_dbcc_dec_qi"): New pattern.
- ("m68hc12_dbcc_inc_qi"): New pattern.
- (split): Add split for the above when we can't use dbcc/ibcc due to
- reloading.
- (peephole2): Add peephole2 to generate the above when possible.
-
-2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.md ("bitcmpqi" split): No need to test the
- mode of operand 0.
- (peephole2 optimize const load): Likewise for operand 2.
- ("*rotlhi3_with_carry"): Change pattern to a const 1 rotate which
- clobbers CC_REGNUM.
- ("*rotrhi3_with_carry"): Likewise.
- (ashift:DI 1 split): Update pattern to create the above rotate.
- (lshiftrt:DI 1 split): Likewise.
-
-2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.md (SOFT_Z_REGNUM): New constant.
- ("tstqi_z_used" split): Use it.
- ("cmphi_z_used"): Likewise.
- ("bitcmpqi_z_used"): Likewise; also use SP_REGNUM constant.
- ("cmpqi_z_used"): Likewise.
-
-2003-04-12 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/7910
- * config/i386/winnt.c (i386_pe_mark_dllimport): Fix thinko.
-
-2003-04-12 Zack Weinberg <zack@codesourcery.com>
-
- * configure.in: Check for wchar.h, mbstowcs, and wcswidth.
- * configure, config.in: Regenerate.
- * intl.c (gcc_gettext_width): New function.
- * intl.h: Prototype it.
-
-2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.h (TARGET_SWITCHES): Fix -mnominmax option;
- recognize -mnorelax.
- (reg_class): Add Z_OR_S_REGS to represent soft registers with Z
- (REG_CLASS_NAMES): Add its name.
- (REG_CLASS_CONTENTS): Define its content.
-
-2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/larith.asm (memcpy): Use ARG macro to access stack
- parameters so that offsets are valid for far definition.
- (__mulsi3): Likewise and use ret to return.
- (___adddi3, ___subdi3, ___notdi2, ): Don't use it to save the result.
-
-2003-04-12 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (rs6000_hash_constant): Skip '0' fields.
-
-2003-04-12 Alexandre Oliva <aoliva@redhat.com>
-
- * mklibgcc.in (libgcc-stage-start): For every multilib directory
- containing a libgcc.a, move lib* to the corresponding stage dir.
-
- * Makefile.in (stage1-start, stage2-start, stage3-start,
- stage4-start): Move $(SPECS) to specs in stage dir.
- (unstage1 unstage2 unstage3 unstage4): Move specs in stage dir
- back as $(SPECS).
-
- * mklibgcc.in (libgcc-stage-start): Move into the stage directory
- object files from the non-libgcc/ multilib directories as well.
-
-2003-04-11 Geoffrey Keating <geoffk@apple.com>
-
- * profile.c (read_counts_file): Initialise 'checksum'.
-
- * emit-rtl.c (gen_rtx): Really correct typo.
-
- PR c++/9393
- * doc/invoke.texi (Debugging Options): Document -frandom-seed.
- * configure.in: Check for gettimeofday.
- * tree.c (flag_random_seed): Define.
- (default_flag_random_seed): New.
- (append_random_chars): Use flag_random_seed rather than trying
- to acquire randomness here.
- * tree.h (default_flag_random_seed): Declare.
- * toplev.c (display_help): Add -frandom-seed and -fstack-limit-*
- descriptions.
- (decode_f_option): Handle -frandom-seed.
- (print_switch_values): Call default_flag_random_seed.
- * flags.h (flag_random_seed): Declare.
- * configure: Regenerate.
- * config.in: Regenerate.
- * config/alpha/t-crtfm: Use -frandom-seed.
-
- * doc/extend.texi (Empty Structures): New.
-
- * c-pch.c: Include flags.h. Add comments to routines.
- (struct c_pch_validity): New.
- (get_ident): Update PCH file version number.
- (pch_init): Output current debugging type.
- (c_common_valid_pch): Check debugging type.
- * Makefile.in (c-pch.o): Update dependencies.
- * flags.h (debug_type_names): Declare.
- * toplev.c (debug_type_names): Move out of decode_g_option.
-
-2003-04-11 Eric Christopher <echristo@redhat.com>
-
- * emit-rtl.c (gen_rtx): Fix typos.
-
-2003-04-11 Richard Henderson <rth@redhat.com>
-
- * emit-rtl.c (gen_rtx): Zero '0' fields.
-
-2003-04-11 Richard Henderson <rth@redhat.com>
-
- PR c++/10202
- * expr.c (expand_expr): Use COMPLETE_OR_UNBOUND_ARRAY_TYPE_P
- not COMPLETE_TYPE_P for re-invoking layout_decl.
-
-2003-04-11 Simon Law <sfllaw@engmail.uwaterloo.ca>
-
- * doc/bugreport.texi: Fix paragraph breaking between sections
- in preparation for TeXinfo's paragraph indentation fixes.
- * doc/extend.texi: Ditto.
- * doc/invoke.texi: Ditto.
- * doc/objc.texi: Ditto.
- * doc/gcov.texi: Wrap 'gcov' in @command{}.
- * doc/invoke.texi (Darwin Options): Add a preamble.
-
-2003-04-11 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.c (tls_model_chars): Remove.
- (ix86_encode_section_info, ix86_strip_name_encoding): Remove.
- (local_symbolic_operand): Use SYMBOL_REF_LOCAL_P.
- (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
- (tls_symbolic_operand_1): Likewise.
- (legitimate_pic_address_disp_p): Use SYMBOL_REF_LOCAL_P.
- * config/i386/i386.h (TARGET_ENCODE_SECTION_INFO): Remove.
- (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
- * config/i386/winnt.c (i386_pe_encode_section_info): Replace
- bits "copied from i386.h" with default_encode_section_info.
-
-2003-04-11 Richard Henderson <rth@redhat.com>
-
- * rtl.def (SYMBOL_REF): Add two 0 fields.
- * gengtype.c (adjust_field_rtx_def): Handle them.
- * print-rtl.c (print_rtx): Print them.
- * rtl.h (SYMBOL_REF_DECL, SYMBOL_REF_FLAGS): New.
- (SYMBOL_FLAG_FUNCTION, SYMBOL_REF_FUNCTION_P): New.
- (SYMBOL_FLAG_LOCAL, SYMBOL_REF_LOCAL_P): New.
- (SYMBOL_FLAG_SMALL, SYMBOL_REF_SMALL_P): New.
- (SYMBOL_FLAG_TLS_SHIFT, SYMBOL_REF_TLS_MODEL): New.
- (SYMBOL_FLAG_EXTERNAL, SYMBOL_REF_EXTERNAL_P): New.
- (SYMBOL_FLAG_MACH_DEP): New.
- * optabs.c (init_one_libfunc): Zap fake SYMBOL_REF_DECL.
- * varasm.c (make_decl_rtl): Set SYMBOL_REF_DECL.
- (assemble_static_space): Set SYMBOL_REF_FLAGS.
- (assemble_trampoline_template): Likewise.
- (output_constant_def, force_const_mem): Likewise.
- (default_encode_section_info): New.
- * output.h: Declare it.
- * target-def.h (TARGET_ENCODE_SECTION_INFO): Use it.
-
-2003-04-11 Richard Henderson <rth@redhat.com>
-
- * libfuncs.h (LTI_setbits, LTI_gcov_flush, LTI_gcov_init): New.
- (setbits_libfunc, gcov_flush_libfunc, gcov_init_libfunc): New.
- * optabs.c (init_optabs): Initialize them.
- (init_libfuncs): Use init_one_libfunc.
- * calls.c (expand_call): Use gcov_flush_libfunc.
- * expr.c (store_constructor): Use setbits_libfunc.
- * function.c (expand_main_function): Use init_one_libfunc.
- * profile.c (create_profiler): Use gcov_init_libfunc and DECL_RTL.
-
-2003-04-11 Mark Mitchell <mark@codesourcery.com>
-
- * doc/c-tree.texi (Functions): Remove DECL_REAL_CONTEXT
- documentation; add DECL_FRIEND_CONTEXT.
-
-2003-04-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * doc/install.texi (hppa): Update links for HP-UX patches. Revise
- notes on linker selection and configuration for 64-bit HP-UX port.
- * doc/invoke.texi (hppa): Remove hppa text from description for
- -ffunction-sections and -fdata-sections. Document -static, -nolibdld
- and -threads options.
-
- * pa-hpux10.h (LIB_SPEC): Add link options to resolve dependency of
- libc.a on libdld.sl when -static is specified and -nolibdld is not
- specified.
- * pa64-hpux.h (LIB_SPEC): Likewise.
- * pa-hpux11.h (LIB_SPEC): Likewise.
- (LINK_SPEC): Add __gcc_plt_call as an undefined symbol when -shared
- is not specified.
-
-2003-04-11 Zack Weinberg <zack@codesourcery.com>
-
- * config/darwin-c.c (darwin_pragma_unused): Use lookup_name,
- not IDENTIFIER_LOCAL_VALUE.
-
-2003-04-11 Richard Henderson <rth@redhat.com>
-
- PR c/10201
- * expr.c (expand_expr): Move DECL_RTL frobbing ...
- * stor-layout.c (layout_decl): ... here.
-
-2003-04-11 James A. Morrison <ja2morri@uwaterloo.ca>
-
- * doc/invoke.texi: Eliminate extra white-space caused by
- @gccoptlist{ on its own line.
- * doc/invoke.texi: Ensured there are two spaces between each option.
- * doc/invoke.texi: Re-wrapped option lines that were too wide.
- Added @gol to options that didn't have them.
-
-2003-04-11 Nathan Sidwell <nathan@codesourcery.com>
-
- * Makefile.in (loop-init.o): Do not depend on gcov-io.h,
- gcov-iov.h.
-
- Simplify interface to gcov reading and writing.
- * gcov-io.h (gcov_file, gcov_position, gcov_length, gcov_buffer,
- gcov_alloc, gcov_modified, gcov_errored): Move into ...
- (struct gcov_var gcov_var): ... this static structure.
- (gcov_write_unsigned, gcov_write_counter, gcov_write_string):
- Return void.
- (gcov_read_unsigned, gcov_read_couter, gcov_read_string): Return
- read object.
- (gcov_read_bytes, gcov_write_bytes): Set error flag on error.
- (gcov_reserve_length): Remove.
- (gcov_write_tag): New.
- (gcov_write_length): Adjust.
- (gcov_read_summary, gcov_write_summary): Adjust.
- (gcov_eof, gcov_ok): Rename to ...
- (gcov_is_eof, gcov_is_error): ... here. Return error code.
- (gcov_save_position, gcov_resync): Rename to ...
- (gcov_position, gcov_seek): ... here.
- (gcov_skip, gcov_skip_string): Remove.
- (gcov_error): Remove.
- (gcov_open, gcov_close): Adjust.
- * gcov.c (find_source): Take const char *, copy it on allocation.
- (read_graph_file): Adjust.
- (read_count_file): Adjust.
- * libgcov.c (gcov_exit): Adjust.
- * gcov-dump.c (tag_function, tag_blocks, tag_arcs, tag_lines,
- tag_arc_counts, tag_summary): Return void. Adjust.
- (struct tag_format): Adjust proc member.
- (dump_file): Adjust gcov calls.
-
-2003-04-11 Alexandre Oliva <aoliva@redhat.com>
-
- * Makefile.in (fixinc.sh): Pass BUILD_LIBERTY as LIBERTY to
- mkfixinc.sh.
- * fixinc/mkfixinc.sh (defs): Add LIBERTY.
- * configure.in (STMP_FIXINC, STMP_FIXPROTO): Don't disable on
- build != host sysrooted builds.
- * configure.in (SYSTEM_HEADER_DIR): Make sure it contains
- TARGET_SYSTEM_ROOT even on sysrooted natives.
- * configure: Rebuilt.
-
-2003-04-10 Zack Weinberg <zack@codesourcery.com>
-
- * c-decl.c (struct binding_level): Add shadowed_tags and
- function_body; remove this_block, tag_transparent, and
- subblocks_tag_transparent; update comments.
- (clear_binding_level, lookup_tag_reverse): Kill.
- (make_binding_level): Use ggc_alloc_cleared or memset.
- (lookup_tag): Remove struct binding_level* parameter. All
- callers changed. Just look at IDENTIFIER_TAG_VALUE, and
- current_binding_level->tags if asked for thislevel_only or if
- we might have to diagnose "struct foo; union foo;"
- (pushlevel): Ignore argument. Do not push another binding
- level on the transition from the parameters to the top level
- of the function body; just tweak the flags and proceed.
- (poplevel): Overhaul. Clear IDENTIFIER_TAG_VALUEs; on exiting
- a function body, separate the parameter list from the
- top-level local variables.
- (set_block): Do nothing.
- (pushtag): Set IDENTIFIER_TAG_VALUE and add an entry to
- shadowed_tags if necessary.
- (warn_if_shadowing): Nuke the special case for local shadowing
- parameter.
- (pushdecl): Do not create a shadow entry if we are replacing
- an older decl in the same binding level.
- (pushdecl_function_level): Tweak for new way of indicating
- function scope.
- (shadow_tag_warned): Use TYPE_NAME, not lookup_tag_reverse.
- (start_function): Don't set subblocks_tag_transparent.
- (finish_function): Fix up the binding_level stack for totally
- empty functions. Otherwise, don't call poplevel.
-
- * c-common.c (shadow_warning): MANDATORY argument is no longer
- necessary. Always use plain warning.
- * c-common.h: Update to match.
-
- * cfglayout.c (scope_to_insns_initialize): Clear block when we
- hit the FUNCTION_DECL.
- * function.c: Do not create cyclic tree structure.
-
-2003-04-10 Zack Weinberg <zack@codesourcery.com>
-
- * c-tree.h (struct lang_identifier): Replace global_value,
- local_value members with symbol_value, tag_value. Kill
- implicit_decl and limbo_value.
- (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_LOCAL_VALUE,
- IDENTIFIER_LIMBO_VALUE, IDENTIFIER_IMPLICIT_DECL,
- C_MISSING_PROTOTYPE_WARNED): Kill.
- (IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE,
- C_DECL_IMPLICIT, C_DECL_ISNT_PROTOTYPE): New.
- (C_DECL_ANTICIPATED): Rename to C_DECL_INVISIBLE.
- (implicit_decl_warning, lookup_name_current_level,
- record_function_scope_shadow): Don't prototype.
- (pushdecl_function_level): Prototype.
-
- * c-decl.c (truly_local_externals): New variable.
- (struct binding_level): Adjust commentary.
- (get_function_binding_level, clear_limbo_values,
- record_function_scope_shadow): Kill.
- (lookup_name_current_level, implicit_decl_warning): Are now static.
- (any_external_decl, record_external_decl): New static functions.
- (clone_underlying type): Split out of pushdecl.
- (c_print_identifier): Update to match changes to struct
- lang_identifier.
- (poplevel): Delete #if 0 block. Make externals invisible
- instead of clearing their IDENTIFIER_SYMBOL_VALUEs. Don't
- call clear_limbo_values. Refer to IDENTIFIER_SYMBOL_VALUE not
- IDENTIFIER_GLOBAL_VALUE or IDENTIFIER_LOCAL_VALUE.
- (duplicate-decls): For real parm decl after a forward decl,
- set TREE_ASM_WRITTEN here. Allow void foo(...) followed by
- foo(...) { } with only a warning. Say whether a previous
- declaration was implicit.
- (warn_if_shadowing): Now handles all shadowing, not just
- local-over-local. Clarify comments.
- (pushdecl): Rewritten. There is no longer a distinction
- between global and local symbol values; they're all
- IDENTIFIER_SYMBOL_VALUE. Call record_external_decl on all
- DECL_EXTERNAL decls, and use any_external_decl to check
- against previous externals. Kill #if 0 blocks. Don't
- tolerate error_mark_node being NULL.
- (pushdecl_top_level): Handle only those cases which
- Objective C (the only user) needs.
- (pushdecl_function_level): New function.
- (implicitly_declare): Create ordinary decls with
- C_DECL_IMPLICIT set. Recycle old decls, however they got
- created.
- (lookup_name): It's always IDENTIFIER_SYMBOL_VALUE. Return 0
- for C_DECL_INVISIBLE symbols.
- (lookup_name_current_level): Likewise. Use chain_member.
- (c_make_fname_decl): Don't muck with DECL_CONTEXT.
- Use pushdecl_function_level.
- (builtin_function): Use C_DECL_INVISIBLE.
- (start_function): Don't muck with IDENTIFIER_IMPLICIT_DECL.
- Use C_DECL_ISNT_PROTOTYPE and C_DECL_IMPLICIT.
- (store_parm_decls): It's IDENTIFIER_SYMBOL_VALUE now.
- (identifier_global_value): Same. Must scan
- global_binding_level in extremis.
-
- * c-typeck.c (undeclared_variable): New static function, split
- from build_external_ref.
- (build_external_ref): Use DECL_CONTEXT, not
- IDENTIFIER_LOCAL_VALUE, to decide whether a local hides
- an instance variable. Restructure for clarity.
- * objc/objc-act.c: Use identifier_global_value, not
- IDENTIFIER_GLOBAL_VALUE.
-
-2003-04-08 Jonathan Wakely <redi@gcc.gnu.org>
-
- * doc/extend.texi (Template Instantiation): Refer to ISO standard,
- not Working Paper.
- * doc/invoke.texi (C++ Dialect Options): Same.
-
-2003-04-10 Zack Weinberg <zack@codesourcery.com>
-
- * tree.c (tree_operand_check_failed): New function.
- * tree.h (TREE_OPERAND_CHECK, TREE_OPERAND_CHECK_CODE,
- TREE_RTL_OPERAND_CHECK): New checking macros.
- (TREE_OPERAND, SAVE_EXPR_CONTEXT, SAVE_EXPR_RTL,
- RTL_EXPR_SEQUENCE, RTL_EXPR_RTL, WITH_CLEANUP_EXPR_RTL,
- CONSTRUCTOR_ELTS, LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY,
- EXIT_BLOCK_RETURN, LOOP_EXPR_BODY, EXPR_WFL_NODE,
- EXPR_WFL_FILENAME_NODE, EXPR_WFL_FILENAME, TARGET_EXPR_SLOT,
- TARGET_EXPR_INITIAL, TARGET_EXPR_CLEANUP): Use the new
- checking macros.
-
-Thu Apr 10 23:52:30 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- PR inline-asm/8803
- * function.c (instantate_virtual_regs): Verify that all ASM statements
- match after the virutal regs instantiation.
-
-2003-04-10 Steve Ellcey <sje@cup.hp.com>
-
- * ia64-protos.h (addp4_optimize_ok): New.
- * ia64.c (addp4_optimize_ok): New.
- * ia64.md (*ptr_extend_plus_1): Use addp4_optimize_ok.
- (*ptr_extend_plus_2): Ditto.
-
-2003-04-10 Steve Ellcey <sje@cup.hp.com>
-
- * expr.c (expand_assignment): Extend offset_rtx with convert_to_mode
- not with convert_memory_address.
- (store_constructor): Ditto, and same for copy_size_rtx.
- (expand_expr): Ditto.
-
-2003-04-10 Douglas B Rupp <rupp@gnat.com>
-
- * config/i386/i386.c (ix86_ms_bitfield_layout_p): Fix formatting.
-
-2003-04-10 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/lib2funcs.S (__xtensa_sync_caches): Flush data cache
- even if it is configured to be write-through.
-
-2003-04-10 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (larl_operand): Do not allow symbols
- marked with '@'.
- (s390_encode_section_info): Mark symbols with forced 1-byte
- alignment with '@'.
- (s390_strip_name_encoding): Strip '@'.
- (legitimize_pic_address): Handle symbols that are not valid
- LARL operands in 64-bit mode.
-
-2003-04-10 Andrew Haley <aph@redhat.com>
-
- * tree-inline.c (inlinable_function_p): Disable inlining for
- synchronized methods.
-
-2003-04-09 Steven Bosscher <steven@gcc.gnu.org>
-
- * c-common.h (lang_statement_code_p): Remove declaration.
- (statement_code_p): Ditto.
- (c_common_stmt_codes): Define; list of c-common statement codes.
- (statement_code_p): New extern declaration.
- (STATEMENT_CODE_P): Define.
- (INIT_STATEMENT_CODES): Define.
- * c-common.c (statement_code_p): Kill the function, declare
- as an array of bools instead.
- (lang_statement_code_p): Remove.
- (walk_stmt_tree): Use STATEMENT_CODE_P not statement_code_p.
- (c_safe_from_p): Ditto.
- * c-objc-common.c (c_objc_common_init): Use INIT_STATEMENT_CODES
- to initialize the statement_code_p array.
- * tree-inline.c (walk_tree): Use STATEMENT_CODE_P instead of
- statement_code_p.
- (copy_tree_r): Ditto.
- * cp/cp-tree.h (cp_stmt_codes): Define; list of C++ specific
- statement tree codes.
- * cp/lex.c (cxx_init): Add missing print line break. Use
- INIT_STATEMENT_CODES to initialize the statement_code_p array.
- * cp/parser.c (cp_parser_statement): Use STATEMENT_CODE_P
- instead of statement_code_p.
- * cp/pt.c (tsubst_expr): Ditto.
- * cp/tree.c (verify_stmt_tree_r): Ditto.
- (cp_statement_code_p): Remove.
- (init_tree): Don't set lang_statement_code_p, it's gone.
-
-2003-04-09 Dan Nicolaescu <dann@ics.uci.edu>
- Zack Weinberg <zack@codesourcery.com>
-
- * regrename.c (struct du_chain): Use a bitfield for reg_class.
- * cse.c (struct qty_table_elem, struct table_elt, struct set):
- Use bitfields for fields holding enum rtx_code or
- enum machine_mode values. Add comments explaining size choices.
-
-2003-04-09 Alexandre Oliva <aoliva@redhat.com>
-
- * config/fp-bit.c (unpack_d): Handle pair of doubles with
- different signs correctly.
-
-2003-04-09 Vladimir Makarov <vmakarov@redhat.com>
-
- * sched-deps.c (reg_pending_barrier_mode): New enumeration.
- (reg_pending_barrier): Make it of the enumeration type.
- (sched_analyze_2): Define the barrier as MOVE_BARRIER or
- TRUE_BARRIER.
- (sched_analyze): Ditto.
- (sched_analyze_insn): Ditto. Use anti-dependencies for
- MOVE_BARRIER and true-dependencies as TRUE_BARRIER.
- (init_deps_global): Initialize the barrier as NO_BARRIER.
-
-2003-04-09 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.c (issue_nops_and_insn): Add new parameter.
- Check that asm insn starts on a new cycle. Add nops after asm
- insn to end bundle.
- (bundling): Move insn type evaluation from the loop. Call
- issue_nops_and_insn with the new parameter. Ignore changing
- position for nops after asm insn.
-
-2003-04-09 Alexandre Oliva <aoliva@redhat.com>
-
- * optabs.c: Comment that gen_add2_insn and others may actually
- return emitted insns, if the gen functions turn out to return
- emitted insns.
- * reload1.c (reload_cse_move2add): Cope with emitted insns from
- gen_add2_insn.
-
-2003-04-09 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (move_operand): Allow symbolic_operand,
- but not tls_symbolic_operand.
- (ia64_expand_load_address): Remove scratch operand.
- (ia64_expand_tls_address): Split out from ia64_expand_move.
- (ia64_expand_move): Split symbolics only after reload.
- (ia64_emit_cond_move): New.
- * config/ia64/ia64-protos.h: Update.
- * config/ia64/ia64.md (movsi_symbolic, movdi_symbolic): Remove.
- (symbolic splitter): Accept SImode operands too.
- (cmove splitter): Use ia64_emit_cond_move.
-
-2003-04-09 Nick Clifton <nickc@redhat.com>
-
- * doc/install.texi: Note that ARM toolchains need binutils 2.13 or
- newer.
- * config/arm/elf.h (SUBTARGET_ASM_FLOAT_SPEC): Pass -mfpu=softfpa
- instead of -mno-fpu.
- * config/arm/semi.h (ASM_SPEC): Likewise.
- * config/arm/xscale-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise,
- but only if -msoft-float is specified pass. Otherwise pass
- -mfpu=softvfp.
-
-2003-04-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * function.c (purge_addressof): Use free_INSN_LIST_node instead of
- free_EXPR_LIST_node.
-
-2003-04-08 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (fold): Use "fold" following build in more places.
- Optimize sqrt(x)*sqrt(x) as x, pow(x,y)*pow(z,y) as pow(x*z,y),
- pow(x,y)*pow(x,z) as pow(x,y+z) and x/pow(y,z) as x*pow(y,-z).
-
-2003-04-08 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (fold_builtin): Constant fold expressions as x*0.5
- instead of x/2.0. Optimize sqrt(pow(x,y)) as pow(x,y*0.5),
- log(pow(x,y)) as y*log(x), pow(exp(x),y) as exp(x*y),
- pow(sqrt(x),y) as pow(x,y*0.5) and pow(pow(x,y),z) as pow(x,y*z).
- Delete function scope "fcode" variable to avoid shadowing.
-
-2003-04-08 Kevin Buettner <kevinb@redhat.com>
-
- * dwarf2out.c (DWARF_ARANGES_HEADER_SIZE, DWARF_ARANGES_PAD_SIZE):
- Take into account DWARF_INITIAL_LENGTH_SIZE.
-
-2003-04-08 Hans-Peter Nilsson <hp@axis.com>
-
- * reorg.c (fill_slots_from_thread): When considering changing the
- insn following a reg-to-reg copy insn to use the source reg of the
- copy, bail out if there's overlap between the registers.
-
-2003-04-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * function.c (postponed_insns): New.
- (purge_addressof_1): Postpone processing of insns if addressofs
- are not put into stack.
- (purge_addressof): Process postponed insns.
-
-2003-04-08 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (NORMAL_MODE): If interrupt handler and TARGET_FMOVD,
- this is FP_MODE_DOUBLE .
- * sh.c (ra.h): #include.
- (push_regs): Add second parameter. Changed all callers.
- If necessary, set fpscr before saving floating point registers.
- (calc_live_regs): If interrupt handler and TARGET_FMOVD, always
- do saves / restores with SZ == 1.
- (sh_expand_prologue): If interrupt handler, don't use gen_toggle_sz.
- (sh_expand_epilogue): Likewise. For TARGET_FMOVD, if floating point
- registers are being restored, restore FPSCR only after restoring them.
-
-2003-04-08 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_init_builtins): Set opaque types
- regardless of architecture.
- (spe_init_builtins): Change V2SI and V2SF types to opaque types.
-
-2003-04-08 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (push_regs, calc_live_regs): Return int. Take single
- HARD_REG_SET * parameter. Changed all callers.
-
-Tue Apr 8 11:12:07 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (legitimate_pic_address_disp_p): Do not accept PLUS in the
- GOTOFF operand.
- (legitimize_pic_address): Move plus outside the unspec.
- * i386.c (legitimate_constant_p): Check (CONST (PLUS (UNSPEC ...
- for validity.
-
-2003-04-08 Nathan Sidwell <nathan@codesourcery.com>
-
- * gcov-io.h (gcov_save_position): Remove __inline__ from
- declaration.
-
-2003-04-07 Matt Kraai <kraai@alumni.cmu.edu>
-
- * doc/install.texi: Use @command and @samp for single- and
- multi-word commands respectively.
- * doc/makefile.texi: Likewise.
- * doc/sourcebuild.texi: Likewise.
-
-2003-04-07 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
- Richard Henderson <rth@redhat.com>
-
- PR c/9516
- * expr.c (safe_from_p): Rearrange to avoid deep recursion in
- favor of looping and tail recursion for TREE_LIST and binops.
-
-2003-04-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * loop.h (REGNO_FIRST_LUID, REGNO_LAST_LUID): Provide defaults
- for insns without luid.
-
-2003-04-07 Glen Nakamura <glen@imodulo.com>
-
- PR opt/8634
- * explow.c (maybe_set_unchanging): Don't flag non-static const
- aggregate type initializers with RTX_UNCHANGING_P.
-
-2003-04-07 Richard Henderson <rth@redhat.com>
-
- PR opt/8634
- * function.c (purge_addressof_1): Don't try arithmetics for
- unchanging memories.
-
-2003-04-07 Janis Johnson <janis187@us.ibm.com>
-
- * doc/sourcebuild.texi (Test Suites): Document testing support for
- gcov and profile-directed optimizations; describe gcc.misc-tests.
-
-Mon Apr 7 22:19:59 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- PR target/10077
- * i386.md (movsi_1, movsi_nointerunit_1): Fix SSEMOV alternative.
-
-2003-04-07 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * doc/rtl.texi (Comparison operations): Update to
- record the allowed comparison modes.
-
-2003-04-07 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_common_init_builtins): Rename all
- V2SI_type_node to opaque_V2SI_type_node. Rename all
- V2SF_type_node to opaque_V2SF_type_node.
- (rs6000_init_builtins): Define opaque_V2SI_type_node and
- opaque_V2SF_type_node.
- (is_ev64_opaque_type): The types opaque_V2SI_type_node and
- opaque_V2SF_type_node are opaque types.
-
-2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
-
- * gcse.c (replace_store_insn): Use single_set.
-
-2003-04-07 Nathan Sidwell <nathan@codesourcery.com>
-
- Change gcov file interface to single file at a time.
- * gcov-io.h: Replace IN_LIBGCC1 with IN_LIBGCOV. Use IN_GCOV.
- Convert to C89 prototypes.
- (gcov_file, gcov_length, gcov_position, gcov_buffer, gcov_alloc,
- gcov_error, gcov_modified): New static variables.
- (gcov_open, gcov_close, gcov_read_bytes, gcov_write_bytes): New
- functions.
- (gcov_write_unsigned, gcov_write_counter, gcov_write_string,
- gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust.
- (gcov_read_summary, gcov_write_summary): Adjust.
- (gcov_save_position, gcov_reserve_length, gcov_write_length):
- Adjust.
- (gcov_resync, gcov_skip, gcov_skip_string): Adjust.
- (da_file_open, da_file_close, da_file_eof, da_file_error): Remove.
- (da_file_position, da_file_seek, da_file_write, da_file_read):
- Remove.
- (gcov_error, gcov_eof, gcov_ok, gcov_time): New functions.
- * gcov.c (gcov_type): Don't typedef here.
- (IN_GCOV): #define
- (read_graph_file, read_count_file): Adjust.
- * gcov-dump.c (gcov_type): Don't typedef here.
- (IN_GCOV): #define.
- (tag_function, tag_blocks, tag_arcs, tag_lines, tag_arc_counts):
- Remove FILE parameter, adjust.
- (struct tag_format): Adjust proc member.
- (dump_file): Adjust.
- * libgcov.c (IN_LIBGCOV): #define.
- (gcov_exit): Adjust.
- * loop-init.c: Don't #include gcov-io.h
- * profile.c (struct counts_entry): New structure to hold counter
- values.
- (struct section_reference, struct da_index_entry): Remove.
- (bbg_file, da_file): Remove.
- (htab_counts_index_hash, htab_counts_index_eq,
- htab_counts_index_del): Replace with ...
- (htab_counts_entry_hash, htab_counts_entry_eq,
- htab_counts_entry_del): ... these.
- (cleanup_counts_index, index_counts_file): Remove.
- (read_counts_file): New function.
- (get_exec_counts): Adjust.
- (compute_branch_probabilities): Don't free the exec counts here.
- (branch_prob): Adjust.
- (init_branch_prob): Adjust.
- (end_branch_prob): Adjust.
-
-2003-04-07 Aldy Hernandez <aldyh@redhat.com>
-
- * doc/invoke.texi (RS/6000 and PowerPC Options): Document
- -mfloat-gprs.
-
- * config/rs6000/rs6000.c: Delete rs6000_fprs.
- Declare rs6000_float_gprs.
- Declare rs6000_float_gprs_string.
- (rs6000_parse_float_gprs_option): New.
- (rs6000_override_options): Genericize rs6000_parse_* calls to use
- rs6000_parse_yes_no_option.
- Change check for cpu=8540, to use TARGET_E500.
- (rs6000_parse_isel_option): Delete.
- (rs6000_parse_spe_option): Delete.
- (rs6000_parse_vrsave_option): Delete.
-
- * config/rs6000/rs6000.h: Rename rs6000_fprs to rs6000_float_gprs.
- Define rs6000_float_gprs_string.
- (TARGET_OPTIONS): Add rs6000_float_gprs option.
-
- * config/rs6000/eabi.h (TARGET_FPRS): Change to use rs6000_float_gprs.
-
- * config/rs6000/eabispe.h: Set rs6000_float_gprs.
-
-Mon Apr 7 14:36:24 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- PR opt/10024
- * cfglayout.c (cfg_layout_redirect_edge):
- Redirect any branch edges unified with the fallthru one.
- * cfgrtl.c (force_nonfallthru_and_redirect): Do not special
- case fallthru edges when called via cfglayout.c
-
-2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
-
- * c-typeck.c (output_init_element): Check for type == error_mark_node.
-
-2003-04-07 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*zero_extendqisi2_h8300hs): Always
- split.
- (a splitter): Do zero-extension via HImode.
-
-2003-04-07 James A. Morrison <ja2morri@uwaterloo.ca>
-
- * doc/invoke.texi: Eliminate extra white-space caused by
- @gccoptlist{ on its own line.
- * doc/invoke.texi: Ensured there are two spaces between each option.
- * doc/invoke.texi: Re-wrapped option lines that were too wide.
- Added @gol to options that didn't have them.
-
-2003-04-07 James A Morrison <ja2morri@student.math.uwaterloo.ca>
-
- * doc/extend.texi (Darwin Pragmas): Fix spelling of Mac OS.
-
-2003-04-06 Zack Weinberg <zack@codesourcery.com>
-
- * tree.c (tree_size): For all 'c' and 'x' nodes, look directly
- at the sizes of the relevant structures, rather than relying
- on TREE_CODE_LENGTH. Call lang_hooks.tree_size to get the
- sizes of any such we don't know about. Use
- lang_hooks.identifier_size for IDENTIFIER_NODE.
-
- (initializer_zerop): Use CONSTRUCTOR_ELTS.
- * tree.def: Update commentary. Make fourth element of
- the definition for all 'c' and 'x' nodes zero.
-
- * langhooks.h: New hook, tree_size / LANG_HOOKS_TREE_SIZE.
- * langhooks-def.h: Update to match.
- * langhooks.c: New default, lhd_tree_size.
-
- * c-common.def (SRCLOC): Kill.
- * c-pretty-print.c (pp_c_postfix_expression [case SRCLOC]):
- Remove entirely - was already #if-ed out.
-
-
-2003-04-06 Zack Weinberg <zack@codesourcery.com>
-
- * mklibgcc.in: Use a here document to avoid running afoul of
- shells that generate control-A from "echo \1".
-
-2003-04-06 Aldy Hernandez <aldyh@redhat.com>
-
- * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mspe
- option.
-
- * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Set
- rs6000_spe.
-
- * config/rs6000/eabi.h (TARGET_E500): Define.
-
- * config/rs6000/rs6000.h (TARGET_E500): Define.
- (TARGET_OPTIONS): Add spe= option.
- Declare rs6000_spe and rs6000_spe_string extern.
-
- * config/rs6000/rs6000.c (branch_positive_comparison_operator):
- Change TARGET_SPE to TARGET_E500.
- (ccr_bit): Change TARGET_SPE to TARGET_E500. Check for
- !TARGET_FPRS.
- (print_operand): Same.
- (rs6000_generate_compare): Same.
- (output_cbranch): Same.
- (rs6000_spe): Declare.
- (rs6000_spe_string): Declare.
- (rs6000_override_options): Call rs6000_parse_spe_option.
- (rs6000_parse_spe_option): New.
-
-2003-04-06 Steven Bosscher <steven@gcc.gnu.org>
-
- * hashtable.c (gcc_obstack_init): Delete this function
- and everything related to it.
- * hashtable.h: Remove prototype.
- * bitmap.c (bitmap_element_allocate): Cleanup redundant
- defines. Cleanup some unnecessary whitespace.
- * defaults.h (obstack_chunk_alloc): Redefine with
- appropriate casts for libiberty obstacks.
- (obstack_chunk_free): Ditto.
- (OBSTACK_CHUNK_SIZE): Define, default to 0.
- (gcc_obstack_init): Define as a call to _obstack_begin.
- * tree.c (print_obstack_statistics): Delete this unused
- function.
- * tree.h (obstack): Don't forward-declare.
- (print_obstack_statistics): Delete prototype.
- (print_obstack_name): Ditto.
- (gcc_obstack_init): Ditto.
- * rtl.h (gcc_obstack_init): Ditto.
- * java/jv-scan.c (gcc_obstack_init): Delete this
- function, its prototype and related defines.
- * java/jvgenmain.c (gcc_obstack_init): Delete this
- function, and related defines.
- * java/parse-scan.y (obstack_chunk_alloc): Don't define.
- (obstack_chunk_free): Ditto
-
-2003-04-06 Geoffrey Keating <geoffk@apple.com>
-
- * dbxout.c (dbxout_handle_pch): Move prototype out from
- #if defined DBX_DEBUGGING_INFO.
-
-2003-04-05 Nathan Sidwell <nathan@codesourcery.com>
-
- * gcov.c (struct arc_info): Replace local_span with cycle.
- (struct block_info): Replace u.span with u.cycle. Add is_call_return.
- (solve_flow_graph): Set is_call_return.
- (add_line_counts): Adjust. In block mode, blocks attach to last line.
- (accumulate_line_counts): Find graph cycles, not spanning tree.
- (output_branch_count): Adjust.
- (output_lines): Adjust.
- * doc/gcov.texi: Update.
-
-2003-04-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*zero_extendqisi2_h8300hs): Change
- the second alternative to "#".
-
-2003-04-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (single_one_operand): Use GET_MODE_MASK.
- (single_zero_operand): Likewise.
-
-2003-04-05 Daniel Berlin <dberlin@dberlin.org>
-
- * Makefile.in (df.o): Depend on alloc-pool.h, not obstack.h.
- * df.c: Include alloc-pool.h, not obstack.h.
- (df_ref_obstack): Remove.
- (df_ref_pool, df_link_pool): Add pools.
- (df_alloc): Init the new pools.
- (df_free): And free them.
- (df_link_create): Use the pools.
- (df_ref_create): Ditto.
-
-2003-04-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * simplify-rtx.c: Fix formatting.
-
-2003-04-05 Andrew Pinski <apinski@apple.com>
-
- * config/rs6000/rs6000.c (addrs_ok_for_quad_peep): Allow addr2
- reg with reg1 == reg2 and offset1 = -8.
-
-2003-04-05 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (rs6000_rtx_costs): Halve Power4
- multiply costs. Correct Power4 divide costs.
- * config/rs6000/power4.md: Restore multiply and FP latency.
-
-2003-04-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * alias.c (find_base_term): Export.
- * rtl.h (find_base_term): Declare.
- * gcse.c (find_moveable_store): Test for flag_non_call_exceptions
- instead of flag_exceptions. Move test for parameter passing ...
- (store_killed_in_insn): ... here.
-
-2003-04-05 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- PR bootstrap/10267
- * doc/install.texi (*-*-solaris2): /bin/ksh is not just recommended
- for configuring.
-
-2003-04-04 Geoffrey Keating <geoffk@apple.com>
-
- * dbxout.c (scope_labelno): Add GTY.
- (have_used_extensions): Add GTY.
- (source_label_number): Add GTY.
- (lastfile): Add GTY.
- (lastfile_is_base): New.
- (base_input_file): New.
- (dbxout_handle_pch): New.
- (dbx_debug_hooks): Add handle_pch.
- (xcoff_debug_hooks): Likewise.
- (dbxout_function_end): Remove scope_labelno.
- (dbxout_init): Set base_input_file.
- (dbxout_handle_pch): New.
- (dbxout_source_file): Honour lastfile_is_base.
- * dwarfout.c (dwarf_debug_hooks): Add dummy handle_pch.
- * sdbout.c (sdb_debug_hooks): Add dummy handle_pch.
- * vmsdbgout.c (vmsdbg_debug_hooks): Add dummy handle_pch.
- * dwarf2out.c (dwarf2_debug_hooks): Add dummy handle_pch.
- * debug.c (do_nothing_debug_hooks): Add dummy handle_pch.
- * debug.h (struct gcc_debug_hooks): Add handle_pch.
- * c-pch.c (pch_init): Don't call start_source_file, but do call
- handle_pch.
- (c_common_write_pch): Call handle_pch.
- (c_common_read_pch): Don't call start_source_file,
- or end_source_file.
-
-Fri Apr 4 17:43:52 2003 Olivier Hainque <hainque@act-europe.fr>
-
- * emit-rtl.c (get_mem_attrs): Adjust alignment tests determining
- use of default attributes to agree MEM_ALIGN macro.
-
-Fri Apr 4 17:33:24 2003 Joel Brobecker <brobecker@gnat.com>
-
- * dbxout.c (dbxout_type): When printing type index of range type
- whose bounds are printed in octal format, print type of parent type if
- it exists so enumerated type descriptions are not transformed
- into unsigned types.
-
-2003-04-04 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- compute_a_shift_cc.
- * config/h8300/h8300.c (shift_one): Update the CC status.
- (shift_two): Likewise.
- (output_a_shift_cc): Set cc_inline and cc_special.
- (compute_a_shift_cc): New.
- * config/h8300/h8300.md (shift insns): Use compute_a_shift_cc.
-
-2003-04-04 Richard Henderson <rth@redhat.com>
-
- * cse.c (fold_rtx): Fix 03-30 change; do check insn non-null.
-
-2003-04-04 Loren James Rittle <ljrittle@acm.org>
-
- * fixinc/inclhack.def (bsd_stdio_attrs_conflict): New.
- * fixinc/fixincl.x: Rebuilt.
- * fixinc/tests/base/stdio.h: Regenerated.
-
-2003-04-04 Nathan Sidwell <nathan@codesourcery.com>
-
- * gcov.c (accumulate_line_counts): Fix span tree merge bug.
-
-Fri Apr 4 15:58:52 2003 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (ACTUAL_NORMAL_MODE): New macro, broken out of
- (NORMAL_MODE).
- * sh.c (fpscr_set_from_mem): Use ACTUAL_NORMAL_MODE.
-
-2003-04-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Add entries for Wolfgang
- Bangerth, DJ Delorie, Christian Ehrhardt, Christopher Faylor,
- Nathanael Nerode, Diego Novillo, Hartmut Penner, Volker Reichelt,
- Danny Smith, and Ulrich Weigand.
- Update Kriang Lerdsuwanakij and fix a typo in Janis Johnson's
- entry.
-
-2003-04-04 Nick Clifton <nickc@redhat.com>
-
- * config/sparc/sol2-bi.h: Revert previous delta.
- * config/sparc/sol2-gas-bi.h (AS_SPARC64_FLAG): Prepend -TSO
-
-2003-04-04 Nick Clifton <nickc@redhat.com>
-
- * config/v850/v850.c (expand_prologue): Only use register save
- helper functions if long calls are not being used.
- Add a clobber of r11 id using long calls.
- (pattern_is_ok_for_prologue): Account for the extra clobber.
- (construct_save_jarl): Likewise.
- * config/v850/v850.md (prolog pattern): Do not use this pattern
- for v850e's.
-
-2003-04-04 Andreas Schwab <schwab@suse.de>
-
- * stor-layout.c (layout_decl): Avoid syntax error in last change
- when PCC_BITFIELD_TYPE_MATTERS is defined but not
- EMPTY_FIELD_BOUNDARY.
-
-2003-04-03 Jason Merrill <jason@redhat.com>
-
- PR c/10175
- * jump.c (never_reached_warning): Revert patch of 2002-11-02.
- Look backwards for a line note.
-
-2003-04-03 Neil Booth <neil@daikokuya.co.uk>
-
- * fix-header.c (read_scan_file): Defer switch processing.
-
-2003-04-03 Matt Austern <austern@apple.com>
-
- * cpppch.c (reset_ht): Remove.
- (cpp_read_state): Remove loop to reset hashtable identifiers.
- * ggc-common.c (gt_pch_save): Add call to gt_pch_fixup_stringpool
- after pch file is written.
- * ggc.h (gt_pch_fixup_stringpool): Declare.
- * stringpool.c (ht_copy_and_clear): Define. Callback. Copy
- hashnode's value to another hashtable, then clear the original.
- (saved_ident_hash): Define.
- (gt_pch_save_stringpool): Create saved_ident_hash, use it to
- store definitions in ident_hash, and clear ident_hash.
- (gt_pch_fixup_stringpool): Define. Restore definitions from
- saved_ident_hash to ident_hash, then destroy saved_ident_hash.
-
-Thu Apr 3 22:27:40 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * cfgrtl.c (update_bb_for_insn): Do not set block for barriers.
-
-2003-04-03 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/10157
- * gcse.c (can_copy_p): Rename it to can_copy.
- (can_copy_init_p): Remove.
- (compute_can_copy): Use can_copy instead of can_copy_p.
- (can_copy_p): New exported function. Call compute_can_copy.
- (hash_scan_set): Use it.
- (gcse_main): Don't call compute_can_copy.
- (bypass_jumps): Don't call compute_can_copy.
- * rtl.h (can_copy_p): Declare.
- * loop.c (scan_loop): Don't move the source and add a reg-to-reg
- copy if the mode doesn't support copy operations.
-
-2003-04-03 Jason Merrill <jason@redhat.com>
-
- * Makefile.in (unstrap): Also remove stage_last.
-
- * dwarf2out.c (lookup_filename): Don't check for "<internal>".
- (dwarf2out_source_line): Don't do anything if line==0.
-
- * stor-layout.c (do_type_align): New fn, split out from...
- (layout_decl): ...here. Do all alignment calculations for
- FIELD_DECLs here.
- (update_alignment_for_field): Not here.
- (start_record_layout, debug_rli): Remove unpadded_align.
- * tree.h (struct record_layout_info_s): Remove unpadded_align.
- * c-decl.c (finish_enum): Don't set DECL_SIZE, DECL_ALIGN
- or DECL_MODE on the CONST_DECLs.
- (finish_struct): Don't mess with DECL_ALIGN.
-
-Thu Apr 3 18:57:19 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (print_operand): Do not bypass output_addr_const at flag_pic.
-
-Thu Apr 3 17:08:09 2003 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (sh_function_ok_for_sibcall): Return 0 if the current
- function is an interrupt handler.
-
- * sh.c (sh_expand_epilogue): Avoid clash of temp register for
- restoring target registers with EH_RETURN_STACKADJ_RTX; use
- multiple registers in round-robin fashion.
-
-2003-04-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * gengtype-lex.l (IWORD): Add CHAR_BITFIELD.
- * system.h (CHAR_BITFIELD): New.
-
-2003-04-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Generalize to accept GT
- and LE.
- (another peephole2): Likewise.
-
-2003-04-03 Nick Clifton <nickc@redhat.com>
-
- * config/sparc/sol2-bi.h (ASM_CPU64_DEFAULT_SPEC): Add -TSO.
- (DEF_ARCH64_SPEC): Likewise.
-
-Thu Apr 3 09:53:40 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (constant_address_p): Use legitimate_constant_p.
- (legitimate_address_p): Do not use CONSTANT_ADDRESS_P.
-
-2003-04-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- gtle_operator.
- * config/h8300/h8300.c (gtle_operator): New.
- * config/h8300/h8300.h (PREDICATE_CODES): Add an entry for
- gtle_operator.
- * config/h8300/h8300.md (a peephole2): Generalize to accept GT
- and LE.
-
-2003-04-02 Richard Henderson <rth@redhat.com>
-
- * libgcc-std.ver (_Unwind_GetCFA): New.
- * unwind-dw2.c (_Unwind_GetCFA): New.
- * unwind-libunwind.c (_Unwind_GetCFA): New.
- * unwind-sjlj.c (_Unwind_GetCFA): New.
- * unwind.h: Declare it.
-
-Thu Apr 3 00:31:21 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- PR inline-asm/8088
- * i386.c (ix86_hard_regno_mode_ok): Return 0 for MMX/SSE registers
- when MMX/SSE is not available.
-
-2003-04-02 Mike Stump <mrs@apple.com>
-
- * doc/install.texi (Specific): Update pointers to apple.com.
-
-Thu Apr 3 00:18:49 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (override_options): Disable red zone by default on i386.
- (compute_frame_layout, ix86_force_to_memory, ix86_free_from_memory):
- Do not test TARGET_64BIT together with TARGET_RED_ZONE
-
-2003-04-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Tighten the condition.
-
-2003-04-02 Richard Henderson <rth@redhat.com>
-
- * longlong.h (umul_ppmm) [alpha]: Use __builtin_alpha_umulh.
-
-2003-04-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-04-02 Richard Henderson <rth@redhat.com>
-
- * except.c (sjlj_find_directly_reachable_regions): Recognize when
- must-not-throw region has been deleted.
-
-2003-04-02 Richard Henderson <rth@redhat.com>
-
- * dwarf2out.c (output_call_frame_info): Ignore fde->nothrow as an
- optimization when flag_exceptions not enabled.
-
-2003-04-02 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/rs6000/rs6000.c
- (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Redefine the
- macros.
- (rs6000_issue_rate): Add case for 8540.
- (rs6000_use_sched_lookahead): New function.
-
- * config/rs6000/8540.md: Rename SIU units into SU ones and MIU
- units into MU ones.
- (ppc8540_branch, ppc8540_cr_logical): Add one cycle in the
- reservation before retirement.
- (ppc8540_multiply, ppc8540_load, ppc8540_store,
- ppc8540_simple_float, ppc8540_vector_load, ppc8540_vector_store):
- Remove additional cycle in the reservation before retirement.
- (ppc8540_mfcr, ppc8540_mtcrf, ppc8540_mtjmpr): Add missed
- reservation of ppc8540_issue.
-
-2003-04-02 Andreas Schwab <schwab@suse.de>
-
- * real.c (decode_ieee_single): Fix decoding of SNaN bit.
-
-2003-04-01 Richard Henderson <rth@redhat.com>
-
- * except.c (convert_from_eh_region_ranges_1): Smash REG_EH_REGION
- notes for nothrow calls if flag_forced_unwind_exceptions.
- (build_post_landing_pads): Mind flag_forced_unwind_exceptions.
- (sjlj_find_directly_reachable_regions): Likewise.
- (reachable_handlers): Likewise.
- (can_throw_external): Likewise.
- (collect_one_action_chain): Record cleanups after catch-all and
- must-not-throw if flag_forced_unwind_exceptions.
- * flags.h (flag_forced_unwind_exceptions): Declare.
- * toplev.c (flag_forced_unwind_exceptions): New.
- (lang_independent_options): Add it.
- * doc/invoke.text: Add it.
-
-2003-04-01 David Mosberger <davidm@hpl.hp.com>
-
- * config/ia64/crti.asm: Clean up trailing whitespace.
- Remove trailing hashes (#) from identifiers.
-
- * config/ia64/crtn.asm: Ditto.
-
- * config/ia64/crtend.asm: Remove trailing hashes (#) from
- identifiers.
- (__do_global_ctors_aux): Align to 32-byte boundary. Add unwind
- directives. Drop explicit bundling---it just makes the code
- harder to read. Don't save/restore gp needlessly.
-
- * config/ia64/crtbegin.asm: Remove trailing hashes (#) from
- identifiers (they're only needed if the identifier would clash
- with a register name otherwise).
- (__do_global_dtors_aux): Align to 32-byte boundary. Add unwind
- directives. Drop explicit bundling---it just makes the code
- harder to read.
- (__do_jv_register_classes): Ditto.
- (.fini_array): Remove "progbits" (newer
- assemblers don't like wrong section-types).
- (.init_array): Ditto.
-
-2003-04-01 Roger Sayle <roger@eyesopen.com>
-
- PR fortran/9974
- * gcse.c (reg_killed_on_edge): New function to test whether the
- given reg is overwritten by any instruction queued on an edge.
- (bypass_block): Ignore substitutions killed on incoming edges.
- Don't bypass outgoing edges that have queued instructions.
-
-2003-04-01 Alexandre Oliva <aoliva@redhat.com>
-
- * real.h (EXP_BITS): Make room for...
- (struct real_value): ... added canonical bit.
- (struct real_format): Added pnan.
- (mips_single_format, mips_double_format, mips_extended_format,
- mips_quad_format): New.
- * real.c: Copy p to pnan in all formats.
- (get_canonical_qnan, get_canonical_snan): Set canonical bit.
- (real_nan): Use pnan to compute significand's shift.
- (real_identical): Disregard significand in canonical
- NaNs.
- (real_hash): Likewise. Take signalling into account.
- (encode_ieee_single, encode_ieee_double, encode_ieee_quad):
- Disregard significand bits in canonical NaNs. Set all bits of
- canonical NaN if !qnan_msb_set.
- (encode_ibm_extended, decode_ibm_extended): Likewise. Use
- qnan_msb_set to tell the base double format.
- (ibm_extended_format): Use 53 as pnan.
- (mips_single_format, mips_double_format, mips_extended_format,
- mips_quad_format): Copied from the corresponding ieee/ibm
- formats, with qnan_msb_set false.
- * config/mips/iris6.h (MIPS_TFMODE_FORMAT): Use mips_extended_format.
- * config/mips/linux64.h (MIPS_TFMODE_FORMAT): Use mips_quad_format.
- * config/mips/mips.c (override_options): Use mips_single_format
- and mips_double_format. Default TFmode to mips_quad_format.
- * config/mips/t-linux64 (tp-bit.c): Define QUIET_NAN_NEGATED.
- * config/mips/t-irix6: Likewise.
- * config/mips/t-mips (fp-bit.c, dp-bit.c): Likewise.
- * config/fp-bit.c (pack_d, unpack_d): Obey it.
-
-2003-04-01 Geoffrey Keating <geoffk@apple.com>
-
- * unwind-dw2-fde-darwin.c (DESTRUCTOR_MAY_BE_CALLED_LIVE): New.
- (live_image_destructor): Reset image to initial state.
- (examine_objects): Set DESTRUCTOR_MAY_BE_CALLED_LIVE.
-
-2003-04-01 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * config/sparc/sparc.c (input_operand): Accept bare
- CONSTANT_P_RTX operands.
-
-2003-04-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * gcse.c (struct ls_expr): Added pattern_regs field.
- (ldst_entry): Initialize it.
- (extract_mentioned_regs, extract_mentioned_regs_helper): New.
- (store_ops_ok): Use regs precomputed by them.
- (find_loads, store_killed_in_insn, load_kills_store): Change return
- type to bool.
- (store_killed_before, store_killed_after): Take position of register
- set in account.
- (reg_set_info): Store position of the setter.
- (gcse_main): Enable store motion.
- (mems_conflict_for_gcse_p): Enable load motion of non-symbol mems.
- (pre_insert_copy_insn, update_ld_motion_stores, insert_store): Prevent rtl
- sharing.
- (simple_mem): Enable store motion of non-symbol mems.
- (regvec): Type changed.
- (LAST_AVAIL_CHECK_FAILURE): New.
- (compute_store_table_current_insn): New.
- (build_store_vectors): Computation of availability and anticipatability
- moved ...
- (compute_store_table, find_moveable_store): ... here.
- (delete_store): Remove senseless comment.
- (store_motion): Reorganize.
-
-2003-04-01 Kevin Buettner <kevinb@redhat.com>
-
- * config/mips/mips.c (override_options): Provide mappings for
- HI_REGNUM and LO_REGNUM.
- * config/mips/mips.h (MD_DBX_FIRST): Define.
-
-2003-04-01 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * combine.c (merge_outer_ops): Fix typo.
-
- * varasm.c (make_decl_one_only): Revert 2003-03-09 patch.
-
-2003-04-01 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md,
- power4.md,rios1.md,rios2.md,rs64.md}: Change mult_compare to
- imul_compare. Add lmul_compare.
- * config/rs6000/power4.md: Bump some latencies. Model extra cycle
- in second pair of dispatch slots. Model stores more accurately.
- Tweak multiply model. Add bypasses for CR instructions dependent
- on complicated compares.
- * config/rs6000/rs6000.md (mulsi3): Name imul_compare patterns.
- (muldi3): Add lmul_compare patterns.
- * config/rs6000/rs6000.c (rs6000_variable_issue): Move FPLOAD_UX
- and FPSTORE_UX to split instructions and add COMPARE,
- DELAYED_COMPARE, IMUL_COMPARE, LMUL_COMPARE, IDIV, LDIV.
- (rs6000_adjust_cost): Add IMUL_COMPARE and LMUL_COMPARE.
- (rs6000_rtx_costs): Separate POWER4 multiply case.
-
-2003-04-01 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_fixup_clobbered_return_reg):
- Do nothing if __builtin_return_address was not used.
-
-Tue Apr 1 18:18:23 CEST 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.md (test patterns): Allow memory operand in operand1.
-
-2003-02-31 Aldy Hernandez <aldyh@redhat.com>
-
- * testsuite/gcc.c-torture/execute/simd-3.c: New.
-
- * expr.c (expand_expr): Handle VECTOR_CST.
- (const_vector_from_tree): New.
-
- * varasm.c (output_constant): Handle VECTOR_CST.
-
- * c-typeck.c (digest_init): Build a vector constant from a
- VECTOR_TYPE.
-
- * config/rs6000/rs6000.c: Remove prototype for
- easy_vector_constant.
- (easy_vector_constant): Add mode parameter. Rewrite to handle
- more easy constants.
- (rs6000_emit_move): Pass mode to easy_vector_constant.
- Call emit_easy_vector_insn for SPE V2SI vector constant moves.
- (emit_easy_vector_insn): New.
- (easy_vector_same): New.
- (EASY_VECTOR_15): New macro.
- (EASY_VECTOR_15_ADD_SELF): New macro.
- (bdesc_2arg): Rename to xorv2si3.
- (easy_vector_constant_add_self): New.
- (input_operand): Allow vector constants.
-
- * config/rs6000/rs6000.h (PREDICATE_CODES): Add
- easy_vector_constant, easy_vector_constant_add_self.
- (EXTRA_CONSTRAINT): Add 'W'.
-
- * config/rs6000/rs6000-protos.h: Add prototype for
- easy_vector_constant, emit_easy_vector_insn.
-
- * config/rs6000/altivec.md (xorv8hi3): New.
- (xorv16qi3): New.
- Remove all _const0 patterns.
- (movv4si_internal): Rewrite to use code. Add vector constant to
- vector alternative. Add splitter.
- (movv8hi_internal): Same.
- (movv16qi_internal): Same.
- (movv4sf_internal): Same.
- Change the unspecs for vspltis* to use constants.
-
- * config/rs6000/spe.md ("xorv4hi3"): New.
- ("spe_evxor"): Rename to xorv2si3.
- ("xorv1di3"): New.
- Remove all _const0 patterns.
- (movv2si_internal): Rewrite to use code. Add vector constant to
- alternatives. Add splitter.
- (movv4hi_internal): Add vector constant to alternatives.
- (movv1di_internal): Same.
- (movv2sf_internal): Same.
-
-2003-03-31 Mark Mitchell <mark@codesourcery.com>
-
- PR c/9936
- * c-decl.c (grokdeclarator): Clear SAVE_EXPR_CONTEXT for
- variably-sized arrays in parameters.
- (set_save_expr_context): New function.
- (c_expand_body): Use it, via walk_tree.
-
-2003-03-31 Eric Christopher <echristo@redhat.com>
-
- * combine.c (can_combine_p): Allow ZERO_EXTRACT and STRICT_LOW_PART.
- (combinable_i3pat): Remove call to expand_field_assignment and
- #if 0'd code.
-
-2003-03-31 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/10278
- * c-common.c (finish_label_address_expr): Handle the
- error_mark_node.
-
-2003-03-31 Richard Henderson <rth@redhat.com>
-
- * real.c (real_identical): Reorg so as to not compare
- signalling for normals.
-
-2003-03-31 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (hard_reg_operand): Check the mode.
-
-2003-03-31 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Don't rely on REG_WAS_0
- notes as they are boggus.
- (m68hc11_gen_movqi): Likewise.
-
-2003-03-31 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (expand_prologue): For an interrupt handler
- save the soft registers after the frame pointer so that gdb can unwind
- the frame more easily.
- (expand_epilogue): Likewise in opposite order; allow to use X register
- as scratch if the return value is by reference.
-
-2003-03-31 Jason Merrill <jason@redhat.com>
-
- PR java/10145
- * stor-layout.c (update_alignment_for_field): Respect
- DECL_USER_ALIGN for zero-length bitfields, too.
- * c-decl.c (finish_struct): Don't set DECL_ALIGN for normal
- fields.
-
-2003-03-31 Matt Austern <austern@apple.com>
-
- * cpppch.c (struct cpp_savedstate): Add defs and n_defs members.
- (count_defs): Keep track of number of defs as well as total size.
- (write_defs): Put every definition in cpp_savedstate's defs array.
- (comp_hashnode): Define. Comparison function for qsort.
- (cpp_write_pch_deps): Sort definitions before writing them.
- (struct ht_node_list): Define. Like cpp_savedstate but simpler.
- (collect_ht_nodes): Define.
- (cpp_valid_state): When verifying that undefined identifiers in
- the pch file are still undefined, read a sorted list of undefined
- identifiers, collect all defined identifiers into a sorted list,
- and walk through both lists to make sure there's no match.
-
-2003-03-31 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-03-31 Michael Matz <matz@suse.de>
-
- * config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Change 1 into 0.
-
-2003-03-31 Segher Boessenkool <segher@koffie.nl>
-
- PR target/10177
- * config/rs6000/rs6000.h (HARD_REGNO_RENAME_OK): New.
- * config/rs6000/rs6000.c (compute_vrsave_mask): Don't mark
- all call-clobbered registers as used.
-
-2003-03-31 Michael Matz <matz@suse.de>
-
- * cppexp.c (cpp_classify_number): Accept '.' after "0x".
- * testsuite/gcc.dg/cpp/c99-hexfloat-3.c: New file.
-
-2003-03-31 Nathan Sidwell <nathan@codesourcery.com>
-
- * gcov.c: Add -a & -u options.
- (struct arc_info): Add local_span, is_call_non_return,
- is_nonlocal_return, is_unconditional flags, remove is_call flag.
- (struct block_info): Add flags, is_call_site, is_nonlocal_return
- members. Make encodings a union with span member.
- (struct function_info): Add blocks_executed, line, src, line_next
- members.
- (struct coverage_info): Make branches a union with blocks member.
- (struct source_info): Add functions member.
- (object_summary, program_count): New global variables.
- (flag_all_blocks, flag_unconditional): New flags.
- (find_source, output_branch_count): New functions.
- (print_usage): Adjust.
- (options): Adjust.
- (process_args): Adjust.
- (read_graph_file) <GCOV_TAG_FUNCTION>: Adjust.
- <GCOV_TAG_BLOCKS>: Read flags.
- <GCOV_TAG_LINES>: Adjust.
- (read_count_file): Process SUMMARY tags.
- (solve_flow_graph): Set is_unconditional and clear is_call_site
- appropriately.
- (add_branch_counts): Adjust. Don't count unconditional branches.
- (add_line_counts): Deal with all-blocks mode, accumulate block
- coverage.
- (accumulate_line_counts): Adjust, generate local spanning tree for
- all-blocks mode.
- (output_lines): Adjust.
- * profile.c (branch_prob): Alter GCOV_FUNCTION_TAG record.
- * doc/gcov.texi: Document.
-
-2003-03-31 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md: Organize peephole2's that transform
- (compare (reg:HI) (const_int)).
-
-2003-03-31 Roger Sayle <roger@eyesopen.com>
-
- * emit-rtl.c (dconstm2, dconsthalf): New real constants.
- (init_emit_once): Initialize dconstm2 and dconsthalf here.
- * real.h (dconstm2, dconsthalf): Add prototypes here.
- * real.c (real_sqrt): Use dconsthalf rather than local copy.
- * builtins.c (fold_builtin): When optimizing sqrt(exp(x)) as
- exp(x/2.0) remember to fold the division if possible.
- Fold sin(0.0) as 0.0, cos(0.0) as 1.0, pow(x,1.0) as x,
- pow(x,-1.0) as 1.0/x, pow(x,2.0) as x*x, pow(x,-2.0) as
- 1.0/(x*x) and pow(x,0.5) as sqrt(x).
-
-2003-03-31 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a new peephole2): New.
-
-2003-03-31 Richard Sandiford <rsandifo@redhat.com>
-
- * gcse.c (simple_mem): Return false for floating-point accesses
- if flag_float_store is true.
-
-2003-03-30 Roger Sayle <roger@eyesopen.com>
-
- * gcse.c (gcse_constant_p): New function to identify constants
- suitable for constant propagation, including COMPARE with two
- integer constant arguments.
- (hash_scan_set): Use gcse_constant_p.
- (find_avail_set): Likewise.
- (cprop_insn): Likewise.
- (do_local_cprop): Likewise.
- (find_implicit_sets): Likewise.
- (find_bypass_set): Likewise.
-
-2003-03-30 Matt Kraai <kraai@alumni.cmu.edu>
-
- * except.h: Remove definition of varray_type.
-
-2003-03-30 Richard Henderson <rth@redhat.com>
-
- PR opt/10011, opt/10252:
- * toplev.c (rest_of_compilation): Run purge_builtin_constant_p
- before post-gcse cse pass.
-
-2003-03-30 Roger Sayle <roger@eyesopen.com>
-
- * dojump.c (do_jump): Copy SUBREGs into a pseudo for comparison.
-
-2003-03-30 DJ Delorie <dj@redhat.com>
-
- * profile.c (instrument_edges): Make sure any newly created
- jump insns have correct jump label info.
-
-2003-03-30 Richard Henderson <rth@redhat.com>
-
- * cfgbuild.c (make_edges): Use tablejump_p.
- * cfgcleanup.c (label_is_jump_target_p): Likewise.
- * cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise.
- * cfgrtl.c (flow_delete_block_noexpunge): Likewise.
- (try_redirect_by_replacing_jump): Likewise.
- (redirect_edge_and_branch): Likewise.
- * cse.c (fold_rtx): Likewise.
- * jump.c (delete_related_insns): Likewise.
- * rtlanal.c (get_jump_table_offset): Likewise.
- * ssa-ccp.c (ssa_ccp_df_delete_unreachable_insns): Likewise.
-
-2003-03-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * Makefile.in (STRICT_WARN): Don't warn for ISO C constructs.
- (STRICT2_WARN): Likewise.
-
-2003-03-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- PR other/6955
- * collect2.c (collect_wait): Use WCOREDUMP and fix output message.
- * system.h (WCOREDUMP, WCOREFLG): Define if necessary.
-
-2003-03-30 Richard Henderson <rth@redhat.com>
-
- PR c/10083
- * config/alpha/alpha.md (umuldi3_highpart): Change to expander;
- don't zero_extend const inputs.
-
-2003-03-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * reload1.c (reload_cse_move2add): Fix a comment typo.
-
-2003-03-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Remove useless code.
-
-2003-03-29 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*iorsi3_and_ashift): New.
- (*iorsi3_and_lshiftrt): Likewise.
- (*iorsi3_zero_extract): Likewise.
-
-2003-03-29 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*insv_si_8_8): New.
- (*insv_si_8_8_lshiftrt_8): Likewise.
- (a peephole2): Likewise.
-
-2003-03-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi: Add Eric Botcazou and Roger Sayle.
- Uniformly use bugfix instead of bug fix.
-
-2003-03-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- PR doc/895
- * ONEWS: Remove those items that already appear in the EGCS
- release notes on our web pages.
-
-2003-03-29 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Respect
- TARGET_HARD_FLOAT. Reformat.
- (FUNCTION_ARG_REGNO_P): Likewise, and remove unneeded casts.
-
-2003-03-28 Albert Chin-A-Young <china@thewrittenword.com>
-
- * gcc/fixinc/inclhack.def: Update solaris_mutex_init_1 to
- work on Solaris 2.5.1.
-
-2003-03-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*addsi3_and_r_1): Put under plus:SI
- section of h8300.md
- (*addsi3_and_nor_r_1): Likewise.
-
-2003-03-29 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_emit_prologoue): Make sure backchain is
- set up before any trapping memory access if flag_non_call_exceptions.
-
-2003-03-29 Alan Modra <amodra@bigpond.net.au>
-
- * reload1.c (reload_as_needed): Allow a USE in asm reloads.
-
- * loop.c: (find_mem_in_note_1, find_mem_in_note): Comment.
-
-2003-03-28 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * configure.in: Clarify comments.
- * configure: Regenerate.
-
-2003-03-28 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.md ("literal_pool_31"): Output pool anchor
- label even if pool empty when generating PIC.
- ("literal_pool_31", "literal_pool_64"): Coding style cleanup.
-
-2003-03-28 Kazu Hirata <kazu@cs.umass.edu>,
- Dhananjay Deshpande <dhananjayd@kpit.com>
-
- PR target/10205
- * config/h8300/h8300.c (h8300_initial_elimination_offset):
- Correct the offset computation when TARGET_NORMAL.
-
-2003-03-28 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR target/10067
- * config/sparc/sparc.md (jump pattern): Correct order
- when issuing the annuling marker.
-
-2003-03-28 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR c/8281
- * config/sparc/sparc.md (movdi_insn_sp32_v9): Remove 'f-f' alternative.
- (movdi reg/reg split): Match only on sparc32, and v9 when int regs.
-
-2003-03-28 Alan Modra <amodra@bigpond.net.au>
-
- * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_BSS): Remove unnecessary
- globalize_label.
- * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
- * config/i960/i960.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
- * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
- * config/mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
- * config/mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
- * config/sparc/sparc.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
- * config/v850/v850.c (v850_output_aligned_bss): Likewise.
-
-2003-03-28 Alan Modra <amodra@bigpond.net.au>
-
- * loop.c: (find_mem_in_note_1, find_mem_in_note): New functions.
- (replace_loop_mems): Add "written" param. Remove invalid REG_EQUAL
- notes after hoisting.
- (load_mems): Adjust replace_loop_mems call.
-
-2003-03-28 Eric Botcazou <ebotcazou@libertysurf.fr>
- Richard Henderson <rth@redhat.com>
-
- PR target/10114 and PR target/10084
- * dwarf2out.c (mem_loc_descriptor): Handle LO_SUM.
-
-2003-03-27 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.md (adddi_er_high_l): Valid only after reload.
-
-2003-03-27 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (fold_inf_compare): New function to simplify FP
- comparisons against +Infinity or -Infinity.
- (fold): Optimize floating point comparisons against Infs and NaNs.
-
-2003-03-27 Janis Johnson <janis187@us.ibm.com>
-
- * libgcov.c: Provide only dummy functions if libc is not available.
-
-2003-03-27 Richard Henderson <rth@redhat.com>
-
- * real.h (struct real_value): Add signalling.
- (EXP_BITS): Decrement.
- * real.c (get_canonical_qnan): Don't set MSB-1.
- (get_canonical_snan): Likewise. Set signalling.
- (real_identical): Compare signalling.
- (round_for_format): Remove force-one-bit on code.
- (real_nan): Likewise. Set signalling.
- (encode_ieee_single): Add force-one-bit code; honor signalling.
- (encode_ieee_double, encode_ieee_extended, encode_ieee_quad): Likewise.
- (decode_ieee_single): Set signalling.
- (decode_ieee_double, decode_ieee_extended, decode_ieee_quad): Likewise.
-
-2003-03-27 Olivier Hainque <hainque@act-europe.fr>
-
- PR ada/9953
- * ada/Makefile.in (gnatlib configuration for HPUX): Split
- the general section for HPUX into specific sections for
- HPUX 10 and HPUX 11. Fix the setting of TGT_LIB in the HPUX
- 11 case.
-
-2003-03-27 Glen Nakamura <glen@imodulo.com>
-
- PR opt/10087
- * loop.c (loop_givs_reduce): Skip bivs with duplicate locations
- while incrementing giv.
- (record_biv): Check for duplicate biv locations and
- set (struct induction *) v->same if found.
-
-2003-03-27 David Mosberger <davidm@hpl.hp.com>
-
- * unwind-libunwind.c (uw_frame_state_for): Adjust for libunwind
- v0.9 API change: replace read of UNW_REG_HANDLER with
- unw_get_proc_info().
- (_Unwind_GetLanguageSpecificData): Replace read of UNW_REG_LSDA
- with unw_get_proc_info().
- (_Unwind_GetRegionStart): Replace UNW_REG_PROC_START with
- unw_get_proc_info().
-
-2003-03-27 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/rs6000/8540.md: Use presence_set instead of absence_set.
-
-2003-03-26 Richard Henderson <rth@redhat.com>
-
- * c-decl.c (finish_function): Always defer if DECL_DECLARED_INLINE_P.
-
-2003-03-26 Roger Sayle <roger@eyesopen.com>
-
- PR bootstrap/10051, PR bootstrap/10169.
- * mips-tfile.c (init_file): Don't provide a static initializer.
- (initialize_init_file): Initialize the contents of init_file.
- (add_file): Call initialize_init_file if not already initialized.
-
-2003-03-26 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_optimize_prolog): Do not save/restore
- registers used for global asm variables.
- (s390_frame_info, s390_arg_frame_offset): Likewise.
- (s390_emit_prologue, s390_emit_epilogue): Likewise.
-
-2003-03-26 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/rs6000/8540.md: New file.
-
- * config/rs6000/{40x.md, 603.md, 6xx.md, 7450.md, 7xx.md, mpc.md,
- power4.md, rios1.md, rios2.md, rs64.md}: Add mult_compare to
- reservations for imul.
-
- * config/rs6000/rs6000.md: Include 8540.md. Change
- delayed_compare onto mult_compare for insns generating
- multiplication.
- (mult_compare, fpsimple, brinc, vecdiv, veccmpsimple, vecfdiv):
- New type attribute values.
-
- * config/rs6000/spe.md (*negsf2_gp, *abssf2_gpr): Use type
- fpsimple instead of fp.
- (*divsf3_gpr): Use type vecfdiv instead of fp.
- (spe_evfsabs, spe_evfsnabs, spe_evfsneg): Use type vecsimple
- instead of vecfloat.
- (spe_evfsdive): Use type vecfdiv instead of vecfloat.
- (spe_brinc): Use type brinc instead of veccomplex.
- (spe_evaddw, spe_evaddiw): Use type vecsimple instead of
- veccomplex.
- (spe_evdivws, spe_evdivwu): Use type vecdiv instead of veccomplex.
- (*movv2si_internal, *movv1di_internal, *movv4hi_internal,
- *movv2sf_internal): Define type attribute values for all
- alternatives.
- (cmpsfeq_gpr, cmpsfgt_gpr, cmpsflt_gpr): Use type veccmp instead
- of fpcompare.
- (tstsfeq_gpr, tstsfgt_gpr, tstsflt_gpr): Use type veccmpsimple
- instead of fpcompare.
-
-2003-03-26 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/power4.md: Allow delay between dispatch and
- function units for simple instructions. Correct store units.
- Allow branch to occupy as many dispatch slots as necessary.
-
-2003-03-26 Jakub Jelinek <jakub@redhat.com>
-
- * config/ia64/ia64.c (ia64_expand_op_and_fetch): Fix comment.
- (ia64_expand_compare_and_swap): Use always DImode ar.ccv,
- zero extend old to it.
- * config/ia64/ia64.md (cmpxchg_acq_si): Remove mode from ccv
- operand.
-
-2003-03-26 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR target/7784
- * reload.c (find_reloads_address): Handle
- (PLUS (PLUS (REG) (REG)) (CONST_INT)) form for
- all base registers.
-
-2003-03-25 Marcelo Abreu <mmabreu@inf.ufrgs.br>
-
- PR other/10203
- * version.c: Reference the GCC web site in the URL.
-
-2003-03-26 Alan Modra <amodra@bigpond.net.au>
-
- * c-incpath.c (add_standard_paths): Add both "translated" and
- non-translated header paths.
-
-2003-03-25 Loren James Rittle <ljrittle@acm.org>
-
- * doc/install.texi (*-*-freebsd*): Update with known status.
-
-2003-03-21 Jason Merrill <jason@redhat.com>
-
- PR optimization/10171
- * unroll.c (unroll_loop): Don't delete the jump at the end unless
- we also delete a jump at the beginning.
-
-2003-03-25 Stephane Carrez <stcarrez@nerim.fr>
-
- * doc/contrib.texi (Contributors): Mention self as 68HC11/68HC12
- contributor.
-
-Tue Mar 25 20:35:51 CET 2003 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_rtx_costs): For -fpic and x86-64 local symbolic
- constants are not expensive.
-
-Mon Mar 24 20:03:03 CET 2003 Jan Hubicka <jh@suse.cz>
-
- PR opt/10056
- * cfglayout.c (fixup_reorder_chain): Fix dealing with the conditional
- jump jumping to the next instruction.
- * cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
-
-2003-03-25 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/passes.texi (Passes): Properly document that we do not
- perform jump2 any longer; remove command-line option -dJ.
-
-2003-03-25 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/8746
- * config/i386/i386.md (and promoting splitters): Disable HImode to
- SImode promoting when the sign bit matters and is not preserved, or
- when TARGET_FAST_PREFIX is true. Disable promoting when optimizing
- for size.
-
-2003-03-24 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Extend to support loads
- in QImode and HImode.
-
-2003-03-24 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/t-m68hc11-gas (LIB1ASMFUNCS): Add _call_far and
- _return_far
- (MULTILIB_OPTIONS): Don't multilib on -mlong-calls.
- (MULTILIB_EXCEPTIONS): Likewise.
- * config/m68hc11/m68hc11.md ("call"): Support far calls for 68HC11
- by calling some board support routine.
- ("call_value"): Likewise.
- ("*return_void"): Likewise for return.
- ("*return_16bit"): Likewise.
- ("*return_32bit"): Likewise.
- * config/m68hc11/m68hc11.h (ASM_DECLARE_FUNCTION_NAME): Generate .far
- for 68HC11 too.
- (DWARF2_ADDR_SIZE): Use 4 so that addresses can
- * config/m68hc11/m68hc11.c (m68hc11_override_options): Accept
- -mlong-calls for 68HC11.
- * config/m68hc11/larith.asm (declare_near): New macro.
- (__premain, ___negsi2, ___one_cmplsi2, ___ashlsi3): Use it.
- (___ashrsi3, ___lshrsi3, ___lshrhi3, ___lshlhi3): Likewise.
- (___rotrhi3, ___rotlhi3, ___ashrhi3, ___ashrqi3): Likewise.
- (___lshlqi3, __divmodhi4, ___mulqi3, ___mulhi3): Likewise.
- (__mulhi32): Likewise.
- (ret): Update macro for 68HC11.
- (__far_trampoline): Implement for 68HC11.
- (__call_a16, __call_a32, __return_void, __return_16): New support
- routines for 68HC11 memory bank switching calling support.
- (__return_32): Likewise.
-
-2003-03-24 Neil Booth <neil@daikokuya.co.uk>
-
- * toplev.c (independent_decode_option): Don't skip a 'Y' prefix.
-
-2003-03-24 Janis Johnson <janis187@us.ibm.com>
-
- * doc/install.texi (Testing): Mention test result links from build
- status pages.
-
-2003-03-24 Mark Mitchell <mark@codesourcery.com>
-
- * function.c (put_var_into_stack): Change bool parameter to int.
- (gen_mem_addressof): Likewise.
- * rtl.h (gen_mem_addressof): Likewise.
- * tree.h (put_var_into_stack): Likewise.
- * config/alpha/alpha.c (alpha_gp_save_rtx): Adjust call to
- gen_mem_addressof or put_var_into_stack.
- * config/c4x/c4x.c (c4x_expand_builtin): Likewise.
- * config/ia64/ia64.c (spill_tfmode_operand): Likewise.
-
-2003-03-24 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-03-24 Jakub Jelinek <jakub@redhat.com>
-
- * dojump.c (do_jump): Handle UNSAVE_EXPR specially.
-
-2003-03-24 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/contrib.texi (Contributors): Update Janis Johnson.
-
-2003-03-23 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR target/10072
- * combine.c (simplify_if_then_else): Check that the mode
- has MODE_INT class before applying the (OP Z (mult COND C2))
- transformation.
-
-2003-03-23 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/9414
- * config/sparc/sparc.md (widening peepholes): Use
- widen_memory_access instead of change_address.
-
-2003-03-23 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/7086
- * c-typeck.c (c_mark_addressable): Adjust calls to
- put_var_into_stack.
- * expr.c (expand_expr): Likewise.
- * function.c (put_var_into_stack): Add rescan parameter. Do not
- call fixup_var_refs when rescan is false.
- (gen_mem_addressof): Likewise.
- (assign_parms): Adjust calls to put_var_into_stack.
- (setjmp_protect): Likewise.
- (setjmp_protect_args): Likewise.
- * rtl.h (gen_mem_addressof): Change prototype.
- * stmt.c (expand_decl): Adjust calls to put_var_into_stack.
- * tree.h (put_var_into_stack): Change prototype.
-
-2003-03-23 Arpad Beszedes <beszedes@cc.u-szeged.hu>
-
- PR middle-end/9967
- * builtins.c (expand_builtin_fputs): When optimizing for size,
- don't transform fputs into fwrite.
-
-2003-03-23 Glen Nakamura <glen@imodulo.com>
-
- PR c/8224
- * fold-const.c (extract_muldiv_1): Don't pass through type conversions
- when signedness changes for division or modulus.
-
-2003-03-24 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Remove unnecessary
- globalize_label.
-
-2003-03-23 Roger Sayle <roger@eyesopen.com>
-
- PR c/10178
- * stmt.c (expand_end_case_type): Check for overflow in range when
- determining whether to use a bit-test implementation.
-
-2003-03-23 Richard Henderson <rth@redhat.com>
-
- * cfgcleanup.c (try_optimize_cfg): Allow merging of tablejumps
- before flow2.
- * cfgrtl.c (try_redirect_by_replacing_jump): Similarly.
-
-2003-03-23 Richard Henderson <rth@redhat.com>
-
- PR opt/10116
- * ifcvt.c (find_if_block): Disallow tablejump insns outgoing
- from then_bb or else_bb after flow2.
-
-2003-03-23 Zack Weinberg <zack@codesourcery.com>
-
- * configure.in: Check whether it is necessary to link against
- libm to use ldexp.
- * configure: Regenerate.
- * Makefile.in: Add LDEXP_LIB substitution variable.
-
-2003-03-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md: Fix comment typos.
-
-2003-03-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.c (output_cbranch): Fix typo in comment.
-
-2003-03-22 Richard Henderson <rth@redhat.com>
-
- * cfgcleanup.c (insns_match_p): Do not do EQUIV substitution
- after reload.
-
-2003-03-22 DJ Delorie <dj at redhat dot com>,
- Bruce Korb <bkorb at gnu dot org>
-
- * fixinc/inclhack.def (solaris_mutex_init_1): New; Fix
- buggy Solaris 2.6 mutex/cond initializers.
- (solaris_mutex_init): Rename to solaris_mutex_init_2.
- * fixinc/fixincl.x: Regenerate.
- * fixinc/tests/base/pthread.h: Update.
- * fixinc/fixincl.c(initialize): be explicit about the default case
- and indicate verbose level when being very, very verbose.
- * fixinc/check.tpl(VERBOSE): provide a means for passing the value in
-
-2003-03-22 Andreas Jaeger <aj@suse.de>
-
- * config/i386/i386.c (ix86_init_machine_status): Return value.
-
-2003-03-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.c (output_cbranch, output_bb, output_bvb): Output nop for
- conditional branch to the following instruction. Use next_real_insn
- instead of next_active_insn.
- (output_dbra, output_movb, jump_in_call_delay): Use next_real_insn
- instead of next_active_insn.
-
-2003-03-22 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.md ("movti", "*movdi_31", "*movdf_31"): Use 'o'
- instead of 'm' constraint in forced-split alternatives.
- ("*adddi3_31", "*subdi3_31"): Likewise. Also, pass 0 instead of 1 as
- VALIDATE_ADDRESS parameter to operand_subword.
-
-2003-03-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (notice_update_cc): Correctly handle
- the case where the set destination is STRICT_LOW_PART.
-
-2003-03-22 Svein E. Seldal <Svein.Seldal@solidas.com>
-
- * config/c4x/t-c4x (INSTALL_LIBGCC): Make gcc recognize a c33 as a
- c30 instead of a c40 processor.
-
-2003-03-22 Alan Modra <amodra@bigpond.net.au>
-
- * combine.c (simplify_comparison <AND>): Use gen_int_mode. Tidy.
-
-2003-03-21 Zack Weinberg <zack@codesourcery.com>
-
- * c-common.c: Include intl.h.
- (shadow_warning): Rewrite to allow better diagnostic translations.
- * c-common.h: Update prototype of shadow_warning. Declare sw_kind enum.
- * c-decl.c (warn_if_shadowing): Update calls to shadow_warning;
- use it throughout.
- * Makefile.in (c-common.o): Add intl.h.
-
-2003-03-21 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config.gcc: Remove 'float_format'.
-
- * fixproto: Define NULL and size_t in generated stdlib.h and
- unistd.h. Kill unused required_stdlib_h, required_unistd_h.
- Rearrange file generation loop for readability. Generate time.h,
- string.h if missing.
- * tsystem.h: Include <string.h>, <time.h> unconditionally.
- * config.gcc: Blow away POSIX defines.
-
-2003-03-22 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.md ("call_value"): Fix trap check.
-
-2003-03-22 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.h (ASM_DECLARE_FUNCTION_NAME): Fix typo in
- writing .interrupt command.
- * config/m68hc11/m68hc11.md ("call"): Look at the symbol to see
- if it's a far or near function.
- ("call_value"): Likewise.
- * config/m68hc11/m68hc11.c (m68hc11_attribute_table): Add far and
- near attributes.
- (m68hc11_handle_fntype_attribute): Accept attributes on methods.
- (m68hc11_override_options): Ignore -mlong-calls for 68HC11.
- (m68hc11_initial_elimination_offset): Set current_function_far
- according to attributes.
- (expand_prologue): Likewise.
- (trap_handler_symbol): New global to keep track of trap handlers.
- (m68hc11_encode_section_info): Mark symbol as far if needed; set
- trap symbol.
- (m68hc11_is_far_symbol): New function.
- (m68hc11_is_trap_symbol): New function.
- * config/m68hc11/m68hc11-protos.h (m68hc11_is_far_symbol): Declare.
- (m68hc11_is_trap_symbol): Declare.
-
-2003-03-21 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_compute_frame_layout): Recompute fast prologues
- only when amount of saved regs changed.
- (ix86_init_machine_status): Initialize use_fast_prologue_epilgoue_nregs.
- * i386.h (machine_function): New fields use_fast_prologue_epilgoue_nregs.
-
-2003-03-21 Jan Hubicka <jh@suse.cz>
-
- PR inline-asm/7916
- * function.c (instantiate_virtual_regs_lossage): New function.
- (instantiate_virtual_regs_1): Use it.
- (instantiate_virtual_regs): Do not continue in substition when insn has
- been deleted.
-
-2003-03-21 Kazu Hirata <kazu@cs.umass.edu>
-
- * combine.c (make_field_assignment): Fix a warning.
-
-2003-03-21 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*insv_si_1_n_lshiftrt_16): New.
-
-2003-03-21 Dale Johannesen <dalej@apple.com>
-
- * config/rs6000/rs6000.h (REG_ALLOC_ORDER): Increase
- priority for R2 on Darwin.
- (HARD_REGNO_MODE_OK): Don't accept R31 for DFmode.
-
-2003-03-21 Kazu Hirata <kazu@cs.umass.edu>
-
- * combine.c (make_field_assignment): Remove unnecessary AND
- when storing into zero_extract.
-
-2003-03-21 Zack Weinberg <zack@codesourcery.com>
-
- * aclocal.m4 (gcc_AC_EXAMINE_OBJECT, gcc_AC_C_FLOAT_FORMAT): Delete.
- * configure.in: Don't call gcc_AC_C_FLOAT_FORMAT.
- * defaults.h: Remove reference to HOST_FLOAT_WORDS_BIG_ENDIAN
- in comment.
-
-2003-03-21 DJ Delorie <dj@redhat.com>
-
- * optabs.c (init_integral_libfuncs): Make sure we init at least up
- to "long long" size words.
-
-2003-03-21 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.h: Do not include fixdfdi.h on s390x.
- (TARGET_64BIT): Define as compile-time constant when IN_LIBGCC2.
- (MIN_UNITS_PER_WORD): Do not define when IN_LIBGCC2.
-
-2003-03-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR doc-bug/9813
- * doc/extend.texi: Move misplaced paragraph about underscores in
- variables in macros.
-
-2003-03-21 Eric Botcazou <ebotcazou@libertysurf.fr>
- Richard Henderson <rth@redhat.com>
-
- PR optimization/8366
- * config/sparc/sparc.h: (SYMBOLIC_CONST): New macro.
- (GO_IF_LEGITIMATE_ADDRESS): Use it. Reject the form
- PIC+SYMBOLIC_CONST in other modes than Pmode.
- (GO_IF_MODE_DEPENDENT_ADDRESS): Use it. Mark
- the form PIC+SYMBOLIC_CONST as mode dependent.
-
-2003-03-21 DJ Delorie <dj@redhat.com>
-
- * config/stormy16/stormy16.c (xstormy16_expand_arith): Make
- sure we always emit at least one insn.
-
-2003-03-21 Christopher Faylor <cgf@redhat.com>
-
- * config.gcc (i[34567]86-*-cygwin*): Use new common makefile
- stub t-cygming. Use common target header cygming.h. Add extra
- c_target_obj and cxx_target_obj file. Default cygwin to posix
- threading. Enforce i386 as float format.
- (i[34567]86-*-mingw*): Use new common makefile stub t-cygming.
- Remove cygwin.h as target header. Use common target header
- cygming.h Enforce i386 as float format. Correct typo.
- * config/i386/cygming.h: New file, containing definitions
- common to mingw32 and cygwin.
- * config/i386/cygwin.h: Remove definitions common to cygwin and
- mingw. Simplify special spec logic. Define "wrappers" around
- certain include path defines to accommodate -mno-cygwin.
- Remove some #if 0'ed code.
- (STANDARD_INCLUDE_DIR) Always define when not cross-compiling.
- (LINK_SPEC): Don't use cyg search prefix when -mno-cygwin.
- (GCC_DRIVER_HOST_INITIALIZATION): Define as call to mingw_scan.
- * config/i386/mingw32.h: Remove definitions common to cygwin and
- mingw.
- (EXTRA_OS_CPP_BUILTINS): Adjust.
- (TARGET_VERSION): Define.
- * config/i386/crtdll.h (EXTRA_OS_CPP_BUILTINS): Override
- mingw32.h definitions.
- (LIBGCC_SPEC): Add libmingwex.a as in mingw32.h.
- * config/i386/t-cygwin (EXTRA_GCC_OBJS): Define as cygwin1.o.
- Add compilation rules for cygwin1.o cygwin2.o.
- * config/i386/cygwin1.c: New file.
- * config/i386/cygwin2.c: New file.
- * config/i386/t-cygming: New makefile stub.
-
-2003-03-20 Richard Henderson <rth@redhat.com>
-
- * fold-const.c (extract_muldiv_1): Revert changing order of
- operands in case MULT_EXPR of 2003-02-16 patch.
-
-2003-03-20 Daniel Berlin <dberlin@dberlin.org>
- Merge changes from new-regalloc-branch
-
- From Michael Matz <matz@suse.de>
- * df.c (df_ref_record_1): Move init of loc to safe point.
- Only recurse on interesting things in parallels.
- Handle CLASS_CANNOT_CHANGE_MODE smarter.
- (df_uses_record): Ditto.
-
- * df.h (DF_REF_MEM_OK): New enum member, used to mark ref's which
- it's already okay to use memory operands in (IE doesn't require
- adding another insn or anything).
-
-2003-03-20 Richard Henderson <rth@redhat.com>
-
- PR middle-end/6348
- * explow.c (allocate_dynamic_stack_space): Handle STACK_SIZE_MODE
- different from word_mode.
-
-2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*insv_si_1_n_lshiftrt): Restrict the
- source operand to those that can be extracted with bld.
-
-2003-03-20 Richard Earnshaw <rearnsha@arm.com>
-
- PR 10066
- * arm.md (UNSPEC_PIC_BASE): New constant.
- (pic_add_dot_plus_four): Wrap with unspec.
- (pic_add_dot_plus_eight): Likewise.
-
-2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*insv_si_1_n): New.
- (*insv_si_1_n_lshiftrt): Likewise.
-
-2003-03-20 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (fold_mathfn_compare): New function to simplify
- comparisons against built-in math functions. Fold comparisons
- of sqrt against constants.
- (fold): Call fold_mathfn_compare when appropriate.
-
-2003-03-20 Richard Earnshaw <rearnsha@arm.com>
-
- * ifcvt.c (find_if_case_1): If we add a new bb, update the dominance
- information.
-
-2003-03-20 Per Bothner <pbothner@apple.com>
-
- Various cleanups to help compile server.
-
- * cppinit.c (cpp_create_reader): Take extra hash_table* argument,
- and pass that to _cpp_init_hashtable.
- (cpp_read_main_file): Drop hash_table* argument; don't call
- _cpp_init_hashtable.
- * cpplib.h: Update declarations to match.
- * c-opts.c (c_common_init_options): Pass ident_hash to
- cpp_create_reader.
- (c_common_post_options): Don't pass ident_hash to cpp_read_main_file.
- * fix-header.c (read_scan_file): Likewise pass NULL table to
- cpp_create_reader rather than cpp_read_main_file.
-
- * cppfiles.c (cpp_rename_file): Generalized and renamed
- to cpp_change_file.
- * cpplib.h: Update declaration to match.
- * c-opts.c (push_command_line_line, finish_options): Change
- cpp_rename_file calls to cpp_change_file.
-
- * line-map.c (add_line_map): Allow leaving the outermost file.
- Allowing entering an outermost-file after the initial time.
-
- * toplev.c (pop_srcloc): Allow popping from initial file.
-
-2003-03-20 Kazu Hirata <kazu at cs dot umass dot edu>
-
- * fold-const.c (fold): Fold A - (A & B) into ~B & A.
-
-2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*addsi3_and_r_1): New.
- (*addsi3_and_not_r_1): Likewise.
-
-2003-03-19 Loren James Rittle <ljrittle@acm.org>
-
- * Makefile.in (STRICT2_WARN): Add @WERROR@.
- (GCC_WARN_CFLAGS): Remove $(WERROR).
- (fixinc.sh-warn): New.
- * ada/Make-lang.in (ada-warn): Add $(WERROR).
- * cp/Make-lang.in (cp-warn): Add $(WERROR).
- * f/Make-lang.in (f-warn): Add $(WERROR).
- * java/Make-lang.in (java-warn): Add $(WERROR).
- * treelang/Make-lang.in (treelang-warn): Add $(WERROR).
-
-2003-03-19 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * c-common.h (c_dump_tree), c-dump.c (c_dump_tree),
- langhooks-def.h (lhd_tree_dump_dump_tree),
- langhooks.c (lhd_tree_dump_dump_tree), langhooks.h (*dump_tree):
- Change return type from 'int' to 'bool'. Replace 0 and 1 with
- true and false in return statements.
-
-2003-03-19 Kevin Buettner <kevinb@redhat.com>
-
- * dwarf2out.c (DWARF_INITIAL_LENGTH_SIZE): Define.
- (DWARF_COMPILE_UNIT_HEADER_SIZE): Take into account
- DWARF_INITIAL_LENGTH_SIZE.
- (output_compilation_unit_header, output_pubnames, output_aranges)
- (output_line_info): Output 0xffffffff escape value for 64-bit
- DWARF extension.
- * config/mips/iris6.h (DWARF_INITIAL_LENGTH_SIZE): Define.
-
-2003-03-19 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.c (s390_preferred_reload_class): Do not
- force constants to the pool unless necessary.
- (s390_decompose_address): Prefer to use pointer as base,
- not index register.
- * config/s390/s390.md ("*tsthiCCT_only"): Remove '?' from
- Q alternative.
- ("*movdi_64", "*movsi", "movhi", "movqi_64", "movqi",
- "*movdf_64", "*movsf"): Add '?' to Q->Q alternatives.
- ("*extractqi", "*extracthi", "*zero_extendhisi2_31",
- "*zero_extendqisi2_31", "*zero_extendqihi2_31",
- "*adddi3_31", "*subdi3_31"): Do not set "type" attribute.
-
-2003-03-19 Jan Hubicka <jh@suse.cz>
-
- * i386.h (machine_function): New fields use_fast_prologue_epilogue.
- * i386.c (use_fast_prologue_epilogue): Remove.
- (ix86_frame): New field save_regs-using_mov;
- (ix86_compute_frame_layout): Decide on fast prologues;
- allocate saved registers in red zone.
- (ix86_expand_epilogue, ix86_expand_prolgoues): Obey new parameters.
-
-2003-03-19 Nick Clifton <nickc@redhat.com>
-
- * config/mcore/mcore.h (CPP_SPEC): Remove trailing semi-colon.
-
-2003-03-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR 10062
- * config/pa/pa-hpux.h (TARGET_HPUX_UNWIND_LIBRARY): Redefine.
- * pa-protos.h (output_lbranch): New prototype.
- * pa.c (compute_frame_size): Change size of the frame marker on the
- 64-bit ports to 48 bytes.
- (pa_output_function_prologue): Document why SAVE_SP is set.
- (hppa_expand_prologue): Save previous stack pointer into frame marker
- on targets which use the hpux unwind library.
- (output_cbranch): Use output_lbranch.
- (output_lbranch): New function to output long unconditional branches.
- * pa.h (TARGET_HPUX_UNWIND_LIBRARY): Define.
- (STACK_POINTER_OFFSET): Update offset for 48-byte frame marker on
- 64-bit ports.
- * pa.md (jump): Use output_lbranch.
- (allocate_stack): New expander for dynamic stack allocation.
-
-2003-03-19 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/rs6000.c (rs6000_stack_info): Only require a frame
- when debugging on XCOFF targets. Delete "abi" temp.
-
- PR target/10073
- * combine.c (force_to_mode <NOT>): Use gen_int_mode.
-
-2003-03-18 Jakub Jelinek <jakub@redhat.com>
-
- * config/s390/s390.c (s390_output_dwarf_dtprel): New.
- * config/s390/s390-protos.h (s390_output_dwarf_dtprel): New proto.
- * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Define.
-
- * config/ia64/ia64.c (ia64_output_dwarf_dtprel): New.
- * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): New proto.
- * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Define.
-
-2003-03-18 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/rs6000.c (rs6000_emit_prologue): Don't clone
- the result of machopic_function_base_name.
- * config/darwin.c (machopic_function_base_name): Use a gc-allocated
- string rather than a static array.
-
- * Makefile.in (emit-rtl.o): Add gt-emit-rtl.h to dependencies.
-
- * gengtype.c: Include rtl.h.
- (enum rtx_code): Don't define.
- (rtx_format): Make declaration match rtl.h.
- (rtx_next_new): Rename from rtx_next to avoid conflict. Change all
- users.
- (adjust_field_rtx_def): Describe strings in NOTE_LINE_NUMBER notes.
- * Makefile.in (gengtype.o): Update dependencies.
-
-2003-03-18 Andreas Schwab <schwab@suse.de>
-
- * config/m68k/m68k.md (iordi3): Fix setting low half to -1. From
- martin@blom.org.
-
-2003-03-18 Geoffrey Keating <geoffk@apple.com>
-
- * function.c (next_block_index): Mark with GTY.
-
- * config/rs6000/rs6000.md (macho_correct_pic): Correct pattern.
-
-2003-03-18 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.md (UNSPECV_SETJMP_RECEIVER): New.
- (builtin_setjmp_receiver): Delay call to ia64_reload_gp
- until after reload.
-
-2003-03-18 Richard Henderson <rth@redhat.com>
-
- * builtins.c (expand_builtin_unop): New target_mode operand;
- use it to convert the result to the correct mode.
- (expand_builtin): Update all callers.
-
-2003-03-18 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.md ("movti", "movhi", "movqi"): Add "type" attribute.
-
-2003-03-18 Jan Hubicka <jh@suse.cz>
-
- * i386.md: Fix previous commit that mistakely applied the patch
- twice.
-
- * alias.c (rtx_equal_for_memref_p): Assume that X and Y has been
- canonicalized.
- (memrefs_conflict_p): Likewise.
- (addr_side_effect_eval): Canonicalize the constructed address.
-
-2003-03-18 Jan Hubicka <jh@suse.cz>
-
- * i386.md (cvtts?2si peep2): New.
-
-2003-03-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*iorsi3_two_qi_zext): New.
-
-2003-03-18 Andreas Schwab <schwab@suse.de>
-
- * dwarf2out.c (output_file_names): Cast size_t to unsigned long
- for format.
-
-2003-03-17 Jason Merrill <jason@redhat.com>
-
- PR c++/10091
- * expr.c (expand_expr) [ADDR_EXPR]: Disallow taking the address of
- an unaligned member of TREE_ADDRESSABLE type.
-
-2003-03-18 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/linux64.h (MASK_PROFILE_KERNEL): Define.
- (TARGET_PROFILE_KERNEL): Define.
- (SUBTARGET_SWITCHES): Handle -mprofile-kernel.
- (PROFILE_BEFORE_PROLOGUE): Don't define.
- (PROFILE_KERNEL): Remove hacks.
- * config/rs6000/rs6000.c (TARGET_PROFILE_KERNEL): Define default.
- (rs6000_stack_info): No need to save lr if just for profiling when
- TARGET_PROFILE_KERNEL.
- (output_profile_hook): Output nothing when TARGET_PROFILE_KERNEL.
- (output_function_profiler): Localize label generation. Emit code
- for kernel profiling.
-
-2003-03-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- byte_accesses_mergeable_p.
- * config/h8300/h8300.c (byte_accesses_mergeable_p): New.
- * config/h8300/h8300.md (*iorhi3_two_qi_mem): Likewise.
- (a splitter): Likewise.
- (*iorsi3_ashift_16_ashift_24): Likewise.
- (*iorsi3_ashift_16_ashift_24_mem): Likewise.
-
-2003-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * dwarf2asm.h: Delete obsolete comment.
- (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset,
- dw2_asm_output_pcrel, dw2_asm_output_addr,
- dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx,
- dw2_asm_output_nstring, dw2_asm_output_data_uleb128,
- dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128,
- dw2_asm_output_delta_sleb128): Add ATTRIBUTE_NULL_PRINTF.
-
-2003-03-17 Zack Weinberg <zack@codesourcery.com>
-
- * c-tree.h (struct lang_identifier): Remove error_locus field.
- (IDENTIFIER_ERROR_LOCUS): Kill.
- (record_function_scope_shadow): New prototype.
- * c-typeck.c (build_external_ref): Don't complain if
- decl is error_mark_node. When not at file scope, bind the
- decl's local value to error_mark_node to suppress further
- warnings, instead of setting IDENTIFIER_ERROR_LOCUS.
-
- * c-decl.c (get_function_binding_level): New static function.
- (record_function_scope_shadow): New exported function.
- (c_make_fname_decl): Use get_function_binding_level.
-
-2003-03-17 Steve Ellcey <sje@cup.hp.com>
-
- * stmt.c (tail_recursion_args): Call promote_mode to set
- unsignedp flag correctly before calling convert_move.
-
-2003-03-17 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * loop-unroll.c (decide_peel_completely,
- decide_unroll_constant_iterations, decide_unroll_stupid,
- decide_unroll_runtime_iterations, decide_peel_simple): Set
- loop->has_desc.
-
-2003-03-17 Jan Hubicka <jh@suse.cz>
-
- * ggc-common.c (ggc_mark_roots): Use htab_traverse_noresize.
-
-2003-03-17 Olivier Hainque <hainque@act-europe.fr>
-
- * function.c (assign_parms): For a struct value address passed as
- first argument, delay the function's result RTL setup code until
- after the emission of parameter conversions.
-
-2003-03-17 Dave Love <fx@gnu.org>
- Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define __digital__,
- __arch64__ to match Compaq cc.
-
-2003-03-17 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c: Default TARGET_EBCDIC to 0 if not defined.
- (c_common_init): Set EBCDIC in cpp options.
- * cpplex.c (maybe_read_ucs, cpp_parse_escape): Use EBCDIC option,
- not conditional compilation.
- * cpplib.h (struct cpp_options): New entry EBCDIC.
-
-2003-03-17 Neil Booth <neil@daikokuya.co.uk>
-
- * fix-header.c (read_scan_file): Need to malloc arguments to add_path.
-
-2003-03-17 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
-
- * function.c (thread_prologue_and_epilogue_insns): Set delete_unused
- argument to 0 for redirect_jump.
-
-2003-03-16 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/8805
- * except.c (eh_region_u_cleanup): Add prev_try.
- (expand_eh_region_end_cleanup): Set it.
- (reachable_handlers): Use it to skip over cleanup blocks.
-
-2003-03-17 Andreas Jaeger <aj@suse.de>
-
- * Makefile.in (TAGS): Remove obsolete handling of =*.[chy].
-
-2003-03-17 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/linux64.h (TARGET_64BIT): Redefine.
- (TARGET_RELOCATABLE, TARGET_EABI, TARGET_PROTOTYPE): Likewise.
- (SUBTARGET_SWITCHES, SUBTARGET_OPTIONS): Likewise.
- (SUBTARGET_OVERRIDE_OPTIONS, CPP_SYSV_SPEC): Likewise.
-
-2003-03-16 Richard Henderson <rth@redhat.com>
-
- * simplify-rtx (simplify_binary_operation): Don't abort for
- SS_PLUS, US_PLUS, SS_MINUS, US_MINUS.
-
-2003-03-16 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.md (movstrictqi, movstrictqi_1): Check
- optimize_size as well.
-
-2003-03-16 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (print_operand): Handle 'b' modifier
- for D register to specify the low part of it, aka B.
- (m68hc11_gen_movhi): Use REG_WAS_0 note and increment or decrement
- the register if we are loading 1 or -1 to it; avoid using temp
- register when moving X/Y to Y/X.
- (m68hc11_gen_movqi): Likewise.
- (m68hc11_check_z_replacement): Fix last insn setting for compare case.
-
-2003-03-14 Mark Mitchell <mark@codesourcery.com>
-
- PR optimization/9016
- * config/i386/i386.c (ix86_expand_move): Force more CONST_DOUBLEs
- into the constant pool.
-
-2003-03-16 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
-
- PR target/9164
- * tree.c (get_narrower): For extensions with unchanged bit number,
- return the unsignedness of the outer mode.
-
-2003-03-16 Roger Sayle <roger@eyesopen.com>
-
- * c-typeck.c (build_component_ref): Turn "for" into "do .. while"
- to avoid "may be used uninitialized" warning on ia64-hpux.
- * config/ia64/ia64-c.c: Include "tm_p.h" for function prototypes.
-
-2003-03-16 Andreas Jaeger <aj@suse.de>
-
- * configure.in: Improve check for memcheck.h.
- * configure: Regenerated.
-
-2003-03-16 Neil Booth <neil@daikokuya.co.uk>
-
- * doc/cppopts.texi: Remove documentation of -A-.
-
-2003-03-15 Zack Weinberg <zack@codesourcery.com>
-
- * doc/libgcc.texi: Remove @tie.
-
-2003-03-15 Josef Zlomek <zlomekj@suse.cz>
-
- * rtl.h (subrtx_p): Renamed to rtx_referenced_p.
- (rtx_pair): Added new element update_label_nuses, renamed to
- replace_label_data.
- * cfgcleanup.c (outgoing_edges_match, try_crossjump_to_edge): Use
- replace_label_data instead of rtx_pair.
- * loop.c (load_mems): Likewise.
- * rtlanal.c (replace_label): Replace label in pool constants and in
- INSN_LIST (in REG_LABEL note).
- (subrtx_p): Renamed to rtx_referenced_p.
- (subrtx_p_1): Renamed to rtx_referenced_p_1, compare the interior of
- LABEL_REF with CODE_LABEL, traverse constants from pool.
-
-2003-03-15 Aldy Hernandez <aldyh@redhat.com>
- Zack Weinberg <zack@codesourcery.com>
-
- * Makefile.in (TEXI_GCCINT_FILES): Add libgcc.texi.
- * doc/libgcc.texi: New file.
- * doc/interface.texi: Delete paragraph about libgcc interface.
- * doc/gccint.texi: Add libgcc menu entry and @include libgcc.texi.
-
-2003-03-15 Jason Merrill <jason@redhat.com>
-
- PR debug/9039
- * dwarf2out.c (gen_decl_die): Ignore frontend tree codes.
-
- PR debug/6387
- * dwarf2out.c (dwarf2out_decl): If we're at -g1, just stick nested
- function DIEs at toplevel.
- (decls_for_scope): At -g1, don't descend into subblocks.
-
-2003-03-15 Ulrich Weigand <uweigand@de.ibm.com>
-
- * varasm.c (struct rtx_const): Change type of un.addr member
- to struct holding an additional 'symbol' member.
- (decode_rtx_const): Re-enable optimization to count SYMBOL_REFs
- with equal string addresses as equal.
- (simplify_subtraction): Adapt to struct rtx_const change.
-
-2003-03-15 Neil Booth <neil@daikokuya.co.uk>
-
- * fix-header.c (read_scan_file): Read main file before handling -D.
-
-2003-03-15 Roger Sayle <roger@eyesopen.com>
-
- * c-cppbuiltin.c (builtin_define_with_value_n): Fix whitespace.
- * c-typeck.c (c_tree_expr_nonnegative_p): Likewise.
- * cfgbuild.c (find_many_sub_basic_blocks): Likewise.
- (find_sub_basic_blocks): Likewise.
- * cgraphunit.c (cgraph_expand_functions): Likewise.
- * dwarf2out.c (prune_unused_types): Likewise.
- * expr.c (store_field): Likewise.
- * genextract.c (print_path): Likewise.
- * haifa-sched.c (schedule_insn): Likewise.
- * lcm.c (compute_antinout_edge): Likewise.
- * loop-unroll.c (decide_peel_once_rolling): Likewise.
- * ra-colorize.c (ra_colorize_free_all): Likewise.
- * ra-debug.c (dump_igraph): Likewise.
- (debug_hard_reg_set): Likewise.
- * reg-stack.c (reg_to_stack): Likewise.
- * rtlanal.c (refers_to_regno_p): Likewise.
- * tracer.c (layout_superblocks): Likewise.
-
-2003-03-15 Neil Booth <neil@daikokuya.co.uk>
-
- * fix-header.c (read_scan_file): Fix thinko.
-
-2003-03-15 Glen Nakamura <glen@imodulo.com>
-
- * reload1.c (choose_reload_regs): Use && instead of ||
- with REG_CANNOT_CHANGE_MODE_P condition.
-
-2003-03-15 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * c-common.h (cb_register_builtins): Rename c_cpp_builtins.
- * c-lex.c (init_c_lex): Register builtins hook is dead.
- * c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
- (c_common_decode_option): Don't call cpp_handle_option.
- Handle -A, -D and -U.
- (handle_deferred_opts): Simplify.
- (finish_options): Define builtins and command line macros.
- * c-ppoutput.c (init_pp_output): Register builtins hook is dead.
- * cppinit.c: Don't include intl.h.
- (init_builtins): Rename cpp_init_builtins. No hook to call.
- (init_library): Don't need to sort options.
- (cpp_create_reader): Don't set pending.
- (cpp_destroy): Don't free pending.
- (struct pending_option, cl_directive_handler, struct cpp_pending,
- APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
- cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
- cl_options, cpp_handle_option): Remove.
- * cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
- cpp_finish_options): Remove.
- (cpp_init_builtins): New.
- * fix-header.c (read_scan_file): Update to handle -D. Fix
- handling of -I. Replace call to cpp_finish_options.
-
-2003-03-15 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
-
- PR optimization/9387
- * function.c (thread_prologue_and_epilogue_insns): Use redirect_jump
- for conditional returns.
-
-2003-03-14 Jason Merrill <jason@redhat.com>
-
- PR optimization/6871
- * varasm.c (assemble_variable): Leave constant zeroes in .rodata.
-
-2003-03-14 Neil Booth <neil@daikokuya.co.uk>
-
- * c-opts.c (finish_options): New.
- (COMMAND_LINE_OPTIONS, c_common_decode_option): Add -imacros.
- (missing_arg): Handle OPT_include and OPT_imacros.
- (c_common_init, c_common_parse_file): Use finish_options.
- (handle_deferred_opts): Update.
- * cppinit.c (struct cpp_pending): Remove imacros_head and imacros_tail.
- (cpp_finish_options): Don't handle -imacros here.
- (no_fil): Remove.
- (COMMAND_LINE_OPTIONS, cpp_handle_option): Don't handle -imacros.
-
-2003-03-14 Jakub Jelinek <jakub@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_emit_load_toc_table): Don't call
- rs6000_maybe_dead if !fromprolog.
-
-2003-03-14 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * c-common.h (fe_file_change, pp_file_change): New.
- * c-lex.c (init_c_lex): Don't set cb_file_change.
- (c_common_parse_file): Move to c-opts.c.
- (cb_file_change): Rename fe_file_change.
- * c-opts.c: Include debug.h.
- (warn_unused_macros, include_cursor): New.
- (push_command_line_include, cb_file_change): New.
- (COMMAND_LINE_OPTIONS): Handle -include.
- (c_common_decode_option): Use local warn_unused_macros.
- Handle OPT_include.
- (c_common_post_options): Set file change callback.
- (handle_deferred_opts): Skip -include. Don't free the array.
- (c_common_init): Call cpp_finish_options here, and push an
- initial -include file.
- * c-ppoutput.c (cb_file_change): Rename pp_file_change.
- (preprocess_file): Don't call cpp_finish_options.
- (init_pp_output): Don't set the file change callback.
- (pp_file_change): Return if no line commands or no output.
- * cpphash.h (next_include_file, first_unused_line): Remove.
- * cppinit.c (include_head, include_tail): Remove.
- (cpp_destroy): Don't free -include chain.
- (cpp_finish_options): Don't handle -include, or worry about
- -Wunused-macros.
- (_cpp_maybe_push_include_file): Remove.
- (COMMAND_LINE_OPTIONS, cpp_handle_option): Don't handle -include.
- * cpplib.c (_cpp_pop_buffer): Don't handle -include.
- * cppmacro.c (_cpp_warn_if_unused_macro, _cpp_create_definition):
- Used flag is set based upon the state of the warn_unused_macros
- flag, and so use of first_unused_line is unnecessary.
-
-2003-03-13 Jan Hubicka <jh@suse.cz>
-
- * cselib.c (clear_table): Do not take argument; always clear just
- used slots.
- (cselib_process_insn): Update call of clear_table
- (cselib_init): Do not call clear_table.
- (cselib_finish): Clear table.
-
- * cse.c (count_reg_usage): Do not check side_effects_p.
- * rtlanal.c (set_noop_p): Check side_effects_p only when set looks
- like noop.
- (find_reg_equal_equiv_note): Do not use find_reg_note.
-
-2003-03-14 Richard Henderson <rth@redhat.com>
-
- PR target/9700
- * config/alpha/alpha.c (alpha_va_start): Account for
- current_function_pretend_args_size in the AP offset.
-
- * config/alpha/alpha.h (SETUP_INCOMING_VARARGS): Move out of line.
- (INITIAL_ELIMINATION_OFFSET): Move out of line.
- * config/alpha/alpha.c (alpha_setup_incoming_varargs): New.
- (alpha_initial_elimination_offset) New.
- * config/alpha/alpha-protos.h: Update.
-
-2003-03-14 Jakub Jelinek <jakub@redhat.com>
-
- * stmt.c (expand_start_case): Call emit_queue ().
-
-2003-03-14 Chris Demetriou <cgd@broadcom.com>
- Alexandre Oliva <aoliva@redhat.com>
-
- * config/mips/mips.h (FUNCTION_PROFILER): _mcount() doesn't pop 2
- words in new abis.
-
-2003-03-14 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/8396
- * tree-inline.c (initialize_inlined_parameters): Make sure the value
- of read-only constant arguments is passed with the right type.
-
-2003-03-14 Steven Bosscher <steven@gcc.gnu.org>
-
- * doc/extend.texi (Function Names): Make the example compilable.
-
-2003-03-13 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (processor_target_table): Really allow
- GP optional instructions on Power4.
-
-2003-03-13 Roger Sayle <roger@eyesopen.com>
-
- * calls.c (flags_from_decl_or_type): Factor and remove redundant
- conditional tests.
-
-2003-03-13 Mike Stump <mrs@apple.com>
-
- * ggc-page.c (struct page_entry): Remove varray.h header.
- Add index_by_depth field.
- Remove save_in_use_p field.
- (struct globals): Add depth_in_use, depth_max, by_depth_in_use,
- by_depth_max, by_depth, and save_in_use fields.
- (INITIAL_PTE_COUNT): Add.
- (save_in_use_p_i): Add.
- (save_in_use_p): Add.
- (adjust_depth): Add.
- (move_ptes_to_front): Add.
- (push_depth): Add.
- (push_by_depth): Add.
- (prefetch): Add.
- (free_page): Add support for and use faster data structures.
- (ggc_alloc): Likewise.
- (init_ggc): Likewise.
- (ggc_recalculate_in_use_p): Likewise.
- (ggc_pop_context): Likewise.
- (clear_marks): Likewise.
- (ggc_pch_read): Likewise.
- * Makefile.in (ggc-page.o): Remove varray.h.
-
-2003-03-13 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * ChangeLog: Rotated last year's entries to...
- * ChangeLog.8: New.
-
- * config/ia64/fde-glibc.c, config/ia64/freebsd.h,
- config/ia64/hpux.h, config/ia64/hpux_longdouble.h,
- config/ia64/ia64-c.c, config/ia64/ia64-modes.def,
- config/ia64/ia64-protos.h, config/ia64/ia64.c,
- config/ia64/ia64.h, config/ia64/ia64.md,
- config/ia64/itanium1.md, config/ia64/itanium2.md,
- config/ia64/quadlib.c, config/ia64/unwind-ia64.c,
- config/ia64/unwind-ia64.h: It's GCC, not GNU CC.
-
-2003-03-13 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_dwarf_register_span):
- Differentiate endianness.
- (s6000_override_options): Use cpu type instead of TARGET_SPE.
-
-2003-03-13 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.c (print_multi_reg): Do not generate a type 2
- LDM instructions with writeback enabled.
- (output_return_instruction): Likewise.
-
- * config/arm/pe.h (FIXED_REGISTERS): Remove definition.
- (CALL_USED_REGISTERS): Remove definition.
- (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Define.
-
-2003-03-13 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/rs6000.c (rs6000_flag_pic): Delete.
- (rs6000_xcoff_encode_section_info): #ifdef TARGET_XCOFF.
- (rs6000_binds_local_p, TARGET_BINDS_LOCAL_P): #if TARGET_MACHO.
- (rs6000_override_options): Don't clear flag_pic for ABI_AIX.
- (rs6000_legitimize_address): Formatting.
- (rs6000_emit_move): Likewise.
- (rs6000_return_addr): Test ABI_AIX as well as flag_pic.
- (rs6000_emit_prologue <save_LR_around_toc_setup>): Likewise.
- (rs6000_elf_select_section): Comment reason for shlib being
- set for ABI_AIX.
- (rs6000_elf_unique_section): Likewise.
- (rs6000_elf_encode_section_info): Test !TARGET_AIX as well as ABI_AIX.
- * config/rs6000/rs6000.h (LEGITIMATE_LO_SUM_ADDRESS_P): Test ABI_AIX
- as well as flag_pic.
- * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
- (MINIMAL_TOC_SECTION_ASM_OP): Likewise.
- * config/rs6000/linux64.h (TARGET_ENCODE_SECTION_INFO): Don't define.
-
-2003-03-13 Richard Henderson <rth@redhat.com>
-
- * emit-rtl.c (try_split): Handle 1-1 splits of call insns properly.
-
- * config/ia64/ia64.c (TARGET_FUNCTION_OK_FOR_SIBCALL): New.
- (ia64_gp_save_reg): Remove.
- (struct ia64_frame_info): Move to the beginning of the file;
- add reg_save_gp.
- (ia64_expand_call): Rearrange for new call patterns.
- (ia64_reload_gp): New.
- (ia64_split_call): New.
- (ia64_compute_frame_size): Allocate reg_save_gp.
- (ia64_expand_prologue): Save reg_save_gp.
- (ia64_expand_epilogue): Don't restore gp.
- (ia64_hard_regno_rename_ok): Remove R4 hack.
- (ia64_function_ok_for_sibcall): New.
- (ia64_output_mi_thunk): Set reload_completed, no_new_pseudos;
- call try_split on sibcall pattern.
- * config/ia64/ia64-protos.h: Update.
- * config/ia64/ia64.md (call_nogp, call_value_nogp, sibcall_nogp):
- Rename from nopic versions. Confiscate 2nd argument to call as
- a marker.
- (call_pic, call_value_pic, sibcall_pic): Remove.
- (call_gp, call_value_gp, sibcall_gp): New.
- (builtin_setjmp_setup): Remove.
- (builtin_setjmp_receiver): Call ia64_reload_gp.
-
-2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c,
- config/dsp16xx/dsp16xx.h, config/dsp16xx/dsp16xx.md: Replace
- "GNU CC" with "GCC".
-
- * config/c4x/c4x-c.c, config/c4x/c4x-modes.def,
- config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h,
- config/c4x/c4x.md, config/c4x/libgcc.S, config/c4x/rtems.h:
- GCC, not GNU CC.
-
- * genattrtab.h, hosthooks-def.h, hosthooks.h, langhooks-def.h,
- langhooks.h, tree-inline.h: Replace "GNU CC" with "GCC".
-
- * c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c,
- langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c,
- unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace
- "GNU CC" with "GCC".
-
- * config/v850/lib1funcs.asm, config/v850/rtems.h,
- config/v850/v850-c.c, config/v850/v850-protos.h,
- config/v850/v850.c, config/v850/v850.h, config/v850/v850.md:
- GCC, not GNU CC.
-
- * config/vax/bsd.h, config/vax/elf.h, config/vax/netbsd-elf.h,
- config/vax/netbsd.h, config/vax/openbsd.h, config/vax/openbsd1.h,
- config/vax/ultrix.h, config/vax/vax-protos.h, config/vax/vax.c,
- config/vax/vax.h, config/vax/vax.md, config/vax/vaxv.h: GCC, not
- GNU CC.
-
-2003-03-12 Benjamin Kosnik <bkoz@redhat.com>
-
- * cpppch.c (cpp_valid_state): Use DL_WARNING_SYSHDR, not DL_WARNING.
-
-2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * fixinc/fixinc.interix: Remove dead code (most of it).
- * fixinc/fixinc.dgux: Remove.
-
- * ginclude/float.h, ginclude/iso646.h, ginclude/stdarg.h,
- ginclude/stdbool.h, ginclude/stddef.h: GCC, not GNU CC.
-
-2003-03-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.c (pa_init_builtins): Fix warning.
-
-2003-03-12 Steve Ellcey <sje@cup.hp.com>
-
- * config/ia64/ia64.h (ASM_OUTPUT_XDATA_CHAR): Remove.
- (ASM_OUTPUT_XDATA_SHORT): Remove.
- (ASM_OUTPUT_XDATA_INT): Remove.
- (ASM_OUTPUT_XDATA_DOUBLE_INT): Remove.
- (ASM_OUTPUT_ADDR_DIFF_ELT): Handled 32 bit address diffs.
- (ASM_PREFERRED_EH_DATA_FORMAT): Handle 32 bit EH pointers.
- (CASE_VECTOR_MODE): Handle 32 bit pointers in case statement.
-
-2003-03-12 Andrew Lewycky <andrew@mxc.ca>
-
- PR c++/7050
- * expr.c (store_expr): Don't attempt to store void-typed trees,
- just evaluate them for side effects.
-
-2003-03-12 Neil Booth <neil@daikokuya.co.uk>
-
- * cppfiles.c (cpp_rename_file, cpp_push_include): New.
- * cppinit.c (push_include): Move with changes to cppfiles.c.
- (cpp_read_main_file): Mark named operators here...
- (cpp_finish_options): ...not here. Update.
- (_cpp_maybe_push_include_file): Update.
- * cpplib.h (cpp_push_include, cpp_rename_file): New.
-
-2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * aclocal.m4: Introduce gcc_GAS_VERSION_GTE_IFELSE,
- _gcc_COMPUTE_GAS_VERSION.
- * configure.in: Use them.
- * configure: Regenerate.
-
-2003-03-12 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.md (adddi3): Don't clobber source operand used
- to detect carry.
- (subdi3): Reorder emitted instructions.
-
-2003-03-12 Andreas Jaeger <aj@suse.de>
-
- * config/i386/netbsd64.h (TARGET_OS_CPP_BUILTINS): Remove call to
- NETBSD_OS_CPP_BUILTINS_LP64.
-
-2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * Makefile.in: Eliminate all.indirect. Update and clean up comments.
- Rearrange. Reorganize.
- * configure.in: Rearrange.
- * configure: Regenerate.
-
-2003-03-12 Andreas Jaeger <aj@suse.de>
-
- * c-cppbuiltin.c (cb_register_builtins): Define LP64 builtins for
- LP64 targets.
-
- * doc/cpp.texi (Common Predefined Macros): Document __LP64__ and
- _LP64.
-
- * config/ia64/ia64.h (TARGET_CPU_CPP_BUILTINS): Do not define
- _LP64 macros here.
- * config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Likewise.
-
- * config/alpha/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove call to
- NETBSD_OS_CPP_BUILTINS_LP64.
- * config/sh/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.
- * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.
-
- * config/netbsd.h (NETBSD_OS_CPP_BUILTINS_LP64): Remove.
-
-2003-03-12 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_setup_incoming_varargs): Set stack_alignment_needed to 128.
-
-2003-03-12 Daniel Jacobowitz <drow@mvista.com>
-
- Fix PR target/9797 and PR c/9853.
- * stmt.c (expand_decl_init): Call push_temp_slots () and
- pop_temp_slots ().
-
-2003-03-12 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c: Include basic-block.h.
- (sh_output_mi_thunk, emit_load_ptr): New functions.
- (TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Redefine.
-
-2003-03-12 Nick Clifton <nickc@redhat.com>
-
- * config/arm/pe.h (FIXED_REGISTERS): Add Maverick registers.
- (CALL_USED_REGISTERS): Likewise.
- * config/arm/arm.h (FIRST_PSEUDO_REGISTER): Update comment
- describing how this value is calculated.
-
-2003-03-12 Hans-Peter Nilsson <hp@bitrange.com>
-
- * configure.in (rlim_t): Define to long if no valid definition
- found in sys/resource.h.
- * config.in, configure: Regenerate.
-
-2003-03-12 Neil Booth <neil@daikokuya.co.uk>
-
- * config/mcore/mcore-elf.h (CPP_PREDEFINES): Replace with
- TARGET_OS_CPP_BUILTINS.
- * config/mcore/mcore-pe.h: Similarly.
- * config/mcore/mcore.h: Replace CPP_PREDEFINES and part of
- CPP_SPEC with TARGET_CPU_CPP_BUILTINS.
-
-2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR c/9928
- * c-decl.c (duplicate_decls): Discard the initializer of the new decl
- only if it is a VAR_DECL.
-
-2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/9888
- * config/i386/i386.md (jcc_1): Fix range.
- (jcc_2): Likewise.
- (jump): LIkewise.
- (doloop_end_internal): Likewise.
-
-2003-03-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * config/i386/winnt.c (DLL_IMPORT_PREFIX): New define.
- Use throughout instead of DLL_IMPORT_EXPORT_PREFIX and "e."
- (DLL_EXPORT_PREFIX): New define. Use throughout instead of
- DLL_IMPORT_EXPORT_PREFIX and "i."
- (i386_pe_dllexport_name_p): Here.
- (i386_pe_dllimport_name_p): Here.
- (i386_pe_mark_dllexport): Here. Remove DLL_IMPORT_PREFIX,
- not 9 chars when getting identifier name.
- (i386_pe_mark_dllimport): Here.
- (i386_pe_encode_section_info): Here. Remove DLL_IMPORT_PREFIX,
- not 9 chars when getting identifier name. Correct comment.
- (i386_pe_strip_name_encoding): Here. Add comments for different
- cases.
- (gen_fastcall_suffix): Break down xmalloc() argument to
- components.
- (gen_stdcall_suffix): Likewise.
- Update copyright year.
-
-2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR optimization/9888
- * config/i386/i386.md (movsi_1): Remove special alternatives
- for %eax register.
- (movsi_1_nointernunit): Likewise.
- (movhi_1): Likewise.
- * config/i386/i386.c (memory_address_length): Do not use
- short displacement when there is no base.
- (ix86_attr_length_address_default): Handle LEA instructions.
-
-2003-03-12 Neil Booth <neil@daikokuya.co.uk>
-
- * c-cppbuiltin.c (builtin_define_std): Make non-static.
-
-2003-03-11 Loren James Rittle <ljrittle@acm.org>
-
- * config/freebsd-spec.h (FBSD_CPP_PREDEFINES): Remove.
- (FBSD_TARGET_OS_CPP_BUILTINS): New port-specific macro.
- (FBSD_TARGET_CPU_CPP_BUILTINS): New port-specific macro.
- * config/freebsd.h (CPP_PREDEFINES): Remove.
- (TARGET_OS_CPP_BUILTINS): New.
- * config/alpha/freebsd.h: Use overridden FBSD_TARGET_CPU_CPP_BUILTINS
- instead of TARGET_OS_CPP_BUILTINS.
- * config/sparc/freebsd.h (CPP_PREDEFINES): Remove.
-
-2003-03-11 Geoffrey Keating <geoffk@apple.com>
-
- * c-cppbuiltin.c (builtin_define_std): Add ATTRIBUTE_UNUSED.
-
-2003-03-11 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_stack_info): Remove
- insn_chain_scanned. Use insn_chain_scanned_p in machine_function.
-
- * config/rs6000/rs6000.h (machine_function): Add insn_chain_scanned_p.
-
-2003-03-11 Alexandre Oliva <aoliva@redhat.com>
-
- * toplev.c (independent_decode_option): Return success for --help,
- --target-help and --version.
-
-2003-03-11 Alexandre Oliva <aoliva@redhat.com>
-
- * config/mips/linux64.h (DRIVER_SELF_SPECS): Add endian_spec.
- Default to -mips3 on -mabi=64. Don't add -mips* flag if -march is
- specified.
- (SUBTARGET_ASM_SPEC): Remove -mips*-adding code obviated by
- DRIVER_SELF_SPECS.
- (LINK_SPEC): Let endian options affect the linker emulation name.
-
-2003-03-11 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.md (reload_inqi): Fix mode for source in second set.
-
-2003-03-11 Jan Hubicka <jh@suse.cz>
-
- * cselib.c (cselib_invalidate_mem_1): Move too ...
- (cselib_invalidate_mem): ... here; use new list
- (dummy_val, first_containing_mem): New static variables.
- (clear_table): Initialize first_containing_mem.
- (discard_useless_values): Compact the containing_mem list.
- (add_mem_for_addr): Add to the list.
- * cselib.h (cselib_val): Add next_containing_mem.
-
-2003-03-11 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (rs6000_override_options): Disable string
- instructions for e500.
-
-2003-03-11 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * c-cppbuiltin.c: Include tm_p.h.
-
-2003-03-11 Aldy Hernandez <aldyh@redhat.com>
-
- * doc/tm.texi (Frame Registers): Document DWARF_REG_TO_UNWIND_COLUMN.
-
- * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Define.
- (_Unwind_GetGR): Use DWARF_REG_TO_UNWIND_COLUMN.
- (_Unwind_SetGR): Same.
- (_Unwind_GetGRPtr): New.
- (_Unwind_SetGRPtr): New.
- (uw_update_context_1): Use accesor functions instead of accessing
- context->reg[] directly.
- (uw_install_context_1): Same.
- (execute_cfa_program): Same.
- (__frame_state_for): Same.
-
- * config/rs6000/rs6000.c (spe_synthesize_frame_save): Use 1200 as
- the synthetic register offset.
-
- * config/rs6000/rs6000.h (DWARF_REG_TO_UNWIND_COLUMN): New.
-
-2003-03-11 Hans-Peter Nilsson <hp@axis.com>
-
- * config/cris/cris.md: Remove lingering EGCS reference.
- ("*extopqihi_side_biap"): For HI operation, match
- cris_additive_operand_extend_operator, not
- cris_operand_extend_operator. Adjust condition.
- ("*extopqihi_side", "*extopqihi"): Ditto.
- ("*extopqisi_side_biap"): Correct operand numbers in condition.
- ("*extophisi_side_biap", "*extopqisi_swap_side_biap"): Ditto.
- ("*extophisi_swap_side_biap", "*extopqisi_swap"): Ditto.
- ("*extophisi_swap"): Ditto.
- ("*extopqihi_swap_side_biap"): For HI operation, match a simple
- PLUS, not cris_operand_extend_operator. Adjust condition and
- output template.
- ("*extopqihi_swap_side", "*extopqihi_swap"): Ditto.
- * config/cris/cris.h (PREDICATE_CODES): Add
- cris_additive_operand_extend_operator.
- * config/cris/cris.c (cris_additive_operand_extend_operator):
- New predicate.
-
-2003-03-11 Hartmut Penner <hpenner@de.ibm.com>
-
- * df.c (read_modify_subreg_p): Change from static to global.
- * df.h (read_modify_subreg_p): Add prototype.
- * sched-deps.c (sched_analyze_1): Generate true dependency for
- strict_low_part, certain subregs and zero/sign_extract.
-
-2003-03-11 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * c-common.c: Don't include real.h or except.h.
- (REGISTER_PREFIX): Remove.
- (builtin_define_std, builtin_define_with_value,
- builtin_define_with_int_value, builtin_define_with_hex_fp_value,
- builtin_define_type_max, builtin_define_type_precision,
- builtin_define_float_constants): Move to c-cppbuiltin.c.
- (c_stddef_cpp_builtins): New.
- * c-common.h (builtin_define_with_value, c_stddef_cpp_builtins): New.
- * c-cppbuiltin.c: New, extracted from c-common.c.
- (define__GNUC__): New.
- * cppspec.c (lang_specific_driver): Remove support of -no-gcc.
- * gcc.c: Remove support of %v1, %v2 and %v3 specs.
- (cpp_unique_options): Don't support no-gcc.
- (do_spec_1): Remove support of version specs.
- * doc/invoke.texi: Remove documentation of %v1, %v2 and %v3.
- * doc/passes.texi: Update.
- * doc/tm.texi: Update.
-
-2003-03-10 Aldy Hernandez <aldyh@redhat.com>
-
- * dwarf2out.c (multiple_reg_loc_descriptor): Fix thinko.
-
-2003-03-10 Andrew Pinski <apinski@apple.com>
-
- * config/darwin.c (machopic_function_base_name): If dynamic-no-pic
- is on should not get here.
- (machopic_indirect_data_reference): If dynamic-no-pic is on just
- generate high/low parts of the address.
- (machopic_legitimize_pic_address): Change MACHOPIC_PURE to
- MACHOPIC_INDIRECT. Dynamic-no-pic uses 0 as the pic base. Generate
- symbol and labels with a new reg. Dynamic-no-pic does not have a
- pic_offset_table_rtx.
- (machopic_select_section): Change references of flag_pic to
- MACHOPIC_INDIRECT.
- (machopic_asm_out_destructor): Likewise.
- * config/darwin.h (ASM_DECLARE_UNRESOLVED_REFERENCE): Change
- reference of flag_pic to MACHOPIC_INDIRECT.
- (MACHO_DYNAMIC_NO_PIC_P): Define as TARGET_DYNAMIC_NO_PIC.
- (MACHOPIC_INDIRECT): Is also true when dynamic-no-pic is on.
- (MACHOPIC_JUST_INDIRECT): Is also true when dynamic-no-pic is on.
- (MACHOPIC_PURE): Is not pure when dynamic-no-pic is on.
- * config/i386/darwin.h (MASK_MACHO_DYNAMIC_NO_PIC): Define as
- 0 for right now as dynamic-no-pic is not implemented on Darwin/ia32.
- * config/rs6000/darwin.h (MASK_MACHO_DYNAMIC_NO_PIC): Define.
- (TARGET_DYNAMIC_NO_PIC): Define.
- (SUBTARGET_SWITCHES): Define, have sub-target switches for
- dynamic-no-pic.
- (SUBTARGET_OVERRIDE_OPTIONS): Move check for -fpic from
- rs6000_override_options to here. Dynamic-no-pic overrides
- pic.
- (CC1_SPEC): Change from not static then pic to not static and not
- dynamic-no-pic then pic.
- * config/rs6000/rs6000.c (rs6000_override_options): Move the
- check for -fpic and DARWIN_ABI to config/rs6000/darwin.h
- (rs6000_legitimize_reload_address): Add case for loading floating in
- dynamic-no-pic.
- (rs6000_emit_move): Add case for dynamic-no-pic. Change reference
- of flag_pic to MACHOPIC_INDIRECT.
- (secondary_reload_class): Conditional change the reference of
- flag_pic to MACHOPIC_INDIRECT.
- (rs6000_output_mi_thunk): Change reference of flag_pic to
- MACHOPIC_INDIRECT.
- (output_profile_hook): Likewise.
- (machopic_output_stub): Non-pure (dynamic-no-pic) is now supported.
- * config/rs6000/rs6000.md (movdf_low): Add the case for
- MACHO_DYNAMIC_NO_PIC_P.
- (call): Change references for flag_pic in TARGET_MACHO to
- MACHOPIC_INDIRECT.
- (SUBTARGET_OVERRIDE_OPTIONS): Add case where -fpic is on and
- -mdynamic-no-pic is on. Also move case for -fpic from rs6000.c.
- * doc/invoke.texi (-mdynamic-no-pic): Document.
-
-2003-03-10 Devang Patel <dpatel@apple.com>
-
- PR c++/9394
- * gcc.c (DEFAULT_SWITCH_TAKES_ARG): Remove.
- (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.
- * gcc.h (DEFAULT_SWITCH_TAKES_ARG): Add.
- (DEFAULT_WORD_SWITCH_TAKES_ARG): Add.
- * cppspec.c (DEFAULT_SWITCH_TAKES_ARG): Remove.
- (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.
-
-2003-03-10 Steven Bosscher <s.bosscher@student.tudelft.nl>
-
- PR optimization/7189
- * toplev.c (rest_of_compilation): Move
- check_function_return_warnings up to just after
- delete_unreachable_blocks.
-
-2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.h (HARD_REGNO_RENAME_OK): Define.
- * config/m68hc11/m68hc11-protos.h (m68hc11_hard_regno_rename_ok):
- Declare.
- * config/m68hc11/m68hc11.c (m68hc11_hard_regno_rename_ok): New function
- for reg rename optimization to avoid using Z and Y registers.
-
-2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.md ("*addhi3_68hc12"): Accept any constant
- when adding to X and Y since leax/leay are fast.
- ("*addhi3"): Accept 'I' constraint when adding to address register.
- ("rotlhi3"): Operand 1 must be a register_operand.
- (peephole2): New peephole to optimize some adds.
- * config/m68hc11/m68hc11.h (CONST_OK_FOR_LETTER_P): Use 'I' constraint
- to represent -2 .. 2 small integer range.
-
-2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (m68hc11_gen_rotate): Set carry before
- each 16-bit rotation.
-
-2003-03-10 Zack Weinberg <zack@codesourcery.com>
-
- * c-opts.c (add_prefixed_path): Don't use concat. When
- prefixing with cpp_GCC_INCLUDE_DIR, copy only the first
- cpp_GCC_INCLUDE_DIR_len characters.
-
-2003-03-10 Segher Boessenkool <segher@koffie.nl>
-
- * testsuite/gcc.dg/altivec-9.c: New file.
-
- * config/rs6000/rs6000.c (altivec_frame_fixup): Remove.
- (rs6000_emit_prologue): Use rs6000_frame_related instead.
-
-2003-03-10 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.h: Define __ev64_*64__ to use single element
- vectors.
- (__ev_convert_u64): Remove macro. Define as inline.
- (__ev_convert_s64): Same.
-
-2003-03-10 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.h (DWARF_FRAME_REGISTERS): Define.
- (rs6000_stack_t): Add spe_64bit_regs_used.
-
- * config/rs6000/rs6000.c (rs6000_stack_info): Calculate
- spe_64bit_regs_used, and use it to determine the size of the
- frame.
- (spe_func_has_64bit_regs_p): New.
- (spe_synthesize_frame_save): New.
- (rs6000_frame_related): Handle SPE synthetic registers.
- (rs6000_emit_prologue): Only save in 64-bits if the function used
- any registers in 64-bit mode.
- (rs6000_emit_epilogue): Same, but for restore.
-
-2003-03-10 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.h (enum floating_point_type): Delete. Replace with...
- (enum fputype): ... new.
- (FPUTYPE_DEFAULT): Renamed from FP_DEFAULT. Values reworked.
- * linux-elf.h (FPUTYPE_DEFAULT): Likewise.
- * arm.md (attr fpu): Reworked for new underlying enum values.
- * arm.c (arm_fpu_arch): Now enum fputype.
- (arm_fpu_tune): Renamed from arm_fpu. Now enum fputype.
- (arm_override_options, arm_output_epilogue, arm_expand_prologue):
- Update uses of arm_fpu_arch and arm_fpu_tune.
-
-2003-03-10 Josef Zlomek <zlomekj@suse.cz>
-
- * cfgcleanup.c (outgoing_edges_match): Compare the jump tables.
- (try_crossjump_to_edge): Replace refereces to one jump table by
- references to identical jump table.
- * loop.c (load_mems): Moved setting the JUMP_LABEL to replace_label.
- (replace_label): Moved to rtlanal.c.
- (struct rtx_pair): Moved to rtl.h.
- * rtl.h (struct rtx_pair): Moved from loop.c.
- (replace_label): New extern function.
- (subrtx_p): New extern function.
- (tablejump_p): New extern function.
- * rtlanal.c (replace_label): Moved from loop.c.
- (subrtx_p_1): New static function.
- (subrtx_p): New function.
- (tablejump_p): New function.
-
-2003-03-10 Jan Hubicka <jh@suse.cz>
-
- * cfgcleanup.c (try_optimize_cfg): Fix thinko in previous patch.
-
- * cfgcleanup.c (merge_blocks): Return where to iterate next.
- (try_optimize_cfg): Use return value of merge_blocks
-
-2003-03-10 Michael Matz <matz@suse.de>
-
- * cfg.c (unchecked_make_edge): New.
- (cached_make_edge): Use it.
- * basic-block.h (unchecked_make_edge): Declare.
- * cfglayout.c (cfg_layout_duplicate_bb): Use it.
-
-2003-03-10 Richard Earnshaw <rearnsha@arm.com>
-
- * fpa.md: New file. Move all patterns relating to FPA co-processor
- to here...
- * arm.md: ... from here.
- (cirrus.md, fpa.md): Include at end of description.
- (divsf3, divdf3, modsf3, movdf3, sqrtsf2, sqrtdf2): New expands.
- (pic_load_addr_based): Remove register constraint from expander.
- (seq, sne, sgt, sle, slt, sge, sgeu, sleu, sgtu, sltu, sunordered)
- (sordered, sungt, sunle, sunge, sunlt): Likewise.
- (eh_epilogue, tablejump): Likewise.
-
-2003-03-09 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * tree.c (substitute_in_expr, case 'e'): Only make recursive call
- on operands if it has a PLACEHOLDER_EXPR.
-
-2003-03-09 David Edelsohn <edelsohn@gnu.org>
- Mostafa Hagog
-
- * config/rs6000/rs6000.md (movsi_update1): Add TARGET_UPDATE final
- condition.
-
-2003-03-09 Neil Booth <neil@daikokuya.co.uk>
-
- * config/frv/frv.h: Use TARGET_CPU_CPP_BUILTINS, not CPP_PREDEFINES.
- * config/ip2k/ip2k.h: Similarly.
- * config/m32r/m32r.h: Similarly.
- * config/m68hc11/m68hc11.h: Similarly.
- * config/mn10200/mn10200.h: Similarly.
- * config/mn10300/mn10300.h: Similarly.
- * config/pdp11/pdp11.h: Similarly.
- * config/v850/v850.h: Similarly.
- * config/rs6000/vxworks.h: Similarly for TARGET_OS_CPP_BUILTINS.
- * config/v850/retms.h: Similarly for TARGET_OS_CPP_BUILTINS.
- * config/mips/iris3.h: Remove #if 0 block.
-
-2003-03-09 Roger Sayle <roger@eyesopen.com>
- Joern Rennecke <joern.rennecke@superh.com>
-
- * gcc.c (do_spec_1) ['{']: Revert 2003-02-24 patch. Don't handle
- pending argument upon return from handle_braces here.
- (do_spec_2): Instead handle it upon return from do_spec_1 here.
-
-2003-03-09 Roger Sayle <roger@eyesopen.com>
- Joern Rennecke <joern.rennecke@superh.com>
-
- * gcc.c (do_spec_1) ['{']: Revert 2003-02-24 patch. Don't handle
- pending argument upon return from handle_braces here.
- (do_spec_2): Instead handle it upon return from do_spec_1 here.
-
-2003-03-09 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * varasm.c (make_decl_one_only): Use declare_weak().
-
-2003-03-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR middle-end/9986
- * c-common.c (c_common_nodes_and_builtins): Initialize target builtins
- after the common builtins.
- * pa-hpux.h (DONT_HAVE_FPUTC_UNLOCKED): Define.
- * pa.c (TARGET_INIT_BUILTINS): Define.
- (pa_init_builtins): New function.
-
- * pa.md (call, call_value, sibcall, sibcall_value): When sufficient
- space has been allocated for the outgoing arguments, set the arg
- pointer for a call emitted after virtuals have been instantiated
- using the stack pointer offset, otherwise abort.
-
-2003-03-09 DJ Delorie <dj@redhat.com>
-
- * config/stormy16/stormy16.h (DWARF_LINE_MIN_INSTR_LENGTH): Revert.
-
-2003-03-09 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (fix_truncsfsi2, fix_truncdfsi2, arm_fix_truncsfsi2)
- (arm_fix_truncdfsi2): Add missing fix in floating point mode before
- conversion to integer.
- * cirrus.md (cirrus_truncsfsi2, cirrus_truncdfsi2): Likewise.
-
-2003-03-09 Roger Sayle <roger@eyesopen.com>
-
- * builtins.def: Fix typo and improve grammar.
- * loop-unroll.c (decide_peel_completely): Tidy log message.
-
-2003-03-09 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*tstsi_upper_bit): New.
- (*iorsi3_e2f): Likewise.
-
-2003-03-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (h8300_and_costs): Return the number of
- assembly instructions needed.
- (h8300_shift_costs): Likewise.
-
-2003-03-09 Hans-Peter Nilsson <hp@bitrange.com>
-
- * config/cris/aout.h (ENDFILE_SPEC): Undef.
-
- * optabs.c (gen_move_insn): Move logic for synthesizing MODE_CC
- moves from here ...
- * expr.c (emit_move_insn_1): ... to here.
-
- * config/cris/aout.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__AOUT__ to...
- (TARGET_OS_CPP_BUILTINS): New macro.
- * config/cris/cris.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__ELF__ to...
- (TARGET_OS_CPP_BUILTINS): New macro.
- (CPP_PREDEFINES): Don't define. Move old definitions and...
- (CPP_SPEC): ...move -D__CRIS_ABI_version=2 to...
- (TARGET_CPU_CPP_BUILTINS): New macro.
- * config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC): Move constant
- definitions and the optional __PIC__, __pic__ and
- __NO_UNDERSCORES__ definitions to...
- (TARGET_OS_CPP_BUILTINS): New macro.
-
- * flags.h (flag_leading_underscore): Declare.
-
- * c-opts.c (c_common_post_options): On fopen failure, return
- false, not NULL.
-
-2003-03-08 Hans-Peter Nilsson <hp@bitrange.com>
-
- * config/cris/cris_abi_symbol.c: #include tconfig.h and tm.h, not
- config.h.
- * config/cris/cris.h (HAVE_GAS_HIDDEN): Don't define here.
- * config/cris/aout.h (HAVE_GAS_HIDDEN): Undef.
-
-2003-03-08 Neil Booth <neil@daikokuya.co.uk>
-
- * config/sh/rtemself.h (TARGET_OS_CPP_BUILTINS): Use instead of
- CPP_PREDEFINES.
- * config/sh/rtems.h (TARGET_OS_CPP_BUILTINS): Use instead of
- CPP_PREDEFINES.
-
-2003-03-08 Neil Booth <neil@daikokuya.co.uk>
-
- * c-common.h (c_common_init, c_common_post_options): Update.
- * c-objc-common.c (c_objc_common_init): Update for new prototype.
- * c-opts.c (saved_lineno): New.
- (c_common_post_options, c_common_init): Update prototypes,
- move call to cpp_read_main_file from latter to former.
- * c-tree.h (c_ojbc_common_init): Update.
- * langhooks-def.h (lhd_post_options): New.
- (LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
- * langhooks.c (lhd_post_options): New.
- * langhooks.h (struct lang_hooks): Update post_options and init hooks.
- * toplev.c (no_backend): New.
- (process_options): Call post_options hook and set main_input_filename
- and input_filename here.
- (lang_dependent_init, do_compile): post_options hook moved to
- process_options.
- * objc/objc-act.c (objc_init): Update prototype.
- * objc/objc-act.h (objc_init): Update prototype.
-
-2003-03-08 Roger Sayle <roger@eyesopen.com>
-
- * emit-rtl.c (gen_lowpart): Don't attempt to load a part of
- a complex or vector type, using a load in the original mode.
-
-2003-03-08 Jan Hubicka <jh@suse.cz>
-
- * Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.
- * gt-cgraph.h: New GC file.
- * cgraph.c (known_fns): New static variable.
- (cgraph_node): Add the decl into varray.
-
-2003-03-08 Hans-Peter Nilsson <hp@bitrange.com>
-
- * config/mmix/mmix.md ("*movcc_expanded"): Add missing alternatives.
-
-2003-03-08 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (fpa_rhs_operand, fpa_add_operand, const_double_rtx_ok_for_fpa)
- (neg_const_double_ok_for_fpa, output_mov_long_double_fpa_from_arm)
- (output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm)
- (output_mov_double_arm_from_fpa): Renamed to use fpa instead of fpu.
- All callers changed.
- * arm.md, arm.h, arm-protos.h: Updated.
-
- * arm.h (enum reg_class FPA_REGS): Renamed from FPU_REGS.
- (CLASS_MAX_NREGS, REGISTER_MOVE_COST, REG_CLASS_FROM_LETTER): Updated.
- * arm.c (arm_regno_class, f_register_operand): Updated.
-
-2003-03-08 Hans-Peter Nilsson <hp@bitrange.com>
-
- * config/cris/cris.h: Remove EGCS references.
- (CPP_SPEC): Remove "-$".
- (INIT_CUMULATIVE_ARGS): Adjust parameter name to FNDECL.
-
-2003-03-08 Neil Booth <neil@daikokuya.co.uk>
-
- * config/stormy16/stormy16.h (TARGET_CPU_CPP_BUILTINS): Use in
- preference to CPP_PREDEFINES.
-
-2003-03-08 Neil Booth <neil@daikokuya.co.uk>
-
- * cppinit.c (cpp_finish_options): Set first_unused_line to -1.
-
-2003-03-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*extzv_16_8): New.
-
-2003-03-08 Jan Hubicka <jh@suse.cz>
-
- * c-decl.c: (finish_function): Update call of tree_inlinable_function_p.
- * cgraph.h: (cgraph_local_info): Add can_inline_once
- (cgraph_global_info): Add inline_once.
- (cgraph_node): Add previous.
- (cgraph_remove_node): New.
- * cgraphunit.c (cgraph_mark_functions_to_inline_once): New static
- function.
- (cgraph_optimize): Call it.
- (cgraph_finalize_function): Set inlinable flags.
- (cgraph_finalize_compilation_unit): Actually remove the reclaimed nodes.
- (cgraph_mark_functions_to_output): Use new inlining heuristics flags.
- (cgraph_expand_function): Likewise.
- * cgraph.c
- (cgraph_node): Put nodes into doubly linked chain.
- (cgraph_remove_node): New function.
- * flags.h (flag_inline_functions_called_once): Declare.
- * tree-inline.c: Include cgraph.h
- (inlinable_functions_p): Add extra argument to bypass limits.
- (expand_call_inline): Obey cgraph flag.
- * tree-inline.h (tree_inlinable_function_p): Update prototype.
-
-2003-03-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * gcse.c (bypass_block, bypass_conditional_jumps): Do not create
- irreducible loops.
-
- * loop-unroll.c (unroll_loop_runtime_iterations): Update irreducible
- loops info correctly.
-
-2003-03-08 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR middle-end/7796
- * unroll.c (calculate_giv_inc): Handle constants being
- loaded with LSHIFTRT.
-
-2003-03-07 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (processor_target_table): Do not disable
- GP optional instructions on Power3, Power4, 620, and 630.
-
-2003-03-07 Kazu Hirata <kazu@cs.umass.edu>
-
- * calls.c: Fix comment formatting.
- * cfgloopanal.c: Likewise.
- * cfgloopmanip.c: Likewise.
- * combine.c: Likewise.
- * dwarf2out.c: Likewise.
- * ggc-common.c: Likewise.
- * langhooks.c: Likewise.
- * loop-unroll.c: Likewise.
- * loop.c: Likewise.
- * ra-build.c: Likewise.
- * sbitmap.c: Likewise.
- * toplev.c: Likewise.
-
-2003-03-07 James E Wilson <wilson@tuliptree.org>
-
- * config/sh/sh.h (HARD_REGNO_NREGS): Round up the XD register count.
-
-2003-03-07 Geoffrey Keating <geoffk@apple.com>
-
- * objc/lang-specs.h (objective-c-header): Use .gch not .pch;
- support -no-integrated-cpp.
-
- * c-pch.c (get_ident): Use c_language_kind and flag_objc rather
- than langhooks.name.
-
-2003-03-07 Michael Matz <matz@suse.de>
-
- * df.h (enum df_ref_flags.DF_REF_STRIPPED): New.
- (DF_FOR_REGALLOC): New.
- * df.c (df_ref_record): Set DF_REF_STRIPPED.
- (read_modify_subreg_p): Simplify.
- (df_def_record_1, df_uses_record): Set DF_REF_MODE_CHANGE more often.
- Use DF_FOR_REGALLOC.
- * ra.h (struct web): New member subreg_stripped.
- (invalid_mode_change_regs): Declare.
- * ra.c (invalid_mode_change_regs): New.
- (init_ra): Initialize it.
- * ra-build.c (init_one_web_common, remember_web_was_spilled): Use it.
- Use CANNOT_CHANGE_MODE_CLASS as ifdef guard.
- (reinit_one_web, parts_to_web_1): Deal with subreg_stripped.
- * ra-colorize.c (colorize_one_web): Use invalid_mode_change_regs.
- Use CANNOT_CHANGE_MODE_CLASS as ifdef guard.
-
-2003-03-07 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (addsf3, adddf3, subsf3, subdf3, mulsf3, muldf3, negsf2)
- (negdf2, abssi2, abssf2, absdf2, floatsisf2, floatsidf2)
- (fix_truncsfsi2, fix_truncdfsi2, truncdfsf2): Moved back into main
- machine description file from ...
- * cirrus.md: ... here.
-
-2003-03-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Don't use
- reg_overlap_mentioned_p.
-
-2003-03-06 Geoffrey Keating <geoffk@apple.com>
-
- * c-pch.c: Include langhooks.h.
- (IDENT_LENGTH): New.
- (get_ident): New.
- (pch_ident): Delete.
- (pch_init): Use get_ident, IDENT_LENGTH.
- (c_common_valid_pch): Likewise. Also, use actual language
- in warning message.
- * Makefile.in (c-pch.o): Add langhooks.h to dependencies.
-
- * objc/config-lang.in (gtfiles): Add objc-act.c. Remove duplicate
- c-parse.in.
- * objc/Make-lang.in (objc/objc-act.o): Add dependency on
- gt-objc-objc-act.h.
- (gt-objc-objc-act.h): New rule.
- * objc/lang-specs.h: Support PCH.
- * objc/objc-act.c: Include gt-objc-objc-act.h.
- (objc_add_static_instance): Move num_static_inst out, mark for PCH.
- (build_selector_reference_decl): Move idx out, mark for PCH.
- (build_class_reference_decl): Likewise.
- (build_objc_string_decl): Move *_idx out, mark for PCH.
- (build_tmp_function_decl): Move xxx out, mark for PCH.
-
-2003-03-06 Dale Johannesen <dalej@apple.com>
-
- * config/rs6000/rs6000.c (rs6000_binds_local_p): Consider
- global functions for inlining on Darwin.
-
-2003-03-06 Vladimir Makarov <vmakarov@redhat.com>
-
- * haifa-sched.c (schedule_block): Don't call reorder when sorting
- is prohibited.
-
-2003-03-06 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (c-ppoutput.o): Update.
- * c-common.h (init_pp_output): New.
- (preprocess_file): Update.
- * c-lex.c (init_c_lex): Move mbchar initialization to cpplib.
- Register builtins.
- * c-opts.c (c_common_init): Call init_pp_output if preprocessing.
- Make call to cpp_read_main_file common to whether preprocessing
- or not. Don't register builtins.
- * c-ppoutput.c: Include c-pragma.h.
- (setup_callbacks): Rename init_pp_output.
- (preprocess_file): No longer setup callbacks or call
- cpp_read_main_file.
- * cpphash.h (_cpp_init_mbchar): New.
- * cppinit.c (init_library): Call _cpp_init_mbchar.
- * cpplex.c (_cpp_init_mbchar): New.
-
-2003-03-06 Roger Sayle <roger@eyesopen.com>
-
- * emit-rtl.c (gen_lowpart): When requesting the low-part of a
- MEM, try loading the MEM into a register and taking the low-part
- of that, to help CSE see the use of the MEM in its true mode.
-
-2003-03-05 Tom Tromey <tromey@redhat.com>
-
- * config/stormy16/stormy16.h (DWARF_LINE_MIN_INSTR_LENGTH):
- Define.
-
-2003-03-05 Nick Clifton <nickc@cambridge.redhat.com>
-
- * config/stormy16/stormy16.md ("*eqbranchsi"): Remove '+' on
- operand 2.
- ("*ineqbranchsi"): Likewise.
-
-2003-03-05 Andrew Haley <aph@cambridge.redhat.com>
-
- * config/stormy16/stormy16.c (xstormy16_expand_prologue): Delete
- mem_fake_push_rtx. Instead construct a SEQUENCE to show the
- register store followed by a stack increment.
-
-2003-03-05 Chris Moller <cmoller@redhat.com>
-
- * config/stormy16/stormy16.c (REG_NEEDS_SAVE): added a term
- to inhibit saving CARRY_REGS.
-
- * config/stormy16/stormy16.c (xs_hi_general_operand):
- added predicate to detect and error-out on out-of-range
- const_ints for movhi.
- * config/stormy16/stormy16.md (movhi): use
- xs_hi_general_operand.
-
- * config/stormy16/stormy16.c (xstormy16_expand_prologue):
- added a check for local vbl size overflow.
- * config/stormy16/stormy16.c (xs_hi_nonmemory_operand):
- added predicate to detect and error-out on out-of-range
- const_ints for addhi and subhi.
- * config/stormy16/stormy16.md (addhi3, addchi4, addchi5,
- subhi3, subchi4, subchi5): used xs_hi_nonmemory_operand.
-
- * config/stormy16/stormy16.c (xstormy16_legitimate_address_p):
- add a term to accept PRE_MODIFY addresses.
- * config/stormy16/stormy16.c (xstormy16_expand_move):
- add code to expand PRE_MODIFY addresses to an add followed
- by a move.
-
-2003-03-06 Jason Merrill <jason@redhat.com>
-
- * tree-inline.c (inlinable_function_p): Revert earlier change
- pending investigation.
-
-2003-03-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a new peephole2): New.
-
-2003-03-06 Jan Hubicka <jh@suse.cz>
-
- * cgraph.c (cgraph_node): Do not confuse nested functions and methods.
-
-2003-03-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * dwarf2out.c (size_of_die): Compute size of external reference to
- die correctly.
-
-2003-03-06 Hans-Peter Nilsson <hp@bitrange.com>
-
- * config/mmix/mmix.md ("*movcc_expanded"): New pattern.
- ("movcc", "movcc_uns", "movcc_fp", "movcc_fpeq", "movcc_fun"): New
- expanders.
-
-2003-03-05 Roger Sayle <roger@eyesopen.com>
-
- * expr.h (lang_expand_expr): Delete obsolete prototype.
-
-2003-03-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * emit-rtl.c (gen_highpart_mode): Fix a comment typo.
-
-2003-03-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Generalize to
- accept a memory operand.
-
-2003-03-05 Olivier Hainque <hainque@act-europe.fr>
-
- * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '+'.
- * config/alpha/alpha.c (print_operand, case '+'): New.
- * config/alpha/alpha.md (call_osf_1_noreturn): Document and use.
- (call_value_osf_1_noreturn): Likewise.
-
-2003-03-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stmt.c (fixup_gotos): Change meaning of DONT_JUMP_IN.
- (expand_end_bindings): Likewise.
-
-2003-03-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.md (return_external_pic): Add !TARGET_PA_20 to constraint.
- (epilogue): Don't generate return_external_pic when emitting PA 2.0
- code.
-
-2003-03-05 Aldy Hernandez <aldyh@redhat.com>
-
- * doc/tm.texi: Document TARGET_DWARF_REGISTER_SPAN.
-
- * config/rs6000/rs6000.c (rs6000_dwarf_register_span): New.
-
- * hooks.c (hook_rtx_rtx_null): New.
-
- * hooks.h (hook_rtx_rtx_null): Protoize.
-
- * target-def.h (TARGET_DWARF_REGISTER_SPAN): New macro.
- (TARGET_INITIALIZER): Add TARGET_DWARF_REGISTER_SPAN.
-
- * target.h (struct gcc_target): Add dwarf_register_span.
-
- * dwarf2out.c (multiple_reg_loc_descriptor): New.
- (one_reg_loc_descriptor): New.
- (reg_loc_descriptor): Add support for values that span more than
- one register.
-
-2003-03-05 Jan Hubicka <jh@suse.cz>
-
- * Makefile.in (calls.o, toplev.o alias.o): Depend on cgraph.h
- * alias.c: Include cgraph.h
- (mark_constant_function): Use cgraph_rtl_info.
- * calls.c: Include cgraph.h
- (flags_from_decl_or_type): Use cgraph_rtl_info to find pure and const
- calls.
- (expand_call): Use cgraph_rtl_info to set preferred stack boundary.
- * cgraph.c (cgraph_rtl_info): New function.
- * cgraph.h (cgraph_rtl_info): Declare
- (cgraph_rtl_info): Likewise.
- * function.h (struct function): Add recursive_call_emit.
- * toplev.c: Include cgraph.h.
- (rest_of_compilation): Set preferred_incoming_stack_boundary.
-
-2003-03-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_simode_bld): Clear the
- destination first if possible.
- * config/h8300/h8300.md (extzv_1_r_h8300hs): Add an
- alternative.
- (extzv_1_r_inv_h8300hs): Likewise.
-
-2003-03-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * basic-block.h (EDGE_IRREDUCIBLE_LOOP, EDGE_ALL_FLAGS): New.
- * cfg.c (dump_edge_info): Add EDGE_IRREDUCIBLE_LOOP flag dump.
- * cfgloop.c (flow_loop_free): Made global.
- (establish_preds): New static function.
- (flow_loop_tree_node_add): Handle subloops of added loop correctly.
- (get_loop_exit_edges): New.
- (verify_loop_structure): Verify EDGE_IRREDUCIBLE_LOOP flags.
- * cfgloop.h (flow_loop_free, get_loop_exit_edges, unloop): Declare.
- * cfgloopanal.c (mark_irreducible_loops): Mark edges in irreducible
- loops.
- * cfgloopmanip.c (loop_delete_branch_edge): Allow to test for
- removability of an edge.
- (fix_irreducible_loops): New static function.
- (find_path, remove_path): Add ability to remove enclosing loops.
- (unloop): New.
- (copy_bbs, duplicate_loop_to_header_edge): Use EDGE_IRREDUCIBLE_LOOP
- flags.
- * cfgrtl.c (verify_flow_info): Handle EDGE_IRREDUCIBLE_LOOP flag.
- * loop-unroll.c (peel_loops_completely): Do not duplicate loop if
- not neccessary.
- (decide_peel_completely, peel_loops_completely): Allow complete peeling
- of non-duplicable once rolling loops.
- * loop-unswitch.c (unswitch_loop): Update EDGE_IRREDUCIBLE_LOOP flags.
-
-2003-03-05 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, the minimum value
- for align_jumps is 4.
-
- (SECONDARY_INPUT_RELOAD_CLASS): If reloading a PLUS into FPUL,
- use GENERAL_REGS.
-
-2003-03-05 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.h (PAD_VARARGS_DOWN): Define and return
- according to va_arg type.
- (EXPAND_BUILTIN_VA_ARG): Remove.
- * config/m68hc11/m68hc11.c (m68hc11_va_arg): Remove.
- * config/m68hc11/m68hc11-protos.h (m68hc11_va_arg): Remove.
-
-2003-03-05 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (rs6000_variable_issue): Remove unnecessary
- else clauses.
-
-2003-03-05 Michael Matz <matz@suse.de>
-
- * i386/i386.c (ix86_save_reg): Also test
- current_function_uses_const_pool.
-
-2003-03-05 Michael Matz <matz@suse.de>
-
- * unwind.h: Add the GPL exception.
- * Makefile.in (USER_H): Add unwind.h.
-
-2003-03-05 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR c/9799
- * c-typeck.c (push_init_level): Add sanity check.
-
-2003-03-05 Jan Hubicka <jh@suse.cz>
-
- * toplev.c (rest_of_compilation): Deffer RTL compilation only when
- RTL inlining is done.
-
- * cgraphunit.c (cgraph_mark_local_functions): New local function.
- (cgraph_optimize): Mark local functions.
- * i386-protos.h (init_cumulative_args): Update prototype.
- * i386.c (init_cumulative_args): Use register passing convention for
- local functions.
-
- * cgraph.c (cgraph_global_info_ready): New global variable
- (cgraph_local_info, cgraph_global_info): New functions.
- * cgraph.h (struct cgraph_local_info, cgraph_global_info): New
- structures.
- (cgraph_local_info, cgraph_global_info, cgraph_global_info_ready):
- Declare.
- * cgraphunit.c (cgraph_finalize_function): Set inline_many.
- (cgraph_mark_functions_to_output): Use inline_many.
- (cgraph_expand_function): Free DECL_SAVED_TREE uncondtionally.
- (cgraph_expand_functions): Expand inline functions last.
- (cgraph_optimize): Do not emit uneeded functions.
-
-2003-03-04 Steve Ellcey <sje@cup.hp.com>
-
- * expr.c (convert_modes): Check for legal hard register.
-
-2003-03-04 Tom Tromey <tromey@redhat.com>
-
- * doc/sourcebuild.texi (Front End Directory): Document tags.
- * configure: Rebuilt.
- * configure.in (target_list): Added tags.
- * Makefile.in (TAGS): Depend on lang.clean. Include subdirectory
- TAGS files by reference.
- * objc/Make-lang.in (objc.tags): New target.
-
-2003-03-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * gcov-io.h (gcov_save_position, gcov_reserve_length, gcov_resync,
- gcov_skip, gcov_skip_string, gcov_write_unsigned, gcov_write_counter,
- gcov_write_string, gcov_read_unsigned, gcov_read_counter,
- gcov_read_string, gcov_write_length): Modified to enable reading/
- writing of whole .da file just once.
- (da_file_open, da_file_close, da_file_eof, da_file_error,
- da_file_position, da_file_seek, da_file_write, da_file_read): New
- functions.
- (actual_da_file, actual_da_file_position, actual_da_file_length,
- actual_da_file_buffer, actual_da_file_buffer_size): New static
- functions.
- * libgcov.c (gcov_exit): Modified to read/write the whole .da file at
- just once.
-
-
-2003-03-04 Andreas Schwab <schwab@suse.de>
-
- * config/m68k/m68k.c (m68k_output_function_prologue): Fix CFA
- offset without frame pointer.
-
-2003-03-04 Steve Ellcey <sje@cup.hp.com>
-
- * expr.c (expand_expr): Call promote_mode to set unsignedp.
-
-2003-03-04 Daniel Jacobowitz <drow@mvista.com>
-
- * configure.in: Don't always define TARGET_SYSTEM_ROOT.
- * configure: Regenerated.
- * gcc.c: Check whether TARGET_SYSTEM_ROOT is defined.
-
-2003-03-04 Andreas Jaeger <aj@suse.de>
-
- * configure.in: Check for <memcheck.h>.
- * configure: Regenerated.
-
- * config.in: Define HAVE_MEMCHECK_H.
-
- * ggc-common.c: Use <memcheck.h> if available instead of
- <valgrind.h>.
- * ggc-page.c: Likewise.
- * cppfiles.c: Likewise.
-
-2003-03-04 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*extzv_8_8): Fix cc and lengths.
-
-2003-03-04 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR c/9262
- * c-typeck.c (do_case): Attach the first case label to the SWITCH_BODY.
- (c_finish_case): Rechain the next statements to the SWITCH_STMT.
-
-2003-03-04 Jan Hubicka <jh@suse.cz>
-
- * doc/invoke.texi: Document that unit-at-a-time is enabled for -O3
- * toplev.c (parse_options_and_default_flags): Enable flag_unit_at_a_time
- for -O3.
-
-2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * configure.in: Delete three unused variables. Move a variable
- definition closer to its use. Simplify use_collect2 logic. Start to
- organize. Simplify tests for in-tree gas and ld.
- * configure: Regenerate.
-
-2003-03-04 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in: Update.
- * c-common.c (flag_no_line_commands, flag_no_output,
- flag_dump_macros, flag_dump_includes): New.
- * c-common.h (flag_no_line_commands, flag_no_output,
- flag_dump_macros, flag_dump_includes, preprocess_file): New.
- (init_c_lex): Update prototype.
- * c-lex.c (init_c_lex): Update prototype; move some code to
- c_common_init.
- * c-opts.c (preprocess_file): Subsume into c_common_init.
- (c_common_decode_option): Update flags.
- (c_common_init): Move code from preprocess_file and init_c_lex.
- (sanitize_cpp_opts): Update.
- * c-ppoutput.c: New, cppmain.c almost verbatim.
- * cpphash.h (struct printer): Remove.
- (struct cpp_reader): Remove print.
- * cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
- cpp_preprocess_file): Remove.
- (struct cpp_options): Remove no_output, no_line_commands, dump_macros
- and dump_includes.
- * cppmain.c: Remove.
- * doc/passes.texi: Update.
-
-2003-03-04 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * function.c (STACK_ALIGNMENT_NEEDED): New macro. Default to 1.
- (assign_stack_local_1): Perform overall stack alignment only when
- STACK_ALIGNMENT_NEEDED is nonzero.
- * doc/tm.texi (STACK_ALIGNMENT_NEEDED): Document.
-
- * pa.c (compute_frame_size): Rename fsize to size. Account for
- alignment to a word boundary before general register save block. Only
- account for double-word alignment before floating point register save
- block if one or more are saved. Don't allocate space for %r3 when
- frame pointer is needed.
- (hppa_expand_prologue): Include alignment to word boundary in local
- frame size.
- * pa.h (STARTING_FRAME_OFFSET): Define to 8 on both 32 and 64-bit ports.
- (STACK_ALIGNMENT_NEEDED): Define.
-
-2003-03-04 Kevin Buettner <kevinb@redhat.com>
-
- * dwarf2out.c (rtl_for_decl_location): Don't return NULL_RTX for
- global register variables.
-
-2003-03-04 Alexandre Oliva <aoliva@redhat.com>
-
- * reload.c (reload_adjust_reg_for_mode): New function.
- (subst_reloads): Call it.
- (operands_match_p): Adjust registers using HARD_REGNO_NREGS.
- * reload.h (reload_adjust_reg_for_mode): Declare.
- * reload1.c (emit_input_reload_insns, emit_output_reload_insns):
- Call it.
-
-2003-03-03 James E Wilson <wilson@tuliptree.org>
-
- * optabs.c (add_equal_note): Delete SUBREG_REG use.
- Fixes PR c/7872.
-
-2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*ixorsi3_ashift_16): New.
- (*ixorsi3_lshiftrt_16): New.
- (*iorsi3_ashift_16): Remove.
-
-2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*extzv_8_8): Use '?' to simplify the
- pattern.
-
-2003-03-03 Geoffrey Keating <geoffk@apple.com>
-
- * doc/install.texi (Specific): Update entry for powerpc-darwin.
-
-2003-03-03 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.h (HAVE_AS_LTOFFX_LDXMOV_RELOCS): Default to 0.
-
-2003-03-03 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (rs6000_multipass_dfa_lookahead): Delete.
- (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Delete.
- (rs6000_variable_issue): Do not return negative value.
- (rs6000_issue_rate): Uniformly set issue rate to 1 for first
- scheduling pass.
-
-2003-03-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * dwarf2out.c (dwarf2out_finish): Swap order of break_out_includes and
- prune_unused_types calls.
-
-2003-03-03 Jason Merrill <jason@redhat.com>
-
- * tree-inline.c (find_builtin_longjmp_call): Save and restore
- lineno and input_filename.
- (find_alloca_call): Likewise.
- (inlinable_function_p): Run the langhook earlier.
-
- * calls.c (compute_argument_addresses): Give the new MEMs a
- minimum alignment of PARM_BOUNDARY.
-
-2003-03-03 J"orn Rennecke <joern.rennecke@superh.com>
-
- * config/sh/sh.h (EXTRA_SPECS): Add subtarget_asm_relax_spec and
- subtarget_asm_isa_spec.
- (SUBTARGET_ASM_RELAX_SPEC, SUBTARGET_ASM_ISA_SPEC): Define.
- (ASM_SPEC): Define as SH_ASM_SPEC.
- (SH_ASM_SPEC): New; take the role of ASM_SPEC, but safe from svr4.h.
- Use subtarget_asm_relax_spec and subtarget_asm_isa_spec.
- * config/sh/elf.h (ASM_SPEC): Use SH_ASM_SPEC.
- (SUBTARGET_ASM_ISA_SPEC): Undef / define.
-
- * sh.h (OVERRIDE_OPTIONS): Set default values for align_loops
- and align_jumps if not set.
- Force align_jumps to be at least 2.
- When relaxing, force align_functions to be at least the maximum of
- align_loops, align_jumps and 4.
- * sh.c (find_barrier, barrier_align): Honour align_jumps_log.
- (sh_loop_align): Honour align_loops_log.
-
- * sh.md (length attribute): Use prev_nonnote_insn instead of PREV_INSN
- to check for indirect_jump_scratch.
- (indirect_jump_scratch): Add second set.
- * sh.c (output_far_jump): Use prev_nonnote_insn instead of PREV_INSN
- when looking for indirect_jump_scratch.
- Extract scratch register taking new structure of indirect_jump_scratch
- into account.
- (gen_block_redirect): Set INSN_SCOPE for indirect_jump_scratch.
-
-2003-03-03 Jan Hubicka <jh@suse.cz>
-
- * calls.c (rtx_for_function_call): Take the address as an argument
- (expand_call): Do not modify the expression.
-
- * toplev.c (rest_of_compilation): Avoid cfg_cleanup calls when not
- optimizing.
-
-2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*ixorsi3_zext_hi): Restrict to
- TARGET_H8300H and TARGET_H8300S.
-
-2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*extzv_8_8): Use shorter code when
- operands[0] and operands[1] are different.
-
-2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * reload1.c (reload_cse_move2add): Remove variable success.
-
-2003-03-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ggc-common.c (ggc_rlimit_bound): Cast RLIM_INFINITY to avoid
- warnings.
-
-2003-03-02 Richard Henderson <rth@redhat.com>
-
- * configure.in (HAVE_AS_LTOFFX_LDXMOV_RELOCS): New ia64 test.
- * config.in, configure: Rebuild.
- * config/ia64/ia64.c (ia64_ld_address_bypass_p): Accept lo_sum.
- * config/ia64/ia64.md (load_symptr): Use high/lo_sum for the
- paired ldtoffx and ldxmov annotations.
- (load_symptr_internal1): Remove.
- (load_symptr_high, load_symptr_low): New.
-
-2003-03-02 Neil Booth <neil@daikokuya.co.uk>
-
- * c-incpath.c (add_path): Fix sysp assignment.
-
-2003-03-02 Kurt Garloff <garloff@suse.de>
-
- * params.def: Introduce parameter max-inline-insns-rtl for
- a separate limit for the RTL inliner.
- * params.h: Likewise.
- * integrate.c (function_cannot_inline_p): Use it.
- * toplev.c (decode_f_option): Set multiple parameters
- controlling inlining with -finline-limit.
- * params.def: Fix orthographic and typographic errors.
- * doc/invoke.texi: Document parameters controlling inlining
- and the way -finline-limit sets multiple of them.
-
- * tree.h (struct tree_decl): Introduce inlined_function_flag,
- recording whether the function became eligible for inlining
- by a compiler flag rather than the declaration.
- Provide DID_INLINE_FUNC macro to access it.
- * c-decl.c (grokdeclarator): Set DID_INLINE_FUNC.
- * cp/decl.c (grokfndecl): Likewise.
- * toplev.c (rest_of_compilation): Likewise.
- * cp/optimize (maybe_clone_body): Copy DID_INLINE_FUNC.
- * print-tree.c (print_node): Report it.
- * params.def: Introduce new max-inline-insns-auto limit.
- * params.h: Likewise.
- * tree-inline.c (inlinable_function_p): Apply it to functions
- with DID_INLINE_FUNC set.
- * toplev.c (decode_f_option): Initialize it from -finline-limit
- value.
- * doc/invoke.texi: Document new parameter.
-
-2003-03-02 Geoffrey Keating <geoffk@apple.com>
-
- * fix-header.c (read_scan_file): Don't reference simplify_path.
-
-2003-03-02 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (m68hc11_override_options): Don't enable
- min/max instructions by default as may result in reload errors.
-
-2003-03-02 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.md ("mulqi3"): Allow address register to
- avoid reload problems; define split for it.
-
-2003-03-02 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (m68hc11_shift_operator): New function.
- * config/m68hc11/m68hc11-protos.h (m68hc11_shift_operator): Declare.
- * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register.
- * config/m68hc11/m68hc11.md ("rotrhi3", "rotlhi3"): New patterns for
- rotatert and rotate.
- ("rotrhi3_const", "rotlhi3_const"): Rename of old 'rotrhi3' insns.
- ("*rotrhi3", "*rotlhi3"): New insn pattern for non-const rotatert.
- ("*rotrhi3_addr"): New split for shift insns on address register.
- ("*lshrhi3", "*ashrhi3", "*ashlhi3_2"): Use new split.
- * config/m68hc11/larith.asm (___rotlhi3): New asm function.
- (___rotrhi3): Likewise.
- * config/m68hc11/t-m68hc11-gas (LIB1ASMFUNCS): Build them.
-
-2003-03-02 Neil Booth <neil@daikokuya.co.uk>
-
- * toplev.c (aux_base_name): Moved from toplev.h.
- (filename): Constify.
- (lang_dependent_init): Don't duplicate name.
- (process_options): Set aux_base_name here, not...
- (do_compile): ...here. Change protoype.
- (toplev_main): Move some code from do_compile.
- * toplev.h: Remove aux_base_name.
-
-2003-03-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- iorxor_operator.
- * config/h8300/h8300.c (print_operand): Handle 'c'.
- (iorxor_operator): New.
- * config/h8300/h8300.h (PREDICATE_CODES): Add iorxor_operator.
- * config/h8300/h8300.md (*iorhi3_zext): Remove.
- (*iorsi3_zexthi): Likewise.
- (*iorsi3_zextsi): Likewise.
- (*xorhi3_zextqi): Likewise.
- (*xorsi3_zexthi): Likewise.
- (*xorsi3_zextsi): Likewise.
- (*ixorhi3_zext): New.
- (*ixorsi3_zext_qi): Likewise.
- (*ixorsi3_zext_hi): Likewise.
-
-2003-03-02 Neil Booth <neil@daikokuya.co.uk>
-
- * c-incpath.c (remove_component_p, simplify_path): Move back to
- cppfiles.c.
- (remove_duplicates): Use cpp_simplify_path.
- * c-incpath.h (simplify_path): Remove.
- * c-lex.c: Don't include c-incpath.h.
- (init_c_lex): Remove simplify_path.
- * cppfiles.c (remove_component_p, cpp_simplify_path): Restore.
- (find_or_create_entry, validate_pch): Revert.
-
-2003-03-02 Ashif Harji <asharji@uwaterloo.ca>
-
- * gcc.c (default_compilers): Add -no-integrated-cpp flag to invoke
- an external cpp during compilation.
- (option_map): Likewise.
- * objc/lang-specs.h (default_compilers): Similarly.
- * doc/invoke.texi: Document -no-integrated-cpp flag.
-
-2003-03-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (zero_extendqisi2): Change to an
- expander.
- (*zero_extendqisi2_h8300): New.
- (*zero_extendqisi2_h8300hs): New.
- (two splitters): New.
-
-2003-03-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * fp-bit.h (float_to_usi): Fix condition wrapping prototype.
-
-2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Remove dead code.
-
-2003-03-01 Roger Sayle <roger@eyesopen.com>
-
- PR c++/9367
- * builtin-types.def (DEF_FUNCTION_TYPE_VAR_3): New macro.
- (BT_FN_INT_CONST_STRING_VALIST_ARG,
- BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
- BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
- BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
- BT_FN_INT_STRING_CONST_STRING_VAR,
- BT_FN_INT_CONST_STRING_CONST_STRING_VAR,
- BT_FN_INT_STRING_SIZE_CONST_STRING_VAR): New built-in types.
- * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2,
- ATTR_NONNULL_3): Also include the nothrow attribute.
- (sprintf, scanf, sscanf, vprintf, vsprintf, snprintf,
- vsnprintf, vscanf, vsscanf): Don't define attributes here.
- * builtins.def (putchar, puts): Make full C89 built-ins.
- (snprintf, sprintf, scanf, sscanf, vprintf, vscanf,
- vsscanf, vsnprintf, vsprintf): New built-ins.
- * c-common.c (c_common_nodes_and_builtins): Handle new macro
- DEF_FUNCTION_TYPE_VAR_3.
-
- * doc/extend.texi: Document these new built-in functions.
-
-2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-03-01 Richard Earnshaw <rearnsha@arm.com>
-
- * predict.c (estimate_bb_frequencies): Correctly set
- real_values_initialized after initialization.
-
-2003-03-01 Neil Booth <neil@daikokuya.co.uk>
-
- * Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
- cppinit.o, cppdefault.o, fix-header): Update.
- * c-incpath.c: New file.
- * c-incpath.h: New file.
- * c-lex.c: Include c-incpath.h.
- (init_c_lex): Register path simplifier.
- * c-opts.c: Include cppdefault.h and c-incpath.h.
- (TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
- std_cxx_inc, quote_chain_split, add_prefixed_path): New.
- (COMMAND_LINE_OPTIONS): Add more options from cpplib.
- (missing_arg, c_common_decode_option): Handle them.
- (c_common_post_options): Register include chains.
- (print_help): Update.
- * cppdefault.h (struct default include): Update.
- Move some macros to ...
- * cppdefault.c: ... here.
- (cpp_include_defaults): Add extra field add_sysroot.
- * cppfiles.c (include_file, search_from, find_or_create_entry,
- cpp_included, find_include_file, remap_filename): Update for
- renaming of search_path to cpp_path, and of the chain headers.
- (remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
- * cpphash.h (struct search_path): Move to cpplib.h.
- (struct cpp_buffer, struct cpp_reader): Update.
- (_cpp_simplify_pathname): Remove.
- * cppinit.c: Don't include prefix.h and cppdefault.h.
- (INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
- remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
- init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
- no_pth, cpp_handle_options): Remove.
- (struct pending_option): Remove chain members.
- (cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
- cpp_handle_option): Update.
- * cpplib.h (struct cpp_path, cpp_set_include_chains): New.
- (struct cpp_options): Remove quote_include, bracket_include,
- include_prefix, include_prefix_len, verbose, ignore_srcdir,
- no_standard_includes, no_standard_cplusplus_includes.
- (struct cpp_callbacks): Add simplify_path.
- (cpp_handle_options): Remove.
- * fix-header.c: Include c-incpath.h.
- (read_scan_file): Update to use c-incpath functionality.
- * doc/passes.texi: Update.
-
-2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (bit_operand): Accept MEM only if it
- satisfies EXTRA_CONSTRAINT 'U'.
-
-2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*tst_extzv_bitqi_1_n): Take a scratch
- register.
- (*tst_extzv_memqi_1_n): Change to a splitter.
- (a peephole2): Update.
-
-2003-03-01 Richard Earnshaw <rearnsha@arm.com>
-
- * predict.c (estimate_bb_frequencies): Initialize the sreal
- constants once per compilation.
-
-2003-02-28 Richard Henderson <rth@redhat.com>
-
- * toplev.c (flag_eliminate_unused_debug_types): Enable by default.
-
-2003-02-28 scott snyder <snyder@fnal.gov>
-
- * flags.h: Add flag_eliminate_unused_debug_types.
- * toplev.c: Add flag_eliminate_unused_debug_types.
- (f_options): Add -feliminate-unused-debug-types.
- * dwarf2out.c (struct file_table): Add emitted member.
- (splice_child_die): Fix the parent pointer for the child being
- spliced.
- (lookup_filename): Maintain file_table.emitted array. Don't
- output .file directive here.
- (maybe_emit_file): (new)
- (init_file_table): Set up file_table.emitted.
- (dwarf2out_source_line): Use maybe_emit_file.
- (dwarf2out_start_source_file): Use maybe_emit_file.
- (dwarf2out_init): Use maybe_emit_file.
- (prune_unused_types_walk_attribs): (new)
- (prune_unused_types_mark): (new)
- (prune_unused_types_walk): (new)
- (prune_unused_types_prune): (new)
- (prune_unused_types): (new)
- (dwarf2out_finish): Call prune_unused_types if
- flag_eliminate_unused_debug_types is set.
- * doc/invoke.texi (Option Summary): Add
- -feliminate-unused-debug-types.
- (Debugging Options): Likewise.
-
-2003-02-28 Geoffrey Keating <geoffk@apple.com>
-
- * doc/invoke.texi: Change .pch to .gch.
- * cppfiles.c (open_file_pch): Likewise.
- * gcc.c (default_compilers): Likewise.
-
-2003-02-28 Aldy Hernandez <aldyh@redhat.com>
-
- * floatlib.c: Remove.
-
-2003-02-28 Jason Merrill <jason@redhat.com>
-
- * stor-layout.c (variable_size): Leave a "minus 1" outside the
- SAVE_EXPR.
-
-2003-02-28 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/power4.md: Add compare bypass.
-
-2003-02-28 Jason Thorpe <thorpej@wasabisystems.com>
-
- * config/netbsd.h: Update copyright years.
- (NETBSD_CPP_SPEC): Define _REENTRANT and _PTHREADS if
- -pthread is specified on the command line.
-
-2003-02-28 Dale Johannesen <dalej@apple.com>
-
- * loop.c (struct movable): Add insert_temp, shrink savemode.
- (scan_loop): Accept invariants that require copying; mark as
- insert_temp.
- (combine_movables): Don't combine insert_temp movables.
- (move_movables): Insert copies for insert_temp movables.
- Don't record the info based on regno for insert_temp's.
-
-2003-02-28 Joel Sherrill <joel@OARcorp.com>
-
- PR 9638/other
- * config/i386/i386.c (DEFAULT_PCC_STRUCT_RETURN): Ensure the
- this constant defaults to 1.
-
-2003-02-28 Bob Wilson <bob.wilson@acm.org>
-
- * config.gcc (xtensa-*-linux*): Add t-slibgcc-elf-ver to tmake_file.
-
-2003-02-28 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (mulhisi3, mulhisi3addsi, mulhidi3adddi): Enable for any
- ARMv5e processor, not just for XScale. Instructions are predicable.
- (mulhisi3tb, mulhisi3bt, mulhisi3tt): New patterns for ARMv5e.
-
-2003-02-28 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.c (note_invalid_constants): Change parameter type
- from bool to int.
-
-2003-02-28 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*tst_extzv_bitqi_1_n): Accept the
- test of bit 7.
- (*tst_extzv_memqi_1_n): Likewise.
- (a peephole2): New.
-
-2003-02-28 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Wrap in
- #ifndef __mips16.
-
-2003-02-28 Jan Hubicka <jh@suse.cz>
-
- * combine.c (gen_lowpart_for_combine): Update handling of
- subregs_of_mode
- * flow.c (life_analysis, mark_used_regs): Likewise.
- * regclass.c (subregs_of_mode): Turn into single bitmap.
- (cannot_change-mode_set_regs, invalid_mode_change_p): Update
- dealing with subregs_of_mode
- * regs.h (subregs_of_mode): Update prototype.
-
-2003-02-28 Josef Zlomek <zlomekj@suse.cz>
-
- * emit-rtl.c (set_reg_attrs_for_parm): New function.
- * rtl.h (set_reg_attrs_for_parm): New exported function.
- * function.c (assign_parms): Use set_reg_attrs_for_parm instead of
- set_reg_attrs_from_mem.
-
-2003-02-27 Roger Sayle <roger@eyesopen.com>
- Zack Weinberg <zack@codesourcery.com>
-
- * gcc.c (do_spec_1): Treat %U like %u for unique associations.
-
-2003-02-27 Kazu Hirata <kazu@cs.umass.edu>
-
- * reload1.c (sext_for_mode): Remove.
- (reload_cse_move2add): Use trunc_int_for_mode instead of
- sext_for_mode.
- (move2add_note_store): Likewise.
- Reset register information if we see a set in non-integer
- mode.
-
-2003-02-27 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/aix43.h (ASM_SPEC): Only emit -mppc64 if no -mcpu
- option.
- (ASM_CPU_SPEC): Use -m620 for Power3, Power4, 620, 630.
- * config/rs6000/aix51.h: Same.
- * config/rs6000/aix52.h: Same.
- * config/rs6000/power4.md: Additional VMX bypasses.
-
-2003-02-27 Geert Bosch <bosch@gnat.com>
-
- * toplev.c (print_version): Add indentation for GGC heuristics and
- output after printing version information.
-
-2003-02-27 James E Wilson <wilson@tuliptree.org>
-
- * combine.c (simplify_comparison): Require integral mode when
- permuting SUBREG with AND.
-
-2003-02-27 Steve Ellcey <sje@cup.hp.com>
-
- * config/ia64/hpux.h (STARTFILE_PREFIX_SPEC): Remove.
-
-2003-02-27 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.md (extendsfdf2): Add pattern accidentally
- deleted when cirrus instructions were added.
-
-2003-02-27 Jason Thorpe <thorpej@wasabisystems.com>
-
- * config.gcc (*-*-netbsd[2-9]*, *-*-netbsdelf[2-9]*): Enable
- POSIX thread support by default.
-
-2003-02-27 Roger Sayle <roger@eyesopen.com>
-
- * config/i386/cygwin.h: Don't include any other files directly.
- * config/i386/mingw32.h: Don't include cygwin.h directly.
- * config.gcc (cygwin, mingw32, uwin): Instead make these files
- explicit in the tm_files variable.
-
-2003-02-27 Alan Modra <amodra@bigpond.net.au>
-
- * config/rs6000/rs6000.md: Add TI constant splitter.
-
-2003-02-26 Alexandre Oliva <aoliva@redhat.com>
-
- * builtins.c (purge_builtin_constant_p): Handle subreg of
- constant_p_rtx too.
-
- * function.c (assign_stack_local_1): Truncate constant added to
- frame_pointer_rtx or virtual_stack_vars_rtx for Pmode.
-
-2003-02-26 David Edelsohn <edelsohn@gnu.org>
-
- * config.gcc: Add power4 to PowerPC with_cpu list.
-
-2003-02-26 Jan Hubicka <jh@suse.cz>
-
- * objc-act.c: (mark_referenced_methods): Fix compilation problem.
-
-2003-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * gcov-dump.c (print_prefix): Fix signedness warning.
- * gcov-io.h (struct counter_section, struct counter_section_data): New.
- (struct function_info): n_arc_counts field removed, n_counter_sections,
- counter_sections fields added.
- (struct gcov_info): arc_counts, n_arc_counts fields removed,
- n_counter_sections, counter_sections fields added.
- * libgcov.c (gcov_exit, __gcov_flush): Add support for multiple
- profile sections.
- * profile.h (MAX_COUNTER_SECTIONS): New.
- (struct section_info): New.
- (struct profile_info): count_instrumented_edges,
- count_edges_instrumented_now fields removed, n_sections, section_info
- fields added.
- (find_counters_section): Declare.
- * profile.c (struct function_list): count_edges field removed,
- n_counter_sections, counter_sections fields added.
- (set_purpose, label_for_tag, build_counter_section_fields,
- build_counter_section_value, build_counter_section_data_fields,
- build_counter_section_data_value, build_function_info_fields,
- build_function_info_value, build_gcov_info_fields,
- build_gcov_info_value): New static functions.
- (find_counters_section): New function.
- (instrument_edges, get_exec_counts, compute_branch_probabilities,
- branch_prob, create_profiler): Modified to support multiple profile
- sections.
-
-2003-02-26 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.c (compute_frame_size): Don't assume PREFERRED_STACK_BOUNDARY
- is 8 * STACK_BOUNDARY.
- * pa.h (PREFERRED_STACK_BOUNDARY): Change to 128 on 64-bit port.
-
-2003-02-26 Michael Matz <matz@suse.de>
-
- * ra-colorize.c (merge_moves): Fix list handling.
-
-2003-02-26 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.c (is_load_address): Rename to...
- (arm_memory_load_p) ... this and make it check for SUBREGs and
- constant loads that will be converted into loads from the
- minipool.
- (is_cirrus_insn): Rename to ...
- (arm_cirrus_insn_p): ... this, for consistency. Replace test
- of CIRRUS_NO with CIRRUS_NOT.
- (cirrus_reorg): Use renamed functions.
- (note_invalid_constants): Change from a void function to bool.
- Add an extra parameter, saying whether the fixups should be
- pushed. Return true if fixups are needed.
- (arm_reorg): Use renamed functions. Use INSN_P. Replace test
- of CIRRUS_NO with CIRRUS_NOT.
- * config/arm/arm.h (FLOAT_WORDS_BIG_ENDIAN): Mention that
- other floating point co-processors can also affect this.
- * config/arm/arm.md ("type" attribute): Add mav_farith and
- mav_dmult. Replace references to "cirrus_type" attribute with
- "type".
- * config/arm/cirrus.md ("cirrus_fpu" attribute): Delete.
- ("cirrus_type" attribute): Delete - use "type" instead.
- ("cirrus" attribute): Replace 'no' with 'not' and 'yes' with
- 'normal'.
-
-2003-02-25 Jan Hubicka <jh@suse.cz>
-
- * objc-act.c: Include cgraph.h
- (mark_referenced_methods): New function.
- (objc_init): Call it.
- * objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set.
-
- * c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time
- mode.
-
- * optabs.c (expand_fix): Do not widen the input operand.
-
- * expr.c (emit_group_store): Fix crash when converting single
- register into complex register.
-
- * Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h
- * alias.c: Include timevar.h
- (init_alias_analysis): Set timevar
- * jump.c: Include timevar.h
- (rebuild_jump_labels): Set timevar
- * regcalss.c: Include timevar.h
- (reg_scan): Set timevar
- * timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New
-
-2003-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cse.c (count_reg_usage): Fix handling of REG_EQUAL notes.
-
- * Makefile.in (loop-unroll.o): New.
- * cfgloop.h (UAP_PEEL, UAP_UNROLL, UAP_UNROLL_ALL): New.
- (unroll_and_peel_loops): Declare.
- * alias.c (init_alias_analysis): Flag_unroll_loops renamed to
- flag_old_unroll_loops.
- * loop.c (loop_invariant_p): Ditto.
- * unroll.c (unroll_loop): Flag_unroll_all_loops renamed to
- flag_old_unroll_all_loops.
- * flags.h (flag_unroll_loops): Renamed to flag_old_unroll_loops.
- (flag_unroll_all_loops): Renamed to flag_old_unroll_all_loops.
- * params.def (PARAM_MAX_UNROLLED_INSNS): Default value changed.
- (PARAM_MAX_AVERAGE_UNROLLED_INSNS, PARAM_MAX_UNROLL_TIMES,
- PARAM_MAX_PEELED_INSNS, PARAM_MAX_PEEL_TIMES,
- PARAM_MAX_COMPLETELY_PEELED_INSNS, PARAM_MAX_COMPLETELY_PEEL_TIMES,
- PARAM_MAX_ONCE_PEELED_INSNS): New.
- * toplev.h (flag_old_unroll_loops, flag_old_unroll_all_loops): New.
- (flag_unroll_loops, flag_unroll_all_loops): Used for new unroller
- instead of old one.
- (flag_peel_loops): New.
- (lang_independent_options): The new flags added.
- (rest_of_compilation): Call new unroller.
- (process_options): Setup flags for coexistence of old and new unroller.
- * doc/invoke.texi: Document new options.
- * doc/passes.texi: Document new unroller pass.
-
-2003-02-26 David Billinghurst <David.Billinghurst@riotinto.com>
-
- * fixinc/fixincl.x: Regenerate
-
-2003-02-26 Josef Zlomek <zlomekj@suse.cz>
-
- * function.c (assign_parms): Set reg_attrs for parameters passed in
- registers.
-
-2003-02-26 Alan Modra <amodra@bigpond.net.au>
-
- PR target/9681
- * tlink.c (scan_linker_output): Drop leading '.' from symbol names.
-
-2003-02-25 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/xcoff.h (ASM_FILE_START): Do not emit machine
- pseudo-op.
-
-2003-02-25 Roger Sayle <roger@eyesopen.com>
-
- * combine.c (combine_simplify_rtx, simplfy_comparison): Use CC0_P.
- * cse.c (invalidate_skipped_set): Likewise.
- * integrate.c (subst_constants): Likewise.
- * jump.c (reversed_comparison_code_parts): Likewise.
- * loop.c (canonicalize_condition): Likewise.
- * simplify-rtx.c (simplify_relational_operation): Likewise.
-
-2003-02-25 Roger Sayle <roger@eyesopen.com>
-
- * builtins.def (DEF_LIB_ALWAYS_BUILTIN, DEF_UNUSED_BUILTIN): Delete.
- (abs, labs, fabs, fabsf, fabsl, abort, exit, _exit, _Exit): Use
- the appropriate macro to define built-in function.
- (fmod,fmodf,fmodl): New built-in functions.
-
- * doc/extend.texi (fmod,fmodf,fmodl): Document new built-ins.
-
-2003-02-25 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.c (function_arg): Pass variable sized
- structures correctly on the stack.
-
-2003-02-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * reload1.c (reload_cse_move2add): Use STRICT_LOW_PART if PLUS
- does not reduce the cost of SET.
-
-2003-02-25 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- PR target/9732
- * config/rs6000/rs6000.c (first_reg_to_save): Handle
- PIC_OFFSET_TABLE_REGNUM for -fPIC too.
- (rs6000_emit_prologue): Likewise.
- (rs6000_emit_epilogue): Likewise.
- * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Make
- PIC_OFFSET_TABLE_REGNUM a fixed register for -fPIC.
-
-2003-02-25 Richard Henderson <rth@redhat.com>
-
- * real.c (real_to_integer2): Force overflow result only for
- unsigned overflow.
-
-2003-02-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * gcse.c (cprop_jump): Revert the 2003-02-23 change.
-
-2003-02-25 Vladimir Makarov <vmakarov@toke.toronto.redhat.com>
- Richard Henderson <rth@redhat.com>
-
- * sched-ebb.c (add_deps_for_risky_insns): Add the dependence when
- there is no similar load.
-
-2003-02-25 Vladimir Makarov <vmakarov@redhat.com>
- Richard Henderson <rth@redhat.com>
-
- * sched-int.h (INSN_TRAP_CLASS, WORST_CLASS): Move them from
- sched-rgn.c.
- (add_forward_dependence): New function prototype.
-
- * sched-rgn.c (INSN_TRAP_CLASS, WORST_CLASS): Move them to
- sched-init.h.
- (CONST_BASED_ADDRESS_P, may_trap_exp, haifa_classify_insn): Move
- them to haifa-sched.c.
-
- * haifa-sched.c (CONST_BASED_ADDRESS_P, may_trap_exp,
- haifa_classify_insn): Move them from sched-rgn.c.
-
- * sched-deps.c (add_dependence): Return flag of creating a new
- entry.
- (add_forward_dependence): New function.
- (compute_forward_dependences): Use the function.
-
- * sched-ebb.c (earliest_block_with_similiar_load): New function.
- (add_deps_for_risky_insns): New function.
- (schedule_ebb): Call the function.
-
-2003-02-20 Aldy Hernandez <aldyh@redhat.com>
-
- * doc/tm.texi: Document Rename TARGET_VECTOR_TYPES_COMPATIBLE to
- TARGET_VECTOR_OPAQUE_P. Document accordingly.
-
- * testsuite/gcc.dg/20030218-1.c: Check that initialization of
- opaque types fail.
-
- * c-typeck.c (comptypes): Change call to vector_types_compatible
- to vector_opaque_p.
- (convert_for_assignment): Call vector_opaque_p instead of
- vector_types_compatible.
- (really_start_incremental_init): Disallow initialization of opaque
- types.
-
- * target-def.h: Remove TARGET_VECTOR_TYPES_COMPATIBLE.
- Define TARGET_VECTOR_OPAQUE_P.
- (TARGET_INITIALIZER): Same.
-
- * target.h (struct gcc_target): Remove vector_types_compatible.
- Add vector_opaque_p.
-
- * config/rs6000/rs6000.c (rs6000_spe_vector_types_compatible):
- Remove.
- (is_ev64_opaque_type): Check for TARGET_SPE and make sure type is
- a vector type. Change return type to bool.
- (TARGET_VECTOR_TYPES_COMPATIBLE): Remove.
- (TARGET_VECTOR_OPAQUE_P): Define.
-
- * cp/parser.c (cp_parser_init_declarator): Call vector_opaque_p
- target hook.
- Include target.h.
- (cp_parser_init_declarator): Fix typo in function comments.
-
-2003-02-25 Jan Hubicka <jh@suse.cz>
-
- * Makefile.in (lcm.o): Add dependency on function.h
- * lcm.c (function.h): Include.
- * i386.c (machine_function, ix86_stack_locals,
- * ix86_save_varrargs_registers) : Move to
- ...
- * i386.h (machine_function, ix86_stack_locals,
- ix86_save_varrargs_registers): ... here; add optimize_mode_switching
- (ix86_optimize_mode_switching): New.
- * i386.md (fix patterns): Set ix86_optimize_mode_switching
-
-2003-02-25 Nick Clifton <nickc@redhat.com>
-
- * config/d30v/d30v.c (d30v_init_cumulative_args): Fix typo. Name
- of fourth arg is 'fndecl' not 'indirect'. Update comment
- describing the function's parameters.
-
-2003-02-24 Jan Hubicka <jh@suse.cz>
-
- * combine.c (simplify_shift_const): Fix previous patch.
-
-2003-02-24 Jeff Law <law@redhat.com>
-
- * i386.md (testdi_1_rex64): Discourage reload from using the %eax
- alternative.
- (testsi_1, testhi_1, testqi_1): Likewise.
-
-2003-02-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Rename
- __EXTERN_PREFIX to __PRAGMA_EXTERN_PREFIX.
- * doc/extend.texi (Tru64 Pragmas): Reflect this.
-
- * fixinc/inclhack.def (alpha___extern_prefix): Indicate #pragma
- extern_prefix support for Tru64 UNIX V5 <sys/stat.h>.
- * fixinc/fixincl.x: Regenerate.
- * fixinc/tests/base/sys/stat.h [ALPHA___EXTERN_PREFIX_CHECK]: New
- testcase.
- Fixes PR c/5059, c/6126, other/9671.
-
-2003-02-24 Roger Sayle <roger@eyesopen.com>
-
- * gcc.c (do_spec_1) ['{']: Handle pending argument upon return
- from handle_braces in "%{...}".
-
-2003-02-24 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * config/sh/sh.c (TARGET_HAVE_TLS): Conditionally define.
- (prepare_move_operands): Handle TLS operands.
- (tls_symbolic_operand): New.
- (nonpic_symbol_mentioned_p): Handle TLS UNSPECs.
- (legitimize_pic_address): Do nothing for the TLS symbol.
- (sh_encode_section_info): Handle TLS case.
- (sh_strip_name_encoding): Drop TLS encoding.
- * config/sh/sh-protos.h (tls_symbolic_operand): Add prototype.
- * config/sh/sh.h (SH_TLS_ENCODING): Define.
- (TLS_SYMNAME_P, STRIP_TLS_ENCODING): Likewise.
- (ASM_OUTPUT_LABELREF): Drop TLS encoding.
- (OUTPUT_ADDR_CONST_EXTRA): Handle TLS UNSPECs.
- * config/sh/sh.md: Define TLS UNSPEC constants.
- (type): Add tls_load.
- ("tls_global_dynamic", "tls_local_dynamic"): New insns.
- ("sym2DTPOFF", "symDTPOFF2reg", "sym2GOTTPOFF"): New expanders.
- ("tls_initial_exec"): New insn.
- ("sym2TPOFF", "symTPOFF2reg"): New expanders.
- ("load_gbr"): New insn.
-
- * configure.in (HAVE_AS_TLS): Add sh-*-* and sh[34]*-*-* cases.
- * configure: Regenerate.
-
-2003-02-24 Alan Modra <amodra@bigpond.net.au>
-
- PR 9297, PR 9722
- * calls.c (store_one_arg): Revert 1999-02-16 change. Revert
- 2000-12-17 change. Pass EXPAND_STACK_PARM to expand_expr.
- * expr.h (enum expand_modifier): Define EXPAND_STACK_PARM.
- (enum block_op_methods): Reorder for better store_expr optimization.
- * expr.c (store_expr): Test bit 1 of "want_value" for call param
- stores, test bit 0 for original want_value meaning. Pass
- BLOCK_OP_CALL_PARM to emit_block_move when bit 1 set. Adjust
- recursive calls, and calls to expand_param.
- (expand_expr): Handle EXPAND_STACK_PARM modifier. When cse
- expected, set target to 0 rather than to subtarget. Formatting.
-
-2003-02-23 Kazu Hirata <kazu@cs.umass.edu>
-
- * gcse.c (cprop_jump): Use the REG_EQUAL note if available.
-
-2003-02-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * doc/invoke.texi (ggc-min-expand, ggc-min-heapsize): Document
- new default behavior.
- * ggc-common.c: Include sys/resource.h.
- (ggc_rlimit_bound): New function.
- (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic): Update
- defaults to account for rlimits.
-
-2003-02-22 Richard Henderson <rth@redhat.com>
-
- * i386.c, i386.h (TUNEMASK): Rename from CPUMASK.
-
-2003-02-22 Kelley Cook <kelley@dwhoops.info>
-
- * i386.h, i386.c, i386.md (ix86_tune): Rename from ix86_cpu.
- (ix86_tune_string): Rename from ix86_cpu_string.
-
-2003-02-22 Kelley Cook <kelleycook@comcast.net>
-
- * config/i386/i386.c: Replace "mcpu" with "mtune".
- * config/i386/i386.h (TARGET_OPTIONS): Likewise.
- (CC1_CPU_SPEC): Likewise. New warning for "-mcpu".
- * doc/invoke.texi (i386 and x86-64 Options): Replace "mcpu"
- with "mtune". Note that "mcpu" is a deprecated synonym for "mtune".
-
-2003-02-23 Andreas Schwab <schwab@suse.de>
-
- * config.gcc: Delete references to m68k/t-linux and
- m68k/t-linux-aout.
- * config/m68k/t-linux, config/m68k/t-linux-aout: Removed.
-
-2003-02-22 Jan Hubicka <jh@suse.cz>
-
- * toplev.c (rest_of_compilation): Apply fotgotten hunk
- of track scheduling patch.
-
-2003-02-22 Jan Hubicka <jh@suse.cz>
-
- * config/linux.h (TARGET_HAS_F_SETLKW): Define.
- * config/alpha/linux.h (TARGET_HAS_F_SETLKW): Likewise
-
-2003-02-22 Jan Hubicka <jh@suse.cz>
-
- * c-decl.c (c_expand_body_1): Fix.
-
-2003-02-22 Jan Hubicka <jh@suse.cz>
-
- * expmed.c (expand_divmod): Undo sign extensions for unsigned operands
-
- * cfgcleanup.c (try_forward_edges): Don't check loop structures
- when not optimizing.
- (cleanup_cfg): Do not iterate trought delete_trivially_dead_insns
- when not expensive.
- * toplev.c (rest_of_compilation): Duplicate loop headers only when
- optimizing; Delete trivially dead insns early; fix optimize check.
-
- * Makefile.in (c-decl.o, c-objc-common.o, cgraph.o, tree-inline.o): Add
- dependency on cgraph.h
- * c-decl.c: Include cgraph.h
- (finish_function): Update call of tree_inlinable_function_p.
- * c-objc-common.c: Include cgraph.h
- * cgraph.h: New file.
- * cgraphunit.c: New file.
- * cgraph.c (cgraph_node, cgraph_edge): Move into cgraph.h
- (cgraph_nodes, cgraph_n_nodes): Globalize.
- (cgraph_finalize_function, cgraph_finalize_compilation_unit
- cgraph_create_edges, cgraph_optimize, cgraph_mark_needed_node):
- Move into cgraphunit.c
- * tree-inline.c: Include cgraph.h
- * tree-inline.c: Include cgraph.h
-
-2003-02-22 Josef Zlomek <zlomekj@suse.cz>
-
- * config/i386/i386.md: Use gen_lowpart instead of gen_rtx_REG
- for copying a register.
-
-2003-02-22 Steven Bosscher <s.bosscher@student.tudelft.nl>
-
- PR other/3782
- * toplev.c (process_options): If flag_detailed_statistics is set,
- then set time_report as well.
-
- PR c/8828
- * jump.c (never_reached_warning): Don't fall through BARRRIER
- insns. Update comments to reflect what the function really does.
-
-2003-02-21 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (omit_one_operand): No longer static.
- * tree.h (omit_one_operand): Prototype here.
- (div_and_round_double): Keep fold-const.c prototypes together.
- * builtins.c (builtin_mathfn_code): Handle binary built-in
- funtions, such as "pow" and "atan2".
- (fold_builtin): Optimize both pow(x,0.0) and pow(1.0,y) to 1.0.
- Simplify optimizations using "type" the builtin's return type.
-
-2003-02-22 Hans-Peter Nilsson <hp@axis.com>
-
- * config/cris/cris.c (cris_rtx_costs): Blockify dangling else.
- Fix functionalization typo.
-
- * regmove.c (optimize_reg_copy_1): Do not replace a hard register
- in an asm.
-
-2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (ggc-common.o): Depend on $(PARAMS_H)
- * doc/invoke.texi (ggc-min-expand, ggc-min-heapsize): Update
- documentation.
- * ggc-common.c: Include params.h
- (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic,
- init_ggc_heuristics): New functions.
- * ggc.h (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic,
- init_ggc_heuristics): Prototype.
- * toplev.c (print_version): Output GGC heuristics.
- (parse_options_and_default_flags): Call init_ggc_heuristics.
-
-2003-02-22 Jan Hubicka <jh@suse.cz>
-
- * i386.c (def_builtin): Special case 64bit builtins.
- (MASK_SSE164, MASK_SSE264): New constants.
- (builtin_description): Add 64bit builtins.
- (ix86_init_mmx_sse_builtins): Likewise.
- * i386.h (enum ix86_builtins): Likewise.
- * i386.md (cvtss2siq, cvttss2siq, cvtsd2siq, cvttsd2siq, cvtsi2sdq,
- sse2_movq2dq_rex64, sse2_movsq2q_rex64): New.
- (sse2_movq2dq, sse2_movsq2q): Disable for 64bit.
- * mmintrin.h (_mm_cvtsi64x_si64, _mm_set_pi64x, _mm_cvtsi64_si64x): New.
- * xmmintrin.h (_mm_cvtss_si64x, _mm_cvttss_si64x, _mm_cvtsi64x_ss,
- _mm_set_epi64x, _mm_set1_epi64x, _mm_cvtsd_si64x, _mm_cvttsd_si64x,
- _mm_cvtsi64x_sd, _mm_cvtsi64x_si128, _mm_cvtsi128_si64x): New.
-
-2003-02-22 Jan Hubicka <jh@suse.cz>
-
- * i386.c (builtin_description): Add __builtin_ia32_paddq and
- __builtin_ia32_psubq. Fix __builtin_ia32_paddq128
- and __builtin_ia32_psubq128.
- * i386.h (IX86_BUILTIN_PADDQ, IX86_BUILTIN_PSUBQ): New.
- * i386.md (addv*, mmx_ior*, mmx_xoe*, mmx_and*): Add missing '%'.
- (mmx_adddi3, mmx_subdi3): New.
- * mmintrin.h (_mm_add_si64, _mm_sub_si64): New.
- * xmmintrin.h (_mm_movepi64_pi64): New.
- (_mm_add_epi64, _mm_sub_epi64): fix.
- (_mm_mul_pu16): Rename to...
- (_mm_mul_su32): ... this one.
-
- * builtins.c (expand_builtin_expect): Do not predict
- flag_guess_branch_prob is not set.
- * c-semantics.c (expand_stmt): Likewise.
- * predict.c (predict_insn): Likewise.
- * stmt.c (expand_continue_loop): Likewise.
- * toplev.c (rest_of_compilation): Do not call
- note_prediction_to_br_prob and note_prediction_to_br_prob
- when not optimizing.
-
-2003-02-21 Jan Hubicka <jh@suse.cz>
-
- * cfgrtl.c (commit_edge_insertions): Call
- find_many_sub_basic_block only when some code has been emitted.
- (commit_edge_insertions_watch_calls): Bring into sync with
- commit_edge_insertions
-
-2003-02-21 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.h (OVERRIDE_OPTIONS): Fix code that clears 'e' register class.
-
- * sh.md (binary_sf_op): Use extra constant operand instead of
- negating constant operand 4.
- * sh.c (sh_expand_binop_v2sf): Supply it.
-
-2003-02-21 Zack Weinberg <zack@codesourcery.com>
-
- * cpphash.h (struct lexer_state): Add directive_wants_padding.
- * cpplib.c (_cpp_handle_directive): Set directive_wants_padding
- for directives of type INCL.
- (glue_header_name, parse_include): Use get_token_no_padding.
- * cppmacro.c (replace_args): If directive_wants_padding,
- provide padding tokens.
-
-2003-02-21 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-02-21 Jan Hubicka <jh@suse.cz>
-
- * cfgrtl.c (commit_one_edge_insertion): Only mark BB for splitting.
- (commit_edge_insertions): Call find_many_sub_basic_blocks
-
- * reg-stack.c (convert_regs): Cleax aux for blocks.
-
-2003-02-21 Jan Hubicka <jh@suse.cz>
-
- * toplev.c (parse_options_and_default_flags): Undo accidental commit.
-
-2003-02-21 Glen Nakamura <glen@imodulo.com>
-
- PR optimization/8613
- * builtins.c (expand_builtin): Emit postincrements before expanding
- builtin functions.
-
-2003-02-21 Ben Elliston <bje@redhat.com>
-
- PR other/5634
- * doc/install.texi (Configuration): Explain using $HOME instead of
- the ~ metacharacter when referring to home directories.
-
-2003-02-20 Alexandre Oliva <aoliva@redhat.com>
-
- * configure.in (TARGET_SYSTEM_ROOT): Set default to
- ${exec_prefix}/${target_alias}/sys-root. Match explicit
- '${exec_prefix}' (in addition to the expansion thereof) as
- relocatable.
- * configure: Rebuilt.
-
-2003-02-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (addhi3_incdec): Change the name to
- *addhi3_incdec.
- (addsi3_incdec): Change the name to *addsi3_incdec.
-
-2003-02-20 Roger Sayle <roger@eyesopen.com>
-
- * explow.c (force_reg): Avoid useless REG_EQUAL notes.
-
-2003-02-20 Toon Moene <toon@moene.indiv.nluug.nl>
-
- PR fortran/9038
- * c-opts.c (sanitize_cpp_opts): Add Fortran front end
- options to be ignored.
- (c_common_decode_option): Ignore them when preprocessing.
-
-2003-02-20 Jan Hubicka <jh@suse.cz>
-
- * toplev.c (flag_sched2_use_superblocks, flag_sched2_use_traces): New
- global variables.
- (lang_independent_options): Add -fsched2-use-superblocks
- -fsced2-use-traces.
- (rest_of_compilation): Deal with it.
- * invoke.texi (-fsched2-use-traces, fsched2-use-superblocks): Declare.
- * flags.h (flag_sched2_use_superblocks, flag_sched2_use_traces):
- Declare.
- * rtl.h (reg_to_stack): Update prototype.
- * reg-stack.c (reg_to_stack): Return when something has changed;
- update liveness when executing after superblock scheduling.
-
- * combine.c (simplify_shift_const): Simplify few special cases
- into constants.
-
-2003-02-20 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.md: (attr "type"): Add fast_compare.
- (add.,subf.,neg.): Change attribute to fast_compare.
- All DFA descriptions updated.
-
-2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
-
- Change base class access representation.
- * tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED,
- TREE_VIA_PRIVATE): Remove.
- (BINFO_BASEACCESSES): New binfo elt.
- (BINFO_BASEACCESS): New accessor.
- (BINFO_ELTS): Increase.
- (TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New.
- (access_public_node, access_protected_node,
- access_private_node): New global nodes.
- * tree.c (build_common_tree_nodes_2): Initialize access nodes.
- * dbxout.c (dbxout_type): Adjust.
- * dwarf2out.c (gen_inheritance_die): Add access parameter.
- (gen_member_die): Adjust.
- * dwarfout.c (output_inheritance_die): ARG is array of two trees.
- (output_type): Adjust.
- * tree-dump.c (dequeue_and_dump): Adjust binfo dumping.
-
- Change base class access representation. Share virtual base
- binfos.
- * cp/call.c (build_special_member_call): Remove binfo_for_vbase
- call.
- * cp/class.c (build_base_path): Likewise.
- (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
- (build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
- (make_new_vtable): Adjust.
- (force_canonical_binfo_r): Delete.
- (force_canonical_binfo): Delete.
- (mark_primary_virtual_base): Delete.
- (dfs_unshared_virtual_bases): Delete.
- (mark_primary_bases): Adjust.
- (maybe_warn_about_overly_private_class): Adjust.
- (dfs_base_derived_from): Delete.
- (base_derived_from): Follow the inheritance chain.
- (struct find_final_overrider_data): Add vpath member.
- (dfs_find_final_overrider): Adjust.
- (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
- (find_final_overrider): Adjust.
- (update_vtable_entry_for_fn): Adjust.
- (modify_all_vtables): Adjust.
- (walk_subobject_offsets): Adjust.
- (layout_nonempty_base_or_field): Adjust.
- (layout_empty_base): Remove last parameter. Adjust.
- (build_base_field): Adjust.
- (build_base_fields): Adjust.
- (propagate_binfo_offsets): Remove last parameter. Adjust.
- (dfs_set_offset_for_unshared_vbases): Delete.
- (layout_virtual_bases): Adjust.
- (finish_struct_1): Adjust.
- (init_class_processing): Don't init access nodes.
- (dfs_get_primary_binfo): Delete.
- (get_primary_binfo): Adjust.
- (dump_class_hierarchy_r): Remove most derived arg, add IGO
- parameter. Adjust.
- (dump_class_hierarchy): Adjust.
- (finish_vtbls): Adjust.
- (get_original_base): Delete.
- (build_vtt_inits): Adjust.
- (dfs_build_secondary_vptr_vtt_inits): Adjust.
- (dfs_ctor_vtable_bases_queue_p): Adjust.
- (build_ctor_vtbl_group): Adjust.
- (dfs_accumulate_vtbl_inits): Adjust.
- (build_vtbl_initializer): Adjust.
- (build_vbase_offset_vtbl_entries): Adjust.
- (add_vcall_offset_vtbl_entries_1): Adjust.
- * cp/cp-tree.h (CPTI_ACCESS_*): Remove.
- (access_*_node): Remove.
- (CANONICAL_BINFO): Delete.
- (BINFO_UNSHARED_MARKED): Remove.
- (BINFO_MARKED): Set LANG_FLAG_0 directly.
- (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
- (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
- (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
- Delete.
- (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
- (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
- (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
- Delete.
- (BINFO_DEPENDENT_BASE_P): New.
- (dfs_walk, dfs_walk_real): Queue function takes derived binfo and
- index.
- (markedp, unmarkedp): Adjust.
- (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
- dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
- find_vbase_instance, binfo_for_vbase): Delete.
- (copied_binfo, original_binfo): Declare.
- (finish_base_specifier): Add virtual_p arg.
- (unshare_base_binfos): Delete.
- (copy_base_binfos): Declare.
- (reverse_path): Delete.
- * cp/decl.c (xref_basetypes): Access and virtuality passed
- differently. Don't copy direct base binfos here. Call
- copy_base_binfos.
- * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
- (initialize_vtbl_ptrs): Adjust.
- (expand_member_init): Adjust.
- * cp/parser.c (cp_parser_base_specifier): Adjust.
- * cp/pt.c (instantiate_class_template): Adjust.
- (get_template_base_recursive): Adjust.
- * cp/rtti.c (get_pseudo_ti_init): Adjust.
- (get_pseudo_ti_desc): Adjust.
- * cp/tree.c (unshare_base_binfos): Rename to ...
- (copy_base_binfos): ... here, reimplement.
- (make_binfo): Set BINFO_DEPENDENT_BASE_P.
- (reverse_path): Remove.
- * cp/typeck.c (get_delta_difference): Adjust error messages.
- * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
- * cp/search.c (lookup_base_r): Adjust.
- (dynamic_cast_base_recurse): Adjust.
- (canonical_binfo): Remove.
- (dfs_canonical_queue): Remove.
- (dfs_assert_unmarked_p): Remove.
- (assert_canonical_unmarked): Remove.
- (shared_marked_p, shared_unmarked_p): Remove.
- (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
- (dfs_access_in_type): Adjust.
- (access_in_type): Adjust.
- (dfs_accessible_queue_p): Adjust.
- (dfs_accessible_p): Adjust.
- (is_subobject_of_p_1, is_subobject_of_p): Remove.
- (struct lookup_field_info): Remove from_dep_base_p field.
- (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
- (lookup_field_r): Remove dependent base code.
- (lookup_member): Likewise.
- (dfs_walk, dfs_walk_real): Add access arg to queue fn.
- (dfs_unmarked_real_bases_queue_p): Remove.
- (dfs_marked_real_bases_queue_p): Remove.
- (dfs_skip_vbases): Remove.
- (dfs_get_pure_virtuals): Adjust.
- (markedp, unmarkedp): Adjust.
- (marked_vtable_pathp, unmarked_vtable_pathp): Remove.
- (marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
- (dfs_unmark): Adjust.
- (dfs_get_vbase_types):Remove.
- (dfs_build_inheritance_graph_order): Remove.
- (get_vbase_types): Remove
- (dfs_find_vbase_instance): Remove.
- (find_vbase_instance): Remove.
- (dfs_debug_unmarkedp): Adjust.
- (dependent_base_p): Remove.
- (dfs_push_type_decls): Adjust.
- (dfs_push_decls): Adjust.
- (dfs_no_overlap_yet): Adjust.
- (copied_binfo): New function.
- (original_binfo): New function.
- (binfo_for_vbase): Remove.
-
- Change base class access representation.
- * java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
- (add_interface_do): Likewise.
-
-2003-02-20 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/sysv4.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define.
- * config/rs6000/power4.md (power4-store,power4-vecstore): New
- insn reservations.
- (power4-fpstore): Compact.
-
-2003-02-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*iorsi3_w): New.
-
-2003-02-20 Josef Zlomek <zlomekj@suse.cz>
-
- * combine.c (distribute_notes): Kill REG_EXEC_COUNT.
- * rtl.c (reg_note_name): Likewise.
- * rtl.h (enum reg_note): Likewise.
- * doc/invoke.texi: Likewise.
- * doc/rtl.texi: Likewise.
-
-2003-02-20 Josef Zlomek <zlomekj@suse.cz>
-
- * bb-reorder.c (find_traces_1_round): Fix comment typo.
-
-2003-02-19 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (fold_real_zero_addition_p): Don't fold a zero
- addition in the presence of signaling NaNs.
-
-2003-02-19 Krister Walfridsson <cato@df.lth.se>
-
- * tm.texi (INIT_CUMULATIVE_ARGS): Fix typo.
-
-2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_logical_op): Optimize or.l when
- ORing with 0xffff??00 with the highest bit of the ?? part set.
- (compute_logical_op_length): Update.
- (compute_logical_op_cc): Likewise.
-
-2003-02-19 Josef Zlomek <zlomekj@suse.cz>
-
- * bb-reorder.c (find_traces_1_round): Fixed condition for small
- destination block with multiple predecessors.
- (connect_traces): Check whether the block is a start of trace.
-
-2003-02-19 Jan Hubicka <jh@suse.cz>
-
- * calls.c (expand_call): Update call of INIT_CUMULATIVE_ARGS
- * function.c (assign_params): Likewise.
- * arm-protos.h (arm_init_cumulative_args): Update prototype.
- * arm.c (arm_init_cumulative_args): Update function.
- * arm.h (INIT_CUMULATIVE_ARGS): Update.
- * avr-protos.h (init_cumulative_args): Update prototype.
- * avr.c (init_cumulative_args): Update function.
- * avr.h (INIT_CUMULATIVE_ARGS): Update.
- * d30v-protos.h (d30v_init_cumulative_args): Update prototype.
- * d30v.c (d30v_init_cumulative_args): Update function.
- * d30v.h (INIT_CUMULATIVE_ARGS): Update.
- * frv-protos.h (frv_init_cumulative_args): Update prototype.
- * frv.c (frv_init_cumulative_args): Update function.
- * frv.h (INIT_CUMULATIVE_ARGS): Update.
- * mips.c (mips_expand_prolgue): Update call of INIT_CUMULATIVE_ARGS.
- * pa.h (INIT_CUMULATIVE_ARGS): Update.
- * sparc-protos.h (init_cumulative_args): Update prototype.
- * sparc.c (init_cumulative_args): Update function.
- * sparc.h (INIT_CUMULATIVE_ARGS): Update.
- * tm.texi (INIT_CUMULATIVE_ARGS): Update documentation.
-
-2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*iorsi3_two_qi_sext): New.
- (*ashiftsi_sextqi_7): Likewise.
-
-2003-02-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * config/mips/iris6.h (TARGET_OS_CPP_BUILTINS): Define __c99 for
- ISO C99 and C++.
-
- * fixinc/inclhack.def (irix___restrict): Don't change __restrict
- for C++ on IRIX 6.5.1[89].
- * fixinc/tests/base/internal/sgimacros.h: New file.
-
- * fixinc/inclhack.def (irix_wcsftime): Use XPG5 variant for C99.
- * fixinc/tests/base/internal/wchar_core.h: New file.
-
- * fixinc/inclhack.def (irix_socklen_t): Fix broken IRIX 6.5.1[78]
- socklen_t definition.
- * fixinc/fixincl.x: Regenerate.
- * fixinc/tests/base/sys/socket.h: New file.
- Fixes PR libgcj/9652.
-
-2003-02-19 Jan Hubicka <jh@suse.cz>
-
- * i386.md (movsfcc_1, movdfcc_1): Fix constrains.
-
-2003-02-19 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (rs6000_override_options): Initialize
- align_jumps_max_skip and align_loops_max_skip.
-
-2003-02-19 Thierry Moreau <thierry.moreau@connotech.com>
-
- * config/rs6000/rs6000.c (rs6000_encode_section_info): Do not
- test size if named section.
-
-2003-02-19 Daniel Jacobowitz <drow@mvista.com>
-
- * expr.c (expand_expr): Use gen_int_mode for the argument
- to gen_rtx_MULT.
-
-2003-02-19 Jan Hubicka <jh@suse.cz>
-
- * i386.md (cosxf2): Fix conditional.
-
-2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (extendqisi2): Change to an expander.
- (*extendqisi2_h8300): New.
- (*extendqisi2_h8300hs): Likewise.
-
-2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Update the prototype for
- split_adds_subs. Remove the prototypes for
- const_int_le_2_operand and const_int_le_6_operand.
- * config/h8300/h8300.c (split_adds_sub): Don't output inc/dec.
- (const_int_le_2_operand): Remove.
- (const_int_le_6_operand): Likewise.
- * config/h8300/h8300.h (PREDICATE_CODES): Remove the entries
- for const_int_le_2_operand and const_int_le_6_operand.
- * config/h8300/h8300.md: Update all uses of split_adds_subs.
- (a peephole2): New.
-
-2003-02-18 Jan Hubicka <jh@suse.cz>
-
- * cgraph.c (NPREDECESORC, SET_NPREDECESORS): Kill.
- (cgraph_expand_function): Rewrite.
-
-2003-02-18 Matt Austern <austern@apple.com>
-
- * toplev.c, langhooks.c, langhooks-def.h: Move
- write_global_declarations from toplev.c to langhooks.c.
-
-2003-02-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (general_operand_src): Always check
- MODE.
- (general_operand_dst): Likewise.
-
-2003-02-18 Roger Sayle <roger@eyesopen.com>
-
- * convert.c (convert_to_real): Also optimize (float)log(x) into
- logf(x) where x is a float, i.e. also handle BUILT_IN_LOG{,L}.
-
-2003-02-18 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * config/sh/sh.c (unspec_caller_rtx_p): New.
- (sh_cannot_copy_insn_p): New.
- (TARGET_CANNOT_COPY_INSN_P): New.
-
-2003-02-18 Richard Henderson <rth@redhat.com>
-
- * c-common.c (handle_used_attribute): Accept static data too.
-
-2003-02-18 Nick Clifton <nickc@redhat.com>
- Aldy Hernandez <aldyh@redhat.com>
-
- * testsuite/gcc.dg/20030218-1.c: New.
-
- * doc/tm.texi: Document TARGET_VECTOR_TYPES_COMPATIBLE.
-
- * target-def.h (TARGET_INITIALIZER): Add
- TARGET_VECTOR_TYPES_COMPATIBLE.
- (TARGET_VECTOR_TYPES_COMPATIBLE): New macro.
-
- * target.h (struct gcc_target): Add field vector_types_compatible.
-
- * c-typeck.c (comptypes): Take into account
- TARGET_VECTOR_TYPES_COMPATIBLE.
- (convert_for_assignment): Same.
-
- * config/rs6000/rs6000.c (is_ev64_opaque_type): New.
- (rs6000_spe_vector_types_compatible): New.
- (TARGET_VECTOR_TYPES_COMPATIBLE): Define.
-
-2003-02-19 Andreas Schwab <schwab@suse.de>
-
- * Makefile.in (toplev.o): Depend on $(LANGHOOKS_DEF_H).
- * toplev.c: Include langhooks-def.h.
-
-2003-02-18 Chris Demetriou <cgd@broadcom.com>
-
- * config/mips/mips.h (enum processor_type): Sort entries
- alphabetically.
- * config/mips/mips.md (define_attr cpu): Sync with processor_type
- enum values, including adding entries that were missing.
-
-2003-02-18 J"orn Rennecke <joern.rennecke@superh.com>
-
- * sh.c (calc_live_regs): Also check GET_CODE when checking if
- initial value for PR_REG is still the PR_REG register.
-
-2003-02-18 Jim Wilson <wilson@redhat.com>
-
- * config/ia64/ia64.md (floatdidf2, floatdisf2): Add %, before second
- instruction in output template.
- (bsp_value): Change output template from string to C code, add %,
- before actual instruction.
- (flushrs): Mark as not predicable.
-
-2003-02-18 Krister Walfridsson <cato@df.lth.se>
-
- * inclhack.def (netbsd_bogus_semicolon): New fix.
- * fixincl.x: Rebuilt.
- * tests/base/ctype.h: Update.
-
-2003-02-18 Roger Sayle <roger@eyesopen.com>
-
- * fold-const.c (negate_expr_p): New function to determine whether
- an expression can be negated cheaply.
- (fold) [MINUS_EXPR]: Use it to determine whether to transform
- -A - B into -B - A for floating point types.
-
-2003-02-18 Roger Sayle <roger@eyesopen.com>
-
- * sbitmap.c (sbitmap_resize): New function.
- * sbitmap.h (sbitmap_resize): Prototype here.
- * recog.c (split_all_insns): Use sbitmap_resize.
-
-2003-02-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*zero_extendhisi2_h8300): Fix the
- insn length.
- (extendqisi2): Likewise.
- (*extendhisi2_h8300): Likewise.
-
-2003-02-18 Matt Austern <austern@apple.com>
-
- * langhooks.h, langhooks-def.h: introduce new langhook,
- final_write_globals, with write_global_declarations as default.
- * toplev.c: Move invocation of wrapup_global_declarations from
- compile_file to new function, write_global_declarations. Change
- compile_file to use final_write_globals hook. Change
- wrapup_global_declarations so writing to DECL_DEFER_OUTPUT is
- conditional.
-
-2003-02-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.md: Correct and enhance comment.
-
-2003-02-18 Geoffrey Keating <geoffk@apple.com>
-
- * gcc.c (validate_switches): Don't scan past closing '}'.
-
-2003-02-18 Ben Elliston <bje@redhat.com>
-
- PR c++/1607
- * doc/extend.texi (Function Attributes): Document the effect of
- the C++ "this" parameter on the counting of arguments for the
- "format" and "format_arg" attributes.
-
-2003-02-17 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.h (__ev_stdd): Cast 2nd arg.
- (__ev_stdw): Same.
- (__ev_stdh): Same.
-
-2003-02-17 Jan Hubicka <jh@suse.cz>
-
- * recog.c (split_all_insns): Fix memory overflow.
-
-2003-02-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (cmpqi): Remove mode from compare.
- (cmphi): Likewise.
- (*cmphi_h8300): Likewise.
- (*cmphi_h8300hs): Likewise.
- (cmpsi): Likewise.
- (7 peephole2): Likewise.
-
-2003-02-16 Jan Hubicka <jh@suse.cz>
-
- * c-typeck.c (build_c_cast): Fold constant variables into
- initial values.
-
-2003-02-16 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Specific): Fix link for m68k-att-sysv.
- (Binaries): Ditto for Sinix/Reliant Unix.
-
-2003-02-16 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (arm_reload_in_hi): Ensure that the scratch register does
- not overlap the final result register.
-
-2003-02-16 Arend Bayer <arend.bayer@web.de>
- Richard Henderson <rth@redhat.com>
-
- PR c/8068
- * fold-const.c (extract_muldiv_1): Rename from extract_muldiv;
- rearrange mult arguments for less recursion.
- (extract_muldiv): New. Prevent runaway recursion.
-
-2003-02-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * config/i386/cygwin.h (TARGET_SUBTARGET_DEFAULT): Set
- MASK_ALIGN_DOUBLE.
-
-2003-02-15 Roger Sayle <roger@eyesopen.com>
-
- * config/i386/i386.c (x86_ext_80387_constants): Use 80387 insns
- to load mathematical constants on K6, Athlon, Pentium 4 and PPro.
- (ext_80387_constants_table): Global table of 80387 special constants
- guarded by ext_80387_constants_init flag when not initialized.
- (init_ext_80387_constants): New function to initialize this table.
- (standard_80387_constant_p): Extend to recognize extra 80387
- constants, in XFmode, on processors where this is a win.
- (standard_80387_constant_opcode): New function to return the
- opcode associated with standard_80387_constant_p.
- (standard_80387_constant_rtx): New function to return the XFmode
- CONST_DOUBLE associated with standard_80387_constant_p.
- (ix86_rtx_costs): Give the new constants the same cost as 1.0.
-
- * config/i386/i386-protos.h (standard_80387_constant_opcode):
- Prototype here.
- (standard_80387_constant_rtx): Likewise.
-
- * config/i386/i386.md (*movsf1, *movsf1_nointerunit, *movdf_nointeger,
- *movdf_integer, *movxf_nointeger, *movtf_nointeger, *movxf_integer,
- *movtf_integer): Simplify using new standard_80387_constant_opcode.
-
-2003-02-15 Geoffrey Keating <geoffk@apple.com>
-
- * doc/invoke.texi (Optimize Options): Correct @option syntax.
-
-2003-02-15 Richard Henderson <rth@redhat.com>
-
- * Makefile.in (cfglayout.o): Depend on TARGET_H.
- * cfglayout.c: Include target.h.
- (cfg_layout_can_duplicate_bb_p): Check targetm.cannot_copy_insn_p.
- * target-def.h (TARGET_CANNOT_COPY_INSN_P): New.
- * target.h (struct gcc_target): Add cannot_copy_insn_p.
-
- * config/alpha/alpha.c (alpha_cannot_copy_insn_p): New.
- (TARGET_CANNOT_COPY_INSN_P): New.
- (override_options): Revert 2003-02-08 hack.
-
-2003-02-15 Richard Henderson <rth@redhat.com>
-
- * gcse.c (bypass_block): Use BLOCK_FOR_INSN for resolving LABEL_REFs.
- (bypass_conditional_jumps): Accept computed_jump_p insns as well.
-
-2003-02-15 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.h (processor_type): Add PPC440.
- * config/rs6000/rs6000.c (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE,
- TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD,
- TARGET_SCHED_VARIABLE_ISSUE): Define.
- (rs6000_use_dfa_pipeline_interface): New function.
- (rs6000_multipass_dfa_lookahead): New Function.
- (rs6000_variable_issue): New function.
- (rs6000_adjust_cost): Add CMP and DELAYED_CR types.
- (rs6000_issue_rate): Add PPC440.
- * config/rs6000/rs6000.md (unspec list): Correct typo.
- (attr "type"): Add load_ext, load_ext_u, load_ext_ux, load_u,
- store_ux, store_u, fpload_ux, fpload_u, fpstore_ux, fpstore_u,
- cmp, delayed_cr, mfcr, mtcr.
- (automata_option): Set "ndfa".
- (extendMMNN2): Update attributes.
- (movcc_internal1): Discourage move to non-cr0. Update
- attributes.
- (movMM_update): Update attributes.
- (cmpMM_internal): Update attributes.
- (sCC CR materialization): Update attributes.
- (branch patterns): Do not discourage non-cr0.
- (cr logical patterns): Prefer destructive register allocation.
- Update attributes.
- (movesi_from_cr): Update attribute.
- (mtcrf_operation): Update attribute.
- (mtcrfsi): Update attribute.
- * config/rs6000/40x.md: New file.
- * config/rs6000/603.md: New file.
- * config/rs6000/6xx.md: New file.
- * config/rs6000/7450.md: New file.
- * config/rs6000/7xx.md: New file.
- * config/rs6000/mpc.md: New file.
- * config/rs6000/power4.md: New file.
- * config/rs6000/rios1.md: New file.
- * config/rs6000/rios2.md: New file.
- * config/rs6000/rs64.md: New file.
- [Some DFA descriptions based on work by Michael Hayes]
-
-2003-02-15 Richard Henderson <rth@redhat.com>
-
- * bb-reorder.c (find_traces_1_round): Don't connect easy to copy
- successors with multiple predecessors.
- (connect_traces): Try harder to copy traces of length 1.
-
- * function.h (struct function): Add computed_goto_common_label,
- computed_goto_common_reg.
- * function.c (free_after_compilation): Zap them.
- * stmt.c (expand_computed_goto): Use them to produce one
- indirect branch per function.
-
-2003-02-15 Richard Henderson <rth@redhat.com>
-
- * cfgcleanup.c: Include params.h.
- (try_crossjump_bb): Use PARAM_MAX_CROSSJUMP_EDGES. Fix test for
- too many outgoing edges from a block.
- * Makefile.in (cfgcleanup.o): Depend on PARAMS_H.
- * params.def (max-crossjump-edges): New.
- * doc/invoke.texi: Document it.
-
-2003-02-15 Richard Henderson <rth@redhat.com>
-
- * recog.c (split_all_insns): Include new blocks in life update;
- do a global life update.
-
-2003-02-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * config/i386/mingw32.h (LIBGCC_SPEC): Add libmingwex.a.
- Update copyright.
- * config/i386/cygwin.h (LIBGCC_SPEC): Add libmingwex.a for
- -mno-cygwin case.
-
-2003-02-14 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
-
- PR optimization/7702
- * reload1.c (reload_cse_simplify_set): Honor
- CANNOT_CHANGE_MODE_CLASS.
-
-2003-02-14 Alexandre Oliva <aoliva@redhat.com>
-
- * config/mn10300/mn10300.c (mn10300_wide_const_load_uses_clr): New
- function.
- * config/mn10300/mn10300-protos.h: Declare it.
- * config/mn10300/mn10300.md (movdi, movdf): Use it to compute
- attribute cc of instructions that may use clr.
-
-2003-02-14 Kazu Hirata <kazu@cs.umass.edu>
-
- * simplify-rtx.c (simplify_binary_operation): Simplify ~y when
- (x - (x & y)) is found.
-
-2003-02-14 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * configure.in: Fix typo.
- * configure: Regenerate.
-
-2003-02-14 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*iorsi2_and_1_lshiftrt_1): New.
-
-2003-02-13 Adam Nemet <anemet@lnxw.com>
-
- PR opt/2391
- * combine.c: Fix spelling in comment.
- (cached_nonzero_bits): New function.
- (cached_num_sign_bit_copies): New function.
- (nonzero_bits_with_known): New macro.
- (num_sign_bit_copies_with_known): New macro.
- (nonzero_bits1): Rename from nonzero_bits. Add three new
- arguments. Change calls from nonzero_bits to
- nonzero_bits_with_known.
- (num_sign_bit_copies1): Rename from num_sign_bit_copies. Add
- three new arguments. Change calls from num_sign_bit_copies to
- num_sign_bit_copies_with_known.
- (nonzero_bits): New macro.
- (num_sign_bit_copies): New macro.
- (update_table_tick): Don't traverse identical subexpression more
- than once.
- (get_last_value_validate): Likewise.
-
-2003-02-13 Zack Weinberg <zack@codesourcery.com>
-
- * emit-rtl.c (init_emit): Use ggc_alloc for regno_reg_rtx.
- * function.h (struct emit_status): Length of regno_pointer_align
- and x_regno_reg_rtx as seen by gengtype is only x_reg_rtx_no,
- not regno_pointer_align_length (i.e. length actually used, not
- length as allocated)
-
- * config/i386/i386.c (struct stack_local_entry): New.
- (struct machine_function): Replace huge array with alist.
- (assign_386_stack_local): Change to match.
-
-2003-02-13 John David Anglin <dave.anglin@nrc-crnc.gc.ca>
-
- * inclhack.def (hpux_long_double): Tighten select and add bypass
- regexp.
- * fixincl.x: Rebuilt.
-
-2003-02-13 Josef Zlomek <zlomekj@suse.cz>
-
- * cfgcleanup.c (outgoing_edges_match): When there is single outgoing
- edge and block ends with a jump insn it must be simple jump.
-
-2003-02-13 Daniel Jacobowitz <drow@mvista.com>
-
- * Makefile.in (PREPROCESSOR_DEFINES): Add
- @TARGET_SYSTEM_ROOT_DEFINE@.
- * configure.in (PREFIX_INCLUDE_DIR): Don't define if $with_sysroot
- is specified or if building a cross compiler.
- (TARGET_SYSTEM_ROOT_DEFINE): Add TARGET_SYSTEM_ROOT_RELOCATABLE
- if the sysroot is under $exec_prefix.
- * configure: Regenerated.
- * cppdefault.h: Use native include paths if TARGET_SYSTEM_ROOT is
- defined.
- (struct default_include): Add add_sysroot field.
- (cpp_SYSROOT): Declare.
- * cppdefault.c (cpp_include_defaults): Fill in add_sysroot
- field.
- (cpp_SYSROOT): New variable.
- * cppinit.c (cpp_create_reader): Initialize
- CPP_OPTION (pfile, sysroot).
- (init_standard_includes): Handle add_sysroot. Do not
- add unrelocated copies of relocated directories.
- (COMMAND_LINE_OPTIONS): Add -isysroot.
- (cpp_handle_option): Handle -isysroot.
- * cpplib.h (struct cpp_options): Add sysroot member.
- * gcc.c (The Specs Language): Update description of %I.
- (target_system_root_changed): New variable.
- (process_command): Conditionalize make_relative_prefix call
- on !VMS and TARGET_SYSTEM_ROOT_RELOCATABLE. Set
- target_system_root_changed.
- (do_spec_1): Add -isysroot to %I.
- * doc/invoke.texi (Spec Files): Update description of %I.
- * doc/install.texi (--with-sysroot): Update comment about
- relocation.
-
-2003-02-13 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-02-13 Robert Lipe <robertlipe@usa.net>
- Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Specific): Update three SCO-related URLs.
-
-2003-02-13 Andreas Schwab <schwab@suse.de>
-
- * cgraph.c (SET_NPREDECESORS): Add intermediate cast to size_t.
- Parenthesize properly.
- (NPREDECESORS): Parenthesize properly.
-
-2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * timevar.h (POP_TIMEVAR_AND_RETURN): New macro.
-
-2003-02-12 Roger Sayle <roger@eyesopen.com>
-
- * config/i386/i386.md (UNSPEC_FPATAN): New UNSPEC constant.
- (atan2sf3, atan2df3, atan2xf3, atan2tf3): New patterns.
-
- * reg-stack.c (subst_stack_regs_pat): Add support for binary
- UNSPEC instructions (e.g. "fpatan").
-
-2003-02-12 Mike Stump <mrs@apple.com>
-
- * varray.c (element_size): Remove.
- (uses_ggc): Remove.
- (element): Add.
- (varray_init): Use new interface.
- (varray_grow): Use new interface.
- (varray_clear): Use new interface.
-
-2003-02-12 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.h: Add casts to the arguments of the following
- macros: evfsabs, evfsnabs, evfsneg, evfsadd, evfssub, evfsmul,
- evfsdiv, evfscfui, evfscfsi evfscfuf evfscfsf, evfsctui, evfsctsi,
- evfsctuf, evfsctsf, evfsctuiz, evfsctsiz, __ev_get_upper*,
- __ev_get_lower*, __ev_get_u32, __ev_get_s32, __ev_get_fs,
- __ev_get_u16, __ev_get_s16.
-
-2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-02-12 Jan Hubicka <jh@suse.cz>
-
- * Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-a-time
- (OBJS): Add callgraph.o
- (callgraph.o): New.
- * c-decl.c (expand_body_1): Break out from ...
- (expand_body): This one; change calling convention
- (finish_function): Move some of expand_body logic here.
- (c_expand_deferred_function): Update call of expand_body
- (c_expand_stmt): Use c_expand_body_1.
- * c-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
- * c-objc-commin.c (c_objc_common_finish_file): Use callgraph code.
- * c-tree.h (c_expand_body): Declare.
- * callgraph.c: New file.
- * flags.h (flag_unit_at_a_time): Declare.
- * langhooks.h (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION,
- LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION,
- LANG_HOOKS_CALLGRAPH_INITIALIZER): New macros.
- * langhooks.h (struct lang_hooks_for_callgraph): New.
- (struct lang_hooks): Add callgraph field.
- * toplev.c (flag_unit_at_a_time): New.
- (lang_independent_options): Add flag_unit_at_a_time.
- (process_options): Disable unit-at-a-time mode for frontends not
- supporting callgraph.
- * tree-inline.c (typedef struct inline_data): Add "decl"
- (expand_call_inline): Update callgraph.
- (optimize_inline_calls): Set id.decl.
- * tree.h (cgraph_finalize_function, cgraph_finalize_compilation_unit,
- cgraph_create_edges, dump_cgraph, cgraph_optimize, cgraph_remove_call
- cgraph_calls_p): Declare.
- * invoke.texi (-funit-at-a-time): Document
-
-2003-02-12 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.h: Fix misc formatting.
- (__ev_create_ufix32_fs): Cast ev argument.
- (__ev_create_sfix32_fs): Same.
- (__ev_get_sfix32_fs_internal): Cast arguments to builtins.
- (__ev_get_ufix32_fs_internal): Same.
-
-2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
-
- * doc/tm.texi (MODIFY_JNI_METHOD_CALL): Document.
- * config/i386/cygwin.h (MODIFY_JNI_METHOD_CALL): New macro.
-
-2003-02-12 Zack Weinberg <zack@codesourcery.com>
-
- * cpplib.c (do_include_common): Move warnings for
- #include_next and #import out to callers. Use early-return
- instead of nested ifs. Don't do check_eol here.
- (parse_include): Do check_eol here with the rest of the
- parsing stuff.
- (do_include_next, do_import): Now handle warnings.
-
-2003-02-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Specific): Update AVR- and Darwin-related URLs.
-
-2003-02-12 Jan Hubicka <jh@suse.cz>
-
- * predict.c (estimate_probability): Fix roundoff error.
-
-2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Don't handle 65535.
- (two peephole2): New.
-
-2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (several peephole2): Replace
- find_regno_note with peep2_reg_dead_p.
-
-2003-02-11 Richard Henderson <rth@redhat.com>
-
- * gcse.c (lookup_set): Remove unused argument PAT. Update
- both callers.
-
-2003-02-11 Geoffrey Keating <geoffk@apple.com>
-
- * diagnostic.c (real_abort): New.
- (diagnostic_report_diagnostic): Call real_abort on error.
- * diagnostic.h (diagnostic_abort_on_error): New.
- (struct diagnostic_context): Add abort_on_error field.
- * toplev.c (setup_core_dumping): New.
- (decode_d_option): Handle 'H' case.
- * doc/invoke.texi (Debugging Options): Document -dH.
-
-2003-02-11 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * Makefile.in: Remove pointless setting of CXXFLAGS for dejagnu
- which refers to obsolete directories.
-
-2003-02-11 Richard Henderson <rth@redhat.com>
-
- * config/alpha/linux.h (TARGET_C99_FUNCTIONS): New.
-
-2002-10-21 Jan Hubicka <jh@suse.cz>
-
- * i386.c (contains_128bit_aligned_vector_p): New function.
- (ix86_function_arg_boundary): Properly align vector modes.
-
-2003-02-11 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.md (set_frame_ptr): Change rtl to set reg a7.
- * config/xtensa/xtensa.c (xtensa_reorg): Search for UNSPECV_SET_FP
- as a SET pattern.
-
-2003-02-11 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c: Fix failure caused by commiting wrong patch.
-
-2003-02-11 Dale Johannesen <dalej@apple.com>
- * ra-build.c (compare_and_free_webs): Relax checking.
- * config/rs6000/darwin.h (HOT_TEXT_SECTION_NAME): Define.
- (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Define.
-
-2003-02-11 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
-
- PR optimization/9651
- * rtlanal.c (may_trap_p): Handle FIX.
-
-2003-02-11 Dave Jones <davej@codemonkey.org.uk>
-
- * config/i386/i386.c (override_options): Define c3-2 as a 686 with SSE.
- * doc/invoke.texi: Extra alias.
-
-2003-02-11 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/host-darwin.c: Fix comment.
-
-2003-02-11 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.md (divmodsi4): Use register_operand
- predicate for mod result.
-
-2003-02-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * inclhack.def (hpux_long_double, hpux10_ctype_declarations1,
- hpux10_ctype_declarations2, hpux_ctype_macros): New hacks.
- * fixincl.x: Rebuilt.
- * tests/base/stdlib.h: Update.
- * tests/base/ctype.h: New file.
-
-2003-02-11 Jan Hubicka <jh@suse.cz>
-
- * emit-rtl.c (emit_copy_of_insn_after): Copy insn recog cache too.
-
-2003-02-11 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.c (ix86_expand_movstr): Fail if esi or edi
- appropriated as globals.
- (ix86_expand_clrstr): Similarly.
- * config/i386/i386.md (cmpstrsi): Similarly.
-
-2003-02-11 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Add a case of 255.
-
-2003-02-11 Roger Sayle <roger@eyesopen.com>
-
- * optabs.h (enum optab_index): Add new OTI_pow and OTI_atan2.
- (pow_optab, atan2_optab): Define corresponding macros.
- * optabs.c (init_optabs): Initialize pow_optab and atan2_optab.
- * genopinit.c (optabs): Implement pow_optab and atan2_optab
- using pow?f3 and atan2?f3 patterns.
- * builtins.c (expand_errno_check): New function to update errno
- if necessary, split out from expand_builtin_mathfn.
- (expand_builtin_mathfn): Use expand_errno_check.
- (expand_builtin_mathfn_2): New function to handle expanding binary
- math functions, reusing the code in expand_errno_check.
- (expand_builtin): Handle the pow and atan2 math built-ins,
- BUILT_IN_{POW,POWF,POWL,ATAN2,ATAN2F,ATAN2L} via the new function
- expand_builtin_mathfn_2.
-
- * doc/md.texi: Document new pow?f3 and atan2?f3 patterns.
-
-2003-02-11 Jan Hubicka <jh@suse.cz>
-
- * combine.c (combine_simplify_rtx): Fix folding of
- nested float_truncates.
-
-2003-02-11 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (a peephole2): Fix a typo.
-
-2003-02-11 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.mc (return_address_mask): Use CC_REGNUM for the condition code
- register number.
-
-2003-02-11 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- gtuleu_operator.
- * config/h8300/h8300.c (gtuleu_operator): New.
- * config/h8300/h8300.h (PREDICATE_CODES): Add gtuleu_operator.
- * config/h8300/h8300.md (a peephole2): New.
-
-2003-02-11 Jan Hubicka <jh@suse.cz>
-
- * sched-ebb.c (schedule_ebbs): Do not verify_flow_info.
-
-2003-02-11 Jan Hubicka <jh@suse.cz>
-
- * predict.c (choose_function_section): Choose sections correctly.
-
-2003-02-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * reload1.c (first_label_num): New.
- (reload): Index offsets_known_at and offsets_at using difference of
- label number and first label number. Don't use offset pointers.
- (set_label_offsets, set_initial_label_offsets): Likewise.
-
-2003-02-10 Roger Sayle <roger@eyesopen.com>
-
- * mips-tfile.c (init_file): Add missing initializers in the
- "#ifdef __alpha" case.
- (file_offset, max_file_offset): Declare as unsigned long.
- (write_varray): Cast to "unsigned long" in comparisons against
- either file_offset or max_file_offset.
- (write_object): Likewise.
- (read_seek): Likewise.
- (copy_object): Likewise. Declare "ifd" as int to match its use
- in add_ext_symbol, and avoid signed/unsigned conditional warning.
-
-2003-02-10 Nick Clifton <nickc@redhat.com>
- Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Do not
- override options which have been specified on the command line.
-
-2003-02-10 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (abssf2): New.
- (*abssf2_h8300): Likewise.
- (*abssf2_h8300hs): Likewise.
-
-2003-02-10 Phil Edwards <pme@gcc.gnu.org>
-
- * tree.c (build_tree_list): Fix parameter names in comment.
-
-2003-02-10 Janis Johnson <janis187@us.ibm.com>
-
- * config/rs6000/ppc64-fp.c: New file.
- * config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Add ppc64-fp.c.
-
-2003-02-10 Josef Zlomek <zlomekj@suse.cz>
-
- * Makefile.in (bb-reorder.o): Add dependency on $(FIBHEAP_H).
- * bb-reorder.c (make_reorder_chain): Deleted.
- (make_reorder_chain_1): Deleted.
- (find_traces): New function.
- (rotate_loop): New function.
- (mark_bb_visited): New function.
- (find_traces_1_round): New function.
- (copy_bb): New function.
- (bb_to_key): New function.
- (better_edge_p): New function.
- (connect_traces): New function.
- (copy_bb_p): New function.
- (get_uncond_jump_length): New function.
- (reorder_basic_blocks): Use new functions (Software Trace Cache).
- * cfgcleanup.c (outgoing_edges_match): Enable crossjumping across loop
- boundaries.
-
-2003-02-10 Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/rs6000.c (bdesc_2arg): Change spe_evxor to xorv2si3.
-
-2003-02-09 Dan Nicolaescu <dann@ics.uci.edu>
-
- * tree.h (struct tree_decl): Remove unused live_range_rtl field.
- (DECL_LIVE_RANGE_RTL): Remove.
-
-2003-02-10 Nick Clifton <nickc@redhat.com>
-
- * config/arm/aof.h, config/arm/aout.h, config/arm/arm-modes.def,
- config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h,
- config/arm/arm.md, config/arm/cirrus.md, config/arm/coff.h,
- config/arm/conix-elf.h, config/arm/ecos-elf.h, config/arm/elf.h,
- config/arm/freebsd.h, config/arm/linux-elf.h,
- config/arm/linux-gas.h, config/arm/netbsd-elf.h,
- config/arm/netbsd.h, config/arm/pe.c, config/arm/pe.h,
- config/arm/rtems-elf.h, config/arm/semi.h, config/arm/semiaof.h,
- config/arm/strongarm-coff.h, config/arm/strongarm-elf.h,
- config/arm/strongarm-pe.h, config/arm/uclinux-elf.h,
- config/arm/unknown-elf-oabi.h, config/arm/unknown-elf.h,
- config/arm/xscale-elf.h: Replace occurances of "GNU CC" with "GCC"
- and reformat as appropriate.
-
-2003-02-10 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/clzsi2.c: Remove.
- * config/h8300/ctzsi2.c: Likewise.
- * config/h8300/paritysi2.c: Likewise.
- * config/h8300/popcountsi2.c: Likewise.
- * config/h8300/t-h8300 (LIB2FUNCS_EXTRA): Remove clzsi2,
- ctzsi2, paritysi2, and popcountsi2.
-
-2003-02-10 Eric Botcazou <ebotcazou@libertysurf.fr>
- Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
-
- PR c/7741
- * c-decl.c (duplicate_decls): Discard the initializer of the
- new decl when the types are conflicting.
-
-2003-02-10 Josef Zlomek <zlomekj@suse.cz>
-
- * Makefile.in (sreal.o): Added.
- (predict.o): Depends on sreal.h instead of real.h.
- * sreal.c: New file.
- * sreal.h: New file.
- * predict.c: Use sreal.c instead of real.c.
-
-2003-02-10 Nick Clifton <nickc@redhat.com>
-
- * Contributed support for the Cirrus EP9312 "Maverick"
- floating point co-processor. Written by Aldy Hernandez
- <aldyh@redhat.com>.
- (config/arm/arm.c): Add Cirrus support.
- (config/arm/arm.h): Likewise.
- (config/arm/aout.h): Likewise.
- (config/arm/arm.md): Likewise.
- (config/arm/arm-protos.h): Likewise.
- (config.gcc): Likewise.
- (doc/invoke.texi): Describe new -mcpu value and new
- -mcirrus-fix-invalid-insns switch,
- (cirrus.md): New file.
-
-2003-02-10 Jan Hubicka <jh@suse.cz>
-
- * combine.c (combine_simplify_rtx): Simplify using
- (float_truncate (float x)) is (float x)
- (float_extend (float_extend x)) is (float_extend x).
-
-2003-02-10 Alan Modra <amodra@bigpond.net.au>
-
- * calls.c (try_to_integrate): Tidy stack_usage_map access.
- (emit_library_call_value_1): Likewise. Formatting.
- (store_one_arg): Likewise.
-
-2003-02-09 Nick Clifton <nickc@redhat.com>
- Aldy Hernandez <aldyh@redhat.com>
-
- * config/rs6000/spe.md: spe_evlhhesplat, spe_evlhhossplat,
- spe_evlhhousplat, spe_evlwhsplat, spe_evlwwsplat, spe_evldd,
- spe_evldh, spe_evldw, spe_evlwhe, spe_evlwhos, spe_evlwhou,
- spe_evstdd, spe_evstdh, spe_evstdw, spe_evstdwx, spe_evstwhe,
- spe_evstwho, spe_evstwwe, spe_evstwwo: Fix syntax to match newest
- docs. Add range test for immediate value.
-
-2003-02-09 Aldy Hernandez <aldyh@redhat.com>
-
- Rename spe_evxor to xorv2si3.
- (xorv4hi3): New.
- (xorv1di3): New.
-
-2003-02-10 Glen Nakamura <glen@imodulo.com>
-
- * doc/extend.texi (C++98 Thread-Local Edits): Add missing @item
- tag.
-
-2003-02-10 Jan Hubicka <jh@suse.cz>
-
- * i386.c (vector_move_operand): New predicate.
- (ix86_expand_vector_move): Be happy about 0.
- * i386.h (PREDICATE_CODES): Add sse-move_operand.
- * i386.md (mov*_internal): Add 'C' alternative.
-
-2003-02-09 Jan Hubicka <jh@suse.cz>
-
- * i386.md (floathi*): Deal with SSE.
-
-2003-02-09 Jan Hubicka <jh@suse.cz>
-
- * simplify-rtx.c (simplify_unary_operation,
- simplify_binary_operation): Deal with vector modes
- (simplify_ternary_operation): Deal with no-op VEC_MERGE.
-
-2003-02-09 Richard Sandiford <rsandifo@redhat.com>
-
- * toplev.c (rest_of_compilation): Recompute register usage after
- split_all_insns.
-
-2003-02-09 Richard Henderson <rth@redhat.com>
-
- * libgcc-std.ver (__clztf2): New.
- (__ctztf2, __popcounttf2, __paritytf2): New.
- * libgcc2.c (__clzSI2, __clzDI2, __ctzSI2, __ctzDI2, __popcountSI2,
- __popcountDI2, __paritySI2, __parityDI2): Use UWmode and UDWmode;
- adjust code to match the different type sizes.
- * libgcc2.h (__clzSI2, __ctzSI2, __popcountSI2, __paritySI2,
- __clzDI2, __ctzDI2, __popcountDI2, __parityDI2): New macros.
-
- * optabs.c (init_integral_libfuncs): Don't hard-code SImode and
- TImode; select word_mode and twice that.
- (init_floating_libfuncs): Don't hard-code SFmode and TFmode;
- select the modes from float, double, and long double.
- (init_optabs): Remove duplicate initializations.
-
-2003-02-09 Wolfgang Bangerth <bangerth@ticam.utexas.edu>
-
- * doc/install.texi: Squeeze and streamline section on
- testing and regression checking.
-
-2003-02-09 Jan Hubicka <jh@suse.cz>
-
- * i386.md (ahi?v*3): Set third operand type to TImode.
- * i386.c (ix86_expand_binop_builtin): Extend operand when needed.
-
- * simplify-rtx.c (simplify_subreg): Fix conversion from vector into
- integer mode.
-
- * rtl.def (VEC_MERGE, VEC_SELECT, VEC_CONCAT, VEC_DUPLICATE):
- Change code so they are arithmetic expressions now.
- * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation,
- simplify_ternary_operation): Deal with VEC_* expressions.
-
- * i386.md (vmaskcmp, pinsrw, movd patterns): Fix RTL representation.
-
-2003-02-08 Jan Hubicka <jh@suse.cz>
-
- * cfgrtl.c (verify_flow_info): Use control_flow_insn_p.
- * reload1.c (fixup_abnormal_edges): Split basic blocks when EH edges
- possibly got duplicated.
-
-2003-02-08 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (override_options): Turn off explicit
- relocs until post-peep2 code duplication resolved.
-
-2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * optabs.c (expand_unop): Widen clz properly when clz is done
- via libcall.
-
-2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/clzsi2.c: Replace "GNU CC" with "GCC".
- * config/h8300/crti.asm: Likewise.
- * config/h8300/crtn.asm: Likewise.
- * config/h8300/ctzsi2.c: Likewise.
- * config/h8300/fixunssfsi.c: Likewise.
- * config/h8300/h8300-protos.h: Likewise.
- * config/h8300/h8300.c: Likewise.
- * config/h8300/h8300.h: Likewise.
- * config/h8300/h8300.md: Likewise.
- * config/h8300/paritysi2.c: Likewise.
- * config/h8300/popcountsi2.c: Likewise.
- * config/h8300/rtems.h: Likewise.
-
-2003-02-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * doc/invoke.texi: Documentation for my previous commit.
- * doc/passes.texi: Ditto.
-
-2003-02-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cfgloop.h (fix_loop_placement, can_duplicate_loop_p,
- duplicate_loop_to_header_edge, loopify, remove_path, split_loop_bb):
- Declare.
- (DLTHE_FLAG_UPDATE_FREQ): New.
- * cfgloopmanip.c (duplicate_loop, duplicate_subloops, copy_loops_to,
- loop_redirect_edge, loop_delete_branch_edge, copy_bbs, remove_bbs,
- rpe_enum_p, find_branch, alp_enum_p, add_loop, fix_loop_placements,
- fix_bb_placement, fix_bb_placements, place_new_loop,
- scale_loop_frequencies, scale_bbs_frequencies, record_exit_edges):
- New static functions.
- (fix_loop_placement, can_duplicate_loop_p,
- duplicate_loop_to_header_edge, loopify, remove_path, split_loop_bb):
- New functions.
-
- * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize,
- unswitch_loops): Declare.
- * loop-init.c: New file.
- * loop-unswitch.c: New file.
- * Makefile.in (loop-init.o, loop-unswitch.o): New.
- * params.def (PARAM_MAX_UNSWITCH_INSNS, PARAM_MAX_UNSWITCH_LEVEL): New.
- * toplev.c (DFI_loop2): New dump.
- (flag_unswitch_loops): New.
- (lang_independent_options): Add it.
- (rest_of_compilation): Call new loop optimizer.
- (parse_options_and_default_flags): Turn flag_unswitch_loops on with -O3.
-
-2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/clzsi2.c: New.
- * config/h8300/ctzsi2.c: Likewise.
- * config/h8300/paritysi2.c: Likewise.
- * config/h8300/popcountsi2.c: Likewise.
- * config/h8300/t-h8300 (LIB2FUNCS_EXTRA): Add above files.
-
-2003-02-07 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.h (CLZ_DEFINED_VALUE_AT_ZERO): Define.
- * config/rs6000/rs6000.md (clzsi2): Rename from cntlzw2.
- (ctzsi2): New pattern.
- (ffssi2): Use clz instead of unspec.
- (clzdi2): Rename from cntlzd2.
- (ctzdi2): New pattern.
- (ffsdi2): Use clz instead of unspec.
-
-2003-02-07 Loren James Rittle <ljrittle@acm.org>
-
- * config/alpha/freebsd.h (LINK_SPEC): Weaken error to notice.
- * config/ia64/freebsd.h (LINK_SPEC): Likewise.
- * config/sparc/freebsd.h (LINK_SPEC): Likewise.
- * config/i386/freebsd.h (LINK_SPEC): Add clause to mirror other arches.
-
-2003-02-07 Wolfgang Bangerth <bangerth@ticam.utexas.edu>
-
- * doc/trouble.texi: Document pitfalls of two-stage name lookup.
-
-2003-02-07 Richard Henderson <rth@redhat.com>
-
- PR 9226
- * gcse.c (local_cprop_find_used_regs): New.
- (local_cprop_pass): Use it.
-
-2003-02-07 Fred Fish <fnf@intrinsity.com>
-
- * mips-tfile.c (parse_def): Parenthesize assignments to fix
- precedence bugs.
-
-2003-02-07 Segher Boessenkool <segher@koffie.nl>
-
- * genoutput.c (output_get_insn_name): Handle NOOP_MOVE_INSN_CODE.
-
-2003-02-07 Roger Sayle <roger@eyesopen.com>
-
- * builtin-types.def (BT_FN_FLOAT_FLOAT_FLOAT): New built-in type.
- (BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE): Likewise.
- (BT_FN_DOUBLE_DOUBLE_DOUBLE): Likewise.
- * builtins.def: Define pow, powf, powl, atan2, atan2f and atan2l
- builtin functions (and their __builtin_* variants).
- * builtins.c (mathfn_built_in): Handle missing log{,f,l} cases.
- (expand_builtin): Don't expand log{,f,l}, pow{,f,l} or atan2{,f,l}
- when not optimizing.
-
- * doc/extend.texi: Document new pow and atan2 builtins, and
- their float and long double variants. Realphabetize builtins.
-
-2003-02-07 Jan Hubicka <jh@suse.cz>
-
- * i386.md (sse2_nandv2di3): Fix.
-
-2003-03-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * config/i386/i386.h (MS_AGGREGATE_RETURN): New define.
- * config/i386/cygwin.h (MS_AGGREGATE_RETURN): Override default
- definition.
- * config/i386/i386.h (ix86_return_in_memory): Return aggregate
- types of up to 8 bytes via registers if MS_AGGREGATE_RETURN.
-
-2003-02-07 Jan Hubicka <jh@suse.cz>
-
- * i386.md (movdi_rex64_1): Fix mmx<->int move opcode.
-
-2003-02-07 Daniel Berlin <dberlin@dberlin.org>
-
- * cfg.c (dump_flow_info): Add back accidently deleted line.
-
-2003-02-07 Andrey Petrov <petrov@netbsd.org>
-
- * optabs.c (expand_float): Search wider integer modes first.
-
-2003-02-07 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.h (LIBGCC2_WORDS_BIG_ENDIAN): Set this
- based on preprocessor flag.
-
-2003-02-07 Roger Sayle <roger@eyesopen.com>
- Richard Henderson <rth@redhat.com>
-
- * gcse.c (implicit_sets): New.
- (compute_hash_table_work): Include them in hash table.
- (find_implicit_sets, fis_get_condition): New.
- (one_cprop_pass): Allocate and free implicit_sets; call
- find_implicit_sets before building hash table.
-
-2003-02-07 Jason Thorpe <thorpej@wasabisystems.com>
-
- * config/t-netbsd (USER_H): Revert previous change.
-
-2003-02-07 Gabor Greif <ggreif@lucent.com>
-
- * doc/c-tree.texi (Namespaces): Fix typo.
-
-2003-02-07 Jan Hubicka <jh@suse.cz>
-
- * regrename.c (do_replace, find_oldest_value_reg,
- copyprop_hardreg_forward_1): Update register attributes.
-
-2003-02-06 Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (VLA_PTR_CREATE, VLA_PTR_EXPAND, VLA_PTR_ADD,
- VLA_HWINT_CREATE, VLA_HWINT_EXPAND, VLA_HWINT_ADD): Use temporay
- variables starting with underscore.
- (struct unit_usage): New structure.
- (unit_usages, cycle_alt_unit_usages): New global variables.
- (check_unit_distribution_in_reserv): Remove it.
- (store_alt_unit_usage): New function.
- (check_regexp_units_distribution): Rewrite it.
-
-2003-02-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * config.gcc (hppa*-*-linux*): Set MASK_NO_SPACE_REGS in
- target_cpu_default.
- * pa.c (attr_length_call): Add 8 to call length (long indirect PA 1.X)
- if not MASK_NO_SPACE_REGS.
- (output_call): Adjust return pointer, don't load new space register
- into %sr0, and use %sr4 for call if TARGET_NO_SPACE_REGS is true.
- (pa_asm_output_mi_thunk): Don't load new space register into %sr0 if
- TARGET_NO_SPACE_REGS is true.
- * pa.md (return_external_pic): Add TARGET_NO_SPACE_REGS to insn
- conditions.
- (epilogue): Always use return_internal if TARGET_NO_SPACE_REGS is true.
- (interspace_jump): Add new pattern for when TARGET_NO_SPACE_REGS is
- true. Use bve when TARGET_64BIT is true.
-
-2003-02-06 Richard Henderson <rth@redhat.com>
-
- * combine.c (nonzero_bits): Fix double break.
-
-2003-02-06 Eric Botcazou <ebotcazou@libertysurf.fr>
- Richard Henderson <rth@redhat.com>
-
- PR c/9530
- * config/i386/i386.c (ix86_function_ok_for_sibcall): Forbid sibcalls
- from functions that return a float to functions that don't.
-
-2003-02-06 Jan Hubicka <jh@suse.cz>
-
- * i386.c (x86_inter_unit_moves): New variable.
- (ix86_secondary_memory_needed): Fix 64bit case, honor
- TARGET_INTER_UNIT_MOVES
- * i386.h (x86_inter_unit_moves): Declare.
- (TARGET_INTER_UNIT_MOVES): New macro.
- * i386.md (movsi_1): Cleanup constraints; disable
- when not doing inter-unit moves.
- (movsi_1_nointernunit): New.
- (movdi_1_rex64): Fix constraints; deal with SSE->GPR moves.
- (movdi_1_rex64_nointerunit): New.
- (mivsf_1): disable when not doing inter-unit moves.
- (movsf_1_nointerunit): New.
-
- * basic-block.h (inside_basic_block_p): Declare.
- * cfgbuild.c (inside_basic_block_p): Make global.
- * haifa-sched.c (unlink_other_notes): Deal with NOT_INSN_BASIC_BLOCK.
- * scheudle-ebb.c (schedule_ebb): Return last basic block of trace;
- update CFG.
- (fix_basic_block_boundaries, add_missing_bbs): New.
- (rank): Use profile.
- (scheudle_ebbs): Rely on CFG; update coments.
-
-2003-02-05 Geoffrey Keating <geoffk@apple.com>
-
- * Makefile.in (host_hook_obj): New.
- (OBJS): Add $(host_hook_obj).
- (host_default.o): New rule.
- * config.gcc (host_hook_obj): New, default to host-default.o.
- (powerpc-*-darwin*): Use host-darwin.o.
- (out_host_hook_obj): New.
- * configure: Regenerate.
- * configure.in: Print information about out_host_hook_obj, substitute
- into output files.
- * host-default.c: New file.
- * hosthooks.h: New file.
- * toplev.c (general_init): Call host_hooks.extra_signals.
- * config/rs6000/host-darwin.c: New file.
- * config/rs6000/x-darwin: New file.
- * doc/hostconfig.texi: Add documentation for new host hook.
- Rearrange existing documentation.
-
-2003-02-05 Roger Sayle <roger@eyesopen.com>
-
- * dwarf2out.c (mem_loc_descriptor): Replace ASM_SIMPLIFY_DWARF_ADDR
- with *targetm.delegitimize_address.
- (rtl_for_decl_location): Likewise.
- * dwarfout.c (output_mem_loc_descriptor): Likewise. Include target.h.
- * Makefile.in (dwarf2out.c, dwarfout.c): Depend upon $(TARGET_H)
-
- * config/i386/i386.h (ASM_SIMPLIFY_DWARF_ADDR): Remove definition.
- * config/i386/i386-protos.h (i386_simplify_dwarf_addr): Remove
- prototype.
- * config/i386/i386.c (ix86_delegitimize_address): Renamed from
- i386_simplify_dwarf_addr. Made static. Prototyped.
- (TARGET_DELEGITIMIZE_ADDRESS): Update definition from
- i386_simplify_dwarf_addr to ix86_delegitimize_address.
- (ix86_find_base_term): Likewise.
- (maybe_get_pool_constant): Likewise.
-
- * config/s390/s390.h (ASM_SIMPLIFY_DWARF_ADDR): Remove definition.
- * config/s390/s390-protos.h (s390_simplify_dwarf_addr): Remove
- prototype.
- * config/s390/s390.c (s390_delegitimize_address): Renamed from
- s390_simplify_dwarf_addr. Made static. Prototyped.
- (TARGET_DELEGITIMIZE_ADDRESS): Define as s390_delegitimize_address.
-
-2003-02-05 Richard Henderson <rth@redhat.com>
-
- PR c/8602
- * integrate.c (output_inline_function): Reset input_filename
- and lineno from the decl before rest_of_compilation.
-
-2003-02-05 Richard Henderson <rth@redhat.com>
-
- * defaults.h (CLZ_DEFINED_VALUE_AT_ZERO): New.
- (CTZ_DEFINED_VALUE_AT_ZERO): New.
- * doc/rtl.texi, doc/tm.texi: Document them.
-
- * combine.c (nonzero_bits) [CLZ, CTZ]: Handle the definedness
- of the value at zero properly.
- * fold-const.c (tree_expr_nonnegative_p): Likewise.
- * simplify-rtx.c (simplify_unary_operation): Likewise.
-
- * config/alpha/alpha.h (CLZ_DEFINED_VALUE_AT_ZERO): New.
- (CTZ_DEFINED_VALUE_AT_ZERO): New.
-
- * config/arm/arm.c (TARGET_INIT_BUILTINS): Remove.
- (TARGET_EXPAND_BUILTIN): Remove.
- (def_builtin, arm_init_builtins, arm_expand_builtin): Remove.
- * config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO): New.
- (enum arm_builtins): Remove.
- * config/arm/arm.md (UNSPEC_CLZ): Remove.
- (clzsi2): Rename from clz; use clz instead of unspec.
- (ctzsi2): New.
- * config/arm/arm-protos.h: Update.
-
-2003-02-05 Jan Hubicka <jh@suse.cz>
-
- * i386-protos.h (x86_emit_floatuns): Declare.
- * i386.c (x86_emit_floatuns): New global function.
- * i386.md (floatunssisf2, floatunsdisf2,
- floatunsdidf2): New patterns.
-
-2003-01-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cfgloopmanip.c (force_single_succ_latches): Fix missindentation.
-
-2003-02-05 Hans Boehm <Hans.Boehm@hp.com>
-
- * config/ia64/unwind-ia64.c: include coretypes.h, tm.h to get
- config/ia64/linux.h
-
-2003-02-05 Roger Sayle <roger@eyesopen.com>
-
- * cfgloop.h (flow_bb_inside_loop_p): Correct prototype again.
-
-2003-02-05 Jakub Jelinek <jakub@redhat.com>
-
- PR optimization/8555
- * config/i386/i386.md (sse_mov?fcc split): Handle op2 == op3 case
- instead of aborting.
-
-2003-02-04 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.md (UNSPEC_BSF): Remove.
- (ffssi2): Split into cmove and no_cmove insns and splitters;
- lose pentium float trick for now.
- (ffssi_1): Add * to name; use CTZ instead of UNSPEC.
- (ctzsi2, clzsi2, bsr): New.
-
-2003-02-04 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (rtx_needs_barrier): Handle POPCOUNT,
- UNSPEC_GETF_EXP; remove UNSPEC_POPCNT.
- * config/ia64/ia64.md (UNSPEC_POPCNT): Remove.
- (ffsdi2): Use popcount instead of unspec.
- (popcountdi2): Rename from *popcnt.
- (ctzdi2, clzdi2, getf_exp_tf): New.
-
-2003-02-04 Kazu Hirata <kazu@cs.umass.edu>
-
- * genconfig.c (main): Generate CC0_P.
- * rtl.h (CC0_P): Remove.
-
-2003-02-04 Richard Henderson <rth@redhat.com>
-
- * libgcc2.h, libgcc2.c (__ffsSI2): New.
- (__ffsDI2): Rename from __ffsdi2.
- * mklibgcc.in (lib2funcs): Add _ffssi2.
-
-2003-02-04 Richard Henderson <rth@redhat.com>
-
- * libgcc2.c (__paritysi2, __paritydi2): Replace last two reduction
- rounds with a "bit table" lookup.
-
-2003-02-04 Ulrich Weigand <uweigand@de.ibm.com>
-
- * reload.c (find_reloads): Do not use the mode specified in the insn
- pattern as reload mode for address operands. Do not generate optional
- reloads for operands where a mandatory reload was already pushed.
-
-2003-02-04 Richard Henderson <rth@redhat.com>
-
- * longlong.h [alpha] (count_leading_zeros, count_trailing_zeros): Use
- builtins instead of inline assembly.
-
-2003-02-04 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
-
- PR c/9376
- * libgcc2.c (__subvdi3): Fix typo.
-
-2003-02-04 Jan Hubicka <jh@suse.cz>
-
- * i386.md (movti_rex64): Fix constraint.
-
-2003-02-04 Jan Hubicka <jh@suse.cz>
-
- * i386.md (vector push splitters): Fix typo in resolving conflict.
-
-2003-02-04 Rodney Brown <rbrown64@csc.com.au>
-
- * config/i386/i386.c (x86_function_profiler): Fix typo in format.
-
-2003-02-04 Phil Edwards <pme@gcc.gnu.org>
-
- * doc/install.texi (*-*-linux-gnu): Mention glibc requirements
- for recent libstdc++. Remove formatting cruft.
-
-2003-02-04 Jakub Jelinek <jakub@redhat.com>
-
- * dwarf2out.c (dwarf2out_finish): Add AT_comp_dir
- attribute even if input file name is absolute, but one of the
- includes is relative.
-
-2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk>
-
- * doc/gcc.texi, doc/gccint.texi, doc/gcov.texi,
- doc/include/fdl.texi, doc/invoke.texi: Update to GFDL 1.2.
- * doc/install.texi: Update copyright dates. Update to GFDL 1.2.
-
-2003-02-03 Richard Henderson <rth@redhat.com>
-
- * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
- __popcountsi2, __popcountdi2, __paritysi2, __paritydi2): Change
- return type to "int". Shuffle declarations and undef int trap.
- * libgcc2.h: Remove their declarations.
- * optabs.c (expand_unop): Force outmode to int for bitops.
-
-2003-02-03 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.c (order_regs_for_local_alloc): Order the
- coprocessor registers before floating-point registers.
- * config/xtensa/xtensa.h (REG_ALLOC_ORDER): Adjust register numbers
- to account for a previously removed register.
- (SPEC_REG_FIRST, SPEC_REG_LAST, SPEC_REG_NUM, COUNT_REGISTER_REGNUM):
- Delete unused macros.
-
-2003-02-03 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_expand_store_builtin): Always force op1 to register.
- (mov*_internal): Fix predicates; require one of operands to not be
- memory.
- (SSE?MMX move expanders): Fix predicates; force one of operands to
- register.
- (SSE/MMX push patterns): Reorganize; fix x86-64 code generation.
- (movups/movupd/movdqu patterns): Force one of operands to not be
- memory.
-
-2003-02-03 Roger Sayle <roger@eyesopen.com>
-
- * hooks.c (hook_rtx_rtx_identity): Generic hook function that
- takes a single rtx and returns it unmodified.
- * hooks.h (hook_rtx_rtx_identity): Prototype here.
- * target.h (struct gcc_target): Add "delegitimize_address"
- field to target structure.
- * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Provide default
- for delegitimize_address target using hook_rtx_rtx_identity.
- (TARGET_INITIALIZER): Initialize delegitimize_address field
- using TARGET_DELEGITIMIZE_ADDRESS macro.
- * simplify-rtx.c (avoid_constant_pool_reference): Handle float
- extensions of constant pool references. Use delegitimize_address
- to undo the obfuscation of "-fpic".
- * Makefile.in (simplify-rtx.o): Add dependency on target.h.
-
- * config/i386/i386.c (TARGET_DELEGITIMIZE_ADDRESS): Define as
- i386_simplify_dwarf_addr.
- (ix86_find_base_term): Simplify using i386_simplify_dwarf_addr.
- (maybe_get_pool_constant): Likewise.
-
-2003-02-03 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_expand_int_movcc): Fix setcc sign bit case.
-
-2003-02-03 Jan Hubicka <jh@suse.cz>
-
- * regclass.c (cannot_change_mode_set_regs): Correct argument order.
-
-2003-02-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * mips/_tilib.c: Don't include tsystem.h or defaults.h. Don't
- define LIBGCC2_WORDS_BIG_ENDIAN. Include coretypes.h and tm.h.
-
-2003-02-02 Andreas Schwab <schwab@suse.de>
-
- * varasm.c (asm_output_aligned_bss): Declare as possibly unused.
-
-2003-02-02 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (sibcall_epilogue): Set the "conds" to "clob".
- (epilogue_insns): Likewise.
-
-2003-02-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * doc/install.texi (hppa*-hp-hpux11*): Update installation notes.
-
-2003-02-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa-protos.h (attr_length_millicode_call): Remove second argument.
- (attr_length_indirect_call, attr_length_indirect_call,
- attr_length_save_restore_dltp): New prototypes.
- * pa.c (attr_length_millicode_call): Remove second argument. Check
- INSN_ADDRESSES_SET_P in distance calculation.
- (output_millicode_call): Check INSN_ADDRESSES_SET_P before using
- INSN_ADDRESSES.
- (attr_length_call): Check INSN_ADDRESSES_SET_P in distance calculation.
- (output_call): Check INSN_ADDRESSES_SET_P before using INSN_ADDRESSES.
- Call attr_length_call directly.
- (attr_length_indirect_call, output_indirect_call,
- attr_length_save_restore_dltp): New functions.
- * pa.md (attr_length_millicode_call): Drop second argument from all
- patterns.
- (return_internal_pic): Delete.
- (return_external_pic): Remove use of PIC register and pic operand and
- flag checks.
- (epilogue): Use return_internal for both normal and pic code.
- (call, call_value): Emit new 32-bit pic patterns for symref and
- indirect calls. Remove uses for arg pointer and pic register.
- (call_symref_pic, call_symref_pic_post_reload, call_reg_pic,
- call_reg_pic_post_reload, call_val_symref_pic,
- call_val_symref_pic_post_reload, call_val_reg_pic,
- call_val_reg_pic_post_reload): New pre and post reload insn patterns.
- Implement define_split and define_peephole2 patterns for pre reload
- patterns.
- (call_symref_64bit, call_internal_reg_64bit, call_value_symref_64bit,
- call_value_internal_reg_64bit): Shorten names.
- (all call patterns): Explicitly indicate registers used and clobbered.
- Use attr_length_indirect_call and attr_length_save_restore_dltp for
- attribute length calculation. Move code generation for indirect calls
- to output_indirect_call.
- (sibcall, sibcall_value): Don't restore PIC register.
- (exception_receiver, builtin_setjmp_receiver): Add blockage after PIC
- register retore.
-
-2003-02-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Testing): Simplify and compress instructions
- concerning Dejagnu.
-
-2003-02-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * collect2.c (pexecute_pid): Rename to pid.
- (collect_wait, collect_execute, scan_prog_file, scan_libraries): Use
- pid.
-
-2003-02-01 Geoffrey Keating <geoffk@apple.com>
-
- * doc/extend.texi (Function Attributes): Remove documentation
- for PowerPC Windows NT function attributes..
-
-2003-02-01 Daniel Jacobowitz <drow@mvista.com>
-
- * dwarf2out.c (gen_type_die): Check for typedefs before calling
- for TYPE_MAIN_VARIANT.
-
-2003-02-01 Richard Henderson <rth@redhat.com>
-
- * libgcc2.c: Include auto-host.h.
- (ATTRIBUTE_HIDDEN): New.
- (__clz_tab): Don't declare here for clz and ctz.
- (__clzsi2, __clzdi2): Use count_leading_zeros.
- (__ctzsi2, __ctzdi2): Use count_trailing_zeros.
- (__popcount_tab): Mark ATTRIBUTE_HIDDEN.
- (__paritysi2, __paritydi2): Use shifts instead of __popcount_tab.
- * longlong.h (__clz_tab): Mark ATTRIBUTE_HIDDEN.
-
-2003-02-01 Richard Henderson <rth@redhat.com>
-
- * config/i386/i386.md (addsi_1_zext splitter): Add TARGET_64BIT
- to the conditional.
- (ashlsi3_1_zext splitter): Likewise.
-
-2003-02-01 Richard Henderson <rth@redhat.com>
-
- * optabs.c (expand_unop): Use word_mode for outmode of bit scaners.
- * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
- __popcountsi2, __popcountdi2, __paritysi2 __paritydi2): Change
- return type to Wtype.
-
- * libgcc-std.ver (GCC_3.4): Fix inheritance.
-
- * config/i386/i386.md (ffssi2): Use nonimmediate_operand for
- expander input constraint.
-
-2003-02-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
-
- * optabs.h (optab_index): Add OTI_clz, OTI_ctz, OTI_popcount and
- OTI_parity.
- (clz_optab, ctz_optab, popcount_optab, parity_optab): New.
- * optabs.c (widen_clz, expand_parity): New.
- (expand_unop): Handle clz and parity. Hardcode SImode as outmode
- for libcalls to clz, ctz, popcount, and parity.
- (init_optabs): Init clz_optab, ctz_optab, popcount_optab and
- parity_optab, and set up libfunc handlers.
- * libgcc2.c (__clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
- __popcountsi2, __popcountdi2, __paritysi2 __paritydi2,
- __popcount_tab): New.
- * libgcc2.h: Declare them.
- * libgcc-std.ver (GCC_3.4): Add new functions from libgcc2.c.
- * genopinit.c (optabs): Add clz_optab, ctz_optab, popcount_optab
- and parity_optab.
- * builtin-types.def (BT_FN_INT_LONG, BT_FN_INT_LONGLONG): New.
- * builtins.def (BUILT_IN_CLZ, BUILT_IN_CTZ, BUILT_IN_POPCOUNT,
- BUILT_IN_PARITY, BUILT_IN_FFSL, BUILT_IN_CLZL, BUILT_IN_CTZL,
- BUILT_IN_POPCOUNTL, BUILT_IN_PARITYL, BUILT_IN_FFSLL,
- BUILT_IN_CLZLL, BUILT_IN_CTZLL, BUILT_IN_POPCOUNTLL,
- BUILT_IN_PARITYLL): New.
- * builtins.c (expand_builtin_unop): Rename from expand_builtin_ffs
- and add optab argument.
- (expand_builtin): Expand BUILT_IN_{FFS,CLZ,POPCOUNT,PARITY}*.
- * tree.def (CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, PARITY_EXPR): New.
- * expr.c (expand_expr): Handle them.
- * fold-const.c (tree_expr_nonnegative_p): Likewise.
- * rtl.def (CLZ, CTZ, POPCOUNT, PARITY): New.
- * reload1.c (eliminate_regs): Handle them.
- (elimination_effects): Likewise.
- * function.c (instantiate_virtual_regs_1): Likewise
- * genattrtab.c (check_attr_value): Likewise.
- * simplify-rtx.c (simplify_unary_operation): Likewise.
- * c-common.c (c_common_truthvalue_conversion): Handle POPCOUNT_EXPR.
- * combine.c (combine_simplify_rtx): Handle POPCOUNT and PARITY.
- (nonzero_bits): Handle CLZ, CTZ, POPCOUNT and PARITY.
- * config/alpha/alpha.md (clzdi2, ctzdi2, popcountdi2): New.
- * config/arm/arm.c (arm_init_builtins): Rename __builtin_clz to
- __builtin_arm_clz.
- * Makefile.in (LIB2FUNCS_1, LIB2FUNCS_2): Move...
- * mklibgcc.in (lib2funcs): ...here and merge. Add new members.
- * doc/extend.texi (Other Builtins): Add new builtins.
- * doc/md.texi (Standard Names): Add new patterns.
-
-2003-02-01 Ulrich Weigand <uweigand@de.ibm.com>
-
- * reload.c: Revert 2003-01-31 change.
-
-2003-02-01 Jan Hubicka <jh@suse.cz>
-
- * combine.c (combine_simplify_rtx): Use reversed_comparison_code_parts.
-
-2003-02-01 Richard Sandiford <rsandifo@redhat.com>
-
- * flags.h (flag_volatile): Remove declaration.
- (flag_volatile_global, flag_volatile_static): Likewise.
- * c-typeck.c (build_indirect_ref): Don't check flag_volatile.
- * toplev.c (flag_volatile): Remove definition.
- (flag_volatile_global, flag_volatile_static): Likewise.
- (f_options): Remove corresponding entries here.
- * varasm.c (make_decl_rtl): Don't check flag_volatile_global
- or flag_volatile_static.
- * doc/invoke.texi: Remove documentation of -fvolatile,
- -fvolatile-global and -fvolatile-static.
-
-2003-01-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa.c (pa_output_function_prologue, pa_output_function_epilogue): Move
- updating of total_code_bytes from prologue to epilogue.
-
-2003-01-31 Ulrich Weigand <uweigand@de.ibm.com>
-
- * reload.c (find_reloads): Do not use the mode specified in the insn
- pattern as reload mode for address operands. Do not generate optional
- reloads for operands where a mandatory reload was already pushed.
- Generate optional reloads only in the final pass though find_reloads.
- (have_replacement_p): New function.
-
-2003-01-31 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Testing): Remove a reference to our obsolete
- /testresults web pages and strip redundant information concerning
- test results.
- (Binaries): Refer to Microsoft Windows instead of listing all
- possible variants.
-
-2003-02-01 Jan Hubicka <jh@suse.cz>
-
- * loop.c (emit_prefetch_instructions): Do conversion at right place in
- RTL chain.
-
- * combine.c (simplify_set): Reverse order of ragumetns to
- REG_CANNOT_CHANGE_MODE_P
- * df.c (df_def_record_1): Likewise.
- * recog.c (register_operand): Likewise.
- * simplify-rtx.c (simplify_subreg): Likewise.
- * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): Update use of
- CANNOT_CHANGE_MODE_CLASS.
- * regclass.c (cannot_change_mode_set_regs, invalid_mode_change_p):
- Likewise.
- * reload.c (push_reload): Likewise.
- * alpha.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
- * ia64.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
- * mips.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
- * mips-protos.h (mips_cannot_change_mode_class): Update prototype.
- * mips.c (mips_cannot_change_mode_class): Update.
- * pa64-regs.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
- * rs6000.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
- * s390.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
- * sh.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
- * sh-protos.h (sh_cannot_change_mode_class): Update prototype.
- * sh.c (sh_cannot_change_mode_class): Update.
- * i386.h (CANNOT_CHANGE_MODE_CLASS): New.
- * tm.texi (CANNOT_CHANGE_MODE_CLASS): Update documentation.
-
-2003-01-31 Geoffrey Keating <geoffk@apple.com>
-
- * config/darwin.h (LINK_COMMAND_SPEC): Update for Nathan's recent
- change to LINK_COMMAND_SPEC in gcc.c.
-
-2003-01-31 Jan Hubicka <jh@suse.cz>
-
- PR c/9506
- * i386.c (override_options): Use DEFAULT_PCC_STRUCT_RETURN.
-
-2003-01-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa32-regs.h (REGNO_REG_CLASS, REG_CLASS_FROM_LETTER): Delete
- duplicated code.
-
-2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
-
- * tree.h (TYPE_BINFO_SIZE, TYPE_BINFO_SIZE_UNIT): Remove.
- (BINFO_ELTS): New #define.
- * stor-layout.c (finalize_record_size): Don't set them.
- * cp/cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
- BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
- (BINFO_LANG_ELTS): New #define.
- * cp/tree.c (make_binfo): Use BINFO_LANG_ELTS.
- * java/class.c (make_class): Use BINFO_ELTS.
- (set_super_info): Likewse.
- (add_interface_do): Likewise.
- * objc/objc-act.c (start_class): Use BINFO_ELTS.
-
-2003-01-31 Danny Smith <dannysmith@users.sourceforge.net>
-
- * timevar.c (getrusage): Don't ever declare if not HAVE_GETRUSAGE.
- (times): Don't ever declare if not HAVE_TIMES.
- (clock): Don't ever declare if not HAVE_CLOCK.
-
-2003-01-30 Richard Henderson <rth@redhat.com>
-
- * flow.c (update_life_info): Zap life info after cleanup_cfg.
- (regno_uninitialized): Use correct live at function entry set.
- (regno_clobbered_at_setjmp): Likewise.
-
- * expr.c (store_expr): Promote all MEM intermediates to regs.
-
-2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/arm/arm.c: Fix comment typos.
- * config/arm/arm.h: Likewise.
- * config/arm/netbsd-elf.h: Likewise.
- * config/arm/netbsd.h: Likewise.
-
-2003-01-30 Geoffrey Keating <geoffk@apple.com>
-
- * gengtype.c (struct walk_type_data): Add needs_cast_p.
- (walk_type): Set needs_cast_p in walk_type_data.
- (write_types_process_field): Supply casts when required to suppress
- warnings.
- (write_root): Cast gt_pch_n_S to suppress warning.
- * Makefile.in: Remove -Wno-error from gtype-desc.o and c-decl.o.
- * config/rs6000/rs6000.c (print_operand): Mask off high bits only
- when they might exist.
- * config/rs6000/t-rs6000: Remove -Wno-error from varasm.o,
- insn-conditions.o, and rs6000.o.
-
-2003-01-30 Richard Henderson <rth@redhat.com>
-
- * ggc-page.c (G.context_depth_allocations): New.
- (G.context_depth_collections): New.
- (alloc_page): Set G.context_depth_allocations.
- (ggc_collect): Set G.context_depth_collections.
- (ggc_push_context): Limit to HOST_BITS_PER_LONG contexts.
- (ggc_pop_context): Early exit for no allocations or collections.
-
-2003-01-30 Richard Henderson <rth@redhat.com>
-
- * tree-inline.c (walk_tree): Streamline duplicate hash table lookup.
-
-2003-01-30 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (arm_compute_initial_elimination_offset): If optimizing for
- size, the link register is always saved if any other register is
- saved.
-
-2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Update the prototype for
- compute_plussi_cc.
- (cpp_reader): Declare before it is used.
- * config/h8300/h8300.c (compute_plussi_cc): Change the return
- type to int.
- * config/h8300/h8300.md (monitor_prologue): Call abort() if we
- see an unknown H8 variant.
-
-2003-01-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- PR target/9316
- * config/rs6000/rtems.h: Add CPP_OS_DEFAULT_SPEC.
- * config/rs6000/sysv4.h: Add CPP_OS_RTEMS_SPEC.
- * config/rs6000/t-rtems: New file. multilib variants to match OS.
- * config.gcc (powerpc-*-rtems*): Use rs6000/t-rtems instead of
- rs6000/t-ppcgas so we get the desired multilibs.
-
-2003-01-30 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.c (arm_output_epilogue): Update stack pointer
- when popping saved IP register off the stack.
-
-2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/rs6000/aix43.h: Fix comment typos.
- * config/rs6000/aix51.h: Likewise.
- * config/rs6000/aix52.h: Likewise.
- * config/rs6000/altivec.h: Likewise.
- * config/rs6000/rs6000.c: Likewise.
- * config/rs6000/rs6000.h: Likewise.
- * config/rs6000/rs6000.md: Likewise.
- * config/rs6000/spe.md: Likewise.
-
-2003-01-29 Mark Mitchell <mark@codesourcery.com>
-
- * c-common.c (builtin_define_float_constants): Define
- __<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__.
-
-2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/sh/lib1funcs.asm: Fix comment typos.
- * config/sh/linux.h: Likewise.
- * config/sh/sh.c: Likewise.
- * config/sh/sh.md: Likewise.
-
-2003-01-30 Loren James Rittle <ljrittle@acm.org>
-
- * objc/Make-lang.in (objc-parse.y): Find c-parse.in in $(srcdir).
-
-2003-01-30 Alexandre Oliva <aoliva@redhat.com>
-
- * config/fp-bit.h (__make_dp): Declare if TMODES.
-
-2003-01-29 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.h (PREDICATE_CODES): Add entries for
- general_operand_src and general_operand_dst.
-
-2003-01-29 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (function_arg_pass_by_reference):
- Return true for variable sized types.
- (rs6000_va_arg): Handle variable sized types passed by reference
- on non-SVR4 ABI.
-
-2003-01-29 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (arm_legtimize_address): New function.
- * arm-protos.h (arm_legtimize_address): Add prototype.
- * arm.h (ARM_LEGITIMIZE_ADDRESS): Use arm_legitimize_address.
- (LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS): Wrap with
- do ... while (0)
-
-2003-01-29 Joel Sherrill <joel@OARcorp.com>
-
- PR bootstrap/9296
- * gthr-rtems.h: Define __GTHREAD_MUTEX_INIT. Apparently no code
- depended on it being defined until now.
-
-2003-01-29 Joel Sherrill <joel@OARcorp.com>
-
- PR target/9295
- * config/mips/rtems.h: Predefine __USE_INIT_FINI__ so generic
- RTEMS code knows which C++ initialization style the toolset
- configuration is using.
-
-2003-01-29 Joel Sherrill <joel@OARcorp.com>
-
- PR bootstrap/9293
- * config/m68k/t-crtstuff: Replace spaces with tabs, add
- $(MULTILIB_CFLAGS) as compiler option and multilib crtbegin/end.o.
-
-2003-01-29 Joel Sherrill <joel@OARcorp.com>
-
- PR bootstrap/9292
- * config.gcc (hppa1.1-rtems): Did not include t-rtems nor enable
- RTEMS threads.
- * config/pa/rtems.h (LIB_SPEC): Use -N when linking.
-
-2003-01-29 Nick Clifton <nickc@redhat.com>
-
- * Makefile.in (c-parse.o): Locate source file in $(parsedir)
- not $(srcdir).
-
-2003-01-29 Andrew Haley <aph@redhat.com>
-
- * tree-inline.c (walk_tree): Add CHAR_TYPE.
-
-2003-01-29 Jan Hubicka <jh@suse.cz>
-
- * i386.md (subdi3_carry_rex64): Fix typo.
-
-2003-01-28 Stan Shebs <shebs@apple.com>
-
- * coretypes.h (cpp_reader): Forward declare struct.
- * c-pragma.h (cpp_reader): Remove forward declaration.
- * hashtable.h (cpp_reader): Likewise.
- * scan.h (cpp_reader): Likewise.
- * tree.h (cpp_reader): Likewise.
- * config/darwin-protos.h (cpp_reader): Likewise.
- * config/arm/arm-protos.h (cpp_reader): Likewise.
- * config/rs6000/rs6000-protos.h: Remove GCC_CPPLIB_H ifdef, use
- struct cpp_reader in prototypes.
-
-2003-01-28 Christian Cornelssen <ccorn@cs.tu-berlin.de>
-
- * doc/install.texi: Add documentation for installation into
- tooldirs and with DESTDIR.
-
-2003-01-28 Richard Henderson <rth@redhat.com>
-
- * config.gcc (ia64*-*-aix*): Remove.
- * config/ia64/aix.h, config/ia64/t-aix: Remove file.
- * config/ia64/unwind-aix.c: Remove file.
-
-2003-01-28 Andreas Schwab <schwab@suse.de>
-
- * config/m68k/m68k.md (tablejump+2): Don't sign extend an address
- register.
- * config/m68k/apollo68.h (ASM_RETURN_CASE_JUMP): Likewise.
- * config/m68k/coff.h (ASM_RETURN_CASE_JUMP): Likewise.
- * config/m68k/linux.h (ASM_RETURN_CASE_JUMP): Likewise.
- * config/m68k/m68kelf.h (ASM_RETURN_CASE_JUMP): Likewise.
- * config/m68k/mot3300.h (ASM_RETURN_CASE_JUMP): Likewise.
- * config/m68k/netbsd-elf.h (ASM_RETURN_CASE_JUMP): Likewise.
- * config/m68k/pbb.h (ASM_RETURN_CASE_JUMP): Likewise.
-
-2003-01-28 Richard Sandiford <rsandifo@redhat.com>
-
- * combine.c (nonzero_bits): Fix check for negative divide operands.
-
-2003-01-28 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (ia64_rwreloc_section_type_flags): New.
- * config/ia64/hpux.h (TARGET_SECTION_TYPE_FLAGS): New.
-
-2003-01-28 Richard Henderson <rth@redhat.com>
-
- * cse.c (find_best_addr): Kill !ADDRESS_COST code.
-
- * config/cris/cris.c (cris_address_cost): Make static.
- (TARGET_RTX_COSTS, TARGET_ADDRESS_COST): New.
- * config/cris/cris.h (ADDRESS_COST): Remove.
- * config/cris/cris-protos.h: Update.
-
-2003-01-23 Mike Stump <mrs@apple.com>
-
- * regclass.c (init_reg_autoinc): New function.
- (regclass): Move initialization of forbidden_inc_dec_class from
- here...
- (init_regs): to here. Avoids reinitialization for each function,
- saving compilation time.
-
-2003-01-28 Jason Merrill <jason@redhat.com>
-
- * cpplib.h (struct cpp_options): Add warn_deprecated field.
- * cppinit.c (cpp_create_reader): Turn it on by default.
- * c-opts.c (c_common_decode_option): Set it.
- * cpplib.c (do_pragma_once): Only complain about #pragma once
- if warn_deprecated is set.
-
-2003-01-28 Dale Johannesen <dalej@apple.com>
-
- * emit-rtl.c (const_double_htab_hash): Use mode in the hash.
- * loop.c (scan_loop): Move movables on -Os rich-register targets.
- * config/rs6000/rs6000.md (sibcall*): Use match_operand for LR.
-
-2003-01-28 Richard Henderson <rth@redhat.com>
-
- * target.h (targetm.address_cost): New.
- * target-def.h (TARGET_ADDRESS_COST): New.
- (TARGET_RTX_COSTS): Uncomment. Oops.
- * cse.c (address_cost): Use new target hook.
- (default_address_cost): New.
- * output.h (default_address_cost): Declare.
- * hooks.c (hook_int_rtx_0): New.
- * hooks.h (hook_int_rtx_0): Declare.
- * loop.c (combine_givs_p): Remove if 0 code.
- * system.h (ADDRESS_COST): Poison.
-
- * config/alpha/alpha.c, config/alpha/alpha.h, config/d30v/d30v.c,
- config/d30v/d30v.h, config/ia64/ia64.c, config/ia64/ia64.h,
- config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c,
- config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.h,
- config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/sparc/sparc.c,
- config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h,
- config/xtensa/xtensa.c, config/xtensa/xtensa.h
- (TARGET_ADDRESS_COST): Define as hook_int_rtx_0.
- (ADDRESS_COST): Remove.
-
- * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h,
- config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h,
- config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h,
- config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c,
- config/dsp16xx/dsp16xx.h, config/i386/i386-protos.h,
- config/i386/i386.c, config/i386/i386.h, config/i960/i960-protos.h,
- config/i960/i960.c, config/i960/i960.h, config/ip2k/ip2k-protos.h,
- config/ip2k/ip2k.c, config/ip2k/ip2k.h, config/mips/mips-protos.h,
- config/mips/mips.c, config/mips/mips.h,
- config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c,
- config/m68hc11/m68hc11.h, config/ns32k/ns32k-protos.h,
- config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-protos.h,
- config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h,
- config/s390/s390.c, config/s390/s390.h, config/vax/vax-protos.h,
- config/vax/vax.c, config/vax/vax.h
- (foo_address_cost): Make static.
- (TARGET_ADDRESS_COST): New.
- (ADDRESS_COST): Remove.
-
- * config/arm/arm.h, config/arm/arm.c, config/m88k/m88k.h,
- config/m88k/m88k.c, config/romp/romp.h, config/romp/romp.c,
- config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c,
- config/stormy16/stormy16.h
- (ADDRESS_COST): Move code ...
- (foo_address_cost): ... here.
- (TARGET_ADDRESS_COST): New.
-
- * config/m32r/m32r.c (m32r_address_cost): Remove.
- * config/m32r/m32r-protos.h: Update.
-
- * config/mmix/mmix.c (mmix_address_cost): Remove.
- * config/mmix/mmix-protos.h: Update.
-
- * config/mn10300/mn10300.c (mn10300_address_cost_1): Rename from
- mn10300_address_cost; move unsig allocation ...
- (mn10300_address_cost): ... here.
- (TARGET_ADDRESS_COST): New.
- * config/mn10300/mn10300-protos.h: Update.
- * config/mn10300/mn10300.h (ADDRESS_COST): Remove.
-
- * doc/tm.texi: Update.
-
-2003-01-28 Vladimir Makarov <vmakarov@redhat.com>
-
- * haifa-sched.c (schedule_insn): Return necessary cycle advance
- after issuing the insn.
- (rank_for_schedule): Make a insn with /S the highest priority
- insn.
- (move_insn): Ignore schedule groups. Clear SCHED_GROUP_P.
- (choose_ready): Check SCHED_GROUP_P.
- (schedule_block): Advance cycle after issuing insn if it is
- necessary. Don't reorder insns if there is an insn with /S.
- (set_priorities): Ignore schedule groups.
-
- * sched-deps.c (remove_dependence, group_leader): Remove the
- functions.
- (add_dependence): Ignore schedule groups.
- (set_sched_group_p): Don't make copy of dependencies from previous
- insn of the schedule group. Add anti-dependency to the previous
- insn of the schedule group.
- (compute_forward_dependences): Ignore schedule groups.
-
- * sched-ebb.c (init_ready_list): Ignore schedule groups.
-
- * sched-rgn.c (init_ready_list): Ditto.
- (can_schedule_ready_p): Ditto.
-
-2003-01-28 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/i386/i386.md (*movsi_1): Use movdqa to move one xmm
- register to another one.
-
-2003-01-28 Richard Henderson <rth@redhat.com>
-
- * calls.c (default_must_pass_in_stack): Fix typo in !type case.
-
-2003-01-28 Roger Sayle <roger@eyesopen.com>
-
- * cse.c (cse_insn): Avoid redundant REG_EQUAL notes.
-
-2003-01-28 Richard Sandiford <rsandifo@redhat.com>
-
- * config/sh/sh.h (CLASS_MAX_NREGS): If TARGET_SHMEDIA, and the given
- class contains a floating-point register, return the size of the
- mode in half words.
-
-2003-01-28 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_carry_flag_operator): New predicate.
- (fcmov_operator): Fix whitespace.
- (ix86_expand_carry_flag_compare): Deal with floating point.
- (ix86_expand_int_movcc): Deal with fp; update insn expansion
- (ix86_expand_int_addcc): Likewise.
- (ix86_expand_strlensi_unroll_1): likewsie.
- * i386.h (PREDICATE_CODES): Add ix86_carry_flag_operator.
- * i386.md (add?i_carry_rex64): Use new predicate.
- (sub?i3_carry_rex64): Likewise.
- (x86_mov?icc_0_m1*): Likewise.
-
-2003-01-28 Andreas Schwab <schwab@suse.de>
-
- * cfgloopmanip.c (create_preheader): Initialize src to avoid
- warning.
-
- * expmed.c (emit_store_flag): Fix cast to avoid sign
- comparison warning.
-
- * combine.c (force_to_mode): Add cast to fix warning when
- STORE_FLAG_VALUE is negative.
-
-2003-01-27 Richard Henderson <rth@redhat.com>
-
- * Makefile.in (cse.o): Depend on TARGET_H.
- * cse.c (rtx_cost): Use targetm.rtx_costs.
- * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison.
- * doc/tm.texi: Update.
-
- * target.h (targetm.rtx_costs): New.
- * target-def.h (TARGET_RTX_COSTS): New.
- * hooks.c (hook_bool_rtx_int_int_intp_false): New.
- * hooks.h: Update.
-
- * config/alpha/alpha.c (alpha_rtx_cost_data): New.
- (alpha_rtx_costs, TARGET_RTX_COSTS): New.
- * config/alpha/alpha.h (PROCESSOR_MAX): New.
- (CONST_COSTS, RTX_COSTS): Remove.
-
- * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c,
- config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h,
- config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c,
- config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h,
- config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c,
- config/i370/i370.h, config/i386/i386.c, config/i386/i386.h,
- config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c,
- config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h,
- config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c,
- config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h,
- config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c,
- config/mn10200/mn10200.h, config/mn10300/mn10300.c,
- config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h,
- config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c,
- config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h,
- config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c,
- config/s390/s390.h, config/sh/sh.c, config/sh/sh.h,
- config/stormy16/stormy16.c, config/stormy16/stormy16.h,
- config/v850/v850.c, config/v850/v850.h,
- config/xtensa/xtensa.c, config/xtensa/xtensa.h
- (CONST_COSTS, RTX_COSTS): Move code ...
- (foo_rtx_costs, TARGET_RTX_COSTS): ... here.
-
- * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs.
- (arm_rtx_costs, TARGET_RTX_COSTS): New.
- * config/arm/arm-protos.h: Update.
- * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove.
-
- * config/avr/avr.h (CONST_COSTS): Move code ...
- * config/avr/avr.c (avr_rtx_costs): ... here.
- (default_rtx_costs): Make static.
- * config/avr/avr-protos.h: Update.
-
- * config/h8300/h8300.c (const_costs): Make static.
- (h8300_and_costs, h8300_shift_costs): Likewise.
- * config/h8300/h8300-protos.h: Update.
-
- * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove.
- (CONST_COSTS): Move code ...
- * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from
- default_rtx_costs; update for signature change.
- * config/ip2k/ip2k-protos.h: Update.
-
- * config/m68hc11/m68hc11.h (RTX_COSTS): Remove.
- (CONST_COSTS): Move code ...
- * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here.
- (TARGET_RTX_COSTS): New.
- (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static.
- * config/m68hc11/m68hc11-protos.h: Update.
-
- * config/m68k/m68k.c (const_int_cost): Make static.
- * config/m68k/m68k-protos.h: Update.
-
- * config/mcore/mcore.c (mcore_const_costs): Make static.
- (mcore_and_cost, mcore_ior_cost): Likewise.
- * config/mcore/mcore-protos.h: Update.
-
- * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New.
- (mmix_rtx_cost_recalculated): Remove.
- * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove.
- * config/mmix/mmix-protos.h: Update.
-
- * config/sh/sh.c (shiftcosts): Make static.
- (addsubcosts, andcosts, multcosts): Likewise.
- * config/sh/sh-protos.h: Update.
-
- * config/sparc/sparc.c (TARGET_RTX_COSTS): New.
- (sparc_rtx_costs): Make static; update for change in signature.
- * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove.
- * config/sparc/sparc-protos.h: Update.
-
- * config/v850/v850.c (const_costs): Make static.
- * config/v850/v850-protos.h: Update.
-
- * config/vax/vax.h (RTX_COSTS): Remove.
- (CONST_COSTS): Move code ...
- * config/vax/vax.c (vax_rtx_costs_1): ... here; rename
- from vax_rtx_cost.
- (vax_rtx_costs, TARGET_RTX_COSTS): New.
-
-2003-01-27 Richard Henderson <rth@redhat.com>
-
- * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Remove. Really.
- * config/vax/vax-protos.h: Update. Really.
-
-2003-01-28 Alexandre Oliva <aoliva@redhat.com>
-
- * config/mips/mips.h (UNITS_PER_HWFPVALUE): Renamed from...
- (UNITS_PER_FPVALUE): Defined as the width of a long double, or
- zero if no hardware floating point.
- (LONG_DUBLE_TYPE_SIZE): Set to 128 on N32 and N64.
- (MAX_FIXED_MODE_SIZE): Define to LONG_DOUBLE_TYPE_SIZE.
- (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define.
- (BIGGEST_ALIGNMENT): Same as LONG_DOUBLE_TYPE_SIZE.
- (FUNCTION_VALUE_REGNO_P): Set for FP_RETURN+2 on N32 and N64.
- * config/mips/mips.c (mips_arg_info): Pass TFmode values in
- even FP registers on N32 and N64.
- (mips_setup_incoming_varargs): Use UNITS_PER_HWFPVALUE.
- (mips_va_start): Adjust alignment of ARG_POINTER_REGNUM.
- (mips_va_arg): Use UNITS_PER_HWFPVALUE. Impose additional
- even-register-like alignment to 128-bit arguments.
- (save_restore_insns): Use UNITS_PER_HWFPVALUE.
- (mips_function_value): Likewise. Return TFmode in $f0 and $f2
- on N32 or N64.
- * config/mips/_tilib.c (__negti2, __ashlti3, __lshrti3): New.
- * config/mips/t-iris6 (LIB2FUNCS_EXTRA): Add _tilib.c.
- (TPBIT): Set to tp-bit.c.
- (tp-bit.c): Create out of fp-bit.c.
-
-2003-01-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * c-parse.in: Remove '%expect 32' directive in objc mode.
-
-2003-01-27 Nathan Sidwell <nathan@codesourcery.com>
-
- * Makefile.in (LIB2FUNCS_ST): Remove _gcov.
- (LIBGCOV): New variable.
- (libgcc.mk): Add LIBGCOV.
- (LIBGCC_DEPS): Add libgcov.c.
- (libgcov.a): New target.
- (clean): Remove libgcov.a.
- (install-libgcc): Do libgcov too.
- (stage1-start, stage2-start, stage3-start, stage4-start): Deal
- with libgcov.a.
- * libgcc2.c (L_gcov): Move into ...
- * libgcov.c: ... here. New file.
- * mklibgcc.in: Add libgcov rules.
- * gcc.c (LINK_COMMAND_SPEC): Add -lgcov when profiling.
-
- * doc/invoke.texi (profile-arcs, test-coverage): Update and
- clarify.
-
- * profile.c (index_counts_file): Remove duplicate check for open file.
-
-2003-01-27 Jerry Quinn <jlquinn@optonline.net>
-
- * gcc/doc/invoke.texi (Optimization Options): Group together
- optional and experimental flags. Move trapv and bounds-check
- out of this section. Group floating point flags together.
- (Code Gen Options): Move trapv and bounds-check to here.
-
-2003-01-27 Josef Zlomek <zlomekj@suse.cz>
-
- * gcse.c (constprop_register): Check NEXT_INSN (insn) != NULL.
-
-2003-01-27 Richard Earnshaw <rearnsha@arm.com>
-
- PR optimization/9090
- * function.c (purge_addressof_1): After pushing an addressed register
- onto the stack, simplify the result.
-
-2003-01-27 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * doc/extend.texi: Fix typo.
-
-2003-01-27 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * doc/cppopts.texi: Fix typo.
- * doc/objc.texi: Likewise.
- * doc/passes.texi: Likewise.
-
-2003-01-27 Alexandre Oliva <aoliva@redhat.com>
-
- * real.c (ibm_extended_format): Add 53 to minimum exponent.
- (encode_ibm_extended): Adjust.
-
-2003-01-26 Gabriel Dos Reis <gdr@soliton.integrable-solutions.net>
-
- * timevar.def (TV_OVERLOAD, TV_TEMPLATE_INSTANTIATION): New
- timevar_id enumerations.
-
-2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * combine.c: Fix formatting.
-
-2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/gccint.texi: Update the copyright.
-
-2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * doc/cpp.texi: Fix typos.
- * doc/extend.texi: Likewise.
- * doc/gty.texi: Likewise.
- * doc/install.texi: Likewise.
- * doc/passes.texi: Likewise.
- * doc/rtl.texi: Likewise.
- * doc/tm.texi: Likewise.
-
-2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/ia64/fde-glibc.c: Fix comment typos.
- * config/ia64/hpux.h: Likewise.
- * config/ia64/ia64.c: Likewise.
- * config/ia64/ia64.h: Likewise.
- * config/ia64/unwind-ia64.c: Likewise.
-
-2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/i386/i386-modes.def: Fix comment typos.
- * config/i386/i386.c: Likewise.
- * config/i386/i386.md: Likewise.
-
-2003-01-26 Steven Bosscher <s.bosscher@student.tudelft.nl>
-
- * config/avr/avr.h, config/cris/aout.h, config/elfos.h,
- config/i386/freebsd-aout.h, config/mips/iris6.h: Undefine
- ASM_FINISH_DECLARE_OBJECT before defining it.
- * toplev.c (rest_of_decl_compilation): Don't define
- ASM_FINISH_DECLARE_OBJECT. Only use it if it is defined.
- (rest_of_type_compilation): Don't ATTRIBUTE_UNUSED function
- parameters for DWARF2 targets because they _are_ used.
-
-2003-01-26 Alexandre Oliva <aoliva@redhat.com>
-
- * fp-bit.h: Define macros for TFmode floating-point constants
- in IBM-extended TFmode types.
- (TMODES): Define if __LDBL_MANT_DIG__ has the newly-supported
- widths.
- * config/fp-bit.c (pack_d, unpack_d): Support IBM-extended
- TFmode type.
-
- * config/fp-bit.h: Define macros for TFmode floating-point
- constants in IEEE quad TFmode type. Declare functions according
- to L_ macros.
- (TMODES): Define if __LDBL_MANT_DIG__ is 113.
- (TFtype, TItype, UTItype): Define if TMODES is defined.
- (MAX_UDI_INT, MAX_DI_INT, BITS_PER_DI): Likewise.
- (F_T_BITOFF, D_T_BITOFF): Define.
- (IMPLICIT_1, IMPLICIT_2): Cast constants to types that are
- guaranteed to be wide enough.
- * config/fp-bit.c: Check for L_ macros for tf functions.
- (__thenan_tf): New.
- (nan): Adjust.
- (pack_d, unpack_d): Support IEEE 854 quad type.
- (_fpmul_parts): Support TFmode. Compute exponent adjustment
- from FRAC_NBITS, FRAC_BITS and NGARDS.
- (usi_to_float): Cast constants to be shifted to fractype
- instead of assuming long long is wide enough.
- (sf_to_tf, df_to_tf, __make_tp, tf_to_df, tf_to_sf): New.
-
-2003-01-26 Andreas Jaeger <aj@suse.de>
-
- * df.c: Remove prototype of unused function df_regno_rtl_debug.
-
-2003-01-26 Alexandre Oliva <aoliva@redhat.com>
-
- * Makefile.in (FPBIT_FUNCS): Added _sf_to_tf.
- (DBBIT_FUNCS): Added _df_to_tf.
- (TPBIT_FUNCS): New.
- (libgcc.mk): Pass TPBIT and TPBIT_FUNCS down.
- (LIBGCC_DEPS): Added TPBIT.
- * mklibgcc.in: Support TPBIT and TPBIT_FUNCS.
-
- * optabs.c (expand_binop) <add, sub>: Return xtarget if we haven't
- been able to move the result to target.
-
- * expr.c (emit_group_store): Initialize dst with CONST0_RTX
- for the appropriate mode.
-
- * calls.c (emit_library_call_value_1): Handle return values
- in a PARALLEL.
-
- * rtl.c (get_mode_alignment): Moved to...
- * stor-layout.c: ... here.
-
- * print-rtl.c (print_rtx): Don't print MEM details in
- GENERATOR_FILEs.
-
-2003-01-26 Michael Hayes <mph@paradise.net.nz>
-
- * df.h: Update comments, tidy formatting.
- (DF_FORWARD, DF_REVERSE, DF_UNION, DF_INTERSECTION): Rename from FORWARD,
- REVERSE, UNION, INTERSECTION. All uses updated.
- (OLD_DF_INTERFACE): Remove.
- (struct insn_info): Remove commented out insn field.
- * df.c: Update comments, tidy formatting.
- (df_def_table_realloc): Remove.
-
-
-2003-01-26 Alan Modra <amodra@bigpond.net.au>
-
- * calls.c (save_fixed_argument_area): Tidy.
- (restore_fixed_argument_area): Tidy. Set alignment of stack_area.
- (expand_call): Comment typo fixes. Don't init low_to_save. Start
- call chain loop at 1 if !try_tail_call. Formatting.
- (emit_library_call_value_1): Don't init low_to_save or high_to_save.
- Use save_fixed_argument_area and restore_fixed_argument_area.
-
-2003-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
-
- * df.c (df_uses_record): Handle CC0.
-
-2003-01-25 Ulrich Weigand <uweigand@de.ibm.com>
-
- * reload.c (maybe_memory_address_p): New function.
- (find_reloads_address): Use it instead of memory_address_p.
-
-2003-01-25 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * final.c (shorten_branches): Align the address of code label
- when computing initial lengths and addresses.
-
-2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/m68hc11/m68hc11.md: Fix a comment typo.
-
-2003-01-25 Andreas Jaeger <aj@suse.de>
-
- * config/i386/i386.c (x86_output_mi_thunk): Correct test for
- TARGET_MACHO.
-
-2003-01-25 Roger Sayle <roger@eyesopen.com>
-
- * gcse.c (bypass_last_basic_block): New global variable.
- (bypass_block): Use redirect_edge_and_branch_force to redirect
- fall-through edges. Use bypass_last_basic_block to determine
- which blocks have valid PRE information.
- (bypass_conditional_jumps): Initialize bypass_last_basic_block.
-
-2003-01-25 Jan Hubicka <jh@suse.cz>
-
- * gcse.c (local_cprop_pass): Update reg_sets table when needed.
-
-2003-01-25 Jan Hubicka <jh@suse.cz>
- Eric Botcazou <ebotcazou@libertysurf.fr>
- PR opt/8492
- * gcse.c (one_cprop_pass): Delete unreachable blocks.
-
-2003-01-25 Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.c (ia64_rwreloc_select_rtx_section): Rename
- from ia64_aix_select_rtx_section.
- (ia64_rwreloc_select_section): Simlarly; use default*_1 function
- instead of saving and restoring flag_pic.
- (ia64_rwreloc_unique_section): Similarly.
- * config/ia64/aix.h (TARGET_ASM_SELECT_SECTION,
- TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Update.
- * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION,
- TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): New.
-
-2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (h8300_shift_needs_scratch_p): Update a
- comment.
-
-2003-01-25 Richard Henderson <rth@redhat.com>
-
- * config/m68k/m68k-none.h (ASM_SPEC): Adjust inter-option spacing.
-
-2003-01-25 Kelley Cook <kelleycook@comcast.net>
-
- * ggc-simple.c (debug_ggc_tree): Add PTR cast.
-
-2003-01-25 Segher Boessenkool <segher@koffie.nl>
-
- * bitmap.h (BITMAP_WORD): New typedef: fundamental storage
- type for bitmaps. Use unsigned long.
- (nBITMAP_WORD_BITS): New macro.
- (BITMAP_WORD_BITS): New macro.
- (rest of file): Use it.
- * bitmap.c: Use it.
-
-2003-01-25 Richard Henderson <rth@redhat.com>
-
- 2002-02-19 Robert Lipe <robertlipe@usa.net>
- * config/i386/t-sco5gas: (CRTSTUFF_T_CFLAGS_S): Delete -mcoff.
-
-2003-01-25 Roger Sayle <roger@eyesopen.com>
-
- * builtins.c (purge_builtin_constant_p): Scan insn stream
- sequentially rather than by basic block.
- * function.c (purge_addressof): Simplify test with INSN_P.
-
-2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * combine.c (simplify_comparison, case AND): Remove a redundant test.
-
-2003-01-25 Roger Sayle <roger@eyesopen.com>
-
- * function.h (struct function): New field calls_constant_p.
- (current_function_calls_constant_p): New macro for above.
- * function.c (prepare_function_start): Initialize calls_eh_return
- and calls_constant_p.
- * builtins.c (expand_builtin_constant_p): Set calls_constant_p.
- * toplev.c (rest_of_compilation): Only call purge_builtin_constant_p
- when the current_function_calls_constant_p.
- * integrate.c (expand_inline_function): Set calls_constant_p if
- the function being inlined has calls_constant_p set.
-
-2003-01-25 Roger Sayle <roger@eyesopen.com>
-
- * cse.c (fold_rtx): Instantiate CONSTANT_P_RTX to 0 when not
- optimizing, even if flag_gcse is true.
- * toplev.c (rest_of_compilation): purge_builtin_constant_p
- only needs to be called when "optimize > 0 && flag_gcse".
-
-2003-01-25 Roger Sayle <roger@eyesopen.com>
-
- * stmt.c (emit_case_bit_tests): New routine to implement suitable
- switch statements using the equivalent of "if ((1<<x) & cst) ... ".
- (case_bit_test_cmp): New comparison function for "qsort" to order
- case_bit_tests by decreasing number of destination nodes.
- (lshift_cheap_p): New function to determine if "1 << x" is cheap.
- (expand_end_case_type): Use emit_case_bit_tests to implement
- suitable switch statments.
- (CASE_USE_BIT_TESTS): New target macro to disable the above.
- * Makefile.in (stmt.o): Add dependency on optab.h.
- * doc/tm.texi (CASE_USE_BIT_TESTS): Document new target macro.
-
-2003-01-23 Andreas Schwab <schwab@suse.de>
-
- * config/ia64/crtend.asm [HAVE_INITFINI_ARRAY]: Make
- __do_global_ctors_aux hidden global and don't put it in
- .init_array.
- * config/ia64/crtbegin.asm [HAVE_INITFINI_ARRAY]: Put it here
- instead so that it comes first.
-
-2003-01-25 Jan Hubicka <jh@suse.cz>
-
- * df.c (read_modify_subreg_p): When osize == UNITS_PER_WORD,
- subreg is read/modify.
-
-2003-01-25 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_expand_movstr, ix86_expand_clrstr): Consistently
- do libcall for large blocks.
- * i386.md (comi patterns): Set type to ssecomi.
- (sse2_unpck?pd): Fix mode of vec_select.
-
- * cse.c: Include except.h
- (cse_set_around_loop): Do not create new basic blocks.
- * Makefile.in (cse.o): Add dependnecy on except.h
-
-2003-01-25 Jan Hubicka <jh@suse.cz>
-
- * builtins.c (fold_trunc_transparent_mathfn): New function.
- (fold_builtin): Use it.
- * convert.c (convert_to_real): Re-enable code to convert
- math functions; add support for floor familly functions.
-
-2003-01-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * Makefile.in (cfgloop.o, cfgloopanal.o, cfgloopmanip.o): Add
- dependencies on coretypes.h and $(TM_H).
-
-2003-01-25 Jan Hubicka <jh@suse.cz>
-
- * builtins.c (fold_trunc_transparent_mathfn): Undo accidental commit.
-
-2003-01-24 Stuart Hastings <stuart@apple.com>
-
- * config/i386/i386.c (x86_output_mi_thunk): Add Darwin/x86 support.
-
-2003-01-25 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
-
- * config/c4x/c4x.md (UNSPEC_BU): New constants.
- (UNSPEC_RPTS, UNSPEC_LSH, UNSPEC_CMPHI, UNSPEC_RCPF): Likewise.
- (UNSPEC_RND, UNSPEC_RPTB_FILL, UNSPEC_LOADHF_INT): Likewise.
- (UNSPEC_STOREHF_INT, UNSPEC_RSQRF, UNSPEC_LOADQF_INT): Likewise.
- (UNSPEC_STOREQF_INT, UNSPEC_LDIV, UNSPEC_PUSH_ST): Likewise.
- (UNSPEC_POP_ST, UNSPEC_PUSH_DP, UNSPEC_POP_DP): Likewise.
- (UNSPEC_POPQI, UNSPEC_POPQF, UNSPEC_ANDN_ST): Likewise.
- (UNSPEC_RPTB_INIT, UNSPEC_TOIEEE, UNSPEC_FRIEEE): Likewise.
-
-2003-01-24 Jan Hubicka <jh@suse.cz>
-
- * emit-rtl.c (reg_attrs_htab): New static variable.
- (reg_attrs_htab_hash, reg_attrs_htab_eq, get_reg_attrs): New static
- functions.
- (reg_rtx): Do not maintain regno_decl.
- (gen_rtx_REG_offset, set_reg_attrs_from_mem, set_delc_rtx,
- set_mem_attrs_from_reg): New global function.
- (init_emit): Do not initialize regno_decl.
- (init_emit_once): initialize reg_attrs_htab.
- * final.c (alter_subreg): Do not replace REG by SUBREG.
- (gen_mem_expr_from_op): Improve output.
- (output_asm_operands): Likewise.
- * function.c (assign_params): Do not set REGNO_DECL.
- * function.h (struct function): Kill regno_decl.
- (REGNO_DECL): Kill.
- * gengtype.c (adjust_field_rtx_def): Handle new field of reg.
- * print_rtl.c (print_rtx): Output REG information.
- * regclass.c (reg_scan_mark_refs): Update attrs.
- * reload1.c (alter_reg): Likewise.
- * simplify_rtx.c (simplify_subreg): Likewise.
- * stmt.c (expand_decl): Likewise.
- * rtl.def (REG): Add new field.
- * rtl.h (struct reg_attrs): New.
- (rtunion_def): At rtreg.
- (X0MEMATTR): Add checking.
- (X0REGATTR, REG_ATTRS, REG_EXPR, REG_OFFSET): New macro.
- (set_reg_attrs_from_mem, set_mem_attrs_from_reg, gen_rtx_REG_offset):
- Declare.
- * tree.h (SET_DECL_RTL): Call set_decl_rtl.
-
-2003-01-24 Bob Wilson <bob.wilson@acm.org>
-
- * config/xtensa/xtensa.c: Remove unused include of machmode.h.
- (xtensa_emit_call, print_operand): Fix printf format strings
- to avoid compile warnings.
- (xtensa_function_prologue, xtensa_function_epilogue): Change type
- of "size" argument to HOST_WIDE_INT to fix compile warnings.
- * config/xtensa/xtensa-protos.h
- (xtensa_function_prologue, xtensa_function_epilogue): Ditto.
-
-2003-01-24 Jan Hubicka <jh@suse.cz>
-
- * builtins.c (DEF_BUILTIN): Accept 10 arguments.
- (implicit_built_in_decls): New global array.
- (mathfn_built_in): New global function.
- (fold_trunc_transparent_mathfn): New static function
- (expand_builtin_strstr, expand_bultin_strchr,
- expand_builtin_strpbrk, expand_builtin_strcpy,
- expand_builtin_strncpy, expand_bultin_strcmp,
- expand_bultin_strncat, expand_builtin_fputs): Use
- implicint_built_in_decls.
- (fold_builtin): Fold floor/trunc/round/ceil/nearbyint.
- * builtins.def: Fix comments.
- (DEF_GCC_BUILTIN, DEF_FALLBACK_BUILTIN, DEF_EXT_FALLBACK_BUILTIN,
- DEF_LIB_BUILTIN, DEF_LIB_ALWAYS_BUILTIN, DEF_EXT_LIB_BUILTIN,
- DEF_C99_BULTIN, DEF_FRONT_END_LIB_BUILTIN,
- DEF_EXT_FRONT_END_LIB_BUILTIN): Pass implicit as needed.
- (DEF_C99_C90RES_BULTIN): New.
- (*f, *l builtins): Update.
- * c-common.c (DEF_BUILTIN): Initialize implicit array.
- (c_expand_builtin_printf, c_expand_builtin_fprintf): Update.
- * convert.c (strip_float_extensions): New global function.
- * tree.h (DEF_BUILTIN): Accept 10 arguments.
- (implicit_built_in_decls, mathfn_built_in, strip_float_extension):
- Declare.
- * java/builtins.c (define_builtin): Handle implicit.
- (DEF_BUILTIN): Update.
- * tm.texi (TARGET_C99_FUNCTIONS): Document.
- * defaults.h (TARGET_C99_FUNCTIONS): Default to 0.
- * config/linux.h (TARGET_C99_FUNCTIONS): Default to 1
- when using glibc2.
-
-2003-01-24 Bob Wilson <bob.wilson@acm.org>
-
- * config.gcc (xtensa-*-elf*): Removed assignments to with_newlib,
- extra_parts, and fixincludes. Add xtensa/t-elf tmake_file.
- (xtensa-*-linux*): Add xtensa/t-linux tmake_file.
- * config/xtensa/crti.asm: New file.
- * config/xtensa/crtn.asm: New file.
- * config/xtensa/t-elf: New file.
- * config/xtensa/t-linux: New file.
- * config/xtensa/t-xtensa: Add rules for crti.o and crtn.o.
- Move various CFLAGS settings to new t-elf file.
-
-2003-01-24 Richard Henderson <rth@redhat.com>
-
- PR optimization/4382
- * tree-inline.c (find_builtin_longjmp_call_1): New.
- (find_builtin_longjmp_call): New.
- (inlinable_function_p): Use it.
-
-2003-01-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * config/i386/i386-protos.h (function_arg_pass_by_reference): Declare.
- * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
- * config/i386/i386.c (function_arg_pass_by_reference): New.
- (ix86_va_arg): Support arguments passed by reference.
-
-2003-01-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cfgloopanal.c: New file.
- * cfgloopmanip.c: New file.
- * Makefile.in (cfgloopanal.o, cfgloopmanip.o): New.
- (toplev.o, loop.o, doloop.o, unroll.o, cfgloop.o, predict.o,
- cfglayout.o): Add dependency on cfgloop.h.
- (cfgloop.o): Add flags.h dependency.
- * basic-block.h (BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK): New flags.
- (VLS_EXPECT_PREHEADERS, VLS_EXPECT_SIMPLE_LATCHES): Removed.
- (struct loop, struct loops, flow_loops_find, flow_loops_update,
- flow_loops_free, flow_loops_dump, flow_loop_dump,
- flow_loop_scan, flow_loop_tree_node_add, flow_loop_tree_node_remove,
- LOOP_TREE,,LOOP_PRE_HEADER, LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES,
- LOOP_ALL, flow_loop_outside_edge_p, flow_loop_nested_p,
- flow_bb_inside_loop_p, get_loop_body, loop_preheader_edge,
- loop_latch_edge, add_bb_to_loop, remove_bb_from_loops,
- find_common_loop, verify_loop_structure): Declarations moved to ...
- * cfgloop.h: New file.
- * bb-reorder.c (reorder_basic_blocks): Modified.
- * cfglayout.c: Include cfgloop.h.
- (cleanup_unconditional_jumps, cfg_layout_redirect_edge,
- cfg_layout_duplicate_bb, cfg_layout_initialize): Update loop structure.
- (break_superblocks): New static function.
- (cfg_layout_finalize): Use it.
- (cfg_layout_split_block): New function.
- * cfglayout.h (struct reorder_block_def): Add copy and duplicated
- fields.
- (cfg_layout_initialize, cfg_layout_redirect_edge): Declaration
- changed.
- (cfg_layout_split_block): Declare.
- * cfgloop.c: Include cfgloop.h and flags.h.
- (flow_loop_dump, flow_loops_free, flow_loop_exit_edges_find,
- get_loop_body): Avoid signed versus unsigned comparison warnings.
- (make_forwarder_block, flow_loops_find, loop_preheader_edge,
- loop_latch_edge): Modified.
- (verify_loop_structure): Modified to use flags stored in loop structure;
- check irreducible loops.
- (cancel_loop, cancel_loop_tree): New functions.
- (estimate_probability): Use loop analysis code for predictions.
- (estimate_loops_at_level): Avoid signed versus unsigned comparison
- warnings.
- * doloop.c: Include cfgloop.h.
- * loop.c: Include cfgloop.h.
- * predict.c: Include cfgloop.h.
- * toplev.c: Include cfgloop.h.
- * unroll.c: Include cfgloop.h.
- * tracer.c (tracer): Modified.
-
-2003-01-24 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (get_shift_alg): Fix a typo.
-
-2003-01-24 Ulrich Weigand <uweigand@de.ibm.com>
-
- * configure.in (HAVE_AS_TLS): Add s390-*-* and s390x-*-* cases.
- * configure: Regenerate.
-
- * config/s390/s390-protos.h (tls_symbolic_operand): Add prototype.
- (tls_symbolic_reference_mentioned_p): Add prototype.
- (s390_tls_get_offset): Add prototype.
- (emit_pic_move): Remove prototype, replace by ...
- (emit_symbolic_move): .. this new prototype.
-
- * config/s390/s390.c (TARGET_HAVE_TLS): Conditionally define.
- (tls_model_chars): New global variable.
- (s390_encode_section_info): Encode TLS model.
- Use targetm.binds_local_p to check for local symbols.
- (s390_strip_name_encoding): New function.
- (TARGET_STRIP_NAME_ENCODING): Define.
-
- (get_thread_pointer): New function.
- (legitimize_tls_address): New function.
- (legitimize_address): Call it.
- (emit_pic_move): Remove, replace by ...
- (emit_symbolic_move): ... this new function.
-
- (larl_operand): Handle TLS operands.
- (legitimate_constant_p): Likewise.
- (s390_decompose_address): Likewise.
- (s390_cannot_force_const_mem): New function.
- (TARGET_CANNOT_FORCE_CONST_MEM): Define.
-
- (s390_output_symbolic_const): Handle TLS unspecs.
- (print_operand): New code 'J'.
- (machine_function): Add struct member 'some_ld_name'.
- (get_some_local_dynamic_name, get_some_local_dynamic_name_1): New.
-
- (enum s390_builtin): New type.
- (code_for_builtin_64, code_for_builtin_31): New global variables.
- (s390_init_builtins, s390_expand_builtin): New functions.
- (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define.
-
- * config/s390/s390.h (TLS_SYMBOLIC_CONST): New macro.
- (ASM_OUTPUT_LABELREF): Define.
- (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Handle TLS constants.
-
- * config/s390/s390.md: Define TLS UNSPEC constants.
- ("movdi", "movsi"): Handle TLS operands.
- ("get_tp_64", "get_tp_31", "set_tp_64", "set_tp_31"): New insns.
- ("*tls_load_64", "*tls_load_31"): New insns.
- ("call_value_tls", "call_value_tls_exp"): New expanders.
- ("brasl_tls", "bras_tls", "basr_tls_64", "basr_tls_31",
- "bas_tls_64", "bas_tls_31"): New insns.
-
-2003-01-24 Nathan Sidwell <nathan@codesourcery.com>
-
- * config/rs6000/rs6000.c (rs6000_parse_abi_options): Make sure
- spe ABI is configured, if requested.
-
-2003-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * doc/passes.texi: Fix typo.
-
-2003-01-24 Andreas Schwab <schwab@suse.de>
-
- * stor-layout.c (excess_unit_span): Only define if used.
-
-2003-01-24 Jerry Quinn <jlquinn@optonline.net>
-
- * gcc/doc/invoke.texi (Optimization Options): List -O levels
- for each optimization flag.
-
-2003-01-24 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*andsi3_ashift_n_lower): New.
-
-2003-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- * doc/bugreport.texi: Use @command instead of @code for commands.
- * doc/collect2.texi: Likewise.
- * doc/headerdirs.texi: Likewise.
- * doc/invoke.texi: Likewise.
- * doc/standards.texi: Likewise.
- * doc/tm.texi: Likewise.
- * doc/trouble.texi: Likewise.
-
-2003-01-24 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.c (use_return_insn): Do not use a single return
- instruction for interrupt handelrs which have to create a stack
- frame.
- (arm_expand_prologue): Do not pre-bias the return address of
- interrupt handlers which create a stack frame.
-
-2003-01-24 Nick Clifton <nickc@redhat.com>
-
- * Add sh2e support:
-
- 2002-08-12 Alexandre Oliva <aoliva@redhat.com>
-
- * config/sh/sh.c (output_branch) [TARGET_SH2E]: Handle
- med_cbranches. Fix logic in short_cbranches.
-
- 2002-04-03 Alexandre Oliva <aoliva@redhat.com>
-
- * config/sh/sh.md (delay for cbranch): Don't annul delay
- slots on SH2e.
- * config/sh/sh.c (sh_insn_length_adjustment): Add 2 for
- cbranch with unfilled delay slot on SH2e.
- (output_branch): Fill with a nop the delay slot of a
- branch that required a delay slot but didn't get one.
-
- 2002-04-02 Alexandre Oliva <aoliva@redhat.com>
-
- * doc/invoke.texi (SH options): Document -m2e.
- * config/sh/crt1.asm: Add __SH2E__ Next to __SH3E__.
- * config/sh/lib1funcs.asm: Likewise.
- * config/sh/sh.c: Replace all uses of TARGET_SH3E with SH2E.
- * config/sh/sh.h (CPP_SPEC): Define __SH2E__ for -m2e, and
- not __sh1__.
- (CONDITIONAL_REGISTER_USAGE): Don't disable FP regs from
- SH2E up.
- (SH3E_BIT): Renamed to...
- (SH_E_BIT): ... this. Replace all uses.
- (TARGET_SH2E): Define from SH_E_BIT and TARGET_SH2.
- Replace all uses of TARGET_SH3E with TARGET_SH2E.
- (TARGET_SWITCHES): Added 2e.
- (OVERRIDE_OPTIONS): Set sh_cpu for SH2E.
- (processor_type): Added PROCESSOR_SH2E.
- * config/sh/sh.md: Replace all uses of TARGET_SH3E with
- TARGET_SH2E, except in sqrtsf2_i.
- (attribute cpu): Added sh2e.
- * config/sh/t-sh (MULTILIB_OPTIONS): Replace m3e with m2e.
- (MULTILIB_MATCHES): Use m2e multilib for m3e.
- * config.gcc: Add sh2e target support.
-
-2003-01-24 Phil Edwards <pme@gcc.gnu.org>
-
- Rename -W to -Wextra.
- * c-decl.c: Update comments.
- * c-typeck.c: Likewise.
- * flags.h: Likewise.
- * function.c: Likewise.
- * stmt.c: Likewise.
- * toplev.c: Update comments.
- (W_options): Add 'extra'.
- (display_help): Remove '-W'.
- (decode_W_option): Special warn_uninitialized treatment in the case
- of -Wextra.
- * doc/invoke.texi: Update with new entries.
-
-2003-01-23 Richard Henderson <rth@redhat.com>
-
- * ifcvt.c (noce_process_if_block): Re-add check vs X being changed
- in no-else-block case. Add commentary.
-
-2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in: Revert last change.
-
-2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in: Don't include ansidecl.h in tconfig.h.
- * gcov-io.h (PARAMS, ATTRIBUTE_UNUSED): Define if IN_LIBGCC2.
- * unwind-dw2-fde.h (last_fde): Use __attribute__, not
- ATTRIBUTE_UNUSED.
-
- * configure: Regenerate.
-
-2003-01-23 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- PR java/6748
- * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Don't destroy
- regs->nip. Fix rt_sigreturn frame layout. Add support for newer
- kernels.
-
-2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * cpplex.c (cpp_interpret_charconst): Squelch warning with cast.
-
-2003-01-23 Ulrich Weigand <uweigand@de.ibm.com>
-
- * genattrtab.c (write_attr_get): Mark 'insn' paramter
- as ATTRIBUTE_UNUSED.
-
-2003-01-23 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (thumb_base_register_rtx_p): New function.
- (thumb_index_register_rtx_p): New function.
- (thumb_legitimate_address_p): New function.
- (thumb_legitimate_offset_p): New function.
- * arm.h (REG_STRICT_P): Define according to setting of REG_OK_STRICT.
- (ARM_GO_IF_LEGITIMATE_ADDRESS): Use REG_STRICT_P to avoid duplicate
- definitions.
- (THUMB_GO_IF_LEGITIMATE_ADDRESS): Use thumb_legitimate_address_p.
- (THUMB_LEGITIMATE_OFFSET): Delte.
- (THUMB_LEGITIMIZE_RELOAD_ADDRESS): Use thumb_legitimate_offset.
- * arm-protos.h (thumb_legitimate_address_p): Add prototype.
- (thumb_legitimate_offset_p): Likewise.
-
-2003-01-23 Andreas Schwab <schwab@suse.de>
-
- * unwind.h (_Unwind_GetTextRelBase): Mark parameter as unused.
-
-2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * fixinc/Makefile.in (FL_LIST): Revert last change.
-
-2003-01-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
-
- PR other/7341
- * invoke.texi (ftest-coverage): Fix broken cross-reference.
- Change @code to @command for gcov command.
-
- * gcc.texi: Adjust title of gcov section.
- Adjust copyright.
- * gcov.texi: Likewise.
-
-2003-01-22 Roger Sayle <roger@eyesopen.com>
-
- PR optimization/8423
- * cse.c (fold_rtx): Only eliminate a CONSTANT_P_RTX to 1 when
- its argument is constant, or 0 if !flag_gcse.
- * simplify-rtx.c (simplify_rtx): Convert CONSTANT_P_RTX to 1
- if it's argument is constant.
- * gcse.c (want_to_gcse_p): Ignore CONSTANT_P_RTX nodes.
- (hash_scan_set): Don't record CONSTANT_P_RTX expressions.
- (do_local_cprop): Don't propagate CONSTANT_P_RTX constants.
- * builtins.c (purge_builtin_constant_p): New function to force
- instantiation of any remaining CONSTANT_P_RTX nodes.
- * rtl.h (purge_builtin_constant_p): Prototype here.
- * toplev.c (rest_of_compilation): Invoke purge_builtin_constant_p
- pass after GCSE and before loop.
- (flag_gcse): No longer static.
- * flags.h (flag_gcse): Prototype here.
-
-2003-01-22 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390.h (HARD_REGNO_MODE_OK): Fix warning regression
- introduced by last change.
-
-2003-01-22 Andreas Schwab <schwab@suse.de>
-
- * ra-rewrite.c (rewrite_program2): Initialize bb to avoid warning.
-
-2003-01-22 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (h8300_shift_needs_scratch_p): Don't
- request a scratch reg on H8S when the shift count is 8.
-
-2003-01-22 Ulrich Weigand <uweigand@de.ibm.com>
-
- * config/s390/s390-protos.h (preferred_la_operand_p):
- Remove second parameter.
- * config/s390/s390.c (preferred_la_operand_p): Likewise.
- * config/s390/s390.h (FRAME_REGNO_P, FRAME_REG_P): New macros.
- (HARD_REGNO_MODE_OK): Use FRAME_REGNO_P.
- * config/s390/s390.md ("*la_cc_64", "*la_cc_31", splitters): Remove.
- Add peepholes to transform ADD to LOAD ADDRESS.
-
-2003-01-22 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (arm_address_register_rtx_p): New function.
- (arm_legitimate_address_p): New function.
- (arm_legitimate_index_p): New function.
- (legitimize_pic_address): Use arm_legitimate_index_p.
- * arm-protos.h (arm_legtimate_address_p): Add prototype.
- * arm.h (ARM_GO_IF_LEGITIMATE_INDEX): Delete.
- (ARM_GO_IF_LEGITIMATE_ADDRESS): Call arm_legitimate_address_p.
-
-2003-01-22 Hartmut Penner <hpenner@de.ibm.com>
-
- * config/s390/s390.md (floatdfdi2): Insn has type 'itof'.
- * config/s390/2064.md (define_bypass): Correct 'Load' and
- 'Load-address' bypass values.
-
-2003-01-22 Andreas Schwab <schwab@suse.de>
-
- * config/ia64/t-ia64 (insn-attrtab.o-warn): Define as -Wno-error.
-
-2003-01-21 Zack Weinberg <zack@codesourcery.com>
-
- * genautomata.c (output_internal_insn_latency_func,
- output_print_reservation_func): Short circuit when there is no
- automaton to generate code for.
-
-2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (ssa-ccp.o): Depend on coretypes.h $(TM_H).
- (df.o): Delete duplicate dependency on coretypes.h $(TM_H).
-
-2003-01-21 Geoffrey Keating <geoffk@apple.com>
-
- * config/rs6000/rs6000.md: Remove warning.
- (builtin_setjmp_receiver): Likewise.
- * config/darwin.c (update_stubs): Slightly improve terrible hack
- with identifiers. Add comment pointing out problems with it.
- (update_non_lazy_ptrs): Likewise.
-
-2003-01-21 Richard Henderson <rth@redhat.com>
-
- * dwarf2out.c (lookup_filename): Fix printf format warning.
- * system.h (fread_unlocked, fwrite_unlocked): Undef.
-
- * fixinc/Makefile.in (FL_LIST): Add $($@-warn) hook.
- (fixincl.o-warn, gnu-regex.o-warn): New.
- * fixinc/fixfixes.c (FIX_PROC_HEAD): Mark parameters unused.
- * fixinc/fixtests.c (TEST_FOR_FIX_PROC_HEAD): Likewise.
- * fixinc/fixincl.c (process): Fix printf format warning.
-
-2003-01-21 Ulrich Weigand <uweigand@de.ibm.com>
-
- * dwarf2out (output_file_names): Don't crash if called
- with empty file_table.
-
-2003-01-21 Zack Weinberg <zack@codesourcery.com>
-
- * genautomata.c (output_internal_insn_latency_func): Add
- missing break statement to generated code.
-
-2003-01-21 Roger Sayle <roger@eyesopen.com>
-
- * stmt.c (same_case_target_p): New function to determine whether
- two case labels branch to the same target. Split out from...
- (group_case_nodes): ... here. Use same_case_target_p instead.
- (strip_default_case_nodes): Remove explicit case nodes
- that branch to the default destination.
- (expand_end_case_type): Call strip_default_case_nodes after
- group_case_nodes, to simplify the case-list before we count it.
- Only generate table_label RTX when actually needed. Try to share
- thiscase->exit_label and thiscase->data.case_stmt.default_label
- when a switch has no explicit default case. Simplify test for
- constant index.
-
-2003-01-21 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*negsf2_h8300): Use \\t instead of
- \t.
- (*negsf2_h8300hs): Likewise.
- (*addsi3_lshiftrt_16_zexthi): Likewise.
- (*iorhi3_lshiftrt_8): Likewise.
-
-2003-01-21 Ulrich Weigand <uweigand@de.ibm.com>
-
- * dwarf2out.c (fde_table_in_use): Mark GTY.
- (dwarf2out_cfi_label_num): New variable, marked GTY.
- (dwarf2out_cfi_label): Use it instead of static label_num.
- * emit-rtl.c (label_num): Mark GTY.
-
-2003-01-21 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_plussi): Support H8/300.
- (compute_plussi_length): Likewise.
- (compute_plussi_cc): Likewise.
- * config/h8300/h8300.md (addsi_h8300): Use output_plussi to
- output assembly instructions.
-
-2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * calls.c (fix_unsafe_tree): Prototype.
-
- * Makefile.in (GCC_WARN_CFLAGS): Add $(WERROR) $($@-warn)
- (gtype-desc.o-warn, c-decl.o-warn, varasm.o-warn, gcc.o-warn,
- insn-conditions.o-warn, out_object_file, gengtype-yacc.o-warn,
- c-parse.o-warn): Add -Wno-error.
- (STAGE2_FLAGS_TO_PASS): Add WERROR="@WERROR@".
-
- * configure.in (--enable-werror): Add new flag.
- * doc/install.texi (--enable-werror): Document.
- * configure: Regenerate.
-
- * objc/Make-lang.in (objc/objc-parse.o-warn): Add -Wno-error.
-
-2003-01-21 Andreas Schwab <schwab@suse.de>
-
- * genautomata.c (output_internal_insn_latency_func): Fix missing
- close paren in output.
-
-2003-01-21 Zack Weinberg <zack@codesourcery.com>
-
- * genautomata.c: Space savings in generated code:
- (output_dfa_insn_code_func): Split out the table-enlargement
- path to an out-of-line static function, dfa_insn_code_enlarge.
- (output_internal_insn_latency_func): Use a lookup table for the
- default latencies.
- (output_print_reservation_func): Use a lookup table for the
- strings.
-
-2003-01-21 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
-
- PR opt/7507
- * calls.c (fix_unsafe_tree): Split out from ...
- (expand_call): ... here. Use it on the function address too.
-
-2003-01-20 Richard Henderson <rth@redhat.com>
-
- * expr.h (default_must_pass_in_stack): Move decl outside ifdef.
-
-2003-01-20 Richard Henderson <rth@redhat.com>
-
- PR opt/7154
- * stmt.c (expand_asm_operands): Validize memory operands.
-
-2003-01-20 Richard Henderson <rth@redhat.com>
-
- PR opt/8848
- * ifcvt.c (noce_process_if_block): Correct arguments to
- modified_between_p for no-else-block case.
-
-2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (const_costs): Remove a warning.
- (output_plussi): Likewise.
- (compute_plussi_length): Likewise.
- (compute_plussi_cc): Likewise.
-
-2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (addsi_h8300): Remove the last
- alternative.
-
-2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (get_shift_alg): Remove redundant code.
-
-2003-01-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * system.h (__NO_STRING_INLINES): Define.
-
-2003-01-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * ifcvt.c (noce_emit_store_flag): Don't emit store flag if mode of x
- is not a scalar int mode.
-
-2003-01-20 Roger Sayle <roger@eyesopen.com>
-
- * cse.c (cse_insn): Avoid RTL sharing when updating the RETVAL
- insn's notes following a substitution inside a libcall.
-
-2003-01-20 Zack Weinberg <zack@codesourcery.com>
-
- * configure.in: Check for system-provided 'uchar' type.
- * configure, config.in: Regenerate.
- * cpphash.h: Only typedef 'uchar' if the system doesn't.
-
-2003-01-20 Richard Henderson <rth@redhat.com>
-
- * expr.h (MUST_PASS_IN_STACK): Move implementation...
- * calls.c (default_must_pass_in_stack): ... here.
-
-2003-01-20 Vladimir Makarov <vmakarov@redhat.com>
-
- * genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c.
-
- * genautomata.c (INSN_ALTS_FUNC_NAME): Move it into genattrtab.h.
-
- * genattr.c (main): Output default definition of AUTOMATON_ALTS.
- Wrap up definition of `insn_alts'.
-
- * genattrtab.c (main): Wrap up `insn_alts'.
-
-2003-01-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * collect2.c (ldgetname): Check HAVE_DECL_LDGETNAME before
- prototyping.
- * configure.in: Check for <ldfcn.h> and ldgetname() prototype.
-
- * config.in, configure: Regenerate.
-
-2003-01-20 Nick Clifton <nickc@redhat.com>
-
- * config/arm/arm.md (sibcall_epilogue): Add an
- UNSPEC_PROLOGUE_USE to prevent the link register from being
- considered dead.
-
-2003-01-20 Jan Hubicka <jh@suse.cz>
-
- * i386.md (SSE cmov splitter): Handle memory operand in operand 5.
-
-2003-01-20 Andreas Schwab <schwab@suse.de>
-
- * system.h: Don't declare strsignal if the decl test hasn't been
- run yet.
-
-2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (notice_update_cc): Don't assume that
- recog_data.operands[0] is always associated with cc0.
-
-2003-01-19 David Edelsohn <edelsohn@gnu.org>
-
- * collect2.c (ldgetname): Expand declaration to prototype.
- * read-rtl.c (atoll): Add prototype.
- * system.h (strsignal): Also declare if no declaration found.
-
-2003-01-19 Alexandre Oliva <aoliva@redhat.com>
-
- * config.gcc (mips64*-*-linux*): Added.
- * config/mips/linux64.h, config/mips/t-linux64: New file.
- * config/mips/iris6.h (MIPS_TFMODE_FORMAT): Define.
- * config/mips/mips.c (override_options): Use it.
- * config/mips/mips.h (TARGET_SWITCHES): Added...
- (SUBTARGET_TARGET_SWITCHES): New, empty by default.
- * Makefile.in (SPECS): New.
- (STAGESTUFF, specs, mostlyclean, install-common): Use it.
- * gcc.c (process_command): Move self-spec processing past spec
- file loading.
- * doc/tm.texi (DRIVER_SELF_SPECS): Document the change.
- * doc/fragments.texi (MULTILIB_EXTRA_OPTS): Document need for
- CRTSTUFF_T_CFLAGS.
- (SPECS): Document.
- * doc/invoke.texi (-mabi-fake-default): Document.
-
-2003-01-19 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (stack_push_word, stack_pop_word,
- z_reg, z_reg_qi): Declare static and GTY().
- (da_reg): Remove.
- (create_regs_rtx): Don't create da_reg.
- ("gt-m68hc11.h"): Include for GTY roots.
- * config/m68hc11/m68hc11.h (ix_reg, iy_reg, d_reg): Declare extern
- and GTY() here.
- (m68hc11_compare_op0, m68hc11_compare_op1): Likewise.
- (m68hc11_soft_tmp_reg): Likewise.
- * config/m68hc11/m68hc11-protos.h: Remove above declarations.
-
-2003-01-18 Kazu Hirata <kazu@cs.umass.edu>
-
- * basic-block.h: Fix comment formatting.
- * calls.c: Likewise.
- * combine.c: Likewise.
- * convert.c: Likewise.
- * gcov.c: Likewise.
- * haifa-sched.c: Likewise.
- * libgcc2.c: Likewise.
- * loop.c: Likewise.
- * profile.c: Likewise.
- * system.h: Likewise.
-
-2003-01-18 Roger Sayle <roger@eyesopen.com>
-
- * config/pa/pa.md (muldi3): Avoid invalid sharing of SUBREG RTXs.
-
-2003-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ra-build.c (undef_to_size_word): Avoid `switch' warning.
-
-2003-01-17 Dale Johannesen <dalej@apple.com>
-
- * config/rs6000/rs6000.md (*floatsidf2_internal): Add earlyclobbers.
- (*floatunssidf2_internal): Ditto.
-
-2003-01-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * alias.c: Fix comment typos.
- * basic-block.h: Likewise.
- * c-common.c: Likewise.
- * c-common.h: Likewise.
- * c-decl.c: Likewise.
- * c-opts.c: Likewise.
- * c-pragma.c: Likewise.
- * c-pretty-print.h: Likewise.
- * cfg.c: Likewise.
- * cfganal.c: Likewise.
- * cfgbuild.c: Likewise.
- * cfgcleanup.c: Likewise.
- * cfglayout.c: Likewise.
- * cfgrtl.c: Likewise.
- * convert.c: Likewise.
- * cpphash.h: Likewise.
- * cpplex.c: Likewise.
- * cpplib.h: Likewise.
- * df.h: Likewise.
- * diagnostic.c: Likewise.
- * diagnostic.h: Likewise.
- * dwarf2.h: Likewise.
-
-2003-01-17 Stan Shebs <shebs@apple.com>
-
- * config/darwin-protos.h: Forward-declare struct cpp_reader.
-
-2003-01-17 Douglas B Rupp <rupp@gnat.com>
-
- * config/alpha/alpha.c (alpha_need_linkage): Fix obvious
- mistake in last checkin.
-
-2003-01-17 Kazu Hirata <kazu@cs.umass.edu>
-
- * et-forest.c: Fix comment typos.
- * et-forest.h: Likewise.
- * except.c: Likewise.
- * expr.c: Likewise.
- * flags.h: Likewise.
- * flow.c: Likewise.
- * gcc.c: Likewise.
- * gcse.c: Likewise.
- * genattrtab.c: Likewise.
- * genautomata.c: Likewise.
- * gengtype.c: Likewise.
- * genrecog.c: Likewise.
- * global.c: Likewise.
- * gthr-rtems.h: Likewise.
-
-2003-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * i386.c (x86_function_profiler): Fix format specifier.
-
-2003-01-17 Richard Henderson <rth@redhat.com>
-
- * gengtype.c (walk_type): Allow paramN_is.
-
-2003-01-17 Nick Clifton <nickc@redhat.com>
-
- * config/i960/t-960bare (i960-c.o): Add missing newline escape.
-
-2003-01-16 Richard Henderson <rth@redhat.com>
-
- * config/alpha/linux-elf.h (LIB_SPEC): Adjust inter-option spacing.
-
-2003-01-16 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (alpha_sr_alias_set): Mark GTY.
- (alpha_next_sequence_number): Likewise.
- (alpha_this_literal_sequence_number): Likewise.
- (alpha_this_gpdisp_sequence_number): Likewise.
- (struct alpha_funcs, alpha_funcs_num): Likewise.
- (struct alpha_links): Fix branch merge error.
- (alpha_need_linkage, alpha_use_linkage): Use GC for alpha_funcs.
-
-2003-01-17 Alexandre Oliva <aoliva@redhat.com>
-
- * config/mips/mips.h: Don't use #elif. Reported by Kaveh
- R. Ghazi.
-
-2003-01-16 Kazu Hirata <kazu@cs.umass.edu>
-
- * ifcvt.c: Fix comment typos.
- * lcm.c: Likewise.
- * libgcc2.c: Likewise.
- * local-alloc.c: Likewise.
- * loop.c: Likewise.
- * predict.c: Likewise.
- * ra-build.c: Likewise.
- * ra.c: Likewise.
- * ra-colorize.c: Likewise.
- * ra.h: Likewise.
- * ra-rewrite.c: Likewise.
- * regmove.c: Likewise.
- * reload.h: Likewise.
- * rtlanal.c: Likewise.
- * toplev.c: Likewise.
- * tree.h: Likewise.
- * unwind-dw2-fde-glibc.c: Likewise.
- * vmsdbgout.c: Likewise.
-
-2003-01-16 Richard Henderson <rth@redhat.com>
-
- * dwarf2out.c (struct file_table): Remove.
- (FILE_TABLE_INCREMENT): Remove.
- (file_table): Make a varray; mark for GC. Update all users.
- (file_table_last_lookup_index): Extract from struct file_table.
- (output_file_names): Fix unsigned compare warnings.
- (add_name_attribute): Remove inline marker.
- (add_comp_dir_attribute): Split out from gen_compile_unit_die.
- (lookup_filename): Don't manage size of file_table.
- (init_file_table): Allocate file_table with GC.
- (dwarf2out_init): Don't record main_input_filename here.
- (dwarf2out_finish): Do it here instead.
-
-2003-01-16 Bruce Korb <bkorb@gnu.org>
-
- * gcc/fixinc/inclhack.def(limits_ifndef): QNX needs a bypass, too.
-
-2003-01-16 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * config/sh/sh.c (sh_initialize_trampoline): Emit rotrdi3_mextr
- instead of rotldi3_mextr.
-
-2003-01-16 Vladimir Makarov <vmakarov@redhat.com>
-
- * haifa-sched.c (move_insn): Restore moving all schedule group.
- (set_priorities): Restore taking SCHED_GROUP_P into account.
-
- * sched-deps.c (add_dependence): Restore processing the last group
- insn.
- (remove_dependence, group_leader): Restore the functions.
- (set_sched_group_p): Restore adding dependencies from previous insn
- in the group.
- (compute_forward_dependences): Restore usage of group_leader.
-
- * sched-ebb.c (init_ready_list): Restore taking SCHED_GROUP_P into
- account.
-
- * sched-rgn.c (init_ready_list): Restore taking SCHED_GROUP_P into
- account.
- (can_schedule_ready_p): Ditto.
- (add_branch_dependences): Restore skipping over the group insns.
-
-2003-01-16 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Fix handling
- 68HC12 pre/post inc/dec side effects.
-
-2003-01-16 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.h (MASK_M6812): Define.
-
-2003-01-16 J"orn Rennecke <amylaar@onetel.net.uk>
-
- * sh.md (mshflo_w_x): Fix description of operation.
-
-2003-01-16 Zack Weinberg <zack@codesourcery.com>
-
- * config/rs6000/rs6000.h: Mention Altivec registers in
- commentary. Fix typo.
-
-2003-01-16 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.md (movti_string): Remove clobber.
- * config/rs6000/rs6000.c (rs6000_emit_move, TImode): Explicitly
- generate PARALLEL with clobber for TARGET_POWER.
-
-2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ra-colorize.c (colorize_one_web): Initialize variable.
- * regmove.c (fixup_match_1): Likewise.
- * reload1.c (reload_as_needed): Likewise.
- * sdbout.c (SET_KNOWN_TYPE_TAG): Add cast.
-
-2003-01-16 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * cfgloop.c (flow_loops_find): Fix handling of abnormal edges.
-
-2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * dbxout.c (lastfile, cwd): Fix `unused' warning.
- * dwarf2out.c (fde_table_in_use, current_funcdef_fde,
- dw_cfi_oprnd1_desc, dw_cfi_oprnd2_desc, next_die_offset,
- is_main_source, file_table, decl_die_table_in_use,
- abbrev_die_table_in_use, line_info_table_in_use,
- separate_line_info_table_in_use, pubname_table_in_use,
- arange_table_in_use, ranges_table_in_use,
- current_function_has_inlines): Likewise.
- * flow.c (life_analysis): Likewise.
- * genemit.c (gen_insn): Likewise.
- * protoize.c (cplus_suffix): Likewise.
-
- * arm.c (ROUND_UP_WORD): Renamed from ROUND_UP.
- * arm.h (ROUND_UP_WORD): Likewise.
-
- * arm.h (CONDITIONAL_REGISTER_USAGE): Avoid signed/unsigned
- warning.
- * emit-rtl.c (gen_rtx_REG, set_mem_attributes_minus_bitpos,
- init_emit_once): Likewise.
- * flow.c (mark_regs_live_at_end, calculate_global_regs_live):
- Likewise.
- * function.c (assign_stack_temp_for_type): Likewise.
- * loop.c (loop_invariant_p): Likewise.
- * recog.c (push_operand): Likewise.
- * regclass.c (init_reg_sets_1): Likewise.
- * reload.c (update_auto_inc_notes): Likewise.
- * reload1.c (reload_as_needed, emit_input_reload_insns): Likewise.
- * stmt.c (expand_asm_operands): Likewise.
- * stor-layout.c (start_record_layout): Likewise.
-
-2003-01-16 Herman A.J. ten Brugge <hermantenbrugge@home.nl>
-
- * config/c4x/c4x.md (epilogue): Correct last patch.
-
-2003-01-15 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (find_lo_sum_using_gp): Rename from find_lo_sum;
- also check that GP is being used.
- (alpha_find_lo_sum_using_gp): New.
- (alpha_does_function_need_gp): Use get_attr_usegp.
- * config/alpha/alpha-protos.h: Update.
- * config/alpha/alpha.md (attr usegp): New. Annotate patterns
- as needed.
-
-2003-01-15 Roger Sayle <roger@eyesopen.com>
-
- * gcse.c (one_cprop_pass): Change function arguments to take both
- cprop_jumps and bypass_jumps flags instead of just alter_jumps.
- (gcse_main): Update calls to one_cprop_pass, disabling bypassing.
- (bypass_jumps): New function to perform separate jump bypassing pass.
- * rtl.h (bypass_jumps): Add function prototype.
- * timevar.def (TV_BYPASS): New timing variable.
- * toplev.c (enum dump_file_index): Add new entry DFI_bypass.
- (dump_file): New entry for the bypass RTL dump file.
- (rest_of_compilation): Insert new jump bypassing optimization
- pass after loop.
- * doc/passes.texi: Document new pass.
-
-2003-01-15 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * som.h (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY, MAKE_DECL_ONE_ONLY,
- ASM_WEAKEN_LABEL, GTHREAD_USE_WEAK): Define.
- * pa.h (TARGET_SOM_SDEF): Define.
- * pa-hpux11.h (TARGET_SOM_SDEF): Define.
-
-2003-01-16 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.c (expand_prologue): Use push/pop to
- allocate 4-bytes of locals on 68HC11.
- (expand_epilogue): Likewise.
- (m68hc11_memory_move_cost): Increase cost of HI/QI soft registers.
-
-2003-01-15 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.h (ASM_SPEC): Handle -m68hcs12; Pass -mshort
- and -mshort-double to the assembler to specify the ABI.
- (LINK_SPEC): Likewise.
- (CPP_SPEC): Pass HCS12 specific define.
- (MASK_M68S12): New define.
- (TARGET_M68S12): Likewise.
- (TARGET_SWITCHES): New options -m68hcs12 and -m68S12.
- (TARGET_VERSION): Update.
- * config/m68hc11/m68hc12.h (CPP_SPEC): Pass HCS12 specific define.
- (LINK_SPEC): Update.
- (ASM_SPEC): Update.
- * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Update.
- * doc/invoke.texi (M68hc1x Options): Document -m68hcs12.
-
-2003-01-15 Stephane Carrez <stcarrez@nerim.fr>
-
- * config/m68hc11/m68hc11.md ("return"): Use emit_jump_insn to emit
- the return code.
-
-2003-01-15 Josef Zlomek <zlomekj@suse.cz>
-
- * cfganal.c (set_edge_can_fallthru_flag): Clear the EDGE_CAN_FALLTHRU
- flag before setting it.
-
-2003-01-15 Roger Sayle <roger@eyesopen.com>
-
- * c-semantics.c (genrtl_while_stmt): Improve initial RTL generation
- when loop condition is known true, i.e. "while (1) { ... }".
- (genrtl_for_stmt): Similarly for "for" statements.
-
-2003-01-15 Roger Sayle <roger@eyesopen.com>
-
- * real.c (real_sqrt): Return a bool result indicating whether
- a floating point exception or trap should be raised.
- * real.h (real_sqrt): Update function prototype.
- * builtins.c (fold_builtin): Only fold non-trapping square
- roots unless we're ignoring errno and trapping math.
-
-2003-01-15 John David Anglin <dave.anglin@nrc.gc.ca>
-
- * expr.h (emit_conditional_add): Add PARAMS to declaration.
- * gengtype-lex.l (malloc, realloc): Move defines after include of
- system.h. Remove duplicate include of system.h.
-
-2003-01-15 Roger Sayle <roger@eyesopen.com>
-
- PR middle-end/9009
- * optabs.c (expand_unop): When manipulating the FP sign bit
- using integer operations, account for targets with different
- integer and FP word orders.
- (expand_abs): Likewise.
-
-2003-01-15 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (rs6000_gen_section_name): Do not include
- file extension in section name.
-
-2003-01-15 Richard Earnshaw <rearnsha@arm.com>
-
- * flow.c (find_auto_inc): Also try to generate a PRE_MODIFY with
- constant offset.
-
-2003-01-15 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.h (HAVE_PRE_MODIFY_DISP, HAVE_PRE_MODIFY_REG): Define.
- (HAVE_POST_MODIFY_DISP, HAVE_POST_MODIFY_REG): Define.
- (ARM_GO_IF_LEGITIMATE_ADDRESS): Handle pre/post-modify addresses.
- (ARM_PRINT_OPERAND_ADDRESS): Likewise.
-
-2003-01-15 Jan Hubicka <jh@suse.cz>
-
- PR f/9258
- * global.c (struct allocno): Add no_stack_reg.
- (global_conflicts): Set no_stack_reg.
- (find_reg): Use it.
-
- * convert.c (convert_to_real): Fold - and abs only when profitable.
- * fold-const.c (fold): Fold truncates in - and abs.
-
-2003-01-15 Josef Zlomek <zlomekj@suse.cz>
-
- Segher Boessenkool <segher@koffie.nl>
-
- * predict.c (real_inv_br_prob_base): New variable.
- (propagate_freq): Use multiply by reciprocal instead of
- division. Don't divide by 1.0 at all.
- (estimate_bb_frequencies): Similar.
-
-2003-01-15 Alexandre Oliva <aoliva@redhat.com>
-
- * configure.in (libgcc_visibility): Force disabled on IRIX 6 too.
- * configure: Rebuilt.
-
-2003-01-15 Hartmut Penner <hpenner@de.ibm.com>
-
- * config/s390/s390.c (s390_safe_attr_type): New function.
- (s390_use_dfa_pipeline_interface): New function, return true for z900.
- (s390_issue_rate): New function.
- (s390_agen_dep_p): New function.
- (addr_generation_dependency_p): Use 's390_safe_attr_type'.
- (s390_adjust_cost): Return 'cost' if new DFA is used.
- (s390_adjust_priority): Delete function.
- * config/s390/s390-protos.h: (s390_agen_dep_p): New prototype.
- * config/s390/s390.md (atype attribute): Attribute 'atype' default
- determined by 'op_type'.
- (type attribute): Added more type attributes.
- * config/s390/2064.md: New DFA description for z900 pipeline.
-
-2003-01-15 Alexandre Oliva <aoliva@redhat.com>
-
- * config/i386/i386.c (ix86_expand_vector_move): Validize constant
- forced to memory. Fixes PR bootstrap/9036.
-
- * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Define so as
- to set $gp before the call.
-
-2003-01-14 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (alpha_expand_mov): Use correct mode
- for force_const_mem.
-
-2003-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * genattr.c (main): Rearrange output to avoid prototype warning.
- * genautomata.c (transform_3): Fix ambiguous-else warning.
- * local-alloc.c (requires_inout): Add parentheses around
- assignment used as truth-value.
- * timevar.c: Move system includes above local includes. Include
- toplev.h
- * Makefile.in (timevar.o): Depend on toplev.h.
-
-2003-01-14 Denis Chertykov <denisc@overta.ru>
-
- * config/ip2k/ip2k.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
- (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
-
- * config/ip2k/ip2k.c (ip2k_attribute_table): New table of
- attributes.
- (TARGET_ATTRIBUTE_TABLE): New macro.
- (valid_machine_type_attribute): Remove.
- (valid_machine_decl_attribute): Remove.
- (ip2k_handle_progmem_attribute): New function.
- (ip2k_handle_fndecl_attribute): New function.
-
-2003-01-10 Andrew Haley <aph@redhat.com>
-
- * config/i386/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Rename
- registers to be in correct order. Add rip.
-
-2003-01-14 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*andsi3_lshiftrt_9_sb): New.
- (*iorsi3_and_lshiftrt_9_sb): Likewise.
-
-2003-01-14 Jan Hubicka <jh@suse.cz>
-
- * convert.c (strip_float_extensions): Look for narrowest type handling
- FP constants.
-
- * fold-const.c (fold): Fold (double)float1 CMP (double)float2 into
- float1 CMP float2.
- * convert.c (strip_float_extensions): Make global.
- * tree.h (strip_float_extensions): Declare.
-
-2003-01-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
- * timevar.def: define TV_NAME_LOOKUP.
- * timevar.c (timevar_pop): Be verbose when aborting.
-
-2003-01-13 Andreas Schwab <schwab@suse.de>
-
- * Makefile.in ($(parsedir)/gengtype-lex.c): Don't change to
- $(parsedir), just move the temporary file at the end.
- ($(parsedir)/gengtype-yacc.c): Likewise.
-
-2003-01-13 Alexandre Oliva <aoliva@redhat.com>
-
- * aclocal.m4 (gcc_AC_PROG_GNAT): Don't try to prepend
- ${ac_tool_prefix} to ADAC or CC. Protect them from word
- splitting.
- * configure: Rebuilt.
-
-2003-01-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * config/sparc/gmon-sol2.c (moncontrol, monstartup, _mcleanup,
- internal_mcount): Don't use PARAMS.
- (monstartup, _mcleanup, internal_mcount, moncontrol): Convert to
- ISO C style.
- (internal_mcount): Use __attribute__, not ATTRIBUTE_UNUSED.
-
-2003-01-13 Andreas Schwab <schwab@suse.de>
-
- * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Output type
- directive.
-
-2003-01-13 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*andsi3_lshift_n_sb): New.
- (*iorsi3_and_lshiftrt_n_sb): Likewise.
-
-2003-01-12 Mark Mitchell <mark@codesourcery.com>
-
- PR c++/9264
- * c-lex.c (c_lex): Set the token value to error_mark_node for
- invalid numeric constants.
-
-2003-01-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-pch.c (asm_file_startpos): Change to `long'.
- (pch_init): Use ftell, not ftello.
- (c_common_write_pch): Use ftell/fseek, not ftello/fseeko.
- Use `long' instead of `off_t'.
- (c_common_read_pch): Likewise.
- * ggc-common.c (gt_pch_save): Use long/ftell instead of
- off_t/ftello.
-
-2003-01-12 Alan Modra <amodra@bigpond.net.au>
-
- * expr.c (expand_expr <RDIV_EXPR>): Correct recursive call args.
-
-2003-01-11 Richard Earnshaw (rearnsha@arm.com)
-
- * arm-protos.h (struct cpp_reader): Add declaration.
-
-2003-01-11 Jan Hubicka <jh@suse.cz>
-
- PR target/9068
- * i386.c (output_fp_compare): Fix typo.
-
-2003-01-10 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.c (common_mode_defined): Mark for PCH.
-
-2003-01-10 Geoffrey Keating <geoffk@apple.com>
-
- * Makefile.in (parsedir): New variable.
- (docobjdir): New variable.
- (c-parse.o, c-parse.c, c-parse.y, gengtype-lex.o, gengtype-yacc.o,
- gengtype-lex.c, gengtype-yacc.c): Use parsedir.
- (info, cpp.info, gcc.info, gccint.info, gccinstall.info,
- cppinternals.info, generated-manpages, gcov.1, cpp.1, gcc.1, gfdl.7,
- gpl.7, fsf-funding.7, maintainer-clean, install-info, install-man):
- Use docobjdir.
- * objc/Make-lang.in (objc/objc-parse.c, objc/objc-parse.y,
- objc.maintainer-clean): Use parsedir.
-
- * varasm.c (struct constant_descriptor_rtx): Remove unused
- `label' field.
-
- * toplev.c (documented_lang_options): Document -Winvalid-pch.
-
-2003-01-10 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.h (NO_PROFILE_COUNTERS): Set.
- (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Kill.
-
-2003-01-10 Richard Henderson <rth@redhat.com>
-
- * combine.c (make_compound_operation): Use SCALAR_INT_MODE_P,
- not INTEGRAL_MODE_P when widening extensions.
-
-2003-01-10 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (decl_has_samegp): True for !TREE_PUBLIC.
-
-2003-01-10 Geoffrey Keating <geoffk@apple.com>
-
- * ggc-page.c (ggc_collect): Avoid overflow computing
- min_expand.
-
- * Makefile.in (RANLIB_FOR_TARGET): Use RANLIB when native.
- (RANLIB_TEST_FOR_TARGET): Delete. Don't pass down to sub-makes.
- Remove calls.
- * mklibgcc.in: Remove uses of RANLIB_TEST_FOR_TARGET.
-
-2003-01-10 Jan Hubicka <jh@suse.cz>
-
- * ifcvt.c (noce_try_addcc): Do not call emit_conditional_add
- with weird operands.
-
-2003-01-10 Dale Johannesen <dalej@apple.com>
-
- * calls.c (load_register_parameters): Add is_sibcall, sibcall_failure
- parameters. Call check_sibcall_argument_overlap if indicated.
- (check_sibcall_argument_overlap): Add mark_stored_args_map
- parameter. Don't mark parameter area as clobbered if not set.
- (expand_call): Adjust calls to above.
-
-2003-01-10 Kelley Cook <kelleycook@comcast.net>
-
- * configure.in (linker read-only and read-write section mixing):
- Squelch some assembler warnings.
- * configure: Likewise.
-
-2003-01-10 Hartmut Penner <hpenner@de.ibm.com>
-
- * doc/invoke.texi: Document -mtune, delete -mcpu
- option for S/390 and zSeries.
- * config/s390/s390.c (s390_tune_string) New variable.
- (s390_cpu_string) Delete variable.
- (override_options): Use s390_tune_string instead of
- s390_cpu_string.
- * config/s390/s390.h: (TARGET_OPTIONS) '-mtune' instead of '-mcpu'.
-
-2003-01-10 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*iorsi3_ashift_31): New.
-
-2003-01-10 Josef Zlomek <zlomekj@suse.cz>
-
- * jump.c (next_nonnote_insn_in_loop): New function.
- (copy_loop_headers): Use next_nonnote_insn_in_loop instead of
- next_nonnote_insn.
- (duplicate_loop_exit_test). Likewise.
-
-2003-01-09 Geoffrey Keating <geoffk@apple.com>
-
- Merge from pch-branch:
-
- 2003-01-06 Geoffrey Keating <geoffk@apple.com>
-
- * ggc-page.c (ggc_pch_read): Update the statistics after a PCH
- load.
-
- 2002-12-24 Geoffrey Keating <geoffk@apple.com>
-
- * cpplib.c (count_registered_pragmas): New function.
- (save_registered_pragmas): New function.
- (_cpp_save_pragma_names): New function.
- (restore_registered_pragmas): New function.
- (_cpp_restore_pragma_names): New function.
- * cpphash.h (_cpp_save_pragma_names): Prototype.
- (_cpp_restore_pragma_names): Likewise.
- * cpppch.c (struct save_macro_item): Split from save_macro_data.
- (struct save_macro_data): New field 'saved_pragmas'.
- (save_macros): Update for changes to struct save_macro_data.
- (cpp_prepare_state): Call _cpp_save_pragma_names, update
- for changes to struct save_macro_data.
- (cpp_read_state): Call _cpp_restore_pragma_names, update
- for changes to struct save_macro_data.
-
- * cpppch.c (cpp_read_state): Restore the hashtable references
- in the cpp_reader.
-
- * tree.h (built_in_decls): Mark for PCH.
-
- * dbxout.c (lastfile): Don't mark for PCH.
-
- * ggc.h: Document PCH calls into memory managers.
-
- 2002-12-18 Geoffrey Keating <geoffk@apple.com>
-
- * doc/invoke.texi (Precompiled Headers): Document the
- directory form of PCH.
- * cppfiles.c (validate_pch): New function.
- (open_file_pch): Search suitably-named directories for PCH files.
-
- 2002-12-14 Geoffrey Keating <geoffk@apple.com>
-
- * doc/gty.texi (GTY Options): Document chain_next, chain_prev,
- reorder options.
- (Type Information): Mention that the information is also
- used to implement PCH.
- * doc/passes.texi (Passes): Improve documentation of
- language-specific files.
-
- 2002-12-11 Geoffrey Keating <geoffk@apple.com>
-
- * gengtype.c (struct write_types_data): Add reorder_note_routine field.
- (struct walk_type_data): Add reorder_fn field.
- (walk_type): Process 'reorder' option.
- (write_types_process_field): Reorder parameters to gt_pch_note_object,
- call reorder_note_routine.
- (write_func_for_structure): Reorder parameters to gt_pch_note_object.
- (ggc_wtd): Update for change to struct write_types_data.
- (pch_wtd): Likewise.
- * ggc.h (gt_pch_note_object): Reorder parameters.
- (gt_handle_reorder): New definition.
- (gt_pch_note_reorder): New prototype.
- * ggc-common.c (struct ptr_data): Add reorder_fn.
- (gt_pch_note_object): Reorder parameters.
- (gt_pch_note_reorder): New.
- (gt_pch_save): Call reorder_fn.
- * stringpool.c (gt_pch_n_S): Update for change to gt_pch_note_object.
-
- * dbxout.c (cwd): Don't mark for PCH.
-
- 2002-12-09 Geoffrey Keating <geoffk@apple.com>
-
- * gengtype.c (finish_root_table): Fix some warnings.
- (write_root): Handle TYPE_STRING.
- * ggc.h (gt_ggc_m_S): Add prototype.
- * stringpool.c (gt_ggc_m_S): New function.
-
- 2002-11-30 Geoffrey Keating <geoffk@apple.com>
-
- * dwarf2out.c (dw2_string_counter): New.
- (AT_string_form): Use it.
- (same_dw_val_p): Update for removal of hashtable.h hash tables.
-
- 2002-11-22 Geoffrey Keating <geoffk@apple.com>
-
- * dbxout.c: Include gt-dbxout.h.
- (lastfile): Mark for PCH/GGC.
- (cwd): Likewise.
- (struct typeinfo): Likewise.
- (typevec): Likewise.
- (typevec_len): Likewise.
- (next_type_number): Likewise.
- (struct dbx_file): Likewise.
- (current_file): Likewise.
- (next_file_number): Likewise.
- (dbxout_init): Allocate typevec, struct dbx_file with GGC.
- (dbxout_start_source_file): Allocate struct dbx_file with GGC.
- (dbxout_end_source_file): Don't free struct dbx_file.
- (dbxout_type): Use GGC to allocate typevec.
- * Makefile.in (dbxout.o): Depend on gt-dbxout.h, $(GGC_H).
- (GTFILES): Add dbxout.c.
- (gt-dbxout.h): New rule.
-
- * Makefile.in (c-pch.o): Add debug.h as dependency.
- * c-pch.c: Include debug.h.
- (pch_init): Call start_source_file to keep nesting right.
- (c_common_read_pch): Add orig_name parameter. Call
- start_source_file debug hook. Call end_source_file debug hook.
- * c-common.h (c_common_read_pch): Update prototype.
- * cpplib.h (struct cpp_callbacks): Add fourth field to read_pch
- callback.
- * cppfiles.c (struct include_file): Add new field `header_name'.
- (find_or_create_entry): Default it to `name'.
- (open_file_pch): Set it to the original header file searched for.
- (stack_include_file): Don't stack an empty buffer, just handle
- PCH files immediately. Pass header_name field to read_pch callback.
-
- 2002-11-19 Geoffrey Keating <geoffk@apple.com>
-
- * function.c (funcdef_no): Mark to be saved in a PCH.
-
- 2002-11-15 Geoffrey Keating <geoffk@apple.com>
-
- * ggc-page.c (ggc_pch_read): Remove unused 'bmap_size'.
-
- * cpppch.c (cpp_read_state): Correct size reallocated for 'defn'.
-
- 2002-11-14 Geoffrey Keating <geoffk@apple.com>
-
- * optabs.h (code_to_optab): Add GTY marker.
-
- 2002-11-13 Geoffrey Keating <geoffk@apple.com>
-
- * Makefile.in (GTFILES): Add cpplib.h.
- * c-common.h (struct c_common_identifier): Don't skip 'node' field.
- * c-decl.c (build_compound_literal): Don't use var_labelno.
- * cpplib.h (struct cpp_hashnode): Use gengtype to mark.
- * dwarf2asm.c (dw2_force_const_mem): Don't use const_labelno.
- * varasm.c (const_labelno): Use gengtype to mark.
- (var_labelno): Likewise.
- (in_section): Likewise.
- (in_named_name): Likewise.
- (struct in_named_entry): Likewise.
- (in_named_htab): Likewise.
- (set_named_section_flags): Use GGC to allocate struct in_named_entry.
- (init_varasm_once): Use GGC to allocate in_named_htab.
- * config/darwin.c (current_pic_label_num): Mark for PCH.
-
- 2002-11-11 Geoffrey Keating <geoffk@apple.com>
-
- * ggc-simple.c (init_ggc_pch): New stub procedure.
- (ggc_pch_count_object): Likewise.
- (ggc_pch_total_size): Likewise.
- (ggc_pch_this_base): Likewise.
- (ggc_pch_alloc_object): Likewise.
- (ggc_pch_prepare_write): Likewise.
- (ggc_pch_write_object): Likewise
- (ggc_pch_finish): Likewise.
- (ggc_pch_read): Likewise.
-
- 2002-11-08 Geoffrey Keating <geoffk@apple.com>
-
- * c-pch.c (c_common_write_pch): Write the macro definitions after
- the GCed data.
- (c_common_read_pch): Call cpp_prepare_state. Restore the macro
- definitions after the GCed data.
- * cpplib.c (save_macros): New.
- (reset_ht): New.
- (cpp_write_pch_deps): Split out of cpp_write_pch.
- (cpp_write_pch_state): Split out of cpp_write_pch.
- (cpp_write_pch): Delete.
- (struct save_macro_data): Delete.
- (cpp_prepare_state): New.
- (cpp_read_state): Erase and restore initial macro definitions.
- * cpplib.h (struct save_macro_data): Forward-declare.
- (cpp_write_pch_deps): Prototype.
- (cpp_write_pch_state): Prototype.
- (cpp_write_pch): Delete prototype.
- (cpp_prepare_state): Prototype.
- (cpp_read_state): Add fourth argument.
-
- 2002-11-04 Geoffrey Keating <geoffk@apple.com>
-
- * gengtype.c (adjust_field_rtx_def): Don't use skip on valid fields.
- (write_array): Remove warning.
-
- * gengtype.c (contains_scalar_p): New.
- (finish_root_table): Add the table to all languages, even if it's
- empty.
- (write_roots): Output gt_pch_scalar_rtab.
- * ggc-common.c (gt_pch_save): Write out scalars.
- (gt_pch_restore): Read scalars back.
-
- * ggc-page.c (OBJECTS_IN_PAGE): New macro.
- (struct page_entry): Delete pch_page field.
- (ggc_recalculate_in_use_p): Use OBJECTS_IN_PAGE.
- (clear_marks): Likewise.
- (sweep_pages): Likewise.
- (poison_pages): Likewise.
- (ggc_print_statistics): Likewise.
- (ggc_pch_read): Don't free objects read from a PCH.
- Properly set up in_use_p and page_tails.
-
- 2002-10-25 Geoffrey Keating <geoffk@apple.com>
-
- * gengtype.c (struct write_types_data): New.
- (struct walk_type_data): Make `cookie' const; add extra
- prev_val item; add `orig_s' field.
- (walk_type): Update prev_val[3].
- (write_types_process_field): New.
- (write_func_for_structure): Take write_types_data structure.
- (write_types): New.
- (ggc_wtd): New.
- (pch_wtd): New.
- (write_types_local_process_field): New.
- (gc_mark_process_field): Delete.
- (write_local_func_for_structure): New.
- (gc_mark_func_name): Delete.
- (write_gc_types): Delete.
- (write_local): New.
- (finish_root_table): Don't include 'ggc_' in PFX.
- (write_root): Rename from write_root. Fill pchw field of structures.
- (write_array): New.
- (write_roots): Rename from write_gc_roots. Split out to write_array.
- Update to changes to other routines. Write gt_pch_cache_rtab table.
- (main): Write PCH walking routines.
- * ggc-common.c: Include toplev.h, sys/mman.h.
- (ggc_mark_roots): For cache hashtables, also mark the hash table
- and the array of entries.
- (saving_htab): New.
- (struct ptr_data): New.
- (POINTER_HASH): New.
- (gt_pch_note_object): New.
- (saving_htab_hash): New.
- (saving_htab_eq): New.
- (struct traversal_state): New.
- (call_count): New.
- (call_alloc): New.
- (compare_ptr_data): New.
- (relocate_ptrs): New.
- (write_pch_globals): New.
- (struct mmap_info): New.
- (gt_pch_save): New.
- (gt_pch_restore): New.
- * ggc-page.c (ROUND_UP_VALUE): New.
- (ROUND_UP): New.
- (struct page_entry): Add field `pch_page'.
- (init_ggc): Use ROUND_UP.
- (struct ggc_pch_data): Declare.
- (init_ggc_pch): New.
- (ggc_pch_count_object): New.
- (ggc_pch_total_size): New.
- (ggc_pch_this_base): New.
- (ggc_pch_alloc_object): New.
- (ggc_pch_prepare_write): New.
- (ggc_pch_write_object): New.
- (ggc_pch_finish): New.
- (ggc_pch_read): New.
- * ggc.h (gt_pointer_operator): New.
- (gt_note_pointers): New.
- (gt_pch_note_object): New prototype.
- (gt_pointer_walker): New.
- (struct ggc_root_tab): Use gt_pointer_walker, add `pchw' field.
- (LAST_GGC_ROOT_TAB): Update.
- (gt_pch_cache_rtab): Declare.
- (gt_pch_scalar_rtab): Declare.
- (struct ggc_cache_tab): Use gt_pointer_walker, add `pchw' field.
- (LAST_GGC_CACHE_TAB): Update.
- (gt_pch_save_stringpool): Declare.
- (gt_pch_restore_stringpool): Declare.
- (gt_pch_p_S): Declare.
- (gt_pch_n_S): Declare.
- (struct ggc_pch_data): Forward-declare.
- (init_ggc_pch): Declare.
- (ggc_pch_count_object): Declare.
- (ggc_pch_total_size): Declare.
- (ggc_pch_this_base): Declare.
- (ggc_pch_alloc_object): Declare.
- (ggc_pch_prepare_write): Declare.
- (ggc_pch_write_object): Declare.
- (ggc_pch_finish): Declare.
- (ggc_pch_read): Declare.
- (gt_pch_save): Declare.
- (gt_pch_restore): Declare.
- * fold-const.c (size_int_type_wide): Allocate size_htab using GGC.
- * emit-rtl.c (init_emit_once): Allocate const_int_htab,
- const_double_htab, mem_attrs_htab using GGC.
- * c-pch.c: Include ggc.h.
- (pch_init): Allow reading PCH file back.
- (c_common_write_pch): Call gt_pch_save.
- (c_common_read_pch): Call gt_pch_restore.
- * c-parse.in (init_reswords): Delete now-untrue comment.
- Allocate ridpointers using GGC.
- * c-objc-common.c (c_objc_common_finish_file): Write PCH before
- calling expand_deferred_fns.
- * c-common.h (ridpointers): Mark for GTY machinery.
- * Makefile.in (stringpool.o): Update dependencies.
- (c-pch.o): Update dependencies.
- (ggc-common.o): Update dependencies.
- * stringpool.c: Include gt-stringpool.h.
- (gt_pch_p_S): New.
- (gt_pch_n_S): New.
- (struct string_pool_data): New.
- (spd): New.
- (gt_pch_save_stringpool): New.
- (gt_pch_restore_stringpool): New.
- * tree.c (init_ttree): Make type_hash_table allocated using GC.
-
- 2002-10-04 Geoffrey Keating <geoffk@apple.com>
-
- * gengtype.c (adjust_field_rtx_def): Don't pass size_t to printf.
- (output_mangled_typename): Don't pass size_t to printf.
-
- * tree.h (union tree_type_symtab): Add tag to `address' field.
- (union tree_decl_u2): Add tag to 'i' field.
- * varasm.c (union rtx_const_un): Add tags to all fields.
- * gengtype.c (struct walk_type_data): New.
- (output_escaped_param): Take struct walk_type_data parameter.
- (write_gc_structure_fields): Delete.
- (walk_type): New.
- (write_gc_marker_routine_for_structure): Delete.
- (write_func_for_structure): New.
- (gc_mark_process_field): New.
- (gc_mark_func_name): New.
- (gc_counter): Delete.
- (write_gc_types): Use write_func_for_structure.
- (write_gc_roots): Use walk_type.
-
- 2002-10-02 Geoffrey Keating <geoffk@apple.com>
-
- * ggc-common.c (ggc_mark_roots): Delete 'x'.
- (ggc_splay_dont_free): Fix warning about unused 'x'.
- (ggc_print_common_statistics): Remove warnings.
-
- 2002-10-01 Mike Stump <mrs@apple.com>
-
- * ggc-common.c (ggc_splay_alloc): Actually return the allocated area.
- * gengtype.c (write_gc_structure_fields): Handle param[digit]_is.
-
- 2002-09-01 Geoffrey Keating <geoffk@redhat.com>
- Catherine Moore <clm@redhat.com>
-
- * Makefile (c-pch.o): Update dependencies.
- (LIBCPP_OBJS): Add cpppch.o.
- (cpppch.o): New.
- * c-common.c (c_common_init): Don't call pch_init here.
- * c-common.h (c_common_read_pch): Update prototype.
- * c-lex.c (c_common_parse_file): Call pch_init here.
- * c-opts.c (COMMAND_LINE_OPTIONS): Add -Winvalid-pch, -fpch-deps.
- (c_common_decode_option): Handle them.
- * c-pch.c: Include c-pragma.h.
- (save_asm_offset): Delete.
- (pch_init): Move contents of save_asm_offset into here, call
- cpp_save_state.
- (c_common_write_pch): Call cpp_write_pch.
- (c_common_valid_pch): Warn only when -Winvalid-pch. Call
- cpp_valid_state.
- (c_common_read_pch): Add NAME parameter. Call cpp_read_state.
- * cppfiles.c (stack_include_file): Update for change to
- parameters of cb.read_pch.
- * cpphash.h (struct cpp_reader): Add `savedstate' field.
- * cpplib.h (struct cpp_options): Add `warn_invalid_pch' and
- `restore_pch_deps' fields.
- (struct cpp_callbacks): Add NAME parameter to `read_pch'.
- (cpp_save_state): Prototype.
- (cpp_write_pch): Prototype.
- (cpp_valid_state): Prototype.
- (cpp_read_state): Prototype.
- * cpppch.c: New file.
- * flags.h (version_flag): Remove prototype.
- * mkdeps.c (deps_save): New.
- (deps_restore): New.
- * mkdeps.h (deps_save): Prototype.
- (deps_restore): Prototype.
- * toplev.c (late_init_hook): Delete.
- (version_flag): Make static again.
- (compile_file): Don't call late_init_hook.
- * toplev.h (late_init_hook): Delete.
- * doc/cppopts.texi: Document -fpch-deps.
- * doc/invoke.texi (Warning Options): Document -Winvalid-pch.
-
- 2002-08-27 Geoffrey Keating <geoffk@redhat.com>
-
- * c-pch.c (c_common_write_pch): Rename from c_write_pch, change
- callers.
- (c_common_valid_pch): Rename from c_valid_pch, change callers.
- (c_common_read_pch): Rename from c_read_pch, change callers.
-
- * c-opts.c (COMMAND_LINE_OPTIONS): Allow -output-pch= to have
- a space between it and its argument.
-
- 2002-08-24 Geoffrey Keating <geoffk@redhat.com>
-
- * c-pch.c: New file.
- * toplev.h (late_init_hook): Declare.
- * toplev.c (late_init_hook): Define.
- (version_flag): Make globally visible.
- (compile_file): Call late_init_hook.
- (init_asm_output): Make output file seekable.
- * gcc.c (default_compilers): Update c-header rule.
- * flags.h (version_flag): Declare.
- * cpplib.h (struct cpp_callbacks): Add 'valid_pch' and 'read_pch'
- fields.
- * cppfiles.c (struct include_file): Add 'pch' field.
- (INCLUDE_PCH_P): New.
- (open_file_pch): New.
- (stack_include_file): Handle PCH files specially.
- (find_include_file): Call open_file_pch instead of open_file.
- (_cpp_read_file): Explain why open_file is used instead of
- open_file_pch.
- * c-opts.c (c_common_decode_option): Correct OPT__output_pch case.
- * c-objc-common.c (c_objc_common_finish_file): Call c_write_pch.
- * c-lex.c (init_c_lex): Set valid_pch and read_pch fields
- in cpplib callbacks.
- * c-common.c (pch_file): Correct comment.
- (allow_pch): Define.
- (c_common_init): Call pch_init.
- * c-common.h (allow_pch): Declare.
- (pch_init): Declare.
- (c_valid_pch): Declare.
- (c_read_pch): Declare.
- (c_write_pch): Declare.
- * Makefile.in (c-pch.o): New.
- (C_AND_OBJC_OBJS): Add c-pch.o.
- * doc/invoke.texi (Precompiled Headers): Add index entries,
- complete truncated paragraph.
-
- 2002-08-17 Geoffrey Keating <geoffk@redhat.com>
-
- * c-common.c: (pch_file): Define.
- * c-common.h (pch_file): Declare.
- * c-opts.c (COMMAND_LINE_OPTIONS): Add --output-pch=.
- (missing_arg): Require --output-pch= to have an argument.
- (c_common_decode_option): Handle --output-pch=.
- * gcc.c: Document new %V.
- (default_compilers): Handle compiling C header files.
- (do_spec_1): Implement %V.
- (main): Handle "gcc foo.h" without trying to run linker.
- * doc/invoke.texi (Invoking GCC): Add new menu item for PCH.
- (Overall Options): Document what the driver does with header files,
- document new -x option possibilities.
- (Invoking G++): More documentation for PCH.
- (Precompiled Headers): New.
-
- 2002-08-09 Geoffrey Keating <geoffk@redhat.com>
-
- * ggc.h: Don't include varray.h. Rearrange functions to be more
- organized.
- (ggc_add_root): Delete.
- (ggc_mark_rtx): Delete.
- (ggc_mark_tree): Delete.
- (struct ggc_statistics): Remove contents.
- * ggc-common.c: Remove unneeded includes.
- (struct ggc_root): Delete.
- (roots): Delete.
- (ggc_add_root): Delete.
- (ggc_mark_roots): Don't mark `roots'. Call ggc_mark_stringpool.
- (ggc_print_common_statistics): Remove most of the contents.
- * Makefile.in (GGC_H): No longer uses varray.h.
- (ggc-common.o): Update dependencies.
- (c-parse.o): Add varray.h to dependencies.
- (c-common.o): Add varray.h.
- * stringpool.c (mark_ident): Use mangled name for tree marker routine.
- (mark_ident_hash): Rename to ggc_mark_stringpool.
- (init_stringpool): Don't use ggc_add_root.
- * c-parse.in: Include varray.h.
- * c-common.c: Include varray.h.
- * objc/Make-lang.in (objc-act.o): Add varray.h.
- * objc/objc-act.c: Include varray.h.
-
- 2002-07-25 Geoffrey Keating <geoffk@redhat.com>
-
- * dwarf2out.c (dw_cfi_oprnd2_desc): Fix ISO-only function definition.
- (dw_cfi_oprnd1_desc): Likewise.
-
- 2002-07-17 Geoffrey Keating <geoffk@redhat.com>
-
- * config/alpha/alpha.c (struct alpha_links): Use gengtype to mark;
- move out of ifdef.
- (alpha_links): Use gengtype to mark; move out of ifdef.
- (mark_alpha_links_node): Delete.
- (mark_alpha_links): Delete.
- (alpha_need_linkage): Use GGC to allocate splay tree, struct
- alpha_links, strings. Don't use ggc_add_root.
- * ggc-common.c (ggc_splay_alloc): New.
- (ggc_splay_dont_free): New.
- * ggc.h (ggc_mark_rtx): Update for changed name mangling.
- (ggc_mark_tree): Likewise.
- (splay_tree_new_ggc): New.
- (ggc_splay_alloc): Declare.
- (ggc_splay_dont_free): Declare.
- * dwarf2asm.c: Include gt-dwarf2asm.h.
- (mark_indirect_pool_entry): Delete.
- (mark_indirect_pool): Delete.
- (indirect_pool): Use gengtype to mark.
- (dw2_force_const_mem): Don't use ggc_add_root.
- * Makefile.in (dwarf2asm.o): Depend on gt-dwarf2asm.h.
- (GTFILES): Add SPLAY_TREE_H, dwarf2asm.c.
- (gt-dwarf2asm.h): Depend on s-gtype.
-
- 2002-07-08 Geoffrey Keating <geoffk@redhat.com>
-
- * tree.h (union tree_type_symtab): Mark `die' field.
- * Makefile.in (dwarf2out.o): Update dependencies.
- * dwarf2out.c: Use GGC to allocate all structures. Convert to htab_t
- hash tables.
- (dw_cfi_oprnd1_desc): New function.
- (dw_cfi_oprnd2_desc): New function.
- (indirect_string_alloc): Delete.
- (debug_str_do_hash): New function.
- (debug_str_eq): New function.
- (mark_limbo_die_list): Delete.
- (dwarf2out_init): Don't call ggc_add_root.
-
-2003-01-09 Vladimir Makarov <vmakarov@redhat.com>
-
- The following changes are merged from itanium-sched-branch:
-
- 2003-01-08 David Edelsohn <edelsohn@gnu.org>
-
- * doc/md.texi: Clarify assignment of units to automata description.
-
- 2003-01-08 Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (unit_decl): Remove members
- `the_same_automaton_unit' and
- `the_same_automaton_message_reported_p'.
- (process_unit_to_form_the_same_automaton_unit_lists,
- form_the_same_automaton_unit_lists_from_regexp,
- form_the_same_automaton_unit_lists, the_same_automaton_lists):
- Remove them.
- (annotation_message_reported_p): New global variable.
- (check_unit_distribution_in_reserv,
- check_regexp_units_distribution): New functions.
- (check_unit_distributions_to_automata): Rewrite it.
-
- 2003-01-04 Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (form_the_same_automaton_unit_lists_from_regexp):
- Use continue instead of break if cycle is too big.
-
- 2002-12-20 Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (check_unit_distributions_to_automata): Output at
- most one message for a unit.
- (process_unit_to_form_the_same_automaton_unit_lists): Check
- automaton of units instead of units themself.
-
- * doc/md.texi: Describe the constraint about assigning unit to
- automata.
-
- 2002-12-20 Jan Hubicka <jH@suse.cz>
- Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (unit_decl): Add new members `min_occ_cycle_num'
- and `in_set_p'.
- (gen_cpu_unit): Initialize the new members.
- (process_regexp_cycles): Calculate minimal finish cycle too. Set
- up `min_occ_cycle_num'.
- (evaluate_max_reserv_cycles): Change the function call.
- (CLEAR_BIT): New macro.
- (states_union, state_shift): Use the mask.
- (initiate_excl_sets, form_reserv_sets_list): Set up `in_set_p'.
- (form_reservs_matter): New function.
- (make_automaton): Call the function and use the mask.
- (estimate_one_automaton_bound): Take `min_occ_cycle_num' into
- account.
-
- 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/itanium2.md (lfetch): Change the insn reservation.
-
- 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.c (bundling): Try to insert 2 nops for M insn
- for Itanium.
-
- 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.c (ia64_override_options): Make itanium2 as
- default cpu.
-
- 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
- 2002-10-31 Dale Johannesen <dalej@apple.com>
-
- * haifa-sched.c (find_set_reg_weight): New function.
- (find_insn_reg_weight): Use the new function.
- (schedule_block): Do sorting ready queue always
- after insn issue.
-
- 2002-11-27 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.c (bundling): Use MFI template instead of MLX.
-
- 2002-11-19 Vladimir Makarov <vmakarov@redhat.com>
-
- * haifa-sched.c (choice_entry): New structure.
- (choice_stack, cycle_issued_insns): New variables.
- (max_issue): Rewrite it.
- (choose_ready): Set up ready_try for unknown insns too.
- (schedule_block): Allocate and free choice_stack. Set up
- and modify cycle_issued_insns.
-
- * config/ia64/ia64.c (issue_nops_and_insn): Combine insn issue
- with and without filling the bundle.
- (bundling): Combine calls of issue_nops_and_insn.
-
- 2002-10-17 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/itanium1.md: New file.
-
- * config/ia64/itanium2.md: New file.
-
- * config/ia64/ia64.md: Move DFA descriptions into the new files.
- Remove the old pipeline description.
-
- * config/ia64/ia64.c (ia64_override_options): Add aliases of
- itanium processor names.
-
- 2002-10-16 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.c (bundling): Print states for Itanium2 too.
- (ia64_reorg): Set up queried unit codes for Itanium2 too.
-
- * config/ia64/ia64.md: Add descriptions for Itanium2.
-
- 2002-10-08 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.h (processor_type): New enumeration.
- (ia64_tune, ia64_tune_string): New external declarations.
- (TARGET_OPTIONS): Add option `tune='.
-
- * config/ia64/ia64.c (ia64_tune, ia64_tune_string): New global
- variables.
- (ia64_override_options): Set up `ia64_tune'.
- (ia64_sched_reorder2): Set up `clocks' only for Itanium.
- (ia64_dfa_new_cycle): Set up `add_cycles' only for Itanium.
- (bundling): Add nops for MM-insns only for Itanium.
- (ia64_reorg): Allocate and free `clocks' and `add_cycles' only for
- Itanium.
-
- * config/ia64/ia64.md (cpu): New attribute.
- (DFA description): Enable it only for Itanium.
-
- 2002-10-08 Vladimir Makarov <vmakarov@redhat.com>
- Richard Henderson <rth@redhat.com>
-
- * config/ia64/ia64.h (MASK_TUNE_STOP_BITS): Rename it to
- MASK_EARLY_STOP_BITS.
- (TARGET_TUNE_STOP_BITS): Rename it to TARGET_EARLY_STOP_BITS.
- (TARGET_SWITCHES): Rename option `tune-stop-bits' to
- `early-stop-bits'.
-
- * config/ia64/ia64.c (ia64_dfa_new_cycle,
- final_emit_insn_group_barriers): Use TARGET_EARLY_STOP_BITS
- instead of TARGET_TUNE_STOP_BITS.
-
- * doc/invoke.texi: Rename option `-mtune-stop-bits' to
- `-mearly-stop-bits'.
-
- * config/ia64/ia64.c (automata_option "v"): Comment it.
-
- 2002-10-07 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.h (MASK_TUNE_STOP_BITS, TARGET_TUNE_STOP_BITS):
- New macros.
- (TARGET_SWITCHES): Add entries for the new option.
-
- * config/ia64/ia64.c (dfa_stop_insn, last_scheduled_insn, rtx
- dfa_pre_cycle_insn, ia64_nop): Don't make them as roots for GC.
- (stops_p, stop_before_p, clocks_length, clocks, add_cycles): New
- global variables.
- (ia64_sched_reorder2): Set up `clocks'.
- (ia64_variable_issue): Set up `stops_p' and reset `stop_before_p'.
- (ia64_dfa_new_cycle): Set up add_cycle. Permit sorting ready
- queue when TARGET_TUNE_STOP_BITS.
- (bundling): Insert additional nops for MM-insns.
- (final_emit_insn_group_barriers): Add insertion of stop bits
- according `stops_p'.
- (ia64_reorg): Initiate the new varibales.
-
- * doc/invoke.texi: Add description of option `-mtune-stop-bits'.
-
- 2002-10-02 Vladimir Makarov <vmakarov@redhat.com>
-
- * haifa-sched.c (schedule_block): Modify INSN_TICK of depended
- insns at the end of block insn scheduling.
-
- 2002-09-30 Vladimir Makarov <vmakarov@redhat.com>
-
- * sched-deps.c (remove_dependence, group_leader): Remove it.
- (add_dependence): Add dependence to group leader to.
- (set_sched_group_p): Add dependence to the first insn of the
- schedule group too.
- (sched_analyze_insn): Make dependence to jump as anti-dependence.
- Change true dependence by anti-dependence when
- `reg_pending_barrier'.
-
- * sched-rgn.c (init_ready_list, can_schedule_ready_p,
- add_branch_dependences): Ignore schedule groups.
-
- * sched-ebb.c (init_ready_list): Ditto.
-
- * (move_insn, set_priorities): Ditto.
-
- * config/ia64/ia64.c (ia64_sched_init): Check that schedule group
- flag is clear after reload.
- (adjust_cost): Change cost only for output dependencies.
-
- * config/ia64/ia64.md: Add more insns into bypass for MM-insns.
-
- 2002-09-26 Vladimir Makarov <vmakarov@redhat.com>
-
- * Makefile.in (sched-ebb.o): Add `$(TARGET_H)' to the entry.
-
- * target.h (gcc_target): Add member
- `dependencies_evaluation_hook'.
-
- * target-def.h (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK): New
- macro.
- (TARGET_SCHED): Add initiatialization of the new member.
-
- * sched-ebb.c: Include `target.h'.
- (schedule_ebb): Call `dependencies_evaluation_hook'.
-
- * sched-rgn.c (schedule_region): Call
- `dependencies_evaluation_hook'.
-
- * config/ia64/ia64.c (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK):
- New macro.
- (ia64_dependencies_evaluation_hook): New function.
-
- * doc/tm.texi (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK):
- Describe the new hook.
-
- 2002-09-25 Vladimir Makarov <vmakarov@redhat.com>
-
- * target.h (gcc_target): Add members
- `first_cycle_multipass_dfa_lookahead_guard' and `dfa_new_cycle'.
-
- * target-def.h (TARGET_SCHED_DFA_NEW_CYCLE,
- TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): New
- macros.
- (TARGET_SCHED): Add initiatialization of the new members.
-
- * haifa-sched.c (schedule_insn): Update last_clock_var for the 1st
- insn scheduling too.
- (choose_ready): Use `first_cycle_multipass_dfa_lookahead_guard' to
- initialize `ready_try'.
- (schedule_block): Use `dfa_new_cycle'. Sort `ready' only unless
- `dfa_new_cycle' says not to do it.
-
- * config/ia64/ia64.md: Add DFA Itanium 1 description for insn
- bundling.
-
- * config/ia64/ia64.h (CPU_UNITS_QUERY): New macro.
-
- * config/ia64/ia64.c: Include `hashtab.h'.
- (ia64_first_cycle_multipass_dfa_lookahead_guard,
- ia64_dfa_new_cycle, final_emit_insn_group_barriers,
- ia64_dfa_sched_reorder, get_free_bundle_state, free_bundle_state,
- initiate_bundle_states, finish_bundle_states, bundle_state_hash,
- bundle_state_eq_p, insert_bundle_state,
- initiate_bundle_state_table, finish_bundle_state_table,
- try_issue_nops, try_issue_insn, issue_nops_and_insn, get_max_pos,
- get_template, get_next_important_insn, bundling): New functions.
- (ia64_internal_sched_reorder): Remove it.
- (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD,
- TARGET_SCHED_DFA_NEW_CYCLE): New macros.
- (ia64_safe_itanium_requires_unit0): Remove it.
- (group_barrier_needed_p): Place group barrier right before a real
- insn.
- (bundle, ia64_packet, NR_PACKETS, type_names, packets, packets):
- Remove them.
- (bundle_name): New variable.
- (_0mii_, _0mmi_, _0mfi_, _0mmf_, _0bbb_, _0mbb_, _0mib_, _0mmb_,
- _0mfb_, _0mlx_, _1mii_, _1mmi_, _1mfi_, _1mmf_, _1bbb_, _1mbb_,
- _1mib_, _1mmb_, _1mfb_, _1mlx_, pos_1, pos_2, pos_3, pos_4, pos_5,
- pos_6, dfa_stop_insn, last_scheduled_insn, dfa_state_size,
- temp_dfa_state, prev_cycle_state): New global variables.
- (insn_matches_slot, maybe_rotate, finish_last_head,
- rotate_one_bundle, rotate_one_bundles, nop_cycles_until,
- cycle_end_fill_slots, packet_matches_p, get_split, find_best_insn,
- find_best_packet, itanium_reorder, dump_current_packet,
- schedule_stop, gen_nop_type, ia64_emit_nops): Remove them.
- (sched_data, sched_ready, sched_types): Remove them.
- (ia64_sched_init): Initiate only `last_scheduled_insn' and call
- `init_insn_group_barriers'.
- (ia64_sched_reorder, ia64_sched_reorder2): Call
- ia64_dfa_sched_reorder.
- (ia64_variable_issue): Rewrite it.
- (bundle_state): New structure.
- (index_to_bundle_states, bundle_states_num,
- allocated_bundle_states_chain, free_bundle_state_chain): New
- global variables.
- (ia64_sched_finish): Add stop bits and call `bundling' after the
- 2nd insn scheduling.
- (ia64_use_dfa_pipeline_interface): Return zero always.
- (ia64_first_cycle_multipass_dfa_lookahead): Return 6 for the 2nd
- insn scheduling.
- (ia64_init_dfa_pre_cycle_insn): Initialize `dfa_state_size',
- `temp_dfa_state', `prev_cycle_state', and `dfa_stop_insn'.
- (ia64_reorg): Add bundling insns.
-
- * doc/tm.texi
- (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD,
- TARGET_SCHED_DFA_NEW_CYCLE): Describe the new hooks.
-
- 2002-09-23 Vladimir Makarov <vmakarov@redhat.com>
-
- * config/ia64/ia64.md: Add Itanium1 DFA description.
- (itanium_class): Add `nop' and `pre_cycle'. Add
- define_function_unit for `nop'.
- (nop): Change attribute `itanium_class'.
- (pre_cycle): New define_insn.
-
- * config/ia64/ia64-protos.h (bundling_p): New external variable.
- (ia64_st_address_bypass_p, ia64_ld_address_bypass_p,
- ia64_produce_address_p): New function prototypes.
-
- * config/ia64/ia64.c (bundling_p): New global variable.
- (ia64_use_dfa_pipeline_interface,
- ia64_first_cycle_multipass_dfa_lookahead,
- ia64_init_dfa_pre_cycle_insn, ia64_dfa_pre_cycle_insn): New
- functions.
- (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE,
- TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD,
- TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN,
- TARGET_SCHED_DFA_PRE_CYCLE_INSN): New macros.
- (ia64_sched_init, ia64_sched_reorder, ia64_sched_reorder2,
- ia64_variable_issue, ia64_sched_finish): Do nothing before reload.
- (dfa_pre_cycle_insn): New variable.
-
- 2002-09-20 Vladimir Makarov <vmakarov@redhat.com>
-
- * rtl.def (FINAL_PRESENCE_SET, FINAL_ABSENCE_SET): New
- constructions.
-
- * genattrtab.h (gen_final_presence_set, gen_final_absence_set):
- New function prototypes.
-
- * genattrtab.c (main): Process the new constructions.
-
- * genautomata.c (gen_presence_absence_set,
- process_presence_absence_names, process_presence_absence_patterns,
- add_presence_absence, check_absence_pattern_sets): Add parameter
- `final_p'.
- (unit_decl): Add new members `final_presence_list' and
- `final_absence_list'.
- (unit_pattern_rel_decl): Add new member `final_p'.
- (gen_final_presence_set, gen_final_absence_set): New functions.
- (process_decls): Use member `final_p'.
- (temp_reserv): New global variable.
- (reserv_sets_are_intersected): Add processing `final_presence_set'
- and `final_absence_set'.
- (initiate_states): Allocate `temp_reserv'.
- (unit_final_presence_set_table, unit_final_absence_set_table): New
- gloabal variables.
- (initiate_presence_absence_pattern_sets): Initiate them.
- (NDFA_to_DFA): Fix typo.
- (output_description): Output `final_presence_set' and
- `final_absence_set'.
-
- * doc/md.texi (final_presence_set, final_absence_set): Describe
- them.
-
- 2002-09-20 Vladimir Makarov <vmakarov@redhat.com>
-
- * genautomata.c (transform_3): Process a missing case (nothing on
- unit place).
-
- 2002-09-20 Vladimir Makarov <vmakarov@redhat.com>
-
- * rtl.def (DEFINE_QUERY_CPU_UNIT, AUTOMATA_OPTION): Change
- comments about queried units and the minimization.
-
- * doc/md.texi: Ditto.
-
- * genautomata.c (create_composed_state): Return nonzero if the new
- state has been created.
- (first_cycle_unit_presence): New function.
- (state_is_differed): Add new parameter. Use the new function.
- Take queried units into account.
- (partition_equiv_class): Pass additional parameter to
- `state_is_differed'.
- (merge_states): Process composed states too.
- (build_automaton, create_automata, output_min_issue_delay_table,
- output_tables, output_statistics): Output more information.
- (output_reserved_units_table): Use function
- `first_cycle_unit_presence'.
- (output_tables): Output table of queried units even if the
- minimization is switched on.
- (write_automata): Output code for querying units even if the
- minimization is switched on.
-
- 2002-09-19 Vladimir Makarov <vmakarov@redhat.com>
-
- * rtl.def (PRESENCE_SET, ABSENCE_SET): Add comments about extended
- syntax of the constructions.
-
- * doc/md.texi (PRESENCE_SET, ABSENCE_SET): Add description of
- extended syntax of the constructions.
-
- * genautomata.c (unit_rel_decl): Rename it to
- `unit_pattern_rel_decl'.
- (pattern_set_el, pattern_reserv): New structures.
- (pattern_set_el_t, pattern_reserv_t): New types.
- (gen_presence_absence_set): New function.
- (process_presence_absence): Remove it.
- (process_presence_absence_names,
- process_presence_absence_patterns): New functions.
- (get_presence_absence_set): Remove it.
- (initiate_presence_absence_sets): Rename it on
- `initiate_presence_absence_pattern_sets'. Use new function
- `form_reserv_sets_list'.
- (form_reserv_sets_list, check_presence_pattern_sets,
- check_absence_pattern_sets, output_pattern_set_el_list): New
- functions.
- (unit_decl): Change types of members `presence_list' and
- `absence_list'.
- (unit_rel_decl): Rename member `names_num' to `all_names_num'.
- (decl): Change types of members `excl', `presence', and `absence'.
- (get_str_vect): Rename `par_flag' to `paren_p'. Add null element
- at the end of the vector.
- (gen_cpu_unit, gen_query_cpu_unit, gen_bypass, gen_excl_set,
- gen_automaton, gen_regexp_repeat, gen_regexp_allof,
- gen_regexp_oneof, gen_regexp_sequence): Use boolean values.
- (gen_presence_set, gen_absence_set): Use new function
- `gen_presence_absence_set'.
- (add_presence_absence): Process `pattern_list' instead of
- `source_list'.
- (process_decls): USe new functions
- `process_presence_absence_names' and
- `process_presence_absence_patterns'.
- (reserv_sets_are_intersected): Use new function
- `check_presence_pattern_sets'.
- (presence_set, absence_set): Remove them.
- (unit_presence_set_table, unit_absence_set_table): New global
- variables.
- (output_description): Use new function
- `output_pattern_set_el_list'.
- (generate): Use `initiate_presence_absence_pattern_sets'.
-
- 2002-09-18 Vladimir Makarov <vmakarov@redhat.com>
-
- * genattr.c (main): Add output of prototype of new interface
- function `dfa_clean_insn_cache'.
-
- * genautomata.c (output_dfa_clean_insn_cache_func): New function.
- (DFA_CLEAN_INSN_CACHE_FUNC_NAME): New macro.
- (output_dfa_start_func): Use function `dfa_clean_insn_cache' in
- the generated code.
- (write_automata): Call the new function.
-
-2003-01-09 Jan Hubicka <jh@suse.cz>
-
- * i386.md (unit, prefix_0f, memory attributes): Hanlde sseicvt
- correctly.
-
-2003-01-09 Paolo Carlini <pcarlini@unitus.it>
-
- * doc/tm.texi (EXTRA_ADDRESS_CONSTRAINT): Fix typo.
-
-2003-01-09 J"orn Rennecke <joern.rennecke@superh.com>
-
- * defaults.h (EXTRA_MEMORY_CONSTRAINT): Add STR argument.
- (EXTRA_ADDRESS_CONSTRAINT): Likewise.
- (CONSTRAINT_LEN): Provide default definition.
- (CONST_OK_FOR_CONSTRAINT_P): Likewise.
- (CONST_DOUBLE_OK_FOR_CONSTRAINT_P): Likewise.
- (EXTRA_CONSTRAINT_STR): Likewise.
- (REG_CLASS_FROM_CONSTRAINT): Define.
- * genoutput.c (check_constraint_len, constraint_len): New functions.
- (validate_insn_alternatives): Check CONSTRAINT_LEN for each
- constraint / modifier.
- (gen_insn): Call check_constraint_len.
- * local-alloc.c (block_alloc): Update to use new macros / pass
- second argument to EXTRA_{MEMORY,ADDRESS}_CONSTRAINT.
- * ra-build.c (handle_asm_insn): Likewise.
- * recog.c (asm_operand_ok, preprocess_constraints): Likewise.
- (constrain_operands, peep2_find_free_register): Likewise.
- * regclass.c (record_operand_costs, record_reg_classes): Likewise.
- * regmove.c (find_matches): Likewise.
- * reload.c (push_secondary_reload, find_reloads): Likewise.
- (alternative_allows_memconst): Likewise.
- * reload1.c (maybe_fix_stack_asms): Likewise.
- (reload_cse_simplify_operands): Likewise.
- * stmt.c (parse_output_constraint, parse_input_constraint): Likewise.
- * doc/tm.texi (CONSTRAINT_LEN, REG_CLASS_FROM_CONSTRAINT): Document.
- (CONST_OK_FOR_CONSTRAINT_P): Likewise.
- (CONST_DOUBLE_OK_FOR_CONSTRAINT_P, EXTRA_CONSTRAINT_STR): Likewise.
- (EXTRA_MEMORY_CONSTRAINT, EXTRA_ADDRESS_CONSTRAINT): Add STR argument.
- * config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Likewise.
-
- * sh.h (OVERRIDE_OPTIONS): Allow first scheduling pass for SH5.
-
-2003-01-09 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*extzv_1_r_h8300): Correct the insn
- length.
- (*extzv_1_r_h8300hs): Likewise.
- (*extzv_1_r_inv_h8300): Likewise.
- (*extzv_1_r_inv_h8300hs): Likewise.
-
-2003-01-09 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.h (PREDICATE_CODES): New.
-
-2003-01-09 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*addsi3_upper): New.
- (*iorsi3_shift): Likewise.
- (two splitters): Likewise.
- (*addsi3_shift): Likewise.
- (two splitters): Likewise.
-
-2003-01-09 Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
-
- * Makefile.in (optabs.o): Add dependency on basic-block.h.
- * basic-block.h (control_flow_insn_p): Fuction was exported.
- * cfgbuild.c (control_flow_insn_p): Fuction was made non-static.
- * optabs.c (emit_libcall_block): Emit REG_LIBCALL and REG_RETVAL
- notes only when the region is contained in a single basic block.
-
-2003-01-09 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR inline-asm/8832
- * tree.h (expand_asm): New prototype.
- * stmt.c (expand_asm): Set the MEM_VOLATILE_P flag if instructed
- to do so.
- * c-semantics (genrtl_asm_stmt): Pass the RID_VOLATILE qualifier
- down to expand_asm.
- * c-typeck.c (simple_asm_stmt): Set the RID_VOLATILE qualifier.
- * rtlanal.c (volatile_insn_p) [ASM_INPUT]: Test the MEM_VOLATILE_P flag.
- (volatile_refs_p) [ASM_INPUT]: Likewise.
- (side_effects_p) [ASM_INPUT]: Likewise.
-
-2003-01-09 Jan Hubicka <jh@suse.cz>
-
- * i386.md (*mul*): FIx constraints; remove confused comment; fix
- athlon_decode attributes
- (imul/k8 optimization peep2s): New.
-
- * athlon.md (athlon_ssecmp*): Handle ssecomi as well.
- * i386.md (type attribute): Add ssecomi.
- (unit, memory, prefix attributes): Handle ssecomi.
- (cvt?2? patterns): Fix athlon_decode attribute
- (comi patterns): Set attribute to ssecomi.
-
- PR target/8343
- * m68k.md (umulsidi, mulsidi expanders): Use register operand.
-
-2003-01-09 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.h (PREDICATE_CODES): Add ADDRESSOF for predicates
- that match register_operands.
- * config/mips/mips.c (reg_or_0_operand, true_reg_or_0_operand): Make
- register_operand the default case.
-
-2003-01-09 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR c/8032
- * c-typeck.c (process_init_element) [RECORD_TYPE]: For
- an empty element, do not advance the pointer to unfilled
- fields if there are pending initializers.
-
-2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
-
- * Makefile.in (ORDINARY_FLAGS_TO_PASS): Also pass DESTDIR.
- (install-gcc-tooldir, install-cpp, installdirs,
- install-common, install-driver, install-info, install-man,
- install-headers, install-include-dir, install-headers-tar,
- install-headers-cpio, install-headers-cp, install-mkheaders,
- install-collect2, uninstall): Prepend $(DESTDIR) to
- destination paths in all (un)installation commands.
- (install-driver): Rewrite $(LN) commands to support DESTDIR
- with "ln" as well as with "ln -s".
- (installdirs): Simply use mkinstalldirs.
- (install-libgcc, install-multilib): Also pass DESTDIR.
- * mklibgcc.in: Prepend $(DESTDIR) to $(libsubdir) in the
- installation destination variable ldir.
- * config/alpha/t-osf4, config/arm/t-netbsd,
- config/ia64/t-hpux, config/mips/t-iris5-6,
- config/pa/t-hpux-shlib, config/rs6000/t-aix43,
- config/rs6000/t-aix52, config/t-slibgcc-elf-ver,
- config/t-slibgcc-sld: Prepend $$(DESTDIR) to $$(slibdir)
- in the definition of SHLIB_INSTALL.
- * config/arc/t-arc (install-multilib-arc): Prepend $(DESTDIR) to
- $(libsubdir) in the installation commands.
-
-2003-01-08 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * config/sh/sh.h (CASE_VECTOR_MODE): Use SImode for a
- non-optimizing compile.
- (ASM_OUTPUT_ADDR_VEC_ELT): Use .long for a non-optimizing
- compile.
-
-2003-01-08 Douglas B Rupp <rupp@gnat.com>
-
- * config/i386/i386.c (ix86_attribute_table): Add new attributes
- ms_struct and gcc_struct.
- (ix86_handle_struct_attribute): New function.
- (ix86_ms_bitfield_layout_p): Update to take new attributes
- into account.
- * doc/extend.texi: Document new attributes.
- * testsuite/gcc.dg/bf-ms-attrib.c: New test.
-
-2003-01-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- PR optimization/8750
- * config/i386/i386.c (ix86_expand_prologue): Don't allow
- scheduling pass to move insns across __alloca call.
-
-2003-01-08 Dale Johannesen <dalej@apple.com>
-
- * config/rs6000/rs6000.md: Replace *store_multiple_string
- with *stmsi[3-8].
-
-2003-01-08 Jeff Sturm <jsturm@one-point.com>
-
- PR target/9210
- * config/rs6000/rs6000.c (rs6000_elf_encode_section_info):
- Set SYMBOL_REF_FLAG on local data sym_ref.
-
-2003-01-08 Dale Johannesen <dalej@apple.com>
-
- * function.c (assign_parms): Don't set pretend_args_size if
- REG_PARM_STACK_SPACE.
- config/rs6000/rs6000.c (setup_incoming_varargs): Don't set
- pretend_args_size.
-
-2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
-
- * gcc.hlp: Delete.
-
-2003-01-09 Jan Hubicka <jh@suse.cz>
-
- * i386.c (ix86_expand_int_addcc): Fix thinko.
-
-2003-01-08 David Edelsohn <edelsohn@gnu.org>
-
- * config/rs6000/rs6000.h (FUNCTION_MODE): Always use SImode.
- * config/rs6000/rs6000.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Redefine
- as hook_bool_tree_hwi_hwi_tree_true.
- (rs6000_emit_allocate_stack): Use TARGET_32BIT.
- (rs6000_emit_epilogue): Same.
- (rs6000_output_mi_thunk): Re-implement as RTL.
- * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Call
- xcoffout_declare_function if any debugging enabled.
-
-2003-01-08 Chris Demetriou <cgd@broadcom.com>
-
- * config.gcc (mipsisa32r2-*-elf*, mipsisa32r2el-*-elf*): New
- targets, to support MIPS32 Release 2 (MIPS32R2) configurations.
- * config/mips/mips.h (enum processor_type): Rename
- PROCESSOR_R4KC to PROCESSOR_4KC, PROCESSOR_R5KC to
- PROCESSOR_5KC, and PROCESSOR_R20KC to PROCESSOR_20KC.
- Add PROCESSOR_M4K.
- (TARGET_MIPS4KC, TARGET_MIPS5KC): Update for the renaming.
- (ISA_MIPS32R2): New define.
- (GENERATE_MULT3_SI, ISA_HAS_CONDMOVE, ISA_HAS_8CC)
- (ISA_HAS_MADD_MSUB, ISA_HAS_CLZ_CLO)
- (ISA_HAS_PREFETCH): Add support for MIPS32R2.
- (MIPS_ISA_DEFAULT): Likewise. Also, fix indentation.
- (TARGET_CPU_CPP_BUILTINS): Add support for MIPS32R2. Add new
- predefine __mips_isa_rev for MIPS32, MIPS32R2, and MIPS64.
- (ISA_HAS_ROTR_SI): Add support for MIPS32R2, and avoid if
- compiling MIPS16 code.
- (ISA_HAS_ROTR_DI): Do not use if compiling MIPS16 code, and fix
- comment.
- (ISA_HAS_SEB_SEH): New define.
- (ASM_SPEC, LINK_SPEC): Pass -mips32r2 to assembler and linker.
- * config/mips/mips.c (mips_cpu_info_table): Adjust for enum
- processor_type value renaming. Add support for MIPS32R2.
- Clean up comments, and move "sb1" entry with other MIPS64 CPU
- entries.
- (override_options): Reimplement -mipsN option handling so that
- it will work correctly for -mips32r2. Avoid branch-likely
- instructions on MIPS32R2.
- * config/mips/mips.md (mulsi3_mult3): Add support for MIPS32R2.
- (extendhisi2): Use extendhisi2_hw if ISA_HAS_SEB_SEH.
- (extendqisi2): Use extendqisi2_hw if ISA_HAS_SEB_SEH.
- (extendhisi2_hw, extendqisi2_hw): New.
- * config/mips/netbsd.h (TARGET_CPU_CPP_BUILTINS): Add support
- for MIPS32R2. Add new predefine __mips_isa_rev for MIPS32,
- MIPS32R2, and MIPS64.
- (LINK_SPEC): Pass -mips32r2 to linker.
- * config/mips/t-isa3264: Built -mips32r2 multilibs.
- * doc/invoke.texi (MIPS Options): Add -mips32r2, add support
- for mips32r2 in the -march description. Alphabetically sort
- CPU names in the -march description. Add long-missed -mips32
- and -mips64 to MIPS option summary.
-
- * config.gcc: Update copyright years to include 2003.
- * config/mips/mips.c: Likewise.
- * config/mips/mips.h: Likewise.
- * config/mips/mips.md: Likewise.
- * config/mips/netbsd.h: Likewise.
- * doc/invoke.texi: Likewise.
-
-2003-01-08 Andreas Schwab <schwab@suse.de>
-
- * aclocal.m4 (gcc_AC_INITFINI_ARRAY): Fix spelling of cache
- variable.
- * configure: Regenerated.
-
-2003-01-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_logical_op): Replace byte/word
- extraction of det with b0, b1, w0, w2, etc.
- (compute_logical_op_length): Likewise.
- (compute_logical_op_cc): Likewise.
-
-2003-01-08 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.h (CONSTANT_ADDRESS_P): Allow CONST and
- HIGH on all variants.
-
-2003-01-08 Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
-
- * Makefile.in (PARTITION_H): New.
- (BASIC_BLOCK_H): Added hard-reg-set.h and $(PARTITION_H).
- * basic-block.h: Include hard-reg-set.h.
-
-2003-01-08 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.h (ENABLE_XF_PATTERNS): Delete.
- * arm.md (addxf3, subxf3, mulxf3, divxf3, modxf3, negxf2, absxf2)
- (sqrtxf2, floatsixf2, fix_truncxfsi2, truncxfsf2, truncxfdf2)
- (extendsfxf2, extenddfxf2, movxf, cmpxf, cmpxf_insn)
- (cmpxf_trap): Delete.
- (movxf_hard_insn): Remove test of ENABLE_XF_PATTERNS.
-
-2003-01-08 Jan Hubicka <jh@suse.cz>
-
- * i386.md (adddi3_carry_rex64, subdi3_carry_rex64): Name pattern.
- (addhi3_carry, addqi3_carry, subhi3_carry, subqi3_carry): New patterns.
- (add??cc): New expanders.
- * i386.c (expand_int_addcc): New function.
- * i386-protos.h (expand_int_addcc): Declare.
-
- * alias.c (memory_modified_1): New static function.
- (memory_modified): New static varaible.
- (memory_modified_in_insn_p): New global function.
- * rtl.h (memory_modified_in_insn_p): Declare.
- * rtlanal.c (modified_between_p, modified_in_p): Be smart about memory
- references.
-
- * expr.h (emit_conditional_add): Declare.
-
-2003-01-07 Janis Johnson <janis187@us.ibm.com>
-
- PR other/8947
- * doc/invoke.texi (-malign-double): Explain that the option breaks
- binary compatibility.
-
-2003-01-08 Andreas Schwab <schwab@suse.de>
-
- * config.gcc (m68k-*-linux*): Don't set extra_parts and gnu_ld,
- should come from the generic *-*-linux* entry.
-
-2003-01-07 Jan Hubicka <jh@suse.cz>
-
- * cselib.c (cselib_current_insn_in_libcall): New static variable.
- (new_elt_loc_list, cselib_process_insn, cselib_init): Keep track on whether
- we are inside libcall.
- * cselib.h (elt_loc_list): Add in_libcall.
- * gcse.c (do_local_cprop): Do not copy propagate using insns
- in libcalls.
-
-2003-01-07 David Edelsohn <edelsohn@gnu.org>
-
- * doc/tm.texi (TARGET_SCHED_VARIABLE_ISSUE): CLOBBER and USE do
- not normally affect to issue rate.
-
-2003-01-07 Jan Hubicka <jh@suse.cz>
-
- * genopinit.c (optabs): Add addc_optab.
- * ifcvt.c (noce_try_store_flag): Rename to ...
- (noce_try_addcc): ... this one; handle generic conditional increment.
- (noce_process_if_block): Update noce_try_addcc call.
- * optabs.c (emit_conditional_add): New.
- (init_obtabs): Initialize addc_optab.
- * optabs.h (optab_index): Add OTI_addcc.
- (addcc_optab): New macro.
- * md.texi: Document addMcc
-
- PR target/8322
- * i386.c (ix86_init_mmx_sse_builtins): Constify arguments of loads.
- * xmmintrin.h (_mm_load*_si128. _mm_store*_si128): Add casts.
- * xmmintrin.h (_mm_load*_si128. _mm_store*_si128): Add casts.
-
- * reload1.c (delete_output_reload): Avoid repeated attempts
- to delete insn.
-
-2003-01-07 Andreas Schwab <schwab@suse.de>
-
- * configure.in: Restore CFLAGS before gcc_AC_INITFINI_ARRAY.
- Move --enable-initfini-array check ...
- * aclocal.m4 (gcc_AC_INITFINI_ARRAY): ... here. Define
- HAVE_INITFINI_ARRAY also when --enable-initfini-array is given.
- Don't AC_SUBST gcc_cv_initfinit_array. Use AC_TRY_RUN.
- * configure: Rebuild.
-
-2003-01-07 Richard Henderson <rth@redhat.com>
-
- * alias.c (find_base_value): Only use new_reg_base_value shortcut
- if the register is set once.
-
-2003-01-07 Sylvain Pion <Sylvain.Pion@mpi-sb.mpg.de>
-
- * config/i386/i386.c (ix86_init_mmx_sse_builtins):
- __builtin_ia32_ldmxcsr and __builtin_ia32_stmxcsr are SSE, not MXX.
- * config/i386/i386.md (ldmxcsr, stmxcsr): SSE, not MMX.
-
-2003-01-07 Benjamin Kosnik <bkoz@redhat.com>
- Sunil Davasam <sunil.k.davasam@intel.com>
-
- PR libstdc++/9076
- * unwind-dw2.c (execute_cfa_program): DW_CFA_undefined,
- DW_CFA_same_value, read next and ignore.
-
-2003-01-07 Richard Henderson <rth@redhat.com>
-
- * cfganal.c (flow_call_edges_add): Don't crash on noreturn call.
-
-2003-01-07 Daniel Berlin <dberlin@dberlin.org>
-
- * cfg.c: Include alloc-pool.h
- (edge_pool): New pool.
- (bb_pool): New pool.
- (first_deleted_edge): Remove.
- (first_deleted_block): Remove.
- (init_flow): Alloc/free the pools.
- (free_edge): Use pools.
- (alloc_block): Ditto.
- (expunge_block): Ditto.
- (cached_make_edge): Ditto.
-
- * Makefile.in (cfg.o): Add alloc-pool.h dependency.
-
-2003-01-07 Daniel Berlin <dberlin@dberlin.org>
-
- * et-forest.c: Include alloc-pool.h.
- (struct et_forest): Add node_pool and occur_pool.
- (et_forest_create): Create the new pools.
- (et_forest_delete): Delete them.
- (et_forest_add_node): Allocate and free using pools.
- (et_forest_add_edge): Ditto.
- (et_forest_remove_node): Ditto.
- (et_forest_remove_edge): Ditto.
-
- * Makefile.in (et-forest.o): Add alloc-pool.h dependency.
-
-2003-01-07 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_logical_op): Simplify and
- optimize the handling of SImode.
- * config/h8300/h8300.c (compute_logical_op_length): Update
- accordingly.
- * config/h8300/h8300.c (compute_logical_op_cc): Likewise.
-
-2003-01-07 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.c (mips_va_arg): In the EABI code, apply the
- big-endian correction to indirect arguments too.
-
-2003-01-06 Aldy Hernandez <aldyh@redhat.com>
-
- Segher Boessenkool <segher@koffie.nl>
-
- * config/rs6000/rs6000.c (rs6000_reg_names): Add missing registers.
- (alt_reg_names): Ditto, fix formatting.
- * config/rs6000/rs6000.h (DEBUG_REGISTER_NAMES): Fix formatting.
-
-2003-01-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (final_prescan_insn): Constify uid.
- (output_logical_op): Constify intval and det.
- (compute_logical_length): Likewise.
- (compute_logical_cc): Likewise.
- (output_a_shift): Constify mask.
- (h8300_encode_label): Constify len.
-
-2003-01-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (h8300_expand_prologue): Remove fsize.
- (h8300_expand_epilogue): Likewise.
-
-2003-01-06 Aldy Hernandez <aldyh@redhat.com>
-
- Segher Boessenkool <segher@koffie.nl>
-
- * config/rs6000/altivec.md: Remove spaces from assembler
- instruction argument lists.
-
-2003-01-07 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
-
- * config/c4x/c4x.c (c4x_naked_function_p): Rename from
- c4x_assembler_function_p.
- (c4x_null_epilogue_p): Complement return value, all uses updated.
- (c4x_insert_attributes): Add naked.
- * config/c4x/c4x.md (c4x_null_epilogue_p): Changes uses.
- * doc/extend.texi: Update C4x function attributes.
-
-2003-01-06 Richard Henderson <rth@redhat.com>
-
- * config/alpha/alpha.c (alpha_encode_section_info): Adjust symbol_str
- properly when changing "local-ness".
- * config/alpha/alpha.md (movdi_er_high_g): Allow all symbols.
-
-2003-01-06 Dale Johannesen <dalej@apple.com>
-
- * config/darwin-protos.h: Add prototypes for new section functions.
-
-2003-01-06 Chris Demetriou <cgd@broadcom.com>
-
- * config.gcc (mipsisa32-*-elf*, mipsisa32el-*-elf*): Default ABI
- to EABI.
-
-2003-01-06 Zack Weinberg <zack@codesourcery.com>
-
- * hwint.h: If the current compiler has no 64-bit type at all,
- make HOST_WIDEST_INT 32 bits.
-
-2003-01-06 Eric Christopher <echristo@redhat.com>
-
- * config/mips/mips.md (movdf_internal2): Fix constraints.
-
-2003-01-06 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*twoshifts_l16_r1): New.
-
-2003-01-06 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md (leadi): Use dla rather than la.
-
-2003-01-06 Svein E. Seldal <Svein.Seldal@solidas.com>
-
- * config/c4x/c4x.h: Updated specs for new gas format. Fixed bug
- in C33_FLAG. Added proper C33 support in ASM_FILE_START macro.
-
-2003-01-06 Herman A.J. ten Brugge <hermantenbrugge@home.nl>
-
- * config/c4x/c4x.h: Remove hwint.h include and HOST_WIDE_INT_PRINT_HEX
- redefinition.
-
-2003-01-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*extzv_8_23): New.
-
-2003-01-05 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * pa64-hpux.h (JCR_SECTION_NAME): Define.
- (PA_INIT_FRAME_DUMMY_ASM_OP): Check EH_FRAME_SECTION_NAME instead of
- USE_EH_FRAME_REGISTRY when defining.
-
-2003-01-05 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_a_shift): Do not output a
- variable shift.
- * config/h8300/h8300.md (two splitters): New.
-
-2003-01-05 Richard Sandiford <rsandifo@redhat.com>
-
- * config/mips/mips.md: Disable the movstrsi define_split.
-
-2003-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * alloc-pool.c: Don't include "libiberty.h".
- * config/sparc/gmon-sol2.c: Include <fcntl.h>.
- * convert.c (convert_to_real): Hide unused variable.
-
-2003-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (gtyp-gen.h): Const-ify.
- * gcov-dump.c (tag_table): Likewise.
-
-2003-01-04 Bruce Korb <bkorb@gnu.org>
-
- * fixinc/fixfixes.c(wrap_fix): the wrapper guard must be a function
- of *both* the file name and the fix name.
-
-2003-01-04 John David Anglin <dave.anglin@nrc.ca>
-
- * config.gcc (hppa*64*-*-hpux11*): Define extra_parts. Don't use
- collect2.
- * pa-hpux11.h (LDD_SUFFIX, PARSE_LDD_OUTPUT): Undefine.
- (HAS_INIT_SECTION, LD_INIT_SWITCH, LD_FINI_SWITCH): Define.
- * pa64-hpux.h (HP_INIT_ARRAY_SECTION_ASM_OP,
- GNU_INIT_ARRAY_SECTION_ASM_OP, HP_FINI_ARRAY_SECTION_ASM_OP,
- GNU_FINI_ARRAY_SECTION_ASM_OP): Define.
- (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Define when not using
- elfos.h.
- (EH_FRAME_IN_DATA_SECTION): Delete define.
- (HAS_INIT_SECTION, LD_INIT_SWITCH, LD_FINI_SWITCH): Undefine.
- (STARTFILE_SPEC): Use crtbegin.o.
- (ENDFILE_SPEC): Use crtend.o.
- (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION,
- SUPPORTS_INIT_PRIORITY, PA_CXA_FINALIZE_STUB, PA_INIT_FINI_HACK,
- PA_INIT_FRAME_DUMMY_ASM_OP, PA_JV_REGISTERCLASSES_STUB,
- DTOR_LIST_BEGIN): Define.
- * pa.c (TARGET_ASM_CONSTRUCTOR): Define.
- (pa_asm_out_constructor, pa_asm_out_destructor): New functions.
- * som.h (SUPPORTS_INIT_PRIORITY): Delete define.
-
-2002-12-31 Larin Hennessy <larin@science.oregonstate.edu>
-
- * fixinc/fixinc.svr4: Remove references to i860, Sony NewsOS, and spur.
- * fixinc/inclhack.def: Remove tests for Apple A/UX, ARM/RISCiX, DG/UX,
- m88k-*-sysv3*, Sony NewsOS. Remove references to i860.
- Cleanup handling of replacement text.
- * fixinc/mkfixinc.sh: Remove reference to i?86-*-osf1*
-
-2003-01-04 Bruce Korb <bkorb@gnu.org>
-
- * fixinc/tests/base/math.h: removed obsolete results
- * fixinc/tests/base/stdlib.h: ditto
- * fixinc/tests/base/sys/param.h: ditto
- * fixinc/tests/base/sys/stat.h: ditto
- * fixinc/tests/base/time.h: ditto
- * fixinc/tests/base/X11/Intrinsic.h: removed obsolete file
- * fixinc/tests/base/sys/byteorder.h: ditto
- * fixinc/inclhack.def: Remove superfluous backslashes
-
-2003-01-04 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add prototypes for
- the new functions defined below.
- * config/h8300/h8300.c (TARGET_ASM_FUNCTION_PROLOGUE): Do not
- define.
- (dosize): Emit RTL instead of assembly code.
- (push): Likewise.
- (pop): Likewise.
- (h8300_output_function_prologue): Remove.
- (h8300_expand_prologue): New.
- (h8300_expand_epilogue): New.
- (h8300_output_function_epilogue): Do only the reset of
- pragma_saveall.
- * config/h8300/h8300.md (push_h8300): New.
- (push_h8300hs): Likewise.
- (pop_h8300): Likewise.
- (pop_h8300hs): Likewise.
- (*stm_h8300s_2): Change the name to stm_h8300s_2.
- (*stm_h8300s_3): Change the name to stm_h8300s_3.
- (*stm_h8300s_4): Change the name to stm_h8300s_4.
- (*ldm_h8300s_2): New.
- (*ldm_h8300s_3): Likewise.
- (*ldm_h8300s_4): Likewise.
- (return): Likewise.
- (*return_1): Likewise.
- (prologue): Likewise.
- (epilogue): Likewise.
- (monitor_prologue): Likewise.
-
-2003-01-03 Dale Johannesen <dalej@apple.com>
-
- * config/darwin.h: (EXTRA_SECTIONS): Add machopic_symbol_stub1,
- machopic_picsymbol_stub1.
- (EXTRA_SECTION_FUNCTIONS): Ditto.
- * rs6000/rs6000.c: Update copyright.
- (machopic_output_stub): Use them. Remove an insn from stub code.
-
-2003-01-02 Jason Merrill <jason@redhat.com>
-
- * fold-const.c (fold) [COND_EXPR]: Avoid NOP_EXPRs better.
-
- * integrate.c (copy_decl_for_inlining): Don't clear the rtl for
- static/external decls.
-
- * c-common.c (finish_fname_decls): Put the DECL_STMTs inside the
- outermost scope.
- * c-decl.c (c_make_fname_decl): Push the decls there, too.
-
-2003-01-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300-protos.h: Add a prototype for
- h8300_current_function_interrupt_function_p.
- * config/h8300/h8300.c (interrupt_handler): Remove.
- (os_task): Likewise.
- (monitor): Likewise.
- (pragma_interrupt): New.
- (WORD_REG_USED): Use
- h8300_current_function_interrupt_function_p.
- (dosize): Likewise.
- (h8300_output_function_prologue): Likewise.
- Do not set interrupt_handler, os_task, monitor.
- (h8300_output_function_prologue): Use
- h8300_current_function_interrupt_function_p.
- Do not set interrupt_handler, os_task, monitor.
- (h8300_current_function_interrupt_function_p): New.
- (h8300_pr_interrupt): Set pragma_interrupt.
- (h8300_insert_attributes): Reset pragma_interrupt.
-
-2003-01-03 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * doc/install.texi (Configuration): Fix markup for reference to
- gcc/config.gcc.
-
-2003-01-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md (*iorhi3_zext): Relax the condition.
- (*iorhi3_two_qi): Likewise.
- (*iorsi3_zexthi): Likewise.
- (*xorhi3_zextqi): Likewise.
- (*xorsi3_zexthi): Likewise.
- (*xorsi3_zextqi): Likewise.
-
-2003-01-02 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (stack_pointer_operand): New.
- (const_int_gt_2_operand): Likewise.
- (const_int_ge_8_operand): Likewise.
- * config/h8300/h8300.md (a splitter): Likewise.
- (a peephole2): Likewise.
- * config/h8300/h8300-protos.h: Add prototypes for the new
- functions above.
-
-2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
-
- * objc/Make-lang.in, objc/config-lang.in, objc/lang-specs.h,
- objc/objc-act.h: Fix copyright years.
-
-2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
-
- * doc/passes.texi: Fix documentation for -fssa-ccp
-
-2003-01-02 Neil Booth <neil@daikokuya.co.uk>
-
- * gccbug.in: Update for new categories.
-
-2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.md: Reorder some patterns.
-
-2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c (output_logical_op): Fix a warning.
-
-2003-01-01 Neil Booth <neil@daikokuya.co.uk>
-
- * config/darwin-protos.h, config/c4x/c4x-protos.h,
- config/cris/cris-protos.h, config/i370/i370-protos.h,
- config/i960/i960-protos.h, config/ia64/ia64-protos.h,
- config/v850/v850-protos.h: Use struct, and don't conditionally
- compile on GCC_C_PRAGMA_H.
-
-2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/arm/arm-protos.h: Remove #ifdef GCC_C_PRAGMA_H.
- * config/h8300/h8300-protos.h: Likewise.
- * config/sh/sh-protos.h: Likewise.
-
-2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/arm/arm-protos.h: Use struct cpp_reader instead of
- cpp_reader.
- * config/h8300/h8300-protos.h: Likewise.
- * config/sh/sh-protos.h: Likewise.
-
-2003-01-01 Neil Booth <neil@daikokuya.co.uk>
-
- * config/arm/arm.c (arm_pr_long_calls, arm_pr_no_long_calls,
- arm_pr_long_calls_off): Use struct.
- * config/h8300/h8300.c (h8300_pr-interrupt, h8300_pr_saveall)
- : Similarly.
- Don't include cpplib.h.
- * config/sh/sh.c (sh_pr_interrupt, sh_pr_trapa,
- sh_pr_nosave_low_regs): Similarly.
-
-2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
-
- * config/h8300/h8300.c: Include cpplib.h.
-
-2003-01-01 Steven Bosscher <s.bosscher@student.tudelft.nl>
-
- * objc/Make-lang.in, objc/config-lang.in, objc/lang-options.h,
- objc/lang-specs.h, objc/objc-act.c, objc/objc-act.h,
- objc/objc-lang.c, objc/objc-tree.def: Replace "GNU CC" with
- "GCC" in the copyright header.
-
-2003-01-01 Neil Booth <neil@daikokuya.co.uk>
-
- * c-pragma.c (c_register_pragma): New.
- (init_pragma): Use it.
- * c-pragma.h (cpp_register_pragma): Don't declare.
- (c_register_pragma): New.
- * cpplib.h: Remove #ifdef GCC_C_PRAGMA_H.
- * config/darwin.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/arm/arm.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/h8300/h8300.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/i370/i370.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/i960/i960.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/ia64/hpux.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/rs6000/rs6000.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/sh/sh.h (REGISTER_TARGET_PRAGMAS): Update.
- * config/v850/v850.h (REGISTER_TARGET_PRAGMAS): Update.
- * doc/tm.texi (REGISTER_TARGET_PRAGMAS): Update
-
-See ChangeLog.8 for earlier changes.
+See ChangeLog.9 for earlier changes.
diff --git a/gcc/ChangeLog.9 b/gcc/ChangeLog.9
new file mode 100644
index 00000000000..8eed245136d
--- /dev/null
+++ b/gcc/ChangeLog.9
@@ -0,0 +1,21488 @@
+2003-06-30 Bruno Haible <bruno@clisp.org>
+
+ PR middle-end/6578
+ * libgcc2.c (__subvsi3): Remove simplification that would not work
+ when subtracting -0x80000000.
+ (__subvdi3): Remove simplification that would return a wrong result.
+ (__mulvsi3): Fix overflow check.
+ (__absvdi2): Fix simplification that would return a wrong result.
+ (__mulvdi3): Fix overflow check.
+
+2003-06-30 Jeff Law <law@redhat.com>
+
+ * stmt.c (any_pending_cleanups): Lose argument THIS_CONTOUR, it
+ was always passed in the value '1'. Simplify body appropriately.
+ * tree.h (any_pending_cleanups): Corresponding changes.
+ * calls.c: (expand_call): Corresponding changes.
+
+2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (distribute_notes): Don't bother REG_WAS_0.
+ * cse.c (cse_insn): Likewise.
+ * final.c (final_scan_insn): Likewise.
+ * jump.c (duplicate_loop_exit_test): Likewise.
+ * rtl.c (reg_note_name): Remove REG_WAS_0.
+ * rtl.h (REG_WAS_0): Remove.
+ * unroll.c (final_reg_note_copy): Don't bother REG_WAS_0.
+ * config/avr/avr.c (output_movqi): Don't use reg_was_0.
+ (output_movhi): Likewise.
+ (output_movsisf): Likewise.
+ (reg_was_0): Remove.
+ * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Don't use
+ REG_WAS_0.
+ (m68hc11_gen_movqi): Likewise.
+ * config/vax/vax-protos.h: Remove the prototype for
+ reg_was_0_p.
+ * config/vax/vax.c (follows_p): Remove.
+ (reg_was_0_p): Likewise.
+ * config/vax/vax.md (movsi): Don't use reg_was_0_p.
+ (movhi): Likewise.
+ (movqi): Likewise.
+ * doc/rtl.texi (REG_WAS_0): Remove.
+
+2003-06-30 Mark Mitchell <mark@codesourcery.com>
+
+ * config/rs6000/spe.h (__ev_set_spefscr_frmc): Set the flag.
+
+2003-06-30 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/lib1funcs.asm: Use "xtensa-config.h" from
+ top-level include directory.
+ * config/xtensa/lib2funcs.S: Likewise.
+ * config/xtensa/xtensa.h: Likewise.
+ * config/xtensa/xtensa-config.h: Remove.
+ * doc/install.texi: Update location of "xtensa-config.h" header.
+
+2003-06-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_extra_constraint): New function.
+ * config/s390/s390-protos.h (s390_extra_constraint): Declare it.
+ * config/s390/s390.h (EXTRA_CONSTRAINT): Use it.
+ * config/s390/s390.c (q_constraint): Remove.
+ * config/s390/s390-protos.h (q_constraint): Likewise.
+ * config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Add 'R', 'S', 'T'.
+ (EXTRA_ADDRESS_CONSTRAINT): Define.
+
+ * config/s390/s390.c (larl_operand): Refuse out-of-range operands.
+ (DISP_IN_RANGE, s390_short_displacement): New.
+ (legitimate_reload_operand_p): Support long displacements.
+ (s390_decompose_address): Likewise.
+ (legitimize_pic_address): Likewise.
+ (legitimize_address): Likewise.
+ (s390_fixup_clobbered_return_reg): Likewise.
+ (s390_emit_prologue, s390_emit_epilogue): Likewise.
+ (s390_output_mi_thunk): Likewise.
+
+ * config/s390/s390.md (attr "op_type"): Add "RXY", "RSY", "SIY".
+ (attr "atype", attr "length"): Add defaults for new op_types.
+ (all insns): Change op_type attribute where appropriate.
+
+ ("*movdi_lay", "*movsi_lay", "*extendqidi2", "*extendqisi2"): New insns.
+ ("*tmqi_ext", "*tmdi_mem", "*tmsi_mem", "*tmhi_mem", *tmqi_mem",
+ "*tstsi", "*tstsi_cconly", "*tsthiCCT", "*tsthiCCT_cconly",
+ "*tsthi", "*tsthi_cconly", "*tstqiCCT", "*tstqiCCT_cconly",
+ "*tstqi", "*tstqi_cconly", "*cmpsi_ccs_sign", "*cmpsi_ccs",
+ "*cmpsi_ccu", "*cmphi_ccu", "*cmpqi_ccu", "*cli",
+ "movti", "*movdi_64", "*movdi_31", "*movsi", "movhi", "movqi_64",
+ "movqi", "*movstrictqi", "*movstricthi", "movstrictsi",
+ "*movdf_64", "*movdf_31", "*movsf",
+ "*load_multiple_si", "*store_multiple_di",
+ "*sethighqisi", "*sethighhisi", "*sethighqidi_31", "*extendhisi2",
+ "*la_64", "*la_31", "*la_31_and", "force_la_31",
+ "*addsi3_carry1_cc", *addsi3_carry1_cconly",
+ "*addsi3_carry2_cc", *addsi3_carry2_cconly",
+ "*addsi3_cc", "*addsi3_cconly", "*addsi3_cconly2",
+ "*addsi3_sign", "*addsi3_sub", "addsi3",
+ "*subsi3_borrow_cc", "*subsi3_borrow_cconly", "*subsi3_cc",
+ "*subsi3_cconly", "*subsi3_sign", "*subsi3_sub", "subsi3",
+ "mulsi3"
+ "*andsi3_cc", "*andsi3_cconly", "andsi3",
+ "*andqi3_ss", "*andqi3_ss_inv",
+ "*iorsi3_cc", "*iorsi3_cconly", "iorsi3",
+ "*iorqi3_ss", "*iorqi3_ss_inv",
+ "*xorsi3_cc", "*xorsi3_cconly", "xorsi3",
+ "*xorqi3_ss", "*xorqi3_ss_inv",
+ "*tls_load_31"): Add alternatives for long-displacement instructions.
+
+ ("*cmpdf_ccs", "*cmpdf_ccs_ibm", "*cmpsf_ccs", "*cmpsf_ccs_ibm",
+ "*load_multiple_di", "*store_multiple_di",
+ "*sethighqidi_64", "*zero_extendhisi2_31",
+ "truncdfsf2_ibm", "extendsfdf2_ieee", "extendsfdf2_ibm",
+ "adddf3", "*adddf3", "*adddf3_ibm",
+ "addsf3", "*addsf3", "*addsf3_ibm",
+ "subdf3", "*subdf3", "*subdf3_ibm",
+ "subsf3", "*subsf3", "*subsf3_ibm",
+ "mulsi_6432", "divmoddisi3",
+ "muldf3", "*muldf3", "*muldf3_ibm",
+ "mulsf3", "*mulsf3", "*mulsf3_ibm",
+ "divdf3", "*divdf3", "*divdf3_ibm",
+ "divsf3", "div*sf3", "*divsf3_ibm",
+ "sqrtdf2", "sqrtsf2",
+ "*cjump_long", "*icjump_long", "indirect_jump", "casesi_jump",
+ "*doloop_si_long", "*doloop_di_long", "bas_64", "bas_31",
+ "bas_r_64", "bas_r_31", "bas_tls_31", "bas_tls_64"): Adapt memory
+ and address constraints for instructions that do not accept long
+ displacements.
+
+2003-06-30 Hartmut Penner <hpenner@de.ibm.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/2084.md: New file.
+ * config/s390/s390.md: Include it.
+ * config/s390/s390.c (s390_adjust_priority): New function.
+ (TARGET_SCHED_ADJUST_PRIORITY): Define.
+ (s390_first_cycle_multipass_dfa_lookahead): New function.
+ (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Define.
+ (s390_sched_reorder2): New function.
+ (TARGET_SCHED_REORDER2): Define.
+ (s390_adjust_cost): Support PROCESSOR_2084_Z990 cpu type.
+ (s390_issue_rate): Likewise.
+
+Mon Jun 30 23:47:33 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (GTFILES): Add cgraph.h.
+ * cgraph.c (known_decls): Remove.
+ (cgraph_hash, cgraph_nodes, cgraph_nodes_queue,
+ cgraph_varpool_hash, cgraph_varpool_nodes_queue): GTYize.
+ (cgraph_node): Do not allocate known_decls; use polutate hashtable.
+ (cgraph_varpool_node): Likewise; add next pointer.
+ (cgraph_varpool_nodes): New static variable.
+ * cgraph.h (cgraph_local_info, cgraph_global_info, cgraph_rtl_info,
+ cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_nodes, cgraph_n_nodes,
+ cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): GTYize.
+ * gengtype.c (open_base_files): Include cgraph.h
+
+2003-06-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * Changelog: Remove ">>>>>>>" from previous change.
+
+2003-06-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * config/cris/cris.c: Fix spelling for "testcase".
+ * config/cris/cris.h: Likewise.
+ * config/cris/cris.md: Likewise.
+ * config/mmix/crti.asm: Likewise.
+ * config/mmix/mmix.h: Likewise.
+ * config/mmix/mmix.md: Likewise.
+
+2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Make it always
+ 1.
+
+2003-06-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config.gcc [s390*-*-*]: Support --with-arch, --with-tune, and
+ --with-mode configure options.
+ * config/s390/s390.h (OPTION_DEFAULT_SPECS): Define.
+ (DRIVER_SELF_SPECS): Define.
+ * config/s390/linux.h (ASM_SPEC): Pass architecture mode and cpu
+ architecture to assembler.
+ (LINK_SPEC): Merge 31-bit and 64-bit variants.
+ (LINK_ARCH31_SPEC, LINK_ARCH64_SPEC, EXTRA_SPECS): Remove.
+ * config/s390/s390.c (override_options): New default rules for
+ architecture mode and cpu architecture selection.
+ * doc/invoke.texi (-mesa, -mzarch, -march, -mtune): Document
+ new default rules.
+
+ * config/s390/s390.h (enum processor_type): Add PROCESSOR_2084_Z990.
+ * config/s390/s390.md (attr "cpu"): Add "z990" processor type.
+ * config/s390/s390.c (override_options): Add "z990" to
+ processor_alias_table.
+ * doc/invoke.texi (-march): Document "z990" processor type.
+
+ * config/s390/s390.c (s390_tune_flags, s390_arch_flags): New variables.
+ * config/s390/s390.h (s390_tune_flags, s390_arch_flags): Declare.
+ (enum processor_flags, TARGET_CPU_IEEE_FLOAT, TARGET_CPU_ZARCH,
+ TARGET_CPU_LONG_DISPLACEMENT, TARGET_LONG_DISPLACEMENT): New.
+ * config/s390/s390.c (override_options): Replace enum pta_flags by
+ enum processor_flags. Fill in s390_tune_flags and s390_arch_flags.
+
+ * config/s390/s390.c (s390_cpu): Rename to ...
+ (s390_tune): ... this.
+ * config/s390/s390.h (s390_cpu, s390_tune): Likewise.
+ * config/s390/s390.c (s390_issue_rate, override_options): Likewise.
+ * config/s390/s390.md (attr "cpu"): Likewise.
+
+2003-06-30 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-common.c (enum c_language_kind, flag_objc): Remove.
+ (fix_string_type, check_case_value, c_common_nodes_and_builtins,
+ c_add_case_label, finish_label_addr_expr, boolean_increment):
+ Use c_dialect_ macros.
+ * c-common.h (enum c_language_kind): Extend.
+ (c_dialect_cxx, c_dialect_objc): New.
+ (flag_objc): Remove.
+ (c_common_init_options): Update prototype.
+ * c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
+ macros.
+ * c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
+ macros.
+ * c-format.c (C_STD_VER, C_STD_NAME): Similarly.
+ * c-lang.c (c_init_options): Remove.
+ (c_language): Define.
+ (LANG_HOOKS_INIT_OPTIONS): Use common hook.
+ * c-lex.c (lex_charconst): Use c_dialect_ macros.
+ * c-opts.c (lang_flags): Make function-local.
+ (c_common_init_options): Use c_dialect_ macros. Handle
+ C++ diagnostic requirements.
+ (c_common_handle_option, c_common_post_options): Use flag_cxx.
+ * c-parse.in (init_reswords): Use c_dialect_objc ().
+ * c-pch.c (get_ident): Use c_language.
+ * c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
+ * c-typeck.c (comptypes, build_c_cast): Similarly.
+ * objc/objc-lang.c (c_language): Define.
+ (LANG_HOOKS_INIT_OPTIONS): Use common hook.
+ (objc_init_options): Remove.
+
+2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/alpha/alpha.h (FUNCTION_ARG_PADDING): Remove.
+ * config/alpha/unicosmk.h: Don't #undef FUNCTION_ARG_PADDING.
+
+2003-06-30 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * doc/sourcebuild.texi: Don't reference gnats.html any more.
+
+2003-06-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (compute_mov_length): Fix length of
+ mov:SF on H8/300.
+
+2003-06-30 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.h (BIGGEST_FIELD_ALIGNMENT): Make defintion
+ constant.
+
+Mon Jun 30 15:36:29 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ (fyl2x_sfxf3, fyl2x_dfxf3, fscale_sfxf3, fscale_dfxf3): Fix condition.
+
+2003-06-30 Hartmut Penner <hpenner@de.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_split_altivec_in_gprs): New function.
+ (altivec_in_gprs_p): New function.
+
+ * config/rs6000/rs6000-protos (rs6000_split_altivec_in_gprs): New
+ prototype.
+ (altivec_in_gprs_p): New prototype.
+
+ * config/rs6000/altivec.md (*movv4si_internal): Change
+ multi-assembler alternative to '#'. Add postreload splitter to
+ handle this cases.
+ (*movv4hi_internal): Likewise.
+ (*movv4qi_internal): Likewise.
+ (*movv4sf_internal): Likewise.
+
+2003-06-30 Jason Merrill <jason@redhat.com>
+
+ * defaults.h (PUSH_ARGS_REVERSED): Define default here.
+ * calls.c: Not here.
+
+2003-06-30 Ben Elliston <bje@wasabisystems.com>
+
+ * config/arm/arm.c (arm_rtx_costs): Remove #if 0 block.
+ (bad_signed_byte_operand): Likewise.
+ (arm_output_epilogue): Likewise.
+ (arm_final_prescan_insn): Likewise.
+
+2003-06-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * cfgrtl.c (mark_killed_regs): Cast HARD_REGNO_NREGS to int.
+
+2003-06-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * c-pch.c (c_common_write_pch): Flush asm_out_file to allow for
+ subsequent writes.
+
+Mon Jun 30 10:03:02 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cfgrtl.c (verify_flow_info): Accept degenerated condjumps
+ in cfglayout mode.
+
+Mon Jun 30 09:52:39 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (standard_80387_constant_p): Accept TFmode constants too.
+ (init_ext_80387_constants): Likewise.
+ (standard_80387_constant_rtx): Likewise.
+ * i386.md (atanxf): Disable for TARGET_128BIT_LONG_LONG
+ (atantf): Disable for !TARGET_128BIT_LONG_LONG
+ (fyl2x_sfxf3, fyl2x_dfxf3): Accept TFmode operands.
+ (fyl2x_xfxf3, fyl2x_tfxf3): Enable/disable as needed.
+ (fscale_sfxf3, fscale_dfxf3): Accept TFmode operands.
+ (fscale_xfxf3, fscale_tfxf3): Enable/disable as needed.
+ (frndinttf2): New.
+ (f2xm1tf2): New.
+ (exp?f2): Use expsf2_tf when needed.
+ (exp?f2_tf): New.
+ (exptf): New.
+
+2003-06-29 Uwe Stieber <uwe@kaos-group.de>
+
+ * config.gcc (sh*-*-kaos*): Put tm_file setting in separate case
+ statement from tmake_file set.
+
+2003-06-29 James E Wilson <wilson@tuliptree.org>
+
+ * reload.c (find_reloads): Change push_reloads to push_reload in
+ comment.
+ * reload1.c (eliminate_regs): Likewise.
+ (dump_needs): Delete prototype for deleted function.
+
+2003-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-attrs.def (gcc_diag, gcc_cdiag, gcc_cxxdiag): New
+ format attributes.
+ * c-format.c (enum format_type): Add gcc_diag_format_type,
+ gcc_cdiag_format_type, and gcc_cxxdiag_format_type.
+ (gcc_diag_length_specs, gcc_cdiag_length_specs,
+ gcc_cxxdiag_length_specs, gcc_diag_flag_pairs,
+ gcc_cdiag_flag_pairs, gcc_cxxdiag_flag_pairs, gcc_diag_flag_specs,
+ gcc_cdiag_flag_specs, gcc_cxxdiag_flag_specs, gcc_diag_char_table,
+ gcc_cdiag_char_table, gcc_cxxdiag_char_table): New.
+ (format_types_orig): Add new data.
+ (find_char_info_specifier_index, init_dynamic_diag_info): New
+ functions.
+ (handle_format_attribute): Update to handle new format attributes.
+
+2003-06-29 Dara Hazeghi <dhazeghi@yahoo.com>
+
+ * doc/install.texi: Remove install documentation for obsoleted targets
+ i?86-*-sco, i?86-*-sco3.2v4, powerpcle-*-pe, powerpcle-*-winnt,
+ arm-*-aof.
+ Update information about IA64 toolchain, AIX make requirements,
+ and binutils for m68k-*-hpux and *-*-linuxaout targets.
+
+Mon Jun 30 00:50:43 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * regmove.c (regmove_optimize): Don't try to make src and dst match
+ when they are in different modes.
+
+Sun Jun 29 23:06:32 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid
+ busy work when builtin is not supported by the backend.
+
+2003-06-29 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop.c (count_one_set): Fix detection of registers set in more
+ than one basic block.
+
+2003-06-29 Andreas Jaeger <aj@suse.de>
+
+ * target-def.h: Remove usage of OBJECT_FORMAT_ROSE.
+ * system.h: Poison OBJ_FORMAT_ROSE.
+ * doc/tm.texi (Macros for Initialization): Remove documentatin of
+ OBJECT_FORMAT_ROSE.
+ * config/rs6000/lynx.h: Remove undef of OBJECT_FORMAT_ROSE.
+ * collect2.c: Remove usage of OBJECT_FORMAT_ROSE.
+
+2003-06-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (update_total_code_bytes): New function.
+ (last_address): Number of bytes output for a function and its
+ associated thunks.
+ (compute_frame_size): Use BITS_PER_UNIT.
+ (pa_output_function_epilogue): Compute last_address. Use
+ update_total_code_bytes.
+ (output_lbranch): Handle long branch on portable runtime.
+ (attr_length_millicode_call, attr_length_call,
+ attr_length_indirect_call): Only use total_code_bytes for calls in
+ the text section.
+ (output_call): Only use an indirect call sequence when the target is
+ not local.
+ (pa_asm_output_mi_thunk): Handle updating of total_code_bytes. Improve
+ test to determine when an IA-relative branch can be used. Add various
+ long branch sequences. Avoid using an indirect branch on all ports
+ except SOM.
+
+2003-06-29 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * expr.c (clear_by_pieces): Fix prototype.
+
+2003-06-29 Andreas Jaeger <aj@suse.de>
+
+ * cse.c: Convert prototypes to ISO C90.
+ * cselib.c: Likewise.
+ * cselib.h: Likewise.
+ * dbxout.c: Likewise.
+ * debug.c: Likewise.
+ * df.c: Likewise.
+ * df.h: Likewise.
+ * dojump.c: Likewise.
+ * doloop.c: Likewise.
+ * dominance.c: Likewise.
+ * dwarf2asm.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * dwarf2out.h: Likewise.
+ * dwarfout.c: Likewise.
+ * except.c: Likewise.
+ * except.h: Likewise.
+ * emit-rtl.c: Likewise.
+ * et-forest.c: Likewise.
+ * et-forest.h: Likewise.
+ * except.c: Likewise.
+ * explow.c: Likewise.
+ * expmed.c: Likewise.
+ * expr.c: Likewise.
+ * expr.h: Likewise.
+
+2003-06-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * alloc-pool.c: Fix comment formatting.
+ * bitmap.c: Likewise.
+ * bitmap.h: Likewise.
+ * bt-load.c: Likewise.
+ * builtins.c: Likewise.
+ * caller-save.c: Likewise.
+ * cfganal.c: Likewise.
+ * cfgrtl.c: Likewise.
+ * collect2.c: Likewise.
+ * cse.c: Likewise.
+ * df.c: Likewise.
+ * diagnostic.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * dwarfout.c: Likewise.
+ * expmed.c: Likewise.
+ * final.c: Likewise.
+ * flags.h: Likewise.
+ * fold-const.c: Likewise.
+ * gcc.c: Likewise.
+ * gcov-io.h: Likewise.
+ * gcov.c: Likewise.
+ * genattrtab.c: Likewise.
+ * genautomata.c: Likewise.
+ * libgcov.c: Likewise.
+ * mips-tfile.c: Likewise.
+ * optabs.c: Likewise.
+ * prefix.c: Likewise.
+ * rtlanal.c: Likewise.
+ * stmt.c: Likewise.
+ * stor-layout.c: Likewise.
+ * toplev.c: Likewise.
+ * varasm.c: Likewise.
+ * vmsdbgout.c: Likewise.
+
+2003-06-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * expr.c (emit_single_push_insn): If padding is needed
+ downward, adjust the stack pointer first, and then store the
+ data into the stack location using an offset.
+
+2003-06-29 Andreas Jaeger <aj@suse.de>
+
+ * collect2.h: Convert prototypes to ISO C90.
+ * collect2.c: Likewise.
+ * conflict.c: Likewise.
+ * coverage.c: Likewise.
+ * convert.h: Likewise.
+ * convert.c: Likewise.
+
+2003-06-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-decl.c (c_init_decl_processing): Use a location_t. Set input
+ filename to <internal>.
+ * tree.c (make_node): Just copy the current location.
+
+2003-06-29 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11210
+ * fold-const (decode_field_reference): Revert 2003-06-26 patch.
+
+2003-06-29 Neil Booth <neil@daikokuya.co.uk>
+
+ * toplev.c (flag_dummy): Remove.
+ (f_options): Restore flag pointers.
+
+2003-06-29 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (processor_target_table): Add 970.
+ * config.gcc: Add 970.
+
+2003-06-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * dwarf2out.c (add_AT_string): Replace ggc_alloc_string (X,
+ -1) with ggc_strdup.
+ * stmt.c (expand_asm_operands): Likewise.
+ * config/rs6000/rs6000.md (builtin_setjmp_receiver): Likewise.
+
+2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/ip2k/ip2k.c (ip2k_reorg): Use INSN_P instead of its
+ definition.
+
+2003-06-29 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * opts.c: Include insn-attr.h.
+ * Makefile.in (opts.o): Depend on INSN_ATTR_H.
+
+2003-06-27 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * flow.c (propagate_one_insn): Use proper test for a register
+ being part of the return value.
+
+2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/avr/avr.c: Fix a comment typo.
+
+2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/avr/avr-protos.h: Replace avr_simplify_comparision_p
+ with avr_simplify_comparison_p.
+ * config/avr/avr.c: Likewise.
+
+2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * builtins.c: Follow spelling conventions.
+ * cgraph.c: Likewise.
+ * cpplex.c: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/arm/iwmmxt.md: Likewise.
+ * config/c4x/c4x-modes.def: Likewise.
+ * config/c4x/c4x.c: Likewise.
+ * config/c4x/c4x.h: Likewise.
+ * config/c4x/c4x.md: Likewise.
+ * config/i386/i386-interix.h: Likewise.
+ * config/mips/mips.h: Likewise.
+
+2003-06-28 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Predicate
+ __mc68020__ on TARGET_68020.
+
+2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c: Fix a comment typo.
+
+2003-06-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-parse.in (yylexstring): Use a location_t.
+
+ * diagnostic.h (diagnostic_set_info): Replace file and lineno
+ parameters with a location_t.
+ * diagnostic.c (diagnostic_set_info): Replace file and lineno
+ parameters with a location_t.
+ (inform, warning, pedwarn, error, sorry, fatal_error,
+ internal_error, warning_with_decl, pedwarn_with_decl,
+ error_with_decl): Adjust.
+ * c-error.c (pedwarn_c99): Adjust.
+ * c-format.c (status_warning): Adjust.
+ * rtl-error.c (file_and_line_for_asm): Rename to ...
+ (location_for_asm): Return a location_t.
+ (diagnostic_for_asm): Adjust.
+
+2003-06-28 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpptrad.c (skip_macro_block_comment): New.
+ (copy_comment): Use it if appropriate.
+
+2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcse.c (compute_ld_motion_mems): Use INSN_P instead of its
+ definition.
+ (store_killed_in_insn): Likewise.
+ * print-rtl.c (print_rtx): Likewise.
+ * config/frv/frv.c (frv_final_prescan_insn): Likewise.
+ * config/m68hc11/m68hc11.c (dead_register_here): Likewise.
+ (m68hc11_reassign_regs): Likewise.
+ (m68hc11_reorg): Likewise.
+
+2003-06-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.c (output_integer_with_precision): New macro.
+ (output_format): Use it. Handle more format specifiers.
+ (output_long_decimal): Remove.
+ (output_unsigned_decimal): Likewise.
+ (output_long_unsigned_decimal): Likewise.
+ (output_octal): Likewise.
+ (output_long_octal): Likewise.
+ (output_hexadecimal): Likewise.
+ (output_long_hexadecimal): Likewise.
+ (output_long_long_decimal): Likewise.
+
+2003-06-28 Andreas Schwab <schwab@suse.de>
+
+ * config/ia64/ia64.md: Follow recent emit_note API change.
+
+2003-06-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-parse.in (%union): Replace filename & lineno with location.
+ (save_filename, save_lineno): Remove.
+ (save_location): New.
+ (fndef, old_style_parm_decls_1, lineno_datadecl, lineno_decl,
+ nested_function, notype_nested_function, if_prefix, lineno_stmt,
+ lineno_label, label): Adjust.
+
+2003-06-28 Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (c_strlen): Add only_value argument.
+ Handle COND_EXPR and COMPOUND_EXPR.
+ (expand_builtin_strlen): Optimize also strlen (i++ ? "foo" : "bar").
+ Adjust c_strlen callers.
+ (expand_builtin_strcpy, expand_builtin_strncpy,
+ expand_builtin_strcmp, expand_builtin_strncmp,
+ expand_builtin_fputs, expand_builtin_sprintf,
+ fold_builtin): Adjust c_strlen callers.
+
+2003-06-28 Josef Zlomek <zlomekj@suse.cz>
+
+ * bb-reorder.c (find_traces_1_round): Do not send basic block
+ to next round when we are in the last round.
+
+2003-06-28 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * opts.c: Include tm_p.h.
+ (handle_options): Make static.
+ (decode_options): Copied from toplev.c.
+ * opts.h (decode_options): New.
+ * toplev.c (parse_options_and_default_flags): Move most to opts.c,
+ some to...
+ (general_init): ...here.
+ (toplev_main): Use decode_options instead.
+ * toplev.h (save_argc, save_argv): New.
+
+2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * explow.c (find_next_ref): Remove.
+ * rtl.h: Remove the prototype for find_next_ref.
+
+2003-06-27 Roger Sayle <roger@eyesopen.com>
+
+ * config/alpha/alpha.md (anonymous define_split): Adjust emit_note
+ call to match recent API change.
+
+2003-06-27 Zack Weinberg <zack@codesourcery.com>
+
+ * dbxout.c (flag_debug_only_used_symbols): Delete redundant
+ declaration.
+
+ * c-format.c (check_format_string, get_constant)
+ * cfgrtl.c (rtl_split_edge):
+ Mark the definition static, matching the forward declaration.
+
+2003-06-27 Gunther Nikl <gni@gecko.de>
+
+ * unwind-c.c (PERSONALITY_FUNCTION): Delete duplicate define.
+
+ PR target/11014
+ * config/m68k/m68k.c (m68k_output_mi_thunk): Use correct assembly
+ syntax for MIT / MOTOROLA.
+
+ PR other/10240
+ * configure.in: Removed $(XCFLAGS) from BUILD_CFLAGS for build != host.
+ * configure: Rebuilt.
+
+2003-06-27 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/mips.c (mips_build_va_list): Make padding in
+ va_list structure explicit to avoid -Wpadded warnings.
+
+2003-06-27 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.h (SECONDARY_OUTPUT_RELOAD_CLASS): Define.
+ * config/s390/s390.c (s390_secondary_output_reload_class): New function.
+ * config/s390/s390-protos.h (s390_secondary_output_reload_class):
+ Declare it.
+ * config/s390/s390.md ("reload_outti", "reload_outdi",
+ "reload_outdf"): New expanders.
+
+ * config/s390/s390.md ("movti" + splitters): Handle non-offsettable
+ memory operands as source.
+ ("movdi" + splitters): Likewise.
+ ("movdf" + splitters): Likewise.
+ * config/s390/s390.c (s390_split_ok_p): New function.
+ * config/s390/s390-protos.h (s390_split_ok_p): Declare it.
+
+2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (force_to_mode): Replace the equality comparison
+ of INTVALs with a pointer equality comparison.
+ (simplify_comparison): Likewise.
+
+2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * jump.c (rtx_renumbered_equal_p): Replace an expression that
+ is known to be 0 with 0.
+
+2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcse.c (expr_equiv_p): Replace expressions that are known to
+ be 0 with 0.
+
+2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cse.c (fold_rtx): Replace the equality comparison of INTVALs
+ with a pointer equality comparison.
+
+2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * rtlanal.c (reg_mentioned_p): Return 0 earlier if REG and IN
+ are known to be not equivalent.
+
+2003-06-27 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (function_arg): Don't pass small aggregates
+ in floating point registers. Validate that we don't receive complex
+ values here. Use #elif.
+ (return_in_memory, function_value): New.
+ (alpha_va_arg): Handle complex values as two arguments.
+ * config/alpha/alpha.h (RETURN_IN_MEMORY): Use return_in_memory.
+ (FUNCTION_VALUE, LIBCALL_VALUE): Use function_value.
+ (SPLIT_COMPLEX_ARGS): New.
+ * config/alpha/alpha-protos.h: Update.
+
+2003-06-27 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * ggc-page.c (inverse_table): Change type of mult to size_t.
+ (compute_inverse): Compute inverse using size_t, not unsigned int.
+ Compute inverse also for sizes larger than half a machine page.
+
+Fri Jun 27 18:36:12 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (rest_of_decl_compilation): Only varpoolize argument
+ when called before cgraph_optimize.
+
+2003-06-27 Zack Weinberg <zack@codesourcery.com>
+
+ * config/darwin.h, config/elfos.h, config/i960/i960-coff.h
+ * config/m68k/coff.h: ASM_FILE_START_FILE_DIRECTIVE should
+ be TARGET_ASM_FILE_START_FILE_DIRECTIVE.
+
+Fri Jun 27 17:41:16 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_node, cgraph_varpool_node): Avoid re-initializing
+ of known_decls.
+
+2003-06-27 Hans-Peter Nilsson <hp@axis.com>
+
+ * defaults.h (REGISTER_MOVE_COST): Define default here.
+ * regclass.c: Don't define default REGISTER_MOVE_COST here.
+ * reload.c, reload1.c: Ditto.
+
+2003-06-27 Richard Earnshaw <rearnsha@arm.com>
+
+ * flags.h: Really install previous change.
+
+2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * rtl.h (emit_note): Remove FILE parameter.
+ * emit-rtl.c (emit_line_note): Adjust emit_note call.
+ (emit_note): Remove FILE parameter. Adjust.
+ * builtins.c (expand_builtin_expect): Adjust emit_note call.
+ * c-semantics.c (genrtl_scope_stmt): Likewise.
+ (expand_stmt): Likewise.
+ * cfglayout.c (reemit_insn_block_notes): Likewise.
+ (duplicate_insn_chain): Likewise.
+ * except.c (expand_eh_region_start, expand_eh_region_end,
+ sjlj_emit_function_enter): Likewise.
+ * explow.c (probe_stack_range): Likewise.
+ * expr.c (emit_block_move_via_loop): Likewise.
+ * function.c (init_function_start, expand_function_start,
+ expand_function_end, thread_prologue_and_epilogue_insns): Likewise.
+ * integrate.c (expand_inline_function, copy_insn_list): Likewise.
+ * reg-stack.c (compensate_edge): Likewise.
+ * reload1.c (reload): Likewise.
+ * rtlanal.c (hoist_insn_to_edge): Likewise.
+ * stmt.c (expand_fixup, expand_start_loop, expand_start_null_loop,
+ expand_loop_continue_here, expand_end_loop, expand_continue_loop,
+ expand_exit_loop_top_cond, expand_value_return,
+ expand_start_bindings_and_block, expand_end_bindings,
+ expand_decl_cleanup, expand_start_case): Likewise.
+ * unroll.c (copy_loop_body
+ * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
+ * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
+ * config/rs6000/rs6000.c (rs6000_emit_eh_toc_restore,
+ rs6000_emit_allocate_stack, rs6000_output_function_prologue,
+ rs6000_output_function_epilogue, rs6000_output_mi_thunk): Likewise.
+ * config/sh/sh.c (sh_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
+
+2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-tree.h (grokfield): Remove unused filename and line parameters.
+ * c-decl.c (grokfield): Remove unused filename and line parameters.
+ * c-parse.in (component_decl): Adjust field grokking rules, adjust
+ grokfield calls.
+ (component_declarator): Likewise.
+ (component_notype_declarator): Likewise.
+ * objc/objc-act.c (build_module_descriptor): Adjust grokfield
+ calls.
+ (build_protocol_template, build_method_prototype_list_template,
+ build_method_prototype_template, build_category_template,
+ build_selector_template, build_class_template,
+ build_super_template, build_ivar_template,
+ build_ivar_list_template, build_method_list_template,
+ build_method_template, add_instance_variable): Likewise.
+
+2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * stmt.c (do_jump_if_equal): Return 0 earlier if OP1 and
+ OP2 are known to be not equivalent.
+
+2003-06-26 Devang Patel <dpatel@apple.com>
+
+ * final.c (debug_flush_symbol_queue): New function.
+ (debug_queue_symbol): New function.
+ (debug_free_queue): New function.
+ (debug_nesting): New variable.
+ (symbol_queue): New variable.
+ (symbol_queue_index): Same.
+ (symbol_queue_size): Same.
+ * debug.h (debug_flush_symbol_queue): New.
+ (debug_queue_symbol): New.
+ (debug_free_queue): New.
+ (debug_nesting): New.
+ (symbol_queue_index): New.
+ * dbxout.c (DBXOUT_DECR_NESTING): New macro.
+ (DBXOUT_DECR_NESTING_AND_RETURN): New macro.
+ (dbxout_init): Delay symbol output.
+ (dbxout_global_decl): Save, set and reset TREE_USED bit around
+ dbxout_symbol() call.
+ (dbxout_begin_function): Same.
+ (dbxout_finish): Free symbol queue.
+ (dbxout_type): Put appropriate symbols in queue.
+ (dbxout_symbol): Put info for symbol's type in queue.
+ Decrement/Increment nesting counts flush symbol queue appropriately.
+ (dbxout_parms): Increment dbxout nesting.
+ (dbxout_reg_parms): Same.
+ * flags.h (flag_debug_only_used_symbols): New.
+ * toplev.c (flag_debug_only_used_symbols): New variable.
+ (lang_independent_options): Add entries for new option
+ -feliminate-unused-debug-symbols.
+ * common.opt: Add entry for -feliminate-unused-debug-symbols.
+ * opts.c (common_handle_options): Same.
+ * config/rs6000/darwin.h (CC1_SPEC): Interpret -gused as
+ -feliminate-unused-debug-symbols.
+ * doc/invoke.texi (Debugging Options): Document
+ -feliminate-unused-debug-symbols.
+
+2003-06-26 Roger Sayle <roger@eyesopen.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (expand_builtin_sprintf): Use c_getstr and strlen to
+ obtain the format string instead of using TREE_STRING_POINTER and
+ TREE_STRING_LENGTH. Only optimize sprintf(dst,"%s",src) when the
+ return value is unused or the length of src is a known constant.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.h (REGISTER_NAMES): R0 is really AP.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_call): Don't add ar.pfs for sibcalls.
+ (ia64_split_call): Only load descriptor for GP register inputs.
+ (ia64_expand_epilogue): Check current_frame_info.mask not
+ current_function_is_leaf to restore ar.pfs.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * emit-rtl.c (try_split): Append to new CALL_INSN_FUNCTION_USAGE
+ instead of replacing it.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * flow.c (propagate_one_insn): Kill function return value
+ registers across tail calls.
+
+ * flow.c (propagate_one_insn): Preserve live-at-end registers
+ across tail calls.
+
+2003-06-26 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * reload.c (can_reload_into): New function.
+ (push_reload): Use it.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (compute_a_rotate_length): Fix the
+ references to the amount of a rotation.
+
+2003-06-26 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/sh/coff.h: Don't include dbxcoff.h.
+ * config.gcc: List it here.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * postreload.c (reload_cse_simplify_set): Call cselib_lookup
+ earlier. Don't check if SRC is a constant.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * Makefile.in (OBJS): Add postreload.o.
+ Remove cselib.h from the dependency list for reload1.o.
+ Add a dependency list for postreload.o.
+ * reload.h: Change the comment for the prototype of
+ reload_cse_regs.
+ * reload1.c: Don't include cselib.h.
+ (reload_cse_regs): Move to postreload.c
+ (reload_cse_regs_1): Likewise.
+ (reload_cse_noop_set_p): Likewise.
+ (reload_cse_simplify_set): Likewise.
+ (reload_cse_simplify_operands): Likewise.
+ (RELOAD_COMBINE_MAX_USES): Likewise.
+ (reload_combine_ruid): Likewise.
+ (LABEL_LIVE): Likewise.
+ (reload_combine): Likewise.
+ (reload_combine_note_use): Likewise.
+ (reload_combine_note_store): Likewise.
+ (reg_set_luid): Likewise.
+ (reg_offset): Likewise.
+ (reg_base_reg): Likewise.
+ (reg_mode): Likewise.
+ (move2add_luid): Likewise.
+ (move2add_last_label_luid): Likewise.
+ (MODES_OK_FOR_MOVE2ADD): Likewise.
+ (reload_cse_move2add): Likewise.
+ (move2add_note_store): Likewise.
+ (reload_cse_simplify): Likewise.
+ * postreload.c: New.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/avr/avr.c (final_prescan_insn): Remove support for
+ -mrtl.
+ * config/avr/avr.h (MASK_RTL_DUMP): Remove.
+ (TARGET_RTL_DUMP): Likewise.
+ (TARGET_SWITCHES): Remove -mrtl.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Change emit_a_rotate to
+ output_a_rotate. Add a prototype for compute_a_rotate_length.
+ * config/h8300/h8300.c (emit_a_rotate): Change to
+ output_a_rotate.
+ (compute_a_rotate_length): New.
+ (h8300_adjust_insn_length): Remove.
+ * config/h8300/h8300.h (ADJUST_INSN_LENGTH): Remove.
+ * config/h8300/h8300.md (adjust_length): Remove.
+ (*rotlqi3_1): Use output_a_rotate and compute_a_rotate_length.
+ (*rotlhi3_1): Likewise.
+ (*rotlsi3_1): Likewise.
+
+2003-06-26 Roger Sayle <roger@eyesopen.com>
+ Richard Henderson <rth@redhat.com>
+
+ * builtins.c (expand_builtin_mathfn): Always stabilize the argument
+ list against re-evaluation. If expand_unop fails, call expand_call
+ with the stabilized argument list rather than return NULL_RTX.
+ (expand_builtin_mathfn2): Likewise, always stabilize the argument
+ list, and call expand_call ourselves if expand_binop fails.
+
+2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11210
+ * fold-const (decode_field_reference): Strip only NOPs that
+ don't affect the sign.
+
+2003-06-26 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * gcc/config/sh/sh.md (push_fpscr): Enable for TARGET_SH2E.
+ (pop_fpscr, fpu_switch): Likewise.
+
+2003-06-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * value-prof.c: New.
+ * value-prof.h: New.
+ * Makefile.in (value-prof.o): New.
+ (LIBGCOV): Add _gcov_merge_single and _gcov_merge_delta
+ (profile.o): Add value-prof.h and tree.h dependency.
+ * flags.h (flag_profile_values): Declare.
+ * gcov-io.h (GCOV_COUNTERS, GCOV_COUNTER_NAMES, GCOV_MERGE_FUNCTIONS):
+ Add new counters.
+ (GCOV_COUNTER_V_INTERVAL, GCOV_COUNTER_V_POW2, GCOV_COUNTER_V_SINGLE,
+ GCOV_COUNTER_V_DELTA): New counter sections.
+ (__gcov_merge_single, __gcov_merge_delta): Declare.
+ * flow.c (mark_used_regs): Set subregs_of_mode only when the
+ structure is initialized.
+ * libgcov.c (__gcov_merge_single, __gcov_merge_delta): New functions.
+ * profile.c: Include value-prof.h and tree.h.
+ (gen_interval_profiler, gen_pow2_profiler, gen_one_value_profiler,
+ gen_const_delta_profiler, instrument_values): New static functions.
+ (get_exec_counts): Fix comment.
+ (branch_prob): Invoke instrument_values.
+ * toplev.c (flag_profile_values): New flag.
+ * doc/invoke.texi (-fprofile-values): Document.
+
+2003-06-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (cfgrtl.o): Add expr.h dependency.
+ * cfgrtl.c: Include expr.h.
+ (mark_killed_regs, safe_insert_insn_on_edge): New
+ functions.
+ * config/i386/i386.h (AVOID_CCMODE_COPIES): Define.
+ * basic-block.h (safe_insert_insn_on_edge): Declare.
+
+2003-06-26 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (missing_arg): Make non-static.
+ (c_common_handle_option): Don't check for missing arguments.
+ * opts.c (handle_option): Check for missing arguments.
+
+2003-06-26 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/power4.md (power4-veccomplex): Correct latency.
+
+2003-06-25 Loren James Rittle <ljrittle@acm.org>
+
+ * configure.in (ld_vers): Portability [sed].
+ * configure: Regenerate with autoconf213.
+
+2003-06-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * doc/extend.texi: Document new builtin functions for Intel
+ Prescott New Intrunctions.
+
+ * doc/invoke.texi: Document new command-line options, -mpni and
+ -mno-pni, for Intel Prescott New Intrunctions.
+
+ * config.gcc (extra_headers): Add pmmintrin.h for i[34567]86-*-*.
+
+ * config/i386/i386.c (override_options): Turn on MASK_SSE2
+ for -mpni. Turn on MASK_SSE for -msse2.
+ (bdesc_2arg): Add PNI builtins with 2 args.
+ (bdesc_1arg): Add PNI builtins with 1 arg.
+ (ix86_init_mmx_sse_builtins): Handle PNI builtins.
+ (ix86_expand_builtin): Likewise.
+
+ * config/i386/i386.h (MASK_3DNOW, MASK_3DNOW_A,
+ MASK_128BIT_LONG_DOUBLE, MASK_64BIT, MASK_MS_BITFIELD_LAYOUT,
+ MASK_TLS_DIRECT_SEG_REFS): Renumbered.
+ (TARGET_PNI): New.
+ (TARGET_SWITCHES): Don't enable MASK_SSE for -msse2 here. Add
+ -mpni and -mno-pni.
+ (TARGET_CPU_CPP_BUILTINS): Defined __PNI__ for PNI.
+ (ix86_builtins): Add PNI builtins.
+ (config/i386/i386.md): Add PNI patterns.
+
+ * config/i386/pmmintrin.h: New file.
+
+2003-06-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (call): Fix the insn lengths.
+ (call_value): Likewise.
+
+Thu Jun 26 00:13:35 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * c-common.c (handle_used_attribute): Use mark_referenced.
+ * varasm.c (mark_referenced): Break out from ...
+ (assemble_name): ... here.
+ * tree.h (mark_referenced): Declare.
+
+2003-06-25 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * gccbug.in: Add PCH to list of categories.
+
+2003-06-25 Martin Schaffner <schaffner@gmx.li>
+
+ * cppfiles.c: Clarify comments.
+ * cpphash.h: Likewise.
+ * cpplib.h: Likewise.
+ * cppmacro.c: Likewise.
+ * mkdeps.h: Likewise.
+
+2003-06-25 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (complain_wrong_lang, write_langs): Remove.
+ (c_common_handle_option): Complaints about wrong language are
+ handled in opts.c now.
+ * opts.c (complain_wrong_lang, write_langs, handle_options): New.
+ (find_opt): Fix thinko.
+ (handle_option): Update prototype. Complain about switches for
+ a different front end.
+ * opts.h (lang_names, handle_options): New.
+ (handle_option): Remove.
+ * opts.sh: Write out language names array.
+ * toplev.c (parse_options_and_default_flags): Use handle_options.
+
+2003-06-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (MASK_SSE1): Removed.
+ (MASK_SSE164): Removed.
+ (MASK_SSE264): Removed.
+ (bdesc_2arg): Replace MASK_SSE1 with MASK_SSE. Replace
+ MASK_SSE164 with MASK_SSE | MASK_64BIT. Replace MASK_SSE264
+ with MASK_SSE2 | MASK_64BIT.
+ (bdesc_1arg): Likewise.
+ (ix86_init_mmx_sse_builtins): Likewise.
+
+ * config/i386/i386.h (TARGET_SSE): Remove MASK_SSE2.
+ (TARGET_SWITCHES): Enable both MASK_SSE and MASK_SSE2 for
+ -msse2.
+
+2003-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * hwint.h (HOST_WIDE_INT_PRINT, HOST_WIDE_INT_PRINT_C): New macros.
+ (HOST_WIDE_INT_PRINT_DEC_SPACE,
+ HOST_WIDE_INT_PRINT_UNSIGNED_SPACE,
+ HOST_WIDEST_INT_PRINT_DEC_SPACE,
+ HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE): Delete.
+ (HOST_WIDE_INT_PRINT_DEC, HOST_WIDE_INT_PRINT_DEC_C,
+ HOST_WIDE_INT_PRINT_UNSIGNED, HOST_WIDE_INT_PRINT_HEX): Define in
+ terms of HOST_WIDE_INT_PRINT and possibly HOST_WIDE_INT_PRINT_C.
+
+ * final.c (asm_fprintf): Use HOST_WIDE_INT_PRINT.
+ * ra-debug.c (dump_static_insn_cost): Likewise.
+
+2003-06-26 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.h (BIGGEST_FIELD_ALIGNMENT): Define instead
+ of ADJUST_FIELD_ALIGN if IN_TARGET_LIBS.
+ Replace occurances of '???' with 'XXX' incase they are
+ mistaken for trigraphs.
+ (THUMB_PRINT_OPERAND_ADDRESS): abort if a compound address
+ does not have a register for the first operand.
+
+2003-06-25 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * config/sh/sh.c (sh_register_move_cost):
+ Add case for moving between MAC_REGS.
+
+2003-06-25 Zack Weinberg <zack@codesourcery.com>
+
+ PR 10178
+ * langhooks.h (struct lang_hooks): Add no_body_blocks bool.
+ * langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): New; default false.
+ * c-lang.c, objc/objc-lang.c: Override LANG_HOOKS_NO_BODY_BLOCKS
+ to true.
+ * stmt.c (is_body_block): If lang_hooks.no_body_blocks, always
+ return 0.
+
+2003-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (bt-load.o): Depend on $(TM_P_H).
+ * bt-load.c: Include "tm_p.h".
+
+2003-06-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (compute_mov_length): Adjust for the
+ new optimization.
+ * config/h8300/h8300.md (*movsi_h8300): Optimize the load of
+ an SImode constant whose upper and lower are the same.
+
+Wed Jun 25 11:31:59 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * varasm.c (assemble_name): Mark needed variables even when
+ global info is ready.
+
+2003-06-24 Jerry Quinn <jlquinn@optonline.net>
+
+ PR other/11280
+ * gcc/doc/invoke.texi (Optimization Options): Remove -Os from
+ -freorder-functions description.
+
+2003-06-25 Josef Zlomek <zlomekj@suse.cz>
+
+ * dwarf2out.c (gen_field_die): Return if type of decl is error mark.
+
+2003-06-25 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.c (common_handle_option): Add missing break;s.
+
+2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ compute_mov_length.
+ * config/h8300/h8300.c (compute_mov_length): New.
+ * config/h8300/h8300.md (*movqi_h8300): Use it.
+ (*movqi_h8300hs): Likewise.
+ (movstrictqi): Likewise.
+ (*movhi_h8300): Likewise.
+ (*movhi_h8300hs): Likewise.
+ (movstricthi): Likewise.
+ (*movsi_h8300): Likewise.
+ (*movsf_h8300): Likewise.
+ (*movsi_h8300hs): Likewise.
+ (*movsf_h8300hs): Likewise.
+
+2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * jump.c (next_nondeleted_insn): Remove.
+ * rtl.h: Remove the prototype for next_nondeleted_insn.
+
+2003-06-24 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/11311
+ * builtins.c (powi_cost): Fix typo. The number of multiplications
+ required is the number to reduce the argument, result, plus the
+ cost of calculating the residual, val [not n, the original value].
+
+2003-06-24 Roger Sayle <roger@eyesopen.com>
+
+ * config/alpha/osf5.h (TARGET_C99_FUNCTIONS): Define.
+
+2003-06-24 Richard Henderson <rth@redhat.com>
+ (blame to: Loren James Rittle <ljrittle@acm.org>)
+
+ * real.h (ieee_extended_intel_96_round_53_format): New.
+ * real.c (ieee_extended_intel_96_round_53_format): New.
+ * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Use it
+ for XFmode and TFmode.
+
+2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (4 anonymous patterns): Give internal
+ names.
+ (movsi_h8300): Change the name to *movsi_h8300.
+ (movsi_h8300hs): Change the name to *movsi_h8300hs.
+ (movsf_h8300): Change the name to *movsf_h8300.
+ (movsf_h8300hs): Change the name to *movsf_h8300hs.
+
+2003-06-24 Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (expand_builtin_strcpy): Don't evaluate side-effects in
+ src twice.
+
+2003-06-24 J"orn Rennecke <joern.rennecke@superh.com>
+
+ Back out these patches:
+ 2003-06-02 J"orn Rennecke <joern.rennecke@superh.com>
+ * sh.h (OLD_ARG_MODE): New macro.
+ (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
+ (FUNCTION_ARG_1): Break out of:
+ (FUNCTION_ARG). Use OLD_ARG_MODE.
+ 2003-06-06 J"orn Rennecke <joern.rennecke@superh.com>
+ * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode
+ of the generated register.
+
+ * sh.h (FUNCTION_ARG_SCmode_WART): Define.
+ (FUNCTION_ARG): Unless FUNCTION_ARG_SCmode_WART is defined and
+ an even number of floating point regs are in use, use the same
+ sequence of argument passing registers for SCmode as would be
+ used for two SFmode values.
+ * sh.c (sh_va_arg): If FUNCTION_ARG_SCmode_WART is defined,
+ swap real / imaginary parts in incoming SCmode values passed
+ in registers.
+
+2003-06-24 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR target/11260
+ * config/alpha/alpha.md (sqrtdf2): Fix operand substitution.
+
+Tue Jun 24 18:49:33 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (cgraph.o): Depend on output.h, not depend on
+ tree-inline.h
+ * cgraph.c: Do not include tree-inline.h; include output.h
+ (known_fns): Rename to ...
+ (known_decls): ... this one; update all uses.
+ (cgraph_varpool_hash): New static variable.
+ (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): New global
+ variables.
+ (cgraph_varpool_hash_node, eq_cgraph_varpool_node, cgraph_varpool_node,
+ cgraph_varpool_node_for_identifier, cgraph_varpool_mark_needed_node,
+ cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls):
+ New functions.
+ * cgraph.h (cgraph_varpool_node): New structure.
+ (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): Declare.
+ (cgraph_varpool_node, cgraph_varpool_node_for_identifier,
+ cgraph_varpool_finalize_decl, cgraph_varpool_mark_needed_node,
+ cgraph_varpool_asemble_pending_decls): Declare.
+ * cgraphunit.c (record_call_1): Notice variable references.
+ (cgraph_finalize_compilation_unit): Assemble pending variables.
+ * toplev.c (wrapup_global_declarations): Use varpool.
+ (compile_file): Assemble pending declarations.
+ (rest_of_decl_compilation): Use varpool in unit-at-a-time mode.
+ * varasm.c (assemble_name): Notice varpool references.
+
+Tue Jun 24 13:52:11 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro.
+ * langhooks.h (lang_hooks_for_decls): Add prepare_assemble_variable.
+ * varasm.c (assemble_variable): Call prepare_assemble_variable.
+
+2003-06-23 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin): Use expand_builtin_pow to expand
+ calls for pow, powf, powl and their __builtin_ variants.
+ (expand_builtin_pow): If the second argument is a constant
+ integer and compiling with -ffast-math, use expand_powi to
+ generate RTL if powi_cost is less than POWI_MAX_MULTS.
+ (powi_cost): New function to return the number of multiplications
+ necessary to evaluate an Nth power, for integer constant N.
+ (expand_powi): New function to expand the RTL for evaluating
+ the Nth power of a floating point value, for integer constant N.
+
+ * doc/tm.texi (POWI_MAX_MULTS): Document new target macro.
+
+Mon Jun 23 23:07:35 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_nodes_queue): Declare.
+ (eq_node): Take identifier as p2.
+ (cgraph_node): Update htab_find_slot_with_hash call.
+ (cgraph_node_for_identifier): New.
+ (cgraph_mark_needed_node): Move here from cgraphunit.c.
+ * cgraph.h (cgraph_nodes_queue): Declare.
+ (cgraph_node_for_identifier): Declare.
+ * cgraphunit.c (cgraph_finalize_function): Collect entry points here
+ instead of in cgraph_finalize_compilation_unit; constructors and
+ destructors are entry points.
+ (cgraph_finalize_compilation_unit): Reorganize debug outout;
+ examine nested functions after lowerng; call collect_functions hook.
+ (cgraph_mark_local_functions): DECL_COMDAT functions are not local.
+ (cgraph_finalize_compilation_unit): Do not collect entry points.
+ * varasm.c: Include cgraph.h
+ (assemble_name): Mark referenced identifier as needed.
+
+ * cgraphunit.c (record_call_1): Use get_callee_fndecl.
+
+2003-06-23 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (x86_output_mi_thunk): Don't pass MEM to %P0,
+ just SYMBOL_REF.
+ * config/s390/s390.c (s390_output_mi_thunk): Avoid .plt in -m31
+ mode, as it requires pic register loaded.
+
+ * varasm.c (resolve_unique_section): Remove prototype. No longer
+ static.
+ * tree.h (resolve_unique_section): New prototype.
+
+2003-06-23 Andreas Schwab <schwab@suse.de>
+
+ PR debug/9905
+ * dwarf2out.c (loc_descriptor_from_tree): Handle MODIFY_EXPR by
+ recursing through first argument.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ChangeLog.1: Fix a typo.
+ * cfgrtl.c: Fix comment typos.
+ * dwarf2out.c: Likewise.
+ * expmed.c: Likewise.
+ * genrecog.c: Likewise.
+ * jump.c: Likewise.
+ * rtlanal.c: Likewise.
+ * ssa-dce.c: Likewise.
+ * toplev.c: Likewise.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/extend.texi: Fix typos.
+ * doc/md.texi: Likewise.
+ * doc/tm.texi: Likewise.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * basic-block.h: Fix comment formatting.
+ * bt-load.c: Likewise.
+ * builtins.c: Likewise.
+ * c-common.c: Likewise.
+ * c-common.h: Likewise.
+ * c-format.c: Likewise.
+ * coverage.c: Likewise.
+ * cpplib.h: Likewise.
+ * cpppch.c: Likewise.
+ * dbxout.c: Likewise.
+ * diagnostic.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * expr.c: Likewise.
+ * fold-const.c: Likewise.
+ * function.c: Likewise.
+ * gcc.c: Likewise.
+ * gcov-io.c: Likewise.
+ * gcov-io.h: Likewise.
+ * gcov.c: Likewise.
+ * profile.c: Likewise.
+ * real.h: Likewise.
+ * sched-deps.c: Likewise.
+
+2003-06-23 Roger Sayle <roger@eyesopen.com>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Add a note on testing and
+ remove duplicates from testers list.
+
+2003-06-23 Nick Clifton <nickc@redhat.com>
+
+ * read-rtl.c (read_braced_string): Check for EOF. If
+ encountered issue an error message.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Document dump options, dT and dW.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * genrecog.c (pred_table): Remove the entry for
+ mode_independent_operand.
+ * recog.c (next_insns_test_no_inequality): Remove.
+ (mode_independent_operand): Likewise.
+ * recog.h: Remove the prototype for mode_independent_operand.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_simode_bld): Use rotxl.l to
+ store into bit 0.
+ * config/h8300/h8300.md (*extzv_1_r_h8300hs): Change cc of the
+ second alternative to set_znv.
+ (*extzv_1_r_inv_h8300hs): Likewise.
+
+2003-06-23 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * configure.in (in_tree_gas): Find out here whether GAS is ELF,
+ set in_tree_gas_is_elf accordingly.
+ (in_tree_ld): Find out whether LD emulation is ELF, set
+ in_tree_ld_is_elf accordingly.
+ (gcc_cv_as_subsections, gcc_cv_as_hidden, gcc_cv_as_leb128)
+ (gcc_cv_as_eh_frame, gcc_cv_as_shf_merge)
+ (gcc_cv_as_dwarf2_debug_line, gcc_cv_as_gdwarf2_flag)
+ (gcc_cv_as_gstabs_flag): Use $in_tree_gas_is_elf instead of
+ grepping gas/Makefile.
+ (gcc_cv_ld_ro_rw_mix, gcc_cv_ld_eh_frame_hdr, gcc_cv_ld_pie): Use
+ $in_tree_ld_is_elf instead of grepping ld/Makefile.
+ * configure: Regenerate.
+
+2003-06-22 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin_mathfn_2): Use tree_cons to build
+ up the stabilized argument list, not build_tree_list.
+ (expand_builtin_strcpy): Construct new argument list manually
+ instead of using chainon to modify the original argument list.
+ (expand_builtin_stpcpy): Construct new argument list manually
+ instead of using copy_list and chainon.
+ (expand_builtin_sprintf): New function. Optimize calls to
+ sprintf when the format is "%s" or doesn't contain a '%'.
+ (expand_builtin): Expand BUILT_IN_SPRINTF using the new function
+ expand_builtin_sprintf.
+
+2003-06-22 Andreas Schwab <schwab@suse.de>
+
+ * function.c (set_insn_locators): Mark as unused.
+
+2003-06-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * common.opt: Add -finline-limit.
+ * opts.c (common_handle_options): Handle it.
+ * opts.sh: Temporary kludge for -finline-limit.
+ * toplev.c (decode_f_option, independent_decode_option): Die.
+ (parse_options_and_default_flags): No independent_decode_option.
+
+2003-06-22 Andreas Jaeger <aj@suse.de>
+
+ * calls.c (emit_call_1): Readd lost ATTRIBUTE_UNUSED.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Document dumps, .btl, .cfg, and .bypass.
+
+2003-06-22 Andreas Schwab <schwab@suse.de>
+
+ * doc/invoke.texi: Remove leading `-' from options in index.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * bt-load.c: Follow spelling conventions.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * expr.c (emit_move_insn_1): Fix a comment typo.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Alphabetize dump options.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Remove a duplicate -dk.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Update dump file names.
+
+2003-06-22 Zack Weinberg <zack@codesourcery.com>
+
+ * config/i370/i370.c, config/i370/i370.h: Use HOST_CHARSET_ASCII
+ and HOST_CHARSET_EBCDIC, not HC_ASCII and HC_EBCDIC.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/rtl.texi: Fix the @findex for pre_modify.
+
+2003-06-22 Andreas Jaeger <aj@suse.de>
+
+ * caller-save.c: Convert to ISO C90.
+ * calls.c: Likewise.
+ * cfg.c: Likewise.
+ * cfganal.c: Likewise.
+ * cfgbuild.c: Likewise.
+ * cfgcleanup.c: Likewise.
+ * cfghooks.c: Likewise.
+ * cfglayout.c: Likewise.
+ * cfglayout.h: Likewise.
+ * cfgloop.c: Likewise.
+ * cfgloop.h: Likewise.
+ * cfgloopanal.c: Likewise.
+ * cfgloopmainip.c: Likewise.
+ * cfgrtl.c: Likewise.
+
+2003-06-22 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (BIGGEST_ALIGNMENT): Use TARGET_REALLY_IWMMXT for selecting
+ 64-bit alignment.
+
+2003-06-22 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (all call_value patterns): Remove register constraints on
+ value operand.
+
+2003-06-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * common.opt: More -f switches.
+ * opts.c (common_handle_options): Handle them.
+ * toplev.c (time_report): Make extern.
+ (f_options): USe flag_dummy.
+ (decode_f_option): No need to use f_options now.
+ * toplev.h (flag_cprop_registers, flag_ssa, flag_ssa_ccp,
+ flag_ssa_dce, time_report, flag_new_regalloc): Make extern.
+
+2003-06-22 Andreas Jaeger <aj@suse.de>
+
+ * c-lex.c: Convert to ISO C90.
+ * c-objc-common.c: Likewise.
+ * c-opts.c: Likewise.
+ * c-pch.c: Likewise.
+ * c-ppoutput.c: Likewise.
+ * c-pragma.h: Likewise.
+ * c-pretty-print.c: Likewise.
+ * c-pretty-print.h: Likewise.
+ * c-semantics.c: Likewise.
+ * c-tree.h: Likewise.
+ * c-typeck.c: Likewise.
+
+ * c-lang.c: Convert to ISO C90.
+
+2003-06-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.c (find_opt): Fix to always guarantee a find of a
+ switch with joined parameter.
+ * opts.h (struct cl_option): New member back_chain.
+ * opts.sh: Update to calculate and add back_chain member.
+
+2003-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.h (output_host_wide_integer): Declare.
+ * diagnostic.c (output_long_long_decicaml): New function.
+ (output_host_wide_integer): Likewise.
+ (output_format): Use them. Handle "%ll" and "%w".
+
+2003-06-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config.gcc (*-*-netbsd*): Add t-libgcc-pic to tmake_file.
+
+2003-06-21 Zack Weinberg <zack@codesourcery.com>
+
+ * aclocal.m4 (gcc_AC_C_CHARSET): Delete.
+ * configure.in: Don't use gcc_AC_C_CHARSET.
+ * configure, config.in: Regenerate.
+ * config/i370/i370.c, config/i370/i370.h: Use
+ (HOST_CHARSET == HC_EBCDIC) or (HOST_CHARSET == HC_ASCII)
+ instead of HOST_EBCDIC or !HOST_EBCDIC. Clarify comments a tad.
+
+2003-06-21 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * common.opt: New switches.
+ * opts.c: Include diagnostic.h.
+ (common_handle_option): Handle new switches.
+ * toplev.c (flag_loop_optimize, flag_crossjumping, flag_if_conversion,
+ flag_if_conversion2, flag_delete_null_pointer_checks,
+ flag_rerun_cse_after_loop): Make extern.
+ (flag_dummy): New.
+ (f_options): Update to use flag_dummy for moved options.
+ (decode_f_option): Some switches moved to opts.c.
+ * toplev.h (flag_loop_optimize, flag_crossjumping, flag_if_conversion,
+ flag_if_conversion2, flag_delete_null_pointer_checks,
+ flag_rerun_cse_after_loop, flag_keep_static_consts, flag_peel_loops,
+ flag_tracer, flag_thread_jumps, flag_unroll_loops,
+ flag_unroll_all_loops, flag_unswitch_loops): New.
+
+Sat Jun 21 13:41:00 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_va_arg): Fix allocation of temporary slot.
+
+2003-06-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ same_cmp_preceding_p.
+ * config/h8300/h8300.c (same_cmp_preceding): New.
+ * config/h8300/h8300.md: Extend peephole2's that transform
+ compare:SI into shorter sequences so that they can deal with
+ signed comparisons.
+
+2003-06-21 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Use Windows instead of Win32.
+
+ Update Andreas Jaeger's entry.
+
+ Merge the two entries of Kaveh Ghazi, David Edelsohn, and
+ Loren J. Rittle.
+
+2003-06-21 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * mkconfig.sh: Add multiple inclusion guards to generated headers.
+
+2003-06-20 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-decl.c (store_parm_decls): Make saved_warn_shadow boolean.
+ * common.opt: Add remaining -W options and -g.
+ * diagnostic.c (warnings_are_errors): Remove.
+ * flags.h: Make most warning flags boolean.
+ * opts.c (common_handle_option): Handle remaining -W options, and -g.
+ Move many warning flags from toplev.c, making them boolean.
+ * toplev.c: Remove many warning flags.
+ (decode_W_option): Remove.
+ (decode_g_option): Make extern. Error on unknown switch.
+ (lang_independent_W_options): Use warn_dummy.
+ (independent_decode_option): Just handle -f switches now.
+ * toplev.h (decode_g_option): New.
+
+2003-06-20 Aldy Hernandez <aldyh@redhat.com>
+
+ PR/11092
+ * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Adjust for
+ vectors.
+
+2003-06-20 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * opts.sh: Tweak awk script for portability.
+
+2003-06-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10888
+ * tree-inline.c (expand_call_inline): Do not warn about failing to
+ inline functions declared in system headers.
+ * doc/invoke.texi (-Winline): Expand on documentation.
+
+2003-06-20 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_file_start): Disable
+ file_start_file_directive for ELF and not MDEBUG.
+
+2003-06-20 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (ROUND_TYPE_ALIGN): Remove.
+
+2003-06-20 Richard Henderson <rth@redhat.com>
+
+ * hooks.c (hook_int_void_no_regs): Rename from
+ hook_reg_class_void_no_regs; change return type.
+ * hooks.h: Update.
+ * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Update.
+ * target.h (branch_target_register_class): Change return type to int.
+ Add documentation.
+ * config/sh/sh.c (sh_target_reg_class): Change return type.
+ * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise.
+
+2003-06-20 Andreas Tobler <toa@pop.agri.ch>
+
+ * c-format.c: Change _Bool to bool reverting part of the last
+ patch.
+
+2003-06-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * som.h (ASM_OUTPUT_SOURCE_LINE): Use targetm.strip_name_encoding to
+ strip name encoding.
+
+2003-06-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (gcc_cv_as_gstabs_flag): Disable if assembler warns.
+ * configure: Regenerate.
+ Fixes PR driver/9362.
+
+2003-06-20 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/alpha/alpha.c (alpha_file_start): Fix typo.
+
+2003-06-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/mips.h (PUT_SDB_FUNCTION_END): Pass 0 as third arg
+ to ASM_OUTPUT_SOURCE_LINE.
+
+2003-06-20 Daniel Egger <degger@fhm.edu>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Building): Correct and improve statement
+ about parallel builds.
+
+2003-06-20 Andreas Jaeger <aj@suse.de>
+
+ * c-common.c: Change _Bool to bool reverting part of the last
+ patch.
+
+2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * tree.h (expand_function_end): Remove all parameters.
+ * function.c (expand_function_end): Remove all parameters.
+ Use input_location. Never expand_end_bindings.
+ * c-decl.c (c_expand_body_1): Adjust expand_function_end call.
+ * coverage.c (create_coverage): Likewise.
+
+2003-06-20 Nick Clifton <nickc@redhat.com>
+
+ * doc/extend.texi (ARM Built-in Functions): New node. Document
+ ARM builtin functions for iWMMXt support.
+
+2003-06-20 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/install.texi (--with-gnu-as): Mention SPARC/Solaris and
+ SPARC64/Solaris as platforms where --with-gnu-as makes a difference.
+ (--with-as): Add @anchor.
+ (--with-gnu-ld): Fix typo.
+ (--with-ld): Add @uref to --with-as.
+
+2003-06-19 Zack Weinberg <zack@codesourcery.com>
+
+ * doc/tm.texi: Uniformly use @defmac for macros, rather than
+ @table items. Minor formatting and editorial corrections.
+
+2003-06-20 Neil Booth <neil@daikokuya.co.uk>
+
+ * line-map.c, line-map.h: Convert to ISO prototypes.
+
+2003-06-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcse.c (store_killed_in_insn): Fix.
+
+2003-06-19 Zack Weinberg <zack@codesourcery.com>
+
+ * target.h (asm_out.file_start, file_start_app_off,
+ file_start_file_directive): New hooks.
+ * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE,
+ TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START):
+ New hook-definition macros.
+ * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START.
+ * varasm.c (default_file_start): New.
+ * output.h: Prototype it.
+ * toplev.c (init_asm_output): Use targetm.asm_out.file_start.
+ * system.h: Poison ASM_FILE_START.
+
+ * config/alpha/alpha.c (alpha_write_verstamp): Delete.
+ (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK.
+ (unicosmk_asm_file_start): Rename unicosmk_file_start,
+ make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END,
+ TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate.
+ * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor
+ TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in
+ comment.
+ * config/arc/arc.c (arc_asm_file_start): Rename
+ arc_file_start, take no arguments, make static.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/arm/arm.c (aof_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it, when appropriate.
+ * config/arm/coff.h, config/arm/elf.h:
+ Set TARGET_ASM_FILE_START_APP_OFF to true.
+ * config/avr/avr.c (asm_file_start): Rename avr_file_start,
+ take no arguments, make static.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
+ Set them.
+ * config/c4x/c4x.c (c4x_file_start): New static function.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
+ Set them.
+ * config/cris/cris.c (cris_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename
+ dsp16xx_file_start, make static.
+ (luxworks_dsp16xx_file_start): Delete.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/h8300/h8300.c (asm_file_start): Rename
+ h8300_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/i370/i370.c (i370_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/i386/i386.c (x86_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE,
+ X86_FILE_START_FLTUSED): New macros, default to false.
+ * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1.
+ * config/i386/sysv4.h, config/i386/sco5.h: Override
+ X86_FILE_START_VERSION_DIRECTIVE to true.
+ * config/ia64/ia64.c (ia64_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ (emit_safe_across_calls): Take no arguments.
+ * config/ia64/ia64.md: Update to match.
+ * config/m32r/m32r.c (m32r_asm_file_start): Rename
+ m32r_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename
+ m68hc11_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ (print_options): Delete.
+ * config/m68k/m68k.c (m68k_hp320_file_start): New static function.
+ (TARGET_ASM_FILE_START_APP_OFF): Set.
+ * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to
+ m68k_hp320_file_start.
+ * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start):
+ Make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/mmix/mmix.c (mmix_asm_file_start): Rename
+ mmix_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/mn10300/mn10300.c (asm_file_start): Rename
+ mn10300_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set.
+ * config/pa/pa.c (pa_file_start_level, pa_file_start_space,
+ pa_file_start_file, pa_file_start_mcount, pa_elf_file_start,
+ pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start,
+ pa_hpux64_hpas_file_start): New static functions.
+ * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start.
+ * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to
+ pa_linux_file_start.
+ * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to
+ pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as
+ appropriate.
+ * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start.
+ * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF.
+ (rs6000_file_start): Make static, take no arguments. Reset
+ default_cpu under certain conditions.
+ (rs6000_xcoff_file_start): New function.
+ * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set.
+ * config/rs6000/xcoff.h (TARGET_ASM_FILE_START,
+ TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override.
+ * config/sh/sh.c (output_file_start): Rename
+ sh_file_start, make static, take no arguments. Merge in old
+ code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/sh/sh.c (TARGET_ELF): Define to 0.
+ * config/sh/elf.h (TARGET_ELF): Redefine to 1.
+ * config/v850/v850.c (asm_file_start): Delete.
+ (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/vax/vax.c (vax_file_start): New static function.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set.
+
+ * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false.
+ * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h
+ * config/i386/att.h, config/i386/gas.h, config/i386/linux.h
+ * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h
+ * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h
+ * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true.
+
+ * config/darwin.h, config/elfos.h, config/alpha/elf.h
+ * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h
+ * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h
+ * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h
+ * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h
+ * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h
+ * config/i370/i370.h, config/i386/att.h, config/i386/gas.h
+ * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h
+ * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h
+ * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h
+ * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h
+ * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h
+ * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h
+ * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h
+ * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h
+ * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h
+ * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h
+ * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START.
+
+ * config/alpha/alpha-protos.h, config/arc/arc-protos.h
+ * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h
+ * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
+ * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h
+ * config/mips/mips-protos.h, config/mmix/mmix-protos.h
+ * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h
+ * config/sh/sh-protos.h, config/v850/v850-protos.h: Update.
+
+ * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h:
+ Remove reference to ASM_FILE_START in comment.
+ * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h
+ * config/arm/linux-gas.h, config/arm/netbsd-elf.h
+ * config/arm/netbsd.h: Delete definition of ARM_OS_NAME.
+
+2003-06-19 Graeme Peterson <gp@qnx.com>
+
+ * gcc.c (target_sysroot_suffix, target_sysroot_hdrs_suffix,
+ SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC, sysroot_suffix_spec,
+ sysroot_hdrs_suffix_spec): New.
+ (static_specs): Initialize new variables.
+ (add_sysroot_suffix_prefix, do_spec_1, main): Use new variables.
+ * doc/tm.texi (SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC):
+ New macros.
+
+2003-06-19 Andreas Jaeger <aj@suse.de>
+
+ * c-aux-info.c: Convert to ISO C90.
+ * c-pragma.c: Likewise.
+ * c-common.c: Likewise.
+ * c-common.h: Likewise.
+ * c-convert.c: Likewise.
+ * c-cppbuiltin.c: Likewise.
+ * c-dump.c: Likewise.
+ * c-decl.c: Likewise
+ * c-format.c: Likewise.
+ * c-incpath.c: Likewise.
+ * c-incpath.h: Likewise.
+
+2003-06-19 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_errno_check): Assume that flag_errno_math
+ and HONOR_NANS have been tested before calling here. Only try
+ to set errno ourselves if the decl can't throw an exception.
+ (expand_builtin_mathfn): Move the code to stabilize the arg
+ after the main switch, so that that its only done when needed.
+ BUILT_IN_SQRT{,F,L} doesn't set errno if its arg is nonnegative.
+ Don't modify the original expr when stabilizing the argument.
+ (expand_builtin_mathfn_2): Likewise, move the code to stabilize
+ the args after the main switch, and don't modify the orginal exp.
+
+2003-06-19 Aldy Hernandez <aldyh@redhat.com>
+
+ * expr.c (const_vector_from_tree): Initialize remaining elements
+ to 0.
+
+2003-06-19 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.md ("spe_evfscfsi"): Change operand types.
+ Change "fix" to "float".
+
+2003-06-19 Andreas Jaeger <aj@suse.de>
+
+ * c-tree.h: Remove declaration of poplevel.
+
+ * tree.h: Remove declaration of approx_sqrt.
+
+ * c-lex.c: Remove redundant declaration of asm_out_file.
+
+ * flags.h: Remove declaration of warn_unknown_pragma and
+ main_input_filename.
+
+ * rtl.h: Remove functions from fold-const.c since they're already
+ declared in tree.h.
+
+ * regs.h: Remove redundant declaration of reg_names.
+
+ * bt-load.c (migrate_btr_defs): Correct printf arguments.
+
+ * protoize.c: Fix breakage from last patch.
+
+2003-06-19 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * hooks.h (hook_reg_class_void_no_regs): Only declare if tm.h
+ has been included.
+
+2003-06-18 James A Morrison <ja2morri@student.math.uwaterloo.ca>
+
+ * config/sparc/sparc.c: Update copyright year.
+
+2003-06-19 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (init_cumulative_args): Limit CALL_LIBCALL
+ to ABI_V4.
+
+2003-06-18 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR bootstrap/4068
+ * config/i386/liunx.h: Don't include sys/ucontext.h for glibc 2.0.
+
+2003-06-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (TARGET_INITIALIZER and friends): Move
+ to the end of the file. Remove unnecessary prototypes.
+
+2003-06-19 Hans-Peter Nilsson <hp@axis.com>
+
+ * bt-load.c (migrate_btr_def) [INSN_SCHEDULING]: Conditionalize
+ calls to insn_default_latency and result_ready_cost. Initialize
+ def_latency to 1.
+
+2003-06-18 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/unwind-ia64.c (_Unwind_GetCFA): New.
+ (_Unwind_FindEnclosingFunction): Implement.
+
+2003-06-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * toplev.c (rest_of_handle_sched): Hide the entire function if
+ INSN_SCHEDULING is not defined.
+ (rest_of_compilation): Call rest_of_handle_sched() only when
+ INSN_SCHEDULING is defined.
+
+2003-06-18 Stephen Clarke <stephen.clarke@superh.com>
+ J"orn Rennecke <joern.rennecke@superh.com>
+
+ * bt-load.c: New file.
+ * Makefile.in (OBJS): Include bt-load.o
+ (bt-load.o): Add dependencies.
+ * flags.h (flag_branch_target_load_optimize): Declare.
+ (flag_branch_target_load_optimize2): Likewise.
+ * hooks.c (hook_reg_class_void_no_regs): New function.
+ (hook_bool_bool_false): Likewise.
+ * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare.
+ * rtl.h (branch_target_load_optimize): Declare.
+ * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define.
+ (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
+ (TARGET_INITIALIZER): Include these.
+ * target.h (struct gcc_target): Add branch_target_register_class
+ and branch_target_register_callee_saved members.
+ * toplev.c (enum dump_file_index): Add DFI_branch_target_load
+ (dump_file) Add "tars" entry.
+ (flag_branch_target_load_optimize): New variable.
+ (flag_branch_target_load_optimize2): Likewise.
+ (lang_independent_options): Add entries for new options.
+ (rest_of_compilation): Call branch_target_load_optimize.
+ * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document.
+ (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
+ * doc/invoke.texi: Document -fbranch-target-load-optimize and
+ -fbranch-target-load-optimize2.
+ * rtl.h (epilogue_completed): Declare.
+ * recog.c (epilogue_completed): New variable.
+ * toplev.c (rest_of_compilation): Set it.
+ * flow.c (mark_regs_live_at_end): Use it.
+ * config/ia64/ia64.c (ia64_output_mi_thunk): Set it.
+ * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
+ * config/sh/sh.c (sh_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
+
+ * sh.c (shmedia_space_reserved_for_target_registers): New variable.
+ (sh_target_reg_class): New function.
+ (sh_optimize_target_register_callee_saved): Likwise.
+ (shmedia_target_regs_stack_space): Likewise.
+ (shmedia_reserve_space_for_target_registers_p): Likewise.
+ (shmedia_target_regs_stack_adjust): Likewise.
+ (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override.
+ (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
+ (calc_live_regs): If flag_branch_target_load_optimize2 and
+ TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved
+ for target registers, make sure that we save all target registers.
+ (sh_expand_prologue, sh_expand_epilogue): Take target register
+ optimizations into account. Collapse stack adjustments if that
+ is beneficial.
+ (initial_elimination_offset): Reserve space for target registers
+ if necessary.
+ * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define.
+ (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize.
+
+2003-06-18 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc: Add an extra_header for ARM targets.
+ Support configuring with --with-cpu=iwmmxt.
+ * doc/invoke.texi: Document new value for -mcpu= ARM switch.
+ * config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
+ names. Fix formatting.
+ * config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
+ names.
+ * config/arm/arm-protos.h (arm_emit_vector_const): New
+ prototype.
+ (arm_output_load_gr): New prototype.
+ * config/arm/arm.c (extra_reg_names1): Delete.
+ (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT,
+ * arch_is_iwmmxt): Define.
+ (all_cores, all_architecture): Add entry for iwmmxt.
+ (arm_override_options): Add support for iwmmxt.
+ (use_return_insn, arm_function_arg, arm_legitimate_index_p,
+ arm_print_value, arm_rtx_costs_1, output_move_double,
+ arm_compute_save_reg_mask, arm_output_epilogue,
+ arm_get_frame_size, arm_expand_prologue, arm_print_operand,
+ arm_assemble_integer, arm_hard_regno_ok, arm_regno_class):
+ Likewise.
+ (arm_init_cumulative_args): Count iwmmxt registers.
+ (arm_function_ok_for_sibcall): Return false of sibcall_blocked
+ has been set.
+ (struct minipool_node): Add fix_size field.
+ (add_minipool_forward_ref): Add support for 8-byte aligning of
+ the pool.
+ (add_minipool_backward_ref, add_minipool_offsets,
+ dump_minipool, push_minipool_fix): Likewise.
+ (struct builtin_description): New struct.
+ (builtin_description): New array of iwmmxt builtin functions.
+ (arm_init_iwmmxt_builtins): New function.
+ (arm_init_builtins): New function.
+ (safe_vector_operand): New function.
+ (arm_expand_binop_builtin): New function.
+ (arm_expand_unop_builtin): New function.
+ (arm_expand_builtin): New function.
+ (arm_emit_vector_const): New function.
+ (arm_output_load_gr): New function.
+ * config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT,
+ TARGET_REALLY_IWMMXT, arm_arch_iwmmxt, IWMMXT_ALIGNMENT,
+ TYPE_NEEDS_IWMMXT_ALIGNMENT, ADJUST_FIELD_ALIGN,
+ DATA_ALIGNMENT, LOCAL_ALIGNMENT, VECTOR_MODE_SUPPORTED_P): Define.
+ (BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled.
+ (CPP_CPU_ARCH_SPEC): Add entries for iwmmxt.
+ (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER,
+ reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
+ REG_CLASS_FOR_LETTER): Add iwmmxt registers.
+ (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt
+ registers unless the iwmmxt target is selected.
+ (FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM,
+ FIRST_IWMMXT_REGNUM, LAST_IWMMXT_REGNUM, IS_IWMMXT_REGNUM,
+ IS_IWMMXT_GR_REGNUM): Define.
+ (FIRST_PSEUDO_REGISTER): Bump to 63.
+ (struct machine_function): Add sibcall_blocked field.
+ (Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and
+ nargs fields.
+ (enum arm_builtins): New enum list.
+ * config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC,
+ UNSPEC_TMOVMSK, UNSPEC_WSAD, UNSPEC_WSADZ, UNSPEC_WMACS,
+ UNSPEC_WMACU, UNSPEC_WMACSZ, UNSPEC_WMACUZ, UNSPEC_CLRDI,
+ UNSPEC_WMADDS, UNSPEC_WMADDU): New unspecs.
+ (VUNSPEC_TMRC, VUNSPEC_TMCR, VUNSPEC_ALIGN8, VUNSPEC_WCMP_EQ,
+ VUNSPEC_WCMP_GTU, VUNSPEC_WCMP_GT): New vunspecs.
+ (movv2si, movv4hi, movv8qi): New expands for vector moves.
+ Include iwmmxt.md.
+ * config/arm/t-xscale-elf (MULTILIB_OPITONS): Add iwmmxt
+ multilib.
+ (MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise.
+ * config/arm/mmintrin.h: New ARM specific header file.
+ * config/arm/iwmmx.md: New iWMMXt specific machine patterns.
+
+2003-06-18 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * toplev.c (Remaining -d letters summary): Update.
+
+2003-06-18 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * config/rs6000/rs6000.c (init_cumulative_args): Add and handle LIBCALL
+ argument.
+ (function_arg): Handle CALL_LIBCALL flag.
+ * config/rs6000/rs6000-protos.h (init_cumulative_args): Update
+ prototype.
+ * config/rs6000/rs6000.h (CALL_LIBCALL): New macro.
+ (INIT_CUMULATIVE_LIBCALL_ARGS): New macro.
+ (INIT_CUMULATIVE_ARGS): Add LIBCALL argument.
+ (INIT_CUMULATIVE_INCOMING_ARGS): Likewise.
+
+2003-06-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * common.opt: New options.
+ * opts.c (maybe_warn_unused_parameter, set_Wextra, handle_param,
+ set_Wunused): New.
+ (common_handle_option): Handle new options.
+ * toplev.c (set_target_switch): Export.
+ (set_Wextra, set_Wunused, maybe_warn_unused_parameter): Move to opts.c.
+ (decode_W_option): -Wunused and -Wextra handled in opts.c now.
+ (independent_decode_option): More options handled in opts.c now.
+ Change prototype.
+ * toplev.h (set_target_switch): New.
+
+2003-06-17 Robert Abeles <rabeles@archaelogic.com>
+
+ PR debug/4252
+ * c-opts.c (c_common_handle_option): Pass -fdump argument suffix
+ to dump_switch_p().
+ * tree-dump.c (dump_switch_p): Remove redundant 'dump-' prefix
+ from static strings in dump_files.
+
+2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * system.h (ANSI_PROTOTYPES, PTR_CONST, LONG_DOUBLE, VPARAMS,
+ VA_OPEN, VA_FIXEDARG, VA_CLOSE, VA_START): undef and poison these
+ libiberty macros.
+
+2003-06-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/10929
+ * tree-inline.c (expand_call_inline): Don't warn about failing to
+ inline a function which was made inline by -finline-functions.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Update to ISO C.
+ * config/h8300/h8300.c: Likewise.
+ * config/h8300/h8300.h: Likewise.
+ * config/h8300/h8300.md: Likewise.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Replace BUILD_CC references with CC_FOR_BUILD.
+ * configure: Regenerate.
+ * Makefile.in: Replace BUILD_CC references with CC_FOR_BUILD.
+
+2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
+
+ * install.texi (Testing): Add information on how to run Java
+ runtime tests separately.
+
+2003-06-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/mips.md (trap): Use break 0 when !TARGET_GAS.
+
+ * config/mips/iris6-o32.h (MIPS_ISA_DEFAULT): Remove.
+ (MIPS_CPU_STRING_DEFAULT): Redefine to mips2.
+
+2003-06-17 Christopher Faylor <cgf@redhat.com>
+
+ * doc/install.texi: Add msvc rebuild caveat.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/sh/coff.h: Replace Hitachi with Renesas.
+ * config/sh/elf.h: Likewise.
+ * config/sh/embed-elf.h: Likewise.
+ * config/sh/lib1funcs.asm: Likewise.
+ * config/sh/sh-protos.h: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sh/sh.h: Likewise.
+ * config/sh/sh.md: Likewise.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ChangeLog.3: Fix comment typos.
+ * ChangeLog.6: Likewise.
+ * config/d30v/d30v.c: Likewise.
+ * config/h8300/h8300.md: Likewise.
+ * config/m32r/m32r.md: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/mips/mips.md: Likewise.
+ * config/ns32k/NOTES: Likewise.
+
+2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/sourcebuild.texi (libgcj Tests): Simplify instructions on how
+ to run Java runtime tests separately.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Update a comment.
+
+2003-06-17 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (ROUND_TYPE_ALIGN, LOCAL_ALIGNMENT): Complex modes
+ are aligned like integral modes.
+ (SH5_WOULD_BE_PARTIAL_NREGS): Also test for CDImode and DCmode.
+
+ * sh.h (EXTRA_CONSTRAINT_Csy): Allow PIC_DIRECT_ADDR_P.
+ (LEGITIMATE_PIC_OPERAND_P): Allow LABEL_REF.
+ * sh.md (*pt): Remove.
+
+ * sh.h (REG_ALLOC_ORDER): Avoid squandering call-saved registers.
+
+ * sh.md (return_media_rte): New pattern.
+ (return_media): Use it.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/contrib.texi: Replace Hitachi with Renesas.
+ * doc/install.texi: Likewise.
+ * doc/invoke.texi: Likewise.
+
+2003-06-17 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (CONST_OK_FOR_J16): Fix HOST_BITS_PER_WIDE_INT >= 64
+ behaviour.
+
+2003-06-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * doc/tm.texi (MD_FALLBACK_FRAME_STATE_FOR): Mention MAKE_THROW_FRAME.
+
+ * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Partly revert
+ 2003-01-23 patch. Corrected to handle kernels with changed ucontext.
+
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Error on invalid
+ -msdata=eabi usages.
+
+ * gcc/config/rs6000/sysv4.h (USE_LIBC_1): Delete all uses.
+
+2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alloc-pool.c: Don't check HAVE_LONG_DOUBLE.
+ * fixinc/gnu-regex.c: Don't define `volatile'.
+ * ggc-page.c: Don't check HAVE_LONG_DOUBLE.
+ * ggc-simple.c: Likewise.
+ * system.h: Don't define `volatile'.
+
+ * aclocal.m4 (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Delete.
+ * configure.in (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Don't
+ call these macros.
+ * config.in, configure: Regenerated.
+
+2003-06-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/ia64/ia64.c (ia64_expand_builtin, case IA64_BUILTIN_BSP):
+ Handle POINTERS_EXTEND_UNSIGNED.
+
+2003-06-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/mips.c (TARGET_ASM_UNALIGNED_DI_OP) [TARGET_IRIX5 &&
+ !TARGET_IRIX6]: Define as NULL.
+
+2003-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * config/sparc/sparc.c (sparc_va_arg): Don't align 16-byte+ structures.
+
+2003-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * dbxout.c (dbxout_source_line_counter): New global variable.
+ Mark it with GTY(()).
+ (dbxout_source_line): Increment dbxout_source_line_counter
+ and pass it to ASM_OUTPUT_SOURCE_LINE.
+ * sdbout.c (sdbout_source_line_counter): New global variable.
+ Mark it with GTY(()).
+ (unnamed_struct_number): Mark it with GTY(()).
+ (sdbout_source_line): Increment sdbout_source_line_counter
+ and pass it to ASM_OUTPUT_SOURCE_LINE.
+ * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Add third parameter
+ (xcoffout_source_line): Pass 0 as third argument to
+ ASM_OUTPUT_SOURCE_LINE.
+ (xcoffout_begin_prologue): Likewise.
+ * config/dbxout.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/dbxelf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/lynx.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/ptx4.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/alpha/alpha.c (alpha_start_function): Pass 0 as third
+ argument to ASM_OUTPUT_SOURCE_LINE.
+ * config/alpha/alpha.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/arm/aout.h: Remove useless comment.
+ * config/avr/avr.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/i960/i960.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/m68k/hp320.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/mcore/mcore-pe.h (ASM_OUTPUT_SOURCE_LINE): Add third
+ parameter. Use it instead of 'sym_lineno' but without incrementing it.
+ * config/mips/mips.c (mips_output_function_prologue): Pass 0 as third
+ argument to ASM_OUTPUT_SOURCE_LINE.
+ * config/mips/mips.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/mmix/mmix.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/pa/som.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sh/elf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sparc/aout.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sparc/pbd.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * doc/tm.texi (ASM_OUTPUT_SOURCE_LINE): Document third parameter.
+
+2003-06-17 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_expand_block_move): Declare.
+ (expand_block_move, output_block_move): Remove.
+ * config/mips/mips.h (enum block_move_type): Remove.
+ * config/mips/mips.c (block_move_call, output_block_move): Remove.
+ (mips_block_move_straight, mips_adjust_block_mem): New function.
+ (mips_block_move_loop): Renamed and reworked from block_move_loop.
+ (mips_expand_block_move): Likewise expand_block_move. Return false
+ to fall back on the target-independent code.
+ * config/mips/mips.md (movstrsi): Use mips_expand_block_move.
+ (movstrsi_internal*): Remove.
+
+2003-06-16 Zack Weinberg <zack@codesourcery.com>
+
+ * cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c
+ * cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c
+ * cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to
+ ISO C: new-style function declarations, no need for PARAMS,
+ no special punctuation on indirect function calls, use string
+ constant concatenation where convenient.
+
+2003-06-17 Andreas Jaeger <aj@suse.de>
+
+ * rtl.h: Remove declarations from coverage.h.
+ * toplev.c: Include coverage.h.
+ * Makefile.in (toplev.o): Depend on coverage.h.
+
+ * toplev.h: Remove extra declaration of print_time.
+
+ * gengtype.c (close_output_files): Remove duplicated declaration.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/sparc/sysv4.h: Remove target-independent comment;
+ replace "GNU CC" with "GCC".
+ * config/vxworks.h: Replace "GNU compiler" with "GCC".
+ * config/sparc/aout.h, config/sparc/biarch64.h, config/sparc/elf.h,
+ config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h,
+ config/sparc/lite.h, config/sparc/litecoff.h, config/sparc/liteelf.h,
+ config/sparc/netbsd-elf.h, config/sparc/openbsd.h,
+ config/sparc/rtemself.h, config/sparc/sol2-64.h,
+ config/sparc/sol2-bi.h, config/sparc/sol2-gas-bi.h,
+ config/sparc/sol2-gld-bi.h, config/sparc/sol2-gld.h,
+ config/sparc/sol2.h, config/sparc/sp64-aout.h,
+ config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h,
+ config/sparc/sparc-protos.h, config/sparc/sysv4-only.h: Replace
+ "GNU compiler", "GNU CC" with "GCC".
+ * config/sparc/cypress.md, config/sparc/hypersparc.md,
+ config/sparc/sparc-modes.def, config/sparc/sparc.c,
+ config/sparc/sparc.md, config/sparc/sparclet.md,
+ config/sparc/supersparc.md, config/sparc/ultra1_2.md,
+ config/sparc/ultra3.md: Replace "GNU CC", "GNU Compiler", and
+ "GNU C Compiler" with "GCC".
+ * config/ip2k/ip2k.h: Replace "GNU CC" and "GNU compiler" with "GCC".
+
+2003-06-16 Aldy Hernandez <aldyh@redhat.com>
+
+ * simplify-rtx.c (simplify_subreg): Do not over-extend vector
+ constants.
+
+ * testsuite/gcc.c-torture/execute/simd-4.c: New.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/ip2k/ip2k.h: Remove target-independent comments.
+
+ * config.gcc: Explicitly mention elfos.h in ip2k entry.
+ * config/ip2k/ip2k.h: Don't #include it here.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
+ config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
+ dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
+ function.c, gcc.c, genoutput.c, gensupport.c, global.c,
+ haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
+ loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
+ read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
+ stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
+ the PTR macro.
+
+ * gengtype.c: Don't use UNION_INIT_ZERO.
+ * system.h (UNION_INIT_ZERO): Delete.
+
+2003-06-16 Richard Henderson <rth@redhat.com>
+
+ * simplify-rtx.c (simplify_subreg): Use GET_MODE_SIZE instead of
+ GET_MODE_UNIT_SIZE when simplifying constant vectors.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * timevar.c (get_run_time): Remove function provided also by
+ libiberty.
+ * timevar.h: Remove get_run_time declaration.
+
+2003-06-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): Remove
+ unreachable code.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c,
+ cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't
+ use macros from "symcat.h", instead rely on ISO C.
+
+ * system.h: Don't include "symcat.h".
+ * configure.in (AC_C_STRINGIZE): Delete.
+ * config.in, configure: Regenerate.
+
+2003-06-16 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * Makefile.in (install-mkheaders): Use INSTALL_SCRIPT for scripts.
+
+ * tree.h (STMT_CHECK): New macro.
+ Also upper-case argument names on all checking macros and
+ fix some whitespace problems; assume CODE argument does not
+ have side-effects.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * scan.h: Convert to ISO C.
+ * system.h: Likewise.
+
+ * c-format.c (dynamic_format_types): New pointer for dynamic data.
+ (find_length_info_modifier_index, init_dynamic_asm_fprintf_info):
+ New functions split out of...
+ (handle_format_attribute): ...here.
+
+2003-06-16 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (REG_CLASS_FROM_LETTER): Change to:
+ (REG_CLASS_FROM_CONSTRAINT).
+ (CONST_OK_FOR_I): Rename to:
+ (CONST_OK_FOR_I08). Changed all users.
+ (CONST_OK_FOR_J): Rename to:
+ (CONST_OK_FOR_I16). Changed all users.
+ (CONST_OK_FOR_K): Rename to:
+ (CONST_OK_FOR_P27). Changed all users.
+ (CONST_OK_FOR_L): Rename to:
+ (CONST_OK_FOR_K08). Changed all users.
+ (CONST_OK_FOR_O): Rename to:
+ (CONST_OK_FOR_I06). Changed all users.
+ (CONST_OK_FOR_P): Rename to:
+ (CONST_OK_FOR_I10). Changed all users.
+ (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define.
+ (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise.
+ (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise.
+ (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise.
+ (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise.
+ (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise.
+ (CONST_OK_FOR_LETTER_P): Replace with
+ (CONST_OK_FOR_CONSTRAINT_P).
+ (EXTRA_CONSTRAINT_S): Rename to:
+ (EXTRA_CONSTRAINT_C16). Changed all users.
+ (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses.
+ (EXTRA_CONSTRAINT_T): Rename to:
+ (EXTRA_CONSTRAINT_Csy). Changed all users.
+ (EXTRA_CONSTRAINT_Z): Remove.
+ (EXTRA_CONSTRAINT): Replace with:
+ (EXTRA_CONSTRAINT_STR).
+ (EXTRA_CONSTRAINT_U): Rename to:
+ (EXTRA_CONSTRAINT_Z). Changed all users.
+ * sh.c (and_operand): Use CONST_OK_FOR_J16.
+ * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints.
+ (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise.
+ (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise.
+ (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise.
+ (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise.
+ (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise.
+ (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise.
+ (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise.
+ (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise.
+ (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise.
+ (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise.
+ (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise.
+ (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise.
+ (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise.
+ (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise.
+ (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise.
+ (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise.
+ (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise.
+ (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise.
+ (sssubv4hi3): Likewise.
+ (movsf_i): Change I[08]/r to G/r.
+ (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc.
+
+ * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD.
+
+2003-06-16 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/i386/i386.c (ix86_memory_move_cost): Fix typo.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * basic-block.h: Remove duplicate prototype of
+ note_prediction_to_br_prob.
+
+ * tree.h: Remove duplicate prototype of strip_float_extensions.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/c4x/c4x.c: Don't include "c-tree.h".
+ * config/pa/pa.c: Likewise.
+ * langhooks.c: Likewise.
+ * tree.h (poplevel): Declare.
+
+2003-06-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (const_costs): Move this to ...
+ (h8300_rtx_costs): ... here.
+
+2003-06-16 Roger Sayle <roger@eyesopen.com>
+
+ * optabs.h (enum optab_index): Add new OTI_tan and OTI_atan.
+ (tan_optab, atan_optab): Define corresponding macros.
+ * optabs.c (init_optabs): Initialize tan_optab and atan_optab.
+ * genopinit.c (optabs): Implement tan_optab and atan_optab
+ using tan?f2 and atan?f2 patterns.
+ * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_TAN{,F,L}
+ using tan_optab, and BUILT_IN_ATAN{,F,L} using atan_optab.
+ Change the default value of errno_set to false.
+ (expand_builtin): Expand BUILT_IN_TAN{,F,L} and BUILT_IN_ATAN{,F,L}
+ using expand_builtin_mathfn.
+
+ * config/i386/i386.md (atansf2, atandf2, atanxf2, atantf2): New
+ expander patterns implemented using existing atan2?f3 patterns.
+
+2003-06-16 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (expand_expr <PLUS_EXPR>): If operand_equal_p considers
+ both operands of the addition equal, reuse the expanded RTL.
+ (expand_expr <MULT_EXPR>): Likewise for multiplication.
+
+2003-06-16 Roger Sayle <roger@eyesopen.com>
+ Jeff Law <law@redhat.com>
+
+ * fold-const.c (operand_equal_p): Consider two calls to "const"
+ functions with identical non-volatile arguments to be equal.
+ Consider the FUNCTION_DECL for the "__builtin_foo" form of a
+ built-in function to be equal to the "foo" form.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/rs6000/sysv4le.h: Remove target-independent comment.
+ Replace "GNU compiler" with "GCC" in comment.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * tracer.c: Remove duplicate declaration.
+
+ * toplev.c: Remove extra declaration of decode_d_option.
+
+ * ssa.c: Remove duplicate declaration.
+
+ * sreal.c: Remove extra declaration of dump_sreal.
+
+ * reload1.c: Remove duplicate declarations.
+
+ * integrate.c: Remove extra declaration of
+ set_decl_abstract_flags.
+
+ * flow.c: Remove extra declaration of dump_flow_info.
+
+ * alias.c: Remove extra declaration of get_addr.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/rtems.h, config/sol2.h, config/svr4.h, config/usegas.h,
+ config/vxworks.h: GNU CC -> GCC.
+
+ * convert.c, dwarf2out.c, dwarfout.c, emit-rtl.c, function.c,
+ lists.c, print-rtl.c, print-tree.c, read-rtl.c, rtl-error.c,
+ stmt.c, toplev.c, integrate.h, loop.h, machmode.h, rtl.h,
+ ssa.h, tree.def: Replace overly specific references to "GNU C"
+ and "GNU C Compiler" with references to "GCC".
+
+2003-06-16 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (prepare_move_operand): Check if operand 0 is an invalid
+ memory reference. Fix test that checks if operand 1 is using r0.
+ * sh.md (movhi_i): Don't allow st.w r0,@(rX,rY) .
+
+ * defaults.h (REG_CLASS_FROM_CONSTRAINT): Only define if not already
+ defined.
+
+2003-06-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * function.h (struct emit_status): Remove x_last_linenum,
+ x_last_filename. Add x_last_location.
+ * rtl.h: #include "input.h".
+ (NOTE_DATA): New.
+ * cfglayout.c (duplicate_insn_chain): Use emit_line_note for line
+ number notes.
+ * emit-rtl.c (last_linenum, last_filename): Remove.
+ (last_location): New.
+ (emit_line_note_after): LINE must always be >= 0.
+ (emit_line_note): Likewise. Check not duplicate here...
+ (emit_note): ... rather than here.
+ (emit_line_note_force, force_next_line_note, init_emit): Adjust.
+ * integrate.c (expand_inline_function): Use emit_line_note for
+ line number notes.
+ (copy_insn_list): Likewise.
+ * unroll.c (copy_loop_body): Likewise.
+ * Makefile.in (RTL_H): Add input.h.
+
+2003-06-16 Richard Sandiford <rsandifo@redhat.com>
+
+ * optabs.c (emit_libcall_block): Don't hoist insns past a label.
+
+2003-06-16 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha-protos.h, config/alpha/elf.h,
+ config/alpha/osf.h, config/alpha/unicosmk.h, config/alpha/vms.h,
+ config/alpha/vms-cc.c, config/alpha/vms-ld.c: Update to ISO C.
+ * config/alpha/alpha.c: Likewise. Move targetm init to end of file.
+ Remove unneeded static function decls.
+
+2003-06-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (c_common_handle_option): s/on/value/.
+ (OPT_fabi_version_, OPT_ftabstop_, OPT_ftemplate_depth_): Use value
+ directly rather than converting the argument.
+ * c.opt: Update docs. Use UInteger where appropriate.
+ * common.opt: Use UInteger where appropriate.
+ * opts.c (integral_argument): New.
+ (handle_argument): Handle integral arguments, and optional
+ joined arguments.
+ (common_handle_option): Update.
+ * opts.h (CL_MISSING_OK, CL_UINTEGER): New.
+ * opts.sh: Handle JoinedOrMissing and UInteger flags.
+
+2003-06-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Remove
+ unnecessary extern declaration.
+
+2003-06-15 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/gofast.h, config/interix.h, config/interix3.h,
+ config/libgloss.h, config/linux-aout.h, config/linux.h,
+ config/lynx-ng.h, config/lynx.h: GNU CC -> GCC.
+ * config/kaos.h: "GNU compiler" -> GCC.
+ * config/linux-aout.h, config/lynx.h: Clarify comment describing file.
+
+ * config/ip2k/crt0.S, config/ip2k/ip2k-protos.h,
+ config/ip2k/ip2k.c, config/ip2k/ip2k.md, config/ip2k/libgcc.S:
+ GNU CC -> GCC.
+
+ * config/svr3.h: Remove #if 0 code, misleading comments.
+ GNU CC -> GCC.
+
+2003-06-15 Zack Weinberg <zack@codesourcery.com>
+
+ * vmsdbgout.c (vmsdbgout_finish): Rename parameter to
+ main_input_filename to avoid conflict with input_filename macro.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/mips/mips.h (asm_file_name, g_switch_set,
+ g_switch_value): Remove.
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Remove
+ unnecessary extern declarations.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/frv/frv.h: Remove declaration of g_switch_value.
+ * config/m32r/m32r.h: Remove declaration of g_switch_value.
+ * config/m68hc11/m68hc11.c: Remove declaration of asm_file_name.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.sh: Quote '+' in regex.
+
+2003-06-15 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/t-rs6000: Add dependence of cfglayout.h to rs6000.o.
+ * config/rs6000/rs6000.c: Include cfglayout.h.
+ * config/alpha/alpha.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/sh/sh.c: Likewise.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.sh: Quote '+' in regex.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (lang_flags): Update for new spelling of flags.
+ (write_langs): Similarly.
+ * c.opt: Specify languages.
+ * opts.h: Remove languages.
+ * opts.sh: Recognise front-end defined languages.
+ * doc/sourcebuild.texi: Update.
+
+2003-06-15 Andreas Jaeger <aj@suse.de>
+
+ * alloc-pool.c: Convert to ISO C90 prototypes.
+ * alloc-pool.h: Likewise.
+ * alias.c: Likewise.
+ * attribs.c: Likewise.
+ * bb-reorder.c: Likewise.
+ * bitmap.h: Likewise.
+ * bitmap.c: Likewise.
+ * builtins.c: Likewise.
+
+ * tree.h: Convert prototypes of attribs.c to ISO C90.
+ * basic-block.h: Convert prototypes of bb-reorder.c to ISO C90.
+ * rtl.h: Convert prototypes of alias.c and builtins.c to ISO C90.
+ * expr.h: Convert prototypes of builtins.c to ISO C90.
+
+2003-06-15 Roger Sayle <roger@eyesopen.com>
+
+ * config/i386/i386.md (expsf2, expdf2, expxf2): New patterns to
+ implement exp, expf and expl built-ins as inline x87 intrinsics.
+ (UNSPEC_FSCALE, UNSPEC_FRNDINT, UNSPEC_F2XM1): New unspecs to
+ represent x87's fscale, frndint and f2xm1 insns respectively.
+ (*fscale_sfxf3, *fscale_dfxf3, *fscale_xf3): New insn patterns
+ to encode x87's "fscale" instruction followed by a pop.
+ (*frndintxf2): New insn pattern for "frndint".
+ (*f2xm1xf2): New insn pattern for "f2xm1".
+
+ * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FRNDINT and
+ UNSPEC_F2XM1 like UNSPEC_{SIN,COS} and handle UNSPEC_FSCALE like
+ UNSPEC_FPATAN.
+
+2003-06-15 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * gencheck.c (main): Avoid generating duplicate macros.
+
+ * Makefile.in (stagefeedback-start): Use $(SUBDIRS) instead of
+ knowing names of language subdirectories.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-pch.c (asm_file_name): Remove.
+ * common.opt: Add more switches.
+ * flags.h (g_switch_set): Boolify.
+ * opts.c (g_switch_value, g_switch_set, exit_after_options,
+ version_flag): Move from toplev.c.
+ (common_handle_option): Handle more switches from toplev.c.
+ * toplev.c (display_help, display_target_options, decode_d_option,
+ print_version): Make non-static, remove prototypes.
+ (aux_base_name, asm_file_name, aux_info_file_name): Constify.
+ (version_flag, g_switch_value, g_switch_set, exit_after_options):
+ Remove.
+ (independent_decode_option): Move some handlers to opts.c.
+ * toplev.h (aux_info_file_name, aux_base_name, asm_file_name,
+ exit_after_options, version_flag, display_help, display_target_options,
+ print_version, decode_d_option): New.
+
+2003-06-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/alpha/alpha.md: Follow spelling conventions.
+ * config/arm/arm.c: Likewise.
+ * config/arm/arm.h: Likewise.
+ * config/arm/arm.md: Likewise.
+ * config/arm/crtn.asm: Likewise.
+ * config/m32r/m32r.c: Likewise.
+ * config/m32r/m32r.md: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+
+2003-06-15 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Call
+ insn_locators_initialize.
+ * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
+ * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
+ * config/sh/sh.c (sh_output_mi_thunk): Do it later.
+
+2003-06-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * builtins.c (expand_builtin_expect_jump): Remove redundant
+ tests that are also in any_condjump_p().
+
+2003-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libgcc2.c: Delete sysV68 L_trampoline section.
+ * config/m68k/mot3300-crt0.S: Delete file.
+ * config/m68k/mot3300Mcrt0.S: Likewise.
+
+2003-06-15 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/aoutos.h: Remove.
+ * config.gcc: Remove reference to aoutos.h.
+ * config/m68k/m68k-aout.h: Remove reference to aoutos.h.
+
+2003-06-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/install.texi: Follow spelling conventions.
+ * doc/tm.texi: Likewise.
+ * config/fp-bit.c: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ * config/ns32k/NOTES: Likewise.
+ * config/ns32k/STATUS: Likewise.
+
+2003-06-14 Roger Sayle <roger@eyesopen.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * rtl.h (STORE_FLAG_VALUE): Remove default definition from here.
+ * defaults.h (STORE_FLAG_VALUE): Move default definition to here.
+ * doc/tm.texi (STORE_FLAG_VALUE): Document the default value.
+
+ * config/alpha/alpha.h (STORE_FLAG_VALUE): Remove definition.
+ * config/arc/arc.h (STORE_FLAG_VALUE): Likewise.
+ * config/arm/arm.h (STORE_FLAG_VALUE): Likewise.
+ * config/cris/cris.h (STORE_FLAG_VALUE): Likewise.
+ * config/i370/i370.h (STORE_FLAG_VALUE): Likewise.
+ * config/i386/i386.h (STORE_FLAG_VALUE): Likewise.
+ * config/i960/i960.h (STORE_FLAG_VALUE): Likewise.
+ * config/ia64/ia64.h (STORE_FLAG_VALUE): Likewise.
+ * config/ip2k/ip2k.h (STORE_FLAG_VALUE): Likewise.
+ * config/m32r/m32r.h (STORE_FLAG_VALUE): Likewise.
+ * config/mcore/mcore.h (STORE_FLAG_VALUE): Likewise.
+ * config/mips/mips.h (STORE_FLAG_VALUE): Likewise.
+ * config/mmix/mmix.h (STORE_FLAG_VALUE): Likewise.
+ * config/ns32k/ns32k.h (STORE_FLAG_VALUE): Likewise.
+ * config/pa/pa.h (STORE_FLAG_VALUE): Likewise.
+ * config/pdp11/pdp11.h (STORE_FLAG_VALUE): Likewise.
+ * config/sh/sh.h (STORE_FLAG_VALUE): Likewise.
+ * config/sparc/sparc.h (STORE_FLAG_VALUE): Likewise.
+ * config/v850/v850.h (STORE_FLAG_VALUE): Likewise.
+ * config/xtensa/xtensa.h (STORE_FLAG_VALUE): Likewise.
+
+2003-06-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * opts.sh (POSIXLY_CORRECT): Unset it.
+
+ * tree.h (init_function_start): Remove filename and line paramters.
+ * function.c (init_function_start): Remove filename and line
+ parameters. Use DECL_SOURCE_LOCATION.
+ * c-decl.c (store_parm_decls): Adjust init_function_start call.
+ (c_expand_body_1): Likewise.
+ * coverage.c (create_coverage): Likewise.
+ * objc/objc-act.c (build_tmp_function_decl): Set line number to
+ zero.
+ (hack_method_prototype): Adjust init_function_start call.
+
+2003-06-14 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/3724
+ * arm/linux-elf.h (PROFILE_HOOK): Define.
+
+2003-06-14 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/11183
+ * arm.h (CANNOT_CHANGE_MODE_CLASS): Define.
+
+2003-06-14 Roger Sayle <roger@eyesopen.com>
+
+ * opts.sh: Work around a mysterious feature in cygwin's gawk
+ where specifying the input files explicitly has a different
+ behavior to piping them via stdin.
+
+2003-06-14 Neil Booth <neil@daikokuya.co.uk>
+
+ * doc/sourcebuild.texi: Update.
+
+2003-06-14 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/11183
+ * arm.c (output_move_double): Pass SImode to adjust_address.
+
+2003-06-14 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update to use common.opt and lang_opt_files.
+ (c-options.c, c-options.h): Remove.
+ (options.c, options.h): Add.
+ * c-opts.c: Include options.h not c-options.h.
+ * common.opt: New file.
+ * configure, configure.in: Add lang_opt_files.
+ * opts.c: Include flags.h and diagnostic.h.
+ (common_handle_option): New.
+ (handle_option): Update to recognize common options and all
+ language-dependent options.
+ * opts.h (CL_F77, CL_JAVA, CL_ADA, CL_COMMON, CL_TREELANG): New.
+ (struct cl_option): Make flags of type int.
+ * opts.h: Flag option with front ends to which it applies.
+ Handle duplicate options.
+ * toplev.c (filename): Remove.
+ (independent_decode_option): Don't handle filenames and -quiet.
+ (process_options, do_compile): Update.
+
+2003-06-14 Nick Clifton <nickc@redhat.com>
+
+ * doc/install.texi (Specific): Add description of different
+ ARM supported file format targets.
+
+Sat Jun 14 11:12:04 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * reorg.c (emit_delay_sequence, dbr_schedule): Clear insn locators
+ inside delay slots.
+
+2003-06-13 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * unwind-c.c: Define NO_SIZE_OF_ENCODED_VALUE.
+ * unwind-pe.h (size_of_encoded_value): Do not define if
+ NO_SIZE_OF_ENCODED_VALUE is defined.
+
+2003-06-13 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (expand_expr <COMPLEX_CST>): Handle the case of
+ expanding a complex constant into a CONCAT target.
+
+2003-06-13 Zack Weinberg <zack@codesourcery.com>
+
+ * config/svr3.h (ASM_FILE_START): Don't use ASM_FILE_START_1.
+ (ASM_FILE_START_1): Delete.
+ * config/i386/att.h, config/i386/sco5.h,
+ config/i386/sysv3.h
+ (ASM_FILE_START_1): Delete.
+
+2003-06-13 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * config/i386/bsd.h: Remove ASM_FILE_START.
+ * config/i386/djgpp.h: Likewise.
+ * config/i386/gas.h (ASM_FILE_START): Output .file before .intel_syntax.
+
+ * config/i386/djgpp.h: Move included unix.h, bsd.h, gas.h to ...
+ * config.gcc (i[34567]86-pc-msdosdjgpp): ... here.
+
+2003-06-13 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR bootstrap/10835
+ * haifa-sched.c (max_lookahead_tries,
+ cached_first_cycle_multipass_dfa_lookahead,
+ cached_issue_rate): New variables.
+ (max_issue): Check the number of tries.
+ (choose_ready): Calculate max_lookahead_tries.
+ (sched_init): Check cached_issue_rate.
+
+2003-06-13 Richard Henderson <rth@redhat.com>
+
+ * cfgbuild.c (make_edges): Set ABNORMAL with SIBCALL.
+ * cfgrtl.c (purge_dead_edges): Expect it too.
+
+2003-06-13 Jim Wilson <wilson@tuliptree.org>
+ Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR bootstrap/10983
+ * combine.c (make_extraction): Use gen_lowpart_for_combine
+ when extracting from a REG and not in the destination of a SET.
+
+2003-06-13 Doug Evans <dje@sebabeach.org>
+
+ * tsystem.h (abort): Declare in inhibit_libc case to remove build
+ warnings for addvsi3, et.al.
+
+2003-06-13 Aldy Hernandez <aldyh@redhat.com>
+
+ * c-common.c (handle_mode_attribute): Use VECTOR_MODE_P macro.
+
+ * simplify-rtx.c (simplify_subreg): Same.
+
+ * emit-rtl.c (gen_lowpart_common): Same.
+
+2003-06-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * builtins.c: Fix comment typos.
+ * fold-const.c: Likewise.
+
+2003-06-13 Doug Evans <dje@sebabeach.org>
+ Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * config/m32r/m32r-protos.h (m32r_pass_by_reference): Declare.
+ * config/m32r/m32r.c (m32r_pass_by_reference): New fn.
+ (m32r_va_arg): Use it.
+ * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Ditto.
+ (RETURN_IN_MEMORY): Ditto.
+
+2003-06-13 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * c-typeck.c: Remove #if 0 clauses.
+
+ PR other/1494
+ * config/alpha/openbsd.h, config/i386/openbsd.h,
+ config/m68k/openbsd.h, config/sparc/openbsd.h: Remove
+ residual reference to EGCS.
+
+2003-06-13 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (output_call_mem): If the address references the link-register
+ use an instruction sequence that avoids early-clobbering IP.
+ (eliminate_lr2ip): Delete.
+
+2003-06-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-format.c (format_types_orig): Disallow '*' width/precision in
+ asm_fprintf format checks.
+
+2003-06-13 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_va_arg): Fix alignment when retrieving
+ non-integral types from integer register save area slots.
+
+2003-06-13 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/i386/svr3dbx.h: GNU CC -> GCC; Intel 385 -> Intel 386.
+
+2003-06-13 Florian Weimer <fw@deneb.enyo.de>
+
+ * doc/invoke.texi (SPARC Options): Document ``-mimpure-text''.
+
+2003-06-13 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/linux.h (TARGET_ASM_FILE_END): Set TARGET_ASM_FILE_END
+ to file_end_indicate_exec_stack.
+
+2003-06-12 Richard Henderson <rth@redhat.com>
+
+ PR target/11089
+ * config/i386/i386.md (sse_movaps): Use an expander to force
+ one operand to be a register.
+ (sse_movups): Likewise.
+
+2003-06-13 Doug Evans <dje@sebabeach.org>
+
+ Remove some build warnings.
+ * config/m32r/initfini.c (__CTOR_LIST__,__DTOR_LIST__): Attribute used.
+ (__do_global_ctors,__do_global_dtors): Ditto.
+
+2003-06-12 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/10557
+ * rtlanal.c (subreg_offset_representable_p): Relax subreg check.
+
+2003-06-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/m32r/m32r.md: Fix a comment typo.
+
+2003-06-13 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+ PR target/10142
+ * config/sparc/sparc.c (function_arg_record_value_parms): Add
+ new 'stack' field.
+ (function_arg_record_value_1): Set 'stack' to 1 if we run out of
+ integer slots for an integer field.
+ (function_arg_record_value_3): Shift vector index.
+ (function_arg_record_value_2): Likewise.
+ (function_arg_record_value): Initialize 'stack' to 0.
+ Set 'stack' to 1 if we run out of integer slots for an integer field.
+ Generate (parallel [(expr_list (nil) ...) ...]) if 'stack' is set to 1.
+
+2003-06-13 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/10955
+ * unroll.c (unroll_loop): Fix off-by-one bug.
+
+2003-06-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (function_arg): Remove typo.
+
+2003-06-12 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (legitimate_constant_p): Handle UNSPEC_NTPOFF
+ and UNSPEC_DTPOFF.
+
+2003-06-12 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/10475
+ * expmed.c (emit_store_flag): Use simplify_gen_subreg directly
+ for extracting sub-words.
+
+2003-06-12 Richard Henderson <rth@redhat.com>
+
+ PR target/7594
+ * config/m68k/m68k.md (zero_extendhisi2): Use gen_lowpart_SUBREG.
+ (zero_extendqihi2, zero_extendqisi2): Likewise.
+
+2003-06-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (function_arg): Always split vectors for
+ e500 if it's a stdarg function.
+ (function_arg_advance): Advance 2 registers for vectors in a
+ stdarg function.
+ (init_cumulative_args): Initialize stdarg.
+ (rs6000_spe_function_arg): New.
+
+ * config/rs6000/rs6000.h (rs6000_args): Add stdarg.
+
+2003-06-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.h (MODES_TIEABLE_P): Add SPE vectors.
+
+2003-06-12 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/168
+ * fold-const.c (tree_expr_nonnegative_p): Handle addition
+ and multiplication of zero extensions, floating point division,
+ and integer<->fp, fp<->fp and zero extension conversions.
+ The built-in ceil and floor functions preserve signedness.
+
+2003-06-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ChangeLog: Follow spelling conventions.
+ * ChangeLog.2: Likewise.
+ * c-decl.c: Likewise.
+ * cfgloop.h: Likewise.
+ * cgraph.c: Likewise.
+ * coverage.c: Likewise.
+ * cppcharset.c: Likewise.
+ * cpphash.h: Likewise.
+ * cpplex.c: Likewise.
+ * cpplib.c: Likewise.
+ * dbxout.c: Likewise.
+ * df.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * dwarfout.c: Likewise.
+ * emit-rtl.c: Likewise.
+ * explow.c: Likewise.
+ * gcov-io.c: Likewise.
+ * gcov-io.h: Likewise.
+ * gcov.c: Likewise.
+ * gengtype.c: Likewise.
+ * ggc.h: Likewise.
+ * opts.c: Likewise.
+ * real.c: Likewise.
+ * reload.c: Likewise.
+ * stmt.c: Likewise.
+
+2003-06-12 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/install.texi (m32r-*-elf): Change company to Renesas.
+
+Thu Jun 12 20:00:55 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * basic-block.h (flow_delete_block_noexpunge): Kill.
+ * cfgrtl.c (flow_delete_block_noexpunge): Merge to
+ rtl_delete_block.
+
+2003-06-10 Richard Henderson <rth@redhat.com>
+
+ PR inline-asm/4823
+ * reg-stack.c (any_malformed_asm): New.
+ (check_asm_stack_operands): Set it.
+ (convert_regs_1): Check it before aborting.
+
+2003-06-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.md: Change all clobbers of the accumulator to sets.
+
+2003-06-12 Jakub Jelinek <jakub@redhat.com>
+
+ * c-opts.c (complain_wrong_lang): Add on argument.
+ Print no- switch if on is false.
+ (c_common_decode_option): Adjust caller.
+
+2003-06-12 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_emit_prologue): Use LA instead of AR
+ to initialize GOT register.
+
+2003-06-12 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (tree_expr_nonnegative_p): Add support for
+ floating point constants, addition and multiplication.
+
+2003-06-12 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.md (adddi3_compact, subdi3_compact): Add earlyclobber
+ constraint modifier for operand 0.
+
+2003-06-12 Hans-Peter Nilsson <hp@axis.com>
+
+ Don't warn on dollars in builtin macro definitions,
+ e.g. __REGISTER_PREFIX__.
+ * cpphash.h (struct cpp_reader): Move member warn_dollars...
+ * cpplib.h (struct cpp_options): ...to here. Change type to
+ unsigned char.
+ * cppinit.c (cpp_create_reader): Set it to 1 here.
+ (post_options): Don't set it here.
+ * c-opts.c (c_common_init_options): Reset it to 0 here.
+ (finish_options): Set it here.
+ * cpplex.c (forms_identifier_p): Tweak for new location of
+ warn_dollars.
+
+ * configure.in (assembler dwarf2 debug_line support): Define insn
+ for cris-*-* and mmix-*-*.
+ * configure: Regenerate.
+
+2003-06-11 Uwe Stieber <uwe@kaos-group.de>
+
+ * config.gcc (arm*-*-kaos*, i[34567]86-*-kaos*, powerpc-*-kaos*,
+ powerpcle-*-kaos*, strongarm-*-kaos*): New targets.
+ (sh-*-elf*): Add sh*-*-kaos* support.
+ * config/kaos.h, config/arm/kaos-strongarm.h, config/arm/kaos-arm.h,
+ config/i386/kaos-i386.h, config/rs6000/kaos-ppc.h,
+ config/sh/kaos-sh.h: New files.
+
+2003-06-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcse.c (fis_get_condition): Make it a global function.
+ * reload1.c (reload_cse_move2add): Detect implicit sets.
+ * rtl.h: Add a prototype for fis_get_condition.
+
+2003-06-11 Richard Henderson <rth@redhat.com>
+
+ * stmt.c (expand_asm_operands): Don't warn for memories with
+ queued addresses.
+
+2003-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.h (SUBTARGET_ASM_RELAX_SPEC): Rewrite without
+ brackets.
+
+2003-06-11 Neil Booth <neil@daikokuya.co.uk>
+
+ * hooks.c (hook_int_size_t_constcharptr_int_0): New.
+ * hooks.h (hook_int_size_t_constcharptr_int_0): New.
+ * langhooks-def.h (lhd_decode_option, LANG_HOOKS_DECODE_OPTION): Die.
+ (LANG_HOOKS_HANDLE_OPTION, LANG_HOOKS_INITIALIZER): Update.
+ * langhooks.c (lhd_decode_option): Remove.
+ * langhooks.h (struct lang_hooks): Remove decode_option.
+ * opts.c (handle_option): No longer use decode_option.
+
+2003-06-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloopanal.c (variable_initial_value): Update the set of altered
+ registers correctly.
+
+2003-06-11 Roger Sayle <roger@eyesopen.com>
+ Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/d30v/d30v.h: Delete reference to ASM_FINAL_SPEC.
+ * config/i386/netbsd-elf.h: Likewise.
+ * config/m32r/m32r.h: Likewise.
+ * config/mn10300/mn10300.h: Likewise.
+ * config/stormy16/stormy16.h: Likewise.
+ * config/v850/v850.h: Likewise.
+ * config/vax/netbsd-elf.h: Likewise.
+ * config/xtensa/elf.h: Likewise.
+ * config/xtensa/linux.h: Likewise.
+
+2003-06-11 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/iris5gas.h (MDEBUG_ASM_SPEC): Override to match
+ DWARF 2 default.
+
+ * config/mips/dbxmdebug.h: New file.
+ * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Use it with
+ gas and --with-stabs.
+
+2003-06-11 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * expr.c (can_move_by_pieces): align argument may be unused.
+
+2003-06-11 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * expr.c (convert_move): Handle moves between two CONCATs.
+
+2003-06-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (RETURN_IN_MEMORY): Accept DImode if
+ !TARGET_H8300.
+
+2003-06-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (final_prescan_insn): Don't dump rtl.
+ * config/h8300/h8300.h (MASK_RTL_DUMP): Remove.
+ (TARGET_RTL_DUMP): Likewise.
+ (TARGET_SWITHCES): Remove -mrtl-dump.
+
+2003-06-10 Richard Henderson <rth@redhat.com>
+
+ * optabs.c (gen_cond_trap): Fix prepare_operand typo.
+
+2003-06-10 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.md (call_gp): Fix memory mode.
+
+2003-06-10 James E Wilson <wilson@tuliptree.org>
+
+ PR target/8812
+ * reload1.c (choose_reload_regs): For equiv reg, add loop over all
+ hard regs for reload_reg_used_at_all and reg_class_contents checks.
+
+2003-06-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (print_operand): Remove support for
+ operand character 'b'.
+ Add the AND case to operand character 'c'.
+ * config/h8300/h8300.md (two anonymous patterns): Replace
+ operand character 'b' with 'c'.
+
+2003-06-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (print_operand): Remove support for
+ operand character 'u'.
+
+2003-06-10 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Fix typo.
+ * configure: Regenerate.
+
+2003-06-10 Loren James Rittle <ljrittle@acm.org>
+
+ * config/alpha/alpha.c (unicosmk_file_end): Add conditional
+ compilation guard.
+
+2003-06-10 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh-protos.h (function_symbol): Declare.
+ * sh.c (expand_block_move, expand_ashiftrt): Use it.
+ (sh_expand_prologue, sh_expand_epilogue): Likewise.
+ (sh_initialize_trampoline): Likewise.
+ (function_symbol): New function.
+ * sh.md (udivsi3, divsi3, mulsi3, ic_invalidate_line): Use it.
+ (initialize_trampoline, call, call_pop, call_value, sibcall): Likewise.
+ (call_value_pop, shcompact_return_tramp): Likewise.
+
+ * sh.h (OVERRIDE_OPTIONS): Don't suppress --profile-arc-flag.
+
+ * sh.md (GOTaddr2picreg): Use gen_lowpart to get lowpart of
+ target register.
+
+2003-06-10 DJ Delorie <dj@redhat.com>
+
+ * doc/md.texi (Machine Constraints): Document stormy's Z
+ constraint.
+
+2003-06-10 Geoffrey Keating <geoffk@apple.com>
+
+ * except.c (call_site_base): Mark with GTY.
+
+2003-06-10 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-proto.h: Convert to ISO C90 prototypes.
+ * arm.c: Likewise.
+
+2003-06-10 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (sh_output_mi_thunk): Call insn_locators_initialize.
+
+2003-06-10 Steve Ellcey <sje@cup.hp.com>
+
+ * calls.c (expand_call): Convert structure_value_addr to Pmode if
+ necessary.
+
+2003-06-10 Andrew Haley <aph@redhat.com>
+
+ * langhooks-def.h (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
+ (LANG_HOOKS_DECLS): Add LANG_HOOKS_DECL_OK_FOR_SIBCALL.
+ (lhd_decl_ok_for_sibcall): New.
+ * langhooks.c (lhd_decl_ok_for_sibcall): New.
+ * langhooks.h (lang_hooks_for_decls.ok_for_sibcall): New field.
+ * calls.c (expand_call): Check lang_hook before generating a
+ sibcall.
+
+2003-06-10 DJ Delorie <dj@redhat.com>
+
+ * config/stormy16/stormy16.c (xstormy16_extra_constraint_p): Add Z,
+ which matches (const_int 0) for addhi3.
+ * config/stormy16/stormy16.md: Document known constraints.
+ (addhi3): Handle adding zero.
+
+2003-06-10 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * config/m32r/m32r.h (HARD_REGNO_RENAME_OK): New.
+ * config/m32r/m32r.c (m32r_hard_regno_rename_ok): New.
+ * config/m32r/m32r-protos.h: Prototype it.
+
+2003-06-10 Janis Johnson <janis187@us.ibm.com>
+
+ * config/rs6000/eabi.h (TARGET_OS_CPP_BUILTINS): Define builtins
+ common to rs6000 sysv targets.
+ * config/rs6000/eabisim.h (TARGET_OS_CPP_BUILTINS): Ditto.
+ * config/rs6000/rtems.h (TARGET_OS_CPP_BUILTINS): Ditto.
+
+2003-06-10 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc: Add arm-wince-pe target.
+ * config/arm/pe.h (MULTILIB_DEFAULTS): Define.
+ Add comment about default apcs26 support.
+ * config/arm/t-pe (MULTILIB_OPTIONS): Add an -mapcs-32
+ multilib.
+ (MULTILIB_DIRNAMES): Add 'apcs32'.
+ * config/arm/t-wince-pe: New makefile fragment.
+ * config/arm/wince-pe.h: New file. Overrides a few definitions
+ in arm/pe.h
+
+2003-06-10 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (fold_builtin): Optimize cos(-x) as cos(x).
+ * fold-const.c (fold <NEGATE_EXPR>): Convert -f(x) into f(-x)
+ when x is easily negated and f is sin, tan or atan.
+ (fold <MULT_EXPR>): Optimize tan(x)*cos(x) and cos(x)*tan(x) as
+ sin(x) with flag_unsafe_math_optimizations.
+ (fold <RDIV_EXPR>): With flag_unsafe_math_optimizations fold
+ sin(x)/cos(x) as tan(x) and cos(x)/sin(x) as 1.0/tan(x).
+
+2003-06-10 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold <EQ_EXPR>): Don't fold x == x only if x
+ is a floating point type *and* we currently honor NaNs.
+ (fold <NE_EXPR>): Likewise.
+
+2003-06-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11131
+ * tree-inline.c (inlinable_function_p): Call the language-specific
+ hook early.
+
+2003-06-09 David Taylor <dtaylor@emc.com>
+
+ * config/rs6000/rs6000.c (rs6000_va_start, rs6000_va_arg): Skip over
+ the f_res field.
+
+2003-06-09 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Remove references to host_truncate_target.
+ * configure: Regenerate.
+ * config.gcc: Remove references to truncate_target,
+ host_truncate_target.
+
+ * Makefile.in, configure.in, config/m68hc11/t-m68hc11-gas:
+ Replace "build_canonical" with build, "host_canonical" with host.
+ * configure.in: Use GCC_TOPLEV_SUBDIRS.
+ * aclocal.m4: Include ../config/acx.m4.
+ * configure: Regenerate.
+
+2003-06-09 David Taylor <dtaylor@emc.com>
+
+ * config/rs6000/rs6000.c (rs6000_build_va_list): Give the two
+ bytes of padding in the __va_list_tag structure a name (reserved).
+
+2003-06-09 Jason Merrill <jason@redhat.com>
+
+ * fold-const.c (operand_equal_p): Handle ADDR_EXPR and TRUTH_NOT_EXPR.
+
+2003-06-09 Osku Salerma <osku@iki.fi>
+
+ * c-format.c (check_format_string, get_constant): New.
+ (handle_format_attribute, handle_format_arg_attribute,
+ decode_format_attr): Change to use above functions.
+
+2003-06-09 Richard Henderson <rth@redhat.com>
+
+ * stmt.c (expand_asm_operands): Re-word warning.
+
+2003-06-08 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/8787
+ * config/i386/djgpp.h (ASM_FILE_START): emit `.intel_syntax'
+ if -masm=intel.
+
+2003-06-09 James E Wilson <wilson@tuliptree.org>
+
+ * config/frv/cmovc.c, config/frv/cmovh.c, config/frv/cmovw.c,
+ config/frv/frvbegin.c, config/frv/frvend.c, config/frv/lib1funcs.asm:
+ Add libgcc exception.
+
+2003-06-09 David Edelsohn <edelsohn@gnu.org>
+ Ayal Zaks <gcchaifa@us.ibm.com>
+
+ * config/rs6000/rs6000.md (define_attr "type"): Add insert_word.
+ (insvsi*): Add insert_word attribute.
+ * config/rs6000/rs6000.c (rs6000_variable_issue): Add TYPE_INSERT_WORD.
+ * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md,
+ power4.md,rios1.md,rios2.md,rs64.md}: Add insert_word.
+
+2003-06-09 Kazu Hirata <kazu@cs.umass.edu>
+
+ * fold-const.c (fold): Fix a comment typo.
+
+2003-06-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ * tree-inline.c (expand_call_inline): DECL_SOURCE_LINE_FIRST is
+ removed.
+
+2003-06-09 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (gen_block_redirect): Use locators.
+
+2003-06-09 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (THUMB_PRINT_OPERAND_ADDRESS): Use %wd in format and remove
+ cast to int.
+
+2003-06-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * configure.in: Assume gas 2.14 and above can handle MIPS relocation
+ operators.
+ * configure: Regenerated.
+
+2003-06-09 Richard Sandiford <rsandifo@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro.
+ (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload.
+ (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for
+ n32/64 PIC.
+ (MUST_SAVE_REGISTERS): Delete.
+ * config/mips/mips.c (mips_frame_info): Remove extra_size field.
+ (machine_function): Add global_pointer field.
+ (mips_classify_constant): Check for (const $gp) using pointer equality
+ with pic_offset_table_rtx.
+ (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO.
+ (mips_restore_gp): Use current_function_outgoing_args_size.
+ (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of
+ GP_REG_FIRST + 28. Handle relocation strings that have
+ more than one '('.
+ (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO.
+ (mips_global_pointer): New function.
+ (mips_save_reg_p): New function, mostly split out from...
+ (compute_frame_size): ...here. Remove handling of extra_size.
+ Reclaim args_size if no variables depend on it. Don't treat gp
+ as a special case: handle it in the main GPR loop.
+ (mips_initial_elimination_offset): Fix comment.
+ (save_restore_insns): Save every register in the GPR mask,
+ removing distinction between mask and real_mask.
+ (mips_output_function_prologue): Update .frame psuedo-op after
+ the removal of extra_size. Move the SVR4 PIC stack allocation
+ and cprestore instructions to mips_expand_prologue.
+ (mips_gp_insn): New function.
+ (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to
+ the chosen global pointer. Handle SVR4 PIC stack allocation
+ in the same way as other ABIs. Adjust varargs code accordingly.
+ Emit a cprestore insn after allocating the stack. Use mips_gp_insn
+ to emit the loadgp sequence. Follow it with a loadgp_blockage
+ if not using explicit relocs.
+ (mips_output_function_epilogue): Reinstate the default gp register.
+ (mips16_gp_pseudo_reg): Use pic_offset_table_rtx.
+ (mips16_optimize_gp): Likewise.
+ * config/mips/mips.md (UNSPEC_LOADGP): Remove.
+ (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove.
+ (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New.
+ (loadgp): Remove.
+ (loadgp_blockage, cprestore): New instructions.
+ (builtin_setjmp_setup): Implement using emit_move_insn. Use
+ pic_offset_table_rtx.
+ (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove.
+ (builtin_longjmp): Use gen_raw_REG to force use of $28.
+
+2003-06-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_output_division): Declare.
+ * config/mips/mips.h (MASK_CHECK_RANGE_DIV): Remove.
+ (MASK_BRANCHLIKELY): Use MASK_CHECK_RANGE_DIV's old number.
+ (TARGET_NO_CHECK_ZERO_DIV, TARGET_CHECK_RANGE_DIV): Remove.
+ (TARGET_CHECK_ZERO_DIV): New macro.
+ (TARGET_SWITCHES): Remove -mcheck-range-div & -mno-check-range-div.
+ * config/mips/mips.c (mips_output_division): New function.
+ * config/mips/mips.md (length): Take TARGET_CHECK_ZERO_DIV into
+ account when calculating the default length of a division.
+ (divmodsi4, divmoddi4, udivmodsi4, udivmoddi4): Turn into define_insns.
+ Enable regardless of optimization level. Use mips_output_division.
+ (divmodsi4_internal, divmoddi4_internal, udivmodsi4_internal,
+ udivmoddi4_internal, div_trap, div_trap_normal, div_trap_mips16,
+ divsi3, divsi3_internal, divdi3, divdi3_internal, modsi3,
+ modsi3_internal, moddi3, moddi3_internal, udivsi3, udivsi3_internal,
+ udivdi3, udivdi3_internal, umodsi3, umodsi3_internal, umoddi3,
+ umoddi3_internal): Remove.
+
+2003-06-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_reg_names): Change hilo entry to "".
+ (mips_sw_reg_names): Likewise.
+ (mips_regno_to_class): Change hilo entry to NO_REGS.
+ (hilo_operand): Use MD_REG_P.
+ (extend_operator): New predicate.
+ (override_options): Remove 'a' constraint.
+ (mips_secondary_reload_class): Remove hilo handling. Also remove
+ handling of (plus sp reg) reloads for mips16.
+ (mips_register_move_cost): Remove hilo handling.
+ * config/mips/mips.h (FIXED_REGISTERS): Make hilo entry fixed.
+ (MD_REG_LAST): Remove hilo from range.
+ (HILO_REGNUM): Delete.
+ (reg_class): Remove HILO_REG and HILO_AND_GR_REGS.
+ (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly.
+ (PREDICATE_CODES): Add entry for extend_operator.
+ (DEBUG_REGISTER_NAMES): Change hilo entry to "".
+ * config/mips/mips.md: Remove hilo clobbers wherever they occur.
+ Remove constraints from multiplication define_expands. Remove
+ clobbers from "decorative" define_expand patterns.
+ (UNSPEC_HILO_DELAY): Delete.
+ (*mul_acc_si, *mul_sub_si): Add early-clobber to operand 6.
+ (mulsidi3, umulsidi3): Change pattern to match the TARGET_64BIT case.
+ Adjust C code to just emit insns for !TARGET_64BIT.
+ (mulsidi3_internal): Rename to mulsidi3_32bit.
+ (mulsidi3_64bit): Use a "d" constraint for the destination.
+ Use extend_operator so that the pattern can handle umulsidi3 as well.
+ Split the instruction after reload.
+ (*mulsidi3_64bit_parts): New pattern, generated by mulsidi3_64bit.
+ (umulsidi3_internal): Rename to umulsidi3_32bit.
+ (umulsidi3_64bit): Remove.
+ (*smsac_di, *umsac_di): Line-wrap fixes.
+ (udivsi3_internal): Don't allow operand 2 to be constant.
+ (udivdi3_internal, umodsi3_internal, umoddi3_internal): Likewise.
+ (movdi_internal2, movsi_internal): Remove hilo alternatives.
+ (reload_in[sd]i, reload_out[sd]i, hilo_delay): Remove.
+
+2003-06-09 Richard Sandiford <rsandifo@redhat.com>
+
+ PR target/10913
+ * config/mips/mips.h (TARGET_FILE_SWITCHING, NO_DBX_FUNCTION_END,
+ PUT_SDB_SCL, PUT_SDB_INT_VAL, PUT_SDB_VAL, PUT_SDB_ENDEF,
+ PUT_SDB_TYPE, PUT_SDB_SIZE, PUT_SDB_DIM, PUT_SDB_START_DIM,
+ PUT_SDB_NEXT_DIM, PUT_SDB_LAST_DIM, PUT_SDB_TAG, PUT_SDB_SRC_FILE,
+ SDB_GENERATE_FAKE, TEXT_SECTION): Delete.
+ (PUT_SDB_DEF, PUT_SDB_PLAIN_DEF, PUT_SDB_BLOCK_START,
+ PUT_SDB_BLOCK_END, PUT_SDB_FUNCTION_END): Replace use of
+ asm_out_text_file with asm_out_file.
+ * config/mips/iris5gas.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Likewise.
+ * config/mips/elf.h (TEXT_SECTION): Undefine.
+ * config/mips/elf64.h (TEXT_SECION): Undefine.
+ * config/mips/openbsd.h (TEXT_SECION): Undefine.
+ * config/mips/mips.c (asm_out_text_file, asm_out_data_file): Delete.
+ (override_options): Disable small-data optimizations unless using
+ gas or explicit relocations.
+ (mips_asm_file_start, mips_asm_file_end, mips_output_function_epilogue,
+ iris6_asm_named_section, iris6_asm_file_start): Remove code for
+ handling TARGET_FILE_SWITCHING.
+ (copy_file_data): Move into TARGET_IRIX6 block.
+
+2003-06-08 Richard Henderson <rth@redhat.com>
+
+ * expr.h (EXPAND_MEMORY): New.
+ * expr.c (expand_expr): Check it.
+ * stmt.c (expand_asm_operands): Provide it when the constraint
+ requires a memory. Warn for memory input constraints without
+ a memory operand.
+
+2003-06-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * varasm.c: Don't include c-tree.h.
+
+2003-06-08 Andreas Jaeger <aj@suse.de>
+
+ * predict.h: Convert to ISO C90 prototypes.
+ * predict.c: Likewise.
+ * tree-dump.h: Likewise.
+ * tree-dump.c: Likewise.
+ * diagnostic.h: Likewise.
+ * diagnostic.c: Likewise.
+ * combine.c: Likewise.
+
+ * rtl.h: Convert prototypes of combine.c to ISO C90.
+
+Sun Jun 8 21:27:41 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cfglayout.c (insn_scope): New static function
+ (block_locators_*, line_locators*, file_locators*): New static varrays.
+ (scope_to_insns_initialize): Use them.
+ (insn_line, insn_file): New functions.
+ (scope_to_insns_finalize): Use insn_scope.
+ (prologue_locator, epilogue_locator): New global variables.
+ * emit-rt.c (try_split, make_insn_raw, make_jump_insn_raw,
+ make_call_insn_raw, emit_copy_of_insn_after): Use locators.
+ (emit_insn_after_scope, emit_insn_before_scope
+ emit_jump_insn_after_scope, emit_jump_insn_before_scope
+ emit_call_insn_after_scope, emit_call_insn_before_scope): Rename to...
+ (emit_insn_after_setloc, emit_insn_before_setloc
+ emit_jump_insn_after_setloc, emit_jump_insn_before_setloc
+ emit_call_insn_after_setloc, emit_call_insn_before_setloc): ... these;
+ use locators.
+ * final.c (notice_source_line): Use locators.
+ (final_start_function): Set initial source file and line.
+ (final_scan_insn): Use locators.
+ * ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants,
+ noce_try_addcc, noce_try_store_flag_mask, noce_try_cmove,
+ noce_try_cmove_arith, noce_try_minmax, noce_try_abs,
+ noce_process_if_block, find_cond_trap): Likewise.
+ * integrate.c (copy_insn_list): Likewise.
+ * jump.c (duplicate_loop_exit_test): LIkewise.
+ * print-rtl.c (print_rtx): Print locators.
+ * recog.c (peephole2_optimize): Likewise.
+ * rtl.h (INSN_SCOPE): Remove.
+ (emit_insn_after_scope, emit_insn_before_scope
+ emit_jump_insn_after_scope, emit_jump_insn_before_scope
+ emit_call_insn_after_scope, emit_call_insn_before_scope): Rename to...
+ (emit_insn_after_setloc, emit_insn_before_setloc
+ emit_jump_insn_after_setloc, emit_jump_insn_before_setloc
+ emit_call_insn_after_setloc, emit_call_insn_before_setloc): ... these;
+ (insn_file, insn_line, prologue_locator, epilogue_locator): Declare.
+ * unroll.c (copy_loop_body): Use locators.
+ * function.c (set_insn_locators): New function.
+ (thread_prologue_and_epilogue_insns): Set the locators accordingly.
+
+2003-06-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (LONG_LONG_TYPE_SIZE): Set to 64.
+ * config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _floatdisf
+ _fixsfdi _fixunssfdi.
+ (LIB2FUNCS_EXTRA): Add entries for clzhi2, ctzhi2, parityhi2,
+ popcounthi2.
+ (TARGET_LIBGCC2_CFLAGS): Remove -DDI=SI.
+ * config/h8300/clzhi2.c: New.
+ * config/h8300/ctzhi2.c: Likewise.
+ * config/h8300/parityhi2.c: Likewise.
+ * config/h8300/popcounthi2.c: Likewise.
+
+Sun Jun 8 15:52:17 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (subsi_3_zext, sse2_nandv2di3): Fix predicates.
+ * i386.c (k8_avoid_jump_misspredicts): Fix debug output.
+
+ * cfg.c (verify_flow_info): Move IL independent checks from cfgrtl here.
+ (dump_bb): New based on old dump_bb in cfgrtl.c
+ (debug_bb, debug_bb_n): Move the functions from cfgrtl.c here.
+ * cfghooks.h (cfgh_verify_flow_info): Return status.
+ * cfglayout.c (cfg_layout_finalize): Verify CFG correctness.
+ * cfgrtl.c (debug_bb, debug_bb_n): Move to cfg.c
+ (dump_bb): Remove generic parts.
+ (rtl_verify_flow_info_1): Break out from rtl_verify_flow_info.
+ (rtl_verify_flow_info): Only check things dependeing on linearized RTL.
+
+2003-06-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Rename options.c and options.h to c-options.c and
+ c-options.h.
+ (OBJS): Remove options.o.
+ * c-opts.c: Don'tInclude c-options.h instead of options.h.
+ * opts.c: Don't include options.h.
+ (find_opt): Can't use enum opt_code or N_OPTS.
+ * opts.h (struct cl_option, cl_options, cl_options_count): Move from...
+ * opts.sh: ... here.
+
+2003-06-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR pch/9830
+ * ggc-common.c (HAVE_MMAP_FILE): Include sys/types.h
+ if HAVE_MINCORE is defined.
+ (MAP_FAILED): Define if not defined.
+ (gt_pch_save): Test against MAP_FAILED.
+ (gt_pch_restore): If HAVE_MINCORE, use MAP_FIXED to force
+ the mapping address to the preferred base after checking it
+ is possible to do so. Test against MAP_FAILED.
+ * configure.in: Test for the presence of mincore in libc.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+
+2003-06-07 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_setup_incoming_varargs): Fix
+ conditional compilation guard.
+
+2003-06-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * optabs.c (expand_abs): Set result_unsignedp to 1 if
+ flag_trav is zero.
+
+2003-06-07 Richard Henderson <rth@redhat.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Define __EXCEPTIONS for C also.
+
+2003-06-07 Richard Henderson <rth@redhat.com>
+
+ * basic-block.h (EDGE_SIBCALL): New.
+ (EDGE_ALL_FLAGS): Update.
+ * cfg.c (dump_edge_info): Add sibcall name.
+ * cfgbuild.c (make_edges): Use EDGE_SIBCALL.
+ * cfgrtl.c (purge_dead_edges): Handle sibcalls.
+
+2003-06-07 Andreas Jaeger <aj@suse.de>
+
+ * mklibgcc.in (lib2funcs): Remove _exit.
+ * libgcc2.c: Remove L_exit.
+ * gbl-ctors.h: Remove declarations dependend on NEED_ATEXIT.
+
+ * system.h: Poison NEED_ATEXIT, ON_EXIT, EXIT_BODY.
+
+ * doc/tm.texi (Misc): Remove NEED_ATEXIT, ON_EXIT, EXIT_BODY.
+
+ * ggc.h: Convert to ISO C90 prototypes.
+ * ggc-none.c: Likewise.
+ * ggc-common.c: Likewise.
+ * ggc-page.c: Likewise.
+ * ggc-simple.c: Likewise.
+
+ * crtstuff.c: Remove undefined usage of INIT_SECTION_PREAMBLE.
+
+ * system.h: Poison INIT_SECTION_PREAMBLE.
+
+2003-06-07 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc (with_cpu handling): Translate sparc64 in
+ $machine to --with-cpu=v9.
+ * config/alpha/alpha.c
+ (TARGET_ASM_GLOBALIZE_LABEL [TARGET_ABI_UNICOSMK]): Correct definition.
+ (alpha_setup_incoming_varargs): #ifdef out when TARGET_ABI_UNICOSMK.
+
+ * target.h: New hook asm_out.file_end.
+ * target.h: Update to match. New hook macro TARGET_ASM_FILE_END.
+ * toplev.c (compile_file): Use targetm.asm_out.file_end.
+ * system.h: Poison ASM_FILE_END.
+ * varasm.c (file_end_indicate_exec_stack): New.
+ * output.h: Prototype it.
+ * doc/tm.texi: Document TARGET_ASM_FILE_END and
+ file_end_indicate_exec_stack. Delete references to attasm.h.
+
+ * config/darwin.h (TARGET_ASM_FILE_END): Reset to darwin_file_end.
+ (ASM_FILE_END): Delete; move code...
+ * config/darwin.c (darwin_file_end): Here; new function.
+ * config/darwin-protos.h: Prototype it.
+ * config/alpha/alpha.c (unicosmk_asm_file_end): Make static,
+ rename unicosmk_file_end.
+ * config/arm/aof.h (ASM_FILE_END): Delete; move code...
+ * config/arm/arm.c (aof_file_end): ... here; new static function.
+ Set TARGET_ASM_FILE_END to aof_file_end if AOF_ASSEMBLER.
+ Make aof_dump_imports and aof_dump_pic_table static.
+ * config/avr/avr.c (asm_file_end): Rename avr_file_end, make static.
+ Set TARGET_ASM_FILE_END to avr_file_end.
+ * config/c4x/c4x.c (c4x_file_end): Make static. Take no arguments.
+ Set TARGET_ASM_FILE_END to c4x_file_end.
+ * config/h8300/h8300.c (asm_file_end): Rename h8300_file_end,
+ make static. Take no arguments. Set TARGET_ASM_FILE_END to
+ h8300_file_end.
+ * config/i370/i370.h (ASM_FILE_END): Delete; move code...
+ * config/i370/i370.c (i370_file_end): ... here; new static function.
+ Set TARGET_ASM_FILE_END to i370_file_end.
+ * config/i386/i386.c (ix86_asm_file_end): Rename ix86_file_end.
+ Take no arguments. Call file_end_indicate_exec_stack if
+ NEED_INDICATE_EXEC_STACK; don't use SUBTARGET_FILE_END.
+ * config/i386/i386.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END.
+ Define NEED_INDICATE_EXEC_STACK to 0.
+ * config/i386/linux.h, config/i386/linux64.h: Redefine
+ NEED_INDICATE_EXEC_STACK to 1 instead of setting SUBTARGET_FILE_END.
+ * config/i386/winnt.c (i386_pe_asm_file_end): Rename to
+ i386_pe_file_end. Take no arguments. Use ix86_file_end.
+ * config/ia64/ia64.c (ia64_hpux_asm_file_end): Rename to
+ ia64_hpux_file_end, make static. Take no arguments.
+ * config/ip2k/ip2k.c (asm_file_start, asm_file_end,
+ commands_in_prologues, commands_in_epilogues): Delete.
+ (function_epilogue): Update to match.
+ * config/mips/mips.c (mips_asm_file_end): Rename mips_file_end,
+ make static. Take no arguments.
+ (iris6_asm_file_end): Rename iris6_file_end, make static, use
+ mips_file_end, take no arguments.
+ Set TARGET_ASM_FILE_END to iris6_file_end or mips_file_end as
+ appropriate.
+ * config/mmix/mmix.c (mmix_asm_file_end): Rename mmix_file_end,
+ make static, take no arguments. Set TARGET_ASM_FILE_END to
+ mmix_file_end.
+ * config/pa/pa.c (output_deferred_plabels): Make static, take
+ no arguments. Set TARGET_ASM_FILE_END to output_deferred_plabels.
+ * config/rs6000/xcoff.h (TARGET_ASM_FILE_END): Set it.
+ (ASM_FILE_END): Delete; move code...
+ * config/rs6000/rs6000.c (rs6000_xcoff_file_end): ... here;
+ new static function.
+
+ * config/avr/avr.h, config/cris/cris.h, config/h8300/h8300.h
+ * config/mmix/mmix.h, config/mips/iris6.h, config/mips/mips.h:
+ Don't set ASM_FILE_END.
+ * config/alpha/linux-elf.h, config/m68k/linux.h, config/rs6000/linux.h
+ * config/rs6000/linux64.h, config/s390/linux.h, config/sparc/linux.h
+ * config/sparc/linux64.h: Set TARGET_ASM_FILE_END to
+ file_end_indicate_exec_stack; don't set ASM_FILE_END.
+ * config/alpha/unicosmk.h, config/i386/cygming.h
+ * config/ia64/hpux.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END.
+ * config/arm/arm-protos.h, config/alpha/alpha-protos.h
+ * config/avr/avr-protos.h, config/c4x/c4x-protos.h
+ * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
+ * config/ip2k/ip2k-protos.h, config/mips/mips-protos.h
+ * config/mmix/mmix-protos.h, config/pa/pa-protos.h: Update.
+
+Sat Jun 7 18:32:13 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.h (OPTION_DEFAULT_SPECS): Avoid -mcpu default when -march is
+ specified.
+
+Sat Jun 7 15:20:01 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (stageprofile_build): Kill redundant target.
+ * i386.c (mdep_reorg): Don't pad jumps for Athlon.
+
+2003-06-07 Andreas Jaeger <aj@suse.de>
+
+ * doc/tm.texi (Costs): Remove DONT_REDUCE_ADDR documentation.
+
+ * config/avr/avr.h: Remove comment regarding DONT_REDUCE_ADDR.
+ * config/dsp16xx/dsp16xx.h: Likewise.
+ * config/i386/i386.h: Likewise.
+ * config/ip2k/ip2k.h: Likewise.
+
+2003-06-07 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (OJBS, c-opts.o): Update.
+ (c-options.c, c-options.h): Rename options.h and options.c.
+ (options.h): Rename options_.h.
+ (opts.o): New.
+ * c-common.h (c_common_handle_option): Replace c_common_decode_option.
+ (c_common_init_options): Update prototype.
+ * c-lang.c (c_init_options): Update prototype.
+ (LANG_HOOKS_HANDLE_OPTION): Override.
+ (LANG_HOOKS_DECODE_OPTION): Drop.
+ * c-opts.c: Include opts.h and options.h instead of c-options.h
+ and c-options.c.
+ (lang_flags): Move to file scope.
+ (find_opt, c_common_decode_option): Remove.
+ (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE,
+ CL_REJECT_NEGATIVE): Move to opts.h.
+ (missing_arg): Update prototype.
+ (c_common_init_options): Update for new prototype.
+ (c_common_handle_options): Filenames are passed as N_OPTS.
+ * hooks.c (hook_int_void_0): New.
+ * hooks.h (hook_int_void_0): New.
+ * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default.
+ (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now.
+ (LANG_HOOKS_INITIALIZER): Update.
+ * langhooks.h (init_options): Update.
+ (handle_option): New.
+ * opts.c, opts.h: New files.
+ * opts.sh: Update c file to include opts.h and options.h.
+ * toplev.c: Include opts.h; change options.h to options_.h.
+ (parse_options_and_default_flags): Get lang_mask, use
+ handle_option for language-specific handling.
+ * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop.
+ (LANG_HOOKS_HANDLE_OPTION): Override.
+ (objc_init_options): Update.
+
+2003-06-07 Magnus Kreth <magnus.kreth@gmx.de>
+ Thibaud Gaillard <thibaud.gaillard@nto.atmel.com>
+
+ PR other/7031
+ * Makefile.in (install-common): Remove GCOV_INSTALL_NAME instead of
+ gcov.
+
+2003-06-07 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Remove quotes in
+ section names.
+ * configure: Regenerate.
+
+2003-06-07 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define.
+
+2003-06-06 James E Wilson <wilson@tuliptree.org>
+
+ PR inline-asm/10890
+ * reload1.c (merge_assigned_reloads): Abort only if two reloads have
+ different in fields.
+
+2003-06-06 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Make $(target_subdir) correspond with top level usage.
+ * Makefile.in: Likewise.
+ * configure: Regenerate.
+
+2003-06-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_COMMON,
+ ASM_OUTPUT_ALIGNED_LOCAL): Cast `SIZE' and `ALIGNED' parameters to
+ unsigned HOST_WIDE_INT.
+ * pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMOM, ASM_OUTPUT_ALIGNED_LOCAL):
+ Likewise.
+ * pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON, ASM_OUTPUT_ALIGNED_LOCAL):
+ Likewise.
+
+2003-06-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * doc/install.texi (Prerequisites): New section documenting
+ tools and packages necessary prior to building and/or
+ modifying GCC.
+ * doc/install.texi2html: Also generate prerequisites.html.
+
+2003-06-06 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/11052
+ * ifcvt.c (noce_process_if_block): Fail if the destination has
+ side-effects.
+
+2003-06-06 Jason Merrill <jason@redhat.com>
+
+ * stmt.c (resolve_asm_operand_names): Rename from
+ resolve_operand_names. No longer static. Avoid needless copying.
+ Don't build array of constraints.
+ (expand_asm_operands): Build it here.
+ * tree.h: Declare resolve_asm_operand_names.
+
+ * stmt.c (expand_decl): Put artificial vars into registers even
+ when not optimizing, and don't mark the regs as user vars.
+
+2003-06-06 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode
+ of the generated register.
+
+2003-06-06 Daniel Jacobowitz <drow@mvista.com>
+
+ * config.gcc: Add a missing sparc64 case.
+
+2003-06-06 Jakub Jelinek <jakub@redhat.com>
+
+ * mklibgcc.in: Propagate .note.GNU-stack section if needed into
+ the .hidden assembly stubs.
+
+2003-06-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config.gcc (extra_headers): Add emmintrin.h for i[34567]86-*-*
+ and x86_64-*-*.
+
+ * config/i386/mmintrin.h: Update version and add alternate
+ intrinsic names.
+ * config/i386/xmmintrin.h: Likewise.
+
+ * config/i386/xmmintrin.h: Include <emmintrin.h>. Move SSE2
+ intrinsics to ...
+ * config/i386/emmintrin.h: Here. New file.
+
+2003-06-06 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold <ABS_EXPR>): Re-fold the result of folding
+ fabs(-x) into fabs(x). Use tree_expr_nonnegative_p to determine
+ when the ABS_EXPR (fabs or abs) is not required.
+ (tree_expr_nonnegative_p): Move the logic that sqrt and exp are
+ always nonnegative from fold to here. Additionally, cabs and fabs
+ are always non-negative, and pow and atan are non-negative if
+ their first argument is non-negative.
+
+ * builtins.c (fold_builtin_cabs): New function to fold cabs{,f,l}.
+ Evaluate cabs of a constant at compile-time. Convert cabs of a
+ non-complex argument into fabs. Convert cabs(z) into
+ sqrt(z.r*z.r + z.i*z.i) at the tree-level with -ffast-math or
+ -funsafe-math-optimizations or -ffast-math.
+ (fold_builtin): Convert BUILT_IN_FABS{,F,L} into an ABS_EXPR.
+ Fold BUILT_IN_CABS{,F,L} using fold_builtin_cabs.
+
+Thu Jun 5 20:51:09 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * sourcebuild.texi (Front End Directory): Document new hooks.
+
+Fri Jun 6 11:02:35 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * function.c (FLOOR_ROUND, CEIL_ROUND): Fix.
+ * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic
+ stack frames.
+ (pro_epilogue_adjust_stack_rex64_2): New pattern
+
+Fri Jun 6 11:03:14 CEST 2003 Jan Hubicka <jh@suse.cz>
+ Pop Sebastian
+ Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfghooks.h, cfghooks.c: New files.
+ * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h.
+ (OBJS): Add cfghooks.o.
+ (cfghooks.o): New rule.
+ * basic-block.h (split_edge): Rename to rtl_split_edge.
+ (verify_flow_info): Rename to rtl_verify_flow_info.
+ (cfghooks.h): Included here.
+ * cfgrtl.c (split_edge): Renamed rtl_split_edge.
+ (verify_flow_info): Renamed rtl_verify_flow_info.
+ * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks.
+
+ * basic-block.h (split_block, split_edge, flow_delete_block,
+ redirect_edge_and_branch, redirect_edge_and_branch_force): Delete.
+ (flow_delete_block_noexpunge): Return void.
+ * cfg.c (verify_flow_info): New function.
+ * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match,
+ try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks):
+ Use delete_block.
+ * cfglayout.c (function_footer): Rename to...
+ (cfg_layout_function_footer): ... this variable
+ (unlink_insn_chain): Make global.
+ (fixup_reorder_chain, record_effective_endpoints): Update.
+ (cleanup_unconditional_jumps): Use delete_block.
+ (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c
+ (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force.
+ (cfg_layout_initialize, cfg_layout_finalize): Update hooks.
+ * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete.
+ (cfg_layout_function_footer): Declare.
+ * cfgloopmanip (split_loop_bb): Do not update RBI.
+ (remove_bbs): Use delete_block.
+ (loop_reidrect_edge, loop_delete_branch_edge): Use
+ redirect_edge_and_branch.
+ (create_preheader): Use split_block and redirect_edge_and_branch_force.
+ (split_edge_with): Likewise.
+ * cfgrtl.c: Include cfglayout.h
+ (split_edge): Rename to ...
+ (rtl_split_edge) ... this one; make local.
+ (redirect_edge_and_branch): Rename to ...
+ (rtl_redirect_edge_and_branch) ... this one; make local.
+ (redirect_edge_and_branch_force): Rename to ...
+ (rtl_redirect_edge_and_branch_force) ... this one; make local.
+ (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New.
+ (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from
+ cfglayout.c; update to directly call RTL counterparts.
+ (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions.
+ * ifcvt.c (find_cond_trap): Use delete_block.
+ (find_if_case_1): Use delete_block.
+ (find_if_case_2): Use delete_block.
+ * rtl.h (unlink_insn_chain): Declare.
+ * toplev.c (rtl_reigster_cfg_hooks): New.
+
+2003-06-05 Richard Henderson <rth@redhat.com>
+
+ * recog.c (peephole2_optimize): Revert last change.
+
+2003-06-05 Richard Henderson <rth@redhat.com>
+
+ * recog.c (peephole2_optimize): Don't split block unless
+ can_throw_internal.
+
+2003-06-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (get_shift_alg): Correct the syntax of rotxl.
+ * config/h8300/h8300.md (*addsi3_lshiftrt_16_zexthi): Likewise.
+
+2003-06-05 Kelley Cook <kelleycook@wideopenwest.com>
+
+ PR optimization/4490
+ * config/i386/i386.md: Don't use XFMode if TARGET_128BIT_LONG_DOUBLE.
+ * doc/invoke.texi (m96bit-long-double, m128bit-long-double): Reword
+ documentation to accurately reflect what these options do.
+
+2003-06-06 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/linux.h (STARTFILE_SPEC): Handle -pie. Simplify.
+ (ENDFILE_SPEC): Redefine to handle -pie.
+
+2003-06-05 Phil Edwards <phil@jaj.com>
+
+ * Makefile.in (qmtest-g++): Use target_alias, not target.
+
+2003-06-05 Per Bothner <pbothner@apple.com>
+
+ * toplev.c (push_srcloc): Simplify behavior to save current location
+ and set current location to parameters.
+ (pop_srcloc): Simplify semantics.
+ (lang_dependent_init): Remove now-useless initial push_srcloc.
+
+2003-05-06 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (loc_descriptor_from_tree): Return 0 for
+ language-specific tree codes.
+
+2003-06-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR middle-end/9986
+ * pa.c (pa_init_builtins): Also set implicit_built_in_decls for
+ BUILT_IN_FPUTC_UNLOCKED to NULL_TREE.
+
+Thu Jun 5 18:32:46 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * install.tex: Document profiledbootstrap.
+
+ * configure.in: Add support for lang.stageprofile and
+ lang.stagefeedback
+ * Makefile.in (clean, distclean): Kill new stages
+ (POSTSTAGE1_FLAGS_TO_PASS): Break from ...
+ (STAGE2_FLAGS_TO_PASS): ... this one.
+ (STAGEPROFILE_FLAGS_TO_PASS, STAGEFEEDBACK_FLAGS_TO_PASS): New.
+ (stage[2-4]_build): Add POSTSTAGE1_FLAGS_TO_PASS.
+ (stageprofile_build, stageprofile_copy, stagefeedback_build,
+ stagefeedback_copy): New.
+ (restageprofile, restagefeedback, stageprofile-start,
+ stageprofile, stagefeedback-start): Likewise.
+
+2003-06-05 David Miller <davem@redhat.com>
+ Richard Henderson <rth@redhat.com>
+
+ * optabs.c (HAVE_conditional_trap): Provide default.
+ (gen_conditional_trap): Likewise.
+ (init_optabs): Merge init_traps.
+ (gen_cond_trap): Use prepare_operand. Restructure and avoid ifdef.
+
+Thu Jun 5 14:59:44 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (simplify_if_then_else): (IF_THEN_ELSE (NE REG 0) (0) (8))
+ is REG for nonzero_bits (REG) == 8.
+
+Thu Jun 5 13:23:51 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (align): Fix warning; clarify what to do when no p2align
+ is available.
+
+2003-06-05 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc (m32r-elf): Revert previous delta.
+ * config/m32r/t-m32r (crtinit.o): Fix rule to work with
+ multilibs. Remove m32rx specific version.
+ (crtfini.o): Likewise.
+ (EXTRA_MULTILIB_PARTS): Define.
+
+2003-06-05 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/md.texi (Machine Constraints): Correct the meaning of
+ constraints related to floating-point registers on SPARC.
+
+2003-06-05 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Paolo Bonzini <bonzini@gnu.org>
+
+ PR target/10663
+ * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Redirect
+ assembler and linker output to /dev/null.
+ Use a 'sed' construct instead of 'grep -A1'.
+ * configure: Regenerate.
+
+2003-06-04 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (struct ix86_address): Add seg.
+ (no_seg_address_operand): New.
+ (ix86_decompose_address): Restructure PLUS loop. Accept one
+ UNSPEC_TP if TARGET_TLS_DIRECT_SEG_REFS. Adjust ESP swap test
+ to test for a regnum, not stack_pointer_rtx.
+ (ix86_address_cost): Reduce cost if non-default segment.
+ (legitimate_address_p): Remove UNSPEC_TP check.
+ (get_thread_pointer): Add to_reg argument. Don't represent
+ the thread pointer as a memory load.
+ (legitimize_tls_address): Split out of ...
+ (legitimize_address): ... here.
+ (print_operand_address): Handle parts.seg.
+ (ix86_expand_move): Use legitimize_tls_address.
+ (ix86_rtx_costs): Handle UNSPEC_TP.
+ * config/i386/i386.h (MASK_TLS_DIRECT_SEG_REFS): New.
+ (TARGET_TLS_DIRECT_SEG_REFS): New.
+ (TARGET_SWITCHES): Add tls-direct-seg-refs.
+ (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): Default.
+ (PREDICATE_CODES): Add no_seg_address_operand.
+ * config/i386/i386.md (lea_1): Use it.
+ (lea_1_rex64, lea_1_zext, lea_2_rex64): Likewise.
+ (load_tp_si, add_tp_si, load_tp_di, add_tp_di): New.
+ * config/i386/linux.h (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): New.
+ * config/i386/linux64.h (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): New.
+ * doc/invoke.texi: Add -mtls-direct-seg-refs.
+
+2003-06-04 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (QMTESTRUNFLAGS): Set for DejaGNU emulation.
+ (QMTEST_GPP_TESTS): Use "g++" by default.
+ (stamp-qmtest): Tweak database creation.
+ (QMTEST_DIR/context): Update context file format.
+ (qmtest-g++): Tweak command-line.
+
+2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (varasm.o): Don't set -Wno-error.
+ * rs6000/t-rs6000 (varasm.o, out_object_file): Don't clear.
+
+2003-06-04 Zack Weinberg <zack@codesourcery.com>
+
+ PR bootstrap/3163
+ * aclocal.m4 (AC_FUNC_MMAP_ANYWHERE, AC_FUNC_MMAP_FILE): Delete.
+ (gcc_AC_FUNC_MMAP_BLACKLIST): New.
+ * configure.in: Check for sys/mman.h and mmap in AC_CHECK_HEADERS
+ and AC_CHECK_FUNCS lists, respectively. Use
+ gcc_AC_FUNC_MMAP_BLACKLIST, not AC_FUNC_MMAP_ANYWHERE nor
+ AC_FUNC_MMAP_FILE.
+ * configure, config.in: Regenerate.
+
+2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * arm/aout.h (ASM_OUTPUT_SKIP): Fix cast for format specifier warning.
+ * arm.c (arm_output_function_prologue): Fix format specifiers.
+ * arm.h (ARM_PRINT_OPERAND_ADDRESS): Likewise.
+ * m68k.c (m68k_output_mi_thunk): Use more readable %wd instead of
+ HOST_WIDE_INT_PRINT_DEC.
+ * vax.c (vax_output_function_prologue): Fix format specifiers.
+
+2003-06-04 Richard Henderson <rth@redhat.com>
+
+ * cse.c (find_best_addr): Consider binary operators even if second
+ argument is not CONST_INT.
+
+2003-06-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * doc/invoke.texi (max-cse-path-length): Document.
+
+2003-06-04 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.md (align): Use ASM_OUTPUT_*ALIGN macros.
+
+2003-06-04 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/darwin.h (RS6000_OUTPUT_BASENAME):
+ Remove semi-colon at the end of the expression.
+
+2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * i370.c (mvs_function_name_length): Fix signed/unsigned warnings.
+ * i370.h (mvs_function_name_length): Likewise.
+ * i960.h (CONSTANT_ALIGNMENT): Likewise.
+ * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * pa/pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+ * pa.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+ * rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Delete unused
+ variable.
+
+2003-06-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * config.gcc: Reorganize --with-cpu logic. Set
+ configure_default_options according to the default CPU, --with-cpu,
+ --with-arch, --with-tune, --with-schedule, --with-abi, and
+ --with-float. Check for legal values of various options.
+ * configure.in: Define configure_default_options in configargs.h.
+ * configure: Regenerated.
+ * config/mips/mips.h (TARGET_DEFAULT_ARCH_P)
+ (TARGET_DEFAULT_FLOAT_P): New macros.
+ * gcc.c (do_option_spec): New function.
+ (struct default_spec, option_default_specs): New.
+ (main): Call do_option_spec.
+ * config/alpha/alpha.h, config/arm/arm.h, config/i386/i386.h,
+ config/mips/mips.h, config/pa/pa.h, config/rs6000/rs6000.h,
+ config/sparc/sparc.h (OPTION_DEFAULT_SPECS): Define.
+
+ * doc/install.texi: Update --with-cpu documentation. Mention
+ --with-arch, --with-schedule, --with-tune, --with-abi, and
+ --with-float.
+ * doc/tm.texi (Driver): Document OPTION_DEFAULT_SPECS.
+
+2003-06-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * config.gcc: Only process --with-cpu logic in the third pass.
+
+2003-06-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * config.gcc: Reorganize --with-cpu section. Remove an
+ obsolete comment about the default CPU for x86-64. Fix
+ a typo for the ep9312. Update the list of supported PowerPC
+ CPUs. Support a limited set of new --with-cpu options
+ for i386.
+
+2003-06-04 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_complex_function_value): Unpack
+ complex numbers <= 32 bits into two registers.
+
+2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alpha.c (print_operand_address): Fix format specifier warnings.
+ * alpha/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+ * alpha/vms.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+ * arm/aof.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise.
+ * arm/pe.h (ASM_OUTPUT_COMMON): Likewise.
+ * avr.h (ASM_OUTPUT_COMMON, ASM_GENERATE_INTERNAL_LABEL,
+ ASM_OUTPUT_SKIP): Likewise.
+ * c4x.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ * dsp16xx.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ * h8300.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_COMMON):
+ Likewise.
+ * i370.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ * i386/cygming.h (ASM_OUTPUT_COMMON): Likewise.
+ * i386/darwin.h (ASM_OUTPUT_COMMON): Likewise.
+ * i960.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ * m68k/hp320.h (PRINT_OPERAND_ADDRESS): Likewise.
+ * mcore.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+ * pdp11.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ * ptx4.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+ * sparc/freebsd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ * svr3.h (ASM_OUTPUT_COMMON): Likewise.
+
+2003-06-04 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * c-decl.c (c_init_decl_processing): Clear input_file_name
+ while building common nodes.
+ * dwarf2out.c (gen_compile_unit_die, dwarf2out_finish):
+ Don't add working directory for strings like <built-in> .
+
+2003-06-04 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi (*-ibm-aix*): Native as and ld required
+ to bootstrap on AIX 5L.
+
+2003-06-04 Richard Henderson <rth@redhat.com>
+
+ * c-common.c (handle_cleanup_attribute): New.
+ (c_common_attributes): Add it.
+ * c-decl.c (finish_decl): Honor the cleanup attribute.
+ * doc/extend.texi (Variable Attributes): Document it.
+
+ * unwind-c.c: New file.
+ * Makefile.in (LIB2ADDEH): Add it.
+ * config/t-darwin, config/t-linux, config/t-linux-gnulibc1,
+ config/ia64/t-ia64: Likewise.
+
+2003-06-04 Jakub Jelinek <jakub@redhat.com>
+
+ * function.c (trampolines_created): New variable.
+ (expand_function_end): Set it when doing INITIALIZE_TRAMPOLINE.
+ * function.h (trampolines_created): Add.
+ * config/s390/linux.h (ASM_FILE_END): Define.
+ * config/alpha/linux-elf.h (ASM_FILE_END): Define.
+ * config/m68k/linux.h (ASM_FILE_END): Define.
+ * config/rs6000/linux.h (ASM_FILE_END): Define.
+ * config/rs6000/linux64.h (ASM_FILE_END): Define.
+ * config/rs6000/ppc-asm.h: Add .note.GNU-stack on powerpc-linux.
+ * config/sparc/linux.h (ASM_FILE_END): Define.
+ * config/sparc/linux64.h (ASM_FILE_END): Define.
+ * config/i386/i386.c (ix86_asm_file_end): Use SUBTARGET_FILE_END.
+ * config/i386/linux.h (SUBTARGET_FILE_END): Define.
+ * config/i386/linux64.h (SUBTARGET_FILE_END): Define.
+
+Wed Jun 4 18:39:33 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (min_insn_size, k8_avoid_jump_misspredicts): New functions
+ (ix86_reorg): Use it.
+ * i386.md (align): New insn pattern.
+
+2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * toplev.c (rest_of_type_compilation): Fix typo.
+
+2003-06-04 Jakub Jelinek <jakub@redhat.com>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * config/i386/linux.h (NO_PROFILE_COUNTERS): Define to 1.
+ * config/i386/freebsd.h (NO_PROFILE_COUNTERS): Likewise.
+ * config/i386/netbsd-elf.h (NO_PROFILE_COUNTERS): Likewise.
+ * config/xtensa/xtensa.h (NO_PROFILE_COUTNERS): Likewise.
+ * config/darwin.h (NO_PROFILE_COUNTERS): Likewise.
+ * final.c (NO_PROFILE_COUNTERS): Define to 0 if not defined.
+ (profile_function): Allow NO_PROFILE_COUNTERS to be non-constant.
+ * config/rs6000/rs6000.c (output_profile_hook): Likewise.
+
+ * configure.in (powerpc*-*, s390*-*): Set tls_as_opt.
+ Pass it to $gcc_cv_as.
+ * configure: Rebuilt.
+
+ * config/rs6000/rs6000.c (rs6000_abi_name): Remove initializer.
+ (print_operand): Allow TARGET_AIX to be non-constant.
+ (rs6000_aix_emit_builtin_unwind_init, rs6000_emit_eh_toc_restore):
+ Define unconditionally.
+ (rs6000_elf_declare_function_name): New function.
+ * config/rs6000/rs6000.md (eh_return): Allow TARGET_AIX to be
+ non-constant.
+ * config/rs6000/linux64.h [!RS6000_BI_ARCH] (TARGET_64BIT): Define
+ to 1.
+ (DEFAULT_ARCH64_P, RS6000_BI_ARCH_P): Define.
+ [IN_LIBGCC2] (TARGET_64BIT): Define based on whether __powerpc64__
+ is defined.
+ (TARGET_AIX): Define to 1 if TARGET_64BIT.
+ (PROCESSOR_DEFAULT): Remove.
+ (TARGET_RELOCATABLE, RS6000_ABI_NAME, INVALID_64BIT,
+ INVALID_32BIT, SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
+ [RS6000_BI_ARCH] (OVERRIDE_OPTIONS, ASM_FILE_START): Define.
+ (ASM_DEFAULT_SPEC, ASM_SPEC, LINK_OS_LINUX_SPEC): Define for both
+ -m32 and -m64.
+ (MULTILIB_DEFAULTS): Define.
+ (SUBSUBTARGET_EXTRA_SPECS): Define.
+ (ASM_SPEC32, ASM_SPEC64, ASM_SPEC_COMMON): Define.
+ (TARGET_TOC): Define only if !RS6000_BI_ARCH.
+ (TARGET_NO_TOC): Remove.
+ [!RS6000_BI_ARCH] (TARGET_RELOCATABLE, TARGET_EABI,
+ TARGET_PROTOTYPE): Define to 0.
+ (NO_PROFILE_COUNTERS): Define to TARGET_64BIT.
+ (PROFILE_HOOK): Only call output_profile_hook if TARGET_64BIT.
+ (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Adjust to work properly
+ if !TARGET_64BIT.
+ (USER_LABEL_PREFIX): Remove.
+ (JUMP_TABLES_IN_TEXT_SECTION): Define to TARGET_64BIT.
+ (SETUP_FRAME_ADDRESSES): Only call rs6000_aix_emit_builtin_unwind_init
+ if TARGET_64BIT.
+ (TARGET_OS_CPP_BUILTINS): Handle both -m32 and -m64.
+ (LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Define.
+ (STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Remove.
+ (TOC_SECTION_ASM_OP): Define depending on TARGET_64BIT.
+ (MINIMAL_TOC_SECTION_ASM_OP): Likewise.
+ (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Define depending on
+ TARGET_64BIT.
+ (RS6000_CALL_GLUE): Likewise.
+ (SAVE_FP_PREFIX, SAVE_FP_SUFFIX, RESTORE_FP_PREFIX,
+ RESTORE_FP_SUFFIX): Likewise.
+ (ASM_DECLARE_FUNCTION_NAME): Remove.
+ (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_SOURCE_LINE,
+ DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Only output dot before function
+ name if TARGET_64BIT.
+ (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Handle both TARGET_64BIT and
+ !TARGET_64BIT.
+ (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Remove undefs.
+ (ASM_PREFERRED_EH_DATA_FORMAT): Take TARGET_64BIT into account.
+ (DRAFT_V4_STRUCT_RET): Define.
+ (SIGNAL_FRAMESIZE): New enum value.
+ (MD_FALLBACK_FRAME_STATE_FOR): Define.
+ * config/rs6000/default64.h: New file.
+ * config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -m32 and -m64
+ options.
+ (SUBTARGET_OVERRIDE_OPTIONS): If rs6000_abi_name is NULL, set it
+ to RS6000_ABI_NAME. Only disallow mixing of -fPIC with -mcall-aixdesc
+ if !TARGET_64BIT.
+ [!RS6000_BI_ARCH] (SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
+ (ASM_DECLARE_FUNCTION_NAME): Use rs6000_elf_declare_function_name
+ function.
+ (TARGET_OS_SYSV_CPP_BUILTINS): Define.
+ (TARGET_OS_CPP_BUILTINS): Use it.
+ (CPP_SYSV_SPEC): Remove.
+ (CPP_SPEC): Remove cpp_sysv.
+ (SUBTARGET_EXTRA_SPECS): Remove cpp_sysv.
+ Add SUBSUBTARGET_EXTRA_SPECS.
+ (SUBSUBTARGET_EXTRA_SPECS): Define.
+ * config/rs6000/biarch64.h: New file.
+ * config/rs6000/rs6000-protos.h (rs6000_elf_declare_function_name):
+ New prototype.
+ * config/rs6000/x-linux64: New file.
+ * config/rs6000/t-linux64: Build -m64, -m32 and -m32 -msoft-float
+ multilibs.
+ * config/rs6000/eabi-ci.asm: Protect with #ifndef __powerpc64__.
+ * config/rs6000/eabi-cn.asm: Likewise.
+ * config/rs6000/tramp.asm: Likewise.
+ * config/rs6000/sol-ci.asm: Likewise.
+ * config/rs6000/sol-cn.asm: Likewise.
+ * config/rs6000/linux.h (TARGET_64BIT): Define to 0.
+ (TARGET_OS_CPP_BUILTINS): Use TARGET_OS_SYSV_CPP_BUILTINS.
+ * config/rs6000/ppc-asm.h: Move __powerpc64__ section before
+ _CALL_AIXDESC section.
+ * config.gcc (powerpc64-*-linux*): Configure a bi-arch compiler,
+ defaulting to -m64 unless --with-cpu= is one of the 32-bit CPUs
+ or default32.
+
+2003-06-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * config.gcc: Revert accidentally committed ARM changes.
+
+2003-06-04 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (dconstpi, dconste): New mathematical constants.
+ (init_builtin_dconsts): New function to initialize dconstpi
+ and dconste.
+ (fold_builtin): Optimize exp(1.0) = e. Evaluate exp(x) at
+ compile time with -ffast-math when x is an integer constant.
+ Optimize tan(0.0) = 0.0. Optimize atan(0.0) = 0.0,
+ atan(1.0) = pi/4 and tan(atan(x)) = x with -ffast-math.
+
+2003-06-04 Roger Sayle <roger@eyesopen.com>
+
+ * calls.c (expand_call): Avoid calling pure or const functions
+ when the result is ignored (or void) and none of the arguments
+ are volatile. Move warning diagnostic earlier in function.
+
+2003-06-04 Andreas Jaeger <aj@suse.de>
+
+ * system.h: Do not poison TDESC_SECTION_ASM_OP,
+ RDATA_SECTION_ASM_OP and SUBTARGET_PROLOGUE.
+
+2003-06-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * final.c (asm_fprintf): Update comments, accept "-+ #0" flags,
+ optimize '%' case, handle %c, don't accept %p, %e, %f or %g,
+ handle %ll, optimize regular character case.
+
+2003-06-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (cse.o): Add params.h dependency.
+ * cse.c: Include params.h.
+ (PATHLENGTH): Removed.
+ (struct cse_basic_block_data): Make path array dynamic.
+ (cse_end_of_basic_block): Use PARAM_MAX_CSE_PATH_LENGTH instead
+ of PATHLENGTH.
+ (cse_main, cse_basic_block): Allocate path array.
+ * params.def (PARAM_MAX_CSE_PATH_LENGTH): New.
+
+Wed Jun 4 09:49:21 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_reorg): Replace the jump instead of adding nop.
+ * i386.md (UNSPEC_REP): New constant.
+ (return_internal_long): New pattern.
+
+2003-06-04 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11018
+ * config/sparc/sparc.c (sparc_v8plus_shift): Use which_alternative
+ consistently to decide whether the scratch register is really
+ required.
+
+2003-06-04 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/10876
+ * config/sparc/sparc.h (CONST_OK_FOR_LETTER): Add
+ new 'O' constraint for constant 4096.
+ (CONST_DOUBLE_OK_FOR_LETTER_P): Likewise.
+ * config/sparc/sparc.md (adddi3 expander): Canonicalize pattern.
+ Do not transform into MINUS insn for constant 4096.
+ (*adddi3_sp64 insn): Canonicalize pattern. Add new alternative
+ for constant 4096 as third operand.
+ (addsi3 expander): Remove.
+ (*addsi3 insn): Rename into 'addsi3'. Canonicalize pattern. Add
+ new alternative for constant 4096 as third operand.
+ (subdi3 expander): Do not transform into PLUS insn for constant 4096.
+ (*subdi3_sp64 insn): Add new alternative for constant 4096 as third
+ operand.
+ (subsi3 expander): Remove.
+ (*subsi3 insn): Rename into 'subsi3'. Add new alternative for
+ constant 4096 as third operand.
+ * doc/md.texi (Machine Constraints): Document new 'O' constraint for
+ the SPARC port.
+
+2003-06-03 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/t-linux64 (CRTSTUFF_T_CFLAGS_S): Define.
+
+2003-06-04 Andreas Jaeger <aj@suse.de>
+
+ * config/i386/uwin.h: Remove SUBTARGET_PROLOGUE.
+
+ * config/i386/i386.c (ix86_expand_prologue): Do not use
+ SUBTARGET_PROLOGUE.
+
+ * system.h: Poision SUBTARGET_PROLOGUE.
+
+ * config/arm/arm-protos.h: Remove unused rdate_section prototype.
+
+ * output.h: Remove TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP
+ dependend code.
+
+ * system.h: Poison TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP.
+
+ * system.h: Poison INSN_CACHE_DEPTH, INSN_CACHE_SIZE and
+ INSN_CACHE_LINE_WIDTH.
+
+ * libgcc2.c (INSN_CACHE_PLANE_SIZE): Removed.
+ (__clear_cache): Remove code dependend on INSN_CACHE_DEPTH,
+ INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH.
+
+ * doc/tm.texi (Trampolines): Remove INSN_CACHE_DEPTH,
+ INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH.
+
+ * dbxout.c (dbxout_type): Remove usage of DBX_OUTPUT_ENUM.
+ (dbxout_symbol): Remove usage of DBX_OUTPUT_CONSTANT_SYMBOL.
+ (dbxout_block): Remove usage of DBX_OUTPUT_CATCH.
+ (dbxout_block): Remove usage of DBX_LBRAC_FIRST.
+ (dbxout_source_file): Remove usage of DBX_OUTPUT_SOURCE_FILENAME.
+ (dbxout_init): Remove test for DBX_WORKING_DIRECTORY.
+
+ * doc/tm.texi (DBX Options): Do not document DBX_LBRAC_FIRST,
+ DBX_OUTPUT_SOURCE_FILENAME and DBX_OUTPUT_ENUM and
+ DBX_WORKING_DIRECTORY.
+
+ * system.h: Poison DBX_LBRAC_FIRST, DBX_OUTPUT_ENUM,
+ DBX_OUTPUT_SOURCE_FILENAME and DBX_WORKING_DIRECTORY.
+
+ * config/frv/frv-protos.h: Remove unused const_section
+ declaration.
+ * config/vax/vax-protos.h: Likewise.
+
+ * output.h: Remove CONST_SECTION_ASM_OP usage.
+
+ * system.h: Poison CONST_SECTION_ASM_OP.
+
+ * crtstuff.c (__do_global_dtors_aux): Remove usage of
+ CRT_GET_RFIB_TEXT.
+ (frame_dummy): Likewise.
+ * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise.
+ * system.h: Poison CRT_GET_RFIB_TEXT.
+
+ * collect2.c (is_ctor_dtor): Remove CFRONT_LOSSAGE dependend code.
+
+ * fix-header.c: Remove ADD_MISSING_EXTERN_C dependend variables.
+ (write_lbrac): Remove ADD_MISSING_EXTERN_C dependend code.
+ (recognized_function): Likewise.
+ (read_scan_file): Likewise.
+
+2003-06-03 Roger Sayle <roger@eyesopen.com>
+
+ * optabs.c (expand_binop): Optimize complex multiplication for
+ the case of squaring a complex argument.
+
+2003-06-03 Roger Sayle <roger@eyesopen.com>
+
+ * optabs.c (expand_binop): Attempt to reuse pseudos for duplicate
+ non-volatile operands of binary operations.
+ (prepare_cmp_insn): Likewise.
+
+2003-06-03 Roger Sayle <roger@eyesopen.com>
+
+ * varasm.c (force_const_mem): Handle alignment of constants not
+ representable as a type in the front-end language.
+
+2003-06-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * flow.c (initialize_uninitialized_subregs): Use
+ emit_move_insn instead of emitting a hardcoded move.
+
+2003-06-03 Richard Henderson <rth@redhat.com>
+
+ * optabs.c (expand_abs_nojump): Split out from ...
+ (expand_abs): ... here.
+ * optabs.h (expand_abs_nojump): Declare.
+ * ifcvt.c: (noce_try_abs): Use expand_abs_nojump.
+ * Makefile.in (ifcvt.o): Depend on optabs.h.
+
+2003-06-03 Alan Modra <amodra@bigpond.net.au>
+
+ * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Heed flag_merge_constants.
+
+2003-06-03 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config.gcc (default_use_cxa_atexit): New variable, defaults to no.
+ (*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*): Set default_use_cxa_atexit
+ to yes.
+ * configure.in: Allow default_use_cxa_atexit to determine the
+ value of DEFAULT_USE_CXA_ATEXIT if not explicitly enabled or
+ disabled.
+ * configure: Regenerate.
+
+2003-06-03 Douglas B Rupp <rupp@gnat.com>
+
+ * Makefile.in (TEXI_GCC_FILES): Remove vms.texi entry.
+ * doc/gcc.texi: Remove vms.texi section.
+ * doc/vms.texi: Remove obsolete file.
+
+2003-05-23 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * configure.in (inhibit_libc): Don't define when configuring
+ with --with-newlib --with-headers.
+ * configure: Regenerate.
+
+ * t-sh: Remove LIB2FUNCS_EXTRA and embed-bb.c rules.
+
+2003-06-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (gcc_cv_as_hidden): Disable .hidden completely on
+ IRIX 6 without GNU ld.
+ * configure: Regenerate.
+
+2003-06-03 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (emit_move_insn_1): Use emit_move_insn to move the parts
+ of a complex number rather than invoke mov_optab directly.
+
+2003-06-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (simplify_set): Don't move a subreg in SET_SRC to
+ SET_DEST if WORD_REGISTER_OPERATIONS is not defined.
+
+2003-06-03 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/i386/x86-64.h: Remove two target-independent comments;
+ replace "GNU CC" with "GCC".
+
+2003-06-03 Anthony Green <green@redhat.com>
+
+ * config/frv/t-frv (EXTRA_HEADERS): Remove media.h
+
+2003-06-03 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def (BUILT_IN_CABS, BUILT_IN_CABSF, BUILT_IN_CABSL):
+ New builtins representing ISO C99's cabs, cabsf and cabsl.
+ * builtins.c (expand_builtin_fabs): New function.
+ (expand_builtin_cabs): New function.
+ (expand_builtin): Expand BUILT_IN_FABS{,F,L} and BUILT_IN_CABS{,F,L}
+ using expand_builtin_fabs and expand_builtin_cabs respectively.
+
+ * doc/extend.texi: Document new cabs, cabsf and cabsl builtins.
+
+2003-06-03 Aldy Hernandez <aldyh@redhat.com>
+
+ * function.c (assign_parms): Split complex arguments.
+
+ * doc/tm.texi (SPLIT_COMPLEX_ARGS): Document.
+
+ * expr.h (SPLIT_COMPLEX_ARGS): Define.
+ (split_complex_types): Protoize.
+ (split_complex_values): Protoize.
+
+ * calls.c (expand_call): Split complex arguments on architectures
+ that require it.
+ (split_complex_values): New.
+ (split_complex_types): New.
+
+ * config/rs6000/rs6000.c (rs6000_libcall_value): New.
+ (rs6000_function_value): Handle complex values on AIX.
+ (rs6000_complex_function_value): New.
+
+ * config/rs6000/rs6000-protos.h (rs6000_libcall_value): Protoize.
+
+ * config/rs6000/rs6000.h (LIBCALL_VALUE): Call function.
+ (SPLIT_COMPLEX_ARGS): New.
+
+2003-06-03 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.in (HAVE_LD_PIE): Check for ld -pie.
+ * config.in: Rebuilt.
+ * configure: Rebuilt.
+ * toplev.c (flag_pie, flag_shlib): New variables.
+ (f_options): Add -fpie and -fPIE.
+ (parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE.
+ Set flag_shlib if flag_pic and not -fpie/-fPIE.
+ * flags.h (flag_pic, flag_shlib): Add.
+ * varasm.c (default_binds_local_p): Use flag_shlib instead of
+ flag_pic.
+ * gcc.c (LINK_PIE_SPEC): Define.
+ (LINK_COMMAND_SPEC): Use LINK_PIE_SPEC.
+ (option_map): Add --pie -> -pie mapping.
+ * config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic
+ and -fPIE the same way as -fPIC.
+ * config/openbsd.h (ASM_SPEC): Likewise.
+ * config/frv/frv.h (ASM_SPEC): Likewise.
+ * config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise.
+ * config/arm/semi.h (ASM_SPEC): Likewise.
+ * config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise.
+ * config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise.
+ * config/i386/beos-elf.h (CC1_SPEC): Likewise.
+ * config/i386/freebsd-aout.h (ASM_SPEC): Likewise.
+ * config/m68k/linux.h (CPP_SPEC): Likewise.
+ * config/m68k/netbsd.h (ASM_SPEC): Likewise.
+ * config/m68k/openbsd.h (ASM_SPEC): Likewise.
+ * config/m68k/netbsd-elf.h (ASM_SPEC): Likewise.
+ * config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise.
+ * config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise.
+ * config/pa/pa-linux.h (CPP_SPEC): Likewise.
+ * config/netbsd-aout.h (ASM_SPEC): Likewise.
+ * config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise.
+ * config/rs6000/vxworks.h (CPP_SPEC): Likewise.
+ * config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
+ * config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
+ * config/sparc/sparc.h (ASM_SPEC): Likewise.
+ * config/sparc/sp64-elf.h (ASM_SPEC): Likewise.
+ * config/sparc/sysv4.h (ASM_SPEC): Likewise.
+ * config/sparc/netbsd-elf.h (ASM_SPEC): Likewise.
+ * config/sparc/openbsd64.h (ASM_SPEC): Likewise.
+ * config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise.
+ * config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie.
+ Simplify.
+ * config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
+ * config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
+ * config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
+ * config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
+ * config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
+ * config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
+ * config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
+ * doc/invoke.texi: Document -pie, -fpie and -fPIE options.
+
+2003-06-03 Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (expand_builtin_memcpy): Remove endp argument and endp
+ != 0 handling. Pass 0 to store_by_pieces.
+ (expand_builtin_mempcpy): Add endp argument. Don't call
+ expand_builtin_memcpy, call store_by_pieces resp. move_by_pieces
+ directly. If ignoring result, only do expand_call.
+ (expand_builtin_stpcpy): Likewise. Call expand_builtin_mempcpy
+ otherwise.
+ (expand_builtin_strncpy, expand_builtin_memset): Adjust
+ store_by_pices callers.
+ (expand_builtin): Adjust expand_builtin_memcpy and
+ expand_builtin_mempcpy callers.
+ * expr.c (can_move_by_pieces): New function.
+ (move_by_pieces): Add endp argument, return to resp. memory at end
+ or one byte earlier depending on endp.
+ (store_by_pieces): Likewise.
+ (emit_block_move): Adjust call to move_by_pieces.
+ (emit_push_insn): Adjust move_by_pieces caller.
+ * expr.h (can_move_by_pieces): New prototype.
+ (store_by_pieces): Adjust prototypes.
+ * rtl.h (move_by_pieces): Adjust prototype.
+ * config/mips/mips.c (expand_block_move): Adjust move_by_pieces
+ caller.
+
+2003-06-03 Ben Elliston <bje@wasabisystems.com>
+
+ * doc/md.texi (Processor pipeline description): Improve wording.
+
+2003-06-03 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (c_common_handle_option): New, pulled out of
+ c_common_decode_option. Substitute uses of argv.
+ (c_common_decode_option): Broken into two.
+
+2003-06-02 Roger Sayle <roger@eyesopen.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * emit-rtl.c (gen_complex_constant_part): Remove unnecessary
+ test of TREE_CONSTANT_POOL_ADDRESS_P.
+
+2003-06-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * mips.c: Don't include output.h twice.
+ * stormy16.c: Likewise.
+ * xtensa.c: Likewise.
+ * output.h: Protect against multiple inclusion.
+
+2003-06-02 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (OLD_ARG_MODE): New macro.
+ (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
+ (FUNCTION_ARG_1): Break out of:
+ (FUNCTION_ARG). Use OLD_ARG_MODE.
+
+2003-06-02 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * gcc/config.gcc Add support multilib parts for m32rx processor.
+
+2003-06-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (c-options.c): Pass in $(AWK) to opts.sh.
+ (mostlyclean): Delete c-options.c and c-options.h.
+
+2003-06-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (CL_REJECT_NEGATIVE): New.
+ (c_common_decode_option): Update to use it.
+ * c.opt: Update documentation; use RejectNegative.
+ * opts.sh: Handle RejectNegative.
+
+2003-06-01 Zack Weinberg <zack@codesourcery.com>
+
+ * ggc-page.c (init_ggc): Give better diagnostics on failure to
+ open /dev/zero.
+ * toplev.c (crash_signal): Reset handling for received signal
+ to SIG_DFL.
+
+2003-06-02 Ben Elliston <bje@wasabisystems.com>
+
+ * config/arm/arm.c (arm_use_dfa_pipeline_interface): Declare.
+ (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define if not already.
+ (arm_use_dfa_pipeline_interface): Implement.
+ * config/arm/arm.md (arm): New automaton.
+ (write_buf): Remove function units; new cpu unit.
+ (write_blockage): Remove function units; new cpu unit.
+ (core): Remove function units; new cpu unit.
+ (r_mem_f_wbuf): New instruction reservation.
+ (store1_wbuf, store2_wbuf, store3_wbuf, store4_wbuf): Likewise.
+ (store1_ldsched, store2, store3, store4): Likewise.
+ (load_ldsched, load_ldsched_xscale, load_or_store): Likewise.
+ (mult, mult_ldsched, mult_ldsched_strongarm): Likewise.
+ (multi_cycle, single_cycle): Likewise.
+ * config/arm/fpa.md (armfp): New automaton.
+ (fpa): Remove function units; new cpu unit.
+ (fpa_mem): Remove function unit; new cpu unit.
+ (fdivx, fdivd, fdivs, fmul, ffmul, farith, ffarith): New reservations.
+ (r_2_f, f_2_r, f_load, f_store, r_mem_f, f_mem_r): Likewise.
+
+2003-06-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-attrs.def (ATTR_ASM_FPRINTF): New.
+ * c-format.c (enum format_type): Add asm_fprintf_format_type.
+ (NOARGUMENTS, asm_fprintf_length_specs, asm_fprintf_flag_specs,
+ asm_fprintf_flag_pairs, asm_fprintf_char_table): New.
+ (format_types_orig): Renamed from format_types. Add new data.
+ (format_types): Declare as pointer.
+ (handle_format_attribute): Move later in file so we have all
+ necessary declarations. Add section to capture HOST_WIDE_INT.
+ * output.h (ATTRIBUTE_ASM_FPRINTF, __gcc_host_wide_int__): New.
+ (asm_fprintf): Mark with ATTRIBUTE_ASM_FPRINTF.
+
+2003-06-01 Andreas Jaeger <aj@suse.de>
+
+ * doc/tm.texi (Storage Layout): Remove ROUND_TYPE_SIZE and
+ ROUND_TYPE_SIZE_UNIT.
+
+ * stor-layout.c (finalize_record_size): Remove usages of
+ ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.
+ (finalize_type_size): Likewise.
+ (layout_type): Likewise.
+
+ * system.h: Poison ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.
+
+ * loop.c (check_insn_for_givs): Remove DONT_REDUCE_ADDR macro.
+
+ * config/d30v/d30v.h: Remove text copied from the manual.
+
+2003-06-01 Roger Sayle <roger@eyesopen.com>
+ John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+ Geoffrey Keating <geoffk@apple.com>
+
+ * emit-rtl.c (gen_lowpart_common): Handle interpreting integer
+ constants as condition code values.
+
+2003-06-01 DJ Delorie <dj@redhat.com>
+
+ * cppmacro.c (warn_of_redefinition): Handle cases where the two
+ definitions have different numbers of tokens.
+
+2003-06-01 Andreas Jaeger <aj@suse.de>
+
+ * gen-protos.c (main): Readd unused attribute for argc.
+
+2003-06-01 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (c-options.c, c-options.h): Parallel make safe.
+ * c.opt: End in blank line.
+ * opts.sh: Take AWK from environment if available; use C locale.
+
+2003-06-01 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/linux.h: Remove code protected by USE_GNULIBC_1.
+
+2003-06-01 Andreas Jaeger <aj@suse.de>
+
+ * gen-protos.c (main): Revert patch to check for argument.
+
+2003-06-01 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/11044
+ * config/i386/i386.md (length attribute): Set length to 4
+ for instructions of type "fcmp".
+
+2003-06-01 Andreas Jaeger <aj@suse.de>
+
+ * toplev.c: Use ISO C90 prototypes.
+
+ * toplev.h: Use ISO C90 prototypes.
+
+ * genrecog.c: Use ISO C90 prototypes.
+ (nodes_identical): Correct declaration to match prototype.
+ (maybe_both_true): Likewise.
+ (merge_trees): Likewise.
+
+ * genpeep.c (gen_peephole): Remove #if 0 code.
+ Use ISO C90 prototypes.
+
+ * genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code.
+ Remove #if 0'ed function simplify_by_alternatives.
+ (optimize_attrs): Remove #if 0'ed code.
+ Remove ^L.
+ Use ISO C90 prototypes.
+ (make_canonical): Remove #if 0'ed code.
+ (convert_const_symbol_ref): Remove #if 0'ed function.
+
+ * gen-protos.c (main): Check for argument.
+
+ * rtl.h: Use ISO C90 prototypes for functions from lists.c.
+
+ * params.h: Use ISO C90 prototypes.
+ * params.c: Likewise.
+ * intl.c: Likewise.
+ * intl.h: Likewise.
+ * lists.c: Likewise.
+ * errors.c: Likewise.
+ * errors.h: Likewise.
+ * gencodes.c: Likewise.
+ * genpreds.c: Likewise.
+ * genattr.c: Likewise.
+ * gen-protos.c: Likewise.
+ * genflags.c: Likewise
+ * genconditions.c: Likewise.
+ * genautomata.c: Likewise.
+ * gencheck.c: Likewise.
+ * genconfig.c: Likewise.
+ * genconstants.c: Likewise.
+ * genemit.c: Likewise.
+ * genextract.c: Likewise.
+ * gengenrtl.c: Likewise.
+ * gengtype.c: Likewise.
+ * gengtype.h: Likewise.
+ * genopinit.c: Likewise.
+ * genoutput.c: Likewise.
+ * gensupport.c: Likewise.
+ * gensupport.h: Likewise.
+
+ * sdbout.h: Use ISO C90 prototypes.
+
+ * sdbout.c (CONTIN): Removed empty macro.
+ (sdbout_one_type): Remove CONTIN usages.
+ Remove ^Ls.
+ (tag_of_ru_type): Remove #if 0'ed function.
+ (sdbout_symbol): Remove #if 0'ed code.
+ (sdbout_one_type): Remove a #if 1.
+ (sdbout_one_type): Remove #if 0'ed code.
+ (sdbout_init): Remove RMS_QUICK_HACK_1 code.
+ Remove PARAMS, use ISO C90 prototypes for all functions.
+
+2003-06-01 Josef Zlomek <zlomekj@suse.cz>
+
+ * rtl.def (CONST_DOUBLE): Update comment.
+
+2003-06-01 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.sh: Remove path from sort.
+
+2003-06-01 Aldy Hernandez <aldyh@redhat.com>
+
+ PR/9680
+ * config/rs6000/rs6000.h (CANNOT_CHANGE_MODE_CLASS): Require
+ TARGET_SPE for SPE_VECTOR_MODE.
+
+2003-05-31 Aldy Hernandez <aldyh@redhat.com>
+
+ * toplev.c (botch): Remove.
+ (do_abort): Remove.
+ (set_Wunused): Comment.
+ (set_Wextra): Comment.
+ Remove ^L's.
+ (rest_of_compilation): Factor out common code into functions.
+ (rest_of_handle_inlining): New.
+ (rest_of_handle_ssa): New.
+ (rest_of_handle_cse): New.
+ (rest_of_handle_gcse): New.
+ (rest_of_handle_loop_optimize): New.
+ (rest_of_handle_jump_bypass): New.
+ (rest_of_handle_sibling_calls): New.
+ (rest_of_handle_null_pointer): New.
+ (rest_of_handle_addresof): New.
+ (rest_of_handle_flow): New.
+ (rest_of_handle_branch_prob): New.
+ (rest_of_handle_if_conversion): New.
+ (rest_of_handle_tracer): New.
+ (rest_of_handle_loop2): New.
+ (rest_of_handle_cse2): New.
+ (rest_of_handle_life): New.
+ (rest_of_handle_combine): New.
+ (rest_of_handle_if_after_combine): New.
+ (rest_of_handle_regmove): New.
+ (rest_of_handle_sched): New.
+ (rest_of_handle_old_regalloc): New.
+ (rest_of_handle_new_regalloc): New.
+ (rest_of_handle_regrename): New.
+ (rest_of_handle_reorder_blocks): New.
+ (rest_of_handle_sched2): New.
+ (rest_of_handle_new_regalloc): New.
+ (rest_of_handle_old_regalloc): New.
+ (rest_of_handle_regrename): New.
+ (rest_of_handle_reorder_blocks): New.
+ (rest_of_handle_stack_regs): New.
+ (rest_of_handle_machine_reorg): New.
+ (rest_of_handle_delay_slots): New.
+ (rest_of_handle_final): New.
+
+ * toplev.h (botch): Remove prototype.
+ (do_abort): Same.
+
+2003-05-31 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (c-opts.o, c-options.h): Update dependencies.
+ * c-opts.c: Include c-options.h and c-options.c.
+ (CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
+ Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
+ (CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
+ OPT, opt_comp): Remove.
+ (missing_arg, c_common_init_options, c_common_decode_option,
+ write_langs): Update for macro redefinitions and enumeration
+ name changes.
+ * c.opt, opts.sh: New files.
+ * doc/passes.texi: Update.
+
+2003-05-31 Andreas Jaeger <aj@suse.de>
+
+ * function.c (trampoline_address): Remove ALLOCATE_TRAMPOLINE
+ usage.
+
+ * doc/tm.texi (Trampolines): Remove ALLOCATE_TRAMPOLINE.
+
+ * config/d30v/d30v.h: Remove traces of ALLOCATE_TRAMPOLINE.
+
+ * system.h: Poison ALLOCATE_TRAMPOLINE.
+
+ * doc/tm.texi (Misc): Remove HANDLE_PRAGMA.
+ * system.h: Poison HANDLE_PRAGMA.
+
+2003-05-31 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Update dump file names.
+
+2003-05-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-format.c (format_length_info, format_char_info,
+ format_flag_spec, format_flag_pair, format_kind_info):
+ De-const-ify structure members.
+
+2003-05-31 Roger Sayle <roger@eyesopen.com>
+
+ * flags.h (flag_wrapv): New flag controlling overflow semantics.
+ * toplev.c (flag_wrapv): Declare the variable with default false.
+ (lang_independent_options): New option "-fwrapv" to set the above.
+
+ * fold-const.c (extract_muldiv_1): Disable optimization of (2*x)/2
+ as x, when signed arithmetic overflow wraps around.
+ (fold): Optimize "-A - B" as "-B - A" if overflow wraps around.
+ * loop.c (basic_induction_var): Ignore BIVs that rely on undefined
+ overflow when flag_wrapv is true.
+
+ * doc/invoke.texi: Document new -fwrapv command line option.
+ * doc/c-tree.texi: Mention that the overflow semantics of
+ NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR and MULT_EXPR is dependent
+ upon both flag_wrapv and flag_trapv.
+
+2003-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/install.texi (mips-sgi-irix5): Add missing
+ HTML <hr> marker.
+
+2003-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/md.texi (Machine Constraints): Document
+ missing SPARC constraints.
+
+2003-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/md.texi (Automaton pipeline description): Use
+ "type" instead of "cpu" as the attribute in the examples.
+
+2003-05-30 Stan Shebs <shebs@apple.com>
+
+ * system.h: Poison OBJC_PROLOGUE.
+
+2003-05-30 Roger Sayle <roger@eyesopen.com>
+
+ * emit-rtl.c (gen_complex_constant_part): New function for getting
+ the constant real or imaginary part of a complex constant.
+ (gen_realpart): Use it.
+ (gen_imagpart): Likewise.
+
+2003-05-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Fix typos.
+ * doc/rtl.texi: Likewise.
+
+2003-05-30 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * config/h8300/crti.asm: Use .h8300hn and .h8300sn for normal
+ mode.
+ * config/h8300/crtn.asm: Likewise.
+ * config/h8300/lib1funcs.asm: Likewise.
+ * config/h8300/h8300.c (asm_file_start): Likewise.
+ * config/h8300/elf.h (LINK_SPEC): Use h8300hnelf and
+ h8300snelf emulations for normal mode.
+ * config/h8300/h8300.h (LINK_SPEC): Use h8300hn and h8300sn
+ emulations for normal mode.
+
+2003-05-30 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * config/h8300/h8300.c (h8300_tiny_constant_address_p): Return
+ true if TARGET_NORMAL_MODE.
+
+2003-05-30 Roger Sayle <roger@eyesopen.com>
+
+ * cse.c (cse_insn): Simplify REG_EQUAL note on libcalls when
+ making a substitution.
+ (dead_libcall_p): If directly replacing a libcall with a
+ constant value produces an invalid instruction, also try forcing
+ the constant into the constant pool.
+ * expr.c (emit_move_insn): Add a REG_EQUAL note when it is not
+ obvious that the source is a constant.
+ (compress_float_constant): Use set_unique_reg_note to place
+ REG_EQUAL notes on instructions.
+
+2003-05-30 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips.c (extern_list): Add GTY marker.
+ (extern_head): Separate out definition. Add marker.
+ (mips_output_external): Use ggc_alloc for extern_list
+ allocation.
+ (mips_output_external_libcall): Ditto.
+
+2003-05-30 Florian Weimer <fw@deneb.enyo.de>
+
+ * doc/install.texi: Ada-enabled bootstrap requires GNAT 3.14 or
+ later.
+
+2003-05-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * vax.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier
+ warnings.
+ (PRINT_OPERAND): Likewise.
+
+2003-05-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Move
+ -mdebug/-no-mdebug switches ...
+ (MDEBUG_ASM_SPEC): ... here.
+ Use only with gas.
+ (EXTRA_SPECS): Initialize mdebug_asm_spec.
+
+2003-05-29 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * gthr-gnat.c: Remove #undef UNUSED.
+ (__gnat_default_lock, __gnat_default_unlock): Prototype.
+ (__gnat_task_lock, __gnat_task_unlock): Make declarations
+ prototypes.
+ (__gnat_install_locks): Convert declaration to ISO C90, make
+ parameter declarations prototypes, and remove blank line.
+ * gthr-gnat.h (__gnat_install_locks): Make parameter
+ declarations prototypes.
+
+2003-05-29 Jason Merrill <jason@redhat.com>
+
+ * Makefile.in (unstrap): Remove stage_last after make unstage1.
+
+2003-05-29 Roger Sayle <roger@eyesopen.com>
+
+ * mips-tfile.c (PAGE_SIZE): Increase page size to 32K.
+
+2003-05-29 Roger Sayle <roger@eyesopen.com>
+ Kaveh Ghazi <ghazi@caip.rutgers.edu>
+
+ PR bootstrap/10169
+ * mips-tfile.c (main): Use getopt_long instead of getopt.
+ Add new command line option --version to display version.
+ Treat --verbose like -v to report a single line version.
+ (options): New global variable for getopt_long.
+ * mips-tdump.c (main): Use getopt_long instead of getopt.
+ New command line options -v, --version and -verbose to display
+ the program version number (to match mips-tfile's behavior).
+ (options): New global variable for getopt_long.
+
+ * gcov.c (options): Zero-terminate getopt_long array.
+ * gcov-dump.c (options): Likewise.
+
+ * Makefile.in (mips-tdump.o): Add dependency on version.h.
+
+2003-05-29 Stan Shebs <shebs@apple.com>
+
+ Remove OBJC_PROLOGUE everywhere.
+ * objc/objc-act.c (finish_objc): Remove use of OBJC_PROLOGUE.
+ * config/avr/avr.h: Remove no-op ref to OBJC_PROLOGUE.
+ * config/d30v/d30v.h: Similarly.
+ * config/ip2k/ip2k.h: Similarly.
+ * doc/tm.texi: Remove doc of OBJC_PROLOGUE.
+
+2003-05-29 Roger Sayle <roger@eyesopen.com>
+
+ * c-semantics.c (genrtl_do_stmt_1): New function split out from...
+ (gen_rtl_do_stmt): ... here. Call genrtl_do_stmt_1.
+ (expand_unreachable_stmt): Expand unreachable while statements
+ using genrtl_do_stmt_1.
+
+2003-05-29 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_output_load_label): Declare.
+ * config/mips/mips.c (mips_output_load_label): New function.
+ (mips_output_conditional_branch): Use it.
+ * config/mips/mips.md (jump): And here.
+
+2003-05-28 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa-protos.h (smalloffset_double_mem_p): Delete.
+ (xtensa_split_operand_pair): New proto.
+ * config/xtensa/xtensa.c (move_operand): Handle DFmode and DImode.
+ (smalloffset_double_mem_p): Delete.
+ (gen_float_relational, printx, print_operand, xtensa_va_arg):
+ Fix whitespace.
+ (xtensa_split_operand_pair): New.
+ (xtensa_dbx_register_number): Fix formatting.
+ * config/xtensa/xtensa.h (EXTRA_CONSTRAINT): Remove 'S' constraint.
+ * config/xtensa/xtensa.md (movdi, movdf): Force constants to memory
+ instead of splitting them into single-word moves. Remove unnecessary
+ checks for reload_in_progress and reload_completed.
+ (movdi_internal, movdf_internal): Change to post-reload split patterns.
+ Add constraints to allow constant operands.
+ (movsf_internal): Allow CONST_INT operands.
+
+2003-05-27 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config.gcc (i[34567]86-*-mingw32*): Add host makefile
+ fragment i386/x-mingw32.
+ * config/i386/x-mingw32: New file. Make local_includedir
+ relative to EXEC_PREFIX.
+
+2003-05-27 Aaron W. LaFramboise <awlaframboise@aol.com>
+
+ * config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Update.
+ (MD_STARTFILE_PREFIX): Define.
+
+2003-05-27 Denis Chertykov <denisc@overta.ru>
+
+ * cselib.c (cselib_invalidate_regno): Abort if hardreg have a
+ VOIDmode.
+ * cselib.c (cselib_process_insn): Pass reg_raw_mode for hardreg in
+ call of cselib_invalidate_regno.
+
+2003-05-28 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/mips/linux.h (LIB_SPEC): Add missing -lc and correct
+ -lthread to -lpthread.
+
+2003-05-28 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Bruce Korb <bkorb@gnu.org>
+ Arno Klaassen <arno@heho.snv.jussieu.fr>
+
+ * fixinc/inclhack.def: Add missing declaration of getpagesize()
+ to unistd.h on Solaris 2.5.1.
+ Fix prototype of recv() and send() in sys/socket.h on
+ Solaris 2.5.1 and 2.6.
+ * fixinc/tests/base/unistd.h: Add solaris_unistd fix test.
+ * fixinc/tests/base/sys/socket.h: Add solaris_socket test.
+ * fixinc/check.tpl: Use 'diff -c', not 'diff -u'.
+ * fixinc/fixincl.x: Regenerate.
+
+2003-05-27 Jason Merrill <jason@redhat.com>
+
+ * tree.c (expr_first, expr_length): New fns.
+ * tree.h: Declare them.
+
+ * tree.c (iterative_hash_expr): Hash commutative expressions
+ consistently.
+
+2003-05-27 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * tree.h (contains_placeholder_p): Now returns bool.
+ (CONTAINS_PLACEHOLDER_P): New macro.
+ (type_contains_placeholder_p): New function.
+ * tree.c (save_expr): Remove code avoiding folding COMPONENT_REF.
+ (contains_placeholder_p): Now returns bool.
+ Rework to use CONTAINS_PLACEHOLDER_P macro.
+ (type_contains_placeholder_p): New function.
+ * fold-const.c (fold, case COMPONENT_REF): Don't fold if
+ type_contains_placeholder_p.
+ (fold_range_test, fold_mathfn_compare, fold_inf_compare, fold):
+ Use CONTAINS_PLACEHOLDER_P macro.
+ * builtins.c (fold_builtin): Likewise.
+ * calls.c (initialize_argument_information): Likewise.
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
+ * explow.c (expr_size): Likewise.
+ * expr.c (store_constructor, get_inner_reference): Likewise.
+ * function.c (assign_parms): Likewise.
+ * stor-layout.c (variable_size): Likewise.
+
+2003-05-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.h (output_verbatim, verbatim): Remove printf
+ attribute.
+
+2003-05-25 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Update Kean Johnston.
+
+2003-05-24 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md (save_fpregs_{si,di}): Add length attribute.
+
+2003-05-24 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/rs6000/440.md, config/stormy16/stormy16protos.h,
+ config/stormy16/stormy16.c, config/stormy16/stormy16.md:
+ Replace "GNU CC" with "GCC".
+
+2003-05-24 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * builtins.c (expand_builtin_memcpy): Use mode of dest_addr for
+ intermediate computation.
+
+2003-05-23 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips.md (clzsi, clzdi): New patterns.
+
+2003-05-23 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.c (default_compilers): Use -o to specify preprocessor's output
+ file. Make -no-integrated-cpp work when building PCH files.
+ * objc/lang-specs.h: Likewise.
+
+2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/Makefile.in: Correct description.
+ * fixinc/Makefile.in, fixinc/fixfixes.c, fixinc/fixincl.c,
+ fixinc/fixlib.c, fixinc/fixlib.h, fixinc/fixtests.c,
+ fixinc/genfixes: Replace "GNU CC" with "GCC".
+
+2003-05-23 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def: Define atan, atanf, atanl, tan, tanf and tanl
+ builtin functions (and their __builtin_* variants).
+ * builtins.c (mathfn_built_in): Handle tan{,f,l} and atan{,f,l}.
+ (expand_builtin): Don't expand tan{,f,l} or atan{,f,l} when not
+ optimizing.
+
+ * doc/extend.texi: Document new tan and atan builtins, and
+ their float and long double variants.
+
+2003-05-23 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define
+ __sparcv9 in the TARGET_ARCH64 case.
+
+Fri May 23 22:17:32 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_reorg): Calls are also jumps.
+
+2003-05-23 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * cse.c (count_reg_usage): When processing an INSNs REG_EQUAL
+ note containing an EXPR_LIST, process all the arguments.
+
+Fri May 23 21:19:31 CEST 2003 Jan Hubicka <jh@suse.cz>
+ Andreas Jaeger <aj@suse.de>
+
+ * i386.h (TARGET_CPU_CPP_BUILTINS): Define __amd64 and __amd64__;
+ do not use assertion.
+
+2003-05-23 Mike Stump <mrs@apple.com>
+
+ * tlink.c (scan_linker_output): Add support for darwin linker, as it
+ emits unresolved symbols one per line, consuming the entire line.
+
+2003-05-23 Larin Hennessy <larin@science.oregonstate.edu>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * explow.c (allocate_dynamic_stack_space): Remove call to gen_probe.
+ * config/m68k/m68k.c (m68k_output_function_prologue):
+ Remove code under #if NEED_PROBE.
+ * config/m68k/m68k.h: Don't define NEED_PROBE.
+ * config/m68k/m68k.md: Remove "probe" insn.
+ * doc/md.texi: Remove documentation of "probe" pattern.
+
+2003-05-23 Dorit Naishlos <gcchaifa@il.ibm.com>
+
+ * config/rs6000/rs6000.md (save_fpregs_{si,di}): Add branch attribute.
+
+2003-05-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/install.texi: Remove sparc64-*-*. Add sparc64-*-solaris2*.
+ Document sparcv9-*-solaris2* as a synonym for sparc64-*-solaris2*.
+
+2003-05-22 Roger Sayle <roger@eyesopen.com>
+
+ * real.c (real_maxval): New function to return the largest finite
+ value representable in a given mode (i.e. FLT_MAX and DBL_MAX).
+ * real.h (real_maxval): Prototype here.
+ * fold-const.c (fold_inf_compare): Transform comparisons against
+ +-Infinity into comparisons against DBL_MAX (or equivalent).
+
+2003-05-22 Mike Stump <mrs@apple.com>
+
+ * config.gcc (*-*-darwin*): Remove use_collect2=no, as it is the
+ default.
+
+2003-05-22 DJ Delorie <dj@redhat.com>
+
+ * calls.c (expand_call): If the arg block is going to grow
+ downward, we need argblock to point to the top of the block,
+ not the bottom.
+
+2003-05-22 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * c-decl.c (duplicate_decls): Test DECL for ERROR_MARK.
+
+ * expr.c (expand_expr, case CONSTRUCTOR): Put into memory if
+ constant and EXPAND_CONST_ADDRESS, not just EXPAND_INITIALIZER.
+
+2003-05-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * m68hc11.c: Don't use the `0' flag for asm_fprintf specifiers.
+ * m68k.c: Likewise.
+ * m68k.h: Likewise.
+
+2003-05-22 Zack Weinberg <zack@codesourcery.com>
+
+ PR other/2873
+ * fixinc/inclhack.def (avoid_wchar_t_type): Add bypass
+ expressions to prevent triggering on recent curses.h,
+ linux/nls.h, or X11/Xlib.h.
+ (stdio_va_list): Add _G_va_list to bypass pattern.
+ (strict_ansi_not): Add bypass pattern for __SCO_VERSION__.
+ * fixinc/fixincl.x: Regenerate.
+
+2003-05-22 Rekha Bhintade <rekhad@kpitcummins.com>
+
+ * gcc/config/sh/sh.h (TARGET_SWITCHES): Display all the target
+ switches when --target-help option is specified.
+
+2003-05-22 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR bootstrap/10805
+ * doc/install.texi (sparc-sun-solaris2.7): Document bootstrap
+ failure with Sun assembler 5.0 Alpha 03/27/98.
+
+2003-05-21 Loren James Rittle <ljrittle@acm.org>
+
+ * config/sparc/freebsd.h (CPP_CPU64_DEFAULT_SPEC): Add -D__sparcv9
+ to match system compiler convention.
+
+2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * gthr-win32.h (__GTHREAD_HIDE_WIN32API): Test for nonzero
+ value, not just if defined.
+ Update copyright year.
+
+2003-05-21 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/6428
+ * pa-hpux10.h (LINK_SPEC, LIB_SPEC): Move -L options for profiling
+ directories from LIB_SPEC to LINK_SPEC. Emit warning if `-p' or `-pg'
+ option is used without `-static'.
+ * pa-hpux11.h (LINK_SPEC, LIB_SPEC): Likewise.
+ * pa64-hpux.h (LINK_SPEC, LIB_SPEC): Likewise.
+
+2003-05-21 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.h (MASK_SERIALIZE_VOLATILE,
+ TARGET_SERIALIZE_VOLATILE): Delete.
+ (MASK_CONST16, MASK_ABS, MASK_ADDX): Renumber flag bits.
+ (TARGET_DEFAULT): Remove MASK_SERIALIZE_VOLATILE.
+ (TARGET_SWITCHES): Remove "-mserialize-volatile" and
+ "-mno-serialize-volatile".
+ * config/xtensa/xtensa.c (print_operand): Remove checks of
+ TARGET_SERIALIZE_VOLATILE.
+ * config/xtensa/xtensa.md (*lsiu, *ssiu): Likewise.
+ * doc/invoke.texi (Option Summary, Xtensa Options): Remove
+ "-mserialize-volatile" and "-mno-serialize-volatile" options.
+
+2003-05-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-parse.in (fndef): Set DECL_SOURCE_LINE and FILE earlier.
+ (nested_function): Likewise.
+ (notype_nested_function): Likewise.
+
+2003-05-21 Nick Clifton <nickc@redhat.com>
+
+ * config/stormy16/stormy-abi: Update overflow type for
+ R_XSTORMY16_16 reloc.
+
+2003-05-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-common.h (enum rid): Remove RID_BOUNDED, RID_UNBOUNDED.
+ * c-parse.in (reswords): Remove __bounded__ and __unbounded__.
+ (rid_to_yy): Remove RID_BOUNDED, RID_UNBOUNDED slots.
+ * print-tree.c (print_node): Remove ambient-boundedness.
+ * tree.h (tree_common): Remove bounded_flag.
+ (BOUNDED_INDIRECT_YPE_P, BOUNDED_POINTER_TYPE_P,
+ BOUNDED_REFERENCE_TYPE_P, MAYBE_BOUNDED_INDIRECT_TYPE_P,
+ MAYBE_BOUNDED_POINTER_TYPE_P, MAYBE_BOUNDED_REFERENCE_TYPE_P,
+ TREE_BOUNDED, TYPE_MAIN_VARIANTS_PHYSICALLY_EQUAL_P,
+ TYPE_MAIN_PHYSICAL_VARIANT, TYPE_BOUNDED, TYPE_QUAL_BOUNDED):
+ Remove.
+ (TYPE_QUALS): Remove BOUNDED.
+ (TREE_EXPR_QUALS, TREE_FUNC_QUALS): Remove.
+ (TYPE_BOUNDED_VALUE, TYPE_BOUNDED_BASE, TYPE_BOUNDED_EXTENT,
+ TYPE_BOUNDED_SUBTYPE, TYPE_UNBOUNDED_VARIANT, TYPE_POINTER_DEPTH,
+ TYPE_AMBIENT_BOUNDEDNESS, MAX_POINTER_DEPT,
+ VA_LIST_POINTER_DEPTH): Remove.
+ (struct tree_type): Remove pointer_depth.
+
+2003-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-pretty-print.c (pp_c_integer_literal): Use
+ HOST_WIDE_INT_PRINT_DOUBLE_HEX.
+
+2003-05-20 Roger Sayle <roger@eyesopen.com>
+ Kazu Hirata <kazu@cs.umass.edu>
+ Joern Rennecke <joern.rennecke@superh.com>
+
+ * gcse.c (cprop_jump): Make use of REG_EQUAL notes on both
+ setcc and jump, if they exist. If substituted instruction
+ fails to validate, store current effort in a REG_EQUAL note.
+ (cprop_insn): Don't attempt further substitutions if the
+ current instruction has been deleted.
+ (local_cprop_pass): Likewise.
+
+ * jump.c (redirect_jump): Also update REG_EQUAL note, if
+ one is attached to the jump instruction.
+ (invert_jump): Delete REG_EQUAL note on jump, if one exists.
+
+2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR c++/9738
+ * config/i386/winnt.c (i386_pe_encode_section_info): Enable
+ even if not first.
+
+2003-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * genautomata.c (output_description, output_automaton_units,
+ output_state_arcs): Add missing specifiers.
+
+2003-05-20 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/lib1funcs.asm: Avoid use of .Lfe* in .size directives.
+ (do_abs, do_addx2, do_addx4, do_addx8): New assembler macros.
+ (__mulsi3): Use do_addx* instead of ADDX* instructions. Formatting.
+ (nsau): Rename to do_nsau. Provide alternate version for use when
+ the NSAU instruction is available.
+ (__udivsi3, __divsi3, __umodsi3, __modsi3): Use do_nsau macro.
+ (__divsi3, __modsi3): Use do_abs macro instead of ABS instruction.
+ * config/xtensa/xtensa-config.h: Update comments to match binutils.
+ (XCHAL_HAVE_ABS, XCHAL_HAVE_ADDX): Define.
+ * config/xtensa/xtensa.h (MASK_ABS, MASK_ADDX): Define.
+ (TARGET_ABS, TARGET_ADDX): Define.
+ (TARGET_DEFAULT): Conditionally add MASK_ABS and MASK_ADDX.
+ (TARGET_SWITCHES): Add "abs", "no-abs", "addx", and "no-addx".
+ * config/xtensa/xtensa.md (*addx2, *addx4, *addx8, *subx2, *subx4,
+ *subx8): Set predicate condition to TARGET_ADDX.
+ (abssi2): Set predicate condition to TARGET_ABS.
+ * doc/invoke.texi (Option Summary): Document new "-mabs", "-mno-abs",
+ "-maddx", and "-mno-addx" options.
+ (Xtensa Options): Likewise. Also tag some opcode names with @code.
+
+2003-05-20 Kevin Ryde <user42@zip.com.au>
+ Wolfgang Bangerth <bangerth@dealii.org>
+
+ PR/10355
+ * doc/extend.texi: Put a warning into the documentation
+ of attribute regparm.
+
+2003-05-20 Jason Merrill <jason@redhat.com>
+
+ * tree.c (expr_last): New fn.
+ * tree.h: Declare it.
+ * objc/objc-act (expr_last): Rename to objc_expr_last.
+
+2003-05-20 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (sh_register_move_cost): Add clase for moving between
+ FP registers and MAC registers.
+
+2003-05-19 John David Anglin <dave.anglin@nrc-gnrc.gc.ca>
+
+ * pa/milli64.S ($$mulI): Fix typo.
+
+2003-05-19 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p)
+ (nonlocal_set_p): Remove initial blank line.
+ * dwarf2out.c (simple_type_size_in_bits): Likewise.
+ * et-forest.c (et_forest_create): Likewise.
+ * explow.c (stabilize): Likewise.
+ * fix-header.c (write_lbrac): Likewise.
+ * graph.c (start_fct, node_data): Likewise.
+ * jump.c (only_sets_cc0_p, sets_cc0_p): Likewise.
+ * rtlanal.c (global_reg_mentioned_p): Likewise.
+ * tree.c (bit_position): Likewise.
+
+2003-05-19 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mips/linux64.h (LIB_SPEC): Add missing -lc and correct
+ -lthread to -lpthread.
+
+2003-05-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (c_common_decode_option): Don't accept dollars
+ as identifier characters in assembly.
+ * doc/cpp.texi: Document this.
+
+2003-05-19 Seth Arnold <sarnold@wirex.com>
+ Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_stack_info): Do not add
+ vrsave_size twice.
+
+2003-05-19 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/tm.texi (function_arg): Fix typo.
+
+2003-05-19 Matt Austern <austern@apple.com>
+
+ * c-opts.c (COMMAND_LINE_OPTIONS): Add -Winvalid-offsetof option.
+ * c-common.h (warn_invalid_offsetof): Declare.
+ * c-common.c (warn_invalid_offsetof): Define.
+ * doc/invoke.texi: Document -Winvalid-offsetof.
+ * testsuite/g++.dg/other/offsetof3.C: New.
+ * testsuite/g++.dg/other/offsetof4.C: New.
+
+2003-05-19 Kevin B. Hendricks <kevin.hendricks@sympatico.ca>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_alignment_string,
+ rs6000_alignment_flags): New variables.
+ (rs6000_parse_alignment_option): New function.
+ (rs6000_override_options): Call it.
+ * config/rs6000/rs6000.h (TARGET_OPTIONS): Add -malign-XXX option.
+ (MASK_ALIGN_POWER, MASK_ALIGN_NATURAL, TARGET_ALIGN_NATURAL): New
+ macros.
+ * config/rs6000/aix.h (ADJUST_FIELD_ALIGN): Always use COMPUTED
+ natural alignment if TARGET_NATURAL_ALIGNMENT
+ (ROUND_TYPE_ALIGN): Always use default record alignment if
+ TAGET_NATURAL_ALIGNMENT.
+ * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Same
+ (ROUND_TYPE_ALIGN): Same.
+ * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Same
+ (ROUND_TYPE_ALIGN): Same.
+ * doc/invoke.texi (Option Summary, PowerPC Options): Document
+ new options.
+
+2003-05-19 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * c-decl.c (finish_decl): When setting the DECL_ASSEMBLER_NAME
+ of a function using ASMSPEC, prepend a star.
+
+2003-05-19 Jason Merrill <jason@redhat.com>
+
+ * tree-inline.c (copy_body_r): Avoid generating &* during inline
+ substitution.
+
+2003-05-19 Andrew Macleod <amacleod@redhat.com>
+
+ * config/stormy16/stormy16.c (xstormy16_expand_prologue): Do
+ not mark assignments to the hard frame pointer as being stack
+ frame related.
+ (xstormy16_expand_epilogue): Mark adjustments to the stack
+ pointer as being stack frame related.
+
+2003-05-19 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (ISA_HAS_LOAD_DELAY, ISA_HAS_XFER_DELAY,
+ ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): New macros.
+ (PREDICATE_CODES): Add hilo_operand.
+ * config/mips/mips.c (hilo_operand): New predicate.
+ (mips_adjust_insn_length): Account for the number nops that might
+ be needed to avoid hardware hazards.
+ * config/mips/mips.md (dslot): Remove attribute.
+ (hazard): New attribute.
+ (can_delay): Use it. Check for calls, branches & jumps.
+ (muldi3): Use the standard dmult pattern for mips16 code.
+ (muldi3_internal, muldi3_internal2): Adjust conditions accordingly.
+
+2003-05-19 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (final_prescan_insn,
+ mips_count_memory_refs, mips_fill_delay_slot): Remove.
+ * config/mips/mips.h (delay_type, dslots_load_total,
+ dslots_load_filled, dslots_jump_total, dslots_jump_filled,
+ dslots_number_nops, num_refs, mips_load_reg, mips_load_reg2,
+ mips_load_reg3, mips_load_reg4): Remove.
+ (MASK_STATS): Remove.
+ (MASK_EXPLICIT_RELOCS): Reuse its value.
+ (TARGET_STATS): Remove.
+ (TARGET_SWITCHES): Turn -mstats and -mno-stats into no-ops.
+ Warn that -mstats is now ignored.
+ (FINAL_PRESCAN_INSN): Undefine.
+ (DBR_OUTPUT_SEQEND): Remove handling of dslot statistics.
+ (ASM_OUTPUT_REG_POP): Likewise.
+ * config/mips/mips.c (dslots_load_total, dslots_load_filled,
+ dslots_jump_total, dslots_jump_filled, dslots_number_nops, num_refs,
+ mips_load_reg, mips_load_reg2, mips_load_reg3, mips_load_reg4,
+ mips_fill_delay_slot, mips_count_memory_refs,
+ final_prescan_insn): Remove.
+ (output_block_move): Remove calls to mips_count_memory_refs.
+ (print_operand): Remove printing of #nop for TARGET_STATS.
+ (mips_output_function_epilogue): Remove TARGET_STATS code.
+ Reorganize setting of fnnmae.
+ * config/mips/mips.md: Remove handling of dslot statistics
+ throughout file. Change all fcmp patterns into normal asm
+ templates, removing calls to mips_fill_delay_slot.
+ * doc/invoke.texi: Remove documentation of -mstats.
+
+2003-05-19 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_class_max_nregs): Return the number of
+ words in the mode.
+
+2003-05-19 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (override_options): Disable explicit
+ relocs for old ABIs unless using gas.
+
+2003-05-18 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips.h: Remove definition of g_switch_value.
+
+2003-05-18 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * flags.h (g_switch_value): Change to an unsigned
+ HOST_WIDE_INT.
+ * toplev.c (g_switch_value): Likewise.
+
+ * config/alpha/alpha.c (small_symbolic_operand): Remove
+ g_switch_value cast.
+ (alpha_in_small_data_p): Cast size to an unsigned
+ HOST_WIDE_INT.
+
+ * config/frv/frv.c (frv_in_small_data_p): Cast size to an
+ unsigned HOST_WIDE_INT.
+ * config/frv/frv.h (g_switch_value, g_switch_set): Remove.
+ (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Declare g_switch_set.
+
+ * config/m32r/m32r.c (m32r_in_small_data_p): Cast size to an
+ unsigned HOST_WIDE_INT.
+ (m32r_asm_file_start): Use HOST_WIDE_INT_PRINT_UNSIGNED.
+ * config/m32r/m32r.h (g_switch_value, g_switch_set): Remove.
+ (ASM_OUTPUT_ALIGNED_COMMON): Declare g_switch_value.
+
+ * config/rs6000/rs6000.c (rs6000_file_start): Use
+ HOST_WIDE_INT_PRINT_UNSIGNED.
+ (small_data_operand): Cast summand to unsigned HOST_WIDE_INT.
+ (rs6000_elf_in_small_data_p): Cast size to unsigned
+ HOST_WIDE_INT.
+ * config/rs6000/sysv4.h (g_switch_value, g_switch_set):
+ Remove.
+ (SUBTARGET_OVERRIDE_OPTIONS): Declare g_switch_value and
+ g_switch_set.
+ (ASM_OUTPUT_ALIGNED_LOCAL): Declare g_switch_value and remove
+ g_switch_value cast.
+
+2003-05-18 Roger Sayle <roger@eyesopen.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ PR middle-end/10472
+ * builtins.c (expand_builtin_memcpy): Call force_operand on
+ expressions and use simplify_gen_binary to create the addition.
+
+2003-05-18 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/m68k.md: Use define_constants for unspec numbers.
+
+2003-05-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/sparc/sparc.h: Define sparc for now.
+
+2003-05-18 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Clear xm_file, md_file at the beginning of each pass.
+
+ * config/stormy16/stormy16.h: Remove about 3000 lines of
+ target-independent comments. Update copyright notice.
+
+ * doc/collect2.texi: GNU CC -> GCC.
+ * doc/headerdirs.texi: GNU CC -> GCC.
+
+2003-05-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * hashtable.h (struct ht_identifier): Add data member "hash_value".
+ * hashtable.c (ht_lookup): Use it when searching, remember.
+ (ht_expand): Do not recompute.
+ * tree.h (IDENTIFIER_HASH_VALUE): New macro.
+
+2003-05-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov-io.c (gcov_read_bytes): Fix fread thinko.
+
+2003-05-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-cppbuiltin.c (TARGET_OS_CPP_BUILTINS, TARGET_OBJFMT_CPP_BUILTINS):
+ Default here.
+ (c_cpp_builtins): Invoke TARGET_OBJFMT_CPP_BUILTINS().
+ * defaults.h: Don't default TARGET_OS_CPP_BUILTINS here.
+ * config/elfos.h (TARGET_OBJFMT_CPP_BUILTINS): Define __ELF__.
+ * config/freebsd-spec.h, config/netbsd-elf.h, config/alpha/gnu.h,
+ config/arm/linux-elf.h, config/arm/rtems-elf.h,
+ config/arm/unknown-elf.h, config/cris/cris.h, config/cris/linux.h,
+ config/h8300/elf.h, config/i370/linux.h, config/i386/beos-elf.h,
+ config/i386/gnu.h, config/i386/linux.h, config/i386/linux64.h,
+ config/i386/moss.h, config/i386/rtemself.h, config/ia64/ia64.h,
+ config/m68k/rtemself.h, config/mcore/mcore-elf.h, config/mips/linux.h,
+ config/pa/pa-linux.h, config/rs6000/linux.h, config/rs6000/linux64.h,
+ config/rs6000/sysv4.h, config/rs6000/vxworks.h, config/s390/linux.h,
+ config/sh/coff.h, config/sh/elf.h, config/sh/rtemself.h,
+ config/sh/sh.h, config/sparc/linux.h, config/sparc/linux64.h,
+ config/sparc/openbsd64.h, config/sparc/sp64-elf.h,
+ config/sparc/sp86x-elf.h, config/xtensa/elf.h, config/xtensa/linux.h:
+ Don't define __ELF__.
+ * config/alpha.h, config/m68k/linux.h (TARGET_OBJFMT_CPP_BUILTINS):
+ Define __ELF__.
+ * doc/cpp.texi: Document __ELF__.
+ * doc/tm.texi: Document TARGET_OBJFMT_CPP_BUILTINS. *
+
+2003-05-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
+ always use stdarg.
+ * c-errors.c (pedwarn_c99): Likewise.
+ * c-format.c (status_warning): Likewise.
+ * c-semantics.c (build_stmt): Likewise.
+ * calls.c (emit_library_call, emit_library_call_value): Likewise.
+ * collect2.c (notice, fatal_perror, fatal, error): Likewise.
+ * cpperror.c (cpp_error, cpp_error_with_line): Likewise.
+ * diagnostic.c (build_message_string, output_printf,
+ output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
+ fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
+ error_with_decl, fnotice): Likewise.
+ * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
+ dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
+ dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
+ dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
+ dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
+ dw2_asm_output_encoded_addr_rtx): Likewise.
+ * emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
+ * errors.c (warning, error, fatal, internal_error): Likewise.
+ * final.c (output_operand_lossage, asm_fprintf): Likewise.
+ * fix-header.c (fatal): Likewise.
+ * gcc.c (fatal, error, notice): Likewise.
+ * gcov.c (fnotice): Likewise.
+ * genattrtab.c (attr_rtx, attr_printf): Likewise.
+ * gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
+ * gensupport.c (message_with_line): Likewise.
+ * mips-tfile.c (fatal, error): Likewise.
+ * protoize.c (notice): Likewise.
+ * ra-debug.c (ra_debug_msg): Likewise.
+ * read-rtl.c (fatal_with_file_and_line): Likewise.
+ * rtl-error.c (error_for_asm, warning_for_asm): Likewise.
+ * tree.c (build, build_nt, build_function_type_list): Likewise.
+
+2003-05-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * defaults.h (TARGET_CPU_CPP_BUILTINS, CPP_PREDEFINES): Remove.
+ * gcc.c (cpp_predefines): Remove.
+ (cpp_unique_options, do_spec_1): Remove handling of CPP_PREDEFINES.
+ (static_specs): Remove predefines.
+ * system.h: Poison CPP_PREDEFINES.
+ * config/freebsd.h, config/openbsd.h, config/ptx4.h, config/svr3.h,
+ config/svr4.h, doc/tm.texi: Remove references to CPP_PREDEFINES.
+
+2003-05-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/m68k/hp320.h, config/m68k/linux.h, config/m68k/m68k-none.h,
+ config/m68k/m68k.h, config/m68k/m68kemb.h, config/m68k/m68kv4.h,
+ config/m68k/openbsd.h, config/m68k/rtemself.h: Remove CPP_PREDEFINES,
+ use TARGET_OS_CPP_BUILTINS and TARGET_CPU_CPP_BUILTINS instead.
+
+2003-05-17 Neil Booth <neil@daikokuya.co.uk>
+
+ PR c/9209
+ * c-common.c, c-common.h (dollars_in_ident): Remove.
+ * c-opts.c (DOLLARS_IN_IDENTIFIERS): Default to true.
+ (c_common_init_options, c_common_decode_option): Set dollars_in_ident.
+ * cpphash.h (warned_dollar): Rename warn_dollars.
+ * cppinit.c (struct lang_flags, lang_defaults, cpp_set_lang)
+ Permit dollars regardless of -std=.
+ (post_options): Set warn_dollars.
+ * cpplex.c (forms_identifier_p): Use warn_dollars.
+ * config/darwin.h, config/alpha/vms.h, config/m68hc11/m68hc11.h:
+ Remove redundant definitions of DOLLARS_IN_IDENTIFIERS.
+ * doc/cpp.texi, doc/cppopts.texi, doc/invoke.texi, doc/tm.texi:
+ Update documentation.
+
+2003-05-17 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/m68k.c (m68k_output_function_prologue): Use
+ HOST_WIDE_INT_PRINT_DEC for fprintf and %wd for asm_fprintf when
+ formatting a HOST_WIDE_INT.
+ (m68k_output_function_epilogue): Likewise.
+
+2003-05-17 Zack Weinberg <zack@codesourcery.com>
+
+ * doc/install.texi: Remove information about desupported targets.
+
+2003-05-17 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/coff.h: Remove support for Sun FPA and Sun SKY board.
+ * config/m68k/linux.h: Likewise.
+ * config/m68k/m68k-none.h: Likewise.
+ * config/m68k/netbsd-elf.h: Likewise.
+ * config/m68k/sgs.h: Likewise.
+ * config/m68k/m68k.h: Likewise.
+ * config/m68k/m68k.md: Likewise.
+ * config/m68k/m68k.c: Likewise.
+ * doc/md.texi (Machine Constraints): Remove Sun FPA specific
+ constraints.
+ * doc/invoke.texi (Option Summary): Remove -mfpa.
+ (M680x0 Options): Likewise.
+
+2003-05-17 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.c (rs6000_function_value): Simplify REAL_TYPE logic.
+
+2003-05-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/sol2.h: Add TARGET_SUB_OS_CPP_BUILTINS.
+ * config/sparc/liteelf.h, config/sparc/openbsd64.h,
+ config/sparc/rtemself.h, config/sparc/sol2-64.h,
+ config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h:
+ Update for use of TARGET_SUB_OS_CPP_BUILTINS.
+
+2003-05-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * i960/i960.h, i960/rtems.h: Use TARGET_OS_CPP_BUILTINS and
+ TARGET_CPU_CPP_BUILTINS in preference to CPP_PREDEFINES.
+
+2003-05-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * config.gcc (sparc-*-sysv4*): Add sparc/sysv4-only.h.
+ * sparc/aout.h, sparc/elf.h, sparc/freebsd.h, sparc/linux.h,
+ sparc/linux64.h, sparc/lite.h, sparc/litecoff.h, sparc/liteelf.h,
+ sparc/netbsd-elf.h, sparc/openbsd.h, sparc/openbsd64.h,
+ sparc/pbd.h, sparc/rtemself.h, sparc/sol2-64.h, sparc/sol2-bi.h,
+ sparc/sol2.h, sparc/sp64-elf.h, sparc/sp86-elf.h, sparc/sparc.h,
+ sparc/sysv4.h,
+ * sparc/sysv4-only.h: New.
+
+2003-05-17 Alan Modra <amodra@bigpond.net.au>
+
+ * function.c (assign_parms): Check for zero size args.
+
+2003-05-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cfgloopanal.c (test_for_iteration): Use string concatentation on
+ HOST_WIDE_INT_PRINT_* format specifier to collapse multiple
+ function calls into one.
+ * dbxout.c (dbxout_symbol): Likewise.
+ * defaults.h (ASM_OUTPUT_SIZE_DIRECTIVE): Likewise.
+ * dwarf2asm.c (dw2_asm_output_data_uleb128,
+ dw2_asm_output_data_sleb128): Likewise.
+ * genrecog.c (debug_decision_2): Likewise.
+ * loop.c (emit_prefetch_instructions): Likewise.
+ * print-rtl.c (print_rtx): Likewise.
+ * print-tree.c (print_node_brief, print_node): Likewise.
+ * ra-debug.c (dump_igraph, dump_graph_cost,
+ dump_static_insn_cost): Likewise.
+ * ra-rewrite.c (dump_cost): Likewise.
+ * sdbout.c (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise.
+ * sreal.c (dump_sreal): Likewise.
+ * unroll.c (unroll_loop, precondition_loop_p): Likewise.
+ * varasm.c (assemble_vtable_entry): Likewise.
+
+ * avr.c (avr_output_function_prologue,
+ avr_output_function_epilogue, print_operand): Fix format specifier
+ warnings.
+ (init_cumulative_args): Mark parameter with ATTRIBUTE_UNUSED.
+ * avr.h (FUNCTION_VALUE_REGNO_P): Fix signed/unsigned warnings.
+
+2003-05-16 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (expand_block_move): Unify the TARGET_STRING
+ and ! TARGET_STRING cases.
+
+ * doc/cppopts.texi (-undef): Fix texinfo warning.
+
+ * doc/cppopts.texi (-H): Document that -H works for PCH files too.
+ * cppfiles.c (validate_pch): When -H is used, print some information
+ about PCH files found.
+
+2003-05-16 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/mips/t-elf: Remove obsolete rules adding dependencies on tm.h.
+ * config/mips/t-isa3264, config/mips/t-r3900: Likewise.
+ * config/mips/t-sr71k: Likewise.
+
+2003-05-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * arc.c (arc_output_function_prologue,
+ arc_output_function_epilogue): Fix format specifier warnings.
+ * arc.h (LARGE_INT): Fix signed/unsigned warnings.
+
+ * v850.c (print_operand): Fix format specifier warnings.
+
+ * ns32k.c (ADJSP, ns32k_output_function_prologue): Fix format
+ specifier warnings.
+
+ * mcore.c (mcore_print_operand_address, mcore_print_operand): Fix
+ format specifier warnings.
+
+ * ip2k.c (function_prologue, function_epilogue, print_operand):
+ Fix format specifier warnings.
+ * ip2k.md: Likewise.
+
+ * i960.c (i960_output_function_prologue, i960_print_operand,
+ i960_print_operand_addr): Fix format specifier warnings.
+
+ * i370.c (ascebc, ebcasc): Wrap in macros controlling usage.
+ (i370_output_function_prologue): Fix format specifier warnings.
+ * i370.h (PRINT_OPERAND): Likewise.
+
+ * fr30.c (fr30_print_operand): Fix format specifier warnings.
+
+ * dsp16xx.c (print_operand_address): Fix format specifier warning.
+ * dsp16xx.h (INCLUDE_DEFAULTS): Add missing initializers.
+
+ * c4x.c (c4x_print_operand, c4x_print_operand_address): Fix format
+ specifier warnings.
+
+ * alpha.c (print_operand_address, alpha_start_function,
+ unicosmk_output_ssib): Use string concatentation on
+ HOST_WIDE_INT_PRINT_* format specifier to collapse multiple
+ function calls into one.
+ * arm.c (arm_print_operand): Likewise.
+ * cris.c (cris_asm_output_mi_thunk): Likewise.
+ * frv.c (frv_asm_output_mi_thunk): Likewise.
+ * ia64.c (ia64_print_operand, process_set): Likewise.
+ * m68k.c (m68k_output_function_epilogue, m68k_output_mi_thunk):
+ Likewise.
+ * mips/iris5gas.h (PUT_SDB_SIZE): Likewise.
+ * mips.h (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise.
+ * pa.c (output_div_insn, pa_asm_output_mi_thunk): Likewise.
+ * pa.h (PRINT_OPERAND_ADDRESS): Likewise.
+ * rs6000.c (rs6000_va_start, print_operand_address): Likewise.
+ * s390.c (s390_assemble_integer): Likewise.
+ * sparc.c (sparc_flat_function_prologue,
+ sparc_flat_function_epilogue): Likewise.
+ * stormy16.c (xstormy16_print_operand_address, xstormy16_print_operand): Likewise.
+ * vax.c (vax_output_mi_thunk): Likewise.
+
+ * frv.c (frv_print_operand_memory_reference): Fix format specifier
+ warning.
+ (frv_rtx_costs): Mark parameter with ATTRIBUTE_UNUSED.
+
+ * m68k.c (m68k_output_function_epilogue): Fix format specifier
+ warnings.
+
+ * stormy16-protos.h (xs_hi_general_operand,
+ xs_hi_nonmemory_operand): Prototype.
+ * stormy16.c (xstormy16_output_shift): Fix format specifier
+ warnings.
+
+ * cris.c: Fix format specifier warnings.
+
+2003-05-16 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/lib1funcs.asm: Fix typo: LSM instead of LSYM.
+
+2003-05-16 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * doc/bugreport.texi: Remove most of the of the preface of the
+ bugs section.
+
+2003-05-16 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/unwind-ia64.c (uw_update_reg_address): Handle
+ .save XX, r0.
+
+2003-05-15 Roger Sayle <roger@eyesopen.com>
+
+ * config/alpha/alpha.h (ASM_OUTPUT_SKIP): Fix typo.
+
+2003-05-15 Eric Christopher <echristo@redhat.com>
+
+ * cfgcleanup.c (merge_blocks): Fix return value.
+
+2003-05-15 Eric Christopher <echristo@redhat.com>
+
+ * combine.c (expand_compound_operation): Make sure
+ that zero_extend operation is profitable.
+
+2003-05-15 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/linux.h, config/alpha/linux-elf.h: Remove
+ code protected by USE_GNULIBC_1.
+
+2003-05-15 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc: Purge all targets obsoleted in GCC 3.3. Also
+ remove hppa*-*-mpeix* which could not be built, and prune
+ files from tmake_file= or tm_file= lists that don't exist.
+
+ * config/alpha/alpha-interix.h, config/alpha/alpha32.h
+ * config/alpha/t-interix, config/arm/conix-elf.h
+ * config/arm/t-arm-aout, config/arm/t-strongarm-coff
+ * config/arm/unknown-elf-oabi.h, config/i386/win32.h
+ * config/m68k/3b1.h, config/m68k/3b1g.h, config/m68k/amix.h
+ * config/m68k/atari.h, config/m68k/ccur-GAS.h, config/m68k/crds.h
+ * config/m68k/hp2bsd.h, config/m68k/hp3bsd.h
+ * config/m68k/hp3bsd44.h, config/m68k/linux-aout.h
+ * config/m68k/m68k-psos.h, config/m68k/mot3300.h
+ * config/m68k/pbb.h, config/m68k/plexus.h, config/m68k/sun2.h
+ * config/m68k/sun2o4.h, config/m68k/sun3.h, config/m68k/sun3mach.h
+ * config/m68k/sun3n.h, config/m68k/sun3n3.h, config/m68k/sun3o3.h
+ * config/m68k/t-mot3300, config/m68k/t-mot3300-gald
+ * config/m68k/t-mot3300-gas, config/m68k/t-mot3300-gld
+ * config/m68k/tower-as.h, config/m68k/tower.h
+ * config/m88k/aout-dbx.h, config/m88k/m88k-aout.h
+ * config/m88k/m88k-modes.def, config/m88k/m88k-move.sh
+ * config/m88k/m88k-protos.h, config/m88k/m88k.c
+ * config/m88k/m88k.h, config/m88k/m88k.md, config/m88k/openbsd.h
+ * config/m88k/sysv4.h, config/m88k/t-luna, config/m88k/t-luna-gas
+ * config/m88k/t-m88k, config/m88k/t-sysv4, config/mcore/gfloat.h
+ * config/mips/rtems64.h, config/mips/sni-gas.h
+ * config/mips/sni-svr4.h, config/mips/t-ecoff
+ * config/mn10200/lib1funcs.asm, config/mn10200/mn10200-protos.h
+ * config/mn10200/mn10200.c, config/mn10200/mn10200.h
+ * config/mn10200/mn10200.md, config/mn10200/t-mn10200
+ * config/pa/pa-hiux.h, config/pa/pa-hpux7.h, config/pa/pa-hpux9.h
+ * config/pa/pa-oldas.h, config/pa/t-mpeix, config/psos.h
+ * config/romp/romp-protos.h, config/romp/romp.c
+ * config/romp/romp.h, config/romp/romp.md, config/rs6000/aix31.h
+ * config/rs6000/aix3newas.h, config/rs6000/mach.h
+ * config/sparc/bsd.h, config/sparc/hal.h
+ * config/sparc/linux-aout.h, config/sparc/lynx-ng.h
+ * config/sparc/lynx.h, config/sparc/netbsd.h
+ * config/sparc/sp86x-aout.h, config/sparc/splet.h
+ * config/sparc/sun4gas.h, config/sparc/sun4o3.h
+ * config/sparc/sunos4.h, config/sparc/t-chorus-elf
+ * config/sparc/t-halos, config/sparc/t-sparcbare
+ * config/sparc/t-splet, config/sparc/t-sunos41
+ * config/v850/rtems.h: Delete file.
+
+2003-05-15 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000-protos.h (function_value): Protoize.
+
+ * config/rs6000/rs6000.h (FUNCTION_VALUE): Call function.
+
+ * config/rs6000/rs6000.c (rs6000_function_value): New.
+
+2003-05-15 Philip Blundell <philb@gnu.org>
+
+ * config/arm/arm.c (arm_is_xscale): Rename to arm_arch_xscale.
+ All uses updated.
+ (arm_tune_xscale): New variable.
+ (arm_override_options): Set it.
+ (arm_adjust_cost): Use it in place of arm_arch_xscale.
+ (arm_gen_load_multiple): Likewise.
+ (arm_gen_store_multiple): Likewise.
+ * config/arm/arm.md (is_xscale): Likewise.
+ * config/arm/arm.h (arm_tune_xscale): Declare.
+
+2003-05-15 Philip Blundell <philb@gnu.org>
+
+ PR target/10730
+ * config/arm/arm.c (adjacent_mem_locations): Reject offsets
+ involving invalid constants.
+
+2003-05-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (hppa_expand_prologue): Remove blockage.
+
+2003-05-15 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * doc/bugreport.texi: Remove most of the bug reporting
+ instructions and merge them into bugs.html.
+
+2003-05-14 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Cast
+ g_switch_value to unsigned HOST_WIDE_INT.
+
+2003-05-14 Eric Christopher <echristo@redhat.com>
+
+ * combine.c: Fix header comments.
+ (distribute_notes): Remove usage of elim_i1, elim_i2. Propagate
+ to all calls and prototype.
+
+2003-05-14 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/10764
+ * config/i386/i386.md (atan2df3, atan2sf3, atan2xf3, atan2tf3):
+ Add an explicit clobber to show that UNSPEC_FPATAN clobbers st(1).
+ (*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3): Likewise,
+ add an explicit clobber to show that UNSPEC_FYL2X clobbers st(1).
+ (logsf2, logdf2, logxf2, logtf2): Update expander patterns to match
+ the corresponding *fyl2x_?fxf3 instructions.
+
+2003-05-14 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/lib2funcs.S (TRAMPOLINE_SIZE): Change from 49 to 59.
+ * config/xtensa/xtensa-config.h (XCHAL_HAVE_CONST16,
+ XCHAL_HAVE_L32R): New.
+ * config/xtensa/xtensa-protos.h (non_const_move_operand,
+ xtensa_load_constant, xtensa_function_prologue,
+ xtensa_function_epilogue): Delete prototypes.
+ (xtensa_expand_prologue): New.
+ * config/xtensa/xtensa.c (frame_size_const,
+ TARGET_ASM_FUNCTION_PROLOGUE, TARGET_MACHINE_DEPENDENT_REORG,
+ non_const_move_operand, xtensa_load_constant, xtensa_reorg,
+ xtensa_function_prologue): Delete.
+ (add_operand, xtensa_mem_offset): Formatting.
+ (move_operand): If the const16 option is available, allow any SFmode
+ and SImode constants.
+ (xtensa_emit_move_sequence): Inline the former contents of
+ xtensa_load_constant with modifications to handle the const16 option.
+ (override_options): Add xtensa_char_to_class['W'] and set it to
+ the general register class only if the const16 option is enabled.
+ Fix formatting. Disallow PIC when using the const16 option.
+ (print_operand): Reorganize to switch on "letter" instead of the
+ RTL code. Add output_operand_lossage calls for invalid cases.
+ Add support for 't' and 'b' letters.
+ (xtensa_expand_prologue): New function to replace
+ xtensa_function_prologue and xtensa_reorg.
+ (xtensa_function_epilogue): Declare this as static. Delete code
+ to print the retw.n or retw instruction.
+ (xtensa_return_addr): Use A0_REG instead of 0.
+ (xtensa_rtx_costs): Add costs for using the const16 option.
+ * config/xtensa/xtensa.h (MASK_CONST16, TARGET_CONST16): New.
+ (TARGET_DEFAULT): Add CONST16 if L32R instructions not available.
+ (TARGET_SWITCHES): Add "const16" and "no-const16".
+ (REG_CLASS_FROM_LETTER): Add comment about new 'W' letter.
+ (EXTRA_CONSTRAINT): Change 'T' constraint to only apply when not
+ using the const16 option.
+ (TRAMPOLINE_TEMPLATE): Rewrite to avoid hardwired use of l32r insn.
+ (TRAMPOLINE_SIZE): Change from 49 to 59.
+ (INITIALIZE_TRAMPOLINE): Adjust offsets to match new trampoline.
+ (GO_IF_LEGITIMATE_ADDRESS): Do not allow constant pool addresses
+ when using the const16 option.
+ (PREDICATE_CODES): Delete non_const_move_operand.
+ * config/xtensa/xtensa.md (define_constants): Add A1_REG, A8_REG, and
+ UNSPECV_ENTRY.
+ (movdi, movdf): If the source is a constant, always expand to a
+ sequence of movsi insns.
+ (movdi_internal, movdf_internal): Remove alternative using l32r insns.
+ (movsi_internal, movsf_internal): Add alternative using const16 insns.
+ (movsf): Add const16 support.
+ (entry, prologue, epilogue): New.
+ (set_frame_ptr): Add missing mode for unspec_volatile operation.
+ Likewise for subsequent split pattern.
+ * doc/invoke.texi (Option Summary, Xtensa Options): Document new
+ "-mconst16" and "-mno-const16" options.
+
+2003-05-14 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_load_address): Force destination
+ to be DImode register. Merge load_symptr.
+ * config/ia64/ia64.md (load_symptr): Remove.
+
+2003-05-14 Richard Henderson <rth@redhat.com>
+
+ * rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): Rename from
+ DEFERRED_CONSTANT_P.
+ * integrate.c (copy_rtx_and_substitute): Update use.
+ * varasm.c (build_constant_desc): Set SYMBOL_REF_DECL
+ to the copy generated.
+ (maybe_output_constant_def_contents): Examine TREE_ASM_WRITTEN
+ of the constant to see if we should emit.
+ (mark_constant): Similarly.
+ (output_constant_def_contents): Set TREE_ASM_WRITTEN.
+
+2003-05-14 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md (movsi_internal2): Use compare for self
+ move record condition.
+ (movdi_internal2): Same.
+
+2003-05-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov-io.h (gcov_write_bytes, gcov_read_bytes): Remove here.
+ (GCOV_TAG_*) Force type to gcov_unsigned_t.
+ (GCOV_CHECK, GCOV_CHECK_READING, GCOV_CHECK_WRITING): New.
+ (struct gcov_var): Remove modified. Add start, length, offset,
+ overread. Have buffer array for libgcov.
+ (gcov_sync, gcov_seek): Definitions moved to gcov-io.c.
+ (gcov_position, gcov_rewrite, gcov_is_eof): Adjust.
+ * gcov-io.c (gcov_open): Set mode, do not read anything.
+ (gcov_close): Write final block.
+ (gcov_write_block, gcov_allocate): New.
+ (gcov_write_bytes): Make static. Write or allocate buffer.
+ (gcov_write_unsigned, gcov_write_counter): Buffer can never be
+ null.
+ (gcov_write_string): Adjust.
+ (gcov_write_tag)
+ (gcov_write_length): Adjust. Flush the block.
+ (gcov_write_tag_length): Buffer can never be null.
+ (gcov_read_bytes): Make static. Read in block.
+ (gcov_sync): Moved here. Adjust.
+ (gcov_seek): Moved here. Adjust.
+ * coverage.c (read_counts_file): Adjust.
+ * gcov-dump.c (print_prefix): Add position parameter.
+ (flag_dump_positions): New flag.
+ (options, main, print_usage): Add it.
+ (dump_file, tag_blocks, tag_arcs, tag_lines, tag_counters,
+ tag_summary): Adjust.
+ * gcov.c (read_graph_file, read_count_file): Adjust.
+ * libgcov.c (gcov_exit): Adjust.
+
+ * Makefile.in (LIBGCC_DEPS): Use $(srcdir) on gcov files
+ (libgcov.a): Depend on libgcc.a.
+ (gcov.o, gcov-dump.o): Add gcov-io.c.
+ * mklibgcc.in (libgcov_c_dep): Use $(srcdir).
+
+ * loop.c (check_dbra_loop): Factor common test.
+
+2003-05-14 Ben Elliston <bje@wasabisystems.com>
+
+ * doc/md.texi (Automaton pipeline description): Grammar fixes.
+
+2003-05-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (TARGET_INITIALIZER): Include it.
+ * target.h (struct gcc_target): Add machine_dependent_reorg field.
+ * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg.
+ * system.h: Poison MACHINE_DEPENDENT_REORG.
+
+ * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration.
+ * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (alpha_handle_trap_shadows): Remove "first insn" parameter.
+ (alpha_align_insns): Likewise.
+ (alpha_reorg): Likewise. Make static. Update calls to above
+ functions.
+
+ * config/arm/arm-protos.h (arm_reorg): Remove declaration.
+ * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (arm_reorg): Remove parameter. Make static.
+
+ * config/avr/avr-protos.h (machine_dependent_reorg): Remove.
+ * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (avr_reorg): Renamed from machine_dependent_reorg. Make static.
+ Remove parameter.
+
+ * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove.
+ * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (c4x_reorg): Renamed from c4x_process_after_reload. Make static.
+ Remove parameter.
+
+ * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove.
+ * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove.
+
+ * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove.
+ * config/frv/frv.c: Remove orphaned comment.
+
+ * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove.
+ * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static.
+ Remove parameter.
+
+ * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration.
+ * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (emit_insn_group_barriers): Remove "first insn" parameter.
+ (emit_all_insn_group_barriers): Likewise.
+ (ia64_reorg): Likewise. Make static. Update calls to above functions.
+ (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers.
+
+ * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove.
+ * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (ip2k_reorg): Renamed from machine_dependent_reorg. Make static.
+ Remove parameter.
+
+ * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration.
+ * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (m68hc11_reorg): Make static. Remove parameter.
+
+ * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove.
+ * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (conditionalize_optimization): Remove parameter.
+ (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter.
+ Make static. Update call to conditionalize_optimization.
+
+ * config/mips/mips-protos.h (machine_dependent_reorg): Remove.
+ * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter.
+ Make static.
+
+ * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove.
+ * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static.
+ Remove parameter.
+
+ * config/pa/pa-protos.h (pa_reorg): Remove declaration.
+ * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (pa_combine_instructions): Remove "first insn" parameter.
+ (remove_useless_addtr_insns): Likewise.
+ (pa_reorg): Likewise. Make static. Update calls to above functions.
+
+ * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove
+ commented-out definition.
+
+ * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove.
+ * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static.
+ Remove parameter.
+
+ * config/sh/sh-protos.h (machine_dependent_reorg): Remove.
+ * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (sh_reorg): Renamed from machine_dependent_reorg. Make static.
+ Remove parameter.
+ (sh_output_mi_thunk): Call sh_reorg directly.
+ * config/sh/sh.md: Update comment.
+
+ * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove
+ commented-out definition.
+
+ * config/v850/v850-protos.h (v850_reorg): Remove declaration.
+ * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (v850_reorg): Make static. Remove parameter.
+
+ * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration.
+ * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove.
+ * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (xtensa_reorg): Make static. Remove parameter.
+
+ * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove.
+ (TARGET_MACHINE_DEPENDENT_REORG): Document.
+
+2003-05-13 Richard Henderson <rth@redhat.com>
+
+ * c-decl.c (duplicate_decls): Re-invoke make_decl_rtl if
+ the old decl had instantiated DECL_RTL.
+
+2003-05-13 Mike Stump <mrs@apple.com>
+
+ * doc/invoke.texi (Option Summary): Kill off documentation for -$.
+
+2003-05-13 Janis Johnson <janis187@us.ibm.com>
+
+ * config/rs6000/sysv4.h (OUTPUT_ASM_ALIGNED_LOCAL): Expect
+ HOST_WIDE_INT argument.
+
+2003-05-13 Jason Merrill <jason@redhat.com>
+
+ * tree.h (STRIP_MAIN_TYPE_NOPS): New macro.
+
+ * tree.c (iterative_hash_expr): New fn.
+
+ * c-semantics.c (emit_local_var): Don't mess with temp slots if
+ there's no initializer.
+
+2003-05-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * final.c (final_scan_insn): Apply the effects of frame-related
+ delay slot insns before emitting a delayed branch.
+
+2003-05-13 Nick Clifton <nickc@redhat.com>
+
+ * config/mcore/mcore.md (jump): Use emit_jump_insn.
+
+2003-05-13 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Second
+ parameter of ASM_OUTPUT_SKIP must have type unsigned HOST_WIDE_INT.
+
+2003-05-12 DJ Delorie <dj@redhat.com>
+
+ * expr.c (move_by_pieces): Honor the alignment of TO and FROM.
+ (emit_push_insn): Don't use push when the source alignment is less
+ than the stack's push rounding.
+
+2003-05-13 Zack Weinberg <zack@codesourcery.com>
+
+ * diagnostic.c (output_format): Add support for %m.
+ (output_printf, output_verbatim, diagnostic_set_info,
+ verbatim): Set err_no field of the text_info structure being
+ initialized.
+ (fatal_io_error): Delete function.
+ * diagnostic.h (text_info): Add err_no field.
+ * toplev.h (fatal_io_error): Delete prototype.
+
+ * c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
+ * toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
+ * objc/objc-act.c: Replace all calls to fatal_io_error with
+ calls to fatal_error; add ": %m" to the end of all the affected
+ error messages.
+
+2003-05-13 Zack Weinberg <zack@codesourcery.com>
+
+ * varasm.c (notice_rtl_inlining_of_deferred_constant): New function.
+ * rtl.h: Prototype it.
+ * integrate.c (copy_rtx_and_substitute <SYMBOL_REF>): Call it
+ when appropriate.
+
+2003-05-13 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("*iordi3_oi"): Do not mark commutative.
+ ("*iorsi3_oi"): Likewise.
+
+2003-05-13 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (compare_scc): Use shorter sequence for EQ case.
+ (ior_scc_scc_cmp, and_scc_scc_cmp): New insn-and-split patterns.
+ (and_scc_scc): Ensure split only applies when there is a dominance
+ of the comparisons.
+ (and_scc_scc_nodom): New insn-and-split pattern.
+
+2003-05-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * unwind-dw2.c (uw_init_context_1): Don't pass &outer_cfa directly
+ to _Unwind_SetGRPtr().
+
+2003-05-13 Michael Eager <eager@mvista.com>
+
+ * Makefile.in: Initialize program_transform_cross_name from
+ @program_transform_name@ instead of target_alias.
+
+2003-05-12 Janis Johnson <janis187@us.ibm.com>
+ Alan Modra <amodra@bigpond.net.au>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * configure.in (HAVE_AS_TLS): Add powerpc and powerpc64 tests.
+ * configure: Rebuild.
+ * config/rs6000/rs6000-protos.h: Update.
+ * config/rs6000/rs6000.c (rs6000_tls_size): New.
+ (rs6000_tls_size_string): New.
+ (rs6000_parse_tls_size_option): New.
+ (rs6000_legitimize_tls_address): New.
+ (rs6000_tls_get_addr): New.
+ (rs6000_got_sym): New.
+ (rs6000_tls_symbol_ref): New.
+ (rs6000_tls_symbol_ref_1): New.
+ (rs6000_get_some_local_dynamic_name): New.
+ (rs6000_get_some_local_dynamic_name_1): New.
+ (TARGET_HAVE_TLS): New.
+ (TARGET_CANNOT_FORCE_CONST_MEM): New.
+ (rs6000_override_options): Handle -mtls-size option.
+ (constant_pool_expr_1): Handle TLS symbols.
+ (rs6000_legitimize_address): Handle TLS symbols.
+ (rs6000_tls_referenced_p): New.
+ (rs6000_legitimate_address): Handle TLS symbols.
+ (rs6000_emit_move): Handle TLS symbols.
+ (print_operand): Handle TLS symbols.
+ (uses_TOC): Handle TLS symbols.
+ (rs6000_emit_prologue): Use symbol for unspec constant.
+ * config/rs6000/rs6000.h (HAVE_AS_TLS): New.
+ (some_ld_name): New.
+ (LEGITIMATE_CONSTANT_P): Handle TLS symbols.
+ (PRINT_OPERAND_PUNCT_VALID_P): Handle TLS symbols.
+ (PREDICATE_CODES): Add rs6000_tls_symbol_ref.
+ * config/rs6000/rs6000.md (load_toc_v4_PIC_1, load_toc_v4_PIC_1b):
+ Support TLS.
+ (tls_gd_32, tls_gd_64, tls_ld_32, tls_ld_64, tls_dtprel_32,
+ tls_dtprel_64, tls_dtprel_ha_32, tls_dtprel_ha_64, tls_dtprel_lo_32,
+ tls_dtprel_lo_64, tls_got_dtprel_32, tls_got_dtprel_64, tls_tprel_32,
+ tls_tprel_64, tls_tprel_ha_32, tls_tprel_ha_64, tls_tprel_lo_32,
+ tls_tprel_lo_64, tls_got_tprel_32, tls_got_tprel_64, tls_tls_32,
+ tls_tls_64): New.
+ * config/rs6000/sysv4.h (SUBTARGET_OPTIONS): Add tls_size.
+
+2003-05-12 Neil Booth <neil@cat.daikokuya.co.uk>
+
+ * Makefile.in (stage2_build, stage3_build, stage4_build):
+ Set BUILD_CC to the same as CC.
+
+2003-05-12 Neil Booth <neil@daikokuya.co.uk>
+
+ * alloc-pool.c (last_id): Put in ENABLE_CHECKING guards.
+
+2003-05-12 Andreas Schwab <schwab@suse.de>
+
+ * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Mark 'exp'
+ as unused.
+ (bundling): Initialize 'pos'.
+ (ia64_expand_builtin): Initialize 'rmode'.
+
+2003-05-12 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/xcoff.h (ASM_OUTPUT_SKIP): Accept HOST_WIDE_INT.
+ (ASM_OUTPUT_ALIGNED_COMMON): Same.
+ (ASM_OUTPUT_LOCAL): Same.
+
+Mon May 12 21:53:29 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * varasm.c (output_constant): Fix underflow.
+
+2003-05-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR other/10745
+ * configure.in: Correct detection of GNU ld version number.
+ * configure: Regenerated.
+
+2003-05-12 Zack Weinberg <zack@codesourcery.com>
+
+ * diagnostic.c (diagnostic_for_decl): Take a
+ diagnostic_context argument. Restructure to be consistent
+ with diagnostic_report_diagnostic.
+ (diagnostic_count_diagnostic): Now static. Take a
+ diagnostic_info argument, not just a diagnostic_t. Some code
+ moved here from internal_error. Move a case label for
+ clarity.
+ (diagnostic_action_after_output): New function. Code moved
+ here from internal_error and fatal_error.
+ (bug_report_request): New #define so that this text appears in
+ only one place.
+ (diagnostic_report_diagnostic): Update to match changes to
+ diagnostic_count_diagnostic. Call diagnostic_action_after_output.
+ (diagnostic_set_info): Call gettext here.
+
+ (pedwarn): Update comment. Don't call gettext here.
+ (sorry): Use report_diagnostic. Don't call gettext here.
+ (fatal_error): Remove final fnotice and exit, but call
+ real_abort to prevent warnings about noreturn function returning.
+ (internal_error): Likewise. Don't do ICE suppression here nor
+ call context->internal_error.
+ (warning_with_decl): Suppress for decls in system headers.
+ Adjust call to diagnostic_for_decl.
+ (pedwarn_with_decl): Likewise.
+ (error_with_decl): Adjust call to diagnostic_for_decl.
+ (error_recursion): Use bug_report_request.
+
+ * diagnostic.h: Remove prototype of diagnostic_count_diagnostic.
+ * objc/objc-act.c (error_with_ivar, warn_with_method): Don't call
+ diagnostic_count_diagnostic.
+
+2003-05-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON): Correct last patch.
+
+Mon May 12 15:57:54 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * rs6000/darwin.h (ASM_OUTPUT_COMMON): Accept HOST_WIDE_INT
+ * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Fix warning.
+ * mips/mips.h (ASM_OUTPUT_SKIP): Fix typo in the previous patch.
+
+2003-05-12 Roger Sayle <roger@eyesopen.com>
+
+ * doc/rtl.texi: Document zero_extract as a valid destination
+ of a set insn.
+
+2003-05-12 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm/lib1funcs.asm (LSYM): Define -- on ELF prefix a local symbol with
+ '.'. Change all local symbol definitions and references to use LSYM.
+
+Mon May 12 11:32:53 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * expr.h (assemble_static_space): Update prototype.
+ * output.h (assemble_zeros, output_constant): Likewise.
+ * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean
+ * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make
+ it 64bit clean.
+ * elf.h (ASM_OTUPUT_SKIP): Likewise.
+ * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise.
+ * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
+ Expect HOST_WIDE_INT operand.
+ * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
+ Expect HOST_WIDE_INT operand.
+ * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
+ Expect HOST_WIDE_INT operand.
+ * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect
+ HOST_WIDE_INT operand.
+ * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP,
+ ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand.
+ * aout.h (ASM_OTUPUT_SKIP): Likewise.
+ * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise.
+ * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise.
+ * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise.
+ * frv.h (ASM_OTUPUT_SKIP): Likewise.
+ * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise.
+ * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
+ Make it 64bit
+ clean.
+ * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand.
+ * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
+ Make it 64bit clean.
+ * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean..
+ * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect
+ HOST_WIDE_INT operand
+ * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
+ Expect HOST_WIDE_INT operand
+ * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand
+ * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON,
+ ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand
+ * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
+ Likewise.
+ * m32r.h (ASM_OUTPUT_COMMON): Likewise.
+ * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
+ Likewise.
+ * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise.
+ * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise.
+ * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
+ ASM_OUTPUT_SKIP): Likewise.
+ * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP):
+ Likewise.
+ * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
+ ASM_OUTPUT_SKIP): Likewise.
+ * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
+ ASM_OUTPUT_SKIP): Likewise.
+ * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise.
+ * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON,
+ ASM_OUTPUT_SKIP): Likewise.
+ * sgs.h (ASM_OUTPUT_SKIP): Likewise.
+ * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON,
+ ASM_OUTPUT_SKIP): Likewise.
+ * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP):
+ Likewise.
+ * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise.
+ * iris.h (ASM_OUTPUT_LOCAL): Likewise.
+ * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise.
+ * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL,
+ ASM_OUTPUT_SKIP): Make it 64bit clean.
+ * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL):
+ Make it 64bit clean.
+ * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL,
+ ASM_OUTPUT_SKIP): Make it 64bit clean.
+ * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it
+ 64bit clean.
+ * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect
+ HOST_WIDE_INT argument
+ * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument.
+ * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect
+ HOST_WIDE_INT argument
+ * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument
+ * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument
+ * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument
+ * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL):
+ HOST_WIDE_INT argument
+ * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument
+ * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument
+ * varasm.c (asm_output_bss, asm_output_aligned_bss,
+ asm_emit_uninitialized, assemble_zeros, assemble_static_space):
+ HOST_WIDE_INT argument
+
+2003-05-10 Steven Bosscher <steven@gcc.gnu.org>
+
+ * cgraphunit.c (cgraph_create_edges): Drop walk_tree in
+ favor of walk_tree_without_duplicates. Add comments.
+
+2003-05-12 Josef Zlomek <zlomekj@suse.cz>
+
+ * alloc-pool.h (ALLOC_POOL_ID_TYPE): New type.
+ (struct alloc_pool_def): New element 'id'.
+ * alloc-pool.c (fancy_abort): Extern function prototype.
+ (abort): Macro which uses fancy_abort.
+ (struct allocation_object_def): New structure.
+ (ALLOCATION_OBJECT_PTR_FROM_USER_PTR): New macro.
+ (USER_PTR_FROM_ALLOCATION_OBJECT_PTR): New macro.
+ (last_id): New variable.
+ (create_alloc_pool): Add the offset of u.data to size of element,
+ increase and use last_id.
+ (free_alloc_pool): Do the checking only when ENABLE_CHECKING.
+ (pool_alloc): Likewise. Set ID for elements.
+ (pool_free): Check whether the PTR was allocated from POOL.
+
+2003-05-11 Richard Henderson <rth@redhat.com>
+
+ PR c/10675
+ * c-decl.c: Include hashtab.h.
+ (detect_field_duplicates): New.
+ (finish_struct): Use it.
+ * Makefile.in (c-decl.o): Update.
+ * c-parse.in (structsp_attr): Nreverse component_decl_list results.
+ (component_decl_list, component_decl_list2,
+ components, components_notype): Build list in reverse order.
+ (enumlist): Clarify docs. Use TREE_CHAIN not chainon.
+
+ * tree.c (chainon): Special case op2 null as well.
+ Reorg for clarity.
+
+2003-05-11 Roger Sayle <roger@eyesopen.com>
+
+ * config/i386/i386.md (logsf2, logdf2, logxf2, logdf2): New patterns
+ to implement log, logf and logl built-ins as inline x87 intrinsics.
+ (UNSPEC_FYL2X): New unspec to represent x87's "fyl2x" instruction.
+ (*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3): New insn
+ patterns for x87's "fyl2x" instruction, used by log?f2 patterns.
+
+ * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FYL2X like
+ UNSPEC_FPATAN, i.e. replaces two stack operands with single result.
+
+2003-05-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (out_object_file): Don't set -Wno-error for ${cpu}.o.
+
+ * sparc.c (print_operand): Fix uninitialized warning.
+
+2003-05-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloopanal.c (num_loop_insns, average_num_loop_insns): Count only
+ real insns.
+ * loop-unroll.c (unroll_loop_runtime_iterations): Remove superfluous
+ condition.
+
+2003-05-11 Neil Booth <neil@cat.daikokuya.co.uk>
+
+ * doc/cpp.texi: Fix typos.
+
+2003-05-11 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_function_arg_float): New function.
+ (s390_function_arg_pass_by_reference): Use it.
+ (s390_function_arg_advance): Likewise.
+ (s390_function_arg): Likewise.
+ (s390_va_arg): Likewise
+
+2003-05-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ * coverage.h (coverage_counter_alloc): New function.
+ * function.h (struct function): Remove arc_profile flag.
+ * coverage.c (fn_ident): Remove.
+ (fn_b_ctrs, no_coverage): New.
+ (get_coverage_counts): Use current_function_funcdef_no.
+ (coverage_counter_alloc): New.
+ (coverage_counter_ref): Adjust.
+ (coverage_begin_output): Check no_coverage. Use
+ current_function_funcdef_no.
+ (coverage_end_function): Likewise.
+ (create_coverage): Set no_coverage. Set DECL_UNINLINEABLE rather
+ than clearing flag_inline_functions. Do not clear arc_profile
+ flag.
+ * function.c (prepare_function_start): Do not set arc_profile
+ flag.
+ * profile.c (instrument_edges): Return number of instrumented
+ edges. Use a for loop.
+ (branch_prob): Call coverage_counter_alloc. Make BB_TO_GCOV_INDEX
+ local to here and simplify. Use profile_arc_flag not arc_profile
+ flag.
+ (find_spanning_tree): Reformat.
+ * toplev.c (rest_of_compilation): Use profile_arc_flags and
+ flag_test_coverage rather than arc_profile flag.
+
+2003-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * doc/invoke.texi (Wctor-dtor-privacy): Update documentation.
+
+2003-05-11 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * varasm.c (copy_constant, case VIEW_CONVERT_EXPR): New case.
+
+2003-05-11 Bruno Haible <bruno@clisp.org>
+
+ * cppfiles.c (find_or_create_entry): Preserve errno.
+
+2003-05-11 Neil Booth <neil@cat.daikokuya.co.uk>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into
+ cpplib as it's a Standard Predefined Macro.
+ * c-opts.c (finish_options): Pass flag_hosted to cpp_init_builtins.
+ * cppinit.c (_cpp_init_builtins): Take HOSTED. Define
+ __STDC_HOSTED__ appropriately.
+ * cpplib.h (_cpp_init_builtins): Update.
+ * fix-header.c (read_scan_file): Update.
+ * doc/cpp.texi, doc/cppopts.texi: Update documentation.
+
+2003-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR C++/689
+ PR C++/9257
+ * c-opts.c (c_common_decode_option): Don't set
+ warn_ctor_dtor_privacy wen -Wall.
+ * c-common.c (warn_ctor_dtor_privacy): Don't turn on by default.
+
+2003-05-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * reload1.c (reload_cse_move2add): Revert part of my 2003-05-09's
+ patch.
+
+2003-05-10 Zack Weinberg <zack@codesourcery.com>
+
+ * diagnostic.c: Reorder functions for clarity, putting all the
+ functions in the "error" family next to each other, and
+ likewise all the functions in the "error_with_decl" family.
+ Some other routines were moved too. Add comments.
+ (vbuild_message_string): Fold into sole caller.
+
+
+2003-05-11 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * except.c (EH_RETURN_STACKADJ_RTX): Do not define.
+ (EH_RETURN_HANDLER_RTX): Likewise.
+ (expand_builtin_eh_return): Do not copy stack adjustment
+ if EH_RETURN_STACKADJ_RTX is not defined.
+ (expand_eh_return): Likewise. Also, do not pass stack
+ adjustment as argument to the eh_return pattern.
+ * except.h (MUST_USE_SJLJ_EXCEPTIONS): Do not define just
+ because EH_RETURN_STACKADJ_RTX is not defined.
+ * unwind-dw.c (uw_update_context_1): If EH_RETURN_STACKADJ_RTX
+ is not defined, treat stack pointer like a regular register.
+ (uw_init_context_1): Set up fake initial stack pointer register.
+ (uw_install_context_1): Do not compute stack adjustment if
+ EH_RETURN_STACKADJ_RTX is not defined.
+
+ * config/i386/i386.md ("eh_return"): Remove first argument.
+ * config/mips/mips.md ("eh_return"): Likewise.
+ * config/rs6000/rs6000.md ("eh_return"): Likewise.
+ * config/sh/sh.md ("eh_return"): Likewise.
+
+ * config/s390/s390.h (EH_RETURN_STACKADJ_RTX): Remove.
+
+2003-05-10 Alexander Aganichev <aaganichev@yandex.ru>
+
+ * config/i386/i386.h (MODES_TIEABLE_P): Fix typo.
+
+2003-05-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ * defaults.h (GCOV_TYPE_SIZE): Remove.
+ * gcov-io.h (gcov_type): Set to specific mode int on target.
+ (gcov_unsigned_t, gcov_position_t): New.
+ (GCOV_TYPE_NODE): New.
+ (GCOV_TAG_SUMMARY_LENGTH): Adjust.
+ (GCOV_COUNTERS_SUMMABLE): New.
+ (gcov_ctr_summary, gcov_sumary, gcov_fn_info, gcov_merge_fn,
+ gcov_ctr_info, gcov_info): Adjust types.
+ (gcov_var): Adjust types.
+ (gcov_write_unsigned, gcov_write_tag,
+ gcov_write_length, gcov_write_tag_length, gcov_write_summary,
+ gcov_read_unsigned, gcov_read_summary): Adjust gcov types.
+ (gcov_position, gcov_sync, gcov_seek): Adjust gcov types.
+ * gcov-io.c (gcov_write_unsigned, gcov_write_tag,
+ gcov_write_length, gcov_write_tag_length, gcov_write_summary,
+ gcov_read_unsigned, gcov_read_summary): Adjust gcov types.
+ * libgcov.c (gcov_crc32, gcov_version_mismatch, gcov_exit,
+ __gcov_init, __gcov_merge_add): Adjust gcov types.
+ * coverage.c (ctr_merge_functions): Constify.
+ (ctr_names): New.
+ (read_counts_file): Adjust gcov types. Only summarize & merge
+ summable counters.
+ (coverage_counter_ref): Use GCOV_TYPE_NODE.
+ (build_fn_info_type, build_fn_info_value, build_ctr_info_type,
+ build_ctr_info_value, build_gcov_info): Adjust types.
+ * profile.c (branch_prob): Adjust gcov types.
+ * gcov_dump (dump_file): Adjust gcov types.
+
+2003-05-10 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (DOM_CC_X_AND_Y, DOM_CC_NX_OR_Y, DOM_CC_X_OR_Y): New
+ constants.
+ (ior_scc_scc, and_scc_scc): New insn_and_split patterns.
+ * arm.c (arm_select_dominance_cc_mode): Renamed from
+ select_dominance_cc_mode, no-longer static. Use DOM_CC... constants.
+ Callers updated.
+ * arm-protos.h (arm_select_dominance_cc_mode): Add prototype.
+
+2003-05-09 Roger Sayle <roger@eyesopen.com>
+
+ * config/alpha/alpha.c (alpha_start_function): Declare frame_size
+ as unsigned to avoid signed/unsigned comparison warnings.
+
+2003-05-09 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_emit_loop_end): Only use "nop.n"
+ instruction if the Xtensa density option is enabled.
+
+2003-05-09 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * mklibgcc.in: Remove extra quotes.
+
+2003-05-09 Mark Mitchell <mark@codesourcery.com>
+
+ * config/rs6000/rs6000.c (spe_init_builtins): Fix typo in creation
+ of int_ftype_void.
+
+2003-05-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * reload1.c (reload_cse_move2add): Don't turn an implicit
+ truncation into a self-set in the narrow mode.
+
+2003-05-09 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (clzsi2): The CLZ instruction is predicable.
+
+2003-05-09 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c: Formatting.
+
+2003-05-09 Diego Novillo <dnovillo@redhat.com>
+
+ * tree-dump.c (dequeue_and_dump): Use CONSTRUCTOR_ELTS,
+ instead of TREE_OPERAND to access the operand of a
+ CONSTRUCTOR node.
+
+2003-05-09 Diego Novillo <dnovillo@redhat.com>
+
+ * tree-dump.c (dequeue_and_dump): CONSTRUCTOR nodes contain only
+ one operand.
+
+2003-05-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * toplev.h (warning_with_file_and_line): Don't declare.
+ (error_with_file_and_line): Likewise.
+ * diagnostic.c (error_with_file_and_line): Remove.
+ (warning_with_file_and_line): Likewise.
+
+2003-05-09 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-parse.in (if_stmt_locus): New object.
+ (if_prefix rule): Use it. Don't use warning_with_file_and_line.
+ (select_or_iter_stmt rule): Likewise.
+ (if_stmt_file): Remove.
+ (if_stmt_line): Likewise.
+ * jump.c: include "diagnostic.h"
+ (never_reached_warning): Don't use warning_with_file_and_line.
+ * Makefile.in (jump.o): Add dependce on diagnostic.h
+
+2003-05-09 Alan Modra <amodra@bigpond.net.au>
+
+ * expr.c (move_block_from_reg): Remove "size" parm. Localize vars.
+ Move code handling pieces not larger than a word to..
+ * function.c (assign_parms): ..here, but use change_address instead
+ of adjust_address and operand_subword, and expand_binop instead of
+ expand_shift. Adjust calls to move_block_from_reg.
+ * expr.h (move_block_from_reg): Update declaration.
+ (copy_blkmode_from_reg): Formatting.
+ * Makefile.in (function.o): Add $(OPTABS_H) to deps.
+ * config/alpha/alpha.c (alpha_setup_incoming_varargs): Adjust
+ move_block_from_reg calls.
+ * config/arc/arc.c (arc_setup_incoming_varargs): Likewise.
+ * config/i960/i960.c (i960_setup_incoming_varargs): Likewise.
+ * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise.
+ * config/m88k/m88k.c (m88k_builtin_saveregsk): Likewise.
+ * config/mips/mips.c (mips_setup_incoming_varargs): Likewise.
+ * config/pa/pa.c (hppa_builtin_saveregs): Likewise.
+ * config/romp/romp.h (SETUP_INCOMING_VARARGS): Likewise.
+ * config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
+ * config/sh/sh.c (sh_builtin_saveregs): Likewise.
+
+2003-05-08 DJ Delorie <dj@redhat.com>
+
+ * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_arg): Fix
+ to handle arguments for which MUST_PASS_IN_STACK is true (e.g.,
+ variable-sized types).
+ (xstormy16_function_arg): New. Pass them that way too.
+ * config/stormy16/stormy16-protos.h (xstormy16_function_arg): New.
+ * config/stormy16/stormy16.h (FUNCTION_ARG): Call it.
+
+2003-05-08 Aldy Hernandez <aldyh@redhat.com>
+
+ * mklibgcc.in: Use mkinstalldirs when installing multilib
+ directories.
+
+2003-05-08 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (gen_block_redirect, split_branches): Use CODE_FOR_jump_compact
+ instead of CODE_FOR_jump
+
+2003-05-08 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * objc/objc-act.c (error_with_ivar): Don't use
+ error_with_file_and_line.
+ (warn_with_method): Don't use warning_with_file_and_line.
+
+2003-05-08 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * stmt.c (emit_locus): New macro.
+ (emit_filename): Remove.
+ (emit_lineno): Likewise.
+ (struct stmt_status): Replace members x_emit_filename and
+ x_emit_lineno with x_emit_locus.
+ (set_file_and_line_for_stmt): Adjust.
+ (expand_expr_stmt_value): Don't use warning_with_file_and_line.
+ (warn_if_unused_value): Likewise.
+ (check_seenlabel): Likewise.
+
+2003-05-08 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-decl.c (define_label): Tidy. Don't use any of
+ error_with_file_and_line or warning_with_file_and_file.
+ (pending_xref_error): Likewise.
+ (store_parm_decls): Likewise.
+ (current_function_prototype_locus): New object. Package from
+ current_function_prototype_file and current_function_prototype_line.
+ (start_function): Use it.
+ (current_function_prototype_file): Remove.
+ (current_function_prototype_line): Remove;
+
+2003-05-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (readonly_data_expr): New function.
+ (expand_builtin_memmove): Optimize any rodata source, not just
+ strings.
+
+2003-05-07 David Mosberger <davidm@hpl.hp.com>
+
+ * unwind-libunwind.c (_Unwind_FindEnclosingFunction): New.
+
+2003-05-07 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (ix86_split_long_move): Fix base register
+ mode for XFmode splits for TARGET_64BIT.
+
+2003-05-07 Richard Henderson <rth@redhat.com>
+
+ * sched-ebb.c (schedule_ebb): Supply the correct starting
+ block number to save_line_notes.
+
+2003-05-07 Richard Henderson <rth@redhat.com>
+
+ * toplev.c (enum dump_file_index): Swap DFI_ce3, DFI_bbro.
+ (dump_file): Likewise.
+
+2003-05-07 David Mosberger <davidm@hpl.hp.com>
+
+ * config/ia64/crtbegin.asm (__do_jv_register_classes): Don't
+ forget to preserve gp.
+ * config/ia64/crtend.asm (__do_global_ctors_au): Ditto.
+
+ * config/ia64/crtbegin.asm (__do_jv_register_classes): Add missing
+ .prologue directive.
+ Use .skip instead of data8 for .bss section to make Intel
+ Assembler (ias) happy. Minor whitespace fixups. Make "nop 0"
+ explicit in the .mib bundles and remove the unnecessary stop
+ bits. Replace local labels with normal labels, to make ias
+ happy. Don't register __do_global_ctors_aux here, do it in
+ crtend.asm instead.
+
+ * config/ia64/crtend.asm [HAVE_INIT_FINI_ARRAY]: Register
+ __do_global_ctors_aux in .init_array section instead of
+ declaring it as a hidden global. Replace local labels with
+ ordinary labels to make ias happy.
+
+2003-05-07 Richard Henderson <rth@redhat.com>
+
+ PR c++/10570
+ * except.c: Revert 04-01 and 04-02 forced-unwind changes.
+ * flags.h, toplev.c, doc/invoke.texi: Likewise.
+
+ * unwind-dw2.c (_Unwind_GetCFA): Fix ptr->int conversion warning.
+ * unwind.inc (_Unwind_DeleteException): Check for null
+ exception_cleanup.
+
+ * unwind-sjlj.c (_Unwind_SjLj_Resume_or_Rethrow): New.
+ * unwind.inc (_Unwind_Resume_or_Rethrow): New.
+ * unwind.h: Declare them.
+ * libgcc-std.ver (GCC_3.3): Export them.
+
+2003-05-07 Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2.c (_Unwind_GetCFA): Cast pointer to _Unwind_Ptr,
+ not _Unwind_Word.
+
+2003-05-07 Zack Weinberg <zack@codesourcery.com>
+
+ * stmt.c (force_label_rtx): New function, based on logic
+ formerly found in expand_expr.
+ * expr.h: Prototype it.
+ * expr.c (expand_expr <LABEL_DECL>): Use force_label_rtx if
+ appropriate.
+ * varasm.c (decode_addr_const <LABEL_DECL>): Use force_label_rtx.
+
+ * print-tree.c (debug_tree): Free the table after we're done
+ with it. Use putc.
+
+2003-05-07 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.h: Reverse arguments for __ev_subfw.
+ Unreverse arguments for __ev_subw.
+
+ * config/rs6000/spe.md (evsubfw): Reverse arguments of assembly.
+
+2003-05-07 Nick Clifton <nickc@redhat.com>
+
+ * config/stormy16/stormy-abi: Update to include
+ R_XSTORMY16_FPTR16, R_XSTORMY16_LO16, R_XSTORMY16_HI16 and
+ R_XSTORMY16_12 relocs.
+
+2003-05-07 Alan Modra <amodra@bigpond.net.au>
+
+ * function.c (assign_parms): Correct reversed reg_parm_stack_space
+ test. Add partial in-regs size to stack_args_size.
+
+2003-05-07 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/invoke.texi (Warning Options): Mark -Wmissing-declarations
+ as a C only option.
+
+2003-05-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov-io.h (GCOV_LOCKED): New #define.
+ (GCOV_LINKAGE): Make sure it is #defined.
+ (gcov_write_string, gcov_write_tag, gcov_write_length,
+ gcov_read_string, gcov_time): Poison in libgcov.
+ (gcov_seek_end): Remove.
+ (gcov_write_tag_length, gcov_sync, gcov_rewrite): New.
+ (GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH,
+ GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH,
+ GCOV_TAG_SUMMARY_LENGTH): New #defines.
+ (gcov_write_tag, gcov_write_length): Not in libgcov.
+ * gcov-io.c (gcov_open): Use GCOV_LOCKED.
+ (gcov_write_tag, gcov_write_length): Not in libgcov.
+ (gcov_write_tag_length): New.
+ (gcov_write_summary): Use gcov_write_tag_length.
+ * libgcov.c: Always #include gcov-io.h.
+ (IN_LIBGCOV): -1 for inhibit_libc, +1 otherwise.
+ (GCOV_LINKAGE): Define to nothing for L_gcov.
+ (gcov_exit): Replace gcov_write_tag, gcov_write_length with
+ gcov_write_tag_length. Use gcov_rewrite & gcov_seek.
+ * gcov.c (read_graph_file): Replace gcov_seek by gcov_sync.
+ (read_count_file): Likewise.
+ * gcov-dump.c (dump_file): Likewise.
+ * coverag.c (read_counts_file): Likewise.
+
+2003-05-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR other/10658
+ * gcc.c (process_command): Update copyright date.
+
+2003-05-06 Phil Edwards <pme@gcc.gnu.org>
+
+ * doc/install.texi (mips-*-*): Add note about libstdc++.
+
+2003-05-06 DJ Delorie <dj@redhat.com>
+
+ * config/stormy16/stormy16.c (xstormy16_function_profiler): New.
+ * config/stormy16/stormy16.h (FUNCTION_PROFILER): Call it.
+ * config/stormy16/stormy16-protos.h (xstormy16_function_profiler): New.
+
+2003-05-06 <neil@cat.daikokuya.co.uk>
+
+ * c-opts.c (COMMAND_LINE_OPTIONS): Reject -Wmissing-prototypes
+ and -Wstrict-prototypes if C++.
+
+2003-05-06 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/linuxspe.h: New file.
+
+ * config.gcc: Add powerpc-*-linux-gnuspe* target.
+
+2003-05-06 Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2.c (uw_update_context_1): Only set cfa as sp if
+ previous frame didn't save sp. Clear sp for next frame.
+ (uw_install_context_1): Honor saved sp from frame.
+
+2003-05-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare.
+ (mips_move_1word, mips_move_2words): Remove declaration.
+ (mips_split_64bit_move_p, mips_split_64bit_move): Declare.
+ (mips_restore_gp): Remove insn argument.
+ * config/mips/mips.h (FP_REG_RTX_P): New macro.
+ * config/mips/mips.c (volatile_buffer): Remove.
+ (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New.
+ (mips_move_1word, mips_move_2words): Remove, replacing with...
+ (mips_output_move): ...this new function.
+ (mips_restore_gp): Remove insn argument. Adjust for above changes.
+ (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove
+ handling of floating-point constants. Handle zero CONST_DOUBLE
+ arguments.
+ (mips_annotate_frame_insn): Replace with...
+ (mips_set_frame_expr): ...this, which just takes one argument.
+ (mips_frame_set): Change the register argument to an rtx.
+ (mips_emit_frame_related_store): Use mips_split_64bit_move_p to
+ check whether moves should be split. Use mips_split_64bit_move
+ to split them. Use mips_subword to generate the high and low
+ parts of a paired FPR. Adjust calls to frame_set and
+ mips_set_frame_expr.
+ (mips_expand_prologue): Simplify due to above changes.
+ * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit
+ targets, replacing xisting register-only versions.
+ (UNSPEC_STORE_DF_HIGH): New unspec.
+ (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs.
+ (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word.
+ (*paradoxical_extendhidi2): Remove.
+ (movdi_internal, movdi_internal2): Use mips_output_move.
+ (*movdi_internal2_mips16, movsi_internal, movcc): Likewise.
+ (movsf_internal1, movsf_internal2): Likewise.
+ (movdf_internal1a): Likewise. Fix length and type of f <- G case.
+ (movdf_internal1b): Use mips_output_move. Fix type of f <- G case.
+ (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves.
+ Add m <- G alternative.
+ (load_df_low, load_df_high, store_df_low): New patterns.
+ (movhi_internal): Use @ template instead of calling a function.
+ Remove unnecessary 'z' alternatives.
+ (movqi_internal): Likewise.
+ (exception_receiver): Update call to mips_restore_gp.
+
+2003-05-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_simplify_dwarf_addr): Remove.
+ (mips_delegitimize_address): Declare.
+ * config/mips/mips.h (ASM_SIMPLIFY_DWARF_ADDR): Undefine.
+ (FIND_BASE_TERM): Define.
+ * config/mips/mips.c (TARGET_DELEGITIMIZE_ADDRESS): Defi~e.
+ (mips_delegitimize_address): Renamed from mips_simplify_dwarf_addr.
+ Handle small-data addresses.
+
+2003-05-05 Roger Sayle <roger@eyesopen.com>
+
+ * real.c (real_powi): New function to calculate the value of
+ a real raised to an integer power, i.e. pow(x,n) for int n.
+ (real_sqrt): Convert to using the faster do_add, do_multiply
+ and do_divide API for consistency with the rest of real.c.
+ * real.h (real_powi): Prototype here.
+ * builtins.c (fold_builtin): Avoid local variable mode when
+ evaluating sqrt at compile time. Attempt to evaluate pow at
+ compile-time, by checking for an integral exponent.
+
+2003-05-05 Richard Henderson <rth@redhat.com>
+
+ * doc/extend.texi (Variable Attributes): Re-sort table and tidy.
+
+2003-05-05 David O'Brien <obrien@FreeBSD.org>
+
+ * config/rs6000/sysv4.h (CPP_OS_FREEBSD_SPEC): Add __ELF__ to mirror
+ other FreeBSD ports.
+ (LINK_OS_FREEBSD_SPEC): Mirror conventions on other FreeBSD ports.
+ (_LITTLE_ENDIAN): Use __LITTLE_ENDIAN__ instead.
+
+2003-05-05 Janis Johnson <janis187@us.ibm.com>
+
+ * Makefile.in: (site.exp): Add ALT_CC_UNDER_TEST, add quotes around
+ expanded variables.
+ * doc/sourcebuild.texi (C tests): Describe gcc.dg/compat tests.
+
+2003-05-05 Zack Weinberg <zack@codesourcery.com>
+
+ * rtl.h (STRING_POOL_ADDRESS_P): Rename to DEFERRED_CONSTANT_P.
+ * varasm.c (struct varasm_status): Add deferred_constants field.
+ (n_deferred_strings): Delete variable.
+ (n_deferred_constants): New #define.
+ (struct constant_descriptor_tree): Kill next and label fields.
+ (const_hash_table, MAX_HASH_TABLE): Delete.
+ (const_desc_htab): New static variable.
+ (const_hash): Rename const_desc_hash, and make it fit the
+ hashtab.h interface.
+ (const_desc_eq): New.
+ (const_hash_1, compare_constant): Const-ify arguments.
+ (build_constant_desc): Set DEFERRED_CONSTANT_P on all new
+ SYMBOL_REFs. Clarify comments. Don't set desc->label.
+ (output_constant_def): Do the lookup/insert using the
+ hashtab.h interface. Don't muck with n_deferred_constants or
+ DEFERRED_CONSTANT_P here.
+ Always call maybe_output_constant_def_contents.
+ (maybe_output_constant_def_contents): Take a pointer to the
+ descriptor, not the EXP and RTL separately. Return
+ immediately if this constant is not deferred. Defer output of
+ everything, except writable string constants. Update
+ n_deferred_constants here.
+ (output_constant_def_contents): Now takes just one argument,
+ an rtx. Clear DEFERRED_CONSTANT_P here.
+ (mark_constant_pool): Update for rename of n_deferred_strings.
+ (mark_constant): Don't clear DEFERRED_CONSTANT_P here.
+
+ (init_varasm_status): Clear p->deferred_constants.
+ (init_varasm_once): Call htab_create_ggc for const_desc_htab.
+
+2003-05-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (expand_builtin_stpcpy): Only expand when the length
+ of the source string can be evaluated at compile-time.
+
+2003-05-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * testsuite/gcc.c-torture/compile/simd-6.c: New.
+
+ * c-typeck.c (digest_init): Handle arrays of vector constants.
+
+2003-05-05 Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (expand_builtin_mempcpy): New function.
+ (expand_builtin_stpcpy): Optimize stpcpy whose return value is
+ ignored into strcpy no matter what arguments it has.
+ (expand_builtin) <case BUILT_IN_MEMPCPY>: Call
+ expand_builtin_mempcpy.
+
+2003-05-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * testsuite/gcc.dg/20030505.c: New.
+
+ * c-typeck.c (convert_for_assignment): Opaque pointers can
+ interconvert.
+
+ * config/rs6000/rs6000.c: New global opaque_p_V2SI_type_node.
+ (rs6000_init_builtins): Initialize opaque_p_V2SI_type_node.
+ (spe_init_builtins): Rename all pv2si_type_node to
+ opaque_p_V2SI_type_node.
+ Remove declaration of pv2si_type_node.
+ (is_ev64_opaque_type): Accept opaque pointers.
+
+2003-05-05 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (validate_condition_mode): Use
+ flag_finite_math_only.
+ (rs6000_reverse_condition): Never return UNKNOWN; use
+ flag_finite_math_only.
+ (rs6000_generate_compare): Use flag_finite_math_only.
+ (rs6000_emit_cmove): Handle UNLE. Support UNEQ under -ffast-math.
+ Use HONOR_* rather than flag_unsafe_math_optimizations. Correct
+ UNGE and GT cases. Handle UNEQ and LTGT when ! HONOR_NANS.
+
+ * toplev.c (check_global_declarations): Suppress not-used warning
+ for volatile variables.
+
+2003-05-05 Olivier Hainque <hainque@act-europe.fr>
+
+ * expr.c (expand_expr, case BIT_FIELD_REF): Refine the test forcing
+ usage of bitfield instructions for mode1 != BLKmode, only ignoring
+ SLOW_UNALIGNED_ACCESS if the field is not byte aligned.
+ (store_field): Likewise.
+
+2003-05-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add
+ evsubifw to builtins accepting 5-bit unsigned constants.
+ (easy_vector_constant): Return if V1DImode. Fix typo.
+
+2003-05-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.h: Revert licensing change from last patch.
+
+2003-05-05 DJ Delorie <dj@redhat.com>
+
+ * config/stormy16/stormy16.md (negsi2): Allocate the pseudos
+ before reload, but defer the split until after.
+ * config/stormy16/stormy16.c (xstormy16_expand_arith): Modify
+ to match.
+
+2003-05-05 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add 440 support.
+ * config/rs6000/vxworks.h (CC1_SPEC): Use -mcpu=440 for t440.
+
+2003-05-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc
+ is defined.
+
+2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-attrs.def (ATTR_NOTHROW_NONNULL_1,
+ ATTR_NOTHROW_NONNULL_2, ATTR_NOTHROW_NONNULL_3): Renamed from
+ ATTR_NONNULL_1, ATTR_NONNULL_2 and ATTR_NONNULL_3.
+
+ (ATTR_NOTHROW_NONNULL_1_2, ATTR_NOTHROW_NONNULL_1_4,
+ ATTR_CONST_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1,
+ ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_MALLOC_NOTHROW_NONNULL_1):
+ New.
+
+ * builtins.def (DEF_EXT_FALLBACK_BUILTIN): Accept ATTRS argument.
+ (BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Update comment
+
+ (BUILT_IN_INDEX, BUILT_IN_RINDEX, BUILT_IN_MEMCPY,
+ BUILT_IN_MEMMOVE, BUILT_IN_MEMCMP, BUILT_IN_MEMSET,
+ BUILT_IN_MEMPCPY, BUILT_IN_STRCAT, BUILT_IN_STRNCAT,
+ BUILT_IN_STPCPY, BUILT_IN_STRCPY, BUILT_IN_STRNCPY,
+ BUILT_IN_STRCMP, BUILT_IN_STRNCMP, BUILT_IN_STRLEN,
+ BUILT_IN_STRSTR, BUILT_IN_STRPBRK, BUILT_IN_STRSPN,
+ BUILT_IN_STRCSPN, BUILT_IN_STRCHR, BUILT_IN_STRRCHR, BUILT_IN_NAN,
+ BUILT_IN_NANF, BUILT_IN_NANL, BUILT_IN_NANS, BUILT_IN_NANSF,
+ BUILT_IN_NANSL, BUILT_IN_PUTS, BUILT_IN_FPUTC, BUILT_IN_FPUTS,
+ BUILT_IN_FWRITE, BUILT_IN_PUTS_UNLOCKED, BUILT_IN_FPUTC_UNLOCKED,
+ BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FWRITE_UNLOCKED,
+ BUILT_IN_STRDUP): Add "nonnull" attribute.
+
+2003-05-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * expr.c (store_field): Don't clobber TEMP in shift: it might be
+ a variable.
+ (get_inner_reference): Don't go through a VIEW_CONVERT_EXPR
+ whose purpose is to step up the alignment.
+ (expand_expr, case ADDR_EXPR): Force LO_SUM into memory, just like REG.
+
+ * stor-layout.c (compute_record_mode): Relax restriction
+ on fields crossing word boundaries forcing BLKmode.
+
+2003-05-04 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppinit.c (cpp_create_reader, post_options): Warn about
+ trigraphs unless explicity set or -trigraphs.
+ * cpplex.c (warn_in_comment): New.
+ (_cpp_process_line_notes): Better handling of -Wtrigraphs.
+ (_cpp_skip_block_comment): Add call to _cpp_process_line_notes.
+ * doc/cppopts.texi, doc/cpp.texi: Update.
+
+2003-05-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (LIBGCOV): Add _gcov_merge_add.
+ * gcov-io.h: Make GCOV_LINKAGE extern in libgcov and prevent resulting
+ namespace clash.
+ (GCOV_MERGE_FUNCTIONS): New.
+ (gcov_merge_fn): Declare.
+ (struct gcov_ctr_info): New field "merge".
+ (__gcov_merge_add): Declare.
+ * coverage.c (ctr_merge_functions): New.
+ (build_ctr_info_type, build_ctr_info_value): Initialize merge field
+ of gcov_ctr_info type.
+ * libgcov.c (__gcov_merge_add): New.
+ (gcov_exit): Call a hook to merge values of counters.
+
+2003-05-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * toplev.h (pedwarn_with_file_and_line): Don't declare.
+ * diagnostic.c (pedwarn_with_file_and_line): Remove.
+
+2003-05-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * varasm.c (assemble_variable): Don't use error_with_file_and_line.
+
+2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (expand_builtin_constant_p, expand_builtin_strlen,
+ expand_builtin_frame_address): Update prototypes.
+ (expand_builtin_constant_p, expand_builtin_strlen,
+ expand_builtin_strcpy, expand_builtin_memset,
+ expand_builtin_bzero, expand_builtin_args_info,
+ expand_builtin_frame_address): Pass in just the argument(s)
+ needed, not the entire expression `exp'.
+ (expand_builtin): Update all calls to these functions.
+
+2003-05-03 Richard Henderson <rth@redhat.com>
+
+ * builtins.c (expand_builtin) <BUILT_IN_DWARF_FP_REGNUM>: Remove.
+ <BUILT_IN_DWARF_SP_COLUMN>: New.
+ * builtins.def (BUILT_IN_DWARF_FP_REGNUM): Remove.
+ (BUILT_IN_DWARF_SP_COLUMN): New.
+ * dwarf2out.c (expand_builtin_dwarf_fp_regnum): Remove.
+ (expand_builtin_dwarf_sp_column): New.
+ * except.h: Update to match.
+ * unwind-dw2.c (execute_stack_op): Correct stack push typo.
+ (execute_cfa_program): Record location expression address
+ before extracting length.
+ (uw_update_context_1): Install old CFA into stack pointer column.
+ (uw_init_context_1): Set cfa_reg to stack pointer column.
+
+2003-05-03 Richard Henderson <rth@redhat.com>
+
+ * config/rs6000/rs6000.c (constant_pool_expr_p): Make static and
+ return bool.
+ (toc_relative_expr_p): Likewise.
+ (SPE_CONST_OFFSET_OK): Move from rs6000.h.
+ (legitimate_constant_pool_address_p): Move from rs6000.h, change
+ into a function, downcase all users.
+ (legitimate_small_data_p): Likewise.
+ (legitimate_offset_address_p): Likewise.
+ (legitimate_indexed_address_p): Likewise.
+ (legitimate_indirect_address_p): Likewise.
+ (legitimate_lo_sum_address_p): Likewise.
+ (rs6000_mode_dependent_address): Likewise.
+ * rs6000.h (CONSTANT_POOL_EXPR_P, TOC_RELATIVE_EXPR_P): Remove.
+ (SPE_CONST_OFFSET_OK, LEGITIMATE_CONSTANT_POOL_ADDRESS_P,
+ LEGITIMATE_SMALL_DATA_P, LEGITIMATE_OFFSET_ADDRESS_P,
+ LEGITIMATE_INDEXED_ADDRESS_P, LEGITIMATE_INDIRECT_ADDRESS_P,
+ LEGITIMATE_LO_SUM_ADDRESS_P): Move into rs6000.c.
+ (LEGITIMATE_ADDRESS_INTEGER_P): Remove.
+ (GO_IF_MODE_DEPENDENT_ADDRESS): Use rs6000_mode_dependent_address.
+ * config/rs6000/rs6000-protos.h: Update.
+
+2003-05-03 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.h (REVERSIBLE_CC_MODE): Define.
+ (REVERSE_CONDITION): Define.
+
+ * config/rs6000/rs6000.c (scc_comparison_operator): Make equivalent
+ to branch_positive_comparison_operator.
+ (ccr_bit): Check that sCOND conditions are actually a positive bit.
+ (print_operand): Remove %D substitution.
+ (rs6000_emit_sCOND): Generate complement operation to ensure that
+ sCOND input is a positive bit.
+ * config/rs6000/rs6000.md: Rearrange sCOND templates to be in the
+ same order as bCOND, and add the missing ones. Remove the %D
+ substitutions from the scc patterns.
+
+ * simplify-rtx.c (simplify_relational_operation): Add case for
+ ! (fabs(x) < 0.0).
+
+2003-05-03 Bruce Korb <bkorb@gnu.org>
+
+ * gcc/fixinc/fixincl.tpl(dne): restore this to force merge conflicts
+ in fixincl.x
+ * gcc/fixinc/inclhack.def(bsd_stdio_attrs_conflict): fix placement
+
+2003-05-03 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.h: Remove unecessary casts. Misc cleanups.
+
+2003-05-03 Zack Weinberg <zack@codesourcery.com>
+
+ PR c/10604
+ * c-common.c (warn_sign_compare): Initialize to -1.
+ * c-opts.c (c_common_init_options): Don't set warn_sign_compare here.
+ (c_common_decode_option <OPT_Wall>): Set warn_sign_compare
+ for C++ only.
+ (c_common_post_options): Set warn_sign_compare from extra_warnings
+ if it's still -1 at this point.
+
+ * toplev.c (maybe_warn_unused_parameter): New static variable.
+ (set_Wextra): New static function.
+ (W_options): Remove "extra".
+ (decode_W_option): Call set_Wextra.
+ (independent_decode_option): Likewise.
+ (set_Wunused): Cooperate with set_Wextra in setting
+ warn_unused_parameter.
+ (rest_of_compilation): No need to check extra_warnings as
+ well as warn_uninitialized.
+
+ * c-typeck.c (build_binary_op, build_conditional_expr):
+ No need to check extra_warnings as well as warn_sign_compare.
+ (internal_build_compound_expr): No need to check extra_warnings
+ as well as warn_unused_value.
+ * function.c (expand_function_end): No need to check extra_warnings
+ as well as warn_unused_parameter.
+ * stmt.c (expand_expr_stmt_value): No need to check extra_warnings
+ as well as warn_unused_value.
+
+ * doc/invoke.texi: Clarify documentation of -Wsign-compare.
+
+ * Makefile.in: Disable -Werror for gengtype-lex.o.
+
+2003-05-03 Olivier Hainque <hainque@act-europe.fr>
+
+ * emit-rtl.c (last_call_insn, add_function_usage_to): New functions.
+ * rtl.h (last_call_insn, add_function_usage_to): New prototypes.
+ * builtins.c (expand_builtin_apply): Use the new emit-rtl functions.
+ * calls.c (emit_call_1): Likewise.
+ (expand_call): For calls initializing constant memory, replace
+ emission of standalone mem /u clobber with function usage entry.
+ * expr.c (emit_block_move_via_libcall): Likewise.
+ * cse.c (count_reg_usage, case EXPR_LIST): New case.
+ * flow.c (propagate_one_insn): Pass entire operand of
+ CALL_INSN_FUNCTION_USAGE to mark_used_regs.
+ * integrate.c (try_constants): For CALL_INSNs, substitute constants
+ within the FUNCTION_USAGE also.
+ * loop.c (prescan_loop): Note clobbers of const mem mentioned in
+ FUNCTION_USAGE lists.
+ * reload1.c (replace_pseudos_in): Renamed.
+ (reload): Use it for clobbers surviving until the end of the reload.
+
+2003-05-03 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * expr.c (expand_expr, case VIEW_CONVERT_EXPR): Don't use
+ gen_lowpart on non-integer modes.
+
+ * stor-layout.c (place_field): When adjusting offset_align, use
+ desired_align, not DECL_ALIGN.
+
+2003-05-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-decl.c (pending_invalid_xref_file): Remove.
+ (pending_invalid_xref_line): Remove.
+ (pending_invalid_xref_location): New.
+ (lookup_label): Use location_t and input_location directly.
+ (lookup_tag): Likewise.
+ (pending_xref_error): Likewise.
+ (c_expand_body_1): Likewise.
+ * c-common.c (x_expand_start_cond): Likewise.
+ * c-semantics.c (genrtl_for_stmt): Likewise.
+ (find_reachable_label): Likewise.
+ * expr.c (expand_expr): Likewise.
+ * integrate.c (output_inline_function): Likewise.
+ * tree-inline.c (find_alloca_call): Likewise.
+ (find_builtin_longjmp_call): Likewise.
+ * gcc.c (input_filename): Make static.
+
+2003-05-03 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md: Fix comment typo.
+
+ * config/mips/mips.c (mips_integer_op): New structure.
+ (MIPS_MAX_INTEGER_OPS): Define.
+ (mips_const_insns): Use mips_build_integer to determine the number
+ of instructions needed to load a CONST_INT.
+ (move_operand): Reject compound CONST_INTs.
+ (mips_build_shift, mips_build_lower, mips_build_integer): New fns.
+ (mips_move_integer): New fn.
+ (mips_legitimize_const_move): Pass CONST_INTs to mips_move_integer.
+ (mips_legitimize_move): Only legitimize constants when moving
+ word or subword values.
+
+2003-05-02 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * Makefile.in (gcov-iov.h): Use move-if-change and a stamp.
+
+2003-05-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (expand_builtin_stpcpy): Copy `arglist' before
+ modifying it.
+
+2003-05-03 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Add Zdenek Dvorak, Aldy
+ Hernandez, and Kazu Hirata. Update Richard Henderson.
+
+2003-05-02 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_attribute_table): Add 'extern'
+ to tentative declaration.
+
+ * config/rs6000/sysv4.h (SYMBOL_FLAG_SMALL_V4): Delete.
+ (SYMBOL_FLAG_SMALL_V4): Delete.
+ * config/rs6000/rs6000.c (small_data_operand): Use SYMBOL_REF_SMALL_P.
+ (rs6000_elf_encode_section_info): Don't set SYMBOL_FLAG_SMALL_V4.
+ (rs6000_elf_in_small_data_p): Add extra section names. Add
+ comment about TREE_PUBLIC test.
+
+ * c-semantics.c (genrtl_switch_stmt, genrtl_if_stmt): Call
+ expand_stmt on result of expand_unreachable_stmt.
+
+2003-05-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Add Daniel Berlin.
+
+2003-05-02 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/{603.md,6xx.md,7450.md,7xx.md,rs64.md}: Decrease
+ number of automata.
+
+ * config/rs6000/rs6000.c (symbol_ref_operand): Check
+ SYMBOL_REF_FUNCTION_P on AIX.
+ (current_file_function_operand): Same.
+ * config/rs6000/rs6000.md (call,call_value): Force non-function
+ symbol_ref into register on AIX.
+
+2003-05-02 Alan Modra <amodra@bigpond.net.au>
+
+ * calls.c (struct arg_data): Move offset, slot_offset, size and
+ alignment_pad to struct locate_and_pad_arg_data. Update all refs.
+ (initialize_argument_information): Adjust call to locate_and_pad_parm.
+ Delete alignment_pad var. Don't calculate slot_offset here.
+ (emit_library_call_value_1): Delete alignment_pad, offset and size
+ vars. Use struct locate_and_pad_arg_data instead. Adjust refs.
+ Adjust call to locate_and_pad_parm. Don't tweak arg size for
+ partial in-regs here. Formatting fixes.
+ * expr.h (struct locate_and_pad_arg_data): New struct.
+ (locate_and_pad_parm): Adjust declaration.
+ * function.c (assign_parms): Localize vars. Use "locate" instead of
+ other arg location vars. Don't invoke FUNCTION_ARG or
+ FUNCTION_INCOMING_ARG unless pretend_named is different from
+ named_arg. Heed MUST_PASS_IN_STACK and set up "partial" before
+ calling locate_and_pad_parm. Adjust locate_and_pad_parm call.
+ Use slot_offset for stack home of reg parms. Correct test for
+ parm passed in memory. Formatting fixes.
+ (locate_and_pad_parm): Add "partial" to params. Replace offset_ptr
+ arg_size_ptr and alignment pad with "locate". Set slot_offset here.
+ Correct initial_offset_ptr handling. Localize vars. Always pad
+ locate->offset even when in_regs.
+
+2003-05-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * Makefile.in (TREE_H): Replace location.h with input.h.
+ (GTFILES) Remove location.h
+ (gt-lists.h): Replace gt-location.h with gt-input.h
+ * input.h (input_filename, input_line): Remove variables.
+ (location_s, location_t): Move from location.h.
+ (input_location): New.
+ (input_filename, input_line): New #defines.
+ * location.h: Remove.
+ * tree.h: Replace location.h with input.h.
+ (input_filename, input_line): Remove.
+ * diagnostic.h: Replace location.h with input.h.
+ * gcc.h (input_filename, input_filename_length): Remove declarations.
+ * toplev.c (input_filename, input_line): Remove.
+ (input_location): Define.
+ (push_srcloc, pop_srcloc): Adjust.
+ * diagnostic.c (diagnostic_report_current_module): Adjust.
+
+2003-05-02 Nick Clifton <nickc@redhat.com>
+
+ * configure.in: Add xstormy16 to list of targets that has a nop
+ instruction and hence which can be tested to see if the
+ assembler supports the --gdwarf2 switch.
+ * configure: Regenerate.
+
+2003-05-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR target/8257
+ * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue,
+ alpha_start_function, alpha_expand_epilogue, unicosmk_gen_dsib):
+ Avoid undefined shifts by making the shift operand unsigned.
+
+2003-05-01 DJ Delorie <dj@redhat.com>
+
+ * reload.c (find_reloads): Also check that all of a multi-reg
+ value is in the class.
+
+2003-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * scan.h (lineno): Revert the rename here.
+
+2003-05-01 Stan Shebs <shebs@apple.com>
+
+ * config/darwin.c (darwin_encode_section_info): Call
+ default_encode_section_info.
+
+2003-05-01 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md (define_attr "type"): Add mfjmpr.
+ (movsi_internal1): Use new mfjmpr attribute.
+ (movhi_internal): Same.
+ (movqi_internal): Same.
+ (movcc_internal1): Same.
+ (movdi_internal64): Same.
+ * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md,
+ power4.md,rios1.md,rios2.md,rs64.md}: Add mfjmpr.
+ * config/rs6000/40x.md: Add fpu_405.
+ * config/rs6000/power4.md: Merge power4lsu and power4disp automata
+ into power4misc automata. Remove extraneous parentheses.
+ * config/rs6000/440.md: New file.
+ * config/rs6000/rs6000.c (processor_target_table): Add 440,
+ 440fp. Rename 405f to 405fp.
+ (function_arg_padding): Correct formatting.
+ (rs6000_rtx_costs): Add PROCESSOR_PPC440 cases.
+
+2003-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * input.h (lineno): Rename to ...
+ (input_line): ... here.
+ * tree.h (lineno): Rename to ...
+ (input_line): ... here.
+ * scan.h (lineno): Rename to ...
+ (input_line): ... here.
+ * toplev.c (lineno): Rename to ...
+ (input_line): ... here.
+ (push_srcloc, pop_srcloc): Rename lineno to input_line.
+ * c-common.c (c_expand_start_cond, fname_decl): Likewise.
+ * c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag,
+ store_parm_decls, c_expand_body_1): Likewise.
+ * c-errors.c (pedwarn_c99): Likewise.
+ * c-format.c (status_warning): Likewise.
+ * c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise.
+ * c-opts.c (c_common_post_options, c_common_parse_file): Likewise.
+ * c-parse.in (save_filename, maybe_type_qual, ifc): Likwise.
+ * c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var,
+ gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt,
+ genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt,
+ genrtl_return_stmt, genrtl_for_stmt, build_break_stmt,
+ build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt,
+ prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise.
+ * coverage.c (create_coverage): Likewise.
+ * diagnostic.c (pedwarn, sorry, error, fatal_error,
+ internal_error, warning, diagnostic_report_current_module,
+ inform): Likewise.
+ * expr.c (expand_expr): Likewise.
+ * integrate.c (expand_inline_function,
+ output_inline_function): Likewise.
+ * rtl-error.c (file_and_line_for_asm): Likewise.
+ * tree-inline.c (find_alloca_call, find_builtin_longjmp_call,
+ walk_tree): Likewise.
+ * tree.c (make_node): Likewise.
+ * ada, cp, f, java, objc, treelang: Likewise.
+ * objc/objc-act.c (objc_init): Rename lineno to input_line.
+ (build_module_descriptor, build_selector_translation_table,
+ build_protocol_template, build_method_prototype_list_template,
+ build_category_template, build_selector_table,
+ build_class_template, build_super_template, build_ivar_template,
+ build_ivar_list_template, build_method_list_template,
+ build_method_template, add_instance_variable): Likewise.
+
+ * dwarf2out.c (dwarf2out_init, dwarf2out_finish): Change parameter
+ name from input_filename.
+
+2003-04-30 Eric Christopher <echristo@redhat.com>
+ Richard Sandiford <rsandifo@redhat.com>
+
+ * configure: Regenerate from patches below.
+ * combine.c (gen_lowpart_for_combine): Fix comment and add tests
+ for all symbolic operands.
+ * config/mips/mips.c: Migrate RTX_COSTS and CONST_COSTS
+ to function.
+ * config/mips/linux.h: Fix typo.
+ * Merge from mips-3_4-rewrite branch:
+
+ 2003-04-07 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_classify_symbol): Add catch-all case for
+ handling local labels when TARGET_ABICALLS.
+
+ 2003-04-04 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_expand_epilogue): Add an
+ integer argument.
+ (mips_expand_call): Likewise.
+ * config/mips/mips.h (TARGET_SIBCALLS): New macro.
+ (FIXED_REGISTERS): Clear $31 entry.
+ (CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTER): Likewise.
+ (EPILOGUE_USES): Define.
+ * config/mips/mips.c (mips_function_ok_for_sibcall): New function.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Use it.
+ (override_options): Add a 'j' register class.
+ (mips_expand_call): Handle sibcalls
+ (mips_expand_epilogue): Handle epilogues for sibcalls.
+ * config/mips/mips.md (epilogue): Adjust call to mips_expand_epilogue.
+ (sibcall_epilogue): New pattern.
+ (call, call_value): Adjust calls to mips_expand_call.
+ (sibcall, sibcall_value): New expanders.
+ (sibcall_internal, sibcall_value_internal): New patterns.
+ (sibcall_value_multiple_internal): New pattern.
+
+ 2003-03-25 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (extended_mips16): New attribute.
+ (define_attr length): Default to 8 if extended_mips16 == yes.
+ (truncdisi2): Set extended_mips16 to yes for the sll alternative.
+ (truncdihi2, truncdiqi2, *extendsidi2): Likewise.
+ (call_internal): Set extended_mips16 to yes for direct jumps.
+ Remove redundant mode attribute.
+ (call_value_internal, call_value_multiple_internal): Likewise.
+ (call_split): Remove redundant mode attribute.
+ (call_value_split, call_value_multiple_split): Likewise.
+
+ * config/mips/mips.c (mips_symbol_insns): Rework. Fix handling
+ of unaligned offsets.
+
+ * config/mips/mips.c (mips_splittable_symbol_p): Fix handling
+ of SYMBOL_GENERAL.
+
+ 2003-03-22 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (TARGET_EXPLICIT_RELOCS): Add commentary.
+ * config/mips/mips.c (override_options): Disable -mexplicit-relocs
+ for mips16 code.
+
+ 2003-03-22 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (ADDRESS_COST): Define.
+
+ 2003-03-20 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (EXTRA_CONSTRAINT): Give existing meaning of
+ 'R' to 'U'. Make 'R' mean a single-instruction memory reference.
+ * config/mips/mips.md: Replace 'R' constraints with 'U'.
+
+ 2003-03-18 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (truncdisi2): Add commentary. Use sll instead
+ of a two-instruction sequence. Add register->memory alternative.
+ (truncdihi2, truncdiqi2): Likewise.
+ Rework shift/truncate instructions so that they only handle right
+ shifts of 32 (or more, in the case of arithmetic shifts).
+ Add patterns for truncate/sign-extend.
+
+ 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * configure.in (mips*-*-*): Check for explicit relocation support.
+ * configure: Regenerate.
+
+ 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (TARGET_SWITCHES): Add -mexplicit-relocs
+ and -mno-explicit-relocs.
+ (MASK_EXPLICIT_RELOCS): Define.
+ (TARGET_EXPLICIT_RELOCS): Use it.
+ (mips_split_addresses): Remove declaration.
+ * config/mips/mips.c (override_options): Update comment for
+ mips_split_addresses. Clear MASK_EXPLICIT_RELOCS for non-PIC n64.
+
+ 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * combine.c (gen_lowpart_for_combine): Treat the lowpart Pmode of
+ a CONST as identity. Check the return value of gen_lowpart_common.
+
+ 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_legitimize_symbol): Handle small data
+ references for TARGET_EXPLICIT_RELOCS.
+ (mips_reloc_string): Return "%gp_rel(" for RELOC_GPREL16 if
+ !TARGET_MIPS16.
+
+ 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md: Replace 'IQ' mips16 constraints with just 'Q'.
+ (addsi3): Remove redundant constraints.
+ (addsi3_internal): Use separate register & constant alternatives.
+ Use a 'Q' constraint and "addiu" insn for the latter.
+ (adddi3_internal_3, addsi3_internal_2): Likewise.
+
+ 2003-03-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_expand_unaligned_load): Declare.
+ (mips_expand_unaligned_store): Declare.
+ * config/mips/mips.c (mips_get_unaligned_mem): New fn.
+ (mips_expand_unaligned_load, mips_expand_unaligned_store): New fns.
+ * config/mips/mips.md (UNSPEC_ULW, UNSPEC_USW): Remove.
+ (UNSPEC_ULD, UNSPEC_USD): Remove.
+ (UNSPEC_LWL, UNSPEC_LWR, UNSPEC_SWL, UNSPEC_SWR): New.
+ (UNSPEC_LDL, UNSPEC_LDR, UNSPEC_SDL, UNSPEC_SDR): New.
+ (extv, extzv): Use mips_expand_unaligned_load.
+ (insv): Use mips_expand_unaligned_store. Use a reg_or_0_operand
+ predicate for operand 3.
+ (movsi_ulw, movsi_usw): Replace with...
+ (mov_lwl, mov_lwr, mov_swl, move_swr): ...these new insns.
+ (movdi_uld, movdi_usd): Likewise replace with...
+ (mov_ldl, mov_ldr, mov_sdl, move_sdr): ...these insns.
+
+ 2003-02-26 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_global_pic_constant_p): Declare.
+ * config/mips/mips.h (LEA_REGS): New register class.
+ (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add entries for it.
+ (GR_REG_CLASS_P): Include LEA_REGS.
+ (DANGEROUS_FOR_LA25_P): New macro.
+ (EXTRA_CONSTRAINT): Add !DANGEROUS_FOR_LA25_P to R's condition.
+ Add a T constraint for the DANGEROUS_FOR_LA25_P case.
+ * config/mips/mips.c (mips_regno_to_class): Change GR_REGS
+ entries to LEA_REGS.
+ (mips_global_pic_constant_p): New function.
+ (override_options): Add 'e' register constraint.
+ (mips_secondary_reload_class): Return LEA_REGS when reloading
+ a dangerous constant into a class containing $25.
+ * config/mips/mips.md (movdi_internal2): Add an e <- T alternative.
+ (movsi_internal): Likewise.
+
+ 2003-02-23 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (TARGET_SPLIT_CALLS): New macro.
+ * config/mips/mips.md (call_split): New insn.
+ (call_value_split, call_value_multiple_split): New insns.
+ (call_internal): Turn into a define_insn_and_split. Split the
+ instruction into a call and $gp load if TARGET_SPLIT_CALLS.
+ (call_value_internal, call_value_multiple_internal): Likewise.
+
+ 2003-02-23 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_reloc_string): Return "%got(" for
+ RELOC_GOT_PAGE and RELOC_GOT_DISP if !TARGET_NEWABI.
+ (mips_encode_section_info): Don't take symbol visibility into
+ account if TARGET_ABICALLS. Add more commentary.
+ * config/mips/mips.md: Add commentary above reloc constants.
+
+ 2003-02-12 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_legitimize_const_move): New, extracted
+ from mips_legitimize_move. Legitimize constant pool references.
+ (mips_legitimize_move): Call mips_legitimize_const_move. Attach
+ a REG_EQUAL note to the last instruction.
+
+ 2003-02-11 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_simplify_dwarf_addr): Declare.
+ * config/mips/mips.h (TARGET_EXPLICIT_RELOCS, TARGET_NEWABI): New.
+ (ASM_SIMPLIFY_DWARF_ADDR): Define to mips_simplify_dwarf_addr.
+ (EXTRA_CONSTRAINT): Allow symbolic call addresses for TARGET_ABICALLS.
+ * config/mips/mips.md (UNSPEC_HIGH): New constant.
+ (UNSPEC_RELOC_GPREL16): Rename to...
+ (RELOC_GPREL16): ...this.
+ (RELOC_GOT_HI, RELOC_GOT_LO, RELOC_GOT_PAGE, RELOC_GOT_DISP): New.
+ (RELOC_CALL16, RELOC_CALL_HI, RELOC_CALL_LO): New.
+ (macro_calls): New attribute.
+ (length): Use it to set the default length of calls. Don't allow
+ calls to have delay slots if macro_calls is "yes".
+ (luisi, luidi): New patterns.
+ (lowsi, lowdi): Use '%R' to print the relocation.
+ (lowdi_extend): Remove.
+ (loadgp): Remove mode from operand 0. Use '%0' instead of '%a0'.
+ (call_internal): Merge alternatives. Always use "jal".
+ (call_value_internal, call_value_multiple_internal): Likewise.
+ (reloc_gprel16): Remove.
+ * config/mips/mips.c (mips_got_alias_set): New variable.
+ (mips_classify_constant): Handle the new relocation constants.
+ (mips_classify_symbol): Reverse the sense of SYMBOL_REF_FLAG for PIC.
+ (mips_symbolic_address_p): Return false if generating explicit relocs.
+ Otherwise allow local PIC symbols to have an offset.
+ (mips_splittable_symbol_p): New function.
+ (mips_classify_address): Use it to check whether a LO_SUM is valid.
+ (mips_const_insns): Always accept HIGH.
+ (call_insn_operand): Don't accept global symbols if using explicit
+ relocs.
+ (move_operand): Don't accept HIGH when generating PIC.
+ (mips_reloc, mips_lui_reloc): New functions.
+ (mips_force_temporary): Remove MODE argument. Expect VALUE to
+ be a valid right-hand-side for a SET pattern.
+ (mips_load_got, mips_load_got16, mips_load_got32): New functions.
+ (mips_emit_high): New function.
+ (mips_legitimize_symbol): Use mips_reloc for the mips16 gp-relative
+ case. Use mips_splittable_symbol_p to check whether a LO_SUM
+ address should be used. Use mips_emit_high to generate the
+ high part of such an address. Adjust the global symbol + offset
+ case to match the change to mips_force_temprorary.
+ (mips_legitimize_move): Shuffle call to mips_legitimize_symbol.
+ If generating explicit-reloc PIC, load the address of global
+ symbols from the GOT. Use mips_emit_high to emit the high part
+ of an address.
+ (mips_simplify_dwarf_addr): New function.
+ (mips_move_1word): Use lwc1 instead of l.s and swc1 instead of s.s.
+ (mips_move_2words): Likewise ldc1/l.d and sdc1/s.d if TARGET_64BIT.
+ (mips_expand_call): Load the addresses of global functions using
+ %call* relocs if generating explicit-reloc PIC. Don't generate
+ an exception_receiver pattern.
+ (override_options): Initialize mips_got_alias_set.
+ (print_relocation): Remove in favor of...
+ (mips_reloc_string): ...this new function.
+ (print_operand): Handle '%R'. Use mips_reloc_string.
+ (print_operand_address): Use print_operand to print the symbolic
+ part of a LO_SUM address.
+ (mips_output_function_prologue): Use .cprestore, reverting last patch.
+ (mips_encode_section_info): Factor out DECL_RTL accesses. Reverse
+ sense of SYMBOL_REF_FLAG for PIC, using binds_local_p to check
+ for local symbols.
+
+ 2003-02-02 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips.c (mips_sign_extend): Remove.
+ * config/mips/mips-protos.h: Ditto.
+ * config/mips/mips.md (movdi_internal2_extend): Remove.
+ (extendsidi2): Fix mode of convert_memory_address.
+
+ 2003-01-24 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips.md: Rewrite zero_extend* and extend*
+ patterns. Use explicit instructions and split after reload
+ for register extensions.
+ (ashlsi3_internal1_extend): New combiner pattern for
+ shift and extend combinations.
+ * config/mips/mips.h: Change Pmode back to ptr_mode
+ for performance enhancement.
+ * combine.c (expand_compound_operation): Make sure
+ that zero_extend operation is profitable.
+
+ 2003-01-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (TRAMPOLINE_TEMPLATE): Make size of stored
+ addresses depend on ptr_mode rather than Pmode.
+ (TRAMPOLINE_SIZE, TRAMPOLINE_ALIGNMENT): Update acoordingly.
+ (INITIALIZE_TRAMPOLINE): Rework to handle Pmode != ptr_mode.
+ (CASE_VECTOR_MODE): Use ptr_mode for !TARGET_MIPS16.
+ (ASM_OUTPUT_ADDR_VEC_ELT): Update accordingly.
+ * config/mips/mips.md (tablejump): Likewise. Remove Pmode
+ condition for selecting cpaddsi or cpadddi: use cpadd instead.
+ (tablejump_internal1): Remove condition.
+ (tablejump_internal2): Change condition to TARGET_64BIT.
+ (cpaddsi): Rename to...
+ (cpadd): ...this.
+ (cpadddi): Remove.
+
+ 2003-01-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips16_constant_after_function_p,
+ mips_address_cost, mips_check_split, double_memory_operand,
+ mips16_gp_offset, mips16_gp_offset_p, mips16_constant,
+ pic_address_needs_scratch, symbolic_operand): Remove declarations.
+ (mips_legitimate_address_p): Return bool.
+ (mips_address_insns, mips_fetch_insns, mips_const_insns,
+ mips_legitimize_address, mips_legitimize_move,
+ mips_expand_call): Declare.
+ (mips_return_addr): Move outside #ifdef RTX_CODE.
+
+ * config/mips/mips.h (ABI_HAS_64BIT_SYMBOLS): New macro.
+ (PIC_FN_ADDR_REG): New reg_class.
+ (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add corresponding entries.
+ (GR_REG_CLASS_P): True for PIC_FN_ADDR_REG.
+ (SMALL_OPERAND, SMALL_OPERAND_UNSIGNED, LUI_OPERAND,
+ CONST_HIGH_PART, CONST_LOW_PART, LUI_INT): New macros.
+ (SMALL_INT, SMALL_INT_UNSIGNED, CONST_OK_FOR_LETTER_P): Use new macros.
+ (EXTRA_CONSTRAINTS): Give new meanings to Q, R and S.
+ (CONSTANT_ADDRESS_P): Use mips_legitimate_address_p.
+ (LEGITIMATE_PIC_OPERAND): Undefine.
+ (LEGITIMATE_CONSTANT_P): Use mips_const_insns.
+ (LEGITIMIZE_ADDRESS): Use mips_legitimize_address.
+ (CONSTANT_AFTER_FUNCTION_P): Remove definition in #if 0 block.
+ (FUNCTION_MODE): Change to SImode.
+ (CONST_COSTS): Use mips_const_insns to calculate the cost of
+ most constants. Treat const_artih_operands specially if they
+ occur in a PLUS or MINUS.
+ (CONSTANT_POOL_COST): New macro.
+ (RTX_COSTS): Use mips_address_insns for MEMs, with a base cost of 2.
+ Add LO_SUM handling.
+ (ADDRESS_COST): Undefine.
+ (PREDICATE_CODES): Add symbolic_operand and const_arith_operand.
+ Add CONST to the list of codes for arith_operand. Add LABEL_REF
+ to call_insn_operand and remove CONST_INT.
+
+ * config/mips/mips.c: Include integrate.h.
+ (SINGLE_WORD_MODE_P): New macro.
+ (mips_constant_type, mips_symbol_type, mips_address_type): New enums.
+ (mips_constant_info, mips_address_info): New structs.
+ (mips_regno_to_class): Map $25 to PIC_FN_ADDR_REG.
+ (mips_classify_constant, mips_classify_symbol,
+ mips_valid_base_register_p, mips_symbolic_address_p,
+ mips_classify_address, mips_symbol_insns,
+ mips16_unextended_reference_p, mips_address_insns, mips_const_insns,
+ mips_fetch_insns, mips_force_temporary, mips_add_offset,
+ mips_legitimize_symbol, mips_legitimize_address, mips_legitimize_move,
+ mips_print_relocation): New functions.
+ (const_arith_operand): New operand predicate.
+ (arith_operand): Use it.
+ (mips_const_double_ok, mips16_simple_memory_operand,
+ simple_memory_operand, double_memory_operand, mips_check_split,
+ mips_address_cost, pic_address_needs_scratch, mips16_gp_offset,
+ mips16_gp_offset_p, mips16_output_gp_offset,
+ mips16_constant_after_function_p, mips16_constant): Remove.
+ (call_insn_operand): Be more fussy about symbolic constants.
+ Use register_operand.
+ (move_operand): Use mips_symbolic_address_p to check symbolic
+ operands and general_operand to check the rest.
+ (symbolic_operand): Use mips_classify_constant.
+ (mips_legitimate_address_p): Use mips_classify_address.
+ (mips_move_1word): Combine handling of symbolic addresses.
+ Remove special treatment of gp-relative loads for TARGET_MIPS16.
+ (move_move_2words): Likewise. Assume addresses are offsettable
+ if they need to refer to more than one word. Add HIGH handling.
+ (mips_restore_gp): Use ptr_mode for the GP save slot.
+ (mips_expand_call): New function, combining the old mips.md
+ call and call_internal define_expands. If the address isn't
+ a call_insn_operand, force it into a register. For SVR4 PIC,
+ emit an exception_receiver instruction after the call.
+ (override_options): Only override flag_pic for TARGET_ABICALLS
+ if it is currently zero. Allow mips_split_addresses when
+ Pmode == DImode too, except when ABI_HAS_64BIT_SYMBOLS.
+ Add new register class letter, 'c'.
+ (print_operand): Use mips_classify_constant for constant operands.
+ (print_operand_address): Use mips_classify_address.
+ (mips_output_function_prologue): Don't use .cprestore.
+ (mips_expand_epilogue): For TARGET_MIPS16, only adjust the stack
+ via the frame pointer if current_function_calls_eh_return.
+ (mips_encode_section_info): For TARGET_ABICALLS, use SYMBOL_REF_FLAG
+ to mark whether a symbol is local or global.
+ (build_mips16_call_stub): Expect the address of the function rather
+ than a MEM reference to it. Update call generation sequences.
+ (mips16_optimize_gp): Remove Pmode checks. Temporarily disable
+ small-data adjustments.
+
+ * config/mips/mips.md: Remove 'R'/'m' memory distinction. Use default
+ length for loads and stores.
+ (UNSPEC_CPADD, UNSPEC_RELOC_GPREL16): New constants.
+ (define_attr type): Add const and prefetch.
+ (define_attr length): Use mips_const_insns for const instructions.
+ Use mips_fetch_insns for load and store instructions.
+ (define_attr single_insn): New.
+ (define_attr can_delay): Use it.
+ (define_attr abicalls): Remove.
+ (define_delay): Use can_delay. Always allow calls to have delay slots.
+ (addsi3_internal_2): Add 'Q' constraint.
+ (movsi_ulw, movsi_usw, movdi_uld, movdi_usd): Set length to 8.
+ (high): Remove.
+ (lowsi): Renamed from low.
+ (lowdi): New pattern.
+ (movdi, movsi): Use mips_legitimize_move. Remove define_split.
+ (lwxc1, ldxc1, swxc1, sdxc1): Set length to 4.
+ (loadgp): Change operand 0 to an immediate_operand.
+ (tablejump): Use the same patterns for SVR4 PIC but emit a cpadd
+ beforehand.
+ (cpaddsi, cpadddi): New patterns.
+ (tablejump_internal3, tablejump_internal4): Remove define_expands
+ and associated define_splits.
+ (call, call_value): Use mips_expand_call.
+ (call_internal): New, replacing all existing call_internal* insns.
+ (call_value_internal): Likewise call_value_internal*.
+ (call_value_multiple_internal): Likewise call_value_multiple_internal*.
+ (untyped_call): Remove if (operands[0]) magic.
+ (prefetch_si_address, prefetch_si): Change type to "prefetch".
+ (prefetch_di_address, prefetch_di): Likewise.
+ (leasi, leadi): Remove.
+ (reloc_gprel16): New.
+
+ * config/mips/5400.md (ir_vr54_hilo): Include const type.
+ * config/mips/5500.md (ir_vr55_hilo): Likewise.
+ * config/mips/sr71k.md (ir_sr70_hilo): Likewise.
+
+ 2003-01-08 Eric Christopher <echristo@redhat.com>
+
+ * config.gcc (mipsisa32*): Change ABI_MEABI to ABI_EABI.
+ * config/mips/elf.h (STARTFILE_SPEC): Remove ABI_MEABI references and
+ configure check for libgloss.
+ * config/mips/elf64.h: Ditto.
+ * config/mips/mips.c: Remove ABI_MEABI.
+ * config/mips/mips.h: Ditto.
+
+ 2002-11-05 Richard Sandiford <rsandifo@redhat.com>
+
+ Fix merge fallout.
+ * config/mips/mips.md (mul_acc_si): Reapply 2002-10-16 change.
+ (muldi3_internal): Remove outdated comment.
+ (*muls_di, *umuls_di): Fix comment and 64-bitness.
+ (*smsac_di, *umsac_di): Likewise. Reformat.
+ (umulsi3_highpart): Minor formatting tweaks.
+ (umulsi3_highpart_internal): Use only if !ISA_HAS_MULHI. Remove
+ redundant scratch operand. Minor formatting tweak.
+ (umulsi3_highpart_mulhi_internal): Use for !TARGET_64BIT as well.
+ (umulsi3_highpart_neg_mulhi_internal): Likewise. Fix asm template.
+ (smulsi3_highpart): As for the unsigned version.
+ (smulsi3_highpart_internal): Likewise.
+ (smulsi3_highpart_mulhi_internal): Likewise.
+ (smulsi3_highpart_neg_mulhi_internal): Likewise.
+ (smuldi3_highpart, umuldi3_highpart): Minor formatting tweaks.
+ (*smul_acc_di): Remove duplicated pattern.
+ (*umul_acc_di, *smul_acc_di): Reapply 2002-10-16 change.
+ (anddi3) [unnamed mips16 pattern]: Remove reintroduced length.
+ (zero_extendsidi2_internal2): Remove new, but commented-out pattern.
+
+ 2002-10-22 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_return_addr): New.
+ * config/mips/mips.c (mips_return_addr): New.
+ (movdi_operand): Remove.
+ (se_register_operand): Ditto.
+ (se_reg_or_0_operand): Ditto.
+ (se_uns_arith_operand): Ditto.
+ (se_arith_operand): Ditto.
+ (se_nonmemory_operand): Ditto.
+ (extend_operator): Ditto.
+ (highpart_shift_operator): Ditto.
+ (mips_initial_elimination_offset): Remove return address pointer
+ elimination.
+ (mips_reg_names): Remove $ra.
+ (mips_regno_to_class): Ditto.
+ * config/mips/mips.h (POINTER_SIZE): Define based on TARGET_LONG64
+ and TARGET_64BIT.
+ (POINTER_BOUNDARY): Remove.
+ (POINTERS_EXTEND_UNSIGNED): Define to 0.
+ (PROMOTE_MODE): Promote to Pmode.
+ (SHORT_IMMEDIATES_SIGN_EXTEND): Define.
+ (Pmode): Define to TARGET_64BIT.
+ (FUNCTION_MODE): Define as Pmode.
+ (mips_args): Remove deleted functions.
+ (SIZE_TYPE): Depend on POINTER_SIZE.
+ (PTRDIFF_TYPE): Ditto.
+ (FIXED_REGISTERS): Fix extra registers.
+ (CALL_USED_REGISTERS): Ditto.
+ (CALL_REALLY_USED_REGISTERS): Ditto.
+ (RAP_REG_NUM): Remove.
+ (RETURN_ADDRESS_POINTER_REGNUM): Ditto.
+ (RETURN_ADDR_RTX): Define to mips_return_addr.
+ (ELIMINABLE_REGS): Remove RETURN_ADDRESS_POINTER_REGNUM.
+ (CAN_ELIMINATE): Ditto.
+ * config/mips/mips.md: For DImode patterns, take into account
+ deletions above. Split mulsidi patterns into sign_extend and
+ zero_extend.
+
+ 2002-10-16 Richard Sandiford <rsandifo@redhat.com>
+ Michael Meissner <meissner@redhat.com>
+
+ * config/mips/mips.h (ISA_HAS_MACC): True for normal-mode vr4120 code.
+ * config/mips/mips.md (mulsi3_mult3): Add a define_peephole2 to
+ mop up unnecessarly moves through LO.
+ (*mul_acc_si): Remove vr5400 and vr5500 handling from here.
+ (*macc): New pattern for ISA_HAS_MACC. Add define_peephole2s to
+ change mtlo/macc sequences into mul/add sequences when a three-
+ address mul is available.
+ (*macc2): New pattern. Add a define_peephole2 to generate it.
+ (*mul_sub_si): Fix contraint for operand 5.
+ (*muls): Use in 32-bit code as well.
+ (*msac): Likewise. Use msub instead of msac in vr5500 code
+ if the destination is LO. Remove duplicate define_split.
+ (*muls_di): Use only in 32-bit code. Adjust rtl accordingly.
+ (*msac_di): Likewise. Fix formatting.
+ (smulsi3_highpart, umulsi3_highpart): Use mulhi in 32-bit code too.
+ (*xmulsi3_highpart_internal): Use only if !ISA_HAS_MULHI.
+ (*xmulsi3_highpart_mulhi): Use even if !TARGET_64BIT.
+ (*xmulsi3_neg_highpart_mulhi): Likewise.
+ (*mul_acc_64bit_di): Remove.
+ (*mul_acc_di): Use only in 32-bit code. Handle ISA_HAS_MACC as well.
+
+ 2002-10-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/vr.h (DRIVER_SELF_SPECS): Define.
+ * config/mips/t-vr (MULTILIB_OPTIONS): Remove mlong32.
+ (MULTILIB_DIRNAMES): Remove long32.
+ (MULTILIB_EXCEPTIONS): Don't build -mabi=32 -mgp32 multilibs.
+ (MULTILIB_REDUNDANT_DIRS): Remove.
+
+ 2002-10-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * doc/tm.texi (DRIVER_SELF_SPECS): Document.
+ * gcc.c (driver_self_specs): New variable.
+ (do_self_spec): New function.
+ (main): Use it to process driver_self_specs.
+
+ 2002-10-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (one_cmpldi2): Use only if TARGET_64BIT.
+ Remove DImode define_split for !TARGET_64BIT.
+ (anddi3): Remove !TARGET_64BIT support from here as well.
+ Change operand 2's predicate to se_uns_arith_operand.
+ Add constant alternatives to define_insn.
+ (iordi3, xordi3, *nordi3): Likewise.
+ (anddi3_internal1, xordi3_immed): Remove.
+
+ 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (PROCESSOR_R4121): Rename to PROCESSOR_R4120.
+ (TARGET_MIPS4121): Rename to TARGET_MIPS4120.
+ * config/mips/mips.c (mips_cpu_info): Rename vr4121 to vr4120.
+ * config/mips/mips.md: Apply same renaming here.
+
+ 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (PROCESSOR_R4320, TARGET_MIPS4320): Remove.
+ (GENERATE_MULT3_SI): Remove use of TARGET_MIPS4320.
+ * config/mips/mips.c (mips_cpu_info): Remove vr4320 entry.
+ * config/mips/mips.md (define_attr cpu): Remove r4320.
+ Remove vr4320 scheduler and uses of TARGET_MIPS4320.
+
+ 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips16_strings): New variable.
+ (mips_output_function_epilogue): Clear the SYMBOL_REF_FLAG of every
+ symbol in mips16_strings. Free the list.
+ (mips_encode_section_info): Keep track of local strings.
+
+ 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (bunge, bltgt, bungt): New define_expands.
+ (sordered_df, sordered_sf): Remove.
+ * config/mips/mips.c (get_float_compare_codes): New fn.
+ (gen_int_relational, gen_conditional_move): Use it.
+
+ 2002-10-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_emit_fcc_reload): Declare.
+ * config/mips/mips.h (PREDICATE_CODES): Add fcc_register_operand.
+ * config/mips/mips.c (fcc_register_operand): New function.
+ (mips_emit_fcc_reload): New function, extracted from reload_incc.
+ (override_options): Allow TFmode values in float registers
+ if ISA_HAS_8CC.
+ * cnfig/mips/mips.md (reload_incc): Change destination prediate
+ to fcc_register_operand. Remove misleading source constraint.
+ Use mips_emit_fcc_reload.
+ (reload_outcc): Duplicate reload_incc.
+
+
+2003-04-30 Diego Novillo <dnovillo@redhat.com>
+
+ * builtins.def (BUILTIN_CONSTANT_P): Mark as constant.
+
+2003-04-30 Geoffrey Keating <geoffk@apple.com>
+
+ * tree-inline.c (inlinable_function_p): Back out last change, it's
+ unnecessary.
+
+2003-04-30 Steven Bosscher <steven@gcc.gnu.org>
+
+ * ggc-page.c (TREE_EXP_SIZE): Define.
+ (extra_order_size_table): New entry for expr trees with
+ two operands.
+
+2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-common.c (if_elt): Use location_t in lieu of "file, line" pair.
+ (c_expand_start_cond): Adjust.
+ (c_expand_end_cond): Don't use warning_with_file_and_file.
+ (shadow_warning): Likewise.
+
+2003-04-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ * tree.h (DECL_POINTER_DEPTH): Remove.
+ (struct tree_decl): Remove pointer_depth.
+
+2003-04-30 Janis Johnson <janis187@us.ibm.com>
+
+ * config/rs6000/linux64.h (ASM_OUTPUT_LABELREF): Remove.
+ * config/rs6000/rs6000.c (rs6000_elf_strip_name_encoding): Remove.
+ (rs6000_xcoff_encode_section_info): Remove.
+ (current_file_function_operand): Use SYMBOL_REF_FLAGS; fix latent bug.
+ (rs6000_output_mi_thunk): Remove dead code; use SYMBOL_REF_FLAGS.
+ (small_data_operand, rs6000_emit_move, rs6000_elf_in_small_data_p,):
+ Use SYMBOL_REF_FLAGS.
+ (rs6000_elf_encode_section_info): Call default_encode_section_info for
+ generic flags, use SYMBOL_REF_FLAGS; code cleanups.
+ * sysv4.h (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
+ (SYMBOL_FLAG_SMALL_V4, SYMBOL_REF_SMALL_V4_P): New.
+ * xcoff.h (TARGET_ENCODE_SECTION_INFO): Remove.
+ (ASM_DECLARE_FUNCTION_NAME): Remove setting of SYMBOL_REF_FLAG.
+
+2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.c (output_pointer): Use HOST_PTR_PRINTF.
+
+2003-04-30 Andreas Schwab <schwab@suse.de>
+
+ * doc/extend.texi (Other Builtins): Enclose multiple word data
+ type in braces for @deftypefn.
+
+2003-04-30 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * stor-layout.c (mode_for_size_tree): Use BLKmode if SIZE overflows.
+
+ * doc/install.texi (--enable-threads): Document "gnat" option.
+
+2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.h (output_formatted_scalar): Tweak.
+ * diagnostic.c (output_long_decimal): Likewise.
+ (output_unsigned_decimal): Likewise.
+ (output_long_unsigned_decimal): Likewise.
+ (output_octal): Likewise.
+ (output_long_octal): Likewise.
+ (output_hexadecimal): Likewise.
+ (output_long_hexadecimal): Likewise.
+ (output_pointer): New function.
+ (output_format): Use it. Recognize "%p" format specifier.
+
+2003-04-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * function.c (purge_addressof_1): Postpone insn in fewer cases.
+
+2003-04-29 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/host-darwin.c (segv_handler): When -dH is used,
+ call abort() after running out of stack space.
+
+ * c-typeck.c (function_types_compatible_p): Ignore incompatible
+ 'volatile' qualifiers on a function's return type in GNU mode.
+
+2003-04-29 Aldy Hernandez <aldyh@redhat.com>
+
+ * expr.c (emit_group_load): Dump parallels of simd types to
+ memory.
+
+2003-04-29 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (add_vect): Check undefined value for range type
+ too.
+
+2003-04-29 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in: More general test for cmp --ignore-initial.
+ * configure: Regenerate.
+
+2003-04-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * stor-layout.c (mode_for_size_tree): Use tree_low_cst.
+ (layout_decl, place_field): Likewise.
+ Also make minor type and whitespace changes.
+
+ * tree.c (save_expr): Don't fold a COMPONENT_REF.
+
+2003-04-29 Olivier Hainque <hainque@act-europe.fr>
+
+ * calls.c (expand_call): When modes of target and valreg match, force
+ sibcall failure when target is a MEM.
+
+2003-04-29 Geoffrey Keating <geoffk@apple.com>
+
+ * tree-inline.c (inlinable_function_p): Don't support inlining
+ functions using varargs.
+
+ * doc/invoke.texi (Overall Options): Mention -x objective-c-header.
+
+ * dwarf2out.c (output_call_frame_info): No need to output EH
+ unwind information if all_throwers_are_sibcalls.
+
+ * c-semantics.c (expand_unreachable_stmt): Return a tree.
+ (expand_stmt): Update for change to expand_unreachable_stmt.
+ (expand_unreachable_if_stmt): Likewise.
+
+ * Makefile.in (quickstrap): Pass BOOT_CFLAGS to submake.
+
+2003-04-29 Jason Merrill <jason@redhat.com>
+
+ PR middle-end/10336
+ * jump.c (never_reached_warning): Really stop looking if we reach
+ the beginning of the function.
+
+2003-04-29 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/elf.h (SIZE_TYPE, PTRDIFF_TYPE, USER_LABEL_PREFIX):
+ Remove redundant macros.
+ (WCHAR_TYPE, WCHAR_TYPE_SIZE): Change to "short unsigned int".
+ (LOCAL_LABEL_PREFIX): Define unconditionally.
+ (NO_DOT_IN_LABEL): Clarify comment.
+ * config/xtensa/linux.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Add explicit
+ definition to "long int".
+
+2003-04-29 Alexander Kabaev <kan@FreeBSD.ORG>
+
+ bootstrap/10452
+ * gengtype-yacc.y: Improve portability.
+
+2003-04-29 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc: Install obsolete target list for GCC 3.3.
+ * doc/install.texi: Mention in specific-target instructions
+ that certain configurations are deprecated.
+
+2003-04-29 Zack Weinberg <zack@codesourcery.com>
+
+ * tree.h: Delete no-checking definition of CST_OR_CONSTRUCTOR_CHECK.
+
+2003-04-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * c-pragma.c (maybe_apply_renaming_pragma): Fix typo.
+ * gcc.c (display_help): Likewise.
+ * toplev.c (f_options): Likewise.
+ * params.def (PARAM_MAX_INLINE_SCOPE): Likewise.
+ * config/c4x/c4x.h (TARGET_SWITCHES): Likewise.
+ * config/mcore/mcore.h (TARGET_SWITCHES): Likewise.
+ * config/s390/s390.h (TARGET_SWITCHES): Likewise.
+ * config/v850/v850.h (TARGET_SWITCHES): Likewise.
+
+2003-04-29 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * varasm.c (default_assemble_visibility): Use assemble_name.
+
+2003-04-29 David O'Brien <obrien@FreeBSD.org>
+
+ * config/i386/freebsd64.h (LINK_SPEC): Mirror FreeBSD linker.
+ * config/rs6000/freebsd.h (LINK_SHLIB_SPEC): New macro.
+ (SIZE_TYPE): New macro.
+ * config/i386/freebsd-aout.h (NO_PROFILE_COUNTERS): New macro.
+ (SET_ASM_OP): New macro.
+ (HANDLE_SYSV_PRAGMA): New macro.
+ (ASM_WEAKEN_LABEL): New macro.
+
+2003-04-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10180
+ * tree-inline.c (expand_call_inline): Call push_srcloc when
+ encountering EXPR_WITH_FILE_LOCATION. Honor warn_inline.
+
+2003-04-28 Mike Stump <mrs@apple.com>
+
+ * gdbinit.in: Update to reflect new identifier structure.
+
+2003-04-28 Zack Weinberg <zack@codesourcery.com>
+
+ * tree.h (TREE_CST_RTL, CST_OR_CONSTRUCTOR_CHECK): Delete.
+ (struct tree_int_cst, struct tree_real_cst, struct tree_string,
+ struct tree_complex, struct tree_vector): Remove RTL field.
+ (CONSTRUCTOR_ELTS): Use elt 0.
+ * tree.def (CONSTRUCTOR): Delete first of its two operands.
+ * varasm.c (output_constant_def): Remove early exit if
+ TREE_CST_RTL is set. Don't set TREE_CST_RTL.
+ (decode_addr_const): Don't mention TREE_CST_RTL in comment.
+ * target.h (select_section): Don't mention TREE_CST_RTL in comment.
+ * doc/tm.texi (encode_section_info): Don't talk about TREE_CST_RTL.
+
+2003-04-28 Jakub Jelinek <jakub@redhat.com>
+
+ * c-decl.c (finish_decl): When prototype with asmspec is found
+ for built-in, adjust built_in_decls as well as expr.c decls.
+ * expr.c (init_block_move_fn, init_block_clear_fn): New functions.
+ (emit_block_move_libcall_fn, clear_storage_libcall_fn): Use it.
+ * expr.c (init_block_move_fn, init_block_clear_fn): New prototypes.
+
+2003-04-28 Richard Henderson <rth@redhat.com>
+
+ * config/sparc/sparc.c (print_operand): Add 's' to sign-extend.
+ * config/sparc/sparc.md (const_mulsidi3_v8plus): Fix mode of
+ integral constant mult operand.
+ (const_mulsidi3_sp32, const_mulsidi3_sp64): Likewise.
+ (const_smulsi3_highpart_v8plus): Likewise.
+ (const_smulsi3_highpart): Likewise.
+ (const_umulsidi3_sp32): Likewise; sign-extend it in the output.
+ (const_umulsidi3_sp64, const_umulsidi3_v8plus): Likewise.
+ (const_umulsi3_highpart_v8plus): Likewise.
+ (const_umulsi3_highpart): Likewise.
+
+2003-04-28 David O'Brien <obrien@FreeBSD.org>
+
+ * config/i386/x86-64.h (NO_PROFILE_COUNTERS, HAVE_AS_DWARF2_DEBUG_LINE):
+ Define as 1.
+
+2003-04-28 David O'Brien <obrien@FreeBSD.org>
+
+ * config/i386/i386.h (builtin_define): Add __amd64 and __amd64__.
+
+2003-04-28 Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.def (BUILT_IN_BCOPY, BUILT_IN_MEMMOVE): New.
+ * builtin-types.def (BT_FN_VOID_CONST_PTR_PTR_SIZE): New.
+ * builtins.c (expand_builtin_memmove, expand_builtin_bcopy): New
+ functions.
+ (expand_builtin): Handle BUILT_IN_BCOPY and BUILT_IN_MEMMOVE.
+
+2003-04-28 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Remove definition.
+
+2003-04-27 Zack Weinberg <zack@codesourcery.com>
+
+ * expr.c (expand_expr <COMPLEX_CST, STRING_CST>): Always call
+ output_constant_def, use its result instead of TREE_CST_RTL (exp).
+ Can assume it has the form (mem (symbol_ref ".LCxxx")).
+ (expand_expr <COMPONENT_REF>): Can always just extract the
+ relevant field of a CONSTRUCTOR.
+ (expand_expr <ARRAY_REF, COMPONENT_REF, BIT_FIELD_REF,
+ ARRAY_RANGE_REF>): Make control flow explicit.
+ * varasm.c (output_constant_def): Can look at TREE_CST_RTL of
+ an INTEGER_CST.
+
+2003-04-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * reload1.c (reg_set_luid): Fix a comment typo.
+
+2003-04-27 Zack Weinberg <zack@codesourcery.com>
+
+ * varasm.c (const_str_htab_hash, const_str_htab_eq, STRHASH,
+ struct deferred_string, const_str_htab): Kill.
+ (n_deferred_strings): New static variable.
+ (build_constant_desc): Set SYMBOL_REF_DECL of the new
+ symbol_ref to point to the constant.
+ (output_constant_def): When a deferred string is forced out,
+ just clear STRING_POOL_ADDRESS_P and decrement n_deferred_strings.
+ (mark_constant): Likewise.
+ (maybe_output_constant_def_contents): When deferring a string
+ constant, just set STRING_POOL_ADDRESS_P and increment
+ n_deferred_strings.
+ (mark_constant_pool): Check n_deferred_strings, not the size
+ of const_str_htab.
+ (init_varasm_once): No need to create const_str_htab.
+
+ * rtl.def, rtl.h, doc/rtl.texi: Document possibility that
+ SYMBOL_REF_DECL points to a constant.
+
+2003-04-26 Zack Weinberg <zack@codesourcery.com>
+
+ * varasm.c (output_constant_def): Split out two new static
+ functions, build_constant_desc and maybe_output_constant_def_contents.
+ Restructure for comprehensibility. Don't call
+ output_addressed_constants. Treat defstr being non-NULL for
+ STRING_POOL_ADDRESS_P constants as an invariant.
+ (struct deferred_string): Remove labelno field.
+ (output_constant_def_contents): Kill labelno argument. Call
+ output_addressed_constants here. Use ASM_OUTPUT_LABEL, not
+ asm_out.internal_label.
+ (mark_constant): Update call to output_constant_def_contents.
+ Treat defstr being non-NULL for STRING_POOL_ADDRESS_P
+ constants as an invariant.
+
+2003-04-26 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (output_pic_addr_const): Use SYMBOL_REF_LOCAL_P.
+ (ix86_expand_call, ix86_rtx_consts): Likewise.
+
+2003-04-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * doc/md.texi (cmpstr): Document additional restrictions.
+
+2003-04-26 Neil Booth <neil@daikokuya.co.uk>
+
+ * flags.h (time_report): Remove.
+ * timevar.c (timevar_enable): New.
+ (TIMEVAR_ENABLE): Remove, use timevar_enable.
+ (timevar_init): Rename from init_timevar.
+ * timevar.h (timevar_init): Rename from init_timevar.
+ * toplev.c (time_report): Make static.
+ (do_compile): Conditionally call init_timevar first.
+ (preprocess_options): Move some code to do_compile.
+
+2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
+
+ * doc/install.texi (Binaries): Mention binaries for HC11/HC12.
+
+2003-04-26 Neil Booth <neil@daikokuya.co.uk>
+
+ * _cpp_lex_direct: Remove pointless code.
+
+2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
+
+ * doc/extend.texi (Function Attributes): Document "near" and "far"
+ for 68HC11 and 68HC12.
+
+2003-04-25 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * expr.c (store_field): When making temporary for store, don't
+ make it TYPE_QUAL_CONST.
+
+2003-04-25 Phil Edwards <pme@gcc.gnu.org>
+
+ * toplev.c (read_integral_parameter): Use "argument" in error
+ message to distinguish it from actual invalid options.
+
+2003-04-25 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Back out previous
+ addition of __PIC__ and __pic__ macros.
+ * config/xtensa/xtensa.h: Clean up indentation.
+
+2003-04-25 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Remove definition of
+ _GNU_SOURCE. Add definitions of __PIC__ and __pic__.
+ (SUBTARGET_CPP_SPEC): Define.
+ (LIB_SPEC): Delete.
+ * config/xtensa/xtensa-protos.h (xtensa_declare_object): Delete.
+ * config/xtensa/xtensa.c (xtensa_declare_object): Delete.
+ * config/xtensa/xtensa.h (CPP_SPEC, SUBTARGET_CPP_SPEC, EXTRA_SPECS):
+ Define.
+ (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Delete.
+ (ASM_OUTPUT_ALIGNED_BSS, BSS_SECTION_ASM_OP): Define.
+
+2003-04-25 H.J. Lu <hjl@gnu.org>
+
+ * config/ia64/ia64.c (ia64_expand_compare_and_swap): Add rmode
+ for return mode.
+ (ia64_expand_builtin): Set rmode to SImode for
+ IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI,
+ IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI and
+ IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI. Set remode to DImode
+ for IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI.
+
+2003-04-25 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in (make_compare_target): Test for GNU cmp and set this
+ variable appropriately.
+ * Makefile.in (compare, compare3, compare4, compare-lean, compare3-lean,
+ compare4-lean): Rename actual targets to slowcompare*. New compare*
+ targets depend on names based on make_compare_target.
+ * configure: Regenerated.
+
+2003-04-25 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_compute_frame_size): Allow inline asm
+ to clobber ar.pfs and ar.unat.
+ (ia64_expand_prologue): Force alloc instruction if ar.pfs saved;
+ fix test for spilling ar.pfs to the stack.
+
+2003-04-25 Richard Henderson <rth@redhat.com>
+
+ PR opt/10315
+ * config/rs6000/rs6000.c (rs6000_emit_move): Only elide proper
+ checks during reload; use validize_mem instead of adjust_address.
+
+2003-04-26 Ben Elliston <bje@wasabisystems.com>
+
+ * config/arm/arm.c (arm_adjust_cost): Correct logic that tests the
+ return values from recog_memoized().
+
+2003-04-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR opt/8705
+ * gcse.c (try_replace_reg): On a successful substitution of a constant
+ into a single set, try to simplify the source of the set.
+ * loop.c (scan_loop): Don't try to optimize a MODE_CC set with a
+ constant source.
+
+2003-04-24 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpplex.c (cpp_token_len): Tighten up.
+ (cpp_token_as_text): Need extra byte now.
+ * cpplib.c (glue_header_name): Need extra 2 bytes.
+ * cppmacro.c (cpp_macro_definition): Need extra byte.
+
+2003-04-24 Alexander Kabaev <kan@FreeBSD.ORG>
+
+ * config/sparc/sparc.md (umulsidi3, mulsidi3): Avoid using
+ const_umulsidi3_sp32 and const_mulsidi3_sp32 on 64bit targets
+ where they might be not present. Use their _sp64 equivalent
+ instead.
+
+Thu Apr 24 20:42:12 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (cvtsi2sdq): Fix typo in previous patch.
+
+2003-04-24 Krister Walfridsson <cato@df.lth.se>
+
+ * configure.in: Check whether mbstowcs works.
+ * configure, config.in: Regenerate.
+ * intl.c: Use HAVE_WORKING_MBSTOWCS.
+
+2003-04-24 H.J. Lu <hjl@gnu.org>
+
+ * config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di
+ for __sync_bool_compare_and_swap_di for int return type.
+
+ * config/ia64/ia64intrin.h (__sync_bool_compare_and_swap_di):
+ Change return type to int.
+ (__sync_bool_compare_and_swap): Likewise.
+
+Thu Apr 24 16:55:26 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cfgbuild.c (make_edges): Do not use next_nonnote_insn when
+ looking for fallthru edge.
+
+ * athlon.md (athlon-agu, athlon-store, athlon-fany, athlon-faddmul):
+ Fix.
+ (athlon-load2, athlon-store2, athlon-fpsched, athlon-fpload,
+ athlon-fvector): New.
+ (athlon_*): Revisit to match new optimization guide.
+ * i386.c (ix86_adjust_cost): Fix memory operand costs on Athlon/k8
+ * i386.md (cvt??2?? patterns): Fix modes.
+ (fistp patterns): Set modes.
+
+ Accidentaly commited with my earlier reload patch:
+ PR c/10308
+ * reload.c (find_reloads_address_1): Reload plus at the place of
+ index register.
+
+2003-04-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ New GCOV_TAG_FUNCTION layout
+ * coverage.c (struct function_list): Replace name with ident.
+ (struct counts_entry): Likewise.
+ (fn_ident): New.
+ (htab_counts_entry_hash, htab_counts_entry_eq,
+ htab_counts_entry_del): Adjust.
+ (reads_count_file, get_coverage_counts,
+ coverage_begin_output, coverage_end_function): Adjust.
+ (build_fn_info_type, build_fn_info_value): Likewise.
+ * gcov-dump.c (tag_function): Adjust.
+ * gcov-io.c (gcov_write_string, gcov_read_string): Not in LIBGCOV.
+ * gcov-io.h (gcov_write_string, gcov_read_string): Not in LIBGCOV.
+ * gcov.c (struct function_info): Add ident.
+ (read_graph_file, read_count_file): Adjust.
+ * libgcov.c (gcov_exit): Adjust.
+
+2003-04-23 Richard Henderson <rth@redhat.com>
+
+ PR opt/8300
+ * toplev.c (rest_of_compilation): Delay no_new_pseudos until
+ after initialize_uninitialized_subregs; update reg info assuming
+ new pseudos were created.
+
+2003-04-23 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (c-lex.o, LIBCPP_OBJS, cpplex.o): Update.
+ * c-lex.c (MULTIBYTE_CHARS): Remove conditionals.
+ (lex_string): Take cpp_string with full spelling.
+ (cb_ident): Update.
+ (c_lex): Update diagnostics.
+ * cpplex.c (SPELL_NUMBER, SPELL_STRING): Combine into SPELL_LITERAL.
+ (create_literal): New.
+ (lex_string): Unterminated literals have type CPP_OTHER.
+ (_cpp_lex_direct): Update calls to lex_string. Use create_literal
+ for CPP_OTHER.
+ (cpp_token_len, cpp_spell_token, cpp_output_token): Simplify.
+ (_cpp_equiv_tokens, cpp_interpret_charconst): Update.
+ * cpplib.c (parse_include, do_line, do_linemarker,
+ destringize_and_run): Update for token storing full spelling.
+ * cpplib.h: Update token spelling types.
+ * cppmacro.c (stringify_arg, check_trad_stringification):
+ Update for token storing full spelling.
+
+2003-04-23 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_expand_cmpstr): Disable CLC loop.
+
+2003-04-23 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (TARGET_OPTIONS): Add value field.
+
+2003-04-23 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/extend.texi: Remove duplicate 2003 copyright date.
+
+2003-04-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ * Makefile.in (LIBGCC_DEPS): Add gcov headers.
+ (libgcov.a): Depends on LIBGCC_DEPS.
+ * basic-block.h (profile_info): Moved here from coverage.h. Made
+ a pointer.
+ * coverage.c (struct function_list): Fixed array of counter types.
+ (struct counts_entry): Keyed by counter type, contains summary.
+ (profile_info): Moved to profile.c.
+ (prg_ctr_mask, prg_n_ctrs, fn_ctr_mask, fn_n_ctrs): New global
+ vars.
+ (profiler_label): Remove.
+ (ctr_labels): New.
+ (set_purpose, label_for_tag, build_counter_section_fields,
+ build_counter_section_value, build_counter_section_data_fields,
+ build_counter_section_data_values, build_function_info_fields,
+ build_function_info_value, gcov_info_fields, gcov_info_value): Remove.
+ (build_fn_info_type, build_fn_info_value, build_ctr_info_type,
+ build_ctr_info_value, build_gcov_info): New.
+ (htab_counts_entry_hash, htab_counts_entry_eq): Adjust.
+ (reads_counts_file): Adjust.
+ (get_coverage_counts): Takes counter number. Add summary
+ parameter. Adjust.
+ (coverage_counter_ref): Tkaes counter number. Adjust. Lazily
+ create counter array labels.
+ (coverage_end_function): Adjust.
+ (create_coverage): Adjust.
+ (find_counters_section): Remove.
+ * coverage.h (MAX_COUNTER_SECTIONS): Remove.
+ (struct section_info, struct profile_info): Remove.
+ (profile_info): Moved to basic-block.h.
+ (coverage_counter_ref): Takes a counter number.
+ (get_coverage_counts): Takes a counter number. Added summary
+ parameter.
+ (find_counters_section): Remove.
+ * gcov-dump.c (tag_arc_counts): Rename to ...
+ (tag_counters): ... here. Adjust.
+ (tag_table): Move tag_counters to 3rd entry. Remove
+ PROGRAM_PLACEHOLDER and PROGRAM_INCORRECT entries.
+ (dump_file): Check for counter tag values here.
+ (tag_summary): Adjust.
+ * gcov-io.c (gcov_write_summary, gcov_read_summary): Adjust.
+ * gcov-io.h (GCOV_LOCKED): New.
+ (GCOV_TAG_ARC_COUNTS): Rename to ...
+ (GCOV_TAG_COUNTS_BASE): ... here.
+ (GCOV_TAG_PLACEHOLDER_SUMMARY, GCOV_TAG_INCORRECT_SUMMARY):
+ Remove.
+ (GCOV_COUNTER_ARCS, GCOV_COUNTERS, GCOV_NAMES): New.
+ (GCOV_TAG_FOR_COUNTER, GCOV_COUNTER_FOR_TAG,
+ GCOV_TAG_IS_COUNTER): New.
+ (struct gcov_ctr_summary): New.
+ (struct gcov_summary): Adjust.
+ (struct gcov_counter_section): Remove.
+ struct gcov_counter_section_data): Remove.
+ (struct gcov_function_info): Rename to ...
+ (struct gcov_fn_info): ... here. Adjust.
+ (struct gcov_ctr_info): New.
+ (struct gcov_info): Adjust.
+ * gcov.c (read_count_file): Adjust.
+ (output_lines): Adjust.
+ * libgcov.c (gcov_exit): Adjust.
+ (__gcov_flush): Adjust.
+ * mklibgcc.in (libgcc2_c_dep): Add gcov headers.
+ * predict.c (maybe_hot_bb_p, probably_cold_bb_p,
+ probably_never_executed_bb_p, compute_frequency_function): Adjust
+ profile_info use.
+ * profile.c (struct counts_entry): Remove.
+ (profile_info): Define here.
+ (get_exec_counts): Adjust get_coverage_counts call.
+ (compute_branch_probablilities): Remove find_counters_section
+ call.
+ (gen_edge_profiler): Adjust coverage_counter_ref call.
+ * tracer.c (tail_duplicate): Adjust profile_info use.
+
+2003-04-23 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/10339
+ * builtins.c (expand_builtin_strcmp): Try to emit cmpstrsi insn
+ directly instead of unsafely transforming call into a memcmp.
+ (expand_builtin_strncmp): Likewise.
+
+2003-04-22 Roger Sayle <roger@eyesopen.com>
+
+ * alias.c (mark_constant_function): Check for constancy and
+ purity even of void functions. Update both the function decl
+ and the cgraph RTL info with the results.
+
+2003-04-22 Roger Sayle <roger@eyesopen.com>
+
+ * real.c (do_add): Change to return a bool indicating that the
+ result of the operation may be inexact due to loss of precision.
+ (do_multiply): Likewise.
+ (do_divide): Likewise.
+
+2003-04-22 Geoffrey Keating <geoffk@apple.com>
+ Loren James Rittle <ljrittle@acm.org>
+
+ * dwarf2out.c (fde_table_allocated): Mark with GTY.
+ (decl_die_table_allocated): Likewise.
+ (abbrev_die_table_allocated): Likewise.
+ (line_info_table_allocated): Likewise.
+ (separate_line_info_table_allocated): Likewise.
+ (pubname_table_allocated): Likewise.
+ (arange_table_allocated): Likewise.
+ (ranges_table_allocated): Likewise.
+ (decl_die_table_in_use): Unconditionalize; mark with GTY.
+ (abbrev_die_table_in_use): Likewise.
+ (line_info_table_in_use): Likewise.
+ (separate_line_info_table_in_use): Likewise.
+ (pubname_table_in_use): Likewise.
+ (arange_table_in_use): Likewise.
+ (ranges_table_in_use): Likewise.
+ (have_location_lists): Likewise.
+ (emitcount): New GTY-marked static, moved...
+ (maybe_emit_file): ...from here.
+ (label_num): New GTY-marked static, moved...
+ (gen_internal_sym): ...from here.
+
+2003-04-22 Richard Henderson <rth@redhat.com>
+
+ PR 8866
+ * rtl.h (MEM_NOTRAP_P): New.
+ (MEM_COPY_ATTRIBUTES): Copy it.
+ * rtlanal.c (may_trap_p): Check it.
+ * expr.c (do_tablejump): Set it.
+ * doc/rtl.texi (Flags): Document it.
+
+ * cfgrtl.c (try_redirect_by_replacing_jump): Revert last three changes.
+
+2003-04-22 Olivier Hainque <hainque@act-europe.fr>
+
+ * config/alpha/alpha.c (alpha_expand_prologue [OPEN_VMS_ABI]): Don't
+ set FRP on stack adjustment for outgoing args if frame_pointer_needed.
+
+2003-04-22 Vincent Celier <celier@gnat.com>
+
+ * gthr-gnat.h, gthr-gnat.c: new sources for implementation of
+ --enable-threads=gnat.
+ * Makefile.in: Add gthr-gnat.c to LIB2ADDEH.
+ * configure.in: Add gnat to the list of thread packages
+ * configure: Rebuild.
+ * config/t-linux: Add gthr-gnat.c to LIB2ADDEH and LIB2ADDEHDEP
+
+2003-04-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpplex.c (_cpp_get_fresh_line): Pop the buffer if return_at_eof.
+
+2003-04-22 Devang Patel <dpatel@apple.com>
+
+ * cpptrad.c (_cpp_replacement_text_len): Add check for macro
+ parameter count.
+ (_cpp_copy_replacement_text): Same.
+
+2003-04-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-lex.c (c_lex): Handle CPP_OTHER differently.
+ * cppexp.c (_cpp_parse_expr): Similarly.
+ * cpplex.c (SPELL_CHAR): Remove.
+ (_cpp_lex_direct): Stray chars are saved as byte strings.
+ (cpp_spell_token, cpp_output_token, _cpp_equiv_token): Don't
+ handle SPELL_CHAR.
+ (cpp_avoid_paste): Update handling of CPP_OTHER.
+ * cpplib.h: Spell CPP_OTHER like a number.
+ (struct cpp_token): Remove member c.
+ * cppmacro.c (stringify_arg): Update handling of CPP_OTHER.
+
+2003-04-22 David Turner <novalis@gnu.org>
+
+ * gbl-ctors.h: Add special license exception.
+ * libgcc2.h: Likewise.
+ * tsystem.h: Likewise.
+ * gcov-io.h: Likewise.
+
+2003-04-22 David Edelsohn <edelsohn@gnu.org>
+
+ * fold-const.c (fold_range_test): Use RANGE_TEST_NON_SHORT_CIRCUIT
+ macro defaulting to original BRANCH_COST heuristic.
+ * doc/tm.texi (RANGE_TEST_NON_SHORT_CIRCUIT): Document.
+
+ * config/rs6000/rs6000.h (RANGE_TEST_NON_SHORT_CIRCUIT): Define.
+
+2003-04-22 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/t-spe: Merge in t-fprules into file.
+
+ * config.gcc: Add t-spe to powerpc-eabispe.
+
+2003-04-22 Kean Johnston <jkj@sco.com>
+
+ * tlink.c (recompile_files): Add missing '=' to putenv calls
+
+2003-04-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ginclude/stddef.h: Provide C++ safe offsetof.
+
+2003-04-22 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * function.c (purge_addressof_1): In (mem (addressof (reg))) case
+ for reg notes, if there are no substitutions, just use a SUBREG.
+
+2003-04-21 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (calls.o): Depend on except.h.
+ * calls.c: Include except.h.
+ (emit_call_1): Call note_eh_region_may_contain_throw if
+ appropriate.
+ * except.c (eh_region): Add may_contain_throw.
+ (expand_eh_region_end_cleanup): Do not include handler code when
+ it cannot be reached.
+ (note_eh_region_may_contain_throw): New function.
+ * except.h (note_eh_region_may_contain_throw): New function.
+
+2003-04-21 Mark Mitchell <mark@codesourcery.com>
+
+ * config/i386/winnt.c (i386_pe_mark_dllimport): Revert previous
+ changes.
+
+2003-04-21 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): No SPE means
+ 64-bit long doubles.
+
+2003-04-21 Olivier Hainque <hainque@act-europe.fr>
+
+ * fold-const.c (fold, case PLUS_EXPR and case MULT_EXPR): Restore
+ a number of conversions required for type consistency and previously
+ stripped off by STRIP_NOPS.
+
+ * calls.c (expand_call): Prevent sibcall optimization for calls to
+ nested subprograms.
+
+ * expmed.c (extract_bit_field): Reverse operands of && condition to
+ prevent a potential division by zero in the previously first branch.
+ * config/pa/pa.md (extv, extzv): FAIL if the bitfield length is zero.
+
+2003-04-21 Joel Brobecker <brobecker@gnat.com>
+
+ * dwarf2out.c (is_ada, is_ada_subrange_type): New functions.
+ (subrange_type_die): Likewise.
+ (modified_type_die): Emit a subrange_type DIE for Ada subrange types.
+ (is_c_family, is_cxx, is_java, is_fortran): Return bool and clean up.
+
+2003-04-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ Break out coverage routines to new file.
+ * Makefile.in (COVERAGE_H): New variable
+ (C_OBJS): Add coverage.o
+ (coverage.o): New target.
+ (profile.o, loop-init.o, sched-ebb.o, predict.o, tracer.o): Adjust
+ dependencies.
+ (GTFILES): Adjust.
+ (gt-coverage.h): New target.
+ (gt-profile.h): Remove.
+ * profile.h: Remove. Move to ...
+ * coverage.h: ... here. New. #include gcov-io.h.
+ * gcov-io.h: Move function definitions to ...
+ * gcov-io.c: ... here. New.
+ * profile.c: Move coverage routines to coverage.c.
+ (instrument_edges, get_exec_counts, branch_prob, init_branch_prob,
+ end_branch_prob): Adjust.
+ * coverage.c: New. Coverage routines from profile.c
+ (coverage_counter_ref, coverage_init, coverage_finish,
+ coverage_end_function, coverage_begin_output,
+ coverage_counter_ref, get_coverage_counts): Define.
+ * gcov-dump.c, gcov.c: #include gcov-io.c.
+ * libgcov.c: Likewise. Adjust.
+ * loop-init.c: Don't #include profile.h
+ * tracer.c, predict.c, sched-ebb.c: Adjust #includes.
+ * rtl.h: Add coverage prototypes.
+ * toplev.c (compile_file): Init coverage, not branch_prob.
+ Always call coverage_finish.
+ (rest_of_compilation): Call coverage_end_function.
+
+2003-04-21 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * config/rs6000/rs6000.md (*movsf_softfloat): Add "h" <- "0" case.
+
+2003-04-21 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-ppoutput.c (cb_include): Don't take a cpp_token.
+ * cppfiles.c: Don't undef strcmp.
+ (find_include_file): Don't take a cpp_token. Check for empty
+ file names.
+ (_cpp_execute_include, _cpp_compare_file_date): Don't take a cpp_token.
+ (cpp_push_include): Simplify.
+ * cpphash.h (_cpp_execute_include, _cpp_compare_file_date): Update.
+ * cpplib.c (glue_header_name): Return the file name, not a cpp_token.
+ (parse_include): Similary. Don't check for zero-length filenames.
+ (do_include_common, do_pragma_dependency): Update accordingly.
+ * cpplib.h (struct cpp_callbacks): Change prototype of include.
+
+2003-04-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * doc/rtl.texi (RTX_UNCHANGING_P): Point to true_dependence for
+ details of conflict handling.
+
+ * fold-const.c (extract_muldiv, case CONVERT_EXPR): Detect case
+ when conversion overflows.
+
+ * stor-layout.c (layout_decl): Don't set DECL_SIZE_UNIT if already set.
+
+ * expr.c (store_constructor): Set RTX_UNCHANGING_P if readonly_field_p
+ before clearing.
+
+2003-04-21 Mark Mitchell <mark@codesourcery.com>
+
+ * config/i386/winnt.c (i386_pe_mark_dllimport): Make the new RTL
+ have the same form as the old RTL.
+
+2003-04-21 Andreas Jaeger <aj@suse.de>
+
+ * cppcharset.c (_cpp_valid_ucn): Cast field precision to int.
+
+2003-04-20 Chris Lattner <sabre@nondot.org>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * c-common.h, c-semantics.c: Rename genrtl_decl_cleanup to
+ genrtl_cleanup_stmt. Correct comment at head of
+ genrtl_cleanup_stmt (no such thing as a DECL_CLEANUP).
+
+ * stmt.c (struct nesting): Kill n_function_calls.
+ (expand_start_bindings): Don't set
+ thisblock->data.block.n_function_calls.
+ (expand_end_bindings): Compare function_call_count against 0.
+ (expand_cleanups): Kill DONT_DO argument; all callers passed
+ NULL_TREE. All callers updated to match.
+
+2003-04-20 Zack Weinberg <zack@codesourcery.com>
+
+ * varasm.c (struct deferred_constant, defer_addressed_constants_flag)
+ (defer_addressed_constants, output_deferred_addressed_constants): Kill.
+ (output_constant_def): Remove code predicated on
+ defer_addressed_constants_flag.
+
+ * output.h: Remove prototypes of deleted functions.
+ * c-typeck.c (constructor_subconstants_deferred): Kill.
+ (struct initializer_stack): Remove 'deferred' field.
+ (start_init): Remove all references to the above.
+ (finish_init): Likewise. Also remove never-executed call to
+ output_deferred_addressed_constants. Pull assignment to
+ defstr out of if expression.
+
+2003-04-20 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpphash.h (NOTE_ESC_NL, NOTE_ESC_SPACE_NL, NOTE_TRIGRAPH,
+ NOTE_NEWLINE): Remove.
+ * cpplex.c (_cpp_clean_line, _cpp_process_line_notes): Update
+ to handle new form of line note type.
+
+2003-04-20 Zack Weinberg <zack@codesourcery.com>
+
+ * target.h (encode_section_info): Add new argument carrying
+ the RTL to be modified by the hook.
+
+ * varasm.c (make_decl_rtl, output_constant_def): Update calls
+ to encode_section_info.
+ (default_encode_section_info): Take and use RTL argument,
+ don't use TREE_CST_RTL or DECL_RTL.
+ * output.h: Update prototype of default_encode_section_info.
+ * config/darwin.h (ASM_DECLARE_OBJECT_NAME)
+ (ASM_DECLARE_FUNCTION_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL):
+ Update calls to encode_section_info.
+
+ * config/darwin.c, config/arm/arm.c, config/arm/pe.c
+ * config/h8300/h8300.c, config/i386/winnt.c, config/m32r/m32r.c
+ * config/m68hc11/m68hc11.c, config/m88k/m88k.c, config/mcore/mcore.c
+ * config/mips/mips.c, config/mmix/mmix.c, config/pa/pa.c
+ * config/romp/romp.c, config/rs6000/rs6000.c, config/s390/s390.c
+ * config/v850/v850.c (TARGET_ENCODE_SECTION_INFO definitions):
+ Take and use RTL argument, don't use TREE_CST_RTL or DECL_RTL,
+ except for PE dllimport/dllexport. Update calls to
+ default_encode_section_info.
+
+ * config/darwin-protos.h, config/arm/arm-protos.h, config/i386-protos.h:
+ Update prototypes.
+
+ * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update.
+
+2003-04-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR/8705
+ * pa.md (movccfp): New expander.
+ (setccfp0, setccfp1): Rename to movccfp0 and movccfp1, respectively.
+ Reverse fcmp conditions.
+
+2003-04-20 Marek Michalkiewicz <marekm@amelek.gda.pl>
+
+ * config/avr/avr.md (*cmpqi_sign_extend): Handle negative values
+ of operand 1 correctly.
+
+2003-04-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cpplex.c (_cpp_lex_direct): Set BOL for CPP_EOF tokens.
+ * gcov.c (output_lines): Don't be so fussy about going past EOF.
+
+2003-04-20 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (LIBCPP_OBJS): Add cppcharset.o.
+ (cppcharset.o): New target.
+ * c-lex.c (is_extended_char): Move to cppcharset.c.
+ (utf8_extend_token): Delete.
+ * cppcharset.c: New file.
+ * cpphash.h (_cpp_valid_ucn): New.
+ * cpplex.c (lex_identifier): Update prototype.
+ (continues_identifier_p): Rename forms_identifier_p. Handle UCN
+ escapes.
+ (maybe_read_ucs): Rename maybe_read_ucn. Update to use code
+ in cppcharset.c.
+ (lex_number, lex_identifier, cpp_parse_escape): Update.
+ (_cpp_lex_direct): Update to handle UCNs.
+ (cpp_avoid_paste): Don't paste to form a UCN.
+
+2003-04-19 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin): Don't expand a pure or const
+ built-in function if the result will be ignored and none of
+ its arguments are volatile.
+
+2003-04-19 Kean Johnston <jkj@sco.com>
+
+ * unwind-dw2.c (_Unwind_GetCFA): cast return to avoid warning
+ * config.gcc: make SCO use dbxelf.h and elfos.h; only use one
+ target fragment now: t-sco5; dont compile crti.o.
+ * config/i386/sco5.h: major overhaul to remove all COFF remnants
+ and to use elfos.h for most definitions.
+ (BSS_SECTION_ASM_OP): set correct segment attributes.
+ (PREFERED_DEBUGGING_TYPE): set to DWARF-2.
+ (DWARF2_UNWIND_INFO): Always set to 1.
+ (MD_STARTFILE_PREFIX): Make /usr/gnu/lib the default.
+ (MD_STARTFILE_PREFIX_1): Define.
+ (MD_EXEC_PREFIX): Adjust to /usr/gnu/bin if using GAS.
+ (DEFAULT_LINKER): Define if not specified to configure.
+ (CTORS_SECTION_ASM_OP): Remove COFF crud.
+ (DTORS_SECTION_ASM_OP): Remove COFF crud.
+ (WINT_TYPE): Define.
+ (SDB_DEBUGGING_INFO): Remove.
+ (EXTRA_SECTIONS): Likewise.
+ (EXTRA_SECTION_FUNCTIONS): Likewise.
+ (CTOR_LIST_BEGIN): Likewise.
+ (CTOR_LIST_END): Likewise.
+ (INIT_SECTION_FUNCTION): Likewise.
+ (FINI_SECTION_FUNCTION): Likewise.
+ (SUBTARGET_FRAME_POINTER_REQUIRED): Likewise.
+ (LOCAL_LABEL_PREFIX): Likewise.
+ (NON_SAVING_SETJMP): Likewise.
+ (RETURN_POPS_ARGS): Likewise.
+ (ASM_OUTPUT_SKIP): Likewise.
+ (TARGET_ASM_NAMED_SECTION): Likewise.
+ (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise.
+ (ASM_OUTPUT_IDENT): Likewise.
+ (ASM_OUTPUT_CASE_LABEL): Likewise.
+ (ASM_OUTPUT_ASCII): Likewise.
+ (ASM_OUTPUT_LIMITED_STRING): Likewise.
+ (ASM_OUTPUT_ALIGNED_LOCAL): Likewise.
+ (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
+ (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ (ASM_FINISH_DECLARE_OBJECT): Likewise.
+ (ASM_DECLARE_OBJECT_NAME): Likewise.
+ (ASM_DECLARE_FUNCTION_SIZE): Likewise.
+ (ASM_DECLARE_FUNCTION_NAME): Likewise.
+ (ASM_DECLARE_RESULT): Likewise.
+ (ASM_WEAKEN_LABEL): Likewise.
+ (SUPPORTS_WEAK): Likewise.
+ (APPLY_RESULT_SIZE): Likewise.
+ (LPREFIX): Likewise.
+ (ALIGN_ASM_OP): Likewise.
+ (ASCII_DATA_ASM_OP): Likewise.
+ (IDENT_ASM_OP): Likewise.
+ (ASM_SHORT): Likewise.
+ (ASM_LONG): Likewise.
+ (TYPE_ASM_OP): Likewise.
+ (SIZE_ASM_OP): Likewise.
+ (STRING_ASM_OP): Likewise.
+ (SKIP_ASM_OP): Likewise.
+ (EH_FRAME_SECTION_ASM_OP): Likewise.
+ (READONLY_DATA_SECTION_ASM_OP): Likewise.
+ (INIT_SECTION_ASM_OP): Likewise.
+ (FINI_SECTION_ASM_OP): Likewise.
+ (TEXT_SECTION_ASM_OP): Likewise.
+ (DATA_SECTION_ASM_OP): Likewise.
+ (TYPE_OPERANT_FORMAT): Likewise.
+ (ASM_SPEC): Remove COFF code.
+ (STARTFILE_SPEC): Likewise. Always use crti.o; add -p and -pp support;
+ cause -pg to emit an error; use pcrt1elf.o with -pp
+ (ENDFILE_SPEC): Likewise.
+ (TARGET_OS_CPP_BUILTINS): Add _SCO_DS_LL.
+ (CPP_SPEC): Remove COFF crud; always look in /usr/gnu/include first.
+ (LINK_SPEC): Remove COFF crud; use -E for environment switch not -R;
+ add -z alt_resolve to support weak symbols the way GCC wants them.
+ (LIB_SPEC): Use the profiler libraries in -p or -pp mode.
+ (LIBGCC_SPEC): Dont use -lgcc in -G mode.
+ (ASM_PREFERED_EH_DATA_FORMAT): Remove.
+ * config/i386/t-sco5 (TARGET_LIBGCC2_CFLAGS): Remove.
+ (CRTSTUFF_T_CFLAGS_S): Define.
+ (MULTILIB_OPTIONS): Likewise.
+ (MULTILIB_DIRNAMES): Likewise.
+ (MULTILIB_MATCHES): Likewise.
+ (MULTILIB_EXTRA_OPTS): Likewise.
+ (LIBGCC): Likewise.
+ (INSTALL_LIBGCC): Likewise.
+ (crti.o): Remove.
+ * config/i386/t-sco5gas: Remove.
+ * doc/install.texi: Updated for new OpenServer instructions.
+ * testsuite/gcc.dg/nest.c: Allow failure on SCO (-pg not supported)
+
+2003-04-19 Kean Johnston <jkj@sco.com>
+
+ * fixinc/check.tpl: Allow user to over-ride diff program.
+ * fixinc/inclhack.def: Removed extraneous #ifndef SVR5.
+ (sco_math): Added test for SCO math header files.
+ (sco_regset): Added check for conflicts with ieeefp.h.
+ (svr4_disable_opt): Removed extraneous #ifdef SVR4.
+ * fixinc/fixincl.x: Regenerated
+ * fixinc/tests/base/math.h: Added sco_math tests.
+ * fixinc/tests/base/string.h: New file.
+ * fixinc/tests/base/sys/regset.h: New file.
+
+2003-04-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpphash.h (struct cpp_buffer): Remove backup_to.
+ * cpplex.c (BACKUP, get_effective_char): Die.
+ (_cpp_skip_block_comment): Assume '*' is location on entry.
+ (continues_identifier_p): Respect -fno-dollars-in-identifiers.
+ (IF_NEXT_IS): Update.
+ (_cpp_lex_direct): Don't use backup_to; look ahead directly.
+
+2003-04-19 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * README.Portability: Move to a new section and obsolete K+R
+ portability issues.
+
+Sat Apr 19 14:56:17 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * rtlanal.c (subreg_offset_representable_p): Fix call of
+ subreg_lowpart.
+
+2003-04-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpphash.h (struct cpp_reader): New member warned_dollar.
+ * cpplex.c (continues_identifier_p): New function.
+ (parse_identifier, parse_number, parse_string): Rename lex_identifer,
+ lex_number and lex_string, and simplify.
+ (parse_slow, unescaped_terminator_p): Die.
+ (_cpp_lex_direct): Update.
+
+2003-04-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * calls.c (expand_call): Provide init for old_stack_pointer_delta.
+
+2003-04-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ * doc/invoke.texi (-fprofile-arcs): Mention -lgcov, locking and
+ fork behavior.
+
+2003-04-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppexp.c (eval_token): Permit true and false even if pedantic.
+
+2003-04-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpplex.c (skip_whitespace): Rearrange to avoid stage1 ICE.
+
+2003-04-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppfiles.c (ENABLE_VALGRIND_CHECKING, VALGRIND_DISCARD,
+ MMAP_THRESHOLD, TEST_THRESHOLD, SHOULD_MMAP): Remove.
+ (struct include_file): Remove fefcnt, mapped members.
+ (open_file, stack_include_file, _cpp_pop_file_buffer): Disable caching.
+ (read_include_file): Don't use mmap, terminate buffers in '\r'.
+ (purge_cache): Don't use munmap.
+ * cpphash.h (CPP_BUF_COLUMN): Update.
+ (lexer_state): Remove lexing_comment.
+ (struct _cpp_line_note): New.
+ (struct cpp_buffer): New members cur_note, notes_used, notes_cap,
+ next_line and need_line. Remove col_adjust and saved_flags.
+ (_cpp_process_line_notes, _cpp_clean_line, _cpp_get_fresh_line,
+ _cpp_skip_block_comment, scan_out_logical_line): New.
+ (_cpp_init_mbchar): Remove.
+ * cppinit.c (init_library): Remove call to _cpp_init_mbchar.
+ (cpp_read_main_file): Set line to 1 earlier.
+ (post_options): -traditional-cpp doesn't want trigraphs.
+ * cpplex.c (MULTIBYTE_CHARS): Remove code predicated on this.
+ (add_line_note, _cpp_clean_line, _cpp_process_line_notes,
+ _cpp_get_fresh_line): New.
+ (handle_newline, skip_escaped_newlines, trigraph_p,
+ continue_after_nul, _cpp_init_mbchar): Remove.
+ (get_effective_char): Update.
+ (_cpp_skip_block_comment): Rename from skip_block_comment, simplify.
+ (skip_line_comment): Simplify.
+ (skip_whitespace, parse_identifier, parse_slow, parse_number,
+ parse_string): Update.
+ (cpp_lex_direct): Use clean lines and process line notes. Update.
+ (cpp_interpret_charconst): No MULTIBYTE_CHARS.
+ * cpplib.c (prepare_directive_trad): Call scan_out_logical_line
+ directly.
+ (_cpp_handle_directive): Don't set saved_flags.
+ (run_directive, destringize_and_run, cpp_define, cpp_define_builtin,
+ cpp_undef, handle_assertion, cpp_push_buffer): Update.
+ (_cpp_pop_buffer): Free notes.
+ * cppmacro.c (builtin_macro, paste_tokens): \n terminate buffer.
+ * cpppch.c (cpp_read_state): \n terminate buffer.
+ * cpptrad.c (skip_escaped_newlines, handle_newline): Remove.
+ (copy_comment): Use _cpp_skip_block_comment.
+ (skip_whitespace, lex_identifier, _cpp_read_logical_line_trad):
+ Simplify.
+ (_cpp_overlay_buffer, _cpp_remove_overlay, push_replacement_text,
+ save_replacement_text): Update.
+ (scan_out_logical_line): Update to use clean lines and process
+ line notes.
+ * fix-header.c (read_scan_file): Update.
+
+2003-04-18 Douglas B Rupp <rupp@gnat.com>
+
+ * unwind-dw2-fde.c (__register_frame_info_bases): Check for
+ null begin parameter (as well as pointer to null).
+ (__deregister_frame_info_bases): Likewise.
+
+2003-04-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * function.c (purge_addressof_1): For ADDRESSOF, see if SUB is a
+ hard or virtual register and copy into pseudo if replacement fails.
+
+ * cfgcleanup.c (flow_find_cross_jump): Use INSN_P, not active_insn_p.
+
+ * expmed.c (mask_rtx): Avoid undefined shifts for BITSIZE of 0.
+
+2003-04-18 Olivier Hainque <hainque@act-europe.fr>
+
+ * calls.c (expand_call): Move special case for constructor calls
+ to right place. Ensures constructor calls used to initialize
+ arguments get a clean outgoing argument block for themselves.
+ Move check for stack deallocation completeness until after last
+ deallocation. Add stack_pointer_delta to set of state
+ variables saved and restored along with current stack_level.
+
+ * integrate.c (expand_inline_function): Ensure non-const actuals
+ don't end up const in the caller's flow after conversion to possibly
+ const formal type.
+
+2003-04-18 Vincent Celier <celier@gnat.com>
+
+ * dwarf2out.c (loc_descriptor_from_tree): Treat all *_MOD_EXPR
+ and *_DIV_EXPR as TRUNC_*_EXPR.
+
+2003-04-18 Mark Mitchell <mark@codesourcery.com>
+
+ * cfgrtl.c (try_redirect_by_replacing_jump): Create a basic block
+ for orphaned jump tables.
+
+2003-04-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * reload1.c: Revert my previous patch on 2002-04-17.
+
+2003-04-18 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Prefer "bug fix" over "bugfix".
+ Add Segher Boessenkool.
+
+2003-04-18 Alexander Sotirov <sluncho@mirizma.org>
+
+ PR c/9177
+ * c-decl.c (c_expand_body): Don't garbage collect the function
+ body if we are going to dump it later.
+
+2003-04-18 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP): Remove.
+ (alpha_end_function): Don't set them.
+ (decl_in_text_section): Remove.
+ (alpha_encode_section_info): Remove.
+ (samegp_function_operand): Use SYMBOL_REF LOCAL_P and EXTERNAL_P.
+ (direct_call_operand): Use SYMBOL_REF_DECL and compare actual
+ sections, rather than decl_in_text_section results.
+
+2003-04-18 Roger Sayle <roger@eyesopen.com>
+
+ * rtlanal.c (reg_overlap_mentioned_p): Handle ZERO_EXTRACT
+ and SIGN_EXTRACT.
+
+2003-04-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/7675
+ * c-typeck.c (build_external_ref): Set the DECL_NONLOCAL flag
+ on VAR_DECL, PARM_DECL and FUNCTION_DECL from within
+ nested functions if they refer to declarations from parent functions.
+ * stmt.c (expand_decl): Don't put automatic variables in registers
+ if the DECL_NONLOCAL flag is set.
+
+2003-04-18 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcse.c (compute_ld_motion_mems): For MEM destinations, only
+ consider those to be movable where the source matches
+ want_to_gcse_p.
+ (update_ld_motion_stores): In comment, refer to
+ compute_ld_motion_mems for validity of replacement.
+
+Fri Apr 18 01:28:51 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * gcov-dump.c (tag_summary): Remove max_sum
+ * gcov-io.h (gcov_summary, gcov_write_summary,
+ gcov_read_summary): Kill max_sum.
+ * libgcov.c (gcov_exit): Do one pass over the data. Make error
+ message more verbose.
+
+ * emit-rtl.c (subreg_hard_regno): Check that register is
+ representable.
+
+ * reload.c (reload_inner_reg_of_subreg): When register is not
+ representable, reload the whole thing.
+ (find_reloads): Likewsie.
+ * rtlanal.c (subreg_representable_p): New function.
+
+ * profile.c (compute_branch_probabilities): Cleanup sanity checking;
+ allow negative probabilities for edges from the call to exit.
+ (branch_prob): Do not add fake edges for functions that may return
+ twice.
+
+2003-04-17 DJ Delorie <dj@redhat.com>
+
+ * toplev.c (target_options): Add value field.
+ (set_target_switch): Handle target options with values.
+ * doc/tm.texi: Document how fixed vs variable target
+ options work.
+ * config/alpha/alpha.h, config/arc/arc.h, config/avr/avr.h,
+ config/c4x/c4x.h, config/cris/aout.h, config/cris/cris.h,
+ config/d30v/d30v.h, config/dsp16xx/dsp16xx.h,
+ config/frv/frv.h, config/i386/i386.h, config/ia64/ia64.h,
+ config/m32r/m32r.h, config/m68hc11/m68hc11.h,
+ config/m68k/m68k.h, config/m88k/m88k.h, config/mcore/mcore.h,
+ config/mips/mips.h, config/mmix/mmix.h, config/pa/pa.h,
+ config/rs6000/rs6000.h, config/rs6000/sysv4.h,
+ config/s390/s390.h, config/sparc/sparc.h, config/v850/v850.h:
+ Add value initializer to target options.
+
+2003-04-07 Loren James Rittle <ljrittle@acm.org>
+
+ * cpppch.c (cpp_valid_state): Unconditionally initialize nl.
+
+2003-04-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * reload1.c (move2add_last_cc0): New.
+ (reload_cse_move2add): Detect implicit sets.
+ (move2add_note_store): Notice a store into cc0.
+
+2003-04-17 Roger Sayle <roger@eyesopen.com>
+
+ PR c/10375
+ * c-decl.c (duplicate_decls): Preserve "const" and "noreturn"
+ function attributes.
+
+2003-04-17 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/sourcebuild.texi (Test Suites): Document support for testing
+ binary compatibility (moved from testsuite/README.compat).
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_in_small_data_p): Disallow strings.
+
+2003-04-17 Simon Law <sfllaw@engmail.uwaterloo.ca>
+
+ * doc/include/gpl.texi: Fix double-spacing after "MA" to match
+ the one provided by the FSF.
+
+2003-04-17 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Binaries): Update URL and list of platforms
+ provided by ftp.thewrittenword.com.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/xtensa/xtensa.c (xtensa_encode_section_info): Remove.
+ (call_insn_operand): Use SYMBOL_REF_LOCAL_P.
+ * config/xtensa/xtensa.md (call, call_value): Likewise.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/v850/v850.c (print_operand): Use SYMBOL_REF_[ZST]DA.
+ (print_operand_address): Likewise.
+ (ep_memory_operand): Likewise.
+ (special_symbolref_operand): Likewise.
+ (v850_encode_data_area): Use SYMBOL_REF_FLAGS.
+ (v850_encode_section_info): Call default_encode_section_info.
+ (v850_strip_name_encoding): Remove.
+ * config/v850/v850.h (EXTRA_CONSTRAINT): Use SYMBOL_REF_[ZST]DA.
+ (ASM_OUTPUT_LABELREF): Remove.
+ (ZDA_NAME_FLAG_CHAR, ZDA_NAME_P): Remove.
+ (SDA_NAME_FLAG_CHAR, SDA_NAME_P): Remove.
+ (TDA_NAME_FLAG_CHAR, TDA_NAME_P): Remove.
+ (ENCODED_NAME_P): Remove.
+ (SYMBOL_FLAG_ZDA, SYMBOL_REF_ZDA_P): New.
+ (SYMBOL_FLAG_SDA, SYMBOL_REF_SDA_P): New.
+ (SYMBOL_FLAG_TDA, SYMBOL_REF_TDA_P): New.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/stormy16/stormy16.c (xstormy16_encode_section_info): Kill.
+ * config/stormy16/stormy16.h (ASM_OUTPUT_SYMBOL_REF): Use
+ SYMBOL_REF_FUNCTION_P.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/sparc/sparc.c (sparc_encode_section_info): Remove.
+ (data_segment_operand): Use SYMBOL_REF_FUNCTION_P.
+ (text_segment_operand): Likewise.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/sh/sh.c (gen_datalabel_ref): Don't add SH_DATALABEL_ENCODING.
+ (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
+ (legitimize_pic_address): Use SYMBOL_REF_LOCAL_P.
+ (sh_encode_section_info): Remove.
+ (sh_strip_name_encoding): Remove.
+ * config/sh/sh.h (SH_DATALABEL_ENCODING): Remove.
+ (DATALABEL_SYMNAME_P, STRIP_DATALABEL_ENCODING): Remove.
+ (SH_TLS_ENCODING, TLS_SYMNAME_P, STRIP_TLS_ENCODING): Remove.
+ (ASM_OUTPUT_LABELREF): Remove.
+ (ASM_OUTPUT_SYMBOL_REF): Use SYMBOL_REF_FUNCTION_P.
+ * config/sh/sh.md (*): Use SYMBOL_REF_LOCAL_P.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/s390/s390.c (SYMBOL_FLAG_ALIGN1): New.
+ (tls_model_chars): Remove.
+ (larl_operand): Use SYMBOL_REF_FLAGS.
+ (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
+ (legitimize_pic_address): Use SYMBOL_REF_LOCAL_P.
+ (s390_output_mi_thunk): Likewise.
+ (s390_emit_prologue): Set SYMBOL_FLAG_LOCAL as needed.
+ (s390_function_profiler): Likewise.
+ (s390_encode_section_info): Use default_encode_section_info
+ and SYMBOL_FLAG_ALIGN1.
+ (s390_strip_name_encoding): Remove.
+ * config/s390/s390.h (ASM_OUTPUT_LABELREF): Remove.
+ * config/s390/s390.md (call, call_value): Use SYMBOL_REF_LOCAL_P.
+ (builtin_setjmp_receiver): Set SYMBOL_FLAG_LOCAL as needed.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/ns32k/ns32k.c (ns32k_encode_section_info): Remove.
+ (global_symbolic_reference_mentioned_p): Use SYMBOL_REF_LOCAL_P.
+ (print_operand_address): Likewise.
+
+ * config/ns32k/ns32k.h (CANNOT_CHANGE_MODE_CLASS): Add CLASS argument.
+ * config/ns32k/ns32k.c (expand_block_move): Don't check
+ flag_unroll_loops.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/mcore/mcore.c (mcore_encode_section_info): Don't set
+ SYMBOL_REF_FLAG.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * rtl.h (SYMBOL_FLAG_MACH_DEP_SHIFT): New.
+
+ * config/m32r/m32r.c (SYMBOL_FLAG_MODEL_SHIFT): New.
+ (SYMBOL_REF_MODEL): New.
+ (LIT_NAME_P): Move from m32r.h.
+ (m32r_select_section): Remove.
+ (m32r_encode_section_info): Use SYMBOL_REF_FLAGS.
+ (m32r_strip_name_encoding): Remove.
+ (m32r_in_small_data_p): New.
+ (small_data_operand): Use SYMBOL_REF_SMALL_P.
+ (addr24_operand): Use SYMBOL_REF_MODEL.
+ (call26_operand): Likewise.
+ (addr32_operand): Tidy.
+ (m32r_print_operand): Use HOST_WIDE_INT_PRINT_HEX.
+ * config/m32r/m32r.h (RODATA_SECTION_ASM_OP): Remove.
+ (SDATA_SECTION_ASM_OP, SBSS_SECTION_ASM_OP): Remove.
+ (READONLY_DATA_SECTION_ASM_OP): Remove.
+ (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove.
+ (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Remove.
+ (TARGET_ASM_SELECT_SECTION): Remove.
+ (SDATA_FLAG_CHAR, MEDIUM_FLAG_CHAR, LARGE_FLAG_CHAR): Remove.
+ (SDATA_NAME_P, SMALL_NAME_P, MEDIUM_NAME_P): Remove.
+ (LARGE_NAME_P, ENCODED_NAME_P): Remove.
+ (ASM_OUTPUT_LABELREF): Remove.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/ip2k/ip2k.c (is_regfile_address): Use SYMBOL_REF_FUNCTION_P.
+ (encode_section_info): Remove.
+ * config/ip2k/ip2k-protos.h: Update.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * varasm.c (default_encode_section_info): Don't set
+ SYMBOL_FLAG_EXTERNAL if not TREE_PUBLIC.
+ * config/i370/i370.c (i370_encode_section_info): Remove.
+ * config/i370/i370.h (CONSTANT_ADDRESS_P): Use SYMBOL_REF_EXTERNAL_P.
+ (PRINT_OPERAND, PRINT_OPERAND_ADDRESS): Likewise.
+ * config/i370/i370.md (movsi): Likewise.
+
+ * config/i370/t-i370: Add missing backslash.
+
+2003-04-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/invoke.texi (inline-limit): Fix pasto.
+
+2003-04-17 Richard Henderson <rth@redhat.com>
+
+ * config/h8300/h8300.c (SYMBOL_FLAG_FUNCVEC_FUNCTION): New.
+ (small_call_insn_operand): Use it.
+ (SYMBOL_FLAG_EIGHTBIT_DATA): New.
+ (h8300_eightbit_constant_address_p): Use it.
+ (SYMBOL_FLAG_TINY_DATA): New.
+ (h8300_tiny_constant_address_p): Use it.
+ (h8300_encode_label, h8300_strip_name_encoding): Remove.
+ (h8300_encode_section_info): Set SYMBOL_REF_FLAGS.
+ * config/h8300/h8300.h (TINY_DATA_NAME_P): Remove.
+ (ASM_OUTPUT_LABELREF): Remove.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * config/frv/frv.c (symbol_ref_small_data_p): Remove. Replace
+ all users with SYMBOL_REF_SMALL_P.
+ (const_small_data_p): Use SYMBOL_REF_SMALL_P.
+ (frv_encode_section_info): Remove.
+ (frv_strip_name_encoding): Remove.
+ (frv_in_small_data_p): Merge tests from encode_section_info.
+ (frv_print_operand): Use '@' not SDATA_FLAG_CHAR.
+ * config/frv/frv.h (SDATA_FLAG_CHAR): Remove.
+ (SDATA_NAME_P): Remove.
+ (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use SIZE not SDATA_NAME_P.
+ (ASM_OUTPUT_LABELREF): Remove.
+ (PRINT_OPERAND_PUNCT_VALID_P): Use '@' not SDATA_FLAG_CHAR.
+
+ * config/frv/frv.c (frv_asm_out_constructor): New.
+ (frv_asm_out_destructor): New.
+ * config/frv/frv.h (CTORS_SECTION_ASM_OP): New.
+ (DTORS_SECTION_ASM_OP): New.
+ (ASM_OUTPUT_CONSTRUCTOR): Remove.
+ (ASM_OUTPUT_DESTRUCTOR): Remove.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * config/cris/cris.c (cris_gotless_symbol, cris_got_symbol): Use
+ SYMBOL_REF_LOCAL_P; abort if not pic.
+ (cris_encode_section_info): Remove.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * config/c4x/c4x.c (c4x_encode_section_info): Remove.
+ (c4x_T_constraint): Use SYMBOL_REF_FUNCTION_P.
+
+ * config/c4x/c4x.h (TARGET_CPU_CPP_BUILTINS): Declare
+ flag_inline_trees.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * config/avr/avr.c (avr_encode_section_info): Remove.
+ (avr_insert_attributes): New.
+ (print_operand_address): Use SYMBOL_REF_FUNCTION_P.
+ (avr_assemble_integer): Likewise.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * arc.c (arc_encode_section_info): Remove.
+ (arc_assemble_integer): Use SYMBOL_REF_FUNCTION_P.
+ (arc_print_operand, arc_print_operand_address): Likewise.
+ * arc.h (EXTRA_CONSTRAINT): Likewise.
+
+2003-04-16 Roger Sayle <roger@eyesopen.com>
+
+ * c-semantics.c (find_reachable_label): New function to find a
+ potentially reachable label in an expression.
+ (expand_unreachable_if_stmt): Similar to expand_if_stmt but
+ assumes the start of the IF_STMT is unreachable (dead) code.
+ (expand_unreachable_stmt): Similar to expand_stmt but assumes
+ the start of the statement list is unreachable (dead) code.
+ (genrtl_if_stmt): If the controlling expression of the IF
+ is constant, use expand_unreachable_stmt for the THEN or ELSE
+ clause as appropriate.
+ (genrtl_switch_stmt): Use expand_unreachable_stmt to expand
+ the body of a SWITCH statement.
+ (expand_stmt): The code immediately following a "return",
+ "break", "continue" or "goto" is unreachable.
+ * Makefile.in (c-semantics.o): Depend upon tree-inline.h.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * rtl.h (MEM_ALIAS_SET): Update documentation.
+ * doc/rtl.texi (Special Accessors): New node.
+ (SYMBOL_REF_FLAG): Note relationship with SYMBOL_REF_FLAGS.
+
+2003-04-16 Alexandre Oliva <aoliva@redhat.com>
+
+ * reload1.c (reload_cse_noop_set_p): Return false if mode of
+ SET_DEST is not the same as that returned by...
+ * cselib.h (cselib_reg_set_mode): ... new function.
+ * cselib.c (cselib_reg_set_mode): Define it.
+ (REG_VALUES): Document semantics of first element as set mode.
+ (cselib_subst_to_values): Skip first element if ELT is NULL.
+ (cselib_lookup): Likewise. Insert past the first element.
+ (cselib_invalidate_regno): NULLify first element.
+ (cselib_record_set): Set first element.
+
+2003-04-16 Olivier Hainque <hainque@act-europe.fr>
+
+ * tree.c (skip_simple_arithmetics_at, saved_expr_p): New functions.
+ (save_expr): Replace loop by call to skip_simple_arithmetics_at.
+ * tree.h: Add prototypes for the two new functions.
+ * fold-const.c (fold_binary_op_with_conditional_arg): Replace test
+ updates introduced in the previous revision by call to saved_expr_p.
+ * stor-layout.c (put_pending_size): Use skip_simple_arithmetics_at.
+
+ * expr.c (store_field): Force usage of bitfield instructions when
+ the field position requires it, whatever SLOW_UNALIGNED_ACCESS.
+ (expand_expr, case BIT_FIELD_REF): likewise.
+
+2003-04-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR middle-end/8866
+ * cfgtrl.c (try_redirect_by_replacing_jump): Do not delete
+ jumptables.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (sdata_symbolic_operand): Use
+ SYMBOL_REF_SMALL_P and SYMBOL_REF_LOCAL_P.
+ (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
+ (function_operand): Use SYMBOL_REF_FUNCTION_P.
+ (ia64_expand_load_address): Likewise.
+ (ia64_assemble_integer): Likewise.
+ (ia64_encode_section_info): Remove.
+ (ia64_strip_name_encoding): Remove.
+ * config/ia64/ia64.h (ENCODE_SECTION_INFO_CHAR): Remove.
+ * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Don't strip it.
+
+2003-04-16 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP): New.
+ (samegp_function_operand): Use SYMBOL_FLAG_SAMEGP.
+ (direct_call_operand): Use SYMBOL_FLAG_NEAR.
+ (local_symbolic_operand): Use SYMBOL_REF_LOCAL_P.
+ (small_symbolic_operand): Use SYMBOL_REF_SMALL_P.
+ (global_symbolic_operand): Similarly.
+ (tls_symbolic_operand_1): Use SYMBOL_REF_TLS_MODEL.
+ (tls_symbolic_operand_type): Likewise.
+ (alpha_encode_section_info): Use default_encode_section_info.
+ (alpha_strip_name_encoding): Remove.
+ (get_tls_get_addr): Split out from ...
+ (alpha_legitimize_address): ... here.
+ (alpha_emit_xfloating_libcall): Use init_one_libfunc.
+ (get_some_local_dynamic_name_1): Use SYMBOL_REF_TLS_MODEL.
+ (alpha_initialize_trampoline): Use init_one_libfunc.
+ (alpha_setup_incoming_varargs): Mark unused parameters.
+ (alpha_initial_elimination_offset): Likewise.
+ (alpha_end_function): Use SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP.
+ (unicosmk_unique_section): Use default_strip_name_encoding.
+ (unicosmk_ssib_name, unicosmk_output_externs): Likewise.
+
+2003-04-16 Aldy Hernandez <aldyh@redhat.com>
+
+ * config.gcc: Add t-spe for eabispe.
+
+ * config/rs6000/t-spe: New.
+
+2003-04-16 J"orn Rennecke <joern.rennecke@superh.com>
+
+ Re-apply this patch:
+
+ 2002-05-16 Dale Johannesen <dalej@apple.com>
+ * combine.c (cant_combine_insn_p): Reenable combinations
+ involving hard regs unless CLASS_LIKELY_SPILLED_P.
+
+2003-04-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR/10271
+ * pa-protos.h (function_arg): Remove last argument.
+ * pa.c (function_arg): Likewise. Use CUMULATIVE_ARGS struct instead.
+ * pa.h (struct hppa_args): Add member incoming.
+ (INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Initialize
+ member incoming.
+ (FUNCTION_ARG): Revise call to function_arg.
+ (FUNCTION_INCOMING_ARG): Delete.
+
+2003-04-15 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.in: Unify the code which creates symlinks to a
+ just-built as, ld, objdump, and nm with the code that detects
+ their presence for purposes of feature tests.
+ * configure: Regenerate.
+
+2003-04-15 Zack Weinberg <zack@codesourcery.com>
+
+ * varasm.c (output_constant_def): Do not consult
+ CONSTANT_AFTER_FUNCTION_P. Remove all code predicated on it.
+ (after_function_constants, output_after_function_constants): Delete.
+ * doc/tm.texi: Delete documentation of CONSTANT_AFTER_FUNCTION_P.
+ * config/mips/mips-protos.h, config/mips/mips.c
+ (mips16_constant_after_function_p): Delete.
+ * config/mips/mips.h: Delete #if-0-ed definition of
+ CONSTANT_AFTER_FUNCTION_P.
+ * config/d30v/d30v.h, config/stormy16/stormy16.h: Remove
+ mention of CONSTANT_AFTER_FUNCTION_P in comment.
+
+2003-04-15 Geoffrey Keating <geoffk@apple.com>
+
+ * tree.c (next_decl_uid): Mark with GTY.
+ (next_type_uid): Likewise.
+
+2003-04-15 J"orn Rennecke <joern.rennecke@superh.com>
+
+ PR target/9594:
+ * sh.c (barrier_align): Also recognize stuff_delay_slot as
+ an indicator that a barrier was created by branch splitting.
+
+2003-04-15 Mark Mitchell <mark@codesourcery.com>
+
+ * c-decl.c (implicitly_declare): Copy declarations that are going
+ to be placed in a local scope.
+
+2003-04-15 James A. Morrison <ja2morri@uwaterloo.ca>
+
+ * invoke.texi (Spec Files): Wrap if-exists-else example.
+ (MCore): Remove duplicate @itemx entries and @opindex entries.
+
+2003-04-15 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * unwind.inc (_Unwind_Backtrace): New function.
+ * unwind.h (_Unwind_Backtrace): Declare it.
+ * libgcc-std.ver (_Unwind_Backtrace): Export it.
+
+2003-04-14 Jason Merrill <jason@redhat.com>
+
+ PR middle-end/10336, c++/10401
+ * jump.c (never_reached_warning): Also stop looking if we reach the
+ beginning of the function.
+
+2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ PR target/10338
+ PR bootstrap/10198
+ PR bootstrap/10140
+ * fixinc/gnu-regex.c (regerror): Use mempcpy not __mempcpy.
+
+2003-04-15 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * i386.md (abssf2_if+1): Make condition agree with abssf2_1 .
+
+2003-04-15 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * optabs.c (expand_binop): In multi-word add cases, ensure
+ XTARGET is copied to TARGET if they are different.
+
+2003-04-15 Olivier Hainque <hainque@act-europe.fr>
+
+ * except.c (resolve_fixup_regions): Avoid dereferencing null pointer
+ to region, possible after integration of function with unreachable
+ regions that were optimized away.
+
+2003-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/rs6000.h (EPILOGUE_USES): Use register 2,
+ instead of TOC_REGISTER in epilogue in
+ current_function_calls_eh_return functions.
+
+2003-04-14 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/extend.texi (Empty Structures): Correct description of G++'s
+ handling of these structures.
+
+ * c-decl.c (grokdeclarator): Reject extern redeclarations of
+ static variables.
+
+2003-04-14 Janis Johnson <janis287@us.ibm.com>
+
+ * config/rs6000/rs6000.md (define_constants): Define constants for
+ all UNSPEC usage, including new values for TLS support.
+ (aux_truncdfsf2, fctiwz, movsi_got, movsi_got_internal,
+ load_toc_aix_si, load_toc_aix_di, load_toc_v4_pic_si,
+ load_toc_v4_PIC_1, load_toc_v4_PIC_1b, load_macho_picbase,
+ macho_correct_pic, blockage, move_from_CR_ov_bit, movesi_from_cr,
+ stack_tie, movsi_to_cr_one, movsi_to_cr, mtcrfsi, eh_set_lr_si,
+ eh_set_lr_di): Use them.
+ * rs6000.c: (mtcrf_operation, uses_TOC, rs6000_emit_prologue,
+ rs6000_emit_epilogue) Use them.
+
+ * rtl.h (SYMBOL_REF_TLS_MODEL): Fix mask value.
+
+2003-04-14 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (c-opts.o): Use custom action.
+
+2003-04-14 Douglas B Rupp <rupp@gnat.com>
+
+ * ifcvt.c (noce_process_if_block): Fail on BLKmode move.
+
+2003-04-14 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * stor-layout.c (layout_type, case ARRAY_TYPE): Add missing code to
+ handle "superflat arrays" in Ada.
+
+ * integrate.c (expand_inline_function): Don't inline if would
+ lose /u on a BLKmode TARGET.
+
+2003-04-14 Joel Brobecker <brobecker@gnat.com>
+
+ * dbxout.c (print_int_cst_bounds_in_octal_p): New function,
+ extracted from dbxout_type.
+ (dbxout_range_type): print large bounds in octal format.
+ (dbxout_type): Replace extracted code by call to
+ print_int_cst_bounds_in_octal_p.
+
+ * dwarf2out.c (gen_compile_unit_die): Emit DW_LANG_Ada95 instead
+ of DW_LANG_Ada83 for Ada units.
+
+2003-04-14 Olivier Hainque <hainque@act-europe.fr>
+
+ * explow.c (round_push): Use HOST_WIDE_INT instead of int for the
+ temporary used to round CONST_INT sizes.
+
+ * tree.c (int_fits_type_p): Extract generic checks from the case
+ of constant type bounds. Refine the checks against constant type
+ bounds to allow for possible decisions against each of these bounds
+ without requiring both bounds to be constant.
+ (tree_int_cst_msb): Put back.
+ * tree.h (tree_int_cst_msb): Likewise.
+
+ * global.c (global_conflicts): Prevent allocation of call clobbered
+ hard regs to pseudos live across abnormal edges, as later passes are
+ not ready to handle them.
+
+ * fold-const.c (fold): Reorder tests for conditional expressions.
+
+ * expr.c (highest_pow2_factor): Return unsigned.
+ * expr.h (offset_address): Likewise.
+ * emit-rtl.c (offset_address): POW2 argument now unsigned.
+
+2003-04-14 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin_strlen): Evaluate the lengths of
+ string literals at compile-time.
+
+2003-04-14 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold): Transform (c1 - x) cmp c2, where cmp is a
+ comparison operation and c1/c2 are floating point constants into
+ x swap(cmp) (c1 - c2).
+
+2003-04-14 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (output_translate_vect): Fix a typo in loop
+ condition.
+
+2003-04-14 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/10377
+ * config/cris/cris.md ("*mov_sideqi", "*mov_sidehi")
+ ("*mov_sidesi", "*mov_sideqi_mem", "*mov_sidehi_mem")
+ ("*mov_sidesi_mem", "*clear_sidesi", "*clear_sidehi")
+ ("*clear_sideqi", "*ext_sideqihi", "*ext_sideqisi")
+ ("*ext_sidehisi", "*op_sideqi", "*op_sidehi", "*op_sidesi")
+ ("*op_swap_sideqi", "*op_swap_sidehi", "*op_swap_sidesi")
+ ("*extopqihi_side", "*extopqisi_side", "*extophisi_side")
+ ("*extopqihi_swap_side", "*extopqisi_swap_side")
+ ("*extophisi_swap_side", 8th, 9th, 10th, 11th, 14th peepholes):
+ When next to constraint R, replace constraint i with n.
+
+Mon Apr 14 16:18:37 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ PR opt/10024
+ * cfgrtl.c (force_nonfallthru_and_redirect): Use unchecked_make_edge.
+
+2003-04-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * doc/contrib.texi (Contributors): Correct my entry.
+
+2003-04-13 Roger Sayle <roger@eyesopen.com>
+
+ * tree.h (DECL_BUILT_IN_NONANSI): Remove.
+ * c-common.c (builtin_function_2): Don't set DECL_BUILT_IN_NONANSI.
+ * c-decl.c (duplicate_decls): Use invariant DECL_BUILT_IN_NONANSI
+ implies DECL_BUILT_IN to simplify logic.
+ * print-tree.c (print_node): Don't dump DECL_BUILT_IN_NONANSI.
+
+2003-04-13 Roger Sayle <roger@eyesopen.com>
+
+ * builtin-types.def (BT_FN_STRING_CONST_STRING): New builtin type.
+ (BT_FN_PTR_SIZE_SIZE): Likewise.
+ * builtins.def (BUILT_IN_MALLOC, BUILT_IN_CALLOC, BUILT_IN_STRDUP):
+ New built-in functions for malloc, calloc and strdup respectively.
+ * calls.c (special_function_p): No need to handle malloc-like
+ functions any longer. ECF_MALLOC is set via built-in attributes.
+
+ * c-decl.c (duplicate_decls): Preserve pure and malloc attributes.
+
+ * doc/extend.texi: Document these new built-in functions.
+
+2003-04-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (expand_builtin_memcpy): Add `endp' argument, use it.
+ (expand_builtin_stpcpy): New.
+ (expand_builtin): Add BUILT_IN_MEMPCPY & BUILT_IN_STPCPY.
+ * builtins.def: Add mempcpy & stpcpy support.
+ * doc/extend.texi (mempcpy, stpcpy): Document new builtins.
+
+2003-04-13 Nick Clifton <nickc@redhat.com>
+
+ * config/rs6000/rs6000.c: Replace occurrences of "GNU CC" with
+ "GCC".
+ * config/rs6000/40x.md, config/rs6000/603.md,
+ config/rs6000/6xx.md, config/rs6000/7450.md, config/rs6000/7xx.md,
+ config/rs6000/8540.md, config/rs6000/aix.h, config/rs6000/aix31.h,
+ config/rs6000/aix3newas.h, config/rs6000/aix41.h,
+ config/rs6000/aix43.h, config/rs6000/aix51.h,
+ config/rs6000/aix52.h, config/rs6000/altivec-defs.h,
+ config/rs6000/altivec.h, config/rs6000/altivec.md,
+ config/rs6000/beos.h, config/rs6000/darwin.h,
+ config/rs6000/eabi.h, config/rs6000/eabialtivec.h,
+ config/rs6000/eabisim.h, config/rs6000/eabispe.h,
+ config/rs6000/freebsd.h, config/rs6000/gnu.h,
+ config/rs6000/host-darwin.c, config/rs6000/linux.h,
+ config/rs6000/linux64.h, config/rs6000/linuxaltivec.h,
+ config/rs6000/lynx.h, config/rs6000/mach.h, config/rs6000/mpc.md,
+ config/rs6000/netbsd.h, config/rs6000/power4.md,
+ config/rs6000/rios1.md, config/rs6000/rios2.md,
+ config/rs6000/rs6000-c.c, config/rs6000/rs6000-modes.def,
+ config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c,
+ config/rs6000/rs6000.h, config/rs6000/rs6000.md,
+ config/rs6000/rs64.md, config/rs6000/rtems.h, config/rs6000/spe.h,
+ config/rs6000/spe.md, config/rs6000/sysv4.h,
+ config/rs6000/sysv4le.h, config/rs6000/vxworks.h,
+ config/rs6000/windiss.h, config/rs6000/xcoff.h: Likewise.
+
+2003-04-13 Nick Clifton <nickc@redhat.com>
+
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Delete
+ support for -mcall-aix switch.
+ * config/rs6000/eabiaix.h: Delete.
+ * config/rs6000/rs6000.h (rs6000_abi): Remove ABI_AIX_NODESC.
+ (RS6000_REG_SAVE, RS6000_SAVE_AREA, FP_ARGS_MAX_REG,
+ RETURN_ADDRESS_OFFSET): Remove use of ABI_AIX_NODESC.
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Likewise.
+ * config/rs6000/rs6000.c (print_operand, rs6000_stack_info,
+ debug_stack_info, output_function_profiler,
+ rs6000_trampoline_size, rs6000_initialise_trampoline): Likewise.
+ * config/rs6000/rs6000.md (call, call_value, call_nonlocal_sysv,
+ call_indirect_nonlocal_sysv, call_value_indirect_nonlocal_sysv,
+ call_value_nonlocal_sysv, sibcall_value_nonlocal_sysv,
+ sibcall_nonlocal_sysv, sibcall_value_local64): Likewise.
+ * config/rs6000/t-ppcgas (MULTILIB_OPTIONS): Remove mcall-aix
+ multilibs.
+ (MULTILIB_DIRNAMES): Remove mcall-aix directories.
+ (MULTILIB_EXCEPTIONS): Delete.
+ (MULTILIB_MATCHES): Remove mcall-aix matches.
+
+ * doc/fragments.texi: Replace -mcall-aix example with an ARM
+ one.
+ * doc/install.texi: Delete powerpc-*-eabiaix target.
+ * doc/invoke.texi: Remove documentation of mcall-aix switch.
+ * doc/tm.texi: Remove mcall-aix from example CPP_SPEC.
+ * config.gcc: Delete powerpc-*-eabiaix target.
+
+2003-04-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Fix typos.
+ * doc/tm.texi: Likewise.
+
+2003-04-12 Zack Weinberg <zack@codesourcery.com>
+
+ * c-typeck.c (digest_init, push_init_level): Use CONSTRUCTOR_ELTS.
+
+2003-04-12 Zack Weinberg <zack@codesourcery.com>
+
+ * tree.c (build_constructor): New function.
+ * tree.h: Prototype it.
+
+ * c-typeck.c (build_c_cast, pop_init_level)
+ * profile.c (build_function_info_value, build_gcov_info_value)
+ (create_profiler):
+ Use build_constructor.
+
+ * builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
+
+ * objc/objc-act.c (build_constructor):
+ Rename objc_build_constructor. Use build_constructor.
+ (build_objc_string_object, objc_add_static_instance)
+ (init_def_list, init_objc_symtab, init_module_descriptor)
+ (generate_static_references, build_selector_translation_table)
+ (build_descriptor_table_initializer, generate_descriptor_table)
+ (build_protocol_initializer, build_ivar_list_initializer)
+ (generate_ivars_list, build_dispatch_table_initializer)
+ (generate_dispatch_table, generate_protocol_list)
+ (build_category_initializer, build_shared_structure_initializer):
+ Update to match.
+
+2003-04-12 Zack Weinberg <zack@codesourcery.com>
+
+ * intl.h: #define gcc_gettext_width to strlen when !ENABLE_NLS.
+
+2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11-protos.h
+ (m68hc11_eq_compare_operator): Declare
+ * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register new predicate.
+ * config/m68hc11/m68hc11.c (m68hc11_eq_compare_operator): New predicate
+ (d_register_operand): Check the operand mode.
+ (hard_addr_reg_operand): Likewise.
+
+2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.md ("decrement_and_branch_until_zero"): New
+ pattern for dbcc/ibcc generation for 68HC12.
+ ("doloop_end"): New pattern.
+ ("m68hc12_dbcc_dec_hi"): New pattern for dbeq/dbne.
+ ("m68hc12_dbcc_inc_hi"): New pattern for ibeq/ibne.
+ ("m68hc12_dbcc_dec_qi"): New pattern.
+ ("m68hc12_dbcc_inc_qi"): New pattern.
+ (split): Add split for the above when we can't use dbcc/ibcc due to
+ reloading.
+ (peephole2): Add peephole2 to generate the above when possible.
+
+2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.md ("bitcmpqi" split): No need to test the
+ mode of operand 0.
+ (peephole2 optimize const load): Likewise for operand 2.
+ ("*rotlhi3_with_carry"): Change pattern to a const 1 rotate which
+ clobbers CC_REGNUM.
+ ("*rotrhi3_with_carry"): Likewise.
+ (ashift:DI 1 split): Update pattern to create the above rotate.
+ (lshiftrt:DI 1 split): Likewise.
+
+2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.md (SOFT_Z_REGNUM): New constant.
+ ("tstqi_z_used" split): Use it.
+ ("cmphi_z_used"): Likewise.
+ ("bitcmpqi_z_used"): Likewise; also use SP_REGNUM constant.
+ ("cmpqi_z_used"): Likewise.
+
+2003-04-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/7910
+ * config/i386/winnt.c (i386_pe_mark_dllimport): Fix thinko.
+
+2003-04-12 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.in: Check for wchar.h, mbstowcs, and wcswidth.
+ * configure, config.in: Regenerate.
+ * intl.c (gcc_gettext_width): New function.
+ * intl.h: Prototype it.
+
+2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.h (TARGET_SWITCHES): Fix -mnominmax option;
+ recognize -mnorelax.
+ (reg_class): Add Z_OR_S_REGS to represent soft registers with Z
+ (REG_CLASS_NAMES): Add its name.
+ (REG_CLASS_CONTENTS): Define its content.
+
+2003-04-12 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/larith.asm (memcpy): Use ARG macro to access stack
+ parameters so that offsets are valid for far definition.
+ (__mulsi3): Likewise and use ret to return.
+ (___adddi3, ___subdi3, ___notdi2, ): Don't use it to save the result.
+
+2003-04-12 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_hash_constant): Skip '0' fields.
+
+2003-04-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * mklibgcc.in (libgcc-stage-start): For every multilib directory
+ containing a libgcc.a, move lib* to the corresponding stage dir.
+
+ * Makefile.in (stage1-start, stage2-start, stage3-start,
+ stage4-start): Move $(SPECS) to specs in stage dir.
+ (unstage1 unstage2 unstage3 unstage4): Move specs in stage dir
+ back as $(SPECS).
+
+ * mklibgcc.in (libgcc-stage-start): Move into the stage directory
+ object files from the non-libgcc/ multilib directories as well.
+
+2003-04-11 Geoffrey Keating <geoffk@apple.com>
+
+ * profile.c (read_counts_file): Initialise 'checksum'.
+
+ * emit-rtl.c (gen_rtx): Really correct typo.
+
+ PR c++/9393
+ * doc/invoke.texi (Debugging Options): Document -frandom-seed.
+ * configure.in: Check for gettimeofday.
+ * tree.c (flag_random_seed): Define.
+ (default_flag_random_seed): New.
+ (append_random_chars): Use flag_random_seed rather than trying
+ to acquire randomness here.
+ * tree.h (default_flag_random_seed): Declare.
+ * toplev.c (display_help): Add -frandom-seed and -fstack-limit-*
+ descriptions.
+ (decode_f_option): Handle -frandom-seed.
+ (print_switch_values): Call default_flag_random_seed.
+ * flags.h (flag_random_seed): Declare.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * config/alpha/t-crtfm: Use -frandom-seed.
+
+ * doc/extend.texi (Empty Structures): New.
+
+ * c-pch.c: Include flags.h. Add comments to routines.
+ (struct c_pch_validity): New.
+ (get_ident): Update PCH file version number.
+ (pch_init): Output current debugging type.
+ (c_common_valid_pch): Check debugging type.
+ * Makefile.in (c-pch.o): Update dependencies.
+ * flags.h (debug_type_names): Declare.
+ * toplev.c (debug_type_names): Move out of decode_g_option.
+
+2003-04-11 Eric Christopher <echristo@redhat.com>
+
+ * emit-rtl.c (gen_rtx): Fix typos.
+
+2003-04-11 Richard Henderson <rth@redhat.com>
+
+ * emit-rtl.c (gen_rtx): Zero '0' fields.
+
+2003-04-11 Richard Henderson <rth@redhat.com>
+
+ PR c++/10202
+ * expr.c (expand_expr): Use COMPLETE_OR_UNBOUND_ARRAY_TYPE_P
+ not COMPLETE_TYPE_P for re-invoking layout_decl.
+
+2003-04-11 Simon Law <sfllaw@engmail.uwaterloo.ca>
+
+ * doc/bugreport.texi: Fix paragraph breaking between sections
+ in preparation for TeXinfo's paragraph indentation fixes.
+ * doc/extend.texi: Ditto.
+ * doc/invoke.texi: Ditto.
+ * doc/objc.texi: Ditto.
+ * doc/gcov.texi: Wrap 'gcov' in @command{}.
+ * doc/invoke.texi (Darwin Options): Add a preamble.
+
+2003-04-11 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (tls_model_chars): Remove.
+ (ix86_encode_section_info, ix86_strip_name_encoding): Remove.
+ (local_symbolic_operand): Use SYMBOL_REF_LOCAL_P.
+ (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
+ (tls_symbolic_operand_1): Likewise.
+ (legitimate_pic_address_disp_p): Use SYMBOL_REF_LOCAL_P.
+ * config/i386/i386.h (TARGET_ENCODE_SECTION_INFO): Remove.
+ (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
+ * config/i386/winnt.c (i386_pe_encode_section_info): Replace
+ bits "copied from i386.h" with default_encode_section_info.
+
+2003-04-11 Richard Henderson <rth@redhat.com>
+
+ * rtl.def (SYMBOL_REF): Add two 0 fields.
+ * gengtype.c (adjust_field_rtx_def): Handle them.
+ * print-rtl.c (print_rtx): Print them.
+ * rtl.h (SYMBOL_REF_DECL, SYMBOL_REF_FLAGS): New.
+ (SYMBOL_FLAG_FUNCTION, SYMBOL_REF_FUNCTION_P): New.
+ (SYMBOL_FLAG_LOCAL, SYMBOL_REF_LOCAL_P): New.
+ (SYMBOL_FLAG_SMALL, SYMBOL_REF_SMALL_P): New.
+ (SYMBOL_FLAG_TLS_SHIFT, SYMBOL_REF_TLS_MODEL): New.
+ (SYMBOL_FLAG_EXTERNAL, SYMBOL_REF_EXTERNAL_P): New.
+ (SYMBOL_FLAG_MACH_DEP): New.
+ * optabs.c (init_one_libfunc): Zap fake SYMBOL_REF_DECL.
+ * varasm.c (make_decl_rtl): Set SYMBOL_REF_DECL.
+ (assemble_static_space): Set SYMBOL_REF_FLAGS.
+ (assemble_trampoline_template): Likewise.
+ (output_constant_def, force_const_mem): Likewise.
+ (default_encode_section_info): New.
+ * output.h: Declare it.
+ * target-def.h (TARGET_ENCODE_SECTION_INFO): Use it.
+
+2003-04-11 Richard Henderson <rth@redhat.com>
+
+ * libfuncs.h (LTI_setbits, LTI_gcov_flush, LTI_gcov_init): New.
+ (setbits_libfunc, gcov_flush_libfunc, gcov_init_libfunc): New.
+ * optabs.c (init_optabs): Initialize them.
+ (init_libfuncs): Use init_one_libfunc.
+ * calls.c (expand_call): Use gcov_flush_libfunc.
+ * expr.c (store_constructor): Use setbits_libfunc.
+ * function.c (expand_main_function): Use init_one_libfunc.
+ * profile.c (create_profiler): Use gcov_init_libfunc and DECL_RTL.
+
+2003-04-11 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/c-tree.texi (Functions): Remove DECL_REAL_CONTEXT
+ documentation; add DECL_FRIEND_CONTEXT.
+
+2003-04-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * doc/install.texi (hppa): Update links for HP-UX patches. Revise
+ notes on linker selection and configuration for 64-bit HP-UX port.
+ * doc/invoke.texi (hppa): Remove hppa text from description for
+ -ffunction-sections and -fdata-sections. Document -static, -nolibdld
+ and -threads options.
+
+ * pa-hpux10.h (LIB_SPEC): Add link options to resolve dependency of
+ libc.a on libdld.sl when -static is specified and -nolibdld is not
+ specified.
+ * pa64-hpux.h (LIB_SPEC): Likewise.
+ * pa-hpux11.h (LIB_SPEC): Likewise.
+ (LINK_SPEC): Add __gcc_plt_call as an undefined symbol when -shared
+ is not specified.
+
+2003-04-11 Zack Weinberg <zack@codesourcery.com>
+
+ * config/darwin-c.c (darwin_pragma_unused): Use lookup_name,
+ not IDENTIFIER_LOCAL_VALUE.
+
+2003-04-11 Richard Henderson <rth@redhat.com>
+
+ PR c/10201
+ * expr.c (expand_expr): Move DECL_RTL frobbing ...
+ * stor-layout.c (layout_decl): ... here.
+
+2003-04-11 James A. Morrison <ja2morri@uwaterloo.ca>
+
+ * doc/invoke.texi: Eliminate extra white-space caused by
+ @gccoptlist{ on its own line.
+ * doc/invoke.texi: Ensured there are two spaces between each option.
+ * doc/invoke.texi: Re-wrapped option lines that were too wide.
+ Added @gol to options that didn't have them.
+
+2003-04-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ * Makefile.in (loop-init.o): Do not depend on gcov-io.h,
+ gcov-iov.h.
+
+ Simplify interface to gcov reading and writing.
+ * gcov-io.h (gcov_file, gcov_position, gcov_length, gcov_buffer,
+ gcov_alloc, gcov_modified, gcov_errored): Move into ...
+ (struct gcov_var gcov_var): ... this static structure.
+ (gcov_write_unsigned, gcov_write_counter, gcov_write_string):
+ Return void.
+ (gcov_read_unsigned, gcov_read_couter, gcov_read_string): Return
+ read object.
+ (gcov_read_bytes, gcov_write_bytes): Set error flag on error.
+ (gcov_reserve_length): Remove.
+ (gcov_write_tag): New.
+ (gcov_write_length): Adjust.
+ (gcov_read_summary, gcov_write_summary): Adjust.
+ (gcov_eof, gcov_ok): Rename to ...
+ (gcov_is_eof, gcov_is_error): ... here. Return error code.
+ (gcov_save_position, gcov_resync): Rename to ...
+ (gcov_position, gcov_seek): ... here.
+ (gcov_skip, gcov_skip_string): Remove.
+ (gcov_error): Remove.
+ (gcov_open, gcov_close): Adjust.
+ * gcov.c (find_source): Take const char *, copy it on allocation.
+ (read_graph_file): Adjust.
+ (read_count_file): Adjust.
+ * libgcov.c (gcov_exit): Adjust.
+ * gcov-dump.c (tag_function, tag_blocks, tag_arcs, tag_lines,
+ tag_arc_counts, tag_summary): Return void. Adjust.
+ (struct tag_format): Adjust proc member.
+ (dump_file): Adjust gcov calls.
+
+2003-04-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (fixinc.sh): Pass BUILD_LIBERTY as LIBERTY to
+ mkfixinc.sh.
+ * fixinc/mkfixinc.sh (defs): Add LIBERTY.
+ * configure.in (STMP_FIXINC, STMP_FIXPROTO): Don't disable on
+ build != host sysrooted builds.
+ * configure.in (SYSTEM_HEADER_DIR): Make sure it contains
+ TARGET_SYSTEM_ROOT even on sysrooted natives.
+ * configure: Rebuilt.
+
+2003-04-10 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (struct binding_level): Add shadowed_tags and
+ function_body; remove this_block, tag_transparent, and
+ subblocks_tag_transparent; update comments.
+ (clear_binding_level, lookup_tag_reverse): Kill.
+ (make_binding_level): Use ggc_alloc_cleared or memset.
+ (lookup_tag): Remove struct binding_level* parameter. All
+ callers changed. Just look at IDENTIFIER_TAG_VALUE, and
+ current_binding_level->tags if asked for thislevel_only or if
+ we might have to diagnose "struct foo; union foo;"
+ (pushlevel): Ignore argument. Do not push another binding
+ level on the transition from the parameters to the top level
+ of the function body; just tweak the flags and proceed.
+ (poplevel): Overhaul. Clear IDENTIFIER_TAG_VALUEs; on exiting
+ a function body, separate the parameter list from the
+ top-level local variables.
+ (set_block): Do nothing.
+ (pushtag): Set IDENTIFIER_TAG_VALUE and add an entry to
+ shadowed_tags if necessary.
+ (warn_if_shadowing): Nuke the special case for local shadowing
+ parameter.
+ (pushdecl): Do not create a shadow entry if we are replacing
+ an older decl in the same binding level.
+ (pushdecl_function_level): Tweak for new way of indicating
+ function scope.
+ (shadow_tag_warned): Use TYPE_NAME, not lookup_tag_reverse.
+ (start_function): Don't set subblocks_tag_transparent.
+ (finish_function): Fix up the binding_level stack for totally
+ empty functions. Otherwise, don't call poplevel.
+
+ * c-common.c (shadow_warning): MANDATORY argument is no longer
+ necessary. Always use plain warning.
+ * c-common.h: Update to match.
+
+ * cfglayout.c (scope_to_insns_initialize): Clear block when we
+ hit the FUNCTION_DECL.
+ * function.c: Do not create cyclic tree structure.
+
+2003-04-10 Zack Weinberg <zack@codesourcery.com>
+
+ * c-tree.h (struct lang_identifier): Replace global_value,
+ local_value members with symbol_value, tag_value. Kill
+ implicit_decl and limbo_value.
+ (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_LOCAL_VALUE,
+ IDENTIFIER_LIMBO_VALUE, IDENTIFIER_IMPLICIT_DECL,
+ C_MISSING_PROTOTYPE_WARNED): Kill.
+ (IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE,
+ C_DECL_IMPLICIT, C_DECL_ISNT_PROTOTYPE): New.
+ (C_DECL_ANTICIPATED): Rename to C_DECL_INVISIBLE.
+ (implicit_decl_warning, lookup_name_current_level,
+ record_function_scope_shadow): Don't prototype.
+ (pushdecl_function_level): Prototype.
+
+ * c-decl.c (truly_local_externals): New variable.
+ (struct binding_level): Adjust commentary.
+ (get_function_binding_level, clear_limbo_values,
+ record_function_scope_shadow): Kill.
+ (lookup_name_current_level, implicit_decl_warning): Are now static.
+ (any_external_decl, record_external_decl): New static functions.
+ (clone_underlying type): Split out of pushdecl.
+ (c_print_identifier): Update to match changes to struct
+ lang_identifier.
+ (poplevel): Delete #if 0 block. Make externals invisible
+ instead of clearing their IDENTIFIER_SYMBOL_VALUEs. Don't
+ call clear_limbo_values. Refer to IDENTIFIER_SYMBOL_VALUE not
+ IDENTIFIER_GLOBAL_VALUE or IDENTIFIER_LOCAL_VALUE.
+ (duplicate-decls): For real parm decl after a forward decl,
+ set TREE_ASM_WRITTEN here. Allow void foo(...) followed by
+ foo(...) { } with only a warning. Say whether a previous
+ declaration was implicit.
+ (warn_if_shadowing): Now handles all shadowing, not just
+ local-over-local. Clarify comments.
+ (pushdecl): Rewritten. There is no longer a distinction
+ between global and local symbol values; they're all
+ IDENTIFIER_SYMBOL_VALUE. Call record_external_decl on all
+ DECL_EXTERNAL decls, and use any_external_decl to check
+ against previous externals. Kill #if 0 blocks. Don't
+ tolerate error_mark_node being NULL.
+ (pushdecl_top_level): Handle only those cases which
+ Objective C (the only user) needs.
+ (pushdecl_function_level): New function.
+ (implicitly_declare): Create ordinary decls with
+ C_DECL_IMPLICIT set. Recycle old decls, however they got
+ created.
+ (lookup_name): It's always IDENTIFIER_SYMBOL_VALUE. Return 0
+ for C_DECL_INVISIBLE symbols.
+ (lookup_name_current_level): Likewise. Use chain_member.
+ (c_make_fname_decl): Don't muck with DECL_CONTEXT.
+ Use pushdecl_function_level.
+ (builtin_function): Use C_DECL_INVISIBLE.
+ (start_function): Don't muck with IDENTIFIER_IMPLICIT_DECL.
+ Use C_DECL_ISNT_PROTOTYPE and C_DECL_IMPLICIT.
+ (store_parm_decls): It's IDENTIFIER_SYMBOL_VALUE now.
+ (identifier_global_value): Same. Must scan
+ global_binding_level in extremis.
+
+ * c-typeck.c (undeclared_variable): New static function, split
+ from build_external_ref.
+ (build_external_ref): Use DECL_CONTEXT, not
+ IDENTIFIER_LOCAL_VALUE, to decide whether a local hides
+ an instance variable. Restructure for clarity.
+ * objc/objc-act.c: Use identifier_global_value, not
+ IDENTIFIER_GLOBAL_VALUE.
+
+2003-04-08 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * doc/extend.texi (Template Instantiation): Refer to ISO standard,
+ not Working Paper.
+ * doc/invoke.texi (C++ Dialect Options): Same.
+
+2003-04-10 Zack Weinberg <zack@codesourcery.com>
+
+ * tree.c (tree_operand_check_failed): New function.
+ * tree.h (TREE_OPERAND_CHECK, TREE_OPERAND_CHECK_CODE,
+ TREE_RTL_OPERAND_CHECK): New checking macros.
+ (TREE_OPERAND, SAVE_EXPR_CONTEXT, SAVE_EXPR_RTL,
+ RTL_EXPR_SEQUENCE, RTL_EXPR_RTL, WITH_CLEANUP_EXPR_RTL,
+ CONSTRUCTOR_ELTS, LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY,
+ EXIT_BLOCK_RETURN, LOOP_EXPR_BODY, EXPR_WFL_NODE,
+ EXPR_WFL_FILENAME_NODE, EXPR_WFL_FILENAME, TARGET_EXPR_SLOT,
+ TARGET_EXPR_INITIAL, TARGET_EXPR_CLEANUP): Use the new
+ checking macros.
+
+Thu Apr 10 23:52:30 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ PR inline-asm/8803
+ * function.c (instantate_virtual_regs): Verify that all ASM statements
+ match after the virutal regs instantiation.
+
+2003-04-10 Steve Ellcey <sje@cup.hp.com>
+
+ * ia64-protos.h (addp4_optimize_ok): New.
+ * ia64.c (addp4_optimize_ok): New.
+ * ia64.md (*ptr_extend_plus_1): Use addp4_optimize_ok.
+ (*ptr_extend_plus_2): Ditto.
+
+2003-04-10 Steve Ellcey <sje@cup.hp.com>
+
+ * expr.c (expand_assignment): Extend offset_rtx with convert_to_mode
+ not with convert_memory_address.
+ (store_constructor): Ditto, and same for copy_size_rtx.
+ (expand_expr): Ditto.
+
+2003-04-10 Douglas B Rupp <rupp@gnat.com>
+
+ * config/i386/i386.c (ix86_ms_bitfield_layout_p): Fix formatting.
+
+2003-04-10 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/lib2funcs.S (__xtensa_sync_caches): Flush data cache
+ even if it is configured to be write-through.
+
+2003-04-10 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (larl_operand): Do not allow symbols
+ marked with '@'.
+ (s390_encode_section_info): Mark symbols with forced 1-byte
+ alignment with '@'.
+ (s390_strip_name_encoding): Strip '@'.
+ (legitimize_pic_address): Handle symbols that are not valid
+ LARL operands in 64-bit mode.
+
+2003-04-10 Andrew Haley <aph@redhat.com>
+
+ * tree-inline.c (inlinable_function_p): Disable inlining for
+ synchronized methods.
+
+2003-04-09 Steven Bosscher <steven@gcc.gnu.org>
+
+ * c-common.h (lang_statement_code_p): Remove declaration.
+ (statement_code_p): Ditto.
+ (c_common_stmt_codes): Define; list of c-common statement codes.
+ (statement_code_p): New extern declaration.
+ (STATEMENT_CODE_P): Define.
+ (INIT_STATEMENT_CODES): Define.
+ * c-common.c (statement_code_p): Kill the function, declare
+ as an array of bools instead.
+ (lang_statement_code_p): Remove.
+ (walk_stmt_tree): Use STATEMENT_CODE_P not statement_code_p.
+ (c_safe_from_p): Ditto.
+ * c-objc-common.c (c_objc_common_init): Use INIT_STATEMENT_CODES
+ to initialize the statement_code_p array.
+ * tree-inline.c (walk_tree): Use STATEMENT_CODE_P instead of
+ statement_code_p.
+ (copy_tree_r): Ditto.
+ * cp/cp-tree.h (cp_stmt_codes): Define; list of C++ specific
+ statement tree codes.
+ * cp/lex.c (cxx_init): Add missing print line break. Use
+ INIT_STATEMENT_CODES to initialize the statement_code_p array.
+ * cp/parser.c (cp_parser_statement): Use STATEMENT_CODE_P
+ instead of statement_code_p.
+ * cp/pt.c (tsubst_expr): Ditto.
+ * cp/tree.c (verify_stmt_tree_r): Ditto.
+ (cp_statement_code_p): Remove.
+ (init_tree): Don't set lang_statement_code_p, it's gone.
+
+2003-04-09 Dan Nicolaescu <dann@ics.uci.edu>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * regrename.c (struct du_chain): Use a bitfield for reg_class.
+ * cse.c (struct qty_table_elem, struct table_elt, struct set):
+ Use bitfields for fields holding enum rtx_code or
+ enum machine_mode values. Add comments explaining size choices.
+
+2003-04-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/fp-bit.c (unpack_d): Handle pair of doubles with
+ different signs correctly.
+
+2003-04-09 Vladimir Makarov <vmakarov@redhat.com>
+
+ * sched-deps.c (reg_pending_barrier_mode): New enumeration.
+ (reg_pending_barrier): Make it of the enumeration type.
+ (sched_analyze_2): Define the barrier as MOVE_BARRIER or
+ TRUE_BARRIER.
+ (sched_analyze): Ditto.
+ (sched_analyze_insn): Ditto. Use anti-dependencies for
+ MOVE_BARRIER and true-dependencies as TRUE_BARRIER.
+ (init_deps_global): Initialize the barrier as NO_BARRIER.
+
+2003-04-09 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.c (issue_nops_and_insn): Add new parameter.
+ Check that asm insn starts on a new cycle. Add nops after asm
+ insn to end bundle.
+ (bundling): Move insn type evaluation from the loop. Call
+ issue_nops_and_insn with the new parameter. Ignore changing
+ position for nops after asm insn.
+
+2003-04-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * optabs.c: Comment that gen_add2_insn and others may actually
+ return emitted insns, if the gen functions turn out to return
+ emitted insns.
+ * reload1.c (reload_cse_move2add): Cope with emitted insns from
+ gen_add2_insn.
+
+2003-04-09 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (move_operand): Allow symbolic_operand,
+ but not tls_symbolic_operand.
+ (ia64_expand_load_address): Remove scratch operand.
+ (ia64_expand_tls_address): Split out from ia64_expand_move.
+ (ia64_expand_move): Split symbolics only after reload.
+ (ia64_emit_cond_move): New.
+ * config/ia64/ia64-protos.h: Update.
+ * config/ia64/ia64.md (movsi_symbolic, movdi_symbolic): Remove.
+ (symbolic splitter): Accept SImode operands too.
+ (cmove splitter): Use ia64_emit_cond_move.
+
+2003-04-09 Nick Clifton <nickc@redhat.com>
+
+ * doc/install.texi: Note that ARM toolchains need binutils 2.13 or
+ newer.
+ * config/arm/elf.h (SUBTARGET_ASM_FLOAT_SPEC): Pass -mfpu=softfpa
+ instead of -mno-fpu.
+ * config/arm/semi.h (ASM_SPEC): Likewise.
+ * config/arm/xscale-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise,
+ but only if -msoft-float is specified pass. Otherwise pass
+ -mfpu=softvfp.
+
+2003-04-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * function.c (purge_addressof): Use free_INSN_LIST_node instead of
+ free_EXPR_LIST_node.
+
+2003-04-08 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold): Use "fold" following build in more places.
+ Optimize sqrt(x)*sqrt(x) as x, pow(x,y)*pow(z,y) as pow(x*z,y),
+ pow(x,y)*pow(x,z) as pow(x,y+z) and x/pow(y,z) as x*pow(y,-z).
+
+2003-04-08 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (fold_builtin): Constant fold expressions as x*0.5
+ instead of x/2.0. Optimize sqrt(pow(x,y)) as pow(x,y*0.5),
+ log(pow(x,y)) as y*log(x), pow(exp(x),y) as exp(x*y),
+ pow(sqrt(x),y) as pow(x,y*0.5) and pow(pow(x,y),z) as pow(x,y*z).
+ Delete function scope "fcode" variable to avoid shadowing.
+
+2003-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2out.c (DWARF_ARANGES_HEADER_SIZE, DWARF_ARANGES_PAD_SIZE):
+ Take into account DWARF_INITIAL_LENGTH_SIZE.
+
+2003-04-08 Hans-Peter Nilsson <hp@axis.com>
+
+ * reorg.c (fill_slots_from_thread): When considering changing the
+ insn following a reg-to-reg copy insn to use the source reg of the
+ copy, bail out if there's overlap between the registers.
+
+2003-04-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * function.c (postponed_insns): New.
+ (purge_addressof_1): Postpone processing of insns if addressofs
+ are not put into stack.
+ (purge_addressof): Process postponed insns.
+
+2003-04-08 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (NORMAL_MODE): If interrupt handler and TARGET_FMOVD,
+ this is FP_MODE_DOUBLE .
+ * sh.c (ra.h): #include.
+ (push_regs): Add second parameter. Changed all callers.
+ If necessary, set fpscr before saving floating point registers.
+ (calc_live_regs): If interrupt handler and TARGET_FMOVD, always
+ do saves / restores with SZ == 1.
+ (sh_expand_prologue): If interrupt handler, don't use gen_toggle_sz.
+ (sh_expand_epilogue): Likewise. For TARGET_FMOVD, if floating point
+ registers are being restored, restore FPSCR only after restoring them.
+
+2003-04-08 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_init_builtins): Set opaque types
+ regardless of architecture.
+ (spe_init_builtins): Change V2SI and V2SF types to opaque types.
+
+2003-04-08 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (push_regs, calc_live_regs): Return int. Take single
+ HARD_REG_SET * parameter. Changed all callers.
+
+Tue Apr 8 11:12:07 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (legitimate_pic_address_disp_p): Do not accept PLUS in the
+ GOTOFF operand.
+ (legitimize_pic_address): Move plus outside the unspec.
+ * i386.c (legitimate_constant_p): Check (CONST (PLUS (UNSPEC ...
+ for validity.
+
+2003-04-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov-io.h (gcov_save_position): Remove __inline__ from
+ declaration.
+
+2003-04-07 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * doc/install.texi: Use @command and @samp for single- and
+ multi-word commands respectively.
+ * doc/makefile.texi: Likewise.
+ * doc/sourcebuild.texi: Likewise.
+
+2003-04-07 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+ Richard Henderson <rth@redhat.com>
+
+ PR c/9516
+ * expr.c (safe_from_p): Rearrange to avoid deep recursion in
+ favor of looping and tail recursion for TREE_LIST and binops.
+
+2003-04-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop.h (REGNO_FIRST_LUID, REGNO_LAST_LUID): Provide defaults
+ for insns without luid.
+
+2003-04-07 Glen Nakamura <glen@imodulo.com>
+
+ PR opt/8634
+ * explow.c (maybe_set_unchanging): Don't flag non-static const
+ aggregate type initializers with RTX_UNCHANGING_P.
+
+2003-04-07 Richard Henderson <rth@redhat.com>
+
+ PR opt/8634
+ * function.c (purge_addressof_1): Don't try arithmetics for
+ unchanging memories.
+
+2003-04-07 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/sourcebuild.texi (Test Suites): Document testing support for
+ gcov and profile-directed optimizations; describe gcc.misc-tests.
+
+Mon Apr 7 22:19:59 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ PR target/10077
+ * i386.md (movsi_1, movsi_nointerunit_1): Fix SSEMOV alternative.
+
+2003-04-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/rtl.texi (Comparison operations): Update to
+ record the allowed comparison modes.
+
+2003-04-07 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_common_init_builtins): Rename all
+ V2SI_type_node to opaque_V2SI_type_node. Rename all
+ V2SF_type_node to opaque_V2SF_type_node.
+ (rs6000_init_builtins): Define opaque_V2SI_type_node and
+ opaque_V2SF_type_node.
+ (is_ev64_opaque_type): The types opaque_V2SI_type_node and
+ opaque_V2SF_type_node are opaque types.
+
+2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * gcse.c (replace_store_insn): Use single_set.
+
+2003-04-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ Change gcov file interface to single file at a time.
+ * gcov-io.h: Replace IN_LIBGCC1 with IN_LIBGCOV. Use IN_GCOV.
+ Convert to C89 prototypes.
+ (gcov_file, gcov_length, gcov_position, gcov_buffer, gcov_alloc,
+ gcov_error, gcov_modified): New static variables.
+ (gcov_open, gcov_close, gcov_read_bytes, gcov_write_bytes): New
+ functions.
+ (gcov_write_unsigned, gcov_write_counter, gcov_write_string,
+ gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust.
+ (gcov_read_summary, gcov_write_summary): Adjust.
+ (gcov_save_position, gcov_reserve_length, gcov_write_length):
+ Adjust.
+ (gcov_resync, gcov_skip, gcov_skip_string): Adjust.
+ (da_file_open, da_file_close, da_file_eof, da_file_error): Remove.
+ (da_file_position, da_file_seek, da_file_write, da_file_read):
+ Remove.
+ (gcov_error, gcov_eof, gcov_ok, gcov_time): New functions.
+ * gcov.c (gcov_type): Don't typedef here.
+ (IN_GCOV): #define
+ (read_graph_file, read_count_file): Adjust.
+ * gcov-dump.c (gcov_type): Don't typedef here.
+ (IN_GCOV): #define.
+ (tag_function, tag_blocks, tag_arcs, tag_lines, tag_arc_counts):
+ Remove FILE parameter, adjust.
+ (struct tag_format): Adjust proc member.
+ (dump_file): Adjust.
+ * libgcov.c (IN_LIBGCOV): #define.
+ (gcov_exit): Adjust.
+ * loop-init.c: Don't #include gcov-io.h
+ * profile.c (struct counts_entry): New structure to hold counter
+ values.
+ (struct section_reference, struct da_index_entry): Remove.
+ (bbg_file, da_file): Remove.
+ (htab_counts_index_hash, htab_counts_index_eq,
+ htab_counts_index_del): Replace with ...
+ (htab_counts_entry_hash, htab_counts_entry_eq,
+ htab_counts_entry_del): ... these.
+ (cleanup_counts_index, index_counts_file): Remove.
+ (read_counts_file): New function.
+ (get_exec_counts): Adjust.
+ (compute_branch_probabilities): Don't free the exec counts here.
+ (branch_prob): Adjust.
+ (init_branch_prob): Adjust.
+ (end_branch_prob): Adjust.
+
+2003-04-07 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Document
+ -mfloat-gprs.
+
+ * config/rs6000/rs6000.c: Delete rs6000_fprs.
+ Declare rs6000_float_gprs.
+ Declare rs6000_float_gprs_string.
+ (rs6000_parse_float_gprs_option): New.
+ (rs6000_override_options): Genericize rs6000_parse_* calls to use
+ rs6000_parse_yes_no_option.
+ Change check for cpu=8540, to use TARGET_E500.
+ (rs6000_parse_isel_option): Delete.
+ (rs6000_parse_spe_option): Delete.
+ (rs6000_parse_vrsave_option): Delete.
+
+ * config/rs6000/rs6000.h: Rename rs6000_fprs to rs6000_float_gprs.
+ Define rs6000_float_gprs_string.
+ (TARGET_OPTIONS): Add rs6000_float_gprs option.
+
+ * config/rs6000/eabi.h (TARGET_FPRS): Change to use rs6000_float_gprs.
+
+ * config/rs6000/eabispe.h: Set rs6000_float_gprs.
+
+Mon Apr 7 14:36:24 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ PR opt/10024
+ * cfglayout.c (cfg_layout_redirect_edge):
+ Redirect any branch edges unified with the fallthru one.
+ * cfgrtl.c (force_nonfallthru_and_redirect): Do not special
+ case fallthru edges when called via cfglayout.c
+
+2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * c-typeck.c (output_init_element): Check for type == error_mark_node.
+
+2003-04-07 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*zero_extendqisi2_h8300hs): Always
+ split.
+ (a splitter): Do zero-extension via HImode.
+
+2003-04-07 James A. Morrison <ja2morri@uwaterloo.ca>
+
+ * doc/invoke.texi: Eliminate extra white-space caused by
+ @gccoptlist{ on its own line.
+ * doc/invoke.texi: Ensured there are two spaces between each option.
+ * doc/invoke.texi: Re-wrapped option lines that were too wide.
+ Added @gol to options that didn't have them.
+
+2003-04-07 James A Morrison <ja2morri@student.math.uwaterloo.ca>
+
+ * doc/extend.texi (Darwin Pragmas): Fix spelling of Mac OS.
+
+2003-04-06 Zack Weinberg <zack@codesourcery.com>
+
+ * tree.c (tree_size): For all 'c' and 'x' nodes, look directly
+ at the sizes of the relevant structures, rather than relying
+ on TREE_CODE_LENGTH. Call lang_hooks.tree_size to get the
+ sizes of any such we don't know about. Use
+ lang_hooks.identifier_size for IDENTIFIER_NODE.
+
+ (initializer_zerop): Use CONSTRUCTOR_ELTS.
+ * tree.def: Update commentary. Make fourth element of
+ the definition for all 'c' and 'x' nodes zero.
+
+ * langhooks.h: New hook, tree_size / LANG_HOOKS_TREE_SIZE.
+ * langhooks-def.h: Update to match.
+ * langhooks.c: New default, lhd_tree_size.
+
+ * c-common.def (SRCLOC): Kill.
+ * c-pretty-print.c (pp_c_postfix_expression [case SRCLOC]):
+ Remove entirely - was already #if-ed out.
+
+
+2003-04-06 Zack Weinberg <zack@codesourcery.com>
+
+ * mklibgcc.in: Use a here document to avoid running afoul of
+ shells that generate control-A from "echo \1".
+
+2003-04-06 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mspe
+ option.
+
+ * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Set
+ rs6000_spe.
+
+ * config/rs6000/eabi.h (TARGET_E500): Define.
+
+ * config/rs6000/rs6000.h (TARGET_E500): Define.
+ (TARGET_OPTIONS): Add spe= option.
+ Declare rs6000_spe and rs6000_spe_string extern.
+
+ * config/rs6000/rs6000.c (branch_positive_comparison_operator):
+ Change TARGET_SPE to TARGET_E500.
+ (ccr_bit): Change TARGET_SPE to TARGET_E500. Check for
+ !TARGET_FPRS.
+ (print_operand): Same.
+ (rs6000_generate_compare): Same.
+ (output_cbranch): Same.
+ (rs6000_spe): Declare.
+ (rs6000_spe_string): Declare.
+ (rs6000_override_options): Call rs6000_parse_spe_option.
+ (rs6000_parse_spe_option): New.
+
+2003-04-06 Steven Bosscher <steven@gcc.gnu.org>
+
+ * hashtable.c (gcc_obstack_init): Delete this function
+ and everything related to it.
+ * hashtable.h: Remove prototype.
+ * bitmap.c (bitmap_element_allocate): Cleanup redundant
+ defines. Cleanup some unnecessary whitespace.
+ * defaults.h (obstack_chunk_alloc): Redefine with
+ appropriate casts for libiberty obstacks.
+ (obstack_chunk_free): Ditto.
+ (OBSTACK_CHUNK_SIZE): Define, default to 0.
+ (gcc_obstack_init): Define as a call to _obstack_begin.
+ * tree.c (print_obstack_statistics): Delete this unused
+ function.
+ * tree.h (obstack): Don't forward-declare.
+ (print_obstack_statistics): Delete prototype.
+ (print_obstack_name): Ditto.
+ (gcc_obstack_init): Ditto.
+ * rtl.h (gcc_obstack_init): Ditto.
+ * java/jv-scan.c (gcc_obstack_init): Delete this
+ function, its prototype and related defines.
+ * java/jvgenmain.c (gcc_obstack_init): Delete this
+ function, and related defines.
+ * java/parse-scan.y (obstack_chunk_alloc): Don't define.
+ (obstack_chunk_free): Ditto
+
+2003-04-06 Geoffrey Keating <geoffk@apple.com>
+
+ * dbxout.c (dbxout_handle_pch): Move prototype out from
+ #if defined DBX_DEBUGGING_INFO.
+
+2003-04-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov.c (struct arc_info): Replace local_span with cycle.
+ (struct block_info): Replace u.span with u.cycle. Add is_call_return.
+ (solve_flow_graph): Set is_call_return.
+ (add_line_counts): Adjust. In block mode, blocks attach to last line.
+ (accumulate_line_counts): Find graph cycles, not spanning tree.
+ (output_branch_count): Adjust.
+ (output_lines): Adjust.
+ * doc/gcov.texi: Update.
+
+2003-04-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*zero_extendqisi2_h8300hs): Change
+ the second alternative to "#".
+
+2003-04-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (single_one_operand): Use GET_MODE_MASK.
+ (single_zero_operand): Likewise.
+
+2003-04-05 Daniel Berlin <dberlin@dberlin.org>
+
+ * Makefile.in (df.o): Depend on alloc-pool.h, not obstack.h.
+ * df.c: Include alloc-pool.h, not obstack.h.
+ (df_ref_obstack): Remove.
+ (df_ref_pool, df_link_pool): Add pools.
+ (df_alloc): Init the new pools.
+ (df_free): And free them.
+ (df_link_create): Use the pools.
+ (df_ref_create): Ditto.
+
+2003-04-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * simplify-rtx.c: Fix formatting.
+
+2003-04-05 Andrew Pinski <apinski@apple.com>
+
+ * config/rs6000/rs6000.c (addrs_ok_for_quad_peep): Allow addr2
+ reg with reg1 == reg2 and offset1 = -8.
+
+2003-04-05 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_rtx_costs): Halve Power4
+ multiply costs. Correct Power4 divide costs.
+ * config/rs6000/power4.md: Restore multiply and FP latency.
+
+2003-04-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * alias.c (find_base_term): Export.
+ * rtl.h (find_base_term): Declare.
+ * gcse.c (find_moveable_store): Test for flag_non_call_exceptions
+ instead of flag_exceptions. Move test for parameter passing ...
+ (store_killed_in_insn): ... here.
+
+2003-04-05 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ PR bootstrap/10267
+ * doc/install.texi (*-*-solaris2): /bin/ksh is not just recommended
+ for configuring.
+
+2003-04-04 Geoffrey Keating <geoffk@apple.com>
+
+ * dbxout.c (scope_labelno): Add GTY.
+ (have_used_extensions): Add GTY.
+ (source_label_number): Add GTY.
+ (lastfile): Add GTY.
+ (lastfile_is_base): New.
+ (base_input_file): New.
+ (dbxout_handle_pch): New.
+ (dbx_debug_hooks): Add handle_pch.
+ (xcoff_debug_hooks): Likewise.
+ (dbxout_function_end): Remove scope_labelno.
+ (dbxout_init): Set base_input_file.
+ (dbxout_handle_pch): New.
+ (dbxout_source_file): Honour lastfile_is_base.
+ * dwarfout.c (dwarf_debug_hooks): Add dummy handle_pch.
+ * sdbout.c (sdb_debug_hooks): Add dummy handle_pch.
+ * vmsdbgout.c (vmsdbg_debug_hooks): Add dummy handle_pch.
+ * dwarf2out.c (dwarf2_debug_hooks): Add dummy handle_pch.
+ * debug.c (do_nothing_debug_hooks): Add dummy handle_pch.
+ * debug.h (struct gcc_debug_hooks): Add handle_pch.
+ * c-pch.c (pch_init): Don't call start_source_file, but do call
+ handle_pch.
+ (c_common_write_pch): Call handle_pch.
+ (c_common_read_pch): Don't call start_source_file,
+ or end_source_file.
+
+Fri Apr 4 17:43:52 2003 Olivier Hainque <hainque@act-europe.fr>
+
+ * emit-rtl.c (get_mem_attrs): Adjust alignment tests determining
+ use of default attributes to agree MEM_ALIGN macro.
+
+Fri Apr 4 17:33:24 2003 Joel Brobecker <brobecker@gnat.com>
+
+ * dbxout.c (dbxout_type): When printing type index of range type
+ whose bounds are printed in octal format, print type of parent type if
+ it exists so enumerated type descriptions are not transformed
+ into unsigned types.
+
+2003-04-04 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ compute_a_shift_cc.
+ * config/h8300/h8300.c (shift_one): Update the CC status.
+ (shift_two): Likewise.
+ (output_a_shift_cc): Set cc_inline and cc_special.
+ (compute_a_shift_cc): New.
+ * config/h8300/h8300.md (shift insns): Use compute_a_shift_cc.
+
+2003-04-04 Richard Henderson <rth@redhat.com>
+
+ * cse.c (fold_rtx): Fix 03-30 change; do check insn non-null.
+
+2003-04-04 Loren James Rittle <ljrittle@acm.org>
+
+ * fixinc/inclhack.def (bsd_stdio_attrs_conflict): New.
+ * fixinc/fixincl.x: Rebuilt.
+ * fixinc/tests/base/stdio.h: Regenerated.
+
+2003-04-04 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov.c (accumulate_line_counts): Fix span tree merge bug.
+
+Fri Apr 4 15:58:52 2003 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (ACTUAL_NORMAL_MODE): New macro, broken out of
+ (NORMAL_MODE).
+ * sh.c (fpscr_set_from_mem): Use ACTUAL_NORMAL_MODE.
+
+2003-04-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Add entries for Wolfgang
+ Bangerth, DJ Delorie, Christian Ehrhardt, Christopher Faylor,
+ Nathanael Nerode, Diego Novillo, Hartmut Penner, Volker Reichelt,
+ Danny Smith, and Ulrich Weigand.
+ Update Kriang Lerdsuwanakij and fix a typo in Janis Johnson's
+ entry.
+
+2003-04-04 Nick Clifton <nickc@redhat.com>
+
+ * config/sparc/sol2-bi.h: Revert previous delta.
+ * config/sparc/sol2-gas-bi.h (AS_SPARC64_FLAG): Prepend -TSO
+
+2003-04-04 Nick Clifton <nickc@redhat.com>
+
+ * config/v850/v850.c (expand_prologue): Only use register save
+ helper functions if long calls are not being used.
+ Add a clobber of r11 id using long calls.
+ (pattern_is_ok_for_prologue): Account for the extra clobber.
+ (construct_save_jarl): Likewise.
+ * config/v850/v850.md (prolog pattern): Do not use this pattern
+ for v850e's.
+
+2003-04-04 Andreas Schwab <schwab@suse.de>
+
+ * stor-layout.c (layout_decl): Avoid syntax error in last change
+ when PCC_BITFIELD_TYPE_MATTERS is defined but not
+ EMPTY_FIELD_BOUNDARY.
+
+2003-04-03 Jason Merrill <jason@redhat.com>
+
+ PR c/10175
+ * jump.c (never_reached_warning): Revert patch of 2002-11-02.
+ Look backwards for a line note.
+
+2003-04-03 Neil Booth <neil@daikokuya.co.uk>
+
+ * fix-header.c (read_scan_file): Defer switch processing.
+
+2003-04-03 Matt Austern <austern@apple.com>
+
+ * cpppch.c (reset_ht): Remove.
+ (cpp_read_state): Remove loop to reset hashtable identifiers.
+ * ggc-common.c (gt_pch_save): Add call to gt_pch_fixup_stringpool
+ after pch file is written.
+ * ggc.h (gt_pch_fixup_stringpool): Declare.
+ * stringpool.c (ht_copy_and_clear): Define. Callback. Copy
+ hashnode's value to another hashtable, then clear the original.
+ (saved_ident_hash): Define.
+ (gt_pch_save_stringpool): Create saved_ident_hash, use it to
+ store definitions in ident_hash, and clear ident_hash.
+ (gt_pch_fixup_stringpool): Define. Restore definitions from
+ saved_ident_hash to ident_hash, then destroy saved_ident_hash.
+
+Thu Apr 3 22:27:40 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cfgrtl.c (update_bb_for_insn): Do not set block for barriers.
+
+2003-04-03 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/10157
+ * gcse.c (can_copy_p): Rename it to can_copy.
+ (can_copy_init_p): Remove.
+ (compute_can_copy): Use can_copy instead of can_copy_p.
+ (can_copy_p): New exported function. Call compute_can_copy.
+ (hash_scan_set): Use it.
+ (gcse_main): Don't call compute_can_copy.
+ (bypass_jumps): Don't call compute_can_copy.
+ * rtl.h (can_copy_p): Declare.
+ * loop.c (scan_loop): Don't move the source and add a reg-to-reg
+ copy if the mode doesn't support copy operations.
+
+2003-04-03 Jason Merrill <jason@redhat.com>
+
+ * Makefile.in (unstrap): Also remove stage_last.
+
+ * dwarf2out.c (lookup_filename): Don't check for "<internal>".
+ (dwarf2out_source_line): Don't do anything if line==0.
+
+ * stor-layout.c (do_type_align): New fn, split out from...
+ (layout_decl): ...here. Do all alignment calculations for
+ FIELD_DECLs here.
+ (update_alignment_for_field): Not here.
+ (start_record_layout, debug_rli): Remove unpadded_align.
+ * tree.h (struct record_layout_info_s): Remove unpadded_align.
+ * c-decl.c (finish_enum): Don't set DECL_SIZE, DECL_ALIGN
+ or DECL_MODE on the CONST_DECLs.
+ (finish_struct): Don't mess with DECL_ALIGN.
+
+Thu Apr 3 18:57:19 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (print_operand): Do not bypass output_addr_const at flag_pic.
+
+Thu Apr 3 17:08:09 2003 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (sh_function_ok_for_sibcall): Return 0 if the current
+ function is an interrupt handler.
+
+ * sh.c (sh_expand_epilogue): Avoid clash of temp register for
+ restoring target registers with EH_RETURN_STACKADJ_RTX; use
+ multiple registers in round-robin fashion.
+
+2003-04-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gengtype-lex.l (IWORD): Add CHAR_BITFIELD.
+ * system.h (CHAR_BITFIELD): New.
+
+2003-04-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Generalize to accept GT
+ and LE.
+ (another peephole2): Likewise.
+
+2003-04-03 Nick Clifton <nickc@redhat.com>
+
+ * config/sparc/sol2-bi.h (ASM_CPU64_DEFAULT_SPEC): Add -TSO.
+ (DEF_ARCH64_SPEC): Likewise.
+
+Thu Apr 3 09:53:40 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (constant_address_p): Use legitimate_constant_p.
+ (legitimate_address_p): Do not use CONSTANT_ADDRESS_P.
+
+2003-04-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ gtle_operator.
+ * config/h8300/h8300.c (gtle_operator): New.
+ * config/h8300/h8300.h (PREDICATE_CODES): Add an entry for
+ gtle_operator.
+ * config/h8300/h8300.md (a peephole2): Generalize to accept GT
+ and LE.
+
+2003-04-02 Richard Henderson <rth@redhat.com>
+
+ * libgcc-std.ver (_Unwind_GetCFA): New.
+ * unwind-dw2.c (_Unwind_GetCFA): New.
+ * unwind-libunwind.c (_Unwind_GetCFA): New.
+ * unwind-sjlj.c (_Unwind_GetCFA): New.
+ * unwind.h: Declare it.
+
+Thu Apr 3 00:31:21 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ PR inline-asm/8088
+ * i386.c (ix86_hard_regno_mode_ok): Return 0 for MMX/SSE registers
+ when MMX/SSE is not available.
+
+2003-04-02 Mike Stump <mrs@apple.com>
+
+ * doc/install.texi (Specific): Update pointers to apple.com.
+
+Thu Apr 3 00:18:49 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (override_options): Disable red zone by default on i386.
+ (compute_frame_layout, ix86_force_to_memory, ix86_free_from_memory):
+ Do not test TARGET_64BIT together with TARGET_RED_ZONE
+
+2003-04-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Tighten the condition.
+
+2003-04-02 Richard Henderson <rth@redhat.com>
+
+ * longlong.h (umul_ppmm) [alpha]: Use __builtin_alpha_umulh.
+
+2003-04-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-04-02 Richard Henderson <rth@redhat.com>
+
+ * except.c (sjlj_find_directly_reachable_regions): Recognize when
+ must-not-throw region has been deleted.
+
+2003-04-02 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (output_call_frame_info): Ignore fde->nothrow as an
+ optimization when flag_exceptions not enabled.
+
+2003-04-02 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/rs6000/rs6000.c
+ (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Redefine the
+ macros.
+ (rs6000_issue_rate): Add case for 8540.
+ (rs6000_use_sched_lookahead): New function.
+
+ * config/rs6000/8540.md: Rename SIU units into SU ones and MIU
+ units into MU ones.
+ (ppc8540_branch, ppc8540_cr_logical): Add one cycle in the
+ reservation before retirement.
+ (ppc8540_multiply, ppc8540_load, ppc8540_store,
+ ppc8540_simple_float, ppc8540_vector_load, ppc8540_vector_store):
+ Remove additional cycle in the reservation before retirement.
+ (ppc8540_mfcr, ppc8540_mtcrf, ppc8540_mtjmpr): Add missed
+ reservation of ppc8540_issue.
+
+2003-04-02 Andreas Schwab <schwab@suse.de>
+
+ * real.c (decode_ieee_single): Fix decoding of SNaN bit.
+
+2003-04-01 Richard Henderson <rth@redhat.com>
+
+ * except.c (convert_from_eh_region_ranges_1): Smash REG_EH_REGION
+ notes for nothrow calls if flag_forced_unwind_exceptions.
+ (build_post_landing_pads): Mind flag_forced_unwind_exceptions.
+ (sjlj_find_directly_reachable_regions): Likewise.
+ (reachable_handlers): Likewise.
+ (can_throw_external): Likewise.
+ (collect_one_action_chain): Record cleanups after catch-all and
+ must-not-throw if flag_forced_unwind_exceptions.
+ * flags.h (flag_forced_unwind_exceptions): Declare.
+ * toplev.c (flag_forced_unwind_exceptions): New.
+ (lang_independent_options): Add it.
+ * doc/invoke.text: Add it.
+
+2003-04-01 David Mosberger <davidm@hpl.hp.com>
+
+ * config/ia64/crti.asm: Clean up trailing whitespace.
+ Remove trailing hashes (#) from identifiers.
+
+ * config/ia64/crtn.asm: Ditto.
+
+ * config/ia64/crtend.asm: Remove trailing hashes (#) from
+ identifiers.
+ (__do_global_ctors_aux): Align to 32-byte boundary. Add unwind
+ directives. Drop explicit bundling---it just makes the code
+ harder to read. Don't save/restore gp needlessly.
+
+ * config/ia64/crtbegin.asm: Remove trailing hashes (#) from
+ identifiers (they're only needed if the identifier would clash
+ with a register name otherwise).
+ (__do_global_dtors_aux): Align to 32-byte boundary. Add unwind
+ directives. Drop explicit bundling---it just makes the code
+ harder to read.
+ (__do_jv_register_classes): Ditto.
+ (.fini_array): Remove "progbits" (newer
+ assemblers don't like wrong section-types).
+ (.init_array): Ditto.
+
+2003-04-01 Roger Sayle <roger@eyesopen.com>
+
+ PR fortran/9974
+ * gcse.c (reg_killed_on_edge): New function to test whether the
+ given reg is overwritten by any instruction queued on an edge.
+ (bypass_block): Ignore substitutions killed on incoming edges.
+ Don't bypass outgoing edges that have queued instructions.
+
+2003-04-01 Alexandre Oliva <aoliva@redhat.com>
+
+ * real.h (EXP_BITS): Make room for...
+ (struct real_value): ... added canonical bit.
+ (struct real_format): Added pnan.
+ (mips_single_format, mips_double_format, mips_extended_format,
+ mips_quad_format): New.
+ * real.c: Copy p to pnan in all formats.
+ (get_canonical_qnan, get_canonical_snan): Set canonical bit.
+ (real_nan): Use pnan to compute significand's shift.
+ (real_identical): Disregard significand in canonical
+ NaNs.
+ (real_hash): Likewise. Take signalling into account.
+ (encode_ieee_single, encode_ieee_double, encode_ieee_quad):
+ Disregard significand bits in canonical NaNs. Set all bits of
+ canonical NaN if !qnan_msb_set.
+ (encode_ibm_extended, decode_ibm_extended): Likewise. Use
+ qnan_msb_set to tell the base double format.
+ (ibm_extended_format): Use 53 as pnan.
+ (mips_single_format, mips_double_format, mips_extended_format,
+ mips_quad_format): Copied from the corresponding ieee/ibm
+ formats, with qnan_msb_set false.
+ * config/mips/iris6.h (MIPS_TFMODE_FORMAT): Use mips_extended_format.
+ * config/mips/linux64.h (MIPS_TFMODE_FORMAT): Use mips_quad_format.
+ * config/mips/mips.c (override_options): Use mips_single_format
+ and mips_double_format. Default TFmode to mips_quad_format.
+ * config/mips/t-linux64 (tp-bit.c): Define QUIET_NAN_NEGATED.
+ * config/mips/t-irix6: Likewise.
+ * config/mips/t-mips (fp-bit.c, dp-bit.c): Likewise.
+ * config/fp-bit.c (pack_d, unpack_d): Obey it.
+
+2003-04-01 Geoffrey Keating <geoffk@apple.com>
+
+ * unwind-dw2-fde-darwin.c (DESTRUCTOR_MAY_BE_CALLED_LIVE): New.
+ (live_image_destructor): Reset image to initial state.
+ (examine_objects): Set DESTRUCTOR_MAY_BE_CALLED_LIVE.
+
+2003-04-01 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * config/sparc/sparc.c (input_operand): Accept bare
+ CONSTANT_P_RTX operands.
+
+2003-04-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcse.c (struct ls_expr): Added pattern_regs field.
+ (ldst_entry): Initialize it.
+ (extract_mentioned_regs, extract_mentioned_regs_helper): New.
+ (store_ops_ok): Use regs precomputed by them.
+ (find_loads, store_killed_in_insn, load_kills_store): Change return
+ type to bool.
+ (store_killed_before, store_killed_after): Take position of register
+ set in account.
+ (reg_set_info): Store position of the setter.
+ (gcse_main): Enable store motion.
+ (mems_conflict_for_gcse_p): Enable load motion of non-symbol mems.
+ (pre_insert_copy_insn, update_ld_motion_stores, insert_store): Prevent rtl
+ sharing.
+ (simple_mem): Enable store motion of non-symbol mems.
+ (regvec): Type changed.
+ (LAST_AVAIL_CHECK_FAILURE): New.
+ (compute_store_table_current_insn): New.
+ (build_store_vectors): Computation of availability and anticipatability
+ moved ...
+ (compute_store_table, find_moveable_store): ... here.
+ (delete_store): Remove senseless comment.
+ (store_motion): Reorganize.
+
+2003-04-01 Kevin Buettner <kevinb@redhat.com>
+
+ * config/mips/mips.c (override_options): Provide mappings for
+ HI_REGNUM and LO_REGNUM.
+ * config/mips/mips.h (MD_DBX_FIRST): Define.
+
+2003-04-01 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * combine.c (merge_outer_ops): Fix typo.
+
+ * varasm.c (make_decl_one_only): Revert 2003-03-09 patch.
+
+2003-04-01 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md,
+ power4.md,rios1.md,rios2.md,rs64.md}: Change mult_compare to
+ imul_compare. Add lmul_compare.
+ * config/rs6000/power4.md: Bump some latencies. Model extra cycle
+ in second pair of dispatch slots. Model stores more accurately.
+ Tweak multiply model. Add bypasses for CR instructions dependent
+ on complicated compares.
+ * config/rs6000/rs6000.md (mulsi3): Name imul_compare patterns.
+ (muldi3): Add lmul_compare patterns.
+ * config/rs6000/rs6000.c (rs6000_variable_issue): Move FPLOAD_UX
+ and FPSTORE_UX to split instructions and add COMPARE,
+ DELAYED_COMPARE, IMUL_COMPARE, LMUL_COMPARE, IDIV, LDIV.
+ (rs6000_adjust_cost): Add IMUL_COMPARE and LMUL_COMPARE.
+ (rs6000_rtx_costs): Separate POWER4 multiply case.
+
+2003-04-01 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_fixup_clobbered_return_reg):
+ Do nothing if __builtin_return_address was not used.
+
+Tue Apr 1 18:18:23 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (test patterns): Allow memory operand in operand1.
+
+2003-04-01 Aldy Hernandez <aldyh@redhat.com>
+
+ * testsuite/gcc.c-torture/execute/simd-3.c: New.
+
+ * expr.c (expand_expr): Handle VECTOR_CST.
+ (const_vector_from_tree): New.
+
+ * varasm.c (output_constant): Handle VECTOR_CST.
+
+ * c-typeck.c (digest_init): Build a vector constant from a
+ VECTOR_TYPE.
+
+ * config/rs6000/rs6000.c: Remove prototype for
+ easy_vector_constant.
+ (easy_vector_constant): Add mode parameter. Rewrite to handle
+ more easy constants.
+ (rs6000_emit_move): Pass mode to easy_vector_constant.
+ Call emit_easy_vector_insn for SPE V2SI vector constant moves.
+ (emit_easy_vector_insn): New.
+ (easy_vector_same): New.
+ (EASY_VECTOR_15): New macro.
+ (EASY_VECTOR_15_ADD_SELF): New macro.
+ (bdesc_2arg): Rename to xorv2si3.
+ (easy_vector_constant_add_self): New.
+ (input_operand): Allow vector constants.
+
+ * config/rs6000/rs6000.h (PREDICATE_CODES): Add
+ easy_vector_constant, easy_vector_constant_add_self.
+ (EXTRA_CONSTRAINT): Add 'W'.
+
+ * config/rs6000/rs6000-protos.h: Add prototype for
+ easy_vector_constant, emit_easy_vector_insn.
+
+ * config/rs6000/altivec.md (xorv8hi3): New.
+ (xorv16qi3): New.
+ Remove all _const0 patterns.
+ (movv4si_internal): Rewrite to use code. Add vector constant to
+ vector alternative. Add splitter.
+ (movv8hi_internal): Same.
+ (movv16qi_internal): Same.
+ (movv4sf_internal): Same.
+ Change the unspecs for vspltis* to use constants.
+
+ * config/rs6000/spe.md ("xorv4hi3"): New.
+ ("spe_evxor"): Rename to xorv2si3.
+ ("xorv1di3"): New.
+ Remove all _const0 patterns.
+ (movv2si_internal): Rewrite to use code. Add vector constant to
+ alternatives. Add splitter.
+ (movv4hi_internal): Add vector constant to alternatives.
+ (movv1di_internal): Same.
+ (movv2sf_internal): Same.
+
+2003-03-31 Mark Mitchell <mark@codesourcery.com>
+
+ PR c/9936
+ * c-decl.c (grokdeclarator): Clear SAVE_EXPR_CONTEXT for
+ variably-sized arrays in parameters.
+ (set_save_expr_context): New function.
+ (c_expand_body): Use it, via walk_tree.
+
+2003-03-31 Eric Christopher <echristo@redhat.com>
+
+ * combine.c (can_combine_p): Allow ZERO_EXTRACT and STRICT_LOW_PART.
+ (combinable_i3pat): Remove call to expand_field_assignment and
+ #if 0'd code.
+
+2003-03-31 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10278
+ * c-common.c (finish_label_address_expr): Handle the
+ error_mark_node.
+
+2003-03-31 Richard Henderson <rth@redhat.com>
+
+ * real.c (real_identical): Reorg so as to not compare
+ signalling for normals.
+
+2003-03-31 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (hard_reg_operand): Check the mode.
+
+2003-03-31 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Don't rely on REG_WAS_0
+ notes as they are boggus.
+ (m68hc11_gen_movqi): Likewise.
+
+2003-03-31 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (expand_prologue): For an interrupt handler
+ save the soft registers after the frame pointer so that gdb can unwind
+ the frame more easily.
+ (expand_epilogue): Likewise in opposite order; allow to use X register
+ as scratch if the return value is by reference.
+
+2003-03-31 Jason Merrill <jason@redhat.com>
+
+ PR java/10145
+ * stor-layout.c (update_alignment_for_field): Respect
+ DECL_USER_ALIGN for zero-length bitfields, too.
+ * c-decl.c (finish_struct): Don't set DECL_ALIGN for normal
+ fields.
+
+2003-03-31 Matt Austern <austern@apple.com>
+
+ * cpppch.c (struct cpp_savedstate): Add defs and n_defs members.
+ (count_defs): Keep track of number of defs as well as total size.
+ (write_defs): Put every definition in cpp_savedstate's defs array.
+ (comp_hashnode): Define. Comparison function for qsort.
+ (cpp_write_pch_deps): Sort definitions before writing them.
+ (struct ht_node_list): Define. Like cpp_savedstate but simpler.
+ (collect_ht_nodes): Define.
+ (cpp_valid_state): When verifying that undefined identifiers in
+ the pch file are still undefined, read a sorted list of undefined
+ identifiers, collect all defined identifiers into a sorted list,
+ and walk through both lists to make sure there's no match.
+
+2003-03-31 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-03-31 Michael Matz <matz@suse.de>
+
+ * config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Change 1 into 0.
+
+2003-03-31 Segher Boessenkool <segher@koffie.nl>
+
+ PR target/10177
+ * config/rs6000/rs6000.h (HARD_REGNO_RENAME_OK): New.
+ * config/rs6000/rs6000.c (compute_vrsave_mask): Don't mark
+ all call-clobbered registers as used.
+
+2003-03-31 Michael Matz <matz@suse.de>
+
+ * cppexp.c (cpp_classify_number): Accept '.' after "0x".
+ * testsuite/gcc.dg/cpp/c99-hexfloat-3.c: New file.
+
+2003-03-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcov.c: Add -a & -u options.
+ (struct arc_info): Add local_span, is_call_non_return,
+ is_nonlocal_return, is_unconditional flags, remove is_call flag.
+ (struct block_info): Add flags, is_call_site, is_nonlocal_return
+ members. Make encodings a union with span member.
+ (struct function_info): Add blocks_executed, line, src, line_next
+ members.
+ (struct coverage_info): Make branches a union with blocks member.
+ (struct source_info): Add functions member.
+ (object_summary, program_count): New global variables.
+ (flag_all_blocks, flag_unconditional): New flags.
+ (find_source, output_branch_count): New functions.
+ (print_usage): Adjust.
+ (options): Adjust.
+ (process_args): Adjust.
+ (read_graph_file) <GCOV_TAG_FUNCTION>: Adjust.
+ <GCOV_TAG_BLOCKS>: Read flags.
+ <GCOV_TAG_LINES>: Adjust.
+ (read_count_file): Process SUMMARY tags.
+ (solve_flow_graph): Set is_unconditional and clear is_call_site
+ appropriately.
+ (add_branch_counts): Adjust. Don't count unconditional branches.
+ (add_line_counts): Deal with all-blocks mode, accumulate block
+ coverage.
+ (accumulate_line_counts): Adjust, generate local spanning tree for
+ all-blocks mode.
+ (output_lines): Adjust.
+ * profile.c (branch_prob): Alter GCOV_FUNCTION_TAG record.
+ * doc/gcov.texi: Document.
+
+2003-03-31 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Organize peephole2's that transform
+ (compare (reg:HI) (const_int)).
+
+2003-03-31 Roger Sayle <roger@eyesopen.com>
+
+ * emit-rtl.c (dconstm2, dconsthalf): New real constants.
+ (init_emit_once): Initialize dconstm2 and dconsthalf here.
+ * real.h (dconstm2, dconsthalf): Add prototypes here.
+ * real.c (real_sqrt): Use dconsthalf rather than local copy.
+ * builtins.c (fold_builtin): When optimizing sqrt(exp(x)) as
+ exp(x/2.0) remember to fold the division if possible.
+ Fold sin(0.0) as 0.0, cos(0.0) as 1.0, pow(x,1.0) as x,
+ pow(x,-1.0) as 1.0/x, pow(x,2.0) as x*x, pow(x,-2.0) as
+ 1.0/(x*x) and pow(x,0.5) as sqrt(x).
+
+2003-03-31 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a new peephole2): New.
+
+2003-03-31 Richard Sandiford <rsandifo@redhat.com>
+
+ * gcse.c (simple_mem): Return false for floating-point accesses
+ if flag_float_store is true.
+
+2003-03-30 Roger Sayle <roger@eyesopen.com>
+
+ * gcse.c (gcse_constant_p): New function to identify constants
+ suitable for constant propagation, including COMPARE with two
+ integer constant arguments.
+ (hash_scan_set): Use gcse_constant_p.
+ (find_avail_set): Likewise.
+ (cprop_insn): Likewise.
+ (do_local_cprop): Likewise.
+ (find_implicit_sets): Likewise.
+ (find_bypass_set): Likewise.
+
+2003-03-30 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * except.h: Remove definition of varray_type.
+
+2003-03-30 Richard Henderson <rth@redhat.com>
+
+ PR opt/10011, opt/10252:
+ * toplev.c (rest_of_compilation): Run purge_builtin_constant_p
+ before post-gcse cse pass.
+
+2003-03-30 Roger Sayle <roger@eyesopen.com>
+
+ * dojump.c (do_jump): Copy SUBREGs into a pseudo for comparison.
+
+2003-03-30 DJ Delorie <dj@redhat.com>
+
+ * profile.c (instrument_edges): Make sure any newly created
+ jump insns have correct jump label info.
+
+2003-03-30 Richard Henderson <rth@redhat.com>
+
+ * cfgbuild.c (make_edges): Use tablejump_p.
+ * cfgcleanup.c (label_is_jump_target_p): Likewise.
+ * cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise.
+ * cfgrtl.c (flow_delete_block_noexpunge): Likewise.
+ (try_redirect_by_replacing_jump): Likewise.
+ (redirect_edge_and_branch): Likewise.
+ * cse.c (fold_rtx): Likewise.
+ * jump.c (delete_related_insns): Likewise.
+ * rtlanal.c (get_jump_table_offset): Likewise.
+ * ssa-ccp.c (ssa_ccp_df_delete_unreachable_insns): Likewise.
+
+2003-03-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * Makefile.in (STRICT_WARN): Don't warn for ISO C constructs.
+ (STRICT2_WARN): Likewise.
+
+2003-03-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ PR other/6955
+ * collect2.c (collect_wait): Use WCOREDUMP and fix output message.
+ * system.h (WCOREDUMP, WCOREFLG): Define if necessary.
+
+2003-03-30 Richard Henderson <rth@redhat.com>
+
+ PR c/10083
+ * config/alpha/alpha.md (umuldi3_highpart): Change to expander;
+ don't zero_extend const inputs.
+
+2003-03-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * reload1.c (reload_cse_move2add): Fix a comment typo.
+
+2003-03-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Remove useless code.
+
+2003-03-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*iorsi3_and_ashift): New.
+ (*iorsi3_and_lshiftrt): Likewise.
+ (*iorsi3_zero_extract): Likewise.
+
+2003-03-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*insv_si_8_8): New.
+ (*insv_si_8_8_lshiftrt_8): Likewise.
+ (a peephole2): Likewise.
+
+2003-03-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi: Add Eric Botcazou and Roger Sayle.
+ Uniformly use bugfix instead of bug fix.
+
+2003-03-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ PR doc/895
+ * ONEWS: Remove those items that already appear in the EGCS
+ release notes on our web pages.
+
+2003-03-29 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Respect
+ TARGET_HARD_FLOAT. Reformat.
+ (FUNCTION_ARG_REGNO_P): Likewise, and remove unneeded casts.
+
+2003-03-28 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * gcc/fixinc/inclhack.def: Update solaris_mutex_init_1 to
+ work on Solaris 2.5.1.
+
+2003-03-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*addsi3_and_r_1): Put under plus:SI
+ section of h8300.md
+ (*addsi3_and_nor_r_1): Likewise.
+
+2003-03-29 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_emit_prologoue): Make sure backchain is
+ set up before any trapping memory access if flag_non_call_exceptions.
+
+2003-03-29 Alan Modra <amodra@bigpond.net.au>
+
+ * reload1.c (reload_as_needed): Allow a USE in asm reloads.
+
+ * loop.c: (find_mem_in_note_1, find_mem_in_note): Comment.
+
+2003-03-28 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Clarify comments.
+ * configure: Regenerate.
+
+2003-03-28 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("literal_pool_31"): Output pool anchor
+ label even if pool empty when generating PIC.
+ ("literal_pool_31", "literal_pool_64"): Coding style cleanup.
+
+2003-03-28 Kazu Hirata <kazu@cs.umass.edu>,
+ Dhananjay Deshpande <dhananjayd@kpit.com>
+
+ PR target/10205
+ * config/h8300/h8300.c (h8300_initial_elimination_offset):
+ Correct the offset computation when TARGET_NORMAL.
+
+2003-03-28 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/10067
+ * config/sparc/sparc.md (jump pattern): Correct order
+ when issuing the annuling marker.
+
+2003-03-28 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/8281
+ * config/sparc/sparc.md (movdi_insn_sp32_v9): Remove 'f-f' alternative.
+ (movdi reg/reg split): Match only on sparc32, and v9 when int regs.
+
+2003-03-28 Alan Modra <amodra@bigpond.net.au>
+
+ * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_BSS): Remove unnecessary
+ globalize_label.
+ * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * config/i960/i960.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * config/mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * config/mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * config/sparc/sparc.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
+ * config/v850/v850.c (v850_output_aligned_bss): Likewise.
+
+2003-03-28 Alan Modra <amodra@bigpond.net.au>
+
+ * loop.c: (find_mem_in_note_1, find_mem_in_note): New functions.
+ (replace_loop_mems): Add "written" param. Remove invalid REG_EQUAL
+ notes after hoisting.
+ (load_mems): Adjust replace_loop_mems call.
+
+2003-03-28 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Richard Henderson <rth@redhat.com>
+
+ PR target/10114 and PR target/10084
+ * dwarf2out.c (mem_loc_descriptor): Handle LO_SUM.
+
+2003-03-27 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.md (adddi_er_high_l): Valid only after reload.
+
+2003-03-27 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold_inf_compare): New function to simplify FP
+ comparisons against +Infinity or -Infinity.
+ (fold): Optimize floating point comparisons against Infs and NaNs.
+
+2003-03-27 Janis Johnson <janis187@us.ibm.com>
+
+ * libgcov.c: Provide only dummy functions if libc is not available.
+
+2003-03-27 Richard Henderson <rth@redhat.com>
+
+ * real.h (struct real_value): Add signalling.
+ (EXP_BITS): Decrement.
+ * real.c (get_canonical_qnan): Don't set MSB-1.
+ (get_canonical_snan): Likewise. Set signalling.
+ (real_identical): Compare signalling.
+ (round_for_format): Remove force-one-bit on code.
+ (real_nan): Likewise. Set signalling.
+ (encode_ieee_single): Add force-one-bit code; honor signalling.
+ (encode_ieee_double, encode_ieee_extended, encode_ieee_quad): Likewise.
+ (decode_ieee_single): Set signalling.
+ (decode_ieee_double, decode_ieee_extended, decode_ieee_quad): Likewise.
+
+2003-03-27 Olivier Hainque <hainque@act-europe.fr>
+
+ PR ada/9953
+ * ada/Makefile.in (gnatlib configuration for HPUX): Split
+ the general section for HPUX into specific sections for
+ HPUX 10 and HPUX 11. Fix the setting of TGT_LIB in the HPUX
+ 11 case.
+
+2003-03-27 Glen Nakamura <glen@imodulo.com>
+
+ PR opt/10087
+ * loop.c (loop_givs_reduce): Skip bivs with duplicate locations
+ while incrementing giv.
+ (record_biv): Check for duplicate biv locations and
+ set (struct induction *) v->same if found.
+
+2003-03-27 David Mosberger <davidm@hpl.hp.com>
+
+ * unwind-libunwind.c (uw_frame_state_for): Adjust for libunwind
+ v0.9 API change: replace read of UNW_REG_HANDLER with
+ unw_get_proc_info().
+ (_Unwind_GetLanguageSpecificData): Replace read of UNW_REG_LSDA
+ with unw_get_proc_info().
+ (_Unwind_GetRegionStart): Replace UNW_REG_PROC_START with
+ unw_get_proc_info().
+
+2003-03-27 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/rs6000/8540.md: Use presence_set instead of absence_set.
+
+2003-03-26 Richard Henderson <rth@redhat.com>
+
+ * c-decl.c (finish_function): Always defer if DECL_DECLARED_INLINE_P.
+
+2003-03-26 Roger Sayle <roger@eyesopen.com>
+
+ PR bootstrap/10051, PR bootstrap/10169.
+ * mips-tfile.c (init_file): Don't provide a static initializer.
+ (initialize_init_file): Initialize the contents of init_file.
+ (add_file): Call initialize_init_file if not already initialized.
+
+2003-03-26 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_optimize_prolog): Do not save/restore
+ registers used for global asm variables.
+ (s390_frame_info, s390_arg_frame_offset): Likewise.
+ (s390_emit_prologue, s390_emit_epilogue): Likewise.
+
+2003-03-26 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/rs6000/8540.md: New file.
+
+ * config/rs6000/{40x.md, 603.md, 6xx.md, 7450.md, 7xx.md, mpc.md,
+ power4.md, rios1.md, rios2.md, rs64.md}: Add mult_compare to
+ reservations for imul.
+
+ * config/rs6000/rs6000.md: Include 8540.md. Change
+ delayed_compare onto mult_compare for insns generating
+ multiplication.
+ (mult_compare, fpsimple, brinc, vecdiv, veccmpsimple, vecfdiv):
+ New type attribute values.
+
+ * config/rs6000/spe.md (*negsf2_gp, *abssf2_gpr): Use type
+ fpsimple instead of fp.
+ (*divsf3_gpr): Use type vecfdiv instead of fp.
+ (spe_evfsabs, spe_evfsnabs, spe_evfsneg): Use type vecsimple
+ instead of vecfloat.
+ (spe_evfsdive): Use type vecfdiv instead of vecfloat.
+ (spe_brinc): Use type brinc instead of veccomplex.
+ (spe_evaddw, spe_evaddiw): Use type vecsimple instead of
+ veccomplex.
+ (spe_evdivws, spe_evdivwu): Use type vecdiv instead of veccomplex.
+ (*movv2si_internal, *movv1di_internal, *movv4hi_internal,
+ *movv2sf_internal): Define type attribute values for all
+ alternatives.
+ (cmpsfeq_gpr, cmpsfgt_gpr, cmpsflt_gpr): Use type veccmp instead
+ of fpcompare.
+ (tstsfeq_gpr, tstsfgt_gpr, tstsflt_gpr): Use type veccmpsimple
+ instead of fpcompare.
+
+2003-03-26 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/power4.md: Allow delay between dispatch and
+ function units for simple instructions. Correct store units.
+ Allow branch to occupy as many dispatch slots as necessary.
+
+2003-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_op_and_fetch): Fix comment.
+ (ia64_expand_compare_and_swap): Use always DImode ar.ccv,
+ zero extend old to it.
+ * config/ia64/ia64.md (cmpxchg_acq_si): Remove mode from ccv
+ operand.
+
+2003-03-26 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/7784
+ * reload.c (find_reloads_address): Handle
+ (PLUS (PLUS (REG) (REG)) (CONST_INT)) form for
+ all base registers.
+
+2003-03-25 Marcelo Abreu <mmabreu@inf.ufrgs.br>
+
+ PR other/10203
+ * version.c: Reference the GCC web site in the URL.
+
+2003-03-26 Alan Modra <amodra@bigpond.net.au>
+
+ * c-incpath.c (add_standard_paths): Add both "translated" and
+ non-translated header paths.
+
+2003-03-25 Loren James Rittle <ljrittle@acm.org>
+
+ * doc/install.texi (*-*-freebsd*): Update with known status.
+
+2003-03-21 Jason Merrill <jason@redhat.com>
+
+ PR optimization/10171
+ * unroll.c (unroll_loop): Don't delete the jump at the end unless
+ we also delete a jump at the beginning.
+
+2003-03-25 Stephane Carrez <stcarrez@nerim.fr>
+
+ * doc/contrib.texi (Contributors): Mention self as 68HC11/68HC12
+ contributor.
+
+Tue Mar 25 20:35:51 CET 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_rtx_costs): For -fpic and x86-64 local symbolic
+ constants are not expensive.
+
+Mon Mar 24 20:03:03 CET 2003 Jan Hubicka <jh@suse.cz>
+
+ PR opt/10056
+ * cfglayout.c (fixup_reorder_chain): Fix dealing with the conditional
+ jump jumping to the next instruction.
+ * cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
+
+2003-03-25 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/passes.texi (Passes): Properly document that we do not
+ perform jump2 any longer; remove command-line option -dJ.
+
+2003-03-25 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/8746
+ * config/i386/i386.md (and promoting splitters): Disable HImode to
+ SImode promoting when the sign bit matters and is not preserved, or
+ when TARGET_FAST_PREFIX is true. Disable promoting when optimizing
+ for size.
+
+2003-03-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Extend to support loads
+ in QImode and HImode.
+
+2003-03-24 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/t-m68hc11-gas (LIB1ASMFUNCS): Add _call_far and
+ _return_far
+ (MULTILIB_OPTIONS): Don't multilib on -mlong-calls.
+ (MULTILIB_EXCEPTIONS): Likewise.
+ * config/m68hc11/m68hc11.md ("call"): Support far calls for 68HC11
+ by calling some board support routine.
+ ("call_value"): Likewise.
+ ("*return_void"): Likewise for return.
+ ("*return_16bit"): Likewise.
+ ("*return_32bit"): Likewise.
+ * config/m68hc11/m68hc11.h (ASM_DECLARE_FUNCTION_NAME): Generate .far
+ for 68HC11 too.
+ (DWARF2_ADDR_SIZE): Use 4 so that addresses can
+ * config/m68hc11/m68hc11.c (m68hc11_override_options): Accept
+ -mlong-calls for 68HC11.
+ * config/m68hc11/larith.asm (declare_near): New macro.
+ (__premain, ___negsi2, ___one_cmplsi2, ___ashlsi3): Use it.
+ (___ashrsi3, ___lshrsi3, ___lshrhi3, ___lshlhi3): Likewise.
+ (___rotrhi3, ___rotlhi3, ___ashrhi3, ___ashrqi3): Likewise.
+ (___lshlqi3, __divmodhi4, ___mulqi3, ___mulhi3): Likewise.
+ (__mulhi32): Likewise.
+ (ret): Update macro for 68HC11.
+ (__far_trampoline): Implement for 68HC11.
+ (__call_a16, __call_a32, __return_void, __return_16): New support
+ routines for 68HC11 memory bank switching calling support.
+ (__return_32): Likewise.
+
+2003-03-24 Neil Booth <neil@daikokuya.co.uk>
+
+ * toplev.c (independent_decode_option): Don't skip a 'Y' prefix.
+
+2003-03-24 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/install.texi (Testing): Mention test result links from build
+ status pages.
+
+2003-03-24 Mark Mitchell <mark@codesourcery.com>
+
+ * function.c (put_var_into_stack): Change bool parameter to int.
+ (gen_mem_addressof): Likewise.
+ * rtl.h (gen_mem_addressof): Likewise.
+ * tree.h (put_var_into_stack): Likewise.
+ * config/alpha/alpha.c (alpha_gp_save_rtx): Adjust call to
+ gen_mem_addressof or put_var_into_stack.
+ * config/c4x/c4x.c (c4x_expand_builtin): Likewise.
+ * config/ia64/ia64.c (spill_tfmode_operand): Likewise.
+
+2003-03-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-03-24 Jakub Jelinek <jakub@redhat.com>
+
+ * dojump.c (do_jump): Handle UNSAVE_EXPR specially.
+
+2003-03-24 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Update Janis Johnson.
+
+2003-03-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/10072
+ * combine.c (simplify_if_then_else): Check that the mode
+ has MODE_INT class before applying the (OP Z (mult COND C2))
+ transformation.
+
+2003-03-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/9414
+ * config/sparc/sparc.md (widening peepholes): Use
+ widen_memory_access instead of change_address.
+
+2003-03-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/7086
+ * c-typeck.c (c_mark_addressable): Adjust calls to
+ put_var_into_stack.
+ * expr.c (expand_expr): Likewise.
+ * function.c (put_var_into_stack): Add rescan parameter. Do not
+ call fixup_var_refs when rescan is false.
+ (gen_mem_addressof): Likewise.
+ (assign_parms): Adjust calls to put_var_into_stack.
+ (setjmp_protect): Likewise.
+ (setjmp_protect_args): Likewise.
+ * rtl.h (gen_mem_addressof): Change prototype.
+ * stmt.c (expand_decl): Adjust calls to put_var_into_stack.
+ * tree.h (put_var_into_stack): Change prototype.
+
+2003-03-23 Arpad Beszedes <beszedes@cc.u-szeged.hu>
+
+ PR middle-end/9967
+ * builtins.c (expand_builtin_fputs): When optimizing for size,
+ don't transform fputs into fwrite.
+
+2003-03-23 Glen Nakamura <glen@imodulo.com>
+
+ PR c/8224
+ * fold-const.c (extract_muldiv_1): Don't pass through type conversions
+ when signedness changes for division or modulus.
+
+2003-03-24 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Remove unnecessary
+ globalize_label.
+
+2003-03-23 Roger Sayle <roger@eyesopen.com>
+
+ PR c/10178
+ * stmt.c (expand_end_case_type): Check for overflow in range when
+ determining whether to use a bit-test implementation.
+
+2003-03-23 Richard Henderson <rth@redhat.com>
+
+ * cfgcleanup.c (try_optimize_cfg): Allow merging of tablejumps
+ before flow2.
+ * cfgrtl.c (try_redirect_by_replacing_jump): Similarly.
+
+2003-03-23 Richard Henderson <rth@redhat.com>
+
+ PR opt/10116
+ * ifcvt.c (find_if_block): Disallow tablejump insns outgoing
+ from then_bb or else_bb after flow2.
+
+2003-03-23 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.in: Check whether it is necessary to link against
+ libm to use ldexp.
+ * configure: Regenerate.
+ * Makefile.in: Add LDEXP_LIB substitution variable.
+
+2003-03-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Fix comment typos.
+
+2003-03-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (output_cbranch): Fix typo in comment.
+
+2003-03-22 Richard Henderson <rth@redhat.com>
+
+ * cfgcleanup.c (insns_match_p): Do not do EQUIV substitution
+ after reload.
+
+2003-03-22 DJ Delorie <dj at redhat dot com>,
+ Bruce Korb <bkorb at gnu dot org>
+
+ * fixinc/inclhack.def (solaris_mutex_init_1): New; Fix
+ buggy Solaris 2.6 mutex/cond initializers.
+ (solaris_mutex_init): Rename to solaris_mutex_init_2.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/tests/base/pthread.h: Update.
+ * fixinc/fixincl.c(initialize): be explicit about the default case
+ and indicate verbose level when being very, very verbose.
+ * fixinc/check.tpl(VERBOSE): provide a means for passing the value in
+
+2003-03-22 Andreas Jaeger <aj@suse.de>
+
+ * config/i386/i386.c (ix86_init_machine_status): Return value.
+
+2003-03-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (output_cbranch, output_bb, output_bvb): Output nop for
+ conditional branch to the following instruction. Use next_real_insn
+ instead of next_active_insn.
+ (output_dbra, output_movb, jump_in_call_delay): Use next_real_insn
+ instead of next_active_insn.
+
+2003-03-22 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("movti", "*movdi_31", "*movdf_31"): Use 'o'
+ instead of 'm' constraint in forced-split alternatives.
+ ("*adddi3_31", "*subdi3_31"): Likewise. Also, pass 0 instead of 1 as
+ VALIDATE_ADDRESS parameter to operand_subword.
+
+2003-03-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (notice_update_cc): Correctly handle
+ the case where the set destination is STRICT_LOW_PART.
+
+2003-03-22 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * config/c4x/t-c4x (INSTALL_LIBGCC): Make gcc recognize a c33 as a
+ c30 instead of a c40 processor.
+
+2003-03-22 Alan Modra <amodra@bigpond.net.au>
+
+ * combine.c (simplify_comparison <AND>): Use gen_int_mode. Tidy.
+
+2003-03-21 Zack Weinberg <zack@codesourcery.com>
+
+ * c-common.c: Include intl.h.
+ (shadow_warning): Rewrite to allow better diagnostic translations.
+ * c-common.h: Update prototype of shadow_warning. Declare sw_kind enum.
+ * c-decl.c (warn_if_shadowing): Update calls to shadow_warning;
+ use it throughout.
+ * Makefile.in (c-common.o): Add intl.h.
+
+2003-03-21 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Remove 'float_format'.
+
+ * fixproto: Define NULL and size_t in generated stdlib.h and
+ unistd.h. Kill unused required_stdlib_h, required_unistd_h.
+ Rearrange file generation loop for readability. Generate time.h,
+ string.h if missing.
+ * tsystem.h: Include <string.h>, <time.h> unconditionally.
+ * config.gcc: Blow away POSIX defines.
+
+2003-03-22 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.md ("call_value"): Fix trap check.
+
+2003-03-22 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.h (ASM_DECLARE_FUNCTION_NAME): Fix typo in
+ writing .interrupt command.
+ * config/m68hc11/m68hc11.md ("call"): Look at the symbol to see
+ if it's a far or near function.
+ ("call_value"): Likewise.
+ * config/m68hc11/m68hc11.c (m68hc11_attribute_table): Add far and
+ near attributes.
+ (m68hc11_handle_fntype_attribute): Accept attributes on methods.
+ (m68hc11_override_options): Ignore -mlong-calls for 68HC11.
+ (m68hc11_initial_elimination_offset): Set current_function_far
+ according to attributes.
+ (expand_prologue): Likewise.
+ (trap_handler_symbol): New global to keep track of trap handlers.
+ (m68hc11_encode_section_info): Mark symbol as far if needed; set
+ trap symbol.
+ (m68hc11_is_far_symbol): New function.
+ (m68hc11_is_trap_symbol): New function.
+ * config/m68hc11/m68hc11-protos.h (m68hc11_is_far_symbol): Declare.
+ (m68hc11_is_trap_symbol): Declare.
+
+2003-03-21 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_compute_frame_layout): Recompute fast prologues
+ only when amount of saved regs changed.
+ (ix86_init_machine_status): Initialize use_fast_prologue_epilgoue_nregs.
+ * i386.h (machine_function): New fields use_fast_prologue_epilgoue_nregs.
+
+2003-03-21 Jan Hubicka <jh@suse.cz>
+
+ PR inline-asm/7916
+ * function.c (instantiate_virtual_regs_lossage): New function.
+ (instantiate_virtual_regs_1): Use it.
+ (instantiate_virtual_regs): Do not continue in substition when insn has
+ been deleted.
+
+2003-03-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (make_field_assignment): Fix a warning.
+
+2003-03-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*insv_si_1_n_lshiftrt_16): New.
+
+2003-03-21 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.h (REG_ALLOC_ORDER): Increase
+ priority for R2 on Darwin.
+ (HARD_REGNO_MODE_OK): Don't accept R31 for DFmode.
+
+2003-03-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (make_field_assignment): Remove unnecessary AND
+ when storing into zero_extract.
+
+2003-03-21 Zack Weinberg <zack@codesourcery.com>
+
+ * aclocal.m4 (gcc_AC_EXAMINE_OBJECT, gcc_AC_C_FLOAT_FORMAT): Delete.
+ * configure.in: Don't call gcc_AC_C_FLOAT_FORMAT.
+ * defaults.h: Remove reference to HOST_FLOAT_WORDS_BIG_ENDIAN
+ in comment.
+
+2003-03-21 DJ Delorie <dj@redhat.com>
+
+ * optabs.c (init_integral_libfuncs): Make sure we init at least up
+ to "long long" size words.
+
+2003-03-21 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.h: Do not include fixdfdi.h on s390x.
+ (TARGET_64BIT): Define as compile-time constant when IN_LIBGCC2.
+ (MIN_UNITS_PER_WORD): Do not define when IN_LIBGCC2.
+
+2003-03-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR doc-bug/9813
+ * doc/extend.texi: Move misplaced paragraph about underscores in
+ variables in macros.
+
+2003-03-21 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Richard Henderson <rth@redhat.com>
+
+ PR optimization/8366
+ * config/sparc/sparc.h: (SYMBOLIC_CONST): New macro.
+ (GO_IF_LEGITIMATE_ADDRESS): Use it. Reject the form
+ PIC+SYMBOLIC_CONST in other modes than Pmode.
+ (GO_IF_MODE_DEPENDENT_ADDRESS): Use it. Mark
+ the form PIC+SYMBOLIC_CONST as mode dependent.
+
+2003-03-21 DJ Delorie <dj@redhat.com>
+
+ * config/stormy16/stormy16.c (xstormy16_expand_arith): Make
+ sure we always emit at least one insn.
+
+2003-03-21 Christopher Faylor <cgf@redhat.com>
+
+ * config.gcc (i[34567]86-*-cygwin*): Use new common makefile
+ stub t-cygming. Use common target header cygming.h. Add extra
+ c_target_obj and cxx_target_obj file. Default cygwin to posix
+ threading. Enforce i386 as float format.
+ (i[34567]86-*-mingw*): Use new common makefile stub t-cygming.
+ Remove cygwin.h as target header. Use common target header
+ cygming.h Enforce i386 as float format. Correct typo.
+ * config/i386/cygming.h: New file, containing definitions
+ common to mingw32 and cygwin.
+ * config/i386/cygwin.h: Remove definitions common to cygwin and
+ mingw. Simplify special spec logic. Define "wrappers" around
+ certain include path defines to accommodate -mno-cygwin.
+ Remove some #if 0'ed code.
+ (STANDARD_INCLUDE_DIR) Always define when not cross-compiling.
+ (LINK_SPEC): Don't use cyg search prefix when -mno-cygwin.
+ (GCC_DRIVER_HOST_INITIALIZATION): Define as call to mingw_scan.
+ * config/i386/mingw32.h: Remove definitions common to cygwin and
+ mingw.
+ (EXTRA_OS_CPP_BUILTINS): Adjust.
+ (TARGET_VERSION): Define.
+ * config/i386/crtdll.h (EXTRA_OS_CPP_BUILTINS): Override
+ mingw32.h definitions.
+ (LIBGCC_SPEC): Add libmingwex.a as in mingw32.h.
+ * config/i386/t-cygwin (EXTRA_GCC_OBJS): Define as cygwin1.o.
+ Add compilation rules for cygwin1.o cygwin2.o.
+ * config/i386/cygwin1.c: New file.
+ * config/i386/cygwin2.c: New file.
+ * config/i386/t-cygming: New makefile stub.
+
+2003-03-20 Richard Henderson <rth@redhat.com>
+
+ * fold-const.c (extract_muldiv_1): Revert changing order of
+ operands in case MULT_EXPR of 2003-02-16 patch.
+
+2003-03-20 Daniel Berlin <dberlin@dberlin.org>
+ Merge changes from new-regalloc-branch
+
+ From Michael Matz <matz@suse.de>
+ * df.c (df_ref_record_1): Move init of loc to safe point.
+ Only recurse on interesting things in parallels.
+ Handle CLASS_CANNOT_CHANGE_MODE smarter.
+ (df_uses_record): Ditto.
+
+ * df.h (DF_REF_MEM_OK): New enum member, used to mark ref's which
+ it's already okay to use memory operands in (IE doesn't require
+ adding another insn or anything).
+
+2003-03-20 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/6348
+ * explow.c (allocate_dynamic_stack_space): Handle STACK_SIZE_MODE
+ different from word_mode.
+
+2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*insv_si_1_n_lshiftrt): Restrict the
+ source operand to those that can be extracted with bld.
+
+2003-03-20 Richard Earnshaw <rearnsha@arm.com>
+
+ PR 10066
+ * arm.md (UNSPEC_PIC_BASE): New constant.
+ (pic_add_dot_plus_four): Wrap with unspec.
+ (pic_add_dot_plus_eight): Likewise.
+
+2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*insv_si_1_n): New.
+ (*insv_si_1_n_lshiftrt): Likewise.
+
+2003-03-20 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold_mathfn_compare): New function to simplify
+ comparisons against built-in math functions. Fold comparisons
+ of sqrt against constants.
+ (fold): Call fold_mathfn_compare when appropriate.
+
+2003-03-20 Richard Earnshaw <rearnsha@arm.com>
+
+ * ifcvt.c (find_if_case_1): If we add a new bb, update the dominance
+ information.
+
+2003-03-20 Per Bothner <pbothner@apple.com>
+
+ Various cleanups to help compile server.
+
+ * cppinit.c (cpp_create_reader): Take extra hash_table* argument,
+ and pass that to _cpp_init_hashtable.
+ (cpp_read_main_file): Drop hash_table* argument; don't call
+ _cpp_init_hashtable.
+ * cpplib.h: Update declarations to match.
+ * c-opts.c (c_common_init_options): Pass ident_hash to
+ cpp_create_reader.
+ (c_common_post_options): Don't pass ident_hash to cpp_read_main_file.
+ * fix-header.c (read_scan_file): Likewise pass NULL table to
+ cpp_create_reader rather than cpp_read_main_file.
+
+ * cppfiles.c (cpp_rename_file): Generalized and renamed
+ to cpp_change_file.
+ * cpplib.h: Update declaration to match.
+ * c-opts.c (push_command_line_line, finish_options): Change
+ cpp_rename_file calls to cpp_change_file.
+
+ * line-map.c (add_line_map): Allow leaving the outermost file.
+ Allowing entering an outermost-file after the initial time.
+
+ * toplev.c (pop_srcloc): Allow popping from initial file.
+
+2003-03-20 Kazu Hirata <kazu at cs dot umass dot edu>
+
+ * fold-const.c (fold): Fold A - (A & B) into ~B & A.
+
+2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-03-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*addsi3_and_r_1): New.
+ (*addsi3_and_not_r_1): Likewise.
+
+2003-03-19 Loren James Rittle <ljrittle@acm.org>
+
+ * Makefile.in (STRICT2_WARN): Add @WERROR@.
+ (GCC_WARN_CFLAGS): Remove $(WERROR).
+ (fixinc.sh-warn): New.
+ * ada/Make-lang.in (ada-warn): Add $(WERROR).
+ * cp/Make-lang.in (cp-warn): Add $(WERROR).
+ * f/Make-lang.in (f-warn): Add $(WERROR).
+ * java/Make-lang.in (java-warn): Add $(WERROR).
+ * treelang/Make-lang.in (treelang-warn): Add $(WERROR).
+
+2003-03-19 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * c-common.h (c_dump_tree), c-dump.c (c_dump_tree),
+ langhooks-def.h (lhd_tree_dump_dump_tree),
+ langhooks.c (lhd_tree_dump_dump_tree), langhooks.h (*dump_tree):
+ Change return type from 'int' to 'bool'. Replace 0 and 1 with
+ true and false in return statements.
+
+2003-03-19 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2out.c (DWARF_INITIAL_LENGTH_SIZE): Define.
+ (DWARF_COMPILE_UNIT_HEADER_SIZE): Take into account
+ DWARF_INITIAL_LENGTH_SIZE.
+ (output_compilation_unit_header, output_pubnames, output_aranges)
+ (output_line_info): Output 0xffffffff escape value for 64-bit
+ DWARF extension.
+ * config/mips/iris6.h (DWARF_INITIAL_LENGTH_SIZE): Define.
+
+2003-03-19 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_preferred_reload_class): Do not
+ force constants to the pool unless necessary.
+ (s390_decompose_address): Prefer to use pointer as base,
+ not index register.
+ * config/s390/s390.md ("*tsthiCCT_only"): Remove '?' from
+ Q alternative.
+ ("*movdi_64", "*movsi", "movhi", "movqi_64", "movqi",
+ "*movdf_64", "*movsf"): Add '?' to Q->Q alternatives.
+ ("*extractqi", "*extracthi", "*zero_extendhisi2_31",
+ "*zero_extendqisi2_31", "*zero_extendqihi2_31",
+ "*adddi3_31", "*subdi3_31"): Do not set "type" attribute.
+
+2003-03-19 Jan Hubicka <jh@suse.cz>
+
+ * i386.h (machine_function): New fields use_fast_prologue_epilogue.
+ * i386.c (use_fast_prologue_epilogue): Remove.
+ (ix86_frame): New field save_regs-using_mov;
+ (ix86_compute_frame_layout): Decide on fast prologues;
+ allocate saved registers in red zone.
+ (ix86_expand_epilogue, ix86_expand_prolgoues): Obey new parameters.
+
+2003-03-19 Nick Clifton <nickc@redhat.com>
+
+ * config/mcore/mcore.h (CPP_SPEC): Remove trailing semi-colon.
+
+2003-03-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR 10062
+ * config/pa/pa-hpux.h (TARGET_HPUX_UNWIND_LIBRARY): Redefine.
+ * pa-protos.h (output_lbranch): New prototype.
+ * pa.c (compute_frame_size): Change size of the frame marker on the
+ 64-bit ports to 48 bytes.
+ (pa_output_function_prologue): Document why SAVE_SP is set.
+ (hppa_expand_prologue): Save previous stack pointer into frame marker
+ on targets which use the hpux unwind library.
+ (output_cbranch): Use output_lbranch.
+ (output_lbranch): New function to output long unconditional branches.
+ * pa.h (TARGET_HPUX_UNWIND_LIBRARY): Define.
+ (STACK_POINTER_OFFSET): Update offset for 48-byte frame marker on
+ 64-bit ports.
+ * pa.md (jump): Use output_lbranch.
+ (allocate_stack): New expander for dynamic stack allocation.
+
+2003-03-19 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (rs6000_stack_info): Only require a frame
+ when debugging on XCOFF targets. Delete "abi" temp.
+
+ PR target/10073
+ * combine.c (force_to_mode <NOT>): Use gen_int_mode.
+
+2003-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ * config/s390/s390.c (s390_output_dwarf_dtprel): New.
+ * config/s390/s390-protos.h (s390_output_dwarf_dtprel): New proto.
+ * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Define.
+
+ * config/ia64/ia64.c (ia64_output_dwarf_dtprel): New.
+ * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): New proto.
+ * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Define.
+
+2003-03-18 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Don't clone
+ the result of machopic_function_base_name.
+ * config/darwin.c (machopic_function_base_name): Use a gc-allocated
+ string rather than a static array.
+
+ * Makefile.in (emit-rtl.o): Add gt-emit-rtl.h to dependencies.
+
+ * gengtype.c: Include rtl.h.
+ (enum rtx_code): Don't define.
+ (rtx_format): Make declaration match rtl.h.
+ (rtx_next_new): Rename from rtx_next to avoid conflict. Change all
+ users.
+ (adjust_field_rtx_def): Describe strings in NOTE_LINE_NUMBER notes.
+ * Makefile.in (gengtype.o): Update dependencies.
+
+2003-03-18 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/m68k.md (iordi3): Fix setting low half to -1. From
+ martin@blom.org.
+
+2003-03-18 Geoffrey Keating <geoffk@apple.com>
+
+ * function.c (next_block_index): Mark with GTY.
+
+ * config/rs6000/rs6000.md (macho_correct_pic): Correct pattern.
+
+2003-03-18 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.md (UNSPECV_SETJMP_RECEIVER): New.
+ (builtin_setjmp_receiver): Delay call to ia64_reload_gp
+ until after reload.
+
+2003-03-18 Richard Henderson <rth@redhat.com>
+
+ * builtins.c (expand_builtin_unop): New target_mode operand;
+ use it to convert the result to the correct mode.
+ (expand_builtin): Update all callers.
+
+2003-03-18 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("movti", "movhi", "movqi"): Add "type" attribute.
+
+2003-03-18 Jan Hubicka <jh@suse.cz>
+
+ * i386.md: Fix previous commit that mistakely applied the patch
+ twice.
+
+ * alias.c (rtx_equal_for_memref_p): Assume that X and Y has been
+ canonicalized.
+ (memrefs_conflict_p): Likewise.
+ (addr_side_effect_eval): Canonicalize the constructed address.
+
+2003-03-18 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (cvtts?2si peep2): New.
+
+2003-03-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*iorsi3_two_qi_zext): New.
+
+2003-03-18 Andreas Schwab <schwab@suse.de>
+
+ * dwarf2out.c (output_file_names): Cast size_t to unsigned long
+ for format.
+
+2003-03-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/10091
+ * expr.c (expand_expr) [ADDR_EXPR]: Disallow taking the address of
+ an unaligned member of TREE_ADDRESSABLE type.
+
+2003-03-18 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/linux64.h (MASK_PROFILE_KERNEL): Define.
+ (TARGET_PROFILE_KERNEL): Define.
+ (SUBTARGET_SWITCHES): Handle -mprofile-kernel.
+ (PROFILE_BEFORE_PROLOGUE): Don't define.
+ (PROFILE_KERNEL): Remove hacks.
+ * config/rs6000/rs6000.c (TARGET_PROFILE_KERNEL): Define default.
+ (rs6000_stack_info): No need to save lr if just for profiling when
+ TARGET_PROFILE_KERNEL.
+ (output_profile_hook): Output nothing when TARGET_PROFILE_KERNEL.
+ (output_function_profiler): Localize label generation. Emit code
+ for kernel profiling.
+
+2003-03-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ byte_accesses_mergeable_p.
+ * config/h8300/h8300.c (byte_accesses_mergeable_p): New.
+ * config/h8300/h8300.md (*iorhi3_two_qi_mem): Likewise.
+ (a splitter): Likewise.
+ (*iorsi3_ashift_16_ashift_24): Likewise.
+ (*iorsi3_ashift_16_ashift_24_mem): Likewise.
+
+2003-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * dwarf2asm.h: Delete obsolete comment.
+ (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset,
+ dw2_asm_output_pcrel, dw2_asm_output_addr,
+ dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx,
+ dw2_asm_output_nstring, dw2_asm_output_data_uleb128,
+ dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128,
+ dw2_asm_output_delta_sleb128): Add ATTRIBUTE_NULL_PRINTF.
+
+2003-03-17 Zack Weinberg <zack@codesourcery.com>
+
+ * c-tree.h (struct lang_identifier): Remove error_locus field.
+ (IDENTIFIER_ERROR_LOCUS): Kill.
+ (record_function_scope_shadow): New prototype.
+ * c-typeck.c (build_external_ref): Don't complain if
+ decl is error_mark_node. When not at file scope, bind the
+ decl's local value to error_mark_node to suppress further
+ warnings, instead of setting IDENTIFIER_ERROR_LOCUS.
+
+ * c-decl.c (get_function_binding_level): New static function.
+ (record_function_scope_shadow): New exported function.
+ (c_make_fname_decl): Use get_function_binding_level.
+
+2003-03-17 Steve Ellcey <sje@cup.hp.com>
+
+ * stmt.c (tail_recursion_args): Call promote_mode to set
+ unsignedp flag correctly before calling convert_move.
+
+2003-03-17 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-unroll.c (decide_peel_completely,
+ decide_unroll_constant_iterations, decide_unroll_stupid,
+ decide_unroll_runtime_iterations, decide_peel_simple): Set
+ loop->has_desc.
+
+2003-03-17 Jan Hubicka <jh@suse.cz>
+
+ * ggc-common.c (ggc_mark_roots): Use htab_traverse_noresize.
+
+2003-03-17 Olivier Hainque <hainque@act-europe.fr>
+
+ * function.c (assign_parms): For a struct value address passed as
+ first argument, delay the function's result RTL setup code until
+ after the emission of parameter conversions.
+
+2003-03-17 Dave Love <fx@gnu.org>
+ Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define __digital__,
+ __arch64__ to match Compaq cc.
+
+2003-03-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c: Default TARGET_EBCDIC to 0 if not defined.
+ (c_common_init): Set EBCDIC in cpp options.
+ * cpplex.c (maybe_read_ucs, cpp_parse_escape): Use EBCDIC option,
+ not conditional compilation.
+ * cpplib.h (struct cpp_options): New entry EBCDIC.
+
+2003-03-17 Neil Booth <neil@daikokuya.co.uk>
+
+ * fix-header.c (read_scan_file): Need to malloc arguments to add_path.
+
+2003-03-17 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * function.c (thread_prologue_and_epilogue_insns): Set delete_unused
+ argument to 0 for redirect_jump.
+
+2003-03-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8805
+ * except.c (eh_region_u_cleanup): Add prev_try.
+ (expand_eh_region_end_cleanup): Set it.
+ (reachable_handlers): Use it to skip over cleanup blocks.
+
+2003-03-17 Andreas Jaeger <aj@suse.de>
+
+ * Makefile.in (TAGS): Remove obsolete handling of =*.[chy].
+
+2003-03-17 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/linux64.h (TARGET_64BIT): Redefine.
+ (TARGET_RELOCATABLE, TARGET_EABI, TARGET_PROTOTYPE): Likewise.
+ (SUBTARGET_SWITCHES, SUBTARGET_OPTIONS): Likewise.
+ (SUBTARGET_OVERRIDE_OPTIONS, CPP_SYSV_SPEC): Likewise.
+
+2003-03-16 Richard Henderson <rth@redhat.com>
+
+ * simplify-rtx (simplify_binary_operation): Don't abort for
+ SS_PLUS, US_PLUS, SS_MINUS, US_MINUS.
+
+2003-03-16 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.md (movstrictqi, movstrictqi_1): Check
+ optimize_size as well.
+
+2003-03-16 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (print_operand): Handle 'b' modifier
+ for D register to specify the low part of it, aka B.
+ (m68hc11_gen_movhi): Use REG_WAS_0 note and increment or decrement
+ the register if we are loading 1 or -1 to it; avoid using temp
+ register when moving X/Y to Y/X.
+ (m68hc11_gen_movqi): Likewise.
+ (m68hc11_check_z_replacement): Fix last insn setting for compare case.
+
+2003-03-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR optimization/9016
+ * config/i386/i386.c (ix86_expand_move): Force more CONST_DOUBLEs
+ into the constant pool.
+
+2003-03-16 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR target/9164
+ * tree.c (get_narrower): For extensions with unchanged bit number,
+ return the unsignedness of the outer mode.
+
+2003-03-16 Roger Sayle <roger@eyesopen.com>
+
+ * c-typeck.c (build_component_ref): Turn "for" into "do .. while"
+ to avoid "may be used uninitialized" warning on ia64-hpux.
+ * config/ia64/ia64-c.c: Include "tm_p.h" for function prototypes.
+
+2003-03-16 Andreas Jaeger <aj@suse.de>
+
+ * configure.in: Improve check for memcheck.h.
+ * configure: Regenerated.
+
+2003-03-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * doc/cppopts.texi: Remove documentation of -A-.
+
+2003-03-15 Zack Weinberg <zack@codesourcery.com>
+
+ * doc/libgcc.texi: Remove @tie.
+
+2003-03-15 Josef Zlomek <zlomekj@suse.cz>
+
+ * rtl.h (subrtx_p): Renamed to rtx_referenced_p.
+ (rtx_pair): Added new element update_label_nuses, renamed to
+ replace_label_data.
+ * cfgcleanup.c (outgoing_edges_match, try_crossjump_to_edge): Use
+ replace_label_data instead of rtx_pair.
+ * loop.c (load_mems): Likewise.
+ * rtlanal.c (replace_label): Replace label in pool constants and in
+ INSN_LIST (in REG_LABEL note).
+ (subrtx_p): Renamed to rtx_referenced_p.
+ (subrtx_p_1): Renamed to rtx_referenced_p_1, compare the interior of
+ LABEL_REF with CODE_LABEL, traverse constants from pool.
+
+2003-03-15 Aldy Hernandez <aldyh@redhat.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in (TEXI_GCCINT_FILES): Add libgcc.texi.
+ * doc/libgcc.texi: New file.
+ * doc/interface.texi: Delete paragraph about libgcc interface.
+ * doc/gccint.texi: Add libgcc menu entry and @include libgcc.texi.
+
+2003-03-15 Jason Merrill <jason@redhat.com>
+
+ PR debug/9039
+ * dwarf2out.c (gen_decl_die): Ignore frontend tree codes.
+
+ PR debug/6387
+ * dwarf2out.c (dwarf2out_decl): If we're at -g1, just stick nested
+ function DIEs at toplevel.
+ (decls_for_scope): At -g1, don't descend into subblocks.
+
+2003-03-15 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * varasm.c (struct rtx_const): Change type of un.addr member
+ to struct holding an additional 'symbol' member.
+ (decode_rtx_const): Re-enable optimization to count SYMBOL_REFs
+ with equal string addresses as equal.
+ (simplify_subtraction): Adapt to struct rtx_const change.
+
+2003-03-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * fix-header.c (read_scan_file): Read main file before handling -D.
+
+2003-03-15 Roger Sayle <roger@eyesopen.com>
+
+ * c-cppbuiltin.c (builtin_define_with_value_n): Fix whitespace.
+ * c-typeck.c (c_tree_expr_nonnegative_p): Likewise.
+ * cfgbuild.c (find_many_sub_basic_blocks): Likewise.
+ (find_sub_basic_blocks): Likewise.
+ * cgraphunit.c (cgraph_expand_functions): Likewise.
+ * dwarf2out.c (prune_unused_types): Likewise.
+ * expr.c (store_field): Likewise.
+ * genextract.c (print_path): Likewise.
+ * haifa-sched.c (schedule_insn): Likewise.
+ * lcm.c (compute_antinout_edge): Likewise.
+ * loop-unroll.c (decide_peel_once_rolling): Likewise.
+ * ra-colorize.c (ra_colorize_free_all): Likewise.
+ * ra-debug.c (dump_igraph): Likewise.
+ (debug_hard_reg_set): Likewise.
+ * reg-stack.c (reg_to_stack): Likewise.
+ * rtlanal.c (refers_to_regno_p): Likewise.
+ * tracer.c (layout_superblocks): Likewise.
+
+2003-03-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * fix-header.c (read_scan_file): Fix thinko.
+
+2003-03-15 Glen Nakamura <glen@imodulo.com>
+
+ * reload1.c (choose_reload_regs): Use && instead of ||
+ with REG_CANNOT_CHANGE_MODE_P condition.
+
+2003-03-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * c-common.h (cb_register_builtins): Rename c_cpp_builtins.
+ * c-lex.c (init_c_lex): Register builtins hook is dead.
+ * c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
+ (c_common_decode_option): Don't call cpp_handle_option.
+ Handle -A, -D and -U.
+ (handle_deferred_opts): Simplify.
+ (finish_options): Define builtins and command line macros.
+ * c-ppoutput.c (init_pp_output): Register builtins hook is dead.
+ * cppinit.c: Don't include intl.h.
+ (init_builtins): Rename cpp_init_builtins. No hook to call.
+ (init_library): Don't need to sort options.
+ (cpp_create_reader): Don't set pending.
+ (cpp_destroy): Don't free pending.
+ (struct pending_option, cl_directive_handler, struct cpp_pending,
+ APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
+ cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
+ cl_options, cpp_handle_option): Remove.
+ * cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
+ cpp_finish_options): Remove.
+ (cpp_init_builtins): New.
+ * fix-header.c (read_scan_file): Update to handle -D. Fix
+ handling of -I. Replace call to cpp_finish_options.
+
+2003-03-15 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ PR optimization/9387
+ * function.c (thread_prologue_and_epilogue_insns): Use redirect_jump
+ for conditional returns.
+
+2003-03-14 Jason Merrill <jason@redhat.com>
+
+ PR optimization/6871
+ * varasm.c (assemble_variable): Leave constant zeroes in .rodata.
+
+2003-03-14 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (finish_options): New.
+ (COMMAND_LINE_OPTIONS, c_common_decode_option): Add -imacros.
+ (missing_arg): Handle OPT_include and OPT_imacros.
+ (c_common_init, c_common_parse_file): Use finish_options.
+ (handle_deferred_opts): Update.
+ * cppinit.c (struct cpp_pending): Remove imacros_head and imacros_tail.
+ (cpp_finish_options): Don't handle -imacros here.
+ (no_fil): Remove.
+ (COMMAND_LINE_OPTIONS, cpp_handle_option): Don't handle -imacros.
+
+2003-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_load_toc_table): Don't call
+ rs6000_maybe_dead if !fromprolog.
+
+2003-03-14 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * c-common.h (fe_file_change, pp_file_change): New.
+ * c-lex.c (init_c_lex): Don't set cb_file_change.
+ (c_common_parse_file): Move to c-opts.c.
+ (cb_file_change): Rename fe_file_change.
+ * c-opts.c: Include debug.h.
+ (warn_unused_macros, include_cursor): New.
+ (push_command_line_include, cb_file_change): New.
+ (COMMAND_LINE_OPTIONS): Handle -include.
+ (c_common_decode_option): Use local warn_unused_macros.
+ Handle OPT_include.
+ (c_common_post_options): Set file change callback.
+ (handle_deferred_opts): Skip -include. Don't free the array.
+ (c_common_init): Call cpp_finish_options here, and push an
+ initial -include file.
+ * c-ppoutput.c (cb_file_change): Rename pp_file_change.
+ (preprocess_file): Don't call cpp_finish_options.
+ (init_pp_output): Don't set the file change callback.
+ (pp_file_change): Return if no line commands or no output.
+ * cpphash.h (next_include_file, first_unused_line): Remove.
+ * cppinit.c (include_head, include_tail): Remove.
+ (cpp_destroy): Don't free -include chain.
+ (cpp_finish_options): Don't handle -include, or worry about
+ -Wunused-macros.
+ (_cpp_maybe_push_include_file): Remove.
+ (COMMAND_LINE_OPTIONS, cpp_handle_option): Don't handle -include.
+ * cpplib.c (_cpp_pop_buffer): Don't handle -include.
+ * cppmacro.c (_cpp_warn_if_unused_macro, _cpp_create_definition):
+ Used flag is set based upon the state of the warn_unused_macros
+ flag, and so use of first_unused_line is unnecessary.
+
+2003-03-13 Jan Hubicka <jh@suse.cz>
+
+ * cselib.c (clear_table): Do not take argument; always clear just
+ used slots.
+ (cselib_process_insn): Update call of clear_table
+ (cselib_init): Do not call clear_table.
+ (cselib_finish): Clear table.
+
+ * cse.c (count_reg_usage): Do not check side_effects_p.
+ * rtlanal.c (set_noop_p): Check side_effects_p only when set looks
+ like noop.
+ (find_reg_equal_equiv_note): Do not use find_reg_note.
+
+2003-03-14 Richard Henderson <rth@redhat.com>
+
+ PR target/9700
+ * config/alpha/alpha.c (alpha_va_start): Account for
+ current_function_pretend_args_size in the AP offset.
+
+ * config/alpha/alpha.h (SETUP_INCOMING_VARARGS): Move out of line.
+ (INITIAL_ELIMINATION_OFFSET): Move out of line.
+ * config/alpha/alpha.c (alpha_setup_incoming_varargs): New.
+ (alpha_initial_elimination_offset) New.
+ * config/alpha/alpha-protos.h: Update.
+
+2003-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ * stmt.c (expand_start_case): Call emit_queue ().
+
+2003-03-14 Chris Demetriou <cgd@broadcom.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mips/mips.h (FUNCTION_PROFILER): _mcount() doesn't pop 2
+ words in new abis.
+
+2003-03-14 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/8396
+ * tree-inline.c (initialize_inlined_parameters): Make sure the value
+ of read-only constant arguments is passed with the right type.
+
+2003-03-14 Steven Bosscher <steven@gcc.gnu.org>
+
+ * doc/extend.texi (Function Names): Make the example compilable.
+
+2003-03-13 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (processor_target_table): Really allow
+ GP optional instructions on Power4.
+
+2003-03-13 Roger Sayle <roger@eyesopen.com>
+
+ * calls.c (flags_from_decl_or_type): Factor and remove redundant
+ conditional tests.
+
+2003-03-13 Mike Stump <mrs@apple.com>
+
+ * ggc-page.c (struct page_entry): Remove varray.h header.
+ Add index_by_depth field.
+ Remove save_in_use_p field.
+ (struct globals): Add depth_in_use, depth_max, by_depth_in_use,
+ by_depth_max, by_depth, and save_in_use fields.
+ (INITIAL_PTE_COUNT): Add.
+ (save_in_use_p_i): Add.
+ (save_in_use_p): Add.
+ (adjust_depth): Add.
+ (move_ptes_to_front): Add.
+ (push_depth): Add.
+ (push_by_depth): Add.
+ (prefetch): Add.
+ (free_page): Add support for and use faster data structures.
+ (ggc_alloc): Likewise.
+ (init_ggc): Likewise.
+ (ggc_recalculate_in_use_p): Likewise.
+ (ggc_pop_context): Likewise.
+ (clear_marks): Likewise.
+ (ggc_pch_read): Likewise.
+ * Makefile.in (ggc-page.o): Remove varray.h.
+
+2003-03-13 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * ChangeLog: Rotated last year's entries to...
+ * ChangeLog.8: New.
+
+ * config/ia64/fde-glibc.c, config/ia64/freebsd.h,
+ config/ia64/hpux.h, config/ia64/hpux_longdouble.h,
+ config/ia64/ia64-c.c, config/ia64/ia64-modes.def,
+ config/ia64/ia64-protos.h, config/ia64/ia64.c,
+ config/ia64/ia64.h, config/ia64/ia64.md,
+ config/ia64/itanium1.md, config/ia64/itanium2.md,
+ config/ia64/quadlib.c, config/ia64/unwind-ia64.c,
+ config/ia64/unwind-ia64.h: It's GCC, not GNU CC.
+
+2003-03-13 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_dwarf_register_span):
+ Differentiate endianness.
+ (s6000_override_options): Use cpu type instead of TARGET_SPE.
+
+2003-03-13 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.c (print_multi_reg): Do not generate a type 2
+ LDM instructions with writeback enabled.
+ (output_return_instruction): Likewise.
+
+ * config/arm/pe.h (FIXED_REGISTERS): Remove definition.
+ (CALL_USED_REGISTERS): Remove definition.
+ (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Define.
+
+2003-03-13 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (rs6000_flag_pic): Delete.
+ (rs6000_xcoff_encode_section_info): #ifdef TARGET_XCOFF.
+ (rs6000_binds_local_p, TARGET_BINDS_LOCAL_P): #if TARGET_MACHO.
+ (rs6000_override_options): Don't clear flag_pic for ABI_AIX.
+ (rs6000_legitimize_address): Formatting.
+ (rs6000_emit_move): Likewise.
+ (rs6000_return_addr): Test ABI_AIX as well as flag_pic.
+ (rs6000_emit_prologue <save_LR_around_toc_setup>): Likewise.
+ (rs6000_elf_select_section): Comment reason for shlib being
+ set for ABI_AIX.
+ (rs6000_elf_unique_section): Likewise.
+ (rs6000_elf_encode_section_info): Test !TARGET_AIX as well as ABI_AIX.
+ * config/rs6000/rs6000.h (LEGITIMATE_LO_SUM_ADDRESS_P): Test ABI_AIX
+ as well as flag_pic.
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
+ (MINIMAL_TOC_SECTION_ASM_OP): Likewise.
+ * config/rs6000/linux64.h (TARGET_ENCODE_SECTION_INFO): Don't define.
+
+2003-03-13 Richard Henderson <rth@redhat.com>
+
+ * emit-rtl.c (try_split): Handle 1-1 splits of call insns properly.
+
+ * config/ia64/ia64.c (TARGET_FUNCTION_OK_FOR_SIBCALL): New.
+ (ia64_gp_save_reg): Remove.
+ (struct ia64_frame_info): Move to the beginning of the file;
+ add reg_save_gp.
+ (ia64_expand_call): Rearrange for new call patterns.
+ (ia64_reload_gp): New.
+ (ia64_split_call): New.
+ (ia64_compute_frame_size): Allocate reg_save_gp.
+ (ia64_expand_prologue): Save reg_save_gp.
+ (ia64_expand_epilogue): Don't restore gp.
+ (ia64_hard_regno_rename_ok): Remove R4 hack.
+ (ia64_function_ok_for_sibcall): New.
+ (ia64_output_mi_thunk): Set reload_completed, no_new_pseudos;
+ call try_split on sibcall pattern.
+ * config/ia64/ia64-protos.h: Update.
+ * config/ia64/ia64.md (call_nogp, call_value_nogp, sibcall_nogp):
+ Rename from nopic versions. Confiscate 2nd argument to call as
+ a marker.
+ (call_pic, call_value_pic, sibcall_pic): Remove.
+ (call_gp, call_value_gp, sibcall_gp): New.
+ (builtin_setjmp_setup): Remove.
+ (builtin_setjmp_receiver): Call ia64_reload_gp.
+
+2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c,
+ config/dsp16xx/dsp16xx.h, config/dsp16xx/dsp16xx.md: Replace
+ "GNU CC" with "GCC".
+
+ * config/c4x/c4x-c.c, config/c4x/c4x-modes.def,
+ config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h,
+ config/c4x/c4x.md, config/c4x/libgcc.S, config/c4x/rtems.h:
+ GCC, not GNU CC.
+
+ * genattrtab.h, hosthooks-def.h, hosthooks.h, langhooks-def.h,
+ langhooks.h, tree-inline.h: Replace "GNU CC" with "GCC".
+
+ * c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c,
+ langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c,
+ unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace
+ "GNU CC" with "GCC".
+
+ * config/v850/lib1funcs.asm, config/v850/rtems.h,
+ config/v850/v850-c.c, config/v850/v850-protos.h,
+ config/v850/v850.c, config/v850/v850.h, config/v850/v850.md:
+ GCC, not GNU CC.
+
+ * config/vax/bsd.h, config/vax/elf.h, config/vax/netbsd-elf.h,
+ config/vax/netbsd.h, config/vax/openbsd.h, config/vax/openbsd1.h,
+ config/vax/ultrix.h, config/vax/vax-protos.h, config/vax/vax.c,
+ config/vax/vax.h, config/vax/vax.md, config/vax/vaxv.h: GCC, not
+ GNU CC.
+
+2003-03-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ * cpppch.c (cpp_valid_state): Use DL_WARNING_SYSHDR, not DL_WARNING.
+
+2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * fixinc/fixinc.interix: Remove dead code (most of it).
+ * fixinc/fixinc.dgux: Remove.
+
+ * ginclude/float.h, ginclude/iso646.h, ginclude/stdarg.h,
+ ginclude/stdbool.h, ginclude/stddef.h: GCC, not GNU CC.
+
+2003-03-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (pa_init_builtins): Fix warning.
+
+2003-03-12 Steve Ellcey <sje@cup.hp.com>
+
+ * config/ia64/ia64.h (ASM_OUTPUT_XDATA_CHAR): Remove.
+ (ASM_OUTPUT_XDATA_SHORT): Remove.
+ (ASM_OUTPUT_XDATA_INT): Remove.
+ (ASM_OUTPUT_XDATA_DOUBLE_INT): Remove.
+ (ASM_OUTPUT_ADDR_DIFF_ELT): Handled 32 bit address diffs.
+ (ASM_PREFERRED_EH_DATA_FORMAT): Handle 32 bit EH pointers.
+ (CASE_VECTOR_MODE): Handle 32 bit pointers in case statement.
+
+2003-03-12 Andrew Lewycky <andrew@mxc.ca>
+
+ PR c++/7050
+ * expr.c (store_expr): Don't attempt to store void-typed trees,
+ just evaluate them for side effects.
+
+2003-03-12 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppfiles.c (cpp_rename_file, cpp_push_include): New.
+ * cppinit.c (push_include): Move with changes to cppfiles.c.
+ (cpp_read_main_file): Mark named operators here...
+ (cpp_finish_options): ...not here. Update.
+ (_cpp_maybe_push_include_file): Update.
+ * cpplib.h (cpp_push_include, cpp_rename_file): New.
+
+2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * aclocal.m4: Introduce gcc_GAS_VERSION_GTE_IFELSE,
+ _gcc_COMPUTE_GAS_VERSION.
+ * configure.in: Use them.
+ * configure: Regenerate.
+
+2003-03-12 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.md (adddi3): Don't clobber source operand used
+ to detect carry.
+ (subdi3): Reorder emitted instructions.
+
+2003-03-12 Andreas Jaeger <aj@suse.de>
+
+ * config/i386/netbsd64.h (TARGET_OS_CPP_BUILTINS): Remove call to
+ NETBSD_OS_CPP_BUILTINS_LP64.
+
+2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.in: Eliminate all.indirect. Update and clean up comments.
+ Rearrange. Reorganize.
+ * configure.in: Rearrange.
+ * configure: Regenerate.
+
+2003-03-12 Andreas Jaeger <aj@suse.de>
+
+ * c-cppbuiltin.c (cb_register_builtins): Define LP64 builtins for
+ LP64 targets.
+
+ * doc/cpp.texi (Common Predefined Macros): Document __LP64__ and
+ _LP64.
+
+ * config/ia64/ia64.h (TARGET_CPU_CPP_BUILTINS): Do not define
+ _LP64 macros here.
+ * config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Likewise.
+
+ * config/alpha/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove call to
+ NETBSD_OS_CPP_BUILTINS_LP64.
+ * config/sh/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.
+ * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.
+
+ * config/netbsd.h (NETBSD_OS_CPP_BUILTINS_LP64): Remove.
+
+2003-03-12 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_setup_incoming_varargs): Set stack_alignment_needed to 128.
+
+2003-03-12 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR target/9797 and PR c/9853.
+ * stmt.c (expand_decl_init): Call push_temp_slots () and
+ pop_temp_slots ().
+
+2003-03-12 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c: Include basic-block.h.
+ (sh_output_mi_thunk, emit_load_ptr): New functions.
+ (TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Redefine.
+
+2003-03-12 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/pe.h (FIXED_REGISTERS): Add Maverick registers.
+ (CALL_USED_REGISTERS): Likewise.
+ * config/arm/arm.h (FIRST_PSEUDO_REGISTER): Update comment
+ describing how this value is calculated.
+
+2003-03-12 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * configure.in (rlim_t): Define to long if no valid definition
+ found in sys/resource.h.
+ * config.in, configure: Regenerate.
+
+2003-03-12 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/mcore/mcore-elf.h (CPP_PREDEFINES): Replace with
+ TARGET_OS_CPP_BUILTINS.
+ * config/mcore/mcore-pe.h: Similarly.
+ * config/mcore/mcore.h: Replace CPP_PREDEFINES and part of
+ CPP_SPEC with TARGET_CPU_CPP_BUILTINS.
+
+2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/9928
+ * c-decl.c (duplicate_decls): Discard the initializer of the new decl
+ only if it is a VAR_DECL.
+
+2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/9888
+ * config/i386/i386.md (jcc_1): Fix range.
+ (jcc_2): Likewise.
+ (jump): LIkewise.
+ (doloop_end_internal): Likewise.
+
+2003-03-12 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/winnt.c (DLL_IMPORT_PREFIX): New define.
+ Use throughout instead of DLL_IMPORT_EXPORT_PREFIX and "e."
+ (DLL_EXPORT_PREFIX): New define. Use throughout instead of
+ DLL_IMPORT_EXPORT_PREFIX and "i."
+ (i386_pe_dllexport_name_p): Here.
+ (i386_pe_dllimport_name_p): Here.
+ (i386_pe_mark_dllexport): Here. Remove DLL_IMPORT_PREFIX,
+ not 9 chars when getting identifier name.
+ (i386_pe_mark_dllimport): Here.
+ (i386_pe_encode_section_info): Here. Remove DLL_IMPORT_PREFIX,
+ not 9 chars when getting identifier name. Correct comment.
+ (i386_pe_strip_name_encoding): Here. Add comments for different
+ cases.
+ (gen_fastcall_suffix): Break down xmalloc() argument to
+ components.
+ (gen_stdcall_suffix): Likewise.
+ Update copyright year.
+
+2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/9888
+ * config/i386/i386.md (movsi_1): Remove special alternatives
+ for %eax register.
+ (movsi_1_nointernunit): Likewise.
+ (movhi_1): Likewise.
+ * config/i386/i386.c (memory_address_length): Do not use
+ short displacement when there is no base.
+ (ix86_attr_length_address_default): Handle LEA instructions.
+
+2003-03-12 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-cppbuiltin.c (builtin_define_std): Make non-static.
+
+2003-03-11 Loren James Rittle <ljrittle@acm.org>
+
+ * config/freebsd-spec.h (FBSD_CPP_PREDEFINES): Remove.
+ (FBSD_TARGET_OS_CPP_BUILTINS): New port-specific macro.
+ (FBSD_TARGET_CPU_CPP_BUILTINS): New port-specific macro.
+ * config/freebsd.h (CPP_PREDEFINES): Remove.
+ (TARGET_OS_CPP_BUILTINS): New.
+ * config/alpha/freebsd.h: Use overridden FBSD_TARGET_CPU_CPP_BUILTINS
+ instead of TARGET_OS_CPP_BUILTINS.
+ * config/sparc/freebsd.h (CPP_PREDEFINES): Remove.
+
+2003-03-11 Geoffrey Keating <geoffk@apple.com>
+
+ * c-cppbuiltin.c (builtin_define_std): Add ATTRIBUTE_UNUSED.
+
+2003-03-11 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_stack_info): Remove
+ insn_chain_scanned. Use insn_chain_scanned_p in machine_function.
+
+ * config/rs6000/rs6000.h (machine_function): Add insn_chain_scanned_p.
+
+2003-03-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * toplev.c (independent_decode_option): Return success for --help,
+ --target-help and --version.
+
+2003-03-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mips/linux64.h (DRIVER_SELF_SPECS): Add endian_spec.
+ Default to -mips3 on -mabi=64. Don't add -mips* flag if -march is
+ specified.
+ (SUBTARGET_ASM_SPEC): Remove -mips*-adding code obviated by
+ DRIVER_SELF_SPECS.
+ (LINK_SPEC): Let endian options affect the linker emulation name.
+
+2003-03-11 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.md (reload_inqi): Fix mode for source in second set.
+
+2003-03-11 Jan Hubicka <jh@suse.cz>
+
+ * cselib.c (cselib_invalidate_mem_1): Move too ...
+ (cselib_invalidate_mem): ... here; use new list
+ (dummy_val, first_containing_mem): New static variables.
+ (clear_table): Initialize first_containing_mem.
+ (discard_useless_values): Compact the containing_mem list.
+ (add_mem_for_addr): Add to the list.
+ * cselib.h (cselib_val): Add next_containing_mem.
+
+2003-03-11 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Disable string
+ instructions for e500.
+
+2003-03-11 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * c-cppbuiltin.c: Include tm_p.h.
+
+2003-03-11 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/tm.texi (Frame Registers): Document DWARF_REG_TO_UNWIND_COLUMN.
+
+ * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Define.
+ (_Unwind_GetGR): Use DWARF_REG_TO_UNWIND_COLUMN.
+ (_Unwind_SetGR): Same.
+ (_Unwind_GetGRPtr): New.
+ (_Unwind_SetGRPtr): New.
+ (uw_update_context_1): Use accesor functions instead of accessing
+ context->reg[] directly.
+ (uw_install_context_1): Same.
+ (execute_cfa_program): Same.
+ (__frame_state_for): Same.
+
+ * config/rs6000/rs6000.c (spe_synthesize_frame_save): Use 1200 as
+ the synthetic register offset.
+
+ * config/rs6000/rs6000.h (DWARF_REG_TO_UNWIND_COLUMN): New.
+
+2003-03-11 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/cris.md: Remove lingering EGCS reference.
+ ("*extopqihi_side_biap"): For HI operation, match
+ cris_additive_operand_extend_operator, not
+ cris_operand_extend_operator. Adjust condition.
+ ("*extopqihi_side", "*extopqihi"): Ditto.
+ ("*extopqisi_side_biap"): Correct operand numbers in condition.
+ ("*extophisi_side_biap", "*extopqisi_swap_side_biap"): Ditto.
+ ("*extophisi_swap_side_biap", "*extopqisi_swap"): Ditto.
+ ("*extophisi_swap"): Ditto.
+ ("*extopqihi_swap_side_biap"): For HI operation, match a simple
+ PLUS, not cris_operand_extend_operator. Adjust condition and
+ output template.
+ ("*extopqihi_swap_side", "*extopqihi_swap"): Ditto.
+ * config/cris/cris.h (PREDICATE_CODES): Add
+ cris_additive_operand_extend_operator.
+ * config/cris/cris.c (cris_additive_operand_extend_operator):
+ New predicate.
+
+2003-03-11 Hartmut Penner <hpenner@de.ibm.com>
+
+ * df.c (read_modify_subreg_p): Change from static to global.
+ * df.h (read_modify_subreg_p): Add prototype.
+ * sched-deps.c (sched_analyze_1): Generate true dependency for
+ strict_low_part, certain subregs and zero/sign_extract.
+
+2003-03-11 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * c-common.c: Don't include real.h or except.h.
+ (REGISTER_PREFIX): Remove.
+ (builtin_define_std, builtin_define_with_value,
+ builtin_define_with_int_value, builtin_define_with_hex_fp_value,
+ builtin_define_type_max, builtin_define_type_precision,
+ builtin_define_float_constants): Move to c-cppbuiltin.c.
+ (c_stddef_cpp_builtins): New.
+ * c-common.h (builtin_define_with_value, c_stddef_cpp_builtins): New.
+ * c-cppbuiltin.c: New, extracted from c-common.c.
+ (define__GNUC__): New.
+ * cppspec.c (lang_specific_driver): Remove support of -no-gcc.
+ * gcc.c: Remove support of %v1, %v2 and %v3 specs.
+ (cpp_unique_options): Don't support no-gcc.
+ (do_spec_1): Remove support of version specs.
+ * doc/invoke.texi: Remove documentation of %v1, %v2 and %v3.
+ * doc/passes.texi: Update.
+ * doc/tm.texi: Update.
+
+2003-03-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * dwarf2out.c (multiple_reg_loc_descriptor): Fix thinko.
+
+2003-03-10 Andrew Pinski <apinski@apple.com>
+
+ * config/darwin.c (machopic_function_base_name): If dynamic-no-pic
+ is on should not get here.
+ (machopic_indirect_data_reference): If dynamic-no-pic is on just
+ generate high/low parts of the address.
+ (machopic_legitimize_pic_address): Change MACHOPIC_PURE to
+ MACHOPIC_INDIRECT. Dynamic-no-pic uses 0 as the pic base. Generate
+ symbol and labels with a new reg. Dynamic-no-pic does not have a
+ pic_offset_table_rtx.
+ (machopic_select_section): Change references of flag_pic to
+ MACHOPIC_INDIRECT.
+ (machopic_asm_out_destructor): Likewise.
+ * config/darwin.h (ASM_DECLARE_UNRESOLVED_REFERENCE): Change
+ reference of flag_pic to MACHOPIC_INDIRECT.
+ (MACHO_DYNAMIC_NO_PIC_P): Define as TARGET_DYNAMIC_NO_PIC.
+ (MACHOPIC_INDIRECT): Is also true when dynamic-no-pic is on.
+ (MACHOPIC_JUST_INDIRECT): Is also true when dynamic-no-pic is on.
+ (MACHOPIC_PURE): Is not pure when dynamic-no-pic is on.
+ * config/i386/darwin.h (MASK_MACHO_DYNAMIC_NO_PIC): Define as
+ 0 for right now as dynamic-no-pic is not implemented on Darwin/ia32.
+ * config/rs6000/darwin.h (MASK_MACHO_DYNAMIC_NO_PIC): Define.
+ (TARGET_DYNAMIC_NO_PIC): Define.
+ (SUBTARGET_SWITCHES): Define, have sub-target switches for
+ dynamic-no-pic.
+ (SUBTARGET_OVERRIDE_OPTIONS): Move check for -fpic from
+ rs6000_override_options to here. Dynamic-no-pic overrides
+ pic.
+ (CC1_SPEC): Change from not static then pic to not static and not
+ dynamic-no-pic then pic.
+ * config/rs6000/rs6000.c (rs6000_override_options): Move the
+ check for -fpic and DARWIN_ABI to config/rs6000/darwin.h
+ (rs6000_legitimize_reload_address): Add case for loading floating in
+ dynamic-no-pic.
+ (rs6000_emit_move): Add case for dynamic-no-pic. Change reference
+ of flag_pic to MACHOPIC_INDIRECT.
+ (secondary_reload_class): Conditional change the reference of
+ flag_pic to MACHOPIC_INDIRECT.
+ (rs6000_output_mi_thunk): Change reference of flag_pic to
+ MACHOPIC_INDIRECT.
+ (output_profile_hook): Likewise.
+ (machopic_output_stub): Non-pure (dynamic-no-pic) is now supported.
+ * config/rs6000/rs6000.md (movdf_low): Add the case for
+ MACHO_DYNAMIC_NO_PIC_P.
+ (call): Change references for flag_pic in TARGET_MACHO to
+ MACHOPIC_INDIRECT.
+ (SUBTARGET_OVERRIDE_OPTIONS): Add case where -fpic is on and
+ -mdynamic-no-pic is on. Also move case for -fpic from rs6000.c.
+ * doc/invoke.texi (-mdynamic-no-pic): Document.
+
+2003-03-10 Devang Patel <dpatel@apple.com>
+
+ PR c++/9394
+ * gcc.c (DEFAULT_SWITCH_TAKES_ARG): Remove.
+ (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.
+ * gcc.h (DEFAULT_SWITCH_TAKES_ARG): Add.
+ (DEFAULT_WORD_SWITCH_TAKES_ARG): Add.
+ * cppspec.c (DEFAULT_SWITCH_TAKES_ARG): Remove.
+ (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove.
+
+2003-03-10 Steven Bosscher <s.bosscher@student.tudelft.nl>
+
+ PR optimization/7189
+ * toplev.c (rest_of_compilation): Move
+ check_function_return_warnings up to just after
+ delete_unreachable_blocks.
+
+2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.h (HARD_REGNO_RENAME_OK): Define.
+ * config/m68hc11/m68hc11-protos.h (m68hc11_hard_regno_rename_ok):
+ Declare.
+ * config/m68hc11/m68hc11.c (m68hc11_hard_regno_rename_ok): New function
+ for reg rename optimization to avoid using Z and Y registers.
+
+2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.md ("*addhi3_68hc12"): Accept any constant
+ when adding to X and Y since leax/leay are fast.
+ ("*addhi3"): Accept 'I' constraint when adding to address register.
+ ("rotlhi3"): Operand 1 must be a register_operand.
+ (peephole2): New peephole to optimize some adds.
+ * config/m68hc11/m68hc11.h (CONST_OK_FOR_LETTER_P): Use 'I' constraint
+ to represent -2 .. 2 small integer range.
+
+2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_gen_rotate): Set carry before
+ each 16-bit rotation.
+
+2003-03-10 Zack Weinberg <zack@codesourcery.com>
+
+ * c-opts.c (add_prefixed_path): Don't use concat. When
+ prefixing with cpp_GCC_INCLUDE_DIR, copy only the first
+ cpp_GCC_INCLUDE_DIR_len characters.
+
+2003-03-10 Segher Boessenkool <segher@koffie.nl>
+
+ * testsuite/gcc.dg/altivec-9.c: New file.
+
+ * config/rs6000/rs6000.c (altivec_frame_fixup): Remove.
+ (rs6000_emit_prologue): Use rs6000_frame_related instead.
+
+2003-03-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.h: Define __ev64_*64__ to use single element
+ vectors.
+ (__ev_convert_u64): Remove macro. Define as inline.
+ (__ev_convert_s64): Same.
+
+2003-03-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.h (DWARF_FRAME_REGISTERS): Define.
+ (rs6000_stack_t): Add spe_64bit_regs_used.
+
+ * config/rs6000/rs6000.c (rs6000_stack_info): Calculate
+ spe_64bit_regs_used, and use it to determine the size of the
+ frame.
+ (spe_func_has_64bit_regs_p): New.
+ (spe_synthesize_frame_save): New.
+ (rs6000_frame_related): Handle SPE synthetic registers.
+ (rs6000_emit_prologue): Only save in 64-bits if the function used
+ any registers in 64-bit mode.
+ (rs6000_emit_epilogue): Same, but for restore.
+
+2003-03-10 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (enum floating_point_type): Delete. Replace with...
+ (enum fputype): ... new.
+ (FPUTYPE_DEFAULT): Renamed from FP_DEFAULT. Values reworked.
+ * linux-elf.h (FPUTYPE_DEFAULT): Likewise.
+ * arm.md (attr fpu): Reworked for new underlying enum values.
+ * arm.c (arm_fpu_arch): Now enum fputype.
+ (arm_fpu_tune): Renamed from arm_fpu. Now enum fputype.
+ (arm_override_options, arm_output_epilogue, arm_expand_prologue):
+ Update uses of arm_fpu_arch and arm_fpu_tune.
+
+2003-03-10 Josef Zlomek <zlomekj@suse.cz>
+
+ * cfgcleanup.c (outgoing_edges_match): Compare the jump tables.
+ (try_crossjump_to_edge): Replace refereces to one jump table by
+ references to identical jump table.
+ * loop.c (load_mems): Moved setting the JUMP_LABEL to replace_label.
+ (replace_label): Moved to rtlanal.c.
+ (struct rtx_pair): Moved to rtl.h.
+ * rtl.h (struct rtx_pair): Moved from loop.c.
+ (replace_label): New extern function.
+ (subrtx_p): New extern function.
+ (tablejump_p): New extern function.
+ * rtlanal.c (replace_label): Moved from loop.c.
+ (subrtx_p_1): New static function.
+ (subrtx_p): New function.
+ (tablejump_p): New function.
+
+2003-03-10 Jan Hubicka <jh@suse.cz>
+
+ * cfgcleanup.c (try_optimize_cfg): Fix thinko in previous patch.
+
+ * cfgcleanup.c (merge_blocks): Return where to iterate next.
+ (try_optimize_cfg): Use return value of merge_blocks
+
+2003-03-10 Michael Matz <matz@suse.de>
+
+ * cfg.c (unchecked_make_edge): New.
+ (cached_make_edge): Use it.
+ * basic-block.h (unchecked_make_edge): Declare.
+ * cfglayout.c (cfg_layout_duplicate_bb): Use it.
+
+2003-03-10 Richard Earnshaw <rearnsha@arm.com>
+
+ * fpa.md: New file. Move all patterns relating to FPA co-processor
+ to here...
+ * arm.md: ... from here.
+ (cirrus.md, fpa.md): Include at end of description.
+ (divsf3, divdf3, modsf3, movdf3, sqrtsf2, sqrtdf2): New expands.
+ (pic_load_addr_based): Remove register constraint from expander.
+ (seq, sne, sgt, sle, slt, sge, sgeu, sleu, sgtu, sltu, sunordered)
+ (sordered, sungt, sunle, sunge, sunlt): Likewise.
+ (eh_epilogue, tablejump): Likewise.
+
+2003-03-09 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * tree.c (substitute_in_expr, case 'e'): Only make recursive call
+ on operands if it has a PLACEHOLDER_EXPR.
+
+2003-03-09 David Edelsohn <edelsohn@gnu.org>
+ Mostafa Hagog
+
+ * config/rs6000/rs6000.md (movsi_update1): Add TARGET_UPDATE final
+ condition.
+
+2003-03-09 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/frv/frv.h: Use TARGET_CPU_CPP_BUILTINS, not CPP_PREDEFINES.
+ * config/ip2k/ip2k.h: Similarly.
+ * config/m32r/m32r.h: Similarly.
+ * config/m68hc11/m68hc11.h: Similarly.
+ * config/mn10200/mn10200.h: Similarly.
+ * config/mn10300/mn10300.h: Similarly.
+ * config/pdp11/pdp11.h: Similarly.
+ * config/v850/v850.h: Similarly.
+ * config/rs6000/vxworks.h: Similarly for TARGET_OS_CPP_BUILTINS.
+ * config/v850/retms.h: Similarly for TARGET_OS_CPP_BUILTINS.
+ * config/mips/iris3.h: Remove #if 0 block.
+
+2003-03-09 Roger Sayle <roger@eyesopen.com>
+ Joern Rennecke <joern.rennecke@superh.com>
+
+ * gcc.c (do_spec_1) ['{']: Revert 2003-02-24 patch. Don't handle
+ pending argument upon return from handle_braces here.
+ (do_spec_2): Instead handle it upon return from do_spec_1 here.
+
+2003-03-09 Roger Sayle <roger@eyesopen.com>
+ Joern Rennecke <joern.rennecke@superh.com>
+
+ * gcc.c (do_spec_1) ['{']: Revert 2003-02-24 patch. Don't handle
+ pending argument upon return from handle_braces here.
+ (do_spec_2): Instead handle it upon return from do_spec_1 here.
+
+2003-03-09 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * varasm.c (make_decl_one_only): Use declare_weak().
+
+2003-03-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR middle-end/9986
+ * c-common.c (c_common_nodes_and_builtins): Initialize target builtins
+ after the common builtins.
+ * pa-hpux.h (DONT_HAVE_FPUTC_UNLOCKED): Define.
+ * pa.c (TARGET_INIT_BUILTINS): Define.
+ (pa_init_builtins): New function.
+
+ * pa.md (call, call_value, sibcall, sibcall_value): When sufficient
+ space has been allocated for the outgoing arguments, set the arg
+ pointer for a call emitted after virtuals have been instantiated
+ using the stack pointer offset, otherwise abort.
+
+2003-03-09 DJ Delorie <dj@redhat.com>
+
+ * config/stormy16/stormy16.h (DWARF_LINE_MIN_INSTR_LENGTH): Revert.
+
+2003-03-09 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (fix_truncsfsi2, fix_truncdfsi2, arm_fix_truncsfsi2)
+ (arm_fix_truncdfsi2): Add missing fix in floating point mode before
+ conversion to integer.
+ * cirrus.md (cirrus_truncsfsi2, cirrus_truncdfsi2): Likewise.
+
+2003-03-09 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def: Fix typo and improve grammar.
+ * loop-unroll.c (decide_peel_completely): Tidy log message.
+
+2003-03-09 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*tstsi_upper_bit): New.
+ (*iorsi3_e2f): Likewise.
+
+2003-03-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (h8300_and_costs): Return the number of
+ assembly instructions needed.
+ (h8300_shift_costs): Likewise.
+
+2003-03-09 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/cris/aout.h (ENDFILE_SPEC): Undef.
+
+ * optabs.c (gen_move_insn): Move logic for synthesizing MODE_CC
+ moves from here ...
+ * expr.c (emit_move_insn_1): ... to here.
+
+ * config/cris/aout.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__AOUT__ to...
+ (TARGET_OS_CPP_BUILTINS): New macro.
+ * config/cris/cris.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__ELF__ to...
+ (TARGET_OS_CPP_BUILTINS): New macro.
+ (CPP_PREDEFINES): Don't define. Move old definitions and...
+ (CPP_SPEC): ...move -D__CRIS_ABI_version=2 to...
+ (TARGET_CPU_CPP_BUILTINS): New macro.
+ * config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC): Move constant
+ definitions and the optional __PIC__, __pic__ and
+ __NO_UNDERSCORES__ definitions to...
+ (TARGET_OS_CPP_BUILTINS): New macro.
+
+ * flags.h (flag_leading_underscore): Declare.
+
+ * c-opts.c (c_common_post_options): On fopen failure, return
+ false, not NULL.
+
+2003-03-08 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/cris/cris_abi_symbol.c: #include tconfig.h and tm.h, not
+ config.h.
+ * config/cris/cris.h (HAVE_GAS_HIDDEN): Don't define here.
+ * config/cris/aout.h (HAVE_GAS_HIDDEN): Undef.
+
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/sh/rtemself.h (TARGET_OS_CPP_BUILTINS): Use instead of
+ CPP_PREDEFINES.
+ * config/sh/rtems.h (TARGET_OS_CPP_BUILTINS): Use instead of
+ CPP_PREDEFINES.
+
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-common.h (c_common_init, c_common_post_options): Update.
+ * c-objc-common.c (c_objc_common_init): Update for new prototype.
+ * c-opts.c (saved_lineno): New.
+ (c_common_post_options, c_common_init): Update prototypes,
+ move call to cpp_read_main_file from latter to former.
+ * c-tree.h (c_ojbc_common_init): Update.
+ * langhooks-def.h (lhd_post_options): New.
+ (LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
+ * langhooks.c (lhd_post_options): New.
+ * langhooks.h (struct lang_hooks): Update post_options and init hooks.
+ * toplev.c (no_backend): New.
+ (process_options): Call post_options hook and set main_input_filename
+ and input_filename here.
+ (lang_dependent_init, do_compile): post_options hook moved to
+ process_options.
+ * objc/objc-act.c (objc_init): Update prototype.
+ * objc/objc-act.h (objc_init): Update prototype.
+
+2003-03-08 Roger Sayle <roger@eyesopen.com>
+
+ * emit-rtl.c (gen_lowpart): Don't attempt to load a part of
+ a complex or vector type, using a load in the original mode.
+
+2003-03-08 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.
+ * gt-cgraph.h: New GC file.
+ * cgraph.c (known_fns): New static variable.
+ (cgraph_node): Add the decl into varray.
+
+2003-03-08 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/mmix/mmix.md ("*movcc_expanded"): Add missing alternatives.
+
+2003-03-08 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (fpa_rhs_operand, fpa_add_operand, const_double_rtx_ok_for_fpa)
+ (neg_const_double_ok_for_fpa, output_mov_long_double_fpa_from_arm)
+ (output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm)
+ (output_mov_double_arm_from_fpa): Renamed to use fpa instead of fpu.
+ All callers changed.
+ * arm.md, arm.h, arm-protos.h: Updated.
+
+ * arm.h (enum reg_class FPA_REGS): Renamed from FPU_REGS.
+ (CLASS_MAX_NREGS, REGISTER_MOVE_COST, REG_CLASS_FROM_LETTER): Updated.
+ * arm.c (arm_regno_class, f_register_operand): Updated.
+
+2003-03-08 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/cris/cris.h: Remove EGCS references.
+ (CPP_SPEC): Remove "-$".
+ (INIT_CUMULATIVE_ARGS): Adjust parameter name to FNDECL.
+
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/stormy16/stormy16.h (TARGET_CPU_CPP_BUILTINS): Use in
+ preference to CPP_PREDEFINES.
+
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppinit.c (cpp_finish_options): Set first_unused_line to -1.
+
+2003-03-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*extzv_16_8): New.
+
+2003-03-08 Jan Hubicka <jh@suse.cz>
+
+ * c-decl.c: (finish_function): Update call of tree_inlinable_function_p.
+ * cgraph.h: (cgraph_local_info): Add can_inline_once
+ (cgraph_global_info): Add inline_once.
+ (cgraph_node): Add previous.
+ (cgraph_remove_node): New.
+ * cgraphunit.c (cgraph_mark_functions_to_inline_once): New static
+ function.
+ (cgraph_optimize): Call it.
+ (cgraph_finalize_function): Set inlinable flags.
+ (cgraph_finalize_compilation_unit): Actually remove the reclaimed nodes.
+ (cgraph_mark_functions_to_output): Use new inlining heuristics flags.
+ (cgraph_expand_function): Likewise.
+ * cgraph.c
+ (cgraph_node): Put nodes into doubly linked chain.
+ (cgraph_remove_node): New function.
+ * flags.h (flag_inline_functions_called_once): Declare.
+ * tree-inline.c: Include cgraph.h
+ (inlinable_functions_p): Add extra argument to bypass limits.
+ (expand_call_inline): Obey cgraph flag.
+ * tree-inline.h (tree_inlinable_function_p): Update prototype.
+
+2003-03-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcse.c (bypass_block, bypass_conditional_jumps): Do not create
+ irreducible loops.
+
+ * loop-unroll.c (unroll_loop_runtime_iterations): Update irreducible
+ loops info correctly.
+
+2003-03-08 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR middle-end/7796
+ * unroll.c (calculate_giv_inc): Handle constants being
+ loaded with LSHIFTRT.
+
+2003-03-07 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (processor_target_table): Do not disable
+ GP optional instructions on Power3, Power4, 620, and 630.
+
+2003-03-07 Kazu Hirata <kazu@cs.umass.edu>
+
+ * calls.c: Fix comment formatting.
+ * cfgloopanal.c: Likewise.
+ * cfgloopmanip.c: Likewise.
+ * combine.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * ggc-common.c: Likewise.
+ * langhooks.c: Likewise.
+ * loop-unroll.c: Likewise.
+ * loop.c: Likewise.
+ * ra-build.c: Likewise.
+ * sbitmap.c: Likewise.
+ * toplev.c: Likewise.
+
+2003-03-07 James E Wilson <wilson@tuliptree.org>
+
+ * config/sh/sh.h (HARD_REGNO_NREGS): Round up the XD register count.
+
+2003-03-07 Geoffrey Keating <geoffk@apple.com>
+
+ * objc/lang-specs.h (objective-c-header): Use .gch not .pch;
+ support -no-integrated-cpp.
+
+ * c-pch.c (get_ident): Use c_language_kind and flag_objc rather
+ than langhooks.name.
+
+2003-03-07 Michael Matz <matz@suse.de>
+
+ * df.h (enum df_ref_flags.DF_REF_STRIPPED): New.
+ (DF_FOR_REGALLOC): New.
+ * df.c (df_ref_record): Set DF_REF_STRIPPED.
+ (read_modify_subreg_p): Simplify.
+ (df_def_record_1, df_uses_record): Set DF_REF_MODE_CHANGE more often.
+ Use DF_FOR_REGALLOC.
+ * ra.h (struct web): New member subreg_stripped.
+ (invalid_mode_change_regs): Declare.
+ * ra.c (invalid_mode_change_regs): New.
+ (init_ra): Initialize it.
+ * ra-build.c (init_one_web_common, remember_web_was_spilled): Use it.
+ Use CANNOT_CHANGE_MODE_CLASS as ifdef guard.
+ (reinit_one_web, parts_to_web_1): Deal with subreg_stripped.
+ * ra-colorize.c (colorize_one_web): Use invalid_mode_change_regs.
+ Use CANNOT_CHANGE_MODE_CLASS as ifdef guard.
+
+2003-03-07 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (addsf3, adddf3, subsf3, subdf3, mulsf3, muldf3, negsf2)
+ (negdf2, abssi2, abssf2, absdf2, floatsisf2, floatsidf2)
+ (fix_truncsfsi2, fix_truncdfsi2, truncdfsf2): Moved back into main
+ machine description file from ...
+ * cirrus.md: ... here.
+
+2003-03-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Don't use
+ reg_overlap_mentioned_p.
+
+2003-03-06 Geoffrey Keating <geoffk@apple.com>
+
+ * c-pch.c: Include langhooks.h.
+ (IDENT_LENGTH): New.
+ (get_ident): New.
+ (pch_ident): Delete.
+ (pch_init): Use get_ident, IDENT_LENGTH.
+ (c_common_valid_pch): Likewise. Also, use actual language
+ in warning message.
+ * Makefile.in (c-pch.o): Add langhooks.h to dependencies.
+
+ * objc/config-lang.in (gtfiles): Add objc-act.c. Remove duplicate
+ c-parse.in.
+ * objc/Make-lang.in (objc/objc-act.o): Add dependency on
+ gt-objc-objc-act.h.
+ (gt-objc-objc-act.h): New rule.
+ * objc/lang-specs.h: Support PCH.
+ * objc/objc-act.c: Include gt-objc-objc-act.h.
+ (objc_add_static_instance): Move num_static_inst out, mark for PCH.
+ (build_selector_reference_decl): Move idx out, mark for PCH.
+ (build_class_reference_decl): Likewise.
+ (build_objc_string_decl): Move *_idx out, mark for PCH.
+ (build_tmp_function_decl): Move xxx out, mark for PCH.
+
+2003-03-06 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_binds_local_p): Consider
+ global functions for inlining on Darwin.
+
+2003-03-06 Vladimir Makarov <vmakarov@redhat.com>
+
+ * haifa-sched.c (schedule_block): Don't call reorder when sorting
+ is prohibited.
+
+2003-03-06 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (c-ppoutput.o): Update.
+ * c-common.h (init_pp_output): New.
+ (preprocess_file): Update.
+ * c-lex.c (init_c_lex): Move mbchar initialization to cpplib.
+ Register builtins.
+ * c-opts.c (c_common_init): Call init_pp_output if preprocessing.
+ Make call to cpp_read_main_file common to whether preprocessing
+ or not. Don't register builtins.
+ * c-ppoutput.c: Include c-pragma.h.
+ (setup_callbacks): Rename init_pp_output.
+ (preprocess_file): No longer setup callbacks or call
+ cpp_read_main_file.
+ * cpphash.h (_cpp_init_mbchar): New.
+ * cppinit.c (init_library): Call _cpp_init_mbchar.
+ * cpplex.c (_cpp_init_mbchar): New.
+
+2003-03-06 Roger Sayle <roger@eyesopen.com>
+
+ * emit-rtl.c (gen_lowpart): When requesting the low-part of a
+ MEM, try loading the MEM into a register and taking the low-part
+ of that, to help CSE see the use of the MEM in its true mode.
+
+2003-03-05 Tom Tromey <tromey@redhat.com>
+
+ * config/stormy16/stormy16.h (DWARF_LINE_MIN_INSTR_LENGTH):
+ Define.
+
+2003-03-05 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * config/stormy16/stormy16.md ("*eqbranchsi"): Remove '+' on
+ operand 2.
+ ("*ineqbranchsi"): Likewise.
+
+2003-03-05 Andrew Haley <aph@cambridge.redhat.com>
+
+ * config/stormy16/stormy16.c (xstormy16_expand_prologue): Delete
+ mem_fake_push_rtx. Instead construct a SEQUENCE to show the
+ register store followed by a stack increment.
+
+2003-03-05 Chris Moller <cmoller@redhat.com>
+
+ * config/stormy16/stormy16.c (REG_NEEDS_SAVE): added a term
+ to inhibit saving CARRY_REGS.
+
+ * config/stormy16/stormy16.c (xs_hi_general_operand):
+ added predicate to detect and error-out on out-of-range
+ const_ints for movhi.
+ * config/stormy16/stormy16.md (movhi): use
+ xs_hi_general_operand.
+
+ * config/stormy16/stormy16.c (xstormy16_expand_prologue):
+ added a check for local vbl size overflow.
+ * config/stormy16/stormy16.c (xs_hi_nonmemory_operand):
+ added predicate to detect and error-out on out-of-range
+ const_ints for addhi and subhi.
+ * config/stormy16/stormy16.md (addhi3, addchi4, addchi5,
+ subhi3, subchi4, subchi5): used xs_hi_nonmemory_operand.
+
+ * config/stormy16/stormy16.c (xstormy16_legitimate_address_p):
+ add a term to accept PRE_MODIFY addresses.
+ * config/stormy16/stormy16.c (xstormy16_expand_move):
+ add code to expand PRE_MODIFY addresses to an add followed
+ by a move.
+
+2003-03-06 Jason Merrill <jason@redhat.com>
+
+ * tree-inline.c (inlinable_function_p): Revert earlier change
+ pending investigation.
+
+2003-03-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a new peephole2): New.
+
+2003-03-06 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_node): Do not confuse nested functions and methods.
+
+2003-03-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * dwarf2out.c (size_of_die): Compute size of external reference to
+ die correctly.
+
+2003-03-06 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/mmix/mmix.md ("*movcc_expanded"): New pattern.
+ ("movcc", "movcc_uns", "movcc_fp", "movcc_fpeq", "movcc_fun"): New
+ expanders.
+
+2003-03-05 Roger Sayle <roger@eyesopen.com>
+
+ * expr.h (lang_expand_expr): Delete obsolete prototype.
+
+2003-03-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * emit-rtl.c (gen_highpart_mode): Fix a comment typo.
+
+2003-03-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Generalize to
+ accept a memory operand.
+
+2003-03-05 Olivier Hainque <hainque@act-europe.fr>
+
+ * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '+'.
+ * config/alpha/alpha.c (print_operand, case '+'): New.
+ * config/alpha/alpha.md (call_osf_1_noreturn): Document and use.
+ (call_value_osf_1_noreturn): Likewise.
+
+2003-03-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * stmt.c (fixup_gotos): Change meaning of DONT_JUMP_IN.
+ (expand_end_bindings): Likewise.
+
+2003-03-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.md (return_external_pic): Add !TARGET_PA_20 to constraint.
+ (epilogue): Don't generate return_external_pic when emitting PA 2.0
+ code.
+
+2003-03-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/tm.texi: Document TARGET_DWARF_REGISTER_SPAN.
+
+ * config/rs6000/rs6000.c (rs6000_dwarf_register_span): New.
+
+ * hooks.c (hook_rtx_rtx_null): New.
+
+ * hooks.h (hook_rtx_rtx_null): Protoize.
+
+ * target-def.h (TARGET_DWARF_REGISTER_SPAN): New macro.
+ (TARGET_INITIALIZER): Add TARGET_DWARF_REGISTER_SPAN.
+
+ * target.h (struct gcc_target): Add dwarf_register_span.
+
+ * dwarf2out.c (multiple_reg_loc_descriptor): New.
+ (one_reg_loc_descriptor): New.
+ (reg_loc_descriptor): Add support for values that span more than
+ one register.
+
+2003-03-05 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (calls.o, toplev.o alias.o): Depend on cgraph.h
+ * alias.c: Include cgraph.h
+ (mark_constant_function): Use cgraph_rtl_info.
+ * calls.c: Include cgraph.h
+ (flags_from_decl_or_type): Use cgraph_rtl_info to find pure and const
+ calls.
+ (expand_call): Use cgraph_rtl_info to set preferred stack boundary.
+ * cgraph.c (cgraph_rtl_info): New function.
+ * cgraph.h (cgraph_rtl_info): Declare
+ (cgraph_rtl_info): Likewise.
+ * function.h (struct function): Add recursive_call_emit.
+ * toplev.c: Include cgraph.h.
+ (rest_of_compilation): Set preferred_incoming_stack_boundary.
+
+2003-03-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_simode_bld): Clear the
+ destination first if possible.
+ * config/h8300/h8300.md (extzv_1_r_h8300hs): Add an
+ alternative.
+ (extzv_1_r_inv_h8300hs): Likewise.
+
+2003-03-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * basic-block.h (EDGE_IRREDUCIBLE_LOOP, EDGE_ALL_FLAGS): New.
+ * cfg.c (dump_edge_info): Add EDGE_IRREDUCIBLE_LOOP flag dump.
+ * cfgloop.c (flow_loop_free): Made global.
+ (establish_preds): New static function.
+ (flow_loop_tree_node_add): Handle subloops of added loop correctly.
+ (get_loop_exit_edges): New.
+ (verify_loop_structure): Verify EDGE_IRREDUCIBLE_LOOP flags.
+ * cfgloop.h (flow_loop_free, get_loop_exit_edges, unloop): Declare.
+ * cfgloopanal.c (mark_irreducible_loops): Mark edges in irreducible
+ loops.
+ * cfgloopmanip.c (loop_delete_branch_edge): Allow to test for
+ removability of an edge.
+ (fix_irreducible_loops): New static function.
+ (find_path, remove_path): Add ability to remove enclosing loops.
+ (unloop): New.
+ (copy_bbs, duplicate_loop_to_header_edge): Use EDGE_IRREDUCIBLE_LOOP
+ flags.
+ * cfgrtl.c (verify_flow_info): Handle EDGE_IRREDUCIBLE_LOOP flag.
+ * loop-unroll.c (peel_loops_completely): Do not duplicate loop if
+ not neccessary.
+ (decide_peel_completely, peel_loops_completely): Allow complete peeling
+ of non-duplicable once rolling loops.
+ * loop-unswitch.c (unswitch_loop): Update EDGE_IRREDUCIBLE_LOOP flags.
+
+2003-03-05 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, the minimum value
+ for align_jumps is 4.
+
+ (SECONDARY_INPUT_RELOAD_CLASS): If reloading a PLUS into FPUL,
+ use GENERAL_REGS.
+
+2003-03-05 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.h (PAD_VARARGS_DOWN): Define and return
+ according to va_arg type.
+ (EXPAND_BUILTIN_VA_ARG): Remove.
+ * config/m68hc11/m68hc11.c (m68hc11_va_arg): Remove.
+ * config/m68hc11/m68hc11-protos.h (m68hc11_va_arg): Remove.
+
+2003-03-05 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_variable_issue): Remove unnecessary
+ else clauses.
+
+2003-03-05 Michael Matz <matz@suse.de>
+
+ * i386/i386.c (ix86_save_reg): Also test
+ current_function_uses_const_pool.
+
+2003-03-05 Michael Matz <matz@suse.de>
+
+ * unwind.h: Add the GPL exception.
+ * Makefile.in (USER_H): Add unwind.h.
+
+2003-03-05 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/9799
+ * c-typeck.c (push_init_level): Add sanity check.
+
+2003-03-05 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (rest_of_compilation): Defer RTL compilation only when
+ RTL inlining is done.
+
+ * cgraphunit.c (cgraph_mark_local_functions): New local function.
+ (cgraph_optimize): Mark local functions.
+ * i386-protos.h (init_cumulative_args): Update prototype.
+ * i386.c (init_cumulative_args): Use register passing convention for
+ local functions.
+
+ * cgraph.c (cgraph_global_info_ready): New global variable
+ (cgraph_local_info, cgraph_global_info): New functions.
+ * cgraph.h (struct cgraph_local_info, cgraph_global_info): New
+ structures.
+ (cgraph_local_info, cgraph_global_info, cgraph_global_info_ready):
+ Declare.
+ * cgraphunit.c (cgraph_finalize_function): Set inline_many.
+ (cgraph_mark_functions_to_output): Use inline_many.
+ (cgraph_expand_function): Free DECL_SAVED_TREE uncondtionally.
+ (cgraph_expand_functions): Expand inline functions last.
+ (cgraph_optimize): Do not emit uneeded functions.
+
+2003-03-04 Steve Ellcey <sje@cup.hp.com>
+
+ * expr.c (convert_modes): Check for legal hard register.
+
+2003-03-04 Tom Tromey <tromey@redhat.com>
+
+ * doc/sourcebuild.texi (Front End Directory): Document tags.
+ * configure: Rebuilt.
+ * configure.in (target_list): Added tags.
+ * Makefile.in (TAGS): Depend on lang.clean. Include subdirectory
+ TAGS files by reference.
+ * objc/Make-lang.in (objc.tags): New target.
+
+2003-03-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcov-io.h (gcov_save_position, gcov_reserve_length, gcov_resync,
+ gcov_skip, gcov_skip_string, gcov_write_unsigned, gcov_write_counter,
+ gcov_write_string, gcov_read_unsigned, gcov_read_counter,
+ gcov_read_string, gcov_write_length): Modified to enable reading/
+ writing of whole .da file just once.
+ (da_file_open, da_file_close, da_file_eof, da_file_error,
+ da_file_position, da_file_seek, da_file_write, da_file_read): New
+ functions.
+ (actual_da_file, actual_da_file_position, actual_da_file_length,
+ actual_da_file_buffer, actual_da_file_buffer_size): New static
+ functions.
+ * libgcov.c (gcov_exit): Modified to read/write the whole .da file at
+ just once.
+
+
+2003-03-04 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/m68k.c (m68k_output_function_prologue): Fix CFA
+ offset without frame pointer.
+
+2003-03-04 Steve Ellcey <sje@cup.hp.com>
+
+ * expr.c (expand_expr): Call promote_mode to set unsignedp.
+
+2003-03-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Don't always define TARGET_SYSTEM_ROOT.
+ * configure: Regenerated.
+ * gcc.c: Check whether TARGET_SYSTEM_ROOT is defined.
+
+2003-03-04 Andreas Jaeger <aj@suse.de>
+
+ * configure.in: Check for <memcheck.h>.
+ * configure: Regenerated.
+
+ * config.in: Define HAVE_MEMCHECK_H.
+
+ * ggc-common.c: Use <memcheck.h> if available instead of
+ <valgrind.h>.
+ * ggc-page.c: Likewise.
+ * cppfiles.c: Likewise.
+
+2003-03-04 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*extzv_8_8): Fix cc and lengths.
+
+2003-03-04 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/9262
+ * c-typeck.c (do_case): Attach the first case label to the SWITCH_BODY.
+ (c_finish_case): Rechain the next statements to the SWITCH_STMT.
+
+2003-03-04 Jan Hubicka <jh@suse.cz>
+
+ * doc/invoke.texi: Document that unit-at-a-time is enabled for -O3
+ * toplev.c (parse_options_and_default_flags): Enable flag_unit_at_a_time
+ for -O3.
+
+2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Delete three unused variables. Move a variable
+ definition closer to its use. Simplify use_collect2 logic. Start to
+ organize. Simplify tests for in-tree gas and ld.
+ * configure: Regenerate.
+
+2003-03-04 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * c-common.c (flag_no_line_commands, flag_no_output,
+ flag_dump_macros, flag_dump_includes): New.
+ * c-common.h (flag_no_line_commands, flag_no_output,
+ flag_dump_macros, flag_dump_includes, preprocess_file): New.
+ (init_c_lex): Update prototype.
+ * c-lex.c (init_c_lex): Update prototype; move some code to
+ c_common_init.
+ * c-opts.c (preprocess_file): Subsume into c_common_init.
+ (c_common_decode_option): Update flags.
+ (c_common_init): Move code from preprocess_file and init_c_lex.
+ (sanitize_cpp_opts): Update.
+ * c-ppoutput.c: New, cppmain.c almost verbatim.
+ * cpphash.h (struct printer): Remove.
+ (struct cpp_reader): Remove print.
+ * cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
+ cpp_preprocess_file): Remove.
+ (struct cpp_options): Remove no_output, no_line_commands, dump_macros
+ and dump_includes.
+ * cppmain.c: Remove.
+ * doc/passes.texi: Update.
+
+2003-03-04 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * function.c (STACK_ALIGNMENT_NEEDED): New macro. Default to 1.
+ (assign_stack_local_1): Perform overall stack alignment only when
+ STACK_ALIGNMENT_NEEDED is nonzero.
+ * doc/tm.texi (STACK_ALIGNMENT_NEEDED): Document.
+
+ * pa.c (compute_frame_size): Rename fsize to size. Account for
+ alignment to a word boundary before general register save block. Only
+ account for double-word alignment before floating point register save
+ block if one or more are saved. Don't allocate space for %r3 when
+ frame pointer is needed.
+ (hppa_expand_prologue): Include alignment to word boundary in local
+ frame size.
+ * pa.h (STARTING_FRAME_OFFSET): Define to 8 on both 32 and 64-bit ports.
+ (STACK_ALIGNMENT_NEEDED): Define.
+
+2003-03-04 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2out.c (rtl_for_decl_location): Don't return NULL_RTX for
+ global register variables.
+
+2003-03-04 Alexandre Oliva <aoliva@redhat.com>
+
+ * reload.c (reload_adjust_reg_for_mode): New function.
+ (subst_reloads): Call it.
+ (operands_match_p): Adjust registers using HARD_REGNO_NREGS.
+ * reload.h (reload_adjust_reg_for_mode): Declare.
+ * reload1.c (emit_input_reload_insns, emit_output_reload_insns):
+ Call it.
+
+2003-03-03 James E Wilson <wilson@tuliptree.org>
+
+ * optabs.c (add_equal_note): Delete SUBREG_REG use.
+ Fixes PR c/7872.
+
+2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*ixorsi3_ashift_16): New.
+ (*ixorsi3_lshiftrt_16): New.
+ (*iorsi3_ashift_16): Remove.
+
+2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*extzv_8_8): Use '?' to simplify the
+ pattern.
+
+2003-03-03 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/install.texi (Specific): Update entry for powerpc-darwin.
+
+2003-03-03 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.h (HAVE_AS_LTOFFX_LDXMOV_RELOCS): Default to 0.
+
+2003-03-03 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_multipass_dfa_lookahead): Delete.
+ (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Delete.
+ (rs6000_variable_issue): Do not return negative value.
+ (rs6000_issue_rate): Uniformly set issue rate to 1 for first
+ scheduling pass.
+
+2003-03-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * dwarf2out.c (dwarf2out_finish): Swap order of break_out_includes and
+ prune_unused_types calls.
+
+2003-03-03 Jason Merrill <jason@redhat.com>
+
+ * tree-inline.c (find_builtin_longjmp_call): Save and restore
+ lineno and input_filename.
+ (find_alloca_call): Likewise.
+ (inlinable_function_p): Run the langhook earlier.
+
+ * calls.c (compute_argument_addresses): Give the new MEMs a
+ minimum alignment of PARM_BOUNDARY.
+
+2003-03-03 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * config/sh/sh.h (EXTRA_SPECS): Add subtarget_asm_relax_spec and
+ subtarget_asm_isa_spec.
+ (SUBTARGET_ASM_RELAX_SPEC, SUBTARGET_ASM_ISA_SPEC): Define.
+ (ASM_SPEC): Define as SH_ASM_SPEC.
+ (SH_ASM_SPEC): New; take the role of ASM_SPEC, but safe from svr4.h.
+ Use subtarget_asm_relax_spec and subtarget_asm_isa_spec.
+ * config/sh/elf.h (ASM_SPEC): Use SH_ASM_SPEC.
+ (SUBTARGET_ASM_ISA_SPEC): Undef / define.
+
+ * sh.h (OVERRIDE_OPTIONS): Set default values for align_loops
+ and align_jumps if not set.
+ Force align_jumps to be at least 2.
+ When relaxing, force align_functions to be at least the maximum of
+ align_loops, align_jumps and 4.
+ * sh.c (find_barrier, barrier_align): Honour align_jumps_log.
+ (sh_loop_align): Honour align_loops_log.
+
+ * sh.md (length attribute): Use prev_nonnote_insn instead of PREV_INSN
+ to check for indirect_jump_scratch.
+ (indirect_jump_scratch): Add second set.
+ * sh.c (output_far_jump): Use prev_nonnote_insn instead of PREV_INSN
+ when looking for indirect_jump_scratch.
+ Extract scratch register taking new structure of indirect_jump_scratch
+ into account.
+ (gen_block_redirect): Set INSN_SCOPE for indirect_jump_scratch.
+
+2003-03-03 Jan Hubicka <jh@suse.cz>
+
+ * calls.c (rtx_for_function_call): Take the address as an argument
+ (expand_call): Do not modify the expression.
+
+ * toplev.c (rest_of_compilation): Avoid cfg_cleanup calls when not
+ optimizing.
+
+2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*ixorsi3_zext_hi): Restrict to
+ TARGET_H8300H and TARGET_H8300S.
+
+2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*extzv_8_8): Use shorter code when
+ operands[0] and operands[1] are different.
+
+2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * reload1.c (reload_cse_move2add): Remove variable success.
+
+2003-03-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ggc-common.c (ggc_rlimit_bound): Cast RLIM_INFINITY to avoid
+ warnings.
+
+2003-03-02 Richard Henderson <rth@redhat.com>
+
+ * configure.in (HAVE_AS_LTOFFX_LDXMOV_RELOCS): New ia64 test.
+ * config.in, configure: Rebuild.
+ * config/ia64/ia64.c (ia64_ld_address_bypass_p): Accept lo_sum.
+ * config/ia64/ia64.md (load_symptr): Use high/lo_sum for the
+ paired ldtoffx and ldxmov annotations.
+ (load_symptr_internal1): Remove.
+ (load_symptr_high, load_symptr_low): New.
+
+2003-03-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-incpath.c (add_path): Fix sysp assignment.
+
+2003-03-02 Kurt Garloff <garloff@suse.de>
+
+ * params.def: Introduce parameter max-inline-insns-rtl for
+ a separate limit for the RTL inliner.
+ * params.h: Likewise.
+ * integrate.c (function_cannot_inline_p): Use it.
+ * toplev.c (decode_f_option): Set multiple parameters
+ controlling inlining with -finline-limit.
+ * params.def: Fix orthographic and typographic errors.
+ * doc/invoke.texi: Document parameters controlling inlining
+ and the way -finline-limit sets multiple of them.
+
+ * tree.h (struct tree_decl): Introduce inlined_function_flag,
+ recording whether the function became eligible for inlining
+ by a compiler flag rather than the declaration.
+ Provide DID_INLINE_FUNC macro to access it.
+ * c-decl.c (grokdeclarator): Set DID_INLINE_FUNC.
+ * cp/decl.c (grokfndecl): Likewise.
+ * toplev.c (rest_of_compilation): Likewise.
+ * cp/optimize (maybe_clone_body): Copy DID_INLINE_FUNC.
+ * print-tree.c (print_node): Report it.
+ * params.def: Introduce new max-inline-insns-auto limit.
+ * params.h: Likewise.
+ * tree-inline.c (inlinable_function_p): Apply it to functions
+ with DID_INLINE_FUNC set.
+ * toplev.c (decode_f_option): Initialize it from -finline-limit
+ value.
+ * doc/invoke.texi: Document new parameter.
+
+2003-03-02 Geoffrey Keating <geoffk@apple.com>
+
+ * fix-header.c (read_scan_file): Don't reference simplify_path.
+
+2003-03-02 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_override_options): Don't enable
+ min/max instructions by default as may result in reload errors.
+
+2003-03-02 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.md ("mulqi3"): Allow address register to
+ avoid reload problems; define split for it.
+
+2003-03-02 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_shift_operator): New function.
+ * config/m68hc11/m68hc11-protos.h (m68hc11_shift_operator): Declare.
+ * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register.
+ * config/m68hc11/m68hc11.md ("rotrhi3", "rotlhi3"): New patterns for
+ rotatert and rotate.
+ ("rotrhi3_const", "rotlhi3_const"): Rename of old 'rotrhi3' insns.
+ ("*rotrhi3", "*rotlhi3"): New insn pattern for non-const rotatert.
+ ("*rotrhi3_addr"): New split for shift insns on address register.
+ ("*lshrhi3", "*ashrhi3", "*ashlhi3_2"): Use new split.
+ * config/m68hc11/larith.asm (___rotlhi3): New asm function.
+ (___rotrhi3): Likewise.
+ * config/m68hc11/t-m68hc11-gas (LIB1ASMFUNCS): Build them.
+
+2003-03-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * toplev.c (aux_base_name): Moved from toplev.h.
+ (filename): Constify.
+ (lang_dependent_init): Don't duplicate name.
+ (process_options): Set aux_base_name here, not...
+ (do_compile): ...here. Change protoype.
+ (toplev_main): Move some code from do_compile.
+ * toplev.h: Remove aux_base_name.
+
+2003-03-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ iorxor_operator.
+ * config/h8300/h8300.c (print_operand): Handle 'c'.
+ (iorxor_operator): New.
+ * config/h8300/h8300.h (PREDICATE_CODES): Add iorxor_operator.
+ * config/h8300/h8300.md (*iorhi3_zext): Remove.
+ (*iorsi3_zexthi): Likewise.
+ (*iorsi3_zextsi): Likewise.
+ (*xorhi3_zextqi): Likewise.
+ (*xorsi3_zexthi): Likewise.
+ (*xorsi3_zextsi): Likewise.
+ (*ixorhi3_zext): New.
+ (*ixorsi3_zext_qi): Likewise.
+ (*ixorsi3_zext_hi): Likewise.
+
+2003-03-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-incpath.c (remove_component_p, simplify_path): Move back to
+ cppfiles.c.
+ (remove_duplicates): Use cpp_simplify_path.
+ * c-incpath.h (simplify_path): Remove.
+ * c-lex.c: Don't include c-incpath.h.
+ (init_c_lex): Remove simplify_path.
+ * cppfiles.c (remove_component_p, cpp_simplify_path): Restore.
+ (find_or_create_entry, validate_pch): Revert.
+
+2003-03-02 Ashif Harji <asharji@uwaterloo.ca>
+
+ * gcc.c (default_compilers): Add -no-integrated-cpp flag to invoke
+ an external cpp during compilation.
+ (option_map): Likewise.
+ * objc/lang-specs.h (default_compilers): Similarly.
+ * doc/invoke.texi: Document -no-integrated-cpp flag.
+
+2003-03-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (zero_extendqisi2): Change to an
+ expander.
+ (*zero_extendqisi2_h8300): New.
+ (*zero_extendqisi2_h8300hs): New.
+ (two splitters): New.
+
+2003-03-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * fp-bit.h (float_to_usi): Fix condition wrapping prototype.
+
+2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Remove dead code.
+
+2003-03-01 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/9367
+ * builtin-types.def (DEF_FUNCTION_TYPE_VAR_3): New macro.
+ (BT_FN_INT_CONST_STRING_VALIST_ARG,
+ BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
+ BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
+ BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
+ BT_FN_INT_STRING_CONST_STRING_VAR,
+ BT_FN_INT_CONST_STRING_CONST_STRING_VAR,
+ BT_FN_INT_STRING_SIZE_CONST_STRING_VAR): New built-in types.
+ * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2,
+ ATTR_NONNULL_3): Also include the nothrow attribute.
+ (sprintf, scanf, sscanf, vprintf, vsprintf, snprintf,
+ vsnprintf, vscanf, vsscanf): Don't define attributes here.
+ * builtins.def (putchar, puts): Make full C89 built-ins.
+ (snprintf, sprintf, scanf, sscanf, vprintf, vscanf,
+ vsscanf, vsnprintf, vsprintf): New built-ins.
+ * c-common.c (c_common_nodes_and_builtins): Handle new macro
+ DEF_FUNCTION_TYPE_VAR_3.
+
+ * doc/extend.texi: Document these new built-in functions.
+
+2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-03-01 Richard Earnshaw <rearnsha@arm.com>
+
+ * predict.c (estimate_bb_frequencies): Correctly set
+ real_values_initialized after initialization.
+
+2003-03-01 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
+ cppinit.o, cppdefault.o, fix-header): Update.
+ * c-incpath.c: New file.
+ * c-incpath.h: New file.
+ * c-lex.c: Include c-incpath.h.
+ (init_c_lex): Register path simplifier.
+ * c-opts.c: Include cppdefault.h and c-incpath.h.
+ (TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
+ std_cxx_inc, quote_chain_split, add_prefixed_path): New.
+ (COMMAND_LINE_OPTIONS): Add more options from cpplib.
+ (missing_arg, c_common_decode_option): Handle them.
+ (c_common_post_options): Register include chains.
+ (print_help): Update.
+ * cppdefault.h (struct default include): Update.
+ Move some macros to ...
+ * cppdefault.c: ... here.
+ (cpp_include_defaults): Add extra field add_sysroot.
+ * cppfiles.c (include_file, search_from, find_or_create_entry,
+ cpp_included, find_include_file, remap_filename): Update for
+ renaming of search_path to cpp_path, and of the chain headers.
+ (remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
+ * cpphash.h (struct search_path): Move to cpplib.h.
+ (struct cpp_buffer, struct cpp_reader): Update.
+ (_cpp_simplify_pathname): Remove.
+ * cppinit.c: Don't include prefix.h and cppdefault.h.
+ (INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
+ remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
+ init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
+ no_pth, cpp_handle_options): Remove.
+ (struct pending_option): Remove chain members.
+ (cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
+ cpp_handle_option): Update.
+ * cpplib.h (struct cpp_path, cpp_set_include_chains): New.
+ (struct cpp_options): Remove quote_include, bracket_include,
+ include_prefix, include_prefix_len, verbose, ignore_srcdir,
+ no_standard_includes, no_standard_cplusplus_includes.
+ (struct cpp_callbacks): Add simplify_path.
+ (cpp_handle_options): Remove.
+ * fix-header.c: Include c-incpath.h.
+ (read_scan_file): Update to use c-incpath functionality.
+ * doc/passes.texi: Update.
+
+2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (bit_operand): Accept MEM only if it
+ satisfies EXTRA_CONSTRAINT 'U'.
+
+2003-03-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*tst_extzv_bitqi_1_n): Take a scratch
+ register.
+ (*tst_extzv_memqi_1_n): Change to a splitter.
+ (a peephole2): Update.
+
+2003-03-01 Richard Earnshaw <rearnsha@arm.com>
+
+ * predict.c (estimate_bb_frequencies): Initialize the sreal
+ constants once per compilation.
+
+2003-02-28 Richard Henderson <rth@redhat.com>
+
+ * toplev.c (flag_eliminate_unused_debug_types): Enable by default.
+
+2003-02-28 scott snyder <snyder@fnal.gov>
+
+ * flags.h: Add flag_eliminate_unused_debug_types.
+ * toplev.c: Add flag_eliminate_unused_debug_types.
+ (f_options): Add -feliminate-unused-debug-types.
+ * dwarf2out.c (struct file_table): Add emitted member.
+ (splice_child_die): Fix the parent pointer for the child being
+ spliced.
+ (lookup_filename): Maintain file_table.emitted array. Don't
+ output .file directive here.
+ (maybe_emit_file): (new)
+ (init_file_table): Set up file_table.emitted.
+ (dwarf2out_source_line): Use maybe_emit_file.
+ (dwarf2out_start_source_file): Use maybe_emit_file.
+ (dwarf2out_init): Use maybe_emit_file.
+ (prune_unused_types_walk_attribs): (new)
+ (prune_unused_types_mark): (new)
+ (prune_unused_types_walk): (new)
+ (prune_unused_types_prune): (new)
+ (prune_unused_types): (new)
+ (dwarf2out_finish): Call prune_unused_types if
+ flag_eliminate_unused_debug_types is set.
+ * doc/invoke.texi (Option Summary): Add
+ -feliminate-unused-debug-types.
+ (Debugging Options): Likewise.
+
+2003-02-28 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/invoke.texi: Change .pch to .gch.
+ * cppfiles.c (open_file_pch): Likewise.
+ * gcc.c (default_compilers): Likewise.
+
+2003-02-28 Aldy Hernandez <aldyh@redhat.com>
+
+ * floatlib.c: Remove.
+
+2003-02-28 Jason Merrill <jason@redhat.com>
+
+ * stor-layout.c (variable_size): Leave a "minus 1" outside the
+ SAVE_EXPR.
+
+2003-02-28 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/power4.md: Add compare bypass.
+
+2003-02-28 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/netbsd.h: Update copyright years.
+ (NETBSD_CPP_SPEC): Define _REENTRANT and _PTHREADS if
+ -pthread is specified on the command line.
+
+2003-02-28 Dale Johannesen <dalej@apple.com>
+
+ * loop.c (struct movable): Add insert_temp, shrink savemode.
+ (scan_loop): Accept invariants that require copying; mark as
+ insert_temp.
+ (combine_movables): Don't combine insert_temp movables.
+ (move_movables): Insert copies for insert_temp movables.
+ Don't record the info based on regno for insert_temp's.
+
+2003-02-28 Joel Sherrill <joel@OARcorp.com>
+
+ PR 9638/other
+ * config/i386/i386.c (DEFAULT_PCC_STRUCT_RETURN): Ensure the
+ this constant defaults to 1.
+
+2003-02-28 Bob Wilson <bob.wilson@acm.org>
+
+ * config.gcc (xtensa-*-linux*): Add t-slibgcc-elf-ver to tmake_file.
+
+2003-02-28 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (mulhisi3, mulhisi3addsi, mulhidi3adddi): Enable for any
+ ARMv5e processor, not just for XScale. Instructions are predicable.
+ (mulhisi3tb, mulhisi3bt, mulhisi3tt): New patterns for ARMv5e.
+
+2003-02-28 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.c (note_invalid_constants): Change parameter type
+ from bool to int.
+
+2003-02-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*tst_extzv_bitqi_1_n): Accept the
+ test of bit 7.
+ (*tst_extzv_memqi_1_n): Likewise.
+ (a peephole2): New.
+
+2003-02-28 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Wrap in
+ #ifndef __mips16.
+
+2003-02-28 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (gen_lowpart_for_combine): Update handling of
+ subregs_of_mode
+ * flow.c (life_analysis, mark_used_regs): Likewise.
+ * regclass.c (subregs_of_mode): Turn into single bitmap.
+ (cannot_change-mode_set_regs, invalid_mode_change_p): Update
+ dealing with subregs_of_mode
+ * regs.h (subregs_of_mode): Update prototype.
+
+2003-02-28 Josef Zlomek <zlomekj@suse.cz>
+
+ * emit-rtl.c (set_reg_attrs_for_parm): New function.
+ * rtl.h (set_reg_attrs_for_parm): New exported function.
+ * function.c (assign_parms): Use set_reg_attrs_for_parm instead of
+ set_reg_attrs_from_mem.
+
+2003-02-27 Roger Sayle <roger@eyesopen.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.c (do_spec_1): Treat %U like %u for unique associations.
+
+2003-02-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * reload1.c (sext_for_mode): Remove.
+ (reload_cse_move2add): Use trunc_int_for_mode instead of
+ sext_for_mode.
+ (move2add_note_store): Likewise.
+ Reset register information if we see a set in non-integer
+ mode.
+
+2003-02-27 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/aix43.h (ASM_SPEC): Only emit -mppc64 if no -mcpu
+ option.
+ (ASM_CPU_SPEC): Use -m620 for Power3, Power4, 620, 630.
+ * config/rs6000/aix51.h: Same.
+ * config/rs6000/aix52.h: Same.
+ * config/rs6000/power4.md: Additional VMX bypasses.
+
+2003-02-27 Geert Bosch <bosch@gnat.com>
+
+ * toplev.c (print_version): Add indentation for GGC heuristics and
+ output after printing version information.
+
+2003-02-27 James E Wilson <wilson@tuliptree.org>
+
+ * combine.c (simplify_comparison): Require integral mode when
+ permuting SUBREG with AND.
+
+2003-02-27 Steve Ellcey <sje@cup.hp.com>
+
+ * config/ia64/hpux.h (STARTFILE_PREFIX_SPEC): Remove.
+
+2003-02-27 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.md (extendsfdf2): Add pattern accidentally
+ deleted when cirrus instructions were added.
+
+2003-02-27 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config.gcc (*-*-netbsd[2-9]*, *-*-netbsdelf[2-9]*): Enable
+ POSIX thread support by default.
+
+2003-02-27 Roger Sayle <roger@eyesopen.com>
+
+ * config/i386/cygwin.h: Don't include any other files directly.
+ * config/i386/mingw32.h: Don't include cygwin.h directly.
+ * config.gcc (cygwin, mingw32, uwin): Instead make these files
+ explicit in the tm_files variable.
+
+2003-02-27 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.md: Add TI constant splitter.
+
+2003-02-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * builtins.c (purge_builtin_constant_p): Handle subreg of
+ constant_p_rtx too.
+
+ * function.c (assign_stack_local_1): Truncate constant added to
+ frame_pointer_rtx or virtual_stack_vars_rtx for Pmode.
+
+2003-02-26 David Edelsohn <edelsohn@gnu.org>
+
+ * config.gcc: Add power4 to PowerPC with_cpu list.
+
+2003-02-26 Jan Hubicka <jh@suse.cz>
+
+ * objc-act.c: (mark_referenced_methods): Fix compilation problem.
+
+2003-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcov-dump.c (print_prefix): Fix signedness warning.
+ * gcov-io.h (struct counter_section, struct counter_section_data): New.
+ (struct function_info): n_arc_counts field removed, n_counter_sections,
+ counter_sections fields added.
+ (struct gcov_info): arc_counts, n_arc_counts fields removed,
+ n_counter_sections, counter_sections fields added.
+ * libgcov.c (gcov_exit, __gcov_flush): Add support for multiple
+ profile sections.
+ * profile.h (MAX_COUNTER_SECTIONS): New.
+ (struct section_info): New.
+ (struct profile_info): count_instrumented_edges,
+ count_edges_instrumented_now fields removed, n_sections, section_info
+ fields added.
+ (find_counters_section): Declare.
+ * profile.c (struct function_list): count_edges field removed,
+ n_counter_sections, counter_sections fields added.
+ (set_purpose, label_for_tag, build_counter_section_fields,
+ build_counter_section_value, build_counter_section_data_fields,
+ build_counter_section_data_value, build_function_info_fields,
+ build_function_info_value, build_gcov_info_fields,
+ build_gcov_info_value): New static functions.
+ (find_counters_section): New function.
+ (instrument_edges, get_exec_counts, compute_branch_probabilities,
+ branch_prob, create_profiler): Modified to support multiple profile
+ sections.
+
+2003-02-26 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (compute_frame_size): Don't assume PREFERRED_STACK_BOUNDARY
+ is 8 * STACK_BOUNDARY.
+ * pa.h (PREFERRED_STACK_BOUNDARY): Change to 128 on 64-bit port.
+
+2003-02-26 Michael Matz <matz@suse.de>
+
+ * ra-colorize.c (merge_moves): Fix list handling.
+
+2003-02-26 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.c (is_load_address): Rename to...
+ (arm_memory_load_p) ... this and make it check for SUBREGs and
+ constant loads that will be converted into loads from the
+ minipool.
+ (is_cirrus_insn): Rename to ...
+ (arm_cirrus_insn_p): ... this, for consistency. Replace test
+ of CIRRUS_NO with CIRRUS_NOT.
+ (cirrus_reorg): Use renamed functions.
+ (note_invalid_constants): Change from a void function to bool.
+ Add an extra parameter, saying whether the fixups should be
+ pushed. Return true if fixups are needed.
+ (arm_reorg): Use renamed functions. Use INSN_P. Replace test
+ of CIRRUS_NO with CIRRUS_NOT.
+ * config/arm/arm.h (FLOAT_WORDS_BIG_ENDIAN): Mention that
+ other floating point co-processors can also affect this.
+ * config/arm/arm.md ("type" attribute): Add mav_farith and
+ mav_dmult. Replace references to "cirrus_type" attribute with
+ "type".
+ * config/arm/cirrus.md ("cirrus_fpu" attribute): Delete.
+ ("cirrus_type" attribute): Delete - use "type" instead.
+ ("cirrus" attribute): Replace 'no' with 'not' and 'yes' with
+ 'normal'.
+
+2003-02-25 Jan Hubicka <jh@suse.cz>
+
+ * objc-act.c: Include cgraph.h
+ (mark_referenced_methods): New function.
+ (objc_init): Call it.
+ * objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set.
+
+ * c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time
+ mode.
+
+ * optabs.c (expand_fix): Do not widen the input operand.
+
+ * expr.c (emit_group_store): Fix crash when converting single
+ register into complex register.
+
+ * Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h
+ * alias.c: Include timevar.h
+ (init_alias_analysis): Set timevar
+ * jump.c: Include timevar.h
+ (rebuild_jump_labels): Set timevar
+ * regcalss.c: Include timevar.h
+ (reg_scan): Set timevar
+ * timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New
+
+2003-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cse.c (count_reg_usage): Fix handling of REG_EQUAL notes.
+
+ * Makefile.in (loop-unroll.o): New.
+ * cfgloop.h (UAP_PEEL, UAP_UNROLL, UAP_UNROLL_ALL): New.
+ (unroll_and_peel_loops): Declare.
+ * alias.c (init_alias_analysis): Flag_unroll_loops renamed to
+ flag_old_unroll_loops.
+ * loop.c (loop_invariant_p): Ditto.
+ * unroll.c (unroll_loop): Flag_unroll_all_loops renamed to
+ flag_old_unroll_all_loops.
+ * flags.h (flag_unroll_loops): Renamed to flag_old_unroll_loops.
+ (flag_unroll_all_loops): Renamed to flag_old_unroll_all_loops.
+ * params.def (PARAM_MAX_UNROLLED_INSNS): Default value changed.
+ (PARAM_MAX_AVERAGE_UNROLLED_INSNS, PARAM_MAX_UNROLL_TIMES,
+ PARAM_MAX_PEELED_INSNS, PARAM_MAX_PEEL_TIMES,
+ PARAM_MAX_COMPLETELY_PEELED_INSNS, PARAM_MAX_COMPLETELY_PEEL_TIMES,
+ PARAM_MAX_ONCE_PEELED_INSNS): New.
+ * toplev.h (flag_old_unroll_loops, flag_old_unroll_all_loops): New.
+ (flag_unroll_loops, flag_unroll_all_loops): Used for new unroller
+ instead of old one.
+ (flag_peel_loops): New.
+ (lang_independent_options): The new flags added.
+ (rest_of_compilation): Call new unroller.
+ (process_options): Setup flags for coexistence of old and new unroller.
+ * doc/invoke.texi: Document new options.
+ * doc/passes.texi: Document new unroller pass.
+
+2003-02-26 David Billinghurst <David.Billinghurst@riotinto.com>
+
+ * fixinc/fixincl.x: Regenerate
+
+2003-02-26 Josef Zlomek <zlomekj@suse.cz>
+
+ * function.c (assign_parms): Set reg_attrs for parameters passed in
+ registers.
+
+2003-02-26 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/9681
+ * tlink.c (scan_linker_output): Drop leading '.' from symbol names.
+
+2003-02-25 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/xcoff.h (ASM_FILE_START): Do not emit machine
+ pseudo-op.
+
+2003-02-25 Roger Sayle <roger@eyesopen.com>
+
+ * combine.c (combine_simplify_rtx, simplfy_comparison): Use CC0_P.
+ * cse.c (invalidate_skipped_set): Likewise.
+ * integrate.c (subst_constants): Likewise.
+ * jump.c (reversed_comparison_code_parts): Likewise.
+ * loop.c (canonicalize_condition): Likewise.
+ * simplify-rtx.c (simplify_relational_operation): Likewise.
+
+2003-02-25 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def (DEF_LIB_ALWAYS_BUILTIN, DEF_UNUSED_BUILTIN): Delete.
+ (abs, labs, fabs, fabsf, fabsl, abort, exit, _exit, _Exit): Use
+ the appropriate macro to define built-in function.
+ (fmod,fmodf,fmodl): New built-in functions.
+
+ * doc/extend.texi (fmod,fmodf,fmodl): Document new built-ins.
+
+2003-02-25 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (function_arg): Pass variable sized
+ structures correctly on the stack.
+
+2003-02-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * reload1.c (reload_cse_move2add): Use STRICT_LOW_PART if PLUS
+ does not reduce the cost of SET.
+
+2003-02-25 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR target/9732
+ * config/rs6000/rs6000.c (first_reg_to_save): Handle
+ PIC_OFFSET_TABLE_REGNUM for -fPIC too.
+ (rs6000_emit_prologue): Likewise.
+ (rs6000_emit_epilogue): Likewise.
+ * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Make
+ PIC_OFFSET_TABLE_REGNUM a fixed register for -fPIC.
+
+2003-02-25 Richard Henderson <rth@redhat.com>
+
+ * real.c (real_to_integer2): Force overflow result only for
+ unsigned overflow.
+
+2003-02-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcse.c (cprop_jump): Revert the 2003-02-23 change.
+
+2003-02-25 Vladimir Makarov <vmakarov@toke.toronto.redhat.com>
+ Richard Henderson <rth@redhat.com>
+
+ * sched-ebb.c (add_deps_for_risky_insns): Add the dependence when
+ there is no similar load.
+
+2003-02-25 Vladimir Makarov <vmakarov@redhat.com>
+ Richard Henderson <rth@redhat.com>
+
+ * sched-int.h (INSN_TRAP_CLASS, WORST_CLASS): Move them from
+ sched-rgn.c.
+ (add_forward_dependence): New function prototype.
+
+ * sched-rgn.c (INSN_TRAP_CLASS, WORST_CLASS): Move them to
+ sched-init.h.
+ (CONST_BASED_ADDRESS_P, may_trap_exp, haifa_classify_insn): Move
+ them to haifa-sched.c.
+
+ * haifa-sched.c (CONST_BASED_ADDRESS_P, may_trap_exp,
+ haifa_classify_insn): Move them from sched-rgn.c.
+
+ * sched-deps.c (add_dependence): Return flag of creating a new
+ entry.
+ (add_forward_dependence): New function.
+ (compute_forward_dependences): Use the function.
+
+ * sched-ebb.c (earliest_block_with_similiar_load): New function.
+ (add_deps_for_risky_insns): New function.
+ (schedule_ebb): Call the function.
+
+2003-02-20 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/tm.texi: Document Rename TARGET_VECTOR_TYPES_COMPATIBLE to
+ TARGET_VECTOR_OPAQUE_P. Document accordingly.
+
+ * testsuite/gcc.dg/20030218-1.c: Check that initialization of
+ opaque types fail.
+
+ * c-typeck.c (comptypes): Change call to vector_types_compatible
+ to vector_opaque_p.
+ (convert_for_assignment): Call vector_opaque_p instead of
+ vector_types_compatible.
+ (really_start_incremental_init): Disallow initialization of opaque
+ types.
+
+ * target-def.h: Remove TARGET_VECTOR_TYPES_COMPATIBLE.
+ Define TARGET_VECTOR_OPAQUE_P.
+ (TARGET_INITIALIZER): Same.
+
+ * target.h (struct gcc_target): Remove vector_types_compatible.
+ Add vector_opaque_p.
+
+ * config/rs6000/rs6000.c (rs6000_spe_vector_types_compatible):
+ Remove.
+ (is_ev64_opaque_type): Check for TARGET_SPE and make sure type is
+ a vector type. Change return type to bool.
+ (TARGET_VECTOR_TYPES_COMPATIBLE): Remove.
+ (TARGET_VECTOR_OPAQUE_P): Define.
+
+ * cp/parser.c (cp_parser_init_declarator): Call vector_opaque_p
+ target hook.
+ Include target.h.
+ (cp_parser_init_declarator): Fix typo in function comments.
+
+2003-02-25 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (lcm.o): Add dependency on function.h
+ * lcm.c (function.h): Include.
+ * i386.c (machine_function, ix86_stack_locals,
+ * ix86_save_varrargs_registers) : Move to
+ ...
+ * i386.h (machine_function, ix86_stack_locals,
+ ix86_save_varrargs_registers): ... here; add optimize_mode_switching
+ (ix86_optimize_mode_switching): New.
+ * i386.md (fix patterns): Set ix86_optimize_mode_switching
+
+2003-02-25 Nick Clifton <nickc@redhat.com>
+
+ * config/d30v/d30v.c (d30v_init_cumulative_args): Fix typo. Name
+ of fourth arg is 'fndecl' not 'indirect'. Update comment
+ describing the function's parameters.
+
+2003-02-24 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (simplify_shift_const): Fix previous patch.
+
+2003-02-24 Jeff Law <law@redhat.com>
+
+ * i386.md (testdi_1_rex64): Discourage reload from using the %eax
+ alternative.
+ (testsi_1, testhi_1, testqi_1): Likewise.
+
+2003-02-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Rename
+ __EXTERN_PREFIX to __PRAGMA_EXTERN_PREFIX.
+ * doc/extend.texi (Tru64 Pragmas): Reflect this.
+
+ * fixinc/inclhack.def (alpha___extern_prefix): Indicate #pragma
+ extern_prefix support for Tru64 UNIX V5 <sys/stat.h>.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/tests/base/sys/stat.h [ALPHA___EXTERN_PREFIX_CHECK]: New
+ testcase.
+ Fixes PR c/5059, c/6126, other/9671.
+
+2003-02-24 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.c (do_spec_1) ['{']: Handle pending argument upon return
+ from handle_braces in "%{...}".
+
+2003-02-24 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (TARGET_HAVE_TLS): Conditionally define.
+ (prepare_move_operands): Handle TLS operands.
+ (tls_symbolic_operand): New.
+ (nonpic_symbol_mentioned_p): Handle TLS UNSPECs.
+ (legitimize_pic_address): Do nothing for the TLS symbol.
+ (sh_encode_section_info): Handle TLS case.
+ (sh_strip_name_encoding): Drop TLS encoding.
+ * config/sh/sh-protos.h (tls_symbolic_operand): Add prototype.
+ * config/sh/sh.h (SH_TLS_ENCODING): Define.
+ (TLS_SYMNAME_P, STRIP_TLS_ENCODING): Likewise.
+ (ASM_OUTPUT_LABELREF): Drop TLS encoding.
+ (OUTPUT_ADDR_CONST_EXTRA): Handle TLS UNSPECs.
+ * config/sh/sh.md: Define TLS UNSPEC constants.
+ (type): Add tls_load.
+ ("tls_global_dynamic", "tls_local_dynamic"): New insns.
+ ("sym2DTPOFF", "symDTPOFF2reg", "sym2GOTTPOFF"): New expanders.
+ ("tls_initial_exec"): New insn.
+ ("sym2TPOFF", "symTPOFF2reg"): New expanders.
+ ("load_gbr"): New insn.
+
+ * configure.in (HAVE_AS_TLS): Add sh-*-* and sh[34]*-*-* cases.
+ * configure: Regenerate.
+
+2003-02-24 Alan Modra <amodra@bigpond.net.au>
+
+ PR 9297, PR 9722
+ * calls.c (store_one_arg): Revert 1999-02-16 change. Revert
+ 2000-12-17 change. Pass EXPAND_STACK_PARM to expand_expr.
+ * expr.h (enum expand_modifier): Define EXPAND_STACK_PARM.
+ (enum block_op_methods): Reorder for better store_expr optimization.
+ * expr.c (store_expr): Test bit 1 of "want_value" for call param
+ stores, test bit 0 for original want_value meaning. Pass
+ BLOCK_OP_CALL_PARM to emit_block_move when bit 1 set. Adjust
+ recursive calls, and calls to expand_param.
+ (expand_expr): Handle EXPAND_STACK_PARM modifier. When cse
+ expected, set target to 0 rather than to subtarget. Formatting.
+
+2003-02-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcse.c (cprop_jump): Use the REG_EQUAL note if available.
+
+2003-02-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * doc/invoke.texi (ggc-min-expand, ggc-min-heapsize): Document
+ new default behavior.
+ * ggc-common.c: Include sys/resource.h.
+ (ggc_rlimit_bound): New function.
+ (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic): Update
+ defaults to account for rlimits.
+
+2003-02-22 Richard Henderson <rth@redhat.com>
+
+ * i386.c, i386.h (TUNEMASK): Rename from CPUMASK.
+
+2003-02-22 Kelley Cook <kelley@dwhoops.info>
+
+ * i386.h, i386.c, i386.md (ix86_tune): Rename from ix86_cpu.
+ (ix86_tune_string): Rename from ix86_cpu_string.
+
+2003-02-22 Kelley Cook <kelleycook@comcast.net>
+
+ * config/i386/i386.c: Replace "mcpu" with "mtune".
+ * config/i386/i386.h (TARGET_OPTIONS): Likewise.
+ (CC1_CPU_SPEC): Likewise. New warning for "-mcpu".
+ * doc/invoke.texi (i386 and x86-64 Options): Replace "mcpu"
+ with "mtune". Note that "mcpu" is a deprecated synonym for "mtune".
+
+2003-02-23 Andreas Schwab <schwab@suse.de>
+
+ * config.gcc: Delete references to m68k/t-linux and
+ m68k/t-linux-aout.
+ * config/m68k/t-linux, config/m68k/t-linux-aout: Removed.
+
+2003-02-22 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (rest_of_compilation): Apply fotgotten hunk
+ of track scheduling patch.
+
+2003-02-22 Jan Hubicka <jh@suse.cz>
+
+ * config/linux.h (TARGET_HAS_F_SETLKW): Define.
+ * config/alpha/linux.h (TARGET_HAS_F_SETLKW): Likewise
+
+2003-02-22 Jan Hubicka <jh@suse.cz>
+
+ * c-decl.c (c_expand_body_1): Fix.
+
+2003-02-22 Jan Hubicka <jh@suse.cz>
+
+ * expmed.c (expand_divmod): Undo sign extensions for unsigned operands
+
+ * cfgcleanup.c (try_forward_edges): Don't check loop structures
+ when not optimizing.
+ (cleanup_cfg): Do not iterate trought delete_trivially_dead_insns
+ when not expensive.
+ * toplev.c (rest_of_compilation): Duplicate loop headers only when
+ optimizing; Delete trivially dead insns early; fix optimize check.
+
+ * Makefile.in (c-decl.o, c-objc-common.o, cgraph.o, tree-inline.o): Add
+ dependency on cgraph.h
+ * c-decl.c: Include cgraph.h
+ (finish_function): Update call of tree_inlinable_function_p.
+ * c-objc-common.c: Include cgraph.h
+ * cgraph.h: New file.
+ * cgraphunit.c: New file.
+ * cgraph.c (cgraph_node, cgraph_edge): Move into cgraph.h
+ (cgraph_nodes, cgraph_n_nodes): Globalize.
+ (cgraph_finalize_function, cgraph_finalize_compilation_unit
+ cgraph_create_edges, cgraph_optimize, cgraph_mark_needed_node):
+ Move into cgraphunit.c
+ * tree-inline.c: Include cgraph.h
+ * tree-inline.c: Include cgraph.h
+
+2003-02-22 Josef Zlomek <zlomekj@suse.cz>
+
+ * config/i386/i386.md: Use gen_lowpart instead of gen_rtx_REG
+ for copying a register.
+
+2003-02-22 Steven Bosscher <s.bosscher@student.tudelft.nl>
+
+ PR other/3782
+ * toplev.c (process_options): If flag_detailed_statistics is set,
+ then set time_report as well.
+
+ PR c/8828
+ * jump.c (never_reached_warning): Don't fall through BARRRIER
+ insns. Update comments to reflect what the function really does.
+
+2003-02-21 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (omit_one_operand): No longer static.
+ * tree.h (omit_one_operand): Prototype here.
+ (div_and_round_double): Keep fold-const.c prototypes together.
+ * builtins.c (builtin_mathfn_code): Handle binary built-in
+ funtions, such as "pow" and "atan2".
+ (fold_builtin): Optimize both pow(x,0.0) and pow(1.0,y) to 1.0.
+ Simplify optimizations using "type" the builtin's return type.
+
+2003-02-22 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/cris.c (cris_rtx_costs): Blockify dangling else.
+ Fix functionalization typo.
+
+ * regmove.c (optimize_reg_copy_1): Do not replace a hard register
+ in an asm.
+
+2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (ggc-common.o): Depend on $(PARAMS_H)
+ * doc/invoke.texi (ggc-min-expand, ggc-min-heapsize): Update
+ documentation.
+ * ggc-common.c: Include params.h
+ (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic,
+ init_ggc_heuristics): New functions.
+ * ggc.h (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic,
+ init_ggc_heuristics): Prototype.
+ * toplev.c (print_version): Output GGC heuristics.
+ (parse_options_and_default_flags): Call init_ggc_heuristics.
+
+2003-02-22 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (def_builtin): Special case 64bit builtins.
+ (MASK_SSE164, MASK_SSE264): New constants.
+ (builtin_description): Add 64bit builtins.
+ (ix86_init_mmx_sse_builtins): Likewise.
+ * i386.h (enum ix86_builtins): Likewise.
+ * i386.md (cvtss2siq, cvttss2siq, cvtsd2siq, cvttsd2siq, cvtsi2sdq,
+ sse2_movq2dq_rex64, sse2_movsq2q_rex64): New.
+ (sse2_movq2dq, sse2_movsq2q): Disable for 64bit.
+ * mmintrin.h (_mm_cvtsi64x_si64, _mm_set_pi64x, _mm_cvtsi64_si64x): New.
+ * xmmintrin.h (_mm_cvtss_si64x, _mm_cvttss_si64x, _mm_cvtsi64x_ss,
+ _mm_set_epi64x, _mm_set1_epi64x, _mm_cvtsd_si64x, _mm_cvttsd_si64x,
+ _mm_cvtsi64x_sd, _mm_cvtsi64x_si128, _mm_cvtsi128_si64x): New.
+
+2003-02-22 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (builtin_description): Add __builtin_ia32_paddq and
+ __builtin_ia32_psubq. Fix __builtin_ia32_paddq128
+ and __builtin_ia32_psubq128.
+ * i386.h (IX86_BUILTIN_PADDQ, IX86_BUILTIN_PSUBQ): New.
+ * i386.md (addv*, mmx_ior*, mmx_xoe*, mmx_and*): Add missing '%'.
+ (mmx_adddi3, mmx_subdi3): New.
+ * mmintrin.h (_mm_add_si64, _mm_sub_si64): New.
+ * xmmintrin.h (_mm_movepi64_pi64): New.
+ (_mm_add_epi64, _mm_sub_epi64): fix.
+ (_mm_mul_pu16): Rename to...
+ (_mm_mul_su32): ... this one.
+
+ * builtins.c (expand_builtin_expect): Do not predict
+ flag_guess_branch_prob is not set.
+ * c-semantics.c (expand_stmt): Likewise.
+ * predict.c (predict_insn): Likewise.
+ * stmt.c (expand_continue_loop): Likewise.
+ * toplev.c (rest_of_compilation): Do not call
+ note_prediction_to_br_prob and note_prediction_to_br_prob
+ when not optimizing.
+
+2003-02-21 Jan Hubicka <jh@suse.cz>
+
+ * cfgrtl.c (commit_edge_insertions): Call
+ find_many_sub_basic_block only when some code has been emitted.
+ (commit_edge_insertions_watch_calls): Bring into sync with
+ commit_edge_insertions
+
+2003-02-21 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (OVERRIDE_OPTIONS): Fix code that clears 'e' register class.
+
+ * sh.md (binary_sf_op): Use extra constant operand instead of
+ negating constant operand 4.
+ * sh.c (sh_expand_binop_v2sf): Supply it.
+
+2003-02-21 Zack Weinberg <zack@codesourcery.com>
+
+ * cpphash.h (struct lexer_state): Add directive_wants_padding.
+ * cpplib.c (_cpp_handle_directive): Set directive_wants_padding
+ for directives of type INCL.
+ (glue_header_name, parse_include): Use get_token_no_padding.
+ * cppmacro.c (replace_args): If directive_wants_padding,
+ provide padding tokens.
+
+2003-02-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-02-21 Jan Hubicka <jh@suse.cz>
+
+ * cfgrtl.c (commit_one_edge_insertion): Only mark BB for splitting.
+ (commit_edge_insertions): Call find_many_sub_basic_blocks
+
+ * reg-stack.c (convert_regs): Cleax aux for blocks.
+
+2003-02-21 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (parse_options_and_default_flags): Undo accidental commit.
+
+2003-02-21 Glen Nakamura <glen@imodulo.com>
+
+ PR optimization/8613
+ * builtins.c (expand_builtin): Emit postincrements before expanding
+ builtin functions.
+
+2003-02-21 Ben Elliston <bje@redhat.com>
+
+ PR other/5634
+ * doc/install.texi (Configuration): Explain using $HOME instead of
+ the ~ metacharacter when referring to home directories.
+
+2003-02-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (TARGET_SYSTEM_ROOT): Set default to
+ ${exec_prefix}/${target_alias}/sys-root. Match explicit
+ '${exec_prefix}' (in addition to the expansion thereof) as
+ relocatable.
+ * configure: Rebuilt.
+
+2003-02-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (addhi3_incdec): Change the name to
+ *addhi3_incdec.
+ (addsi3_incdec): Change the name to *addsi3_incdec.
+
+2003-02-20 Roger Sayle <roger@eyesopen.com>
+
+ * explow.c (force_reg): Avoid useless REG_EQUAL notes.
+
+2003-02-20 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR fortran/9038
+ * c-opts.c (sanitize_cpp_opts): Add Fortran front end
+ options to be ignored.
+ (c_common_decode_option): Ignore them when preprocessing.
+
+2003-02-20 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (flag_sched2_use_superblocks, flag_sched2_use_traces): New
+ global variables.
+ (lang_independent_options): Add -fsched2-use-superblocks
+ -fsced2-use-traces.
+ (rest_of_compilation): Deal with it.
+ * invoke.texi (-fsched2-use-traces, fsched2-use-superblocks): Declare.
+ * flags.h (flag_sched2_use_superblocks, flag_sched2_use_traces):
+ Declare.
+ * rtl.h (reg_to_stack): Update prototype.
+ * reg-stack.c (reg_to_stack): Return when something has changed;
+ update liveness when executing after superblock scheduling.
+
+ * combine.c (simplify_shift_const): Simplify few special cases
+ into constants.
+
+2003-02-20 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md: (attr "type"): Add fast_compare.
+ (add.,subf.,neg.): Change attribute to fast_compare.
+ All DFA descriptions updated.
+
+2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ Change base class access representation.
+ * tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED,
+ TREE_VIA_PRIVATE): Remove.
+ (BINFO_BASEACCESSES): New binfo elt.
+ (BINFO_BASEACCESS): New accessor.
+ (BINFO_ELTS): Increase.
+ (TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New.
+ (access_public_node, access_protected_node,
+ access_private_node): New global nodes.
+ * tree.c (build_common_tree_nodes_2): Initialize access nodes.
+ * dbxout.c (dbxout_type): Adjust.
+ * dwarf2out.c (gen_inheritance_die): Add access parameter.
+ (gen_member_die): Adjust.
+ * dwarfout.c (output_inheritance_die): ARG is array of two trees.
+ (output_type): Adjust.
+ * tree-dump.c (dequeue_and_dump): Adjust binfo dumping.
+
+ Change base class access representation. Share virtual base
+ binfos.
+ * cp/call.c (build_special_member_call): Remove binfo_for_vbase
+ call.
+ * cp/class.c (build_base_path): Likewise.
+ (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
+ (build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
+ (make_new_vtable): Adjust.
+ (force_canonical_binfo_r): Delete.
+ (force_canonical_binfo): Delete.
+ (mark_primary_virtual_base): Delete.
+ (dfs_unshared_virtual_bases): Delete.
+ (mark_primary_bases): Adjust.
+ (maybe_warn_about_overly_private_class): Adjust.
+ (dfs_base_derived_from): Delete.
+ (base_derived_from): Follow the inheritance chain.
+ (struct find_final_overrider_data): Add vpath member.
+ (dfs_find_final_overrider): Adjust.
+ (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
+ (find_final_overrider): Adjust.
+ (update_vtable_entry_for_fn): Adjust.
+ (modify_all_vtables): Adjust.
+ (walk_subobject_offsets): Adjust.
+ (layout_nonempty_base_or_field): Adjust.
+ (layout_empty_base): Remove last parameter. Adjust.
+ (build_base_field): Adjust.
+ (build_base_fields): Adjust.
+ (propagate_binfo_offsets): Remove last parameter. Adjust.
+ (dfs_set_offset_for_unshared_vbases): Delete.
+ (layout_virtual_bases): Adjust.
+ (finish_struct_1): Adjust.
+ (init_class_processing): Don't init access nodes.
+ (dfs_get_primary_binfo): Delete.
+ (get_primary_binfo): Adjust.
+ (dump_class_hierarchy_r): Remove most derived arg, add IGO
+ parameter. Adjust.
+ (dump_class_hierarchy): Adjust.
+ (finish_vtbls): Adjust.
+ (get_original_base): Delete.
+ (build_vtt_inits): Adjust.
+ (dfs_build_secondary_vptr_vtt_inits): Adjust.
+ (dfs_ctor_vtable_bases_queue_p): Adjust.
+ (build_ctor_vtbl_group): Adjust.
+ (dfs_accumulate_vtbl_inits): Adjust.
+ (build_vtbl_initializer): Adjust.
+ (build_vbase_offset_vtbl_entries): Adjust.
+ (add_vcall_offset_vtbl_entries_1): Adjust.
+ * cp/cp-tree.h (CPTI_ACCESS_*): Remove.
+ (access_*_node): Remove.
+ (CANONICAL_BINFO): Delete.
+ (BINFO_UNSHARED_MARKED): Remove.
+ (BINFO_MARKED): Set LANG_FLAG_0 directly.
+ (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
+ (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
+ (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
+ Delete.
+ (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
+ (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
+ (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
+ Delete.
+ (BINFO_DEPENDENT_BASE_P): New.
+ (dfs_walk, dfs_walk_real): Queue function takes derived binfo and
+ index.
+ (markedp, unmarkedp): Adjust.
+ (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
+ dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
+ find_vbase_instance, binfo_for_vbase): Delete.
+ (copied_binfo, original_binfo): Declare.
+ (finish_base_specifier): Add virtual_p arg.
+ (unshare_base_binfos): Delete.
+ (copy_base_binfos): Declare.
+ (reverse_path): Delete.
+ * cp/decl.c (xref_basetypes): Access and virtuality passed
+ differently. Don't copy direct base binfos here. Call
+ copy_base_binfos.
+ * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
+ (initialize_vtbl_ptrs): Adjust.
+ (expand_member_init): Adjust.
+ * cp/parser.c (cp_parser_base_specifier): Adjust.
+ * cp/pt.c (instantiate_class_template): Adjust.
+ (get_template_base_recursive): Adjust.
+ * cp/rtti.c (get_pseudo_ti_init): Adjust.
+ (get_pseudo_ti_desc): Adjust.
+ * cp/tree.c (unshare_base_binfos): Rename to ...
+ (copy_base_binfos): ... here, reimplement.
+ (make_binfo): Set BINFO_DEPENDENT_BASE_P.
+ (reverse_path): Remove.
+ * cp/typeck.c (get_delta_difference): Adjust error messages.
+ * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
+ * cp/search.c (lookup_base_r): Adjust.
+ (dynamic_cast_base_recurse): Adjust.
+ (canonical_binfo): Remove.
+ (dfs_canonical_queue): Remove.
+ (dfs_assert_unmarked_p): Remove.
+ (assert_canonical_unmarked): Remove.
+ (shared_marked_p, shared_unmarked_p): Remove.
+ (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
+ (dfs_access_in_type): Adjust.
+ (access_in_type): Adjust.
+ (dfs_accessible_queue_p): Adjust.
+ (dfs_accessible_p): Adjust.
+ (is_subobject_of_p_1, is_subobject_of_p): Remove.
+ (struct lookup_field_info): Remove from_dep_base_p field.
+ (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
+ (lookup_field_r): Remove dependent base code.
+ (lookup_member): Likewise.
+ (dfs_walk, dfs_walk_real): Add access arg to queue fn.
+ (dfs_unmarked_real_bases_queue_p): Remove.
+ (dfs_marked_real_bases_queue_p): Remove.
+ (dfs_skip_vbases): Remove.
+ (dfs_get_pure_virtuals): Adjust.
+ (markedp, unmarkedp): Adjust.
+ (marked_vtable_pathp, unmarked_vtable_pathp): Remove.
+ (marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
+ (dfs_unmark): Adjust.
+ (dfs_get_vbase_types):Remove.
+ (dfs_build_inheritance_graph_order): Remove.
+ (get_vbase_types): Remove
+ (dfs_find_vbase_instance): Remove.
+ (find_vbase_instance): Remove.
+ (dfs_debug_unmarkedp): Adjust.
+ (dependent_base_p): Remove.
+ (dfs_push_type_decls): Adjust.
+ (dfs_push_decls): Adjust.
+ (dfs_no_overlap_yet): Adjust.
+ (copied_binfo): New function.
+ (original_binfo): New function.
+ (binfo_for_vbase): Remove.
+
+ Change base class access representation.
+ * java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
+ (add_interface_do): Likewise.
+
+2003-02-20 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/sysv4.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define.
+ * config/rs6000/power4.md (power4-store,power4-vecstore): New
+ insn reservations.
+ (power4-fpstore): Compact.
+
+2003-02-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*iorsi3_w): New.
+
+2003-02-20 Josef Zlomek <zlomekj@suse.cz>
+
+ * combine.c (distribute_notes): Kill REG_EXEC_COUNT.
+ * rtl.c (reg_note_name): Likewise.
+ * rtl.h (enum reg_note): Likewise.
+ * doc/invoke.texi: Likewise.
+ * doc/rtl.texi: Likewise.
+
+2003-02-20 Josef Zlomek <zlomekj@suse.cz>
+
+ * bb-reorder.c (find_traces_1_round): Fix comment typo.
+
+2003-02-19 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold_real_zero_addition_p): Don't fold a zero
+ addition in the presence of signaling NaNs.
+
+2003-02-19 Krister Walfridsson <cato@df.lth.se>
+
+ * tm.texi (INIT_CUMULATIVE_ARGS): Fix typo.
+
+2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_logical_op): Optimize or.l when
+ ORing with 0xffff??00 with the highest bit of the ?? part set.
+ (compute_logical_op_length): Update.
+ (compute_logical_op_cc): Likewise.
+
+2003-02-19 Josef Zlomek <zlomekj@suse.cz>
+
+ * bb-reorder.c (find_traces_1_round): Fixed condition for small
+ destination block with multiple predecessors.
+ (connect_traces): Check whether the block is a start of trace.
+
+2003-02-19 Jan Hubicka <jh@suse.cz>
+
+ * calls.c (expand_call): Update call of INIT_CUMULATIVE_ARGS
+ * function.c (assign_params): Likewise.
+ * arm-protos.h (arm_init_cumulative_args): Update prototype.
+ * arm.c (arm_init_cumulative_args): Update function.
+ * arm.h (INIT_CUMULATIVE_ARGS): Update.
+ * avr-protos.h (init_cumulative_args): Update prototype.
+ * avr.c (init_cumulative_args): Update function.
+ * avr.h (INIT_CUMULATIVE_ARGS): Update.
+ * d30v-protos.h (d30v_init_cumulative_args): Update prototype.
+ * d30v.c (d30v_init_cumulative_args): Update function.
+ * d30v.h (INIT_CUMULATIVE_ARGS): Update.
+ * frv-protos.h (frv_init_cumulative_args): Update prototype.
+ * frv.c (frv_init_cumulative_args): Update function.
+ * frv.h (INIT_CUMULATIVE_ARGS): Update.
+ * mips.c (mips_expand_prolgue): Update call of INIT_CUMULATIVE_ARGS.
+ * pa.h (INIT_CUMULATIVE_ARGS): Update.
+ * sparc-protos.h (init_cumulative_args): Update prototype.
+ * sparc.c (init_cumulative_args): Update function.
+ * sparc.h (INIT_CUMULATIVE_ARGS): Update.
+ * tm.texi (INIT_CUMULATIVE_ARGS): Update documentation.
+
+2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*iorsi3_two_qi_sext): New.
+ (*ashiftsi_sextqi_7): Likewise.
+
+2003-02-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/iris6.h (TARGET_OS_CPP_BUILTINS): Define __c99 for
+ ISO C99 and C++.
+
+ * fixinc/inclhack.def (irix___restrict): Don't change __restrict
+ for C++ on IRIX 6.5.1[89].
+ * fixinc/tests/base/internal/sgimacros.h: New file.
+
+ * fixinc/inclhack.def (irix_wcsftime): Use XPG5 variant for C99.
+ * fixinc/tests/base/internal/wchar_core.h: New file.
+
+ * fixinc/inclhack.def (irix_socklen_t): Fix broken IRIX 6.5.1[78]
+ socklen_t definition.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/tests/base/sys/socket.h: New file.
+ Fixes PR libgcj/9652.
+
+2003-02-19 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (movsfcc_1, movdfcc_1): Fix constrains.
+
+2003-02-19 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Initialize
+ align_jumps_max_skip and align_loops_max_skip.
+
+2003-02-19 Thierry Moreau <thierry.moreau@connotech.com>
+
+ * config/rs6000/rs6000.c (rs6000_encode_section_info): Do not
+ test size if named section.
+
+2003-02-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * expr.c (expand_expr): Use gen_int_mode for the argument
+ to gen_rtx_MULT.
+
+2003-02-19 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (cosxf2): Fix conditional.
+
+2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (extendqisi2): Change to an expander.
+ (*extendqisi2_h8300): New.
+ (*extendqisi2_h8300hs): Likewise.
+
+2003-02-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Update the prototype for
+ split_adds_subs. Remove the prototypes for
+ const_int_le_2_operand and const_int_le_6_operand.
+ * config/h8300/h8300.c (split_adds_sub): Don't output inc/dec.
+ (const_int_le_2_operand): Remove.
+ (const_int_le_6_operand): Likewise.
+ * config/h8300/h8300.h (PREDICATE_CODES): Remove the entries
+ for const_int_le_2_operand and const_int_le_6_operand.
+ * config/h8300/h8300.md: Update all uses of split_adds_subs.
+ (a peephole2): New.
+
+2003-02-18 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (NPREDECESORC, SET_NPREDECESORS): Kill.
+ (cgraph_expand_function): Rewrite.
+
+2003-02-18 Matt Austern <austern@apple.com>
+
+ * toplev.c, langhooks.c, langhooks-def.h: Move
+ write_global_declarations from toplev.c to langhooks.c.
+
+2003-02-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (general_operand_src): Always check
+ MODE.
+ (general_operand_dst): Likewise.
+
+2003-02-18 Roger Sayle <roger@eyesopen.com>
+
+ * convert.c (convert_to_real): Also optimize (float)log(x) into
+ logf(x) where x is a float, i.e. also handle BUILT_IN_LOG{,L}.
+
+2003-02-18 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (unspec_caller_rtx_p): New.
+ (sh_cannot_copy_insn_p): New.
+ (TARGET_CANNOT_COPY_INSN_P): New.
+
+2003-02-18 Richard Henderson <rth@redhat.com>
+
+ * c-common.c (handle_used_attribute): Accept static data too.
+
+2003-02-18 Nick Clifton <nickc@redhat.com>
+ Aldy Hernandez <aldyh@redhat.com>
+
+ * testsuite/gcc.dg/20030218-1.c: New.
+
+ * doc/tm.texi: Document TARGET_VECTOR_TYPES_COMPATIBLE.
+
+ * target-def.h (TARGET_INITIALIZER): Add
+ TARGET_VECTOR_TYPES_COMPATIBLE.
+ (TARGET_VECTOR_TYPES_COMPATIBLE): New macro.
+
+ * target.h (struct gcc_target): Add field vector_types_compatible.
+
+ * c-typeck.c (comptypes): Take into account
+ TARGET_VECTOR_TYPES_COMPATIBLE.
+ (convert_for_assignment): Same.
+
+ * config/rs6000/rs6000.c (is_ev64_opaque_type): New.
+ (rs6000_spe_vector_types_compatible): New.
+ (TARGET_VECTOR_TYPES_COMPATIBLE): Define.
+
+2003-02-19 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.in (toplev.o): Depend on $(LANGHOOKS_DEF_H).
+ * toplev.c: Include langhooks-def.h.
+
+2003-02-18 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/mips.h (enum processor_type): Sort entries
+ alphabetically.
+ * config/mips/mips.md (define_attr cpu): Sync with processor_type
+ enum values, including adding entries that were missing.
+
+2003-02-18 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (calc_live_regs): Also check GET_CODE when checking if
+ initial value for PR_REG is still the PR_REG register.
+
+2003-02-18 Jim Wilson <wilson@redhat.com>
+
+ * config/ia64/ia64.md (floatdidf2, floatdisf2): Add %, before second
+ instruction in output template.
+ (bsp_value): Change output template from string to C code, add %,
+ before actual instruction.
+ (flushrs): Mark as not predicable.
+
+2003-02-18 Krister Walfridsson <cato@df.lth.se>
+
+ * inclhack.def (netbsd_bogus_semicolon): New fix.
+ * fixincl.x: Rebuilt.
+ * tests/base/ctype.h: Update.
+
+2003-02-18 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (negate_expr_p): New function to determine whether
+ an expression can be negated cheaply.
+ (fold) [MINUS_EXPR]: Use it to determine whether to transform
+ -A - B into -B - A for floating point types.
+
+2003-02-18 Roger Sayle <roger@eyesopen.com>
+
+ * sbitmap.c (sbitmap_resize): New function.
+ * sbitmap.h (sbitmap_resize): Prototype here.
+ * recog.c (split_all_insns): Use sbitmap_resize.
+
+2003-02-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*zero_extendhisi2_h8300): Fix the
+ insn length.
+ (extendqisi2): Likewise.
+ (*extendhisi2_h8300): Likewise.
+
+2003-02-18 Matt Austern <austern@apple.com>
+
+ * langhooks.h, langhooks-def.h: introduce new langhook,
+ final_write_globals, with write_global_declarations as default.
+ * toplev.c: Move invocation of wrapup_global_declarations from
+ compile_file to new function, write_global_declarations. Change
+ compile_file to use final_write_globals hook. Change
+ wrapup_global_declarations so writing to DECL_DEFER_OUTPUT is
+ conditional.
+
+2003-02-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.md: Correct and enhance comment.
+
+2003-02-18 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.c (validate_switches): Don't scan past closing '}'.
+
+2003-02-18 Ben Elliston <bje@redhat.com>
+
+ PR c++/1607
+ * doc/extend.texi (Function Attributes): Document the effect of
+ the C++ "this" parameter on the counting of arguments for the
+ "format" and "format_arg" attributes.
+
+2003-02-17 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.h (__ev_stdd): Cast 2nd arg.
+ (__ev_stdw): Same.
+ (__ev_stdh): Same.
+
+2003-02-17 Jan Hubicka <jh@suse.cz>
+
+ * recog.c (split_all_insns): Fix memory overflow.
+
+2003-02-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (cmpqi): Remove mode from compare.
+ (cmphi): Likewise.
+ (*cmphi_h8300): Likewise.
+ (*cmphi_h8300hs): Likewise.
+ (cmpsi): Likewise.
+ (7 peephole2): Likewise.
+
+2003-02-16 Jan Hubicka <jh@suse.cz>
+
+ * c-typeck.c (build_c_cast): Fold constant variables into
+ initial values.
+
+2003-02-16 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific): Fix link for m68k-att-sysv.
+ (Binaries): Ditto for Sinix/Reliant Unix.
+
+2003-02-16 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_reload_in_hi): Ensure that the scratch register does
+ not overlap the final result register.
+
+2003-02-16 Arend Bayer <arend.bayer@web.de>
+ Richard Henderson <rth@redhat.com>
+
+ PR c/8068
+ * fold-const.c (extract_muldiv_1): Rename from extract_muldiv;
+ rearrange mult arguments for less recursion.
+ (extract_muldiv): New. Prevent runaway recursion.
+
+2003-02-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/cygwin.h (TARGET_SUBTARGET_DEFAULT): Set
+ MASK_ALIGN_DOUBLE.
+
+2003-02-15 Roger Sayle <roger@eyesopen.com>
+
+ * config/i386/i386.c (x86_ext_80387_constants): Use 80387 insns
+ to load mathematical constants on K6, Athlon, Pentium 4 and PPro.
+ (ext_80387_constants_table): Global table of 80387 special constants
+ guarded by ext_80387_constants_init flag when not initialized.
+ (init_ext_80387_constants): New function to initialize this table.
+ (standard_80387_constant_p): Extend to recognize extra 80387
+ constants, in XFmode, on processors where this is a win.
+ (standard_80387_constant_opcode): New function to return the
+ opcode associated with standard_80387_constant_p.
+ (standard_80387_constant_rtx): New function to return the XFmode
+ CONST_DOUBLE associated with standard_80387_constant_p.
+ (ix86_rtx_costs): Give the new constants the same cost as 1.0.
+
+ * config/i386/i386-protos.h (standard_80387_constant_opcode):
+ Prototype here.
+ (standard_80387_constant_rtx): Likewise.
+
+ * config/i386/i386.md (*movsf1, *movsf1_nointerunit, *movdf_nointeger,
+ *movdf_integer, *movxf_nointeger, *movtf_nointeger, *movxf_integer,
+ *movtf_integer): Simplify using new standard_80387_constant_opcode.
+
+2003-02-15 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/invoke.texi (Optimize Options): Correct @option syntax.
+
+2003-02-15 Richard Henderson <rth@redhat.com>
+
+ * Makefile.in (cfglayout.o): Depend on TARGET_H.
+ * cfglayout.c: Include target.h.
+ (cfg_layout_can_duplicate_bb_p): Check targetm.cannot_copy_insn_p.
+ * target-def.h (TARGET_CANNOT_COPY_INSN_P): New.
+ * target.h (struct gcc_target): Add cannot_copy_insn_p.
+
+ * config/alpha/alpha.c (alpha_cannot_copy_insn_p): New.
+ (TARGET_CANNOT_COPY_INSN_P): New.
+ (override_options): Revert 2003-02-08 hack.
+
+2003-02-15 Richard Henderson <rth@redhat.com>
+
+ * gcse.c (bypass_block): Use BLOCK_FOR_INSN for resolving LABEL_REFs.
+ (bypass_conditional_jumps): Accept computed_jump_p insns as well.
+
+2003-02-15 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.h (processor_type): Add PPC440.
+ * config/rs6000/rs6000.c (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE,
+ TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD,
+ TARGET_SCHED_VARIABLE_ISSUE): Define.
+ (rs6000_use_dfa_pipeline_interface): New function.
+ (rs6000_multipass_dfa_lookahead): New Function.
+ (rs6000_variable_issue): New function.
+ (rs6000_adjust_cost): Add CMP and DELAYED_CR types.
+ (rs6000_issue_rate): Add PPC440.
+ * config/rs6000/rs6000.md (unspec list): Correct typo.
+ (attr "type"): Add load_ext, load_ext_u, load_ext_ux, load_u,
+ store_ux, store_u, fpload_ux, fpload_u, fpstore_ux, fpstore_u,
+ cmp, delayed_cr, mfcr, mtcr.
+ (automata_option): Set "ndfa".
+ (extendMMNN2): Update attributes.
+ (movcc_internal1): Discourage move to non-cr0. Update
+ attributes.
+ (movMM_update): Update attributes.
+ (cmpMM_internal): Update attributes.
+ (sCC CR materialization): Update attributes.
+ (branch patterns): Do not discourage non-cr0.
+ (cr logical patterns): Prefer destructive register allocation.
+ Update attributes.
+ (movesi_from_cr): Update attribute.
+ (mtcrf_operation): Update attribute.
+ (mtcrfsi): Update attribute.
+ * config/rs6000/40x.md: New file.
+ * config/rs6000/603.md: New file.
+ * config/rs6000/6xx.md: New file.
+ * config/rs6000/7450.md: New file.
+ * config/rs6000/7xx.md: New file.
+ * config/rs6000/mpc.md: New file.
+ * config/rs6000/power4.md: New file.
+ * config/rs6000/rios1.md: New file.
+ * config/rs6000/rios2.md: New file.
+ * config/rs6000/rs64.md: New file.
+ [Some DFA descriptions based on work by Michael Hayes]
+
+2003-02-15 Richard Henderson <rth@redhat.com>
+
+ * bb-reorder.c (find_traces_1_round): Don't connect easy to copy
+ successors with multiple predecessors.
+ (connect_traces): Try harder to copy traces of length 1.
+
+ * function.h (struct function): Add computed_goto_common_label,
+ computed_goto_common_reg.
+ * function.c (free_after_compilation): Zap them.
+ * stmt.c (expand_computed_goto): Use them to produce one
+ indirect branch per function.
+
+2003-02-15 Richard Henderson <rth@redhat.com>
+
+ * cfgcleanup.c: Include params.h.
+ (try_crossjump_bb): Use PARAM_MAX_CROSSJUMP_EDGES. Fix test for
+ too many outgoing edges from a block.
+ * Makefile.in (cfgcleanup.o): Depend on PARAMS_H.
+ * params.def (max-crossjump-edges): New.
+ * doc/invoke.texi: Document it.
+
+2003-02-15 Richard Henderson <rth@redhat.com>
+
+ * recog.c (split_all_insns): Include new blocks in life update;
+ do a global life update.
+
+2003-02-15 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/mingw32.h (LIBGCC_SPEC): Add libmingwex.a.
+ Update copyright.
+ * config/i386/cygwin.h (LIBGCC_SPEC): Add libmingwex.a for
+ -mno-cygwin case.
+
+2003-02-14 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR optimization/7702
+ * reload1.c (reload_cse_simplify_set): Honor
+ CANNOT_CHANGE_MODE_CLASS.
+
+2003-02-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mn10300/mn10300.c (mn10300_wide_const_load_uses_clr): New
+ function.
+ * config/mn10300/mn10300-protos.h: Declare it.
+ * config/mn10300/mn10300.md (movdi, movdf): Use it to compute
+ attribute cc of instructions that may use clr.
+
+2003-02-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * simplify-rtx.c (simplify_binary_operation): Simplify ~y when
+ (x - (x & y)) is found.
+
+2003-02-14 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Fix typo.
+ * configure: Regenerate.
+
+2003-02-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*iorsi2_and_1_lshiftrt_1): New.
+
+2003-02-13 Adam Nemet <anemet@lnxw.com>
+
+ PR opt/2391
+ * combine.c: Fix spelling in comment.
+ (cached_nonzero_bits): New function.
+ (cached_num_sign_bit_copies): New function.
+ (nonzero_bits_with_known): New macro.
+ (num_sign_bit_copies_with_known): New macro.
+ (nonzero_bits1): Rename from nonzero_bits. Add three new
+ arguments. Change calls from nonzero_bits to
+ nonzero_bits_with_known.
+ (num_sign_bit_copies1): Rename from num_sign_bit_copies. Add
+ three new arguments. Change calls from num_sign_bit_copies to
+ num_sign_bit_copies_with_known.
+ (nonzero_bits): New macro.
+ (num_sign_bit_copies): New macro.
+ (update_table_tick): Don't traverse identical subexpression more
+ than once.
+ (get_last_value_validate): Likewise.
+
+2003-02-13 Zack Weinberg <zack@codesourcery.com>
+
+ * emit-rtl.c (init_emit): Use ggc_alloc for regno_reg_rtx.
+ * function.h (struct emit_status): Length of regno_pointer_align
+ and x_regno_reg_rtx as seen by gengtype is only x_reg_rtx_no,
+ not regno_pointer_align_length (i.e. length actually used, not
+ length as allocated)
+
+ * config/i386/i386.c (struct stack_local_entry): New.
+ (struct machine_function): Replace huge array with alist.
+ (assign_386_stack_local): Change to match.
+
+2003-02-13 John David Anglin <dave.anglin@nrc-crnc.gc.ca>
+
+ * inclhack.def (hpux_long_double): Tighten select and add bypass
+ regexp.
+ * fixincl.x: Rebuilt.
+
+2003-02-13 Josef Zlomek <zlomekj@suse.cz>
+
+ * cfgcleanup.c (outgoing_edges_match): When there is single outgoing
+ edge and block ends with a jump insn it must be simple jump.
+
+2003-02-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (PREPROCESSOR_DEFINES): Add
+ @TARGET_SYSTEM_ROOT_DEFINE@.
+ * configure.in (PREFIX_INCLUDE_DIR): Don't define if $with_sysroot
+ is specified or if building a cross compiler.
+ (TARGET_SYSTEM_ROOT_DEFINE): Add TARGET_SYSTEM_ROOT_RELOCATABLE
+ if the sysroot is under $exec_prefix.
+ * configure: Regenerated.
+ * cppdefault.h: Use native include paths if TARGET_SYSTEM_ROOT is
+ defined.
+ (struct default_include): Add add_sysroot field.
+ (cpp_SYSROOT): Declare.
+ * cppdefault.c (cpp_include_defaults): Fill in add_sysroot
+ field.
+ (cpp_SYSROOT): New variable.
+ * cppinit.c (cpp_create_reader): Initialize
+ CPP_OPTION (pfile, sysroot).
+ (init_standard_includes): Handle add_sysroot. Do not
+ add unrelocated copies of relocated directories.
+ (COMMAND_LINE_OPTIONS): Add -isysroot.
+ (cpp_handle_option): Handle -isysroot.
+ * cpplib.h (struct cpp_options): Add sysroot member.
+ * gcc.c (The Specs Language): Update description of %I.
+ (target_system_root_changed): New variable.
+ (process_command): Conditionalize make_relative_prefix call
+ on !VMS and TARGET_SYSTEM_ROOT_RELOCATABLE. Set
+ target_system_root_changed.
+ (do_spec_1): Add -isysroot to %I.
+ * doc/invoke.texi (Spec Files): Update description of %I.
+ * doc/install.texi (--with-sysroot): Update comment about
+ relocation.
+
+2003-02-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-02-13 Robert Lipe <robertlipe@usa.net>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific): Update three SCO-related URLs.
+
+2003-02-13 Andreas Schwab <schwab@suse.de>
+
+ * cgraph.c (SET_NPREDECESORS): Add intermediate cast to size_t.
+ Parenthesize properly.
+ (NPREDECESORS): Parenthesize properly.
+
+2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * timevar.h (POP_TIMEVAR_AND_RETURN): New macro.
+
+2003-02-12 Roger Sayle <roger@eyesopen.com>
+
+ * config/i386/i386.md (UNSPEC_FPATAN): New UNSPEC constant.
+ (atan2sf3, atan2df3, atan2xf3, atan2tf3): New patterns.
+
+ * reg-stack.c (subst_stack_regs_pat): Add support for binary
+ UNSPEC instructions (e.g. "fpatan").
+
+2003-02-12 Mike Stump <mrs@apple.com>
+
+ * varray.c (element_size): Remove.
+ (uses_ggc): Remove.
+ (element): Add.
+ (varray_init): Use new interface.
+ (varray_grow): Use new interface.
+ (varray_clear): Use new interface.
+
+2003-02-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.h: Add casts to the arguments of the following
+ macros: evfsabs, evfsnabs, evfsneg, evfsadd, evfssub, evfsmul,
+ evfsdiv, evfscfui, evfscfsi evfscfuf evfscfsf, evfsctui, evfsctsi,
+ evfsctuf, evfsctsf, evfsctuiz, evfsctsiz, __ev_get_upper*,
+ __ev_get_lower*, __ev_get_u32, __ev_get_s32, __ev_get_fs,
+ __ev_get_u16, __ev_get_s16.
+
+2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-02-12 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-a-time
+ (OBJS): Add cgraph.o
+ (cgraph.o): New.
+ * c-decl.c (expand_body_1): Break out from ...
+ (expand_body): This one; change calling convention
+ (finish_function): Move some of expand_body logic here.
+ (c_expand_deferred_function): Update call of expand_body
+ (c_expand_stmt): Use c_expand_body_1.
+ * c-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
+ * c-objc-commin.c (c_objc_common_finish_file): Use callgraph code.
+ * c-tree.h (c_expand_body): Declare.
+ * cgraph.c: New file.
+ * flags.h (flag_unit_at_a_time): Declare.
+ * langhooks.h (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION,
+ LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION,
+ LANG_HOOKS_CALLGRAPH_INITIALIZER): New macros.
+ * langhooks.h (struct lang_hooks_for_callgraph): New.
+ (struct lang_hooks): Add callgraph field.
+ * toplev.c (flag_unit_at_a_time): New.
+ (lang_independent_options): Add flag_unit_at_a_time.
+ (process_options): Disable unit-at-a-time mode for frontends not
+ supporting callgraph.
+ * tree-inline.c (typedef struct inline_data): Add "decl"
+ (expand_call_inline): Update callgraph.
+ (optimize_inline_calls): Set id.decl.
+ * tree.h (cgraph_finalize_function, cgraph_finalize_compilation_unit,
+ cgraph_create_edges, dump_cgraph, cgraph_optimize, cgraph_remove_call
+ cgraph_calls_p): Declare.
+ * invoke.texi (-funit-at-a-time): Document.
+
+2003-02-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.h: Fix misc formatting.
+ (__ev_create_ufix32_fs): Cast ev argument.
+ (__ev_create_sfix32_fs): Same.
+ (__ev_get_sfix32_fs_internal): Cast arguments to builtins.
+ (__ev_get_ufix32_fs_internal): Same.
+
+2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
+
+ * doc/tm.texi (MODIFY_JNI_METHOD_CALL): Document.
+ * config/i386/cygwin.h (MODIFY_JNI_METHOD_CALL): New macro.
+
+2003-02-12 Zack Weinberg <zack@codesourcery.com>
+
+ * cpplib.c (do_include_common): Move warnings for
+ #include_next and #import out to callers. Use early-return
+ instead of nested ifs. Don't do check_eol here.
+ (parse_include): Do check_eol here with the rest of the
+ parsing stuff.
+ (do_include_next, do_import): Now handle warnings.
+
+2003-02-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific): Update AVR- and Darwin-related URLs.
+
+2003-02-12 Jan Hubicka <jh@suse.cz>
+
+ * predict.c (estimate_probability): Fix roundoff error.
+
+2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Don't handle 65535.
+ (two peephole2): New.
+
+2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (several peephole2): Replace
+ find_regno_note with peep2_reg_dead_p.
+
+2003-02-11 Richard Henderson <rth@redhat.com>
+
+ * gcse.c (lookup_set): Remove unused argument PAT. Update
+ both callers.
+
+2003-02-11 Geoffrey Keating <geoffk@apple.com>
+
+ * diagnostic.c (real_abort): New.
+ (diagnostic_report_diagnostic): Call real_abort on error.
+ * diagnostic.h (diagnostic_abort_on_error): New.
+ (struct diagnostic_context): Add abort_on_error field.
+ * toplev.c (setup_core_dumping): New.
+ (decode_d_option): Handle 'H' case.
+ * doc/invoke.texi (Debugging Options): Document -dH.
+
+2003-02-11 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.in: Remove pointless setting of CXXFLAGS for dejagnu
+ which refers to obsolete directories.
+
+2003-02-11 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/linux.h (TARGET_C99_FUNCTIONS): New.
+
+2002-10-21 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (contains_128bit_aligned_vector_p): New function.
+ (ix86_function_arg_boundary): Properly align vector modes.
+
+2003-02-11 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.md (set_frame_ptr): Change rtl to set reg a7.
+ * config/xtensa/xtensa.c (xtensa_reorg): Search for UNSPECV_SET_FP
+ as a SET pattern.
+
+2003-02-11 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c: Fix failure caused by commiting wrong patch.
+
+2003-02-11 Dale Johannesen <dalej@apple.com>
+ * ra-build.c (compare_and_free_webs): Relax checking.
+ * config/rs6000/darwin.h (HOT_TEXT_SECTION_NAME): Define.
+ (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Define.
+
+2003-02-11 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR optimization/9651
+ * rtlanal.c (may_trap_p): Handle FIX.
+
+2003-02-11 Dave Jones <davej@codemonkey.org.uk>
+
+ * config/i386/i386.c (override_options): Define c3-2 as a 686 with SSE.
+ * doc/invoke.texi: Extra alias.
+
+2003-02-11 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/host-darwin.c: Fix comment.
+
+2003-02-11 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md (divmodsi4): Use register_operand
+ predicate for mod result.
+
+2003-02-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * inclhack.def (hpux_long_double, hpux10_ctype_declarations1,
+ hpux10_ctype_declarations2, hpux_ctype_macros): New hacks.
+ * fixincl.x: Rebuilt.
+ * tests/base/stdlib.h: Update.
+ * tests/base/ctype.h: New file.
+
+2003-02-11 Jan Hubicka <jh@suse.cz>
+
+ * emit-rtl.c (emit_copy_of_insn_after): Copy insn recog cache too.
+
+2003-02-11 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_movstr): Fail if esi or edi
+ appropriated as globals.
+ (ix86_expand_clrstr): Similarly.
+ * config/i386/i386.md (cmpstrsi): Similarly.
+
+2003-02-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Add a case of 255.
+
+2003-02-11 Roger Sayle <roger@eyesopen.com>
+
+ * optabs.h (enum optab_index): Add new OTI_pow and OTI_atan2.
+ (pow_optab, atan2_optab): Define corresponding macros.
+ * optabs.c (init_optabs): Initialize pow_optab and atan2_optab.
+ * genopinit.c (optabs): Implement pow_optab and atan2_optab
+ using pow?f3 and atan2?f3 patterns.
+ * builtins.c (expand_errno_check): New function to update errno
+ if necessary, split out from expand_builtin_mathfn.
+ (expand_builtin_mathfn): Use expand_errno_check.
+ (expand_builtin_mathfn_2): New function to handle expanding binary
+ math functions, reusing the code in expand_errno_check.
+ (expand_builtin): Handle the pow and atan2 math built-ins,
+ BUILT_IN_{POW,POWF,POWL,ATAN2,ATAN2F,ATAN2L} via the new function
+ expand_builtin_mathfn_2.
+
+ * doc/md.texi: Document new pow?f3 and atan2?f3 patterns.
+
+2003-02-11 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (combine_simplify_rtx): Fix folding of
+ nested float_truncates.
+
+2003-02-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Fix a typo.
+
+2003-02-11 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.mc (return_address_mask): Use CC_REGNUM for the condition code
+ register number.
+
+2003-02-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ gtuleu_operator.
+ * config/h8300/h8300.c (gtuleu_operator): New.
+ * config/h8300/h8300.h (PREDICATE_CODES): Add gtuleu_operator.
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-02-11 Jan Hubicka <jh@suse.cz>
+
+ * sched-ebb.c (schedule_ebbs): Do not verify_flow_info.
+
+2003-02-11 Jan Hubicka <jh@suse.cz>
+
+ * predict.c (choose_function_section): Choose sections correctly.
+
+2003-02-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * reload1.c (first_label_num): New.
+ (reload): Index offsets_known_at and offsets_at using difference of
+ label number and first label number. Don't use offset pointers.
+ (set_label_offsets, set_initial_label_offsets): Likewise.
+
+2003-02-10 Roger Sayle <roger@eyesopen.com>
+
+ * mips-tfile.c (init_file): Add missing initializers in the
+ "#ifdef __alpha" case.
+ (file_offset, max_file_offset): Declare as unsigned long.
+ (write_varray): Cast to "unsigned long" in comparisons against
+ either file_offset or max_file_offset.
+ (write_object): Likewise.
+ (read_seek): Likewise.
+ (copy_object): Likewise. Declare "ifd" as int to match its use
+ in add_ext_symbol, and avoid signed/unsigned conditional warning.
+
+2003-02-10 Nick Clifton <nickc@redhat.com>
+ Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Do not
+ override options which have been specified on the command line.
+
+2003-02-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (abssf2): New.
+ (*abssf2_h8300): Likewise.
+ (*abssf2_h8300hs): Likewise.
+
+2003-02-10 Phil Edwards <pme@gcc.gnu.org>
+
+ * tree.c (build_tree_list): Fix parameter names in comment.
+
+2003-02-10 Janis Johnson <janis187@us.ibm.com>
+
+ * config/rs6000/ppc64-fp.c: New file.
+ * config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Add ppc64-fp.c.
+
+2003-02-10 Josef Zlomek <zlomekj@suse.cz>
+
+ * Makefile.in (bb-reorder.o): Add dependency on $(FIBHEAP_H).
+ * bb-reorder.c (make_reorder_chain): Deleted.
+ (make_reorder_chain_1): Deleted.
+ (find_traces): New function.
+ (rotate_loop): New function.
+ (mark_bb_visited): New function.
+ (find_traces_1_round): New function.
+ (copy_bb): New function.
+ (bb_to_key): New function.
+ (better_edge_p): New function.
+ (connect_traces): New function.
+ (copy_bb_p): New function.
+ (get_uncond_jump_length): New function.
+ (reorder_basic_blocks): Use new functions (Software Trace Cache).
+ * cfgcleanup.c (outgoing_edges_match): Enable crossjumping across loop
+ boundaries.
+
+2003-02-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.c (bdesc_2arg): Change spe_evxor to xorv2si3.
+
+2003-02-09 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * tree.h (struct tree_decl): Remove unused live_range_rtl field.
+ (DECL_LIVE_RANGE_RTL): Remove.
+
+2003-02-10 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/aof.h, config/arm/aout.h, config/arm/arm-modes.def,
+ config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h,
+ config/arm/arm.md, config/arm/cirrus.md, config/arm/coff.h,
+ config/arm/conix-elf.h, config/arm/ecos-elf.h, config/arm/elf.h,
+ config/arm/freebsd.h, config/arm/linux-elf.h,
+ config/arm/linux-gas.h, config/arm/netbsd-elf.h,
+ config/arm/netbsd.h, config/arm/pe.c, config/arm/pe.h,
+ config/arm/rtems-elf.h, config/arm/semi.h, config/arm/semiaof.h,
+ config/arm/strongarm-coff.h, config/arm/strongarm-elf.h,
+ config/arm/strongarm-pe.h, config/arm/uclinux-elf.h,
+ config/arm/unknown-elf-oabi.h, config/arm/unknown-elf.h,
+ config/arm/xscale-elf.h: Replace occurances of "GNU CC" with "GCC"
+ and reformat as appropriate.
+
+2003-02-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/clzsi2.c: Remove.
+ * config/h8300/ctzsi2.c: Likewise.
+ * config/h8300/paritysi2.c: Likewise.
+ * config/h8300/popcountsi2.c: Likewise.
+ * config/h8300/t-h8300 (LIB2FUNCS_EXTRA): Remove clzsi2,
+ ctzsi2, paritysi2, and popcountsi2.
+
+2003-02-10 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+ PR c/7741
+ * c-decl.c (duplicate_decls): Discard the initializer of the
+ new decl when the types are conflicting.
+
+2003-02-10 Josef Zlomek <zlomekj@suse.cz>
+
+ * Makefile.in (sreal.o): Added.
+ (predict.o): Depends on sreal.h instead of real.h.
+ * sreal.c: New file.
+ * sreal.h: New file.
+ * predict.c: Use sreal.c instead of real.c.
+
+2003-02-10 Nick Clifton <nickc@redhat.com>
+
+ * Contributed support for the Cirrus EP9312 "Maverick"
+ floating point co-processor. Written by Aldy Hernandez
+ <aldyh@redhat.com>.
+ (config/arm/arm.c): Add Cirrus support.
+ (config/arm/arm.h): Likewise.
+ (config/arm/aout.h): Likewise.
+ (config/arm/arm.md): Likewise.
+ (config/arm/arm-protos.h): Likewise.
+ (config.gcc): Likewise.
+ (doc/invoke.texi): Describe new -mcpu value and new
+ -mcirrus-fix-invalid-insns switch,
+ (cirrus.md): New file.
+
+2003-02-10 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (combine_simplify_rtx): Simplify using
+ (float_truncate (float x)) is (float x)
+ (float_extend (float_extend x)) is (float_extend x).
+
+2003-02-10 Alan Modra <amodra@bigpond.net.au>
+
+ * calls.c (try_to_integrate): Tidy stack_usage_map access.
+ (emit_library_call_value_1): Likewise. Formatting.
+ (store_one_arg): Likewise.
+
+2003-02-09 Nick Clifton <nickc@redhat.com>
+ Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.md: spe_evlhhesplat, spe_evlhhossplat,
+ spe_evlhhousplat, spe_evlwhsplat, spe_evlwwsplat, spe_evldd,
+ spe_evldh, spe_evldw, spe_evlwhe, spe_evlwhos, spe_evlwhou,
+ spe_evstdd, spe_evstdh, spe_evstdw, spe_evstdwx, spe_evstwhe,
+ spe_evstwho, spe_evstwwe, spe_evstwwo: Fix syntax to match newest
+ docs. Add range test for immediate value.
+
+2003-02-09 Aldy Hernandez <aldyh@redhat.com>
+
+ Rename spe_evxor to xorv2si3.
+ (xorv4hi3): New.
+ (xorv1di3): New.
+
+2003-02-10 Glen Nakamura <glen@imodulo.com>
+
+ * doc/extend.texi (C++98 Thread-Local Edits): Add missing @item
+ tag.
+
+2003-02-10 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (vector_move_operand): New predicate.
+ (ix86_expand_vector_move): Be happy about 0.
+ * i386.h (PREDICATE_CODES): Add sse-move_operand.
+ * i386.md (mov*_internal): Add 'C' alternative.
+
+2003-02-09 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (floathi*): Deal with SSE.
+
+2003-02-09 Jan Hubicka <jh@suse.cz>
+
+ * simplify-rtx.c (simplify_unary_operation,
+ simplify_binary_operation): Deal with vector modes
+ (simplify_ternary_operation): Deal with no-op VEC_MERGE.
+
+2003-02-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * toplev.c (rest_of_compilation): Recompute register usage after
+ split_all_insns.
+
+2003-02-09 Richard Henderson <rth@redhat.com>
+
+ * libgcc-std.ver (__clztf2): New.
+ (__ctztf2, __popcounttf2, __paritytf2): New.
+ * libgcc2.c (__clzSI2, __clzDI2, __ctzSI2, __ctzDI2, __popcountSI2,
+ __popcountDI2, __paritySI2, __parityDI2): Use UWmode and UDWmode;
+ adjust code to match the different type sizes.
+ * libgcc2.h (__clzSI2, __ctzSI2, __popcountSI2, __paritySI2,
+ __clzDI2, __ctzDI2, __popcountDI2, __parityDI2): New macros.
+
+ * optabs.c (init_integral_libfuncs): Don't hard-code SImode and
+ TImode; select word_mode and twice that.
+ (init_floating_libfuncs): Don't hard-code SFmode and TFmode;
+ select the modes from float, double, and long double.
+ (init_optabs): Remove duplicate initializations.
+
+2003-02-09 Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+ * doc/install.texi: Squeeze and streamline section on
+ testing and regression checking.
+
+2003-02-09 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (ahi?v*3): Set third operand type to TImode.
+ * i386.c (ix86_expand_binop_builtin): Extend operand when needed.
+
+ * simplify-rtx.c (simplify_subreg): Fix conversion from vector into
+ integer mode.
+
+ * rtl.def (VEC_MERGE, VEC_SELECT, VEC_CONCAT, VEC_DUPLICATE):
+ Change code so they are arithmetic expressions now.
+ * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation,
+ simplify_ternary_operation): Deal with VEC_* expressions.
+
+ * i386.md (vmaskcmp, pinsrw, movd patterns): Fix RTL representation.
+
+2003-02-08 Jan Hubicka <jh@suse.cz>
+
+ * cfgrtl.c (verify_flow_info): Use control_flow_insn_p.
+ * reload1.c (fixup_abnormal_edges): Split basic blocks when EH edges
+ possibly got duplicated.
+
+2003-02-08 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (override_options): Turn off explicit
+ relocs until post-peep2 code duplication resolved.
+
+2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * optabs.c (expand_unop): Widen clz properly when clz is done
+ via libcall.
+
+2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/clzsi2.c: Replace "GNU CC" with "GCC".
+ * config/h8300/crti.asm: Likewise.
+ * config/h8300/crtn.asm: Likewise.
+ * config/h8300/ctzsi2.c: Likewise.
+ * config/h8300/fixunssfsi.c: Likewise.
+ * config/h8300/h8300-protos.h: Likewise.
+ * config/h8300/h8300.c: Likewise.
+ * config/h8300/h8300.h: Likewise.
+ * config/h8300/h8300.md: Likewise.
+ * config/h8300/paritysi2.c: Likewise.
+ * config/h8300/popcountsi2.c: Likewise.
+ * config/h8300/rtems.h: Likewise.
+
+2003-02-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * doc/invoke.texi: Documentation for my previous commit.
+ * doc/passes.texi: Ditto.
+
+2003-02-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloop.h (fix_loop_placement, can_duplicate_loop_p,
+ duplicate_loop_to_header_edge, loopify, remove_path, split_loop_bb):
+ Declare.
+ (DLTHE_FLAG_UPDATE_FREQ): New.
+ * cfgloopmanip.c (duplicate_loop, duplicate_subloops, copy_loops_to,
+ loop_redirect_edge, loop_delete_branch_edge, copy_bbs, remove_bbs,
+ rpe_enum_p, find_branch, alp_enum_p, add_loop, fix_loop_placements,
+ fix_bb_placement, fix_bb_placements, place_new_loop,
+ scale_loop_frequencies, scale_bbs_frequencies, record_exit_edges):
+ New static functions.
+ (fix_loop_placement, can_duplicate_loop_p,
+ duplicate_loop_to_header_edge, loopify, remove_path, split_loop_bb):
+ New functions.
+
+ * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize,
+ unswitch_loops): Declare.
+ * loop-init.c: New file.
+ * loop-unswitch.c: New file.
+ * Makefile.in (loop-init.o, loop-unswitch.o): New.
+ * params.def (PARAM_MAX_UNSWITCH_INSNS, PARAM_MAX_UNSWITCH_LEVEL): New.
+ * toplev.c (DFI_loop2): New dump.
+ (flag_unswitch_loops): New.
+ (lang_independent_options): Add it.
+ (rest_of_compilation): Call new loop optimizer.
+ (parse_options_and_default_flags): Turn flag_unswitch_loops on with -O3.
+
+2003-02-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/clzsi2.c: New.
+ * config/h8300/ctzsi2.c: Likewise.
+ * config/h8300/paritysi2.c: Likewise.
+ * config/h8300/popcountsi2.c: Likewise.
+ * config/h8300/t-h8300 (LIB2FUNCS_EXTRA): Add above files.
+
+2003-02-07 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.h (CLZ_DEFINED_VALUE_AT_ZERO): Define.
+ * config/rs6000/rs6000.md (clzsi2): Rename from cntlzw2.
+ (ctzsi2): New pattern.
+ (ffssi2): Use clz instead of unspec.
+ (clzdi2): Rename from cntlzd2.
+ (ctzdi2): New pattern.
+ (ffsdi2): Use clz instead of unspec.
+
+2003-02-07 Loren James Rittle <ljrittle@acm.org>
+
+ * config/alpha/freebsd.h (LINK_SPEC): Weaken error to notice.
+ * config/ia64/freebsd.h (LINK_SPEC): Likewise.
+ * config/sparc/freebsd.h (LINK_SPEC): Likewise.
+ * config/i386/freebsd.h (LINK_SPEC): Add clause to mirror other arches.
+
+2003-02-07 Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+ * doc/trouble.texi: Document pitfalls of two-stage name lookup.
+
+2003-02-07 Richard Henderson <rth@redhat.com>
+
+ PR 9226
+ * gcse.c (local_cprop_find_used_regs): New.
+ (local_cprop_pass): Use it.
+
+2003-02-07 Fred Fish <fnf@intrinsity.com>
+
+ * mips-tfile.c (parse_def): Parenthesize assignments to fix
+ precedence bugs.
+
+2003-02-07 Segher Boessenkool <segher@koffie.nl>
+
+ * genoutput.c (output_get_insn_name): Handle NOOP_MOVE_INSN_CODE.
+
+2003-02-07 Roger Sayle <roger@eyesopen.com>
+
+ * builtin-types.def (BT_FN_FLOAT_FLOAT_FLOAT): New built-in type.
+ (BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE): Likewise.
+ (BT_FN_DOUBLE_DOUBLE_DOUBLE): Likewise.
+ * builtins.def: Define pow, powf, powl, atan2, atan2f and atan2l
+ builtin functions (and their __builtin_* variants).
+ * builtins.c (mathfn_built_in): Handle missing log{,f,l} cases.
+ (expand_builtin): Don't expand log{,f,l}, pow{,f,l} or atan2{,f,l}
+ when not optimizing.
+
+ * doc/extend.texi: Document new pow and atan2 builtins, and
+ their float and long double variants. Realphabetize builtins.
+
+2003-02-07 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (sse2_nandv2di3): Fix.
+
+2003-03-07 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/i386.h (MS_AGGREGATE_RETURN): New define.
+ * config/i386/cygwin.h (MS_AGGREGATE_RETURN): Override default
+ definition.
+ * config/i386/i386.h (ix86_return_in_memory): Return aggregate
+ types of up to 8 bytes via registers if MS_AGGREGATE_RETURN.
+
+2003-02-07 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (movdi_rex64_1): Fix mmx<->int move opcode.
+
+2003-02-07 Daniel Berlin <dberlin@dberlin.org>
+
+ * cfg.c (dump_flow_info): Add back accidently deleted line.
+
+2003-02-07 Andrey Petrov <petrov@netbsd.org>
+
+ * optabs.c (expand_float): Search wider integer modes first.
+
+2003-02-07 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.h (LIBGCC2_WORDS_BIG_ENDIAN): Set this
+ based on preprocessor flag.
+
+2003-02-07 Roger Sayle <roger@eyesopen.com>
+ Richard Henderson <rth@redhat.com>
+
+ * gcse.c (implicit_sets): New.
+ (compute_hash_table_work): Include them in hash table.
+ (find_implicit_sets, fis_get_condition): New.
+ (one_cprop_pass): Allocate and free implicit_sets; call
+ find_implicit_sets before building hash table.
+
+2003-02-07 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/t-netbsd (USER_H): Revert previous change.
+
+2003-02-07 Gabor Greif <ggreif@lucent.com>
+
+ * doc/c-tree.texi (Namespaces): Fix typo.
+
+2003-02-07 Jan Hubicka <jh@suse.cz>
+
+ * regrename.c (do_replace, find_oldest_value_reg,
+ copyprop_hardreg_forward_1): Update register attributes.
+
+2003-02-06 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (VLA_PTR_CREATE, VLA_PTR_EXPAND, VLA_PTR_ADD,
+ VLA_HWINT_CREATE, VLA_HWINT_EXPAND, VLA_HWINT_ADD): Use temporay
+ variables starting with underscore.
+ (struct unit_usage): New structure.
+ (unit_usages, cycle_alt_unit_usages): New global variables.
+ (check_unit_distribution_in_reserv): Remove it.
+ (store_alt_unit_usage): New function.
+ (check_regexp_units_distribution): Rewrite it.
+
+2003-02-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * config.gcc (hppa*-*-linux*): Set MASK_NO_SPACE_REGS in
+ target_cpu_default.
+ * pa.c (attr_length_call): Add 8 to call length (long indirect PA 1.X)
+ if not MASK_NO_SPACE_REGS.
+ (output_call): Adjust return pointer, don't load new space register
+ into %sr0, and use %sr4 for call if TARGET_NO_SPACE_REGS is true.
+ (pa_asm_output_mi_thunk): Don't load new space register into %sr0 if
+ TARGET_NO_SPACE_REGS is true.
+ * pa.md (return_external_pic): Add TARGET_NO_SPACE_REGS to insn
+ conditions.
+ (epilogue): Always use return_internal if TARGET_NO_SPACE_REGS is true.
+ (interspace_jump): Add new pattern for when TARGET_NO_SPACE_REGS is
+ true. Use bve when TARGET_64BIT is true.
+
+2003-02-06 Richard Henderson <rth@redhat.com>
+
+ * combine.c (nonzero_bits): Fix double break.
+
+2003-02-06 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Richard Henderson <rth@redhat.com>
+
+ PR c/9530
+ * config/i386/i386.c (ix86_function_ok_for_sibcall): Forbid sibcalls
+ from functions that return a float to functions that don't.
+
+2003-02-06 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_inter_unit_moves): New variable.
+ (ix86_secondary_memory_needed): Fix 64bit case, honor
+ TARGET_INTER_UNIT_MOVES
+ * i386.h (x86_inter_unit_moves): Declare.
+ (TARGET_INTER_UNIT_MOVES): New macro.
+ * i386.md (movsi_1): Cleanup constraints; disable
+ when not doing inter-unit moves.
+ (movsi_1_nointernunit): New.
+ (movdi_1_rex64): Fix constraints; deal with SSE->GPR moves.
+ (movdi_1_rex64_nointerunit): New.
+ (mivsf_1): disable when not doing inter-unit moves.
+ (movsf_1_nointerunit): New.
+
+ * basic-block.h (inside_basic_block_p): Declare.
+ * cfgbuild.c (inside_basic_block_p): Make global.
+ * haifa-sched.c (unlink_other_notes): Deal with NOT_INSN_BASIC_BLOCK.
+ * scheudle-ebb.c (schedule_ebb): Return last basic block of trace;
+ update CFG.
+ (fix_basic_block_boundaries, add_missing_bbs): New.
+ (rank): Use profile.
+ (scheudle_ebbs): Rely on CFG; update coments.
+
+2003-02-05 Geoffrey Keating <geoffk@apple.com>
+
+ * Makefile.in (host_hook_obj): New.
+ (OBJS): Add $(host_hook_obj).
+ (host_default.o): New rule.
+ * config.gcc (host_hook_obj): New, default to host-default.o.
+ (powerpc-*-darwin*): Use host-darwin.o.
+ (out_host_hook_obj): New.
+ * configure: Regenerate.
+ * configure.in: Print information about out_host_hook_obj, substitute
+ into output files.
+ * host-default.c: New file.
+ * hosthooks.h: New file.
+ * toplev.c (general_init): Call host_hooks.extra_signals.
+ * config/rs6000/host-darwin.c: New file.
+ * config/rs6000/x-darwin: New file.
+ * doc/hostconfig.texi: Add documentation for new host hook.
+ Rearrange existing documentation.
+
+2003-02-05 Roger Sayle <roger@eyesopen.com>
+
+ * dwarf2out.c (mem_loc_descriptor): Replace ASM_SIMPLIFY_DWARF_ADDR
+ with *targetm.delegitimize_address.
+ (rtl_for_decl_location): Likewise.
+ * dwarfout.c (output_mem_loc_descriptor): Likewise. Include target.h.
+ * Makefile.in (dwarf2out.c, dwarfout.c): Depend upon $(TARGET_H)
+
+ * config/i386/i386.h (ASM_SIMPLIFY_DWARF_ADDR): Remove definition.
+ * config/i386/i386-protos.h (i386_simplify_dwarf_addr): Remove
+ prototype.
+ * config/i386/i386.c (ix86_delegitimize_address): Renamed from
+ i386_simplify_dwarf_addr. Made static. Prototyped.
+ (TARGET_DELEGITIMIZE_ADDRESS): Update definition from
+ i386_simplify_dwarf_addr to ix86_delegitimize_address.
+ (ix86_find_base_term): Likewise.
+ (maybe_get_pool_constant): Likewise.
+
+ * config/s390/s390.h (ASM_SIMPLIFY_DWARF_ADDR): Remove definition.
+ * config/s390/s390-protos.h (s390_simplify_dwarf_addr): Remove
+ prototype.
+ * config/s390/s390.c (s390_delegitimize_address): Renamed from
+ s390_simplify_dwarf_addr. Made static. Prototyped.
+ (TARGET_DELEGITIMIZE_ADDRESS): Define as s390_delegitimize_address.
+
+2003-02-05 Richard Henderson <rth@redhat.com>
+
+ PR c/8602
+ * integrate.c (output_inline_function): Reset input_filename
+ and lineno from the decl before rest_of_compilation.
+
+2003-02-05 Richard Henderson <rth@redhat.com>
+
+ * defaults.h (CLZ_DEFINED_VALUE_AT_ZERO): New.
+ (CTZ_DEFINED_VALUE_AT_ZERO): New.
+ * doc/rtl.texi, doc/tm.texi: Document them.
+
+ * combine.c (nonzero_bits) [CLZ, CTZ]: Handle the definedness
+ of the value at zero properly.
+ * fold-const.c (tree_expr_nonnegative_p): Likewise.
+ * simplify-rtx.c (simplify_unary_operation): Likewise.
+
+ * config/alpha/alpha.h (CLZ_DEFINED_VALUE_AT_ZERO): New.
+ (CTZ_DEFINED_VALUE_AT_ZERO): New.
+
+ * config/arm/arm.c (TARGET_INIT_BUILTINS): Remove.
+ (TARGET_EXPAND_BUILTIN): Remove.
+ (def_builtin, arm_init_builtins, arm_expand_builtin): Remove.
+ * config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO): New.
+ (enum arm_builtins): Remove.
+ * config/arm/arm.md (UNSPEC_CLZ): Remove.
+ (clzsi2): Rename from clz; use clz instead of unspec.
+ (ctzsi2): New.
+ * config/arm/arm-protos.h: Update.
+
+2003-02-05 Jan Hubicka <jh@suse.cz>
+
+ * i386-protos.h (x86_emit_floatuns): Declare.
+ * i386.c (x86_emit_floatuns): New global function.
+ * i386.md (floatunssisf2, floatunsdisf2,
+ floatunsdidf2): New patterns.
+
+2003-01-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloopmanip.c (force_single_succ_latches): Fix missindentation.
+
+2003-02-05 Hans Boehm <Hans.Boehm@hp.com>
+
+ * config/ia64/unwind-ia64.c: include coretypes.h, tm.h to get
+ config/ia64/linux.h
+
+2003-02-05 Roger Sayle <roger@eyesopen.com>
+
+ * cfgloop.h (flow_bb_inside_loop_p): Correct prototype again.
+
+2003-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR optimization/8555
+ * config/i386/i386.md (sse_mov?fcc split): Handle op2 == op3 case
+ instead of aborting.
+
+2003-02-04 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.md (UNSPEC_BSF): Remove.
+ (ffssi2): Split into cmove and no_cmove insns and splitters;
+ lose pentium float trick for now.
+ (ffssi_1): Add * to name; use CTZ instead of UNSPEC.
+ (ctzsi2, clzsi2, bsr): New.
+
+2003-02-04 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (rtx_needs_barrier): Handle POPCOUNT,
+ UNSPEC_GETF_EXP; remove UNSPEC_POPCNT.
+ * config/ia64/ia64.md (UNSPEC_POPCNT): Remove.
+ (ffsdi2): Use popcount instead of unspec.
+ (popcountdi2): Rename from *popcnt.
+ (ctzdi2, clzdi2, getf_exp_tf): New.
+
+2003-02-04 Kazu Hirata <kazu@cs.umass.edu>
+
+ * genconfig.c (main): Generate CC0_P.
+ * rtl.h (CC0_P): Remove.
+
+2003-02-04 Richard Henderson <rth@redhat.com>
+
+ * libgcc2.h, libgcc2.c (__ffsSI2): New.
+ (__ffsDI2): Rename from __ffsdi2.
+ * mklibgcc.in (lib2funcs): Add _ffssi2.
+
+2003-02-04 Richard Henderson <rth@redhat.com>
+
+ * libgcc2.c (__paritysi2, __paritydi2): Replace last two reduction
+ rounds with a "bit table" lookup.
+
+2003-02-04 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * reload.c (find_reloads): Do not use the mode specified in the insn
+ pattern as reload mode for address operands. Do not generate optional
+ reloads for operands where a mandatory reload was already pushed.
+
+2003-02-04 Richard Henderson <rth@redhat.com>
+
+ * longlong.h [alpha] (count_leading_zeros, count_trailing_zeros): Use
+ builtins instead of inline assembly.
+
+2003-02-04 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR c/9376
+ * libgcc2.c (__subvdi3): Fix typo.
+
+2003-02-04 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (movti_rex64): Fix constraint.
+
+2003-02-04 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (vector push splitters): Fix typo in resolving conflict.
+
+2003-02-04 Rodney Brown <rbrown64@csc.com.au>
+
+ * config/i386/i386.c (x86_function_profiler): Fix typo in format.
+
+2003-02-04 Phil Edwards <pme@gcc.gnu.org>
+
+ * doc/install.texi (*-*-linux-gnu): Mention glibc requirements
+ for recent libstdc++. Remove formatting cruft.
+
+2003-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (dwarf2out_finish): Add AT_comp_dir
+ attribute even if input file name is absolute, but one of the
+ includes is relative.
+
+2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * doc/gcc.texi, doc/gccint.texi, doc/gcov.texi,
+ doc/include/fdl.texi, doc/invoke.texi: Update to GFDL 1.2.
+ * doc/install.texi: Update copyright dates. Update to GFDL 1.2.
+
+2003-02-03 Richard Henderson <rth@redhat.com>
+
+ * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
+ __popcountsi2, __popcountdi2, __paritysi2, __paritydi2): Change
+ return type to "int". Shuffle declarations and undef int trap.
+ * libgcc2.h: Remove their declarations.
+ * optabs.c (expand_unop): Force outmode to int for bitops.
+
+2003-02-03 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (order_regs_for_local_alloc): Order the
+ coprocessor registers before floating-point registers.
+ * config/xtensa/xtensa.h (REG_ALLOC_ORDER): Adjust register numbers
+ to account for a previously removed register.
+ (SPEC_REG_FIRST, SPEC_REG_LAST, SPEC_REG_NUM, COUNT_REGISTER_REGNUM):
+ Delete unused macros.
+
+2003-02-03 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_store_builtin): Always force op1 to register.
+ (mov*_internal): Fix predicates; require one of operands to not be
+ memory.
+ (SSE?MMX move expanders): Fix predicates; force one of operands to
+ register.
+ (SSE/MMX push patterns): Reorganize; fix x86-64 code generation.
+ (movups/movupd/movdqu patterns): Force one of operands to not be
+ memory.
+
+2003-02-03 Roger Sayle <roger@eyesopen.com>
+
+ * hooks.c (hook_rtx_rtx_identity): Generic hook function that
+ takes a single rtx and returns it unmodified.
+ * hooks.h (hook_rtx_rtx_identity): Prototype here.
+ * target.h (struct gcc_target): Add "delegitimize_address"
+ field to target structure.
+ * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Provide default
+ for delegitimize_address target using hook_rtx_rtx_identity.
+ (TARGET_INITIALIZER): Initialize delegitimize_address field
+ using TARGET_DELEGITIMIZE_ADDRESS macro.
+ * simplify-rtx.c (avoid_constant_pool_reference): Handle float
+ extensions of constant pool references. Use delegitimize_address
+ to undo the obfuscation of "-fpic".
+ * Makefile.in (simplify-rtx.o): Add dependency on target.h.
+
+ * config/i386/i386.c (TARGET_DELEGITIMIZE_ADDRESS): Define as
+ i386_simplify_dwarf_addr.
+ (ix86_find_base_term): Simplify using i386_simplify_dwarf_addr.
+ (maybe_get_pool_constant): Likewise.
+
+2003-02-03 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): Fix setcc sign bit case.
+
+2003-02-03 Jan Hubicka <jh@suse.cz>
+
+ * regclass.c (cannot_change_mode_set_regs): Correct argument order.
+
+2003-02-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * mips/_tilib.c: Don't include tsystem.h or defaults.h. Don't
+ define LIBGCC2_WORDS_BIG_ENDIAN. Include coretypes.h and tm.h.
+
+2003-02-02 Andreas Schwab <schwab@suse.de>
+
+ * varasm.c (asm_output_aligned_bss): Declare as possibly unused.
+
+2003-02-02 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (sibcall_epilogue): Set the "conds" to "clob".
+ (epilogue_insns): Likewise.
+
+2003-02-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * doc/install.texi (hppa*-hp-hpux11*): Update installation notes.
+
+2003-02-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa-protos.h (attr_length_millicode_call): Remove second argument.
+ (attr_length_indirect_call, attr_length_indirect_call,
+ attr_length_save_restore_dltp): New prototypes.
+ * pa.c (attr_length_millicode_call): Remove second argument. Check
+ INSN_ADDRESSES_SET_P in distance calculation.
+ (output_millicode_call): Check INSN_ADDRESSES_SET_P before using
+ INSN_ADDRESSES.
+ (attr_length_call): Check INSN_ADDRESSES_SET_P in distance calculation.
+ (output_call): Check INSN_ADDRESSES_SET_P before using INSN_ADDRESSES.
+ Call attr_length_call directly.
+ (attr_length_indirect_call, output_indirect_call,
+ attr_length_save_restore_dltp): New functions.
+ * pa.md (attr_length_millicode_call): Drop second argument from all
+ patterns.
+ (return_internal_pic): Delete.
+ (return_external_pic): Remove use of PIC register and pic operand and
+ flag checks.
+ (epilogue): Use return_internal for both normal and pic code.
+ (call, call_value): Emit new 32-bit pic patterns for symref and
+ indirect calls. Remove uses for arg pointer and pic register.
+ (call_symref_pic, call_symref_pic_post_reload, call_reg_pic,
+ call_reg_pic_post_reload, call_val_symref_pic,
+ call_val_symref_pic_post_reload, call_val_reg_pic,
+ call_val_reg_pic_post_reload): New pre and post reload insn patterns.
+ Implement define_split and define_peephole2 patterns for pre reload
+ patterns.
+ (call_symref_64bit, call_internal_reg_64bit, call_value_symref_64bit,
+ call_value_internal_reg_64bit): Shorten names.
+ (all call patterns): Explicitly indicate registers used and clobbered.
+ Use attr_length_indirect_call and attr_length_save_restore_dltp for
+ attribute length calculation. Move code generation for indirect calls
+ to output_indirect_call.
+ (sibcall, sibcall_value): Don't restore PIC register.
+ (exception_receiver, builtin_setjmp_receiver): Add blockage after PIC
+ register retore.
+
+2003-02-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Testing): Simplify and compress instructions
+ concerning Dejagnu.
+
+2003-02-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * collect2.c (pexecute_pid): Rename to pid.
+ (collect_wait, collect_execute, scan_prog_file, scan_libraries): Use
+ pid.
+
+2003-02-01 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/extend.texi (Function Attributes): Remove documentation
+ for PowerPC Windows NT function attributes..
+
+2003-02-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * dwarf2out.c (gen_type_die): Check for typedefs before calling
+ for TYPE_MAIN_VARIANT.
+
+2003-02-01 Richard Henderson <rth@redhat.com>
+
+ * libgcc2.c: Include auto-host.h.
+ (ATTRIBUTE_HIDDEN): New.
+ (__clz_tab): Don't declare here for clz and ctz.
+ (__clzsi2, __clzdi2): Use count_leading_zeros.
+ (__ctzsi2, __ctzdi2): Use count_trailing_zeros.
+ (__popcount_tab): Mark ATTRIBUTE_HIDDEN.
+ (__paritysi2, __paritydi2): Use shifts instead of __popcount_tab.
+ * longlong.h (__clz_tab): Mark ATTRIBUTE_HIDDEN.
+
+2003-02-01 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.md (addsi_1_zext splitter): Add TARGET_64BIT
+ to the conditional.
+ (ashlsi3_1_zext splitter): Likewise.
+
+2003-02-01 Richard Henderson <rth@redhat.com>
+
+ * optabs.c (expand_unop): Use word_mode for outmode of bit scaners.
+ * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
+ __popcountsi2, __popcountdi2, __paritysi2 __paritydi2): Change
+ return type to Wtype.
+
+ * libgcc-std.ver (GCC_3.4): Fix inheritance.
+
+ * config/i386/i386.md (ffssi2): Use nonimmediate_operand for
+ expander input constraint.
+
+2003-02-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ * optabs.h (optab_index): Add OTI_clz, OTI_ctz, OTI_popcount and
+ OTI_parity.
+ (clz_optab, ctz_optab, popcount_optab, parity_optab): New.
+ * optabs.c (widen_clz, expand_parity): New.
+ (expand_unop): Handle clz and parity. Hardcode SImode as outmode
+ for libcalls to clz, ctz, popcount, and parity.
+ (init_optabs): Init clz_optab, ctz_optab, popcount_optab and
+ parity_optab, and set up libfunc handlers.
+ * libgcc2.c (__clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
+ __popcountsi2, __popcountdi2, __paritysi2 __paritydi2,
+ __popcount_tab): New.
+ * libgcc2.h: Declare them.
+ * libgcc-std.ver (GCC_3.4): Add new functions from libgcc2.c.
+ * genopinit.c (optabs): Add clz_optab, ctz_optab, popcount_optab
+ and parity_optab.
+ * builtin-types.def (BT_FN_INT_LONG, BT_FN_INT_LONGLONG): New.
+ * builtins.def (BUILT_IN_CLZ, BUILT_IN_CTZ, BUILT_IN_POPCOUNT,
+ BUILT_IN_PARITY, BUILT_IN_FFSL, BUILT_IN_CLZL, BUILT_IN_CTZL,
+ BUILT_IN_POPCOUNTL, BUILT_IN_PARITYL, BUILT_IN_FFSLL,
+ BUILT_IN_CLZLL, BUILT_IN_CTZLL, BUILT_IN_POPCOUNTLL,
+ BUILT_IN_PARITYLL): New.
+ * builtins.c (expand_builtin_unop): Rename from expand_builtin_ffs
+ and add optab argument.
+ (expand_builtin): Expand BUILT_IN_{FFS,CLZ,POPCOUNT,PARITY}*.
+ * tree.def (CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, PARITY_EXPR): New.
+ * expr.c (expand_expr): Handle them.
+ * fold-const.c (tree_expr_nonnegative_p): Likewise.
+ * rtl.def (CLZ, CTZ, POPCOUNT, PARITY): New.
+ * reload1.c (eliminate_regs): Handle them.
+ (elimination_effects): Likewise.
+ * function.c (instantiate_virtual_regs_1): Likewise
+ * genattrtab.c (check_attr_value): Likewise.
+ * simplify-rtx.c (simplify_unary_operation): Likewise.
+ * c-common.c (c_common_truthvalue_conversion): Handle POPCOUNT_EXPR.
+ * combine.c (combine_simplify_rtx): Handle POPCOUNT and PARITY.
+ (nonzero_bits): Handle CLZ, CTZ, POPCOUNT and PARITY.
+ * config/alpha/alpha.md (clzdi2, ctzdi2, popcountdi2): New.
+ * config/arm/arm.c (arm_init_builtins): Rename __builtin_clz to
+ __builtin_arm_clz.
+ * Makefile.in (LIB2FUNCS_1, LIB2FUNCS_2): Move...
+ * mklibgcc.in (lib2funcs): ...here and merge. Add new members.
+ * doc/extend.texi (Other Builtins): Add new builtins.
+ * doc/md.texi (Standard Names): Add new patterns.
+
+2003-02-01 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * reload.c: Revert 2003-01-31 change.
+
+2003-02-01 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (combine_simplify_rtx): Use reversed_comparison_code_parts.
+
+2003-02-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * flags.h (flag_volatile): Remove declaration.
+ (flag_volatile_global, flag_volatile_static): Likewise.
+ * c-typeck.c (build_indirect_ref): Don't check flag_volatile.
+ * toplev.c (flag_volatile): Remove definition.
+ (flag_volatile_global, flag_volatile_static): Likewise.
+ (f_options): Remove corresponding entries here.
+ * varasm.c (make_decl_rtl): Don't check flag_volatile_global
+ or flag_volatile_static.
+ * doc/invoke.texi: Remove documentation of -fvolatile,
+ -fvolatile-global and -fvolatile-static.
+
+2003-01-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (pa_output_function_prologue, pa_output_function_epilogue): Move
+ updating of total_code_bytes from prologue to epilogue.
+
+2003-01-31 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * reload.c (find_reloads): Do not use the mode specified in the insn
+ pattern as reload mode for address operands. Do not generate optional
+ reloads for operands where a mandatory reload was already pushed.
+ Generate optional reloads only in the final pass though find_reloads.
+ (have_replacement_p): New function.
+
+2003-01-31 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Testing): Remove a reference to our obsolete
+ /testresults web pages and strip redundant information concerning
+ test results.
+ (Binaries): Refer to Microsoft Windows instead of listing all
+ possible variants.
+
+2003-02-01 Jan Hubicka <jh@suse.cz>
+
+ * loop.c (emit_prefetch_instructions): Do conversion at right place in
+ RTL chain.
+
+ * combine.c (simplify_set): Reverse order of ragumetns to
+ REG_CANNOT_CHANGE_MODE_P
+ * df.c (df_def_record_1): Likewise.
+ * recog.c (register_operand): Likewise.
+ * simplify-rtx.c (simplify_subreg): Likewise.
+ * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): Update use of
+ CANNOT_CHANGE_MODE_CLASS.
+ * regclass.c (cannot_change_mode_set_regs, invalid_mode_change_p):
+ Likewise.
+ * reload.c (push_reload): Likewise.
+ * alpha.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
+ * ia64.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
+ * mips.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
+ * mips-protos.h (mips_cannot_change_mode_class): Update prototype.
+ * mips.c (mips_cannot_change_mode_class): Update.
+ * pa64-regs.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
+ * rs6000.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
+ * s390.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
+ * sh.h (CANNOT_CHANGE_MODE_CLASS): Update definition.
+ * sh-protos.h (sh_cannot_change_mode_class): Update prototype.
+ * sh.c (sh_cannot_change_mode_class): Update.
+ * i386.h (CANNOT_CHANGE_MODE_CLASS): New.
+ * tm.texi (CANNOT_CHANGE_MODE_CLASS): Update documentation.
+
+2003-01-31 Geoffrey Keating <geoffk@apple.com>
+
+ * config/darwin.h (LINK_COMMAND_SPEC): Update for Nathan's recent
+ change to LINK_COMMAND_SPEC in gcc.c.
+
+2003-01-31 Jan Hubicka <jh@suse.cz>
+
+ PR c/9506
+ * i386.c (override_options): Use DEFAULT_PCC_STRUCT_RETURN.
+
+2003-01-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa32-regs.h (REGNO_REG_CLASS, REG_CLASS_FROM_LETTER): Delete
+ duplicated code.
+
+2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * tree.h (TYPE_BINFO_SIZE, TYPE_BINFO_SIZE_UNIT): Remove.
+ (BINFO_ELTS): New #define.
+ * stor-layout.c (finalize_record_size): Don't set them.
+ * cp/cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
+ BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
+ (BINFO_LANG_ELTS): New #define.
+ * cp/tree.c (make_binfo): Use BINFO_LANG_ELTS.
+ * java/class.c (make_class): Use BINFO_ELTS.
+ (set_super_info): Likewse.
+ (add_interface_do): Likewise.
+ * objc/objc-act.c (start_class): Use BINFO_ELTS.
+
+2003-01-31 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * timevar.c (getrusage): Don't ever declare if not HAVE_GETRUSAGE.
+ (times): Don't ever declare if not HAVE_TIMES.
+ (clock): Don't ever declare if not HAVE_CLOCK.
+
+2003-01-30 Richard Henderson <rth@redhat.com>
+
+ * flow.c (update_life_info): Zap life info after cleanup_cfg.
+ (regno_uninitialized): Use correct live at function entry set.
+ (regno_clobbered_at_setjmp): Likewise.
+
+ * expr.c (store_expr): Promote all MEM intermediates to regs.
+
+2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/arm/arm.c: Fix comment typos.
+ * config/arm/arm.h: Likewise.
+ * config/arm/netbsd-elf.h: Likewise.
+ * config/arm/netbsd.h: Likewise.
+
+2003-01-30 Geoffrey Keating <geoffk@apple.com>
+
+ * gengtype.c (struct walk_type_data): Add needs_cast_p.
+ (walk_type): Set needs_cast_p in walk_type_data.
+ (write_types_process_field): Supply casts when required to suppress
+ warnings.
+ (write_root): Cast gt_pch_n_S to suppress warning.
+ * Makefile.in: Remove -Wno-error from gtype-desc.o and c-decl.o.
+ * config/rs6000/rs6000.c (print_operand): Mask off high bits only
+ when they might exist.
+ * config/rs6000/t-rs6000: Remove -Wno-error from varasm.o,
+ insn-conditions.o, and rs6000.o.
+
+2003-01-30 Richard Henderson <rth@redhat.com>
+
+ * ggc-page.c (G.context_depth_allocations): New.
+ (G.context_depth_collections): New.
+ (alloc_page): Set G.context_depth_allocations.
+ (ggc_collect): Set G.context_depth_collections.
+ (ggc_push_context): Limit to HOST_BITS_PER_LONG contexts.
+ (ggc_pop_context): Early exit for no allocations or collections.
+
+2003-01-30 Richard Henderson <rth@redhat.com>
+
+ * tree-inline.c (walk_tree): Streamline duplicate hash table lookup.
+
+2003-01-30 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_compute_initial_elimination_offset): If optimizing for
+ size, the link register is always saved if any other register is
+ saved.
+
+2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Update the prototype for
+ compute_plussi_cc.
+ (cpp_reader): Declare before it is used.
+ * config/h8300/h8300.c (compute_plussi_cc): Change the return
+ type to int.
+ * config/h8300/h8300.md (monitor_prologue): Call abort() if we
+ see an unknown H8 variant.
+
+2003-01-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ PR target/9316
+ * config/rs6000/rtems.h: Add CPP_OS_DEFAULT_SPEC.
+ * config/rs6000/sysv4.h: Add CPP_OS_RTEMS_SPEC.
+ * config/rs6000/t-rtems: New file. multilib variants to match OS.
+ * config.gcc (powerpc-*-rtems*): Use rs6000/t-rtems instead of
+ rs6000/t-ppcgas so we get the desired multilibs.
+
+2003-01-30 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.c (arm_output_epilogue): Update stack pointer
+ when popping saved IP register off the stack.
+
+2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/rs6000/aix43.h: Fix comment typos.
+ * config/rs6000/aix51.h: Likewise.
+ * config/rs6000/aix52.h: Likewise.
+ * config/rs6000/altivec.h: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * config/rs6000/rs6000.h: Likewise.
+ * config/rs6000/rs6000.md: Likewise.
+ * config/rs6000/spe.md: Likewise.
+
+2003-01-29 Mark Mitchell <mark@codesourcery.com>
+
+ * c-common.c (builtin_define_float_constants): Define
+ __<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__.
+
+2003-01-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/sh/lib1funcs.asm: Fix comment typos.
+ * config/sh/linux.h: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sh/sh.md: Likewise.
+
+2003-01-30 Loren James Rittle <ljrittle@acm.org>
+
+ * objc/Make-lang.in (objc-parse.y): Find c-parse.in in $(srcdir).
+
+2003-01-30 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/fp-bit.h (__make_dp): Declare if TMODES.
+
+2003-01-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (PREDICATE_CODES): Add entries for
+ general_operand_src and general_operand_dst.
+
+2003-01-29 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (function_arg_pass_by_reference):
+ Return true for variable sized types.
+ (rs6000_va_arg): Handle variable sized types passed by reference
+ on non-SVR4 ABI.
+
+2003-01-29 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_legtimize_address): New function.
+ * arm-protos.h (arm_legtimize_address): Add prototype.
+ * arm.h (ARM_LEGITIMIZE_ADDRESS): Use arm_legitimize_address.
+ (LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS): Wrap with
+ do ... while (0)
+
+2003-01-29 Joel Sherrill <joel@OARcorp.com>
+
+ PR bootstrap/9296
+ * gthr-rtems.h: Define __GTHREAD_MUTEX_INIT. Apparently no code
+ depended on it being defined until now.
+
+2003-01-29 Joel Sherrill <joel@OARcorp.com>
+
+ PR target/9295
+ * config/mips/rtems.h: Predefine __USE_INIT_FINI__ so generic
+ RTEMS code knows which C++ initialization style the toolset
+ configuration is using.
+
+2003-01-29 Joel Sherrill <joel@OARcorp.com>
+
+ PR bootstrap/9293
+ * config/m68k/t-crtstuff: Replace spaces with tabs, add
+ $(MULTILIB_CFLAGS) as compiler option and multilib crtbegin/end.o.
+
+2003-01-29 Joel Sherrill <joel@OARcorp.com>
+
+ PR bootstrap/9292
+ * config.gcc (hppa1.1-rtems): Did not include t-rtems nor enable
+ RTEMS threads.
+ * config/pa/rtems.h (LIB_SPEC): Use -N when linking.
+
+2003-01-29 Nick Clifton <nickc@redhat.com>
+
+ * Makefile.in (c-parse.o): Locate source file in $(parsedir)
+ not $(srcdir).
+
+2003-01-29 Andrew Haley <aph@redhat.com>
+
+ * tree-inline.c (walk_tree): Add CHAR_TYPE.
+
+2003-01-29 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (subdi3_carry_rex64): Fix typo.
+
+2003-01-28 Stan Shebs <shebs@apple.com>
+
+ * coretypes.h (cpp_reader): Forward declare struct.
+ * c-pragma.h (cpp_reader): Remove forward declaration.
+ * hashtable.h (cpp_reader): Likewise.
+ * scan.h (cpp_reader): Likewise.
+ * tree.h (cpp_reader): Likewise.
+ * config/darwin-protos.h (cpp_reader): Likewise.
+ * config/arm/arm-protos.h (cpp_reader): Likewise.
+ * config/rs6000/rs6000-protos.h: Remove GCC_CPPLIB_H ifdef, use
+ struct cpp_reader in prototypes.
+
+2003-01-28 Christian Cornelssen <ccorn@cs.tu-berlin.de>
+
+ * doc/install.texi: Add documentation for installation into
+ tooldirs and with DESTDIR.
+
+2003-01-28 Richard Henderson <rth@redhat.com>
+
+ * config.gcc (ia64*-*-aix*): Remove.
+ * config/ia64/aix.h, config/ia64/t-aix: Remove file.
+ * config/ia64/unwind-aix.c: Remove file.
+
+2003-01-28 Andreas Schwab <schwab@suse.de>
+
+ * config/m68k/m68k.md (tablejump+2): Don't sign extend an address
+ register.
+ * config/m68k/apollo68.h (ASM_RETURN_CASE_JUMP): Likewise.
+ * config/m68k/coff.h (ASM_RETURN_CASE_JUMP): Likewise.
+ * config/m68k/linux.h (ASM_RETURN_CASE_JUMP): Likewise.
+ * config/m68k/m68kelf.h (ASM_RETURN_CASE_JUMP): Likewise.
+ * config/m68k/mot3300.h (ASM_RETURN_CASE_JUMP): Likewise.
+ * config/m68k/netbsd-elf.h (ASM_RETURN_CASE_JUMP): Likewise.
+ * config/m68k/pbb.h (ASM_RETURN_CASE_JUMP): Likewise.
+
+2003-01-28 Richard Sandiford <rsandifo@redhat.com>
+
+ * combine.c (nonzero_bits): Fix check for negative divide operands.
+
+2003-01-28 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_rwreloc_section_type_flags): New.
+ * config/ia64/hpux.h (TARGET_SECTION_TYPE_FLAGS): New.
+
+2003-01-28 Richard Henderson <rth@redhat.com>
+
+ * cse.c (find_best_addr): Kill !ADDRESS_COST code.
+
+ * config/cris/cris.c (cris_address_cost): Make static.
+ (TARGET_RTX_COSTS, TARGET_ADDRESS_COST): New.
+ * config/cris/cris.h (ADDRESS_COST): Remove.
+ * config/cris/cris-protos.h: Update.
+
+2003-01-23 Mike Stump <mrs@apple.com>
+
+ * regclass.c (init_reg_autoinc): New function.
+ (regclass): Move initialization of forbidden_inc_dec_class from
+ here...
+ (init_regs): to here. Avoids reinitialization for each function,
+ saving compilation time.
+
+2003-01-28 Jason Merrill <jason@redhat.com>
+
+ * cpplib.h (struct cpp_options): Add warn_deprecated field.
+ * cppinit.c (cpp_create_reader): Turn it on by default.
+ * c-opts.c (c_common_decode_option): Set it.
+ * cpplib.c (do_pragma_once): Only complain about #pragma once
+ if warn_deprecated is set.
+
+2003-01-28 Dale Johannesen <dalej@apple.com>
+
+ * emit-rtl.c (const_double_htab_hash): Use mode in the hash.
+ * loop.c (scan_loop): Move movables on -Os rich-register targets.
+ * config/rs6000/rs6000.md (sibcall*): Use match_operand for LR.
+
+2003-01-28 Richard Henderson <rth@redhat.com>
+
+ * target.h (targetm.address_cost): New.
+ * target-def.h (TARGET_ADDRESS_COST): New.
+ (TARGET_RTX_COSTS): Uncomment. Oops.
+ * cse.c (address_cost): Use new target hook.
+ (default_address_cost): New.
+ * output.h (default_address_cost): Declare.
+ * hooks.c (hook_int_rtx_0): New.
+ * hooks.h (hook_int_rtx_0): Declare.
+ * loop.c (combine_givs_p): Remove if 0 code.
+ * system.h (ADDRESS_COST): Poison.
+
+ * config/alpha/alpha.c, config/alpha/alpha.h, config/d30v/d30v.c,
+ config/d30v/d30v.h, config/ia64/ia64.c, config/ia64/ia64.h,
+ config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c,
+ config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.h,
+ config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/sparc/sparc.c,
+ config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h,
+ config/xtensa/xtensa.c, config/xtensa/xtensa.h
+ (TARGET_ADDRESS_COST): Define as hook_int_rtx_0.
+ (ADDRESS_COST): Remove.
+
+ * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h,
+ config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h,
+ config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h,
+ config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c,
+ config/dsp16xx/dsp16xx.h, config/i386/i386-protos.h,
+ config/i386/i386.c, config/i386/i386.h, config/i960/i960-protos.h,
+ config/i960/i960.c, config/i960/i960.h, config/ip2k/ip2k-protos.h,
+ config/ip2k/ip2k.c, config/ip2k/ip2k.h, config/mips/mips-protos.h,
+ config/mips/mips.c, config/mips/mips.h,
+ config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c,
+ config/m68hc11/m68hc11.h, config/ns32k/ns32k-protos.h,
+ config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-protos.h,
+ config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h,
+ config/s390/s390.c, config/s390/s390.h, config/vax/vax-protos.h,
+ config/vax/vax.c, config/vax/vax.h
+ (foo_address_cost): Make static.
+ (TARGET_ADDRESS_COST): New.
+ (ADDRESS_COST): Remove.
+
+ * config/arm/arm.h, config/arm/arm.c, config/m88k/m88k.h,
+ config/m88k/m88k.c, config/romp/romp.h, config/romp/romp.c,
+ config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c,
+ config/stormy16/stormy16.h
+ (ADDRESS_COST): Move code ...
+ (foo_address_cost): ... here.
+ (TARGET_ADDRESS_COST): New.
+
+ * config/m32r/m32r.c (m32r_address_cost): Remove.
+ * config/m32r/m32r-protos.h: Update.
+
+ * config/mmix/mmix.c (mmix_address_cost): Remove.
+ * config/mmix/mmix-protos.h: Update.
+
+ * config/mn10300/mn10300.c (mn10300_address_cost_1): Rename from
+ mn10300_address_cost; move unsig allocation ...
+ (mn10300_address_cost): ... here.
+ (TARGET_ADDRESS_COST): New.
+ * config/mn10300/mn10300-protos.h: Update.
+ * config/mn10300/mn10300.h (ADDRESS_COST): Remove.
+
+ * doc/tm.texi: Update.
+
+2003-01-28 Vladimir Makarov <vmakarov@redhat.com>
+
+ * haifa-sched.c (schedule_insn): Return necessary cycle advance
+ after issuing the insn.
+ (rank_for_schedule): Make a insn with /S the highest priority
+ insn.
+ (move_insn): Ignore schedule groups. Clear SCHED_GROUP_P.
+ (choose_ready): Check SCHED_GROUP_P.
+ (schedule_block): Advance cycle after issuing insn if it is
+ necessary. Don't reorder insns if there is an insn with /S.
+ (set_priorities): Ignore schedule groups.
+
+ * sched-deps.c (remove_dependence, group_leader): Remove the
+ functions.
+ (add_dependence): Ignore schedule groups.
+ (set_sched_group_p): Don't make copy of dependencies from previous
+ insn of the schedule group. Add anti-dependency to the previous
+ insn of the schedule group.
+ (compute_forward_dependences): Ignore schedule groups.
+
+ * sched-ebb.c (init_ready_list): Ignore schedule groups.
+
+ * sched-rgn.c (init_ready_list): Ditto.
+ (can_schedule_ready_p): Ditto.
+
+2003-01-28 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/i386/i386.md (*movsi_1): Use movdqa to move one xmm
+ register to another one.
+
+2003-01-28 Richard Henderson <rth@redhat.com>
+
+ * calls.c (default_must_pass_in_stack): Fix typo in !type case.
+
+2003-01-28 Roger Sayle <roger@eyesopen.com>
+
+ * cse.c (cse_insn): Avoid redundant REG_EQUAL notes.
+
+2003-01-28 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/sh/sh.h (CLASS_MAX_NREGS): If TARGET_SHMEDIA, and the given
+ class contains a floating-point register, return the size of the
+ mode in half words.
+
+2003-01-28 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_carry_flag_operator): New predicate.
+ (fcmov_operator): Fix whitespace.
+ (ix86_expand_carry_flag_compare): Deal with floating point.
+ (ix86_expand_int_movcc): Deal with fp; update insn expansion
+ (ix86_expand_int_addcc): Likewise.
+ (ix86_expand_strlensi_unroll_1): likewsie.
+ * i386.h (PREDICATE_CODES): Add ix86_carry_flag_operator.
+ * i386.md (add?i_carry_rex64): Use new predicate.
+ (sub?i3_carry_rex64): Likewise.
+ (x86_mov?icc_0_m1*): Likewise.
+
+2003-01-28 Andreas Schwab <schwab@suse.de>
+
+ * cfgloopmanip.c (create_preheader): Initialize src to avoid
+ warning.
+
+ * expmed.c (emit_store_flag): Fix cast to avoid sign
+ comparison warning.
+
+ * combine.c (force_to_mode): Add cast to fix warning when
+ STORE_FLAG_VALUE is negative.
+
+2003-01-27 Richard Henderson <rth@redhat.com>
+
+ * Makefile.in (cse.o): Depend on TARGET_H.
+ * cse.c (rtx_cost): Use targetm.rtx_costs.
+ * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison.
+ * doc/tm.texi: Update.
+
+ * target.h (targetm.rtx_costs): New.
+ * target-def.h (TARGET_RTX_COSTS): New.
+ * hooks.c (hook_bool_rtx_int_int_intp_false): New.
+ * hooks.h: Update.
+
+ * config/alpha/alpha.c (alpha_rtx_cost_data): New.
+ (alpha_rtx_costs, TARGET_RTX_COSTS): New.
+ * config/alpha/alpha.h (PROCESSOR_MAX): New.
+ (CONST_COSTS, RTX_COSTS): Remove.
+
+ * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c,
+ config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h,
+ config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c,
+ config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h,
+ config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c,
+ config/i370/i370.h, config/i386/i386.c, config/i386/i386.h,
+ config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c,
+ config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h,
+ config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c,
+ config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h,
+ config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c,
+ config/mn10200/mn10200.h, config/mn10300/mn10300.c,
+ config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h,
+ config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c,
+ config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h,
+ config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c,
+ config/s390/s390.h, config/sh/sh.c, config/sh/sh.h,
+ config/stormy16/stormy16.c, config/stormy16/stormy16.h,
+ config/v850/v850.c, config/v850/v850.h,
+ config/xtensa/xtensa.c, config/xtensa/xtensa.h
+ (CONST_COSTS, RTX_COSTS): Move code ...
+ (foo_rtx_costs, TARGET_RTX_COSTS): ... here.
+
+ * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs.
+ (arm_rtx_costs, TARGET_RTX_COSTS): New.
+ * config/arm/arm-protos.h: Update.
+ * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove.
+
+ * config/avr/avr.h (CONST_COSTS): Move code ...
+ * config/avr/avr.c (avr_rtx_costs): ... here.
+ (default_rtx_costs): Make static.
+ * config/avr/avr-protos.h: Update.
+
+ * config/h8300/h8300.c (const_costs): Make static.
+ (h8300_and_costs, h8300_shift_costs): Likewise.
+ * config/h8300/h8300-protos.h: Update.
+
+ * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove.
+ (CONST_COSTS): Move code ...
+ * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from
+ default_rtx_costs; update for signature change.
+ * config/ip2k/ip2k-protos.h: Update.
+
+ * config/m68hc11/m68hc11.h (RTX_COSTS): Remove.
+ (CONST_COSTS): Move code ...
+ * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here.
+ (TARGET_RTX_COSTS): New.
+ (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static.
+ * config/m68hc11/m68hc11-protos.h: Update.
+
+ * config/m68k/m68k.c (const_int_cost): Make static.
+ * config/m68k/m68k-protos.h: Update.
+
+ * config/mcore/mcore.c (mcore_const_costs): Make static.
+ (mcore_and_cost, mcore_ior_cost): Likewise.
+ * config/mcore/mcore-protos.h: Update.
+
+ * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New.
+ (mmix_rtx_cost_recalculated): Remove.
+ * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove.
+ * config/mmix/mmix-protos.h: Update.
+
+ * config/sh/sh.c (shiftcosts): Make static.
+ (addsubcosts, andcosts, multcosts): Likewise.
+ * config/sh/sh-protos.h: Update.
+
+ * config/sparc/sparc.c (TARGET_RTX_COSTS): New.
+ (sparc_rtx_costs): Make static; update for change in signature.
+ * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove.
+ * config/sparc/sparc-protos.h: Update.
+
+ * config/v850/v850.c (const_costs): Make static.
+ * config/v850/v850-protos.h: Update.
+
+ * config/vax/vax.h (RTX_COSTS): Remove.
+ (CONST_COSTS): Move code ...
+ * config/vax/vax.c (vax_rtx_costs_1): ... here; rename
+ from vax_rtx_cost.
+ (vax_rtx_costs, TARGET_RTX_COSTS): New.
+
+2003-01-27 Richard Henderson <rth@redhat.com>
+
+ * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Remove. Really.
+ * config/vax/vax-protos.h: Update. Really.
+
+2003-01-28 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mips/mips.h (UNITS_PER_HWFPVALUE): Renamed from...
+ (UNITS_PER_FPVALUE): Defined as the width of a long double, or
+ zero if no hardware floating point.
+ (LONG_DUBLE_TYPE_SIZE): Set to 128 on N32 and N64.
+ (MAX_FIXED_MODE_SIZE): Define to LONG_DOUBLE_TYPE_SIZE.
+ (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define.
+ (BIGGEST_ALIGNMENT): Same as LONG_DOUBLE_TYPE_SIZE.
+ (FUNCTION_VALUE_REGNO_P): Set for FP_RETURN+2 on N32 and N64.
+ * config/mips/mips.c (mips_arg_info): Pass TFmode values in
+ even FP registers on N32 and N64.
+ (mips_setup_incoming_varargs): Use UNITS_PER_HWFPVALUE.
+ (mips_va_start): Adjust alignment of ARG_POINTER_REGNUM.
+ (mips_va_arg): Use UNITS_PER_HWFPVALUE. Impose additional
+ even-register-like alignment to 128-bit arguments.
+ (save_restore_insns): Use UNITS_PER_HWFPVALUE.
+ (mips_function_value): Likewise. Return TFmode in $f0 and $f2
+ on N32 or N64.
+ * config/mips/_tilib.c (__negti2, __ashlti3, __lshrti3): New.
+ * config/mips/t-iris6 (LIB2FUNCS_EXTRA): Add _tilib.c.
+ (TPBIT): Set to tp-bit.c.
+ (tp-bit.c): Create out of fp-bit.c.
+
+2003-01-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-parse.in: Remove '%expect 32' directive in objc mode.
+
+2003-01-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * Makefile.in (LIB2FUNCS_ST): Remove _gcov.
+ (LIBGCOV): New variable.
+ (libgcc.mk): Add LIBGCOV.
+ (LIBGCC_DEPS): Add libgcov.c.
+ (libgcov.a): New target.
+ (clean): Remove libgcov.a.
+ (install-libgcc): Do libgcov too.
+ (stage1-start, stage2-start, stage3-start, stage4-start): Deal
+ with libgcov.a.
+ * libgcc2.c (L_gcov): Move into ...
+ * libgcov.c: ... here. New file.
+ * mklibgcc.in: Add libgcov rules.
+ * gcc.c (LINK_COMMAND_SPEC): Add -lgcov when profiling.
+
+ * doc/invoke.texi (profile-arcs, test-coverage): Update and
+ clarify.
+
+ * profile.c (index_counts_file): Remove duplicate check for open file.
+
+2003-01-27 Jerry Quinn <jlquinn@optonline.net>
+
+ * gcc/doc/invoke.texi (Optimization Options): Group together
+ optional and experimental flags. Move trapv and bounds-check
+ out of this section. Group floating point flags together.
+ (Code Gen Options): Move trapv and bounds-check to here.
+
+2003-01-27 Josef Zlomek <zlomekj@suse.cz>
+
+ * gcse.c (constprop_register): Check NEXT_INSN (insn) != NULL.
+
+2003-01-27 Richard Earnshaw <rearnsha@arm.com>
+
+ PR optimization/9090
+ * function.c (purge_addressof_1): After pushing an addressed register
+ onto the stack, simplify the result.
+
+2003-01-27 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * doc/extend.texi: Fix typo.
+
+2003-01-27 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * doc/cppopts.texi: Fix typo.
+ * doc/objc.texi: Likewise.
+ * doc/passes.texi: Likewise.
+
+2003-01-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * real.c (ibm_extended_format): Add 53 to minimum exponent.
+ (encode_ibm_extended): Adjust.
+
+2003-01-26 Gabriel Dos Reis <gdr@soliton.integrable-solutions.net>
+
+ * timevar.def (TV_OVERLOAD, TV_TEMPLATE_INSTANTIATION): New
+ timevar_id enumerations.
+
+2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c: Fix formatting.
+
+2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/gccint.texi: Update the copyright.
+
+2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/cpp.texi: Fix typos.
+ * doc/extend.texi: Likewise.
+ * doc/gty.texi: Likewise.
+ * doc/install.texi: Likewise.
+ * doc/passes.texi: Likewise.
+ * doc/rtl.texi: Likewise.
+ * doc/tm.texi: Likewise.
+
+2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/ia64/fde-glibc.c: Fix comment typos.
+ * config/ia64/hpux.h: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/ia64/ia64.h: Likewise.
+ * config/ia64/unwind-ia64.c: Likewise.
+
+2003-01-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/i386/i386-modes.def: Fix comment typos.
+ * config/i386/i386.c: Likewise.
+ * config/i386/i386.md: Likewise.
+
+2003-01-26 Steven Bosscher <s.bosscher@student.tudelft.nl>
+
+ * config/avr/avr.h, config/cris/aout.h, config/elfos.h,
+ config/i386/freebsd-aout.h, config/mips/iris6.h: Undefine
+ ASM_FINISH_DECLARE_OBJECT before defining it.
+ * toplev.c (rest_of_decl_compilation): Don't define
+ ASM_FINISH_DECLARE_OBJECT. Only use it if it is defined.
+ (rest_of_type_compilation): Don't ATTRIBUTE_UNUSED function
+ parameters for DWARF2 targets because they _are_ used.
+
+2003-01-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * fp-bit.h: Define macros for TFmode floating-point constants
+ in IBM-extended TFmode types.
+ (TMODES): Define if __LDBL_MANT_DIG__ has the newly-supported
+ widths.
+ * config/fp-bit.c (pack_d, unpack_d): Support IBM-extended
+ TFmode type.
+
+ * config/fp-bit.h: Define macros for TFmode floating-point
+ constants in IEEE quad TFmode type. Declare functions according
+ to L_ macros.
+ (TMODES): Define if __LDBL_MANT_DIG__ is 113.
+ (TFtype, TItype, UTItype): Define if TMODES is defined.
+ (MAX_UDI_INT, MAX_DI_INT, BITS_PER_DI): Likewise.
+ (F_T_BITOFF, D_T_BITOFF): Define.
+ (IMPLICIT_1, IMPLICIT_2): Cast constants to types that are
+ guaranteed to be wide enough.
+ * config/fp-bit.c: Check for L_ macros for tf functions.
+ (__thenan_tf): New.
+ (nan): Adjust.
+ (pack_d, unpack_d): Support IEEE 854 quad type.
+ (_fpmul_parts): Support TFmode. Compute exponent adjustment
+ from FRAC_NBITS, FRAC_BITS and NGARDS.
+ (usi_to_float): Cast constants to be shifted to fractype
+ instead of assuming long long is wide enough.
+ (sf_to_tf, df_to_tf, __make_tp, tf_to_df, tf_to_sf): New.
+
+2003-01-26 Andreas Jaeger <aj@suse.de>
+
+ * df.c: Remove prototype of unused function df_regno_rtl_debug.
+
+2003-01-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (FPBIT_FUNCS): Added _sf_to_tf.
+ (DBBIT_FUNCS): Added _df_to_tf.
+ (TPBIT_FUNCS): New.
+ (libgcc.mk): Pass TPBIT and TPBIT_FUNCS down.
+ (LIBGCC_DEPS): Added TPBIT.
+ * mklibgcc.in: Support TPBIT and TPBIT_FUNCS.
+
+ * optabs.c (expand_binop) <add, sub>: Return xtarget if we haven't
+ been able to move the result to target.
+
+ * expr.c (emit_group_store): Initialize dst with CONST0_RTX
+ for the appropriate mode.
+
+ * calls.c (emit_library_call_value_1): Handle return values
+ in a PARALLEL.
+
+ * rtl.c (get_mode_alignment): Moved to...
+ * stor-layout.c: ... here.
+
+ * print-rtl.c (print_rtx): Don't print MEM details in
+ GENERATOR_FILEs.
+
+2003-01-26 Michael Hayes <mph@paradise.net.nz>
+
+ * df.h: Update comments, tidy formatting.
+ (DF_FORWARD, DF_REVERSE, DF_UNION, DF_INTERSECTION): Rename from FORWARD,
+ REVERSE, UNION, INTERSECTION. All uses updated.
+ (OLD_DF_INTERFACE): Remove.
+ (struct insn_info): Remove commented out insn field.
+ * df.c: Update comments, tidy formatting.
+ (df_def_table_realloc): Remove.
+
+
+2003-01-26 Alan Modra <amodra@bigpond.net.au>
+
+ * calls.c (save_fixed_argument_area): Tidy.
+ (restore_fixed_argument_area): Tidy. Set alignment of stack_area.
+ (expand_call): Comment typo fixes. Don't init low_to_save. Start
+ call chain loop at 1 if !try_tail_call. Formatting.
+ (emit_library_call_value_1): Don't init low_to_save or high_to_save.
+ Use save_fixed_argument_area and restore_fixed_argument_area.
+
+2003-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * df.c (df_uses_record): Handle CC0.
+
+2003-01-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * reload.c (maybe_memory_address_p): New function.
+ (find_reloads_address): Use it instead of memory_address_p.
+
+2003-01-25 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * final.c (shorten_branches): Align the address of code label
+ when computing initial lengths and addresses.
+
+2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/m68hc11/m68hc11.md: Fix a comment typo.
+
+2003-01-25 Andreas Jaeger <aj@suse.de>
+
+ * config/i386/i386.c (x86_output_mi_thunk): Correct test for
+ TARGET_MACHO.
+
+2003-01-25 Roger Sayle <roger@eyesopen.com>
+
+ * gcse.c (bypass_last_basic_block): New global variable.
+ (bypass_block): Use redirect_edge_and_branch_force to redirect
+ fall-through edges. Use bypass_last_basic_block to determine
+ which blocks have valid PRE information.
+ (bypass_conditional_jumps): Initialize bypass_last_basic_block.
+
+2003-01-25 Jan Hubicka <jh@suse.cz>
+
+ * gcse.c (local_cprop_pass): Update reg_sets table when needed.
+
+2003-01-25 Jan Hubicka <jh@suse.cz>
+ Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR opt/8492
+ * gcse.c (one_cprop_pass): Delete unreachable blocks.
+
+2003-01-25 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_rwreloc_select_rtx_section): Rename
+ from ia64_aix_select_rtx_section.
+ (ia64_rwreloc_select_section): Simlarly; use default*_1 function
+ instead of saving and restoring flag_pic.
+ (ia64_rwreloc_unique_section): Similarly.
+ * config/ia64/aix.h (TARGET_ASM_SELECT_SECTION,
+ TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Update.
+ * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION,
+ TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): New.
+
+2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (h8300_shift_needs_scratch_p): Update a
+ comment.
+
+2003-01-25 Richard Henderson <rth@redhat.com>
+
+ * config/m68k/m68k-none.h (ASM_SPEC): Adjust inter-option spacing.
+
+2003-01-25 Kelley Cook <kelleycook@comcast.net>
+
+ * ggc-simple.c (debug_ggc_tree): Add PTR cast.
+
+2003-01-25 Segher Boessenkool <segher@koffie.nl>
+
+ * bitmap.h (BITMAP_WORD): New typedef: fundamental storage
+ type for bitmaps. Use unsigned long.
+ (nBITMAP_WORD_BITS): New macro.
+ (BITMAP_WORD_BITS): New macro.
+ (rest of file): Use it.
+ * bitmap.c: Use it.
+
+2003-01-25 Richard Henderson <rth@redhat.com>
+
+ 2002-02-19 Robert Lipe <robertlipe@usa.net>
+ * config/i386/t-sco5gas: (CRTSTUFF_T_CFLAGS_S): Delete -mcoff.
+
+2003-01-25 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (purge_builtin_constant_p): Scan insn stream
+ sequentially rather than by basic block.
+ * function.c (purge_addressof): Simplify test with INSN_P.
+
+2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * combine.c (simplify_comparison, case AND): Remove a redundant test.
+
+2003-01-25 Roger Sayle <roger@eyesopen.com>
+
+ * function.h (struct function): New field calls_constant_p.
+ (current_function_calls_constant_p): New macro for above.
+ * function.c (prepare_function_start): Initialize calls_eh_return
+ and calls_constant_p.
+ * builtins.c (expand_builtin_constant_p): Set calls_constant_p.
+ * toplev.c (rest_of_compilation): Only call purge_builtin_constant_p
+ when the current_function_calls_constant_p.
+ * integrate.c (expand_inline_function): Set calls_constant_p if
+ the function being inlined has calls_constant_p set.
+
+2003-01-25 Roger Sayle <roger@eyesopen.com>
+
+ * cse.c (fold_rtx): Instantiate CONSTANT_P_RTX to 0 when not
+ optimizing, even if flag_gcse is true.
+ * toplev.c (rest_of_compilation): purge_builtin_constant_p
+ only needs to be called when "optimize > 0 && flag_gcse".
+
+2003-01-25 Roger Sayle <roger@eyesopen.com>
+
+ * stmt.c (emit_case_bit_tests): New routine to implement suitable
+ switch statements using the equivalent of "if ((1<<x) & cst) ... ".
+ (case_bit_test_cmp): New comparison function for "qsort" to order
+ case_bit_tests by decreasing number of destination nodes.
+ (lshift_cheap_p): New function to determine if "1 << x" is cheap.
+ (expand_end_case_type): Use emit_case_bit_tests to implement
+ suitable switch statments.
+ (CASE_USE_BIT_TESTS): New target macro to disable the above.
+ * Makefile.in (stmt.o): Add dependency on optab.h.
+ * doc/tm.texi (CASE_USE_BIT_TESTS): Document new target macro.
+
+2003-01-23 Andreas Schwab <schwab@suse.de>
+
+ * config/ia64/crtend.asm [HAVE_INITFINI_ARRAY]: Make
+ __do_global_ctors_aux hidden global and don't put it in
+ .init_array.
+ * config/ia64/crtbegin.asm [HAVE_INITFINI_ARRAY]: Put it here
+ instead so that it comes first.
+
+2003-01-25 Jan Hubicka <jh@suse.cz>
+
+ * df.c (read_modify_subreg_p): When osize == UNITS_PER_WORD,
+ subreg is read/modify.
+
+2003-01-25 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_movstr, ix86_expand_clrstr): Consistently
+ do libcall for large blocks.
+ * i386.md (comi patterns): Set type to ssecomi.
+ (sse2_unpck?pd): Fix mode of vec_select.
+
+ * cse.c: Include except.h
+ (cse_set_around_loop): Do not create new basic blocks.
+ * Makefile.in (cse.o): Add dependnecy on except.h
+
+2003-01-25 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c (fold_trunc_transparent_mathfn): New function.
+ (fold_builtin): Use it.
+ * convert.c (convert_to_real): Re-enable code to convert
+ math functions; add support for floor familly functions.
+
+2003-01-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (cfgloop.o, cfgloopanal.o, cfgloopmanip.o): Add
+ dependencies on coretypes.h and $(TM_H).
+
+2003-01-25 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c (fold_trunc_transparent_mathfn): Undo accidental commit.
+
+2003-01-24 Stuart Hastings <stuart@apple.com>
+
+ * config/i386/i386.c (x86_output_mi_thunk): Add Darwin/x86 support.
+
+2003-01-25 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * config/c4x/c4x.md (UNSPEC_BU): New constants.
+ (UNSPEC_RPTS, UNSPEC_LSH, UNSPEC_CMPHI, UNSPEC_RCPF): Likewise.
+ (UNSPEC_RND, UNSPEC_RPTB_FILL, UNSPEC_LOADHF_INT): Likewise.
+ (UNSPEC_STOREHF_INT, UNSPEC_RSQRF, UNSPEC_LOADQF_INT): Likewise.
+ (UNSPEC_STOREQF_INT, UNSPEC_LDIV, UNSPEC_PUSH_ST): Likewise.
+ (UNSPEC_POP_ST, UNSPEC_PUSH_DP, UNSPEC_POP_DP): Likewise.
+ (UNSPEC_POPQI, UNSPEC_POPQF, UNSPEC_ANDN_ST): Likewise.
+ (UNSPEC_RPTB_INIT, UNSPEC_TOIEEE, UNSPEC_FRIEEE): Likewise.
+
+2003-01-24 Jan Hubicka <jh@suse.cz>
+
+ * emit-rtl.c (reg_attrs_htab): New static variable.
+ (reg_attrs_htab_hash, reg_attrs_htab_eq, get_reg_attrs): New static
+ functions.
+ (reg_rtx): Do not maintain regno_decl.
+ (gen_rtx_REG_offset, set_reg_attrs_from_mem, set_delc_rtx,
+ set_mem_attrs_from_reg): New global function.
+ (init_emit): Do not initialize regno_decl.
+ (init_emit_once): initialize reg_attrs_htab.
+ * final.c (alter_subreg): Do not replace REG by SUBREG.
+ (gen_mem_expr_from_op): Improve output.
+ (output_asm_operands): Likewise.
+ * function.c (assign_params): Do not set REGNO_DECL.
+ * function.h (struct function): Kill regno_decl.
+ (REGNO_DECL): Kill.
+ * gengtype.c (adjust_field_rtx_def): Handle new field of reg.
+ * print_rtl.c (print_rtx): Output REG information.
+ * regclass.c (reg_scan_mark_refs): Update attrs.
+ * reload1.c (alter_reg): Likewise.
+ * simplify_rtx.c (simplify_subreg): Likewise.
+ * stmt.c (expand_decl): Likewise.
+ * rtl.def (REG): Add new field.
+ * rtl.h (struct reg_attrs): New.
+ (rtunion_def): At rtreg.
+ (X0MEMATTR): Add checking.
+ (X0REGATTR, REG_ATTRS, REG_EXPR, REG_OFFSET): New macro.
+ (set_reg_attrs_from_mem, set_mem_attrs_from_reg, gen_rtx_REG_offset):
+ Declare.
+ * tree.h (SET_DECL_RTL): Call set_decl_rtl.
+
+2003-01-24 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c: Remove unused include of machmode.h.
+ (xtensa_emit_call, print_operand): Fix printf format strings
+ to avoid compile warnings.
+ (xtensa_function_prologue, xtensa_function_epilogue): Change type
+ of "size" argument to HOST_WIDE_INT to fix compile warnings.
+ * config/xtensa/xtensa-protos.h
+ (xtensa_function_prologue, xtensa_function_epilogue): Ditto.
+
+2003-01-24 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c (DEF_BUILTIN): Accept 10 arguments.
+ (implicit_built_in_decls): New global array.
+ (mathfn_built_in): New global function.
+ (fold_trunc_transparent_mathfn): New static function
+ (expand_builtin_strstr, expand_bultin_strchr,
+ expand_builtin_strpbrk, expand_builtin_strcpy,
+ expand_builtin_strncpy, expand_bultin_strcmp,
+ expand_bultin_strncat, expand_builtin_fputs): Use
+ implicint_built_in_decls.
+ (fold_builtin): Fold floor/trunc/round/ceil/nearbyint.
+ * builtins.def: Fix comments.
+ (DEF_GCC_BUILTIN, DEF_FALLBACK_BUILTIN, DEF_EXT_FALLBACK_BUILTIN,
+ DEF_LIB_BUILTIN, DEF_LIB_ALWAYS_BUILTIN, DEF_EXT_LIB_BUILTIN,
+ DEF_C99_BULTIN, DEF_FRONT_END_LIB_BUILTIN,
+ DEF_EXT_FRONT_END_LIB_BUILTIN): Pass implicit as needed.
+ (DEF_C99_C90RES_BULTIN): New.
+ (*f, *l builtins): Update.
+ * c-common.c (DEF_BUILTIN): Initialize implicit array.
+ (c_expand_builtin_printf, c_expand_builtin_fprintf): Update.
+ * convert.c (strip_float_extensions): New global function.
+ * tree.h (DEF_BUILTIN): Accept 10 arguments.
+ (implicit_built_in_decls, mathfn_built_in, strip_float_extension):
+ Declare.
+ * java/builtins.c (define_builtin): Handle implicit.
+ (DEF_BUILTIN): Update.
+ * tm.texi (TARGET_C99_FUNCTIONS): Document.
+ * defaults.h (TARGET_C99_FUNCTIONS): Default to 0.
+ * config/linux.h (TARGET_C99_FUNCTIONS): Default to 1
+ when using glibc2.
+
+2003-01-24 Bob Wilson <bob.wilson@acm.org>
+
+ * config.gcc (xtensa-*-elf*): Removed assignments to with_newlib,
+ extra_parts, and fixincludes. Add xtensa/t-elf tmake_file.
+ (xtensa-*-linux*): Add xtensa/t-linux tmake_file.
+ * config/xtensa/crti.asm: New file.
+ * config/xtensa/crtn.asm: New file.
+ * config/xtensa/t-elf: New file.
+ * config/xtensa/t-linux: New file.
+ * config/xtensa/t-xtensa: Add rules for crti.o and crtn.o.
+ Move various CFLAGS settings to new t-elf file.
+
+2003-01-24 Richard Henderson <rth@redhat.com>
+
+ PR optimization/4382
+ * tree-inline.c (find_builtin_longjmp_call_1): New.
+ (find_builtin_longjmp_call): New.
+ (inlinable_function_p): Use it.
+
+2003-01-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * config/i386/i386-protos.h (function_arg_pass_by_reference): Declare.
+ * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
+ * config/i386/i386.c (function_arg_pass_by_reference): New.
+ (ix86_va_arg): Support arguments passed by reference.
+
+2003-01-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloopanal.c: New file.
+ * cfgloopmanip.c: New file.
+ * Makefile.in (cfgloopanal.o, cfgloopmanip.o): New.
+ (toplev.o, loop.o, doloop.o, unroll.o, cfgloop.o, predict.o,
+ cfglayout.o): Add dependency on cfgloop.h.
+ (cfgloop.o): Add flags.h dependency.
+ * basic-block.h (BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK): New flags.
+ (VLS_EXPECT_PREHEADERS, VLS_EXPECT_SIMPLE_LATCHES): Removed.
+ (struct loop, struct loops, flow_loops_find, flow_loops_update,
+ flow_loops_free, flow_loops_dump, flow_loop_dump,
+ flow_loop_scan, flow_loop_tree_node_add, flow_loop_tree_node_remove,
+ LOOP_TREE,,LOOP_PRE_HEADER, LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES,
+ LOOP_ALL, flow_loop_outside_edge_p, flow_loop_nested_p,
+ flow_bb_inside_loop_p, get_loop_body, loop_preheader_edge,
+ loop_latch_edge, add_bb_to_loop, remove_bb_from_loops,
+ find_common_loop, verify_loop_structure): Declarations moved to ...
+ * cfgloop.h: New file.
+ * bb-reorder.c (reorder_basic_blocks): Modified.
+ * cfglayout.c: Include cfgloop.h.
+ (cleanup_unconditional_jumps, cfg_layout_redirect_edge,
+ cfg_layout_duplicate_bb, cfg_layout_initialize): Update loop structure.
+ (break_superblocks): New static function.
+ (cfg_layout_finalize): Use it.
+ (cfg_layout_split_block): New function.
+ * cfglayout.h (struct reorder_block_def): Add copy and duplicated
+ fields.
+ (cfg_layout_initialize, cfg_layout_redirect_edge): Declaration
+ changed.
+ (cfg_layout_split_block): Declare.
+ * cfgloop.c: Include cfgloop.h and flags.h.
+ (flow_loop_dump, flow_loops_free, flow_loop_exit_edges_find,
+ get_loop_body): Avoid signed versus unsigned comparison warnings.
+ (make_forwarder_block, flow_loops_find, loop_preheader_edge,
+ loop_latch_edge): Modified.
+ (verify_loop_structure): Modified to use flags stored in loop structure;
+ check irreducible loops.
+ (cancel_loop, cancel_loop_tree): New functions.
+ (estimate_probability): Use loop analysis code for predictions.
+ (estimate_loops_at_level): Avoid signed versus unsigned comparison
+ warnings.
+ * doloop.c: Include cfgloop.h.
+ * loop.c: Include cfgloop.h.
+ * predict.c: Include cfgloop.h.
+ * toplev.c: Include cfgloop.h.
+ * unroll.c: Include cfgloop.h.
+ * tracer.c (tracer): Modified.
+
+2003-01-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (get_shift_alg): Fix a typo.
+
+2003-01-24 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * configure.in (HAVE_AS_TLS): Add s390-*-* and s390x-*-* cases.
+ * configure: Regenerate.
+
+ * config/s390/s390-protos.h (tls_symbolic_operand): Add prototype.
+ (tls_symbolic_reference_mentioned_p): Add prototype.
+ (s390_tls_get_offset): Add prototype.
+ (emit_pic_move): Remove prototype, replace by ...
+ (emit_symbolic_move): .. this new prototype.
+
+ * config/s390/s390.c (TARGET_HAVE_TLS): Conditionally define.
+ (tls_model_chars): New global variable.
+ (s390_encode_section_info): Encode TLS model.
+ Use targetm.binds_local_p to check for local symbols.
+ (s390_strip_name_encoding): New function.
+ (TARGET_STRIP_NAME_ENCODING): Define.
+
+ (get_thread_pointer): New function.
+ (legitimize_tls_address): New function.
+ (legitimize_address): Call it.
+ (emit_pic_move): Remove, replace by ...
+ (emit_symbolic_move): ... this new function.
+
+ (larl_operand): Handle TLS operands.
+ (legitimate_constant_p): Likewise.
+ (s390_decompose_address): Likewise.
+ (s390_cannot_force_const_mem): New function.
+ (TARGET_CANNOT_FORCE_CONST_MEM): Define.
+
+ (s390_output_symbolic_const): Handle TLS unspecs.
+ (print_operand): New code 'J'.
+ (machine_function): Add struct member 'some_ld_name'.
+ (get_some_local_dynamic_name, get_some_local_dynamic_name_1): New.
+
+ (enum s390_builtin): New type.
+ (code_for_builtin_64, code_for_builtin_31): New global variables.
+ (s390_init_builtins, s390_expand_builtin): New functions.
+ (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define.
+
+ * config/s390/s390.h (TLS_SYMBOLIC_CONST): New macro.
+ (ASM_OUTPUT_LABELREF): Define.
+ (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Handle TLS constants.
+
+ * config/s390/s390.md: Define TLS UNSPEC constants.
+ ("movdi", "movsi"): Handle TLS operands.
+ ("get_tp_64", "get_tp_31", "set_tp_64", "set_tp_31"): New insns.
+ ("*tls_load_64", "*tls_load_31"): New insns.
+ ("call_value_tls", "call_value_tls_exp"): New expanders.
+ ("brasl_tls", "bras_tls", "basr_tls_64", "basr_tls_31",
+ "bas_tls_64", "bas_tls_31"): New insns.
+
+2003-01-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/rs6000/rs6000.c (rs6000_parse_abi_options): Make sure
+ spe ABI is configured, if requested.
+
+2003-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * doc/passes.texi: Fix typo.
+
+2003-01-24 Andreas Schwab <schwab@suse.de>
+
+ * stor-layout.c (excess_unit_span): Only define if used.
+
+2003-01-24 Jerry Quinn <jlquinn@optonline.net>
+
+ * gcc/doc/invoke.texi (Optimization Options): List -O levels
+ for each optimization flag.
+
+2003-01-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*andsi3_ashift_n_lower): New.
+
+2003-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * doc/bugreport.texi: Use @command instead of @code for commands.
+ * doc/collect2.texi: Likewise.
+ * doc/headerdirs.texi: Likewise.
+ * doc/invoke.texi: Likewise.
+ * doc/standards.texi: Likewise.
+ * doc/tm.texi: Likewise.
+ * doc/trouble.texi: Likewise.
+
+2003-01-24 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.c (use_return_insn): Do not use a single return
+ instruction for interrupt handelrs which have to create a stack
+ frame.
+ (arm_expand_prologue): Do not pre-bias the return address of
+ interrupt handlers which create a stack frame.
+
+2003-01-24 Nick Clifton <nickc@redhat.com>
+
+ * Add sh2e support:
+
+ 2002-08-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sh/sh.c (output_branch) [TARGET_SH2E]: Handle
+ med_cbranches. Fix logic in short_cbranches.
+
+ 2002-04-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sh/sh.md (delay for cbranch): Don't annul delay
+ slots on SH2e.
+ * config/sh/sh.c (sh_insn_length_adjustment): Add 2 for
+ cbranch with unfilled delay slot on SH2e.
+ (output_branch): Fill with a nop the delay slot of a
+ branch that required a delay slot but didn't get one.
+
+ 2002-04-02 Alexandre Oliva <aoliva@redhat.com>
+
+ * doc/invoke.texi (SH options): Document -m2e.
+ * config/sh/crt1.asm: Add __SH2E__ Next to __SH3E__.
+ * config/sh/lib1funcs.asm: Likewise.
+ * config/sh/sh.c: Replace all uses of TARGET_SH3E with SH2E.
+ * config/sh/sh.h (CPP_SPEC): Define __SH2E__ for -m2e, and
+ not __sh1__.
+ (CONDITIONAL_REGISTER_USAGE): Don't disable FP regs from
+ SH2E up.
+ (SH3E_BIT): Renamed to...
+ (SH_E_BIT): ... this. Replace all uses.
+ (TARGET_SH2E): Define from SH_E_BIT and TARGET_SH2.
+ Replace all uses of TARGET_SH3E with TARGET_SH2E.
+ (TARGET_SWITCHES): Added 2e.
+ (OVERRIDE_OPTIONS): Set sh_cpu for SH2E.
+ (processor_type): Added PROCESSOR_SH2E.
+ * config/sh/sh.md: Replace all uses of TARGET_SH3E with
+ TARGET_SH2E, except in sqrtsf2_i.
+ (attribute cpu): Added sh2e.
+ * config/sh/t-sh (MULTILIB_OPTIONS): Replace m3e with m2e.
+ (MULTILIB_MATCHES): Use m2e multilib for m3e.
+ * config.gcc: Add sh2e target support.
+
+2003-01-24 Phil Edwards <pme@gcc.gnu.org>
+
+ Rename -W to -Wextra.
+ * c-decl.c: Update comments.
+ * c-typeck.c: Likewise.
+ * flags.h: Likewise.
+ * function.c: Likewise.
+ * stmt.c: Likewise.
+ * toplev.c: Update comments.
+ (W_options): Add 'extra'.
+ (display_help): Remove '-W'.
+ (decode_W_option): Special warn_uninitialized treatment in the case
+ of -Wextra.
+ * doc/invoke.texi: Update with new entries.
+
+2003-01-23 Richard Henderson <rth@redhat.com>
+
+ * ifcvt.c (noce_process_if_block): Re-add check vs X being changed
+ in no-else-block case. Add commentary.
+
+2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in: Revert last change.
+
+2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in: Don't include ansidecl.h in tconfig.h.
+ * gcov-io.h (PARAMS, ATTRIBUTE_UNUSED): Define if IN_LIBGCC2.
+ * unwind-dw2-fde.h (last_fde): Use __attribute__, not
+ ATTRIBUTE_UNUSED.
+
+ * configure: Regenerate.
+
+2003-01-23 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR java/6748
+ * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Don't destroy
+ regs->nip. Fix rt_sigreturn frame layout. Add support for newer
+ kernels.
+
+2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cpplex.c (cpp_interpret_charconst): Squelch warning with cast.
+
+2003-01-23 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * genattrtab.c (write_attr_get): Mark 'insn' paramter
+ as ATTRIBUTE_UNUSED.
+
+2003-01-23 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (thumb_base_register_rtx_p): New function.
+ (thumb_index_register_rtx_p): New function.
+ (thumb_legitimate_address_p): New function.
+ (thumb_legitimate_offset_p): New function.
+ * arm.h (REG_STRICT_P): Define according to setting of REG_OK_STRICT.
+ (ARM_GO_IF_LEGITIMATE_ADDRESS): Use REG_STRICT_P to avoid duplicate
+ definitions.
+ (THUMB_GO_IF_LEGITIMATE_ADDRESS): Use thumb_legitimate_address_p.
+ (THUMB_LEGITIMATE_OFFSET): Delte.
+ (THUMB_LEGITIMIZE_RELOAD_ADDRESS): Use thumb_legitimate_offset.
+ * arm-protos.h (thumb_legitimate_address_p): Add prototype.
+ (thumb_legitimate_offset_p): Likewise.
+
+2003-01-23 Andreas Schwab <schwab@suse.de>
+
+ * unwind.h (_Unwind_GetTextRelBase): Mark parameter as unused.
+
+2003-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * fixinc/Makefile.in (FL_LIST): Revert last change.
+
+2003-01-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR other/7341
+ * invoke.texi (ftest-coverage): Fix broken cross-reference.
+ Change @code to @command for gcov command.
+
+ * gcc.texi: Adjust title of gcov section.
+ Adjust copyright.
+ * gcov.texi: Likewise.
+
+2003-01-22 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/8423
+ * cse.c (fold_rtx): Only eliminate a CONSTANT_P_RTX to 1 when
+ its argument is constant, or 0 if !flag_gcse.
+ * simplify-rtx.c (simplify_rtx): Convert CONSTANT_P_RTX to 1
+ if it's argument is constant.
+ * gcse.c (want_to_gcse_p): Ignore CONSTANT_P_RTX nodes.
+ (hash_scan_set): Don't record CONSTANT_P_RTX expressions.
+ (do_local_cprop): Don't propagate CONSTANT_P_RTX constants.
+ * builtins.c (purge_builtin_constant_p): New function to force
+ instantiation of any remaining CONSTANT_P_RTX nodes.
+ * rtl.h (purge_builtin_constant_p): Prototype here.
+ * toplev.c (rest_of_compilation): Invoke purge_builtin_constant_p
+ pass after GCSE and before loop.
+ (flag_gcse): No longer static.
+ * flags.h (flag_gcse): Prototype here.
+
+2003-01-22 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.h (HARD_REGNO_MODE_OK): Fix warning regression
+ introduced by last change.
+
+2003-01-22 Andreas Schwab <schwab@suse.de>
+
+ * ra-rewrite.c (rewrite_program2): Initialize bb to avoid warning.
+
+2003-01-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (h8300_shift_needs_scratch_p): Don't
+ request a scratch reg on H8S when the shift count is 8.
+
+2003-01-22 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390-protos.h (preferred_la_operand_p):
+ Remove second parameter.
+ * config/s390/s390.c (preferred_la_operand_p): Likewise.
+ * config/s390/s390.h (FRAME_REGNO_P, FRAME_REG_P): New macros.
+ (HARD_REGNO_MODE_OK): Use FRAME_REGNO_P.
+ * config/s390/s390.md ("*la_cc_64", "*la_cc_31", splitters): Remove.
+ Add peepholes to transform ADD to LOAD ADDRESS.
+
+2003-01-22 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_address_register_rtx_p): New function.
+ (arm_legitimate_address_p): New function.
+ (arm_legitimate_index_p): New function.
+ (legitimize_pic_address): Use arm_legitimate_index_p.
+ * arm-protos.h (arm_legtimate_address_p): Add prototype.
+ * arm.h (ARM_GO_IF_LEGITIMATE_INDEX): Delete.
+ (ARM_GO_IF_LEGITIMATE_ADDRESS): Call arm_legitimate_address_p.
+
+2003-01-22 Hartmut Penner <hpenner@de.ibm.com>
+
+ * config/s390/s390.md (floatdfdi2): Insn has type 'itof'.
+ * config/s390/2064.md (define_bypass): Correct 'Load' and
+ 'Load-address' bypass values.
+
+2003-01-22 Andreas Schwab <schwab@suse.de>
+
+ * config/ia64/t-ia64 (insn-attrtab.o-warn): Define as -Wno-error.
+
+2003-01-21 Zack Weinberg <zack@codesourcery.com>
+
+ * genautomata.c (output_internal_insn_latency_func,
+ output_print_reservation_func): Short circuit when there is no
+ automaton to generate code for.
+
+2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (ssa-ccp.o): Depend on coretypes.h $(TM_H).
+ (df.o): Delete duplicate dependency on coretypes.h $(TM_H).
+
+2003-01-21 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.md: Remove warning.
+ (builtin_setjmp_receiver): Likewise.
+ * config/darwin.c (update_stubs): Slightly improve terrible hack
+ with identifiers. Add comment pointing out problems with it.
+ (update_non_lazy_ptrs): Likewise.
+
+2003-01-21 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (lookup_filename): Fix printf format warning.
+ * system.h (fread_unlocked, fwrite_unlocked): Undef.
+
+ * fixinc/Makefile.in (FL_LIST): Add $($@-warn) hook.
+ (fixincl.o-warn, gnu-regex.o-warn): New.
+ * fixinc/fixfixes.c (FIX_PROC_HEAD): Mark parameters unused.
+ * fixinc/fixtests.c (TEST_FOR_FIX_PROC_HEAD): Likewise.
+ * fixinc/fixincl.c (process): Fix printf format warning.
+
+2003-01-21 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * dwarf2out (output_file_names): Don't crash if called
+ with empty file_table.
+
+2003-01-21 Zack Weinberg <zack@codesourcery.com>
+
+ * genautomata.c (output_internal_insn_latency_func): Add
+ missing break statement to generated code.
+
+2003-01-21 Roger Sayle <roger@eyesopen.com>
+
+ * stmt.c (same_case_target_p): New function to determine whether
+ two case labels branch to the same target. Split out from...
+ (group_case_nodes): ... here. Use same_case_target_p instead.
+ (strip_default_case_nodes): Remove explicit case nodes
+ that branch to the default destination.
+ (expand_end_case_type): Call strip_default_case_nodes after
+ group_case_nodes, to simplify the case-list before we count it.
+ Only generate table_label RTX when actually needed. Try to share
+ thiscase->exit_label and thiscase->data.case_stmt.default_label
+ when a switch has no explicit default case. Simplify test for
+ constant index.
+
+2003-01-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*negsf2_h8300): Use \\t instead of
+ \t.
+ (*negsf2_h8300hs): Likewise.
+ (*addsi3_lshiftrt_16_zexthi): Likewise.
+ (*iorhi3_lshiftrt_8): Likewise.
+
+2003-01-21 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * dwarf2out.c (fde_table_in_use): Mark GTY.
+ (dwarf2out_cfi_label_num): New variable, marked GTY.
+ (dwarf2out_cfi_label): Use it instead of static label_num.
+ * emit-rtl.c (label_num): Mark GTY.
+
+2003-01-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_plussi): Support H8/300.
+ (compute_plussi_length): Likewise.
+ (compute_plussi_cc): Likewise.
+ * config/h8300/h8300.md (addsi_h8300): Use output_plussi to
+ output assembly instructions.
+
+2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * calls.c (fix_unsafe_tree): Prototype.
+
+ * Makefile.in (GCC_WARN_CFLAGS): Add $(WERROR) $($@-warn)
+ (gtype-desc.o-warn, c-decl.o-warn, varasm.o-warn, gcc.o-warn,
+ insn-conditions.o-warn, out_object_file, gengtype-yacc.o-warn,
+ c-parse.o-warn): Add -Wno-error.
+ (STAGE2_FLAGS_TO_PASS): Add WERROR="@WERROR@".
+
+ * configure.in (--enable-werror): Add new flag.
+ * doc/install.texi (--enable-werror): Document.
+ * configure: Regenerate.
+
+ * objc/Make-lang.in (objc/objc-parse.o-warn): Add -Wno-error.
+
+2003-01-21 Andreas Schwab <schwab@suse.de>
+
+ * genautomata.c (output_internal_insn_latency_func): Fix missing
+ close paren in output.
+
+2003-01-21 Zack Weinberg <zack@codesourcery.com>
+
+ * genautomata.c: Space savings in generated code:
+ (output_dfa_insn_code_func): Split out the table-enlargement
+ path to an out-of-line static function, dfa_insn_code_enlarge.
+ (output_internal_insn_latency_func): Use a lookup table for the
+ default latencies.
+ (output_print_reservation_func): Use a lookup table for the
+ strings.
+
+2003-01-21 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+ PR opt/7507
+ * calls.c (fix_unsafe_tree): Split out from ...
+ (expand_call): ... here. Use it on the function address too.
+
+2003-01-20 Richard Henderson <rth@redhat.com>
+
+ * expr.h (default_must_pass_in_stack): Move decl outside ifdef.
+
+2003-01-20 Richard Henderson <rth@redhat.com>
+
+ PR opt/7154
+ * stmt.c (expand_asm_operands): Validize memory operands.
+
+2003-01-20 Richard Henderson <rth@redhat.com>
+
+ PR opt/8848
+ * ifcvt.c (noce_process_if_block): Correct arguments to
+ modified_between_p for no-else-block case.
+
+2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (const_costs): Remove a warning.
+ (output_plussi): Likewise.
+ (compute_plussi_length): Likewise.
+ (compute_plussi_cc): Likewise.
+
+2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (addsi_h8300): Remove the last
+ alternative.
+
+2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (get_shift_alg): Remove redundant code.
+
+2003-01-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * system.h (__NO_STRING_INLINES): Define.
+
+2003-01-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * ifcvt.c (noce_emit_store_flag): Don't emit store flag if mode of x
+ is not a scalar int mode.
+
+2003-01-20 Roger Sayle <roger@eyesopen.com>
+
+ * cse.c (cse_insn): Avoid RTL sharing when updating the RETVAL
+ insn's notes following a substitution inside a libcall.
+
+2003-01-20 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.in: Check for system-provided 'uchar' type.
+ * configure, config.in: Regenerate.
+ * cpphash.h: Only typedef 'uchar' if the system doesn't.
+
+2003-01-20 Richard Henderson <rth@redhat.com>
+
+ * expr.h (MUST_PASS_IN_STACK): Move implementation...
+ * calls.c (default_must_pass_in_stack): ... here.
+
+2003-01-20 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c.
+
+ * genautomata.c (INSN_ALTS_FUNC_NAME): Move it into genattrtab.h.
+
+ * genattr.c (main): Output default definition of AUTOMATON_ALTS.
+ Wrap up definition of `insn_alts'.
+
+ * genattrtab.c (main): Wrap up `insn_alts'.
+
+2003-01-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * collect2.c (ldgetname): Check HAVE_DECL_LDGETNAME before
+ prototyping.
+ * configure.in: Check for <ldfcn.h> and ldgetname() prototype.
+
+ * config.in, configure: Regenerate.
+
+2003-01-20 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.md (sibcall_epilogue): Add an
+ UNSPEC_PROLOGUE_USE to prevent the link register from being
+ considered dead.
+
+2003-01-20 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (SSE cmov splitter): Handle memory operand in operand 5.
+
+2003-01-20 Andreas Schwab <schwab@suse.de>
+
+ * system.h: Don't declare strsignal if the decl test hasn't been
+ run yet.
+
+2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (notice_update_cc): Don't assume that
+ recog_data.operands[0] is always associated with cc0.
+
+2003-01-19 David Edelsohn <edelsohn@gnu.org>
+
+ * collect2.c (ldgetname): Expand declaration to prototype.
+ * read-rtl.c (atoll): Add prototype.
+ * system.h (strsignal): Also declare if no declaration found.
+
+2003-01-19 Alexandre Oliva <aoliva@redhat.com>
+
+ * config.gcc (mips64*-*-linux*): Added.
+ * config/mips/linux64.h, config/mips/t-linux64: New file.
+ * config/mips/iris6.h (MIPS_TFMODE_FORMAT): Define.
+ * config/mips/mips.c (override_options): Use it.
+ * config/mips/mips.h (TARGET_SWITCHES): Added...
+ (SUBTARGET_TARGET_SWITCHES): New, empty by default.
+ * Makefile.in (SPECS): New.
+ (STAGESTUFF, specs, mostlyclean, install-common): Use it.
+ * gcc.c (process_command): Move self-spec processing past spec
+ file loading.
+ * doc/tm.texi (DRIVER_SELF_SPECS): Document the change.
+ * doc/fragments.texi (MULTILIB_EXTRA_OPTS): Document need for
+ CRTSTUFF_T_CFLAGS.
+ (SPECS): Document.
+ * doc/invoke.texi (-mabi-fake-default): Document.
+
+2003-01-19 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (stack_push_word, stack_pop_word,
+ z_reg, z_reg_qi): Declare static and GTY().
+ (da_reg): Remove.
+ (create_regs_rtx): Don't create da_reg.
+ ("gt-m68hc11.h"): Include for GTY roots.
+ * config/m68hc11/m68hc11.h (ix_reg, iy_reg, d_reg): Declare extern
+ and GTY() here.
+ (m68hc11_compare_op0, m68hc11_compare_op1): Likewise.
+ (m68hc11_soft_tmp_reg): Likewise.
+ * config/m68hc11/m68hc11-protos.h: Remove above declarations.
+
+2003-01-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * basic-block.h: Fix comment formatting.
+ * calls.c: Likewise.
+ * combine.c: Likewise.
+ * convert.c: Likewise.
+ * gcov.c: Likewise.
+ * haifa-sched.c: Likewise.
+ * libgcc2.c: Likewise.
+ * loop.c: Likewise.
+ * profile.c: Likewise.
+ * system.h: Likewise.
+
+2003-01-18 Roger Sayle <roger@eyesopen.com>
+
+ * config/pa/pa.md (muldi3): Avoid invalid sharing of SUBREG RTXs.
+
+2003-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ra-build.c (undef_to_size_word): Avoid `switch' warning.
+
+2003-01-17 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.md (*floatsidf2_internal): Add earlyclobbers.
+ (*floatunssidf2_internal): Ditto.
+
+2003-01-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * alias.c: Fix comment typos.
+ * basic-block.h: Likewise.
+ * c-common.c: Likewise.
+ * c-common.h: Likewise.
+ * c-decl.c: Likewise.
+ * c-opts.c: Likewise.
+ * c-pragma.c: Likewise.
+ * c-pretty-print.h: Likewise.
+ * cfg.c: Likewise.
+ * cfganal.c: Likewise.
+ * cfgbuild.c: Likewise.
+ * cfgcleanup.c: Likewise.
+ * cfglayout.c: Likewise.
+ * cfgrtl.c: Likewise.
+ * convert.c: Likewise.
+ * cpphash.h: Likewise.
+ * cpplex.c: Likewise.
+ * cpplib.h: Likewise.
+ * df.h: Likewise.
+ * diagnostic.c: Likewise.
+ * diagnostic.h: Likewise.
+ * dwarf2.h: Likewise.
+
+2003-01-17 Stan Shebs <shebs@apple.com>
+
+ * config/darwin-protos.h: Forward-declare struct cpp_reader.
+
+2003-01-17 Douglas B Rupp <rupp@gnat.com>
+
+ * config/alpha/alpha.c (alpha_need_linkage): Fix obvious
+ mistake in last checkin.
+
+2003-01-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * et-forest.c: Fix comment typos.
+ * et-forest.h: Likewise.
+ * except.c: Likewise.
+ * expr.c: Likewise.
+ * flags.h: Likewise.
+ * flow.c: Likewise.
+ * gcc.c: Likewise.
+ * gcse.c: Likewise.
+ * genattrtab.c: Likewise.
+ * genautomata.c: Likewise.
+ * gengtype.c: Likewise.
+ * genrecog.c: Likewise.
+ * global.c: Likewise.
+ * gthr-rtems.h: Likewise.
+
+2003-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * i386.c (x86_function_profiler): Fix format specifier.
+
+2003-01-17 Richard Henderson <rth@redhat.com>
+
+ * gengtype.c (walk_type): Allow paramN_is.
+
+2003-01-17 Nick Clifton <nickc@redhat.com>
+
+ * config/i960/t-960bare (i960-c.o): Add missing newline escape.
+
+2003-01-16 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/linux-elf.h (LIB_SPEC): Adjust inter-option spacing.
+
+2003-01-16 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_sr_alias_set): Mark GTY.
+ (alpha_next_sequence_number): Likewise.
+ (alpha_this_literal_sequence_number): Likewise.
+ (alpha_this_gpdisp_sequence_number): Likewise.
+ (struct alpha_funcs, alpha_funcs_num): Likewise.
+ (struct alpha_links): Fix branch merge error.
+ (alpha_need_linkage, alpha_use_linkage): Use GC for alpha_funcs.
+
+2003-01-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mips/mips.h: Don't use #elif. Reported by Kaveh
+ R. Ghazi.
+
+2003-01-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ifcvt.c: Fix comment typos.
+ * lcm.c: Likewise.
+ * libgcc2.c: Likewise.
+ * local-alloc.c: Likewise.
+ * loop.c: Likewise.
+ * predict.c: Likewise.
+ * ra-build.c: Likewise.
+ * ra.c: Likewise.
+ * ra-colorize.c: Likewise.
+ * ra.h: Likewise.
+ * ra-rewrite.c: Likewise.
+ * regmove.c: Likewise.
+ * reload.h: Likewise.
+ * rtlanal.c: Likewise.
+ * toplev.c: Likewise.
+ * tree.h: Likewise.
+ * unwind-dw2-fde-glibc.c: Likewise.
+ * vmsdbgout.c: Likewise.
+
+2003-01-16 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (struct file_table): Remove.
+ (FILE_TABLE_INCREMENT): Remove.
+ (file_table): Make a varray; mark for GC. Update all users.
+ (file_table_last_lookup_index): Extract from struct file_table.
+ (output_file_names): Fix unsigned compare warnings.
+ (add_name_attribute): Remove inline marker.
+ (add_comp_dir_attribute): Split out from gen_compile_unit_die.
+ (lookup_filename): Don't manage size of file_table.
+ (init_file_table): Allocate file_table with GC.
+ (dwarf2out_init): Don't record main_input_filename here.
+ (dwarf2out_finish): Do it here instead.
+
+2003-01-16 Bruce Korb <bkorb@gnu.org>
+
+ * gcc/fixinc/inclhack.def(limits_ifndef): QNX needs a bypass, too.
+
+2003-01-16 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (sh_initialize_trampoline): Emit rotrdi3_mextr
+ instead of rotldi3_mextr.
+
+2003-01-16 Vladimir Makarov <vmakarov@redhat.com>
+
+ * haifa-sched.c (move_insn): Restore moving all schedule group.
+ (set_priorities): Restore taking SCHED_GROUP_P into account.
+
+ * sched-deps.c (add_dependence): Restore processing the last group
+ insn.
+ (remove_dependence, group_leader): Restore the functions.
+ (set_sched_group_p): Restore adding dependencies from previous insn
+ in the group.
+ (compute_forward_dependences): Restore usage of group_leader.
+
+ * sched-ebb.c (init_ready_list): Restore taking SCHED_GROUP_P into
+ account.
+
+ * sched-rgn.c (init_ready_list): Restore taking SCHED_GROUP_P into
+ account.
+ (can_schedule_ready_p): Ditto.
+ (add_branch_dependences): Restore skipping over the group insns.
+
+2003-01-16 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Fix handling
+ 68HC12 pre/post inc/dec side effects.
+
+2003-01-16 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.h (MASK_M6812): Define.
+
+2003-01-16 J"orn Rennecke <amylaar@onetel.net.uk>
+
+ * sh.md (mshflo_w_x): Fix description of operation.
+
+2003-01-16 Zack Weinberg <zack@codesourcery.com>
+
+ * config/rs6000/rs6000.h: Mention Altivec registers in
+ commentary. Fix typo.
+
+2003-01-16 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md (movti_string): Remove clobber.
+ * config/rs6000/rs6000.c (rs6000_emit_move, TImode): Explicitly
+ generate PARALLEL with clobber for TARGET_POWER.
+
+2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ra-colorize.c (colorize_one_web): Initialize variable.
+ * regmove.c (fixup_match_1): Likewise.
+ * reload1.c (reload_as_needed): Likewise.
+ * sdbout.c (SET_KNOWN_TYPE_TAG): Add cast.
+
+2003-01-16 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloop.c (flow_loops_find): Fix handling of abnormal edges.
+
+2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * dbxout.c (lastfile, cwd): Fix `unused' warning.
+ * dwarf2out.c (fde_table_in_use, current_funcdef_fde,
+ dw_cfi_oprnd1_desc, dw_cfi_oprnd2_desc, next_die_offset,
+ is_main_source, file_table, decl_die_table_in_use,
+ abbrev_die_table_in_use, line_info_table_in_use,
+ separate_line_info_table_in_use, pubname_table_in_use,
+ arange_table_in_use, ranges_table_in_use,
+ current_function_has_inlines): Likewise.
+ * flow.c (life_analysis): Likewise.
+ * genemit.c (gen_insn): Likewise.
+ * protoize.c (cplus_suffix): Likewise.
+
+ * arm.c (ROUND_UP_WORD): Renamed from ROUND_UP.
+ * arm.h (ROUND_UP_WORD): Likewise.
+
+ * arm.h (CONDITIONAL_REGISTER_USAGE): Avoid signed/unsigned
+ warning.
+ * emit-rtl.c (gen_rtx_REG, set_mem_attributes_minus_bitpos,
+ init_emit_once): Likewise.
+ * flow.c (mark_regs_live_at_end, calculate_global_regs_live):
+ Likewise.
+ * function.c (assign_stack_temp_for_type): Likewise.
+ * loop.c (loop_invariant_p): Likewise.
+ * recog.c (push_operand): Likewise.
+ * regclass.c (init_reg_sets_1): Likewise.
+ * reload.c (update_auto_inc_notes): Likewise.
+ * reload1.c (reload_as_needed, emit_input_reload_insns): Likewise.
+ * stmt.c (expand_asm_operands): Likewise.
+ * stor-layout.c (start_record_layout): Likewise.
+
+2003-01-16 Herman A.J. ten Brugge <hermantenbrugge@home.nl>
+
+ * config/c4x/c4x.md (epilogue): Correct last patch.
+
+2003-01-15 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (find_lo_sum_using_gp): Rename from find_lo_sum;
+ also check that GP is being used.
+ (alpha_find_lo_sum_using_gp): New.
+ (alpha_does_function_need_gp): Use get_attr_usegp.
+ * config/alpha/alpha-protos.h: Update.
+ * config/alpha/alpha.md (attr usegp): New. Annotate patterns
+ as needed.
+
+2003-01-15 Roger Sayle <roger@eyesopen.com>
+
+ * gcse.c (one_cprop_pass): Change function arguments to take both
+ cprop_jumps and bypass_jumps flags instead of just alter_jumps.
+ (gcse_main): Update calls to one_cprop_pass, disabling bypassing.
+ (bypass_jumps): New function to perform separate jump bypassing pass.
+ * rtl.h (bypass_jumps): Add function prototype.
+ * timevar.def (TV_BYPASS): New timing variable.
+ * toplev.c (enum dump_file_index): Add new entry DFI_bypass.
+ (dump_file): New entry for the bypass RTL dump file.
+ (rest_of_compilation): Insert new jump bypassing optimization
+ pass after loop.
+ * doc/passes.texi: Document new pass.
+
+2003-01-15 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * som.h (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY, MAKE_DECL_ONE_ONLY,
+ ASM_WEAKEN_LABEL, GTHREAD_USE_WEAK): Define.
+ * pa.h (TARGET_SOM_SDEF): Define.
+ * pa-hpux11.h (TARGET_SOM_SDEF): Define.
+
+2003-01-16 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (expand_prologue): Use push/pop to
+ allocate 4-bytes of locals on 68HC11.
+ (expand_epilogue): Likewise.
+ (m68hc11_memory_move_cost): Increase cost of HI/QI soft registers.
+
+2003-01-15 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.h (ASM_SPEC): Handle -m68hcs12; Pass -mshort
+ and -mshort-double to the assembler to specify the ABI.
+ (LINK_SPEC): Likewise.
+ (CPP_SPEC): Pass HCS12 specific define.
+ (MASK_M68S12): New define.
+ (TARGET_M68S12): Likewise.
+ (TARGET_SWITCHES): New options -m68hcs12 and -m68S12.
+ (TARGET_VERSION): Update.
+ * config/m68hc11/m68hc12.h (CPP_SPEC): Pass HCS12 specific define.
+ (LINK_SPEC): Update.
+ (ASM_SPEC): Update.
+ * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Update.
+ * doc/invoke.texi (M68hc1x Options): Document -m68hcs12.
+
+2003-01-15 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.md ("return"): Use emit_jump_insn to emit
+ the return code.
+
+2003-01-15 Josef Zlomek <zlomekj@suse.cz>
+
+ * cfganal.c (set_edge_can_fallthru_flag): Clear the EDGE_CAN_FALLTHRU
+ flag before setting it.
+
+2003-01-15 Roger Sayle <roger@eyesopen.com>
+
+ * c-semantics.c (genrtl_while_stmt): Improve initial RTL generation
+ when loop condition is known true, i.e. "while (1) { ... }".
+ (genrtl_for_stmt): Similarly for "for" statements.
+
+2003-01-15 Roger Sayle <roger@eyesopen.com>
+
+ * real.c (real_sqrt): Return a bool result indicating whether
+ a floating point exception or trap should be raised.
+ * real.h (real_sqrt): Update function prototype.
+ * builtins.c (fold_builtin): Only fold non-trapping square
+ roots unless we're ignoring errno and trapping math.
+
+2003-01-15 John David Anglin <dave.anglin@nrc.gc.ca>
+
+ * expr.h (emit_conditional_add): Add PARAMS to declaration.
+ * gengtype-lex.l (malloc, realloc): Move defines after include of
+ system.h. Remove duplicate include of system.h.
+
+2003-01-15 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/9009
+ * optabs.c (expand_unop): When manipulating the FP sign bit
+ using integer operations, account for targets with different
+ integer and FP word orders.
+ (expand_abs): Likewise.
+
+2003-01-15 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_gen_section_name): Do not include
+ file extension in section name.
+
+2003-01-15 Richard Earnshaw <rearnsha@arm.com>
+
+ * flow.c (find_auto_inc): Also try to generate a PRE_MODIFY with
+ constant offset.
+
+2003-01-15 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (HAVE_PRE_MODIFY_DISP, HAVE_PRE_MODIFY_REG): Define.
+ (HAVE_POST_MODIFY_DISP, HAVE_POST_MODIFY_REG): Define.
+ (ARM_GO_IF_LEGITIMATE_ADDRESS): Handle pre/post-modify addresses.
+ (ARM_PRINT_OPERAND_ADDRESS): Likewise.
+
+2003-01-15 Jan Hubicka <jh@suse.cz>
+
+ PR f/9258
+ * global.c (struct allocno): Add no_stack_reg.
+ (global_conflicts): Set no_stack_reg.
+ (find_reg): Use it.
+
+ * convert.c (convert_to_real): Fold - and abs only when profitable.
+ * fold-const.c (fold): Fold truncates in - and abs.
+
+2003-01-15 Josef Zlomek <zlomekj@suse.cz>
+
+ Segher Boessenkool <segher@koffie.nl>
+
+ * predict.c (real_inv_br_prob_base): New variable.
+ (propagate_freq): Use multiply by reciprocal instead of
+ division. Don't divide by 1.0 at all.
+ (estimate_bb_frequencies): Similar.
+
+2003-01-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (libgcc_visibility): Force disabled on IRIX 6 too.
+ * configure: Rebuilt.
+
+2003-01-15 Hartmut Penner <hpenner@de.ibm.com>
+
+ * config/s390/s390.c (s390_safe_attr_type): New function.
+ (s390_use_dfa_pipeline_interface): New function, return true for z900.
+ (s390_issue_rate): New function.
+ (s390_agen_dep_p): New function.
+ (addr_generation_dependency_p): Use 's390_safe_attr_type'.
+ (s390_adjust_cost): Return 'cost' if new DFA is used.
+ (s390_adjust_priority): Delete function.
+ * config/s390/s390-protos.h: (s390_agen_dep_p): New prototype.
+ * config/s390/s390.md (atype attribute): Attribute 'atype' default
+ determined by 'op_type'.
+ (type attribute): Added more type attributes.
+ * config/s390/2064.md: New DFA description for z900 pipeline.
+
+2003-01-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_vector_move): Validize constant
+ forced to memory. Fixes PR bootstrap/9036.
+
+ * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Define so as
+ to set $gp before the call.
+
+2003-01-14 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_expand_mov): Use correct mode
+ for force_const_mem.
+
+2003-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * genattr.c (main): Rearrange output to avoid prototype warning.
+ * genautomata.c (transform_3): Fix ambiguous-else warning.
+ * local-alloc.c (requires_inout): Add parentheses around
+ assignment used as truth-value.
+ * timevar.c: Move system includes above local includes. Include
+ toplev.h
+ * Makefile.in (timevar.o): Depend on toplev.h.
+
+2003-01-14 Denis Chertykov <denisc@overta.ru>
+
+ * config/ip2k/ip2k.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+ (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+
+ * config/ip2k/ip2k.c (ip2k_attribute_table): New table of
+ attributes.
+ (TARGET_ATTRIBUTE_TABLE): New macro.
+ (valid_machine_type_attribute): Remove.
+ (valid_machine_decl_attribute): Remove.
+ (ip2k_handle_progmem_attribute): New function.
+ (ip2k_handle_fndecl_attribute): New function.
+
+2003-01-10 Andrew Haley <aph@redhat.com>
+
+ * config/i386/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Rename
+ registers to be in correct order. Add rip.
+
+2003-01-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*andsi3_lshiftrt_9_sb): New.
+ (*iorsi3_and_lshiftrt_9_sb): Likewise.
+
+2003-01-14 Jan Hubicka <jh@suse.cz>
+
+ * convert.c (strip_float_extensions): Look for narrowest type handling
+ FP constants.
+
+ * fold-const.c (fold): Fold (double)float1 CMP (double)float2 into
+ float1 CMP float2.
+ * convert.c (strip_float_extensions): Make global.
+ * tree.h (strip_float_extensions): Declare.
+
+2003-01-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * timevar.def: define TV_NAME_LOOKUP.
+ * timevar.c (timevar_pop): Be verbose when aborting.
+
+2003-01-13 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.in ($(parsedir)/gengtype-lex.c): Don't change to
+ $(parsedir), just move the temporary file at the end.
+ ($(parsedir)/gengtype-yacc.c): Likewise.
+
+2003-01-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * aclocal.m4 (gcc_AC_PROG_GNAT): Don't try to prepend
+ ${ac_tool_prefix} to ADAC or CC. Protect them from word
+ splitting.
+ * configure: Rebuilt.
+
+2003-01-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/sparc/gmon-sol2.c (moncontrol, monstartup, _mcleanup,
+ internal_mcount): Don't use PARAMS.
+ (monstartup, _mcleanup, internal_mcount, moncontrol): Convert to
+ ISO C style.
+ (internal_mcount): Use __attribute__, not ATTRIBUTE_UNUSED.
+
+2003-01-13 Andreas Schwab <schwab@suse.de>
+
+ * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Output type
+ directive.
+
+2003-01-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*andsi3_lshift_n_sb): New.
+ (*iorsi3_and_lshiftrt_n_sb): Likewise.
+
+2003-01-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9264
+ * c-lex.c (c_lex): Set the token value to error_mark_node for
+ invalid numeric constants.
+
+2003-01-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-pch.c (asm_file_startpos): Change to `long'.
+ (pch_init): Use ftell, not ftello.
+ (c_common_write_pch): Use ftell/fseek, not ftello/fseeko.
+ Use `long' instead of `off_t'.
+ (c_common_read_pch): Likewise.
+ * ggc-common.c (gt_pch_save): Use long/ftell instead of
+ off_t/ftello.
+
+2003-01-12 Alan Modra <amodra@bigpond.net.au>
+
+ * expr.c (expand_expr <RDIV_EXPR>): Correct recursive call args.
+
+2003-01-11 Richard Earnshaw (rearnsha@arm.com)
+
+ * arm-protos.h (struct cpp_reader): Add declaration.
+
+2003-01-11 Jan Hubicka <jh@suse.cz>
+
+ PR target/9068
+ * i386.c (output_fp_compare): Fix typo.
+
+2003-01-10 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (common_mode_defined): Mark for PCH.
+
+2003-01-10 Geoffrey Keating <geoffk@apple.com>
+
+ * Makefile.in (parsedir): New variable.
+ (docobjdir): New variable.
+ (c-parse.o, c-parse.c, c-parse.y, gengtype-lex.o, gengtype-yacc.o,
+ gengtype-lex.c, gengtype-yacc.c): Use parsedir.
+ (info, cpp.info, gcc.info, gccint.info, gccinstall.info,
+ cppinternals.info, generated-manpages, gcov.1, cpp.1, gcc.1, gfdl.7,
+ gpl.7, fsf-funding.7, maintainer-clean, install-info, install-man):
+ Use docobjdir.
+ * objc/Make-lang.in (objc/objc-parse.c, objc/objc-parse.y,
+ objc.maintainer-clean): Use parsedir.
+
+ * varasm.c (struct constant_descriptor_rtx): Remove unused
+ `label' field.
+
+ * toplev.c (documented_lang_options): Document -Winvalid-pch.
+
+2003-01-10 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.h (NO_PROFILE_COUNTERS): Set.
+ (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Kill.
+
+2003-01-10 Richard Henderson <rth@redhat.com>
+
+ * combine.c (make_compound_operation): Use SCALAR_INT_MODE_P,
+ not INTEGRAL_MODE_P when widening extensions.
+
+2003-01-10 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (decl_has_samegp): True for !TREE_PUBLIC.
+
+2003-01-10 Geoffrey Keating <geoffk@apple.com>
+
+ * ggc-page.c (ggc_collect): Avoid overflow computing
+ min_expand.
+
+ * Makefile.in (RANLIB_FOR_TARGET): Use RANLIB when native.
+ (RANLIB_TEST_FOR_TARGET): Delete. Don't pass down to sub-makes.
+ Remove calls.
+ * mklibgcc.in: Remove uses of RANLIB_TEST_FOR_TARGET.
+
+2003-01-10 Jan Hubicka <jh@suse.cz>
+
+ * ifcvt.c (noce_try_addcc): Do not call emit_conditional_add
+ with weird operands.
+
+2003-01-10 Dale Johannesen <dalej@apple.com>
+
+ * calls.c (load_register_parameters): Add is_sibcall, sibcall_failure
+ parameters. Call check_sibcall_argument_overlap if indicated.
+ (check_sibcall_argument_overlap): Add mark_stored_args_map
+ parameter. Don't mark parameter area as clobbered if not set.
+ (expand_call): Adjust calls to above.
+
+2003-01-10 Kelley Cook <kelleycook@comcast.net>
+
+ * configure.in (linker read-only and read-write section mixing):
+ Squelch some assembler warnings.
+ * configure: Likewise.
+
+2003-01-10 Hartmut Penner <hpenner@de.ibm.com>
+
+ * doc/invoke.texi: Document -mtune, delete -mcpu
+ option for S/390 and zSeries.
+ * config/s390/s390.c (s390_tune_string) New variable.
+ (s390_cpu_string) Delete variable.
+ (override_options): Use s390_tune_string instead of
+ s390_cpu_string.
+ * config/s390/s390.h: (TARGET_OPTIONS) '-mtune' instead of '-mcpu'.
+
+2003-01-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*iorsi3_ashift_31): New.
+
+2003-01-10 Josef Zlomek <zlomekj@suse.cz>
+
+ * jump.c (next_nonnote_insn_in_loop): New function.
+ (copy_loop_headers): Use next_nonnote_insn_in_loop instead of
+ next_nonnote_insn.
+ (duplicate_loop_exit_test). Likewise.
+
+2003-01-09 Geoffrey Keating <geoffk@apple.com>
+
+ Merge from pch-branch:
+
+ 2003-01-06 Geoffrey Keating <geoffk@apple.com>
+
+ * ggc-page.c (ggc_pch_read): Update the statistics after a PCH
+ load.
+
+ 2002-12-24 Geoffrey Keating <geoffk@apple.com>
+
+ * cpplib.c (count_registered_pragmas): New function.
+ (save_registered_pragmas): New function.
+ (_cpp_save_pragma_names): New function.
+ (restore_registered_pragmas): New function.
+ (_cpp_restore_pragma_names): New function.
+ * cpphash.h (_cpp_save_pragma_names): Prototype.
+ (_cpp_restore_pragma_names): Likewise.
+ * cpppch.c (struct save_macro_item): Split from save_macro_data.
+ (struct save_macro_data): New field 'saved_pragmas'.
+ (save_macros): Update for changes to struct save_macro_data.
+ (cpp_prepare_state): Call _cpp_save_pragma_names, update
+ for changes to struct save_macro_data.
+ (cpp_read_state): Call _cpp_restore_pragma_names, update
+ for changes to struct save_macro_data.
+
+ * cpppch.c (cpp_read_state): Restore the hashtable references
+ in the cpp_reader.
+
+ * tree.h (built_in_decls): Mark for PCH.
+
+ * dbxout.c (lastfile): Don't mark for PCH.
+
+ * ggc.h: Document PCH calls into memory managers.
+
+ 2002-12-18 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/invoke.texi (Precompiled Headers): Document the
+ directory form of PCH.
+ * cppfiles.c (validate_pch): New function.
+ (open_file_pch): Search suitably-named directories for PCH files.
+
+ 2002-12-14 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/gty.texi (GTY Options): Document chain_next, chain_prev,
+ reorder options.
+ (Type Information): Mention that the information is also
+ used to implement PCH.
+ * doc/passes.texi (Passes): Improve documentation of
+ language-specific files.
+
+ 2002-12-11 Geoffrey Keating <geoffk@apple.com>
+
+ * gengtype.c (struct write_types_data): Add reorder_note_routine field.
+ (struct walk_type_data): Add reorder_fn field.
+ (walk_type): Process 'reorder' option.
+ (write_types_process_field): Reorder parameters to gt_pch_note_object,
+ call reorder_note_routine.
+ (write_func_for_structure): Reorder parameters to gt_pch_note_object.
+ (ggc_wtd): Update for change to struct write_types_data.
+ (pch_wtd): Likewise.
+ * ggc.h (gt_pch_note_object): Reorder parameters.
+ (gt_handle_reorder): New definition.
+ (gt_pch_note_reorder): New prototype.
+ * ggc-common.c (struct ptr_data): Add reorder_fn.
+ (gt_pch_note_object): Reorder parameters.
+ (gt_pch_note_reorder): New.
+ (gt_pch_save): Call reorder_fn.
+ * stringpool.c (gt_pch_n_S): Update for change to gt_pch_note_object.
+
+ * dbxout.c (cwd): Don't mark for PCH.
+
+ 2002-12-09 Geoffrey Keating <geoffk@apple.com>
+
+ * gengtype.c (finish_root_table): Fix some warnings.
+ (write_root): Handle TYPE_STRING.
+ * ggc.h (gt_ggc_m_S): Add prototype.
+ * stringpool.c (gt_ggc_m_S): New function.
+
+ 2002-11-30 Geoffrey Keating <geoffk@apple.com>
+
+ * dwarf2out.c (dw2_string_counter): New.
+ (AT_string_form): Use it.
+ (same_dw_val_p): Update for removal of hashtable.h hash tables.
+
+ 2002-11-22 Geoffrey Keating <geoffk@apple.com>
+
+ * dbxout.c: Include gt-dbxout.h.
+ (lastfile): Mark for PCH/GGC.
+ (cwd): Likewise.
+ (struct typeinfo): Likewise.
+ (typevec): Likewise.
+ (typevec_len): Likewise.
+ (next_type_number): Likewise.
+ (struct dbx_file): Likewise.
+ (current_file): Likewise.
+ (next_file_number): Likewise.
+ (dbxout_init): Allocate typevec, struct dbx_file with GGC.
+ (dbxout_start_source_file): Allocate struct dbx_file with GGC.
+ (dbxout_end_source_file): Don't free struct dbx_file.
+ (dbxout_type): Use GGC to allocate typevec.
+ * Makefile.in (dbxout.o): Depend on gt-dbxout.h, $(GGC_H).
+ (GTFILES): Add dbxout.c.
+ (gt-dbxout.h): New rule.
+
+ * Makefile.in (c-pch.o): Add debug.h as dependency.
+ * c-pch.c: Include debug.h.
+ (pch_init): Call start_source_file to keep nesting right.
+ (c_common_read_pch): Add orig_name parameter. Call
+ start_source_file debug hook. Call end_source_file debug hook.
+ * c-common.h (c_common_read_pch): Update prototype.
+ * cpplib.h (struct cpp_callbacks): Add fourth field to read_pch
+ callback.
+ * cppfiles.c (struct include_file): Add new field `header_name'.
+ (find_or_create_entry): Default it to `name'.
+ (open_file_pch): Set it to the original header file searched for.
+ (stack_include_file): Don't stack an empty buffer, just handle
+ PCH files immediately. Pass header_name field to read_pch callback.
+
+ 2002-11-19 Geoffrey Keating <geoffk@apple.com>
+
+ * function.c (funcdef_no): Mark to be saved in a PCH.
+
+ 2002-11-15 Geoffrey Keating <geoffk@apple.com>
+
+ * ggc-page.c (ggc_pch_read): Remove unused 'bmap_size'.
+
+ * cpppch.c (cpp_read_state): Correct size reallocated for 'defn'.
+
+ 2002-11-14 Geoffrey Keating <geoffk@apple.com>
+
+ * optabs.h (code_to_optab): Add GTY marker.
+
+ 2002-11-13 Geoffrey Keating <geoffk@apple.com>
+
+ * Makefile.in (GTFILES): Add cpplib.h.
+ * c-common.h (struct c_common_identifier): Don't skip 'node' field.
+ * c-decl.c (build_compound_literal): Don't use var_labelno.
+ * cpplib.h (struct cpp_hashnode): Use gengtype to mark.
+ * dwarf2asm.c (dw2_force_const_mem): Don't use const_labelno.
+ * varasm.c (const_labelno): Use gengtype to mark.
+ (var_labelno): Likewise.
+ (in_section): Likewise.
+ (in_named_name): Likewise.
+ (struct in_named_entry): Likewise.
+ (in_named_htab): Likewise.
+ (set_named_section_flags): Use GGC to allocate struct in_named_entry.
+ (init_varasm_once): Use GGC to allocate in_named_htab.
+ * config/darwin.c (current_pic_label_num): Mark for PCH.
+
+ 2002-11-11 Geoffrey Keating <geoffk@apple.com>
+
+ * ggc-simple.c (init_ggc_pch): New stub procedure.
+ (ggc_pch_count_object): Likewise.
+ (ggc_pch_total_size): Likewise.
+ (ggc_pch_this_base): Likewise.
+ (ggc_pch_alloc_object): Likewise.
+ (ggc_pch_prepare_write): Likewise.
+ (ggc_pch_write_object): Likewise
+ (ggc_pch_finish): Likewise.
+ (ggc_pch_read): Likewise.
+
+ 2002-11-08 Geoffrey Keating <geoffk@apple.com>
+
+ * c-pch.c (c_common_write_pch): Write the macro definitions after
+ the GCed data.
+ (c_common_read_pch): Call cpp_prepare_state. Restore the macro
+ definitions after the GCed data.
+ * cpplib.c (save_macros): New.
+ (reset_ht): New.
+ (cpp_write_pch_deps): Split out of cpp_write_pch.
+ (cpp_write_pch_state): Split out of cpp_write_pch.
+ (cpp_write_pch): Delete.
+ (struct save_macro_data): Delete.
+ (cpp_prepare_state): New.
+ (cpp_read_state): Erase and restore initial macro definitions.
+ * cpplib.h (struct save_macro_data): Forward-declare.
+ (cpp_write_pch_deps): Prototype.
+ (cpp_write_pch_state): Prototype.
+ (cpp_write_pch): Delete prototype.
+ (cpp_prepare_state): Prototype.
+ (cpp_read_state): Add fourth argument.
+
+ 2002-11-04 Geoffrey Keating <geoffk@apple.com>
+
+ * gengtype.c (adjust_field_rtx_def): Don't use skip on valid fields.
+ (write_array): Remove warning.
+
+ * gengtype.c (contains_scalar_p): New.
+ (finish_root_table): Add the table to all languages, even if it's
+ empty.
+ (write_roots): Output gt_pch_scalar_rtab.
+ * ggc-common.c (gt_pch_save): Write out scalars.
+ (gt_pch_restore): Read scalars back.
+
+ * ggc-page.c (OBJECTS_IN_PAGE): New macro.
+ (struct page_entry): Delete pch_page field.
+ (ggc_recalculate_in_use_p): Use OBJECTS_IN_PAGE.
+ (clear_marks): Likewise.
+ (sweep_pages): Likewise.
+ (poison_pages): Likewise.
+ (ggc_print_statistics): Likewise.
+ (ggc_pch_read): Don't free objects read from a PCH.
+ Properly set up in_use_p and page_tails.
+
+ 2002-10-25 Geoffrey Keating <geoffk@apple.com>
+
+ * gengtype.c (struct write_types_data): New.
+ (struct walk_type_data): Make `cookie' const; add extra
+ prev_val item; add `orig_s' field.
+ (walk_type): Update prev_val[3].
+ (write_types_process_field): New.
+ (write_func_for_structure): Take write_types_data structure.
+ (write_types): New.
+ (ggc_wtd): New.
+ (pch_wtd): New.
+ (write_types_local_process_field): New.
+ (gc_mark_process_field): Delete.
+ (write_local_func_for_structure): New.
+ (gc_mark_func_name): Delete.
+ (write_gc_types): Delete.
+ (write_local): New.
+ (finish_root_table): Don't include 'ggc_' in PFX.
+ (write_root): Rename from write_root. Fill pchw field of structures.
+ (write_array): New.
+ (write_roots): Rename from write_gc_roots. Split out to write_array.
+ Update to changes to other routines. Write gt_pch_cache_rtab table.
+ (main): Write PCH walking routines.
+ * ggc-common.c: Include toplev.h, sys/mman.h.
+ (ggc_mark_roots): For cache hashtables, also mark the hash table
+ and the array of entries.
+ (saving_htab): New.
+ (struct ptr_data): New.
+ (POINTER_HASH): New.
+ (gt_pch_note_object): New.
+ (saving_htab_hash): New.
+ (saving_htab_eq): New.
+ (struct traversal_state): New.
+ (call_count): New.
+ (call_alloc): New.
+ (compare_ptr_data): New.
+ (relocate_ptrs): New.
+ (write_pch_globals): New.
+ (struct mmap_info): New.
+ (gt_pch_save): New.
+ (gt_pch_restore): New.
+ * ggc-page.c (ROUND_UP_VALUE): New.
+ (ROUND_UP): New.
+ (struct page_entry): Add field `pch_page'.
+ (init_ggc): Use ROUND_UP.
+ (struct ggc_pch_data): Declare.
+ (init_ggc_pch): New.
+ (ggc_pch_count_object): New.
+ (ggc_pch_total_size): New.
+ (ggc_pch_this_base): New.
+ (ggc_pch_alloc_object): New.
+ (ggc_pch_prepare_write): New.
+ (ggc_pch_write_object): New.
+ (ggc_pch_finish): New.
+ (ggc_pch_read): New.
+ * ggc.h (gt_pointer_operator): New.
+ (gt_note_pointers): New.
+ (gt_pch_note_object): New prototype.
+ (gt_pointer_walker): New.
+ (struct ggc_root_tab): Use gt_pointer_walker, add `pchw' field.
+ (LAST_GGC_ROOT_TAB): Update.
+ (gt_pch_cache_rtab): Declare.
+ (gt_pch_scalar_rtab): Declare.
+ (struct ggc_cache_tab): Use gt_pointer_walker, add `pchw' field.
+ (LAST_GGC_CACHE_TAB): Update.
+ (gt_pch_save_stringpool): Declare.
+ (gt_pch_restore_stringpool): Declare.
+ (gt_pch_p_S): Declare.
+ (gt_pch_n_S): Declare.
+ (struct ggc_pch_data): Forward-declare.
+ (init_ggc_pch): Declare.
+ (ggc_pch_count_object): Declare.
+ (ggc_pch_total_size): Declare.
+ (ggc_pch_this_base): Declare.
+ (ggc_pch_alloc_object): Declare.
+ (ggc_pch_prepare_write): Declare.
+ (ggc_pch_write_object): Declare.
+ (ggc_pch_finish): Declare.
+ (ggc_pch_read): Declare.
+ (gt_pch_save): Declare.
+ (gt_pch_restore): Declare.
+ * fold-const.c (size_int_type_wide): Allocate size_htab using GGC.
+ * emit-rtl.c (init_emit_once): Allocate const_int_htab,
+ const_double_htab, mem_attrs_htab using GGC.
+ * c-pch.c: Include ggc.h.
+ (pch_init): Allow reading PCH file back.
+ (c_common_write_pch): Call gt_pch_save.
+ (c_common_read_pch): Call gt_pch_restore.
+ * c-parse.in (init_reswords): Delete now-untrue comment.
+ Allocate ridpointers using GGC.
+ * c-objc-common.c (c_objc_common_finish_file): Write PCH before
+ calling expand_deferred_fns.
+ * c-common.h (ridpointers): Mark for GTY machinery.
+ * Makefile.in (stringpool.o): Update dependencies.
+ (c-pch.o): Update dependencies.
+ (ggc-common.o): Update dependencies.
+ * stringpool.c: Include gt-stringpool.h.
+ (gt_pch_p_S): New.
+ (gt_pch_n_S): New.
+ (struct string_pool_data): New.
+ (spd): New.
+ (gt_pch_save_stringpool): New.
+ (gt_pch_restore_stringpool): New.
+ * tree.c (init_ttree): Make type_hash_table allocated using GC.
+
+ 2002-10-04 Geoffrey Keating <geoffk@apple.com>
+
+ * gengtype.c (adjust_field_rtx_def): Don't pass size_t to printf.
+ (output_mangled_typename): Don't pass size_t to printf.
+
+ * tree.h (union tree_type_symtab): Add tag to `address' field.
+ (union tree_decl_u2): Add tag to 'i' field.
+ * varasm.c (union rtx_const_un): Add tags to all fields.
+ * gengtype.c (struct walk_type_data): New.
+ (output_escaped_param): Take struct walk_type_data parameter.
+ (write_gc_structure_fields): Delete.
+ (walk_type): New.
+ (write_gc_marker_routine_for_structure): Delete.
+ (write_func_for_structure): New.
+ (gc_mark_process_field): New.
+ (gc_mark_func_name): New.
+ (gc_counter): Delete.
+ (write_gc_types): Use write_func_for_structure.
+ (write_gc_roots): Use walk_type.
+
+ 2002-10-02 Geoffrey Keating <geoffk@apple.com>
+
+ * ggc-common.c (ggc_mark_roots): Delete 'x'.
+ (ggc_splay_dont_free): Fix warning about unused 'x'.
+ (ggc_print_common_statistics): Remove warnings.
+
+ 2002-10-01 Mike Stump <mrs@apple.com>
+
+ * ggc-common.c (ggc_splay_alloc): Actually return the allocated area.
+ * gengtype.c (write_gc_structure_fields): Handle param[digit]_is.
+
+ 2002-09-01 Geoffrey Keating <geoffk@redhat.com>
+ Catherine Moore <clm@redhat.com>
+
+ * Makefile (c-pch.o): Update dependencies.
+ (LIBCPP_OBJS): Add cpppch.o.
+ (cpppch.o): New.
+ * c-common.c (c_common_init): Don't call pch_init here.
+ * c-common.h (c_common_read_pch): Update prototype.
+ * c-lex.c (c_common_parse_file): Call pch_init here.
+ * c-opts.c (COMMAND_LINE_OPTIONS): Add -Winvalid-pch, -fpch-deps.
+ (c_common_decode_option): Handle them.
+ * c-pch.c: Include c-pragma.h.
+ (save_asm_offset): Delete.
+ (pch_init): Move contents of save_asm_offset into here, call
+ cpp_save_state.
+ (c_common_write_pch): Call cpp_write_pch.
+ (c_common_valid_pch): Warn only when -Winvalid-pch. Call
+ cpp_valid_state.
+ (c_common_read_pch): Add NAME parameter. Call cpp_read_state.
+ * cppfiles.c (stack_include_file): Update for change to
+ parameters of cb.read_pch.
+ * cpphash.h (struct cpp_reader): Add `savedstate' field.
+ * cpplib.h (struct cpp_options): Add `warn_invalid_pch' and
+ `restore_pch_deps' fields.
+ (struct cpp_callbacks): Add NAME parameter to `read_pch'.
+ (cpp_save_state): Prototype.
+ (cpp_write_pch): Prototype.
+ (cpp_valid_state): Prototype.
+ (cpp_read_state): Prototype.
+ * cpppch.c: New file.
+ * flags.h (version_flag): Remove prototype.
+ * mkdeps.c (deps_save): New.
+ (deps_restore): New.
+ * mkdeps.h (deps_save): Prototype.
+ (deps_restore): Prototype.
+ * toplev.c (late_init_hook): Delete.
+ (version_flag): Make static again.
+ (compile_file): Don't call late_init_hook.
+ * toplev.h (late_init_hook): Delete.
+ * doc/cppopts.texi: Document -fpch-deps.
+ * doc/invoke.texi (Warning Options): Document -Winvalid-pch.
+
+ 2002-08-27 Geoffrey Keating <geoffk@redhat.com>
+
+ * c-pch.c (c_common_write_pch): Rename from c_write_pch, change
+ callers.
+ (c_common_valid_pch): Rename from c_valid_pch, change callers.
+ (c_common_read_pch): Rename from c_read_pch, change callers.
+
+ * c-opts.c (COMMAND_LINE_OPTIONS): Allow -output-pch= to have
+ a space between it and its argument.
+
+ 2002-08-24 Geoffrey Keating <geoffk@redhat.com>
+
+ * c-pch.c: New file.
+ * toplev.h (late_init_hook): Declare.
+ * toplev.c (late_init_hook): Define.
+ (version_flag): Make globally visible.
+ (compile_file): Call late_init_hook.
+ (init_asm_output): Make output file seekable.
+ * gcc.c (default_compilers): Update c-header rule.
+ * flags.h (version_flag): Declare.
+ * cpplib.h (struct cpp_callbacks): Add 'valid_pch' and 'read_pch'
+ fields.
+ * cppfiles.c (struct include_file): Add 'pch' field.
+ (INCLUDE_PCH_P): New.
+ (open_file_pch): New.
+ (stack_include_file): Handle PCH files specially.
+ (find_include_file): Call open_file_pch instead of open_file.
+ (_cpp_read_file): Explain why open_file is used instead of
+ open_file_pch.
+ * c-opts.c (c_common_decode_option): Correct OPT__output_pch case.
+ * c-objc-common.c (c_objc_common_finish_file): Call c_write_pch.
+ * c-lex.c (init_c_lex): Set valid_pch and read_pch fields
+ in cpplib callbacks.
+ * c-common.c (pch_file): Correct comment.
+ (allow_pch): Define.
+ (c_common_init): Call pch_init.
+ * c-common.h (allow_pch): Declare.
+ (pch_init): Declare.
+ (c_valid_pch): Declare.
+ (c_read_pch): Declare.
+ (c_write_pch): Declare.
+ * Makefile.in (c-pch.o): New.
+ (C_AND_OBJC_OBJS): Add c-pch.o.
+ * doc/invoke.texi (Precompiled Headers): Add index entries,
+ complete truncated paragraph.
+
+ 2002-08-17 Geoffrey Keating <geoffk@redhat.com>
+
+ * c-common.c: (pch_file): Define.
+ * c-common.h (pch_file): Declare.
+ * c-opts.c (COMMAND_LINE_OPTIONS): Add --output-pch=.
+ (missing_arg): Require --output-pch= to have an argument.
+ (c_common_decode_option): Handle --output-pch=.
+ * gcc.c: Document new %V.
+ (default_compilers): Handle compiling C header files.
+ (do_spec_1): Implement %V.
+ (main): Handle "gcc foo.h" without trying to run linker.
+ * doc/invoke.texi (Invoking GCC): Add new menu item for PCH.
+ (Overall Options): Document what the driver does with header files,
+ document new -x option possibilities.
+ (Invoking G++): More documentation for PCH.
+ (Precompiled Headers): New.
+
+ 2002-08-09 Geoffrey Keating <geoffk@redhat.com>
+
+ * ggc.h: Don't include varray.h. Rearrange functions to be more
+ organized.
+ (ggc_add_root): Delete.
+ (ggc_mark_rtx): Delete.
+ (ggc_mark_tree): Delete.
+ (struct ggc_statistics): Remove contents.
+ * ggc-common.c: Remove unneeded includes.
+ (struct ggc_root): Delete.
+ (roots): Delete.
+ (ggc_add_root): Delete.
+ (ggc_mark_roots): Don't mark `roots'. Call ggc_mark_stringpool.
+ (ggc_print_common_statistics): Remove most of the contents.
+ * Makefile.in (GGC_H): No longer uses varray.h.
+ (ggc-common.o): Update dependencies.
+ (c-parse.o): Add varray.h to dependencies.
+ (c-common.o): Add varray.h.
+ * stringpool.c (mark_ident): Use mangled name for tree marker routine.
+ (mark_ident_hash): Rename to ggc_mark_stringpool.
+ (init_stringpool): Don't use ggc_add_root.
+ * c-parse.in: Include varray.h.
+ * c-common.c: Include varray.h.
+ * objc/Make-lang.in (objc-act.o): Add varray.h.
+ * objc/objc-act.c: Include varray.h.
+
+ 2002-07-25 Geoffrey Keating <geoffk@redhat.com>
+
+ * dwarf2out.c (dw_cfi_oprnd2_desc): Fix ISO-only function definition.
+ (dw_cfi_oprnd1_desc): Likewise.
+
+ 2002-07-17 Geoffrey Keating <geoffk@redhat.com>
+
+ * config/alpha/alpha.c (struct alpha_links): Use gengtype to mark;
+ move out of ifdef.
+ (alpha_links): Use gengtype to mark; move out of ifdef.
+ (mark_alpha_links_node): Delete.
+ (mark_alpha_links): Delete.
+ (alpha_need_linkage): Use GGC to allocate splay tree, struct
+ alpha_links, strings. Don't use ggc_add_root.
+ * ggc-common.c (ggc_splay_alloc): New.
+ (ggc_splay_dont_free): New.
+ * ggc.h (ggc_mark_rtx): Update for changed name mangling.
+ (ggc_mark_tree): Likewise.
+ (splay_tree_new_ggc): New.
+ (ggc_splay_alloc): Declare.
+ (ggc_splay_dont_free): Declare.
+ * dwarf2asm.c: Include gt-dwarf2asm.h.
+ (mark_indirect_pool_entry): Delete.
+ (mark_indirect_pool): Delete.
+ (indirect_pool): Use gengtype to mark.
+ (dw2_force_const_mem): Don't use ggc_add_root.
+ * Makefile.in (dwarf2asm.o): Depend on gt-dwarf2asm.h.
+ (GTFILES): Add SPLAY_TREE_H, dwarf2asm.c.
+ (gt-dwarf2asm.h): Depend on s-gtype.
+
+ 2002-07-08 Geoffrey Keating <geoffk@redhat.com>
+
+ * tree.h (union tree_type_symtab): Mark `die' field.
+ * Makefile.in (dwarf2out.o): Update dependencies.
+ * dwarf2out.c: Use GGC to allocate all structures. Convert to htab_t
+ hash tables.
+ (dw_cfi_oprnd1_desc): New function.
+ (dw_cfi_oprnd2_desc): New function.
+ (indirect_string_alloc): Delete.
+ (debug_str_do_hash): New function.
+ (debug_str_eq): New function.
+ (mark_limbo_die_list): Delete.
+ (dwarf2out_init): Don't call ggc_add_root.
+
+2003-01-09 Vladimir Makarov <vmakarov@redhat.com>
+
+ The following changes are merged from itanium-sched-branch:
+
+ 2003-01-08 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/md.texi: Clarify assignment of units to automata description.
+
+ 2003-01-08 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (unit_decl): Remove members
+ `the_same_automaton_unit' and
+ `the_same_automaton_message_reported_p'.
+ (process_unit_to_form_the_same_automaton_unit_lists,
+ form_the_same_automaton_unit_lists_from_regexp,
+ form_the_same_automaton_unit_lists, the_same_automaton_lists):
+ Remove them.
+ (annotation_message_reported_p): New global variable.
+ (check_unit_distribution_in_reserv,
+ check_regexp_units_distribution): New functions.
+ (check_unit_distributions_to_automata): Rewrite it.
+
+ 2003-01-04 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (form_the_same_automaton_unit_lists_from_regexp):
+ Use continue instead of break if cycle is too big.
+
+ 2002-12-20 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (check_unit_distributions_to_automata): Output at
+ most one message for a unit.
+ (process_unit_to_form_the_same_automaton_unit_lists): Check
+ automaton of units instead of units themself.
+
+ * doc/md.texi: Describe the constraint about assigning unit to
+ automata.
+
+ 2002-12-20 Jan Hubicka <jH@suse.cz>
+ Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (unit_decl): Add new members `min_occ_cycle_num'
+ and `in_set_p'.
+ (gen_cpu_unit): Initialize the new members.
+ (process_regexp_cycles): Calculate minimal finish cycle too. Set
+ up `min_occ_cycle_num'.
+ (evaluate_max_reserv_cycles): Change the function call.
+ (CLEAR_BIT): New macro.
+ (states_union, state_shift): Use the mask.
+ (initiate_excl_sets, form_reserv_sets_list): Set up `in_set_p'.
+ (form_reservs_matter): New function.
+ (make_automaton): Call the function and use the mask.
+ (estimate_one_automaton_bound): Take `min_occ_cycle_num' into
+ account.
+
+ 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/itanium2.md (lfetch): Change the insn reservation.
+
+ 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.c (bundling): Try to insert 2 nops for M insn
+ for Itanium.
+
+ 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.c (ia64_override_options): Make itanium2 as
+ default cpu.
+
+ 2002-12-17 Vladimir Makarov <vmakarov@redhat.com>
+ 2002-10-31 Dale Johannesen <dalej@apple.com>
+
+ * haifa-sched.c (find_set_reg_weight): New function.
+ (find_insn_reg_weight): Use the new function.
+ (schedule_block): Do sorting ready queue always
+ after insn issue.
+
+ 2002-11-27 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.c (bundling): Use MFI template instead of MLX.
+
+ 2002-11-19 Vladimir Makarov <vmakarov@redhat.com>
+
+ * haifa-sched.c (choice_entry): New structure.
+ (choice_stack, cycle_issued_insns): New variables.
+ (max_issue): Rewrite it.
+ (choose_ready): Set up ready_try for unknown insns too.
+ (schedule_block): Allocate and free choice_stack. Set up
+ and modify cycle_issued_insns.
+
+ * config/ia64/ia64.c (issue_nops_and_insn): Combine insn issue
+ with and without filling the bundle.
+ (bundling): Combine calls of issue_nops_and_insn.
+
+ 2002-10-17 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/itanium1.md: New file.
+
+ * config/ia64/itanium2.md: New file.
+
+ * config/ia64/ia64.md: Move DFA descriptions into the new files.
+ Remove the old pipeline description.
+
+ * config/ia64/ia64.c (ia64_override_options): Add aliases of
+ itanium processor names.
+
+ 2002-10-16 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.c (bundling): Print states for Itanium2 too.
+ (ia64_reorg): Set up queried unit codes for Itanium2 too.
+
+ * config/ia64/ia64.md: Add descriptions for Itanium2.
+
+ 2002-10-08 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.h (processor_type): New enumeration.
+ (ia64_tune, ia64_tune_string): New external declarations.
+ (TARGET_OPTIONS): Add option `tune='.
+
+ * config/ia64/ia64.c (ia64_tune, ia64_tune_string): New global
+ variables.
+ (ia64_override_options): Set up `ia64_tune'.
+ (ia64_sched_reorder2): Set up `clocks' only for Itanium.
+ (ia64_dfa_new_cycle): Set up `add_cycles' only for Itanium.
+ (bundling): Add nops for MM-insns only for Itanium.
+ (ia64_reorg): Allocate and free `clocks' and `add_cycles' only for
+ Itanium.
+
+ * config/ia64/ia64.md (cpu): New attribute.
+ (DFA description): Enable it only for Itanium.
+
+ 2002-10-08 Vladimir Makarov <vmakarov@redhat.com>
+ Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.h (MASK_TUNE_STOP_BITS): Rename it to
+ MASK_EARLY_STOP_BITS.
+ (TARGET_TUNE_STOP_BITS): Rename it to TARGET_EARLY_STOP_BITS.
+ (TARGET_SWITCHES): Rename option `tune-stop-bits' to
+ `early-stop-bits'.
+
+ * config/ia64/ia64.c (ia64_dfa_new_cycle,
+ final_emit_insn_group_barriers): Use TARGET_EARLY_STOP_BITS
+ instead of TARGET_TUNE_STOP_BITS.
+
+ * doc/invoke.texi: Rename option `-mtune-stop-bits' to
+ `-mearly-stop-bits'.
+
+ * config/ia64/ia64.c (automata_option "v"): Comment it.
+
+ 2002-10-07 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.h (MASK_TUNE_STOP_BITS, TARGET_TUNE_STOP_BITS):
+ New macros.
+ (TARGET_SWITCHES): Add entries for the new option.
+
+ * config/ia64/ia64.c (dfa_stop_insn, last_scheduled_insn, rtx
+ dfa_pre_cycle_insn, ia64_nop): Don't make them as roots for GC.
+ (stops_p, stop_before_p, clocks_length, clocks, add_cycles): New
+ global variables.
+ (ia64_sched_reorder2): Set up `clocks'.
+ (ia64_variable_issue): Set up `stops_p' and reset `stop_before_p'.
+ (ia64_dfa_new_cycle): Set up add_cycle. Permit sorting ready
+ queue when TARGET_TUNE_STOP_BITS.
+ (bundling): Insert additional nops for MM-insns.
+ (final_emit_insn_group_barriers): Add insertion of stop bits
+ according `stops_p'.
+ (ia64_reorg): Initiate the new varibales.
+
+ * doc/invoke.texi: Add description of option `-mtune-stop-bits'.
+
+ 2002-10-02 Vladimir Makarov <vmakarov@redhat.com>
+
+ * haifa-sched.c (schedule_block): Modify INSN_TICK of depended
+ insns at the end of block insn scheduling.
+
+ 2002-09-30 Vladimir Makarov <vmakarov@redhat.com>
+
+ * sched-deps.c (remove_dependence, group_leader): Remove it.
+ (add_dependence): Add dependence to group leader to.
+ (set_sched_group_p): Add dependence to the first insn of the
+ schedule group too.
+ (sched_analyze_insn): Make dependence to jump as anti-dependence.
+ Change true dependence by anti-dependence when
+ `reg_pending_barrier'.
+
+ * sched-rgn.c (init_ready_list, can_schedule_ready_p,
+ add_branch_dependences): Ignore schedule groups.
+
+ * sched-ebb.c (init_ready_list): Ditto.
+
+ * (move_insn, set_priorities): Ditto.
+
+ * config/ia64/ia64.c (ia64_sched_init): Check that schedule group
+ flag is clear after reload.
+ (adjust_cost): Change cost only for output dependencies.
+
+ * config/ia64/ia64.md: Add more insns into bypass for MM-insns.
+
+ 2002-09-26 Vladimir Makarov <vmakarov@redhat.com>
+
+ * Makefile.in (sched-ebb.o): Add `$(TARGET_H)' to the entry.
+
+ * target.h (gcc_target): Add member
+ `dependencies_evaluation_hook'.
+
+ * target-def.h (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK): New
+ macro.
+ (TARGET_SCHED): Add initiatialization of the new member.
+
+ * sched-ebb.c: Include `target.h'.
+ (schedule_ebb): Call `dependencies_evaluation_hook'.
+
+ * sched-rgn.c (schedule_region): Call
+ `dependencies_evaluation_hook'.
+
+ * config/ia64/ia64.c (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK):
+ New macro.
+ (ia64_dependencies_evaluation_hook): New function.
+
+ * doc/tm.texi (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK):
+ Describe the new hook.
+
+ 2002-09-25 Vladimir Makarov <vmakarov@redhat.com>
+
+ * target.h (gcc_target): Add members
+ `first_cycle_multipass_dfa_lookahead_guard' and `dfa_new_cycle'.
+
+ * target-def.h (TARGET_SCHED_DFA_NEW_CYCLE,
+ TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): New
+ macros.
+ (TARGET_SCHED): Add initiatialization of the new members.
+
+ * haifa-sched.c (schedule_insn): Update last_clock_var for the 1st
+ insn scheduling too.
+ (choose_ready): Use `first_cycle_multipass_dfa_lookahead_guard' to
+ initialize `ready_try'.
+ (schedule_block): Use `dfa_new_cycle'. Sort `ready' only unless
+ `dfa_new_cycle' says not to do it.
+
+ * config/ia64/ia64.md: Add DFA Itanium 1 description for insn
+ bundling.
+
+ * config/ia64/ia64.h (CPU_UNITS_QUERY): New macro.
+
+ * config/ia64/ia64.c: Include `hashtab.h'.
+ (ia64_first_cycle_multipass_dfa_lookahead_guard,
+ ia64_dfa_new_cycle, final_emit_insn_group_barriers,
+ ia64_dfa_sched_reorder, get_free_bundle_state, free_bundle_state,
+ initiate_bundle_states, finish_bundle_states, bundle_state_hash,
+ bundle_state_eq_p, insert_bundle_state,
+ initiate_bundle_state_table, finish_bundle_state_table,
+ try_issue_nops, try_issue_insn, issue_nops_and_insn, get_max_pos,
+ get_template, get_next_important_insn, bundling): New functions.
+ (ia64_internal_sched_reorder): Remove it.
+ (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD,
+ TARGET_SCHED_DFA_NEW_CYCLE): New macros.
+ (ia64_safe_itanium_requires_unit0): Remove it.
+ (group_barrier_needed_p): Place group barrier right before a real
+ insn.
+ (bundle, ia64_packet, NR_PACKETS, type_names, packets, packets):
+ Remove them.
+ (bundle_name): New variable.
+ (_0mii_, _0mmi_, _0mfi_, _0mmf_, _0bbb_, _0mbb_, _0mib_, _0mmb_,
+ _0mfb_, _0mlx_, _1mii_, _1mmi_, _1mfi_, _1mmf_, _1bbb_, _1mbb_,
+ _1mib_, _1mmb_, _1mfb_, _1mlx_, pos_1, pos_2, pos_3, pos_4, pos_5,
+ pos_6, dfa_stop_insn, last_scheduled_insn, dfa_state_size,
+ temp_dfa_state, prev_cycle_state): New global variables.
+ (insn_matches_slot, maybe_rotate, finish_last_head,
+ rotate_one_bundle, rotate_one_bundles, nop_cycles_until,
+ cycle_end_fill_slots, packet_matches_p, get_split, find_best_insn,
+ find_best_packet, itanium_reorder, dump_current_packet,
+ schedule_stop, gen_nop_type, ia64_emit_nops): Remove them.
+ (sched_data, sched_ready, sched_types): Remove them.
+ (ia64_sched_init): Initiate only `last_scheduled_insn' and call
+ `init_insn_group_barriers'.
+ (ia64_sched_reorder, ia64_sched_reorder2): Call
+ ia64_dfa_sched_reorder.
+ (ia64_variable_issue): Rewrite it.
+ (bundle_state): New structure.
+ (index_to_bundle_states, bundle_states_num,
+ allocated_bundle_states_chain, free_bundle_state_chain): New
+ global variables.
+ (ia64_sched_finish): Add stop bits and call `bundling' after the
+ 2nd insn scheduling.
+ (ia64_use_dfa_pipeline_interface): Return zero always.
+ (ia64_first_cycle_multipass_dfa_lookahead): Return 6 for the 2nd
+ insn scheduling.
+ (ia64_init_dfa_pre_cycle_insn): Initialize `dfa_state_size',
+ `temp_dfa_state', `prev_cycle_state', and `dfa_stop_insn'.
+ (ia64_reorg): Add bundling insns.
+
+ * doc/tm.texi
+ (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD,
+ TARGET_SCHED_DFA_NEW_CYCLE): Describe the new hooks.
+
+ 2002-09-23 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.md: Add Itanium1 DFA description.
+ (itanium_class): Add `nop' and `pre_cycle'. Add
+ define_function_unit for `nop'.
+ (nop): Change attribute `itanium_class'.
+ (pre_cycle): New define_insn.
+
+ * config/ia64/ia64-protos.h (bundling_p): New external variable.
+ (ia64_st_address_bypass_p, ia64_ld_address_bypass_p,
+ ia64_produce_address_p): New function prototypes.
+
+ * config/ia64/ia64.c (bundling_p): New global variable.
+ (ia64_use_dfa_pipeline_interface,
+ ia64_first_cycle_multipass_dfa_lookahead,
+ ia64_init_dfa_pre_cycle_insn, ia64_dfa_pre_cycle_insn): New
+ functions.
+ (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE,
+ TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD,
+ TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN,
+ TARGET_SCHED_DFA_PRE_CYCLE_INSN): New macros.
+ (ia64_sched_init, ia64_sched_reorder, ia64_sched_reorder2,
+ ia64_variable_issue, ia64_sched_finish): Do nothing before reload.
+ (dfa_pre_cycle_insn): New variable.
+
+ 2002-09-20 Vladimir Makarov <vmakarov@redhat.com>
+
+ * rtl.def (FINAL_PRESENCE_SET, FINAL_ABSENCE_SET): New
+ constructions.
+
+ * genattrtab.h (gen_final_presence_set, gen_final_absence_set):
+ New function prototypes.
+
+ * genattrtab.c (main): Process the new constructions.
+
+ * genautomata.c (gen_presence_absence_set,
+ process_presence_absence_names, process_presence_absence_patterns,
+ add_presence_absence, check_absence_pattern_sets): Add parameter
+ `final_p'.
+ (unit_decl): Add new members `final_presence_list' and
+ `final_absence_list'.
+ (unit_pattern_rel_decl): Add new member `final_p'.
+ (gen_final_presence_set, gen_final_absence_set): New functions.
+ (process_decls): Use member `final_p'.
+ (temp_reserv): New global variable.
+ (reserv_sets_are_intersected): Add processing `final_presence_set'
+ and `final_absence_set'.
+ (initiate_states): Allocate `temp_reserv'.
+ (unit_final_presence_set_table, unit_final_absence_set_table): New
+ gloabal variables.
+ (initiate_presence_absence_pattern_sets): Initiate them.
+ (NDFA_to_DFA): Fix typo.
+ (output_description): Output `final_presence_set' and
+ `final_absence_set'.
+
+ * doc/md.texi (final_presence_set, final_absence_set): Describe
+ them.
+
+ 2002-09-20 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genautomata.c (transform_3): Process a missing case (nothing on
+ unit place).
+
+ 2002-09-20 Vladimir Makarov <vmakarov@redhat.com>
+
+ * rtl.def (DEFINE_QUERY_CPU_UNIT, AUTOMATA_OPTION): Change
+ comments about queried units and the minimization.
+
+ * doc/md.texi: Ditto.
+
+ * genautomata.c (create_composed_state): Return nonzero if the new
+ state has been created.
+ (first_cycle_unit_presence): New function.
+ (state_is_differed): Add new parameter. Use the new function.
+ Take queried units into account.
+ (partition_equiv_class): Pass additional parameter to
+ `state_is_differed'.
+ (merge_states): Process composed states too.
+ (build_automaton, create_automata, output_min_issue_delay_table,
+ output_tables, output_statistics): Output more information.
+ (output_reserved_units_table): Use function
+ `first_cycle_unit_presence'.
+ (output_tables): Output table of queried units even if the
+ minimization is switched on.
+ (write_automata): Output code for querying units even if the
+ minimization is switched on.
+
+ 2002-09-19 Vladimir Makarov <vmakarov@redhat.com>
+
+ * rtl.def (PRESENCE_SET, ABSENCE_SET): Add comments about extended
+ syntax of the constructions.
+
+ * doc/md.texi (PRESENCE_SET, ABSENCE_SET): Add description of
+ extended syntax of the constructions.
+
+ * genautomata.c (unit_rel_decl): Rename it to
+ `unit_pattern_rel_decl'.
+ (pattern_set_el, pattern_reserv): New structures.
+ (pattern_set_el_t, pattern_reserv_t): New types.
+ (gen_presence_absence_set): New function.
+ (process_presence_absence): Remove it.
+ (process_presence_absence_names,
+ process_presence_absence_patterns): New functions.
+ (get_presence_absence_set): Remove it.
+ (initiate_presence_absence_sets): Rename it on
+ `initiate_presence_absence_pattern_sets'. Use new function
+ `form_reserv_sets_list'.
+ (form_reserv_sets_list, check_presence_pattern_sets,
+ check_absence_pattern_sets, output_pattern_set_el_list): New
+ functions.
+ (unit_decl): Change types of members `presence_list' and
+ `absence_list'.
+ (unit_rel_decl): Rename member `names_num' to `all_names_num'.
+ (decl): Change types of members `excl', `presence', and `absence'.
+ (get_str_vect): Rename `par_flag' to `paren_p'. Add null element
+ at the end of the vector.
+ (gen_cpu_unit, gen_query_cpu_unit, gen_bypass, gen_excl_set,
+ gen_automaton, gen_regexp_repeat, gen_regexp_allof,
+ gen_regexp_oneof, gen_regexp_sequence): Use boolean values.
+ (gen_presence_set, gen_absence_set): Use new function
+ `gen_presence_absence_set'.
+ (add_presence_absence): Process `pattern_list' instead of
+ `source_list'.
+ (process_decls): USe new functions
+ `process_presence_absence_names' and
+ `process_presence_absence_patterns'.
+ (reserv_sets_are_intersected): Use new function
+ `check_presence_pattern_sets'.
+ (presence_set, absence_set): Remove them.
+ (unit_presence_set_table, unit_absence_set_table): New global
+ variables.
+ (output_description): Use new function
+ `output_pattern_set_el_list'.
+ (generate): Use `initiate_presence_absence_pattern_sets'.
+
+ 2002-09-18 Vladimir Makarov <vmakarov@redhat.com>
+
+ * genattr.c (main): Add output of prototype of new interface
+ function `dfa_clean_insn_cache'.
+
+ * genautomata.c (output_dfa_clean_insn_cache_func): New function.
+ (DFA_CLEAN_INSN_CACHE_FUNC_NAME): New macro.
+ (output_dfa_start_func): Use function `dfa_clean_insn_cache' in
+ the generated code.
+ (write_automata): Call the new function.
+
+2003-01-09 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (unit, prefix_0f, memory attributes): Hanlde sseicvt
+ correctly.
+
+2003-01-09 Paolo Carlini <pcarlini@unitus.it>
+
+ * doc/tm.texi (EXTRA_ADDRESS_CONSTRAINT): Fix typo.
+
+2003-01-09 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * defaults.h (EXTRA_MEMORY_CONSTRAINT): Add STR argument.
+ (EXTRA_ADDRESS_CONSTRAINT): Likewise.
+ (CONSTRAINT_LEN): Provide default definition.
+ (CONST_OK_FOR_CONSTRAINT_P): Likewise.
+ (CONST_DOUBLE_OK_FOR_CONSTRAINT_P): Likewise.
+ (EXTRA_CONSTRAINT_STR): Likewise.
+ (REG_CLASS_FROM_CONSTRAINT): Define.
+ * genoutput.c (check_constraint_len, constraint_len): New functions.
+ (validate_insn_alternatives): Check CONSTRAINT_LEN for each
+ constraint / modifier.
+ (gen_insn): Call check_constraint_len.
+ * local-alloc.c (block_alloc): Update to use new macros / pass
+ second argument to EXTRA_{MEMORY,ADDRESS}_CONSTRAINT.
+ * ra-build.c (handle_asm_insn): Likewise.
+ * recog.c (asm_operand_ok, preprocess_constraints): Likewise.
+ (constrain_operands, peep2_find_free_register): Likewise.
+ * regclass.c (record_operand_costs, record_reg_classes): Likewise.
+ * regmove.c (find_matches): Likewise.
+ * reload.c (push_secondary_reload, find_reloads): Likewise.
+ (alternative_allows_memconst): Likewise.
+ * reload1.c (maybe_fix_stack_asms): Likewise.
+ (reload_cse_simplify_operands): Likewise.
+ * stmt.c (parse_output_constraint, parse_input_constraint): Likewise.
+ * doc/tm.texi (CONSTRAINT_LEN, REG_CLASS_FROM_CONSTRAINT): Document.
+ (CONST_OK_FOR_CONSTRAINT_P): Likewise.
+ (CONST_DOUBLE_OK_FOR_CONSTRAINT_P, EXTRA_CONSTRAINT_STR): Likewise.
+ (EXTRA_MEMORY_CONSTRAINT, EXTRA_ADDRESS_CONSTRAINT): Add STR argument.
+ * config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Likewise.
+
+ * sh.h (OVERRIDE_OPTIONS): Allow first scheduling pass for SH5.
+
+2003-01-09 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*extzv_1_r_h8300): Correct the insn
+ length.
+ (*extzv_1_r_h8300hs): Likewise.
+ (*extzv_1_r_inv_h8300): Likewise.
+ (*extzv_1_r_inv_h8300hs): Likewise.
+
+2003-01-09 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (PREDICATE_CODES): New.
+
+2003-01-09 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*addsi3_upper): New.
+ (*iorsi3_shift): Likewise.
+ (two splitters): Likewise.
+ (*addsi3_shift): Likewise.
+ (two splitters): Likewise.
+
+2003-01-09 Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
+
+ * Makefile.in (optabs.o): Add dependency on basic-block.h.
+ * basic-block.h (control_flow_insn_p): Fuction was exported.
+ * cfgbuild.c (control_flow_insn_p): Fuction was made non-static.
+ * optabs.c (emit_libcall_block): Emit REG_LIBCALL and REG_RETVAL
+ notes only when the region is contained in a single basic block.
+
+2003-01-09 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR inline-asm/8832
+ * tree.h (expand_asm): New prototype.
+ * stmt.c (expand_asm): Set the MEM_VOLATILE_P flag if instructed
+ to do so.
+ * c-semantics (genrtl_asm_stmt): Pass the RID_VOLATILE qualifier
+ down to expand_asm.
+ * c-typeck.c (simple_asm_stmt): Set the RID_VOLATILE qualifier.
+ * rtlanal.c (volatile_insn_p) [ASM_INPUT]: Test the MEM_VOLATILE_P flag.
+ (volatile_refs_p) [ASM_INPUT]: Likewise.
+ (side_effects_p) [ASM_INPUT]: Likewise.
+
+2003-01-09 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (*mul*): FIx constraints; remove confused comment; fix
+ athlon_decode attributes
+ (imul/k8 optimization peep2s): New.
+
+ * athlon.md (athlon_ssecmp*): Handle ssecomi as well.
+ * i386.md (type attribute): Add ssecomi.
+ (unit, memory, prefix attributes): Handle ssecomi.
+ (cvt?2? patterns): Fix athlon_decode attribute
+ (comi patterns): Set attribute to ssecomi.
+
+ PR target/8343
+ * m68k.md (umulsidi, mulsidi expanders): Use register operand.
+
+2003-01-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (PREDICATE_CODES): Add ADDRESSOF for predicates
+ that match register_operands.
+ * config/mips/mips.c (reg_or_0_operand, true_reg_or_0_operand): Make
+ register_operand the default case.
+
+2003-01-09 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/8032
+ * c-typeck.c (process_init_element) [RECORD_TYPE]: For
+ an empty element, do not advance the pointer to unfilled
+ fields if there are pending initializers.
+
+2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
+
+ * Makefile.in (ORDINARY_FLAGS_TO_PASS): Also pass DESTDIR.
+ (install-gcc-tooldir, install-cpp, installdirs,
+ install-common, install-driver, install-info, install-man,
+ install-headers, install-include-dir, install-headers-tar,
+ install-headers-cpio, install-headers-cp, install-mkheaders,
+ install-collect2, uninstall): Prepend $(DESTDIR) to
+ destination paths in all (un)installation commands.
+ (install-driver): Rewrite $(LN) commands to support DESTDIR
+ with "ln" as well as with "ln -s".
+ (installdirs): Simply use mkinstalldirs.
+ (install-libgcc, install-multilib): Also pass DESTDIR.
+ * mklibgcc.in: Prepend $(DESTDIR) to $(libsubdir) in the
+ installation destination variable ldir.
+ * config/alpha/t-osf4, config/arm/t-netbsd,
+ config/ia64/t-hpux, config/mips/t-iris5-6,
+ config/pa/t-hpux-shlib, config/rs6000/t-aix43,
+ config/rs6000/t-aix52, config/t-slibgcc-elf-ver,
+ config/t-slibgcc-sld: Prepend $$(DESTDIR) to $$(slibdir)
+ in the definition of SHLIB_INSTALL.
+ * config/arc/t-arc (install-multilib-arc): Prepend $(DESTDIR) to
+ $(libsubdir) in the installation commands.
+
+2003-01-08 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.h (CASE_VECTOR_MODE): Use SImode for a
+ non-optimizing compile.
+ (ASM_OUTPUT_ADDR_VEC_ELT): Use .long for a non-optimizing
+ compile.
+
+2003-01-08 Douglas B Rupp <rupp@gnat.com>
+
+ * config/i386/i386.c (ix86_attribute_table): Add new attributes
+ ms_struct and gcc_struct.
+ (ix86_handle_struct_attribute): New function.
+ (ix86_ms_bitfield_layout_p): Update to take new attributes
+ into account.
+ * doc/extend.texi: Document new attributes.
+ * testsuite/gcc.dg/bf-ms-attrib.c: New test.
+
+2003-01-08 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR optimization/8750
+ * config/i386/i386.c (ix86_expand_prologue): Don't allow
+ scheduling pass to move insns across __alloca call.
+
+2003-01-08 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.md: Replace *store_multiple_string
+ with *stmsi[3-8].
+
+2003-01-08 Jeff Sturm <jsturm@one-point.com>
+
+ PR target/9210
+ * config/rs6000/rs6000.c (rs6000_elf_encode_section_info):
+ Set SYMBOL_REF_FLAG on local data sym_ref.
+
+2003-01-08 Dale Johannesen <dalej@apple.com>
+
+ * function.c (assign_parms): Don't set pretend_args_size if
+ REG_PARM_STACK_SPACE.
+ config/rs6000/rs6000.c (setup_incoming_varargs): Don't set
+ pretend_args_size.
+
+2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * gcc.hlp: Delete.
+
+2003-01-09 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_addcc): Fix thinko.
+
+2003-01-08 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.h (FUNCTION_MODE): Always use SImode.
+ * config/rs6000/rs6000.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Redefine
+ as hook_bool_tree_hwi_hwi_tree_true.
+ (rs6000_emit_allocate_stack): Use TARGET_32BIT.
+ (rs6000_emit_epilogue): Same.
+ (rs6000_output_mi_thunk): Re-implement as RTL.
+ * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Call
+ xcoffout_declare_function if any debugging enabled.
+
+2003-01-08 Chris Demetriou <cgd@broadcom.com>
+
+ * config.gcc (mipsisa32r2-*-elf*, mipsisa32r2el-*-elf*): New
+ targets, to support MIPS32 Release 2 (MIPS32R2) configurations.
+ * config/mips/mips.h (enum processor_type): Rename
+ PROCESSOR_R4KC to PROCESSOR_4KC, PROCESSOR_R5KC to
+ PROCESSOR_5KC, and PROCESSOR_R20KC to PROCESSOR_20KC.
+ Add PROCESSOR_M4K.
+ (TARGET_MIPS4KC, TARGET_MIPS5KC): Update for the renaming.
+ (ISA_MIPS32R2): New define.
+ (GENERATE_MULT3_SI, ISA_HAS_CONDMOVE, ISA_HAS_8CC)
+ (ISA_HAS_MADD_MSUB, ISA_HAS_CLZ_CLO)
+ (ISA_HAS_PREFETCH): Add support for MIPS32R2.
+ (MIPS_ISA_DEFAULT): Likewise. Also, fix indentation.
+ (TARGET_CPU_CPP_BUILTINS): Add support for MIPS32R2. Add new
+ predefine __mips_isa_rev for MIPS32, MIPS32R2, and MIPS64.
+ (ISA_HAS_ROTR_SI): Add support for MIPS32R2, and avoid if
+ compiling MIPS16 code.
+ (ISA_HAS_ROTR_DI): Do not use if compiling MIPS16 code, and fix
+ comment.
+ (ISA_HAS_SEB_SEH): New define.
+ (ASM_SPEC, LINK_SPEC): Pass -mips32r2 to assembler and linker.
+ * config/mips/mips.c (mips_cpu_info_table): Adjust for enum
+ processor_type value renaming. Add support for MIPS32R2.
+ Clean up comments, and move "sb1" entry with other MIPS64 CPU
+ entries.
+ (override_options): Reimplement -mipsN option handling so that
+ it will work correctly for -mips32r2. Avoid branch-likely
+ instructions on MIPS32R2.
+ * config/mips/mips.md (mulsi3_mult3): Add support for MIPS32R2.
+ (extendhisi2): Use extendhisi2_hw if ISA_HAS_SEB_SEH.
+ (extendqisi2): Use extendqisi2_hw if ISA_HAS_SEB_SEH.
+ (extendhisi2_hw, extendqisi2_hw): New.
+ * config/mips/netbsd.h (TARGET_CPU_CPP_BUILTINS): Add support
+ for MIPS32R2. Add new predefine __mips_isa_rev for MIPS32,
+ MIPS32R2, and MIPS64.
+ (LINK_SPEC): Pass -mips32r2 to linker.
+ * config/mips/t-isa3264: Built -mips32r2 multilibs.
+ * doc/invoke.texi (MIPS Options): Add -mips32r2, add support
+ for mips32r2 in the -march description. Alphabetically sort
+ CPU names in the -march description. Add long-missed -mips32
+ and -mips64 to MIPS option summary.
+
+ * config.gcc: Update copyright years to include 2003.
+ * config/mips/mips.c: Likewise.
+ * config/mips/mips.h: Likewise.
+ * config/mips/mips.md: Likewise.
+ * config/mips/netbsd.h: Likewise.
+ * doc/invoke.texi: Likewise.
+
+2003-01-08 Andreas Schwab <schwab@suse.de>
+
+ * aclocal.m4 (gcc_AC_INITFINI_ARRAY): Fix spelling of cache
+ variable.
+ * configure: Regenerated.
+
+2003-01-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_logical_op): Replace byte/word
+ extraction of det with b0, b1, w0, w2, etc.
+ (compute_logical_op_length): Likewise.
+ (compute_logical_op_cc): Likewise.
+
+2003-01-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (CONSTANT_ADDRESS_P): Allow CONST and
+ HIGH on all variants.
+
+2003-01-08 Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
+
+ * Makefile.in (PARTITION_H): New.
+ (BASIC_BLOCK_H): Added hard-reg-set.h and $(PARTITION_H).
+ * basic-block.h: Include hard-reg-set.h.
+
+2003-01-08 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (ENABLE_XF_PATTERNS): Delete.
+ * arm.md (addxf3, subxf3, mulxf3, divxf3, modxf3, negxf2, absxf2)
+ (sqrtxf2, floatsixf2, fix_truncxfsi2, truncxfsf2, truncxfdf2)
+ (extendsfxf2, extenddfxf2, movxf, cmpxf, cmpxf_insn)
+ (cmpxf_trap): Delete.
+ (movxf_hard_insn): Remove test of ENABLE_XF_PATTERNS.
+
+2003-01-08 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (adddi3_carry_rex64, subdi3_carry_rex64): Name pattern.
+ (addhi3_carry, addqi3_carry, subhi3_carry, subqi3_carry): New patterns.
+ (add??cc): New expanders.
+ * i386.c (expand_int_addcc): New function.
+ * i386-protos.h (expand_int_addcc): Declare.
+
+ * alias.c (memory_modified_1): New static function.
+ (memory_modified): New static varaible.
+ (memory_modified_in_insn_p): New global function.
+ * rtl.h (memory_modified_in_insn_p): Declare.
+ * rtlanal.c (modified_between_p, modified_in_p): Be smart about memory
+ references.
+
+ * expr.h (emit_conditional_add): Declare.
+
+2003-01-07 Janis Johnson <janis187@us.ibm.com>
+
+ PR other/8947
+ * doc/invoke.texi (-malign-double): Explain that the option breaks
+ binary compatibility.
+
+2003-01-08 Andreas Schwab <schwab@suse.de>
+
+ * config.gcc (m68k-*-linux*): Don't set extra_parts and gnu_ld,
+ should come from the generic *-*-linux* entry.
+
+2003-01-07 Jan Hubicka <jh@suse.cz>
+
+ * cselib.c (cselib_current_insn_in_libcall): New static variable.
+ (new_elt_loc_list, cselib_process_insn, cselib_init): Keep track on whether
+ we are inside libcall.
+ * cselib.h (elt_loc_list): Add in_libcall.
+ * gcse.c (do_local_cprop): Do not copy propagate using insns
+ in libcalls.
+
+2003-01-07 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/tm.texi (TARGET_SCHED_VARIABLE_ISSUE): CLOBBER and USE do
+ not normally affect to issue rate.
+
+2003-01-07 Jan Hubicka <jh@suse.cz>
+
+ * genopinit.c (optabs): Add addc_optab.
+ * ifcvt.c (noce_try_store_flag): Rename to ...
+ (noce_try_addcc): ... this one; handle generic conditional increment.
+ (noce_process_if_block): Update noce_try_addcc call.
+ * optabs.c (emit_conditional_add): New.
+ (init_obtabs): Initialize addc_optab.
+ * optabs.h (optab_index): Add OTI_addcc.
+ (addcc_optab): New macro.
+ * md.texi: Document addMcc
+
+ PR target/8322
+ * i386.c (ix86_init_mmx_sse_builtins): Constify arguments of loads.
+ * xmmintrin.h (_mm_load*_si128. _mm_store*_si128): Add casts.
+ * xmmintrin.h (_mm_load*_si128. _mm_store*_si128): Add casts.
+
+ * reload1.c (delete_output_reload): Avoid repeated attempts
+ to delete insn.
+
+2003-01-07 Andreas Schwab <schwab@suse.de>
+
+ * configure.in: Restore CFLAGS before gcc_AC_INITFINI_ARRAY.
+ Move --enable-initfini-array check ...
+ * aclocal.m4 (gcc_AC_INITFINI_ARRAY): ... here. Define
+ HAVE_INITFINI_ARRAY also when --enable-initfini-array is given.
+ Don't AC_SUBST gcc_cv_initfinit_array. Use AC_TRY_RUN.
+ * configure: Rebuild.
+
+2003-01-07 Richard Henderson <rth@redhat.com>
+
+ * alias.c (find_base_value): Only use new_reg_base_value shortcut
+ if the register is set once.
+
+2003-01-07 Sylvain Pion <Sylvain.Pion@mpi-sb.mpg.de>
+
+ * config/i386/i386.c (ix86_init_mmx_sse_builtins):
+ __builtin_ia32_ldmxcsr and __builtin_ia32_stmxcsr are SSE, not MXX.
+ * config/i386/i386.md (ldmxcsr, stmxcsr): SSE, not MMX.
+
+2003-01-07 Benjamin Kosnik <bkoz@redhat.com>
+ Sunil Davasam <sunil.k.davasam@intel.com>
+
+ PR libstdc++/9076
+ * unwind-dw2.c (execute_cfa_program): DW_CFA_undefined,
+ DW_CFA_same_value, read next and ignore.
+
+2003-01-07 Richard Henderson <rth@redhat.com>
+
+ * cfganal.c (flow_call_edges_add): Don't crash on noreturn call.
+
+2003-01-07 Daniel Berlin <dberlin@dberlin.org>
+
+ * cfg.c: Include alloc-pool.h
+ (edge_pool): New pool.
+ (bb_pool): New pool.
+ (first_deleted_edge): Remove.
+ (first_deleted_block): Remove.
+ (init_flow): Alloc/free the pools.
+ (free_edge): Use pools.
+ (alloc_block): Ditto.
+ (expunge_block): Ditto.
+ (cached_make_edge): Ditto.
+
+ * Makefile.in (cfg.o): Add alloc-pool.h dependency.
+
+2003-01-07 Daniel Berlin <dberlin@dberlin.org>
+
+ * et-forest.c: Include alloc-pool.h.
+ (struct et_forest): Add node_pool and occur_pool.
+ (et_forest_create): Create the new pools.
+ (et_forest_delete): Delete them.
+ (et_forest_add_node): Allocate and free using pools.
+ (et_forest_add_edge): Ditto.
+ (et_forest_remove_node): Ditto.
+ (et_forest_remove_edge): Ditto.
+
+ * Makefile.in (et-forest.o): Add alloc-pool.h dependency.
+
+2003-01-07 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_logical_op): Simplify and
+ optimize the handling of SImode.
+ * config/h8300/h8300.c (compute_logical_op_length): Update
+ accordingly.
+ * config/h8300/h8300.c (compute_logical_op_cc): Likewise.
+
+2003-01-07 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_va_arg): In the EABI code, apply the
+ big-endian correction to indirect arguments too.
+
+2003-01-06 Aldy Hernandez <aldyh@redhat.com>
+
+ Segher Boessenkool <segher@koffie.nl>
+
+ * config/rs6000/rs6000.c (rs6000_reg_names): Add missing registers.
+ (alt_reg_names): Ditto, fix formatting.
+ * config/rs6000/rs6000.h (DEBUG_REGISTER_NAMES): Fix formatting.
+
+2003-01-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (final_prescan_insn): Constify uid.
+ (output_logical_op): Constify intval and det.
+ (compute_logical_length): Likewise.
+ (compute_logical_cc): Likewise.
+ (output_a_shift): Constify mask.
+ (h8300_encode_label): Constify len.
+
+2003-01-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (h8300_expand_prologue): Remove fsize.
+ (h8300_expand_epilogue): Likewise.
+
+2003-01-06 Aldy Hernandez <aldyh@redhat.com>
+
+ Segher Boessenkool <segher@koffie.nl>
+
+ * config/rs6000/altivec.md: Remove spaces from assembler
+ instruction argument lists.
+
+2003-01-07 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * config/c4x/c4x.c (c4x_naked_function_p): Rename from
+ c4x_assembler_function_p.
+ (c4x_null_epilogue_p): Complement return value, all uses updated.
+ (c4x_insert_attributes): Add naked.
+ * config/c4x/c4x.md (c4x_null_epilogue_p): Changes uses.
+ * doc/extend.texi: Update C4x function attributes.
+
+2003-01-06 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_encode_section_info): Adjust symbol_str
+ properly when changing "local-ness".
+ * config/alpha/alpha.md (movdi_er_high_g): Allow all symbols.
+
+2003-01-06 Dale Johannesen <dalej@apple.com>
+
+ * config/darwin-protos.h: Add prototypes for new section functions.
+
+2003-01-06 Chris Demetriou <cgd@broadcom.com>
+
+ * config.gcc (mipsisa32-*-elf*, mipsisa32el-*-elf*): Default ABI
+ to EABI.
+
+2003-01-06 Zack Weinberg <zack@codesourcery.com>
+
+ * hwint.h: If the current compiler has no 64-bit type at all,
+ make HOST_WIDEST_INT 32 bits.
+
+2003-01-06 Eric Christopher <echristo@redhat.com>
+
+ * config/mips/mips.md (movdf_internal2): Fix constraints.
+
+2003-01-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*twoshifts_l16_r1): New.
+
+2003-01-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (leadi): Use dla rather than la.
+
+2003-01-06 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * config/c4x/c4x.h: Updated specs for new gas format. Fixed bug
+ in C33_FLAG. Added proper C33 support in ASM_FILE_START macro.
+
+2003-01-06 Herman A.J. ten Brugge <hermantenbrugge@home.nl>
+
+ * config/c4x/c4x.h: Remove hwint.h include and HOST_WIDE_INT_PRINT_HEX
+ redefinition.
+
+2003-01-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*extzv_8_23): New.
+
+2003-01-05 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * pa64-hpux.h (JCR_SECTION_NAME): Define.
+ (PA_INIT_FRAME_DUMMY_ASM_OP): Check EH_FRAME_SECTION_NAME instead of
+ USE_EH_FRAME_REGISTRY when defining.
+
+2003-01-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_a_shift): Do not output a
+ variable shift.
+ * config/h8300/h8300.md (two splitters): New.
+
+2003-01-05 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md: Disable the movstrsi define_split.
+
+2003-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alloc-pool.c: Don't include "libiberty.h".
+ * config/sparc/gmon-sol2.c: Include <fcntl.h>.
+ * convert.c (convert_to_real): Hide unused variable.
+
+2003-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (gtyp-gen.h): Const-ify.
+ * gcov-dump.c (tag_table): Likewise.
+
+2003-01-04 Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/fixfixes.c(wrap_fix): the wrapper guard must be a function
+ of *both* the file name and the fix name.
+
+2003-01-04 John David Anglin <dave.anglin@nrc.ca>
+
+ * config.gcc (hppa*64*-*-hpux11*): Define extra_parts. Don't use
+ collect2.
+ * pa-hpux11.h (LDD_SUFFIX, PARSE_LDD_OUTPUT): Undefine.
+ (HAS_INIT_SECTION, LD_INIT_SWITCH, LD_FINI_SWITCH): Define.
+ * pa64-hpux.h (HP_INIT_ARRAY_SECTION_ASM_OP,
+ GNU_INIT_ARRAY_SECTION_ASM_OP, HP_FINI_ARRAY_SECTION_ASM_OP,
+ GNU_FINI_ARRAY_SECTION_ASM_OP): Define.
+ (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Define when not using
+ elfos.h.
+ (EH_FRAME_IN_DATA_SECTION): Delete define.
+ (HAS_INIT_SECTION, LD_INIT_SWITCH, LD_FINI_SWITCH): Undefine.
+ (STARTFILE_SPEC): Use crtbegin.o.
+ (ENDFILE_SPEC): Use crtend.o.
+ (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION,
+ SUPPORTS_INIT_PRIORITY, PA_CXA_FINALIZE_STUB, PA_INIT_FINI_HACK,
+ PA_INIT_FRAME_DUMMY_ASM_OP, PA_JV_REGISTERCLASSES_STUB,
+ DTOR_LIST_BEGIN): Define.
+ * pa.c (TARGET_ASM_CONSTRUCTOR): Define.
+ (pa_asm_out_constructor, pa_asm_out_destructor): New functions.
+ * som.h (SUPPORTS_INIT_PRIORITY): Delete define.
+
+2002-12-31 Larin Hennessy <larin@science.oregonstate.edu>
+
+ * fixinc/fixinc.svr4: Remove references to i860, Sony NewsOS, and spur.
+ * fixinc/inclhack.def: Remove tests for Apple A/UX, ARM/RISCiX, DG/UX,
+ m88k-*-sysv3*, Sony NewsOS. Remove references to i860.
+ Cleanup handling of replacement text.
+ * fixinc/mkfixinc.sh: Remove reference to i?86-*-osf1*
+
+2003-01-04 Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/tests/base/math.h: removed obsolete results
+ * fixinc/tests/base/stdlib.h: ditto
+ * fixinc/tests/base/sys/param.h: ditto
+ * fixinc/tests/base/sys/stat.h: ditto
+ * fixinc/tests/base/time.h: ditto
+ * fixinc/tests/base/X11/Intrinsic.h: removed obsolete file
+ * fixinc/tests/base/sys/byteorder.h: ditto
+ * fixinc/inclhack.def: Remove superfluous backslashes
+
+2003-01-04 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add prototypes for
+ the new functions defined below.
+ * config/h8300/h8300.c (TARGET_ASM_FUNCTION_PROLOGUE): Do not
+ define.
+ (dosize): Emit RTL instead of assembly code.
+ (push): Likewise.
+ (pop): Likewise.
+ (h8300_output_function_prologue): Remove.
+ (h8300_expand_prologue): New.
+ (h8300_expand_epilogue): New.
+ (h8300_output_function_epilogue): Do only the reset of
+ pragma_saveall.
+ * config/h8300/h8300.md (push_h8300): New.
+ (push_h8300hs): Likewise.
+ (pop_h8300): Likewise.
+ (pop_h8300hs): Likewise.
+ (*stm_h8300s_2): Change the name to stm_h8300s_2.
+ (*stm_h8300s_3): Change the name to stm_h8300s_3.
+ (*stm_h8300s_4): Change the name to stm_h8300s_4.
+ (*ldm_h8300s_2): New.
+ (*ldm_h8300s_3): Likewise.
+ (*ldm_h8300s_4): Likewise.
+ (return): Likewise.
+ (*return_1): Likewise.
+ (prologue): Likewise.
+ (epilogue): Likewise.
+ (monitor_prologue): Likewise.
+
+2003-01-03 Dale Johannesen <dalej@apple.com>
+
+ * config/darwin.h: (EXTRA_SECTIONS): Add machopic_symbol_stub1,
+ machopic_picsymbol_stub1.
+ (EXTRA_SECTION_FUNCTIONS): Ditto.
+ * rs6000/rs6000.c: Update copyright.
+ (machopic_output_stub): Use them. Remove an insn from stub code.
+
+2003-01-02 Jason Merrill <jason@redhat.com>
+
+ * fold-const.c (fold) [COND_EXPR]: Avoid NOP_EXPRs better.
+
+ * integrate.c (copy_decl_for_inlining): Don't clear the rtl for
+ static/external decls.
+
+ * c-common.c (finish_fname_decls): Put the DECL_STMTs inside the
+ outermost scope.
+ * c-decl.c (c_make_fname_decl): Push the decls there, too.
+
+2003-01-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ h8300_current_function_interrupt_function_p.
+ * config/h8300/h8300.c (interrupt_handler): Remove.
+ (os_task): Likewise.
+ (monitor): Likewise.
+ (pragma_interrupt): New.
+ (WORD_REG_USED): Use
+ h8300_current_function_interrupt_function_p.
+ (dosize): Likewise.
+ (h8300_output_function_prologue): Likewise.
+ Do not set interrupt_handler, os_task, monitor.
+ (h8300_output_function_prologue): Use
+ h8300_current_function_interrupt_function_p.
+ Do not set interrupt_handler, os_task, monitor.
+ (h8300_current_function_interrupt_function_p): New.
+ (h8300_pr_interrupt): Set pragma_interrupt.
+ (h8300_insert_attributes): Reset pragma_interrupt.
+
+2003-01-03 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Configuration): Fix markup for reference to
+ gcc/config.gcc.
+
+2003-01-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*iorhi3_zext): Relax the condition.
+ (*iorhi3_two_qi): Likewise.
+ (*iorsi3_zexthi): Likewise.
+ (*xorhi3_zextqi): Likewise.
+ (*xorsi3_zexthi): Likewise.
+ (*xorsi3_zextqi): Likewise.
+
+2003-01-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (stack_pointer_operand): New.
+ (const_int_gt_2_operand): Likewise.
+ (const_int_ge_8_operand): Likewise.
+ * config/h8300/h8300.md (a splitter): Likewise.
+ (a peephole2): Likewise.
+ * config/h8300/h8300-protos.h: Add prototypes for the new
+ functions above.
+
+2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
+
+ * objc/Make-lang.in, objc/config-lang.in, objc/lang-specs.h,
+ objc/objc-act.h: Fix copyright years.
+
+2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
+
+ * doc/passes.texi: Fix documentation for -fssa-ccp
+
+2003-01-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * gccbug.in: Update for new categories.
+
+2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Reorder some patterns.
+
+2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_logical_op): Fix a warning.
+
+2003-01-01 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/darwin-protos.h, config/c4x/c4x-protos.h,
+ config/cris/cris-protos.h, config/i370/i370-protos.h,
+ config/i960/i960-protos.h, config/ia64/ia64-protos.h,
+ config/v850/v850-protos.h: Use struct, and don't conditionally
+ compile on GCC_C_PRAGMA_H.
+
+2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/arm/arm-protos.h: Remove #ifdef GCC_C_PRAGMA_H.
+ * config/h8300/h8300-protos.h: Likewise.
+ * config/sh/sh-protos.h: Likewise.
+
+2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/arm/arm-protos.h: Use struct cpp_reader instead of
+ cpp_reader.
+ * config/h8300/h8300-protos.h: Likewise.
+ * config/sh/sh-protos.h: Likewise.
+
+2003-01-01 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/arm/arm.c (arm_pr_long_calls, arm_pr_no_long_calls,
+ arm_pr_long_calls_off): Use struct.
+ * config/h8300/h8300.c (h8300_pr-interrupt, h8300_pr_saveall)
+ : Similarly.
+ Don't include cpplib.h.
+ * config/sh/sh.c (sh_pr_interrupt, sh_pr_trapa,
+ sh_pr_nosave_low_regs): Similarly.
+
+2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c: Include cpplib.h.
+
+2003-01-01 Steven Bosscher <s.bosscher@student.tudelft.nl>
+
+ * objc/Make-lang.in, objc/config-lang.in, objc/lang-options.h,
+ objc/lang-specs.h, objc/objc-act.c, objc/objc-act.h,
+ objc/objc-lang.c, objc/objc-tree.def: Replace "GNU CC" with
+ "GCC" in the copyright header.
+
+2003-01-01 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-pragma.c (c_register_pragma): New.
+ (init_pragma): Use it.
+ * c-pragma.h (cpp_register_pragma): Don't declare.
+ (c_register_pragma): New.
+ * cpplib.h: Remove #ifdef GCC_C_PRAGMA_H.
+ * config/darwin.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/arm/arm.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/h8300/h8300.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/i370/i370.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/i960/i960.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/ia64/hpux.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/rs6000/rs6000.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/sh/sh.h (REGISTER_TARGET_PRAGMAS): Update.
+ * config/v850/v850.h (REGISTER_TARGET_PRAGMAS): Update.
+ * doc/tm.texi (REGISTER_TARGET_PRAGMAS): Update
+
+See ChangeLog.8 for earlier changes.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 8d9ceb8fd9b..85e2aec3b52 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -186,7 +186,6 @@ FLEX = @FLEX@
FLEXFLAGS =
AR = ar
AR_FLAGS = rc
-DLLTOOL = dlltool
RANLIB = @RANLIB@
# -------------------------------------------
@@ -223,6 +222,7 @@ STAMP = echo timestamp >
# Make sure the $(MAKE) variable is defined.
@SET_MAKE@
+REMAKEFLAGS=LANGUAGES="$(LANGUAGES)" BOOT_CFLAGS="$(BOOT_CFLAGS)"
# --------
# UNSORTED
@@ -336,27 +336,27 @@ LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
-xmake_file=@dep_host_xmake_file@
-tmake_file=@dep_tmake_file@
+xmake_file=@xmake_file@
+tmake_file=@tmake_file@
out_file=$(srcdir)/config/@out_file@
out_object_file=@out_object_file@
md_file=$(srcdir)/config/@md_file@
-tm_file=@tm_file@
tm_file_list=@tm_file_list@
+tm_include_list=@tm_include_list@
tm_defines=@tm_defines@
tm_p_file_list=@tm_p_file_list@
-tm_p_file=@tm_p_file@
+tm_p_include_list=@tm_p_include_list@
build_xm_file_list=@build_xm_file_list@
-build_xm_file=@build_xm_file@
+build_xm_include_list=@build_xm_include_list@
build_xm_defines=@build_xm_defines@
host_xm_file_list=@host_xm_file_list@
-host_xm_file=@host_xm_file@
+host_xm_include_list=@host_xm_include_list@
host_xm_defines=@host_xm_defines@
-xm_file=@xm_file@
+xm_file_list=@xm_file_list@
+xm_include_list=@xm_include_list@
xm_defines=@xm_defines@
lang_opt_files=@lang_opt_files@ $(srcdir)/c.opt $(srcdir)/common.opt
lang_specs_files=@lang_specs_files@
-lang_options_files=@lang_options_files@
lang_tree_files=@lang_tree_files@
target_cpu_default=@target_cpu_default@
GCC_THREAD_FILE=@thread_file@
@@ -387,13 +387,17 @@ exec_prefix = @exec_prefix@
bindir = @bindir@
# Directory in which to put the directories used by the compiler.
libdir = @libdir@
+# Directory in which GCC puts its executables.
+libexecdir = @libexecdir@
# --------
# UNSORTED
# --------
-# Directory in which the compiler finds executables, libraries, etc.
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version)
+# Directory in which the compiler finds libraries etc.
+libsubdir = $(libdir)/gcc/$(target_alias)/$(version)
+# Directory in which the compiler finds executables
+libexecsubdir = $(libexecdir)/gcc/$(target_alias)/$(version)
# Used to produce a relative $(gcc_tooldir) in gcc.o
unlibsubdir = ../../..
# Directory in which to find other cross-compilation tools and headers.
@@ -653,13 +657,20 @@ C_TREE_H = c-tree.h $(C_COMMON_H)
SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h
PREDICT_H = predict.h predict.def
CPPLIB_H = cpplib.h line-map.h
+PRETTY_PRINT_H = pretty-print.h input.h $(OBSTACK_H)
+DIAGNOSTIC_H = diagnostic.h diagnostic.def $(PRETTY_PRINT_H)
+C_PRETTY_PRINT_H = $(PRETTY_PRINT_H) $(C_COMMON_H) $(TREE_H)
-# sed inserts variable overrides after the following line.
-####target overrides
-@target_overrides@
+# target overrides
+ifneq ($(tmake_file),)
+include $(tmake_file)
+endif
+
+# host overrides
+ifneq ($(xmake_file),)
+include $(xmake_file)
+endif
-####host overrides
-@host_overrides@
#
# Now figure out from those variables how to compile and link.
@@ -719,9 +730,8 @@ BUILD_VARRAY = $(BUILD_PREFIX)varray.o
# currently being compiled, in both source trees, to be examined as well.
# libintl.h will be found in ../intl if we are using the included libintl.
INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
- -I$(srcdir)/config -I$(srcdir)/../include @INCINTL@
+ -I$(srcdir)/../include @INCINTL@
-# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
@@ -729,6 +739,7 @@ INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
# Support for additional languages (other than C).
# C can be supported this way too (leave for later).
+LANG_MAKEFRAGS = @all_lang_makefrags@
LANG_MAKEFILES = @all_lang_makefiles@
LANG_STAGESTUFF = @all_stagestuff@
@@ -737,16 +748,30 @@ LANG_STAGESTUFF = @all_stagestuff@
# because we need CC="stage1/xgcc -Bstage1/" to work in the language
# subdirectories.
# ??? The choices here will need some experimenting with.
+
+export AR_FOR_TARGET
+export AR_CREATE_FOR_TARGET
+export AR_FLAGS_FOR_TARGET
+export AR_EXTRACT_FOR_TARGET
+export AWK
+export BUILD_PREFIX
+export BUILD_PREFIX_1
+export DESTDIR
+export GCC_FOR_TARGET
+export INCLUDES
+export INSTALL_DATA
+export LIB1ASMSRC
+export LIBGCC2_CFLAGS
+export MACHMODE_H
+export NM_FOR_TARGET
+export RANLIB_FOR_TARGET
+export libsubdir
+export slibdir
+
ORDINARY_FLAGS_TO_PASS = \
- "AR_FLAGS_FOR_TARGET=$(AR_FLAGS_FOR_TARGET)" \
- "AR_CREATE_FOR_TARGET=$(AR_CREATE_FOR_TARGET)" \
- "AR_EXTRACT_FOR_TARGET=$(AR_EXTRACT_FOR_TARGET)" \
- "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
"BISON=$(BISON)" \
"BISONFLAGS=$(BISONFLAGS)" \
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
- "DESTDIR=$(DESTDIR)" \
- "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"LDFLAGS=$(LDFLAGS)" \
"FLEX=$(FLEX)" \
"FLEXFLAGS=$(FLEXFLAGS)" \
@@ -755,7 +780,6 @@ ORDINARY_FLAGS_TO_PASS = \
"MAKEINFO=$(MAKEINFO)" \
"MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
"MAKEOVERRIDES=" \
- "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"exeext=$(exeext)" \
"build_exeext=$(build_exeext)" \
@@ -767,7 +791,7 @@ ORDINARY_FLAGS_TO_PASS = \
"build_tooldir=$(build_tooldir)" \
"gcc_tooldir=$(gcc_tooldir)" \
"bindir=$(bindir)" \
- "libsubdir=$(libsubdir)" \
+ "libexecsubdir=$(libsubdir)" \
"datadir=$(datadir)" \
"localedir=$(localedir)"
FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) "CC=@cc_set_by_configure@" \
@@ -797,11 +821,12 @@ C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
c-objc-common.o c-dump.o c-pch.o libcpp.a $(C_TARGET_OBJS)
# Language-specific object files for C.
-C_OBJS = c-parse.o c-lang.o c-pretty-print.o $(C_AND_OBJC_OBJS)
+C_OBJS = c-parse.o c-lang.o c-pretty-print.o stub-objc.o $(C_AND_OBJC_OBJS)
# Language-independent object files.
-OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
+OBJS-common = \
+ alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \
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 \
@@ -809,7 +834,7 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
dwarf2asm.o dwarf2out.o dwarfout.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 hashtable.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o \
+ haifa-sched.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o \
insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
loop.o optabs.o options.o opts.o params.o postreload.o predict.o \
@@ -819,10 +844,17 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.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 timevar.o toplev.o tracer.o tree.o tree-dump.o \
- tree-inline.o unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
- alloc-pool.o et-forest.o cgraph.o cgraphunit.o cfghooks.o bt-load.o \
- $(GGC) $(out_object_file) $(EXTRA_OBJS) $(host_hook_obj)
+ 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)
+
+OBJS-md = $(out_object_file)
+OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) hashtable.o tree-inline.o \
+ tree-optimize.o cgraph.o cgraphunit.o
+
+OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive)
+
+OBJS-onestep = libbackend.o $(OBJS-archive)
BACKEND = main.o libbackend.a
@@ -842,7 +874,7 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
gengtype$(build_exeext) genconditions$(build_exeext) \
genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c \
xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
- $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) cc1obj$(exeext) \
+ $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
protoize$(exeext) unprotoize$(exeext) \
$(SPECS) collect2$(exeext) $(USE_COLLECT2) \
gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
@@ -890,27 +922,24 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
# targets). The name of each hooked is "lang.${target_name}" (eg: lang.info).
# Configure computes and adds these here.
-####language hooks
+# language hooks, generated by configure
@language_hooks@
-# sed inserts language fragments after the following line.
-####language fragments
-@language_fragments@
+# per-language makefile fragments
+ifneq ($(LANG_MAKEFRAGS),)
+include $(LANG_MAKEFRAGS)
+endif
-# End of language makefile fragments.
#
# -----------------------------
# Rebuilding this configuration
# -----------------------------
-Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \
- $(xmake_file) $(tmake_file) $(LANG_MAKEFILES)
- $(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \
- "$(xmake_file)" "$(tmake_file)"
- cp config.status config.run
- LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.run
- rm -f config.run
+Makefile: config.status $(srcdir)/Makefile.in $(srcdir)/version.c
+ LANGUAGES="$(CONFIG_LANGUAGES)" \
+ CONFIG_HEADERS= \
+ CONFIG_FILES=$@ $(SHELL) config.status
config.h: cs-config.h ; @true
bconfig.h: cs-bconfig.h ; @true
@@ -920,27 +949,27 @@ tm_p.h: cs-tm_p.h ; @true
cs-config.h: Makefile
TARGET_CPU_DEFAULT="" \
- HEADERS="$(host_xm_file)" DEFINES="$(host_xm_defines)" \
+ HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh config.h
cs-bconfig.h: Makefile
TARGET_CPU_DEFAULT="" \
- HEADERS="$(build_xm_file)" DEFINES="$(build_xm_defines)" \
+ HEADERS="$(build_xm_include_list)" DEFINES="$(build_xm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh bconfig.h
cs-tconfig.h: Makefile
TARGET_CPU_DEFAULT="" \
- HEADERS="$(xm_file)" DEFINES="$(xm_defines)" \
+ HEADERS="$(xm_include_list)" DEFINES="$(xm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh tconfig.h
cs-tm.h: Makefile
TARGET_CPU_DEFAULT="$(target_cpu_default)" \
- HEADERS="$(tm_file)" DEFINES="$(tm_defines)" \
+ HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh tm.h
cs-tm_p.h: Makefile
TARGET_CPU_DEFAULT="" \
- HEADERS="$(tm_p_file)" DEFINES="" \
+ HEADERS="$(tm_p_include_list)" DEFINES="" \
$(SHELL) $(srcdir)/mkconfig.sh tm_p.h
# Don't automatically run autoconf, since configure.in might be accidentally
@@ -973,13 +1002,15 @@ mkheaders: $(srcdir)/mkheaders.in
# Don't run autoheader automatically either.
# Only run it if maintainer mode is enabled.
@MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
-@MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
+@MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.in
@MAINT@ (cd $(srcdir) && autoheader)
@MAINT@ @rm -f $(srcdir)/cstamp-h.in
@MAINT@ echo timestamp > $(srcdir)/cstamp-h.in
auto-host.h: cstamp-h ; @true
cstamp-h: config.in config.status
- CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
+ CONFIG_HEADERS=auto-host.h:config.in \
+ CONFIG_FILES= \
+ LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
# Really, really stupid make features, such as SUN's KEEP_STATE, may force
# a target to build even if it is up-to-date. So we must verify that
@@ -1026,9 +1057,9 @@ rest.cross: $(LIBGCC) specs
compilations: $(BACKEND)
# Like libcpp.a, this archive is strictly for the host.
-libbackend.a: $(OBJS)
+libbackend.a: $(OBJS@onestep@)
-rm -rf libbackend.a
- $(AR) $(AR_FLAGS) libbackend.a $(OBJS)
+ $(AR) $(AR_FLAGS) libbackend.a $(OBJS@onestep@)
-$(RANLIB) libbackend.a
# We call this executable `xgcc' rather than `gcc'
@@ -1119,18 +1150,9 @@ LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
libgcov.a: libgcc.a; @true
libgcc.a: $(LIBGCC_DEPS)
- $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
- BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
- AR_FOR_TARGET="$(AR_FOR_TARGET)" \
- AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
- AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
+ $(MAKE) \
CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
- RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
- NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
- LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
- INCLUDES="$(INCLUDES)" \
- CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" TM_H="$(TM_H)" \
- LIB1ASMSRC='$(LIB1ASMSRC)' \
+ CONFIG_H="$(TCONFIG_H)" TM_H="$(TM_H)" \
MAKEOVERRIDES= \
-f libgcc.mk all
@@ -1160,18 +1182,9 @@ s-mlib: $(srcdir)/genmultilib Makefile
# Build multiple copies of libgcc.a, one for each target switch.
stmp-multilib: $(LIBGCC_DEPS)
- $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
- BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
- AR_FOR_TARGET="$(AR_FOR_TARGET)" \
- AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
- AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
+ $(MAKE) \
CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
- RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
- NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
- LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
- INCLUDES="$(INCLUDES)" \
- CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
- LIB1ASMSRC='$(LIB1ASMSRC)' \
+ CONFIG_H="$(CONFIG_H)" \
MAKEOVERRIDES= \
-f libgcc.mk all
$(STAMP) stmp-multilib
@@ -1231,7 +1244,7 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
# C language specific files.
c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(C_TREE_H) flags.h diagnostic.h $(TM_P_H)
+ $(C_TREE_H) flags.h $(DIAGNOSTIC_H) $(TM_P_H)
c-parse.o : $(parsedir)/c-parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(GGC_H) intl.h $(C_TREE_H) input.h flags.h toplev.h output.h $(CPPLIB_H) \
varray.h gt-c-parse.h
@@ -1250,8 +1263,8 @@ $(parsedir)/c-parse.c: $(parsedir)/c-parse.y
$(parsedir)/c-parse.y: c-parse.in
echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
- sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
- -e "/^ifc$$/d" -e "/^end ifc$$/d" \
+ sed -e "/^@@ifobjc.*/,/^@@end_ifobjc.*/d" \
+ -e "/^@@ifc.*/d" -e "/^@@end_ifc.*/d" \
$(srcdir)/c-parse.in >>tmp-c-parse.y
$(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(parsedir)/c-parse.y
@@ -1261,11 +1274,14 @@ c-incpath.o: c-incpath.c c-incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) flags.h function.h output.h \
$(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) \
- c-pragma.h gt-c-decl.h cgraph.h $(HASHTAB_H) libfuncs.h except.h
+ opts.h c-pragma.h gt-c-decl.h cgraph.h $(HASHTAB_H) libfuncs.h except.h \
+ $(LANGHOOKS_DEF_H)
c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
$(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
-c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
+c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(C_TREE_H) $(C_PRETTY_PRINT_H) $(DIAGNOSTIC_H) \
$(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-c.h
+stub-objc.o : stub-objc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) $(C_COMMON_H)
c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) real.h c-incpath.h cppdefault.h \
c-pragma.h input.h intl.h flags.h toplev.h output.h \
@@ -1274,8 +1290,8 @@ c-ppoutput.o : c-ppoutput.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(C_COMMON_H) $(TREE_H) $(CPPLIB_H) cpphash.h $(TM_P_H) c-pragma.h
c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) $(EXPR_H) $(C_TREE_H) \
- flags.h toplev.h tree-inline.h diagnostic.h $(VARRAY_H) \
- langhooks.h $(GGC_H) gt-c-objc-common.h $(TARGET_H) cgraph.h
+ flags.h toplev.h tree-inline.h $(DIAGNOSTIC_H) $(VARRAY_H) \
+ langhooks.h $(GGC_H) $(TARGET_H) cgraph.h
c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) flags.h toplev.h
c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
@@ -1309,13 +1325,13 @@ tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h
c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(OBSTACK_H) $(C_COMMON_H) flags.h toplev.h output.h c-pragma.h intl.h \
$(GGC_H) $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def \
- diagnostic.h gt-c-common.h langhooks.h varray.h $(RTL_H) $(TARGET_H) \
- $(C_TREE_H)
-c-pretty-print.o : c-pretty-print.c c-pretty-print.h pretty-print.h \
+ $(DIAGNOSTIC_H) gt-c-common.h langhooks.h varray.h $(RTL_H) \
+ $(TARGET_H) $(C_TREE_H)
+c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \
$(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) real.h
c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h \
+ c-pragma.h flags.h toplev.h langhooks.h tree-inline.h $(DIAGNOSTIC_H) \
intl.h debug.h $(C_COMMON_H) opts.h options.h $(PARAMS_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
@@ -1331,7 +1347,7 @@ attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flag
builtin-types.def $(TARGET_H) langhooks.h
c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \
- $(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
+ $(C_COMMON_H) flags.h toplev.h intl.h $(DIAGNOSTIC_H)
c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
@@ -1341,14 +1357,15 @@ c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) tree-dump.h
c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \
- $(C_COMMON_H) output.h toplev.h c-pragma.h $(GGC_H) debug.h langhooks.h \
- flags.h
+ $(C_COMMON_H) output.h toplev.h c-pragma.h $(GGC_H) debug.h \
+ langhooks.h flags.h hosthooks.h
# Language-independent files.
DRIVER_DEFINES = \
-DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
- -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
+ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
+ -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
-DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
@@ -1387,8 +1404,6 @@ gencheck$(build_exeext) : gencheck.o $(BUILD_LIBDEPS)
gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) $(lang_tree_files)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
- $(srcdir)/gencheck.c $(OUTPUT_OPTION)
gencheck.h : s-gencheck ; @true
s-gencheck : Makefile
@@ -1398,14 +1413,6 @@ s-gencheck : Makefile
$(SHELL) $(srcdir)/move-if-change tmp-gencheck.h gencheck.h
$(STAMP) s-gencheck
-options_.h : s-options ; @true
-s-options : Makefile
- lof="$(lang_options_files)"; for f in $$lof; do \
- echo "#include \"$$f\""; \
- done | sed 's|$(srcdir)/||' > tmp-options_.h
- $(SHELL) $(srcdir)/move-if-change tmp-options_.h options_.h
- $(STAMP) s-options
-
specs.h : s-specs ; @true
s-specs : Makefile
lsf="$(lang_specs_files)"; for f in $$lsf; do \
@@ -1416,9 +1423,10 @@ s-specs : Makefile
options.c: $(lang_opt_files) $(srcdir)/opts.sh options.h intl.h
-options.h: $(lang_opt_files) $(srcdir)/opts.sh
- AWK=$(AWK) $(SHELL) $(srcdir)/opts.sh options.c options.h \
- $(lang_opt_files)
+options.h: $(lang_opt_files) $(srcdir)/opts.sh Makefile
+ AWK=$(AWK) $(SHELL) $(srcdir)/opts.sh \
+ '$(SHELL) $(srcdir)/move-if-change' \
+ options.c options.h $(lang_opt_files)
dumpvers: dumpvers.c
@@ -1430,7 +1438,7 @@ gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h
ssa.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)
+ $(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h
ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H)
@@ -1441,10 +1449,6 @@ ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TR
stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(GGC_H) gt-stringpool.h
-hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H)
-
-line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
-
ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
@@ -1458,17 +1462,20 @@ convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \
tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) langhooks.h \
- $(LANGHOOKS_DEF_H) flags.h
+ $(LANGHOOKS_DEF_H) flags.h $(GGC_H) gt-langhooks.h diagnostic.h
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h function.h \
toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
real.h gt-tree.h
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(SPLAY_TREE_H) tree-dump.h
-tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(RTL_H) $(EXPR_H) flags.h $(PARAMS_H) input.h insn-config.h $(INTEGRATE_H) \
- $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h langhooks.h \
- $(C_COMMON_H) tree-inline.h cgraph.h
+tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TREE_H) $(RTL_H) $(EXPR_H) flags.h $(PARAMS_H) input.h insn-config.h \
+ $(INTEGRATE_H) $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \
+ langhooks.h $(C_COMMON_H) tree-inline.h cgraph.h intl.h
+tree-optimize.o : tree-optimize.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TREE_H) toplev.h langhooks.h cgraph.h $(TIMEVAR_H) function.h $(GGC_H)
+
print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(GGC_H) langhooks.h real.h
stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
@@ -1476,19 +1483,22 @@ stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE
langhooks.h
fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
flags.h real.h toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H) langhooks.h
-diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
+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) \
- output.h diagnostic.h $(TM_P_H) $(INSN_ATTR_H) intl.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 toplev.h
+
toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
- function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
+ function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) \
debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
- graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
+ graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) \
ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
- langhooks.h insn-flags.h options_.h cfglayout.h real.h cfgloop.h \
+ 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) \
-DTARGET_NAME=\"$(target_alias)\" \
@@ -1499,7 +1509,7 @@ host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
hosthooks.h hosthooks-def.h
rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(INSN_ATTR_H) \
- insn-config.h input.h toplev.h intl.h diagnostic.h $(CONFIG_H)
+ insn-config.h input.h toplev.h intl.h $(DIAGNOSTIC_H) $(CONFIG_H)
rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) real.h \
$(GGC_H) errors.h
@@ -1520,16 +1530,16 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_
function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h function.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h \
insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \
- $(TM_P_H) langhooks.h gt-function.h
+ $(TM_P_H) langhooks.h gt-function.h $(TARGET_H)
stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
$(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
- langhooks.h $(PREDICT_H) gt-stmt.h $(OPTABS_H)
-except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
- flags.h except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) langhooks.h \
- insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
+ langhooks.h $(PREDICT_H) gt-stmt.h $(OPTABS_H) $(TARGET_H)
+except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(TREE_H) flags.h except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) \
+ langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
- gt-except.h
+ gt-except.h cgraph.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 \
@@ -1542,7 +1552,7 @@ builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(T
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
- $(EXPR_H) langhooks.h $(TARGET_H) \
+ $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \
libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H) cgraph.h except.h
expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
@@ -1566,7 +1576,7 @@ 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 \
+ $(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 \
$(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) \
gt-dwarf2out.h $(TARGET_H)
@@ -1588,7 +1598,7 @@ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $
jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H) \
- diagnostic.h
+ $(DIAGNOSTIC_H)
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
@@ -1690,7 +1700,7 @@ dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h
combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
function.h insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
- $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
+ $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H) $(TREE_H) $(TARGET_H)
regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \
real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H) $(TIMEVAR_H)
@@ -1732,7 +1742,7 @@ postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H)
caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
flags.h $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
$(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
-bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) $(RTL_H) hard-reg-set.h $(REGS_H) $(OBSTACK_H) $(TM_P_H) \
$(FIBHEAP_H) output.h $(TARGET_H) $(EXPR_H) flags.h $(INSN_ATTR_H)
reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) conditions.h \
@@ -1792,10 +1802,12 @@ regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
resource.h $(OBSTACK_H) flags.h $(TM_P_H)
ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(REGS_H) toplev.h flags.h insn-config.h function.h $(RECOG_H) \
- $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) real.h $(OPTABS_H)
+ $(REGS_H) toplev.h flags.h insn-config.h function.h $(RECOG_H) target.h \
+ $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) real.h $(OPTABS_H) \
+ cfgloop.h
params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h
hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
+pretty-print.o: pretty-print.c $(PRETTY_PRINT_H)
$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
@@ -1816,6 +1828,15 @@ mips-tdump: mips-tdump.o version.o $(LIBDEPS)
mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h
+# FIXME: writing proper dependencies for this is a *LOT* of work.
+libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
+ insn-config.h insn-flags.h insn-codes.h insn-constants.h \
+ insn-attr.h
+ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ -DTARGET_NAME=\"$(target_alias)\" \
+ -DLOCALEDIR=\"$(localedir)\" \
+ -c $(filter %.c,$^) -o $@
+
#
# Generate header and source files from the machine description,
# and compile them.
@@ -1863,8 +1884,6 @@ insn-conditions.o : insn-conditions.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
dummy-conditions.o : dummy-conditions.c $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
- $(srcdir)/dummy-conditions.c $(OUTPUT_OPTION)
insn-flags.h: s-flags ; @true
s-flags : $(md_file) genflags$(build_exeext) $(srcdir)/move-if-change
@@ -2005,7 +2024,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \
$(srcdir)/fold-const.c $(srcdir)/function.c \
$(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
$(srcdir)/profile.c $(srcdir)/ra-build.c $(srcdir)/regclass.c \
- $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c \
+ $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/langhooks.c \
$(srcdir)/sdbout.c $(srcdir)/stmt.c $(srcdir)/stor-layout.c \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
$(out_file) \
@@ -2023,8 +2042,8 @@ gt-lists.h gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h \
gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h \
gt-dwarf2out.h gt-ra-build.h gt-reg-stack.h gt-dwarf2asm.h \
gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parse.h \
-gt-c-pragma.h gt-c-objc-common.h gtype-c.h gt-input.h gt-cfglayout.h \
-gt-stringpool.h : s-gtype ; @true
+gt-c-pragma.h gtype-c.h gt-input.h gt-cfglayout.h \
+gt-stringpool.h gt-langhooks.h : s-gtype ; @true
gtyp-gen.h: Makefile
echo "/* This file is machine generated. Do not edit. */" > tmp-gtyp.h
@@ -2068,43 +2087,43 @@ s-gtype: gengtype$(build_exeext) $(GTFILES)
# about the target machine. They do depend on config.h itself,
# since that describes the host machine.
+# The names of programs that run on the "build" machine.
+genprognames=genconfig genflags gencodes genemit genopinit genrecog \
+ genextract genpeep genattr genoutput
+
+# The names of the executable files for those programs.
+genprogs=$(genprognames:%=%$(build_exeext))
+
+# Object files used in those programs.
+genobjs=$(genprognames:%=%.o) read-rtl.o gensupport.o genattrtab.o \
+ genautomata.o gengenrtl.o genpreds.o gengtype.o \
+ genconstants.o gen-protos.o scan.o fix-header.o scan-decls.o \
+ gencheck.o dummy-conditions.o genconditions.o
+
+$(genprogs): %$(build_exeext): %.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) \
+ $(BUILD_LIBDEPS)
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $< $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+$(genobjs): %.o : %.c
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
$(OBSTACK_H) $(HASHTAB_H)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/read-rtl.c $(OUTPUT_OPTION)
gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
$(OBSTACK_H) errors.h $(HASHTAB_H) gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c $(OUTPUT_OPTION)
-
-genconfig$(build_exeext) : genconfig.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genconfig.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genconfig.o : genconfig.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c $(OUTPUT_OPTION)
-
-genflags$(build_exeext) : genflags.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genflags.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c $(OUTPUT_OPTION)
-
-gencodes$(build_exeext) : gencodes.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- gencodes.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
gencodes.o : gencodes.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c $(OUTPUT_OPTION)
genconstants$(build_exeext) : genconstants.o $(BUILD_RTL) $(BUILD_EARLY_SUPPORT) \
$(BUILD_ERRORS) $(BUILD_LIBDEPS)
@@ -2114,67 +2133,24 @@ genconstants$(build_exeext) : genconstants.o $(BUILD_RTL) $(BUILD_EARLY_SUPPORT)
genconstants.o : genconstants.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
errors.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconstants.c $(OUTPUT_OPTION)
-
-genemit$(build_exeext) : genemit.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genemit.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genemit.o : genemit.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c $(OUTPUT_OPTION)
-
-genopinit$(build_exeext) : genopinit.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genopinit.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genopinit.o : genopinit.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c $(OUTPUT_OPTION)
-
-genrecog$(build_exeext) : genrecog.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genrecog.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genrecog.o : genrecog.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c $(OUTPUT_OPTION)
-
-genextract$(build_exeext) : genextract.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genextract.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genextract.o : genextract.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) insn-config.h errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c $(OUTPUT_OPTION)
-
-genpeep$(build_exeext) : genpeep.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genpeep.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genpeep.o : genpeep.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c $(OUTPUT_OPTION)
-
-genattr$(build_exeext) : genattr.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genattr.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genattr.o : genattr.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h \
gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(OUTPUT_OPTION)
genattrtab$(build_exeext) : genattrtab.o genautomata.o \
$(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_VARRAY) \
@@ -2186,21 +2162,12 @@ genattrtab$(build_exeext) : genattrtab.o genautomata.o \
genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) gensupport.h genattrtab.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(OUTPUT_OPTION)
genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h varray.h genattrtab.h $(HASHTAB_H)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genautomata.c $(OUTPUT_OPTION)
-
-genoutput$(build_exeext) : genoutput.o $(BUILD_RTL) $(BUILD_SUPPORT) \
- $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
- genoutput.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
- $(BUILD_ERRORS) $(BUILD_LIBS)
genoutput.o : genoutput.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c $(OUTPUT_OPTION)
gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_LIBDEPS)
$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
@@ -2208,14 +2175,12 @@ gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_LIBDEPS)
gengenrtl.o : gengenrtl.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
$(GTM_H) real.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c $(OUTPUT_OPTION)
genpreds$(build_exeext) : genpreds.o $(BUILD_LIBDEPS)
$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genpreds.o $(BUILD_LIBS)
genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpreds.c $(OUTPUT_OPTION)
gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
$(BUILD_LIBDEPS)
@@ -2224,8 +2189,6 @@ gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
gengtype.o : gengtype.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
real.h $(RTL_BASE_H) gtyp-gen.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
- $(srcdir)/gengtype.c $(OUTPUT_OPTION)
gengtype-lex.o : $(parsedir)/gengtype-lex.c gengtype.h $(parsedir)/gengtype-yacc.c \
$(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H)
@@ -2265,8 +2228,6 @@ genconditions$(build_exeext) : genconditions.o $(BUILD_EARLY_SUPPORT) \
genconditions.o : genconditions.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
$(GTM_H) errors.h
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
- $(srcdir)/genconditions.c $(OUTPUT_OPTION)
#
# Compile the libraries to be used by gen*.
@@ -2318,7 +2279,7 @@ intl.o: intl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h Makefile
# Make-lang.in should add dependencies of po-generated on any generated
# files which need to be scanned by gettext (usually Yacc-generated parsers).
-po-generated: $(parsedir)/c-parse.c
+po-generated: $(parsedir)/c-parse.c options.c
#
# Remake cpp and protoize.
@@ -2338,7 +2299,7 @@ LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
hashtable.o line-map.o mkdeps.o cpppch.o
LIBCPP_DEPS = $(CPPLIB_H) cpphash.h line-map.h hashtable.h intl.h \
- $(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
+ $(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H)
# Most of the other archives built/used by this makefile are for
# targets. This one is strictly for the host.
@@ -2355,7 +2316,7 @@ cppmacro.o: cppmacro.c $(LIBCPP_DEPS)
cpplib.o: cpplib.c $(LIBCPP_DEPS)
cpphash.o: cpphash.c $(LIBCPP_DEPS)
cpptrad.o: cpptrad.c $(LIBCPP_DEPS)
-cppfiles.o: cppfiles.c $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
+cppfiles.o: cppfiles.c $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h
cppinit.o: cppinit.c $(LIBCPP_DEPS) mkdeps.h
cpppch.o: cpppch.c $(LIBCPP_DEPS) mkdeps.h
@@ -2365,7 +2326,9 @@ cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(PREPROCESSOR_DEFINES) \
-c $(srcdir)/cppdefault.c $(OUTPUT_OPTION)
-mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) mkdeps.h
+mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h
+hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
+line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H)
# Note for the stamp targets, we run the program `true' instead of
# having an empty command (nothing following the semicolon).
@@ -2510,7 +2473,7 @@ fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
$(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
(MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && ${PWD_COMMAND}` ; \
CC="$(CC_FOR_BUILD)"; CFLAGS="$(BUILD_CFLAGS)"; LDFLAGS="$(BUILD_LDFLAGS)"; \
- WARN_CFLAGS="$(WARN_CFLAGS)"; LIBERTY=`pwd`/"$(BUILD_LIBIBERTY)"; \
+ WARN_CFLAGS="$(WARN_CFLAGS)"; LIBERTY=`${PWD_COMMAND}`/"$(BUILD_LIBIBERTY)"; \
export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS LIBERTY; \
cd ./fixinc && \
$(SHELL) $${srcdir}/mkfixinc.sh $(build) $(target))
@@ -2564,10 +2527,8 @@ gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
$(GEN_PROTOS_OBJS) $(BUILD_LIBS)
gen-protos.o: gen-protos.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c $(OUTPUT_OPTION)
scan.o: scan.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c $(OUTPUT_OPTION)
xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile
sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
@@ -2588,10 +2549,8 @@ fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \
fix-header.o: fix-header.c $(OBSTACK_H) scan.h \
xsys-protos.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(CPPLIB_H)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c $(OUTPUT_OPTION)
scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c $(OUTPUT_OPTION)
# stmp-fixproto depends on this, not on fix-header directly.
# The idea is to make sure fix-header gets built,
@@ -2626,6 +2585,10 @@ stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs
docdir = $(srcdir)/doc
+stmp-docobjdir:
+ -test -d $(docobjdir) || mkdir $(docobjdir)
+ $(STAMP) stmp-docobjdir
+
doc: $(BUILD_INFO) $(GENERATED_MANPAGES) gccbug
info: $(docobjdir)/cpp.info $(docobjdir)/gcc.info $(docobjdir)/gccint.info $(docobjdir)/gccinstall.info lang.info $(docobjdir)/cppinternals.info
@@ -2661,99 +2624,55 @@ TEXI_GCCINSTALL_FILES = $(docdir)/install.texi $(docdir)/install-old.texi \
TEXI_CPPINT_FILES = $(docdir)/cppinternals.texi
-$(docobjdir)/cpp.info: $(TEXI_CPP_FILES)
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) -I $(docdir)/include \
- -o $@ $(docdir)/cpp.texi
-
-$(docobjdir)/gcc.info: $(TEXI_GCC_FILES)
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) -I $(docdir)/include \
- -o $@ $(docdir)/gcc.texi
-
-$(docobjdir)/gccint.info: $(TEXI_GCCINT_FILES)
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) -I $(docdir)/include \
- -o $@ $(docdir)/gccint.texi
-
-$(docobjdir)/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) -I $(docdir)/include \
- -o $@ $(docdir)/install.texi
+$(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)/cppinternals.info: $(TEXI_CPPINT_FILES)
+$(docobjdir)/%.info: $(docdir)/%.texi stmp-docobjdir
$(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) -I $(docdir)/include \
- -o $@ $(docdir)/cppinternals.texi
+ -o $@ $<
dvi: gcc.dvi gccint.dvi gccinstall.dvi cpp.dvi lang.dvi cppinternals.dvi
-# This works with GNU Make's default rule.
-cpp.dvi: $(TEXI_CPP_FILES)
- $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cpp.texi
+%.dvi: $(docdir)/%.texi
+ $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $<
-gcc.dvi: $(TEXI_GCC_FILES)
- $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/gcc.texi
-
-gccint.dvi: $(TEXI_GCCINT_FILES)
- $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/gccint.texi
-
-gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
+gccinstall.dvi:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(TEXI2DVI) -I $$s/doc -I $$s/doc/include -o $@ $$s/doc/install.texi
-cppinternals.dvi: $(TEXI_CPPINT_FILES)
- $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cppinternals.texi
-
generated-manpages: $(docobjdir)/gcov.1 $(docobjdir)/cpp.1 $(docobjdir)/gcc.1 \
- $(docobjdir)/gfdl.7 $(docobjdir)/gpl.7 $(docobjdir)/fsf-funding.7 \
- lang.generated-manpages
+ $(docobjdir)/gfdl.7 $(docobjdir)/gpl.7 $(docobjdir)/fsf-funding.7 \
+ lang.generated-manpages
$(docobjdir)/gcov.1: $(docdir)/gcov.texi
- $(STAMP) $(docobjdir)/gcov.1
- -$(TEXI2POD) $(docdir)/gcov.texi > gcov.pod
- -($(POD2MAN) --section=1 gcov.pod > $(docobjdir)/gcov.1.T$$$$ && \
- mv -f $(docobjdir)/gcov.1.T$$$$ $(docobjdir)/gcov.1) || \
- (rm -f $(docobjdir)/gcov.1.T$$$$ && exit 1)
- -rm -f gcov.pod
-
$(docobjdir)/cpp.1: $(docdir)/cpp.texi $(docdir)/cppenv.texi \
$(docdir)/cppopts.texi
- $(STAMP) $(docobjdir)/cpp.1
- -$(TEXI2POD) $(docdir)/cpp.texi > cpp.pod
- -($(POD2MAN) --section=1 cpp.pod > $(docobjdir)/cpp.1.T$$$$ && \
- mv -f $(docobjdir)/cpp.1.T$$$$ $(docobjdir)/cpp.1) || \
- (rm -f $(docobjdir)/cpp.1.T$$$$ && exit 1)
- -rm -f cpp.pod
-
$(docobjdir)/gcc.1: $(docdir)/invoke.texi $(docdir)/cppenv.texi \
$(docdir)/cppopts.texi
- $(STAMP) $(docobjdir)/gcc.1
- -$(TEXI2POD) $(docdir)/invoke.texi > gcc.pod
- -($(POD2MAN) --section=1 gcc.pod > $(docobjdir)/gcc.1.T$$$$ && \
- mv -f $(docobjdir)/gcc.1.T$$$$ $(docobjdir)/gcc.1) || \
- (rm -f $(docobjdir)/gcc.1.T$$$$ && exit 1)
- -rm -f gcc.pod
-
$(docobjdir)/gfdl.7: $(docdir)/include/fdl.texi
- $(STAMP) $(docobjdir)/gfdl.7
- -$(TEXI2POD) $(docdir)/include/fdl.texi > gfdl.pod
- -($(POD2MAN) --section=7 gfdl.pod > $(docobjdir)/gfdl.7.T$$$$ && \
- mv -f $(docobjdir)/gfdl.7.T$$$$ $(docobjdir)/gfdl.7) || \
- (rm -f $(docobjdir)/gfdl.7.T$$$$ && exit 1)
- -rm -f gfdl.pod
-
$(docobjdir)/gpl.7: $(docdir)/include/gpl.texi
- $(STAMP) $(docobjdir)/gpl.7
- -$(TEXI2POD) $(docdir)/include/gpl.texi > gpl.pod
- -($(POD2MAN) --section=7 gpl.pod > $(docobjdir)/gpl.7.T$$$$ && \
- mv -f $(docobjdir)/gpl.7.T$$$$ $(docobjdir)/gpl.7) || \
- (rm -f $(docobjdir)/gpl.7.T$$$$ && exit 1)
- -rm -f gpl.pod
-
$(docobjdir)/fsf-funding.7: $(docdir)/include/funding.texi
- $(STAMP) $(docobjdir)/fsf-funding.7
- -$(TEXI2POD) $(docdir)/include/funding.texi > fsf-funding.pod
- -($(POD2MAN) --section=7 fsf-funding.pod \
- > $(docobjdir)/fsf-funding.7.T$$$$ && \
- mv -f $(docobjdir)/fsf-funding.7.T$$$$ $(docobjdir)/fsf-funding.7) || \
- (rm -f $(docobjdir)/fsf-funding.7.T$$$$ && exit 1)
- -rm -f fsf-funding.pod
+
+$(docobjdir)/%.1: $(docdir)/%.texi stmp-docobjdir
+ $(STAMP) $@
+ -$(TEXI2POD) $< > $(basename $(notdir $@)).pod
+ -($(POD2MAN) --section=1 \
+ $(basename $(notdir $@)).pod > $(@).T$$$$ && \
+ mv -f $(@).T$$$$ $@) || \
+ (rm -f $(@).T$$$$ && exit 1)
+ -rm -f $(basename $(notdir $@)).pod
+
+$(docobjdir)/%.7: $(docdir)/%.texi stmp-docobjdir
+ $(STAMP) $@
+ -$(TEXI2POD) $< > $(basename $(notdir $@)).pod
+ -($(POD2MAN) --section=7 \
+ $(basename $(notdir $@)).pod > $(@).T$$$$ && \
+ mv -f $(@).T$$$$ $@) || \
+ (rm -f $(@).T$$$$ && exit 1)
+ -rm -f $(basename $(notdir $@)).pod
#
# Deletion of files made during compilation.
@@ -2781,7 +2700,7 @@ mostlyclean: lang.mostlyclean
-rm -f xlimits.h
# Delete other built files.
-rm -f xsys-protos.hT
- -rm -f specs.h options_.h gencheck.h options.c options.h
+ -rm -f specs.h gencheck.h options.c options.h
# Delete the stamp and temporary files.
-rm -f s-* tmp-* stamp-* stmp-*
-rm -f */stamp-* */tmp-*
@@ -2920,9 +2839,10 @@ install-cpp: cpp$(exeext)
fi
# Create the installation directories.
-# $(libdir)/gcc-lib/include isn't currently searched by cpp.
+# $(libdir)/gcc/include isn't currently searched by cpp.
installdirs:
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(libsubdir)
+ $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(libexecsubdir)
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir)
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(includedir)
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(infodir)
@@ -2931,18 +2851,18 @@ installdirs:
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(man7dir)
# Install the compiler executables built during cross compilation.
-install-common: native $(EXTRA_PARTS) lang.install-common
+install-common: native $(EXTRA_PARTS) lang.install-common installdirs
for file in $(COMPILERS); do \
if [ -f $$file ] ; then \
- rm -f $(DESTDIR)$(libsubdir)/$$file; \
- $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file; \
+ rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
+ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
else true; \
fi; \
done
for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
if [ x"$$file" != x.. ]; then \
- rm -f $(DESTDIR)$(libsubdir)/$$file; \
- $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file; \
+ rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
+ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
else true; fi; \
done
for file in $(EXTRA_PARTS) ..; do \
@@ -3064,44 +2984,18 @@ install-man: installdirs $(GENERATED_MANPAGES) lang.install-man
# Install the library.
install-libgcc: libgcc.mk libgcc.a libgcov.a installdirs
- $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
- BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
- AR_FOR_TARGET="$(AR_FOR_TARGET)" \
- AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
- AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
+ $(MAKE) \
CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
- NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
- LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
- INCLUDES="$(INCLUDES)" \
- CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
- LIB1ASMSRC='$(LIB1ASMSRC)' \
+ CONFIG_H="$(TCONFIG_H)" \
MAKEOVERRIDES= \
- INSTALL_DATA="$(INSTALL_DATA)" \
- RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
- DESTDIR="$(DESTDIR)" \
- libsubdir="$(libsubdir)" \
- slibdir="$(slibdir)" \
-f libgcc.mk install
# Install multiple versions of libgcc.a, libgcov.a.
install-multilib: stmp-multilib installdirs
- $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
- BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
- AR_FOR_TARGET="$(AR_FOR_TARGET)" \
- AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
- AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
+ $(MAKE) \
CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
- NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
- LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
- INCLUDES="$(INCLUDES)" \
- CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
- LIB1ASMSRC='$(LIB1ASMSRC)' \
+ CONFIG_H="$(CONFIG_H)" \
MAKEOVERRIDES= \
- INSTALL_DATA="$(INSTALL_DATA)" \
- RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
- DESTDIR="$(DESTDIR)" \
- libsubdir="$(libsubdir)" \
- slibdir="$(slibdir)" \
-f libgcc.mk install
# Install all the header files built in the include subdirectory.
@@ -3149,25 +3043,28 @@ install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
cp -p -r include $(DESTDIR)$(libsubdir)
-itoolsdir = $(libsubdir)/install-tools
+itoolsdir = $(libexecsubdir)/install-tools
+itoolsdatadir = $(libsubdir)/install-tools
# Don't install the headers. Instead, install appropriate scripts
# and supporting files for fixincludes to be run later.
install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
mkheaders xlimits.h
- -rm -rf $(DESTDIR)$(itoolsdir)
- $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdir)/include
+ -rm -rf $(DESTDIR)$(itoolsdir) $(DESTDIR)$(itoolsdatadir)
+ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdatadir)/include
+ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdir)
for file in $(USER_H); do \
realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
$(INSTALL_DATA) $$file \
- $(DESTDIR)$(itoolsdir)/include/$$realfile ; \
+ $(DESTDIR)$(itoolsdatadir)/include/$$realfile ; \
done
- $(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdir)/include/limits.h
+ $(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdatadir)/include/limits.h
if [ x$(STMP_FIXINC) != x ] ; then \
$(INSTALL_DATA) $(srcdir)/README-fixinc \
- $(DESTDIR)$(itoolsdir)/include/README ; \
+ $(DESTDIR)$(itoolsdatadir)/include/README ; \
$(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
$(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \
- $(INSTALL_DATA) $(srcdir)/gsyslimits.h $(DESTDIR)$(itoolsdir)/gsyslimits.h ; \
+ $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
+ $(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \
else :; fi
if [ x$(STMP_FIXPROTO) != x ] ; then \
$(INSTALL_SCRIPT) $(srcdir)/mkinstalldirs \
@@ -3178,23 +3075,26 @@ install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
else :; fi
$(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
- > $(DESTDIR)$(itoolsdir)/mkheaders.conf
+ > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
- >> $(DESTDIR)$(itoolsdir)/mkheaders.conf
+ >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
echo 'FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"' \
- >> $(DESTDIR)$(itoolsdir)/mkheaders.conf
- echo 'STMP_FIXPROTO="$(STMP_FIXPROTO)"' >> $(DESTDIR)$(itoolsdir)/mkheaders.conf
- echo 'STMP_FIXINC="$(STMP_FIXINC)"' >> $(DESTDIR)$(itoolsdir)/mkheaders.conf
+ >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
+ echo 'STMP_FIXPROTO="$(STMP_FIXPROTO)"' \
+ >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
+ echo 'STMP_FIXINC="$(STMP_FIXINC)"' \
+ >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
# Use this target to install the program `collect2' under the name `collect2'.
install-collect2: collect2 installdirs
- $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libsubdir)/collect2$(exeext)
+ $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libexecsubdir)/collect2$(exeext)
# Install the driver program as $(libsubdir)/gcc for collect2.
- $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libsubdir)/gcc$(exeext)
+ $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext)
# Cancel installation by deleting the installed files.
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)
@@ -3311,37 +3211,7 @@ $(TESTSUITEDIR)/site.exp: site.exp
-rm -f $@
sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@
-check-g++: $(TESTSUITEDIR)/site.exp
- -(rootme=`${PWD_COMMAND}`; export rootme; \
- srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
- cd $(TESTSUITEDIR); \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool g++ $(RUNTESTFLAGS))
-
-check-gcc: $(TESTSUITEDIR)/site.exp
- -(rootme=`${PWD_COMMAND}`; export rootme; \
- srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
- cd $(TESTSUITEDIR); \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool gcc $(RUNTESTFLAGS))
-
-check-g77: $(TESTSUITEDIR)/site.exp
- -(rootme=`${PWD_COMMAND}`; export rootme; \
- srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
- cd $(TESTSUITEDIR); \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool g77 $(RUNTESTFLAGS))
-
-check-objc: $(TESTSUITEDIR)/site.exp
+check-g++ check-gcc check-g77 check-objc: check-% : $(TESTSUITEDIR)/site.exp
-(rootme=`${PWD_COMMAND}`; export rootme; \
srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
cd $(TESTSUITEDIR); \
@@ -3349,7 +3219,7 @@ check-objc: $(TESTSUITEDIR)/site.exp
if [ -f $${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool objc $(RUNTESTFLAGS))
+ $(RUNTEST) --tool $* $(RUNTESTFLAGS))
check-consistency: testsuite/site.exp
-rootme=`${PWD_COMMAND}`; export rootme; \
@@ -3387,7 +3257,7 @@ QMTEST_DIR=qmtestsuite
${QMTEST_DIR} stamp-qmtest:
${QMTEST} -D ${QMTEST_DIR} create-tdb \
-c gcc_database.GCCDatabase \
- -a srcdir=`cd ${srcdir}/testsuite && pwd` && \
+ -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \
$(STAMP) stamp-qmtest
# Create the QMTest context file.
@@ -3448,7 +3318,6 @@ VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
POSTSTAGE1_FLAGS_TO_PASS = \
ADAC="\$$(CC)" \
- GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
CFLAGS="$(BOOT_CFLAGS)" \
LDFLAGS="$(BOOT_LDFLAGS)" \
WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
@@ -3478,8 +3347,8 @@ STAGEFEEDBACK_FLAGS_TO_PASS = \
stage1_build:
$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
- GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
- MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS=
+ MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS= \
+ OBJS-onestep="$(OBJS)"
$(STAMP) stage1_build
echo stage1_build > stage_last
@@ -3600,46 +3469,54 @@ unstage1 unstage2 unstage3 unstage4 unstageprofile unstagefeedback:
echo $${stage}_build > stage_last
restage1: unstage1
- $(MAKE) stage1_build
+ $(MAKE) $(REMAKEFLAGS) stage1_build
restage2: unstage2
- $(MAKE) LANGUAGES="$(LANGUAGES)" stage2_build
+ $(MAKE) $(REMAKEFLAGS) stage2_build
restage3: unstage3
- $(MAKE) LANGUAGES="$(LANGUAGES)" stage3_build
+ $(MAKE) $(REMAKEFLAGS) stage3_build
restage4: unstage4
- $(MAKE) LANGUAGES="$(LANGUAGES)" stage4_build
+ $(MAKE) $(REMAKEFLAGS) stage4_build
restageprofile: unstageprofile
- $(MAKE) LANGUAGES="$(LANGUAGES)" stageprofile_build
+ $(MAKE) $(REMAKEFLAGS) stageprofile_build
restagefeedback: unstagefeedback
- $(MAKE) LANGUAGES="$(LANGUAGES)" stagefeedback_build
+ $(MAKE) $(REMAKEFLAGS) stagefeedback_build
+# Bubble up a bugfix through all the stages. Primarily useful for fixing
+# bugs that cause the compiler to crash while building stage 2.
bubblestrap:
- if test -f stage3_build; then true; else \
- echo; echo You must \"make bootstrap\" first.; \
- exit 1; \
+ if test -f stage_last; then \
+ LAST=`sed -e 's/_build//' < stage_last`; \
+ if test "$$LAST" != "stage1"; then \
+ $(MAKE) $(REMAKEFLAGS) $$LAST; \
+ $(STAMP) $${LAST}_copy; \
+ fi; \
+ fi
+ if test -f stage1_copy; then $(MAKE) unstage1; fi
+ $(MAKE) $(REMAKEFLAGS) stage1_copy
+ if test -f stage2_copy; then $(MAKE) unstage2; fi
+ $(MAKE) $(REMAKEFLAGS) stage2_copy
+ if test -f stage3_copy; then $(MAKE) unstage3; fi
+ $(MAKE) $(REMAKEFLAGS) stage3_build
+ if test -f stage4_copy; then \
+ $(MAKE) $(REMAKEFLAGS) stage3_copy; $(MAKE) unstage4; \
+ $(MAKE) $(REMAKEFLAGS) stage4_build || exit 1; \
fi
- for i in stage3 \
- unstage1 stage1_build stage1_copy \
- unstage2 stage2_build stage2_copy \
- unstage3 stage3_build ; \
- do \
- $(MAKE) LANGUAGES="$(LANGUAGES)" $$i || exit 1 ; \
- done
quickstrap:
if test -f stage_last ; then \
- LAST=`cat stage_last`; rm $$LAST; $(MAKE) BOOT_CFLAGS="$(BOOT_CFLAGS)" LANGUAGES="$(LANGUAGES)" $$LAST; \
+ LAST=`cat stage_last`; rm $$LAST; $(MAKE) $(REMAKEFLAGS) $$LAST; \
else \
- $(MAKE) stage1_build; \
+ $(MAKE) $(REMAKEFLAGS) stage1_build; \
fi
cleanstrap:
-$(MAKE) clean
- $(MAKE) LANGUAGES="$(LANGUAGES)" bootstrap
+ $(MAKE) $(REMAKEFLAGS) bootstrap
unstrap:
-rm -rf stage[234]*
@@ -3650,7 +3527,7 @@ unstrap:
# not from scratch.
restrap:
$(MAKE) unstrap
- $(MAKE) LANGUAGES="$(LANGUAGES)" bootstrap
+ $(MAKE) $(REMAKEFLAGS) bootstrap
# Compare the object files in the current directory with those in the
# stage2 directory.
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index c313aaa300b..d772ee91f5b 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -16,6 +16,27 @@ if test $ac_cv_header_stdbool_h = yes; then
fi
])
+dnl Fixed AC_CHECK_TYPE that doesn't need anything in acconfig.h.
+dnl Remove after migrating to 2.5x.
+AC_DEFUN(gcc_AC_CHECK_TYPE,
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(ac_cv_type_$1,
+[AC_EGREP_CPP(dnl
+changequote(<<,>>)dnl
+<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
+changequote([,]), [#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
+AC_MSG_RESULT($ac_cv_type_$1)
+if test $ac_cv_type_$1 = no; then
+ AC_DEFINE($1, $2, [Define as \`$2' if <sys/types.h> doesn't define.])
+fi
+])
+
+
dnl See whether we can include both string.h and strings.h.
AC_DEFUN(gcc_AC_HEADER_STRING,
[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
@@ -80,6 +101,29 @@ if test x = y ; then
fi
])
+dnl 'make compare' can be significantly faster, if cmp itself can
+dnl skip bytes instead of using tail. The test being performed is
+dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
+dnl but we need to sink errors and handle broken shells.
+AC_DEFUN(gcc_AC_PROG_CMP_IGNORE_INITIAL,
+[AC_CACHE_CHECK([for cmp's capabilities], gcc_cv_prog_cmp_skip,
+[ echo abfoo >t1
+ echo cdfoo >t2
+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
+ gcc_cv_prog_cmp_skip=slowcompare
+ else
+ gcc_cv_prog_cmp_skip=gnucompare
+ fi
+ else
+ gcc_cv_prog_cmp_skip=slowcompare
+ fi
+ rm t1 t2
+])
+make_compare_target=$gcc_cv_prog_cmp_skip
+AC_SUBST(make_compare_target)
+])
+
dnl See if the printf functions in libc support %p in format strings.
AC_DEFUN(gcc_AC_FUNC_PRINTF_PTR,
[AC_CACHE_CHECK(whether the printf functions support %p,
@@ -659,9 +703,15 @@ done
gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"`
gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"`
gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"`
+case $gcc_cv_gas_patch_version in
+ "") gcc_cv_gas_patch_version="0" ;;
+esac
+gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
+ + $gcc_cv_gas_minor_version \) \* 1000 \
+ + $gcc_cv_gas_patch_version`
]) []dnl # _gcc_COMPUTE_GAS_VERSION
-dnl # gcc_GAS_VERSION_GTE_IFELSE(major, minor, patchlevel,
+dnl # gcc_GAS_VERSION_GTE_IFELSE([elf,] major, minor, patchlevel,
dnl # [command_if_true = :], [command_if_false = :])
dnl # Check to see if the version of GAS is greater than or
dnl # equal to the specified version.
@@ -670,23 +720,54 @@ dnl # The first ifelse() shortens the shell code if the patchlevel
dnl # is unimportant (the usual case). The others handle missing
dnl # commands. Note that the tests are structured so that the most
dnl # common version number cases are tested first.
+AC_DEFUN([_gcc_GAS_VERSION_GTE_IFELSE],
+[ifelse([$1], elf,
+ [if test $in_tree_gas_is_elf = yes \
+ &&],
+ [if]) test $gcc_cv_gas_vers -ge `expr \( \( $2 \* 1000 \) + $3 \) \* 1000 + $4`
+ then dnl
+ifelse([$5],,:,[$5])[]dnl
+ifelse([$6],,,[
+ else $6])
+fi])
+
AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE],
-[AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION]) []dnl
-ifelse([$3],[0],
-[if test $gcc_cv_gas_major_version -eq $1 \
-&& test $gcc_cv_gas_minor_version -ge $2 \
-|| test $gcc_cv_gas_major_version -gt $1 ; then
-],
-[if test $gcc_cv_gas_major_version -eq $1 \
-&& (test $gcc_cv_gas_minor_version -gt $2 \
- || (test $gcc_cv_gas_minor_version -eq $2 \
- && test $gcc_cv_gas_patch_version -ge $3 )) \
-|| test $gcc_cv_gas_major_version -gt $1 ; then
-])
-ifelse([$4],[],[:],[$4])
-ifelse([$5],[],[],[else $5])
-fi
-]) []dnl # gcc_GAS_VERSION_GTE_IFELSE
+[AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION])dnl
+ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)],
+ [_gcc_GAS_VERSION_GTE_IFELSE(,$@)])])
+
+dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel],
+dnl [extra switches to as], [assembler input],
+dnl [extra testing logic], [command if feature available])
+dnl
+dnl Checks for an assembler feature. If we are building an in-tree
+dnl gas, the feature is available if the associated assembler version
+dnl is greater than or equal to major.minor.patchlevel. If not, then
+dnl ASSEMBLER INPUT is fed to the assembler and the feature is available
+dnl if assembly succeeds. If EXTRA TESTING LOGIC is not the empty string,
+dnl then it is run instead of simply setting CV to "yes" - it is responsible
+dnl for doing so, if appropriate.
+AC_DEFUN([gcc_GAS_CHECK_FEATURE],
+[AC_CACHE_CHECK([assembler for $1], [$2],
+ [[$2]=no
+ ifelse([$3],,,[dnl
+ if test $in_tree_gas = yes; then
+ gcc_GAS_VERSION_GTE_IFELSE($3, [[$2]=yes])
+ el])if test x$gcc_cv_as != x; then
+ echo ifelse(substr([$5],0,1),[$], "[$5]", '[$5]') > conftest.s
+ if AC_TRY_COMMAND([$gcc_cv_as $4 -o conftest.o conftest.s >&AC_FD_CC])
+ then
+ ifelse([$6],, [$2]=yes, [$6])
+ else
+ echo "configure: failed program was" >&AC_FD_CC
+ cat conftest.s >&AC_FD_CC
+ fi
+ rm -f conftest.o conftest.s
+ fi])
+ifelse([$7],,,[dnl
+if test $[$2] = yes; then
+ $7
+fi])])
# lcmessage.m4 serial 3 (gettext-0.11.3)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index cc2d36df7e0..c84af19d0d6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,34 @@
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * trans.c, utils.c: Revert.
+
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and
+ change to const.
+
+2003-09-04 Michael Matz <matz@suse.de>
+
+ * misc.c: Include "target.h".
+ * Make-lang.in (misc.o): Add dependency on target.h.
+
+2003-09-03 DJ Delorie <dj@redhat.com>
+
+ * misc.c (default_pass_by_ref): Convert to calls.return_in_memory
+ hook.
+
+2003-08-30 Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in: Update substitutions to match changes to
+ configure. Use include directives instead of @-insertions
+ to read in host and target fragments. Add a rule to
+ regenerate ada/Makefile.
+
+2003-07-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang-options.h: Remove.
+ * lang.opt: Add help text.
+
2003-07-07 Nathan Sidwell <nathan@codesourcery.com>
* trans.c (build_unit_elab, set_lineno): Adjust emit_line_note
@@ -118,7 +149,7 @@
* bindgen.adb (Gen_Main_C): Mark ensure_reference with
__attribute__ ((__unused__)).
-Thu Jun 5 18:33:40 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-05 Jan Hubicka <jh@suse.cz>
* Make-lang.in: Add support for stageprofile and stagefeedback
@@ -137,10 +168,10 @@ Thu Jun 5 18:33:40 CEST 2003 Jan Hubicka <jh@suse.cz>
2003-06-04 Olivier Hainque <hainque@act-europe.fr>
- PR ada/9953:
- * 5hsystem.ads: Remove pragma Linker_Option for pthreads library,
- and turn ZCX_By_Default back to False since the underlying support
- is not quite there yet.
+ PR ada/9953:
+ * 5hsystem.ads: Remove pragma Linker_Option for pthreads library,
+ and turn ZCX_By_Default back to False since the underlying support
+ is not quite there yet.
2003-06-01 Andreas Jaeger <aj@suse.de>
@@ -168,9 +199,9 @@ Thu Jun 5 18:33:40 CEST 2003 Jan Hubicka <jh@suse.cz>
2003-05-01 Laurent Guerby <guerby@acm.org>
- PR ada/10546
- * 5iosinte.ads: Increase pthread_cond_t size to match recent
- LinuxThread and NPTL version, merge from ACT.
+ PR ada/10546
+ * 5iosinte.ads: Increase pthread_cond_t size to match recent
+ LinuxThread and NPTL version, merge from ACT.
2003-04-28 Zack Weinberg <zack@codesourcery.com>
diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in
index b1a75990f4e..9dec92ad48e 100644
--- a/gcc/ada/Make-lang.in
+++ b/gcc/ada/Make-lang.in
@@ -1014,7 +1014,7 @@ ada/misc.o : ada/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
diagnostic.h output.h except.h $(TM_P_H) langhooks.h debug.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
+ ada/fe.h $(ADA_TREE_H) ada/gigi.h ada/adadecode.h opts.h options.h target.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 \
diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in
index c10bbc4a103..abed86b7cde 100644
--- a/gcc/ada/Makefile.in
+++ b/gcc/ada/Makefile.in
@@ -177,8 +177,8 @@ objdir = .
target=@target@
target_alias=@target_alias@
-xmake_file=@dep_host_xmake_file@
-tmake_file=@dep_tmake_file@
+xmake_file = @xmake_file@
+tmake_file = @tmake_file@
host_canonical=@host@
#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
@@ -217,12 +217,20 @@ all: all.indirect
# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:
-# sed inserts variable overrides after the following line.
-####target overrides
-@target_overrides@
+# tmake_file and xmake_file expand to lists with entries of the form
+# $(srcdir)/config/... but here $(srcdir) is the ada subdirectory so we
+# need to adjust the paths. There can't be spaces in the subst arguments
+# or we get spurious spaces in the actual list of files to include.
-####host overrides
-@host_overrides@
+# target overrides
+ifneq ($(tmake_file),)
+include $(subst /config,/../config,$(tmake_file))
+endif
+
+# host overrides
+ifneq ($(xmake_file),)
+include $(subst /config,/../config,$(xmake_file))
+endif
# Now figure out from those variables how to compile and link.
@@ -278,6 +286,13 @@ ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)
.ads.o:
$(ADAC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $<
+# how to regenerate this file
+Makefile: ../config.status $(srcdir)/Makefile.in $(srcdir)/../version.c
+ cd ..; \
+ LANGUAGES="$(CONFIG_LANGUAGES)" \
+ CONFIG_HEADERS= \
+ CONFIG_FILES=ada/Makefile $(SHELL) config.status
+
# This tells GNU make version 3 not to export all the variables
# defined in this file into the environment.
.NOEXPORT:
diff --git a/gcc/ada/lang.opt b/gcc/ada/lang.opt
index 9d8b7ab221d..393c72d14e7 100644
--- a/gcc/ada/lang.opt
+++ b/gcc/ada/lang.opt
@@ -27,17 +27,21 @@ Ada
I
Ada Joined Separate
+; Documented for C
Wall
Ada
+; Documented for C
fRTS
Ada RejectNegative
gant
-Ada Joined
+Ada Joined Undocumented
+; Catches typos
gnat
Ada Joined
+-gnat<option> Specify options to GNAT
; This comment is to ensure we retain the blank line above.
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 60232bf5997..45f069d32fb 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -7,7 +7,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- *
@@ -59,6 +59,7 @@
#include "tm_p.h"
#include "langhooks.h"
#include "langhooks-def.h"
+#include "target.h"
#include "ada.h"
#include "types.h"
@@ -796,7 +797,7 @@ default_pass_by_ref (gnu_type)
|| FUNCTION_ARG_PASS_BY_REFERENCE (cum, TYPE_MODE (gnu_type),
gnu_type, 1)
#endif
- || RETURN_IN_MEMORY (gnu_type)
+ || targetm.calls.return_in_memory (gnu_type, NULL_TREE)
|| (AGGREGATE_TYPE_P (gnu_type)
&& (! host_integerp (TYPE_SIZE (gnu_type), 1)
|| 0 < compare_tree_int (TYPE_SIZE (gnu_type),
diff --git a/gcc/alias.c b/gcc/alias.c
index 2617c8b5e71..19ac3f78655 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -110,7 +110,7 @@ static bool nonoverlapping_component_refs_p (tree, tree);
static tree decl_for_component_ref (tree);
static rtx adjust_offset_for_component_ref (tree, rtx);
static int nonoverlapping_memrefs_p (rtx, rtx);
-static int write_dependence_p (rtx, rtx, int);
+static int write_dependence_p (rtx, rtx, int, int);
static int nonlocal_mentioned_p_1 (rtx *, void *);
static int nonlocal_mentioned_p (rtx);
@@ -632,8 +632,7 @@ record_alias_subset (HOST_WIDE_INT superset, HOST_WIDE_INT subset)
{
/* Create an entry for the SUPERSET, so that we have a place to
attach the SUBSET. */
- superset_entry
- = (alias_set_entry) xmalloc (sizeof (struct alias_set_entry));
+ superset_entry = xmalloc (sizeof (struct alias_set_entry));
superset_entry->alias_set = superset;
superset_entry->children
= splay_tree_new (splay_tree_compare_ints, 0, 0);
@@ -783,7 +782,7 @@ find_base_value (rtx src)
return reg_base_value[regno];
}
- return src;
+ return 0;
case MEM:
/* Check for an argument passed in memory. Only record in the
@@ -889,10 +888,8 @@ find_base_value (rtx src)
{
rtx temp = find_base_value (XEXP (src, 0));
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (temp != 0 && CONSTANT_P (temp) && GET_MODE (temp) != Pmode)
+ if (temp != 0 && CONSTANT_P (temp))
temp = convert_memory_address (Pmode, temp);
-#endif
return temp;
}
@@ -1308,10 +1305,8 @@ find_base_term (rtx x)
{
rtx temp = find_base_term (XEXP (x, 0));
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (temp != 0 && CONSTANT_P (temp) && GET_MODE (temp) != Pmode)
+ if (temp != 0 && CONSTANT_P (temp))
temp = convert_memory_address (Pmode, temp);
-#endif
return temp;
}
@@ -1327,7 +1322,7 @@ find_base_term (rtx x)
x = XEXP (x, 0);
if (GET_CODE (x) != PLUS && GET_CODE (x) != MINUS)
return 0;
- /* fall through */
+ /* Fall through. */
case LO_SUM:
case PLUS:
case MINUS:
@@ -2203,10 +2198,11 @@ canon_true_dependence (rtx mem, enum machine_mode mem_mode, rtx mem_addr,
}
/* Returns nonzero if a write to X might alias a previous read from
- (or, if WRITEP is nonzero, a write to) MEM. */
+ (or, if WRITEP is nonzero, a write to) MEM. If CONSTP is nonzero,
+ honor the RTX_UNCHANGING_P flags on X and MEM. */
static int
-write_dependence_p (rtx mem, rtx x, int writep)
+write_dependence_p (rtx mem, rtx x, int writep, int constp)
{
rtx x_addr, mem_addr;
rtx fixed_scalar;
@@ -2225,15 +2221,18 @@ write_dependence_p (rtx mem, rtx x, int writep)
if (DIFFERENT_ALIAS_SETS_P (x, mem))
return 0;
- /* Unchanging memory can't conflict with non-unchanging memory. */
- if (RTX_UNCHANGING_P (x) != RTX_UNCHANGING_P (mem))
- return 0;
+ if (constp)
+ {
+ /* Unchanging memory can't conflict with non-unchanging memory. */
+ if (RTX_UNCHANGING_P (x) != RTX_UNCHANGING_P (mem))
+ return 0;
- /* If MEM is an unchanging read, then it can't possibly conflict with
- the store to X, because there is at most one store to MEM, and it must
- have occurred somewhere before MEM. */
- if (! writep && RTX_UNCHANGING_P (mem))
- return 0;
+ /* If MEM is an unchanging read, then it can't possibly conflict with
+ the store to X, because there is at most one store to MEM, and it
+ must have occurred somewhere before MEM. */
+ if (! writep && RTX_UNCHANGING_P (mem))
+ return 0;
+ }
if (nonoverlapping_memrefs_p (x, mem))
return 0;
@@ -2274,7 +2273,7 @@ write_dependence_p (rtx mem, rtx x, int writep)
int
anti_dependence (rtx mem, rtx x)
{
- return write_dependence_p (mem, x, /*writep=*/0);
+ return write_dependence_p (mem, x, /*writep=*/0, /*constp*/1);
}
/* Output dependence: X is written after store in MEM takes place. */
@@ -2282,7 +2281,16 @@ anti_dependence (rtx mem, rtx x)
int
output_dependence (rtx mem, rtx x)
{
- return write_dependence_p (mem, x, /*writep=*/1);
+ return write_dependence_p (mem, x, /*writep=*/1, /*constp*/1);
+}
+
+/* Unchanging anti dependence: Like anti_dependence but ignores
+ the UNCHANGING_RTX_P property on const variable references. */
+
+int
+unchanging_anti_dependence (rtx mem, rtx x)
+{
+ return write_dependence_p (mem, x, /*writep=*/0, /*constp*/0);
}
/* A subroutine of nonlocal_mentioned_p, returns 1 if *LOC mentions
@@ -2717,17 +2725,16 @@ init_alias_analysis (void)
optimization. Loop unrolling can create a large number of
registers. */
reg_base_value_size = maxreg * 2;
- reg_base_value = (rtx *) ggc_alloc_cleared (reg_base_value_size
- * sizeof (rtx));
+ reg_base_value = ggc_alloc_cleared (reg_base_value_size * sizeof (rtx));
- new_reg_base_value = (rtx *) xmalloc (reg_base_value_size * sizeof (rtx));
- reg_seen = (char *) xmalloc (reg_base_value_size);
+ new_reg_base_value = xmalloc (reg_base_value_size * sizeof (rtx));
+ reg_seen = xmalloc (reg_base_value_size);
if (! reload_completed && flag_old_unroll_loops)
{
/* ??? Why are we realloc'ing if we're just going to zero it? */
- alias_invariant = (rtx *)xrealloc (alias_invariant,
- reg_base_value_size * sizeof (rtx));
- memset ((char *)alias_invariant, 0, reg_base_value_size * sizeof (rtx));
+ alias_invariant = xrealloc (alias_invariant,
+ reg_base_value_size * sizeof (rtx));
+ memset (alias_invariant, 0, reg_base_value_size * sizeof (rtx));
}
/* The basic idea is that each pass through this loop will use the
@@ -2764,10 +2771,10 @@ init_alias_analysis (void)
copying_arguments = true;
/* Wipe the potential alias information clean for this pass. */
- memset ((char *) new_reg_base_value, 0, reg_base_value_size * sizeof (rtx));
+ memset (new_reg_base_value, 0, reg_base_value_size * sizeof (rtx));
/* Wipe the reg_seen array clean. */
- memset ((char *) reg_seen, 0, reg_base_value_size);
+ memset (reg_seen, 0, reg_base_value_size);
/* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address.
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index 9cb56cd48b6..d275cd86cff 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -105,7 +105,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
pool_size = sizeof (struct alloc_pool_def);
/* and allocate that much memory. */
- pool = (alloc_pool) xmalloc (pool_size);
+ pool = xmalloc (pool_size);
/* Now init the various pieces of our pool structure. */
pool->name = xstrdup (name);
@@ -176,7 +176,7 @@ pool_alloc (alloc_pool pool)
alloc_pool_list block_header;
/* Make the block. */
- block = (char *) xmalloc (pool->block_size);
+ block = xmalloc (pool->block_size);
block_header = (alloc_pool_list) block;
block += align_eight (sizeof (struct alloc_pool_list_def));
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 6ddacb18348..a40fea7e761 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -134,11 +134,7 @@ init_attributes (void)
information, in the form of a bitwise OR of flags in enum attribute_flags
from tree.h. Depending on these flags, some attributes may be
returned to be applied at a later stage (for example, to apply
- a decl attribute to the declaration rather than to its type). If
- ATTR_FLAG_BUILT_IN is not set and *NODE is a DECL, then also consider
- whether there might be some default attributes to apply to this DECL;
- if so, decl_attributes will be called recursively with those attributes
- and ATTR_FLAG_BUILT_IN set. */
+ a decl attribute to the declaration rather than to its type). */
tree
decl_attributes (tree *node, tree attributes, int flags)
@@ -151,10 +147,6 @@ decl_attributes (tree *node, tree attributes, int flags)
(*targetm.insert_attributes) (*node, &attributes);
- if (DECL_P (*node) && TREE_CODE (*node) == FUNCTION_DECL
- && !(flags & (int) ATTR_FLAG_BUILT_IN))
- (*lang_hooks.insert_default_attributes) (*node);
-
for (a = attributes; a; a = TREE_CHAIN (a))
{
tree name = TREE_PURPOSE (a);
@@ -162,6 +154,7 @@ decl_attributes (tree *node, tree attributes, int flags)
tree *anode = node;
const struct attribute_spec *spec = NULL;
bool no_add_attrs = 0;
+ tree fn_ptr_tmp = NULL_TREE;
size_t i;
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
@@ -230,9 +223,18 @@ decl_attributes (tree *node, tree attributes, int flags)
&& (TREE_CODE (TREE_TYPE (*anode)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (*anode)) == METHOD_TYPE))
{
- if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
- *anode = build_type_copy (*anode);
- anode = &TREE_TYPE (*anode);
+ /* OK, this is a bit convoluted. We can't just make a copy
+ of the pointer type and modify its TREE_TYPE, because if
+ we change the attributes of the target type the pointer
+ type needs to have a different TYPE_MAIN_VARIANT. So we
+ pull out the target type now, frob it as appropriate, and
+ rebuild the pointer type later.
+
+ This would all be simpler if attributes were part of the
+ declarator, grumble grumble. */
+ fn_ptr_tmp = TREE_TYPE (*anode);
+ anode = &fn_ptr_tmp;
+ flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE;
}
else if (flags & (int) ATTR_FLAG_FUNCTION_NEXT)
{
@@ -299,6 +301,19 @@ decl_attributes (tree *node, tree attributes, int flags)
old_attrs));
}
}
+
+ if (fn_ptr_tmp)
+ {
+ /* Rebuild the function pointer type and put it in the
+ appropriate place. */
+ fn_ptr_tmp = build_pointer_type (fn_ptr_tmp);
+ if (DECL_P (*node))
+ TREE_TYPE (*node) = fn_ptr_tmp;
+ else if (TREE_CODE (*node) == POINTER_TYPE)
+ *node = fn_ptr_tmp;
+ else
+ abort ();
+ }
}
return returned_attrs;
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 0558fe81f5d..221b2466985 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -152,7 +152,8 @@ typedef struct edge_def {
flow. */
#define EDGE_IRREDUCIBLE_LOOP 128 /* Part of irreducible loop. */
#define EDGE_SIBCALL 256 /* Edge from sibcall to exit. */
-#define EDGE_ALL_FLAGS 511
+#define EDGE_LOOP_EXIT 512 /* Exit of a loop. */
+#define EDGE_ALL_FLAGS 1023
#define EDGE_COMPLEX (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH)
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 9b6c47ce490..84d4be2ec38 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -131,8 +131,7 @@ bitmap_element_allocate (bitmap head)
obstack_chunk_free);
}
- element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
- sizeof (bitmap_element));
+ element = obstack_alloc (&bitmap_obstack, sizeof (bitmap_element));
}
}
else
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 401506a2a7e..d7220034880 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -128,7 +128,7 @@ extern int bitmap_last_set_bit (bitmap);
/* Allocate a bitmap with oballoc. */
#define BITMAP_OBSTACK_ALLOC(OBSTACK) \
- bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
+ bitmap_initialize (obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
/* Allocate a bitmap with ggc_alloc. */
#define BITMAP_GGC_ALLOC() \
@@ -136,7 +136,7 @@ extern int bitmap_last_set_bit (bitmap);
/* Allocate a bitmap with xmalloc. */
#define BITMAP_XMALLOC() \
- bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head)), 1)
+ bitmap_initialize (xmalloc (sizeof (bitmap_head)), 1)
/* Do any cleanup needed on a bitmap when it is no longer used. */
#define BITMAP_FREE(BITMAP) \
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 4bcf76c3f22..b3ba22b83ee 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -277,9 +277,8 @@ find_btr_def_group (btr_def_group *all_btr_def_groups, btr_def def)
if (!this_group)
{
- this_group = (btr_def_group)
- obstack_alloc (&migrate_btrl_obstack,
- sizeof (struct btr_def_group_s));
+ this_group = obstack_alloc (&migrate_btrl_obstack,
+ sizeof (struct btr_def_group_s));
this_group->src = def_src;
this_group->members = NULL;
this_group->next = *all_btr_def_groups;
@@ -301,8 +300,8 @@ add_btr_def (fibheap_t all_btr_defs, basic_block bb, int insn_luid, rtx insn,
unsigned int dest_reg, int other_btr_uses_before_def,
btr_def_group *all_btr_def_groups)
{
- btr_def this = (btr_def)
- obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s));
+ btr_def this
+ = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s));
this->bb = bb;
this->luid = insn_luid;
this->insn = insn;
@@ -353,8 +352,7 @@ new_btr_user (basic_block bb, int insn_luid, rtx insn)
usep = NULL;
}
use = usep ? *usep : NULL_RTX;
- user = (btr_user)
- obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
+ user = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
user->bb = bb;
user->luid = insn_luid;
user->insn = insn;
@@ -736,8 +734,7 @@ build_btr_def_use_webs (fibheap_t all_btr_defs)
sbitmap *btr_defset = sbitmap_vector_alloc (
(last_btr - first_btr) + 1, max_uid);
sbitmap *bb_gen = sbitmap_vector_alloc (n_basic_blocks, max_uid);
- HARD_REG_SET *btrs_written = (HARD_REG_SET *) xcalloc (
- n_basic_blocks, sizeof (HARD_REG_SET));
+ HARD_REG_SET *btrs_written = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
sbitmap *bb_kill;
sbitmap *bb_out;
@@ -841,8 +838,7 @@ augment_live_range (bitmap live_range, HARD_REG_SET *btrs_live_in_range,
{
basic_block *worklist, *tos;
- tos = worklist =
- (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
if (dominated_by_p (dom, new_bb, head_bb))
*tos++ = new_bb;
@@ -1318,8 +1314,7 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
first_btr = reg;
}
- btrs_live =
- (HARD_REG_SET *) xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
+ btrs_live = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
build_btr_def_use_webs (all_btr_defs);
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
index 7156fcef994..92fe65e1e0d 100644
--- a/gcc/builtin-attrs.def
+++ b/gcc/builtin-attrs.def
@@ -41,13 +41,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
DEF_ATTR_TREE_LIST (ENUM, PURPOSE, VALUE, CHAIN)
Constructs a TREE_LIST with given PURPOSE, VALUE and CHAIN (given
- as previous ENUM names).
-
- DEF_FN_ATTR (NAME, ATTRS, PREDICATE)
-
- Specifies that the function with name NAME (a previous ENUM for an
- IDENTIFIER_NODE) has attributes ATTRS (a previous ENUM) if
- PREDICATE is true. */
+ as previous ENUM names). */
DEF_ATTR_NULL_TREE (ATTR_NULL)
@@ -110,22 +104,22 @@ DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, \
ATTR_NOTHROW_LIST)
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_3, ATTR_NONNULL, ATTR_LIST_3, \
ATTR_NOTHROW_LIST)
-/* Nothrow functions whose first and second parameters are nonnull pointers. */
+/* Nothrow functions whose first and second parameters are nonnull pointers. */
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_2, ATTR_NONNULL, ATTR_LIST_2, \
ATTR_NOTHROW_NONNULL_1)
-/* Nothrow functions whose first and fourth parameters are nonnull pointers. */
+/* Nothrow functions whose first and fourth parameters are nonnull pointers. */
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_4, ATTR_NONNULL, ATTR_LIST_4, \
ATTR_NOTHROW_NONNULL_1)
-/* Nothrow const functions whose first parameter is a nonnull pointer. */
+/* Nothrow const functions whose first parameter is a nonnull pointer. */
DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_NONNULL_1, ATTR_CONST, ATTR_NULL, \
ATTR_NOTHROW_NONNULL_1)
-/* Nothrow pure functions whose first parameter is a nonnull pointer. */
+/* Nothrow pure functions whose first parameter is a nonnull pointer. */
DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL_1, ATTR_PURE, ATTR_NULL, \
ATTR_NOTHROW_NONNULL_1)
-/* Nothrow pure functions whose first and second parameters are nonnull pointers. */
+/* Nothrow pure functions whose first and second parameters are nonnull pointers. */
DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_PURE, ATTR_NULL, \
ATTR_NOTHROW_NONNULL_1_2)
-/* Nothrow malloc functions whose first parameter is a nonnull pointer. */
+/* Nothrow malloc functions whose first parameter is a nonnull pointer. */
DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_NONNULL_1, ATTR_MALLOC, ATTR_NULL, \
ATTR_NOTHROW_NONNULL_1)
@@ -157,43 +151,3 @@ DEF_FORMAT_ARG_ATTRIBUTE(1)
DEF_FORMAT_ARG_ATTRIBUTE(2)
#undef DEF_FORMAT_ARG_ATTRIBUTE
-/* Define an attribute for a function, along with the IDENTIFIER_NODE. */
-#define DEF_FN_ATTR_IDENT(NAME, ATTRS, PREDICATE) \
- DEF_ATTR_IDENT (ATTR_##NAME, #NAME) \
- DEF_FN_ATTR (ATTR_##NAME, ATTRS, PREDICATE)
-
-/* The ISO C functions are always checked (whether <stdio.h> is
- included or not), since it is common to call printf without
- including <stdio.h>. There shouldn't be a problem with this,
- since ISO C reserves these function names whether you include the
- header file or not. In any case, the checking is harmless. With
- -ffreestanding, these default attributes are disabled, and must be
- specified manually if desired. */
-
-/* Functions from ISO/IEC 9899:1990. */
-#define DEF_C89_ATTR(NAME, ATTRS) DEF_FN_ATTR_IDENT (NAME, ATTRS, flag_hosted)
-DEF_C89_ATTR (fscanf, ATTR_FORMAT_SCANF_2_3)
-DEF_C89_ATTR (vfprintf, ATTR_FORMAT_PRINTF_2_0)
-DEF_C89_ATTR (strftime, ATTR_FORMAT_STRFTIME_3_0)
-#undef DEF_C89_ATTR
-
-/* ISO C99 adds the snprintf and vscanf family functions. */
-#define DEF_C99_ATTR(NAME, ATTRS) \
- DEF_FN_ATTR_IDENT (NAME, ATTRS, \
- (flag_hosted \
- && (flag_isoc99 || flag_noniso_default_format_attributes)))
-DEF_C99_ATTR (vfscanf, ATTR_FORMAT_SCANF_2_0)
-#undef DEF_C99_ATTR
-
-/* Functions not in any version of ISO C. */
-#define DEF_EXT_ATTR(NAME, ATTRS) \
- DEF_FN_ATTR_IDENT (NAME, ATTRS, \
- flag_hosted && flag_noniso_default_format_attributes)
-/* Uniforum/GNU gettext functions. */
-DEF_EXT_ATTR (gettext, ATTR_FORMAT_ARG_1)
-DEF_EXT_ATTR (dgettext, ATTR_FORMAT_ARG_2)
-DEF_EXT_ATTR (dcgettext, ATTR_FORMAT_ARG_2)
-/* X/Open strfmon function. */
-DEF_EXT_ATTR (strfmon, ATTR_FORMAT_STRFMON_3_4)
-#undef DEF_EXT_ATTR
-#undef DEF_FN_ATTR_IDENT
diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def
index d9b98f11174..f33bacd4330 100644
--- a/gcc/builtin-types.def
+++ b/gcc/builtin-types.def
@@ -67,15 +67,20 @@ DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_long_integer_type_node)
DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node)
DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node)
DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node)
-DEF_PRIMITIVE_TYPE (BT_LONG_DOUBLE, long_double_type_node)
+DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE, long_double_type_node)
DEF_PRIMITIVE_TYPE (BT_COMPLEX_FLOAT, complex_float_type_node)
DEF_PRIMITIVE_TYPE (BT_COMPLEX_DOUBLE, complex_double_type_node)
-DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONG_DOUBLE, complex_long_double_type_node)
+DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONGDOUBLE, complex_long_double_type_node)
DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
+DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node)
+DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node)
+DEF_PRIMITIVE_TYPE (BT_DOUBLE_PTR, double_ptr_type_node)
+DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE_PTR, long_double_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node)
+DEF_PRIMITIVE_TYPE (BT_SSIZE, signed_size_type_node)
DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node)
DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node)
@@ -87,33 +92,45 @@ DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR)
DEF_FUNCTION_TYPE_0 (BT_FN_UNSIGNED, BT_UNSIGNED)
DEF_FUNCTION_TYPE_0 (BT_FN_FLOAT, BT_FLOAT)
DEF_FUNCTION_TYPE_0 (BT_FN_DOUBLE, BT_DOUBLE)
-DEF_FUNCTION_TYPE_0 (BT_FN_LONG_DOUBLE, BT_LONG_DOUBLE)
+/* For "long double" we use LONGDOUBLE (not LONG_DOUBLE) to
+ distinguish it from two types in sequence, "long" followed by
+ "double". */
+DEF_FUNCTION_TYPE_0 (BT_FN_LONGDOUBLE, BT_LONGDOUBLE)
DEF_FUNCTION_TYPE_1 (BT_FN_LONG_LONG, BT_LONG, BT_LONG)
DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_LONGLONG, BT_LONGLONG, BT_LONGLONG)
DEF_FUNCTION_TYPE_1 (BT_FN_INTMAX_INTMAX, BT_INTMAX, BT_INTMAX)
DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_FLOAT, BT_FLOAT, BT_FLOAT)
DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_DOUBLE, BT_DOUBLE, BT_DOUBLE)
-DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- BT_LONG_DOUBLE, BT_LONG_DOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_LONGDOUBLE,
+ BT_LONGDOUBLE, BT_LONGDOUBLE)
DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT,
BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT)
DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE)
-DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
- BT_COMPLEX_LONG_DOUBLE, BT_COMPLEX_LONG_DOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE,
+ BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_COMPLEX_FLOAT,
BT_FLOAT, BT_COMPLEX_FLOAT)
DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_COMPLEX_DOUBLE,
BT_DOUBLE, BT_COMPLEX_DOUBLE)
-DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
- BT_LONG_DOUBLE, BT_COMPLEX_LONG_DOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE,
+ BT_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UNSIGNED, BT_PTR, BT_UNSIGNED)
DEF_FUNCTION_TYPE_1 (BT_FN_PTR_SIZE, BT_PTR, BT_SIZE)
DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONG, BT_INT, BT_LONG)
DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONGLONG, BT_INT, BT_LONGLONG)
DEF_FUNCTION_TYPE_1 (BT_FN_INT_PTR, BT_INT, BT_PTR)
+DEF_FUNCTION_TYPE_1 (BT_FN_INT_FLOAT, BT_INT, BT_FLOAT)
+DEF_FUNCTION_TYPE_1 (BT_FN_INT_DOUBLE, BT_INT, BT_DOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONGDOUBLE, BT_INT, BT_LONGDOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONG_FLOAT, BT_LONG, BT_FLOAT)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE, BT_LONG, BT_DOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONG_LONGDOUBLE, BT_LONG, BT_LONGDOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_FLOAT, BT_LONGLONG, BT_FLOAT)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_DOUBLE, BT_LONGLONG, BT_DOUBLE)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_LONGDOUBLE, BT_LONGLONG, BT_LONGDOUBLE)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTR, BT_VOID, BT_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_SIZE_CONST_STRING, BT_SIZE, BT_CONST_STRING)
DEF_FUNCTION_TYPE_1 (BT_FN_INT_CONST_STRING, BT_INT, BT_CONST_STRING)
@@ -122,8 +139,8 @@ DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VALIST_REF, BT_VOID, BT_VALIST_REF)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_CONST_STRING, BT_FLOAT, BT_CONST_STRING)
DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_CONST_STRING, BT_DOUBLE, BT_CONST_STRING)
-DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE_CONST_STRING,
- BT_LONG_DOUBLE, BT_CONST_STRING)
+DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_CONST_STRING,
+ BT_LONGDOUBLE, BT_CONST_STRING)
DEF_FUNCTION_TYPE_1 (BT_FN_STRING_CONST_STRING, BT_STRING, BT_CONST_STRING)
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_INT, BT_VOID, BT_PTR, BT_INT)
@@ -155,12 +172,52 @@ DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_FLOAT,
BT_FLOAT, BT_FLOAT, BT_FLOAT)
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_DOUBLE,
BT_DOUBLE, BT_DOUBLE, BT_DOUBLE)
-DEF_FUNCTION_TYPE_2 (BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
- BT_LONG_DOUBLE, BT_LONG_DOUBLE, BT_LONG_DOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE,
+ BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_FLOATPTR,
+ BT_FLOAT, BT_FLOAT, BT_FLOAT_PTR)
+DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_DOUBLEPTR,
+ BT_DOUBLE, BT_DOUBLE, BT_DOUBLE_PTR)
+DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR,
+ BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE_PTR)
+DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_LONGDOUBLE,
+ BT_FLOAT, BT_FLOAT, BT_LONGDOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_LONGDOUBLE,
+ BT_DOUBLE, BT_DOUBLE, BT_LONGDOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_INT,
+ BT_FLOAT, BT_FLOAT, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_INT,
+ BT_DOUBLE, BT_DOUBLE, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_INT,
+ BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_INTPTR,
+ BT_FLOAT, BT_FLOAT, BT_INT_PTR)
+DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_INTPTR,
+ BT_DOUBLE, BT_DOUBLE, BT_INT_PTR)
+DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR,
+ BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INT_PTR)
+DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_INT_FLOAT,
+ BT_FLOAT, BT_INT, BT_FLOAT)
+DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_INT_DOUBLE,
+ BT_DOUBLE, BT_INT, BT_DOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_INT_LONGDOUBLE,
+ BT_LONGDOUBLE, BT_INT, BT_LONGDOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_LONG,
+ BT_FLOAT, BT_FLOAT, BT_LONG)
+DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_LONG,
+ BT_DOUBLE, BT_DOUBLE, BT_LONG)
+DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONG,
+ BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONG)
DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_VALIST_ARG,
BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
DEF_FUNCTION_TYPE_2 (BT_FN_PTR_SIZE_SIZE,
BT_PTR, BT_SIZE, BT_SIZE)
+DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT,
+ BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT)
+DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
+ BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE,
+ BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
DEF_FUNCTION_TYPE_3 (BT_FN_STRING_STRING_CONST_STRING_SIZE,
BT_STRING, BT_STRING, BT_CONST_STRING, BT_SIZE)
@@ -180,11 +237,35 @@ DEF_FUNCTION_TYPE_3 (BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
BT_INT, BT_STRING, BT_CONST_STRING, BT_VALIST_ARG)
DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_VALIST_ARG)
+DEF_FUNCTION_TYPE_3 (BT_FN_INT_PTR_CONST_STRING_VALIST_ARG,
+ BT_INT, BT_PTR, BT_CONST_STRING, BT_VALIST_ARG)
+DEF_FUNCTION_TYPE_3 (BT_FN_STRING_CONST_STRING_CONST_STRING_INT,
+ BT_STRING, BT_CONST_STRING, BT_CONST_STRING, BT_INT)
+DEF_FUNCTION_TYPE_3 (BT_FN_FLOAT_FLOAT_FLOAT_FLOAT,
+ BT_FLOAT, BT_FLOAT, BT_FLOAT, BT_FLOAT)
+DEF_FUNCTION_TYPE_3 (BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE,
+ BT_DOUBLE, BT_DOUBLE, BT_DOUBLE, BT_DOUBLE)
+DEF_FUNCTION_TYPE_3 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE,
+ BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE)
+DEF_FUNCTION_TYPE_3 (BT_FN_FLOAT_FLOAT_FLOAT_INTPTR,
+ BT_FLOAT, BT_FLOAT, BT_FLOAT, BT_INT_PTR)
+DEF_FUNCTION_TYPE_3 (BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR,
+ BT_DOUBLE, BT_DOUBLE, BT_DOUBLE, BT_INT_PTR)
+DEF_FUNCTION_TYPE_3 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR,
+ BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INT_PTR)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR,
+ BT_VOID, BT_FLOAT, BT_FLOAT_PTR, BT_FLOAT_PTR)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR,
+ BT_VOID, BT_DOUBLE, BT_DOUBLE_PTR, BT_DOUBLE_PTR)
+DEF_FUNCTION_TYPE_3 (BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR,
+ BT_VOID, BT_LONGDOUBLE, BT_LONGDOUBLE_PTR, BT_LONGDOUBLE_PTR)
DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_PTR)
DEF_FUNCTION_TYPE_4 (BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
+DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR,
+ BT_SIZE, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_CONST_PTR)
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID)
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_INT_VAR, BT_INT)
@@ -206,6 +287,8 @@ DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_CONST_STRING_CONST_STRING_VAR,
DEF_FUNCTION_TYPE_VAR_3 (BT_FN_INT_STRING_SIZE_CONST_STRING_VAR,
BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING)
+DEF_FUNCTION_TYPE_VAR_3 (BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR,
+ BT_SSIZE, BT_STRING, BT_SIZE, BT_CONST_STRING)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR)
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 94712150ad1..5de1ac35a5a 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -79,17 +79,13 @@ tree built_in_decls[(int) END_BUILTINS];
required to implement the function call in all cases. */
tree implicit_built_in_decls[(int) END_BUILTINS];
-/* Trigonometric and mathematical constants used in builtin folding. */
-static bool builtin_dconsts_init = 0;
-static REAL_VALUE_TYPE dconstpi;
-static REAL_VALUE_TYPE dconste;
-
static int get_pointer_alignment (tree, unsigned int);
static tree c_strlen (tree, int);
static const char *c_getstr (tree);
static rtx c_readstr (const char *, enum machine_mode);
static int target_char_cast (tree, char *);
static rtx get_memory_rtx (tree);
+static tree build_string_literal (int, const char *);
static int apply_args_size (void);
static int apply_result_size (void);
#if defined (HAVE_untyped_call) || defined (HAVE_untyped_return)
@@ -140,7 +136,9 @@ static rtx expand_builtin_strrchr (tree, rtx, enum machine_mode);
static rtx expand_builtin_alloca (tree, rtx);
static rtx expand_builtin_unop (enum machine_mode, tree, rtx, rtx, optab);
static rtx expand_builtin_frame_address (tree, tree);
-static rtx expand_builtin_fputs (tree, int, int);
+static rtx expand_builtin_fputs (tree, rtx, bool);
+static rtx expand_builtin_printf (tree, rtx, enum machine_mode, bool);
+static rtx expand_builtin_fprintf (tree, rtx, enum machine_mode, bool);
static rtx expand_builtin_sprintf (tree, rtx, enum machine_mode);
static tree stabilize_va_list (tree, int);
static rtx expand_builtin_expect (tree, rtx);
@@ -154,25 +152,11 @@ static tree fold_trunc_transparent_mathfn (tree);
static bool readonly_data_expr (tree);
static rtx expand_builtin_fabs (tree, rtx, rtx);
static rtx expand_builtin_cabs (tree, rtx);
-static void init_builtin_dconsts (void);
static tree fold_builtin_cabs (tree, tree, tree);
static tree fold_builtin_trunc (tree);
static tree fold_builtin_floor (tree);
static tree fold_builtin_ceil (tree);
-
-/* Initialize mathematical constants for constant folding builtins.
- These constants need to be given to at least 160 bits precision. */
-
-static void
-init_builtin_dconsts (void)
-{
- real_from_string (&dconstpi,
- "3.1415926535897932384626433832795028841971693993751058209749445923078");
- real_from_string (&dconste,
- "2.7182818284590452353602874713526624977572470936999595749669676277241");
-
- builtin_dconsts_init = true;
-}
+static tree fold_builtin_bitop (tree);
/* Return the alignment in bits of EXP, a pointer valued expression.
But don't return more than MAX_ALIGN no matter what.
@@ -493,10 +477,7 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label)
if (setjmp_alias_set == -1)
setjmp_alias_set = new_alias_set ();
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (buf_addr) != Pmode)
- buf_addr = convert_memory_address (Pmode, buf_addr);
-#endif
+ buf_addr = convert_memory_address (Pmode, buf_addr);
buf_addr = force_reg (Pmode, force_operand (buf_addr, NULL_RTX));
@@ -635,10 +616,11 @@ expand_builtin_setjmp (tree arglist, rtx target)
expand_builtin_setjmp_setup (buf_addr, next_lab);
- /* Set TARGET to zero and branch to the continue label. */
+ /* Set TARGET to zero and branch to the continue label. Use emit_jump to
+ ensure that pending stack adjustments are flushed. */
emit_move_insn (target, const0_rtx);
- emit_jump_insn (gen_jump (cont_lab));
- emit_barrier ();
+ emit_jump (cont_lab);
+
emit_label (next_lab);
expand_builtin_setjmp_receiver (next_lab);
@@ -676,10 +658,7 @@ expand_builtin_longjmp (rtx buf_addr, rtx value)
if (setjmp_alias_set == -1)
setjmp_alias_set = new_alias_set ();
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (buf_addr) != Pmode)
- buf_addr = convert_memory_address (Pmode, buf_addr);
-#endif
+ buf_addr = convert_memory_address (Pmode, buf_addr);
buf_addr = force_reg (Pmode, buf_addr);
@@ -820,12 +799,9 @@ expand_builtin_prefetch (tree arglist)
if ((! (*insn_data[(int) CODE_FOR_prefetch].operand[0].predicate)
(op0,
insn_data[(int) CODE_FOR_prefetch].operand[0].mode))
- || (GET_MODE(op0) != Pmode))
+ || (GET_MODE (op0) != Pmode))
{
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE(op0) != Pmode)
- op0 = convert_memory_address (Pmode, op0);
-#endif
+ op0 = convert_memory_address (Pmode, op0);
op0 = force_reg (Pmode, op0);
}
emit_insn (gen_prefetch (op0, op1, op2));
@@ -848,10 +824,7 @@ get_memory_rtx (tree exp)
rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_SUM);
rtx mem;
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (addr) != Pmode)
- addr = convert_memory_address (Pmode, addr);
-#endif
+ addr = convert_memory_address (Pmode, addr);
mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr));
@@ -936,7 +909,7 @@ apply_args_size (void)
/* The second value is the structure value address unless this is
passed as an "invisible" first argument. */
- if (struct_value_rtx)
+ if (targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 0))
size += GET_MODE_SIZE (Pmode);
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
@@ -1082,7 +1055,7 @@ result_vector (int savep, rtx result)
int regno, size, align, nelts;
enum machine_mode mode;
rtx reg, mem;
- rtx *savevec = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
+ rtx *savevec = alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
size = nelts = 0;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
@@ -1111,6 +1084,7 @@ expand_builtin_apply_args_1 (void)
rtx registers;
int size, align, regno;
enum machine_mode mode;
+ rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1);
/* Create a block where the arg-pointer, structure value address,
and argument registers can be saved. */
@@ -1118,7 +1092,7 @@ expand_builtin_apply_args_1 (void)
/* Walk past the arg-pointer and structure value address. */
size = GET_MODE_SIZE (Pmode);
- if (struct_value_rtx)
+ if (targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 0))
size += GET_MODE_SIZE (Pmode);
/* Save each register used in calling a function to the block. */
@@ -1144,10 +1118,10 @@ expand_builtin_apply_args_1 (void)
/* Save the structure value address unless this is passed as an
"invisible" first argument. */
- if (struct_value_incoming_rtx)
+ if (struct_incoming_value)
{
emit_move_insn (adjust_address (registers, Pmode, size),
- copy_to_reg (struct_value_incoming_rtx));
+ copy_to_reg (struct_incoming_value));
size += GET_MODE_SIZE (Pmode);
}
@@ -1205,11 +1179,9 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
rtx incoming_args, result, reg, dest, src, call_insn;
rtx old_stack_level = 0;
rtx call_fusage = 0;
+ rtx struct_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 0);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (arguments) != Pmode)
- arguments = convert_memory_address (Pmode, arguments);
-#endif
+ arguments = convert_memory_address (Pmode, arguments);
/* Create a block where the return registers can be saved. */
result = assign_stack_local (BLKmode, apply_result_size (), -1);
@@ -1258,7 +1230,7 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
/* Walk past the arg-pointer and structure value address. */
size = GET_MODE_SIZE (Pmode);
- if (struct_value_rtx)
+ if (struct_value)
size += GET_MODE_SIZE (Pmode);
/* Restore each of the registers previously saved. Make USE insns
@@ -1278,13 +1250,13 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
/* Restore the structure value address unless this is passed as an
"invisible" first argument. */
size = GET_MODE_SIZE (Pmode);
- if (struct_value_rtx)
+ if (struct_value)
{
rtx value = gen_reg_rtx (Pmode);
emit_move_insn (value, adjust_address (arguments, Pmode, size));
- emit_move_insn (struct_value_rtx, value);
- if (GET_CODE (struct_value_rtx) == REG)
- use_reg (&call_fusage, struct_value_rtx);
+ emit_move_insn (struct_value, value);
+ if (GET_CODE (struct_value) == REG)
+ use_reg (&call_fusage, struct_value);
size += GET_MODE_SIZE (Pmode);
}
@@ -1347,7 +1319,8 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
OK_DEFER_POP;
/* Return the address of the result block. */
- return copy_addr_to_reg (XEXP (result, 0));
+ result = copy_addr_to_reg (XEXP (result, 0));
+ return convert_memory_address (ptr_mode, result);
}
/* Perform an untyped return. */
@@ -1360,10 +1333,7 @@ expand_builtin_return (rtx result)
rtx reg;
rtx call_fusage = 0;
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (result) != Pmode)
- result = convert_memory_address (Pmode, result);
-#endif
+ result = convert_memory_address (Pmode, result);
apply_result_size ();
result = gen_rtx_MEM (BLKmode, result);
@@ -1458,7 +1428,11 @@ expand_builtin_constant_p (tree arglist, enum machine_mode target_mode)
/* We have taken care of the easy cases during constant folding. This
case is not obvious, so emit (constant_p_rtx (ARGLIST)) and let CSE
- get a chance to see if it can deduce whether ARGLIST is constant. */
+ get a chance to see if it can deduce whether ARGLIST is constant.
+ If CSE isn't going to run, of course, don't bother waiting. */
+
+ if (cse_not_expected)
+ return const0_rtx;
current_function_calls_constant_p = 1;
@@ -1467,211 +1441,111 @@ expand_builtin_constant_p (tree arglist, enum machine_mode target_mode)
return tmp;
}
-/* Return mathematic function equivalent to FN but operating directly on TYPE,
- if available. */
+/* This helper macro, meant to be used in mathfn_built_in below,
+ determines which among a set of three builtin math functions is
+ appropriate for a given type mode. The `F' and `L' cases are
+ automatically generated from the `double' case. */
+#define CASE_MATHFN(BUILT_IN_MATHFN) \
+ case BUILT_IN_MATHFN: case BUILT_IN_MATHFN##F: case BUILT_IN_MATHFN##L: \
+ fcode = BUILT_IN_MATHFN; fcodef = BUILT_IN_MATHFN##F ; \
+ fcodel = BUILT_IN_MATHFN##L ; break;
+
+/* Return mathematic function equivalent to FN but operating directly
+ on TYPE, if available. If we can't do the conversion, return zero. */
tree
mathfn_built_in (tree type, enum built_in_function fn)
{
- enum built_in_function fcode = NOT_BUILT_IN;
- if (TYPE_MODE (type) == TYPE_MODE (double_type_node))
- switch (fn)
- {
- case BUILT_IN_SQRT:
- case BUILT_IN_SQRTF:
- case BUILT_IN_SQRTL:
- fcode = BUILT_IN_SQRT;
- break;
- case BUILT_IN_SIN:
- case BUILT_IN_SINF:
- case BUILT_IN_SINL:
- fcode = BUILT_IN_SIN;
- break;
- case BUILT_IN_COS:
- case BUILT_IN_COSF:
- case BUILT_IN_COSL:
- fcode = BUILT_IN_COS;
- break;
- case BUILT_IN_EXP:
- case BUILT_IN_EXPF:
- case BUILT_IN_EXPL:
- fcode = BUILT_IN_EXP;
- break;
- case BUILT_IN_LOG:
- case BUILT_IN_LOGF:
- case BUILT_IN_LOGL:
- fcode = BUILT_IN_LOG;
- break;
- case BUILT_IN_TAN:
- case BUILT_IN_TANF:
- case BUILT_IN_TANL:
- fcode = BUILT_IN_TAN;
- break;
- case BUILT_IN_ATAN:
- case BUILT_IN_ATANF:
- case BUILT_IN_ATANL:
- fcode = BUILT_IN_ATAN;
- break;
- case BUILT_IN_FLOOR:
- case BUILT_IN_FLOORF:
- case BUILT_IN_FLOORL:
- fcode = BUILT_IN_FLOOR;
- break;
- case BUILT_IN_CEIL:
- case BUILT_IN_CEILF:
- case BUILT_IN_CEILL:
- fcode = BUILT_IN_CEIL;
- break;
- case BUILT_IN_TRUNC:
- case BUILT_IN_TRUNCF:
- case BUILT_IN_TRUNCL:
- fcode = BUILT_IN_TRUNC;
- break;
- case BUILT_IN_ROUND:
- case BUILT_IN_ROUNDF:
- case BUILT_IN_ROUNDL:
- fcode = BUILT_IN_ROUND;
- break;
- case BUILT_IN_NEARBYINT:
- case BUILT_IN_NEARBYINTF:
- case BUILT_IN_NEARBYINTL:
- fcode = BUILT_IN_NEARBYINT;
- break;
- default:
- abort ();
- }
- else if (TYPE_MODE (type) == TYPE_MODE (float_type_node))
- switch (fn)
- {
- case BUILT_IN_SQRT:
- case BUILT_IN_SQRTF:
- case BUILT_IN_SQRTL:
- fcode = BUILT_IN_SQRTF;
- break;
- case BUILT_IN_SIN:
- case BUILT_IN_SINF:
- case BUILT_IN_SINL:
- fcode = BUILT_IN_SINF;
- break;
- case BUILT_IN_COS:
- case BUILT_IN_COSF:
- case BUILT_IN_COSL:
- fcode = BUILT_IN_COSF;
- break;
- case BUILT_IN_EXP:
- case BUILT_IN_EXPF:
- case BUILT_IN_EXPL:
- fcode = BUILT_IN_EXPF;
- break;
- case BUILT_IN_LOG:
- case BUILT_IN_LOGF:
- case BUILT_IN_LOGL:
- fcode = BUILT_IN_LOGF;
- break;
- case BUILT_IN_TAN:
- case BUILT_IN_TANF:
- case BUILT_IN_TANL:
- fcode = BUILT_IN_TANF;
- break;
- case BUILT_IN_ATAN:
- case BUILT_IN_ATANF:
- case BUILT_IN_ATANL:
- fcode = BUILT_IN_ATANF;
- break;
- case BUILT_IN_FLOOR:
- case BUILT_IN_FLOORF:
- case BUILT_IN_FLOORL:
- fcode = BUILT_IN_FLOORF;
- break;
- case BUILT_IN_CEIL:
- case BUILT_IN_CEILF:
- case BUILT_IN_CEILL:
- fcode = BUILT_IN_CEILF;
- break;
- case BUILT_IN_TRUNC:
- case BUILT_IN_TRUNCF:
- case BUILT_IN_TRUNCL:
- fcode = BUILT_IN_TRUNCF;
- break;
- case BUILT_IN_ROUND:
- case BUILT_IN_ROUNDF:
- case BUILT_IN_ROUNDL:
- fcode = BUILT_IN_ROUNDF;
- break;
- case BUILT_IN_NEARBYINT:
- case BUILT_IN_NEARBYINTF:
- case BUILT_IN_NEARBYINTL:
- fcode = BUILT_IN_NEARBYINTF;
- break;
- default:
- abort ();
- }
- else if (TYPE_MODE (type) == TYPE_MODE (long_double_type_node))
- switch (fn)
- {
- case BUILT_IN_SQRT:
- case BUILT_IN_SQRTF:
- case BUILT_IN_SQRTL:
- fcode = BUILT_IN_SQRTL;
- break;
- case BUILT_IN_SIN:
- case BUILT_IN_SINF:
- case BUILT_IN_SINL:
- fcode = BUILT_IN_SINL;
- break;
- case BUILT_IN_COS:
- case BUILT_IN_COSF:
- case BUILT_IN_COSL:
- fcode = BUILT_IN_COSL;
- break;
- case BUILT_IN_EXP:
- case BUILT_IN_EXPF:
- case BUILT_IN_EXPL:
- fcode = BUILT_IN_EXPL;
- break;
- case BUILT_IN_LOG:
- case BUILT_IN_LOGF:
- case BUILT_IN_LOGL:
- fcode = BUILT_IN_LOGL;
- break;
- case BUILT_IN_TAN:
- case BUILT_IN_TANF:
- case BUILT_IN_TANL:
- fcode = BUILT_IN_TANL;
- break;
- case BUILT_IN_ATAN:
- case BUILT_IN_ATANF:
- case BUILT_IN_ATANL:
- fcode = BUILT_IN_ATANL;
- break;
- case BUILT_IN_FLOOR:
- case BUILT_IN_FLOORF:
- case BUILT_IN_FLOORL:
- fcode = BUILT_IN_FLOORL;
- break;
- case BUILT_IN_CEIL:
- case BUILT_IN_CEILF:
- case BUILT_IN_CEILL:
- fcode = BUILT_IN_CEILL;
- break;
- case BUILT_IN_TRUNC:
- case BUILT_IN_TRUNCF:
- case BUILT_IN_TRUNCL:
- fcode = BUILT_IN_TRUNCL;
- break;
- case BUILT_IN_ROUND:
- case BUILT_IN_ROUNDF:
- case BUILT_IN_ROUNDL:
- fcode = BUILT_IN_ROUNDL;
- break;
- case BUILT_IN_NEARBYINT:
- case BUILT_IN_NEARBYINTF:
- case BUILT_IN_NEARBYINTL:
- fcode = BUILT_IN_NEARBYINTL;
- break;
+ const enum machine_mode type_mode = TYPE_MODE (type);
+ enum built_in_function fcode, fcodef, fcodel;
+
+ switch (fn)
+ {
+ CASE_MATHFN (BUILT_IN_ACOS)
+ CASE_MATHFN (BUILT_IN_ACOSH)
+ CASE_MATHFN (BUILT_IN_ASIN)
+ CASE_MATHFN (BUILT_IN_ASINH)
+ CASE_MATHFN (BUILT_IN_ATAN)
+ CASE_MATHFN (BUILT_IN_ATAN2)
+ CASE_MATHFN (BUILT_IN_ATANH)
+ CASE_MATHFN (BUILT_IN_CBRT)
+ CASE_MATHFN (BUILT_IN_CEIL)
+ CASE_MATHFN (BUILT_IN_COPYSIGN)
+ CASE_MATHFN (BUILT_IN_COS)
+ CASE_MATHFN (BUILT_IN_COSH)
+ CASE_MATHFN (BUILT_IN_DREM)
+ CASE_MATHFN (BUILT_IN_ERF)
+ CASE_MATHFN (BUILT_IN_ERFC)
+ CASE_MATHFN (BUILT_IN_EXP)
+ CASE_MATHFN (BUILT_IN_EXP10)
+ CASE_MATHFN (BUILT_IN_EXP2)
+ CASE_MATHFN (BUILT_IN_EXPM1)
+ CASE_MATHFN (BUILT_IN_FABS)
+ CASE_MATHFN (BUILT_IN_FDIM)
+ CASE_MATHFN (BUILT_IN_FLOOR)
+ CASE_MATHFN (BUILT_IN_FMA)
+ CASE_MATHFN (BUILT_IN_FMAX)
+ CASE_MATHFN (BUILT_IN_FMIN)
+ CASE_MATHFN (BUILT_IN_FMOD)
+ CASE_MATHFN (BUILT_IN_FREXP)
+ CASE_MATHFN (BUILT_IN_GAMMA)
+ CASE_MATHFN (BUILT_IN_HUGE_VAL)
+ CASE_MATHFN (BUILT_IN_HYPOT)
+ CASE_MATHFN (BUILT_IN_ILOGB)
+ CASE_MATHFN (BUILT_IN_INF)
+ CASE_MATHFN (BUILT_IN_J0)
+ CASE_MATHFN (BUILT_IN_J1)
+ CASE_MATHFN (BUILT_IN_JN)
+ CASE_MATHFN (BUILT_IN_LDEXP)
+ CASE_MATHFN (BUILT_IN_LGAMMA)
+ CASE_MATHFN (BUILT_IN_LLRINT)
+ CASE_MATHFN (BUILT_IN_LLROUND)
+ CASE_MATHFN (BUILT_IN_LOG)
+ CASE_MATHFN (BUILT_IN_LOG10)
+ CASE_MATHFN (BUILT_IN_LOG1P)
+ CASE_MATHFN (BUILT_IN_LOG2)
+ CASE_MATHFN (BUILT_IN_LOGB)
+ CASE_MATHFN (BUILT_IN_LRINT)
+ CASE_MATHFN (BUILT_IN_LROUND)
+ CASE_MATHFN (BUILT_IN_MODF)
+ CASE_MATHFN (BUILT_IN_NAN)
+ CASE_MATHFN (BUILT_IN_NANS)
+ CASE_MATHFN (BUILT_IN_NEARBYINT)
+ CASE_MATHFN (BUILT_IN_NEXTAFTER)
+ CASE_MATHFN (BUILT_IN_NEXTTOWARD)
+ CASE_MATHFN (BUILT_IN_POW)
+ CASE_MATHFN (BUILT_IN_POW10)
+ CASE_MATHFN (BUILT_IN_REMAINDER)
+ CASE_MATHFN (BUILT_IN_REMQUO)
+ CASE_MATHFN (BUILT_IN_RINT)
+ CASE_MATHFN (BUILT_IN_ROUND)
+ CASE_MATHFN (BUILT_IN_SCALB)
+ CASE_MATHFN (BUILT_IN_SCALBLN)
+ CASE_MATHFN (BUILT_IN_SCALBN)
+ CASE_MATHFN (BUILT_IN_SIGNIFICAND)
+ CASE_MATHFN (BUILT_IN_SIN)
+ CASE_MATHFN (BUILT_IN_SINCOS)
+ CASE_MATHFN (BUILT_IN_SINH)
+ CASE_MATHFN (BUILT_IN_SQRT)
+ CASE_MATHFN (BUILT_IN_TAN)
+ CASE_MATHFN (BUILT_IN_TANH)
+ CASE_MATHFN (BUILT_IN_TGAMMA)
+ CASE_MATHFN (BUILT_IN_TRUNC)
+ CASE_MATHFN (BUILT_IN_Y0)
+ CASE_MATHFN (BUILT_IN_Y1)
+ CASE_MATHFN (BUILT_IN_YN)
+
default:
- abort ();
+ return 0;
}
- return implicit_built_in_decls[fcode];
+
+ if (type_mode == TYPE_MODE (double_type_node))
+ return implicit_built_in_decls[fcode];
+ else if (type_mode == TYPE_MODE (float_type_node))
+ return implicit_built_in_decls[fcodef];
+ else if (type_mode == TYPE_MODE (long_double_type_node))
+ return implicit_built_in_decls[fcodel];
+ else
+ return 0;
}
/* If errno must be maintained, expand the RTL to check if the result,
@@ -1723,8 +1597,8 @@ static rtx
expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
{
optab builtin_optab;
- rtx op0, insns;
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ rtx op0, insns, before_call;
+ tree fndecl = get_callee_fndecl (exp);
tree arglist = TREE_OPERAND (exp, 1);
enum machine_mode mode;
bool errno_set = false;
@@ -1794,49 +1668,93 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
/* Make a suitable register to place result in. */
mode = TYPE_MODE (TREE_TYPE (exp));
- /* Before working hard, check whether the instruction is available. */
- if (builtin_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing)
- return 0;
- target = gen_reg_rtx (mode);
-
if (! flag_errno_math || ! HONOR_NANS (mode))
errno_set = false;
- /* Wrap the computation of the argument in a SAVE_EXPR, as we may
- need to expand the argument again. This way, we will not perform
- side-effects more the once. */
- narg = save_expr (arg);
- if (narg != arg)
+ /* Before working hard, check whether the instruction is available. */
+ if (builtin_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
{
- arglist = build_tree_list (NULL_TREE, arg);
- exp = build_function_call_expr (fndecl, arglist);
- }
+ target = gen_reg_rtx (mode);
- op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ /* Wrap the computation of the argument in a SAVE_EXPR, as we may
+ need to expand the argument again. This way, we will not perform
+ side-effects more the once. */
+ narg = save_expr (arg);
+ if (narg != arg)
+ {
+ arglist = build_tree_list (NULL_TREE, arg);
+ exp = build_function_call_expr (fndecl, arglist);
+ }
- emit_queue ();
- start_sequence ();
+ op0 = expand_expr (arg, subtarget, VOIDmode, 0);
- /* Compute into TARGET.
- Set TARGET to wherever the result comes back. */
- target = expand_unop (mode, builtin_optab, op0, target, 0);
+ emit_queue ();
+ start_sequence ();
- /* If we were unable to expand via the builtin, stop the sequence
- (without outputting the insns) and call to the library function
- with the stabilized argument list. */
- if (target == 0)
- {
+ /* Compute into TARGET.
+ Set TARGET to wherever the result comes back. */
+ target = expand_unop (mode, builtin_optab, op0, target, 0);
+
+ if (target != 0)
+ {
+ if (errno_set)
+ expand_errno_check (exp, target);
+
+ /* Output the entire sequence. */
+ insns = get_insns ();
+ end_sequence ();
+ emit_insn (insns);
+ return target;
+ }
+
+ /* If we were unable to expand via the builtin, stop the sequence
+ (without outputting the insns) and call to the library function
+ with the stabilized argument list. */
end_sequence ();
- return expand_call (exp, target, target == const0_rtx);
}
- if (errno_set)
- expand_errno_check (exp, target);
+ before_call = get_last_insn ();
- /* Output the entire sequence. */
- insns = get_insns ();
- end_sequence ();
- emit_insn (insns);
+ target = expand_call (exp, target, target == const0_rtx);
+
+ /* If this is a sqrt operation and we don't care about errno, try to
+ attach a REG_EQUAL note with a SQRT rtx to the emitted libcall.
+ This allows the semantics of the libcall to be visible to the RTL
+ optimizers. */
+ if (builtin_optab == sqrt_optab && !errno_set)
+ {
+ /* Search backwards through the insns emitted by expand_call looking
+ for the instruction with the REG_RETVAL note. */
+ rtx last = get_last_insn ();
+ while (last != before_call)
+ {
+ if (find_reg_note (last, REG_RETVAL, NULL))
+ {
+ rtx note = find_reg_note (last, REG_EQUAL, NULL);
+ /* Check that the REQ_EQUAL note is an EXPR_LIST with
+ two elements, i.e. symbol_ref(sqrt) and the operand. */
+ if (note
+ && GET_CODE (note) == EXPR_LIST
+ && GET_CODE (XEXP (note, 0)) == EXPR_LIST
+ && XEXP (XEXP (note, 0), 1) != NULL_RTX
+ && XEXP (XEXP (XEXP (note, 0), 1), 1) == NULL_RTX)
+ {
+ rtx operand = XEXP (XEXP (XEXP (note, 0), 1), 0);
+ /* Check operand is a register with expected mode. */
+ if (operand
+ && GET_CODE (operand) == REG
+ && GET_MODE (operand) == mode)
+ {
+ /* Replace the REG_EQUAL note with a SQRT rtx. */
+ rtx equiv = gen_rtx_SQRT (mode, operand);
+ set_unique_reg_note (last, REG_EQUAL, equiv);
+ }
+ }
+ break;
+ }
+ last = PREV_INSN (last);
+ }
+ }
return target;
}
@@ -1853,7 +1771,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
{
optab builtin_optab;
rtx op0, op1, insns;
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ tree fndecl = get_callee_fndecl (exp);
tree arglist = TREE_OPERAND (exp, 1);
tree arg0, arg1, temp, narg;
enum machine_mode mode;
@@ -2137,7 +2055,7 @@ expand_powi (rtx x, enum machine_mode mode, HOST_WIDE_INT n)
val = (n < 0) ? -n : n;
- memset (cache, 0, sizeof(cache));
+ memset (cache, 0, sizeof (cache));
cache[1] = x;
result = expand_powi_1 (mode, (n < 0) ? -n : n, cache);
@@ -2167,10 +2085,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
arg0 = TREE_VALUE (arglist);
arg1 = TREE_VALUE (TREE_CHAIN (arglist));
- if (flag_unsafe_math_optimizations
- && ! flag_errno_math
- && ! optimize_size
- && TREE_CODE (arg1) == REAL_CST
+ if (TREE_CODE (arg1) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (arg1))
{
REAL_VALUE_TYPE cint;
@@ -2180,13 +2095,21 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
c = TREE_REAL_CST (arg1);
n = real_to_integer (&c);
real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0);
- if (real_identical (&c, &cint)
- && powi_cost (n) <= POWI_MAX_MULTS)
+ if (real_identical (&c, &cint))
{
- enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
- rtx op = expand_expr (arg0, subtarget, VOIDmode, 0);
- op = force_reg (mode, op);
- return expand_powi (op, mode, n);
+ /* If the exponent is -1, 0, 1 or 2, then expand_powi is exact.
+ Otherwise, check the number of multiplications required.
+ Note that pow never sets errno for an integer exponent. */
+ if ((n >= -1 && n <= 2)
+ || (flag_unsafe_math_optimizations
+ && ! optimize_size
+ && powi_cost (n) <= POWI_MAX_MULTS))
+ {
+ enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
+ rtx op = expand_expr (arg0, subtarget, VOIDmode, 0);
+ op = force_reg (mode, op);
+ return expand_powi (op, mode, n);
+ }
}
}
return expand_builtin_mathfn_2 (exp, target, NULL_RTX);
@@ -2581,10 +2504,7 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode)
builtin_memcpy_read_str,
(void *) src_str, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_mem) != ptr_mode)
- dest_mem = convert_memory_address (ptr_mode, dest_mem);
-#endif
+ dest_mem = convert_memory_address (ptr_mode, dest_mem);
return dest_mem;
}
@@ -2598,10 +2518,7 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode)
if (dest_addr == 0)
{
dest_addr = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_addr) != ptr_mode)
- dest_addr = convert_memory_address (ptr_mode, dest_addr);
-#endif
+ dest_addr = convert_memory_address (ptr_mode, dest_addr);
}
return dest_addr;
}
@@ -2680,10 +2597,7 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode,
builtin_memcpy_read_str,
(void *) src_str, dest_align, endp);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_mem) != ptr_mode)
- dest_mem = convert_memory_address (ptr_mode, dest_mem);
-#endif
+ dest_mem = convert_memory_address (ptr_mode, dest_mem);
return dest_mem;
}
@@ -2698,10 +2612,7 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode,
dest_mem = move_by_pieces (dest_mem, src_mem, INTVAL (len_rtx),
MIN (dest_align, src_align), endp);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_mem) != ptr_mode)
- dest_mem = convert_memory_address (ptr_mode, dest_mem);
-#endif
+ dest_mem = convert_memory_address (ptr_mode, dest_mem);
return dest_mem;
}
@@ -2937,10 +2848,7 @@ expand_builtin_strncpy (tree arglist, rtx target, enum machine_mode mode)
builtin_strncpy_read_str,
(void *) p, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_mem) != ptr_mode)
- dest_mem = convert_memory_address (ptr_mode, dest_mem);
-#endif
+ dest_mem = convert_memory_address (ptr_mode, dest_mem);
return dest_mem;
}
@@ -3058,10 +2966,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode)
builtin_memset_gen_str,
val_rtx, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_mem) != ptr_mode)
- dest_mem = convert_memory_address (ptr_mode, dest_mem);
-#endif
+ dest_mem = convert_memory_address (ptr_mode, dest_mem);
return dest_mem;
}
@@ -3082,10 +2987,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode)
builtin_memset_read_str,
&c, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_mem) != ptr_mode)
- dest_mem = convert_memory_address (ptr_mode, dest_mem);
-#endif
+ dest_mem = convert_memory_address (ptr_mode, dest_mem);
return dest_mem;
}
@@ -3098,10 +3000,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode)
if (dest_addr == 0)
{
dest_addr = force_operand (XEXP (dest_mem, 0), NULL_RTX);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dest_addr) != ptr_mode)
- dest_addr = convert_memory_address (ptr_mode, dest_addr);
-#endif
+ dest_addr = convert_memory_address (ptr_mode, dest_addr);
}
return dest_addr;
@@ -3196,7 +3095,7 @@ expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target,
return expand_expr (result, target, mode, EXPAND_NORMAL);
}
-#ifdef HAVE_cmpstrsi
+#if defined HAVE_cmpmemsi || defined HAVE_cmpstrsi
{
rtx arg1_rtx, arg2_rtx, arg3_rtx;
rtx result;
@@ -3206,8 +3105,19 @@ expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target,
= get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
int arg2_align
= get_pointer_alignment (arg2, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
- enum machine_mode insn_mode
- = insn_data[(int) CODE_FOR_cmpstrsi].operand[0].mode;
+ enum machine_mode insn_mode;
+
+#ifdef HAVE_cmpmemsi
+ if (HAVE_cmpmemsi)
+ insn_mode = insn_data[(int) CODE_FOR_cmpmemsi].operand[0].mode;
+ else
+#endif
+#ifdef HAVE_cmpstrsi
+ if (HAVE_cmpstrsi)
+ insn_mode = insn_data[(int) CODE_FOR_cmpstrsi].operand[0].mode;
+ else
+#endif
+ return 0;
/* If we don't have POINTER_TYPE, call the function. */
if (arg1_align == 0 || arg2_align == 0)
@@ -3223,11 +3133,19 @@ expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target,
arg1_rtx = get_memory_rtx (arg1);
arg2_rtx = get_memory_rtx (arg2);
arg3_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0);
- if (!HAVE_cmpstrsi)
- insn = NULL_RTX;
+#ifdef HAVE_cmpmemsi
+ if (HAVE_cmpmemsi)
+ insn = gen_cmpmemsi (result, arg1_rtx, arg2_rtx, arg3_rtx,
+ GEN_INT (MIN (arg1_align, arg2_align)));
else
+#endif
+#ifdef HAVE_cmpstrsi
+ if (HAVE_cmpstrsi)
insn = gen_cmpstrsi (result, arg1_rtx, arg2_rtx, arg3_rtx,
GEN_INT (MIN (arg1_align, arg2_align)));
+ else
+#endif
+ abort ();
if (insn)
emit_insn (insn);
@@ -3550,9 +3468,52 @@ expand_builtin_strcat (tree arglist, rtx target, enum machine_mode mode)
src = TREE_VALUE (TREE_CHAIN (arglist));
const char *p = c_getstr (src);
- /* If the string length is zero, return the dst parameter. */
- if (p && *p == '\0')
- return expand_expr (dst, target, mode, EXPAND_NORMAL);
+ if (p)
+ {
+ /* If the string length is zero, return the dst parameter. */
+ if (*p == '\0')
+ return expand_expr (dst, target, mode, EXPAND_NORMAL);
+ else if (!optimize_size)
+ {
+ /* Otherwise if !optimize_size, see if we can store by
+ pieces into (dst + strlen(dst)). */
+ tree newdst, arglist,
+ strlen_fn = implicit_built_in_decls[BUILT_IN_STRLEN];
+
+ /* This is the length argument. */
+ arglist = build_tree_list (NULL_TREE,
+ fold (size_binop (PLUS_EXPR,
+ c_strlen (src, 0),
+ ssize_int (1))));
+ /* Prepend src argument. */
+ arglist = tree_cons (NULL_TREE, src, arglist);
+
+ /* We're going to use dst more than once. */
+ dst = save_expr (dst);
+
+ /* Create strlen (dst). */
+ newdst =
+ fold (build_function_call_expr (strlen_fn,
+ build_tree_list (NULL_TREE,
+ dst)));
+ /* Create (dst + strlen (dst)). */
+ newdst = fold (build (PLUS_EXPR, TREE_TYPE (dst), dst, newdst));
+
+ /* Prepend the new dst argument. */
+ arglist = tree_cons (NULL_TREE, newdst, arglist);
+
+ /* We don't want to get turned into a memcpy if the
+ target is const0_rtx, i.e. when the return value
+ isn't used. That would produce pessimized code so
+ pass in a target of zero, it should never actually be
+ used. If this was successful return the original
+ dst, not the result of mempcpy. */
+ if (expand_builtin_mempcpy (arglist, /*target=*/0, mode, /*endp=*/0))
+ return expand_expr (dst, target, mode, EXPAND_NORMAL);
+ else
+ return 0;
+ }
+ }
return 0;
}
@@ -3708,21 +3669,8 @@ expand_builtin_saveregs (void)
start_sequence ();
-#ifdef EXPAND_BUILTIN_SAVEREGS
/* Do whatever the machine needs done in this case. */
- val = EXPAND_BUILTIN_SAVEREGS ();
-#else
- /* ??? 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
- harder with __builtin_va_start, since we don't have a tree for a
- call to __builtin_saveregs to fall back on. There was exactly one
- port (i860) that used this code, and I'm unconvinced it could actually
- handle the general case. So we no longer try to handle anything
- weird and make the backend absorb the evil. */
-
- error ("__builtin_saveregs not supported by this target");
- val = const0_rtx;
-#endif
+ val = targetm.calls.expand_builtin_saveregs ();
seq = get_insns ();
end_sequence ();
@@ -4050,10 +3998,7 @@ expand_builtin_va_arg (tree valist, tree type)
#endif
}
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (addr) != Pmode)
- addr = convert_memory_address (Pmode, addr);
-#endif
+ addr = convert_memory_address (Pmode, addr);
result = gen_rtx_MEM (TYPE_MODE (type), addr);
set_mem_alias_set (result, get_varargs_alias_set ());
@@ -4112,13 +4057,8 @@ expand_builtin_va_copy (tree arglist)
size = expand_expr (TYPE_SIZE_UNIT (va_list_type_node), NULL_RTX,
VOIDmode, EXPAND_NORMAL);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (dstb) != Pmode)
- dstb = convert_memory_address (Pmode, dstb);
-
- if (GET_MODE (srcb) != Pmode)
- srcb = convert_memory_address (Pmode, srcb);
-#endif
+ dstb = convert_memory_address (Pmode, dstb);
+ srcb = convert_memory_address (Pmode, srcb);
/* "Dereference" to BLKmode memories. */
dstb = gen_rtx_MEM (BLKmode, dstb);
@@ -4201,11 +4141,7 @@ expand_builtin_alloca (tree arglist, rtx target)
/* Allocate the desired space. */
result = allocate_dynamic_stack_space (op0, target, BITS_PER_UNIT);
-
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (result) != ptr_mode)
- result = convert_memory_address (ptr_mode, result);
-#endif
+ result = convert_memory_address (ptr_mode, result);
return result;
}
@@ -4239,7 +4175,7 @@ expand_builtin_unop (enum machine_mode target_mode, tree arglist, rtx target,
long, we attempt to transform this call into __builtin_fputc(). */
static rtx
-expand_builtin_fputs (tree arglist, int ignore, int unlocked)
+expand_builtin_fputs (tree arglist, rtx target, bool unlocked)
{
tree len, fn;
tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED]
@@ -4249,7 +4185,7 @@ expand_builtin_fputs (tree arglist, int ignore, int unlocked)
/* If the return value is used, or the replacement _DECL isn't
initialized, don't do the transformation. */
- if (!ignore || !fn_fputc || !fn_fwrite)
+ if (target != const0_rtx || !fn_fputc || !fn_fwrite)
return 0;
/* Verify the arguments in the original call. */
@@ -4311,8 +4247,7 @@ expand_builtin_fputs (tree arglist, int ignore, int unlocked)
}
return expand_expr (build_function_call_expr (fn, arglist),
- (ignore ? const0_rtx : NULL_RTX),
- VOIDmode, EXPAND_NORMAL);
+ const0_rtx, VOIDmode, EXPAND_NORMAL);
}
/* Expand a call to __builtin_expect. We return our argument and emit a
@@ -4377,6 +4312,7 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label)
&& (integer_zerop (arg1) || integer_onep (arg1)))
{
int num_jumps = 0;
+ int save_pending_stack_adjust = pending_stack_adjust;
rtx insn;
/* If we fail to locate an appropriate conditional jump, we'll
@@ -4468,7 +4404,10 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label)
/* If no jumps were modified, fail and do __builtin_expect the normal
way. */
if (num_jumps == 0)
- ret = NULL_RTX;
+ {
+ ret = NULL_RTX;
+ pending_stack_adjust = save_pending_stack_adjust;
+ }
}
return ret;
@@ -4532,6 +4471,227 @@ expand_builtin_cabs (tree arglist, rtx target)
return expand_complex_abs (mode, op0, target, 0);
}
+/* Create a new constant string literal and return a char* pointer to it.
+ The STRING_CST value is the LEN characters at STR. */
+static tree
+build_string_literal (int len, const char *str)
+{
+ tree t, elem, index, type;
+
+ t = build_string (len, str);
+ elem = build_type_variant (char_type_node, 1, 0);
+ index = build_index_type (build_int_2 (len - 1, 0));
+ type = build_array_type (elem, index);
+ TREE_TYPE (t) = type;
+ TREE_CONSTANT (t) = 1;
+ TREE_READONLY (t) = 1;
+ TREE_STATIC (t) = 1;
+
+ type = build_pointer_type (type);
+ t = build1 (ADDR_EXPR, type, t);
+
+ type = build_pointer_type (elem);
+ t = build1 (NOP_EXPR, type, t);
+ return t;
+}
+
+/* Expand a call to printf or printf_unlocked with argument list ARGLIST.
+ Return 0 if a normal call should be emitted rather than transforming
+ the function inline. If convenient, the result should be placed in
+ TARGET with mode MODE. UNLOCKED indicates this is a printf_unlocked
+ call. */
+static rtx
+expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode,
+ bool unlocked)
+{
+ tree fn_putchar = unlocked
+ ? implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED]
+ : implicit_built_in_decls[BUILT_IN_PUTCHAR];
+ tree fn_puts = unlocked ? implicit_built_in_decls[BUILT_IN_PUTS_UNLOCKED]
+ : implicit_built_in_decls[BUILT_IN_PUTS];
+ const char *fmt_str;
+ tree fn, fmt, arg;
+
+ /* If the return value is used, don't do the transformation. */
+ if (target != const0_rtx)
+ return 0;
+
+ /* Verify the required arguments in the original call. */
+ if (! arglist)
+ return 0;
+ fmt = TREE_VALUE (arglist);
+ if (TREE_CODE (TREE_TYPE (fmt)) != POINTER_TYPE)
+ return 0;
+ arglist = TREE_CHAIN (arglist);
+
+ /* Check whether the format is a literal string constant. */
+ fmt_str = c_getstr (fmt);
+ if (fmt_str == NULL)
+ return 0;
+
+ /* If the format specifier was "%s\n", call __builtin_puts(arg). */
+ if (strcmp (fmt_str, "%s\n") == 0)
+ {
+ if (! arglist
+ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE
+ || TREE_CHAIN (arglist))
+ return 0;
+ fn = fn_puts;
+ }
+ /* If the format specifier was "%c", call __builtin_putchar(arg). */
+ else if (strcmp (fmt_str, "%c") == 0)
+ {
+ if (! arglist
+ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE
+ || TREE_CHAIN (arglist))
+ return 0;
+ fn = fn_putchar;
+ }
+ else
+ {
+ /* We can't handle anything else with % args or %% ... yet. */
+ if (strchr (fmt_str, '%'))
+ return 0;
+
+ if (arglist)
+ return 0;
+
+ /* If the format specifier was "", printf does nothing. */
+ if (fmt_str[0] == '\0')
+ return const0_rtx;
+ /* If the format specifier has length of 1, call putchar. */
+ if (fmt_str[1] == '\0')
+ {
+ /* Given printf("c"), (where c is any one character,)
+ convert "c"[0] to an int and pass that to the replacement
+ function. */
+ arg = build_int_2 (fmt_str[0], 0);
+ arglist = build_tree_list (NULL_TREE, arg);
+ fn = fn_putchar;
+ }
+ else
+ {
+ /* If the format specifier was "string\n", call puts("string"). */
+ size_t len = strlen (fmt_str);
+ if (fmt_str[len - 1] == '\n')
+ {
+ /* Create a NUL-terminated string that's one char shorter
+ than the original, stripping off the trailing '\n'. */
+ char *newstr = (char *) alloca (len);
+ memcpy (newstr, fmt_str, len - 1);
+ newstr[len - 1] = 0;
+
+ arg = build_string_literal (len, newstr);
+ arglist = build_tree_list (NULL_TREE, arg);
+ fn = fn_puts;
+ }
+ else
+ /* We'd like to arrange to call fputs(string,stdout) here,
+ but we need stdout and don't have a way to get it yet. */
+ return 0;
+ }
+ }
+
+ if (!fn)
+ return 0;
+ return expand_expr (build_function_call_expr (fn, arglist),
+ target, mode, EXPAND_NORMAL);
+}
+
+/* Expand a call to fprintf or fprintf_unlocked with argument list ARGLIST.
+ Return 0 if a normal call should be emitted rather than transforming
+ the function inline. If convenient, the result should be placed in
+ TARGET with mode MODE. UNLOCKED indicates this is a fprintf_unlocked
+ call. */
+static rtx
+expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode,
+ bool unlocked)
+{
+ tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED]
+ : implicit_built_in_decls[BUILT_IN_FPUTC];
+ tree fn_fputs = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTS_UNLOCKED]
+ : implicit_built_in_decls[BUILT_IN_FPUTS];
+ const char *fmt_str;
+ tree fn, fmt, fp, arg;
+
+ /* If the return value is used, don't do the transformation. */
+ if (target != const0_rtx)
+ return 0;
+
+ /* Verify the required arguments in the original call. */
+ if (! arglist)
+ return 0;
+ fp = TREE_VALUE (arglist);
+ if (TREE_CODE (TREE_TYPE (fp)) != POINTER_TYPE)
+ return 0;
+ arglist = TREE_CHAIN (arglist);
+ if (! arglist)
+ return 0;
+ fmt = TREE_VALUE (arglist);
+ if (TREE_CODE (TREE_TYPE (fmt)) != POINTER_TYPE)
+ return 0;
+ arglist = TREE_CHAIN (arglist);
+
+ /* Check whether the format is a literal string constant. */
+ fmt_str = c_getstr (fmt);
+ if (fmt_str == NULL)
+ return 0;
+
+ /* If the format specifier was "%s", call __builtin_fputs(arg,fp). */
+ if (strcmp (fmt_str, "%s") == 0)
+ {
+ if (! arglist
+ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE
+ || TREE_CHAIN (arglist))
+ return 0;
+ arg = TREE_VALUE (arglist);
+ arglist = build_tree_list (NULL_TREE, fp);
+ arglist = tree_cons (NULL_TREE, arg, arglist);
+ fn = fn_fputs;
+ }
+ /* If the format specifier was "%c", call __builtin_fputc(arg,fp). */
+ else if (strcmp (fmt_str, "%c") == 0)
+ {
+ if (! arglist
+ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE
+ || TREE_CHAIN (arglist))
+ return 0;
+ arg = TREE_VALUE (arglist);
+ arglist = build_tree_list (NULL_TREE, fp);
+ arglist = tree_cons (NULL_TREE, arg, arglist);
+ fn = fn_fputc;
+ }
+ else
+ {
+ /* We can't handle anything else with % args or %% ... yet. */
+ if (strchr (fmt_str, '%'))
+ return 0;
+
+ if (arglist)
+ return 0;
+
+ /* If the format specifier was "", fprintf does nothing. */
+ if (fmt_str[0] == '\0')
+ {
+ /* Evaluate and ignore FILE* argument for side-effects. */
+ expand_expr (fp, const0_rtx, VOIDmode, EXPAND_NORMAL);
+ return const0_rtx;
+ }
+
+ /* When "string" doesn't contain %, replace all cases of
+ fprintf(stream,string) with fputs(string,stream). The fputs
+ builtin will take care of special cases like length == 1. */
+ arglist = build_tree_list (NULL_TREE, fp);
+ arglist = tree_cons (NULL_TREE, fmt, arglist);
+ fn = fn_fputs;
+ }
+
+ if (!fn)
+ return 0;
+ return expand_expr (build_function_call_expr (fn, arglist),
+ target, mode, EXPAND_NORMAL);
+}
+
/* Expand a call to sprintf with argument list ARGLIST. Return 0 if
a normal call should be emitted rather than expanding the function
inline. If convenient, the result should be placed in TARGET with
@@ -4555,7 +4715,7 @@ expand_builtin_sprintf (tree arglist, rtx target, enum machine_mode mode)
if (! arglist)
return 0;
fmt = TREE_VALUE (arglist);
- if (TREE_CODE (TREE_TYPE (dest)) != POINTER_TYPE)
+ if (TREE_CODE (TREE_TYPE (fmt)) != POINTER_TYPE)
return 0;
arglist = TREE_CHAIN (arglist);
@@ -4627,12 +4787,12 @@ rtx
expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
int ignore)
{
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ tree fndecl = get_callee_fndecl (exp);
tree arglist = TREE_OPERAND (exp, 1);
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
enum machine_mode target_mode = TYPE_MODE (TREE_TYPE (exp));
- /* Perform postincrements before expanding builtin functions.  */
+ /* Perform postincrements before expanding builtin functions. */
emit_queue ();
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
@@ -4640,94 +4800,11 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
/* When not optimizing, generate calls to library functions for a certain
set of builtins. */
- if (!optimize && !CALLED_AS_BUILT_IN (fndecl))
- switch (fcode)
- {
- case BUILT_IN_SQRT:
- case BUILT_IN_SQRTF:
- case BUILT_IN_SQRTL:
- case BUILT_IN_SIN:
- case BUILT_IN_SINF:
- case BUILT_IN_SINL:
- case BUILT_IN_COS:
- case BUILT_IN_COSF:
- case BUILT_IN_COSL:
- case BUILT_IN_EXP:
- case BUILT_IN_EXPF:
- case BUILT_IN_EXPL:
- case BUILT_IN_LOG:
- case BUILT_IN_LOGF:
- case BUILT_IN_LOGL:
- case BUILT_IN_TAN:
- case BUILT_IN_TANF:
- case BUILT_IN_TANL:
- case BUILT_IN_ATAN:
- case BUILT_IN_ATANF:
- case BUILT_IN_ATANL:
- case BUILT_IN_POW:
- case BUILT_IN_POWF:
- case BUILT_IN_POWL:
- case BUILT_IN_ATAN2:
- case BUILT_IN_ATAN2F:
- case BUILT_IN_ATAN2L:
- case BUILT_IN_MEMSET:
- case BUILT_IN_MEMCPY:
- case BUILT_IN_MEMCMP:
- case BUILT_IN_MEMPCPY:
- case BUILT_IN_MEMMOVE:
- case BUILT_IN_BCMP:
- case BUILT_IN_BZERO:
- case BUILT_IN_BCOPY:
- case BUILT_IN_INDEX:
- case BUILT_IN_RINDEX:
- case BUILT_IN_SPRINTF:
- case BUILT_IN_STPCPY:
- case BUILT_IN_STRCHR:
- case BUILT_IN_STRRCHR:
- case BUILT_IN_STRLEN:
- case BUILT_IN_STRCPY:
- case BUILT_IN_STRNCPY:
- case BUILT_IN_STRNCMP:
- case BUILT_IN_STRSTR:
- case BUILT_IN_STRPBRK:
- case BUILT_IN_STRCAT:
- case BUILT_IN_STRNCAT:
- case BUILT_IN_STRSPN:
- case BUILT_IN_STRCSPN:
- case BUILT_IN_STRCMP:
- case BUILT_IN_FFS:
- case BUILT_IN_PUTCHAR:
- case BUILT_IN_PUTS:
- case BUILT_IN_PRINTF:
- case BUILT_IN_FPUTC:
- case BUILT_IN_FPUTS:
- case BUILT_IN_FWRITE:
- case BUILT_IN_PUTCHAR_UNLOCKED:
- case BUILT_IN_PUTS_UNLOCKED:
- case BUILT_IN_PRINTF_UNLOCKED:
- case BUILT_IN_FPUTC_UNLOCKED:
- case BUILT_IN_FPUTS_UNLOCKED:
- case BUILT_IN_FWRITE_UNLOCKED:
- case BUILT_IN_FLOOR:
- case BUILT_IN_FLOORF:
- case BUILT_IN_FLOORL:
- case BUILT_IN_CEIL:
- case BUILT_IN_CEILF:
- case BUILT_IN_CEILL:
- case BUILT_IN_TRUNC:
- case BUILT_IN_TRUNCF:
- case BUILT_IN_TRUNCL:
- case BUILT_IN_ROUND:
- case BUILT_IN_ROUNDF:
- case BUILT_IN_ROUNDL:
- case BUILT_IN_NEARBYINT:
- case BUILT_IN_NEARBYINTF:
- case BUILT_IN_NEARBYINTL:
- return expand_call (exp, target, ignore);
-
- default:
- break;
- }
+ if (!optimize
+ && !CALLED_AS_BUILT_IN (fndecl)
+ && DECL_ASSEMBLER_NAME_SET_P (fndecl)
+ && fcode != BUILT_IN_ALLOCA)
+ return expand_call (exp, target, ignore);
/* The built-in function expanders test for target == const0_rtx
to determine whether the function's result will be ignored. */
@@ -5148,13 +5225,38 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
expand_builtin_trap ();
return const0_rtx;
+ case BUILT_IN_PRINTF:
+ target = expand_builtin_printf (arglist, target, mode, false);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_PRINTF_UNLOCKED:
+ target = expand_builtin_printf (arglist, target, mode, true);
+ if (target)
+ return target;
+ break;
+
case BUILT_IN_FPUTS:
- target = expand_builtin_fputs (arglist, ignore,/*unlocked=*/ 0);
+ target = expand_builtin_fputs (arglist, target, false);
if (target)
return target;
break;
+
case BUILT_IN_FPUTS_UNLOCKED:
- target = expand_builtin_fputs (arglist, ignore,/*unlocked=*/ 1);
+ target = expand_builtin_fputs (arglist, target, true);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_FPRINTF:
+ target = expand_builtin_fprintf (arglist, target, mode, false);
+ if (target)
+ return target;
+ break;
+
+ case BUILT_IN_FPRINTF_UNLOCKED:
+ target = expand_builtin_fprintf (arglist, target, mode, true);
if (target)
return target;
break;
@@ -5230,8 +5332,8 @@ builtin_mathfn_code (tree t)
|| TREE_CODE (TREE_OPERAND (t, 0)) != ADDR_EXPR)
return END_BUILTINS;
- fndecl = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
- if (TREE_CODE (fndecl) != FUNCTION_DECL
+ fndecl = get_callee_fndecl (t);
+ if (fndecl == NULL_TREE
|| ! DECL_BUILT_IN (fndecl)
|| DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
return END_BUILTINS;
@@ -5289,15 +5391,14 @@ fold_builtin_constant_p (tree arglist)
&& TREE_CODE (TREE_OPERAND (arglist, 0)) == STRING_CST))
return integer_one_node;
- /* If we aren't going to be running CSE or this expression
- has side effects, show we don't know it to be a constant.
- Likewise if it's a pointer or aggregate type since in those
- case we only want literals, since those are only optimized
+ /* If this expression has side effects, show we don't know it to be a
+ constant. Likewise if it's a pointer or aggregate type since in
+ those case we only want literals, since those are only optimized
when generating RTL, not later.
And finally, if we are compiling an initializer, not code, we
need to return a definite result now; there's not going to be any
more optimization done. */
- if (TREE_SIDE_EFFECTS (arglist) || cse_not_expected
+ if (TREE_SIDE_EFFECTS (arglist)
|| AGGREGATE_TYPE_P (TREE_TYPE (arglist))
|| POINTER_TYPE_P (TREE_TYPE (arglist))
|| cfun == 0)
@@ -5442,7 +5543,7 @@ integer_valued_real_p (tree t)
static tree
fold_trunc_transparent_mathfn (tree exp)
{
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ tree fndecl = get_callee_fndecl (exp);
tree arglist = TREE_OPERAND (exp, 1);
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
tree arg;
@@ -5544,6 +5645,8 @@ fold_builtin_cabs (tree fndecl, tree arglist, tree type)
{
tree rpart, ipart, result, arglist;
+ arg = save_expr (arg);
+
rpart = fold (build1 (REALPART_EXPR, type, arg));
ipart = fold (build1 (IMAGPART_EXPR, type, arg));
@@ -5655,13 +5758,331 @@ fold_builtin_ceil (tree exp)
return fold_trunc_transparent_mathfn (exp);
}
+/* Fold function call to builtin ffs, clz, ctz, popcount and parity
+ and their long and long long variants (i.e. ffsl and ffsll).
+ Return NULL_TREE if no simplification can be made. */
+
+static tree
+fold_builtin_bitop (tree exp)
+{
+ tree fndecl = get_callee_fndecl (exp);
+ tree arglist = TREE_OPERAND (exp, 1);
+ tree arg;
+
+ if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE))
+ return NULL_TREE;
+
+ /* Optimize for constant argument. */
+ arg = TREE_VALUE (arglist);
+ if (TREE_CODE (arg) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (arg))
+ {
+ HOST_WIDE_INT hi, width, result;
+ unsigned HOST_WIDE_INT lo;
+ tree type, t;
+
+ type = TREE_TYPE (arg);
+ width = TYPE_PRECISION (type);
+ lo = TREE_INT_CST_LOW (arg);
+
+ /* Clear all the bits that are beyond the type's precision. */
+ if (width > HOST_BITS_PER_WIDE_INT)
+ {
+ hi = TREE_INT_CST_HIGH (arg);
+ if (width < 2 * HOST_BITS_PER_WIDE_INT)
+ hi &= ~((HOST_WIDE_INT) (-1) >> (width - HOST_BITS_PER_WIDE_INT));
+ }
+ else
+ {
+ hi = 0;
+ if (width < HOST_BITS_PER_WIDE_INT)
+ lo &= ~((unsigned HOST_WIDE_INT) (-1) << width);
+ }
+
+ switch (DECL_FUNCTION_CODE (fndecl))
+ {
+ case BUILT_IN_FFS:
+ case BUILT_IN_FFSL:
+ case BUILT_IN_FFSLL:
+ if (lo != 0)
+ result = exact_log2 (lo & -lo) + 1;
+ else if (hi != 0)
+ result = HOST_BITS_PER_WIDE_INT + exact_log2 (hi & -hi) + 1;
+ else
+ result = 0;
+ break;
+
+ case BUILT_IN_CLZ:
+ case BUILT_IN_CLZL:
+ case BUILT_IN_CLZLL:
+ if (hi != 0)
+ result = width - floor_log2 (hi) - 1 - HOST_BITS_PER_WIDE_INT;
+ else if (lo != 0)
+ result = width - floor_log2 (lo) - 1;
+ else if (! CLZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (type), result))
+ result = width;
+ break;
+
+ case BUILT_IN_CTZ:
+ case BUILT_IN_CTZL:
+ case BUILT_IN_CTZLL:
+ if (lo != 0)
+ result = exact_log2 (lo & -lo);
+ else if (hi != 0)
+ result = HOST_BITS_PER_WIDE_INT + exact_log2 (hi & -hi);
+ else if (! CTZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (type), result))
+ result = width;
+ break;
+
+ case BUILT_IN_POPCOUNT:
+ case BUILT_IN_POPCOUNTL:
+ case BUILT_IN_POPCOUNTLL:
+ result = 0;
+ while (lo)
+ result++, lo &= lo - 1;
+ while (hi)
+ result++, hi &= hi - 1;
+ break;
+
+ case BUILT_IN_PARITY:
+ case BUILT_IN_PARITYL:
+ case BUILT_IN_PARITYLL:
+ result = 0;
+ while (lo)
+ result++, lo &= lo - 1;
+ while (hi)
+ result++, hi &= hi - 1;
+ result &= 1;
+ break;
+
+ default:
+ abort();
+ }
+
+ t = build_int_2 (result, 0);
+ TREE_TYPE (t) = TREE_TYPE (exp);
+ return t;
+ }
+
+ return NULL_TREE;
+}
+
+/* Return true if EXPR is the real constant contained in VALUE. */
+
+static bool
+real_dconstp (tree expr, const REAL_VALUE_TYPE *value)
+{
+ STRIP_NOPS (expr);
+
+ return ((TREE_CODE (expr) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (expr)
+ && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), *value))
+ || (TREE_CODE (expr) == COMPLEX_CST
+ && real_dconstp (TREE_REALPART (expr), value)
+ && real_zerop (TREE_IMAGPART (expr))));
+}
+
+/* A subroutine of fold_builtin to fold the various logarithmic
+ functions. EXP is the CALL_EXPR of a call to a builtin log*
+ function. VALUE is the base of the log* function. */
+
+static tree
+fold_builtin_logarithm (tree exp, const REAL_VALUE_TYPE *value)
+{
+ tree arglist = TREE_OPERAND (exp, 1);
+
+ if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
+ {
+ tree fndecl = get_callee_fndecl (exp);
+ tree type = TREE_TYPE (TREE_TYPE (fndecl));
+ tree arg = TREE_VALUE (arglist);
+ const enum built_in_function fcode = builtin_mathfn_code (arg);
+
+ /* Optimize log*(1.0) = 0.0. */
+ if (real_onep (arg))
+ return build_real (type, dconst0);
+
+ /* Optimize logN(N) = 1.0. If N can't be truncated to MODE
+ exactly, then only do this if flag_unsafe_math_optimizations. */
+ if (exact_real_truncate (TYPE_MODE (type), value)
+ || flag_unsafe_math_optimizations)
+ {
+ const REAL_VALUE_TYPE value_truncate =
+ real_value_truncate (TYPE_MODE (type), *value);
+ if (real_dconstp (arg, &value_truncate))
+ return build_real (type, dconst1);
+ }
+
+ /* Special case, optimize logN(expN(x)) = x. */
+ if (flag_unsafe_math_optimizations
+ && ((value == &dconste
+ && (fcode == BUILT_IN_EXP
+ || fcode == BUILT_IN_EXPF
+ || fcode == BUILT_IN_EXPL))
+ || (value == &dconst2
+ && (fcode == BUILT_IN_EXP2
+ || fcode == BUILT_IN_EXP2F
+ || fcode == BUILT_IN_EXP2L))
+ || (value == &dconst10
+ && (fcode == BUILT_IN_EXP10
+ || fcode == BUILT_IN_EXP10F
+ || fcode == BUILT_IN_EXP10L))))
+ return convert (type, TREE_VALUE (TREE_OPERAND (arg, 1)));
+
+ /* Optimize log*(func()) for various exponential functions. We
+ want to determine the value "x" and the power "exponent" in
+ order to transform logN(x**exponent) into exponent*logN(x). */
+ if (flag_unsafe_math_optimizations)
+ {
+ tree exponent = 0, x = 0;
+
+ switch (fcode)
+ {
+ case BUILT_IN_EXP:
+ case BUILT_IN_EXPF:
+ case BUILT_IN_EXPL:
+ /* Prepare to do logN(exp(exponent) -> exponent*logN(e). */
+ x = build_real (type,
+ real_value_truncate (TYPE_MODE (type), dconste));
+ exponent = TREE_VALUE (TREE_OPERAND (arg, 1));
+ break;
+ case BUILT_IN_EXP2:
+ case BUILT_IN_EXP2F:
+ case BUILT_IN_EXP2L:
+ /* Prepare to do logN(exp2(exponent) -> exponent*logN(2). */
+ x = build_real (type, dconst2);
+ exponent = TREE_VALUE (TREE_OPERAND (arg, 1));
+ break;
+ case BUILT_IN_EXP10:
+ case BUILT_IN_EXP10F:
+ case BUILT_IN_EXP10L:
+ case BUILT_IN_POW10:
+ case BUILT_IN_POW10F:
+ case BUILT_IN_POW10L:
+ /* Prepare to do logN(exp10(exponent) -> exponent*logN(10). */
+ x = build_real (type, dconst10);
+ exponent = TREE_VALUE (TREE_OPERAND (arg, 1));
+ break;
+ case BUILT_IN_SQRT:
+ case BUILT_IN_SQRTF:
+ case BUILT_IN_SQRTL:
+ /* Prepare to do logN(sqrt(x) -> 0.5*logN(x). */
+ x = TREE_VALUE (TREE_OPERAND (arg, 1));
+ exponent = build_real (type, dconsthalf);
+ break;
+ case BUILT_IN_CBRT:
+ case BUILT_IN_CBRTF:
+ case BUILT_IN_CBRTL:
+ /* Prepare to do logN(cbrt(x) -> (1/3)*logN(x). */
+ x = TREE_VALUE (TREE_OPERAND (arg, 1));
+ exponent = build_real (type, real_value_truncate (TYPE_MODE (type),
+ dconstthird));
+ break;
+ case BUILT_IN_POW:
+ case BUILT_IN_POWF:
+ case BUILT_IN_POWL:
+ /* Prepare to do logN(pow(x,exponent) -> exponent*logN(x). */
+ x = TREE_VALUE (TREE_OPERAND (arg, 1));
+ exponent = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg, 1)));
+ break;
+ default:
+ break;
+ }
+
+ /* Now perform the optimization. */
+ if (x && exponent)
+ {
+ tree logfn;
+ arglist = build_tree_list (NULL_TREE, x);
+ logfn = build_function_call_expr (fndecl, arglist);
+ return fold (build (MULT_EXPR, type, exponent, logfn));
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* A subroutine of fold_builtin to fold the various exponent
+ functions. EXP is the CALL_EXPR of a call to a builtin function.
+ VALUE is the value which will be raised to a power. */
+
+static tree
+fold_builtin_exponent (tree exp, const REAL_VALUE_TYPE *value)
+{
+ tree arglist = TREE_OPERAND (exp, 1);
+
+ if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
+ {
+ tree fndecl = get_callee_fndecl (exp);
+ tree type = TREE_TYPE (TREE_TYPE (fndecl));
+ tree arg = TREE_VALUE (arglist);
+
+ /* Optimize exp*(0.0) = 1.0. */
+ if (real_zerop (arg))
+ return build_real (type, dconst1);
+
+ /* Optimize expN(1.0) = N. */
+ if (real_onep (arg))
+ {
+ REAL_VALUE_TYPE cst;
+
+ real_convert (&cst, TYPE_MODE (type), value);
+ return build_real (type, cst);
+ }
+
+ /* Attempt to evaluate expN(integer) at compile-time. */
+ if (flag_unsafe_math_optimizations
+ && TREE_CODE (arg) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg))
+ {
+ REAL_VALUE_TYPE cint;
+ REAL_VALUE_TYPE c;
+ HOST_WIDE_INT n;
+
+ c = TREE_REAL_CST (arg);
+ n = real_to_integer (&c);
+ real_from_integer (&cint, VOIDmode, n,
+ n < 0 ? -1 : 0, 0);
+ if (real_identical (&c, &cint))
+ {
+ REAL_VALUE_TYPE x;
+
+ real_powi (&x, TYPE_MODE (type), value, n);
+ return build_real (type, x);
+ }
+ }
+
+ /* Optimize expN(logN(x)) = x. */
+ if (flag_unsafe_math_optimizations)
+ {
+ const enum built_in_function fcode = builtin_mathfn_code (arg);
+
+ if ((value == &dconste
+ && (fcode == BUILT_IN_LOG
+ || fcode == BUILT_IN_LOGF
+ || fcode == BUILT_IN_LOGL))
+ || (value == &dconst2
+ && (fcode == BUILT_IN_LOG2
+ || fcode == BUILT_IN_LOG2F
+ || fcode == BUILT_IN_LOG2L))
+ || (value == &dconst10
+ && (fcode == BUILT_IN_LOG10
+ || fcode == BUILT_IN_LOG10F
+ || fcode == BUILT_IN_LOG10L)))
+ return convert (type, TREE_VALUE (TREE_OPERAND (arg, 1)));
+ }
+ }
+
+ return 0;
+}
+
/* Used by constant folding to eliminate some builtin calls early. EXP is
the CALL_EXPR of a call to a builtin function. */
tree
fold_builtin (tree exp)
{
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ tree fndecl = get_callee_fndecl (exp);
tree arglist = TREE_OPERAND (exp, 1);
tree type = TREE_TYPE (TREE_TYPE (fndecl));
@@ -5792,107 +6213,32 @@ fold_builtin (tree exp)
case BUILT_IN_EXP:
case BUILT_IN_EXPF:
case BUILT_IN_EXPL:
- if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
- {
- enum built_in_function fcode;
- tree arg = TREE_VALUE (arglist);
-
- /* Optimize exp(0.0) = 1.0. */
- if (real_zerop (arg))
- return build_real (type, dconst1);
-
- /* Optimize exp(1.0) = e. */
- if (real_onep (arg))
- {
- REAL_VALUE_TYPE cst;
-
- if (! builtin_dconsts_init)
- init_builtin_dconsts ();
- real_convert (&cst, TYPE_MODE (type), &dconste);
- return build_real (type, cst);
- }
-
- /* Attempt to evaluate exp at compile-time. */
- if (flag_unsafe_math_optimizations
- && TREE_CODE (arg) == REAL_CST
- && ! TREE_CONSTANT_OVERFLOW (arg))
- {
- REAL_VALUE_TYPE cint;
- REAL_VALUE_TYPE c;
- HOST_WIDE_INT n;
-
- c = TREE_REAL_CST (arg);
- n = real_to_integer (&c);
- real_from_integer (&cint, VOIDmode, n,
- n < 0 ? -1 : 0, 0);
- if (real_identical (&c, &cint))
- {
- REAL_VALUE_TYPE x;
-
- if (! builtin_dconsts_init)
- init_builtin_dconsts ();
- real_powi (&x, TYPE_MODE (type), &dconste, n);
- return build_real (type, x);
- }
- }
-
- /* Optimize exp(log(x)) = x. */
- fcode = builtin_mathfn_code (arg);
- if (flag_unsafe_math_optimizations
- && (fcode == BUILT_IN_LOG
- || fcode == BUILT_IN_LOGF
- || fcode == BUILT_IN_LOGL))
- return TREE_VALUE (TREE_OPERAND (arg, 1));
- }
- break;
-
+ return fold_builtin_exponent (exp, &dconste);
+ case BUILT_IN_EXP2:
+ case BUILT_IN_EXP2F:
+ case BUILT_IN_EXP2L:
+ return fold_builtin_exponent (exp, &dconst2);
+ case BUILT_IN_EXP10:
+ case BUILT_IN_EXP10F:
+ case BUILT_IN_EXP10L:
+ case BUILT_IN_POW10:
+ case BUILT_IN_POW10F:
+ case BUILT_IN_POW10L:
+ return fold_builtin_exponent (exp, &dconst10);
case BUILT_IN_LOG:
case BUILT_IN_LOGF:
case BUILT_IN_LOGL:
- if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
- {
- enum built_in_function fcode;
- tree arg = TREE_VALUE (arglist);
-
- /* Optimize log(1.0) = 0.0. */
- if (real_onep (arg))
- return build_real (type, dconst0);
-
- /* Optimize log(exp(x)) = x. */
- fcode = builtin_mathfn_code (arg);
- if (flag_unsafe_math_optimizations
- && (fcode == BUILT_IN_EXP
- || fcode == BUILT_IN_EXPF
- || fcode == BUILT_IN_EXPL))
- return TREE_VALUE (TREE_OPERAND (arg, 1));
-
- /* Optimize log(sqrt(x)) = log(x)*0.5. */
- if (flag_unsafe_math_optimizations
- && (fcode == BUILT_IN_SQRT
- || fcode == BUILT_IN_SQRTF
- || fcode == BUILT_IN_SQRTL))
- {
- tree logfn = build_function_call_expr (fndecl,
- TREE_OPERAND (arg, 1));
- return fold (build (MULT_EXPR, type, logfn,
- build_real (type, dconsthalf)));
- }
-
- /* Optimize log(pow(x,y)) = y*log(x). */
- if (flag_unsafe_math_optimizations
- && (fcode == BUILT_IN_POW
- || fcode == BUILT_IN_POWF
- || fcode == BUILT_IN_POWL))
- {
- tree arg0, arg1, logfn;
-
- arg0 = TREE_VALUE (TREE_OPERAND (arg, 1));
- arg1 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg, 1)));
- arglist = build_tree_list (NULL_TREE, arg0);
- logfn = build_function_call_expr (fndecl, arglist);
- return fold (build (MULT_EXPR, type, arg1, logfn));
- }
- }
+ return fold_builtin_logarithm (exp, &dconste);
+ break;
+ case BUILT_IN_LOG2:
+ case BUILT_IN_LOG2F:
+ case BUILT_IN_LOG2L:
+ return fold_builtin_logarithm (exp, &dconst2);
+ break;
+ case BUILT_IN_LOG10:
+ case BUILT_IN_LOG10F:
+ case BUILT_IN_LOG10L:
+ return fold_builtin_logarithm (exp, &dconst10);
break;
case BUILT_IN_TAN:
@@ -5933,8 +6279,6 @@ fold_builtin (tree exp)
{
REAL_VALUE_TYPE cst;
- if (! builtin_dconsts_init)
- init_builtin_dconsts ();
real_convert (&cst, TYPE_MODE (type), &dconstpi);
cst.exp -= 2;
return build_real (type, cst);
@@ -5976,28 +6320,6 @@ fold_builtin (tree exp)
build_real (type, dconst1),
arg0));
- /* Optimize pow(x,2.0) = x*x. */
- if (REAL_VALUES_EQUAL (c, dconst2)
- && (*lang_hooks.decls.global_bindings_p) () == 0
- && ! CONTAINS_PLACEHOLDER_P (arg0))
- {
- arg0 = save_expr (arg0);
- return fold (build (MULT_EXPR, type, arg0, arg0));
- }
-
- /* Optimize pow(x,-2.0) = 1.0/(x*x). */
- if (flag_unsafe_math_optimizations
- && REAL_VALUES_EQUAL (c, dconstm2)
- && (*lang_hooks.decls.global_bindings_p) () == 0
- && ! CONTAINS_PLACEHOLDER_P (arg0))
- {
- arg0 = save_expr (arg0);
- return fold (build (RDIV_EXPR, type,
- build_real (type, dconst1),
- fold (build (MULT_EXPR, type,
- arg0, arg0))));
- }
-
/* Optimize pow(x,0.5) = sqrt(x). */
if (flag_unsafe_math_optimizations
&& REAL_VALUES_EQUAL (c, dconsthalf))
@@ -6132,6 +6454,23 @@ fold_builtin (tree exp)
case BUILT_IN_NEARBYINTL:
return fold_trunc_transparent_mathfn (exp);
+ case BUILT_IN_FFS:
+ case BUILT_IN_FFSL:
+ case BUILT_IN_FFSLL:
+ case BUILT_IN_CLZ:
+ case BUILT_IN_CLZL:
+ case BUILT_IN_CLZLL:
+ case BUILT_IN_CTZ:
+ case BUILT_IN_CTZL:
+ case BUILT_IN_CTZLL:
+ case BUILT_IN_POPCOUNT:
+ case BUILT_IN_POPCOUNTL:
+ case BUILT_IN_POPCOUNTLL:
+ case BUILT_IN_PARITY:
+ case BUILT_IN_PARITYL:
+ case BUILT_IN_PARITYLL:
+ return fold_builtin_bitop (exp);
+
default:
break;
}
@@ -6149,7 +6488,6 @@ build_function_call_expr (tree fn, tree arglist)
call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
call_expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
call_expr, arglist);
- TREE_SIDE_EFFECTS (call_expr) = 1;
return fold (call_expr);
}
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 5f814bbf9f5..fc6ddcaedfa 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -67,28 +67,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
library. */
#undef DEF_GCC_BUILTIN
#define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
+ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
false, false, false, ATTRS, true)
-
-/* A fallback builtin is a builtin (like __builtin_puts) that falls
- back to the corresopnding library function if necessary -- but
- for which we should not introduce the non-`__builtin' variant of
- the name. */
-#undef DEF_FALLBACK_BUILTIN
-#define DEF_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- false, true, false, ATTRS, true)
-
-/* Like DEF_FALLBACK_BUILTIN, except that the function is not one that
- is specified by ANSI/ISO C. So, when we're being fully conformant
- we ignore the version of these builtins that does not begin with
- __builtin. */
-#undef DEF_EXT_FALLBACK_BUILTIN
-#define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- false, true, true, ATTRS, true)
-
/* A library builtin (like __builtin_strchr) is a builtin equivalent
of an ANSI/ISO standard library function. In addition to the
`__builtin' version, we will create an ordinary version (e.g,
@@ -97,7 +78,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
version. */
#undef DEF_LIB_BUILTIN
#define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
+ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
true, true, false, ATTRS, true)
/* Like DEF_LIB_BUILTIN, except that the function is not one that is
@@ -106,14 +87,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
__builtin. */
#undef DEF_EXT_LIB_BUILTIN
#define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
+ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
true, true, true, ATTRS, false)
/* Like DEF_LIB_BUILTIN, except that the function is only a part of
the standard in C99 or above. */
#undef DEF_C99_BUILTIN
#define DEF_C99_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
+ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
/* Builtin that is specified by C99 and C90 reserve the name for future use.
@@ -121,890 +102,451 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
implicitly. */
#undef DEF_C99_C90RES_BUILTIN
#define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
+ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
-/* Like DEF_LIB_BUILTIN, except that the function is expanded in the
- front-end. */
-#undef DEF_FRONT_END_LIB_BUILTIN
-#define DEF_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
- true, true, false, ATTRS, true)
-
-/* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
- that is specified by ANSI/ISO C. So, when we're being fully
- conformant we ignore the version of these builtins that does not
- begin with __builtin. */
-#undef DEF_EXT_FRONT_END_LIB_BUILTIN
-#define DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
- true, true, true, ATTRS, true)
-
-/* If SMALL_STACK is defined, then `alloca' is only defined in its
- `__builtin' form. */
-#if SMALL_STACK
-DEF_FALLBACK_BUILTIN(BUILT_IN_ALLOCA,
- "__builtin_alloca",
- BT_FN_PTR_SIZE,
- ATTR_MALLOC_NOTHROW_LIST)
-#else
-DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA,
- "__builtin_alloca",
- BT_FN_PTR_SIZE,
- ATTR_MALLOC_NOTHROW_LIST)
-#endif
-
-DEF_LIB_BUILTIN(BUILT_IN_ABS,
- "__builtin_abs",
- BT_FN_INT_INT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_LIB_BUILTIN(BUILT_IN_LABS,
- "__builtin_labs",
- BT_FN_LONG_LONG,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_LIB_BUILTIN(BUILT_IN_FABS,
- "__builtin_fabs",
- BT_FN_DOUBLE_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_FABSF,
- "__builtin_fabsf",
- BT_FN_FLOAT_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_FABSL,
- "__builtin_fabsl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_LIB_BUILTIN(BUILT_IN_FLOOR,
- "__builtin_floor",
- BT_FN_DOUBLE_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORF,
- "__builtin_floorf",
- BT_FN_FLOAT_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORL,
- "__builtin_floorl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_LIB_BUILTIN(BUILT_IN_CEIL,
- "__builtin_ceil",
- BT_FN_DOUBLE_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILF,
- "__builtin_ceilf",
- BT_FN_FLOAT_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILL,
- "__builtin_ceill",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_C99_BUILTIN(BUILT_IN_ROUND,
- "__builtin_round",
- BT_FN_DOUBLE_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_ROUNDF,
- "__builtin_roundf",
- BT_FN_FLOAT_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_ROUNDL,
- "__builtin_roundl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_C99_BUILTIN(BUILT_IN_TRUNC,
- "__builtin_trunc",
- BT_FN_DOUBLE_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_TRUNCF,
- "__builtin_truncf",
- BT_FN_FLOAT_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_TRUNCL,
- "__builtin_truncl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_C99_BUILTIN(BUILT_IN_NEARBYINT,
- "__builtin_nearbyint",
- BT_FN_DOUBLE_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_NEARBYINTF,
- "__builtin_nearbyintf",
- BT_FN_FLOAT_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_NEARBYINTL,
- "__builtin_nearbyintl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_C99_BUILTIN(BUILT_IN_LLABS,
- "__builtin_llabs",
- BT_FN_LONGLONG_LONGLONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_IMAXABS,
- "__builtin_imaxabs",
- BT_FN_INTMAX_INTMAX,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CONJ,
- "__builtin_conj",
- BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CONJF,
- "__builtin_conjf",
- BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CONJL,
- "__builtin_conjl",
- BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CREAL,
- "__builtin_creal",
- BT_FN_DOUBLE_COMPLEX_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CREALF,
- "__builtin_crealf",
- BT_FN_FLOAT_COMPLEX_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CREALL,
- "__builtin_creall",
- BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CIMAG,
- "__builtin_cimag",
- BT_FN_DOUBLE_COMPLEX_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CIMAGF,
- "__builtin_cimagf",
- BT_FN_FLOAT_COMPLEX_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CIMAGL,
- "__builtin_cimagl",
- BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CABS,
- "__builtin_cabs",
- BT_FN_DOUBLE_COMPLEX_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CABSF,
- "__builtin_cabsf",
- BT_FN_FLOAT_COMPLEX_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN_CABSL,
- "__builtin_cabsl",
- BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-/* The system prototypes for `bzero', 'bcopy' and `bcmp' functions
- have many variations, so don't specify parameters to avoid
- conflicts. The expand_* functions check the argument types anyway.
- In addition, these functions have traditionally accepted NULL
- pointers when the length parameter is zero, so don't apply
- attribute "nonnull". */
-DEF_BUILTIN (BUILT_IN_BZERO,
- "__builtin_bzero",
- BUILT_IN_NORMAL,
- BT_FN_VOID_PTR_SIZE,
- BT_FN_VOID_VAR,
- true, true, true,
- ATTR_NOTHROW_LIST, false)
-DEF_BUILTIN (BUILT_IN_BCOPY,
- "__builtin_bcopy",
- BUILT_IN_NORMAL,
- BT_FN_VOID_CONST_PTR_PTR_SIZE,
- BT_FN_VOID_VAR,
- true, true, true,
- ATTR_NOTHROW_LIST, false)
-DEF_BUILTIN (BUILT_IN_BCMP,
- "__builtin_bcmp",
- BUILT_IN_NORMAL,
- BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
- BT_FN_INT_VAR,
- true, true, true,
- ATTR_PURE_NOTHROW_LIST, false)
-
-DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
- "__builtin_ffs",
- BT_FN_INT_INT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_CLZ,
- "__builtin_clz",
- BT_FN_INT_INT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_CTZ,
- "__builtin_ctz",
- BT_FN_INT_INT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_POPCOUNT,
- "__builtin_popcount",
- BT_FN_INT_INT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_PARITY,
- "__builtin_parity",
- BT_FN_INT_INT,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_GCC_BUILTIN(BUILT_IN_FFSL,
- "__builtin_ffsl",
- BT_FN_INT_LONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_CLZL,
- "__builtin_clzl",
- BT_FN_INT_LONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_CTZL,
- "__builtin_ctzl",
- BT_FN_INT_LONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTL,
- "__builtin_popcountl",
- BT_FN_INT_LONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_PARITYL,
- "__builtin_parityl",
- BT_FN_INT_LONG,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_EXT_LIB_BUILTIN(BUILT_IN_FFSLL,
- "__builtin_ffsll",
- BT_FN_INT_LONGLONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_CLZLL,
- "__builtin_clzll",
- BT_FN_INT_LONGLONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_CTZLL,
- "__builtin_ctzll",
- BT_FN_INT_LONGLONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTLL,
- "__builtin_popcountll",
- BT_FN_INT_LONGLONG,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_PARITYLL,
- "__builtin_parityll",
- BT_FN_INT_LONGLONG,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX,
- "__builtin_index",
- BT_FN_STRING_CONST_STRING_INT,
- ATTR_PURE_NOTHROW_NONNULL_1)
-DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
- "__builtin_rindex",
- BT_FN_STRING_CONST_STRING_INT,
- ATTR_PURE_NOTHROW_NONNULL_1)
-
-DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
- "__builtin_memcpy",
- BT_FN_PTR_PTR_CONST_PTR_SIZE,
- ATTR_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_MEMMOVE,
- "__builtin_memmove",
- BT_FN_PTR_PTR_CONST_PTR_SIZE,
- ATTR_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
- "__builtin_memcmp",
- BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
- ATTR_PURE_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
- "__builtin_memset",
- BT_FN_PTR_PTR_INT_SIZE,
- ATTR_NOTHROW_NONNULL_1)
-DEF_EXT_LIB_BUILTIN(BUILT_IN_MEMPCPY,
- "__builtin_mempcpy",
- BT_FN_PTR_PTR_CONST_PTR_SIZE,
- ATTR_NOTHROW_NONNULL_1_2)
-
-DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
- "__builtin_strcat",
- BT_FN_STRING_STRING_CONST_STRING,
- ATTR_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
- "__builtin_strncat",
- BT_FN_STRING_STRING_CONST_STRING_SIZE,
- ATTR_NOTHROW_NONNULL_1_2)
-DEF_EXT_LIB_BUILTIN(BUILT_IN_STPCPY,
- "__builtin_stpcpy",
- BT_FN_STRING_STRING_CONST_STRING,
- ATTR_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
- "__builtin_strcpy",
- BT_FN_STRING_STRING_CONST_STRING,
- ATTR_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
- "__builtin_strncpy",
- BT_FN_STRING_STRING_CONST_STRING_SIZE,
- ATTR_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
- "__builtin_strcmp",
- BT_FN_INT_CONST_STRING_CONST_STRING,
- ATTR_PURE_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRNCMP,
- "__builtin_strncmp",
- BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
- ATTR_PURE_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRLEN,
- "__builtin_strlen",
- BT_FN_SIZE_CONST_STRING,
- ATTR_PURE_NOTHROW_NONNULL_1)
-DEF_LIB_BUILTIN(BUILT_IN_STRSTR,
- "__builtin_strstr",
- BT_FN_STRING_CONST_STRING_CONST_STRING,
- ATTR_PURE_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRPBRK,
- "__builtin_strpbrk",
- BT_FN_STRING_CONST_STRING_CONST_STRING,
- ATTR_PURE_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRSPN,
- "__builtin_strspn",
- BT_FN_SIZE_CONST_STRING_CONST_STRING,
- ATTR_PURE_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRCSPN,
- "__builtin_strcspn",
- BT_FN_SIZE_CONST_STRING_CONST_STRING,
- ATTR_PURE_NOTHROW_NONNULL_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_STRCHR,
- "__builtin_strchr",
- BT_FN_STRING_CONST_STRING_INT,
- ATTR_PURE_NOTHROW_NONNULL_1)
-DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
- "__builtin_strrchr",
- BT_FN_STRING_CONST_STRING_INT,
- ATTR_PURE_NOTHROW_NONNULL_1)
-
-DEF_LIB_BUILTIN(BUILT_IN_SQRT,
- "__builtin_sqrt",
- BT_FN_DOUBLE_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_LIB_BUILTIN(BUILT_IN_SIN,
- "__builtin_sin",
- BT_FN_DOUBLE_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_LIB_BUILTIN(BUILT_IN_COS,
- "__builtin_cos",
- BT_FN_DOUBLE_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_LIB_BUILTIN(BUILT_IN_EXP,
- "__builtin_exp",
- BT_FN_DOUBLE_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_LIB_BUILTIN(BUILT_IN_LOG,
- "__builtin_log",
- BT_FN_DOUBLE_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_LIB_BUILTIN(BUILT_IN_TAN,
- "__builtin_tan",
- BT_FN_DOUBLE_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_LIB_BUILTIN(BUILT_IN_ATAN,
- "__builtin_atan",
- BT_FN_DOUBLE_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_LIB_BUILTIN(BUILT_IN_POW,
- "__builtin_pow",
- BT_FN_DOUBLE_DOUBLE_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_LIB_BUILTIN(BUILT_IN_ATAN2,
- "__builtin_atan2",
- BT_FN_DOUBLE_DOUBLE_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_LIB_BUILTIN(BUILT_IN_FMOD,
- "__builtin_fmod",
- BT_FN_DOUBLE_DOUBLE_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTF,
- "__builtin_sqrtf",
- BT_FN_FLOAT_FLOAT,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_SINF,
- "__builtin_sinf",
- BT_FN_FLOAT_FLOAT,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_COSF,
- "__builtin_cosf",
- BT_FN_FLOAT_FLOAT,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPF,
- "__builtin_expf",
- BT_FN_FLOAT_FLOAT,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGF,
- "__builtin_logf",
- BT_FN_FLOAT_FLOAT,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_TANF,
- "__builtin_tanf",
- BT_FN_FLOAT_FLOAT,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_ATANF,
- "__builtin_atanf",
- BT_FN_FLOAT_FLOAT,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_POWF,
- "__builtin_powf",
- BT_FN_FLOAT_FLOAT_FLOAT,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2F,
- "__builtin_atan2f",
- BT_FN_FLOAT_FLOAT_FLOAT,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_FMODF,
- "__builtin_fmodf",
- BT_FN_FLOAT_FLOAT_FLOAT,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTL,
- "__builtin_sqrtl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_SINL,
- "__builtin_sinl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_COSL,
- "__builtin_cosl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPL,
- "__builtin_expl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGL,
- "__builtin_logl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_TANL,
- "__builtin_tanl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_ATANL,
- "__builtin_atanl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE,
- flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST)
-DEF_C99_C90RES_BUILTIN(BUILT_IN_POWL,
- "__builtin_powl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2L,
- "__builtin_atan2l",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-DEF_C99_C90RES_BUILTIN(BUILT_IN_FMODL,
- "__builtin_fmodl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
- flag_errno_math ? ATTR_NOTHROW_LIST
- : (flag_unsafe_math_optimizations
- ? ATTR_CONST_NOTHROW_LIST
- : ATTR_PURE_NOTHROW_LIST))
-
-DEF_GCC_BUILTIN(BUILT_IN_INF,
- "__builtin_inf",
- BT_FN_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_INFF,
- "__builtin_inff",
- BT_FN_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_INFL,
- "__builtin_infl",
- BT_FN_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_GCC_BUILTIN(BUILT_IN_HUGE_VAL,
- "__builtin_huge_val",
- BT_FN_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALF,
- "__builtin_huge_valf",
- BT_FN_FLOAT,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALL,
- "__builtin_huge_vall",
- BT_FN_LONG_DOUBLE,
- ATTR_CONST_NOTHROW_LIST)
-
-DEF_LIB_BUILTIN(BUILT_IN_NAN,
- "__builtin_nan",
- BT_FN_DOUBLE_CONST_STRING,
- ATTR_CONST_NOTHROW_NONNULL_1)
-DEF_LIB_BUILTIN(BUILT_IN_NANF,
- "__builtin_nanf",
- BT_FN_FLOAT_CONST_STRING,
- ATTR_CONST_NOTHROW_NONNULL_1)
-DEF_LIB_BUILTIN(BUILT_IN_NANL,
- "__builtin_nanl",
- BT_FN_LONG_DOUBLE_CONST_STRING,
- ATTR_CONST_NOTHROW_NONNULL_1)
-
-DEF_LIB_BUILTIN(BUILT_IN_NANS,
- "__builtin_nans",
- BT_FN_DOUBLE_CONST_STRING,
- ATTR_CONST_NOTHROW_NONNULL_1)
-DEF_LIB_BUILTIN(BUILT_IN_NANSF,
- "__builtin_nansf",
- BT_FN_FLOAT_CONST_STRING,
- ATTR_CONST_NOTHROW_NONNULL_1)
-DEF_LIB_BUILTIN(BUILT_IN_NANSL,
- "__builtin_nansl",
- BT_FN_LONG_DOUBLE_CONST_STRING,
- ATTR_CONST_NOTHROW_NONNULL_1)
-
-DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
- "__builtin_saveregs",
- BT_FN_PTR_VAR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
- "__builtin_classify_type",
- BT_FN_INT_VAR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
- "__builtin_next_arg",
- BT_FN_PTR_VAR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
- "__builtin_args_info",
- BT_FN_INT_INT,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
- "__builtin_constant_p",
- BT_FN_INT_VAR,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
- "__builtin_frame_address",
- BT_FN_PTR_UNSIGNED,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
- "__builtin_return_address",
- BT_FN_PTR_UNSIGNED,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
- "__builtin_aggregate_incoming_address",
- BT_FN_PTR_VAR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
- "__builtin_apply_args",
- BT_FN_PTR_VAR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_APPLY,
- "__builtin_apply",
- BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_RETURN,
- "__builtin_return",
- BT_FN_VOID_PTR,
- ATTR_NORETURN_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
- "__builtin_setjmp",
- BT_FN_INT_PTR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
- "__builtin_longjmp",
- BT_FN_VOID_PTR_INT,
- ATTR_NORETURN_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_TRAP,
- "__builtin_trap",
- BT_FN_VOID,
- ATTR_NORETURN_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
- "__builtin_prefetch",
- BT_FN_VOID_CONST_PTR_VAR,
- ATTR_NULL)
-
-/* stdio.h builtins (without FILE *). */
-
-DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF,
- "__builtin_printf",
- BT_FN_INT_CONST_STRING_VAR,
- ATTR_FORMAT_PRINTF_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_PUTCHAR,
- "__builtin_putchar",
- BT_FN_INT_INT,
- ATTR_NOTHROW_LIST)
-DEF_LIB_BUILTIN(BUILT_IN_PUTS,
- "__builtin_puts",
- BT_FN_INT_CONST_STRING,
- ATTR_NOTHROW_NONNULL_1)
-DEF_C99_BUILTIN(BUILT_IN_SNPRINTF,
- "__builtin_snprintf",
- BT_FN_INT_STRING_SIZE_CONST_STRING_VAR,
- ATTR_FORMAT_PRINTF_3_4)
-DEF_LIB_BUILTIN(BUILT_IN_SPRINTF,
- "__builtin_sprintf",
- BT_FN_INT_STRING_CONST_STRING_VAR,
- ATTR_FORMAT_PRINTF_2_3)
-DEF_LIB_BUILTIN(BUILT_IN_SCANF,
- "__builtin_scanf",
- BT_FN_INT_CONST_STRING_VAR,
- ATTR_FORMAT_SCANF_1_2)
-DEF_LIB_BUILTIN(BUILT_IN_SSCANF,
- "__builtin_sscanf",
- BT_FN_INT_CONST_STRING_CONST_STRING_VAR,
- ATTR_FORMAT_SCANF_2_3)
-DEF_LIB_BUILTIN(BUILT_IN_VPRINTF,
- "__builtin_vprintf",
- BT_FN_INT_CONST_STRING_VALIST_ARG,
- ATTR_FORMAT_PRINTF_1_0)
-DEF_C99_BUILTIN(BUILT_IN_VSCANF,
- "__builtin_vscanf",
- BT_FN_INT_CONST_STRING_VALIST_ARG,
- ATTR_FORMAT_SCANF_1_0)
-DEF_C99_BUILTIN(BUILT_IN_VSSCANF,
- "__builtin_vsscanf",
- BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
- ATTR_FORMAT_SCANF_2_0)
-DEF_C99_BUILTIN(BUILT_IN_VSNPRINTF,
- "__builtin_vsnprintf",
- BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
- ATTR_FORMAT_PRINTF_3_0)
-DEF_LIB_BUILTIN(BUILT_IN_VSPRINTF,
- "__builtin_vsprintf",
- BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
- ATTR_FORMAT_PRINTF_2_0)
-
-
-/* stdio.h builtins (with FILE *). */
-
-/* Declare the __builtin_ style with arguments and the regular style
- without them. We rely on stdio.h to supply the arguments for the
- regular style declaration since we had to use void* instead of
- FILE* in the __builtin_ prototype supplied here. */
-
-DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
- "__builtin_fputc",
- BT_FN_INT_INT_PTR,
- ATTR_NOTHROW_NONNULL_2)
-DEF_BUILTIN (BUILT_IN_FPUTS,
- "__builtin_fputs",
- BUILT_IN_NORMAL,
- BT_FN_INT_CONST_STRING_PTR,
- BT_FN_INT_VAR,
- true, true, false, ATTR_NOTHROW_NONNULL_1_2, true)
-DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
- "__builtin_fwrite",
- BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
- ATTR_NOTHROW_NONNULL_1_4)
-DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
- "__builtin_fprintf",
- BT_FN_INT_PTR_CONST_STRING_VAR,
- ATTR_FORMAT_PRINTF_2_3)
-
-/* stdio unlocked builtins (without FILE *). */
-
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
- "__builtin_putchar_unlocked",
- BT_FN_INT_INT, ATTR_NOTHROW_LIST)
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
- "__builtin_puts_unlocked",
- BT_FN_INT_CONST_STRING, ATTR_NOTHROW_NONNULL_1)
-DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
- "__builtin_printf_unlocked",
- BT_FN_INT_CONST_STRING_VAR,
- ATTR_FORMAT_PRINTF_1_2)
-
-/* stdio unlocked builtins (with FILE *). */
-
-/* Declare the __builtin_ style with arguments and the regular style
- without them. We rely on stdio.h to supply the arguments for the
- regular style declaration since we had to use void* instead of
- FILE* in the __builtin_ prototype supplied here. */
-
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
- "__builtin_fputc_unlocked",
- BT_FN_INT_INT_PTR, ATTR_NOTHROW_NONNULL_2)
-DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
- "__builtin_fputs_unlocked",
- BUILT_IN_NORMAL,
- BT_FN_INT_CONST_STRING_PTR,
- BT_FN_INT_VAR,
- true, true, true, ATTR_NOTHROW_NONNULL_1_2, true)
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
- "__builtin_fwrite_unlocked",
- BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, ATTR_NOTHROW_NONNULL_1_4)
-DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
- "__builtin_fprintf_unlocked",
- BT_FN_INT_PTR_CONST_STRING_VAR,
- ATTR_FORMAT_PRINTF_2_3)
-
- /* ISO C99 floating point unordered comparisons. */
-DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
- "__builtin_isgreater",
- BT_FN_INT_VAR,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
- "__builtin_isgreaterequal",
- BT_FN_INT_VAR,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
- "__builtin_isless",
- BT_FN_INT_VAR,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
- "__builtin_islessequal",
- BT_FN_INT_VAR,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
- "__builtin_islessgreater",
- BT_FN_INT_VAR,
- ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
- "__builtin_isunordered",
- BT_FN_INT_VAR,
- ATTR_CONST_NOTHROW_LIST)
-
-/* Various hooks for the DWARF 2 __throw routine. */
-DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
- "__builtin_unwind_init",
- BT_FN_VOID,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
- "__builtin_dwarf_cfa",
- BT_FN_PTR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_DWARF_SP_COLUMN,
- "__builtin_dwarf_sp_column",
- BT_FN_UNSIGNED,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
- "__builtin_init_dwarf_reg_size_table",
- BT_FN_VOID_PTR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
- "__builtin_frob_return_addr",
- BT_FN_PTR_PTR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
- "__builtin_extract_return_addr",
- BT_FN_PTR_PTR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
- "__builtin_eh_return",
- BT_FN_VOID_PTRMODE_PTR,
- ATTR_NORETURN_NOTHROW_LIST)
-DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
- "__builtin_eh_return_data_regno",
- BT_FN_INT_INT,
- ATTR_NULL)
-
-/* Variable argument list (stdarg.h) support */
-DEF_GCC_BUILTIN(BUILT_IN_VA_START,
- "__builtin_va_start",
- BT_FN_VOID_VALIST_REF_VAR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
- "__builtin_stdarg_start",
- BT_FN_VOID_VALIST_REF_VAR,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_VA_END,
- "__builtin_va_end",
- BT_FN_VOID_VALIST_REF,
- ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
- "__builtin_va_copy",
- BT_FN_VOID_VALIST_REF_VALIST_ARG,
- ATTR_NULL)
-
-DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
- "__builtin_expect",
- BT_FN_LONG_LONG_LONG,
- ATTR_NULL)
-
-/* Declare abort, exit, _exit and _Exit */
-DEF_LIB_BUILTIN(BUILT_IN_ABORT,
- "__builtin_abort",
- BT_FN_VOID,
- ATTR_NORETURN_NOTHROW_LIST)
-DEF_LIB_BUILTIN(BUILT_IN_EXIT,
- "__builtin_exit",
- BT_FN_VOID_INT,
- ATTR_NORETURN_NOTHROW_LIST)
-DEF_EXT_LIB_BUILTIN(BUILT_IN__EXIT,
- "__builtin__exit",
- BT_FN_VOID_INT,
- ATTR_NORETURN_NOTHROW_LIST)
-DEF_C99_BUILTIN(BUILT_IN__EXIT2,
- "__builtin__Exit",
- BT_FN_VOID_INT,
- ATTR_NORETURN_NOTHROW_LIST)
-
-/* Declare malloc, calloc and strdup. */
-DEF_LIB_BUILTIN(BUILT_IN_MALLOC,
- "__builtin_malloc",
- BT_FN_PTR_SIZE,
- ATTR_MALLOC_NOTHROW_LIST)
-
-DEF_LIB_BUILTIN(BUILT_IN_CALLOC,
- "__builtin_calloc",
- BT_FN_PTR_SIZE_SIZE,
- ATTR_MALLOC_NOTHROW_LIST)
-
-DEF_EXT_LIB_BUILTIN(BUILT_IN_STRDUP,
- "__builtin_strdup",
- BT_FN_STRING_CONST_STRING,
- ATTR_MALLOC_NOTHROW_NONNULL_1)
-
+/* Define an attribute list for math functions that are normally
+ "impure" because some of them may write into global memory for
+ `errno'. If !flag_errno_math they are instead "const". */
+#undef ATTR_MATHFN_ERRNO
+#define ATTR_MATHFN_ERRNO (flag_errno_math ? \
+ ATTR_NOTHROW_LIST : ATTR_CONST_NOTHROW_LIST)
+
+/* Define an attribute list for math functions that are normally
+ "pure" but if flag_unsafe_math_optimizations is set they are
+ instead "const". This distinction accounts for the fact that some
+ math functions check the rounding mode which is akin to examing
+ global memory. In "unsafe" mode we can be less careful. */
+#undef ATTR_MATHFN_FPROUNDING
+#define ATTR_MATHFN_FPROUNDING (flag_unsafe_math_optimizations ? \
+ ATTR_CONST_NOTHROW_LIST : ATTR_PURE_NOTHROW_LIST)
+
+/* Define an attribute list for math functions that are normally
+ "impure" because some of them may write into global memory for
+ `errno'. If !flag_errno_math, we can possibly use "pure" or
+ "const" depending on whether we care about FP rounding. */
+#undef ATTR_MATHFN_FPROUNDING_ERRNO
+#define ATTR_MATHFN_FPROUNDING_ERRNO (flag_errno_math ? \
+ ATTR_NOTHROW_LIST : ATTR_MATHFN_FPROUNDING)
+
+/* Define an attribute list for math functions that need to mind FP
+ rounding, but because they store into memory they are never "const"
+ or "pure". Use of this macro is mainly for documentation and
+ maintenance purposes. */
+#undef ATTR_MATHFN_FPROUNDING_STORE
+#define ATTR_MATHFN_FPROUNDING_STORE ATTR_NOTHROW_LIST
+
+/* Category: math builtins. */
+DEF_LIB_BUILTIN (BUILT_IN_ACOS, "acos", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ACOSF, "acosf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ACOSH, "acosh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ACOSHF, "acoshf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ACOSHL, "acoshl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ACOSL, "acosl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_ASIN, "asin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ASINF, "asinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ASINH, "asinh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_ASINHF, "asinhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_ASINHL, "asinhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ASINL, "asinl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_ATAN, "atan", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_LIB_BUILTIN (BUILT_IN_ATAN2, "atan2", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ATAN2F, "atan2f", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ATAN2L, "atan2l", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ATANF, "atanf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_ATANH, "atanh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ATANHF, "atanhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ATANHL, "atanhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_ATANL, "atanl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CBRT, "cbrt", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CBRTF, "cbrtf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CBRTL, "cbrtl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_LIB_BUILTIN (BUILT_IN_CEIL, "ceil", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_CEILF, "ceilf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_CEILL, "ceill", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_COPYSIGN, "copysign", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_COPYSIGNF, "copysignf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_COPYSIGNL, "copysignl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN (BUILT_IN_COS, "cos", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_COSF, "cosf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_LIB_BUILTIN (BUILT_IN_COSH, "cosh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_COSHF, "coshf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_COSHL, "coshl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_COSL, "cosl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_DREM, "drem", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_DREMF, "dremf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_DREML, "dreml", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERF, "erf", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_ERFC, "erfc", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFCF, "erfcf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFCL, "erfcl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFF, "erff", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_ERFL, "erfl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_LIB_BUILTIN (BUILT_IN_EXP, "exp", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10, "exp10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10F, "exp10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10L, "exp10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_EXP2, "exp2", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_EXP2F, "exp2f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_EXP2L, "exp2l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_EXPF, "expf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_EXPL, "expl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_EXPM1, "expm1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_EXPM1F, "expm1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_EXPM1L, "expm1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_FABS, "fabs", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FABSF, "fabsf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FABSL, "fabsl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_FDIM, "fdim", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_FDIMF, "fdimf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_FDIML, "fdiml", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_FLOOR, "floor", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORF, "floorf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORL, "floorl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_FMA, "fma", BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_FMAF, "fmaf", BT_FN_FLOAT_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_FMAL, "fmal", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_FMAX, "fmax", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_FMAXF, "fmaxf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_FMAXL, "fmaxl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_FMIN, "fmin", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_FMINF, "fminf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_FMINL, "fminl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN (BUILT_IN_FMOD, "fmod", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODF, "fmodf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODL, "fmodl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_FREXP, "frexp", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPF, "frexpf", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPL, "frexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_GCC_BUILTIN (BUILT_IN_HUGE_VAL, "huge_val", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALF, "huge_valf", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALL, "huge_vall", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_HYPOT, "hypot", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_HYPOTF, "hypotf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_HYPOTL, "hypotl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ILOGB, "ilogb", BT_FN_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ILOGBF, "ilogbf", BT_FN_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ILOGBL, "ilogbl", BT_FN_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_GCC_BUILTIN (BUILT_IN_INF, "inf", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_INFF, "inff", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_INFL, "infl", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J0, "j0", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J0F, "j0f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J0L, "j0l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J1, "j1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J1F, "j1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J1L, "j1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_JN, "jn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_JNF, "jnf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_JNL, "jnl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_LDEXP, "ldexp", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPF, "ldexpf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPL, "ldexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LGAMMA, "lgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LGAMMAF, "lgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LGAMMAL, "lgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LLRINT, "llrint", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LLRINTF, "llrintf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LLRINTL, "llrintl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LLROUND, "llround", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LLROUNDF, "llroundf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LLROUNDL, "llroundl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_LOG, "log", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_LOG10, "log10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_LOG10F, "log10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_LOG10L, "log10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOG1P, "log1p", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOG1PF, "log1pf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOG1PL, "log1pl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOG2, "log2", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOG2F, "log2f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOG2L, "log2l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOGB, "logb", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOGBF, "logbf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LOGBL, "logbl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_LOGF, "logf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_LOGL, "logl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LRINT, "lrint", BT_FN_LONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LRINTF, "lrintf", BT_FN_LONG_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LRINTL, "lrintl", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LROUND, "lround", BT_FN_LONG_DOUBLE, ATTR_MATHFN_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LROUNDF, "lroundf", BT_FN_LONG_FLOAT, ATTR_MATHFN_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LROUNDL, "lroundl", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_MODF, "modf", BT_FN_DOUBLE_DOUBLE_DOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFF, "modff", BT_FN_FLOAT_FLOAT_FLOATPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFL, "modfl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_LIB_BUILTIN (BUILT_IN_NAN, "nan", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_NANF, "nanf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_NANL, "nanl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_NANS, "nans", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_NANSF, "nansf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_NANSL, "nansl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
+DEF_C99_BUILTIN (BUILT_IN_NEARBYINT, "nearbyint", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_NEARBYINTF, "nearbyintf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_NEARBYINTL, "nearbyintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_NEXTAFTER, "nextafter", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_NEXTAFTERF, "nextafterf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_NEXTAFTERL, "nextafterl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_NEXTTOWARD, "nexttoward", BT_FN_DOUBLE_DOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_NEXTTOWARDF, "nexttowardf", BT_FN_FLOAT_FLOAT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_NEXTTOWARDL, "nexttowardl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_POW, "pow", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10, "pow10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10F, "pow10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10L, "pow10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_POWF, "powf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_POWL, "powl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_REMAINDER, "remainder", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_REMAINDERF, "remainderf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_REMAINDERL, "remainderl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_REMQUO, "remquo", BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_BUILTIN (BUILT_IN_REMQUOF, "remquof", BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_BUILTIN (BUILT_IN_REMQUOL, "remquol", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_BUILTIN (BUILT_IN_RINT, "rint", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_RINTF, "rintf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_RINTL, "rintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ROUND, "round", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_ROUNDF, "roundf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_ROUNDL, "roundl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SCALB, "scalb", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SCALBF, "scalbf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SCALBL, "scalbl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_SCALBLN, "scalbln", BT_FN_DOUBLE_DOUBLE_LONG, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_SCALBLNF, "scalblnf", BT_FN_FLOAT_FLOAT_LONG, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_SCALBLNL, "scalblnl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONG, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_SCALBN, "scalbn", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_SCALBNF, "scalbnf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_SCALBNL, "scalbnl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICAND, "significand", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDF, "significandf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDL, "significandl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_SIN, "sin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOS, "sincos", BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOSF, "sincosf", BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOSL, "sincosl", BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_SINF, "sinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_LIB_BUILTIN (BUILT_IN_SINH, "sinh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_SINHF, "sinhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_SINHL, "sinhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_SINL, "sinl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_LIB_BUILTIN (BUILT_IN_SQRT, "sqrt", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_SQRTF, "sqrtf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_SQRTL, "sqrtl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_LIB_BUILTIN (BUILT_IN_TAN, "tan", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_TANF, "tanf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_LIB_BUILTIN (BUILT_IN_TANH, "tanh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_TANHF, "tanhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_TANHL, "tanhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_C90RES_BUILTIN (BUILT_IN_TANL, "tanl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_TGAMMA, "tgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_TGAMMAF, "tgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_TGAMMAL, "tgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_TRUNC, "trunc", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_TRUNCF, "truncf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_TRUNCL, "truncl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0, "y0", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0F, "y0f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0L, "y0l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1, "y1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1F, "y1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1L, "y1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_YN, "yn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_YNF, "ynf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_YNL, "ynl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+
+/* Category: _Complex math builtins. */
+/* The C99 clog function conflicts with C++ iostreams clog, see
+ http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00510.html */
+DEF_C99_BUILTIN (BUILT_IN_CABS, "cabs", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CABSF, "cabsf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CABSL, "cabsl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CACOS, "cacos", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CACOSF, "cacosf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CACOSH, "cacosh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CACOSHF, "cacoshf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CACOSHL, "cacoshl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CACOSL, "cacosl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CARG, "carg", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CARGF, "cargf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CARGL, "cargl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CASIN, "casin", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CASINF, "casinf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CASINH, "casinh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CASINHF, "casinhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CASINHL, "casinhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CASINL, "casinl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CATAN, "catan", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CATANF, "catanf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CATANH, "catanh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CATANHF, "catanhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CATANHL, "catanhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CATANL, "catanl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CCOS, "ccos", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CCOSF, "ccosf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CCOSH, "ccosh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CCOSHF, "ccoshf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CCOSHL, "ccoshl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CCOSL, "ccosl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CEXP, "cexp", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CEXPF, "cexpf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CEXPL, "cexpl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CIMAG, "cimag", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CIMAGF, "cimagf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CIMAGL, "cimagl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+/*DEF_C99_BUILTIN (BUILT_IN_CLOG, "clog", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)*/
+/*DEF_C99_BUILTIN (BUILT_IN_CLOGF, "clogf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)*/
+/*DEF_C99_BUILTIN (BUILT_IN_CLOGL, "clogl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)*/
+DEF_C99_BUILTIN (BUILT_IN_CONJ, "conj", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CONJF, "conjf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CONJL, "conjl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CPOW, "cpow", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CPOWF, "cpowf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CPOWL, "cpowl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CPROJ, "cproj", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CPROJF, "cprojf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CPROJL, "cprojl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CREAL, "creal", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CREALF, "crealf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CREALL, "creall", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_CSIN, "csin", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSINF, "csinf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSINH, "csinh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSINHF, "csinhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSINHL, "csinhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSINL, "csinl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSQRT, "csqrt", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSQRTF, "csqrtf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CSQRTL, "csqrtl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CTAN, "ctan", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CTANF, "ctanf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CTANH, "ctanh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CTANHF, "ctanhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CTANHL, "ctanhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_CTANL, "ctanl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+
+/* Category: string/memory builtins. */
+/* bcmp, bcopy and bzero have traditionally accepted NULL pointers
+ when the length parameter is zero, so don't apply attribute "nonnull". */
+DEF_EXT_LIB_BUILTIN (BUILT_IN_BCMP, "bcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_BCOPY, "bcopy", BT_FN_VOID_CONST_PTR_PTR_SIZE, ATTR_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_BZERO, "bzero", BT_FN_VOID_PTR_SIZE, ATTR_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_1_2)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_NOTHROW_NONNULL_1)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRNCPY, "strncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRPBRK, "strpbrk", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRRCHR, "strrchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_STRSPN, "strspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_STRSTR, "strstr", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2)
+
+/* Category: stdio builtins. */
+DEF_LIB_BUILTIN (BUILT_IN_FPRINTF, "fprintf", BT_FN_INT_PTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_FPRINTF_UNLOCKED, "fprintf_unlocked", BT_FN_INT_PTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3)
+DEF_LIB_BUILTIN (BUILT_IN_FPUTC, "fputc", BT_FN_INT_INT_PTR, ATTR_NOTHROW_NONNULL_2)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTC_UNLOCKED, "fputc_unlocked", BT_FN_INT_INT_PTR, ATTR_NOTHROW_NONNULL_2)
+DEF_LIB_BUILTIN (BUILT_IN_FPUTS, "fputs", BT_FN_INT_CONST_STRING_PTR, ATTR_NOTHROW_NONNULL_1_2)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTS_UNLOCKED, "fputs_unlocked", BT_FN_INT_CONST_STRING_PTR, ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_FSCANF, "fscanf", BT_FN_INT_PTR_CONST_STRING_VAR, ATTR_FORMAT_SCANF_2_3)
+DEF_LIB_BUILTIN (BUILT_IN_FWRITE, "fwrite", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, ATTR_NOTHROW_NONNULL_1_4)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_FWRITE_UNLOCKED, "fwrite_unlocked", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, ATTR_NOTHROW_NONNULL_1_4)
+DEF_LIB_BUILTIN (BUILT_IN_PRINTF, "printf", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_1_2)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_PRINTF_UNLOCKED, "printf_unlocked", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_1_2)
+DEF_LIB_BUILTIN (BUILT_IN_PUTCHAR, "putchar", BT_FN_INT_INT, ATTR_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTCHAR_UNLOCKED, "putchar_unlocked", BT_FN_INT_INT, ATTR_NOTHROW_LIST)
+DEF_LIB_BUILTIN (BUILT_IN_PUTS, "puts", BT_FN_INT_CONST_STRING, ATTR_NOTHROW_NONNULL_1)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTS_UNLOCKED, "puts_unlocked", BT_FN_INT_CONST_STRING, ATTR_NOTHROW_NONNULL_1)
+DEF_LIB_BUILTIN (BUILT_IN_SCANF, "scanf", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_SCANF_1_2)
+DEF_C99_BUILTIN (BUILT_IN_SNPRINTF, "snprintf", BT_FN_INT_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_3_4)
+DEF_LIB_BUILTIN (BUILT_IN_SPRINTF, "sprintf", BT_FN_INT_STRING_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3)
+DEF_LIB_BUILTIN (BUILT_IN_SSCANF, "sscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_FORMAT_SCANF_2_3)
+DEF_LIB_BUILTIN (BUILT_IN_VFPRINTF, "vfprintf", BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0)
+DEF_C99_BUILTIN (BUILT_IN_VFSCANF, "vfscanf", BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_2_0)
+DEF_LIB_BUILTIN (BUILT_IN_VPRINTF, "vprintf", BT_FN_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_1_0)
+DEF_C99_BUILTIN (BUILT_IN_VSCANF, "vscanf", BT_FN_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_1_0)
+DEF_C99_BUILTIN (BUILT_IN_VSNPRINTF, "vsnprintf", BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_3_0)
+DEF_LIB_BUILTIN (BUILT_IN_VSPRINTF, "vsprintf", BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0)
+DEF_C99_BUILTIN (BUILT_IN_VSSCANF, "vsscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_2_0)
+
+/* Category: miscellaneous builtins. */
+DEF_LIB_BUILTIN (BUILT_IN_ABORT, "abort", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LIST)
+DEF_LIB_BUILTIN (BUILT_IN_ABS, "abs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_AGGREGATE_INCOMING_ADDRESS, "aggregate_incoming_address", BT_FN_PTR_VAR, ATTR_NULL)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, "alloca", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_APPLY, "apply", BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL)
+DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_CLZL, "clzl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_CLZLL, "clzll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_CONSTANT_P, "constant_p", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_CTZ, "ctz", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_CTZL, "ctzl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_CTZLL, "ctzll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_DCGETTEXT, "dcgettext", BT_FN_STRING_CONST_STRING_CONST_STRING_INT, ATTR_FORMAT_ARG_2)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_DGETTEXT, "dgettext", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_FORMAT_ARG_2)
+DEF_GCC_BUILTIN (BUILT_IN_DWARF_CFA, "dwarf_cfa", BT_FN_PTR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_DWARF_SP_COLUMN, "dwarf_sp_column", BT_FN_UNSIGNED, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN, "eh_return", BT_FN_VOID_PTRMODE_PTR, ATTR_NORETURN_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN_DATA_REGNO, "eh_return_data_regno", BT_FN_INT_INT, ATTR_NULL)
+DEF_LIB_BUILTIN (BUILT_IN_EXIT, "exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_EXPECT, "expect", BT_FN_LONG_LONG_LONG, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_EXTRACT_RETURN_ADDR, "extract_return_addr", BT_FN_PTR_PTR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UNSIGNED, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_FROB_RETURN_ADDR, "frob_return_addr", BT_FN_PTR_PTR, ATTR_NULL)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GETTEXT, "gettext", BT_FN_STRING_CONST_STRING, ATTR_FORMAT_ARG_1)
+DEF_C99_BUILTIN (BUILT_IN_IMAXABS, "imaxabs", BT_FN_INTMAX_INTMAX, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_INIT_DWARF_REG_SIZES, "init_dwarf_reg_size_table", BT_FN_VOID_PTR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_ISGREATER, "isgreater", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_ISGREATEREQUAL, "isgreaterequal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_ISLESS, "isless", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_ISLESSEQUAL, "islessequal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_ISLESSGREATER, "islessgreater", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_ISUNORDERED, "isunordered", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN (BUILT_IN_LABS, "labs", BT_FN_LONG_LONG, ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN_LLABS, "llabs", BT_FN_LONGLONG_LONGLONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_LONGJMP, "longjmp", BT_FN_VOID_PTR_INT, ATTR_NORETURN_NOTHROW_LIST)
+DEF_LIB_BUILTIN (BUILT_IN_MALLOC, "malloc", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_NEXT_ARG, "next_arg", BT_FN_PTR_VAR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_PARITY, "parity", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_PARITYL, "parityl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_PARITYLL, "parityll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_PREFETCH, "prefetch", BT_FN_VOID_CONST_PTR_VAR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_RETURN, "return", BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UNSIGNED, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_SAVEREGS, "saveregs", BT_FN_PTR_VAR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_SETJMP, "setjmp", BT_FN_INT_PTR, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_STDARG_START, "stdarg_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_STRFMON, "strfmon", BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_STRFMON_3_4)
+DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, ATTR_FORMAT_STRFTIME_3_0)
+DEF_GCC_BUILTIN (BUILT_IN_TRAP, "trap", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_UNWIND_INIT, "unwind_init", BT_FN_VOID, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_VA_COPY, "va_copy", BT_FN_VOID_VALIST_REF_VALIST_ARG, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_VA_END, "va_end", BT_FN_VOID_VALIST_REF, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_VA_START, "va_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL)
+DEF_EXT_LIB_BUILTIN (BUILT_IN__EXIT, "_exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
+DEF_C99_BUILTIN (BUILT_IN__EXIT2, "_Exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 49ff8707e27..16a3b77ede9 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -41,10 +41,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h"
#include "tree-inline.h"
#include "c-tree.h"
-/* In order to ensure we use a common subset of valid specifiers
- (between the various C family frontends) in this file, we restrict
- ourselves to the generic specifier set. */
-#undef GCC_DIAG_STYLE
#include "toplev.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */
@@ -104,9 +100,9 @@ cpp_reader *parse_in; /* Declared in c-pragma.h. */
tree long_unsigned_type_node;
tree long_long_unsigned_type_node;
- tree boolean_type_node;
- tree boolean_false_node;
- tree boolean_true_node;
+ tree truthvalue_type_node;
+ tree truthvalue_false_node;
+ tree truthvalue_true_node;
tree ptrdiff_type_node;
@@ -191,10 +187,6 @@ tree c_global_trees[CTI_MAX];
langhook should take care of initialization of this array. */
bool statement_code_p[MAX_TREE_CODES];
-
-/* Nonzero if we can read a PCH file now. */
-
-int allow_pch = 1;
/* Switches common to the C front ends. */
@@ -354,7 +346,25 @@ int warn_format_nonliteral;
int warn_format_security;
-
+/* Zero means that faster, ...NonNil variants of objc_msgSend...
+ calls will be used in ObjC; passing nil receivers to such calls
+ will most likely result in crashes. */
+int flag_nil_receivers = 1;
+
+/* Nonzero means that we will allow new ObjC exception syntax (@throw,
+ @try, etc.) in source code. */
+int flag_objc_exceptions = 0;
+
+/* Nonzero means that code generation will be altered to support
+ "zero-link" execution. This currently affects ObjC only, but may
+ affect other languages in the future. */
+int flag_zero_link = 0;
+
+/* Nonzero means emit an '__OBJC, __image_info' for the current translation
+ unit. It will inform the ObjC runtime that class definition(s) herein
+ contained are to replace one(s) previously loaded. */
+int flag_replace_objc_classes = 0;
+
/* C/ObjC language option variables. */
@@ -380,11 +390,6 @@ int flag_isoc99;
int flag_hosted = 1;
-/* Nonzero means add default format_arg attributes for functions not
- in ISO C. */
-
-int flag_noniso_default_format_attributes = 1;
-
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
@@ -395,6 +400,10 @@ int warn_bad_function_cast;
int warn_traditional;
+/* Nonzero means warn for a declaration found after a statement. */
+
+int warn_declaration_after_statement;
+
/* Nonzero means warn for non-prototype function decls
or non-prototyped defs without previous prototype. */
@@ -421,6 +430,11 @@ int warn_main;
int warn_sequence_point;
+/* Nonzero means warn about uninitialized variable when it is initialized with itself.
+ For example: int i = i;, GCC will not warn about this when warn_init_self is nonzero. */
+
+int warn_init_self;
+
/* Nonzero means to warn about compile-time division by zero. */
int warn_div_by_zero = 1;
@@ -433,6 +447,10 @@ int warn_implicit_int;
int warn_nonnull;
+/* Warn about old-style parameter declaration. */
+
+int warn_old_style_definition;
+
/* ObjC language option variables. */
@@ -568,15 +586,18 @@ int flag_new_for_scope = 1;
int flag_weak = 1;
+/* 0 means we want the preprocessor to not emit line directives for
+ the current working directory. 1 means we want it to do it. -1
+ means we should decide depending on whether debugging information
+ is being emitted or not. */
+
+int flag_working_directory = -1;
+
/* Nonzero to use __cxa_atexit, rather than atexit, to register
destructors for local statics and global objects. */
int flag_use_cxa_atexit = DEFAULT_USE_CXA_ATEXIT;
-/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
-
-int flag_vtable_gc;
-
/* Nonzero means make the default pedwarns warnings instead of errors.
The value of this flag is ignored if -pedantic is specified. */
@@ -770,12 +791,15 @@ static tree handle_vector_size_attribute (tree *, tree, tree, int,
static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *);
static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
static tree handle_cleanup_attribute (tree *, tree, tree, int, bool *);
+static tree handle_warn_unused_result_attribute (tree *, tree, tree, int,
+ bool *);
static tree vector_size_helper (tree, tree);
static void check_function_nonnull (tree, tree);
static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INT);
static bool nonnull_check_p (tree, unsigned HOST_WIDE_INT);
static bool get_nonnull_operand (tree, unsigned HOST_WIDE_INT *);
+static int resort_field_decl_cmp (const void *, const void *);
/* Table of machine-independent attributes common to all C-like languages. */
const struct attribute_spec c_common_attribute_table[] =
@@ -846,6 +870,8 @@ const struct attribute_spec c_common_attribute_table[] =
{ "may_alias", 0, 0, false, true, false, NULL },
{ "cleanup", 1, 1, true, false, false,
handle_cleanup_attribute },
+ { "warn_unused_result", 0, 0, false, true, true,
+ handle_warn_unused_result_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
@@ -878,12 +904,12 @@ c_expand_start_cond (tree cond, int compstmt_count, tree if_stmt)
if (if_stack_space == 0)
{
if_stack_space = 10;
- if_stack = (if_elt *) xmalloc (10 * sizeof (if_elt));
+ if_stack = xmalloc (10 * sizeof (if_elt));
}
else if (if_stack_space == if_stack_pointer)
{
if_stack_space += 10;
- if_stack = (if_elt *) xrealloc (if_stack, if_stack_space * sizeof (if_elt));
+ if_stack = xrealloc (if_stack, if_stack_space * sizeof (if_elt));
}
IF_COND (if_stmt) = cond;
@@ -1071,16 +1097,18 @@ finish_fname_decls (void)
const char *
fname_as_string (int pretty_p)
{
- const char *name = NULL;
-
- if (pretty_p)
- name = (current_function_decl
- ? (*lang_hooks.decl_printable_name) (current_function_decl, 2)
- : "top level");
- else if (current_function_decl && DECL_NAME (current_function_decl))
- name = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
- else
- name = "";
+ const char *name = "top level";
+ int vrb = 2;
+
+ if (! pretty_p)
+ {
+ name = "";
+ vrb = 0;
+ }
+
+ if (current_function_decl)
+ name = (*lang_hooks.decl_printable_name) (current_function_decl, vrb);
+
return name;
}
@@ -1130,7 +1158,7 @@ fname_decl (unsigned int rid, tree id)
input_line = saved_lineno;
}
if (!ix && !current_function_decl)
- pedwarn_with_decl (decl, "`%s' is not defined outside of function scope");
+ pedwarn ("%J'%D' is not defined outside of function scope", decl, decl);
return decl;
}
@@ -1177,14 +1205,6 @@ fix_string_type (tree value)
return value;
}
-static int is_valid_printf_arglist (tree);
-static rtx c_expand_builtin (tree, rtx, enum machine_mode,
- enum expand_modifier);
-static rtx c_expand_builtin_printf (tree, rtx, enum machine_mode,
- enum expand_modifier, int, int);
-static rtx c_expand_builtin_fprintf (tree, rtx, enum machine_mode,
- enum expand_modifier, int, int);
-
/* Print a warning if a constant expression had overflow in folding.
Invoke this function on every expression that the language
requires to be a constant expression.
@@ -1356,7 +1376,7 @@ static struct tlist *
new_tlist (struct tlist *next, tree t, tree writer)
{
struct tlist *l;
- l = (struct tlist *) obstack_alloc (&tlist_obstack, sizeof *l);
+ l = obstack_alloc (&tlist_obstack, sizeof *l);
l->next = next;
l->expr = t;
l->writer = writer;
@@ -1626,8 +1646,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
if (! t)
{
- t = (struct tlist_cache *) obstack_alloc (&tlist_obstack,
- sizeof *t);
+ t = obstack_alloc (&tlist_obstack, sizeof *t);
t->next = save_expr_cache;
t->expr = x;
save_expr_cache = t;
@@ -1862,10 +1881,10 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp)
return long_double_type_node;
if (mode == TYPE_MODE (build_pointer_type (char_type_node)))
- return build_pointer_type (char_type_node);
+ return unsignedp ? make_unsigned_type (mode) : make_signed_type (mode);
if (mode == TYPE_MODE (build_pointer_type (integer_type_node)))
- return build_pointer_type (integer_type_node);
+ return unsignedp ? make_unsigned_type (mode) : make_signed_type (mode);
switch (mode)
{
@@ -1895,6 +1914,8 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp)
return V2SF_type_node;
case V2DFmode:
return V2DF_type_node;
+ case V4DFmode:
+ return V4DF_type_node;
default:
break;
}
@@ -2009,6 +2030,21 @@ c_common_signed_or_unsigned_type (int unsignedp, tree type)
return type;
}
+
+/* The C version of the register_builtin_type langhook. */
+
+void
+c_register_builtin_type (tree type, const char* name)
+{
+ tree decl;
+
+ decl = build_decl (TYPE_DECL, get_identifier (name), type);
+ DECL_ARTIFICIAL (decl) = 1;
+ if (!TYPE_NAME (type))
+ TYPE_NAME (type) = decl;
+ pushdecl (decl);
+}
+
/* Return the minimum number of bits needed to represent VALUE in a
signed or unsigned type, UNSIGNEDP says which. */
@@ -2219,10 +2255,12 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
type = c_common_signed_or_unsigned_type (unsignedp0,
TREE_TYPE (primop0));
- /* If TYPE is an enumeration, then we need to get its min/max
- values from it's underlying integral type, not the enumerated
- type itself. */
- if (TREE_CODE (type) == ENUMERAL_TYPE)
+ /* In C, if TYPE is an enumeration, then we need to get its
+ min/max values from it's underlying integral type, not the
+ enumerated type itself. In C++, TYPE_MAX_VALUE and
+ TYPE_MIN_VALUE have already been set correctly on the
+ enumeration type. */
+ if (!c_dialect_cxx() && TREE_CODE (type) == ENUMERAL_TYPE)
type = c_common_type_for_size (TYPE_PRECISION (type), unsignedp0);
maxval = TYPE_MAX_VALUE (type);
@@ -2259,40 +2297,40 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
if (code == NE_EXPR)
{
if (max_lt || min_gt)
- val = boolean_true_node;
+ val = truthvalue_true_node;
}
else if (code == EQ_EXPR)
{
if (max_lt || min_gt)
- val = boolean_false_node;
+ val = truthvalue_false_node;
}
else if (code == LT_EXPR)
{
if (max_lt)
- val = boolean_true_node;
+ val = truthvalue_true_node;
if (!min_lt)
- val = boolean_false_node;
+ val = truthvalue_false_node;
}
else if (code == GT_EXPR)
{
if (min_gt)
- val = boolean_true_node;
+ val = truthvalue_true_node;
if (!max_gt)
- val = boolean_false_node;
+ val = truthvalue_false_node;
}
else if (code == LE_EXPR)
{
if (!max_gt)
- val = boolean_true_node;
+ val = truthvalue_true_node;
if (min_gt)
- val = boolean_false_node;
+ val = truthvalue_false_node;
}
else if (code == GE_EXPR)
{
if (!min_lt)
- val = boolean_true_node;
+ val = truthvalue_true_node;
if (max_lt)
- val = boolean_false_node;
+ val = truthvalue_false_node;
}
/* If primop0 was sign-extended and unsigned comparison specd,
@@ -2331,9 +2369,9 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
if (TREE_CODE (primop0) != INTEGER_CST)
{
- if (val == boolean_false_node)
+ if (val == truthvalue_false_node)
warning ("comparison is always false due to limited range of data type");
- if (val == boolean_true_node)
+ if (val == truthvalue_true_node)
warning ("comparison is always true due to limited range of data type");
}
@@ -2405,7 +2443,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
&& ! TREE_OVERFLOW (convert (c_common_signed_type (type),
primop0))))
warning ("comparison of unsigned expression >= 0 is always true");
- value = boolean_true_node;
+ value = truthvalue_true_node;
break;
case LT_EXPR:
@@ -2414,7 +2452,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
&& ! TREE_OVERFLOW (convert (c_common_signed_type (type),
primop0))))
warning ("comparison of unsigned expression < 0 is always false");
- value = boolean_false_node;
+ value = truthvalue_false_node;
break;
default:
@@ -2435,7 +2473,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
*op0_ptr = convert (type, primop0);
*op1_ptr = convert (type, primop1);
- *restype_ptr = boolean_type_node;
+ *restype_ptr = truthvalue_type_node;
return 0;
}
@@ -2545,10 +2583,10 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
This preparation consists of taking the ordinary
representation of an expression expr and producing a valid tree
boolean expression describing whether expr is nonzero. We could
- simply always do build_binary_op (NE_EXPR, expr, boolean_false_node, 1),
+ simply always do build_binary_op (NE_EXPR, expr, truthvalue_false_node, 1),
but we optimize comparisons, &&, ||, and !.
- The resulting type should always be `boolean_type_node'. */
+ The resulting type should always be `truthvalue_type_node'. */
tree
c_common_truthvalue_conversion (tree expr)
@@ -2563,15 +2601,15 @@ c_common_truthvalue_conversion (tree expr)
{
case RECORD_TYPE:
error ("struct type value used where scalar is required");
- return boolean_false_node;
+ return truthvalue_false_node;
case UNION_TYPE:
error ("union type value used where scalar is required");
- return boolean_false_node;
+ return truthvalue_false_node;
case ARRAY_TYPE:
error ("array type value used where scalar is required");
- return boolean_false_node;
+ return truthvalue_false_node;
default:
break;
@@ -2588,17 +2626,17 @@ c_common_truthvalue_conversion (tree expr)
case TRUTH_OR_EXPR:
case TRUTH_XOR_EXPR:
case TRUTH_NOT_EXPR:
- TREE_TYPE (expr) = boolean_type_node;
+ TREE_TYPE (expr) = truthvalue_type_node;
return expr;
case ERROR_MARK:
return expr;
case INTEGER_CST:
- return integer_zerop (expr) ? boolean_false_node : boolean_true_node;
+ return integer_zerop (expr) ? truthvalue_false_node : truthvalue_true_node;
case REAL_CST:
- return real_zerop (expr) ? boolean_false_node : boolean_true_node;
+ return real_zerop (expr) ? truthvalue_false_node : truthvalue_true_node;
case ADDR_EXPR:
/* If we are taking the address of an external decl, it might be zero
@@ -2608,10 +2646,10 @@ c_common_truthvalue_conversion (tree expr)
break;
if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0)))
- return build (COMPOUND_EXPR, boolean_type_node,
- TREE_OPERAND (expr, 0), boolean_true_node);
+ return build (COMPOUND_EXPR, truthvalue_type_node,
+ TREE_OPERAND (expr, 0), truthvalue_true_node);
else
- return boolean_true_node;
+ return truthvalue_true_node;
case COMPLEX_EXPR:
return build_binary_op ((TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1))
@@ -2623,8 +2661,6 @@ c_common_truthvalue_conversion (tree expr)
case NEGATE_EXPR:
case ABS_EXPR:
case FLOAT_EXPR:
- case FFS_EXPR:
- case POPCOUNT_EXPR:
/* These don't change whether an object is nonzero or zero. */
return c_common_truthvalue_conversion (TREE_OPERAND (expr, 0));
@@ -2633,14 +2669,14 @@ c_common_truthvalue_conversion (tree expr)
/* These don't change whether an object is zero or nonzero, but
we can't ignore them if their second arg has side-effects. */
if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
- return build (COMPOUND_EXPR, boolean_type_node, TREE_OPERAND (expr, 1),
+ return build (COMPOUND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 1),
c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)));
else
return c_common_truthvalue_conversion (TREE_OPERAND (expr, 0));
case COND_EXPR:
/* Distribute the conversion into the arms of a COND_EXPR. */
- return fold (build (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0),
+ return fold (build (COND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 0),
c_common_truthvalue_conversion (TREE_OPERAND (expr, 1)),
c_common_truthvalue_conversion (TREE_OPERAND (expr, 2))));
@@ -2650,7 +2686,7 @@ c_common_truthvalue_conversion (tree expr)
if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE
|| TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
break;
- /* fall through... */
+ /* Fall through.... */
case NOP_EXPR:
/* If this is widening the argument, we can ignore it. */
if (TYPE_PRECISION (TREE_TYPE (expr))
@@ -2669,7 +2705,7 @@ c_common_truthvalue_conversion (tree expr)
be false. */
if (HONOR_INFINITIES (TYPE_MODE (TREE_TYPE (TREE_OPERAND (expr, 0)))))
break;
- /* fall through... */
+ /* Fall through.... */
case BIT_XOR_EXPR:
/* This and MINUS_EXPR can be changed into a comparison of the
two objects. */
@@ -2684,9 +2720,9 @@ c_common_truthvalue_conversion (tree expr)
case BIT_AND_EXPR:
if (integer_onep (TREE_OPERAND (expr, 1))
- && TREE_TYPE (expr) != boolean_type_node)
+ && TREE_TYPE (expr) != truthvalue_type_node)
/* Using convert here would cause infinite recursion. */
- return build1 (NOP_EXPR, boolean_type_node, expr);
+ return build1 (NOP_EXPR, truthvalue_type_node, expr);
break;
case MODIFY_EXPR:
@@ -2968,20 +3004,16 @@ enum built_in_attribute
#define DEF_ATTR_INT(ENUM, VALUE) ENUM,
#define DEF_ATTR_IDENT(ENUM, STRING) ENUM,
#define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) ENUM,
-#define DEF_FN_ATTR(NAME, ATTRS, PREDICATE) /* No entry needed in enum. */
#include "builtin-attrs.def"
#undef DEF_ATTR_NULL_TREE
#undef DEF_ATTR_INT
#undef DEF_ATTR_IDENT
#undef DEF_ATTR_TREE_LIST
-#undef DEF_FN_ATTR
ATTR_LAST
};
static GTY(()) tree built_in_attributes[(int) ATTR_LAST];
-static bool c_attrs_initialized = false;
-
static void c_init_attributes (void);
/* Build tree nodes and builtin functions common to both C and C++ language
@@ -3359,8 +3391,7 @@ c_common_nodes_and_builtins (void)
#undef DEF_FUNCTION_TYPE_VAR_3
#undef DEF_POINTER_TYPE
- if (!c_attrs_initialized)
- c_init_attributes ();
+ c_init_attributes ();
#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, \
BOTH_P, FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT) \
@@ -3556,6 +3587,15 @@ strip_array_types (tree type)
return type;
}
+/* Recursively remove any '*' or '&' operator from TYPE. */
+tree
+strip_pointer_operator (tree t)
+{
+ while (POINTER_TYPE_P (t))
+ t = TREE_TYPE (t);
+ return t;
+}
+
static tree expand_unordered_cmp (tree, tree, enum tree_code, enum tree_code);
/* Expand a call to an unordered comparison function such as
@@ -3913,18 +3953,17 @@ c_add_case_label (splay_tree cases, tree cond, tree low_value,
if (high_value)
{
error ("duplicate (or overlapping) case value");
- error_with_decl (duplicate,
- "this is the first entry overlapping that value");
+ error ("%Jthis is the first entry overlapping that value", duplicate);
}
else if (low_value)
{
error ("duplicate case value") ;
- error_with_decl (duplicate, "previously used here");
+ error ("%Jpreviously used here", duplicate);
}
else
{
error ("multiple default labels in one switch");
- error_with_decl (duplicate, "this is the first default label");
+ error ("%Jthis is the first default label", duplicate);
}
if (!cases->root)
add_stmt (build_case_label (NULL_TREE, NULL_TREE, label));
@@ -3985,6 +4024,26 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
bool preserve_result = false;
bool return_target = false;
+ if (STMT_EXPR_WARN_UNUSED_RESULT (exp) && target == const0_rtx)
+ {
+ tree stmt = STMT_EXPR_STMT (exp);
+ tree scope;
+
+ for (scope = COMPOUND_BODY (stmt);
+ scope && TREE_CODE (scope) != SCOPE_STMT;
+ scope = TREE_CHAIN (scope));
+
+ if (scope && SCOPE_STMT_BLOCK (scope))
+ warning ("%Hignoring return value of `%D', "
+ "declared with attribute warn_unused_result",
+ &expr_wfl_stack->location,
+ BLOCK_ABSTRACT_ORIGIN (SCOPE_STMT_BLOCK (scope)));
+ else
+ warning ("%Hignoring return value of function "
+ "declared with attribute warn_unused_result",
+ &expr_wfl_stack->location);
+ }
+
/* Since expand_expr_stmt calls free_temp_slots after every
expression statement, we must call push_temp_slots here.
Otherwise, any temporaries in use now would be considered
@@ -4053,20 +4112,6 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
}
break;
- case CALL_EXPR:
- {
- if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
- && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
- == FUNCTION_DECL)
- && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
- && (DECL_BUILT_IN_CLASS (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
- == BUILT_IN_FRONTEND))
- return c_expand_builtin (exp, target, tmode, modifier);
- else
- abort ();
- }
- break;
-
case COMPOUND_LITERAL_EXPR:
{
/* Initialize the anonymous variable declared in the compound
@@ -4135,280 +4180,6 @@ c_staticp (tree exp)
return 1;
return 0;
}
-
-#define CALLED_AS_BUILT_IN(NODE) \
- (!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10))
-
-static rtx
-c_expand_builtin (tree exp, rtx target, enum machine_mode tmode,
- enum expand_modifier modifier)
-{
- tree type = TREE_TYPE (exp);
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
- tree arglist = TREE_OPERAND (exp, 1);
- enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
- enum tree_code code = TREE_CODE (exp);
- const int ignore = (target == const0_rtx
- || ((code == NON_LVALUE_EXPR || code == NOP_EXPR
- || code == CONVERT_EXPR || code == REFERENCE_EXPR
- || code == COND_EXPR)
- && TREE_CODE (type) == VOID_TYPE));
-
- if (! optimize && ! CALLED_AS_BUILT_IN (fndecl))
- return expand_call (exp, target, ignore);
-
- switch (fcode)
- {
- case BUILT_IN_PRINTF:
- target = c_expand_builtin_printf (arglist, target, tmode,
- modifier, ignore, /*unlocked=*/ 0);
- if (target)
- return target;
- break;
-
- case BUILT_IN_PRINTF_UNLOCKED:
- target = c_expand_builtin_printf (arglist, target, tmode,
- modifier, ignore, /*unlocked=*/ 1);
- if (target)
- return target;
- break;
-
- case BUILT_IN_FPRINTF:
- target = c_expand_builtin_fprintf (arglist, target, tmode,
- modifier, ignore, /*unlocked=*/ 0);
- if (target)
- return target;
- break;
-
- case BUILT_IN_FPRINTF_UNLOCKED:
- target = c_expand_builtin_fprintf (arglist, target, tmode,
- modifier, ignore, /*unlocked=*/ 1);
- if (target)
- return target;
- break;
-
- default: /* just do library call, if unknown builtin */
- error ("built-in function `%s' not currently supported",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- }
-
- /* The switch statement above can drop through to cause the function
- to be called normally. */
- return expand_call (exp, target, ignore);
-}
-
-/* Check an arglist to *printf for problems. The arglist should start
- at the format specifier, with the remaining arguments immediately
- following it. */
-static int
-is_valid_printf_arglist (tree arglist)
-{
- /* Save this value so we can restore it later. */
- const int SAVE_pedantic = pedantic;
- int diagnostic_occurred = 0;
- tree attrs;
-
- /* Set this to a known value so the user setting won't affect code
- generation. */
- pedantic = 1;
- /* Check to make sure there are no format specifier errors. */
- attrs = tree_cons (get_identifier ("format"),
- tree_cons (NULL_TREE,
- get_identifier ("printf"),
- tree_cons (NULL_TREE,
- integer_one_node,
- tree_cons (NULL_TREE,
- build_int_2 (2, 0),
- NULL_TREE))),
- NULL_TREE);
- check_function_format (&diagnostic_occurred, attrs, arglist);
-
- /* Restore the value of `pedantic'. */
- pedantic = SAVE_pedantic;
-
- /* If calling `check_function_format_ptr' produces a warning, we
- return false, otherwise we return true. */
- return ! diagnostic_occurred;
-}
-
-/* If the arguments passed to printf are suitable for optimizations,
- we attempt to transform the call. */
-static rtx
-c_expand_builtin_printf (tree arglist, rtx target, enum machine_mode tmode,
- enum expand_modifier modifier, int ignore,
- int unlocked)
-{
- tree fn_putchar = unlocked ?
- implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] : implicit_built_in_decls[BUILT_IN_PUTCHAR];
- tree fn_puts = unlocked ?
- implicit_built_in_decls[BUILT_IN_PUTS_UNLOCKED] : implicit_built_in_decls[BUILT_IN_PUTS];
- tree fn, format_arg, stripped_string;
-
- /* If the return value is used, or the replacement _DECL isn't
- initialized, don't do the transformation. */
- if (!ignore || !fn_putchar || !fn_puts)
- return 0;
-
- /* Verify the required arguments in the original call. */
- if (arglist == 0
- || (TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE))
- return 0;
-
- /* Check the specifier vs. the parameters. */
- if (!is_valid_printf_arglist (arglist))
- return 0;
-
- format_arg = TREE_VALUE (arglist);
- stripped_string = format_arg;
- STRIP_NOPS (stripped_string);
- if (stripped_string && TREE_CODE (stripped_string) == ADDR_EXPR)
- stripped_string = TREE_OPERAND (stripped_string, 0);
-
- /* If the format specifier isn't a STRING_CST, punt. */
- if (TREE_CODE (stripped_string) != STRING_CST)
- return 0;
-
- /* OK! We can attempt optimization. */
-
- /* If the format specifier was "%s\n", call __builtin_puts(arg2). */
- if (strcmp (TREE_STRING_POINTER (stripped_string), "%s\n") == 0)
- {
- arglist = TREE_CHAIN (arglist);
- fn = fn_puts;
- }
- /* If the format specifier was "%c", call __builtin_putchar (arg2). */
- else if (strcmp (TREE_STRING_POINTER (stripped_string), "%c") == 0)
- {
- arglist = TREE_CHAIN (arglist);
- fn = fn_putchar;
- }
- else
- {
- /* We can't handle anything else with % args or %% ... yet. */
- if (strchr (TREE_STRING_POINTER (stripped_string), '%'))
- return 0;
-
- /* If the resulting constant string has a length of 1, call
- putchar. Note, TREE_STRING_LENGTH includes the terminating
- NULL in its count. */
- if (TREE_STRING_LENGTH (stripped_string) == 2)
- {
- /* Given printf("c"), (where c is any one character,)
- convert "c"[0] to an int and pass that to the replacement
- function. */
- arglist = build_int_2 (TREE_STRING_POINTER (stripped_string)[0], 0);
- arglist = build_tree_list (NULL_TREE, arglist);
-
- fn = fn_putchar;
- }
- /* If the resulting constant was "string\n", call
- __builtin_puts("string"). Ensure "string" has at least one
- character besides the trailing \n. Note, TREE_STRING_LENGTH
- includes the terminating NULL in its count. */
- else if (TREE_STRING_LENGTH (stripped_string) > 2
- && TREE_STRING_POINTER (stripped_string)
- [TREE_STRING_LENGTH (stripped_string) - 2] == '\n')
- {
- /* Create a NULL-terminated string that's one char shorter
- than the original, stripping off the trailing '\n'. */
- const int newlen = TREE_STRING_LENGTH (stripped_string) - 1;
- char *newstr = (char *) alloca (newlen);
- memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);
- newstr[newlen - 1] = 0;
-
- arglist = fix_string_type (build_string (newlen, newstr));
- arglist = build_tree_list (NULL_TREE, arglist);
- fn = fn_puts;
- }
- else
- /* We'd like to arrange to call fputs(string) here, but we
- need stdout and don't have a way to get it ... yet. */
- return 0;
- }
-
- return expand_expr (build_function_call (fn, arglist),
- (ignore ? const0_rtx : target),
- tmode, modifier);
-}
-
-/* If the arguments passed to fprintf are suitable for optimizations,
- we attempt to transform the call. */
-static rtx
-c_expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode tmode,
- enum expand_modifier modifier, int ignore,
- int unlocked)
-{
- tree fn_fputc = unlocked ?
- implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FPUTC];
- tree fn_fputs = unlocked ?
- implicit_built_in_decls[BUILT_IN_FPUTS_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FPUTS];
- tree fn, format_arg, stripped_string;
-
- /* If the return value is used, or the replacement _DECL isn't
- initialized, don't do the transformation. */
- if (!ignore || !fn_fputc || !fn_fputs)
- return 0;
-
- /* Verify the required arguments in the original call. */
- if (arglist == 0
- || (TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE)
- || (TREE_CHAIN (arglist) == 0)
- || (TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist)))) !=
- POINTER_TYPE))
- return 0;
-
- /* Check the specifier vs. the parameters. */
- if (!is_valid_printf_arglist (TREE_CHAIN (arglist)))
- return 0;
-
- format_arg = TREE_VALUE (TREE_CHAIN (arglist));
- stripped_string = format_arg;
- STRIP_NOPS (stripped_string);
- if (stripped_string && TREE_CODE (stripped_string) == ADDR_EXPR)
- stripped_string = TREE_OPERAND (stripped_string, 0);
-
- /* If the format specifier isn't a STRING_CST, punt. */
- if (TREE_CODE (stripped_string) != STRING_CST)
- return 0;
-
- /* OK! We can attempt optimization. */
-
- /* If the format specifier was "%s", call __builtin_fputs(arg3, arg1). */
- if (strcmp (TREE_STRING_POINTER (stripped_string), "%s") == 0)
- {
- tree newarglist = build_tree_list (NULL_TREE, TREE_VALUE (arglist));
- arglist = tree_cons (NULL_TREE,
- TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))),
- newarglist);
- fn = fn_fputs;
- }
- /* If the format specifier was "%c", call __builtin_fputc (arg3, arg1). */
- else if (strcmp (TREE_STRING_POINTER (stripped_string), "%c") == 0)
- {
- tree newarglist = build_tree_list (NULL_TREE, TREE_VALUE (arglist));
- arglist = tree_cons (NULL_TREE,
- TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))),
- newarglist);
- fn = fn_fputc;
- }
- else
- {
- /* We can't handle anything else with % args or %% ... yet. */
- if (strchr (TREE_STRING_POINTER (stripped_string), '%'))
- return 0;
-
- /* When "string" doesn't contain %, replace all cases of
- fprintf(stream,string) with fputs(string,stream). The fputs
- builtin will take take of special cases like length==1. */
- arglist = tree_cons (NULL_TREE, TREE_VALUE (TREE_CHAIN (arglist)),
- build_tree_list (NULL_TREE, TREE_VALUE (arglist)));
- fn = fn_fputs;
- }
-
- return expand_expr (build_function_call (fn, arglist),
- (ignore ? const0_rtx : target),
- tmode, modifier);
-}
/* Given a boolean expression ARG, return a tree representing an increment
@@ -4418,7 +4189,7 @@ tree
boolean_increment (enum tree_code code, tree arg)
{
tree val;
- tree true_res = (c_dialect_cxx () ? boolean_true_node : c_bool_true_node);
+ tree true_res = boolean_true_node;
arg = stabilize_reference (arg);
switch (code)
@@ -4474,40 +4245,11 @@ c_init_attributes (void)
= tree_cons (built_in_attributes[(int) PURPOSE], \
built_in_attributes[(int) VALUE], \
built_in_attributes[(int) CHAIN]);
-#define DEF_FN_ATTR(NAME, ATTRS, PREDICATE) /* No initialization needed. */
#include "builtin-attrs.def"
#undef DEF_ATTR_NULL_TREE
#undef DEF_ATTR_INT
#undef DEF_ATTR_IDENT
#undef DEF_ATTR_TREE_LIST
-#undef DEF_FN_ATTR
- c_attrs_initialized = true;
-}
-
-/* Depending on the name of DECL, apply default attributes to it. */
-
-void
-c_common_insert_default_attributes (tree decl)
-{
- tree name = DECL_NAME (decl);
-
- if (!c_attrs_initialized)
- c_init_attributes ();
-
-#define DEF_ATTR_NULL_TREE(ENUM) /* Nothing needed after initialization. */
-#define DEF_ATTR_INT(ENUM, VALUE)
-#define DEF_ATTR_IDENT(ENUM, STRING)
-#define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN)
-#define DEF_FN_ATTR(NAME, ATTRS, PREDICATE) \
- if ((PREDICATE) && name == built_in_attributes[(int) NAME]) \
- decl_attributes (&decl, built_in_attributes[(int) ATTRS], \
- ATTR_FLAG_BUILT_IN);
-#include "builtin-attrs.def"
-#undef DEF_ATTR_NULL_TREE
-#undef DEF_ATTR_INT
-#undef DEF_ATTR_IDENT
-#undef DEF_ATTR_TREE_LIST
-#undef DEF_FN_ATTR
}
/* Output a -Wshadow warning MSGCODE about NAME, and give the location
@@ -4522,7 +4264,7 @@ shadow_warning (enum sw_kind msgcode, const char *name, tree decl)
};
warning (msgs[msgcode], name);
- warning ("%Hshadowed declaration is here", &DECL_SOURCE_LOCATION (decl));
+ warning ("%Jshadowed declaration is here", decl);
}
/* Attribute handlers common to C front ends. */
@@ -4534,25 +4276,33 @@ static tree
handle_packed_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
int flags, bool *no_add_attrs)
{
- tree *type = NULL;
- if (DECL_P (*node))
- {
- if (TREE_CODE (*node) == TYPE_DECL)
- type = &TREE_TYPE (*node);
- }
- else
- type = node;
-
- if (type)
+ if (TYPE_P (*node))
{
if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
- *type = build_type_copy (*type);
- TYPE_PACKED (*type) = 1;
+ *node = build_type_copy (*node);
+ TYPE_PACKED (*node) = 1;
+ if (TYPE_MAIN_VARIANT (*node) == *node)
+ {
+ /* If it is the main variant, then pack the other variants
+ too. This happens in,
+
+ struct Foo {
+ struct Foo const *ptr; // creates a variant w/o packed flag
+ } __ attribute__((packed)); // packs it now.
+ */
+ tree probe;
+
+ for (probe = *node; probe; probe = TYPE_NEXT_VARIANT (probe))
+ TYPE_PACKED (probe) = 1;
+ }
+
}
else if (TREE_CODE (*node) == FIELD_DECL)
DECL_PACKED (*node) = 1;
/* We can't set DECL_PACKED for a VAR_DECL, because the bit is
- used for DECL_REGISTER. It wouldn't mean anything anyway. */
+ used for DECL_REGISTER. It wouldn't mean anything anyway.
+ We can't set DECL_PACKED on the type of a TYPE_DECL, because
+ that changes what the typedef is typing. */
else
{
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
@@ -4680,7 +4430,6 @@ handle_used_attribute (tree *pnode, tree name, tree args ATTRIBUTE_UNUSED,
if (TREE_CODE (node) == FUNCTION_DECL
|| (TREE_CODE (node) == VAR_DECL && TREE_STATIC (node)))
{
- mark_referenced (DECL_ASSEMBLER_NAME (node));
TREE_USED (node) = 1;
}
else
@@ -4877,7 +4626,7 @@ handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
{
- char *newp = (char *) alloca (len - 1);
+ char *newp = alloca (len - 1);
strcpy (newp, &p[2]);
newp[len - 4] = '\0';
@@ -4956,8 +4705,8 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
&& current_function_decl != NULL_TREE
&& ! TREE_STATIC (decl))
{
- error_with_decl (decl,
- "section attribute cannot be specified for local variables");
+ error ("%Jsection attribute cannot be specified for "
+ "local variables", decl);
*no_add_attrs = true;
}
@@ -4967,8 +4716,8 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
&& strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
TREE_STRING_POINTER (TREE_VALUE (args))) != 0)
{
- error_with_decl (*node,
- "section of `%s' conflicts with previous declaration");
+ error ("%Jsection of '%D' conflicts with previous declaration",
+ *node, *node);
*no_add_attrs = true;
}
else
@@ -4976,15 +4725,13 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
}
else
{
- error_with_decl (*node,
- "section attribute not allowed for `%s'");
+ error ("%Jsection attribute not allowed for '%D'", *node, *node);
*no_add_attrs = true;
}
}
else
{
- error_with_decl (*node,
- "section attributes are not supported for this target");
+ error ("%Jsection attributes are not supported for this target", *node);
*no_add_attrs = true;
}
@@ -5058,8 +4805,7 @@ handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
else if (TREE_CODE (decl) != VAR_DECL
&& TREE_CODE (decl) != FIELD_DECL)
{
- error_with_decl (decl,
- "alignment may not be specified for `%s'");
+ error ("%Jalignment may not be specified for '%D'", decl, decl);
*no_add_attrs = true;
}
else
@@ -5097,8 +4843,7 @@ handle_alias_attribute (tree *node, tree name, tree args,
if ((TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl))
|| (TREE_CODE (decl) != FUNCTION_DECL && ! DECL_EXTERNAL (decl)))
{
- error_with_decl (decl,
- "`%s' defined both normally and as an alias");
+ error ("%J'%D' defined both normally and as an alias", decl, decl);
*no_add_attrs = true;
}
else if (decl_function_context (decl) == 0)
@@ -5222,16 +4967,12 @@ handle_no_instrument_function_attribute (tree *node, tree name,
if (TREE_CODE (decl) != FUNCTION_DECL)
{
- error_with_decl (decl,
- "`%s' attribute applies only to functions",
- IDENTIFIER_POINTER (name));
+ error ("%J'%E' attribute applies only to functions", decl, name);
*no_add_attrs = true;
}
else if (DECL_INITIAL (decl))
{
- error_with_decl (decl,
- "can't set `%s' attribute after definition",
- IDENTIFIER_POINTER (name));
+ error ("%Jcan't set '%E' attribute after definition", decl, name);
*no_add_attrs = true;
}
else
@@ -5272,16 +5013,12 @@ handle_no_limit_stack_attribute (tree *node, tree name,
if (TREE_CODE (decl) != FUNCTION_DECL)
{
- error_with_decl (decl,
- "`%s' attribute applies only to functions",
- IDENTIFIER_POINTER (name));
+ error ("%J'%E' attribute applies only to functions", decl, name);
*no_add_attrs = true;
}
else if (DECL_INITIAL (decl))
{
- error_with_decl (decl,
- "can't set `%s' attribute after definition",
- IDENTIFIER_POINTER (name));
+ error ("%Jcan't set '%E' attribute after definition", decl, name);
*no_add_attrs = true;
}
else
@@ -5408,6 +5145,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
while (POINTER_TYPE_P (type)
|| TREE_CODE (type) == FUNCTION_TYPE
+ || TREE_CODE (type) == METHOD_TYPE
|| TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
@@ -5538,12 +5276,19 @@ vector_size_helper (tree type, tree bottom)
else if (TREE_CODE (type) == ARRAY_TYPE)
{
inner = vector_size_helper (TREE_TYPE (type), bottom);
- outer = build_array_type (inner, TYPE_VALUES (type));
+ outer = build_array_type (inner, TYPE_DOMAIN (type));
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
inner = vector_size_helper (TREE_TYPE (type), bottom);
- outer = build_function_type (inner, TYPE_VALUES (type));
+ outer = build_function_type (inner, TYPE_ARG_TYPES (type));
+ }
+ else if (TREE_CODE (type) == METHOD_TYPE)
+ {
+ inner = vector_size_helper (TREE_TYPE (type), bottom);
+ outer = build_method_type_directly (TYPE_METHOD_BASETYPE (type),
+ inner,
+ TYPE_ARG_TYPES (type));
}
else
return bottom;
@@ -5780,6 +5525,23 @@ handle_cleanup_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
+
+/* Handle a "warn_unused_result" attribute. No special handling. */
+
+static tree
+handle_warn_unused_result_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
+{
+ /* Ignore the attribute for functions not returning any value. */
+ if (VOID_TYPE_P (TREE_TYPE (*node)))
+ {
+ warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
/* Check for valid arguments being passed to a function. */
void
@@ -5881,6 +5643,72 @@ check_function_arguments_recurse (void (*callback)
(*callback) (ctx, param, param_num);
}
+/* Function to help qsort sort FIELD_DECLs by name order. */
+
+int
+field_decl_cmp (const void *x_p, const void *y_p)
+{
+ const tree *const x = x_p;
+ const tree *const y = y_p;
+ if (DECL_NAME (*x) == DECL_NAME (*y))
+ /* A nontype is "greater" than a type. */
+ return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL);
+ if (DECL_NAME (*x) == NULL_TREE)
+ return -1;
+ if (DECL_NAME (*y) == NULL_TREE)
+ return 1;
+ if (DECL_NAME (*x) < DECL_NAME (*y))
+ return -1;
+ return 1;
+}
+
+static struct {
+ gt_pointer_operator new_value;
+ void *cookie;
+} resort_data;
+
+/* This routine compares two fields like field_decl_cmp but using the
+pointer operator in resort_data. */
+
+static int
+resort_field_decl_cmp (const void *x_p, const void *y_p)
+{
+ const tree *const x = x_p;
+ const tree *const y = y_p;
+
+ if (DECL_NAME (*x) == DECL_NAME (*y))
+ /* A nontype is "greater" than a type. */
+ return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL);
+ if (DECL_NAME (*x) == NULL_TREE)
+ return -1;
+ if (DECL_NAME (*y) == NULL_TREE)
+ return 1;
+ {
+ tree d1 = DECL_NAME (*x);
+ tree d2 = DECL_NAME (*y);
+ resort_data.new_value (&d1, resort_data.cookie);
+ resort_data.new_value (&d2, resort_data.cookie);
+ if (d1 < d2)
+ return -1;
+ }
+ return 1;
+}
+
+/* Resort DECL_SORTED_FIELDS because pointers have been reordered. */
+
+void
+resort_sorted_fields (void *obj,
+ void *orig_obj ATTRIBUTE_UNUSED ,
+ gt_pointer_operator new_value,
+ void *cookie)
+{
+ struct sorted_fields_type *sf = obj;
+ resort_data.new_value = new_value;
+ resort_data.cookie = cookie;
+ qsort (&sf->elts[0], sf->len, sizeof (tree),
+ resort_field_decl_cmp);
+}
+
/* Used by estimate_num_insns. Estimate number of instructions seen
by given statement. */
static tree
@@ -5895,7 +5723,7 @@ c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
return NULL;
}
/* Assume that constants and references counts nothing. These should
- be majorized by amount of operations amoung them we count later
+ be majorized by amount of operations among them we count later
and are common target of CSE and similar optimizations. */
if (TREE_CODE_CLASS (TREE_CODE (x)) == 'c'
|| TREE_CODE_CLASS (TREE_CODE (x)) == 'r')
@@ -5928,7 +5756,6 @@ c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case ROUND_MOD_EXPR:
case RDIV_EXPR:
case CALL_EXPR:
- case METHOD_CALL_EXPR:
*count += 10;
break;
/* Various containers that will produce no code themselves. */
@@ -5991,4 +5818,35 @@ c_estimate_num_insns (tree decl)
return num;
}
+/* Used by c_decl_uninit to find where expressions like x = x + 1; */
+
+static tree
+c_decl_uninit_1 (tree *t, int *walk_sub_trees, void *x)
+{
+ /* If x = EXP(&x)EXP, then do not warn about the use of x. */
+ if (TREE_CODE (*t) == ADDR_EXPR && TREE_OPERAND (*t, 0) == x)
+ {
+ *walk_sub_trees = 0;
+ return NULL_TREE;
+ }
+ if (*t == x)
+ return *t;
+ return NULL_TREE;
+}
+
+/* Find out if a variable is uninitialized based on DECL_INITIAL. */
+
+bool
+c_decl_uninit (tree t)
+{
+ /* int x = x; is GCC extension to turn off this warning, only if warn_init_self is zero. */
+ if (DECL_INITIAL (t) == t)
+ return warn_init_self ? true : false;
+
+ /* Walk the trees looking for the variable itself. */
+ if (walk_tree_without_duplicates (&DECL_INITIAL (t), c_decl_uninit_1, t))
+ return true;
+ return false;
+}
+
#include "gt-c-common.h"
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 7fdd80969b9..ba7248270d2 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -24,6 +24,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "splay-tree.h"
#include "cpplib.h"
+#include "ggc.h"
/* Usage of TREE_LANG_FLAG_?:
0: COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
@@ -39,6 +40,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2: STMT_LINENO_FOR_FN_P (in _STMT)
3: SCOPE_NO_CLEANUPS_P (in SCOPE_STMT)
COMPOUND_STMT_BODY_BLOCK (in COMPOUND_STMT)
+ STMT_EXPR_WARN_UNUSED_RESULT (in STMT_EXPR)
4: SCOPE_PARTIAL_P (in SCOPE_STMT)
*/
@@ -97,7 +99,10 @@ enum rid
RID_ID, RID_AT_ENCODE, RID_AT_END,
RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS,
RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC,
- RID_AT_PROTOCOL, RID_AT_SELECTOR, RID_AT_INTERFACE,
+ RID_AT_PROTOCOL, RID_AT_SELECTOR,
+ RID_AT_THROW, RID_AT_TRY, RID_AT_CATCH,
+ RID_AT_FINALLY, RID_AT_SYNCHRONIZED,
+ RID_AT_INTERFACE,
RID_AT_IMPLEMENTATION,
RID_MAX,
@@ -145,13 +150,10 @@ enum c_tree_index
CTI_CONST_STRING_TYPE,
/* Type for boolean expressions (bool in C++, int in C). */
- CTI_BOOLEAN_TYPE,
- CTI_BOOLEAN_TRUE,
- CTI_BOOLEAN_FALSE,
- /* C99's _Bool type. */
- CTI_C_BOOL_TYPE,
- CTI_C_BOOL_TRUE,
- CTI_C_BOOL_FALSE,
+ CTI_TRUTHVALUE_TYPE,
+ CTI_TRUTHVALUE_TRUE,
+ CTI_TRUTHVALUE_FALSE,
+
CTI_DEFAULT_FUNCTION_TYPE,
CTI_G77_INTEGER_TYPE,
@@ -191,13 +193,9 @@ struct c_common_identifier GTY(())
#define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE]
#define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
-#define boolean_type_node c_global_trees[CTI_BOOLEAN_TYPE]
-#define boolean_true_node c_global_trees[CTI_BOOLEAN_TRUE]
-#define boolean_false_node c_global_trees[CTI_BOOLEAN_FALSE]
-
-#define c_bool_type_node c_global_trees[CTI_C_BOOL_TYPE]
-#define c_bool_true_node c_global_trees[CTI_C_BOOL_TRUE]
-#define c_bool_false_node c_global_trees[CTI_C_BOOL_FALSE]
+#define truthvalue_type_node c_global_trees[CTI_TRUTHVALUE_TYPE]
+#define truthvalue_true_node c_global_trees[CTI_TRUTHVALUE_TRUE]
+#define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE]
#define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE]
#define wchar_array_type_node c_global_trees[CTI_WCHAR_ARRAY_TYPE]
@@ -223,6 +221,13 @@ struct c_common_identifier GTY(())
extern GTY(()) tree c_global_trees[CTI_MAX];
+/* In a RECORD_TYPE, a sorted array of the fields of the type, not a tree for size reasons. */
+struct sorted_fields_type GTY(())
+{
+ int len;
+ tree GTY((length ("%h.len"))) elts[1];
+};
+
/* Mark which labels are explicitly declared.
These may be shadowed, and may be referenced from nested functions. */
#define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
@@ -317,7 +322,6 @@ struct c_language_function GTY(()) {
extern void (*lang_expand_stmt) (tree);
extern void (*lang_expand_decl_stmt) (tree);
extern void (*lang_expand_function_end) (void);
-extern tree gettags (void);
/* Callback that determines if it's ok for a function to have no
noreturn attribute. */
@@ -343,26 +347,9 @@ extern void c_finish_while_stmt_cond (tree, tree);
enum sw_kind { SW_PARAM = 0, SW_LOCAL, SW_GLOBAL };
extern void shadow_warning (enum sw_kind, const char *, tree);
-
-/* Extra information associated with a DECL. Other C dialects extend
- this structure in various ways. The C front-end only uses this
- structure for FUNCTION_DECLs; all other DECLs have a NULL
- DECL_LANG_SPECIFIC field. */
-
-struct c_lang_decl GTY(()) {
- unsigned declared_inline : 1;
-};
-
-/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is
- the approximate number of statements in this function. There is
- no need for this number to be exact; it is only used in various
- heuristics regarding optimization. */
-#define DECL_ESTIMATED_INSNS(NODE) \
- (FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
-
-/* Nonzero if we can read a PCH file now. */
-
-extern int allow_pch;
+extern int field_decl_cmp (const void *, const void *);
+extern void resort_sorted_fields (void *, void *, gt_pointer_operator,
+ void *);
/* Switches common to the C front ends. */
@@ -370,6 +357,25 @@ extern int allow_pch;
extern int flag_preprocess_only;
+/* Zero means that faster, ...NonNil variants of objc_msgSend...
+ calls will be used in ObjC; passing nil receivers to such calls
+ will most likely result in crashes. */
+extern int flag_nil_receivers;
+
+/* Nonzero means that we will allow new ObjC exception syntax (@throw,
+ @try, etc.) in source code. */
+extern int flag_objc_exceptions;
+
+/* Nonzero means that code generation will be altered to support
+ "zero-link" execution. This currently affects ObjC only, but may
+ affect other languages in the future. */
+extern int flag_zero_link;
+
+/* Nonzero means emit an '__OBJC, __image_info' for the current translation
+ unit. It will inform the ObjC runtime that class definition(s) herein
+ contained are to replace one(s) previously loaded. */
+extern int flag_replace_objc_classes;
+
/* Nonzero means don't output line number information. */
extern char flag_no_line_commands;
@@ -550,11 +556,6 @@ extern int flag_isoc99;
extern int flag_hosted;
-/* Nonzero means add default format_arg attributes for functions not
- in ISO C. */
-
-extern int flag_noniso_default_format_attributes;
-
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
@@ -565,6 +566,10 @@ extern int warn_bad_function_cast;
extern int warn_traditional;
+/* Nonzero means warn for a declaration found after a statement. */
+
+extern int warn_declaration_after_statement;
+
/* Nonzero means warn for non-prototype function decls
or non-prototyped defs without previous prototype. */
@@ -591,6 +596,12 @@ extern int warn_main;
extern int warn_sequence_point;
+/* Nonzero means warn about uninitialized variable when it is initialized with itself.
+ For example: int i = i;, GCC will not warn about this when warn_init_self is nonzero. */
+
+extern int warn_init_self;
+
+
/* Nonzero means to warn about compile-time division by zero. */
extern int warn_div_by_zero;
@@ -603,6 +614,10 @@ extern int warn_implicit_int;
extern int warn_nonnull;
+/* Warn about old-style parameter declaration. */
+
+extern int warn_old_style_definition;
+
/* ObjC language option variables. */
@@ -734,15 +749,18 @@ extern int flag_new_for_scope;
extern int flag_weak;
+/* 0 means we want the preprocessor to not emit line directives for
+ the current working directory. 1 means we want it to do it. -1
+ means we should decide depending on whether debugging information
+ is being emitted or not. */
+
+extern int flag_working_directory;
+
/* Nonzero to use __cxa_atexit, rather than atexit, to register
destructors for local statics and global objects. */
extern int flag_use_cxa_atexit;
-/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
-
-extern int flag_vtable_gc;
-
/* Nonzero means make the default pedwarns warnings instead of errors.
The value of this flag is ignored if -pedantic is specified. */
@@ -894,9 +912,7 @@ extern void check_function_format (int *, tree, tree);
extern void set_Wformat (int);
extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
-extern void c_common_insert_default_attributes (tree);
extern int c_common_handle_option (size_t code, const char *arg, int value);
-extern void c_common_handle_filename (const char *filename);
extern bool c_common_missing_argument (const char *opt, size_t code);
extern tree c_common_type_for_mode (enum machine_mode, int);
extern tree c_common_type_for_size (unsigned int, int);
@@ -959,9 +975,19 @@ extern bool c_common_init (void);
extern void c_common_finish (void);
extern void c_common_parse_file (int);
extern HOST_WIDE_INT c_common_get_alias_set (tree);
+extern void c_register_builtin_type (tree, const char*);
extern bool c_promoting_integer_type_p (tree);
extern int self_promoting_args_p (tree);
extern tree strip_array_types (tree);
+extern tree strip_pointer_operator (tree);
+
+/* This function resets the parsers' state in preparation for parsing
+ a new file. */
+extern void c_reset_state (void);
+/* This is the basic parsing function. */
+extern void c_parse_file (void);
+/* This is misnamed, it actually performs end-of-compilation processing. */
+extern void finish_file (void);
/* These macros provide convenient access to the various _STMT nodes. */
@@ -1051,6 +1077,11 @@ extern tree strip_array_types (tree);
#define STMT_EXPR_NO_SCOPE(NODE) \
TREE_LANG_FLAG_0 (STMT_EXPR_CHECK (NODE))
+/* Nonzero if this statement-expression should cause warning if its result
+ is not used. */
+#define STMT_EXPR_WARN_UNUSED_RESULT(NODE) \
+ TREE_LANG_FLAG_3 (STMT_EXPR_CHECK (NODE))
+
/* LABEL_STMT accessor. This gives access to the label associated with
the given label statement. */
#define LABEL_STMT_LABEL(NODE) TREE_OPERAND (LABEL_STMT_CHECK (NODE), 0)
@@ -1293,10 +1324,24 @@ extern int c_common_valid_pch (cpp_reader *pfile, const char *name, int fd);
extern void c_common_read_pch (cpp_reader *pfile, const char *name, int fd,
const char *orig);
extern void c_common_write_pch (void);
+extern void c_common_no_more_pch (void);
extern void builtin_define_with_value (const char *, const char *, int);
extern void c_stddef_cpp_builtins (void);
extern void fe_file_change (const struct line_map *);
extern int c_estimate_num_insns (tree decl);
+extern bool c_decl_uninit (tree t);
+
+/* 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
+ prototypes. */
+extern tree lookup_interface (tree);
+extern tree is_class_name (tree);
+extern tree objc_is_object_ptr (tree);
+extern void objc_check_decl (tree);
+extern int objc_comptypes (tree, tree, int);
+extern tree objc_message_selector (void);
+extern tree lookup_objc_ivar (tree);
+extern void objc_mark_locals_volatile (void *);
/* In c-ppoutput.c */
extern void init_pp_output (FILE *);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index fbe0b02a810..16d7c436193 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "cpplib.h"
#include "target.h"
#include "debug.h"
+#include "opts.h"
#include "timevar.h"
#include "c-common.h"
#include "c-pragma.h"
@@ -52,6 +53,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "hashtab.h"
#include "libfuncs.h"
#include "except.h"
+#include "langhooks-def.h"
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
@@ -83,26 +85,37 @@ static tree enum_next_value;
static int enum_overflow;
/* Parsing a function declarator leaves a list of parameter names
- or a chain or parameter decls here. */
+ or a chain of parameter decls here. */
static tree last_function_parms;
-/* Parsing a function declarator leaves here a chain of structure
- and enum types declared in the parmlist. */
+/* ... and a chain of structure and enum types declared in the
+ parmlist here. */
static tree last_function_parm_tags;
+/* ... and a chain of all non-parameter declarations (such as
+ CONST_DECLs from enumerations) here. */
+
+static tree last_function_parm_others;
+
/* After parsing the declarator that starts a function definition,
- `start_function' puts here the list of parameter names or chain of decls.
- `store_parm_decls' finds it here. */
+ `start_function' puts the list of parameter names or chain of decls here
+ for `store_parm_decls' to find. */
static tree current_function_parms;
/* Similar, for last_function_parm_tags. */
+
static tree current_function_parm_tags;
+/* And for last_function_parm_others. */
+
+static tree current_function_parm_others;
+
/* Similar, for the file and line that the prototype came from if this is
an old-style definition. */
+
static location_t current_function_prototype_locus;
/* The current statement tree. */
@@ -113,19 +126,18 @@ static GTY(()) struct stmt_tree_s c_stmt_tree;
static GTY(()) tree c_scope_stmt_stack;
-/* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
- that have names. Here so we can clear out their names' definitions
- at the end of the function. */
+/* 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;
-static GTY(()) tree named_labels;
+/* All the builtins; this is a subset of the entries of global_scope. */
-/* A list of LABEL_DECLs from outer contexts that are currently shadowed. */
+static GTY(()) tree first_builtin_decl;
+static GTY(()) tree last_builtin_decl;
-static GTY(()) tree shadowed_labels;
+/* A DECL for the current file-scope context. */
-/* 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;
+static GTY(()) tree current_file_decl;
/* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */
@@ -151,111 +163,137 @@ static int warn_about_return_type;
static int current_extern_inline;
-/* For each binding contour we allocate a binding_level structure
- * which records the names defined in that contour.
- * Contours include:
- * 0) the global one
- * 1) one for each function definition,
- * where internal declarations of the parameters appear.
- * 2) one for each compound statement,
- * to record its declarations.
- *
- * The current meaning of a name can be found by searching the levels from
- * the current one out to the global one.
- */
-
-struct binding_level GTY(())
- {
- /* A chain of _DECL nodes for all variables, constants, functions,
- and typedef types. These are in the reverse of the order supplied.
- */
- tree names;
-
- /* A list of structure, union and enum definitions,
- * for looking up tag names.
- * It is a chain of TREE_LIST nodes, each of whose TREE_PURPOSE is a name,
- * or NULL_TREE; and whose TREE_VALUE is a RECORD_TYPE, UNION_TYPE,
- * or ENUMERAL_TYPE node.
- */
- tree tags;
-
- /* For each level, a list of shadowed outer-level definitions
- to be restored when this level is popped.
- Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and
- whose TREE_VALUE is its old definition (a kind of ..._DECL node). */
- tree shadowed;
+/* Each c_scope structure describes the complete contents of one scope.
+ Three scopes are distinguished specially: the innermost or current
+ scope, the innermost function scope, and the outermost or file scope.
- /* For each level, a list of shadowed outer-level tag definitions
- to be restored when this level is popped.
- Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and
- whose TREE_VALUE is its old definition (a kind of ..._TYPE node). */
- tree shadowed_tags;
+ Most declarations are recorded in the current scope.
- /* For each level (except not the global one),
- a chain of BLOCK nodes for all the levels
- that were entered and exited one level down. */
- tree blocks;
+ All normal label declarations are recorded in the innermost
+ function scope, as are bindings of undeclared identifiers to
+ error_mark_node. (GCC permits nested functions as an extension,
+ hence the 'innermost' qualifier.) Explicitly declared labels
+ (using the __label__ extension) appear in the current scope.
- /* The binding level which this one is contained in (inherits from). */
- struct binding_level *level_chain;
+ Being in the global scope (current_scope == global_scope) causes
+ special behavior in several places below. Also, under some
+ conditions the Objective-C front end records declarations in the
+ global scope even though that isn't the current scope.
- /* Nonzero if we are currently filling this level with parameter
- declarations. */
- char parm_flag;
+ The order of the names, parms, and blocks lists matters, and they
+ are frequently appended to. To avoid having to walk all the way to
+ the end of the list on each insertion, or reverse the lists later,
+ we maintain a pointer to the last list entry for each of the lists.
- /* Nonzero if this is the outermost block scope of a function body.
- This scope contains both the parameters and the local variables
- declared in the outermost block. */
- char function_body;
+ The order of the tags, shadowed, and shadowed_tags
+ lists does not matter, so we just prepend to these lists. */
- /* Nonzero means make a BLOCK for this level regardless of all else. */
- char keep;
-
- /* Nonzero means make a BLOCK if this level has any subblocks. */
- char keep_if_subblocks;
-
- /* List of decls in `names' that have incomplete structure or
- union types. */
- tree incomplete_list;
+struct c_scope GTY(())
+{
+ /* The scope containing this one. */
+ struct c_scope *outer;
+
+ /* The next outermost function scope. */
+ struct c_scope *outer_function;
+
+ /* All variables, constants, functions, labels, and typedef names. */
+ tree names;
+ tree names_last;
+
+ /* All parameter declarations. Used only in the outermost scope of
+ a function. */
+ tree parms;
+ tree parms_last;
+
+ /* All structure, union, and enum type tags. */
+ tree tags;
+
+ /* For each scope, a list of shadowed outer-scope definitions
+ to be restored when this scope is popped.
+ Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and
+ whose TREE_VALUE is its old definition (a kind of ..._DECL node). */
+ tree shadowed;
+
+ /* For each scope, a list of shadowed outer-scope tag definitions
+ to be restored when this scope is popped.
+ Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and
+ whose TREE_VALUE is its old definition (a kind of ..._TYPE node). */
+ tree shadowed_tags;
+
+ /* For each scope (except the global one), a chain of BLOCK nodes
+ for all the scopes that were entered and exited one level down. */
+ tree blocks;
+ tree blocks_last;
+
+ /* True if we are currently filling this scope with parameter
+ declarations. */
+ bool parm_flag : 1;
+
+ /* True if we already complained about forward parameter decls
+ in this scope. This prevents double warnings on
+ foo (int a; int b; ...) */
+ bool warned_forward_parm_decls : 1;
+
+ /* True if this is the outermost block scope of a function body.
+ This scope contains the parameters, the local variables declared
+ in the outermost block, and all the labels (except those in
+ nested functions, or declared at block scope with __label__). */
+ bool function_body : 1;
+
+ /* True means make a BLOCK for this scope no matter what. */
+ bool keep : 1;
+};
- /* A list of decls giving the (reversed) specified order of parms,
- not including any forward-decls in the parmlist.
- This is so we can put the parms in proper order for assign_parms. */
- tree parm_order;
- };
+/* The scope currently in effect. */
-#define NULL_BINDING_LEVEL (struct binding_level *) NULL
+static GTY(()) struct c_scope *current_scope;
-/* The binding level currently in effect. */
+/* A chain of c_scope structures awaiting reuse. */
-static GTY(()) struct binding_level *current_binding_level;
+static GTY((deletable (""))) struct c_scope *scope_freelist;
-/* A chain of binding_level structures awaiting reuse. */
+/* The innermost function scope. Ordinary (not explicitly declared)
+ labels, bindings to error_mark_node, and the lazily-created
+ bindings of __func__ and its friends get this scope. */
-static GTY((deletable (""))) struct binding_level *free_binding_level;
+static GTY(()) struct c_scope *current_function_scope;
-/* The outermost binding level, for names of file scope.
- This is created when the compiler is started and exists
- through the entire run. */
+/* The outermost scope, corresponding to the C "file scope". This is
+ created when the compiler is started and exists through the entire run. */
-static GTY(()) struct binding_level *global_binding_level;
+static GTY(()) struct c_scope *global_scope;
-/* Nonzero means unconditionally make a BLOCK for the next level pushed. */
+/* Append VAR to LIST in scope SCOPE. */
+#define SCOPE_LIST_APPEND(scope, list, decl) do { \
+ struct c_scope *s_ = (scope); \
+ tree d_ = (decl); \
+ if (s_->list##_last) \
+ TREE_CHAIN (s_->list##_last) = d_; \
+ else \
+ s_->list = d_; \
+ s_->list##_last = d_; \
+} while (0)
-static int keep_next_level_flag;
+/* Concatenate FROM in scope FSCOPE onto TO in scope TSCOPE. */
+#define SCOPE_LIST_CONCAT(tscope, to, fscope, from) do { \
+ struct c_scope *t_ = (tscope); \
+ struct c_scope *f_ = (fscope); \
+ if (t_->to##_last) \
+ TREE_CHAIN (t_->to##_last) = f_->from; \
+ else \
+ t_->to = f_->from; \
+ t_->to##_last = f_->from##_last; \
+} while (0)
-/* Nonzero means make a BLOCK for the next level pushed
- if it has subblocks. */
+/* True means unconditionally make a BLOCK for the next scope pushed. */
-static int keep_next_if_subblocks;
+static bool keep_next_level_flag;
-/* The chain of outer levels of label scopes.
- This uses the same data structure used for binding levels,
- but it works differently: each link in the chain records
- saved values of named_labels and shadowed_labels for
- a label binding level outside the current one. */
+/* True means the next call to pushlevel will be the outermost scope
+ of a function body, so do not push a new scope, merely cease
+ expecting parameter decls. */
-static GTY(()) struct binding_level *label_level_chain;
+static bool next_is_function_body;
/* Functions called automatically at the beginning and end of execution. */
@@ -263,18 +301,21 @@ tree static_ctors, static_dtors;
/* Forward declarations. */
-static struct binding_level *make_binding_level (void);
-static void pop_binding_level (struct binding_level **);
-static int duplicate_decls (tree, tree, int);
+static struct c_scope *make_scope (void);
+static void pop_scope (void);
+static tree match_builtin_function_types (tree, tree);
+static int duplicate_decls (tree, tree, int, int);
static int redeclaration_error_message (tree, tree);
+static tree make_label (tree, location_t);
+static void bind_label (tree, tree, struct c_scope *);
static void implicit_decl_warning (tree);
-static void storedecls (tree);
-static void storetags (tree);
static tree lookup_tag (enum tree_code, tree, int);
static tree lookup_name_current_level (tree);
static tree grokdeclarator (tree, tree, enum decl_context, int);
static tree grokparms (tree, int);
static void layout_array_type (tree);
+static void store_parm_decls_newstyle (void);
+static void store_parm_decls_oldstyle (void);
static tree c_make_fname_decl (tree, int);
static void c_expand_body_1 (tree, int);
static tree any_external_decl (tree);
@@ -282,6 +323,8 @@ static void record_external_decl (tree);
static void warn_if_shadowing (tree, tree);
static void clone_underlying_type (tree);
static bool flexible_array_type_p (tree);
+static hashval_t link_hash_hash (const void *);
+static int link_hash_eq (const void *, const void *);
/* States indicating how grokdeclarator() should handle declspecs marked
with __attribute__((deprecated)). An object declared as
@@ -311,7 +354,7 @@ c_print_identifier (FILE *file, tree node, int indent)
}
/* Hook called at end of compilation to assume 1 elt
- for a top-level tentative array defn that wasn't complete before. */
+ for a file-scope tentative array defn that wasn't complete before. */
void
c_finish_incomplete_decl (tree decl)
@@ -324,7 +367,7 @@ c_finish_incomplete_decl (tree decl)
&& ! DECL_EXTERNAL (decl)
&& TYPE_DOMAIN (type) == 0)
{
- warning_with_decl (decl, "array `%s' assumed to have one element");
+ warning ("%Jarray '%D' assumed to have one element", decl, decl);
complete_array_type (type, NULL_TREE, 1);
@@ -333,73 +376,94 @@ c_finish_incomplete_decl (tree decl)
}
}
-/* Reuse or create a struct for this binding level. */
+/* Reuse or create a struct for this scope. */
-static struct binding_level *
-make_binding_level (void)
+static struct c_scope *
+make_scope (void)
{
- struct binding_level *result;
- if (free_binding_level)
+ struct c_scope *result;
+ if (scope_freelist)
{
- result = free_binding_level;
- free_binding_level = result->level_chain;
- memset (result, 0, sizeof(struct binding_level));
+ result = scope_freelist;
+ scope_freelist = result->outer;
}
else
- result = (struct binding_level *)
- ggc_alloc_cleared (sizeof (struct binding_level));
+ result = ggc_alloc_cleared (sizeof (struct c_scope));
return result;
}
-/* Remove a binding level from a list and add it to the level chain. */
+/* Remove the topmost scope from the stack and add it to the
+ free list, updating current_function_scope if necessary. */
static void
-pop_binding_level (struct binding_level **lp)
+pop_scope (void)
{
- struct binding_level *l = *lp;
- *lp = l->level_chain;
+ struct c_scope *scope = current_scope;
+
+ current_scope = scope->outer;
+ if (scope->function_body)
+ current_function_scope = scope->outer_function;
- memset (l, 0, sizeof (struct binding_level));
- l->level_chain = free_binding_level;
- free_binding_level = l;
+ memset (scope, 0, sizeof (struct c_scope));
+ scope->outer = scope_freelist;
+ scope_freelist = scope;
}
-/* Nonzero if we are currently in the global binding level. */
+/* The Objective-C front-end often needs to determine the current scope. */
-int
-global_bindings_p (void)
+void *
+get_current_scope (void)
{
- return current_binding_level == global_binding_level;
+ return current_scope;
}
+/* The following function is used only by Objective-C. It needs to live here
+ because it accesses the innards of c_scope. */
+
void
-keep_next_level (void)
+objc_mark_locals_volatile (enclosing_blk)
+ void *enclosing_blk;
{
- keep_next_level_flag = 1;
-}
-
-/* Nonzero if the current level needs to have a BLOCK made. */
+ struct c_scope *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;
+ TREE_THIS_VOLATILE (decl) = 1;
+ }
+ /* Do not climb up past the current function. */
+ if (scope->function_body)
+ break;
+ }
+}
+
+/* Nonzero if we are currently in the global scope. */
int
-kept_level_p (void)
+global_bindings_p (void)
{
- return ((current_binding_level->keep_if_subblocks
- && current_binding_level->blocks != 0)
- || current_binding_level->keep
- || current_binding_level->names != 0
- || current_binding_level->tags != 0);
+ return current_scope == global_scope;
}
-/* Identify this binding level as a level of parameters.
- DEFINITION_FLAG is 1 for a definition, 0 for a declaration.
- But it turns out there is no way to pass the right value for
- DEFINITION_FLAG, so we ignore it. */
+void
+keep_next_level (void)
+{
+ keep_next_level_flag = true;
+}
+
+/* Identify this scope as currently being filled with parameters. */
void
-declare_parm_level (int definition_flag ATTRIBUTE_UNUSED)
+declare_parm_level (void)
{
- current_binding_level->parm_flag = 1;
+ current_scope->parm_flag = true;
}
/* Nonzero if currently making parm declarations. */
@@ -407,250 +471,236 @@ declare_parm_level (int definition_flag ATTRIBUTE_UNUSED)
int
in_parm_level_p (void)
{
- return current_binding_level->parm_flag;
+ return current_scope->parm_flag;
}
-/* Enter a new binding level. */
+/* Enter a new scope. The dummy parameter is for signature
+ compatibility with lang_hooks.decls.pushlevel. */
void
pushlevel (int dummy ATTRIBUTE_UNUSED)
{
- /* If this is the top level of a function, make sure that
- NAMED_LABELS is 0. */
-
- if (current_binding_level == global_binding_level)
- named_labels = 0;
-
- if (keep_next_if_subblocks)
+ if (next_is_function_body)
{
/* This is the transition from the parameters to the top level
of the function body. These are the same scope
- (C99 6.2.1p4,6) so we do not push another binding level.
-
- XXX Note kludge - keep_next_if_subblocks is set only by
- store_parm_decls, which in turn is called when and only
- when we are about to encounter the opening curly brace for
- the function body. */
- current_binding_level->parm_flag = 0;
- current_binding_level->function_body = 1;
- current_binding_level->keep |= keep_next_level_flag;
- current_binding_level->keep_if_subblocks = 1;
-
- keep_next_level_flag = 0;
- keep_next_if_subblocks = 0;
+ (C99 6.2.1p4,6) so we do not push another scope structure.
+ next_is_function_body is set only by store_parm_decls, which
+ in turn is called when and only when we are about to
+ encounter the opening curly brace for the function body.
+
+ The outermost block of a function always gets a BLOCK node,
+ because the debugging output routines expect that each
+ function has at least one BLOCK. */
+ current_scope->parm_flag = false;
+ current_scope->function_body = true;
+ current_scope->keep = true;
+ current_scope->outer_function = current_function_scope;
+ current_function_scope = current_scope;
+
+ keep_next_level_flag = false;
+ next_is_function_body = false;
}
else
{
- struct binding_level *newlevel = make_binding_level ();
+ struct c_scope *scope = make_scope ();
- newlevel->keep = keep_next_level_flag;
- newlevel->level_chain = current_binding_level;
- current_binding_level = newlevel;
- keep_next_level_flag = 0;
+ scope->keep = keep_next_level_flag;
+ scope->outer = current_scope;
+ current_scope = scope;
+ keep_next_level_flag = false;
}
}
-/* Exit a binding level.
- Pop the level off, and restore the state of the identifier-decl mappings
- that were in effect when this level was entered.
+/* Exit a scope. Restore the state of the identifier-decl mappings
+ that were in effect when this scope was entered.
+
+ If KEEP is KEEP_YES (1), this scope had explicit declarations, so
+ create a BLOCK node to record its declarations and subblocks for
+ debugging output. If KEEP is KEEP_MAYBE, do so only if the names
+ or tags lists are nonempty.
- If KEEP is nonzero, this level had explicit declarations, so
- and create a "block" (a BLOCK node) for the level
- to record its declarations and subblocks for symbol table output.
+ The second parameter is ignored; it is present only for
+ signature compatibility with lang_hooks.decls.poplevel.
If FUNCTIONBODY is nonzero, this level is the body of a function,
- so create a block as if KEEP were set and also clear out all
- label names.
+ even if current_scope->function_body is not set. This is used
+ by language-independent code that generates synthetic functions,
+ and cannot set current_scope->function_body.
- If REVERSE is nonzero, reverse the order of decls before putting
- them into the BLOCK. */
+ FIXME: Eliminate the need for all arguments. */
tree
-poplevel (int keep, int reverse, int functionbody)
+poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody)
{
- tree link;
+ struct c_scope *scope = current_scope;
tree block;
tree decl;
- tree decls = current_binding_level->names;
- tree tags = current_binding_level->tags;
- tree subblocks = current_binding_level->blocks;
-
- functionbody |= current_binding_level->function_body;
- keep |= (current_binding_level->keep || functionbody
- || (current_binding_level->keep_if_subblocks && subblocks != 0));
+ tree p;
- /* We used to warn about unused variables in expand_end_bindings,
- i.e. while generating RTL. But in function-at-a-time mode we may
- choose to never expand a function at all (e.g. auto inlining), so
- we do this explicitly now. */
- warn_about_unused_variables (decls);
+ /* The following line does not use |= due to a bug in HP's C compiler */
+ scope->function_body = scope->function_body | functionbody;
- /* Clear out the name-meanings declared on this level.
- Propagate TREE_ADDRESSABLE from nested functions to their
- containing functions. */
- for (link = decls; link; link = TREE_CHAIN (link))
- {
- if (DECL_NAME (link) != 0)
- {
- if (DECL_EXTERNAL (link))
- /* External decls stay in the symbol-value slot but are
- inaccessible. */
- C_DECL_INVISIBLE (link) = 1;
- else
- IDENTIFIER_SYMBOL_VALUE (DECL_NAME (link)) = 0;
- }
-
- if (TREE_CODE (link) == FUNCTION_DECL
- && ! TREE_ASM_WRITTEN (link)
- && DECL_INITIAL (link) != 0
- && TREE_ADDRESSABLE (link)
- && DECL_ABSTRACT_ORIGIN (link) != 0
- && DECL_ABSTRACT_ORIGIN (link) != link)
- TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (link)) = 1;
- }
-
- /* Clear out the tag-meanings declared on this level. */
- for (link = tags; link; link = TREE_CHAIN (link))
- if (TREE_PURPOSE (link))
- IDENTIFIER_TAG_VALUE (TREE_PURPOSE (link)) = 0;
-
- /* Restore all name-meanings of the outer levels
- that were shadowed by this level. */
+ if (keep == KEEP_MAYBE)
+ keep = (scope->names || scope->tags);
- for (link = current_binding_level->shadowed; link; link = TREE_CHAIN (link))
- IDENTIFIER_SYMBOL_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
-
- /* Restore all tag-meanings of the outer levels
- that were shadowed by this level. */
-
- for (link = current_binding_level->shadowed_tags; link;
- link = TREE_CHAIN (link))
- IDENTIFIER_TAG_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
-
- /* If this is the top level block of a function, remove all
- PARM_DECLs from current_binding_level->names; they are already
- stored in DECL_ARGUMENTS of cfun->decl in proper order, should
- not be put in BLOCK_VARS, and furthermore reversing them will
- cause trouble later. They are all together at the end of the
- list. */
- if (functionbody && decls)
- {
- if (TREE_CODE (decls) == PARM_DECL)
- decls = 0;
- else
- {
- link = decls;
- while (TREE_CHAIN (link)
- && TREE_CODE (TREE_CHAIN (link)) != PARM_DECL)
- link = TREE_CHAIN (link);
-
- TREE_CHAIN (link) = 0;
- }
- }
-
- /* Get the decls in the order they were written.
- Usually current_binding_level->names is in reverse order.
- But parameter decls were previously put in forward order. */
-
- if (reverse)
- decls = nreverse (decls);
-
- /* If there were any declarations or structure tags in that level,
- or if this level is a function body,
- create a BLOCK to record them for the life of this function. */
+ keep |= scope->keep;
+ keep |= scope->function_body;
+ /* If appropriate, create a BLOCK to record the decls for the life
+ of this function. */
block = 0;
if (keep)
{
block = make_node (BLOCK);
- BLOCK_VARS (block) = decls;
- BLOCK_SUBBLOCKS (block) = subblocks;
+ BLOCK_VARS (block) = scope->names;
+ BLOCK_SUBBLOCKS (block) = scope->blocks;
TREE_USED (block) = 1;
}
/* In each subblock, record that this is its superior. */
+ for (p = scope->blocks; p; p = TREE_CHAIN (p))
+ BLOCK_SUPERCONTEXT (p) = block;
- for (link = subblocks; link; link = TREE_CHAIN (link))
- BLOCK_SUPERCONTEXT (link) = block;
-
- /* Set the TYPE_CONTEXTs for all of the tagged types belonging to this
- binding contour so that they point to the appropriate construct, i.e.
- either to the current FUNCTION_DECL node, or else to the BLOCK node
- we just constructed.
+ /* Clear out the variable bindings in this scope.
- Note that for tagged types whose scope is just the formal parameter
- list for some function type specification, we can't properly set
- their TYPE_CONTEXTs here, because we don't have a pointer to the
- appropriate FUNCTION_TYPE node readily available to us. For those
- cases, the TYPE_CONTEXTs of the relevant tagged type nodes get set
- in `grokdeclarator' as soon as we have created the FUNCTION_TYPE
- node which will represent the "scope" for these "parameter list local"
- tagged types. */
-
- decl = functionbody ? current_function_decl : block;
- if (decl)
- for (link = tags; link; link = TREE_CHAIN (link))
- TYPE_CONTEXT (TREE_VALUE (link)) = decl;
+ Propagate TREE_ADDRESSABLE from nested functions to their
+ containing functions.
- /* If the level being exited is the top level of a function, check
- over all the labels, and clear out the current (function local)
- meanings of their names. Then add them to BLOCK_VARS. */
+ Issue warnings for unused variables and labels, and errors for
+ undefined labels, if there are any. */
- if (functionbody)
+ for (p = scope->names; p; p = TREE_CHAIN (p))
{
- for (link = named_labels; link; link = TREE_CHAIN (link))
+ switch (TREE_CODE (p))
{
- tree label = TREE_VALUE (link);
+ case LABEL_DECL:
+ if (TREE_USED (p) && !DECL_INITIAL (p))
+ {
+ error ("%Jlabel `%D' used but not defined", p, p);
+ DECL_INITIAL (p) = error_mark_node;
+ }
+ else if (!TREE_USED (p) && warn_unused_label)
+ {
+ if (DECL_INITIAL (p))
+ warning ("%Jlabel `%D' defined but not used", p, p);
+ else
+ warning ("%Jlabel `%D' declared but not defined", p, p);
+ }
- if (DECL_INITIAL (label) == 0)
+ IDENTIFIER_LABEL_VALUE (DECL_NAME (p)) = 0;
+ break;
+
+ case FUNCTION_DECL:
+ if (! TREE_ASM_WRITTEN (p)
+ && DECL_INITIAL (p) != 0
+ && TREE_ADDRESSABLE (p)
+ && DECL_ABSTRACT_ORIGIN (p) != 0
+ && DECL_ABSTRACT_ORIGIN (p) != p)
+ TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (p)) = 1;
+ goto normal;
+
+ case VAR_DECL:
+ /* Keep this in sync with stmt.c:warn_about_unused_variables.
+ No warnings when the global scope is popped because the
+ global scope isn't popped for the last translation unit,
+ so the warnings are done in c_write_global_declaration. */
+ if (warn_unused_variable && scope != global_scope
+ && !TREE_USED (p)
+ && !DECL_IN_SYSTEM_HEADER (p)
+ && DECL_NAME (p)
+ && !DECL_ARTIFICIAL (p))
+ warning ("%Junused variable `%D'", p, p);
+ /* fall through */
+
+ default:
+ normal:
+ if (DECL_NAME (p))
{
- error_with_decl (label, "label `%s' used but not defined");
- /* Avoid crashing later. */
- define_label (input_location, DECL_NAME (label));
+ if (DECL_EXTERNAL (p) && scope != global_scope)
+ /* External decls stay in the symbol-value slot but are
+ inaccessible. */
+ C_DECL_INVISIBLE (p) = 1;
+ else
+ IDENTIFIER_SYMBOL_VALUE (DECL_NAME (p)) = 0;
}
- else if (warn_unused_label && !TREE_USED (label))
- warning_with_decl (label, "label `%s' defined but not used");
- IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
-
- /* Put the labels into the "variables" of the
- top-level block, so debugger can see them. */
- TREE_CHAIN (label) = BLOCK_VARS (block);
- BLOCK_VARS (block) = label;
+ break;
}
}
- /* Pop the current level, and free the structure for reuse. */
+ /* Clear out the parameter bindings in this scope, if any.
+ Unused-parameter warnings are handled by function.c. */
+ for (p = scope->parms; p; p = TREE_CHAIN (p))
+ if (DECL_NAME (p))
+ IDENTIFIER_SYMBOL_VALUE (DECL_NAME (p)) = 0;
+
+ /* Clear out the tag-meanings declared in this scope.
+
+ Set the TYPE_CONTEXTs for all of the tagged types belonging to
+ this scope so that they point to the appropriate construct, i.e.
+ either to the current FUNCTION_DECL node, or else to the BLOCK
+ node we just constructed.
+
+ Note that for tagged types whose scope is just the formal
+ parameter list for some function type specification, we can't
+ properly set their TYPE_CONTEXTs here, because we don't have a
+ pointer to the appropriate FUNCTION_TYPE node readily available
+ to us. For those cases, the TYPE_CONTEXTs of the relevant tagged
+ type nodes get set in `grokdeclarator' as soon as we have created
+ the FUNCTION_TYPE node which will represent the "scope" for these
+ "parameter list local" tagged types. */
+
+ decl = scope->function_body ? current_function_decl : block;
+ for (p = scope->tags; p; p = TREE_CHAIN (p))
+ {
+ if (TREE_PURPOSE (p))
+ IDENTIFIER_TAG_VALUE (TREE_PURPOSE (p)) = 0;
+ if (decl)
+ TYPE_CONTEXT (TREE_VALUE (p)) = decl;
+ }
+
+ /* Restore all name- and label-meanings from outer scopes that were
+ shadowed by this scope. */
+ for (p = scope->shadowed; p; p = TREE_CHAIN (p))
+ if (TREE_VALUE (p) && TREE_CODE (TREE_VALUE (p)) == LABEL_DECL)
+ IDENTIFIER_LABEL_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p);
+ else
+ IDENTIFIER_SYMBOL_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p);
- pop_binding_level (&current_binding_level);
+ /* Restore all tag-meanings from outer scopes that were shadowed by
+ this scope. */
+ for (p = scope->shadowed_tags; p; p = TREE_CHAIN (p))
+ IDENTIFIER_TAG_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p);
/* Dispose of the block that we just made inside some higher level. */
- if (functionbody)
+ if (scope->function_body)
DECL_INITIAL (current_function_decl) = block;
- else if (block)
- current_binding_level->blocks
- = chainon (current_binding_level->blocks, block);
- /* If we did not make a block for the level just exited,
- any blocks made for inner levels
- (since they cannot be recorded as subblocks in that level)
- must be carried forward so they will later become subblocks
- of something else. */
- else if (subblocks)
- current_binding_level->blocks
- = chainon (current_binding_level->blocks, subblocks);
+ else if (scope->outer)
+ {
+ if (block)
+ SCOPE_LIST_APPEND (scope->outer, blocks, block);
+ /* If we did not make a block for the scope just exited, any
+ blocks made for inner scopes must be carried forward so they
+ will later become subblocks of something else. */
+ else if (scope->blocks)
+ SCOPE_LIST_CONCAT (scope->outer, blocks, scope, blocks);
+ }
+
+ /* Pop the current scope, and free the structure for reuse. */
+ pop_scope ();
return block;
}
-/* 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. */
+/* Insert BLOCK at the end of the list of subblocks of the current
+ scope. This is used when a BIND_EXPR is expanded, to handle the
+ BLOCK node inside the BIND_EXPR. */
void
insert_block (tree block)
{
TREE_USED (block) = 1;
- current_binding_level->blocks
- = chainon (current_binding_level->blocks, block);
+ SCOPE_LIST_APPEND (current_scope, blocks, block);
}
/* Set the BLOCK node for the innermost scope (the one we are
@@ -662,75 +712,6 @@ set_block (tree block ATTRIBUTE_UNUSED)
{
}
-void
-push_label_level (void)
-{
- struct binding_level *newlevel;
-
- newlevel = make_binding_level ();
-
- /* Add this level to the front of the chain (stack) of label levels. */
-
- newlevel->level_chain = label_level_chain;
- label_level_chain = newlevel;
-
- newlevel->names = named_labels;
- newlevel->shadowed = shadowed_labels;
- named_labels = 0;
- shadowed_labels = 0;
-}
-
-void
-pop_label_level (void)
-{
- struct binding_level *level = label_level_chain;
- tree link, prev;
-
- /* Clear out the definitions of the declared labels in this level.
- Leave in the list any ordinary, non-declared labels. */
- for (link = named_labels, prev = 0; link;)
- {
- if (C_DECLARED_LABEL_FLAG (TREE_VALUE (link)))
- {
- if (DECL_SOURCE_LINE (TREE_VALUE (link)) == 0)
- {
- error_with_decl (TREE_VALUE (link),
- "label `%s' used but not defined");
- /* Avoid crashing later. */
- define_label (input_location, DECL_NAME (TREE_VALUE (link)));
- }
- else if (warn_unused_label && !TREE_USED (TREE_VALUE (link)))
- warning_with_decl (TREE_VALUE (link),
- "label `%s' defined but not used");
- IDENTIFIER_LABEL_VALUE (DECL_NAME (TREE_VALUE (link))) = 0;
-
- /* Delete this element from the list. */
- link = TREE_CHAIN (link);
- if (prev)
- TREE_CHAIN (prev) = link;
- else
- named_labels = link;
- }
- else
- {
- prev = link;
- link = TREE_CHAIN (link);
- }
- }
-
- /* Bring back all the labels that were shadowed. */
- for (link = shadowed_labels; link; link = TREE_CHAIN (link))
- if (DECL_NAME (TREE_VALUE (link)) != 0)
- IDENTIFIER_LABEL_VALUE (DECL_NAME (TREE_VALUE (link)))
- = TREE_VALUE (link);
-
- named_labels = chainon (named_labels, level->names);
- shadowed_labels = level->shadowed;
-
- /* Pop the current level, and free the structure for reuse. */
- pop_binding_level (&label_level_chain);
-}
-
/* Push a definition or a declaration of struct, union or enum tag "name".
"type" should be the type node.
We assume that the tag "name" is not already defined.
@@ -741,12 +722,11 @@ pop_label_level (void)
void
pushtag (tree name, tree type)
{
- struct binding_level *b = current_binding_level;
+ struct c_scope *b = current_scope;
+ /* Record the identifier as the type's name if it has none. */
if (name)
{
- /* Record the identifier as the type's name if it has none. */
-
if (TYPE_NAME (type) == 0)
TYPE_NAME (type) = name;
@@ -759,7 +739,7 @@ pushtag (tree name, tree type)
b->tags = tree_cons (name, type, b->tags);
/* Create a fake NULL-named TYPE_DECL node whose TREE_TYPE will be the
- tagged type we just added to the current binding level. This fake
+ tagged type we just added to the current scope. This fake
NULL-named TYPE_DECL node helps dwarfout.c to know when it needs
to output a representation of a tagged type, and it also gives
us a convenient place to record the "scope start" address for the
@@ -772,6 +752,46 @@ pushtag (tree name, tree type)
TYPE_CONTEXT (type) = DECL_CONTEXT (TYPE_STUB_DECL (type));
}
+/* Subroutine of duplicate_decls. Allow harmless mismatches in return
+ and argument types provided that the type modes match. This function
+ return a unified type given a suitable match, and 0 otherwise. */
+
+static tree
+match_builtin_function_types (tree oldtype, tree newtype)
+{
+ tree newrettype, oldrettype;
+ tree newargs, oldargs;
+ tree trytype, tryargs;
+
+ /* Accept the return type of the new declaration if same modes. */
+ oldrettype = TREE_TYPE (oldtype);
+ newrettype = TREE_TYPE (newtype);
+
+ if (TYPE_MODE (oldrettype) != TYPE_MODE (newrettype))
+ return 0;
+
+ oldargs = TYPE_ARG_TYPES (oldtype);
+ newargs = TYPE_ARG_TYPES (newtype);
+ tryargs = newargs;
+
+ while (oldargs || newargs)
+ {
+ if (! oldargs
+ || ! newargs
+ || ! TREE_VALUE (oldargs)
+ || ! TREE_VALUE (newargs)
+ || TYPE_MODE (TREE_VALUE (oldargs))
+ != TYPE_MODE (TREE_VALUE (newargs)))
+ return 0;
+
+ oldargs = TREE_CHAIN (oldargs);
+ newargs = TREE_CHAIN (newargs);
+ }
+
+ trytype = build_function_type (newrettype, tryargs);
+ return build_type_attribute_variant (trytype, TYPE_ATTRIBUTES (oldtype));
+}
+
/* Handle when a new declaration NEWDECL
has the same name as an old one OLDDECL
in the same binding contour.
@@ -781,12 +801,14 @@ pushtag (tree name, tree type)
Otherwise, return 0.
When DIFFERENT_BINDING_LEVEL is true, NEWDECL is an external declaration,
- and OLDDECL is in an outer binding level and should thus not be changed. */
+ and OLDDECL is in an outer scope and should thus not be changed. */
static int
-duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
+duplicate_decls (tree newdecl, tree olddecl, int different_binding_level,
+ int different_tu)
{
- int types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl));
+ int types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl),
+ COMPARE_STRICT);
int new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL
&& DECL_INITIAL (newdecl) != 0);
tree oldtype = TREE_TYPE (olddecl);
@@ -812,19 +834,19 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
&& DECL_UNINLINABLE (olddecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl)))
{
- warning_with_decl (newdecl,
- "function `%s' redeclared as inline");
- warning_with_decl (olddecl,
- "previous declaration of function `%s' with attribute noinline");
+ warning ("%Jfunction '%D' redeclared as inline",
+ newdecl, newdecl);
+ warning ("%Jprevious declaration of function '%D' "
+ "with attribute noinline", olddecl, olddecl);
}
else if (DECL_DECLARED_INLINE_P (olddecl)
&& DECL_UNINLINABLE (newdecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
{
- warning_with_decl (newdecl,
- "function `%s' redeclared with attribute noinline");
- warning_with_decl (olddecl,
- "previous declaration of function `%s' was inline");
+ warning ("%Jfunction '%D' redeclared with attribute noinline",
+ newdecl, newdecl);
+ warning ("%Jprevious declaration of function '%D' was inline",
+ olddecl, olddecl);
}
}
@@ -850,16 +872,18 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
if (!TREE_PUBLIC (newdecl))
{
if (warn_shadow)
- warning_with_decl (newdecl, "shadowing built-in function `%s'");
+ warning ("%Jshadowing built-in function '%D'",
+ newdecl, newdecl);
}
else
- warning_with_decl (newdecl,
- "built-in function `%s' declared as non-function");
+ warning ("%Jbuilt-in function '%D' declared as non-function",
+ newdecl, newdecl);
}
else
{
- error_with_decl (newdecl, "`%s' redeclared as different kind of symbol");
- error_with_decl (olddecl, "previous declaration of `%s'");
+ error ("%J'%D' redeclared as different kind of symbol",
+ newdecl, newdecl);
+ error ("%Jprevious declaration of '%D'", olddecl, olddecl);
}
return 0;
@@ -888,76 +912,30 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
built-in definition is overridden,
but optionally warn this was a bad choice of name. */
if (warn_shadow)
- warning_with_decl (newdecl, "shadowing built-in function `%s'");
+ warning ("%Jshadowing built-in function '%D'", newdecl, newdecl);
/* Discard the old built-in function. */
return 0;
}
- else if (!types_match)
+ if (!types_match)
{
- /* Accept the return type of the new declaration if same modes. */
- tree oldreturntype = TREE_TYPE (oldtype);
- tree newreturntype = TREE_TYPE (newtype);
-
- if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype))
- {
- /* Function types may be shared, so we can't just modify
- the return type of olddecl's function type. */
- tree trytype
- = build_function_type (newreturntype,
- TYPE_ARG_TYPES (oldtype));
- trytype = build_type_attribute_variant (trytype,
- TYPE_ATTRIBUTES (oldtype));
-
- types_match = comptypes (newtype, trytype);
- if (types_match)
- oldtype = trytype;
- }
- /* Accept harmless mismatch in first argument type also.
+ /* Accept harmless mismatch in function types.
This is for the ffs and fprintf builtins. */
- if (TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != 0
- && TYPE_ARG_TYPES (oldtype) != 0
- && TREE_VALUE (TYPE_ARG_TYPES (newtype)) != 0
- && TREE_VALUE (TYPE_ARG_TYPES (oldtype)) != 0
- && (TYPE_MODE (TREE_VALUE (TYPE_ARG_TYPES (newtype)))
- == TYPE_MODE (TREE_VALUE (TYPE_ARG_TYPES (oldtype)))))
+ tree trytype = match_builtin_function_types (oldtype, newtype);
+
+ if (trytype)
{
- /* Function types may be shared, so we can't just modify
- the return type of olddecl's function type. */
- tree trytype
- = build_function_type (TREE_TYPE (oldtype),
- tree_cons (NULL_TREE,
- TREE_VALUE (TYPE_ARG_TYPES (newtype)),
- TREE_CHAIN (TYPE_ARG_TYPES (oldtype))));
- trytype = build_type_attribute_variant (trytype,
- TYPE_ATTRIBUTES (oldtype));
-
- types_match = comptypes (newtype, trytype);
+ types_match = comptypes (newtype, trytype, COMPARE_STRICT);
if (types_match)
oldtype = trytype;
+ if (! different_binding_level)
+ TREE_TYPE (olddecl) = oldtype;
}
- if (! different_binding_level)
- TREE_TYPE (olddecl) = oldtype;
- }
- else if (TYPE_ARG_TYPES (oldtype) == NULL
- && TYPE_ARG_TYPES (newtype) != NULL)
- {
- /* For bcmp, bzero, fputs the builtin type has arguments not
- specified. Use the ones from the prototype so that type checking
- is done for them. */
- tree trytype
- = build_function_type (TREE_TYPE (oldtype),
- TYPE_ARG_TYPES (newtype));
- trytype = build_type_attribute_variant (trytype,
- TYPE_ATTRIBUTES (oldtype));
-
- oldtype = trytype;
- if (! different_binding_level)
- TREE_TYPE (olddecl) = oldtype;
}
if (!types_match)
{
/* If types don't match for a built-in, throw away the built-in. */
- warning_with_decl (newdecl, "conflicting types for built-in function `%s'");
+ warning ("%Jconflicting types for built-in function '%D'",
+ newdecl, newdecl);
return 0;
}
}
@@ -1000,7 +978,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
&& TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (oldtype))) == void_type_node)))
{
if (pedantic)
- pedwarn_with_decl (newdecl, "conflicting types for `%s'");
+ pedwarn ("%Jconflicting types for '%D'", newdecl, newdecl);
/* Make sure we keep void * as ret type, not char *. */
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (oldtype))) == void_type_node)
TREE_TYPE (newdecl) = newtype = oldtype;
@@ -1018,7 +996,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
&& TYPE_MAIN_VARIANT (TREE_TYPE (newtype)) == integer_type_node
&& C_FUNCTION_IMPLICIT_INT (newdecl))
{
- pedwarn_with_decl (newdecl, "conflicting types for `%s'");
+ pedwarn ("%Jconflicting types for '%D'", newdecl, newdecl);
/* Make sure we keep void as the return type. */
TREE_TYPE (newdecl) = newtype = oldtype;
C_FUNCTION_IMPLICIT_INT (newdecl) = 0;
@@ -1030,15 +1008,15 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
&& ! pedantic
/* Return types must still match. */
&& comptypes (TREE_TYPE (oldtype),
- TREE_TYPE (newtype))
+ TREE_TYPE (newtype), COMPARE_STRICT)
&& TYPE_ARG_TYPES (newtype) == 0))
{
- error_with_decl (newdecl, "conflicting types for `%s'");
+ error ("%Jconflicting types for '%D'", newdecl, newdecl);
/* Check for function type mismatch
involving an empty arglist vs a nonempty one. */
if (TREE_CODE (olddecl) == FUNCTION_DECL
&& comptypes (TREE_TYPE (oldtype),
- TREE_TYPE (newtype))
+ TREE_TYPE (newtype), COMPARE_STRICT)
&& ((TYPE_ARG_TYPES (oldtype) == 0
&& DECL_INITIAL (olddecl) == 0)
||
@@ -1068,9 +1046,9 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
}
}
if (C_DECL_IMPLICIT (olddecl))
- error_with_decl (olddecl, "previous implicit declaration of `%s'");
+ error ("%Jprevious implicit declaration of '%D'", olddecl, olddecl);
else
- error_with_decl (olddecl, "previous declaration of `%s'");
+ error ("%Jprevious declaration of '%D'", olddecl, olddecl);
/* This is safer because the initializer might contain references
to variables that were declared between olddecl and newdecl. This
@@ -1083,15 +1061,17 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
else if (TREE_CODE (olddecl) == VAR_DECL && TREE_CODE (newdecl) == VAR_DECL
&& !DECL_THREAD_LOCAL (olddecl) && DECL_THREAD_LOCAL (newdecl))
{
- error_with_decl (newdecl, "thread-local declaration of `%s' follows non thread-local declaration");
- error_with_decl (olddecl, "previous declaration of `%s'");
+ error ("%Jthread-local declaration of '%D' follows non thread-local "
+ "declaration", newdecl, newdecl);
+ error ("%Jprevious declaration of '%D'", olddecl, olddecl);
}
/* non-TLS declaration cannot follow TLS declaration. */
else if (TREE_CODE (olddecl) == VAR_DECL && TREE_CODE (newdecl) == VAR_DECL
&& DECL_THREAD_LOCAL (olddecl) && !DECL_THREAD_LOCAL (newdecl))
{
- error_with_decl (newdecl, "non thread-local declaration of `%s' follows thread-local declaration");
- error_with_decl (olddecl, "previous declaration of `%s'");
+ error ("%Jnon thread-local declaration of '%D' follows "
+ "thread-local declaration", newdecl, newdecl);
+ error ("%Jprevious declaration of '%D'", olddecl, olddecl);
}
else
{
@@ -1101,36 +1081,34 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
switch (errmsg)
{
case 1:
- error_with_decl (newdecl, "redefinition of `%s'");
+ error ("%Jredefinition of '%D'", newdecl, newdecl);
break;
case 2:
- error_with_decl (newdecl, "redeclaration of `%s'");
+ error ("%Jredeclaration of '%D'", newdecl, newdecl);
break;
case 3:
- error_with_decl (newdecl, "conflicting declarations of `%s'");
+ error ("%Jconflicting declarations of '%D'", newdecl, newdecl);
break;
default:
abort ();
}
- error_with_decl (olddecl,
- ((DECL_INITIAL (olddecl)
- && current_binding_level == global_binding_level)
- ? "`%s' previously defined here"
- : "`%s' previously declared here"));
+ if (DECL_INITIAL (olddecl)
+ && current_scope == global_scope)
+ error ("%J'%D' previously defined here", olddecl, olddecl);
+ else
+ error ("%J'%D' previously declared here", olddecl, olddecl);
return 0;
}
else if (TREE_CODE (newdecl) == TYPE_DECL
&& (DECL_IN_SYSTEM_HEADER (olddecl)
|| DECL_IN_SYSTEM_HEADER (newdecl)))
{
- warning_with_decl (newdecl, "redefinition of `%s'");
- warning_with_decl
- (olddecl,
- ((DECL_INITIAL (olddecl)
- && current_binding_level == global_binding_level)
- ? "`%s' previously defined here"
- : "`%s' previously declared here"));
+ warning ("%Jredefinition of '%D'", newdecl, newdecl);
+ if (DECL_INITIAL (olddecl) && current_scope == global_scope)
+ warning ("%J'%D' previously defined here", olddecl, olddecl);
+ else
+ warning ("%J'%D' previously declared here", olddecl, olddecl);
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_INITIAL (olddecl) != 0
@@ -1151,27 +1129,27 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
if (TYPE_MAIN_VARIANT (TREE_VALUE (parm)) == void_type_node
&& TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
{
- warning_with_decl (newdecl, "prototype for `%s' follows");
- warning_with_decl (olddecl, "non-prototype definition here");
+ warning ("%Jprototype for '%D' follows", newdecl, newdecl);
+ warning ("%Jnon-prototype definition here", olddecl);
break;
}
if (TYPE_MAIN_VARIANT (TREE_VALUE (parm)) == void_type_node
|| TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
{
- error_with_decl (newdecl,
- "prototype for `%s' follows and number of arguments doesn't match");
- error_with_decl (olddecl, "non-prototype definition here");
+ error ("%Jprototype for '%D' follows and number of "
+ "arguments doesn't match", newdecl, newdecl);
+ error ("%Jnon-prototype definition here", olddecl);
errmsg = 1;
break;
}
/* Type for passing arg must be consistent
with that declared for the arg. */
- if (! comptypes (TREE_VALUE (parm), TREE_VALUE (type)))
+ if (! comptypes (TREE_VALUE (parm), TREE_VALUE (type),
+ COMPARE_STRICT))
{
- error_with_decl (newdecl,
- "prototype for `%s' follows and argument %d doesn't match",
- nargs);
- error_with_decl (olddecl, "non-prototype definition here");
+ error ("%Jprototype for '%D' follows and argument %d "
+ "doesn't match", newdecl, newdecl, nargs);
+ error ("%Jnon-prototype definition here", olddecl);
errmsg = 1;
break;
}
@@ -1186,43 +1164,47 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
&& ! DECL_DECLARED_INLINE_P (olddecl)
&& DECL_DECLARED_INLINE_P (newdecl)
&& TREE_USED (olddecl))
- warning_with_decl (newdecl,
- "`%s' declared inline after being called");
+ warning ("%J'%D' declared inline after being called",
+ newdecl, newdecl);
if (TREE_CODE (olddecl) == FUNCTION_DECL
&& ! DECL_DECLARED_INLINE_P (olddecl)
&& DECL_DECLARED_INLINE_P (newdecl)
&& DECL_INITIAL (olddecl) != 0)
- warning_with_decl (newdecl,
- "`%s' declared inline after its definition");
+ warning ("%J'%D' declared inline after its definition",
+ newdecl, newdecl);
/* If pedantic, warn when static declaration follows a non-static
- declaration. Otherwise, do so only for functions. */
+ declaration. Otherwise, do so only for functions. */
if ((pedantic || TREE_CODE (olddecl) == FUNCTION_DECL)
&& TREE_PUBLIC (olddecl)
&& !TREE_PUBLIC (newdecl))
- warning_with_decl (newdecl, "static declaration for `%s' follows non-static");
+ warning ("%Jstatic declaration for '%D' follows non-static",
+ newdecl, newdecl);
/* If warn_traditional, warn when a non-static function
- declaration follows a static one. */
+ declaration follows a static one. */
if (warn_traditional && !in_system_header
&& TREE_CODE (olddecl) == FUNCTION_DECL
&& !TREE_PUBLIC (olddecl)
&& TREE_PUBLIC (newdecl))
- warning_with_decl (newdecl, "non-static declaration for `%s' follows static");
+ warning ("%Jnon-static declaration for '%D' follows static",
+ newdecl, newdecl);
/* Warn when const declaration follows a non-const
declaration, but not for functions. */
if (TREE_CODE (olddecl) != FUNCTION_DECL
&& !TREE_READONLY (olddecl)
&& TREE_READONLY (newdecl))
- warning_with_decl (newdecl, "const declaration for `%s' follows non-const");
+ warning ("%Jconst declaration for '%D' follows non-const",
+ newdecl, newdecl);
/* These bits are logically part of the type, for variables.
But not for functions
(where qualifiers are not valid ANSI anyway). */
else if (pedantic && TREE_CODE (olddecl) != FUNCTION_DECL
&& (TREE_READONLY (newdecl) != TREE_READONLY (olddecl)
|| TREE_THIS_VOLATILE (newdecl) != TREE_THIS_VOLATILE (olddecl)))
- pedwarn_with_decl (newdecl, "type qualifiers for `%s' conflict with previous decl");
+ pedwarn ("%Jtype qualifiers for '%D' conflict with previous "
+ "declaration", newdecl, newdecl);
}
}
@@ -1235,8 +1217,9 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
/* Don't warn about extern decl followed by (tentative) definition. */
&& !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl)))
{
- warning_with_decl (newdecl, "redundant redeclaration of `%s' in same scope");
- warning_with_decl (olddecl, "previous declaration of `%s'");
+ warning ("%Jredundant redeclaration of '%D' in same scope",
+ newdecl, newdecl);
+ warning ("%Jprevious declaration of '%D'", olddecl, olddecl);
}
/* Copy all the DECL_... slots specified in the new decl
@@ -1393,7 +1376,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
}
if (DECL_EXTERNAL (newdecl))
{
- if (! different_binding_level)
+ if (! different_binding_level || different_tu)
{
/* Don't mess with these flags on local externs; they remain
external even if there's a declaration at file scope which
@@ -1404,7 +1387,13 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
/* An extern decl does not override previous storage class. */
TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl);
if (! DECL_EXTERNAL (newdecl))
- DECL_CONTEXT (newdecl) = DECL_CONTEXT (olddecl);
+ {
+ DECL_CONTEXT (newdecl) = DECL_CONTEXT (olddecl);
+ /* If we have two non-EXTERNAL file-scope decls that are
+ the same, only one of them should be written out. */
+ if (different_tu)
+ TREE_ASM_WRITTEN (newdecl) = 1;
+ }
}
else
{
@@ -1578,15 +1567,13 @@ warn_if_shadowing (tree x, tree old)
It would be nice to avoid warning in any function
declarator in a declaration, as opposed to a definition,
but there is no way to tell it's not a definition. */
- || (TREE_CODE (x) == PARM_DECL
- && current_binding_level->level_chain->parm_flag))
+ || (TREE_CODE (x) == PARM_DECL && current_scope->outer->parm_flag))
return;
name = IDENTIFIER_POINTER (DECL_NAME (x));
-
if (TREE_CODE (old) == PARM_DECL)
shadow_warning (SW_PARAM, name, old);
- else if (DECL_CONTEXT (old) == 0)
+ else if (DECL_FILE_SCOPE_P (old))
shadow_warning (SW_GLOBAL, name, old);
else
shadow_warning (SW_LOCAL, name, old);
@@ -1669,7 +1656,7 @@ tree
pushdecl (tree x)
{
tree name = DECL_NAME (x);
- struct binding_level *scope = current_binding_level;
+ struct c_scope *scope = current_scope;
#ifdef ENABLE_CHECKING
if (error_mark_node == 0)
@@ -1679,33 +1666,50 @@ pushdecl (tree x)
/* Functions need the lang_decl data. */
if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_LANG_SPECIFIC (x))
- DECL_LANG_SPECIFIC (x) = (struct lang_decl *)
- ggc_alloc_cleared (sizeof (struct lang_decl));
+ DECL_LANG_SPECIFIC (x) = ggc_alloc_cleared (sizeof (struct lang_decl));
/* A local extern declaration for a function doesn't constitute nesting.
A local auto declaration does, since it's a forward decl
for a nested function coming later. */
- if ((TREE_CODE (x) == FUNCTION_DECL || TREE_CODE (x) == VAR_DECL)
- && DECL_INITIAL (x) == 0 && DECL_EXTERNAL (x))
- DECL_CONTEXT (x) = 0;
+ if (current_function_decl == NULL
+ || ((TREE_CODE (x) == FUNCTION_DECL || TREE_CODE (x) == VAR_DECL)
+ && DECL_INITIAL (x) == 0 && DECL_EXTERNAL (x)))
+ DECL_CONTEXT (x) = current_file_decl;
else
DECL_CONTEXT (x) = current_function_decl;
-
+
if (name)
{
tree old;
if (warn_nested_externs
- && scope != global_binding_level
+ && scope != global_scope
&& DECL_EXTERNAL (x)
&& !DECL_IN_SYSTEM_HEADER (x))
warning ("nested extern declaration of `%s'",
IDENTIFIER_POINTER (name));
old = lookup_name_current_level (name);
- if (old && duplicate_decls (x, old, 0))
- return old;
- if (DECL_EXTERNAL (x) || scope == global_binding_level)
+ if (old && duplicate_decls (x, old, 0, false))
+ {
+ /* For PARM_DECLs, old may be a forward declaration.
+ If so, we want to remove it from its old location
+ (in the variables chain) and rechain it in the
+ location given by the new declaration. */
+ if (TREE_CODE (x) == PARM_DECL)
+ {
+ tree *p;
+ for (p = &scope->names; *p; p = &TREE_CHAIN (*p))
+ if (*p == old)
+ {
+ *p = TREE_CHAIN (old);
+ SCOPE_LIST_APPEND (scope, parms, old);
+ break;
+ }
+ }
+ return old;
+ }
+ 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
@@ -1714,7 +1718,8 @@ pushdecl (tree x)
tree ext = any_external_decl (name);
if (ext)
{
- if (duplicate_decls (x, ext, scope != global_binding_level))
+ if (duplicate_decls (x, ext, scope != global_scope,
+ false))
x = copy_node (ext);
}
else
@@ -1726,10 +1731,10 @@ pushdecl (tree x)
/* If storing a local value, there may already be one
(inherited). If so, record it for restoration when this
- binding level ends. Take care not to do this if we are
- replacing an older decl in the same binding level (i.e.
- duplicate_decls returned false, above). */
- if (scope != global_binding_level
+ scope ends. Take care not to do this if we are replacing an
+ older decl in the same scope (i.e. duplicate_decls returned
+ false, above). */
+ if (scope != global_scope
&& IDENTIFIER_SYMBOL_VALUE (name)
&& IDENTIFIER_SYMBOL_VALUE (name) != old)
{
@@ -1738,11 +1743,16 @@ pushdecl (tree x)
scope->shadowed);
}
- /* Install the new declaration in the requested binding level. */
+ /* Install the new declaration in the requested scope. */
IDENTIFIER_SYMBOL_VALUE (name) = x;
C_DECL_INVISIBLE (x) = 0;
- /* Keep list of variables in this level with incomplete type.
+ /* If x's type is incomplete because it's based on a
+ structure or union which has not yet been fully declared,
+ attach it to that structure or union type, so we can go
+ back and complete the variable declaration later, if the
+ structure or union gets fully declared.
+
If the input is erroneous, we can have error_mark in the type
slot (e.g. "f(void a, ...)") - that doesn't count as an
incomplete type. */
@@ -1753,88 +1763,48 @@ pushdecl (tree x)
while (TREE_CODE (element) == ARRAY_TYPE)
element = TREE_TYPE (element);
- if (TREE_CODE (element) == RECORD_TYPE
- || TREE_CODE (element) == UNION_TYPE)
- scope->incomplete_list = tree_cons (NULL_TREE, x,
- scope->incomplete_list);
+ element = TYPE_MAIN_VARIANT (element);
+
+ if ((TREE_CODE (element) == RECORD_TYPE
+ || TREE_CODE (element) == UNION_TYPE)
+ && (TREE_CODE (x) != TYPE_DECL
+ || TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE)
+ && !COMPLETE_TYPE_P (element))
+ C_TYPE_INCOMPLETE_VARS (element)
+ = tree_cons (NULL_TREE, x, C_TYPE_INCOMPLETE_VARS (element));
}
}
- /* Put decls on list in reverse order.
- We will reverse them later if necessary. */
- TREE_CHAIN (x) = scope->names;
- scope->names = x;
+ if (TREE_CODE (x) == PARM_DECL)
+ SCOPE_LIST_APPEND (scope, parms, x);
+ else
+ SCOPE_LIST_APPEND (scope, names, x);
return x;
}
/* Record X as belonging to the global scope (C99 "file scope").
This is used only internally by the Objective-C front end,
- and is limited to its needs. It will hork if there is _any_
- visible binding for X (not just a global one). */
+ and is limited to its needs. duplicate_decls is not called;
+ if there is any preexisting decl for this identifier, it is an ICE. */
+
tree
pushdecl_top_level (tree x)
{
- tree name, old;
+ tree name;
if (TREE_CODE (x) != VAR_DECL)
abort ();
name = DECL_NAME (x);
- old = IDENTIFIER_SYMBOL_VALUE (name);
- if (old)
- {
- if (DECL_CONTEXT (old))
- abort ();
-
- if (!duplicate_decls (x, old, 0))
- abort ();
-
- return old;
- }
-
- DECL_CONTEXT (x) = 0;
- IDENTIFIER_SYMBOL_VALUE (name) = x;
- TREE_CHAIN (x) = global_binding_level->names;
- global_binding_level->names = x;
- return x;
-}
-
-/* Record X as belonging to the outermost scope of the current
- function. This is used only internally, by c_make_fname_decl and
- build_external_ref, and is limited to their needs. The NAME is
- provided as a separate argument because build_external_ref wants to
- use error_mark_node for X. For VAR_DECLs, duplicate_decls is not
- called; if there is any preexisting decl for this identifier, it is
- an ICE. */
-tree
-pushdecl_function_level (tree x, tree name)
-{
- struct binding_level *scope;
-
- scope = current_binding_level;
- while (scope->function_body == 0)
- scope = scope->level_chain;
- if (!scope)
+ if (IDENTIFIER_SYMBOL_VALUE (name))
abort ();
- if (x == error_mark_node)
- scope->shadowed = tree_cons (name, IDENTIFIER_SYMBOL_VALUE (name),
- scope->shadowed);
- else if (TREE_CODE (x) == VAR_DECL)
- {
- if (name != DECL_NAME (x))
- abort ();
- if (IDENTIFIER_SYMBOL_VALUE (name))
- abort ();
-
- DECL_CONTEXT (x) = current_function_decl;
- TREE_CHAIN (x) = scope->names;
- scope->names = x;
- }
-
+ DECL_CONTEXT (x) = current_file_decl;
IDENTIFIER_SYMBOL_VALUE (name) = x;
+
+ SCOPE_LIST_APPEND (global_scope, names, x);
return x;
}
@@ -1846,7 +1816,7 @@ implicitly_declare (tree functionid)
{
tree decl = any_external_decl (functionid);
- if (decl && decl != error_mark_node)
+ if (decl)
{
/* Implicit declaration of a function already declared
(somehow) in a different scope, or as a built-in.
@@ -1855,16 +1825,16 @@ implicitly_declare (tree functionid)
if (!C_DECL_IMPLICIT (decl))
{
implicit_decl_warning (DECL_NAME (decl));
- if (DECL_CONTEXT (decl))
- warning_with_decl (decl, "previous declaration of `%s'");
+ if (! DECL_FILE_SCOPE_P (decl))
+ warning ("%Jprevious declaration of '%D'", decl, decl);
C_DECL_IMPLICIT (decl) = 1;
}
/* If this function is global, then it must already be in the
- global binding level, so there's no need to push it again. */
- if (current_binding_level == global_binding_level)
+ global scope, so there's no need to push it again. */
+ if (current_scope == global_scope)
return decl;
/* If this is a local declaration, make a copy; we can't have
- the same DECL listed in two different binding levels. */
+ the same DECL listed in two different scopes. */
return pushdecl (copy_node (decl));
}
@@ -1875,16 +1845,15 @@ implicitly_declare (tree functionid)
C_DECL_IMPLICIT (decl) = 1;
implicit_decl_warning (functionid);
- /* ANSI standard says implicit declarations are in the innermost block.
+ /* C89 says implicit declarations are in the innermost block.
So we record the decl in the standard fashion. */
decl = pushdecl (decl);
/* No need to call objc_check_decl here - it's a function type. */
rest_of_decl_compilation (decl, NULL, 0, 0);
- /* Write a record describing this implicit function declaration to the
- prototypes file (if requested). */
-
+ /* Write a record describing this implicit function declaration
+ to the prototypes file (if requested). */
gen_aux_info_record (decl, 0, 1, 0);
/* Possibly apply some default attributes to this implicit declaration. */
@@ -1935,9 +1904,9 @@ redeclaration_error_message (tree newdecl, tree olddecl)
return 1;
return 0;
}
- else if (DECL_CONTEXT (newdecl) == NULL_TREE)
+ else if (DECL_FILE_SCOPE_P (newdecl))
{
- /* Objects declared at top level: */
+ /* Objects declared at file scope: */
/* If at least one is a reference, it's ok. */
if (DECL_EXTERNAL (newdecl) || DECL_EXTERNAL (olddecl))
return 0;
@@ -1950,7 +1919,7 @@ redeclaration_error_message (tree newdecl, tree olddecl)
return 3;
return 0;
}
- else if (current_binding_level->parm_flag
+ else if (current_scope->parm_flag
&& TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))
return 0;
else
@@ -1965,86 +1934,145 @@ redeclaration_error_message (tree newdecl, tree olddecl)
return 0;
}
}
-
-/* Get the LABEL_DECL corresponding to identifier ID as a label.
- Create one if none exists so far for the current function.
- This function is called for both label definitions and label references. */
-tree
-lookup_label (tree id)
+/* Issue an error message for a reference to an undeclared variable
+ ID, including a reference to a builtin outside of function-call
+ context. Establish a binding of the identifier to error_mark_node
+ in an appropriate scope, which will suppress further errors for the
+ same identifier. */
+void
+undeclared_variable (tree id)
{
- tree decl = IDENTIFIER_LABEL_VALUE (id);
+ static bool already = false;
+ struct c_scope *scope;
if (current_function_decl == 0)
{
- error ("label %s referenced outside of any function",
+ error ("`%s' undeclared here (not in a function)",
IDENTIFIER_POINTER (id));
- return 0;
+ scope = current_scope;
}
-
- /* Use a label already defined or ref'd with this name. */
- if (decl != 0)
+ else
{
- /* But not if it is inherited and wasn't declared to be inheritable. */
- if (DECL_CONTEXT (decl) != current_function_decl
- && ! C_DECLARED_LABEL_FLAG (decl))
- return shadow_label (id);
- return decl;
+ error ("`%s' undeclared (first use in this function)",
+ IDENTIFIER_POINTER (id));
+
+ if (! already)
+ {
+ error ("(Each undeclared identifier is reported only once");
+ error ("for each function it appears in.)");
+ already = true;
+ }
+
+ scope = current_function_scope;
}
- decl = build_decl (LABEL_DECL, id, void_type_node);
+ scope->shadowed = tree_cons (id, IDENTIFIER_SYMBOL_VALUE (id),
+ scope->shadowed);
+ IDENTIFIER_SYMBOL_VALUE (id) = error_mark_node;
+}
+
+/* Subroutine of lookup_label, declare_label, define_label: construct a
+ LABEL_DECL with all the proper frills. */
- /* A label not explicitly declared must be local to where it's ref'd. */
- DECL_CONTEXT (decl) = current_function_decl;
+static tree
+make_label (tree name, location_t location)
+{
+ tree label = build_decl (LABEL_DECL, name, void_type_node);
- DECL_MODE (decl) = VOIDmode;
+ DECL_CONTEXT (label) = current_function_decl;
+ DECL_MODE (label) = VOIDmode;
+ DECL_SOURCE_LOCATION (label) = location;
- /* Say where one reference is to the label,
- for the sake of the error if it is not defined. */
- DECL_SOURCE_LOCATION (decl) = input_location;
+ return label;
+}
- IDENTIFIER_LABEL_VALUE (id) = decl;
+/* Another subroutine of lookup_label, declare_label, define_label:
+ set up the binding of name to LABEL_DECL in the given SCOPE. */
- named_labels = tree_cons (NULL_TREE, decl, named_labels);
+static void
+bind_label (tree name, tree label, struct c_scope *scope)
+{
+ if (IDENTIFIER_LABEL_VALUE (name))
+ scope->shadowed = tree_cons (name, IDENTIFIER_LABEL_VALUE (name),
+ scope->shadowed);
+ IDENTIFIER_LABEL_VALUE (name) = label;
- return decl;
+ SCOPE_LIST_APPEND (scope, names, label);
}
-/* Make a label named NAME in the current function,
- shadowing silently any that may be inherited from containing functions
- or containing scopes.
-
- Note that valid use, if the label being shadowed
- comes from another scope in the same function,
- requires calling declare_nonlocal_label right away. */
+/* Get the LABEL_DECL corresponding to identifier NAME as a label.
+ Create one if none exists so far for the current function.
+ This is called when a label is used in a goto expression or
+ has its address taken. */
tree
-shadow_label (tree name)
+lookup_label (tree name)
{
- tree decl = IDENTIFIER_LABEL_VALUE (name);
+ tree label;
- if (decl != 0)
+ if (current_function_decl == 0)
{
- tree dup;
-
- /* Check to make sure that the label hasn't already been declared
- at this label scope */
- for (dup = named_labels; dup; dup = TREE_CHAIN (dup))
- if (TREE_VALUE (dup) == decl)
- {
- error ("duplicate label declaration `%s'",
- IDENTIFIER_POINTER (name));
- error_with_decl (TREE_VALUE (dup),
- "this is a previous declaration");
- /* Just use the previous declaration. */
- return lookup_label (name);
- }
+ error ("label %s referenced outside of any function",
+ IDENTIFIER_POINTER (name));
+ return 0;
+ }
- shadowed_labels = tree_cons (NULL_TREE, decl, shadowed_labels);
- IDENTIFIER_LABEL_VALUE (name) = decl = 0;
+ /* Use a label already defined or ref'd with this name, but not if
+ it is inherited from a containing function and wasn't declared
+ using __label__. */
+ label = IDENTIFIER_LABEL_VALUE (name);
+ if (label && (DECL_CONTEXT (label) == current_function_decl
+ || C_DECLARED_LABEL_FLAG (label)))
+ {
+ /* If the label has only been declared, update its apparent
+ location to point here, for better diagnostics if it
+ turns out not to have been defined. */
+ if (!TREE_USED (label))
+ DECL_SOURCE_LOCATION (label) = input_location;
+ return label;
}
- return lookup_label (name);
+ /* No label binding for that identifier; make one. */
+ label = make_label (name, input_location);
+
+ /* Ordinary labels go in the current function scope. */
+ bind_label (name, label, current_function_scope);
+ return label;
+}
+
+/* Make a label named NAME in the current function, shadowing silently
+ any that may be inherited from containing functions or containing
+ scopes. This is called for __label__ declarations. */
+
+/* Note that valid use, if the label being shadowed comes from another
+ scope in the same function, requires calling declare_nonlocal_label
+ right away. (Is this still true? -zw 2003-07-17) */
+
+tree
+declare_label (tree name)
+{
+ tree label = IDENTIFIER_LABEL_VALUE (name);
+ tree dup;
+
+ /* Check to make sure that the label hasn't already been declared
+ at this scope */
+ for (dup = current_scope->names; dup; dup = TREE_CHAIN (dup))
+ if (dup == label)
+ {
+ error ("duplicate label declaration `%s'", IDENTIFIER_POINTER (name));
+ error ("%Jthis is a previous declaration", dup);
+
+ /* Just use the previous declaration. */
+ return dup;
+ }
+
+ label = make_label (name, input_location);
+ C_DECLARED_LABEL_FLAG (label) = 1;
+
+ /* Declared labels go in the current scope. */
+ bind_label (name, label, current_scope);
+ return label;
}
/* Define a label, specifying the location in the source file.
@@ -2054,75 +2082,65 @@ shadow_label (tree name)
tree
define_label (location_t location, tree name)
{
- tree decl = lookup_label (name);
-
- /* If label with this name is known from an outer context, shadow it. */
- if (decl != 0 && DECL_CONTEXT (decl) != current_function_decl)
+ tree label;
+
+ /* Find any preexisting label with this name. It is an error
+ if that label has already been defined in this function, or
+ if there is a containing function with a declared label with
+ the same name. */
+ label = IDENTIFIER_LABEL_VALUE (name);
+
+ if (label
+ && ((DECL_CONTEXT (label) == current_function_decl
+ && DECL_INITIAL (label) != 0)
+ || (DECL_CONTEXT (label) != current_function_decl
+ && C_DECLARED_LABEL_FLAG (label))))
{
- shadowed_labels = tree_cons (NULL_TREE, decl, shadowed_labels);
- IDENTIFIER_LABEL_VALUE (name) = 0;
- decl = lookup_label (name);
+ error ("%Hduplicate label `%D'", &location, label);
+ if (DECL_INITIAL (label))
+ error ("%J`%D' previously defined here", label, label);
+ else
+ error ("%J`%D' previously declared here", label, label);
+ return 0;
}
-
- if (warn_traditional && !in_system_header && lookup_name (name))
- warning ("%Htraditional C lacks a separate namespace for labels, "
- "identifier `%s' conflicts", &location, IDENTIFIER_POINTER (name));
-
- if (DECL_INITIAL (decl) != 0)
+ else if (label && DECL_CONTEXT (label) == current_function_decl)
{
- error ("%Hduplicate label `%s'", &location, IDENTIFIER_POINTER (name));
- return 0;
+ /* The label has been used or declared already in this function,
+ but not defined. Update its location to point to this
+ definition. */
+ DECL_SOURCE_LOCATION (label) = location;
}
else
{
- /* Mark label as having been defined. */
- DECL_INITIAL (decl) = error_mark_node;
- /* Say where in the source. */
- DECL_SOURCE_LOCATION (decl) = location;
- return decl;
+ /* No label binding for that identifier; make one. */
+ label = make_label (name, location);
+
+ /* Ordinary labels go in the current function scope. */
+ bind_label (name, label, current_function_scope);
}
+
+ if (warn_traditional && !in_system_header && lookup_name (name))
+ warning ("%Htraditional C lacks a separate namespace for labels, "
+ "identifier `%s' conflicts", &location,
+ IDENTIFIER_POINTER (name));
+
+ /* Mark label as having been defined. */
+ DECL_INITIAL (label) = error_mark_node;
+ return label;
}
-/* Return the list of declarations of the current level.
- Note that this list is in reverse order unless/until
- you nreverse it; and when you do nreverse it, you must
- store the result back using `storedecls' or you will lose. */
+/* Return the list of declarations of the current scope. */
tree
getdecls (void)
{
- return current_binding_level->names;
-}
-
-/* Return the list of type-tags (for structs, etc) of the current level. */
-
-tree
-gettags (void)
-{
- return current_binding_level->tags;
+ return current_scope->names;
}
-/* Store the list of declarations of the current level.
- This is done for the parameter declarations of a function being defined,
- after they are modified in the light of any missing parameters. */
-
-static void
-storedecls (tree decls)
-{
- current_binding_level->names = decls;
-}
-
-/* Similarly, store the list of tags of the current level. */
-
-static void
-storetags (tree tags)
-{
- current_binding_level->tags = tags;
-}
/* Given NAME, an IDENTIFIER_NODE,
return the structure (or union or enum) definition for that name.
- If THISLEVEL_ONLY is nonzero, searches only the current_binding_level.
+ If THISLEVEL_ONLY is nonzero, searches only the current_scope.
CODE says which kind of type the caller wants;
it is RECORD_TYPE or UNION_TYPE or ENUMERAL_TYPE.
If the wrong kind of type is found, an error is reported. */
@@ -2140,8 +2158,8 @@ lookup_tag (enum tree_code code, tree name, int thislevel_only)
thislevel_only was set or it might be a type clash. */
if (thislevel_only || TREE_CODE (tag) != code)
{
- if (current_binding_level == global_binding_level
- || purpose_member (name, current_binding_level->tags))
+ if (current_scope == global_scope
+ || purpose_member (name, current_scope->tags))
thislevel = 1;
}
@@ -2180,7 +2198,7 @@ pending_xref_error (void)
}
-/* Look up NAME in the current binding level and its superiors
+/* Look up NAME in the current scope and its superiors
in the namespace of variables, functions and typedefs.
Return a ..._DECL node of some kind representing its definition,
or return 0 if it is undefined. */
@@ -2196,7 +2214,7 @@ lookup_name (tree name)
return decl;
}
-/* Similar to `lookup_name' but look only at the current binding level. */
+/* Similar to `lookup_name' but look only at the current scope. */
static tree
lookup_name_current_level (tree name)
@@ -2206,11 +2224,16 @@ lookup_name_current_level (tree name)
if (decl == 0 || decl == error_mark_node || C_DECL_INVISIBLE (decl))
return 0;
- if (current_binding_level == global_binding_level)
+ if (current_scope == global_scope)
return decl;
- /* Scan the current scope for a decl with name NAME. */
- if (chain_member (decl, current_binding_level->names))
+ /* Scan the current scope for a decl with name NAME.
+ For PARM_DECLs, we have to look at both ->parms and ->names, since
+ forward parameter declarations wind up on the ->names list. */
+ if (TREE_CODE (decl) == PARM_DECL
+ && chain_member (decl, current_scope->parms))
+ return decl;
+ if (chain_member (decl, current_scope->names))
return decl;
return 0;
@@ -2218,7 +2241,7 @@ lookup_name_current_level (tree name)
/* Create the predefined scalar types of C,
and some nodes representing standard constants (0, 1, (void *) 0).
- Initialize the global binding level.
+ Initialize the global scope.
Make definitions for built-in primitive functions. */
void
@@ -2231,39 +2254,33 @@ c_init_decl_processing (void)
/* Adds some ggc roots, and reserved words for c-parse.in. */
c_parse_init ();
- current_function_decl = NULL;
- named_labels = NULL;
- current_binding_level = NULL_BINDING_LEVEL;
- free_binding_level = NULL_BINDING_LEVEL;
+ current_function_decl = 0;
- /* Make the binding_level structure for global names. */
+ /* Make the c_scope structure for global names. */
pushlevel (0);
- global_binding_level = current_binding_level;
+ global_scope = current_scope;
+
/* Declarations from c_common_nodes_and_builtins must not be associated
with this input file, lest we get differences between using and not
using preprocessed headers. */
input_location.file = "<internal>";
input_location.line = 0;
+ /* Make the DECL for the toplevel file scope. */
+ current_file_decl = build_decl (TRANSLATION_UNIT_DECL, NULL, NULL);
+
build_common_tree_nodes (flag_signed_char);
c_common_nodes_and_builtins ();
- boolean_type_node = integer_type_node;
- boolean_true_node = integer_one_node;
- boolean_false_node = integer_zero_node;
+ /* In C, comparisons and TRUTH_* expressions have type int. */
+ truthvalue_type_node = integer_type_node;
+ truthvalue_true_node = integer_one_node;
+ truthvalue_false_node = integer_zero_node;
- c_bool_type_node = make_unsigned_type (BOOL_TYPE_SIZE);
- TREE_SET_CODE (c_bool_type_node, BOOLEAN_TYPE);
- TYPE_MAX_VALUE (c_bool_type_node) = build_int_2 (1, 0);
- TREE_TYPE (TYPE_MAX_VALUE (c_bool_type_node)) = c_bool_type_node;
- TYPE_PRECISION (c_bool_type_node) = 1;
+ /* Even in C99, which has a real boolean type. */
pushdecl (build_decl (TYPE_DECL, get_identifier ("_Bool"),
- c_bool_type_node));
- c_bool_false_node = build_int_2 (0, 0);
- TREE_TYPE (c_bool_false_node) = c_bool_type_node;
- c_bool_true_node = build_int_2 (1, 0);
- TREE_TYPE (c_bool_true_node) = c_bool_type_node;
+ boolean_type_node));
endlink = void_list_node;
ptr_ftype_void = build_function_type (ptr_type_node, endlink);
@@ -2277,6 +2294,9 @@ c_init_decl_processing (void)
make_fname_decl = c_make_fname_decl;
start_fname_decls ();
+
+ first_builtin_decl = global_scope->names;
+ last_builtin_decl = global_scope->names_last;
}
/* Create the VAR_DECL for __FUNCTION__ etc. ID is the name to give the
@@ -2284,8 +2304,7 @@ c_init_decl_processing (void)
NAME depended on the type of the function. As we don't yet implement
delayed emission of static data, we mark the decl as emitted
so it is not placed in the output. Anything using it must therefore pull
- out the STRING_CST initializer directly. This does mean that these names
- are string merging candidates, which is wrong for C99's __func__. FIXME. */
+ out the STRING_CST initializer directly. FIXME. */
static tree
c_make_fname_decl (tree id, int type_dep)
@@ -2311,7 +2330,11 @@ c_make_fname_decl (tree id, int type_dep)
TREE_USED (decl) = 1;
if (current_function_decl)
- pushdecl_function_level (decl, DECL_NAME (decl));
+ {
+ DECL_CONTEXT (decl) = current_function_decl;
+ IDENTIFIER_SYMBOL_VALUE (id) = decl;
+ SCOPE_LIST_APPEND (current_function_scope, names, decl);
+ }
finish_decl (decl, init, NULL_TREE);
@@ -2355,17 +2378,6 @@ builtin_function (const char *name, tree type, int function_code,
return decl;
}
-
-/* Apply default attributes to a function, if a system function with default
- attributes. */
-
-void
-c_insert_default_attributes (tree decl)
-{
- if (!TREE_PUBLIC (decl))
- return;
- c_common_insert_default_attributes (decl);
-}
/* Called when a declaration is seen that contains no names to declare.
If its type is a reference to a structure, union or enum inherited
@@ -2564,7 +2576,7 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes)
if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL
&& MAIN_NAME_P (DECL_NAME (decl)))
- warning_with_decl (decl, "`%s' is usually a function");
+ warning ("%J'%D' is usually a function", decl, decl);
if (initialized)
/* Is it valid for this decl to have an initializer at all?
@@ -2626,16 +2638,8 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes)
if (initialized)
{
-#if 0
- /* Seems redundant with grokdeclarator. */
- if (current_binding_level != global_binding_level
- && DECL_EXTERNAL (decl)
- && TREE_CODE (decl) != FUNCTION_DECL)
- warning ("declaration of `%s' has `extern' and is initialized",
- IDENTIFIER_POINTER (DECL_NAME (decl)));
-#endif
DECL_EXTERNAL (decl) = 0;
- if (current_binding_level == global_binding_level)
+ if (current_scope == global_scope)
TREE_STATIC (decl) = 1;
/* Tell `pushdecl' this is an initialized decl
@@ -2671,34 +2675,48 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes)
/* Set attributes here so if duplicate decl, will have proper attributes. */
decl_attributes (&decl, attributes, 0);
- /* If #pragma weak was used, mark the decl weak now. */
- if (current_binding_level == global_binding_level)
- maybe_apply_pragma_weak (decl);
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ && targetm.calls.promote_prototypes (TREE_TYPE (decl)))
+ {
+ tree ce = declarator;
+
+ if (TREE_CODE (ce) == INDIRECT_REF)
+ ce = TREE_OPERAND (declarator, 0);
+ if (TREE_CODE (ce) == CALL_EXPR)
+ {
+ tree args = TREE_PURPOSE (TREE_OPERAND (ce, 1));
+ for (; args; args = TREE_CHAIN (args))
+ {
+ tree type = TREE_TYPE (args);
+ if (INTEGRAL_TYPE_P (type)
+ && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
+ DECL_ARG_TYPE (args) = integer_type_node;
+ }
+ }
+ }
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (decl)
&& DECL_UNINLINABLE (decl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (decl)))
- warning_with_decl (decl,
- "inline function `%s' given attribute noinline");
+ warning ("%Jinline function '%D' given attribute noinline", decl, decl);
- /* Add this decl to the current binding level.
+ /* Add this decl to the current scope.
TEM may equal DECL or it may be a previous decl of the same name. */
tem = pushdecl (decl);
/* For a local variable, define the RTL now. */
- if (current_binding_level != global_binding_level
+ if (current_scope != global_scope
/* But not if this is a duplicate decl
and we preserved the rtl from the previous one
(which may or may not happen). */
&& !DECL_RTL_SET_P (tem)
- && !DECL_CONTEXT (tem))
+ && DECL_FILE_SCOPE_P (tem))
{
if (TREE_TYPE (tem) != error_mark_node
- && COMPLETE_TYPE_P (TREE_TYPE (tem)))
- expand_decl (tem);
- else if (TREE_CODE (TREE_TYPE (tem)) == ARRAY_TYPE
- && DECL_INITIAL (tem) != 0)
+ && (COMPLETE_TYPE_P (TREE_TYPE (tem))
+ || (TREE_CODE (TREE_TYPE (tem)) == ARRAY_TYPE
+ && DECL_INITIAL (tem) != 0)))
expand_decl (tem);
}
@@ -2718,7 +2736,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
const char *asmspec = 0;
/* If a name was specified, get the string. */
- if (current_binding_level == global_binding_level)
+ if (current_scope == global_scope)
asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);
if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree);
@@ -2734,6 +2752,11 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
if (init)
store_init_value (decl, init);
+ if (c_dialect_objc () && (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == FUNCTION_DECL
+ || TREE_CODE (decl) == FIELD_DECL))
+ objc_check_decl (decl);
+
/* Deduce size of array from initialization, if not already known */
if (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) == 0
@@ -2752,12 +2775,12 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
type = TREE_TYPE (decl);
if (failure == 1)
- error_with_decl (decl, "initializer fails to determine size of `%s'");
+ error ("%Jinitializer fails to determine size of '%D'", decl, decl);
else if (failure == 2)
{
if (do_default)
- error_with_decl (decl, "array size missing in `%s'");
+ error ("%Jarray size missing in '%D'", decl, decl);
/* If a `static' var's size isn't known,
make it extern as well as static, so it does not get
allocated.
@@ -2773,7 +2796,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
warn only if the value is less than zero. */
else if (pedantic && TYPE_DOMAIN (type) != 0
&& tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0)
- error_with_decl (decl, "zero or negative size array `%s'");
+ error ("%Jzero or negative size array '%D'", decl, decl);
layout_decl (decl, 0);
}
@@ -2795,13 +2818,13 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
Otherwise, let it through, but if it is not `extern'
then it may cause an error message later. */
(DECL_INITIAL (decl) != 0
- || DECL_CONTEXT (decl) != 0)
+ || !DECL_FILE_SCOPE_P (decl))
:
/* An automatic variable with an incomplete type
is an error. */
!DECL_EXTERNAL (decl)))
{
- error_with_decl (decl, "storage size of `%s' isn't known");
+ error ("%Jstorage size of '%D' isn't known", decl, decl);
TREE_TYPE (decl) = error_mark_node;
}
@@ -2811,7 +2834,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
else
- error_with_decl (decl, "storage size of `%s' isn't constant");
+ error ("%Jstorage size of '%D' isn't constant", decl, decl);
}
if (TREE_USED (type))
@@ -2850,6 +2873,10 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred));
}
+ /* If #pragma weak was used, mark the decl weak now. */
+ if (current_scope == global_scope)
+ maybe_apply_pragma_weak (decl);
+
/* Output the assembler code and/or RTL code for variables and functions,
unless the type is an undefined structure or union.
If not, it will get done when the type is completed. */
@@ -2860,7 +2887,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
if (c_dialect_objc ())
objc_check_decl (decl);
- if (!DECL_CONTEXT (decl))
+ if (DECL_FILE_SCOPE_P (decl))
{
if (DECL_INITIAL (decl) == NULL_TREE
|| DECL_INITIAL (decl) == error_mark_node)
@@ -2868,9 +2895,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
when a tentative file-scope definition is seen.
But at end of compilation, do output code for them. */
DECL_DEFER_OUTPUT (decl) = 1;
- rest_of_decl_compilation (decl, asmspec,
- (DECL_CONTEXT (decl) == 0
- || TREE_ASM_WRITTEN (decl)), 0);
+ rest_of_decl_compilation (decl, asmspec, true, 0);
}
else
{
@@ -2892,8 +2917,8 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
if (TREE_CODE (decl) == VAR_DECL
&& !DECL_REGISTER (decl)
&& !TREE_STATIC (decl))
- warning_with_decl (decl,
- "ignoring asm-specifier for non-static local variable `%s'");
+ warning ("%Jignoring asm-specifier for non-static local "
+ "variable '%D'", decl, decl);
else
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
}
@@ -2902,7 +2927,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
add_decl_stmt (decl);
}
- if (DECL_CONTEXT (decl) != 0)
+ if (!DECL_FILE_SCOPE_P (decl))
{
/* Recompute the RTL of a local array now
if it used to be an incomplete type. */
@@ -2918,18 +2943,17 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
}
}
+ /* If this was marked 'used', be sure it will be output. */
+ if (lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
+ mark_referenced (DECL_ASSEMBLER_NAME (decl));
+
if (TREE_CODE (decl) == TYPE_DECL)
- {
- /* This is a no-op in c-lang.c or something real in objc-act.c. */
- if (c_dialect_objc ())
- objc_check_decl (decl);
- rest_of_decl_compilation (decl, NULL, DECL_CONTEXT (decl) == 0, 0);
- }
+ rest_of_decl_compilation (decl, NULL, DECL_FILE_SCOPE_P (decl), 0);
/* At the end of a declaration, throw away any variable type sizes
of types defined inside that declaration. There is no use
computing them in the following function definition. */
- if (current_binding_level == global_binding_level)
+ if (current_scope == global_scope)
get_pending_sizes ();
/* Install a cleanup (aka destructor) if one was given. */
@@ -2968,53 +2992,51 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
}
}
-/* Given a parsed parameter declaration,
- decode it into a PARM_DECL and push that on the current binding level.
- Also, for the sake of forward parm decls,
- record the given order of parms in `parm_order'. */
+/* Given a parsed parameter declaration, decode it into a PARM_DECL
+ and push that on the current scope. */
void
push_parm_decl (tree parm)
{
tree decl;
- int old_immediate_size_expand = immediate_size_expand;
- /* Don't try computing parm sizes now -- wait till fn is called. */
+
+ /* Don't attempt to expand sizes while parsing this decl.
+ (We can get here with i_s_e 1 somehow from Objective-C.) */
+ int save_immediate_size_expand = immediate_size_expand;
immediate_size_expand = 0;
decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)),
TREE_PURPOSE (TREE_PURPOSE (parm)), PARM, 0);
decl_attributes (&decl, TREE_VALUE (parm), 0);
-#if 0
- if (DECL_NAME (decl))
- {
- tree olddecl;
- olddecl = lookup_name (DECL_NAME (decl));
- if (pedantic && olddecl != 0 && TREE_CODE (olddecl) == TYPE_DECL)
- pedwarn_with_decl (decl,
- "ISO C forbids parameter `%s' shadowing typedef");
- }
-#endif
-
decl = pushdecl (decl);
- immediate_size_expand = old_immediate_size_expand;
-
- current_binding_level->parm_order
- = tree_cons (NULL_TREE, decl, current_binding_level->parm_order);
-
- /* Add this decl to the current binding level. */
finish_decl (decl, NULL_TREE, NULL_TREE);
+
+ immediate_size_expand = save_immediate_size_expand;
}
-/* Clear the given order of parms in `parm_order'.
- Used at start of parm list,
- and also at semicolon terminating forward decls. */
+/* Mark all the parameter declarations to date as forward decls,
+ shift them to the variables list, and reset the parameters list.
+ Also diagnose use of this extension. */
void
-clear_parm_order (void)
+mark_forward_parm_decls (void)
{
- current_binding_level->parm_order = NULL_TREE;
+ tree parm;
+
+ if (pedantic && !current_scope->warned_forward_parm_decls)
+ {
+ pedwarn ("ISO C forbids forward parameter declarations");
+ current_scope->warned_forward_parm_decls = true;
+ }
+
+ for (parm = current_scope->parms; parm; parm = TREE_CHAIN (parm))
+ TREE_ASM_WRITTEN (parm) = 1;
+
+ SCOPE_LIST_CONCAT (current_scope, names, current_scope, parms);
+ current_scope->parms = 0;
+ current_scope->parms_last = 0;
}
static GTY(()) int compound_literal_number;
@@ -3035,7 +3057,7 @@ build_compound_literal (tree type, tree init)
tree stmt;
DECL_EXTERNAL (decl) = 0;
TREE_PUBLIC (decl) = 0;
- TREE_STATIC (decl) = (current_binding_level == global_binding_level);
+ TREE_STATIC (decl) = (current_scope == global_scope);
DECL_CONTEXT (decl) = current_function_decl;
TREE_USED (decl) = 1;
TREE_TYPE (decl) = type;
@@ -3280,15 +3302,11 @@ grokdeclarator (tree declarator, tree declspecs,
if (funcdef_flag && innermost_code != CALL_EXPR)
return 0;
- /* Anything declared one level down from the top level
- must be one of the parameters of a function
- (because the body is at least two levels down). */
-
/* If this looks like a function definition, make it one,
even if it occurs where parms are expected.
Then store_parm_decls will reject it and not use it as a parm. */
if (decl_context == NORMAL && !funcdef_flag
- && current_binding_level->parm_flag)
+ && current_scope->parm_flag)
decl_context = PARM;
/* Look through the decl specs and record which ones appear.
@@ -3629,7 +3647,7 @@ grokdeclarator (tree declarator, tree declspecs,
| (1 << (int) RID_THREAD))))
{
if (specbits & 1 << (int) RID_AUTO
- && (pedantic || current_binding_level == global_binding_level))
+ && (pedantic || current_scope == global_scope))
pedwarn ("function definition declared `auto'");
if (specbits & 1 << (int) RID_REGISTER)
error ("function definition declared `register'");
@@ -3666,16 +3684,16 @@ grokdeclarator (tree declarator, tree declspecs,
}
else if (specbits & 1 << (int) RID_EXTERN && initialized && ! funcdef_flag)
{
- /* `extern' with initialization is invalid if not at top level. */
- if (current_binding_level == global_binding_level)
+ /* `extern' with initialization is invalid if not at file scope. */
+ if (current_scope == global_scope)
warning ("`%s' initialized and declared `extern'", name);
else
error ("`%s' has both `extern' and initializer", name);
}
- else if (current_binding_level == global_binding_level)
+ else if (current_scope == global_scope)
{
if (specbits & 1 << (int) RID_AUTO)
- error ("top-level declaration of `%s' specifies `auto'", name);
+ error ("file-scope declaration of `%s' specifies `auto'", name);
}
else
{
@@ -3895,14 +3913,6 @@ grokdeclarator (tree declarator, tree declspecs,
if (pedantic && !COMPLETE_TYPE_P (type))
pedwarn ("array type has incomplete element type");
-#if 0
- /* We shouldn't have a function type here at all!
- Functions aren't allowed as array elements. */
- if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
- && (constp || volatilep))
- pedwarn ("ISO C forbids const or volatile function types");
-#endif
-
/* Build the array type itself, then merge any constancy or
volatility into the target type. We must do it in this order
to ensure that the TYPE_MAIN_VARIANT field of the array type
@@ -4146,7 +4156,7 @@ grokdeclarator (tree declarator, tree declspecs,
if (VOID_TYPE_P (type) && decl_context != PARM
&& ! ((decl_context != FIELD && TREE_CODE (type) != FUNCTION_TYPE)
&& ((specbits & (1 << (int) RID_EXTERN))
- || (current_binding_level == global_binding_level
+ || (current_scope == global_scope
&& !(specbits
& ((1 << (int) RID_STATIC) | (1 << (int) RID_REGISTER)))))))
{
@@ -4264,15 +4274,9 @@ grokdeclarator (tree declarator, tree declspecs,
}
/* Move type qualifiers down to element of an array. */
if (TREE_CODE (type) == ARRAY_TYPE && type_quals)
- {
- type = build_array_type (c_build_qualified_type (TREE_TYPE (type),
- type_quals),
- TYPE_DOMAIN (type));
-#if 0
- /* Leave the field const or volatile as well. */
- type_quals = TYPE_UNQUALIFIED;
-#endif
- }
+ type = build_array_type (c_build_qualified_type (TREE_TYPE (type),
+ type_quals),
+ TYPE_DOMAIN (type));
decl = build_decl (FIELD_DECL, declarator, type);
DECL_NONADDRESSABLE_P (decl) = bitfield;
@@ -4287,19 +4291,19 @@ grokdeclarator (tree declarator, tree declspecs,
That is a case not specified by ANSI C,
and we use it for forward declarations for nested functions. */
int extern_ref = (!(specbits & (1 << (int) RID_AUTO))
- || current_binding_level == global_binding_level);
+ || current_scope == global_scope);
if (specbits & (1 << (int) RID_AUTO)
- && (pedantic || current_binding_level == global_binding_level))
+ && (pedantic || current_scope == global_scope))
pedwarn ("invalid storage class for function `%s'", name);
if (specbits & (1 << (int) RID_REGISTER))
error ("invalid storage class for function `%s'", name);
if (specbits & (1 << (int) RID_THREAD))
error ("invalid storage class for function `%s'", name);
- /* Function declaration not at top level.
+ /* Function declaration not at file scope.
Storage classes other than `extern' are not allowed
and `extern' makes no difference. */
- if (current_binding_level != global_binding_level
+ if (current_scope != global_scope
&& (specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_INLINE)))
&& pedantic)
pedwarn ("invalid storage class for function `%s'", name);
@@ -4307,8 +4311,8 @@ grokdeclarator (tree declarator, tree declspecs,
decl = build_decl (FUNCTION_DECL, declarator, type);
decl = build_decl_attribute_variant (decl, decl_attr);
- DECL_LANG_SPECIFIC (decl) = (struct lang_decl *)
- ggc_alloc_cleared (sizeof (struct lang_decl));
+ DECL_LANG_SPECIFIC (decl)
+ = ggc_alloc_cleared (sizeof (struct lang_decl));
if (pedantic && type_quals && ! DECL_IN_SYSTEM_HEADER (decl))
pedwarn ("ISO C forbids qualified function types");
@@ -4336,7 +4340,7 @@ grokdeclarator (tree declarator, tree declspecs,
}
else if (inlinep)
{
- /* Assume that otherwise the function can be inlined. */
+ /* Record that the function is declared `inline'. */
DECL_DECLARED_INLINE_P (decl) = 1;
/* Do not mark bare declarations as DECL_INLINE. Doing so
@@ -4354,12 +4358,7 @@ grokdeclarator (tree declarator, tree declspecs,
two things: let the function be deferred until it is actually
needed, and let dwarf2 know that the function is inlinable. */
else if (flag_inline_trees == 2 && initialized)
- {
- if (!DECL_INLINE (decl))
- DID_INLINE_FUNC (decl) = 1;
- DECL_INLINE (decl) = 1;
- DECL_DECLARED_INLINE_P (decl) = 0;
- }
+ DECL_INLINE (decl) = 1;
}
else
{
@@ -4375,9 +4374,6 @@ grokdeclarator (tree declarator, tree declspecs,
type_quals),
TYPE_DOMAIN (type));
TYPE_ALIGN (type) = saved_align;
-#if 0 /* Leave the variable const or volatile as well. */
- type_quals = TYPE_UNQUALIFIED;
-#endif
}
else if (type_quals)
type = c_build_qualified_type (type, type_quals);
@@ -4385,7 +4381,7 @@ grokdeclarator (tree declarator, tree declspecs,
/* It is invalid to create an `extern' declaration for a
variable if there is a global declaration that is
`static'. */
- if (extern_ref && current_binding_level != global_binding_level)
+ if (extern_ref && current_scope != global_scope)
{
tree global_decl;
@@ -4402,21 +4398,21 @@ grokdeclarator (tree declarator, tree declspecs,
C_DECL_VARIABLE_SIZE (decl) = 1;
if (inlinep)
- pedwarn_with_decl (decl, "variable `%s' declared `inline'");
+ pedwarn ("%Jvariable '%D' declared `inline'", decl, decl);
DECL_EXTERNAL (decl) = extern_ref;
- /* At top level, the presence of a `static' or `register' storage
+ /* At file scope, the presence of a `static' or `register' storage
class specifier, or the absence of all storage class specifiers
makes this declaration a definition (perhaps tentative). Also,
the absence of both `static' and `register' makes it public. */
- if (current_binding_level == global_binding_level)
+ if (current_scope == global_scope)
{
TREE_PUBLIC (decl) = !(specbits & ((1 << (int) RID_STATIC)
| (1 << (int) RID_REGISTER)));
TREE_STATIC (decl) = !extern_ref;
}
- /* Not at top level, only `static' makes a static definition. */
+ /* Not at file scope, only `static' makes a static definition. */
else
{
TREE_STATIC (decl) = (specbits & (1 << (int) RID_STATIC)) != 0;
@@ -4449,6 +4445,13 @@ grokdeclarator (tree declarator, tree declspecs,
if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (decl)))
c_mark_addressable (decl);
+#ifdef ENABLE_CHECKING
+ /* This is the earliest point at which we might know the assembler
+ name of a variable. Thus, if it's known before this, die horribly. */
+ if (DECL_ASSEMBLER_NAME_SET_P (decl))
+ abort ();
+#endif
+
decl_attributes (&decl, returned_attrs, 0);
return decl;
@@ -4480,6 +4483,7 @@ grokparms (tree parms_info, int funcdef_flag)
last_function_parms = TREE_PURPOSE (parms_info);
last_function_parm_tags = TREE_VALUE (parms_info);
+ last_function_parm_others = TREE_TYPE (parms_info);
if (warn_strict_prototypes && first_parm == 0 && !funcdef_flag
&& !in_system_header)
@@ -4498,71 +4502,48 @@ grokparms (tree parms_info, int funcdef_flag)
{
tree parm;
tree typelt;
- /* We no longer test FUNCDEF_FLAG.
- If the arg types are incomplete in a declaration,
+ /* If the arg types are incomplete in a declaration,
they must include undefined tags.
These tags can never be defined in the scope of the declaration,
so the types can never be completed,
and no call can be compiled successfully. */
-#if 0
- /* In a fcn definition, arg types must be complete. */
- if (funcdef_flag)
-#endif
- for (parm = last_function_parms, typelt = first_parm;
- parm;
- parm = TREE_CHAIN (parm))
- /* Skip over any enumeration constants declared here. */
- if (TREE_CODE (parm) == PARM_DECL)
- {
- /* Barf if the parameter itself has an incomplete type. */
- tree type = TREE_VALUE (typelt);
- if (type == error_mark_node)
- continue;
- if (!COMPLETE_TYPE_P (type))
- {
- if (funcdef_flag && DECL_NAME (parm) != 0)
- error ("parameter `%s' has incomplete type",
- IDENTIFIER_POINTER (DECL_NAME (parm)));
- else
- warning ("parameter has incomplete type");
- if (funcdef_flag)
- {
- TREE_VALUE (typelt) = error_mark_node;
- TREE_TYPE (parm) = error_mark_node;
- }
- }
-#if 0
- /* This has been replaced by parm_tags_warning, which
- uses a more accurate criterion for what to warn
- about. */
- else
- {
- /* Now warn if is a pointer to an incomplete type. */
- while (TREE_CODE (type) == POINTER_TYPE
- || TREE_CODE (type) == REFERENCE_TYPE)
- type = TREE_TYPE (type);
- type = TYPE_MAIN_VARIANT (type);
- if (!COMPLETE_TYPE_P (type))
- {
- if (DECL_NAME (parm) != 0)
- warning ("parameter `%s' points to incomplete type",
- IDENTIFIER_POINTER (DECL_NAME (parm)));
- else
- warning ("parameter points to incomplete type");
- }
- }
-#endif
- typelt = TREE_CHAIN (typelt);
- }
+
+ for (parm = last_function_parms, typelt = first_parm;
+ parm;
+ parm = TREE_CHAIN (parm))
+ /* Skip over any enumeration constants declared here. */
+ if (TREE_CODE (parm) == PARM_DECL)
+ {
+ /* Barf if the parameter itself has an incomplete type. */
+ tree type = TREE_VALUE (typelt);
+ if (type == error_mark_node)
+ continue;
+ if (!COMPLETE_TYPE_P (type))
+ {
+ if (funcdef_flag && DECL_NAME (parm) != 0)
+ error ("parameter `%s' has incomplete type",
+ IDENTIFIER_POINTER (DECL_NAME (parm)));
+ else
+ warning ("parameter has incomplete type");
+ if (funcdef_flag)
+ {
+ TREE_VALUE (typelt) = error_mark_node;
+ TREE_TYPE (parm) = error_mark_node;
+ }
+ }
+ typelt = TREE_CHAIN (typelt);
+ }
return first_parm;
}
}
/* Return a tree_list node with info on a parameter list just parsed.
- The TREE_PURPOSE is a chain of decls of those parms.
+ The TREE_PURPOSE is a list of decls of those parms.
The TREE_VALUE is a list of structure, union and enum tags defined.
The TREE_CHAIN is a list of argument types to go in the FUNCTION_TYPE.
+ The TREE_TYPE is a list of non-parameter decls which appeared with the
+ parameters.
This tree_list node is later fed to `grokparms'.
VOID_AT_END nonzero means append `void' to the end of the type-list.
@@ -4571,144 +4552,117 @@ grokparms (tree parms_info, int funcdef_flag)
tree
get_parm_info (int void_at_end)
{
- tree decl, t;
+ tree decl, type, list;
tree types = 0;
- int erred = 0;
- tree tags = gettags ();
- tree parms = getdecls ();
- tree new_parms = 0;
- tree order = current_binding_level->parm_order;
-
- /* Just `void' (and no ellipsis) is special. There are really no parms.
- But if the `void' is qualified (by `const' or `volatile') or has a
- storage class specifier (`register'), then the behavior is undefined;
- by not counting it as the special case of `void' we will cause an
- error later. Typedefs for `void' are OK (see DR#157). */
+ tree *last_type = &types;
+ tree tags = current_scope->tags;
+ tree parms = current_scope->parms;
+ tree others = current_scope->names;
+ static bool explained_incomplete_types = false;
+ bool gave_void_only_once_err = false;
+
+ /* Just "void" (and no ellipsis) is special. There are really no parms.
+ But if the "void" is qualified (by "const" or "volatile"), or has a
+ storage class specifier ("register"), then the behavior is undefined;
+ issue an error. Typedefs for "void" are OK (see DR#157). */
if (void_at_end && parms != 0
&& TREE_CHAIN (parms) == 0
&& VOID_TYPE_P (TREE_TYPE (parms))
- && ! TREE_THIS_VOLATILE (parms)
- && ! TREE_READONLY (parms)
- && ! DECL_REGISTER (parms)
- && DECL_NAME (parms) == 0)
+ && !DECL_NAME (parms))
{
- parms = NULL_TREE;
- storedecls (NULL_TREE);
- return tree_cons (NULL_TREE, NULL_TREE,
- tree_cons (NULL_TREE, void_type_node, NULL_TREE));
+ if (TREE_THIS_VOLATILE (parms)
+ || TREE_READONLY (parms)
+ || DECL_REGISTER (parms))
+ error ("\"void\" as only parameter may not be qualified");
+
+ return tree_cons (0, 0, tree_cons (0, void_type_node, 0));
}
- /* Extract enumerator values and other non-parms declared with the parms.
- Likewise any forward parm decls that didn't have real parm decls. */
- for (decl = parms; decl;)
+ /* Sanity check all of the parameter declarations. */
+ for (decl = parms; decl; decl = TREE_CHAIN (decl))
{
- tree next = TREE_CHAIN (decl);
-
if (TREE_CODE (decl) != PARM_DECL)
+ abort ();
+ if (TREE_ASM_WRITTEN (decl))
+ abort ();
+
+ /* Since there is a prototype, args are passed in their
+ declared types. The back end may override this. */
+ type = TREE_TYPE (decl);
+ DECL_ARG_TYPE (decl) = type;
+
+ /* Check for (..., void, ...) and issue an error. */
+ if (VOID_TYPE_P (type) && !DECL_NAME (decl) && !gave_void_only_once_err)
{
- TREE_CHAIN (decl) = new_parms;
- new_parms = decl;
- }
- else if (TREE_ASM_WRITTEN (decl))
- {
- error_with_decl (decl,
- "parameter `%s' has just a forward declaration");
- TREE_CHAIN (decl) = new_parms;
- new_parms = decl;
+ error ("\"void\" must be the only parameter");
+ gave_void_only_once_err = true;
}
- decl = next;
- }
- /* Put the parm decls back in the order they were in in the parm list. */
- for (t = order; t; t = TREE_CHAIN (t))
- {
- if (TREE_CHAIN (t))
- TREE_CHAIN (TREE_VALUE (t)) = TREE_VALUE (TREE_CHAIN (t));
- else
- TREE_CHAIN (TREE_VALUE (t)) = 0;
+ type = build_tree_list (0, type);
+ *last_type = type;
+ last_type = &TREE_CHAIN (type);
}
- new_parms = chainon (order ? nreverse (TREE_VALUE (order)) : 0,
- new_parms);
-
- /* Store the parmlist in the binding level since the old one
- is no longer a valid list. (We have changed the chain pointers.) */
- storedecls (new_parms);
-
- for (decl = new_parms; decl; decl = TREE_CHAIN (decl))
- /* There may also be declarations for enumerators if an enumeration
- type is declared among the parms. Ignore them here. */
+ /* Check the list of non-parameter decls for any forward parm decls
+ that never got real decls. */
+ for (decl = others; decl; decl = TREE_CHAIN (decl))
if (TREE_CODE (decl) == PARM_DECL)
{
- /* Since there is a prototype,
- args are passed in their declared types. */
- tree type = TREE_TYPE (decl);
- DECL_ARG_TYPE (decl) = type;
- if (PROMOTE_PROTOTYPES
- && INTEGRAL_TYPE_P (type)
- && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
- DECL_ARG_TYPE (decl) = integer_type_node;
-
- types = tree_cons (NULL_TREE, TREE_TYPE (decl), types);
- if (VOID_TYPE_P (TREE_VALUE (types)) && ! erred
- && DECL_NAME (decl) == 0)
- {
- error ("`void' in parameter list must be the entire list");
- erred = 1;
- }
- }
-
- if (void_at_end)
- return tree_cons (new_parms, tags,
- nreverse (tree_cons (NULL_TREE, void_type_node, types)));
-
- return tree_cons (new_parms, tags, nreverse (types));
-}
-
-/* At end of parameter list, warn about any struct, union or enum tags
- defined within. Do so because these types cannot ever become complete. */
+ if (!TREE_ASM_WRITTEN (decl))
+ abort ();
-void
-parmlist_tags_warning (void)
-{
- tree elt;
- static int already;
+ error ("%Jparameter \"%D\" has just a forward declaration",
+ decl, decl);
+ }
- for (elt = current_binding_level->tags; elt; elt = TREE_CHAIN (elt))
+ /* Warn about any struct, union or enum tags defined within this
+ list. The scope of such types is limited to this declaration,
+ which is rarely if ever desirable (it's impossible to call such
+ a function with type-correct arguments). */
+ for (decl = tags; decl; decl = TREE_CHAIN (decl))
{
- enum tree_code code = TREE_CODE (TREE_VALUE (elt));
+ enum tree_code code = TREE_CODE (TREE_VALUE (decl));
+ const char *keyword;
/* An anonymous union parm type is meaningful as a GNU extension.
So don't warn for that. */
- if (code == UNION_TYPE && TREE_PURPOSE (elt) == 0 && !pedantic)
+ if (code == UNION_TYPE && TREE_PURPOSE (decl) == 0 && !pedantic)
continue;
- if (TREE_PURPOSE (elt) != 0)
- {
- if (code == RECORD_TYPE)
- warning ("`struct %s' declared inside parameter list",
- IDENTIFIER_POINTER (TREE_PURPOSE (elt)));
- else if (code == UNION_TYPE)
- warning ("`union %s' declared inside parameter list",
- IDENTIFIER_POINTER (TREE_PURPOSE (elt)));
- else
- warning ("`enum %s' declared inside parameter list",
- IDENTIFIER_POINTER (TREE_PURPOSE (elt)));
- }
- else
+
+ /* The keyword should not be translated. */
+ switch (code)
{
- /* For translation these need to be separate warnings */
- if (code == RECORD_TYPE)
- warning ("anonymous struct declared inside parameter list");
- else if (code == UNION_TYPE)
- warning ("anonymous union declared inside parameter list");
- else
- warning ("anonymous enum declared inside parameter list");
+ case RECORD_TYPE: keyword = "struct"; break;
+ case UNION_TYPE: keyword = "union"; break;
+ case ENUMERAL_TYPE: keyword = "enum"; break;
+ default: abort ();
}
- if (! already)
+
+ 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)));
+ else
+ /* The %s will be one of 'struct', 'union', or 'enum'. */
+ warning ("anonymous %s declared inside parameter list", keyword);
+
+ if (! explained_incomplete_types)
{
- warning ("its scope is only this definition or declaration, which is probably not what you want");
- already = 1;
+ warning ("its scope is only this definition or declaration,"
+ " which is probably not what you want");
+ explained_incomplete_types = true;
}
}
+
+
+ if (void_at_end)
+ {
+ type = build_tree_list (0, void_type_node);
+ *last_type = type;
+ }
+
+ list = tree_cons (parms, tags, types);
+ TREE_TYPE (list) = others;
+ return list;
}
/* Get the struct, enum or union (CODE says which) with tag NAME.
@@ -4724,10 +4678,10 @@ xref_tag (enum tree_code code, tree name)
/* If this is the right type of tag, return what we found.
(This reference will be shadowed by shadow_tag later if appropriate.)
If this is the wrong type of tag, do not return it. If it was the
- wrong type in the same binding level, we will have had an error
- message already; if in a different binding level and declaring
+ wrong type in the same scope, we will have had an error
+ message already; if in a different scope and declaring
a name, pending_xref_error will give an error message; but if in a
- different binding level and not declaring a name, this tag should
+ different scope and not declaring a name, this tag should
shadow the previous declaration of a different type of tag, and
this would not work properly if we return the reference found.
(For example, with "struct foo" in an outer scope, "union foo;"
@@ -4759,14 +4713,14 @@ xref_tag (enum tree_code code, tree name)
return ref;
}
-/* Make sure that the tag NAME is defined *in the current binding level*
+/* Make sure that the tag NAME is defined *in the current scope*
at least as a forward reference.
CODE says which kind of tag NAME ought to be. */
tree
start_struct (enum tree_code code, tree name)
{
- /* If there is already a tag defined at this binding level
+ /* If there is already a tag defined at this scope
(as a forward reference), just return it. */
tree ref = 0;
@@ -4858,8 +4812,6 @@ grokfield (tree declarator, tree declspecs, tree width)
finish_decl (value, NULL_TREE, NULL_TREE);
DECL_INITIAL (value) = width;
- if (c_dialect_objc ())
- objc_check_decl (value);
return value;
}
@@ -4894,7 +4846,7 @@ detect_field_duplicates (tree fieldlist)
for (y = fieldlist; y != x; y = TREE_CHAIN (y))
if (DECL_NAME (y) == DECL_NAME (x))
{
- error_with_decl (x, "duplicate member `%s'");
+ error ("%Jduplicate member '%D'", x, x);
DECL_NAME (x) = NULL_TREE;
}
}
@@ -4910,7 +4862,7 @@ detect_field_duplicates (tree fieldlist)
slot = htab_find_slot (htab, y, INSERT);
if (*slot)
{
- error_with_decl (x, "duplicate member `%s'");
+ error ("%Jduplicate member '%D'", x, x);
DECL_NAME (x) = NULL_TREE;
}
*slot = y;
@@ -4928,7 +4880,7 @@ tree
finish_struct (tree t, tree fieldlist, tree attributes)
{
tree x;
- int toplevel = global_binding_level == current_binding_level;
+ int toplevel = global_scope == current_scope;
int saw_named_field;
/* If this type was previously laid out as a forward reference,
@@ -5011,8 +4963,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
constant_expression_warning (DECL_INITIAL (x));
else
{
- error_with_decl (x,
- "bit-field `%s' width not an integer constant");
+ error ("%Jbit-field '%D' width not an integer constant", x, x);
DECL_INITIAL (x) = NULL;
}
}
@@ -5023,34 +4974,34 @@ finish_struct (tree t, tree fieldlist, tree attributes)
&& TREE_CODE (TREE_TYPE (x)) != BOOLEAN_TYPE
&& TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE)
{
- error_with_decl (x, "bit-field `%s' has invalid 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)) != c_bool_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_with_decl (x, "bit-field `%s' type invalid in ISO C");
+ 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)) == c_bool_type_node
+ = (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_with_decl (x, "negative width in bit-field `%s'");
+ error ("%Jnegative width in bit-field '%D'", x, x);
else if (0 < compare_tree_int (DECL_INITIAL (x), max_width))
- pedwarn_with_decl (x, "width of `%s' exceeds its type");
+ pedwarn ("%Jwidth of '%D' exceeds its type", x, x);
else if (integer_zerop (DECL_INITIAL (x)) && DECL_NAME (x) != 0)
- error_with_decl (x, "zero width for bit-field `%s'");
+ error ("%Jzero width for bit-field '%D'", x, x);
else
{
/* The test above has assured us that TREE_INT_CST_HIGH is 0. */
@@ -5063,8 +5014,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
|| (width
< min_precision (TYPE_MAX_VALUE (TREE_TYPE (x)),
TREE_UNSIGNED (TREE_TYPE (x))))))
- warning_with_decl (x,
- "`%s' is narrower than values of its type");
+ warning ("%J'%D' is narrower than values of its type", x, x);
DECL_SIZE (x) = bitsize_int (width);
DECL_BIT_FIELD (x) = 1;
@@ -5081,16 +5031,16 @@ finish_struct (tree t, tree fieldlist, tree attributes)
&& TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (x))) == NULL_TREE)
{
if (TREE_CODE (t) == UNION_TYPE)
- error_with_decl (x, "flexible array member in union");
+ error ("%Jflexible array member in union", x);
else if (TREE_CHAIN (x) != NULL_TREE)
- error_with_decl (x, "flexible array member not at end of struct");
+ error ("%Jflexible array member not at end of struct", x);
else if (! saw_named_field)
- error_with_decl (x, "flexible array member in otherwise empty struct");
+ error ("%Jflexible array member in otherwise empty struct", x);
}
if (pedantic && TREE_CODE (t) == RECORD_TYPE
&& flexible_array_type_p (TREE_TYPE (x)))
- pedwarn_with_decl (x, "invalid use of structure with flexible array member");
+ pedwarn ("%Jinvalid use of structure with flexible array member", x);
if (DECL_NAME (x))
saw_named_field = 1;
@@ -5120,6 +5070,56 @@ 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". */
+
+ {
+ int len = 0;
+
+ for (x = fieldlist; x; x = TREE_CHAIN (x))
+ {
+ if (len > 15 || DECL_NAME (x) == NULL)
+ break;
+ len += 1;
+ }
+
+ if (len > 15)
+ {
+ 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;
+ }
+ /* Found no anonymous struct/union. Add the TYPE_LANG_SPECIFIC. */
+ if (x == NULL)
+ {
+ TYPE_LANG_SPECIFIC (t) = space;
+ TYPE_LANG_SPECIFIC (t)->s->len = len;
+ field_array = TYPE_LANG_SPECIFIC (t)->s->elts;
+ qsort (field_array, len, sizeof (tree), field_decl_cmp);
+ }
+ }
+ }
+
for (x = TYPE_MAIN_VARIANT (t); x; x = TYPE_NEXT_VARIANT (x))
{
TYPE_FIELDS (x) = TYPE_FIELDS (t);
@@ -5140,58 +5140,24 @@ finish_struct (tree t, tree fieldlist, tree attributes)
/* If this structure or union completes the type of any previous
variable declaration, lay it out and output its rtl. */
-
- if (current_binding_level->incomplete_list != NULL_TREE)
+ for (x = C_TYPE_INCOMPLETE_VARS (TYPE_MAIN_VARIANT (t));
+ x;
+ x = TREE_CHAIN (x))
{
- tree prev = NULL_TREE;
-
- for (x = current_binding_level->incomplete_list; x; x = TREE_CHAIN (x))
- {
- tree decl = TREE_VALUE (x);
-
- if (TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == TYPE_MAIN_VARIANT (t)
- && TREE_CODE (decl) != TYPE_DECL)
- {
- layout_decl (decl, 0);
- /* This is a no-op in c-lang.c or something real in objc-act.c. */
- if (c_dialect_objc ())
- objc_check_decl (decl);
- rest_of_decl_compilation (decl, NULL, toplevel, 0);
- if (! toplevel)
- expand_decl (decl);
- /* Unlink X from the incomplete list. */
- if (prev)
- TREE_CHAIN (prev) = TREE_CHAIN (x);
- else
- current_binding_level->incomplete_list = TREE_CHAIN (x);
- }
- else if (!COMPLETE_TYPE_P (TREE_TYPE (decl))
- && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
- {
- tree element = TREE_TYPE (decl);
- while (TREE_CODE (element) == ARRAY_TYPE)
- element = TREE_TYPE (element);
- if (element == t)
- {
- layout_array_type (TREE_TYPE (decl));
- if (TREE_CODE (decl) != TYPE_DECL)
- {
- layout_decl (decl, 0);
- if (c_dialect_objc ())
- objc_check_decl (decl);
- rest_of_decl_compilation (decl, NULL, toplevel, 0);
- if (! toplevel)
- expand_decl (decl);
- }
- /* Unlink X from the incomplete list. */
- if (prev)
- TREE_CHAIN (prev) = TREE_CHAIN (x);
- else
- current_binding_level->incomplete_list = TREE_CHAIN (x);
- }
- }
+ tree decl = TREE_VALUE (x);
+ if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
+ layout_array_type (TREE_TYPE (decl));
+ if (TREE_CODE (decl) != TYPE_DECL)
+ {
+ layout_decl (decl, 0);
+ if (c_dialect_objc ())
+ objc_check_decl (decl);
+ rest_of_decl_compilation (decl, NULL, toplevel, 0);
+ if (! toplevel)
+ expand_decl (decl);
}
}
+ C_TYPE_INCOMPLETE_VARS (TYPE_MAIN_VARIANT (t)) = 0;
/* Finish debugging output for this type. */
rest_of_type_compilation (t, toplevel);
@@ -5266,7 +5232,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
tree pair, tem;
tree minnode = 0, maxnode = 0, enum_value_type;
int precision, unsign;
- int toplevel = (global_binding_level == current_binding_level);
+ int toplevel = (global_scope == current_scope);
if (in_parm_level_p ())
warning ("enum defined inside parms");
@@ -5472,8 +5438,6 @@ start_function (tree declspecs, tree declarator, tree attributes)
current_function_returns_abnormally = 0;
warn_about_return_type = 0;
current_extern_inline = 0;
- named_labels = 0;
- shadowed_labels = 0;
/* Don't expand any sizes in the return type of the function. */
immediate_size_expand = 0;
@@ -5490,15 +5454,10 @@ start_function (tree declspecs, tree declarator, tree attributes)
decl_attributes (&decl1, attributes, 0);
- /* If #pragma weak was used, mark the decl weak now. */
- if (current_binding_level == global_binding_level)
- maybe_apply_pragma_weak (decl1);
-
if (DECL_DECLARED_INLINE_P (decl1)
&& DECL_UNINLINABLE (decl1)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (decl1)))
- warning_with_decl (decl1,
- "inline function `%s' given attribute noinline");
+ warning ("%Jinline function '%D' given attribute noinline", decl1, decl1);
announce_function (decl1);
@@ -5518,6 +5477,7 @@ start_function (tree declspecs, tree declarator, tree attributes)
where store_parm_decls will find them. */
current_function_parms = last_function_parms;
current_function_parm_tags = last_function_parm_tags;
+ current_function_parm_others = last_function_parm_others;
/* Make the init_value nonzero so pushdecl knows this is not tentative.
error_mark_node is replaced below (in poplevel) with the BLOCK. */
@@ -5547,27 +5507,27 @@ start_function (tree declspecs, tree declarator, tree attributes)
&& TREE_PUBLIC (decl1)
&& ! MAIN_NAME_P (DECL_NAME (decl1))
&& C_DECL_ISNT_PROTOTYPE (old_decl))
- warning_with_decl (decl1, "no previous prototype for `%s'");
+ warning ("%Jno previous prototype for '%D'", decl1, decl1);
/* Optionally warn of any def with no previous prototype
if the function has already been used. */
else if (warn_missing_prototypes
&& old_decl != 0 && TREE_USED (old_decl)
&& TYPE_ARG_TYPES (TREE_TYPE (old_decl)) == 0)
- warning_with_decl (decl1,
- "`%s' was used with no prototype before its definition");
+ warning ("%J'%D' was used with no prototype before its definition",
+ decl1, decl1);
/* Optionally warn of any global def with no previous declaration. */
else if (warn_missing_declarations
&& TREE_PUBLIC (decl1)
&& old_decl == 0
&& ! MAIN_NAME_P (DECL_NAME (decl1)))
- warning_with_decl (decl1, "no previous declaration for `%s'");
+ warning ("%Jno previous declaration for '%D'", decl1, decl1);
/* Optionally warn of any def with no previous declaration
if the function has already been used. */
else if (warn_missing_declarations
&& old_decl != 0 && TREE_USED (old_decl)
&& C_DECL_IMPLICIT (old_decl))
- warning_with_decl (decl1,
- "`%s' was used with no declaration before its definition");
+ warning ("%J`%D' was used with no declaration before its definition",
+ decl1, decl1);
/* This is a definition, not a reference.
So normally clear DECL_EXTERNAL.
@@ -5583,6 +5543,17 @@ start_function (tree declspecs, tree declarator, tree attributes)
if (current_function_decl != 0)
TREE_PUBLIC (decl1) = 0;
+#ifdef ENABLE_CHECKING
+ /* This is the earliest point at which we might know the assembler
+ name of the function. Thus, if it's set before this, die horribly. */
+ if (DECL_ASSEMBLER_NAME_SET_P (decl1))
+ abort ();
+#endif
+
+ /* If #pragma weak was used, mark the decl weak now. */
+ if (current_scope == global_scope)
+ maybe_apply_pragma_weak (decl1);
+
/* Warn for unlikely, improbable, or stupid declarations of `main'. */
if (warn_main > 0 && MAIN_NAME_P (DECL_NAME (decl1)))
{
@@ -5591,7 +5562,7 @@ start_function (tree declspecs, tree declarator, tree attributes)
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1)))
!= integer_type_node)
- pedwarn_with_decl (decl1, "return type of `%s' is not `int'");
+ pedwarn ("%Jreturn type of '%D' is not `int'", decl1, decl1);
for (args = TYPE_ARG_TYPES (TREE_TYPE (decl1)); args;
args = TREE_CHAIN (args))
@@ -5606,8 +5577,8 @@ start_function (tree declspecs, tree declarator, tree attributes)
{
case 1:
if (TYPE_MAIN_VARIANT (type) != integer_type_node)
- pedwarn_with_decl (decl1,
- "first argument of `%s' should be `int'");
+ pedwarn ("%Jfirst argument of '%D' should be `int'",
+ decl1, decl1);
break;
case 2:
@@ -5615,8 +5586,8 @@ start_function (tree declspecs, tree declarator, tree attributes)
|| TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
- pedwarn_with_decl (decl1,
- "second argument of `%s' should be `char **'");
+ pedwarn ("%Jsecond argument of '%D' should be 'char **'",
+ decl1, decl1);
break;
case 3:
@@ -5624,8 +5595,8 @@ start_function (tree declspecs, tree declarator, tree attributes)
|| TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
- pedwarn_with_decl (decl1,
- "third argument of `%s' should probably be `char **'");
+ pedwarn ("%Jthird argument of '%D' should probably be "
+ "'char **'", decl1, decl1);
break;
}
}
@@ -5634,10 +5605,10 @@ start_function (tree declspecs, tree declarator, tree attributes)
argument because it's only mentioned in an appendix of the
standard. */
if (argct > 0 && (argct < 2 || argct > 3))
- pedwarn_with_decl (decl1, "`%s' takes only zero or two arguments");
+ pedwarn ("%J'%D' takes only zero or two arguments", decl1, decl1);
if (! TREE_PUBLIC (decl1))
- pedwarn_with_decl (decl1, "`%s' is normally a non-static function");
+ pedwarn ("%J'%D' is normally a non-static function", decl1, decl1);
}
/* Record the decl so that the function name is defined.
@@ -5647,7 +5618,7 @@ start_function (tree declspecs, tree declarator, tree attributes)
current_function_decl = pushdecl (decl1);
pushlevel (0);
- declare_parm_level (1);
+ declare_parm_level ();
make_decl_rtl (current_function_decl, NULL);
@@ -5678,389 +5649,331 @@ start_function (tree declspecs, tree declarator, tree attributes)
return 1;
}
-/* Store the parameter declarations into the current function declaration.
- This is called after parsing the parameter declarations, before
- digesting the body of the function.
-
- For an old-style definition, modify the function's type
- to specify at least the number of arguments. */
-
-void
-store_parm_decls (void)
+/* Subroutine of store_parm_decls which handles new-style function
+ definitions (prototype format). The parms already have decls, so we
+ need only record them as in effect and complain if any redundant
+ old-style parm decls were written. */
+static void
+store_parm_decls_newstyle (void)
{
+ tree decl, last;
tree fndecl = current_function_decl;
- tree parm;
-
- /* This is either a chain of PARM_DECLs (if a prototype was used)
- or a list of IDENTIFIER_NODEs (for an old-fashioned C definition). */
- tree specparms = current_function_parms;
+ tree parms = current_function_parms;
+ tree tags = current_function_parm_tags;
+ tree others = current_function_parm_others;
- /* This is a list of types declared among parms in a prototype. */
- tree parmtags = current_function_parm_tags;
-
- /* This is a chain of PARM_DECLs from old-style parm declarations. */
- tree parmdecls = getdecls ();
-
- /* 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;
- then CONST_DECLs for foo and bar are put here. */
- tree nonparms = 0;
-
- /* The function containing FNDECL, if any. */
- tree context = decl_function_context (fndecl);
-
- /* Nonzero if this definition is written with a prototype. */
- int prototype = 0;
-
- bool saved_warn_shadow = warn_shadow;
-
- /* Don't re-emit shadow warnings. */
- warn_shadow = false;
-
- if (specparms != 0 && TREE_CODE (specparms) != TREE_LIST)
+ if (current_scope->parms || current_scope->names || current_scope->tags)
{
- /* This case is when the function was defined with an ANSI prototype.
- The parms already have decls, so we need not do anything here
- except record them as in effect
- and complain if any redundant old-style parm decls were written. */
-
- tree next;
- tree others = 0;
-
- prototype = 1;
+ error ("%Jold-style parameter declarations in prototyped "
+ "function definition", fndecl);
- if (parmdecls != 0)
- {
- tree decl, link;
-
- error_with_decl (fndecl,
- "parm types given both in parmlist and separately");
- /* Get rid of the erroneous decls; don't keep them on
- the list of parms, since they might not be PARM_DECLs. */
- for (decl = current_binding_level->names;
- decl; decl = TREE_CHAIN (decl))
- if (DECL_NAME (decl))
- IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)) = 0;
- for (link = current_binding_level->shadowed;
- link; link = TREE_CHAIN (link))
- IDENTIFIER_SYMBOL_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
- current_binding_level->names = 0;
- current_binding_level->shadowed = 0;
- }
+ /* Get rid of the old-style declarations. */
+ poplevel (0, 0, 0);
+ pushlevel (0);
+ }
- specparms = nreverse (specparms);
- for (parm = specparms; parm; parm = next)
+ /* Now make all the parameter declarations visible in the function body.
+ We can bypass most of the grunt work of pushdecl. */
+ for (last = 0, decl = parms; decl; last = decl, decl = TREE_CHAIN (decl))
+ {
+ DECL_CONTEXT (decl) = current_function_decl;
+ if (DECL_NAME (decl) == 0)
+ error ("%Jparameter name omitted", decl);
+ else
{
- next = TREE_CHAIN (parm);
- if (TREE_CODE (parm) == PARM_DECL)
- {
- if (DECL_NAME (parm) == 0)
- error_with_decl (parm, "parameter name omitted");
- else if (TREE_CODE (TREE_TYPE (parm)) != ERROR_MARK
- && VOID_TYPE_P (TREE_TYPE (parm)))
- {
- error_with_decl (parm, "parameter `%s' declared void");
- /* Change the type to error_mark_node so this parameter
- will be ignored by assign_parms. */
- TREE_TYPE (parm) = error_mark_node;
- }
- pushdecl (parm);
- }
- else
- {
- /* If we find an enum constant or a type tag,
- put it aside for the moment. */
- TREE_CHAIN (parm) = 0;
- others = chainon (others, parm);
- }
+ if (IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)))
+ current_scope->shadowed
+ = tree_cons (DECL_NAME (decl),
+ IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)),
+ current_scope->shadowed);
+ IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)) = decl;
}
+ }
+ current_scope->parms = parms;
+ current_scope->parms_last = last;
- /* Get the decls in their original chain order
- and record in the function. */
- DECL_ARGUMENTS (fndecl) = getdecls ();
+ /* Record the parameter list in the function declaration. */
+ DECL_ARGUMENTS (fndecl) = parms;
-#if 0
- /* If this function takes a variable number of arguments,
- add a phony parameter to the end of the parm list,
- to represent the position of the first unnamed argument. */
- if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (fndecl))))
- != void_type_node)
+ /* Now make all the ancillary declarations visible, likewise. */
+ for (last = 0, decl = others; decl; last = decl, decl = TREE_CHAIN (decl))
+ {
+ DECL_CONTEXT (decl) = current_function_decl;
+ if (DECL_NAME (decl)
+ && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) != void_type_node)
{
- tree dummy = build_decl (PARM_DECL, NULL_TREE, void_type_node);
- /* Let's hope the address of the unnamed parm
- won't depend on its type. */
- TREE_TYPE (dummy) = integer_type_node;
- DECL_ARG_TYPE (dummy) = integer_type_node;
- DECL_ARGUMENTS (fndecl) = chainon (DECL_ARGUMENTS (fndecl), dummy);
+ if (IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)))
+ current_scope->shadowed
+ = tree_cons (DECL_NAME (decl),
+ IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)),
+ current_scope->shadowed);
+ IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)) = decl;
}
-#endif
+ }
+ current_scope->names = others;
+ current_scope->names_last = last;
- /* Now pushdecl the enum constants. */
- for (parm = others; parm; parm = next)
- {
- next = TREE_CHAIN (parm);
- if (DECL_NAME (parm) == 0)
- ;
- else if (TYPE_MAIN_VARIANT (TREE_TYPE (parm)) == void_type_node)
- ;
- else if (TREE_CODE (parm) != PARM_DECL)
- pushdecl (parm);
- }
+ /* And all the tag declarations. */
+ for (decl = tags; decl; decl = TREE_CHAIN (decl))
+ if (TREE_PURPOSE (decl))
+ {
+ if (IDENTIFIER_TAG_VALUE (TREE_PURPOSE (decl)))
+ current_scope->shadowed_tags
+ = tree_cons (TREE_PURPOSE (decl),
+ IDENTIFIER_SYMBOL_VALUE (TREE_PURPOSE (decl)),
+ current_scope->shadowed_tags);
+ IDENTIFIER_TAG_VALUE (TREE_PURPOSE (decl)) = TREE_VALUE (decl);
+ }
+ current_scope->tags = tags;
+}
- storetags (chainon (parmtags, gettags ()));
- }
- else
- {
- /* SPECPARMS is an identifier list--a chain of TREE_LIST nodes
- each with a parm name as the TREE_VALUE.
+/* Subroutine of store_parm_decls which handles old-style function
+ definitions (separate parameter list and declarations). */
- PARMDECLS is a chain of declarations for parameters.
- Warning! It can also contain CONST_DECLs which are not parameters
- but are names of enumerators of any enum types
- declared among the parameters.
+static void
+store_parm_decls_oldstyle (void)
+{
+ tree parm, decl, last;
+ tree fndecl = current_function_decl;
- First match each formal parameter name with its declaration.
- Associate decls with the names and store the decls
- into the TREE_PURPOSE slots. */
+ /* This is the identifier list from the function declarator. */
+ tree parmids = current_function_parms;
- /* We use DECL_WEAK as a flag to show which parameters have been
- seen already since it is not used on PARM_DECL or CONST_DECL. */
- for (parm = parmdecls; parm; parm = TREE_CHAIN (parm))
- DECL_WEAK (parm) = 0;
+ /* We use DECL_WEAK as a flag to show which parameters have been
+ seen already, since it is not used on PARM_DECL. */
+#ifdef ENABLE_CHECKING
+ for (parm = current_scope->parms; parm; parm = TREE_CHAIN (parm))
+ if (DECL_WEAK (parm))
+ abort ();
+#endif
- for (parm = specparms; parm; parm = TREE_CHAIN (parm))
+ /* Match each formal parameter name with its declaration. Save each
+ decl in the appropriate TREE_PURPOSE slot of the parmids chain. */
+ for (parm = parmids; parm; parm = TREE_CHAIN (parm))
+ {
+ if (TREE_VALUE (parm) == 0)
{
- tree tail, found = NULL;
+ error ("%Jparameter name missing from parameter list", fndecl);
+ TREE_PURPOSE (parm) = 0;
+ continue;
+ }
- if (TREE_VALUE (parm) == 0)
+ decl = IDENTIFIER_SYMBOL_VALUE (TREE_VALUE (parm));
+ if (decl && DECL_CONTEXT (decl) == fndecl)
+ {
+ /* If we got something other than a PARM_DECL it is an error. */
+ if (TREE_CODE (decl) != PARM_DECL)
+ error ("%J\"%D\" declared as a non-parameter", decl, decl);
+ /* If the declaration is already marked, we have a duplicate
+ name. Complain and ignore the duplicate. */
+ else if (DECL_WEAK (decl))
{
- error_with_decl (fndecl,
- "parameter name missing from parameter list");
+ error ("%Jmultiple parameters named \"%D\"", decl, decl);
TREE_PURPOSE (parm) = 0;
continue;
}
-
- /* See if any of the parmdecls specifies this parm by name.
- Ignore any enumerator decls. */
- for (tail = parmdecls; tail; tail = TREE_CHAIN (tail))
- if (DECL_NAME (tail) == TREE_VALUE (parm)
- && TREE_CODE (tail) == PARM_DECL)
- {
- found = tail;
- break;
- }
-
- /* If declaration already marked, we have a duplicate name.
- Complain, and don't use this decl twice. */
- if (found && DECL_WEAK (found))
+ /* If the declaration says "void", complain and turn it into
+ an int. */
+ else if (VOID_TYPE_P (TREE_TYPE (decl)))
{
- error_with_decl (found, "multiple parameters named `%s'");
- found = 0;
+ error ("%Jparameter \"%D\" declared void", decl, decl);
+ TREE_TYPE (decl) = integer_type_node;
+ DECL_ARG_TYPE (decl) = integer_type_node;
+ layout_decl (decl, 0);
}
+ }
+ /* If no declaration found, default to int. */
+ else
+ {
+ decl = build_decl (PARM_DECL, TREE_VALUE (parm), integer_type_node);
+ DECL_ARG_TYPE (decl) = TREE_TYPE (decl);
+ DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (fndecl);
+ pushdecl (decl);
- /* If the declaration says "void", complain and ignore it. */
- if (found && VOID_TYPE_P (TREE_TYPE (found)))
- {
- error_with_decl (found, "parameter `%s' declared void");
- TREE_TYPE (found) = integer_type_node;
- DECL_ARG_TYPE (found) = integer_type_node;
- layout_decl (found, 0);
- }
+ if (flag_isoc99)
+ pedwarn ("%Jtype of \"%D\" defaults to \"int\"", decl, decl);
+ else if (extra_warnings)
+ warning ("%Jtype of \"%D\" defaults to \"int\"", decl, decl);
+ }
- /* If no declaration found, default to int. */
- if (!found)
- {
- found = build_decl (PARM_DECL, TREE_VALUE (parm),
- integer_type_node);
- DECL_ARG_TYPE (found) = TREE_TYPE (found);
- DECL_SOURCE_LOCATION (found) = DECL_SOURCE_LOCATION (fndecl);
- if (flag_isoc99)
- pedwarn_with_decl (found, "type of `%s' defaults to `int'");
- else if (extra_warnings)
- warning_with_decl (found, "type of `%s' defaults to `int'");
- pushdecl (found);
- }
+ TREE_PURPOSE (parm) = decl;
+ DECL_WEAK (decl) = 1;
+ }
- TREE_PURPOSE (parm) = found;
+ /* Now examine the parms chain for incomplete declarations
+ and declarations with no corresponding names. */
- /* Mark this decl as "already found". */
- DECL_WEAK (found) = 1;
+ for (parm = current_scope->parms; parm; parm = TREE_CHAIN (parm))
+ {
+ if (!COMPLETE_TYPE_P (TREE_TYPE (parm)))
+ {
+ error ("%Jparameter \"%D\" has incomplete type", parm, parm);
+ TREE_TYPE (parm) = error_mark_node;
}
- /* Put anything which is on the parmdecls chain and which is
- not a PARM_DECL onto the list NONPARMS. (The types of
- non-parm things which might appear on the list include
- enumerators and NULL-named TYPE_DECL nodes.) Complain about
- any actual PARM_DECLs not matched with any names. */
-
- nonparms = 0;
- for (parm = parmdecls; parm;)
+ if (! DECL_WEAK (parm))
{
- tree next = TREE_CHAIN (parm);
- TREE_CHAIN (parm) = 0;
+ error ("%Jdeclaration for parameter \"%D\" but no such parameter",
+ parm, parm);
- if (TREE_CODE (parm) != PARM_DECL)
- nonparms = chainon (nonparms, parm);
- else
- {
- /* Complain about args with incomplete types. */
- if (!COMPLETE_TYPE_P (TREE_TYPE (parm)))
- {
- error_with_decl (parm, "parameter `%s' has incomplete type");
- TREE_TYPE (parm) = error_mark_node;
- }
+ /* Pretend the parameter was not missing.
+ This gets us to a standard state and minimizes
+ further error messages. */
+ parmids = chainon (parmids, tree_cons (parm, 0, 0));
+ }
+ }
- if (! DECL_WEAK (parm))
- {
- error_with_decl (parm,
- "declaration for parameter `%s' but no such parameter");
- /* Pretend the parameter was not missing.
- This gets us to a standard state and minimizes
- further error messages. */
- specparms
- = chainon (specparms,
- tree_cons (parm, NULL_TREE, NULL_TREE));
- }
- }
+ /* Chain the declarations together in the order of the list of
+ names. Store that chain in the function decl, replacing the
+ list of names. Update the current scope to match. */
+ DECL_ARGUMENTS (fndecl) = 0;
- parm = next;
- }
+ for (parm = parmids; parm; parm = TREE_CHAIN (parm))
+ if (TREE_PURPOSE (parm))
+ break;
+ if (parm && TREE_PURPOSE (parm))
+ {
+ last = TREE_PURPOSE (parm);
+ DECL_ARGUMENTS (fndecl) = last;
+ current_scope->parms = last;
+ DECL_WEAK (last) = 0;
- /* Chain the declarations together in the order of the list of
- names. Store that chain in the function decl, replacing the
- list of names. */
- parm = specparms;
- DECL_ARGUMENTS (fndecl) = 0;
- {
- tree last;
- for (last = 0; parm; parm = TREE_CHAIN (parm))
- if (TREE_PURPOSE (parm))
- {
- if (last == 0)
- DECL_ARGUMENTS (fndecl) = TREE_PURPOSE (parm);
- else
- TREE_CHAIN (last) = TREE_PURPOSE (parm);
- last = TREE_PURPOSE (parm);
- TREE_CHAIN (last) = 0;
- }
- }
+ for (parm = TREE_CHAIN (parm); parm; parm = TREE_CHAIN (parm))
+ if (TREE_PURPOSE (parm))
+ {
+ TREE_CHAIN (last) = TREE_PURPOSE (parm);
+ last = TREE_PURPOSE (parm);
+ DECL_WEAK (last) = 0;
+ }
+ current_scope->parms_last = last;
+ TREE_CHAIN (last) = 0;
+ }
- /* If there was a previous prototype,
- set the DECL_ARG_TYPE of each argument according to
- the type previously specified, and report any mismatches. */
+ /* If there was a previous prototype,
+ set the DECL_ARG_TYPE of each argument according to
+ the type previously specified, and report any mismatches. */
- if (TYPE_ARG_TYPES (TREE_TYPE (fndecl)))
+ if (TYPE_ARG_TYPES (TREE_TYPE (fndecl)))
+ {
+ tree type;
+ for (parm = DECL_ARGUMENTS (fndecl),
+ type = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+ parm || (type && (TYPE_MAIN_VARIANT (TREE_VALUE (type))
+ != void_type_node));
+ parm = TREE_CHAIN (parm), type = TREE_CHAIN (type))
{
- tree type;
- for (parm = DECL_ARGUMENTS (fndecl),
- type = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
- parm || (type && (TYPE_MAIN_VARIANT (TREE_VALUE (type))
- != void_type_node));
- parm = TREE_CHAIN (parm), type = TREE_CHAIN (type))
+ if (parm == 0 || type == 0
+ || TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
{
- if (parm == 0 || type == 0
- || TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
- {
- error ("number of arguments doesn't match prototype");
- error ("%Hprototype declaration",
- &current_function_prototype_locus);
- break;
- }
- /* Type for passing arg must be consistent with that
- declared for the arg. ISO C says we take the unqualified
- type for parameters declared with qualified type. */
- if (! comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)),
- TYPE_MAIN_VARIANT (TREE_VALUE (type))))
+ error ("number of arguments doesn't match prototype");
+ error ("%Hprototype declaration",
+ &current_function_prototype_locus);
+ break;
+ }
+ /* Type for passing arg must be consistent with that
+ declared for the arg. ISO C says we take the unqualified
+ type for parameters declared with qualified type. */
+ if (! comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)),
+ TYPE_MAIN_VARIANT (TREE_VALUE (type)),
+ COMPARE_STRICT))
+ {
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (parm))
+ == TYPE_MAIN_VARIANT (TREE_VALUE (type)))
{
- if (TYPE_MAIN_VARIANT (TREE_TYPE (parm))
- == TYPE_MAIN_VARIANT (TREE_VALUE (type)))
- {
- /* Adjust argument to match prototype. E.g. a previous
- `int foo(float);' prototype causes
- `int foo(x) float x; {...}' to be treated like
- `int foo(float x) {...}'. This is particularly
- useful for argument types like uid_t. */
- DECL_ARG_TYPE (parm) = TREE_TYPE (parm);
-
- if (PROMOTE_PROTOTYPES
- && INTEGRAL_TYPE_P (TREE_TYPE (parm))
- && TYPE_PRECISION (TREE_TYPE (parm))
- < TYPE_PRECISION (integer_type_node))
- DECL_ARG_TYPE (parm) = integer_type_node;
-
- if (pedantic)
- {
- pedwarn ("promoted argument `%s' doesn't match prototype",
- IDENTIFIER_POINTER (DECL_NAME (parm)));
- warning ("%Hprototype declaration",
- &current_function_prototype_locus);
- }
- }
- else
+ /* Adjust argument to match prototype. E.g. a previous
+ `int foo(float);' prototype causes
+ `int foo(x) float x; {...}' to be treated like
+ `int foo(float x) {...}'. This is particularly
+ useful for argument types like uid_t. */
+ DECL_ARG_TYPE (parm) = TREE_TYPE (parm);
+
+ if (targetm.calls.promote_prototypes (TREE_TYPE (current_function_decl))
+ && INTEGRAL_TYPE_P (TREE_TYPE (parm))
+ && TYPE_PRECISION (TREE_TYPE (parm))
+ < TYPE_PRECISION (integer_type_node))
+ DECL_ARG_TYPE (parm) = integer_type_node;
+
+ if (pedantic)
{
- error ("argument `%s' doesn't match prototype",
- IDENTIFIER_POINTER (DECL_NAME (parm)));
- error ("%Hprototype declaration",
- &current_function_prototype_locus);
+ pedwarn ("promoted argument \"%D\" "
+ "doesn't match prototype", parm);
+ pedwarn ("%Hprototype declaration",
+ &current_function_prototype_locus);
}
}
+ else
+ {
+ error ("argument \"%D\" doesn't match prototype", parm);
+ error ("%Hprototype declaration",
+ &current_function_prototype_locus);
+ }
}
- TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = 0;
}
+ TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = 0;
+ }
- /* Otherwise, create a prototype that would match. */
+ /* Otherwise, create a prototype that would match. */
- else
- {
- tree actual = 0, last = 0, type;
+ else
+ {
+ tree actual = 0, last = 0, type;
- for (parm = DECL_ARGUMENTS (fndecl); parm; parm = TREE_CHAIN (parm))
- {
- type = tree_cons (NULL_TREE, DECL_ARG_TYPE (parm), NULL_TREE);
- if (last)
- TREE_CHAIN (last) = type;
- else
- actual = type;
- last = type;
- }
- type = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
+ for (parm = DECL_ARGUMENTS (fndecl); parm; parm = TREE_CHAIN (parm))
+ {
+ type = tree_cons (NULL_TREE, DECL_ARG_TYPE (parm), NULL_TREE);
if (last)
TREE_CHAIN (last) = type;
else
actual = type;
+ last = type;
+ }
+ type = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
+ if (last)
+ TREE_CHAIN (last) = type;
+ else
+ actual = type;
- /* We are going to assign a new value for the TYPE_ACTUAL_ARG_TYPES
- of the type of this function, but we need to avoid having this
- affect the types of other similarly-typed functions, so we must
- first force the generation of an identical (but separate) type
- node for the relevant function type. The new node we create
- will be a variant of the main variant of the original function
- type. */
+ /* We are going to assign a new value for the TYPE_ACTUAL_ARG_TYPES
+ of the type of this function, but we need to avoid having this
+ affect the types of other similarly-typed functions, so we must
+ first force the generation of an identical (but separate) type
+ node for the relevant function type. The new node we create
+ will be a variant of the main variant of the original function
+ type. */
- TREE_TYPE (fndecl) = build_type_copy (TREE_TYPE (fndecl));
+ TREE_TYPE (fndecl) = build_type_copy (TREE_TYPE (fndecl));
- TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = actual;
- }
+ TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = actual;
+ }
+}
+
+/* Store the parameter declarations into the current function declaration.
+ This is called after parsing the parameter declarations, before
+ digesting the body of the function.
- /* Now store the final chain of decls for the arguments
- as the decl-chain of the current lexical scope.
- Put the enumerators in as well, at the front so that
- DECL_ARGUMENTS is not modified. */
+ For an old-style definition, construct a prototype out of the old-style
+ parameter declarations and inject it into the function's type. */
- storedecls (chainon (nonparms, DECL_ARGUMENTS (fndecl)));
- }
+void
+store_parm_decls (void)
+{
+ tree fndecl = current_function_decl;
+
+ /* The function containing FNDECL, if any. */
+ tree context = decl_function_context (fndecl);
+
+ /* True if this definition is written with a prototype. */
+ bool prototype = (current_function_parms
+ && TREE_CODE (current_function_parms) != TREE_LIST);
- /* Make sure the binding level for the top of the function body
- gets a BLOCK if there are any in the function.
- Otherwise, the dbx output is wrong. */
+ if (prototype)
+ store_parm_decls_newstyle ();
+ else
+ store_parm_decls_oldstyle ();
- keep_next_if_subblocks = 1;
+ /* The next call to pushlevel will be a function body. */
- /* ??? This might be an improvement,
- but needs to be thought about some more. */
-#if 0
- keep_next_level_flag = 1;
-#endif
+ next_is_function_body = true;
/* Write a record describing this function definition to the prototypes
file (if requested). */
@@ -6068,10 +5981,10 @@ store_parm_decls (void)
gen_aux_info_record (fndecl, 1, 0, prototype);
/* Initialize the RTL code for the function. */
- init_function_start (fndecl);
+ allocate_struct_function (fndecl);
/* Begin the statement tree for this function. */
- begin_stmt_tree (&DECL_SAVED_TREE (current_function_decl));
+ begin_stmt_tree (&DECL_SAVED_TREE (fndecl));
/* If this is a nested function, save away the sizes of any
variable-size types so that we can expand them when generating
@@ -6097,21 +6010,16 @@ store_parm_decls (void)
not safe to try to expand expressions involving them. */
immediate_size_expand = 0;
cfun->x_dont_save_pending_sizes_p = 1;
-
- warn_shadow = saved_warn_shadow;
}
/* Finish up a function declaration and compile that function
all the way to assembler language output. The free the storage
for the function definition.
- This is called after parsing the body of the function definition.
-
- NESTED is nonzero if the function being finished is nested in another.
- CAN_DEFER_P is nonzero if the function may be deferred. */
+ This is called after parsing the body of the function definition. */
void
-finish_function (int nested, int can_defer_p)
+finish_function ()
{
tree fndecl = current_function_decl;
@@ -6119,22 +6027,30 @@ finish_function (int nested, int can_defer_p)
void foo(void) { }
(the argument list is irrelevant) the compstmt rule will not
bother calling pushlevel/poplevel, which means we get here with
- the binding_level stack out of sync. Detect this situation by
- noticing that the current_binding_level is still as
- store_parm_decls left it, and do a dummy push/pop to get back to
- consistency. Note that the call to pushlevel does not actually
- push another binding level - see there for details. */
- if (current_binding_level->parm_flag && keep_next_if_subblocks)
+ the scope stack out of sync. Detect this situation by noticing
+ that current_scope is still as store_parm_decls left it, and do
+ a dummy push/pop to get back to consistency.
+ Note that the call to pushlevel does not actually push another
+ scope - see there for details. */
+
+ if (current_scope->parm_flag && next_is_function_body)
{
pushlevel (0);
- poplevel (1, 0, 1);
+ poplevel (0, 0, 0);
}
-#if 0
- /* This caused &foo to be of type ptr-to-const-function which then
- got a warning when stored in a ptr-to-function variable. */
- TREE_READONLY (fndecl) = 1;
-#endif
+ if (TREE_CODE (fndecl) == FUNCTION_DECL
+ && targetm.calls.promote_prototypes (TREE_TYPE (fndecl)))
+ {
+ tree args = DECL_ARGUMENTS (fndecl);
+ for (; args; args = TREE_CHAIN (args))
+ {
+ tree type = TREE_TYPE (args);
+ if (INTEGRAL_TYPE_P (type)
+ && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
+ DECL_ARG_TYPE (args) = integer_type_node;
+ }
+ }
BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
@@ -6149,8 +6065,8 @@ finish_function (int nested, int can_defer_p)
{
/* If warn_main is 1 (-Wmain) or 2 (-Wall), we have already warned.
If warn_main is -1 (-Wno-main) we don't want to be warned. */
- if (! warn_main)
- pedwarn_with_decl (fndecl, "return type of `%s' is not `int'");
+ if (!warn_main)
+ pedwarn ("%Jreturn type of '%D' is not `int'", fndecl, fndecl);
}
else
{
@@ -6184,81 +6100,24 @@ finish_function (int nested, int can_defer_p)
&& DECL_INLINE (fndecl))
warning ("no return statement in function returning non-void");
- /* Clear out memory we no longer need. */
- free_after_parsing (cfun);
- /* Since we never call rest_of_compilation, we never clear
- CFUN. Do so explicitly. */
- free_after_compilation (cfun);
- cfun = NULL;
-
- if (flag_unit_at_a_time && can_defer_p)
- {
- cgraph_finalize_function (fndecl, DECL_SAVED_TREE (fndecl));
- current_function_decl = NULL;
- return;
- }
-
- if (! nested)
- {
- /* Function is parsed.
- Generate RTL for the body of this function or defer
- it for later expansion. */
- int uninlinable = 1;
-
- /* There's no reason to do any of the work here if we're only doing
- semantic analysis; this code just generates RTL. */
- if (flag_syntax_only)
- {
- current_function_decl = NULL;
- DECL_SAVED_TREE (fndecl) = NULL_TREE;
- return;
- }
-
- if (flag_inline_trees)
- {
- /* First, cache whether the current function is inlinable. Some
- predicates depend on cfun and current_function_decl to
- function completely. */
- timevar_push (TV_INTEGRATION);
- uninlinable = ! tree_inlinable_function_p (fndecl, 0);
-
- if (can_defer_p
- /* We defer functions marked inline *even if* the function
- itself is not inlinable. This is because we don't yet
- know if the function will actually be used; we may be
- able to avoid emitting it entirely. */
- && (! uninlinable || DECL_DECLARED_INLINE_P (fndecl))
- /* Save function tree for inlining. Should return 0 if the
- language does not support function deferring or the
- function could not be deferred. */
- && defer_fn (fndecl))
- {
- /* Let the back-end know that this function exists. */
- (*debug_hooks->deferred_inline_function) (fndecl);
- timevar_pop (TV_INTEGRATION);
- current_function_decl = NULL;
- return;
- }
-
- /* Then, inline any functions called in it. */
- optimize_inline_calls (fndecl);
- timevar_pop (TV_INTEGRATION);
- }
-
- c_expand_body (fndecl);
+ /* With just -Wextra, complain only if function returns both with
+ and without a value. */
+ if (extra_warnings
+ && current_function_returns_value
+ && current_function_returns_null)
+ warning ("this function may return with or without a value");
- /* Keep the function body if it's needed for inlining or dumping. */
- if (uninlinable && !dump_enabled_p (TDI_all))
- {
- /* Allow the body of the function to be garbage collected. */
- DECL_SAVED_TREE (fndecl) = NULL_TREE;
- }
+ /* We're leaving the context of this function, so zap cfun. It's still in
+ DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation. */
+ cfun = NULL;
- /* Let the error reporting routines know that we're outside a
- function. For a nested function, this value is used in
- c_pop_function_context and then reset via pop_function_context. */
- current_function_decl = NULL;
- }
+ /* ??? Objc emits functions after finalizing the compilation unit.
+ This should be cleaned up later and this conditional removed. */
+ if (!cgraph_global_info_ready)
+ cgraph_finalize_function (fndecl, false);
+ else
+ c_expand_body (fndecl);
+ current_function_decl = NULL;
}
/* Generate the RTL for a deferred function FNDECL. */
@@ -6281,153 +6140,28 @@ c_expand_deferred_function (tree fndecl)
}
}
-/* Called to move the SAVE_EXPRs for parameter declarations in a
- nested function into the nested function. DATA is really the
- nested FUNCTION_DECL. */
-
-static tree
-set_save_expr_context (tree *tp,
- int *walk_subtrees,
- void *data)
-{
- if (TREE_CODE (*tp) == SAVE_EXPR && !SAVE_EXPR_CONTEXT (*tp))
- SAVE_EXPR_CONTEXT (*tp) = (tree) data;
- /* Do not walk back into the SAVE_EXPR_CONTEXT; that will cause
- circularity. */
- else if (DECL_P (*tp))
- *walk_subtrees = 0;
-
- return NULL_TREE;
-}
-
/* Generate the RTL for the body of FNDECL. If NESTED_P is nonzero,
then we are already in the process of generating RTL for another
- function. If can_defer_p is zero, we won't attempt to defer the
- generation of RTL. */
+ function. */
static void
c_expand_body_1 (tree fndecl, int nested_p)
{
- timevar_push (TV_EXPAND);
-
if (nested_p)
{
/* Make sure that we will evaluate variable-sized types involved
in our function's type. */
expand_pending_sizes (DECL_LANG_SPECIFIC (fndecl)->pending_sizes);
+
/* Squirrel away our current state. */
push_function_context ();
}
- /* Initialize the RTL code for the function. */
- current_function_decl = fndecl;
- input_location = DECL_SOURCE_LOCATION (fndecl);
- init_function_start (fndecl);
-
- /* This function is being processed in whole-function mode. */
- cfun->x_whole_function_mode_p = 1;
+ tree_rest_of_compilation (fndecl, nested_p);
- /* Even though we're inside a function body, we still don't want to
- call expand_expr to calculate the size of a variable-sized array.
- We haven't necessarily assigned RTL to all variables yet, so it's
- not safe to try to expand expressions involving them. */
- immediate_size_expand = 0;
- cfun->x_dont_save_pending_sizes_p = 1;
-
- /* Set up parameters and prepare for return, for the function. */
- expand_function_start (fndecl, 0);
-
- /* If the function has a variably modified type, there may be
- SAVE_EXPRs in the parameter types. Their context must be set to
- refer to this function; they cannot be expanded in the containing
- function. */
- if (decl_function_context (fndecl)
- && variably_modified_type_p (TREE_TYPE (fndecl)))
- walk_tree (&TREE_TYPE (fndecl), set_save_expr_context, fndecl,
- NULL);
-
- /* If this function is `main', emit a call to `__main'
- to run global initializers, etc. */
- if (DECL_NAME (fndecl)
- && MAIN_NAME_P (DECL_NAME (fndecl))
- && DECL_CONTEXT (fndecl) == NULL_TREE)
- expand_main_function ();
-
- /* Generate the RTL for this function. */
- expand_stmt (DECL_SAVED_TREE (fndecl));
-
- /* We hard-wired immediate_size_expand to zero above.
- expand_function_end will decrement this variable. So, we set the
- variable to one here, so that after the decrement it will remain
- zero. */
- immediate_size_expand = 1;
-
- /* Allow language dialects to perform special processing. */
- if (lang_expand_function_end)
- (*lang_expand_function_end) ();
-
- /* Generate rtl for function exit. */
- expand_function_end ();
-
- /* If this is a nested function, protect the local variables in the stack
- above us from being collected while we're compiling this function. */
if (nested_p)
- ggc_push_context ();
-
- /* Run the optimizers and output the assembler code for this function. */
- rest_of_compilation (fndecl);
-
- /* Undo the GC context switch. */
- if (nested_p)
- ggc_pop_context ();
-
- /* With just -Wextra, complain only if function returns both with
- and without a value. */
- if (extra_warnings
- && current_function_returns_value
- && current_function_returns_null)
- warning ("this function may return with or without a value");
-
- /* If requested, warn about function definitions where the function will
- return a value (usually of some struct or union type) which itself will
- take up a lot of stack space. */
-
- if (warn_larger_than && !DECL_EXTERNAL (fndecl) && TREE_TYPE (fndecl))
- {
- tree ret_type = TREE_TYPE (TREE_TYPE (fndecl));
-
- if (ret_type && TYPE_SIZE_UNIT (ret_type)
- && TREE_CODE (TYPE_SIZE_UNIT (ret_type)) == INTEGER_CST
- && 0 < compare_tree_int (TYPE_SIZE_UNIT (ret_type),
- larger_than_size))
- {
- unsigned int size_as_int
- = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
-
- if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0)
- warning_with_decl (fndecl,
- "size of return value of `%s' is %u bytes",
- size_as_int);
- else
- warning_with_decl (fndecl,
- "size of return value of `%s' is larger than %d bytes",
- larger_than_size);
- }
- }
-
- if (DECL_SAVED_INSNS (fndecl) == 0 && ! nested_p
- && ! flag_inline_trees)
- {
- /* Stop pointing to the local nodes about to be freed.
- But DECL_INITIAL must remain nonzero so we know this
- was an actual function definition.
- For a nested function, this is done in c_pop_function_context.
- If rest_of_compilation set this to 0, leave it 0. */
- if (DECL_INITIAL (fndecl) != 0)
- DECL_INITIAL (fndecl) = error_mark_node;
-
- DECL_ARGUMENTS (fndecl) = 0;
- }
+ /* Return to the enclosing function. */
+ pop_function_context ();
if (DECL_STATIC_CONSTRUCTOR (fndecl))
{
@@ -6446,11 +6180,6 @@ c_expand_body_1 (tree fndecl, int nested_p)
else
static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors);
}
-
- if (nested_p)
- /* Return to the enclosing function. */
- pop_function_context ();
- timevar_pop (TV_EXPAND);
}
/* Like c_expand_body_1 but only for unnested functions. */
@@ -6473,7 +6202,7 @@ check_for_loop_decls (void)
/* 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. */
- error ("`for' loop initial declaration used outside C99 mode");
+ error ("'for' loop initial declaration used outside C99 mode");
return;
}
/* C99 subclause 6.8.5 paragraph 3:
@@ -6490,20 +6219,20 @@ check_for_loop_decls (void)
interpretation, to avoid creating an extension which later causes
problems. */
- for (t = gettags (); t; t = TREE_CHAIN (t))
+ for (t = current_scope->tags; t; t = TREE_CHAIN (t))
{
if (TREE_PURPOSE (t) != 0)
{
enum tree_code code = TREE_CODE (TREE_VALUE (t));
if (code == RECORD_TYPE)
- error ("`struct %s' declared in `for' loop initial declaration",
+ error ("'struct %s' declared in 'for' loop initial declaration",
IDENTIFIER_POINTER (TREE_PURPOSE (t)));
else if (code == UNION_TYPE)
- error ("`union %s' declared in `for' loop initial declaration",
+ error ("'union %s' declared in 'for' loop initial declaration",
IDENTIFIER_POINTER (TREE_PURPOSE (t)));
else
- error ("`enum %s' declared in `for' loop initial declaration",
+ error ("'enum %s' declared in 'for' loop initial declaration",
IDENTIFIER_POINTER (TREE_PURPOSE (t)));
}
}
@@ -6511,11 +6240,14 @@ check_for_loop_decls (void)
for (t = getdecls (); t; t = TREE_CHAIN (t))
{
if (TREE_CODE (t) != VAR_DECL && DECL_NAME (t))
- error_with_decl (t, "declaration of non-variable `%s' in `for' loop initial declaration");
+ error ("%Jdeclaration of non-variable '%D' in 'for' loop "
+ "initial declaration", t, t);
else if (TREE_STATIC (t))
- error_with_decl (t, "declaration of static variable `%s' in `for' loop initial declaration");
+ error ("%Jdeclaration of static variable '%D' in 'for' loop "
+ "initial declaration", t, t);
else if (DECL_EXTERNAL (t))
- error_with_decl (t, "declaration of `extern' variable `%s' in `for' loop initial declaration");
+ error ("%Jdeclaration of 'extern' variable '%D' in 'for' loop "
+ "initial declaration", t, t);
}
}
@@ -6526,14 +6258,11 @@ check_for_loop_decls (void)
struct language_function GTY(())
{
struct c_language_function base;
- tree named_labels;
- tree shadowed_labels;
int returns_value;
int returns_null;
int returns_abnormally;
int warn_about_return_type;
int extern_inline;
- struct binding_level *binding_level;
};
/* Save and reinitialize the variables
@@ -6543,20 +6272,16 @@ void
c_push_function_context (struct function *f)
{
struct language_function *p;
- p = ((struct language_function *)
- ggc_alloc (sizeof (struct language_function)));
+ p = ggc_alloc (sizeof (struct language_function));
f->language = p;
p->base.x_stmt_tree = c_stmt_tree;
p->base.x_scope_stmt_stack = c_scope_stmt_stack;
- p->named_labels = named_labels;
- p->shadowed_labels = shadowed_labels;
p->returns_value = current_function_returns_value;
p->returns_null = current_function_returns_null;
p->returns_abnormally = current_function_returns_abnormally;
p->warn_about_return_type = warn_about_return_type;
p->extern_inline = current_extern_inline;
- p->binding_level = current_binding_level;
}
/* Restore the variables used during compilation of a C function. */
@@ -6565,13 +6290,6 @@ void
c_pop_function_context (struct function *f)
{
struct language_function *p = f->language;
- tree link;
-
- /* Bring back all the labels that were shadowed. */
- for (link = shadowed_labels; link; link = TREE_CHAIN (link))
- if (DECL_NAME (TREE_VALUE (link)) != 0)
- IDENTIFIER_LABEL_VALUE (DECL_NAME (TREE_VALUE (link)))
- = TREE_VALUE (link);
if (DECL_SAVED_INSNS (current_function_decl) == 0
&& DECL_SAVED_TREE (current_function_decl) == NULL_TREE)
@@ -6585,14 +6303,11 @@ 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;
- named_labels = p->named_labels;
- shadowed_labels = p->shadowed_labels;
current_function_returns_value = p->returns_value;
current_function_returns_null = p->returns_null;
current_function_returns_abnormally = p->returns_abnormally;
warn_about_return_type = p->warn_about_return_type;
current_extern_inline = p->extern_inline;
- current_binding_level = p->binding_level;
f->language = NULL;
}
@@ -6607,9 +6322,8 @@ c_dup_lang_specific_decl (tree decl)
if (!DECL_LANG_SPECIFIC (decl))
return;
- ld = (struct lang_decl *) ggc_alloc (sizeof (struct lang_decl));
- memcpy ((char *) ld, (char *) DECL_LANG_SPECIFIC (decl),
- sizeof (struct lang_decl));
+ ld = ggc_alloc (sizeof (struct lang_decl));
+ memcpy (ld, DECL_LANG_SPECIFIC (decl), sizeof (struct lang_decl));
DECL_LANG_SPECIFIC (decl) = ld;
}
@@ -6697,11 +6411,11 @@ tree
identifier_global_value (tree t)
{
tree decl = IDENTIFIER_SYMBOL_VALUE (t);
- if (decl == 0 || DECL_CONTEXT (decl) == 0)
+ if (decl == 0 || DECL_FILE_SCOPE_P (decl))
return decl;
/* Shadowed by something else; find the true global value. */
- for (decl = global_binding_level->names; decl; decl = TREE_CHAIN (decl))
+ for (decl = global_scope->names; decl; decl = TREE_CHAIN (decl))
if (DECL_NAME (decl) == t)
return decl;
@@ -6751,4 +6465,194 @@ make_pointer_declarator (tree type_quals_attrs, tree target)
return build1 (INDIRECT_REF, quals, itarget);
}
+/* A wrapper around lhd_set_decl_assembler_name that gives static
+ variables their C names if they are at file scope and only one
+ translation unit is being compiled, for backwards compatibility
+ with certain bizarre assembler hacks (like crtstuff.c). */
+
+void
+c_static_assembler_name (tree decl)
+{
+ if (num_in_fnames == 1
+ && !TREE_PUBLIC (decl) && DECL_CONTEXT (decl)
+ && TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL)
+ SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
+ else
+ lhd_set_decl_assembler_name (decl);
+}
+
+/* Hash and equality functions for link_hash_table: key off
+ DECL_ASSEMBLER_NAME. */
+
+static hashval_t
+link_hash_hash (const void *x_p)
+{
+ tree x = (tree)x_p;
+ return (hashval_t) (long)DECL_ASSEMBLER_NAME (x);
+}
+
+static int
+link_hash_eq (const void *x1_p, const void *x2_p)
+{
+ tree x1 = (tree)x1_p;
+ tree x2 = (tree)x2_p;
+ return DECL_ASSEMBLER_NAME (x1) == DECL_ASSEMBLER_NAME (x2);
+}
+
+/* Propagate information between definitions and uses between multiple
+ translation units in TU_LIST based on linkage rules. */
+
+void
+merge_translation_unit_decls (void)
+{
+ const tree tu_list = current_file_decl;
+ tree tu;
+ 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);
+ BLOCK_VARS (block) = current_scope->names;
+ TREE_USED (block) = 1;
+ DECL_INITIAL (current_file_decl) = block;
+
+ /* If only one translation unit seen, no copying necessary. */
+ if (TREE_CHAIN (tu_list) == NULL_TREE)
+ return;
+
+ link_hash_table = htab_create (1021, link_hash_hash, link_hash_eq, NULL);
+
+ /* Enter any actual definitions into the hash table. */
+ for (tu = tu_list; tu; tu = TREE_CHAIN (tu))
+ for (decl = BLOCK_VARS (DECL_INITIAL (tu)); decl; decl = TREE_CHAIN (decl))
+ if (TREE_PUBLIC (decl) && ! DECL_EXTERNAL (decl))
+ {
+ PTR *slot;
+ slot = htab_find_slot (link_hash_table, decl, INSERT);
+
+ /* If we've already got a definition, work out which one is
+ the real one, put it into the hash table, and make the
+ other one DECL_EXTERNAL. This is important to avoid
+ putting out two definitions of the same symbol in the
+ assembly output. */
+ if (*slot != NULL)
+ {
+ tree old_decl = (tree) *slot;
+
+ /* If this is weak or common or whatever, suppress it
+ in favor of the other definition. */
+ if (DECL_WEAK (decl))
+ DECL_EXTERNAL (decl) = 1;
+ else if (DECL_WEAK (old_decl) && ! DECL_WEAK (decl))
+ DECL_EXTERNAL (old_decl) = 1;
+ else if (DECL_COMMON (decl) || DECL_ONE_ONLY (decl))
+ 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;
+ DECL_COMMON (decl) = 0;
+ DECL_ONE_ONLY (decl) = 0;
+ DECL_WEAK (decl) = 0;
+ }
+ else if (DECL_EXTERNAL (old_decl))
+ {
+ DECL_INITIAL (old_decl) = NULL_TREE;
+ DECL_COMMON (old_decl) = 0;
+ DECL_ONE_ONLY (old_decl) = 0;
+ DECL_WEAK (old_decl) = 0;
+ *slot = decl;
+ }
+ else
+ {
+ error ("%Jredefinition of global '%D'", decl, decl);
+ error ("%J'%D' previously defined here", old_decl, old_decl);
+ }
+ }
+ else
+ *slot = decl;
+ }
+
+ /* Now insert the desired information from all the definitions
+ into any plain declarations. */
+ for (tu = tu_list; tu; tu = TREE_CHAIN (tu))
+ for (decl = BLOCK_VARS (DECL_INITIAL (tu)); decl; decl = TREE_CHAIN (decl))
+ if (TREE_PUBLIC (decl) && DECL_EXTERNAL (decl))
+ {
+ 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);
+ }
+
+ htab_delete (link_hash_table);
+}
+
+/* Perform final processing on file-scope data. */
+
+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));
+ int len = list_length (globals);
+ 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);
+ }
+}
+
+/* Reset the parser's state in preparation for a new file. */
+
+void
+c_reset_state (void)
+{
+ tree link;
+ tree file_scope_decl;
+
+ /* Pop the global scope. */
+ if (current_scope != global_scope)
+ current_scope = global_scope;
+ file_scope_decl = current_file_decl;
+ DECL_INITIAL (file_scope_decl) = poplevel (1, 0, 0);
+ BLOCK_SUPERCONTEXT (DECL_INITIAL (file_scope_decl)) = file_scope_decl;
+ truly_local_externals = NULL_TREE;
+
+ /* Start a new global binding level. */
+ pushlevel (0);
+ global_scope = current_scope;
+ current_file_decl = build_decl (TRANSLATION_UNIT_DECL, NULL, NULL);
+ TREE_CHAIN (current_file_decl) = file_scope_decl;
+
+ /* Reintroduce the builtin declarations. */
+ for (link = first_builtin_decl;
+ link != TREE_CHAIN (last_builtin_decl);
+ link = TREE_CHAIN (link))
+ pushdecl (copy_node (link));
+}
+
#include "gt-c-decl.h"
diff --git a/gcc/c-errors.c b/gcc/c-errors.c
index 2a2fdc0c440..fa71b8cfa97 100644
--- a/gcc/c-errors.c
+++ b/gcc/c-errors.c
@@ -43,3 +43,21 @@ pedwarn_c99 (const char *msgid, ...)
report_diagnostic (&diagnostic);
va_end (ap);
}
+
+/* Issue an ISO C90 pedantic warning MSGID. This function is supposed to
+ be used for matters that are allowed in ISO C99 but not supported in
+ ISO C90, thus we explicitly don't pedwarn when C99 is specified.
+ (There is no flag_c90.) */
+
+void
+pedwarn_c90 (const char *msgid, ...)
+{
+ diagnostic_info diagnostic;
+ va_list ap;
+
+ va_start (ap, msgid);
+ diagnostic_set_info (&diagnostic, msgid, &ap, input_location,
+ flag_isoc99 ? DK_WARNING : pedantic_error_kind ());
+ report_diagnostic (&diagnostic);
+ va_end (ap);
+}
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 0b3fa2f251c..82fb593f440 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -810,6 +810,9 @@ static const format_char_info gcc_diag_char_table[] =
/* %H will require "location_t" at runtime. */
{ "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
+ /* These will require a "tree" at runtime. */
+ { "J", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
+
{ "m", 0, STD_C89, NOARGUMENTS, "", "" },
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
};
@@ -830,7 +833,7 @@ static const format_char_info gcc_cdiag_char_table[] =
{ "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
/* These will require a "tree" at runtime. */
- { "DFT", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
+ { "DEFJT", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
{ "m", 0, STD_C89, NOARGUMENTS, "", "" },
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
@@ -852,7 +855,7 @@ static const format_char_info gcc_cxxdiag_char_table[] =
{ "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
/* These will require a "tree" at runtime. */
- { "ADEFTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "+#", "" },
+ { "ADEFJTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "+#", "" },
/* These accept either an `int' or an `enum tree_code' (which is handled as an `int'.) */
{ "CLOPQ",0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
@@ -2401,19 +2404,24 @@ check_format_types (int *status, format_wanted_type *types)
{
const char *this;
const char *that;
+ tree tmp;
+
+ tmp = TYPE_NAME (wanted_type);
+ if (TREE_CODE (tmp) == TYPE_DECL)
+ tmp = DECL_NAME (tmp);
+ this = IDENTIFIER_POINTER (tmp);
- this = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (wanted_type)));
that = 0;
if (TYPE_NAME (orig_cur_type) != 0
&& TREE_CODE (orig_cur_type) != INTEGER_TYPE
&& !(TREE_CODE (orig_cur_type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (orig_cur_type)) == INTEGER_TYPE))
{
- if (TREE_CODE (TYPE_NAME (orig_cur_type)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (orig_cur_type)) != 0)
- that = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (orig_cur_type)));
- else
- that = IDENTIFIER_POINTER (TYPE_NAME (orig_cur_type));
+ tmp = TYPE_NAME (orig_cur_type);
+ if (TREE_CODE (tmp) == TYPE_DECL)
+ tmp = DECL_NAME (tmp);
+ if (tmp)
+ that = IDENTIFIER_POINTER (tmp);
}
/* A nameless type can't possibly match what the format wants.
@@ -2471,7 +2479,6 @@ find_char_info_specifier_index (const format_char_info *fci, int c)
/* We shouldn't be looking for a non-existent specifier. */
abort ();
-
}
/* Given a format_length_info array FLI, and a character C, this
@@ -2604,6 +2611,12 @@ init_dynamic_diag_info (void)
diag_fci[i].types[0].type = &loc;
diag_fci[i].pointer_count = 1;
}
+ if (t)
+ {
+ i = find_char_info_specifier_index (diag_fci, 'J');
+ diag_fci[i].types[0].type = &t;
+ diag_fci[i].pointer_count = 1;
+ }
/* Handle the __gcc_cdiag__ format specifics. */
if (! cdiag_fci)
@@ -2619,10 +2632,13 @@ init_dynamic_diag_info (void)
}
if (t)
{
- /* All specifiers taking a tree share the same struct. */
+ /* All specifiers taking a tree share the same struct. */
i = find_char_info_specifier_index (cdiag_fci, 'D');
cdiag_fci[i].types[0].type = &t;
cdiag_fci[i].pointer_count = 1;
+ i = find_char_info_specifier_index (cdiag_fci, 'J');
+ cdiag_fci[i].types[0].type = &t;
+ cdiag_fci[i].pointer_count = 1;
}
/* Handle the __gcc_cxxdiag__ format specifics. */
@@ -2639,10 +2655,13 @@ init_dynamic_diag_info (void)
}
if (t)
{
- /* All specifiers taking a tree share the same struct. */
+ /* All specifiers taking a tree share the same struct. */
i = find_char_info_specifier_index (cxxdiag_fci, 'D');
cxxdiag_fci[i].types[0].type = &t;
cxxdiag_fci[i].pointer_count = 1;
+ i = find_char_info_specifier_index (cxxdiag_fci, 'J');
+ cxxdiag_fci[i].types[0].type = &t;
+ cxxdiag_fci[i].pointer_count = 1;
}
}
}
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c
index efcd19b5ea5..e28114652a3 100644
--- a/gcc/c-incpath.c
+++ b/gcc/c-incpath.c
@@ -45,21 +45,21 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static void add_env_var_paths (const char *, int);
static void add_standard_paths (const char *, const char *, int);
-static void free_path (struct cpp_path *, int);
+static void free_path (struct cpp_dir *, int);
static void merge_include_chains (cpp_reader *, int);
-static struct cpp_path *remove_duplicates (cpp_reader *, struct cpp_path *,
- struct cpp_path *,
- struct cpp_path *, int);
+static struct cpp_dir *remove_duplicates (cpp_reader *, struct cpp_dir *,
+ struct cpp_dir *,
+ struct cpp_dir *, int);
/* Include chains heads and tails. */
-static struct cpp_path *heads[4];
-static struct cpp_path *tails[4];
+static struct cpp_dir *heads[4];
+static struct cpp_dir *tails[4];
static bool quote_ignores_source_dir;
enum { REASON_QUIET = 0, REASON_NOENT, REASON_DUP, REASON_DUP_SYS };
/* Free an element of the include chain, possibly giving a reason. */
static void
-free_path (struct cpp_path *path, int reason)
+free_path (struct cpp_dir *path, int reason)
{
switch (reason)
{
@@ -169,12 +169,12 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
JOIN, unless it duplicates JOIN in which case the last path is
removed. Return the head of the resulting chain. Any of HEAD,
JOIN and SYSTEM can be NULL. */
-static struct cpp_path *
-remove_duplicates (cpp_reader *pfile, struct cpp_path *head,
- struct cpp_path *system, struct cpp_path *join,
+static struct cpp_dir *
+remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
+ struct cpp_dir *system, struct cpp_dir *join,
int verbose)
{
- struct cpp_path **pcur, *tmp, *cur;
+ struct cpp_dir **pcur, *tmp, *cur;
struct stat st;
for (pcur = &head; *pcur; )
@@ -182,7 +182,6 @@ remove_duplicates (cpp_reader *pfile, struct cpp_path *head,
int reason = REASON_QUIET;
cur = *pcur;
- cpp_simplify_path (cur->name);
if (stat (cur->name, &st))
{
@@ -269,7 +268,7 @@ merge_include_chains (cpp_reader *pfile, int verbose)
/* If verbose, print the list of dirs to search. */
if (verbose)
{
- struct cpp_path *p;
+ struct cpp_dir *p;
fprintf (stderr, _("#include \"...\" search starts here:\n"));
for (p = heads[QUOTE];; p = p->next)
@@ -304,9 +303,9 @@ split_quote_chain (void)
void
add_path (char *path, int chain, int cxx_aware)
{
- struct cpp_path *p;
+ struct cpp_dir *p;
- p = (struct cpp_path *) xmalloc (sizeof (struct cpp_path));
+ p = xmalloc (sizeof (struct cpp_dir));
p->next = NULL;
p->name = path;
if (chain == SYSTEM || chain == AFTER)
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index 815a72f1a20..06490330364 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -30,6 +30,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "langhooks.h"
#include "langhooks-def.h"
+#include "diagnostic.h"
+#include "c-pretty-print.h"
+
+static void c_initialize_diagnostics (diagnostic_context *);
enum c_language_kind c_language = clk_c;
@@ -43,10 +47,10 @@ enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_FINISH c_common_finish
#undef LANG_HOOKS_INIT_OPTIONS
#define LANG_HOOKS_INIT_OPTIONS c_common_init_options
+#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS
+#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS c_initialize_diagnostics
#undef LANG_HOOKS_HANDLE_OPTION
#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option
-#undef LANG_HOOKS_HANDLE_FILENAME
-#define LANG_HOOKS_HANDLE_FILENAME c_common_handle_filename
#undef LANG_HOOKS_MISSING_ARGUMENT
#define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument
#undef LANG_HOOKS_POST_OPTIONS
@@ -63,14 +67,14 @@ enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
#undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp
+#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
+#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME c_static_assembler_name
#undef LANG_HOOKS_NO_BODY_BLOCKS
#define LANG_HOOKS_NO_BODY_BLOCKS true
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
@@ -83,6 +87,11 @@ enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
+#undef LANG_HOOKS_DECL_UNINIT
+#define LANG_HOOKS_DECL_UNINIT c_decl_uninit
+
+#undef LANG_HOOKS_RTL_EXPAND_STMT
+#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
@@ -124,6 +133,11 @@ enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error
#undef LANG_HOOKS_TYPE_PROMOTES_TO
#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to
+#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
+#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
+
+#undef LANG_HOOKS_WRITE_GLOBALS
+#define LANG_HOOKS_WRITE_GLOBALS c_write_global_declarations
/* ### When changing hooks, consider if ObjC needs changing too!! ### */
@@ -165,56 +179,24 @@ const char *const tree_code_name[] = {
};
#undef DEFTREECODE
-/* Used by c-lex.c, but only for objc. */
-
-tree
-lookup_interface (tree arg ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-tree
-is_class_name (tree arg ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-tree
-objc_is_id (tree arg ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
void
-objc_check_decl (tree decl ATTRIBUTE_UNUSED)
-{
-}
-
-int
-objc_comptypes (tree lhs ATTRIBUTE_UNUSED, tree rhs ATTRIBUTE_UNUSED,
- int reflexive ATTRIBUTE_UNUSED)
+finish_file (void)
{
- return -1;
+ c_objc_common_finish_file ();
}
-tree
-objc_message_selector (void)
+static void
+c_initialize_diagnostics (diagnostic_context *context)
{
- return 0;
+ pretty_printer *base = context->printer;
+ c_pretty_printer *pp = xmalloc (sizeof (c_pretty_printer));
+ memcpy (pp_base (pp), base, sizeof (pretty_printer));
+ pp_c_pretty_printer_init (pp);
+ context->printer = (pretty_printer *) pp;
+
+ /* It is safe to free this object because it was previously malloc()'d. */
+ free (base);
}
-/* Used by c-typeck.c (build_external_ref), but only for objc. */
-
-tree
-lookup_objc_ivar (tree id ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-void
-finish_file (void)
-{
- c_objc_common_finish_file ();
-}
#include "gtype-c.h"
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 034b3b608c8..2109eff1da9 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -72,6 +72,7 @@ static tree lex_charconst (const cpp_token *);
static void update_header_times (const char *);
static int dump_one_header (splay_tree_node, void *);
static void cb_line_change (cpp_reader *, const cpp_token *, int);
+static void cb_dir_change (cpp_reader *, const char *);
static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
static void cb_def_pragma (cpp_reader *, unsigned int);
static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
@@ -98,6 +99,7 @@ init_c_lex (void)
cb = cpp_get_callbacks (parse_in);
cb->line_change = cb_line_change;
+ cb->dir_change = cb_dir_change;
cb->ident = cb_ident;
cb->def_pragma = cb_def_pragma;
cb->valid_pch = c_common_valid_pch;
@@ -123,7 +125,7 @@ get_fileinfo (const char *name)
if (n)
return (struct c_fileinfo *) n->value;
- fi = (struct c_fileinfo *) xmalloc (sizeof (struct c_fileinfo));
+ fi = xmalloc (sizeof (struct c_fileinfo));
fi->time = 0;
fi->interface_only = 0;
fi->interface_unknown = 1;
@@ -195,16 +197,24 @@ cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED,
lexed token on the line. Used for diagnostic line numbers. */
static void
cb_line_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const cpp_token *token,
- int parsing_args ATTRIBUTE_UNUSED)
+ int parsing_args)
{
+ if (token->type == CPP_EOF || parsing_args)
+ return;
+
src_lineno = SOURCE_LINE (map, token->line);
}
+static void
+cb_dir_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const char *dir)
+{
+ if (! set_src_pwd (dir))
+ warning ("too late for # directive to set debug directory");
+}
+
void
fe_file_change (const struct line_map *new_map)
{
- unsigned int to_line = SOURCE_LINE (new_map, new_map->to_line);
-
if (new_map->reason == LC_ENTER)
{
/* Don't stack the main buffer on the input stack;
@@ -241,13 +251,13 @@ fe_file_change (const struct line_map *new_map)
#endif
pop_srcloc ();
- (*debug_hooks->end_source_file) (to_line);
+ (*debug_hooks->end_source_file) (new_map->to_line);
}
update_header_times (new_map->to_file);
in_system_header = new_map->sysp != 0;
input_filename = new_map->to_file;
- input_line = to_line;
+ input_line = new_map->to_line;
map = new_map;
/* Hook for C++. */
@@ -320,6 +330,7 @@ c_lex (tree *value)
{
const cpp_token *tok;
location_t atloc;
+ static bool no_more_pch;
retry:
tok = get_nonpadding_token ();
@@ -421,6 +432,12 @@ c_lex (tree *value)
break;
}
+ if (! no_more_pch)
+ {
+ no_more_pch = true;
+ c_common_no_more_pch ();
+ }
+
return tok->type;
}
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 438b3fba808..287cf300232 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -39,14 +39,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "target.h"
#include "cgraph.h"
-static bool c_tree_printer (output_buffer *, text_info *);
-static tree inline_forbidden_p (tree *, int *, void *);
-static void expand_deferred_fns (void);
+static bool c_tree_printer (pretty_printer *, text_info *);
static tree start_cdtor (int);
static void finish_cdtor (tree);
-static GTY(()) varray_type deferred_fns;
-
int
c_missing_noreturn_ok_p (tree decl)
{
@@ -68,110 +64,42 @@ c_disregard_inline_limits (tree fn)
return DECL_DECLARED_INLINE_P (fn) && DECL_EXTERNAL (fn);
}
-static tree
-inline_forbidden_p (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *fn)
-{
- tree node = *nodep;
- tree t;
-
- switch (TREE_CODE (node))
- {
- case CALL_EXPR:
- t = get_callee_fndecl (node);
-
- if (! t)
- break;
-
- /* We cannot inline functions that call setjmp. */
- if (setjmp_call_p (t))
- 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:
-#if 0
- /* Functions that need information about the address of the
- caller can't (shouldn't?) be inlined. */
- case BUILT_IN_RETURN_ADDRESS:
-#endif
- return node;
-
- default:
- break;
- }
-
- break;
-
- case DECL_STMT:
- /* We cannot inline functions that contain other functions. */
- if (TREE_CODE (TREE_OPERAND (node, 0)) == FUNCTION_DECL
- && DECL_INITIAL (TREE_OPERAND (node, 0)))
- return node;
- break;
-
- case GOTO_STMT:
- case GOTO_EXPR:
- t = TREE_OPERAND (node, 0);
-
- /* We will not inline a function which uses computed goto. The
- addresses of its local labels, which may be tucked into
- global storage, are of course not constant across
- instantiations, which causes unexpected behavior. */
- if (TREE_CODE (t) != LABEL_DECL)
- return node;
-
- /* We cannot inline a nested function that jumps to a nonlocal
- label. */
- if (TREE_CODE (t) == LABEL_DECL
- && DECL_CONTEXT (t) && DECL_CONTEXT (t) != fn)
- return node;
-
- break;
-
- case RECORD_TYPE:
- case UNION_TYPE:
- /* We cannot inline a function of the form
-
- void F (int i) { struct S { int ar[i]; } s; }
-
- Attempting to do so produces a catch-22 in tree-inline.c.
- If walk_tree examines the TYPE_FIELDS chain of RECORD_TYPE/
- UNION_TYPE nodes, then it goes into infinite recursion on a
- structure containing a pointer to its own type. If it doesn't,
- then the type node for S doesn't get adjusted properly when
- F is inlined, and we abort in find_function_data. */
- for (t = TYPE_FIELDS (node); t; t = TREE_CHAIN (t))
- if (variably_modified_type_p (TREE_TYPE (t)))
- return node;
-
- default:
- break;
- }
-
- return NULL_TREE;
-}
-
int
c_cannot_inline_tree_fn (tree *fnp)
{
tree fn = *fnp;
tree t;
+ bool do_warning = (warn_inline
+ && DECL_INLINE (fn)
+ && DECL_DECLARED_INLINE_P (fn)
+ && !DECL_IN_SYSTEM_HEADER (fn));
if (flag_really_no_inline
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
- return 1;
+ {
+ if (do_warning)
+ warning ("%Jfunction '%F' can never be inlined because it "
+ "is supressed using -fno-inline", fn, fn);
+ goto cannot_inline;
+ }
/* Don't auto-inline anything that might not be bound within
this unit of translation. */
if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn))
- goto cannot_inline;
+ {
+ if (do_warning)
+ warning ("%Jfunction '%F' can never be inlined because it might not "
+ "be bound within this unit of translation", fn, fn);
+ goto cannot_inline;
+ }
if (! function_attribute_inlinable_p (fn))
- goto cannot_inline;
+ {
+ if (do_warning)
+ warning ("%Jfunction '%F' can never be inlined because it uses "
+ "attributes conflicting with inlining", fn, fn);
+ goto cannot_inline;
+ }
/* If a function has pending sizes, we must not defer its
compilation, and we can't inline it as a tree. */
@@ -181,39 +109,27 @@ c_cannot_inline_tree_fn (tree *fnp)
put_pending_sizes (t);
if (t)
- goto cannot_inline;
+ {
+ if (do_warning)
+ warning ("%Jfunction '%F' can never be inlined because it has "
+ "pending sizes", fn, fn);
+ goto cannot_inline;
+ }
}
- if (DECL_CONTEXT (fn))
+ if (! DECL_FILE_SCOPE_P (fn))
{
/* If a nested function has pending sizes, we may have already
saved them. */
if (DECL_LANG_SPECIFIC (fn)->pending_sizes)
- goto cannot_inline;
- }
- else
- {
- /* We rely on the fact that this function is called upfront,
- just before we start expanding a function. If FN is active
- (i.e., it's the current_function_decl or a parent thereof),
- we have to walk FN's saved tree. Otherwise, we can safely
- assume we have done it before and, if we didn't mark it as
- uninlinable (in which case we wouldn't have been called), it
- is inlinable. Unfortunately, this strategy doesn't work for
- nested functions, because they're only expanded as part of
- their enclosing functions, so the inlinability test comes in
- late. */
- t = current_function_decl;
-
- while (t && t != fn)
- t = DECL_CONTEXT (t);
- if (! t)
- return 0;
+ {
+ if (do_warning)
+ warning ("%Jnested function '%F' can never be inlined because it "
+ "has possibly saved pending sizes", fn, fn);
+ goto cannot_inline;
+ }
}
- if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL))
- goto cannot_inline;
-
return 0;
cannot_inline:
@@ -267,46 +183,9 @@ c_objc_common_init (void)
mesg_implicit_function_declaration = 0;
}
- VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns");
-
return true;
}
-/* Register a function tree, so that its optimization and conversion
- to RTL is only done at the end of the compilation. */
-
-int
-defer_fn (tree fn)
-{
- VARRAY_PUSH_TREE (deferred_fns, fn);
-
- return 1;
-}
-
-/* Expand deferred functions for C and ObjC. */
-
-static void
-expand_deferred_fns (void)
-{
- unsigned int i;
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (deferred_fns); i++)
- {
- tree decl = VARRAY_TREE (deferred_fns, i);
-
- if (! TREE_ASM_WRITTEN (decl))
- {
- /* For static inline functions, delay the decision whether to
- emit them or not until wrapup_global_declarations. */
- if (! TREE_PUBLIC (decl))
- DECL_DEFER_OUTPUT (decl) = 1;
- c_expand_deferred_function (decl);
- }
- }
-
- deferred_fns = 0;
-}
-
static tree
start_cdtor (int method_type)
{
@@ -346,7 +225,7 @@ finish_cdtor (tree body)
RECHAIN_STMTS (body, COMPOUND_BODY (body));
- finish_function (0, 0);
+ finish_function ();
}
/* Called at end of parsing, but before end-of-file processing. */
@@ -357,13 +236,12 @@ c_objc_common_finish_file (void)
if (pch_file)
c_common_write_pch ();
- if (flag_unit_at_a_time)
- {
- cgraph_finalize_compilation_unit ();
- cgraph_optimize ();
- }
- else
- expand_deferred_fns ();
+ /* If multiple translation units were built, copy information between
+ them based on linkage rules. */
+ merge_translation_unit_decls ();
+
+ cgraph_finalize_compilation_unit ();
+ cgraph_optimize ();
if (static_ctors)
{
@@ -403,6 +281,7 @@ c_objc_common_finish_file (void)
source-level entity onto BUFFER. The meaning of the format specifiers
is as follows:
%D: a general decl,
+ %E: An expression,
%F: a function declaration,
%T: a type.
@@ -411,7 +290,7 @@ c_objc_common_finish_file (void)
Please notice when called, the `%' part was already skipped by the
diagnostic machinery. */
static bool
-c_tree_printer (output_buffer *buffer, text_info *text)
+c_tree_printer (pretty_printer *pp, text_info *text)
{
tree t = va_arg (*text->args_ptr, tree);
@@ -424,13 +303,19 @@ c_tree_printer (output_buffer *buffer, text_info *text)
const char *n = DECL_NAME (t)
? (*lang_hooks.decl_printable_name) (t, 2)
: "({anonymous})";
- output_add_string (buffer, n);
+ pp_string (pp, n);
}
return true;
+ case 'E':
+ if (TREE_CODE (t) == IDENTIFIER_NODE)
+ {
+ pp_string (pp, IDENTIFIER_POINTER (t));
+ return true;
+ }
+ return false;
+
default:
return false;
}
}
-
-#include "gt-c-objc-common.h"
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index a12ced1f06e..7763702262a 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -52,7 +52,7 @@ static int saved_lineno;
static cpp_options *cpp_opts;
/* Input filename. */
-static const char *in_fname;
+static const char *this_input_filename;
/* Filename and stream for preprocessed output. */
static const char *out_fname;
@@ -98,7 +98,6 @@ static size_t include_cursor;
static bool permit_fortran_options;
static void set_Wimplicit (int);
-static void print_help (void);
static void handle_OPT_d (const char *);
static void set_std_cxx98 (int);
static void set_std_c89 (int, int);
@@ -109,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 (void);
+static void finish_options (const char *);
#ifndef STDC_0_IN_SYSTEM_HEADERS
#define STDC_0_IN_SYSTEM_HEADERS 0
@@ -218,8 +217,7 @@ c_common_init_options (unsigned int argc, const char **argv ATTRIBUTE_UNUSED)
flag_exceptions = c_dialect_cxx ();
warn_pointer_arith = c_dialect_cxx ();
- deferred_opts = (struct deferred_opt *)
- xmalloc (argc * sizeof (struct deferred_opt));
+ deferred_opts = xmalloc (argc * sizeof (struct deferred_opt));
result = lang_flags[c_language];
@@ -237,7 +235,7 @@ c_common_init_options (unsigned int argc, const char **argv ATTRIBUTE_UNUSED)
return result;
}
-/* Handle switch SCODE with argument ARG. ON is true, unless no-
+/* Handle switch SCODE with argument ARG. VALUE is true, unless no-
form of an -f or -W option was given. Returns 0 if the switch was
invalid, a negative number to prevent language-independent
processing in toplev.c (a hack necessary for the short-term). */
@@ -254,10 +252,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
result = permit_fortran_options;
break;
- case OPT__help:
- print_help ();
- break;
-
case OPT__output_pch_:
pch_file = arg;
break;
@@ -341,6 +335,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_no_line_commands = 1;
break;
+ case OPT_fworking_directory:
+ flag_working_directory = value;
+ break;
+
case OPT_U:
defer_opt (code, arg);
break;
@@ -416,6 +414,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_ctor_dtor_privacy = value;
break;
+ case OPT_Wdeclaration_after_statement:
+ warn_declaration_after_statement = value;
+ break;
+
case OPT_Wdeprecated:
warn_deprecated = value;
cpp_opts->warn_deprecated = value;
@@ -473,6 +475,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_format_zero_length = value;
break;
+ case OPT_Winit_self:
+ warn_init_self = value;
+ break;
+
case OPT_Wimplicit:
set_Wimplicit (value);
break;
@@ -486,7 +492,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_Wimport:
- cpp_opts->warn_import = value;
+ /* Silently ignore for now. */
break;
case OPT_Winvalid_offsetof:
@@ -544,6 +550,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_nonnull = value;
break;
+ case OPT_Wold_style_definition:
+ warn_old_style_definition = value;
+ break;
+
case OPT_Wold_style_cast:
warn_old_style_cast = value;
break;
@@ -675,6 +685,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_fthis_is_variable:
case OPT_fvtable_thunks:
case OPT_fxref:
+ case OPT_fvtable_gc:
warning ("switch \"%s\" is no longer supported", option->opt_text);
break;
@@ -721,7 +732,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_ffreestanding:
value = !value;
- /* Fall through... */
+ /* Fall through.... */
case OPT_fhosted:
flag_hosted = value;
flag_no_builtin = !value;
@@ -836,10 +847,18 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_next_runtime = value;
break;
+ case OPT_fnil_receivers:
+ flag_nil_receivers = value;
+ break;
+
case OPT_fnonansi_builtins:
flag_no_nonansi_builtin = !value;
break;
+ case OPT_fobjc_exceptions:
+ flag_objc_exceptions = value;
+ break;
+
case OPT_foperator_names:
cpp_opts->operator_names = value;
break;
@@ -860,6 +879,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
cpp_opts->preprocessed = value;
break;
+ case OPT_freplace_objc_classes:
+ flag_replace_objc_classes = value;
+ break;
+
case OPT_frepo:
flag_use_repository = value;
if (value)
@@ -896,10 +919,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
max_tinst_depth = value;
break;
- case OPT_fvtable_gc:
- flag_vtable_gc = value;
- break;
-
case OPT_fuse_cxa_atexit:
flag_use_cxa_atexit = value;
break;
@@ -908,6 +927,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_weak = value;
break;
+ case OPT_fzero_link:
+ flag_zero_link = value;
+ break;
+
case OPT_gen_decls:
flag_gen_declaration = 1;
break;
@@ -970,7 +993,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
is not overridden. */
case OPT_pedantic_errors:
cpp_opts->pedantic_errors = 1;
- /* fall through */
+ /* Fall through. */
case OPT_pedantic:
cpp_opts->pedantic = 1;
cpp_opts->warn_endif_labels = 1;
@@ -1035,25 +1058,18 @@ c_common_handle_option (size_t scode, const char *arg, int value)
return result;
}
-/* Handle FILENAME from the command line. */
-void
-c_common_handle_filename (const char *filename)
-{
- if (!in_fname)
- in_fname = filename;
- else if (!out_fname)
- out_fname = filename;
- else
- error ("output filename specified twice");
-}
-
/* Post-switch processing. */
bool
c_common_post_options (const char **pfilename)
{
/* Canonicalize the input and output filenames. */
- if (in_fname == NULL || !strcmp (in_fname, "-"))
- in_fname = "";
+ if (in_fnames == NULL)
+ {
+ in_fnames = xmalloc (sizeof (in_fnames[0]));
+ in_fnames[0] = "";
+ }
+ else if (strcmp (in_fnames[0], "-") == 0)
+ in_fnames[0] = "";
if (out_fname == NULL || !strcmp (out_fname, "-"))
out_fname = "";
@@ -1119,6 +1135,10 @@ c_common_post_options (const char **pfilename)
return false;
}
+ if (num_in_fnames > 1)
+ error ("too many filenames given. Type %s --help for usage",
+ progname);
+
init_pp_output (out_stream);
}
else
@@ -1130,9 +1150,10 @@ c_common_post_options (const char **pfilename)
}
cpp_get_callbacks (parse_in)->file_change = cb_file_change;
+ cpp_post_options (parse_in);
/* NOTE: we use in_fname here, not the one supplied. */
- *pfilename = cpp_read_main_file (parse_in, in_fname);
+ *pfilename = cpp_read_main_file (parse_in, in_fnames[0]);
saved_lineno = input_line;
input_line = 0;
@@ -1165,7 +1186,7 @@ c_common_init (void)
if (flag_preprocess_only)
{
- finish_options ();
+ finish_options (in_fnames[0]);
preprocess_file (parse_in);
return false;
}
@@ -1176,23 +1197,43 @@ c_common_init (void)
return true;
}
-/* A thin wrapper around the real parser that initializes the
- integrated preprocessor after debug output has been initialized.
- Also, make sure the start_source_file debug hook gets called for
- the primary source file. */
+/* Initialize the integrated preprocessor after debug output has been
+ initialized; loop over each input file. */
void
c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{
+ unsigned file_index;
+
#if YYDEBUG != 0
yydebug = set_yydebug;
#else
warning ("YYDEBUG not defined");
#endif
- finish_options();
- pch_init();
- yyparse ();
+ file_index = 0;
+
+ do
+ {
+ if (file_index > 0)
+ {
+ /* Reset the state of the parser. */
+ c_reset_state();
+
+ /* Reset cpplib's macros and start a new file. */
+ cpp_undef_all (parse_in);
+ cpp_read_main_file (parse_in, in_fnames[file_index]);
+ }
+
+ finish_options(in_fnames[file_index]);
+ if (file_index == 0)
+ pch_init();
+ c_parse_file ();
+
+ file_index++;
+ } while (file_index < num_in_fnames);
+
free_parser_stacks ();
+ finish_file ();
}
/* Common finish hook for the C, ObjC and C++ front ends. */
@@ -1317,6 +1358,15 @@ sanitize_cpp_opts (void)
and/or -Wtraditional, whatever the ordering. */
cpp_opts->warn_long_long
= warn_long_long && ((!flag_isoc99 && pedantic) || warn_traditional);
+
+ /* If we're generating preprocessor output, emit current directory
+ if explicitly requested or if debugging information is enabled.
+ ??? Maybe we should only do it for debugging formats that
+ actually output the current directory? */
+ if (flag_working_directory == -1)
+ flag_working_directory = (debug_info_level != DINFO_LEVEL_NONE);
+ cpp_opts->working_directory
+ = flag_preprocess_only && flag_working_directory;
}
/* Add include path with a prefix at the front of its name. */
@@ -1339,9 +1389,11 @@ add_prefixed_path (const char *suffix, size_t chain)
add_path (path, chain, 0);
}
-/* Handle -D, -U, -A, -imacros, and the first -include. */
+/* 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
-finish_options (void)
+finish_options (const char *tif)
{
if (!cpp_opts->preprocessed)
{
@@ -1391,6 +1443,8 @@ finish_options (void)
}
}
+ include_cursor = 0;
+ this_input_filename = tif;
push_command_line_include ();
}
@@ -1411,9 +1465,8 @@ push_command_line_include (void)
if (include_cursor == deferred_count)
{
- free (deferred_opts);
/* Restore the line map from <command line>. */
- cpp_change_file (parse_in, LC_RENAME, main_input_filename);
+ cpp_change_file (parse_in, LC_RENAME, this_input_filename);
/* -Wunused-macros should only warn about macros defined hereafter. */
cpp_opts->warn_unused_macros = warn_unused_macros;
include_cursor++;
@@ -1444,7 +1497,6 @@ set_std_c89 (int c94, int iso)
flag_no_asm = iso;
flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso;
- flag_noniso_default_format_attributes = !iso;
flag_isoc94 = c94;
flag_isoc99 = 0;
flag_writable_strings = 0;
@@ -1457,7 +1509,6 @@ set_std_c99 (int iso)
cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99);
flag_no_asm = iso;
flag_no_nonansi_builtin = iso;
- flag_noniso_default_format_attributes = !iso;
flag_iso = iso;
flag_isoc99 = 1;
flag_isoc94 = 1;
@@ -1471,7 +1522,6 @@ set_std_cxx98 (int iso)
cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX);
flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso;
- flag_noniso_default_format_attributes = !iso;
flag_iso = iso;
}
@@ -1511,91 +1561,3 @@ handle_OPT_d (const char *arg)
break;
}
}
-
-/* Handle --help output. */
-static void
-print_help (void)
-{
- /* To keep the lines from getting too long for some compilers, limit
- to about 500 characters (6 lines) per chunk. */
- fputs (_("\
-Switches:\n\
- -include <file> Include the contents of <file> before other files\n\
- -imacros <file> Accept definition of macros in <file>\n\
- -iprefix <path> Specify <path> as a prefix for next two options\n\
- -iwithprefix <dir> Add <dir> to the end of the system include path\n\
- -iwithprefixbefore <dir> Add <dir> to the end of the main include path\n\
- -isystem <dir> Add <dir> to the start of the system include path\n\
-"), stdout);
- fputs (_("\
- -idirafter <dir> Add <dir> to the end of the system include path\n\
- -I <dir> Add <dir> to the end of the main include path\n\
- -I- Fine-grained include path control; see info docs\n\
- -nostdinc Do not search system include directories\n\
- (dirs specified with -isystem will still be used)\n\
- -nostdinc++ Do not search system include directories for C++\n\
- -o <file> Put output into <file>\n\
-"), stdout);
- fputs (_("\
- -trigraphs Support ISO C trigraphs\n\
- -std=<std name> Specify the conformance standard; one of:\n\
- gnu89, gnu99, c89, c99, iso9899:1990,\n\
- iso9899:199409, iso9899:1999, c++98\n\
- -w Inhibit warning messages\n\
- -W[no-]trigraphs Warn if trigraphs are encountered\n\
- -W[no-]comment{s} Warn if one comment starts inside another\n\
-"), stdout);
- fputs (_("\
- -W[no-]traditional Warn about features not present in traditional C\n\
- -W[no-]undef Warn if an undefined macro is used by #if\n\
- -W[no-]import Warn about the use of the #import directive\n\
-"), stdout);
- fputs (_("\
- -W[no-]error Treat all warnings as errors\n\
- -W[no-]system-headers Do not suppress warnings from system headers\n\
- -W[no-]all Enable most preprocessor warnings\n\
-"), stdout);
- fputs (_("\
- -M Generate make dependencies\n\
- -MM As -M, but ignore system header files\n\
- -MD Generate make dependencies and compile\n\
- -MMD As -MD, but ignore system header files\n\
- -MF <file> Write dependency output to the given file\n\
- -MG Treat missing header file as generated files\n\
-"), stdout);
- fputs (_("\
- -MP Generate phony targets for all headers\n\
- -MQ <target> Add a MAKE-quoted target\n\
- -MT <target> Add an unquoted target\n\
-"), stdout);
- fputs (_("\
- -D<macro> Define a <macro> with string '1' as its value\n\
- -D<macro>=<val> Define a <macro> with <val> as its value\n\
- -A<question>=<answer> Assert the <answer> to <question>\n\
- -A-<question>=<answer> Disable the <answer> to <question>\n\
- -U<macro> Undefine <macro> \n\
- -v Display the version number\n\
-"), stdout);
- fputs (_("\
- -H Print the name of header files as they are used\n\
- -C Do not discard comments\n\
- -dM Display a list of macro definitions active at end\n\
- -dD Preserve macro definitions in output\n\
- -dN As -dD except that only the names are preserved\n\
- -dI Include #include directives in the output\n\
-"), stdout);
- fputs (_("\
- -f[no-]preprocessed Treat the input file as already preprocessed\n\
- -ftabstop=<number> Distance between tab stops for column reporting\n\
- -ftarget-charset=<c> Convert all strings and character constants\n\
- to character set <c>\n\
- -ftarget-wide-charset=<c> Convert all wide strings and character constants\n\
- to character set <c>\n\
-"), stdout);
- fputs (_("\
- -isysroot <dir> Set <dir> to be the system root directory\n\
- -P Do not generate #line directives\n\
- -remap Remap file names when including files\n\
- --help Display this information\n\
-"), stdout);
-}
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 787167c155d..3d14d916b07 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -20,17 +20,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* This file defines the grammar of C and that of Objective C.
- ifobjc ... end ifobjc conditionals contain code for Objective C only.
- ifc ... end ifc conditionals contain code for C only.
+ @@ifobjc ... @@end_ifobjc conditionals contain code for Objective C only.
+ @@ifc ... @@end_ifc conditionals contain code for C only.
Sed commands in Makefile.in are used to convert this file into
c-parse.y and into objc-parse.y. */
/* To whomever it may concern: I have heard that such a thing was once
written by AT&T, but I have never seen it. */
-ifc
+@@ifc
%expect 10 /* shift/reduce conflicts, and no reduce/reduce conflicts. */
-end ifc
+@@end_ifc
%{
#include "config.h"
@@ -50,9 +50,9 @@ end ifc
#include "toplev.h"
#include "ggc.h"
-ifobjc
+@@ifobjc
#include "objc-act.h"
-end ifobjc
+@@end_ifobjc
/* Like YYERROR but do call yyerror. */
#define YYERROR1 { yyerror ("syntax error"); YYERROR; }
@@ -75,15 +75,13 @@ do { \
newsize = *(YYSSZ) *= 2; \
if (malloced_yyss) \
{ \
- newss = (short *) \
- really_call_realloc (*(SS), newsize * sizeof (short)); \
- newvs = (YYSTYPE *) \
- really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
+ newss = really_call_realloc (*(SS), newsize * sizeof (short)); \
+ newvs = really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
} \
else \
{ \
- newss = (short *) really_call_malloc (newsize * sizeof (short)); \
- newvs = (YYSTYPE *) really_call_malloc (newsize * sizeof (YYSTYPE)); \
+ newss = really_call_malloc (newsize * sizeof (short)); \
+ newvs = really_call_malloc (newsize * sizeof (YYSTYPE)); \
if (newss) \
memcpy (newss, *(SS), (SSSIZE)); \
if (newvs) \
@@ -177,6 +175,7 @@ do { \
Objective C, so that the token codes are the same in both. */
%token INTERFACE IMPLEMENTATION END SELECTOR DEFS ENCODE
%token CLASSNAME PUBLIC PRIVATE PROTECTED PROTOCOL OBJECTNAME CLASS ALIAS
+%token AT_THROW AT_TRY AT_CATCH AT_FINALLY AT_SYNCHRONIZED
%token OBJC_STRING
%type <code> unop
@@ -235,7 +234,7 @@ do { \
%type <location> save_location
-ifobjc
+@@ifobjc
/* the Objective-C nonterminals */
%type <ttype> ivar_decl_list ivar_decls ivar_decl ivars ivar_declarator
@@ -247,7 +246,10 @@ ifobjc
%type <ttype> non_empty_protocolrefs protocolrefs identifier_list objcprotocolexpr
%type <ttype> CLASSNAME OBJECTNAME OBJC_STRING
-end ifobjc
+
+%type <ttype> objc_try_stmt superclass
+%type <itype> objc_try_catch_stmt objc_finally_block
+@@end_ifobjc
%{
/* Number of statements (loosely speaking) and compound statements
@@ -308,7 +310,7 @@ static GTY(()) tree declspec_stack;
flag_iso = (val >> 3) & 1; \
} while (0)
-ifobjc
+@@ifobjc
/* Objective-C specific parser/lexer information */
static enum tree_code objc_inherit_code;
@@ -320,11 +322,11 @@ static int objc_pq_context = 0, objc_public_flag = 0;
exists. */
static int objc_need_raw_identifier;
#define OBJC_NEED_RAW_IDENTIFIER(VAL) objc_need_raw_identifier = VAL
-end ifobjc
+@@end_ifobjc
-ifc
+@@ifc
#define OBJC_NEED_RAW_IDENTIFIER(VAL) /* nothing */
-end ifc
+@@end_ifc
static bool parsing_iso_function_signature;
@@ -352,20 +354,8 @@ c_parse_init (void)
program: /* empty */
{ if (pedantic)
pedwarn ("ISO C forbids an empty source file");
- finish_file ();
}
| extdefs
- {
- /* In case there were missing closebraces,
- get us back to the global binding level. */
- while (! global_bindings_p ())
- poplevel (0, 0, 0);
- /* __FUNCTION__ is defined at file scope (""). This
- call may not be necessary as my tests indicate it
- still works without it. */
- finish_fname_decls ();
- finish_file ();
- }
;
/* the reason for the strange actions in this rule
@@ -385,9 +375,9 @@ extdef:
extdef_1:
fndef
| datadef
-ifobjc
+@@ifobjc
| objcdef
-end ifobjc
+@@end_ifobjc
| ASM_KEYWORD '(' expr ')' ';'
{ STRIP_NOPS ($3);
if ((TREE_CODE ($3) == ADDR_EXPR
@@ -431,7 +421,7 @@ fndef:
{ DECL_SOURCE_LOCATION (current_function_decl) = $6;
store_parm_decls (); }
compstmt_or_error
- { finish_function (0, 1);
+ { finish_function ();
POP_DECLSPEC_STACK; }
| declspecs_ts setspecs declarator error
{ POP_DECLSPEC_STACK; }
@@ -444,7 +434,7 @@ fndef:
{ DECL_SOURCE_LOCATION (current_function_decl) = $6;
store_parm_decls (); }
compstmt_or_error
- { finish_function (0, 1);
+ { finish_function ();
POP_DECLSPEC_STACK; }
| declspecs_nots setspecs notype_declarator error
{ POP_DECLSPEC_STACK; }
@@ -457,7 +447,7 @@ fndef:
{ DECL_SOURCE_LOCATION (current_function_decl) = $5;
store_parm_decls (); }
compstmt_or_error
- { finish_function (0, 1);
+ { finish_function ();
POP_DECLSPEC_STACK; }
| setspecs notype_declarator error
{ POP_DECLSPEC_STACK; }
@@ -466,10 +456,10 @@ fndef:
identifier:
IDENTIFIER
| TYPENAME
-ifobjc
+@@ifobjc
| OBJECTNAME
| CLASSNAME
-end ifobjc
+@@end_ifobjc
;
unop: '&'
@@ -478,10 +468,10 @@ unop: '&'
{ $$ = NEGATE_EXPR; }
| '+'
{ $$ = CONVERT_EXPR;
-ifc
+@@ifc
if (warn_traditional && !in_system_header)
warning ("traditional C rejects the unary plus operator");
-end ifc
+@@end_ifc
}
| PLUSPLUS
{ $$ = PREINCREMENT_EXPR; }
@@ -592,26 +582,26 @@ expr_no_commas:
| expr_no_commas ANDAND
{ $1 = c_common_truthvalue_conversion
(default_conversion ($1));
- skip_evaluation += $1 == boolean_false_node; }
+ skip_evaluation += $1 == truthvalue_false_node; }
expr_no_commas
- { skip_evaluation -= $1 == boolean_false_node;
+ { skip_evaluation -= $1 == truthvalue_false_node;
$$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $4); }
| expr_no_commas OROR
{ $1 = c_common_truthvalue_conversion
(default_conversion ($1));
- skip_evaluation += $1 == boolean_true_node; }
+ skip_evaluation += $1 == truthvalue_true_node; }
expr_no_commas
- { skip_evaluation -= $1 == boolean_true_node;
+ { skip_evaluation -= $1 == truthvalue_true_node;
$$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $4); }
| expr_no_commas '?'
{ $1 = c_common_truthvalue_conversion
(default_conversion ($1));
- skip_evaluation += $1 == boolean_false_node; }
+ skip_evaluation += $1 == truthvalue_false_node; }
expr ':'
- { skip_evaluation += (($1 == boolean_true_node)
- - ($1 == boolean_false_node)); }
+ { skip_evaluation += (($1 == truthvalue_true_node)
+ - ($1 == truthvalue_false_node)); }
expr_no_commas
- { skip_evaluation -= $1 == boolean_true_node;
+ { skip_evaluation -= $1 == truthvalue_true_node;
$$ = build_conditional_expr ($1, $4, $7); }
| expr_no_commas '?'
{ if (pedantic)
@@ -620,9 +610,9 @@ expr_no_commas:
$<ttype>2 = save_expr ($1);
$1 = c_common_truthvalue_conversion
(default_conversion ($<ttype>2));
- skip_evaluation += $1 == boolean_true_node; }
+ skip_evaluation += $1 == truthvalue_true_node; }
':' expr_no_commas
- { skip_evaluation -= $1 == boolean_true_node;
+ { skip_evaluation -= $1 == truthvalue_true_node;
$$ = build_conditional_expr ($1, $<ttype>2, $5); }
| expr_no_commas '=' expr_no_commas
{ char class;
@@ -678,8 +668,6 @@ primary:
if (pedantic)
pedwarn ("ISO C forbids braced-groups within expressions");
- pop_label_level ();
-
saved_last_tree = COMPOUND_BODY ($1);
RECHAIN_STMTS ($1, COMPOUND_BODY ($1));
last_tree = saved_last_tree;
@@ -691,7 +679,6 @@ primary:
}
| compstmt_primary_start error ')'
{
- pop_label_level ();
last_tree = COMPOUND_BODY ($1);
TREE_CHAIN (last_tree) = NULL_TREE;
$$ = error_mark_node;
@@ -718,36 +705,36 @@ primary:
e1 = TYPE_MAIN_VARIANT (groktypename ($3));
e2 = TYPE_MAIN_VARIANT (groktypename ($5));
- $$ = comptypes (e1, e2)
+ $$ = comptypes (e1, e2, COMPARE_STRICT)
? build_int_2 (1, 0) : build_int_2 (0, 0);
}
| primary '[' expr ']' %prec '.'
{ $$ = build_array_ref ($1, $3); }
| primary '.' identifier
{
-ifobjc
+@@ifobjc
if (!is_public ($1, $3))
$$ = error_mark_node;
else
-end ifobjc
+@@end_ifobjc
$$ = build_component_ref ($1, $3);
}
| primary POINTSAT identifier
{
tree expr = build_indirect_ref ($1, "->");
-ifobjc
+@@ifobjc
if (!is_public (expr, $3))
$$ = error_mark_node;
else
-end ifobjc
+@@end_ifobjc
$$ = build_component_ref (expr, $3);
}
| primary PLUSPLUS
{ $$ = build_unary_op (POSTINCREMENT_EXPR, $1, 0); }
| primary MINUSMINUS
{ $$ = build_unary_op (POSTDECREMENT_EXPR, $1, 0); }
-ifobjc
+@@ifobjc
| objcmessageexpr
{ $$ = build_message_expr ($1); }
| objcselectorexpr
@@ -758,7 +745,7 @@ ifobjc
{ $$ = build_encode_expr ($1); }
| OBJC_STRING
{ $$ = build_objc_string_object ($1); }
-end ifobjc
+@@end_ifobjc
;
old_style_parm_decls:
@@ -774,9 +761,16 @@ old_style_parm_decls_1:
if (warn_traditional && !in_system_header
&& parsing_iso_function_signature)
warning ("traditional C rejects ISO C style function definitions");
+ if (warn_old_style_definition && !in_system_header
+ && !parsing_iso_function_signature)
+ warning ("old-style parameter declaration");
parsing_iso_function_signature = false; /* Reset after warning. */
}
| datadecls
+ {
+ if (warn_old_style_definition && !in_system_header)
+ warning ("old-style parameter declaration");
+ }
;
/* The following are analogous to lineno_decl, decls and decl
@@ -1366,7 +1360,7 @@ typespec_nonreserved_nonattr:
{ /* For a typedef name, record the meaning, not the name.
In case of `foo foo, bar;'. */
$$ = lookup_name ($1); }
-ifobjc
+@@ifobjc
| CLASSNAME protocolrefs
{ $$ = get_static_reference ($1, $2); }
| OBJECTNAME protocolrefs
@@ -1376,7 +1370,7 @@ ifobjc
- nisse@lysator.liu.se */
| non_empty_protocolrefs
{ $$ = get_object_reference ($1); }
-end ifobjc
+@@end_ifobjc
| typeof '(' expr ')'
{ skip_evaluation--; $$ = TREE_TYPE ($3); }
| typeof '(' typename ')'
@@ -1583,7 +1577,7 @@ nested_function:
which called YYERROR1 again, and so on. */
compstmt
{ tree decl = current_function_decl;
- finish_function (1, 1);
+ finish_function ();
pop_function_context ();
add_decl_stmt (decl); }
;
@@ -1614,7 +1608,7 @@ notype_nested_function:
which called YYERROR1 again, and so on. */
compstmt
{ tree decl = current_function_decl;
- finish_function (1, 1);
+ finish_function ();
pop_function_context ();
add_decl_stmt (decl); }
;
@@ -1642,9 +1636,9 @@ after_type_declarator:
| '*' maybe_type_quals_attrs after_type_declarator %prec UNARY
{ $$ = make_pointer_declarator ($2, $3); }
| TYPENAME
-ifobjc
+@@ifobjc
| OBJECTNAME
-end ifobjc
+@@end_ifobjc
;
/* Kinds of declarator that can appear in a parameter list
@@ -1665,9 +1659,9 @@ parm_declarator_starttypename:
| parm_declarator_starttypename array_declarator %prec '.'
{ $$ = set_array_declarator_type ($2, $1, 0); }
| TYPENAME
-ifobjc
+@@ifobjc
| OBJECTNAME
-end ifobjc
+@@end_ifobjc
;
parm_declarator_nostarttypename:
@@ -1816,22 +1810,11 @@ component_decl_list2: /* empty */
| component_decl_list2 ';'
{ if (pedantic)
pedwarn ("extra semicolon in struct or union specified"); }
-ifobjc
+@@ifobjc
/* foo(sizeof(struct{ @defs(ClassName)})); */
| DEFS '(' CLASSNAME ')'
- {
- tree interface = lookup_interface ($3);
-
- if (interface)
- $$ = nreverse (get_class_ivars (interface));
- else
- {
- error ("cannot find interface declaration for `%s'",
- IDENTIFIER_POINTER ($3));
- $$ = NULL_TREE;
- }
- }
-end ifobjc
+ { $$ = nreverse (get_class_ivars_from_name ($3)); }
+@@end_ifobjc
;
component_decl:
@@ -1854,7 +1837,7 @@ component_decl:
| declspecs_nosc_nots
{ if (pedantic)
pedwarn ("ISO C forbids member declarations with no members");
- shadow_tag($1);
+ shadow_tag_warned ($1, pedantic);
$$ = NULL_TREE; }
| error
{ $$ = NULL_TREE; }
@@ -2030,8 +2013,11 @@ lineno_stmt_decl_or_labels_ending_stmt:
lineno_stmt_decl_or_labels_ending_decl:
lineno_decl
| lineno_stmt_decl_or_labels_ending_stmt lineno_decl
- { if (pedantic && !flag_isoc99)
- pedwarn ("ISO C89 forbids mixed declarations and code"); }
+ {
+ if ((pedantic && !flag_isoc99)
+ || warn_declaration_after_statement)
+ pedwarn_c90 ("ISO C90 forbids mixed declarations and code");
+ }
| lineno_stmt_decl_or_labels_ending_decl lineno_decl
| lineno_stmt_decl_or_labels_ending_error lineno_decl
;
@@ -2063,15 +2049,17 @@ pushlevel: /* empty */
{ pushlevel (0);
clear_last_expr ();
add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
-ifobjc
- if (objc_method_context)
- add_objc_decls ();
-end ifobjc
}
;
poplevel: /* empty */
- { $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0); }
+ {
+@@ifobjc
+ if (c_dialect_objc ())
+ objc_clear_super_receiver ();
+@@end_ifobjc
+ $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
+ }
;
/* Start and end blocks created for the new scopes of C99. */
@@ -2082,10 +2070,6 @@ c99_block_start: /* empty */
pushlevel (0);
clear_last_expr ();
add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
-ifobjc
- if (objc_method_context)
- add_objc_decls ();
-end ifobjc
}
else
$$ = NULL_TREE;
@@ -2099,7 +2083,7 @@ c99_block_end: /* empty */
{ if (flag_isoc99)
{
tree scope_stmt = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
- $$ = poplevel (kept_level_p (), 0, 0);
+ $$ = poplevel (KEEP_MAYBE, 0, 0);
SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmt))
= SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmt))
= $$;
@@ -2127,7 +2111,7 @@ label_decl:
{ tree link;
for (link = $2; link; link = TREE_CHAIN (link))
{
- tree label = shadow_label (TREE_VALUE (link));
+ tree label = declare_label (TREE_VALUE (link));
C_DECLARED_LABEL_FLAG (label) = 1;
add_decl_stmt (label);
}
@@ -2149,7 +2133,7 @@ compstmt_start: '{' { compstmt_count++;
compstmt_nostart: '}'
{ $$ = convert (void_type_node, integer_zero_node); }
| pushlevel maybe_label_decls compstmt_contents_nonempty '}' poplevel
- { $$ = poplevel (kept_level_p (), 1, 0);
+ { $$ = poplevel (KEEP_MAYBE, 0, 0);
SCOPE_STMT_BLOCK (TREE_PURPOSE ($5))
= SCOPE_STMT_BLOCK (TREE_VALUE ($5))
= $$; }
@@ -2172,7 +2156,6 @@ compstmt_primary_start:
there is a way to turn off the entire subtree of blocks
that are contained in it. */
keep_next_level ();
- push_label_level ();
compstmt_count++;
$$ = add_stmt (build_stmt (COMPOUND_STMT, last_tree));
}
@@ -2412,6 +2395,59 @@ stmt:
$$ = add_stmt (build_stmt (GOTO_STMT, $3)); }
| ';'
{ $$ = NULL_TREE; }
+@@ifobjc
+ | AT_THROW expr ';'
+ { stmt_count++;
+ $$ = objc_build_throw_stmt ($2);
+ }
+ | AT_THROW ';'
+ { stmt_count++;
+ $$ = objc_build_throw_stmt (NULL_TREE);
+ }
+ | objc_try_catch_stmt
+ { objc_build_finally_prologue (); }
+ objc_finally_block
+ { $$ = objc_build_try_catch_finally_stmt ($1, $3); }
+ | AT_SYNCHRONIZED '(' expr ')'
+ { objc_build_synchronized_prologue ($3); }
+ compstmt
+ { $$ = objc_build_synchronized_epilogue (); }
+ ;
+
+objc_try_catch_stmt:
+ objc_try_stmt
+ { objc_build_try_epilogue (1); }
+ objc_catch_list
+ { objc_build_catch_epilogue (); $$ = 1; }
+ | objc_try_stmt
+ { objc_build_try_epilogue (0); $$ = 0; }
+ ;
+
+
+objc_try_stmt:
+ AT_TRY
+ { objc_build_try_prologue (); }
+ compstmt
+ ;
+
+objc_catch_list:
+ objc_catch_list objc_catch_block
+ | objc_catch_block
+ ;
+
+objc_catch_block:
+ AT_CATCH '(' parm ')'
+ { objc_build_catch_stmt ($3); }
+ compstmt
+ { stmt_count++; }
+ ;
+
+objc_finally_block:
+ AT_FINALLY compstmt
+ { $$ = 1; }
+ | /* NULL */
+ { $$ = 0; }
+@@end_ifobjc
;
/* Any kind of label, including jump labels and case labels.
@@ -2493,24 +2529,16 @@ asm_clobbers:
parmlist:
maybe_attribute
{ pushlevel (0);
- clear_parm_order ();
- declare_parm_level (0); }
+ declare_parm_level (); }
parmlist_1
{ $$ = $3;
- parmlist_tags_warning ();
poplevel (0, 0, 0); }
;
parmlist_1:
parmlist_2 ')'
| parms ';'
- { tree parm;
- if (pedantic)
- pedwarn ("ISO C forbids forward parameter declarations");
- /* Mark the forward decls as such. */
- for (parm = getdecls (); parm; parm = TREE_CHAIN (parm))
- TREE_ASM_WRITTEN (parm) = 1;
- clear_parm_order (); }
+ { mark_forward_parm_decls (); }
maybe_attribute
{ /* Dummy action so attributes are in known place
on parser stack. */ }
@@ -2615,11 +2643,9 @@ setspecs_fp:
parmlist_or_identifiers:
maybe_attribute
{ pushlevel (0);
- clear_parm_order ();
- declare_parm_level (1); }
+ declare_parm_level (); }
parmlist_or_identifiers_1
{ $$ = $3;
- parmlist_tags_warning ();
poplevel (0, 0, 0); }
;
@@ -2666,7 +2692,7 @@ extension:
flag_iso = 0; }
;
-ifobjc
+@@ifobjc
/* Objective-C productions. */
objcdef:
@@ -2710,103 +2736,41 @@ aliasdecl:
}
;
-classdef:
- INTERFACE identifier protocolrefs '{'
- {
- objc_interface_context = objc_ivar_context
- = start_class (CLASS_INTERFACE_TYPE, $2, NULL_TREE, $3);
- objc_public_flag = 0;
- }
- ivar_decl_list '}'
- {
- continue_class (objc_interface_context);
- }
- methodprotolist
- END
- {
- finish_class (objc_interface_context);
- objc_interface_context = NULL_TREE;
- }
+superclass:
+ ':' identifier { $$ = $2; }
+ | /* NULL */ %prec HYPERUNARY { $$ = NULL_TREE; }
+ ;
- | INTERFACE identifier protocolrefs
- {
- objc_interface_context
- = start_class (CLASS_INTERFACE_TYPE, $2, NULL_TREE, $3);
- continue_class (objc_interface_context);
- }
- methodprotolist
- END
- {
- finish_class (objc_interface_context);
- objc_interface_context = NULL_TREE;
- }
+class_ivars:
+ '{' ivar_decl_list '}'
+ | /* NULL */
+ ;
- | INTERFACE identifier ':' identifier protocolrefs '{'
+classdef:
+ INTERFACE identifier superclass protocolrefs
{
objc_interface_context = objc_ivar_context
- = start_class (CLASS_INTERFACE_TYPE, $2, $4, $5);
+ = start_class (CLASS_INTERFACE_TYPE, $2, $3, $4);
objc_public_flag = 0;
}
- ivar_decl_list '}'
- {
- continue_class (objc_interface_context);
- }
- methodprotolist
- END
- {
- finish_class (objc_interface_context);
- objc_interface_context = NULL_TREE;
- }
-
- | INTERFACE identifier ':' identifier protocolrefs
+ class_ivars
{
- objc_interface_context
- = start_class (CLASS_INTERFACE_TYPE, $2, $4, $5);
continue_class (objc_interface_context);
}
- methodprotolist
- END
+ methodprotolist END
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
}
- | IMPLEMENTATION identifier '{'
- {
- objc_implementation_context = objc_ivar_context
- = start_class (CLASS_IMPLEMENTATION_TYPE, $2, NULL_TREE, NULL_TREE);
- objc_public_flag = 0;
- }
- ivar_decl_list '}'
- {
- objc_ivar_chain
- = continue_class (objc_implementation_context);
- }
-
- | IMPLEMENTATION identifier
- {
- objc_implementation_context
- = start_class (CLASS_IMPLEMENTATION_TYPE, $2, NULL_TREE, NULL_TREE);
- objc_ivar_chain
- = continue_class (objc_implementation_context);
- }
-
- | IMPLEMENTATION identifier ':' identifier '{'
+ | IMPLEMENTATION identifier superclass
{
objc_implementation_context = objc_ivar_context
- = start_class (CLASS_IMPLEMENTATION_TYPE, $2, $4, NULL_TREE);
+ = start_class (CLASS_IMPLEMENTATION_TYPE, $2, $3, NULL_TREE);
objc_public_flag = 0;
}
- ivar_decl_list '}'
- {
- objc_ivar_chain
- = continue_class (objc_implementation_context);
- }
-
- | IMPLEMENTATION identifier ':' identifier
+ class_ivars
{
- objc_implementation_context
- = start_class (CLASS_IMPLEMENTATION_TYPE, $2, $4, NULL_TREE);
objc_ivar_chain
= continue_class (objc_implementation_context);
}
@@ -2817,8 +2781,7 @@ classdef:
= start_class (CATEGORY_INTERFACE_TYPE, $2, $4, $6);
continue_class (objc_interface_context);
}
- methodprotolist
- END
+ methodprotolist END
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
@@ -2965,10 +2928,7 @@ methoddef:
methoddecl
{
objc_pq_context = 0;
- if (objc_inherit_code == CLASS_METHOD_DECL)
- add_class_method (objc_implementation_context, $3);
- else
- add_instance_method (objc_implementation_context, $3);
+ add_method (objc_implementation_context, $3, objc_inherit_code == CLASS_METHOD_DECL);
start_method_def ($3);
}
optarglist
@@ -2987,14 +2947,8 @@ methoddef:
methodprotolist:
/* empty */
- | {$<ttype>$ = NULL_TREE; } methodprotolist2
- ;
-
-methodprotolist2: /* eliminates a shift/reduce conflict */
- methodproto
- | datadef
- | methodprotolist2 methodproto
- | methodprotolist2 {$<ttype>$ = NULL_TREE; } datadef
+ | methodprotolist methodproto
+ | methodprotolist { $<ttype>$ = NULL_TREE; } datadef
;
semi_or_error:
@@ -3012,10 +2966,7 @@ methodproto:
{
/* Forget protocol qualifiers here. */
objc_pq_context = 0;
- if (objc_inherit_code == CLASS_METHOD_DECL)
- add_class_method (objc_interface_context, $3);
- else
- add_instance_method (objc_interface_context, $3);
+ add_method (objc_interface_context, $3, objc_inherit_code == CLASS_METHOD_DECL);
}
semi_or_error
;
@@ -3212,6 +3163,10 @@ receiver:
{
$$ = get_class_reference ($1);
}
+ | TYPENAME
+ {
+ $$ = get_class_reference ($1);
+ }
;
objcmessageexpr:
@@ -3266,7 +3221,7 @@ objcencodeexpr:
}
;
-end ifobjc
+@@end_ifobjc
%%
/* yylex() is a thin wrapper around c_lex(), all it does is translate
@@ -3368,7 +3323,7 @@ static const struct resword reswords[] =
{ "void", RID_VOID, 0 },
{ "volatile", RID_VOLATILE, 0 },
{ "while", RID_WHILE, 0 },
-ifobjc
+@@ifobjc
{ "id", RID_ID, D_OBJC },
/* These objc keywords are recognized only immediately after
@@ -3385,7 +3340,11 @@ ifobjc
{ "protocol", RID_AT_PROTOCOL, D_OBJC },
{ "public", RID_AT_PUBLIC, D_OBJC },
{ "selector", RID_AT_SELECTOR, D_OBJC },
-
+ { "throw", RID_AT_THROW, D_OBJC },
+ { "try", RID_AT_TRY, D_OBJC },
+ { "catch", RID_AT_CATCH, D_OBJC },
+ { "finally", RID_AT_FINALLY, D_OBJC },
+ { "synchronized", RID_AT_SYNCHRONIZED, D_OBJC },
/* These are recognized only in protocol-qualifier context
(see above) */
{ "bycopy", RID_BYCOPY, D_OBJC },
@@ -3394,7 +3353,7 @@ ifobjc
{ "inout", RID_INOUT, D_OBJC },
{ "oneway", RID_ONEWAY, D_OBJC },
{ "out", RID_OUT, D_OBJC },
-end ifobjc
+@@end_ifobjc
};
#define N_reswords (sizeof reswords / sizeof (struct resword))
@@ -3521,6 +3480,11 @@ static const short rid_to_yy[RID_MAX] =
/* RID_AT_PUBLIC */ PUBLIC,
/* RID_AT_PROTOCOL */ PROTOCOL,
/* RID_AT_SELECTOR */ SELECTOR,
+ /* RID_AT_THROW */ AT_THROW,
+ /* RID_AT_TRY */ AT_TRY,
+ /* RID_AT_CATCH */ AT_CATCH,
+ /* RID_AT_FINALLY */ AT_FINALLY,
+ /* RID_AT_SYNCHRONIZED */ AT_SYNCHRONIZED,
/* RID_AT_INTERFACE */ INTERFACE,
/* RID_AT_IMPLEMENTATION */ IMPLEMENTATION
};
@@ -3536,7 +3500,7 @@ init_reswords (void)
if (!c_dialect_objc ())
mask |= D_OBJC;
- ridpointers = (tree *) ggc_calloc ((int) RID_MAX, sizeof (tree));
+ ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree));
for (i = 0; i < N_reswords; i++)
{
/* If a keyword is disabled, do not enter it into the table
@@ -3585,16 +3549,16 @@ yylexname (void)
{
tree decl;
-ifobjc
+@@ifobjc
int objc_force_identifier = objc_need_raw_identifier;
OBJC_NEED_RAW_IDENTIFIER (0);
-end ifobjc
+@@end_ifobjc
if (C_IS_RESERVED_WORD (yylval.ttype))
{
enum rid rid_code = C_RID_CODE (yylval.ttype);
-ifobjc
+@@ifobjc
/* Turn non-typedefed refs to "id" into plain identifiers; this
allows constructs like "void foo(id id);" to work. */
if (rid_code == RID_ID)
@@ -3606,7 +3570,7 @@ ifobjc
if (!OBJC_IS_AT_KEYWORD (rid_code)
&& (!OBJC_IS_PQ_KEYWORD (rid_code) || objc_pq_context))
-end ifobjc
+@@end_ifobjc
{
/* Return the canonical spelling for this keyword. */
yylval.ttype = ridpointers[(int) rid_code];
@@ -3620,7 +3584,7 @@ end ifobjc
if (TREE_CODE (decl) == TYPE_DECL)
return TYPENAME;
}
-ifobjc
+@@ifobjc
else
{
tree objc_interface_decl = is_class_name (yylval.ttype);
@@ -3634,7 +3598,7 @@ ifobjc
return CLASSNAME;
}
}
-end ifobjc
+@@end_ifobjc
return IDENTIFIER;
}
@@ -3795,10 +3759,27 @@ yyprint (FILE *file, int yychar, YYSTYPE yyl)
void
free_parser_stacks (void)
{
+}
+
+/* Parse the file. */
+void
+c_parse_file (void)
+{
+ yyparse ();
+ /* In case there were missing closebraces, get us back to the global
+ binding level. */
+ while (! global_bindings_p ())
+ poplevel (0, 0, 0);
+ /* __FUNCTION__ is defined at file scope (""). This
+ call may not be necessary as my tests indicate it
+ still works without it. */
+ finish_fname_decls ();
+
if (malloced_yyss)
{
free (malloced_yyss);
free (malloced_yyvs);
+ malloced_yyss = 0;
}
}
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index 2cd9b9d1a2d..23ab0f8454a 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "c-pragma.h"
#include "ggc.h"
#include "langhooks.h"
+#include "hosthooks.h"
struct c_pch_validity
{
@@ -164,9 +165,6 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
const char *pch_ident;
struct c_pch_validity v;
- if (! allow_pch)
- return 2;
-
/* Perform a quick test of whether this is a valid
precompiled header for the current language. */
@@ -244,7 +242,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
return;
}
- allow_pch = 0;
+ cpp_get_callbacks (parse_in)->valid_pch = NULL;
if (fread (&h, sizeof (h), 1, f) != 1)
{
@@ -274,3 +272,15 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
fclose (f);
}
+
+/* Indicate that no more PCH files should be read. */
+
+void
+c_common_no_more_pch (void)
+{
+ if (cpp_get_callbacks (parse_in)->valid_pch)
+ {
+ cpp_get_callbacks (parse_in)->valid_pch = NULL;
+ host_hooks.gt_pch_use_address (NULL, 0);
+ }
+}
diff --git a/gcc/c-ppoutput.c b/gcc/c-ppoutput.c
index 333da30b2e9..669d11ea494 100644
--- a/gcc/c-ppoutput.c
+++ b/gcc/c-ppoutput.c
@@ -35,29 +35,28 @@ static struct
const struct line_map *map; /* Logical to physical line mappings. */
const cpp_token *prev; /* Previous token. */
const cpp_token *source; /* Source token for spacing. */
- unsigned int line; /* Line currently being written. */
+ fileline line; /* Line currently being written. */
unsigned char printed; /* Nonzero if something output at line. */
} print;
/* General output routines. */
static void scan_translation_unit (cpp_reader *);
static void scan_translation_unit_trad (cpp_reader *);
-static void account_for_newlines (const uchar *, size_t);
+static void account_for_newlines (const unsigned char *, size_t);
static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
-static void print_line (const struct line_map *, unsigned int,
- const char *);
-static void maybe_print_line (const struct line_map *, unsigned int);
+static void print_line (const struct line_map *, fileline, const char *);
+static void maybe_print_line (const struct line_map *, fileline);
/* Callback routines for the parser. Most of these are active only
in specific modes. */
static void cb_line_change (cpp_reader *, const cpp_token *, int);
-static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
-static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
-static void cb_include (cpp_reader *, unsigned int, const unsigned char *,
+static void cb_define (cpp_reader *, fileline, cpp_hashnode *);
+static void cb_undef (cpp_reader *, fileline, cpp_hashnode *);
+static void cb_include (cpp_reader *, fileline, const unsigned char *,
const char *, int);
-static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
-static void cb_def_pragma (cpp_reader *, unsigned int);
+static void cb_ident (cpp_reader *, fileline, const cpp_string *);
+static void cb_def_pragma (cpp_reader *, fileline);
/* Preprocess and output. */
void
@@ -116,7 +115,7 @@ init_pp_output (FILE *out_stream)
/* Initialize the print structure. Setting print.line to -1 here is
a trick to guarantee that the first token of the file will cause
a linemarker to be output by maybe_print_line. */
- print.line = (unsigned int) -1;
+ print.line = (fileline) -1;
print.printed = 0;
print.prev = 0;
print.map = 0;
@@ -174,7 +173,7 @@ scan_translation_unit (cpp_reader *pfile)
/* Adjust print.line for newlines embedded in output. */
static void
-account_for_newlines (const uchar *str, size_t len)
+account_for_newlines (const unsigned char *str, size_t len)
{
while (len--)
if (*str++ == '\n')
@@ -200,7 +199,7 @@ scan_translation_unit_trad (cpp_reader *pfile)
different line to the current one, output the required newlines or
a line marker, and return 1. Otherwise return 0. */
static void
-maybe_print_line (const struct line_map *map, unsigned int line)
+maybe_print_line (const struct line_map *map, fileline line)
{
/* End the previous line of text. */
if (print.printed)
@@ -225,7 +224,7 @@ maybe_print_line (const struct line_map *map, unsigned int line)
/* Output a line marker for logical line LINE. Special flags are "1"
or "2" indicating entering or leaving a file. */
static void
-print_line (const struct line_map *map, unsigned int line, const char *special_flags)
+print_line (const struct line_map *map, fileline line, const char *special_flags)
{
/* End any previous line of text. */
if (print.printed)
@@ -260,7 +259,8 @@ print_line (const struct line_map *map, unsigned int line, const char *special_f
/* Called when a line of output is started. TOKEN is the first token
of the line, and at end of file will be CPP_EOF. */
static void
-cb_line_change (cpp_reader *pfile, const cpp_token *token, int parsing_args)
+cb_line_change (cpp_reader *pfile, const cpp_token *token,
+ int parsing_args)
{
if (token->type == CPP_EOF || parsing_args)
return;
@@ -288,7 +288,7 @@ cb_line_change (cpp_reader *pfile, const cpp_token *token, int parsing_args)
}
static void
-cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
+cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, fileline line,
const cpp_string *str)
{
maybe_print_line (print.map, line);
@@ -297,7 +297,7 @@ cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
}
static void
-cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
+cb_define (cpp_reader *pfile, fileline line, cpp_hashnode *node)
{
maybe_print_line (print.map, line);
fputs ("#define ", print.outf);
@@ -314,7 +314,7 @@ cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
}
static void
-cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
+cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, fileline line,
cpp_hashnode *node)
{
maybe_print_line (print.map, line);
@@ -323,7 +323,7 @@ cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
}
static void
-cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
+cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, fileline line,
const unsigned char *dir, const char *header, int angle_brackets)
{
maybe_print_line (print.map, line);
@@ -371,7 +371,7 @@ pp_file_change (const struct line_map *map)
/* Copy a #pragma directive to the preprocessed output. */
static void
-cb_def_pragma (cpp_reader *pfile, unsigned int line)
+cb_def_pragma (cpp_reader *pfile, fileline line)
{
maybe_print_line (print.map, line);
fputs ("#pragma ", print.outf);
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 71b34096b77..141b9061cef 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -74,7 +74,7 @@ push_alignment (int alignment, tree id)
{
align_stack * entry;
- entry = (align_stack *) ggc_alloc (sizeof (* entry));
+ entry = ggc_alloc (sizeof (* entry));
entry->alignment = alignment;
entry->num_pushes = 1;
@@ -273,8 +273,10 @@ apply_pragma_weak (tree decl, tree value)
}
if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
+ && !DECL_WEAK (decl) /* don't complain about a redundant #pragma */
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
- warning_with_decl (decl, "applying #pragma weak `%s' after first use results in unspecified behavior");
+ warning ("%Japplying #pragma weak '%D' after first use results "
+ "in unspecified behavior", decl, decl);
declare_weak (decl);
}
@@ -284,15 +286,22 @@ maybe_apply_pragma_weak (tree decl)
{
tree *p, t, id;
- /* Copied from the check in set_decl_assembler_name. */
- if (TREE_CODE (decl) == FUNCTION_DECL
- || (TREE_CODE (decl) == VAR_DECL
- && (TREE_STATIC (decl)
- || DECL_EXTERNAL (decl)
- || TREE_PUBLIC (decl))))
- id = DECL_ASSEMBLER_NAME (decl);
- else
+ /* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
+
+ /* No weak symbols pending, take the short-cut. */
+ if (!pending_weaks)
+ return;
+ /* If it's not visible outside this file, it doesn't matter whether
+ it's weak. */
+ if (!DECL_EXTERNAL (decl) && !TREE_PUBLIC (decl))
return;
+ /* If it's not a function or a variable, it can't be weak.
+ FIXME: what kinds of things are visible outside this file but
+ aren't functions or variables? Should this be an abort() instead? */
+ if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
+ return;
+
+ id = DECL_ASSEMBLER_NAME (decl);
for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
if (id == TREE_PURPOSE (t))
diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h
index b14a0c4738c..cea410b1580 100644
--- a/gcc/c-pragma.h
+++ b/gcc/c-pragma.h
@@ -28,12 +28,9 @@ extern int yydebug;
extern struct cpp_reader* parse_in;
-#ifdef HANDLE_SYSV_PRAGMA
-#if ((defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_WEAK_ALIAS)) \
- || defined (ASM_WEAKEN_DECL))
#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
-#endif
+#ifdef HANDLE_SYSV_PRAGMA
/* We always support #pragma pack for SYSV pragmas. */
#ifndef HANDLE_PRAGMA_PACK
#define HANDLE_PRAGMA_PACK 1
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 3fd9f55083c..1ddc1d036c7 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -27,79 +27,252 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "c-pretty-print.h"
#include "c-tree.h"
-/* literal */
-static void pp_c_char (c_pretty_printer, int);
-static void pp_c_character_literal (c_pretty_printer, tree);
-static void pp_c_bool_literal (c_pretty_printer, tree);
-static bool pp_c_enumerator (c_pretty_printer, tree);
-static void pp_c_integer_literal (c_pretty_printer, tree);
-static void pp_c_real_literal (c_pretty_printer, tree);
-static void pp_c_string_literal (c_pretty_printer, tree);
+/* The pretty-printer code is primarily designed to closely follow
+ (GNU) C and C++ grammars. That is to be contrasted with spaghetti
+ codes we used to have in the past. Following a structured
+ approach (preferably the official grammars) is believed to make it
+ much easier to add extensions and nifty pretty-printing effects that
+ takes expression or declaration contexts into account. */
+
+
+#define pp_c_maybe_whitespace(PP) \
+ do { \
+ if (pp_base (PP)->padding == pp_before) \
+ pp_c_whitespace (PP); \
+ } while (0)
+
+#define pp_c_left_bracket(PP) \
+ do { \
+ pp_left_bracket (PP); \
+ pp_base (PP)->padding = pp_none; \
+ } while (0)
+
+#define pp_c_right_bracket(PP) \
+ do { \
+ pp_right_bracket (PP); \
+ pp_base (PP)->padding = pp_none; \
+ } while (0)
+
+#define pp_c_star(PP) \
+ do { \
+ pp_star (PP); \
+ pp_base (PP)->padding = pp_none; \
+ } while (0)
-static void pp_c_primary_expression (c_pretty_printer, tree);
+/* literal */
+static void pp_c_char (c_pretty_printer *, int);
/* postfix-expression */
-static void pp_c_initializer_list (c_pretty_printer, tree);
-
-static void pp_c_unary_expression (c_pretty_printer, tree);
-static void pp_c_multiplicative_expression (c_pretty_printer, tree);
-static void pp_c_additive_expression (c_pretty_printer, tree);
-static void pp_c_shift_expression (c_pretty_printer, tree);
-static void pp_c_relational_expression (c_pretty_printer, tree);
-static void pp_c_equality_expression (c_pretty_printer, tree);
-static void pp_c_and_expression (c_pretty_printer, tree);
-static void pp_c_exclusive_or_expression (c_pretty_printer, tree);
-static void pp_c_inclusive_or_expression (c_pretty_printer, tree);
-static void pp_c_logical_and_expression (c_pretty_printer, tree);
-static void pp_c_conditional_expression (c_pretty_printer, tree);
-static void pp_c_assignment_expression (c_pretty_printer, tree);
+static void pp_c_initializer_list (c_pretty_printer *, tree);
+static void pp_c_brace_enclosed_initializer_list (c_pretty_printer *, tree);
+
+static void pp_c_multiplicative_expression (c_pretty_printer *, tree);
+static void pp_c_additive_expression (c_pretty_printer *, tree);
+static void pp_c_shift_expression (c_pretty_printer *, tree);
+static void pp_c_relational_expression (c_pretty_printer *, tree);
+static void pp_c_equality_expression (c_pretty_printer *, tree);
+static void pp_c_and_expression (c_pretty_printer *, tree);
+static void pp_c_exclusive_or_expression (c_pretty_printer *, tree);
+static void pp_c_inclusive_or_expression (c_pretty_printer *, tree);
+static void pp_c_logical_and_expression (c_pretty_printer *, tree);
+static void pp_c_conditional_expression (c_pretty_printer *, tree);
+static void pp_c_assignment_expression (c_pretty_printer *, tree);
/* declarations. */
-static void pp_c_declaration_specifiers (c_pretty_printer, tree);
-static void pp_c_init_declarator (c_pretty_printer, tree);
-static void pp_c_declarator (c_pretty_printer, tree);
-static void pp_c_direct_declarator (c_pretty_printer, tree);
-static void pp_c_abstract_declarator (c_pretty_printer, tree);
-static void pp_c_specifier_qualifier_list (c_pretty_printer, tree);
-static void pp_c_simple_type_specifier (c_pretty_printer, tree);
-static void pp_c_parameter_declaration (c_pretty_printer, tree);
-static void pp_c_type_id (c_pretty_printer, tree);
-static void pp_c_storage_class_specifier (c_pretty_printer, tree);
-static void pp_c_function_specifier (c_pretty_printer, tree);
+
+
+/* Helper functions. */
+
+void
+pp_c_whitespace (c_pretty_printer *pp)
+{
+ pp_space (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_left_paren (c_pretty_printer *pp)
+{
+ pp_left_paren (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_right_paren (c_pretty_printer *pp)
+{
+ pp_right_paren (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_left_brace (c_pretty_printer *pp)
+{
+ pp_left_brace (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_right_brace (c_pretty_printer *pp)
+{
+ pp_right_brace (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_dot (c_pretty_printer *pp)
+{
+ pp_dot (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_ampersand (c_pretty_printer *pp)
+{
+ pp_ampersand (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_arrow (c_pretty_printer *pp)
+{
+ pp_arrow (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+void
+pp_c_semicolon(c_pretty_printer *pp)
+{
+ pp_semicolon (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+static void
+pp_c_cv_qualifier (c_pretty_printer *pp, const char *cv)
+{
+ const char *p = pp_last_position_in_text (pp);
+ if (p != NULL && *p == '*')
+ pp_c_whitespace (pp);
+ pp_c_identifier (pp, cv);
+}
+
+/* Pretty-print T using the type-cast notation '( type-name )'. */
+
+static inline void
+pp_c_type_cast (c_pretty_printer *pp, tree t)
+{
+ pp_c_left_paren (pp);
+ pp_type_id (pp, t);
+ pp_c_right_paren (pp);
+}
+
+void
+pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t)
+{
+ if (POINTER_TYPE_P (t))
+ {
+ tree pointee = strip_pointer_operator (TREE_TYPE (t));
+ if (TREE_CODE (pointee) != ARRAY_TYPE
+ && TREE_CODE (pointee) != FUNCTION_TYPE)
+ pp_c_whitespace (pp);
+ }
+}
/* Declarations. */
-/* Print out CV-qualifiers. Take care of possible extensions. */
+/* C++ cv-qualifiers are called type-qualifiers in C. Print out the
+ cv-qualifiers of T. If T is a declaration then it is the cv-qualifier
+ of its type. Take care of possible extensions.
+
+ type-qualifier-list:
+ type-qualifier
+ type-qualifier-list type-qualifier
+
+ type-qualifier:
+ const
+ restrict -- C99
+ __restrict__ -- GNU C
+ volatile */
+
void
-pp_c_cv_qualifier (c_pretty_printer ppi, int cv)
+pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
{
- if (cv & TYPE_QUAL_CONST)
- pp_c_identifier (ppi, "const");
- if (cv & TYPE_QUAL_VOLATILE)
- pp_c_identifier (ppi, "volatile");
- if (cv & TYPE_QUAL_RESTRICT)
- pp_c_identifier (ppi, flag_isoc99 ? "restrict" : "__restrict__");
+ int qualifiers;
+
+ if (!TYPE_P (t))
+ t = TREE_TYPE (t);
+
+ qualifiers = TYPE_QUALS (t);
+ if (qualifiers & TYPE_QUAL_CONST)
+ pp_c_cv_qualifier (pp, "const");
+ if (qualifiers & TYPE_QUAL_VOLATILE)
+ pp_c_cv_qualifier (pp, "volatile");
+ if (qualifiers & TYPE_QUAL_RESTRICT)
+ pp_c_cv_qualifier (pp, flag_isoc99 ? "restrict" : "__restrict__");
}
+/* pointer:
+ * type-qualifier-list(opt)
+ * type-qualifier-list(opt) pointer */
+
static void
-pp_c_simple_type_specifier (c_pretty_printer ppi, tree t)
+pp_c_pointer (c_pretty_printer *pp, tree t)
+{
+ if (!TYPE_P (t) && TREE_CODE (t) != TYPE_DECL)
+ t = TREE_TYPE (t);
+ switch (TREE_CODE (t))
+ {
+ case POINTER_TYPE:
+ /* It is easier to handle C++ reference types here. */
+ case REFERENCE_TYPE:
+ if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE)
+ pp_c_pointer (pp, TREE_TYPE (t));
+ if (TREE_CODE (t) == POINTER_TYPE)
+ pp_c_star (pp);
+ else
+ pp_c_ampersand (pp);
+ pp_c_type_qualifier_list (pp, t);
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ }
+}
+
+/* type-specifier:
+ void
+ char
+ short
+ int
+ long
+ float
+ double
+ signed
+ unsigned
+ _Bool -- C99
+ _Complex -- C99
+ _Imaginary -- C99
+ struct-or-union-specifier
+ enum-specifier
+ typedef-name.
+
+ GNU extensions.
+ simple-type-specifier:
+ __complex__
+ __vector__ */
+
+void
+pp_c_type_specifier (c_pretty_printer *pp, tree t)
{
const enum tree_code code = TREE_CODE (t);
switch (code)
{
case ERROR_MARK:
- pp_c_identifier (ppi, "<type-error>");
- break;
-
-#if 0
- case UNKNOWN_TYPE:
- pp_c_identifier (ppi, "<unkown-type>");
+ pp_c_identifier (pp, "<type-error>");
break;
-#endif
case IDENTIFIER_NODE:
- pp_c_tree_identifier (ppi, t);
+ pp_c_tree_identifier (pp, t);
break;
case VOID_TYPE:
@@ -107,135 +280,366 @@ pp_c_simple_type_specifier (c_pretty_printer ppi, tree t)
case CHAR_TYPE:
case INTEGER_TYPE:
case REAL_TYPE:
- pp_c_tree_identifier (ppi, DECL_NAME (t));
- break;
-
- case COMPLEX_TYPE:
- case VECTOR_TYPE:
- pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t)));
- if (code == COMPLEX_TYPE)
- pp_c_identifier (ppi, flag_isoc99 ? "_Complex" : "__complex__");
- else if (code == VECTOR_TYPE)
- pp_c_identifier (ppi, "__vector__");
+ if (TYPE_NAME (t))
+ t = TYPE_NAME (t);
+ else
+ t = c_common_type_for_mode (TYPE_MODE (t), TREE_UNSIGNED (t));
+ pp_c_type_specifier (pp, t);
break;
case TYPE_DECL:
if (DECL_NAME (t))
- pp_c_tree_identifier (ppi, DECL_NAME (t));
+ pp_id_expression (pp, t);
else
- pp_c_identifier (ppi, "<typedef-error>");
+ pp_c_identifier (pp, "<typedef-error>");
break;
case UNION_TYPE:
case RECORD_TYPE:
case ENUMERAL_TYPE:
if (code == UNION_TYPE)
- pp_c_identifier (ppi, "union");
+ pp_c_identifier (pp, "union");
else if (code == RECORD_TYPE)
- pp_c_identifier (ppi, "struct");
+ pp_c_identifier (pp, "struct");
else if (code == ENUMERAL_TYPE)
- pp_c_identifier (ppi, "enum");
+ pp_c_identifier (pp, "enum");
else
- pp_c_identifier (ppi, "<tag-error>");
+ pp_c_identifier (pp, "<tag-error>");
if (TYPE_NAME (t))
- pp_c_tree_identifier (ppi, TYPE_NAME (t));
+ pp_id_expression (pp, TYPE_NAME (t));
else
- pp_c_identifier (ppi, "<anonymous>");
+ pp_c_identifier (pp, "<anonymous>");
break;
default:
- pp_unsupported_tree (ppi, t);
+ pp_unsupported_tree (pp, t);
+ break;
}
}
-static inline void
-pp_c_specifier_qualifier_list (c_pretty_printer ppi, tree t)
+/* specifier-qualifier-list:
+ type-specifier specifier-qualifier-list-opt
+ type-qualifier specifier-qualifier-list-opt
+
+
+ Implementation note: Because of the non-linearities in array or
+ function declarations, this routine prints not just the
+ specifier-qualifier-list of such entities or types of such entities,
+ but also the 'pointer' production part of their declarators. The
+ remaining part is done by pp_declarator or pp_c_abstract_declarator. */
+
+void
+pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t)
{
- pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t)));
- pp_c_cv_qualifier (ppi, TYPE_QUALS (t));
+ const enum tree_code code = TREE_CODE (t);
+
+ if (TREE_CODE (t) != POINTER_TYPE)
+ pp_c_type_qualifier_list (pp, t);
+ switch (code)
+ {
+ case REFERENCE_TYPE:
+ case POINTER_TYPE:
+ {
+ /* Get the types-specifier of this type. */
+ tree pointee = strip_pointer_operator (TREE_TYPE (t));
+ pp_c_specifier_qualifier_list (pp, pointee);
+ if (TREE_CODE (pointee) == ARRAY_TYPE
+ || TREE_CODE (pointee) == FUNCTION_TYPE)
+ {
+ pp_c_whitespace (pp);
+ pp_c_left_paren (pp);
+ }
+ pp_ptr_operator (pp, t);
+ }
+ break;
+
+ case FUNCTION_TYPE:
+ case ARRAY_TYPE:
+ pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
+ break;
+
+ case VECTOR_TYPE:
+ case COMPLEX_TYPE:
+ pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
+ if (code == COMPLEX_TYPE)
+ pp_c_identifier (pp, flag_isoc99 ? "_Complex" : "__complex__");
+ else if (code == VECTOR_TYPE)
+ pp_c_identifier (pp, "__vector__");
+ break;
+
+ default:
+ pp_simple_type_specifier (pp, t);
+ break;
+ }
}
-static void
-pp_c_abstract_declarator (c_pretty_printer ppi, tree t)
+/* parameter-type-list:
+ parameter-list
+ parameter-list , ...
+
+ parameter-list:
+ parameter-declaration
+ parameter-list , parameter-declaration
+
+ parameter-declaration:
+ declaration-specifiers declarator
+ declaration-specifiers abstract-declarator(opt) */
+
+void
+pp_c_parameter_type_list (c_pretty_printer *pp, tree t)
{
- pp_unsupported_tree (ppi, t);
+ bool want_parm_decl = DECL_P (t) && !(pp->flags & pp_c_flag_abstract);
+ tree parms = want_parm_decl ? DECL_ARGUMENTS (t) : TYPE_ARG_TYPES (t);
+ pp_c_left_paren (pp);
+ if (parms == void_list_node)
+ pp_c_identifier (pp, "void");
+ else
+ {
+ bool first = true;
+ for ( ; parms && parms != void_list_node; parms = TREE_CHAIN (parms))
+ {
+ if (!first)
+ pp_separate_with (pp, ',');
+ first = false;
+ pp_declaration_specifiers
+ (pp, want_parm_decl ? parms : TREE_VALUE (parms));
+ if (want_parm_decl)
+ pp_declarator (pp, parms);
+ else
+ pp_abstract_declarator (pp, TREE_VALUE (parms));
+ }
+ }
+ pp_c_right_paren (pp);
}
+/* abstract-declarator:
+ pointer
+ pointer(opt) direct-abstract-declarator */
static inline void
-pp_c_type_id (c_pretty_printer ppi, tree t)
+pp_c_abstract_declarator (c_pretty_printer *pp, tree t)
{
- pp_c_specifier_qualifier_list (ppi, t);
- pp_c_abstract_declarator (ppi, t);
+ if (TREE_CODE (t) == POINTER_TYPE)
+ {
+ if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE
+ || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
+ pp_c_right_paren (pp);
+ t = TREE_TYPE (t);
+ }
+
+ pp_direct_abstract_declarator (pp, t);
}
-static inline void
-pp_c_storage_class_specifier (c_pretty_printer pp, tree t)
+/* direct-abstract-declarator:
+ ( abstract-declarator )
+ direct-abstract-declarator(opt) [ assignment-expression(opt) ]
+ direct-abstract-declarator(opt) [ * ]
+ direct-abstract-declarator(opt) ( parameter-type-list(opt) ) */
+
+void
+pp_c_direct_abstract_declarator (c_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case POINTER_TYPE:
+ pp_abstract_declarator (pp, t);
+ break;
+
+ case FUNCTION_TYPE:
+ pp_c_parameter_type_list (pp, t);
+ pp_direct_abstract_declarator (pp, TREE_TYPE (t));
+ break;
+
+ case ARRAY_TYPE:
+ pp_c_left_bracket (pp);
+ if (TYPE_DOMAIN (t))
+ pp_expression (pp, TYPE_MAX_VALUE (TYPE_DOMAIN (t)));
+ pp_c_right_bracket (pp);
+ pp_direct_abstract_declarator (pp, TREE_TYPE (t));
+ break;
+
+ case IDENTIFIER_NODE:
+ case VOID_TYPE:
+ case BOOLEAN_TYPE:
+ case INTEGER_TYPE:
+ case REAL_TYPE:
+ case ENUMERAL_TYPE:
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case VECTOR_TYPE:
+ case COMPLEX_TYPE:
+ case TYPE_DECL:
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
+ }
+}
+
+/* type-name:
+ specifier-qualifier-list abstract-declarator(opt) */
+
+void
+pp_c_type_id (c_pretty_printer *pp, tree t)
+{
+ pp_c_specifier_qualifier_list (pp, t);
+ pp_abstract_declarator (pp, t);
+}
+
+/* storage-class-specifier:
+ typedef
+ extern
+ static
+ auto
+ register */
+
+void
+pp_c_storage_class_specifier (c_pretty_printer *pp, tree t)
{
if (TREE_CODE (t) == TYPE_DECL)
pp_c_identifier (pp, "typedef");
- else if (DECL_REGISTER (t))
- pp_c_identifier (pp, "register");
+ else if (DECL_P (t))
+ {
+ if (DECL_REGISTER (t))
+ pp_c_identifier (pp, "register");
+ else if (TREE_STATIC (t) && TREE_CODE (t) == VAR_DECL)
+ pp_c_identifier (pp, "static");
+ }
}
-static inline void
-pp_c_function_specifier (c_pretty_printer pp, tree t)
+/* function-specifier:
+ inline */
+
+void
+pp_c_function_specifier (c_pretty_printer *pp, tree t)
{
if (TREE_CODE (t) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (t))
pp_c_identifier (pp, "inline");
}
-static inline void
-pp_c_declaration_specifiers (c_pretty_printer pp, tree t)
-{
- pp_c_storage_class_specifier (pp, t);
- pp_c_function_specifier (pp, t);
- pp_type_specifier (pp, TYPE_MAIN_VARIANT (TREE_TYPE (t)));
- pp_c_cv_qualifier (pp, TYPE_QUALS (TREE_TYPE (t)));
-}
+/* declaration-specifiers:
+ storage-class-specifier declaration-specifiers(opt)
+ type-specifier declaration-specifiers(opt)
+ type-qualifier declaration-specifiers(opt)
+ function-specifier declaration-specifiers(opt) */
-static inline void
-pp_c_direct_declarator (c_pretty_printer pp, tree t)
+void
+pp_c_declaration_specifiers (c_pretty_printer *pp, tree t)
{
- pp_unsupported_tree (pp, t);
+ pp_storage_class_specifier (pp, t);
+ pp_function_specifier (pp, t);
+ pp_c_specifier_qualifier_list (pp, DECL_P (t) ? TREE_TYPE (t) : t);
}
-static inline void
-pp_c_declarator (c_pretty_printer pp, tree t)
+/* direct-declarator
+ identifier
+ ( declarator )
+ direct-declarator [ type-qualifier-list(opt) assignment-expression(opt) ]
+ direct-declarator [ static type-qualifier-list(opt) assignment-expression(opt)]
+ direct-declarator [ type-qualifier-list static assignment-exression ]
+ direct-declarator [ type-qualifier-list * ]
+ direct-declaratpr ( parameter-type-list )
+ direct-declarator ( identifier-list(opt) ) */
+
+void
+pp_c_direct_declarator (c_pretty_printer *pp, tree t)
{
- pp_unsupported_tree (pp, t);
+ switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case TYPE_DECL:
+ case FIELD_DECL:
+ case LABEL_DECL:
+ if (DECL_NAME (t))
+ {
+ pp_c_space_for_pointer_operator (pp, TREE_TYPE (t));
+ pp_c_tree_identifier (pp, DECL_NAME (t));
+ }
+ case ARRAY_TYPE:
+ case POINTER_TYPE:
+ pp_abstract_declarator (pp, TREE_TYPE (t));
+ break;
+
+ case FUNCTION_TYPE:
+ pp_parameter_list (pp, t);
+ pp_abstract_declarator (pp, TREE_TYPE (t));
+ break;
+
+ case FUNCTION_DECL:
+ pp_c_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t)));
+ pp_c_tree_identifier (pp, DECL_NAME (t));
+ if (pp_c_base (pp)->flags & pp_c_flag_abstract)
+ pp_abstract_declarator (pp, TREE_TYPE (t));
+ else
+ {
+ pp_parameter_list (pp, t);
+ pp_abstract_declarator (pp, TREE_TYPE (TREE_TYPE (t)));
+ }
+ break;
+
+ case INTEGER_TYPE:
+ case REAL_TYPE:
+ case ENUMERAL_TYPE:
+ case UNION_TYPE:
+ case RECORD_TYPE:
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
+ }
}
-static inline void
-pp_c_init_declarator (c_pretty_printer pp, tree t)
+
+/* declarator:
+ pointer(opt) direct-declarator */
+
+void
+pp_c_declarator (c_pretty_printer *pp, tree t)
{
- pp_declarator (pp, t);
- if (DECL_INITIAL (t))
+ switch (TREE_CODE (t))
{
- pp_whitespace (pp);
- pp_equal (pp);
- pp_whitespace (pp);
- pp_c_initializer (pp, DECL_INITIAL (t));
+ case INTEGER_TYPE:
+ case REAL_TYPE:
+ case ENUMERAL_TYPE:
+ case UNION_TYPE:
+ case RECORD_TYPE:
+ break;
+
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ case ARRAY_TYPE:
+ case FUNCTION_TYPE:
+ case FUNCTION_DECL:
+ case TYPE_DECL:
+ pp_direct_declarator (pp, t);
+ break;
+
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
}
}
+/* declaration:
+ declaration-specifiers init-declarator-list(opt) ; */
+
void
-pp_c_declaration (c_pretty_printer pp, tree t)
+pp_c_declaration (c_pretty_printer *pp, tree t)
{
pp_declaration_specifiers (pp, t);
pp_c_init_declarator (pp, t);
}
-static void
-pp_c_parameter_declaration (c_pretty_printer pp, tree t)
-{
- pp_unsupported_tree (pp, t);
-}
-
/* Pretty-print ATTRIBUTES using GNU C extension syntax. */
+
void
-pp_c_attributes (c_pretty_printer pp, tree attributes)
+pp_c_attributes (c_pretty_printer *pp, tree attributes)
{
if (attributes == NULL_TREE)
return;
@@ -247,11 +651,7 @@ pp_c_attributes (c_pretty_printer pp, tree attributes)
{
pp_tree_identifier (pp, TREE_PURPOSE (attributes));
if (TREE_VALUE (attributes))
- {
- pp_c_left_paren (pp);
- pp_c_expression_list (pp, TREE_VALUE (attributes));
- pp_c_right_paren (pp);
- }
+ pp_c_call_argument_list (pp, TREE_VALUE (attributes));
if (TREE_CHAIN (attributes))
pp_separate_with (pp, ',');
@@ -260,109 +660,166 @@ pp_c_attributes (c_pretty_printer pp, tree attributes)
pp_c_right_paren (pp);
}
+/* function-definition:
+ declaration-specifiers declarator compound-statement */
+
+void
+pp_c_function_definition (c_pretty_printer *pp, tree t)
+{
+ pp_declaration_specifiers (pp, t);
+ pp_declarator (pp, t);
+ pp_needs_newline (pp) = true;
+ pp_statement (pp, DECL_SAVED_TREE (t));
+ pp_newline (pp);
+ pp_flush (pp);
+}
+
/* Expressions. */
/* Print out a c-char. */
+
static void
-pp_c_char (c_pretty_printer ppi, int c)
+pp_c_char (c_pretty_printer *pp, int c)
{
switch (c)
{
case TARGET_NEWLINE:
- pp_identifier (ppi, "\\n");
+ pp_string (pp, "\\n");
break;
case TARGET_TAB:
- pp_identifier (ppi, "\\t");
+ pp_string (pp, "\\t");
break;
case TARGET_VT:
- pp_identifier (ppi, "\\v");
+ pp_string (pp, "\\v");
break;
case TARGET_BS:
- pp_identifier (ppi, "\\b");
+ pp_string (pp, "\\b");
break;
case TARGET_CR:
- pp_identifier (ppi, "\\r");
+ pp_string (pp, "\\r");
break;
case TARGET_FF:
- pp_identifier (ppi, "\\f");
+ pp_string (pp, "\\f");
break;
case TARGET_BELL:
- pp_identifier (ppi, "\\a");
+ pp_string (pp, "\\a");
break;
case '\\':
- pp_identifier (ppi, "\\\\");
+ pp_string (pp, "\\\\");
break;
case '\'':
- pp_identifier (ppi, "\\'");
+ pp_string (pp, "\\'");
break;
case '\"':
- pp_identifier (ppi, "\\\"");
+ pp_string (pp, "\\\"");
break;
default:
if (ISPRINT (c))
- pp_character (ppi, c);
+ pp_character (pp, c);
else
- pp_format_scalar (ppi, "\\%03o", (unsigned) c);
+ pp_scalar (pp, "\\%03o", (unsigned) c);
break;
}
}
/* Print out a STRING literal. */
-static inline void
-pp_c_string_literal (c_pretty_printer ppi, tree s)
+
+void
+pp_c_string_literal (c_pretty_printer *pp, tree s)
{
const char *p = TREE_STRING_POINTER (s);
int n = TREE_STRING_LENGTH (s) - 1;
int i;
- pp_doublequote (ppi);
+ pp_doublequote (pp);
for (i = 0; i < n; ++i)
- pp_c_char (ppi, p[i]);
- pp_doublequote (ppi);
+ pp_c_char (pp, p[i]);
+ pp_doublequote (pp);
+}
+
+static void
+pp_c_integer_constant (c_pretty_printer *pp, tree i)
+{
+ tree type = TREE_TYPE (i);
+
+ if (TREE_INT_CST_HIGH (i) == 0)
+ pp_wide_integer (pp, TREE_INT_CST_LOW (i));
+ else
+ {
+ if (tree_int_cst_sgn (i) < 0)
+ {
+ pp_c_char (pp, '-');
+ i = build_int_2 (-TREE_INT_CST_LOW (i),
+ ~TREE_INT_CST_HIGH (i) + !TREE_INT_CST_LOW (i));
+ }
+ sprintf (pp_buffer (pp)->digit_buffer,
+ HOST_WIDE_INT_PRINT_DOUBLE_HEX,
+ TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i));
+ pp_string (pp, pp_buffer (pp)->digit_buffer);
+ }
+ if (TREE_UNSIGNED (type))
+ pp_character (pp, 'u');
+ if (type == long_integer_type_node || type == long_unsigned_type_node)
+ pp_character (pp, 'l');
+ else if (type == long_long_integer_type_node
+ || type == long_long_unsigned_type_node)
+ pp_string (pp, "ll");
}
/* Print out a CHARACTER literal. */
+
static inline void
-pp_c_character_literal (c_pretty_printer ppi, tree c)
+pp_c_character_constant (c_pretty_printer *pp, tree c)
{
- pp_quote (ppi);
- pp_c_char (ppi, tree_low_cst (c, 0));
- pp_quote (ppi);
+ tree type = TREE_TYPE (c);
+ if (type == wchar_type_node)
+ pp_character (pp, 'L');
+ pp_quote (pp);
+ if (host_integerp (c, TREE_UNSIGNED (type)))
+ pp_c_char (pp, tree_low_cst (c, TREE_UNSIGNED (type)));
+ else
+ pp_scalar (pp, "\\x%x", (unsigned) TREE_INT_CST_LOW (c));
+ pp_quote (pp);
}
/* Print out a BOOLEAN literal. */
-static inline void
-pp_c_bool_literal (c_pretty_printer ppi, tree b)
+
+static void
+pp_c_bool_constant (c_pretty_printer *pp, tree b)
{
- if (b == boolean_false_node || integer_zerop (b))
+ if (b == boolean_false_node)
{
if (c_dialect_cxx ())
- pp_c_identifier (ppi, "false");
+ pp_c_identifier (pp, "false");
else if (flag_isoc99)
- pp_c_identifier (ppi, "_False");
+ pp_c_identifier (pp, "_False");
else
- pp_unsupported_tree (ppi, b);
+ pp_unsupported_tree (pp, b);
}
else if (b == boolean_true_node)
{
if (c_dialect_cxx ())
- pp_c_identifier (ppi, "true");
+ pp_c_identifier (pp, "true");
else if (flag_isoc99)
- pp_c_identifier (ppi, "_True");
+ pp_c_identifier (pp, "_True");
else
- pp_unsupported_tree (ppi, b);
+ pp_unsupported_tree (pp, b);
}
+ else if (TREE_CODE (b) == INTEGER_CST)
+ pp_c_integer_constant (pp, b);
else
- pp_unsupported_tree (ppi, b);
+ pp_unsupported_tree (pp, b);
}
/* Attempt to print out an ENUMERATOR. Return true on success. Else return
false; that means the value was obtained by a cast, in which case
print out the type-id part of the cast-expression -- the casted value
is then printed by pp_c_integer_literal. */
+
static bool
-pp_c_enumerator (c_pretty_printer ppi, tree e)
+pp_c_enumeration_constant (c_pretty_printer *pp, tree e)
{
+ bool value_is_named = true;
tree type = TREE_TYPE (e);
tree value;
@@ -373,89 +830,115 @@ pp_c_enumerator (c_pretty_printer ppi, tree e)
;
if (value != NULL_TREE)
- pp_c_tree_identifier (ppi, TREE_PURPOSE (value));
+ pp_id_expression (pp, TREE_PURPOSE (value));
else
{
/* Value must have been cast. */
- pp_c_left_paren (ppi);
- pp_type_id (ppi, type);
- pp_c_right_paren (ppi);
- return false;
+ pp_c_type_cast (pp, type);
+ value_is_named = false;
}
- return true;
+ return value_is_named;
}
-/* Print out an INTEGER constant value. */
+/* Print out a REAL value as a decimal-floating-constant. */
+
+static inline void
+pp_c_floating_constant (c_pretty_printer *pp, tree r)
+{
+ real_to_decimal (pp_buffer (pp)->digit_buffer, &TREE_REAL_CST (r),
+ sizeof (pp_buffer (pp)->digit_buffer), 0, 1);
+ pp_string (pp, pp_buffer(pp)->digit_buffer);
+ if (TREE_TYPE (r) == float_type_node)
+ pp_character (pp, 'f');
+ else if (TREE_TYPE (r) == long_double_type_node)
+ pp_character (pp, 'l');
+}
+
+/* Pretty-print a compound literal expression. GNU extensions include
+ vector constants. */
+
static void
-pp_c_integer_literal (c_pretty_printer ppi, tree i)
+pp_c_compound_literal (c_pretty_printer *pp, tree e)
{
- tree type = TREE_TYPE (i);
+ tree type = TREE_TYPE (e);
+ pp_c_type_cast (pp, type);
- if (type == boolean_type_node)
- pp_c_bool_literal (ppi, i);
- else if (type == char_type_node)
- pp_c_character_literal (ppi, i);
- else if (TREE_CODE (type) == ENUMERAL_TYPE
- && pp_c_enumerator (ppi, i))
- ;
- else
+ switch (TREE_CODE (type))
{
- if (host_integerp (i, 0))
- pp_wide_integer (ppi, TREE_INT_CST_LOW (i));
- else
- {
- if (tree_int_cst_sgn (i) < 0)
- {
- pp_c_char (ppi, '-');
- i = build_int_2 (-TREE_INT_CST_LOW (i),
- ~TREE_INT_CST_HIGH (i) + !TREE_INT_CST_LOW (i));
- sprintf (pp_buffer (ppi)->digit_buffer,
- HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i));
- pp_identifier (ppi, pp_buffer (ppi)->digit_buffer);
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case ARRAY_TYPE:
+ case VECTOR_TYPE:
+ case COMPLEX_TYPE:
+ pp_c_brace_enclosed_initializer_list (pp, e);
+ break;
- }
- }
+ default:
+ pp_unsupported_tree (pp, e);
+ break;
}
}
-/* Print out a REAL value. */
-static inline void
-pp_c_real_literal (c_pretty_printer ppi, tree r)
-{
- real_to_decimal (pp_buffer (ppi)->digit_buffer, &TREE_REAL_CST (r),
- sizeof (pp_buffer (ppi)->digit_buffer), 0, 1);
- pp_identifier (ppi, pp_buffer(ppi)->digit_buffer);
-}
-
+/* constant:
+ integer-constant
+ floating-constant
+ enumeration-constant
+ chatracter-constant */
void
-pp_c_literal (c_pretty_printer ppi, tree e)
+pp_c_constant (c_pretty_printer *pp, tree e)
{
- switch (TREE_CODE (e))
+ const enum tree_code code = TREE_CODE (e);
+
+ switch (code)
{
case INTEGER_CST:
- pp_c_integer_literal (ppi, e);
+ {
+ tree type = TREE_TYPE (e);
+ if (type == boolean_type_node)
+ pp_c_bool_constant (pp, e);
+ else if (type == char_type_node)
+ pp_c_character_constant (pp, e);
+ else if (TREE_CODE (type) == ENUMERAL_TYPE
+ && pp_c_enumeration_constant (pp, e))
+ ;
+ else
+ pp_c_integer_constant (pp, e);
+ }
break;
case REAL_CST:
- pp_c_real_literal (ppi, e);
+ pp_c_floating_constant (pp, e);
break;
case STRING_CST:
- pp_c_string_literal (ppi, e);
+ pp_c_string_literal (pp, e);
break;
default:
- pp_unsupported_tree (ppi, e);
+ pp_unsupported_tree (pp, e);
break;
}
}
-/* Pretty-print a C primary-expression. */
-static void
-pp_c_primary_expression (c_pretty_printer ppi, tree e)
+void
+pp_c_identifier (c_pretty_printer *pp, const char *id)
+{
+ pp_c_maybe_whitespace (pp);
+ pp_identifier (pp, id);
+ pp_base (pp)->padding = pp_before;
+}
+
+/* Pretty-print a C primary-expression.
+ primary-expression:
+ identifier
+ constant
+ string-literal
+ ( expression ) */
+
+void
+pp_c_primary_expression (c_pretty_printer *pp, tree e)
{
switch (TREE_CODE (e))
{
@@ -468,147 +951,246 @@ pp_c_primary_expression (c_pretty_printer ppi, tree e)
e = DECL_NAME (e);
/* Fall through. */
case IDENTIFIER_NODE:
- pp_c_tree_identifier (ppi, e);
+ pp_c_tree_identifier (pp, e);
break;
case ERROR_MARK:
- pp_c_identifier (ppi, "<erroneous-expression>");
+ pp_c_identifier (pp, "<erroneous-expression>");
break;
case RESULT_DECL:
- pp_c_identifier (ppi, "<return-value>");
+ pp_c_identifier (pp, "<return-value>");
break;
case INTEGER_CST:
case REAL_CST:
case STRING_CST:
- pp_c_literal (ppi, e);
+ pp_c_constant (pp, e);
break;
- case TARGET_EXPR:
- pp_c_left_paren (ppi);
- pp_c_identifier (ppi, "__builtin_memcpy");
- pp_c_left_paren (ppi);
- pp_ampersand (ppi);
- pp_c_primary_expression (ppi, TREE_OPERAND (e, 0));
- pp_separate_with (ppi, ',');
- pp_ampersand (ppi);
- pp_initializer (ppi, TREE_OPERAND (e, 1));
- if (TREE_OPERAND (e, 2))
- {
- pp_separate_with (ppi, ',');
- pp_c_expression (ppi, TREE_OPERAND (e, 2));
- }
- pp_c_right_paren (ppi);
-
case STMT_EXPR:
- pp_c_left_paren (ppi);
- pp_statement (ppi, STMT_EXPR_STMT (e));
- pp_c_right_paren (ppi);
+ pp_c_left_paren (pp);
+ pp_statement (pp, STMT_EXPR_STMT (e));
+ pp_c_right_paren (pp);
break;
default:
- /* Make sure this call won't cause any infinite loop. */
- pp_c_left_paren (ppi);
- pp_c_expression (ppi, e);
- pp_c_right_paren (ppi);
+ /* FIXME: Make sure we won't get into an infinie loop. */
+ pp_c_left_paren (pp);
+ pp_expression (pp, e);
+ pp_c_right_paren (pp);
break;
}
}
-/* Print out a C initializer -- also support C compound-literals. */
-void
-pp_c_initializer (c_pretty_printer ppi, tree e)
+/* Print out a C initializer -- also support C compound-literals.
+ initializer:
+ assignment-expression:
+ { initializer-list }
+ { initializer-list , } */
+
+static void
+pp_c_initializer (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == CONSTRUCTOR)
{
enum tree_code code = TREE_CODE (TREE_TYPE (e));
if (code == RECORD_TYPE || code == UNION_TYPE || code == ARRAY_TYPE)
- {
- pp_left_brace (ppi);
- pp_c_initializer_list (ppi, e);
- pp_right_brace (ppi);
- }
+ pp_c_brace_enclosed_initializer_list (pp, e);
else
- pp_unsupported_tree (ppi, TREE_OPERAND (e, 1));
+ pp_unsupported_tree (pp, TREE_OPERAND (e, 1));
}
else
- pp_assignment_expression (ppi, e);
+ pp_expression (pp, e);
+}
+
+/* init-declarator:
+ declarator:
+ declarator = initializer */
+
+void
+pp_c_init_declarator (c_pretty_printer *pp, tree t)
+{
+ pp_declarator (pp, t);
+ if (DECL_INITIAL (t))
+ {
+ tree init = DECL_INITIAL (t);
+ /* This C++ bit is handled here because it is easier to do so.
+ In templates, the C++ parser builds a TREE_LIST for a
+ direct-initialization; the TREE_PURPOSE is the variable to
+ initialize and the TREE_VALUE is the initializer. */
+ if (TREE_CODE (init) == TREE_LIST)
+ {
+ pp_c_left_paren (pp);
+ pp_expression (pp, TREE_VALUE (init));
+ pp_right_paren (pp);
+ }
+ else
+ {
+ pp_space (pp);
+ pp_equal (pp);
+ pp_space (pp);
+ pp_c_initializer (pp, init);
+ }
+ }
}
+/* initializer-list:
+ designation(opt) initializer
+ initializer-list , designation(opt) initializer
+
+ designation:
+ designator-list =
+
+ designator-list:
+ designator
+ designator-list designator
+
+ designator:
+ [ constant-expression ]
+ identifier */
+
static void
-pp_c_initializer_list (c_pretty_printer ppi, tree e)
+pp_c_initializer_list (c_pretty_printer *pp, tree e)
{
tree type = TREE_TYPE (e);
const enum tree_code code = TREE_CODE (type);
- if (code == RECORD_TYPE || code == UNION_TYPE || code == ARRAY_TYPE)
+ switch (code)
{
- tree init = TREE_OPERAND (e, 1);
- for (; init != NULL_TREE; init = TREE_CHAIN (init))
- {
- if (code == RECORD_TYPE || code == UNION_TYPE)
- {
- pp_dot (ppi);
- pp_c_primary_expression (ppi, TREE_PURPOSE (init));
- }
- else
- {
- pp_c_left_bracket (ppi);
- if (TREE_PURPOSE (init))
- pp_c_literal (ppi, TREE_PURPOSE (init));
- pp_c_right_bracket (ppi);
- }
- pp_c_whitespace (ppi);
- pp_equal (ppi);
- pp_c_whitespace (ppi);
- pp_initializer (ppi, TREE_VALUE (init));
- if (TREE_CHAIN (init))
- pp_separate_with (ppi, ',');
- }
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case ARRAY_TYPE:
+ {
+ tree init = TREE_OPERAND (e, 0);
+ for (; init != NULL_TREE; init = TREE_CHAIN (init))
+ {
+ if (code == RECORD_TYPE || code == UNION_TYPE)
+ {
+ pp_c_dot (pp);
+ pp_c_primary_expression (pp, TREE_PURPOSE (init));
+ }
+ else
+ {
+ pp_c_left_bracket (pp);
+ if (TREE_PURPOSE (init))
+ pp_c_constant (pp, TREE_PURPOSE (init));
+ pp_c_right_bracket (pp);
+ }
+ pp_c_whitespace (pp);
+ pp_equal (pp);
+ pp_c_whitespace (pp);
+ pp_initializer (pp, TREE_VALUE (init));
+ if (TREE_CHAIN (init))
+ pp_separate_with (pp, ',');
+ }
+ }
+ break;
+
+ case VECTOR_TYPE:
+ pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
+ break;
+
+ case COMPLEX_TYPE:
+ {
+ const bool cst = TREE_CODE (e) == COMPLEX_CST;
+ pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0));
+ pp_separate_with (pp, ',');
+ pp_expression (pp, cst ? TREE_IMAGPART (e) : TREE_OPERAND (e, 1));
+ }
+ break;
+
+ default:
+ pp_unsupported_tree (pp, type);
+ break;
+ }
+}
+
+/* Pretty-print a brace-enclosed initializer-list. */
+
+static void
+pp_c_brace_enclosed_initializer_list (c_pretty_printer *pp, tree l)
+{
+ pp_c_left_brace (pp);
+ pp_c_initializer_list (pp, l);
+ pp_c_right_brace (pp);
+}
+
+
+/* This is a convenient function, used to bridge gap between C and C++
+ grammars.
+
+ id-expression:
+ identifier */
+
+void
+pp_c_id_expression (c_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case CONST_DECL:
+ case TYPE_DECL:
+ case FUNCTION_DECL:
+ case FIELD_DECL:
+ case LABEL_DECL:
+ t = DECL_NAME (t);
+ case IDENTIFIER_NODE:
+ pp_c_tree_identifier (pp, t);
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
}
- else
- pp_unsupported_tree (ppi, type);
}
+/* postfix-expression:
+ primary-expression
+ postfix-expression [ expression ]
+ postfix-expression ( argument-expression-list(opt) )
+ postfix-expression . identifier
+ postfix-expression -> identifier
+ postfix-expression ++
+ postfix-expression --
+ ( type-name ) { initializer-list }
+ ( type-name ) { initializer-list , } */
+
void
-pp_c_postfix_expression (c_pretty_printer ppi, tree e)
+pp_c_postfix_expression (c_pretty_printer *pp, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
{
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
- pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
- pp_identifier (ppi, code == POSTINCREMENT_EXPR ? "++" : "--");
+ pp_postfix_expression (pp, TREE_OPERAND (e, 0));
+ pp_identifier (pp, code == POSTINCREMENT_EXPR ? "++" : "--");
break;
case ARROW_EXPR:
- pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
- pp_arrow (ppi);
+ pp_postfix_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_arrow (pp);
break;
case ARRAY_REF:
- pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_left_bracket (ppi);
- pp_c_expression (ppi, TREE_OPERAND (e, 1));
- pp_c_right_bracket (ppi);
+ pp_postfix_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_left_bracket (pp);
+ pp_expression (pp, TREE_OPERAND (e, 1));
+ pp_c_right_bracket (pp);
break;
case CALL_EXPR:
- pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_left_paren (ppi);
- pp_c_expression_list (ppi, TREE_OPERAND (e, 1));
- pp_c_right_paren (ppi);
+ pp_postfix_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_call_argument_list (pp, TREE_OPERAND (e, 1));
break;
case ABS_EXPR:
- case FFS_EXPR:
- pp_c_identifier (ppi,
- code == ABS_EXPR ? "__builtin_abs" : "__builtin_ffs");
- pp_c_left_paren (ppi);
- pp_c_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_right_paren (ppi);
+ pp_c_identifier (pp, "__builtin_abs");
+ pp_c_left_paren (pp);
+ pp_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_right_paren (pp);
break;
case COMPONENT_REF:
@@ -616,153 +1198,180 @@ pp_c_postfix_expression (c_pretty_printer ppi, tree e)
tree object = TREE_OPERAND (e, 0);
if (TREE_CODE (object) == INDIRECT_REF)
{
- pp_postfix_expression (ppi, TREE_OPERAND (object, 0));
- pp_arrow (ppi);
+ pp_postfix_expression (pp, TREE_OPERAND (object, 0));
+ pp_c_arrow (pp);
}
else
{
- pp_postfix_expression (ppi, object);
- pp_dot (ppi);
+ pp_postfix_expression (pp, object);
+ pp_c_dot (pp);
}
- pp_c_expression (ppi, TREE_OPERAND (e, 1));
+ pp_expression (pp, TREE_OPERAND (e, 1));
}
break;
case COMPLEX_CST:
case VECTOR_CST:
case COMPLEX_EXPR:
- pp_c_left_paren (ppi);
- pp_type_id (ppi, TREE_TYPE (e));
- pp_c_right_paren (ppi);
- pp_left_brace (ppi);
-
- if (code == COMPLEX_CST)
- {
- pp_c_expression (ppi, TREE_REALPART (e));
- pp_separate_with (ppi, ',');
- pp_c_expression (ppi, TREE_IMAGPART (e));
- }
- else if (code == VECTOR_CST)
- pp_c_expression_list (ppi, TREE_VECTOR_CST_ELTS (e));
- else if (code == COMPLEX_EXPR)
- {
- pp_c_expression (ppi, TREE_OPERAND (e, 0));
- pp_separate_with (ppi, ',');
- pp_c_expression (ppi, TREE_OPERAND (e, 1));
- }
-
- pp_right_brace (ppi);
+ pp_c_compound_literal (pp, e);
break;
case COMPOUND_LITERAL_EXPR:
e = DECL_INITIAL (e);
/* Fall through. */
case CONSTRUCTOR:
- pp_initializer (ppi, e);
+ pp_initializer (pp, e);
break;
case VA_ARG_EXPR:
- pp_c_identifier (ppi, "__builtin_va_arg");
- pp_c_left_paren (ppi);
- pp_assignment_expression (ppi, TREE_OPERAND (e, 0));
- pp_separate_with (ppi, ',');
- pp_type_id (ppi, TREE_TYPE (e));
- pp_c_right_paren (ppi);
+ pp_c_identifier (pp, "__builtin_va_arg");
+ pp_c_left_paren (pp);
+ pp_assignment_expression (pp, TREE_OPERAND (e, 0));
+ pp_separate_with (pp, ',');
+ pp_type_id (pp, TREE_TYPE (e));
+ pp_c_right_paren (pp);
break;
+ case ADDR_EXPR:
+ if (TREE_CODE (TREE_OPERAND (e, 0)) == FUNCTION_DECL)
+ {
+ pp_c_id_expression (pp, TREE_OPERAND (e, 0));
+ break;
+ }
+ /* else fall through. */
+
default:
- pp_primary_expression (ppi, e);
+ pp_primary_expression (pp, e);
break;
}
}
/* Print out an expression-list; E is expected to be a TREE_LIST */
+
void
-pp_c_expression_list (c_pretty_printer ppi, tree e)
+pp_c_expression_list (c_pretty_printer *pp, tree e)
{
for (; e != NULL_TREE; e = TREE_CHAIN (e))
{
- pp_c_assignment_expression (ppi, TREE_VALUE (e));
+ pp_expression (pp, TREE_VALUE (e));
if (TREE_CHAIN (e))
- pp_separate_with (ppi, ',');
+ pp_separate_with (pp, ',');
}
}
-static void
-pp_c_unary_expression (c_pretty_printer ppi, tree e)
+/* Print out an expression-list in parens, as in a function call. */
+
+void
+pp_c_call_argument_list (c_pretty_printer *pp, tree t)
+{
+ pp_c_left_paren (pp);
+ if (t && TREE_CODE (t) == TREE_LIST)
+ pp_c_expression_list (pp, t);
+ pp_c_right_paren (pp);
+}
+
+/* unary-expression:
+ postfix-expression
+ ++ cast-expression
+ -- cast-expression
+ unary-operator cast-expression
+ sizeof unary-expression
+ sizeof ( type-id )
+
+ unary-operator: one of
+ * & + - ! ~
+
+ GNU extensions.
+ unary-expression:
+ __alignof__ unary-expression
+ __alignof__ ( type-id )
+ __real__ unary-expression
+ __imag__ unary-expression */
+
+void
+pp_c_unary_expression (c_pretty_printer *pp, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
{
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
- pp_identifier (ppi, code == PREINCREMENT_EXPR ? "++" : "--");
- pp_c_unary_expression (ppi, TREE_OPERAND (e, 0));
+ pp_identifier (pp, code == PREINCREMENT_EXPR ? "++" : "--");
+ pp_c_unary_expression (pp, TREE_OPERAND (e, 0));
break;
case ADDR_EXPR:
case INDIRECT_REF:
- case CONVERT_EXPR:
case NEGATE_EXPR:
case BIT_NOT_EXPR:
case TRUTH_NOT_EXPR:
case CONJ_EXPR:
- if (code == ADDR_EXPR)
- pp_ampersand (ppi);
+ /* String literal are used by address. */
+ if (code == ADDR_EXPR && TREE_CODE (TREE_OPERAND (e, 0)) != STRING_CST)
+ pp_ampersand (pp);
else if (code == INDIRECT_REF)
- pp_star (ppi);
+ pp_c_star (pp);
else if (code == NEGATE_EXPR)
- pp_minus (ppi);
+ pp_minus (pp);
else if (code == BIT_NOT_EXPR || code == CONJ_EXPR)
- pp_complement (ppi);
+ pp_complement (pp);
else if (code == TRUTH_NOT_EXPR)
- pp_exclamation (ppi);
- pp_c_cast_expression (ppi, TREE_OPERAND (e, 0));
+ pp_exclamation (pp);
+ pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
break;
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
- pp_c_identifier (ppi, code == SIZEOF_EXPR ? "sizeof" : "__alignof__");
- pp_c_whitespace (ppi);
+ pp_c_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__");
+ pp_c_whitespace (pp);
if (TYPE_P (TREE_OPERAND (e, 0)))
- {
- pp_c_left_paren (ppi);
- pp_type_id (ppi, TREE_OPERAND (e, 0));
- pp_c_right_paren (ppi);
- }
+ pp_c_type_cast (pp, TREE_OPERAND (e, 0));
else
- pp_c_unary_expression (ppi, TREE_OPERAND (e, 0));
+ pp_unary_expression (pp, TREE_OPERAND (e, 0));
break;
case REALPART_EXPR:
case IMAGPART_EXPR:
- pp_c_identifier (ppi, code == REALPART_EXPR ? "__real__" : "__imag__");
- pp_c_whitespace (ppi);
- pp_unary_expression (ppi, TREE_OPERAND (e, 0));
+ pp_c_identifier (pp, code == REALPART_EXPR ? "__real__" : "__imag__");
+ pp_c_whitespace (pp);
+ pp_unary_expression (pp, TREE_OPERAND (e, 0));
break;
default:
- pp_postfix_expression (ppi, e);
+ pp_postfix_expression (pp, e);
break;
}
}
+/* cast-expression:
+ unary-expression
+ ( type-name ) cast-expression */
+
void
-pp_c_cast_expression (c_pretty_printer ppi, tree e)
+pp_c_cast_expression (c_pretty_printer *pp, tree e)
{
- if (TREE_CODE (e) == CONVERT_EXPR || TREE_CODE (e) == FLOAT_EXPR)
+ switch (TREE_CODE (e))
{
- pp_c_left_paren (ppi);
- pp_type_id (ppi, TREE_TYPE (e));
- pp_c_right_paren (ppi);
- pp_c_cast_expression (ppi, TREE_OPERAND (e, 0));
+ case FLOAT_EXPR:
+ case FIX_TRUNC_EXPR:
+ case CONVERT_EXPR:
+ pp_c_type_cast (pp, TREE_TYPE (e));
+ pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
+ break;
+
+ default:
+ pp_unary_expression (pp, e);
}
- else
- pp_unary_expression (ppi, e);
}
+/* multiplicative-expression:
+ cast-expression
+ multiplicative-expression * cast-expression
+ multiplicative-expression / cast-expression
+ multiplicative-expression % cast-expression */
+
static void
-pp_c_multiplicative_expression (c_pretty_printer ppi, tree e)
+pp_c_multiplicative_expression (c_pretty_printer *pp, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -770,70 +1379,87 @@ pp_c_multiplicative_expression (c_pretty_printer ppi, tree e)
case MULT_EXPR:
case TRUNC_DIV_EXPR:
case TRUNC_MOD_EXPR:
- pp_c_multiplicative_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_whitespace (ppi);
+ pp_multiplicative_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
if (code == MULT_EXPR)
- pp_star (ppi);
+ pp_c_star (pp);
else if (code == TRUNC_DIV_EXPR)
- pp_slash (ppi);
+ pp_slash (pp);
else
- pp_modulo (ppi);
- pp_c_whitespace (ppi);
- pp_c_cast_expression (ppi, TREE_OPERAND (e, 1));
+ pp_modulo (pp);
+ pp_c_whitespace (pp);
+ pp_c_cast_expression (pp, TREE_OPERAND (e, 1));
break;
default:
- pp_c_cast_expression (ppi, e);
+ pp_c_cast_expression (pp, e);
break;
}
}
+/* additive-expression:
+ multiplicative-expression
+ additive-expression + multiplicative-expression
+ additive-expression - multiplicative-expression */
+
static inline void
-pp_c_additive_expression (c_pretty_printer ppi, tree e)
+pp_c_additive_expression (c_pretty_printer *pp, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
{
case PLUS_EXPR:
case MINUS_EXPR:
- pp_c_additive_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_whitespace (ppi);
+ pp_c_additive_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
if (code == PLUS_EXPR)
- pp_plus (ppi);
+ pp_plus (pp);
else
- pp_minus (ppi);
- pp_c_whitespace (ppi);
- pp_multiplicative_expression (ppi, TREE_OPERAND (e, 1));
+ pp_minus (pp);
+ pp_c_whitespace (pp);
+ pp_multiplicative_expression (pp, TREE_OPERAND (e, 1));
break;
default:
- pp_multiplicative_expression (ppi, e);
+ pp_multiplicative_expression (pp, e);
break;
}
}
+/* additive-expression:
+ additive-expression
+ shift-expression << additive-expression
+ shift-expression >> additive-expression */
+
static inline void
-pp_c_shift_expression (c_pretty_printer ppi, tree e)
+pp_c_shift_expression (c_pretty_printer *pp, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
{
case LSHIFT_EXPR:
case RSHIFT_EXPR:
- pp_c_shift_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_whitespace (ppi);
- pp_identifier (ppi, code == LSHIFT_EXPR ? "<<" : ">>");
- pp_c_whitespace (ppi);
- pp_c_additive_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_shift_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_identifier (pp, code == LSHIFT_EXPR ? "<<" : ">>");
+ pp_c_whitespace (pp);
+ pp_c_additive_expression (pp, TREE_OPERAND (e, 1));
break;
default:
- pp_c_additive_expression (ppi, e);
+ pp_c_additive_expression (pp, e);
}
}
+/* relational-expression:
+ shift-expression
+ relational-expression < shift-expression
+ relational-expression > shift-expression
+ relational-expression <= shift-expression
+ relational-expression >= shift-expression */
+
static void
-pp_c_relational_expression (c_pretty_printer ppi, tree e)
+pp_c_relational_expression (c_pretty_printer *pp, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -842,176 +1468,221 @@ pp_c_relational_expression (c_pretty_printer ppi, tree e)
case GT_EXPR:
case LE_EXPR:
case GE_EXPR:
- pp_c_relational_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_whitespace (ppi);
+ pp_c_relational_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
if (code == LT_EXPR)
- pp_less (ppi);
+ pp_less (pp);
else if (code == GT_EXPR)
- pp_greater (ppi);
+ pp_greater (pp);
else if (code == LE_EXPR)
- pp_identifier (ppi, "<=");
+ pp_identifier (pp, "<=");
else if (code == GE_EXPR)
- pp_identifier (ppi, ">=");
- pp_c_whitespace (ppi);
- pp_c_shift_expression (ppi, TREE_OPERAND (e, 1));
+ pp_identifier (pp, ">=");
+ pp_c_whitespace (pp);
+ pp_c_shift_expression (pp, TREE_OPERAND (e, 1));
break;
default:
- pp_c_shift_expression (ppi, e);
+ pp_c_shift_expression (pp, e);
break;
}
}
+/* equality-expression:
+ relational-expression
+ equality-expression == relational-expression
+ equality-equality != relational-expression */
+
static inline void
-pp_c_equality_expression (c_pretty_printer ppi, tree e)
+pp_c_equality_expression (c_pretty_printer *pp, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
{
case EQ_EXPR:
case NE_EXPR:
- pp_c_equality_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_identifier (ppi, code == EQ_EXPR ? "==" : "!=");
- pp_c_whitespace (ppi);
- pp_c_relational_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_equality_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_identifier (pp, code == EQ_EXPR ? "==" : "!=");
+ pp_c_whitespace (pp);
+ pp_c_relational_expression (pp, TREE_OPERAND (e, 1));
break;
default:
- pp_c_relational_expression (ppi, e);
+ pp_c_relational_expression (pp, e);
break;
}
}
+/* AND-expression:
+ equality-expression
+ AND-expression & equality-equality */
+
static inline void
-pp_c_and_expression (c_pretty_printer ppi, tree e)
+pp_c_and_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == BIT_AND_EXPR)
{
- pp_c_and_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_ampersand (ppi);
- pp_c_whitespace (ppi);
- pp_c_equality_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_and_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_ampersand (pp);
+ pp_c_whitespace (pp);
+ pp_c_equality_expression (pp, TREE_OPERAND (e, 1));
}
else
- pp_c_equality_expression (ppi, e);
+ pp_c_equality_expression (pp, e);
}
+/* exclusive-OR-expression:
+ AND-expression
+ exclusive-OR-expression ^ AND-expression */
+
static inline void
-pp_c_exclusive_or_expression (c_pretty_printer ppi, tree e)
+pp_c_exclusive_or_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == BIT_XOR_EXPR)
{
- pp_c_exclusive_or_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_carret (ppi);
- pp_c_whitespace (ppi);
- pp_c_and_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_maybe_whitespace (pp);
+ pp_carret (pp);
+ pp_c_whitespace (pp);
+ pp_c_and_expression (pp, TREE_OPERAND (e, 1));
}
else
- pp_c_and_expression (ppi, e);
+ pp_c_and_expression (pp, e);
}
+/* inclusive-OR-expression:
+ exclusive-OR-expression
+ inclusive-OR-expression | exclusive-OR-expression */
+
static inline void
-pp_c_inclusive_or_expression (c_pretty_printer ppi, tree e)
+pp_c_inclusive_or_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == BIT_IOR_EXPR)
{
- pp_c_exclusive_or_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_bar (ppi);
- pp_c_whitespace (ppi);
- pp_c_exclusive_or_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_bar (pp);
+ pp_c_whitespace (pp);
+ pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 1));
}
else
- pp_c_exclusive_or_expression (ppi, e);
+ pp_c_exclusive_or_expression (pp, e);
}
+/* logical-AND-expression:
+ inclusive-OR-expression
+ logical-AND-expression && inclusive-OR-expression */
+
static inline void
-pp_c_logical_and_expression (c_pretty_printer ppi, tree e)
+pp_c_logical_and_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == TRUTH_ANDIF_EXPR)
{
- pp_c_logical_and_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_identifier (ppi, "&&");
- pp_c_whitespace (ppi);
- pp_c_inclusive_or_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_logical_and_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_identifier (pp, "&&");
+ pp_c_whitespace (pp);
+ pp_c_inclusive_or_expression (pp, TREE_OPERAND (e, 1));
}
else
- pp_c_inclusive_or_expression (ppi, e);
+ pp_c_inclusive_or_expression (pp, e);
}
+/* logical-OR-expression:
+ logical-AND-expression
+ logical-OR-expression || logical-AND-expression */
+
void
-pp_c_logical_or_expression (c_pretty_printer ppi, tree e)
+pp_c_logical_or_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == TRUTH_ORIF_EXPR)
{
- pp_c_logical_or_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_identifier (ppi, "||");
- pp_c_whitespace (ppi);
- pp_c_logical_and_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_identifier (pp, "||");
+ pp_c_whitespace (pp);
+ pp_c_logical_and_expression (pp, TREE_OPERAND (e, 1));
}
else
- pp_c_logical_and_expression (ppi, e);
+ pp_c_logical_and_expression (pp, e);
}
+/* conditional-expression:
+ logical-OR-expression
+ logical-OR-expression ? expression : conditional-expression */
+
static void
-pp_c_conditional_expression (c_pretty_printer ppi, tree e)
+pp_c_conditional_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == COND_EXPR)
{
- pp_c_logical_or_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_question (ppi);
- pp_c_whitespace (ppi);
- pp_c_expression (ppi, TREE_OPERAND (e, 1));
- pp_c_maybe_whitespace (ppi);
- pp_colon (ppi);
- pp_c_whitespace (ppi);
- pp_c_conditional_expression (ppi, TREE_OPERAND (e, 2));
+ pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_question (pp);
+ pp_c_whitespace (pp);
+ pp_expression (pp, TREE_OPERAND (e, 1));
+ pp_c_whitespace (pp);
+ pp_colon (pp);
+ pp_c_whitespace (pp);
+ pp_c_conditional_expression (pp, TREE_OPERAND (e, 2));
}
else
- pp_c_logical_or_expression (ppi, e);
+ pp_c_logical_or_expression (pp, e);
}
-/* Pretty-print a C assignment-expression. */
+/* assignment-expression:
+ conditional-expression
+ unary-expression assignment-operator assignment-expression
+
+ assignment-expression: one of
+ = *= /= %= += -= >>= <<= &= ^= |= */
+
static void
-pp_c_assignment_expression (c_pretty_printer ppi, tree e)
+pp_c_assignment_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == MODIFY_EXPR || TREE_CODE (e) == INIT_EXPR)
{
- pp_c_unary_expression (ppi, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (ppi);
- pp_equal (ppi);
- pp_whitespace (ppi);
- pp_c_assignment_expression (ppi, TREE_OPERAND (e, 1));
+ pp_c_unary_expression (pp, TREE_OPERAND (e, 0));
+ pp_c_whitespace (pp);
+ pp_equal (pp);
+ pp_space (pp);
+ pp_c_expression (pp, TREE_OPERAND (e, 1));
}
else
- pp_c_conditional_expression (ppi, e);
+ pp_c_conditional_expression (pp, e);
}
-/* Pretty-print an expression. */
+/* expression:
+ assignment-expression
+ expression , assignment-expression
+
+ Implementation note: instead of going through the usual recursion
+ chain, I take the liberty of dispatching nodes to the appropriate
+ functions. This makes some redundancy, but it worths it. That also
+ prevents a possible infinite recursion between pp_c_primary_expression ()
+ and pp_c_expression (). */
+
void
-pp_c_expression (c_pretty_printer ppi, tree e)
+pp_c_expression (c_pretty_printer *pp, tree e)
{
switch (TREE_CODE (e))
{
case INTEGER_CST:
- pp_c_integer_literal (ppi, e);
+ pp_c_integer_constant (pp, e);
break;
case REAL_CST:
- pp_c_real_literal (ppi, e);
+ pp_c_floating_constant (pp, e);
break;
case STRING_CST:
- pp_c_string_literal (ppi, e);
+ pp_c_string_literal (pp, e);
break;
+ case IDENTIFIER_NODE:
case FUNCTION_DECL:
case VAR_DECL:
case CONST_DECL:
@@ -1020,9 +1691,8 @@ pp_c_expression (c_pretty_printer ppi, tree e)
case FIELD_DECL:
case LABEL_DECL:
case ERROR_MARK:
- case TARGET_EXPR:
case STMT_EXPR:
- pp_c_primary_expression (ppi, e);
+ pp_primary_expression (pp, e);
break;
case POSTINCREMENT_EXPR:
@@ -1032,14 +1702,13 @@ pp_c_expression (c_pretty_printer ppi, tree e)
case CALL_EXPR:
case COMPONENT_REF:
case COMPLEX_CST:
+ case COMPLEX_EXPR:
case VECTOR_CST:
case ABS_EXPR:
- case FFS_EXPR:
case CONSTRUCTOR:
case COMPOUND_LITERAL_EXPR:
- case COMPLEX_EXPR:
case VA_ARG_EXPR:
- pp_c_postfix_expression (ppi, e);
+ pp_postfix_expression (pp, e);
break;
case CONJ_EXPR:
@@ -1054,217 +1723,307 @@ pp_c_expression (c_pretty_printer ppi, tree e)
case ALIGNOF_EXPR:
case REALPART_EXPR:
case IMAGPART_EXPR:
- pp_c_unary_expression (ppi, e);
+ pp_c_unary_expression (pp, e);
break;
- case CONVERT_EXPR:
case FLOAT_EXPR:
- pp_c_cast_expression (ppi, e);
+ case FIX_TRUNC_EXPR:
+ case CONVERT_EXPR:
+ pp_c_cast_expression (pp, e);
break;
case MULT_EXPR:
case TRUNC_MOD_EXPR:
case TRUNC_DIV_EXPR:
- pp_c_multiplicative_expression (ppi, e);
+ pp_multiplicative_expression (pp, e);
break;
case LSHIFT_EXPR:
case RSHIFT_EXPR:
- pp_c_shift_expression (ppi, e);
+ pp_c_shift_expression (pp, e);
break;
case LT_EXPR:
case GT_EXPR:
case LE_EXPR:
case GE_EXPR:
- pp_c_relational_expression (ppi, e);
+ pp_c_relational_expression (pp, e);
break;
case BIT_AND_EXPR:
- pp_c_and_expression (ppi, e);
+ pp_c_and_expression (pp, e);
break;
case BIT_XOR_EXPR:
- pp_c_exclusive_or_expression (ppi, e);
+ pp_c_exclusive_or_expression (pp, e);
break;
case BIT_IOR_EXPR:
- pp_c_inclusive_or_expression (ppi, e);
+ pp_c_inclusive_or_expression (pp, e);
break;
case TRUTH_ANDIF_EXPR:
- pp_c_logical_and_expression (ppi, e);
+ pp_c_logical_and_expression (pp, e);
break;
case TRUTH_ORIF_EXPR:
- pp_c_logical_or_expression (ppi, e);
+ pp_c_logical_or_expression (pp, e);
break;
+ case EQ_EXPR:
+ case NE_EXPR:
+ pp_c_equality_expression (pp, e);
+ break;
+
case COND_EXPR:
- pp_c_conditional_expression (ppi, e);
+ pp_conditional_expression (pp, e);
break;
- case MODIFY_EXPR:
- case INIT_EXPR:
- pp_c_assignment_expression (ppi, e);
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ pp_c_additive_expression (pp, e);
break;
- case NOP_EXPR:
- pp_c_expression (ppi, TREE_OPERAND (e, 0));
+ case MODIFY_EXPR:
+ case INIT_EXPR:
+ pp_assignment_expression (pp, e);
break;
case COMPOUND_EXPR:
- pp_c_left_paren (ppi);
- pp_c_expression (ppi, TREE_OPERAND (e, 0));
- pp_separate_with (ppi, ',');
- pp_assignment_expression (ppi, TREE_OPERAND (e, 1));
- pp_c_right_paren (ppi);
+ pp_c_left_paren (pp);
+ pp_expression (pp, TREE_OPERAND (e, 0));
+ pp_separate_with (pp, ',');
+ pp_assignment_expression (pp, TREE_OPERAND (e, 1));
+ pp_c_right_paren (pp);
break;
+ case NOP_EXPR:
+ case NON_LVALUE_EXPR:
+ case SAVE_EXPR:
+ case UNSAVE_EXPR:
+ pp_expression (pp, TREE_OPERAND (e, 0));
+ break;
+ case TARGET_EXPR:
+ pp_postfix_expression (pp, TREE_OPERAND (e, 1));
+ break;
+
default:
- pp_unsupported_tree (ppi, e);
+ pp_unsupported_tree (pp, e);
break;
}
}
+
/* Statements. */
+
+/* statement:
+ labeled-statement
+ coumpound-statement
+ expression-statement
+ selection-statement
+ iteration-statement
+ jump-statement */
+
void
-pp_c_statement (c_pretty_printer ppi, tree stmt)
+pp_c_statement (c_pretty_printer *pp, tree stmt)
{
- const enum tree_code code = TREE_CODE (stmt);
+ enum tree_code code;
+
+ if (stmt == NULL)
+ return;
+
+ code = TREE_CODE (stmt);
switch (code)
{
+ /* labeled-statement:
+ identifier : statement
+ case constant-expression : statement
+ default : statement */
case LABEL_STMT:
case CASE_LABEL:
- pp_newline (ppi);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, -3);
+ else
+ pp_indentation (pp) -= 3;
if (code == LABEL_STMT)
- pp_tree_identifier (ppi, DECL_NAME (LABEL_STMT_LABEL (stmt)));
- else if (code == LABEL_STMT)
+ pp_tree_identifier (pp, DECL_NAME (LABEL_STMT_LABEL (stmt)));
+ else if (code == CASE_LABEL)
{
if (CASE_LOW (stmt) == NULL_TREE)
- pp_identifier (ppi, "default");
+ pp_identifier (pp, "default");
else
{
- pp_c_identifier (ppi, "case");
- pp_c_whitespace (ppi);
- pp_conditional_expression (ppi, CASE_LOW (stmt));
+ pp_c_identifier (pp, "case");
+ pp_c_whitespace (pp);
+ pp_conditional_expression (pp, CASE_LOW (stmt));
if (CASE_HIGH (stmt))
{
- pp_identifier (ppi, "...");
- pp_conditional_expression (ppi, CASE_HIGH (stmt));
+ pp_identifier (pp, "...");
+ pp_conditional_expression (pp, CASE_HIGH (stmt));
}
}
}
- pp_colon (ppi);
- pp_newline_and_indent (ppi, 3);
+ pp_colon (pp);
+ pp_indentation (pp) += 3;
+ pp_needs_newline (pp) = true;
break;
+ /* coumpound-statement:
+ { block-item-list(opt) }
+
+ block-item-list:
+ block-item
+ block-item-list block-item
+
+ block-item:
+ declaration
+ statement */
case COMPOUND_STMT:
- pp_left_brace (ppi);
- pp_newline_and_indent (ppi, 3);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_c_left_brace (pp);
+ pp_newline_and_indent (pp, 3);
for (stmt = COMPOUND_BODY (stmt); stmt; stmt = TREE_CHAIN (stmt))
- pp_c_statement (ppi, stmt);
- pp_newline_and_indent (ppi, -3);
- pp_right_brace (ppi);
- pp_newline (ppi);
+ pp_statement (pp, stmt);
+ pp_newline_and_indent (pp, -3);
+ pp_c_right_brace (pp);
+ pp_needs_newline (pp) = true;
break;
+ /* expression-statement:
+ expression(opt) ; */
case EXPR_STMT:
case CLEANUP_STMT:
- pp_newline (ppi);
- pp_c_expression (ppi, code == EXPR_STMT
- ? EXPR_STMT_EXPR (stmt)
- : CLEANUP_EXPR (stmt));
- pp_semicolon (ppi);
- pp_newline (ppi);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ {
+ tree e = code == EXPR_STMT
+ ? EXPR_STMT_EXPR (stmt)
+ : CLEANUP_EXPR (stmt);
+ if (e)
+ pp_expression (pp, e);
+ }
+ pp_c_semicolon (pp);
+ pp_needs_newline (pp) = true;
break;
+ /* selection-statement:
+ if ( expression ) statement
+ if ( expression ) statement else statement
+ switch ( expression ) statement */
case IF_STMT:
- pp_c_identifier (ppi, "if");
- pp_whitespace (ppi);
- pp_c_left_paren (ppi);
- pp_c_expression (ppi, IF_COND (stmt));
- pp_right_paren (ppi);
- pp_newline_and_indent (ppi, 3);
- pp_statement (ppi, THEN_CLAUSE (stmt));
- pp_newline_and_indent (ppi, -3);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_c_identifier (pp, "if");
+ pp_c_whitespace (pp);
+ pp_c_left_paren (pp);
+ pp_expression (pp, IF_COND (stmt));
+ pp_c_right_paren (pp);
+ pp_newline_and_indent (pp, 3);
+ pp_statement (pp, THEN_CLAUSE (stmt));
+ pp_newline_and_indent (pp, -3);
if (ELSE_CLAUSE (stmt))
{
tree else_clause = ELSE_CLAUSE (stmt);
- pp_c_identifier (ppi, "else");
+ pp_c_identifier (pp, "else");
if (TREE_CODE (else_clause) == IF_STMT)
- pp_c_whitespace (ppi);
+ pp_c_whitespace (pp);
else
- pp_newline_and_indent (ppi, 3);
- pp_statement (ppi, else_clause);
+ pp_newline_and_indent (pp, 3);
+ pp_statement (pp, else_clause);
if (TREE_CODE (else_clause) != IF_STMT)
- pp_newline_and_indent (ppi, -3);
+ pp_newline_and_indent (pp, -3);
}
break;
case SWITCH_STMT:
- pp_newline (ppi);
- pp_c_identifier (ppi, "switch");
- pp_whitespace (ppi);
- pp_c_left_paren (ppi);
- pp_c_expression (ppi, SWITCH_COND (stmt));
- pp_right_paren (ppi);
- pp_newline_and_indent (ppi, 3);
- pp_statement (ppi, SWITCH_BODY (stmt));
- pp_newline_and_indent (ppi, -3);
- break;
-
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_c_identifier (pp, "switch");
+ pp_space (pp);
+ pp_c_left_paren (pp);
+ pp_expression (pp, SWITCH_COND (stmt));
+ pp_c_right_paren (pp);
+ pp_indentation (pp) += 3;
+ pp_needs_newline (pp) = true;
+ pp_statement (pp, SWITCH_BODY (stmt));
+ pp_newline_and_indent (pp, -3);
+ break;
+
+ /* iteration-statement:
+ while ( expression ) statement
+ do statement while ( expression ) ;
+ for ( expression(opt) ; expression(opt) ; expression(opt) ) statement
+ for ( declaration expression(opt) ; expression(opt) ) statement */
case WHILE_STMT:
- pp_c_identifier (ppi, "while");
- pp_whitespace (ppi);
- pp_c_left_paren (ppi);
- pp_c_expression (ppi, WHILE_COND (stmt));
- pp_right_paren (ppi);
- pp_newline_and_indent (ppi, 3);
- pp_statement (ppi, WHILE_BODY (stmt));
- pp_newline_and_indent (ppi, -3);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_c_identifier (pp, "while");
+ pp_space (pp);
+ pp_c_left_paren (pp);
+ pp_expression (pp, WHILE_COND (stmt));
+ pp_c_right_paren (pp);
+ pp_newline_and_indent (pp, 3);
+ pp_statement (pp, WHILE_BODY (stmt));
+ pp_indentation (pp) -= 3;
+ pp_needs_newline (pp) = true;
break;
case DO_STMT:
- pp_c_identifier (ppi, "do");
- pp_newline_and_indent (ppi, 3);
- pp_statement (ppi, DO_BODY (stmt));
- pp_newline_and_indent (ppi, -3);
- pp_c_identifier (ppi, "while");
- pp_whitespace (ppi);
- pp_c_left_paren (ppi);
- pp_c_expression (ppi, DO_COND (stmt));
- pp_c_right_paren (ppi);
- pp_semicolon (ppi);
- pp_newline (ppi);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_c_identifier (pp, "do");
+ pp_newline_and_indent (pp, 3);
+ pp_statement (pp, DO_BODY (stmt));
+ pp_newline_and_indent (pp, -3);
+ pp_c_identifier (pp, "while");
+ pp_space (pp);
+ pp_c_left_paren (pp);
+ pp_expression (pp, DO_COND (stmt));
+ pp_c_right_paren (pp);
+ pp_c_semicolon (pp);
+ pp_needs_newline (pp) = true;
break;
case FOR_STMT:
- pp_c_identifier (ppi, "for");
- pp_whitespace (ppi);
- pp_c_left_paren (ppi);
- pp_statement (ppi, FOR_INIT_STMT (stmt));
- pp_c_whitespace (ppi);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_c_identifier (pp, "for");
+ pp_space (pp);
+ pp_c_left_paren (pp);
+ if (FOR_INIT_STMT (stmt))
+ pp_statement (pp, FOR_INIT_STMT (stmt));
+ else
+ pp_c_semicolon (pp);
+ pp_needs_newline (pp) = false;
+ pp_c_whitespace (pp);
if (FOR_COND (stmt))
- pp_c_expression (ppi, FOR_COND (stmt));
- pp_semicolon (ppi);
- pp_c_whitespace (ppi);
+ pp_expression (pp, FOR_COND (stmt));
+ pp_c_semicolon (pp);
+ pp_needs_newline (pp) = false;
+ pp_c_whitespace (pp);
if (FOR_EXPR (stmt))
- pp_c_expression (ppi, FOR_EXPR (stmt));
- pp_right_paren (ppi);
- pp_newline_and_indent (ppi, 3);
- pp_statement (ppi, FOR_BODY (stmt));
- pp_newline_and_indent (ppi, -3);
- break;
-
+ pp_expression (pp, FOR_EXPR (stmt));
+ pp_c_right_paren (pp);
+ pp_newline_and_indent (pp, 3);
+ pp_statement (pp, FOR_BODY (stmt));
+ pp_indentation (pp) -= 3;
+ pp_needs_newline (pp) = true;
+ break;
+
+ /* jump-statement:
+ goto identifier;
+ continue ;
+ return expression(opt) ; */
case BREAK_STMT:
case CONTINUE_STMT:
- pp_newline (ppi);
- pp_identifier (ppi, code == BREAK_STMT ? "break" : "continue");
- pp_semicolon (ppi);
- pp_newline (ppi);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_identifier (pp, code == BREAK_STMT ? "break" : "continue");
+ pp_c_semicolon (pp);
+ pp_needs_newline (pp) = true;
break;
case RETURN_STMT:
@@ -1273,36 +2032,48 @@ pp_c_statement (c_pretty_printer ppi, tree stmt)
tree e = code == RETURN_STMT
? RETURN_STMT_EXPR (stmt)
: GOTO_DESTINATION (stmt);
-
- pp_newline (ppi);
- pp_c_identifier (ppi, code == RETURN_STMT ? "return" : "goto");
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_c_identifier (pp, code == RETURN_STMT ? "return" : "goto");
+ pp_c_whitespace (pp);
if (e)
- pp_c_expression (ppi, e);
- pp_semicolon (ppi);
- pp_newline (ppi);
+ {
+ if (TREE_CODE (e) == INIT_EXPR
+ && TREE_CODE (TREE_OPERAND (e, 0)) == RESULT_DECL)
+ e = TREE_OPERAND (e, 1);
+ pp_expression (pp, e);
+ }
+ pp_c_semicolon (pp);
+ pp_needs_newline (pp) = true;
}
break;
case SCOPE_STMT:
if (!SCOPE_NULLIFIED_P (stmt) && SCOPE_NO_CLEANUPS_P (stmt))
- {
- if (SCOPE_BEGIN_P (stmt))
- {
- pp_left_brace (ppi);
- pp_newline_and_indent (ppi, 3);
- }
- else if (SCOPE_END_P (stmt))
- {
- pp_right_brace (ppi);
- pp_newline_and_indent (ppi, -3);
- }
- }
+ {
+ int i = 0;
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ if (SCOPE_BEGIN_P (stmt))
+ {
+ pp_left_brace (pp);
+ i = 3;
+ }
+ else if (SCOPE_END_P (stmt))
+ {
+ pp_right_brace (pp);
+ i = -3;
+ }
+ pp_indentation (pp) += i;
+ pp_needs_newline (pp) = true;
+ }
break;
case DECL_STMT:
- pp_declaration (ppi, DECL_STMT_DECL (stmt));
- pp_semicolon (ppi);
- pp_newline (ppi);
+ if (pp_needs_newline (pp))
+ pp_newline_and_indent (pp, 0);
+ pp_declaration (pp, DECL_STMT_DECL (stmt));
+ pp_needs_newline (pp) = true;
break;
case ASM_STMT:
@@ -1310,65 +2081,72 @@ pp_c_statement (c_pretty_printer ppi, tree stmt)
bool has_volatile_p = ASM_VOLATILE_P (stmt);
bool is_extended = has_volatile_p || ASM_INPUTS (stmt)
|| ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt);
- pp_c_identifier (ppi, is_extended ? "__asm__" : "asm");
+ pp_c_identifier (pp, is_extended ? "__asm__" : "asm");
if (has_volatile_p)
- pp_c_identifier (ppi, "__volatile__");
- pp_whitespace (ppi);
- pp_c_left_paren (ppi);
- pp_c_string_literal (ppi, ASM_STRING (stmt));
+ pp_c_identifier (pp, "__volatile__");
+ pp_space (pp);
+ pp_c_left_paren (pp);
+ pp_c_string_literal (pp, ASM_STRING (stmt));
if (is_extended)
{
- pp_whitespace (ppi);
- pp_separate_with (ppi, ':');
+ pp_space (pp);
+ pp_separate_with (pp, ':');
if (ASM_OUTPUTS (stmt))
- pp_c_expression (ppi, ASM_OUTPUTS (stmt));
- pp_whitespace (ppi);
- pp_separate_with (ppi, ':');
+ pp_expression (pp, ASM_OUTPUTS (stmt));
+ pp_space (pp);
+ pp_separate_with (pp, ':');
if (ASM_INPUTS (stmt))
- pp_c_expression (ppi, ASM_INPUTS (stmt));
- pp_whitespace (ppi);
- pp_separate_with (ppi, ':');
+ pp_expression (pp, ASM_INPUTS (stmt));
+ pp_space (pp);
+ pp_separate_with (pp, ':');
if (ASM_CLOBBERS (stmt))
- pp_c_expression (ppi, ASM_CLOBBERS (stmt));
+ pp_expression (pp, ASM_CLOBBERS (stmt));
}
- pp_right_paren (ppi);
- pp_newline (ppi);
+ pp_c_right_paren (pp);
+ pp_newline (pp);
}
break;
case FILE_STMT:
- pp_c_identifier (ppi, "__FILE__");
- pp_whitespace (ppi);
- pp_equal (ppi);
- pp_c_whitespace (ppi);
- pp_c_identifier (ppi, FILE_STMT_FILENAME (stmt));
- pp_semicolon (ppi);
- pp_newline (ppi);
+ pp_c_identifier (pp, "__FILE__");
+ pp_space (pp);
+ pp_equal (pp);
+ pp_c_whitespace (pp);
+ pp_c_identifier (pp, FILE_STMT_FILENAME (stmt));
+ pp_c_semicolon (pp);
+ pp_needs_newline (pp) = true;
break;
default:
- pp_unsupported_tree (ppi, stmt);
+ pp_unsupported_tree (pp, stmt);
}
-
}
/* Initialize the PRETTY-PRINTER for handling C codes. */
+
void
-pp_c_pretty_printer_init (c_pretty_printer pp)
+pp_c_pretty_printer_init (c_pretty_printer *pp)
{
pp->offset_list = 0;
pp->declaration = pp_c_declaration;
pp->declaration_specifiers = pp_c_declaration_specifiers;
- pp->type_specifier = pp_c_simple_type_specifier;
pp->declarator = pp_c_declarator;
pp->direct_declarator = pp_c_direct_declarator;
- pp->parameter_declaration = pp_c_parameter_declaration;
+ pp->type_specifier_seq = pp_c_specifier_qualifier_list;
+ pp->abstract_declarator = pp_c_abstract_declarator;
+ pp->direct_abstract_declarator = pp_c_direct_abstract_declarator;
+ pp->ptr_operator = pp_c_pointer;
+ pp->parameter_list = pp_c_parameter_type_list;
pp->type_id = pp_c_type_id;
+ pp->simple_type_specifier = pp_c_type_specifier;
+ pp->function_specifier = pp_c_function_specifier;
+ pp->storage_class_specifier = pp_c_storage_class_specifier;
pp->statement = pp_c_statement;
+ pp->id_expression = pp_c_id_expression;
pp->primary_expression = pp_c_primary_expression;
pp->postfix_expression = pp_c_postfix_expression;
pp->unary_expression = pp_c_unary_expression;
@@ -1376,4 +2154,5 @@ pp_c_pretty_printer_init (c_pretty_printer pp)
pp->multiplicative_expression = pp_c_multiplicative_expression;
pp->conditional_expression = pp_c_conditional_expression;
pp->assignment_expression = pp_c_assignment_expression;
+ pp->expression = pp_c_expression;
}
diff --git a/gcc/c-pretty-print.h b/gcc/c-pretty-print.h
index 95cd4eff198..26b3cae99c7 100644
--- a/gcc/c-pretty-print.h
+++ b/gcc/c-pretty-print.h
@@ -27,139 +27,174 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "pretty-print.h"
+typedef enum
+ {
+ pp_c_flag_abstract = 1 << 1,
+ pp_c_flag_last_bit = 2
+ } pp_c_pretty_print_flags;
+
+
/* The data type used to bundle information necessary for pretty-printing
a C or C++ entity. */
-typedef struct c_pretty_print_info *c_pretty_printer;
+typedef struct c_pretty_print_info c_pretty_printer;
/* The type of a C pretty-printer 'member' function. */
-typedef void (*c_pretty_print_fn) (c_pretty_printer, tree);
-
+typedef void (*c_pretty_print_fn) (c_pretty_printer *, tree);
+
+/* The datatype that contains information necessary for pretty-printing
+ a tree that represents a C construct. Any pretty-printer for a
+ language using C/c++ syntax can derive from this datatype and reuse
+ facilities provided here. It can do so by having a subobject of type
+ c_pretty_printer and override the macro pp_c_base to return a pointer
+ to that subobject. Such a pretty-printer has the responsability to
+ initialize the pp_base() part, then call pp_c_pretty_printer_init
+ to set up the components that are specific to the C pretty-printer.
+ A derived pretty-printer can override any function listed in the
+ vtable below. See cp/cxx-pretty-print.h and cp/cxx-pretty-print.c
+ for an example of derivation. */
struct c_pretty_print_info
{
- struct pretty_print_info base;
+ pretty_printer base;
/* Points to the first element of an array of offset-list.
Not used yet. */
int *offset_list;
+ pp_flags flags;
+
/* These must be overridden by each of the C and C++ front-end to
reflect their understanding of syntactic productions when they differ. */
c_pretty_print_fn declaration;
c_pretty_print_fn declaration_specifiers;
- c_pretty_print_fn type_specifier;
c_pretty_print_fn declarator;
+ c_pretty_print_fn abstract_declarator;
+ c_pretty_print_fn direct_abstract_declarator;
+ c_pretty_print_fn type_specifier_seq;
c_pretty_print_fn direct_declarator;
- c_pretty_print_fn parameter_declaration;
+ c_pretty_print_fn ptr_operator;
+ c_pretty_print_fn parameter_list;
c_pretty_print_fn type_id;
+ c_pretty_print_fn simple_type_specifier;
+ c_pretty_print_fn function_specifier;
+ c_pretty_print_fn storage_class_specifier;
+ c_pretty_print_fn initializer;
c_pretty_print_fn statement;
+ c_pretty_print_fn id_expression;
c_pretty_print_fn primary_expression;
c_pretty_print_fn postfix_expression;
c_pretty_print_fn unary_expression;
- c_pretty_print_fn initializer;
c_pretty_print_fn multiplicative_expression;
c_pretty_print_fn conditional_expression;
c_pretty_print_fn assignment_expression;
+ c_pretty_print_fn expression;
};
-#define pp_c_left_paren(PPI) \
- do { \
- pp_left_paren (PPI); \
- pp_c_base (PPI)->base.padding = pp_none; \
- } while (0)
-#define pp_c_right_paren(PPI) \
- do { \
- pp_right_paren (PPI); \
- pp_c_base (PPI)->base.padding = pp_none; \
- } while (0)
-#define pp_c_left_bracket(PPI) \
- do { \
- pp_left_bracket (PPI); \
- pp_c_base (PPI)->base.padding = pp_none; \
- } while (0)
-#define pp_c_right_bracket(PPI) \
- do { \
- pp_right_bracket (PPI); \
- pp_c_base (PPI)->base.padding = pp_none; \
- } while (0)
-#define pp_c_whitespace(PPI) \
- do { \
- pp_whitespace (PPI); \
- pp_c_base (PPI)->base.padding = pp_none; \
- } while (0)
-#define pp_c_maybe_whitespace(PPI) \
- do { \
- if (pp_c_base (PPI)->base.padding != pp_none) \
- pp_c_whitespace (PPI); \
- } while (0)
-#define pp_c_identifier(PPI, ID) \
- do { \
- pp_c_maybe_whitespace (PPI); \
- pp_identifier (PPI, ID); \
- pp_c_base (PPI)->base.padding = pp_before; \
- } while (0)
+/* Override the pp_base macro. Derived pretty-printers should not
+ touch this macro. Instead they should override pp_c_base instead. */
+#undef pp_base
+#define pp_base(PP) (&pp_c_base (PP)->base)
+
#define pp_c_tree_identifier(PPI, ID) \
pp_c_identifier (PPI, IDENTIFIER_POINTER (ID))
-/* Returns the 'output_buffer *' associated with a PRETTY-PRINTER, the latter
- being something digestible by pp_c_base. */
-#define pp_buffer(PPI) pp_c_base (PPI)->base.buffer
-
#define pp_declaration(PPI, T) \
- (*pp_c_base (PPI)->declaration) (pp_c_base (PPI), T)
+ pp_c_base (PPI)->declaration (pp_c_base (PPI), T)
#define pp_declaration_specifiers(PPI, D) \
- (*pp_c_base (PPI)->declaration_specifiers) (pp_c_base (PPI), D)
-#define pp_type_specifier(PPI, D) \
- (*pp_c_base (PPI)->type_specifier) (pp_c_base (PPI), D)
+ pp_c_base (PPI)->declaration_specifiers (pp_c_base (PPI), D)
+#define pp_abstract_declarator(PP, D) \
+ pp_c_base (PP)->abstract_declarator (pp_c_base (PP), D)
+#define pp_type_specifier_seq(PPI, D) \
+ pp_c_base (PPI)->type_specifier_seq (pp_c_base (PPI), D)
#define pp_declarator(PPI, D) \
- (*pp_c_base (PPI)->declarator) (pp_c_base (PPI), D)
+ pp_c_base (PPI)->declarator (pp_c_base (PPI), D)
#define pp_direct_declarator(PPI, D) \
- (*pp_c_base (PPI)->direct_declarator) (pp_c_base (PPI), D)
-#define pp_parameter_declaration(PPI, T) \
- (*pp_c_base (PPI)->parameter_declaration) (pp_c_base (PPI), T)
+ pp_c_base (PPI)->direct_declarator (pp_c_base (PPI), D)
+#define pp_direct_abstract_declarator(PP, D) \
+ pp_c_base (PP)->direct_abstract_declarator (pp_c_base (PP), D)
+#define pp_ptr_operator(PP, D) \
+ pp_c_base (PP)->ptr_operator (pp_c_base (PP), D)
+#define pp_parameter_list(PPI, T) \
+ pp_c_base (PPI)->parameter_list (pp_c_base (PPI), T)
#define pp_type_id(PPI, D) \
- (*pp_c_base (PPI)->type_id) (pp_c_base (PPI), D)
+ pp_c_base (PPI)->type_id (pp_c_base (PPI), D)
+#define pp_simple_type_specifier(PP, T) \
+ pp_c_base (PP)->simple_type_specifier (pp_c_base (PP), T)
+#define pp_function_specifier(PP, D) \
+ pp_c_base (PP)->function_specifier (pp_c_base (PP), D)
+#define pp_storage_class_specifier(PP, D) \
+ pp_c_base (PP)->storage_class_specifier (pp_c_base (PP), D);
#define pp_statement(PPI, S) \
- (*pp_c_base (PPI)->statement) (pp_c_base (PPI), S)
+ pp_c_base (PPI)->statement (pp_c_base (PPI), S)
+#define pp_id_expression(PP, E) \
+ pp_c_base (PP)->id_expression (pp_c_base (PP), E)
#define pp_primary_expression(PPI, E) \
- (*pp_c_base (PPI)->primary_expression) (pp_c_base (PPI), E)
+ pp_c_base (PPI)->primary_expression (pp_c_base (PPI), E)
#define pp_postfix_expression(PPI, E) \
- (*pp_c_base (PPI)->postfix_expression) (pp_c_base (PPI), E)
+ pp_c_base (PPI)->postfix_expression (pp_c_base (PPI), E)
#define pp_unary_expression(PPI, E) \
- (*pp_c_base (PPI)->unary_expression) (pp_c_base (PPI), E)
+ pp_c_base (PPI)->unary_expression (pp_c_base (PPI), E)
#define pp_initializer(PPI, E) \
- (*pp_c_base (PPI)->initializer) (pp_c_base (PPI), E)
+ pp_c_base (PPI)->initializer (pp_c_base (PPI), E)
#define pp_multiplicative_expression(PPI, E) \
- (*pp_c_base (PPI)->multiplicative_expression) (pp_c_base (PPI), E)
+ pp_c_base (PPI)->multiplicative_expression (pp_c_base (PPI), E)
#define pp_conditional_expression(PPI, E) \
- (*pp_c_base (PPI)->conditional_expression) (pp_c_base (PPI), E)
+ pp_c_base (PPI)->conditional_expression (pp_c_base (PPI), E)
#define pp_assignment_expression(PPI, E) \
- (*pp_c_base (PPI)->assignment_expression) (pp_c_base (PPI), E)
+ pp_c_base (PPI)->assignment_expression (pp_c_base (PPI), E)
+#define pp_expression(PP, E) \
+ pp_c_base (PP)->expression (pp_c_base (PP), E)
/* Returns the c_pretty_printer base object of PRETTY-PRINTER. This
macro must be overridden by any subclass of c_pretty_print_info. */
#define pp_c_base(PP) (PP)
-extern void pp_c_pretty_printer_init (c_pretty_printer);
+extern void pp_c_pretty_printer_init (c_pretty_printer *);
+void pp_c_whitespace (c_pretty_printer *);
+void pp_c_left_paren (c_pretty_printer *);
+void pp_c_right_paren (c_pretty_printer *);
+void pp_c_left_brace (c_pretty_printer *);
+void pp_c_right_brace (c_pretty_printer *);
+void pp_c_dot (c_pretty_printer *);
+void pp_c_ampersand (c_pretty_printer *);
+void pp_c_arrow (c_pretty_printer *);
+void pp_c_semicolon (c_pretty_printer *);
+void pp_c_space_for_pointer_operator (c_pretty_printer *, tree);
/* Declarations. */
-void pp_c_attributes (c_pretty_printer, tree);
-void pp_c_cv_qualifier (c_pretty_printer, int);
-void pp_c_parameter_declaration_clause (c_pretty_printer, tree);
-void pp_c_declaration (c_pretty_printer, tree);
+void pp_c_function_definition (c_pretty_printer *, tree);
+void pp_c_attributes (c_pretty_printer *, tree);
+void pp_c_type_qualifier_list (c_pretty_printer *, tree);
+void pp_c_parameter_type_list (c_pretty_printer *, tree);
+void pp_c_declaration (c_pretty_printer *, tree);
+void pp_c_declaration_specifiers (c_pretty_printer *, tree);
+void pp_c_declarator (c_pretty_printer *, tree);
+void pp_c_direct_declarator (c_pretty_printer *, tree);
+void pp_c_specifier_qualifier_list (c_pretty_printer *, tree);
+void pp_c_function_specifier (c_pretty_printer *, tree);
+void pp_c_type_id (c_pretty_printer *, tree);
+void pp_c_direct_abstract_declarator (c_pretty_printer *, tree);
+void pp_c_type_specifier (c_pretty_printer *, tree);
+void pp_c_storage_class_specifier (c_pretty_printer *, tree);
/* Statements. */
-void pp_c_statement (c_pretty_printer, tree);
+void pp_c_statement (c_pretty_printer *, tree);
/* Expressions. */
-void pp_c_expression (c_pretty_printer, tree);
-void pp_c_logical_or_expression (c_pretty_printer, tree);
-void pp_c_expression_list (c_pretty_printer, tree);
-void pp_c_cast_expression (c_pretty_printer, tree);
-void pp_c_postfix_expression (c_pretty_printer, tree);
-void pp_c_initializer (c_pretty_printer, tree);
-void pp_c_literal (c_pretty_printer, tree);
+void pp_c_expression (c_pretty_printer *, tree);
+void pp_c_logical_or_expression (c_pretty_printer *, tree);
+void pp_c_expression_list (c_pretty_printer *, tree);
+void pp_c_call_argument_list (c_pretty_printer *, tree);
+void pp_c_unary_expression (c_pretty_printer *, tree);
+void pp_c_cast_expression (c_pretty_printer *, tree);
+void pp_c_postfix_expression (c_pretty_printer *, tree);
+void pp_c_primary_expression (c_pretty_printer *, tree);
+void pp_c_init_declarator (c_pretty_printer *, tree);
+void pp_c_constant (c_pretty_printer *, tree);
+void pp_c_id_expression (c_pretty_printer *, tree);
+void pp_c_identifier (c_pretty_printer *, const char *);
+void pp_c_string_literal (c_pretty_printer *, tree);
#endif /* GCC_C_PRETTY_PRINTER */
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index 933ed50f27f..4163d449199 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -645,6 +645,7 @@ genrtl_scope_stmt (tree t)
if (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_CONTEXT (fn) == current_function_decl
&& DECL_SAVED_INSNS (fn)
+ && DECL_SAVED_INSNS (fn)->saved_for_inline
&& !TREE_ASM_WRITTEN (fn)
&& TREE_ADDRESSABLE (fn))
{
@@ -668,7 +669,7 @@ genrtl_switch_stmt (tree t)
if (cond == error_mark_node)
/* The code is in error, but we don't want expand_end_case to
crash. */
- cond = boolean_false_node;
+ cond = truthvalue_false_node;
emit_line_note (input_location);
expand_start_case (1, cond, TREE_TYPE (cond), "switch statement");
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 593877aee73..f1803edde3d 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -46,7 +46,7 @@ struct lang_identifier GTY(())
union lang_tree_node
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
+ 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)")))
@@ -58,7 +58,6 @@ union lang_tree_node
struct lang_decl GTY(())
{
- struct c_lang_decl base;
/* The return types and parameter types may have variable size.
This is a list of any SAVE_EXPRs that need to be evaluated to
compute those sizes. */
@@ -95,22 +94,19 @@ struct lang_decl GTY(())
nonzero if the definition of the type has already started. */
#define C_TYPE_BEING_DEFINED(TYPE) TYPE_LANG_FLAG_0 (TYPE)
+/* In an incomplete RECORD_TYPE or UNION_TYPE, a list of variable
+ declarations whose type would be completed by completing that type. */
+#define C_TYPE_INCOMPLETE_VARS(TYPE) TYPE_VFIELD (TYPE)
+
/* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
keyword. C_RID_CODE (node) is then the RID_* value of the keyword,
and C_RID_YYCODE is the token number wanted by Yacc. */
#define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_0 (ID)
-/* This function was declared inline. This flag controls the linkage
- semantics of 'inline'; whether or not the function is inlined is
- controlled by DECL_INLINE. */
-#define DECL_DECLARED_INLINE_P(NODE) \
- (DECL_LANG_SPECIFIC (NODE)->base.declared_inline)
-
/* In a RECORD_TYPE, a sorted array of the fields of the type. */
struct lang_type GTY(())
{
- int len;
- tree GTY((length ("%h.len"))) elts[1];
+ struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s;
};
/* Record whether a type or decl was written with nonconstant size.
@@ -151,13 +147,17 @@ struct lang_type GTY(())
without prototypes. */
#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_BINFO (NODE)
+/* Values for the first parameter to poplevel. */
+#define KEEP_NO 0
+#define KEEP_YES 1
+#define KEEP_MAYBE 2
+
/* in c-lang.c and objc-act.c */
extern tree lookup_interface (tree);
extern tree is_class_name (tree);
-extern tree objc_is_id (tree);
+extern tree objc_is_object_ptr (tree);
extern void objc_check_decl (tree);
-extern void finish_file (void);
extern int objc_comptypes (tree, tree, int);
extern tree objc_message_selector (void);
extern tree lookup_objc_ivar (tree);
@@ -172,27 +172,27 @@ extern void gen_aux_info_record (tree, int, int, int);
/* in c-decl.c */
extern int global_bindings_p (void);
-extern int kept_level_p (void);
extern tree getdecls (void);
extern void pushlevel (int);
extern void insert_block (tree);
extern void set_block (tree);
extern tree pushdecl (tree);
-extern void c_insert_default_attributes (tree);
extern void c_init_decl_processing (void);
extern void c_dup_lang_specific_decl (tree);
extern void c_print_identifier (FILE *, tree, int);
extern tree build_array_declarator (tree, tree, int, int);
extern tree build_enumerator (tree, tree);
extern void check_for_loop_decls (void);
-extern void clear_parm_order (void);
+extern void mark_forward_parm_decls (void);
extern int complete_array_type (tree, tree, int);
-extern void declare_parm_level (int);
+extern void declare_parm_level (void);
+extern void undeclared_variable (tree);
+extern tree declare_label (tree);
extern tree define_label (location_t, tree);
extern void finish_decl (tree, tree, tree);
extern tree finish_enum (tree, tree, tree);
-extern void finish_function (int, int);
+extern void finish_function (void);
extern tree finish_struct (tree, tree, tree);
extern tree get_parm_info (int);
extern tree grokfield (tree, tree, tree);
@@ -202,18 +202,13 @@ extern tree implicitly_declare (tree);
extern int in_parm_level_p (void);
extern void keep_next_level (void);
extern tree lookup_name (tree);
-extern void parmlist_tags_warning (void);
extern void pending_xref_error (void);
extern void c_push_function_context (struct function *);
extern void c_pop_function_context (struct function *);
-extern void pop_label_level (void);
-extern void push_label_level (void);
extern void push_parm_decl (tree);
extern tree pushdecl_top_level (tree);
-extern tree pushdecl_function_level (tree, tree);
extern void pushtag (tree, tree);
extern tree set_array_declarator_type (tree, tree, int);
-extern tree shadow_label (tree);
extern void shadow_tag (tree);
extern void shadow_tag_warned (tree, int);
extern tree start_enum (tree);
@@ -225,7 +220,9 @@ extern tree xref_tag (enum tree_code, tree);
extern tree c_begin_compound_stmt (void);
extern void c_expand_deferred_function (tree);
extern void c_expand_decl_stmt (tree);
+extern void c_static_assembler_name (tree);
extern tree make_pointer_declarator (tree, tree);
+extern void merge_translation_unit_decls (void);
/* in c-objc-common.c */
extern int c_disregard_inline_limits (tree);
@@ -242,9 +239,16 @@ extern bool c_warn_unused_global_decl (tree);
((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
#define c_sizeof_nowarn(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 0)
+
/* in c-typeck.c */
+
+/* For use with comptypes. */
+enum {
+ COMPARE_STRICT = 0
+};
+
extern tree require_complete_type (tree);
-extern int comptypes (tree, tree);
+extern int comptypes (tree, tree, int);
extern tree c_size_in_bytes (tree);
extern bool c_mark_addressable (tree);
extern void c_incomplete_type_error (tree, tree);
@@ -273,6 +277,7 @@ extern void set_init_index (tree, tree);
extern void set_init_label (tree);
extern void process_init_element (tree);
extern tree build_compound_literal (tree, tree);
+extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_PRINTF_1;
extern tree c_start_case (tree);
extern void c_finish_case (void);
@@ -301,6 +306,9 @@ extern int system_header_p;
/* In c-decl.c */
extern void c_finish_incomplete_decl (tree);
+extern void *get_current_scope (void);
+extern void objc_mark_locals_volatile (void *);
+extern void c_write_global_declarations (void);
extern GTY(()) tree static_ctors;
extern GTY(()) tree static_dtors;
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 718bd8f5986..51887599caa 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -49,17 +49,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
message within this initializer. */
static int missing_braces_mentioned;
-/* 1 if we explained undeclared var errors. */
-static int undeclared_variable_notice;
-
static tree qualify_type (tree, tree);
+static int same_translation_unit_p (tree, tree);
+static int tagged_types_tu_compatible_p (tree, tree, int);
static int comp_target_types (tree, tree, int);
-static int function_types_compatible_p (tree, tree);
-static int type_lists_compatible_p (tree, tree);
+static int function_types_compatible_p (tree, tree, int);
+static int type_lists_compatible_p (tree, tree, int);
static tree decl_constant_value_for_broken_optimization (tree);
static tree default_function_array_conversion (tree);
static tree lookup_field (tree, tree);
-static void undeclared_variable (tree);
static tree convert_arguments (tree, tree, tree, tree);
static tree pointer_diff (tree, tree);
static tree unary_complex_lvalue (enum tree_code, tree, int);
@@ -374,7 +372,7 @@ common_type (tree t1, tree t2)
lists, argument by argument. */
pushlevel (0);
- declare_parm_level (1);
+ declare_parm_level ();
len = list_length (p1);
newargs = 0;
@@ -409,7 +407,8 @@ common_type (tree t1, tree t2)
tree memb;
for (memb = TYPE_FIELDS (TREE_VALUE (p1));
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), TREE_VALUE (p2)))
+ if (comptypes (TREE_TYPE (memb), TREE_VALUE (p2),
+ COMPARE_STRICT))
{
TREE_VALUE (n) = TREE_VALUE (p2);
if (pedantic)
@@ -423,7 +422,8 @@ common_type (tree t1, tree t2)
tree memb;
for (memb = TYPE_FIELDS (TREE_VALUE (p2));
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), TREE_VALUE (p1)))
+ if (comptypes (TREE_TYPE (memb), TREE_VALUE (p1),
+ COMPARE_STRICT))
{
TREE_VALUE (n) = TREE_VALUE (p1);
if (pedantic)
@@ -452,7 +452,7 @@ common_type (tree t1, tree t2)
but a warning may be needed if you use them together. */
int
-comptypes (tree type1, tree type2)
+comptypes (tree type1, tree type2, int flags)
{
tree t1 = type1;
tree t2 = type2;
@@ -511,12 +511,16 @@ comptypes (tree type1, tree type2)
switch (TREE_CODE (t1))
{
case POINTER_TYPE:
+ /* We must give ObjC the first crack at comparing pointers, since
+ protocol qualifiers may be involved. */
+ if (c_dialect_objc () && (val = objc_comptypes (t1, t2, 0)) >= 0)
+ break;
val = (TREE_TYPE (t1) == TREE_TYPE (t2)
- ? 1 : comptypes (TREE_TYPE (t1), TREE_TYPE (t2)));
+ ? 1 : comptypes (TREE_TYPE (t1), TREE_TYPE (t2), flags));
break;
case FUNCTION_TYPE:
- val = function_types_compatible_p (t1, t2);
+ val = function_types_compatible_p (t1, t2, flags);
break;
case ARRAY_TYPE:
@@ -529,7 +533,8 @@ comptypes (tree type1, tree type2)
/* Target types must match incl. qualifiers. */
if (TREE_TYPE (t1) != TREE_TYPE (t2)
- && 0 == (val = comptypes (TREE_TYPE (t1), TREE_TYPE (t2))))
+ && 0 == (val = comptypes (TREE_TYPE (t1), TREE_TYPE (t2),
+ flags)))
return 0;
/* Sizes must match unless one is missing or variable. */
@@ -559,8 +564,15 @@ comptypes (tree type1, tree type2)
}
case RECORD_TYPE:
+ /* We are dealing with two distinct structs. In assorted Objective-C
+ corner cases, however, these can still be deemed equivalent. */
if (c_dialect_objc () && objc_comptypes (t1, t2, 0) == 1)
val = 1;
+
+ case ENUMERAL_TYPE:
+ case UNION_TYPE:
+ if (val != 1 && !same_translation_unit_p (t1, t2))
+ val = tagged_types_tu_compatible_p (t1, t2, flags);
break;
case VECTOR_TYPE:
@@ -592,7 +604,7 @@ comp_target_types (tree ttl, tree ttr, int reflexive)
return val;
val = comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (ttl)),
- TYPE_MAIN_VARIANT (TREE_TYPE (ttr)));
+ TYPE_MAIN_VARIANT (TREE_TYPE (ttr)), COMPARE_STRICT);
if (val == 2 && pedantic)
pedwarn ("types are not quite compatible");
@@ -601,6 +613,187 @@ comp_target_types (tree ttl, tree ttr, int reflexive)
/* Subroutines of `comptypes'. */
+/* Determine whether two types derive from the same translation unit.
+ If the CONTEXT chain ends in a null, that type's context is still
+ being parsed, so if two types have context chains ending in null,
+ they're in the same translation unit. */
+static int
+same_translation_unit_p (tree t1, tree t2)
+{
+ while (t1 && TREE_CODE (t1) != TRANSLATION_UNIT_DECL)
+ switch (TREE_CODE_CLASS (TREE_CODE (t1)))
+ {
+ case 'd': t1 = DECL_CONTEXT (t1); break;
+ case 't': t1 = TYPE_CONTEXT (t1); break;
+ case 'b': t1 = BLOCK_SUPERCONTEXT (t1); break;
+ default: abort ();
+ }
+
+ while (t2 && TREE_CODE (t2) != TRANSLATION_UNIT_DECL)
+ switch (TREE_CODE_CLASS (TREE_CODE (t2)))
+ {
+ case 'd': t2 = DECL_CONTEXT (t1); break;
+ case 't': t2 = TYPE_CONTEXT (t2); break;
+ case 'b': t2 = BLOCK_SUPERCONTEXT (t2); break;
+ default: abort ();
+ }
+
+ return t1 == t2;
+}
+
+/* The C standard says that two structures in different translation
+ units are compatible with each other only if the types of their
+ fields are compatible (among other things). So, consider two copies
+ of this structure: */
+
+struct tagged_tu_seen {
+ const struct tagged_tu_seen * next;
+ tree t1;
+ tree t2;
+};
+
+/* Can they be compatible with each other? We choose to break the
+ recursion by allowing those types to be compatible. */
+
+static const struct tagged_tu_seen * tagged_tu_seen_base;
+
+/* Return 1 if two 'struct', 'union', or 'enum' types T1 and T2 are
+ compatible. If the two types are not the same (which has been
+ checked earlier), this can only happen when multiple translation
+ units are being compiled. See C99 6.2.7 paragraph 1 for the exact
+ rules. */
+
+static int
+tagged_types_tu_compatible_p (tree t1, tree t2, int flags)
+{
+ tree s1, s2;
+ bool needs_warning = false;
+
+ /* We have to verify that the tags of the types are the same. This
+ is harder than it looks because this may be a typedef, so we have
+ to go look at the original type. It may even be a typedef of a
+ typedef... */
+ while (TYPE_NAME (t1) && TREE_CODE (TYPE_NAME (t1)) == TYPE_DECL)
+ t1 = DECL_ORIGINAL_TYPE (TYPE_NAME (t1));
+
+ while (TYPE_NAME (t2) && TREE_CODE (TYPE_NAME (t2)) == TYPE_DECL)
+ t2 = DECL_ORIGINAL_TYPE (TYPE_NAME (t2));
+
+ /* C90 didn't have the requirement that the two tags be the same. */
+ if (flag_isoc99 && TYPE_NAME (t1) != TYPE_NAME (t2))
+ return 0;
+
+ /* C90 didn't say what happened if one or both of the types were
+ incomplete; we choose to follow C99 rules here, which is that they
+ are compatible. */
+ if (TYPE_SIZE (t1) == NULL
+ || TYPE_SIZE (t2) == NULL)
+ return 1;
+
+ {
+ const struct tagged_tu_seen * tts_i;
+ for (tts_i = tagged_tu_seen_base; tts_i != NULL; tts_i = tts_i->next)
+ if (tts_i->t1 == t1 && tts_i->t2 == t2)
+ return 1;
+ }
+
+ switch (TREE_CODE (t1))
+ {
+ case ENUMERAL_TYPE:
+ {
+ if (list_length (TYPE_VALUES (t1)) != list_length (TYPE_VALUES (t2)))
+ return 0;
+
+ for (s1 = TYPE_VALUES (t1); s1; s1 = TREE_CHAIN (s1))
+ {
+ s2 = purpose_member (TREE_PURPOSE (s1), TYPE_VALUES (t2));
+ if (s2 == NULL
+ || simple_cst_equal (TREE_VALUE (s1), TREE_VALUE (s2)) != 1)
+ return 0;
+ }
+ return 1;
+ }
+
+ case UNION_TYPE:
+ {
+ if (list_length (TYPE_FIELDS (t1)) != list_length (TYPE_FIELDS (t2)))
+ return 0;
+
+ for (s1 = TYPE_FIELDS (t1); s1; s1 = TREE_CHAIN (s1))
+ {
+ bool ok = false;
+ struct tagged_tu_seen tts;
+
+ tts.next = tagged_tu_seen_base;
+ tts.t1 = t1;
+ tts.t2 = t2;
+ tagged_tu_seen_base = &tts;
+
+ if (DECL_NAME (s1) != NULL)
+ for (s2 = TYPE_VALUES (t2); s2; s2 = TREE_CHAIN (s2))
+ if (DECL_NAME (s1) == DECL_NAME (s2))
+ {
+ int result;
+ result = comptypes (TREE_TYPE (s1), TREE_TYPE (s2), flags);
+ if (result == 0)
+ break;
+ if (result == 2)
+ needs_warning = true;
+
+ if (TREE_CODE (s1) == FIELD_DECL
+ && simple_cst_equal (DECL_FIELD_BIT_OFFSET (s1),
+ DECL_FIELD_BIT_OFFSET (s2)) != 1)
+ break;
+
+ ok = true;
+ break;
+ }
+ tagged_tu_seen_base = tts.next;
+ if (! ok)
+ return 0;
+ }
+ return needs_warning ? 2 : 1;
+ }
+
+ case RECORD_TYPE:
+ {
+ struct tagged_tu_seen tts;
+
+ tts.next = tagged_tu_seen_base;
+ tts.t1 = t1;
+ tts.t2 = t2;
+ tagged_tu_seen_base = &tts;
+
+ for (s1 = TYPE_FIELDS (t1), s2 = TYPE_FIELDS (t2);
+ s1 && s2;
+ s1 = TREE_CHAIN (s1), s2 = TREE_CHAIN (s2))
+ {
+ int result;
+ if (TREE_CODE (s1) != TREE_CODE (s2)
+ || DECL_NAME (s1) != DECL_NAME (s2))
+ break;
+ result = comptypes (TREE_TYPE (s1), TREE_TYPE (s2), flags);
+ if (result == 0)
+ break;
+ if (result == 2)
+ needs_warning = true;
+
+ if (TREE_CODE (s1) == FIELD_DECL
+ && simple_cst_equal (DECL_FIELD_BIT_OFFSET (s1),
+ DECL_FIELD_BIT_OFFSET (s2)) != 1)
+ break;
+ }
+ tagged_tu_seen_base = tts.next;
+ if (s1 && s2)
+ return 0;
+ return needs_warning ? 2 : 1;
+ }
+
+ default:
+ abort ();
+ }
+}
+
/* Return 1 if two function types F1 and F2 are compatible.
If either type specifies no argument types,
the other must specify a fixed number of self-promoting arg types.
@@ -609,7 +802,7 @@ comp_target_types (tree ttl, tree ttr, int reflexive)
Otherwise, the argument types must match. */
static int
-function_types_compatible_p (tree f1, tree f2)
+function_types_compatible_p (tree f1, tree f2, int flags)
{
tree args1, args2;
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
@@ -630,7 +823,7 @@ function_types_compatible_p (tree f1, tree f2)
if (TYPE_VOLATILE (ret2))
ret2 = build_qualified_type (TYPE_MAIN_VARIANT (ret2),
TYPE_QUALS (ret2) & ~TYPE_QUAL_VOLATILE);
- val = comptypes (ret1, ret2);
+ val = comptypes (ret1, ret2, flags);
if (val == 0)
return 0;
@@ -648,7 +841,8 @@ function_types_compatible_p (tree f1, tree f2)
compare that with the other type's arglist.
If they don't match, ask for a warning (but no error). */
if (TYPE_ACTUAL_ARG_TYPES (f1)
- && 1 != type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1)))
+ && 1 != type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1),
+ flags))
val = 2;
return val;
}
@@ -657,13 +851,14 @@ function_types_compatible_p (tree f1, tree f2)
if (!self_promoting_args_p (args1))
return 0;
if (TYPE_ACTUAL_ARG_TYPES (f2)
- && 1 != type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2)))
+ && 1 != type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2),
+ flags))
val = 2;
return val;
}
/* Both types have argument lists: compare them and propagate results. */
- val1 = type_lists_compatible_p (args1, args2);
+ val1 = type_lists_compatible_p (args1, args2, flags);
return val1 != 1 ? val1 : val;
}
@@ -672,7 +867,7 @@ function_types_compatible_p (tree f1, tree f2)
or 2 for compatible with warning. */
static int
-type_lists_compatible_p (tree args1, tree args2)
+type_lists_compatible_p (tree args1, tree args2, int flags)
{
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
int val = 1;
@@ -700,8 +895,13 @@ type_lists_compatible_p (tree args1, tree args2)
if (c_type_promotes_to (TREE_VALUE (args1)) != TREE_VALUE (args1))
return 0;
}
+ /* If one of the lists has an error marker, ignore this arg. */
+ else if (TREE_CODE (TREE_VALUE (args1)) == ERROR_MARK
+ || TREE_CODE (TREE_VALUE (args2)) == ERROR_MARK)
+ ;
else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)),
- TYPE_MAIN_VARIANT (TREE_VALUE (args2)))))
+ TYPE_MAIN_VARIANT (TREE_VALUE (args2)),
+ flags)))
{
/* Allow wait (union {union wait *u; int *i} *)
and wait (union wait *) to be compatible. */
@@ -715,7 +915,8 @@ type_lists_compatible_p (tree args1, tree args2)
tree memb;
for (memb = TYPE_FIELDS (TREE_VALUE (args1));
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), TREE_VALUE (args2)))
+ if (comptypes (TREE_TYPE (memb), TREE_VALUE (args2),
+ flags))
break;
if (memb == 0)
return 0;
@@ -730,7 +931,8 @@ type_lists_compatible_p (tree args1, tree args2)
tree memb;
for (memb = TYPE_FIELDS (TREE_VALUE (args2));
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), TREE_VALUE (args1)))
+ if (comptypes (TREE_TYPE (memb), TREE_VALUE (args1),
+ flags))
break;
if (memb == 0)
return 0;
@@ -1016,11 +1218,11 @@ lookup_field (tree decl, tree component)
if (TYPE_LANG_SPECIFIC (type))
{
int bot, top, half;
- tree *field_array = &TYPE_LANG_SPECIFIC (type)->elts[0];
+ tree *field_array = &TYPE_LANG_SPECIFIC (type)->s->elts[0];
field = TYPE_FIELDS (type);
bot = 0;
- top = TYPE_LANG_SPECIFIC (type)->len;
+ top = TYPE_LANG_SPECIFIC (type)->s->len;
while (top - bot > 1)
{
half = (top - bot + 1) >> 1;
@@ -1364,37 +1566,6 @@ build_array_ref (tree array, tree index)
}
}
-/* Issue an error message for a reference to an undeclared variable ID,
- including a reference to a builtin outside of function-call context.
- Arrange to suppress further errors for the same identifier. */
-static void
-undeclared_variable (tree id)
-{
- if (current_function_decl == 0)
- {
- error ("`%s' undeclared here (not in a function)",
- IDENTIFIER_POINTER (id));
- IDENTIFIER_SYMBOL_VALUE (id) = error_mark_node;
- }
- else
- {
- error ("`%s' undeclared (first use in this function)",
- IDENTIFIER_POINTER (id));
-
- if (! undeclared_variable_notice)
- {
- error ("(Each undeclared identifier is reported only once");
- error ("for each function it appears in.)");
- undeclared_variable_notice = 1;
- }
-
- /* Set IDENTIFIER_SYMBOL_VALUE (id) to error_mark_node
- at function scope. This suppresses further warnings
- about this undeclared identifier in this function. */
- pushdecl_function_level (error_mark_node, id);
- }
-}
-
/* Build an external reference to identifier ID. FUN indicates
whether this will be used for a function call. */
tree
@@ -1409,7 +1580,7 @@ build_external_ref (tree id, int fun)
/* Properly declared variable or function reference. */
if (!objc_ivar)
ref = decl;
- else if (decl != objc_ivar && DECL_CONTEXT (decl) != 0)
+ else if (decl != objc_ivar && !DECL_FILE_SCOPE_P (decl))
{
warning ("local declaration of `%s' hides instance variable",
IDENTIFIER_POINTER (id));
@@ -1449,7 +1620,7 @@ build_external_ref (tree id, int fun)
TREE_CONSTANT (ref) = 1;
}
else if (current_function_decl != 0
- && DECL_CONTEXT (current_function_decl) != 0
+ && !DECL_FILE_SCOPE_P (current_function_decl)
&& (TREE_CODE (ref) == VAR_DECL
|| TREE_CODE (ref) == PARM_DECL
|| TREE_CODE (ref) == FUNCTION_DECL))
@@ -1701,7 +1872,7 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl)
(char *) 0, /* arg passing */
fundecl, name, parmnum + 1);
- if (PROMOTE_PROTOTYPES
+ if (targetm.calls.promote_prototypes (fundecl ? TREE_TYPE (fundecl) : 0)
&& INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
parmval = default_conversion (parmval);
@@ -1841,736 +2012,6 @@ parser_build_binary_op (enum tree_code code, tree arg1, tree arg2)
return result;
}
-
-/* Build a binary-operation expression without default conversions.
- CODE is the kind of expression to build.
- This function differs from `build' in several ways:
- the data type of the result is computed and recorded in it,
- warnings are generated if arg data types are invalid,
- special handling for addition and subtraction of pointers is known,
- and some optimization is done (operations on narrow ints
- are done in the narrower type when that gives the same result).
- Constant folding is also done before the result is returned.
-
- Note that the operands will never have enumeral types, or function
- or array types, because either they will have the default conversions
- performed or they have both just been converted to some other type in which
- the arithmetic is to be done. */
-
-tree
-build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
- int convert_p)
-{
- tree type0, type1;
- enum tree_code code0, code1;
- tree op0, op1;
-
- /* 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. */
- 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. */
- tree result_type = NULL;
-
- /* Nonzero means operands have already been type-converted
- in whatever way is necessary.
- Zero means they need to be converted to RESULT_TYPE. */
- int converted = 0;
-
- /* Nonzero means create the expression with this type, rather than
- RESULT_TYPE. */
- tree build_type = 0;
-
- /* Nonzero means after finally constructing the expression
- convert it to this type. */
- tree final_type = 0;
-
- /* Nonzero if this is an operation like MIN or MAX which can
- safely be computed in short if both args are promoted shorts.
- Also implies COMMON.
- -1 indicates a bitwise operation; this makes a difference
- in the exact conditions for when it is safe to do the operation
- in a narrower mode. */
- int shorten = 0;
-
- /* Nonzero if this is a comparison operation;
- if both args are promoted shorts, compare the original shorts.
- Also implies COMMON. */
- int short_compare = 0;
-
- /* Nonzero if this is a right-shift operation, which can be computed on the
- original short and then promoted if the operand is a promoted short. */
- int short_shift = 0;
-
- /* Nonzero means set RESULT_TYPE to the common type of the args. */
- int common = 0;
-
- if (convert_p)
- {
- op0 = default_conversion (orig_op0);
- op1 = default_conversion (orig_op1);
- }
- else
- {
- op0 = orig_op0;
- op1 = orig_op1;
- }
-
- type0 = TREE_TYPE (op0);
- type1 = TREE_TYPE (op1);
-
- /* The expression codes of the data types of the arguments tell us
- whether the arguments are integers, floating, pointers, etc. */
- code0 = TREE_CODE (type0);
- code1 = TREE_CODE (type1);
-
- /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
- STRIP_TYPE_NOPS (op0);
- STRIP_TYPE_NOPS (op1);
-
- /* If an error was already reported for one of the arguments,
- avoid reporting another error. */
-
- if (code0 == ERROR_MARK || code1 == ERROR_MARK)
- return error_mark_node;
-
- switch (code)
- {
- case PLUS_EXPR:
- /* Handle the pointer + int case. */
- if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
- return pointer_int_sum (PLUS_EXPR, op0, op1);
- else if (code1 == POINTER_TYPE && code0 == INTEGER_TYPE)
- return pointer_int_sum (PLUS_EXPR, op1, op0);
- else
- common = 1;
- break;
-
- case MINUS_EXPR:
- /* Subtraction of two similar pointers.
- We must subtract them as integers, then divide by object size. */
- if (code0 == POINTER_TYPE && code1 == POINTER_TYPE
- && comp_target_types (type0, type1, 1))
- return pointer_diff (op0, op1);
- /* Handle pointer minus int. Just like pointer plus int. */
- else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
- return pointer_int_sum (MINUS_EXPR, op0, op1);
- else
- common = 1;
- break;
-
- case MULT_EXPR:
- common = 1;
- break;
-
- case TRUNC_DIV_EXPR:
- case CEIL_DIV_EXPR:
- case FLOOR_DIV_EXPR:
- case ROUND_DIV_EXPR:
- case EXACT_DIV_EXPR:
- /* Floating point division by zero is a legitimate way to obtain
- infinities and NaNs. */
- if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
- warning ("division by zero");
-
- if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
- || code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE)
- && (code1 == INTEGER_TYPE || code1 == REAL_TYPE
- || code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
- {
- if (!(code0 == INTEGER_TYPE && code1 == INTEGER_TYPE))
- resultcode = RDIV_EXPR;
- else
- /* Although it would be tempting to shorten always here, that
- loses on some targets, since the modulo instruction is
- undefined if the quotient can't be represented in the
- computation mode. We shorten only if unsigned or if
- dividing by something we know != -1. */
- shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0))
- || (TREE_CODE (op1) == INTEGER_CST
- && ! integer_all_onesp (op1)));
- common = 1;
- }
- break;
-
- case BIT_AND_EXPR:
- case BIT_ANDTC_EXPR:
- case BIT_IOR_EXPR:
- case BIT_XOR_EXPR:
- if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
- shorten = -1;
- else if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE)
- common = 1;
- break;
-
- case TRUNC_MOD_EXPR:
- case FLOOR_MOD_EXPR:
- if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
- warning ("division by zero");
-
- if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
- {
- /* Although it would be tempting to shorten always here, that loses
- on some targets, since the modulo instruction is undefined if the
- quotient can't be represented in the computation mode. We shorten
- only if unsigned or if dividing by something we know != -1. */
- shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0))
- || (TREE_CODE (op1) == INTEGER_CST
- && ! integer_all_onesp (op1)));
- common = 1;
- }
- break;
-
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_OR_EXPR:
- case TRUTH_XOR_EXPR:
- if ((code0 == INTEGER_TYPE || code0 == POINTER_TYPE
- || code0 == REAL_TYPE || code0 == COMPLEX_TYPE)
- && (code1 == INTEGER_TYPE || code1 == POINTER_TYPE
- || code1 == REAL_TYPE || code1 == COMPLEX_TYPE))
- {
- /* Result of these operations is always an int,
- but that does not mean the operands should be
- converted to ints! */
- result_type = integer_type_node;
- op0 = c_common_truthvalue_conversion (op0);
- op1 = c_common_truthvalue_conversion (op1);
- converted = 1;
- }
- break;
-
- /* Shift operations: result has same type as first operand;
- always convert second operand to int.
- Also set SHORT_SHIFT if shifting rightward. */
-
- case RSHIFT_EXPR:
- if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
- {
- if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
- {
- if (tree_int_cst_sgn (op1) < 0)
- warning ("right shift count is negative");
- else
- {
- if (! integer_zerop (op1))
- short_shift = 1;
-
- if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
- warning ("right shift count >= width of type");
- }
- }
-
- /* Use the type of the value to be shifted. */
- result_type = type0;
- /* Convert the shift-count to an integer, regardless of size
- of value being shifted. */
- if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node)
- op1 = convert (integer_type_node, op1);
- /* Avoid converting op1 to result_type later. */
- converted = 1;
- }
- break;
-
- case LSHIFT_EXPR:
- if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
- {
- if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
- {
- if (tree_int_cst_sgn (op1) < 0)
- warning ("left shift count is negative");
-
- else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
- warning ("left shift count >= width of type");
- }
-
- /* Use the type of the value to be shifted. */
- result_type = type0;
- /* Convert the shift-count to an integer, regardless of size
- of value being shifted. */
- if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node)
- op1 = convert (integer_type_node, op1);
- /* Avoid converting op1 to result_type later. */
- converted = 1;
- }
- break;
-
- case RROTATE_EXPR:
- case LROTATE_EXPR:
- if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
- {
- if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
- {
- if (tree_int_cst_sgn (op1) < 0)
- warning ("shift count is negative");
- else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
- warning ("shift count >= width of type");
- }
-
- /* Use the type of the value to be shifted. */
- result_type = type0;
- /* Convert the shift-count to an integer, regardless of size
- of value being shifted. */
- if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node)
- op1 = convert (integer_type_node, op1);
- /* Avoid converting op1 to result_type later. */
- converted = 1;
- }
- break;
-
- case EQ_EXPR:
- case NE_EXPR:
- if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE))
- warning ("comparing floating point with == or != is unsafe");
- /* Result of comparison is always int,
- but don't convert the args to int! */
- build_type = integer_type_node;
- if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
- || code0 == COMPLEX_TYPE
- || code0 == VECTOR_TYPE)
- && (code1 == INTEGER_TYPE || code1 == REAL_TYPE
- || code1 == COMPLEX_TYPE
- || code1 == VECTOR_TYPE))
- short_compare = 1;
- else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
- {
- tree tt0 = TREE_TYPE (type0);
- tree tt1 = TREE_TYPE (type1);
- /* Anything compares with void *. void * compares with anything.
- Otherwise, the targets must be compatible
- and both must be object or both incomplete. */
- if (comp_target_types (type0, type1, 1))
- result_type = common_type (type0, type1);
- else if (VOID_TYPE_P (tt0))
- {
- /* op0 != orig_op0 detects the case of something
- whose value is 0 but which isn't a valid null ptr const. */
- if (pedantic && (!integer_zerop (op0) || op0 != orig_op0)
- && TREE_CODE (tt1) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids comparison of `void *' with function pointer");
- }
- else if (VOID_TYPE_P (tt1))
- {
- if (pedantic && (!integer_zerop (op1) || op1 != orig_op1)
- && TREE_CODE (tt0) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids comparison of `void *' with function pointer");
- }
- else
- pedwarn ("comparison of distinct pointer types lacks a cast");
-
- if (result_type == NULL_TREE)
- result_type = ptr_type_node;
- }
- else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST
- && integer_zerop (op1))
- result_type = type0;
- else if (code1 == POINTER_TYPE && TREE_CODE (op0) == INTEGER_CST
- && integer_zerop (op0))
- result_type = type1;
- else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
- {
- result_type = type0;
- pedwarn ("comparison between pointer and integer");
- }
- else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
- {
- result_type = type1;
- pedwarn ("comparison between pointer and integer");
- }
- break;
-
- case MAX_EXPR:
- case MIN_EXPR:
- if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE)
- && (code1 == INTEGER_TYPE || code1 == REAL_TYPE))
- shorten = 1;
- else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
- {
- if (comp_target_types (type0, type1, 1))
- {
- result_type = common_type (type0, type1);
- if (pedantic
- && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
- }
- else
- {
- result_type = ptr_type_node;
- pedwarn ("comparison of distinct pointer types lacks a cast");
- }
- }
- break;
-
- case LE_EXPR:
- case GE_EXPR:
- case LT_EXPR:
- case GT_EXPR:
- build_type = integer_type_node;
- if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE)
- && (code1 == INTEGER_TYPE || code1 == REAL_TYPE))
- short_compare = 1;
- else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
- {
- if (comp_target_types (type0, type1, 1))
- {
- result_type = common_type (type0, type1);
- if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
- != !COMPLETE_TYPE_P (TREE_TYPE (type1)))
- pedwarn ("comparison of complete and incomplete pointers");
- else if (pedantic
- && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
- }
- else
- {
- result_type = ptr_type_node;
- pedwarn ("comparison of distinct pointer types lacks a cast");
- }
- }
- else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST
- && integer_zerop (op1))
- {
- result_type = type0;
- if (pedantic || extra_warnings)
- pedwarn ("ordered comparison of pointer with integer zero");
- }
- else if (code1 == POINTER_TYPE && TREE_CODE (op0) == INTEGER_CST
- && integer_zerop (op0))
- {
- result_type = type1;
- if (pedantic)
- pedwarn ("ordered comparison of pointer with integer zero");
- }
- else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
- {
- result_type = type0;
- pedwarn ("comparison between pointer and integer");
- }
- else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
- {
- result_type = type1;
- pedwarn ("comparison between pointer and integer");
- }
- break;
-
- case UNORDERED_EXPR:
- case ORDERED_EXPR:
- case UNLT_EXPR:
- case UNLE_EXPR:
- case UNGT_EXPR:
- case UNGE_EXPR:
- case UNEQ_EXPR:
- build_type = integer_type_node;
- if (code0 != REAL_TYPE || code1 != REAL_TYPE)
- {
- error ("unordered comparison on non-floating point argument");
- return error_mark_node;
- }
- common = 1;
- break;
-
- default:
- break;
- }
-
- if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE
- || code0 == VECTOR_TYPE)
- &&
- (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE
- || code1 == VECTOR_TYPE))
- {
- int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE);
-
- if (shorten || common || short_compare)
- result_type = common_type (type0, type1);
-
- /* For certain operations (which identify themselves by shorten != 0)
- if both args were extended from the same smaller type,
- do the arithmetic in that type and then extend.
-
- shorten !=0 and !=1 indicates a bitwise operation.
- For them, this optimization is safe only if
- both args are zero-extended or both are sign-extended.
- Otherwise, we might change the result.
- Eg, (short)-1 | (unsigned short)-1 is (int)-1
- but calculated in (unsigned short) it would be (unsigned short)-1. */
-
- if (shorten && none_complex)
- {
- int unsigned0, unsigned1;
- tree arg0 = get_narrower (op0, &unsigned0);
- tree arg1 = get_narrower (op1, &unsigned1);
- /* UNS is 1 if the operation to be done is an unsigned one. */
- int uns = TREE_UNSIGNED (result_type);
- tree type;
-
- final_type = result_type;
-
- /* Handle the case that OP0 (or OP1) does not *contain* a conversion
- but it *requires* conversion to FINAL_TYPE. */
-
- if ((TYPE_PRECISION (TREE_TYPE (op0))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && TREE_TYPE (op0) != final_type)
- unsigned0 = TREE_UNSIGNED (TREE_TYPE (op0));
- if ((TYPE_PRECISION (TREE_TYPE (op1))
- == TYPE_PRECISION (TREE_TYPE (arg1)))
- && TREE_TYPE (op1) != final_type)
- unsigned1 = TREE_UNSIGNED (TREE_TYPE (op1));
-
- /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
-
- /* For bitwise operations, signedness of nominal type
- does not matter. Consider only how operands were extended. */
- if (shorten == -1)
- uns = unsigned0;
-
- /* Note that in all three cases below we refrain from optimizing
- an unsigned operation on sign-extended args.
- That would not be valid. */
-
- /* Both args variable: if both extended in same way
- from same width, do it in that width.
- Do it unsigned if args were zero-extended. */
- if ((TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && unsigned0 == unsigned1
- && (unsigned0 || !uns))
- result_type
- = c_common_signed_or_unsigned_type
- (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
- else if (TREE_CODE (arg0) == INTEGER_CST
- && (unsigned1 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- < TYPE_PRECISION (result_type))
- && (type
- = c_common_signed_or_unsigned_type (unsigned1,
- TREE_TYPE (arg1)),
- int_fits_type_p (arg0, type)))
- result_type = type;
- else if (TREE_CODE (arg1) == INTEGER_CST
- && (unsigned0 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (type
- = c_common_signed_or_unsigned_type (unsigned0,
- TREE_TYPE (arg0)),
- int_fits_type_p (arg1, type)))
- result_type = type;
- }
-
- /* Shifts can be shortened if shifting right. */
-
- if (short_shift)
- {
- int unsigned_arg;
- tree arg0 = get_narrower (op0, &unsigned_arg);
-
- final_type = result_type;
-
- if (arg0 == op0 && final_type == TREE_TYPE (op0))
- unsigned_arg = TREE_UNSIGNED (TREE_TYPE (op0));
-
- if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type)
- /* We can shorten only if the shift count is less than the
- number of bits in the smaller type size. */
- && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0
- /* We cannot drop an unsigned shift after sign-extension. */
- && (!TREE_UNSIGNED (final_type) || unsigned_arg))
- {
- /* Do an unsigned shift if the operand was zero-extended. */
- result_type
- = c_common_signed_or_unsigned_type (unsigned_arg,
- TREE_TYPE (arg0));
- /* Convert value-to-be-shifted to that type. */
- if (TREE_TYPE (op0) != result_type)
- op0 = convert (result_type, op0);
- converted = 1;
- }
- }
-
- /* Comparison operations are shortened too but differently.
- They identify themselves by setting short_compare = 1. */
-
- if (short_compare)
- {
- /* Don't write &op0, etc., because that would prevent op0
- from being kept in a register.
- Instead, make copies of the our local variables and
- pass the copies by reference, then copy them back afterward. */
- tree xop0 = op0, xop1 = op1, xresult_type = result_type;
- enum tree_code xresultcode = resultcode;
- tree val
- = shorten_compare (&xop0, &xop1, &xresult_type, &xresultcode);
-
- if (val != 0)
- return val;
-
- op0 = xop0, op1 = xop1;
- converted = 1;
- resultcode = xresultcode;
-
- if (warn_sign_compare && skip_evaluation == 0)
- {
- int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0));
- int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1));
- int unsignedp0, unsignedp1;
- tree primop0 = get_narrower (op0, &unsignedp0);
- tree primop1 = get_narrower (op1, &unsignedp1);
-
- xop0 = orig_op0;
- xop1 = orig_op1;
- STRIP_TYPE_NOPS (xop0);
- STRIP_TYPE_NOPS (xop1);
-
- /* Give warnings for comparisons between signed and unsigned
- quantities that may fail.
-
- Do the checking based on the original operand trees, so that
- casts will be considered, but default promotions won't be.
-
- Do not warn if the comparison is being done in a signed type,
- since the signed type will only be chosen if it can represent
- all the values of the unsigned type. */
- if (! TREE_UNSIGNED (result_type))
- /* OK */;
- /* Do not warn if both operands are the same signedness. */
- else if (op0_signed == op1_signed)
- /* OK */;
- else
- {
- tree sop, uop;
-
- if (op0_signed)
- sop = xop0, uop = xop1;
- else
- sop = xop1, uop = xop0;
-
- /* Do not warn if the signed quantity is an
- unsuffixed integer literal (or some static
- constant expression involving such literals or a
- conditional expression involving such literals)
- and it is non-negative. */
- if (c_tree_expr_nonnegative_p (sop))
- /* OK */;
- /* Do not warn if the comparison is an equality operation,
- the unsigned quantity is an integral constant, and it
- would fit in the result if the result were signed. */
- else if (TREE_CODE (uop) == INTEGER_CST
- && (resultcode == EQ_EXPR || resultcode == NE_EXPR)
- && int_fits_type_p
- (uop, c_common_signed_type (result_type)))
- /* OK */;
- /* Do not warn if the unsigned quantity is an enumeration
- constant and its maximum value would fit in the result
- if the result were signed. */
- else if (TREE_CODE (uop) == INTEGER_CST
- && TREE_CODE (TREE_TYPE (uop)) == ENUMERAL_TYPE
- && int_fits_type_p
- (TYPE_MAX_VALUE (TREE_TYPE(uop)),
- c_common_signed_type (result_type)))
- /* OK */;
- else
- warning ("comparison between signed and unsigned");
- }
-
- /* Warn if two unsigned values are being compared in a size
- larger than their original size, and one (and only one) is the
- result of a `~' operator. This comparison will always fail.
-
- Also warn if one operand is a constant, and the constant
- does not have all bits set that are set in the ~ operand
- when it is extended. */
-
- if ((TREE_CODE (primop0) == BIT_NOT_EXPR)
- != (TREE_CODE (primop1) == BIT_NOT_EXPR))
- {
- if (TREE_CODE (primop0) == BIT_NOT_EXPR)
- primop0 = get_narrower (TREE_OPERAND (primop0, 0),
- &unsignedp0);
- else
- primop1 = get_narrower (TREE_OPERAND (primop1, 0),
- &unsignedp1);
-
- if (host_integerp (primop0, 0) || host_integerp (primop1, 0))
- {
- tree primop;
- HOST_WIDE_INT constant, mask;
- int unsignedp, bits;
-
- if (host_integerp (primop0, 0))
- {
- primop = primop1;
- unsignedp = unsignedp1;
- constant = tree_low_cst (primop0, 0);
- }
- else
- {
- primop = primop0;
- unsignedp = unsignedp0;
- constant = tree_low_cst (primop1, 0);
- }
-
- bits = TYPE_PRECISION (TREE_TYPE (primop));
- if (bits < TYPE_PRECISION (result_type)
- && bits < HOST_BITS_PER_WIDE_INT && unsignedp)
- {
- mask = (~ (HOST_WIDE_INT) 0) << bits;
- if ((mask & constant) != mask)
- warning ("comparison of promoted ~unsigned with constant");
- }
- }
- else if (unsignedp0 && unsignedp1
- && (TYPE_PRECISION (TREE_TYPE (primop0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (primop1))
- < TYPE_PRECISION (result_type)))
- warning ("comparison of promoted ~unsigned with unsigned");
- }
- }
- }
- }
-
- /* At this point, RESULT_TYPE must be nonzero to avoid an error message.
- If CONVERTED is zero, both args will be converted to type RESULT_TYPE.
- Then the expression will be built.
- It will be given type FINAL_TYPE if that is nonzero;
- otherwise, it will be given type RESULT_TYPE. */
-
- if (!result_type)
- {
- binary_op_error (code);
- return error_mark_node;
- }
-
- if (! converted)
- {
- if (TREE_TYPE (op0) != result_type)
- op0 = convert (result_type, op0);
- if (TREE_TYPE (op1) != result_type)
- op1 = convert (result_type, op1);
- }
-
- if (build_type == NULL_TREE)
- build_type = result_type;
-
- {
- tree result = build (resultcode, build_type, op0, op1);
- tree folded;
-
- folded = fold (result);
- if (folded == result)
- TREE_CONSTANT (folded) = TREE_CONSTANT (op0) & TREE_CONSTANT (op1);
- if (final_type != 0)
- return convert (final_type, folded);
- return folded;
- }
-}
/* Return true if `t' is known to be non-negative. */
@@ -2746,8 +2187,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
break;
case ABS_EXPR:
- if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
- || typecode == COMPLEX_TYPE))
+ if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE))
{
error ("wrong type argument to abs");
return error_mark_node;
@@ -3031,7 +2471,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
file-scope function counts as a constant. */
if (staticp (arg)
&& ! (TREE_CODE (arg) == FUNCTION_DECL
- && DECL_CONTEXT (arg) != 0))
+ && !DECL_FILE_SCOPE_P (arg)))
TREE_CONSTANT (addr) = 1;
return addr;
}
@@ -3258,6 +2698,7 @@ c_mark_addressable (tree exp)
/* drops in */
case FUNCTION_DECL:
TREE_ADDRESSABLE (x) = 1;
+ /* drops out */
default:
return true;
}
@@ -3492,7 +2933,7 @@ build_c_cast (tree type, tree expr)
/* The ObjC front-end uses TYPE_MAIN_VARIANT to tie together types differing
only in <protocol> qualifications. But when constructing cast expressions,
the protocols do matter and must be kept around. */
- if (!c_dialect_objc () || !objc_is_id (type))
+ if (!c_dialect_objc () || !objc_is_object_ptr (type))
type = TYPE_MAIN_VARIANT (type);
if (TREE_CODE (type) == ARRAY_TYPE)
@@ -3523,7 +2964,7 @@ build_c_cast (tree type, tree expr)
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
if (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (field)),
- TYPE_MAIN_VARIANT (TREE_TYPE (value))))
+ TYPE_MAIN_VARIANT (TREE_TYPE (value)), COMPARE_STRICT))
break;
if (field)
@@ -3917,7 +3358,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
This code doesn't fully support references, it's just for the
special case of va_start and va_copy. */
if (codel == REFERENCE_TYPE
- && comptypes (TREE_TYPE (type), TREE_TYPE (rhs)) == 1)
+ && comptypes (TREE_TYPE (type), TREE_TYPE (rhs), COMPARE_STRICT) == 1)
{
if (!lvalue_p (rhs))
{
@@ -3966,7 +3407,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
tree memb_type = TREE_TYPE (memb_types);
if (comptypes (TYPE_MAIN_VARIANT (memb_type),
- TYPE_MAIN_VARIANT (rhstype)))
+ TYPE_MAIN_VARIANT (rhstype), COMPARE_STRICT))
break;
if (TREE_CODE (memb_type) != POINTER_TYPE)
@@ -4053,6 +3494,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
tree ttl = TREE_TYPE (type);
tree ttr = TREE_TYPE (rhstype);
bool is_opaque_pointer;
+ int target_cmp = 0; /* Cache comp_target_types () result. */
/* Opaque pointers are treated like void pointers. */
is_opaque_pointer = ((*targetm.vector_opaque_p) (type)
@@ -4064,7 +3506,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
and vice versa; otherwise, targets must be the same.
Meanwhile, the lhs target must have all the qualifiers of the rhs. */
if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr)
- || comp_target_types (type, rhstype, 0)
+ || (target_cmp = comp_target_types (type, rhstype, 0))
|| is_opaque_pointer
|| (c_common_unsigned_type (TYPE_MAIN_VARIANT (ttl))
== c_common_unsigned_type (TYPE_MAIN_VARIANT (ttr))))
@@ -4090,7 +3532,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
/* If this is not a case of ignoring a mismatch in signedness,
no warning. */
else if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr)
- || comp_target_types (type, rhstype, 0))
+ || target_cmp)
;
/* If there is a mismatch, do warn. */
else if (pedantic)
@@ -4180,7 +3622,7 @@ c_convert_parm_for_inlining (tree parm, tree value, tree fn)
ret = convert_for_assignment (type, value,
(char *) 0 /* arg passing */, fn,
DECL_NAME (fn), 0);
- if (PROMOTE_PROTOTYPES
+ if (targetm.calls.promote_prototypes (TREE_TYPE (fn))
&& INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
ret = default_conversion (ret);
@@ -4214,9 +3656,8 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'");
- new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
- + strlen (argstring) + 1
- + 1);
+ new_opname = alloca (IDENTIFIER_LENGTH (function)
+ + strlen (argstring) + 1 + 1);
sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function));
}
@@ -4224,7 +3665,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function");
- new_opname = (char *) alloca (strlen (argnofun) + 1 + 1);
+ new_opname = alloca (strlen (argnofun) + 1 + 1);
sprintf (new_opname, argnofun);
}
}
@@ -4232,9 +3673,8 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of `%s'");
- new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
- + strlen (argstring) + 1 + 25
- /*%d*/ + 1);
+ new_opname = alloca (IDENTIFIER_LENGTH (function)
+ + strlen (argstring) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function));
}
@@ -4242,7 +3682,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{
/* Function name unknown (call through ptr); just give arg number. */
const char *const argnofun = _("passing arg %d of pointer to function");
- new_opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
+ new_opname = alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argnofun, argnum);
}
opname = new_opname;
@@ -4374,12 +3814,10 @@ static int spelling_size; /* Size of the spelling stack. */
{ \
spelling_size += 10; \
if (spelling_base == 0) \
- spelling_base \
- = (struct spelling *) xmalloc (spelling_size * sizeof (struct spelling)); \
+ spelling_base = xmalloc (spelling_size * sizeof (struct spelling)); \
else \
- spelling_base \
- = (struct spelling *) xrealloc (spelling_base, \
- spelling_size * sizeof (struct spelling)); \
+ spelling_base = xrealloc (spelling_base, \
+ spelling_size * sizeof (struct spelling)); \
RESTORE_SPELLING_DEPTH (depth); \
} \
\
@@ -4469,7 +3907,7 @@ error_init (const char *msgid)
char *ofwhat;
error ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
error ("(near initialization for `%s')", ofwhat);
}
@@ -4484,7 +3922,7 @@ pedwarn_init (const char *msgid)
char *ofwhat;
pedwarn ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
pedwarn ("(near initialization for `%s')", ofwhat);
}
@@ -4499,7 +3937,7 @@ warning_init (const char *msgid)
char *ofwhat;
warning ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
warning ("(near initialization for `%s')", ofwhat);
}
@@ -4543,7 +3981,7 @@ digest_init (tree type, tree init, int require_constant)
&& ((inside_init && TREE_CODE (inside_init) == STRING_CST)))
{
if (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
- TYPE_MAIN_VARIANT (type)))
+ TYPE_MAIN_VARIANT (type), COMPARE_STRICT))
return inside_init;
if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (inside_init)))
@@ -4585,12 +4023,13 @@ digest_init (tree type, tree init, int require_constant)
vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
below and handle as a constructor. */
if (code == VECTOR_TYPE
- && comptypes (TREE_TYPE (inside_init), type)
+ && comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT)
&& TREE_CONSTANT (inside_init))
{
if (TREE_CODE (inside_init) == VECTOR_CST
&& comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
- TYPE_MAIN_VARIANT (type)))
+ TYPE_MAIN_VARIANT (type),
+ COMPARE_STRICT))
return inside_init;
else
return build_vector (type, CONSTRUCTOR_ELTS (inside_init));
@@ -4601,19 +4040,24 @@ digest_init (tree type, tree init, int require_constant)
if (inside_init && TREE_TYPE (inside_init) != 0
&& (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
- TYPE_MAIN_VARIANT (type))
+ TYPE_MAIN_VARIANT (type), COMPARE_STRICT)
|| (code == ARRAY_TYPE
- && comptypes (TREE_TYPE (inside_init), type))
+ && comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT))
|| (code == VECTOR_TYPE
- && comptypes (TREE_TYPE (inside_init), type))
+ && comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT))
|| (code == POINTER_TYPE
&& (TREE_CODE (TREE_TYPE (inside_init)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (inside_init)) == FUNCTION_TYPE)
&& comptypes (TREE_TYPE (TREE_TYPE (inside_init)),
- TREE_TYPE (type)))))
+ TREE_TYPE (type), COMPARE_STRICT))))
{
if (code == POINTER_TYPE)
inside_init = default_function_array_conversion (inside_init);
+
+ if (code == VECTOR_TYPE)
+ /* Although the types are compatible, we may require a
+ conversion. */
+ inside_init = convert (type, inside_init);
if (require_constant && !flag_isoc99
&& TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR)
@@ -4882,8 +4326,7 @@ void
start_init (tree decl, tree asmspec_tree, int top_level)
{
const char *locus;
- struct initializer_stack *p
- = (struct initializer_stack *) xmalloc (sizeof (struct initializer_stack));
+ struct initializer_stack *p = xmalloc (sizeof (struct initializer_stack));
const char *asmspec = 0;
if (asmspec_tree)
@@ -4983,8 +4426,7 @@ finish_init (void)
void
really_start_incremental_init (tree type)
{
- struct constructor_stack *p
- = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
+ struct constructor_stack *p = xmalloc (sizeof (struct constructor_stack));
if (type == 0)
type = TREE_TYPE (constructor_decl);
@@ -5120,7 +4562,7 @@ push_init_level (int implicit)
value = find_init_member (constructor_index);
}
- p = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
+ p = xmalloc (sizeof (struct constructor_stack));
p->type = constructor_type;
p->fields = constructor_fields;
p->index = constructor_index;
@@ -5504,8 +4946,7 @@ push_range_stack (tree range_end)
{
struct constructor_range_stack *p;
- p = (struct constructor_range_stack *)
- ggc_alloc (sizeof (struct constructor_range_stack));
+ p = ggc_alloc (sizeof (struct constructor_range_stack));
p->prev = constructor_range_stack;
p->next = 0;
p->fields = constructor_fields;
@@ -5551,6 +4992,8 @@ set_init_index (tree first, tree last)
error_init ("nonconstant array index in initializer");
else if (TREE_CODE (constructor_type) != ARRAY_TYPE)
error_init ("array index in non-array initializer");
+ else if (tree_int_cst_sgn (first) == -1)
+ error_init ("array index in initializer exceeds array bounds");
else if (constructor_max_index
&& tree_int_cst_lt (constructor_max_index, first))
error_init ("array index in initializer exceeds array bounds");
@@ -5677,7 +5120,7 @@ add_pending_init (tree purpose, tree value)
}
}
- r = (struct init_node *) ggc_alloc (sizeof (struct init_node));
+ r = ggc_alloc (sizeof (struct init_node));
r->purpose = purpose;
r->value = value;
@@ -6039,7 +5482,7 @@ output_init_element (tree value, tree type, tree field, int pending)
&& TREE_CODE (type) == ARRAY_TYPE
&& TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE)
&& !comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (value)),
- TYPE_MAIN_VARIANT (type))))
+ TYPE_MAIN_VARIANT (type), COMPARE_STRICT)))
value = default_conversion (value);
if (TREE_CODE (value) == COMPOUND_LITERAL_EXPR
@@ -6779,7 +6222,7 @@ c_expand_asm_operands (tree string, tree outputs, tree inputs,
int noutputs = list_length (outputs);
int i;
/* o[I] is the place that output number I should be written. */
- tree *o = (tree *) alloca (noutputs * sizeof (tree));
+ tree *o = alloca (noutputs * sizeof (tree));
tree tail;
/* Record the contents of OUTPUTS before it is modified. */
@@ -6977,7 +6420,7 @@ c_start_case (tree exp)
}
/* Add this new SWITCH_STMT to the stack. */
- cs = (struct c_switch *) xmalloc (sizeof (*cs));
+ cs = xmalloc (sizeof (*cs));
cs->switch_stmt = build_stmt (SWITCH_STMT, exp, NULL_TREE, orig_type);
cs->cases = splay_tree_new (case_compare, NULL, NULL);
cs->next = switch_stack;
@@ -7032,3 +6475,735 @@ c_finish_case (void)
splay_tree_delete (cs->cases);
free (cs);
}
+
+/* Build a binary-operation expression without default conversions.
+ CODE is the kind of expression to build.
+ This function differs from `build' in several ways:
+ the data type of the result is computed and recorded in it,
+ warnings are generated if arg data types are invalid,
+ special handling for addition and subtraction of pointers is known,
+ and some optimization is done (operations on narrow ints
+ are done in the narrower type when that gives the same result).
+ Constant folding is also done before the result is returned.
+
+ Note that the operands will never have enumeral types, or function
+ or array types, because either they will have the default conversions
+ performed or they have both just been converted to some other type in which
+ the arithmetic is to be done. */
+
+tree
+build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
+ int convert_p)
+{
+ tree type0, type1;
+ enum tree_code code0, code1;
+ tree op0, op1;
+
+ /* 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. */
+ 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. */
+ tree result_type = NULL;
+
+ /* Nonzero means operands have already been type-converted
+ in whatever way is necessary.
+ Zero means they need to be converted to RESULT_TYPE. */
+ int converted = 0;
+
+ /* Nonzero means create the expression with this type, rather than
+ RESULT_TYPE. */
+ tree build_type = 0;
+
+ /* Nonzero means after finally constructing the expression
+ convert it to this type. */
+ tree final_type = 0;
+
+ /* Nonzero if this is an operation like MIN or MAX which can
+ safely be computed in short if both args are promoted shorts.
+ Also implies COMMON.
+ -1 indicates a bitwise operation; this makes a difference
+ in the exact conditions for when it is safe to do the operation
+ in a narrower mode. */
+ int shorten = 0;
+
+ /* Nonzero if this is a comparison operation;
+ if both args are promoted shorts, compare the original shorts.
+ Also implies COMMON. */
+ int short_compare = 0;
+
+ /* Nonzero if this is a right-shift operation, which can be computed on the
+ original short and then promoted if the operand is a promoted short. */
+ int short_shift = 0;
+
+ /* Nonzero means set RESULT_TYPE to the common type of the args. */
+ int common = 0;
+
+ if (convert_p)
+ {
+ op0 = default_conversion (orig_op0);
+ op1 = default_conversion (orig_op1);
+ }
+ else
+ {
+ op0 = orig_op0;
+ op1 = orig_op1;
+ }
+
+ type0 = TREE_TYPE (op0);
+ type1 = TREE_TYPE (op1);
+
+ /* The expression codes of the data types of the arguments tell us
+ whether the arguments are integers, floating, pointers, etc. */
+ code0 = TREE_CODE (type0);
+ code1 = TREE_CODE (type1);
+
+ /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
+ STRIP_TYPE_NOPS (op0);
+ STRIP_TYPE_NOPS (op1);
+
+ /* If an error was already reported for one of the arguments,
+ avoid reporting another error. */
+
+ if (code0 == ERROR_MARK || code1 == ERROR_MARK)
+ return error_mark_node;
+
+ switch (code)
+ {
+ case PLUS_EXPR:
+ /* Handle the pointer + int case. */
+ if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
+ return pointer_int_sum (PLUS_EXPR, op0, op1);
+ else if (code1 == POINTER_TYPE && code0 == INTEGER_TYPE)
+ return pointer_int_sum (PLUS_EXPR, op1, op0);
+ else
+ common = 1;
+ break;
+
+ case MINUS_EXPR:
+ /* Subtraction of two similar pointers.
+ We must subtract them as integers, then divide by object size. */
+ if (code0 == POINTER_TYPE && code1 == POINTER_TYPE
+ && comp_target_types (type0, type1, 1))
+ return pointer_diff (op0, op1);
+ /* Handle pointer minus int. Just like pointer plus int. */
+ else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
+ return pointer_int_sum (MINUS_EXPR, op0, op1);
+ else
+ common = 1;
+ break;
+
+ case MULT_EXPR:
+ common = 1;
+ break;
+
+ case TRUNC_DIV_EXPR:
+ case CEIL_DIV_EXPR:
+ case FLOOR_DIV_EXPR:
+ case ROUND_DIV_EXPR:
+ case EXACT_DIV_EXPR:
+ /* Floating point division by zero is a legitimate way to obtain
+ infinities and NaNs. */
+ if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
+ warning ("division by zero");
+
+ if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
+ || code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE)
+ && (code1 == INTEGER_TYPE || code1 == REAL_TYPE
+ || code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
+ {
+ if (!(code0 == INTEGER_TYPE && code1 == INTEGER_TYPE))
+ resultcode = RDIV_EXPR;
+ else
+ /* Although it would be tempting to shorten always here, that
+ loses on some targets, since the modulo instruction is
+ undefined if the quotient can't be represented in the
+ computation mode. We shorten only if unsigned or if
+ dividing by something we know != -1. */
+ shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0))
+ || (TREE_CODE (op1) == INTEGER_CST
+ && ! integer_all_onesp (op1)));
+ common = 1;
+ }
+ break;
+
+ case BIT_AND_EXPR:
+ case BIT_IOR_EXPR:
+ case BIT_XOR_EXPR:
+ if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
+ shorten = -1;
+ else if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE)
+ common = 1;
+ break;
+
+ case TRUNC_MOD_EXPR:
+ case FLOOR_MOD_EXPR:
+ if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
+ warning ("division by zero");
+
+ if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
+ {
+ /* Although it would be tempting to shorten always here, that loses
+ on some targets, since the modulo instruction is undefined if the
+ quotient can't be represented in the computation mode. We shorten
+ only if unsigned or if dividing by something we know != -1. */
+ shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0))
+ || (TREE_CODE (op1) == INTEGER_CST
+ && ! integer_all_onesp (op1)));
+ common = 1;
+ }
+ break;
+
+ case TRUTH_ANDIF_EXPR:
+ case TRUTH_ORIF_EXPR:
+ case TRUTH_AND_EXPR:
+ case TRUTH_OR_EXPR:
+ case TRUTH_XOR_EXPR:
+ if ((code0 == INTEGER_TYPE || code0 == POINTER_TYPE
+ || code0 == REAL_TYPE || code0 == COMPLEX_TYPE)
+ && (code1 == INTEGER_TYPE || code1 == POINTER_TYPE
+ || code1 == REAL_TYPE || code1 == COMPLEX_TYPE))
+ {
+ /* Result of these operations is always an int,
+ but that does not mean the operands should be
+ converted to ints! */
+ result_type = integer_type_node;
+ op0 = c_common_truthvalue_conversion (op0);
+ op1 = c_common_truthvalue_conversion (op1);
+ converted = 1;
+ }
+ break;
+
+ /* Shift operations: result has same type as first operand;
+ always convert second operand to int.
+ Also set SHORT_SHIFT if shifting rightward. */
+
+ case RSHIFT_EXPR:
+ if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
+ {
+ if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
+ {
+ if (tree_int_cst_sgn (op1) < 0)
+ warning ("right shift count is negative");
+ else
+ {
+ if (! integer_zerop (op1))
+ short_shift = 1;
+
+ if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
+ warning ("right shift count >= width of type");
+ }
+ }
+
+ /* Use the type of the value to be shifted. */
+ result_type = type0;
+ /* Convert the shift-count to an integer, regardless of size
+ of value being shifted. */
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node)
+ op1 = convert (integer_type_node, op1);
+ /* Avoid converting op1 to result_type later. */
+ converted = 1;
+ }
+ break;
+
+ case LSHIFT_EXPR:
+ if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
+ {
+ if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
+ {
+ if (tree_int_cst_sgn (op1) < 0)
+ warning ("left shift count is negative");
+
+ else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
+ warning ("left shift count >= width of type");
+ }
+
+ /* Use the type of the value to be shifted. */
+ result_type = type0;
+ /* Convert the shift-count to an integer, regardless of size
+ of value being shifted. */
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node)
+ op1 = convert (integer_type_node, op1);
+ /* Avoid converting op1 to result_type later. */
+ converted = 1;
+ }
+ break;
+
+ case RROTATE_EXPR:
+ case LROTATE_EXPR:
+ if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
+ {
+ if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0)
+ {
+ if (tree_int_cst_sgn (op1) < 0)
+ warning ("shift count is negative");
+ else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0)
+ warning ("shift count >= width of type");
+ }
+
+ /* Use the type of the value to be shifted. */
+ result_type = type0;
+ /* Convert the shift-count to an integer, regardless of size
+ of value being shifted. */
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node)
+ op1 = convert (integer_type_node, op1);
+ /* Avoid converting op1 to result_type later. */
+ converted = 1;
+ }
+ break;
+
+ case EQ_EXPR:
+ case NE_EXPR:
+ if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE))
+ warning ("comparing floating point with == or != is unsafe");
+ /* Result of comparison is always int,
+ but don't convert the args to int! */
+ build_type = integer_type_node;
+ if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
+ || code0 == COMPLEX_TYPE
+ || code0 == VECTOR_TYPE)
+ && (code1 == INTEGER_TYPE || code1 == REAL_TYPE
+ || code1 == COMPLEX_TYPE
+ || code1 == VECTOR_TYPE))
+ short_compare = 1;
+ else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
+ {
+ tree tt0 = TREE_TYPE (type0);
+ tree tt1 = TREE_TYPE (type1);
+ /* Anything compares with void *. void * compares with anything.
+ Otherwise, the targets must be compatible
+ and both must be object or both incomplete. */
+ if (comp_target_types (type0, type1, 1))
+ result_type = common_type (type0, type1);
+ else if (VOID_TYPE_P (tt0))
+ {
+ /* op0 != orig_op0 detects the case of something
+ whose value is 0 but which isn't a valid null ptr const. */
+ if (pedantic && (!integer_zerop (op0) || op0 != orig_op0)
+ && TREE_CODE (tt1) == FUNCTION_TYPE)
+ pedwarn ("ISO C forbids comparison of `void *' with function pointer");
+ }
+ else if (VOID_TYPE_P (tt1))
+ {
+ if (pedantic && (!integer_zerop (op1) || op1 != orig_op1)
+ && TREE_CODE (tt0) == FUNCTION_TYPE)
+ pedwarn ("ISO C forbids comparison of `void *' with function pointer");
+ }
+ else
+ pedwarn ("comparison of distinct pointer types lacks a cast");
+
+ if (result_type == NULL_TREE)
+ result_type = ptr_type_node;
+ }
+ else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST
+ && integer_zerop (op1))
+ result_type = type0;
+ else if (code1 == POINTER_TYPE && TREE_CODE (op0) == INTEGER_CST
+ && integer_zerop (op0))
+ result_type = type1;
+ else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
+ {
+ result_type = type0;
+ pedwarn ("comparison between pointer and integer");
+ }
+ else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
+ {
+ result_type = type1;
+ pedwarn ("comparison between pointer and integer");
+ }
+ break;
+
+ case MAX_EXPR:
+ case MIN_EXPR:
+ if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE)
+ && (code1 == INTEGER_TYPE || code1 == REAL_TYPE))
+ shorten = 1;
+ else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
+ {
+ if (comp_target_types (type0, type1, 1))
+ {
+ result_type = common_type (type0, type1);
+ if (pedantic
+ && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
+ pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
+ }
+ else
+ {
+ result_type = ptr_type_node;
+ pedwarn ("comparison of distinct pointer types lacks a cast");
+ }
+ }
+ break;
+
+ case LE_EXPR:
+ case GE_EXPR:
+ case LT_EXPR:
+ case GT_EXPR:
+ build_type = integer_type_node;
+ if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE)
+ && (code1 == INTEGER_TYPE || code1 == REAL_TYPE))
+ short_compare = 1;
+ else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
+ {
+ if (comp_target_types (type0, type1, 1))
+ {
+ result_type = common_type (type0, type1);
+ if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
+ != !COMPLETE_TYPE_P (TREE_TYPE (type1)))
+ pedwarn ("comparison of complete and incomplete pointers");
+ else if (pedantic
+ && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
+ pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
+ }
+ else
+ {
+ result_type = ptr_type_node;
+ pedwarn ("comparison of distinct pointer types lacks a cast");
+ }
+ }
+ else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST
+ && integer_zerop (op1))
+ {
+ result_type = type0;
+ if (pedantic || extra_warnings)
+ pedwarn ("ordered comparison of pointer with integer zero");
+ }
+ else if (code1 == POINTER_TYPE && TREE_CODE (op0) == INTEGER_CST
+ && integer_zerop (op0))
+ {
+ result_type = type1;
+ if (pedantic)
+ pedwarn ("ordered comparison of pointer with integer zero");
+ }
+ else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
+ {
+ result_type = type0;
+ pedwarn ("comparison between pointer and integer");
+ }
+ else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
+ {
+ result_type = type1;
+ pedwarn ("comparison between pointer and integer");
+ }
+ break;
+
+ case UNORDERED_EXPR:
+ case ORDERED_EXPR:
+ case UNLT_EXPR:
+ case UNLE_EXPR:
+ case UNGT_EXPR:
+ case UNGE_EXPR:
+ case UNEQ_EXPR:
+ build_type = integer_type_node;
+ if (code0 != REAL_TYPE || code1 != REAL_TYPE)
+ {
+ error ("unordered comparison on non-floating point argument");
+ return error_mark_node;
+ }
+ common = 1;
+ break;
+
+ default:
+ break;
+ }
+
+ if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE
+ || code0 == VECTOR_TYPE)
+ &&
+ (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE
+ || code1 == VECTOR_TYPE))
+ {
+ int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE);
+
+ if (shorten || common || short_compare)
+ result_type = common_type (type0, type1);
+
+ /* For certain operations (which identify themselves by shorten != 0)
+ if both args were extended from the same smaller type,
+ do the arithmetic in that type and then extend.
+
+ shorten !=0 and !=1 indicates a bitwise operation.
+ For them, this optimization is safe only if
+ both args are zero-extended or both are sign-extended.
+ Otherwise, we might change the result.
+ Eg, (short)-1 | (unsigned short)-1 is (int)-1
+ but calculated in (unsigned short) it would be (unsigned short)-1. */
+
+ if (shorten && none_complex)
+ {
+ int unsigned0, unsigned1;
+ tree arg0 = get_narrower (op0, &unsigned0);
+ tree arg1 = get_narrower (op1, &unsigned1);
+ /* UNS is 1 if the operation to be done is an unsigned one. */
+ int uns = TREE_UNSIGNED (result_type);
+ tree type;
+
+ final_type = result_type;
+
+ /* Handle the case that OP0 (or OP1) does not *contain* a conversion
+ but it *requires* conversion to FINAL_TYPE. */
+
+ if ((TYPE_PRECISION (TREE_TYPE (op0))
+ == TYPE_PRECISION (TREE_TYPE (arg0)))
+ && TREE_TYPE (op0) != final_type)
+ unsigned0 = TREE_UNSIGNED (TREE_TYPE (op0));
+ if ((TYPE_PRECISION (TREE_TYPE (op1))
+ == TYPE_PRECISION (TREE_TYPE (arg1)))
+ && TREE_TYPE (op1) != final_type)
+ unsigned1 = TREE_UNSIGNED (TREE_TYPE (op1));
+
+ /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
+
+ /* For bitwise operations, signedness of nominal type
+ does not matter. Consider only how operands were extended. */
+ if (shorten == -1)
+ uns = unsigned0;
+
+ /* Note that in all three cases below we refrain from optimizing
+ an unsigned operation on sign-extended args.
+ That would not be valid. */
+
+ /* Both args variable: if both extended in same way
+ from same width, do it in that width.
+ Do it unsigned if args were zero-extended. */
+ if ((TYPE_PRECISION (TREE_TYPE (arg0))
+ < TYPE_PRECISION (result_type))
+ && (TYPE_PRECISION (TREE_TYPE (arg1))
+ == TYPE_PRECISION (TREE_TYPE (arg0)))
+ && unsigned0 == unsigned1
+ && (unsigned0 || !uns))
+ result_type
+ = c_common_signed_or_unsigned_type
+ (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
+ else if (TREE_CODE (arg0) == INTEGER_CST
+ && (unsigned1 || !uns)
+ && (TYPE_PRECISION (TREE_TYPE (arg1))
+ < TYPE_PRECISION (result_type))
+ && (type
+ = c_common_signed_or_unsigned_type (unsigned1,
+ TREE_TYPE (arg1)),
+ int_fits_type_p (arg0, type)))
+ result_type = type;
+ else if (TREE_CODE (arg1) == INTEGER_CST
+ && (unsigned0 || !uns)
+ && (TYPE_PRECISION (TREE_TYPE (arg0))
+ < TYPE_PRECISION (result_type))
+ && (type
+ = c_common_signed_or_unsigned_type (unsigned0,
+ TREE_TYPE (arg0)),
+ int_fits_type_p (arg1, type)))
+ result_type = type;
+ }
+
+ /* Shifts can be shortened if shifting right. */
+
+ if (short_shift)
+ {
+ int unsigned_arg;
+ tree arg0 = get_narrower (op0, &unsigned_arg);
+
+ final_type = result_type;
+
+ if (arg0 == op0 && final_type == TREE_TYPE (op0))
+ unsigned_arg = TREE_UNSIGNED (TREE_TYPE (op0));
+
+ if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type)
+ /* We can shorten only if the shift count is less than the
+ number of bits in the smaller type size. */
+ && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0
+ /* We cannot drop an unsigned shift after sign-extension. */
+ && (!TREE_UNSIGNED (final_type) || unsigned_arg))
+ {
+ /* Do an unsigned shift if the operand was zero-extended. */
+ result_type
+ = c_common_signed_or_unsigned_type (unsigned_arg,
+ TREE_TYPE (arg0));
+ /* Convert value-to-be-shifted to that type. */
+ if (TREE_TYPE (op0) != result_type)
+ op0 = convert (result_type, op0);
+ converted = 1;
+ }
+ }
+
+ /* Comparison operations are shortened too but differently.
+ They identify themselves by setting short_compare = 1. */
+
+ if (short_compare)
+ {
+ /* Don't write &op0, etc., because that would prevent op0
+ from being kept in a register.
+ Instead, make copies of the our local variables and
+ pass the copies by reference, then copy them back afterward. */
+ tree xop0 = op0, xop1 = op1, xresult_type = result_type;
+ enum tree_code xresultcode = resultcode;
+ tree val
+ = shorten_compare (&xop0, &xop1, &xresult_type, &xresultcode);
+
+ if (val != 0)
+ return val;
+
+ op0 = xop0, op1 = xop1;
+ converted = 1;
+ resultcode = xresultcode;
+
+ if (warn_sign_compare && skip_evaluation == 0)
+ {
+ int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0));
+ int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1));
+ int unsignedp0, unsignedp1;
+ tree primop0 = get_narrower (op0, &unsignedp0);
+ tree primop1 = get_narrower (op1, &unsignedp1);
+
+ xop0 = orig_op0;
+ xop1 = orig_op1;
+ STRIP_TYPE_NOPS (xop0);
+ STRIP_TYPE_NOPS (xop1);
+
+ /* Give warnings for comparisons between signed and unsigned
+ quantities that may fail.
+
+ Do the checking based on the original operand trees, so that
+ casts will be considered, but default promotions won't be.
+
+ Do not warn if the comparison is being done in a signed type,
+ since the signed type will only be chosen if it can represent
+ all the values of the unsigned type. */
+ if (! TREE_UNSIGNED (result_type))
+ /* OK */;
+ /* Do not warn if both operands are the same signedness. */
+ else if (op0_signed == op1_signed)
+ /* OK */;
+ else
+ {
+ tree sop, uop;
+
+ if (op0_signed)
+ sop = xop0, uop = xop1;
+ else
+ sop = xop1, uop = xop0;
+
+ /* Do not warn if the signed quantity is an
+ unsuffixed integer literal (or some static
+ constant expression involving such literals or a
+ conditional expression involving such literals)
+ and it is non-negative. */
+ if (c_tree_expr_nonnegative_p (sop))
+ /* OK */;
+ /* Do not warn if the comparison is an equality operation,
+ the unsigned quantity is an integral constant, and it
+ would fit in the result if the result were signed. */
+ else if (TREE_CODE (uop) == INTEGER_CST
+ && (resultcode == EQ_EXPR || resultcode == NE_EXPR)
+ && int_fits_type_p
+ (uop, c_common_signed_type (result_type)))
+ /* OK */;
+ /* Do not warn if the unsigned quantity is an enumeration
+ constant and its maximum value would fit in the result
+ if the result were signed. */
+ else if (TREE_CODE (uop) == INTEGER_CST
+ && TREE_CODE (TREE_TYPE (uop)) == ENUMERAL_TYPE
+ && int_fits_type_p
+ (TYPE_MAX_VALUE (TREE_TYPE(uop)),
+ c_common_signed_type (result_type)))
+ /* OK */;
+ else
+ warning ("comparison between signed and unsigned");
+ }
+
+ /* Warn if two unsigned values are being compared in a size
+ larger than their original size, and one (and only one) is the
+ result of a `~' operator. This comparison will always fail.
+
+ Also warn if one operand is a constant, and the constant
+ does not have all bits set that are set in the ~ operand
+ when it is extended. */
+
+ if ((TREE_CODE (primop0) == BIT_NOT_EXPR)
+ != (TREE_CODE (primop1) == BIT_NOT_EXPR))
+ {
+ if (TREE_CODE (primop0) == BIT_NOT_EXPR)
+ primop0 = get_narrower (TREE_OPERAND (primop0, 0),
+ &unsignedp0);
+ else
+ primop1 = get_narrower (TREE_OPERAND (primop1, 0),
+ &unsignedp1);
+
+ if (host_integerp (primop0, 0) || host_integerp (primop1, 0))
+ {
+ tree primop;
+ HOST_WIDE_INT constant, mask;
+ int unsignedp, bits;
+
+ if (host_integerp (primop0, 0))
+ {
+ primop = primop1;
+ unsignedp = unsignedp1;
+ constant = tree_low_cst (primop0, 0);
+ }
+ else
+ {
+ primop = primop0;
+ unsignedp = unsignedp0;
+ constant = tree_low_cst (primop1, 0);
+ }
+
+ bits = TYPE_PRECISION (TREE_TYPE (primop));
+ if (bits < TYPE_PRECISION (result_type)
+ && bits < HOST_BITS_PER_WIDE_INT && unsignedp)
+ {
+ mask = (~ (HOST_WIDE_INT) 0) << bits;
+ if ((mask & constant) != mask)
+ warning ("comparison of promoted ~unsigned with constant");
+ }
+ }
+ else if (unsignedp0 && unsignedp1
+ && (TYPE_PRECISION (TREE_TYPE (primop0))
+ < TYPE_PRECISION (result_type))
+ && (TYPE_PRECISION (TREE_TYPE (primop1))
+ < TYPE_PRECISION (result_type)))
+ warning ("comparison of promoted ~unsigned with unsigned");
+ }
+ }
+ }
+ }
+
+ /* At this point, RESULT_TYPE must be nonzero to avoid an error message.
+ If CONVERTED is zero, both args will be converted to type RESULT_TYPE.
+ Then the expression will be built.
+ It will be given type FINAL_TYPE if that is nonzero;
+ otherwise, it will be given type RESULT_TYPE. */
+
+ if (!result_type)
+ {
+ binary_op_error (code);
+ return error_mark_node;
+ }
+
+ if (! converted)
+ {
+ if (TREE_TYPE (op0) != result_type)
+ op0 = convert (result_type, op0);
+ if (TREE_TYPE (op1) != result_type)
+ op1 = convert (result_type, op1);
+ }
+
+ if (build_type == NULL_TREE)
+ build_type = result_type;
+
+ {
+ tree result = build (resultcode, build_type, op0, op1);
+ tree folded;
+
+ /* Treat expressions in initializers specially as they can't trap. */
+ folded = initializer_stack ? fold_initializer (result)
+ : fold (result);
+ if (folded == result)
+ TREE_CONSTANT (folded) = TREE_CONSTANT (op0) & TREE_CONSTANT (op1);
+ if (final_type != 0)
+ return convert (final_type, folded);
+ return folded;
+ }
+}
+
diff --git a/gcc/c.opt b/gcc/c.opt
index 64e9fe02ddd..431a4983609 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -44,7 +44,11 @@
; output. However, if the help text contains a tab character, the
; text to the left of the tab is output instead of the switch, and the
; text to its right forms the help. This is useful for elaborating on
-; what type of argument a switch takes, for example.
+; what type of argument a switch takes, for example. If the second
+; field contains "Undocumented" then nothing is output with --help.
+; Only do this with good reason like the switch being internal between
+; the driver and the front end - it is not an excuse to leave a switch
+; undocumented.
; Comments can appear on their own line anwhere in the file, preceded
; by a semicolon. Whitespace is permitted before the semicolon.
@@ -67,128 +71,166 @@ C++
Language
ObjC++
--help
-C ObjC C++ ObjC++
-
-output-pch=
C ObjC C++ ObjC++ Joined Separate
A
C ObjC C++ ObjC++ Joined Separate
+-A<question>=<answer> Assert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>
C
C ObjC C++ ObjC++
+Do not discard comments
CC
C ObjC C++ ObjC++
+Do not discard comments in macro expansions
D
C ObjC C++ ObjC++ Joined Separate
+-D<macro>[=<val>] Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1
E
-C ObjC C++ ObjC++
+C ObjC C++ ObjC++ Undocumented
H
C ObjC C++ ObjC++
+Print the name of header files as they are used
I
C ObjC C++ ObjC++ Joined Separate
+-I <dir> Add <dir> to the end of the main include path. -I- gives more include path control; see info documentation
M
C ObjC C++ ObjC++
+Generate make dependencies
MD
C ObjC C++ ObjC++ Separate
+Generate make dependencies and compile
MF
C ObjC C++ ObjC++ Joined Separate
+-MF <file> Write dependency output to the given file
MG
C ObjC C++ ObjC++
+Treat missing header files as generated files
MM
C ObjC C++ ObjC++
+Like -M but ignore system header files
MMD
C ObjC C++ ObjC++ Separate
+Like -MD but ignore system header files
MP
C ObjC C++ ObjC++
+Generate phony targets for all headers
MQ
C ObjC C++ ObjC++ Joined Separate
+-MQ <target> Add a MAKE-quoted target
MT
C ObjC C++ ObjC++ Joined Separate
+-MT <target> Add an unquoted target
P
C ObjC C++ ObjC++
+Do not generate #line directives
U
C ObjC C++ ObjC++ Joined Separate
+-U<macro> Undefine <macro>
Wabi
C++ ObjC++
Wall
C ObjC C++ ObjC++
+Enable most warning messages
Wbad-function-cast
C ObjC
+Warn about casting functions to incompatible types
Wcast-qual
C ObjC C++ ObjC++
+Warn about casts which discard qualifiers
Wchar-subscripts
C ObjC C++ ObjC++
+Warn about subscripts whose type is \"char\"
Wcomment
C ObjC C++ ObjC++
+Warn about possibly nested block comments, and C++ comments spanning more than one physical line
Wcomments
C ObjC C++ ObjC++
+Synonym for -Wcomment
Wconversion
C ObjC C++ ObjC++
+Warn about possibly confusing type conversions
Wctor-dtor-privacy
C++ ObjC++
+Warn when all constructors and destructors are private
+
+Wdeclaration-after-statement
+C ObjC
+Warn when a declaration is found after a statement
Wdeprecated
C++ ObjC++
+Warn about deprecated compiler features
Wdiv-by-zero
C ObjC
+Warn about compile-time integer division by zero
Weffc++
C++ ObjC++
+Warn about violations of Effective C++ style rules
Wendif-labels
C ObjC C++ ObjC++
+Warn about stray tokens after #elif and #endif
Werror
C ObjC C++ ObjC++
+; Documented in common.opt
Werror-implicit-function-declaration
C ObjC RejectNegative
+Make implicit function declarations an error
Wfloat-equal
C ObjC C++ ObjC++
+Warn if testing floating point numbers for equality
Wformat
C ObjC C++ ObjC++
+Warn about printf/scanf/strftime/strfmon format string anomalies
Wformat-extra-args
C ObjC C++ ObjC++
+Warn if passing too many arguments to a function for its format string
Wformat-nonliteral
C ObjC C++ ObjC++
+Warn about format strings that are not literals
Wformat-security
C ObjC C++ ObjC++
+Warn about possible security problems with format functions
Wformat-y2k
C ObjC C++ ObjC++
+Warn about strftime formats yielding 2-digit years
Wformat-zero-length
C ObjC
@@ -196,188 +238,249 @@ C ObjC
Wformat=
C ObjC C++ ObjC++ Joined
+Winit-self
+C ObjC C++ ObjC++
+Warn about variables which are initialized to themselves.
+
Wimplicit
C ObjC C++ ObjC++
Wimplicit-function-declaration
C ObjC
+Warn about implicit function declarations
Wimplicit-int
C ObjC
+Warn when a declaration does not specify a type
Wimport
C ObjC C++ ObjC++
+Deprecated. This switch has no effect.
Winvalid-offsetof
C++ ObjC++
+Warn about invalid uses of the \"offsetof\" macro
Winvalid-pch
C ObjC C++ ObjC++
+Warn about PCH files that are found but not used
Wlong-long
C ObjC C++ ObjC++
+Do not warn about using \"long long\" when -pedantic
Wmain
C ObjC
+Warn about suspicious declarations of \"main\"
Wmissing-braces
C ObjC C++ ObjC++
+Warn about possibly missing braces around initializers
Wmissing-declarations
C ObjC
+Warn about global functions without previous declarations
Wmissing-format-attribute
C ObjC C++ ObjC++
+Warn about functions which might be candidates for format attributes
Wmissing-prototypes
C ObjC
+Warn about global functions without prototypes
Wmultichar
C ObjC C++ ObjC++
+Warn about use of multi-character character constants
Wnested-externs
C ObjC
+Warn about \"extern\" declarations not at file scope
Wnon-template-friend
C++ ObjC++
+Warn when non-templatized friend functions are declared within a template
Wnon-virtual-dtor
C++ ObjC++
+Warn about non-virtual destructors
Wnonnull
C ObjC
Wold-style-cast
C++ ObjC++
+Warn if a C-style cast is used in a program
+
+Wold-style-definition
+C ObjC
+Warn if an old-style parameter definition is used
Woverloaded-virtual
C++ ObjC++
+Warn about overloaded virtual function names
Wparentheses
C ObjC C++ ObjC++
+Warn about possibly missing parentheses
Wpmf-conversions
C++ ObjC++
+Warn when converting the type of pointers to member functions
Wpointer-arith
C ObjC C++ ObjC++
+Warn about function pointer arithmetic
Wprotocol
ObjC ObjC++
+Warn if inherited methods are unimplemented
Wredundant-decls
C ObjC C++ ObjC++
+Warn about multiple declarations of the same object
Wreorder
C++ ObjC++
+Warn when the compiler reorders code
Wreturn-type
C ObjC C++ ObjC++
+Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
Wselector
ObjC ObjC++
+Warn if a selector has multiple methods
Wsequence-point
C ObjC
+Warn about possible violations of sequence point rules
Wsign-compare
C ObjC C++ ObjC++
+Warn about signed-unsigned comparisons
Wsign-promo
C++ ObjC++
+Warn when overload promotes from unsigned to signed
Wstrict-prototypes
C ObjC
+Warn about unprototyped function declarations
Wsynth
C++ ObjC++
+Warn when synthesis behavior differs from Cfront
Wsystem-headers
C ObjC C++ ObjC++
+Do not suppress warnings from system headers
Wtraditional
C ObjC
+Warn about features not present in traditional C
Wtrigraphs
C ObjC C++ ObjC++
+Warn if trigraphs are encountered that might affect the meaning of the program
Wundeclared-selector
ObjC ObjC++
Wundef
C ObjC C++ ObjC++
+Warn if an undefined macro is used in an #if directive
Wunknown-pragmas
C ObjC C++ ObjC++
+Warn about unrecognized pragmas
Wunused-macros
C ObjC C++ ObjC++
+Warn about macros defined in the main file that are not used
Wwrite-strings
C ObjC C++ ObjC++
+Give strings the type \"array of char\"
ansi
C ObjC C++ ObjC++
+A synonym for -std=c89. In a future version of GCC it will become synonymous with -std=c99 instead
d
C ObjC C++ ObjC++ Joined
+; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
fabi-version=
C++ ObjC++ Joined UInteger
faccess-control
C++ ObjC++
+Enforce class member access control semantics
fall-virtual
C++ ObjC++
falt-external-templates
C++ ObjC++
+Change when template instances are emitted
fasm
C ObjC C++ ObjC++
+Recognize the \"asm\" keyword
fbuiltin
C ObjC C++ ObjC++
+Recognize built-in functions
fbuiltin-
C ObjC C++ ObjC++ Joined
fcheck-new
C++ ObjC++
+Check the return value of new
fcond-mismatch
C ObjC C++ ObjC++
+Allow the arguments of the '?' operator to have different types
fconserve-space
C++ ObjC++
+Reduce the size of object files
fconst-strings
C++ ObjC++
+Make string literals \"const char[]\" not \"char[]\"
fconstant-string-class=
ObjC ObjC++ Joined
+-fconst-string-class=<name> Use class <name> for constant strings
fdefault-inline
C++ ObjC++
+Inline member functions by default
fdollars-in-identifiers
C ObjC C++ ObjC++
+Permit '$' as an identifier character
fdump-
C ObjC C++ ObjC++ Joined RejectNegative
+-fdump-<type> Dump various compiler internals to a file
felide-constructors
C++ ObjC++
fenforce-eh-specs
C++ ObjC++
+Generate code to check exception specifications
fenum-int-equiv
C++ ObjC++
fexec-charset=
C ObjC C++ ObjC++ Joined RejectNegative
+-fexec-charset=<cset> Convert all strings and character constants to character set <cset>
fexternal-templates
C++ ObjC++
@@ -390,15 +493,19 @@ C ObjC Joined
ffor-scope
C++ ObjC++
+Scope of for-init-statement variables is local to the loop
ffreestanding
C ObjC
+Do not assume that standard C libraries and \"main\" exist
fgnu-keywords
C++ ObjC++
+Recognize GNU-defined keywords
fgnu-runtime
ObjC ObjC++
+Generate code for GNU runtime environment
fguiding-decls
C++ ObjC++
@@ -411,24 +518,30 @@ C++ ObjC++
fhosted
C ObjC
+Assume normal C execution environment
fhuge-objects
C++ ObjC++
+Enable support for huge objects
fimplement-inlines
C++ ObjC++
+Export functions even if they can be inlined
fimplicit-inline-templates
C++ ObjC++
+Emit implicit instantiations of inline templates
fimplicit-templates
C++ ObjC++
+Emit implicit instantiations of templates
flabels-ok
C++ ObjC++
fms-extensions
C ObjC C++ ObjC++
+Don't warn about uses of Microsoft extensions
fname-mangling-version-
C++ ObjC++ Joined
@@ -438,6 +551,11 @@ C++ ObjC++
fnext-runtime
ObjC ObjC++
+Generate code for NeXT (Apple Mac OS X) runtime environment
+
+fnil-receivers
+ObjC ObjC++
+Assume that receivers of Objective-C messages may be nil
fnonansi-builtins
C++ ObjC++
@@ -445,190 +563,261 @@ C++ ObjC++
fnonnull-objects
C++ ObjC++
+fobjc-exceptions
+ObjC ObjC++
+Enable Objective-C exception and synchronization syntax
+
foperator-names
C++ ObjC++
+Recognize C++ kewords like \"compl\" and \"xor\"
foptional-diags
C++ ObjC++
+Enable optional diagnostics
fpch-deps
C ObjC C++ ObjC++
fpermissive
C++ ObjC++
+Downgrade conformance errors to warnings
fpreprocessed
C ObjC C++ ObjC++
+Treat the input file as already preprocessed
+
+freplace-objc-classes
+ObjC ObjC++
+Used in Fix and Continue mode to indicate that class implementations may be swapped in at runtime
frepo
C++ ObjC++
+Enable automatic template instantiation
frtti
C++ ObjC++
+Generate run time type descriptor information
fshort-double
C ObjC C++ ObjC++
+Use the same size for double as for float
fshort-enums
C ObjC C++ ObjC++
+Use the narrowest integer type possible for enumeration types
fshort-wchar
C ObjC C++ ObjC++
+Force the underlying type for \"wchar_t\" to be \"unsigned short\"
fshow-column
C ObjC C++ ObjC++
fsigned-bitfields
C ObjC C++ ObjC++
+When \"signed\" or \"unsigned\" is not given make the bitfield signed
fsigned-char
C ObjC C++ ObjC++
+Make \"char\" signed by default
fsquangle
C++ ObjC++
fstats
C++ ObjC++
+Display statistics accumulated during compilation
fstrict-prototype
C++ ObjC++
ftabstop=
C ObjC C++ ObjC++ Joined RejectNegative UInteger
+-ftabstop=<number> Distance between tab stops for column reporting
ftemplate-depth-
C++ ObjC++ Joined RejectNegative UInteger
+-ftemplate-depth-<number> Specify maximum template instantiation depth
fthis-is-variable
C++ ObjC++
funsigned-bitfields
C ObjC C++ ObjC++
+When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
funsigned-char
C ObjC C++ ObjC++
+Make \"char\" unsigned by default
fuse-cxa-atexit
C++ ObjC++
+Use __cxa_atexit to register destructors
fvtable-gc
C++ ObjC++
+Discard unused virtual functions
fvtable-thunks
C++ ObjC++
+Implement vtables using thunks
fweak
C++ ObjC++
+Emit common-like symbols as weak symbols
fwide-exec-charset=
C ObjC C++ ObjC++ Joined RejectNegative
+-fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
+
+fworking-directory
+C ObjC C++ ObjC++
+Generate a #line directive pointing at the current working directory
fxref
C++ ObjC++
+Emit cross referencing information
+
+fzero-link
+ObjC ObjC++
+Generate lazy class lookup (via objc_getClass()) for use in Zero Link mode
gen-decls
ObjC ObjC++
+Dump declarations to a .decl file
idirafter
C ObjC C++ ObjC++ Joined Separate
+-idirafter <dir> Add <dir> to the end of the system include path
imacros
C ObjC C++ ObjC++ Joined Separate
+-imacros <file> Accept definition of macros in <file>
include
C ObjC C++ ObjC++ Joined Separate
+-include <file> Include the contents of <file> before other files
iprefix
C ObjC C++ ObjC++ Joined Separate
+-iprefix <path> Specify <path> as a prefix for next two options
isysroot
C ObjC C++ ObjC++ Joined Separate
+-isysroot <dir> Set <dir> to be the system root directory
isystem
C ObjC C++ ObjC++ Joined Separate
+-isystem <dir> Add <dir> to the start of the system include path
iwithprefix
C ObjC C++ ObjC++ Joined Separate
+-iwithprefix <dir> Add <dir> to the end of the system include path
iwithprefixbefore
C ObjC C++ ObjC++ Joined Separate
+-iwithprefixbefore <dir> Add <dir> to the end of the main include path
lang-asm
-C
+C Undocumented
lang-objc
-C ObjC C++ ObjC++
+C ObjC C++ ObjC++ Undocumented
nostdinc
C ObjC C++ ObjC++
+Do not search standard system include directories (those specified with -isystem will still be used)
nostdinc++
-C ObjC C++ ObjC++
+C++ ObjC++
+Do not search standard system include directories for C++
o
C ObjC C++ ObjC++ Joined Separate
+; Documented in common.opt
pedantic
C ObjC C++ ObjC++
+; Documented in common.opt
pedantic-errors
C ObjC C++ ObjC++
+; Documented in common.opt
print-objc-runtime-info
ObjC ObjC++
+Generate C header of platform-specific features
remap
C ObjC C++ ObjC++
+Remap file names when including files
std=c++98
C++ ObjC++
+Conform to the ISO 1998 C++ standard
std=c89
C ObjC
+Conform to the ISO 1990 C standard
std=c99
C ObjC
+Conform to the ISO 1999 C standard
std=c9x
C ObjC
+Deprecated in favor of -std=c99
std=gnu++98
C++ ObjC++
+Conform to the ISO 1998 C++ standard with GNU extensions
std=gnu89
C ObjC
+Conform to the ISO 1990 C standard with GNU extensions
std=gnu99
C ObjC
+Conform to the ISO 1999 C standard with GNU extensions
std=gnu9x
C ObjC
+Deprecated in favor of -std=gnu99
std=iso9899:1990
C ObjC
+Deprecated in favor of -std=c89
std=iso9899:199409
C ObjC
+Conform to the ISO 1990 C standard as amended in 1994
std=iso9899:1999
C ObjC
+Deprecated in favor of -std=c99
std=iso9899:199x
C ObjC
+Deprecated in favor of -std=c99
traditional-cpp
C ObjC C++ ObjC++
+Enable traditional preprocessing
trigraphs
C ObjC C++ ObjC++
+-trigraphs Support ISO C trigraphs
undef
C ObjC C++ ObjC++
+Do not predefine system-specific and GCC-specific macros
v
C ObjC C++ ObjC++
+Enable verbose output
w
C ObjC C++ ObjC++
+; Documented in common.opt
; This comment is to ensure we retain the blank line above.
diff --git a/gcc/calls.c b/gcc/calls.c
index 700564a33db..fa4f93473c5 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1,5 +1,5 @@
/* Convert function calls to rtl insns, for GNU C compiler.
- Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998
+ Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -27,6 +27,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree.h"
#include "flags.h"
#include "expr.h"
+#include "optabs.h"
#include "libfuncs.h"
#include "function.h"
#include "regs.h"
@@ -261,8 +262,8 @@ calls_function_1 (tree exp, int which)
break;
}
- /* Only expressions, references, and blocks can contain calls. */
- if (! IS_EXPR_CODE_CLASS (class) && class != 'r' && class != 'b')
+ /* Only expressions and blocks can contain calls. */
+ if (! IS_EXPR_CODE_CLASS (class) && class != 'b')
return 0;
for (i = 0; i < length; i++)
@@ -600,8 +601,14 @@ special_function_p (tree fndecl, int flags)
&& IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 17
/* Exclude functions not at the file scope, or not `extern',
since they are not the magic functions we would otherwise
- think they are. */
- && DECL_CONTEXT (fndecl) == NULL_TREE && TREE_PUBLIC (fndecl))
+ think they are.
+ FIXME: this should be handled with attributes, not with this
+ hacky imitation of DECL_ASSEMBLER_NAME. It's (also) wrong
+ because you can declare fork() inside a function if you
+ wish. */
+ && (DECL_CONTEXT (fndecl) == NULL_TREE
+ || TREE_CODE (DECL_CONTEXT (fndecl)) == TRANSLATION_UNIT_DECL)
+ && TREE_PUBLIC (fndecl))
{
const char *name = IDENTIFIER_POINTER (DECL_NAME (fndecl));
const char *tname = name;
@@ -723,10 +730,13 @@ flags_from_decl_or_type (tree exp)
if (TREE_NOTHROW (exp))
flags |= ECF_NOTHROW;
+
+ if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp))
+ flags |= ECF_LIBCALL_BLOCK;
}
if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp))
- flags |= ECF_CONST | ECF_LIBCALL_BLOCK;
+ flags |= ECF_CONST;
if (TREE_THIS_VOLATILE (exp))
flags |= ECF_NORETURN;
@@ -928,22 +938,26 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals)
< (unsigned int) MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD)))
{
int bytes = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
- int big_endian_correction = 0;
-
- args[i].n_aligned_regs
- = args[i].partial ? args[i].partial
- : (bytes + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
+ int nregs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
+ int endian_correction = 0;
- args[i].aligned_regs = (rtx *) xmalloc (sizeof (rtx)
- * args[i].n_aligned_regs);
+ args[i].n_aligned_regs = args[i].partial ? args[i].partial : nregs;
+ args[i].aligned_regs = xmalloc (sizeof (rtx) * args[i].n_aligned_regs);
- /* Structures smaller than a word are aligned to the least
- significant byte (to the right). On a BYTES_BIG_ENDIAN machine,
+ /* Structures smaller than a word are normally aligned to the
+ least significant byte. 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 * BITS_PER_UNIT));
+ if (bytes < UNITS_PER_WORD
+#ifdef BLOCK_REG_PADDING
+ && (BLOCK_REG_PADDING (args[i].mode,
+ TREE_TYPE (args[i].tree_value), 1)
+ == downward)
+#else
+ && BYTES_BIG_ENDIAN
+#endif
+ )
+ endian_correction = BITS_PER_WORD - bytes * BITS_PER_UNIT;
for (j = 0; j < args[i].n_aligned_regs; j++)
{
@@ -952,6 +966,8 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals)
int bitsize = MIN (bytes * BITS_PER_UNIT, BITS_PER_WORD);
args[i].aligned_regs[j] = reg;
+ word = extract_bit_field (word, bitsize, 0, 1, NULL_RTX,
+ word_mode, word_mode, BITS_PER_WORD);
/* There is no need to restrict this code to loading items
in TYPE_ALIGN sized hunks. The bitfield instructions can
@@ -967,11 +983,8 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals)
emit_move_insn (reg, const0_rtx);
bytes -= bitsize / BITS_PER_UNIT;
- store_bit_field (reg, bitsize, big_endian_correction, word_mode,
- extract_bit_field (word, bitsize, 0, 1, NULL_RTX,
- word_mode, word_mode,
- BITS_PER_WORD),
- BITS_PER_WORD);
+ store_bit_field (reg, bitsize, endian_correction, word_mode,
+ word, BITS_PER_WORD);
}
}
}
@@ -1164,9 +1177,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
mode = TYPE_MODE (type);
unsignedp = TREE_UNSIGNED (type);
-#ifdef PROMOTE_FUNCTION_ARGS
- mode = promote_mode (type, mode, &unsignedp, 1);
-#endif
+ if (targetm.calls.promote_function_args (fndecl ? TREE_TYPE (fndecl) : 0))
+ mode = promote_mode (type, mode, &unsignedp, 1);
args[i].unsignedp = unsignedp;
args[i].mode = mode;
@@ -1225,6 +1237,14 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
#endif
args[i].pass_on_stack ? 0 : args[i].partial,
fndecl, args_size, &args[i].locate);
+#ifdef BLOCK_REG_PADDING
+ else
+ /* The argument is passed entirely in registers. See at which
+ end it should be padded. */
+ args[i].locate.where_pad =
+ BLOCK_REG_PADDING (mode, type,
+ int_size_in_bytes (type) <= UNITS_PER_WORD);
+#endif
/* Update ARGS_SIZE, the total stack space for args so far. */
@@ -1574,35 +1594,67 @@ load_register_parameters (struct arg_data *args, int num_actuals,
{
rtx reg = ((flags & ECF_SIBCALL)
? args[i].tail_call_reg : args[i].reg);
- int partial = args[i].partial;
- int nregs;
-
if (reg)
{
+ int partial = args[i].partial;
+ int nregs;
+ int size = 0;
rtx before_arg = get_last_insn ();
/* Set to non-negative if must move a word at a time, even if just
one word (e.g, partial == 1 && mode == DFmode). Set to -1 if
we just use a normal move insn. This value can be zero if the
argument is a zero size structure with no fields. */
- nregs = (partial ? partial
- : (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode
- ? ((int_size_in_bytes (TREE_TYPE (args[i].tree_value))
- + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
- : -1));
+ nregs = -1;
+ if (partial)
+ nregs = partial;
+ else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode)
+ {
+ size = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
+ nregs = (size + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
+ }
+ else
+ size = GET_MODE_SIZE (args[i].mode);
/* Handle calls that pass values in multiple non-contiguous
locations. The Irix 6 ABI has examples of this. */
if (GET_CODE (reg) == PARALLEL)
- emit_group_load (reg, args[i].value,
- int_size_in_bytes (TREE_TYPE (args[i].tree_value)));
+ {
+ tree type = TREE_TYPE (args[i].tree_value);
+ emit_group_load (reg, args[i].value, type,
+ int_size_in_bytes (type));
+ }
/* If simple case, just do move. If normal partial, store_one_arg
has already loaded the register for us. In all other cases,
load the register(s) from memory. */
else if (nregs == -1)
- emit_move_insn (reg, args[i].value);
+ {
+ emit_move_insn (reg, args[i].value);
+#ifdef BLOCK_REG_PADDING
+ /* Handle case where we have a value that needs shifting
+ up to the msb. eg. a QImode value and we're padding
+ upward on a BYTES_BIG_ENDIAN machine. */
+ if (size < UNITS_PER_WORD
+ && (args[i].locate.where_pad
+ == (BYTES_BIG_ENDIAN ? upward : downward)))
+ {
+ rtx x;
+ int shift = (UNITS_PER_WORD - size) * BITS_PER_UNIT;
+
+ /* Assigning REG here rather than a temp makes CALL_FUSAGE
+ report the whole reg as used. Strictly speaking, the
+ call only uses SIZE bytes at the msb end, but it doesn't
+ seem worth generating rtl to say that. */
+ reg = gen_rtx_REG (word_mode, REGNO (reg));
+ x = expand_binop (word_mode, ashl_optab, reg,
+ GEN_INT (shift), reg, 1, OPTAB_WIDEN);
+ if (x != reg)
+ emit_move_insn (reg, x);
+ }
+#endif
+ }
/* If we have pre-computed the values to put in the registers in
the case of non-aligned structures, copy them in now. */
@@ -1613,9 +1665,30 @@ load_register_parameters (struct arg_data *args, int num_actuals,
args[i].aligned_regs[j]);
else if (partial == 0 || args[i].pass_on_stack)
- move_block_to_reg (REGNO (reg),
- validize_mem (args[i].value), nregs,
- args[i].mode);
+ {
+ rtx mem = validize_mem (args[i].value);
+
+#ifdef BLOCK_REG_PADDING
+ /* Handle a BLKmode that needs shifting. */
+ if (nregs == 1 && size < UNITS_PER_WORD
+ && args[i].locate.where_pad == downward)
+ {
+ rtx tem = operand_subword_force (mem, 0, args[i].mode);
+ rtx ri = gen_rtx_REG (word_mode, REGNO (reg));
+ rtx x = gen_reg_rtx (word_mode);
+ int shift = (UNITS_PER_WORD - size) * BITS_PER_UNIT;
+ optab dir = BYTES_BIG_ENDIAN ? lshr_optab : ashl_optab;
+
+ emit_move_insn (x, tem);
+ x = expand_binop (word_mode, dir, x, GEN_INT (shift),
+ ri, 1, OPTAB_WIDEN);
+ if (x != ri)
+ emit_move_insn (ri, x);
+ }
+ else
+#endif
+ move_block_to_reg (REGNO (reg), mem, nregs, args[i].mode);
+ }
/* When a parameter is a block, and perhaps in other cases, it is
possible that it did a load from an argument slot that was
@@ -1746,7 +1819,7 @@ try_to_integrate (tree fndecl, tree actparms, rtx target, int ignore,
if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline
&& optimize > 0 && !TREE_ADDRESSABLE (fndecl))
{
- warning_with_decl (fndecl, "inlining failed in call to `%s'");
+ warning ("%Jinlining failed in call to '%F'", fndecl, fndecl);
warning ("called from here");
}
(*lang_hooks.mark_addressable) (fndecl);
@@ -1985,6 +2058,7 @@ expand_call (tree exp, rtx target, int ignore)
/* Nonzero if called function returns an aggregate in memory PCC style,
by returning the address of where to find it. */
int pcc_struct_value = 0;
+ rtx struct_value = 0;
/* Number of actual parameters in this call, including struct value addr. */
int num_actuals;
@@ -2085,19 +2159,34 @@ expand_call (tree exp, rtx target, int ignore)
if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline
&& optimize > 0)
{
- warning_with_decl (fndecl, "can't inline call to `%s'");
+ warning ("%Jcan't inline call to '%F'", fndecl, fndecl);
warning ("called from here");
}
(*lang_hooks.mark_addressable) (fndecl);
}
+ if (ignore
+ && lookup_attribute ("warn_unused_result",
+ TYPE_ATTRIBUTES (TREE_TYPE (fndecl))))
+ warning ("ignoring return value of `%D', "
+ "declared with attribute warn_unused_result", fndecl);
+
flags |= flags_from_decl_or_type (fndecl);
}
/* If we don't have specific function to call, see if we have a
attributes set in the type. */
else
- flags |= flags_from_decl_or_type (TREE_TYPE (TREE_TYPE (p)));
+ {
+ if (ignore
+ && lookup_attribute ("warn_unused_result",
+ TYPE_ATTRIBUTES (TREE_TYPE (TREE_TYPE (p)))))
+ warning ("ignoring return value of function "
+ "declared with attribute warn_unused_result");
+ flags |= flags_from_decl_or_type (TREE_TYPE (TREE_TYPE (p)));
+ }
+
+ struct_value = targetm.calls.struct_value_rtx (fndecl ? TREE_TYPE (fndecl) : 0, 0);
/* Warn if this value is an aggregate type,
regardless of which calling convention we are using for it. */
@@ -2146,7 +2235,7 @@ expand_call (tree exp, rtx target, int ignore)
/* Set up a place to return a structure. */
/* Cater to broken compilers. */
- if (aggregate_value_p (exp))
+ if (aggregate_value_p (exp, fndecl))
{
/* This call returns a big structure. */
flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK);
@@ -2240,7 +2329,7 @@ expand_call (tree exp, rtx target, int ignore)
/* If struct_value_rtx is 0, it means pass the address
as if it were an extra parameter. */
- if (structure_value_addr && struct_value_rtx == 0)
+ if (structure_value_addr && struct_value == 0)
{
/* If structure_value_addr is a REG other than
virtual_outgoing_args_rtx, we can use always use it. If it
@@ -2266,6 +2355,14 @@ expand_call (tree exp, rtx target, int ignore)
for (p = actparms, num_actuals = 0; p; p = TREE_CHAIN (p))
num_actuals++;
+ /* Start updating where the next arg would go.
+
+ On some machines (such as the PA) indirect calls have a difuferent
+ calling convention than normal calls. The last argument in
+ INIT_CUMULATIVE_ARGS tells the backend if this is an indirect call
+ or not. */
+ INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl);
+
/* Compute number of named args.
Normally, don't include the last named arg if anonymous args follow.
We do include the last named arg if STRICT_ARGUMENT_NAMING is nonzero.
@@ -2282,30 +2379,22 @@ expand_call (tree exp, rtx target, int ignore)
reliable way to pass unnamed args in registers, so we must force
them into memory. */
- if ((STRICT_ARGUMENT_NAMING
- || ! PRETEND_OUTGOING_VARARGS_NAMED)
+ if ((targetm.calls.strict_argument_naming (&args_so_far)
+ || ! targetm.calls.pretend_outgoing_varargs_named (&args_so_far))
&& type_arg_types != 0)
n_named_args
= (list_length (type_arg_types)
/* Don't include the last named arg. */
- - (STRICT_ARGUMENT_NAMING ? 0 : 1)
+ - (targetm.calls.strict_argument_naming (&args_so_far) ? 0 : 1)
/* Count the struct value address, if it is passed as a parm. */
+ structure_value_addr_parm);
else
/* If we know nothing, treat all args as named. */
n_named_args = num_actuals;
- /* Start updating where the next arg would go.
-
- On some machines (such as the PA) indirect calls have a different
- calling convention than normal calls. The last argument in
- INIT_CUMULATIVE_ARGS tells the backend if this is an indirect call
- or not. */
- INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl);
-
/* Make a vector to hold all the information about each arg. */
- args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data));
- memset ((char *) args, 0, num_actuals * sizeof (struct arg_data));
+ args = alloca (num_actuals * sizeof (struct arg_data));
+ memset (args, 0, num_actuals * sizeof (struct arg_data));
/* Build up entries in the ARGS array, compute the size of the
arguments into ARGS_SIZE, etc. */
@@ -2695,8 +2784,7 @@ expand_call (tree exp, rtx target, int ignore)
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
- stack_usage_map
- = (char *) alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
@@ -2801,8 +2889,7 @@ expand_call (tree exp, rtx target, int ignore)
= stack_arg_under_construction;
stack_arg_under_construction = 0;
/* Make a new map for the new argument list. */
- stack_usage_map = (char *)
- alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
memset (stack_usage_map, 0, highest_outgoing_arg_in_use);
highest_outgoing_arg_in_use = 0;
}
@@ -2937,18 +3024,15 @@ expand_call (tree exp, rtx target, int ignore)
structure value. */
if (pass != 0 && structure_value_addr && ! structure_value_addr_parm)
{
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (structure_value_addr) != Pmode)
- structure_value_addr = convert_memory_address
- (Pmode, structure_value_addr);
-#endif
- emit_move_insn (struct_value_rtx,
+ structure_value_addr
+ = convert_memory_address (Pmode, structure_value_addr);
+ emit_move_insn (struct_value,
force_reg (Pmode,
force_operand (structure_value_addr,
NULL_RTX)));
- if (GET_CODE (struct_value_rtx) == REG)
- use_reg (&call_fusage, struct_value_rtx);
+ if (GET_CODE (struct_value) == REG)
+ use_reg (&call_fusage, struct_value);
}
funexp = prepare_call_address (funexp, fndecl, &call_fusage,
@@ -2995,10 +3079,19 @@ expand_call (tree exp, rtx target, int ignore)
if (pass && (flags & ECF_LIBCALL_BLOCK))
{
rtx insns;
+ rtx insn;
+ bool failed = valreg == 0 || GET_CODE (valreg) == PARALLEL;
- if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
+ insns = get_insns ();
+
+ /* Expansion of block moves possibly introduced a loop that may
+ not appear inside libcall block. */
+ for (insn = insns; insn; insn = NEXT_INSN (insn))
+ if (GET_CODE (insn) == JUMP_INSN)
+ failed = true;
+
+ if (failed)
{
- insns = get_insns ();
end_sequence ();
emit_insn (insns);
}
@@ -3019,7 +3112,6 @@ expand_call (tree exp, rtx target, int ignore)
args[i].initial_value, note);
note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
- insns = get_insns ();
end_sequence ();
if (flags & ECF_PURE)
@@ -3138,7 +3230,7 @@ expand_call (tree exp, rtx target, int ignore)
}
if (! rtx_equal_p (target, valreg))
- emit_group_store (target, valreg,
+ emit_group_store (target, valreg, TREE_TYPE (exp),
int_size_in_bytes (TREE_TYPE (exp)));
/* We can not support sibling calls for this case. */
@@ -3172,7 +3264,8 @@ expand_call (tree exp, rtx target, int ignore)
else
target = copy_to_reg (valreg);
-#ifdef PROMOTE_FUNCTION_RETURN
+ if (targetm.calls.promote_function_return(funtype))
+ {
/* If we promoted this return value, make the proper SUBREG. TARGET
might be const0_rtx here, so be careful. */
if (GET_CODE (target) == REG
@@ -3203,7 +3296,7 @@ expand_call (tree exp, rtx target, int ignore)
SUBREG_PROMOTED_VAR_P (target) = 1;
SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp);
}
-#endif
+ }
/* If size of args is variable or this was a constructor call for a stack
argument, restore saved stack-pointer value. */
@@ -3512,6 +3605,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
int initial_highest_arg_in_use = highest_outgoing_arg_in_use;
char *initial_stack_usage_map = stack_usage_map;
+ rtx struct_value = targetm.calls.struct_value_rtx (0, 0);
+
#ifdef REG_PARM_STACK_SPACE
#ifdef MAYBE_REG_PARM_STACK_SPACE
reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE;
@@ -3564,7 +3659,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
if (outmode != VOIDmode)
{
tfom = (*lang_hooks.types.type_for_mode) (outmode, 0);
- if (aggregate_value_p (tfom))
+ if (aggregate_value_p (tfom, 0))
{
#ifdef PCC_STATIC_STRUCT_RETURN
rtx pointer_reg
@@ -3596,8 +3691,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
of the full argument passing conventions to limit complexity here since
library functions shouldn't have many args. */
- argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
- memset ((char *) argvec, 0, (nargs + 1) * sizeof (struct arg));
+ argvec = alloca ((nargs + 1) * sizeof (struct arg));
+ memset (argvec, 0, (nargs + 1) * sizeof (struct arg));
#ifdef INIT_CUMULATIVE_LIBCALL_ARGS
INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
@@ -3619,7 +3714,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
/* If there's a structure value address to be passed,
either pass it in the special place, or pass it as an extra argument. */
- if (mem_value && struct_value_rtx == 0 && ! pcc_struct_value)
+ if (mem_value && struct_value == 0 && ! pcc_struct_value)
{
rtx addr = XEXP (mem_value, 0);
nargs++;
@@ -3667,13 +3762,6 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
|| (GET_MODE (val) != mode && GET_MODE (val) != VOIDmode))
abort ();
- /* On some machines, there's no way to pass a float to a library fcn.
- Pass it as a double instead. */
-#ifdef LIBGCC_NEEDS_DOUBLE
- if (LIBGCC_NEEDS_DOUBLE && mode == SFmode)
- val = convert_modes (DFmode, SFmode, val, 0), mode = DFmode;
-#endif
-
/* There's no need to call protect_from_queue, because
either emit_move_insn or emit_push_insn will do that. */
@@ -3832,7 +3920,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
- stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
@@ -3936,9 +4024,25 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
argvec[argnum].locate.offset.constant);
rtx stack_area
= gen_rtx_MEM (save_mode, memory_address (save_mode, adr));
- argvec[argnum].save_area = gen_reg_rtx (save_mode);
- emit_move_insn (argvec[argnum].save_area, stack_area);
+ if (save_mode == BLKmode)
+ {
+ argvec[argnum].save_area
+ = assign_stack_temp (BLKmode,
+ argvec[argnum].locate.size.constant,
+ 0);
+
+ emit_block_move (validize_mem (argvec[argnum].save_area),
+ stack_area,
+ GEN_INT (argvec[argnum].locate.size.constant),
+ BLOCK_OP_CALL_PARM);
+ }
+ else
+ {
+ argvec[argnum].save_area = gen_reg_rtx (save_mode);
+
+ emit_move_insn (argvec[argnum].save_area, stack_area);
+ }
}
}
@@ -3983,7 +4087,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
/* Handle calls that pass values in multiple non-contiguous
locations. The PA64 has examples of this for library calls. */
if (reg != 0 && GET_CODE (reg) == PARALLEL)
- emit_group_load (reg, val, GET_MODE_SIZE (GET_MODE (val)));
+ emit_group_load (reg, val, NULL_TREE, GET_MODE_SIZE (GET_MODE (val)));
else if (reg != 0 && partial == 0)
emit_move_insn (reg, val);
@@ -4001,14 +4105,14 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
}
/* Pass the function the address in which to return a structure value. */
- if (mem_value != 0 && struct_value_rtx != 0 && ! pcc_struct_value)
+ if (mem_value != 0 && struct_value != 0 && ! pcc_struct_value)
{
- emit_move_insn (struct_value_rtx,
+ emit_move_insn (struct_value,
force_reg (Pmode,
force_operand (XEXP (mem_value, 0),
NULL_RTX)));
- if (GET_CODE (struct_value_rtx) == REG)
- use_reg (&call_fusage, struct_value_rtx);
+ if (GET_CODE (struct_value) == REG)
+ use_reg (&call_fusage, struct_value);
}
/* Don't allow popping to be deferred, since then
@@ -4087,7 +4191,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
if (GET_CODE (valreg) == PARALLEL)
{
temp = gen_reg_rtx (outmode);
- emit_group_store (temp, valreg, outmode);
+ emit_group_store (temp, valreg, NULL_TREE,
+ GET_MODE_SIZE (outmode));
valreg = temp;
}
@@ -4130,7 +4235,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
{
if (value == 0)
value = gen_reg_rtx (outmode);
- emit_group_store (value, valreg, outmode);
+ emit_group_store (value, valreg, NULL_TREE, GET_MODE_SIZE (outmode));
}
else if (value != 0)
emit_move_insn (value, valreg);
@@ -4156,7 +4261,13 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
rtx stack_area = gen_rtx_MEM (save_mode,
memory_address (save_mode, adr));
- emit_move_insn (stack_area, argvec[count].save_area);
+ if (save_mode == BLKmode)
+ emit_block_move (stack_area,
+ validize_mem (argvec[count].save_area),
+ GEN_INT (argvec[count].locate.size.constant),
+ BLOCK_OP_CALL_PARM);
+ else
+ emit_move_insn (stack_area, argvec[count].save_area);
}
highest_outgoing_arg_in_use = initial_highest_arg_in_use;
diff --git a/gcc/cfg.c b/gcc/cfg.c
index ba4dd812a64..ded0e3263fb 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -155,7 +155,7 @@ init_flow (void)
if (!initialized)
{
gcc_obstack_init (&flow_obstack);
- flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
+ flow_firstobj = obstack_alloc (&flow_obstack, 0);
initialized = 1;
}
else
@@ -163,7 +163,7 @@ init_flow (void)
free_alloc_pool (bb_pool);
free_alloc_pool (edge_pool);
obstack_free (&flow_obstack, flow_firstobj);
- flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
+ flow_firstobj = obstack_alloc (&flow_obstack, 0);
}
bb_pool = create_alloc_pool ("Basic block pool",
sizeof (struct basic_block_def), 100);
@@ -491,48 +491,49 @@ dump_flow_info (FILE *file)
static const char * const reg_class_names[] = REG_CLASS_NAMES;
fprintf (file, "%d registers.\n", max_regno);
- for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
- if (REG_N_REFS (i))
- {
- enum reg_class class, altclass;
-
- fprintf (file, "\nRegister %d used %d times across %d insns",
- i, REG_N_REFS (i), REG_LIVE_LENGTH (i));
- if (REG_BASIC_BLOCK (i) >= 0)
- fprintf (file, " in block %d", REG_BASIC_BLOCK (i));
- if (REG_N_SETS (i))
- fprintf (file, "; set %d time%s", REG_N_SETS (i),
- (REG_N_SETS (i) == 1) ? "" : "s");
- if (regno_reg_rtx[i] != NULL && REG_USERVAR_P (regno_reg_rtx[i]))
- fprintf (file, "; user var");
- if (REG_N_DEATHS (i) != 1)
- fprintf (file, "; dies in %d places", REG_N_DEATHS (i));
- if (REG_N_CALLS_CROSSED (i) == 1)
- fprintf (file, "; crosses 1 call");
- else if (REG_N_CALLS_CROSSED (i))
- fprintf (file, "; crosses %d calls", REG_N_CALLS_CROSSED (i));
- if (regno_reg_rtx[i] != NULL
- && PSEUDO_REGNO_BYTES (i) != UNITS_PER_WORD)
- fprintf (file, "; %d bytes", PSEUDO_REGNO_BYTES (i));
-
- class = reg_preferred_class (i);
- altclass = reg_alternate_class (i);
- if (class != GENERAL_REGS || altclass != ALL_REGS)
- {
- if (altclass == ALL_REGS || class == ALL_REGS)
- fprintf (file, "; pref %s", reg_class_names[(int) class]);
- else if (altclass == NO_REGS)
- fprintf (file, "; %s or none", reg_class_names[(int) class]);
- else
- fprintf (file, "; pref %s, else %s",
- reg_class_names[(int) class],
- reg_class_names[(int) altclass]);
- }
+ if (reg_n_info)
+ for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
+ if (REG_N_REFS (i))
+ {
+ enum reg_class class, altclass;
+
+ fprintf (file, "\nRegister %d used %d times across %d insns",
+ i, REG_N_REFS (i), REG_LIVE_LENGTH (i));
+ if (REG_BASIC_BLOCK (i) >= 0)
+ fprintf (file, " in block %d", REG_BASIC_BLOCK (i));
+ if (REG_N_SETS (i))
+ fprintf (file, "; set %d time%s", REG_N_SETS (i),
+ (REG_N_SETS (i) == 1) ? "" : "s");
+ if (regno_reg_rtx[i] != NULL && REG_USERVAR_P (regno_reg_rtx[i]))
+ fprintf (file, "; user var");
+ if (REG_N_DEATHS (i) != 1)
+ fprintf (file, "; dies in %d places", REG_N_DEATHS (i));
+ if (REG_N_CALLS_CROSSED (i) == 1)
+ fprintf (file, "; crosses 1 call");
+ else if (REG_N_CALLS_CROSSED (i))
+ fprintf (file, "; crosses %d calls", REG_N_CALLS_CROSSED (i));
+ if (regno_reg_rtx[i] != NULL
+ && PSEUDO_REGNO_BYTES (i) != UNITS_PER_WORD)
+ fprintf (file, "; %d bytes", PSEUDO_REGNO_BYTES (i));
+
+ class = reg_preferred_class (i);
+ altclass = reg_alternate_class (i);
+ if (class != GENERAL_REGS || altclass != ALL_REGS)
+ {
+ if (altclass == ALL_REGS || class == ALL_REGS)
+ fprintf (file, "; pref %s", reg_class_names[(int) class]);
+ else if (altclass == NO_REGS)
+ fprintf (file, "; %s or none", reg_class_names[(int) class]);
+ else
+ fprintf (file, "; pref %s, else %s",
+ reg_class_names[(int) class],
+ reg_class_names[(int) altclass]);
+ }
- if (regno_reg_rtx[i] != NULL && REG_POINTER (regno_reg_rtx[i]))
- fprintf (file, "; pointer");
- fprintf (file, ".\n");
- }
+ if (regno_reg_rtx[i] != NULL && REG_POINTER (regno_reg_rtx[i]))
+ fprintf (file, "; pointer");
+ fprintf (file, ".\n");
+ }
fprintf (file, "\n%d basic blocks, %d edges.\n", n_basic_blocks, n_edges);
FOR_EACH_BB (bb)
@@ -636,7 +637,7 @@ dump_edge_info (FILE *file, edge e, int do_succ)
{
static const char * const bitnames[] = {
"fallthru", "ab", "abcall", "eh", "fake", "dfs_back",
- "can_fallthru", "irreducible", "sibcall"
+ "can_fallthru", "irreducible", "sibcall", "loop_exit"
};
int comma = 0;
int i, flags = e->flags;
@@ -697,7 +698,7 @@ alloc_aux_for_blocks (int size)
/* Check whether AUX data are still allocated. */
else if (first_block_aux_obj)
abort ();
- first_block_aux_obj = (char *) obstack_alloc (&block_aux_obstack, 0);
+ first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0);
if (size)
{
basic_block bb;
@@ -763,7 +764,7 @@ alloc_aux_for_edges (int size)
else if (first_edge_aux_obj)
abort ();
- first_edge_aux_obj = (char *) obstack_alloc (&edge_aux_obstack, 0);
+ first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0);
if (size)
{
basic_block bb;
@@ -819,9 +820,8 @@ verify_flow_info (void)
basic_block bb, last_bb_seen;
basic_block *last_visited;
- last_visited = (basic_block *) xcalloc (last_basic_block + 2,
- sizeof (basic_block));
- edge_checksum = (size_t *) xcalloc (last_basic_block + 2, sizeof (size_t));
+ last_visited = xcalloc (last_basic_block + 2, sizeof (basic_block));
+ edge_checksum = xcalloc (last_basic_block + 2, sizeof (size_t));
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index d3383c0646d..e45b48465e2 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -139,11 +139,11 @@ mark_dfs_back_edges (void)
bool found = false;
/* Allocate the preorder and postorder number arrays. */
- pre = (int *) xcalloc (last_basic_block, sizeof (int));
- post = (int *) xcalloc (last_basic_block, sizeof (int));
+ pre = xcalloc (last_basic_block, sizeof (int));
+ post = xcalloc (last_basic_block, sizeof (int));
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
@@ -402,8 +402,7 @@ find_unreachable_blocks (void)
edge e;
basic_block *tos, *worklist, bb;
- tos = worklist =
- (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* Clear all the reachability flags. */
@@ -473,10 +472,10 @@ create_edge_list (void)
num_edges++;
}
- elist = (struct edge_list *) xmalloc (sizeof (struct edge_list));
+ elist = xmalloc (sizeof (struct edge_list));
elist->num_blocks = block_count;
elist->num_edges = num_edges;
- elist->index_to_edge = (edge *) xmalloc (sizeof (edge) * num_edges);
+ elist->index_to_edge = xmalloc (sizeof (edge) * num_edges);
num_edges = 0;
@@ -735,7 +734,7 @@ flow_reverse_top_sort_order_compute (int *rts_order)
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
@@ -804,7 +803,7 @@ flow_depth_first_order_compute (int *dfs_order, int *rc_order)
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
@@ -909,12 +908,11 @@ flow_preorder_transversal_compute (int *pot_order)
basic_block bb;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate the tree. */
- dfst = (struct dfst_node *) xcalloc (last_basic_block,
- sizeof (struct dfst_node));
+ dfst = xcalloc (last_basic_block, sizeof (struct dfst_node));
FOR_EACH_BB (bb)
{
@@ -924,9 +922,7 @@ flow_preorder_transversal_compute (int *pot_order)
dfst[bb->index].node
= (max_successors
- ? (struct dfst_node **) xcalloc (max_successors,
- sizeof (struct dfst_node *))
- : NULL);
+ ? xcalloc (max_successors, sizeof (struct dfst_node *)) : NULL);
}
/* Allocate bitmap to track nodes that have been visited. */
@@ -1038,8 +1034,8 @@ static void
flow_dfs_compute_reverse_init (depth_first_search_ds data)
{
/* Allocate stack for back-tracking up CFG. */
- data->stack = (basic_block *) xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
- * sizeof (basic_block));
+ data->stack = xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
+ * sizeof (basic_block));
data->sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index eb7fd22e331..1fb43605972 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -121,7 +121,7 @@ control_flow_insn_p (rtx insn)
return (flag_non_call_exceptions && can_throw_internal (insn));
case BARRIER:
- /* It is nonsence to reach barrier when looking for the
+ /* It is nonsense to reach barrier when looking for the
end of basic block, but before dead code is eliminated
this may happen. */
return false;
@@ -725,9 +725,7 @@ compute_outgoing_frequencies (basic_block b)
if (!note)
return;
- probability = INTVAL (XEXP (find_reg_note (b->end,
- REG_BR_PROB, NULL),
- 0));
+ probability = INTVAL (XEXP (note, 0));
e = BRANCH_EDGE (b);
e->probability = probability;
e->count = ((b->count * probability + REG_BR_PROB_BASE / 2)
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 7dbed9b9705..32a9e653228 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -118,6 +118,8 @@ try_simplify_condjump (basic_block cbranch_block)
basic_block jump_block, jump_dest_block, cbranch_dest_block;
edge cbranch_jump_edge, cbranch_fallthru_edge;
rtx cbranch_insn;
+ rtx insn, next;
+ rtx end;
/* Verify that there are exactly two successors. */
if (!cbranch_block->succ
@@ -170,6 +172,26 @@ try_simplify_condjump (basic_block cbranch_block)
cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU;
update_br_prob_note (cbranch_block);
+ end = jump_block->end;
+ /* Deleting a block may produce unreachable code warning even when we are
+ not deleting anything live. Supress it by moving all the line number
+ notes out of the block. */
+ for (insn = jump_block->head; insn != NEXT_INSN (jump_block->end);
+ insn = next)
+ {
+ next = NEXT_INSN (insn);
+ if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
+ {
+ if (insn == jump_block->end)
+ {
+ jump_block->end = PREV_INSN (insn);
+ if (insn == end)
+ break;
+ }
+ reorder_insns_nobb (insn, insn, end);
+ end = insn;
+ }
+ }
/* Delete the block with the unconditional jump, and clean up the mess. */
delete_block (jump_block);
tidy_fallthru_edge (cbranch_jump_edge, cbranch_block, cbranch_dest_block);
@@ -227,7 +249,7 @@ mark_effect (rtx exp, regset nonequal)
}
}
-/* Return nonzero if X is an register set in regset DATA.
+/* Return nonzero if X is a register set in regset DATA.
Called via for_each_rtx. */
static int
mentions_nonequal_regs (rtx *x, void *data)
@@ -639,7 +661,8 @@ label_is_jump_target_p (rtx label, rtx jump_insn)
if (tablejump_p (jump_insn, NULL, &tmp))
{
- rtvec vec = XVEC (tmp, GET_CODE (tmp) == ADDR_DIFF_VEC);
+ rtvec vec = XVEC (PATTERN (tmp),
+ GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC);
int i, veclen = GET_NUM_ELEM (vec);
for (i = 0; i < veclen; ++i)
@@ -714,25 +737,20 @@ static void
merge_blocks_move_successor_nojumps (basic_block a, basic_block b)
{
rtx barrier, real_b_end;
+ rtx label, table;
real_b_end = b->end;
- barrier = NEXT_INSN (b->end);
- /* Recognize a jump table following block B. */
- if (barrier
- && GET_CODE (barrier) == CODE_LABEL
- && NEXT_INSN (barrier)
- && GET_CODE (NEXT_INSN (barrier)) == JUMP_INSN
- && (GET_CODE (PATTERN (NEXT_INSN (barrier))) == ADDR_VEC
- || GET_CODE (PATTERN (NEXT_INSN (barrier))) == ADDR_DIFF_VEC))
+ /* 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)
{
- /* Temporarily add the table jump insn to b, so that it will also
- be moved to the correct location. */
- b->end = NEXT_INSN (barrier);
- barrier = NEXT_INSN (b->end);
+ b->end = table;
}
/* There had better have been a barrier there. Delete it. */
+ barrier = NEXT_INSN (b->end);
if (barrier && GET_CODE (barrier) == BARRIER)
delete_insn (barrier);
@@ -1342,15 +1360,17 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
return false;
}
- /* In case we do have EH edges, ensure we are in the same region. */
- if (nehedges1)
- {
- rtx n1 = find_reg_note (bb1->end, REG_EH_REGION, 0);
- rtx n2 = find_reg_note (bb2->end, REG_EH_REGION, 0);
+ /* 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);
- if (XEXP (n1, 0) != XEXP (n2, 0))
- return false;
- }
+ if (!n1 && n2)
+ return false;
+
+ if (n1 && (!n2 || XEXP (n1, 0) != XEXP (n2, 0)))
+ return false;
+ }
/* We don't need to match the rest of edges as above checks should be enough
to ensure that they are equivalent. */
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 7172eaa7c3d..7121a3e5db4 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -435,13 +435,12 @@ insn_scope (rtx insn)
return VARRAY_TREE (block_locators_blocks, min);
}
-/* Return line number of the statement that produced this insn. */
+/* Return line number of the statement specified by the locator. */
int
-insn_line (rtx insn)
+locator_line (int loc)
{
int max = VARRAY_ACTIVE_SIZE (line_locators_locs);
int min = 0;
- int loc = INSN_LOCATOR (insn);
if (!max || !loc)
return 0;
@@ -463,13 +462,19 @@ insn_line (rtx insn)
return VARRAY_INT (line_locators_lines, min);
}
-/* Return source file of the statement that produced this insn. */
+/* Return line number of the statement that produced this insn. */
+int
+insn_line (rtx insn)
+{
+ return locator_line (INSN_LOCATOR (insn));
+}
+
+/* Return source file of the statement specified by LOC. */
const char *
-insn_file (rtx insn)
+locator_file (int loc)
{
int max = VARRAY_ACTIVE_SIZE (file_locators_locs);
int min = 0;
- int loc = INSN_LOCATOR (insn);
if (!max || !loc)
return NULL;
@@ -491,6 +496,13 @@ insn_file (rtx insn)
return VARRAY_CHAR_PTR (file_locators_files, min);
}
+/* Return source file of the statement that produced this insn. */
+const char *
+insn_file (rtx insn)
+{
+ return locator_file (INSN_LOCATOR (insn));
+}
+
/* Rebuild all the NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes based
on the scope tree and the newly reordered instructions. */
@@ -783,7 +795,7 @@ fixup_reorder_chain (void)
prev_bb->next_bb = EXIT_BLOCK_PTR;
EXIT_BLOCK_PTR->prev_bb = prev_bb;
- /* Anoying special case - jump around dead jumptables left in the code. */
+ /* Annoying special case - jump around dead jumptables left in the code. */
FOR_EACH_BB (bb)
{
edge e;
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index fac614ff28b..2f3ff3e4513 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -241,7 +241,7 @@ flow_loop_entry_edges_find (struct loop *loop)
if (! num_entries)
abort ();
- loop->entry_edges = (edge *) xmalloc (num_entries * sizeof (edge *));
+ loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
num_entries = 0;
for (e = loop->header->pred; e; e = e->pred_next)
@@ -288,7 +288,7 @@ flow_loop_exit_edges_find (struct loop *loop)
return;
}
- loop->exit_edges = (edge *) xmalloc (num_exits * sizeof (edge *));
+ loop->exit_edges = xmalloc (num_exits * sizeof (edge *));
/* Store all exiting edges into an array. */
num_exits = 0;
@@ -322,7 +322,7 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
if (loop->latch->loop_father != loop)
{
- stack = (basic_block *) xmalloc (n_basic_blocks * sizeof (basic_block));
+ stack = xmalloc (n_basic_blocks * sizeof (basic_block));
sp = 0;
num_nodes++;
stack[sp++] = loop->latch;
@@ -380,7 +380,7 @@ flow_loop_pre_header_scan (struct loop *loop)
num++)
ebb = ebb->pred->src;
- loop->pre_header_edges = (edge *) xmalloc (num * sizeof (edge));
+ loop->pre_header_edges = xmalloc (num * sizeof (edge));
loop->num_pre_header_edges = num;
/* Store edges in order that they are followed. The source of the first edge
@@ -817,7 +817,7 @@ flow_loops_find (struct loops *loops, int flags)
}
/* Allocate loop structures. */
- loops->parray = (struct loop **) xcalloc (num_loops + 1, sizeof (struct loop *));
+ loops->parray = xcalloc (num_loops + 1, sizeof (struct loop *));
/* Dummy loop containing whole function. */
loops->parray[0] = xcalloc (1, sizeof (struct loop));
@@ -844,8 +844,8 @@ flow_loops_find (struct loops *loops, int flags)
{
/* Compute depth first search order of the CFG so that outer
natural loops will be found before inner natural loops. */
- dfs_order = (int *) xmalloc (n_basic_blocks * sizeof (int));
- rc_order = (int *) xmalloc (n_basic_blocks * sizeof (int));
+ dfs_order = xmalloc (n_basic_blocks * sizeof (int));
+ rc_order = xmalloc (n_basic_blocks * sizeof (int));
flow_depth_first_order_compute (dfs_order, rc_order);
/* Save CFG derived information to avoid recomputing it. */
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index 5502844ce4f..57c3baceff4 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -470,7 +470,7 @@ count_strange_loop_iterations (rtx init, rtx lim, enum rtx_code cond,
/* If we are able to prove that we don't pass the first test, we are
done. */
- rqmt = simplify_gen_relational (cond, SImode, mode, init, lim);
+ rqmt = simplify_relational_operation (cond, mode, init, lim);
if (rqmt == const0_rtx)
return const0_rtx;
@@ -557,10 +557,10 @@ count_strange_loop_iterations (rtx init, rtx lim, enum rtx_code cond,
abort ();
}
- /* If this is const_true_rtx and we did not take a conservative aproximation
+ /* If this is const_true_rtx and we did not take a conservative approximation
of after_wrap above, we might iterate the calculation (but of course we
would have to take care about infinite cases). Ignore this for now. */
- rqmt = simplify_gen_relational (cond, SImode, mode, after_wrap, lim);
+ rqmt = simplify_relational_operation (cond, mode, after_wrap, lim);
if (rqmt != const0_rtx)
return NULL_RTX;
@@ -775,7 +775,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)))
+ if (!(condition = get_condition (exit_bb->end, NULL, false)))
return false;
if (!simple_condition_p (loop, condition, invariant_regs, desc))
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 8892720069d..26eb9fd6e3b 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -988,6 +988,27 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
/* Copy bbs. */
copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop, loops);
+ /* Note whether the blocks and edges belong to an irreducible loop. */
+ if (add_irreducible_flag)
+ {
+ for (i = 0; i < n; i++)
+ new_bbs[i]->rbi->duplicated = 1;
+ for (i = 0; i < n; i++)
+ {
+ new_bb = new_bbs[i];
+ if (new_bb->loop_father == target)
+ new_bb->flags |= BB_IRREDUCIBLE_LOOP;
+
+ for (ae = new_bb->succ; ae; ae = ae->succ_next)
+ if (ae->dest->rbi->duplicated
+ && (ae->src->loop_father == target
+ || ae->dest->loop_father == target))
+ ae->flags |= EDGE_IRREDUCIBLE_LOOP;
+ }
+ for (i = 0; i < n; i++)
+ new_bbs[i]->rbi->duplicated = 0;
+ }
+
/* Redirect the special edges. */
if (is_latch)
{
@@ -1011,22 +1032,6 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
if (orig && TEST_BIT (wont_exit, j + 1))
to_remove[(*n_to_remove)++] = new_spec_edges[SE_ORIG];
- /* Note whether the blocks and edges belong to an irreducible loop. */
- if (add_irreducible_flag)
- {
- for (i = 0; i < n; i++)
- {
- new_bb = new_bbs[i];
- if (new_bb->loop_father == target)
- new_bb->flags |= BB_IRREDUCIBLE_LOOP;
-
- for (ae = new_bb->succ; ae; ae = ae->succ_next)
- if (ae->src->loop_father == target
- || ae->dest->loop_father == target)
- ae->flags |= EDGE_IRREDUCIBLE_LOOP;
- }
- }
-
/* Record the first copy in the control flow order if it is not
the original loop (i.e. in case of peeling). */
if (!first_active_latch)
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index d197b79380a..f383438e26b 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1036,19 +1036,16 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
{
/* Create the new structures. */
+ /* 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;
+
/* Position the new block correctly relative to loop notes. */
- note = last_loop_beg_note (e->src->end);
+ note = last_loop_beg_note (note);
note = NEXT_INSN (note);
- /* ... and ADDR_VECs. */
- if (note != NULL
- && GET_CODE (note) == CODE_LABEL
- && NEXT_INSN (note)
- && GET_CODE (NEXT_INSN (note)) == JUMP_INSN
- && (GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_DIFF_VEC
- || GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_VEC))
- note = NEXT_INSN (NEXT_INSN (note));
-
jump_block = create_basic_block (note, NULL, e->src);
jump_block->count = e->count;
jump_block->frequency = EDGE_FREQUENCY (e);
@@ -1724,12 +1721,9 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first)
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
- basic_block *start
- = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
- basic_block *end
- = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
- enum bb_state *in_bb_p
- = (enum bb_state *) xcalloc (max_uid, sizeof (enum bb_state));
+ basic_block *start = xcalloc (max_uid, sizeof (basic_block));
+ basic_block *end = xcalloc (max_uid, sizeof (basic_block));
+ enum bb_state *in_bb_p = xcalloc (max_uid, sizeof (enum bb_state));
basic_block bb;
@@ -1835,7 +1829,7 @@ rtl_verify_flow_info_1 (void)
int err = 0;
basic_block bb, last_bb_seen;
- bb_info = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
+ bb_info = xcalloc (max_uid, sizeof (basic_block));
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
@@ -1910,7 +1904,10 @@ rtl_verify_flow_info_1 (void)
if (e->flags & EDGE_FALLTHRU)
n_fallthru++, fallthru = e;
- if ((e->flags & ~(EDGE_DFS_BACK | EDGE_CAN_FALLTHRU | EDGE_IRREDUCIBLE_LOOP)) == 0)
+ if ((e->flags & ~(EDGE_DFS_BACK
+ | EDGE_CAN_FALLTHRU
+ | EDGE_IRREDUCIBLE_LOOP
+ | EDGE_LOOP_EXIT)) == 0)
n_branch++;
if (e->flags & EDGE_ABNORMAL_CALL)
@@ -2258,8 +2255,12 @@ purge_dead_edges (basic_block bb)
continue;
else if ((e->flags & EDGE_EH) && can_throw_internal (insn))
/* Keep the edges that correspond to exceptions thrown by
- this instruction. */
- continue;
+ this instruction and rematerialize the EDGE_ABNORMAL
+ flag we just cleared above. */
+ {
+ e->flags |= EDGE_ABNORMAL;
+ continue;
+ }
/* We do not need this edge. */
bb->flags |= BB_DIRTY;
@@ -2555,7 +2556,7 @@ cfg_layout_delete_block (basic_block bb)
}
}
-/* return true when blocks A and B can be safely merged. */
+/* Return true when blocks A and B can be safely merged. */
static bool
cfg_layout_can_merge_blocks_p (basic_block a, basic_block b)
{
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 7bc065b79d3..43238e58ecd 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -48,6 +48,9 @@ struct cgraph_node *cgraph_nodes_queue;
/* Number of nodes in existence. */
int cgraph_n_nodes;
+/* Maximal uid used in cgraph nodes. */
+int cgraph_max_uid;
+
/* Set when whole unit has been analyzed so we can access global info. */
bool cgraph_global_info_ready = false;
@@ -63,17 +66,16 @@ int cgraph_varpool_n_nodes;
/* The linked list of cgraph varpool nodes. */
static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes;
-static struct cgraph_edge *create_edge PARAMS ((struct cgraph_node *,
- struct cgraph_node *));
-static void cgraph_remove_edge PARAMS ((struct cgraph_node *, struct cgraph_node *));
-static hashval_t hash_node PARAMS ((const void *));
-static int eq_node PARAMS ((const void *, const void *));
+static struct cgraph_edge *create_edge (struct cgraph_node *,
+ struct cgraph_node *);
+static void cgraph_remove_edge (struct cgraph_node *, struct cgraph_node *);
+static hashval_t hash_node (const void *);
+static int eq_node (const void *, const void *);
/* Returns a hash code for P. */
static hashval_t
-hash_node (p)
- const void *p;
+hash_node (const void *p)
{
return ((hashval_t)
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
@@ -83,9 +85,7 @@ hash_node (p)
/* Returns nonzero if P1 and P2 are equal. */
static int
-eq_node (p1, p2)
- const void *p1;
- const void *p2;
+eq_node (const void *p1, const void *p2)
{
return ((DECL_ASSEMBLER_NAME (((struct cgraph_node *) p1)->decl)) ==
(tree) p2);
@@ -93,8 +93,7 @@ eq_node (p1, p2)
/* Return cgraph node assigned to DECL. Create new one when needed. */
struct cgraph_node *
-cgraph_node (decl)
- tree decl;
+cgraph_node (tree decl)
{
struct cgraph_node *node;
struct cgraph_node **slot;
@@ -114,6 +113,7 @@ cgraph_node (decl)
node = ggc_alloc_cleared (sizeof (*node));
node->decl = decl;
node->next = cgraph_nodes;
+ node->uid = cgraph_max_uid++;
if (cgraph_nodes)
cgraph_nodes->previous = node;
node->previous = NULL;
@@ -131,8 +131,7 @@ cgraph_node (decl)
/* Try to find existing function for identifier ID. */
struct cgraph_node *
-cgraph_node_for_identifier (id)
- tree id;
+cgraph_node_for_identifier (tree id)
{
struct cgraph_node **slot;
@@ -144,7 +143,7 @@ cgraph_node_for_identifier (id)
slot = (struct cgraph_node **)
htab_find_slot_with_hash (cgraph_hash, id,
- IDENTIFIER_HASH_VALUE (id), 0);
+ IDENTIFIER_HASH_VALUE (id), 0);
if (!slot)
return NULL;
return *slot;
@@ -153,10 +152,22 @@ cgraph_node_for_identifier (id)
/* Create edge from CALLER to CALLEE in the cgraph. */
static struct cgraph_edge *
-create_edge (caller, callee)
- struct cgraph_node *caller, *callee;
+create_edge (struct cgraph_node *caller, struct cgraph_node *callee)
{
struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge));
+ struct cgraph_edge *edge2;
+
+ edge->inline_call = false;
+ /* At the moment we don't associate calls with specific CALL_EXPRs
+ as we probably ought to, so we must preserve inline_call flags to
+ be the same in all copies of the same edge. */
+ if (cgraph_global_info_ready)
+ for (edge2 = caller->callees; edge2; edge2 = edge2->next_callee)
+ if (edge2->callee == callee)
+ {
+ edge->inline_call = edge2->inline_call;
+ break;
+ }
edge->caller = caller;
edge->callee = callee;
@@ -170,8 +181,7 @@ create_edge (caller, callee)
/* Remove the edge from CALLER to CALLEE in the cgraph. */
static void
-cgraph_remove_edge (caller, callee)
- struct cgraph_node *caller, *callee;
+cgraph_remove_edge (struct cgraph_node *caller, struct cgraph_node *callee)
{
struct cgraph_edge **edge, **edge2;
@@ -192,9 +202,9 @@ cgraph_remove_edge (caller, callee)
/* Remove the node from cgraph. */
void
-cgraph_remove_node (node)
- struct cgraph_node *node;
+cgraph_remove_node (struct cgraph_node *node)
{
+ void **slot;
while (node->callers)
cgraph_remove_edge (node->callers->caller, node);
while (node->callees)
@@ -216,44 +226,59 @@ cgraph_remove_node (node)
if (node->next)
node->next->previous = node->previous;
DECL_SAVED_TREE (node->decl) = NULL;
+ slot =
+ htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (node->decl),
+ IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
+ (node->decl)), 1);
+ htab_clear_slot (cgraph_hash, slot);
/* Do not free the structure itself so the walk over chain can continue. */
}
-/* Notify finalize_compilation_unit that given node is reachable
- or needed. */
+/* Notify finalize_compilation_unit that given node is reachable. */
+
void
-cgraph_mark_needed_node (node, needed)
- struct cgraph_node *node;
- int needed;
+cgraph_mark_reachable_node (struct cgraph_node *node)
{
- if (needed)
- {
- node->needed = 1;
- }
- if (!node->reachable)
+ if (!node->reachable && node->local.finalized)
{
+ notice_global_symbol (node->decl);
node->reachable = 1;
- if (DECL_SAVED_TREE (node->decl))
+
+ node->next_needed = cgraph_nodes_queue;
+ cgraph_nodes_queue = node;
+
+ /* At the moment frontend automatically emits all nested functions. */
+ if (node->nested)
{
- node->next_needed = cgraph_nodes_queue;
- cgraph_nodes_queue = node;
- }
+ struct cgraph_node *node2;
+
+ for (node2 = node->nested; node2; node2 = node2->next_nested)
+ if (!node2->reachable)
+ cgraph_mark_reachable_node (node2);
+ }
}
}
+/* Likewise indicate that a node is needed, i.e. reachable via some
+ external means. */
+
+void
+cgraph_mark_needed_node (struct cgraph_node *node)
+{
+ node->needed = 1;
+ cgraph_mark_reachable_node (node);
+}
/* Record call from CALLER to CALLEE */
struct cgraph_edge *
-cgraph_record_call (caller, callee)
- tree caller, callee;
+cgraph_record_call (tree caller, tree callee)
{
return create_edge (cgraph_node (caller), cgraph_node (callee));
}
void
-cgraph_remove_call (caller, callee)
- tree caller, callee;
+cgraph_remove_call (tree caller, tree callee)
{
cgraph_remove_edge (cgraph_node (caller), cgraph_node (callee));
}
@@ -261,8 +286,7 @@ cgraph_remove_call (caller, callee)
/* Return true when CALLER_DECL calls CALLEE_DECL. */
bool
-cgraph_calls_p (caller_decl, callee_decl)
- tree caller_decl, callee_decl;
+cgraph_calls_p (tree caller_decl, tree callee_decl)
{
struct cgraph_node *caller = cgraph_node (caller_decl);
struct cgraph_node *callee = cgraph_node (callee_decl);
@@ -277,8 +301,7 @@ cgraph_calls_p (caller_decl, callee_decl)
/* Return local info for the compiled function. */
struct cgraph_local_info *
-cgraph_local_info (decl)
- tree decl;
+cgraph_local_info (tree decl)
{
struct cgraph_node *node;
if (TREE_CODE (decl) != FUNCTION_DECL)
@@ -290,8 +313,7 @@ cgraph_local_info (decl)
/* Return local info for the compiled function. */
struct cgraph_global_info *
-cgraph_global_info (decl)
- tree decl;
+cgraph_global_info (tree decl)
{
struct cgraph_node *node;
if (TREE_CODE (decl) != FUNCTION_DECL || !cgraph_global_info_ready)
@@ -303,8 +325,7 @@ cgraph_global_info (decl)
/* Return local info for the compiled function. */
struct cgraph_rtl_info *
-cgraph_rtl_info (decl)
- tree decl;
+cgraph_rtl_info (tree decl)
{
struct cgraph_node *node;
if (TREE_CODE (decl) != FUNCTION_DECL)
@@ -318,8 +339,7 @@ cgraph_rtl_info (decl)
/* Return name of the node used in debug output. */
const char *
-cgraph_node_name (node)
- struct cgraph_node *node;
+cgraph_node_name (struct cgraph_node *node)
{
return (*lang_hooks.decl_printable_name) (node->decl, 2);
}
@@ -327,8 +347,7 @@ cgraph_node_name (node)
/* Dump the callgraph. */
void
-dump_cgraph (f)
- FILE *f;
+dump_cgraph (FILE *f)
{
struct cgraph_node *node;
@@ -337,6 +356,8 @@ dump_cgraph (f)
{
struct cgraph_edge *edge;
fprintf (f, "%s", cgraph_node_name (node));
+ if (node->local.self_insns)
+ fprintf (f, " %i insns", node->local.self_insns);
if (node->origin)
fprintf (f, " nested in: %s", cgraph_node_name (node->origin));
if (node->needed)
@@ -346,13 +367,30 @@ dump_cgraph (f)
if (DECL_SAVED_TREE (node->decl))
fprintf (f, " tree");
- fprintf (f, "\n called by :");
+ if (node->local.disregard_inline_limits)
+ fprintf (f, " always_inline");
+ else if (node->local.inlinable)
+ fprintf (f, " inlinable");
+ if (node->global.insns && node->global.insns != node->local.self_insns)
+ fprintf (f, " %i insns after inlining", node->global.insns);
+ if (node->global.cloned_times > 1)
+ fprintf (f, " cloned %ix", node->global.cloned_times);
+
+ fprintf (f, "\n called by: ");
for (edge = node->callers; edge; edge = edge->next_caller)
- fprintf (f, "%s ", cgraph_node_name (edge->caller));
+ {
+ fprintf (f, "%s ", cgraph_node_name (edge->caller));
+ if (edge->inline_call)
+ fprintf(f, "(inlined) ");
+ }
fprintf (f, "\n calls: ");
for (edge = node->callees; edge; edge = edge->next_callee)
- fprintf (f, "%s ", cgraph_node_name (edge->callee));
+ {
+ fprintf (f, "%s ", cgraph_node_name (edge->callee));
+ if (edge->inline_call)
+ fprintf(f, "(inlined) ");
+ }
fprintf (f, "\n");
}
}
@@ -360,7 +398,7 @@ dump_cgraph (f)
/* Returns a hash code for P. */
static hashval_t
-cgraph_varpool_hash_node (const PTR p)
+cgraph_varpool_hash_node (const void *p)
{
return ((hashval_t)
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
@@ -370,7 +408,7 @@ cgraph_varpool_hash_node (const PTR p)
/* Returns nonzero if P1 and P2 are equal. */
static int
-eq_cgraph_varpool_node (const PTR p1, const PTR p2)
+eq_cgraph_varpool_node (const void *p1, const void *p2)
{
return ((DECL_ASSEMBLER_NAME (((struct cgraph_varpool_node *) p1)->decl)) ==
(tree) p2);
@@ -434,6 +472,7 @@ cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *node)
{
node->next_needed = cgraph_varpool_nodes_queue;
cgraph_varpool_nodes_queue = node;
+ notice_global_symbol (node->decl);
}
node->needed = 1;
}
@@ -442,11 +481,18 @@ void
cgraph_varpool_finalize_decl (tree decl)
{
struct cgraph_varpool_node *node = cgraph_varpool_node (decl);
-
- if (node->needed && !node->finalized)
+
+ /* The first declaration of a variable that comes through this function
+ decides whether it is global (in C, has external linkage)
+ or local (in C, has internal linkage). So do nothing more
+ if this function has already run. */
+ if (node->finalized)
+ return;
+ if (node->needed)
{
node->next_needed = cgraph_varpool_nodes_queue;
cgraph_varpool_nodes_queue = node;
+ notice_global_symbol (decl);
}
node->finalized = true;
@@ -464,7 +510,7 @@ cgraph_varpool_finalize_decl (tree decl)
}
bool
-cgraph_varpool_assemble_pending_decls ()
+cgraph_varpool_assemble_pending_decls (void)
{
bool changed = false;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 65bda0717cc..eb747d57d37 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -23,20 +23,22 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define GCC_CGRAPH_H
/* Information about the function collected locally.
- Available after function is lowered */
+ Available after function is analyzed. */
struct cgraph_local_info GTY(())
{
/* Set when function function is visible in current compilation unit only
and it's address is never taken. */
bool local;
- /* Set when function is small enough to be inlinable many times. */
- bool inline_many;
- /* Set when function can be inlined once (false only for functions calling
- alloca, using varargs and so on). */
- bool can_inline_once;
/* Set once it has been finalized so we consider it to be output. */
bool finalized;
+
+ /* False when there something makes inlining impossible (such as va_arg). */
+ bool inlinable;
+ /* True when function should be inlined independently on it's size. */
+ bool disregard_inline_limits;
+ /* Size of the function before inlining. */
+ int self_insns;
};
/* Information about the function that needs to be computed globally
@@ -46,6 +48,17 @@ struct cgraph_global_info GTY(())
{
/* Set when the function will be inlined exactly once. */
bool inline_once;
+
+ /* Estimated size of the function after inlining. */
+ int insns;
+
+ /* Number of times given function will be cloned during output. */
+ int cloned_times;
+
+ /* Set to true for all reachable functions before inlining is decided.
+ Once we inline all calls to the function and the function is local,
+ it is set to false. */
+ bool will_be_output;
};
/* Information about the function that is propagated by the RTL backend.
@@ -62,7 +75,7 @@ struct cgraph_rtl_info GTY(())
/* The cgraph data strutcture.
Each function decl has assigned cgraph_node listing callees and callers. */
-struct cgraph_node GTY(())
+struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
{
tree decl;
struct cgraph_edge *callees;
@@ -77,6 +90,8 @@ struct cgraph_node GTY(())
struct cgraph_node *next_nested;
/* Pointer to the next function in cgraph_nodes_queue. */
struct cgraph_node *next_needed;
+ /* Unique id of the node. */
+ int uid;
PTR GTY ((skip (""))) aux;
/* Set when function must be output - it is externally visible
@@ -85,10 +100,9 @@ struct cgraph_node GTY(())
/* Set when function is reachable by call from other function
that is either reachable or needed. */
bool reachable;
- /* Set when the frontend has been asked to lower representation of this
- function into trees. Callees lists are not available when lowered
- is not set. */
- bool lowered;
+ /* Set once the function has been instantiated and its callee
+ lists created. */
+ bool analyzed;
/* Set when function is scheduled to be assembled. */
bool output;
struct cgraph_local_info local;
@@ -102,6 +116,7 @@ struct cgraph_edge GTY(())
struct cgraph_node *callee;
struct cgraph_edge *next_caller;
struct cgraph_edge *next_callee;
+ bool inline_call;
};
/* The cgraph_varpool data strutcture.
@@ -124,6 +139,7 @@ struct cgraph_varpool_node GTY(())
extern GTY(()) struct cgraph_node *cgraph_nodes;
extern GTY(()) int cgraph_n_nodes;
+extern GTY(()) int cgraph_max_uid;
extern bool cgraph_global_info_ready;
extern GTY(()) struct cgraph_node *cgraph_nodes_queue;
extern FILE *cgraph_dump_file;
@@ -133,17 +149,17 @@ extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
/* In cgraph.c */
-void dump_cgraph PARAMS ((FILE *));
-void cgraph_remove_call PARAMS ((tree, tree));
-void cgraph_remove_node PARAMS ((struct cgraph_node *));
-struct cgraph_edge *cgraph_record_call PARAMS ((tree, tree));
-struct cgraph_node *cgraph_node PARAMS ((tree decl));
-struct cgraph_node *cgraph_node_for_identifier PARAMS ((tree id));
-bool cgraph_calls_p PARAMS ((tree, tree));
-struct cgraph_local_info *cgraph_local_info PARAMS ((tree));
-struct cgraph_global_info *cgraph_global_info PARAMS ((tree));
-struct cgraph_rtl_info *cgraph_rtl_info PARAMS ((tree));
-const char * cgraph_node_name PARAMS ((struct cgraph_node *));
+void dump_cgraph (FILE *);
+void cgraph_remove_call (tree, tree);
+void cgraph_remove_node (struct cgraph_node *);
+struct cgraph_edge *cgraph_record_call (tree, tree);
+struct cgraph_node *cgraph_node (tree decl);
+struct cgraph_node *cgraph_node_for_identifier (tree id);
+bool cgraph_calls_p (tree, tree);
+struct cgraph_local_info *cgraph_local_info (tree);
+struct cgraph_global_info *cgraph_global_info (tree);
+struct cgraph_rtl_info *cgraph_rtl_info (tree);
+const char * cgraph_node_name (struct cgraph_node *);
struct cgraph_varpool_node *cgraph_varpool_node (tree decl);
struct cgraph_varpool_node *cgraph_varpool_node_for_identifier (tree id);
@@ -152,10 +168,13 @@ void cgraph_varpool_finalize_decl (tree);
bool cgraph_varpool_assemble_pending_decls (void);
/* In cgraphunit.c */
-void cgraph_finalize_function PARAMS ((tree, tree));
-void cgraph_finalize_compilation_unit PARAMS ((void));
-void cgraph_create_edges PARAMS ((tree, tree));
-void cgraph_optimize PARAMS ((void));
-void cgraph_mark_needed_node PARAMS ((struct cgraph_node *, int));
+bool cgraph_assemble_pending_functions (void);
+void cgraph_finalize_function (tree, bool);
+void cgraph_finalize_compilation_unit (void);
+void cgraph_create_edges (tree, tree);
+void cgraph_optimize (void);
+void cgraph_mark_needed_node (struct cgraph_node *);
+void cgraph_mark_reachable_node (struct cgraph_node *);
+bool cgraph_inline_p (tree, tree);
#endif /* GCC_CGRAPH_H */
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index ad504dd08e5..f615d1bafa4 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1,4 +1,4 @@
-/* Callgraph handling code.
+/* Callgraph based intraprocedural optimizations.
Copyright (C) 2003 Free Software Foundation, Inc.
Contributed by Jan Hubicka
@@ -35,111 +35,321 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "cgraph.h"
#include "diagnostic.h"
#include "timevar.h"
+#include "params.h"
+#include "fibheap.h"
+#include "c-common.h"
+
+#define INSNS_PER_CALL 10
+
+static void cgraph_expand_functions (void);
+static void cgraph_mark_functions_to_output (void);
+static void cgraph_expand_function (struct cgraph_node *);
+static tree record_call_1 (tree *, int *, void *);
+static void cgraph_mark_local_functions (void);
+static void cgraph_optimize_function (struct cgraph_node *);
+static bool cgraph_default_inline_p (struct cgraph_node *n);
+static void cgraph_analyze_function (struct cgraph_node *node);
+
+/* Statistics we collect about inlining algorithm. */
+static int ncalls_inlined;
+static int nfunctions_inlined;
+static int initial_insns;
+static int overall_insns;
+
+/* Records tree nodes seen in cgraph_create_edges. Simply using
+ walk_tree_without_duplicates doesn't guarantee each node is visited
+ once because it gets a new htab upon each recursive call from
+ record_calls_1. */
+static htab_t visited_nodes;
+
+/* Determine if function DECL is needed. That is, visible to something
+ either outside this translation unit, something magic in the system
+ configury, or (if not doing unit-at-a-time) to something we havn't
+ seen yet. */
+
+static bool
+decide_is_function_needed (struct cgraph_node *node, tree decl)
+{
+ /* If we decided it was needed before, but at the time we didn't have
+ the body of the function available, then it's still needed. We have
+ to go back and re-check its dependencies now. */
+ if (node->needed)
+ return true;
+
+ /* Externally visible functions must be output. The exception is
+ COMDAT functions that must be output only when they are needed. */
+ if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
+ return true;
+
+ /* Constructors and destructors are reachable from the runtime by
+ some mechanism. */
+ if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl))
+ return true;
+
+ /* If the user told us it is used, then it must be so. */
+ if (lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
+ return true;
+
+ /* ??? If the assembler name is set by hand, it is possible to assemble
+ the name later after finalizing the function and the fact is noticed
+ in assemble_name then. This is arguably a bug. */
+ if (DECL_ASSEMBLER_NAME_SET_P (decl)
+ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
+ return true;
+
+ if (flag_unit_at_a_time)
+ return false;
+
+ /* If not doing unit at a time, then we'll only defer this function
+ if its marked for inlining. Otherwise we want to emit it now. */
+
+ /* "extern inline" functions are never output locally. */
+ if (DECL_EXTERNAL (decl))
+ return false;
+ /* We want to emit COMDAT functions only when absolutely neccesary. */
+ if (DECL_COMDAT (decl))
+ return false;
+ if (!DECL_INLINE (decl)
+ || (!node->local.disregard_inline_limits
+ /* When declared inline, defer even the uninlinable functions.
+ This allows them to be elliminated when unused. */
+ && !DECL_DECLARED_INLINE_P (decl)
+ && (node->local.inlinable || !cgraph_default_inline_p (node))))
+ return true;
+
+ return false;
+}
+
+/* When not doing unit-at-a-time, output all functions enqueued.
+ Return true when such a functions were found. */
+
+bool
+cgraph_assemble_pending_functions (void)
+{
+ bool output = false;
+
+ if (flag_unit_at_a_time)
+ return false;
+
+ while (cgraph_nodes_queue)
+ {
+ struct cgraph_node *n = cgraph_nodes_queue;
+
+ cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
+ if (!n->origin && !DECL_EXTERNAL (n->decl))
+ {
+ cgraph_expand_function (n);
+ output = true;
+ }
+ }
-static void cgraph_expand_functions PARAMS ((void));
-static void cgraph_mark_functions_to_output PARAMS ((void));
-static void cgraph_expand_function PARAMS ((struct cgraph_node *));
-static tree record_call_1 PARAMS ((tree *, int *, void *));
-static void cgraph_mark_local_functions PARAMS ((void));
-static void cgraph_mark_functions_to_inline_once PARAMS ((void));
-static void cgraph_optimize_function PARAMS ((struct cgraph_node *));
+ return output;
+}
-/* Analyze function once it is parsed. Set up the local information
- available - create cgraph edges for function calls via BODY. */
+/* DECL has been parsed. Take it, queue it, compile it at the whim of the
+ logic in effect. If NESTED is true, then our caller cannot stand to have
+ the garbage collector run at the moment. We would need to either create
+ a new GC context, or just not compile right now. */
void
-cgraph_finalize_function (decl, body)
- tree decl;
- tree body ATTRIBUTE_UNUSED;
+cgraph_finalize_function (tree decl, bool nested)
{
struct cgraph_node *node = cgraph_node (decl);
+ if (node->local.finalized)
+ {
+ /* As an GCC extension we allow redefinition of the function. The
+ semantics when both copies of bodies differ is not well defined.
+ We replace the old body with new body so in unit at a time mode
+ we always use new body, while in normal mode we may end up with
+ old body inlined into some functions and new body expanded and
+ inlined in others.
+
+ ??? It may make more sense to use one body for inlining and other
+ body for expanding the function but this is dificult to do. */
+
+ /* If node->output is set, then this is a unit-at-a-time compilation
+ and we have already begun whole-unit analysis. This is *not*
+ testing for whether we've already emitted the function. That
+ case can be sort-of legitimately seen with real function
+ redefinition errors. I would argue that the front end should
+ never present us with such a case, but don't enforce that for now. */
+ if (node->output)
+ abort ();
+
+ /* Reset our datastructures so we can analyze the function again. */
+ memset (&node->local, 0, sizeof (node->local));
+ memset (&node->global, 0, sizeof (node->global));
+ memset (&node->rtl, 0, sizeof (node->rtl));
+ node->analyzed = false;
+ while (node->callees)
+ cgraph_remove_call (node->decl, node->callees->callee->decl);
+
+ /* We may need to re-queue the node for assembling in case
+ we already proceeded it and ignored as not needed. */
+ if (node->reachable && !flag_unit_at_a_time)
+ {
+ struct cgraph_node *n;
+
+ for (n = cgraph_nodes_queue; n; n = n->next_needed)
+ if (n == node)
+ break;
+ if (!n)
+ node->reachable = 0;
+ }
+ }
+
+ notice_global_symbol (decl);
node->decl = decl;
node->local.finalized = true;
- if (/* Externally visible functions must be output. The exception are
- COMDAT functions that must be output only when they are needed.
- Similarly are handled deferred functions and
- external functions (GCC extension "extern inline") */
- (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
- /* ??? Constructors and destructors not called otherwise can be inlined
- into single construction/destruction function per section to save some
- resources. For now just mark it as reachable. */
- || DECL_STATIC_CONSTRUCTOR (decl)
- || DECL_STATIC_DESTRUCTOR (decl)
- /* Function whose name is output to the assembler file must be produced.
- It is possible to assemble the name later after finalizing the function
- and the fact is noticed in assemble_name then. */
- || (DECL_ASSEMBLER_NAME_SET_P (decl)
- && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
- {
- cgraph_mark_needed_node (node, 1);
- }
+ /* If not unit at a time, then we need to create the call graph
+ now, so that called functions can be queued and emitted now. */
+ if (!flag_unit_at_a_time)
+ cgraph_analyze_function (node);
+
+ if (decide_is_function_needed (node, decl))
+ cgraph_mark_needed_node (node);
+
+ /* If not unit at a time, go ahead and emit everything we've found
+ to be reachable at this time. */
+ if (!nested)
+ cgraph_assemble_pending_functions ();
- (*debug_hooks->deferred_inline_function) (decl);
+ /* If we've not yet emitted decl, tell the debug info about it. */
+ if (!TREE_ASM_WRITTEN (decl))
+ (*debug_hooks->deferred_inline_function) (decl);
}
/* Walk tree and record all calls. Called via walk_tree. */
static tree
-record_call_1 (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees;
- void *data;
+record_call_1 (tree *tp, int *walk_subtrees, void *data)
{
- if (TREE_CODE (*tp) == VAR_DECL && TREE_STATIC (*tp))
- cgraph_varpool_mark_needed_node (cgraph_varpool_node (*tp));
- /* Record dereferences to the functions. This makes the functions
- reachable unconditionally. */
- else if (TREE_CODE (*tp) == ADDR_EXPR)
- {
- tree decl = TREE_OPERAND (*tp, 0);
- if (TREE_CODE (decl) == FUNCTION_DECL)
- cgraph_mark_needed_node (cgraph_node (decl), 1);
- }
- else if (TREE_CODE (*tp) == CALL_EXPR)
+ tree t = *tp;
+
+ switch (TREE_CODE (t))
{
- tree decl = get_callee_fndecl (*tp);
- if (decl && TREE_CODE (decl) == FUNCTION_DECL)
+ case VAR_DECL:
+ /* ??? Really, we should mark this decl as *potentially* referenced
+ by this function and re-examine whether the decl is actually used
+ after rtl has been generated. */
+ if (TREE_STATIC (t))
+ cgraph_varpool_mark_needed_node (cgraph_varpool_node (t));
+ break;
+
+ case ADDR_EXPR:
+ if (flag_unit_at_a_time)
+ {
+ /* Record dereferences to the functions. This makes the
+ functions reachable unconditionally. */
+ tree decl = TREE_OPERAND (*tp, 0);
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ cgraph_mark_needed_node (cgraph_node (decl));
+ }
+ break;
+
+ case CALL_EXPR:
+ {
+ tree decl = get_callee_fndecl (*tp);
+ if (decl && TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ if (DECL_BUILT_IN (decl))
+ return NULL;
+ cgraph_record_call (data, decl);
+
+ /* When we see a function call, we don't want to look at the
+ function reference in the ADDR_EXPR that is hanging from
+ the CALL_EXPR we're examining here, because we would
+ conclude incorrectly that the function's address could be
+ taken by something that is not a function call. So only
+ walk the function parameter list, skip the other subtrees. */
+
+ walk_tree (&TREE_OPERAND (*tp, 1), record_call_1, data,
+ visited_nodes);
+ *walk_subtrees = 0;
+ }
+ break;
+ }
+
+ default:
+ /* Save some cycles by not walking types and declaration as we
+ won't find anything useful there anyway. */
+ if (DECL_P (*tp) || TYPE_P (*tp))
{
- if (DECL_BUILT_IN (decl))
- return NULL;
- cgraph_record_call (data, decl);
-
- /* When we see a function call, we don't want to look at the
- function reference in the ADDR_EXPR that is hanging from
- the CALL_EXPR we're examining here, because we would
- conclude incorrectly that the function's address could be
- taken by something that is not a function call. So only
- walk the function parameter list, skip the other subtrees. */
-
- walk_tree (&TREE_OPERAND (*tp, 1), record_call_1, data, NULL);
*walk_subtrees = 0;
+ break;
}
+
+ if ((unsigned int) TREE_CODE (t) >= LAST_AND_UNUSED_TREE_CODE)
+ return (*lang_hooks.callgraph.analyze_expr) (tp, walk_subtrees, data);
+ break;
}
+
return NULL;
}
/* Create cgraph edges for function calls inside BODY from DECL. */
void
-cgraph_create_edges (decl, body)
- tree decl;
- tree body;
+cgraph_create_edges (tree decl, tree body)
{
/* The nodes we're interested in are never shared, so walk
the tree ignoring duplicates. */
- walk_tree_without_duplicates (&body, record_call_1, decl);
+ visited_nodes = htab_create (37, htab_hash_pointer,
+ htab_eq_pointer, NULL);
+ walk_tree (&body, record_call_1, decl, visited_nodes);
+ htab_delete (visited_nodes);
+ visited_nodes = NULL;
+}
+
+/* Analyze the function scheduled to be output. */
+static void
+cgraph_analyze_function (struct cgraph_node *node)
+{
+ tree decl = node->decl;
+
+ current_function_decl = decl;
+
+ /* First kill forward declaration so reverse inlining works properly. */
+ cgraph_create_edges (decl, DECL_SAVED_TREE (decl));
+
+ node->local.inlinable = tree_inlinable_function_p (decl);
+ if (!DECL_ESTIMATED_INSNS (decl))
+ DECL_ESTIMATED_INSNS (decl)
+ = (*lang_hooks.tree_inlining.estimate_num_insns) (decl);
+ node->local.self_insns = DECL_ESTIMATED_INSNS (decl);
+ if (node->local.inlinable)
+ node->local.disregard_inline_limits
+ = (*lang_hooks.tree_inlining.disregard_inline_limits) (decl);
+
+ /* Inlining characteristics are maintained by the cgraph_mark_inline. */
+ node->global.insns = node->local.self_insns;
+ if (!DECL_EXTERNAL (decl))
+ {
+ node->global.cloned_times = 1;
+ node->global.will_be_output = true;
+ }
+
+ node->analyzed = true;
+ current_function_decl = NULL;
}
/* Analyze the whole compilation unit once it is parsed completely. */
void
-cgraph_finalize_compilation_unit ()
+cgraph_finalize_compilation_unit (void)
{
struct cgraph_node *node;
- struct cgraph_edge *edge;
+
+ if (!flag_unit_at_a_time)
+ {
+ cgraph_assemble_pending_functions ();
+ return;
+ }
cgraph_varpool_assemble_pending_decls ();
+ if (!quiet_flag)
+ fprintf (stderr, "\nAnalyzing compilation unit\n");
timevar_push (TV_CGRAPH);
if (cgraph_dump_file)
@@ -157,48 +367,30 @@ cgraph_finalize_compilation_unit ()
method table generation for instance). */
while (cgraph_nodes_queue)
{
+ struct cgraph_edge *edge;
tree decl = cgraph_nodes_queue->decl;
node = cgraph_nodes_queue;
cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
- if (node->lowered || !node->reachable || !DECL_SAVED_TREE (decl))
- abort ();
-
- if (lang_hooks.callgraph.lower_function)
- (*lang_hooks.callgraph.lower_function) (decl);
-
- current_function_decl = node->decl;
- if (!node->needed && !DECL_COMDAT (node->decl))
- node->local.can_inline_once = tree_inlinable_function_p (decl, 1);
- else
- node->local.can_inline_once = 0;
- if (flag_inline_trees)
- node->local.inline_many = tree_inlinable_function_p (decl, 0);
- else
- node->local.inline_many = 0;
-
- /* At the moment frontend automatically emits all nested functions. */
- if (node->nested)
- {
- struct cgraph_node *node2;
+ /* ??? It is possible to create extern inline function and later using
+ weak alas attribute to kill it's body. See
+ gcc.c-torture/compile/20011119-1.c */
+ if (!DECL_SAVED_TREE (decl))
+ continue;
- for (node2 = node->nested; node2; node2 = node2->next_nested)
- if (!node2->reachable)
- cgraph_mark_needed_node (node2, 0);
- }
+ if (node->analyzed || !node->reachable || !DECL_SAVED_TREE (decl))
+ abort ();
- /* First kill forward declaration so reverse inling works properly. */
- cgraph_create_edges (decl, DECL_SAVED_TREE (decl));
+ cgraph_analyze_function (node);
for (edge = node->callees; edge; edge = edge->next_callee)
- {
- if (!edge->callee->reachable)
- cgraph_mark_needed_node (edge->callee, 0);
- }
- node->lowered = true;
+ if (!edge->callee->reachable)
+ cgraph_mark_reachable_node (edge->callee);
+
cgraph_varpool_assemble_pending_decls ();
}
+
/* Collect entry points to the unit. */
if (cgraph_dump_file)
@@ -208,6 +400,7 @@ cgraph_finalize_compilation_unit ()
if (node->needed && DECL_SAVED_TREE (node->decl))
fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
fprintf (cgraph_dump_file, "\n");
+ dump_cgraph (cgraph_dump_file);
}
if (cgraph_dump_file)
@@ -233,23 +426,27 @@ cgraph_finalize_compilation_unit ()
/* Figure out what functions we want to assemble. */
static void
-cgraph_mark_functions_to_output ()
+cgraph_mark_functions_to_output (void)
{
struct cgraph_node *node;
for (node = cgraph_nodes; node; node = node->next)
{
tree decl = node->decl;
+ struct cgraph_edge *e;
+ if (node->output)
+ abort ();
+
+ for (e = node->callers; e; e = e->next_caller)
+ if (!e->inline_call)
+ break;
/* We need to output all local functions that are used and not
always inlined, as well as those that are reachable from
outside the current compilation unit. */
if (DECL_SAVED_TREE (decl)
&& (node->needed
- || (!node->local.inline_many && !node->global.inline_once
- && node->reachable)
- || (DECL_ASSEMBLER_NAME_SET_P (decl)
- && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
+ || (e && node->reachable))
&& !TREE_ASM_WRITTEN (decl) && !node->origin
&& !DECL_EXTERNAL (decl))
node->output = 1;
@@ -259,12 +456,13 @@ cgraph_mark_functions_to_output ()
/* Optimize the function before expansion. */
static void
-cgraph_optimize_function (node)
- struct cgraph_node *node;
+cgraph_optimize_function (struct cgraph_node *node)
{
tree decl = node->decl;
timevar_push (TV_INTEGRATION);
+ /* optimize_inline_calls avoids inlining of current_function_decl. */
+ current_function_decl = decl;
if (flag_inline_trees)
optimize_inline_calls (decl);
if (node->nested)
@@ -278,12 +476,13 @@ cgraph_optimize_function (node)
/* Expand function specified by NODE. */
static void
-cgraph_expand_function (node)
- struct cgraph_node *node;
+cgraph_expand_function (struct cgraph_node *node)
{
tree decl = node->decl;
+ struct cgraph_edge *e;
- announce_function (decl);
+ if (flag_unit_at_a_time)
+ announce_function (decl);
cgraph_optimize_function (node);
@@ -291,41 +490,36 @@ cgraph_expand_function (node)
via lang_expand_decl_stmt. */
(*lang_hooks.callgraph.expand_function) (decl);
- /* When we decided to inline the function once, we never ever should
- need to output it separately. */
- if (node->global.inline_once)
- abort ();
- if (!node->local.inline_many
- || !node->callers)
- DECL_SAVED_TREE (decl) = NULL;
+ 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;
+ }
current_function_decl = NULL;
}
-
-/* Expand all functions that must be output.
-
- Attempt to topologically sort the nodes so function is output when
- all called functions are already assembled to allow data to be
- propagated across the callgraph. Use a stack to get smaller distance
- between a function and it's callees (later we may choose to use a more
- sophisticated algorithm for function reordering; we will likely want
- to use subsections to make the output functions appear in top-down
- order. */
-
-static void
-cgraph_expand_functions ()
+/* Fill array order with all nodes with output flag set in the reverse
+ topological order. */
+static int
+cgraph_postorder (struct cgraph_node **order)
{
struct cgraph_node *node, *node2;
- struct cgraph_node **stack =
- xcalloc (sizeof (struct cgraph_node *), cgraph_n_nodes);
- struct cgraph_node **order =
- xcalloc (sizeof (struct cgraph_node *), cgraph_n_nodes);
int stack_size = 0;
int order_pos = 0;
struct cgraph_edge *edge, last;
- int i;
- cgraph_mark_functions_to_output ();
+ struct cgraph_node **stack =
+ xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *));
/* We have to deal with cycles nicely, so use a depth first traversal
output algorithm. Ignore the fact that some functions won't need
@@ -371,97 +565,716 @@ cgraph_expand_functions ()
}
}
}
- for (i = order_pos - 1; i >= 0; i--)
+ free (stack);
+ return order_pos;
+}
+
+#define INLINED_TIMES(node) ((size_t)(node)->aux)
+#define SET_INLINED_TIMES(node,times) ((node)->aux = (void *)(times))
+
+/* Return list of nodes we decided to inline NODE into, set their output
+ flag and compute INLINED_TIMES.
+
+ We do simple backtracing to get INLINED_TIMES right. This should not be
+ expensive as we limit the amount of inlining. Alternatively we may first
+ discover set of nodes, topologically sort these and propagate
+ INLINED_TIMES */
+
+static int
+cgraph_inlined_into (struct cgraph_node *node, struct cgraph_node **array)
+{
+ int nfound = 0;
+ struct cgraph_edge **stack;
+ struct cgraph_edge *e, *e1;
+ int sp;
+ int i;
+
+ /* Fast path: since we traverse in mostly topological order, we will likely
+ find no edges. */
+ for (e = node->callers; e; e = e->next_caller)
+ if (e->inline_call)
+ break;
+
+ if (!e)
+ return 0;
+
+ /* Allocate stack for back-tracking up callgraph. */
+ stack = xmalloc ((cgraph_n_nodes + 1) * sizeof (struct cgraph_edge));
+ sp = 0;
+
+ /* Push the first edge on to the stack. */
+ stack[sp++] = e;
+
+ while (sp)
{
- node = order[i];
- if (node->output)
+ struct cgraph_node *caller;
+
+ /* Look at the edge on the top of the stack. */
+ e = stack[sp - 1];
+ caller = e->caller;
+
+ /* Check if the caller destination has been visited yet. */
+ if (!caller->output)
{
- if (!node->reachable)
- abort ();
- node->output = 0;
- cgraph_expand_function (node);
+ array[nfound++] = e->caller;
+ /* Mark that we have visited the destination. */
+ caller->output = true;
+ SET_INLINED_TIMES (caller, 0);
+ }
+ SET_INLINED_TIMES (caller, INLINED_TIMES (caller) + 1);
+
+ for (e1 = caller->callers; e1; e1 = e1->next_caller)
+ if (e1->inline_call)
+ break;
+ if (e1)
+ stack[sp++] = e1;
+ else
+ {
+ while (true)
+ {
+ for (e1 = e->next_caller; e1; e1 = e1->next_caller)
+ if (e1->inline_call)
+ break;
+
+ if (e1)
+ {
+ stack[sp - 1] = e1;
+ break;
+ }
+ else
+ {
+ sp--;
+ if (!sp)
+ break;
+ e = stack[sp - 1];
+ }
+ }
}
}
+
free (stack);
- free (order);
+
+
+ if (cgraph_dump_file)
+ {
+ fprintf (cgraph_dump_file, "Found inline predecesors of %s:",
+ cgraph_node_name (node));
+ for (i = 0; i < nfound; i++)
+ {
+ fprintf (cgraph_dump_file, " %s", cgraph_node_name (array[i]));
+ if (INLINED_TIMES (array[i]) != 1)
+ fprintf (cgraph_dump_file, " (%i times)",
+ (int)INLINED_TIMES (array[i]));
+ }
+ fprintf (cgraph_dump_file, "\n");
+ }
+
+ return nfound;
}
-/* Mark all local functions.
- We can not use node->needed directly as it is modified during
- execution of cgraph_optimize. */
+/* Return list of nodes we decided to inline into NODE, set their output
+ flag and compute INLINED_TIMES.
+
+ This function is identical to cgraph_inlined_into with callers and callees
+ nodes swapped. */
+
+static int
+cgraph_inlined_callees (struct cgraph_node *node, struct cgraph_node **array)
+{
+ int nfound = 0;
+ struct cgraph_edge **stack;
+ struct cgraph_edge *e, *e1;
+ int sp;
+ int i;
+
+ /* Fast path: since we traverse in mostly topological order, we will likely
+ find no edges. */
+ for (e = node->callees; e; e = e->next_callee)
+ if (e->inline_call)
+ break;
+
+ if (!e)
+ return 0;
+
+ /* Allocate stack for back-tracking up callgraph. */
+ stack = xmalloc ((cgraph_n_nodes + 1) * sizeof (struct cgraph_edge));
+ sp = 0;
+
+ /* Push the first edge on to the stack. */
+ stack[sp++] = e;
+
+ while (sp)
+ {
+ struct cgraph_node *callee;
+
+ /* Look at the edge on the top of the stack. */
+ e = stack[sp - 1];
+ callee = e->callee;
+
+ /* Check if the callee destination has been visited yet. */
+ if (!callee->output)
+ {
+ array[nfound++] = e->callee;
+ /* Mark that we have visited the destination. */
+ callee->output = true;
+ SET_INLINED_TIMES (callee, 0);
+ }
+ SET_INLINED_TIMES (callee, INLINED_TIMES (callee) + 1);
+
+ for (e1 = callee->callees; e1; e1 = e1->next_callee)
+ if (e1->inline_call)
+ break;
+ if (e1)
+ stack[sp++] = e1;
+ else
+ {
+ while (true)
+ {
+ for (e1 = e->next_callee; e1; e1 = e1->next_callee)
+ if (e1->inline_call)
+ break;
+
+ if (e1)
+ {
+ stack[sp - 1] = e1;
+ break;
+ }
+ else
+ {
+ sp--;
+ if (!sp)
+ break;
+ e = stack[sp - 1];
+ }
+ }
+ }
+ }
+
+ free (stack);
+
+ if (cgraph_dump_file)
+ {
+ fprintf (cgraph_dump_file, "Found inline successors of %s:",
+ cgraph_node_name (node));
+ for (i = 0; i < nfound; i++)
+ {
+ fprintf (cgraph_dump_file, " %s", cgraph_node_name (array[i]));
+ if (INLINED_TIMES (array[i]) != 1)
+ fprintf (cgraph_dump_file, " (%i times)",
+ (int)INLINED_TIMES (array[i]));
+ }
+ fprintf (cgraph_dump_file, "\n");
+ }
+
+ return nfound;
+}
+
+/* Estimate size of the function after inlining WHAT into TO. */
+
+static int
+cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to,
+ struct cgraph_node *what)
+{
+ return (what->global.insns - INSNS_PER_CALL) *times + to->global.insns;
+}
+
+/* Estimate the growth caused by inlining NODE into all callees. */
+
+static int
+cgraph_estimate_growth (struct cgraph_node *node)
+{
+ int growth = 0;
+ int calls_saved = 0;
+ int clones_added = 0;
+ struct cgraph_edge *e;
+
+ for (e = node->callers; e; e = e->next_caller)
+ if (!e->inline_call)
+ {
+ growth += ((cgraph_estimate_size_after_inlining (1, e->caller, node)
+ -
+ e->caller->global.insns) *e->caller->global.cloned_times);
+ calls_saved += e->caller->global.cloned_times;
+ clones_added += e->caller->global.cloned_times;
+ }
+
+ /* ??? Wrong for self recursive functions or cases where we decide to not
+ inline for different reasons, but it is not big deal as in that case
+ we will keep the body around, but we will also avoid some inlining. */
+ if (!node->needed && !node->origin && !DECL_EXTERNAL (node->decl))
+ growth -= node->global.insns, clones_added--;
+
+ if (!calls_saved)
+ calls_saved = 1;
+
+ return growth;
+}
+
+/* Update insn sizes after inlining WHAT into TO that is already inlined into
+ all nodes in INLINED array. */
+
+static void
+cgraph_mark_inline (struct cgraph_node *to, struct cgraph_node *what,
+ struct cgraph_node **inlined, int ninlined,
+ struct cgraph_node **inlined_callees,
+ int ninlined_callees)
+{
+ int i;
+ int times = 0;
+ int clones = 0;
+ struct cgraph_edge *e;
+ bool called = false;
+ int new_insns;
+
+ for (e = what->callers; e; e = e->next_caller)
+ {
+ if (e->caller == to)
+ {
+ if (e->inline_call)
+ abort ();
+ e->inline_call = true;
+ times++;
+ clones += e->caller->global.cloned_times;
+ }
+ else if (!e->inline_call)
+ called = true;
+ }
+ if (!times)
+ abort ();
+ ncalls_inlined += times;
+
+ new_insns = cgraph_estimate_size_after_inlining (times, to, what);
+ if (to->global.will_be_output)
+ overall_insns += new_insns - to->global.insns;
+ to->global.insns = new_insns;
+
+ if (!called && !what->needed && !what->origin
+ && !DECL_EXTERNAL (what->decl))
+ {
+ if (!what->global.will_be_output)
+ abort ();
+ clones--;
+ nfunctions_inlined++;
+ what->global.will_be_output = 0;
+ overall_insns -= what->global.insns;
+ }
+ what->global.cloned_times += clones;
+ for (i = 0; i < ninlined; i++)
+ {
+ new_insns =
+ cgraph_estimate_size_after_inlining (INLINED_TIMES (inlined[i]) *
+ times, inlined[i], what);
+ if (inlined[i]->global.will_be_output)
+ overall_insns += new_insns - inlined[i]->global.insns;
+ inlined[i]->global.insns = new_insns;
+ }
+ for (i = 0; i < ninlined_callees; i++)
+ {
+ inlined_callees[i]->global.cloned_times +=
+ INLINED_TIMES (inlined_callees[i]) * clones;
+ }
+}
+
+/* Return false when inlining WHAT into TO is not good idea as it would cause
+ too large growth of function bodies. */
+
+static bool
+cgraph_check_inline_limits (struct cgraph_node *to, struct cgraph_node *what,
+ struct cgraph_node **inlined, int ninlined)
+{
+ int i;
+ int times = 0;
+ struct cgraph_edge *e;
+ int newsize;
+ int limit;
+
+ for (e = to->callees; e; e = e->next_callee)
+ if (e->callee == what)
+ times++;
+
+ /* When inlining large function body called once into small function,
+ take the inlined function as base for limiting the growth. */
+ if (to->local.self_insns > what->local.self_insns)
+ limit = to->local.self_insns;
+ else
+ limit = what->local.self_insns;
+
+ limit += limit * PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH) / 100;
+
+ newsize = cgraph_estimate_size_after_inlining (times, to, what);
+ if (newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS)
+ && newsize > limit)
+ return false;
+ for (i = 0; i < ninlined; i++)
+ {
+ newsize =
+ cgraph_estimate_size_after_inlining (INLINED_TIMES (inlined[i]) *
+ times, inlined[i], what);
+ if (newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS)
+ && newsize >
+ inlined[i]->local.self_insns *
+ (100 + PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH)) / 100)
+ return false;
+ }
+ return true;
+}
+
+/* Return true when function N is small enought to be inlined. */
+
+static bool
+cgraph_default_inline_p (struct cgraph_node *n)
+{
+ if (!DECL_INLINE (n->decl) || !DECL_SAVED_TREE (n->decl))
+ return false;
+ if (DECL_DECLARED_INLINE_P (n->decl))
+ return n->global.insns < MAX_INLINE_INSNS_SINGLE;
+ else
+ return n->global.insns < MAX_INLINE_INSNS_AUTO;
+}
+
+/* We use greedy algorithm for inlining of small functions:
+ 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
+ to be passed to cgraph_inlined_into and cgraph_inlined_callees. */
static void
-cgraph_mark_local_functions ()
+cgraph_decide_inlining_of_small_functions (struct cgraph_node **inlined,
+ struct cgraph_node **inlined_callees)
{
+ int i;
struct cgraph_node *node;
+ fibheap_t heap = fibheap_new ();
+ struct fibnode **heap_node =
+ xcalloc (cgraph_max_uid, sizeof (struct fibnode *));
+ int ninlined, ninlined_callees;
+ int max_insns = ((HOST_WIDEST_INT) initial_insns
+ * (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100);
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Marking local functions:");
+ /* Put all inline candidates into the heap. */
- /* Figure out functions we want to assemble. */
for (node = cgraph_nodes; node; node = node->next)
{
- node->local.local = (!node->needed
- && DECL_SAVED_TREE (node->decl)
- && !DECL_COMDAT (node->decl)
- && !TREE_PUBLIC (node->decl));
- if (cgraph_dump_file && node->local.local)
- fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
+ struct cgraph_edge *e;
+
+ if (!node->local.inlinable || !node->callers
+ || !cgraph_default_inline_p (node))
+ continue;
+
+ /* Rule out always_inline functions we dealt with earlier. */
+ for (e = node->callers; e; e = e->next_caller)
+ if (e->inline_call)
+ break;
+ if (e)
+ continue;
+ heap_node[node->uid] =
+ fibheap_insert (heap, cgraph_estimate_growth (node), node);
}
+
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "\n");
+ fprintf (cgraph_dump_file, "\n\nDeciding on inlining: ");
+ while ((node = fibheap_extract_min (heap)) && overall_insns <= max_insns)
+ {
+ struct cgraph_edge *e;
+ int old_insns = overall_insns;
+
+ heap_node[node->uid] = NULL;
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Considering %s %i insns, growth %i.\n",
+ cgraph_node_name (node), node->global.insns,
+ cgraph_estimate_growth (node));
+ if (!cgraph_default_inline_p (node))
+ {
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Function too large.\n");
+ continue;
+ }
+ ninlined_callees = cgraph_inlined_callees (node, inlined_callees);
+ for (e = node->callers; e; e = e->next_caller)
+ if (!e->inline_call && e->caller != node)
+ {
+ ninlined = cgraph_inlined_into (e->caller, inlined);
+ if (e->callee->output
+ || !cgraph_check_inline_limits (e->caller, node, inlined,
+ ninlined))
+ {
+ for (i = 0; i < ninlined; i++)
+ inlined[i]->output = 0, node->aux = 0;
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Not inlining into %s\n",
+ cgraph_node_name (e->caller));
+ continue;
+ }
+ cgraph_mark_inline (e->caller, node, inlined, ninlined,
+ inlined_callees, ninlined_callees);
+ if (heap_node[e->caller->uid])
+ fibheap_replace_key (heap, heap_node[e->caller->uid],
+ cgraph_estimate_growth (e->caller));
+
+ /* Size of the functions we updated into has changed, so update
+ the keys. */
+ for (i = 0; i < ninlined; i++)
+ {
+ inlined[i]->output = 0, node->aux = 0;
+ if (heap_node[inlined[i]->uid])
+ fibheap_replace_key (heap, heap_node[inlined[i]->uid],
+ cgraph_estimate_growth (inlined[i]));
+ }
+ }
+
+ /* Similarly all functions called by function we just inlined
+ are now called more times; update keys. */
+
+ for (e = node->callees; e; e = e->next_callee)
+ if (!e->inline_call && heap_node[e->callee->uid])
+ fibheap_replace_key (heap, heap_node[e->callee->uid],
+ cgraph_estimate_growth (e->callee));
+
+ for (i = 0; i < ninlined_callees; i++)
+ {
+ struct cgraph_edge *e;
+
+ for (e = inlined_callees[i]->callees; e; e = e->next_callee)
+ if (!e->inline_call && heap_node[e->callee->uid])
+ fibheap_replace_key (heap, heap_node[e->callee->uid],
+ cgraph_estimate_growth (e->callee));
+
+ inlined_callees[i]->output = 0, node->aux = 0;
+ }
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file,
+ "Created %i clones, Num insns:%i (%+i), %.2f%%.\n\n",
+ node->global.cloned_times - 1,
+ overall_insns, overall_insns - old_insns,
+ overall_insns * 100.0 / initial_insns);
+ }
+ if (cgraph_dump_file && !fibheap_empty (heap))
+ fprintf (cgraph_dump_file, "inline-unit-growth limit reached.\n");
+ fibheap_delete (heap);
+ free (heap_node);
}
-/* Decide what function should be inlined because they are invoked once
- (so inlining won't result in duplication of the code). */
+/* Decide on the inlining. We do so in the topological order to avoid
+ expenses on updating datastructures. */
static void
-cgraph_mark_functions_to_inline_once ()
+cgraph_decide_inlining (void)
{
- struct cgraph_node *node, *node1;
+ struct cgraph_node *node;
+ int nnodes;
+ struct cgraph_node **order =
+ xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *));
+ struct cgraph_node **inlined =
+ xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *));
+ struct cgraph_node **inlined_callees =
+ xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *));
+ int ninlined;
+ int ninlined_callees;
+ int i, y;
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "\n\nMarking functions to inline once:");
+ for (node = cgraph_nodes; node; node = node->next)
+ initial_insns += node->local.self_insns;
+ overall_insns = initial_insns;
+
+ nnodes = cgraph_postorder (order);
- /* Now look for function called only once and mark them to inline.
- From this point number of calls to given function won't grow. */
for (node = cgraph_nodes; node; node = node->next)
+ node->aux = 0;
+
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "\n\nDeciding on always_inline functions:\n");
+
+ /* In the first pass mark all always_inline edges. Do this with a priority
+ so no our decisions makes this impossible. */
+ for (i = nnodes - 1; i >= 0; i--)
+ {
+ struct cgraph_edge *e;
+
+ node = order[i];
+
+ for (e = node->callees; e; e = e->next_callee)
+ if (e->callee->local.disregard_inline_limits)
+ break;
+ if (!e)
+ continue;
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file,
+ "Considering %s %i insns (always inline)\n",
+ cgraph_node_name (node), node->global.insns);
+ ninlined = cgraph_inlined_into (order[i], inlined);
+ for (; e; e = e->next_callee)
+ {
+ if (e->inline_call || !e->callee->local.disregard_inline_limits)
+ continue;
+ if (e->callee->output || e->callee == node)
+ continue;
+ ninlined_callees =
+ cgraph_inlined_callees (e->callee, inlined_callees);
+ cgraph_mark_inline (node, e->callee, inlined, ninlined,
+ inlined_callees, ninlined_callees);
+ for (y = 0; y < ninlined_callees; y++)
+ inlined_callees[y]->output = 0, node->aux = 0;
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Inlined %i times. Now %i insns\n\n",
+ node->global.cloned_times, overall_insns);
+ }
+ for (y = 0; y < ninlined; y++)
+ inlined[y]->output = 0, node->aux = 0;
+ }
+
+ cgraph_decide_inlining_of_small_functions (inlined, inlined_callees);
+
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "\n\nFunctions to inline once:\n");
+
+ /* And finally decide what functions are called once. */
+
+ for (i = nnodes - 1; i >= 0; i--)
{
+ node = order[i];
+
if (node->callers && !node->callers->next_caller && !node->needed
- && node->local.can_inline_once)
+ && node->local.inlinable && !node->callers->inline_call
+ && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl))
{
bool ok = true;
+ struct cgraph_node *node1;
/* Verify that we won't duplicate the caller. */
for (node1 = node->callers->caller;
- node1->local.inline_many
- && node1->callers
- && ok;
- node1 = node1->callers->caller)
+ node1->callers && node1->callers->inline_call
+ && ok; node1 = node1->callers->caller)
if (node1->callers->next_caller || node1->needed)
ok = false;
if (ok)
{
- node->global.inline_once = true;
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
+ fprintf (cgraph_dump_file,
+ "Considering %s %i insns (called once)\n",
+ cgraph_node_name (node), node->global.insns);
+ ninlined = cgraph_inlined_into (node->callers->caller, inlined);
+ if (cgraph_check_inline_limits
+ (node->callers->caller, node, inlined, ninlined))
+ {
+ ninlined_callees =
+ cgraph_inlined_callees (node, inlined_callees);
+ cgraph_mark_inline (node->callers->caller, node, inlined,
+ ninlined, inlined_callees,
+ ninlined_callees);
+ for (y = 0; y < ninlined_callees; y++)
+ inlined_callees[y]->output = 0, node->aux = 0;
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Inlined. Now %i insns\n\n", overall_insns);
+ }
+ for (y = 0; y < ninlined; y++)
+ inlined[y]->output = 0, node->aux = 0;
}
}
}
+
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "\n");
+ fprintf (cgraph_dump_file,
+ "\nInlined %i calls, elliminated %i functions, %i insns turned to %i insns.\n",
+ ncalls_inlined, nfunctions_inlined, initial_insns,
+ overall_insns);
+ free (order);
+ free (inlined);
+ free (inlined_callees);
}
+/* Return true when CALLER_DECL should be inlined into CALLEE_DECL. */
-/* Perform simple optimizations based on callgraph. */
+bool
+cgraph_inline_p (tree caller_decl, tree callee_decl)
+{
+ struct cgraph_node *caller = cgraph_node (caller_decl);
+ struct cgraph_node *callee = cgraph_node (callee_decl);
+ struct cgraph_edge *e;
+
+ for (e = caller->callees; e; e = e->next_callee)
+ if (e->callee == callee)
+ return e->inline_call;
+ /* We do not record builtins in the callgraph. Perhaps it would make more
+ sense to do so and then prune out those not overwritten by explicit
+ function body. */
+ return false;
+}
+/* Expand all functions that must be output.
-void
-cgraph_optimize ()
+ Attempt to topologically sort the nodes so function is output when
+ all called functions are already assembled to allow data to be
+ propagated across the callgraph. Use a stack to get smaller distance
+ between a function and it's callees (later we may choose to use a more
+ sophisticated algorithm for function reordering; we will likely want
+ to use subsections to make the output functions appear in top-down
+ order). */
+
+static void
+cgraph_expand_functions (void)
+{
+ struct cgraph_node *node;
+ struct cgraph_node **order =
+ xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *));
+ int order_pos = 0;
+ int i;
+
+ cgraph_mark_functions_to_output ();
+
+ order_pos = cgraph_postorder (order);
+
+ for (i = order_pos - 1; i >= 0; i--)
+ {
+ node = order[i];
+ if (node->output)
+ {
+ if (!node->reachable)
+ abort ();
+ node->output = 0;
+ cgraph_expand_function (node);
+ }
+ }
+ free (order);
+}
+
+/* Mark all local functions.
+
+ A local function is one whose calls can occur only in the
+ current compilation unit, so we change its calling convention.
+ We simply mark all static functions whose address is not taken
+ as local. */
+
+static void
+cgraph_mark_local_functions (void)
{
struct cgraph_node *node;
- bool changed = true;
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Marking local functions:");
+
+ /* Figure out functions we want to assemble. */
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ node->local.local = (!node->needed
+ && DECL_SAVED_TREE (node->decl)
+ && !TREE_PUBLIC (node->decl));
+ if (cgraph_dump_file && node->local.local)
+ fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
+ }
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "\n");
+}
+
+/* Perform simple optimizations based on callgraph. */
+
+void
+cgraph_optimize (void)
+{
+ if (!flag_unit_at_a_time)
+ return;
timevar_push (TV_CGRAPHOPT);
+ if (!quiet_flag)
+ fprintf (stderr, "Performing intraprocedural optimizations\n");
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Initial callgraph:");
@@ -469,7 +1282,7 @@ cgraph_optimize ()
}
cgraph_mark_local_functions ();
- cgraph_mark_functions_to_inline_once ();
+ cgraph_decide_inlining ();
cgraph_global_info_ready = true;
if (cgraph_dump_file)
@@ -479,39 +1292,10 @@ cgraph_optimize ()
}
timevar_pop (TV_CGRAPHOPT);
if (!quiet_flag)
- fprintf (stderr, "\n\nAssembling functions:");
+ fprintf (stderr, "Assembling functions:");
- /* Output everything.
- ??? Our inline heuristic may decide to not inline functions previously
- marked as inlinable thus adding new function bodies that must be output.
- Later we should move all inlining decisions to callgraph code to make
- this impossible. */
+ /* Output everything. */
cgraph_expand_functions ();
- if (!quiet_flag)
- fprintf (stderr, "\n\nAssembling functions that failed to inline:");
- while (changed && !errorcount && !sorrycount)
- {
- changed = false;
- for (node = cgraph_nodes; node; node = node->next)
- {
- tree decl = node->decl;
- if (!node->origin
- && !TREE_ASM_WRITTEN (decl)
- && DECL_SAVED_TREE (decl)
- && !DECL_EXTERNAL (decl))
- {
- struct cgraph_edge *edge;
-
- for (edge = node->callers; edge; edge = edge->next_caller)
- if (TREE_ASM_WRITTEN (edge->caller->decl))
- {
- changed = true;
- cgraph_expand_function (node);
- break;
- }
- }
- }
- }
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Final callgraph:");
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 866b0c1aa61..356eda96f6b 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -689,7 +689,7 @@ add_prefix (struct path_prefix *pprefix, const char *prefix)
if (len > pprefix->max_len)
pprefix->max_len = len;
- pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
+ pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = xstrdup (prefix);
if (*prev)
@@ -716,7 +716,7 @@ static void
prefix_from_string (const char *p, struct path_prefix *pprefix)
{
const char *startp, *endp;
- char *nstore = (char *) xmalloc (strlen (p) + 3);
+ char *nstore = xmalloc (strlen (p) + 3);
if (debug)
fprintf (stderr, "Convert string '%s' into prefixes, separator = '%c'\n", p, PATH_SEPARATOR);
@@ -838,9 +838,9 @@ main (int argc, char **argv)
/* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */
- ld1 = (const char **)(ld1_argv = (char **) xcalloc(sizeof (char *), argc+3));
- ld2 = (const char **)(ld2_argv = (char **) xcalloc(sizeof (char *), argc+10));
- object = (const char **)(object_lst = (char **) xcalloc(sizeof (char *), argc));
+ ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+3));
+ ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+10));
+ object = (const char **)(object_lst = xcalloc(sizeof (char *), argc));
#ifdef DEBUG
debug = 1;
@@ -865,7 +865,7 @@ main (int argc, char **argv)
#endif
obstack_begin (&temporary_obstack, 0);
- temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
+ temporary_firstobj = obstack_alloc (&temporary_obstack, 0);
current_demangling_style = auto_demangling;
p = getenv ("COLLECT_GCC_OPTIONS");
@@ -880,8 +880,7 @@ main (int argc, char **argv)
/* -fno-exceptions -w */
num_c_args += 2;
- c_ptr = (const char **)
- (c_argv = (char **) xcalloc (sizeof (char *), num_c_args));
+ c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args));
if (argc < 2)
fatal ("no arguments");
@@ -1337,7 +1336,7 @@ main (int argc, char **argv)
/* Strip now if it was requested on the command line. */
if (strip_flag)
{
- char **real_strip_argv = (char **) xcalloc (sizeof (char *), 3);
+ char **real_strip_argv = xcalloc (sizeof (char *), 3);
const char ** strip_argv = (const char **) real_strip_argv;
strip_argv[0] = strip_file_name;
@@ -1579,8 +1578,7 @@ static long sequence_number = 0;
static void
add_to_list (struct head *head_ptr, const char *name)
{
- struct id *newid
- = (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
+ struct id *newid = xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p;
strcpy (newid->name, name);
@@ -2278,7 +2276,7 @@ locatelib (const char *name)
cnt++;
q = xstrdup (p);
}
- l = (const char **) xmalloc ((cnt + 3) * sizeof (char *));
+ l = xmalloc ((cnt + 3) * sizeof (char *));
pp = l;
if (ldr)
{
diff --git a/gcc/combine.c b/gcc/combine.c
index 037f583d827..c18c36e8091 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -75,6 +75,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
+#include "tree.h"
#include "tm_p.h"
#include "flags.h"
#include "regs.h"
@@ -88,6 +89,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "recog.h"
#include "real.h"
#include "toplev.h"
+#include "target.h"
/* It is not safe to use ordinary gen_lowpart in combine.
Use gen_lowpart_for_combine instead. See comments there. */
@@ -456,7 +458,7 @@ do_SUBST (rtx *into, rtx newval)
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = (struct undo *) xmalloc (sizeof (struct undo));
+ buf = xmalloc (sizeof (struct undo));
buf->is_int = 0;
buf->where.r = into;
@@ -484,7 +486,7 @@ do_SUBST_INT (int *into, int newval)
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = (struct undo *) xmalloc (sizeof (struct undo));
+ buf = xmalloc (sizeof (struct undo));
buf->is_int = 1;
buf->where.i = into;
@@ -520,23 +522,18 @@ combine_instructions (rtx f, unsigned int nregs)
combine_max_regno = nregs;
- reg_nonzero_bits = ((unsigned HOST_WIDE_INT *)
- xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT)));
- reg_sign_bit_copies
- = (unsigned char *) xcalloc (nregs, sizeof (unsigned char));
-
- reg_last_death = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set_value = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set_table_tick = (int *) xmalloc (nregs * sizeof (int));
- reg_last_set_label = (int *) xmalloc (nregs * sizeof (int));
- reg_last_set_invalid = (char *) xmalloc (nregs * sizeof (char));
- reg_last_set_mode
- = (enum machine_mode *) xmalloc (nregs * sizeof (enum machine_mode));
- reg_last_set_nonzero_bits
- = (unsigned HOST_WIDE_INT *) xmalloc (nregs * sizeof (HOST_WIDE_INT));
- reg_last_set_sign_bit_copies
- = (char *) xmalloc (nregs * sizeof (char));
+ reg_nonzero_bits = xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT));
+ reg_sign_bit_copies = xcalloc (nregs, sizeof (unsigned char));
+
+ reg_last_death = xmalloc (nregs * sizeof (rtx));
+ reg_last_set = xmalloc (nregs * sizeof (rtx));
+ reg_last_set_value = xmalloc (nregs * sizeof (rtx));
+ reg_last_set_table_tick = xmalloc (nregs * sizeof (int));
+ reg_last_set_label = xmalloc (nregs * sizeof (int));
+ reg_last_set_invalid = xmalloc (nregs * sizeof (char));
+ reg_last_set_mode = xmalloc (nregs * sizeof (enum machine_mode));
+ reg_last_set_nonzero_bits = xmalloc (nregs * sizeof (HOST_WIDE_INT));
+ reg_last_set_sign_bit_copies = xmalloc (nregs * sizeof (char));
init_reg_last_arrays ();
@@ -548,7 +545,7 @@ combine_instructions (rtx f, unsigned int nregs)
if (INSN_UID (insn) > i)
i = INSN_UID (insn);
- uid_cuid = (int *) xmalloc ((i + 1) * sizeof (int));
+ uid_cuid = xmalloc ((i + 1) * sizeof (int));
max_uid_cuid = i;
nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);
@@ -788,14 +785,14 @@ init_reg_last_arrays (void)
{
unsigned int nregs = combine_max_regno;
- memset ((char *) reg_last_death, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set_value, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set_table_tick, 0, nregs * sizeof (int));
- memset ((char *) reg_last_set_label, 0, nregs * sizeof (int));
+ memset (reg_last_death, 0, nregs * sizeof (rtx));
+ memset (reg_last_set, 0, nregs * sizeof (rtx));
+ memset (reg_last_set_value, 0, nregs * sizeof (rtx));
+ memset (reg_last_set_table_tick, 0, nregs * sizeof (int));
+ memset (reg_last_set_label, 0, nregs * sizeof (int));
memset (reg_last_set_invalid, 0, nregs * sizeof (char));
- memset ((char *) reg_last_set_mode, 0, nregs * sizeof (enum machine_mode));
- memset ((char *) reg_last_set_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT));
+ memset (reg_last_set_mode, 0, nregs * sizeof (enum machine_mode));
+ memset (reg_last_set_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT));
memset (reg_last_set_sign_bit_copies, 0, nregs * sizeof (char));
}
@@ -804,30 +801,31 @@ init_reg_last_arrays (void)
static void
setup_incoming_promotions (void)
{
-#ifdef PROMOTE_FUNCTION_ARGS
unsigned int regno;
rtx reg;
enum machine_mode mode;
int unsignedp;
rtx first = get_insns ();
+ if (targetm.calls.promote_function_args (TREE_TYPE (cfun->decl)))
+ {
#ifndef OUTGOING_REGNO
#define OUTGOING_REGNO(N) N
#endif
- for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- /* Check whether this register can hold an incoming pointer
- argument. FUNCTION_ARG_REGNO_P tests outgoing register
- numbers, so translate if necessary due to register windows. */
- if (FUNCTION_ARG_REGNO_P (OUTGOING_REGNO (regno))
- && (reg = promoted_input_arg (regno, &mode, &unsignedp)) != 0)
- {
- record_value_for_reg
- (reg, first, gen_rtx_fmt_e ((unsignedp ? ZERO_EXTEND
- : SIGN_EXTEND),
- GET_MODE (reg),
- gen_rtx_CLOBBER (mode, const0_rtx)));
- }
-#endif
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ /* Check whether this register can hold an incoming pointer
+ argument. FUNCTION_ARG_REGNO_P tests outgoing register
+ numbers, so translate if necessary due to register windows. */
+ if (FUNCTION_ARG_REGNO_P (OUTGOING_REGNO (regno))
+ && (reg = promoted_input_arg (regno, &mode, &unsignedp)) != 0)
+ {
+ record_value_for_reg
+ (reg, first, gen_rtx_fmt_e ((unsignedp ? ZERO_EXTEND
+ : SIGN_EXTEND),
+ GET_MODE (reg),
+ gen_rtx_CLOBBER (mode, const0_rtx)));
+ }
+ }
}
/* Called via note_stores. If X is a pseudo that is narrower than
@@ -1301,9 +1299,14 @@ combinable_i3pat (rtx i3, rtx *loc, rtx i2dest, rtx i1dest,
|| GET_CODE (inner_dest) == ZERO_EXTRACT)
inner_dest = XEXP (inner_dest, 0);
- /* Check for the case where I3 modifies its output, as
- discussed above. */
- if ((inner_dest != dest
+ /* Check for the case where I3 modifies its output, as discussed
+ above. We don't want to prevent pseudos from being combined
+ into the address of a MEM, so only prevent the combination if
+ i1 or i2 set the same MEM. */
+ if ((inner_dest != dest &&
+ (GET_CODE (inner_dest) != MEM
+ || rtx_equal_p (i2dest, inner_dest)
+ || (i1dest && rtx_equal_p (i1dest, inner_dest)))
&& (reg_overlap_mentioned_p (i2dest, inner_dest)
|| (i1dest && reg_overlap_mentioned_p (i1dest, inner_dest))))
@@ -2764,6 +2767,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
if (returnjump_p (i3) || any_uncondjump_p (i3))
{
*new_direct_jump_p = 1;
+ mark_jump_label (PATTERN (i3), i3, 0);
if ((temp = next_nonnote_insn (i3)) == NULL_RTX
|| GET_CODE (temp) != BARRIER)
@@ -3057,7 +3061,7 @@ find_split_point (rtx *loc, rtx insn)
break;
case NE:
- /* if STORE_FLAG_VALUE is -1, this is (NE X 0) and only one bit of X
+ /* If STORE_FLAG_VALUE is -1, this is (NE X 0) and only one bit of X
is known to be on, this can be converted into a NEG of a shift. */
if (STORE_FLAG_VALUE == -1 && XEXP (SET_SRC (x), 1) == const0_rtx
&& GET_MODE (SET_SRC (x)) == GET_MODE (XEXP (SET_SRC (x), 0))
@@ -3476,7 +3480,9 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy)
if (GET_CODE (new) == CLOBBER && XEXP (new, 0) == const0_rtx)
return new;
- if (GET_CODE (new) == CONST_INT && GET_CODE (x) == SUBREG)
+ if (GET_CODE (x) == SUBREG
+ && (GET_CODE (new) == CONST_INT
+ || GET_CODE (new) == CONST_DOUBLE))
{
enum machine_mode mode = GET_MODE (x);
@@ -3633,9 +3639,11 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
return x;
/* Simplify the alternative arms; this may collapse the true and
- false arms to store-flag values. */
- true_rtx = subst (true_rtx, pc_rtx, pc_rtx, 0, 0);
- false_rtx = subst (false_rtx, pc_rtx, pc_rtx, 0, 0);
+ false arms to store-flag values. Be careful to use copy_rtx
+ here since true_rtx or false_rtx might share RTL with x as a
+ result of the if_then_else_cond call above. */
+ true_rtx = subst (copy_rtx (true_rtx), pc_rtx, pc_rtx, 0, 0);
+ false_rtx = subst (copy_rtx (false_rtx), pc_rtx, pc_rtx, 0, 0);
/* If true_rtx and false_rtx are not general_operands, an if_then_else
is unlikely to be simpler. */
@@ -3839,33 +3847,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
break;
case NOT:
- /* (not (plus X -1)) can become (neg X). */
- if (GET_CODE (XEXP (x, 0)) == PLUS
- && XEXP (XEXP (x, 0), 1) == constm1_rtx)
- return gen_rtx_NEG (mode, XEXP (XEXP (x, 0), 0));
-
- /* Similarly, (not (neg X)) is (plus X -1). */
- if (GET_CODE (XEXP (x, 0)) == NEG)
- return gen_rtx_PLUS (mode, XEXP (XEXP (x, 0), 0), constm1_rtx);
-
- /* (not (xor X C)) for C constant is (xor X D) with D = ~C. */
- if (GET_CODE (XEXP (x, 0)) == XOR
- && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
- && (temp = simplify_unary_operation (NOT, mode,
- XEXP (XEXP (x, 0), 1),
- mode)) != 0)
- return gen_binary (XOR, mode, XEXP (XEXP (x, 0), 0), temp);
-
- /* (not (ashift 1 X)) is (rotate ~1 X). We used to do this for operands
- other than 1, but that is not valid. We could do a similar
- simplification for (not (lshiftrt C X)) where C is just the sign bit,
- but this doesn't seem common enough to bother with. */
- if (GET_CODE (XEXP (x, 0)) == ASHIFT
- && XEXP (XEXP (x, 0), 0) == const1_rtx)
- return gen_rtx_ROTATE (mode, simplify_gen_unary (NOT, mode,
- const1_rtx, mode),
- XEXP (XEXP (x, 0), 1));
-
if (GET_CODE (XEXP (x, 0)) == SUBREG
&& subreg_lowpart_p (XEXP (x, 0))
&& (GET_MODE_SIZE (GET_MODE (XEXP (x, 0)))
@@ -3882,24 +3863,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
return gen_lowpart_for_combine (mode, x);
}
- /* If STORE_FLAG_VALUE is -1, (not (comparison foo bar)) can be done by
- reversing the comparison code if valid. */
- if (STORE_FLAG_VALUE == -1
- && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<'
- && (reversed = reversed_comparison (x, mode, XEXP (XEXP (x, 0), 0),
- XEXP (XEXP (x, 0), 1))))
- return reversed;
-
- /* (not (ashiftrt foo C)) where C is the number of bits in FOO minus 1
- is (ge foo (const_int 0)) if STORE_FLAG_VALUE is -1, so we can
- perform the above simplification. */
-
- if (STORE_FLAG_VALUE == -1
- && GET_CODE (XEXP (x, 0)) == ASHIFTRT
- && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
- && INTVAL (XEXP (XEXP (x, 0), 1)) == GET_MODE_BITSIZE (mode) - 1)
- return gen_rtx_GE (mode, XEXP (XEXP (x, 0), 0), const0_rtx);
-
/* Apply De Morgan's laws to reduce number of patterns for machines
with negating logical insns (and-not, nand, etc.). If result has
only one NOT, put it first, since that is how the patterns are
@@ -3930,61 +3893,12 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
break;
case NEG:
- /* (neg (plus X 1)) can become (not X). */
- if (GET_CODE (XEXP (x, 0)) == PLUS
- && XEXP (XEXP (x, 0), 1) == const1_rtx)
- return gen_rtx_NOT (mode, XEXP (XEXP (x, 0), 0));
-
- /* Similarly, (neg (not X)) is (plus X 1). */
- if (GET_CODE (XEXP (x, 0)) == NOT)
- return plus_constant (XEXP (XEXP (x, 0), 0), 1);
-
- /* (neg (minus X Y)) can become (minus Y X). This transformation
- isn't safe for modes with signed zeros, since if X and Y are
- both +0, (minus Y X) is the same as (minus X Y). If the rounding
- mode is towards +infinity (or -infinity) then the two expressions
- will be rounded differently. */
- if (GET_CODE (XEXP (x, 0)) == MINUS
- && !HONOR_SIGNED_ZEROS (mode)
- && !HONOR_SIGN_DEPENDENT_ROUNDING (mode))
- return gen_binary (MINUS, mode, XEXP (XEXP (x, 0), 1),
- XEXP (XEXP (x, 0), 0));
-
- /* (neg (plus A B)) is canonicalized to (minus (neg A) B). */
- if (GET_CODE (XEXP (x, 0)) == PLUS
- && !HONOR_SIGNED_ZEROS (mode)
- && !HONOR_SIGN_DEPENDENT_ROUNDING (mode))
- {
- temp = simplify_gen_unary (NEG, mode, XEXP (XEXP (x, 0), 0), mode);
- temp = combine_simplify_rtx (temp, mode, last, in_dest);
- return gen_binary (MINUS, mode, temp, XEXP (XEXP (x, 0), 1));
- }
-
- /* (neg (mult A B)) becomes (mult (neg A) B).
- This works even for floating-point values. */
- if (GET_CODE (XEXP (x, 0)) == MULT)
- {
- temp = simplify_gen_unary (NEG, mode, XEXP (XEXP (x, 0), 0), mode);
- return gen_binary (MULT, mode, temp, XEXP (XEXP (x, 0), 1));
- }
-
/* (neg (xor A 1)) is (plus A -1) if A is known to be either 0 or 1. */
- if (GET_CODE (XEXP (x, 0)) == XOR && XEXP (XEXP (x, 0), 1) == const1_rtx
+ if (GET_CODE (XEXP (x, 0)) == XOR
+ && XEXP (XEXP (x, 0), 1) == const1_rtx
&& nonzero_bits (XEXP (XEXP (x, 0), 0), mode) == 1)
return gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), constm1_rtx);
- /* NEG commutes with ASHIFT since it is multiplication. Only do this
- if we can then eliminate the NEG (e.g.,
- if the operand is a constant). */
-
- if (GET_CODE (XEXP (x, 0)) == ASHIFT)
- {
- temp = simplify_unary_operation (NEG, mode,
- XEXP (XEXP (x, 0), 0), mode);
- if (temp)
- return gen_binary (ASHIFT, mode, temp, XEXP (XEXP (x, 0), 1));
- }
-
temp = expand_compound_operation (XEXP (x, 0));
/* For C equal to the width of MODE minus 1, (neg (ashiftrt X C)) can be
@@ -6823,15 +6737,13 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask,
mask &= GET_MODE_MASK (op_mode);
/* When we have an arithmetic operation, or a shift whose count we
- do not know, we need to assume that all bit the up to the highest-order
+ do not know, we need to assume that all bits up to the highest-order
bit in MASK will be needed. This is how we form such a mask. */
- if (op_mode)
- fuller_mask = (GET_MODE_BITSIZE (op_mode) >= HOST_BITS_PER_WIDE_INT
- ? GET_MODE_MASK (op_mode)
- : (((unsigned HOST_WIDE_INT) 1 << (floor_log2 (mask) + 1))
- - 1));
+ if (mask & ((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)))
+ fuller_mask = ~(unsigned HOST_WIDE_INT) 0;
else
- fuller_mask = ~(HOST_WIDE_INT) 0;
+ fuller_mask = (((unsigned HOST_WIDE_INT) 1 << (floor_log2 (mask) + 1))
+ - 1);
/* Determine what bits of X are guaranteed to be (non)zero. */
nonzero = nonzero_bits (x, mode);
@@ -7343,7 +7255,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse)
/* If we are comparing a value against zero, we are done. */
if ((code == NE || code == EQ)
- && GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) == 0)
+ && XEXP (x, 1) == const0_rtx)
{
*ptrue = (code == NE) ? const_true_rtx : const0_rtx;
*pfalse = (code == NE) ? const0_rtx : const_true_rtx;
@@ -7952,7 +7864,7 @@ apply_distributive_law (rtx x)
tem = gen_binary (code, GET_MODE (x), lhs, rhs);
/* There is one exception to the general way of distributing:
- (a ^ b) | (a ^ c) -> (~a) & (b ^ c) */
+ (a | c) ^ (b | c) -> (a ^ b) & ~c */
if (code == XOR && inner_code == IOR)
{
inner_code = AND;
@@ -9683,7 +9595,7 @@ simplify_shift_const (rtx x, enum rtx_code code,
break;
case EQ:
- /* convert (lshiftrt (eq FOO 0) C) to (xor FOO 1) if STORE_FLAG_VALUE
+ /* Convert (lshiftrt (eq FOO 0) C) to (xor FOO 1) if STORE_FLAG_VALUE
says that the sign bit can be tested, FOO has mode MODE, C is
GET_MODE_BITSIZE (MODE) - 1, and FOO has only its low-order bit
that may be nonzero. */
@@ -10171,6 +10083,11 @@ gen_binary (enum rtx_code code, enum machine_mode mode, rtx op0, rtx op1)
rtx result;
rtx tem;
+ if (GET_CODE (op0) == CLOBBER)
+ return op0;
+ else if (GET_CODE (op1) == CLOBBER)
+ return op1;
+
if (GET_RTX_CLASS (code) == 'c'
&& swap_commutative_operands_p (op0, op1))
tem = op0, op0 = op1, op1 = tem;
@@ -11054,21 +10971,43 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
}
}
- /* Convert (ne (and (lshiftrt (not X)) 1) 0) to
- (eq (and (lshiftrt X) 1) 0). */
+ /* Convert (ne (and (not X) 1) 0) to (eq (and X 1) 0). */
if (const_op == 0 && equality_comparison_p
&& XEXP (op0, 1) == const1_rtx
- && GET_CODE (XEXP (op0, 0)) == LSHIFTRT
- && GET_CODE (XEXP (XEXP (op0, 0), 0)) == NOT)
+ && GET_CODE (XEXP (op0, 0)) == NOT)
{
op0 = simplify_and_const_int
- (op0, mode,
- gen_rtx_LSHIFTRT (mode, XEXP (XEXP (XEXP (op0, 0), 0), 0),
- XEXP (XEXP (op0, 0), 1)),
- (HOST_WIDE_INT) 1);
+ (NULL_RTX, mode, XEXP (XEXP (op0, 0), 0), (HOST_WIDE_INT) 1);
code = (code == NE ? EQ : NE);
continue;
}
+
+ /* Convert (ne (and (lshiftrt (not X)) 1) 0) to
+ (eq (and (lshiftrt X) 1) 0).
+ Also handle the case where (not X) is expressed using xor. */
+ if (const_op == 0 && equality_comparison_p
+ && XEXP (op0, 1) == const1_rtx
+ && GET_CODE (XEXP (op0, 0)) == LSHIFTRT)
+ {
+ rtx shift_op = XEXP (XEXP (op0, 0), 0);
+ rtx shift_count = XEXP (XEXP (op0, 0), 1);
+
+ if (GET_CODE (shift_op) == NOT
+ || (GET_CODE (shift_op) == XOR
+ && GET_CODE (XEXP (shift_op, 1)) == CONST_INT
+ && GET_CODE (shift_count) == CONST_INT
+ && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
+ && (INTVAL (XEXP (shift_op, 1))
+ == (HOST_WIDE_INT) 1 << INTVAL (shift_count))))
+ {
+ op0 = simplify_and_const_int
+ (NULL_RTX, mode,
+ gen_rtx_LSHIFTRT (mode, XEXP (shift_op, 0), shift_count),
+ (HOST_WIDE_INT) 1);
+ code = (code == NE ? EQ : NE);
+ continue;
+ }
+ }
break;
case ASHIFT:
@@ -11256,9 +11195,6 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
op1 = make_compound_operation (op1, SET);
if (GET_CODE (op0) == SUBREG && subreg_lowpart_p (op0)
- /* Case 3 above, to sometimes allow (subreg (mem x)), isn't
- implemented. */
- && GET_CODE (SUBREG_REG (op0)) == REG
&& GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT
&& GET_MODE_CLASS (GET_MODE (SUBREG_REG (op0))) == MODE_INT
&& (code == NE || code == EQ))
@@ -11266,8 +11202,13 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
if (GET_MODE_SIZE (GET_MODE (op0))
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))
{
- op0 = SUBREG_REG (op0);
- op1 = gen_lowpart_for_combine (GET_MODE (op0), op1);
+ /* For paradoxical subregs, allow case 1 as above. Case 3 isn't
+ implemented. */
+ if (GET_CODE (SUBREG_REG (op0)) == REG)
+ {
+ op0 = SUBREG_REG (op0);
+ op1 = gen_lowpart_for_combine (GET_MODE (op0), op1);
+ }
}
else if ((GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op0)))
<= HOST_BITS_PER_WIDE_INT)
@@ -12438,6 +12379,10 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
place = i3;
break;
+ case REG_VALUE_PROFILE:
+ /* Just get rid of this note, as it is unused later anyway. */
+ break;
+
case REG_VTABLE_REF:
/* ??? Should remain with *a particular* memory load. Given the
nature of vtable data, the last insn seems relatively safe. */
@@ -12473,6 +12418,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
abort ();
break;
+ case REG_ALWAYS_RETURN:
case REG_NORETURN:
case REG_SETJMP:
/* These notes must remain with the call. It should not be
diff --git a/gcc/common.opt b/gcc/common.opt
index 44d8381a1ee..68c37b0c696 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -28,6 +28,7 @@ Display this information
-param
Common Separate
+--param <param>=<value> Set paramter <param> to value. See below for a complete list of parameters
-target-help
Common
@@ -117,7 +118,7 @@ Warn about all enumerated switches missing a specific case
Wsystem-headers
Common
-Suppress warnings from system headers
+Do not suppress warnings from system headers
Wuninitialized
Common
@@ -180,54 +181,67 @@ Common
falign-functions
Common
+Align the start of functions
falign-functions=
Common RejectNegative Joined UInteger
falign-jumps
Common
+Align labels which are only reached by jumping
falign-jumps=
Common RejectNegative Joined UInteger
falign-labels
Common
+Align all labels
falign-labels=
Common RejectNegative Joined UInteger
falign-loops
Common
+Align the start of loops
falign-loops=
Common RejectNegative Joined UInteger
fargument-alias
Common
+Specify that arguments may alias each other and globals
fargument-noalias
Common
+Assume arguments may alias globals but not each other
fargument-noalias-global
Common
+Assume arguments alias neither each other nor globals
fasynchronous-unwind-tables
Common
+Generate unwind tables that are exact at each instruction boundary
fbounds-check
Common
+Generate code to check bounds before indexing arrays
fbranch-count-reg
Common
+Replace add, compare, branch with branch on count register
fbranch-probabilities
Common
+Use profiling information for branch probabilities
fbranch-target-load-optimize
Common
+Perform branch target load optimization before prologue / epilogue threading
fbranch-target-load-optimize2
Common
+Perform branch target load optimization after prologue / epilogue threading
fcall-saved-
Common Joined RejectNegative
@@ -239,33 +253,43 @@ Common Joined RejectNegative
fcaller-saves
Common
+Save registers around function calls
fcommon
Common
+Do not put uninitialized globals in the common section
fcprop-registers
Common
+Perform a register copy-propagation optimization pass
fcrossjumping
Common
+Perform cross-jumping optimization
fcse-follow-jumps
Common
+When running CSE, follow jumps to their targets
fcse-skip-blocks
Common
+When running CSE, follow conditional jumps
fdata-sections
Common
+Place data items into their own section
fdefer-pop
Common
+Defer popping functions args from stack until later
fdelayed-branch
Common
+Attempt to fill delay slots of branch instructions
fdelete-null-pointer-checks
Common
+Delete useless null pointer checks
fdiagnostics-show-location=
Common Joined RejectNegative
@@ -273,27 +297,34 @@ Common Joined RejectNegative
fdump-unnumbered
Common
+Suppress output of instruction numbers and line number notes in debugging dumps
feliminate-dwarf2-dups
Common
+Perform DWARF2 duplicate elimination
feliminate-unused-debug-symbols
Common
+Perform unused type elimination in debug info
feliminate-unused-debug-types
Common
+Perform unused type elimination in debug info
fexceptions
Common
+Enable exception handling
fexpensive-optimizations
Common
+Perform a number of minor, expensive optimizations
ffast-math
Common
ffinite-math-only
Common
+Assume no NaNs or infinities are generated
ffixed-
Common Joined RejectNegative
@@ -301,51 +332,67 @@ Common Joined RejectNegative
ffloat-store
Common
+Do not store floats in registers
fforce-addr
Common
+Copy memory address constants into registers before use
fforce-mem
Common
+Copy memory operands into registers before use
ffunction-cse
Common
+Allow function addresses to be held in registers
ffunction-sections
Common
+Place each function into its own section
fgcse
Common
+Perform global common subexpression elimination
fgcse-lm
Common
+Perform enhanced load motion during global common subexpression elimination
fgcse-sm
Common
+Perform store motion after global common subexpression elimination
fgnu-linker
Common
+Output GNU ld formatted global initializers
fguess-branch-probability
Common
+Enable guessing of branch probabilities
fident
Common
+Process #ident directives
fif-conversion
Common
+Perform conversion of conditional jumps to branchless equivalents
fif-conversion2
Common
+Perform conversion of conditional jumps to conditional execution
finhibit-size-directive
Common
+Do not generate .size directives
finline
Common
+Pay attention to the \"inline\" keyword
finline-functions
Common
+Integrate simple functions into their callers
finline-limit-
Common RejectNegative Joined UInteger
@@ -356,30 +403,39 @@ Common RejectNegative Joined UInteger
finstrument-functions
Common
+Instrument function entry and exit with profiling calls
fkeep-inline-functions
Common
+Generate code for functions even if they are fully inlined
fkeep-static-consts
Common
+Emit static const variables even if they are not used
fleading-underscore
Common
+Give external symbols a leading underscore
floop-optimize
Common
+Perform loop optimizations
fmath-errno
Common
+Set errno after built-in math functions
fmem-report
Common
+Report on permanent memory allocation
fmerge-all-constants
Common
+Attempt to merge identical constants and constant variables
fmerge-constants
Common
+Attempt to merge identical constants across compilation units
fmessage-length=
Common RejectNegative Joined UInteger
@@ -387,57 +443,75 @@ Common RejectNegative Joined UInteger
fmove-all-movables
Common
+Force all loop invariant computations out of loops
fnew-ra
Common
+Use graph-coloring register allocation
fnon-call-exceptions
Common
+Support synchronous non-call exceptions
fold-unroll-loops
Common
+Perform loop unrolling when iteration count is known
fold-unroll-all-loops
Common
+Perform loop unrolling for all loops
fomit-frame-pointer
Common
+When possible do not generate stack frames
foptimize-register-move
Common
+Do the full register move optimization pass
foptimize-sibling-calls
Common
+Optimize sibling and tail recursive calls
fpack-struct
Common
+Pack structure members together without holes
fpcc-struct-return
Common
+Return small aggregates in memory, not registers
fpeel-loops
Common
+Perform loop peeling
fpeephole
Common
+Enable machine specific peephole optimizations
fpeephole2
Common
+Enable an RTL peephole pass before sched2
fpic
Common
+Generate position-independent code if possible
fpie
Common
+Generate position-independent code for executables if possible
fprefetch-loop-arrays
Common
+Generate prefetch instructions, if available, for arrays in loops
fprofile
Common
+Enable basic program profiling code
fprofile-arcs
Common
+Insert arc-based program profiling code
frandom-seed
Common
@@ -448,39 +522,55 @@ Common Joined RejectNegative
freduce-all-givs
Common
+Strength reduce all loop general induction variables
freg-struct-return
Common
+Return small aggregates in registers
fregmove
Common
+Enables a register move optimization
frename-registers
Common
+Perform a register renaming optimization pass
freorder-blocks
Common
+Reorder basic blocks to improve code placement
freorder-functions
Common
+Reorder functions to improve code placement
frerun-cse-after-loop
Common
+Add a common subexpression elimination pass after loop optimizations
frerun-loop-opt
Common
+Run the loop optimizer twice
+
+frounding-math
+Common
+Disable optimizations that assume default FP rounding behavior
fsched-interblock
Common
+Enable scheduling across basic blocks
fsched-spec
Common
+Allow speculative motion of non-loads
fsched-spec-load
Common
+Allow speculative motion of some loads
fsched-spec-load-dangerous
Common
+Allow speculative motion of more loads
fsched-verbose=
Common RejectNegative Joined
@@ -488,36 +578,47 @@ Common RejectNegative Joined
fsched2-use-superblocks
Common
+If scheduling post reload, do superblock scheduling
fsched2-use-traces
Common
+If scheduling post reload, do trace scheduling
fschedule-insns
Common
+Reschedule instructions before register allocation
fschedule-insns2
Common
+Reschedule instructions after register allocation
fshared-data
Common
+Mark data as shared rather than private
fsignaling-nans
Common
+Disable optimizations observable by IEEE signaling NaNs
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
fstack-limit
Common
@@ -532,21 +633,27 @@ Common RejectNegative Joined
fstrength-reduce
Common
+Perform strength reduction optimizations
fstrict-aliasing
Common
+Assume strict aliasing rules apply
fsyntax-only
Common
+Check for syntax errors, then stop
ftest-coverage
Common
+Create data files needed by \"gcov\"
fthread-jumps
Common
+Perform jump threading optimizations
ftime-report
Common
+Report the time taken by each compiler pass
ftls-model=
Common Joined RejectNegative
@@ -554,45 +661,99 @@ Common Joined RejectNegative
ftracer
Common
+Perform superblock formation via tail duplication
ftrapping-math
Common
+Assume floating-point operations can trap
ftrapv
Common
+Trap for signed overflow in addition, subtraction and multiplication
funit-at-a-time
Common
+Compile whole compilation unit at a time
funroll-loops
Common
+Perform loop unrolling when iteration count is known
funroll-all-loops
Common
+Perform loop unrolling for all loops
funsafe-math-optimizations
Common
+Allow math optimizations that may violate IEEE or ISO standards
funswitch-loops
Common
+Perform loop unswitching
funwind-tables
Common
+Just generate unwind tables for exception handling
fverbose-asm
Common
+Add extra commentary to assembler output
fwrapv
Common
+Assume signed arithmetic overflow wraps around
fwritable-strings
Common
+Store strings in writable data section
fzero-initialized-in-bss
Common
+Put zero initialized data in the bss section
g
Common JoinedOrMissing
+Generate debug information in default format
+
+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
+
+ggdb
+Common JoinedOrMissing
+Generate debug information in default extended format
+
+gstabs
+Common JoinedOrMissing
+Generate debug information in STABS format
+
+gstabs+
+Common JoinedOrMissing
+Generate debug information in extended STABS format
+
+gvms
+Common JoinedOrMissing
+Generate debug information in VMS format
+
+gxcoff
+Common JoinedOrMissing
+Generate debug information in XCOFF format
+
+gxcoff+
+Common JoinedOrMissing
+Generate debug information in extended XCOFF format
m
Common Joined
diff --git a/gcc/config.build b/gcc/config.build
new file mode 100644
index 00000000000..bfbee5bb2bc
--- /dev/null
+++ b/gcc/config.build
@@ -0,0 +1,131 @@
+# GCC build-specific configuration file.
+# Copyright 1997, 1998, 1999, 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.
+
+# This is the GCC build-specific configuration file
+# where a configuration type is mapped to different system-specific
+# definitions and files. This is invoked by the autoconf-generated
+# configure script. Putting it in a separate shell file lets us skip
+# running autoconf when modifying build-specific information.
+
+# This file switches on the shell variable ${build}. As much of this
+# as possible should be replaced with autoconf tests in the future.
+
+# This file sets the following shell variables for use by the
+# autoconf-generated configure script:
+#
+# build_xm_defines List of macros to define when compiling for the
+# build machine.
+#
+# build_xm_file List of files to include when compiling for the
+# build machine.
+#
+# build_install_headers_dir
+# Target to use when installing header files.
+#
+# build_exeext Set to the suffix, if the build machine requires
+# executables to have a file name suffix.
+
+# Default settings.
+build_xm_file=
+build_xm_defines=
+build_exeext=
+build_install_headers_dir=install-headers-tar
+
+# System-specific settings.
+case $build in
+ alpha*-dec-osf4*)
+ # Some versions of OSF4 (specifically X4.0-9 296.7) have
+ # a broken tar, so we use cpio instead.
+ build_install_headers_dir=install-headers-cpio
+ ;;
+ alpha*-dec-*vms*)
+ build_xm_file=alpha/xm-vms.h
+ build_exeext=.exe
+ build_install_headers_dir=install-headers-cp
+ prefix=/gnu
+ local_prefix=/gnu
+ ;;
+ hppa1.0-*-hpux1[01]* | \
+ hppa*64*-*-hpux11* | \
+ hppa1.1-*-hpux11* | \
+ hppa2*-*-hpux11* )
+ build_install_headers_dir=install-headers-cpio
+ ;;
+ i370-*-opened* | i370-*-mvs* )
+ # IBM 360/370/390 Architecture
+ build_xm_defines='FATAL_EXIT_CODE=12'
+ ;;
+ i[34567]86-*-cygwin* | i[34567]86-*-pe )
+ build_xm_file=i386/xm-cygwin.h
+ build_exeext=.exe
+ ;;
+ i[34567]86-*-mingw32*)
+ build_xm_file=i386/xm-mingw32.h
+ build_exeext=.exe
+ ;;
+ i[34567]86-pc-msdosdjgpp*)
+ build_xm_file=i386/xm-djgpp.h
+ build_exeext=.exe
+ ;;
+ i[34567]86-*-sco3.2v5*)
+ # 80386 running SCO Open Server 5
+ build_install_headers_dir=install-headers-cpio
+ ;;
+ i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4* )
+ build_xm_defines="SMALL_ARG_MAX"
+ build_install_headers_dir=install-headers-cpio
+ ;;
+ i[34567]86-*-solaris2*)
+ build_xm_defines="SMALL_ARG_MAX"
+ ;;
+ i[34567]86-*-sysv4*)
+ # Intel x86 running system V r4
+ build_xm_defines="SMALL_ARG_MAX"
+ build_install_headers_dir=install-headers-cpio
+ ;;
+ i[34567]86-*-udk*)
+ # Intel x86 on SCO UW/OSR5 Dev Kit
+ build_install_headers_dir=install-headers-cpio
+ ;;
+ i[34567]86-*-uwin*)
+ build_exeext=.exe
+ ;;
+ i386-*-vsta)
+ # Intel 80386's running VSTa kernel
+ ;;
+ m68000-hp-hpux* | m68k-hp-hpux*)
+ # HP 9000 series 300
+ build_install_headers_dir=install-headers-cpio
+ ;;
+ mips-sgi-irix5*)
+ # SGI System V r4, IRIX 5
+ build_xm_file=mips/xm-iris5.h
+ ;;
+ mips-sgi-irix6*o32)
+ # SGI System V r4, IRIX 6, O32 ABI
+ build_xm_file=mips/xm-iris5.h
+ ;;
+ *-*-sysv*)
+ # All other System V variants.
+ build_install_headers_dir=install-headers-cpio
+ ;;
+esac
+
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 3a834d4d19e..383e7b0ecfc 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1,4 +1,4 @@
-# GCC build-, host- and target-specific configuration file.
+# GCC target-specific configuration file.
# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
@@ -19,13 +19,11 @@
#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#02111-1307, USA.
-# This is the GCC build-, host- and target-specific configuration file
-# where a configuration type, as recognized and generated by config.bfd,
-# is mapped to different system-specific definitions and files. This is
-# invoked by the autoconf-generated configure script, called for build,
-# host and target in that order, setting ${machine} to each. Putting it
-# in a separate shell file lets us skip running autoconf when modifying
-# build-, host- and target-specific information.
+# This is the GCC target-specific configuration file
+# where a configuration type is mapped to different system-specific
+# definitions and files. This is invoked by the autoconf-generated
+# configure script. Putting it in a separate shell file lets us skip
+# running autoconf when modifying target-specific information.
# This file switches on the shell variable ${machine}, and also uses the
# following shell variables:
@@ -88,8 +86,6 @@
# extra_headers List of used header files from the directory
# config/${cpu_type}.
#
-# host_xmake_file List of host-specific makefile-fragments.
-#
# extra_passes List of extra executables compiled for this target
# machine, used for compiling from source to object.
#
@@ -98,14 +94,6 @@
#
# extra_programs Like extra_passes, but these are used when linking.
#
-# host_extra_objs List of extra host-dependent objects that should
-# be linked into the compiler proper.
-#
-# host_extra_gcc_objs List of extra host-dependent objects that should
-# be linked into the gcc driver.
-#
-# out_host_hook_obj An object file that provides the host hooks.
-#
# c_target_objs List of extra target-dependent objects that be
# linked into the C compiler only.
#
@@ -114,18 +102,6 @@
#
# target_gtfiles List of extra source files with type information.
#
-# build_xm_defines List of macros to define when compiling for the
-# build machine.
-#
-# build_xm_file List of files to include when compiling for the
-# build machine.
-#
-# host_xm_defines List of macros to define when compiling for the
-# host machine.
-#
-# host_xm_file List of files to include when compiling for the
-# host machine.
-#
# xm_defines List of macros to define when compiling for the
# target machine.
#
@@ -137,19 +113,10 @@
#
# target_cpu_default Set to override the default target model.
#
-# build_install_headers_dir
-# Target to use when installing header files.
-#
# gdb_needs_out_file_path
# Set to yes if gdb needs a dir command with
# `dirname $out_file`.
#
-# build_exeext Set to the suffix, if the build machine requires
-# executables to have a file name suffix.
-#
-# host_exeext Set to the suffix, if the host machine requires
-# executables to have a file name suffix.
-#
# thread_file Set to control which thread package to use.
#
# gas Set to yes or no depending on whether the target
@@ -169,50 +136,27 @@
# The following variables are used in each case-construct to build up the
# outgoing variables:
#
-# xmake_file Makefile-fragment when this system is as a host,
-# for host_xmake_file.
-#
-# extra_host_objs List of extra objects that should be linked into
-# the compiler proper when this system is a host,
-# for host_extra_objs.
-#
-# host_hook_obj An object file that provides the host hooks.
-#
-# install_headers_dir Makefile-target for how the header file directory
-# is installed, when this system is a build system,
-# for build_install_headers_dir.
-#
-# exeext The suffix for executables on this system.
-#
# gnu_ld Set to yes or no depending on whether the target
# system normally uses GNU ld.
out_file=
-xmake_file=
tmake_file=
extra_headers=
extra_passes=
extra_parts=
extra_programs=
extra_objs=
-extra_host_objs=
extra_gcc_objs=
c_target_objs=
cxx_target_objs=
-host_hook_obj=host-default.o
tm_defines=
xm_defines=
# Set this to force installation and use of collect2.
use_collect2=
# Set this to override the default target model.
target_cpu_default=
-# Set this to control how the header file directory is installed.
-install_headers_dir=install-headers-tar
# Set this if gdb needs a dir command with `dirname $out_file`
gdb_needs_out_file_path=
-# Set this if the build machine requires executables to have a
-# file name suffix.
-exeext=
# Set this to control which thread package will be used.
thread_file=
# Reinitialize these from the flag values every loop pass, since some
@@ -245,7 +189,8 @@ esac
# should be in alphabetical order.
case $machine in
alpha*-*-linux*libc1* \
- | i[34567]86-sequent-sysv* \
+ | i[34567]86-sequent-sysv \
+ | i[34567]86-sequent-sysv[123]* \
| i[34567]86-go32-* \
| i[34567]86-*-go32* \
| m68k-*-linux*aout* \
@@ -276,6 +221,9 @@ alpha*-*-*)
cpu_type=alpha
need_64bit_hwint=yes
;;
+am33_2.0-*-linux*)
+ cpu_type=mn10300
+ ;;
strongarm*-*-*)
cpu_type=arm
;;
@@ -296,7 +244,7 @@ i[34567]86-*-*)
;;
x86_64-*-*)
cpu_type=i386
- extra_headers="mmintrin.h xmmintrin.h emmintrin.h"
+ extra_headers="mmintrin.h xmmintrin.h emmintrin.h pmmintrin.h"
need_64bit_hwint=yes
;;
ia64-*-*)
@@ -391,8 +339,6 @@ case $machine in
# support are matched above and just set $cpu_type.
tm_file="${cpu_type}/gnu.h"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
- # GNU always uses ELF.
- elf=yes
# GNU tools are the only tools.
gnu_ld=yes
gas=yes
@@ -409,7 +355,6 @@ case $machine in
esac
;;
*-*-openbsd*)
- tm_file=${cpu_type}/openbsd.h
tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
if test x$enable_threads = xyes; then
thread_file='posix'
@@ -491,7 +436,6 @@ case $machine in
*) echo 'Please update *-*-freebsd* in gcc/config.gcc'; exit 1;;
esac
tmake_file="t-slibgcc-elf-ver t-freebsd"
- xmake_file=none
case x${enable_threads} in
xno) fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h";;
x | xyes | xpthreads | xposix)
@@ -517,6 +461,10 @@ case $machine in
cxx_target_objs="darwin-c.o"
extra_parts="crt2.o"
extra_objs="darwin.o"
+ case x${enable_threads} in
+ x | xyes | xposix) thread_file='posix'
+ ;;
+ esac
;;
*-*-vxworks*)
tmake_file=t-vxworks
@@ -534,9 +482,6 @@ case $machine in
if test -f $srcdir/config/${cpu_type}/xm-$rest.h
then xm_file=${cpu_type}/xm-$rest.h
fi
- if test -f $srcdir/config/${cpu_type}/x-$rest
- then xmake_file=${cpu_type}/x-$rest
- fi
if test -f $srcdir/config/${cpu_type}/t-$rest
then tmake_file=${cpu_type}/t-$rest
fi
@@ -571,7 +516,8 @@ alpha*-*-netbsd*)
;;
alpha*-*-openbsd*)
- tm_file="${cpu_type}/${cpu_type}.h ${tm_file}"
+ tm_defines="OBSD_NO_DYNAMIC_LIBRARIES OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
+ tm_file="alpha/alpha.h openbsd.h alpha/openbsd.h"
# default x-alpha is only appropriate for dec-osf.
target_cpu_default="MASK_GAS"
tmake_file="alpha/t-alpha alpha/t-ieee"
@@ -592,9 +538,6 @@ alpha*-dec-osf[45]*)
extra_headers=va_list.h
case $machine in
*-*-osf4*)
- # Some versions of OSF4 (specifically X4.0-9 296.7) have
- # a broken tar, so we use cpio instead.
- install_headers_dir=install-headers-cpio
# Set target_cpu_default except on 4.0a.
case $machine in
*-*-osf4.0a) ;;
@@ -606,21 +549,17 @@ alpha*-dec-osf[45]*)
target_cpu_default=MASK_SUPPORT_ARCH
;;
esac
+ case x${enable_threads} in
+ x | xyes | xpthreads | xposix)
+ thread_file='posix'
+ tmake_file="${tmake_file} alpha/t-osf-pthread"
+ ;;
+ esac
;;
alpha64-dec-*vms*)
tm_file="${tm_file} alpha/vms.h alpha/vms64.h"
xm_file="alpha/xm-vms.h"
tmake_file="alpha/t-alpha alpha/t-vms alpha/t-vms64 alpha/t-ieee"
- xmake_file=alpha/x-vms
- exeext=.exe
- # This removes the cpu type and manufacturer components and
- # replaces "." with "_" in the operating system version.
- case $host in *-*-*vms*)
- target_alias=`echo $host \
- | sed 's/.*-.*-\(.*\)$/\1/' | sed 's/\./_/g'`
- ;;
- esac
- install_headers_dir=install-headers-cp
prefix=/gnu
local_prefix=/gnu
;;
@@ -628,16 +567,6 @@ alpha*-dec-*vms*)
tm_file="${tm_file} alpha/vms.h"
xm_file=alpha/xm-vms.h
tmake_file="alpha/t-alpha alpha/t-vms alpha/t-ieee"
- xmake_file=alpha/x-vms
- exeext=.exe
- # This removes the cpu type and manufacturer components and
- # replaces "." with "_" in the operating system version.
- case $host in *-*-*vms*)
- target_alias=`echo $host \
- | sed 's/.*-.*-\(.*\)$/\1/' | sed 's/\./_/g'`
- ;;
- esac
- install_headers_dir=install-headers-cp
prefix=/gnu
local_prefix=/gnu
;;
@@ -646,7 +575,7 @@ arc-*-elf*)
extra_parts="crtinit.o crtfini.o"
;;
arm-*-coff* | armel-*-coff*)
- tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h"
+ tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h"
tmake_file=arm/t-arm-coff
;;
arm-semi-aof | armel-semi-aof)
@@ -698,12 +627,12 @@ arm*-*-elf | ep9312-*-elf)
tmake_file=arm/t-arm-elf
;;
arm*-wince-pe*)
- tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h arm/pe.h arm/wince-pe.h"
+ tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h"
tmake_file=arm/t-wince-pe
extra_objs="pe.o"
;;
arm-*-pe*)
- tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h arm/pe.h"
+ tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h"
tmake_file=arm/t-pe
extra_objs="pe.o"
;;
@@ -712,6 +641,7 @@ arm*-*-kaos*)
tmake_file=arm/t-arm-elf
;;
avr-*-*)
+ tm_file="avr/avr.h dbxelf.h"
;;
c4x-*-rtems* | tic4x-*-rtems*)
tmake_file="c4x/t-c4x t-rtems"
@@ -757,16 +687,17 @@ frv-*-elf)
;;
h8300-*-rtems*)
tmake_file="h8300/t-h8300 t-rtems"
- tm_file="h8300/h8300.h h8300/rtems.h rtems.h"
+ tm_file="h8300/h8300.h dbxcoff.h h8300/coff.h h8300/rtems.h rtems.h"
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
;;
h8300-*-elf*)
tmake_file="h8300/t-h8300 h8300/t-elf"
- tm_file="h8300/h8300.h h8300/elf.h"
+ tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h"
;;
h8300-*-*)
+ tm_file="h8300/h8300.h dbxcoff.h h8300/coff.h"
;;
hppa*64*-*-linux* | parisc*64*-*-linux*)
target_cpu_default="(MASK_PA_11 | MASK_PA_20)"
@@ -782,44 +713,40 @@ hppa*-*-linux* | parisc*-*-linux*)
pa/pa32-regs.h pa/pa32-linux.h"
tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
;;
-hppa*-*-openbsd*)
- target_cpu_default="MASK_PA_11"
- tmake_file=pa/t-bsd
- ;;
+# port not yet contributed.
+#hppa*-*-openbsd*)
+# target_cpu_default="MASK_PA_11"
+# tmake_file=pa/t-bsd
+# ;;
hppa1.1-*-pro*)
target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h"
tmake_file="pa/t-bsd pa/t-pro"
- xmake_file="pa/x-ada"
;;
hppa1.1-*-osf*)
target_cpu_default="MASK_PA_11"
- tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-osf.h"
+ tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-osf.h"
tmake_file="pa/t-bsd pa/t-pa"
- xmake_file="pa/x-ada"
use_collect2=yes
;;
hppa1.1-*-rtems*)
target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h pa/rtems.h rtems.h"
tmake_file="pa/t-bsd pa/t-pro t-rtems"
- xmake_file="pa/x-ada"
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
;;
hppa1.1-*-bsd*)
- tm_file="${tm_file} pa/pa32-regs.h pa/som.h"
+ tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h"
target_cpu_default="MASK_PA_11"
tmake_file="pa/t-bsd pa/t-pa"
- xmake_file="pa/x-ada"
use_collect2=yes
;;
hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
target_cpu_default="MASK_PA_11"
- tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
+ tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
- xmake_file="pa/x-ada"
if test x$enable_threads = x; then
enable_threads=$have_pthread_h
fi
@@ -828,13 +755,11 @@ hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
tmake_file="${tmake_file} pa/t-dce-thr"
;;
esac
- install_headers_dir=install-headers-cpio
use_collect2=yes
;;
hppa1.0-*-hpux10*)
- tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
+ tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
- xmake_file="pa/x-ada"
if test x$enable_threads = x; then
enable_threads=$have_pthread_h
fi
@@ -843,7 +768,6 @@ hppa1.0-*-hpux10*)
tmake_file="${tmake_file} pa/t-dce-thr"
;;
esac
- install_headers_dir=install-headers-cpio
use_collect2=yes
;;
hppa*64*-*-hpux11*)
@@ -859,70 +783,57 @@ hppa*64*-*-hpux11*)
fi
need_64bit_hwint=yes
tmake_file="pa/t-pa64 pa/t-pa-hpux"
- xmake_file="pa/x-ada"
target_cpu_default="(MASK_PA_11|MASK_PA_20|MASK_GAS)"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
if test x$gnu_ld = xyes
then
target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
fi
-# if [ x$enable_threads = x ]; then
-# enable_threads=$have_pthread_h
-# fi
-# if [ x$enable_threads = xyes ]; then
-# thread_file='dce'
-# tmake_file="${tmake_file} pa/t-dce-thr"
-# fi
- install_headers_dir=install-headers-cpio
+ case x${enable_threads} in
+ xyes | xposix )
+ thread_file=posix
+ ;;
+ esac
;;
hppa1.1-*-hpux11* | hppa2*-*-hpux11*)
target_cpu_default="MASK_PA_11"
- tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h"
+ tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h"
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
- xmake_file="pa/x-ada"
-# if test x$enable_threads = x; then
-# enable_threads=$have_pthread_h
-# fi
-# if test x$enable_threads = xyes; then
-# thread_file='dce'
-# tmake_file="${tmake_file} pa/t-dce-thr"
-# fi
- install_headers_dir=install-headers-cpio
+ case x${enable_threads} in
+ xyes | xposix )
+ thread_file=posix
+ ;;
+ esac
use_collect2=yes
;;
hppa1.0-*-hpux11*)
- tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h"
+ tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h"
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
- xmake_file="pa/x-ada"
-# if test x$enable_threads = x; then
-# enable_threads=$have_pthread_h
-# fi
-# if test x$enable_threads = xyes; then
-# thread_file='dce'
-# tmake_file="${tmake_file} pa/t-dce-thr"
-# fi
- install_headers_dir=install-headers-cpio
+ case x${enable_threads} in
+ xyes | xposix )
+ thread_file=posix
+ ;;
+ esac
use_collect2=yes
;;
i370-*-opened*) # IBM 360/370/390 Architecture
xm_defines='FATAL_EXIT_CODE=12'
- tm_file=i370/oe.h
+ tm_file="i370/oe.h i370/i370.h"
tmake_file="i370/t-oe i370/t-i370"
c_target_objs="i370-c.o"
cxx_target_objs="i370-c.o"
;;
i370-*-mvs*)
xm_defines='FATAL_EXIT_CODE=12'
- tm_file=i370/mvs.h
+ tm_file="i370/mvs.h i370/i370.h"
tmake_file="i370/t-i370"
c_target_objs="i370-c.o"
cxx_target_objs="i370-c.o"
;;
i370-*-linux*)
- tm_file="dbxelf.h elfos.h svr4.h linux.h i370/linux.h ${tm_file}"
+ tm_file="dbxelf.h elfos.h svr4.h linux.h i370/linux.h i370/i370.h"
tmake_file="t-slibgcc-elf-ver t-linux"
# broken_install=yes
- elf=yes
;;
i[34567]86-*-darwin*)
tm_file="${tm_file} i386/darwin.h"
@@ -950,7 +861,6 @@ i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ptx4.h i386/ptx4-i.h"
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
- install_headers_dir=install-headers-cpio
;;
i[34567]86-*-aout*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/i386-aout.h"
@@ -983,7 +893,7 @@ x86_64-*-netbsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
;;
i[34567]86-*-openbsd*)
- tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h ${tm_file}"
+ tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
# needed to unconfuse gdb
tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
# we need collect2 until our bug is fixed...
@@ -1028,11 +938,6 @@ i[34567]86-pc-msdosdjgpp*)
tmake_file=i386/t-djgpp
gnu_ld=yes
gas=yes
- exeext=.exe
- case $host in *pc-msdosdjgpp*)
- target_alias=djgpp
- ;;
- esac
;;
i[34567]86-moss-msdos* | i[34567]86-*-moss*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h i386/moss.h"
@@ -1043,7 +948,7 @@ i[34567]86-moss-msdos* | i[34567]86-*-moss*)
i[34567]86-*-lynxos*)
if test x$gas = xyes
then
- tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h lynx.h i386/lynx.h"
+ tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h svr3.h lynx.h i386/lynx.h"
else
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h lynx-ng.h i386/lynx-ng.h"
fi
@@ -1053,6 +958,12 @@ i[34567]86-*-mach*)
# tmake_file=t-libc-ok
use_collect2=yes
;;
+i[34567]86-*-nto-qnx*)
+ tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h svr4.h i386/unix.h i386/nto.h"
+ tmake_file=i386/t-nto
+ gnu_ld=yes
+ gas=yes
+ ;;
i[34567]86-*-rtems*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h"
extra_parts="crtbegin.o crtend.o crti.o crtn.o"
@@ -1062,7 +973,6 @@ i[34567]86-*-rtems*)
fi
;;
i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
- install_headers_dir=install-headers-cpio
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/sco5.h"
if test x$gas = xyes
then
@@ -1121,7 +1031,6 @@ i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv5.h i386/udk.h"
tmake_file="i386/t-crtpic i386/t-udk t-svr4"
extra_parts="crtbegin.o crtend.o"
- install_headers_dir=install-headers-cpio
;;
i[34567]86-*-sysv*) # Intel 80386's running system V
if test x$gas = xyes
@@ -1144,8 +1053,8 @@ i[34567]86-*-sysv*) # Intel 80386's running system V
tmake_file="$tmake_file i386/t-crtpic"
;;
i386-*-vsta) # Intel 80386's running VSTa kernel
- xm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/xm-vsta.h"
- tm_file="${tm_file} i386/vsta.h"
+ xm_file="i386/xm-vsta.h"
+ tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/vsta.h"
;;
i[34567]86-*-pe | i[34567]86-*-cygwin*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h"
@@ -1157,18 +1066,15 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
if test x$enable_threads = xyes; then
thread_file='posix'
fi
- exeext=.exe
;;
i[34567]86-*-mingw32*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h"
xm_file=i386/xm-mingw32.h
tmake_file="i386/t-cygming i386/t-mingw32"
- xmake_file=i386/x-mingw32
extra_objs=winnt.o
if test x$enable_threads = xyes; then
thread_file='win32'
fi
- exeext=.exe
case $machine in
*mingw32crt*)
tm_file="${tm_file} i386/crtdll.h"
@@ -1184,13 +1090,11 @@ i[34567]86-*-uwin*)
if test x$enable_threads = xyes; then
thread_file='win32'
fi
- exeext=.exe
;;
i[34567]86-*-interix3*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h i386/i386-interix3.h interix.h interix3.h"
tmake_file="t-interix i386/t-interix"
extra_objs=winnt.o
- xmake_file="x-interix"
if test x$enable_threads = xyes ; then
thread_file='posix'
fi
@@ -1213,6 +1117,11 @@ i[34567]86-*-kaos*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h kaos.h i386/kaos-i386.h"
tmake_file="i386/t-i386elf t-svr4"
;;
+i860-*-sysv4*)
+ tm_file="${tm_file} elfos.h svr4.h i860/sysv4.h"
+ tmake_file="i860/t-i860 i860/t-svr4"
+ extra_parts="crtbegin.o crtend.o"
+ ;;
i960-*-coff*)
tm_file="${tm_file} dbxcoff.h i960/i960-coff.h libgloss.h"
tmake_file=i960/t-960bare
@@ -1267,9 +1176,11 @@ ia64*-*-hpux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h ia64/sysv4.h ia64/hpux.h ia64/hpux_longdouble.h"
tmake_file="ia64/t-ia64 ia64/t-hpux"
target_cpu_default="MASK_GNU_AS"
- if test x$enable_threads = xyes; then
- thread_file='posix'
- fi
+ case x$enable_threads in
+ xyes | xposix )
+ thread_file=posix
+ ;;
+ esac
use_collect2=no
c_target_objs="ia64-c.o"
cxx_target_objs="ia64-c.o"
@@ -1277,6 +1188,12 @@ ia64*-*-hpux*)
ip2k-*-elf)
tm_file="elfos.h ${tm_file}"
;;
+iq2000*-*-elf*)
+ tm_file="svr4.h elfos.h iq2000/iq2000.h"
+ tmake_file=iq2000/t-iq2000
+ out_file=iq2000/iq2000.c
+ md_file=iq2000/iq2000.md
+ ;;
m32r-*-elf*)
tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
extra_parts="crtinit.o crtfini.o"
@@ -1297,46 +1214,44 @@ m68hc12-*-*|m6812-*-*)
tmake_file="m68hc11/t-m68hc11-gas"
;;
m68000-hp-hpux*) # HP 9000 series 300
+ tm_file="m68k/hp320base.h m68k/m68k.h m68k/hp320.h m68k/hp310.h"
+ tm_defines="TARGET_DEFAULT=0" # 68000, no 68881, no bitfield ops
if test x$gas = xyes
then
- tm_file=m68k/hp310g.h
- else
- tm_file=m68k/hp310.h
+ tm_defines="${tm_defines} DBX_DEBUGGING_INFO=1 USE_GAS"
fi
tmake_file=m68k/t-hp320
- install_headers_dir=install-headers-cpio
use_collect2=yes
;;
m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
+ tm_file="m68k/hp320base.h m68k/m68k.h m68k/hp320.h"
if test x$gas = xyes
then
- tm_file=m68k/hp320g.h
+ tm_defines="DBX_DEBUGGING_INFO=1 USE_GAS"
else
- tm_file=m68k/hpux7.h
+ tm_defines="NO_DOT_IN_LABEL NO_BUGS"
fi
- install_headers_dir=install-headers-cpio
use_collect2=yes
;;
m68k-hp-hpux*) # HP 9000 series 300
+ tm_file="m68k/hp320base.h m68k/m68k.h m68k/hp320.h"
if test x$gas = xyes
then
- tm_file=m68k/hp320g.h
- else
- tm_file=m68k/hp320.h
+ tm_defines="DBX_DEBUGGING_INFO=1 USE_GAS"
fi
- install_headers_dir=install-headers-cpio
use_collect2=yes
;;
m68k-*-aout*)
tmake_file=m68k/t-m68kbare
- tm_file="m68k/m68k-aout.h libgloss.h"
+ tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kemb.h m68k/m68k-aout.h libgloss.h"
;;
m68k-*-coff*)
tmake_file=m68k/t-m68kbare
- tm_file="m68k/m68k-coff.h dbx.h"
+ tm_defines="MOTOROLA USE_GAS"
+ tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kemb.h dbxcoff.h m68k/coff.h dbx.h"
;;
m68020-*-elf* | m68k-*-elf*)
- tm_file="m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
+ tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
tmake_file=m68k/t-m68kelf
extra_parts="crtbegin.o crtend.o"
;;
@@ -1352,31 +1267,35 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
esac
;;
m68k*-*-netbsd*)
- tm_file=m68k/netbsd.h
+ tm_file="m68k/m68k.h netbsd.h netbsd-aout.h m68k/netbsd.h"
tmake_file=t-netbsd
extra_parts=""
use_collect2=yes
;;
m68k*-*-openbsd*)
# needed to unconfuse gdb
+ tm_defines="OBSD_OLD_GAS TARGET_DEFAULT=(MASK_68020|MASK_68881|MASK_BITFIELD)"
+ tm_file="m68k/m68k.h openbsd.h m68k/openbsd.h"
tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
m68k-*-sysv4*) # Motorola m68k's running system V.4
- tm_file=m68k/m68kv4.h
+ tm_file="m68k/m68k.h m68k/sgs.h dbxelf.h elfos.h svr4.h m68k/m68kv4.h"
+ tm_defines="MOTOROLA SGS SGS_CMP_ORDER SGS_SWITCH_TABLES"
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
;;
m68k-*-linux*) # Motorola m68k's running GNU/Linux
# with ELF format using glibc 2
# aka the GNU/Linux C library 6.
- tm_file=m68k/linux.h
+ tm_file="m68k/m68k.h dbxelf.h elfos.h svr4.h linux.h m68k/linux.h"
+ tm_defines="MOTOROLA USE_GAS"
tmake_file="t-slibgcc-elf-ver t-linux"
;;
m68k-*-rtems*)
- tmake_file="m68k/t-m68kbare t-rtems m68k/t-crtstuff"
- tm_file="m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h"
+ 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"
extra_parts="crtbegin.o crtend.o"
if test x$enable_threads = xyes; then
thread_file='rtems'
@@ -1387,14 +1306,14 @@ mcore-*-elf)
tmake_file=mcore/t-mcore
;;
mcore-*-pe*)
- tm_file=mcore/mcore-pe.h
+ tm_file="svr3.h dbxcoff.h ${tm_file} mcore/mcore-pe.h"
tmake_file=mcore/t-mcore-pe
;;
mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI
tm_file="${tm_file} mips/iris5.h"
if test x$gas = xyes
then
- tm_file="${tm_file} mips/iris5gas.h mips/iris6-o32-gas.h"
+ tm_file="${tm_file} mips/sdb.h mips/iris5gas.h mips/iris6-o32-gas.h"
if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
@@ -1444,7 +1363,7 @@ mips-sgi-irix5*) # SGI System V.4., IRIX 5
tm_file="${tm_file} mips/iris5.h"
if test x$gas = xyes
then
- tm_file="${tm_file} mips/iris5gas.h"
+ tm_file="${tm_file} mips/sdb.h mips/iris5gas.h"
if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
@@ -1465,7 +1384,7 @@ mips-sgi-irix5*) # SGI System V.4., IRIX 5
;;
mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_GAS|MASK_ABICALLS"
- tm_file="elfos.h ${tm_file} mips/netbsd.h"
+ tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
tmake_file="${tmake_file}"
;;
mips64*-*-linux*)
@@ -1496,12 +1415,15 @@ mips*-*-linux*) # Linux MIPS, either endian.
esac
tmake_file="t-slibgcc-elf-ver t-linux"
;;
-mips*el-*-openbsd*) # mips little endian
- target_cpu_default="MASK_GAS|MASK_ABICALLS"
- ;;
-mips*-*-openbsd*) # mips big endian
+mips*-*-openbsd*)
+ tm_defines="OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
target_cpu_default="MASK_GAS|MASK_ABICALLS"
- tm_file="mips/openbsd-be.h ${tm_file}"
+ tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h"
+ case $machine in
+ mips*el-*-openbsd*)
+ tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";;
+ *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN";;
+ esac
;;
mipsisa32-*-elf* | mipsisa32el-*-elf*)
tm_file="${tm_file} mips/elf.h"
@@ -1555,7 +1477,7 @@ mips64orion-*-elf* | mips64orionel-*-elf*)
;;
mips*-*-rtems*)
tm_file="${tm_file} mips/elf.h mips/rtems.h rtems.h"
- tmake_file="mips/t-elf t-rtems"
+ tmake_file="mips/t-elf t-rtems mips/t-rtems"
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
@@ -1592,10 +1514,11 @@ pdp11-*-*)
;;
avr-*-*)
;;
-powerpc-*-openbsd*)
- tmake_file="${tmake_file} rs6000/t-fprules "
- extra_headers=
- ;;
+# port not yet contributed
+#powerpc-*-openbsd*)
+# tmake_file="${tmake_file} rs6000/t-fprules "
+# extra_headers=
+# ;;
powerpc64-*-linux*)
tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
case x$with_cpu in
@@ -1615,13 +1538,10 @@ powerpc-*-beos*)
;;
powerpc-*-darwin*)
tm_file="${tm_file} rs6000/darwin.h"
- tmake_file="rs6000/t-fprules t-darwin rs6000/t-darwin"
+ tmake_file="t-darwin rs6000/t-darwin"
extra_headers=altivec.h
# override ppc default
need_64bit_hwint=
- # powerpc-darwin host support.
- host_hook_obj=host-darwin.o
- xmake_file=rs6000/x-darwin
;;
powerpc*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
@@ -1762,7 +1682,7 @@ rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
extra_headers=
;;
rs6000-*-lynxos*)
- tm_file="lynx.h rs6000/lynx.h"
+ tm_file="svr3.h lynx.h rs6000/lynxbase.h rs6000/rs6000.h rs6000/lynx.h"
tmake_file=rs6000/t-fprules
use_collect2=yes
;;
@@ -1786,7 +1706,7 @@ sh-*-elf* | sh[2346l]*-*-elf* | sh*-*-kaos*)
tmake_file="${tmake_file} sh/t-le"
;;
esac
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/embed-elf.h"
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h"
case $machine in
sh64*)
tmake_file="${tmake_file} sh/t-sh64"
@@ -1809,7 +1729,7 @@ sh-*-elf* | sh[2346l]*-*-elf* | sh*-*-kaos*)
;;
sh-*-rtemself*)
tmake_file="sh/t-sh sh/t-elf t-rtems"
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/embed-elf.h sh/rtemself.h rtems.h"
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h"
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
@@ -1822,7 +1742,7 @@ sh-*-rtems*)
fi
;;
sh-*-linux* | sh[2346lbe]*-*-linux*)
- tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux"
+ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux"
case $machine in
sh*be-*-* | sh*eb-*-*) ;;
*)
@@ -1830,6 +1750,7 @@ sh-*-linux* | sh[2346lbe]*-*-linux*)
tmake_file="${tmake_file} sh/t-le"
;;
esac
+ tmake_file="${tmake_file} sh/t-linux"
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
case $machine in
sh64*)
@@ -1893,7 +1814,8 @@ sparc-*-netbsdelf*)
tm_file="${tm_file} elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
;;
sparc-*-openbsd*)
- tm_file="sparc/sparc.h ${tm_file}"
+ tm_defines=OBSD_OLD_GAS
+ tm_file="sparc/sparc.h openbsd.h sparc/openbsd.h"
# needed to unconfuse gdb
tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
# we need collect2 until our bug is fixed...
@@ -2025,7 +1947,6 @@ sparc64-*-elf*)
sparc64-*-freebsd*|ultrasparc-*-freebsd*)
tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
tmake_file="${tmake_file} sparc/t-crtfm"
- xmake_file=none
case "x$with_cpu" in
xultrasparc) ;;
x) with_cpu=ultrasparc ;;
@@ -2050,7 +1971,7 @@ strongarm-*-elf*)
extra_modes=arm/arm-modes.def
;;
strongarm-*-pe)
- tm_file="arm/semi.h arm/aout.h arm/coff.h arm/strongarm-coff.h arm/arm.h arm/pe.h arm/strongarm-pe.h"
+ tm_file="arm/semi.h arm/aout.h arm/coff.h dbxcoff.h arm/strongarm-coff.h arm/arm.h arm/pe.h arm/strongarm-pe.h"
tmake_file=arm/t-strongarm-pe
out_file=arm/arm.c
md_file=arm/arm.md
@@ -2064,11 +1985,26 @@ strongarm-*-kaos*)
md_file=arm/arm.md
extra_modes=arm/arm-modes.def
;;
+v850e1-*-*)
+ target_cpu_default="TARGET_CPU_v850e1"
+ tm_file="dbxelf.h elfos.h svr4.h v850/v850.h"
+ tm_p_file=v850/v850-protos.h
+ tmake_file=v850/t-v850e
+ md_file=v850/v850.md
+ out_file=v850/v850.c
+ if test x$stabs = xyes
+ then
+ tm_file="${tm_file} dbx.h"
+ fi
+ use_collect2=no
+ c_target_objs="v850-c.o"
+ cxx_target_objs="v850-c.o"
+ ;;
v850e-*-*)
target_cpu_default="TARGET_CPU_v850e"
tm_file="dbxelf.h elfos.h svr4.h v850/v850.h"
tm_p_file=v850/v850-protos.h
- tmake_file=v850/t-v850
+ tmake_file=v850/t-v850e
md_file=v850/v850.md
out_file=v850/v850.c
if test x$stabs = xyes
@@ -2108,7 +2044,7 @@ vax-*-netbsd*)
use_collect2=yes
;;
vax-*-openbsd*)
- tm_file="vax/vax.h vax/openbsd1.h openbsd.h ${tm_file}"
+ tm_file="vax/vax.h vax/openbsd1.h openbsd.h vax/openbsd.h"
use_collect2=yes
;;
vax-*-ultrix*) # VAXen running ultrix
@@ -2128,7 +2064,7 @@ xscale-*-elf)
extra_modes=arm/arm-modes.def
;;
xscale-*-coff)
- tm_file="arm/semi.h arm/aout.h arm/coff.h arm/xscale-coff.h arm/arm.h"
+ tm_file="arm/semi.h arm/aout.h arm/coff.h dbxcoff.h arm/xscale-coff.h arm/arm.h"
tmake_file=arm/t-xscale-coff
out_file=arm/arm.c
md_file=arm/arm.md
@@ -2151,24 +2087,24 @@ xtensa-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h xtensa/linux.h"
tmake_file="t-slibgcc-elf-ver t-linux xtensa/t-xtensa xtensa/t-linux"
;;
+am33_2.0-*-linux*)
+ tm_file="mn10300/mn10300.h dbxelf.h elfos.h linux.h mn10300/linux.h"
+ tmake_file="t-linux mn10300/t-linux"
+ gas=yes gnu_ld=yes
+ if test x$enable_threads = xyes; then
+ thread_file='posix'
+ fi
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ use_collect2=no
+ ;;
*)
echo "*** Configuration $machine not supported" 1>&2
exit 1
;;
esac
-case $machine in
-*-*-sysv*)
- install_headers_dir=install-headers-cpio
- ;;
-esac
-
# Support for --with-cpu and related options (and a few unrelated options,
-# too). Only do this if $machine is the target, or we'll try to validate
-# the CPU argument against the wrong machine type.
-
-if test "x$pass2done" = xyes
-then
+# too).
case "x$with_cpu" in
xyes | xno)
echo "--with-cpu must be passed a value" 1>&2
@@ -2514,7 +2450,7 @@ then
v850*-*-*)
supported_defaults=cpu
case "x$with_cpu" in
- x | xv850e)
+ x | xv850e | xv850e1)
# OK
;;
*)
@@ -2681,31 +2617,3 @@ then
target_cpu_default=$target_cpu_default2
fi
fi
-fi
-
-# Save data on machine being used to compile GCC in build_xm_file.
-# Save data on host machine in vars host_xm_file and host_xmake_file.
-if test x$pass1done = x
-then
- if test x$xm_file != x
- then build_xm_file=$xm_file
- fi
- build_xm_defines=$xm_defines
- build_install_headers_dir=$install_headers_dir
- build_exeext=$exeext
- pass1done=yes
-else
- if test x$pass2done = x
- then
- if test x$xm_file != x
- then host_xm_file=$xm_file
- fi
- host_xm_defines=$xm_defines
- host_xmake_file="$xmake_file"
- host_extra_gcc_objs=$extra_gcc_objs
- host_extra_objs=$extra_host_objs
- host_exeext=$exeext
- out_host_hook_obj=$host_hook_obj
- pass2done=yes
- fi
-fi
diff --git a/gcc/config.host b/gcc/config.host
new file mode 100644
index 00000000000..9c7b85aab67
--- /dev/null
+++ b/gcc/config.host
@@ -0,0 +1,610 @@
+# GCC host-specific configuration file.
+# Copyright 1997, 1998, 1999, 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.
+
+# This is the GCC host-specific configuration file
+# where a configuration type is mapped to different system-specific
+# definitions and files. This is invoked by the autoconf-generated
+# configure script. Putting it in a separate shell file lets us skip
+# running autoconf when modifying host-specific information.
+
+# This file switches on the shell variable ${host}. As much of this as
+# is reasonable should be replaced with autoconf tests in the future.
+
+# This file sets the following shell variables for use by the
+# autoconf-generated configure script:
+#
+# host_xm_file List of files to include when compiling for the
+# host machine.
+#
+# host_xm_defines List of macros to define when compiling for the
+# host machine.
+#
+# host_xmake_file List of host-specific makefile-fragments.
+#
+# host_exeext Set to the suffix, if the host machine requires
+# executables to have a file name suffix.
+#
+# host_extra_objs List of extra host-dependent objects that should
+# be linked into the compiler proper.
+#
+# host_extra_gcc_objs List of extra host-dependent objects that should
+# be linked into the gcc driver.
+#
+# out_host_hook_obj An object file that provides the host hooks.
+
+# When setting any of these variables, check to see if a corresponding
+# variable is present in config.build; if so, you will likely want to
+# set it in both places.
+
+# Default settings.
+host_xm_file=
+host_xm_defines=
+host_xmake_file=
+host_exeext=
+host_extra_objs=
+host_extra_gcc_objs=
+out_host_hook_obj=host-default.o
+
+# Obsolete configurations.
+case ${host} in
+ dummy)
+ if test "x$enable_obsolete" != xyes; then
+ echo "*** Configuration for host ${host} 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
+ ;;
+esac
+
+# Unsupported hosts list. Do not put an entry in this list unless
+# it would otherwise be caught by a more permissive pattern. The list
+# should be in alphabetical order.
+case ${host} in
+ alpha*-*-linux*libc1* \
+ | i[34567]86-sequent-sysv \
+ | i[34567]86-sequent-sysv[123]* \
+ | i[34567]86-go32-* \
+ | i[34567]86-*-go32* \
+ | m68k-*-linux*aout* \
+ | m68k-*-linux*libc1* \
+ | mips64orion*-*-rtems* \
+ | powerpc-*-linux*libc1* \
+ | sparc-*-linux*aout* \
+ | sparc-*-linux*libc1* \
+ | sparc-hal-solaris2* \
+ | thumb-*-* \
+ | *-*-linux*coff* \
+ | *-*-linux*oldld* \
+ | *-*-rtemsaout* \
+ | *-*-rtemscoff* \
+ )
+ echo "*** Configuration for host ${host} not supported" 1>&2
+ exit 1
+ ;;
+esac
+
+# Machine-specific settings.
+case ${host} in
+ alpha*-*-unicosmk*)
+ ;;
+ alpha*-*-linux*)
+ ;;
+ alpha*-*-gnu*)
+ ;;
+ alpha*-*-freebsd*)
+ ;;
+ alpha*-*-netbsd*)
+ ;;
+ alpha*-*-openbsd*)
+ ;;
+ alpha*-dec-osf[45]*)
+ ;;
+ alpha*-dec-*vms*)
+ host_xm_file=alpha/xm-vms.h
+ host_xmake_file=alpha/x-vms
+ host_exeext=.exe
+ # This removes the cpu type and manufacturer components and
+ # replaces "." with "_" in the operating system version.
+ target_alias=`echo $host | sed 's/.*-.*-\(.*\)$/\1/' | sed 's/\./_/g'`
+ prefix=/gnu
+ local_prefix=/gnu
+ ;;
+ arc-*-elf*)
+ ;;
+ arm-*-coff* | armel-*-coff*)
+ ;;
+ arm-semi-aof | armel-semi-aof)
+ ;;
+ arm*-*-freebsd*|strongarm*-*-freebsd*)
+ ;;
+ arm*-*-netbsdelf*)
+ ;;
+ arm*-*-netbsd*)
+ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ ;;
+ arm*-*-uclinux*) # ARM ucLinux
+ ;;
+ arm*-*-ecos-elf)
+ ;;
+ arm*-*-rtems*)
+ ;;
+ arm*-*-elf | ep9312-*-elf)
+ ;;
+ arm*-wince-pe*)
+ ;;
+ arm-*-pe*)
+ ;;
+ arm*-*-kaos*)
+ ;;
+ avr-*-*)
+ ;;
+ c4x-*-rtems* | tic4x-*-rtems*)
+ ;;
+ c4x-* | tic4x-*)
+ ;;
+ cris-*-aout)
+ ;;
+ cris-*-elf | cris-*-none)
+ ;;
+ cris-*-linux*)
+ ;;
+ d30v-*)
+ ;;
+ dsp16xx-*)
+ ;;
+ fr30-*-elf)
+ ;;
+ frv-*-elf)
+ ;;
+ h8300-*-rtems*)
+ ;;
+ h8300-*-elf*)
+ ;;
+ h8300-*-*)
+ ;;
+ hppa*64*-*-linux* | parisc*64*-*-linux*)
+ ;;
+ hppa*-*-linux* | parisc*-*-linux*)
+ ;;
+# port not yet contributed.
+# hppa*-*-openbsd*)
+# ;;
+ hppa1.1-*-pro*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa1.1-*-osf*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa1.1-*-rtems*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa1.1-*-bsd*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa1.0-*-hpux10*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa*64*-*-hpux11*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa1.1-*-hpux11* | hppa2*-*-hpux11*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ hppa1.0-*-hpux11*)
+ host_xmake_file="pa/x-ada"
+ ;;
+ i370-*-opened*) # IBM 360/370/390 Architecture
+ host_xm_defines='FATAL_EXIT_CODE=12'
+ ;;
+ i370-*-mvs*)
+ host_xm_defines='FATAL_EXIT_CODE=12'
+ ;;
+ i370-*-linux*)
+ ;;
+ i[34567]86-*-darwin*)
+ ;;
+ i[34567]86-*-elf*)
+ ;;
+ i[34567]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4
+ host_xm_defines="SMALL_ARG_MAX"
+ ;;
+ i[34567]86-*-netware) # Intel 80386's running netware
+ ;;
+ i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*)
+ host_xm_defines="SMALL_ARG_MAX"
+ ;;
+ i[34567]86-*-aout*)
+ ;;
+ i[34567]86-*-beoself* | i[34567]86-*-beos*)
+ ;;
+ i[34567]86-*-freebsd2 | i[34567]86-*-freebsd2.* | i[34567]86-*-freebsd*aout*)
+ ;;
+ i[34567]86-*-freebsd*)
+ ;;
+ x86_64-*-freebsd*)
+ ;;
+ i[34567]86-*-netbsdelf*)
+ ;;
+ i[34567]86-*-netbsd*)
+ ;;
+ x86_64-*-netbsd*)
+ ;;
+ i[34567]86-*-openbsd*)
+ ;;
+ i[34567]86-*-coff*)
+ ;;
+ i[34567]86-*-linux*aout*) # Intel 80386's running GNU/Linux with a.out format
+ ;;
+ i[34567]86-*-linux*libc1) # Intel 80386's running GNU/Linux
+ # with ELF format using the
+ # GNU/Linux C library 5
+ ;;
+ i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
+ # with ELF format using glibc 2
+ # aka GNU/Linux C library 6
+ ;;
+ x86_64-*-linux*)
+ ;;
+ i[34567]86-*-gnu*)
+ ;;
+ i[34567]86-pc-msdosdjgpp*)
+ host_xm_file=i386/xm-djgpp.h
+ host_exeext=.exe
+ # Shorten $target_alias for 8.3 filename conventions.
+ case ${target} in
+ *pc-msdosdjgpp*)
+ target_alias=djgpp
+ ;;
+ esac
+ ;;
+ i[34567]86-moss-msdos* | i[34567]86-*-moss*)
+ ;;
+ i[34567]86-*-lynxos*)
+ ;;
+ i[34567]86-*-mach*)
+ ;;
+ i[34567]86-*-nto-qnx*)
+ ;;
+ i[34567]86-*-rtems*)
+ ;;
+ i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
+ ;;
+ i[34567]86-*-solaris2*)
+ host_xm_defines="SMALL_ARG_MAX"
+ ;;
+ i[34567]86-*-sysv5*) # Intel x86 on System V Release 5
+ ;;
+ i[34567]86-*-sysv4*) # Intel 80386's running System V Release 4
+ host_xm_defines="SMALL_ARG_MAX"
+ ;;
+ i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
+ ;;
+ i[34567]86-*-sysv*) # Intel 80386's running System V
+ ;;
+ i386-*-vsta) # Intel 80386's running VSTa kernel
+ ;;
+ i[34567]86-*-pe | i[34567]86-*-cygwin*)
+ host_xm_file=i386/xm-cygwin.h
+ host_exeext=.exe
+ ;;
+ i[34567]86-*-mingw32*)
+ host_xm_file=i386/xm-mingw32.h
+ host_xmake_file=i386/x-mingw32
+ host_exeext=.exe
+ ;;
+ i[34567]86-*-uwin*)
+ host_exeext=.exe
+ ;;
+ i[34567]86-*-interix3*)
+ host_xmake_file="x-interix"
+ ;;
+ i[34567]86-*-interix*)
+ ;;
+ i[34567]86-*-kaos*)
+ ;;
+ i860-*-sysv4*)
+ host_xmake_file=i860/x-sysv4
+ ;;
+ i960-*-coff*)
+ ;;
+ i960-*-rtems)
+ ;;
+ i960-*-*) # Default i960 environment.
+ ;;
+ ia64*-*-elf*)
+ ;;
+ ia64*-*-freebsd*)
+ ;;
+ ia64*-*-linux*)
+ ;;
+ ia64*-*-hpux*)
+ ;;
+ ip2k-*-elf)
+ ;;
+ iq2000*-*-elf*)
+ ;;
+ m32r-*-elf*)
+ ;;
+ # m68hc11 and m68hc12 share the same machine description.
+ m68hc11-*-*|m6811-*-*)
+ ;;
+ m68hc12-*-*|m6812-*-*)
+ ;;
+ m68000-hp-hpux*) # HP 9000 series 300
+ ;;
+ m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
+ ;;
+ m68k-hp-hpux*) # HP 9000 series 300
+ ;;
+ m68k-*-aout*)
+ ;;
+ m68k-*-coff*)
+ ;;
+ m68020-*-elf* | m68k-*-elf*)
+ ;;
+ m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
+ ;;
+ m68k*-*-netbsd*)
+ ;;
+ m68k*-*-openbsd*)
+ ;;
+ m68k-*-sysv4*) # Motorola m68k's running system V r4
+ ;;
+ m68k-*-linux*) # Motorola m68k's running GNU/Linux
+ # with ELF format using glibc 2
+ # aka the GNU/Linux C library 6.
+ ;;
+ m68k-*-rtems*)
+ ;;
+ mcore-*-elf)
+ ;;
+ mcore-*-pe*)
+ ;;
+ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI
+ host_xm_file=mips/xm-iris5.h
+ ;;
+ mips-sgi-irix6*) # SGI System V.4., IRIX 6
+ ;;
+ mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64
+ host_xm_file=mips/xm-iris5.h
+ ;;
+ mips-sgi-irix5*) # SGI System V.4., IRIX 5
+ host_xm_file=mips/xm-iris5.h
+ ;;
+ mips*-*-netbsd*) # NetBSD/mips, either endian.
+ ;;
+ mips64*-*-linux*)
+ ;;
+ mips*-*-linux*) # Linux MIPS, either endian.
+ ;;
+ mips*-*-openbsd*)
+ ;;
+ mipsisa32-*-elf* | mipsisa32el-*-elf*)
+ ;;
+ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*)
+ ;;
+ mipsisa64-*-elf* | mipsisa64el-*-elf*)
+ ;;
+ mipsisa64sr71k-*-elf*)
+ ;;
+ mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
+ ;;
+ mips-*-elf* | mipsel-*-elf*)
+ ;;
+ mips64-*-elf* | mips64el-*-elf*)
+ ;;
+ mips64vr-*-elf* | mips64vrel-*-elf*)
+ ;;
+ mips64orion-*-elf* | mips64orionel-*-elf*)
+ ;;
+ mips*-*-rtems*)
+ ;;
+ mipstx39-*-elf* | mipstx39el-*-elf*)
+ ;;
+ mmix-knuth-mmixware)
+ ;;
+ mn10300-*-*)
+ ;;
+ ns32k-*-netbsdelf*)
+ echo "GCC does not yet support the ${host} host"; exit 1
+ ;;
+ ns32k-*-netbsd*)
+ ;;
+ pdp11-*-bsd)
+ ;;
+ pdp11-*-*)
+ ;;
+ avr-*-*)
+ ;;
+# port not yet contributed
+# powerpc-*-openbsd*)
+# ;;
+ powerpc64-*-linux*)
+ ;;
+ powerpc64-*-gnu*)
+ ;;
+ powerpc-*-beos*)
+ ;;
+ powerpc-*-darwin*)
+ # powerpc-darwin host support.
+ out_host_hook_obj=host-darwin.o
+ host_xmake_file=rs6000/x-darwin
+ ;;
+ powerpc*-*-freebsd*)
+ ;;
+ powerpc-*-netbsd*)
+ ;;
+ powerpc-*-chorusos*)
+ ;;
+ powerpc-*-eabispe*)
+ ;;
+ powerpc-*-eabisimaltivec*)
+ ;;
+ powerpc-*-eabisim*)
+ ;;
+ powerpc-*-elf*)
+ ;;
+ powerpc-*-eabialtivec*)
+ ;;
+ powerpc-*-eabi*)
+ ;;
+ powerpc-*-rtems*)
+ ;;
+ powerpc-*-linux*altivec*)
+ ;;
+ powerpc-*-linux*spe*)
+ ;;
+ powerpc-*-linux*)
+ ;;
+ powerpc-*-gnu-gnualtivec*)
+ ;;
+ powerpc-*-gnu*)
+ ;;
+ powerpc-wrs-vxworks*)
+ ;;
+ powerpc-wrs-windiss*)
+ ;;
+ powerpcle-*-sysv*)
+ ;;
+ powerpcle-*-elf*)
+ ;;
+ powerpcle-*-eabisim*)
+ ;;
+ powerpcle-*-eabi*)
+ ;;
+ powerpc-*-kaos*)
+ ;;
+ powerpcle-*-kaos*)
+ ;;
+ rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
+ ;;
+ rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
+ ;;
+ rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
+ ;;
+ rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
+ ;;
+ rs6000-*-lynxos*)
+ ;;
+ s390-*-linux*)
+ ;;
+ s390x-*-linux*)
+ ;;
+ sh-*-elf* | sh[2346l]*-*-elf* | sh*-*-kaos*)
+ ;;
+ sh-*-rtemself*)
+ ;;
+ sh-*-rtems*)
+ ;;
+ sh-*-linux* | sh[2346lbe]*-*-linux*)
+ ;;
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ ;;
+ sh-*-*)
+ ;;
+ sparc-tti-*)
+ ;;
+ sparc-*-netbsdelf*)
+ ;;
+ sparc-*-openbsd*)
+ ;;
+ sparc64-*-openbsd*)
+ ;;
+ sparc-*-elf*)
+ ;;
+ sparc-*-linux*) # SPARC's running GNU/Linux, libc6
+ ;;
+ sparc-*-rtems*)
+ ;;
+ sparc64-*-solaris2* | sparcv9-*-solaris2*)
+ ;;
+ sparc-*-solaris2*)
+ ;;
+ sparc-*-sysv4*)
+ ;;
+ sparclite-*-coff*)
+ ;;
+ sparclite-*-elf*)
+ ;;
+ sparc86x-*-elf*)
+ ;;
+ sparc64-*-aout*)
+ ;;
+ sparc64-*-elf*)
+ ;;
+ sparc64-*-freebsd*|ultrasparc-*-freebsd*)
+ ;;
+ sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
+ ;;
+ sparc64-*-netbsd*)
+ ;;
+ strongarm-*-elf*)
+ ;;
+ strongarm-*-pe)
+ ;;
+ strongarm-*-kaos*)
+ ;;
+ v850e-*-*)
+ ;;
+ v850-*-*)
+ ;;
+ vax-*-bsd*) # VAXen running BSD
+ ;;
+ vax-*-sysv*) # VAXen running System V
+ ;;
+ vax-*-netbsdelf*)
+ ;;
+ vax-*-netbsd*)
+ ;;
+ vax-*-openbsd*)
+ ;;
+ vax-*-ultrix*) # VAXen running ultrix
+ ;;
+ vax-*-vms*) # VAXen running VMS
+ echo "Host ${host} no longer supported" 1>&2
+ exit 1
+ ;;
+ vax-*-*) # VAX default entry
+ ;;
+ xscale-*-elf)
+ ;;
+ xscale-*-coff)
+ ;;
+ xstormy16-*-elf)
+ ;;
+ xtensa-*-elf*)
+ ;;
+ xtensa-*-linux*)
+ ;;
+ am33_2.0-*-linux*)
+ ;;
+ *)
+ echo "*** Configuration ${host} not supported" 1>&2
+ exit 1
+ ;;
+esac
diff --git a/gcc/config.in b/gcc/config.in
index 9370196cfd2..54c4baeb3d0 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader 2.13. */
+/* config.in. Generated automatically from configure.in by autoheader. */
/* Define to the type of elements in the array set by `getgroups'.
Usually this is either `int' or `gid_t'. */
@@ -34,22 +34,6 @@
/* Define vfork as fork if vfork does not work. */
#undef vfork
-/* Define if your assembler supports specifying the maximum number
- of bytes to skip when using the GAS .p2align command. */
-#undef HAVE_GAS_MAX_SKIP_P2ALIGN
-
-/* Define if your assembler supports .balign and .p2align. */
-#undef HAVE_GAS_BALIGN_AND_P2ALIGN
-
-/* Define if your assembler uses the old HImode fild and fist notation. */
-#undef HAVE_GAS_FILDS_FISTS
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef ssize_t
-
-/* Define if cpp should also search $prefix/include. */
-#undef PREFIX_INCLUDE_DIR
-
/* Define if you have the alphasort function. */
#undef HAVE_ALPHASORT
@@ -89,9 +73,6 @@
/* Define if you have the kill function. */
#undef HAVE_KILL
-/* Define if you have the lstat function. */
-#undef HAVE_LSTAT
-
/* Define if you have the mbstowcs function. */
#undef HAVE_MBSTOWCS
@@ -252,6 +233,10 @@
every opportunity. This is extremely expensive. */
#undef ENABLE_GC_ALWAYS_COLLECT
+/* Define if you want fold checked that it never destructs its argument.
+ This is quite expensive. */
+#undef ENABLE_FOLD_CHECKING
+
/* Define if you want to run subprograms and generated programs
through valgrind (a memory checker). This is extremely expensive. */
#undef ENABLE_VALGRIND_CHECKING
@@ -288,6 +273,9 @@
first argument is NULL. */
#undef HAVE_WORKING_MBSTOWCS
+/* Define as `int' if <sys/types.h> doesn't define. */
+#undef ssize_t
+
/* Define if printf supports %p. */
#undef HAVE_PRINTF_PTR
@@ -442,6 +430,13 @@
/* Define to be the last portion of registry key on windows hosts. */
#undef WIN32_REGISTRY_KEY
+/* Define if your assembler supports .balign and .p2align. */
+#undef HAVE_GAS_BALIGN_AND_P2ALIGN
+
+/* Define if your assembler supports specifying the maximum number
+ of bytes to skip when using the GAS .p2align command. */
+#undef HAVE_GAS_MAX_SKIP_P2ALIGN
+
/* Define if your assembler supports .subsection and .subsection -1 starts
emitting at the beginning of your section. */
#undef HAVE_GAS_SUBSECTION_ORDERING
@@ -449,10 +444,10 @@
/* Define if your assembler supports .weak. */
#undef HAVE_GAS_WEAK
-/* Define if your assembler supports .hidden. */
+/* Define if your assembler and linker support .hidden. */
#undef HAVE_GAS_HIDDEN
-/* Define if your assembler supports .uleb128. */
+/* Define if your assembler supports .sleb128 and .uleb128. */
#undef HAVE_AS_LEB128
/* Define if your assembler mis-optimizes .eh_frame data. */
@@ -482,6 +477,12 @@
/* Define if your assembler supports offsetable %lo(). */
#undef HAVE_AS_OFFSETABLE_LO10
+/* Define if your assembler uses the new HImode fild and fist notation. */
+#undef HAVE_GAS_FILDS_FISTS
+
+/* Define if your assembler supports the Sun syntax for cmov. */
+#undef HAVE_AS_IX86_CMOV_SUN_SYNTAX
+
/* Define true if the assembler supports '.long foo@GOTOFF'. */
#undef HAVE_AS_GOTOFF_IN_DATA
@@ -514,15 +515,6 @@
/* 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
-/* Bison unconditionally undefines `const' if neither `__STDC__' nor
- __cplusplus are defined. That's a problem since we use `const' in
- the GCC headers, and the resulting bison code is therefore type
- unsafe. Thus, we must match the bison behavior here. */
-
-#ifndef __STDC__
-#ifndef __cplusplus
-#undef const
-#define const
-#endif
-#endif
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index df386deb937..72d01af2f15 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -233,7 +233,7 @@ override_options (void)
flag_pic = 0;
}
- /* On Unicos/Mk, the native compiler consistenly generates /d suffices for
+ /* On Unicos/Mk, the native compiler consistently generates /d suffices for
floating-point instructions. Make that the default for this target. */
if (TARGET_ABI_UNICOSMK)
alpha_fprm = ALPHA_FPRM_DYN;
@@ -3481,7 +3481,7 @@ alpha_split_conditional_move (enum rtx_code code, rtx dest, rtx cond,
be shared. */
if (f == 0 && exact_log2 (diff) > 0
- /* On EV6, we've got enough shifters to make non-arithmatic shifts
+ /* On EV6, we've got enough shifters to make non-arithmetic shifts
viable over a longer latency cmove. On EV5, the E0 slot is a
scarce resource, and on EV4 shift has the same latency as a cmove. */
&& (diff <= 8 || alpha_cpu == PROCESSOR_EV6))
@@ -5120,7 +5120,7 @@ alpha_use_dfa_pipeline_interface (void)
For EV4, loads can be issued to either IB0 or IB1, thus we have 2
alternative schedules. For EV5, we can choose between E0/E1 and
- FA/FM. For EV6, an arithmatic insn can be issued to U0/U1/L0/L1. */
+ FA/FM. For EV6, an arithmetic insn can be issued to U0/U1/L0/L1. */
static int
alpha_multipass_dfa_lookahead (void)
@@ -7799,7 +7799,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Find the "this" pointer. If the function returns a structure,
the structure return pointer is in $16. */
- if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function))))
+ if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
this = gen_rtx_REG (Pmode, 17);
else
this = gen_rtx_REG (Pmode, 16);
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 067f3fdf839..a7680d9ac99 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -120,7 +120,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
;; The ROUND_SUFFIX attribute marks which instructions require a
;; rounding-mode suffix. The value NONE indicates no suffix,
-;; the value NORMAL indicates a suffix controled by alpha_fprm.
+;; the value NORMAL indicates a suffix controlled by alpha_fprm.
(define_attr "round_suffix" "none,normal,c"
(const_string "none"))
@@ -133,7 +133,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
;; V_SV_SVI accepts /v, /sv and /svi (cvttq only)
;; U_SU_SUI accepts /u, /su and /sui (most fp instructions)
;;
-;; The actual suffix emitted is controled by alpha_fptm.
+;; The actual suffix emitted is controlled by alpha_fptm.
(define_attr "trap_suffix" "none,su,sui,v_sv,v_sv_svi,u_su_sui"
(const_string "none"))
@@ -7171,7 +7171,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_extxl_be;
else
@@ -7186,7 +7186,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_extxl_be;
else
@@ -7201,7 +7201,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_extxl_be;
else
@@ -7216,7 +7216,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_extxl_be;
else
@@ -7231,7 +7231,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_extwh_be;
else
@@ -7246,7 +7246,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_extlh_be;
else
@@ -7261,7 +7261,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_extqh_be;
else
@@ -7276,7 +7276,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_insbl_be;
else
@@ -7292,7 +7292,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_inswl_be;
else
@@ -7308,7 +7308,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_insll_be;
else
@@ -7325,7 +7325,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx);
if (WORDS_BIG_ENDIAN)
gen = gen_insql_be;
else
@@ -7370,7 +7370,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
rtx mask;
if (WORDS_BIG_ENDIAN)
gen = gen_mskxl_be;
@@ -7387,7 +7387,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
rtx mask;
if (WORDS_BIG_ENDIAN)
gen = gen_mskxl_be;
@@ -7404,7 +7404,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
rtx mask;
if (WORDS_BIG_ENDIAN)
gen = gen_mskxl_be;
@@ -7421,7 +7421,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand:DI 2 "reg_or_8bit_operand" "")]
""
{
- rtx (*gen) PARAMS ((rtx, rtx, rtx, rtx));
+ rtx (*gen) (rtx, rtx, rtx, rtx);
rtx mask;
if (WORDS_BIG_ENDIAN)
gen = gen_mskxl_be;
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index bad20a6b204..87d62eb551e 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for Alpha Linux-based GNU systems.
- Copyright (C) 1996, 1997, 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
Contributed by Richard Henderson.
This file is part of GNU CC.
@@ -65,6 +65,9 @@ Boston, MA 02111-1307, USA. */
#define TARGET_HAS_F_SETLKW
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/alpha/openbsd.h b/gcc/config/alpha/openbsd.h
index f574e8da1f7..fa9a5111173 100644
--- a/gcc/config/alpha/openbsd.h
+++ b/gcc/config/alpha/openbsd.h
@@ -1,5 +1,5 @@
/* Configuration file for an alpha OpenBSD target.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -21,16 +21,6 @@ Boston, MA 02111-1307, USA. */
/* We settle for little endian for now. */
#define TARGET_ENDIAN_DEFAULT 0
-#define OBSD_NO_DYNAMIC_LIBRARIES
-#define OBSD_HAS_DECLARE_FUNCTION_NAME
-#define OBSD_HAS_DECLARE_FUNCTION_SIZE
-#define OBSD_HAS_DECLARE_OBJECT
-
-/* alpha ecoff supports only weak aliases, see below. */
-#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS (FILE,NAME,0)
-
-#include <openbsd.h>
-
/* Controlling the compilation driver. */
/* alpha needs __start. */
@@ -90,6 +80,10 @@ Boston, MA 02111-1307, USA. */
/* Assembler format: label output. */
+/* alpha ecoff supports only weak aliases. */
+#undef ASM_WEAKEN_LABEL
+#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS (FILE,NAME,0)
+
#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
do { \
fputs ("\t.weakext\t", FILE); \
diff --git a/gcc/config/alpha/t-osf-pthread b/gcc/config/alpha/t-osf-pthread
new file mode 100644
index 00000000000..968e65cce9e
--- /dev/null
+++ b/gcc/config/alpha/t-osf-pthread
@@ -0,0 +1,5 @@
+# Provide dummy POSIX threads functions
+LIB2FUNCS_EXTRA += $(srcdir)/gthr-posix.c
+
+# Compile libgcc2 with POSIX threads supports
+TARGET_LIBGCC2_CFLAGS=-pthread
diff --git a/gcc/config/alpha/t-osf4 b/gcc/config/alpha/t-osf4
index 0525d617662..fe747a3d521 100644
--- a/gcc/config/alpha/t-osf4
+++ b/gcc/config/alpha/t-osf4
@@ -10,7 +10,11 @@ SHLIB_NAME = @shlib_base_name@.so
SHLIB_SONAME = @shlib_base_name@.so.1
SHLIB_OBJS = @shlib_objs@
+# Hide all POSIX threads related symbols provided by gthr-posix.c. This
+# only has an effect if t-osf-pthread is in use.
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,-hidden_symbol,pthread\* -Wl,-hidden_symbol,__pthread\* \
+ -Wl,-hidden_symbol,sched_get_\* -Wl,-hidden_symbol,sched_yield \
-Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME) \
-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
rm -f $(SHLIB_SONAME) && \
diff --git a/gcc/config/arc/t-arc b/gcc/config/arc/t-arc
index bbf4257c7b9..9f949f6c438 100644
--- a/gcc/config/arc/t-arc
+++ b/gcc/config/arc/t-arc
@@ -26,15 +26,15 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
# .init/.fini section routines
-x-crtinit.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
+crtinit.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
-DCRT_INIT -finhibit-size-directive -fno-inline-functions \
- -g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtinit.o
+ -g0 -c $(srcdir)/config/arc/initfini.c -o crtinit.o
-x-crtfini.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
+crtfini.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
-DCRT_FINI -finhibit-size-directive -fno-inline-functions \
- -g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtfini.o
+ -g0 -c $(srcdir)/config/arc/initfini.c -o crtfini.o
MULTILIB_OPTIONS = EB
MULTILIB_DIRNAMES = be
@@ -54,7 +54,7 @@ stmp-multilib-arc: stmp-multilib
BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
GCC_CFLAGS="$(GCC_CFLAGS) $${flags}" \
INCLUDES="$(INCLUDES)" CRTSTUFF_T_CFLAGS=$(CRTSTUFF_T_CFLAGS) \
- dir="$${dir}" x-crtinit.o x-crtfini.o; \
+ dir="$${dir}" crtinit.o crtfini.o; \
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
done
touch stmp-multilib-arc
diff --git a/gcc/config/arm/README-interworking b/gcc/config/arm/README-interworking
index de8b27841b2..0a03cdc3c9d 100644
--- a/gcc/config/arm/README-interworking
+++ b/gcc/config/arm/README-interworking
@@ -404,7 +404,7 @@ Instead the pseudo op is attached to a new label .real_start_of_<name>
(where <name> is the name of the function) which indicates the start
of the Thumb code. This does have the interesting side effect in that
if this function is now called from a Thumb mode piece of code
-outsside of the current file, the linker will generate a calling stub
+outside of the current file, the linker will generate a calling stub
to switch from Thumb mode into ARM mode, and then this is immediately
overridden by the function's header which switches back into Thumb
mode.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 6b6a718557d..5e92b28b79b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -452,7 +452,7 @@ static const struct processors all_architectures[] =
{ NULL, 0 }
};
-/* This is a magic stucture. The 'string' field is magically filled in
+/* This is a magic structure. The 'string' field is magically filled in
with a pointer to the value specified by the user on the command line
assuming that the user has specified such a value. */
@@ -1968,7 +1968,7 @@ arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype,
tree fndecl ATTRIBUTE_UNUSED)
{
/* On the ARM, the offset starts at 0. */
- pcum->nregs = ((fntype && aggregate_value_p (TREE_TYPE (fntype))) ? 1 : 0);
+ pcum->nregs = ((fntype && aggregate_value_p (TREE_TYPE (fntype), fntype)) ? 1 : 0);
pcum->iwmmxt_nregs = 0;
pcum->call_cookie = CALL_NORMAL;
@@ -10248,7 +10248,7 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
return VALID_IWMMXT_REG_MODE (mode);
if (regno <= LAST_ARM_REGNUM)
- /* We allow any value to be stored in the general regisetrs. */
+ /* We allow any value to be stored in the general registers. */
return 1;
if ( regno == FRAME_POINTER_REGNUM
@@ -10715,7 +10715,7 @@ arm_init_iwmmxt_builtins (void)
/* Add all builtins that are more or less simple operations on two
operands. */
- for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++)
+ for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
{
/* Use one of the operands; the target can have a different mode for
mask-generating compares. */
@@ -11155,11 +11155,11 @@ arm_expand_builtin (tree exp,
break;
}
- for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++)
+ for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
if (d->code == (const enum arm_builtins) fcode)
return arm_expand_binop_builtin (d->icode, arglist, target);
- for (i = 0, d = bdesc_1arg; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++)
+ for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++)
if (d->code == (const enum arm_builtins) fcode)
return arm_expand_unop_builtin (d->icode, arglist, target, 0);
@@ -11648,7 +11648,7 @@ thumb_far_jump_used_p (int in_prologue)
&& get_attr_far_jump (insn) == FAR_JUMP_YES
)
{
- /* Record the fact that we have decied that
+ /* Record the fact that we have decided that
the function does use far jumps. */
cfun->machine->far_jump_used = 1;
return 1;
@@ -12962,7 +12962,7 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
int mi_delta = delta;
const char *const mi_op = mi_delta < 0 ? "sub" : "add";
int shift = 0;
- int this_regno = (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)))
+ int this_regno = (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function)
? 1 : 0);
if (mi_delta < 0)
mi_delta = - mi_delta;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index dc649ccfd1d..958cbcb29f6 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -172,9 +172,13 @@ extern GTY(()) rtx aof_pic_label;
#ifdef TARGET_DEFAULT
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME)
-#endif /* TARGET_CPU_DEFAULT */
+#endif
+#else
+#if TARGET_CPU_DEFAULT == TARGET_CPU_iwmmxt
+#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__ -D__IWMMXT__"
#else
-Unrecognized value in TARGET_CPU_DEFAULT.
+#error Unrecognized value in TARGET_CPU_DEFAULT.
+#endif
#endif
#endif
#endif
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 94e2c65edd6..4a72c69ef3c 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -75,18 +75,18 @@
; and stack frame generation. Operand 0 is the
; register to "use".
(UNSPEC_CHECK_ARCH 7); Set CCs to indicate 26-bit or 32-bit mode.
- (UNSPEC_WSHUFH 8) ; Used by the instrinsic form of the iWMMXt WSHUFH instruction.
- (UNSPEC_WACC 9) ; Used by the instrinsic form of the iWMMXt WACC instruction.
- (UNSPEC_TMOVMSK 10) ; Used by the instrinsic form of the iWMMXt TMOVMSK instruction.
- (UNSPEC_WSAD 11) ; Used by the instrinsic form of the iWMMXt WSAD instruction.
- (UNSPEC_WSADZ 12) ; Used by the instrinsic form of the iWMMXt WSADZ instruction.
- (UNSPEC_WMACS 13) ; Used by the instrinsic form of the iWMMXt WMACS instruction.
- (UNSPEC_WMACU 14) ; Used by the instrinsic form of the iWMMXt WMACU instruction.
- (UNSPEC_WMACSZ 15) ; Used by the instrinsic form of the iWMMXt WMACSZ instruction.
- (UNSPEC_WMACUZ 16) ; Used by the instrinsic form of the iWMMXt WMACUZ instruction.
- (UNSPEC_CLRDI 17) ; Used by the instrinsic form of the iWMMXt CLRDI instruction.
- (UNSPEC_WMADDS 18) ; Used by the instrinsic form of the iWMMXt WMADDS instruction.
- (UNSPEC_WMADDU 19) ; Used by the instrinsic form of the iWMMXt WMADDU instruction.
+ (UNSPEC_WSHUFH 8) ; Used by the intrinsic form of the iWMMXt WSHUFH instruction.
+ (UNSPEC_WACC 9) ; Used by the intrinsic form of the iWMMXt WACC instruction.
+ (UNSPEC_TMOVMSK 10) ; Used by the intrinsic form of the iWMMXt TMOVMSK instruction.
+ (UNSPEC_WSAD 11) ; Used by the intrinsic form of the iWMMXt WSAD instruction.
+ (UNSPEC_WSADZ 12) ; Used by the intrinsic form of the iWMMXt WSADZ instruction.
+ (UNSPEC_WMACS 13) ; Used by the intrinsic form of the iWMMXt WMACS instruction.
+ (UNSPEC_WMACU 14) ; Used by the intrinsic form of the iWMMXt WMACU instruction.
+ (UNSPEC_WMACSZ 15) ; Used by the intrinsic form of the iWMMXt WMACSZ instruction.
+ (UNSPEC_WMACUZ 16) ; Used by the intrinsic form of the iWMMXt WMACUZ instruction.
+ (UNSPEC_CLRDI 17) ; Used by the intrinsic form of the iWMMXt CLRDI instruction.
+ (UNSPEC_WMADDS 18) ; Used by the intrinsic form of the iWMMXt WMADDS instruction.
+ (UNSPEC_WMADDU 19) ; Used by the intrinsic form of the iWMMXt WMADDU instruction.
]
)
@@ -243,7 +243,7 @@
; Only model the write buffer for ARM6 and ARM7. Earlier processors don't
; have one. Later ones, such as StrongARM, have write-back caches, so don't
-; suffer blockages enough to warrent modelling this (and it can adversely
+; suffer blockages enough to warrant modelling this (and it can adversely
; affect the schedule).
(define_attr "model_wbuf" "no,yes" (const (symbol_ref "arm_is_6_or_7")))
@@ -5106,7 +5106,7 @@
;; Compare & branch insns
-;; The range calcualations are based as follows:
+;; The range calculations are based as follows:
;; For forward branches, the address calculation returns the address of
;; the next instruction. This is 2 beyond the branch instruction.
;; For backward branches, the address calculation returns the address of
diff --git a/gcc/config/arm/coff.h b/gcc/config/arm/coff.h
index c4f0932e9ce..310c4fba8ec 100644
--- a/gcc/config/arm/coff.h
+++ b/gcc/config/arm/coff.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler.
For ARM with COFF object format.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
Contributed by Doug Evans (devans@cygnus.com).
@@ -43,7 +43,6 @@
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-#include "dbxcoff.h"
#define TARGET_ASM_FILE_START_APP_OFF true
diff --git a/gcc/config/arm/ieee754-df.S b/gcc/config/arm/ieee754-df.S
new file mode 100644
index 00000000000..2d5f487ff60
--- /dev/null
+++ b/gcc/config/arm/ieee754-df.S
@@ -0,0 +1,1214 @@
+/* ieee754-df.S double-precision floating point support for ARM
+
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Nicolas Pitre (nico@cam.org)
+
+ This file is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ In addition to the permissions in the GNU General Public License, the
+ Free Software Foundation gives you unlimited permission to link the
+ compiled version of this file into combinations with other programs,
+ and to distribute those combinations without any restriction coming
+ from the use of this file. (The General Public License restrictions
+ do apply in other respects; for example, they cover modification of
+ the file, and distribution when not linked into a combine
+ executable.)
+
+ This file is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/*
+ * Notes:
+ *
+ * The goal of this code is to be as fast as possible. This is
+ * not meant to be easy to understand for the casual reader.
+ * For slightly simpler code please see the single precision version
+ * of this file.
+ *
+ * Only the default rounding mode is intended for best performances.
+ * Exceptions aren't supported yet, but that can be added quite easily
+ * if necessary without impacting performances.
+ */
+
+
+@ For FPA, float words are always big-endian.
+@ For VFP, floats words follow the memory system mode.
+#if defined(__VFP_FP__) && !defined(__ARMEB__)
+#define xl r0
+#define xh r1
+#define yl r2
+#define yh r3
+#else
+#define xh r0
+#define xl r1
+#define yh r2
+#define yl r3
+#endif
+
+
+#ifdef L_negdf2
+
+ARM_FUNC_START negdf2
+ @ flip sign bit
+ eor xh, xh, #0x80000000
+ RET
+
+ FUNC_END negdf2
+
+#endif
+
+#ifdef L_addsubdf3
+
+ARM_FUNC_START subdf3
+ @ flip sign bit of second arg
+ eor yh, yh, #0x80000000
+#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
+ b 1f @ Skip Thumb-code prologue
+#endif
+
+ARM_FUNC_START adddf3
+
+1: @ Compare both args, return zero if equal but the sign.
+ teq xl, yl
+ eoreq ip, xh, yh
+ teqeq ip, #0x80000000
+ beq LSYM(Lad_z)
+
+ @ If first arg is 0 or -0, return second arg.
+ @ If second arg is 0 or -0, return first arg.
+ orrs ip, xl, xh, lsl #1
+ moveq xl, yl
+ moveq xh, yh
+ orrnes ip, yl, yh, lsl #1
+ RETc(eq)
+
+ stmfd sp!, {r4, r5, lr}
+
+ @ Mask out exponents.
+ mov ip, #0x7f000000
+ orr ip, ip, #0x00f00000
+ and r4, xh, ip
+ and r5, yh, ip
+
+ @ If either of them is 0x7ff, result will be INF or NAN
+ teq r4, ip
+ teqne r5, ip
+ beq LSYM(Lad_i)
+
+ @ Compute exponent difference. Make largest exponent in r4,
+ @ corresponding arg in xh-xl, and positive exponent difference in r5.
+ subs r5, r5, r4
+ rsblt r5, r5, #0
+ ble 1f
+ add r4, r4, r5
+ eor yl, xl, yl
+ eor yh, xh, yh
+ eor xl, yl, xl
+ eor xh, yh, xh
+ eor yl, xl, yl
+ eor yh, xh, yh
+1:
+
+ @ If exponent difference is too large, return largest argument
+ @ already in xh-xl. We need up to 54 bit to handle proper rounding
+ @ of 0x1p54 - 1.1.
+ cmp r5, #(54 << 20)
+ RETLDM "r4, r5" hi
+
+ @ Convert mantissa to signed integer.
+ tst xh, #0x80000000
+ bic xh, xh, ip, lsl #1
+ orr xh, xh, #0x00100000
+ beq 1f
+ rsbs xl, xl, #0
+ rsc xh, xh, #0
+1:
+ tst yh, #0x80000000
+ bic yh, yh, ip, lsl #1
+ orr yh, yh, #0x00100000
+ beq 1f
+ rsbs yl, yl, #0
+ rsc yh, yh, #0
+1:
+ @ If exponent == difference, one or both args were denormalized.
+ @ Since this is not common case, rescale them off line.
+ teq r4, r5
+ beq LSYM(Lad_d)
+LSYM(Lad_x):
+ @ Scale down second arg with exponent difference.
+ @ Apply shift one bit left to first arg and the rest to second arg
+ @ to simplify things later, but only if exponent does not become 0.
+ mov ip, #0
+ movs r5, r5, lsr #20
+ beq 3f
+ teq r4, #(1 << 20)
+ beq 1f
+ movs xl, xl, lsl #1
+ adc xh, ip, xh, lsl #1
+ sub r4, r4, #(1 << 20)
+ subs r5, r5, #1
+ beq 3f
+
+ @ Shift yh-yl right per r5, keep leftover bits into ip.
+1: rsbs lr, r5, #32
+ blt 2f
+ mov ip, yl, lsl lr
+ mov yl, yl, lsr r5
+ orr yl, yl, yh, lsl lr
+ mov yh, yh, asr r5
+ b 3f
+2: sub r5, r5, #32
+ add lr, lr, #32
+ cmp yl, #1
+ adc ip, ip, yh, lsl lr
+ mov yl, yh, asr r5
+ mov yh, yh, asr #32
+3:
+ @ the actual addition
+ adds xl, xl, yl
+ adc xh, xh, yh
+
+ @ We now have a result in xh-xl-ip.
+ @ Keep absolute value in xh-xl-ip, sign in r5.
+ ands r5, xh, #0x80000000
+ bpl LSYM(Lad_p)
+ rsbs ip, ip, #0
+ rscs xl, xl, #0
+ rsc xh, xh, #0
+
+ @ Determine how to normalize the result.
+LSYM(Lad_p):
+ cmp xh, #0x00100000
+ bcc LSYM(Lad_l)
+ cmp xh, #0x00200000
+ bcc LSYM(Lad_r0)
+ cmp xh, #0x00400000
+ bcc LSYM(Lad_r1)
+
+ @ Result needs to be shifted right.
+ movs xh, xh, lsr #1
+ movs xl, xl, rrx
+ movs ip, ip, rrx
+ orrcs ip, ip, #1
+ add r4, r4, #(1 << 20)
+LSYM(Lad_r1):
+ movs xh, xh, lsr #1
+ movs xl, xl, rrx
+ movs ip, ip, rrx
+ orrcs ip, ip, #1
+ add r4, r4, #(1 << 20)
+
+ @ Our result is now properly aligned into xh-xl, remaining bits in ip.
+ @ Round with MSB of ip. If halfway between two numbers, round towards
+ @ LSB of xl = 0.
+LSYM(Lad_r0):
+ adds xl, xl, ip, lsr #31
+ adc xh, xh, #0
+ teq ip, #0x80000000
+ biceq xl, xl, #1
+
+ @ One extreme rounding case may add a new MSB. Adjust exponent.
+ @ That MSB will be cleared when exponent is merged below.
+ tst xh, #0x00200000
+ addne r4, r4, #(1 << 20)
+
+ @ Make sure we did not bust our exponent.
+ adds ip, r4, #(1 << 20)
+ bmi LSYM(Lad_o)
+
+ @ Pack final result together.
+LSYM(Lad_e):
+ bic xh, xh, #0x00300000
+ orr xh, xh, r4
+ orr xh, xh, r5
+ RETLDM "r4, r5"
+
+LSYM(Lad_l):
+ @ Result must be shifted left and exponent adjusted.
+ @ No rounding necessary since ip will always be 0.
+#if __ARM_ARCH__ < 5
+
+ teq xh, #0
+ movne r3, #-11
+ moveq r3, #21
+ moveq xh, xl
+ moveq xl, #0
+ mov r2, xh
+ movs ip, xh, lsr #16
+ moveq r2, r2, lsl #16
+ addeq r3, r3, #16
+ tst r2, #0xff000000
+ moveq r2, r2, lsl #8
+ addeq r3, r3, #8
+ tst r2, #0xf0000000
+ moveq r2, r2, lsl #4
+ addeq r3, r3, #4
+ tst r2, #0xc0000000
+ moveq r2, r2, lsl #2
+ addeq r3, r3, #2
+ tst r2, #0x80000000
+ addeq r3, r3, #1
+
+#else
+
+ teq xh, #0
+ moveq xh, xl
+ moveq xl, #0
+ clz r3, xh
+ addeq r3, r3, #32
+ sub r3, r3, #11
+
+#endif
+
+ @ determine how to shift the value.
+ subs r2, r3, #32
+ bge 2f
+ adds r2, r2, #12
+ ble 1f
+
+ @ shift value left 21 to 31 bits, or actually right 11 to 1 bits
+ @ since a register switch happened above.
+ add ip, r2, #20
+ rsb r2, r2, #12
+ mov xl, xh, lsl ip
+ mov xh, xh, lsr r2
+ b 3f
+
+ @ actually shift value left 1 to 20 bits, which might also represent
+ @ 32 to 52 bits if counting the register switch that happened earlier.
+1: add r2, r2, #20
+2: rsble ip, r2, #32
+ mov xh, xh, lsl r2
+ orrle xh, xh, xl, lsr ip
+ movle xl, xl, lsl r2
+
+ @ adjust exponent accordingly.
+3: subs r4, r4, r3, lsl #20
+ bgt LSYM(Lad_e)
+
+ @ Exponent too small, denormalize result.
+ @ Find out proper shift value.
+ mvn r4, r4, asr #20
+ subs r4, r4, #30
+ bge 2f
+ adds r4, r4, #12
+ bgt 1f
+
+ @ shift result right of 1 to 20 bits, sign is in r5.
+ add r4, r4, #20
+ rsb r2, r4, #32
+ mov xl, xl, lsr r4
+ orr xl, xl, xh, lsl r2
+ orr xh, r5, xh, lsr r4
+ RETLDM "r4, r5"
+
+ @ shift result right of 21 to 31 bits, or left 11 to 1 bits after
+ @ a register switch from xh to xl.
+1: rsb r4, r4, #12
+ rsb r2, r4, #32
+ mov xl, xl, lsr r2
+ orr xl, xl, xh, lsl r4
+ mov xh, r5
+ RETLDM "r4, r5"
+
+ @ Shift value right of 32 to 64 bits, or 0 to 32 bits after a switch
+ @ from xh to xl.
+2: mov xl, xh, lsr r4
+ mov xh, r5
+ RETLDM "r4, r5"
+
+ @ Adjust exponents for denormalized arguments.
+LSYM(Lad_d):
+ teq r4, #0
+ eoreq xh, xh, #0x00100000
+ addeq r4, r4, #(1 << 20)
+ eor yh, yh, #0x00100000
+ subne r5, r5, #(1 << 20)
+ b LSYM(Lad_x)
+
+ @ Result is x - x = 0, unless x = INF or NAN.
+LSYM(Lad_z):
+ sub ip, ip, #0x00100000 @ ip becomes 0x7ff00000
+ and r2, xh, ip
+ teq r2, ip
+ orreq xh, ip, #0x00080000
+ movne xh, #0
+ mov xl, #0
+ RET
+
+ @ Overflow: return INF.
+LSYM(Lad_o):
+ orr xh, r5, #0x7f000000
+ orr xh, xh, #0x00f00000
+ mov xl, #0
+ RETLDM "r4, r5"
+
+ @ At least one of x or y is INF/NAN.
+ @ if xh-xl != INF/NAN: return yh-yl (which is INF/NAN)
+ @ if yh-yl != INF/NAN: return xh-xl (which is INF/NAN)
+ @ if either is NAN: return NAN
+ @ if opposite sign: return NAN
+ @ return xh-xl (which is INF or -INF)
+LSYM(Lad_i):
+ teq r4, ip
+ movne xh, yh
+ movne xl, yl
+ teqeq r5, ip
+ RETLDM "r4, r5" ne
+
+ orrs r4, xl, xh, lsl #12
+ orreqs r4, yl, yh, lsl #12
+ teqeq xh, yh
+ orrne xh, r5, #0x00080000
+ movne xl, #0
+ RETLDM "r4, r5"
+
+ FUNC_END subdf3
+ FUNC_END adddf3
+
+ARM_FUNC_START floatunsidf
+ teq r0, #0
+ moveq r1, #0
+ RETc(eq)
+ stmfd sp!, {r4, r5, lr}
+ mov r4, #(0x400 << 20) @ initial exponent
+ add r4, r4, #((52-1) << 20)
+ mov r5, #0 @ sign bit is 0
+ mov xl, r0
+ mov xh, #0
+ b LSYM(Lad_l)
+
+ FUNC_END floatunsidf
+
+ARM_FUNC_START floatsidf
+ teq r0, #0
+ moveq r1, #0
+ RETc(eq)
+ stmfd sp!, {r4, r5, lr}
+ mov r4, #(0x400 << 20) @ initial exponent
+ add r4, r4, #((52-1) << 20)
+ ands r5, r0, #0x80000000 @ sign bit in r5
+ rsbmi r0, r0, #0 @ absolute value
+ mov xl, r0
+ mov xh, #0
+ b LSYM(Lad_l)
+
+ FUNC_END floatsidf
+
+ARM_FUNC_START extendsfdf2
+ movs r2, r0, lsl #1
+ beq 1f @ value is 0.0 or -0.0
+ mov xh, r2, asr #3 @ stretch exponent
+ mov xh, xh, rrx @ retrieve sign bit
+ mov xl, r2, lsl #28 @ retrieve remaining bits
+ ands r2, r2, #0xff000000 @ isolate exponent
+ beq 2f @ exponent was 0 but not mantissa
+ teq r2, #0xff000000 @ check if INF or NAN
+ eorne xh, xh, #0x38000000 @ fixup exponent otherwise.
+ RET
+
+1: mov xh, r0
+ mov xl, #0
+ RET
+
+2: @ value was denormalized. We can normalize it now.
+ stmfd sp!, {r4, r5, lr}
+ mov r4, #(0x380 << 20) @ setup corresponding exponent
+ add r4, r4, #(1 << 20)
+ and r5, xh, #0x80000000 @ move sign bit in r5
+ bic xh, xh, #0x80000000
+ b LSYM(Lad_l)
+
+ FUNC_END extendsfdf2
+
+#endif /* L_addsubdf3 */
+
+#ifdef L_muldivdf3
+
+ARM_FUNC_START muldf3
+
+ stmfd sp!, {r4, r5, r6, lr}
+
+ @ Mask out exponents.
+ mov ip, #0x7f000000
+ orr ip, ip, #0x00f00000
+ and r4, xh, ip
+ and r5, yh, ip
+
+ @ Trap any INF/NAN.
+ teq r4, ip
+ teqne r5, ip
+ beq LSYM(Lml_s)
+
+ @ Trap any multiplication by 0.
+ orrs r6, xl, xh, lsl #1
+ orrnes r6, yl, yh, lsl #1
+ beq LSYM(Lml_z)
+
+ @ Shift exponents right one bit to make room for overflow bit.
+ @ If either of them is 0, scale denormalized arguments off line.
+ @ Then add both exponents together.
+ movs r4, r4, lsr #1
+ teqne r5, #0
+ beq LSYM(Lml_d)
+LSYM(Lml_x):
+ add r4, r4, r5, asr #1
+
+ @ Preserve final sign in r4 along with exponent for now.
+ teq xh, yh
+ orrmi r4, r4, #0x8000
+
+ @ Convert mantissa to unsigned integer.
+ bic xh, xh, ip, lsl #1
+ bic yh, yh, ip, lsl #1
+ orr xh, xh, #0x00100000
+ orr yh, yh, #0x00100000
+
+#if __ARM_ARCH__ < 4
+
+ @ Well, no way to make it shorter without the umull instruction.
+ @ We must perform that 53 x 53 bit multiplication by hand.
+ stmfd sp!, {r7, r8, r9, sl, fp}
+ mov r7, xl, lsr #16
+ mov r8, yl, lsr #16
+ mov r9, xh, lsr #16
+ mov sl, yh, lsr #16
+ bic xl, xl, r7, lsl #16
+ bic yl, yl, r8, lsl #16
+ bic xh, xh, r9, lsl #16
+ bic yh, yh, sl, lsl #16
+ mul ip, xl, yl
+ mul fp, xl, r8
+ mov lr, #0
+ adds ip, ip, fp, lsl #16
+ adc lr, lr, fp, lsr #16
+ mul fp, r7, yl
+ adds ip, ip, fp, lsl #16
+ adc lr, lr, fp, lsr #16
+ mul fp, xl, sl
+ mov r5, #0
+ adds lr, lr, fp, lsl #16
+ adc r5, r5, fp, lsr #16
+ mul fp, r7, yh
+ adds lr, lr, fp, lsl #16
+ adc r5, r5, fp, lsr #16
+ mul fp, xh, r8
+ adds lr, lr, fp, lsl #16
+ adc r5, r5, fp, lsr #16
+ mul fp, r9, yl
+ adds lr, lr, fp, lsl #16
+ adc r5, r5, fp, lsr #16
+ mul fp, xh, sl
+ mul r6, r9, sl
+ adds r5, r5, fp, lsl #16
+ adc r6, r6, fp, lsr #16
+ mul fp, r9, yh
+ adds r5, r5, fp, lsl #16
+ adc r6, r6, fp, lsr #16
+ mul fp, xl, yh
+ adds lr, lr, fp
+ mul fp, r7, sl
+ adcs r5, r5, fp
+ mul fp, xh, yl
+ adc r6, r6, #0
+ adds lr, lr, fp
+ mul fp, r9, r8
+ adcs r5, r5, fp
+ mul fp, r7, r8
+ adc r6, r6, #0
+ adds lr, lr, fp
+ mul fp, xh, yh
+ adcs r5, r5, fp
+ adc r6, r6, #0
+ ldmfd sp!, {r7, r8, r9, sl, fp}
+
+#else
+
+ @ Here is the actual multiplication: 53 bits * 53 bits -> 106 bits.
+ umull ip, lr, xl, yl
+ mov r5, #0
+ umlal lr, r5, xl, yh
+ umlal lr, r5, xh, yl
+ mov r6, #0
+ umlal r5, r6, xh, yh
+
+#endif
+
+ @ The LSBs in ip are only significant for the final rounding.
+ @ Fold them into one bit of lr.
+ teq ip, #0
+ orrne lr, lr, #1
+
+ @ Put final sign in xh.
+ mov xh, r4, lsl #16
+ bic r4, r4, #0x8000
+
+ @ Adjust result if one extra MSB appeared (one of four times).
+ tst r6, #(1 << 9)
+ beq 1f
+ add r4, r4, #(1 << 19)
+ movs r6, r6, lsr #1
+ movs r5, r5, rrx
+ movs lr, lr, rrx
+ orrcs lr, lr, #1
+1:
+ @ Scale back to 53 bits.
+ @ xh contains sign bit already.
+ orr xh, xh, r6, lsl #12
+ orr xh, xh, r5, lsr #20
+ mov xl, r5, lsl #12
+ orr xl, xl, lr, lsr #20
+
+ @ Apply exponent bias, check range for underflow.
+ sub r4, r4, #0x00f80000
+ subs r4, r4, #0x1f000000
+ ble LSYM(Lml_u)
+
+ @ Round the result.
+ movs lr, lr, lsl #12
+ bpl 1f
+ adds xl, xl, #1
+ adc xh, xh, #0
+ teq lr, #0x80000000
+ biceq xl, xl, #1
+
+ @ Rounding may have produced an extra MSB here.
+ @ The extra bit is cleared before merging the exponent below.
+ tst xh, #0x00200000
+ addne r4, r4, #(1 << 19)
+1:
+ @ Check exponent for overflow.
+ adds ip, r4, #(1 << 19)
+ tst ip, #(1 << 30)
+ bne LSYM(Lml_o)
+
+ @ Add final exponent.
+ bic xh, xh, #0x00300000
+ orr xh, xh, r4, lsl #1
+ RETLDM "r4, r5, r6"
+
+ @ Result is 0, but determine sign anyway.
+LSYM(Lml_z):
+ eor xh, xh, yh
+LSYM(Ldv_z):
+ bic xh, xh, #0x7fffffff
+ mov xl, #0
+ RETLDM "r4, r5, r6"
+
+ @ Check if denormalized result is possible, otherwise return signed 0.
+LSYM(Lml_u):
+ cmn r4, #(53 << 19)
+ movle xl, #0
+ bicle xh, xh, #0x7fffffff
+ RETLDM "r4, r5, r6" le
+
+ @ Find out proper shift value.
+LSYM(Lml_r):
+ mvn r4, r4, asr #19
+ subs r4, r4, #30
+ bge 2f
+ adds r4, r4, #12
+ bgt 1f
+
+ @ shift result right of 1 to 20 bits, preserve sign bit, round, etc.
+ add r4, r4, #20
+ rsb r5, r4, #32
+ mov r3, xl, lsl r5
+ mov xl, xl, lsr r4
+ orr xl, xl, xh, lsl r5
+ movs xh, xh, lsl #1
+ mov xh, xh, lsr r4
+ mov xh, xh, rrx
+ adds xl, xl, r3, lsr #31
+ adc xh, xh, #0
+ teq lr, #0
+ teqeq r3, #0x80000000
+ biceq xl, xl, #1
+ RETLDM "r4, r5, r6"
+
+ @ shift result right of 21 to 31 bits, or left 11 to 1 bits after
+ @ a register switch from xh to xl. Then round.
+1: rsb r4, r4, #12
+ rsb r5, r4, #32
+ mov r3, xl, lsl r4
+ mov xl, xl, lsr r5
+ orr xl, xl, xh, lsl r4
+ bic xh, xh, #0x7fffffff
+ adds xl, xl, r3, lsr #31
+ adc xh, xh, #0
+ teq lr, #0
+ teqeq r3, #0x80000000
+ biceq xl, xl, #1
+ RETLDM "r4, r5, r6"
+
+ @ Shift value right of 32 to 64 bits, or 0 to 32 bits after a switch
+ @ from xh to xl. Leftover bits are in r3-r6-lr for rounding.
+2: rsb r5, r4, #32
+ mov r6, xl, lsl r5
+ mov r3, xl, lsr r4
+ orr r3, r3, xh, lsl r5
+ mov xl, xh, lsr r4
+ bic xh, xh, #0x7fffffff
+ adds xl, xl, r3, lsr #31
+ adc xh, xh, #0
+ orrs r6, r6, lr
+ teqeq r3, #0x80000000
+ biceq xl, xl, #1
+ RETLDM "r4, r5, r6"
+
+ @ One or both arguments are denormalized.
+ @ Scale them leftwards and preserve sign bit.
+LSYM(Lml_d):
+ mov lr, #0
+ teq r4, #0
+ bne 2f
+ and r6, xh, #0x80000000
+1: movs xl, xl, lsl #1
+ adc xh, lr, xh, lsl #1
+ tst xh, #0x00100000
+ subeq r4, r4, #(1 << 19)
+ beq 1b
+ orr xh, xh, r6
+ teq r5, #0
+ bne LSYM(Lml_x)
+2: and r6, yh, #0x80000000
+3: movs yl, yl, lsl #1
+ adc yh, lr, yh, lsl #1
+ tst yh, #0x00100000
+ subeq r5, r5, #(1 << 20)
+ beq 3b
+ orr yh, yh, r6
+ b LSYM(Lml_x)
+
+ @ One or both args are INF or NAN.
+LSYM(Lml_s):
+ orrs r6, xl, xh, lsl #1
+ orrnes r6, yl, yh, lsl #1
+ beq LSYM(Lml_n) @ 0 * INF or INF * 0 -> NAN
+ teq r4, ip
+ bne 1f
+ orrs r6, xl, xh, lsl #12
+ bne LSYM(Lml_n) @ NAN * <anything> -> NAN
+1: teq r5, ip
+ bne LSYM(Lml_i)
+ orrs r6, yl, yh, lsl #12
+ bne LSYM(Lml_n) @ <anything> * NAN -> NAN
+
+ @ Result is INF, but we need to determine its sign.
+LSYM(Lml_i):
+ eor xh, xh, yh
+
+ @ Overflow: return INF (sign already in xh).
+LSYM(Lml_o):
+ and xh, xh, #0x80000000
+ orr xh, xh, #0x7f000000
+ orr xh, xh, #0x00f00000
+ mov xl, #0
+ RETLDM "r4, r5, r6"
+
+ @ Return NAN.
+LSYM(Lml_n):
+ mov xh, #0x7f000000
+ orr xh, xh, #0x00f80000
+ RETLDM "r4, r5, r6"
+
+ FUNC_END muldf3
+
+ARM_FUNC_START divdf3
+
+ stmfd sp!, {r4, r5, r6, lr}
+
+ @ Mask out exponents.
+ mov ip, #0x7f000000
+ orr ip, ip, #0x00f00000
+ and r4, xh, ip
+ and r5, yh, ip
+
+ @ Trap any INF/NAN or zeroes.
+ teq r4, ip
+ teqne r5, ip
+ orrnes r6, xl, xh, lsl #1
+ orrnes r6, yl, yh, lsl #1
+ beq LSYM(Ldv_s)
+
+ @ Shift exponents right one bit to make room for overflow bit.
+ @ If either of them is 0, scale denormalized arguments off line.
+ @ Then substract divisor exponent from dividend''s.
+ movs r4, r4, lsr #1
+ teqne r5, #0
+ beq LSYM(Ldv_d)
+LSYM(Ldv_x):
+ sub r4, r4, r5, asr #1
+
+ @ Preserve final sign into lr.
+ eor lr, xh, yh
+
+ @ Convert mantissa to unsigned integer.
+ @ Dividend -> r5-r6, divisor -> yh-yl.
+ mov r5, #0x10000000
+ mov yh, yh, lsl #12
+ orr yh, r5, yh, lsr #4
+ orr yh, yh, yl, lsr #24
+ movs yl, yl, lsl #8
+ mov xh, xh, lsl #12
+ teqeq yh, r5
+ beq LSYM(Ldv_1)
+ orr r5, r5, xh, lsr #4
+ orr r5, r5, xl, lsr #24
+ mov r6, xl, lsl #8
+
+ @ Initialize xh with final sign bit.
+ and xh, lr, #0x80000000
+
+ @ Ensure result will land to known bit position.
+ cmp r5, yh
+ cmpeq r6, yl
+ bcs 1f
+ sub r4, r4, #(1 << 19)
+ movs yh, yh, lsr #1
+ mov yl, yl, rrx
+1:
+ @ Apply exponent bias, check range for over/underflow.
+ add r4, r4, #0x1f000000
+ add r4, r4, #0x00f80000
+ cmn r4, #(53 << 19)
+ ble LSYM(Ldv_z)
+ cmp r4, ip, lsr #1
+ bge LSYM(Lml_o)
+
+ @ Perform first substraction to align result to a nibble.
+ subs r6, r6, yl
+ sbc r5, r5, yh
+ movs yh, yh, lsr #1
+ mov yl, yl, rrx
+ mov xl, #0x00100000
+ mov ip, #0x00080000
+
+ @ The actual division loop.
+1: subs lr, r6, yl
+ sbcs lr, r5, yh
+ subcs r6, r6, yl
+ movcs r5, lr
+ orrcs xl, xl, ip
+ movs yh, yh, lsr #1
+ mov yl, yl, rrx
+ subs lr, r6, yl
+ sbcs lr, r5, yh
+ subcs r6, r6, yl
+ movcs r5, lr
+ orrcs xl, xl, ip, lsr #1
+ movs yh, yh, lsr #1
+ mov yl, yl, rrx
+ subs lr, r6, yl
+ sbcs lr, r5, yh
+ subcs r6, r6, yl
+ movcs r5, lr
+ orrcs xl, xl, ip, lsr #2
+ movs yh, yh, lsr #1
+ mov yl, yl, rrx
+ subs lr, r6, yl
+ sbcs lr, r5, yh
+ subcs r6, r6, yl
+ movcs r5, lr
+ orrcs xl, xl, ip, lsr #3
+
+ orrs lr, r5, r6
+ beq 2f
+ mov r5, r5, lsl #4
+ orr r5, r5, r6, lsr #28
+ mov r6, r6, lsl #4
+ mov yh, yh, lsl #3
+ orr yh, yh, yl, lsr #29
+ mov yl, yl, lsl #3
+ movs ip, ip, lsr #4
+ bne 1b
+
+ @ We are done with a word of the result.
+ @ Loop again for the low word if this pass was for the high word.
+ tst xh, #0x00100000
+ bne 3f
+ orr xh, xh, xl
+ mov xl, #0
+ mov ip, #0x80000000
+ b 1b
+2:
+ @ Be sure result starts in the high word.
+ tst xh, #0x00100000
+ orreq xh, xh, xl
+ moveq xl, #0
+3:
+ @ Check if denormalized result is needed.
+ cmp r4, #0
+ ble LSYM(Ldv_u)
+
+ @ Apply proper rounding.
+ subs ip, r5, yh
+ subeqs ip, r6, yl
+ adcs xl, xl, #0
+ adc xh, xh, #0
+ teq ip, #0
+ biceq xl, xl, #1
+
+ @ Add exponent to result.
+ bic xh, xh, #0x00100000
+ orr xh, xh, r4, lsl #1
+ RETLDM "r4, r5, r6"
+
+ @ Division by 0x1p*: shortcut a lot of code.
+LSYM(Ldv_1):
+ and lr, lr, #0x80000000
+ orr xh, lr, xh, lsr #12
+ add r4, r4, #0x1f000000
+ add r4, r4, #0x00f80000
+ cmp r4, ip, lsr #1
+ bge LSYM(Lml_o)
+ cmp r4, #0
+ orrgt xh, xh, r4, lsl #1
+ RETLDM "r4, r5, r6" gt
+
+ cmn r4, #(53 << 19)
+ ble LSYM(Ldv_z)
+ orr xh, xh, #0x00100000
+ mov lr, #0
+ b LSYM(Lml_r)
+
+ @ Result must be denormalized: put remainder in lr for
+ @ rounding considerations.
+LSYM(Ldv_u):
+ orr lr, r5, r6
+ b LSYM(Lml_r)
+
+ @ One or both arguments are denormalized.
+ @ Scale them leftwards and preserve sign bit.
+LSYM(Ldv_d):
+ mov lr, #0
+ teq r4, #0
+ bne 2f
+ and r6, xh, #0x80000000
+1: movs xl, xl, lsl #1
+ adc xh, lr, xh, lsl #1
+ tst xh, #0x00100000
+ subeq r4, r4, #(1 << 19)
+ beq 1b
+ orr xh, xh, r6
+ teq r5, #0
+ bne LSYM(Ldv_x)
+2: and r6, yh, #0x80000000
+3: movs yl, yl, lsl #1
+ adc yh, lr, yh, lsl #1
+ tst yh, #0x00100000
+ subeq r5, r5, #(1 << 20)
+ beq 3b
+ orr yh, yh, r6
+ b LSYM(Ldv_x)
+
+ @ One or both arguments is either INF, NAN or zero.
+LSYM(Ldv_s):
+ teq r4, ip
+ teqeq r5, ip
+ beq LSYM(Lml_n) @ INF/NAN / INF/NAN -> NAN
+ teq r4, ip
+ bne 1f
+ orrs r4, xl, xh, lsl #12
+ bne LSYM(Lml_n) @ NAN / <anything> -> NAN
+ b LSYM(Lml_i) @ INF / <anything> -> INF
+1: teq r5, ip
+ bne 2f
+ orrs r5, yl, yh, lsl #12
+ bne LSYM(Lml_n) @ <anything> / NAN -> NAN
+ b LSYM(Lml_z) @ <anything> / INF -> 0
+2: @ One or both arguments are 0.
+ orrs r4, xl, xh, lsl #1
+ bne LSYM(Lml_i) @ <non_zero> / 0 -> INF
+ orrs r5, yl, yh, lsl #1
+ bne LSYM(Lml_z) @ 0 / <non_zero> -> 0
+ b LSYM(Lml_n) @ 0 / 0 -> NAN
+
+ FUNC_END divdf3
+
+#endif /* L_muldivdf3 */
+
+#ifdef L_cmpdf2
+
+FUNC_START gedf2
+ARM_FUNC_START gtdf2
+ mov ip, #-1
+ b 1f
+
+FUNC_START ledf2
+ARM_FUNC_START ltdf2
+ mov ip, #1
+ b 1f
+
+FUNC_START nedf2
+FUNC_START eqdf2
+ARM_FUNC_START cmpdf2
+ mov ip, #1 @ how should we specify unordered here?
+
+1: stmfd sp!, {r4, r5, lr}
+
+ @ Trap any INF/NAN first.
+ mov lr, #0x7f000000
+ orr lr, lr, #0x00f00000
+ and r4, xh, lr
+ and r5, yh, lr
+ teq r4, lr
+ teqne r5, lr
+ beq 3f
+
+ @ Test for equality.
+ @ Note that 0.0 is equal to -0.0.
+2: orrs ip, xl, xh, lsl #1 @ if x == 0.0 or -0.0
+ orreqs ip, yl, yh, lsl #1 @ and y == 0.0 or -0.0
+ teqne xh, yh @ or xh == yh
+ teqeq xl, yl @ and xl == yl
+ moveq r0, #0 @ then equal.
+ RETLDM "r4, r5" eq
+
+ @ Check for sign difference.
+ teq xh, yh
+ movmi r0, xh, asr #31
+ orrmi r0, r0, #1
+ RETLDM "r4, r5" mi
+
+ @ Compare exponents.
+ cmp r4, r5
+
+ @ Compare mantissa if exponents are equal.
+ moveq xh, xh, lsl #12
+ cmpeq xh, yh, lsl #12
+ cmpeq xl, yl
+ movcs r0, yh, asr #31
+ mvncc r0, yh, asr #31
+ orr r0, r0, #1
+ RETLDM "r4, r5"
+
+ @ Look for a NAN.
+3: teq r4, lr
+ bne 4f
+ orrs xl, xl, xh, lsl #12
+ bne 5f @ x is NAN
+4: teq r5, lr
+ bne 2b
+ orrs yl, yl, yh, lsl #12
+ beq 2b @ y is not NAN
+5: mov r0, ip @ return unordered code from ip
+ RETLDM "r4, r5"
+
+ FUNC_END gedf2
+ FUNC_END gtdf2
+ FUNC_END ledf2
+ FUNC_END ltdf2
+ FUNC_END nedf2
+ FUNC_END eqdf2
+ FUNC_END cmpdf2
+
+#endif /* L_cmpdf2 */
+
+#ifdef L_unorddf2
+
+ARM_FUNC_START unorddf2
+ str lr, [sp, #-4]!
+ mov ip, #0x7f000000
+ orr ip, ip, #0x00f00000
+ and lr, xh, ip
+ teq lr, ip
+ bne 1f
+ orrs xl, xl, xh, lsl #12
+ bne 3f @ x is NAN
+1: and lr, yh, ip
+ teq lr, ip
+ bne 2f
+ orrs yl, yl, yh, lsl #12
+ bne 3f @ y is NAN
+2: mov r0, #0 @ arguments are ordered.
+ RETLDM
+
+3: mov r0, #1 @ arguments are unordered.
+ RETLDM
+
+ FUNC_END unorddf2
+
+#endif /* L_unorddf2 */
+
+#ifdef L_fixdfsi
+
+ARM_FUNC_START fixdfsi
+ orrs ip, xl, xh, lsl #1
+ beq 1f @ value is 0.
+
+ mov r3, r3, rrx @ preserve C flag (the actual sign)
+
+ @ check exponent range.
+ mov ip, #0x7f000000
+ orr ip, ip, #0x00f00000
+ and r2, xh, ip
+ teq r2, ip
+ beq 2f @ value is INF or NAN
+ bic ip, ip, #0x40000000
+ cmp r2, ip
+ bcc 1f @ value is too small
+ add ip, ip, #(31 << 20)
+ cmp r2, ip
+ bcs 3f @ value is too large
+
+ rsb r2, r2, ip
+ mov ip, xh, lsl #11
+ orr ip, ip, #0x80000000
+ orr ip, ip, xl, lsr #21
+ mov r2, r2, lsr #20
+ tst r3, #0x80000000 @ the sign bit
+ mov r0, ip, lsr r2
+ rsbne r0, r0, #0
+ RET
+
+1: mov r0, #0
+ RET
+
+2: orrs xl, xl, xh, lsl #12
+ bne 4f @ r0 is NAN.
+3: ands r0, r3, #0x80000000 @ the sign bit
+ moveq r0, #0x7fffffff @ maximum signed positive si
+ RET
+
+4: mov r0, #0 @ How should we convert NAN?
+ RET
+
+ FUNC_END fixdfsi
+
+ARM_FUNC_START fixunsdfsi
+ orrs ip, xl, xh, lsl #1
+ movcss r0, #0 @ value is negative
+ RETc(eq) @ or 0 (xl, xh overlap r0)
+
+ @ check exponent range.
+ mov ip, #0x7f000000
+ orr ip, ip, #0x00f00000
+ and r2, xh, ip
+ teq r2, ip
+ beq 1f @ value is INF or NAN
+ bic ip, ip, #0x40000000
+ cmp r2, ip
+ bcc 1b @ value is too small
+ add ip, ip, #(31 << 20)
+ cmp r2, ip
+ bhi 2f @ value is too large
+
+ rsb r2, r2, ip
+ mov ip, xh, lsl #11
+ orr ip, ip, #0x80000000
+ orr ip, ip, xl, lsr #21
+ mov r2, r2, lsr #20
+ mov r0, ip, lsr r2
+ RET
+
+1: orrs xl, xl, xh, lsl #12
+ bne 4b @ value is NAN.
+2: mov r0, #0xffffffff @ maximum unsigned si
+ RET
+
+ FUNC_END fixunsdfsi
+
+#endif /* L_fixunsdfdi */
+
+#ifdef L_truncdfsf2
+
+ARM_FUNC_START truncdfsf2
+ orrs r2, xl, xh, lsl #1
+ moveq r0, r2, rrx
+ RETc(eq) @ value is 0.0 or -0.0
+
+ @ check exponent range.
+ mov ip, #0x7f000000
+ orr ip, ip, #0x00f00000
+ and r2, ip, xh
+ teq r2, ip
+ beq 2f @ value is INF or NAN
+ bic xh, xh, ip
+ cmp r2, #(0x380 << 20)
+ bls 4f @ value is too small
+
+ @ shift and round mantissa
+1: movs r3, xl, lsr #29
+ adc r3, r3, xh, lsl #3
+
+ @ if halfway between two numbers, round towards LSB = 0.
+ mov xl, xl, lsl #3
+ teq xl, #0x80000000
+ biceq r3, r3, #1
+
+ @ rounding might have created an extra MSB. If so adjust exponent.
+ tst r3, #0x00800000
+ addne r2, r2, #(1 << 20)
+ bicne r3, r3, #0x00800000
+
+ @ check exponent for overflow
+ mov ip, #(0x400 << 20)
+ orr ip, ip, #(0x07f << 20)
+ cmp r2, ip
+ bcs 3f @ overflow
+
+ @ adjust exponent, merge with sign bit and mantissa.
+ movs xh, xh, lsl #1
+ mov r2, r2, lsl #4
+ orr r0, r3, r2, rrx
+ eor r0, r0, #0x40000000
+ RET
+
+2: @ chech for NAN
+ orrs xl, xl, xh, lsl #12
+ movne r0, #0x7f000000
+ orrne r0, r0, #0x00c00000
+ RETc(ne) @ return NAN
+
+3: @ return INF with sign
+ and r0, xh, #0x80000000
+ orr r0, r0, #0x7f000000
+ orr r0, r0, #0x00800000
+ RET
+
+4: @ check if denormalized value is possible
+ subs r2, r2, #((0x380 - 24) << 20)
+ andle r0, xh, #0x80000000 @ too small, return signed 0.
+ RETc(le)
+
+ @ denormalize value so we can resume with the code above afterwards.
+ orr xh, xh, #0x00100000
+ mov r2, r2, lsr #20
+ rsb r2, r2, #25
+ cmp r2, #20
+ bgt 6f
+
+ rsb ip, r2, #32
+ mov r3, xl, lsl ip
+ mov xl, xl, lsr r2
+ orr xl, xl, xh, lsl ip
+ movs xh, xh, lsl #1
+ mov xh, xh, lsr r2
+ mov xh, xh, rrx
+5: teq r3, #0 @ fold r3 bits into the LSB
+ orrne xl, xl, #1 @ for rounding considerations.
+ mov r2, #(0x380 << 20) @ equivalent to the 0 float exponent
+ b 1b
+
+6: rsb r2, r2, #(12 + 20)
+ rsb ip, r2, #32
+ mov r3, xl, lsl r2
+ mov xl, xl, lsr ip
+ orr xl, xl, xh, lsl r2
+ and xh, xh, #0x80000000
+ b 5b
+
+ FUNC_END truncdfsf2
+
+#endif /* L_truncdfsf2 */
diff --git a/gcc/config/arm/ieee754-sf.S b/gcc/config/arm/ieee754-sf.S
new file mode 100644
index 00000000000..904b536f2ff
--- /dev/null
+++ b/gcc/config/arm/ieee754-sf.S
@@ -0,0 +1,815 @@
+/* ieee754-sf.S single-precision floating point support for ARM
+
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Nicolas Pitre (nico@cam.org)
+
+ This file is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ In addition to the permissions in the GNU General Public License, the
+ Free Software Foundation gives you unlimited permission to link the
+ compiled version of this file into combinations with other programs,
+ and to distribute those combinations without any restriction coming
+ from the use of this file. (The General Public License restrictions
+ do apply in other respects; for example, they cover modification of
+ the file, and distribution when not linked into a combine
+ executable.)
+
+ This file is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/*
+ * Notes:
+ *
+ * The goal of this code is to be as fast as possible. This is
+ * not meant to be easy to understand for the casual reader.
+ *
+ * Only the default rounding mode is intended for best performances.
+ * Exceptions aren't supported yet, but that can be added quite easily
+ * if necessary without impacting performances.
+ */
+
+#ifdef L_negsf2
+
+ARM_FUNC_START negsf2
+ eor r0, r0, #0x80000000 @ flip sign bit
+ RET
+
+ FUNC_END negsf2
+
+#endif
+
+#ifdef L_addsubsf3
+
+ARM_FUNC_START subsf3
+ eor r1, r1, #0x80000000 @ flip sign bit of second arg
+#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
+ b 1f @ Skip Thumb-code prologue
+#endif
+
+ARM_FUNC_START addsf3
+
+1: @ Compare both args, return zero if equal but the sign.
+ eor r2, r0, r1
+ teq r2, #0x80000000
+ beq LSYM(Lad_z)
+
+ @ If first arg is 0 or -0, return second arg.
+ @ If second arg is 0 or -0, return first arg.
+ bics r2, r0, #0x80000000
+ moveq r0, r1
+ bicnes r2, r1, #0x80000000
+ RETc(eq)
+
+ @ Mask out exponents.
+ mov ip, #0xff000000
+ and r2, r0, ip, lsr #1
+ and r3, r1, ip, lsr #1
+
+ @ If either of them is 255, result will be INF or NAN
+ teq r2, ip, lsr #1
+ teqne r3, ip, lsr #1
+ beq LSYM(Lad_i)
+
+ @ Compute exponent difference. Make largest exponent in r2,
+ @ corresponding arg in r0, and positive exponent difference in r3.
+ subs r3, r3, r2
+ addgt r2, r2, r3
+ eorgt r1, r0, r1
+ eorgt r0, r1, r0
+ eorgt r1, r0, r1
+ rsblt r3, r3, #0
+
+ @ If exponent difference is too large, return largest argument
+ @ already in r0. We need up to 25 bit to handle proper rounding
+ @ of 0x1p25 - 1.1.
+ cmp r3, #(25 << 23)
+ RETc(hi)
+
+ @ Convert mantissa to signed integer.
+ tst r0, #0x80000000
+ orr r0, r0, #0x00800000
+ bic r0, r0, #0xff000000
+ rsbne r0, r0, #0
+ tst r1, #0x80000000
+ orr r1, r1, #0x00800000
+ bic r1, r1, #0xff000000
+ rsbne r1, r1, #0
+
+ @ If exponent == difference, one or both args were denormalized.
+ @ Since this is not common case, rescale them off line.
+ teq r2, r3
+ beq LSYM(Lad_d)
+LSYM(Lad_x):
+
+ @ Scale down second arg with exponent difference.
+ @ Apply shift one bit left to first arg and the rest to second arg
+ @ to simplify things later, but only if exponent does not become 0.
+ movs r3, r3, lsr #23
+ teqne r2, #(1 << 23)
+ movne r0, r0, lsl #1
+ subne r2, r2, #(1 << 23)
+ subne r3, r3, #1
+
+ @ Shift second arg into ip, keep leftover bits into r1.
+ mov ip, r1, asr r3
+ rsb r3, r3, #32
+ mov r1, r1, lsl r3
+
+ add r0, r0, ip @ the actual addition
+
+ @ We now have a 64 bit result in r0-r1.
+ @ Keep absolute value in r0-r1, sign in r3.
+ ands r3, r0, #0x80000000
+ bpl LSYM(Lad_p)
+ rsbs r1, r1, #0
+ rsc r0, r0, #0
+
+ @ Determine how to normalize the result.
+LSYM(Lad_p):
+ cmp r0, #0x00800000
+ bcc LSYM(Lad_l)
+ cmp r0, #0x01000000
+ bcc LSYM(Lad_r0)
+ cmp r0, #0x02000000
+ bcc LSYM(Lad_r1)
+
+ @ Result needs to be shifted right.
+ movs r0, r0, lsr #1
+ mov r1, r1, rrx
+ add r2, r2, #(1 << 23)
+LSYM(Lad_r1):
+ movs r0, r0, lsr #1
+ mov r1, r1, rrx
+ add r2, r2, #(1 << 23)
+
+ @ Our result is now properly aligned into r0, remaining bits in r1.
+ @ Round with MSB of r1. If halfway between two numbers, round towards
+ @ LSB of r0 = 0.
+LSYM(Lad_r0):
+ add r0, r0, r1, lsr #31
+ teq r1, #0x80000000
+ biceq r0, r0, #1
+
+ @ Rounding may have added a new MSB. Adjust exponent.
+ @ That MSB will be cleared when exponent is merged below.
+ tst r0, #0x01000000
+ addne r2, r2, #(1 << 23)
+
+ @ Make sure we did not bust our exponent.
+ cmp r2, #(254 << 23)
+ bhi LSYM(Lad_o)
+
+ @ Pack final result together.
+LSYM(Lad_e):
+ bic r0, r0, #0x01800000
+ orr r0, r0, r2
+ orr r0, r0, r3
+ RET
+
+ @ Result must be shifted left.
+ @ No rounding necessary since r1 will always be 0.
+LSYM(Lad_l):
+
+#if __ARM_ARCH__ < 5
+
+ movs ip, r0, lsr #12
+ moveq r0, r0, lsl #12
+ subeq r2, r2, #(12 << 23)
+ tst r0, #0x00ff0000
+ moveq r0, r0, lsl #8
+ subeq r2, r2, #(8 << 23)
+ tst r0, #0x00f00000
+ moveq r0, r0, lsl #4
+ subeq r2, r2, #(4 << 23)
+ tst r0, #0x00c00000
+ moveq r0, r0, lsl #2
+ subeq r2, r2, #(2 << 23)
+ tst r0, #0x00800000
+ moveq r0, r0, lsl #1
+ subeq r2, r2, #(1 << 23)
+ cmp r2, #0
+ bgt LSYM(Lad_e)
+
+#else
+
+ clz ip, r0
+ sub ip, ip, #8
+ mov r0, r0, lsl ip
+ subs r2, r2, ip, lsl #23
+ bgt LSYM(Lad_e)
+
+#endif
+
+ @ Exponent too small, denormalize result.
+ mvn r2, r2, asr #23
+ add r2, r2, #2
+ orr r0, r3, r0, lsr r2
+ RET
+
+ @ Fixup and adjust bit position for denormalized arguments.
+ @ Note that r2 must not remain equal to 0.
+LSYM(Lad_d):
+ teq r2, #0
+ eoreq r0, r0, #0x00800000
+ addeq r2, r2, #(1 << 23)
+ eor r1, r1, #0x00800000
+ subne r3, r3, #(1 << 23)
+ b LSYM(Lad_x)
+
+ @ Result is x - x = 0, unless x is INF or NAN.
+LSYM(Lad_z):
+ mov ip, #0xff000000
+ and r2, r0, ip, lsr #1
+ teq r2, ip, lsr #1
+ moveq r0, ip, asr #2
+ movne r0, #0
+ RET
+
+ @ Overflow: return INF.
+LSYM(Lad_o):
+ orr r0, r3, #0x7f000000
+ orr r0, r0, #0x00800000
+ RET
+
+ @ At least one of r0/r1 is INF/NAN.
+ @ if r0 != INF/NAN: return r1 (which is INF/NAN)
+ @ if r1 != INF/NAN: return r0 (which is INF/NAN)
+ @ if r0 or r1 is NAN: return NAN
+ @ if opposite sign: return NAN
+ @ return r0 (which is INF or -INF)
+LSYM(Lad_i):
+ teq r2, ip, lsr #1
+ movne r0, r1
+ teqeq r3, ip, lsr #1
+ RETc(ne)
+ movs r2, r0, lsl #9
+ moveqs r2, r1, lsl #9
+ teqeq r0, r1
+ orrne r0, r3, #0x00400000 @ NAN
+ RET
+
+ FUNC_END addsf3
+ FUNC_END subsf3
+
+ARM_FUNC_START floatunsisf
+ mov r3, #0
+ b 1f
+
+ARM_FUNC_START floatsisf
+ ands r3, r0, #0x80000000
+ rsbmi r0, r0, #0
+
+1: teq r0, #0
+ RETc(eq)
+
+ mov r1, #0
+ mov r2, #((127 + 23) << 23)
+ tst r0, #0xfc000000
+ beq LSYM(Lad_p)
+
+ @ We need to scale the value a little before branching to code above.
+ tst r0, #0xf0000000
+ movne r1, r0, lsl #28
+ movne r0, r0, lsr #4
+ addne r2, r2, #(4 << 23)
+ tst r0, #0x0c000000
+ beq LSYM(Lad_p)
+ mov r1, r1, lsr #2
+ orr r1, r1, r0, lsl #30
+ mov r0, r0, lsr #2
+ add r2, r2, #(2 << 23)
+ b LSYM(Lad_p)
+
+ FUNC_END floatsisf
+ FUNC_END floatunsisf
+
+#endif /* L_addsubsf3 */
+
+#ifdef L_muldivsf3
+
+ARM_FUNC_START mulsf3
+
+ @ Mask out exponents.
+ mov ip, #0xff000000
+ and r2, r0, ip, lsr #1
+ and r3, r1, ip, lsr #1
+
+ @ Trap any INF/NAN.
+ teq r2, ip, lsr #1
+ teqne r3, ip, lsr #1
+ beq LSYM(Lml_s)
+
+ @ Trap any multiplication by 0.
+ bics ip, r0, #0x80000000
+ bicnes ip, r1, #0x80000000
+ beq LSYM(Lml_z)
+
+ @ Shift exponents right one bit to make room for overflow bit.
+ @ If either of them is 0, scale denormalized arguments off line.
+ @ Then add both exponents together.
+ movs r2, r2, lsr #1
+ teqne r3, #0
+ beq LSYM(Lml_d)
+LSYM(Lml_x):
+ add r2, r2, r3, asr #1
+
+ @ Preserve final sign in r2 along with exponent for now.
+ teq r0, r1
+ orrmi r2, r2, #0x8000
+
+ @ Convert mantissa to unsigned integer.
+ bic r0, r0, #0xff000000
+ bic r1, r1, #0xff000000
+ orr r0, r0, #0x00800000
+ orr r1, r1, #0x00800000
+
+#if __ARM_ARCH__ < 4
+
+ @ Well, no way to make it shorter without the umull instruction.
+ @ We must perform that 24 x 24 -> 48 bit multiplication by hand.
+ stmfd sp!, {r4, r5}
+ mov r4, r0, lsr #16
+ mov r5, r1, lsr #16
+ bic r0, r0, #0x00ff0000
+ bic r1, r1, #0x00ff0000
+ mul ip, r4, r5
+ mul r3, r0, r1
+ mul r0, r5, r0
+ mla r0, r4, r1, r0
+ adds r3, r3, r0, lsl #16
+ adc ip, ip, r0, lsr #16
+ ldmfd sp!, {r4, r5}
+
+#else
+
+ umull r3, ip, r0, r1 @ The actual multiplication.
+
+#endif
+
+ @ Put final sign in r0.
+ mov r0, r2, lsl #16
+ bic r2, r2, #0x8000
+
+ @ Adjust result if one extra MSB appeared.
+ @ The LSB may be lost but this never changes the result in this case.
+ tst ip, #(1 << 15)
+ addne r2, r2, #(1 << 22)
+ movnes ip, ip, lsr #1
+ movne r3, r3, rrx
+
+ @ Apply exponent bias, check range for underflow.
+ subs r2, r2, #(127 << 22)
+ ble LSYM(Lml_u)
+
+ @ Scale back to 24 bits with rounding.
+ @ r0 contains sign bit already.
+ orrs r0, r0, r3, lsr #23
+ adc r0, r0, ip, lsl #9
+
+ @ If halfway between two numbers, rounding should be towards LSB = 0.
+ mov r3, r3, lsl #9
+ teq r3, #0x80000000
+ biceq r0, r0, #1
+
+ @ Note: rounding may have produced an extra MSB here.
+ @ The extra bit is cleared before merging the exponent below.
+ tst r0, #0x01000000
+ addne r2, r2, #(1 << 22)
+
+ @ Check for exponent overflow
+ cmp r2, #(255 << 22)
+ bge LSYM(Lml_o)
+
+ @ Add final exponent.
+ bic r0, r0, #0x01800000
+ orr r0, r0, r2, lsl #1
+ RET
+
+ @ Result is 0, but determine sign anyway.
+LSYM(Lml_z): eor r0, r0, r1
+ bic r0, r0, #0x7fffffff
+ RET
+
+ @ Check if denormalized result is possible, otherwise return signed 0.
+LSYM(Lml_u):
+ cmn r2, #(24 << 22)
+ RETc(le)
+
+ @ Find out proper shift value.
+ mvn r1, r2, asr #22
+ subs r1, r1, #7
+ bgt LSYM(Lml_ur)
+
+ @ Shift value left, round, etc.
+ add r1, r1, #32
+ orrs r0, r0, r3, lsr r1
+ rsb r1, r1, #32
+ adc r0, r0, ip, lsl r1
+ mov ip, r3, lsl r1
+ teq ip, #0x80000000
+ biceq r0, r0, #1
+ RET
+
+ @ Shift value right, round, etc.
+ @ Note: r1 must not be 0 otherwise carry does not get set.
+LSYM(Lml_ur):
+ orrs r0, r0, ip, lsr r1
+ adc r0, r0, #0
+ rsb r1, r1, #32
+ mov ip, ip, lsl r1
+ teq r3, #0
+ teqeq ip, #0x80000000
+ biceq r0, r0, #1
+ RET
+
+ @ One or both arguments are denormalized.
+ @ Scale them leftwards and preserve sign bit.
+LSYM(Lml_d):
+ teq r2, #0
+ and ip, r0, #0x80000000
+1: moveq r0, r0, lsl #1
+ tsteq r0, #0x00800000
+ subeq r2, r2, #(1 << 22)
+ beq 1b
+ orr r0, r0, ip
+ teq r3, #0
+ and ip, r1, #0x80000000
+2: moveq r1, r1, lsl #1
+ tsteq r1, #0x00800000
+ subeq r3, r3, #(1 << 23)
+ beq 2b
+ orr r1, r1, ip
+ b LSYM(Lml_x)
+
+ @ One or both args are INF or NAN.
+LSYM(Lml_s):
+ teq r0, #0x0
+ teqne r1, #0x0
+ teqne r0, #0x80000000
+ teqne r1, #0x80000000
+ beq LSYM(Lml_n) @ 0 * INF or INF * 0 -> NAN
+ teq r2, ip, lsr #1
+ bne 1f
+ movs r2, r0, lsl #9
+ bne LSYM(Lml_n) @ NAN * <anything> -> NAN
+1: teq r3, ip, lsr #1
+ bne LSYM(Lml_i)
+ movs r3, r1, lsl #9
+ bne LSYM(Lml_n) @ <anything> * NAN -> NAN
+
+ @ Result is INF, but we need to determine its sign.
+LSYM(Lml_i):
+ eor r0, r0, r1
+
+ @ Overflow: return INF (sign already in r0).
+LSYM(Lml_o):
+ and r0, r0, #0x80000000
+ orr r0, r0, #0x7f000000
+ orr r0, r0, #0x00800000
+ RET
+
+ @ Return NAN.
+LSYM(Lml_n):
+ mov r0, #0x7f000000
+ orr r0, r0, #0x00c00000
+ RET
+
+ FUNC_END mulsf3
+
+ARM_FUNC_START divsf3
+
+ @ Mask out exponents.
+ mov ip, #0xff000000
+ and r2, r0, ip, lsr #1
+ and r3, r1, ip, lsr #1
+
+ @ Trap any INF/NAN or zeroes.
+ teq r2, ip, lsr #1
+ teqne r3, ip, lsr #1
+ bicnes ip, r0, #0x80000000
+ bicnes ip, r1, #0x80000000
+ beq LSYM(Ldv_s)
+
+ @ Shift exponents right one bit to make room for overflow bit.
+ @ If either of them is 0, scale denormalized arguments off line.
+ @ Then substract divisor exponent from dividend''s.
+ movs r2, r2, lsr #1
+ teqne r3, #0
+ beq LSYM(Ldv_d)
+LSYM(Ldv_x):
+ sub r2, r2, r3, asr #1
+
+ @ Preserve final sign into ip.
+ eor ip, r0, r1
+
+ @ Convert mantissa to unsigned integer.
+ @ Dividend -> r3, divisor -> r1.
+ mov r3, #0x10000000
+ movs r1, r1, lsl #9
+ mov r0, r0, lsl #9
+ beq LSYM(Ldv_1)
+ orr r1, r3, r1, lsr #4
+ orr r3, r3, r0, lsr #4
+
+ @ Initialize r0 (result) with final sign bit.
+ and r0, ip, #0x80000000
+
+ @ Ensure result will land to known bit position.
+ cmp r3, r1
+ subcc r2, r2, #(1 << 22)
+ movcc r3, r3, lsl #1
+
+ @ Apply exponent bias, check range for over/underflow.
+ add r2, r2, #(127 << 22)
+ cmn r2, #(24 << 22)
+ RETc(le)
+ cmp r2, #(255 << 22)
+ bge LSYM(Lml_o)
+
+ @ The actual division loop.
+ mov ip, #0x00800000
+1: cmp r3, r1
+ subcs r3, r3, r1
+ orrcs r0, r0, ip
+ cmp r3, r1, lsr #1
+ subcs r3, r3, r1, lsr #1
+ orrcs r0, r0, ip, lsr #1
+ cmp r3, r1, lsr #2
+ subcs r3, r3, r1, lsr #2
+ orrcs r0, r0, ip, lsr #2
+ cmp r3, r1, lsr #3
+ subcs r3, r3, r1, lsr #3
+ orrcs r0, r0, ip, lsr #3
+ movs r3, r3, lsl #4
+ movnes ip, ip, lsr #4
+ bne 1b
+
+ @ Check if denormalized result is needed.
+ cmp r2, #0
+ ble LSYM(Ldv_u)
+
+ @ Apply proper rounding.
+ cmp r3, r1
+ addcs r0, r0, #1
+ biceq r0, r0, #1
+
+ @ Add exponent to result.
+ bic r0, r0, #0x00800000
+ orr r0, r0, r2, lsl #1
+ RET
+
+ @ Division by 0x1p*: let''s shortcut a lot of code.
+LSYM(Ldv_1):
+ and ip, ip, #0x80000000
+ orr r0, ip, r0, lsr #9
+ add r2, r2, #(127 << 22)
+ cmp r2, #(255 << 22)
+ bge LSYM(Lml_o)
+ cmp r2, #0
+ orrgt r0, r0, r2, lsl #1
+ RETc(gt)
+ cmn r2, #(24 << 22)
+ movle r0, ip
+ RETc(le)
+ orr r0, r0, #0x00800000
+ mov r3, #0
+
+ @ Result must be denormalized: prepare parameters to use code above.
+ @ r3 already contains remainder for rounding considerations.
+LSYM(Ldv_u):
+ bic ip, r0, #0x80000000
+ and r0, r0, #0x80000000
+ mvn r1, r2, asr #22
+ add r1, r1, #2
+ b LSYM(Lml_ur)
+
+ @ One or both arguments are denormalized.
+ @ Scale them leftwards and preserve sign bit.
+LSYM(Ldv_d):
+ teq r2, #0
+ and ip, r0, #0x80000000
+1: moveq r0, r0, lsl #1
+ tsteq r0, #0x00800000
+ subeq r2, r2, #(1 << 22)
+ beq 1b
+ orr r0, r0, ip
+ teq r3, #0
+ and ip, r1, #0x80000000
+2: moveq r1, r1, lsl #1
+ tsteq r1, #0x00800000
+ subeq r3, r3, #(1 << 23)
+ beq 2b
+ orr r1, r1, ip
+ b LSYM(Ldv_x)
+
+ @ One or both arguments is either INF, NAN or zero.
+LSYM(Ldv_s):
+ mov ip, #0xff000000
+ teq r2, ip, lsr #1
+ teqeq r3, ip, lsr #1
+ beq LSYM(Lml_n) @ INF/NAN / INF/NAN -> NAN
+ teq r2, ip, lsr #1
+ bne 1f
+ movs r2, r0, lsl #9
+ bne LSYM(Lml_n) @ NAN / <anything> -> NAN
+ b LSYM(Lml_i) @ INF / <anything> -> INF
+1: teq r3, ip, lsr #1
+ bne 2f
+ movs r3, r1, lsl #9
+ bne LSYM(Lml_n) @ <anything> / NAN -> NAN
+ b LSYM(Lml_z) @ <anything> / INF -> 0
+2: @ One or both arguments are 0.
+ bics r2, r0, #0x80000000
+ bne LSYM(Lml_i) @ <non_zero> / 0 -> INF
+ bics r3, r1, #0x80000000
+ bne LSYM(Lml_z) @ 0 / <non_zero> -> 0
+ b LSYM(Lml_n) @ 0 / 0 -> NAN
+
+ FUNC_END divsf3
+
+#endif /* L_muldivsf3 */
+
+#ifdef L_cmpsf2
+
+FUNC_START gesf2
+ARM_FUNC_START gtsf2
+ mov r3, #-1
+ b 1f
+
+FUNC_START lesf2
+ARM_FUNC_START ltsf2
+ mov r3, #1
+ b 1f
+
+FUNC_START nesf2
+FUNC_START eqsf2
+ARM_FUNC_START cmpsf2
+ mov r3, #1 @ how should we specify unordered here?
+
+1: @ Trap any INF/NAN first.
+ mov ip, #0xff000000
+ and r2, r1, ip, lsr #1
+ teq r2, ip, lsr #1
+ and r2, r0, ip, lsr #1
+ teqne r2, ip, lsr #1
+ beq 3f
+
+ @ Test for equality.
+ @ Note that 0.0 is equal to -0.0.
+2: orr r3, r0, r1
+ bics r3, r3, #0x80000000 @ either 0.0 or -0.0
+ teqne r0, r1 @ or both the same
+ moveq r0, #0
+ RETc(eq)
+
+ @ Check for sign difference. The N flag is set if it is the case.
+ @ If so, return sign of r0.
+ movmi r0, r0, asr #31
+ orrmi r0, r0, #1
+ RETc(mi)
+
+ @ Compare exponents.
+ and r3, r1, ip, lsr #1
+ cmp r2, r3
+
+ @ Compare mantissa if exponents are equal
+ moveq r0, r0, lsl #9
+ cmpeq r0, r1, lsl #9
+ movcs r0, r1, asr #31
+ mvncc r0, r1, asr #31
+ orr r0, r0, #1
+ RET
+
+ @ Look for a NAN.
+3: and r2, r1, ip, lsr #1
+ teq r2, ip, lsr #1
+ bne 4f
+ movs r2, r1, lsl #9
+ bne 5f @ r1 is NAN
+4: and r2, r0, ip, lsr #1
+ teq r2, ip, lsr #1
+ bne 2b
+ movs ip, r0, lsl #9
+ beq 2b @ r0 is not NAN
+5: mov r0, r3 @ return unordered code from r3.
+ RET
+
+ FUNC_END gesf2
+ FUNC_END gtsf2
+ FUNC_END lesf2
+ FUNC_END ltsf2
+ FUNC_END nesf2
+ FUNC_END eqsf2
+ FUNC_END cmpsf2
+
+#endif /* L_cmpsf2 */
+
+#ifdef L_unordsf2
+
+ARM_FUNC_START unordsf2
+ mov ip, #0xff000000
+ and r2, r1, ip, lsr #1
+ teq r2, ip, lsr #1
+ bne 1f
+ movs r2, r1, lsl #9
+ bne 3f @ r1 is NAN
+1: and r2, r0, ip, lsr #1
+ teq r2, ip, lsr #1
+ bne 2f
+ movs r2, r0, lsl #9
+ bne 3f @ r0 is NAN
+2: mov r0, #0 @ arguments are ordered.
+ RET
+3: mov r0, #1 @ arguments are unordered.
+ RET
+
+ FUNC_END unordsf2
+
+#endif /* L_unordsf2 */
+
+#ifdef L_fixsfsi
+
+ARM_FUNC_START fixsfsi
+ movs r0, r0, lsl #1
+ RETc(eq) @ value is 0.
+
+ mov r1, r1, rrx @ preserve C flag (the actual sign)
+
+ @ check exponent range.
+ and r2, r0, #0xff000000
+ cmp r2, #(127 << 24)
+ movcc r0, #0 @ value is too small
+ RETc(cc)
+ cmp r2, #((127 + 31) << 24)
+ bcs 1f @ value is too large
+
+ mov r0, r0, lsl #7
+ orr r0, r0, #0x80000000
+ mov r2, r2, lsr #24
+ rsb r2, r2, #(127 + 31)
+ tst r1, #0x80000000 @ the sign bit
+ mov r0, r0, lsr r2
+ rsbne r0, r0, #0
+ RET
+
+1: teq r2, #0xff000000
+ bne 2f
+ movs r0, r0, lsl #8
+ bne 3f @ r0 is NAN.
+2: ands r0, r1, #0x80000000 @ the sign bit
+ moveq r0, #0x7fffffff @ the maximum signed positive si
+ RET
+
+3: mov r0, #0 @ What should we convert NAN to?
+ RET
+
+ FUNC_END fixsfsi
+
+#endif /* L_fixsfsi */
+
+#ifdef L_fixunssfsi
+
+ARM_FUNC_START fixunssfsi
+ movs r0, r0, lsl #1
+ movcss r0, #0 @ value is negative...
+ RETc(eq) @ ... or 0.
+
+
+ @ check exponent range.
+ and r2, r0, #0xff000000
+ cmp r2, #(127 << 24)
+ movcc r0, #0 @ value is too small
+ RETc(cc)
+ cmp r2, #((127 + 32) << 24)
+ bcs 1f @ value is too large
+
+ mov r0, r0, lsl #7
+ orr r0, r0, #0x80000000
+ mov r2, r2, lsr #24
+ rsb r2, r2, #(127 + 31)
+ mov r0, r0, lsr r2
+ RET
+
+1: teq r2, #0xff000000
+ bne 2f
+ movs r0, r0, lsl #8
+ bne 3f @ r0 is NAN.
+2: mov r0, #0xffffffff @ maximum unsigned si
+ RET
+
+3: mov r0, #0 @ What should we convert NAN to?
+ RET
+
+ FUNC_END fixunssfsi
+
+#endif /* L_fixunssfsi */
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm
index f80af2dd60e..34cf986d03e 100644
--- a/gcc/config/arm/lib1funcs.asm
+++ b/gcc/config/arm/lib1funcs.asm
@@ -61,66 +61,107 @@ Boston, MA 02111-1307, USA. */
/* Function end macros. Variants for 26 bit APCS and interworking. */
+@ This selects the minimum architecture level required.
+#define __ARM_ARCH__ 3
+
+#if defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__) \
+ || defined(__ARM_ARCH_4T__)
+/* We use __ARM_ARCH__ set to 4 here, but in reality it's any processor with
+ long multiply instructions. That includes v3M. */
+# undef __ARM_ARCH__
+# define __ARM_ARCH__ 4
+#endif
+
+#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
+ || defined(__ARM_ARCH_5TE__)
+# undef __ARM_ARCH__
+# define __ARM_ARCH__ 5
+#endif
+
+/* How to return from a function call depends on the architecture variant. */
+
#ifdef __APCS_26__
+
# define RET movs pc, lr
# define RETc(x) mov##x##s pc, lr
-# define RETCOND ^
+
+#elif (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__)
+
+# define RET bx lr
+# define RETc(x) bx##x lr
+
+# if (__ARM_ARCH__ == 4) \
+ && (defined(__thumb__) || defined(__THUMB_INTERWORK__))
+# define __INTERWORKING__
+# endif
+
+#else
+
+# define RET mov pc, lr
+# define RETc(x) mov##x pc, lr
+
+#endif
+
+/* Don't pass dirn, it's there just to get token pasting right. */
+
+.macro RETLDM regs=, cond=, dirn=ia
+#ifdef __APCS_26__
+ .ifc "\regs",""
+ ldm\cond\dirn sp!, {pc}^
+ .else
+ ldm\cond\dirn sp!, {\regs, pc}^
+ .endif
+#elif defined (__INTERWORKING__)
+ .ifc "\regs",""
+ ldr\cond lr, [sp], #4
+ .else
+ ldm\cond\dirn sp!, {\regs, lr}
+ .endif
+ bx\cond lr
+#else
+ .ifc "\regs",""
+ ldr\cond pc, [sp], #4
+ .else
+ ldm\cond\dirn sp!, {\regs, pc}
+ .endif
+#endif
+.endm
+
+
.macro ARM_LDIV0
LSYM(Ldiv0):
str lr, [sp, #-4]!
bl SYM (__div0) __PLT__
mov r0, #0 @ About as wrong as it could be.
- ldmia sp!, {pc}^
+ RETLDM
.endm
-#else
-# ifdef __THUMB_INTERWORK__
-# define RET bx lr
-# define RETc(x) bx##x lr
+
+
.macro THUMB_LDIV0
LSYM(Ldiv0):
push { lr }
bl SYM (__div0)
mov r0, #0 @ About as wrong as it could be.
+#if defined (__INTERWORKING__)
pop { r1 }
bx r1
-.endm
-.macro ARM_LDIV0
-LSYM(Ldiv0):
- str lr, [sp, #-4]!
- bl SYM (__div0) __PLT__
- mov r0, #0 @ About as wrong as it could be.
- ldr lr, [sp], #4
- bx lr
-.endm
-# else
-# define RET mov pc, lr
-# define RETc(x) mov##x pc, lr
-.macro THUMB_LDIV0
-LSYM(Ldiv0):
- push { lr }
- bl SYM (__div0)
- mov r0, #0 @ About as wrong as it could be.
+#else
pop { pc }
-.endm
-.macro ARM_LDIV0
-LSYM(Ldiv0):
- str lr, [sp, #-4]!
- bl SYM (__div0) __PLT__
- mov r0, #0 @ About as wrong as it could be.
- ldmia sp!, {pc}
-.endm
-# endif
-# define RETCOND
#endif
+.endm
.macro FUNC_END name
+ SIZE (__\name)
+.endm
+
+.macro DIV_FUNC_END name
LSYM(Ldiv0):
#ifdef __thumb__
THUMB_LDIV0
#else
ARM_LDIV0
#endif
- SIZE (__\name)
+ FUNC_END \name
.endm
.macro THUMB_FUNC_START name
@@ -149,7 +190,24 @@ SYM (\name):
THUMB_FUNC
SYM (__\name):
.endm
-
+
+/* Special function that will always be coded in ARM assembly, even if
+ in Thumb-only compilation. */
+
+#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
+.macro ARM_FUNC_START name
+ FUNC_START \name
+ bx pc
+ nop
+ .arm
+_L__\name: /* A hook to tell gdb that we've switched to ARM */
+.endm
+#else
+.macro ARM_FUNC_START name
+ FUNC_START \name
+.endm
+#endif
+
/* Register aliases. */
work .req r4 @ XXXX is this safe ?
@@ -165,7 +223,7 @@ lr .req r14
pc .req r15
#endif
/* ------------------------------------------------------------------------ */
-/* Bodies of the divsion and modulo routines. */
+/* Bodies of the division and modulo routines. */
/* ------------------------------------------------------------------------ */
.macro ARM_DIV_MOD_BODY modulo
LSYM(Loop1):
@@ -452,7 +510,7 @@ LSYM(Lgot_result):
#endif /* ARM version */
- FUNC_END udivsi3
+ DIV_FUNC_END udivsi3
#endif /* L_udivsi3 */
/* ------------------------------------------------------------------------ */
@@ -493,7 +551,7 @@ LSYM(Lover10):
#endif /* ARM version. */
- FUNC_END umodsi3
+ DIV_FUNC_END umodsi3
#endif /* L_umodsi3 */
/* ------------------------------------------------------------------------ */
@@ -555,7 +613,7 @@ LSYM(Lover12):
#endif /* ARM version */
- FUNC_END divsi3
+ DIV_FUNC_END divsi3
#endif /* L_divsi3 */
/* ------------------------------------------------------------------------ */
@@ -616,7 +674,7 @@ LSYM(Lover12):
#endif /* ARM version */
- FUNC_END modsi3
+ DIV_FUNC_END modsi3
#endif /* L_modsi3 */
/* ------------------------------------------------------------------------ */
@@ -626,7 +684,7 @@ LSYM(Lover12):
RET
- SIZE (__div0)
+ FUNC_END div0
#endif /* L_divmodsi_tools */
/* ------------------------------------------------------------------------ */
@@ -639,22 +697,18 @@ LSYM(Lover12):
#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
#define __NR_kill (__NR_SYSCALL_BASE+ 37)
+ .code 32
FUNC_START div0
stmfd sp!, {r1, lr}
swi __NR_getpid
cmn r0, #1000
- ldmhsfd sp!, {r1, pc}RETCOND @ not much we can do
+ RETLDM r1 hs
mov r1, #SIGFPE
swi __NR_kill
-#ifdef __THUMB_INTERWORK__
- ldmfd sp!, {r1, lr}
- bx lr
-#else
- ldmfd sp!, {r1, pc}RETCOND
-#endif
+ RETLDM r1
- SIZE (__div0)
+ FUNC_END div0
#endif /* L_dvmd_lnx */
/* ------------------------------------------------------------------------ */
@@ -723,24 +777,23 @@ LSYM(Lover12):
.code 32
.globl _arm_return
-_arm_return:
- ldmia r13!, {r12}
- bx r12
+_arm_return:
+ RETLDM
.code 16
-.macro interwork register
- .code 16
+.macro interwork register
+ .code 16
THUMB_FUNC_START _interwork_call_via_\register
- bx pc
+ bx pc
nop
-
- .code 32
- .globl .Lchange_\register
-.Lchange_\register:
+
+ .code 32
+ .globl LSYM(Lchange_\register)
+LSYM(Lchange_\register):
tst \register, #1
- stmeqdb r13!, {lr}
+ streq lr, [sp, #-4]!
adreq lr, _arm_return
bx \register
@@ -782,3 +835,7 @@ _arm_return:
SIZE (_interwork_call_via_lr)
#endif /* L_interwork_call_via_rX */
+
+#include "ieee754-df.S"
+#include "ieee754-sf.S"
+
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 1a86e458927..f55a42562cb 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -1,5 +1,5 @@
/* Definitions for ARM running Linux-based GNU systems using ELF
- Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Philip Blundell <philb@gnu.org>
@@ -127,3 +127,6 @@
#undef CC1_SPEC
#define CC1_SPEC "%{profile:-p}"
+
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
diff --git a/gcc/config/arm/pe.c b/gcc/config/arm/pe.c
index 1413eeeb51d..d25fd0da977 100644
--- a/gcc/config/arm/pe.c
+++ b/gcc/config/arm/pe.c
@@ -167,7 +167,7 @@ arm_mark_dllimport (decl)
&& !DECL_VIRTUAL_P (decl)
&& DECL_INITIAL (decl))
{
- error_with_decl (decl, "initialized variable `%s' is marked dllimport");
+ error ("%Jinitialized variable '%D' is marked dllimport", decl, decl);
return;
}
/* Nor can they be static. */
@@ -176,7 +176,7 @@ arm_mark_dllimport (decl)
&& !DECL_VIRTUAL_P (decl)
&& 0 /*???*/)
{
- error_with_decl (decl, "static variable `%s' is marked dllimport");
+ error ("%Jstatic variable '%D' is marked dllimport", decl, decl);
return;
}
diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
index 79506fb5a62..1b8f719b949 100644
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -1,29 +1,14 @@
LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _call_via_rX _interwork_call_via_rX
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
+ _call_via_rX _interwork_call_via_rX \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+ _fixsfsi _fixunssfsi
-# We want fine grained libraries, so use the new code to build the
-# floating point emulation libraries.
-FPBIT = fp-bit.c
-DPBIT = dp-bit.c
-
-fp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#define FLOAT' > fp-bit.c
- echo '#ifndef __ARMEB__' >> fp-bit.c
- echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
- echo '#endif' >> fp-bit.c
- cat $(srcdir)/config/fp-bit.c >> fp-bit.c
-
-dp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#ifndef __ARMEB__' > dp-bit.c
- echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
- echo '#define FLOAT_WORD_ORDER_MISMATCH' >> dp-bit.c
- echo '#endif' >> dp-bit.c
- cat $(srcdir)/config/fp-bit.c >> dp-bit.c
-
-
MULTILIB_OPTIONS = marm/mthumb
MULTILIB_DIRNAMES = arm thumb
MULTILIB_EXCEPTIONS =
+MULTILIB_MATCHES =
# MULTILIB_OPTIONS += mcpu=ep9312
# MULTILIB_DIRNAMES += ep9312
@@ -31,8 +16,7 @@ MULTILIB_EXCEPTIONS =
# MULTILIB_OPTIONS += mlittle-endian/mbig-endian
# MULTILIB_DIRNAMES += le be
-# MULTILIB_EXCEPTIONS =
-# MULTILIB_MATCHES = mbig-endian=mbe mlittle-endian=mle
+# MULTILIB_MATCHES += mbig-endian=mbe mlittle-endian=mle
#
# MULTILIB_OPTIONS += mhard-float/msoft-float
# MULTILIB_DIRNAMES += fpu soft
@@ -97,3 +81,4 @@ $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES)
$(T)crtn.o: $(srcdir)/config/arm/crtn.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/arm/crtn.asm
+
diff --git a/gcc/config/arm/t-linux b/gcc/config/arm/t-linux
index 7dbd0c0e277..1c5f48ae6f5 100644
--- a/gcc/config/arm/t-linux
+++ b/gcc/config/arm/t-linux
@@ -3,9 +3,6 @@
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
LIBGCC2_DEBUG_CFLAGS = -g0
-# Don't build enquire
-ENQUIRE=
-
LIB1ASMSRC = arm/lib1funcs.asm
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
diff --git a/gcc/config/arm/t-netbsd b/gcc/config/arm/t-netbsd
index 76e431bfb11..77e622716f2 100644
--- a/gcc/config/arm/t-netbsd
+++ b/gcc/config/arm/t-netbsd
@@ -19,8 +19,3 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
SHLIB_INSTALL = $(INSTALL_DATA) $(SHLIB_NAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME); \
$(LN_S) $(SHLIB_SONAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME)
-
-# Don't build enquire
-ENQUIRE=
-
-
diff --git a/gcc/config/arm/t-semi b/gcc/config/arm/t-semi
index ce394606386..072691a9e21 100644
--- a/gcc/config/arm/t-semi
+++ b/gcc/config/arm/t-semi
@@ -3,9 +3,6 @@
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer
LIBGCC2_DEBUG_CFLAGS = -g0
-# Don't build enquire
-ENQUIRE=
-
LIB1ASMSRC = arm/lib1funcs.asm
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 432dd538ae6..16701d1b550 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -281,20 +281,17 @@ avr_override_options ()
void
avr_init_once ()
{
- tmp_reg_rtx = xmalloc (sizeof (struct rtx_def) + 1 * sizeof (rtunion));
- memset (tmp_reg_rtx, 0, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
+ 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 = xmalloc (sizeof (struct rtx_def) + 1 * sizeof (rtunion));
- memset (zero_reg_rtx, 0, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
+ 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 = xmalloc (sizeof (struct rtx_def) + 1 * sizeof (rtunion));
- memset (ldi_reg_rtx, 0, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
+ 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;
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 83c91ee6240..e2063c7abde 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -2499,6 +2499,3 @@ extern struct rtx_def *zero_reg_rtx;
extern struct rtx_def *ldi_reg_rtx;
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-/* Get the standard ELF stabs definitions. */
-#include "dbxelf.h"
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 86ab6c72829..ef449158c44 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -2255,7 +2255,7 @@
;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-;; This instructin sets Z flag
+;; This instruction sets Z flag
(define_insn "sez"
[(set (cc0) (const_int 0))]
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index 045530d7b5b..c92c12f2ff9 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -1,6 +1,5 @@
/* Darwin support needed only by C/C++ frontends.
- Copyright (C) 2001
- Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
This file is part of GNU CC.
@@ -38,8 +37,8 @@ Boston, MA 02111-1307, USA. */
/* Maintain a small stack of alignments. This is similar to pragma
pack's stack, but simpler. */
-static void push_field_alignment PARAMS ((int));
-static void pop_field_alignment PARAMS ((void));
+static void push_field_alignment (int);
+static void pop_field_alignment (void);
typedef struct align_stack
{
@@ -50,8 +49,7 @@ typedef struct align_stack
static struct align_stack * field_align_stack = NULL;
static void
-push_field_alignment (bit_alignment)
- int bit_alignment;
+push_field_alignment (int bit_alignment)
{
align_stack *entry = (align_stack *) xmalloc (sizeof (align_stack));
@@ -63,7 +61,7 @@ push_field_alignment (bit_alignment)
}
static void
-pop_field_alignment ()
+pop_field_alignment (void)
{
if (field_align_stack)
{
@@ -80,8 +78,7 @@ pop_field_alignment ()
/* Handlers for Darwin-specific pragmas. */
void
-darwin_pragma_ignore (pfile)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
+darwin_pragma_ignore (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
/* Do nothing. */
}
@@ -89,8 +86,7 @@ darwin_pragma_ignore (pfile)
/* #pragma options align={mac68k|power|reset} */
void
-darwin_pragma_options (pfile)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
+darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
const char *arg;
tree t, x;
@@ -122,8 +118,7 @@ darwin_pragma_options (pfile)
/* #pragma unused ([var {, var}*]) */
void
-darwin_pragma_unused (pfile)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
+darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
tree decl, x;
int tok;
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index ad8b2340ae6..68ae21c44a7 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -18,104 +18,105 @@ 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. */
-extern int name_needs_quotes PARAMS ((const char *));
+extern int name_needs_quotes (const char *);
-extern void machopic_validate_stub_or_non_lazy_ptr PARAMS ((const char *, int));
+extern void machopic_validate_stub_or_non_lazy_ptr (const char *, int);
-extern const char *machopic_function_base_name PARAMS ((void));
-extern const char *machopic_non_lazy_ptr_name PARAMS ((const char*));
-extern const char *machopic_stub_name PARAMS ((const char*));
+extern const char *machopic_function_base_name (void);
+extern void machopic_output_function_base_name (FILE *);
+extern const char *machopic_non_lazy_ptr_name (const char*);
+extern const char *machopic_stub_name (const char*);
-extern void machopic_picsymbol_stub_section PARAMS ((void));
-extern void machopic_picsymbol_stub1_section PARAMS ((void));
-extern void machopic_symbol_stub_section PARAMS ((void));
-extern void machopic_symbol_stub1_section PARAMS ((void));
-extern void machopic_lazy_symbol_ptr_section PARAMS ((void));
-extern void machopic_nl_symbol_ptr_section PARAMS ((void));
+extern void machopic_picsymbol_stub_section (void);
+extern void machopic_picsymbol_stub1_section (void);
+extern void machopic_symbol_stub_section (void);
+extern void machopic_symbol_stub1_section (void);
+extern void machopic_lazy_symbol_ptr_section (void);
+extern void machopic_nl_symbol_ptr_section (void);
-extern void constructor_section PARAMS ((void));
-extern void destructor_section PARAMS ((void));
-extern void mod_init_section PARAMS ((void));
-extern void mod_term_section PARAMS ((void));
+extern void constructor_section (void);
+extern void destructor_section (void);
+extern void mod_init_section (void);
+extern void mod_term_section (void);
#ifdef RTX_CODE
-extern int machopic_operand_p PARAMS ((rtx));
-extern enum machopic_addr_class machopic_classify_name PARAMS ((const char*));
+extern int machopic_operand_p (rtx);
+extern enum machopic_addr_class machopic_classify_name (const char*);
-extern rtx machopic_indirect_data_reference PARAMS ((rtx, rtx));
-extern rtx machopic_indirect_call_target PARAMS ((rtx));
-extern rtx machopic_legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx));
+extern rtx machopic_indirect_data_reference (rtx, rtx);
+extern rtx machopic_indirect_call_target (rtx);
+extern rtx machopic_legitimize_pic_address (rtx, enum machine_mode, rtx);
-extern void machopic_asm_out_constructor PARAMS ((rtx, int));
-extern void machopic_asm_out_destructor PARAMS ((rtx, int));
+extern void machopic_asm_out_constructor (rtx, int);
+extern void machopic_asm_out_destructor (rtx, int);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern enum machopic_addr_class machopic_classify_ident PARAMS ((tree));
-extern void machopic_define_ident PARAMS ((tree));
-extern void machopic_define_name PARAMS ((const char*));
-extern int machopic_name_defined_p PARAMS ((const char*));
-extern int machopic_ident_defined_p PARAMS ((tree));
-extern void darwin_encode_section_info PARAMS ((tree, rtx, int));
-extern const char *darwin_strip_name_encoding PARAMS ((const char *));
+extern enum machopic_addr_class machopic_classify_ident (tree);
+extern void machopic_define_ident (tree);
+extern void machopic_define_name (const char*);
+extern int machopic_name_defined_p (const char*);
+extern int machopic_ident_defined_p (tree);
+extern void darwin_encode_section_info (tree, rtx, int);
+extern const char *darwin_strip_name_encoding (const char *);
#endif /* TREE_CODE */
-extern void machopic_finish PARAMS ((FILE *));
+extern void machopic_finish (FILE *);
-extern void machopic_output_possible_stub_label PARAMS ((FILE *, const char*));
+extern void machopic_output_possible_stub_label (FILE *, const char*);
-extern void darwin_exception_section PARAMS ((void));
-extern void darwin_eh_frame_section PARAMS ((void));
-extern void machopic_select_section PARAMS ((tree, int,
- unsigned HOST_WIDE_INT));
-extern void machopic_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT));
+extern void darwin_exception_section (void);
+extern void darwin_eh_frame_section (void);
+extern void machopic_select_section (tree, int, unsigned HOST_WIDE_INT);
+extern void machopic_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT);
-extern void darwin_pragma_ignore PARAMS ((struct cpp_reader *));
-extern void darwin_pragma_options PARAMS ((struct cpp_reader *));
-extern void darwin_pragma_unused PARAMS ((struct cpp_reader *));
+extern void darwin_pragma_ignore (struct cpp_reader *);
+extern void darwin_pragma_options (struct cpp_reader *);
+extern void darwin_pragma_unused (struct cpp_reader *);
-extern void darwin_file_end PARAMS ((void));
+extern void darwin_file_end (void);
/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */
-extern void const_section PARAMS ((void));
-extern void const_data_section PARAMS ((void));
-extern void cstring_section PARAMS ((void));
-extern void literal4_section PARAMS ((void));
-extern void literal8_section PARAMS ((void));
-extern void constructor_section PARAMS ((void));
-extern void mod_init_section PARAMS ((void));
-extern void mod_term_section PARAMS ((void));
-extern void destructor_section PARAMS ((void));
-extern void objc_class_section PARAMS ((void));
-extern void objc_meta_class_section PARAMS ((void));
-extern void objc_category_section PARAMS ((void));
-extern void objc_class_vars_section PARAMS ((void));
-extern void objc_instance_vars_section PARAMS ((void));
-extern void objc_cls_meth_section PARAMS ((void));
-extern void objc_inst_meth_section PARAMS ((void));
-extern void objc_cat_cls_meth_section PARAMS ((void));
-extern void objc_cat_inst_meth_section PARAMS ((void));
-extern void objc_selector_refs_section PARAMS ((void));
-extern void objc_selector_fixup_section PARAMS ((void));
-extern void objc_symbols_section PARAMS ((void));
-extern void objc_module_info_section PARAMS ((void));
-extern void objc_protocol_section PARAMS ((void));
-extern void objc_string_object_section PARAMS ((void));
-extern void objc_constant_string_object_section PARAMS ((void));
-extern void objc_class_names_section PARAMS ((void));
-extern void objc_meth_var_names_section PARAMS ((void));
-extern void objc_meth_var_types_section PARAMS ((void));
-extern void objc_cls_refs_section PARAMS ((void));
-extern void machopic_lazy_symbol_ptr_section PARAMS ((void));
-extern void machopic_nl_symbol_ptr_section PARAMS ((void));
-extern void machopic_symbol_stub_section PARAMS ((void));
-extern void machopic_picsymbol_stub_section PARAMS ((void));
-extern void machopic_output_stub PARAMS ((FILE *, const char *, const char *));
-extern void darwin_exception_section PARAMS ((void));
-extern void darwin_eh_frame_section PARAMS ((void));
-extern void darwin_globalize_label PARAMS ((FILE *, const char *));
-extern void darwin_asm_output_dwarf_delta PARAMS ((FILE *, int, const char *, const char *));
+extern void const_section (void);
+extern void const_data_section (void);
+extern void cstring_section (void);
+extern void literal4_section (void);
+extern void literal8_section (void);
+extern void constructor_section (void);
+extern void mod_init_section (void);
+extern void mod_term_section (void);
+extern void destructor_section (void);
+extern void objc_class_section (void);
+extern void objc_meta_class_section (void);
+extern void objc_category_section (void);
+extern void objc_class_vars_section (void);
+extern void objc_instance_vars_section (void);
+extern void objc_cls_meth_section (void);
+extern void objc_inst_meth_section (void);
+extern void objc_cat_cls_meth_section (void);
+extern void objc_cat_inst_meth_section (void);
+extern void objc_selector_refs_section (void);
+extern void objc_selector_fixup_section (void);
+extern void objc_symbols_section (void);
+extern void objc_module_info_section (void);
+extern void objc_protocol_section (void);
+extern void objc_string_object_section (void);
+extern void objc_constant_string_object_section (void);
+extern void objc_class_names_section (void);
+extern void objc_meth_var_names_section (void);
+extern void objc_meth_var_types_section (void);
+extern void objc_cls_refs_section (void);
+extern void machopic_lazy_symbol_ptr_section (void);
+extern void machopic_nl_symbol_ptr_section (void);
+extern void machopic_symbol_stub_section (void);
+extern void machopic_picsymbol_stub_section (void);
+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_asm_output_dwarf_delta (FILE *, int, const char *,
+ const char *);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index c17fc74ba08..dc864628a20 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -42,13 +42,12 @@ Boston, MA 02111-1307, USA. */
#include "langhooks.h"
#include "tm_p.h"
-static int machopic_data_defined_p PARAMS ((const char *));
-static void update_non_lazy_ptrs PARAMS ((const char *));
-static void update_stubs PARAMS ((const char *));
+static int machopic_data_defined_p (const char *);
+static void update_non_lazy_ptrs (const char *);
+static void update_stubs (const char *);
int
-name_needs_quotes (name)
- const char *name;
+name_needs_quotes (const char *name)
{
int c;
while ((c = *name++) != '\0')
@@ -57,7 +56,7 @@ name_needs_quotes (name)
return 0;
}
-/*
+/*
* flag_pic = 1 ... generate only indirections
* flag_pic = 2 ... generate indirections and pure code
*/
@@ -68,20 +67,23 @@ name_needs_quotes (name)
static GTY(()) tree machopic_defined_list;
enum machopic_addr_class
-machopic_classify_ident (ident)
- tree ident;
+machopic_classify_ident (tree ident)
{
const char *name = IDENTIFIER_POINTER (ident);
int lprefix = (((name[0] == '*' || name[0] == '&')
&& (name[1] == 'L' || (name[1] == '"' && name[2] == 'L')))
- || ( name[0] == '_'
- && name[1] == 'O'
- && name[2] == 'B'
+ || ( name[0] == '_'
+ && name[1] == 'O'
+ && name[2] == 'B'
&& name[3] == 'J'
&& name[4] == 'C'
&& name[5] == '_'));
tree temp;
+ /* The PIC base symbol is always defined. */
+ if (! strcmp (name, "<pic base>"))
+ return MACHOPIC_DEFINED_DATA;
+
if (name[0] != '!')
{
/* Here if no special encoding to be found. */
@@ -142,7 +144,7 @@ machopic_classify_ident (ident)
return MACHOPIC_DEFINED_DATA;
}
}
-
+
if (name[1] == 't' || name[1] == 'T')
{
if (lprefix)
@@ -159,17 +161,15 @@ machopic_classify_ident (ident)
}
}
-
+
enum machopic_addr_class
-machopic_classify_name (name)
- const char *name;
+machopic_classify_name (const char *name)
{
return machopic_classify_ident (get_identifier (name));
}
int
-machopic_ident_defined_p (ident)
- tree ident;
+machopic_ident_defined_p (tree ident)
{
switch (machopic_classify_ident (ident))
{
@@ -183,8 +183,7 @@ machopic_ident_defined_p (ident)
}
static int
-machopic_data_defined_p (name)
- const char *name;
+machopic_data_defined_p (const char *name)
{
switch (machopic_classify_ident (get_identifier (name)))
{
@@ -196,76 +195,65 @@ machopic_data_defined_p (name)
}
int
-machopic_name_defined_p (name)
- const char *name;
+machopic_name_defined_p (const char *name)
{
return machopic_ident_defined_p (get_identifier (name));
}
void
-machopic_define_ident (ident)
- tree ident;
+machopic_define_ident (tree ident)
{
if (!machopic_ident_defined_p (ident))
- machopic_defined_list =
+ machopic_defined_list =
tree_cons (NULL_TREE, ident, machopic_defined_list);
}
void
-machopic_define_name (name)
- const char *name;
+machopic_define_name (const char *name)
{
machopic_define_ident (get_identifier (name));
}
-/* This is a static to make inline functions work. The rtx
- representing the PIC base symbol always points to here.
+static GTY(()) char * function_base;
- FIXME: The rest of the compiler doesn't expect strings to change. */
+const char *
+machopic_function_base_name (void)
+{
+ const char *current_name;
+ /* if dynamic-no-pic is on, we should not get here */
+ if (MACHO_DYNAMIC_NO_PIC_P)
+ abort ();
+ current_name =
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
+
+ if (function_base == NULL)
+ function_base =
+ (char *) ggc_alloc_string ("<pic base>", sizeof ("<pic base>"));
+
+ current_function_uses_pic_offset_table = 1;
+
+ return function_base;
+}
-static GTY(()) char * function_base;
static GTY(()) const char * function_base_func_name;
static GTY(()) int current_pic_label_num;
-const char *
-machopic_function_base_name ()
+void
+machopic_output_function_base_name (FILE *file)
{
const char *current_name;
- /* if dynamic-no-pic is on, we should not get here */
+ /* If dynamic-no-pic is on, we should not get here. */
if (MACHO_DYNAMIC_NO_PIC_P)
abort ();
- current_name =
+ current_name =
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
-
if (function_base_func_name != current_name)
{
- current_function_uses_pic_offset_table = 1;
-
- /* Save mucho space and time. Some of the C++ mangled names are over
- 700 characters long! Note that we produce a label containing a '-'
- if the function we're compiling is an Objective-C method, as evinced
- by the incredibly scientific test below. This is because code in
- rs6000.c makes the same ugly test when loading the PIC reg. */
-
- /* It's hard to describe just how ugly this is. The reason for
- the '%011d' is that after a PCH load, we can't change the
- size of the string, because PCH will have uniqued it and
- allocated it in the string pool. */
- if (function_base == NULL)
- function_base =
- (char *) ggc_alloc_string ("", sizeof ("*\"L12345678901$pb\""));
-
++current_pic_label_num;
- if (*current_name == '+' || *current_name == '-')
- sprintf (function_base, "*\"L-%010d$pb\"", current_pic_label_num);
- else
- sprintf (function_base, "*\"L%011d$pb\"", current_pic_label_num);
-
function_base_func_name = current_name;
}
-
- return function_base;
+ fprintf (file, "\"L%011d$pb\"", current_pic_label_num);
}
static GTY(()) tree machopic_non_lazy_pointers;
@@ -274,15 +262,14 @@ static GTY(()) tree machopic_non_lazy_pointers;
either by finding it in our list of pointer names, or by generating
a new one. */
-const char *
-machopic_non_lazy_ptr_name (name)
- const char *name;
+const char *
+machopic_non_lazy_ptr_name (const char *name)
{
const char *temp_name;
tree temp, ident = get_identifier (name);
-
+
for (temp = machopic_non_lazy_pointers;
- temp != NULL_TREE;
+ temp != NULL_TREE;
temp = TREE_CHAIN (temp))
{
if (ident == TREE_VALUE (temp))
@@ -293,7 +280,7 @@ machopic_non_lazy_ptr_name (name)
/* Try again, but comparing names this time. */
for (temp = machopic_non_lazy_pointers;
- temp != NULL_TREE;
+ temp != NULL_TREE;
temp = TREE_CHAIN (temp))
{
if (TREE_VALUE (temp))
@@ -319,11 +306,11 @@ machopic_non_lazy_ptr_name (name)
strcat (buffer, "_");
strcat (buffer, name);
}
-
+
strcat (buffer, "$non_lazy_ptr");
ptr_name = get_identifier (buffer);
- machopic_non_lazy_pointers
+ machopic_non_lazy_pointers
= tree_cons (ptr_name, ident, machopic_non_lazy_pointers);
TREE_USED (machopic_non_lazy_pointers) = 0;
@@ -337,15 +324,14 @@ static GTY(()) tree machopic_stubs;
/* Return the name of the stub corresponding to the given name,
generating a new stub name if necessary. */
-const char *
-machopic_stub_name (name)
- const char *name;
+const char *
+machopic_stub_name (const char *name)
{
tree temp, ident = get_identifier (name);
const char *tname;
for (temp = machopic_stubs;
- temp != NULL_TREE;
+ temp != NULL_TREE;
temp = TREE_CHAIN (temp))
{
if (ident == TREE_VALUE (temp))
@@ -398,9 +384,7 @@ machopic_stub_name (name)
}
void
-machopic_validate_stub_or_non_lazy_ptr (name, validate_stub)
- const char *name;
- int validate_stub;
+machopic_validate_stub_or_non_lazy_ptr (const char *name, int validate_stub)
{
const char *real_name;
tree temp, ident = get_identifier (name), id2;
@@ -414,12 +398,12 @@ machopic_validate_stub_or_non_lazy_ptr (name, validate_stub)
original symbol as being referenced. */
TREE_USED (temp) = 1;
if (TREE_CODE (TREE_VALUE (temp)) == IDENTIFIER_NODE)
- TREE_SYMBOL_REFERENCED (TREE_VALUE (temp)) = 1;
+ mark_referenced (TREE_VALUE (temp));
real_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
real_name = darwin_strip_name_encoding (real_name);
id2 = maybe_get_identifier (real_name);
if (id2)
- TREE_SYMBOL_REFERENCED (id2) = 1;
+ mark_referenced (id2);
}
}
@@ -427,11 +411,10 @@ machopic_validate_stub_or_non_lazy_ptr (name, validate_stub)
source using indirections. */
rtx
-machopic_indirect_data_reference (orig, reg)
- rtx orig, reg;
+machopic_indirect_data_reference (rtx orig, rtx reg)
{
rtx ptr_ref = orig;
-
+
if (! MACHOPIC_INDIRECT)
return orig;
@@ -444,7 +427,7 @@ machopic_indirect_data_reference (orig, reg)
if (defined && MACHO_DYNAMIC_NO_PIC_P)
{
#if defined (TARGET_TOC)
- emit_insn (gen_macho_high (reg, orig));
+ emit_insn (gen_macho_high (reg, orig));
emit_insn (gen_macho_low (reg, reg, orig));
#else
/* some other cpu -- writeme! */
@@ -455,7 +438,7 @@ machopic_indirect_data_reference (orig, reg)
else if (defined)
{
#if defined (TARGET_TOC) || defined (HAVE_lo_sum)
- rtx pic_base = gen_rtx (SYMBOL_REF, Pmode,
+ rtx pic_base = gen_rtx (SYMBOL_REF, Pmode,
machopic_function_base_name ());
rtx offset = gen_rtx (CONST, Pmode,
gen_rtx (MINUS, Pmode, orig, pic_base));
@@ -511,7 +494,7 @@ machopic_indirect_data_reference (orig, reg)
orig = machopic_indirect_data_reference (XEXP (XEXP (orig, 0), 1),
(base == reg ? 0 : reg));
}
- else
+ else
return orig;
if (MACHOPIC_PURE && GET_CODE (orig) == CONST_INT)
@@ -561,14 +544,13 @@ machopic_indirect_data_reference (orig, reg)
corresponding symbol_stub if necessary. Return a new MEM. */
rtx
-machopic_indirect_call_target (target)
- rtx target;
+machopic_indirect_call_target (rtx target)
{
if (GET_CODE (target) != MEM)
return target;
if (MACHOPIC_INDIRECT && GET_CODE (XEXP (target, 0)) == SYMBOL_REF)
- {
+ {
enum machine_mode mode = GET_MODE (XEXP (target, 0));
const char *name = XSTR (XEXP (target, 0), 0);
@@ -582,16 +564,14 @@ machopic_indirect_call_target (target)
XEXP (target, 0) = gen_rtx (SYMBOL_REF, mode, stub_name);
RTX_UNCHANGING_P (target) = 1;
- }
+ }
}
return target;
}
rtx
-machopic_legitimize_pic_address (orig, mode, reg)
- rtx orig, reg;
- enum machine_mode mode;
+machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
{
rtx pic_ref = orig;
@@ -608,7 +588,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
orig = machopic_indirect_data_reference (orig, reg);
- if (GET_CODE (orig) == PLUS
+ if (GET_CODE (orig) == PLUS
&& GET_CODE (XEXP (orig, 0)) == REG)
{
if (reg == 0)
@@ -616,7 +596,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
emit_move_insn (reg, orig);
return reg;
- }
+ }
/* if dynamic-no-pic then use 0 as the pic base */
if (MACHO_DYNAMIC_NO_PIC_P)
@@ -633,7 +613,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
else
reg = gen_reg_rtx (Pmode);
}
-
+
#ifdef HAVE_lo_sum
if (MACHO_DYNAMIC_NO_PIC_P
&& (GET_CODE (XEXP (orig, 0)) == SYMBOL_REF
@@ -656,7 +636,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
pic_ref = reg;
}
else
- if (GET_CODE (XEXP (orig, 0)) == SYMBOL_REF
+ if (GET_CODE (XEXP (orig, 0)) == SYMBOL_REF
|| GET_CODE (XEXP (orig, 0)) == LABEL_REF)
{
rtx offset = gen_rtx (CONST, Pmode,
@@ -674,7 +654,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
gen_rtx (HIGH, Pmode, offset))));
emit_insn (gen_rtx (SET, VOIDmode, reg,
gen_rtx (MEM, GET_MODE (orig),
- gen_rtx (LO_SUM, Pmode,
+ gen_rtx (LO_SUM, Pmode,
hi_sum_reg, offset))));
pic_ref = reg;
@@ -683,10 +663,10 @@ machopic_legitimize_pic_address (orig, mode, reg)
gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM)));
emit_insn (gen_rtx (SET, VOIDmode, reg,
- gen_rtx (HIGH, Pmode,
+ gen_rtx (HIGH, Pmode,
gen_rtx (CONST, Pmode, offset))));
emit_insn (gen_rtx (SET, VOIDmode, reg,
- gen_rtx (LO_SUM, Pmode, reg,
+ gen_rtx (LO_SUM, Pmode, reg,
gen_rtx (CONST, Pmode, offset))));
pic_ref = gen_rtx (PLUS, Pmode,
pic_offset_table_rtx, reg);
@@ -707,13 +687,13 @@ machopic_legitimize_pic_address (orig, mode, reg)
#endif
pic_ref = gen_rtx (PLUS, Pmode,
- pic,
- gen_rtx (CONST, Pmode,
+ pic,
+ gen_rtx (CONST, Pmode,
gen_rtx (MINUS, Pmode,
- XEXP (orig, 0),
+ XEXP (orig, 0),
pic_base)));
}
-
+
#if !defined (TARGET_TOC)
emit_move_insn (reg, pic_ref);
pic_ref = gen_rtx (MEM, GET_MODE (orig), reg);
@@ -724,7 +704,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
{
#ifdef HAVE_lo_sum
- if (GET_CODE (orig) == SYMBOL_REF
+ if (GET_CODE (orig) == SYMBOL_REF
|| GET_CODE (orig) == LABEL_REF)
{
rtx offset = gen_rtx (CONST, Pmode,
@@ -739,7 +719,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
else
reg = gen_reg_rtx (SImode);
}
-
+
hi_sum_reg = reg;
emit_insn (gen_rtx (SET, Pmode, hi_sum_reg,
@@ -784,7 +764,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
#endif
pic_ref = gen_rtx (PLUS, Pmode,
pic,
- gen_rtx (CONST, Pmode,
+ gen_rtx (CONST, Pmode,
gen_rtx (MINUS, Pmode,
orig, pic_base)));
}
@@ -818,7 +798,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
|| GET_CODE (XEXP (orig, 0)) == LABEL_REF)
&& XEXP (orig, 0) != pic_offset_table_rtx
&& GET_CODE (XEXP (orig, 1)) != REG)
-
+
{
rtx base;
int is_complex = (GET_CODE (XEXP (orig, 0)) == MEM);
@@ -866,8 +846,7 @@ machopic_legitimize_pic_address (orig, mode, reg)
void
-machopic_finish (asm_out_file)
- FILE *asm_out_file;
+machopic_finish (FILE *asm_out_file)
{
tree temp;
@@ -893,7 +872,7 @@ machopic_finish (asm_out_file)
if (sym_name[0] == '*' || sym_name[0] == '&')
strcpy (sym, sym_name + 1);
else if (sym_name[0] == '-' || sym_name[0] == '+')
- strcpy (sym, sym_name);
+ strcpy (sym, sym_name);
else
sym[0] = '_', strcpy (sym + 1, sym_name);
@@ -907,7 +886,7 @@ machopic_finish (asm_out_file)
}
for (temp = machopic_non_lazy_pointers;
- temp != NULL_TREE;
+ temp != NULL_TREE;
temp = TREE_CHAIN (temp))
{
const char *const sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
@@ -928,11 +907,11 @@ machopic_finish (asm_out_file)
else
{
machopic_nl_symbol_ptr_section ();
- assemble_name (asm_out_file, lazy_name);
+ assemble_name (asm_out_file, lazy_name);
fprintf (asm_out_file, ":\n");
fprintf (asm_out_file, "\t.indirect_symbol ");
- assemble_name (asm_out_file, sym_name);
+ assemble_name (asm_out_file, sym_name);
fprintf (asm_out_file, "\n");
assemble_integer (const0_rtx, GET_MODE_SIZE (Pmode),
@@ -941,9 +920,8 @@ machopic_finish (asm_out_file)
}
}
-int
-machopic_operand_p (op)
- rtx op;
+int
+machopic_operand_p (rtx op)
{
if (MACHOPIC_JUST_INDIRECT)
{
@@ -974,10 +952,7 @@ machopic_operand_p (op)
use later. */
void
-darwin_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first ATTRIBUTE_UNUSED;
+darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
{
char code = '\0';
int defined = 0;
@@ -1047,8 +1022,7 @@ darwin_encode_section_info (decl, rtl, first)
/* Undo the effects of the above. */
const char *
-darwin_strip_name_encoding (str)
- const char *str;
+darwin_strip_name_encoding (const char *str)
{
return str[0] == '!' ? str + 4 : str;
}
@@ -1057,8 +1031,7 @@ darwin_strip_name_encoding (str)
stripped name matches the argument. */
static void
-update_non_lazy_ptrs (name)
- const char *name;
+update_non_lazy_ptrs (const char *name)
{
const char *name1, *name2;
tree temp;
@@ -1066,7 +1039,7 @@ update_non_lazy_ptrs (name)
name1 = darwin_strip_name_encoding (name);
for (temp = machopic_non_lazy_pointers;
- temp != NULL_TREE;
+ temp != NULL_TREE;
temp = TREE_CHAIN (temp))
{
const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
@@ -1077,7 +1050,7 @@ update_non_lazy_ptrs (name)
if (strcmp (name1, name2) == 0)
{
/* FIXME: This breaks the identifier hash table. */
- IDENTIFIER_NODE_CHECK (TREE_VALUE (temp))->identifier.id.str
+ IDENTIFIER_NODE_CHECK (TREE_VALUE (temp))->identifier.id.str
= (unsigned char *) name;
break;
}
@@ -1090,9 +1063,7 @@ update_non_lazy_ptrs (name)
just emit the stub label now and we don't bother emitting the stub later. */
void
-machopic_output_possible_stub_label (file, name)
- FILE *file;
- const char *name;
+machopic_output_possible_stub_label (FILE *file, const char *name)
{
tree temp;
@@ -1123,8 +1094,7 @@ machopic_output_possible_stub_label (file, name)
stripped name matches the argument. */
static void
-update_stubs (name)
- const char *name;
+update_stubs (const char *name)
{
const char *name1, *name2;
tree temp;
@@ -1132,7 +1102,7 @@ update_stubs (name)
name1 = darwin_strip_name_encoding (name);
for (temp = machopic_stubs;
- temp != NULL_TREE;
+ temp != NULL_TREE;
temp = TREE_CHAIN (temp))
{
const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
@@ -1143,7 +1113,7 @@ update_stubs (name)
if (strcmp (name1, name2) == 0)
{
/* FIXME: This breaks the identifier hash table. */
- IDENTIFIER_NODE_CHECK (TREE_VALUE (temp))->identifier.id.str
+ IDENTIFIER_NODE_CHECK (TREE_VALUE (temp))->identifier.id.str
= (unsigned char *) name;
break;
}
@@ -1152,23 +1122,25 @@ update_stubs (name)
}
void
-machopic_select_section (exp, reloc, align)
- tree exp;
- int reloc;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+machopic_select_section (tree exp, int reloc,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
- if (TREE_CODE (exp) == STRING_CST)
- {
- if (flag_writable_strings)
- data_section ();
- else if ((size_t) TREE_STRING_LENGTH (exp) !=
- strlen (TREE_STRING_POINTER (exp)) + 1)
- readonly_data_section ();
- else
- cstring_section ();
- }
- else if (TREE_CODE (exp) == INTEGER_CST
- || TREE_CODE (exp) == REAL_CST)
+ void (*base_function)(void);
+
+ if (decl_readonly_section_1 (exp, reloc, MACHOPIC_INDIRECT))
+ base_function = readonly_data_section;
+ else if (TREE_READONLY (exp) || TREE_CONSTANT (exp))
+ base_function = const_data_section;
+ else
+ base_function = data_section;
+
+ if (TREE_CODE (exp) == STRING_CST
+ && ((size_t) TREE_STRING_LENGTH (exp)
+ == strlen (TREE_STRING_POINTER (exp)) + 1)
+ && ! flag_writable_strings)
+ cstring_section ();
+ else if ((TREE_CODE (exp) == INTEGER_CST || TREE_CODE (exp) == REAL_CST)
+ && flag_merge_constants)
{
tree size = TYPE_SIZE (TREE_TYPE (exp));
@@ -1181,7 +1153,7 @@ machopic_select_section (exp, reloc, align)
TREE_INT_CST_HIGH (size) == 0)
literal8_section ();
else
- readonly_data_section ();
+ base_function ();
}
else if (TREE_CODE (exp) == CONSTRUCTOR
&& TREE_TYPE (exp)
@@ -1195,16 +1167,8 @@ machopic_select_section (exp, reloc, align)
objc_constant_string_object_section ();
else if (!strcmp (IDENTIFIER_POINTER (name), "NXConstantString"))
objc_string_object_section ();
- else if (TREE_READONLY (exp) || TREE_CONSTANT (exp))
- {
-
- if (TREE_SIDE_EFFECTS (exp) || (MACHOPIC_INDIRECT && reloc))
- const_data_section ();
- else
- readonly_data_section ();
- }
else
- data_section ();
+ base_function ();
}
else if (TREE_CODE (exp) == VAR_DECL &&
DECL_NAME (exp) &&
@@ -1250,6 +1214,8 @@ machopic_select_section (exp, reloc, align)
objc_symbols_section ();
else if (!strncmp (name, "_OBJC_MODULES", 13))
objc_module_info_section ();
+ else if (!strncmp (name, "_OBJC_IMAGE_INFO", 16))
+ objc_image_info_section ();
else if (!strncmp (name, "_OBJC_PROTOCOL_INSTANCE_METHODS_", 32))
objc_cat_inst_meth_section ();
else if (!strncmp (name, "_OBJC_PROTOCOL_CLASS_METHODS_", 29))
@@ -1258,38 +1224,19 @@ machopic_select_section (exp, reloc, align)
objc_cat_cls_meth_section ();
else if (!strncmp (name, "_OBJC_PROTOCOL_", 15))
objc_protocol_section ();
- else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp))
- && !TREE_SIDE_EFFECTS (exp))
- {
-
- if (MACHOPIC_INDIRECT && reloc)
- const_data_section ();
- else
- readonly_data_section ();
- }
else
- data_section ();
- }
- else if (TREE_READONLY (exp) || TREE_CONSTANT (exp))
- {
-
- if (TREE_SIDE_EFFECTS (exp) || (MACHOPIC_INDIRECT && reloc))
- const_data_section ();
- else
- readonly_data_section ();
+ base_function ();
}
else
- data_section ();
+ base_function ();
}
/* This can be called with address expressions as "rtx".
They must go in "const". */
void
-machopic_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+machopic_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
if (GET_MODE_SIZE (mode) == 8)
literal8_section ();
@@ -1297,16 +1244,19 @@ machopic_select_rtx_section (mode, x, align)
&& (GET_CODE (x) == CONST_INT
|| GET_CODE (x) == CONST_DOUBLE))
literal4_section ();
+ else if (MACHOPIC_INDIRECT
+ && (GET_CODE (x) == SYMBOL_REF
+ || GET_CODE (x) == CONST
+ || GET_CODE (x) == LABEL_REF))
+ const_data_section ();
else
const_section ();
}
void
-machopic_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
+machopic_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
{
-
+
if (MACHOPIC_INDIRECT)
mod_init_section ();
else
@@ -1314,17 +1264,15 @@ machopic_asm_out_constructor (symbol, priority)
assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
-
+
if (! MACHOPIC_INDIRECT)
fprintf (asm_out_file, ".reference .constructors_used\n");
}
void
-machopic_asm_out_destructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
+machopic_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
{
-
+
if (MACHOPIC_INDIRECT)
mod_term_section ();
else
@@ -1337,9 +1285,7 @@ machopic_asm_out_destructor (symbol, priority)
}
void
-darwin_globalize_label (stream, name)
- FILE *stream;
- const char *name;
+darwin_globalize_label (FILE *stream, const char *name)
{
if (!!strncmp (name, "_OBJC_", 6))
default_globalize_label (stream, name);
@@ -1355,10 +1301,8 @@ darwin_globalize_label (stream, name)
static int darwin_dwarf_label_counter;
void
-darwin_asm_output_dwarf_delta (file, size, lab1, lab2)
- FILE *file;
- int size ATTRIBUTE_UNUSED;
- const char *lab1, *lab2;
+darwin_asm_output_dwarf_delta (FILE *file, int size ATTRIBUTE_UNUSED,
+ const char *lab1, const char *lab2)
{
const char *p = lab1 + (lab1[0] == '*');
int islocaldiff = (p[0] == 'L');
@@ -1375,7 +1319,7 @@ darwin_asm_output_dwarf_delta (file, size, lab1, lab2)
}
void
-darwin_file_end ()
+darwin_file_end (void)
{
machopic_finish (asm_out_file);
if (strcmp (lang_hooks.name, "GNU C++") == 0)
@@ -1387,4 +1331,3 @@ darwin_file_end ()
}
#include "gt-darwin.h"
-
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 8a959090c56..35415159e49 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -186,6 +186,8 @@ Boston, MA 02111-1307, USA. */
#define LINK_COMMAND_SPEC "\
%{!fdump=*:%{!fsyntax-only:%{!precomp:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%{!Zdynamiclib:%(linker)}%{Zdynamiclib:/usr/bin/libtool} \
+ %{!Zdynamiclib:-arch %(darwin_arch)} \
+ %{Zdynamiclib:-arch_only %(darwin_arch)} \
%l %X %{d} %{s} %{t} %{Z} \
%{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \
%{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
@@ -244,7 +246,7 @@ Boston, MA 02111-1307, USA. */
%{Zmulti_module:-multi_module} %{Zsingle_module:-single_module} \
%{Zmultiply_defined*:-multiply_defined %*} \
%{Zmultiplydefinedunused*:-multiply_defined_unused %*} \
- %{prebind} %{noprebind} %{prebind_all_twolevel_modules} \
+ %{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \
%{read_only_relocs} \
%{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} %{seg_addr_table*} \
%{Zseg_addr_table_filename*:-seg_addr_table_filename %*} \
@@ -356,18 +358,22 @@ do { text_section (); \
#undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
do { \
- const char *xname = NAME; \
- if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \
- xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \
- if ((TREE_STATIC (DECL) \
- && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
- || DECL_INITIAL (DECL)) \
- machopic_define_name (xname); \
- if ((TREE_STATIC (DECL) \
- && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
- || DECL_INITIAL (DECL)) \
+ const char *xname = NAME; \
+ if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \
+ xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \
+ if ((TREE_STATIC (DECL) \
+ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
+ || DECL_INITIAL (DECL)) \
+ machopic_define_name (xname); \
+ if ((TREE_STATIC (DECL) \
+ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
+ || DECL_INITIAL (DECL)) \
(* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \
- ASM_OUTPUT_LABEL (FILE, xname); \
+ ASM_OUTPUT_LABEL (FILE, xname); \
+ /* Darwin doesn't support zero-size objects, so give them a \
+ byte. */ \
+ if (tree_low_cst (DECL_SIZE_UNIT (DECL), 1) == 0) \
+ assemble_zeros (1); \
} while (0)
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
@@ -389,6 +395,15 @@ do { text_section (); \
machopic_output_possible_stub_label (FILE, xname); \
} while (0)
+#define ASM_DECLARE_CONSTANT_NAME(FILE, NAME, EXP, SIZE) \
+ do { \
+ ASM_OUTPUT_LABEL (FILE, NAME); \
+ /* Darwin doesn't support zero-size objects, so give them a \
+ byte. */ \
+ if ((SIZE) == 0) \
+ assemble_zeros (1); \
+ } while (0)
+
/* Wrap new method names in quotes so the assembler doesn't gag.
Make Objective-C internal symbols local. */
@@ -396,7 +411,9 @@ do { text_section (); \
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
do { \
const char *xname = darwin_strip_name_encoding (NAME); \
- if (xname[0] == '&' || xname[0] == '*') \
+ if (! strcmp (xname, "<pic base>")) \
+ machopic_output_function_base_name(FILE); \
+ else if (xname[0] == '&' || xname[0] == '*') \
{ \
int len = strlen (xname); \
if (len > 6 && !strcmp ("$stub", xname + len - 5)) \
@@ -463,9 +480,9 @@ do { text_section (); \
#undef SECTION_FUNCTION
#define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, OBJC) \
-extern void FUNCTION PARAMS ((void)); \
+extern void FUNCTION (void); \
void \
-FUNCTION () \
+FUNCTION (void) \
{ \
if (in_section != SECTION) \
{ \
@@ -493,8 +510,9 @@ FUNCTION () \
in_objc_symbols, in_objc_module_info, \
in_objc_protocol, in_objc_string_object, \
in_objc_constant_string_object, \
+ in_objc_image_info, \
in_objc_class_names, in_objc_meth_var_names, \
- in_objc_meth_var_types, in_objc_cls_refs, \
+ in_objc_meth_var_types, in_objc_cls_refs, \
in_machopic_nl_symbol_ptr, \
in_machopic_lazy_symbol_ptr, \
in_machopic_symbol_stub, \
@@ -506,7 +524,7 @@ FUNCTION () \
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
-static void objc_section_init PARAMS ((void)); \
+static void objc_section_init (void); \
SECTION_FUNCTION (const_section, \
in_const, \
".const", 0) \
@@ -582,6 +600,10 @@ SECTION_FUNCTION (objc_string_object_section, \
SECTION_FUNCTION (objc_constant_string_object_section, \
in_objc_constant_string_object, \
".section __OBJC, __cstring_object", 1) \
+/* Fix-and-Continue image marker. */ \
+SECTION_FUNCTION (objc_image_info_section, \
+ in_objc_image_info, \
+ ".section __OBJC, __image_info", 1) \
SECTION_FUNCTION (objc_class_names_section, \
in_objc_class_names, \
".objc_class_names", 1) \
@@ -597,19 +619,19 @@ SECTION_FUNCTION (objc_cls_refs_section, \
\
SECTION_FUNCTION (machopic_lazy_symbol_ptr_section, \
in_machopic_lazy_symbol_ptr, \
- ".lazy_symbol_pointer", 0) \
+ ".lazy_symbol_pointer", 0) \
SECTION_FUNCTION (machopic_nl_symbol_ptr_section, \
in_machopic_nl_symbol_ptr, \
- ".non_lazy_symbol_pointer", 0) \
+ ".non_lazy_symbol_pointer", 0) \
SECTION_FUNCTION (machopic_symbol_stub_section, \
in_machopic_symbol_stub, \
- ".symbol_stub", 0) \
+ ".symbol_stub", 0) \
SECTION_FUNCTION (machopic_symbol_stub1_section, \
in_machopic_symbol_stub1, \
".section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16", 0)\
SECTION_FUNCTION (machopic_picsymbol_stub_section, \
in_machopic_picsymbol_stub, \
- ".picsymbol_stub", 0) \
+ ".picsymbol_stub", 0) \
SECTION_FUNCTION (machopic_picsymbol_stub1_section, \
in_machopic_picsymbol_stub1, \
".section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32", 0)\
@@ -621,7 +643,7 @@ SECTION_FUNCTION (darwin_eh_frame_section, \
".section __TEXT,__eh_frame", 0) \
\
static void \
-objc_section_init () \
+objc_section_init (void) \
{ \
static int been_here = 0; \
\
@@ -638,7 +660,7 @@ objc_section_init () \
objc_cls_refs_section (); \
objc_class_section (); \
objc_meta_class_section (); \
- /* shared, hot -> cold */ \
+ /* shared, hot -> cold */ \
objc_cls_meth_section (); \
objc_inst_meth_section (); \
objc_protocol_section (); \
@@ -661,7 +683,7 @@ objc_section_init () \
#define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
#define ASM_DECLARE_UNRESOLVED_REFERENCE(FILE,NAME) \
- do { \
+ do { \
if (FILE) { \
if (MACHOPIC_INDIRECT) \
fprintf (FILE, "\t.lazy_reference "); \
@@ -676,7 +698,7 @@ objc_section_init () \
do { \
if (FILE) { \
fprintf (FILE, "\t"); \
- assemble_name (FILE, NAME); \
+ assemble_name (FILE, NAME); \
fprintf (FILE, "=0\n"); \
(*targetm.asm_out.globalize_label) (FILE, NAME); \
} \
@@ -778,7 +800,7 @@ enum machopic_addr_class {
#define TARGET_ASM_EXCEPTION_SECTION darwin_exception_section
#define TARGET_ASM_EH_FRAME_SECTION darwin_eh_frame_section
-
+
#undef ASM_PREFERRED_EH_DATA_FORMAT
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(((CODE) == 2 && (GLOBAL) == 1) \
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 6640f7ad1b4..51c67430535 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -46,7 +46,7 @@ Boston, MA 02111-1307, USA. */
#include "tconfig.h"
#include "coretypes.h"
#include "tm.h"
-#include "fp-bit.h"
+#include "config/fp-bit.h"
/* The following macros can be defined to change the behavior of this file:
FLOAT: Implement a `float', aka SFmode, fp library. If this is not
diff --git a/gcc/config/frv/frv-asm.h b/gcc/config/frv/frv-asm.h
index e8447a6093d..46814278522 100644
--- a/gcc/config/frv/frv-asm.h
+++ b/gcc/config/frv/frv-asm.h
@@ -1,19 +1,19 @@
/* Assembler Support.
Copyright (C) 2000 Free Software Foundation, Inc.
Contributed by Red Hat, 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,
@@ -23,7 +23,7 @@
P2(INSN): Emit INSN.P on the FR500 and above, otherwise emit plain INSN. */
#ifdef __FRV_VLIW__
#ifdef __STDC__
-#define P(A) A##.p
+#define P(A) A.p
#else
#define P(A) A/**/.p
#endif
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 5caf13d7c52..84d6d357a57 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -9649,53 +9649,38 @@ frv_expand_builtin (exp, target, subtarget, mode, ignore)
/* Expand groups of builtins. */
- for (i = 0, d = bdesc_set; i < sizeof (bdesc_set) / sizeof *d; i++, d++)
+ for (i = 0, d = bdesc_set; i < ARRAY_SIZE (bdesc_set); i++, d++)
if (d->code == fcode)
return frv_expand_set_builtin (d->icode, arglist, target);
- for (i = 0, d = bdesc_1arg; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++)
+ for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++)
if (d->code == fcode)
return frv_expand_unop_builtin (d->icode, arglist, target);
- for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++)
+ for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
if (d->code == fcode)
return frv_expand_binop_builtin (d->icode, arglist, target);
- for (i = 0, d = bdesc_cut; i < sizeof (bdesc_cut) / sizeof *d; i++, d++)
+ for (i = 0, d = bdesc_cut; i < ARRAY_SIZE (bdesc_cut); i++, d++)
if (d->code == fcode)
return frv_expand_cut_builtin (d->icode, arglist, target);
- for (i = 0, d = bdesc_2argimm;
- i < sizeof (bdesc_2argimm) / sizeof *d;
- i++, d++)
- {
- if (d->code == fcode)
- return frv_expand_binopimm_builtin (d->icode, arglist, target);
- }
+ for (i = 0, d = bdesc_2argimm; i < ARRAY_SIZE (bdesc_2argimm); i++, d++)
+ if (d->code == fcode)
+ return frv_expand_binopimm_builtin (d->icode, arglist, target);
- for (i = 0, d = bdesc_void2arg;
- i < sizeof (bdesc_void2arg) / sizeof *d;
- i++, d++)
- {
- if (d->code == fcode)
- return frv_expand_voidbinop_builtin (d->icode, arglist);
- }
+ for (i = 0, d = bdesc_void2arg; i < ARRAY_SIZE (bdesc_void2arg); i++, d++)
+ if (d->code == fcode)
+ return frv_expand_voidbinop_builtin (d->icode, arglist);
- for (i = 0, d = bdesc_void3arg;
- i < sizeof (bdesc_void3arg) / sizeof *d;
- i++, d++)
- {
- if (d->code == fcode)
- return frv_expand_voidtriop_builtin (d->icode, arglist);
- }
+ for (i = 0, d = bdesc_void3arg; i < ARRAY_SIZE (bdesc_void3arg); i++, d++)
+ if (d->code == fcode)
+ return frv_expand_voidtriop_builtin (d->icode, arglist);
+
+ for (i = 0, d = bdesc_voidacc; i < ARRAY_SIZE (bdesc_voidacc); i++, d++)
+ if (d->code == fcode)
+ return frv_expand_voidaccop_builtin (d->icode, arglist);
- for (i = 0, d = bdesc_voidacc;
- i < sizeof (bdesc_voidacc) / sizeof *d;
- i++, d++)
- {
- if (d->code == fcode)
- return frv_expand_voidaccop_builtin (d->icode, arglist);
- }
return 0;
}
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index dda5a059e8e..feadc791b9c 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1,5 +1,5 @@
/* Target macros for the FRV port of GCC.
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Red Hat Inc.
This file is part of GCC.
@@ -22,10 +22,6 @@
#ifndef __FRV_H__
#define __FRV_H__
-/* Set up System V.4 (aka ELF) defaults. */
-#include "svr4.h"
-
-
/* Frv general purpose macros. */
/* Align an address. */
#define ADDR_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))
diff --git a/gcc/config/frv/t-frv b/gcc/config/frv/t-frv
index eec05b1ea81..a9130ff0604 100644
--- a/gcc/config/frv/t-frv
+++ b/gcc/config/frv/t-frv
@@ -19,11 +19,11 @@ TARGET_LIBGCC2_CFLAGS =
fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c
- echo '#include "frv/frv-abi.h"' >> fp-bit.c
+ echo '#include "config/frv/frv-abi.h"' >> fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
dp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#include "frv/frv-abi.h"' > dp-bit.c
+ echo '#include "config/frv/frv-abi.h"' > dp-bit.c
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
cmovh.c: $(srcdir)/config/frv/cmovh.c
diff --git a/gcc/config/h8300/coff.h b/gcc/config/h8300/coff.h
new file mode 100644
index 00000000000..7b56a494ac6
--- /dev/null
+++ b/gcc/config/h8300/coff.h
@@ -0,0 +1,56 @@
+/* Definitions of target machine for GNU compiler.
+ Hitachi H8/300 version generating coff
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Steve Chamberlain (sac@cygnus.com),
+ Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.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. */
+
+#ifndef GCC_H8300_COFF_H
+#define GCC_H8300_COFF_H
+
+#define SDB_DEBUGGING_INFO 1
+#define SDB_DELIM "\n"
+
+/* Override definition in dbxcoff.h. */
+/* Generate a blank trailing N_SO to mark the end of the .o file, since
+ we can't depend upon the linker to mark .o file boundaries with
+ embedded stabs. */
+
+#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
+#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
+ fprintf (FILE, \
+ "\t.text\n.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO)
+
+/* This is how to output an assembler line
+ that says to advance the location counter by SIZE bytes. */
+
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME)
+
+#define IDENT_ASM_OP "\t.ident\t"
+#define INIT_SECTION_ASM_OP "\t.section .init"
+#define READONLY_DATA_SECTION_ASM_OP "\t.section .rodata"
+
+/* Switch into a generic section. */
+#define TARGET_ASM_NAMED_SECTION h8300_asm_named_section
+
+/* A bit-field declared as `int' forces `int' alignment for the struct. */
+#define PCC_BITFIELD_TYPE_MATTERS 0
+
+#endif /* h8300/coff.h */
diff --git a/gcc/config/h8300/elf.h b/gcc/config/h8300/elf.h
index 7f67a3a78b1..bae8c265040 100644
--- a/gcc/config/h8300/elf.h
+++ b/gcc/config/h8300/elf.h
@@ -1,25 +1,28 @@
-/* Undefine some macros defined in h8300 that conflict with elfos.h . */
-#undef SDB_DEBUGGING_INFO
-#undef DBX_DEBUGGING_INFO
-#undef ASM_OUTPUT_IDENT
-#undef IDENT_ASM_OP
-#undef CTORS_SECTION_ASM_OP
-#undef DTORS_SECTION_ASM_OP
-#undef INIT_SECTION_ASM_OP
-#undef READONLY_DATA_SECTION_ASM_OP
-#undef TARGET_ASM_NAMED_SECTION
-#undef TARGET_MEM_FUNCTIONS
-#undef PREFERRED_DEBUGGING_TYPE
-/* ??? h8300.h defines PCC_BITFIELD_TYPE_MATTERS to 0, but it
- doesn't define STRUCTURE_SIZE_BOUNDARY, nor does h8300.md
- have a full set of bit field instructions. */
-#undef PCC_BITFIELD_TYPE_MATTERS
-
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
-#include "dbxelf.h"
-#include "elfos.h"
+/* Definitions of target machine for GNU compiler.
+ Hitachi H8/300 version generating elf
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Contributed by Steve Chamberlain (sac@cygnus.com),
+ Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.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. */
+
+#ifndef GCC_H8300_ELF_H
+#define GCC_H8300_ELF_H
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o%s}%{!pg:crtn.o%s}"
@@ -38,3 +41,5 @@
#undef LINK_SPEC
#define LINK_SPEC "%{mh:%{mn:-m h8300hnelf}} %{mh:%{!mn:-m h8300helf}} %{ms:%{mn:-m h8300snelf}} %{ms:%{!mn:-m h8300self}}"
+
+#endif /* h8300/elf.h */
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index d99f0dca0b9..e36ae4b719c 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -98,6 +98,7 @@ extern void h8300_expand_prologue (void);
extern void h8300_expand_epilogue (void);
extern int h8300_current_function_interrupt_function_p (void);
extern int h8300_initial_elimination_offset (int, int);
+extern int h8300_hard_regno_rename_ok (unsigned int, unsigned int);
struct cpp_reader;
extern void h8300_pr_interrupt (struct cpp_reader *);
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 5ab2bfac04d..3d874c2c085 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -4489,6 +4489,23 @@ same_cmp_preceding_p (rtx i3)
return (INSN_P (i1) && 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
+h8300_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
+ unsigned int new_reg)
+{
+ /* Interrupt functions can only use registers that have already been
+ saved by the prologue, even if they would normally be
+ call-clobbered. */
+
+ if (h8300_current_function_interrupt_function_p ()
+ && !regs_ever_live[new_reg])
+ return 0;
+
+ return 1;
+}
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index ba8dcffdeb1..c4103d0464f 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler.
- Hitachi H8/300 version generating coff
+ Hitachi H8/300 (generic)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com),
@@ -257,9 +257,6 @@ extern int target_flags;
structure layouts. */
#define EMPTY_FIELD_BOUNDARY 16
-/* A bit-field declared as `int' forces `int' alignment for the struct. */
-#define PCC_BITFIELD_TYPE_MATTERS 0
-
/* No data type wants to be aligned rounder than this.
32 bit values are aligned as such on the H8/300H and H8S for speed. */
#define BIGGEST_ALIGNMENT \
@@ -353,6 +350,12 @@ extern int target_flags;
&& ((MODE2) == QImode || (MODE2) == HImode \
|| ((TARGET_H8300H || TARGET_H8300S) && (MODE2) == SImode))))
+/* A C expression that is nonzero if hard register NEW_REG can be
+ considered for use as a rename register for OLD_REG register */
+
+#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
+ h8300_hard_regno_rename_ok (OLD_REG, NEW_REG)
+
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
@@ -1038,7 +1041,6 @@ struct cum_arg
#define ASM_APP_OFF "; #NO_APP\n"
#define FILE_ASM_OP "\t.file\n"
-#define IDENT_ASM_OP "\t.ident\t"
/* The assembler op to get a word, 2 bytes for the H8/300, 4 for H8/300H. */
#define ASM_WORD_OP \
@@ -1047,8 +1049,6 @@ struct cum_arg
#define TEXT_SECTION_ASM_OP "\t.section .text"
#define DATA_SECTION_ASM_OP "\t.section .data"
#define BSS_SECTION_ASM_OP "\t.section .bss"
-#define INIT_SECTION_ASM_OP "\t.section .init"
-#define READONLY_DATA_SECTION_ASM_OP "\t.section .rodata"
#undef DO_GLOBAL_CTORS_BODY
#define DO_GLOBAL_CTORS_BODY \
@@ -1086,26 +1086,6 @@ struct cum_arg
{ {"er0", 0}, {"er1", 1}, {"er2", 2}, {"er3", 3}, {"er4", 4}, \
{"er5", 5}, {"er6", 6}, {"er7", 7}, {"r7", 7} }
-#define SDB_DEBUGGING_INFO 1
-#define SDB_DELIM "\n"
-
-/* Support -gstabs. */
-
-#include "dbxcoff.h"
-
-/* Override definition in dbxcoff.h. */
-/* Generate a blank trailing N_SO to mark the end of the .o file, since
- we can't depend upon the linker to mark .o file boundaries with
- embedded stabs. */
-
-#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
-#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
- fprintf (FILE, \
- "\t.text\n.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO)
-
-/* Switch into a generic section. */
-#define TARGET_ASM_NAMED_SECTION h8300_asm_named_section
-
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)
/* Globalizing directive for a label. */
@@ -1158,12 +1138,6 @@ struct cum_arg
if ((LOG) != 0) \
fprintf (FILE, "\t.align %d\n", (LOG))
-/* This is how to output an assembler line
- that says to advance the location counter by SIZE bytes. */
-
-#define ASM_OUTPUT_IDENT(FILE, NAME) \
- fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME)
-
#define ASM_OUTPUT_SKIP(FILE, SIZE) \
fprintf (FILE, "\t.space %d\n", (int)(SIZE))
@@ -1221,7 +1195,7 @@ struct cum_arg
(and ANSI C) library functions `memcpy' and `memset' rather than
the BSD functions `bcopy' and `bzero'. */
-#define TARGET_MEM_FUNCTIONS 1
+#define TARGET_MEM_FUNCTIONS
#define MULHI3_LIBCALL "__mulhi3"
#define DIVHI3_LIBCALL "__divhi3"
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 4ae445c31e6..b17a03ead80 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -652,43 +652,6 @@
(match_dup 3)))]
"operands[3] = GEN_INT (INTVAL (operands[1]) - 16);")
-(define_insn ""
- [(set (cc0)
- (and:HI (match_operand:HI 0 "register_operand" "r")
- (match_operand:HI 1 "single_one_operand" "n")))]
- ""
- "*
-{
- operands[1] = GEN_INT (INTVAL (operands[1]) & 0xffff);
- if (INTVAL (operands[1]) > 128)
- {
- operands[1] = GEN_INT (INTVAL (operands[1]) >> 8);
- return \"btst\\t%V1,%t0\";
- }
- return \"btst\\t%V1,%s0\";
-}"
- [(set_attr "length" "2")
- (set_attr "cc" "set_zn")])
-
-(define_insn ""
- [(set (cc0)
- (and:SI (match_operand:SI 0 "register_operand" "r")
- (match_operand:SI 1 "single_one_operand" "n")))]
- "(TARGET_H8300H || TARGET_H8300S)
- && (INTVAL (operands[1]) & 0xffff) != 0"
- "*
-{
- operands[1] = GEN_INT (INTVAL (operands[1]) & 0xffff);
- if (INTVAL (operands[1]) > 128)
- {
- operands[1] = GEN_INT (INTVAL (operands[1]) >> 8);
- return \"btst\\t%V1,%x0\";
- }
- return \"btst\\t%V1,%w0\";
-}"
- [(set_attr "length" "2")
- (set_attr "cc" "set_zn")])
-
(define_insn "tstqi"
[(set (cc0) (match_operand:QI 0 "register_operand" "r"))]
""
@@ -4120,6 +4083,8 @@
;;
;; dead 0xffffff?? except -1 and -2 eq/ne xor.b and not.l
;; dead 0xffff??ff eq/ne xor.b and not.l
+;; dead 0x40000000 (H8S) eq/ne rotl.l and dec.l
+;; dead 0x80000000 eq/ne rotl.l and dec.l
;;
;; live 1 geu/ltu copy and shar.l
;; live 3 (H8S) geu/ltu copy and shar.l
@@ -4248,6 +4213,34 @@
(pc)))]
"operands[4] = GEN_INT (INTVAL (operands[1]) ^ -1);")
+(define_peephole2
+ [(set (cc0)
+ (compare (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "const_int_operand" "")))
+ (set (pc)
+ (if_then_else (match_operator 3 "eqne_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ "(TARGET_H8300H || TARGET_H8300S)
+ && peep2_reg_dead_p (1, operands[0])
+ && (INTVAL (operands[1]) == -2147483648
+ || (TARGET_H8300S && INTVAL (operands[1]) == 1073741824))"
+ [(set (match_dup 0)
+ (rotate:SI (match_dup 0)
+ (match_dup 4)))
+ (set (match_dup 0)
+ (unspec:SI [(match_dup 0)
+ (const_int -1)]
+ UNSPEC_INCDEC))
+ (set (cc0)
+ (match_dup 0))
+ (set (pc)
+ (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);")
+
;; Transform
;;
;; cmp.l #1,er0
diff --git a/gcc/config/i370/i370.md b/gcc/config/i370/i370.md
index 5bdbec80abe..081c62dd8fa 100644
--- a/gcc/config/i370/i370.md
+++ b/gcc/config/i370/i370.md
@@ -474,10 +474,10 @@ check_label_emit ();
)
;
-; cmpstrsi instruction pattern(s).
+; cmpmemsi instruction pattern(s).
;
-(define_expand "cmpstrsi"
+(define_expand "cmpmemsi"
[(set (match_operand:SI 0 "general_operand" "")
(compare (match_operand:BLK 1 "general_operand" "")
(match_operand:BLK 2 "general_operand" "")))
@@ -545,7 +545,7 @@ check_label_emit ();
emit_move_insn (gen_rtx_SUBREG (SImode, reg2, GET_MODE_SIZE (SImode)), len);
/* Compare! */
- emit_insn (gen_cmpstrsi_1 (result, reg1, reg2));
+ emit_insn (gen_cmpmemsi_1 (result, reg1, reg2));
}
DONE;
}")
@@ -569,7 +569,7 @@ check_label_emit ();
; Compare a block that is larger than 255 bytes in length.
-(define_insn "cmpstrsi_1"
+(define_insn "cmpmemsi_1"
[(set (match_operand:SI 0 "register_operand" "+d")
(compare
(mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "+d") 0))
diff --git a/gcc/config/i370/linux.h b/gcc/config/i370/linux.h
index 730d6b0e996..adc14105947 100644
--- a/gcc/config/i370/linux.h
+++ b/gcc/config/i370/linux.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler. System/370 version.
- Copyright (C) 1989, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993, 1995, 1996, 1997, 2003
+ Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for Linux/390 by Linas Vepstas (linas@linas.org)
@@ -26,11 +27,6 @@ Boston, MA 02111-1307, USA. */
/* Specify that we're generating code for a Linux port to 370 */
#define TARGET_ELF_ABI
-#define LINUX_DEFAULT_ELF
-
-/* Include system common definitions */
-/* TODO: convert include to ${tm_file} list in config.gcc. */
-#include "i370/i370.h"
/* Target OS preprocessor built-ins. */
#define TARGET_OS_CPP_BUILTINS() \
diff --git a/gcc/config/i370/mvs.h b/gcc/config/i370/mvs.h
index 0e29fa4c8f1..0b8a374375f 100644
--- a/gcc/config/i370/mvs.h
+++ b/gcc/config/i370/mvs.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler. System/370 version.
- Copyright (C) 1989, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993, 1995, 1996, 1997, 2003
+ Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
@@ -46,8 +47,3 @@ Boston, MA 02111-1307, USA. */
#else
# define MAYBE_LE370_MACROS()
#endif
-
-/* Include system common definitions */
-
-#include "config/i370/i370.h"
-
diff --git a/gcc/config/i370/oe.h b/gcc/config/i370/oe.h
index afc9bd3073d..9d36ea9bbf5 100644
--- a/gcc/config/i370/oe.h
+++ b/gcc/config/i370/oe.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler. System/370 version.
- Copyright (C) 1989, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993, 1995, 1996, 1997, 2003
+ Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for OS/390 OpenEdition by Dave Pitts (dpitts@cozx.com)
@@ -50,7 +51,3 @@ Boston, MA 02111-1307, USA. */
builtin_assert ("system=unix"); \
} while (0)
-/* Include system common definitions */
-
-#include "config/i370/i370.h"
-
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 2f9b0a1920e..95b894ad217 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -45,7 +45,7 @@ Boston, MA 02111-1307, USA. */
{ "console", 0, N_("Create console application") },\
{ "dll", 0, N_("Generate code for a DLL") }, \
{ "nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, \
- N_("Ignore dllimport for functions") }, \
+ N_("Ignore dllimport for functions") }, \
{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \
{ "threads", 0, N_("Use Mingw-specific thread support") },
@@ -94,7 +94,7 @@ Boston, MA 02111-1307, USA. */
Do not define this macro if it does not need to do anything. */
#undef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS \
+#define SUBTARGET_EXTRA_SPECS \
{ "mingw_include_path", DEFAULT_TARGET_MACHINE }
#undef MATH_LIBRARY
@@ -130,7 +130,7 @@ drectve_section () \
in_section = in_drectve; \
} \
}
-void drectve_section PARAMS ((void));
+void drectve_section (void);
/* Switch to SECTION (an `enum in_section').
@@ -138,21 +138,19 @@ void drectve_section PARAMS ((void));
The problem is that we want to temporarily switch sections in
ASM_DECLARE_OBJECT_NAME and then switch back to the original section
afterwards. */
-#define SWITCH_TO_SECTION_FUNCTION \
-void switch_to_section PARAMS ((enum in_section, tree)); \
-void \
-switch_to_section (section, decl) \
- enum in_section section; \
- tree decl; \
-{ \
- switch (section) \
- { \
- case in_text: text_section (); break; \
- case in_data: data_section (); break; \
- case in_named: named_section (decl, NULL, 0); break; \
- case in_drectve: drectve_section (); break; \
- default: abort (); break; \
- } \
+#define SWITCH_TO_SECTION_FUNCTION \
+void switch_to_section (enum in_section, tree); \
+void \
+switch_to_section (enum in_section section, tree decl) \
+{ \
+ switch (section) \
+ { \
+ case in_text: text_section (); break; \
+ case in_data: data_section (); break; \
+ case in_named: named_section (decl, NULL, 0); break; \
+ case in_drectve: drectve_section (); break; \
+ default: abort (); break; \
+ } \
}
/* Don't allow flag_pic to propagate since gas may produce invalid code
@@ -173,15 +171,15 @@ do { \
differently depending on something about the variable or
function named by the symbol (such as what section it is in).
- On i386 running Windows NT, modify the assembler name with a suffix
+ On i386 running Windows NT, modify the assembler name with a suffix
consisting of an atsign (@) followed by string of digits that represents
- the number of bytes of arguments passed to the function, if it has the
+ the number of bytes of arguments passed to the function, if it has the
attribute STDCALL.
- In addition, we must mark dll symbols specially. Definitions of
- dllexport'd objects install some info in the .drectve section.
+ In addition, we must mark dll symbols specially. Definitions of
+ dllexport'd objects install some info in the .drectve section.
References to dllimport'd objects are fetched indirectly via
- _imp__. If both are declared, dllexport overrides. This is also
+ _imp__. If both are declared, dllexport overrides. This is also
needed to implement one-only vtables: they go into their own
section and we need to set DECL_SECTION_NAME so we do that here.
Note that we can be called twice on the same decl. */
@@ -203,7 +201,7 @@ do { \
i386_pe_record_exported_symbol (NAME, 1); \
if (! i386_pe_dllimport_name_p (NAME)) \
{ \
- fprintf ((STREAM), "\t.comm\t"); \
+ fprintf ((STREAM), "\t.comm\t"); \
assemble_name ((STREAM), (NAME)); \
fprintf ((STREAM), ", %d\t%s %d\n", \
(int)(ROUNDED), ASM_COMMENT_START, (int)(SIZE)); \
@@ -212,7 +210,7 @@ do { \
/* Output the label for an initialized variable. */
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
+#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
do { \
if (i386_pe_dllexport_name_p (NAME)) \
i386_pe_record_exported_symbol (NAME, 1); \
@@ -248,7 +246,7 @@ do { \
symbols must be explicitly imported from shared libraries (DLLs). */
#define MULTIPLE_SYMBOL_SPACES
-extern void i386_pe_unique_section PARAMS ((TREE, int));
+extern void i386_pe_unique_section (TREE, int);
#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
#define SUPPORTS_ONE_ONLY 1
@@ -328,12 +326,12 @@ extern void i386_pe_unique_section PARAMS ((TREE, int));
/* External function declarations. */
-extern void i386_pe_record_external_function PARAMS ((const char *));
-extern void i386_pe_declare_function_type PARAMS ((FILE *, const char *, int));
-extern void i386_pe_record_exported_symbol PARAMS ((const char *, int));
-extern void i386_pe_file_end PARAMS ((void));
-extern int i386_pe_dllexport_name_p PARAMS ((const char *));
-extern int i386_pe_dllimport_name_p PARAMS ((const char *));
+extern void i386_pe_record_external_function (const char *);
+extern void i386_pe_declare_function_type (FILE *, const char *, int);
+extern void i386_pe_record_exported_symbol (const char *, int);
+extern void i386_pe_file_end (void);
+extern int i386_pe_dllexport_name_p (const char *);
+extern int i386_pe_dllimport_name_p (const char *);
/* For Win32 ABI compatibility */
#undef DEFAULT_PCC_STRUCT_RETURN
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index ea505741f3c..6fe7e197e58 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -20,7 +20,7 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define TARGET_VERSION fprintf (stderr, " (x86 Cygwin)");
+#define TARGET_VERSION fprintf (stderr, " (x86 Cygwin)");
#define EXTRA_OS_CPP_BUILTINS() /* Nothing. */
@@ -81,7 +81,7 @@ Boston, MA 02111-1307, USA. */
#ifndef CYGWIN_MINGW_SUBDIR
#define CYGWIN_MINGW_SUBDIR "/mingw"
-#endif
+#endif
#define CYGWIN_MINGW_SUBDIR_LEN (sizeof (CYGWIN_MINGW_SUBDIR) - 1)
#ifdef GPLUSPLUS_INCLUDE_DIR
@@ -199,7 +199,7 @@ char *cvt_to_mingw[] =
#undef GEN_CVT_ARRAY
#endif /*GEN_CVT_ARRAY*/
-void mingw_scan PARAMS ((int, const char * const *, char **));
+void mingw_scan (int, const char * const *, char **);
#if 1
#define GCC_DRIVER_HOST_INITIALIZATION \
do \
diff --git a/gcc/config/i386/cygwin2.c b/gcc/config/i386/cygwin2.c
index 39bcd71ecd6..598aa0fec16 100644
--- a/gcc/config/i386/cygwin2.c
+++ b/gcc/config/i386/cygwin2.c
@@ -28,13 +28,13 @@ Boston, MA 02111-1307, USA. */
#include <string.h>
/*
-static void remove_w32api PARAMS ((void));
+static void remove_w32api (void);
*/
-static void add_mingw PARAMS ((void));
-static void set_mingw PARAMS((void)) __attribute__ ((constructor));
+static void add_mingw (void);
+static void set_mingw (void) __attribute__ ((constructor));
static void
-add_mingw ()
+add_mingw (void)
{
char **av;
char *p;
@@ -59,7 +59,7 @@ add_mingw ()
static void
-set_mingw ()
+set_mingw (void)
{
char *env = getenv ("GCC_CYGWIN_MINGW");
if (env && *env == '1')
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 2e68be81c6f..3b70de4f1bc 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -41,6 +41,16 @@ Boston, MA 02111-1307, USA. */
#undef CC1_SPEC
#define CC1_SPEC "%{!static:-fPIC}"
+#define ASM_SPEC "-arch i386 \
+ %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
+ %{!Zforce_cpusubtype_ALL:%{mmmx:-force_cpusubtype_ALL}\
+ %{msse:-force_cpusubtype_ALL}\
+ %{msse2:-force_cpusubtype_ALL}}"
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "darwin_arch", "i386" },
+
/* The Darwin assembler mostly follows AT&T syntax. */
#undef ASSEMBLER_DIALECT
#define ASSEMBLER_DIALECT ASM_ATT
diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
index 52dcf1bc4c2..9cd46f28167 100644
--- a/gcc/config/i386/freebsd.h
+++ b/gcc/config/i386/freebsd.h
@@ -26,19 +26,16 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
/* Override the default comment-starter of "/". */
-#undef ASM_COMMENT_START
+#undef ASM_COMMENT_START
#define ASM_COMMENT_START "#"
-#undef ASM_APP_ON
+#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"
-#undef ASM_APP_OFF
+#undef ASM_APP_OFF
#define ASM_APP_OFF "#NO_APP\n"
-#undef SET_ASM_OP
-#define SET_ASM_OP "\t.set\t"
-
-#undef DBX_REGISTER_NUMBER
+#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
(TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
@@ -47,19 +44,19 @@ Boston, MA 02111-1307, USA. */
/* Tell final.c that we don't need a label passed to mcount. */
-#undef MCOUNT_NAME
+#undef MCOUNT_NAME
#define MCOUNT_NAME ".mcount"
/* Make gcc agree with <machine/ansi.h>. */
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
+#undef SIZE_TYPE
+#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
the magical crtbegin.o file (see crtstuff.c) which provides part
@@ -119,6 +116,7 @@ Boston, MA 02111-1307, USA. */
This is used to align code labels according to Intel recommendations. */
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+#undef ASM_OUTPUT_MAX_SKIP_ALIGN
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
if ((LOG) != 0) { \
if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
@@ -138,8 +136,10 @@ Boston, MA 02111-1307, USA. */
compiler get the contents of <float.h> and std::numeric_limits correct. */
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
- real_format_for_mode[XFmode - QFmode] \
- = &ieee_extended_intel_96_round_53_format; \
- real_format_for_mode[TFmode - QFmode] \
- = &ieee_extended_intel_96_round_53_format; \
+ if (!TARGET_64BIT) { \
+ real_format_for_mode[XFmode - QFmode] \
+ = &ieee_extended_intel_96_round_53_format; \
+ real_format_for_mode[TFmode - QFmode] \
+ = &ieee_extended_intel_96_round_53_format; \
+ } \
} while (0)
diff --git a/gcc/config/i386/gthr-win32.c b/gcc/config/i386/gthr-win32.c
index 06dc2045d24..5510f108ca4 100644
--- a/gcc/config/i386/gthr-win32.c
+++ b/gcc/config/i386/gthr-win32.c
@@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef __GTHREAD_HIDE_WIN32API
-# define __GTHREAD_HIDE_WIN32API
+# define __GTHREAD_HIDE_WIN32API 1
#endif
#include <gthr-win32.h>
#include <windows.h>
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index 5507649ac42..664cda19b30 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -1,5 +1,5 @@
/* Target definitions for GNU compiler for Intel 80386 running Interix
- Parts Copyright (C) 1991, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Parts Copyright (C) 1991, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Parts:
by Douglas B. Rupp (drupp@cs.washington.edu).
@@ -341,7 +341,7 @@ while (0)
symbols must be explicitly imported from shared libraries (DLLs). */
#define MULTIPLE_SYMBOL_SPACES
-extern void i386_pe_unique_section PARAMS ((tree, int));
+extern void i386_pe_unique_section (tree, int);
#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
#define SUPPORTS_ONE_ONLY 1
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2e13624af1a..c1e8ac6c894 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -866,7 +866,7 @@ static unsigned int ix86_select_alt_pic_regnum (void);
static int ix86_save_reg (unsigned int, int);
static void ix86_compute_frame_layout (struct ix86_frame *);
static int ix86_comp_type_attributes (tree, tree);
-static int ix86_fntype_regparm (tree);
+static int ix86_function_regparm (tree, tree);
const struct attribute_spec ix86_attribute_table[];
static bool ix86_function_ok_for_sibcall (tree, tree);
static tree ix86_handle_cdecl_attribute (tree *, tree, tree, int, bool *);
@@ -1532,19 +1532,14 @@ ix86_function_ok_for_sibcall (tree decl, tree exp)
such registers are not used for passing parameters. */
if (!decl && !TARGET_64BIT)
{
- int regparm = ix86_regparm;
- tree attr, type;
+ tree type;
/* We're looking at the CALL_EXPR, we need the type of the function. */
type = TREE_OPERAND (exp, 0); /* pointer expression */
type = TREE_TYPE (type); /* pointer type */
type = TREE_TYPE (type); /* function type */
- attr = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type));
- if (attr)
- regparm = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
-
- if (regparm >= 3)
+ if (ix86_function_regparm (type, NULL) >= 3)
{
/* ??? Need to count the actual number of registers to be used,
not the possible number of registers. Fix later. */
@@ -1637,9 +1632,9 @@ ix86_handle_regparm_attribute (tree *node, tree name, tree args,
}
if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node)))
- {
- error ("fastcall and regparm attributes are not compatible");
- }
+ {
+ error ("fastcall and regparm attributes are not compatible");
+ }
}
return NULL_TREE;
@@ -1670,18 +1665,49 @@ ix86_comp_type_attributes (tree type1, tree type2)
return 1;
}
-/* Return the regparm value for a fuctio with the indicated TYPE. */
+/* 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. */
static int
-ix86_fntype_regparm (tree type)
+ix86_function_regparm (tree type, tree decl)
{
tree attr;
+ int regparm = ix86_regparm;
+ bool user_convention = false;
- attr = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type));
- if (attr)
- return TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
- else
- return ix86_regparm;
+ if (!TARGET_64BIT)
+ {
+ attr = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type));
+ if (attr)
+ {
+ regparm = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
+ user_convention = true;
+ }
+
+ if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type)))
+ {
+ regparm = 2;
+ user_convention = true;
+ }
+
+ /* Use register calling convention for local functions when possible. */
+ if (!TARGET_64BIT && !user_convention && decl
+ && flag_unit_at_a_time)
+ {
+ struct cgraph_local_info *i = cgraph_local_info (decl);
+ if (i && i->local)
+ {
+ /* We can't use regparm(3) for nested functions as these use
+ static chain pointer in third argument. */
+ if (DECL_CONTEXT (decl) && !DECL_NO_STATIC_CHAIN (decl))
+ regparm = 2;
+ else
+ regparm = 3;
+ }
+ }
+ }
+ return regparm;
}
/* Value is the number of bytes of arguments automatically
@@ -1722,10 +1748,10 @@ ix86_return_pops_args (tree fundecl, tree funtype, int size)
}
/* Lose any fake structure return argument if it is passed on the stack. */
- if (aggregate_value_p (TREE_TYPE (funtype))
+ if (aggregate_value_p (TREE_TYPE (funtype), fundecl)
&& !TARGET_64BIT)
{
- int nregs = ix86_fntype_regparm (funtype);
+ int nregs = ix86_function_regparm (funtype, fundecl);
if (!nregs)
return GET_MODE_SIZE (Pmode);
@@ -1767,7 +1793,6 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
{
static CUMULATIVE_ARGS zero_cum;
tree param, next_param;
- bool user_convention = false;
if (TARGET_DEBUG_ARG)
{
@@ -1786,18 +1811,11 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
*cum = zero_cum;
/* Set up the number of registers to use for passing arguments. */
- cum->nregs = ix86_regparm;
+ if (fntype)
+ cum->nregs = ix86_function_regparm (fntype, fndecl);
+ else
+ cum->nregs = ix86_regparm;
cum->sse_nregs = SSE_REGPARM_MAX;
- if (fntype && !TARGET_64BIT)
- {
- tree attr = lookup_attribute ("regparm", TYPE_ATTRIBUTES (fntype));
-
- if (attr)
- {
- cum->nregs = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
- user_convention = true;
- }
- }
cum->maybe_vaarg = false;
/* Use ecx and edx registers if function has fastcall attribute */
@@ -1807,23 +1825,6 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
{
cum->nregs = 2;
cum->fastcall = 1;
- user_convention = true;
- }
- }
-
- /* Use register calling convention for local functions when possible. */
- if (!TARGET_64BIT && !user_convention && fndecl
- && flag_unit_at_a_time)
- {
- struct cgraph_local_info *i = cgraph_local_info (fndecl);
- if (i && i->local)
- {
- /* We can't use regparm(3) for nested functions as these use
- static chain pointer in third argument. */
- if (DECL_CONTEXT (fndecl) && !DECL_NO_STATIC_CHAIN (fndecl))
- cum->nregs = 2;
- else
- cum->nregs = 3;
}
}
@@ -2501,7 +2502,7 @@ function_arg (CUMULATIVE_ARGS *cum, /* current arg information */
/* ECX not EAX is the first allocated register. */
if (regno == 0)
- regno = 2;
+ regno = 2;
}
ret = gen_rtx_REG (mode, regno);
}
@@ -2610,8 +2611,8 @@ contains_128bit_aligned_vector_p (tree type)
return false;
}
-/* Gives the alignment boundary, in bits, of an argument with the specified mode
- and type. */
+/* Gives the alignment boundary, in bits, of an argument with the
+ specified mode and type. */
int
ix86_function_arg_boundary (enum machine_mode mode, tree type)
@@ -2642,8 +2643,6 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type)
if (!contains_128bit_aligned_vector_p (type))
align = PARM_BOUNDARY;
}
- if (align != PARM_BOUNDARY && !TARGET_SSE)
- abort();
}
if (align > 128)
align = 128;
@@ -2692,29 +2691,59 @@ ix86_function_value (tree valtype)
int
ix86_return_in_memory (tree type)
{
- int needed_intregs, needed_sseregs;
+ int needed_intregs, needed_sseregs, size;
+ enum machine_mode mode = TYPE_MODE (type);
+
if (TARGET_64BIT)
+ return !examine_argument (mode, type, 1, &needed_intregs, &needed_sseregs);
+
+ if (mode == BLKmode)
+ return 1;
+
+ size = int_size_in_bytes (type);
+
+ if (MS_AGGREGATE_RETURN && AGGREGATE_TYPE_P (type) && size <= 8)
+ return 0;
+
+ if (VECTOR_MODE_P (mode) || mode == TImode)
{
- return !examine_argument (TYPE_MODE (type), type, 1,
- &needed_intregs, &needed_sseregs);
- }
- else
- {
- if (TYPE_MODE (type) == BLKmode)
- return 1;
- else if (MS_AGGREGATE_RETURN
- && AGGREGATE_TYPE_P (type)
- && int_size_in_bytes(type) <= 8)
+ /* User-created vectors small enough to fit in EAX. */
+ if (size < 8)
return 0;
- else if ((VECTOR_MODE_P (TYPE_MODE (type))
- && int_size_in_bytes (type) == 8)
- || (int_size_in_bytes (type) > 12
- && TYPE_MODE (type) != TImode
- && TYPE_MODE (type) != TFmode
- && !VECTOR_MODE_P (TYPE_MODE (type))))
+
+ /* MMX/3dNow values are returned on the stack, since we've
+ got to EMMS/FEMMS before returning. */
+ if (size == 8)
return 1;
- return 0;
+
+ /* SSE values are returned in XMM0. */
+ /* ??? Except when it doesn't exist? We have a choice of
+ either (1) being abi incompatible with a -march switch,
+ or (2) generating an error here. Given no good solution,
+ I think the safest thing is one warning. The user won't
+ be able to use -Werror, but... */
+ if (size == 16)
+ {
+ static bool warned;
+
+ if (TARGET_SSE)
+ return 0;
+
+ if (!warned)
+ {
+ warned = true;
+ warning ("SSE vector return without SSE enabled "
+ "changes the ABI");
+ }
+ return 1;
+ }
}
+
+ if (mode == TFmode)
+ return 0;
+ if (size > 12)
+ return 1;
+ return 0;
}
/* Define how to find the value returned by a library function
@@ -2747,10 +2776,14 @@ ix86_libcall_value (enum machine_mode mode)
static int
ix86_value_regno (enum machine_mode mode)
{
+ /* Floating point return values in %st(0). */
if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_FLOAT_RETURNS_IN_80387)
return FIRST_FLOAT_REG;
- if (mode == TImode || VECTOR_MODE_P (mode))
+ /* 16-byte vector modes in %xmm0. See ix86_return_in_memory for where
+ we prevent this case when sse is not available. */
+ if (mode == TImode || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16))
return FIRST_SSE_REG;
+ /* Everything else in %eax. */
return 0;
}
@@ -3344,7 +3377,7 @@ x86_64_zext_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
int
const_int_1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
- return (GET_CODE (op) == CONST_INT && INTVAL (op) == 1);
+ return op == const1_rtx;
}
/* Return nonzero if OP is CONST_INT >= 1 and <= 31 (a valid operand
@@ -3412,7 +3445,12 @@ pic_symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
op = XEXP (op, 0);
if (TARGET_64BIT)
{
- if (GET_CODE (XEXP (op, 0)) == UNSPEC)
+ if (GET_CODE (op) == UNSPEC
+ && XINT (op, 1) == UNSPEC_GOTPCREL)
+ return 1;
+ if (GET_CODE (op) == PLUS
+ && GET_CODE (XEXP (op, 0)) == UNSPEC
+ && XINT (XEXP (op, 0), 1) == UNSPEC_GOTPCREL)
return 1;
}
else
@@ -3592,6 +3630,32 @@ const248_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
&& (INTVAL (op) == 2 || INTVAL (op) == 4 || INTVAL (op) == 8));
}
+int
+const_0_to_3_operand (register 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)
+{
+ 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)
+{
+ 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)
+{
+ return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 256);
+}
+
+
/* True if this is a constant appropriate for an increment or decrement. */
int
@@ -5658,15 +5722,23 @@ legitimate_pic_address_disp_p (register rtx disp)
if (GET_CODE (disp) == LABEL_REF)
return 1;
if (GET_CODE (disp) == CONST
- && GET_CODE (XEXP (disp, 0)) == PLUS
- && ((GET_CODE (XEXP (XEXP (disp, 0), 0)) == SYMBOL_REF
- && ix86_cmodel == CM_SMALL_PIC
- && SYMBOL_REF_LOCAL_P (XEXP (XEXP (disp, 0), 0)))
- || GET_CODE (XEXP (XEXP (disp, 0), 0)) == LABEL_REF)
- && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT
- && INTVAL (XEXP (XEXP (disp, 0), 1)) < 16*1024*1024
- && INTVAL (XEXP (XEXP (disp, 0), 1)) >= -16*1024*1024)
- return 1;
+ && GET_CODE (XEXP (disp, 0)) == PLUS)
+ {
+ rtx op0 = XEXP (XEXP (disp, 0), 0);
+ rtx op1 = XEXP (XEXP (disp, 0), 1);
+
+ /* TLS references should always be enclosed in UNSPEC. */
+ if (tls_symbolic_operand (op0, GET_MODE (op0)))
+ return 0;
+ if (((GET_CODE (op0) == SYMBOL_REF
+ && ix86_cmodel == CM_SMALL_PIC
+ && SYMBOL_REF_LOCAL_P (op0))
+ || GET_CODE (op0) == LABEL_REF)
+ && GET_CODE (op1) == CONST_INT
+ && INTVAL (op1) < 16*1024*1024
+ && INTVAL (op1) >= -16*1024*1024)
+ return 1;
+ }
}
if (GET_CODE (disp) != CONST)
return 0;
@@ -5703,7 +5775,7 @@ legitimate_pic_address_disp_p (register rtx disp)
if (GET_CODE (XEXP (disp, 1)) == SYMBOL_REF)
{
const char *sym_name = XSTR (XEXP (disp, 1), 0);
- if (strstr (sym_name, "$pb") != 0)
+ if (! strcmp (sym_name, "<pic base>"))
return 1;
}
}
@@ -6948,8 +7020,8 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
C -- print opcode suffix for set/cmov insn.
c -- like C, but print reversed condition
F,f -- likewise, but for floating-point.
- O -- if CMOV_SUN_AS_SYNTAX, expand to "w.", "l." or "q.", otherwise
- nothing
+ O -- if HAVE_AS_IX86_CMOV_SUN_SYNTAX, expand to "w.", "l." or "q.",
+ otherwise nothing
R -- print the prefix for register names.
z -- print the opcode suffix for the size of the current operand.
* -- print a star (in certain assembler syntax)
@@ -7150,7 +7222,7 @@ print_operand (FILE *file, rtx x, int code)
}
return;
case 'O':
-#ifdef CMOV_SUN_AS_SYNTAX
+#ifdef HAVE_AS_IX86_CMOV_SUN_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
{
switch (GET_MODE (x))
@@ -7170,7 +7242,7 @@ print_operand (FILE *file, rtx x, int code)
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 0, 0, file);
return;
case 'F':
-#ifdef CMOV_SUN_AS_SYNTAX
+#ifdef HAVE_AS_IX86_CMOV_SUN_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('.', file);
#endif
@@ -7189,7 +7261,7 @@ print_operand (FILE *file, rtx x, int code)
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 0, file);
return;
case 'f':
-#ifdef CMOV_SUN_AS_SYNTAX
+#ifdef HAVE_AS_IX86_CMOV_SUN_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('.', file);
#endif
@@ -8015,8 +8087,11 @@ ix86_output_addr_diff_elt (FILE *file, int value, int rel)
fprintf (file, "%s%s%d@GOTOFF\n", ASM_LONG, LPREFIX, value);
#if TARGET_MACHO
else if (TARGET_MACHO)
- fprintf (file, "%s%s%d-%s\n", ASM_LONG, LPREFIX, value,
- machopic_function_base_name () + 1);
+ {
+ fprintf (file, "%s%s%d-", ASM_LONG, LPREFIX, value);
+ machopic_output_function_base_name (file);
+ fprintf(file, "\n");
+ }
#endif
else
asm_fprintf (file, "%s%U%s+[.-%s%d]\n",
@@ -9394,25 +9469,32 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop)
}
break;
- /* Convert a>0 into (unsigned)a<0x7fffffff. */
+ /* Convert a>=0 into (unsigned)a<0x80000000. */
case LT:
case GE:
if (mode == DImode || op1 != const0_rtx)
return false;
- op1 = gen_int_mode (~(1 << (GET_MODE_BITSIZE (mode) - 1)), mode);
+ op1 = gen_int_mode (1 << (GET_MODE_BITSIZE (mode) - 1), mode);
code = (code == LT ? GEU : LTU);
break;
case LE:
case GT:
if (mode == DImode || op1 != constm1_rtx)
return false;
- op1 = gen_int_mode (~(1 << (GET_MODE_BITSIZE (mode) - 1)), mode);
+ op1 = gen_int_mode (1 << (GET_MODE_BITSIZE (mode) - 1), mode);
code = (code == LE ? GEU : LTU);
break;
default:
return false;
}
+ /* Swapping operands may cause constant to appear as first operand. */
+ if (!nonimmediate_operand (op0, VOIDmode))
+ {
+ if (no_new_pseudos)
+ return false;
+ op0 = force_reg (mode, op0);
+ }
ix86_compare_op0 = op0;
ix86_compare_op1 = op1;
*pop = ix86_expand_compare (code, NULL, NULL);
@@ -11572,10 +11654,15 @@ memory_address_length (rtx addr)
disp = parts.disp;
len = 0;
+ /* Rule of thumb:
+ - esp as the base always wants an index,
+ - ebp as the base always wants a displacement. */
+
/* Register Indirect. */
if (base && !index && !disp)
{
- /* Special cases: ebp and esp need the two-byte modrm form. */
+ /* esp (for its index) and ebp (for its displacement) need
+ the two-byte modrm form. */
if (addr == stack_pointer_rtx
|| addr == arg_pointer_rtx
|| addr == frame_pointer_rtx
@@ -11599,9 +11686,16 @@ memory_address_length (rtx addr)
else
len = 4;
}
+ /* ebp always wants a displacement. */
+ else if (base == hard_frame_pointer_rtx)
+ len = 1;
- /* An index requires the two-byte modrm form. */
- if (index)
+ /* An index requires the two-byte modrm form... */
+ if (index
+ /* ...like esp, which always wants an index. */
+ || base == stack_pointer_rtx
+ || base == arg_pointer_rtx
+ || base == frame_pointer_rtx)
len += 1;
}
@@ -13488,7 +13582,8 @@ ix86_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target)
/* In case the insn wants input operands in modes different from
the result, abort. */
- if (GET_MODE (op0) != mode0 || GET_MODE (op1) != mode1)
+ if ((GET_MODE (op0) != mode0 && GET_MODE (op0) != VOIDmode)
+ || (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode))
abort ();
if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
@@ -13753,8 +13848,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
op0 = copy_to_mode_reg (mode0, op0);
if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
{
- /* @@@ better error message */
- error ("selector must be an immediate");
+ error ("selector must be an integer constant in the range 0..%i",
+ fcode == IX86_BUILTIN_PEXTRW ? 3:7);
return gen_reg_rtx (tmode);
}
if (target == 0
@@ -13789,8 +13884,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
op1 = copy_to_mode_reg (mode1, op1);
if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
{
- /* @@@ better error message */
- error ("selector must be an immediate");
+ error ("selector must be an integer constant in the range 0..%i",
+ fcode == IX86_BUILTIN_PINSRW ? 15:255);
return const0_rtx;
}
if (target == 0
@@ -15067,11 +15162,11 @@ x86_this_parameter (tree function)
if (TARGET_64BIT)
{
- int n = aggregate_value_p (TREE_TYPE (type)) != 0;
+ int n = aggregate_value_p (TREE_TYPE (type), type) != 0;
return gen_rtx_REG (DImode, x86_64_int_parameter_registers[n]);
}
- if (ix86_fntype_regparm (type) > 0)
+ if (ix86_function_regparm (type, function) > 0)
{
tree parm;
@@ -15081,12 +15176,17 @@ x86_this_parameter (tree function)
for (; parm; parm = TREE_CHAIN (parm))
if (TREE_VALUE (parm) == void_type_node)
break;
- /* If not, the this parameter is in %eax. */
+ /* If not, the this parameter is in the first argument. */
if (parm)
- return gen_rtx_REG (SImode, 0);
+ {
+ int regno = 0;
+ if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type)))
+ regno = 2;
+ return gen_rtx_REG (SImode, 0);
+ }
}
- if (aggregate_value_p (TREE_TYPE (type)))
+ if (aggregate_value_p (TREE_TYPE (type), type))
return gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx, 8));
else
return gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx, 4));
@@ -15104,7 +15204,7 @@ x86_can_output_mi_thunk (tree thunk ATTRIBUTE_UNUSED,
return true;
/* For 32-bit, everything's fine if we have one free register. */
- if (ix86_fntype_regparm (TREE_TYPE (function)) < 3)
+ if (ix86_function_regparm (TREE_TYPE (function), function) < 3)
return true;
/* Need a free register for vcall_offset. */
@@ -15175,7 +15275,13 @@ x86_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
if (TARGET_64BIT)
tmp = gen_rtx_REG (DImode, FIRST_REX_INT_REG + 2 /* R10 */);
else
- tmp = gen_rtx_REG (SImode, 2 /* ECX */);
+ {
+ int tmp_regno = 2 /* ECX */;
+ if (lookup_attribute ("fastcall",
+ TYPE_ATTRIBUTES (TREE_TYPE (function))))
+ tmp_regno = 0 /* EAX */;
+ tmp = gen_rtx_REG (SImode, tmp_regno);
+ }
xops[0] = gen_rtx_MEM (Pmode, this_reg);
xops[1] = tmp;
@@ -15515,17 +15621,22 @@ x86_extended_reg_mentioned_p (rtx insn)
return for_each_rtx (&PATTERN (insn), extended_reg_mentioned_1, NULL);
}
-/* Generate an unsigned DImode to FP conversion. This is the same code
+/* Generate an unsigned DImode/SImode to FP conversion. This is the same code
optabs would emit if we didn't have TFmode patterns. */
void
x86_emit_floatuns (rtx operands[2])
{
rtx neglab, donelab, i0, i1, f0, in, out;
- enum machine_mode mode;
+ enum machine_mode mode, inmode;
+
+ inmode = GET_MODE (operands[1]);
+ if (inmode != SImode
+ && inmode != DImode)
+ abort ();
out = operands[0];
- in = force_reg (DImode, operands[1]);
+ in = force_reg (inmode, operands[1]);
mode = GET_MODE (out);
neglab = gen_label_rtx ();
donelab = gen_label_rtx ();
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 343cfd17472..718c52530e2 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1135,7 +1135,7 @@ do { \
#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
(CC_REGNO_P (REGNO) ? VOIDmode \
: (MODE) == VOIDmode && (NREGS) != 1 ? VOIDmode \
- : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS)) \
+ : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS), false)\
: (MODE) == HImode && !TARGET_PARTIAL_REG_STALL ? SImode \
: (MODE) == QImode && (REGNO) >= 4 && !TARGET_64BIT ? SImode \
: (MODE))
@@ -3018,6 +3018,10 @@ do { \
{"const0_operand", {CONST_INT, CONST_DOUBLE}}, \
{"const1_operand", {CONST_INT}}, \
{"const248_operand", {CONST_INT}}, \
+ {"const_0_to_3_operand", {CONST_INT}}, \
+ {"const_0_to_7_operand", {CONST_INT}}, \
+ {"const_0_to_15_operand", {CONST_INT}}, \
+ {"const_0_to_255_operand", {CONST_INT}}, \
{"incdec_operand", {CONST_INT}}, \
{"mmx_reg_operand", {REG}}, \
{"reg_no_sp_operand", {SUBREG, REG}}, \
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 32da30a19c9..9ee1d7d6c50 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -351,7 +351,7 @@
(if_then_else (match_operand 1 "constant_call_address_operand" "")
(const_string "none")
(const_string "load"))
- (and (eq_attr "type" "alu1,negnot")
+ (and (eq_attr "type" "alu1,negnot,ishift1")
(match_operand 1 "memory_operand" ""))
(const_string "both")
(and (match_operand 0 "memory_operand" "")
@@ -362,7 +362,7 @@
(match_operand 1 "memory_operand" "")
(const_string "load")
(and (eq_attr "type"
- "!alu1,negnot,
+ "!alu1,negnot,ishift1,
imov,imovx,icmp,test,
fmov,fcmp,fsgn,
sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt,
@@ -1166,8 +1166,8 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "immediate_operand" "i"))
(clobber (reg:CC 17))]
- "reload_completed && GET_CODE (operands[1]) == CONST_INT
- && INTVAL (operands[1]) == -1
+ "reload_completed
+ && operands[1] == constm1_rtx
&& (TARGET_PENTIUM || optimize_size)"
{
operands[1] = constm1_rtx;
@@ -1930,8 +1930,7 @@
(clobber (reg:CC 17))]
"TARGET_64BIT && (TARGET_PENTIUM || optimize_size)
&& reload_completed
- && GET_CODE (operands[1]) == CONST_INT
- && INTVAL (operands[1]) == -1"
+ && operands[1] == constm1_rtx"
{
operands[1] = constm1_rtx;
return "or{q}\t{%1, %0|%0, %1}";
@@ -3279,22 +3278,56 @@
")
(define_insn "zero_extendsidi2_32"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?*o")
- (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,rm,r")))
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?*o,!?y,!?Y")
+ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,rm,r,m,m")))
(clobber (reg:CC 17))]
- "!TARGET_64BIT"
- "#"
- [(set_attr "mode" "SI")])
+ "!TARGET_64BIT && !TARGET_INTER_UNIT_MOVES"
+ "@
+ #
+ #
+ #
+ movd\t{%1, %0|%0, %1}
+ movd\t{%1, %0|%0, %1}"
+ [(set_attr "mode" "SI,SI,SI,DI,TI")
+ (set_attr "type" "multi,multi,multi,mmxmov,ssemov")])
+
+(define_insn "*zero_extendsidi2_32_1"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?*o,!?y,!?Y")
+ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,rm,r,rm,rm")))
+ (clobber (reg:CC 17))]
+ "!TARGET_64BIT && TARGET_INTER_UNIT_MOVES"
+ "@
+ #
+ #
+ #
+ movd\t{%1, %0|%0, %1}
+ movd\t{%1, %0|%0, %1}"
+ [(set_attr "mode" "SI,SI,SI,DI,TI")
+ (set_attr "type" "multi,multi,multi,mmxmov,ssemov")])
(define_insn "zero_extendsidi2_rex64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
- (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "rm,0")))]
- "TARGET_64BIT"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,!?y,!?Y")
+ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "rm,0,m,m")))]
+ "TARGET_64BIT && !TARGET_INTER_UNIT_MOVES"
"@
mov\t{%k1, %k0|%k0, %k1}
- #"
- [(set_attr "type" "imovx,imov")
- (set_attr "mode" "SI,DI")])
+ #
+ movd\t{%1, %0|%0, %1}
+ movd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "imovx,imov,mmxmov,ssemov")
+ (set_attr "mode" "SI,DI,DI,TI")])
+
+(define_insn "*zero_extendsidi2_rex64_1"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,!?y,!*?")
+ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "rm,0,rm,rm")))]
+ "TARGET_64BIT && TARGET_INTER_UNIT_MOVES"
+ "@
+ mov\t{%k1, %k0|%k0, %k1}
+ #
+ movd\t{%1, %0|%0, %1}
+ movd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "imovx,imov,mmxmov,ssemov")
+ (set_attr "mode" "SI,DI,SI,SI")])
(define_split
[(set (match_operand:DI 0 "memory_operand" "")
@@ -3316,7 +3349,8 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(zero_extend:DI (match_operand:SI 1 "general_operand" "")))
(clobber (reg:CC 17))]
- "!TARGET_64BIT && reload_completed"
+ "!TARGET_64BIT && reload_completed
+ && !SSE_REG_P (operands[0]) && !MMX_REG_P (operands[0])"
[(set (match_dup 3) (match_dup 1))
(set (match_dup 4) (const_int 0))]
"split_di (&operands[0], 1, &operands[3], &operands[4]);")
@@ -14416,7 +14450,7 @@
(define_insn_and_split "*ffs_no_cmove"
[(set (match_operand:SI 0 "nonimmediate_operand" "=r")
(ffs:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))
- (clobber (match_scratch:SI 2 "=&r"))
+ (clobber (match_scratch:SI 2 "=&q"))
(clobber (reg:CC 17))]
""
"#"
@@ -21229,7 +21263,7 @@
(vec_merge:V4HI (match_operand:V4HI 1 "register_operand" "0")
(vec_duplicate:V4HI
(truncate:HI (match_operand:SI 2 "nonimmediate_operand" "rm")))
- (match_operand:SI 3 "immediate_operand" "i")))]
+ (match_operand:SI 3 "const_0_to_15_operand" "N")))]
"TARGET_SSE || TARGET_3DNOW_A"
"pinsrw\t{%3, %2, %0|%0, %2, %3}"
[(set_attr "type" "mmxcvt")
@@ -21239,7 +21273,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (vec_select:HI (match_operand:V4HI 1 "register_operand" "y")
(parallel
- [(match_operand:SI 2 "immediate_operand" "i")]))))]
+ [(match_operand:SI 2 "const_0_to_3_operand" "N")]))))]
"TARGET_SSE || TARGET_3DNOW_A"
"pextrw\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "mmxcvt")
@@ -22925,7 +22959,7 @@
(vec_duplicate:V8HI
(truncate:HI
(match_operand:SI 2 "nonimmediate_operand" "rm")))
- (match_operand:SI 3 "immediate_operand" "i")))]
+ (match_operand:SI 3 "const_0_to_255_operand" "N")))]
"TARGET_SSE2"
"pinsrw\t{%3, %2, %0|%0, %2, %3}"
[(set_attr "type" "ssecvt")
@@ -22936,7 +22970,7 @@
(zero_extend:SI
(vec_select:HI (match_operand:V8HI 1 "register_operand" "x")
(parallel
- [(match_operand:SI 2 "immediate_operand" "i")]))))]
+ [(match_operand:SI 2 "const_0_to_7_operand" "N")]))))]
"TARGET_SSE2"
"pextrw\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "ssecvt")
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 98a25a95eaf..c199fb3ce8f 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -21,8 +21,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define LINUX_DEFAULT_ELF
-
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
@@ -115,15 +113,6 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#ifdef USE_GNULIBC_1
-#ifndef LINUX_DEFAULT_ELF
-#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
- %{!shared: \
- %{!ibcs: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/elf/ld-linux.so.1} \
- %{!rpath:-rpath /lib/elf/}} %{static:-static}}}"
-#else
#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
@@ -131,7 +120,6 @@ Boston, MA 02111-1307, USA. */
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
%{static:-static}}}"
-#endif
#else
#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 582a22bacd4..ea329803322 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -19,8 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define LINUX_DEFAULT_ELF
-
#define TARGET_VERSION fprintf (stderr, " (x86-64 Linux/ELF)");
#define TARGET_OS_CPP_BUILTINS() \
diff --git a/gcc/config/i386/nto.h b/gcc/config/i386/nto.h
new file mode 100644
index 00000000000..db60ad6ab08
--- /dev/null
+++ b/gcc/config/i386/nto.h
@@ -0,0 +1,99 @@
+/* Definitions for Intel 386 running QNX/Neutrino.
+ Copyright (C) 2002, 2003 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. */
+
+#undef DEFAULT_PCC_STRUCT_RETURN
+#define DEFAULT_PCC_STRUCT_RETURN 1
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (QNX/Neutrino/i386 ELF)");
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("__X86__"); \
+ builtin_define_std ("__QNXNTO__"); \
+ builtin_define_std ("__QNX__"); \
+ builtin_define_std ("__ELF__"); \
+ builtin_define_std ("__LITTLEENDIAN__");\
+ builtin_assert ("system=qnx"); \
+ builtin_assert ("system=qnxnto"); \
+ builtin_assert ("system=nto"); \
+ builtin_assert ("system=unix"); \
+ if (flag_pic) \
+ { \
+ builtin_define ("__PIC__"); \
+ builtin_define ("__pic__"); \
+ } \
+ } \
+ while (0)
+
+#undef THREAD_MODEL_SPEC
+#define THREAD_MODEL_SPEC "posix"
+
+#ifdef CROSS_COMPILE
+#define SYSROOT_SUFFIX_SPEC "x86"
+#endif
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+"%{!shared: \
+ %{!symbolic: \
+ %{pg:mcrt1.o%s} \
+ %{!pg:%{p:mcrt1.o%s} \
+ %{!p:crt1.o%s}}}} \
+crti.o%s \
+%{fexceptions: crtbegin.o%s} \
+%{!fexceptions: %R/lib/crtbegin.o}"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "crtend.o%s crtn.o%s"
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%{h*} %{v:-V} \
+ %{b} \
+ %{static:-dn -Bstatic} \
+ %{shared:-G -dy -z text} \
+ %{symbolic:-Bsymbolic -G -dy -z text} \
+ %{G:-G} \
+ %{YP,*} \
+ %{!YP,*:%{p:-Y P,%R/lib} \
+ %{!p:-Y P,%R/lib}} \
+ %{Qy:} %{!Qn:-Qy} \
+ -m i386nto \
+ %{!shared: --dynamic-linker /usr/lib/ldqnx.so.2}"
+
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "long unsigned int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
+
+#define NO_IMPLICIT_EXTERN_C 1
+
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/sol2.h b/gcc/config/i386/sol2.h
index fb5a184d65b..9089a1dce6c 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -1,5 +1,5 @@
/* Target definitions for GNU compiler for Intel 80386 running Solaris 2
- Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Fred Fish (fnf@cygnus.com).
@@ -20,8 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define CMOV_SUN_AS_SYNTAX 1
-
/* The Solaris 2.0 x86 linker botches alignment of code sections.
It tries to align to a 16 byte boundary by padding with 0x00000090
ints, rather than 0x90 bytes (nop). This generates trash in the
diff --git a/gcc/config/i386/t-nto b/gcc/config/i386/t-nto
new file mode 100644
index 00000000000..314c2609f8b
--- /dev/null
+++ b/gcc/config/i386/t-nto
@@ -0,0 +1,7 @@
+# Don't run fixproto
+STMP_FIXPROTO =
+
+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fPIC
+TARGET_LIBGCC2_CFLAGS = -fPIC -fexceptions
+
+EXTRA_PARTS = crtbegin.o
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 2c1e47fdd56..f376bc4c710 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -16,10 +16,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
-
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
#include "config.h"
#include "system.h"
@@ -47,13 +46,13 @@ Boston, MA 02111-1307, USA. */
multiple times.
*/
-static tree associated_type PARAMS ((tree));
-const char * gen_stdcall_suffix PARAMS ((tree));
-const char * gen_fastcall_suffix PARAMS ((tree));
-int i386_pe_dllexport_p PARAMS ((tree));
-int i386_pe_dllimport_p PARAMS ((tree));
-void i386_pe_mark_dllexport PARAMS ((tree));
-void i386_pe_mark_dllimport PARAMS ((tree));
+static tree associated_type (tree);
+const char * gen_stdcall_suffix (tree);
+const char * gen_fastcall_suffix (tree);
+int i386_pe_dllexport_p (tree);
+int i386_pe_dllimport_p (tree);
+void i386_pe_mark_dllexport (tree);
+void i386_pe_mark_dllimport (tree);
/* This is we how mark internal identifiers with dllimport or dllexport
attributes. */
@@ -67,12 +66,8 @@ void i386_pe_mark_dllimport PARAMS ((tree));
/* Handle a "dllimport" or "dllexport" attribute;
arguments as in struct attribute_spec.handler. */
tree
-ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
- tree * pnode;
- tree name;
- tree args;
- int flags;
- bool *no_add_attrs;
+ix86_handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
+ bool *no_add_attrs)
{
tree node = *pnode;
@@ -106,7 +101,7 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node)
&& !DECL_INLINE (node))
{
- error_with_decl (node, "function `%s' definition is marked dllimport.");
+ error ("%Jfunction `%D' definition is marked dllimport.", node, node);
*no_add_attrs = true;
}
@@ -114,27 +109,28 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
{
if (DECL_INITIAL (node))
{
- error_with_decl (node,"variable `%s' definition is marked dllimport.");
+ error ("%Jvariable `%D' definition is marked dllimport.",
+ node, node);
*no_add_attrs = true;
}
/* `extern' needn't be specified with dllimport.
Specify `extern' now and hope for the best. Sigh. */
- DECL_EXTERNAL (node) = 1;
+ DECL_EXTERNAL (node) = 1;
/* Also, implicitly give dllimport'd variables declared within
a function global scope, unless declared static. */
if (current_function_decl != NULL_TREE && !TREE_STATIC (node))
- TREE_PUBLIC (node) = 1;
+ TREE_PUBLIC (node) = 1;
}
}
/* Report error if symbol is not accessible at global scope. */
if (!TREE_PUBLIC (node)
&& (TREE_CODE (node) == VAR_DECL
- || TREE_CODE (node) == FUNCTION_DECL))
+ || TREE_CODE (node) == FUNCTION_DECL))
{
- error_with_decl (node, "external linkage required for symbol '%s' because of '%s' attribute.",
- IDENTIFIER_POINTER (name));
+ error ("%Jexternal linkage required for symbol '%D' because of "
+ "'%s' attribute.", node, node, IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
@@ -144,12 +140,9 @@ ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
/* Handle a "shared" attribute;
arguments as in struct attribute_spec.handler. */
tree
-ix86_handle_shared_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+ix86_handle_shared_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (TREE_CODE (*node) != VAR_DECL)
{
@@ -165,8 +158,7 @@ ix86_handle_shared_attribute (node, name, args, flags, no_add_attrs)
imported or exported. */
static tree
-associated_type (decl)
- tree decl;
+associated_type (tree decl)
{
tree t = NULL_TREE;
@@ -174,9 +166,11 @@ associated_type (decl)
to the containing class. So we look at the 'this' arg. */
if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
{
- /* Artificial methods are not affected by the import/export status of
- their class unless they are virtual. */
- if (! DECL_ARTIFICIAL (decl) || DECL_VINDEX (decl))
+ /* Artificial methods are not affected by the import/export status
+ of their class unless they are COMDAT. Implicit copy ctor's and
+ dtor's are not affected by class status but virtual and
+ non-virtual thunks are. */
+ if (!DECL_ARTIFICIAL (decl) || DECL_COMDAT (decl))
t = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))));
}
else if (DECL_CONTEXT (decl)
@@ -189,8 +183,7 @@ associated_type (decl)
/* Return nonzero if DECL is a dllexport'd object. */
int
-i386_pe_dllexport_p (decl)
- tree decl;
+i386_pe_dllexport_p (tree decl)
{
tree exp;
@@ -216,8 +209,7 @@ i386_pe_dllexport_p (decl)
/* Return nonzero if DECL is a dllimport'd object. */
int
-i386_pe_dllimport_p (decl)
- tree decl;
+i386_pe_dllimport_p (tree decl)
{
tree imp;
int context_imp = 0;
@@ -252,17 +244,19 @@ i386_pe_dllimport_p (decl)
{
/* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl))
- warning_with_decl (decl,"function '%s' is defined after prior declaration as dllimport: attribute ignored.");
+ warning ("%Jfunction '%D' is defined after prior declaration "
+ "as dllimport: attribute ignored", decl, decl);
return 0;
}
/* We ignore the dllimport attribute for inline member functions.
This differs from MSVC behavior which treats it like GNUC
- 'extern inline' extension. */
+ 'extern inline' extension. */
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{
if (extra_warnings)
- warning_with_decl (decl, "inline function '%s' is declared as dllimport: attribute ignored.");
+ warning ("%Jinline function '%D' is declared as dllimport: "
+ "attribute ignored.", decl, decl);
return 0;
}
@@ -273,15 +267,18 @@ i386_pe_dllimport_p (decl)
&& !DECL_EXTERNAL (decl) && context_imp)
{
if (!DECL_VIRTUAL_P (decl))
- error_with_decl (decl, "definition of static data member '%s' of dllimport'd class.");
- return 0;
+ error ("%Jdefinition of static data member '%D' of "
+ "dllimport'd class.", decl, decl);
+ return 0;
}
/* Since we can't treat a pointer to a dllimport'd symbol as a
constant address, we turn off the attribute on C++ virtual
- methods to allow creation of vtables using thunks. */
+ methods to allow creation of vtables using thunks. Don't mark
+ artificial methods either (in associated_type, only COMDAT
+ artificial method get import status from class context). */
else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
- && (DECL_VIRTUAL_P (decl)))
+ && (DECL_VIRTUAL_P (decl) || DECL_ARTIFICIAL (decl)))
return 0;
return 1;
@@ -293,8 +290,7 @@ i386_pe_dllimport_p (decl)
/* Return nonzero if SYMBOL is marked as being dllexport'd. */
int
-i386_pe_dllexport_name_p (symbol)
- const char *symbol;
+i386_pe_dllexport_name_p (const char *symbol)
{
return (strncmp (DLL_EXPORT_PREFIX, symbol,
strlen (DLL_EXPORT_PREFIX)) == 0);
@@ -303,8 +299,7 @@ i386_pe_dllexport_name_p (symbol)
/* Return nonzero if SYMBOL is marked as being dllimport'd. */
int
-i386_pe_dllimport_name_p (symbol)
- const char *symbol;
+i386_pe_dllimport_name_p (const char *symbol)
{
return (strncmp (DLL_IMPORT_PREFIX, symbol,
strlen (DLL_IMPORT_PREFIX)) == 0);
@@ -314,8 +309,7 @@ i386_pe_dllimport_name_p (symbol)
Note that we override the previous setting (eg: dllimport). */
void
-i386_pe_mark_dllexport (decl)
- tree decl;
+i386_pe_mark_dllexport (tree decl)
{
const char *oldname;
char *newname;
@@ -332,7 +326,8 @@ i386_pe_mark_dllexport (decl)
abort ();
if (i386_pe_dllimport_name_p (oldname))
{
- warning_with_decl (decl,"inconsistent dll linkage for '%s': dllexport assumed.");
+ warning ("%Jinconsistent dll linkage for '%D', dllexport assumed.",
+ decl, decl);
/* Remove DLL_IMPORT_PREFIX. */
oldname += strlen (DLL_IMPORT_PREFIX);
DECL_NON_ADDR_CONST_P (decl) = 0;
@@ -356,8 +351,7 @@ i386_pe_mark_dllexport (decl)
/* Mark a DECL as being dllimport'd. */
void
-i386_pe_mark_dllimport (decl)
- tree decl;
+i386_pe_mark_dllimport (tree decl)
{
const char *oldname;
char *newname;
@@ -383,7 +377,8 @@ i386_pe_mark_dllimport (decl)
/* Already done, but do a sanity check to prevent assembler errors. */
if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
{
- error_with_decl (decl, "failure in redeclaration of '%s': dllimport'd symbol lacks external linkage.");
+ error ("%Jfailure in redeclaration of '%D': dllimport'd "
+ "symbol lacks external linkage.", decl, decl);
abort();
}
return;
@@ -407,13 +402,12 @@ i386_pe_mark_dllimport (decl)
DECL_NON_ADDR_CONST_P (decl) = 1;
}
-/* Return string which is the former assembler name modified with a
+/* Return string which is the former assembler name modified with a
prefix consisting of FASTCALL_PREFIX and a suffix consisting of an
atsign (@) followed by the number of bytes of arguments. */
const char *
-gen_fastcall_suffix (decl)
- tree decl;
+gen_fastcall_suffix (tree decl)
{
int total = 0;
@@ -426,7 +420,10 @@ gen_fastcall_suffix (decl)
{
tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
- while (TREE_VALUE (formal_type) != void_type_node)
+ /* Quit if we hit an incomplete type. Error is reported
+ by convert_arguments in c-typeck.c or cp/typeck.c. */
+ while (TREE_VALUE (formal_type) != void_type_node
+ && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))
{
int parm_size
= TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
@@ -439,19 +436,18 @@ gen_fastcall_suffix (decl)
}
}
- /* Assume max of 8 base 10 digits in the suffix. */
+ /* Assume max of 8 base 10 digits in the suffix. */
newsym = xmalloc (1 + strlen (asmname) + 1 + 8 + 1);
sprintf (newsym, "%c%s@%d", FASTCALL_PREFIX, asmname, total/BITS_PER_UNIT);
return IDENTIFIER_POINTER (get_identifier (newsym));
}
-/* Return string which is the former assembler name modified with a
- suffix consisting of an atsign (@) followed by the number of bytes of
+/* Return string which is the former assembler name modified with a
+ suffix consisting of an atsign (@) followed by the number of bytes of
arguments */
const char *
-gen_stdcall_suffix (decl)
- tree decl;
+gen_stdcall_suffix (tree decl)
{
int total = 0;
/* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
@@ -460,12 +456,15 @@ gen_stdcall_suffix (decl)
char *newsym;
if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
- if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
+ if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
== void_type_node)
{
tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
- while (TREE_VALUE (formal_type) != void_type_node)
+ /* Quit if we hit an incomplete type. Error is reported
+ by convert_arguments in c-typeck.c or cp/typeck.c. */
+ while (TREE_VALUE (formal_type) != void_type_node
+ && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))
{
int parm_size
= TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
@@ -478,17 +477,14 @@ gen_stdcall_suffix (decl)
}
}
- /* Assume max of 8 base 10 digits in the suffix. */
+ /* Assume max of 8 base 10 digits in the suffix. */
newsym = xmalloc (strlen (asmname) + 1 + 8 + 1);
sprintf (newsym, "%s@%d", asmname, total/BITS_PER_UNIT);
return IDENTIFIER_POINTER (get_identifier (newsym));
}
void
-i386_pe_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+i386_pe_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
@@ -496,7 +492,7 @@ i386_pe_encode_section_info (decl, rtl, first)
{
if (lookup_attribute ("stdcall",
TYPE_ATTRIBUTES (TREE_TYPE (decl))))
- XEXP (DECL_RTL (decl), 0) =
+ XEXP (DECL_RTL (decl), 0) =
gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl));
else if (lookup_attribute ("fastcall",
TYPE_ATTRIBUTES (TREE_TYPE (decl))))
@@ -525,13 +521,17 @@ i386_pe_encode_section_info (decl, rtl, first)
&& i386_pe_dllimport_name_p (XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0)))
{
const char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0);
+
/* Remove DLL_IMPORT_PREFIX. */
tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX));
rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
- warning_with_decl (decl, "'%s' %s after being referenced with dllimport linkage.",
- (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
- ? "defined locally" : "redeclared without dllimport attribute");
+ if (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
+ warning ("%J'%D' defined locally after being "
+ "referenced with dllimport linkage", decl, decl);
+ else
+ warning ("%J'%D' redeclared without dllimport attribute "
+ "after being referenced with dllimport linkage", decl, decl);
XEXP (DECL_RTL (decl), 0) = newrtl;
@@ -546,8 +546,7 @@ i386_pe_encode_section_info (decl, rtl, first)
prefix if it exists. */
const char *
-i386_pe_strip_name_encoding (str)
- const char *str;
+i386_pe_strip_name_encoding (const char *str)
{
if (strncmp (str, DLL_IMPORT_PREFIX, strlen (DLL_IMPORT_PREFIX))
== 0)
@@ -563,12 +562,11 @@ i386_pe_strip_name_encoding (str)
/* Also strip the stdcall suffix. */
const char *
-i386_pe_strip_name_encoding_full (str)
- const char *str;
+i386_pe_strip_name_encoding_full (const char *str)
{
const char *p;
const char *name = i386_pe_strip_name_encoding (str);
-
+
p = strchr (name, '@');
if (p)
return ggc_alloc_string (name, p - name);
@@ -586,16 +584,16 @@ void i386_pe_output_labelref (stream, name)
{
if (strncmp (name, DLL_IMPORT_PREFIX, strlen (DLL_IMPORT_PREFIX))
== 0)
- /* A dll import */
+ /* A dll import */
{
if (name[strlen (DLL_IMPORT_PREFIX)] == FASTCALL_PREFIX)
- /* A dllimport fastcall symbol. */
+ /* A dllimport fastcall symbol. */
{
fprintf (stream, "__imp_%s",
i386_pe_strip_name_encoding (name));
}
else
- /* A dllimport non-fastcall symbol. */
+ /* A dllimport non-fastcall symbol. */
{
fprintf (stream, "__imp__%s",
i386_pe_strip_name_encoding (name));
@@ -603,7 +601,7 @@ void i386_pe_output_labelref (stream, name)
}
else if ((name[0] == FASTCALL_PREFIX)
|| (strncmp (name, DLL_EXPORT_PREFIX, strlen (DLL_EXPORT_PREFIX)
- == 0
+ == 0
&& name[strlen (DLL_EXPORT_PREFIX)] == FASTCALL_PREFIX)))
/* A fastcall symbol. */
{
@@ -619,9 +617,7 @@ void i386_pe_output_labelref (stream, name)
}
void
-i386_pe_unique_section (decl, reloc)
- tree decl;
- int reloc;
+i386_pe_unique_section (tree decl, int reloc)
{
int len;
const char *name, *prefix;
@@ -633,7 +629,7 @@ i386_pe_unique_section (decl, reloc)
/* The object is put in, for example, section .text$foo.
The linker will then ultimately place them in .text
(everything from the $ on is stripped). Don't put
- read-only data in .rdata section to avoid a PE linker
+ read-only data in .rdata section to avoid a PE linker
bug when .rdata$* grouped sections are used in code
without a .rdata section. */
if (TREE_CODE (decl) == FUNCTION_DECL)
@@ -667,10 +663,7 @@ i386_pe_unique_section (decl, reloc)
#define SECTION_PE_SHARED SECTION_MACH_DEP
unsigned int
-i386_pe_section_type_flags (decl, name, reloc)
- tree decl;
- const char *name;
- int reloc;
+i386_pe_section_type_flags (tree decl, const char *name, int reloc)
{
static htab_t htab;
unsigned int flags;
@@ -708,16 +701,14 @@ i386_pe_section_type_flags (decl, name, reloc)
else
{
if (decl && **slot != flags)
- error_with_decl (decl, "%s causes a section type conflict");
+ error ("%J'%D' causes a section type conflict", decl, decl);
}
return flags;
}
void
-i386_pe_asm_named_section (name, flags)
- const char *name;
- unsigned int flags;
+i386_pe_asm_named_section (const char *name, unsigned int flags)
{
char flagchars[8], *f = flagchars;
@@ -754,10 +745,7 @@ i386_pe_asm_named_section (name, flags)
visible. */
void
-i386_pe_declare_function_type (file, name, public)
- FILE *file;
- const char *name;
- int public;
+i386_pe_declare_function_type (FILE *file, const char *name, int public)
{
fprintf (file, "\t.def\t");
assemble_name (file, name);
@@ -783,8 +771,7 @@ static struct extern_list *extern_head;
for it then. */
void
-i386_pe_record_external_function (name)
- const char *name;
+i386_pe_record_external_function (const char *name)
{
struct extern_list *p;
@@ -808,13 +795,11 @@ static struct export_list *export_head;
/* Assemble an export symbol entry. We need to keep a list of
these, so that we can output the export list at the end of the
assembly. We used to output these export symbols in each function,
- but that causes problems with GNU ld when the sections are
+ but that causes problems with GNU ld when the sections are
linkonce. */
void
-i386_pe_record_exported_symbol (name, is_data)
- const char *name;
- int is_data;
+i386_pe_record_exported_symbol (const char *name, int is_data)
{
struct export_list *p;
@@ -830,7 +815,7 @@ i386_pe_record_exported_symbol (name, is_data)
output the .drectve section. */
void
-i386_pe_file_end ()
+i386_pe_file_end (void)
{
struct extern_list *p;
@@ -847,7 +832,7 @@ i386_pe_file_end ()
{
TREE_ASM_WRITTEN (decl) = 1;
i386_pe_declare_function_type (asm_out_file, p->name,
- TREE_PUBLIC (decl));
+ TREE_PUBLIC (decl));
}
}
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-mingw32.h b/gcc/config/i386/xm-mingw32.h
index 9984bf93cfb..81995e05d43 100644
--- a/gcc/config/i386/xm-mingw32.h
+++ b/gcc/config/i386/xm-mingw32.h
@@ -1,25 +1,29 @@
/* Configuration for GNU C-compiler for hosting on Windows32.
using GNU tools and the Windows32 API Library.
- Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
#define HOST_EXECUTABLE_SUFFIX ".exe"
#undef PATH_SEPARATOR
#define PATH_SEPARATOR ';'
+
+/* This is the name of the null device on windows. */
+#define HOST_BIT_BUCKET "nul"
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/i386/xm-vsta.h b/gcc/config/i386/xm-vsta.h
deleted file mode 100644
index 53943eaf7da..00000000000
--- a/gcc/config/i386/xm-vsta.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Use semicolons to separate elements of a path. */
-#define PATH_SEPARATOR ';'
-
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("unix"); \
- } \
- while (0)
-
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index cb44ee3efe7..26443223ddc 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -1086,7 +1086,7 @@ i960_function_name_declare (file, name, fndecl)
/* See if caller passes in an address to return value. */
- if (aggregate_value_p (DECL_RESULT (fndecl)))
+ if (aggregate_value_p (DECL_RESULT (fndecl), fndecl))
{
tail_call_ok = 0;
leaf_proc_ok = 0;
diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h
index 40094840719..b2b854b3fcb 100644
--- a/gcc/config/ia64/hpux.h
+++ b/gcc/config/ia64/hpux.h
@@ -26,9 +26,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
/* Target OS builtins. */
-/* -D__fpreg=long double is needed to compensate for
- the lack of __fpreg which is a primitive type in
- HP C but does not exist in GNU C. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_assert("system=hpux"); \
@@ -39,9 +36,6 @@ do { \
builtin_define("__IA64__"); \
builtin_define("_LONGLONG"); \
builtin_define("_UINT128_T"); \
- builtin_define("__fpreg=long double"); \
- builtin_define("__float80=long double"); \
- builtin_define("__float128=long double"); \
if (c_dialect_cxx () || !flag_iso) \
{ \
builtin_define("_HPUX_SOURCE"); \
@@ -49,6 +43,13 @@ do { \
} \
} while (0)
+#undef CPP_SPEC
+#define CPP_SPEC \
+ "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
+/* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These
+ affect only aCC's C++ library (Rogue Wave-derived) which we do not
+ use, and they violate the user's name space. */
+
#undef ASM_EXTRA_SPEC
#define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
@@ -68,6 +69,7 @@ do { \
#undef LIB_SPEC
#define LIB_SPEC \
"%{!shared: \
+ %{mt|pthread:-lpthread} \
%{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
%{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
%{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
@@ -134,6 +136,10 @@ do { \
#undef TARGET_HPUX_LD
#define TARGET_HPUX_LD 1
+/* The HPUX dynamic linker objects to weak symbols with no
+ definitions, so do not use them in gthr-posix.h. */
+#define GTHREAD_USE_WEAK 0
+
/* Put out the needed function declarations at the end. */
#define TARGET_ASM_FILE_END ia64_hpux_file_end
@@ -144,6 +150,10 @@ do { \
#undef DTORS_SECTION_ASM_OP
#define DTORS_SECTION_ASM_OP "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
+/* The init_array/fini_array technique does not permit the use of
+ initialization priorities. */
+#define SUPPORTS_INIT_PRIORITY 0
+
#undef READONLY_DATA_SECTION_ASM_OP
#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
@@ -172,3 +182,8 @@ do { \
#define TARGET_ASM_SELECT_RTX_SECTION ia64_rwreloc_select_rtx_section
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS ia64_rwreloc_section_type_flags
+
+/* 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.c b/gcc/config/ia64/ia64-c.c
index b95c21d4d9b..422fc865b2a 100644
--- a/gcc/config/ia64/ia64-c.c
+++ b/gcc/config/ia64/ia64-c.c
@@ -1,5 +1,5 @@
/* Definitions of C specific functions for GNU compiler.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Steve Ellcey <sje@cup.hp.com>
This file is part of GCC.
@@ -30,11 +30,10 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "tm_p.h"
-static void ia64_hpux_add_pragma_builtin PARAMS ((tree func));
+static void ia64_hpux_add_pragma_builtin (tree func);
void
-ia64_hpux_handle_builtin_pragma (pfile)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
+ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
/* #pragma builtin name, name, name */
@@ -173,8 +172,7 @@ static const c89_mathlib_names c89_mathlib_name_list [] =
};
static void
-ia64_hpux_add_pragma_builtin (func)
- tree func;
+ia64_hpux_add_pragma_builtin (tree func)
{
size_t i;
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 030c5ed667b..52dacb73e7a 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler for IA-64.
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -29,127 +30,125 @@ extern GTY(()) rtx ia64_compare_op1;
extern int bundling_p;
#ifdef RTX_CODE
-extern int ia64_st_address_bypass_p PARAMS((rtx, rtx));
-extern int ia64_ld_address_bypass_p PARAMS((rtx, rtx));
-extern int ia64_produce_address_p PARAMS((rtx));
-extern int call_operand PARAMS((rtx, enum machine_mode));
-extern int sdata_symbolic_operand PARAMS((rtx, enum machine_mode));
-extern int got_symbolic_operand PARAMS((rtx, enum machine_mode));
-extern int symbolic_operand PARAMS((rtx, enum machine_mode));
-extern int tls_symbolic_operand PARAMS((rtx, enum machine_mode));
-extern int function_operand PARAMS((rtx, enum machine_mode));
-extern int setjmp_operand PARAMS((rtx, enum machine_mode));
-extern int move_operand PARAMS((rtx, enum machine_mode));
-extern int gr_register_operand PARAMS((rtx, enum machine_mode));
-extern int fr_register_operand PARAMS((rtx, enum machine_mode));
-extern int grfr_register_operand PARAMS((rtx, enum machine_mode));
-extern int gr_nonimmediate_operand PARAMS((rtx, enum machine_mode));
-extern int fr_nonimmediate_operand PARAMS((rtx, enum machine_mode));
-extern int grfr_nonimmediate_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_0_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_5bit_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_6bit_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_8bit_operand PARAMS((rtx, enum machine_mode));
-extern int grfr_reg_or_8bit_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_8bit_adjusted_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_8bit_and_adjusted_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_14bit_operand PARAMS((rtx, enum machine_mode));
-extern int gr_reg_or_22bit_operand PARAMS((rtx, enum machine_mode));
-extern int shift_count_operand PARAMS((rtx, enum machine_mode));
-extern int shift_32bit_count_operand PARAMS((rtx, enum machine_mode));
-extern int shladd_operand PARAMS((rtx, enum machine_mode));
-extern int fetchadd_operand PARAMS((rtx, enum machine_mode));
-extern int fr_reg_or_fp01_operand PARAMS((rtx, enum machine_mode));
-extern int normal_comparison_operator PARAMS((rtx, enum machine_mode));
-extern int adjusted_comparison_operator PARAMS((rtx, enum machine_mode));
-extern int signed_inequality_operator PARAMS((rtx, enum machine_mode));
-extern int destination_operand PARAMS((rtx, enum machine_mode));
-extern int not_postinc_memory_operand PARAMS((rtx, enum machine_mode));
-extern int predicate_operator PARAMS((rtx, enum machine_mode));
-extern int ar_lc_reg_operand PARAMS((rtx, enum machine_mode));
-extern int ar_ccv_reg_operand PARAMS((rtx, enum machine_mode));
-extern int ar_pfs_reg_operand PARAMS((rtx, enum machine_mode));
-extern int general_tfmode_operand PARAMS((rtx, enum machine_mode));
-extern int destination_tfmode_operand PARAMS((rtx, enum machine_mode));
-extern int tfreg_or_fp01_operand PARAMS((rtx, enum machine_mode));
-extern int basereg_operand PARAMS((rtx, enum machine_mode));
-
-extern rtx ia64_expand_move PARAMS ((rtx, rtx));
-extern int ia64_move_ok PARAMS((rtx, rtx));
-extern int addp4_optimize_ok PARAMS((rtx, rtx));
-extern void ia64_emit_cond_move PARAMS((rtx, rtx, rtx));
-extern int ia64_depz_field_mask PARAMS((rtx, rtx));
-extern rtx ia64_split_timode PARAMS((rtx[], rtx, rtx));
-extern rtx spill_tfmode_operand PARAMS((rtx, int));
-extern rtx ia64_expand_compare PARAMS((enum rtx_code, enum machine_mode));
-extern void ia64_expand_call PARAMS((rtx, rtx, rtx, int));
-extern void ia64_split_call PARAMS((rtx, rtx, rtx, rtx, rtx, int, int));
-extern void ia64_reload_gp PARAMS((void));
-
-extern HOST_WIDE_INT ia64_initial_elimination_offset PARAMS((int, int));
-extern void ia64_expand_prologue PARAMS((void));
-extern void ia64_expand_epilogue PARAMS((int));
-
-extern int ia64_direct_return PARAMS((void));
-extern void ia64_expand_load_address PARAMS((rtx, rtx));
-extern int ia64_hard_regno_rename_ok PARAMS((int, int));
-
-extern void ia64_initialize_trampoline PARAMS((rtx, rtx, rtx));
-extern void ia64_print_operand_address PARAMS((FILE *, rtx));
-extern void ia64_print_operand PARAMS((FILE *, rtx, int));
-extern enum reg_class ia64_secondary_reload_class PARAMS((enum reg_class,
- enum machine_mode,
- rtx));
-extern void ia64_output_dwarf_dtprel PARAMS ((FILE*, int, rtx));
-extern void process_for_unwind_directive PARAMS ((FILE *, rtx));
-extern const char *get_bundle_name PARAMS ((int));
+extern int ia64_st_address_bypass_p (rtx, rtx);
+extern int ia64_ld_address_bypass_p (rtx, rtx);
+extern int ia64_produce_address_p (rtx);
+extern int call_operand (rtx, enum machine_mode);
+extern int sdata_symbolic_operand (rtx, enum machine_mode);
+extern int got_symbolic_operand (rtx, enum machine_mode);
+extern int symbolic_operand (rtx, enum machine_mode);
+extern int tls_symbolic_operand (rtx, enum machine_mode);
+extern int function_operand (rtx, enum machine_mode);
+extern int setjmp_operand (rtx, enum machine_mode);
+extern int move_operand (rtx, enum machine_mode);
+extern int gr_register_operand (rtx, enum machine_mode);
+extern int fr_register_operand (rtx, enum machine_mode);
+extern int grfr_register_operand (rtx, enum machine_mode);
+extern int gr_nonimmediate_operand (rtx, enum machine_mode);
+extern int fr_nonimmediate_operand (rtx, enum machine_mode);
+extern int grfr_nonimmediate_operand (rtx, enum machine_mode);
+extern int gr_reg_or_0_operand (rtx, enum machine_mode);
+extern int gr_reg_or_5bit_operand (rtx, enum machine_mode);
+extern int gr_reg_or_6bit_operand (rtx, enum machine_mode);
+extern int gr_reg_or_8bit_operand (rtx, enum machine_mode);
+extern int grfr_reg_or_8bit_operand (rtx, enum machine_mode);
+extern int gr_reg_or_8bit_adjusted_operand (rtx, enum machine_mode);
+extern int gr_reg_or_8bit_and_adjusted_operand (rtx, enum machine_mode);
+extern int gr_reg_or_14bit_operand (rtx, enum machine_mode);
+extern int gr_reg_or_22bit_operand (rtx, enum machine_mode);
+extern int shift_count_operand (rtx, enum machine_mode);
+extern int shift_32bit_count_operand (rtx, enum machine_mode);
+extern int shladd_operand (rtx, enum machine_mode);
+extern int fetchadd_operand (rtx, enum machine_mode);
+extern int fr_reg_or_fp01_operand (rtx, enum machine_mode);
+extern int normal_comparison_operator (rtx, enum machine_mode);
+extern int adjusted_comparison_operator (rtx, enum machine_mode);
+extern int signed_inequality_operator (rtx, enum machine_mode);
+extern int destination_operand (rtx, enum machine_mode);
+extern int not_postinc_memory_operand (rtx, enum machine_mode);
+extern int predicate_operator (rtx, enum machine_mode);
+extern int ar_lc_reg_operand (rtx, enum machine_mode);
+extern int ar_ccv_reg_operand (rtx, enum machine_mode);
+extern int ar_pfs_reg_operand (rtx, enum machine_mode);
+extern int general_tfmode_operand (rtx, enum machine_mode);
+extern int destination_tfmode_operand (rtx, enum machine_mode);
+extern int tfreg_or_fp01_operand (rtx, enum machine_mode);
+extern int basereg_operand (rtx, enum machine_mode);
+
+extern rtx ia64_expand_move (rtx, rtx);
+extern int ia64_move_ok (rtx, rtx);
+extern int addp4_optimize_ok (rtx, rtx);
+extern void ia64_emit_cond_move (rtx, rtx, rtx);
+extern int ia64_depz_field_mask (rtx, rtx);
+extern rtx ia64_split_timode (rtx[], rtx, rtx);
+extern rtx spill_tfmode_operand (rtx, int);
+extern rtx ia64_expand_compare (enum rtx_code, enum machine_mode);
+extern void ia64_expand_call (rtx, rtx, rtx, int);
+extern void ia64_split_call (rtx, rtx, rtx, rtx, rtx, int, int);
+extern void ia64_reload_gp (void);
+
+extern HOST_WIDE_INT ia64_initial_elimination_offset (int, int);
+extern void ia64_expand_prologue (void);
+extern void ia64_expand_epilogue (int);
+
+extern int ia64_direct_return (void);
+extern void ia64_expand_load_address (rtx, rtx);
+extern int ia64_hard_regno_rename_ok (int, int);
+
+extern void ia64_initialize_trampoline (rtx, rtx, rtx);
+extern void ia64_print_operand_address (FILE *, rtx);
+extern void ia64_print_operand (FILE *, rtx, int);
+extern enum reg_class ia64_secondary_reload_class (enum reg_class,
+ enum machine_mode, rtx);
+extern void ia64_output_dwarf_dtprel (FILE*, int, rtx);
+extern void process_for_unwind_directive (FILE *, rtx);
+extern const char *get_bundle_name (int);
#endif /* RTX_CODE */
#ifdef TREE_CODE
#ifdef RTX_CODE
-extern rtx ia64_function_arg PARAMS((CUMULATIVE_ARGS *, enum machine_mode,
- tree, int, int));
-extern rtx ia64_expand_builtin PARAMS((tree, rtx, rtx,
- enum machine_mode, int));
-extern rtx ia64_va_arg PARAMS((tree, tree));
-extern rtx ia64_function_value PARAMS((tree, tree));
+extern rtx ia64_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int, int);
+extern rtx ia64_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+extern rtx ia64_va_arg (tree, tree);
+extern rtx ia64_function_value (tree, tree);
#endif /* RTX_CODE */
-extern void ia64_setup_incoming_varargs PARAMS((CUMULATIVE_ARGS, int, tree,
- int *, int));
-extern int ia64_function_arg_partial_nregs PARAMS((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern void ia64_function_arg_advance PARAMS((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern int ia64_function_arg_pass_by_reference PARAMS((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern int ia64_return_in_memory PARAMS((tree));
-extern void ia64_asm_output_external PARAMS((FILE *, tree, const char *));
+extern void ia64_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree,
+ int *, int);
+extern int ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int);
+extern int ia64_function_arg_pass_by_reference (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern int ia64_return_in_memory (tree);
+extern void ia64_asm_output_external (FILE *, tree, const char *);
#endif /* TREE_CODE */
-extern int ia64_register_move_cost PARAMS((enum machine_mode, enum reg_class,
- enum reg_class));
-extern int ia64_epilogue_uses PARAMS((int));
-extern int ia64_eh_uses PARAMS((int));
-extern void emit_safe_across_calls PARAMS((void));
-extern void ia64_init_builtins PARAMS((void));
-extern void ia64_override_options PARAMS((void));
-extern int ia64_dbx_register_number PARAMS((int));
+extern int ia64_register_move_cost (enum machine_mode, enum reg_class,
+ enum reg_class);
+extern int ia64_epilogue_uses (int);
+extern int ia64_eh_uses (int);
+extern void emit_safe_across_calls (void);
+extern void ia64_init_builtins (void);
+extern void ia64_override_options (void);
+extern int ia64_dbx_register_number (int);
+
+extern rtx ia64_return_addr_rtx (HOST_WIDE_INT, rtx);
+extern void ia64_split_return_addr_rtx (rtx);
#ifdef SDATA_SECTION_ASM_OP
-extern void sdata_section PARAMS ((void));
+extern void sdata_section (void);
#endif
#ifdef SBSS_SECTION_ASM_OP
-extern void sbss_section PARAMS ((void));
+extern void sbss_section (void);
#endif
#ifdef ARGS_SIZE_RTX
/* expr.h defines ARGS_SIZE_RTX and `enum direction'. */
-extern enum direction ia64_hpux_function_arg_padding PARAMS ((enum machine_mode, tree));
+extern enum direction ia64_hpux_function_arg_padding (enum machine_mode, tree);
#endif /* ARGS_SIZE_RTX */
-extern void ia64_hpux_handle_builtin_pragma PARAMS ((struct cpp_reader *));
+extern void ia64_hpux_handle_builtin_pragma (struct cpp_reader *);
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 444e882457d..f82981b07bf 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler.
Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by James E. Wilson <wilson@cygnus.com> and
- David Mosberger <davidm@hpl.hp.com>.
+ David Mosberger <davidm@hpl.hp.com>.
This file is part of GCC.
@@ -136,7 +136,7 @@ struct ia64_frame_info
HOST_WIDE_INT spill_size; /* size of the gr/br/fr spill area. */
HOST_WIDE_INT extra_spill_size; /* size of spill area for others. */
HARD_REG_SET mask; /* mask of saved registers. */
- unsigned int gr_used_mask; /* mask of registers in use as gr spill
+ unsigned int gr_used_mask; /* mask of registers in use as gr spill
registers or long-term scratches. */
int n_spilled; /* number of spilled registers. */
int reg_fp; /* register for fp. */
@@ -158,117 +158,113 @@ struct ia64_frame_info
/* Current frame information calculated by ia64_compute_frame_size. */
static struct ia64_frame_info current_frame_info;
-static int ia64_use_dfa_pipeline_interface PARAMS ((void));
-static int ia64_first_cycle_multipass_dfa_lookahead PARAMS ((void));
-static void ia64_dependencies_evaluation_hook PARAMS ((rtx, rtx));
-static void ia64_init_dfa_pre_cycle_insn PARAMS ((void));
-static rtx ia64_dfa_pre_cycle_insn PARAMS ((void));
-static int ia64_first_cycle_multipass_dfa_lookahead_guard PARAMS ((rtx));
-static int ia64_dfa_new_cycle PARAMS ((FILE *, int, rtx, int, int, int *));
-static rtx gen_tls_get_addr PARAMS ((void));
-static rtx gen_thread_pointer PARAMS ((void));
-static rtx ia64_expand_tls_address PARAMS ((enum tls_model, rtx, rtx));
-static int find_gr_spill PARAMS ((int));
-static int next_scratch_gr_reg PARAMS ((void));
-static void mark_reg_gr_used_mask PARAMS ((rtx, void *));
-static void ia64_compute_frame_size PARAMS ((HOST_WIDE_INT));
-static void setup_spill_pointers PARAMS ((int, rtx, HOST_WIDE_INT));
-static void finish_spill_pointers PARAMS ((void));
-static rtx spill_restore_mem PARAMS ((rtx, HOST_WIDE_INT));
-static void do_spill PARAMS ((rtx (*)(rtx, rtx, rtx), rtx, HOST_WIDE_INT, rtx));
-static void do_restore PARAMS ((rtx (*)(rtx, rtx, rtx), rtx, HOST_WIDE_INT));
-static rtx gen_movdi_x PARAMS ((rtx, rtx, rtx));
-static rtx gen_fr_spill_x PARAMS ((rtx, rtx, rtx));
-static rtx gen_fr_restore_x PARAMS ((rtx, rtx, rtx));
-
-static enum machine_mode hfa_element_mode PARAMS ((tree, int));
-static bool ia64_function_ok_for_sibcall PARAMS ((tree, tree));
-static bool ia64_rtx_costs PARAMS ((rtx, int, int, int *));
-static void fix_range PARAMS ((const char *));
-static struct machine_function * ia64_init_machine_status PARAMS ((void));
-static void emit_insn_group_barriers PARAMS ((FILE *));
-static void emit_all_insn_group_barriers PARAMS ((FILE *));
-static void final_emit_insn_group_barriers PARAMS ((FILE *));
-static void emit_predicate_relation_info PARAMS ((void));
-static void ia64_reorg PARAMS ((void));
-static bool ia64_in_small_data_p PARAMS ((tree));
-static void process_epilogue PARAMS ((void));
-static int process_set PARAMS ((FILE *, rtx));
-
-static rtx ia64_expand_fetch_and_op PARAMS ((optab, enum machine_mode,
- tree, rtx));
-static rtx ia64_expand_op_and_fetch PARAMS ((optab, enum machine_mode,
- tree, rtx));
-static rtx ia64_expand_compare_and_swap PARAMS ((enum machine_mode,
- enum machine_mode,
- int, tree, rtx));
-static rtx ia64_expand_lock_test_and_set PARAMS ((enum machine_mode,
- tree, rtx));
-static rtx ia64_expand_lock_release PARAMS ((enum machine_mode, tree, rtx));
-static bool ia64_assemble_integer PARAMS ((rtx, unsigned int, int));
-static void ia64_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void ia64_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void ia64_output_function_end_prologue PARAMS ((FILE *));
-
-static int ia64_issue_rate PARAMS ((void));
-static int ia64_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static void ia64_sched_init PARAMS ((FILE *, int, int));
-static void ia64_sched_finish PARAMS ((FILE *, int));
-static int ia64_dfa_sched_reorder PARAMS ((FILE *, int, rtx *, int *,
- int, int));
-static int ia64_sched_reorder PARAMS ((FILE *, int, rtx *, int *, int));
-static int ia64_sched_reorder2 PARAMS ((FILE *, int, rtx *, int *, int));
-static int ia64_variable_issue PARAMS ((FILE *, int, rtx, int));
-
-static struct bundle_state *get_free_bundle_state PARAMS ((void));
-static void free_bundle_state PARAMS ((struct bundle_state *));
-static void initiate_bundle_states PARAMS ((void));
-static void finish_bundle_states PARAMS ((void));
-static unsigned bundle_state_hash PARAMS ((const void *));
-static int bundle_state_eq_p PARAMS ((const void *, const void *));
-static int insert_bundle_state PARAMS ((struct bundle_state *));
-static void initiate_bundle_state_table PARAMS ((void));
-static void finish_bundle_state_table PARAMS ((void));
-static int try_issue_nops PARAMS ((struct bundle_state *, int));
-static int try_issue_insn PARAMS ((struct bundle_state *, rtx));
-static void issue_nops_and_insn PARAMS ((struct bundle_state *, int,
- rtx, int, int));
-static int get_max_pos PARAMS ((state_t));
-static int get_template PARAMS ((state_t, int));
-
-static rtx get_next_important_insn PARAMS ((rtx, rtx));
-static void bundling PARAMS ((FILE *, int, rtx, rtx));
-
-static void ia64_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
-static void ia64_file_start PARAMS ((void));
-
-static void ia64_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT));
-static void ia64_rwreloc_select_section PARAMS ((tree, int,
- unsigned HOST_WIDE_INT))
+static int ia64_use_dfa_pipeline_interface (void);
+static int ia64_first_cycle_multipass_dfa_lookahead (void);
+static void ia64_dependencies_evaluation_hook (rtx, rtx);
+static void ia64_init_dfa_pre_cycle_insn (void);
+static rtx ia64_dfa_pre_cycle_insn (void);
+static int ia64_first_cycle_multipass_dfa_lookahead_guard (rtx);
+static int ia64_dfa_new_cycle (FILE *, int, rtx, int, int, int *);
+static rtx gen_tls_get_addr (void);
+static rtx gen_thread_pointer (void);
+static rtx ia64_expand_tls_address (enum tls_model, rtx, rtx);
+static int find_gr_spill (int);
+static int next_scratch_gr_reg (void);
+static void mark_reg_gr_used_mask (rtx, void *);
+static void ia64_compute_frame_size (HOST_WIDE_INT);
+static void setup_spill_pointers (int, rtx, HOST_WIDE_INT);
+static void finish_spill_pointers (void);
+static rtx spill_restore_mem (rtx, HOST_WIDE_INT);
+static void do_spill (rtx (*)(rtx, rtx, rtx), rtx, HOST_WIDE_INT, rtx);
+static void do_restore (rtx (*)(rtx, rtx, rtx), rtx, HOST_WIDE_INT);
+static rtx gen_movdi_x (rtx, rtx, rtx);
+static rtx gen_fr_spill_x (rtx, rtx, rtx);
+static rtx gen_fr_restore_x (rtx, rtx, rtx);
+
+static enum machine_mode hfa_element_mode (tree, int);
+static bool ia64_function_ok_for_sibcall (tree, tree);
+static bool ia64_rtx_costs (rtx, int, int, int *);
+static void fix_range (const char *);
+static struct machine_function * ia64_init_machine_status (void);
+static void emit_insn_group_barriers (FILE *);
+static void emit_all_insn_group_barriers (FILE *);
+static void final_emit_insn_group_barriers (FILE *);
+static void emit_predicate_relation_info (void);
+static void ia64_reorg (void);
+static bool ia64_in_small_data_p (tree);
+static void process_epilogue (void);
+static int process_set (FILE *, rtx);
+
+static rtx ia64_expand_fetch_and_op (optab, enum machine_mode, tree, rtx);
+static rtx ia64_expand_op_and_fetch (optab, enum machine_mode, tree, rtx);
+static rtx ia64_expand_compare_and_swap (enum machine_mode, enum machine_mode,
+ int, tree, rtx);
+static rtx ia64_expand_lock_test_and_set (enum machine_mode, tree, rtx);
+static rtx ia64_expand_lock_release (enum machine_mode, tree, rtx);
+static bool ia64_assemble_integer (rtx, unsigned int, int);
+static void ia64_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void ia64_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void ia64_output_function_end_prologue (FILE *);
+
+static int ia64_issue_rate (void);
+static int ia64_adjust_cost (rtx, rtx, rtx, int);
+static void ia64_sched_init (FILE *, int, int);
+static void ia64_sched_finish (FILE *, int);
+static int ia64_dfa_sched_reorder (FILE *, int, rtx *, int *, int, int);
+static int ia64_sched_reorder (FILE *, int, rtx *, int *, int);
+static int ia64_sched_reorder2 (FILE *, int, rtx *, int *, int);
+static int ia64_variable_issue (FILE *, int, rtx, int);
+
+static struct bundle_state *get_free_bundle_state (void);
+static void free_bundle_state (struct bundle_state *);
+static void initiate_bundle_states (void);
+static void finish_bundle_states (void);
+static unsigned bundle_state_hash (const void *);
+static int bundle_state_eq_p (const void *, const void *);
+static int insert_bundle_state (struct bundle_state *);
+static void initiate_bundle_state_table (void);
+static void finish_bundle_state_table (void);
+static int try_issue_nops (struct bundle_state *, int);
+static int try_issue_insn (struct bundle_state *, rtx);
+static void issue_nops_and_insn (struct bundle_state *, int, rtx, int, int);
+static int get_max_pos (state_t);
+static int get_template (state_t, int);
+
+static rtx get_next_important_insn (rtx, rtx);
+static void bundling (FILE *, int, rtx, rtx);
+
+static void ia64_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree);
+static void ia64_file_start (void);
+
+static void ia64_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT);
+static void ia64_rwreloc_select_section (tree, int, unsigned HOST_WIDE_INT)
ATTRIBUTE_UNUSED;
-static void ia64_rwreloc_unique_section PARAMS ((tree, int))
+static void ia64_rwreloc_unique_section (tree, int)
ATTRIBUTE_UNUSED;
-static void ia64_rwreloc_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT))
+static void ia64_rwreloc_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT)
ATTRIBUTE_UNUSED;
-static unsigned int ia64_rwreloc_section_type_flags
- PARAMS ((tree, const char *, int))
+static unsigned int ia64_rwreloc_section_type_flags (tree, const char *, int)
ATTRIBUTE_UNUSED;
-static void ia64_hpux_add_extern_decl PARAMS ((const char *name))
+static void ia64_hpux_add_extern_decl (const char *name)
ATTRIBUTE_UNUSED;
-static void ia64_hpux_file_end PARAMS ((void))
+static void ia64_hpux_file_end (void)
ATTRIBUTE_UNUSED;
+static tree ia64_handle_model_attribute (tree *, tree, tree, int, bool *);
+static void ia64_encode_section_info (tree, rtx, int);
+
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
{ "syscall_linkage", 0, 0, false, true, true, NULL },
- { NULL, 0, 0, false, false, false, NULL }
+ { "model", 1, 1, true, false, false, ia64_handle_model_attribute },
+ { NULL, 0, 0, false, false, false, NULL }
};
/* Initialize the GCC target structure. */
@@ -368,14 +364,15 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG ia64_reorg
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO ia64_encode_section_info
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */
int
-call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand (rtx op, enum machine_mode mode)
{
if (mode != GET_MODE (op) && mode != VOIDmode)
return 0;
@@ -387,9 +384,7 @@ call_operand (op, mode)
/* Return 1 if OP refers to a symbol in the sdata section. */
int
-sdata_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+sdata_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -413,12 +408,16 @@ sdata_symbolic_operand (op, mode)
return 0;
}
+int
+small_addr_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+ return SYMBOL_REF_SMALL_ADDR_P (op);
+}
+
/* Return 1 if OP refers to a symbol, and is appropriate for a GOT load. */
int
-got_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+got_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -449,6 +448,8 @@ got_symbolic_operand (op, mode)
return (INTVAL (op) & 0x3fff) == 0;
case SYMBOL_REF:
+ if (SYMBOL_REF_SMALL_ADDR_P (op))
+ return 0;
case LABEL_REF:
return 1;
@@ -461,9 +462,7 @@ got_symbolic_operand (op, mode)
/* Return 1 if OP refers to a symbol. */
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))
{
@@ -481,9 +480,7 @@ symbolic_operand (op, mode)
/* Return tls_model if OP refers to a TLS symbol. */
int
-tls_symbolic_operand (op, mode)
- 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;
@@ -494,9 +491,7 @@ tls_symbolic_operand (op, mode)
/* Return 1 if OP refers to a function. */
int
-function_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+function_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (op))
return 1;
@@ -509,9 +504,7 @@ function_operand (op, mode)
/* ??? This is an unsatisfying solution. Should rethink. */
int
-setjmp_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+setjmp_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
const char *name;
int retval = 0;
@@ -557,9 +550,7 @@ setjmp_operand (op, mode)
/* Return 1 if OP is a general operand, excluding tls symbolic operands. */
int
-move_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_operand (rtx op, enum machine_mode mode)
{
return general_operand (op, mode) && !tls_symbolic_operand (op, mode);
}
@@ -567,9 +558,7 @@ move_operand (op, mode)
/* Return 1 if OP is a register operand that is (or could be) a GR reg. */
int
-gr_register_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_register_operand (rtx op, enum machine_mode mode)
{
if (! register_operand (op, mode))
return 0;
@@ -587,9 +576,7 @@ gr_register_operand (op, mode)
/* Return 1 if OP is a register operand that is (or could be) an FR reg. */
int
-fr_register_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fr_register_operand (rtx op, enum machine_mode mode)
{
if (! register_operand (op, mode))
return 0;
@@ -607,9 +594,7 @@ fr_register_operand (op, mode)
/* Return 1 if OP is a register operand that is (or could be) a GR/FR reg. */
int
-grfr_register_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+grfr_register_operand (rtx op, enum machine_mode mode)
{
if (! register_operand (op, mode))
return 0;
@@ -627,9 +612,7 @@ grfr_register_operand (op, mode)
/* Return 1 if OP is a nonimmediate operand that is (or could be) a GR reg. */
int
-gr_nonimmediate_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_nonimmediate_operand (rtx op, enum machine_mode mode)
{
if (! nonimmediate_operand (op, mode))
return 0;
@@ -647,9 +630,7 @@ gr_nonimmediate_operand (op, mode)
/* Return 1 if OP is a nonimmediate operand that is (or could be) a FR reg. */
int
-fr_nonimmediate_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fr_nonimmediate_operand (rtx op, enum machine_mode mode)
{
if (! nonimmediate_operand (op, mode))
return 0;
@@ -667,9 +648,7 @@ fr_nonimmediate_operand (op, mode)
/* Return 1 if OP is a nonimmediate operand that is a GR/FR reg. */
int
-grfr_nonimmediate_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+grfr_nonimmediate_operand (rtx op, enum machine_mode mode)
{
if (! nonimmediate_operand (op, mode))
return 0;
@@ -687,9 +666,7 @@ grfr_nonimmediate_operand (op, mode)
/* Return 1 if OP is a GR register operand, or zero. */
int
-gr_reg_or_0_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_0_operand (rtx op, enum machine_mode mode)
{
return (op == const0_rtx || gr_register_operand (op, mode));
}
@@ -697,9 +674,7 @@ gr_reg_or_0_operand (op, mode)
/* Return 1 if OP is a GR register operand, or a 5 bit immediate operand. */
int
-gr_reg_or_5bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_5bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 32)
|| GET_CODE (op) == CONSTANT_P_RTX
@@ -709,9 +684,7 @@ gr_reg_or_5bit_operand (op, mode)
/* Return 1 if OP is a GR register operand, or a 6 bit immediate operand. */
int
-gr_reg_or_6bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_6bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_M (INTVAL (op)))
|| GET_CODE (op) == CONSTANT_P_RTX
@@ -721,9 +694,7 @@ gr_reg_or_6bit_operand (op, mode)
/* Return 1 if OP is a GR register operand, or an 8 bit immediate operand. */
int
-gr_reg_or_8bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_8bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op)))
|| GET_CODE (op) == CONSTANT_P_RTX
@@ -733,9 +704,7 @@ gr_reg_or_8bit_operand (op, mode)
/* Return 1 if OP is a GR/FR register operand, or an 8 bit immediate. */
int
-grfr_reg_or_8bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+grfr_reg_or_8bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op)))
|| GET_CODE (op) == CONSTANT_P_RTX
@@ -746,9 +715,7 @@ grfr_reg_or_8bit_operand (op, mode)
operand. */
int
-gr_reg_or_8bit_adjusted_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_8bit_adjusted_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_L (INTVAL (op)))
|| GET_CODE (op) == CONSTANT_P_RTX
@@ -761,9 +728,7 @@ gr_reg_or_8bit_adjusted_operand (op, mode)
so we need the union of the immediates accepted by GT and LT. */
int
-gr_reg_or_8bit_and_adjusted_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_8bit_and_adjusted_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op))
&& CONST_OK_FOR_L (INTVAL (op)))
@@ -774,9 +739,7 @@ gr_reg_or_8bit_and_adjusted_operand (op, mode)
/* Return 1 if OP is a register operand, or a 14 bit immediate operand. */
int
-gr_reg_or_14bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_14bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_I (INTVAL (op)))
|| GET_CODE (op) == CONSTANT_P_RTX
@@ -786,9 +749,7 @@ gr_reg_or_14bit_operand (op, mode)
/* Return 1 if OP is a register operand, or a 22 bit immediate operand. */
int
-gr_reg_or_22bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gr_reg_or_22bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_J (INTVAL (op)))
|| GET_CODE (op) == CONSTANT_P_RTX
@@ -798,9 +759,7 @@ gr_reg_or_22bit_operand (op, mode)
/* Return 1 if OP is a 6 bit immediate operand. */
int
-shift_count_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+shift_count_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_M (INTVAL (op)))
|| GET_CODE (op) == CONSTANT_P_RTX);
@@ -809,9 +768,7 @@ shift_count_operand (op, mode)
/* Return 1 if OP is a 5 bit immediate operand. */
int
-shift_32bit_count_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+shift_32bit_count_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ((GET_CODE (op) == CONST_INT
&& (INTVAL (op) >= 0 && INTVAL (op) < 32))
@@ -821,9 +778,7 @@ shift_32bit_count_operand (op, mode)
/* Return 1 if OP is a 2, 4, 8, or 16 immediate operand. */
int
-shladd_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+shladd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 2 || INTVAL (op) == 4
@@ -833,9 +788,7 @@ shladd_operand (op, mode)
/* Return 1 if OP is a -16, -8, -4, -1, 1, 4, 8, or 16 immediate operand. */
int
-fetchadd_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+fetchadd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == -16 || INTVAL (op) == -8 ||
@@ -847,9 +800,7 @@ fetchadd_operand (op, mode)
/* Return 1 if OP is a floating-point constant zero, one, or a register. */
int
-fr_reg_or_fp01_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fr_reg_or_fp01_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_OK_FOR_G (op))
|| fr_register_operand (op, mode));
@@ -859,9 +810,7 @@ fr_reg_or_fp01_operand (op, mode)
POST_MODIFY with a REG as displacement. */
int
-destination_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+destination_operand (rtx op, enum machine_mode mode)
{
if (! nonimmediate_operand (op, mode))
return 0;
@@ -875,9 +824,7 @@ destination_operand (op, mode)
/* Like memory_operand, but don't allow post-increments. */
int
-not_postinc_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+not_postinc_memory_operand (rtx op, enum machine_mode mode)
{
return (memory_operand (op, mode)
&& GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != 'a');
@@ -887,9 +834,7 @@ not_postinc_memory_operand (op, mode)
signed immediate operand. */
int
-normal_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+normal_comparison_operator (register rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
return ((mode == VOIDmode || GET_MODE (op) == mode)
@@ -901,9 +846,7 @@ normal_comparison_operator (op, mode)
signed immediate operand. */
int
-adjusted_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+adjusted_comparison_operator (register rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
return ((mode == VOIDmode || GET_MODE (op) == mode)
@@ -913,9 +856,7 @@ adjusted_comparison_operator (op, mode)
/* Return 1 if this is a signed inequality operator. */
int
-signed_inequality_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+signed_inequality_operator (register rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
return ((mode == VOIDmode || GET_MODE (op) == mode)
@@ -926,9 +867,7 @@ signed_inequality_operator (op, mode)
/* Return 1 if this operator is valid for predication. */
int
-predicate_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+predicate_operator (register rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
return ((GET_MODE (op) == mode || mode == VOIDmode)
@@ -938,9 +877,7 @@ predicate_operator (op, mode)
/* Return 1 if this operator can be used in a conditional operation. */
int
-condop_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+condop_operator (register rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
return ((GET_MODE (op) == mode || mode == VOIDmode)
@@ -951,9 +888,7 @@ condop_operator (op, mode)
/* Return 1 if this is the ar.lc register. */
int
-ar_lc_reg_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+ar_lc_reg_operand (register rtx op, enum machine_mode mode)
{
return (GET_MODE (op) == DImode
&& (mode == DImode || mode == VOIDmode)
@@ -964,9 +899,7 @@ ar_lc_reg_operand (op, mode)
/* Return 1 if this is the ar.ccv register. */
int
-ar_ccv_reg_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+ar_ccv_reg_operand (register rtx op, enum machine_mode mode)
{
return ((GET_MODE (op) == mode || mode == VOIDmode)
&& GET_CODE (op) == REG
@@ -976,9 +909,7 @@ ar_ccv_reg_operand (op, mode)
/* Return 1 if this is the ar.pfs register. */
int
-ar_pfs_reg_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+ar_pfs_reg_operand (register rtx op, enum machine_mode mode)
{
return ((GET_MODE (op) == mode || mode == VOIDmode)
&& GET_CODE (op) == REG
@@ -988,9 +919,7 @@ ar_pfs_reg_operand (op, mode)
/* Like general_operand, but don't allow (mem (addressof)). */
int
-general_tfmode_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+general_tfmode_operand (rtx op, enum machine_mode mode)
{
if (! general_operand (op, mode))
return 0;
@@ -1002,9 +931,7 @@ general_tfmode_operand (op, mode)
/* Similarly. */
int
-destination_tfmode_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+destination_tfmode_operand (rtx op, enum machine_mode mode)
{
if (! destination_operand (op, mode))
return 0;
@@ -1016,9 +943,7 @@ destination_tfmode_operand (op, mode)
/* Similarly. */
int
-tfreg_or_fp01_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+tfreg_or_fp01_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == SUBREG)
return 0;
@@ -1028,9 +953,7 @@ tfreg_or_fp01_operand (op, mode)
/* Return 1 if OP is valid as a base register in a reg + offset address. */
int
-basereg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+basereg_operand (rtx op, enum machine_mode mode)
{
/* ??? Should I copy the flag_omit_frame_pointer and cse_not_expected
checks from pa.c basereg_operand as well? Seems to be OK without them
@@ -1040,11 +963,130 @@ basereg_operand (op, mode)
REG_POINTER ((GET_CODE (op) == SUBREG) ? SUBREG_REG (op) : op));
}
+typedef enum
+ {
+ ADDR_AREA_NORMAL, /* normal address area */
+ ADDR_AREA_SMALL /* addressable by "addl" (-2MB < addr < 2MB) */
+ }
+ia64_addr_area;
+
+static GTY(()) tree small_ident1;
+static GTY(()) tree small_ident2;
+
+static void
+init_idents (void)
+{
+ if (small_ident1 == 0)
+ {
+ small_ident1 = get_identifier ("small");
+ small_ident2 = get_identifier ("__small__");
+ }
+}
+
+/* Retrieve the address area that has been chosen for the given decl. */
+
+static ia64_addr_area
+ia64_get_addr_area (tree decl)
+{
+ tree model_attr;
+
+ model_attr = lookup_attribute ("model", DECL_ATTRIBUTES (decl));
+ if (model_attr)
+ {
+ tree id;
+
+ init_idents ();
+ id = TREE_VALUE (TREE_VALUE (model_attr));
+ if (id == small_ident1 || id == small_ident2)
+ return ADDR_AREA_SMALL;
+ }
+ return ADDR_AREA_NORMAL;
+}
+
+static tree
+ia64_handle_model_attribute (tree *node, tree name, tree args, int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
+{
+ ia64_addr_area addr_area = ADDR_AREA_NORMAL;
+ ia64_addr_area area;
+ tree arg, decl = *node;
+
+ init_idents ();
+ arg = TREE_VALUE (args);
+ if (arg == small_ident1 || arg == small_ident2)
+ {
+ addr_area = ADDR_AREA_SMALL;
+ }
+ else
+ {
+ warning ("invalid argument of `%s' attribute",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+ switch (TREE_CODE (decl))
+ {
+ case VAR_DECL:
+ if ((DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl))
+ == FUNCTION_DECL)
+ && !TREE_STATIC (decl))
+ {
+ error ("%Jan address area attribute cannot be specified for "
+ "local variables", decl, decl);
+ *no_add_attrs = true;
+ }
+ area = ia64_get_addr_area (decl);
+ if (area != ADDR_AREA_NORMAL && addr_area != area)
+ {
+ error ("%Jaddress area of '%s' conflicts with previous "
+ "declaration", decl, decl);
+ *no_add_attrs = true;
+ }
+ break;
+
+ case FUNCTION_DECL:
+ error ("%Jaddress area attribute cannot be specified for functions",
+ decl, decl);
+ *no_add_attrs = true;
+ break;
+
+ default:
+ warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ break;
+ }
+
+ return NULL_TREE;
+}
+
+static void
+ia64_encode_addr_area (tree decl, rtx symbol)
+{
+ int flags;
+
+ flags = SYMBOL_REF_FLAGS (symbol);
+ switch (ia64_get_addr_area (decl))
+ {
+ case ADDR_AREA_NORMAL: break;
+ case ADDR_AREA_SMALL: flags |= SYMBOL_FLAG_SMALL_ADDR; break;
+ default: abort ();
+ }
+ SYMBOL_REF_FLAGS (symbol) = flags;
+}
+
+static void
+ia64_encode_section_info (tree decl, rtx rtl, int first)
+{
+ default_encode_section_info (decl, rtl, first);
+
+ if (TREE_CODE (decl) == VAR_DECL
+ && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
+ ia64_encode_addr_area (decl, XEXP (rtl, 0));
+}
+
/* Return 1 if the operands of a move are ok. */
int
-ia64_move_ok (dst, src)
- rtx dst, src;
+ia64_move_ok (rtx dst, rtx src)
{
/* If we're under init_recog_no_volatile, we'll not be able to use
memory_operand. So check the code directly and don't worry about
@@ -1064,17 +1106,9 @@ ia64_move_ok (dst, src)
return GET_CODE (src) == CONST_DOUBLE && CONST_DOUBLE_OK_FOR_G (src);
}
-/* Return 0 if we are doing C++ code. This optimization fails with
- C++ because of GNAT c++/6685. */
-
int
-addp4_optimize_ok (op1, op2)
- rtx op1, op2;
+addp4_optimize_ok (rtx op1, rtx op2)
{
-
- if (!strcmp (lang_hooks.name, "GNU C++"))
- return 0;
-
return (basereg_operand (op1, GET_MODE(op1)) !=
basereg_operand (op2, GET_MODE(op2)));
}
@@ -1083,8 +1117,7 @@ addp4_optimize_ok (op1, op2)
Return the length of the field, or <= 0 on failure. */
int
-ia64_depz_field_mask (rop, rshift)
- rtx rop, rshift;
+ia64_depz_field_mask (rtx rop, rtx rshift)
{
unsigned HOST_WIDE_INT op = INTVAL (rop);
unsigned HOST_WIDE_INT shift = INTVAL (rshift);
@@ -1099,8 +1132,7 @@ ia64_depz_field_mask (rop, rshift)
/* Expand a symbolic constant load. */
void
-ia64_expand_load_address (dest, src)
- rtx dest, src;
+ia64_expand_load_address (rtx dest, rtx src)
{
if (tls_symbolic_operand (src, VOIDmode))
abort ();
@@ -1114,7 +1146,12 @@ ia64_expand_load_address (dest, src)
if (GET_MODE (dest) != Pmode)
dest = gen_rtx_REG (Pmode, REGNO (dest));
- if (TARGET_AUTO_PIC)
+ if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_SMALL_ADDR_P (src))
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, dest, src));
+ return;
+ }
+ else if (TARGET_AUTO_PIC)
{
emit_insn (gen_load_gprel64 (dest, src));
return;
@@ -1162,7 +1199,7 @@ ia64_expand_load_address (dest, src)
static GTY(()) rtx gen_tls_tga;
static rtx
-gen_tls_get_addr ()
+gen_tls_get_addr (void)
{
if (!gen_tls_tga)
gen_tls_tga = init_one_libfunc ("__tls_get_addr");
@@ -1171,7 +1208,7 @@ gen_tls_get_addr ()
static GTY(()) rtx thread_pointer_rtx;
static rtx
-gen_thread_pointer ()
+gen_thread_pointer (void)
{
if (!thread_pointer_rtx)
{
@@ -1182,11 +1219,10 @@ gen_thread_pointer ()
}
static rtx
-ia64_expand_tls_address (tls_kind, op0, op1)
- enum tls_model tls_kind;
- rtx op0, op1;
+ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1)
{
rtx tga_op1, tga_op2, tga_ret, tga_eqv, tmp, insns;
+ rtx orig_op0 = op0;
switch (tls_kind)
{
@@ -1202,7 +1238,7 @@ ia64_expand_tls_address (tls_kind, op0, op1)
emit_insn (gen_load_ltoff_dtprel (tga_op2, op1));
tga_op2 = gen_rtx_MEM (Pmode, tga_op2);
RTX_UNCHANGING_P (tga_op2) = 1;
-
+
tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX,
LCT_CONST, Pmode, 2, tga_op1,
Pmode, tga_op2, Pmode);
@@ -1210,8 +1246,10 @@ ia64_expand_tls_address (tls_kind, op0, op1)
insns = get_insns ();
end_sequence ();
+ if (GET_MODE (op0) != Pmode)
+ op0 = tga_ret;
emit_libcall_block (insns, op0, tga_ret, op1);
- return NULL_RTX;
+ break;
case TLS_MODEL_LOCAL_DYNAMIC:
/* ??? This isn't the completely proper way to do local-dynamic
@@ -1239,19 +1277,16 @@ ia64_expand_tls_address (tls_kind, op0, op1)
tmp = gen_reg_rtx (Pmode);
emit_libcall_block (insns, tmp, tga_ret, tga_eqv);
- if (register_operand (op0, Pmode))
- tga_ret = op0;
- else
- tga_ret = gen_reg_rtx (Pmode);
+ if (!register_operand (op0, Pmode))
+ op0 = gen_reg_rtx (Pmode);
if (TARGET_TLS64)
{
- emit_insn (gen_load_dtprel (tga_ret, op1));
- emit_insn (gen_adddi3 (tga_ret, tmp, tga_ret));
+ emit_insn (gen_load_dtprel (op0, op1));
+ emit_insn (gen_adddi3 (op0, tmp, op0));
}
else
- emit_insn (gen_add_dtprel (tga_ret, tmp, op1));
-
- return (tga_ret == op0 ? NULL_RTX : tga_ret);
+ emit_insn (gen_add_dtprel (op0, tmp, op1));
+ break;
case TLS_MODEL_INITIAL_EXEC:
tmp = gen_reg_rtx (Pmode);
@@ -1260,37 +1295,36 @@ ia64_expand_tls_address (tls_kind, op0, op1)
RTX_UNCHANGING_P (tmp) = 1;
tmp = force_reg (Pmode, tmp);
- if (register_operand (op0, Pmode))
- op1 = op0;
- else
- op1 = gen_reg_rtx (Pmode);
- emit_insn (gen_adddi3 (op1, tmp, gen_thread_pointer ()));
-
- return (op1 == op0 ? NULL_RTX : op1);
+ if (!register_operand (op0, Pmode))
+ op0 = gen_reg_rtx (Pmode);
+ emit_insn (gen_adddi3 (op0, tmp, gen_thread_pointer ()));
+ break;
case TLS_MODEL_LOCAL_EXEC:
- if (register_operand (op0, Pmode))
- tmp = op0;
- else
- tmp = gen_reg_rtx (Pmode);
+ if (!register_operand (op0, Pmode))
+ op0 = gen_reg_rtx (Pmode);
if (TARGET_TLS64)
{
- emit_insn (gen_load_tprel (tmp, op1));
- emit_insn (gen_adddi3 (tmp, gen_thread_pointer (), tmp));
+ emit_insn (gen_load_tprel (op0, op1));
+ emit_insn (gen_adddi3 (op0, gen_thread_pointer (), op0));
}
else
- emit_insn (gen_add_tprel (tmp, gen_thread_pointer (), op1));
-
- return (tmp == op0 ? NULL_RTX : tmp);
+ emit_insn (gen_add_tprel (op0, gen_thread_pointer (), op1));
+ break;
default:
abort ();
}
+
+ if (orig_op0 == op0)
+ return NULL_RTX;
+ if (GET_MODE (orig_op0) == Pmode)
+ return op0;
+ return gen_lowpart (GET_MODE (orig_op0), op0);
}
rtx
-ia64_expand_move (op0, op1)
- rtx op0, op1;
+ia64_expand_move (rtx op0, rtx op1)
{
enum machine_mode mode = GET_MODE (op0);
@@ -1316,8 +1350,7 @@ ia64_expand_move (op0, op1)
/* Split a move from OP1 to OP0 conditional on COND. */
void
-ia64_emit_cond_move (op0, op1, cond)
- rtx op0, op1, cond;
+ia64_emit_cond_move (rtx op0, rtx op1, rtx cond)
{
rtx insn, first = get_last_insn ();
@@ -1332,9 +1365,7 @@ ia64_emit_cond_move (op0, op1, cond)
/* Split a post-reload TImode reference into two DImode components. */
rtx
-ia64_split_timode (out, in, scratch)
- rtx out[2];
- rtx in, scratch;
+ia64_split_timode (rtx out[2], rtx in, rtx scratch)
{
switch (GET_CODE (in))
{
@@ -1401,14 +1432,12 @@ ia64_split_timode (out, in, scratch)
SECONDARY_RELOAD_CLASS, but not both.
We got into problems in the first place by allowing a construct like
- (subreg:TF (reg:TI)), which we got from a union containing a long double.
+ (subreg:TF (reg:TI)), which we got from a union containing a long double.
This solution attempts to prevent this situation from occurring. When
we see something like the above, we spill the inner register to memory. */
rtx
-spill_tfmode_operand (in, force)
- rtx in;
- int force;
+spill_tfmode_operand (rtx in, int force)
{
if (GET_CODE (in) == SUBREG
&& GET_MODE (SUBREG_REG (in)) == TImode
@@ -1433,9 +1462,7 @@ spill_tfmode_operand (in, force)
that holds the compare result in the proper mode. */
rtx
-ia64_expand_compare (code, mode)
- enum rtx_code code;
- enum machine_mode mode;
+ia64_expand_compare (enum rtx_code code, enum machine_mode mode)
{
rtx op0 = ia64_compare_op0, op1 = ia64_compare_op1;
rtx cmp;
@@ -1463,11 +1490,8 @@ ia64_expand_compare (code, mode)
/* Emit the appropriate sequence for a call. */
void
-ia64_expand_call (retval, addr, nextarg, sibcall_p)
- rtx retval;
- rtx addr;
- rtx nextarg ATTRIBUTE_UNUSED;
- int sibcall_p;
+ia64_expand_call (rtx retval, rtx addr, rtx nextarg ATTRIBUTE_UNUSED,
+ int sibcall_p)
{
rtx insn, b0;
@@ -1503,7 +1527,7 @@ ia64_expand_call (retval, addr, nextarg, sibcall_p)
}
void
-ia64_reload_gp ()
+ia64_reload_gp (void)
{
rtx tmp;
@@ -1543,10 +1567,8 @@ ia64_reload_gp ()
}
void
-ia64_split_call (retval, addr, retaddr, scratch_r, scratch_b,
- noreturn_p, sibcall_p)
- rtx retval, addr, retaddr, scratch_r, scratch_b;
- int noreturn_p, sibcall_p;
+ia64_split_call (rtx retval, rtx addr, rtx retaddr, rtx scratch_r,
+ rtx scratch_b, int noreturn_p, int sibcall_p)
{
rtx insn;
bool is_desc = false;
@@ -1560,7 +1582,7 @@ ia64_split_call (retval, addr, retaddr, scratch_r, scratch_b,
/* ??? We are currently constrained to *not* use peep2, because
we can legitimately change the global lifetime of the GP
- (in the form of killing where previously live). This is
+ (in the form of killing where previously live). This is
because a call through a descriptor doesn't use the previous
value of the GP, while a direct call does, and we do not
commit to either form until the split here.
@@ -1609,14 +1631,14 @@ ia64_split_call (retval, addr, retaddr, scratch_r, scratch_b,
/* Begin the assembly file. */
static void
-ia64_file_start ()
+ia64_file_start (void)
{
default_file_start ();
emit_safe_across_calls ();
}
void
-emit_safe_across_calls ()
+emit_safe_across_calls (void)
{
unsigned int rs, re;
int out_state;
@@ -1654,8 +1676,7 @@ emit_safe_across_calls ()
TRY_LOCALS is true if we should attempt to locate a local regnum. */
static int
-find_gr_spill (try_locals)
- int try_locals;
+find_gr_spill (int try_locals)
{
int regno;
@@ -1704,7 +1725,7 @@ find_gr_spill (try_locals)
static int last_scratch_gr_reg;
static int
-next_scratch_gr_reg ()
+next_scratch_gr_reg (void)
{
int i, regno;
@@ -1729,9 +1750,7 @@ next_scratch_gr_reg ()
diddle_return_value. Mark REG in current_frame_info.gr_used_mask. */
static void
-mark_reg_gr_used_mask (reg, data)
- rtx reg;
- void *data ATTRIBUTE_UNUSED;
+mark_reg_gr_used_mask (rtx reg, void *data ATTRIBUTE_UNUSED)
{
unsigned int regno = REGNO (reg);
if (regno < 32)
@@ -1747,8 +1766,7 @@ mark_reg_gr_used_mask (reg, data)
needed for local variables. */
static void
-ia64_compute_frame_size (size)
- HOST_WIDE_INT size;
+ia64_compute_frame_size (HOST_WIDE_INT size)
{
HOST_WIDE_INT total_size;
HOST_WIDE_INT spill_size = 0;
@@ -1821,7 +1839,7 @@ ia64_compute_frame_size (size)
current_frame_info.n_rotate_regs = 0;
/* Discover which registers need spilling, and how much room that
- will take. Begin with floating point and general registers,
+ will take. Begin with floating point and general registers,
which will always wind up on the stack. */
for (regno = FR_REG (2); regno <= FR_REG (127); regno++)
@@ -1852,7 +1870,7 @@ ia64_compute_frame_size (size)
/* Now come all special registers that might get saved in other
general registers. */
-
+
if (frame_pointer_needed)
{
current_frame_info.reg_fp = find_gr_spill (1);
@@ -2014,8 +2032,7 @@ ia64_compute_frame_size (size)
/* Compute the initial difference between the specified pair of registers. */
HOST_WIDE_INT
-ia64_initial_elimination_offset (from, to)
- int from, to;
+ia64_initial_elimination_offset (int from, int to)
{
HOST_WIDE_INT offset;
@@ -2054,10 +2071,6 @@ ia64_initial_elimination_offset (from, to)
abort ();
break;
- case RETURN_ADDRESS_POINTER_REGNUM:
- offset = 0;
- break;
-
default:
abort ();
}
@@ -2091,10 +2104,7 @@ struct spill_fill_data
static struct spill_fill_data spill_fill_data;
static void
-setup_spill_pointers (n_spills, init_reg, cfa_off)
- int n_spills;
- rtx init_reg;
- HOST_WIDE_INT cfa_off;
+setup_spill_pointers (int n_spills, rtx init_reg, HOST_WIDE_INT cfa_off)
{
int i;
@@ -2120,15 +2130,13 @@ setup_spill_pointers (n_spills, init_reg, cfa_off)
}
static void
-finish_spill_pointers ()
+finish_spill_pointers (void)
{
current_frame_info.gr_used_mask = spill_fill_data.save_gr_used_mask;
}
static rtx
-spill_restore_mem (reg, cfa_off)
- rtx reg;
- HOST_WIDE_INT cfa_off;
+spill_restore_mem (rtx reg, HOST_WIDE_INT cfa_off)
{
int iter = spill_fill_data.next_iter;
HOST_WIDE_INT disp = spill_fill_data.prev_off[iter] - cfa_off;
@@ -2241,10 +2249,8 @@ spill_restore_mem (reg, cfa_off)
}
static void
-do_spill (move_fn, reg, cfa_off, frame_reg)
- rtx (*move_fn) PARAMS ((rtx, rtx, rtx));
- rtx reg, frame_reg;
- HOST_WIDE_INT cfa_off;
+do_spill (rtx (*move_fn) (rtx, rtx, rtx), rtx reg, HOST_WIDE_INT cfa_off,
+ rtx frame_reg)
{
int iter = spill_fill_data.next_iter;
rtx mem, insn;
@@ -2260,7 +2266,7 @@ do_spill (move_fn, reg, cfa_off, frame_reg)
RTX_FRAME_RELATED_P (insn) = 1;
- /* Don't even pretend that the unwind code can intuit its way
+ /* Don't even pretend that the unwind code can intuit its way
through a pair of interleaved post_modify iterators. Just
provide the correct answer. */
@@ -2286,10 +2292,7 @@ do_spill (move_fn, reg, cfa_off, frame_reg)
}
static void
-do_restore (move_fn, reg, cfa_off)
- rtx (*move_fn) PARAMS ((rtx, rtx, rtx));
- rtx reg;
- HOST_WIDE_INT cfa_off;
+do_restore (rtx (*move_fn) (rtx, rtx, rtx), rtx reg, HOST_WIDE_INT cfa_off)
{
int iter = spill_fill_data.next_iter;
rtx insn;
@@ -2304,25 +2307,19 @@ do_restore (move_fn, reg, cfa_off)
use a consistent function interface. */
static rtx
-gen_movdi_x (dest, src, offset)
- rtx dest, src;
- rtx offset ATTRIBUTE_UNUSED;
+gen_movdi_x (rtx dest, rtx src, rtx offset ATTRIBUTE_UNUSED)
{
return gen_movdi (dest, src);
}
static rtx
-gen_fr_spill_x (dest, src, offset)
- rtx dest, src;
- rtx offset ATTRIBUTE_UNUSED;
+gen_fr_spill_x (rtx dest, rtx src, rtx offset ATTRIBUTE_UNUSED)
{
return gen_fr_spill (dest, src);
}
static rtx
-gen_fr_restore_x (dest, src, offset)
- rtx dest, src;
- rtx offset ATTRIBUTE_UNUSED;
+gen_fr_restore_x (rtx dest, rtx src, rtx offset ATTRIBUTE_UNUSED)
{
return gen_fr_restore (dest, src);
}
@@ -2350,7 +2347,7 @@ gen_fr_restore_x (dest, src, offset)
adds instruction. */
void
-ia64_expand_prologue ()
+ia64_expand_prologue (void)
{
rtx insn, ar_pfs_save_reg, ar_unat_save_reg;
int i, epilogue_p, regno, alt_regno, cfa_off, n_varargs;
@@ -2408,17 +2405,6 @@ ia64_expand_prologue ()
reg_names[current_frame_info.reg_fp] = tmp;
}
- /* Fix up the return address placeholder. */
- /* ??? We can fail if __builtin_return_address is used, and we didn't
- allocate a register in which to save b0. I can't think of a way to
- eliminate RETURN_ADDRESS_POINTER_REGNUM to a local register and
- then be sure that I got the right one. Further, reload doesn't seem
- to care if an eliminable register isn't used, and "eliminates" it
- anyway. */
- if (regs_ever_live[RETURN_ADDRESS_POINTER_REGNUM]
- && current_frame_info.reg_save_b0 != 0)
- XINT (return_address_pointer_rtx, 0) = current_frame_info.reg_save_b0;
-
/* We don't need an alloc instruction if we've used no outputs or locals. */
if (current_frame_info.n_local_regs == 0
&& current_frame_info.n_output_regs == 0
@@ -2440,7 +2426,7 @@ ia64_expand_prologue ()
regno = next_scratch_gr_reg ();
ar_pfs_save_reg = gen_rtx_REG (DImode, regno);
- insn = emit_insn (gen_alloc (ar_pfs_save_reg,
+ insn = emit_insn (gen_alloc (ar_pfs_save_reg,
GEN_INT (current_frame_info.n_input_regs),
GEN_INT (current_frame_info.n_local_regs),
GEN_INT (current_frame_info.n_output_regs),
@@ -2470,7 +2456,7 @@ ia64_expand_prologue ()
else
{
regno = next_scratch_gr_reg ();
- offset = gen_rtx_REG (DImode, regno);
+ offset = gen_rtx_REG (DImode, regno);
emit_move_insn (offset, frame_size_rtx);
}
@@ -2707,8 +2693,7 @@ ia64_expand_prologue ()
insn to prevent such scheduling. */
void
-ia64_expand_epilogue (sibcall_p)
- int sibcall_p;
+ia64_expand_epilogue (int sibcall_p)
{
rtx insn, reg, alt_reg, ar_unat_save_reg;
int regno, alt_regno, cfa_off;
@@ -2722,7 +2707,7 @@ ia64_expand_epilogue (sibcall_p)
setup_spill_pointers (current_frame_info.n_spilled,
hard_frame_pointer_rtx, 0);
else
- setup_spill_pointers (current_frame_info.n_spilled, stack_pointer_rtx,
+ setup_spill_pointers (current_frame_info.n_spilled, stack_pointer_rtx,
current_frame_info.total_size);
if (current_frame_info.total_size != 0)
@@ -2774,7 +2759,7 @@ ia64_expand_epilogue (sibcall_p)
}
else
ar_unat_save_reg = NULL_RTX;
-
+
if (current_frame_info.reg_save_ar_pfs != 0)
{
alt_reg = gen_rtx_REG (DImode, current_frame_info.reg_save_ar_pfs);
@@ -2824,7 +2809,7 @@ ia64_expand_epilogue (sibcall_p)
do_restore (gen_gr_restore, reg, cfa_off);
cfa_off -= 8;
}
-
+
/* Restore the branch registers. Handle B0 specially, as it may
have gotten stored in some GR register. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, BR_REG (0)))
@@ -2841,7 +2826,7 @@ ia64_expand_epilogue (sibcall_p)
reg = gen_rtx_REG (DImode, BR_REG (0));
emit_move_insn (reg, alt_reg);
}
-
+
for (regno = BR_REG (1); regno <= BR_REG (7); ++regno)
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
{
@@ -2925,15 +2910,15 @@ ia64_expand_epilogue (sibcall_p)
if (cfun->machine->ia64_eh_epilogue_bsp)
emit_insn (gen_set_bsp (cfun->machine->ia64_eh_epilogue_bsp));
-
+
if (! sibcall_p)
emit_jump_insn (gen_return_internal (gen_rtx_REG (DImode, BR_REG (0))));
else
{
int fp = GR_REG (2);
/* We need a throw away register here, r0 and r1 are reserved, so r2 is the
- first available call clobbered register. If there was a frame_pointer
- register, we may have swapped the names of r2 and HARD_FRAME_POINTER_REGNUM,
+ first available call clobbered register. If there was a frame_pointer
+ register, we may have swapped the names of r2 and HARD_FRAME_POINTER_REGNUM,
so we have to make sure we're using the string "r2" when emitting
the register name for the assembler. */
if (current_frame_info.reg_fp && current_frame_info.reg_fp == GR_REG (2))
@@ -2958,7 +2943,7 @@ ia64_expand_epilogue (sibcall_p)
function. */
int
-ia64_direct_return ()
+ia64_direct_return (void)
{
if (reload_completed && ! frame_pointer_needed)
{
@@ -2975,10 +2960,71 @@ ia64_direct_return ()
return 0;
}
+/* Return the magic cookie that we use to hold the return address
+ during early compilation. */
+
+rtx
+ia64_return_addr_rtx (HOST_WIDE_INT count, rtx frame ATTRIBUTE_UNUSED)
+{
+ if (count != 0)
+ return NULL;
+ return gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), UNSPEC_RET_ADDR);
+}
+
+/* Split this value after reload, now that we know where the return
+ address is saved. */
+
+void
+ia64_split_return_addr_rtx (rtx dest)
+{
+ rtx src;
+
+ if (TEST_HARD_REG_BIT (current_frame_info.mask, BR_REG (0)))
+ {
+ if (current_frame_info.reg_save_b0 != 0)
+ src = gen_rtx_REG (DImode, current_frame_info.reg_save_b0);
+ else
+ {
+ HOST_WIDE_INT off;
+ unsigned int regno;
+
+ /* Compute offset from CFA for BR0. */
+ /* ??? Must be kept in sync with ia64_expand_prologue. */
+ off = (current_frame_info.spill_cfa_off
+ + current_frame_info.spill_size);
+ for (regno = GR_REG (1); regno <= GR_REG (31); ++regno)
+ if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
+ off -= 8;
+
+ /* Convert CFA offset to a register based offset. */
+ if (frame_pointer_needed)
+ src = hard_frame_pointer_rtx;
+ else
+ {
+ src = stack_pointer_rtx;
+ off += current_frame_info.total_size;
+ }
+
+ /* Load address into scratch register. */
+ if (CONST_OK_FOR_I (off))
+ emit_insn (gen_adddi3 (dest, src, GEN_INT (off)));
+ else
+ {
+ emit_move_insn (dest, GEN_INT (off));
+ emit_insn (gen_adddi3 (dest, src, dest));
+ }
+
+ src = gen_rtx_MEM (Pmode, dest);
+ }
+ }
+ else
+ src = gen_rtx_REG (DImode, BR_REG (0));
+
+ emit_move_insn (dest, src);
+}
+
int
-ia64_hard_regno_rename_ok (from, to)
- int from;
- int to;
+ia64_hard_regno_rename_ok (int from, int to)
{
/* Don't clobber any of the registers we reserved for the prologue. */
if (to == current_frame_info.reg_fp
@@ -3012,10 +3058,7 @@ ia64_hard_regno_rename_ok (from, to)
aligned objects and detect the cases when @fptr is needed. */
static bool
-ia64_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+ia64_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if (size == (TARGET_ILP32 ? 4 : 8)
&& aligned_p
@@ -3037,9 +3080,7 @@ ia64_assemble_integer (x, size, aligned_p)
/* Emit the function prologue. */
static void
-ia64_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+ia64_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
int mask, grsave, grsave_prev;
@@ -3106,8 +3147,7 @@ ia64_output_function_prologue (file, size)
/* Emit the .body directive at the scheduled end of the prologue. */
static void
-ia64_output_function_end_prologue (file)
- FILE *file;
+ia64_output_function_end_prologue (FILE *file)
{
if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
return;
@@ -3118,15 +3158,11 @@ ia64_output_function_end_prologue (file)
/* Emit the function epilogue. */
static void
-ia64_output_function_epilogue (file, size)
- FILE *file ATTRIBUTE_UNUSED;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+ia64_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
int i;
- /* Reset from the function's potential modifications. */
- XINT (return_address_pointer_rtx, 0) = RETURN_ADDRESS_POINTER_REGNUM;
-
if (current_frame_info.reg_fp)
{
const char *tmp = reg_names[HARD_FRAME_POINTER_REGNUM];
@@ -3148,8 +3184,7 @@ ia64_output_function_epilogue (file, size)
}
int
-ia64_dbx_register_number (regno)
- int regno;
+ia64_dbx_register_number (int regno)
{
/* In ia64_expand_prologue we quite literally renamed the frame pointer
from its home at loc79 to something inside the register frame. We
@@ -3174,8 +3209,7 @@ ia64_dbx_register_number (regno)
}
void
-ia64_initialize_trampoline (addr, fnaddr, static_chain)
- rtx addr, fnaddr, static_chain;
+ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
{
rtx addr_reg, eight = GEN_INT (8);
@@ -3207,12 +3241,9 @@ ia64_initialize_trampoline (addr, fnaddr, static_chain)
We generate the actual spill instructions during prologue generation. */
void
-ia64_setup_incoming_varargs (cum, int_mode, type, pretend_size, second_time)
- CUMULATIVE_ARGS cum;
- int int_mode;
- tree type;
- int * pretend_size;
- int second_time ATTRIBUTE_UNUSED;
+ia64_setup_incoming_varargs (CUMULATIVE_ARGS cum, int int_mode, tree type,
+ int * pretend_size,
+ int second_time ATTRIBUTE_UNUSED)
{
/* Skip the current argument. */
ia64_function_arg_advance (&cum, int_mode, type, 1);
@@ -3234,9 +3265,7 @@ ia64_setup_incoming_varargs (cum, int_mode, type, pretend_size, second_time)
SFmode). 128-bit quad-precision floats are excluded. */
static enum machine_mode
-hfa_element_mode (type, nested)
- tree type;
- int nested;
+hfa_element_mode (tree type, int nested)
{
enum machine_mode element_mode = VOIDmode;
enum machine_mode mode;
@@ -3317,12 +3346,8 @@ hfa_element_mode (type, nested)
registers. */
rtx
-ia64_function_arg (cum, mode, type, named, incoming)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
- int incoming;
+ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
+ int named, int incoming)
{
int basereg = (incoming ? GR_ARG_FIRST : AR_ARG_FIRST);
int words = (((mode == BLKmode ? int_size_in_bytes (type)
@@ -3493,11 +3518,8 @@ ia64_function_arg (cum, mode, type, named, incoming)
in memory. */
int
-ia64_function_arg_partial_nregs (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named ATTRIBUTE_UNUSED)
{
int words = (((mode == BLKmode ? int_size_in_bytes (type)
: GET_MODE_SIZE (mode)) + UNITS_PER_WORD - 1)
@@ -3530,11 +3552,8 @@ ia64_function_arg_partial_nregs (cum, mode, type, named)
ia64_function_arg. */
void
-ia64_function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
+ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named)
{
int words = (((mode == BLKmode ? int_size_in_bytes (type)
: GET_MODE_SIZE (mode)) + UNITS_PER_WORD - 1)
@@ -3614,7 +3633,7 @@ ia64_function_arg_advance (cum, mode, type, named)
/* If there is no prototype, then FP values go in both FR and GR
registers. */
else
- {
+ {
/* ??? Complex types should not reach here. */
cum->fp_regs += (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT ? 2 : 1);
cum->int_regs = cum->words;
@@ -3625,11 +3644,9 @@ ia64_function_arg_advance (cum, mode, type, named)
/* ??? At present this is a GCC extension to the IA-64 ABI. */
int
-ia64_function_arg_pass_by_reference (cum, mode, type, named)
- CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- tree type;
- int named ATTRIBUTE_UNUSED;
+ia64_function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type, int named ATTRIBUTE_UNUSED)
{
return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST;
}
@@ -3638,26 +3655,18 @@ ia64_function_arg_pass_by_reference (cum, mode, type, named)
call expression EXP. DECL will be the called function, or NULL if
this is an indirect call. */
static bool
-ia64_function_ok_for_sibcall (decl, exp)
- tree decl;
- tree exp ATTRIBUTE_UNUSED;
+ia64_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
- /* Direct calls are always ok. */
- if (decl)
- return true;
-
- /* If TARGET_CONST_GP is in effect, then our caller expects us to
- return with our current GP. This means that we'll always have
- a GP reload after an indirect call. */
- return !ia64_epilogue_uses (R_GR (1));
+ /* We must always return with our current GP. This means we can
+ only sibcall to functions defined in the current module. */
+ return decl && (*targetm.binds_local_p) (decl);
}
/* Implement va_arg. */
rtx
-ia64_va_arg (valist, type)
- tree valist, type;
+ia64_va_arg (tree valist, tree type)
{
tree t;
@@ -3688,8 +3697,7 @@ ia64_va_arg (valist, type)
in a register. */
int
-ia64_return_in_memory (valtype)
- tree valtype;
+ia64_return_in_memory (tree valtype)
{
enum machine_mode mode;
enum machine_mode hfa_mode;
@@ -3725,9 +3733,7 @@ ia64_return_in_memory (valtype)
/* Return rtx for register that holds the function return value. */
rtx
-ia64_function_value (valtype, func)
- tree valtype;
- tree func ATTRIBUTE_UNUSED;
+ia64_function_value (tree valtype, tree func ATTRIBUTE_UNUSED)
{
enum machine_mode mode;
enum machine_mode hfa_mode;
@@ -3794,10 +3800,7 @@ ia64_function_value (valtype, func)
We need to emit DTP-relative relocations. */
void
-ia64_output_dwarf_dtprel (file, size, x)
- FILE *file;
- int size;
- rtx x;
+ia64_output_dwarf_dtprel (FILE *file, int size, rtx x)
{
if (size != 8)
abort ();
@@ -3812,9 +3815,8 @@ ia64_output_dwarf_dtprel (file, size, x)
also call this from ia64_print_operand for memory addresses. */
void
-ia64_print_operand_address (stream, address)
- FILE * stream ATTRIBUTE_UNUSED;
- rtx address ATTRIBUTE_UNUSED;
+ia64_print_operand_address (FILE * stream ATTRIBUTE_UNUSED,
+ rtx address ATTRIBUTE_UNUSED)
{
}
@@ -3839,10 +3841,7 @@ ia64_print_operand_address (stream, address)
r Print register name, or constant 0 as r0. HP compatibility for
Linux kernel. */
void
-ia64_print_operand (file, x, code)
- FILE * file;
- rtx x;
- int code;
+ia64_print_operand (FILE * file, rtx x, int code)
{
const char *str;
@@ -4001,7 +4000,7 @@ ia64_print_operand (file, x, code)
case '+':
{
const char *which;
-
+
/* For conditional branches, returns or calls, substitute
sptk, dptk, dpnt, or spnt for %s. */
x = find_reg_note (current_output_insn, REG_BR_PROB, 0);
@@ -4080,10 +4079,7 @@ ia64_print_operand (file, x, code)
/* ??? This is incomplete. */
static bool
-ia64_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+ia64_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
@@ -4157,9 +4153,8 @@ ia64_rtx_costs (x, code, outer_code, total)
one in class TO, using MODE. */
int
-ia64_register_move_cost (mode, from, to)
- enum machine_mode mode;
- enum reg_class from, to;
+ia64_register_move_cost (enum machine_mode mode, enum reg_class from,
+ enum reg_class to)
{
/* ADDL_REGS is the same as GR_REGS for movement purposes. */
if (to == ADDL_REGS)
@@ -4231,10 +4226,8 @@ ia64_register_move_cost (mode, from, to)
is required. */
enum reg_class
-ia64_secondary_reload_class (class, mode, x)
- enum reg_class class;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- rtx x;
+ia64_secondary_reload_class (enum reg_class class,
+ enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
int regno = -1;
@@ -4271,7 +4264,7 @@ ia64_secondary_reload_class (class, mode, x)
/* Need to go through general registers to get to other class regs. */
if (regno >= 0 && ! (FR_REGNO_P (regno) || GENERAL_REGNO_P (regno)))
return GR_REGS;
-
+
/* This can happen when a paradoxical subreg is an operand to the
muldi3 pattern. */
/* ??? This shouldn't be necessary after instruction scheduling is
@@ -4331,10 +4324,7 @@ ia64_secondary_reload_class (class, mode, x)
the Intel assembler does not support undefined externals. */
void
-ia64_asm_output_external (file, decl, name)
- FILE *file;
- tree decl;
- const char *name;
+ia64_asm_output_external (FILE *file, tree decl, const char *name)
{
int save_referenced;
@@ -4376,8 +4366,7 @@ ia64_asm_output_external (file, decl, name)
/* Parse the -mfixed-range= option string. */
static void
-fix_range (const_str)
- const char *const_str;
+fix_range (const char *const_str)
{
int i, first, last;
char *str, *dash, *comma;
@@ -4440,7 +4429,7 @@ fix_range (const_str)
}
static struct machine_function *
-ia64_init_machine_status ()
+ia64_init_machine_status (void)
{
return ggc_alloc_cleared (sizeof (struct machine_function));
}
@@ -4448,7 +4437,7 @@ ia64_init_machine_status ()
/* Handle TARGET_OPTIONS switches. */
void
-ia64_override_options ()
+ia64_override_options (void)
{
static struct pta
{
@@ -4520,12 +4509,11 @@ ia64_override_options ()
real_format_for_mode[TFmode - QFmode] = &ieee_extended_intel_128_format;
}
-static enum attr_itanium_class ia64_safe_itanium_class PARAMS((rtx));
-static enum attr_type ia64_safe_type PARAMS((rtx));
+static enum attr_itanium_class ia64_safe_itanium_class (rtx);
+static enum attr_type ia64_safe_type (rtx);
static enum attr_itanium_class
-ia64_safe_itanium_class (insn)
- rtx insn;
+ia64_safe_itanium_class (rtx insn)
{
if (recog_memoized (insn) >= 0)
return get_attr_itanium_class (insn);
@@ -4534,8 +4522,7 @@ ia64_safe_itanium_class (insn)
}
static enum attr_type
-ia64_safe_type (insn)
- rtx insn;
+ia64_safe_type (rtx insn)
{
if (recog_memoized (insn) >= 0)
return get_attr_type (insn);
@@ -4613,26 +4600,21 @@ struct reg_flags
unsigned int is_sibcall : 1; /* Is this a sibling or normal call? */
};
-static void rws_update PARAMS ((struct reg_write_state *, int,
- struct reg_flags, int));
-static int rws_access_regno PARAMS ((int, struct reg_flags, int));
-static int rws_access_reg PARAMS ((rtx, struct reg_flags, int));
-static void update_set_flags PARAMS ((rtx, struct reg_flags *, int *, rtx *));
-static int set_src_needs_barrier PARAMS ((rtx, struct reg_flags, int, rtx));
-static int rtx_needs_barrier PARAMS ((rtx, struct reg_flags, int));
-static void init_insn_group_barriers PARAMS ((void));
-static int group_barrier_needed_p PARAMS ((rtx));
-static int safe_group_barrier_needed_p PARAMS ((rtx));
+static void rws_update (struct reg_write_state *, int, struct reg_flags, int);
+static int rws_access_regno (int, struct reg_flags, int);
+static int rws_access_reg (rtx, struct reg_flags, int);
+static void update_set_flags (rtx, struct reg_flags *, int *, rtx *);
+static int set_src_needs_barrier (rtx, struct reg_flags, int, rtx);
+static int rtx_needs_barrier (rtx, struct reg_flags, int);
+static void init_insn_group_barriers (void);
+static int group_barrier_needed_p (rtx);
+static int safe_group_barrier_needed_p (rtx);
/* Update *RWS for REGNO, which is being written by the current instruction,
with predicate PRED, and associated register flags in FLAGS. */
static void
-rws_update (rws, regno, flags, pred)
- struct reg_write_state *rws;
- int regno;
- struct reg_flags flags;
- int pred;
+rws_update (struct reg_write_state *rws, int regno, struct reg_flags flags, int pred)
{
if (pred)
rws[regno].write_count++;
@@ -4650,10 +4632,7 @@ rws_update (rws, regno, flags, pred)
a dependency with an earlier instruction in the same group. */
static int
-rws_access_regno (regno, flags, pred)
- int regno;
- struct reg_flags flags;
- int pred;
+rws_access_regno (int regno, struct reg_flags flags, int pred)
{
int need_barrier = 0;
@@ -4688,7 +4667,7 @@ rws_access_regno (regno, flags, pred)
/* ??? This assumes that P and P+1 are always complementary
predicates for P even. */
if (flags.is_and && rws_sum[regno].written_by_and)
- ;
+ ;
else if (flags.is_or && rws_sum[regno].written_by_or)
;
else if ((rws_sum[regno].first_pred ^ 1) != pred)
@@ -4771,10 +4750,7 @@ rws_access_regno (regno, flags, pred)
}
static int
-rws_access_reg (reg, flags, pred)
- rtx reg;
- struct reg_flags flags;
- int pred;
+rws_access_reg (rtx reg, struct reg_flags flags, int pred)
{
int regno = REGNO (reg);
int n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
@@ -4794,11 +4770,7 @@ rws_access_reg (reg, flags, pred)
the condition, stored in *PFLAGS, *PPRED and *PCOND. */
static void
-update_set_flags (x, pflags, ppred, pcond)
- rtx x;
- struct reg_flags *pflags;
- int *ppred;
- rtx *pcond;
+update_set_flags (rtx x, struct reg_flags *pflags, int *ppred, rtx *pcond)
{
rtx src = SET_SRC (x);
@@ -4812,7 +4784,7 @@ update_set_flags (x, pflags, ppred, pcond)
case IF_THEN_ELSE:
if (SET_DEST (x) == pc_rtx)
/* X is a conditional branch. */
- return;
+ return;
else
{
int is_complemented = 0;
@@ -4875,13 +4847,9 @@ update_set_flags (x, pflags, ppred, pcond)
source of a given SET rtx found in X needs a barrier. FLAGS and PRED
are as in rtx_needs_barrier. COND is an rtx that holds the condition
for this insn. */
-
+
static int
-set_src_needs_barrier (x, flags, pred, cond)
- rtx x;
- struct reg_flags flags;
- int pred;
- rtx cond;
+set_src_needs_barrier (rtx x, struct reg_flags flags, int pred, rtx cond)
{
int need_barrier = 0;
rtx dst;
@@ -4921,10 +4889,7 @@ set_src_needs_barrier (x, flags, pred, cond)
in the same group. */
static int
-rtx_needs_barrier (x, flags, pred)
- rtx x;
- struct reg_flags flags;
- int pred;
+rtx_needs_barrier (rtx x, struct reg_flags flags, int pred)
{
int i, j;
int is_complemented = 0;
@@ -4940,7 +4905,7 @@ rtx_needs_barrier (x, flags, pred)
switch (GET_CODE (x))
{
- case SET:
+ case SET:
update_set_flags (x, &new_flags, &pred, &cond);
need_barrier = set_src_needs_barrier (x, new_flags, pred, cond);
if (GET_CODE (SET_SRC (x)) != CALL)
@@ -5143,7 +5108,7 @@ rtx_needs_barrier (x, flags, pred)
new_flags, pred);
break;
}
-
+
case UNSPEC_FR_SPILL:
case UNSPEC_FR_RESTORE:
case UNSPEC_GETF_EXP:
@@ -5245,7 +5210,7 @@ rtx_needs_barrier (x, flags, pred)
sequence of insns. */
static void
-init_insn_group_barriers ()
+init_insn_group_barriers (void)
{
memset (rws_sum, 0, sizeof (rws_sum));
first_instruction = 1;
@@ -5256,8 +5221,7 @@ init_insn_group_barriers ()
Return nonzero if so. */
static int
-group_barrier_needed_p (insn)
- rtx insn;
+group_barrier_needed_p (rtx insn)
{
rtx pat;
int need_barrier = 0;
@@ -5368,8 +5332,7 @@ group_barrier_needed_p (insn)
/* Like group_barrier_needed_p, but do not clobber the current state. */
static int
-safe_group_barrier_needed_p (insn)
- rtx insn;
+safe_group_barrier_needed_p (rtx insn)
{
struct reg_write_state rws_saved[NUM_REGS];
int saved_first_instruction;
@@ -5394,8 +5357,7 @@ safe_group_barrier_needed_p (insn)
invisible to the scheduler. */
static void
-emit_insn_group_barriers (dump)
- FILE *dump;
+emit_insn_group_barriers (FILE *dump)
{
rtx insn;
rtx last_label = 0;
@@ -5451,8 +5413,7 @@ emit_insn_group_barriers (dump)
This function has to emit all necessary group barriers. */
static void
-emit_all_insn_group_barriers (dump)
- FILE *dump ATTRIBUTE_UNUSED;
+emit_all_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED)
{
rtx insn;
@@ -5489,9 +5450,9 @@ emit_all_insn_group_barriers (dump)
}
-static int errata_find_address_regs PARAMS ((rtx *, void *));
-static void errata_emit_nops PARAMS ((rtx));
-static void fixup_errata PARAMS ((void));
+static int errata_find_address_regs (rtx *, void *);
+static void errata_emit_nops (rtx);
+static void fixup_errata (void);
/* This structure is used to track some details about the previous insns
groups so we can determine if it may be necessary to insert NOPs to
@@ -5509,9 +5470,7 @@ static int group_idx;
conditionally set in the previous group is used as an address register.
It ensures that for_each_rtx returns 1 in that case. */
static int
-errata_find_address_regs (xp, data)
- rtx *xp;
- void *data ATTRIBUTE_UNUSED;
+errata_find_address_regs (rtx *xp, void *data ATTRIBUTE_UNUSED)
{
rtx x = *xp;
if (GET_CODE (x) != MEM)
@@ -5534,8 +5493,7 @@ errata_find_address_regs (xp, data)
last_group and emits additional NOPs if necessary to work around
an Itanium A/B step erratum. */
static void
-errata_emit_nops (insn)
- rtx insn;
+errata_emit_nops (rtx insn)
{
struct group *this_group = last_group + group_idx;
struct group *prev_group = last_group + (group_idx ^ 1);
@@ -5608,7 +5566,7 @@ errata_emit_nops (insn)
/* Emit extra nops if they are required to work around hardware errata. */
static void
-fixup_errata ()
+fixup_errata (void)
{
rtx insn;
@@ -5717,14 +5675,13 @@ static int *clocks;
static int *add_cycles;
-static rtx ia64_single_set PARAMS ((rtx));
-static void ia64_emit_insn_before PARAMS ((rtx, rtx));
+static rtx ia64_single_set (rtx);
+static void ia64_emit_insn_before (rtx, rtx);
/* Map a bundle number to its pseudo-op. */
const char *
-get_bundle_name (b)
- int b;
+get_bundle_name (int b)
{
return bundle_name[b];
}
@@ -5733,7 +5690,7 @@ get_bundle_name (b)
/* Return the maximum number of instructions a cpu can issue. */
static int
-ia64_issue_rate ()
+ia64_issue_rate (void)
{
return 6;
}
@@ -5741,8 +5698,7 @@ ia64_issue_rate ()
/* Helper function - like single_set, but look inside COND_EXEC. */
static rtx
-ia64_single_set (insn)
- rtx insn;
+ia64_single_set (rtx insn)
{
rtx x = PATTERN (insn), ret;
if (GET_CODE (x) == COND_EXEC)
@@ -5772,9 +5728,7 @@ ia64_single_set (insn)
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
static int
-ia64_adjust_cost (insn, link, dep_insn, cost)
- rtx insn, link, dep_insn;
- int cost;
+ia64_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
{
enum attr_itanium_class dep_class;
enum attr_itanium_class insn_class;
@@ -5795,8 +5749,7 @@ ia64_adjust_cost (insn, link, dep_insn, cost)
??? When cycle display notes are implemented, update this. */
static void
-ia64_emit_insn_before (insn, before)
- rtx insn, before;
+ia64_emit_insn_before (rtx insn, rtx before)
{
emit_insn_before (insn, before);
}
@@ -5807,11 +5760,10 @@ ia64_emit_insn_before (insn, before)
`ia64_produce_address_p' and the DFA descriptions). */
static void
-ia64_dependencies_evaluation_hook (head, tail)
- rtx head, tail;
+ia64_dependencies_evaluation_hook (rtx head, rtx tail)
{
rtx insn, link, next, next_tail;
-
+
next_tail = NEXT_INSN (tail);
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
if (INSN_P (insn))
@@ -5840,14 +5792,13 @@ ia64_dependencies_evaluation_hook (head, tail)
/* We're beginning a new block. Initialize data structures as necessary. */
static void
-ia64_sched_init (dump, sched_verbose, max_ready)
- FILE *dump ATTRIBUTE_UNUSED;
- int sched_verbose ATTRIBUTE_UNUSED;
- int max_ready ATTRIBUTE_UNUSED;
+ia64_sched_init (FILE *dump ATTRIBUTE_UNUSED,
+ int sched_verbose ATTRIBUTE_UNUSED,
+ int max_ready ATTRIBUTE_UNUSED)
{
#ifdef ENABLE_CHECKING
rtx insn;
-
+
if (reload_completed)
for (insn = NEXT_INSN (current_sched_info->prev_head);
insn != current_sched_info->next_tail;
@@ -5863,14 +5814,9 @@ ia64_sched_init (dump, sched_verbose, max_ready)
Override the default sort algorithm to better slot instructions. */
static int
-ia64_dfa_sched_reorder (dump, sched_verbose, ready, pn_ready,
- clock_var, reorder_type)
- FILE *dump;
- int sched_verbose;
- rtx *ready;
- int *pn_ready;
- int clock_var ATTRIBUTE_UNUSED;
- int reorder_type;
+ia64_dfa_sched_reorder (FILE *dump, int sched_verbose, rtx *ready,
+ int *pn_ready, int clock_var ATTRIBUTE_UNUSED,
+ int reorder_type)
{
int n_asms;
int n_ready = *pn_ready;
@@ -5927,7 +5873,7 @@ ia64_dfa_sched_reorder (dump, sched_verbose, ready, pn_ready,
for (insnp = ready; insnp < e_ready; insnp++)
if (safe_group_barrier_needed_p (*insnp))
nr_need_stop++;
-
+
if (reorder_type == 1 && n_ready == nr_need_stop)
return 0;
if (reorder_type == 0)
@@ -5956,12 +5902,8 @@ ia64_dfa_sched_reorder (dump, sched_verbose, ready, pn_ready,
the default sort algorithm to better slot instructions. */
static int
-ia64_sched_reorder (dump, sched_verbose, ready, pn_ready, clock_var)
- FILE *dump;
- int sched_verbose;
- rtx *ready;
- int *pn_ready;
- int clock_var;
+ia64_sched_reorder (FILE *dump, int sched_verbose, rtx *ready, int *pn_ready,
+ int clock_var)
{
return ia64_dfa_sched_reorder (dump, sched_verbose, ready,
pn_ready, clock_var, 0);
@@ -5971,12 +5913,9 @@ ia64_sched_reorder (dump, sched_verbose, ready, pn_ready, clock_var)
Override the default sort algorithm to better slot instructions. */
static int
-ia64_sched_reorder2 (dump, sched_verbose, ready, pn_ready, clock_var)
- FILE *dump ATTRIBUTE_UNUSED;
- int sched_verbose ATTRIBUTE_UNUSED;
- rtx *ready;
- int *pn_ready;
- int clock_var;
+ia64_sched_reorder2 (FILE *dump ATTRIBUTE_UNUSED,
+ int sched_verbose ATTRIBUTE_UNUSED, rtx *ready,
+ int *pn_ready, int clock_var)
{
if (ia64_tune == PROCESSOR_ITANIUM && reload_completed && last_scheduled_insn)
clocks [INSN_UID (last_scheduled_insn)] = clock_var;
@@ -5988,11 +5927,10 @@ ia64_sched_reorder2 (dump, sched_verbose, ready, pn_ready, clock_var)
ready queue that can be issued this cycle. */
static int
-ia64_variable_issue (dump, sched_verbose, insn, can_issue_more)
- FILE *dump ATTRIBUTE_UNUSED;
- int sched_verbose ATTRIBUTE_UNUSED;
- rtx insn ATTRIBUTE_UNUSED;
- int can_issue_more ATTRIBUTE_UNUSED;
+ia64_variable_issue (FILE *dump ATTRIBUTE_UNUSED,
+ int sched_verbose ATTRIBUTE_UNUSED,
+ rtx insn ATTRIBUTE_UNUSED,
+ int can_issue_more ATTRIBUTE_UNUSED)
{
last_scheduled_insn = insn;
memcpy (prev_cycle_state, curr_state, dfa_state_size);
@@ -6012,8 +5950,7 @@ ia64_variable_issue (dump, sched_verbose, insn, can_issue_more)
can be chosen. */
static int
-ia64_first_cycle_multipass_dfa_lookahead_guard (insn)
- rtx insn;
+ia64_first_cycle_multipass_dfa_lookahead_guard (rtx insn)
{
if (insn == NULL_RTX || !INSN_P (insn))
abort ();
@@ -6032,12 +5969,8 @@ static rtx dfa_pre_cycle_insn;
the ready queue on the next clock start. */
static int
-ia64_dfa_new_cycle (dump, verbose, insn, last_clock, clock, sort_p)
- FILE *dump;
- int verbose;
- rtx insn;
- int last_clock, clock;
- int *sort_p;
+ia64_dfa_new_cycle (FILE *dump, int verbose, rtx insn, int last_clock,
+ int clock, int *sort_p)
{
int setup_clocks_p = FALSE;
@@ -6076,18 +6009,18 @@ ia64_dfa_new_cycle (dump, verbose, insn, last_clock, clock, sort_p)
if (setup_clocks_p && ia64_tune == PROCESSOR_ITANIUM)
{
enum attr_itanium_class c = ia64_safe_itanium_class (insn);
-
+
if (c != ITANIUM_CLASS_MMMUL && c != ITANIUM_CLASS_MMSHF)
{
rtx link;
int d = -1;
-
+
for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
if (REG_NOTE_KIND (link) == 0)
{
enum attr_itanium_class dep_class;
rtx dep_insn = XEXP (link, 0);
-
+
dep_class = ia64_safe_itanium_class (dep_insn);
if ((dep_class == ITANIUM_CLASS_MMMUL
|| dep_class == ITANIUM_CLASS_MMSHF)
@@ -6153,7 +6086,7 @@ static struct bundle_state *free_bundle_state_chain;
/* The following function returns a free bundle state. */
static struct bundle_state *
-get_free_bundle_state ()
+get_free_bundle_state (void)
{
struct bundle_state *result;
@@ -6171,14 +6104,13 @@ get_free_bundle_state ()
}
result->unique_num = bundle_states_num++;
return result;
-
+
}
/* The following function frees given bundle state. */
static void
-free_bundle_state (state)
- struct bundle_state *state;
+free_bundle_state (struct bundle_state *state)
{
state->next = free_bundle_state_chain;
free_bundle_state_chain = state;
@@ -6187,7 +6119,7 @@ free_bundle_state (state)
/* Start work with abstract data `bundle states'. */
static void
-initiate_bundle_states ()
+initiate_bundle_states (void)
{
bundle_states_num = 0;
free_bundle_state_chain = NULL;
@@ -6197,7 +6129,7 @@ initiate_bundle_states ()
/* Finish work with abstract data `bundle states'. */
static void
-finish_bundle_states ()
+finish_bundle_states (void)
{
struct bundle_state *curr_state, *next_state;
@@ -6219,8 +6151,7 @@ static htab_t bundle_state_table;
/* The function returns hash of BUNDLE_STATE. */
static unsigned
-bundle_state_hash (bundle_state)
- const void *bundle_state;
+bundle_state_hash (const void *bundle_state)
{
const struct bundle_state *state = (struct bundle_state *) bundle_state;
unsigned result, i;
@@ -6234,9 +6165,7 @@ bundle_state_hash (bundle_state)
/* The function returns nonzero if the bundle state keys are equal. */
static int
-bundle_state_eq_p (bundle_state_1, bundle_state_2)
- const void *bundle_state_1;
- const void *bundle_state_2;
+bundle_state_eq_p (const void *bundle_state_1, const void *bundle_state_2)
{
const struct bundle_state * state1 = (struct bundle_state *) bundle_state_1;
const struct bundle_state * state2 = (struct bundle_state *) bundle_state_2;
@@ -6251,8 +6180,7 @@ bundle_state_eq_p (bundle_state_1, bundle_state_2)
table. The table contains the best bundle state with given key. */
static int
-insert_bundle_state (bundle_state)
- struct bundle_state *bundle_state;
+insert_bundle_state (struct bundle_state *bundle_state)
{
void **entry_ptr;
@@ -6274,7 +6202,7 @@ insert_bundle_state (bundle_state)
&& ((struct bundle_state *)
*entry_ptr)->branch_deviation
> bundle_state->branch_deviation))))
-
+
{
struct bundle_state temp;
@@ -6289,7 +6217,7 @@ insert_bundle_state (bundle_state)
/* Start work with the hash table. */
static void
-initiate_bundle_state_table ()
+initiate_bundle_state_table (void)
{
bundle_state_table = htab_create (50, bundle_state_hash, bundle_state_eq_p,
(htab_del) 0);
@@ -6298,7 +6226,7 @@ initiate_bundle_state_table ()
/* Finish work with the hash table. */
static void
-finish_bundle_state_table ()
+finish_bundle_state_table (void)
{
htab_delete (bundle_state_table);
}
@@ -6315,9 +6243,7 @@ static rtx ia64_nop;
function returns FALSE and frees the current state. */
static int
-try_issue_nops (curr_state, nops_num)
- struct bundle_state *curr_state;
- int nops_num;
+try_issue_nops (struct bundle_state *curr_state, int nops_num)
{
int i;
@@ -6335,9 +6261,7 @@ try_issue_nops (curr_state, nops_num)
function returns FALSE and frees the current state. */
static int
-try_issue_insn (curr_state, insn)
- struct bundle_state *curr_state;
- rtx insn;
+try_issue_insn (struct bundle_state *curr_state, rtx insn)
{
if (insn && state_transition (curr_state->dfa_state, insn) >= 0)
{
@@ -6355,12 +6279,8 @@ try_issue_insn (curr_state, insn)
insert into the hash table and into `index_to_bundle_states'. */
static void
-issue_nops_and_insn (originator, before_nops_num, insn, try_bundle_end_p,
- only_bundle_end_p)
- struct bundle_state *originator;
- int before_nops_num;
- rtx insn;
- int try_bundle_end_p, only_bundle_end_p;
+issue_nops_and_insn (struct bundle_state *originator, int before_nops_num,
+ rtx insn, int try_bundle_end_p, int only_bundle_end_p)
{
struct bundle_state *curr_state;
@@ -6466,8 +6386,7 @@ issue_nops_and_insn (originator, before_nops_num, insn, try_bundle_end_p,
for given STATE. */
static int
-get_max_pos (state)
- state_t state;
+get_max_pos (state_t state)
{
if (cpu_unit_reservation_p (state, pos_6))
return 6;
@@ -6490,9 +6409,7 @@ get_max_pos (state)
position equal to 3 or 6. */
static int
-get_template (state, pos)
- state_t state;
- int pos;
+get_template (state_t state, int pos)
{
switch (pos)
{
@@ -6551,8 +6468,7 @@ get_template (state, pos)
followed by INSN and before TAIL. */
static rtx
-get_next_important_insn (insn, tail)
- rtx insn, tail;
+get_next_important_insn (rtx insn, rtx tail)
{
for (; insn && insn != tail; insn = NEXT_INSN (insn))
if (INSN_P (insn)
@@ -6572,10 +6488,7 @@ get_next_important_insn (insn, tail)
scheduling. */
static void
-bundling (dump, verbose, prev_head_insn, tail)
- FILE *dump;
- int verbose;
- rtx prev_head_insn, tail;
+bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
{
struct bundle_state *curr_state, *next_state, *best_state;
rtx insn, next_insn;
@@ -6690,7 +6603,7 @@ bundling (dump, verbose, prev_head_insn, tail)
unsigned short two_automaton_state;
unsigned short twob_automaton_state;
};
-
+
fprintf
(dump,
"// Bundle state %d (orig %d, cost %d, nops %d/%d, insns %d, branch %d, state %d) for %d\n",
@@ -6743,7 +6656,7 @@ bundling (dump, verbose, prev_head_insn, tail)
unsigned short two_automaton_state;
unsigned short twob_automaton_state;
};
-
+
fprintf
(dump,
"// Best %d (orig %d, cost %d, nops %d/%d, insns %d, branch %d, state %d) for %d\n",
@@ -6856,7 +6769,7 @@ bundling (dump, verbose, prev_head_insn, tail)
rtx last;
int i, j, n;
int pred_stop_p;
-
+
last = prev_active_insn (insn);
pred_stop_p = recog_memoized (last) == CODE_FOR_insn_group_barrier;
if (pred_stop_p)
@@ -6920,9 +6833,7 @@ bundling (dump, verbose, prev_head_insn, tail)
EBB. After reload, it inserts stop bits and does insn bundling. */
static void
-ia64_sched_finish (dump, sched_verbose)
- FILE *dump;
- int sched_verbose;
+ia64_sched_finish (FILE *dump, int sched_verbose)
{
if (sched_verbose)
fprintf (dump, "// Finishing schedule.\n");
@@ -6937,7 +6848,7 @@ ia64_sched_finish (dump, sched_verbose)
fprintf (dump, "// finishing %d-%d\n",
INSN_UID (NEXT_INSN (current_sched_info->prev_head)),
INSN_UID (PREV_INSN (current_sched_info->next_tail)));
-
+
return;
}
}
@@ -6945,8 +6856,7 @@ ia64_sched_finish (dump, sched_verbose)
/* The following function inserts stop bits in scheduled BB or EBB. */
static void
-final_emit_insn_group_barriers (dump)
- FILE *dump ATTRIBUTE_UNUSED;
+final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED)
{
rtx insn;
int need_barrier_p = 0;
@@ -6987,7 +6897,7 @@ final_emit_insn_group_barriers (dump)
if (TARGET_EARLY_STOP_BITS)
{
rtx last;
-
+
for (last = insn;
last != current_sched_info->prev_head;
last = PREV_INSN (last))
@@ -7032,7 +6942,7 @@ final_emit_insn_group_barriers (dump)
insn scheduler. */
static int
-ia64_use_dfa_pipeline_interface ()
+ia64_use_dfa_pipeline_interface (void)
{
return 1;
}
@@ -7041,7 +6951,7 @@ ia64_use_dfa_pipeline_interface ()
insn scheduler. */
static int
-ia64_first_cycle_multipass_dfa_lookahead ()
+ia64_first_cycle_multipass_dfa_lookahead (void)
{
return (reload_completed ? 6 : 4);
}
@@ -7049,7 +6959,7 @@ ia64_first_cycle_multipass_dfa_lookahead ()
/* The following function initiates variable `dfa_pre_cycle_insn'. */
static void
-ia64_init_dfa_pre_cycle_insn ()
+ia64_init_dfa_pre_cycle_insn (void)
{
if (temp_dfa_state == NULL)
{
@@ -7069,7 +6979,7 @@ ia64_init_dfa_pre_cycle_insn ()
used by the DFA insn scheduler. */
static rtx
-ia64_dfa_pre_cycle_insn ()
+ia64_dfa_pre_cycle_insn (void)
{
return dfa_pre_cycle_insn;
}
@@ -7078,9 +6988,7 @@ ia64_dfa_pre_cycle_insn ()
ld) produces address for CONSUMER (of type st or stf). */
int
-ia64_st_address_bypass_p (producer, consumer)
- rtx producer;
- rtx consumer;
+ia64_st_address_bypass_p (rtx producer, rtx consumer)
{
rtx dest, reg, mem;
@@ -7103,9 +7011,7 @@ ia64_st_address_bypass_p (producer, consumer)
ld) produces address for CONSUMER (of type ld or fld). */
int
-ia64_ld_address_bypass_p (producer, consumer)
- rtx producer;
- rtx consumer;
+ia64_ld_address_bypass_p (rtx producer, rtx consumer)
{
rtx dest, src, reg, mem;
@@ -7137,8 +7043,7 @@ ia64_ld_address_bypass_p (producer, consumer)
decreases its latency time. */
int
-ia64_produce_address_p (insn)
- rtx insn;
+ia64_produce_address_p (rtx insn)
{
return insn->call;
}
@@ -7150,7 +7055,7 @@ ia64_produce_address_p (insn)
straight-line code. */
static void
-emit_predicate_relation_info ()
+emit_predicate_relation_info (void)
{
basic_block bb;
@@ -7184,7 +7089,7 @@ emit_predicate_relation_info ()
FOR_EACH_BB_REVERSE (bb)
{
rtx insn = bb->head;
-
+
while (1)
{
if (GET_CODE (insn) == CALL_INSN
@@ -7198,7 +7103,7 @@ emit_predicate_relation_info ()
if (bb->end == insn)
bb->end = a;
}
-
+
if (insn == bb->end)
break;
insn = NEXT_INSN (insn);
@@ -7209,7 +7114,7 @@ emit_predicate_relation_info ()
/* Perform machine dependent operations on the rtl chain INSNS. */
static void
-ia64_reorg ()
+ia64_reorg (void)
{
/* We are freeing block_for_insn in the toplev to keep compatibility
with old MDEP_REORGS that are not CFG based. Recompute it now. */
@@ -7233,14 +7138,11 @@ ia64_reorg ()
PREV_INSN (ia64_nop) = NEXT_INSN (ia64_nop) = NULL_RTX;
recog_memoized (ia64_nop);
clocks_length = get_max_uid () + 1;
- stops_p = (char *) xmalloc (clocks_length);
- memset (stops_p, 0, clocks_length);
+ stops_p = xcalloc (1, clocks_length);
if (ia64_tune == PROCESSOR_ITANIUM)
{
- clocks = (int *) xmalloc (clocks_length * sizeof (int));
- memset (clocks, 0, clocks_length * sizeof (int));
- add_cycles = (int *) xmalloc (clocks_length * sizeof (int));
- memset (add_cycles, 0, clocks_length * sizeof (int));
+ clocks = xcalloc (clocks_length, sizeof (int));
+ add_cycles = xcalloc (clocks_length, sizeof (int));
}
if (ia64_tune == PROCESSOR_ITANIUM2)
{
@@ -7350,18 +7252,16 @@ ia64_reorg ()
/* Return true if REGNO is used by the epilogue. */
int
-ia64_epilogue_uses (regno)
- int regno;
+ia64_epilogue_uses (int regno)
{
switch (regno)
{
case R_GR (1):
- /* When a function makes a call through a function descriptor, we
- will write a (potentially) new value to "gp". After returning
- from such a call, we need to make sure the function restores the
- original gp-value, even if the function itself does not use the
- gp anymore. */
- return (TARGET_CONST_GP && !(TARGET_AUTO_PIC || TARGET_NO_PIC));
+ /* With a call to a function in another module, we will write a new
+ value to "gp". After returning from such a call, we need to make
+ sure the function restores the original gp-value, even if the
+ function itself does not use the gp anymore. */
+ return !(TARGET_AUTO_PIC || TARGET_NO_PIC);
case IN_REG (0): case IN_REG (1): case IN_REG (2): case IN_REG (3):
case IN_REG (4): case IN_REG (5): case IN_REG (6): case IN_REG (7):
@@ -7391,8 +7291,7 @@ ia64_epilogue_uses (regno)
/* Return true if REGNO is used by the frame unwinder. */
int
-ia64_eh_uses (regno)
- int regno;
+ia64_eh_uses (int regno)
{
if (! reload_completed)
return 0;
@@ -7424,8 +7323,7 @@ ia64_eh_uses (regno)
types which can't go in sdata/sbss. */
static bool
-ia64_in_small_data_p (exp)
- tree exp;
+ia64_in_small_data_p (tree exp)
{
if (TARGET_NO_SDATA)
return false;
@@ -7467,7 +7365,7 @@ static bool need_copy_state;
/* The function emits unwind directives for the start of an epilogue. */
static void
-process_epilogue ()
+process_epilogue (void)
{
/* If this isn't the last block of the function, then we need to label the
current state, and copy it back in at the start of the next block. */
@@ -7485,9 +7383,7 @@ process_epilogue ()
which result in emitting an assembly directive required for unwinding. */
static int
-process_set (asm_out_file, pat)
- FILE *asm_out_file;
- rtx pat;
+process_set (FILE *asm_out_file, rtx pat)
{
rtx src = SET_SRC (pat);
rtx dest = SET_DEST (pat);
@@ -7697,9 +7593,7 @@ process_set (asm_out_file, pat)
/* This function looks at a single insn and emits any directives
required to unwind this insn. */
void
-process_for_unwind_directive (asm_out_file, insn)
- FILE *asm_out_file;
- rtx insn;
+process_for_unwind_directive (FILE *asm_out_file, rtx insn)
{
if (flag_unwind_tables
|| (flag_exceptions && !USING_SJLJ_EXCEPTIONS))
@@ -7756,7 +7650,7 @@ process_for_unwind_directive (asm_out_file, insn)
void
-ia64_init_builtins ()
+ia64_init_builtins (void)
{
tree psi_type_node = build_pointer_type (integer_type_node);
tree pdi_type_node = build_pointer_type (long_integer_type_node);
@@ -7800,6 +7694,42 @@ ia64_init_builtins ()
tree void_ftype_pdi
= build_function_type_list (void_type_node, pdi_type_node, NULL_TREE);
+ tree fpreg_type;
+ tree float80_type;
+
+ /* The __fpreg type. */
+ fpreg_type = make_node (REAL_TYPE);
+ /* ??? Once the IA64 back end supports both 80-bit and 128-bit
+ floating types, this type should have XFmode, not TFmode.
+ TYPE_PRECISION should be 80 bits, not 128. And, the back end
+ should know to load/save __fpreg variables using the ldf.fill and
+ stf.spill instructions. */
+ TYPE_PRECISION (fpreg_type) = 128;
+ layout_type (fpreg_type);
+ (*lang_hooks.types.register_builtin_type) (fpreg_type, "__fpreg");
+
+ /* The __float80 type. */
+ float80_type = make_node (REAL_TYPE);
+ /* ??? Once the IA64 back end supports both 80-bit and 128-bit
+ floating types, this type should have XFmode, not TFmode.
+ TYPE_PRECISION should be 80 bits, not 128. */
+ TYPE_PRECISION (float80_type) = 128;
+ layout_type (float80_type);
+ (*lang_hooks.types.register_builtin_type) (float80_type, "__float80");
+
+ /* The __float128 type. */
+ if (INTEL_EXTENDED_IEEE_FORMAT)
+ {
+ tree float128_type = make_node (REAL_TYPE);
+ TYPE_PRECISION (float128_type) = 128;
+ layout_type (float128_type);
+ (*lang_hooks.types.register_builtin_type) (float128_type, "__float128");
+ }
+ else
+ /* This is a synonym for "long double". */
+ (*lang_hooks.types.register_builtin_type) (long_double_type_node,
+ "__float128");
+
#define def_builtin(name, type, code) \
builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL_TREE)
@@ -7828,8 +7758,8 @@ ia64_init_builtins ()
build_function_type (ptr_type_node, void_list_node),
IA64_BUILTIN_BSP);
- def_builtin ("__builtin_ia64_flushrs",
- build_function_type (void_type_node, void_list_node),
+ def_builtin ("__builtin_ia64_flushrs",
+ build_function_type (void_type_node, void_list_node),
IA64_BUILTIN_FLUSHRS);
def_builtin ("__sync_fetch_and_add_si", si_ftype_psi_si,
@@ -7900,11 +7830,8 @@ ia64_init_builtins ()
*/
static rtx
-ia64_expand_fetch_and_op (binoptab, mode, arglist, target)
- optab binoptab;
- enum machine_mode mode;
- tree arglist;
- rtx target;
+ia64_expand_fetch_and_op (optab binoptab, enum machine_mode mode,
+ tree arglist, rtx target)
{
rtx ret, label, tmp, ccv, insn, mem, value;
tree arg0, arg1;
@@ -7981,11 +7908,8 @@ ia64_expand_fetch_and_op (binoptab, mode, arglist, target)
*/
static rtx
-ia64_expand_op_and_fetch (binoptab, mode, arglist, target)
- optab binoptab;
- enum machine_mode mode;
- tree arglist;
- rtx target;
+ia64_expand_op_and_fetch (optab binoptab, enum machine_mode mode,
+ tree arglist, rtx target)
{
rtx old, label, tmp, ret, ccv, insn, mem, value;
tree arg0, arg1;
@@ -8049,12 +7973,8 @@ ia64_expand_op_and_fetch (binoptab, mode, arglist, target)
*/
static rtx
-ia64_expand_compare_and_swap (rmode, mode, boolp, arglist, target)
- enum machine_mode rmode;
- enum machine_mode mode;
- int boolp;
- tree arglist;
- rtx target;
+ia64_expand_compare_and_swap (enum machine_mode rmode, enum machine_mode mode,
+ int boolp, tree arglist, rtx target)
{
tree arg0, arg1, arg2;
rtx mem, old, new, ccv, tmp, insn;
@@ -8108,10 +8028,8 @@ ia64_expand_compare_and_swap (rmode, mode, boolp, arglist, target)
/* Expand lock_test_and_set. I.e. `xchgsz ret = [ptr], new'. */
static rtx
-ia64_expand_lock_test_and_set (mode, arglist, target)
- enum machine_mode mode;
- tree arglist;
- rtx target;
+ia64_expand_lock_test_and_set (enum machine_mode mode, tree arglist,
+ rtx target)
{
tree arg0, arg1;
rtx mem, new, ret, insn;
@@ -8143,10 +8061,8 @@ ia64_expand_lock_test_and_set (mode, arglist, target)
/* Expand lock_release. I.e. `stsz.rel [ptr] = r0'. */
static rtx
-ia64_expand_lock_release (mode, arglist, target)
- enum machine_mode mode;
- tree arglist;
- rtx target ATTRIBUTE_UNUSED;
+ia64_expand_lock_release (enum machine_mode mode, tree arglist,
+ rtx target ATTRIBUTE_UNUSED)
{
tree arg0;
rtx mem;
@@ -8163,12 +8079,9 @@ ia64_expand_lock_release (mode, arglist, target)
}
rtx
-ia64_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;
+ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int ignore ATTRIBUTE_UNUSED)
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
@@ -8327,9 +8240,7 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore)
most significant bits of the stack slot. */
enum direction
-ia64_hpux_function_arg_padding (mode, type)
- enum machine_mode mode;
- tree type;
+ia64_hpux_function_arg_padding (enum machine_mode mode, tree type)
{
/* Exception to normal case for structures/unions/etc. */
@@ -8337,14 +8248,8 @@ ia64_hpux_function_arg_padding (mode, type)
&& int_size_in_bytes (type) < UNITS_PER_WORD)
return upward;
- /* This is the standard FUNCTION_ARG_PADDING with !BYTES_BIG_ENDIAN
- hardwired to be true. */
-
- return((mode == BLKmode
- ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && int_size_in_bytes (type) < (PARM_BOUNDARY / BITS_PER_UNIT))
- : GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)
- ? downward : upward);
+ /* Fall back to the default. */
+ return DEFAULT_FUNCTION_ARG_PADDING (mode, type);
}
/* Linked list of all external functions that are to be emitted by GCC.
@@ -8358,8 +8263,7 @@ struct extern_func_list
} *extern_func_head = 0;
static void
-ia64_hpux_add_extern_decl (name)
- const char *name;
+ia64_hpux_add_extern_decl (const char *name)
{
struct extern_func_list *p;
@@ -8373,7 +8277,7 @@ ia64_hpux_add_extern_decl (name)
/* Print out the list of used global functions. */
static void
-ia64_hpux_file_end ()
+ia64_hpux_file_end (void)
{
while (extern_func_head)
{
@@ -8405,10 +8309,8 @@ ia64_hpux_file_end ()
special we do here is to honor small data. */
static void
-ia64_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align;
+ia64_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align)
{
if (GET_MODE_SIZE (mode) > 0
&& GET_MODE_SIZE (mode) <= ia64_section_threshold)
@@ -8421,27 +8323,20 @@ ia64_select_rtx_section (mode, x, align)
Pretend flag_pic is always set. */
static void
-ia64_rwreloc_select_section (exp, reloc, align)
- tree exp;
- int reloc;
- unsigned HOST_WIDE_INT align;
+ia64_rwreloc_select_section (tree exp, int reloc, unsigned HOST_WIDE_INT align)
{
default_elf_select_section_1 (exp, reloc, align, true);
}
static void
-ia64_rwreloc_unique_section (decl, reloc)
- tree decl;
- int reloc;
+ia64_rwreloc_unique_section (tree decl, int reloc)
{
default_unique_section_1 (decl, reloc, true);
}
static void
-ia64_rwreloc_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align;
+ia64_rwreloc_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align)
{
int save_pic = flag_pic;
flag_pic = 1;
@@ -8450,10 +8345,7 @@ ia64_rwreloc_select_rtx_section (mode, x, align)
}
static unsigned int
-ia64_rwreloc_section_type_flags (decl, name, reloc)
- tree decl;
- const char *name;
- int reloc;
+ia64_rwreloc_section_type_flags (tree decl, const char *name, int reloc)
{
return default_section_type_flags_1 (decl, name, reloc, true);
}
@@ -8466,12 +8358,9 @@ ia64_rwreloc_section_type_flags (decl, name, reloc)
*(*this + vcall_offset) should be added to THIS. */
static void
-ia64_output_mi_thunk (file, thunk, delta, vcall_offset, function)
- FILE *file;
- tree thunk ATTRIBUTE_UNUSED;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset;
- tree function;
+ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
+ tree function)
{
rtx this, insn, funexp;
@@ -8494,6 +8383,18 @@ ia64_output_mi_thunk (file, thunk, delta, vcall_offset, function)
emit_note (NOTE_INSN_PROLOGUE_END);
this = gen_rtx_REG (Pmode, IN_REG (0));
+ if (TARGET_ILP32)
+ {
+ rtx tmp = gen_rtx_REG (ptr_mode, IN_REG (0));
+ REG_POINTER (tmp) = 1;
+ if (delta && CONST_OK_FOR_I (delta))
+ {
+ emit_insn (gen_ptr_extend_plus_imm (this, tmp, GEN_INT (delta)));
+ delta = 0;
+ }
+ else
+ emit_insn (gen_ptr_extend (this, tmp));
+ }
/* Apply the constant offset, if required. */
if (delta)
@@ -8515,17 +8416,39 @@ ia64_output_mi_thunk (file, thunk, delta, vcall_offset, function)
rtx vcall_offset_rtx = GEN_INT (vcall_offset);
rtx tmp = gen_rtx_REG (Pmode, 2);
- emit_move_insn (tmp, gen_rtx_MEM (Pmode, this));
+ if (TARGET_ILP32)
+ {
+ rtx t = gen_rtx_REG (ptr_mode, 2);
+ REG_POINTER (t) = 1;
+ emit_move_insn (t, gen_rtx_MEM (ptr_mode, this));
+ if (CONST_OK_FOR_I (vcall_offset))
+ {
+ emit_insn (gen_ptr_extend_plus_imm (tmp, t,
+ vcall_offset_rtx));
+ vcall_offset = 0;
+ }
+ else
+ emit_insn (gen_ptr_extend (tmp, t));
+ }
+ else
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, this));
- if (!CONST_OK_FOR_J (vcall_offset))
+ if (vcall_offset)
{
- rtx tmp2 = gen_rtx_REG (Pmode, next_scratch_gr_reg ());
- emit_move_insn (tmp2, vcall_offset_rtx);
- vcall_offset_rtx = tmp2;
+ if (!CONST_OK_FOR_J (vcall_offset))
+ {
+ rtx tmp2 = gen_rtx_REG (Pmode, next_scratch_gr_reg ());
+ emit_move_insn (tmp2, vcall_offset_rtx);
+ vcall_offset_rtx = tmp2;
+ }
+ emit_insn (gen_adddi3 (tmp, tmp, vcall_offset_rtx));
}
- emit_insn (gen_adddi3 (tmp, tmp, vcall_offset_rtx));
- emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
+ if (TARGET_ILP32)
+ emit_move_insn (gen_rtx_REG (ptr_mode, 2),
+ gen_rtx_MEM (ptr_mode, tmp));
+ else
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
emit_insn (gen_adddi3 (this, this, tmp));
}
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index e7e1d29d613..a8bc569a7f0 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -455,7 +455,7 @@ while (0)
64 predicate registers, 8 branch registers, one frame pointer,
and several "application" registers. */
-#define FIRST_PSEUDO_REGISTER 335
+#define FIRST_PSEUDO_REGISTER 334
/* Ranges for the various kinds of registers. */
#define ADDL_REGNO_P(REGNO) ((unsigned HOST_WIDE_INT) (REGNO) <= 3)
@@ -464,9 +464,7 @@ while (0)
#define PR_REGNO_P(REGNO) ((REGNO) >= 256 && (REGNO) <= 319)
#define BR_REGNO_P(REGNO) ((REGNO) >= 320 && (REGNO) <= 327)
#define GENERAL_REGNO_P(REGNO) \
- (GR_REGNO_P (REGNO) \
- || (REGNO) == FRAME_POINTER_REGNUM \
- || (REGNO) == RETURN_ADDRESS_POINTER_REGNUM)
+ (GR_REGNO_P (REGNO) || (REGNO) == FRAME_POINTER_REGNUM)
#define GR_REG(REGNO) ((REGNO) + 0)
#define FR_REG(REGNO) ((REGNO) + 128)
@@ -476,11 +474,11 @@ while (0)
#define IN_REG(REGNO) ((REGNO) + 112)
#define LOC_REG(REGNO) ((REGNO) + 32)
-#define AR_CCV_REGNUM 330
-#define AR_UNAT_REGNUM 331
-#define AR_PFS_REGNUM 332
-#define AR_LC_REGNUM 333
-#define AR_EC_REGNUM 334
+#define AR_CCV_REGNUM 329
+#define AR_UNAT_REGNUM 330
+#define AR_PFS_REGNUM 331
+#define AR_LC_REGNUM 332
+#define AR_EC_REGNUM 333
#define IN_REGNO_P(REGNO) ((REGNO) >= IN_REG (0) && (REGNO) <= IN_REG (7))
#define LOC_REGNO_P(REGNO) ((REGNO) >= LOC_REG (0) && (REGNO) <= LOC_REG (79))
@@ -543,8 +541,8 @@ while (0)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* Branch registers. */ \
0, 0, 0, 0, 0, 0, 0, 0, \
- /*FP RA CCV UNAT PFS LC EC */ \
- 1, 1, 1, 1, 1, 0, 1 \
+ /*FP CCV UNAT PFS LC EC */ \
+ 1, 1, 1, 1, 0, 1 \
}
/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered
@@ -578,8 +576,8 @@ while (0)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* Branch registers. */ \
1, 0, 0, 0, 0, 0, 1, 1, \
- /*FP RA CCV UNAT PFS LC EC */ \
- 1, 1, 1, 1, 1, 0, 1 \
+ /*FP CCV UNAT PFS LC EC */ \
+ 1, 1, 1, 1, 0, 1 \
}
/* Like `CALL_USED_REGISTERS' but used to overcome a historical
@@ -616,8 +614,8 @@ while (0)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* Branch registers. */ \
1, 0, 0, 0, 0, 0, 1, 1, \
- /*FP RA CCV UNAT PFS LC EC */ \
- 0, 0, 1, 0, 1, 0, 0 \
+ /*FP CCV UNAT PFS LC EC */ \
+ 0, 1, 0, 1, 0, 0 \
}
@@ -763,7 +761,7 @@ while (0)
/* Special branch registers. */ \
R_BR (0), \
/* Other fixed registers. */ \
- FRAME_POINTER_REGNUM, RETURN_ADDRESS_POINTER_REGNUM, \
+ FRAME_POINTER_REGNUM, \
AR_CCV_REGNUM, AR_UNAT_REGNUM, AR_PFS_REGNUM, AR_LC_REGNUM, \
AR_EC_REGNUM \
}
@@ -892,11 +890,11 @@ enum reg_class
/* AR_M_REGS. */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
- 0x00000000, 0x00000000, 0x0C00 }, \
+ 0x00000000, 0x00000000, 0x0600 }, \
/* AR_I_REGS. */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
- 0x00000000, 0x00000000, 0x7000 }, \
+ 0x00000000, 0x00000000, 0x3800 }, \
/* ADDL_REGS. */ \
{ 0x0000000F, 0x00000000, 0x00000000, 0x00000000, \
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
@@ -904,7 +902,7 @@ enum reg_class
/* GR_REGS. */ \
{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
- 0x00000000, 0x00000000, 0x0300 }, \
+ 0x00000000, 0x00000000, 0x0100 }, \
/* FR_REGS. */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000, \
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
@@ -912,15 +910,15 @@ enum reg_class
/* GR_AND_BR_REGS. */ \
{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
- 0x00000000, 0x00000000, 0x03FF }, \
+ 0x00000000, 0x00000000, 0x01FF }, \
/* GR_AND_FR_REGS. */ \
{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
- 0x00000000, 0x00000000, 0x0300 }, \
+ 0x00000000, 0x00000000, 0x0100 }, \
/* ALL_REGS. */ \
{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \
- 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFF }, \
+ 0xFFFFFFFF, 0xFFFFFFFF, 0x3FFF }, \
}
/* A C expression whose value is a register class containing hard register
@@ -1098,11 +1096,15 @@ enum reg_class
(GET_CODE (VALUE) == MEM \
&& GET_RTX_CLASS (GET_CODE (XEXP ((VALUE), 0))) != 'a' \
&& (reload_in_progress || memory_operand ((VALUE), VOIDmode)))
+/* Symbol ref to small-address-area: */
+#define CONSTRAINT_OK_FOR_T(VALUE) \
+ (GET_CODE (VALUE) == SYMBOL_REF && SYMBOL_REF_SMALL_ADDR_P (VALUE))
#define EXTRA_CONSTRAINT(VALUE, C) \
((C) == 'Q' ? CONSTRAINT_OK_FOR_Q (VALUE) \
: (C) == 'R' ? CONSTRAINT_OK_FOR_R (VALUE) \
: (C) == 'S' ? CONSTRAINT_OK_FOR_S (VALUE) \
+ : (C) == 'T' ? CONSTRAINT_OK_FOR_T (VALUE) \
: 0)
/* Basic Stack Layout */
@@ -1138,7 +1140,7 @@ enum reg_class
DYNAMIC_CHAIN_ADDRESS and SETUP_FRAME_ADDRESS (for the reg stack flush). */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
- ((COUNT) == 0 ? return_address_pointer_rtx : const0_rtx)
+ ia64_return_addr_rtx (COUNT, FRAME)
/* A C expression whose value is RTL representing the location of the incoming
return address at the beginning of any function, before the prologue. This
@@ -1199,13 +1201,6 @@ enum reg_class
REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = 64; \
} while (0)
-/* The register number for the return address register. For IA-64, this
- is not actually a pointer as the name suggests, but that's a name that
- gen_rtx_REG already takes care to keep unique. We modify
- return_address_pointer_rtx in ia64_expand_prologue to reference the
- final output regnum. */
-#define RETURN_ADDRESS_POINTER_REGNUM 329
-
/* Register numbers used for passing a function's static chain pointer. */
/* ??? The ABI sez the static chain should be passed as a normal parameter. */
#define STATIC_CHAIN_REGNUM 15
@@ -1229,7 +1224,6 @@ enum reg_class
{ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
- {RETURN_ADDRESS_POINTER_REGNUM, BR_REG (0)}, \
}
/* A C expression that returns nonzero if the compiler is allowed to try to
@@ -1875,8 +1869,8 @@ do { \
"p60", "p61", "p62", "p63", \
/* Branch registers. */ \
"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \
- /* Frame pointer. Return address. */ \
- "sfp", "retaddr", "ar.ccv", "ar.unat", "ar.pfs", "ar.lc", "ar.ec", \
+ /* Frame pointer. Application registers. */ \
+ "sfp", "ar.ccv", "ar.unat", "ar.pfs", "ar.lc", "ar.ec", \
}
/* If defined, a C initializer for an array of structures containing a name and
@@ -2172,6 +2166,12 @@ do { \
/* Miscellaneous Parameters. */
+/* Flag to mark data that is in the small address area (addressable
+ via "addl", that is, within a 2MByte offset of 0. */
+#define SYMBOL_FLAG_SMALL_ADDR (SYMBOL_FLAG_MACH_DEP << 0)
+#define SYMBOL_REF_SMALL_ADDR_P(X) \
+ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SMALL_ADDR) != 0)
+
/* Define this if you have defined special-purpose predicates in the file
`MACHINE.c'. For each predicate, list all rtl codes that can be in
expressions matched by the predicate. */
@@ -2180,6 +2180,7 @@ do { \
{ "call_operand", {SUBREG, REG, SYMBOL_REF}}, \
{ "got_symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
{ "sdata_symbolic_operand", {SYMBOL_REF, CONST}}, \
+{ "small_addr_symbolic_operand", {SYMBOL_REF}}, \
{ "symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
{ "function_operand", {SYMBOL_REF}}, \
{ "setjmp_operand", {SYMBOL_REF}}, \
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index d53234ea7fc..9ead0866798 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -73,6 +73,7 @@
(UNSPEC_BUNDLE_SELECTOR 23)
(UNSPEC_ADDP4 24)
(UNSPEC_PROLOGUE_USE 25)
+ (UNSPEC_RET_ADDR 26)
])
(define_constants
@@ -325,7 +326,7 @@
[(set (match_operand:DI 0 "destination_operand"
"=r,r,r,r, m, r,*f,*f,*f, Q, r,*b, r,*e, r,*d, r,*c")
(match_operand:DI 1 "move_operand"
- "rO,J,i,m,rO,*f,rO,*f, Q,*f,*b,rO,*e,rK,*d,rK,*c,rO"))]
+ "rO,JT,i,m,rO,*f,rO,*f, Q,*f,*b,rO,*e,rK,*d,rK,*c,rO"))]
"ia64_move_ok (operands[0], operands[1])"
{
static const char * const alt[] = {
@@ -410,6 +411,25 @@
operands[3] = pic_offset_table_rtx;
})
+;; This is used as a placeholder for the return address during early
+;; compilation. We won't know where we've placed this until during
+;; reload, at which point it can wind up in b0, a general register,
+;; or memory. The only safe destination under these conditions is a
+;; general register.
+
+(define_insn_and_split "*movdi_ret_addr"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec:DI [(const_int 0)] UNSPEC_RET_ADDR))]
+ ""
+ "#"
+ "reload_completed"
+ [(const_int 0)]
+{
+ ia64_split_return_addr_rtx (operands[0]);
+ DONE;
+}
+ [(set_attr "itanium_class" "ialu")])
+
(define_insn "*load_symptr_high"
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (high:DI (match_operand 1 "got_symbolic_operand" "s"))
@@ -5217,16 +5237,16 @@
{
static const char * const alt[2][4] = {
{
- "lfetch.nta [%0]",
- "lfetch.nt1 [%0]",
- "lfetch.nt2 [%0]",
- "lfetch [%0]"
+ "%,lfetch.nta [%0]",
+ "%,lfetch.nt1 [%0]",
+ "%,lfetch.nt2 [%0]",
+ "%,lfetch [%0]"
},
{
- "lfetch.excl.nta [%0]",
- "lfetch.excl.nt1 [%0]",
- "lfetch.excl.nt2 [%0]",
- "lfetch.excl [%0]"
+ "%,lfetch.excl.nta [%0]",
+ "%,lfetch.excl.nt1 [%0]",
+ "%,lfetch.excl.nt2 [%0]",
+ "%,lfetch.excl [%0]"
}
};
int i = (INTVAL (operands[1]));
@@ -5452,7 +5472,7 @@
;;
;; Optimizations for ptr_extend
-(define_insn "*ptr_extend_plus_1"
+(define_insn "ptr_extend_plus_imm"
[(set (match_operand:DI 0 "gr_register_operand" "=r")
(unspec:DI
[(plus:SI (match_operand:SI 1 "basereg_operand" "r")
diff --git a/gcc/config/ia64/libgcc-ia64.ver b/gcc/config/ia64/libgcc-ia64.ver
index 2ffb6936864..cd769907df0 100644
--- a/gcc/config/ia64/libgcc-ia64.ver
+++ b/gcc/config/ia64/libgcc-ia64.ver
@@ -7,3 +7,6 @@ GCC_3.0 {
__ia64_trampoline
__ia64_backtrace
}
+GCC_3.3.2 {
+ _Unwind_GetBSP
+}
diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c
index 9b6023da58a..41f59d10b9d 100644
--- a/gcc/config/ia64/unwind-ia64.c
+++ b/gcc/config/ia64/unwind-ia64.c
@@ -1667,6 +1667,14 @@ _Unwind_GetCFA (struct _Unwind_Context *context)
return (_Unwind_Ptr) context->psp;
}
+/* Get the value of the Backing Store Pointer as saved in CONTEXT. */
+
+_Unwind_Word
+_Unwind_GetBSP (struct _Unwind_Context *context)
+{
+ return (_Unwind_Ptr) context->bsp;
+}
+
static _Unwind_Reason_Code
uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 75b403057e2..2c85148c685 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -1,5 +1,6 @@
/* Definitions for Linux-based GNU systems with ELF format
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003
+ Free Software Foundation, Inc.
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
@@ -103,6 +104,8 @@ Boston, MA 02111-1307, USA. */
/* Define this so we can compile MS code for use with WINE. */
#define HANDLE_PRAGMA_PACK_PUSH_POP
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
/* Determine whether the the entire c99 runtime
is present in the runtime library. */
diff --git a/gcc/config/lynx.h b/gcc/config/lynx.h
index 267f499e221..a2366d106da 100644
--- a/gcc/config/lynx.h
+++ b/gcc/config/lynx.h
@@ -1,5 +1,5 @@
/* Target independent definitions for LynxOS using gas and gnu ld.
- Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002
+ Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@@ -19,10 +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. */
-/* LynxOS is a multi-platform Unix, similar to SVR3, but not identical.
- We can get quite a bit from generic svr3, but have to do some overrides. */
-
-#include "svr3.h"
+/* LynxOS is a multi-platform Unix, similar to SVR3, but not identical. */
/* Define various macros, depending on the combination of flags. */
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index 38690ee7319..c97ea89c447 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -1490,7 +1490,7 @@ m68hc11_init_cumulative_args (cum, fntype, libname)
ret_type = TREE_TYPE (fntype);
- if (ret_type && aggregate_value_p (ret_type))
+ if (ret_type && aggregate_value_p (ret_type, fntype))
{
cum->words = 1;
cum->nregs = 1;
@@ -1582,14 +1582,8 @@ m68hc11_function_arg_padding (mode, type)
if (type != 0 && AGGREGATE_TYPE_P (type))
return upward;
- /* This is the default definition. */
- return (!BYTES_BIG_ENDIAN
- ? upward
- : ((mode == BLKmode
- ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && int_size_in_bytes (type) <
- (PARM_BOUNDARY / BITS_PER_UNIT)) : GET_MODE_BITSIZE (mode) <
- PARM_BOUNDARY) ? downward : upward));
+ /* Fall back to the default. */
+ return DEFAULT_FUNCTION_ARG_PADDING (mode, type);
}
diff --git a/gcc/config/m68k/coff.h b/gcc/config/m68k/coff.h
index 77be8b9743c..21699a60c78 100644
--- a/gcc/config/m68k/coff.h
+++ b/gcc/config/m68k/coff.h
@@ -22,13 +22,13 @@ Boston, MA 02111-1307, USA. */
/* This file is included after m68k.h by CPU COFF specific files. It
is not a complete target itself. */
-/* Generate sdb debugging information. */
+/* Used in m68k.c to include required support code. */
-#define SDB_DEBUGGING_INFO 1
+#define M68K_TARGET_COFF 1
-/* Output DBX (stabs) debugging information if using -gstabs. */
+/* Generate sdb debugging information. */
-#include "dbxcoff.h"
+#define SDB_DEBUGGING_INFO 1
/* COFF symbols don't start with an underscore. */
@@ -57,7 +57,7 @@ Boston, MA 02111-1307, USA. */
#define ASM_RETURN_CASE_JUMP \
do { \
- if (TARGET_5200) \
+ if (TARGET_COLDFIRE) \
{ \
if (ADDRESS_REG_P (operands[0])) \
return "jmp %%pc@(2,%0:l)"; \
@@ -74,7 +74,7 @@ Boston, MA 02111-1307, USA. */
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
+ "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", "argptr" }
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
diff --git a/gcc/config/m68k/hp310.h b/gcc/config/m68k/hp310.h
index 4c765b89f55..1abbeaeddc9 100644
--- a/gcc/config/m68k/hp310.h
+++ b/gcc/config/m68k/hp310.h
@@ -1,10 +1,5 @@
/* Definitions of target machine for GNU compiler. HP-UX 68010 version. */
-/* See m68k.h. 0 means 68000 without 68881 and no bitfields. */
-#define TARGET_DEFAULT 0
-
-#include "m68k/hp320.h"
-
/* Don't try using XFmode. */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 64
diff --git a/gcc/config/m68k/hp310g.h b/gcc/config/m68k/hp310g.h
deleted file mode 100644
index d5c543eb3b2..00000000000
--- a/gcc/config/m68k/hp310g.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Definitions of target machine for GNU compiler. HP-UX 68010 version.
- Use this file if GCC is supposed to work with the GNU assembler,
- GNU linker and GNU debugger using DBX debugging information.
- (In other words, much of HPUX has been cast aside.) */
-
-/* This wants DBX format. */
-
-#define DBX_DEBUGGING_INFO 1
-
-#define USE_GAS
-
-#include "m68k/hp310.h"
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index 17ce3504d9b..edfe3b9b174 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
- Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002
+ Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -19,34 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Define USE_GAS if GCC is supposed to work with the GNU assembler,
- GNU linker and GNU debugger using DBX debugging information.
- (In other words, much of HPUX has been cast aside.)
- Undefine USE_GAS if you want GCC to feed the HP assembler. */
-
-/* #define USE_GAS */ /* Use hp320g.h if you want this. */
-
-/* Control assembler-syntax conditionals in m68k.md. */
-
-#ifndef USE_GAS
-#define MOTOROLA /* Use Motorola syntax rather than "MIT" */
-#define SGS /* Uses SGS assembler */
-#define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
-#define HPUX_ASM
-
-#if !defined (CROSS_COMPILE) && !defined (NO_BUGS)
-/* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't translate
- floating point constants behind some operands. The workaround is to
- use hex constants. Reported by Thomas Nau (nau@medizin.uni-ulm.de). */
-#define AS_BUG_FLOATING_CONSTANT
-/* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't accept
- labels followed by a text, data, or other section directive. Reported
- by Thomas Nau (nau@medizin.uni-ulm.de). */
-#define AS_BUG_TRAILING_LABEL
-#endif
-
-#endif /* not USE_GAS */
-
/* gcc.c should find libgcc.a itself rather than expecting linker to. */
#define LINK_LIBGCC_SPECIAL
/* The arguments of -L must be a separate argv element. */
@@ -57,8 +29,6 @@ Boston, MA 02111-1307, USA. */
/* Be compatible with system stddef.h. */
#define SIZE_TYPE "unsigned int"
-#include "m68k/m68k.h"
-
#undef INT_OP_GROUP
#define INT_OP_GROUP INT_OP_NO_DOT
@@ -188,7 +158,7 @@ Boston, MA 02111-1307, USA. */
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp", \
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
+ "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", "argptr"}
#define IMMEDIATE_PREFIX "&"
#define REGISTER_PREFIX "%"
diff --git a/gcc/config/m68k/hp320base.h b/gcc/config/m68k/hp320base.h
new file mode 100644
index 00000000000..ad84d45600d
--- /dev/null
+++ b/gcc/config/m68k/hp320base.h
@@ -0,0 +1,40 @@
+/* Configuration file for an HP 320.
+ Copyright (C) 2003 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. */
+
+/* Control assembler-syntax conditionals in m68k.md. */
+
+#ifndef USE_GAS
+#define MOTOROLA /* Use Motorola syntax rather than "MIT" */
+#define SGS /* Uses SGS assembler */
+#define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
+#define HPUX_ASM
+
+#if !defined (CROSS_COMPILE) && !defined (NO_BUGS)
+/* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't translate
+ floating point constants behind some operands. The workaround is to
+ use hex constants. Reported by Thomas Nau (nau@medizin.uni-ulm.de). */
+#define AS_BUG_FLOATING_CONSTANT
+/* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't accept
+ labels followed by a text, data, or other section directive. Reported
+ by Thomas Nau (nau@medizin.uni-ulm.de). */
+#define AS_BUG_TRAILING_LABEL
+#endif
+
+#endif /* not USE_GAS */
diff --git a/gcc/config/m68k/hp320g.h b/gcc/config/m68k/hp320g.h
deleted file mode 100644
index b20cc3d03cc..00000000000
--- a/gcc/config/m68k/hp320g.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
- Use this file if GCC is supposed to work with the GNU assembler,
- GNU linker and GNU debugger using DBX debugging information.
- (In other words, much of HPUX has been cast aside.) */
-
-/* This wants DBX format. */
-
-#define DBX_DEBUGGING_INFO 1
-
-#define USE_GAS
-
-#include "m68k/hp320.h"
diff --git a/gcc/config/m68k/hpux7.h b/gcc/config/m68k/hpux7.h
deleted file mode 100644
index ae584bde097..00000000000
--- a/gcc/config/m68k/hpux7.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* tm.h for m68k running HPUX version 7. */
-
-/* fletcher@cs.utexas.edu says this is needed. */
-#define NO_DOT_IN_LABEL
-#define NO_BUGS
-
-#include "m68k/hp320.h"
diff --git a/gcc/config/m68k/lb1sf68.asm b/gcc/config/m68k/lb1sf68.asm
index 7bcee2eabe4..d424e9787f1 100644
--- a/gcc/config/m68k/lb1sf68.asm
+++ b/gcc/config/m68k/lb1sf68.asm
@@ -214,7 +214,7 @@ TRUNCDFSF = 7
| void __clear_sticky_bits(void);
SYM (__clear_sticky_bit):
lea SYM (_fpCCR),a0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
movew IMM (0),a0@(STICK)
#else
clr.w a0@(STICK)
@@ -248,7 +248,7 @@ FPTRAP = 15
$_exception_handler:
lea SYM (_fpCCR),a0
movew d7,a0@(EBITS) | set __exception_bits
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
orw d7,a0@(STICK) | and __sticky_bits
#else
movew a0@(STICK),d4
@@ -259,7 +259,7 @@ $_exception_handler:
movew d5,a0@(LASTO) | and __last_operation
| Now put the operands in place:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (SINGLE_FLOAT),d6
#else
cmpl IMM (SINGLE_FLOAT),d6
@@ -274,7 +274,7 @@ $_exception_handler:
movel a6@(12),a0@(OPER2)
2:
| And check whether the exception is trap-enabled:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
andw a0@(TRAPE),d7 | is exception trap-enabled?
#else
clrl d6
@@ -284,7 +284,7 @@ $_exception_handler:
beq 1f | no, exit
pea SYM (_fpCCR) | yes, push address of _fpCCR
trap IMM (FPTRAP) | and trap
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
1: moveml sp@+,d2-d7 | restore data registers
#else
1: moveml sp@,d2-d7
@@ -304,7 +304,7 @@ SYM (__mulsi3):
muluw sp@(10), d0 /* x0*y1 */
movew sp@(6), d1 /* x1 -> d1 */
muluw sp@(8), d1 /* x1*y0 */
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
addw d1, d0
#else
addl d1, d0
@@ -323,7 +323,7 @@ SYM (__mulsi3):
.proc
.globl SYM (__udivsi3)
SYM (__udivsi3):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
movel d2, sp@-
movel sp@(12), d1 /* d1 = divisor */
movel sp@(8), d0 /* d0 = dividend */
@@ -368,7 +368,7 @@ L5: subql IMM (1), d0 /* adjust quotient */
L6: movel sp@+, d2
rts
-#else /* __mcf5200__ */
+#else /* __mcoldfire__ */
/* Coldfire implementation of non-restoring division algorithm from
Hennessy & Patterson, Appendix A. */
@@ -390,7 +390,7 @@ L2: subql IMM (1),d4
moveml sp@,d2-d4 | restore data registers
unlk a6 | and return
rts
-#endif /* __mcf5200__ */
+#endif /* __mcoldfire__ */
#endif /* L_udivsi3 */
@@ -405,7 +405,7 @@ SYM (__divsi3):
movel sp@(12), d1 /* d1 = divisor */
jpl L1
negl d1
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
negb d2 /* change sign because divisor <0 */
#else
negl d2 /* change sign because divisor <0 */
@@ -413,7 +413,7 @@ SYM (__divsi3):
L1: movel sp@(8), d0 /* d0 = dividend */
jpl L2
negl d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
negb d2
#else
negl d2
@@ -444,7 +444,7 @@ SYM (__umodsi3):
jbsr SYM (__udivsi3)
addql IMM (8), sp
movel sp@(8), d1 /* d1 = divisor */
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
movel d1, sp@-
movel d0, sp@-
jbsr SYM (__mulsi3) /* d0 = (a/b)*b */
@@ -470,7 +470,7 @@ SYM (__modsi3):
jbsr SYM (__divsi3)
addql IMM (8), sp
movel sp@(8), d1 /* d1 = divisor */
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
movel d1, sp@-
movel d0, sp@-
jbsr SYM (__mulsi3) /* d0 = (a/b)*b */
@@ -611,7 +611,7 @@ SYM (__subdf3):
| double __adddf3(double, double);
SYM (__adddf3):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0) | everything will be done in registers
moveml d2-d7,sp@- | save all data registers and a2 (but d0-d1)
#else
@@ -635,7 +635,7 @@ SYM (__adddf3):
andl IMM (0x80000000),d7 | isolate a's sign bit '
swap d6 | and also b's sign bit '
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
andw IMM (0x8000),d6 |
orw d6,d7 | and combine them into d7, so that a's sign '
| bit is in the high word and b's is in the '
@@ -662,7 +662,7 @@ SYM (__adddf3):
orl d7,d0 | and put hidden bit back
Ladddf$1:
swap d4 | shift right exponent so that it starts
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (5),d4 | in bit 0 and not bit 20
#else
lsrl IMM (5),d4 | in bit 0 and not bit 20
@@ -678,7 +678,7 @@ Ladddf$1:
orl d7,d2 | and put hidden bit back
Ladddf$2:
swap d5 | shift right exponent so that it starts
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (5),d5 | in bit 0 and not bit 20
#else
lsrl IMM (5),d5 | in bit 0 and not bit 20
@@ -693,7 +693,7 @@ Ladddf$2:
| and d4-d5-d6-d7 for the second. To do this we store (temporarily) the
| exponents in a2-a3.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml a2-a3,sp@- | save the address registers
#else
movel a2,sp@-
@@ -713,7 +713,7 @@ Ladddf$2:
| Here we shift the numbers until the exponents are the same, and put
| the largest exponent in a2.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d4,a2 | get exponents back
exg d5,a3 |
cmpw d4,d5 | compare the exponents
@@ -732,7 +732,7 @@ Ladddf$2:
| Here we have a's exponent larger than b's, so we have to shift b. We do
| this by using as counter d2:
1: movew d4,d2 | move largest exponent to d2
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw d5,d2 | and subtract second exponent
exg d4,a2 | get back the longs we saved
exg d5,a3 |
@@ -746,20 +746,20 @@ Ladddf$2:
movel a4,a3
#endif
| if difference is too large we don't shift (actually, we can just exit) '
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (DBL_MANT_DIG+2),d2
#else
cmpl IMM (DBL_MANT_DIG+2),d2
#endif
bge Ladddf$b$small
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (32),d2 | if difference >= 32, shift by longs
#else
cmpl IMM (32),d2 | if difference >= 32, shift by longs
#endif
bge 5f
2:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (16),d2 | if difference >= 16, shift by words
#else
cmpl IMM (16),d2 | if difference >= 16, shift by words
@@ -768,7 +768,7 @@ Ladddf$2:
bra 3f | enter dbra loop
4:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d4
roxrl IMM (1),d5
roxrl IMM (1),d6
@@ -789,7 +789,7 @@ Ladddf$2:
12: lsrl IMM (1),d4
#endif
3:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d2,4b
#else
subql IMM (1),d2
@@ -803,7 +803,7 @@ Ladddf$2:
movel d5,d6
movel d4,d5
movel IMM (0),d4
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (32),d2
#else
subl IMM (32),d2
@@ -818,7 +818,7 @@ Ladddf$2:
swap d5
movew IMM (0),d4
swap d4
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (16),d2
#else
subl IMM (16),d2
@@ -826,7 +826,7 @@ Ladddf$2:
bra 3b
9:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d4,d5
movew d4,d6
subw d5,d6 | keep d5 (largest exponent) in d4
@@ -845,20 +845,20 @@ Ladddf$2:
movel a4,a3
#endif
| if difference is too large we don't shift (actually, we can just exit) '
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (DBL_MANT_DIG+2),d6
#else
cmpl IMM (DBL_MANT_DIG+2),d6
#endif
bge Ladddf$a$small
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (32),d6 | if difference >= 32, shift by longs
#else
cmpl IMM (32),d6 | if difference >= 32, shift by longs
#endif
bge 5f
2:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (16),d6 | if difference >= 16, shift by words
#else
cmpl IMM (16),d6 | if difference >= 16, shift by words
@@ -867,7 +867,7 @@ Ladddf$2:
bra 3f | enter dbra loop
4:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
roxrl IMM (1),d2
@@ -888,7 +888,7 @@ Ladddf$2:
12: lsrl IMM (1),d0
#endif
3:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d6,4b
#else
subql IMM (1),d6
@@ -902,7 +902,7 @@ Ladddf$2:
movel d1,d2
movel d0,d1
movel IMM (0),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (32),d6
#else
subl IMM (32),d6
@@ -917,14 +917,14 @@ Ladddf$2:
swap d1
movew IMM (0),d0
swap d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (16),d6
#else
subl IMM (16),d6
#endif
bra 3b
Ladddf$3:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d4,a2
exg d5,a3
#else
@@ -940,7 +940,7 @@ Ladddf$4:
| the signs in a4.
| Here we have to decide whether to add or subtract the numbers:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a0 | get the signs
exg d6,a3 | a3 is free to be used
#else
@@ -958,7 +958,7 @@ Ladddf$4:
eorl d7,d6 | compare the signs
bmi Lsubdf$0 | if the signs are different we have
| to subtract
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a0 | else we add the numbers
exg d6,a3 |
#else
@@ -978,7 +978,7 @@ Ladddf$4:
movel a0,d7 |
andl IMM (0x80000000),d7 | d7 now has the sign
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,a2-a3
#else
movel sp@+,a4
@@ -992,7 +992,7 @@ Ladddf$4:
| one more bit we check this:
btst IMM (DBL_MANT_DIG+1),d0
beq 1f
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
roxrl IMM (1),d2
@@ -1017,12 +1017,12 @@ Ladddf$4:
1:
lea Ladddf$5,a0 | to return from rounding routine
lea SYM (_fpCCR),a1 | check the rounding mode
-#ifdef __mcf5200__
+#ifdef __mcoldfire__
clrl d6
#endif
movew a1@(6),d6 | rounding mode in d6
beq Lround$to$nearest
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (ROUND_TO_PLUS),d6
#else
cmpl IMM (ROUND_TO_PLUS),d6
@@ -1032,20 +1032,20 @@ Ladddf$4:
bra Lround$to$plus
Ladddf$5:
| Put back the exponent and check for overflow
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (0x7ff),d4 | is the exponent big?
#else
cmpl IMM (0x7ff),d4 | is the exponent big?
#endif
bge 1f
bclr IMM (DBL_MANT_DIG-1),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lslw IMM (4),d4 | put exponent back into position
#else
lsll IMM (4),d4 | put exponent back into position
#endif
swap d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
orw d4,d0 |
#else
orl d4,d0 |
@@ -1058,7 +1058,7 @@ Ladddf$5:
Lsubdf$0:
| Here we do the subtraction.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a0 | put sign back in a0
exg d6,a3 |
#else
@@ -1086,7 +1086,7 @@ Lsubdf$0:
movel a2,d4 | return exponent to d4
movel a0,d7
andl IMM (0x80000000),d7 | isolate sign bit
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,a2-a3 |
#else
movel sp@+,a4
@@ -1100,7 +1100,7 @@ Lsubdf$0:
| one more bit we check this:
btst IMM (DBL_MANT_DIG+1),d0
beq 1f
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
roxrl IMM (1),d2
@@ -1125,12 +1125,12 @@ Lsubdf$0:
1:
lea Lsubdf$1,a0 | to return from rounding routine
lea SYM (_fpCCR),a1 | check the rounding mode
-#ifdef __mcf5200__
+#ifdef __mcoldfire__
clrl d6
#endif
movew a1@(6),d6 | rounding mode in d6
beq Lround$to$nearest
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (ROUND_TO_PLUS),d6
#else
cmpl IMM (ROUND_TO_PLUS),d6
@@ -1141,13 +1141,13 @@ Lsubdf$0:
Lsubdf$1:
| Put back the exponent and sign (we don't have overflow). '
bclr IMM (DBL_MANT_DIG-1),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lslw IMM (4),d4 | put exponent back into position
#else
lsll IMM (4),d4 | put exponent back into position
#endif
swap d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
orw d4,d0 |
#else
orl d4,d0 |
@@ -1159,7 +1159,7 @@ Lsubdf$1:
| DBL_MANT_DIG+1) we return the other (and now we don't have to '
| check for finiteness or zero).
Ladddf$a$small:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,a2-a3
#else
movel sp@+,a4
@@ -1170,7 +1170,7 @@ Ladddf$a$small:
movel a6@(20),d1
lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | restore data registers
#else
moveml sp@,d2-d7
@@ -1181,7 +1181,7 @@ Ladddf$a$small:
rts
Ladddf$b$small:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,a2-a3
#else
movel sp@+,a4
@@ -1192,7 +1192,7 @@ Ladddf$b$small:
movel a6@(12),d1
lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | restore data registers
#else
moveml sp@,d2-d7
@@ -1238,7 +1238,7 @@ Ladddf$a:
bra Ld$infty |
Ladddf$ret$1:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,a2-a3 | restore regs and exit
#else
movel sp@+,a4
@@ -1251,7 +1251,7 @@ Ladddf$ret:
lea SYM (_fpCCR),a0
movew IMM (0),a0@
orl d7,d0 | put sign bit back
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7
#else
moveml sp@,d2-d7
@@ -1263,7 +1263,7 @@ Ladddf$ret:
Ladddf$ret$den:
| Return a denormalized number.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0 | shift right once more
roxrl IMM (1),d1 |
#else
@@ -1329,7 +1329,7 @@ Ladddf$nf:
| double __muldf3(double, double);
SYM (__muldf3):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@-
#else
@@ -1370,7 +1370,7 @@ SYM (__muldf3):
andl d6,d0 | isolate fraction
orl IMM (0x00100000),d0 | and put hidden bit back
swap d4 | I like exponents in the first byte
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (4),d4 |
#else
lsrl IMM (4),d4 |
@@ -1381,13 +1381,13 @@ Lmuldf$1:
andl d6,d2 |
orl IMM (0x00100000),d2 | and put hidden bit back
swap d5 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (4),d5 |
#else
lsrl IMM (4),d5 |
#endif
Lmuldf$2: |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
addw d5,d4 | add exponents
subw IMM (D_BIAS+1),d4 | and subtract bias (plus one)
#else
@@ -1405,7 +1405,7 @@ Lmuldf$2: |
| enough to keep everything in them. So we use the address registers to keep
| some intermediate data.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml a2-a3,sp@- | save a2 and a3 for temporary use
#else
movel a2,sp@-
@@ -1416,7 +1416,7 @@ Lmuldf$2: |
movel d4,a3 | and a3 will preserve the exponent
| First, shift d2-d3 so bit 20 becomes bit 31:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
rorl IMM (5),d2 | rotate d2 5 places right
swap d2 | and swap it
rorl IMM (5),d3 | do the same thing with d3
@@ -1447,7 +1447,7 @@ Lmuldf$2: |
| We use a1 as counter:
movel IMM (DBL_MANT_DIG-1),a1
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a1
#else
movel d7,a4
@@ -1456,7 +1456,7 @@ Lmuldf$2: |
#endif
1:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a1 | put counter back in a1
#else
movel d7,a4
@@ -1470,7 +1470,7 @@ Lmuldf$2: |
addl d7,d7 |
addxl d6,d6 |
bcc 2f | if bit clear skip the following
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a2 |
#else
movel d7,a4
@@ -1481,7 +1481,7 @@ Lmuldf$2: |
addxl d4,d2 |
addxl d7,d1 |
addxl d7,d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a2 |
#else
movel d7,a4
@@ -1489,7 +1489,7 @@ Lmuldf$2: |
movel a4,a2
#endif
2:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d7,a1 | put counter in d7
dbf d7,1b | decrement and branch
#else
@@ -1501,7 +1501,7 @@ Lmuldf$2: |
#endif
movel a3,d4 | restore exponent
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,a2-a3
#else
movel sp@+,a4
@@ -1520,7 +1520,7 @@ Lmuldf$2: |
swap d3
movew d3,d2
movew IMM (0),d3
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
roxrl IMM (1),d2
@@ -1556,7 +1556,7 @@ Lmuldf$2: |
btst IMM (DBL_MANT_DIG+1-32),d0
beq Lround$exit
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
addw IMM (1),d4
@@ -1592,7 +1592,7 @@ Lmuldf$a$nf:
| NaN, in which case we return NaN.
Lmuldf$b$0:
movew IMM (MULTIPLY),d5
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d2,d0 | put b (==0) into d0-d1
exg d3,d1 | and a (with sign bit cleared) into d2-d3
#else
@@ -1612,7 +1612,7 @@ Lmuldf$a$0:
bge Ld$inop | in case NaN or +/-INFINITY return NaN
lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7
#else
moveml sp@,d2-d7
@@ -1631,7 +1631,7 @@ Lmuldf$a$den:
andl d6,d0
1: addl d1,d1 | shift a left until bit 20 is set
addxl d0,d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d4 | and adjust exponent
#else
subl IMM (1),d4 | and adjust exponent
@@ -1645,7 +1645,7 @@ Lmuldf$b$den:
andl d6,d2
1: addl d3,d3 | shift b left until bit 20 is set
addxl d2,d2 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d5 | and adjust exponent
#else
subql IMM (1),d5 | and adjust exponent
@@ -1661,7 +1661,7 @@ Lmuldf$b$den:
| double __divdf3(double, double);
SYM (__divdf3):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@-
#else
@@ -1706,7 +1706,7 @@ SYM (__divdf3):
andl d6,d0 | and isolate fraction
orl IMM (0x00100000),d0 | and put hidden bit back
swap d4 | I like exponents in the first byte
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (4),d4 |
#else
lsrl IMM (4),d4 |
@@ -1717,13 +1717,13 @@ Ldivdf$1: |
andl d6,d2 |
orl IMM (0x00100000),d2
swap d5 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (4),d5 |
#else
lsrl IMM (4),d5 |
#endif
Ldivdf$2: |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw d5,d4 | subtract exponents
addw IMM (D_BIAS),d4 | and add bias
#else
@@ -1760,7 +1760,7 @@ Ldivdf$2: |
bset d5,d6 | set the corresponding bit in d6
3: addl d1,d1 | shift a by 1
addxl d0,d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d5,1b | and branch back
#else
subql IMM (1), d5
@@ -1782,7 +1782,7 @@ Ldivdf$2: |
bset d5,d7 | set the corresponding bit in d7
3: addl d1,d1 | shift a by 1
addxl d0,d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d5,1b | and branch back
#else
subql IMM (1), d5
@@ -1800,7 +1800,7 @@ Ldivdf$2: |
beq 3f | if d0==d2 check d1 and d3
2: addl d1,d1 | shift a by 1
addxl d0,d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d5,1b | and branch back
#else
subql IMM (1), d5
@@ -1816,7 +1816,7 @@ Ldivdf$2: |
| to it; if you don't do this the algorithm loses in some cases). '
movel IMM (0),d2
movel d2,d3
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (DBL_MANT_DIG),d5
addw IMM (63),d5
cmpw IMM (31),d5
@@ -1828,7 +1828,7 @@ Ldivdf$2: |
bhi 2f
1: bset d5,d3
bra 5f
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (32),d5
#else
subl IMM (32),d5
@@ -1847,7 +1847,7 @@ Ldivdf$2: |
| not set:
btst IMM (DBL_MANT_DIG-32+1),d0
beq 1f
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
roxrl IMM (1),d2
@@ -1897,7 +1897,7 @@ Ldivdf$a$0:
movel d0,d1 |
lea SYM (_fpCCR),a0 | clear exception flags
movew IMM (0),a0@ |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 |
#else
moveml sp@,d2-d7 |
@@ -1945,7 +1945,7 @@ Ldivdf$a$den:
andl d6,d0
1: addl d1,d1 | shift a left until bit 20 is set
addxl d0,d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d4 | and adjust exponent
#else
subl IMM (1),d4 | and adjust exponent
@@ -1959,7 +1959,7 @@ Ldivdf$b$den:
andl d6,d2
1: addl d3,d3 | shift b left until bit 20 is set
addxl d2,d2
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d5 | and adjust exponent
#else
subql IMM (1),d5 | and adjust exponent
@@ -1974,7 +1974,7 @@ Lround$exit:
| so that 2^21 <= d0 < 2^22, and the exponent is in the lower byte of d4.
| First check for underlow in the exponent:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (-DBL_MANT_DIG-1),d4
#else
cmpl IMM (-DBL_MANT_DIG-1),d4
@@ -1987,14 +1987,14 @@ Lround$exit:
movel d7,a0 |
movel IMM (0),d6 | use d6-d7 to collect bits flushed right
movel d6,d7 | use d6-d7 to collect bits flushed right
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (1),d4 | if the exponent is less than 1 we
#else
cmpl IMM (1),d4 | if the exponent is less than 1 we
#endif
bge 2f | have to shift right (denormalize)
1:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
addw IMM (1),d4 | adjust the exponent
lsrl IMM (1),d0 | shift right once
roxrl IMM (1),d1 |
@@ -2037,12 +2037,12 @@ Lround$exit:
| Now call the rounding routine (which takes care of denormalized numbers):
lea Lround$0,a0 | to return from rounding routine
lea SYM (_fpCCR),a1 | check the rounding mode
-#ifdef __mcf5200__
+#ifdef __mcoldfire__
clrl d6
#endif
movew a1@(6),d6 | rounding mode in d6
beq Lround$to$nearest
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (ROUND_TO_PLUS),d6
#else
cmpl IMM (ROUND_TO_PLUS),d6
@@ -2058,7 +2058,7 @@ Lround$0:
| check again for underflow!). We have to check for overflow or for a
| denormalized number (which also signals underflow).
| Check for overflow (i.e., exponent >= 0x7ff).
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (0x07ff),d4
#else
cmpl IMM (0x07ff),d4
@@ -2069,14 +2069,14 @@ Lround$0:
beq Ld$den
1:
| Put back the exponents and sign and return.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lslw IMM (4),d4 | exponent back to fourth byte
#else
lsll IMM (4),d4 | exponent back to fourth byte
#endif
bclr IMM (DBL_MANT_DIG-32-1),d0
swap d0 | and put back exponent
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
orw d4,d0 |
#else
orl d4,d0 |
@@ -2086,7 +2086,7 @@ Lround$0:
lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7
#else
moveml sp@,d2-d7
@@ -2102,7 +2102,7 @@ Lround$0:
| double __negdf2(double, double);
SYM (__negdf2):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@-
#else
@@ -2128,7 +2128,7 @@ SYM (__negdf2):
bra Ld$infty
1: lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7
#else
moveml sp@,d2-d7
@@ -2150,7 +2150,7 @@ EQUAL = 0
| int __cmpdf2(double, double);
SYM (__cmpdf2):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@- | save registers
#else
@@ -2194,7 +2194,7 @@ Lcmpdf$1:
tstl d6
bpl 1f
| If both are negative exchange them
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d0,d2
exg d1,d3
#else
@@ -2217,7 +2217,7 @@ Lcmpdf$1:
bne Lcmpdf$a$gt$b | |b| < |a|
| If we got here a == b.
movel IMM (EQUAL),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | put back the registers
#else
moveml sp@,d2-d7
@@ -2228,7 +2228,7 @@ Lcmpdf$1:
rts
Lcmpdf$a$gt$b:
movel IMM (GREATER),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | put back the registers
#else
moveml sp@,d2-d7
@@ -2239,7 +2239,7 @@ Lcmpdf$a$gt$b:
rts
Lcmpdf$b$gt$a:
movel IMM (LESS),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | put back the registers
#else
moveml sp@,d2-d7
@@ -2287,7 +2287,7 @@ Lround$to$nearest:
| Normalize shifting left until bit #DBL_MANT_DIG-32 is set or the exponent
| is one (remember that a denormalized number corresponds to an
| exponent of -D_BIAS+1).
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (1),d4 | remember that the exponent is at least one
#else
cmpl IMM (1),d4 | remember that the exponent is at least one
@@ -2297,7 +2297,7 @@ Lround$to$nearest:
addxl d2,d2 |
addxl d1,d1 |
addxl d0,d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d4,1b |
#else
subql IMM (1), d4
@@ -2325,7 +2325,7 @@ Lround$to$nearest:
addxl d2,d0
| Shift right once (because we used bit #DBL_MANT_DIG-32!).
2:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
#else
@@ -2340,7 +2340,7 @@ Lround$to$nearest:
| 'fraction overflow' ...).
btst IMM (DBL_MANT_DIG-32),d0
beq 1f
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
addw IMM (1),d4
@@ -2491,7 +2491,7 @@ SYM (__subsf3):
| float __addsf3(float, float);
SYM (__addsf3):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0) | everything will be done in registers
moveml d2-d7,sp@- | save all data registers but d0-d1
#else
@@ -2551,7 +2551,7 @@ Laddsf$2:
| same, and put the largest exponent in d6. Note that we are using two
| registers for each number (see the discussion by D. Knuth in "Seminumerical
| Algorithms").
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw d6,d7 | compare exponents
#else
cmpl d6,d7 | compare exponents
@@ -2561,32 +2561,32 @@ Laddsf$2:
1:
subl d6,d7 | keep the largest exponent
negl d7
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (8),d7 | put difference in lower byte
#else
lsrl IMM (8),d7 | put difference in lower byte
#endif
| if difference is too large we don't shift (actually, we can just exit) '
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (FLT_MANT_DIG+2),d7
#else
cmpl IMM (FLT_MANT_DIG+2),d7
#endif
bge Laddsf$b$small
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (16),d7 | if difference >= 16 swap
#else
cmpl IMM (16),d7 | if difference >= 16 swap
#endif
bge 4f
2:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d7
#else
subql IMM (1), d7
#endif
3:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d2 | shift right second operand
roxrl IMM (1),d3
dbra d7,3b
@@ -2605,7 +2605,7 @@ Laddsf$2:
swap d3
movew d3,d2
swap d2
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (16),d7
#else
subl IMM (16),d7
@@ -2613,7 +2613,7 @@ Laddsf$2:
bne 2b | if still more bits, go back to normal case
bra Laddsf$3
5:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d6,d7 | exchange the exponents
#else
eorl d6,d7
@@ -2622,32 +2622,32 @@ Laddsf$2:
#endif
subl d6,d7 | keep the largest exponent
negl d7 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (8),d7 | put difference in lower byte
#else
lsrl IMM (8),d7 | put difference in lower byte
#endif
| if difference is too large we don't shift (and exit!) '
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (FLT_MANT_DIG+2),d7
#else
cmpl IMM (FLT_MANT_DIG+2),d7
#endif
bge Laddsf$a$small
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (16),d7 | if difference >= 16 swap
#else
cmpl IMM (16),d7 | if difference >= 16 swap
#endif
bge 8f
6:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d7
#else
subl IMM (1),d7
#endif
7:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0 | shift right first operand
roxrl IMM (1),d1
dbra d7,7b
@@ -2666,7 +2666,7 @@ Laddsf$2:
swap d1
movew d1,d0
swap d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (16),d7
#else
subl IMM (16),d7
@@ -2679,7 +2679,7 @@ Laddsf$2:
Laddsf$3:
| Here we have to decide whether to add or subtract the numbers
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d6,a0 | get signs back
exg d7,a1 | and save the exponents
#else
@@ -2696,7 +2696,7 @@ Laddsf$3:
| numbers
| Here we have both positive or both negative
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d6,a0 | now we have the exponent in d6
#else
movel d6,d4
@@ -2713,7 +2713,7 @@ Laddsf$3:
| Put the exponent, in the first byte, in d2, to use the "standard" rounding
| routines:
movel d6,d2
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (8),d2
#else
lsrl IMM (8),d2
@@ -2725,7 +2725,7 @@ Laddsf$3:
| one more bit we check this:
btst IMM (FLT_MANT_DIG+1),d0
beq 1f
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
#else
@@ -2739,12 +2739,12 @@ Laddsf$3:
1:
lea Laddsf$4,a0 | to return from rounding routine
lea SYM (_fpCCR),a1 | check the rounding mode
-#ifdef __mcf5200__
+#ifdef __mcoldfire__
clrl d6
#endif
movew a1@(6),d6 | rounding mode in d6
beq Lround$to$nearest
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (ROUND_TO_PLUS),d6
#else
cmpl IMM (ROUND_TO_PLUS),d6
@@ -2754,14 +2754,14 @@ Laddsf$3:
bra Lround$to$plus
Laddsf$4:
| Put back the exponent, but check for overflow.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (0xff),d2
#else
cmpl IMM (0xff),d2
#endif
bhi 1f
bclr IMM (FLT_MANT_DIG-1),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lslw IMM (7),d2
#else
lsll IMM (7),d2
@@ -2787,7 +2787,7 @@ Lsubsf$0:
negl d1
negxl d0
1:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d2,a0 | now we have the exponent in d2
lsrw IMM (8),d2 | put it in the first byte
#else
@@ -2804,12 +2804,12 @@ Lsubsf$0:
| the rounding routines themselves.
lea Lsubsf$1,a0 | to return from rounding routine
lea SYM (_fpCCR),a1 | check the rounding mode
-#ifdef __mcf5200__
+#ifdef __mcoldfire__
clrl d6
#endif
movew a1@(6),d6 | rounding mode in d6
beq Lround$to$nearest
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (ROUND_TO_PLUS),d6
#else
cmpl IMM (ROUND_TO_PLUS),d6
@@ -2820,7 +2820,7 @@ Lsubsf$0:
Lsubsf$1:
| Put back the exponent (we can't have overflow!). '
bclr IMM (FLT_MANT_DIG-1),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lslw IMM (7),d2
#else
lsll IMM (7),d2
@@ -2836,7 +2836,7 @@ Laddsf$a$small:
movel a6@(12),d0
lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | restore data registers
#else
moveml sp@,d2-d7
@@ -2850,7 +2850,7 @@ Laddsf$b$small:
movel a6@(8),d0
lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | restore data registers
#else
moveml sp@,d2-d7
@@ -2908,7 +2908,7 @@ Laddsf$ret:
lea SYM (_fpCCR),a0
movew IMM (0),a0@
orl d7,d0 | put sign bit
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | restore data registers
#else
moveml sp@,d2-d7
@@ -2975,7 +2975,7 @@ Laddsf$nf:
| float __mulsf3(float, float);
SYM (__mulsf3):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@-
#else
@@ -3010,7 +3010,7 @@ SYM (__mulsf3):
andl d5,d0 | and isolate fraction
orl d4,d0 | and put hidden bit back
swap d2 | I like exponents in the first byte
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (7),d2 |
#else
lsrl IMM (7),d2 |
@@ -3021,13 +3021,13 @@ Lmulsf$1: | number
andl d5,d1 |
orl d4,d1 |
swap d3 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (7),d3 |
#else
lsrl IMM (7),d3 |
#endif
Lmulsf$2: |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
addw d3,d2 | add exponents
subw IMM (F_BIAS+1),d2 | and subtract bias (plus one)
#else
@@ -3060,7 +3060,7 @@ Lmulsf$2: |
addl d5,d1 | add a
addxl d4,d0
2:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbf d3,1b | loop back
#else
subql IMM (1),d3
@@ -3070,7 +3070,7 @@ Lmulsf$2: |
| Now we have the product in d0-d1, with bit (FLT_MANT_DIG - 1) + FLT_MANT_DIG
| (mod 32) of d0 set. The first thing to do now is to normalize it so bit
| FLT_MANT_DIG is set (to do the rounding).
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
rorl IMM (6),d1
swap d1
movew d1,d3
@@ -3089,7 +3089,7 @@ Lmulsf$2: |
lsll IMM (8),d0
addl d0,d0
addl d0,d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
orw d3,d0
#else
orl d3,d0
@@ -3099,7 +3099,7 @@ Lmulsf$2: |
btst IMM (FLT_MANT_DIG+1),d0
beq Lround$exit
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrl IMM (1),d0
roxrl IMM (1),d1
addw IMM (1),d2
@@ -3143,7 +3143,7 @@ Lmulsf$a$0:
bge Lf$inop | if b is +/-INFINITY or NaN return NaN
lea SYM (_fpCCR),a0 | else return zero
movew IMM (0),a0@ |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 |
#else
moveml sp@,d2-d7
@@ -3161,7 +3161,7 @@ Lmulsf$a$den:
movel IMM (1),d2
andl d5,d0
1: addl d0,d0 | shift a left (until bit 23 is set)
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d2 | and adjust exponent
#else
subql IMM (1),d2 | and adjust exponent
@@ -3174,7 +3174,7 @@ Lmulsf$b$den:
movel IMM (1),d3
andl d5,d1
1: addl d1,d1 | shift b left until bit 23 is set
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d3 | and adjust exponent
#else
subl IMM (1),d3 | and adjust exponent
@@ -3189,7 +3189,7 @@ Lmulsf$b$den:
| float __divsf3(float, float);
SYM (__divsf3):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@-
#else
@@ -3226,7 +3226,7 @@ SYM (__divsf3):
andl d5,d0 | and isolate fraction
orl d4,d0 | and put hidden bit back
swap d2 | I like exponents in the first byte
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (7),d2 |
#else
lsrl IMM (7),d2 |
@@ -3237,13 +3237,13 @@ Ldivsf$1: |
andl d5,d1 |
orl d4,d1 |
swap d3 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lsrw IMM (7),d3 |
#else
lsrl IMM (7),d3 |
#endif
Ldivsf$2: |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw d3,d2 | subtract exponents
addw IMM (F_BIAS),d2 | and add bias
#else
@@ -3270,7 +3270,7 @@ Ldivsf$2: |
subl d1,d0 | if a >= b a <-- a-b
beq 3f | if a is zero, exit
2: addl d0,d0 | multiply a by 2
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d3,1b
#else
subql IMM (1),d3
@@ -3282,7 +3282,7 @@ Ldivsf$2: |
1: cmpl d0,d1
ble 2f
addl d0,d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d3,1b
#else
subql IMM(1),d3
@@ -3291,7 +3291,7 @@ Ldivsf$2: |
movel IMM (0),d1
bra 3f
2: movel IMM (0),d1
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (FLT_MANT_DIG),d3
addw IMM (31),d3
#else
@@ -3309,7 +3309,7 @@ Ldivsf$2: |
btst IMM (FLT_MANT_DIG+1),d0
beq 1f | if it is not set, then bit 24 is set
lsrl IMM (1),d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
addw IMM (1),d2 |
#else
addl IMM (1),d2 |
@@ -3343,7 +3343,7 @@ Ldivsf$a$0:
movel IMM (0),d0 | else return zero
lea SYM (_fpCCR),a0 |
movew IMM (0),a0@ |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 |
#else
moveml sp@,d2-d7 |
@@ -3375,7 +3375,7 @@ Ldivsf$a$den:
movel IMM (1),d2
andl d5,d0
1: addl d0,d0 | shift a left until bit FLT_MANT_DIG-1 is set
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d2 | and adjust exponent
#else
subl IMM (1),d2 | and adjust exponent
@@ -3388,7 +3388,7 @@ Ldivsf$b$den:
movel IMM (1),d3
andl d5,d1
1: addl d1,d1 | shift b left until bit FLT_MANT_DIG is set
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
subw IMM (1),d3 | and adjust exponent
#else
subl IMM (1),d3 | and adjust exponent
@@ -3401,7 +3401,7 @@ Lround$exit:
| This is a common exit point for __mulsf3 and __divsf3.
| First check for underlow in the exponent:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (-FLT_MANT_DIG-1),d2
#else
cmpl IMM (-FLT_MANT_DIG-1),d2
@@ -3412,14 +3412,14 @@ Lround$exit:
| exponent until it becomes 1 or the fraction is zero (in the latter case
| we signal underflow and return zero).
movel IMM (0),d6 | d6 is used temporarily
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (1),d2 | if the exponent is less than 1 we
#else
cmpl IMM (1),d2 | if the exponent is less than 1 we
#endif
bge 2f | have to shift right (denormalize)
1:
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
addw IMM (1),d2 | adjust the exponent
lsrl IMM (1),d0 | shift right once
roxrl IMM (1),d1 |
@@ -3446,12 +3446,12 @@ Lround$exit:
| Now call the rounding routine (which takes care of denormalized numbers):
lea Lround$0,a0 | to return from rounding routine
lea SYM (_fpCCR),a1 | check the rounding mode
-#ifdef __mcf5200__
+#ifdef __mcoldfire__
clrl d6
#endif
movew a1@(6),d6 | rounding mode in d6
beq Lround$to$nearest
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (ROUND_TO_PLUS),d6
#else
cmpl IMM (ROUND_TO_PLUS),d6
@@ -3467,7 +3467,7 @@ Lround$0:
| check again for underflow!). We have to check for overflow or for a
| denormalized number (which also signals underflow).
| Check for overflow (i.e., exponent >= 255).
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (0x00ff),d2
#else
cmpl IMM (0x00ff),d2
@@ -3478,14 +3478,14 @@ Lround$0:
beq Lf$den
1:
| Put back the exponents and sign and return.
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
lslw IMM (7),d2 | exponent back to fourth byte
#else
lsll IMM (7),d2 | exponent back to fourth byte
#endif
bclr IMM (FLT_MANT_DIG-1),d0
swap d0 | and put back exponent
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
orw d2,d0 |
#else
orl d2,d0
@@ -3495,7 +3495,7 @@ Lround$0:
lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7
#else
moveml sp@,d2-d7
@@ -3514,7 +3514,7 @@ Lround$0:
| float __negsf2(float);
SYM (__negsf2):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@-
#else
@@ -3536,7 +3536,7 @@ SYM (__negsf2):
bra Lf$infty
1: lea SYM (_fpCCR),a0
movew IMM (0),a0@
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7
#else
moveml sp@,d2-d7
@@ -3558,7 +3558,7 @@ EQUAL = 0
| int __cmpsf2(float, float);
SYM (__cmpsf2):
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
link a6,IMM (0)
moveml d2-d7,sp@- | save registers
#else
@@ -3595,7 +3595,7 @@ Lcmpsf$2:
tstl d6
bpl 1f
| If both are negative exchange them
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
exg d0,d1
#else
movel d0,d7
@@ -3610,7 +3610,7 @@ Lcmpsf$2:
bne Lcmpsf$a$gt$b | |b| < |a|
| If we got here a == b.
movel IMM (EQUAL),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | put back the registers
#else
moveml sp@,d2-d7
@@ -3619,7 +3619,7 @@ Lcmpsf$2:
rts
Lcmpsf$a$gt$b:
movel IMM (GREATER),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | put back the registers
#else
moveml sp@,d2-d7
@@ -3630,7 +3630,7 @@ Lcmpsf$a$gt$b:
rts
Lcmpsf$b$gt$a:
movel IMM (LESS),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
moveml sp@+,d2-d7 | put back the registers
#else
moveml sp@,d2-d7
@@ -3668,7 +3668,7 @@ Lround$to$nearest:
| Normalize shifting left until bit #FLT_MANT_DIG is set or the exponent
| is one (remember that a denormalized number corresponds to an
| exponent of -F_BIAS+1).
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
cmpw IMM (1),d2 | remember that the exponent is at least one
#else
cmpl IMM (1),d2 | remember that the exponent is at least one
@@ -3676,7 +3676,7 @@ Lround$to$nearest:
beq 2f | an exponent of one means denormalized
addl d1,d1 | else shift and adjust the exponent
addxl d0,d0 |
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
dbra d2,1b |
#else
subql IMM (1),d2
@@ -3705,7 +3705,7 @@ Lround$to$nearest:
btst IMM (FLT_MANT_DIG),d0
beq 1f
lsrl IMM (1),d0
-#ifndef __mcf5200__
+#ifndef __mcoldfire__
addw IMM (1),d2
#else
addql IMM (1),d2
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index efedd4f2d1e..8178d527459 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -19,21 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define LINUX_DEFAULT_ELF
-#define MOTOROLA /* Use Motorola syntax */
-#define USE_GAS /* But GAS wants jbsr instead of jsr */
-
-/* TODO: convert includes to ${tm_file} list in config.gcc. */
-#include <m68k/m68k.h>
-
-/* Make sure CC1 is undefined. */
-#undef CC1_SPEC
-
-#include "dbxelf.h"
-#include "elfos.h"
-#include "svr4.h"
-#include <linux.h> /* some common stuff */
-
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (68k GNU/Linux with ELF)");
@@ -83,7 +68,7 @@ Boston, MA 02111-1307, USA. */
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
+ "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", "argptr" }
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
@@ -171,7 +156,7 @@ Boston, MA 02111-1307, USA. */
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_RETURN_CASE_JUMP \
do { \
- if (TARGET_5200) \
+ if (TARGET_COLDFIRE) \
{ \
if (ADDRESS_REG_P (operands[0])) \
return "jmp %%pc@(2,%0:l)"; \
diff --git a/gcc/config/m68k/m68k-aout.h b/gcc/config/m68k/m68k-aout.h
index 095ec874795..cf553fbf220 100644
--- a/gcc/config/m68k/m68k-aout.h
+++ b/gcc/config/m68k/m68k-aout.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler. "naked" 68020,
a.out object files and debugging, version.
- Copyright (C) 1994, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1996, 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -19,11 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This comment is here to see if it will keep Sun's cpp from dying. */
-
-#include "m68k/m68k-none.h"
-#include "m68k/m68kemb.h"
-
#define DBX_DEBUGGING_INFO 1
#undef SDB_DEBUGGING_INFO
diff --git a/gcc/config/m68k/m68k-coff.h b/gcc/config/m68k/m68k-coff.h
deleted file mode 100644
index ad08a48579b..00000000000
--- a/gcc/config/m68k/m68k-coff.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Definitions of target machine for GNU compiler. "naked" 68020,
- COFF object files and debugging, version.
- Copyright (C) 1994 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#define MOTOROLA /* Use Motorola syntax rather than MIT. */
-#ifndef USE_GAS /* forces jsbr instead of jsr. */
-#define USE_GAS
-#endif
-
-#include "m68k/m68k-none.h"
-#include "m68k/m68kemb.h"
-#include "m68k/coff.h"
-
-/* end of m68k-coff.h */
diff --git a/gcc/config/m68k/m68k-none.h b/gcc/config/m68k/m68k-none.h
index 0c9514b89ca..040122f01d2 100644
--- a/gcc/config/m68k/m68k-none.h
+++ b/gcc/config/m68k/m68k-none.h
@@ -18,25 +18,21 @@ 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 "m68k/m68k.h"
-
/* Default to m68k (m68020). */
#ifndef TARGET_CPU_DEFAULT
#define TARGET_CPU_DEFAULT M68K_CPU_m68k
#endif
/* These are values set by the configure script in TARGET_CPU_DEFAULT.
- They are ((desired value for TARGET_DEFAULT) << 4) + sequential integer.
- See m68k.h for the values (it should really define MASK_FOO so we can
- use them). */
-#define M68K_CPU_m68k ((7 << 4) + 0)
-#define M68K_CPU_m68000 ((0 << 4) + 1)
-#define M68K_CPU_m68010 ((0 << 4) + 1) /* make same as m68000 */
-#define M68K_CPU_m68020 ((7 << 4) + 2)
-#define M68K_CPU_m68030 ((7 << 4) + 3)
-#define M68K_CPU_m68040 ((01007 << 4) + 4)
-#define M68K_CPU_m68302 ((0 << 4) + 5)
-#define M68K_CPU_m68332 ((1 << 4) + 6)
+ They are (sequential integer + (desired value for TARGET_DEFAULT) << 4). */
+#define M68K_CPU_m68k (0 + ((MASK_68020|MASK_68881|MASK_BITFIELD)<<4))
+#define M68K_CPU_m68000 (1 + (0 << 4))
+#define M68K_CPU_m68010 (1 + (0 << 4)) /* make same as m68000 */
+#define M68K_CPU_m68020 (2 + ((MASK_68020|MASK_68881|MASK_BITFIELD) << 4))
+#define M68K_CPU_m68030 (3 + ((MASK_68030|MASK_68020|MASK_68881|MASK_BITFIELD) << 4))
+#define M68K_CPU_m68040 (4 + ((MASK_68040_ONLY|MASK_68020|MASK_68881|MASK_BITFIELD) << 4))
+#define M68K_CPU_m68302 (5 + (0 << 4))
+#define M68K_CPU_m68332 (6 + (MASK_68020 << 4))
/* This is tested for below, so if target wants to override this, it
just set this first in cover file. */
@@ -50,32 +46,26 @@ Boston, MA 02111-1307, USA. */
this file. However, it's not used anywhere here because it doesn't
seem to be necessary. */
#if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
-#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68020 } -D__mc68020 -D__mc68020__"
#define ASM_CPU_DEFAULT_SPEC "-mc68020"
#define CC1_CPU_DEFAULT_SPEC "-m68020"
#else
#if TARGET_CPU_DEFAULT == M68K_CPU_m68000
-#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68000 } -D__mc68000 -D__mc68000__"
#define ASM_CPU_DEFAULT_SPEC "-mc68000"
#define CC1_CPU_DEFAULT_SPEC "-m68000"
#else
#if TARGET_CPU_DEFAULT == M68K_CPU_m68030
-#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68030 } -D__mc68030 -D__mc68030__"
#define ASM_CPU_DEFAULT_SPEC "-mc68030"
#define CC1_CPU_DEFAULT_SPEC "-m68030"
#else
#if TARGET_CPU_DEFAULT == M68K_CPU_m68040
-#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68040 } -D__mc68040 -D__mc68040__"
#define ASM_CPU_DEFAULT_SPEC "-mc68040"
#define CC1_CPU_DEFAULT_SPEC "-m68040"
#else
#if TARGET_CPU_DEFAULT == M68K_CPU_m68302
-#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68302 } -D__mc68302 -D__mc68302__"
#define ASM_CPU_DEFAULT_SPEC "-mc68302"
#define CC1_CPU_DEFAULT_SPEC "-m68302"
#else
#if TARGET_CPU_DEFAULT == M68K_CPU_m68332
-#define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68332 -Dmcpu32 } -D__mc68332 -D__mc68332__ -D__mcpu32 -D__mcpu32__"
#define ASM_CPU_DEFAULT_SPEC "-mc68332"
#define CC1_CPU_DEFAULT_SPEC "-m68332"
#else
@@ -86,52 +76,12 @@ Unrecognized value in TARGET_CPU_DEFAULT.
#endif
#endif
#endif
-
-/* Define __HAVE_68881__ or nothing (soft float), appropriately. */
-#undef CPP_FPU_SPEC
-#if TARGET_DEFAULT & MASK_68881
-#define CPP_FPU_SPEC "\
-%{!mc68000:%{!m68000:%{!m68302:%{!mcpu32:%{!m68332:%{!m5200:%{!msoft-float:%{!mno-68881:-D__HAVE_68881__ }}}}}}}} \
-%{m68881:-D__HAVE_68881__ }"
-#else
-#define CPP_FPU_SPEC "\
-%{m68881:-D__HAVE_68881__ }"
-#endif
-
-/* Names to predefine in the preprocessor for this target machine.
- Other definitions depend on what the default cpu is and switches
- given to the compiler:
-
- -m68000, -mc68000: define nothing else
- -m68010: define mc68010
- -m68020, -mc68020: define mc68020
- -m68030: define mc68030
- -m68040: define mc68040
- -m68060: define mc68060
- -m68020-40: define mc68020 mc68030 mc68040
- -m68020-60: define mc68020 mc68030 mc68040 mc68060
- -m68302: define mc68302
- -m68332: define mc68332 mcpu32
- -mcpu32: define mcpu32
- -m5200: define mcf5200
- default: define as above appropriately
-
- GCC won't automatically add __'d versions, we have to mention them
- explicitly. */
-
-#undef CPP_SPEC
-#define CPP_SPEC "\
-%(cpp_fpu)%{!ansi:%{m68302:-Dmc68302 }%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68020-60:-Dmc68020 -Dmc68030 -Dmc68040 -Dmc68060 }%{m68060:-Dmc68060 }%{mcpu32:-Dmcpu32 } %{m68332:-Dmc68332 -Dmcpu32 }%{m5200:-Dmcf5200 }} \
-%{m68302:-D__mc68302__ -D__mc68302 }%{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68020-60:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 -D__mc68060__ -D__mc68060 }%{m68060:-D__mc68060__ -D__mc68060 }%{mcpu32:-D__mcpu32__ -D__mcpu32 }%{m68332:-D__mc68332__ -D__mc68332 -D__mcpu32__ -D__mcpu32 }%{m5200:-D__mcf5200__ -D__mcf5200 } \
-%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32: %{!m68332:%{!m5200:%(cpp_cpu_default)}}}}}}}}}}}}}} \
-%(cpp_subtarget) \
-"
/* Pass flags to gas indicating which type of processor we have. */
#undef ASM_SPEC
#define ASM_SPEC "\
-%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881} %{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040} %{m68020-60:-mc68040} %{m68060}%{mcpu32}%{m68332}%{m5200}%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:%{!m68332:%{!m5200:%(asm_cpu_default)}}}}}}}}}}}}}} \
+%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881} %{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040} %{m68020-60:-mc68040} %{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%(asm_cpu_default)}}}}}}}}}}}}}}}}}} \
"
/* cc1/cc1plus always receives all the -m flags. If the specs strings above
@@ -152,11 +102,8 @@ Unrecognized value in TARGET_CPU_DEFAULT.
Do not define this macro if it does not need to do anything. */
#define EXTRA_SPECS \
- { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
- { "cpp_fpu", CPP_FPU_SPEC }, \
- { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
{ "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
-/*{ "cc1_cpu_default", CC1_CPU_DEFAULT__SPEC },*/ \
+ { "cc1_cpu_default", CC1_CPU_DEFAULT_SPEC }, \
SUBTARGET_EXTRA_SPECS
#define CPP_SUBTARGET_SPEC ""
diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h
index e0ffee80eb7..955cbf576f0 100644
--- a/gcc/config/m68k/m68k-protos.h
+++ b/gcc/config/m68k/m68k-protos.h
@@ -21,49 +21,49 @@ Boston, MA 02111-1307, USA. */
/* Define functions defined in aux-output.c and used in templates. */
#ifdef RTX_CODE
-extern const char *output_move_const_into_data_reg PARAMS ((rtx *));
-extern const char *output_move_simode_const PARAMS ((rtx *));
-extern const char *output_move_simode PARAMS ((rtx *));
-extern const char *output_move_himode PARAMS ((rtx *));
-extern const char *output_move_qimode PARAMS ((rtx *));
-extern const char *output_move_stricthi PARAMS ((rtx *));
-extern const char *output_move_strictqi PARAMS ((rtx *));
-extern const char *output_move_double PARAMS ((rtx *));
-extern const char *output_move_const_single PARAMS ((rtx *));
-extern const char *output_move_const_double PARAMS ((rtx *));
-extern const char *output_btst PARAMS ((rtx *, rtx, rtx, rtx, int));
-extern const char *output_scc_di PARAMS ((rtx, rtx, rtx, rtx));
-extern const char *output_addsi3 PARAMS ((rtx *));
-extern const char *output_andsi3 PARAMS ((rtx *));
-extern const char *output_iorsi3 PARAMS ((rtx *));
-extern const char *output_xorsi3 PARAMS ((rtx *));
-extern void output_dbcc_and_branch PARAMS ((rtx *));
-extern int const_uint32_operand PARAMS ((rtx, enum machine_mode));
-extern int const_sint32_operand PARAMS ((rtx, enum machine_mode));
-extern int floating_exact_log2 PARAMS ((rtx));
-extern int not_sp_operand PARAMS ((rtx, enum machine_mode));
-extern int valid_dbcc_comparison_p PARAMS ((rtx, enum machine_mode));
-extern int extend_operator PARAMS ((rtx, enum machine_mode));
-extern int strict_low_part_peephole_ok PARAMS ((enum machine_mode, rtx, rtx));
+extern HOST_WIDE_INT m68k_initial_elimination_offset (int from, int to);
+extern const char *output_move_const_into_data_reg (rtx *);
+extern const char *output_move_simode_const (rtx *);
+extern const char *output_move_simode (rtx *);
+extern const char *output_move_himode (rtx *);
+extern const char *output_move_qimode (rtx *);
+extern const char *output_move_stricthi (rtx *);
+extern const char *output_move_strictqi (rtx *);
+extern const char *output_move_double (rtx *);
+extern const char *output_move_const_single (rtx *);
+extern const char *output_move_const_double (rtx *);
+extern const char *output_btst (rtx *, rtx, rtx, rtx, int);
+extern const char *output_scc_di (rtx, rtx, rtx, rtx);
+extern const char *output_addsi3 (rtx *);
+extern const char *output_andsi3 (rtx *);
+extern const char *output_iorsi3 (rtx *);
+extern const char *output_xorsi3 (rtx *);
+extern void output_dbcc_and_branch (rtx *);
+extern int const_uint32_operand (rtx, enum machine_mode);
+extern int const_sint32_operand (rtx, enum machine_mode);
+extern int floating_exact_log2 (rtx);
+extern int not_sp_operand (rtx, enum machine_mode);
+extern int valid_dbcc_comparison_p (rtx, enum machine_mode);
+extern int extend_operator (rtx, enum machine_mode);
+extern bool strict_low_part_peephole_ok (enum machine_mode mode, rtx first_insn, rtx target);
/* Functions from m68k.c used in macros. */
-extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int standard_68881_constant_p PARAMS ((rtx));
-extern int standard_sun_fpa_constant_p PARAMS ((rtx));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void notice_update_cc PARAMS ((rtx, rtx));
+extern bool symbolic_operand (rtx, enum machine_mode);
+extern int standard_68881_constant_p (rtx);
+extern void print_operand_address (FILE *, rtx);
+extern void print_operand (FILE *, rtx, int);
+extern void notice_update_cc (rtx, rtx);
#if 0
-extern void finalize_pic PARAMS ((rtx, enum machine_mode));
+extern void finalize_pic (rtx, enum machine_mode));
#endif
-extern int general_src_operand PARAMS ((rtx, enum machine_mode));
-extern int nonimmediate_src_operand PARAMS ((rtx, enum machine_mode));
-extern int memory_src_operand PARAMS ((rtx, enum machine_mode));
-extern int pcrel_address PARAMS ((rtx, enum machine_mode));
-extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx));
+extern int general_src_operand (rtx, enum machine_mode);
+extern int nonimmediate_src_operand (rtx, enum machine_mode);
+extern int memory_src_operand (rtx, enum machine_mode);
+extern int pcrel_address (rtx, enum machine_mode);
+extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
#endif /* RTX_CODE */
-extern int flags_in_68881 PARAMS ((void));
-extern int use_return_insn PARAMS ((void));
-extern void override_options PARAMS ((void));
-extern void init_68881_table PARAMS ((void));
+extern int flags_in_68881 (void);
+extern int use_return_insn (void);
+extern void override_options (void);
+extern void init_68881_table (void);
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index c9f879ab73c..1c3d8cc6a6e 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -49,23 +49,22 @@ Boston, MA 02111-1307, USA. */
if SGS_SWITCH_TABLE. */
int switch_table_difference_label_flag;
-static rtx find_addr_reg PARAMS ((rtx));
-static const char *singlemove_string PARAMS ((rtx *));
-static void m68k_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void m68k_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void m68k_coff_asm_named_section PARAMS ((const char *, unsigned int));
-#ifdef CTOR_LIST_BEGIN
-static void m68k_svr3_asm_out_constructor PARAMS ((rtx, int));
-#endif
+static rtx find_addr_reg (rtx);
+static const char *singlemove_string (rtx *);
+static void m68k_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void m68k_output_function_epilogue (FILE *, HOST_WIDE_INT);
+#ifdef M68K_TARGET_COFF
+static void m68k_coff_asm_named_section (const char *, unsigned int);
+#endif /* M68K_TARGET_COFF */
#ifdef HPUX_ASM
-static void m68k_hp320_internal_label PARAMS ((FILE *, const char *, unsigned long));
-static void m68k_hp320_file_start PARAMS ((void));
-#endif
-static void m68k_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
-static int m68k_save_reg PARAMS ((unsigned int));
-static int const_int_cost PARAMS ((rtx));
-static bool m68k_rtx_costs PARAMS ((rtx, int, int, int *));
+static void m68k_hp320_internal_label (FILE *, const char *, unsigned long);
+static void m68k_hp320_file_start (void);
+#endif
+static void m68k_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree);
+static int m68k_save_reg (unsigned int);
+static int const_int_cost (rtx);
+static bool m68k_rtx_costs (rtx, int, int, int *);
/* Alignment to use for loops and jumps */
@@ -150,7 +149,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
`-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
void
-override_options ()
+override_options (void)
{
int def_align;
int i;
@@ -216,10 +215,87 @@ override_options ()
real_format_for_mode[XFmode - QFmode] = &ieee_extended_motorola_format;
}
+/* Structure describing stack frame layout. */
+struct m68k_frame {
+ HOST_WIDE_INT offset;
+ HOST_WIDE_INT size;
+ /* data and address register */
+ int reg_no;
+ unsigned int reg_mask;
+ unsigned int reg_rev_mask;
+ /* fpu registers */
+ int fpu_no;
+ unsigned int fpu_mask;
+ unsigned int fpu_rev_mask;
+ /* fpa registers */
+ int fpa_no;
+ /* offsets relative to ARG_POINTER. */
+ HOST_WIDE_INT frame_pointer_offset;
+ HOST_WIDE_INT stack_pointer_offset;
+};
+
+static void
+m68k_compute_frame_layout (struct m68k_frame *frame)
+{
+ int regno, saved;
+ unsigned int mask, rmask;
+
+ frame->size = (get_frame_size () + 3) & -4;
+
+ mask = rmask = saved = 0;
+ for (regno = 0; regno < 16; regno++)
+ if (m68k_save_reg (regno))
+ {
+ mask |= 1 << regno;
+ rmask |= 1 << (15 - regno);
+ saved++;
+ }
+ frame->offset = saved * 4;
+ frame->reg_no = saved;
+ frame->reg_mask = mask;
+ frame->reg_rev_mask = rmask;
+
+ if (TARGET_68881 /* || TARGET_CFV4E */)
+ {
+ mask = rmask = saved = 0;
+ for (regno = 16; regno < 24; regno++)
+ if (regs_ever_live[regno] && ! call_used_regs[regno])
+ {
+ mask |= 1 << (23 - regno);
+ rmask |= 1 << (regno - 16);
+ saved++;
+ }
+ frame->offset += saved * 12 /* (TARGET_CFV4E ? 8 : 12) */;
+ frame->fpu_no = saved;
+ frame->fpu_mask = mask;
+ frame->fpu_rev_mask = rmask;
+ }
+}
+
+HOST_WIDE_INT
+m68k_initial_elimination_offset (int from, int to)
+{
+ struct m68k_frame frame;
+
+ /* FIXME: The correct offset to compute here would appear to be
+ (frame_pointer_needed ? -UNITS_PER_WORD * 2 : -UNITS_PER_WORD);
+ but for some obscure reason, this must be 0 to get correct code. */
+ if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM)
+ return 0;
+
+ m68k_compute_frame_layout (&frame);
+
+ if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
+ return frame.offset + frame.size + (frame_pointer_needed ? -UNITS_PER_WORD * 2 : -UNITS_PER_WORD);
+ else if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
+ return frame.offset + frame.size;
+
+ abort();
+}
+
/* Return 1 if we need to save REGNO. */
static int
-m68k_save_reg (regno)
- unsigned int regno;
+m68k_save_reg (unsigned int regno)
{
if (flag_pic && current_function_uses_pic_offset_table
&& regno == PIC_OFFSET_TABLE_REGNUM)
@@ -257,16 +333,14 @@ m68k_save_reg (regno)
of the order for movem! */
static void
-m68k_output_function_prologue (stream, size)
- FILE *stream;
- HOST_WIDE_INT size;
+m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size)
{
register int regno;
register int mask = 0;
int num_saved_regs = 0;
HOST_WIDE_INT fsize = (size + 3) & -4;
+ HOST_WIDE_INT fsize_with_regs;
HOST_WIDE_INT cfa_offset = INCOMING_FRAME_SP_OFFSET;
- HOST_WIDE_INT cfa_store_offset = cfa_offset;
/* If the stack limit is a symbol, we can check it here,
before actually allocating the space. */
@@ -282,6 +356,21 @@ m68k_output_function_prologue (stream, size)
#endif
}
+ if (TARGET_COLDFIRE)
+ {
+ /* on Coldfire add register save into initial stack frame setup, if possible */
+ for (regno = 0; regno < 16; regno++)
+ if (m68k_save_reg (regno))
+ num_saved_regs++;
+
+ if (num_saved_regs <= 2)
+ num_saved_regs = 0;
+ }
+ else
+ num_saved_regs = 0;
+
+ fsize_with_regs = fsize + num_saved_regs * 4;
+
if (frame_pointer_needed)
{
if (fsize == 0 && TARGET_68040)
@@ -299,75 +388,73 @@ m68k_output_function_prologue (stream, size)
reg_names[FRAME_POINTER_REGNUM]);
#endif
}
- else if (fsize < 0x8000)
+ else if (fsize_with_regs < 0x8000)
{
#ifdef MOTOROLA
- asm_fprintf (stream, "\tlink.w %s,%I%wd\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize);
+ 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);
+ asm_fprintf (stream, "\tlink %s,%I%wd\n",
+ reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
#endif
}
else if (TARGET_68020)
{
#ifdef MOTOROLA
asm_fprintf (stream, "\tlink.l %s,%I%wd\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize);
+ reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
#else
asm_fprintf (stream, "\tlink %s,%I%wd\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize);
+ reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
#endif
}
else
{
- /* Adding negative number is faster on the 68040. */
+ /* 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);
+ 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);
+ reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
#endif
}
if (dwarf2out_do_frame ())
{
char *l;
l = (char *) dwarf2out_cfi_label ();
- cfa_store_offset += 4;
- cfa_offset = cfa_store_offset;
- dwarf2out_reg_save (l, FRAME_POINTER_REGNUM, -cfa_store_offset);
+ cfa_offset += 4;
+ dwarf2out_reg_save (l, FRAME_POINTER_REGNUM, -cfa_offset);
dwarf2out_def_cfa (l, FRAME_POINTER_REGNUM, cfa_offset);
- cfa_store_offset += fsize;
+ cfa_offset += fsize;
}
}
- else if (fsize)
+ else if (fsize_with_regs) /* !frame_pointer_needed */
{
- if (fsize + 4 < 0x8000)
+ if (fsize_with_regs < 0x8000)
{
-#ifndef NO_ADDSUB_Q
- if (fsize + 4 <= 8)
+ if (fsize_with_regs <= 8)
{
- if (!TARGET_5200)
+ if (!TARGET_COLDFIRE)
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tsubq.w %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubq.w %I%wd,%Rsp\n", fsize_with_regs);
#else
- asm_fprintf (stream, "\tsubqw %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubqw %I%wd,%Rsp\n", fsize_with_regs);
#endif
}
else
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tsubq.l %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubq.l %I%wd,%Rsp\n", fsize_with_regs);
#else
- asm_fprintf (stream, "\tsubql %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubql %I%wd,%Rsp\n", fsize_with_regs);
#endif
}
}
- else if (fsize + 4 <= 16 && TARGET_CPU32)
+ 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. */
@@ -375,49 +462,48 @@ m68k_output_function_prologue (stream, size)
#ifdef MOTOROLA
asm_fprintf (stream,
"\tsubq.w %I8,%Rsp\n\tsubq.w %I%wd,%Rsp\n",
- fsize + 4 - 8);
+ fsize_with_regs - 8);
#else
asm_fprintf (stream, "\tsubqw %I8,%Rsp\n\tsubqw %I%wd,%Rsp\n",
- fsize + 4 - 8);
+ fsize_with_regs - 8);
#endif
}
- else
-#endif /* not NO_ADDSUB_Q */
- if (TARGET_68040)
+ else if (TARGET_68040)
{
/* Adding negative number is faster on the 68040. */
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", - (fsize + 4));
+ asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", -fsize_with_regs);
#else
- asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", - (fsize + 4));
+ asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", -fsize_with_regs);
#endif
}
else
{
#ifdef MOTOROLA
- asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", - (fsize + 4));
+ asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", -fsize_with_regs);
#else
- asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", - (fsize + 4));
+ asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", -fsize_with_regs);
#endif
}
}
- else
+ else /* fsize_with_regs >= 0x8000 */
{
- /* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", - (fsize + 4));
+ asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", -fsize_with_regs);
#else
- asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", - (fsize + 4));
+ asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", -fsize_with_regs);
#endif
}
if (dwarf2out_do_frame ())
{
- cfa_store_offset += fsize + 4;
- cfa_offset = cfa_store_offset;
+ cfa_offset += fsize + 4;
dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, cfa_offset);
}
- }
+ } /* !frame_pointer_needed */
+
+ num_saved_regs = 0;
+
if (TARGET_68881)
{
for (regno = 16; regno < 24; regno++)
@@ -438,16 +524,13 @@ m68k_output_function_prologue (stream, size)
char *l = (char *) dwarf2out_cfi_label ();
int n_regs;
- cfa_store_offset += num_saved_regs * 12;
+ cfa_offset += num_saved_regs * 12;
if (! frame_pointer_needed)
- {
- cfa_offset = cfa_store_offset;
- dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
- }
+ dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
for (regno = 16, n_regs = 0; regno < 24; regno++)
if (mask & (1 << (regno - 16)))
dwarf2out_reg_save (l, regno,
- -cfa_store_offset + n_regs++ * 12);
+ -cfa_offset + n_regs++ * 12);
}
}
mask = 0;
@@ -502,29 +585,24 @@ m68k_output_function_prologue (stream, size)
{
char *l = (char *) dwarf2out_cfi_label ();
- cfa_store_offset += 4;
+ cfa_offset += 4;
if (! frame_pointer_needed)
- {
- cfa_offset = cfa_store_offset;
- dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
- }
- dwarf2out_reg_save (l, 15 - i, -cfa_store_offset);
+ dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
+ dwarf2out_reg_save (l, 15 - i, -cfa_offset);
}
}
}
else if (mask)
{
- if (TARGET_5200)
+ if (TARGET_COLDFIRE)
{
/* The coldfire does not support the predecrement form of the
movml instruction, so we must adjust the stack pointer and
then use the plain address register indirect mode. We also
have to invert the register save mask to use the new mode.
- FIXME: if num_saved_regs was calculated earlier, we could
- combine the stack pointer adjustment with any adjustment
- done when the initial stack frame is created. This would
- save an instruction */
+ The required register save space was combined earlier with
+ the fsize amount. Don't add it again. */
int newmask = 0;
int i;
@@ -534,10 +612,8 @@ m68k_output_function_prologue (stream, size)
newmask |= (1 << (15-i));
#ifdef MOTOROLA
- asm_fprintf (stream, "\tlea (%d,%Rsp),%Rsp\n", -num_saved_regs*4);
asm_fprintf (stream, "\tmovm.l %I0x%x,(%Rsp)\n", newmask);
#else
- asm_fprintf (stream, "\tlea %Rsp@(%d),%Rsp\n", -num_saved_regs*4);
asm_fprintf (stream, "\tmoveml %I0x%x,%Rsp@\n", newmask);
#endif
}
@@ -554,16 +630,13 @@ m68k_output_function_prologue (stream, size)
char *l = (char *) dwarf2out_cfi_label ();
int n_regs;
- cfa_store_offset += num_saved_regs * 4;
+ cfa_offset += num_saved_regs * 4;
if (! frame_pointer_needed)
- {
- cfa_offset = cfa_store_offset;
- dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
- }
+ dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
for (regno = 0, n_regs = 0; regno < 16; regno++)
if (mask & (1 << (15 - regno)))
dwarf2out_reg_save (l, regno,
- -cfa_store_offset + n_regs++ * 4);
+ -cfa_offset + n_regs++ * 4);
}
}
if (flag_pic && current_function_uses_pic_offset_table)
@@ -572,7 +645,7 @@ m68k_output_function_prologue (stream, size)
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__GLOBAL_OFFSET_TABLE_, %s\n",
+ 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],
@@ -607,15 +680,14 @@ use_return_insn ()
omit stack adjustments before returning. */
static void
-m68k_output_function_epilogue (stream, size)
- FILE *stream;
- HOST_WIDE_INT size;
+m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size)
{
register int regno;
register int mask, fmask;
register int nregs;
HOST_WIDE_INT offset, foffset;
HOST_WIDE_INT fsize = (size + 3) & -4;
+ HOST_WIDE_INT fsize_with_regs;
int big = 0;
rtx insn = get_last_insn ();
int restore_from_sp = 0;
@@ -658,18 +730,45 @@ m68k_output_function_epilogue (stream, size)
stack adjustment needed at that point. */
restore_from_sp = ! frame_pointer_needed
|| (! current_function_calls_alloca && leaf_function_p ());
+
+ /* fsize_with_regs is the size we need to adjust the sp when
+ popping the frame */
+ fsize_with_regs = fsize;
+
+ /* Because the ColdFire doesn't support moveml with
+ complex address modes, we must adjust the stack manually
+ after restoring registers. When the frame pointer isn't used,
+ we can merge movem adjustment into frame unlinking
+ made immediately after it. */
+ if (TARGET_COLDFIRE && restore_from_sp && (nregs > 2))
+ fsize_with_regs += nregs * 4;
+
if (offset + fsize >= 0x8000
&& ! restore_from_sp
&& (mask || fmask))
{
+ /* 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 - offset);
+#else
+ asm_fprintf (stream, "\tmovel %I%d,%Ra1\n", -fsize - offset);
+#endif
+ }
+ else
+ {
#ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l %I%wd,%Ra1\n", -fsize);
+ asm_fprintf (stream, "\t%Omove.l %I%wd,%Ra1\n", -fsize);
#else
- asm_fprintf (stream, "\tmovel %I%wd,%Ra1\n", -fsize);
+ asm_fprintf (stream, "\tmovel %I%wd,%Ra1\n", -fsize);
#endif
+ }
+
fsize = 0, big = 1;
}
- if (TARGET_5200 || nregs <= 2)
+ if (nregs <= 2)
{
/* Restore each separately in the same order moveml does.
Using two movel instructions instead of a single moveml
@@ -713,10 +812,9 @@ m68k_output_function_epilogue (stream, size)
reg_names[FRAME_POINTER_REGNUM],
reg_names[i]);
#else
- fprintf (stream,
- "\tmovel %s@(-" HOST_WIDE_INT_PRINT_DEC "),%s\n",
- reg_names[FRAME_POINTER_REGNUM],
- offset + fsize, reg_names[i]);
+ asm_fprintf (stream, "\tmovel %s@(-%wd),%s\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ offset + fsize, reg_names[i]);
#endif
}
offset = offset - 4;
@@ -724,39 +822,77 @@ m68k_output_function_epilogue (stream, size)
}
else if (mask)
{
- if (big)
- {
+ /* The ColdFire requires special handling due to its limited moveml insn */
+ if (TARGET_COLDFIRE)
+ {
+ if (big)
+ {
#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l -%wd(%s,%Ra1.l),%I0x%x\n",
- offset + fsize,
- reg_names[FRAME_POINTER_REGNUM],
- mask);
+ asm_fprintf (stream, "\tadd.l %s,%Ra1\n", reg_names[FRAME_POINTER_REGNUM]);
+ asm_fprintf (stream, "\tmovm.l (%Ra1),%I0x%x\n", mask);
#else
- asm_fprintf (stream, "\tmoveml %s@(-%wd,%Ra1:l),%I0x%x\n",
- reg_names[FRAME_POINTER_REGNUM],
- offset + fsize, mask);
+ asm_fprintf (stream, "\taddl %s,%Ra1\n", reg_names[FRAME_POINTER_REGNUM]);
+ asm_fprintf (stream, "\tmoveml %Ra1@,%I0x%x\n", mask);
#endif
- }
- else if (restore_from_sp)
- {
+ }
+ else if (restore_from_sp)
+ {
#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l (%Rsp)+,%I0x%x\n", mask);
+ asm_fprintf (stream, "\tmovm.l (%Rsp),%I0x%x\n", mask);
#else
- asm_fprintf (stream, "\tmoveml %Rsp@+,%I0x%x\n", mask);
+ asm_fprintf (stream, "\tmoveml %Rsp@,%I0x%x\n", mask);
#endif
- }
- else
+ }
+ else
+ {
+#ifdef MOTOROLA
+ asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
+ offset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ mask);
+#else
+ asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ offset + fsize, mask);
+#endif
+ }
+ }
+ else /* !TARGET_COLDFIRE */
{
+ if (big)
+ {
#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
- offset + fsize,
- reg_names[FRAME_POINTER_REGNUM],
- mask);
+ asm_fprintf (stream, "\tmovm.l -%wd(%s,%Ra1.l),%I0x%x\n",
+ offset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ mask);
#else
- asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
- reg_names[FRAME_POINTER_REGNUM],
- offset + fsize, mask);
+ asm_fprintf (stream, "\tmoveml %s@(-%wd,%Ra1:l),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ offset + fsize, mask);
+#endif
+ }
+ else if (restore_from_sp)
+ {
+#ifdef MOTOROLA
+ asm_fprintf (stream, "\tmovm.l (%Rsp)+,%I0x%x\n", mask);
+#else
+ asm_fprintf (stream, "\tmoveml %Rsp@+,%I0x%x\n", mask);
+#endif
+ }
+ else
+ {
+#ifdef MOTOROLA
+ asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
+ offset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ mask);
+#else
+ asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ offset + fsize, mask);
#endif
+ }
}
}
if (fmask)
@@ -799,60 +935,57 @@ m68k_output_function_epilogue (stream, size)
if (frame_pointer_needed)
fprintf (stream, "\tunlk %s\n",
reg_names[FRAME_POINTER_REGNUM]);
- else if (fsize)
+ else if (fsize_with_regs)
{
-#ifndef NO_ADDSUB_Q
- if (fsize + 4 <= 8)
+ if (fsize_with_regs <= 8)
{
- if (!TARGET_5200)
+ if (!TARGET_COLDFIRE)
{
#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.w %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddq.w %I%wd,%Rsp\n", fsize_with_regs);
#else
- asm_fprintf (stream, "\taddqw %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddqw %I%wd,%Rsp\n", fsize_with_regs);
#endif
}
- else
+ else /* TARGET_COLDFIRE */
{
#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.l %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddq.l %I%wd,%Rsp\n", fsize_with_regs);
#else
- asm_fprintf (stream, "\taddql %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddql %I%wd,%Rsp\n", fsize_with_regs);
#endif
}
}
- else if (fsize + 4 <= 16 && TARGET_CPU32)
+ 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. */
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
asm_fprintf (stream, "\taddq.w %I8,%Rsp\n\taddq.w %I%wd,%Rsp\n",
- fsize + 4 - 8);
+ fsize_with_regs - 8);
#else
asm_fprintf (stream, "\taddqw %I8,%Rsp\n\taddqw %I%wd,%Rsp\n",
- fsize + 4 - 8);
+ fsize_with_regs - 8);
#endif
}
- else
-#endif /* not NO_ADDSUB_Q */
- if (fsize + 4 < 0x8000)
+ else if (fsize_with_regs < 0x8000)
{
if (TARGET_68040)
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", fsize_with_regs);
#else
- asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", fsize_with_regs);
#endif
}
else
{
#ifdef MOTOROLA
- asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", fsize_with_regs);
#else
- asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", fsize_with_regs);
#endif
}
}
@@ -860,9 +993,9 @@ m68k_output_function_epilogue (stream, size)
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", fsize_with_regs);
#else
- asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", fsize_with_regs);
#endif
}
}
@@ -883,14 +1016,12 @@ m68k_output_function_epilogue (stream, size)
/* Similar to general_operand, but exclude stack_pointer_rtx. */
int
-not_sp_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+not_sp_operand (rtx op, enum machine_mode mode)
{
return op != stack_pointer_rtx && nonimmediate_operand (op, mode);
}
-/* Return TRUE if X is a valid comparison operator for the dbcc
+/* Return true if X is a valid comparison operator for the dbcc
instruction.
Note it rejects floating point comparison operators.
@@ -899,9 +1030,7 @@ not_sp_operand (op, mode)
It also rejects some comparisons when CC_NO_OVERFLOW is set. */
int
-valid_dbcc_comparison_p (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+valid_dbcc_comparison_p (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (x))
{
@@ -920,7 +1049,7 @@ valid_dbcc_comparison_p (x, mode)
/* Return nonzero if flags are currently in the 68881 flag register. */
int
-flags_in_68881 ()
+flags_in_68881 (void)
{
/* We could add support for these in the future */
return cc_status.flags & CC_IN_68881;
@@ -933,8 +1062,7 @@ flags_in_68881 ()
kick those out before we get here. */
void
-output_dbcc_and_branch (operands)
- rtx *operands;
+output_dbcc_and_branch (rtx *operands)
{
switch (GET_CODE (operands[3]))
{
@@ -1043,11 +1171,7 @@ output_dbcc_and_branch (operands)
}
const char *
-output_scc_di(op, operand1, operand2, dest)
- rtx op;
- rtx operand1;
- rtx operand2;
- rtx dest;
+output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest)
{
rtx loperands[7];
enum rtx_code op_code = GET_CODE (op);
@@ -1098,7 +1222,7 @@ output_scc_di(op, operand1, operand2, dest)
}
else
{
- if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (loperands[0]))
+ if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (loperands[0]))
output_asm_insn ("tst%.l %0", loperands);
else
{
@@ -1115,7 +1239,7 @@ output_scc_di(op, operand1, operand2, dest)
output_asm_insn ("jne %l4", loperands);
#endif
- if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (loperands[1]))
+ if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (loperands[1]))
output_asm_insn ("tst%.l %1", loperands);
else
{
@@ -1230,11 +1354,7 @@ output_scc_di(op, operand1, operand2, dest)
}
const char *
-output_btst (operands, countop, dataop, insn, signpos)
- rtx *operands;
- rtx countop, dataop;
- rtx insn;
- int signpos;
+output_btst (rtx *operands, rtx countop, rtx dataop, rtx insn, int signpos)
{
operands[0] = countop;
operands[1] = dataop;
@@ -1272,19 +1392,17 @@ output_btst (operands, countop, dataop, insn, signpos)
return "btst %0,%1";
}
-/* Returns 1 if OP is either a symbol reference or a sum of a symbol
+/* Returns true if OP is either a symbol reference or a sum of a symbol
reference and a constant. */
-int
-symbolic_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+bool
+symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
case SYMBOL_REF:
case LABEL_REF:
- return 1;
+ return true;
case CONST:
op = XEXP (op, 0);
@@ -1299,16 +1417,14 @@ symbolic_operand (op, mode)
#endif
default:
- return 0;
+ return false;
}
}
/* Check for sign_extend or zero_extend. Used for bit-count operands. */
int
-extend_operator(x, mode)
- rtx x;
- enum machine_mode mode;
+extend_operator(rtx x, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE(x) != mode)
return 0;
@@ -1364,9 +1480,8 @@ extend_operator(x, mode)
handled. */
rtx
-legitimize_pic_address (orig, mode, reg)
- rtx orig, reg;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx reg)
{
rtx pic_ref = orig;
@@ -1416,13 +1531,12 @@ legitimize_pic_address (orig, mode, reg)
typedef enum { MOVL, SWAP, NEGW, NOTW, NOTB, MOVQ } CONST_METHOD;
-static CONST_METHOD const_method PARAMS ((rtx));
+static CONST_METHOD const_method (rtx);
#define USE_MOVQ(i) ((unsigned)((i) + 128) <= 255)
static CONST_METHOD
-const_method (constant)
- rtx constant;
+const_method (rtx constant)
{
int i;
unsigned u;
@@ -1433,7 +1547,7 @@ const_method (constant)
/* The Coldfire doesn't have byte or word operations. */
/* FIXME: This may not be useful for the m68060 either */
- if (!TARGET_5200)
+ if (!TARGET_COLDFIRE)
{
/* if -256 < N < 256 but N is not in range for a moveq
N^ff will be, so use moveq #N^ff, dreg; not.b dreg. */
@@ -1455,8 +1569,7 @@ const_method (constant)
}
static int
-const_int_cost (constant)
- rtx constant;
+const_int_cost (rtx constant)
{
switch (const_method (constant))
{
@@ -1477,10 +1590,7 @@ const_int_cost (constant)
}
static bool
-m68k_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+m68k_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
@@ -1514,9 +1624,10 @@ m68k_rtx_costs (x, code, outer_code, total)
for add and the time for shift, taking away a little more because
sometimes move insns are needed. */
/* div?.w is relatively cheaper on 68000 counted in COSTS_N_INSNS terms. */
-#define MULL_COST (TARGET_68060 ? 2 : TARGET_68040 ? 5 : 13)
-#define MULW_COST (TARGET_68060 ? 2 : TARGET_68040 ? 3 : TARGET_68020 ? 8 : 5)
-#define DIVW_COST (TARGET_68020 ? 27 : 12)
+#define MULL_COST (TARGET_68060 ? 2 : TARGET_68040 ? 5 : TARGET_CFV3 ? 3 : TARGET_COLDFIRE ? 10 : 13)
+#define MULW_COST (TARGET_68060 ? 2 : TARGET_68040 ? 3 : TARGET_68020 ? 8 : \
+ TARGET_CFV3 ? 2 : 5)
+#define DIVW_COST (TARGET_68020 ? 27 : TARGET_CF_HWDIV ? 11 : 12)
case PLUS:
/* An lea costs about three times as much as a simple add. */
@@ -1528,7 +1639,11 @@ m68k_rtx_costs (x, code, outer_code, total)
&& (INTVAL (XEXP (XEXP (x, 0), 1)) == 2
|| INTVAL (XEXP (XEXP (x, 0), 1)) == 4
|| INTVAL (XEXP (XEXP (x, 0), 1)) == 8))
- *total = COSTS_N_INSNS (3); /* lea an@(dx:l:i),am */
+ {
+ /* lea an@(dx:l:i),am */
+ *total = COSTS_N_INSNS (TARGET_COLDFIRE ? 2 : 3);
+ return true;
+ }
return false;
case ASHIFT:
@@ -1539,7 +1654,7 @@ m68k_rtx_costs (x, code, outer_code, total)
*total = COSTS_N_INSNS(1);
return true;
}
- if (! TARGET_68020)
+ if (! TARGET_68020 && ! TARGET_COLDFIRE)
{
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
{
@@ -1564,7 +1679,7 @@ m68k_rtx_costs (x, code, outer_code, total)
&& !(INTVAL (XEXP (x, 1)) > 0
&& INTVAL (XEXP (x, 1)) <= 8))
{
- *total = COSTS_N_INSNS (3); /* lsr #i,dn */
+ *total = COSTS_N_INSNS (TARGET_COLDFIRE ? 1 : 3); /* lsr #i,dn */
return true;
}
return false;
@@ -1586,6 +1701,8 @@ m68k_rtx_costs (x, code, outer_code, total)
case UMOD:
if (GET_MODE (x) == QImode || GET_MODE (x) == HImode)
*total = COSTS_N_INSNS (DIVW_COST); /* div.w */
+ else if (TARGET_CF_HWDIV)
+ *total = COSTS_N_INSNS (18);
else
*total = COSTS_N_INSNS (43); /* div.l */
return true;
@@ -1596,8 +1713,7 @@ m68k_rtx_costs (x, code, outer_code, total)
}
const char *
-output_move_const_into_data_reg (operands)
- rtx *operands;
+output_move_const_into_data_reg (rtx *operands)
{
int i;
@@ -1605,41 +1721,21 @@ output_move_const_into_data_reg (operands)
switch (const_method (operands[1]))
{
case MOVQ :
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0";
-#else
return "moveq %1,%0";
-#endif
case NOTB :
operands[1] = GEN_INT (i ^ 0xff);
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0\n\tnot%.b %0";
-#else
return "moveq %1,%0\n\tnot%.b %0";
-#endif
case NOTW :
operands[1] = GEN_INT (i ^ 0xffff);
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0\n\tnot%.w %0";
-#else
return "moveq %1,%0\n\tnot%.w %0";
-#endif
case NEGW :
-#if defined (MOTOROLA)
- return "moveq%.l %#-128,%0\n\tneg%.w %0";
-#else
return "moveq %#-128,%0\n\tneg%.w %0";
-#endif
case SWAP :
{
unsigned u = i;
operands[1] = GEN_INT ((u << 16) | (u >> 16));
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0\n\tswap %0";
-#else
return "moveq %1,%0\n\tswap %0";
-#endif
}
case MOVL :
return "move%.l %1,%0";
@@ -1649,15 +1745,14 @@ output_move_const_into_data_reg (operands)
}
const char *
-output_move_simode_const (operands)
- rtx *operands;
+output_move_simode_const (rtx *operands)
{
if (operands[1] == const0_rtx
&& (DATA_REG_P (operands[0])
|| GET_CODE (operands[0]) == MEM)
/* clr insns on 68000 read before writing.
This isn't so on the 68010, but we have no TARGET_68010. */
- && ((TARGET_68020 || TARGET_5200)
+ && ((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM
&& MEM_VOLATILE_P (operands[0]))))
return "clr%.l %0";
@@ -1680,8 +1775,7 @@ output_move_simode_const (operands)
}
const char *
-output_move_simode (operands)
- rtx *operands;
+output_move_simode (rtx *operands)
{
if (GET_CODE (operands[1]) == CONST_INT)
return output_move_simode_const (operands);
@@ -1697,8 +1791,7 @@ output_move_simode (operands)
}
const char *
-output_move_himode (operands)
- rtx *operands;
+output_move_himode (rtx *operands)
{
if (GET_CODE (operands[1]) == CONST_INT)
{
@@ -1707,7 +1800,7 @@ output_move_himode (operands)
|| GET_CODE (operands[0]) == MEM)
/* clr insns on 68000 read before writing.
This isn't so on the 68010, but we have no TARGET_68010. */
- && ((TARGET_68020 || TARGET_5200)
+ && ((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM
&& MEM_VOLATILE_P (operands[0]))))
return "clr%.w %0";
@@ -1718,11 +1811,7 @@ output_move_himode (operands)
&& INTVAL (operands[1]) < 128
&& INTVAL (operands[1]) >= -128)
{
-#if defined(MOTOROLA)
- return "moveq%.l %1,%0";
-#else
return "moveq %1,%0";
-#endif
}
else if (INTVAL (operands[1]) < 0x8000
&& INTVAL (operands[1]) >= -0x8000)
@@ -1730,7 +1819,6 @@ output_move_himode (operands)
}
else if (CONSTANT_P (operands[1]))
return "move%.l %1,%0";
-#ifndef SGS_NO_LI
/* Recognize the insn before a tablejump, one that refers
to a table of offsets. Such an insn will need to refer
to a label on the insn. So output one. Use the label-number
@@ -1761,13 +1849,11 @@ output_move_himode (operands)
#endif /* SGS_SWITCH_TABLES */
#endif /* SGS_SWITCH_TABLES or not MOTOROLA */
}
-#endif /* SGS_NO_LI */
return "move%.w %1,%0";
}
const char *
-output_move_qimode (operands)
- rtx *operands;
+output_move_qimode (rtx *operands)
{
rtx xoperands[4];
@@ -1779,7 +1865,7 @@ output_move_qimode (operands)
&& GET_CODE (XEXP (operands[0], 0)) == PRE_DEC
&& XEXP (XEXP (operands[0], 0), 0) == stack_pointer_rtx
&& ! ADDRESS_REG_P (operands[1])
- && ! TARGET_5200)
+ && ! TARGET_COLDFIRE)
{
xoperands[1] = operands[1];
xoperands[2]
@@ -1790,11 +1876,7 @@ output_move_qimode (operands)
if (!reg_mentioned_p (stack_pointer_rtx, operands[1]))
{
xoperands[3] = stack_pointer_rtx;
-#ifndef NO_ADDSUB_Q
output_asm_insn ("subq%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
-#else
- output_asm_insn ("sub%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
-#endif
}
else
output_asm_insn ("move%.b %1,%-\n\tmove%.b %@,%2", xoperands);
@@ -1804,12 +1886,12 @@ output_move_qimode (operands)
/* clr and st insns on 68000 read before writing.
This isn't so on the 68010, but we have no TARGET_68010. */
if (!ADDRESS_REG_P (operands[0])
- && ((TARGET_68020 || TARGET_5200)
+ && ((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
{
if (operands[1] == const0_rtx)
return "clr%.b %0";
- if ((!TARGET_5200 || DATA_REG_P (operands[0]))
+ if ((!TARGET_COLDFIRE || DATA_REG_P (operands[0]))
&& GET_CODE (operands[1]) == CONST_INT
&& (INTVAL (operands[1]) & 255) == 255)
{
@@ -1822,11 +1904,7 @@ output_move_qimode (operands)
&& INTVAL (operands[1]) < 128
&& INTVAL (operands[1]) >= -128)
{
-#if defined(MOTOROLA)
- return "moveq%.l %1,%0";
-#else
return "moveq %1,%0";
-#endif
}
if (operands[1] == const0_rtx && ADDRESS_REG_P (operands[0]))
return "sub%.l %0,%0";
@@ -1840,26 +1918,24 @@ output_move_qimode (operands)
}
const char *
-output_move_stricthi (operands)
- rtx *operands;
+output_move_stricthi (rtx *operands)
{
if (operands[1] == const0_rtx
/* clr insns on 68000 read before writing.
This isn't so on the 68010, but we have no TARGET_68010. */
- && ((TARGET_68020 || TARGET_5200)
+ && ((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
return "clr%.w %0";
return "move%.w %1,%0";
}
const char *
-output_move_strictqi (operands)
- rtx *operands;
+output_move_strictqi (rtx *operands)
{
if (operands[1] == const0_rtx
/* clr insns on 68000 read before writing.
This isn't so on the 68010, but we have no TARGET_68010. */
- && ((TARGET_68020 || TARGET_5200)
+ && ((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
return "clr%.b %0";
return "move%.b %1,%0";
@@ -1869,8 +1945,7 @@ output_move_strictqi (operands)
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)
return output_move_simode_const (operands);
@@ -1882,8 +1957,7 @@ singlemove_string (operands)
with operands OPERANDS. */
const char *
-output_move_double (operands)
- rtx *operands;
+output_move_double (rtx *operands)
{
enum
{
@@ -2236,8 +2310,7 @@ compadr:
ADDR can be effectively incremented by incrementing REG. */
static rtx
-find_addr_reg (addr)
- rtx addr;
+find_addr_reg (rtx addr)
{
while (GET_CODE (addr) == PLUS)
{
@@ -2260,8 +2333,7 @@ find_addr_reg (addr)
/* Output assembler code to perform a 32 bit 3 operand add. */
const char *
-output_addsi3 (operands)
- rtx *operands;
+output_addsi3 (rtx *operands)
{
if (! operands_match_p (operands[0], operands[1]))
{
@@ -2283,8 +2355,7 @@ output_addsi3 (operands)
return "lea 0(%1,%2.l),%0";
else
return "lea %c2(%1),%0";
-#else /* not SGS */
-#ifdef MOTOROLA
+#elif defined(MOTOROLA)
if (GET_CODE (operands[2]) == REG)
return "lea (%1,%2.l),%0";
else
@@ -2295,11 +2366,9 @@ output_addsi3 (operands)
else
return "lea %1@(%c2),%0";
#endif /* not MOTOROLA */
-#endif /* not SGS */
}
if (GET_CODE (operands[2]) == CONST_INT)
{
-#ifndef NO_ADDSUB_Q
if (INTVAL (operands[2]) > 0
&& INTVAL (operands[2]) <= 8)
return "addq%.l %2,%0";
@@ -2327,7 +2396,6 @@ output_addsi3 (operands)
return "subq%.l %#8,%0\n\tsubq%.l %2,%0";
}
}
-#endif
if (ADDRESS_REG_P (operands[0])
&& INTVAL (operands[2]) >= -0x8000
&& INTVAL (operands[2]) < 0x8000)
@@ -2355,9 +2423,7 @@ output_addsi3 (operands)
some or all of the saved cc's so they won't be used. */
void
-notice_update_cc (exp, insn)
- rtx exp;
- rtx insn;
+notice_update_cc (rtx exp, rtx insn)
{
if (GET_CODE (exp) == SET)
{
@@ -2452,8 +2518,7 @@ notice_update_cc (exp, insn)
}
const char *
-output_move_const_double (operands)
- rtx *operands;
+output_move_const_double (rtx *operands)
{
int code = standard_68881_constant_p (operands[1]);
@@ -2468,8 +2533,7 @@ output_move_const_double (operands)
}
const char *
-output_move_const_single (operands)
- rtx *operands;
+output_move_const_single (rtx *operands)
{
int code = standard_68881_constant_p (operands[1]);
@@ -2518,7 +2582,7 @@ REAL_VALUE_TYPE values_68881[7];
strings_68881 to binary. */
void
-init_68881_table ()
+init_68881_table (void)
{
int i;
REAL_VALUE_TYPE r;
@@ -2536,16 +2600,11 @@ init_68881_table ()
}
int
-standard_68881_constant_p (x)
- rtx x;
+standard_68881_constant_p (rtx x)
{
REAL_VALUE_TYPE r;
int i;
-#ifdef NO_ASM_FMOVECR
- return 0;
-#endif
-
/* fmovecr must be emulated on the 68040 and 68060, so it shouldn't be
used at all on those chips. */
if (TARGET_68040 || TARGET_68060)
@@ -2579,8 +2638,7 @@ standard_68881_constant_p (x)
or 0 if X is not a power of 2. */
int
-floating_exact_log2 (x)
- rtx x;
+floating_exact_log2 (rtx x)
{
REAL_VALUE_TYPE r, r1;
int exp;
@@ -2645,10 +2703,7 @@ floating_exact_log2 (x)
*/
void
-print_operand (file, op, letter)
- FILE *file; /* file to write to */
- rtx op; /* operand to print */
- int letter; /* %<letter> or 0 */
+print_operand (FILE *file, rtx op, int letter)
{
if (letter == '.')
{
@@ -2817,9 +2872,7 @@ print_operand (file, op, letter)
#endif /* ASM_OUTPUT_CASE_FETCH */
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
register rtx reg1, reg2, breg, ireg;
rtx offset;
@@ -3125,11 +3178,9 @@ print_operand_address (file, addr)
insn we are checking for redundancy. TARGET is the register set by the
clear insn. */
-int
-strict_low_part_peephole_ok (mode, first_insn, target)
- enum machine_mode mode;
- rtx first_insn;
- rtx target;
+bool
+strict_low_part_peephole_ok (enum machine_mode mode, rtx first_insn,
+ rtx target)
{
rtx p;
@@ -3139,7 +3190,7 @@ strict_low_part_peephole_ok (mode, first_insn, target)
{
/* If it isn't an insn, then give up. */
if (GET_CODE (p) != INSN)
- return 0;
+ return false;
if (reg_set_p (target, p))
{
@@ -3148,7 +3199,7 @@ strict_low_part_peephole_ok (mode, first_insn, target)
/* If it isn't an easy to recognize insn, then give up. */
if (! set)
- return 0;
+ return false;
dest = SET_DEST (set);
@@ -3156,7 +3207,7 @@ strict_low_part_peephole_ok (mode, first_insn, target)
first_insn is redundant. */
if (rtx_equal_p (dest, target)
&& SET_SRC (set) == const0_rtx)
- return 1;
+ return true;
else if (GET_CODE (dest) == STRICT_LOW_PART
&& GET_CODE (XEXP (dest, 0)) == REG
&& REGNO (XEXP (dest, 0)) == REGNO (target)
@@ -3166,14 +3217,14 @@ strict_low_part_peephole_ok (mode, first_insn, target)
we are using, so it is safe. */
;
else
- return 0;
+ return false;
}
p = prev_nonnote_insn (p);
}
- return 0;
+ return false;
}
/* Accept integer operands in the range 0..0xffffffff. We have to check the
@@ -3181,9 +3232,7 @@ strict_low_part_peephole_ok (mode, first_insn, target)
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;
+const_uint32_operand (rtx op, enum machine_mode mode)
{
/* It doesn't make sense to ask this question with a mode that is
not larger than 32 bits. */
@@ -3205,9 +3254,7 @@ const_uint32_operand (op, mode)
contexts. */
int
-const_sint32_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+const_sint32_operand (rtx op, enum machine_mode mode)
{
/* It doesn't make sense to ask this question with a mode that is
not larger than 32 bits. */
@@ -3281,9 +3328,7 @@ const_sint32_operand (op, mode)
is specified. */
int
-general_src_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+general_src_operand (rtx op, enum machine_mode mode)
{
if (TARGET_PCREL
&& GET_CODE (op) == MEM
@@ -3299,9 +3344,7 @@ general_src_operand (op, mode)
is specified. */
int
-nonimmediate_src_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+nonimmediate_src_operand (rtx op, enum machine_mode mode)
{
if (TARGET_PCREL && GET_CODE (op) == MEM
&& (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
@@ -3316,9 +3359,7 @@ nonimmediate_src_operand (op, mode)
is specified. */
int
-memory_src_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+memory_src_operand (rtx op, enum machine_mode mode)
{
if (TARGET_PCREL && GET_CODE (op) == MEM
&& (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
@@ -3333,24 +3374,21 @@ memory_src_operand (op, mode)
"general_src_operand". */
int
-pcrel_address (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+pcrel_address (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF
|| GET_CODE (op) == CONST);
}
const char *
-output_andsi3 (operands)
- rtx *operands;
+output_andsi3 (rtx *operands)
{
int logval;
if (GET_CODE (operands[2]) == CONST_INT
&& (INTVAL (operands[2]) | 0xffff) == 0xffffffff
&& (DATA_REG_P (operands[0])
|| offsettable_memref_p (operands[0]))
- && !TARGET_5200)
+ && !TARGET_COLDFIRE)
{
if (GET_CODE (operands[0]) != REG)
operands[0] = adjust_address (operands[0], HImode, 2);
@@ -3383,15 +3421,14 @@ output_andsi3 (operands)
}
const char *
-output_iorsi3 (operands)
- rtx *operands;
+output_iorsi3 (rtx *operands)
{
register int logval;
if (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) >> 16 == 0
&& (DATA_REG_P (operands[0])
|| offsettable_memref_p (operands[0]))
- && !TARGET_5200)
+ && !TARGET_COLDFIRE)
{
if (GET_CODE (operands[0]) != REG)
operands[0] = adjust_address (operands[0], HImode, 2);
@@ -3420,14 +3457,13 @@ output_iorsi3 (operands)
}
const char *
-output_xorsi3 (operands)
- rtx *operands;
+output_xorsi3 (rtx *operands)
{
register int logval;
if (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) >> 16 == 0
&& (offsettable_memref_p (operands[0]) || DATA_REG_P (operands[0]))
- && !TARGET_5200)
+ && !TARGET_COLDFIRE)
{
if (! DATA_REG_P (operands[0]))
operands[0] = adjust_address (operands[0], HImode, 2);
@@ -3455,12 +3491,12 @@ output_xorsi3 (operands)
return "eor%.l %2,%0";
}
+#ifdef M68K_TARGET_COFF
+
/* Output assembly to switch to section NAME with attribute FLAGS. */
static void
-m68k_coff_asm_named_section (name, flags)
- const char *name;
- unsigned int flags;
+m68k_coff_asm_named_section (const char *name, unsigned int flags)
{
char flagchar;
@@ -3472,28 +3508,12 @@ m68k_coff_asm_named_section (name, flags)
fprintf (asm_out_file, "\t.section\t%s,\"%c\"\n", name, flagchar);
}
-#ifdef CTOR_LIST_BEGIN
-static void
-m68k_svr3_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
-{
- rtx xop[2];
-
- xop[1] = symbol;
- xop[0] = gen_rtx_MEM (SImode, gen_rtx_PRE_DEC (SImode, stack_pointer_rtx));
-
- init_section ();
- output_asm_insn (output_move_simode (xop), xop);
-}
-#endif
+#endif /* M68K_TARGET_COFF */
#ifdef HPUX_ASM
static void
-m68k_hp320_internal_label (stream, prefix, labelno)
- FILE *stream;
- const char *prefix;
- unsigned long labelno;
+m68k_hp320_internal_label (FILE *stream, const char *prefix,
+ unsigned long labelno)
{
if (prefix[0] == 'L' && prefix[1] == 'I')
fprintf(stream, "\tset %s%ld,.+2\n", prefix, labelno);
@@ -3502,7 +3522,7 @@ m68k_hp320_internal_label (stream, prefix, labelno)
}
static void
-m68k_hp320_file_start ()
+m68k_hp320_file_start (void)
{
/* version 1: 68010.
2: 68020 without FPU.
@@ -3513,12 +3533,10 @@ m68k_hp320_file_start ()
#endif
static void
-m68k_output_mi_thunk (file, thunk, delta, vcall_offset, function)
- FILE *file;
- tree thunk ATTRIBUTE_UNUSED;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED;
- tree function;
+m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta,
+ HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
+ tree function)
{
rtx xops[1];
const char *fmt;
@@ -3573,11 +3591,7 @@ m68k_output_mi_thunk (file, thunk, delta, vcall_offset, function)
else
{
#if defined (MOTOROLA) && !defined (USE_GAS)
-#ifdef MOTOROLA_BSR
- fmt = "bra %0";
-#else
fmt = "jmp %0";
-#endif
#else
fmt = "jra %0";
#endif
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 8ee78ba9aa9..977a034bb13 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -28,12 +28,66 @@ Boston, MA 02111-1307, USA. */
#define TARGET_CPU_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__mc68000__"); \
- if (TARGET_68020) \
- builtin_define ("__mc68020__"); \
- builtin_define ("__m68k__"); \
- builtin_assert ("cpu=m68k"); \
- builtin_assert ("machine=m68k"); \
+ builtin_define ("__m68k__"); \
+ builtin_define_std ("mc68000"); \
+ if (TARGET_68040_ONLY) \
+ { \
+ if (TARGET_68060) \
+ builtin_define_std ("mc68060"); \
+ else \
+ builtin_define_std ("mc68040"); \
+ } \
+ else if (TARGET_68060) /* -m68020-60 */ \
+ { \
+ builtin_define_std ("mc68060"); \
+ builtin_define_std ("mc68040"); \
+ builtin_define_std ("mc68030"); \
+ builtin_define_std ("mc68020"); \
+ } \
+ else if (TARGET_68040) /* -m68020-40 */ \
+ { \
+ builtin_define_std ("mc68040"); \
+ builtin_define_std ("mc68030"); \
+ builtin_define_std ("mc68020"); \
+ } \
+ else if (TARGET_68030) \
+ builtin_define_std ("mc68030"); \
+ else if (TARGET_68020) \
+ builtin_define_std ("mc68020"); \
+ if (TARGET_68881) \
+ builtin_define ("__HAVE_68881__"); \
+ if (TARGET_CPU32) \
+ { \
+ builtin_define_std ("mc68332"); \
+ builtin_define_std ("mcpu32"); \
+ } \
+ if (TARGET_COLDFIRE) \
+ builtin_define ("__mcoldfire__"); \
+ if (TARGET_5200) \
+ builtin_define ("__mcf5200__"); \
+ if (TARGET_528x) \
+ { \
+ builtin_define ("__mcf528x__"); \
+ builtin_define ("__mcf5200__"); \
+ } \
+ if (TARGET_CFV3) \
+ { \
+ builtin_define ("__mcf5300__"); \
+ builtin_define ("__mcf5307__"); \
+ } \
+ if (TARGET_CFV4) \
+ { \
+ builtin_define ("__mcf5400__"); \
+ builtin_define ("__mcf5407__"); \
+ } \
+ if (TARGET_CF_HWDIV) \
+ builtin_define ("__mcfhwdiv__"); \
+ if (flag_pic) \
+ builtin_define ("__pic__"); \
+ if (flag_pic > 1) \
+ builtin_define ("__PIC__"); \
+ builtin_assert ("cpu=m68k"); \
+ builtin_assert ("machine=m68k"); \
} \
while (0)
@@ -62,33 +116,13 @@ extern int target_flags;
/* Macros used in the machine description to test the flags. */
/* Compile for a 68020 (not a 68000 or 68010). */
-#define MASK_68020 1
+#define MASK_68020 (1<<0)
#define TARGET_68020 (target_flags & MASK_68020)
-/* Compile 68881 insns for floating point (not library calls). */
-#define MASK_68881 2
-#define TARGET_68881 (target_flags & MASK_68881)
-
-/* Compile using 68020 bit-field insns. */
-#define MASK_BITFIELD 4
-#define TARGET_BITFIELD (target_flags & MASK_BITFIELD)
-
-/* Compile using rtd insn calling sequence.
- This will not work unless you use prototypes at least
- for all functions that can take varying numbers of args. */
-#define MASK_RTD 8
-#define TARGET_RTD (target_flags & MASK_RTD)
-
-/* Compile passing first two args in regs 0 and 1.
- This exists only to test compiler features that will
- be needed for RISC chips. It is not usable
- and is not intended to be usable on this cpu. */
-#define MASK_REGPARM 16
-#define TARGET_REGPARM (target_flags & MASK_REGPARM)
-
-/* Compile with 16-bit `int'. */
-#define MASK_SHORT 32
-#define TARGET_SHORT (target_flags & MASK_SHORT)
+/* Compile for a 68030. This does not really make a difference in GCC,
+ it just enables the __mc68030__ predefine. */
+#define MASK_68030 (1<<1)
+#define TARGET_68030 (target_flags & MASK_68030)
/* Optimize for 68040, but still allow execution on 68020
(-m68020-40 or -m68040).
@@ -96,11 +130,11 @@ extern int target_flags;
of them must be emulated in software by the OS. When TARGET_68040 is
turned on, these instructions won't be used. This code will still
run on a 68030 and 68881/2. */
-#define MASK_68040 256
+#define MASK_68040 (1<<2)
#define TARGET_68040 (target_flags & MASK_68040)
/* Use the 68040-only fp instructions (-m68040 or -m68060). */
-#define MASK_68040_ONLY 512
+#define MASK_68040_ONLY (1<<3)
#define TARGET_68040_ONLY (target_flags & MASK_68040_ONLY)
/* Optimize for 68060, but still allow execution on 68020
@@ -109,24 +143,48 @@ extern int target_flags;
of them must be emulated in software by the OS. When TARGET_68060 is
turned on, these instructions won't be used. This code will still
run on a 68030 and 68881/2. */
-#define MASK_68060 1024
+#define MASK_68060 (1<<4)
#define TARGET_68060 (target_flags & MASK_68060)
/* Compile for mcf5200 */
-#define MASK_5200 2048
+#define MASK_5200 (1<<5)
#define TARGET_5200 (target_flags & MASK_5200)
+/* Build for ColdFire v3 */
+#define MASK_CFV3 (1<<6)
+#define TARGET_CFV3 (target_flags & MASK_CFV3)
+
+/* Build for ColdFire v4 */
+#define MASK_CFV4 (1<<7)
+#define TARGET_CFV4 (target_flags & MASK_CFV4)
+
+/* Compile for ColdFire 528x */
+#define MASK_528x (1<<8)
+#define TARGET_528x (target_flags & MASK_528x)
+
+/* Divide support for ColdFire */
+#define MASK_CF_HWDIV (1<<9)
+#define TARGET_CF_HWDIV (target_flags & MASK_CF_HWDIV)
+
+/* Compile 68881 insns for floating point (not library calls). */
+#define MASK_68881 (1<<10)
+#define TARGET_68881 (target_flags & MASK_68881)
+
+/* Compile using 68020 bit-field insns. */
+#define MASK_BITFIELD (1<<11)
+#define TARGET_BITFIELD (target_flags & MASK_BITFIELD)
+
+/* Compile with 16-bit `int'. */
+#define MASK_SHORT (1<<12)
+#define TARGET_SHORT (target_flags & MASK_SHORT)
+
/* Align ints to a word boundary. This breaks compatibility with the
published ABI's for structures containing ints, but produces faster
code on cpus with 32 bit busses (020, 030, 040, 060, CPU32+, coldfire).
It's required for coldfire cpus without a misalignment module. */
-#define MASK_ALIGN_INT 4096
+#define MASK_ALIGN_INT (1<<13)
#define TARGET_ALIGN_INT (target_flags & MASK_ALIGN_INT)
-/* Compile for a CPU32 */
- /* A 68020 without bitfields is a good heuristic for a CPU32 */
-#define TARGET_CPU32 (TARGET_68020 && !TARGET_BITFIELD)
-
/* Use PC-relative addressing modes (without using a global offset table).
The m68000 supports 16-bit PC-relative addressing.
The m68020 supports 32-bit PC-relative addressing
@@ -136,13 +194,30 @@ extern int target_flags;
treated as all containing an implicit PC-relative component, and hence
cannot be used directly as addresses for memory writes. See the comments
in m68k.c for more information. */
-#define MASK_PCREL 8192
+#define MASK_PCREL (1<<14)
#define TARGET_PCREL (target_flags & MASK_PCREL)
/* Relax strict alignment. */
-#define MASK_NO_STRICT_ALIGNMENT 16384
+#define MASK_NO_STRICT_ALIGNMENT (1<<15)
#define TARGET_STRICT_ALIGNMENT (~target_flags & MASK_NO_STRICT_ALIGNMENT)
+/* Compile using rtd insn calling sequence.
+ This will not work unless you use prototypes at least
+ for all functions that can take varying numbers of args. */
+#define MASK_RTD (1<<16)
+#define TARGET_RTD (target_flags & MASK_RTD)
+
+/* Compile for a CPU32. A 68020 without bitfields is a good
+ heuristic for a CPU32. */
+#define TARGET_CPU32 (TARGET_68020 && !TARGET_BITFIELD)
+
+/* Is the target a ColdFire? */
+#define MASK_COLDFIRE (MASK_5200|MASK_528x|MASK_CFV3|MASK_CFV4)
+#define TARGET_COLDFIRE (target_flags & MASK_COLDFIRE)
+
+/* Which bits can be set by specifying a coldfire */
+#define MASK_ALL_CF_BITS (MASK_COLDFIRE|MASK_CF_HWDIV)
+
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
each pair being { "NAME", VALUE }
@@ -150,26 +225,22 @@ extern int target_flags;
An empty string NAME is used to identify the default VALUE. */
#define TARGET_SWITCHES \
- { { "68020", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY), \
+ { { "68020", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY), \
N_("Generate code for a 68020") }, \
- { "c68020", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY), \
+ { "c68020", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY), \
N_("Generate code for a 68020") }, \
{ "68020", (MASK_68020|MASK_BITFIELD), "" }, \
{ "c68020", (MASK_68020|MASK_BITFIELD), "" }, \
- { "68000", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
+ { "68000", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \
|MASK_68020|MASK_BITFIELD|MASK_68881), \
N_("Generate code for a 68000") }, \
- { "c68000", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
+ { "c68000", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \
|MASK_68020|MASK_BITFIELD|MASK_68881), \
N_("Generate code for a 68000") }, \
{ "bitfield", MASK_BITFIELD, \
N_("Use the bit-field instructions") }, \
{ "nobitfield", - MASK_BITFIELD, \
N_("Do not use the bit-field instructions") }, \
- { "rtd", MASK_RTD, \
- N_("Use different calling convention using 'rtd'") }, \
- { "nortd", - MASK_RTD, \
- N_("Use normal calling convention") }, \
{ "short", MASK_SHORT, \
N_("Consider type `int' to be 16 bits wide") }, \
{ "noshort", - MASK_SHORT, \
@@ -177,40 +248,56 @@ extern int target_flags;
{ "68881", MASK_68881, "" }, \
{ "soft-float", - (MASK_68040_ONLY|MASK_68881), \
N_("Generate code with library calls for floating point") }, \
- { "68020-40", -(MASK_5200|MASK_68060|MASK_68040_ONLY), \
+ { "68020-40", -(MASK_ALL_CF_BITS|MASK_68060|MASK_68040_ONLY), \
N_("Generate code for a 68040, without any new instructions") }, \
{ "68020-40", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040), ""},\
- { "68020-60", -(MASK_5200|MASK_68040_ONLY), \
+ { "68020-60", -(MASK_ALL_CF_BITS|MASK_68040_ONLY), \
N_("Generate code for a 68060, without any new instructions") }, \
{ "68020-60", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040 \
|MASK_68060), "" }, \
- { "68030", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY), \
+ { "68030", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY), \
N_("Generate code for a 68030") }, \
- { "68030", (MASK_68020|MASK_BITFIELD), "" }, \
- { "68040", - (MASK_5200|MASK_68060), \
+ { "68030", (MASK_68020|MASK_68030|MASK_BITFIELD), "" }, \
+ { "68040", - (MASK_ALL_CF_BITS|MASK_68060), \
N_("Generate code for a 68040") }, \
{ "68040", (MASK_68020|MASK_68881|MASK_BITFIELD \
|MASK_68040_ONLY|MASK_68040), "" }, \
- { "68060", - (MASK_5200|MASK_68040), \
+ { "68060", - (MASK_ALL_CF_BITS|MASK_68040), \
N_("Generate code for a 68060") }, \
{ "68060", (MASK_68020|MASK_68881|MASK_BITFIELD \
|MASK_68040_ONLY|MASK_68060), "" }, \
- { "5200", - (MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
+ { "5200", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
|MASK_BITFIELD|MASK_68881), \
N_("Generate code for a 520X") }, \
{ "5200", (MASK_5200), "" }, \
+ { "5206e", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
+ |MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 5206e") }, \
+ { "5206e", (MASK_5200|MASK_CF_HWDIV), "" }, \
+ { "528x", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
+ |MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 528x") }, \
+ { "528x", (MASK_528x|MASK_CF_HWDIV), "" }, \
+ { "5307", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
+ |MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 5307") }, \
+ { "5307", (MASK_CFV3|MASK_CF_HWDIV), "" }, \
+ { "5407", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
+ |MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 5407") }, \
+ { "5407", (MASK_CFV4|MASK_CF_HWDIV), "" }, \
{ "68851", 0, \
N_("Generate code for a 68851") }, \
{ "no-68851", 0, \
N_("Do no generate code for a 68851") }, \
- { "68302", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
+ { "68302", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \
|MASK_68020|MASK_BITFIELD|MASK_68881), \
N_("Generate code for a 68302") }, \
- { "68332", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
+ { "68332", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \
|MASK_BITFIELD|MASK_68881), \
N_("Generate code for a 68332") }, \
{ "68332", MASK_68020, "" }, \
- { "cpu32", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
+ { "cpu32", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \
|MASK_BITFIELD|MASK_68881), \
N_("Generate code for a cpu32") }, \
{ "cpu32", MASK_68020, "" }, \
@@ -224,9 +311,13 @@ extern int target_flags;
N_("Do not use unaligned memory references") }, \
{ "no-strict-align", MASK_NO_STRICT_ALIGNMENT, \
N_("Use unaligned memory references") }, \
+ { "rtd", MASK_RTD, \
+ N_("Use different calling convention using 'rtd'") }, \
+ { "nortd", - MASK_RTD, \
+ N_("Use normal calling convention") }, \
SUBTARGET_SWITCHES \
{ "", TARGET_DEFAULT, "" }}
-/* TARGET_DEFAULT is defined in sun*.h and isi.h, etc. */
+/* TARGET_DEFAULT is defined in m68k-none.h, netbsd.h, etc. */
/* This macro is similar to `TARGET_SWITCHES' but defines names of
command options that have values. Its definition is an
@@ -346,7 +437,7 @@ extern int target_flags;
For the 68000, we give the data registers numbers 0-7,
the address registers numbers 010-017,
and the 68881 floating point registers numbers 020-027. */
-#define FIRST_PSEUDO_REGISTER 24
+#define FIRST_PSEUDO_REGISTER 25
/* This defines the register which is used to hold the offset table for PIC. */
#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 13 : INVALID_REGNUM)
@@ -453,8 +544,11 @@ extern int target_flags;
This is computed in `reload', in reload1.c. */
#define FRAME_POINTER_REQUIRED 0
-/* Base register for access to arguments of the function. */
-#define ARG_POINTER_REGNUM 14
+/* Base register for access to arguments of the function.
+ * This isn't a hardware register. It will be eliminated to the
+ * stack pointer or frame pointer.
+ */
+#define ARG_POINTER_REGNUM 24
/* Register in which static-chain is passed to a function. */
#define STATIC_CHAIN_REGNUM 8
@@ -688,12 +782,12 @@ enum reg_class {
this says how many the stack pointer really advances by.
On the 68000, sp@- in a byte insn really pushes a word.
On the 5200 (coldfire), sp@- in a byte insn pushes just a byte. */
-#define PUSH_ROUNDING(BYTES) (TARGET_5200 ? BYTES : ((BYTES) + 1) & ~1)
+#define PUSH_ROUNDING(BYTES) (TARGET_COLDFIRE ? BYTES : ((BYTES) + 1) & ~1)
/* We want to avoid trying to push bytes. */
#define MOVE_BY_PIECES_P(SIZE, ALIGN) \
(move_by_pieces_ninsns (SIZE, ALIGN) < MOVE_RATIO \
- && (((SIZE) >=16 && (ALIGN) >= 16) || (TARGET_5200)))
+ && (((SIZE) >=16 && (ALIGN) >= 16) || (TARGET_COLDFIRE)))
/* Offset of first parameter from the argument pointer register value. */
#define FIRST_PARM_OFFSET(FNDECL) 8
@@ -798,26 +892,17 @@ enum reg_class {
CUM is a variable of type CUMULATIVE_ARGS which gives info about
the preceding args and about the function being called.
NAMED is nonzero if this argument is a named parameter
- (otherwise it is an extra parameter matching an ellipsis). */
+ (otherwise it is an extra parameter matching an ellipsis).
-/* On the 68000 all args are pushed, except if -mregparm is specified
- then the first two words of arguments are passed in d0, d1.
- *NOTE* -mregparm does not work.
- It exists only to test register calling conventions. */
+ On the m68k all args are always pushed. */
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
-((TARGET_REGPARM && (CUM) < 8) ? gen_rtx_REG ((MODE), (CUM) / 4) : 0)
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
/* For an arg passed partly in registers and partly in memory,
this is the number of registers used.
For args passed entirely in registers or entirely in memory, zero. */
-#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
-((TARGET_REGPARM && (CUM) < 8 \
- && 8 < ((CUM) + ((MODE) == BLKmode \
- ? int_size_in_bytes (TYPE) \
- : GET_MODE_SIZE (MODE)))) \
- ? 2 - (CUM) / 4 : 0)
+#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
@@ -839,32 +924,6 @@ enum reg_class {
You should override this if you define FUNCTION_EXTRA_EPILOGUE. */
#define USE_RETURN_INSN use_return_insn ()
-/* Store in the variable DEPTH the initial difference between the
- frame pointer reg contents and the stack pointer reg contents,
- as of the start of the function body. This depends on the layout
- of the fixed parts of the stack frame and on how registers are saved.
-
- On the 68k, if we have a frame, we must add one word to its length
- to allow for the place that a6 is stored when we do have a frame pointer.
- Otherwise, we would need to compute the offset from the frame pointer
- of a local variable as a function of frame_pointer_needed, which
- is hard. */
-
-#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \
-{ int regno; \
- int offset = -4; \
- for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \
- if (regs_ever_live[regno] && ! call_used_regs[regno]) \
- offset += 12; \
- for (regno = 0; regno < 16; regno++) \
- if (regs_ever_live[regno] && ! call_used_regs[regno]) \
- offset += 4; \
- if (flag_pic && current_function_uses_pic_offset_table) \
- offset += 4; \
- (DEPTH) = (offset + ((get_frame_size () + 3) & -4) \
- + (get_frame_size () == 0 ? 0 : 4)); \
-}
-
/* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts. */
@@ -942,6 +1001,38 @@ __transfer_from_trampoline () \
asm ("rts":); \
}
+/* Definitions for register eliminations.
+
+ This is an array of structures. Each structure initializes one pair
+ of eliminable registers. The "from" register number is given first,
+ followed by "to". Eliminations of the same "from" register are listed
+ in order of preference.
+
+ There are two registers that can always be eliminated on the m68k.
+ The frame pointer and the arg pointer can be replaced by either the
+ hard frame pointer or to the stack pointer, depending upon the
+ circumstances. The hard frame pointer is not used before reload and
+ so it is not eligible for elimination. */
+
+#define ELIMINABLE_REGS \
+{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
+ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
+ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }}
+
+/* Given FROM and TO register numbers, say whether this elimination is
+ allowed. Frame pointer elimination is automatically handled.
+
+ All other eliminations are valid. */
+
+#define CAN_ELIMINATE(FROM, TO) \
+ ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1)
+
+/* 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) \
+ (OFFSET) = m68k_initial_elimination_offset(FROM, TO)
+
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT 1
@@ -1122,7 +1213,7 @@ __transfer_from_trampoline () \
/* coldfire/5200 does not allow HImode index registers. */
#define LEGITIMATE_INDEX_REG_P(X) \
((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X)) \
- || (! TARGET_5200 \
+ || (! TARGET_COLDFIRE \
&& GET_CODE (X) == SIGN_EXTEND \
&& GET_CODE (XEXP (X, 0)) == REG \
&& GET_MODE (XEXP (X, 0)) == HImode \
@@ -1133,12 +1224,12 @@ __transfer_from_trampoline () \
#define LEGITIMATE_INDEX_P(X) \
(LEGITIMATE_INDEX_REG_P (X) \
- || ((TARGET_68020 || TARGET_5200) && GET_CODE (X) == MULT \
+ || ((TARGET_68020 || TARGET_COLDFIRE) && GET_CODE (X) == MULT \
&& LEGITIMATE_INDEX_REG_P (XEXP (X, 0)) \
&& GET_CODE (XEXP (X, 1)) == CONST_INT \
&& (INTVAL (XEXP (X, 1)) == 2 \
|| INTVAL (XEXP (X, 1)) == 4 \
- || (INTVAL (XEXP (X, 1)) == 8 && !TARGET_5200))))
+ || (INTVAL (XEXP (X, 1)) == 8 && !TARGET_COLDFIRE))))
/* If pic, we accept INDEX+LABEL, which is what do_tablejump makes. */
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
@@ -1341,7 +1432,7 @@ __transfer_from_trampoline () \
#define REGISTER_NAMES \
{"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", \
"a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp", \
- "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7" }
+ "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", "argptr" }
/* How to renumber registers for dbx and gdb.
On the Sun-3, the floating point registers have numbers
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 4542d73acbc..1917717076d 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -24,7 +24,7 @@
;;- The MCF5200 "ColdFire" architecture is a reduced version of the
;;- 68k ISA. Differences include reduced support for byte and word
;;- operands and the removal of BCD, bitfield, rotate, and integer
-;;- divide instructions. The TARGET_5200 flag turns the use of the
+;;- divide instructions. The TARGET_COLDFIRE flag turns the use of the
;;- removed opcodes and addressing modes off.
;;-
@@ -199,12 +199,7 @@
""
"*
{
-#ifdef ISI_OV
- /* ISI's assembler fails to handle tstl a0. */
- if (! ADDRESS_REG_P (operands[0]))
-#else
- if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (operands[0]))
-#endif
+ if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
return \"tst%.l %0\";
/* If you think that the 68020 does not support tstl a0,
reread page B-167 of the 68020 manual more carefully. */
@@ -338,7 +333,7 @@
[(set (cc0)
(compare (match_operand:SI 0 "nonimmediate_operand" "rKT,rKs,mSr,mSa,>")
(match_operand:SI 1 "general_src_operand" "mSr,mSa,KTr,Ksr,>")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
@@ -378,7 +373,7 @@
[(set (cc0)
(compare (match_operand:SI 0 "nonimmediate_operand" "mrKs,r")
(match_operand:SI 1 "general_operand" "r,mrKs")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"*
{
if (REG_P (operands[1])
@@ -401,14 +396,14 @@
[(set (cc0)
(compare (match_operand:HI 0 "nonimmediate_src_operand" "")
(match_operand:HI 1 "general_src_operand" "")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"m68k_last_compare_had_fp_operands = 0;")
(define_insn ""
[(set (cc0)
(compare (match_operand:HI 0 "nonimmediate_src_operand" "rnmS,d,n,mS,>")
(match_operand:HI 1 "general_src_operand" "d,rnmS,mS,n,>")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
@@ -437,14 +432,14 @@
[(set (cc0)
(compare (match_operand:QI 0 "nonimmediate_src_operand" "")
(match_operand:QI 1 "general_src_operand" "")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"m68k_last_compare_had_fp_operands = 0;")
(define_insn ""
[(set (cc0)
(compare (match_operand:QI 0 "nonimmediate_src_operand" "dn,dmS,>")
(match_operand:QI 1 "general_src_operand" "dmS,nd,>")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
@@ -562,7 +557,7 @@
(const_int 1)
(minus:SI (const_int 7)
(match_operand:SI 1 "general_operand" "di"))))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"* { return output_btst (operands, operands[1], operands[0], insn, 7); }")
;; This is the same as the above pattern except for the constraints. The 'i'
@@ -573,7 +568,7 @@
(const_int 1)
(minus:SI (const_int 7)
(match_operand:SI 1 "general_operand" "d"))))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* { return output_btst (operands, operands[1], operands[0], insn, 7); }")
(define_insn ""
@@ -614,7 +609,7 @@
[(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "m")
(const_int 1)
(match_operand:SI 1 "const_int_operand" "n")))]
- "(unsigned) INTVAL (operands[1]) < 8 && !TARGET_5200"
+ "(unsigned) INTVAL (operands[1]) < 8 && !TARGET_COLDFIRE"
"*
{
operands[1] = GEN_INT (7 - INTVAL (operands[1]));
@@ -625,7 +620,7 @@
[(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "do")
(const_int 1)
(match_operand:SI 1 "const_int_operand" "n")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[0]) == MEM)
@@ -646,7 +641,7 @@
[(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "dQ")
(const_int 1)
(match_operand:SI 1 "const_int_operand" "n")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[0]) == MEM)
@@ -693,7 +688,7 @@
(const_int 0))]
;; clr insns on 68000 read before writing.
;; This isn't so on the 68010, but we have no TARGET_68010.
- "((TARGET_68020 || TARGET_5200)
+ "((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0])))"
"*
{
@@ -717,12 +712,8 @@
}
}
/* moveq is faster on the 68000. */
- if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_5200))
-#if defined(MOTOROLA)
- return \"moveq%.l %#0,%0\";
-#else
+ if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_COLDFIRE))
return \"moveq %#0,%0\";
-#endif
return \"clr%.l %0\";
}")
@@ -772,7 +763,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<")
(match_operand:SI 1 "general_src_operand" "daymSKT,n,i"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
return output_move_simode (operands);
@@ -781,7 +772,7 @@
(define_insn ""
[(set (match_operand:SI 0 "nonimmediate_operand" "=r<Q>,g")
(match_operand:SI 1 "general_operand" "g,r<Q>"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_move_simode (operands);")
;; Special case of fullword move, where we need to get a non-GOT PIC
@@ -806,13 +797,13 @@
(define_insn ""
[(set (match_operand:HI 0 "nonimmediate_operand" "=g")
(match_operand:HI 1 "general_src_operand" "gS"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"* return output_move_himode (operands);")
(define_insn ""
[(set (match_operand:HI 0 "nonimmediate_operand" "=r<Q>,g")
(match_operand:HI 1 "general_operand" "g,r<Q>"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_move_himode (operands);")
(define_expand "movstricthi"
@@ -824,13 +815,13 @@
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(match_operand:HI 1 "general_src_operand" "rmSn"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"* return output_move_stricthi (operands);")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+d,m"))
(match_operand:HI 1 "general_src_operand" "rmn,r"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_move_stricthi (operands);")
(define_expand "movqi"
@@ -842,13 +833,13 @@
(define_insn ""
[(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m")
(match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"* return output_move_qimode (operands);")
(define_insn ""
[(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>,dm,d*a")
(match_operand:QI 1 "general_src_operand" "dmi,d<Q>,di*a"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_move_qimode (operands);")
(define_expand "movstrictqi"
@@ -860,20 +851,20 @@
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(match_operand:QI 1 "general_src_operand" "dmSn"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"* return output_move_strictqi (operands);")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d,m"))
(match_operand:QI 1 "general_src_operand" "dmn,d"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_move_strictqi (operands);")
(define_expand "pushqi1"
[(set (reg:SI 15) (plus:SI (reg:SI 15) (const_int -2)))
(set (mem:QI (plus:SI (reg:SI 15) (const_int 1)))
(match_operand:QI 0 "general_operand" ""))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"")
(define_expand "movsf"
@@ -885,7 +876,7 @@
(define_insn ""
[(set (match_operand:SF 0 "nonimmediate_operand" "=rmf")
(match_operand:SF 1 "general_operand" "rmfF"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (FP_REG_P (operands[0]))
@@ -907,7 +898,7 @@
if (operands[1] == CONST0_RTX (SFmode)
/* clr insns on 68000 read before writing.
This isn't so on the 68010, but we have no TARGET_68010. */
- && ((TARGET_68020 || TARGET_5200)
+ && ((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
{
if (ADDRESS_REG_P (operands[0]))
@@ -930,13 +921,9 @@
}
}
/* moveq is faster on the 68000. */
- if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_5200))
+ if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_COLDFIRE))
{
-#if defined(MOTOROLA)
- return \"moveq%.l %#0,%0\";
-#else
return \"moveq %#0,%0\";
-#endif
}
return \"clr%.l %0\";
}
@@ -946,7 +933,7 @@
(define_insn ""
[(set (match_operand:SF 0 "nonimmediate_operand" "=r,g")
(match_operand:SF 1 "general_operand" "g,r"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return \"move%.l %1,%0\";")
(define_expand "movdf"
@@ -960,7 +947,7 @@
(match_operand:DF 1 "general_operand" "*rf,m,0,*rofE<>"))]
; [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,&rf,&rof<>")
; (match_operand:DF 1 "general_operand" "rf,m,rofF<>"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (FP_REG_P (operands[0]))
@@ -996,7 +983,7 @@
(define_insn ""
[(set (match_operand:DF 0 "nonimmediate_operand" "=r,g")
(match_operand:DF 1 "general_operand" "g,r"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_move_double (operands);")
;; ??? The XFmode patterns are schizophrenic about whether constants are
@@ -1075,7 +1062,7 @@
(define_insn ""
[(set (match_operand:XF 0 "nonimmediate_operand" "=rm,rf,&rof<>")
(match_operand:XF 1 "nonimmediate_operand" "rf,m,rof<>"))]
- "! TARGET_68881 && ! TARGET_5200"
+ "! TARGET_68881 && ! TARGET_COLDFIRE"
"*
{
if (FP_REG_P (operands[0]))
@@ -1116,7 +1103,7 @@
(define_insn ""
[(set (match_operand:XF 0 "nonimmediate_operand" "=r,g")
(match_operand:XF 1 "nonimmediate_operand" "g,r"))]
- "! TARGET_68881 && TARGET_5200"
+ "! TARGET_68881 && TARGET_COLDFIRE"
"* return output_move_double (operands);")
(define_expand "movdi"
@@ -1135,7 +1122,7 @@
; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF"))]
; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&rf,&ro<>,!&rm,!&f")
; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF,rfF"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (FP_REG_P (operands[0]))
@@ -1171,7 +1158,7 @@
(define_insn ""
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,g")
(match_operand:DI 1 "general_operand" "g,r"))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_move_double (operands);")
;; Thus goes after the move instructions
@@ -1286,7 +1273,7 @@
(define_insn "*zero_extendsidi2_cf"
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,m")
(zero_extend:DI (match_operand:SI 1 "general_operand" "rm,r")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -1310,7 +1297,7 @@
(define_insn "*zero_extendsidi2"
[(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(zero_extend:DI (match_operand:SI 1 "general_operand" "rm")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -1411,9 +1398,9 @@
{
if (GET_CODE (operands[1]) == REG
&& REGNO (operands[0]) == REGNO (operands[1]))
- return (!TARGET_5200 ? \"and%.w %#0xFF,%0\" : \"and%.l %#0xFF,%0\");
+ return (!TARGET_COLDFIRE ? \"and%.w %#0xFF,%0\" : \"and%.l %#0xFF,%0\");
if (reg_mentioned_p (operands[0], operands[1]))
- return (!TARGET_5200 ? \"move%.b %1,%0\;and%.w %#0xFF,%0\"
+ return (!TARGET_COLDFIRE ? \"move%.b %1,%0\;and%.w %#0xFF,%0\"
: \"move%.b %1,%0\;and%.l %#0xFF,%0\");
return \"clr%.w %0\;move%.b %1,%0\";
}
@@ -1503,7 +1490,7 @@
{
CC_STATUS_INIT;
operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
- if (TARGET_68020 || TARGET_5200)
+ if (TARGET_68020 || TARGET_COLDFIRE)
return \"move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0\";
else
return \"move%.b %1,%2\;ext%.w %0\;ext%.l %2\;move%.l %2,%0\;smi %0\";
@@ -1518,7 +1505,7 @@
{
CC_STATUS_INIT;
operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
- if (TARGET_68020 || TARGET_5200)
+ if (TARGET_68020 || TARGET_COLDFIRE)
return \"move%.w %1,%2\;ext%.l %2\;smi %0\;extb%.l %0\";
else
return \"move%.w %1,%2\;ext%.l %2\;smi %0\;ext%.w %0\;ext%.l %0\";
@@ -1533,7 +1520,7 @@
{
CC_STATUS_INIT;
operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
- if (TARGET_68020 || TARGET_5200)
+ if (TARGET_68020 || TARGET_COLDFIRE)
return \"move%.l %1,%2\;smi %0\;extb%.l %0\";
else
return \"move%.l %1,%2\;smi %0\;ext%.w %0\;ext%.l %0\";
@@ -1565,7 +1552,7 @@
output_asm_insn (\"add%.l %2,%3\", operands);
else
output_asm_insn (\"move%.l %2,%3\;add%.l %1,%3\", operands);
- if (TARGET_68020 || TARGET_5200)
+ if (TARGET_68020 || TARGET_COLDFIRE)
return \"smi %0\;extb%.l %0\";
else
return \"smi %0\;ext%.w %0\;ext%.l %0\";
@@ -1592,7 +1579,7 @@
(define_insn "extendqisi2"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))]
- "TARGET_68020 || TARGET_5200"
+ "TARGET_68020 || TARGET_COLDFIRE"
"extb%.l %0")
;; Conversions between float and double.
@@ -1849,7 +1836,7 @@
&& GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
output_asm_insn (\"move%.l %4,%3\", operands);
output_asm_insn (\"move%.l %1,%0\;smi %2\", operands);
- if (TARGET_68020 || TARGET_5200)
+ if (TARGET_68020 || TARGET_COLDFIRE)
output_asm_insn (\"extb%.l %2\", operands);
else
output_asm_insn (\"ext%.w %2\;ext%.l %2\", operands);
@@ -1866,7 +1853,7 @@
(const_int 32))
(match_operand:DI 2 "general_operand" "0,0,0,0")))
(clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -1961,21 +1948,11 @@
if (GET_CODE (operands[1]) == CONST_INT)
{
if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
- {
-#ifdef NO_ADDSUB_Q
- return \"add%.l %1,%R0\;addx%.l %3,%0\";
-#else
- return \"addq%.l %1,%R0\;addx%.l %3,%0\";
-#endif
- }
+ return \"addq%.l %1,%R0\;addx%.l %3,%0\";
else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
{
operands[1] = GEN_INT (-INTVAL (operands[1]));
-#ifdef NO_ADDSUB_Q
- return \"sub%.l %1,%R0\;subx%.l %3,%0\";
-#else
return \"subq%.l %1,%R0\;subx%.l %3,%0\";
-#endif
}
}
return \"add%.l %1,%R0\;addx%.l %3,%0\";
@@ -2031,11 +2008,7 @@
#else
output_asm_insn (\"jpl %l3\", operands);
#endif
-#ifndef NO_ADDSUB_Q
output_asm_insn (\"addq%.l %#1,%2\", operands);
-#else
- output_asm_insn (\"add%.l %#1,%2\", operands);
-#endif
(*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[3]));
return \"\";
@@ -2058,14 +2031,14 @@
(match_operand:SI 2 "general_src_operand" "dIKLT,rJK,a,mSrIKLT,mSrIKLs")))]
- "! TARGET_5200"
+ "! TARGET_COLDFIRE"
"* return output_addsi3 (operands);")
(define_insn "*addsi3_5200"
[(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,r")
(plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0")
(match_operand:SI 2 "general_src_operand" "d,rJK,a,mrIKLs")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"* return output_addsi3 (operands);")
(define_insn ""
@@ -2073,19 +2046,18 @@
(plus:SI (match_operand:SI 1 "general_operand" "0")
(sign_extend:SI
(match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"add%.w %2,%0")
(define_insn "addhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
(plus:HI (match_operand:HI 1 "general_operand" "%0,0")
(match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[2]) == CONST_INT)
{
-#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range,
@@ -2121,7 +2093,6 @@
return \"subq%.w %#8,%0\;subq%.w %2,%0\";
}
}
-#endif
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA
return \"lea (%c2,%0),%0\";
@@ -2142,12 +2113,11 @@
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(plus:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[1]) == CONST_INT)
{
-#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range,
@@ -2183,7 +2153,6 @@
return \"subq%.w %#8,%0\;subq%.w %1,%0\";
}
}
-#endif
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA
return \"lea (%c1,%0),%0\";
@@ -2198,12 +2167,11 @@
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(plus:HI (match_operand:HI 1 "general_src_operand" "dn,rmSn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[1]) == CONST_INT)
{
-#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range,
@@ -2239,7 +2207,6 @@
return \"subq%.w %#8,%0\;subq%.w %1,%0\";
}
}
-#endif
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA
return \"lea (%c1,%0),%0\";
@@ -2254,10 +2221,9 @@
[(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(plus:QI (match_operand:QI 1 "general_operand" "%0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
-#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[2]) == CONST_INT)
{
if (INTVAL (operands[2]) >= 128)
@@ -2272,7 +2238,6 @@
return \"subq%.b %2,%0\";
}
}
-#endif
return \"add%.b %2,%0\";
}")
@@ -2280,10 +2245,9 @@
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(plus:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
-#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[1]) == CONST_INT)
{
if (INTVAL (operands[1]) >= 128)
@@ -2298,7 +2262,6 @@
return \"subq%.b %1,%0\";
}
}
-#endif
return \"add%.b %1,%0\";
}")
@@ -2306,10 +2269,9 @@
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(plus:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
-#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[1]) == CONST_INT)
{
if (INTVAL (operands[1]) >= 128)
@@ -2324,7 +2286,6 @@
return \"subq%.b %1,%0\";
}
}
-#endif
return \"add%.b %1,%0\";
}")
@@ -2416,7 +2377,7 @@
(ashift:DI (sign_extend:DI (match_operand:HI 2 "general_operand" "rm,rm,rm,rm"))
(const_int 32))))
(clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -2491,21 +2452,11 @@
if (GET_CODE (operands[1]) == CONST_INT)
{
if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
- {
-#ifdef NO_ADDSUB_Q
- return \"sub%.l %1,%R0\;subx%.l %3,%0\";
-#else
- return \"subq%.l %1,%R0\;subx%.l %3,%0\";
-#endif
- }
+ return \"subq%.l %1,%R0\;subx%.l %3,%0\";
else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
{
operands[1] = GEN_INT (-INTVAL (operands[1]));
-#ifdef NO_ADDSUB_Q
- return \"add%.l %1,%R0\;addx%.l %3,%0\";
-#else
return \"addq%.l %1,%R0\;addx%.l %3,%0\";
-#endif
}
}
return \"sub%.l %1,%R0\;subx%.l %3,%0\";
@@ -2550,35 +2501,35 @@
(minus:SI (match_operand:SI 1 "general_operand" "0")
(sign_extend:SI
(match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"sub%.w %2,%0")
(define_insn "subhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
(minus:HI (match_operand:HI 1 "general_operand" "0,0")
(match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"sub%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(minus:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"sub%.w %1,%0")
(define_insn "subqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(minus:QI (match_operand:QI 1 "general_operand" "0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"sub%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(minus:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"sub%.b %1,%0")
(define_expand "subdf3"
@@ -2712,7 +2663,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "")
(mult:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" "")))]
- "TARGET_68020 || TARGET_5200"
+ "TARGET_68020 || TARGET_COLDFIRE"
"")
(define_insn ""
@@ -2727,7 +2678,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(mult:SI (match_operand:SI 1 "general_operand" "%0")
(match_operand:SI 2 "general_operand" "d<Q>")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"muls%.l %2,%0")
(define_insn "umulhisi3"
@@ -2773,7 +2724,7 @@
(truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
(zero_extend:DI (match_dup 2)))
(const_int 32))))])]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"")
(define_insn ""
@@ -2784,7 +2735,7 @@
(truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
(zero_extend:DI (match_dup 2)))
(const_int 32))))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"mulu%.l %2,%3:%0")
; Match immediate case. For 2.4 only match things < 2^31.
@@ -2799,7 +2750,7 @@
(truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
(match_dup 2))
(const_int 32))))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE
&& (unsigned) INTVAL (operands[2]) <= 0x7fffffff"
"mulu%.l %2,%3:%0")
@@ -2812,7 +2763,7 @@
(truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
(sign_extend:DI (match_dup 2)))
(const_int 32))))])]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"")
(define_insn ""
@@ -2823,7 +2774,7 @@
(truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
(sign_extend:DI (match_dup 2)))
(const_int 32))))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"muls%.l %2,%3:%0")
(define_insn ""
@@ -2834,7 +2785,7 @@
(truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
(match_dup 2))
(const_int 32))))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"muls%.l %2,%3:%0")
(define_expand "umulsi3_highpart"
@@ -2846,7 +2797,7 @@
(zero_extend:DI (match_operand:SI 2 "general_operand" "")))
(const_int 32))))
(clobber (match_dup 3))])]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"
{
operands[3] = gen_reg_rtx (SImode);
@@ -2871,7 +2822,7 @@
(zero_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
(const_int 32))))
(clobber (match_operand:SI 1 "register_operand" "=d"))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"mulu%.l %3,%0:%1")
(define_insn "const_umulsi3_highpart"
@@ -2882,7 +2833,7 @@
(match_operand:DI 3 "const_uint32_operand" "n"))
(const_int 32))))
(clobber (match_operand:SI 1 "register_operand" "=d"))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"mulu%.l %3,%0:%1")
(define_expand "smulsi3_highpart"
@@ -2894,7 +2845,7 @@
(sign_extend:DI (match_operand:SI 2 "general_operand" "")))
(const_int 32))))
(clobber (match_dup 3))])]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"
{
operands[3] = gen_reg_rtx (SImode);
@@ -2915,7 +2866,7 @@
(sign_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
(const_int 32))))
(clobber (match_operand:SI 1 "register_operand" "=d"))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"muls%.l %3,%0:%1")
(define_insn "const_smulsi3_highpart"
@@ -2926,7 +2877,7 @@
(match_operand:DI 3 "const_sint32_operand" "n"))
(const_int 32))))
(clobber (match_operand:SI 1 "register_operand" "=d"))]
- "TARGET_68020 && !TARGET_68060 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_68060 && !TARGET_COLDFIRE"
"muls%.l %3,%0:%1")
(define_expand "muldf3"
@@ -3026,17 +2977,10 @@
"TARGET_68881"
"*
{
-#ifdef FSGLMUL_USE_S
- if (REG_P (operands[2]) && ! DATA_REG_P (operands[2]))
- return (TARGET_68040_ONLY
- ? \"fsmul%.s %2,%0\"
- : \"fsglmul%.s %2,%0\");
-#else
if (REG_P (operands[2]) && ! DATA_REG_P (operands[2]))
return (TARGET_68040_ONLY
? \"fsmul%.x %2,%0\"
: \"fsglmul%.x %2,%0\");
-#endif
return (TARGET_68040_ONLY
? \"fsmul%.s %f2,%0\"
: \"fsglmul%.s %f2,%0\");
@@ -3134,17 +3078,10 @@
"TARGET_68881"
"*
{
-#ifdef FSGLDIV_USE_S
- if (REG_P (operands[2]) && ! DATA_REG_P (operands[2]))
- return (TARGET_68040_ONLY
- ? \"fsdiv%.s %2,%0\"
- : \"fsgldiv%.s %2,%0\");
-#else
if (REG_P (operands[2]) && ! DATA_REG_P (operands[2]))
return (TARGET_68040_ONLY
? \"fsdiv%.x %2,%0\"
: \"fsgldiv%.x %2,%0\");
-#endif
return (TARGET_68040_ONLY
? \"fsdiv%.s %f2,%0\"
: \"fsgldiv%.s %f2,%0\");
@@ -3152,13 +3089,40 @@
;; Remainder instructions.
-(define_insn "divmodsi4"
+(define_expand "divmodsi4"
+ [(parallel
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
+ (div:SI (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "general_src_operand" "")))
+ (set (match_operand:SI 3 "nonimmediate_operand" "")
+ (mod:SI (match_dup 1) (match_dup 2)))])]
+ "TARGET_68020 || TARGET_CF_HWDIV"
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
+ (div:SI (match_operand:SI 1 "general_operand" "0")
+ (match_operand:SI 2 "general_src_operand" "d<Q>U")))
+ (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
+ (mod:SI (match_dup 1) (match_dup 2)))]
+ "TARGET_CF_HWDIV"
+ "*
+{
+ if (find_reg_note (insn, REG_UNUSED, operands[3]))
+ return \"divs%.l %2,%0\";
+ else if (find_reg_note (insn, REG_UNUSED, operands[0]))
+ return \"rems%.l %2,%3:%0\";
+ else
+ return \"rems%.l %2,%3:%0\;divs%.l %2,%0\";
+}")
+
+(define_insn ""
[(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(div:SI (match_operand:SI 1 "general_operand" "0")
(match_operand:SI 2 "general_src_operand" "dmSTK")))
(set (match_operand:SI 3 "nonimmediate_operand" "=d")
(mod:SI (match_dup 1) (match_dup 2)))]
- "TARGET_68020 && !TARGET_5200"
+ "TARGET_68020"
"*
{
if (find_reg_note (insn, REG_UNUSED, operands[3]))
@@ -3167,13 +3131,40 @@
return \"divsl%.l %2,%3:%0\";
}")
-(define_insn "udivmodsi4"
+(define_expand "udivmodsi4"
+ [(parallel
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
+ (udiv:SI (match_operand:SI 1 "general_operand" "0")
+ (match_operand:SI 2 "general_src_operand" "dmSTK")))
+ (set (match_operand:SI 3 "nonimmediate_operand" "=d")
+ (umod:SI (match_dup 1) (match_dup 2)))])]
+ "TARGET_68020 || TARGET_CF_HWDIV"
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
+ (udiv:SI (match_operand:SI 1 "general_operand" "0")
+ (match_operand:SI 2 "general_src_operand" "d<Q>U")))
+ (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
+ (umod:SI (match_dup 1) (match_dup 2)))]
+ "TARGET_CF_HWDIV"
+ "*
+{
+ if (find_reg_note (insn, REG_UNUSED, operands[3]))
+ return \"divu%.l %2,%0\";
+ else if (find_reg_note (insn, REG_UNUSED, operands[0]))
+ return \"remu%.l %2,%3:%0\";
+ else
+ return \"remu%.l %2,%3:%0\;divu%.l %2,%0\";
+}")
+
+(define_insn ""
[(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(udiv:SI (match_operand:SI 1 "general_operand" "0")
(match_operand:SI 2 "general_src_operand" "dmSTK")))
(set (match_operand:SI 3 "nonimmediate_operand" "=d")
(umod:SI (match_dup 1) (match_dup 2)))]
- "TARGET_68020 && !TARGET_5200"
+ "TARGET_68020 && !TARGET_COLDFIRE"
"*
{
if (find_reg_note (insn, REG_UNUSED, operands[3]))
@@ -3188,7 +3179,7 @@
(match_operand:HI 2 "general_src_operand" "dmSKT")))
(set (match_operand:HI 3 "nonimmediate_operand" "=d")
(mod:HI (match_dup 1) (match_dup 2)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
"*
{
#ifdef MOTOROLA
@@ -3211,7 +3202,7 @@
(match_operand:HI 2 "general_src_operand" "dmSKT")))
(set (match_operand:HI 3 "nonimmediate_operand" "=d")
(umod:HI (match_dup 1) (match_dup 2)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
"*
{
#ifdef MOTOROLA
@@ -3235,7 +3226,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
(and:DI (match_operand:DI 1 "general_operand" "%0,0")
(match_operand:DI 2 "general_operand" "dn,don")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -3312,7 +3303,7 @@
[(set (match_operand:SI 0 "not_sp_operand" "=m,d")
(and:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_src_operand" "dKT,dmSM")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
return output_andsi3 (operands);
@@ -3322,49 +3313,49 @@
[(set (match_operand:SI 0 "not_sp_operand" "=m,d")
(and:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_src_operand" "d,dmsK")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"and%.l %2,%0")
(define_insn "andhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
(and:HI (match_operand:HI 1 "general_operand" "%0,0")
(match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"and%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(and:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"and%.w %1,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(and:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"and%.w %1,%0")
(define_insn "andqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(and:QI (match_operand:QI 1 "general_operand" "%0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"and%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(and:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"and%.b %1,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(and:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"and%.b %1,%0")
;; inclusive-or instructions
@@ -3373,7 +3364,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
(ior:DI (zero_extend:DI (match_operand 1 "general_operand" "dn,dmn"))
(match_operand:DI 2 "general_operand" "0,0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
int byte_mode;
@@ -3400,7 +3391,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
(ior:DI (match_operand:DI 1 "general_operand" "%0,0")
(match_operand:DI 2 "general_operand" "dn,don")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -3477,7 +3468,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
(ior:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_src_operand" "dKT,dmSMT")))]
- "! TARGET_5200"
+ "! TARGET_COLDFIRE"
"*
{
return output_iorsi3 (operands);
@@ -3487,49 +3478,49 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
(ior:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_src_operand" "d,dmsK")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"or%.l %2,%0")
(define_insn "iorhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
(ior:HI (match_operand:HI 1 "general_operand" "%0,0")
(match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"or%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(ior:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"or%.w %1,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(ior:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"or%.w %1,%0")
(define_insn "iorqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(ior:QI (match_operand:QI 1 "general_operand" "%0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"or%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(ior:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"or%.b %1,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(ior:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"or%.b %1,%0")
;; On all 68k models, this makes faster code in a special case.
@@ -3556,7 +3547,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=o,d")
(ior:SI (zero_extend:SI (match_operand 1 "general_operand" "dn,dmn"))
(match_operand:SI 2 "general_operand" "0,0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
int byte_mode;
@@ -3579,7 +3570,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=od")
(xor:DI (match_operand:DI 1 "general_operand" "%0")
(match_operand:DI 2 "general_operand" "dn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -3660,7 +3651,7 @@
(xor:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_operand" "di,dKT")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
return output_xorsi3 (operands);
@@ -3670,49 +3661,49 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=dm,d")
(xor:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_operand" "d,Ks")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"eor%.l %2,%0")
(define_insn "xorhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(xor:HI (match_operand:HI 1 "general_operand" "%0")
(match_operand:HI 2 "general_operand" "dn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"eor%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(xor:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"eor%.w %1,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(xor:HI (match_operand:HI 1 "general_operand" "dn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"eor%.w %1,%0")
(define_insn "xorqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(xor:QI (match_operand:QI 1 "general_operand" "%0")
(match_operand:QI 2 "general_operand" "dn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"eor%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(xor:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "dn")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"eor%.b %1,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(xor:QI (match_operand:QI 1 "general_operand" "dn")
(match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"eor%.b %1,%0")
;; negation instructions
@@ -3723,7 +3714,7 @@
""
"
{
- if (TARGET_5200)
+ if (TARGET_COLDFIRE)
emit_insn (gen_negdi2_5200 (operands[0], operands[1]));
else
emit_insn (gen_negdi2_internal (operands[0], operands[1]));
@@ -3733,7 +3724,7 @@
(define_insn "negdi2_internal"
[(set (match_operand:DI 0 "nonimmediate_operand" "=<,do,!*a")
(neg:DI (match_operand:DI 1 "general_operand" "0,0,0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (which_alternative == 0)
@@ -3751,7 +3742,7 @@
(define_insn "negdi2_5200"
[(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(neg:DI (match_operand:DI 1 "general_operand" "0")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"*
{
operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
@@ -3764,7 +3755,7 @@
""
"
{
- if (TARGET_5200)
+ if (TARGET_COLDFIRE)
emit_insn (gen_negsi2_5200 (operands[0], operands[1]));
else
emit_insn (gen_negsi2_internal (operands[0], operands[1]));
@@ -3774,37 +3765,37 @@
(define_insn "negsi2_internal"
[(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(neg:SI (match_operand:SI 1 "general_operand" "0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"neg%.l %0")
(define_insn "negsi2_5200"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(neg:SI (match_operand:SI 1 "general_operand" "0")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"neg%.l %0")
(define_insn "neghi2"
[(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(neg:HI (match_operand:HI 1 "general_operand" "0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"neg%.w %0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(neg:HI (match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"neg%.w %0")
(define_insn "negqi2"
[(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(neg:QI (match_operand:QI 1 "general_operand" "0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"neg%.b %0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(neg:QI (match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"neg%.b %0")
;; If using software floating point, just flip the sign bit.
@@ -4020,7 +4011,7 @@
(define_insn "one_cmpldi2"
[(set (match_operand:DI 0 "nonimmediate_operand" "=dm")
(not:DI (match_operand:DI 1 "general_operand" "0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -4040,7 +4031,7 @@
""
"
{
- if (TARGET_5200)
+ if (TARGET_COLDFIRE)
emit_insn (gen_one_cmplsi2_5200 (operands[0], operands[1]));
else
emit_insn (gen_one_cmplsi2_internal (operands[0], operands[1]));
@@ -4050,37 +4041,37 @@
(define_insn "one_cmplsi2_internal"
[(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(not:SI (match_operand:SI 1 "general_operand" "0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"not%.l %0")
(define_insn "one_cmplsi2_5200"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(not:SI (match_operand:SI 1 "general_operand" "0")))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"not%.l %0")
(define_insn "one_cmplhi2"
[(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(not:HI (match_operand:HI 1 "general_operand" "0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"not%.w %0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(not:HI (match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"not%.w %0")
(define_insn "one_cmplqi2"
[(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(not:QI (match_operand:QI 1 "general_operand" "0")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"not%.b %0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(not:QI (match_dup 0)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"not%.b %0")
;; arithmetic shift instructions
@@ -4164,7 +4155,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(ashift:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
- "(!TARGET_5200
+ "(!TARGET_COLDFIRE
&& ((INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3)
|| INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
|| (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63)))"
@@ -4196,7 +4187,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(ashift:DI (match_operand:DI 1 "general_operand" "")
(match_operand 2 "const_int_operand" "")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"
{
/* ??? This is a named pattern like this is not allowed to FAIL based
@@ -4230,7 +4221,7 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(ashift:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "const_int_operand" "n")))]
- "(! TARGET_68020 && !TARGET_5200
+ "(! TARGET_68020 && !TARGET_COLDFIRE
&& INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24)"
"*
{
@@ -4259,28 +4250,28 @@
[(set (match_operand:HI 0 "register_operand" "=d")
(ashift:HI (match_operand:HI 1 "register_operand" "0")
(match_operand:HI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsl%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
(ashift:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsl%.w %1,%0")
(define_insn "ashlqi3"
[(set (match_operand:QI 0 "register_operand" "=d")
(ashift:QI (match_operand:QI 1 "register_operand" "0")
(match_operand:QI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsl%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
(ashift:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsl%.b %1,%0")
;; On most 68k models, this makes faster code in a special case.
@@ -4298,7 +4289,7 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "const_int_operand" "n")))]
- "(! TARGET_68020 && !TARGET_5200
+ "(! TARGET_68020 && !TARGET_COLDFIRE
&& INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24)"
"*
{
@@ -4367,7 +4358,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(ashiftrt:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
- "(!TARGET_5200
+ "(!TARGET_COLDFIRE
&& ((INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3)
|| INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
|| INTVAL (operands[2]) == 31
@@ -4407,7 +4398,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(ashiftrt:DI (match_operand:DI 1 "general_operand" "")
(match_operand 2 "const_int_operand" "")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"
{
/* ??? This is a named pattern like this is not allowed to FAIL based
@@ -4442,28 +4433,28 @@
[(set (match_operand:HI 0 "register_operand" "=d")
(ashiftrt:HI (match_operand:HI 1 "register_operand" "0")
(match_operand:HI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"asr%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
(ashiftrt:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"asr%.w %1,%0")
(define_insn "ashrqi3"
[(set (match_operand:QI 0 "register_operand" "=d")
(ashiftrt:QI (match_operand:QI 1 "register_operand" "0")
(match_operand:QI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"asr%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
(ashiftrt:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"asr%.b %1,%0")
;; logical shift instructions
@@ -4540,7 +4531,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
- "(!TARGET_5200
+ "(!TARGET_COLDFIRE
&& ((INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3)
|| INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
|| (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63)))"
@@ -4575,7 +4566,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "")
(match_operand 2 "const_int_operand" "")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"
{
/* ??? This is a named pattern like this is not allowed to FAIL based
@@ -4618,7 +4609,7 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "const_int_operand" "n")))]
- "(! TARGET_68020 && !TARGET_5200
+ "(! TARGET_68020 && !TARGET_COLDFIRE
&& INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24)"
"*
{
@@ -4638,28 +4629,28 @@
[(set (match_operand:HI 0 "register_operand" "=d")
(lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
(match_operand:HI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsr%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
(lshiftrt:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsr%.w %1,%0")
(define_insn "lshrqi3"
[(set (match_operand:QI 0 "register_operand" "=d")
(lshiftrt:QI (match_operand:QI 1 "register_operand" "0")
(match_operand:QI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsr%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
(lshiftrt:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"lsr%.b %1,%0")
;; rotate instructions
@@ -4668,7 +4659,7 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(rotate:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "general_operand" "dINO")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 16)
@@ -4686,7 +4677,7 @@
[(set (match_operand:HI 0 "register_operand" "=d")
(rotate:HI (match_operand:HI 1 "register_operand" "0")
(match_operand:HI 2 "general_operand" "dIP")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
@@ -4702,7 +4693,7 @@
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
(rotate:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dIP")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
@@ -4718,7 +4709,7 @@
[(set (match_operand:QI 0 "register_operand" "=d")
(rotate:QI (match_operand:QI 1 "register_operand" "0")
(match_operand:QI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
@@ -4734,7 +4725,7 @@
[(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
(rotate:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
@@ -4750,35 +4741,35 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(rotatert:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"ror%.l %2,%0")
(define_insn "rotrhi3"
[(set (match_operand:HI 0 "register_operand" "=d")
(rotatert:HI (match_operand:HI 1 "register_operand" "0")
(match_operand:HI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"ror%.w %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
(rotatert:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"ror%.w %1,%0")
(define_insn "rotrqi3"
[(set (match_operand:QI 0 "register_operand" "=d")
(rotatert:QI (match_operand:QI 1 "register_operand" "0")
(match_operand:QI 2 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"ror%.b %2,%0")
(define_insn ""
[(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
(rotatert:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "dI")))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"ror%.b %1,%0")
@@ -5242,7 +5233,7 @@
[(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
- "! TARGET_5200"
+ "! TARGET_COLDFIRE"
"*
{
return output_scc_di (operands[1], operands[2], const0_rtx, operands[0]);
@@ -5252,7 +5243,7 @@
[(set (match_operand:QI 0 "nonimmediate_operand" "=d")
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"*
{
return output_scc_di (operands[1], operands[2], const0_rtx, operands[0]);
@@ -5263,7 +5254,7 @@
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro,r")
(match_operand:DI 3 "general_operand" "r,ro")]))]
- "! TARGET_5200"
+ "! TARGET_COLDFIRE"
"*
{
return output_scc_di (operands[1], operands[2], operands[3], operands[0]);
@@ -5274,7 +5265,7 @@
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro,r")
(match_operand:DI 3 "general_operand" "r,ro")]))]
- "TARGET_5200"
+ "TARGET_COLDFIRE"
"*
{
return output_scc_di (operands[1], operands[2], operands[3], operands[0]);
@@ -5721,7 +5712,7 @@
#endif
}
operands[4] = gen_label_rtx();
- if (TARGET_68020 || TARGET_5200)
+ if (TARGET_68020 || TARGET_COLDFIRE)
{
#ifdef MOTOROLA
output_asm_insn (\"tst%.l %0\;jbne %l4\;tst%.l %3\;jbeq %l1\", operands);
@@ -5800,7 +5791,7 @@
return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\";
#endif
}
- if (TARGET_68020 || TARGET_5200)
+ if (TARGET_68020 || TARGET_COLDFIRE)
{
#ifdef MOTOROLA
return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\";
@@ -5855,7 +5846,7 @@
}
}
CC_STATUS_INIT;
- if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (operands[0]))
+ if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
output_asm_insn(\"tst%.l %0\", operands);
else
{
@@ -5907,7 +5898,7 @@
}
}
CC_STATUS_INIT;
- if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (operands[0]))
+ if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
output_asm_insn(\"tst%.l %0\", operands);
else
{
@@ -6526,7 +6517,7 @@
#else
#ifdef SGS
#ifdef ASM_OUTPUT_CASE_LABEL
- if (TARGET_5200)
+ if (TARGET_COLDFIRE)
{
if (ADDRESS_REG_P (operands[0]))
return \"jmp 6(%%pc,%0.l)\";
@@ -6536,7 +6527,7 @@
else
return \"jmp 6(%%pc,%0.w)\";
#else
- if (TARGET_5200)
+ if (TARGET_COLDFIRE)
{
if (ADDRESS_REG_P (operands[0]))
return \"jmp 2(%%pc,%0.l)\";
@@ -6547,7 +6538,7 @@
return \"jmp 2(%%pc,%0.w)\";
#endif
#else /* not SGS */
- if (TARGET_5200)
+ if (TARGET_COLDFIRE)
{
if (ADDRESS_REG_P (operands[0]))
{
@@ -6589,7 +6580,7 @@
(set (match_dup 0)
(plus:HI (match_dup 0)
(const_int -1)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
@@ -6598,22 +6589,14 @@
if (GET_CODE (operands[0]) == MEM)
{
#ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
- return \"sub%.w %#1,%0\;jbcc %l1\";
-#else
return \"subq%.w %#1,%0\;jbcc %l1\";
-#endif
#else /* not MOTOROLA */
return \"subqw %#1,%0\;jcc %l1\";
#endif
}
#ifdef MOTOROLA
#ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
- return \"sub%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
-#else
return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
-#endif
#else /* not SGS_CMP_ORDER */
return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\";
#endif
@@ -6632,28 +6615,17 @@
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int -1)))]
- "!TARGET_5200"
+ "!TARGET_COLDFIRE"
"*
{
CC_STATUS_INIT;
#ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\;clr%.w %0\;sub%.l %#1,%0\;jbcc %l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"sub%.l %#1,%0\;jbcc %l1\";
-#else
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\";
-#endif /* NO_ADDSUB_Q */
#ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
- return \"sub.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#else
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#endif
#else /* not SGS_CMP_ORDER */
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */
@@ -6679,28 +6651,17 @@
(set (match_dup 0)
(plus:HI (match_dup 0)
(const_int -1)))]
- "!TARGET_5200 && find_reg_note (insn, REG_NONNEG, 0)"
+ "!TARGET_COLDFIRE && find_reg_note (insn, REG_NONNEG, 0)"
"*
{
CC_STATUS_INIT;
#ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"sub%.w %#1,%0\;jbcc %l1\";
-#else
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq%.w %#1,%0\;jbcc %l1\";
-#endif
#ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
- return \"sub.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
-#else
return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
-#endif
#else /* not SGS_CMP_ORDER */
return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */
@@ -6738,28 +6699,17 @@
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int -1)))]
- "!TARGET_5200 && find_reg_note (insn, REG_NONNEG, 0)"
+ "!TARGET_COLDFIRE && find_reg_note (insn, REG_NONNEG, 0)"
"*
{
CC_STATUS_INIT;
#ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\;clr%.w %0\;sub%.l %#1,%0\;jbcc %l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"sub%.l %#1,%0\;jbcc %l1\";
-#else
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\";
-#endif
#ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
- return \"sub.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#else
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#endif
#else /* not SGS_CMP_ORDER */
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */
@@ -6832,11 +6782,6 @@
"! flag_pic"
"*
#if defined (MOTOROLA) && !defined (USE_GAS)
-#ifdef MOTOROLA_BSR
- if (GET_CODE (operands[0]) == MEM
- && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
- return \"bsr %0\";
-#endif
return \"jsr %0\";
#else
return \"jbsr %0\";
@@ -6902,11 +6847,6 @@
"! flag_pic"
"*
#if defined (MOTOROLA) && !defined (USE_GAS)
-#ifdef MOTOROLA_BSR
- if (GET_CODE (operands[1]) == MEM
- && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
- return \"bsr %1\";
-#endif
return \"jsr %1\";
#else
return \"jbsr %1\";
@@ -7015,7 +6955,6 @@
""
"*
{
-#ifndef SGS_NO_LI
/* Recognize an insn that refers to a table of offsets. Such an insn will
need to refer to a label on the insn. So output one. Use the
label-number of the table of offsets to generate this label. This code,
@@ -7044,7 +6983,6 @@
#endif /* SGS_SWITCH_TABLES */
#endif /* SGS_SWITCH_TABLES or not MOTOROLA */
}
-#endif /* SGS_NO_LI */
return \"lea %a1,%0\";
}")
@@ -7087,10 +7025,9 @@
rtx xoperands[2];
xoperands[0] = stack_pointer_rtx;
xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
-#ifndef NO_ADDSUB_Q
if (INTVAL (xoperands[1]) <= 8)
{
- if (!TARGET_5200)
+ if (!TARGET_COLDFIRE)
output_asm_insn (\"addq%.w %1,%0\", xoperands);
else
output_asm_insn (\"addq%.l %1,%0\", xoperands);
@@ -7100,9 +7037,7 @@
xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
}
- else
-#endif
- if (INTVAL (xoperands[1]) <= 0x7FFF)
+ else if (INTVAL (xoperands[1]) <= 0x7FFF)
{
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
@@ -7137,10 +7072,9 @@
rtx xoperands[2];
xoperands[0] = stack_pointer_rtx;
xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
-#ifndef NO_ADDSUB_Q
if (INTVAL (xoperands[1]) <= 8)
{
- if (!TARGET_5200)
+ if (!TARGET_COLDFIRE)
output_asm_insn (\"addq%.w %1,%0\", xoperands);
else
output_asm_insn (\"addq%.l %1,%0\", xoperands);
@@ -7150,9 +7084,7 @@
xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
}
- else
-#endif
- if (INTVAL (xoperands[1]) <= 0x7FFF)
+ else if (INTVAL (xoperands[1]) <= 0x7FFF)
{
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
@@ -7191,7 +7123,7 @@
xoperands[2]
= gen_rtx_MEM (QImode, plus_constant (stack_pointer_rtx, 3));
xoperands[3] = stack_pointer_rtx;
- if (!TARGET_5200)
+ if (!TARGET_COLDFIRE)
output_asm_insn (\"subq%.w %#4,%3\;move%.b %1,%2\", xoperands);
else
output_asm_insn (\"subq%.l %#4,%3\;move%.b %1,%2\", xoperands);
@@ -7213,7 +7145,7 @@
|| GET_CODE (operands[0]) == MEM)
/* clr insns on 68000 read before writing.
This isn't so on the 68010, but we have no TARGET_68010. */
- && ((TARGET_68020 || TARGET_5200)
+ && ((TARGET_68020 || TARGET_COLDFIRE)
|| !(GET_CODE (operands[0]) == MEM
&& MEM_VOLATILE_P (operands[0]))))
return \"clr%.w %0\";
@@ -7253,7 +7185,7 @@
(set (match_dup 0)
(plus:HI (match_dup 0)
(const_int -1)))])]
- "!TARGET_5200 && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
+ "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
"*
{
CC_STATUS_INIT;
@@ -7276,7 +7208,7 @@
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int -1)))])]
- "!TARGET_5200 && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
+ "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
"*
{
CC_STATUS_INIT;
@@ -7300,7 +7232,7 @@
(set (match_dup 0)
(plus:HI (match_dup 0)
(const_int -1)))])]
- "!TARGET_5200 && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
+ "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
"*
{
CC_STATUS_INIT;
@@ -7324,7 +7256,7 @@
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int -1)))])]
- "!TARGET_5200 && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
+ "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
"*
{
CC_STATUS_INIT;
diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h
index f481871c48d..585b24f11bb 100644
--- a/gcc/config/m68k/m68kelf.h
+++ b/gcc/config/m68k/m68kelf.h
@@ -1,7 +1,7 @@
/* m68kelf support, derived from m68kv4.h */
/* Target definitions for GNU compiler for mc680x0 running System V.4
- Copyright (C) 1991, 1993, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 2000, 2002, 2003 Free Software Foundation, Inc.
Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com).
@@ -22,8 +22,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #notinclude "m68k/sgs.h" / * The m68k/SVR4 assembler is SGS based */
-
/* These are necessary for -fpic/-fPIC to work correctly. */
#ifndef MOTOROLA
#define MOTOROLA /* Use MOTOROLA syntax. */
@@ -75,7 +73,7 @@ Boston, MA 02111-1307, USA. */
#define ASM_RETURN_CASE_JUMP \
do { \
- if (TARGET_5200) \
+ if (TARGET_COLDFIRE) \
{ \
if (ADDRESS_REG_P (operands[0])) \
return "jmp %%pc@(2,%0:l)"; \
@@ -96,7 +94,7 @@ Boston, MA 02111-1307, USA. */
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
+ "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", "argptr" }
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
diff --git a/gcc/config/m68k/m68kv4.h b/gcc/config/m68k/m68kv4.h
index f826f0fbf04..161d60703af 100644
--- a/gcc/config/m68k/m68kv4.h
+++ b/gcc/config/m68k/m68kv4.h
@@ -1,5 +1,5 @@
/* Target definitions for GNU compiler for mc680x0 running System V.4
- Copyright (C) 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000
+ Copyright (C) 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003
Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com) and
Fred Fish (fnf@cygnus.com).
@@ -34,19 +34,6 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
-/* Use SGS_* macros to control compilation in m68k.md */
-
-#define SGS_SWITCH_TABLES /* Different switch table handling */
-
-/* TODO: convert includes to ${tm_file} list in config.gcc. */
-#include "m68k/sgs.h" /* The m68k/SVR4 assembler is SGS based */
-
-#include "dbxelf.h"
-#include "elfos.h"
-#include "svr4.h" /* Pick up the generic SVR4 macros */
-
-/* See m68k.h. 7 means 68020 with 68881. */
-
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
#endif
@@ -257,7 +244,7 @@ do { \
switch_table_difference_label_flag = 0; \
} while (0)
-int switch_table_difference_label_flag;
+extern int switch_table_difference_label_flag;
#undef ASM_OUTPUT_COMMON
#undef ASM_OUTPUT_LOCAL
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index 14fcf1a962a..74f39ad0f1d 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -31,8 +31,6 @@ Boston, MA 02111-1307, USA. */
builtin_define ("__m68k__"); \
builtin_define ("__SVR4_ABI__"); \
builtin_define ("__motorola__"); \
- builtin_assert ("cpu=m68k"); \
- builtin_assert ("machine=m68k"); \
} \
while (0)
@@ -204,7 +202,7 @@ while (0)
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_RETURN_CASE_JUMP \
do { \
- if (TARGET_5200) \
+ if (TARGET_COLDFIRE) \
{ \
if (ADDRESS_REG_P (operands[0])) \
return "jmp %%pc@(2,%0:l)"; \
diff --git a/gcc/config/m68k/netbsd.h b/gcc/config/m68k/netbsd.h
index 382adc0fa17..2b4fd855a9f 100644
--- a/gcc/config/m68k/netbsd.h
+++ b/gcc/config/m68k/netbsd.h
@@ -6,18 +6,9 @@
builtin_define_std ("m68k"); \
builtin_define_std ("mc68000"); \
builtin_define_std ("mc68020"); \
- builtin_assert ("cpu=m68k"); \
- builtin_assert ("machine=m68k"); \
} \
while (0)
-#include <m68k/m68k.h>
-
-/* Get generic NetBSD definitions. */
-
-#include <netbsd.h>
-#include <netbsd-aout.h>
-
#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
#define EXTRA_SPECS \
diff --git a/gcc/config/m68k/openbsd.h b/gcc/config/m68k/openbsd.h
index f577ca5afed..8fc5198f01b 100644
--- a/gcc/config/m68k/openbsd.h
+++ b/gcc/config/m68k/openbsd.h
@@ -1,5 +1,5 @@
/* Configuration file for an m68k OpenBSD target.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -29,16 +29,6 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
-/* m68k is an old configuration that does not yet use the TARGET_CPU_DEFAULT
- framework. */
-#define TARGET_DEFAULT (MASK_BITFIELD | MASK_68881 | MASK_68020)
-
-#include <m68k/m68k.h>
-
-/* Get generic OpenBSD definitions. */
-#define OBSD_OLD_GAS
-#include <openbsd.h>
-
/* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
This will control the use of inline 68881 insns in certain macros. */
#undef CPP_SPEC
diff --git a/gcc/config/m68k/sgs.h b/gcc/config/m68k/sgs.h
index 470c066c995..1dc44c7735c 100644
--- a/gcc/config/m68k/sgs.h
+++ b/gcc/config/m68k/sgs.h
@@ -20,16 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Control assembler-syntax conditionals in m68k.md and conditionals in
- m68k.h. Note that some systems may also require SGS_SWAP_W and/or
- SGS_SWITCH_TABLES to be defined as well. */
-
-#define MOTOROLA /* Use Motorola syntax rather than "MIT" */
-#define SGS /* Uses SGS assembler */
-#define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
-
-#include "m68k/m68k.h"
-
#undef INT_OP_GROUP
#define INT_OP_GROUP INT_OP_STANDARD
@@ -82,7 +72,7 @@ Boston, MA 02111-1307, USA. */
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp", \
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
+ "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", "argptr" }
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
diff --git a/gcc/config/m68k/t-m68kbare b/gcc/config/m68k/t-m68kbare
index d9651d1b75b..8bb4b948c35 100644
--- a/gcc/config/m68k/t-m68kbare
+++ b/gcc/config/m68k/t-m68kbare
@@ -15,7 +15,7 @@ xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68040/m68060 m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68681 m68060/m68681
+MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/t-m68kelf b/gcc/config/m68k/t-m68kelf
index 6f7e3a0edc9..686e2d49054 100644
--- a/gcc/config/m68k/t-m68kelf
+++ b/gcc/config/m68k/t-m68kelf
@@ -12,11 +12,14 @@ xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
echo '#define EXTFLOAT' > xfgnulib.c
cat $(srcdir)/config/m68k/fpgnulib.c >> xfgnulib.c
-MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68040/m68060 m68881/msoft-float
+MULTILIB_OPTIONS = m68000/m68020/m5200/m5206e/m528x/m5307/m5407/mcpu32/m68040/m68060 m68881/msoft-float
MULTILIB_DIRNAMES =
-MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68040/msoft-float m68060/m68881 m68060/msoft-float
-
+MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m5206e=m5272
+MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float \
+ m5206e/m68881 m5206e/msoft-float m528x/m68881 m528x/msoft-float \
+ m5307/m68881 m5307/msoft-float m5407/m68881 m5407/msoft-float \
+ mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68040/msoft-float \
+ m68060/m68881 m68060/msoft-float
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/t-rtems b/gcc/config/m68k/t-rtems
new file mode 100644
index 00000000000..d0e50e22ea9
--- /dev/null
+++ b/gcc/config/m68k/t-rtems
@@ -0,0 +1,6 @@
+# Custom multilibs for RTEMS
+
+MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float
+MULTILIB_DIRNAMES =
+MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030
+MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h
index 35055e5762f..48b65d5219e 100644
--- a/gcc/config/mcore/mcore-pe.h
+++ b/gcc/config/mcore/mcore-pe.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for MCore using COFF/PE.
- Copyright (C) 1994, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com).
This file is part of GNU CC.
@@ -31,12 +31,9 @@ Boston, MA 02111-1307, USA. */
/* The MCore ABI says that bitfields are unsigned by default. */
/* The EPOC C++ environment does not support exceptions. */
+#undef CC1_SPEC
#define CC1_SPEC "-funsigned-bitfields %{!DIN_GCC:-fno-rtti} %{!DIN_GCC:-fno-exceptions}"
-#include "svr3.h"
-#include "mcore/mcore.h"
-#include "dbxcoff.h"
-
#undef SDB_DEBUGGING_INFO
#define DBX_DEBUGGING_INFO 1
diff --git a/gcc/config/mcore/mcore-protos.h b/gcc/config/mcore/mcore-protos.h
index 7152a57d498..ae9f402f47f 100644
--- a/gcc/config/mcore/mcore-protos.h
+++ b/gcc/config/mcore/mcore-protos.h
@@ -65,6 +65,8 @@ extern void mcore_print_operand_address PARAMS ((FILE *, rtx));
extern void mcore_print_operand PARAMS ((FILE *, rtx, int));
extern rtx mcore_gen_compare_reg PARAMS ((RTX_CODE));
extern int mcore_symbolic_address_p PARAMS ((rtx));
+extern bool mcore_r15_operand_p PARAMS ((rtx));
+extern enum reg_class mcore_secondary_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx));
extern enum reg_class mcore_reload_class PARAMS ((rtx, enum reg_class));
extern int mcore_is_same_reg PARAMS ((rtx, rtx));
extern int mcore_arith_S_operand PARAMS ((rtx));
@@ -72,7 +74,6 @@ extern int mcore_arith_S_operand PARAMS ((rtx));
#ifdef HAVE_MACHINE_MODES
extern const char * mcore_output_move PARAMS ((rtx, rtx *, enum machine_mode));
extern const char * mcore_output_movedouble PARAMS ((rtx *, enum machine_mode));
-extern const char * mcore_output_inline_const_forced PARAMS ((rtx, rtx *, enum machine_mode));
extern int mcore_arith_reg_operand PARAMS ((rtx, enum machine_mode));
extern int mcore_general_movsrc_operand PARAMS ((rtx, enum machine_mode));
extern int mcore_general_movdst_operand PARAMS ((rtx, enum machine_mode));
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 59c04d6c839..fe44a1ee7fc 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -1270,7 +1270,17 @@ mcore_output_move (insn, operands, mode)
if (GET_CODE (XEXP (src, 0)) == LABEL_REF)
return "lrw\t%0,[%1]"; /* a-R */
else
- return "ldw\t%0,%1"; /* r-m */
+ switch (GET_MODE (src)) /* r-m */
+ {
+ case SImode:
+ return "ldw\t%0,%1";
+ case HImode:
+ return "ld.h\t%0,%1";
+ case QImode:
+ return "ld.b\t%0,%1";
+ default:
+ abort ();
+ }
}
else if (GET_CODE (src) == CONST_INT)
{
@@ -1291,100 +1301,21 @@ mcore_output_move (insn, operands, mode)
return "lrw\t%0, %1"; /* Into the literal pool. */
}
else if (GET_CODE (dst) == MEM) /* m-r */
- return "stw\t%1,%0";
+ switch (GET_MODE (dst))
+ {
+ case SImode:
+ return "stw\t%1,%0";
+ case HImode:
+ return "st.h\t%1,%0";
+ case QImode:
+ return "st.b\t%1,%0";
+ default:
+ abort ();
+ }
abort ();
}
-/* Outputs a constant inline -- regardless of the cost.
- Useful for things where we've gotten into trouble and think we'd
- be doing an lrw into r15 (forbidden). This lets us get out of
- that pickle even after register allocation. */
-
-const char *
-mcore_output_inline_const_forced (insn, operands, mode)
- rtx insn ATTRIBUTE_UNUSED;
- rtx operands[];
- enum machine_mode mode ATTRIBUTE_UNUSED;
-{
- unsigned long value = INTVAL (operands[1]);
- unsigned long ovalue = value;
- struct piece
- {
- int low;
- int shift;
- }
- part[6];
- int i;
-
- if (mcore_const_ok_for_inline (value))
- return output_inline_const (SImode, operands);
-
- for (i = 0; (unsigned) i < ARRAY_SIZE (part); i++)
- {
- part[i].shift = 0;
- part[i].low = (value & 0x1F);
- value -= part[i].low;
-
- if (mcore_const_ok_for_inline (value))
- break;
- else
- {
- value >>= 5;
- part[i].shift = 5;
-
- while ((value & 1) == 0)
- {
- part[i].shift++;
- value >>= 1;
- }
-
- if (mcore_const_ok_for_inline (value))
- break;
- }
- }
-
- /* 5 bits per iteration, a maximum of 5 times == 25 bits and leaves
- 7 bits left in the constant -- which we know we can cover with
- a movi. The final value can't be zero otherwise we'd have stopped
- in the previous iteration. */
- if (value == 0 || ! mcore_const_ok_for_inline (value))
- abort ();
-
- /* Now, work our way backwards emitting the constant. */
-
- /* Emit the value that remains -- it will be nonzero. */
- operands[1] = GEN_INT (value);
- output_asm_insn (output_inline_const (SImode, operands), operands);
-
- while (i >= 0)
- {
- /* Shift anything we've already loaded. */
- if (part[i].shift)
- {
- operands[2] = GEN_INT (part[i].shift);
- output_asm_insn ("lsli %0,%2", operands);
- value <<= part[i].shift;
- }
-
- /* Add anything we need into the low 5 bits. */
- if (part[i].low != 0)
- {
- operands[2] = GEN_INT (part[i].low);
- output_asm_insn ("addi %0,%2", operands);
- value += part[i].low;
- }
-
- i--;
- }
-
- if (value != ovalue) /* sanity */
- abort ();
-
- /* We've output all the instructions. */
- return "";
-}
-
/* Return a sequence of instructions to perform DI or DF move.
Since the MCORE cannot move a DI or DF in one instruction, we have
to take care when we see overlapping source and dest registers. */
@@ -3064,36 +2995,53 @@ mcore_reorg ()
}
-/* Return the reg_class to use when reloading the rtx X into the class
- CLASS. */
+/* Return true if X is something that can be moved directly into r15. */
-/* If the input is (PLUS REG CONSTANT) representing a stack slot address,
- then we want to restrict the class to LRW_REGS since that ensures that
- will be able to safely load the constant.
+bool
+mcore_r15_operand_p (x)
+ rtx x;
+{
+ switch (GET_CODE (x))
+ {
+ case CONST_INT:
+ return mcore_const_ok_for_inline (INTVAL (x));
- If the input is a constant that should be loaded with mvir1, then use
- ONLYR1_REGS.
+ case REG:
+ case SUBREG:
+ case MEM:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+/* Implement SECONDARY_RELOAD_CLASS. If CLASS contains r15, and we can't
+ directly move X into it, use r1-r14 as a temporary. */
+enum reg_class
+mcore_secondary_reload_class (class, mode, x)
+ enum reg_class class;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+ rtx x;
+{
+ if (TEST_HARD_REG_BIT (reg_class_contents[class], 15)
+ && !mcore_r15_operand_p (x))
+ return LRW_REGS;
+ return NO_REGS;
+}
- ??? We don't handle the case where we have (PLUS REG CONSTANT) and
- the constant should be loaded with mvir1, because that can lead to cases
- where an instruction needs two ONLYR1_REGS reloads. */
+/* Return the reg_class to use when reloading the rtx X into the class
+ CLASS. If X is too complex to move directly into r15, prefer to
+ use LRW_REGS instead. */
enum reg_class
mcore_reload_class (x, class)
rtx x;
enum reg_class class;
{
- enum reg_class new_class;
-
- if (class == GENERAL_REGS && CONSTANT_P (x)
- && (GET_CODE (x) != CONST_INT
- || ( ! CONST_OK_FOR_I (INTVAL (x))
- && ! CONST_OK_FOR_M (INTVAL (x))
- && ! CONST_OK_FOR_N (INTVAL (x)))))
- new_class = LRW_REGS;
- else
- new_class = class;
+ if (reg_class_subset_p (LRW_REGS, class) && !mcore_r15_operand_p (x))
+ return LRW_REGS;
- return new_class;
+ return class;
}
/* Tell me if a pair of reg/subreg rtx's actually refer to the same
@@ -3410,7 +3358,7 @@ mcore_mark_dllimport (decl)
&& !DECL_VIRTUAL_P (decl)
&& DECL_INITIAL (decl))
{
- error_with_decl (decl, "initialized variable `%s' is marked dllimport");
+ error ("%Jinitialized variable '%D' is marked dllimport", decl, decl);
return;
}
diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h
index dddd5c15232..6a489e9fa9b 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -28,12 +28,6 @@
#define MCORE_STRUCT_ARGS
/* RBE: end of "move elsewhere". */
-#include "hwint.h"
-
-#ifndef HAVE_MACHINE_MODES
-#include "machmode.h"
-#endif
-
/* Run-time Target Specification. */
#define TARGET_MCORE
@@ -179,10 +173,8 @@ extern const char * mcore_stack_increment_string;
N_("Maximum amount for a single stack increment operation"), 0} \
}
-#ifndef CC1_SPEC
/* The MCore ABI says that bitfields are unsigned by default. */
#define CC1_SPEC "-funsigned-bitfields"
-#endif
/* What options are we going to default to specific settings when
-O* happens; the user can subsequently override these settings.
@@ -611,7 +603,8 @@ extern const enum reg_class reg_class_from_letter[];
/* 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. */
-#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) NO_REGS
+#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
+ mcore_secondary_reload_class (CLASS, MODE, X)
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS.
diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md
index bfdd844c21a..700dcb2cdc9 100644
--- a/gcc/config/mcore/mcore.md
+++ b/gcc/config/mcore/mcore.md
@@ -1226,101 +1226,20 @@
{
if (GET_CODE (operands[0]) == MEM)
operands[1] = force_reg (SImode, operands[1]);
- else if (CONSTANT_P (operands[1])
- && (GET_CODE (operands[1]) != CONST_INT
- || ( ! CONST_OK_FOR_I (INTVAL (operands[1]))
- && ! CONST_OK_FOR_M (INTVAL (operands[1]))
- && ! CONST_OK_FOR_N (INTVAL (operands[1]))
- && (! TARGET_HARDLIT ||
- ! mcore_const_ok_for_inline (INTVAL (operands[1])))))
- && ! reload_completed
- && ! reload_in_progress
- && GET_CODE (operands[0]) == REG
- && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
- && (REGNO (operands[0]) == STACK_POINTER_REGNUM
- || REGNO (operands[0]) == LK_REG))
- operands[1] = force_reg (SImode, operands[1]);
}")
-;;; Must put a/i before r/r so that it will be preferred when the dest is
-;;; a hard register. Must put a/R before r/m.
-;;; DO WE NEED a/i ANYMORE?
-
(define_insn ""
- [(set (match_operand:SI 0 "mcore_general_movdst_operand" "=r,r,r,a,r,r,a,r,m")
- (match_operand:SI 1 "mcore_general_movsrc_operand" "I,M,N,i,r,c,R,m,r"))]
+ [(set (match_operand:SI 0 "mcore_general_movdst_operand" "=r,r,a,r,a,r,m")
+ (match_operand:SI 1 "mcore_general_movsrc_operand" "r,P,i,c,R,m,r"))]
"(register_operand (operands[0], SImode)
- || register_operand (operands[1], SImode))
- && ! (CONSTANT_P (operands[1])
- && (GET_CODE (operands[1]) != CONST_INT
- || ( ! CONST_OK_FOR_I (INTVAL (operands[1]))
- && ! CONST_OK_FOR_M (INTVAL (operands[1]))
- && ! CONST_OK_FOR_N (INTVAL (operands[1]))))
- && GET_CODE (operands[0]) == REG
- && REGNO (operands[0]) < FIRST_PSEUDO_REGISTER
- && (REGNO (operands[0]) == STACK_POINTER_REGNUM
- || REGNO (operands[0]) == LK_REG))"
+ || register_operand (operands[1], SImode))"
"* return mcore_output_move (insn, operands, SImode);"
- [(set_attr "type" "move,move,move,move,move,move,load,load,store")])
+ [(set_attr "type" "move,move,move,move,load,load,store")])
-;; This is to work around a bug in reload.
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=r")
- (match_operand:SI 1 "immediate_operand" "i"))]
- "((reload_in_progress || reload_completed)
- && CONSTANT_P (operands[1])
- && GET_CODE (operands[1]) == CONST_INT
- && ! CONST_OK_FOR_I (INTVAL (operands[1]))
- && ! CONST_OK_FOR_M (INTVAL (operands[1]))
- && ! CONST_OK_FOR_N (INTVAL (operands[1]))
- && GET_CODE (operands[0]) == REG
- && REGNO (operands[0]) == LK_REG)"
- "* return mcore_output_inline_const_forced (insn, operands, SImode);"
- [(set_attr "type" "load")])
-
-;; (define_expand "reload_insi"
-;; [(parallel [(match_operand:SI 0 "register_operand" "=r")
-;; (match_operand:SI 1 "general_operand" "")
-;; (match_operand:DI 2 "register_operand" "=&r")])]
-;; ""
-;; "
-;; {
-;; if (CONSTANT_P (operands[1])
-;; && GET_CODE (operands[1]) == CONST_INT
-;; && ! CONST_OK_FOR_I (INTVAL (operands[1]))
-;; && ! CONST_OK_FOR_M (INTVAL (operands[1]))
-;; && ! CONST_OK_FOR_N (INTVAL (operands[1]))
-;; && GET_CODE (operands[0]) == REG
-;; && (REGNO (operands[0]) == STACK_POINTER_REGNUM
-;; || REGNO (operands[0]) == LK_REG))
-;; {
-;; rtx tmp;
-;;
-;; if ( REGNO (operands[2]) == REGNO (operands[0])
-;; || REGNO (operands[2]) == STACK_POINTER_REGNUM
-;; || REGNO (operands[2]) == LK_REG)
-;; tmp = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
-;; else
-;; tmp = gen_rtx_REG (SImode, REGNO (operands[2]));
-;;
-;; emit_insn (gen_movsi (tmp, operands[1]));
-;; emit_insn (gen_movsi (operands[0], tmp));
-;; DONE;
-;; }
-;; emit_insn (gen_movsi (operands[0], operands[1]));
-;; DONE;
-;; }"
-;; )
-
-
-
;;
;; HImode
;;
-;;; ??? This isn't guaranteed to work. It should be more like the SImode
-;;; patterns.
-
(define_expand "movhi"
[(set (match_operand:HI 0 "general_operand" "")
(match_operand:HI 1 "general_operand" ""))]
@@ -1338,73 +1257,17 @@
{
rtx reg = gen_reg_rtx (SImode);
emit_insn (gen_movsi (reg, operands[1]));
- operands[1] = gen_rtx (SUBREG, HImode, reg, 0);
+ operands[1] = gen_lowpart (HImode, reg);
}
}")
(define_insn ""
- [(set (match_operand:HI 0 "mcore_general_movdst_operand" "=r,r,r,r,r,r,m")
- (match_operand:HI 1 "mcore_general_movsrc_operand" "r,I,M,N,c,m,r"))]
+ [(set (match_operand:HI 0 "mcore_general_movdst_operand" "=r,r,a,r,r,m")
+ (match_operand:HI 1 "mcore_general_movsrc_operand" "r,P,i,c,m,r"))]
"(register_operand (operands[0], HImode)
- || register_operand (operands[1], HImode))
- && (GET_CODE (operands[1]) != CONST_INT
- || CONST_OK_FOR_M (INTVAL (operands[1]))
- || CONST_OK_FOR_N (INTVAL (operands[1]))
- || CONST_OK_FOR_I (INTVAL (operands[1])))"
- "@
- mov %0,%1
- movi %0,%1
- bgeni %0,%P1
- bmaski %0,%N1
- mvc %0
- ld.h %0,%1
- st.h %1,%0"
- [(set_attr "type" "move,move,move,move,move,load,store")])
-
-;; Like movhi, but the const_int source can't be synthesized in
-;; a single-instruction. Fall back to the same things that
-;; are done for movsi in such cases. Presumes that we can
-;; modify any parts of the register that we wish.
-
-(define_insn ""
- [(set (match_operand:HI 0 "mcore_general_movdst_operand" "=r,a")
- (match_operand:HI 1 "const_int_operand" "P,i"))]
- "GET_CODE (operands[1]) == CONST_INT
- && INTVAL (operands[1]) > 127 && INTVAL (operands[1]) < 65536"
- "*
-{
- if (GET_CODE (operands[0])== REG && REGNO (operands[0]) == 15
- && !mcore_const_ok_for_inline (INTVAL (operands[1])))
- {
- /* mcore_output_move would generate lrw r15 -- a forbidden combo */
- return mcore_output_inline_const_forced (insn, operands, SImode);
- }
- else
- return mcore_output_move (insn, operands, SImode);
-}"
- [(set_attr "type" "move")])
-
-
-;; if we're still looking around for things to use, here's a last
-;; ditch effort that just calls the move. We only let this happen
-;; if we're in the reload pass.
-;;
-(define_insn ""
- [(set (match_operand:HI 0 "mcore_general_movdst_operand" "=r,a")
- (match_operand:HI 1 "const_int_operand" "P,i"))]
- "reload_in_progress || reload_completed"
- "*
-{
- if (GET_CODE (operands[0])== REG && REGNO (operands[0]) == 15
- && !mcore_const_ok_for_inline (INTVAL (operands[1])))
- {
- /* mcore_output_move would generate lrw r15 -- a forbidden combo */
- return mcore_output_inline_const_forced (insn, operands, SImode);
- }
- else
- return mcore_output_move (insn, operands, HImode);
-}"
- [(set_attr "type" "move")])
+ || register_operand (operands[1], HImode))"
+ "* return mcore_output_move (insn, operands, HImode);"
+ [(set_attr "type" "move,move,move,move,load,store")])
;;
;; QImode
@@ -1427,67 +1290,18 @@
{
rtx reg = gen_reg_rtx (SImode);
emit_insn (gen_movsi (reg, operands[1]));
- operands[1] = gen_rtx (SUBREG, QImode, reg, 0);
+ operands[1] = gen_lowpart (QImode, reg);
}
}")
(define_insn ""
- [(set (match_operand:QI 0 "mcore_general_movdst_operand" "=r,r,r,r,r,r,m")
- (match_operand:QI 1 "mcore_general_movsrc_operand" "r,I,M,N,c,m,r"))]
+ [(set (match_operand:QI 0 "mcore_general_movdst_operand" "=r,r,a,r,r,m")
+ (match_operand:QI 1 "mcore_general_movsrc_operand" "r,P,i,c,m,r"))]
"(register_operand (operands[0], QImode)
- || register_operand (operands[1], QImode))
- && (GET_CODE (operands[1]) != CONST_INT
- || CONST_OK_FOR_M (INTVAL (operands[1]))
- || CONST_OK_FOR_N (INTVAL (operands[1]))
- || CONST_OK_FOR_I (INTVAL (operands[1])))"
- "@
- mov %0,%1
- movi %0,%1
- bgeni %0,%P1
- bmaski %0,%N1
- mvc %0
- ld.b %0,%1
- st.b %1,%0"
- [(set_attr "type" "move,move,move,move,move,load,store")])
-
-;; cover the case where the constant is 128..255; this isn't handled
-;; in the above case. We could if we wanted to mess with adding a
-;; new constraint class like M,N,I.
-(define_insn ""
- [(set (match_operand:QI 0 "mcore_general_movdst_operand" "=r")
- (match_operand:QI 1 "const_int_operand" ""))]
- "GET_CODE (operands[1]) == CONST_INT
- && INTVAL (operands[1]) > 127 && INTVAL (operands[1]) < 256"
- "*
-{
- /* have a constant in range 128..255; have to do 2 insns; we can
- * do this with a movi followed by a bseti
- */
- operands[2] = GEN_INT (INTVAL (operands[1]) & 0x7f);
- return \"movi\\t%0,%2\;bseti\\t%0,7\";
-}"
- [(set_attr "type" "move")])
+ || register_operand (operands[1], QImode))"
+ "* return mcore_output_move (insn, operands, QImode);"
+ [(set_attr "type" "move,move,move,move,load,store")])
-;; if we're still looking around for things to use, here's a last
-;; ditch effort that just calls the move. We only let this happen
-;; if we're in the reload pass.
-;;
-(define_insn ""
- [(set (match_operand:QI 0 "mcore_general_movdst_operand" "=r,a")
- (match_operand:QI 1 "const_int_operand" "P,i"))]
- "(reload_in_progress || reload_completed)"
- "*
-{
- if (GET_CODE (operands[0])== REG && REGNO (operands[0]) == 15
- && ! mcore_const_ok_for_inline (INTVAL (operands[1])))
- {
- /* mcore_output_move would generate lrw r15 -- a forbidden combo */
- return mcore_output_inline_const_forced (insn, operands, SImode);
- }
- else
- return mcore_output_move (insn, operands, QImode);
-}"
- [(set_attr "type" "move")])
;; DImode
@@ -1502,15 +1316,12 @@
else if (GET_CODE (operands[1]) == CONST_INT
&& ! CONST_OK_FOR_I (INTVAL (operands[1]))
&& ! CONST_OK_FOR_M (INTVAL (operands[1]))
- && ! CONST_OK_FOR_N (INTVAL (operands[1]))
- && ! reload_completed
- && ! reload_in_progress
- && GET_CODE (operands[0]) == REG)
+ && ! CONST_OK_FOR_N (INTVAL (operands[1])))
{
- emit_move_insn (operand_subword (operands[0], 0, 1, DImode),
- operand_subword_force (operands[1], 0, DImode));
- emit_move_insn (operand_subword (operands[0], 1, 1, DImode),
- operand_subword_force (operands[1], 1, DImode));
+ int i;
+ for (i = 0; i < UNITS_PER_WORD * 2; i += UNITS_PER_WORD)
+ emit_move_insn (simplify_gen_subreg (SImode, operands[0], DImode, i),
+ simplify_gen_subreg (SImode, operands[1], DImode, i));
DONE;
}
}")
diff --git a/gcc/config/mips/5400.md b/gcc/config/mips/5400.md
index 6934b7433df..70386fc518b 100644
--- a/gcc/config/mips/5400.md
+++ b/gcc/config/mips/5400.md
@@ -44,11 +44,10 @@
;; This reservation is for conditional move based on integer
-;; or floating point CC. This could probably use some refinement
-;; as "move" type attr seems to be overloaded in rtl.
-(define_insn_reservation "ir_vr54_move" 4
+;; or floating point CC.
+(define_insn_reservation "ir_vr54_condmove" 4
(and (eq_attr "cpu" "r5400")
- (eq_attr "type" "move"))
+ (eq_attr "type" "condmove"))
"vr54_dp0|vr54_dp1")
;; Move to/from FPU registers
@@ -64,7 +63,7 @@
(define_insn_reservation "ir_vr54_arith" 1
(and (eq_attr "cpu" "r5400")
- (eq_attr "type" "arith,darith,const,icmp,nop"))
+ (eq_attr "type" "move,arith,darith,const,icmp,nop"))
"vr54_dp0|vr54_dp1")
(define_insn_reservation "ir_vr54_imul_si" 3
diff --git a/gcc/config/mips/5500.md b/gcc/config/mips/5500.md
index dc85356d98b..0abee1741c2 100644
--- a/gcc/config/mips/5500.md
+++ b/gcc/config/mips/5500.md
@@ -37,11 +37,10 @@
"vr55_mem")
;; This reservation is for conditional move based on integer
-;; or floating point CC. This could probably use some refinement
-;; as "move" type attr seems to be overloaded in rtl.
-(define_insn_reservation "ir_vr55_move" 2
+;; or floating point CC.
+(define_insn_reservation "ir_vr55_condmove" 2
(and (eq_attr "cpu" "r5500")
- (eq_attr "type" "move"))
+ (eq_attr "type" "condmove"))
"vr55_dp0|vr55_dp1")
;; Move to/from FPU registers
@@ -57,7 +56,7 @@
(define_insn_reservation "ir_vr55_arith" 1
(and (eq_attr "cpu" "r5500")
- (eq_attr "type" "arith,darith,const,icmp,nop"))
+ (eq_attr "type" "move,arith,darith,const,icmp,nop"))
"vr55_dp0|vr55_dp1")
(define_insn_reservation "ir_vr55_imul_si" 3
diff --git a/gcc/config/mips/7000.md b/gcc/config/mips/7000.md
new file mode 100644
index 00000000000..2ea6298fddf
--- /dev/null
+++ b/gcc/config/mips/7000.md
@@ -0,0 +1,211 @@
+;; DFA-based pipeline description for the RM7000.
+;; 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.
+
+;; .........................
+;;
+;; The RM7000 is a dual-issue processor that can bundle instructions as:
+;; {arith|load|store}{arith|imul|idiv|branch|float}
+;;
+;; Reference:
+;; "RM7000 Family User Manual, PMC-2002296"
+;;
+;; .........................
+
+;; Use three automata to isolate long latency operations, reducing space.
+(define_automaton "rm7000_other, rm7000_fdiv, rm7000_idiv")
+
+;;
+;; Describe the resources.
+;;
+
+;; Global
+(define_cpu_unit "rm7_iss0,rm7_iss1" "rm7000_other")
+
+;; Integer execution unit (M-Pipe).
+(define_cpu_unit "ixum_addsub_agen" "rm7000_other")
+
+;; Integer execution unit (F-Pipe).
+(define_cpu_unit "ixuf_addsub" "rm7000_other")
+(define_cpu_unit "ixuf_branch" "rm7000_other")
+(define_cpu_unit "ixuf_mpydiv" "rm7000_other")
+(define_cpu_unit "ixuf_mpydiv_iter" "rm7000_idiv")
+;; Floating-point unit (F-Pipe).
+(define_cpu_unit "fxuf_add" "rm7000_other")
+(define_cpu_unit "fxuf_mpy" "rm7000_other")
+(define_cpu_unit "fxuf_mpy_iter" "rm7000_fdiv")
+(define_cpu_unit "fxuf_divsqrt" "rm7000_other")
+(define_cpu_unit "fxuf_divsqrt_iter" "rm7000_fdiv")
+
+(exclusion_set "ixuf_addsub"
+ "ixuf_branch,ixuf_mpydiv,fxuf_add,fxuf_mpy,fxuf_divsqrt")
+(exclusion_set "ixuf_branch" "ixuf_mpydiv,fxuf_add,fxuf_mpy,fxuf_divsqrt")
+(exclusion_set "ixuf_mpydiv" "fxuf_add,fxuf_mpy,fxuf_divsqrt")
+(exclusion_set "fxuf_add" "fxuf_mpy,fxuf_divsqrt")
+(exclusion_set "fxuf_mpy" "fxuf_divsqrt")
+
+;; After branch any insn can not be issued.
+(absence_set "rm7_iss0,rm7_iss1" "ixuf_branch")
+
+;;
+;; Define reservations for unit name mnemonics or combinations.
+;;
+
+(define_reservation "rm7_iss" "rm7_iss0|rm7_iss1")
+(define_reservation "rm7_single_dispatch" "rm7_iss0+rm7_iss1")
+
+(define_reservation "rm7_iaddsub" "rm7_iss+(ixum_addsub_agen|ixuf_addsub)")
+(define_reservation "rm7_imem" "rm7_iss+ixum_addsub_agen")
+(define_reservation "rm7_impydiv" "rm7_iss+ixuf_mpydiv")
+(define_reservation "rm7_impydiv_iter" "ixuf_mpydiv_iter")
+(define_reservation "rm7_branch" "rm7_iss+ixuf_branch")
+
+(define_reservation "rm7_fpadd" "rm7_iss+fxuf_add")
+(define_reservation "rm7_fpmpy" "rm7_iss+fxuf_mpy")
+(define_reservation "rm7_fpmpy_iter" "fxuf_mpy_iter")
+(define_reservation "rm7_fpdivsqr" "rm7_iss+fxuf_divsqrt")
+(define_reservation "rm7_fpdivsqr_iter" "fxuf_divsqrt_iter")
+
+;;
+;; Describe instruction reservations for integer operations.
+;;
+
+(define_insn_reservation "rm7_int_other" 1
+ (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "arith,darith,const,move,condmove,icmp,nop"))
+ "rm7_iaddsub")
+
+(define_insn_reservation "rm7_ld" 2 (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "load"))
+ "rm7_imem")
+
+(define_insn_reservation "rm7_st" 1 (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "store"))
+ "rm7_imem")
+
+(define_insn_reservation "rm7_idiv_si" 36 (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "mode" "SI")))
+ "rm7_impydiv+(rm7_impydiv_iter*36)")
+
+(define_insn_reservation "rm7_idiv_di" 68 (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "mode" "DI")))
+ "rm7_impydiv+(rm7_impydiv_iter*68)")
+
+(define_insn_reservation "rm7_impy_si_mult" 5
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "imul,imadd")
+ (and (eq_attr "mode" "SI")
+ (match_operand 0 "hilo_operand" ""))))
+ "rm7_impydiv+(rm7_impydiv_iter*3)")
+
+;; There are an additional 2 stall cycles.
+(define_insn_reservation "rm7_impy_si_mul" 2
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "imul,imadd")
+ (and (eq_attr "mode" "SI")
+ (not (match_operand 0 "hilo_operand" "")))))
+ "rm7_impydiv")
+
+(define_insn_reservation "rm7_impy_di" 9 (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "imul")
+ (eq_attr "mode" "DI")))
+ "rm7_impydiv+(rm7_impydiv_iter*8)")
+
+;; Move to/from HI/LO.
+(define_insn_reservation "rm7_mthilo" 3
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "hilo")
+ (match_operand 0 "hilo_operand" "")))
+ "rm7_impydiv")
+
+(define_insn_reservation "rm7_mfhilo" 1
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "hilo")
+ (not (match_operand 0 "hilo_operand" ""))))
+ "rm7_impydiv")
+
+;; Move to/from fp coprocessor.
+(define_insn_reservation "rm7_ixfer" 2 (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "xfer"))
+ "rm7_iaddsub")
+
+(define_insn_reservation "rm7_ibr" 3 (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "branch,jump,call"))
+ "rm7_branch")
+
+;;
+;; Describe instruction reservations for the floating-point operations.
+;;
+(define_insn_reservation "rm7_fp_quick" 4
+ (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "fneg,fcmp,fabs"))
+ "rm7_fpadd")
+
+(define_insn_reservation "rm7_fp_other" 4
+ (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "fadd"))
+ "rm7_fpadd")
+
+(define_insn_reservation "rm7_fp_cvt" 4
+ (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "fcvt"))
+ "rm7_fpadd")
+
+(define_insn_reservation "rm7_fp_divsqrt_df" 36
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "fdiv,fsqrt")
+ (eq_attr "mode" "DF")))
+ "rm7_fpdivsqr+(rm7_fpdivsqr_iter*36)")
+
+(define_insn_reservation "rm7_fp_divsqrt_sf" 21
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "fdiv,fsqrt")
+ (eq_attr "mode" "SF")))
+ "rm7_fpdivsqr+(rm7_fpdivsqr_iter*21)")
+
+(define_insn_reservation "rm7_fp_rsqrt_df" 68
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "frsqrt")
+ (eq_attr "mode" "DF")))
+ "rm7_fpdivsqr+(rm7_fpdivsqr_iter*68)")
+
+(define_insn_reservation "rm7_fp_rsqrt_sf" 38
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "frsqrt")
+ (eq_attr "mode" "SF")))
+ "rm7_fpdivsqr+(rm7_fpdivsqr_iter*38)")
+
+(define_insn_reservation "rm7_fp_mpy_sf" 4
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "fmul,fmadd")
+ (eq_attr "mode" "SF")))
+ "rm7_fpmpy+rm7_fpmpy_iter")
+
+(define_insn_reservation "rm7_fp_mpy_df" 5
+ (and (eq_attr "cpu" "r7000")
+ (and (eq_attr "type" "fmul,fmadd")
+ (eq_attr "mode" "DF")))
+ "rm7_fpmpy+(rm7_fpmpy_iter*2)")
+
+;; Force single-dispatch for unknown or multi.
+(define_insn_reservation "rm7_unknown" 1 (and (eq_attr "cpu" "r7000")
+ (eq_attr "type" "unknown,multi"))
+ "rm7_single_dispatch")
diff --git a/gcc/config/mips/9000.md b/gcc/config/mips/9000.md
new file mode 100644
index 00000000000..124941b33ea
--- /dev/null
+++ b/gcc/config/mips/9000.md
@@ -0,0 +1,154 @@
+;; DFA-based pipeline description for the RM9000.
+;; 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 "rm9k_main, rm9k_imul, rm9k_fdiv")
+
+;; These units are for insns that can issue in either pipe. We don't
+;; want to use constructs like "rm9k_m | rm9k_f_int" since that would
+;; needlessly make an insn prefer the M pipe.
+(define_cpu_unit "rm9k_any1" "rm9k_main")
+(define_cpu_unit "rm9k_any2" "rm9k_main")
+
+;; F and M pipe units, for instructions that must be issued by a
+;; particular pipe. Split the F pipe into two units so that integer
+;; instructions can issue while the FPU is busy. We don't need to
+;; split M because it is only ever reserved for a single cycle.
+(define_cpu_unit "rm9k_m" "rm9k_main")
+(define_cpu_unit "rm9k_f_int" "rm9k_main")
+(define_cpu_unit "rm9k_f_float" "rm9k_main")
+
+(exclusion_set "rm9k_f_int" "rm9k_f_float")
+
+;; Multiply/divide units.
+(define_cpu_unit "rm9k_imul" "rm9k_imul")
+(define_cpu_unit "rm9k_fdiv" "rm9k_fdiv")
+
+(define_insn_reservation "rm9k_load" 3
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "load"))
+ "rm9k_m")
+
+(define_insn_reservation "rm9k_store" 1
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "store"))
+ "rm9k_m")
+
+(define_insn_reservation "rm9k_int" 1
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "move,arith,darith,const,icmp,nop"))
+ "rm9k_any1 | rm9k_any2")
+
+(define_insn_reservation "rm9k_int_cmove" 2
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "condmove")
+ (eq_attr "mode" "SI,DI")))
+ "rm9k_any1 | rm9k_any2")
+
+;; This applies to both 'mul' and 'mult'.
+(define_insn_reservation "rm9k_mulsi" 3
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "imul,imadd")
+ (eq_attr "mode" "!DI")))
+ "rm9k_f_int")
+
+(define_insn_reservation "rm9k_muldi" 7
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "imul,imadd")
+ (eq_attr "mode" "DI")))
+ "rm9k_f_int + rm9k_imul * 7")
+
+(define_insn_reservation "rm9k_divsi" 38
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "mode" "!DI")))
+ "rm9k_f_int + rm9k_imul * 38")
+
+(define_insn_reservation "rm9k_divdi" 70
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "mode" "DI")))
+ "rm9k_f_int + rm9k_imul * 70")
+
+(define_insn_reservation "rm9k_mfhilo" 1
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "hilo")
+ (not (match_operand 0 "hilo_operand" ""))))
+ "rm9k_f_int")
+
+(define_insn_reservation "rm9k_mthilo" 5
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "hilo")
+ (match_operand 0 "hilo_operand" "")))
+ "rm9k_f_int")
+
+(define_insn_reservation "rm9k_xfer" 2
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "xfer"))
+ "rm9k_m")
+
+(define_insn_reservation "rm9k_fquick" 2
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "fabs,fneg,fcmp"))
+ "rm9k_f_float")
+
+(define_insn_reservation "rm9k_fcmove" 2
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "condmove")
+ (eq_attr "mode" "SF,DF")))
+ "rm9k_m")
+
+(define_insn_reservation "rm9k_fadd" 6
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "fadd,fcvt"))
+ "rm9k_f_float")
+
+(define_insn_reservation "rm9k_fmuls" 6
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "fmul,fmadd")
+ (eq_attr "mode" "SF")))
+ "rm9k_f_float")
+
+(define_insn_reservation "rm9k_fmuld" 9
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "fmul,fmadd")
+ (eq_attr "mode" "DF")))
+ "rm9k_f_float * 3")
+
+(define_insn_reservation "rm9k_fdivs" 22
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "fdiv,fsqrt,frsqrt")
+ (eq_attr "mode" "SF")))
+ "rm9k_f_float + rm9k_fdiv * 22")
+
+(define_insn_reservation "rm9k_fdivd" 37
+ (and (eq_attr "cpu" "r9000")
+ (and (eq_attr "type" "fdiv,fsqrt,frsqrt")
+ (eq_attr "mode" "DF")))
+ "rm9k_f_float + rm9k_fdiv * 37")
+
+(define_insn_reservation "rm9k_branch" 2
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "branch,jump,call"))
+ "rm9k_any1 | rm9k_any2")
+
+(define_insn_reservation "rm9k_unknown" 1
+ (and (eq_attr "cpu" "r9000")
+ (eq_attr "type" "unknown,multi"))
+ "rm9k_m + rm9k_f_int + rm9k_any1 + rm9k_any2")
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index c325410d604..61999e2c372 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -20,14 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Use ELF. */
-#undef OBJECT_FORMAT_COFF
-#undef EXTENDED_COFF
-
-/* ??? Move all SDB stuff into separate header file. */
-#undef SDB_DEBUGGING_INFO
-
-#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
@@ -79,75 +71,15 @@ Boston, MA 02111-1307, USA. */
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
#endif
-#undef SBSS_SECTION_ASM_OP
-#define SBSS_SECTION_ASM_OP "\t.section .sbss"
-
-/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
- separate, explicit argument. If you define this macro, it is used
- in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
- handling the required alignment of the variable. The alignment is
- specified as the number of bits.
-
- Try to use function `asm_output_aligned_bss' defined in file
- `varasm.c' when defining this macro. */
#ifndef ASM_OUTPUT_ALIGNED_BSS
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
-do { \
- if (SIZE > 0 && SIZE <= (unsigned HOST_WIDE_INT)mips_section_threshold)\
- named_section (0, ".sbss", 0); \
- else \
- bss_section (); \
- ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
- last_assemble_variable_decl = DECL; \
- ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
- ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
-} while (0)
+#define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss
#endif
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
-
-#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h
index 4d672774c4f..f23ec9650cb 100644
--- a/gcc/config/mips/elf64.h
+++ b/gcc/config/mips/elf64.h
@@ -20,11 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#undef OBJECT_FORMAT_COFF
-#undef EXTENDED_COFF
-
-#undef SDB_DEBUGGING_INFO
-#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
@@ -64,49 +59,11 @@ Boston, MA 02111-1307, USA. */
#define TYPE_ASM_OP "\t.type\t"
#define SIZE_ASM_OP "\t.size\t"
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
diff --git a/gcc/config/mips/iris5.h b/gcc/config/mips/iris5.h
index a0d1e936d7e..51f80dcac87 100644
--- a/gcc/config/mips/iris5.h
+++ b/gcc/config/mips/iris5.h
@@ -23,9 +23,6 @@ Boston, MA 02111-1307, USA. */
#define ABICALLS_ASM_OP "\t.option pic2"
-/* IRIX 5 doesn't use COFF, so disable special COFF handling in collect2.c. */
-#undef OBJECT_FORMAT_COFF
-
/* ??? This is correct, but not very useful, because there is no file that
uses this macro. */
/* ??? The best way to handle global constructors under ELF is to use .init
@@ -59,16 +56,23 @@ Boston, MA 02111-1307, USA. */
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|| !strcmp (STR, "rpath"))
+/* We must pass -D_LONGLONG always, even when -ansi is used, because IRIX 5
+ system header files require it. This is OK, because gcc never warns
+ when long long is used in system header files. Alternatively, we can
+ add support for the SGI builtin type __long_long. */
+
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define_std ("host_mips"); \
builtin_define_std ("sgi"); \
builtin_define_std ("unix"); \
builtin_define_std ("SYSTYPE_SVR4"); \
+ builtin_define ("_LONGLONG"); \
builtin_define ("_MODERN_C"); \
builtin_define ("_SVR4_SOURCE"); \
builtin_define ("__DSO__"); \
- builtin_define ("_MIPS_SIM=_MIPS_SIM_ABI32"); \
+ builtin_define ("_ABIO32=1"); \
+ builtin_define ("_MIPS_SIM=_ABIO32"); \
builtin_define ("_MIPS_SZPTR=32"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=svr4"); \
@@ -99,6 +103,18 @@ Boston, MA 02111-1307, USA. */
#undef SUBTARGET_CC1_SPEC
#define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
+/* Override mips.h default: the IRIX 5 assembler warns about -O3:
+
+ as1: Warning: <file>.s, line 1: Binasm file dictates -pic: 2
+ uld:
+ No ucode object file linked -- please use -O2 or lower.
+
+ So avoid passing it in the first place. */
+#undef SUBTARGET_ASM_OPTIMIZING_SPEC
+#define SUBTARGET_ASM_OPTIMIZING_SPEC "\
+%{noasmopt:-O0} \
+%{!noasmopt:%{O|O1|O2|O3:-O2}}"
+
#undef LINK_SPEC
#define LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
@@ -140,7 +156,6 @@ Boston, MA 02111-1307, USA. */
/* We don't support debugging info for now. */
#undef DBX_DEBUGGING_INFO
-#undef SDB_DEBUGGING_INFO
#undef MIPS_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
diff --git a/gcc/config/mips/iris5gas.h b/gcc/config/mips/iris5gas.h
index a38108d861c..f94d1ac7676 100644
--- a/gcc/config/mips/iris5gas.h
+++ b/gcc/config/mips/iris5gas.h
@@ -3,7 +3,6 @@
/* Enable debugging. */
#define DBX_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
-#define SDB_DEBUGGING_INFO 1
#define MIPS_DEBUGGING_INFO 1
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
diff --git a/gcc/config/mips/iris6-o32-as.h b/gcc/config/mips/iris6-o32-as.h
index 6aafc7683d7..5cda89e13cf 100644
--- a/gcc/config/mips/iris6-o32-as.h
+++ b/gcc/config/mips/iris6-o32-as.h
@@ -1,17 +1,6 @@
/* Definitions of target machine for GNU compiler, for MIPS running IRIX 6
(O32 ABI) using the SGI assembler. */
-/* Override mips.h default: the IRIX 6 O32 assembler warns about -O3:
-
- as: Warning: -O3 is not supported for assembly compiles for ucode
- compilers; changing to -O2.
-
- So avoid passing it in the first place. */
-#undef SUBTARGET_ASM_OPTIMIZING_SPEC
-#define SUBTARGET_ASM_OPTIMIZING_SPEC "\
-%{noasmopt:-O0} \
-%{!noasmopt:%{O|O1|O2|O3:-O2}}"
-
/* Enforce use of O32 linker, irrespective of SGI_ABI environment variable
and machine type (e.g., R8000 systems default to -64). Copied from
iris5.h, only adding -32. The default options -call_shared -no_unresolved
diff --git a/gcc/config/mips/iris6-o32.h b/gcc/config/mips/iris6-o32.h
index 20a66946966..a525db163ae 100644
--- a/gcc/config/mips/iris6-o32.h
+++ b/gcc/config/mips/iris6-o32.h
@@ -18,48 +18,6 @@
#undef WINT_TYPE_SIZE
#define WINT_TYPE_SIZE 32
-/* Copied from iris5.h, with _MIPS_SIM definition adapted to SGI cc usage
- and -D_LONGLONG added as in iris6.h. */
-#undef TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define_std ("host_mips"); \
- builtin_define_std ("sgi"); \
- builtin_define_std ("unix"); \
- builtin_define_std ("SYSTYPE_SVR4"); \
- builtin_define ("_LONGLONG"); \
- builtin_define ("_MODERN_C"); \
- builtin_define ("_SVR4_SOURCE"); \
- builtin_define ("__DSO__"); \
- builtin_define ("_ABIO32=1"); \
- builtin_define ("_MIPS_SIM=_ABIO32"); \
- builtin_define ("_MIPS_SZPTR=32"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=svr4"); \
- builtin_assert ("machine=sgi"); \
- \
- if (!TARGET_FLOAT64) \
- builtin_define ("_MIPS_FPSET=16"); \
- else \
- builtin_define ("_MIPS_FPSET=32"); \
- \
- if (!TARGET_INT64) \
- builtin_define ("_MIPS_SZINT=32"); \
- else \
- builtin_define ("_MIPS_SZINT=64"); \
- \
- if (!TARGET_LONG64) \
- builtin_define ("_MIPS_SZLONG=32"); \
- else \
- builtin_define ("_MIPS_SZLONG=64"); \
- \
- if (!flag_iso) \
- { \
- builtin_define ("__EXTENSIONS__"); \
- builtin_define ("_SGI_SOURCE"); \
- } \
-} while (0);
-
/* Enforce use of O32 assembler, irrespective of SGI_ABI environment variable
and machine type (e.g., R8000 systems default to -64). Gas doesn't need
this, but doesn't hurt either. Need to pass -mips2 to gas which defaults
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 0bfc44bd1b5..cf68b418c3d 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -287,7 +287,7 @@ Boston, MA 02111-1307, USA. */
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
const char * \
-current_section_name () \
+current_section_name (void) \
{ \
switch (in_section) \
{ \
@@ -307,7 +307,7 @@ current_section_name () \
} \
\
unsigned int \
-current_section_flags () \
+current_section_flags (void) \
{ \
switch (in_section) \
{ \
@@ -370,51 +370,17 @@ while (0)
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-/* Write the extra assembler code needed to declare an object properly. */
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
-do \
- { \
- HOST_WIDE_INT size; \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (STREAM, NAME, size); \
- } \
- mips_declare_object (STREAM, NAME, "", ":\n", 0); \
- } \
-while (0)
-
/* 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)
-/* Output the size directive for a decl in rest_of_decl_compilation
- in the case where we did not do so before the initializer.
- Once we find the error_mark_node, we know that the value of
- size_directive_output was set
- by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
-do { \
- const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
- HOST_WIDE_INT size; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
- && ! AT_END && TOP_LEVEL \
- && DECL_INITIAL (DECL) == error_mark_node \
- && !size_directive_output) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
- } \
- } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
diff --git a/gcc/config/mips/irix6-libc-compat.c b/gcc/config/mips/irix6-libc-compat.c
index cdac9fafea4..59a148aa865 100644
--- a/gcc/config/mips/irix6-libc-compat.c
+++ b/gcc/config/mips/irix6-libc-compat.c
@@ -1,4 +1,4 @@
-/* Compensate for inconsistent structure passing conventions on IRIX 6. */
+/* Compensate for inconsistent structure return conventions on IRIX 6. */
/* Compile this one with gcc. */
/* Copyright (C) 2001 Free Software Foundation, Inc.
@@ -28,7 +28,7 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* GCC doesn't correctly implement the structure and union passing and return
+/* 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
@@ -38,17 +38,15 @@ Boston, MA 02111-1307, USA. */
While GCC is internally consistent, calling routines compiled with a
compiler that does implement the documented ABI (like SGIs MIPSpro C
compiler) doesn't work. This is primarily an issue for system libraries
- like libc. Fortunately, there exist only very few routines that take
- structure value arguments or return structures by value, so until the
- underlying bug is fixed, it is possible to work around it by providing
- wrapper functions for the few affected routines that compensate for the
- inconsistent alignment.
+ 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 after shifting the arguments or results as required.
+ variants and then shifting the result as required.
This is a rewrite of code created by Andy Polyakov. */
@@ -61,59 +59,14 @@ Boston, MA 02111-1307, USA. */
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-/* The affected arguments need to be shifted by
+/* The affected return values need to be shifted by
- BITS_PER_WORD - (sizeof (arg) * BITS_PER_UNIT).
+ BITS_PER_WORD - (sizeof (value) * BITS_PER_UNIT).
- Since only 32-bit args and results are involved, the shift count is
- always 32. */
+ Since only 32-bit results are involved, the shift count is always 32. */
#define SHIFT_BITS 32
-extern machreg_t inet_ntoa PARAMS ((machreg_t));
-extern machreg_t inet_lnaof PARAMS ((machreg_t));
-extern machreg_t inet_netof PARAMS ((machreg_t));
-extern machreg_t inet_makeaddr PARAMS ((machreg_t, machreg_t));
-
-extern machreg_t _inet_ntoa PARAMS ((machreg_t));
-extern machreg_t _inet_lnaof PARAMS ((machreg_t));
-extern machreg_t _inet_netof PARAMS ((machreg_t));
-extern machreg_t _inet_makeaddr PARAMS ((machreg_t, machreg_t));
-
-/* <arpa/inet.h> has
-
- char *inet_ntoa (struct in_addr);
-
- on both IRIX 6.2 and 6.5, with struct in_addr containing a 32-bit int. */
-
-machreg_t
-inet_ntoa (machreg_t in)
-{
- return _inet_ntoa (in << SHIFT_BITS);
-}
-
-/* <arpa/inet.h> has
-
- unsigned long inet_lnaof (struct in_addr); (IRIX 6.2)
- in_addr_t inet_lnaof (struct in_addr); (IRIX 6.5)
-
- in_addr_t is a 32-bit int. */
-
-machreg_t
-inet_lnaof (machreg_t in)
-{
- return _inet_lnaof (in << SHIFT_BITS);
-}
-
-/* <arpa/inet.h> has
-
- unsigned long inet_netof (struct in_addr); (IRIX 6.2)
- in_addr_t inet_netof (struct in_addr); (IRIX 6.5) */
-
-machreg_t
-inet_netof (machreg_t in)
-{
- return _inet_netof (in << SHIFT_BITS);
-}
+extern machreg_t _inet_makeaddr (machreg_t, machreg_t);
/* <arpa/inet.h> has
@@ -126,23 +79,4 @@ inet_makeaddr (machreg_t net, machreg_t lna)
return _inet_makeaddr (net, lna) >> SHIFT_BITS;
}
-#if _MIPS_SIM == _ABIN32
-extern machreg_t semctl PARAMS ((machreg_t, machreg_t, machreg_t, machreg_t));
-extern machreg_t _semctl PARAMS ((machreg_t, machreg_t, machreg_t, machreg_t));
-
-/* <sys/sem.h> has
-
- int semctl (int, int, int, ...);
-
- where the variadic argument is union semun if used. union semun contains
- an int and two pointers, so the union is already 64 bits wide under the
- N64 ABI and alignment is not an issue. */
-
-machreg_t
-semctl (machreg_t semid, machreg_t semnum, machreg_t cmd, machreg_t arg)
-{
- return _semctl(semid, semnum, cmd, arg << SHIFT_BITS);
-}
-#endif /* _ABIN32 */
-
#endif /* _ABIN32 || _ABI64 */
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 054f5f1a298..70acf11ee99 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -34,49 +34,10 @@ Boston, MA 02111-1307, USA. */
used. */
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-#define SBSS_SECTION_ASM_OP "\t.section .sbss"
-
-/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
- separate, explicit argument. If you define this macro, it is used
- in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
- handling the required alignment of the variable. The alignment is
- specified as the number of bits.
-
- Try to use function `asm_output_aligned_bss' defined in file
- `varasm.c' when defining this macro. */
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
-do { \
- if (SIZE > 0 && (long)(SIZE) <= mips_section_threshold) \
- named_section (0, ".sbss", 0); \
- else \
- bss_section (); \
- ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
- last_assemble_variable_decl = DECL; \
- ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
- ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
-} while (0)
-
-/* These macros generate the special .type and .size directives which
- are used to set the corresponding fields of the linker symbol table
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-/* Write the extra assembler code needed to declare an object properly. */
+#define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
- do { \
- HOST_WIDE_INT size; \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
- size_directive_output = 0; \
- if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
- { \
- size_directive_output = 1; \
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
- } \
- mips_declare_object (FILE, NAME, "", ":\n", 0); \
- } while (0)
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef TARGET_VERSION
#if TARGET_ENDIAN_DEFAULT == 0
@@ -88,9 +49,6 @@ do { \
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
-/* Required to keep collect2.c happy */
-#undef OBJECT_FORMAT_COFF
-
/* If we don't set MASK_ABICALLS, we can't default to PIC. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS)
@@ -226,10 +184,6 @@ do { \
#undef ASM_OUTPUT_REG_PUSH
#undef ASM_OUTPUT_REG_POP
-/* The current Linux binutils uses MIPS_STABS_ELF and doesn't support
- COFF. */
-#undef SDB_DEBUGGING_INFO
-
#undef LIB_SPEC
#define LIB_SPEC "\
%{shared: -lc} \
diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h
index 6ccb496b773..bac5d635c00 100644
--- a/gcc/config/mips/linux64.h
+++ b/gcc/config/mips/linux64.h
@@ -73,12 +73,6 @@ Boston, MA 02111-1307, USA. */
%{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
%{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
-#undef STARTFILE_PREFIX_SPEC
-#define STARTFILE_PREFIX_SPEC "\
-%{mabi=n32: /lib32/ /usr/lib32/} \
-%{mabi=64: /lib64/ /usr/lib64/} \
-%{mabi=32: /lib/ /usr/lib/}"
-
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
? "$" : ".")
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index 217647bbfbd..89a8cb2a420 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -26,144 +26,124 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_MIPS_PROTOS_H
#define GCC_MIPS_PROTOS_H
-extern HOST_WIDE_INT compute_frame_size PARAMS ((HOST_WIDE_INT));
-extern int mips_initial_elimination_offset PARAMS ((int, int));
-extern void iris6_asm_output_align PARAMS ((FILE *, unsigned));
-extern const char * current_section_name PARAMS ((void));
-extern unsigned int current_section_flags PARAMS ((void));
-extern int mips_can_use_return_insn PARAMS ((void));
-extern void mips_declare_object PARAMS ((FILE *, const char *,
- const char *,
- const char *, int));
-extern void mips_expand_epilogue PARAMS ((int));
-extern void mips_expand_prologue PARAMS ((void));
-extern void mips_output_filename PARAMS ((FILE *, const char *));
-extern void mips_output_lineno PARAMS ((FILE *, int));
-extern void mips_output_ascii PARAMS ((FILE *, const char *,
- size_t));
-extern void mips_order_regs_for_local_alloc PARAMS ((void));
-extern struct rtx_def * embedded_pic_fnaddr_reg PARAMS ((void));
-extern struct rtx_def * mips16_gp_pseudo_reg PARAMS ((void));
-#ifdef ASM_OUTPUT_UNDEF_FUNCTION
-extern int mips_output_external_libcall PARAMS ((FILE *, const char *));
-#endif /* ASM_OUTPUT_UNDEF_FUNCTION */
-extern struct rtx_def *mips_function_value PARAMS ((tree, tree,
- enum machine_mode));
-
-extern unsigned int mips_hard_regno_nregs PARAMS ((int,
- enum machine_mode));
-extern int mips_return_in_memory PARAMS ((tree));
-
-extern struct rtx_def *function_arg PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode, tree, int));
-extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern int function_arg_partial_nregs
- PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern int mips_setup_incoming_varargs
- PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern int function_arg_pass_by_reference
- PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode, tree, int));
-extern int mips_output_external PARAMS ((FILE *, tree,
- const char *));
-extern tree mips_build_va_list PARAMS ((void));
-extern void mips_va_start PARAMS ((tree, rtx));
-extern struct rtx_def *mips_va_arg PARAMS ((tree, tree));
-
-extern bool mips_expand_block_move PARAMS ((rtx, rtx, rtx));
-extern bool mips_expand_unaligned_load PARAMS ((rtx, rtx,
- unsigned int,
- int));
-extern bool mips_expand_unaligned_store PARAMS ((rtx, rtx,
- unsigned int,
- int));
-extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *,
- tree, rtx));
-extern void gen_conditional_move PARAMS ((rtx *));
-extern void mips_gen_conditional_trap PARAMS ((rtx *));
-extern void mips_emit_fcc_reload PARAMS ((rtx, rtx, rtx));
-extern void mips_set_return_address PARAMS ((rtx, rtx));
-extern HOST_WIDE_INT mips_debugger_offset PARAMS ((rtx, HOST_WIDE_INT));
-extern rtx mips_subword PARAMS ((rtx, int));
-extern bool mips_split_64bit_move_p PARAMS ((rtx, rtx));
-extern void mips_split_64bit_move PARAMS ((rtx, rtx));
-extern const char *mips_output_move PARAMS ((rtx, rtx));
-extern const char *mips_emit_prefetch PARAMS ((rtx *));
-extern const char *mips_restore_gp PARAMS ((rtx *));
-extern void override_options PARAMS ((void));
-extern void mips_conditional_register_usage PARAMS ((void));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern struct rtx_def * embedded_pic_offset PARAMS ((rtx));
-extern int build_mips16_call_stub PARAMS ((rtx, rtx, rtx, int));
-extern const char *mips_output_load_label PARAMS ((void));
-extern const char *mips_output_conditional_branch PARAMS ((rtx, rtx *,
- int, int, int,
- int));
-extern const char *mips_output_division PARAMS ((const char *, rtx *));
-extern int mips_adjust_insn_length PARAMS ((rtx, int));
-extern enum reg_class mips_secondary_reload_class PARAMS ((enum reg_class,
- enum machine_mode,
- rtx, int));
-extern bool mips_cannot_change_mode_class
- PARAMS ((enum machine_mode, enum machine_mode,
- enum reg_class));
-extern int mips_class_max_nregs PARAMS ((enum reg_class,
- enum machine_mode));
-extern int mips_register_move_cost PARAMS ((enum machine_mode,
- enum reg_class,
- enum reg_class));
-
-extern int se_arith_operand PARAMS ((rtx, enum machine_mode));
-extern int coprocessor_operand PARAMS ((rtx, enum machine_mode));
-extern int coprocessor2_operand PARAMS ((rtx, enum machine_mode));
-extern int mips_address_insns PARAMS ((rtx, enum machine_mode));
-extern int mips_fetch_insns PARAMS ((rtx));
-extern int mips_const_insns PARAMS ((rtx));
-extern bool mips_global_pic_constant_p PARAMS ((rtx));
-extern bool mips_legitimate_address_p PARAMS ((enum machine_mode,
- rtx, int));
-extern bool mips_legitimize_address PARAMS ((rtx *,
- enum machine_mode));
-extern bool mips_legitimize_move PARAMS ((enum machine_mode,
- rtx, rtx));
-extern rtx mips_delegitimize_address PARAMS ((rtx));
-extern void mips_expand_call PARAMS ((rtx, rtx, rtx, rtx, int));
-extern int mips_reg_mode_ok_for_base_p PARAMS ((rtx,
- enum machine_mode,
- int));
-extern bool mips_valid_pointer_mode PARAMS ((enum machine_mode));
-
-extern int m16_uimm3_b PARAMS ((rtx, enum machine_mode));
-extern int m16_simm4_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_nsimm4_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_simm5_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_nsimm5_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_uimm5_4 PARAMS ((rtx, enum machine_mode));
-extern int m16_nuimm5_4 PARAMS ((rtx, enum machine_mode));
-extern int m16_simm8_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_nsimm8_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_uimm8_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_nuimm8_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_uimm8_m1_1 PARAMS ((rtx, enum machine_mode));
-extern int m16_uimm8_4 PARAMS ((rtx, enum machine_mode));
-extern int m16_nuimm8_4 PARAMS ((rtx, enum machine_mode));
-extern int m16_simm8_8 PARAMS ((rtx, enum machine_mode));
-extern int m16_nsimm8_8 PARAMS ((rtx, enum machine_mode));
-extern int m16_usym8_4 PARAMS ((rtx, enum machine_mode));
-extern int m16_usym5_4 PARAMS ((rtx, enum machine_mode));
+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 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);
+extern int m16_nsimm4_1 (rtx, enum machine_mode);
+extern int m16_simm5_1 (rtx, enum machine_mode);
+extern int m16_nsimm5_1 (rtx, enum machine_mode);
+extern int m16_uimm5_4 (rtx, enum machine_mode);
+extern int m16_nuimm5_4 (rtx, enum machine_mode);
+extern int m16_simm8_1 (rtx, enum machine_mode);
+extern int m16_nsimm8_1 (rtx, enum machine_mode);
+extern int m16_uimm8_1 (rtx, enum machine_mode);
+extern int m16_nuimm8_1 (rtx, enum machine_mode);
+extern int m16_uimm8_m1_1 (rtx, enum machine_mode);
+extern int m16_uimm8_4 (rtx, enum machine_mode);
+extern int m16_nuimm8_4 (rtx, enum machine_mode);
+extern int m16_simm8_8 (rtx, enum machine_mode);
+extern int m16_nsimm8_8 (rtx, enum machine_mode);
+extern int m16_usym8_4 (rtx, enum machine_mode);
+extern int m16_usym5_4 (rtx, enum machine_mode);
+extern struct rtx_def *embedded_pic_fnaddr_reg (void);
+extern struct rtx_def *embedded_pic_offset (rtx);
+extern rtx mips_subword (rtx, int);
+extern bool mips_split_64bit_move_p (rtx, rtx);
+extern void mips_split_64bit_move (rtx, rtx);
+extern const char *mips_output_move (rtx, rtx);
+extern const char *mips_restore_gp (rtx *);
#ifdef RTX_CODE
-extern rtx gen_int_relational PARAMS ((enum rtx_code, rtx, rtx,
- rtx,int *));
-extern void gen_conditional_branch PARAMS ((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
-extern rtx mips_return_addr PARAMS ((int, rtx));
+extern void gen_conditional_move (rtx *);
+extern void mips_gen_conditional_trap (rtx *);
+extern void mips_expand_call (rtx, rtx, rtx, rtx, int);
+extern void mips_emit_fcc_reload (rtx, rtx, rtx);
+extern void mips_set_return_address (rtx, rtx);
+extern bool mips_expand_block_move (rtx, rtx, rtx);
+
+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 (const CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+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);
+
+extern bool mips_expand_unaligned_load (rtx, rtx, unsigned int, int);
+extern bool mips_expand_unaligned_store (rtx, rtx, unsigned int, int);
+extern void override_options (void);
+extern void mips_conditional_register_usage (void);
+extern void mips_order_regs_for_local_alloc (void);
+extern HOST_WIDE_INT mips_debugger_offset (rtx, HOST_WIDE_INT);
+
+extern void print_operand (FILE *, rtx, int);
+extern void print_operand_address (FILE *, rtx);
+extern int mips_output_external (FILE *, tree, const char *);
+#ifdef ASM_OUTPUT_UNDEF_FUNCTION
+extern int mips_output_external_libcall (FILE *, const char *);
+#endif
+extern void mips_output_filename (FILE *, const char *);
+extern void mips_output_lineno (FILE *, int);
+extern void mips_output_ascii (FILE *, const char *, size_t);
+extern void mips_output_aligned_bss (FILE *, tree, const char *,
+ unsigned HOST_WIDE_INT, int);
+extern void mips_declare_object (FILE *, const char *, const char *,
+ const char *, int);
+extern void mips_declare_object_name (FILE *, const char *, tree);
+extern void mips_finish_declare_object (FILE *, tree, int, int);
+
+extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT);
+extern 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);
+extern int mips_can_use_return_insn (void);
+extern struct rtx_def *mips_function_value (tree, tree, enum machine_mode);
+extern int function_arg_pass_by_reference (const CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+
+extern bool mips_cannot_change_mode_class (enum machine_mode,
+ enum machine_mode, enum reg_class);
+extern enum reg_class mips_secondary_reload_class (enum reg_class,
+ enum machine_mode,
+ rtx, int);
+extern int mips_class_max_nregs (enum reg_class, enum machine_mode);
+extern bool mips_valid_pointer_mode (enum machine_mode);
+extern struct rtx_def *mips16_gp_pseudo_reg (void);
+extern int build_mips16_call_stub (rtx, rtx, rtx, int);
+extern int mips_register_move_cost (enum machine_mode, enum reg_class,
+ enum reg_class);
+
+extern int mips_adjust_insn_length (rtx, int);
+extern const char *mips_output_load_label (void);
+extern const char *mips_output_conditional_branch (rtx, rtx *, int, int,
+ int, int);
+extern const char *mips_output_division (const char *, rtx *);
+extern unsigned int mips_hard_regno_nregs (int, enum machine_mode);
+extern int mips_return_in_memory (tree);
+extern const char *mips_emit_prefetch (rtx *);
+
+extern void iris6_asm_output_align (FILE *, unsigned);
+extern const char *current_section_name (void);
+extern unsigned int current_section_flags (void);
#endif /* ! GCC_MIPS_PROTOS_H */
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index eeef802ab3c..8bd2139d9ef 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1,4 +1,4 @@
-/* Subroutines for insn-output.c for MIPS
+/* Subroutines used for MIPS code generation.
Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by A. Lichnewsky, lich@inria.inria.fr.
@@ -23,10 +23,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* ??? The TARGET_FP_CALL_32 macros are intended to simulate a 32 bit
- calling convention in 64 bit mode. It doesn't work though, and should
- be replaced with something better designed. */
-
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -56,37 +52,32 @@ Boston, MA 02111-1307, USA. */
#include "target-def.h"
#include "integrate.h"
-#ifdef __GNU_STAB__
-#define STAB_CODE_TYPE enum __stab_debug_code
-#else
-#define STAB_CODE_TYPE int
-#endif
-
-extern tree lookup_name PARAMS ((tree));
-
/* Enumeration for all of the relational tests, so that we can build
arrays indexed by the test type, and not worry about the order
of EQ, NE, etc. */
enum internal_test {
- ITEST_EQ,
- ITEST_NE,
- ITEST_GT,
- ITEST_GE,
- ITEST_LT,
- ITEST_LE,
- ITEST_GTU,
- ITEST_GEU,
- ITEST_LTU,
- ITEST_LEU,
- ITEST_MAX
- };
+ ITEST_EQ,
+ ITEST_NE,
+ ITEST_GT,
+ ITEST_GE,
+ ITEST_LT,
+ ITEST_LE,
+ ITEST_GTU,
+ ITEST_GEU,
+ ITEST_LTU,
+ ITEST_LEU,
+ ITEST_MAX
+};
/* Return true if it is likely that the given mode will be accessed
using only a single instruction. */
#define SINGLE_WORD_MODE_P(MODE) \
((MODE) != BLKmode && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD)
+/* True if the given SYMBOL_REF is for an internally-generated symbol. */
+#define INTERNAL_SYMBOL_P(SYM) \
+ (XSTR (SYM, 0)[0] == '*' && XSTR (SYM, 0)[1] == LOCAL_LABEL_PREFIX[0])
/* Classifies a non-literal integer constant.
@@ -179,127 +170,101 @@ struct mips_arg_info;
struct mips_constant_info;
struct mips_address_info;
struct mips_integer_op;
-static enum mips_constant_type mips_classify_constant
- PARAMS ((struct mips_constant_info *, rtx));
-static enum mips_symbol_type mips_classify_symbol
- PARAMS ((rtx));
-static bool mips_valid_base_register_p
- PARAMS ((rtx, enum machine_mode, int));
-static bool mips_symbolic_address_p
- PARAMS ((rtx, HOST_WIDE_INT,
- enum machine_mode, int));
-static enum mips_address_type mips_classify_address
- PARAMS ((struct mips_address_info *,
- rtx, enum machine_mode, int, int));
-static enum internal_test map_test_to_internal_test PARAMS ((enum rtx_code));
-static void get_float_compare_codes PARAMS ((enum rtx_code, enum rtx_code *,
- enum rtx_code *));
-static const char *mips_reloc_string PARAMS ((int));
-static bool mips_splittable_symbol_p PARAMS ((enum mips_symbol_type));
-static int mips_symbol_insns PARAMS ((enum mips_symbol_type));
-static bool mips16_unextended_reference_p
- PARAMS ((enum machine_mode mode,
- rtx, rtx));
-static rtx mips_force_temporary PARAMS ((rtx, rtx));
-static rtx mips_add_offset PARAMS ((rtx, HOST_WIDE_INT));
-static rtx mips_load_got PARAMS ((rtx, rtx, int));
-static rtx mips_load_got16 PARAMS ((rtx, int));
-static rtx mips_load_got32 PARAMS ((rtx, rtx, int, int));
-static rtx mips_emit_high PARAMS ((rtx, rtx));
-static bool mips_legitimize_symbol PARAMS ((rtx, rtx *, int));
-static rtx mips_reloc PARAMS ((rtx, int));
-static rtx mips_lui_reloc PARAMS ((rtx, int));
-static unsigned int mips_build_shift PARAMS ((struct mips_integer_op *,
- HOST_WIDE_INT));
-static unsigned int mips_build_lower PARAMS ((struct mips_integer_op *,
- unsigned HOST_WIDE_INT));
-static unsigned int mips_build_integer PARAMS ((struct mips_integer_op *,
- unsigned HOST_WIDE_INT));
-static void mips_move_integer PARAMS ((rtx, unsigned HOST_WIDE_INT));
-static void mips_legitimize_const_move PARAMS ((enum machine_mode,
- rtx, rtx));
-static int m16_check_op PARAMS ((rtx, int, int, int));
-static bool mips_function_ok_for_sibcall PARAMS ((tree, tree));
-static void mips_block_move_straight PARAMS ((rtx, rtx,
- HOST_WIDE_INT));
-static void mips_adjust_block_mem PARAMS ((rtx, HOST_WIDE_INT,
- rtx *, rtx *));
-static void mips_block_move_loop PARAMS ((rtx, rtx,
- HOST_WIDE_INT));
-static void mips_arg_info PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int,
- struct mips_arg_info *));
-static bool mips_get_unaligned_mem PARAMS ((rtx *, unsigned int,
- int, rtx *, rtx *));
-static unsigned int mips_global_pointer PARAMS ((void));
-static bool mips_save_reg_p PARAMS ((unsigned int));
-static rtx mips_add_large_offset_to_sp PARAMS ((HOST_WIDE_INT));
-static void mips_set_frame_expr PARAMS ((rtx));
-static rtx mips_frame_set PARAMS ((rtx, int));
-static void mips_emit_frame_related_store PARAMS ((rtx, rtx,
- HOST_WIDE_INT));
-static void save_restore_insns PARAMS ((int, rtx, long));
-static void mips_gp_insn PARAMS ((rtx, rtx));
-static void mips16_fp_args PARAMS ((FILE *, int, int));
-static void build_mips16_function_stub PARAMS ((FILE *));
-static void mips16_optimize_gp PARAMS ((void));
-static rtx add_constant PARAMS ((struct constant **,
- rtx,
- enum machine_mode));
-static void dump_constants PARAMS ((struct constant *,
- rtx));
-static rtx mips_find_symbol PARAMS ((rtx));
-static void mips16_lay_out_constants PARAMS ((void));
-static void mips_avoid_hazard PARAMS ((rtx, rtx, int *,
- rtx *, rtx));
-static void mips_avoid_hazards PARAMS ((void));
-static void mips_reorg PARAMS ((void));
-static void abort_with_insn PARAMS ((rtx, const char *))
- ATTRIBUTE_NORETURN;
-static int symbolic_expression_p PARAMS ((rtx));
-static bool mips_assemble_integer PARAMS ((rtx, unsigned int, int));
-static void mips_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void mips_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void mips_set_architecture PARAMS ((const struct mips_cpu_info *));
-static void mips_set_tune PARAMS ((const struct mips_cpu_info *));
-static bool mips_strict_matching_cpu_name_p PARAMS ((const char *,
- const char *));
-static bool mips_matching_cpu_name_p PARAMS ((const char *,
- const char *));
-static const struct mips_cpu_info *mips_parse_cpu PARAMS ((const char *,
- const char *));
-static const struct mips_cpu_info *mips_cpu_info_from_isa PARAMS ((int));
+static enum mips_constant_type
+ mips_classify_constant (struct mips_constant_info *, rtx);
+static enum mips_symbol_type mips_classify_symbol (rtx);
+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);
+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_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);
+static unsigned int mips_build_integer (struct mips_integer_op *,
+ unsigned HOST_WIDE_INT);
+static void mips_move_integer (rtx, unsigned HOST_WIDE_INT);
+static void mips_legitimize_const_move (enum machine_mode, rtx, rtx);
+static int m16_check_op (rtx, int, int, int);
+static bool mips_rtx_costs (rtx, int, int, int *);
+static int mips_address_cost (rtx);
+static enum internal_test map_test_to_internal_test (enum rtx_code);
+static void get_float_compare_codes (enum rtx_code, enum rtx_code *,
+ enum rtx_code *);
+static bool mips_function_ok_for_sibcall (tree, tree);
+static void mips_block_move_straight (rtx, rtx, HOST_WIDE_INT);
+static void mips_adjust_block_mem (rtx, HOST_WIDE_INT, rtx *, rtx *);
+static void mips_block_move_loop (rtx, rtx, HOST_WIDE_INT);
+static void mips_arg_info (const CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int, struct mips_arg_info *);
+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 bool mips_assemble_integer (rtx, unsigned int, int);
+static void mips_file_start (void);
+static void mips_file_end (void);
+static unsigned int mips_global_pointer (void);
+static bool mips_save_reg_p (unsigned int);
+static rtx mips_add_large_offset_to_sp (HOST_WIDE_INT);
+static void mips_set_frame_expr (rtx);
+static rtx mips_frame_set (rtx, int);
+static void mips_emit_frame_related_store (rtx, rtx, HOST_WIDE_INT);
+static void save_restore_insns (int, rtx, long);
+static void mips_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void mips_gp_insn (rtx, rtx);
+static void mips_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static int symbolic_expression_p (rtx);
+static void mips_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT);
+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 void mips16_fp_args (FILE *, int, int);
+static void build_mips16_function_stub (FILE *);
+static void mips16_optimize_gp (void);
+static rtx add_constant (struct constant **, rtx, enum machine_mode);
+static void dump_constants (struct constant *, rtx);
+static rtx mips_find_symbol (rtx);
+static void mips16_lay_out_constants (void);
+static void mips_avoid_hazard (rtx, rtx, int *, rtx *, rtx);
+static void mips_avoid_hazards (void);
+static void mips_reorg (void);
+static bool mips_strict_matching_cpu_name_p (const char *, const char *);
+static bool mips_matching_cpu_name_p (const char *, const char *);
+static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *);
+static const struct mips_cpu_info *mips_cpu_info_from_isa (int);
+static int mips_adjust_cost (rtx, rtx, rtx, int);
+static int mips_issue_rate (void);
+static int mips_use_dfa_pipeline_interface (void);
+
#ifdef TARGET_IRIX6
-static void copy_file_data PARAMS ((FILE *, FILE *));
-static void iris6_asm_named_section_1 PARAMS ((const char *,
- unsigned int,
- unsigned int));
-static void iris6_asm_named_section PARAMS ((const char *,
- unsigned int));
-static int iris_section_align_entry_eq PARAMS ((const void *, const void *));
-static hashval_t iris_section_align_entry_hash PARAMS ((const void *));
-static int iris6_section_align_1 PARAMS ((void **, void *));
-static void iris6_file_start PARAMS ((void));
-static void iris6_file_end PARAMS ((void));
-static unsigned int iris6_section_type_flags PARAMS ((tree, const char *,
- int));
+static void iris6_asm_named_section_1 (const char *, unsigned int,
+ unsigned int);
+static void iris6_asm_named_section (const char *, unsigned int);
+static int iris_section_align_entry_eq (const void *, const void *);
+static hashval_t iris_section_align_entry_hash (const void *);
+static void iris6_file_start (void);
+static int iris6_section_align_1 (void **, void *);
+static void copy_file_data (FILE *, FILE *);
+static void iris6_file_end (void);
+static unsigned int iris6_section_type_flags (tree, const char *, int);
#endif
-static int mips_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int mips_issue_rate PARAMS ((void));
-
-static struct machine_function * mips_init_machine_status PARAMS ((void));
-static void mips_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT))
- ATTRIBUTE_UNUSED;
-static void mips_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT));
-static int mips_use_dfa_pipeline_interface PARAMS ((void));
-static bool mips_rtx_costs PARAMS ((rtx, int, int, int *));
-static int mips_address_cost PARAMS ((rtx));
-static bool mips_in_small_data_p PARAMS ((tree));
-static void mips_encode_section_info PARAMS ((tree, rtx, int));
-static void mips_file_start PARAMS ((void));
-static void mips_file_end PARAMS ((void));
/* Structure to be filled in by compute_frame_size with register
save masks, and offsets for the current function. */
@@ -324,8 +289,7 @@ struct mips_frame_info GTY(())
struct machine_function GTY(()) {
/* Pseudo-reg holding the address of the current function when
- generating embedded PIC code. Created by LEGITIMIZE_ADDRESS,
- used by mips_finalize_pic if it was created. */
+ generating embedded PIC code. */
rtx embedded_pic_fnaddr_rtx;
/* Pseudo-reg holding the value of $28 in a mips16 function which
@@ -353,9 +317,6 @@ struct machine_function GTY(()) {
/* Information about a single argument. */
struct mips_arg_info
{
- /* True if the argument is a record or union type. */
- bool struct_p;
-
/* True if the argument is passed in a floating-point register, or
would have been if we hadn't run out of registers. */
bool fpr_p;
@@ -450,9 +411,7 @@ struct mips_integer_op {
/* Global variables for machine-dependent things. */
/* Threshold for data being put into the small data/bss area, instead
- of the normal data area (references to the small data/bss area take
- 1 instruction, and use the global pointer, references to the normal
- data area takes 2 instructions). */
+ of the normal data area. */
int mips_section_threshold = -1;
/* Count the number of .file directives, so that .loc is up to date. */
@@ -465,10 +424,6 @@ int sdb_label_count = 0;
/* Next label # for each statement for Silicon Graphics IRIS systems. */
int sym_lineno = 0;
-/* Nonzero if inside of a function, because the stupid MIPS asm can't
- handle .files inside of functions. */
-int inside_function = 0;
-
/* Linked list of all externals that are to be emitted when optimizing
for the global pointer if they haven't been declared by the end of
the program with an appropriate .comm or initialization. */
@@ -485,14 +440,6 @@ static GTY (()) struct extern_list *extern_head = 0;
/* Name of the file containing the current function. */
const char *current_function_file = "";
-/* Warning given that Mips ECOFF can't support changing files
- within a function. */
-int file_in_function_warning = FALSE;
-
-/* Whether to suppress issuing .loc's because the user attempted
- to change the filename within a function. */
-int ignore_line_number = FALSE;
-
/* Number of nested .set noreorder, noat, nomacro, and volatile requests. */
int set_noreorder;
int set_noat;
@@ -517,10 +464,10 @@ const struct mips_cpu_info *mips_arch_info;
enum processor_type mips_tune;
const struct mips_cpu_info *mips_tune_info;
-/* which instruction set architecture to use. */
+/* Which instruction set architecture to use. */
int mips_isa;
-/* which abi to use. */
+/* Which ABI to use. */
int mips_abi;
/* Strings to hold which cpu and instruction set architecture to use. */
@@ -529,15 +476,6 @@ const char *mips_tune_string; /* for -mtune=<xxx> */
const char *mips_isa_string; /* for -mips{1,2,3,4} */
const char *mips_abi_string; /* for -mabi={32,n32,64,eabi} */
-/* Whether we are generating mips16 code. This is a synonym for
- TARGET_MIPS16, and exists for use as an attribute. */
-int mips16;
-
-/* This variable is set by -mno-mips16. We only care whether
- -mno-mips16 appears or not, and using a string in this fashion is
- just a way to avoid using up another bit in target_flags. */
-const char *mips_no_mips16_string;
-
/* Whether we are generating mips16 hard float code. In mips16 mode
we always set TARGET_SOFT_FLOAT; this variable is nonzero if
-msoft-float was not specified by the user, which means that we
@@ -557,9 +495,6 @@ int mips_entry;
/* If TRUE, we split addresses into their high and low parts in the RTL. */
int mips_split_addresses;
-/* Generating calls to position independent functions? */
-enum mips_abicalls_type mips_abicalls;
-
/* Mode used for saving/restoring general purpose registers. */
static enum machine_mode gpr_mode;
@@ -711,73 +646,7 @@ const enum reg_class mips_regno_to_class[] =
};
/* Map register constraint character to register class. */
-enum reg_class mips_char_to_class[256] =
-{
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
- NO_REGS, NO_REGS, NO_REGS, NO_REGS,
-};
+enum reg_class mips_char_to_class[256];
/* A table describing all the processors gcc knows about. Names are
matched in the order listed. The first mention of an ISA level is
@@ -819,6 +688,8 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
{ "vr5000", PROCESSOR_R5000, 4 },
{ "vr5400", PROCESSOR_R5400, 4 },
{ "vr5500", PROCESSOR_R5500, 4 },
+ { "rm7000", PROCESSOR_R7000, 4 },
+ { "rm9000", PROCESSOR_R9000, 4 },
/* MIPS32 */
{ "4kc", PROCESSOR_4KC, 32 },
@@ -918,9 +789,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
store its components in INFO and return its type. */
static enum mips_constant_type
-mips_classify_constant (info, x)
- struct mips_constant_info *info;
- rtx x;
+mips_classify_constant (struct mips_constant_info *info, rtx x)
{
info->offset = 0;
info->symbol = x;
@@ -966,8 +835,7 @@ mips_classify_constant (info, x)
/* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF. */
static enum mips_symbol_type
-mips_classify_symbol (x)
- rtx x;
+mips_classify_symbol (rtx x)
{
if (GET_CODE (x) == LABEL_REF)
return (TARGET_ABICALLS ? SYMBOL_GOT_LOCAL : SYMBOL_GENERAL);
@@ -989,9 +857,7 @@ mips_classify_symbol (x)
return SYMBOL_GENERAL;
}
- if (XSTR (x, 0)[0] == '*'
- && strncmp (XSTR (x, 0) + 1, LOCAL_LABEL_PREFIX,
- sizeof LOCAL_LABEL_PREFIX - 1) == 0)
+ if (INTERNAL_SYMBOL_P (x))
{
/* The symbol is a local label. For TARGET_MIPS16, SYMBOL_REF_FLAG
will be set if the symbol refers to a string in the current
@@ -1016,10 +882,7 @@ mips_classify_symbol (x)
/* This function is used to implement REG_MODE_OK_FOR_BASE_P. */
int
-mips_reg_mode_ok_for_base_p (reg, mode, strict)
- rtx reg;
- enum machine_mode mode;
- int strict;
+mips_reg_mode_ok_for_base_p (rtx reg, enum machine_mode mode, int strict)
{
return (strict
? REGNO_MODE_OK_FOR_BASE_P (REGNO (reg), mode)
@@ -1031,10 +894,7 @@ mips_reg_mode_ok_for_base_p (reg, mode, strict)
Allow only hard registers if STRICT. */
static bool
-mips_valid_base_register_p (x, mode, strict)
- rtx x;
- enum machine_mode mode;
- int strict;
+mips_valid_base_register_p (rtx x, enum machine_mode mode, int strict)
{
if (!strict && GET_CODE (x) == SUBREG)
x = SUBREG_REG (x);
@@ -1059,11 +919,8 @@ mips_valid_base_register_p (x, mode, strict)
it is better to move the address into a register first. */
static bool
-mips_symbolic_address_p (symbol, offset, mode, lea_p)
- rtx symbol;
- HOST_WIDE_INT offset;
- enum machine_mode mode;
- int lea_p;
+mips_symbolic_address_p (rtx symbol, HOST_WIDE_INT offset,
+ enum machine_mode mode, int lea_p)
{
if (TARGET_EXPLICIT_RELOCS)
return false;
@@ -1110,11 +967,8 @@ mips_symbolic_address_p (symbol, offset, mode, lea_p)
the same as for mips_symbolic_address_p. */
static enum mips_address_type
-mips_classify_address (info, x, mode, strict, lea_p)
- struct mips_address_info *info;
- rtx x;
- enum machine_mode mode;
- int strict, lea_p;
+mips_classify_address (struct mips_address_info *info, rtx x,
+ enum machine_mode mode, int strict, int lea_p)
{
switch (GET_CODE (x))
{
@@ -1176,8 +1030,7 @@ mips_classify_address (info, x, mode, strict, lea_p)
HIGH/LO_SUM pair. */
static bool
-mips_splittable_symbol_p (type)
- enum mips_symbol_type type;
+mips_splittable_symbol_p (enum mips_symbol_type type)
{
if (TARGET_EXPLICIT_RELOCS)
return (type == SYMBOL_GENERAL || type == SYMBOL_GOT_LOCAL);
@@ -1193,8 +1046,7 @@ mips_splittable_symbol_p (type)
mips16 instructions as two instructions. */
static int
-mips_symbol_insns (type)
- enum mips_symbol_type type;
+mips_symbol_insns (enum mips_symbol_type type)
{
switch (type)
{
@@ -1229,7 +1081,7 @@ mips_symbol_insns (type)
daddu $at,$at,$gp
and the final address is $at + %got_lo(symbol). */
- return (flag_pic == 1 ? 1 : 3);
+ return (TARGET_XGOT ? 3 : 1);
case SYMBOL_GOT_LOCAL:
/* For o32 and o64, the sequence is:
@@ -1257,9 +1109,7 @@ mips_symbol_insns (type)
stack pointer, which have an 8-bit immediate field. */
static bool
-mips16_unextended_reference_p (mode, base, offset)
- enum machine_mode mode;
- rtx base, offset;
+mips16_unextended_reference_p (enum machine_mode mode, rtx base, rtx offset)
{
if (TARGET_MIPS16
&& GET_CODE (offset) == CONST_INT
@@ -1280,9 +1130,7 @@ mips16_unextended_reference_p (mode, base, offset)
For mips16 code, count extended instructions as two instructions. */
int
-mips_address_insns (x, mode)
- rtx x;
- enum machine_mode mode;
+mips_address_insns (rtx x, enum machine_mode mode)
{
struct mips_address_info addr;
int factor;
@@ -1314,8 +1162,7 @@ mips_address_insns (x, mode)
/* Likewise for constant X. */
int
-mips_const_insns (x)
- rtx x;
+mips_const_insns (rtx x)
{
struct mips_constant_info c;
struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS];
@@ -1369,8 +1216,7 @@ mips_const_insns (x)
Count extended mips16 instructions as two instructions. */
int
-mips_fetch_insns (x)
- rtx x;
+mips_fetch_insns (rtx x)
{
if (GET_CODE (x) != MEM)
abort ();
@@ -1383,8 +1229,7 @@ mips_fetch_insns (x)
global PIC symbol. */
bool
-mips_global_pic_constant_p (op)
- rtx op;
+mips_global_pic_constant_p (rtx op)
{
struct mips_constant_info c;
@@ -1397,9 +1242,7 @@ mips_global_pic_constant_p (op)
where a register or 16 bit unsigned integer is needed. */
int
-uns_arith_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+uns_arith_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT && SMALL_INT_UNSIGNED (op))
return 1;
@@ -1411,9 +1254,7 @@ uns_arith_operand (op, mode)
/* True if OP can be treated as a signed 16-bit constant. */
int
-const_arith_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_arith_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
struct mips_constant_info c;
@@ -1422,79 +1263,28 @@ const_arith_operand (op, mode)
}
-/* Return truth value of whether OP can be used as an operands
- where a 16 bit integer is needed */
+/* Return true if OP is a register operand or a signed 16-bit constant. */
int
-arith_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith_operand (rtx op, enum machine_mode mode)
{
return const_arith_operand (op, mode) || register_operand (op, mode);
}
-/* Return truth value of whether OP can be used as an operand in a two
- address arithmetic insn (such as set 123456,%o4) of mode MODE. */
-
-int
-arith32_operand (op, mode)
- rtx op;
- enum machine_mode mode;
-{
- if (GET_CODE (op) == CONST_INT)
- return 1;
-
- return register_operand (op, mode);
-}
-
/* Return truth value of whether OP is an integer which fits in 16 bits. */
int
-small_int (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && SMALL_INT (op));
}
-/* Return truth value of whether OP is a 32 bit integer which is too big to
- be loaded with one instruction. */
-
-int
-large_int (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
-{
- HOST_WIDE_INT value;
-
- if (GET_CODE (op) != CONST_INT)
- return 0;
-
- value = INTVAL (op);
-
- /* ior reg,$r0,value */
- if ((value & ~ ((HOST_WIDE_INT) 0x0000ffff)) == 0)
- return 0;
-
- /* subu reg,$r0,value */
- if (((unsigned HOST_WIDE_INT) (value + 32768)) <= 32767)
- return 0;
-
- /* lui reg,value>>16 */
- if ((value & 0x0000ffff) == 0)
- return 0;
-
- return 1;
-}
-
/* Return truth value of whether OP is a register or the constant 0.
- In mips16 mode, we only accept a register, since the mips16 does
- not have $0. */
+ Do not accept 0 in mips16 mode since $0 is not one of the core 8
+ registers. */
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))
{
@@ -1513,21 +1303,22 @@ reg_or_0_operand (op, mode)
}
}
-/* Return truth value of whether OP is a register or the constant 0,
- even in mips16 mode. */
+/* Accept a register or the floating point constant 1 in the appropriate mode. */
int
-true_reg_or_0_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_const_float_1_operand (rtx op, enum machine_mode mode)
{
+ REAL_VALUE_TYPE d;
+
switch (GET_CODE (op))
{
- case CONST_INT:
- return INTVAL (op) == 0;
-
case CONST_DOUBLE:
- return op == CONST0_RTX (mode);
+ if (mode != GET_MODE (op)
+ || (mode != DFmode && mode != SFmode))
+ return 0;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (d, op);
+ return REAL_VALUES_EQUAL (d, dconst1);
default:
return register_operand (op, mode);
@@ -1537,9 +1328,7 @@ true_reg_or_0_operand (op, mode)
/* Accept the floating point constant 1 in the appropriate mode. */
int
-const_float_1_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+const_float_1_operand (rtx op, enum machine_mode mode)
{
REAL_VALUE_TYPE d;
@@ -1556,9 +1345,7 @@ const_float_1_operand (op, mode)
/* Return true if OP is either the HI or LO register. */
int
-hilo_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+hilo_operand (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || mode == GET_MODE (op))
&& REG_P (op) && MD_REG_P (REGNO (op)));
@@ -1567,9 +1354,7 @@ hilo_operand (op, mode)
/* Return true if OP is an extension operator. */
int
-extend_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+extend_operator (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || mode == GET_MODE (op))
&& (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND));
@@ -1578,9 +1363,7 @@ extend_operator (op, mode)
/* Return nonzero if the code of this rtx pattern is EQ or NE. */
int
-equality_op (op, mode)
- rtx op;
- enum machine_mode mode;
+equality_op (rtx op, enum machine_mode mode)
{
if (mode != GET_MODE (op))
return 0;
@@ -1591,9 +1374,7 @@ equality_op (op, mode)
/* Return nonzero if the code is a relational operations (EQ, LE, etc.) */
int
-cmp_op (op, mode)
- rtx op;
- enum machine_mode mode;
+cmp_op (rtx op, enum machine_mode mode)
{
if (mode != GET_MODE (op))
return 0;
@@ -1607,9 +1388,7 @@ cmp_op (op, mode)
combine from erroneously altering the condition. */
int
-trap_cmp_op (op, mode)
- rtx op;
- enum machine_mode mode;
+trap_cmp_op (rtx op, enum machine_mode mode)
{
if (mode != GET_MODE (op))
return 0;
@@ -1632,9 +1411,7 @@ trap_cmp_op (op, mode)
/* Return nonzero if the operand is either the PC or a label_ref. */
int
-pc_or_label_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+pc_or_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (op == pc_rtx)
return 1;
@@ -1648,9 +1425,7 @@ pc_or_label_operand (op, mode)
/* Test for a valid call address. */
int
-call_insn_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_insn_operand (rtx op, enum machine_mode mode)
{
struct mips_constant_info c;
@@ -1680,9 +1455,7 @@ call_insn_operand (op, mode)
instruction. */
int
-move_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_operand (rtx op, enum machine_mode mode)
{
struct mips_constant_info c;
@@ -1702,43 +1475,16 @@ move_operand (op, mode)
accepted by LEGITIMATE_CONSTANT, such as arbitrary SYMBOL_REFs. */
int
-consttable_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+consttable_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return CONSTANT_P (op);
}
-/* Coprocessor operand; return true if rtx is a REG and refers to a
- coprocessor. */
-
-int
-coprocessor_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
-{
- return (GET_CODE (op) == REG
- && COP0_REG_FIRST <= REGNO (op)
- && REGNO (op) <= COP3_REG_LAST);
-}
-
-int
-coprocessor2_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
-{
- return (GET_CODE (op) == REG
- && COP2_REG_FIRST <= REGNO (op)
- && REGNO (op) <= COP2_REG_LAST);
-}
-
-/* Returns 1 if OP is a symbolic operand, i.e. a symbol_ref or a label_ref,
+/* Return 1 if OP is a symbolic operand, i.e. a symbol_ref or a label_ref,
possibly with an offset. */
int
-symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
struct mips_constant_info c;
@@ -1752,10 +1498,7 @@ symbolic_operand (op, mode)
is called during reload. */
bool
-mips_legitimate_address_p (mode, x, strict)
- enum machine_mode mode;
- rtx x;
- int strict;
+mips_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
{
struct mips_address_info addr;
@@ -1767,9 +1510,7 @@ mips_legitimate_address_p (mode, x, strict)
RELOC to symbolic address ADDR. */
static rtx
-mips_reloc (addr, reloc)
- rtx addr;
- int reloc;
+mips_reloc (rtx addr, int reloc)
{
struct mips_constant_info c;
rtx x;
@@ -1786,9 +1527,7 @@ mips_reloc (addr, reloc)
used as the right hand side of an LUISI or LUIDI pattern. */
static rtx
-mips_lui_reloc (addr, reloc)
- rtx addr;
- int reloc;
+mips_lui_reloc (rtx addr, int reloc)
{
return gen_rtx_UNSPEC (Pmode,
gen_rtvec (1, mips_reloc (addr, reloc)),
@@ -1802,8 +1541,7 @@ mips_lui_reloc (addr, reloc)
The operation happens in Pmode. */
static rtx
-mips_force_temporary (dest, value)
- rtx dest, value;
+mips_force_temporary (rtx dest, rtx value)
{
if (dest == 0)
return force_reg (Pmode, value);
@@ -1820,9 +1558,7 @@ mips_force_temporary (dest, value)
create a temporary register if OFFSET is not a SMALL_OPERAND. */
static rtx
-mips_add_offset (reg, offset)
- rtx reg;
- HOST_WIDE_INT offset;
+mips_add_offset (rtx reg, HOST_WIDE_INT offset)
{
if (!SMALL_OPERAND (offset))
reg = expand_simple_binop (GET_MODE (reg), PLUS,
@@ -1838,9 +1574,7 @@ mips_add_offset (reg, offset)
sought and RELOC is the relocation that should be used. */
static rtx
-mips_load_got (base, addr, reloc)
- rtx base, addr;
- int reloc;
+mips_load_got (rtx base, rtx addr, int reloc)
{
rtx mem;
@@ -1864,9 +1598,7 @@ mips_load_got (base, addr, reloc)
The returned address may be used on the right hand side of a SET. */
static rtx
-mips_load_got16 (addr, reloc)
- rtx addr;
- int reloc;
+mips_load_got16 (rtx addr, int reloc)
{
return mips_load_got (pic_offset_table_rtx, addr, reloc);
}
@@ -1878,9 +1610,7 @@ mips_load_got16 (addr, reloc)
to use a temporary, or null if new registers can be created at will. */
static rtx
-mips_load_got32 (temp, addr, high_reloc, low_reloc)
- rtx temp, addr;
- int high_reloc, low_reloc;
+mips_load_got32 (rtx temp, rtx addr, int high_reloc, int low_reloc)
{
rtx x;
@@ -1895,8 +1625,7 @@ mips_load_got32 (temp, addr, high_reloc, low_reloc)
Use DEST as the register if non-null. */
static rtx
-mips_emit_high (dest, addr)
- rtx dest, addr;
+mips_emit_high (rtx dest, rtx addr)
{
rtx high, x;
@@ -1923,9 +1652,7 @@ mips_emit_high (dest, addr)
can be created at will. */
static bool
-mips_legitimize_symbol (dest, xloc, offsetable_p)
- rtx dest, *xloc;
- int offsetable_p;
+mips_legitimize_symbol (rtx dest, rtx *xloc, int offsetable_p)
{
struct mips_constant_info c;
enum mips_symbol_type symbol_type;
@@ -1995,9 +1722,7 @@ mips_legitimize_symbol (dest, xloc, offsetable_p)
the memory being accessed. */
bool
-mips_legitimize_address (xloc, mode)
- rtx *xloc;
- enum machine_mode mode;
+mips_legitimize_address (rtx *xloc, enum machine_mode mode)
{
if (mips_legitimize_symbol (0, xloc, !SINGLE_WORD_MODE_P (mode)))
return true;
@@ -2022,9 +1747,7 @@ mips_legitimize_address (xloc, mode)
Assume that the final action in the sequence should be a left shift. */
static unsigned int
-mips_build_shift (codes, value)
- struct mips_integer_op *codes;
- HOST_WIDE_INT value;
+mips_build_shift (struct mips_integer_op *codes, HOST_WIDE_INT value)
{
unsigned int i, shift;
@@ -2045,9 +1768,7 @@ mips_build_shift (codes, value)
an IOR or PLUS operation. */
static unsigned int
-mips_build_lower (codes, value)
- struct mips_integer_op *codes;
- unsigned HOST_WIDE_INT value;
+mips_build_lower (struct mips_integer_op *codes, unsigned HOST_WIDE_INT value)
{
unsigned HOST_WIDE_INT high;
unsigned int i;
@@ -2078,9 +1799,8 @@ mips_build_lower (codes, value)
Return the number of operations needed. */
static unsigned int
-mips_build_integer (codes, value)
- struct mips_integer_op *codes;
- unsigned HOST_WIDE_INT value;
+mips_build_integer (struct mips_integer_op *codes,
+ unsigned HOST_WIDE_INT value)
{
if (SMALL_OPERAND (value)
|| SMALL_OPERAND_UNSIGNED (value)
@@ -2128,9 +1848,7 @@ mips_build_integer (codes, value)
/* Move VALUE into register DEST. */
static void
-mips_move_integer (dest, value)
- rtx dest;
- unsigned HOST_WIDE_INT value;
+mips_move_integer (rtx dest, unsigned HOST_WIDE_INT value)
{
struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS];
enum machine_mode mode;
@@ -2161,9 +1879,7 @@ mips_move_integer (dest, value)
move_operand. */
static void
-mips_legitimize_const_move (mode, dest, src)
- enum machine_mode mode;
- rtx dest, src;
+mips_legitimize_const_move (enum machine_mode mode, rtx dest, rtx src)
{
rtx temp;
@@ -2187,10 +1903,10 @@ mips_legitimize_const_move (mode, dest, src)
&& GET_CODE (src) == SYMBOL_REF
&& mips_classify_symbol (src) == SYMBOL_GOT_GLOBAL)
{
- if (flag_pic == 1)
- src = mips_load_got16 (src, RELOC_GOT_DISP);
- else
+ 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));
return;
}
@@ -2221,9 +1937,7 @@ mips_legitimize_const_move (mode, dest, src)
sequence that is valid. */
bool
-mips_legitimize_move (mode, dest, src)
- enum machine_mode mode;
- rtx dest, src;
+mips_legitimize_move (enum machine_mode mode, rtx dest, rtx src)
{
if (!register_operand (dest, mode) && !reg_or_0_operand (src, mode))
{
@@ -2248,11 +1962,10 @@ mips_legitimize_move (mode, dest, src)
/* Convert GOT and GP-relative accesses back into their original form.
- Used by bothh TARGET_DELEGITIMIZE_ADDRESS and FIND_BASE_TERM. */
+ Used by both TARGET_DELEGITIMIZE_ADDRESS and FIND_BASE_TERM. */
rtx
-mips_delegitimize_address (x)
- rtx x;
+mips_delegitimize_address (rtx x)
{
struct mips_constant_info c;
@@ -2278,11 +1991,7 @@ mips_delegitimize_address (x)
there aren't nearly enough letters available. */
static int
-m16_check_op (op, low, high, mask)
- rtx op;
- int low;
- int high;
- int mask;
+m16_check_op (rtx op, int low, int high, int mask)
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) >= low
@@ -2291,129 +2000,97 @@ m16_check_op (op, low, high, mask)
}
int
-m16_uimm3_b (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_uimm3_b (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, 0x1, 0x8, 0);
}
int
-m16_simm4_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_simm4_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0x8, 0x7, 0);
}
int
-m16_nsimm4_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_nsimm4_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0x7, 0x8, 0);
}
int
-m16_simm5_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_simm5_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0x10, 0xf, 0);
}
int
-m16_nsimm5_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_nsimm5_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0xf, 0x10, 0);
}
int
-m16_uimm5_4 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_uimm5_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, (- 0x10) << 2, 0xf << 2, 3);
}
int
-m16_nuimm5_4 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_nuimm5_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, (- 0xf) << 2, 0x10 << 2, 3);
}
int
-m16_simm8_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_simm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0x80, 0x7f, 0);
}
int
-m16_nsimm8_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_nsimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0x7f, 0x80, 0);
}
int
-m16_uimm8_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_uimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, 0x0, 0xff, 0);
}
int
-m16_nuimm8_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_nuimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0xff, 0x0, 0);
}
int
-m16_uimm8_m1_1 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_uimm8_m1_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, - 0x1, 0xfe, 0);
}
int
-m16_uimm8_4 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_uimm8_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, 0x0, 0xff << 2, 3);
}
int
-m16_nuimm8_4 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_nuimm8_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, (- 0xff) << 2, 0x0, 3);
}
int
-m16_simm8_8 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_simm8_8 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, (- 0x80) << 3, 0x7f << 3, 7);
}
int
-m16_nsimm8_8 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_nsimm8_8 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return m16_check_op (op, (- 0x7f) << 3, 0x80 << 3, 7);
}
@@ -2424,16 +2101,12 @@ m16_nsimm8_8 (op, mode)
referencing instruction. */
int
-m16_usym8_4 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_usym8_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == SYMBOL_REF
&& SYMBOL_REF_FLAG (op)
&& cfun->machine->insns_len > 0
- && XSTR (op, 0)[0] == '*'
- && strncmp (XSTR (op, 0) + 1, LOCAL_LABEL_PREFIX,
- sizeof LOCAL_LABEL_PREFIX - 1) == 0
+ && INTERNAL_SYMBOL_P (op)
&& (cfun->machine->insns_len + get_pool_size () + mips_string_length
< 4 * 0x100))
{
@@ -2451,16 +2124,12 @@ m16_usym8_4 (op, mode)
}
int
-m16_usym5_4 (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m16_usym5_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == SYMBOL_REF
&& SYMBOL_REF_FLAG (op)
&& cfun->machine->insns_len > 0
- && XSTR (op, 0)[0] == '*'
- && strncmp (XSTR (op, 0) + 1, LOCAL_LABEL_PREFIX,
- sizeof LOCAL_LABEL_PREFIX - 1) == 0
+ && INTERNAL_SYMBOL_P (op)
&& (cfun->machine->insns_len + get_pool_size () + mips_string_length
< 4 * 0x20))
{
@@ -2478,10 +2147,7 @@ m16_usym5_4 (op, mode)
}
static bool
-mips_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+mips_rtx_costs (rtx x, int code, int outer_code, int *total)
{
enum machine_mode mode = GET_MODE (x);
@@ -2508,8 +2174,8 @@ mips_rtx_costs (x, code, outer_code, total)
*total = COSTS_N_INSNS (1);
return true;
}
- /* We can use cmpi for an xor with an unsigned 16 bit value. */
+ /* We can use cmpi for an xor with an unsigned 16 bit value. */
if ((outer_code) == XOR
&& INTVAL (x) >= 0 && INTVAL (x) < 0x10000)
{
@@ -2673,6 +2339,10 @@ mips_rtx_costs (x, code, outer_code, total)
*total = COSTS_N_INSNS (2);
else if (TUNE_MIPS5400 || TUNE_MIPS5500)
*total = COSTS_N_INSNS ((mode == DImode) ? 4 : 3);
+ else if (TUNE_MIPS7000)
+ *total = COSTS_N_INSNS (mode == DImode ? 9 : 5);
+ else if (TUNE_MIPS9000)
+ *total = COSTS_N_INSNS (mode == DImode ? 8 : 3);
else if (TUNE_MIPS6000)
*total = COSTS_N_INSNS (17);
else if (TUNE_MIPS5000)
@@ -2755,8 +2425,7 @@ mips_rtx_costs (x, code, outer_code, total)
If ADDR is not a valid address, its cost is irrelevant. */
static int
-mips_address_cost (addr)
- rtx addr;
+mips_address_cost (rtx addr)
{
return mips_address_insns (addr, SImode);
}
@@ -2766,7 +2435,7 @@ mips_address_cost (addr)
pseudo is emitted in the beginning of the function. */
rtx
-embedded_pic_fnaddr_reg ()
+embedded_pic_fnaddr_reg (void)
{
if (cfun->machine->embedded_pic_fnaddr_rtx == NULL)
{
@@ -2799,8 +2468,7 @@ embedded_pic_fnaddr_reg ()
X is the symbol whose offset from the current function we want. */
rtx
-embedded_pic_offset (x)
- rtx x;
+embedded_pic_offset (rtx x)
{
/* Make sure it is emitted. */
embedded_pic_fnaddr_reg ();
@@ -2816,9 +2484,7 @@ embedded_pic_offset (x)
false to select the low part. */
rtx
-mips_subword (op, high_p)
- rtx op;
- int high_p;
+mips_subword (rtx op, int high_p)
{
unsigned int byte;
enum machine_mode mode;
@@ -2850,8 +2516,7 @@ mips_subword (op, high_p)
/* Return true if a 64-bit move from SRC to DEST should be split into two. */
bool
-mips_split_64bit_move_p (dest, src)
- rtx dest, src;
+mips_split_64bit_move_p (rtx dest, rtx src)
{
if (TARGET_64BIT)
return false;
@@ -2889,8 +2554,7 @@ mips_split_64bit_move_p (dest, src)
load_df_high and store_df_high instead. */
void
-mips_split_64bit_move (dest, src)
- rtx dest, src;
+mips_split_64bit_move (rtx dest, rtx src)
{
if (FP_REG_RTX_P (dest))
{
@@ -2930,8 +2594,7 @@ mips_split_64bit_move (dest, src)
that SRC is operand 1 and DEST is operand 0. */
const char *
-mips_output_move (dest, src)
- rtx dest, src;
+mips_output_move (rtx dest, rtx src)
{
enum rtx_code dest_code, src_code;
struct mips_constant_info c;
@@ -3066,8 +2729,7 @@ mips_output_move (dest, src)
on entry. */
const char *
-mips_restore_gp (operands)
- rtx *operands;
+mips_restore_gp (rtx *operands)
{
rtx loc;
@@ -3086,8 +2748,7 @@ mips_restore_gp (operands)
/* Make normal rtx_code into something we can index from an array */
static enum internal_test
-map_test_to_internal_test (test_code)
- enum rtx_code test_code;
+map_test_to_internal_test (enum rtx_code test_code)
{
enum internal_test test = ITEST_MAX;
@@ -3129,16 +2790,16 @@ map_test_to_internal_test (test_code)
return i < 5;
}
- */
+ TEST_CODE is the rtx code for the comparison.
+ CMP0 and CMP1 are the two operands to compare.
+ RESULT is the register in which the result should be stored (null for
+ branches).
+ For branches, P_INVERT points to an integer that is nonzero on return
+ if the branch should be inverted. */
rtx
-gen_int_relational (test_code, result, cmp0, cmp1, p_invert)
- enum rtx_code test_code; /* relational test (EQ, etc) */
- rtx result; /* result to store comp. or 0 if branch */
- rtx cmp0; /* first operand to compare */
- rtx cmp1; /* second operand to compare */
- int *p_invert; /* NULL or ptr to hold whether branch needs */
- /* to reverse its test */
+gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0,
+ rtx cmp1, int *p_invert)
{
struct cmp_info
{
@@ -3334,8 +2995,8 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert)
and *action_code to the branch or move code. */
static void
-get_float_compare_codes (in_code, cmp_code, action_code)
- enum rtx_code in_code, *cmp_code, *action_code;
+get_float_compare_codes (enum rtx_code in_code, enum rtx_code *cmp_code,
+ enum rtx_code *action_code)
{
switch (in_code)
{
@@ -3360,9 +3021,7 @@ get_float_compare_codes (in_code, cmp_code, action_code)
The comparison operands are saved away by cmp{si,di,sf,df}. */
void
-gen_conditional_branch (operands, test_code)
- rtx operands[];
- enum rtx_code test_code;
+gen_conditional_branch (rtx *operands, enum rtx_code test_code)
{
enum cmp_type type = branch_type;
rtx cmp0 = branch_cmp[0];
@@ -3412,7 +3071,7 @@ gen_conditional_branch (operands, test_code)
break;
default:
- abort_with_insn (gen_rtx (test_code, VOIDmode, cmp0, cmp1), "bad test");
+ fatal_insn ("bad test", gen_rtx (test_code, VOIDmode, cmp0, cmp1));
}
/* Generate the branch. */
@@ -3434,11 +3093,10 @@ gen_conditional_branch (operands, test_code)
}
/* Emit the common code for conditional moves. OPERANDS is the array
- of operands passed to the conditional move defined_expand. */
+ of operands passed to the conditional move define_expand. */
void
-gen_conditional_move (operands)
- rtx *operands;
+gen_conditional_move (rtx *operands)
{
rtx op0 = branch_cmp[0];
rtx op1 = branch_cmp[1];
@@ -3520,12 +3178,11 @@ gen_conditional_move (operands)
operands[2], operands[3])));
}
-/* Emit the common code for conditional moves. OPERANDS is the array
- of operands passed to the conditional move defined_expand. */
+/* Emit a conditional trap. OPERANDS is the array of operands passed to
+ the conditional_trap expander. */
void
-mips_gen_conditional_trap (operands)
- rtx operands[];
+mips_gen_conditional_trap (rtx *operands)
{
rtx op0, op1;
enum rtx_code cmp_code = GET_CODE (operands[0]);
@@ -3565,15 +3222,11 @@ mips_gen_conditional_trap (operands)
function, ARGS_SIZE is the size of the arguments and AUX is
the value passed to us by mips_function_arg. SIBCALL_P is true
if we are expanding a sibling call, false if we're expanding
- normal call. */
+ a normal call. */
void
-mips_expand_call (result, addr, args_size, aux, sibcall_p)
- rtx result, addr, args_size, aux;
- int sibcall_p;
+mips_expand_call (rtx result, rtx addr, rtx args_size, rtx aux, int sibcall_p)
{
- int i;
-
if (!call_insn_operand (addr, VOIDmode))
{
/* When generating PIC, try to allow global functions to be
@@ -3582,24 +3235,14 @@ mips_expand_call (result, addr, args_size, aux, sibcall_p)
&& GET_CODE (addr) == SYMBOL_REF
&& mips_classify_symbol (addr) == SYMBOL_GOT_GLOBAL)
{
- if (flag_pic == 1)
- addr = mips_load_got16 (addr, RELOC_CALL16);
- else
+ if (TARGET_XGOT)
addr = mips_load_got32 (0, addr, RELOC_CALL_HI, RELOC_CALL_LO);
+ else
+ addr = mips_load_got16 (addr, RELOC_CALL16);
}
addr = force_reg (Pmode, addr);
}
- /* In order to pass small structures by value in registers
- compatibly with the MIPS compiler, we need to shift the value
- into the high part of the register. 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. */
- if (aux != 0 && GET_CODE (aux) == PARALLEL)
- for (i = 0; i < XVECLEN (aux, 0); i++)
- emit_insn (XVECEXP (aux, 0, i));
-
if (TARGET_MIPS16
&& mips16_hard_float
&& build_mips16_call_stub (result, addr, args_size,
@@ -3630,9 +3273,8 @@ mips_expand_call (result, addr, args_size, aux, sibcall_p)
/* We can handle any sibcall when TARGET_SIBCALLS is true. */
static bool
-mips_function_ok_for_sibcall (decl, exp)
- tree decl ATTRIBUTE_UNUSED;
- tree exp ATTRIBUTE_UNUSED;
+mips_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
+ tree exp ATTRIBUTE_UNUSED)
{
return TARGET_SIBCALLS;
}
@@ -3641,9 +3283,7 @@ mips_function_ok_for_sibcall (decl, exp)
Only for use during or after reload. */
int
-fcc_register_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fcc_register_operand (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || mode == GET_MODE (op))
&& (reload_in_progress || reload_completed)
@@ -3663,8 +3303,7 @@ fcc_register_operand (op, mode)
taken from SCRATCH. */
void
-mips_emit_fcc_reload (dest, src, scratch)
- rtx dest, src, scratch;
+mips_emit_fcc_reload (rtx dest, rtx src, rtx scratch)
{
rtx fp1, fp2;
@@ -3687,8 +3326,7 @@ mips_emit_fcc_reload (dest, src, scratch)
ADDRESS and SCRATCH are both word-mode GPRs. */
void
-mips_set_return_address (address, scratch)
- rtx address, scratch;
+mips_set_return_address (rtx address, rtx scratch)
{
HOST_WIDE_INT gp_offset;
@@ -3716,9 +3354,7 @@ mips_set_return_address (address, scratch)
Assume that the areas do not overlap. */
static void
-mips_block_move_straight (dest, src, length)
- rtx dest, src;
- HOST_WIDE_INT length;
+mips_block_move_straight (rtx dest, rtx src, HOST_WIDE_INT length)
{
HOST_WIDE_INT offset, delta;
unsigned HOST_WIDE_INT bits;
@@ -3792,9 +3428,8 @@ mips_block_move_straight (dest, src, length)
register. Store them in *LOOP_REG and *LOOP_MEM respectively. */
static void
-mips_adjust_block_mem (mem, length, loop_reg, loop_mem)
- rtx mem, *loop_reg, *loop_mem;
- HOST_WIDE_INT length;
+mips_adjust_block_mem (rtx mem, HOST_WIDE_INT length,
+ rtx *loop_reg, rtx *loop_mem)
{
*loop_reg = copy_addr_to_reg (XEXP (mem, 0));
@@ -3810,9 +3445,7 @@ mips_adjust_block_mem (mem, length, loop_reg, loop_mem)
memory regions do not overlap. */
static void
-mips_block_move_loop (dest, src, length)
- rtx dest, src;
- HOST_WIDE_INT length;
+mips_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length)
{
rtx label, src_reg, dest_reg, final_src;
HOST_WIDE_INT leftover;
@@ -3855,8 +3488,7 @@ mips_block_move_loop (dest, src, length)
/* Expand a movstrsi instruction. */
bool
-mips_expand_block_move (dest, src, length)
- rtx dest, src, length;
+mips_expand_block_move (rtx dest, rtx src, rtx length)
{
if (GET_CODE (length) == CONST_INT)
{
@@ -3879,10 +3511,8 @@ mips_expand_block_move (dest, src, length)
/* Initialize CUMULATIVE_ARGS for a function. */
void
-init_cumulative_args (cum, fntype, libname)
- CUMULATIVE_ARGS *cum; /* argument info to initialize */
- tree fntype; /* tree ptr for function decl */
- rtx libname ATTRIBUTE_UNUSED; /* SYMBOL_REF of library name or 0 */
+init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
+ rtx libname ATTRIBUTE_UNUSED)
{
static CUMULATIVE_ARGS zero_cum;
tree param, next_param;
@@ -3921,45 +3551,40 @@ init_cumulative_args (cum, fntype, libname)
}
}
+
+/* Fill INFO with information about a single argument. CUM is the
+ cumulative state for earlier arguments. MODE is the mode of this
+ argument and TYPE is its type (if known). NAMED is true if this
+ is a named (fixed) argument rather than a variable one. */
+
static void
-mips_arg_info (cum, mode, type, named, info)
- const CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
- struct mips_arg_info *info;
+mips_arg_info (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named, struct mips_arg_info *info)
{
bool even_reg_p;
unsigned int num_words, max_regs;
- info->struct_p = (type != 0
- && (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE));
-
/* Decide whether this argument should go in a floating-point register,
assuming one is free. Later code checks for availability. */
- info->fpr_p = false;
- if (GET_MODE_CLASS (mode) == MODE_FLOAT
- && GET_MODE_SIZE (mode) <= UNITS_PER_FPVALUE)
- {
- switch (mips_abi)
- {
- case ABI_32:
- case ABI_O64:
- info->fpr_p = (!cum->gp_reg_found && cum->arg_number < 2);
- break;
+ info->fpr_p = (GET_MODE_CLASS (mode) == MODE_FLOAT
+ && GET_MODE_SIZE (mode) <= UNITS_PER_FPVALUE);
- case ABI_EABI:
- info->fpr_p = true;
- break;
+ if (info->fpr_p)
+ switch (mips_abi)
+ {
+ case ABI_32:
+ case ABI_O64:
+ info->fpr_p = (!cum->gp_reg_found
+ && cum->arg_number < 2
+ && (type == 0 || FLOAT_TYPE_P (type)));
+ break;
- default:
- info->fpr_p = named;
- break;
- }
- }
+ case ABI_N32:
+ case ABI_64:
+ info->fpr_p = (named && (type == 0 || FLOAT_TYPE_P (type)));
+ break;
+ }
/* Now decide whether the argument must go in an even-numbered register. */
@@ -4013,49 +3638,16 @@ mips_arg_info (cum, mode, type, named, info)
}
-/* Advance the argument to the next argument position. */
+/* Implement FUNCTION_ARG_ADVANCE. */
void
-function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum; /* current arg information */
- enum machine_mode mode; /* current arg mode */
- tree type; /* type of the argument or 0 if lib support */
- int named; /* whether or not the argument was named */
+function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named)
{
struct mips_arg_info info;
mips_arg_info (cum, mode, type, named, &info);
- /* The following is a hack in order to pass 1 byte structures
- the same way that the MIPS compiler does (namely by passing
- the structure in the high byte or half word of the register).
- This also makes varargs work. If we have such a structure,
- we save the adjustment RTL, and the call define expands will
- emit them. For the VOIDmode argument (argument after the
- last real argument), pass back a parallel vector holding each
- of the adjustments. */
-
- /* ??? This scheme requires everything smaller than the word size to
- shifted to the left, but when TARGET_64BIT and ! TARGET_INT64,
- that would mean every int needs to be shifted left, which is very
- inefficient. Let's not carry this compatibility to the 64 bit
- calling convention for now. */
-
- if (info.struct_p
- && info.reg_words == 1
- && info.num_bytes < UNITS_PER_WORD
- && !TARGET_64BIT
- && mips_abi != ABI_EABI)
- {
- rtx amount = GEN_INT (BITS_PER_WORD - info.num_bytes * BITS_PER_UNIT);
- rtx reg = gen_rtx_REG (word_mode, GP_ARG_FIRST + info.reg_offset);
-
- if (TARGET_64BIT)
- cum->adjust[cum->num_adjusts++] = PATTERN (gen_ashldi3 (reg, reg, amount));
- else
- cum->adjust[cum->num_adjusts++] = PATTERN (gen_ashlsi3 (reg, reg, amount));
- }
-
if (!info.fpr_p)
cum->gp_reg_found = true;
@@ -4076,32 +3668,21 @@ function_arg_advance (cum, mode, type, named)
cum->arg_number++;
}
-/* Return an RTL expression containing the register for the given mode,
- or 0 if the argument is to be passed on the stack. */
+/* Implement FUNCTION_ARG. */
struct rtx_def *
-function_arg (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum; /* current arg information */
- enum machine_mode mode; /* current arg mode */
- tree type; /* type of the argument or 0 if lib support */
- int named; /* != 0 for normal args, == 0 for ... args */
+function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named)
{
struct mips_arg_info info;
/* We will be called with a mode of VOIDmode after the last argument
has been seen. Whatever we return will be passed to the call
- insn. If we need any shifts for small structures, return them in
- a PARALLEL; in that case, stuff the mips16 fp_code in as the
- mode. Otherwise, if we need a mips16 fp_code, return a REG
- with the code stored as the mode. */
+ insn. If we need a mips16 fp_code, return a REG with the code
+ stored as the mode. */
if (mode == VOIDmode)
{
- if (cum->num_adjusts > 0)
- return gen_rtx_PARALLEL ((enum machine_mode) cum->fp_code,
- gen_rtvec_v (cum->num_adjusts,
- (rtx *) cum->adjust));
-
- else if (TARGET_MIPS16 && cum->fp_code != 0)
+ if (TARGET_MIPS16 && cum->fp_code != 0)
return gen_rtx_REG ((enum machine_mode) cum->fp_code, 0);
else
@@ -4119,8 +3700,7 @@ function_arg (cum, mode, type, named)
&& (mips_abi == ABI_N32 || mips_abi == ABI_64)
&& TYPE_SIZE_UNIT (type)
&& host_integerp (TYPE_SIZE_UNIT (type), 1)
- && named
- && mode != DFmode)
+ && named)
{
/* The Irix 6 n32/n64 ABIs say that if any 64 bit chunk of the
structure contains a double in its entirety, then that 64 bit
@@ -4185,32 +3765,75 @@ function_arg (cum, mode, type, named)
return gen_rtx_REG (mode, GP_ARG_FIRST + info.reg_offset);
}
+
+/* Implement FUNCTION_ARG_PARTIAL_NREGS. */
+
int
-function_arg_partial_nregs (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum; /* current arg information */
- enum machine_mode mode; /* current arg mode */
- tree type; /* type of the argument or 0 if lib support */
- int named; /* != 0 for normal args, == 0 for ... args */
+function_arg_partial_nregs (const CUMULATIVE_ARGS *cum,
+ enum machine_mode mode, tree type, int named)
{
struct mips_arg_info info;
mips_arg_info (cum, mode, type, named, &info);
return info.stack_words > 0 ? info.reg_words : 0;
}
+
+
+/* Return true if FUNCTION_ARG_PADDING (MODE, TYPE) should return
+ upward rather than downward. In other words, return true if the
+ first byte of the stack slot has useful data, false if the last
+ byte does. */
+
+bool
+mips_pad_arg_upward (enum machine_mode mode, tree type)
+{
+ /* On little-endian targets, the first byte of every stack argument
+ is passed in the first byte of the stack slot. */
+ if (!BYTES_BIG_ENDIAN)
+ return true;
+
+ /* Otherwise, integral types are padded downward: the last byte of a
+ stack argument is passed in the last byte of the stack slot. */
+ if (type != 0
+ ? INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type)
+ : GET_MODE_CLASS (mode) == MODE_INT)
+ return false;
+
+ /* Other types are padded upward for o32, o64, n32 and n64. */
+ if (mips_abi != ABI_EABI)
+ return true;
+
+ /* Arguments smaller than a stack slot are padded downward. */
+ if (mode != BLKmode)
+ return (GET_MODE_BITSIZE (mode) >= PARM_BOUNDARY);
+ else
+ return (int_size_in_bytes (type) >= (PARM_BOUNDARY / BITS_PER_UNIT));
+}
+
+
+/* Likewise BLOCK_REG_PADDING (MODE, TYPE, ...). Return !BYTES_BIG_ENDIAN
+ if the least significant byte of the register has useful data. Return
+ the opposite if the most significant byte does. */
+
+bool
+mips_pad_reg_upward (enum machine_mode mode, tree type)
+{
+ /* No shifting is required for floating-point arguments. */
+ if (type != 0 ? FLOAT_TYPE_P (type) : GET_MODE_CLASS (mode) == MODE_FLOAT)
+ return !BYTES_BIG_ENDIAN;
+
+ /* Otherwise, apply the same padding to register arguments as we do
+ to stack arguments. */
+ return mips_pad_arg_upward (mode, type);
+}
int
-mips_setup_incoming_varargs (cum, mode, type, no_rtl)
- const CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int no_rtl;
+mips_setup_incoming_varargs (const CUMULATIVE_ARGS *cum,
+ enum machine_mode mode, tree type, int no_rtl)
{
CUMULATIVE_ARGS local_cum;
int gp_saved, fp_saved;
- if (mips_abi == ABI_32 || mips_abi == ABI_O64)
- return 0;
-
/* The caller has advanced CUM up to, but not beyond, the last named
argument. Advance a local copy of CUM past the last "real" named
argument, to find out how many registers are left over. */
@@ -4231,19 +3854,22 @@ mips_setup_incoming_varargs (cum, mode, type, no_rtl)
rtx ptr, mem;
ptr = virtual_incoming_args_rtx;
- if (mips_abi == ABI_EABI)
- ptr = plus_constant (ptr, -gp_saved * UNITS_PER_WORD);
- mem = gen_rtx_MEM (BLKmode, ptr);
+ switch (mips_abi)
+ {
+ case ABI_32:
+ case ABI_O64:
+ ptr = plus_constant (ptr, local_cum.num_gprs * UNITS_PER_WORD);
+ break;
- /* va_arg is an array access in this case, which causes
- it to get MEM_IN_STRUCT_P set. We must set it here
- so that the insn scheduler won't assume that these
- stores can't possibly overlap with the va_arg loads. */
- if (mips_abi != ABI_EABI && BYTES_BIG_ENDIAN)
- MEM_SET_IN_STRUCT_P (mem, 1);
+ case ABI_EABI:
+ ptr = plus_constant (ptr, -gp_saved * UNITS_PER_WORD);
+ break;
+ }
+ mem = gen_rtx_MEM (BLKmode, ptr);
+ set_mem_alias_set (mem, get_varargs_alias_set ());
- move_block_from_reg (local_cum.num_gprs + GP_ARG_FIRST, mem,
- gp_saved);
+ move_block_from_reg (local_cum.num_gprs + GP_ARG_FIRST,
+ mem, gp_saved);
}
if (fp_saved > 0)
{
@@ -4263,13 +3889,20 @@ mips_setup_incoming_varargs (cum, mode, type, no_rtl)
for (i = local_cum.num_fprs; i < MAX_ARGS_IN_REGISTERS; i += FP_INC)
{
- rtx ptr = plus_constant (virtual_incoming_args_rtx, off);
- emit_move_insn (gen_rtx_MEM (mode, ptr),
- gen_rtx_REG (mode, FP_ARG_FIRST + i));
+ rtx ptr, mem;
+
+ ptr = plus_constant (virtual_incoming_args_rtx, off);
+ mem = gen_rtx_MEM (mode, ptr);
+ set_mem_alias_set (mem, get_varargs_alias_set ());
+ emit_move_insn (mem, gen_rtx_REG (mode, FP_ARG_FIRST + i));
off += UNITS_PER_HWFPVALUE;
}
}
}
+ if (mips_abi == ABI_32 || mips_abi == ABI_O64)
+ /* No need for pretend arguments: the register parameter area was
+ allocated by the caller. */
+ return 0;
return (gp_saved * UNITS_PER_WORD) + (fp_saved * UNITS_PER_FPREG);
}
@@ -4295,7 +3928,7 @@ mips_setup_incoming_varargs (cum, mode, type, no_rtl)
tree
-mips_build_va_list ()
+mips_build_va_list (void)
{
if (EABI_FLOAT_VARARGS_P)
{
@@ -4342,12 +3975,10 @@ mips_build_va_list ()
return ptr_type_node;
}
-/* Implement va_start. stdarg_p is always 1. */
+/* Implement va_start. */
void
-mips_va_start (valist, nextarg)
- tree valist;
- rtx nextarg;
+mips_va_start (tree valist, rtx nextarg)
{
const CUMULATIVE_ARGS *cum = &current_function_args_info;
@@ -4440,148 +4071,10 @@ mips_va_start (valist, nextarg)
std_expand_builtin_va_start (valist, nextarg);
}
-/* Return true if it is possible to use left/right accesses for a
- bitfield of WIDTH bits starting BITPOS bits into *OP. When
- returning true, update *OP, *LEFT and *RIGHT as follows:
-
- *OP is a BLKmode reference to the whole field.
-
- *LEFT is a QImode reference to the first byte if big endian or
- the last byte if little endian. This address can be used in the
- left-side instructions (lwl, swl, ldl, sdl).
-
- *RIGHT is a QImode reference to the opposite end of the field and
- can be used in the parterning right-side instruction. */
-
-static bool
-mips_get_unaligned_mem (op, width, bitpos, left, right)
- rtx *op, *left, *right;
- unsigned int width;
- int bitpos;
-{
- rtx first, last;
-
- /* Check that the operand really is a MEM. Not all the extv and
- extzv predicates are checked. */
- if (GET_CODE (*op) != MEM)
- return false;
-
- /* Check that the size is valid. */
- if (width != 32 && (!TARGET_64BIT || width != 64))
- return false;
-
- /* We can only access byte-aligned values. Since we are always passed
- a reference to the first byte of the field, it is not necessary to
- do anything with BITPOS after this check. */
- if (bitpos % BITS_PER_UNIT != 0)
- return false;
-
- /* Reject aligned bitfields: we want to use a normal load or store
- instead of a left/right pair. */
- if (MEM_ALIGN (*op) >= width)
- return false;
-
- /* Adjust *OP to refer to the whole field. This also has the effect
- of legitimizing *OP's address for BLKmode, possibly simplifying it. */
- *op = adjust_address (*op, BLKmode, 0);
- set_mem_size (*op, GEN_INT (width / BITS_PER_UNIT));
-
- /* Get references to both ends of the field. We deliberately don't
- use the original QImode *OP for FIRST since the new BLKmode one
- might have a simpler address. */
- first = adjust_address (*op, QImode, 0);
- last = adjust_address (*op, QImode, width / BITS_PER_UNIT - 1);
-
- /* Allocate to LEFT and RIGHT according to endiannes. LEFT should
- be the upper word and RIGHT the lower word. */
- if (TARGET_BIG_ENDIAN)
- *left = first, *right = last;
- else
- *left = last, *right = first;
-
- return true;
-}
-
-
-/* Try to emit the equivalent of (set DEST (zero_extract SRC WIDTH BITPOS)).
- Return true on success. We only handle cases where zero_extract is
- equivalent to sign_extract. */
-
-bool
-mips_expand_unaligned_load (dest, src, width, bitpos)
- rtx dest, src;
- unsigned int width;
- int bitpos;
-{
- rtx left, right;
-
- /* If TARGET_64BIT, the destination of a 32-bit load will be a
- paradoxical word_mode subreg. This is the only case in which
- we allow the destination to be larger than the source. */
- if (GET_CODE (dest) == SUBREG
- && GET_MODE (dest) == DImode
- && SUBREG_BYTE (dest) == 0
- && GET_MODE (SUBREG_REG (dest)) == SImode)
- dest = SUBREG_REG (dest);
-
- /* After the above adjustment, the destination must be the same
- width as the source. */
- if (GET_MODE_BITSIZE (GET_MODE (dest)) != width)
- return false;
-
- if (!mips_get_unaligned_mem (&src, width, bitpos, &left, &right))
- return false;
-
- if (GET_MODE (dest) == DImode)
- {
- emit_insn (gen_mov_ldl (dest, src, left));
- emit_insn (gen_mov_ldr (copy_rtx (dest), copy_rtx (src),
- right, copy_rtx (dest)));
- }
- else
- {
- emit_insn (gen_mov_lwl (dest, src, left));
- emit_insn (gen_mov_lwr (copy_rtx (dest), copy_rtx (src),
- right, copy_rtx (dest)));
- }
- return true;
-}
-
-
-/* Try to expand (set (zero_extract DEST WIDTH BITPOS) SRC). Return
- true on success. */
-
-bool
-mips_expand_unaligned_store (dest, src, width, bitpos)
- rtx dest, src;
- unsigned int width;
- int bitpos;
-{
- rtx left, right;
-
- if (!mips_get_unaligned_mem (&dest, width, bitpos, &left, &right))
- return false;
-
- src = gen_lowpart (mode_for_size (width, MODE_INT, 0), src);
-
- if (GET_MODE (src) == DImode)
- {
- emit_insn (gen_mov_sdl (dest, src, left));
- emit_insn (gen_mov_sdr (copy_rtx (dest), copy_rtx (src), right));
- }
- else
- {
- emit_insn (gen_mov_swl (dest, src, left));
- emit_insn (gen_mov_swr (copy_rtx (dest), copy_rtx (src), right));
- }
- return true;
-}
-
/* Implement va_arg. */
rtx
-mips_va_arg (valist, type)
- tree valist, type;
+mips_va_arg (tree valist, tree type)
{
HOST_WIDE_INT size, rsize;
rtx addr_rtx;
@@ -4659,11 +4152,11 @@ mips_va_arg (valist, type)
TOP be the top of the register save area;
OFF be the offset from TOP of the next register;
- ADDR_RTX be the address of the argument; and
+ ADDR_RTX be the address of the argument;
RSIZE be the number of bytes used to store the argument
- when it's in the register save area
+ when it's in the register save area;
OSIZE be the number of bytes used to store it when it's
- in the stack overflow area
+ in the stack overflow area; and
PADDING be (BYTES_BIG_ENDIAN ? OSIZE - RSIZE : 0)
The code we want is:
@@ -4687,8 +4180,8 @@ mips_va_arg (valist, type)
lab_over = gen_label_rtx ();
ovfl = build (COMPONENT_REF, TREE_TYPE (f_ovfl), valist, f_ovfl);
-
- if (TREE_CODE (type) == REAL_TYPE)
+ if (GET_MODE_CLASS (TYPE_MODE (type)) == MODE_FLOAT
+ && GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_FPVALUE)
{
top = build (COMPONENT_REF, TREE_TYPE (f_ftop), valist, f_ftop);
off = build (COMPONENT_REF, TREE_TYPE (f_foff), valist, f_foff);
@@ -4810,24 +4303,140 @@ mips_va_arg (valist, type)
}
}
-/* Abort after printing out a specific insn. */
+/* Return true if it is possible to use left/right accesses for a
+ bitfield of WIDTH bits starting BITPOS bits into *OP. When
+ returning true, update *OP, *LEFT and *RIGHT as follows:
-static void
-abort_with_insn (insn, reason)
- rtx insn;
- const char *reason;
+ *OP is a BLKmode reference to the whole field.
+
+ *LEFT is a QImode reference to the first byte if big endian or
+ the last byte if little endian. This address can be used in the
+ left-side instructions (lwl, swl, ldl, sdl).
+
+ *RIGHT is a QImode reference to the opposite end of the field and
+ can be used in the parterning right-side instruction. */
+
+static bool
+mips_get_unaligned_mem (rtx *op, unsigned int width, int bitpos,
+ rtx *left, rtx *right)
{
- error (reason);
- debug_rtx (insn);
- abort ();
+ rtx first, last;
+
+ /* Check that the operand really is a MEM. Not all the extv and
+ extzv predicates are checked. */
+ if (GET_CODE (*op) != MEM)
+ return false;
+
+ /* Check that the size is valid. */
+ if (width != 32 && (!TARGET_64BIT || width != 64))
+ return false;
+
+ /* We can only access byte-aligned values. Since we are always passed
+ a reference to the first byte of the field, it is not necessary to
+ do anything with BITPOS after this check. */
+ if (bitpos % BITS_PER_UNIT != 0)
+ return false;
+
+ /* Reject aligned bitfields: we want to use a normal load or store
+ instead of a left/right pair. */
+ if (MEM_ALIGN (*op) >= width)
+ return false;
+
+ /* Adjust *OP to refer to the whole field. This also has the effect
+ of legitimizing *OP's address for BLKmode, possibly simplifying it. */
+ *op = adjust_address (*op, BLKmode, 0);
+ set_mem_size (*op, GEN_INT (width / BITS_PER_UNIT));
+
+ /* Get references to both ends of the field. We deliberately don't
+ use the original QImode *OP for FIRST since the new BLKmode one
+ might have a simpler address. */
+ first = adjust_address (*op, QImode, 0);
+ last = adjust_address (*op, QImode, width / BITS_PER_UNIT - 1);
+
+ /* Allocate to LEFT and RIGHT according to endiannes. LEFT should
+ be the upper word and RIGHT the lower word. */
+ if (TARGET_BIG_ENDIAN)
+ *left = first, *right = last;
+ else
+ *left = last, *right = first;
+
+ return true;
+}
+
+
+/* Try to emit the equivalent of (set DEST (zero_extract SRC WIDTH BITPOS)).
+ Return true on success. We only handle cases where zero_extract is
+ equivalent to sign_extract. */
+
+bool
+mips_expand_unaligned_load (rtx dest, rtx src, unsigned int width, int bitpos)
+{
+ rtx left, right;
+
+ /* If TARGET_64BIT, the destination of a 32-bit load will be a
+ paradoxical word_mode subreg. This is the only case in which
+ we allow the destination to be larger than the source. */
+ if (GET_CODE (dest) == SUBREG
+ && GET_MODE (dest) == DImode
+ && SUBREG_BYTE (dest) == 0
+ && GET_MODE (SUBREG_REG (dest)) == SImode)
+ dest = SUBREG_REG (dest);
+
+ /* After the above adjustment, the destination must be the same
+ width as the source. */
+ if (GET_MODE_BITSIZE (GET_MODE (dest)) != width)
+ return false;
+
+ if (!mips_get_unaligned_mem (&src, width, bitpos, &left, &right))
+ return false;
+
+ if (GET_MODE (dest) == DImode)
+ {
+ emit_insn (gen_mov_ldl (dest, src, left));
+ emit_insn (gen_mov_ldr (copy_rtx (dest), copy_rtx (src),
+ right, copy_rtx (dest)));
+ }
+ else
+ {
+ emit_insn (gen_mov_lwl (dest, src, left));
+ emit_insn (gen_mov_lwr (copy_rtx (dest), copy_rtx (src),
+ right, copy_rtx (dest)));
+ }
+ return true;
+}
+
+
+/* Try to expand (set (zero_extract DEST WIDTH BITPOS) SRC). Return
+ true on success. */
+
+bool
+mips_expand_unaligned_store (rtx dest, rtx src, unsigned int width, int bitpos)
+{
+ rtx left, right;
+
+ if (!mips_get_unaligned_mem (&dest, width, bitpos, &left, &right))
+ return false;
+
+ src = gen_lowpart (mode_for_size (width, MODE_INT, 0), src);
+
+ if (GET_MODE (src) == DImode)
+ {
+ emit_insn (gen_mov_sdl (dest, src, left));
+ emit_insn (gen_mov_sdr (copy_rtx (dest), copy_rtx (src), right));
+ }
+ else
+ {
+ emit_insn (gen_mov_swl (dest, src, left));
+ emit_insn (gen_mov_swr (copy_rtx (dest), copy_rtx (src), right));
+ }
+ return true;
}
/* Set up globals to generate code for the ISA or processor
described by INFO. */
static void
-mips_set_architecture (info)
- const struct mips_cpu_info *info;
+mips_set_architecture (const struct mips_cpu_info *info)
{
if (info != 0)
{
@@ -4841,8 +4450,7 @@ mips_set_architecture (info)
/* Likewise for tuning. */
static void
-mips_set_tune (info)
- const struct mips_cpu_info *info;
+mips_set_tune (const struct mips_cpu_info *info)
{
if (info != 0)
{
@@ -4856,7 +4464,7 @@ mips_set_tune (info)
of the normal data area, and detect any conflicts in the switches. */
void
-override_options ()
+override_options (void)
{
int i, start, regno;
enum machine_mode mode;
@@ -4888,38 +4496,25 @@ override_options ()
if (mips_arch_string != 0)
mips_set_architecture (mips_parse_cpu ("-march", mips_arch_string));
- if (mips_tune_string != 0)
- mips_set_tune (mips_parse_cpu ("-mtune", mips_tune_string));
-
if (mips_isa_string != 0)
{
/* Handle -mipsN. */
+ char *whole_isa_str = concat ("mips", mips_isa_string, NULL);
+ const struct mips_cpu_info *isa_info;
- if (strcmp (mips_isa_string, "16") == 0)
- {
- /* -mips16 specifies an ASE rather than a processor, so don't
- change mips_arch here. -mno-mips16 overrides -mips16. */
- if (mips_no_mips16_string == NULL)
- target_flags |= MASK_MIPS16;
- }
- else
- {
- char *whole_isa_str = concat ("mips", mips_isa_string, NULL);
- const struct mips_cpu_info *isa_info;
-
- isa_info = mips_parse_cpu ("-mips option", whole_isa_str);
- free (whole_isa_str);
+ isa_info = mips_parse_cpu ("-mips option", whole_isa_str);
+ free (whole_isa_str);
- /* -march takes precedence over -mipsN, since it is more descriptive.
- There's no harm in specifying both as long as the ISA levels
- are the same. */
- if (mips_arch_info != 0 && mips_isa != isa_info->isa)
- error ("-mips%s conflicts with the other architecture options, which specify a MIPS%d processor",
- mips_isa_string, mips_isa);
+ /* -march takes precedence over -mipsN, since it is more descriptive.
+ There's no harm in specifying both as long as the ISA levels
+ are the same. */
+ if (mips_arch_info != 0 && mips_isa != isa_info->isa)
+ error ("-mips%s conflicts with the other architecture options, "
+ "which specify a MIPS%d processor",
+ mips_isa_string, mips_isa);
- /* Set architecture based on the given option. */
- mips_set_architecture (isa_info);
- }
+ /* Set architecture based on the given option. */
+ mips_set_architecture (isa_info);
}
if (mips_arch_info == 0)
@@ -4937,6 +4532,9 @@ override_options ()
mips_arch_info->name);
/* Optimize for mips_arch, unless -mtune selects a different processor. */
+ if (mips_tune_string != 0)
+ mips_set_tune (mips_parse_cpu ("-mtune", mips_tune_string));
+
if (mips_tune_info == 0)
mips_set_tune (mips_arch_info);
@@ -5043,20 +4641,23 @@ override_options ()
if (TARGET_BRANCHLIKELY && !ISA_HAS_BRANCHLIKELY)
warning ("generation of Branch Likely instructions enabled, but not supported by architecture");
+ /* The effect of -mabicalls isn't defined for the EABI. */
+ if (mips_abi == ABI_EABI && TARGET_ABICALLS)
+ {
+ error ("unsupported combination: %s", "-mabicalls -mabi=eabi");
+ target_flags &= ~MASK_ABICALLS;
+ }
+
/* -fpic (-KPIC) is the default when TARGET_ABICALLS is defined. We need
to set flag_pic so that the LEGITIMATE_PIC_OPERAND_P macro will work. */
/* ??? -non_shared turns off pic code generation, but this is not
implemented. */
if (TARGET_ABICALLS)
{
- mips_abicalls = MIPS_ABICALLS_YES;
- if (flag_pic == 0)
- flag_pic = 1;
+ flag_pic = 1;
if (mips_section_threshold > 0)
warning ("-G is incompatible with PIC code which is the default");
}
- else
- mips_abicalls = MIPS_ABICALLS_NO;
/* The MIPS and SGI o32 assemblers expect small-data variables to
be declared before they are used. Although we once had code to
@@ -5065,6 +4666,13 @@ override_options ()
if (!TARGET_EXPLICIT_RELOCS && !TARGET_GAS)
mips_section_threshold = 0;
+ /* We switch to small data sections using ".section", which the native
+ o32 irix assemblers don't understand. Disable -G accordingly.
+ We must do this regardless of command-line options since otherwise
+ the compiler would abort. */
+ if (!targetm.have_named_sections)
+ mips_section_threshold = 0;
+
/* -membedded-pic is a form of PIC code suitable for embedded
systems. All calls are made using PC relative addressing, and
all data is addressed using the $gp register. This requires gas,
@@ -5164,13 +4772,6 @@ override_options ()
mips_entry = 1;
}
- /* We copy TARGET_MIPS16 into the mips16 global variable, so that
- attributes can access it. */
- if (TARGET_MIPS16)
- mips16 = 1;
- else
- mips16 = 0;
-
/* When using explicit relocs, we call dbr_schedule from within
mips_reorg. */
if (TARGET_EXPLICIT_RELOCS)
@@ -5244,12 +4845,7 @@ override_options ()
mips_dbx_regno[HI_REGNUM] = MD_DBX_FIRST + 0;
mips_dbx_regno[LO_REGNUM] = MD_DBX_FIRST + 1;
- /* Set up array giving whether a given register can hold a given mode.
- At present, restrict ints from being in FP registers, because reload
- is a little enthusiastic about storing extra values in FP registers,
- and this is not good for things like OS kernels. Also, due to the
- mandatory delay, it is as fast to load from cached memory as to move
- from the FP register. */
+ /* Set up array giving whether a given register can hold a given mode. */
for (mode = VOIDmode;
mode != MAX_MACHINE_MODE;
@@ -5325,7 +4921,7 @@ override_options ()
/* Implement CONDITIONAL_REGISTER_USAGE. */
void
-mips_conditional_register_usage ()
+mips_conditional_register_usage (void)
{
if (!TARGET_HARD_FLOAT)
{
@@ -5380,7 +4976,7 @@ mips_conditional_register_usage ()
/* Allocate a chunk of memory for per-function machine-dependent data. */
static struct machine_function *
-mips_init_machine_status ()
+mips_init_machine_status (void)
{
return ((struct machine_function *)
ggc_alloc_cleared (sizeof (struct machine_function)));
@@ -5392,7 +4988,7 @@ mips_init_machine_status ()
encouraging the compiler to use a cmp instead. */
void
-mips_order_regs_for_local_alloc ()
+mips_order_regs_for_local_alloc (void)
{
register int i;
@@ -5419,9 +5015,7 @@ mips_order_regs_for_local_alloc ()
the initial adjustments. */
HOST_WIDE_INT
-mips_debugger_offset (addr, offset)
- rtx addr;
- HOST_WIDE_INT offset;
+mips_debugger_offset (rtx addr, HOST_WIDE_INT offset)
{
rtx offset2 = const0_rtx;
rtx reg = eliminate_constant_term (addr, &offset2);
@@ -5446,37 +5040,18 @@ mips_debugger_offset (addr, offset)
/* sdbout_parms does not want this to crash for unrecognized cases. */
#if 0
else if (reg != arg_pointer_rtx)
- abort_with_insn (addr, "mips_debugger_offset called with non stack/frame/arg pointer");
+ fatal_insn ("mips_debugger_offset called with non stack/frame/arg pointer",
+ addr);
#endif
return offset;
}
-/* A C compound statement to output to stdio stream STREAM the
- assembler syntax for an instruction operand X. X is an RTL
- expression.
-
- CODE is a value that can be used to specify one of several ways
- of printing the operand. It is used when identical operands
- must be printed differently depending on the context. CODE
- comes from the `%' specification that was used to request
- printing of the operand. If the specification was just `%DIGIT'
- then CODE is 0; if the specification was `%LTR DIGIT' then CODE
- is the ASCII code for LTR.
-
- If X is a register, this macro should print the register's name.
- The names can be found in an array `reg_names' whose type is
- `char *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
-
- When the machine description has a specification `%PUNCT' (a `%'
- followed by a punctuation character), this macro is called with
- a null pointer for X and the punctuation character for CODE.
-
- The MIPS specific codes are:
-
- 'X' X is CONST_INT, prints 32 bits in hexadecimal format = "0x%08x",
- 'x' X is CONST_INT, prints 16 bits in hexadecimal format = "0x%04x",
- 'h' X is HIGH, prints %hi(X),
+/* Implement the PRINT_OPERAND macro. The MIPS-specific operand codes are:
+
+ 'X' OP is CONST_INT, prints 32 bits in hexadecimal format = "0x%08x",
+ 'x' OP is CONST_INT, prints 16 bits in hexadecimal format = "0x%04x",
+ 'h' OP is HIGH, prints %hi(X),
'd' output integer constant in decimal,
'z' if the operand is 0, use $0 instead of normal operand.
'D' print second part of double-word register or memory operand.
@@ -5486,13 +5061,16 @@ mips_debugger_offset (addr, offset)
'F' print part of opcode for a floating-point branch condition.
'N' print part of opcode for a branch condition, inverted.
'W' print part of opcode for a floating-point branch condition, inverted.
- 'S' X is CODE_LABEL, print with prefix of "LS" (for embedded switch).
+ 'S' OP is CODE_LABEL, print with prefix of "LS" (for embedded switch).
'B' print 'z' for EQ, 'n' for NE
'b' print 'n' for EQ, 'z' for NE
'T' print 'f' for EQ, 't' for NE
't' print 't' for EQ, 'f' for NE
'Z' print register and a comma, but print nothing for $fcc0
'R' print the reloc associated with LO_SUM
+
+ The punctuation characters are:
+
'(' Turn on .set noreorder
')' Turn on .set reorder
'[' Turn on .set noat
@@ -5515,10 +5093,7 @@ mips_debugger_offset (addr, offset)
'~' Output a branch alignment to LABEL_ALIGN(NULL). */
void
-print_operand (file, op, letter)
- FILE *file; /* file to write to */
- rtx op; /* operand to print */
- int letter; /* %<letter> or 0 */
+print_operand (FILE *file, rtx op, int letter)
{
register enum rtx_code code;
struct mips_constant_info c;
@@ -5663,9 +5238,6 @@ print_operand (file, op, letter)
code = GET_CODE (op);
- if (code == SIGN_EXTEND)
- op = XEXP (op, 0), code = GET_CODE (op);
-
if (letter == 'R')
{
if (TARGET_ABICALLS && TARGET_NEWABI)
@@ -5699,7 +5271,7 @@ print_operand (file, op, letter)
case LTU: fputs ("ltu", file); break;
case LEU: fputs ("leu", file); break;
default:
- abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%C");
+ fatal_insn ("PRINT_OPERAND, invalid insn for %%C", op);
}
else if (letter == 'N')
@@ -5716,7 +5288,7 @@ print_operand (file, op, letter)
case LTU: fputs ("geu", file); break;
case LEU: fputs ("gtu", file); break;
default:
- abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%N");
+ fatal_insn ("PRINT_OPERAND, invalid insn for %%N", op);
}
else if (letter == 'F')
@@ -5725,7 +5297,7 @@ print_operand (file, op, letter)
case EQ: fputs ("c1f", file); break;
case NE: fputs ("c1t", file); break;
default:
- abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%F");
+ fatal_insn ("PRINT_OPERAND, invalid insn for %%F", op);
}
else if (letter == 'W')
@@ -5734,7 +5306,7 @@ print_operand (file, op, letter)
case EQ: fputs ("c1t", file); break;
case NE: fputs ("c1f", file); break;
default:
- abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%W");
+ fatal_insn ("PRINT_OPERAND, invalid insn for %%W", op);
}
else if (letter == 'S')
@@ -5835,8 +5407,7 @@ print_operand (file, op, letter)
/* Return the assembly operator used for the given type of relocation. */
static const char *
-mips_reloc_string (reloc)
- int reloc;
+mips_reloc_string (int reloc)
{
switch (reloc)
{
@@ -5857,9 +5428,7 @@ mips_reloc_string (reloc)
/* Output address operand X to FILE. */
void
-print_operand_address (file, x)
- FILE *file;
- rtx x;
+print_operand_address (FILE *file, rtx x)
{
struct mips_address_info addr;
@@ -5891,10 +5460,7 @@ print_operand_address (file, x)
such an integer here. */
static bool
-mips_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+mips_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if ((TARGET_64BIT || TARGET_GAS) && size == 8 && aligned_p)
{
@@ -5918,10 +5484,7 @@ mips_assemble_integer (x, size, aligned_p)
than .sbss or .sdata. */
int
-mips_output_external (file, decl, name)
- FILE *file ATTRIBUTE_UNUSED;
- tree decl;
- const char *name;
+mips_output_external (FILE *file ATTRIBUTE_UNUSED, tree decl, const char *name)
{
register struct extern_list *p;
@@ -5956,9 +5519,7 @@ mips_output_external (file, decl, name)
#ifdef ASM_OUTPUT_UNDEF_FUNCTION
int
-mips_output_external_libcall (file, name)
- FILE *file ATTRIBUTE_UNUSED;
- const char *name;
+mips_output_external_libcall (FILE *file ATTRIBUTE_UNUSED, const char *name)
{
register struct extern_list *p;
@@ -5972,14 +5533,11 @@ mips_output_external_libcall (file, name)
}
#endif
-/* Emit a new filename to a stream. If this is MIPS ECOFF, watch out
- for .file's that start within a function. If we are smuggling stabs, try to
+/* Emit a new filename to a stream. If we are smuggling stabs, try to
put out a MIPS ECOFF file and a stab. */
void
-mips_output_filename (stream, name)
- FILE *stream;
- const char *name;
+mips_output_filename (FILE *stream, const char *name)
{
char ltext_label_name[100];
@@ -6007,23 +5565,11 @@ mips_output_filename (stream, name)
}
else if (name != current_function_file
- && strcmp (name, current_function_file) != 0)
+ && strcmp (name, current_function_file) != 0)
{
- if (inside_function && !TARGET_GAS)
- {
- if (!file_in_function_warning)
- {
- file_in_function_warning = 1;
- ignore_line_number = 1;
- warning ("MIPS ECOFF format does not allow changing filenames within functions with #line");
- }
- }
- else
- {
- SET_FILE_NUMBER ();
- current_function_file = name;
- ASM_OUTPUT_FILENAME (stream, num_source_filenames, name);
- }
+ SET_FILE_NUMBER ();
+ current_function_file = name;
+ ASM_OUTPUT_FILENAME (stream, num_source_filenames, name);
}
}
@@ -6033,9 +5579,7 @@ mips_output_filename (stream, name)
file. */
void
-mips_output_lineno (stream, line)
- FILE *stream;
- int line;
+mips_output_lineno (FILE *stream, int line)
{
if (write_symbols == DBX_DEBUG)
{
@@ -6046,10 +5590,7 @@ mips_output_lineno (stream, line)
}
else
{
- fprintf (stream, "\n\t%s.loc\t%d %d\n",
- (ignore_line_number) ? "#" : "",
- num_source_filenames, line);
-
+ fprintf (stream, "\n\t.loc\t%d %d\n", num_source_filenames, line);
LABEL_AFTER_LOC (stream);
}
}
@@ -6057,10 +5598,7 @@ mips_output_lineno (stream, line)
/* Output an ASCII string, in a space-saving way. */
void
-mips_output_ascii (stream, string_param, len)
- FILE *stream;
- const char *string_param;
- size_t len;
+mips_output_ascii (FILE *stream, const char *string_param, size_t len)
{
size_t i;
int cur_pos = 17;
@@ -6133,16 +5671,10 @@ mips_output_ascii (stream, string_param, len)
fprintf (stream, "\"\n");
}
-/* Output at beginning of assembler file.
-
- If we are optimizing to use the global pointer, create a temporary file to
- hold all of the text stuff, and write it out to the end. This is needed
- because the MIPS assembler is evidently one pass, and if it hasn't seen the
- relevant .comm/.lcomm/.extern/.sdata declaration when the code is
- processed, it generates a two instruction sequence. */
+/* Implement TARGET_ASM_FILE_START. */
static void
-mips_file_start ()
+mips_file_start (void)
{
default_file_start ();
@@ -6203,14 +5735,33 @@ mips_file_start ()
ASM_COMMENT_START,
mips_section_threshold, mips_arch_info->name, mips_isa);
}
+
+#ifdef BSS_SECTION_ASM_OP
+/* Implement ASM_OUTPUT_ALIGNED_BSS. This differs from the default only
+ in the use of sbss. */
+
+void
+mips_output_aligned_bss (FILE *stream, tree decl, const char *name,
+ unsigned HOST_WIDE_INT size, int align)
+{
+ extern tree last_assemble_variable_decl;
+
+ if (mips_in_small_data_p (decl))
+ named_section (0, ".sbss", 0);
+ else
+ bss_section ();
+ ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT));
+ last_assemble_variable_decl = decl;
+ ASM_DECLARE_OBJECT_NAME (stream, name, decl);
+ ASM_OUTPUT_SKIP (stream, size != 0 ? size : 1);
+}
+#endif
-/* If we are optimizing the global pointer, emit the text section now and any
- small externs which did not have .comm, etc that are needed. Also, give a
- warning if the data area is more than 32K and -pic because 3 instructions
- are needed to reference the data pointers. */
+/* Implement TARGET_ASM_FILE_END. When using assembler macros, emit
+ .externs for any small-data variables that turned out to be external. */
static void
-mips_file_end ()
+mips_file_end (void)
{
tree name_tree;
struct extern_list *p;
@@ -6247,12 +5798,8 @@ mips_file_end ()
.extern for it. */
void
-mips_declare_object (stream, name, init_string, final_string, size)
- FILE *stream;
- const char *name;
- const char *init_string;
- const char *final_string;
- int size;
+mips_declare_object (FILE *stream, const char *name, const char *init_string,
+ const char *final_string, int size)
{
fputs (init_string, stream); /* "", "\t.comm\t", or "\t.lcomm\t" */
assemble_name (stream, name);
@@ -6264,13 +5811,63 @@ mips_declare_object (stream, name, init_string, final_string, size)
TREE_ASM_WRITTEN (name_tree) = 1;
}
}
+
+#ifdef ASM_OUTPUT_SIZE_DIRECTIVE
+extern int size_directive_output;
+
+/* Implement ASM_DECLARE_OBJECT_NAME. This is like most of the standard ELF
+ definitions except that it uses mips_declare_object() to emit the label. */
+
+void
+mips_declare_object_name (FILE *stream, const char *name,
+ tree decl ATTRIBUTE_UNUSED)
+{
+#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
+ ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object");
+#endif
+
+ size_directive_output = 0;
+ if (!flag_inhibit_size_directive && DECL_SIZE (decl))
+ {
+ HOST_WIDE_INT size;
+
+ size_directive_output = 1;
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+ }
+
+ mips_declare_object (stream, name, "", ":\n", 0);
+}
+
+/* Implement ASM_FINISH_DECLARE_OBJECT. This is generic ELF stuff. */
+
+void
+mips_finish_declare_object (FILE *stream, tree decl, int top_level, int at_end)
+{
+ const char *name;
+
+ name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ if (!flag_inhibit_size_directive
+ && DECL_SIZE (decl) != 0
+ && !at_end && top_level
+ && DECL_INITIAL (decl) == error_mark_node
+ && !size_directive_output)
+ {
+ HOST_WIDE_INT size;
+
+ size_directive_output = 1;
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+ }
+}
+#endif
/* 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. */
static unsigned int
-mips_global_pointer ()
+mips_global_pointer (void)
{
unsigned int regno;
@@ -6320,8 +5917,7 @@ mips_global_pointer ()
/* Return true if the current function must save REGNO. */
static bool
-mips_save_reg_p (regno)
- unsigned int regno;
+mips_save_reg_p (unsigned int regno)
{
/* We only need to save $gp for NewABI PIC. */
if (regno == GLOBAL_POINTER_REGNUM)
@@ -6359,7 +5955,7 @@ mips_save_reg_p (regno)
if (regno == GP_REG_FIRST + 31
&& mips16_hard_float
&& !mips_entry
- && !aggregate_value_p (return_type)
+ && !aggregate_value_p (return_type, current_function_decl)
&& GET_MODE_CLASS (DECL_MODE (return_type)) == MODE_FLOAT
&& GET_MODE_SIZE (DECL_MODE (return_type)) <= UNITS_PER_FPVALUE)
return true;
@@ -6377,7 +5973,7 @@ mips_save_reg_p (regno)
/* Return the bytes needed to compute the frame pointer from the current
- stack pointer.
+ stack pointer. SIZE is the size (in bytes) of the local variables.
Mips stack frames look like:
@@ -6430,8 +6026,7 @@ mips_save_reg_p (regno)
*/
HOST_WIDE_INT
-compute_frame_size (size)
- HOST_WIDE_INT size; /* # of var. bytes allocated */
+compute_frame_size (HOST_WIDE_INT size)
{
unsigned int regno;
HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */
@@ -6570,8 +6165,7 @@ compute_frame_size (size)
hard frame pointer. */
int
-mips_initial_elimination_offset (from, to)
- int from, to;
+mips_initial_elimination_offset (int from, int to)
{
int offset;
@@ -6610,9 +6204,7 @@ mips_initial_elimination_offset (from, to)
/* Implement RETURN_ADDR_RTX. Note, we do not support moving
back to a previous frame. */
rtx
-mips_return_addr (count, frame)
- int count;
- rtx frame ATTRIBUTE_UNUSED;
+mips_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
{
if (count != 0)
return const0_rtx;
@@ -6628,8 +6220,7 @@ mips_return_addr (count, frame)
OFFSET is too large to add in a single instruction. */
static rtx
-mips_add_large_offset_to_sp (offset)
- HOST_WIDE_INT offset;
+mips_add_large_offset_to_sp (HOST_WIDE_INT offset)
{
rtx reg = gen_rtx_REG (Pmode, MIPS_TEMP2_REGNUM);
rtx offset_rtx = GEN_INT (offset);
@@ -6646,8 +6237,7 @@ mips_add_large_offset_to_sp (offset)
the operation described by FRAME_PATTERN. */
static void
-mips_set_frame_expr (frame_pattern)
- rtx frame_pattern;
+mips_set_frame_expr (rtx frame_pattern)
{
rtx insn;
@@ -6662,9 +6252,7 @@ mips_set_frame_expr (frame_pattern)
REG must be a single register. */
static rtx
-mips_frame_set (reg, offset)
- rtx reg;
- int offset;
+mips_frame_set (rtx reg, int offset)
{
rtx address = plus_constant (stack_pointer_rtx, offset);
rtx set = gen_rtx_SET (VOIDmode, gen_rtx_MEM (GET_MODE (reg), address), reg);
@@ -6678,10 +6266,7 @@ mips_frame_set (reg, offset)
function may be asked to store an FPR pair. */
static void
-mips_emit_frame_related_store (mem, reg, offset)
- rtx mem;
- rtx reg;
- HOST_WIDE_INT offset;
+mips_emit_frame_related_store (rtx mem, rtx reg, HOST_WIDE_INT offset)
{
if (GET_MODE (reg) == DFmode && mips_split_64bit_move_p (mem, reg))
mips_split_64bit_move (mem, reg);
@@ -6703,11 +6288,15 @@ mips_emit_frame_related_store (mem, reg, offset)
mips_set_frame_expr (mips_frame_set (reg, offset));
}
+
+/* Emit instructions to save or restore the registers in
+ cfun->machine->frame.mask and cfun->machine->frame.fmask.
+ STORE_P is true to save registers (meaning we are expanding
+ the prologue). If nonnull, LARGE_REG stores the value LARGE_OFFSET,
+ which the caller thinks might be useful to us. */
+
static void
-save_restore_insns (store_p, large_reg, large_offset)
- int store_p; /* true if this is prologue */
- rtx large_reg; /* register holding large offset constant or NULL */
- long large_offset; /* large constant offset value */
+save_restore_insns (int store_p, rtx large_reg, long large_offset)
{
long mask = cfun->machine->frame.mask;
long fmask = cfun->machine->frame.fmask;
@@ -6907,9 +6496,7 @@ save_restore_insns (store_p, large_reg, large_offset)
/* Set up the stack and frame (if desired) for the function. */
static void
-mips_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
#ifndef FUNCTION_NAME_ALREADY_DECLARED
const char *fnname;
@@ -6935,8 +6522,6 @@ mips_output_function_prologue (file, size)
&& current_function_args_info.fp_code != 0)
build_mips16_function_stub (file);
- inside_function = 1;
-
#ifndef FUNCTION_NAME_ALREADY_DECLARED
/* Get the function name the same way that toplev.c does before calling
assemble_start_function. This is needed so that the name used here
@@ -7115,8 +6700,7 @@ mips_output_function_prologue (file, size)
explicit reloc code, mark the instruction as potentially dead. */
static void
-mips_gp_insn (dest, src)
- rtx dest, src;
+mips_gp_insn (rtx dest, rtx src)
{
rtx insn;
@@ -7135,31 +6719,24 @@ mips_gp_insn (dest, src)
/* Expand the prologue into a bunch of separate insns. */
void
-mips_expand_prologue ()
+mips_expand_prologue (void)
{
- int regno;
HOST_WIDE_INT tsize;
rtx tmp_rtx = 0;
- int last_arg_is_vararg_marker = 0;
tree fndecl = current_function_decl;
tree fntype = TREE_TYPE (fndecl);
tree fnargs = DECL_ARGUMENTS (fndecl);
- rtx next_arg_reg;
- int i;
- tree next_arg;
tree cur_arg;
CUMULATIVE_ARGS args_so_far;
rtx reg_18_save = NULL_RTX;
- int store_args_on_stack = (mips_abi == ABI_32 || mips_abi == ABI_O64)
- && (! mips_entry || mips_can_use_return_insn ());
if (cfun->machine->global_pointer > 0)
REGNO (pic_offset_table_rtx) = cfun->machine->global_pointer;
/* If struct value address is treated as the first argument, make it so. */
- 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 (fndecl, 0) == 0)
{
tree type = build_pointer_type (fntype);
tree function_result_decl = build_decl (PARM_DECL, NULL_TREE, type);
@@ -7169,130 +6746,27 @@ mips_expand_prologue ()
fnargs = function_result_decl;
}
- /* For arguments passed in registers, find the register number
- of the first argument in the variable part of the argument list,
- otherwise GP_ARG_LAST+1. Note also if the last argument is
- the varargs special argument, and treat it as part of the
- variable arguments.
-
- This is only needed if store_args_on_stack is true. */
-
+ /* Go through the function arguments, leaving args_so_far reflecting
+ the final state. */
INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, current_function_decl);
- regno = GP_ARG_FIRST;
-
- for (cur_arg = fnargs; cur_arg != 0; cur_arg = next_arg)
+ for (cur_arg = fnargs; cur_arg != 0; cur_arg = TREE_CHAIN (cur_arg))
{
- tree passed_type = DECL_ARG_TYPE (cur_arg);
- enum machine_mode passed_mode = TYPE_MODE (passed_type);
- rtx entry_parm;
+ tree passed_type;
+ enum machine_mode passed_mode;
+ passed_type = DECL_ARG_TYPE (cur_arg);
if (TREE_ADDRESSABLE (passed_type))
{
passed_type = build_pointer_type (passed_type);
passed_mode = Pmode;
}
-
- entry_parm = FUNCTION_ARG (args_so_far, passed_mode, passed_type, 1);
-
- FUNCTION_ARG_ADVANCE (args_so_far, passed_mode, passed_type, 1);
- next_arg = TREE_CHAIN (cur_arg);
-
- if (entry_parm && store_args_on_stack)
- {
- if (next_arg == 0
- && DECL_NAME (cur_arg)
- && ((0 == strcmp (IDENTIFIER_POINTER (DECL_NAME (cur_arg)),
- "__builtin_va_alist"))
- || (0 == strcmp (IDENTIFIER_POINTER (DECL_NAME (cur_arg)),
- "va_alist"))))
- {
- last_arg_is_vararg_marker = 1;
- if (GET_CODE (entry_parm) == REG)
- regno = REGNO (entry_parm);
- else
- regno = GP_ARG_LAST + 1;
- break;
- }
- else
- {
- int words;
-
- if (GET_CODE (entry_parm) != REG)
- abort ();
-
- /* passed in a register, so will get homed automatically */
- if (GET_MODE (entry_parm) == BLKmode)
- words = (int_size_in_bytes (passed_type) + 3) / 4;
- else
- words = (GET_MODE_SIZE (GET_MODE (entry_parm)) + 3) / 4;
-
- regno = REGNO (entry_parm) + words - 1;
- }
- }
else
- {
- regno = GP_ARG_LAST+1;
- break;
- }
- }
-
- /* In order to pass small structures by value in registers compatibly with
- the MIPS compiler, we need to shift the value into the high part of the
- register. 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)
- {
- rtvec adjust = XVEC (next_arg_reg, 0);
- int num = GET_NUM_ELEM (adjust);
-
- for (i = 0; i < num; i++)
- {
- rtx insn, pattern;
-
- pattern = RTVEC_ELT (adjust, i);
- if (GET_CODE (pattern) != SET
- || GET_CODE (SET_SRC (pattern)) != ASHIFT)
- abort_with_insn (pattern, "insn is not a shift");
- PUT_CODE (SET_SRC (pattern), ASHIFTRT);
-
- insn = emit_insn (pattern);
-
- /* Global life information isn't valid at this point, so we
- can't check whether these shifts are actually used. Mark
- them MAYBE_DEAD so that flow2 will remove them, and not
- complain about dead code in the prologue. */
- REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
- REG_NOTES (insn));
- }
+ passed_mode = TYPE_MODE (passed_type);
+ FUNCTION_ARG_ADVANCE (args_so_far, passed_mode, passed_type, 1);
}
tsize = compute_frame_size (get_frame_size ());
- /* If this function is a varargs function, store any registers that
- would normally hold arguments ($4 - $7) on the stack. */
- if (store_args_on_stack
- && ((TYPE_ARG_TYPES (fntype) != 0
- && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
- != void_type_node))
- || last_arg_is_vararg_marker))
- {
- int offset = (regno - GP_ARG_FIRST) * UNITS_PER_WORD;
- rtx ptr = stack_pointer_rtx;
-
- for (; regno <= GP_ARG_LAST; regno++)
- {
- if (offset != 0)
- ptr = gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (offset));
- emit_move_insn (gen_rtx (MEM, gpr_mode, ptr),
- gen_rtx (REG, gpr_mode, regno));
-
- offset += GET_MODE_SIZE (gpr_mode);
- }
- }
-
/* If we are using the entry pseudo instruction, it will
automatically subtract 32 from the stack pointer, so we don't
need to. The entry pseudo instruction is emitted by
@@ -7374,27 +6848,24 @@ mips_expand_prologue ()
{
rtx tsize_rtx = GEN_INT (tsize);
- /* If we are doing svr4-abi, sp move is done by
- function_prologue. In mips16 mode with a large frame, we
- save the registers before adjusting the stack. */
- if (!TARGET_MIPS16 || tsize <= 32767)
+ /* In mips16 mode with a large frame, we save the registers before
+ adjusting the stack. */
+ if (!TARGET_MIPS16 || tsize <= 32768)
{
- rtx adjustment_rtx;
-
- if (tsize > 32767)
+ if (tsize > 32768)
{
+ rtx adjustment_rtx;
+
adjustment_rtx = gen_rtx (REG, Pmode, MIPS_TEMP1_REGNUM);
emit_move_insn (adjustment_rtx, tsize_rtx);
+ emit_insn (gen_sub3_insn (stack_pointer_rtx,
+ stack_pointer_rtx,
+ adjustment_rtx));
}
else
- adjustment_rtx = tsize_rtx;
-
- if (Pmode == DImode)
- emit_insn (gen_subdi3 (stack_pointer_rtx, stack_pointer_rtx,
- adjustment_rtx));
- else
- emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
- adjustment_rtx));
+ emit_insn (gen_add3_insn (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-tsize)));
mips_set_frame_expr
(gen_rtx_SET (VOIDmode, stack_pointer_rtx,
@@ -7410,7 +6881,7 @@ mips_expand_prologue ()
emit_insn (gen_cprestore
(GEN_INT (current_function_outgoing_args_size)));
- if (TARGET_MIPS16 && tsize > 32767)
+ if (TARGET_MIPS16 && tsize > 32768)
{
rtx reg_rtx;
@@ -7420,14 +6891,9 @@ mips_expand_prologue ()
reg_rtx = gen_rtx (REG, Pmode, 3);
emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
emit_move_insn (reg_rtx, tsize_rtx);
- if (Pmode == DImode)
- emit_insn (gen_subdi3 (hard_frame_pointer_rtx,
- hard_frame_pointer_rtx,
- reg_rtx));
- else
- emit_insn (gen_subsi3 (hard_frame_pointer_rtx,
- hard_frame_pointer_rtx,
- reg_rtx));
+ emit_insn (gen_sub3_insn (hard_frame_pointer_rtx,
+ hard_frame_pointer_rtx,
+ reg_rtx));
emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx);
}
@@ -7513,9 +6979,8 @@ mips_expand_prologue ()
#define PIC_OFFSET_TABLE_MASK (1 << (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST))
static void
-mips_output_function_epilogue (file, size)
- FILE *file ATTRIBUTE_UNUSED;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
rtx string;
@@ -7542,10 +7007,6 @@ mips_output_function_epilogue (file, size)
}
#endif
- /* Reset state info for each function. */
- inside_function = 0;
- ignore_line_number = 0;
-
while (string_constants != NULL)
{
struct string_constant *next;
@@ -7575,8 +7036,7 @@ mips_output_function_epilogue (file, size)
"epilogue" pattern. */
void
-mips_expand_epilogue (sibcall_p)
- int sibcall_p;
+mips_expand_epilogue (int sibcall_p)
{
HOST_WIDE_INT tsize = cfun->machine->frame.total_size;
rtx tsize_rtx = GEN_INT (tsize);
@@ -7724,7 +7184,7 @@ mips_expand_epilogue (sibcall_p)
was created. */
int
-mips_can_use_return_insn ()
+mips_can_use_return_insn (void)
{
tree return_type;
@@ -7741,7 +7201,7 @@ mips_can_use_return_insn ()
registers. */
if (TARGET_MIPS16
&& mips16_hard_float
- && ! aggregate_value_p (return_type)
+ && ! aggregate_value_p (return_type, current_function_decl)
&& GET_MODE_CLASS (DECL_MODE (return_type)) == MODE_FLOAT
&& GET_MODE_SIZE (DECL_MODE (return_type)) <= UNITS_PER_FPVALUE)
return 0;
@@ -7755,8 +7215,7 @@ mips_can_use_return_insn ()
/* Returns nonzero if X contains a SYMBOL_REF. */
static int
-symbolic_expression_p (x)
- rtx x;
+symbolic_expression_p (rtx x)
{
if (GET_CODE (x) == SYMBOL_REF)
return 1;
@@ -7779,10 +7238,8 @@ symbolic_expression_p (x)
mode MODE. */
static void
-mips_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align;
+mips_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align)
{
if (TARGET_MIPS16)
{
@@ -7822,10 +7279,8 @@ mips_select_rtx_section (mode, x, align)
any relocatable expression. */
static void
-mips_select_section (decl, reloc, align)
- tree decl;
- int reloc;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+mips_select_section (tree decl, int reloc,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16)
&& TREE_CODE (decl) == STRING_CST
@@ -7835,8 +7290,11 @@ mips_select_section (decl, reloc, align)
For mips16 code, put strings in the text section so that a PC
relative load instruction can be used to get their address. */
text_section ();
- else
+ else if (targetm.have_named_sections)
default_elf_select_section (decl, reloc, align);
+ else
+ /* The native irix o32 assembler doesn't support named sections. */
+ default_select_section (decl, reloc, align);
}
@@ -7844,8 +7302,7 @@ mips_select_section (decl, reloc, align)
access DECL using %gp_rel(...)($gp). */
static bool
-mips_in_small_data_p (decl)
- tree decl;
+mips_in_small_data_p (tree decl)
{
HOST_WIDE_INT size;
@@ -7878,16 +7335,6 @@ mips_in_small_data_p (decl)
&& (!DECL_INITIAL (decl) || TREE_CONSTANT (DECL_INITIAL (decl))))
return false;
}
- else if (TARGET_MIPS16)
- {
- /* Alhough it seems strange to have separate rules for -mips16,
- this behaviour is long-standing. */
- if (TREE_PUBLIC (decl)
- && (DECL_COMMON (decl)
- || DECL_ONE_ONLY (decl)
- || DECL_WEAK (decl)))
- return false;
- }
size = int_size_in_bytes (TREE_TYPE (decl));
return (size > 0 && size <= mips_section_threshold);
@@ -7907,10 +7354,7 @@ mips_in_small_data_p (decl)
should treat the symbol as SYMBOL_GOT_LOCAL. */
static void
-mips_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+mips_encode_section_info (tree decl, rtx rtl, int first)
{
rtx symbol;
@@ -7990,17 +7434,14 @@ mips_encode_section_info (decl, rtl, first)
default_encode_section_info (decl, rtl, first);
}
-
-
-/* Return register to use for a function return value with VALTYPE for
- function FUNC. MODE is used instead of VALTYPE for LIBCALLs. */
+/* 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. */
rtx
-mips_function_value (valtype, func, mode)
- tree valtype;
- tree func ATTRIBUTE_UNUSED;
- enum machine_mode mode;
+mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
+ enum machine_mode mode)
{
int reg = GP_RETURN;
enum mode_class mclass;
@@ -8123,31 +7564,13 @@ mips_function_value (valtype, func, mode)
nonzero when an argument must be passed by reference. */
int
-function_arg_pass_by_reference (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg_pass_by_reference (const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode, tree type,
+ int named ATTRIBUTE_UNUSED)
{
int size;
- if (mips_abi == ABI_32 || mips_abi == ABI_O64)
- return 0;
-
- /* We must pass by reference if we would be both passing in registers
- and the stack. This is because any subsequent partial arg would be
- handled incorrectly in this case.
-
- ??? This is really a kludge. We should either fix GCC so that such
- a situation causes an abort and then do something in the MIPS port
- to prevent it, or add code to function.c to properly handle the case. */
- /* ??? cum can be NULL when called from mips_va_arg. The problem handled
- here hopefully is not relevant to mips_va_arg. */
- if (cum && MUST_PASS_IN_STACK (mode, type)
- && FUNCTION_ARG (*cum, mode, type, named) != 0)
- return 1;
-
- /* Otherwise, we only do this if EABI is selected. */
+ /* The EABI is the only one to pass args by reference. */
if (mips_abi != ABI_EABI)
return 0;
@@ -8177,9 +7600,8 @@ function_arg_pass_by_reference (cum, mode, type, named)
mode to a 64-bit mode. */
bool
-mips_cannot_change_mode_class (from, to, class)
- enum machine_mode from, to;
- enum reg_class class;
+mips_cannot_change_mode_class (enum machine_mode from,
+ enum machine_mode to, enum reg_class class)
{
if (GET_MODE_SIZE (from) != GET_MODE_SIZE (to))
{
@@ -8199,55 +7621,14 @@ mips_cannot_change_mode_class (from, to, class)
NO_REGS means that no secondary register is required. */
enum reg_class
-mips_secondary_reload_class (class, mode, x, in_p)
- enum reg_class class;
- enum machine_mode mode;
- rtx x;
- int in_p;
+mips_secondary_reload_class (enum reg_class class,
+ enum machine_mode mode, rtx x, int in_p)
{
enum reg_class gr_regs = TARGET_MIPS16 ? M16_REGS : GR_REGS;
int regno = -1;
int gp_reg_p;
- if (GET_CODE (x) == SIGN_EXTEND)
- {
- int off = 0;
-
- x = XEXP (x, 0);
-
- /* We may be called with reg_renumber NULL from regclass.
- ??? This is probably a bug. */
- if (reg_renumber)
- regno = true_regnum (x);
- else
- {
- while (GET_CODE (x) == SUBREG)
- {
- off += subreg_regno_offset (REGNO (SUBREG_REG (x)),
- GET_MODE (SUBREG_REG (x)),
- SUBREG_BYTE (x),
- GET_MODE (x));
- x = SUBREG_REG (x);
- }
-
- if (GET_CODE (x) == REG)
- regno = REGNO (x) + off;
- }
-
- /* 64-bit floating-point registers don't store 32-bit values
- in sign-extended form. The only way we can reload
- (sign_extend:DI (reg:SI $f0)) is by moving $f0 into
- an integer register using a 32-bit move. */
- if (FP_REG_P (regno))
- return (class == GR_REGS ? NO_REGS : GR_REGS);
-
- /* For the same reason, we can only reload (sign_extend:DI FOO) into
- a floating-point register when FOO is an integer register. */
- if (class == FP_REGS)
- return (GP_REG_P (regno) ? NO_REGS : GR_REGS);
- }
-
- else if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
+ if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
regno = true_regnum (x);
gp_reg_p = TARGET_MIPS16 ? M16_REG_P (regno) : GP_REG_P (regno);
@@ -8354,16 +7735,14 @@ mips_secondary_reload_class (class, mode, x, in_p)
since -msingle-float disallows multi-FPR values. */
int
-mips_class_max_nregs (class, mode)
- enum reg_class class ATTRIBUTE_UNUSED;
- enum machine_mode mode;
+mips_class_max_nregs (enum reg_class class ATTRIBUTE_UNUSED,
+ enum machine_mode mode)
{
return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
}
bool
-mips_valid_pointer_mode (mode)
- enum machine_mode mode;
+mips_valid_pointer_mode (enum machine_mode mode)
{
return (mode == SImode || (TARGET_64BIT && mode == DImode));
}
@@ -8374,7 +7753,7 @@ mips_valid_pointer_mode (mode)
hold the $gp value. */
rtx
-mips16_gp_pseudo_reg ()
+mips16_gp_pseudo_reg (void)
{
if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX)
{
@@ -8416,10 +7795,7 @@ mips16_gp_pseudo_reg ()
we are copying from the floating point registers. */
static void
-mips16_fp_args (file, fp_code, from_fp_p)
- FILE *file;
- int fp_code;
- int from_fp_p;
+mips16_fp_args (FILE *file, int fp_code, int from_fp_p)
{
const char *s;
int gparg, fparg;
@@ -8479,8 +7855,7 @@ mips16_fp_args (file, fp_code, from_fp_p)
then jumps to the 16 bit code. */
static void
-build_mips16_function_stub (file)
- FILE *file;
+build_mips16_function_stub (FILE *file)
{
const char *fnname;
char *secname, *stubname;
@@ -8587,11 +7962,7 @@ static struct mips16_stub *mips16_stubs;
value if it builds the call instruction itself. */
int
-build_mips16_call_stub (retval, fn, arg_size, fp_code)
- rtx retval;
- rtx fn;
- rtx arg_size;
- int fp_code;
+build_mips16_call_stub (rtx retval, rtx fn, rtx arg_size, int fp_code)
{
int fpret;
const char *fnname;
@@ -8895,7 +8266,7 @@ build_mips16_call_stub (retval, fn, arg_size, fp_code)
generated is correct, so we do not need to catch all cases. */
static void
-mips16_optimize_gp ()
+mips16_optimize_gp (void)
{
rtx gpcopy, slot, insn;
@@ -9112,10 +8483,7 @@ struct constant
/* Add a constant to the list in *PCONSTANTS. */
static rtx
-add_constant (pconstants, val, mode)
- struct constant **pconstants;
- rtx val;
- enum machine_mode mode;
+add_constant (struct constant **pconstants, rtx val, enum machine_mode mode)
{
struct constant *c;
@@ -9135,9 +8503,7 @@ add_constant (pconstants, val, mode)
/* Dump out the constants in CONSTANTS after INSN. */
static void
-dump_constants (constants, insn)
- struct constant *constants;
- rtx insn;
+dump_constants (struct constant *constants, rtx insn)
{
struct constant *c;
int align;
@@ -9210,8 +8576,7 @@ dump_constants (constants, insn)
/* Find the symbol in an address expression. */
static rtx
-mips_find_symbol (addr)
- rtx addr;
+mips_find_symbol (rtx addr)
{
if (GET_CODE (addr) == MEM)
addr = XEXP (addr, 0);
@@ -9237,7 +8602,7 @@ mips_find_symbol (addr)
PC relative loads that are out of range. */
static void
-mips16_lay_out_constants ()
+mips16_lay_out_constants (void)
{
int insns_len, max_internal_pool_size, pool_size, addr, first_constant_ref;
rtx first, insn;
@@ -9446,9 +8811,8 @@ mips16_lay_out_constants ()
LO_REG is an rtx for the LO register, used in dependence checking. */
static void
-mips_avoid_hazard (after, insn, hilo_delay, delayed_reg, lo_reg)
- rtx after, insn, *delayed_reg, lo_reg;
- int *hilo_delay;
+mips_avoid_hazard (rtx after, rtx insn, int *hilo_delay,
+ rtx *delayed_reg, rtx lo_reg)
{
rtx pattern, set;
int nops, ninsns;
@@ -9514,7 +8878,7 @@ mips_avoid_hazard (after, insn, hilo_delay, delayed_reg, lo_reg)
.set nomacro. */
static void
-mips_avoid_hazards ()
+mips_avoid_hazards (void)
{
rtx insn, last_insn, lo_reg, delayed_reg;
int hilo_delay, i;
@@ -9550,7 +8914,7 @@ mips_avoid_hazards ()
/* Implement TARGET_MACHINE_DEPENDENT_REORG. */
static void
-mips_reorg ()
+mips_reorg (void)
{
if (TARGET_MIPS16)
{
@@ -9599,9 +8963,8 @@ mips_reorg ()
we need to use. This gets pretty messy, but it is feasible. */
int
-mips_register_move_cost (mode, to, from)
- enum machine_mode mode ATTRIBUTE_UNUSED;
- enum reg_class to, from;
+mips_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+ enum reg_class to, enum reg_class from)
{
if (from == M16_REGS && GR_REG_CLASS_P (to))
return 2;
@@ -9669,9 +9032,7 @@ mips_register_move_cost (mode, to, from)
attributes in the machine-description file. */
int
-mips_adjust_insn_length (insn, length)
- rtx insn;
- int length;
+mips_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, but
@@ -9709,7 +9070,7 @@ mips_adjust_insn_length (insn, length)
of a label into $1. */
const char *
-mips_output_load_label ()
+mips_output_load_label (void)
{
if (TARGET_EXPLICIT_RELOCS)
switch (mips_abi)
@@ -9750,18 +9111,8 @@ mips_output_load_label ()
That tells us whether to generate a simple conditional branch, or a
reversed conditional branch around a `jr' instruction. */
const char *
-mips_output_conditional_branch (insn,
- operands,
- two_operands_p,
- float_p,
- inverted_p,
- length)
- rtx insn;
- rtx *operands;
- int two_operands_p;
- int float_p;
- int inverted_p;
- int length;
+mips_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. */
@@ -9949,95 +9300,6 @@ mips_output_conditional_branch (insn,
return "";
}
- /* We do not currently use this code. It handles jumps to
- arbitrary locations, using `jr', even across a 256MB boundary.
- We could add a -mhuge switch, and then use this code instead of
- the `j' alternative above when -mhuge was used. */
-#if 0
- case 16:
- case 20:
- {
- /* Generate a reversed conditional branch around a `jr'
- instruction:
-
- .set noreorder
- .set nomacro
- .set noat
- bc l
- la $at, target
- jr $at
- .set at
- .set macro
- .set reorder
- l:
-
- Not pretty, but allows a conditional branch anywhere in the
- 32-bit address space. If the original branch is annulled,
- then the instruction in the delay slot should be executed
- only if the branch is taken. The la instruction is really
- a macro which will usually take eight bytes, but sometimes
- takes only four, if the instruction to which we're jumping
- gets its own entry in the global pointer table, which will
- happen if its a case label. The assembler will then
- generate only a four-byte sequence, rather than eight, and
- there seems to be no way to tell it not to. Thus, we can't
- just use a `.+x' addressing form; we don't know what value
- to give for `x'.
-
- So, we resort to using the explicit relocation syntax
- available in the assembler and do:
-
- lw $at,%got_page(target)($gp)
- daddiu $at,$at,%got_ofst(target)
-
- That way, this always takes up eight bytes, and we can use
- the `.+x' form. Of course, these explicit machinations
- with relocation will not work with old assemblers. Then
- again, neither do out-of-range branches, so we haven't lost
- anything. */
-
- /* The target of the reversed branch. */
- const char *const target
- = ((mips_branch_likely || length == 20) ? ".+20" : ".+16");
- const char *at_register = mips_reg_names[ASSEMBLER_SCRATCH_REGNUM];
- const char *gp_register = mips_reg_names[PIC_OFFSET_TABLE_REGNUM];
- char *c;
-
- strcpy (buffer, "%(%<%[");
- c = strchr (buffer, '\0');
- /* Generate the reversed comparison. This takes four
- bytes. */
- if (float_p)
- sprintf (c, "%%*b%s\t%%Z2%s",
- inverted_p ? comp : inverted_comp,
- target);
- else
- sprintf (c, "%%*b%s%s\t%s%s,%s",
- inverted_p ? comp : inverted_comp,
- need_z_p ? "z" : "",
- op1,
- op2,
- target);
- c = strchr (buffer, '\0');
- /* Generate the load-address, and jump. This takes twelve
- bytes, for a total of 16. */
- sprintf (c,
- "\n\tlw\t%s,%%%%got_page(%%1)(%s)\n\tdaddiu\t%s,%s,%%%%got_ofst(%%1)\n\tjr\t%s",
- at_register,
- gp_register,
- at_register,
- at_register,
- at_register);
- if (length == 20)
- /* The delay slot was unfilled. Since we're inside
- .noreorder, the assembler will not fill in the NOP for
- us, so we must do it ourselves. */
- strcat (buffer, "\n\tnop");
- strcat (buffer, "%]%>%)");
- return buffer;
- }
-#endif
-
default:
abort ();
}
@@ -10052,9 +9314,7 @@ mips_output_conditional_branch (insn,
operand 2 is zero. Otherwise just return DIVISION itself. */
const char *
-mips_output_division (division, operands)
- const char *division;
- rtx *operands;
+mips_output_division (const char *division, rtx *operands)
{
if (TARGET_CHECK_ZERO_DIV)
{
@@ -10074,8 +9334,7 @@ mips_output_division (division, operands)
Note: this function is shared between GCC and GAS. */
static bool
-mips_strict_matching_cpu_name_p (canonical, given)
- const char *canonical, *given;
+mips_strict_matching_cpu_name_p (const char *canonical, const char *given)
{
while (*given != 0 && TOLOWER (*given) == TOLOWER (*canonical))
given++, canonical++;
@@ -10091,8 +9350,7 @@ mips_strict_matching_cpu_name_p (canonical, given)
Note: this function is shared between GCC and GAS. */
static bool
-mips_matching_cpu_name_p (canonical, given)
- const char *canonical, *given;
+mips_matching_cpu_name_p (const char *canonical, const char *given)
{
/* First see if the name matches exactly, or with a final "000"
turned into "k". */
@@ -10127,8 +9385,7 @@ mips_matching_cpu_name_p (canonical, given)
A similar function exists in GAS. */
static const struct mips_cpu_info *
-mips_parse_cpu (option, cpu_string)
- const char *option, *cpu_string;
+mips_parse_cpu (const char *option, const char *cpu_string)
{
const struct mips_cpu_info *p;
const char *s;
@@ -10169,8 +9426,7 @@ mips_parse_cpu (option, cpu_string)
if the ISA isn't valid. */
static const struct mips_cpu_info *
-mips_cpu_info_from_isa (isa)
- int isa;
+mips_cpu_info_from_isa (int isa)
{
const struct mips_cpu_info *p;
@@ -10187,21 +9443,19 @@ mips_cpu_info_from_isa (isa)
On the MIPS, ignore the cost of anti- and output-dependencies. */
static int
-mips_adjust_cost (insn, link, dep, cost)
- rtx insn ATTRIBUTE_UNUSED;
- rtx link;
- rtx dep ATTRIBUTE_UNUSED;
- int cost;
+mips_adjust_cost (rtx insn ATTRIBUTE_UNUSED, rtx link,
+ rtx dep ATTRIBUTE_UNUSED, int cost)
{
if (REG_NOTE_KIND (link) != 0)
return 0; /* Anti or output dependence. */
return cost;
}
+/* Implement HARD_REGNO_NREGS. The size of FP registers are controlled
+ by UNITS_PER_FPREG. All other registers are word sized. */
+
unsigned int
-mips_hard_regno_nregs (regno, mode)
- int regno;
- enum machine_mode mode;
+mips_hard_regno_nregs (int regno, enum machine_mode mode)
{
if (! FP_REG_P (regno))
return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
@@ -10209,15 +9463,15 @@ mips_hard_regno_nregs (regno, mode)
return ((GET_MODE_SIZE (mode) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG);
}
+/* Implement RETURN_IN_MEMORY. Under the old (i.e., 32 and O64 ABIs)
+ all BLKmode objects are returned in memory. Under the new (N32 and
+ 64-bit MIPS ABIs) small structures are returned in a register.
+ Objects with varying size must still be returned in memory, of
+ course. */
+
int
-mips_return_in_memory (type)
- tree type;
+mips_return_in_memory (tree type)
{
- /* Under the old (i.e., 32 and O64 ABIs) all BLKmode objects are
- returned in memory. Under the new (N32 and 64-bit MIPS ABIs) small
- structures are returned in a register. Objects with varying size
- must still be returned in memory, of course. */
-
if (mips_abi == ABI_32 || mips_abi == ABI_O64)
return (TYPE_MODE (type) == BLKmode);
else
@@ -10226,13 +9480,15 @@ mips_return_in_memory (type)
}
static int
-mips_issue_rate ()
+mips_issue_rate (void)
{
switch (mips_tune)
{
- case PROCESSOR_R3000: return 1;
- case PROCESSOR_R5400: return 2;
- case PROCESSOR_R5500: return 2;
+ case PROCESSOR_R5400:
+ case PROCESSOR_R5500:
+ case PROCESSOR_R7000:
+ case PROCESSOR_R9000:
+ return 2;
default:
return 1;
@@ -10246,12 +9502,14 @@ mips_issue_rate ()
processors that have a DFA pipeline description. */
static int
-mips_use_dfa_pipeline_interface ()
+mips_use_dfa_pipeline_interface (void)
{
switch (mips_tune)
{
case PROCESSOR_R5400:
case PROCESSOR_R5500:
+ case PROCESSOR_R7000:
+ case PROCESSOR_R9000:
case PROCESSOR_SR71000:
return true;
@@ -10262,33 +9520,32 @@ mips_use_dfa_pipeline_interface ()
const char *
-mips_emit_prefetch (operands)
- rtx operands[];
+mips_emit_prefetch (rtx *operands)
{
- /* For the mips32/64 architectures the hint fields are arranged
- by operation (load/store) and locality (normal/streamed/retained).
- Irritatingly, numbers 2 and 3 are reserved leaving no simple
- algorithm for figuring the hint. */
+ /* For the mips32/64 architectures the hint fields are arranged
+ by operation (load/store) and locality (normal/streamed/retained).
+ Irritatingly, numbers 2 and 3 are reserved leaving no simple
+ algorithm for figuring the hint. */
- int write = INTVAL (operands[1]);
- int locality = INTVAL (operands[2]);
+ int write = INTVAL (operands[1]);
+ int locality = INTVAL (operands[2]);
- static const char * const alt[2][4] = {
- {
- "pref\t4,%a0",
- "pref\t0,%a0",
- "pref\t0,%a0",
- "pref\t6,%a0"
- },
- {
- "pref\t5,%a0",
- "pref\t1,%a0",
- "pref\t1,%a0",
- "pref\t7,%a0"
- }
- };
+ static const char * const alt[2][4] = {
+ {
+ "pref\t4,%a0",
+ "pref\t0,%a0",
+ "pref\t0,%a0",
+ "pref\t6,%a0"
+ },
+ {
+ "pref\t5,%a0",
+ "pref\t1,%a0",
+ "pref\t1,%a0",
+ "pref\t7,%a0"
+ }
+ };
- return alt[write][locality];
+ return alt[write][locality];
}
@@ -10297,10 +9554,8 @@ mips_emit_prefetch (operands)
/* Output assembly to switch to section NAME with attribute FLAGS. */
static void
-iris6_asm_named_section_1 (name, flags, align)
- const char *name;
- unsigned int flags;
- unsigned int align;
+iris6_asm_named_section_1 (const char *name, unsigned int flags,
+ unsigned int align)
{
unsigned int sh_type, sh_flags, sh_entsize;
@@ -10332,9 +9587,7 @@ iris6_asm_named_section_1 (name, flags, align)
}
static void
-iris6_asm_named_section (name, flags)
- const char *name;
- unsigned int flags;
+iris6_asm_named_section (const char *name, unsigned int flags)
{
iris6_asm_named_section_1 (name, flags, 0);
}
@@ -10353,9 +9606,7 @@ static htab_t iris_section_align_htab;
static FILE *iris_orig_asm_out_file;
static int
-iris_section_align_entry_eq (p1, p2)
- const void *p1;
- const void *p2;
+iris_section_align_entry_eq (const void *p1, const void *p2)
{
const struct iris_section_align_entry *old = p1;
const char *new = p2;
@@ -10364,17 +9615,14 @@ iris_section_align_entry_eq (p1, p2)
}
static hashval_t
-iris_section_align_entry_hash (p)
- const void *p;
+iris_section_align_entry_hash (const void *p)
{
const struct iris_section_align_entry *old = p;
return htab_hash_string (old->name);
}
void
-iris6_asm_output_align (file, log)
- FILE *file;
- unsigned int log;
+iris6_asm_output_align (FILE *file, unsigned int log)
{
const char *section = current_section_name ();
struct iris_section_align_entry **slot, *entry;
@@ -10407,7 +9655,7 @@ iris6_asm_output_align (file, log)
beginning of the file with the proper alignment attached. */
static void
-iris6_file_start ()
+iris6_file_start (void)
{
mips_file_start ();
@@ -10419,9 +9667,7 @@ iris6_file_start ()
}
static int
-iris6_section_align_1 (slot, data)
- void **slot;
- void *data ATTRIBUTE_UNUSED;
+iris6_section_align_1 (void **slot, void *data ATTRIBUTE_UNUSED)
{
const struct iris_section_align_entry *entry
= *(const struct iris_section_align_entry **) slot;
@@ -10431,8 +9677,7 @@ iris6_section_align_1 (slot, data)
}
static void
-copy_file_data (to, from)
- FILE *to, *from;
+copy_file_data (FILE *to, FILE *from)
{
char buffer[8192];
size_t len;
@@ -10452,7 +9697,7 @@ copy_file_data (to, from)
}
static void
-iris6_file_end ()
+iris6_file_end (void)
{
/* Emit section directives with the proper alignment at the top of the
real output file. */
@@ -10472,10 +9717,7 @@ iris6_file_end ()
default code. */
static unsigned int
-iris6_section_type_flags (decl, section, relocs_p)
- tree decl;
- const char *section;
- int relocs_p;
+iris6_section_type_flags (tree decl, const char *section, int relocs_p)
{
unsigned int flags;
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 2193f98e04b..b72399ee02c 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -26,8 +26,6 @@ Boston, MA 02111-1307, USA. */
/* Standard GCC variables that we reference. */
-extern char call_used_regs[];
-extern int may_call_alloca;
extern int target_flags;
/* MIPS external variables defined in mips.c. */
@@ -65,14 +63,13 @@ enum processor_type {
PROCESSOR_R5000,
PROCESSOR_R5400,
PROCESSOR_R5500,
+ PROCESSOR_R7000,
PROCESSOR_R8000,
+ PROCESSOR_R9000,
PROCESSOR_SB1,
PROCESSOR_SR71000
};
-/* Recast the cpu class to be the cpu attribute. */
-#define mips_cpu_attr ((enum attr_cpu)mips_tune)
-
/* Which ABI to use. ABI_32 (original 32, or o32), ABI_N32 (n32),
ABI_64 (n64) are all defined by SGI. ABI_O64 is o32 extended
to work on a 64 bit machine. */
@@ -83,16 +80,6 @@ enum processor_type {
#define ABI_EABI 3
#define ABI_O64 4
-/* Whether to emit abicalls code sequences or not. */
-
-enum mips_abicalls_type {
- MIPS_ABICALLS_NO,
- MIPS_ABICALLS_YES
-};
-
-/* Recast the abicalls class to be the abicalls attribute. */
-#define mips_abicalls_attr ((enum attr_abicalls)mips_abicalls)
-
/* Information about one recognized processor. Defined here for the
benefit of TARGET_CPU_CPP_BUILTINS. */
struct mips_cpu_info {
@@ -114,11 +101,6 @@ extern char mips_reg_names[][8]; /* register names (a0 vs. $4). */
extern char mips_print_operand_punct[256]; /* print_operand punctuation chars */
extern const char *current_function_file; /* filename current function is in */
extern int num_source_filenames; /* current .file # */
-extern int inside_function; /* != 0 if inside of a function */
-extern int ignore_line_number; /* != 0 if we are to ignore next .loc */
-extern int file_in_function_warning; /* warning given about .file in func */
-extern int sdb_label_count; /* block start/end next label # */
-extern int sdb_begin_function_line; /* Starting Line of current function */
extern int mips_section_threshold; /* # bytes of data/sdata cutoff */
extern int sym_lineno; /* sgi next label # for each stmt */
extern int set_noreorder; /* # of nested .set noreorder's */
@@ -131,9 +113,8 @@ extern GTY(()) rtx branch_cmp[2]; /* operands for compare */
extern enum cmp_type branch_type; /* what type of branch to use */
extern enum processor_type mips_arch; /* which cpu to codegen for */
extern enum processor_type mips_tune; /* which cpu to schedule for */
-extern enum mips_abicalls_type mips_abicalls;/* for svr4 abi pic calls */
extern int mips_isa; /* architectural level */
-extern int mips16; /* whether generating mips16 code */
+extern int mips_abi; /* which ABI to use */
extern int mips16_hard_float; /* mips16 without -msoft-float */
extern int mips_entry; /* generate entry/exit for mips16 */
extern const char *mips_arch_string; /* for -march=<xxx> */
@@ -141,7 +122,6 @@ extern const char *mips_tune_string; /* for -mtune=<xxx> */
extern const char *mips_isa_string; /* for -mips{1,2,3,4} */
extern const char *mips_abi_string; /* for -mabi={32,n32,64} */
extern const char *mips_entry_string; /* for -mentry */
-extern const char *mips_no_mips16_string;/* for -mno-mips16 */
extern const char *mips_cache_flush_func;/* for -mflush-func= and -mno-flush-func */
extern int mips_string_length; /* length of strings for mips16 */
extern const struct mips_cpu_info mips_cpu_info_table[];
@@ -173,7 +153,7 @@ extern const struct mips_cpu_info *mips_tune_info;
#define MASK_SOFT_FLOAT 0x00000100 /* software floating point */
#define MASK_FLOAT64 0x00000200 /* fp registers are 64 bits */
#define MASK_ABICALLS 0x00000400 /* emit .abicalls/.cprestore/.cpload */
-#define MASK_UNUSED1 0x00000800 /* Unused Mask. */
+#define MASK_XGOT 0x00000800 /* emit big-got PIC */
#define MASK_LONG_CALLS 0x00001000 /* Always call through a register */
#define MASK_64BIT 0x00002000 /* Use 64 bit GP registers and insns */
#define MASK_EMBEDDED_PIC 0x00004000 /* Generate embedded PIC code */
@@ -190,6 +170,7 @@ extern const struct mips_cpu_info *mips_tune_info;
#define MASK_UNINIT_CONST_IN_RODATA \
0x00800000 /* Store uninitialized
consts in rodata */
+#define MASK_FIX_SB1 0x01000000 /* Work around SB-1 errata. */
/* Debug switches, not documented */
#define MASK_DEBUG 0 /* unused */
@@ -237,6 +218,7 @@ extern const struct mips_cpu_info *mips_tune_info;
/* .abicalls, etc from Pyramid V.4 */
#define TARGET_ABICALLS (target_flags & MASK_ABICALLS)
+#define TARGET_XGOT (target_flags & MASK_XGOT)
/* software floating point */
#define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT)
@@ -275,6 +257,7 @@ extern const struct mips_cpu_info *mips_tune_info;
#define TARGET_BRANCHLIKELY (target_flags & MASK_BRANCHLIKELY)
+#define TARGET_FIX_SB1 (target_flags & MASK_FIX_SB1)
/* True if we should use NewABI-style relocation operators for
symbolic addresses. This is never true for mips16 code,
@@ -334,6 +317,8 @@ extern const struct mips_cpu_info *mips_tune_info;
#define TARGET_MIPS5KC (mips_arch == PROCESSOR_5KC)
#define TARGET_MIPS5400 (mips_arch == PROCESSOR_R5400)
#define TARGET_MIPS5500 (mips_arch == PROCESSOR_R5500)
+#define TARGET_MIPS7000 (mips_arch == PROCESSOR_R7000)
+#define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000)
#define TARGET_SB1 (mips_arch == PROCESSOR_SB1)
#define TARGET_SR71K (mips_arch == PROCESSOR_SR71000)
@@ -345,6 +330,8 @@ extern const struct mips_cpu_info *mips_tune_info;
#define TUNE_MIPS5400 (mips_tune == PROCESSOR_R5400)
#define TUNE_MIPS5500 (mips_tune == PROCESSOR_R5500)
#define TUNE_MIPS6000 (mips_tune == PROCESSOR_R6000)
+#define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000)
+#define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000)
#define TUNE_SB1 (mips_tune == PROCESSOR_SB1)
#define TUNE_SR71K (mips_tune == PROCESSOR_SR71000)
@@ -380,7 +367,7 @@ extern const struct mips_cpu_info *mips_tune_info;
/* We do this here because __mips is defined below \
and so we can't use builtin_define_std. */ \
if (!flag_iso) \
- builtin_define ("mips"); \
+ builtin_define ("mips"); \
\
/* Treat _R3000 and _R4000 like register-size defines, \
which is how they've historically been used. */ \
@@ -396,12 +383,12 @@ extern const struct mips_cpu_info *mips_tune_info;
builtin_define ("_R3000"); \
} \
if (TARGET_FLOAT64) \
- builtin_define ("__mips_fpr=64"); \
+ builtin_define ("__mips_fpr=64"); \
else \
- builtin_define ("__mips_fpr=32"); \
+ builtin_define ("__mips_fpr=32"); \
\
if (TARGET_MIPS16) \
- builtin_define ("__mips16"); \
+ builtin_define ("__mips16"); \
\
MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info); \
MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info); \
@@ -446,12 +433,12 @@ extern const struct mips_cpu_info *mips_tune_info;
} \
\
if (TARGET_HARD_FLOAT) \
- builtin_define ("__mips_hard_float"); \
+ builtin_define ("__mips_hard_float"); \
else if (TARGET_SOFT_FLOAT) \
- builtin_define ("__mips_soft_float"); \
+ builtin_define ("__mips_soft_float"); \
\
if (TARGET_SINGLE_FLOAT) \
- builtin_define ("__mips_single_float"); \
+ builtin_define ("__mips_single_float"); \
\
if (TARGET_BIG_ENDIAN) \
{ \
@@ -528,9 +515,9 @@ extern const struct mips_cpu_info *mips_tune_info;
N_("Use GP relative sdata/sbss sections (now ignored)")}, \
{"gpopt", 0, \
N_("Use GP relative sdata/sbss sections (now ignored)")}, \
- {"no-gpOPT", 0, \
+ {"no-gpOPT", 0, \
N_("Don't use GP relative sdata/sbss sections (now ignored)")}, \
- {"no-gpopt", 0, \
+ {"no-gpopt", 0, \
N_("Don't use GP relative sdata/sbss sections (now ignored)")}, \
{"stats", 0, \
N_("Output compiler statistics (now ignored)")}, \
@@ -596,6 +583,10 @@ extern const struct mips_cpu_info *mips_tune_info;
N_("Work around early 4300 hardware bug")}, \
{"no-fix4300", -MASK_4300_MUL_FIX, \
N_("Don't work around early 4300 hardware bug")}, \
+ {"fix-sb1", MASK_FIX_SB1, \
+ N_("Work around errata for early SB-1 revision 2 cores")}, \
+ {"no-fix-sb1", -MASK_FIX_SB1, \
+ N_("Don't work around errata for early SB-1 revision 2 cores")}, \
{"check-zero-division",-MASK_NO_CHECK_ZERO_DIV, \
N_("Trap on integer divide by zero")}, \
{"no-check-zero-division", MASK_NO_CHECK_ZERO_DIV, \
@@ -608,6 +599,14 @@ extern const struct mips_cpu_info *mips_tune_info;
N_("Use NewABI-style %reloc() assembly operators")}, \
{"no-explicit-relocs", -MASK_EXPLICIT_RELOCS, \
N_("Use assembler macros instead of relocation operators")}, \
+ {"ips16", MASK_MIPS16, \
+ N_("Generate mips16 code") }, \
+ {"no-mips16", -MASK_MIPS16, \
+ N_("Generate normal-mode code") }, \
+ {"xgot", MASK_XGOT, \
+ N_("Lift restrictions on GOT size") }, \
+ {"no-xgot", -MASK_XGOT, \
+ N_("Do not lift restrictions on GOT size") }, \
{"debug", MASK_DEBUG, \
NULL}, \
{"debuga", MASK_DEBUG_A, \
@@ -734,8 +733,6 @@ extern const struct mips_cpu_info *mips_tune_info;
N_("Specify a Standard MIPS ISA"), 0}, \
{ "entry", &mips_entry_string, \
N_("Use mips16 entry/exit psuedo ops"), 0}, \
- { "no-mips16", &mips_no_mips16_string, \
- N_("Don't use MIPS16 instructions"), 0}, \
{ "no-flush-func", &mips_cache_flush_func, \
N_("Don't call any cache flush functions"), 0}, \
{ "flush-func=", &mips_cache_flush_func, \
@@ -767,6 +764,8 @@ extern const struct mips_cpu_info *mips_tune_info;
#define GENERATE_MULT3_SI ((TARGET_MIPS3900 \
|| TARGET_MIPS5400 \
|| TARGET_MIPS5500 \
+ || TARGET_MIPS7000 \
+ || TARGET_MIPS9000 \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
|| ISA_MIPS64) \
@@ -936,35 +935,13 @@ extern const struct mips_cpu_info *mips_tune_info;
which write to the HI and LO registers. Most targets require a
two-instruction gap. */
#define ISA_HAS_HILO_INTERLOCKS (TARGET_MIPS5500 || TARGET_SB1)
-
-/* CC1_SPEC causes -mips3 and -mips4 to set -mfp64 and -mgp64; -mips1 or
- -mips2 sets -mfp32 and -mgp32. This can be overridden by an explicit
- -mfp32, -mfp64, -mgp32 or -mgp64. -mfp64 sets MASK_FLOAT64 in
- target_flags, and -mgp64 sets MASK_64BIT.
-
- Setting MASK_64BIT in target_flags will cause gcc to assume that
- registers are 64 bits wide. int, long and void * will be 32 bit;
- this may be changed with -mint64 or -mlong64.
-
- The gen* programs link code that refers to MASK_64BIT. They don't
- actually use the information in target_flags; they just refer to
- it. */
-/* Switch Recognition by gcc.c. Add -G xx support */
+/* Add -G xx support. */
#undef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) \
(DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-/* Sometimes certain combinations of command options do not make sense
- on a particular target machine. You can define a macro
- `OVERRIDE_OPTIONS' to take account of this. This macro, if
- defined, is executed once just after all the command options have
- been parsed.
-
- On the MIPS, it is used to handle -G. We also use it to set up all
- of the tables referenced in the other macros. */
-
#define OVERRIDE_OPTIONS override_options ()
#define CONDITIONAL_REGISTER_USAGE mips_conditional_register_usage ()
@@ -1002,8 +979,6 @@ extern const struct mips_cpu_info *mips_tune_info;
#define SUBTARGET_TARGET_SWITCHES
-extern int mips_abi;
-
#ifndef MIPS_ABI_DEFAULT
#define MIPS_ABI_DEFAULT ABI_32
#endif
@@ -1112,49 +1087,10 @@ extern int mips_abi;
%{membedded-pic} \
%{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \
%{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} \
-%{mgp32} %{mgp64} %{march=*} \
+%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \
%(target_asm_spec) \
%(subtarget_asm_spec)"
-/* Specify to run a post-processor, mips-tfile after the assembler
- has run to stuff the mips debug information into the object file.
- This is needed because the $#!%^ MIPS assembler provides no way
- of specifying such information in the assembly file. If we are
- cross compiling, disable mips-tfile unless the user specifies
- -mmips-tfile. */
-
-#ifndef ASM_FINAL_SPEC
-#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0
-/* GAS */
-#define ASM_FINAL_SPEC "\
-%{mmips-as: %{!mno-mips-tfile: \
- \n mips-tfile %{v*: -v} \
- %{K: -I %b.o~} \
- %{!K: %{save-temps: -I %b.o~}} \
- %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
- %{.s:%i} %{!.s:%g.s}}}"
-
-#else
-/* not GAS */
-#define ASM_FINAL_SPEC "\
-%{!mgas: %{!mno-mips-tfile: \
- \n mips-tfile %{v*: -v} \
- %{K: -I %b.o~} \
- %{!K: %{save-temps: -I %b.o~}} \
- %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
- %{.s:%i} %{!.s:%g.s}}}"
-
-#endif
-#endif /* ASM_FINAL_SPEC */
-
-/* Redefinition of libraries used. Mips doesn't support normal
- UNIX style profiling via calling _mcount. It does offer
- profiling that samples the PC, so do what we can... */
-
-#ifndef LIB_SPEC
-#define LIB_SPEC "%{pg:-lprof1} %{p:-lprof1} -lc"
-#endif
-
/* Extra switches sometimes passed to the linker. */
/* ??? The bestGnum will never be passed to the linker, because the gcc driver
will interpret it as a -b option. */
@@ -1176,9 +1112,6 @@ extern int mips_abi;
#endif
/* CC1_SPEC is the set of arguments to pass to the compiler proper. */
-/* Note, we will need to adjust the following if we ever find a MIPS variant
- that has 32-bit GPRs and 64-bit FPRs as well as fix all of the reload bugs
- that show up in this case. */
#ifndef CC1_SPEC
#define CC1_SPEC "\
@@ -1239,32 +1172,9 @@ extern int mips_abi;
#endif
-/* Print subsidiary information on the compiler version in use. */
-
-#define MIPS_VERSION "[AL 1.1, MM 40]"
-
-#ifndef MACHINE_TYPE
-#define MACHINE_TYPE "BSD Mips"
-#endif
-
-#ifndef TARGET_VERSION_INTERNAL
-#define TARGET_VERSION_INTERNAL(STREAM) \
- fprintf (STREAM, " %s %s", MIPS_VERSION, MACHINE_TYPE)
-#endif
-
-#ifndef TARGET_VERSION
-#define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)
-#endif
-
-
-#define SDB_DEBUGGING_INFO 1 /* generate info for mips-tfile */
#define DBX_DEBUGGING_INFO 1 /* generate stabs (OSF/rose) */
#define MIPS_DEBUGGING_INFO 1 /* MIPS specific debugging info */
-#ifndef PREFERRED_DEBUGGING_TYPE /* assume SDB_DEBUGGING_INFO */
-#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
-#endif
-
/* By default, turn on GDB extensions. */
#define DEFAULT_GDB_EXTENSIONS 1
@@ -1292,12 +1202,6 @@ extern int mips_abi;
#define USER_LABEL_PREFIX ""
#endif
-/* Forward references to tags are allowed. */
-#define SDB_ALLOW_FORWARD_REFERENCES
-
-/* Unknown tags are also allowed. */
-#define SDB_ALLOW_UNKNOWN_REFERENCES
-
/* On Sun 4, this limit is 2048. We use 1500 to be safe,
since the length can run past this up to a continuation point. */
#undef DBX_CONTIN_LENGTH
@@ -1306,10 +1210,7 @@ extern int mips_abi;
/* How to renumber registers for dbx and gdb. */
#define DBX_REGISTER_NUMBER(REGNO) mips_dbx_regno[ (REGNO) ]
-/* The mapping from gcc register number to DWARF 2 CFA column number.
- This mapping does not allow for tracking register 0, since SGI's broken
- dwarf reader thinks column 0 is used for the frame address, but since
- register 0 is fixed this is not a problem. */
+/* The mapping from gcc register number to DWARF 2 CFA column number. */
#define DWARF_FRAME_REGNUM(REG) \
(REG == GP_REG_FIRST + 31 ? DWARF_FRAME_RETURN_COLUMN : REG)
@@ -1320,7 +1221,9 @@ extern int mips_abi;
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31)
/* Describe how we implement __builtin_eh_return. */
-#define EH_RETURN_DATA_REGNO(N) ((N) < (TARGET_MIPS16 ? 2 : 4) ? (N) + GP_ARG_FIRST : INVALID_REGNUM)
+#define EH_RETURN_DATA_REGNO(N) \
+ ((N) < (TARGET_MIPS16 ? 2 : 4) ? (N) + GP_ARG_FIRST : INVALID_REGNUM)
+
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, GP_REG_FIRST + 3)
/* Offsets recorded in opcodes are a multiple of this alignment factor.
@@ -1330,60 +1233,6 @@ extern int mips_abi;
#define FIND_BASE_TERM(X) mips_delegitimize_address (X)
-#define PUT_SDB_DEF(a) \
-do { \
- fprintf (asm_out_file, "\t%s.def\t", \
- (TARGET_GAS) ? "" : "#"); \
- ASM_OUTPUT_LABELREF (asm_out_file, a); \
- fputc (';', asm_out_file); \
-} while (0)
-
-#define PUT_SDB_PLAIN_DEF(a) \
-do { \
- fprintf (asm_out_file, "\t%s.def\t.%s;", \
- (TARGET_GAS) ? "" : "#", (a)); \
-} while (0)
-
-/* For block start and end, we create labels, so that
- later we can figure out where the correct offset is.
- The normal .ent/.end serve well enough for functions,
- so those are just commented out. */
-
-#define PUT_SDB_BLOCK_START(LINE) \
-do { \
- fprintf (asm_out_file, \
- "%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (TARGET_GAS) ? "" : "#", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (LINE)); \
- sdb_label_count++; \
-} while (0)
-
-#define PUT_SDB_BLOCK_END(LINE) \
-do { \
- fprintf (asm_out_file, \
- "%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (TARGET_GAS) ? "" : "#", \
- LOCAL_LABEL_PREFIX, \
- sdb_label_count, \
- (LINE)); \
- sdb_label_count++; \
-} while (0)
-
-#define PUT_SDB_FUNCTION_START(LINE)
-
-#define PUT_SDB_FUNCTION_END(LINE) \
-do { \
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \
-} while (0)
-
-#define PUT_SDB_EPILOGUE_END(NAME)
-
/* 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
@@ -1395,22 +1244,11 @@ do { \
mips_debugger_offset (X, (HOST_WIDE_INT) 0)
#define DEBUGGER_ARG_OFFSET(OFFSET, X) \
mips_debugger_offset (X, (HOST_WIDE_INT) OFFSET)
-
-/* Tell collect that the object format is ECOFF */
-#define OBJECT_FORMAT_COFF /* Object file looks like COFF */
-#define EXTENDED_COFF /* ECOFF, not normal coff */
/* Target machine storage layout */
-/* Define this if most significant bit is lowest numbered
- in instructions that operate on numbered bit-fields.
-*/
#define BITS_BIG_ENDIAN 0
-
-/* Define this if most significant byte of a word is the lowest numbered. */
#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
-
-/* Define this if most significant word of a multiword number is the lowest. */
#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
/* Define this to set the endianness to use in libgcc2.c, which can
@@ -1446,11 +1284,6 @@ do { \
/* The number of bytes in a double. */
#define UNITS_PER_DOUBLE (TYPE_PRECISION (double_type_node) / BITS_PER_UNIT)
-/* A C expression for the size in bits of the type `int' on the
- target machine. If you don't define this, the default is one
- word. */
-#define INT_TYPE_SIZE (TARGET_INT64 ? 64 : 32)
-
/* Tell the preprocessor the maximum size of wchar_t. */
#ifndef MAX_WCHAR_TYPE_SIZE
#ifndef WCHAR_TYPE_SIZE
@@ -1458,36 +1291,16 @@ do { \
#endif
#endif
-/* A C expression for the size in bits of the type `short' on the
- target machine. If you don't define this, the default is half a
- word. (If this would be less than one storage unit, it is
- rounded up to one unit.) */
+/* Set the sizes of the core types. */
#define SHORT_TYPE_SIZE 16
-
-/* A C expression for the size in bits of the type `long' on the
- target machine. If you don't define this, the default is one
- word. */
+#define INT_TYPE_SIZE (TARGET_INT64 ? 64 : 32)
#define LONG_TYPE_SIZE (TARGET_LONG64 ? 64 : 32)
-#define MAX_LONG_TYPE_SIZE 64
-
-/* A C expression for the size in bits of the type `long long' on the
- target machine. If you don't define this, the default is two
- words. */
#define LONG_LONG_TYPE_SIZE 64
-/* A C expression for the size in bits of the type `float' on the
- target machine. If you don't define this, the default is one
- word. */
-#define FLOAT_TYPE_SIZE 32
+#define MAX_LONG_TYPE_SIZE 64
-/* A C expression for the size in bits of the type `double' on the
- target machine. If you don't define this, the default is two
- words. */
+#define FLOAT_TYPE_SIZE 32
#define DOUBLE_TYPE_SIZE 64
-
-/* A C expression for the size in bits of the type `long double' on
- the target machine. If you don't define this, the default is two
- words. */
#define LONG_DOUBLE_TYPE_SIZE \
(mips_abi == ABI_N32 || mips_abi == ABI_64 ? 128 : 64)
@@ -1530,8 +1343,7 @@ do { \
/* There is no point aligning anything to a rounder boundary than this. */
#define BIGGEST_ALIGNMENT LONG_DOUBLE_TYPE_SIZE
-/* Set this nonzero if move instructions will actually fail to work
- when given unaligned data. */
+/* All accesses must be aligned. */
#define STRICT_ALIGNMENT 1
/* Define this if you wish to imitate the way many other C compilers
@@ -1592,27 +1404,18 @@ do { \
|| TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
-/* Force right-alignment for small varargs in 32 bit little_endian mode */
-
-#define PAD_VARARGS_DOWN (TARGET_64BIT ? BYTES_BIG_ENDIAN : !BYTES_BIG_ENDIAN)
-
-/* Define this macro if an argument declared as `char' or `short' in a
- prototype should actually be passed as an `int'. In addition to
- avoiding errors in certain cases of mismatch, it also makes for
- better code on certain machines. */
+#define PAD_VARARGS_DOWN \
+ (FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward)
+/* Arguments declared as 'char' or 'short' in a prototype should be
+ passed as 'int's. */
#define PROMOTE_PROTOTYPES 1
/* Define if operations between registers always perform the operation
on the full register even if a narrower mode is specified. */
#define WORD_REGISTER_OPERATIONS
-/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
- will either zero-extend or sign-extend. The value of this macro should
- be the code that says which one of the two operations is implicitly
- done, NIL if none.
-
- When in 64 bit mode, mips_move_1word will sign extend SImode and CCmode
+/* When in 64 bit mode, move insns will sign extend SImode and CCmode
moves. All other references are zero extended. */
#define LOAD_EXTEND_OP(MODE) \
(TARGET_64BIT && ((MODE) == SImode || (MODE) == CCmode) \
@@ -1647,26 +1450,22 @@ do { \
/* Standard register usage. */
-/* Number of actual hardware registers.
- The hardware registers are assigned numbers for the compiler
- from 0 to just below FIRST_PSEUDO_REGISTER.
- All registers that the compiler knows about must be given numbers,
- even those that are not normally considered general registers.
+/* Number of hardware registers. We have:
- On the Mips, we have 32 integer registers, 32 floating point
- registers, 8 condition code registers, and the special registers
- hi and lo. After that we have 32 COP0 registers, 32 COP2 registers,
- and 32 COP3 registers. (COP1 is the floating-point processor.)
- The 8 condition code registers are only used if mips_isa >= 4. */
+ - 32 integer registers
+ - 32 floating point registers
+ - 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. */
#define FIRST_PSEUDO_REGISTER 176
-/* 1 for registers that have pervasive standard uses
- and are not available for the register allocator.
-
- On the MIPS, see conventions, page D-2 */
+/* By default, fix the kernel registers ($26 and $27), the global
+ pointer ($28) and the stack pointer ($29). This can change
+ depending on the command-line options.
-/* Regarding coprocessor registers: without evidence to the contrary,
+ Regarding coprocessor registers: without evidence to the contrary,
it's best to assume that each coprocessor register has a unique
use. This can be overridden, in, e.g., override_options() or
CONDITIONAL_REGISTER_USAGE should the assumption be inappropriate
@@ -1691,8 +1490,10 @@ do { \
}
-/* Don't mark $31 as a call-clobbered register. The idea is that
- it's really the call instructions themselves which clobber $31.
+/* Set up this array for o32 by default.
+
+ Note that we don't mark $31 as a call-clobbered register. The idea is
+ that it's really the call instructions themselves which clobber $31.
We don't care what the called function does with it afterwards.
This approach makes it easier to implement sibcalls. Unlike normal
@@ -1718,14 +1519,8 @@ do { \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \
}
-/* Like `CALL_USED_REGISTERS' but used to overcome a historical
- problem which makes CALL_USED_REGISTERS *always* include
- all the FIXED_REGISTERS. Until this problem has been
- resolved this macro can be used to overcome this situation.
- In particular, block_propagate() requires this list
- be accurate, or we can remove registers which should be live.
- This macro is used in regs_invalidated_by_call. */
+/* Define this since $28, though fixed, is call-saved in many ABIs. */
#define CALL_REALLY_USED_REGISTERS \
{ /* General registers. */ \
@@ -1790,8 +1585,8 @@ do { \
#define HI_REGNUM (MD_REG_FIRST + 0)
#define LO_REGNUM (MD_REG_FIRST + 1)
-/* FPSW_REGNUM is the single condition code used if mips_isa < 4. If
- mips_isa >= 4, it should not be used, and an arbitrary ST_REG
+/* FPSW_REGNUM is the single condition code used if !ISA_HAS_8CC.
+ If ISA_HAS_8CC, it should not be used, and an arbitrary ST_REG
should be used instead. */
#define FPSW_REGNUM ST_REG_FIRST
@@ -1822,24 +1617,10 @@ do { \
(COP0_REG_P (REGNO) ? '0' : COP2_REG_P (REGNO) ? '2' \
: COP3_REG_P (REGNO) ? '3' : '?')
-/* Return number of consecutive hard regs needed starting at reg REGNO
- to hold something of mode MODE.
- This is ordinarily the length in words of a value of mode MODE
- but can be less for certain modes in special long registers.
-
- On the MIPS, all general registers are one word long. Except on
- the R4000 with the FR bit set, the floating point uses register
- pairs, with the second register not being allocable. */
#define HARD_REGNO_NREGS(REGNO, MODE) mips_hard_regno_nregs (REGNO, MODE)
-/* Value is 1 if hard register REGNO can hold a value of machine-mode
- MODE. In 32 bit mode, require that DImode and DFmode be in even
- registers. For DImode, this makes some of the insns easier to
- write, since you don't have to worry about a DImode value in
- registers 3 & 4, producing a result in 4 & 5.
-
- To make the code simpler HARD_REGNO_MODE_OK now just references an
+/* To make the code simpler, HARD_REGNO_MODE_OK just references an
array built in override_options. Because machmodes.h is not yet
included before this file is processed, the MODE bound can't be
expressed here. */
@@ -1859,25 +1640,15 @@ extern char mips_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
== (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \
GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT))
-/* MIPS pc is not overloaded on a register. */
-/* #define PC_REGNUM xx */
-
/* Register to use for pushing function arguments. */
#define STACK_POINTER_REGNUM (GP_REG_FIRST + 29)
-/* Offset from the stack pointer to the first available location. Use
- the default value zero. */
-/* #define STACK_POINTER_OFFSET 0 */
-
/* Base register for access to local variables of the function. We
pretend that the frame pointer is $1, and then eliminate it to
HARD_FRAME_POINTER_REGNUM. We can get away with this because $1 is
a fixed register, and will not be used for anything else. */
#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 1)
-/* Temporary scratch register for use by the assembler. */
-#define ASSEMBLER_SCRATCH_REGNUM (GP_REG_FIRST + 1)
-
/* $30 is not available on the mips16, so we use $17 as the frame
pointer. */
#define HARD_FRAME_POINTER_REGNUM \
@@ -1895,14 +1666,7 @@ extern char mips_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
/* Register in which static-chain is passed to a function. */
#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2)
-/* If the structure value address is passed in a register, then
- `STRUCT_VALUE_REGNUM' should be the number of that register. */
-/* #define STRUCT_VALUE_REGNUM (GP_REG_FIRST + 4) */
-
-/* If the structure value address is not passed in a register, define
- `STRUCT_VALUE' as an expression returning an RTX for the place
- where the address is passed. If it returns 0, the address is
- passed as an "invisible" first argument. */
+/* Pass structure addresses as an "invisible" first argument. */
#define STRUCT_VALUE 0
/* Mips registers used in prologue/epilogue code when the stack frame
@@ -2040,31 +1804,31 @@ enum reg_class
sub-initializer must be suitable as an initializer for the type
`HARD_REG_SET' which is defined in `hard-reg-set.h'. */
-#define REG_CLASS_CONTENTS \
-{ \
+#define REG_CLASS_CONTENTS \
+{ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* no registers */ \
{ 0x0003000c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 nonarg regs */\
{ 0x000300fc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 registers */ \
{ 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 T register */ \
{ 0x010300fc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 and T regs */ \
{ 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* SVR4 PIC function address register */ \
- { 0xfdffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* Every other GPR */ \
+ { 0xfdffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* Every other GPR */ \
{ 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* integer registers */ \
{ 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* floating registers*/ \
{ 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 }, /* hi register */ \
{ 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000 }, /* lo register */ \
{ 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000 }, /* mul/div registers */ \
- { 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000 }, /* cop0 registers */ \
- { 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000 }, /* cop2 registers */ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff }, /* cop3 registers */ \
+ { 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000 }, /* cop0 registers */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000 }, /* cop2 registers */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff }, /* cop3 registers */ \
{ 0xffffffff, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 }, /* union classes */ \
{ 0xffffffff, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000 }, \
{ 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x00000000, 0x00000000 }, \
- { 0xffffffff, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000 }, \
- { 0xffffffff, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000 }, \
- { 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff }, \
- { 0x00000000, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \
- { 0xffffffff, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \
+ { 0xffffffff, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000 }, \
+ { 0xffffffff, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000 }, \
+ { 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff }, \
+ { 0x00000000, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \
+ { 0xffffffff, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \
{ 0x00000000, 0x00000000, 0x000007f8, 0x00000000, 0x00000000, 0x00000000 }, /* status registers */ \
{ 0xffffffff, 0xffffffff, 0xffff07ff, 0xffffffff, 0xffffffff, 0x0000ffff } /* all registers */ \
}
@@ -2347,36 +2111,6 @@ extern enum reg_class mips_char_to_class[256];
+ (TARGET_ABICALLS && !TARGET_NEWABI \
? MIPS_STACK_ALIGN (UNITS_PER_WORD) : 0))
-/* Offset from the stack pointer register to an item dynamically
- allocated on the stack, e.g., by `alloca'.
-
- The default value for this macro is `STACK_POINTER_OFFSET' plus the
- length of the outgoing arguments. The default is correct for most
- machines. See `function.c' for details.
-
- The MIPS ABI states that functions which dynamically allocate the
- stack must not have 0 for STACK_DYNAMIC_OFFSET, since it looks like
- we are trying to create a second frame pointer to the function, so
- allocate some stack space to make it happy.
-
- However, the linker currently complains about linking any code that
- dynamically allocates stack space, and there seems to be a bug in
- STACK_DYNAMIC_OFFSET, so don't define this right now. */
-
-#if 0
-#define STACK_DYNAMIC_OFFSET(FUNDECL) \
- ((current_function_outgoing_args_size == 0 && current_function_calls_alloca) \
- ? 4*UNITS_PER_WORD \
- : current_function_outgoing_args_size)
-#endif
-
-/* The return address for the current frame is in r31 if this is a leaf
- function. Otherwise, it is on the stack. It is at a variable offset
- from sp/fp/ap, so we define a fake hard register rap which is a
- pointer to the return address on the stack. This always gets eliminated
- during reload to be either the frame pointer or the stack pointer plus
- an offset. */
-
#define RETURN_ADDR_RTX mips_return_addr
/* Since the mips16 ISA mode is encoded in the least-significant bit
@@ -2391,33 +2125,7 @@ extern enum reg_class mips_char_to_class[256];
#define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_delta
-/* If defined, this macro specifies a table of register pairs used to
- eliminate unneeded registers that point into the stack frame. If
- it is not defined, the only elimination attempted by the compiler
- is to replace references to the frame pointer with references to
- the stack pointer.
-
- The definition of this macro is a list of structure
- initializations, each of which specifies an original and
- replacement register.
-
- On some machines, the position of the argument pointer is not
- known until the compilation is completed. In such a case, a
- separate hard register must be used for the argument pointer.
- This register can be eliminated by replacing it with either the
- frame pointer or the argument pointer, depending on whether or not
- the frame pointer has been eliminated.
-
- In this case, you might specify:
- #define ELIMINABLE_REGS \
- {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
- {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
- {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
-
- Note that the elimination of the argument pointer with the stack
- pointer is specified first since that is the preferred elimination.
-
- The eliminations to $17 are only used on the mips16. See the
+/* The eliminations to $17 are only used for mips16 code. See the
definition of HARD_FRAME_POINTER_REGNUM. */
#define ELIMINABLE_REGS \
@@ -2428,88 +2136,37 @@ extern enum reg_class mips_char_to_class[256];
{ FRAME_POINTER_REGNUM, GP_REG_FIRST + 30}, \
{ FRAME_POINTER_REGNUM, GP_REG_FIRST + 17}}
-/* A C expression that returns nonzero if the compiler is allowed to
- try to replace register number FROM-REG with register number
- TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
- defined, and will usually be the constant 1, since most of the
- cases preventing register elimination are things that the compiler
- already knows about.
-
- When not in mips16 and mips64, we can always eliminate to the
- frame pointer. We can eliminate to the stack pointer unless
- a frame pointer is needed. In mips16 mode, we need a frame
- pointer for a large frame; otherwise, reload may be unable
- to compute the address of a local variable, since there is
- no way to add a large constant to the stack pointer
+/* We can always eliminate to the hard frame pointer. We can eliminate
+ to the stack pointer unless a frame pointer is needed.
+
+ In mips16 mode, we need a frame pointer for a large frame; otherwise,
+ reload may be unable to compute the address of a local variable,
+ since there is no way to add a large constant to the stack pointer
without using a temporary register.
- In mips16, for some instructions (eg lwu), we can't eliminate the
+ Also, for some mips16 instructions (eg lwu), we can't eliminate the
frame pointer for the stack pointer. These instructions are
- only generated in TARGET_64BIT mode.
- */
-
+ only generated in TARGET_64BIT mode. */
#define CAN_ELIMINATE(FROM, TO) \
- (((TO) == HARD_FRAME_POINTER_REGNUM \
- || ((TO) == STACK_POINTER_REGNUM && ! frame_pointer_needed \
- && ! (TARGET_MIPS16 && TARGET_64BIT) \
- && (! TARGET_MIPS16 \
- || compute_frame_size (get_frame_size ()) < 32768))))
+ ((TO) == HARD_FRAME_POINTER_REGNUM \
+ || ((TO) == STACK_POINTER_REGNUM && !frame_pointer_needed \
+ && !(TARGET_MIPS16 && TARGET_64BIT) \
+ && (!TARGET_MIPS16 \
+ || compute_frame_size (get_frame_size ()) < 32768)))
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
- (OFFSET) = mips_initial_elimination_offset ((FROM), (TO))
-
-/* If we generate an insn to push BYTES bytes,
- this says how many the stack pointer really advances by.
- On the VAX, sp@- in a byte insn really pushes a word. */
-
-/* #define PUSH_ROUNDING(BYTES) 0 */
-
-/* If defined, the maximum amount of space required for outgoing
- arguments will be computed and placed into the variable
- `current_function_outgoing_args_size'. No space will be pushed
- onto the stack for each call; instead, the function prologue
- should increase the stack frame size by this amount.
+ (OFFSET) = mips_initial_elimination_offset ((FROM), (TO))
- It is not proper to define both `PUSH_ROUNDING' and
- `ACCUMULATE_OUTGOING_ARGS'. */
+/* Allocate stack space for arguments at the beginning of each function. */
#define ACCUMULATE_OUTGOING_ARGS 1
-/* Offset from the argument pointer register to the first argument's
- address. On some machines it may depend on the data type of the
- function.
-
- If `ARGS_GROW_DOWNWARD', this is the offset to the location above
- the first argument's address.
-
- On the MIPS, we must skip the first argument position if we are
- returning a structure or a union, to account for its address being
- passed in $4. However, at the current time, this produces a compiler
- that can't bootstrap, so comment it out for now. */
-
-#if 0
-#define FIRST_PARM_OFFSET(FNDECL) \
- (FNDECL != 0 \
- && TREE_TYPE (FNDECL) != 0 \
- && TREE_TYPE (TREE_TYPE (FNDECL)) != 0 \
- && (TREE_CODE (TREE_TYPE (TREE_TYPE (FNDECL))) == RECORD_TYPE \
- || TREE_CODE (TREE_TYPE (TREE_TYPE (FNDECL))) == UNION_TYPE) \
- ? UNITS_PER_WORD \
- : 0)
-#else
+/* The argument pointer always points to the first argument. */
#define FIRST_PARM_OFFSET(FNDECL) 0
-#endif
-
-/* When a parameter is passed in a register, stack space is still
- allocated for it. For the MIPS, stack space must be allocated, cf
- Asm Lang Prog Guide page 7-8.
-
- BEWARE that some space is also allocated for non existing arguments
- in register. In case an argument list is of form GF used registers
- are a0 (a2,a3), but we should push over a1... */
-#define REG_PARM_STACK_SPACE(FNDECL) \
- ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
- ? (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD) - FIRST_PARM_OFFSET (FNDECL) \
+/* o32 and o64 reserve stack space for all argument registers. */
+#define REG_PARM_STACK_SPACE(FNDECL) \
+ ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
+ ? (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD) \
: 0)
/* Define this if it is the responsibility of the caller to
@@ -2524,35 +2181,8 @@ extern enum reg_class mips_char_to_class[256];
? 64 : 128)
-/* A C expression that should indicate the number of bytes of its
- own arguments that a function pops on returning, or 0
- if the function pops no arguments and the caller must therefore
- pop them all after the function returns.
-
- FUNDECL is the declaration node of the function (as a tree).
-
- FUNTYPE is a C variable whose value is a tree node that
- describes the function in question. Normally it is a node of
- type `FUNCTION_TYPE' that describes the data type of the function.
- From this it is possible to obtain the data types of the value
- and arguments (if known).
-
- When a call to a library function is being considered, FUNTYPE
- will contain an identifier node for the library function. Thus,
- if you need to distinguish among various library functions, you
- can do so by their names. Note that "library function" in this
- context means a function used to perform arithmetic, whose name
- is known specially in the compiler and was not mentioned in the
- C code being compiled.
-
- STACK-SIZE is the number of bytes of arguments passed on the
- stack. If a variable number of bytes is passed, it is zero, and
- argument popping will always be the responsibility of the
- calling function. */
-
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
/* Symbolic macros for the registers used to return integer and floating
point values. */
@@ -2573,19 +2203,9 @@ extern enum reg_class mips_char_to_class[256];
#define FP_ARG_FIRST (FP_REG_FIRST + 12)
#define FP_ARG_LAST (FP_ARG_FIRST + MAX_ARGS_IN_REGISTERS - 1)
-/* Define how to find the value returned by a library function
- assuming the value has mode MODE. Because we define
- PROMOTE_FUNCTION_RETURN, we must promote the mode just as
- PROMOTE_MODE does. */
-
#define LIBCALL_VALUE(MODE) \
mips_function_value (NULL_TREE, NULL, (MODE))
-/* Define how to find the value returned by a function.
- VALTYPE is the data type of the value (as a tree).
- If the precise function being called is known, FUNC is its FUNCTION_DECL;
- otherwise, FUNC is 0. */
-
#define FUNCTION_VALUE(VALTYPE, FUNC) \
mips_function_value ((VALTYPE), (FUNC), VOIDmode)
@@ -2607,26 +2227,7 @@ extern enum reg_class mips_char_to_class[256];
&& ((N) % FP_INC == 0) && mips_abi != ABI_O64)) \
&& !fixed_regs[N])
-/* A C expression which can inhibit the returning of certain function
- values in registers, based on the type of value. A nonzero value says
- to return the function value in memory, just as large structures are
- always returned. Here TYPE will be a C expression of type
- `tree', representing the data type of the value.
-
- Note that values of mode `BLKmode' must be explicitly
- handled by this macro. Also, the option `-fpcc-struct-return'
- takes effect regardless of this macro. On most systems, it is
- possible to leave the macro undefined; this causes a default
- definition to be used, whose value is the constant 1 for BLKmode
- values, and 0 otherwise.
-
- GCC normally converts 1 byte structures into chars, 2 byte
- structs into shorts, and 4 byte structs into ints, and returns
- them this way. Defining the following macro overrides this,
- to give us MIPS cc compatibility. */
-
-#define RETURN_IN_MEMORY(TYPE) \
- mips_return_in_memory (TYPE)
+#define RETURN_IN_MEMORY(TYPE) mips_return_in_memory (TYPE)
#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
(PRETEND_SIZE) = mips_setup_incoming_varargs (&(CUM), (MODE), \
@@ -2634,19 +2235,12 @@ extern enum reg_class mips_char_to_class[256];
#define STRICT_ARGUMENT_NAMING (mips_abi != ABI_32 && mips_abi != ABI_O64)
-/* Define a data type for recording info about an argument list
- during the scan of that argument list. This data type should
- hold all necessary information about the function itself
- and about the args processed so far, enough to enable macros
- such as FUNCTION_ARG to determine where the next arg should go.
-
- This structure has to cope with two different argument allocation
+/* This structure has to cope with two different argument allocation
schemes. Most MIPS ABIs view the arguments as a struct, of which the
first N words go in registers and the rest go on the stack. If I < N,
the Ith word might go in Ith integer argument register or the
- Ith floating-point one. In some cases, it has to go in both (see
- function_arg). For these ABIs, we only need to remember the number
- of words passed so far.
+ Ith floating-point one. For these ABIs, we only need to remember
+ the number of words passed so far.
The EABI instead allocates the integer and floating-point arguments
separately. The first N words of FP arguments go in FP registers,
@@ -2700,15 +2294,6 @@ typedef struct mips_args {
/* True if the function has a prototype. */
int prototype;
-
- /* When a structure does not take up a full register, the argument
- should sometimes be shifted left so that it occupies the high part
- of the register. These two fields describe an array of ashl
- patterns for doing this. See function_arg_advance, which creates
- the shift patterns, and function_arg, which returns them when given
- a VOIDmode argument. */
- unsigned int num_adjusts;
- rtx adjust[BIGGEST_MAX_ARGS_IN_REGISTERS];
} CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
@@ -2766,35 +2351,23 @@ typedef struct mips_args {
#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)
-#define FUNCTION_ARG_PADDING(MODE, TYPE) \
- (! BYTES_BIG_ENDIAN \
- ? upward \
- : (((MODE) == BLKmode \
- ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
- && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT))\
- : (GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY \
- && (mips_abi == ABI_32 \
- || mips_abi == ABI_O64 \
- || mips_abi == ABI_EABI \
- || GET_MODE_CLASS (MODE) == MODE_INT))) \
- ? downward : upward))
+#define FUNCTION_ARG_PADDING(MODE, TYPE) \
+ (mips_pad_arg_upward (MODE, TYPE) ? upward : downward)
+
+#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
+ (mips_pad_reg_upward (MODE, TYPE) ? upward : downward)
#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \
(mips_abi == ABI_EABI && (NAMED) \
&& FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED))
-/* Modified version of the macro in expr.h. */
+/* Modified version of the macro in expr.h. Only return true if
+ the type has a variable size or if the front end requires it
+ to be passed by reference. */
#define MUST_PASS_IN_STACK(MODE,TYPE) \
((TYPE) != 0 \
&& (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
- || TREE_ADDRESSABLE (TYPE) \
- || ((MODE) == BLKmode \
- && mips_abi != ABI_32 && mips_abi != ABI_O64 \
- && ! ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
- && 0 == (int_size_in_bytes (TYPE) \
- % (PARM_BOUNDARY / BITS_PER_UNIT))) \
- && (FUNCTION_ARG_PADDING (MODE, TYPE) \
- == (BYTES_BIG_ENDIAN ? upward : downward)))))
+ || TREE_ADDRESSABLE (TYPE)))
/* True if using EABI and varargs can be passed in floating-point
registers. Under these conditions, we need a more complex form
@@ -3090,9 +2663,7 @@ typedef struct mips_args {
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction.
- ??? Using HImode in mips16 mode can cause overflow. However, the
- overflow is no more likely than the overflow in a branch
- instruction. Large functions can currently break in both ways. */
+ ??? Using HImode in mips16 mode can cause overflow. */
#define CASE_VECTOR_MODE \
(TARGET_MIPS16 ? HImode : ptr_mode)
@@ -3226,13 +2797,11 @@ typedef struct mips_args {
{"symbolic_operand", { CONST, SYMBOL_REF, LABEL_REF }}, \
{"const_arith_operand", { CONST, CONST_INT }}, \
{"arith_operand", { REG, CONST_INT, CONST, SUBREG, ADDRESSOF }}, \
- {"arith32_operand", { REG, CONST_INT, SUBREG, ADDRESSOF }}, \
{"reg_or_0_operand", { REG, CONST_INT, CONST_DOUBLE, SUBREG, ADDRESSOF }}, \
- {"true_reg_or_0_operand", { REG, CONST_INT, CONST_DOUBLE, SUBREG, ADDRESSOF }}, \
{"small_int", { CONST_INT }}, \
- {"large_int", { CONST_INT }}, \
{"mips_const_double_ok", { CONST_DOUBLE }}, \
{"const_float_1_operand", { CONST_DOUBLE }}, \
+ {"reg_or_const_float_1_operand", { CONST_DOUBLE, REG}}, \
{"simple_memory_operand", { MEM, SUBREG }}, \
{"equality_op", { EQ, NE }}, \
{"cmp_op", { EQ, NE, GT, GE, GTU, GEU, LT, LE, \
@@ -3641,12 +3210,7 @@ do \
while (0)
-/* How to tell the debugger about changes of source files. Note, the
- mips ECOFF format cannot deal with changes of files inside of
- functions, which means the output of parser generators like bison
- is generally not debuggable without using the -l switch. Lose,
- lose, lose. Silicon graphics seems to want all .file's hardwired
- to 1. */
+/* How to tell the debugger about changes of source files. */
#ifndef SET_FILE_NUMBER
#define SET_FILE_NUMBER() ++num_source_filenames
@@ -3688,23 +3252,9 @@ while (0)
$Lc[0-9]+ Label for use in s<xx> operation.
$Le[0-9]+ End blocks for MIPS debug support */
-/* A C statement (sans semicolon) to output to the stdio stream
- STREAM any text necessary for declaring the name NAME of an
- initialized variable which is being defined. This macro must
- output the label definition (perhaps using `ASM_OUTPUT_LABEL').
- The argument DECL is the `VAR_DECL' tree node representing the
- variable.
-
- If this macro is not defined, then the variable name is defined
- in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
-
#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
-do \
- { \
- mips_declare_object (STREAM, NAME, "", ":\n", 0); \
- } \
-while (0)
+#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
+ mips_declare_object (STREAM, NAME, "", ":\n", 0)
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl\t"
@@ -3810,7 +3360,7 @@ do { \
do { \
if (TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
function_section (current_function_decl); \
- (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
} while (0)
/* This is how to output an assembler line
@@ -3899,29 +3449,14 @@ while (0)
#define ASM_COMMENT_START " #"
#endif
-
-/* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for
- and mips-tdump.c to print them out.
-
- These must match the corresponding definitions in gdb/mipsread.c.
- Unfortunately, gcc and gdb do not currently share any directories. */
-
-#define CODE_MASK 0x8F300
-#define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK)
-#define MIPS_MARK_STAB(code) ((code)+CODE_MASK)
-#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
-
-
/* Default definitions for size_t and ptrdiff_t. We must override the
definitions from ../svr4.h on mips-*-linux-gnu. */
-#ifndef SIZE_TYPE
+#undef SIZE_TYPE
#define SIZE_TYPE (POINTER_SIZE == 64 ? "long unsigned int" : "unsigned int")
-#endif
-#ifndef PTRDIFF_TYPE
+#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE (POINTER_SIZE == 64 ? "long int" : "int")
-#endif
/* See mips_expand_prologue's use of loadgp for when this should be
true. */
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 0be11733250..7b5f1b7433c 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -30,29 +30,29 @@
[(UNSPEC_LOAD_DF_LOW 0)
(UNSPEC_LOAD_DF_HIGH 1)
(UNSPEC_STORE_DF_HIGH 2)
- (UNSPEC_GET_FNADDR 4)
- (UNSPEC_BLOCKAGE 6)
- (UNSPEC_CPRESTORE 8)
- (UNSPEC_EH_RECEIVER 10)
- (UNSPEC_EH_RETURN 11)
- (UNSPEC_CONSTTABLE_QI 12)
- (UNSPEC_CONSTTABLE_HI 13)
- (UNSPEC_CONSTTABLE_SI 14)
- (UNSPEC_CONSTTABLE_DI 15)
- (UNSPEC_CONSTTABLE_SF 16)
- (UNSPEC_CONSTTABLE_DF 17)
- (UNSPEC_ALIGN_2 18)
- (UNSPEC_ALIGN_4 19)
- (UNSPEC_ALIGN_8 20)
- (UNSPEC_HIGH 22)
- (UNSPEC_LWL 23)
- (UNSPEC_LWR 24)
- (UNSPEC_SWL 25)
- (UNSPEC_SWR 26)
- (UNSPEC_LDL 27)
- (UNSPEC_LDR 28)
- (UNSPEC_SDL 29)
- (UNSPEC_SDR 30)
+ (UNSPEC_GET_FNADDR 3)
+ (UNSPEC_BLOCKAGE 4)
+ (UNSPEC_CPRESTORE 5)
+ (UNSPEC_EH_RECEIVER 6)
+ (UNSPEC_EH_RETURN 7)
+ (UNSPEC_CONSTTABLE_QI 8)
+ (UNSPEC_CONSTTABLE_HI 9)
+ (UNSPEC_CONSTTABLE_SI 10)
+ (UNSPEC_CONSTTABLE_DI 11)
+ (UNSPEC_CONSTTABLE_SF 12)
+ (UNSPEC_CONSTTABLE_DF 13)
+ (UNSPEC_ALIGN_2 14)
+ (UNSPEC_ALIGN_4 15)
+ (UNSPEC_ALIGN_8 16)
+ (UNSPEC_HIGH 17)
+ (UNSPEC_LWL 18)
+ (UNSPEC_LWR 19)
+ (UNSPEC_SWL 20)
+ (UNSPEC_SWR 21)
+ (UNSPEC_LDL 22)
+ (UNSPEC_LDR 23)
+ (UNSPEC_SDL 24)
+ (UNSPEC_SDR 25)
;; Constants used in relocation unspecs. RELOC_GOT_PAGE and RELOC_GOT_DISP
;; are really only available for n32 and n64. However, it is convenient
@@ -69,7 +69,6 @@
(RELOC_LOADGP_HI 108)
(RELOC_LOADGP_LO 109)])
-
;; ....................
;;
;; Attributes
@@ -81,10 +80,12 @@
(define_attr "jal" "unset,direct,indirect"
(const_string "unset"))
-;; True for multi-instruction jal macros. jal is always a macro
-;; in SVR4 PIC since it includes an instruction to restore $gp.
-;; Direct jals are also macros in NewABI PIC since they load the
-;; target address into $25.
+;; This attribute is YES if the instruction is a jal macro (not a
+;; real jal instruction).
+;;
+;; jal is always a macro in SVR4 PIC since it includes an instruction to
+;; restore $gp. Direct jals are also macros in NewABI PIC since they
+;; load the target address into $25.
(define_attr "jal_macro" "no,yes"
(cond [(eq_attr "jal" "direct")
(symbol_ref "TARGET_ABICALLS != 0")
@@ -100,6 +101,7 @@
;; store store instruction(s)
;; prefetch memory prefetch
;; move data movement within same register set
+;; condmove conditional moves
;; xfer transfer to/from coprocessor
;; hilo transfer of hi/lo registers
;; arith integer arithmetic instruction
@@ -122,30 +124,53 @@
;; multi multiword sequence (or user asm statements)
;; nop no operation
(define_attr "type"
- "unknown,branch,jump,call,load,store,prefetch,move,xfer,hilo,const,arith,darith,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop"
+ "unknown,branch,jump,call,load,store,prefetch,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")]
(const_string "unknown")))
;; Main data type used by the insn
-(define_attr "mode" "unknown,none,QI,HI,SI,DI,SF,DF,FPSW" (const_string "unknown"))
+(define_attr "mode" "unknown,none,QI,HI,SI,DI,SF,DF,FPSW"
+ (const_string "unknown"))
;; Is this an extended instruction in mips16 mode?
(define_attr "extended_mips16" "no,yes"
(const_string "no"))
-;; Length (in # of bytes). A conditional branch is allowed only to a
-;; location within a signed 18-bit offset of the delay slot. If that
-;; provides too smal a range, we use the `j' instruction. This
-;; instruction takes a 28-bit value, but that value is not an offset.
-;; Instead, it's bitwise-ored with the high-order four bits of the
-;; instruction in the delay slot, which means it cannot be used to
-;; cross a 256MB boundary. We could fall back back on the jr,
-;; instruction which allows full access to the entire address space,
-;; but we do not do so at present.
-
+;; Length of instruction in bytes.
(define_attr "length" ""
- (cond [(eq_attr "type" "branch")
+ (cond [;; Direct branch instructions have a range of [-0x40000,0x3fffc].
+ ;; If a branch is outside this range, we have a choice of two
+ ;; sequences. For PIC, an out-of-range branch like:
+ ;;
+ ;; bne r1,r2,target
+ ;; dslot
+ ;;
+ ;; becomes the equivalent of:
+ ;;
+ ;; beq r1,r2,1f
+ ;; dslot
+ ;; la $at,target
+ ;; jr $at
+ ;; nop
+ ;; 1:
+ ;;
+ ;; where the load address can be up to three instructions long
+ ;; (lw, nop, addiu).
+ ;;
+ ;; The non-PIC case is similar except that we use a direct
+ ;; jump instead of an la/jr pair. Since the target of this
+ ;; jump is an absolute 28-bit bit address (the other bits
+ ;; coming from the address of the delay slot) this form cannot
+ ;; cross a 256MB boundary. We could provide the option of
+ ;; using la/jr in this case too, but we do not do so at
+ ;; present.
+ ;;
+ ;; Note that this value does not account for the delay slot
+ ;; instruction, whose length is added separately. If the RTL
+ ;; pattern has no explicit delay slot, mips_adjust_insn_length
+ ;; will add the length of the implicit nop.
+ (eq_attr "type" "branch")
(cond [(lt (abs (minus (match_dup 1) (plus (pc) (const_int 4))))
(const_int 131072))
(const_int 4)
@@ -153,12 +178,14 @@
(const_int 0))
(const_int 24)
] (const_int 12))
+
(eq_attr "type" "const")
(symbol_ref "mips_const_insns (operands[1]) * 4")
(eq_attr "type" "load")
(symbol_ref "mips_fetch_insns (operands[1]) * 4")
(eq_attr "type" "store")
(symbol_ref "mips_fetch_insns (operands[0]) * 4")
+
;; In the worst case, a call macro will take 8 instructions:
;;
;; lui $25,%call_hi(FOO)
@@ -171,9 +198,11 @@
;; nop
(eq_attr "jal_macro" "yes")
(const_int 32)
+
(and (eq_attr "extended_mips16" "yes")
(ne (symbol_ref "TARGET_MIPS16") (const_int 0)))
(const_int 8)
+
(and (eq_attr "type" "idiv")
(ne (symbol_ref "TARGET_CHECK_ZERO_DIV") (const_int 0)))
(cond [(ne (symbol_ref "TARGET_MIPS16") (const_int 0))
@@ -183,19 +212,9 @@
;; Attribute describing the processor. This attribute must match exactly
;; with the processor_type enumeration in mips.h.
-
-;; Attribute describing the processor
-;; (define_attr "cpu" "default,r3000,r6000,r4000"
-;; (const
-;; (cond [(eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R3000")) (const_string "r3000")
-;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R4000")) (const_string "r4000")
-;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R6000")) (const_string "r6000")]
-;; (const_string "default"))))
-
-;; ??? Fix everything that tests this attribute.
(define_attr "cpu"
- "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4300,r4600,r4650,r5000,r5400,r5500,r8000,sb1,sr71000"
- (const (symbol_ref "mips_cpu_attr")))
+ "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000"
+ (const (symbol_ref "mips_tune")))
;; The type of hardware hazard associated with this instruction.
;; DELAY means that the next instruction cannot read the result
@@ -238,28 +257,24 @@
(const_string "no")))
;; Attribute defining whether or not we can use the branch-likely instructions
-
(define_attr "branch_likely" "no,yes"
(const
(if_then_else (ne (symbol_ref "GENERATE_BRANCHLIKELY") (const_int 0))
(const_string "yes")
(const_string "no"))))
-
;; Describe a user's asm statement.
(define_asm_attributes
[(set_attr "type" "multi")])
-
-
;; .........................
;;
-;; Delay slots, can't describe load/fcmp/xfer delay slots here
+;; Branch, call and jump delay slots
;;
;; .........................
(define_delay (and (eq_attr "type" "branch")
- (eq (symbol_ref "mips16") (const_int 0)))
+ (eq (symbol_ref "TARGET_MIPS16") (const_int 0)))
[(eq_attr "can_delay" "yes")
(nil)
(and (eq_attr "branch_likely" "yes")
@@ -275,9 +290,7 @@
[(eq_attr "can_delay" "yes")
(nil)
(nil)])
-
-
;; .........................
;;
;; Functional units
@@ -319,7 +332,7 @@
;; selecting instructions to between the two instructions.
(define_function_unit "imuldiv" 1 0
- (and (eq_attr "type" "hilo") (ne (symbol_ref "mips16") (const_int 0)))
+ (and (eq_attr "type" "hilo") (ne (symbol_ref "TARGET_MIPS16") (const_int 0)))
1 5)
(define_function_unit "imuldiv" 1 0
@@ -592,39 +605,14 @@
(and (eq_attr "mode" "DF") (eq_attr "cpu" "r4300")))
58 58)
-;; The following functional units do not use the cpu type, and use
-;; much less memory in genattrtab.c.
-
-;; (define_function_unit "memory" 1 0 (eq_attr "type" "load") 3 0)
-;; (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0)
-;;
-;; (define_function_unit "fp_comp" 1 0 (eq_attr "type" "fcmp") 2 0)
-;;
-;; (define_function_unit "transfer" 1 0 (eq_attr "type" "xfer") 2 0)
-;; (define_function_unit "transfer" 1 0 (eq_attr "type" "hilo") 3 0)
-;;
-;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "imul") 17 0)
-;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "idiv") 38 0)
-;;
-;; (define_function_unit "adder" 1 1 (eq_attr "type" "fadd") 4 0)
-;; (define_function_unit "adder" 1 1 (eq_attr "type" "fabs,fneg") 2 0)
-;;
-;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "SF")) 7 0)
-;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "DF")) 8 0)
-;;
-;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "SF")) 23 0)
-;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "DF")) 36 0)
-;;
-;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "SF")) 54 0)
-;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "DF")) 112 0)
-
;; Include scheduling descriptions.
(include "5400.md")
(include "5500.md")
+(include "7000.md")
+(include "9000.md")
(include "sr71k.md")
-
-
+
;;
;; ....................
;;
@@ -636,39 +624,46 @@
(define_insn "trap"
[(trap_if (const_int 1) (const_int 0))]
""
- "*
{
if (ISA_HAS_COND_TRAP)
- return \"teq\\t$0,$0\";
+ return "teq\t$0,$0";
/* The IRIX 6 O32 assembler requires the first break operand. */
- else if (TARGET_MIPS16 || ! TARGET_GAS)
- return \"break 0\";
+ else if (TARGET_MIPS16 || !TARGET_GAS)
+ return "break 0";
else
- return \"break\";
-}")
+ return "break";
+})
(define_expand "conditional_trap"
[(trap_if (match_operator 0 "cmp_op"
[(match_dup 2) (match_dup 3)])
(match_operand 1 "const_int_operand" ""))]
"ISA_HAS_COND_TRAP"
- "
{
- mips_gen_conditional_trap (operands);
- DONE;
-}")
-
-;; Match a TRAP_IF with 2nd arg of 0. The div_trap_* insns match a
-;; 2nd arg of any CONST_INT, so this insn must appear first.
-;; gen_div_trap always generates TRAP_IF with 2nd arg of 6 or 7.
+ if (operands[1] == const0_rtx)
+ {
+ mips_gen_conditional_trap (operands);
+ DONE;
+ }
+ else
+ FAIL;
+})
(define_insn ""
[(trap_if (match_operator 0 "trap_cmp_op"
- [(match_operand:SI 1 "reg_or_0_operand" "d")
- (match_operand:SI 2 "nonmemory_operand" "dI")])
+ [(match_operand:SI 1 "reg_or_0_operand" "dJ")
+ (match_operand:SI 2 "arith_operand" "dI")])
(const_int 0))]
"ISA_HAS_COND_TRAP"
- "t%C0\\t%z1,%z2")
+ "t%C0\t%z1,%z2")
+
+(define_insn ""
+ [(trap_if (match_operator 0 "trap_cmp_op"
+ [(match_operand:DI 1 "reg_or_0_operand" "dJ")
+ (match_operand:DI 2 "arith_operand" "dI")])
+ (const_int 0))]
+ "TARGET_64BIT && ISA_HAS_COND_TRAP"
+ "t%C0\t%z1,%z2")
;;
;; ....................
@@ -683,7 +678,7 @@
(plus:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "add.d\\t%0,%1,%2"
+ "add.d\t%0,%1,%2"
[(set_attr "type" "fadd")
(set_attr "mode" "DF")])
@@ -692,7 +687,7 @@
(plus:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "add.s\\t%0,%1,%2"
+ "add.s\t%0,%1,%2"
[(set_attr "type" "fadd")
(set_attr "mode" "SF")])
@@ -701,7 +696,6 @@
(plus:SI (match_operand:SI 1 "reg_or_0_operand" "")
(match_operand:SI 2 "arith_operand" "")))]
""
- "
{
/* If a large stack adjustment was forced into a register, we may be
asked to generate rtx such as:
@@ -723,7 +717,7 @@
emit_move_insn (operands[0], tmp);
DONE;
}
-}")
+})
(define_insn "addsi3_internal"
[(set (match_operand:SI 0 "register_operand" "=d,d")
@@ -731,8 +725,8 @@
(match_operand:SI 2 "arith_operand" "d,Q")))]
"!TARGET_MIPS16"
"@
- addu\\t%0,%z1,%2
- addiu\\t%0,%z1,%2"
+ addu\t%0,%z1,%2
+ addiu\t%0,%z1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -745,7 +739,7 @@
(plus:SI (reg:SI 29)
(match_operand:SI 0 "small_int" "I")))]
"TARGET_MIPS16"
- "addu\\t%$,%$,%0"
+ "addu\t%$,%$,%0"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set (attr "length") (if_then_else (match_operand:VOID 0 "m16_simm8_8" "")
@@ -757,7 +751,7 @@
(plus:SI (reg:SI 29)
(match_operand:SI 1 "small_int" "I")))]
"TARGET_MIPS16"
- "addu\\t%0,%$,%1"
+ "addu\t%0,%$,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set (attr "length") (if_then_else (match_operand:VOID 1 "m16_uimm8_4" "")
@@ -781,12 +775,12 @@
|| REGNO (operands[2]) == ARG_POINTER_REGNUM
|| REGNO (operands[2]) == FRAME_POINTER_REGNUM
|| REGNO (operands[2]) == STACK_POINTER_REGNUM)"
- "*
{
if (REGNO (operands[0]) == REGNO (operands[1]))
- return \"addu\\t%0,%2\";
- return \"addu\\t%0,%1,%2\";
-}"
+ return "addu\t%0,%2";
+ else
+ return "addu\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -819,7 +813,6 @@
&& INTVAL (operands[1]) >= - 0x80 - 0x80))"
[(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[1]);
@@ -833,7 +826,7 @@
operands[1] = GEN_INT (- 0x80);
operands[2] = GEN_INT (val + 0x80);
}
-}")
+})
(define_split
[(set (match_operand:SI 0 "register_operand" "")
@@ -852,7 +845,6 @@
&& INTVAL (operands[2]) >= - 0x8 - 0x80))"
[(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[2]);
@@ -866,7 +858,7 @@
operands[2] = GEN_INT (- 0x8);
operands[3] = GEN_INT (val + 0x8);
}
-}")
+})
(define_expand "adddi3"
[(parallel [(set (match_operand:DI 0 "register_operand" "")
@@ -874,7 +866,6 @@
(match_operand:DI 2 "arith_operand" "")))
(clobber (match_dup 3))])]
"TARGET_64BIT || (!TARGET_DEBUG_G_MODE && !TARGET_MIPS16)"
- "
{
/* If a large stack adjustment was forced into a register, we may be
asked to generate rtx such as:
@@ -905,7 +896,7 @@
}
operands[3] = gen_reg_rtx (SImode);
-}")
+})
(define_insn "adddi3_internal_1"
[(set (match_operand:DI 0 "register_operand" "=d,&d")
@@ -913,13 +904,12 @@
(match_operand:DI 2 "register_operand" "d,d")))
(clobber (match_operand:SI 3 "register_operand" "=d,d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
{
return (REGNO (operands[0]) == REGNO (operands[1])
&& REGNO (operands[0]) == REGNO (operands[2]))
- ? \"srl\\t%3,%L0,31\;sll\\t%M0,%M0,1\;sll\\t%L0,%L1,1\;addu\\t%M0,%M0,%3\"
- : \"addu\\t%L0,%L1,%L2\;sltu\\t%3,%L0,%L2\;addu\\t%M0,%M1,%M2\;addu\\t%M0,%M0,%3\";
-}"
+ ? "srl\t%3,%L0,31\;sll\t%M0,%M0,1\;sll\t%L0,%L1,1\;addu\t%M0,%M0,%3"
+ : "addu\t%L0,%L1,%L2\;sltu\t%3,%L0,%L2\;addu\t%M0,%M1,%M2\;addu\t%M0,%M0,%3";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "16")])
@@ -991,9 +981,9 @@
(clobber (match_operand:SI 3 "register_operand" "=d,d,d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
"@
- addu\\t%L0,%L1,%2\;sltu\\t%3,%L0,%2\;addu\\t%M0,%M1,%3
- move\\t%L0,%L1\;move\\t%M0,%M1
- subu\\t%L0,%L1,%n2\;sltu\\t%3,%L0,%2\;subu\\t%M0,%M1,1\;addu\\t%M0,%M0,%3"
+ addu\t%L0,%L1,%2\;sltu\t%3,%L0,%2\;addu\t%M0,%M1,%3
+ move\t%L0,%L1\;move\t%M0,%M1
+ subu\t%L0,%L1,%n2\;sltu\t%3,%L0,%2\;subu\t%M0,%M1,1\;addu\t%M0,%M0,%3"
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "12,8,16")])
@@ -1052,8 +1042,8 @@
(match_operand:DI 2 "arith_operand" "d,Q")))]
"TARGET_64BIT && !TARGET_MIPS16"
"@
- daddu\\t%0,%z1,%2
- daddiu\\t%0,%z1,%2"
+ daddu\t%0,%z1,%2
+ daddiu\t%0,%z1,%2"
[(set_attr "type" "darith")
(set_attr "mode" "DI")])
@@ -1066,7 +1056,7 @@
(plus:DI (reg:DI 29)
(match_operand:DI 0 "small_int" "I")))]
"TARGET_MIPS16 && TARGET_64BIT"
- "daddu\\t%$,%$,%0"
+ "daddu\t%$,%$,%0"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set (attr "length") (if_then_else (match_operand:VOID 0 "m16_simm8_8" "")
@@ -1078,7 +1068,7 @@
(plus:DI (reg:DI 29)
(match_operand:DI 1 "small_int" "I")))]
"TARGET_MIPS16 && TARGET_64BIT"
- "daddu\\t%0,%$,%1"
+ "daddu\t%0,%$,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set (attr "length") (if_then_else (match_operand:VOID 0 "m16_uimm5_4" "")
@@ -1102,12 +1092,12 @@
|| REGNO (operands[2]) == ARG_POINTER_REGNUM
|| REGNO (operands[2]) == FRAME_POINTER_REGNUM
|| REGNO (operands[2]) == STACK_POINTER_REGNUM)"
- "*
{
if (REGNO (operands[0]) == REGNO (operands[1]))
- return \"daddu\\t%0,%2\";
- return \"daddu\\t%0,%1,%2\";
-}"
+ return "daddu\t%0,%2";
+ else
+ return "daddu\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr_alternative "length"
@@ -1140,7 +1130,6 @@
&& INTVAL (operands[1]) >= - 0x10 - 0x10))"
[(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1)))
(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[1]);
@@ -1154,7 +1143,7 @@
operands[1] = GEN_INT (- 0x10);
operands[2] = GEN_INT (val + 0x10);
}
-}")
+})
(define_split
[(set (match_operand:DI 0 "register_operand" "")
@@ -1173,7 +1162,6 @@
&& INTVAL (operands[2]) >= - 0x8 - 0x10))"
[(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))
(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[2]);
@@ -1187,7 +1175,7 @@
operands[2] = GEN_INT (- 0x8);
operands[3] = GEN_INT (val + 0x8);
}
-}")
+})
(define_insn "addsi3_internal_2"
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -1195,8 +1183,8 @@
(match_operand:SI 2 "arith_operand" "d,Q"))))]
"TARGET_64BIT && !TARGET_MIPS16"
"@
- addu\\t%0,%z1,%2
- addiu\\t%0,%z1,%2"
+ addu\t%0,%z1,%2
+ addiu\t%0,%z1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -1205,12 +1193,12 @@
(sign_extend:DI (plus:SI (match_operand:SI 1 "register_operand" "0,d,d")
(match_operand:SI 2 "arith_operand" "Q,O,d"))))]
"TARGET_MIPS16 && TARGET_64BIT"
- "*
{
if (REGNO (operands[0]) == REGNO (operands[1]))
- return \"addu\\t%0,%2\";
- return \"addu\\t%0,%1,%2\";
-}"
+ return "addu\t%0,%2";
+ else
+ return "addu\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -1221,7 +1209,6 @@
(const_int 4)
(const_int 8))
(const_int 4)])])
-
;;
;; ....................
@@ -1236,7 +1223,7 @@
(minus:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "sub.d\\t%0,%1,%2"
+ "sub.d\t%0,%1,%2"
[(set_attr "type" "fadd")
(set_attr "mode" "DF")])
@@ -1245,165 +1232,32 @@
(minus:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "sub.s\\t%0,%1,%2"
+ "sub.s\t%0,%1,%2"
[(set_attr "type" "fadd")
(set_attr "mode" "SF")])
(define_expand "subsi3"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
- (match_operand:SI 2 "arith_operand" "dI")))]
+ [(set (match_operand:SI 0 "register_operand" "")
+ (minus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))]
""
- "
-{
- if (GET_CODE (operands[2]) == CONST_INT
- && (INTVAL (operands[2]) == -32768
- || (TARGET_MIPS16
- && INTVAL (operands[2]) == -0x4000)))
- operands[2] = force_reg (SImode, operands[2]);
-}")
+ "")
(define_insn "subsi3_internal"
[(set (match_operand:SI 0 "register_operand" "=d")
- (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
- (match_operand:SI 2 "arith_operand" "dI")))]
- "!TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
- "subu\\t%0,%z1,%2"
+ (minus:SI (match_operand:SI 1 "register_operand" "d")
+ (match_operand:SI 2 "register_operand" "d")))]
+ ""
+ "subu\t%0,%z1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
-;; For the mips16, we need to recognize stack pointer subtractions
-;; explicitly, since we don't have a constraint for $sp. These insns
-;; will be generated by the save_restore_insns functions.
-
-(define_insn ""
- [(set (reg:SI 29)
- (minus:SI (reg:SI 29)
- (match_operand:SI 0 "small_int" "I")))]
- "TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
- "addu\\t%$,%$,%n0"
- [(set_attr "type" "arith")
- (set_attr "mode" "SI")
- (set (attr "length") (if_then_else (match_operand:VOID 0 "m16_nsimm8_8" "")
- (const_int 4)
- (const_int 8)))])
-
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=d")
- (minus:SI (reg:SI 29)
- (match_operand:SI 1 "small_int" "I")))]
- "TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
- "addu\\t%0,%$,%n1"
- [(set_attr "type" "arith")
- (set_attr "mode" "SI")
- (set (attr "length") (if_then_else (match_operand:VOID 1 "m16_nuimm8_4" "")
- (const_int 4)
- (const_int 8)))])
-
-
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=d,d,d")
- (minus:SI (match_operand:SI 1 "register_operand" "0,d,d")
- (match_operand:SI 2 "arith_operand" "I,O,d")))]
- "TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT
- || (INTVAL (operands[2]) != -32768 && INTVAL (operands[2]) != -0x4000))"
- "*
-{
- if (REGNO (operands[0]) == REGNO (operands[1]))
- return \"subu\\t%0,%2\";
- return \"subu\\t%0,%1,%2\";
-}"
- [(set_attr "type" "arith")
- (set_attr "mode" "SI")
- (set_attr_alternative "length"
- [(if_then_else (match_operand:VOID 2 "m16_nsimm8_1" "")
- (const_int 4)
- (const_int 8))
- (if_then_else (match_operand:VOID 2 "m16_nsimm4_1" "")
- (const_int 4)
- (const_int 8))
- (const_int 4)])])
-
-;; On the mips16, we can sometimes split a subtract of a constant
-;; which is a 4 byte instruction into two adds which are both 2 byte
-;; instructions. There are two cases: one where we are setting a
-;; register to a register minus a constant, and one where we are
-;; simply subtracting a constant from a register.
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (minus:SI (match_dup 0)
- (match_operand:SI 1 "const_int_operand" "")))]
- "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE
- && GET_CODE (operands[0]) == REG
- && M16_REG_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == CONST_INT
- && ((INTVAL (operands[1]) > 0x80
- && INTVAL (operands[1]) <= 0x80 + 0x80)
- || (INTVAL (operands[1]) < - 0x7f
- && INTVAL (operands[1]) >= - 0x7f - 0x7f))"
- [(set (match_dup 0) (minus:SI (match_dup 0) (match_dup 1)))
- (set (match_dup 0) (minus:SI (match_dup 0) (match_dup 2)))]
- "
-{
- HOST_WIDE_INT val = INTVAL (operands[1]);
-
- if (val >= 0)
- {
- operands[1] = GEN_INT (0x80);
- operands[2] = GEN_INT (val - 0x80);
- }
- else
- {
- operands[1] = GEN_INT (- 0x7f);
- operands[2] = GEN_INT (val + 0x7f);
- }
-}")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (minus:SI (match_operand:SI 1 "register_operand" "")
- (match_operand:SI 2 "const_int_operand" "")))]
- "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE
- && GET_CODE (operands[0]) == REG
- && M16_REG_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == REG
- && M16_REG_P (REGNO (operands[1]))
- && REGNO (operands[0]) != REGNO (operands[1])
- && GET_CODE (operands[2]) == CONST_INT
- && ((INTVAL (operands[2]) > 0x8
- && INTVAL (operands[2]) <= 0x8 + 0x80)
- || (INTVAL (operands[2]) < - 0x7
- && INTVAL (operands[2]) >= - 0x7 - 0x7f))"
- [(set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))
- (set (match_dup 0) (minus:SI (match_dup 0) (match_dup 3)))]
- "
-{
- HOST_WIDE_INT val = INTVAL (operands[2]);
-
- if (val >= 0)
- {
- operands[2] = GEN_INT (0x8);
- operands[3] = GEN_INT (val - 0x8);
- }
- else
- {
- operands[2] = GEN_INT (- 0x7);
- operands[3] = GEN_INT (val + 0x7);
- }
-}")
-
(define_expand "subdi3"
[(parallel [(set (match_operand:DI 0 "register_operand" "=d")
(minus:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")))
(clobber (match_dup 3))])]
"TARGET_64BIT || (!TARGET_DEBUG_G_MODE && !TARGET_MIPS16)"
- "
{
if (TARGET_64BIT)
{
@@ -1413,7 +1267,7 @@
}
operands[3] = gen_reg_rtx (SImode);
-}")
+})
(define_insn "subdi3_internal"
[(set (match_operand:DI 0 "register_operand" "=d")
@@ -1421,7 +1275,7 @@
(match_operand:DI 2 "register_operand" "d")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "sltu\\t%3,%L1,%L2\;subu\\t%L0,%L1,%L2\;subu\\t%M0,%M1,%M2\;subu\\t%M0,%M0,%3"
+ "sltu\t%3,%L1,%L2\;subu\t%L0,%L1,%L2\;subu\t%M0,%M1,%M2\;subu\t%M0,%M0,%3"
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "16")])
@@ -1482,247 +1336,24 @@
(match_dup 3)))]
"")
-(define_insn "subdi3_internal_2"
- [(set (match_operand:DI 0 "register_operand" "=d,d,d")
- (minus:DI (match_operand:DI 1 "register_operand" "d,d,d")
- (match_operand:DI 2 "small_int" "P,J,N")))
- (clobber (match_operand:SI 3 "register_operand" "=d,d,d"))]
- "!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
- && INTVAL (operands[2]) != -32768"
- "@
- sltu\\t%3,%L1,%2\;subu\\t%L0,%L1,%2\;subu\\t%M0,%M1,%3
- move\\t%L0,%L1\;move\\t%M0,%M1
- sltu\\t%3,%L1,%2\;subu\\t%L0,%L1,%2\;subu\\t%M0,%M1,1\;subu\\t%M0,%M0,%3"
- [(set_attr "type" "darith")
- (set_attr "mode" "DI")
- (set_attr "length" "12,8,16")])
-
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (minus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "small_int" "")))
- (clobber (match_operand:SI 3 "register_operand" ""))]
- "reload_completed && !WORDS_BIG_ENDIAN && !TARGET_64BIT
- && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
- && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
- && INTVAL (operands[2]) > 0"
-
- [(set (match_dup 3)
- (ltu:SI (subreg:SI (match_dup 1) 0)
- (match_dup 2)))
-
- (set (subreg:SI (match_dup 0) 0)
- (minus:SI (subreg:SI (match_dup 1) 0)
- (match_dup 2)))
-
- (set (subreg:SI (match_dup 0) 4)
- (minus:SI (subreg:SI (match_dup 1) 4)
- (match_dup 3)))]
- "")
-
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (minus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "small_int" "")))
- (clobber (match_operand:SI 3 "register_operand" ""))]
- "reload_completed && WORDS_BIG_ENDIAN && !TARGET_64BIT
- && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
- && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
- && INTVAL (operands[2]) > 0"
-
- [(set (match_dup 3)
- (ltu:SI (subreg:SI (match_dup 1) 4)
- (match_dup 2)))
-
- (set (subreg:SI (match_dup 0) 4)
- (minus:SI (subreg:SI (match_dup 1) 4)
- (match_dup 2)))
-
- (set (subreg:SI (match_dup 0) 0)
- (minus:SI (subreg:SI (match_dup 1) 0)
- (match_dup 3)))]
- "")
-
(define_insn "subdi3_internal_3"
[(set (match_operand:DI 0 "register_operand" "=d")
- (minus:DI (match_operand:DI 1 "reg_or_0_operand" "dJ")
- (match_operand:DI 2 "arith_operand" "dI")))]
- "TARGET_64BIT && !TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
- "*
-{
- return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
- ? \"daddu\\t%0,%z1,%n2\"
- : \"dsubu\\t%0,%z1,%2\";
-}"
+ (minus:DI (match_operand:DI 1 "register_operand" "d")
+ (match_operand:DI 2 "register_operand" "d")))]
+ "TARGET_64BIT"
+ "dsubu\t%0,%1,%2"
[(set_attr "type" "darith")
(set_attr "mode" "DI")])
-;; For the mips16, we need to recognize stack pointer subtractions
-;; explicitly, since we don't have a constraint for $sp. These insns
-;; will be generated by the save_restore_insns functions.
-
-(define_insn ""
- [(set (reg:DI 29)
- (minus:DI (reg:DI 29)
- (match_operand:DI 0 "small_int" "I")))]
- "TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
- "daddu\\t%$,%$,%n0"
- [(set_attr "type" "arith")
- (set_attr "mode" "DI")
- (set (attr "length") (if_then_else (match_operand:VOID 0 "m16_nsimm8_8" "")
- (const_int 4)
- (const_int 8)))])
-
-(define_insn ""
- [(set (match_operand:DI 0 "register_operand" "=d")
- (minus:DI (reg:DI 29)
- (match_operand:DI 1 "small_int" "I")))]
- "TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
- "daddu\\t%0,%$,%n1"
- [(set_attr "type" "arith")
- (set_attr "mode" "DI")
- (set (attr "length") (if_then_else (match_operand:VOID 0 "m16_nuimm5_4" "")
- (const_int 4)
- (const_int 8)))])
-
-(define_insn ""
- [(set (match_operand:DI 0 "register_operand" "=d,d,d")
- (minus:DI (match_operand:DI 1 "register_operand" "0,d,d")
- (match_operand:DI 2 "arith_operand" "I,O,d")))]
- "TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT
- || (INTVAL (operands[2]) != -32768 && INTVAL (operands[2]) != -0x4000))"
- "*
-{
- if (REGNO (operands[0]) == REGNO (operands[1]))
- return \"dsubu\\t%0,%2\";
- return \"dsubu\\t%0,%1,%2\";
-}"
- [(set_attr "type" "arith")
- (set_attr "mode" "DI")
- (set_attr_alternative "length"
- [(if_then_else (match_operand:VOID 2 "m16_nsimm5_1" "")
- (const_int 4)
- (const_int 8))
- (if_then_else (match_operand:VOID 2 "m16_nsimm4_1" "")
- (const_int 4)
- (const_int 8))
- (const_int 4)])])
-
-;; On the mips16, we can sometimes split an add of a constant which is
-;; a 4 byte instruction into two adds which are both 2 byte
-;; instructions. There are two cases: one where we are adding a
-;; constant plus a register to another register, and one where we are
-;; simply adding a constant to a register.
-
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (minus:DI (match_dup 0)
- (match_operand:DI 1 "const_int_operand" "")))]
- "TARGET_MIPS16 && TARGET_64BIT && reload_completed && !TARGET_DEBUG_D_MODE
- && GET_CODE (operands[0]) == REG
- && M16_REG_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == CONST_INT
- && ((INTVAL (operands[1]) > 0x10
- && INTVAL (operands[1]) <= 0x10 + 0x10)
- || (INTVAL (operands[1]) < - 0xf
- && INTVAL (operands[1]) >= - 0xf - 0xf))"
- [(set (match_dup 0) (minus:DI (match_dup 0) (match_dup 1)))
- (set (match_dup 0) (minus:DI (match_dup 0) (match_dup 2)))]
- "
-{
- HOST_WIDE_INT val = INTVAL (operands[1]);
-
- if (val >= 0)
- {
- operands[1] = GEN_INT (0xf);
- operands[2] = GEN_INT (val - 0xf);
- }
- else
- {
- operands[1] = GEN_INT (- 0x10);
- operands[2] = GEN_INT (val + 0x10);
- }
-}")
-
-(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (minus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "const_int_operand" "")))]
- "TARGET_MIPS16 && TARGET_64BIT && reload_completed && !TARGET_DEBUG_D_MODE
- && GET_CODE (operands[0]) == REG
- && M16_REG_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == REG
- && M16_REG_P (REGNO (operands[1]))
- && REGNO (operands[0]) != REGNO (operands[1])
- && GET_CODE (operands[2]) == CONST_INT
- && ((INTVAL (operands[2]) > 0x8
- && INTVAL (operands[2]) <= 0x8 + 0x10)
- || (INTVAL (operands[2]) < - 0x7
- && INTVAL (operands[2]) >= - 0x7 - 0xf))"
- [(set (match_dup 0) (minus:DI (match_dup 1) (match_dup 2)))
- (set (match_dup 0) (minus:DI (match_dup 0) (match_dup 3)))]
- "
-{
- HOST_WIDE_INT val = INTVAL (operands[2]);
-
- if (val >= 0)
- {
- operands[2] = GEN_INT (0x8);
- operands[3] = GEN_INT (val - 0x8);
- }
- else
- {
- operands[2] = GEN_INT (- 0x7);
- operands[3] = GEN_INT (val + 0x7);
- }
-}")
-
(define_insn "subsi3_internal_2"
[(set (match_operand:DI 0 "register_operand" "=d")
- (sign_extend:DI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")
- (match_operand:SI 2 "arith_operand" "dI"))))]
- "TARGET_64BIT && !TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768)"
- "*
-{
- return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
- ? \"addu\\t%0,%z1,%n2\"
- : \"subu\\t%0,%z1,%2\";
-}"
+ (sign_extend:DI
+ (minus:SI (match_operand:SI 1 "register_operand" "d")
+ (match_operand:SI 2 "register_operand" "d"))))]
+ "TARGET_64BIT"
+ "subu\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
-
-(define_insn ""
- [(set (match_operand:DI 0 "register_operand" "=d,d,d")
- (sign_extend:DI (minus:SI (match_operand:SI 1 "register_operand" "0,d,d")
- (match_operand:SI 2 "arith_operand" "I,O,d"))))]
- "TARGET_64BIT && TARGET_MIPS16
- && (GET_CODE (operands[2]) != CONST_INT
- || (INTVAL (operands[2]) != -32768 && INTVAL (operands[2]) != -0x4000))"
- "*
-{
- if (REGNO (operands[0]) == REGNO (operands[1]))
- return \"subu\\t%0,%2\";
- return \"subu\\t%0,%1,%2\";
-}"
- [(set_attr "type" "arith")
- (set_attr "mode" "SI")
- (set_attr_alternative "length"
- [(if_then_else (match_operand:VOID 2 "m16_nsimm8_1" "")
- (const_int 4)
- (const_int 8))
- (if_then_else (match_operand:VOID 2 "m16_nsimm4_1" "")
- (const_int 4)
- (const_int 8))
- (const_int 4)])])
-
-
;;
;; ....................
@@ -1732,87 +1363,63 @@
;; ....................
;;
-;; Early Vr4300 silicon has a CPU bug where multiplies with certain
-;; operands may corrupt immediately following multiplies. This is a
-;; simple fix to insert NOPs.
-
(define_expand "muldf3"
[(set (match_operand:DF 0 "register_operand" "=f")
(mult:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "
-{
- if (!TARGET_MIPS4300)
- emit_insn (gen_muldf3_internal (operands[0], operands[1], operands[2]));
- else
- emit_insn (gen_muldf3_r4300 (operands[0], operands[1], operands[2]));
- DONE;
-}")
+ "")
(define_insn "muldf3_internal"
[(set (match_operand:DF 0 "register_operand" "=f")
(mult:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_MIPS4300"
- "mul.d\\t%0,%1,%2"
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_4300_MUL_FIX"
+ "mul.d\t%0,%1,%2"
[(set_attr "type" "fmul")
(set_attr "mode" "DF")])
+;; Early VR4300 silicon has a CPU bug where multiplies with certain
+;; operands may corrupt immediately following multiplies. This is a
+;; simple fix to insert NOPs.
+
(define_insn "muldf3_r4300"
[(set (match_operand:DF 0 "register_operand" "=f")
(mult:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_MIPS4300"
- "*
-{
- output_asm_insn (\"mul.d\\t%0,%1,%2\", operands);
- if (TARGET_4300_MUL_FIX)
- output_asm_insn (\"nop\", operands);
- return \"\";
-}"
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_4300_MUL_FIX"
+ "mul.d\t%0,%1,%2\;nop"
[(set_attr "type" "fmul")
(set_attr "mode" "DF")
- (set_attr "length" "8")]) ;; mul.d + nop
+ (set_attr "length" "8")])
(define_expand "mulsf3"
[(set (match_operand:SF 0 "register_operand" "=f")
(mult:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "
-{
- if (!TARGET_MIPS4300)
- emit_insn( gen_mulsf3_internal (operands[0], operands[1], operands[2]));
- else
- emit_insn( gen_mulsf3_r4300 (operands[0], operands[1], operands[2]));
- DONE;
-}")
+ "")
(define_insn "mulsf3_internal"
[(set (match_operand:SF 0 "register_operand" "=f")
(mult:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && !TARGET_MIPS4300"
- "mul.s\\t%0,%1,%2"
+ "TARGET_HARD_FLOAT && !TARGET_4300_MUL_FIX"
+ "mul.s\t%0,%1,%2"
[(set_attr "type" "fmul")
(set_attr "mode" "SF")])
+;; See muldf3_r4300.
+
(define_insn "mulsf3_r4300"
[(set (match_operand:SF 0 "register_operand" "=f")
(mult:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && TARGET_MIPS4300"
- "*
-{
- output_asm_insn (\"mul.s\\t%0,%1,%2\", operands);
- if (TARGET_4300_MUL_FIX)
- output_asm_insn (\"nop\", operands);
- return \"\";
-}"
+ "TARGET_HARD_FLOAT && TARGET_4300_MUL_FIX"
+ "mul.s\t%0,%1,%2\;nop"
[(set_attr "type" "fmul")
(set_attr "mode" "SF")
- (set_attr "length" "8")]) ;; mul.s + nop
+ (set_attr "length" "8")])
;; ??? The R4000 (only) has a cpu bug. If a double-word shift executes while
@@ -1824,7 +1431,6 @@
(mult:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "register_operand" "")))]
""
- "
{
if (GENERATE_MULT3_SI || TARGET_MAD)
emit_insn (gen_mulsi3_mult3 (operands[0], operands[1], operands[2]));
@@ -1833,7 +1439,7 @@
else
emit_insn (gen_mulsi3_r4000 (operands[0], operands[1], operands[2]));
DONE;
-}")
+})
(define_insn "mulsi3_mult3"
[(set (match_operand:SI 0 "register_operand" "=d,l")
@@ -1843,19 +1449,20 @@
(clobber (match_scratch:SI 4 "=l,X"))]
"GENERATE_MULT3_SI
|| TARGET_MAD"
- "*
{
if (which_alternative == 1)
- return \"mult\\t%1,%2\";
+ return "mult\t%1,%2";
if (TARGET_MAD
|| TARGET_MIPS5400
|| TARGET_MIPS5500
+ || TARGET_MIPS7000
+ || TARGET_MIPS9000
|| ISA_MIPS32
|| ISA_MIPS32R2
|| ISA_MIPS64)
- return \"mul\\t%0,%1,%2\";
- return \"mult\\t%0,%1,%2\";
-}"
+ return "mul\t%0,%1,%2";
+ return "mult\t%0,%1,%2";
+}
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -1894,7 +1501,7 @@
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_scratch:SI 3 "=h"))]
"!TARGET_MIPS4000 || TARGET_MIPS16"
- "mult\\t%1,%2"
+ "mult\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -1933,15 +1540,14 @@
"(TARGET_MIPS3900
|| ISA_HAS_MADD_MSUB)
&& !TARGET_MIPS16"
- "*
{
- static const char *const madd[] = { \"madd\\t%1,%2\", \"madd\\t%0,%1,%2\" };
+ static const char *const madd[] = { "madd\t%1,%2", "madd\t%0,%1,%2" };
if (which_alternative == 2)
- return \"#\";
+ return "#";
if (ISA_HAS_MADD_MSUB && which_alternative != 0)
- return \"#\";
+ return "#";
return madd[which_alternative];
-}"
+}
[(set_attr "type" "imadd,imadd,multi")
(set_attr "mode" "SI")
(set_attr "length" "4,4,8")])
@@ -1994,15 +1600,14 @@
(clobber (match_scratch:SI 4 "=h,h"))
(clobber (match_scratch:SI 5 "=X,3"))]
"ISA_HAS_MACC"
- "*
{
if (which_alternative == 1)
- return \"macc\\t%0,%1,%2\";
+ return "macc\t%0,%1,%2";
else if (TARGET_MIPS5500)
- return \"madd\\t%1,%2\";
+ return "madd\t%1,%2";
else
- return \"macc\\t%.,%1,%2\";
-}"
+ return "macc\t%.,%1,%2";
+}
[(set_attr "type" "imadd")
(set_attr "mode" "SI")])
@@ -2018,7 +1623,7 @@
(match_dup 0)))
(clobber (match_scratch:SI 4 "=h"))]
"ISA_HAS_MACC && reload_completed"
- "macc\\t%3,%1,%2"
+ "macc\t%3,%1,%2"
[(set_attr "type" "imadd")
(set_attr "mode" "SI")])
@@ -2140,12 +1745,10 @@
(clobber (match_scratch:SI 5 "=X,1,l"))
(clobber (match_scratch:SI 6 "=X,X,&d"))]
"ISA_HAS_MADD_MSUB"
- "*
-{
- if (which_alternative != 0)
- return \"#\";
- return \"msub\\t%2,%3\";
-}"
+ "@
+ msub\t%2,%3
+ #
+ #"
[(set_attr "type" "imadd,multi,multi")
(set_attr "mode" "SI")
(set_attr "length" "4,8,8")])
@@ -2198,8 +1801,8 @@
(clobber (match_scratch:SI 4 "=X,l"))]
"ISA_HAS_MULS"
"@
- muls\\t$0,%1,%2
- muls\\t%0,%1,%2"
+ muls\t$0,%1,%2
+ muls\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -2211,15 +1814,14 @@
(clobber (match_scratch:SI 4 "=h,h"))
(clobber (match_scratch:SI 5 "=X,1"))]
"ISA_HAS_MSAC"
- "*
{
if (which_alternative == 1)
- return \"msac\\t%0,%2,%3\";
+ return "msac\t%0,%2,%3";
else if (TARGET_MIPS5500)
- return \"msub\\t%2,%3\";
+ return "msub\t%2,%3";
else
- return \"msac\\t$0,%2,%3\";
-}"
+ return "msac\t$0,%2,%3";
+}
[(set_attr "type" "imadd")
(set_attr "mode" "SI")])
@@ -2228,15 +1830,13 @@
(mult:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))]
"TARGET_64BIT"
-
- "
{
if (GENERATE_MULT3_DI || TARGET_MIPS4000)
emit_insn (gen_muldi3_internal2 (operands[0], operands[1], operands[2]));
else
emit_insn (gen_muldi3_internal (operands[0], operands[1], operands[2]));
DONE;
-}")
+})
(define_insn "muldi3_internal"
[(set (match_operand:DI 0 "register_operand" "=l")
@@ -2244,7 +1844,7 @@
(match_operand:DI 2 "register_operand" "d")))
(clobber (match_scratch:DI 3 "=h"))]
"TARGET_64BIT && !TARGET_MIPS4000"
- "dmult\\t%1,%2"
+ "dmult\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "DI")])
@@ -2255,12 +1855,12 @@
(clobber (match_scratch:DI 3 "=h"))
(clobber (match_scratch:DI 4 "=l"))]
"TARGET_64BIT && (GENERATE_MULT3_DI || TARGET_MIPS4000)"
- {
- if (GENERATE_MULT3_DI)
- return "dmult\t%0,%1,%2";
- else
- return "dmult\t%1,%2\n\tmflo\t%0";
- }
+{
+ if (GENERATE_MULT3_DI)
+ return "dmult\t%0,%1,%2";
+ else
+ return "dmult\t%1,%2\;mflo\t%0";
+}
[(set_attr "type" "imul")
(set_attr "mode" "DI")
(set (attr "length")
@@ -2280,13 +1880,13 @@
(clobber (scratch:DI))
(clobber (scratch:DI))])]
""
- {
- if (!TARGET_64BIT)
- {
- emit_insn (gen_mulsidi3_32bit (operands[0], operands[1], operands[2]));
- DONE;
- }
- })
+{
+ if (!TARGET_64BIT)
+ {
+ emit_insn (gen_mulsidi3_32bit (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+})
(define_insn "mulsidi3_32bit"
[(set (match_operand:DI 0 "register_operand" "=x")
@@ -2294,7 +1894,7 @@
(sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
(sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))]
"!TARGET_64BIT"
- "mult\\t%1,%2"
+ "mult\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -2359,12 +1959,12 @@
(match_operator:DI 5 "extend_operator" [(match_dup 3)]))
(const_int 32)))]
"TARGET_64BIT && GET_CODE (operands[4]) == GET_CODE (operands[5])"
- {
- if (GET_CODE (operands[4]) == SIGN_EXTEND)
- return "mult\t%2,%3";
- else
- return "multu\t%2,%3";
- }
+{
+ if (GET_CODE (operands[4]) == SIGN_EXTEND)
+ return "mult\t%2,%3";
+ else
+ return "multu\t%2,%3";
+}
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -2378,14 +1978,14 @@
(clobber (scratch:DI))
(clobber (scratch:DI))])]
""
- {
- if (!TARGET_64BIT)
- {
- emit_insn (gen_umulsidi3_32bit (operands[0], operands[1],
- operands[2]));
- DONE;
- }
- })
+{
+ if (!TARGET_64BIT)
+ {
+ emit_insn (gen_umulsidi3_32bit (operands[0], operands[1],
+ operands[2]));
+ DONE;
+ }
+})
(define_insn "umulsidi3_32bit"
[(set (match_operand:DI 0 "register_operand" "=x")
@@ -2393,7 +1993,7 @@
(zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
(zero_extend:DI (match_operand:SI 2 "register_operand" "d"))))]
"!TARGET_64BIT"
- "multu\\t%1,%2"
+ "multu\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -2405,7 +2005,7 @@
(sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
(sign_extend:DI (match_operand:SI 2 "register_operand" "d")))))]
"!TARGET_64BIT && ISA_HAS_MULS"
- "muls\\t$0,%1,%2"
+ "muls\t$0,%1,%2"
[(set_attr "type" "imul")
(set_attr "length" "4")
(set_attr "mode" "SI")])
@@ -2417,7 +2017,7 @@
(zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
(zero_extend:DI (match_operand:SI 2 "register_operand" "d")))))]
"!TARGET_64BIT && ISA_HAS_MULS"
- "mulsu\\t$0,%1,%2"
+ "mulsu\t$0,%1,%2"
[(set_attr "type" "imul")
(set_attr "length" "4")
(set_attr "mode" "SI")])
@@ -2430,13 +2030,12 @@
(sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
(sign_extend:DI (match_operand:SI 2 "register_operand" "d")))))]
"!TARGET_64BIT && ISA_HAS_MSAC"
- "*
{
if (TARGET_MIPS5500)
- return \"msub\\t%1,%2\";
+ return "msub\t%1,%2";
else
- return \"msac\\t$0,%1,%2\";
-}"
+ return "msac\t$0,%1,%2";
+}
[(set_attr "type" "imadd")
(set_attr "length" "4")
(set_attr "mode" "SI")])
@@ -2449,13 +2048,12 @@
(zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
(zero_extend:DI (match_operand:SI 2 "register_operand" "d")))))]
"!TARGET_64BIT && ISA_HAS_MSAC"
- "*
{
if (TARGET_MIPS5500)
- return \"msubu\\t%1,%2\";
+ return "msubu\t%1,%2";
else
- return \"msacu\\t$0,%1,%2\";
-}"
+ return "msacu\t$0,%1,%2";
+}
[(set_attr "type" "imadd")
(set_attr "length" "4")
(set_attr "mode" "SI")])
@@ -2469,7 +2067,6 @@
(zero_extend:DI (match_operand:SI 2 "register_operand" "")))
(const_int 32))))]
""
- "
{
if (ISA_HAS_MULHI)
emit_insn (gen_umulsi3_highpart_mulhi_internal (operands[0], operands[1],
@@ -2478,7 +2075,7 @@
emit_insn (gen_umulsi3_highpart_internal (operands[0], operands[1],
operands[2]));
DONE;
-}")
+})
(define_insn "umulsi3_highpart_internal"
[(set (match_operand:SI 0 "register_operand" "=h")
@@ -2489,7 +2086,7 @@
(const_int 32))))
(clobber (match_scratch:SI 3 "=l"))]
"!ISA_HAS_MULHI"
- "multu\\t%1,%2"
+ "multu\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "4")])
@@ -2505,8 +2102,8 @@
(clobber (match_scratch:SI 4 "=X,h"))]
"ISA_HAS_MULHI"
"@
- multu\\t%1,%2
- mulhiu\\t%0,%1,%2"
+ multu\t%1,%2
+ mulhiu\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "4")])
@@ -2523,8 +2120,8 @@
(clobber (match_scratch:SI 4 "=X,h"))]
"ISA_HAS_MULHI"
"@
- mulshiu\\t%.,%1,%2
- mulshiu\\t%0,%1,%2"
+ mulshiu\t%.,%1,%2
+ mulshiu\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "4")])
@@ -2537,7 +2134,6 @@
(sign_extend:DI (match_operand:SI 2 "register_operand" "")))
(const_int 32))))]
""
- "
{
if (ISA_HAS_MULHI)
emit_insn (gen_smulsi3_highpart_mulhi_internal (operands[0], operands[1],
@@ -2546,7 +2142,7 @@
emit_insn (gen_smulsi3_highpart_internal (operands[0], operands[1],
operands[2]));
DONE;
-}")
+})
(define_insn "smulsi3_highpart_internal"
[(set (match_operand:SI 0 "register_operand" "=h")
@@ -2557,7 +2153,7 @@
(const_int 32))))
(clobber (match_scratch:SI 3 "=l"))]
"!ISA_HAS_MULHI"
- "mult\\t%1,%2"
+ "mult\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "4")])
@@ -2573,8 +2169,8 @@
(clobber (match_scratch:SI 4 "=X,h"))]
"ISA_HAS_MULHI"
"@
- mult\\t%1,%2
- mulhi\\t%0,%1,%2"
+ mult\t%1,%2
+ mulhi\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "4")])
@@ -2591,8 +2187,8 @@
(clobber (match_scratch:SI 4 "=X,h"))]
"ISA_HAS_MULHI"
"@
- mulshi\\t%.,%1,%2
- mulshi\\t%0,%1,%2"
+ mulshi\t%.,%1,%2
+ mulshi\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -2606,7 +2202,7 @@
(const_int 64))))
(clobber (match_scratch:DI 3 "=l"))]
"TARGET_64BIT"
- "dmult\\t%1,%2"
+ "dmult\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "DI")])
@@ -2620,7 +2216,7 @@
(const_int 64))))
(clobber (match_scratch:DI 3 "=l"))]
"TARGET_64BIT"
- "dmultu\\t%1,%2"
+ "dmultu\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "DI")])
@@ -2635,7 +2231,7 @@
(match_dup 0)))
(clobber (match_scratch:SI 3 "=h"))]
"TARGET_MAD"
- "mad\\t%1,%2"
+ "mad\t%1,%2"
[(set_attr "type" "imadd")
(set_attr "mode" "SI")])
@@ -2647,15 +2243,14 @@
(match_operand:DI 3 "register_operand" "0")))]
"(TARGET_MAD || ISA_HAS_MACC)
&& !TARGET_64BIT"
- "*
{
if (TARGET_MAD)
- return \"madu\\t%1,%2\";
+ return "madu\t%1,%2";
else if (TARGET_MIPS5500)
- return \"maddu\\t%1,%2\";
+ return "maddu\t%1,%2";
else
- return \"maccu\\t%.,%1,%2\";
-}"
+ return "maccu\t%.,%1,%2";
+}
[(set_attr "type" "imadd")
(set_attr "mode" "SI")])
@@ -2668,15 +2263,14 @@
(match_operand:DI 3 "register_operand" "0")))]
"(TARGET_MAD || ISA_HAS_MACC)
&& !TARGET_64BIT"
- "*
{
if (TARGET_MAD)
- return \"mad\\t%1,%2\";
+ return "mad\t%1,%2";
else if (TARGET_MIPS5500)
- return \"madd\\t%1,%2\";
+ return "madd\t%1,%2";
else
- return \"macc\\t%.,%1,%2\";
-}"
+ return "macc\t%.,%1,%2";
+}
[(set_attr "type" "imadd")
(set_attr "mode" "SI")])
@@ -2688,7 +2282,7 @@
(match_operand:DF 2 "register_operand" "f"))
(match_operand:DF 3 "register_operand" "f")))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FUSED_MADD"
- "madd.d\\t%0,%3,%1,%2"
+ "madd.d\t%0,%3,%1,%2"
[(set_attr "type" "fmadd")
(set_attr "mode" "DF")])
@@ -2698,7 +2292,7 @@
(match_operand:SF 2 "register_operand" "f"))
(match_operand:SF 3 "register_operand" "f")))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
- "madd.s\\t%0,%3,%1,%2"
+ "madd.s\t%0,%3,%1,%2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")])
@@ -2708,7 +2302,7 @@
(match_operand:DF 2 "register_operand" "f"))
(match_operand:DF 3 "register_operand" "f")))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FUSED_MADD"
- "msub.d\\t%0,%3,%1,%2"
+ "msub.d\t%0,%3,%1,%2"
[(set_attr "type" "fmadd")
(set_attr "mode" "DF")])
@@ -2719,7 +2313,7 @@
(match_operand:SF 3 "register_operand" "f")))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
- "msub.s\\t%0,%3,%1,%2"
+ "msub.s\t%0,%3,%1,%2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")])
@@ -2729,7 +2323,7 @@
(match_operand:DF 2 "register_operand" "f"))
(match_operand:DF 3 "register_operand" "f"))))]
"ISA_HAS_NMADD_NMSUB && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FUSED_MADD"
- "nmadd.d\\t%0,%3,%1,%2"
+ "nmadd.d\t%0,%3,%1,%2"
[(set_attr "type" "fmadd")
(set_attr "mode" "DF")])
@@ -2739,7 +2333,7 @@
(match_operand:SF 2 "register_operand" "f"))
(match_operand:SF 3 "register_operand" "f"))))]
"ISA_HAS_NMADD_NMSUB && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
- "nmadd.s\\t%0,%3,%1,%2"
+ "nmadd.s\t%0,%3,%1,%2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")])
@@ -2749,7 +2343,7 @@
(mult:DF (match_operand:DF 2 "register_operand" "f")
(match_operand:DF 3 "register_operand" "f"))))]
"ISA_HAS_NMADD_NMSUB && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FUSED_MADD"
- "nmsub.d\\t%0,%1,%2,%3"
+ "nmsub.d\t%0,%1,%2,%3"
[(set_attr "type" "fmadd")
(set_attr "mode" "DF")])
@@ -2759,7 +2353,7 @@
(mult:SF (match_operand:SF 2 "register_operand" "f")
(match_operand:SF 3 "register_operand" "f"))))]
"ISA_HAS_NMADD_NMSUB && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
- "nmsub.s\\t%0,%1,%2,%3"
+ "nmsub.s\t%0,%1,%2,%3"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")])
@@ -2771,41 +2365,127 @@
;; ....................
;;
-(define_insn "divdf3"
+(define_expand "divdf3"
+ [(set (match_operand:DF 0 "register_operand" "")
+ (div:DF (match_operand:DF 1 "reg_or_const_float_1_operand" "")
+ (match_operand:DF 2 "register_operand" "")))]
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
+{
+ if (const_float_1_operand (operands[1], DFmode))
+ if (!(ISA_HAS_FP4 && flag_unsafe_math_optimizations))
+ FAIL;
+})
+
+;; This pattern works around the early SB-1 rev2 core "F1" erratum:
+;;
+;; If an mfc1 or dmfc1 happens to access the floating point register
+;; file at the same time a long latency operation (div, sqrt, recip,
+;; sqrt) iterates an intermediate result back through the floating
+;; point register file bypass, then instead returning the correct
+;; register value the mfc1 or dmfc1 operation returns the intermediate
+;; result of the long latency operation.
+;;
+;; The workaround is to insert an unconditional 'mov' from/to the
+;; long latency op destination register.
+
+(define_insn "*divdf3"
[(set (match_operand:DF 0 "register_operand" "=f")
(div:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "div.d\\t%0,%1,%2"
+{
+ if (TARGET_FIX_SB1)
+ return "div.d\t%0,%1,%2\;mov.d\t%0,%0";
+ else
+ return "div.d\t%0,%1,%2";
+}
[(set_attr "type" "fdiv")
- (set_attr "mode" "DF")])
+ (set_attr "mode" "DF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
+
-(define_insn "divsf3"
+(define_expand "divsf3"
+ [(set (match_operand:SF 0 "register_operand" "")
+ (div:SF (match_operand:SF 1 "reg_or_const_float_1_operand" "")
+ (match_operand:SF 2 "register_operand" "")))]
+ "TARGET_HARD_FLOAT"
+{
+ if (const_float_1_operand (operands[1], SFmode))
+ if (!(ISA_HAS_FP4 && flag_unsafe_math_optimizations))
+ FAIL;
+})
+
+;; This pattern works around the early SB-1 rev2 core "F1" erratum (see
+;; "divdf3" comment for details).
+;;
+;; This pattern works around the early SB-1 rev2 core "F2" erratum:
+;;
+;; In certain cases, div.s and div.ps may have a rounding error
+;; and/or wrong inexact flag.
+;;
+;; Therefore, we only allow div.s if not working around SB-1 rev2
+;; errata, or if working around those errata and a slight loss of
+;; precision is OK (i.e., flag_unsafe_math_optimizations is set).
+(define_insn "*divsf3"
[(set (match_operand:SF 0 "register_operand" "=f")
(div:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT"
- "div.s\\t%0,%1,%2"
+ "TARGET_HARD_FLOAT && (!TARGET_FIX_SB1 || flag_unsafe_math_optimizations)"
+{
+ if (TARGET_FIX_SB1)
+ return "div.s\t%0,%1,%2\;mov.s\t%0,%0";
+ else
+ return "div.s\t%0,%1,%2";
+}
[(set_attr "type" "fdiv")
- (set_attr "mode" "SF")])
+ (set_attr "mode" "SF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
+;; This pattern works around the early SB-1 rev2 core "F1" erratum (see
+;; "divdf3" comment for details).
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f")
(div:DF (match_operand:DF 1 "const_float_1_operand" "")
(match_operand:DF 2 "register_operand" "f")))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && flag_unsafe_math_optimizations"
- "recip.d\\t%0,%2"
+{
+ if (TARGET_FIX_SB1)
+ return "recip.d\t%0,%2\;mov.d\t%0,%0";
+ else
+ return "recip.d\t%0,%2";
+}
[(set_attr "type" "fdiv")
- (set_attr "mode" "DF")])
+ (set_attr "mode" "DF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
+;; This pattern works around the early SB-1 rev2 core "F1" erratum (see
+;; "divdf3" comment for details).
(define_insn ""
[(set (match_operand:SF 0 "register_operand" "=f")
(div:SF (match_operand:SF 1 "const_float_1_operand" "")
(match_operand:SF 2 "register_operand" "f")))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && flag_unsafe_math_optimizations"
- "recip.s\\t%0,%2"
+{
+ if (TARGET_FIX_SB1)
+ return "recip.s\t%0,%2\;mov.s\t%0,%0";
+ else
+ return "recip.s\t%0,%2";
+}
[(set_attr "type" "fdiv")
- (set_attr "mode" "SF")])
+ (set_attr "mode" "SF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
(define_insn "divmodsi4"
[(set (match_operand:SI 0 "register_operand" "=l")
@@ -2815,7 +2495,7 @@
(mod:SI (match_dup 1)
(match_dup 2)))]
""
- { return mips_output_division ("div\\t$0,%1,%2", operands); }
+ { return mips_output_division ("div\t$0,%1,%2", operands); }
[(set_attr "type" "idiv")
(set_attr "mode" "SI")])
@@ -2827,7 +2507,7 @@
(mod:DI (match_dup 1)
(match_dup 2)))]
"TARGET_64BIT"
- { return mips_output_division ("ddiv\\t$0,%1,%2", operands); }
+ { return mips_output_division ("ddiv\t$0,%1,%2", operands); }
[(set_attr "type" "idiv")
(set_attr "mode" "DI")])
@@ -2839,7 +2519,7 @@
(umod:SI (match_dup 1)
(match_dup 2)))]
""
- { return mips_output_division ("divu\\t$0,%1,%2", operands); }
+ { return mips_output_division ("divu\t$0,%1,%2", operands); }
[(set_attr "type" "idiv")
(set_attr "mode" "SI")])
@@ -2851,9 +2531,10 @@
(umod:DI (match_dup 1)
(match_dup 2)))]
"TARGET_64BIT"
- { return mips_output_division ("ddivu\\t$0,%1,%2", operands); }
+ { return mips_output_division ("ddivu\t$0,%1,%2", operands); }
[(set_attr "type" "idiv")
(set_attr "mode" "DI")])
+
;;
;; ....................
;;
@@ -2861,40 +2542,83 @@
;;
;; ....................
+;; This pattern works around the early SB-1 rev2 core "F1" erratum (see
+;; "divdf3" comment for details).
(define_insn "sqrtdf2"
[(set (match_operand:DF 0 "register_operand" "=f")
(sqrt:DF (match_operand:DF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && HAVE_SQRT_P() && TARGET_DOUBLE_FLOAT"
- "sqrt.d\\t%0,%1"
+{
+ if (TARGET_FIX_SB1)
+ return "sqrt.d\t%0,%1\;mov.d\t%0,%0";
+ else
+ return "sqrt.d\t%0,%1";
+}
[(set_attr "type" "fsqrt")
- (set_attr "mode" "DF")])
+ (set_attr "mode" "DF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
+;; This pattern works around the early SB-1 rev2 core "F1" erratum (see
+;; "divdf3" comment for details).
(define_insn "sqrtsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && HAVE_SQRT_P()"
- "sqrt.s\\t%0,%1"
+{
+ if (TARGET_FIX_SB1)
+ return "sqrt.s\t%0,%1\;mov.s\t%0,%0";
+ else
+ return "sqrt.s\t%0,%1";
+}
[(set_attr "type" "fsqrt")
- (set_attr "mode" "SF")])
+ (set_attr "mode" "SF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
+;; This pattern works around the early SB-1 rev2 core "F1" erratum (see
+;; "divdf3" comment for details).
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f")
(div:DF (match_operand:DF 1 "const_float_1_operand" "")
(sqrt:DF (match_operand:DF 2 "register_operand" "f"))))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && flag_unsafe_math_optimizations"
- "rsqrt.d\\t%0,%2"
+{
+ if (TARGET_FIX_SB1)
+ return "rsqrt.d\t%0,%2\;mov.d\t%0,%0";
+ else
+ return "rsqrt.d\t%0,%2";
+}
[(set_attr "type" "frsqrt")
- (set_attr "mode" "DF")])
+ (set_attr "mode" "DF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
+;; This pattern works around the early SB-1 rev2 core "F1" erratum (see
+;; "divdf3" comment for details).
(define_insn ""
[(set (match_operand:SF 0 "register_operand" "=f")
(div:SF (match_operand:SF 1 "const_float_1_operand" "")
(sqrt:SF (match_operand:SF 2 "register_operand" "f"))))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && flag_unsafe_math_optimizations"
- "rsqrt.s\\t%0,%2"
+{
+ if (TARGET_FIX_SB1)
+ return "rsqrt.s\t%0,%2\;mov.s\t%0,%0";
+ else
+ return "rsqrt.s\t%0,%2";
+}
[(set_attr "type" "frsqrt")
- (set_attr "mode" "SF")])
-
+ (set_attr "mode" "SF")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0))
+ (const_int 8)
+ (const_int 4)))])
;;
;; ....................
@@ -2910,20 +2634,19 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(abs:SI (match_operand:SI 1 "register_operand" "d")))]
"!TARGET_MIPS16"
- "*
{
operands[2] = const0_rtx;
if (REGNO (operands[0]) == REGNO (operands[1]))
{
if (GENERATE_BRANCHLIKELY)
- return \"%(bltzl\\t%1,1f\\n\\tsubu\\t%0,%z2,%0\\n%~1:%)\";
+ return "%(bltzl\t%1,1f\;subu\t%0,%z2,%0\n%~1:%)";
else
- return \"bgez\\t%1,1f%#\\n\\tsubu\\t%0,%z2,%0\\n%~1:\";
+ return "bgez\t%1,1f%#\;subu\t%0,%z2,%0\n%~1:";
}
else
- return \"%(bgez\\t%1,1f\\n\\tmove\\t%0,%1\\n\\tsubu\\t%0,%z2,%0\\n%~1:%)\";
-}"
+ return "%(bgez\t%1,1f\;move\t%0,%1\;subu\t%0,%z2,%0\n%~1:%)";
+}
[(set_attr "type" "multi")
(set_attr "mode" "SI")
(set_attr "length" "12")])
@@ -2932,7 +2655,6 @@
[(set (match_operand:DI 0 "register_operand" "=d")
(abs:DI (match_operand:DI 1 "register_operand" "d")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "*
{
unsigned int regno1;
operands[2] = const0_rtx;
@@ -2943,10 +2665,10 @@
regno1 = REGNO (XEXP (operands[1], 0));
if (REGNO (operands[0]) == regno1)
- return \"%(bltzl\\t%1,1f\\n\\tdsubu\\t%0,%z2,%0\\n%~1:%)\";
+ return "%(bltzl\t%1,1f\;dsubu\t%0,%z2,%0\n%~1:%)";
else
- return \"%(bgez\\t%1,1f\\n\\tmove\\t%0,%1\\n\\tdsubu\\t%0,%z2,%0\\n%~1:%)\";
-}"
+ return "%(bgez\t%1,1f\;move\t%0,%1\;dsubu\t%0,%z2,%0\n%~1:%)";
+}
[(set_attr "type" "multi")
(set_attr "mode" "DI")
(set_attr "length" "12")])
@@ -2955,7 +2677,7 @@
[(set (match_operand:DF 0 "register_operand" "=f")
(abs:DF (match_operand:DF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "abs.d\\t%0,%1"
+ "abs.d\t%0,%1"
[(set_attr "type" "fabs")
(set_attr "mode" "DF")])
@@ -2963,10 +2685,9 @@
[(set (match_operand:SF 0 "register_operand" "=f")
(abs:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "abs.s\\t%0,%1"
+ "abs.s\t%0,%1"
[(set_attr "type" "fabs")
(set_attr "mode" "SF")])
-
;;
;; ....................
@@ -2982,30 +2703,27 @@
(clobber (match_scratch:SI 2 "=&d"))
(clobber (match_scratch:SI 3 "=&d"))]
"!TARGET_MIPS16"
- "*
{
- operands[4] = const0_rtx;
-
if (optimize && find_reg_note (insn, REG_DEAD, operands[1]))
- return \"%(\\
-move\\t%0,%z4\\n\\
-\\tbeq\\t%1,%z4,2f\\n\\
-%~1:\\tand\\t%2,%1,0x0001\\n\\
-\\taddu\\t%0,%0,1\\n\\
-\\tbeq\\t%2,%z4,1b\\n\\
-\\tsrl\\t%1,%1,1\\n\\
-%~2:%)\";
-
- return \"%(\\
-move\\t%0,%z4\\n\\
-\\tmove\\t%3,%1\\n\\
-\\tbeq\\t%3,%z4,2f\\n\\
-%~1:\\tand\\t%2,%3,0x0001\\n\\
-\\taddu\\t%0,%0,1\\n\\
-\\tbeq\\t%2,%z4,1b\\n\\
-\\tsrl\\t%3,%3,1\\n\\
-%~2:%)\";
-}"
+ return "%(\
+move\t%0,%.\;\
+beq\t%1,%.,2f\n\
+%~1:\tand\t%2,%1,0x0001\;\
+addu\t%0,%0,1\;\
+beq\t%2,%.,1b\;\
+srl\t%1,%1,1\n\
+%~2:%)";
+
+ return "%(\
+move\t%0,%.\;\
+move\t%3,%1\;\
+beq\t%3,%.,2f\n\
+%~1:\tand\t%2,%3,0x0001\;\
+addu\t%0,%0,1\;\
+beq\t%2,%.,1b\;\
+srl\t%3,%3,1\n\
+%~2:%)";
+}
[(set_attr "type" "multi")
(set_attr "mode" "SI")
(set_attr "length" "28")])
@@ -3016,36 +2734,31 @@ move\\t%0,%z4\\n\\
(clobber (match_scratch:DI 2 "=&d"))
(clobber (match_scratch:DI 3 "=&d"))]
"TARGET_64BIT && !TARGET_MIPS16"
- "*
{
- operands[4] = const0_rtx;
-
if (optimize && find_reg_note (insn, REG_DEAD, operands[1]))
- return \"%(\\
-move\\t%0,%z4\\n\\
-\\tbeq\\t%1,%z4,2f\\n\\
-%~1:\\tand\\t%2,%1,0x0001\\n\\
-\\tdaddu\\t%0,%0,1\\n\\
-\\tbeq\\t%2,%z4,1b\\n\\
-\\tdsrl\\t%1,%1,1\\n\\
-%~2:%)\";
-
- return \"%(\\
-move\\t%0,%z4\\n\\
-\\tmove\\t%3,%1\\n\\
-\\tbeq\\t%3,%z4,2f\\n\\
-%~1:\\tand\\t%2,%3,0x0001\\n\\
-\\tdaddu\\t%0,%0,1\\n\\
-\\tbeq\\t%2,%z4,1b\\n\\
-\\tdsrl\\t%3,%3,1\\n\\
-%~2:%)\";
-}"
+ return "%(\
+move\t%0,%.\;\
+beq\t%1,%.,2f\n\
+%~1:\tand\t%2,%1,0x0001\;\
+daddu\t%0,%0,1\;\
+beq\t%2,%.,1b\;\
+dsrl\t%1,%1,1\n\
+%~2:%)";
+
+ return "%(\
+move\t%0,%.\;\
+move\t%3,%1\;\
+beq\t%3,%.,2f\n\
+%~1:\tand\t%2,%3,0x0001\;\
+daddu\t%0,%0,1\;\
+beq\t%2,%.,1b\;\
+dsrl\t%3,%3,1\n\
+%~2:%)";
+}
[(set_attr "type" "multi")
(set_attr "mode" "DI")
(set_attr "length" "28")])
-
-
;;
;; ...................
;;
@@ -3058,7 +2771,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "=d")
(clz:SI (match_operand:SI 1 "register_operand" "d")))]
"ISA_HAS_CLZ_CLO"
- "clz\\t%0,%1"
+ "clz\t%0,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3066,10 +2779,10 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DI 0 "register_operand" "=d")
(clz:DI (match_operand:DI 1 "register_operand" "d")))]
"ISA_HAS_DCLZ_DCLO"
- "dclz\\t%0,%1"
+ "dclz\t%0,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
-
+
;;
;; ....................
;;
@@ -3081,13 +2794,12 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "=d")
(neg:SI (match_operand:SI 1 "register_operand" "d")))]
""
- "*
{
if (TARGET_MIPS16)
- return \"neg\\t%0,%1\";
- operands[2] = const0_rtx;
- return \"subu\\t%0,%z2,%1\";
-}"
+ return "neg\t%0,%1";
+ else
+ return "subu\t%0,%.,%1";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3096,7 +2808,6 @@ move\\t%0,%z4\\n\\
(neg:DI (match_operand:DI 1 "register_operand" "d")))
(clobber (match_dup 2))])]
"(TARGET_64BIT || !TARGET_DEBUG_G_MODE) && !TARGET_MIPS16"
- "
{
if (TARGET_64BIT)
{
@@ -3105,18 +2816,14 @@ move\\t%0,%z4\\n\\
}
operands[2] = gen_reg_rtx (SImode);
-}")
+})
(define_insn "negdi2_internal"
[(set (match_operand:DI 0 "register_operand" "=d")
(neg:DI (match_operand:DI 1 "register_operand" "d")))
(clobber (match_operand:SI 2 "register_operand" "=d"))]
"! TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
-{
- operands[3] = const0_rtx;
- return \"subu\\t%L0,%z3,%L1\;subu\\t%M0,%z3,%M1\;sltu\\t%2,%z3,%L0\;subu\\t%M0,%M0,%2\";
-}"
+ "subu\t%L0,%.,%L1\;subu\t%M0,%.,%M1\;sltu\t%2,%.,%L0\;subu\t%M0,%M0,%2"
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "16")])
@@ -3125,11 +2832,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DI 0 "register_operand" "=d")
(neg:DI (match_operand:DI 1 "register_operand" "d")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "*
-{
- operands[2] = const0_rtx;
- return \"dsubu\\t%0,%z2,%1\";
-}"
+ "dsubu\t%0,%.,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -3137,7 +2840,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DF 0 "register_operand" "=f")
(neg:DF (match_operand:DF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "neg.d\\t%0,%1"
+ "neg.d\t%0,%1"
[(set_attr "type" "fneg")
(set_attr "mode" "DF")])
@@ -3145,7 +2848,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SF 0 "register_operand" "=f")
(neg:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "neg.s\\t%0,%1"
+ "neg.s\t%0,%1"
[(set_attr "type" "fneg")
(set_attr "mode" "SF")])
@@ -3153,13 +2856,12 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "=d")
(not:SI (match_operand:SI 1 "register_operand" "d")))]
""
- "*
{
if (TARGET_MIPS16)
- return \"not\\t%0,%1\";
- operands[2] = const0_rtx;
- return \"nor\\t%0,%z2,%1\";
-}"
+ return "not\t%0,%1";
+ else
+ return "nor\t%0,%.,%1";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3167,12 +2869,12 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DI 0 "register_operand" "=d")
(not:DI (match_operand:DI 1 "register_operand" "d")))]
"TARGET_64BIT"
- "*
{
if (TARGET_MIPS16)
- return \"not\\t%0,%1\";
- return \"nor\\t%0,%.,%1\";
-}"
+ return "not\t%0,%1";
+ else
+ return "nor\t%0,%.,%1";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")])
@@ -3184,7 +2886,7 @@ move\\t%0,%z4\\n\\
;; ....................
;;
-;; Many of these instructions uses trivial define_expands, because we
+;; Many of these instructions use trivial define_expands, because we
;; want to use a different set of constraints when TARGET_MIPS16.
(define_expand "andsi3"
@@ -3192,14 +2894,13 @@ move\\t%0,%z4\\n\\
(and:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
(match_operand:SI 2 "uns_arith_operand" "d,K")))]
""
- "
{
if (TARGET_MIPS16)
{
operands[1] = force_reg (SImode, operands[1]);
operands[2] = force_reg (SImode, operands[2]);
}
-}")
+})
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=d,d")
@@ -3207,8 +2908,8 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "uns_arith_operand" "d,K")))]
"!TARGET_MIPS16"
"@
- and\\t%0,%1,%2
- andi\\t%0,%1,%x2"
+ and\t%0,%1,%2
+ andi\t%0,%1,%x2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3217,7 +2918,7 @@ move\\t%0,%z4\\n\\
(and:SI (match_operand:SI 1 "register_operand" "%0")
(match_operand:SI 2 "register_operand" "d")))]
"TARGET_MIPS16"
- "and\\t%0,%2"
+ "and\t%0,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3226,14 +2927,13 @@ move\\t%0,%z4\\n\\
(and:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "uns_arith_operand" "")))]
"TARGET_64BIT"
- "
{
if (TARGET_MIPS16)
{
operands[1] = force_reg (DImode, operands[1]);
operands[2] = force_reg (DImode, operands[2]);
}
-}")
+})
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -3241,8 +2941,8 @@ move\\t%0,%z4\\n\\
(match_operand:DI 2 "uns_arith_operand" "d,K")))]
"TARGET_64BIT && !TARGET_MIPS16"
"@
- and\\t%0,%1,%2
- andi\\t%0,%1,%x2"
+ and\t%0,%1,%2
+ andi\t%0,%1,%x2"
[(set_attr "type" "darith")
(set_attr "mode" "DI")])
@@ -3251,7 +2951,7 @@ move\\t%0,%z4\\n\\
(and:DI (match_operand:DI 1 "register_operand" "0")
(match_operand:DI 2 "register_operand" "d")))]
"TARGET_64BIT && TARGET_MIPS16"
- "and\\t%0,%2"
+ "and\t%0,%2"
[(set_attr "type" "darith")
(set_attr "mode" "DI")])
@@ -3260,14 +2960,13 @@ move\\t%0,%z4\\n\\
(ior:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")
(match_operand:SI 2 "uns_arith_operand" "d,K")))]
""
- "
{
if (TARGET_MIPS16)
{
operands[1] = force_reg (SImode, operands[1]);
operands[2] = force_reg (SImode, operands[2]);
}
-}")
+})
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=d,d")
@@ -3275,8 +2974,8 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "uns_arith_operand" "d,K")))]
"!TARGET_MIPS16"
"@
- or\\t%0,%1,%2
- ori\\t%0,%1,%x2"
+ or\t%0,%1,%2
+ ori\t%0,%1,%x2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3285,7 +2984,7 @@ move\\t%0,%z4\\n\\
(ior:SI (match_operand:SI 1 "register_operand" "%0")
(match_operand:SI 2 "register_operand" "d")))]
"TARGET_MIPS16"
- "or\\t%0,%2"
+ "or\t%0,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3294,14 +2993,13 @@ move\\t%0,%z4\\n\\
(ior:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "uns_arith_operand" "")))]
"TARGET_64BIT"
- "
{
if (TARGET_MIPS16)
{
operands[1] = force_reg (DImode, operands[1]);
operands[2] = force_reg (DImode, operands[2]);
}
-}")
+})
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -3336,8 +3034,8 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "uns_arith_operand" "d,K")))]
"!TARGET_MIPS16"
"@
- xor\\t%0,%1,%2
- xori\\t%0,%1,%x2"
+ xor\t%0,%1,%2
+ xori\t%0,%1,%x2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3347,9 +3045,9 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "uns_arith_operand" "d,K,d")))]
"TARGET_MIPS16"
"@
- xor\\t%0,%2
- cmpi\\t%1,%2
- cmp\\t%1,%2"
+ xor\t%0,%2
+ cmpi\t%1,%2
+ cmp\t%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -3364,14 +3062,13 @@ move\\t%0,%z4\\n\\
(xor:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "uns_arith_operand" "")))]
"TARGET_64BIT"
- "
{
if (TARGET_MIPS16)
{
operands[1] = force_reg (DImode, operands[1]);
operands[2] = force_reg (DImode, operands[2]);
}
-}")
+})
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -3390,9 +3087,9 @@ move\\t%0,%z4\\n\\
(match_operand:DI 2 "uns_arith_operand" "d,K,d")))]
"TARGET_64BIT && TARGET_MIPS16"
"@
- xor\\t%0,%2
- cmpi\\t%1,%2
- cmp\\t%1,%2"
+ xor\t%0,%2
+ cmpi\t%1,%2
+ cmp\t%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr_alternative "length"
@@ -3407,7 +3104,7 @@ move\\t%0,%z4\\n\\
(and:SI (not:SI (match_operand:SI 1 "register_operand" "d"))
(not:SI (match_operand:SI 2 "register_operand" "d"))))]
"!TARGET_MIPS16"
- "nor\\t%0,%z1,%z2"
+ "nor\t%0,%z1,%z2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3416,7 +3113,7 @@ move\\t%0,%z4\\n\\
(and:DI (not:DI (match_operand:DI 1 "register_operand" "d"))
(not:DI (match_operand:DI 2 "register_operand" "d"))))]
"TARGET_64BIT && !TARGET_MIPS16"
- "nor\\t%0,%z1,%z2"
+ "nor\t%0,%z1,%z2"
[(set_attr "type" "darith")
(set_attr "mode" "DI")])
@@ -3433,7 +3130,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SF 0 "register_operand" "=f")
(float_truncate:SF (match_operand:DF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "cvt.s.d\\t%0,%1"
+ "cvt.s.d\t%0,%1"
[(set_attr "type" "fcvt")
(set_attr "mode" "SF")])
@@ -3490,7 +3187,7 @@ move\\t%0,%z4\\n\\
(truncate:SI (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "small_int" "I"))))]
"TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) >= 32"
- "dsra\\t%0,%1,%2"
+ "dsra\t%0,%1,%2"
[(set_attr "type" "darith")
(set_attr "mode" "SI")])
@@ -3499,7 +3196,7 @@ move\\t%0,%z4\\n\\
(truncate:SI (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
(const_int 32))))]
"TARGET_64BIT && !TARGET_MIPS16"
- "dsra\\t%0,%1,32"
+ "dsra\t%0,%1,32"
[(set_attr "type" "darith")
(set_attr "mode" "SI")])
@@ -3545,7 +3242,7 @@ move\\t%0,%z4\\n\\
(zero_extend:SI (truncate:HI
(match_operand:DI 1 "register_operand" "d"))))]
"TARGET_64BIT && !TARGET_MIPS16"
- "andi\\t%0,%1,0xffff"
+ "andi\t%0,%1,0xffff"
[(set_attr "type" "darith")
(set_attr "mode" "SI")])
@@ -3554,7 +3251,7 @@ move\\t%0,%z4\\n\\
(zero_extend:SI (truncate:QI
(match_operand:DI 1 "register_operand" "d"))))]
"TARGET_64BIT && !TARGET_MIPS16"
- "andi\\t%0,%1,0xff"
+ "andi\t%0,%1,0xff"
[(set_attr "type" "darith")
(set_attr "mode" "SI")])
@@ -3563,10 +3260,9 @@ move\\t%0,%z4\\n\\
(zero_extend:HI (truncate:QI
(match_operand:DI 1 "register_operand" "d"))))]
"TARGET_64BIT && !TARGET_MIPS16"
- "andi\\t%0,%1,0xff"
+ "andi\t%0,%1,0xff"
[(set_attr "type" "darith")
(set_attr "mode" "HI")])
-
;;
;; ....................
@@ -3604,7 +3300,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "")
(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
""
- "
{
if (TARGET_MIPS16 && GET_CODE (operands[1]) != MEM)
{
@@ -3614,7 +3309,7 @@ move\\t%0,%z4\\n\\
emit_insn (gen_andsi3 (operands[0], op, temp));
DONE;
}
-}")
+})
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=d,d")
@@ -3639,7 +3334,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DI 0 "register_operand" "")
(zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "")))]
"TARGET_64BIT"
- "
{
if (TARGET_MIPS16 && GET_CODE (operands[1]) != MEM)
{
@@ -3649,7 +3343,7 @@ move\\t%0,%z4\\n\\
emit_insn (gen_anddi3 (operands[0], op, temp));
DONE;
}
-}")
+})
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -3674,7 +3368,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:HI 0 "register_operand" "")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))]
""
- "
{
if (TARGET_MIPS16 && GET_CODE (operands[1]) != MEM)
{
@@ -3685,7 +3378,7 @@ move\\t%0,%z4\\n\\
emit_insn (gen_andsi3 (op0, op1, temp));
DONE;
}
-}")
+})
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=d,d")
@@ -3710,7 +3403,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
""
- "
{
if (TARGET_MIPS16 && GET_CODE (operands[1]) != MEM)
{
@@ -3720,7 +3412,7 @@ move\\t%0,%z4\\n\\
emit_insn (gen_andsi3 (operands[0], op, temp));
DONE;
}
-}")
+})
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=d,d")
@@ -3745,7 +3437,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DI 0 "register_operand" "")
(zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "")))]
"TARGET_64BIT"
- "
{
if (TARGET_MIPS16 && GET_CODE (operands[1]) != MEM)
{
@@ -3755,7 +3446,7 @@ move\\t%0,%z4\\n\\
emit_insn (gen_anddi3 (operands[0], op, temp));
DONE;
}
-}")
+})
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -3790,15 +3481,14 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DI 0 "register_operand" "")
(sign_extend:DI (match_operand:SI 1 "move_operand" "")))]
"TARGET_64BIT"
- "
{
- if (symbolic_operand (operands[1], SImode))
- {
- emit_move_insn (operands[0], convert_memory_address (DImode, operands[1]));
+ if (symbolic_operand (operands[1], SImode))
+ {
+ emit_move_insn (operands[0],
+ convert_memory_address (DImode, operands[1]));
DONE;
- }
-
-}")
+ }
+})
(define_insn "*extendsidi2"
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -3852,14 +3542,14 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "")
(sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
""
- "
- if (ISA_HAS_SEB_SEH)
- {
- emit_insn (gen_extendhisi2_hw (operands[0],
- force_reg (HImode, operands[1])));
- DONE;
- }
-")
+{
+ if (ISA_HAS_SEB_SEH)
+ {
+ emit_insn (gen_extendhisi2_hw (operands[0],
+ force_reg (HImode, operands[1])));
+ DONE;
+ }
+})
(define_insn "*extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=d")
@@ -3889,7 +3579,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "=r")
(sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
"ISA_HAS_SEB_SEH"
- "seh\\t%0,%1"
+ "seh\t%0,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -3929,14 +3619,14 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "")
(sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
""
- "
- if (ISA_HAS_SEB_SEH)
- {
- emit_insn (gen_extendqisi2_hw (operands[0],
- force_reg (QImode, operands[1])));
- DONE;
- }
-")
+{
+ if (ISA_HAS_SEB_SEH)
+ {
+ emit_insn (gen_extendqisi2_hw (operands[0],
+ force_reg (QImode, operands[1])));
+ DONE;
+ }
+})
(define_insn "*extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=d")
@@ -3966,7 +3656,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "=r")
(sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
"ISA_HAS_SEB_SEH"
- "seb\\t%0,%1"
+ "seb\t%0,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -4004,12 +3694,10 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DF 0 "register_operand" "=f")
(float_extend:DF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "cvt.d.s\\t%0,%1"
+ "cvt.d.s\t%0,%1"
[(set_attr "type" "fcvt")
(set_attr "mode" "DF")])
-
-
;;
;; ....................
;;
@@ -4043,11 +3731,12 @@ move\\t%0,%z4\\n\\
(fix:SI (match_operand:DF 1 "register_operand" "f")))
(clobber (match_scratch:DF 2 "=d"))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !ISA_HAS_TRUNC_W"
- {
- if (set_nomacro)
- return ".set\tmacro\n\ttrunc.w.d %0,%1,%2\n\t.set\tmacro";
+{
+ if (set_nomacro)
+ return ".set\tmacro\;trunc.w.d %0,%1,%2\;.set\tnomacro";
+ else
return "trunc.w.d %0,%1,%2";
- }
+}
[(set_attr "type" "fcvt")
(set_attr "mode" "DF")
(set_attr "length" "36")])
@@ -4078,23 +3767,16 @@ move\\t%0,%z4\\n\\
(fix:SI (match_operand:SF 1 "register_operand" "f")))
(clobber (match_scratch:SF 2 "=d"))]
"TARGET_HARD_FLOAT && !ISA_HAS_TRUNC_W"
- {
- if (set_nomacro)
- return ".set\tmacro\n\ttrunc.w.s %0,%1,%2\n\t.set\tmacro";
+{
+ if (set_nomacro)
+ return ".set\tmacro\;trunc.w.s %0,%1,%2\;.set\tnomacro";
+ else
return "trunc.w.s %0,%1,%2";
- }
+}
[(set_attr "type" "fcvt")
(set_attr "mode" "DF")
(set_attr "length" "36")])
-;;; ??? trunc.l.d is mentioned in the appendix of the 1993 r4000/r4600 manuals
-;;; but not in the chapter that describes the FPU. It is not mentioned at all
-;;; in the 1991 manuals. The r4000 at Cygnus does not have this instruction.
-
-;;; Deleting this means that we now need two libgcc2.a libraries. One for
-;;; the 32 bit calling convention and one for the 64 bit calling convention.
-
-;;; If this is disabled, then fixuns_truncdfdi2 must be disabled also.
(define_insn "fix_truncdfdi2"
[(set (match_operand:DI 0 "register_operand" "=f")
@@ -4106,9 +3788,6 @@ move\\t%0,%z4\\n\\
(set_attr "length" "4")])
-;;; ??? trunc.l.s is mentioned in the appendix of the 1993 r4000/r4600 manuals
-;;; but not in the chapter that describes the FPU. It is not mentioned at all
-;;; in the 1991 manuals. The r4000 at Cygnus does not have this instruction.
(define_insn "fix_truncsfdi2"
[(set (match_operand:DI 0 "register_operand" "=f")
(fix:DI (match_operand:SF 1 "register_operand" "f")))]
@@ -4123,7 +3802,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DF 0 "register_operand" "=f")
(float:DF (match_operand:SI 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "cvt.d.w\\t%0,%1"
+ "cvt.d.w\t%0,%1"
[(set_attr "type" "fcvt")
(set_attr "mode" "DF")
(set_attr "length" "4")])
@@ -4133,7 +3812,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DF 0 "register_operand" "=f")
(float:DF (match_operand:DI 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_FLOAT64 && TARGET_DOUBLE_FLOAT"
- "cvt.d.l\\t%0,%1"
+ "cvt.d.l\t%0,%1"
[(set_attr "type" "fcvt")
(set_attr "mode" "DF")
(set_attr "length" "4")])
@@ -4143,7 +3822,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SF 0 "register_operand" "=f")
(float:SF (match_operand:SI 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "cvt.s.w\\t%0,%1"
+ "cvt.s.w\t%0,%1"
[(set_attr "type" "fcvt")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -4153,7 +3832,7 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SF 0 "register_operand" "=f")
(float:SF (match_operand:DI 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_FLOAT64 && TARGET_DOUBLE_FLOAT"
- "cvt.s.l\\t%0,%1"
+ "cvt.s.l\t%0,%1"
[(set_attr "type" "fcvt")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -4163,7 +3842,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "register_operand" "")
(unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "
{
rtx reg1 = gen_reg_rtx (DFmode);
rtx reg2 = gen_reg_rtx (DFmode);
@@ -4202,14 +3880,13 @@ move\\t%0,%z4\\n\\
emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
DONE;
}
-}")
+})
(define_expand "fixuns_truncdfdi2"
[(set (match_operand:DI 0 "register_operand" "")
(unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT && TARGET_64BIT && TARGET_DOUBLE_FLOAT"
- "
{
rtx reg1 = gen_reg_rtx (DFmode);
rtx reg2 = gen_reg_rtx (DFmode);
@@ -4220,42 +3897,38 @@ move\\t%0,%z4\\n\\
real_2expN (&offset, 63);
- if (reg1) /* turn off complaints about unreached code */
- {
- emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, DFmode));
- do_pending_stack_adjust ();
+ emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, DFmode));
+ do_pending_stack_adjust ();
- emit_insn (gen_cmpdf (operands[1], reg1));
- emit_jump_insn (gen_bge (label1));
+ emit_insn (gen_cmpdf (operands[1], reg1));
+ emit_jump_insn (gen_bge (label1));
- emit_insn (gen_fix_truncdfdi2 (operands[0], operands[1]));
- emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
- gen_rtx_LABEL_REF (VOIDmode, label2)));
- emit_barrier ();
+ emit_insn (gen_fix_truncdfdi2 (operands[0], operands[1]));
+ emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
+ gen_rtx_LABEL_REF (VOIDmode, label2)));
+ emit_barrier ();
- emit_label (label1);
- emit_move_insn (reg2, gen_rtx_MINUS (DFmode, operands[1], reg1));
- emit_move_insn (reg3, GEN_INT (BITMASK_HIGH));
- emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32)));
+ emit_label (label1);
+ emit_move_insn (reg2, gen_rtx_MINUS (DFmode, operands[1], reg1));
+ emit_move_insn (reg3, GEN_INT (BITMASK_HIGH));
+ emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32)));
- emit_insn (gen_fix_truncdfdi2 (operands[0], reg2));
- emit_insn (gen_iordi3 (operands[0], operands[0], reg3));
+ emit_insn (gen_fix_truncdfdi2 (operands[0], reg2));
+ emit_insn (gen_iordi3 (operands[0], operands[0], reg3));
- emit_label (label2);
+ emit_label (label2);
- /* allow REG_NOTES to be set on last insn (labels don't have enough
- fields, and can't be used for REG_NOTES anyway). */
- emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
- DONE;
- }
-}")
+ /* allow REG_NOTES to be set on last insn (labels don't have enough
+ fields, and can't be used for REG_NOTES anyway). */
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
+ DONE;
+})
(define_expand "fixuns_truncsfsi2"
[(set (match_operand:SI 0 "register_operand" "")
(unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
rtx reg1 = gen_reg_rtx (SFmode);
rtx reg2 = gen_reg_rtx (SFmode);
@@ -4266,42 +3939,38 @@ move\\t%0,%z4\\n\\
real_2expN (&offset, 31);
- if (reg1) /* turn off complaints about unreached code */
- {
- emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode));
- do_pending_stack_adjust ();
+ emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode));
+ do_pending_stack_adjust ();
- emit_insn (gen_cmpsf (operands[1], reg1));
- emit_jump_insn (gen_bge (label1));
+ emit_insn (gen_cmpsf (operands[1], reg1));
+ emit_jump_insn (gen_bge (label1));
- emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1]));
- emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
- gen_rtx_LABEL_REF (VOIDmode, label2)));
- emit_barrier ();
+ emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1]));
+ emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
+ gen_rtx_LABEL_REF (VOIDmode, label2)));
+ emit_barrier ();
- emit_label (label1);
- emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1));
- emit_move_insn (reg3, GEN_INT (trunc_int_for_mode
- (BITMASK_HIGH, SImode)));
+ emit_label (label1);
+ emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1));
+ emit_move_insn (reg3, GEN_INT (trunc_int_for_mode
+ (BITMASK_HIGH, SImode)));
- emit_insn (gen_fix_truncsfsi2 (operands[0], reg2));
- emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
+ emit_insn (gen_fix_truncsfsi2 (operands[0], reg2));
+ emit_insn (gen_iorsi3 (operands[0], operands[0], reg3));
- emit_label (label2);
+ emit_label (label2);
- /* allow REG_NOTES to be set on last insn (labels don't have enough
- fields, and can't be used for REG_NOTES anyway). */
- emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
- DONE;
- }
-}")
+ /* allow REG_NOTES to be set on last insn (labels don't have enough
+ fields, and can't be used for REG_NOTES anyway). */
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
+ DONE;
+})
(define_expand "fixuns_truncsfdi2"
[(set (match_operand:DI 0 "register_operand" "")
(unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT && TARGET_64BIT && TARGET_DOUBLE_FLOAT"
- "
{
rtx reg1 = gen_reg_rtx (SFmode);
rtx reg2 = gen_reg_rtx (SFmode);
@@ -4312,36 +3981,32 @@ move\\t%0,%z4\\n\\
real_2expN (&offset, 63);
- if (reg1) /* turn off complaints about unreached code */
- {
- emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode));
- do_pending_stack_adjust ();
+ emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode));
+ do_pending_stack_adjust ();
- emit_insn (gen_cmpsf (operands[1], reg1));
- emit_jump_insn (gen_bge (label1));
+ emit_insn (gen_cmpsf (operands[1], reg1));
+ emit_jump_insn (gen_bge (label1));
- emit_insn (gen_fix_truncsfdi2 (operands[0], operands[1]));
- emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
- gen_rtx_LABEL_REF (VOIDmode, label2)));
- emit_barrier ();
+ emit_insn (gen_fix_truncsfdi2 (operands[0], operands[1]));
+ emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
+ gen_rtx_LABEL_REF (VOIDmode, label2)));
+ emit_barrier ();
- emit_label (label1);
- emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1));
- emit_move_insn (reg3, GEN_INT (BITMASK_HIGH));
- emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32)));
+ emit_label (label1);
+ emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1));
+ emit_move_insn (reg3, GEN_INT (BITMASK_HIGH));
+ emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32)));
- emit_insn (gen_fix_truncsfdi2 (operands[0], reg2));
- emit_insn (gen_iordi3 (operands[0], operands[0], reg3));
+ emit_insn (gen_fix_truncsfdi2 (operands[0], reg2));
+ emit_insn (gen_iordi3 (operands[0], operands[0], reg3));
- emit_label (label2);
-
- /* allow REG_NOTES to be set on last insn (labels don't have enough
- fields, and can't be used for REG_NOTES anyway). */
- emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
- DONE;
- }
-}")
+ emit_label (label2);
+ /* allow REG_NOTES to be set on last insn (labels don't have enough
+ fields, and can't be used for REG_NOTES anyway). */
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
+ DONE;
+})
;;
;; ....................
@@ -4358,14 +4023,14 @@ move\\t%0,%z4\\n\\
(match_operand 2 "immediate_operand" "")
(match_operand 3 "immediate_operand" "")))]
"!TARGET_MIPS16"
- {
- if (mips_expand_unaligned_load (operands[0], operands[1],
- INTVAL (operands[2]),
- INTVAL (operands[3])))
- DONE;
- else
- FAIL;
- })
+{
+ if (mips_expand_unaligned_load (operands[0], operands[1],
+ INTVAL (operands[2]),
+ INTVAL (operands[3])))
+ DONE;
+ else
+ FAIL;
+})
(define_expand "extzv"
[(set (match_operand 0 "register_operand" "")
@@ -4373,14 +4038,14 @@ move\\t%0,%z4\\n\\
(match_operand 2 "immediate_operand" "")
(match_operand 3 "immediate_operand" "")))]
"!TARGET_MIPS16"
- {
- if (mips_expand_unaligned_load (operands[0], operands[1],
- INTVAL (operands[2]),
- INTVAL (operands[3])))
- DONE;
- else
- FAIL;
- })
+{
+ if (mips_expand_unaligned_load (operands[0], operands[1],
+ INTVAL (operands[2]),
+ INTVAL (operands[3])))
+ DONE;
+ else
+ FAIL;
+})
(define_expand "insv"
[(set (zero_extract (match_operand:QI 0 "memory_operand" "")
@@ -4388,14 +4053,14 @@ move\\t%0,%z4\\n\\
(match_operand 2 "immediate_operand" ""))
(match_operand 3 "reg_or_0_operand" ""))]
"!TARGET_MIPS16"
- {
- if (mips_expand_unaligned_store (operands[0], operands[3],
- INTVAL (operands[1]),
- INTVAL (operands[2])))
- DONE;
- else
- FAIL;
- })
+{
+ if (mips_expand_unaligned_store (operands[0], operands[3],
+ INTVAL (operands[1]),
+ INTVAL (operands[2])))
+ DONE;
+ else
+ FAIL;
+})
;; Unaligned word moves generated by the bit field patterns.
;;
@@ -4520,7 +4185,7 @@ move\\t%0,%z4\\n\\
(lo_sum:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "immediate_operand" "")))]
"!TARGET_MIPS16"
- "addiu\\t%0,%1,%R2"
+ "addiu\t%0,%1,%R2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -4529,7 +4194,7 @@ move\\t%0,%z4\\n\\
(lo_sum:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:DI 2 "immediate_operand" "")))]
"!TARGET_MIPS16 && TARGET_64BIT"
- "daddiu\\t%0,%1,%R2"
+ "daddiu\t%0,%1,%R2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -4543,7 +4208,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(match_operand:DI 1 "" ""))]
""
- "
{
if (mips_legitimize_move (DImode, operands[0], operands[1]))
DONE;
@@ -4564,7 +4228,7 @@ move\\t%0,%z4\\n\\
emit_move_insn (operands[0], force_reg (DImode, temp));
DONE;
}
-}")
+})
;; For mips16, we need a special case to handle storing $31 into
;; memory, since we don't have a constraint to match $31. This
@@ -4662,7 +4326,6 @@ move\\t%0,%z4\\n\\
&& (INTVAL (operands[1]) & 7) != 0))"
[(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1)))
(set (match_dup 0) (mem:DI (plus:DI (match_dup 0) (match_dup 2))))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[1]);
@@ -4682,7 +4345,7 @@ move\\t%0,%z4\\n\\
operands[1] = GEN_INT (off);
operands[2] = GEN_INT (val - off);
}
-}")
+})
;; 32-bit Integer moves
@@ -4694,7 +4357,6 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SI 0 "nonimmediate_operand" "")
(match_operand:SI 1 "" ""))]
""
- "
{
if (mips_legitimize_move (SImode, operands[0], operands[1]))
DONE;
@@ -4715,7 +4377,7 @@ move\\t%0,%z4\\n\\
emit_move_insn (operands[0], force_reg (SImode, temp));
DONE;
}
-}")
+})
;; We can only store $ra directly into a small sp offset. Should the
;; offset be too wide, non-constant or not sp-based, leave it up to
@@ -4726,7 +4388,7 @@ move\\t%0,%z4\\n\\
(match_operand:SI 0 "small_int" "n")))
(reg:SI 31))]
"TARGET_MIPS16"
- "sw\\t$31,%0($sp)"
+ "sw\t$31,%0($sp)"
[(set_attr "type" "store")
(set_attr "mode" "SI")
(set_attr_alternative
@@ -4797,7 +4459,6 @@ move\\t%0,%z4\\n\\
&& (INTVAL (operands[1]) & 3) != 0))"
[(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
(set (match_dup 0) (mem:SI (plus:SI (match_dup 0) (match_dup 2))))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[1]);
@@ -4817,7 +4478,7 @@ move\\t%0,%z4\\n\\
operands[1] = GEN_INT (off);
operands[2] = GEN_INT (val - off);
}
-}")
+})
;; On the mips16, we can split a load of certain constants into a load
;; and an add. This turns a 4 byte instruction into 2 2 byte
@@ -4834,13 +4495,12 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[1]) <= 0xff + 0x7f"
[(set (match_dup 0) (match_dup 1))
(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))]
- "
{
int val = INTVAL (operands[1]);
operands[1] = GEN_INT (0xff);
operands[2] = GEN_INT (val - 0xff);
-}")
+})
;; On the mips16, we can split a load of a negative constant into a
;; load and a neg. That's what mips_output_move will generate anyhow.
@@ -4856,10 +4516,7 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[1]) > - 0x8000"
[(set (match_dup 0) (match_dup 1))
(set (match_dup 0) (neg:SI (match_dup 0)))]
- "
-{
- operands[1] = GEN_INT (- INTVAL (operands[1]));
-}")
+ { operands[1] = GEN_INT (- INTVAL (operands[1])); })
;; This insn handles moving CCmode values. It's really just a
;; slightly simplified copy of movsi_internal2, with additional cases
@@ -4894,22 +4551,20 @@ move\\t%0,%z4\\n\\
(match_operand:CC 1 "general_operand" ""))
(clobber (match_operand:TF 2 "register_operand" "=&f"))]
"ISA_HAS_8CC && TARGET_HARD_FLOAT"
- "
{
mips_emit_fcc_reload (operands[0], operands[1], operands[2]);
DONE;
-}")
+})
(define_expand "reload_outcc"
[(set (match_operand:CC 0 "fcc_register_operand" "=z")
(match_operand:CC 1 "register_operand" ""))
(clobber (match_operand:TF 2 "register_operand" "=&f"))]
"ISA_HAS_8CC && TARGET_HARD_FLOAT"
- "
{
mips_emit_fcc_reload (operands[0], operands[1], operands[2]);
DONE;
-}")
+})
;; MIPS4 supports loading and storing a floating point register from
;; the sum of two general registers. We use two versions for each of
@@ -4929,7 +4584,7 @@ move\\t%0,%z4\\n\\
(mem:SF (plus:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "register_operand" "d"))))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT"
- "lwxc1\\t%0,%1(%2)"
+ "lwxc1\t%0,%1(%2)"
[(set_attr "type" "load")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -4939,7 +4594,7 @@ move\\t%0,%z4\\n\\
(mem:SF (plus:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d"))))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT"
- "lwxc1\\t%0,%1(%2)"
+ "lwxc1\t%0,%1(%2)"
[(set_attr "type" "load")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -4949,7 +4604,7 @@ move\\t%0,%z4\\n\\
(mem:DF (plus:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "register_operand" "d"))))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "ldxc1\\t%0,%1(%2)"
+ "ldxc1\t%0,%1(%2)"
[(set_attr "type" "load")
(set_attr "mode" "DF")
(set_attr "length" "4")])
@@ -4959,7 +4614,7 @@ move\\t%0,%z4\\n\\
(mem:DF (plus:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d"))))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "ldxc1\\t%0,%1(%2)"
+ "ldxc1\t%0,%1(%2)"
[(set_attr "type" "load")
(set_attr "mode" "DF")
(set_attr "length" "4")])
@@ -4969,7 +4624,7 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(match_operand:SF 0 "register_operand" "f"))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT"
- "swxc1\\t%0,%1(%2)"
+ "swxc1\t%0,%1(%2)"
[(set_attr "type" "store")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -4979,7 +4634,7 @@ move\\t%0,%z4\\n\\
(match_operand:DI 2 "register_operand" "d")))
(match_operand:SF 0 "register_operand" "f"))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT"
- "swxc1\\t%0,%1(%2)"
+ "swxc1\t%0,%1(%2)"
[(set_attr "type" "store")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -4989,7 +4644,7 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(match_operand:DF 0 "register_operand" "f"))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "sdxc1\\t%0,%1(%2)"
+ "sdxc1\t%0,%1(%2)"
[(set_attr "type" "store")
(set_attr "mode" "DF")
(set_attr "length" "4")])
@@ -4999,7 +4654,7 @@ move\\t%0,%z4\\n\\
(match_operand:DI 2 "register_operand" "d")))
(match_operand:DF 0 "register_operand" "f"))]
"ISA_HAS_FP4 && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "sdxc1\\t%0,%1(%2)"
+ "sdxc1\t%0,%1(%2)"
[(set_attr "type" "store")
(set_attr "mode" "DF")
(set_attr "length" "4")])
@@ -5009,13 +4664,12 @@ move\\t%0,%z4\\n\\
;; Unlike most other insns, the move insns can't be split with
;; different predicates, because register spilling and other parts of
;; the compiler, have memoized the insn number already.
-;; Unsigned loads are used because BYTE_LOADS_ZERO_EXTEND is defined
+;; Unsigned loads are used because LOAD_EXTEND_OP returns ZERO_EXTEND.
(define_expand "movhi"
[(set (match_operand:HI 0 "nonimmediate_operand" "")
(match_operand:HI 1 "general_operand" ""))]
""
- "
{
if ((reload_in_progress | reload_completed) == 0
&& !register_operand (operands[0], HImode)
@@ -5028,10 +4682,7 @@ move\\t%0,%z4\\n\\
emit_move_insn (operands[0], temp);
DONE;
}
-}")
-
-;; The difference between these two is whether or not ints are allowed
-;; in FP registers (off by default, use -mdebugh to enable).
+})
(define_insn "movhi_internal"
[(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,m,*d,*f,*f,*x,*d")
@@ -5107,7 +4758,6 @@ move\\t%0,%z4\\n\\
&& (INTVAL (operands[1]) & 1) != 0))"
[(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
(set (match_dup 0) (mem:HI (plus:SI (match_dup 0) (match_dup 2))))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[1]);
@@ -5127,20 +4777,19 @@ move\\t%0,%z4\\n\\
operands[1] = GEN_INT (off);
operands[2] = GEN_INT (val - off);
}
-}")
+})
;; 8-bit Integer moves
;; Unlike most other insns, the move insns can't be split with
;; different predicates, because register spilling and other parts of
;; the compiler, have memoized the insn number already.
-;; Unsigned loads are used because BYTE_LOADS_ZERO_EXTEND is defined
+;; Unsigned loads are used because LOAD_EXTEND_OP returns ZERO_EXTEND.
(define_expand "movqi"
[(set (match_operand:QI 0 "nonimmediate_operand" "")
(match_operand:QI 1 "general_operand" ""))]
""
- "
{
if ((reload_in_progress | reload_completed) == 0
&& !register_operand (operands[0], QImode)
@@ -5153,10 +4802,7 @@ move\\t%0,%z4\\n\\
emit_move_insn (operands[0], temp);
DONE;
}
-}")
-
-;; The difference between these two is whether or not ints are allowed
-;; in FP registers (off by default, use -mdebugh to enable).
+})
(define_insn "movqi_internal"
[(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,*d,*f,*f,*x,*d")
@@ -5216,7 +4862,6 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[1]) <= 31 + 0x7f))"
[(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
(set (match_dup 0) (mem:QI (plus:SI (match_dup 0) (match_dup 2))))]
- "
{
HOST_WIDE_INT val = INTVAL (operands[1]);
@@ -5227,7 +4872,7 @@ move\\t%0,%z4\\n\\
operands[1] = GEN_INT (0x7f);
operands[2] = GEN_INT (val - 0x7f);
}
-}")
+})
;; 32-bit floating point moves
@@ -5235,13 +4880,12 @@ move\\t%0,%z4\\n\\
[(set (match_operand:SF 0 "nonimmediate_operand" "")
(match_operand:SF 1 "general_operand" ""))]
""
- "
{
if ((reload_in_progress | reload_completed) == 0
&& !register_operand (operands[0], SFmode)
&& !nonmemory_operand (operands[1], SFmode))
operands[1] = force_reg (SFmode, operands[1]);
-}")
+})
(define_insn "movsf_internal1"
[(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,m,*f,*d,*d,*d,*m")
@@ -5283,13 +4927,12 @@ move\\t%0,%z4\\n\\
[(set (match_operand:DF 0 "nonimmediate_operand" "")
(match_operand:DF 1 "general_operand" ""))]
""
- "
{
if ((reload_in_progress | reload_completed) == 0
&& !register_operand (operands[0], DFmode)
&& !nonmemory_operand (operands[1], DFmode))
operands[1] = force_reg (DFmode, operands[1]);
-}")
+})
(define_insn "movdf_internal1a"
[(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,m,*f,*d,*d,*d,*m")
@@ -5341,10 +4984,10 @@ move\\t%0,%z4\\n\\
"reload_completed && !TARGET_64BIT
&& mips_split_64bit_move_p (operands[0], operands[1])"
[(const_int 0)]
- {
- mips_split_64bit_move (operands[0], operands[1]);
- DONE;
- })
+{
+ mips_split_64bit_move (operands[0], operands[1]);
+ DONE;
+})
(define_split
[(set (match_operand:DF 0 "nonimmediate_operand" "")
@@ -5352,10 +4995,10 @@ move\\t%0,%z4\\n\\
"reload_completed && !TARGET_64BIT
&& mips_split_64bit_move_p (operands[0], operands[1])"
[(const_int 0)]
- {
- mips_split_64bit_move (operands[0], operands[1]);
- DONE;
- })
+{
+ mips_split_64bit_move (operands[0], operands[1]);
+ DONE;
+})
;; Patterns for loading or storing part of a paired floating point
;; register. We need them because odd-numbered floating-point registers
@@ -5367,10 +5010,10 @@ move\\t%0,%z4\\n\\
(unspec:DF [(match_operand:SI 1 "general_operand" "dJ,m")]
UNSPEC_LOAD_DF_LOW))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_64BIT"
- {
- operands[0] = mips_subword (operands[0], 0);
- return mips_output_move (operands[0], operands[1]);
- }
+{
+ operands[0] = mips_subword (operands[0], 0);
+ return mips_output_move (operands[0], operands[1]);
+}
[(set_attr "type" "xfer,load")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -5383,10 +5026,10 @@ move\\t%0,%z4\\n\\
(match_operand:DF 2 "register_operand" "0,0")]
UNSPEC_LOAD_DF_HIGH))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_64BIT"
- {
- operands[0] = mips_subword (operands[0], 1);
- return mips_output_move (operands[0], operands[1]);
- }
+{
+ operands[0] = mips_subword (operands[0], 1);
+ return mips_output_move (operands[0], operands[1]);
+}
[(set_attr "type" "xfer,load")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -5398,10 +5041,10 @@ move\\t%0,%z4\\n\\
(unspec:SI [(match_operand:DF 1 "register_operand" "f,f")]
UNSPEC_STORE_DF_HIGH))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_64BIT"
- {
- operands[1] = mips_subword (operands[1], 1);
- return mips_output_move (operands[0], operands[1]);
- }
+{
+ operands[1] = mips_subword (operands[1], 1);
+ return mips_output_move (operands[0], operands[1]);
+}
[(set_attr "type" "xfer,store")
(set_attr "mode" "SF")
(set_attr "length" "4")])
@@ -5441,12 +5084,12 @@ move\\t%0,%z4\\n\\
(use (match_operand:SI 2 "" ""))
(use (match_operand:SI 3 "const_int_operand" ""))])]
"!TARGET_MIPS16 && !TARGET_MEMCPY"
- {
- if (mips_expand_block_move (operands[0], operands[1], operands[2]))
- DONE;
- else
- FAIL;
- })
+{
+ if (mips_expand_block_move (operands[0], operands[1], operands[2]))
+ DONE;
+ else
+ FAIL;
+})
;;
;; ....................
@@ -5455,7 +5098,7 @@ move\\t%0,%z4\\n\\
;;
;; ....................
-;; Many of these instructions uses trivial define_expands, because we
+;; Many of these instructions use trivial define_expands, because we
;; want to use a different set of constraints when TARGET_MIPS16.
(define_expand "ashlsi3"
@@ -5463,7 +5106,6 @@ move\\t%0,%z4\\n\\
(ashift:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
""
- "
{
/* On the mips16, a shift of more than 8 is a four byte instruction,
so, for a shift between 8 and 16, it is just as fast to do two
@@ -5487,20 +5129,19 @@ move\\t%0,%z4\\n\\
GEN_INT (INTVAL (operands[2]) - 8)));
DONE;
}
-}")
+})
(define_insn "ashlsi3_internal1"
[(set (match_operand:SI 0 "register_operand" "=d")
(ashift:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"!TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sll\\t%0,%1,%2\";
-}"
+ return "sll\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -5509,13 +5150,12 @@ move\\t%0,%z4\\n\\
(sign_extend:DI (ashift:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI"))))]
"TARGET_64BIT && !TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sll\\t%0,%1,%2\";
-}"
+ return "sll\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -5525,16 +5165,15 @@ move\\t%0,%z4\\n\\
(ashift:SI (match_operand:SI 1 "register_operand" "0,d")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_MIPS16"
- "*
{
if (which_alternative == 0)
- return \"sll\\t%0,%2\";
+ return "sll\t%0,%2";
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sll\\t%0,%1,%2\";
-}"
+ return "sll\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -5555,10 +5194,7 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[2]) <= 16"
[(set (match_dup 0) (ashift:SI (match_dup 1) (const_int 8)))
(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2)))]
-"
-{
- operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
-}")
+ { operands[2] = GEN_INT (INTVAL (operands[2]) - 8); })
(define_expand "ashldi3"
[(parallel [(set (match_operand:DI 0 "register_operand" "")
@@ -5566,7 +5202,6 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "arith_operand" "")))
(clobber (match_dup 3))])]
"TARGET_64BIT || (!TARGET_DEBUG_G_MODE && !TARGET_MIPS16)"
- "
{
if (TARGET_64BIT)
{
@@ -5599,7 +5234,7 @@ move\\t%0,%z4\\n\\
}
operands[3] = gen_reg_rtx (SImode);
-}")
+})
(define_insn "ashldi3_internal"
@@ -5608,27 +5243,22 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
-{
- operands[4] = const0_rtx;
-
- return \"sll\\t%3,%2,26\\n\\
-\\tbgez\\t%3,1f%#\\n\\
-\\tsll\\t%M0,%L1,%2\\n\\
-\\t%(b\\t3f\\n\\
-\\tmove\\t%L0,%z4%)\\n\\
-\\n\\
-%~1:\\n\\
-\\t%(beq\\t%3,%z4,2f\\n\\
-\\tsll\\t%M0,%M1,%2%)\\n\\
-\\n\\
-\\tsubu\\t%3,%z4,%2\\n\\
-\\tsrl\\t%3,%L1,%3\\n\\
-\\tor\\t%M0,%M0,%3\\n\\
-%~2:\\n\\
-\\tsll\\t%L0,%L1,%2\\n\\
-%~3:\";
-}"
+ "sll\t%3,%2,26\;\
+bgez\t%3,1f%#\;\
+sll\t%M0,%L1,%2\;\
+%(b\t3f\;\
+move\t%L0,%.%)\
+\n\n\
+%~1:\;\
+%(beq\t%3,%.,2f\;\
+sll\t%M0,%M1,%2%)\
+\n\;\
+subu\t%3,%.,%2\;\
+srl\t%3,%L1,%3\;\
+or\t%M0,%M0,%3\n\
+%~2:\;\
+sll\t%L0,%L1,%2\n\
+%~3:"
[(set_attr "type" "darith")
(set_attr "mode" "SI")
(set_attr "length" "48")])
@@ -5641,12 +5271,10 @@ move\\t%0,%z4\\n\\
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
&& (INTVAL (operands[2]) & 32) != 0"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- operands[4] = const0_rtx;
- return \"sll\\t%M0,%L1,%2\;move\\t%L0,%z4\";
-}"
+ return "sll\t%M0,%L1,%2\;move\t%L0,%.";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -5694,16 +5322,14 @@ move\\t%0,%z4\\n\\
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
&& (INTVAL (operands[2]) & 63) < 32
&& (INTVAL (operands[2]) & 63) != 0"
- "*
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
- operands[4] = const0_rtx;
- operands[5] = GEN_INT ((-amount) & 31);
+ operands[4] = GEN_INT ((-amount) & 31);
- return \"sll\\t%M0,%M1,%2\;srl\\t%3,%L1,%5\;or\\t%M0,%M0,%3\;sll\\t%L0,%L1,%2\";
-}"
+ return "sll\t%M0,%M1,%2\;srl\t%3,%L1,%4\;or\t%M0,%M0,%3\;sll\t%L0,%L1,%2";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "16")])
@@ -5736,12 +5362,11 @@ move\\t%0,%z4\\n\\
(set (subreg:SI (match_dup 0) 0)
(ashift:SI (subreg:SI (match_dup 1) 0)
(match_dup 2)))]
- "
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
-}")
+})
(define_split
@@ -5771,12 +5396,11 @@ move\\t%0,%z4\\n\\
(set (subreg:SI (match_dup 0) 4)
(ashift:SI (subreg:SI (match_dup 1) 4)
(match_dup 2)))]
- "
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
-}")
+})
(define_insn "ashldi3_internal4"
@@ -5784,13 +5408,12 @@ move\\t%0,%z4\\n\\
(ashift:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"dsll\\t%0,%1,%2\";
-}"
+ return "dsll\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -5799,16 +5422,15 @@ move\\t%0,%z4\\n\\
(ashift:DI (match_operand:DI 1 "register_operand" "0,d")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_64BIT && TARGET_MIPS16"
- "*
{
if (which_alternative == 0)
- return \"dsll\\t%0,%2\";
+ return "dsll\t%0,%2";
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"dsll\\t%0,%1,%2\";
-}"
+ return "dsll\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr_alternative "length"
@@ -5831,17 +5453,13 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[2]) <= 16"
[(set (match_dup 0) (ashift:DI (match_dup 1) (const_int 8)))
(set (match_dup 0) (ashift:DI (match_dup 0) (match_dup 2)))]
-"
-{
- operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
-}")
+ { operands[2] = GEN_INT (INTVAL (operands[2]) - 8); })
(define_expand "ashrsi3"
[(set (match_operand:SI 0 "register_operand" "=d")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
""
- "
{
/* On the mips16, a shift of more than 8 is a four byte instruction,
so, for a shift between 8 and 16, it is just as fast to do two
@@ -5861,20 +5479,19 @@ move\\t%0,%z4\\n\\
GEN_INT (INTVAL (operands[2]) - 8)));
DONE;
}
-}")
+})
(define_insn "ashrsi3_internal1"
[(set (match_operand:SI 0 "register_operand" "=d")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"!TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sra\\t%0,%1,%2\";
-}"
+ return "sra\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -5883,16 +5500,15 @@ move\\t%0,%z4\\n\\
(ashiftrt:SI (match_operand:SI 1 "register_operand" "0,d")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_MIPS16"
- "*
{
if (which_alternative == 0)
- return \"sra\\t%0,%2\";
+ return "sra\t%0,%2";
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sra\\t%0,%1,%2\";
-}"
+ return "sra\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -5914,10 +5530,7 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[2]) <= 16"
[(set (match_dup 0) (ashiftrt:SI (match_dup 1) (const_int 8)))
(set (match_dup 0) (ashiftrt:SI (match_dup 0) (match_dup 2)))]
-"
-{
- operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
-}")
+ { operands[2] = GEN_INT (INTVAL (operands[2]) - 8); })
(define_expand "ashrdi3"
[(parallel [(set (match_operand:DI 0 "register_operand" "")
@@ -5925,7 +5538,6 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "arith_operand" "")))
(clobber (match_dup 3))])]
"TARGET_64BIT || (!TARGET_DEBUG_G_MODE && !TARGET_MIPS16)"
- "
{
if (TARGET_64BIT)
{
@@ -5954,7 +5566,7 @@ move\\t%0,%z4\\n\\
}
operands[3] = gen_reg_rtx (SImode);
-}")
+})
(define_insn "ashrdi3_internal"
@@ -5963,27 +5575,22 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
-{
- operands[4] = const0_rtx;
-
- return \"sll\\t%3,%2,26\\n\\
-\\tbgez\\t%3,1f%#\\n\\
-\\tsra\\t%L0,%M1,%2\\n\\
-\\t%(b\\t3f\\n\\
-\\tsra\\t%M0,%M1,31%)\\n\\
-\\n\\
-%~1:\\n\\
-\\t%(beq\\t%3,%z4,2f\\n\\
-\\tsrl\\t%L0,%L1,%2%)\\n\\
-\\n\\
-\\tsubu\\t%3,%z4,%2\\n\\
-\\tsll\\t%3,%M1,%3\\n\\
-\\tor\\t%L0,%L0,%3\\n\\
-%~2:\\n\\
-\\tsra\\t%M0,%M1,%2\\n\\
-%~3:\";
-}"
+ "sll\t%3,%2,26\;\
+bgez\t%3,1f%#\;\
+sra\t%L0,%M1,%2\;\
+%(b\t3f\;\
+sra\t%M0,%M1,31%)\
+\n\n\
+%~1:\;\
+%(beq\t%3,%.,2f\;\
+srl\t%L0,%L1,%2%)\
+\n\;\
+subu\t%3,%.,%2\;\
+sll\t%3,%M1,%3\;\
+or\t%L0,%L0,%3\n\
+%~2:\;\
+sra\t%M0,%M1,%2\n\
+%~3:"
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "48")])
@@ -5995,11 +5602,10 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "small_int" "IJK")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && (INTVAL (operands[2]) & 32) != 0"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sra\\t%L0,%M1,%2\;sra\\t%M0,%M1,31\";
-}"
+ return "sra\t%L0,%M1,%2\;sra\t%M0,%M1,31";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -6047,15 +5653,14 @@ move\\t%0,%z4\\n\\
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
&& (INTVAL (operands[2]) & 63) < 32
&& (INTVAL (operands[2]) & 63) != 0"
- "*
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
- return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;sra\\t%M0,%M1,%2\";
-}"
+ return "srl\t%L0,%L1,%2\;sll\t%3,%M1,%4\;or\t%L0,%L0,%3\;sra\t%M0,%M1,%2";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "16")])
@@ -6088,12 +5693,11 @@ move\\t%0,%z4\\n\\
(set (subreg:SI (match_dup 0) 4)
(ashiftrt:SI (subreg:SI (match_dup 1) 4)
(match_dup 2)))]
- "
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
-}")
+})
(define_split
@@ -6123,12 +5727,11 @@ move\\t%0,%z4\\n\\
(set (subreg:SI (match_dup 0) 0)
(ashiftrt:SI (subreg:SI (match_dup 1) 0)
(match_dup 2)))]
- "
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
-}")
+})
(define_insn "ashrdi3_internal4"
@@ -6136,13 +5739,12 @@ move\\t%0,%z4\\n\\
(ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"dsra\\t%0,%1,%2\";
-}"
+ return "dsra\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -6151,13 +5753,12 @@ move\\t%0,%z4\\n\\
(ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_64BIT && TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"dsra\\t%0,%2\";
-}"
+ return "dsra\t%0,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr_alternative "length"
@@ -6179,17 +5780,13 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[2]) <= 16"
[(set (match_dup 0) (ashiftrt:DI (match_dup 1) (const_int 8)))
(set (match_dup 0) (ashiftrt:DI (match_dup 0) (match_dup 2)))]
-"
-{
- operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
-}")
+ { operands[2] = GEN_INT (INTVAL (operands[2]) - 8); })
(define_expand "lshrsi3"
[(set (match_operand:SI 0 "register_operand" "=d")
(lshiftrt:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
""
- "
{
/* On the mips16, a shift of more than 8 is a four byte instruction,
so, for a shift between 8 and 16, it is just as fast to do two
@@ -6209,20 +5806,19 @@ move\\t%0,%z4\\n\\
GEN_INT (INTVAL (operands[2]) - 8)));
DONE;
}
-}")
+})
(define_insn "lshrsi3_internal1"
[(set (match_operand:SI 0 "register_operand" "=d")
(lshiftrt:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"!TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"srl\\t%0,%1,%2\";
-}"
+ return "srl\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -6231,16 +5827,15 @@ move\\t%0,%z4\\n\\
(lshiftrt:SI (match_operand:SI 1 "register_operand" "0,d")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_MIPS16"
- "*
{
if (which_alternative == 0)
- return \"srl\\t%0,%2\";
+ return "srl\t%0,%2";
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"srl\\t%0,%1,%2\";
-}"
+ return "srl\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -6262,10 +5857,7 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[2]) <= 16"
[(set (match_dup 0) (lshiftrt:SI (match_dup 1) (const_int 8)))
(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
-"
-{
- operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
-}")
+ { operands[2] = GEN_INT (INTVAL (operands[2]) - 8); })
;; If we load a byte on the mips16 as a bitfield, the resulting
;; sequence of instructions is too complicated for combine, because it
@@ -6280,7 +5872,7 @@ move\\t%0,%z4\\n\\
(lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
(match_operand:SI 2 "immediate_operand" "I")))]
"0 && TARGET_MIPS16"
- "lw\\t%0,%1\;srl\\t%0,%2"
+ "lw\t%0,%1\;srl\t%0,%2"
[(set_attr "type" "load")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -6303,7 +5895,6 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "arith_operand" "")))
(clobber (match_dup 3))])]
"TARGET_64BIT || (!TARGET_DEBUG_G_MODE && !TARGET_MIPS16)"
- "
{
if (TARGET_64BIT)
{
@@ -6332,7 +5923,7 @@ move\\t%0,%z4\\n\\
}
operands[3] = gen_reg_rtx (SImode);
-}")
+})
(define_insn "lshrdi3_internal"
@@ -6341,27 +5932,22 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
-{
- operands[4] = const0_rtx;
-
- return \"sll\\t%3,%2,26\\n\\
-\\tbgez\\t%3,1f%#\\n\\
-\\tsrl\\t%L0,%M1,%2\\n\\
-\\t%(b\\t3f\\n\\
-\\tmove\\t%M0,%z4%)\\n\\
-\\n\\
-%~1:\\n\\
-\\t%(beq\\t%3,%z4,2f\\n\\
-\\tsrl\\t%L0,%L1,%2%)\\n\\
-\\n\\
-\\tsubu\\t%3,%z4,%2\\n\\
-\\tsll\\t%3,%M1,%3\\n\\
-\\tor\\t%L0,%L0,%3\\n\\
-%~2:\\n\\
-\\tsrl\\t%M0,%M1,%2\\n\\
-%~3:\";
-}"
+ "sll\t%3,%2,26\;\
+bgez\t%3,1f%#\;\
+srl\t%L0,%M1,%2\;\
+%(b\t3f\;\
+move\t%M0,%.%)\
+\n\n\
+%~1:\;\
+%(beq\t%3,%.,2f\;\
+srl\t%L0,%L1,%2%)\
+\n\;\
+subu\t%3,%.,%2\;\
+sll\t%3,%M1,%3\;\
+or\t%L0,%L0,%3\n\
+%~2:\;\
+srl\t%M0,%M1,%2\n\
+%~3:"
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "48")])
@@ -6374,12 +5960,10 @@ move\\t%0,%z4\\n\\
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
&& (INTVAL (operands[2]) & 32) != 0"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- operands[4] = const0_rtx;
- return \"srl\\t%L0,%M1,%2\;move\\t%M0,%z4\";
-}"
+ return "srl\t%L0,%M1,%2\;move\t%M0,%.";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -6427,15 +6011,14 @@ move\\t%0,%z4\\n\\
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16
&& (INTVAL (operands[2]) & 63) < 32
&& (INTVAL (operands[2]) & 63) != 0"
- "*
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
- return \"srl\\t%L0,%L1,%2\;sll\\t%3,%M1,%4\;or\\t%L0,%L0,%3\;srl\\t%M0,%M1,%2\";
-}"
+ return "srl\t%L0,%L1,%2\;sll\t%3,%M1,%4\;or\t%L0,%L0,%3\;srl\t%M0,%M1,%2";
+}
[(set_attr "type" "darith")
(set_attr "mode" "DI")
(set_attr "length" "16")])
@@ -6468,12 +6051,11 @@ move\\t%0,%z4\\n\\
(set (subreg:SI (match_dup 0) 4)
(lshiftrt:SI (subreg:SI (match_dup 1) 4)
(match_dup 2)))]
- "
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
-}")
+})
(define_split
@@ -6503,12 +6085,11 @@ move\\t%0,%z4\\n\\
(set (subreg:SI (match_dup 0) 0)
(lshiftrt:SI (subreg:SI (match_dup 1) 0)
(match_dup 2)))]
- "
{
int amount = INTVAL (operands[2]);
operands[2] = GEN_INT (amount & 31);
operands[4] = GEN_INT ((-amount) & 31);
-}")
+})
(define_insn "lshrdi3_internal4"
@@ -6516,13 +6097,12 @@ move\\t%0,%z4\\n\\
(lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"dsrl\\t%0,%1,%2\";
-}"
+ return "dsrl\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -6531,13 +6111,12 @@ move\\t%0,%z4\\n\\
(lshiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_64BIT && TARGET_MIPS16"
- "*
{
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"dsrl\\t%0,%2\";
-}"
+ return "dsrl\t%0,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr_alternative "length"
@@ -6551,17 +6130,16 @@ move\\t%0,%z4\\n\\
(rotatert:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dn")))]
"ISA_HAS_ROTR_SI"
- "*
{
if (TARGET_SR71K && GET_CODE (operands[2]) != CONST_INT)
- return \"rorv\\t%0,%1,%2\";
+ return "rorv\t%0,%1,%2";
if ((GET_CODE (operands[2]) == CONST_INT)
&& (INTVAL (operands[2]) < 0 || INTVAL (operands[2]) >= 32))
abort ();
- return \"ror\\t%0,%1,%2\";
-}"
+ return "ror\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -6570,23 +6148,22 @@ move\\t%0,%z4\\n\\
(rotatert:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "arith_operand" "dn")))]
"ISA_HAS_ROTR_DI"
- "*
{
- if (TARGET_SR71K)
+ if (TARGET_SR71K)
{
if (GET_CODE (operands[2]) != CONST_INT)
- return \"drorv\\t%0,%1,%2\";
+ return "drorv\t%0,%1,%2";
if (INTVAL (operands[2]) >= 32 && INTVAL (operands[2]) <= 63)
- return \"dror32\\t%0,%1,%2\";
+ return "dror32\t%0,%1,%2";
}
if ((GET_CODE (operands[2]) == CONST_INT)
&& (INTVAL (operands[2]) < 0 || INTVAL (operands[2]) >= 64))
abort ();
- return \"dror\\t%0,%1,%2\";
-}"
+ return "dror\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -6603,11 +6180,7 @@ move\\t%0,%z4\\n\\
&& INTVAL (operands[2]) <= 16"
[(set (match_dup 0) (lshiftrt:DI (match_dup 1) (const_int 8)))
(set (match_dup 0) (lshiftrt:DI (match_dup 0) (match_dup 2)))]
-"
-{
- operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
-}")
-
+ { operands[2] = GEN_INT (INTVAL (operands[2]) - 8); })
;;
;; ....................
@@ -6627,7 +6200,7 @@ move\\t%0,%z4\\n\\
;; Different CC modes are used, based on what type of branch is
;; done, so that we can constrain things appropriately. There
;; are assumptions in the rest of GCC that break if we fold the
-;; operands into the branchs for integer operations, and use cc0
+;; operands into the branches for integer operations, and use cc0
;; for floating point, so we use the fp status register instead.
;; If needed, an appropriate temporary is created to hold the
;; of the integer compare.
@@ -6637,95 +6210,70 @@ move\\t%0,%z4\\n\\
(compare:CC (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "arith_operand" "")))]
""
- "
{
- if (operands[0]) /* avoid unused code message */
- {
- branch_cmp[0] = operands[0];
- branch_cmp[1] = operands[1];
- branch_type = CMP_SI;
- DONE;
- }
-}")
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = operands[1];
+ branch_type = CMP_SI;
+ DONE;
+})
(define_expand "tstsi"
[(set (cc0)
(match_operand:SI 0 "register_operand" ""))]
""
- "
{
- if (operands[0]) /* avoid unused code message */
- {
- branch_cmp[0] = operands[0];
- branch_cmp[1] = const0_rtx;
- branch_type = CMP_SI;
- DONE;
- }
-}")
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = const0_rtx;
+ branch_type = CMP_SI;
+ DONE;
+})
(define_expand "cmpdi"
[(set (cc0)
(compare:CC (match_operand:DI 0 "register_operand" "")
(match_operand:DI 1 "arith_operand" "")))]
"TARGET_64BIT"
- "
{
- if (operands[0]) /* avoid unused code message */
- {
- branch_cmp[0] = operands[0];
- branch_cmp[1] = operands[1];
- branch_type = CMP_DI;
- DONE;
- }
-}")
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = operands[1];
+ branch_type = CMP_DI;
+ DONE;
+})
(define_expand "tstdi"
[(set (cc0)
(match_operand:DI 0 "register_operand" ""))]
"TARGET_64BIT"
- "
{
- if (operands[0]) /* avoid unused code message */
- {
- branch_cmp[0] = operands[0];
- branch_cmp[1] = const0_rtx;
- branch_type = CMP_DI;
- DONE;
- }
-}")
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = const0_rtx;
+ branch_type = CMP_DI;
+ DONE;
+})
(define_expand "cmpdf"
[(set (cc0)
(compare:CC (match_operand:DF 0 "register_operand" "")
(match_operand:DF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "
{
- if (operands[0]) /* avoid unused code message */
- {
- branch_cmp[0] = operands[0];
- branch_cmp[1] = operands[1];
- branch_type = CMP_DF;
- DONE;
- }
-}")
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = operands[1];
+ branch_type = CMP_DF;
+ DONE;
+})
(define_expand "cmpsf"
[(set (cc0)
(compare:CC (match_operand:SF 0 "register_operand" "")
(match_operand:SF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
- if (operands[0]) /* avoid unused code message */
- {
- branch_cmp[0] = operands[0];
- branch_cmp[1] = operands[1];
- branch_type = CMP_SF;
- DONE;
- }
-}")
-
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = operands[1];
+ branch_type = CMP_SF;
+ DONE;
+})
;;
;; ....................
@@ -6745,7 +6293,6 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 1 "" ""))
(pc)))]
"TARGET_HARD_FLOAT"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6753,7 +6300,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/1,
/*inverted_p=*/0,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6766,7 +6313,6 @@ move\\t%0,%z4\\n\\
(pc)
(label_ref (match_operand 1 "" ""))))]
"TARGET_HARD_FLOAT"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6774,7 +6320,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/1,
/*inverted_p=*/1,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6789,7 +6335,6 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 1 "" ""))
(pc)))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6797,7 +6342,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/0,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6810,7 +6355,6 @@ move\\t%0,%z4\\n\\
(pc)
(label_ref (match_operand 1 "" ""))))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6818,7 +6362,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/1,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6831,7 +6375,6 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 1 "" ""))
(pc)))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6839,7 +6382,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/0,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6852,7 +6395,6 @@ move\\t%0,%z4\\n\\
(pc)
(label_ref (match_operand 1 "" ""))))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6860,7 +6402,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/1,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6875,7 +6417,6 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 1 "" ""))
(pc)))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6883,7 +6424,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/0,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6896,7 +6437,6 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 1 "" ""))
(pc)))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6904,7 +6444,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/0,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6917,7 +6457,6 @@ move\\t%0,%z4\\n\\
(pc)
(label_ref (match_operand 1 "" ""))))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6925,7 +6464,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/1,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6938,7 +6477,6 @@ move\\t%0,%z4\\n\\
(pc)
(label_ref (match_operand 1 "" ""))))]
"!TARGET_MIPS16"
- "*
{
return mips_output_conditional_branch (insn,
operands,
@@ -6946,7 +6484,7 @@ move\\t%0,%z4\\n\\
/*float_p=*/0,
/*inverted_p=*/1,
get_attr_length (insn));
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")])
@@ -6960,23 +6498,22 @@ move\\t%0,%z4\\n\\
(match_operand 2 "pc_or_label_operand" "")
(match_operand 3 "pc_or_label_operand" "")))]
"TARGET_MIPS16"
- "*
{
if (operands[2] != pc_rtx)
{
if (which_alternative == 0)
- return \"b%C0z\\t%1,%2\";
+ return "b%C0z\t%1,%2";
else
- return \"bt%C0z\\t%2\";
+ return "bt%C0z\t%2";
}
else
{
if (which_alternative == 0)
- return \"b%N0z\\t%1,%3\";
+ return "b%N0z\t%1,%3";
else
- return \"bt%N0z\\t%3\";
+ return "bt%N0z\t%3";
}
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
@@ -6989,23 +6526,22 @@ move\\t%0,%z4\\n\\
(match_operand 2 "pc_or_label_operand" "")
(match_operand 3 "pc_or_label_operand" "")))]
"TARGET_MIPS16"
- "*
{
if (operands[2] != pc_rtx)
{
if (which_alternative == 0)
- return \"b%C0z\\t%1,%2\";
+ return "b%C0z\t%1,%2";
else
- return \"bt%C0z\\t%2\";
+ return "bt%C0z\t%2";
}
else
{
if (which_alternative == 0)
- return \"b%N0z\\t%1,%3\";
+ return "b%N0z\t%1,%3";
else
- return \"bt%N0z\\t%3\";
+ return "bt%N0z\t%3";
}
-}"
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
@@ -7017,14 +6553,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, UNORDERED);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, UNORDERED);
+ DONE;
+})
(define_expand "bordered"
[(set (pc)
@@ -7033,14 +6565,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, ORDERED);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, ORDERED);
+ DONE;
+})
(define_expand "bunlt"
[(set (pc)
@@ -7049,14 +6577,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, UNLT);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, UNLT);
+ DONE;
+})
(define_expand "bunge"
[(set (pc)
@@ -7065,11 +6589,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
gen_conditional_branch (operands, UNGE);
DONE;
-}")
+})
(define_expand "buneq"
[(set (pc)
@@ -7078,14 +6601,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, UNEQ);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, UNEQ);
+ DONE;
+})
(define_expand "bltgt"
[(set (pc)
@@ -7094,11 +6613,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
gen_conditional_branch (operands, LTGT);
DONE;
-}")
+})
(define_expand "bunle"
[(set (pc)
@@ -7107,14 +6625,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, UNLE);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, UNLE);
+ DONE;
+})
(define_expand "bungt"
[(set (pc)
@@ -7123,11 +6637,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
gen_conditional_branch (operands, UNGT);
DONE;
-}")
+})
(define_expand "beq"
[(set (pc)
@@ -7136,14 +6649,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, EQ);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, EQ);
+ DONE;
+})
(define_expand "bne"
[(set (pc)
@@ -7152,14 +6661,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, NE);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, NE);
+ DONE;
+})
(define_expand "bgt"
[(set (pc)
@@ -7168,14 +6673,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, GT);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, GT);
+ DONE;
+})
(define_expand "bge"
[(set (pc)
@@ -7184,14 +6685,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, GE);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, GE);
+ DONE;
+})
(define_expand "blt"
[(set (pc)
@@ -7200,14 +6697,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, LT);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, LT);
+ DONE;
+})
(define_expand "ble"
[(set (pc)
@@ -7216,14 +6709,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, LE);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, LE);
+ DONE;
+})
(define_expand "bgtu"
[(set (pc)
@@ -7232,14 +6721,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, GTU);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, GTU);
+ DONE;
+})
(define_expand "bgeu"
[(set (pc)
@@ -7248,15 +6733,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, GEU);
- DONE;
- }
-}")
-
+ gen_conditional_branch (operands, GEU);
+ DONE;
+})
(define_expand "bltu"
[(set (pc)
@@ -7265,14 +6745,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, LTU);
- DONE;
- }
-}")
+ gen_conditional_branch (operands, LTU);
+ DONE;
+})
(define_expand "bleu"
[(set (pc)
@@ -7281,15 +6757,10 @@ move\\t%0,%z4\\n\\
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
- if (operands[0]) /* avoid unused code warning */
- {
- gen_conditional_branch (operands, LEU);
- DONE;
- }
-}")
-
+ gen_conditional_branch (operands, LEU);
+ DONE;
+})
;;
;; ....................
@@ -7303,7 +6774,6 @@ move\\t%0,%z4\\n\\
(eq:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7322,7 +6792,7 @@ move\\t%0,%z4\\n\\
operands[2] = force_reg (SImode, operands[2]);
/* fall through and generate default code */
-}")
+})
(define_insn "seq_si_zero"
@@ -7330,7 +6800,7 @@ move\\t%0,%z4\\n\\
(eq:SI (match_operand:SI 1 "register_operand" "d")
(const_int 0)))]
"!TARGET_MIPS16"
- "sltu\\t%0,%1,1"
+ "sltu\t%0,%1,1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7339,7 +6809,7 @@ move\\t%0,%z4\\n\\
(eq:SI (match_operand:SI 1 "register_operand" "d")
(const_int 0)))]
"TARGET_MIPS16"
- "sltu\\t%1,1"
+ "sltu\t%1,1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7348,7 +6818,7 @@ move\\t%0,%z4\\n\\
(eq:DI (match_operand:DI 1 "register_operand" "d")
(const_int 0)))]
"TARGET_64BIT && !TARGET_MIPS16"
- "sltu\\t%0,%1,1"
+ "sltu\t%0,%1,1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7357,7 +6827,7 @@ move\\t%0,%z4\\n\\
(eq:DI (match_operand:DI 1 "register_operand" "d")
(const_int 0)))]
"TARGET_64BIT && TARGET_MIPS16"
- "sltu\\t%1,1"
+ "sltu\t%1,1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7367,8 +6837,8 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "uns_arith_operand" "d,K")))]
"TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
"@
- xor\\t%0,%1,%2\;sltu\\t%0,%0,1
- xori\\t%0,%1,%2\;sltu\\t%0,%0,1"
+ xor\t%0,%1,%2\;sltu\t%0,%0,1
+ xori\t%0,%1,%2\;sltu\t%0,%0,1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "8")])
@@ -7393,8 +6863,8 @@ move\\t%0,%z4\\n\\
(match_operand:DI 2 "uns_arith_operand" "d,K")))]
"TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
"@
- xor\\t%0,%1,%2\;sltu\\t%0,%0,1
- xori\\t%0,%1,%2\;sltu\\t%0,%0,1"
+ xor\t%0,%1,%2\;sltu\t%0,%0,1
+ xori\t%0,%1,%2\;sltu\t%0,%0,1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -7421,7 +6891,6 @@ move\\t%0,%z4\\n\\
(ne:SI (match_dup 1)
(match_dup 2)))]
"!TARGET_MIPS16"
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7440,14 +6909,14 @@ move\\t%0,%z4\\n\\
operands[2] = force_reg (SImode, operands[2]);
/* fall through and generate default code */
-}")
+})
(define_insn "sne_si_zero"
[(set (match_operand:SI 0 "register_operand" "=d")
(ne:SI (match_operand:SI 1 "register_operand" "d")
(const_int 0)))]
"!TARGET_MIPS16"
- "sltu\\t%0,%.,%1"
+ "sltu\t%0,%.,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7456,7 +6925,7 @@ move\\t%0,%z4\\n\\
(ne:DI (match_operand:DI 1 "register_operand" "d")
(const_int 0)))]
"TARGET_64BIT && !TARGET_MIPS16"
- "sltu\\t%0,%.,%1"
+ "sltu\t%0,%.,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7466,8 +6935,8 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "uns_arith_operand" "d,K")))]
"TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
"@
- xor\\t%0,%1,%2\;sltu\\t%0,%.,%0
- xori\\t%0,%1,%x2\;sltu\\t%0,%.,%0"
+ xor\t%0,%1,%2\;sltu\t%0,%.,%0
+ xori\t%0,%1,%x2\;sltu\t%0,%.,%0"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "8")])
@@ -7492,8 +6961,8 @@ move\\t%0,%z4\\n\\
(match_operand:DI 2 "uns_arith_operand" "d,K")))]
"TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
"@
- xor\\t%0,%1,%2\;sltu\\t%0,%.,%0
- xori\\t%0,%1,%x2\;sltu\\t%0,%.,%0"
+ xor\t%0,%1,%2\;sltu\t%0,%.,%0
+ xori\t%0,%1,%x2\;sltu\t%0,%.,%0"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -7518,7 +6987,6 @@ move\\t%0,%z4\\n\\
(gt:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7537,14 +7005,14 @@ move\\t%0,%z4\\n\\
operands[2] = force_reg (SImode, operands[2]);
/* fall through and generate default code */
-}")
+})
(define_insn "sgt_si"
[(set (match_operand:SI 0 "register_operand" "=d")
(gt:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "reg_or_0_operand" "dJ")))]
"!TARGET_MIPS16"
- "slt\\t%0,%z2,%1"
+ "slt\t%0,%z2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7553,7 +7021,7 @@ move\\t%0,%z4\\n\\
(gt:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "register_operand" "d")))]
"TARGET_MIPS16"
- "slt\\t%2,%1"
+ "slt\t%2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7562,7 +7030,7 @@ move\\t%0,%z4\\n\\
(gt:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "reg_or_0_operand" "dJ")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "slt\\t%0,%z2,%1"
+ "slt\t%0,%z2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7571,7 +7039,7 @@ move\\t%0,%z4\\n\\
(gt:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")))]
"TARGET_64BIT && TARGET_MIPS16"
- "slt\\t%2,%1"
+ "slt\t%2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7580,7 +7048,6 @@ move\\t%0,%z4\\n\\
(ge:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7596,14 +7063,14 @@ move\\t%0,%z4\\n\\
}
/* fall through and generate default code */
-}")
+})
(define_insn "sge_si"
[(set (match_operand:SI 0 "register_operand" "=d")
(ge:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "slt\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
+ "slt\t%0,%1,%2\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "8")])
@@ -7626,7 +7093,7 @@ move\\t%0,%z4\\n\\
(ge:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "arith_operand" "dI")))]
"TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "slt\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
+ "slt\t%0,%1,%2\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -7650,7 +7117,6 @@ move\\t%0,%z4\\n\\
(lt:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7666,14 +7132,14 @@ move\\t%0,%z4\\n\\
}
/* fall through and generate default code */
-}")
+})
(define_insn "slt_si"
[(set (match_operand:SI 0 "register_operand" "=d")
(lt:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"!TARGET_MIPS16"
- "slt\\t%0,%1,%2"
+ "slt\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7682,7 +7148,7 @@ move\\t%0,%z4\\n\\
(lt:SI (match_operand:SI 1 "register_operand" "d,d")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_MIPS16"
- "slt\\t%1,%2"
+ "slt\t%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -7696,7 +7162,7 @@ move\\t%0,%z4\\n\\
(lt:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "arith_operand" "dI")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "slt\\t%0,%1,%2"
+ "slt\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7705,7 +7171,7 @@ move\\t%0,%z4\\n\\
(lt:DI (match_operand:DI 1 "register_operand" "d,d")
(match_operand:DI 2 "arith_operand" "d,I")))]
"TARGET_64BIT && TARGET_MIPS16"
- "slt\\t%1,%2"
+ "slt\t%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr_alternative "length"
@@ -7719,7 +7185,6 @@ move\\t%0,%z4\\n\\
(le:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7738,18 +7203,17 @@ move\\t%0,%z4\\n\\
operands[2] = force_reg (SImode, operands[2]);
/* fall through and generate default code */
-}")
+})
(define_insn "sle_si_const"
[(set (match_operand:SI 0 "register_operand" "=d")
(le:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "small_int" "I")))]
"!TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2])+1);
- return \"slt\\t%0,%1,%2\";
-}"
+ return "slt\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7758,11 +7222,10 @@ move\\t%0,%z4\\n\\
(le:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "small_int" "I")))]
"TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2])+1);
- return \"slt\\t%1,%2\";
-}"
+ return "slt\t%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set (attr "length") (if_then_else (match_operand:VOID 2 "m16_uimm8_m1_1" "")
@@ -7774,11 +7237,10 @@ move\\t%0,%z4\\n\\
(le:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "small_int" "I")))]
"TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2])+1);
- return \"slt\\t%0,%1,%2\";
-}"
+ return "slt\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7787,11 +7249,10 @@ move\\t%0,%z4\\n\\
(le:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "small_int" "I")))]
"TARGET_64BIT && TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2])+1);
- return \"slt\\t%1,%2\";
-}"
+ return "slt\t%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set (attr "length") (if_then_else (match_operand:VOID 2 "m16_uimm8_m1_1" "")
@@ -7803,7 +7264,7 @@ move\\t%0,%z4\\n\\
(le:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "register_operand" "d")))]
"TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "slt\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
+ "slt\t%0,%z2,%1\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "8")])
@@ -7826,7 +7287,7 @@ move\\t%0,%z4\\n\\
(le:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")))]
"TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "slt\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
+ "slt\t%0,%z2,%1\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -7850,7 +7311,6 @@ move\\t%0,%z4\\n\\
(gtu:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7869,14 +7329,14 @@ move\\t%0,%z4\\n\\
operands[2] = force_reg (SImode, operands[2]);
/* fall through and generate default code */
-}")
+})
(define_insn "sgtu_si"
[(set (match_operand:SI 0 "register_operand" "=d")
(gtu:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "reg_or_0_operand" "dJ")))]
"!TARGET_MIPS16"
- "sltu\\t%0,%z2,%1"
+ "sltu\t%0,%z2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7885,7 +7345,7 @@ move\\t%0,%z4\\n\\
(gtu:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "register_operand" "d")))]
"TARGET_MIPS16"
- "sltu\\t%2,%1"
+ "sltu\t%2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -7894,7 +7354,7 @@ move\\t%0,%z4\\n\\
(gtu:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "reg_or_0_operand" "dJ")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "sltu\\t%0,%z2,%1"
+ "sltu\t%0,%z2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7903,7 +7363,7 @@ move\\t%0,%z4\\n\\
(gtu:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")))]
"TARGET_64BIT && TARGET_MIPS16"
- "sltu\\t%2,%1"
+ "sltu\t%2,%1"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -7912,7 +7372,6 @@ move\\t%0,%z4\\n\\
(geu:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7928,14 +7387,14 @@ move\\t%0,%z4\\n\\
}
/* fall through and generate default code */
-}")
+})
(define_insn "sgeu_si"
[(set (match_operand:SI 0 "register_operand" "=d")
(geu:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "sltu\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
+ "sltu\t%0,%1,%2\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "8")])
@@ -7958,7 +7417,7 @@ move\\t%0,%z4\\n\\
(geu:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "arith_operand" "dI")))]
"TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "sltu\\t%0,%1,%2\;xori\\t%0,%0,0x0001"
+ "sltu\t%0,%1,%2\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -7982,7 +7441,6 @@ move\\t%0,%z4\\n\\
(ltu:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -7998,14 +7456,14 @@ move\\t%0,%z4\\n\\
}
/* fall through and generate default code */
-}")
+})
(define_insn "sltu_si"
[(set (match_operand:SI 0 "register_operand" "=d")
(ltu:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "arith_operand" "dI")))]
"!TARGET_MIPS16"
- "sltu\\t%0,%1,%2"
+ "sltu\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -8014,7 +7472,7 @@ move\\t%0,%z4\\n\\
(ltu:SI (match_operand:SI 1 "register_operand" "d,d")
(match_operand:SI 2 "arith_operand" "d,I")))]
"TARGET_MIPS16"
- "sltu\\t%1,%2"
+ "sltu\t%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr_alternative "length"
@@ -8028,7 +7486,7 @@ move\\t%0,%z4\\n\\
(ltu:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "arith_operand" "dI")))]
"TARGET_64BIT && !TARGET_MIPS16"
- "sltu\\t%0,%1,%2"
+ "sltu\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -8037,7 +7495,7 @@ move\\t%0,%z4\\n\\
(ltu:DI (match_operand:DI 1 "register_operand" "d,d")
(match_operand:DI 2 "arith_operand" "d,I")))]
"TARGET_64BIT && TARGET_MIPS16"
- "sltu\\t%1,%2"
+ "sltu\t%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr_alternative "length"
@@ -8051,7 +7509,6 @@ move\\t%0,%z4\\n\\
(leu:SI (match_dup 1)
(match_dup 2)))]
""
- "
{
if (branch_type != CMP_SI && (!TARGET_64BIT || branch_type != CMP_DI))
FAIL;
@@ -8070,18 +7527,17 @@ move\\t%0,%z4\\n\\
operands[2] = force_reg (SImode, operands[2]);
/* fall through and generate default code */
-}")
+})
(define_insn "sleu_si_const"
[(set (match_operand:SI 0 "register_operand" "=d")
(leu:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "small_int" "I")))]
"!TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2]) + 1);
- return \"sltu\\t%0,%1,%2\";
-}"
+ return "sltu\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
@@ -8090,11 +7546,10 @@ move\\t%0,%z4\\n\\
(leu:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "small_int" "I")))]
"TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2])+1);
- return \"sltu\\t%1,%2\";
-}"
+ return "sltu\t%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set (attr "length") (if_then_else (match_operand:VOID 2 "m16_uimm8_m1_1" "")
@@ -8106,11 +7561,10 @@ move\\t%0,%z4\\n\\
(leu:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "small_int" "I")))]
"TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2]) + 1);
- return \"sltu\\t%0,%1,%2\";
-}"
+ return "sltu\t%0,%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
@@ -8119,11 +7573,10 @@ move\\t%0,%z4\\n\\
(leu:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "small_int" "I")))]
"TARGET_64BIT && TARGET_MIPS16 && INTVAL (operands[2]) < 32767"
- "*
{
operands[2] = GEN_INT (INTVAL (operands[2])+1);
- return \"sltu\\t%1,%2\";
-}"
+ return "sltu\t%1,%2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set (attr "length") (if_then_else (match_operand:VOID 2 "m16_uimm8_m1_1" "")
@@ -8135,7 +7588,7 @@ move\\t%0,%z4\\n\\
(leu:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "register_operand" "d")))]
"TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "sltu\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
+ "sltu\t%0,%z2,%1\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "8")])
@@ -8158,7 +7611,7 @@ move\\t%0,%z4\\n\\
(leu:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")))]
"TARGET_64BIT && TARGET_DEBUG_C_MODE && !TARGET_MIPS16"
- "sltu\\t%0,%z2,%1\;xori\\t%0,%0,0x0001"
+ "sltu\t%0,%z2,%1\;xori\t%0,%0,0x0001"
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr "length" "8")])
@@ -8176,7 +7629,6 @@ move\\t%0,%z4\\n\\
(xor:DI (match_dup 0)
(const_int 1)))]
"")
-
;;
;; ....................
@@ -8346,7 +7798,6 @@ move\\t%0,%z4\\n\\
"c.le.s\t%Z0%2,%1"
[(set_attr "type" "fcmp")
(set_attr "mode" "FPSW")])
-
;;
;; ....................
@@ -8361,21 +7812,20 @@ move\\t%0,%z4\\n\\
[(set (pc)
(label_ref (match_operand 0 "" "")))]
"!TARGET_MIPS16"
- "*
{
if (flag_pic && ! TARGET_EMBEDDED_PIC)
{
if (get_attr_length (insn) <= 8)
- return \"%*b\\t%l0%/\";
+ return "%*b\t%l0%/";
else
{
output_asm_insn (mips_output_load_label (), operands);
- return \"%*jr\\t%@%/%]\";
+ return "%*jr\t%@%/%]";
}
}
else
- return \"%*j\\t%l0%/\";
-}"
+ return "%*j\t%l0%/";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set (attr "length")
@@ -8397,7 +7847,7 @@ move\\t%0,%z4\\n\\
[(set (pc)
(label_ref (match_operand 0 "" "")))]
"TARGET_MIPS16"
- "b\\t%l0"
+ "b\t%l0"
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
@@ -8405,24 +7855,20 @@ move\\t%0,%z4\\n\\
(define_expand "indirect_jump"
[(set (pc) (match_operand 0 "register_operand" "d"))]
""
- "
{
rtx dest;
- if (operands[0]) /* eliminate unused code warnings */
- {
- dest = operands[0];
- if (GET_CODE (dest) != REG || GET_MODE (dest) != Pmode)
- operands[0] = copy_to_mode_reg (Pmode, dest);
+ dest = operands[0];
+ if (GET_CODE (dest) != REG || GET_MODE (dest) != Pmode)
+ operands[0] = copy_to_mode_reg (Pmode, dest);
- if (!(Pmode == DImode))
- emit_jump_insn (gen_indirect_jump_internal1 (operands[0]));
- else
- emit_jump_insn (gen_indirect_jump_internal2 (operands[0]));
+ if (!(Pmode == DImode))
+ emit_jump_insn (gen_indirect_jump_internal1 (operands[0]));
+ else
+ emit_jump_insn (gen_indirect_jump_internal2 (operands[0]));
- DONE;
- }
-}")
+ DONE;
+})
(define_insn "indirect_jump_internal1"
[(set (pc) (match_operand:SI 0 "register_operand" "d"))]
@@ -8443,35 +7889,31 @@ move\\t%0,%z4\\n\\
(match_operand 0 "register_operand" "d"))
(use (label_ref (match_operand 1 "" "")))]
""
- "
{
- if (operands[0]) /* eliminate unused code warnings */
+ if (TARGET_MIPS16)
{
- if (TARGET_MIPS16)
- {
- if (GET_MODE (operands[0]) != HImode)
- abort ();
- if (!(Pmode == DImode))
- emit_insn (gen_tablejump_mips161 (operands[0], operands[1]));
- else
- emit_insn (gen_tablejump_mips162 (operands[0], operands[1]));
- DONE;
- }
-
- if (GET_MODE (operands[0]) != ptr_mode)
+ if (GET_MODE (operands[0]) != HImode)
abort ();
-
- if (TARGET_GPWORD)
- operands[0] = expand_binop (ptr_mode, add_optab, operands[0],
- pic_offset_table_rtx, 0, 0, OPTAB_WIDEN);
-
- if (Pmode == SImode)
- emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
+ if (!(Pmode == DImode))
+ emit_insn (gen_tablejump_mips161 (operands[0], operands[1]));
else
- emit_jump_insn (gen_tablejump_internal2 (operands[0], operands[1]));
+ emit_insn (gen_tablejump_mips162 (operands[0], operands[1]));
DONE;
}
-}")
+
+ if (GET_MODE (operands[0]) != ptr_mode)
+ abort ();
+
+ if (TARGET_GPWORD)
+ operands[0] = expand_binop (ptr_mode, add_optab, operands[0],
+ pic_offset_table_rtx, 0, 0, OPTAB_WIDEN);
+
+ if (Pmode == SImode)
+ emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
+ else
+ emit_jump_insn (gen_tablejump_internal2 (operands[0], operands[1]));
+ DONE;
+})
(define_insn "tablejump_internal1"
[(set (pc)
@@ -8496,52 +7938,44 @@ move\\t%0,%z4\\n\\
(match_operand:HI 0 "register_operand" "d"))
(label_ref:SI (match_operand 1 "" ""))))]
"TARGET_MIPS16 && !(Pmode == DImode)"
- "
{
- if (operands[0]) /* eliminate unused code warnings. */
- {
- rtx t1, t2, t3;
-
- t1 = gen_reg_rtx (SImode);
- t2 = gen_reg_rtx (SImode);
- t3 = gen_reg_rtx (SImode);
- emit_insn (gen_extendhisi2 (t1, operands[0]));
- emit_move_insn (t2, gen_rtx_LABEL_REF (SImode, operands[1]));
- emit_insn (gen_addsi3 (t3, t1, t2));
- emit_jump_insn (gen_tablejump_internal1 (t3, operands[1]));
- DONE;
- }
-}")
+ rtx t1, t2, t3;
+
+ t1 = gen_reg_rtx (SImode);
+ t2 = gen_reg_rtx (SImode);
+ t3 = gen_reg_rtx (SImode);
+ emit_insn (gen_extendhisi2 (t1, operands[0]));
+ emit_move_insn (t2, gen_rtx_LABEL_REF (SImode, operands[1]));
+ emit_insn (gen_addsi3 (t3, t1, t2));
+ emit_jump_insn (gen_tablejump_internal1 (t3, operands[1]));
+ DONE;
+})
(define_expand "tablejump_mips162"
[(set (pc) (plus:DI (sign_extend:DI
(match_operand:HI 0 "register_operand" "d"))
(label_ref:DI (match_operand 1 "" ""))))]
"TARGET_MIPS16 && Pmode == DImode"
- "
{
- if (operands[0]) /* eliminate unused code warnings. */
- {
- rtx t1, t2, t3;
-
- t1 = gen_reg_rtx (DImode);
- t2 = gen_reg_rtx (DImode);
- t3 = gen_reg_rtx (DImode);
- emit_insn (gen_extendhidi2 (t1, operands[0]));
- emit_move_insn (t2, gen_rtx_LABEL_REF (DImode, operands[1]));
- emit_insn (gen_adddi3 (t3, t1, t2));
- emit_jump_insn (gen_tablejump_internal2 (t3, operands[1]));
- DONE;
- }
-}")
+ rtx t1, t2, t3;
+
+ t1 = gen_reg_rtx (DImode);
+ t2 = gen_reg_rtx (DImode);
+ t3 = gen_reg_rtx (DImode);
+ emit_insn (gen_extendhidi2 (t1, operands[0]));
+ emit_move_insn (t2, gen_rtx_LABEL_REF (DImode, operands[1]));
+ emit_insn (gen_adddi3 (t3, t1, t2));
+ emit_jump_insn (gen_tablejump_internal2 (t3, operands[1]));
+ DONE;
+})
;; Implement a switch statement when generating embedded PIC code.
;; Switches are implemented by `tablejump' when not using -membedded-pic.
(define_expand "casesi"
[(set (match_dup 5)
- (minus:SI (match_operand:SI 0 "register_operand" "d")
- (match_operand:SI 1 "arith_operand" "dI")))
+ (minus:SI (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "const_int_operand" "")))
(set (cc0)
(compare:CC (match_dup 5)
(match_operand:SI 2 "arith_operand" "")))
@@ -8558,28 +7992,25 @@ move\\t%0,%z4\\n\\
(clobber (match_scratch:SI 6 ""))
(clobber (reg:SI 31))])]
"TARGET_EMBEDDED_PIC"
- "
{
- if (operands[0])
- {
- rtx reg = gen_reg_rtx (SImode);
+ rtx index;
- /* If the index is too large, go to the default label. */
- emit_insn (gen_subsi3 (reg, operands[0], operands[1]));
- emit_insn (gen_cmpsi (reg, operands[2]));
- emit_insn (gen_bgtu (operands[4]));
+ /* If the index is too large, go to the default label. */
+ index = expand_binop (SImode, sub_optab, operands[0],
+ operands[1], 0, 0, OPTAB_WIDEN);
+ emit_insn (gen_cmpsi (index, operands[2]));
+ emit_insn (gen_bgtu (operands[4]));
- /* Do the PIC jump. */
- if (Pmode != DImode)
- emit_jump_insn (gen_casesi_internal (reg, operands[3],
- gen_reg_rtx (SImode)));
- else
- emit_jump_insn (gen_casesi_internal_di (reg, operands[3],
- gen_reg_rtx (DImode)));
+ /* Do the PIC jump. */
+ if (Pmode != DImode)
+ emit_jump_insn (gen_casesi_internal (index, operands[3],
+ gen_reg_rtx (SImode)));
+ else
+ emit_jump_insn (gen_casesi_internal_di (index, operands[3],
+ gen_reg_rtx (DImode)));
- DONE;
- }
-}")
+ DONE;
+})
;; An embedded PIC switch statement looks like this:
;; bal $LS1
@@ -8602,8 +8033,8 @@ move\\t%0,%z4\\n\\
(clobber (match_operand:SI 2 "register_operand" "=d"))
(clobber (reg:SI 31))]
"TARGET_EMBEDDED_PIC"
- "%(bal\\t%S1\;sll\\t%2,%0,2\\n%~%S1:\;addu\\t%2,%2,$31%)\;\\
-lw\\t%2,%1-%S1(%2)\;addu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
+ "%(bal\t%S1\;sll\t%2,%0,2\n%~%S1:\;addu\t%2,%2,$31%)\;\
+lw\t%2,%1-%S1(%2)\;addu\t%2,%2,$31\;%*j\t%2%/"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "24")])
@@ -8619,8 +8050,8 @@ lw\\t%2,%1-%S1(%2)\;addu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(clobber (match_operand:DI 2 "register_operand" "=d"))
(clobber (reg:DI 31))]
"TARGET_EMBEDDED_PIC"
- "%(bal\\t%S1\;sll\\t%2,%0,3\\n%~%S1:\;daddu\\t%2,%2,$31%)\;\\
-ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
+ "%(bal\t%S1\;sll\t%2,%0,3\n%~%S1:\;daddu\t%2,%2,$31%)\;\
+ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "24")])
@@ -8633,22 +8064,21 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(define_expand "builtin_setjmp_setup"
[(use (match_operand 0 "register_operand" ""))]
"TARGET_ABICALLS"
- {
- rtx addr;
+{
+ rtx addr;
- addr = plus_constant (operands[0], GET_MODE_SIZE (Pmode) * 3);
- emit_move_insn (gen_rtx_MEM (Pmode, addr), pic_offset_table_rtx);
- DONE;
- })
+ addr = plus_constant (operands[0], GET_MODE_SIZE (Pmode) * 3);
+ emit_move_insn (gen_rtx_MEM (Pmode, addr), pic_offset_table_rtx);
+ DONE;
+})
-;; Restore the gp that we saved above. Despite the comment, it seems that
-;; older code did recalculate the gp from $25. Continue to jump through
+;; Restore the gp that we saved above. Despite the earlier comment, it seems
+;; that older code did recalculate the gp from $25. Continue to jump through
;; $25 for compatibility (we lose nothing by doing so).
(define_expand "builtin_longjmp"
[(use (match_operand 0 "register_operand" "r"))]
"TARGET_ABICALLS"
- "
{
/* The elements of the buffer are, in order: */
int W = GET_MODE_SIZE (Pmode);
@@ -8673,7 +8103,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
emit_insn (gen_rtx_USE (VOIDmode, gp));
emit_indirect_jump (pv);
DONE;
-}")
+})
;;
;; ....................
@@ -8686,14 +8116,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(define_expand "prologue"
[(const_int 1)]
""
- "
{
- if (mips_isa >= 0) /* avoid unused code warnings */
- {
- mips_expand_prologue ();
- DONE;
- }
-}")
+ mips_expand_prologue ();
+ DONE;
+})
;; Block any insns from being moved before this point, since the
;; profiling call to mcount can use various registers that aren't
@@ -8724,7 +8150,8 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
})
;; Trivial return. Make it look like a normal return insn as that
-;; allows jump optimizations to work better .
+;; allows jump optimizations to work better.
+
(define_insn "return"
[(return)]
"mips_can_use_return_insn ()"
@@ -8751,7 +8178,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(clobber (reg:SI 31))]
"TARGET_EMBEDDED_PIC
&& GET_CODE (operands[1]) == SYMBOL_REF"
- "%($LF%= = . + 8\;bal\\t$LF%=\;nop;la\\t%0,%1-$LF%=%)\;addu\\t%0,%0,$31"
+ "%($LF%= = . + 8\;bal\t$LF%=\;nop;la\t%0,%1-$LF%=%)\;addu\t%0,%0,$31"
[(set_attr "type" "call")
(set_attr "mode" "none")
(set_attr "length" "20")])
@@ -8760,7 +8187,6 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(define_expand "eh_return"
[(use (match_operand 0 "general_operand" ""))]
""
- "
{
enum machine_mode gpr_mode = TARGET_64BIT ? DImode : SImode;
@@ -8772,7 +8198,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
emit_insn (gen_eh_set_lr_si (operands[0]));
DONE;
-}")
+})
;; Clobber the return address on the stack. We can't expand this
;; until we know where it will be put in the stack frame.
@@ -8794,15 +8220,14 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(clobber (match_scratch 1 ""))]
"reload_completed && !TARGET_DEBUG_D_MODE"
[(const_int 0)]
- "
{
mips_set_return_address (operands[0], operands[1]);
DONE;
-}")
+})
(define_insn "exception_receiver"
[(set (reg:SI 28)
- (unspec_volatile [(const_int 0)] UNSPEC_EH_RECEIVER))]
+ (unspec_volatile:SI [(const_int 0)] UNSPEC_EH_RECEIVER))]
"TARGET_ABICALLS && (mips_abi == ABI_32 || mips_abi == ABI_O64)"
{ return mips_restore_gp (operands); }
[(set_attr "type" "load")
@@ -8815,11 +8240,12 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
;;
;; ....................
-;; Sibling calls. All these patterns use direct jumps.
+;; Sibling calls. All these patterns use jump instructions.
-;; call_insn_operand will only accepts constant addresses if a direct
-;; jump is acceptable. Since the 'S' constraint is defined in terms of
-;; call_insn_operand, the same is true of the constraints.
+;; If TARGET_SIBCALLS, call_insn_operand will only accept constant
+;; addresses if a direct jump is acceptable. Since the 'S' constraint
+;; is defined in terms of call_insn_operand, the same is true of the
+;; constraints.
;; When we use an indirect jump, we need a register that will be
;; preserved by the epilogue. Since TARGET_ABICALLS forces us to
@@ -8900,11 +8326,11 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
"%*jal\t%0%/"
"reload_completed && TARGET_SPLIT_CALLS"
[(const_int 0)]
- {
- emit_call_insn (gen_call_split (operands[0], operands[1]));
- emit_insn (gen_exception_receiver ());
- DONE;
- }
+{
+ emit_call_insn (gen_call_split (operands[0], operands[1]));
+ emit_insn (gen_exception_receiver ());
+ DONE;
+}
[(set_attr "jal" "indirect,direct")
(set_attr "extended_mips16" "no,yes")])
@@ -8938,12 +8364,12 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
"%*jal\t%1%/"
"reload_completed && TARGET_SPLIT_CALLS"
[(const_int 0)]
- {
- emit_call_insn (gen_call_value_split (operands[0], operands[1],
- operands[2]));
- emit_insn (gen_exception_receiver ());
- DONE;
- }
+{
+ emit_call_insn (gen_call_value_split (operands[0], operands[1],
+ operands[2]));
+ emit_insn (gen_exception_receiver ());
+ DONE;
+}
[(set_attr "jal" "indirect,direct")
(set_attr "extended_mips16" "no,yes")])
@@ -8969,12 +8395,12 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
"%*jal\t%1%/"
"reload_completed && TARGET_SPLIT_CALLS"
[(const_int 0)]
- {
- emit_call_insn (gen_call_value_multiple_split (operands[0], operands[1],
- operands[2], operands[3]));
- emit_insn (gen_exception_receiver ());
- DONE;
- }
+{
+ emit_call_insn (gen_call_value_multiple_split (operands[0], operands[1],
+ operands[2], operands[3]));
+ emit_insn (gen_exception_receiver ());
+ DONE;
+}
[(set_attr "jal" "indirect,direct")
(set_attr "extended_mips16" "no,yes")])
@@ -8999,7 +8425,6 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand 1 "" "")
(match_operand 2 "" "")])]
""
- "
{
int i;
@@ -9013,7 +8438,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
emit_insn (gen_blockage ());
DONE;
-}")
+})
;;
;; ....................
@@ -9040,7 +8465,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SI 1 "const_int_operand" "n")
(match_operand:SI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == SImode"
- "* return mips_emit_prefetch (operands);"
+ { return mips_emit_prefetch (operands); }
[(set_attr "type" "prefetch")])
(define_insn "prefetch_si"
@@ -9048,7 +8473,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SI 1 "const_int_operand" "n")
(match_operand:SI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == SImode"
- "* return mips_emit_prefetch (operands);"
+ { return mips_emit_prefetch (operands); }
[(set_attr "type" "prefetch")])
(define_insn "prefetch_di_address"
@@ -9057,7 +8482,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DI 1 "const_int_operand" "n")
(match_operand:DI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == DImode"
- "* return mips_emit_prefetch (operands);"
+ { return mips_emit_prefetch (operands); }
[(set_attr "type" "prefetch")])
(define_insn "prefetch_di"
@@ -9065,7 +8490,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DI 1 "const_int_operand" "n")
(match_operand:DI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == DImode"
- "* return mips_emit_prefetch (operands);"
+ { return mips_emit_prefetch (operands); }
[(set_attr "type" "prefetch")])
(define_insn "nop"
@@ -9086,24 +8511,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
return "#nop";
}
[(set_attr "type" "arith")])
-
-;; The MIPS chip does not seem to require stack probes.
-;;
-;; (define_expand "probe"
-;; [(set (match_dup 0)
-;; (match_dup 1))]
-;; ""
-;; "
-;; {
-;; operands[0] = gen_reg_rtx (SImode);
-;; operands[1] = gen_rtx_MEM (SImode, stack_pointer_rtx);
-;; MEM_VOLATILE_P (operands[1]) = TRUE;
-;;
-;; /* fall through and generate default code */
-;; }")
-;;
-;;
;; MIPS4 Conditional move instructions.
(define_insn ""
@@ -9116,9 +8524,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SI 3 "reg_or_0_operand" "0,dJ")))]
"ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
"@
- mov%B4\\t%0,%z2,%1
- mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ mov%B4\t%0,%z2,%1
+ mov%b4\t%0,%z3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "SI")])
(define_insn ""
@@ -9131,9 +8539,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SI 3 "reg_or_0_operand" "0,dJ")))]
"ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
"@
- mov%B4\\t%0,%z2,%1
- mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ mov%B4\t%0,%z2,%1
+ mov%b4\t%0,%z3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "SI")])
(define_insn ""
@@ -9147,9 +8555,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SI 2 "reg_or_0_operand" "0,dJ")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT"
"@
- mov%T3\\t%0,%z1,%4
- mov%t3\\t%0,%z2,%4"
- [(set_attr "type" "move")
+ mov%T3\t%0,%z1,%4
+ mov%t3\t%0,%z2,%4"
+ [(set_attr "type" "condmove")
(set_attr "mode" "SI")])
(define_insn ""
@@ -9162,9 +8570,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DI 3 "reg_or_0_operand" "0,dJ")))]
"(ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE) && TARGET_64BIT"
"@
- mov%B4\\t%0,%z2,%1
- mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ mov%B4\t%0,%z2,%1
+ mov%b4\t%0,%z3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "DI")])
(define_insn ""
@@ -9177,9 +8585,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DI 3 "reg_or_0_operand" "0,dJ")))]
"(ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE) && TARGET_64BIT"
"@
- mov%B4\\t%0,%z2,%1
- mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ mov%B4\t%0,%z2,%1
+ mov%b4\t%0,%z3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "DI")])
(define_insn ""
@@ -9193,9 +8601,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DI 2 "reg_or_0_operand" "0,dJ")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT && TARGET_64BIT"
"@
- mov%T3\\t%0,%z1,%4
- mov%t3\\t%0,%z2,%4"
- [(set_attr "type" "move")
+ mov%T3\t%0,%z1,%4
+ mov%t3\t%0,%z2,%4"
+ [(set_attr "type" "condmove")
(set_attr "mode" "DI")])
(define_insn ""
@@ -9208,9 +8616,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SF 3 "register_operand" "0,f")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT"
"@
- mov%B4.s\\t%0,%2,%1
- mov%b4.s\\t%0,%3,%1"
- [(set_attr "type" "move")
+ mov%B4.s\t%0,%2,%1
+ mov%b4.s\t%0,%3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "SF")])
(define_insn ""
@@ -9223,9 +8631,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SF 3 "register_operand" "0,f")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT"
"@
- mov%B4.s\\t%0,%2,%1
- mov%b4.s\\t%0,%3,%1"
- [(set_attr "type" "move")
+ mov%B4.s\t%0,%2,%1
+ mov%b4.s\t%0,%3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "SF")])
(define_insn ""
@@ -9239,9 +8647,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SF 2 "register_operand" "0,f")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT"
"@
- mov%T3.s\\t%0,%1,%4
- mov%t3.s\\t%0,%2,%4"
- [(set_attr "type" "move")
+ mov%T3.s\t%0,%1,%4
+ mov%t3.s\t%0,%2,%4"
+ [(set_attr "type" "condmove")
(set_attr "mode" "SF")])
(define_insn ""
@@ -9254,9 +8662,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DF 3 "register_operand" "0,f")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
"@
- mov%B4.d\\t%0,%2,%1
- mov%b4.d\\t%0,%3,%1"
- [(set_attr "type" "move")
+ mov%B4.d\t%0,%2,%1
+ mov%b4.d\t%0,%3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "DF")])
(define_insn ""
@@ -9269,9 +8677,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DF 3 "register_operand" "0,f")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
"@
- mov%B4.d\\t%0,%2,%1
- mov%b4.d\\t%0,%3,%1"
- [(set_attr "type" "move")
+ mov%B4.d\t%0,%2,%1
+ mov%b4.d\t%0,%3,%1"
+ [(set_attr "type" "condmove")
(set_attr "mode" "DF")])
(define_insn ""
@@ -9285,9 +8693,9 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DF 2 "register_operand" "0,f")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
"@
- mov%T3.d\\t%0,%1,%4
- mov%t3.d\\t%0,%2,%4"
- [(set_attr "type" "move")
+ mov%T3.d\t%0,%1,%4
+ mov%t3.d\t%0,%2,%4"
+ [(set_attr "type" "condmove")
(set_attr "mode" "DF")])
;; These are the main define_expand's used to make conditional moves.
@@ -9299,11 +8707,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SI 2 "reg_or_0_operand" "")
(match_operand:SI 3 "reg_or_0_operand" "")))]
"ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
- "
{
gen_conditional_move (operands);
DONE;
-}")
+})
(define_expand "movdicc"
[(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
@@ -9312,11 +8719,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DI 2 "reg_or_0_operand" "")
(match_operand:DI 3 "reg_or_0_operand" "")))]
"(ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE) && TARGET_64BIT"
- "
{
gen_conditional_move (operands);
DONE;
-}")
+})
(define_expand "movsfcc"
[(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
@@ -9325,11 +8731,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:SF 2 "register_operand" "")
(match_operand:SF 3 "register_operand" "")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT"
- "
{
gen_conditional_move (operands);
DONE;
-}")
+})
(define_expand "movdfcc"
[(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
@@ -9338,11 +8743,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
(match_operand:DF 2 "register_operand" "")
(match_operand:DF 3 "register_operand" "")))]
"ISA_HAS_CONDMOVE && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
- "
{
gen_conditional_move (operands);
DONE;
-}")
+})
;;
;; ....................
@@ -9356,11 +8760,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
[(unspec_volatile [(match_operand:QI 0 "consttable_operand" "=g")]
UNSPEC_CONSTTABLE_QI)]
"TARGET_MIPS16"
- "*
{
assemble_integer (operands[0], 1, BITS_PER_UNIT, 1);
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "unknown")
(set_attr "mode" "QI")
(set_attr "length" "8")])
@@ -9369,11 +8772,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
[(unspec_volatile [(match_operand:HI 0 "consttable_operand" "=g")]
UNSPEC_CONSTTABLE_HI)]
"TARGET_MIPS16"
- "*
{
assemble_integer (operands[0], 2, BITS_PER_UNIT * 2, 1);
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "unknown")
(set_attr "mode" "HI")
(set_attr "length" "8")])
@@ -9382,11 +8784,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
[(unspec_volatile [(match_operand:SI 0 "consttable_operand" "=g")]
UNSPEC_CONSTTABLE_SI)]
"TARGET_MIPS16"
- "*
{
assemble_integer (operands[0], 4, BITS_PER_UNIT * 4, 1);
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "unknown")
(set_attr "mode" "SI")
(set_attr "length" "8")])
@@ -9395,11 +8796,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
[(unspec_volatile [(match_operand:DI 0 "consttable_operand" "=g")]
UNSPEC_CONSTTABLE_DI)]
"TARGET_MIPS16"
- "*
{
assemble_integer (operands[0], 8, BITS_PER_UNIT * 8, 1);
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "unknown")
(set_attr "mode" "DI")
(set_attr "length" "16")])
@@ -9408,7 +8808,6 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
[(unspec_volatile [(match_operand:SF 0 "consttable_operand" "=g")]
UNSPEC_CONSTTABLE_SF)]
"TARGET_MIPS16"
- "*
{
REAL_VALUE_TYPE d;
@@ -9416,8 +8815,8 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
abort ();
REAL_VALUE_FROM_CONST_DOUBLE (d, operands[0]);
assemble_real (d, SFmode, GET_MODE_ALIGNMENT (SFmode));
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "unknown")
(set_attr "mode" "SF")
(set_attr "length" "8")])
@@ -9426,7 +8825,6 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
[(unspec_volatile [(match_operand:DF 0 "consttable_operand" "=g")]
UNSPEC_CONSTTABLE_DF)]
"TARGET_MIPS16"
- "*
{
REAL_VALUE_TYPE d;
@@ -9434,8 +8832,8 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
abort ();
REAL_VALUE_FROM_CONST_DOUBLE (d, operands[0]);
assemble_real (d, DFmode, GET_MODE_ALIGNMENT (DFmode));
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "unknown")
(set_attr "mode" "DF")
(set_attr "length" "16")])
@@ -9493,13 +8891,12 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
&& dead_or_set_p (insn, operands[0])
&& GET_CODE (operands[1]) == REG
&& M16_REG_P (REGNO (operands[1]))"
- "*
{
if (operands[3] != pc_rtx)
- return \"b%C2z\\t%1,%3\";
+ return "b%C2z\t%1,%3";
else
- return \"b%N2z\\t%1,%4\";
-}"
+ return "b%N2z\t%1,%4";
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
@@ -9518,13 +8915,12 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
&& dead_or_set_p (insn, operands[0])
&& GET_CODE (operands[1]) == REG
&& M16_REG_P (REGNO (operands[1]))"
- "*
{
if (operands[3] != pc_rtx)
- return \"b%C2z\\t%1,%3\";
+ return "b%C2z\t%1,%3";
else
- return \"b%N2z\\t%1,%4\";
-}"
+ return "b%N2z\t%1,%4";
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
@@ -9547,13 +8943,12 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
&& GET_CODE (operands[0]) == REG
&& M16_REG_P (REGNO (operands[0]))
&& dead_or_set_p (insn, operands[0])"
- "*
{
if (operands[3] != pc_rtx)
- return \"bt%C2z\\t%3\";
+ return "bt%C2z\t%3";
else
- return \"bt%N2z\\t%4\";
-}"
+ return "bt%N2z\t%4";
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
@@ -9572,13 +8967,12 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\\n\\t%*j\\t%2%/"
&& GET_CODE (operands[0]) == REG
&& M16_REG_P (REGNO (operands[0]))
&& dead_or_set_p (insn, operands[0])"
- "*
{
if (operands[3] != pc_rtx)
- return \"bt%C2z\\t%3\";
+ return "bt%C2z\t%3";
else
- return \"bt%N2z\\t%4\";
-}"
+ return "bt%N2z\t%4";
+}
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
diff --git a/gcc/config/mips/netbsd.h b/gcc/config/mips/netbsd.h
index 3e6d2a7f459..4bdc8aad692 100644
--- a/gcc/config/mips/netbsd.h
+++ b/gcc/config/mips/netbsd.h
@@ -128,21 +128,10 @@ Boston, MA 02111-1307, USA. */
while (0)
-/* Include the generic MIPS ELF configuration. */
-#include <mips/elf.h>
-
-/* Now clean up after it. */
+/* Clean up after the generic MIPS/ELF configuration. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
-/* Get generic NetBSD definitions. */
-#include <netbsd.h>
-
-
-/* Get generic NetBSD ELF definitions. */
-#include <netbsd-elf.h>
-
-
/* Extra specs we need. */
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
diff --git a/gcc/config/mips/openbsd-be.h b/gcc/config/mips/openbsd-be.h
deleted file mode 100644
index 2f07c8fe110..00000000000
--- a/gcc/config/mips/openbsd-be.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Configuration fragment for a mips big-endian OpenBSD target
- Copyright (C) 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. */
-
-#define TARGET_ENDIAN_DEFAULT MASK_BIG_ENDIAN
diff --git a/gcc/config/mips/openbsd.h b/gcc/config/mips/openbsd.h
index a61aac0d438..6ca833bb372 100644
--- a/gcc/config/mips/openbsd.h
+++ b/gcc/config/mips/openbsd.h
@@ -1,5 +1,5 @@
/* Configuration for a Mips ABI32 OpenBSD target.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -21,35 +21,24 @@ Boston, MA 02111-1307, USA. */
/* Definitions needed for OpenBSD, to avoid picking mips 'defaults'. */
/* GAS must know this. */
+#undef SUBTARGET_ASM_SPEC
#define SUBTARGET_ASM_SPEC "%{fPIC|fPIE:-KPIC}"
#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* CPP specific OpenBSD specs. */
+#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
/* Needed for ELF (inspired by netbsd-elf). */
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
/* The profiling lib spec here is not really correct but we leave
it as it is until we have some kind of profiling working. */
#define LIB_SPEC OBSD_LIB_SPEC
-/* By default, OpenBSD mips is little endian. This is important to set
- here as mips/mips.h defaults to big endian. */
-#ifndef TARGET_ENDIAN_DEFAULT
-#define TARGET_ENDIAN_DEFAULT 0
-#endif
-
-#include <mips/mips.h>
-
-/* Get generic OpenBSD definitions. */
-#define OBSD_HAS_DECLARE_FUNCTION_NAME
-#define OBSD_HAS_DECLARE_OBJECT
-#define OBSD_HAS_CORRECT_SPECS
-#include <openbsd.h>
-
/* mips assembler uses .set for arcane purposes. __attribute__((alias))
and friends won't work until we get recent binutils with .weakext
support. */
@@ -109,9 +98,3 @@ Boston, MA 02111-1307, USA. */
/* Switch into a generic section. */
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
-
-/* collect2 support (Macros for initialization). */
-
-/* Mips default configuration is COFF-only, and confuses collect2. */
-#undef OBJECT_FORMAT_COFF
-#undef EXTENDED_COFF
diff --git a/gcc/config/mips/sdb.h b/gcc/config/mips/sdb.h
new file mode 100644
index 00000000000..6ac4c214e45
--- /dev/null
+++ b/gcc/config/mips/sdb.h
@@ -0,0 +1,89 @@
+/* Generate SDB debugging info.
+ 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. */
+
+/* Note that no configuration uses sdb as its preferred format. */
+
+#define SDB_DEBUGGING_INFO 1
+
+/* Forward references to tags are allowed. */
+#define SDB_ALLOW_FORWARD_REFERENCES
+
+/* Unknown tags are also allowed. */
+#define SDB_ALLOW_UNKNOWN_REFERENCES
+
+/* Block start/end next label #. */
+extern int sdb_label_count;
+
+/* Starting line of current function. */
+extern int sdb_begin_function_line;
+
+#define PUT_SDB_DEF(a) \
+do { \
+ fprintf (asm_out_file, "\t%s.def\t", \
+ (TARGET_GAS) ? "" : "#"); \
+ ASM_OUTPUT_LABELREF (asm_out_file, a); \
+ fputc (';', asm_out_file); \
+} while (0)
+
+#define PUT_SDB_PLAIN_DEF(a) \
+do { \
+ fprintf (asm_out_file, "\t%s.def\t.%s;", \
+ (TARGET_GAS) ? "" : "#", (a)); \
+} while (0)
+
+/* For block start and end, we create labels, so that
+ later we can figure out where the correct offset is.
+ The normal .ent/.end serve well enough for functions,
+ so those are just commented out. */
+
+#define PUT_SDB_BLOCK_START(LINE) \
+do { \
+ fprintf (asm_out_file, \
+ "%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (TARGET_GAS) ? "" : "#", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (LINE)); \
+ sdb_label_count++; \
+} while (0)
+
+#define PUT_SDB_BLOCK_END(LINE) \
+do { \
+ fprintf (asm_out_file, \
+ "%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (TARGET_GAS) ? "" : "#", \
+ LOCAL_LABEL_PREFIX, \
+ sdb_label_count, \
+ (LINE)); \
+ sdb_label_count++; \
+} while (0)
+
+#define PUT_SDB_FUNCTION_START(LINE)
+
+#define PUT_SDB_FUNCTION_END(LINE) \
+do { \
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \
+} while (0)
+
+#define PUT_SDB_EPILOGUE_END(NAME)
diff --git a/gcc/config/mips/sr71k.md b/gcc/config/mips/sr71k.md
index d6c7cafa083..51731893dbf 100644
--- a/gcc/config/mips/sr71k.md
+++ b/gcc/config/mips/sr71k.md
@@ -172,12 +172,11 @@
;; This reservation is for conditional move based on integer
-;; or floating point CC. This could probably use some refinement
-;; as "move" type attr seems to be overloaded in rtl.
-(define_insn_reservation "ir_sr70_move"
+;; or floating point CC.
+(define_insn_reservation "ir_sr70_condmove"
4
(and (eq_attr "cpu" "sr71000")
- (eq_attr "type" "move"))
+ (eq_attr "type" "condmove"))
"ri_insns")
;; Try to discriminate move-from-cp1 versus move-to-cp1 as latencies
@@ -206,7 +205,7 @@
(define_insn_reservation "ir_sr70_arith"
1
(and (eq_attr "cpu" "sr71000")
- (eq_attr "type" "arith,darith,const"))
+ (eq_attr "type" "move,arith,darith,const"))
"ri_insns")
;; emulate repeat (dispatch stall) by spending extra cycle(s) in
diff --git a/gcc/config/mips/t-rtems b/gcc/config/mips/t-rtems
new file mode 100644
index 00000000000..bd7b7adf467
--- /dev/null
+++ b/gcc/config/mips/t-rtems
@@ -0,0 +1,5 @@
+# Custom multilibs for RTEMS
+
+MULTILIB_OPTIONS = mips1/mips3 msoft-float/msingle-float EL/EB
+MULTILIB_DIRNAMES = mips1 mips3 soft-float single el eb
+MULTILIB_MATCHES = msingle-float=m4650
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index 7e04d6aa998..a5ae7c8ae2f 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -1,5 +1,5 @@
/* Prototypes for exported functions defined in mmix.c
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of GCC.
@@ -19,94 +19,89 @@ 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 mmix_override_options PARAMS ((void));
-extern void mmix_init_expanders PARAMS ((void));
-extern int mmix_eh_return_data_regno PARAMS ((int));
-extern int mmix_initial_elimination_offset PARAMS ((int, int));
-extern int mmix_starting_frame_offset PARAMS ((void));
-extern int mmix_function_arg_regno_p PARAMS ((int, int));
-extern void mmix_function_profiler PARAMS ((FILE *, int));
-extern void mmix_trampoline_template PARAMS ((FILE *));
+extern void mmix_override_options (void);
+extern void mmix_init_expanders (void);
+extern int mmix_eh_return_data_regno (int);
+extern int mmix_initial_elimination_offset (int, int);
+extern int mmix_starting_frame_offset (void);
+extern int mmix_function_arg_regno_p (int, int);
+extern void mmix_function_profiler (FILE *, int);
+extern void mmix_trampoline_template (FILE *);
extern int mmix_trampoline_size;
-extern int mmix_reversible_cc_mode PARAMS ((enum machine_mode));
+extern int mmix_reversible_cc_mode (enum machine_mode);
extern int mmix_register_move_cost
- PARAMS ((enum machine_mode, enum reg_class, enum reg_class));
-extern const char *mmix_text_section_asm_op PARAMS ((void));
-extern const char *mmix_data_section_asm_op PARAMS ((void));
-extern void mmix_asm_output_source_filename PARAMS ((FILE *, const char *));
-extern void mmix_output_quoted_string PARAMS ((FILE *, const char *, int));
-extern void mmix_asm_output_source_line PARAMS ((FILE *, int));
-extern void mmix_asm_output_ascii PARAMS ((FILE *, const char *, int));
-extern void mmix_asm_output_label PARAMS ((FILE *, const char *));
-extern void mmix_asm_weaken_label PARAMS ((FILE *, const char *));
-extern void mmix_asm_output_labelref PARAMS ((FILE *, const char *));
-extern void mmix_asm_output_def PARAMS ((FILE *, const char *, const char *));
-extern int mmix_print_operand_punct_valid_p PARAMS ((int));
-extern void mmix_asm_output_reg_push PARAMS ((FILE *, int));
-extern void mmix_asm_output_reg_pop PARAMS ((FILE *, int));
-extern void mmix_asm_output_skip PARAMS ((FILE *, int));
-extern void mmix_asm_output_align PARAMS ((FILE *, int));
-extern int mmix_shiftable_wyde_value PARAMS ((unsigned HOST_WIDEST_INT));
-extern void mmix_output_register_setting
- PARAMS ((FILE *, int, HOST_WIDEST_INT, int));
-extern void mmix_conditional_register_usage PARAMS ((void));
-extern int mmix_local_regno PARAMS ((int));
-extern int mmix_dbx_register_number PARAMS ((int));
-extern int mmix_use_simple_return PARAMS ((void));
-extern void mmix_make_decl_one_only PARAMS ((tree));
+ (enum machine_mode, enum reg_class, enum reg_class);
+extern const char *mmix_text_section_asm_op (void);
+extern const char *mmix_data_section_asm_op (void);
+extern void mmix_asm_output_source_filename (FILE *, const char *);
+extern void mmix_output_quoted_string (FILE *, const char *, int);
+extern void mmix_asm_output_source_line (FILE *, int);
+extern void mmix_asm_output_ascii (FILE *, const char *, int);
+extern void mmix_asm_output_label (FILE *, const char *);
+extern void mmix_asm_weaken_label (FILE *, const char *);
+extern void mmix_asm_output_labelref (FILE *, const char *);
+extern void mmix_asm_output_def (FILE *, const char *, const char *);
+extern int mmix_print_operand_punct_valid_p (int);
+extern void mmix_asm_output_reg_push (FILE *, int);
+extern void mmix_asm_output_reg_pop (FILE *, int);
+extern void mmix_asm_output_skip (FILE *, int);
+extern void mmix_asm_output_align (FILE *, int);
+extern int mmix_shiftable_wyde_value (unsigned HOST_WIDEST_INT);
+extern void mmix_output_register_setting (FILE *, int, HOST_WIDEST_INT, int);
+extern void mmix_conditional_register_usage (void);
+extern int mmix_local_regno (int);
+extern int mmix_dbx_register_number (int);
+extern int mmix_use_simple_return (void);
+extern void mmix_make_decl_one_only (tree);
extern int mmix_function_arg_pass_by_reference
- PARAMS ((const CUMULATIVE_ARGS *, enum machine_mode, tree, int));
-extern rtx mmix_function_outgoing_value PARAMS ((tree, tree));
-extern int mmix_function_value_regno_p PARAMS ((int));
-extern int mmix_data_alignment PARAMS ((tree, int));
-extern int mmix_constant_alignment PARAMS ((tree, int));
-extern int mmix_local_alignment PARAMS ((tree, int));
+ (const CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern rtx mmix_function_outgoing_value (tree, tree);
+extern int mmix_function_value_regno_p (int);
+extern int mmix_data_alignment (tree, int);
+extern int mmix_constant_alignment (tree, int);
+extern int mmix_local_alignment (tree, int);
extern void mmix_setup_incoming_varargs
- PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int));
-extern void mmix_asm_output_pool_prologue
- PARAMS ((FILE *, const char *, tree, int));
-extern void mmix_asm_output_aligned_common
- PARAMS ((FILE *, const char *, int, int));
-extern void mmix_asm_output_aligned_local
- PARAMS ((FILE *, const char *, int, int));
+ (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
+extern void mmix_asm_output_pool_prologue (FILE *, const char *, tree, int);
+extern void mmix_asm_output_aligned_common (FILE *, const char *, int, int);
+extern void mmix_asm_output_aligned_local (FILE *, const char *, int, int);
extern void mmix_asm_declare_register_global
- PARAMS ((FILE *, tree, int, const char *));
+ (FILE *, tree, int, const char *);
extern rtx mmix_function_arg
- PARAMS ((const CUMULATIVE_ARGS *, enum machine_mode, tree, int, int));
-extern rtx mmix_expand_builtin_va_arg PARAMS ((tree, tree));
-extern void mmix_asm_output_addr_diff_elt PARAMS ((FILE *, rtx, int, int));
-extern void mmix_asm_output_addr_vec_elt PARAMS ((FILE *, int));
-extern enum reg_class mmix_preferred_reload_class
- PARAMS ((rtx, enum reg_class));
+ (const CUMULATIVE_ARGS *, enum machine_mode, tree, int, int);
+extern rtx mmix_expand_builtin_va_arg (tree, tree);
+extern void mmix_asm_output_addr_diff_elt (FILE *, rtx, int, int);
+extern void mmix_asm_output_addr_vec_elt (FILE *, int);
+extern enum reg_class mmix_preferred_reload_class (rtx, enum reg_class);
extern enum reg_class mmix_preferred_output_reload_class
- PARAMS ((rtx, enum reg_class));
+ (rtx, enum reg_class);
extern enum reg_class mmix_secondary_reload_class
- PARAMS ((enum reg_class, enum machine_mode, rtx, int));
-extern int mmix_const_ok_for_letter_p PARAMS ((HOST_WIDE_INT, int));
-extern int mmix_const_double_ok_for_letter_p PARAMS ((rtx, int));
-extern int mmix_extra_constraint PARAMS ((rtx, int, int));
-extern rtx mmix_dynamic_chain_address PARAMS ((rtx));
-extern rtx mmix_return_addr_rtx PARAMS ((int, rtx));
-extern rtx mmix_eh_return_stackadj_rtx PARAMS ((void));
-extern rtx mmix_eh_return_handler_rtx PARAMS ((void));
-extern void mmix_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern int mmix_constant_address_p PARAMS ((rtx));
-extern int mmix_legitimate_address PARAMS ((enum machine_mode, rtx, int));
-extern int mmix_legitimate_constant_p PARAMS ((rtx));
-extern void mmix_print_operand PARAMS ((FILE *, rtx, int));
-extern void mmix_print_operand_address PARAMS ((FILE *, rtx));
-extern void mmix_expand_prologue PARAMS ((void));
-extern void mmix_expand_epilogue PARAMS ((void));
-extern rtx mmix_get_hard_reg_initial_val PARAMS ((enum machine_mode, int));
-extern int mmix_asm_preferred_eh_data_format PARAMS ((int, int));
-extern void mmix_setup_frame_addresses PARAMS ((void));
+ (enum reg_class, enum machine_mode, rtx, int);
+extern int mmix_const_ok_for_letter_p (HOST_WIDE_INT, int);
+extern int mmix_const_double_ok_for_letter_p (rtx, int);
+extern int mmix_extra_constraint (rtx, int, int);
+extern rtx mmix_dynamic_chain_address (rtx);
+extern rtx mmix_return_addr_rtx (int, rtx);
+extern rtx mmix_eh_return_stackadj_rtx (void);
+extern rtx mmix_eh_return_handler_rtx (void);
+extern void mmix_initialize_trampoline (rtx, rtx, rtx);
+extern int mmix_constant_address_p (rtx);
+extern int mmix_legitimate_address (enum machine_mode, rtx, int);
+extern int mmix_legitimate_constant_p (rtx);
+extern void mmix_print_operand (FILE *, rtx, int);
+extern void mmix_print_operand_address (FILE *, rtx);
+extern void mmix_expand_prologue (void);
+extern void mmix_expand_epilogue (void);
+extern rtx mmix_get_hard_reg_initial_val (enum machine_mode, int);
+extern int mmix_asm_preferred_eh_data_format (int, int);
+extern void mmix_setup_frame_addresses (void);
#ifdef RTX_CODE
/* Needs to be ifdef:d for sake of enum rtx_code. */
-extern enum machine_mode mmix_select_cc_mode PARAMS ((enum rtx_code, rtx, rtx));
-extern void mmix_canonicalize_comparison PARAMS ((enum rtx_code *, rtx *, rtx *));
-extern int mmix_valid_comparison PARAMS ((enum rtx_code, enum machine_mode, rtx));
-extern rtx mmix_gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx));
+extern enum machine_mode mmix_select_cc_mode (enum rtx_code, rtx, rtx);
+extern void mmix_canonicalize_comparison (enum rtx_code *, rtx *, rtx *);
+extern int mmix_valid_comparison (enum rtx_code, enum machine_mode, rtx);
+extern rtx mmix_gen_compare_reg (enum rtx_code, rtx, rtx);
#endif
/*
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 290b5d83e07..1feebdd9ae9 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for MMIX.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of GCC.
@@ -117,28 +117,25 @@ const char *mmix_cc1_ignored_option;
static int mmix_output_destination_register;
static void mmix_output_shiftvalue_op_from_str
- PARAMS ((FILE *, const char *, HOST_WIDEST_INT));
-static void mmix_output_shifted_value PARAMS ((FILE *, HOST_WIDEST_INT));
-static void mmix_output_condition PARAMS ((FILE *, rtx, int));
-static HOST_WIDEST_INT mmix_intval PARAMS ((rtx));
-static void mmix_output_octa PARAMS ((FILE *, HOST_WIDEST_INT, int));
-static bool mmix_assemble_integer PARAMS ((rtx, unsigned int, int));
-static struct machine_function * mmix_init_machine_status PARAMS ((void));
-static void mmix_encode_section_info PARAMS ((tree, rtx, int));
-static const char *mmix_strip_name_encoding PARAMS ((const char *));
-static void mmix_emit_sp_add PARAMS ((HOST_WIDE_INT offset));
-static void mmix_target_asm_function_prologue
- PARAMS ((FILE *, HOST_WIDE_INT));
-static void mmix_target_asm_function_end_prologue PARAMS ((FILE *));
-static void mmix_target_asm_function_epilogue
- PARAMS ((FILE *, HOST_WIDE_INT));
-static void mmix_reorg PARAMS ((void));
+ (FILE *, const char *, HOST_WIDEST_INT);
+static void mmix_output_shifted_value (FILE *, HOST_WIDEST_INT);
+static void mmix_output_condition (FILE *, rtx, int);
+static HOST_WIDEST_INT mmix_intval (rtx);
+static void mmix_output_octa (FILE *, HOST_WIDEST_INT, int);
+static bool mmix_assemble_integer (rtx, unsigned int, int);
+static struct machine_function *mmix_init_machine_status (void);
+static void mmix_encode_section_info (tree, rtx, int);
+static const char *mmix_strip_name_encoding (const char *);
+static void mmix_emit_sp_add (HOST_WIDE_INT offset);
+static void mmix_target_asm_function_prologue (FILE *, HOST_WIDE_INT);
+static void mmix_target_asm_function_end_prologue (FILE *);
+static void mmix_target_asm_function_epilogue (FILE *, HOST_WIDE_INT);
+static void mmix_reorg (void);
static void mmix_asm_output_mi_thunk
- PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
-static void mmix_file_start PARAMS ((void));
-static void mmix_file_end PARAMS ((void));
-static bool mmix_rtx_costs
- PARAMS ((rtx, int, int, int *));
+ (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
+static void mmix_file_start (void);
+static void mmix_file_end (void);
+static bool mmix_rtx_costs (rtx, int, int, int *);
/* Target structure macros. Listed by node. See `Using and Porting GCC'
@@ -198,7 +195,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
/* OVERRIDE_OPTIONS. */
void
-mmix_override_options ()
+mmix_override_options (void)
{
/* Should we err or should we warn? Hmm. At least we must neutralize
it. For example the wrong kind of case-tables will be generated with
@@ -215,7 +212,7 @@ mmix_override_options ()
/* INIT_EXPANDERS. */
void
-mmix_init_expanders ()
+mmix_init_expanders (void)
{
init_machine_status = mmix_init_machine_status;
}
@@ -223,7 +220,7 @@ mmix_init_expanders ()
/* Set the per-function data. */
static struct machine_function *
-mmix_init_machine_status ()
+mmix_init_machine_status (void)
{
return ggc_alloc_cleared (sizeof (struct machine_function));
}
@@ -234,9 +231,7 @@ mmix_init_machine_status ()
at least 32-bit alignment. */
int
-mmix_data_alignment (type, basic_align)
- tree type ATTRIBUTE_UNUSED;
- int basic_align;
+mmix_data_alignment (tree type ATTRIBUTE_UNUSED, int basic_align)
{
if (basic_align < 32)
return 32;
@@ -247,9 +242,7 @@ mmix_data_alignment (type, basic_align)
/* CONSTANT_ALIGNMENT. */
int
-mmix_constant_alignment (constant, basic_align)
- tree constant ATTRIBUTE_UNUSED;
- int basic_align;
+mmix_constant_alignment (tree constant ATTRIBUTE_UNUSED, int basic_align)
{
if (basic_align < 32)
return 32;
@@ -260,9 +253,7 @@ mmix_constant_alignment (constant, basic_align)
/* LOCAL_ALIGNMENT. */
int
-mmix_local_alignment (type, basic_align)
- tree type ATTRIBUTE_UNUSED;
- int basic_align;
+mmix_local_alignment (tree type ATTRIBUTE_UNUSED, int basic_align)
{
if (basic_align < 32)
return 32;
@@ -273,7 +264,7 @@ mmix_local_alignment (type, basic_align)
/* CONDITIONAL_REGISTER_USAGE. */
void
-mmix_conditional_register_usage ()
+mmix_conditional_register_usage (void)
{
int i;
@@ -314,8 +305,7 @@ mmix_conditional_register_usage ()
saved are local. */
int
-mmix_local_regno (regno)
- int regno;
+mmix_local_regno (int regno)
{
return regno <= MMIX_LAST_STACK_REGISTER_REGNUM && !call_used_regs[regno];
}
@@ -324,9 +314,7 @@ mmix_local_regno (regno)
We need to extend the reload class of REMAINDER_REG and HIMULT_REG. */
enum reg_class
-mmix_preferred_reload_class (x, class)
- rtx x ATTRIBUTE_UNUSED;
- enum reg_class class;
+mmix_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
{
/* FIXME: Revisit. */
return GET_CODE (x) == MOD && GET_MODE (x) == DImode
@@ -337,9 +325,8 @@ mmix_preferred_reload_class (x, class)
We need to extend the reload class of REMAINDER_REG and HIMULT_REG. */
enum reg_class
-mmix_preferred_output_reload_class (x, class)
- rtx x ATTRIBUTE_UNUSED;
- enum reg_class class;
+mmix_preferred_output_reload_class (rtx x ATTRIBUTE_UNUSED,
+ enum reg_class class)
{
/* FIXME: Revisit. */
return GET_CODE (x) == MOD && GET_MODE (x) == DImode
@@ -350,11 +337,10 @@ mmix_preferred_output_reload_class (x, class)
We need to reload regs of REMAINDER_REG and HIMULT_REG elsewhere. */
enum reg_class
-mmix_secondary_reload_class (class, mode, x, in_p)
- enum reg_class class;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- rtx x ATTRIBUTE_UNUSED;
- int in_p ATTRIBUTE_UNUSED;
+mmix_secondary_reload_class (enum reg_class class,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx x ATTRIBUTE_UNUSED,
+ int in_p ATTRIBUTE_UNUSED)
{
if (class == REMAINDER_REG
|| class == HIMULT_REG
@@ -367,9 +353,7 @@ mmix_secondary_reload_class (class, mode, x, in_p)
/* CONST_OK_FOR_LETTER_P. */
int
-mmix_const_ok_for_letter_p (value, c)
- HOST_WIDE_INT value;
- int c;
+mmix_const_ok_for_letter_p (HOST_WIDE_INT value, int c)
{
return
(c == 'I' ? value >= 0 && value <= 255
@@ -386,9 +370,7 @@ mmix_const_ok_for_letter_p (value, c)
/* CONST_DOUBLE_OK_FOR_LETTER_P. */
int
-mmix_const_double_ok_for_letter_p (value, c)
- rtx value;
- int c;
+mmix_const_double_ok_for_letter_p (rtx value, int c)
{
return
(c == 'G' ? value == CONST0_RTX (GET_MODE (value))
@@ -400,10 +382,7 @@ mmix_const_double_ok_for_letter_p (value, c)
CONST_INT:s, but rather often as CONST_DOUBLE:s. */
int
-mmix_extra_constraint (x, c, strict)
- rtx x;
- int c;
- int strict;
+mmix_extra_constraint (rtx x, int c, int strict)
{
HOST_WIDEST_INT value;
@@ -455,8 +434,7 @@ mmix_extra_constraint (x, c, strict)
/* DYNAMIC_CHAIN_ADDRESS. */
rtx
-mmix_dynamic_chain_address (frame)
- rtx frame;
+mmix_dynamic_chain_address (rtx frame)
{
/* FIXME: the frame-pointer is stored at offset -8 from the current
frame-pointer. Unfortunately, the caller assumes that a
@@ -468,7 +446,7 @@ mmix_dynamic_chain_address (frame)
/* STARTING_FRAME_OFFSET. */
int
-mmix_starting_frame_offset ()
+mmix_starting_frame_offset (void)
{
/* The old frame pointer is in the slot below the new one, so
FIRST_PARM_OFFSET does not need to depend on whether the
@@ -485,9 +463,7 @@ mmix_starting_frame_offset ()
/* RETURN_ADDR_RTX. */
rtx
-mmix_return_addr_rtx (count, frame)
- int count;
- rtx frame ATTRIBUTE_UNUSED;
+mmix_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED)
{
return count == 0
? (MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS
@@ -503,7 +479,7 @@ mmix_return_addr_rtx (count, frame)
/* SETUP_FRAME_ADDRESSES. */
void
-mmix_setup_frame_addresses ()
+mmix_setup_frame_addresses (void)
{
/* Nothing needed at the moment. */
}
@@ -512,9 +488,7 @@ mmix_setup_frame_addresses ()
pointer. Used to eliminate the frame pointer. */
int
-mmix_initial_elimination_offset (fromreg, toreg)
- int fromreg;
- int toreg;
+mmix_initial_elimination_offset (int fromreg, int toreg)
{
int regno;
int fp_sp_offset
@@ -567,12 +541,11 @@ mmix_initial_elimination_offset (fromreg, toreg)
one that must go on stack. */
rtx
-mmix_function_arg (argsp, mode, type, named, incoming)
- const CUMULATIVE_ARGS * argsp;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
- int incoming;
+mmix_function_arg (const CUMULATIVE_ARGS *argsp,
+ enum machine_mode mode,
+ tree type,
+ int named ATTRIBUTE_UNUSED,
+ int incoming)
{
/* Last-argument marker. */
if (type == void_type_node)
@@ -600,11 +573,10 @@ mmix_function_arg (argsp, mode, type, named, incoming)
everything that goes by value. */
int
-mmix_function_arg_pass_by_reference (argsp, mode, type, named)
- const CUMULATIVE_ARGS * argsp;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+mmix_function_arg_pass_by_reference (const CUMULATIVE_ARGS *argsp,
+ enum machine_mode mode,
+ tree type,
+ int named ATTRIBUTE_UNUSED)
{
/* FIXME: Check: I'm not sure the MUST_PASS_IN_STACK check is
necessary. */
@@ -619,9 +591,7 @@ mmix_function_arg_pass_by_reference (argsp, mode, type, named)
passed, and 0 otherwise. */
int
-mmix_function_arg_regno_p (regno, incoming)
- int regno;
- int incoming;
+mmix_function_arg_regno_p (int regno, int incoming)
{
int first_arg_regnum
= incoming ? MMIX_FIRST_INCOMING_ARG_REGNUM : MMIX_FIRST_ARG_REGNUM;
@@ -633,9 +603,7 @@ mmix_function_arg_regno_p (regno, incoming)
/* FUNCTION_OUTGOING_VALUE. */
rtx
-mmix_function_outgoing_value (valtype, func)
- tree valtype;
- tree func ATTRIBUTE_UNUSED;
+mmix_function_outgoing_value (tree valtype, tree func ATTRIBUTE_UNUSED)
{
enum machine_mode mode = TYPE_MODE (valtype);
enum machine_mode cmode;
@@ -684,8 +652,7 @@ mmix_function_outgoing_value (valtype, func)
/* FUNCTION_VALUE_REGNO_P. */
int
-mmix_function_value_regno_p (regno)
- int regno;
+mmix_function_value_regno_p (int regno)
{
return regno == MMIX_RETURN_VALUE_REGNUM;
}
@@ -693,8 +660,7 @@ mmix_function_value_regno_p (regno)
/* EH_RETURN_DATA_REGNO. */
int
-mmix_eh_return_data_regno (n)
- int n ATTRIBUTE_UNUSED;
+mmix_eh_return_data_regno (int n)
{
if (n >= 0 && n < 4)
return MMIX_EH_RETURN_DATA_REGNO_START + n;
@@ -705,7 +671,7 @@ mmix_eh_return_data_regno (n)
/* EH_RETURN_STACKADJ_RTX. */
rtx
-mmix_eh_return_stackadj_rtx ()
+mmix_eh_return_stackadj_rtx (void)
{
return gen_rtx_REG (Pmode, MMIX_EH_RETURN_STACKADJ_REGNUM);
}
@@ -713,18 +679,16 @@ mmix_eh_return_stackadj_rtx ()
/* EH_RETURN_HANDLER_RTX. */
rtx
-mmix_eh_return_handler_rtx ()
+mmix_eh_return_handler_rtx (void)
{
- return
- gen_rtx_REG (Pmode, MMIX_INCOMING_RETURN_ADDRESS_REGNUM);
+ return gen_rtx_REG (Pmode, MMIX_INCOMING_RETURN_ADDRESS_REGNUM);
}
/* ASM_PREFERRED_EH_DATA_FORMAT. */
int
-mmix_asm_preferred_eh_data_format (code, global)
- int code ATTRIBUTE_UNUSED;
- int global ATTRIBUTE_UNUSED;
+mmix_asm_preferred_eh_data_format (int code ATTRIBUTE_UNUSED,
+ int global ATTRIBUTE_UNUSED)
{
/* This is the default (was at 2001-07-20). Revisit when needed. */
return DW_EH_PE_absptr;
@@ -735,9 +699,8 @@ mmix_asm_preferred_eh_data_format (code, global)
mmix_reorg. */
static void
-mmix_target_asm_function_prologue (stream, framesize)
- FILE *stream ATTRIBUTE_UNUSED;
- HOST_WIDE_INT framesize ATTRIBUTE_UNUSED;
+mmix_target_asm_function_prologue (FILE *stream ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT framesize ATTRIBUTE_UNUSED)
{
cfun->machine->in_prologue = 1;
}
@@ -745,8 +708,7 @@ mmix_target_asm_function_prologue (stream, framesize)
/* Make a note that we've seen the end of the prologue. */
static void
-mmix_target_asm_function_end_prologue (stream)
- FILE *stream ATTRIBUTE_UNUSED;
+mmix_target_asm_function_end_prologue (FILE *stream ATTRIBUTE_UNUSED)
{
cfun->machine->in_prologue = 0;
}
@@ -756,7 +718,7 @@ mmix_target_asm_function_end_prologue (stream)
register number used to modify the register numbers at output time. */
static void
-mmix_reorg ()
+mmix_reorg (void)
{
int regno;
@@ -796,10 +758,8 @@ mmix_reorg ()
/* TARGET_ASM_FUNCTION_EPILOGUE. */
static void
-mmix_target_asm_function_epilogue (stream, locals_size)
- FILE *stream;
- HOST_WIDE_INT locals_size ATTRIBUTE_UNUSED;
-
+mmix_target_asm_function_epilogue (FILE *stream,
+ HOST_WIDE_INT locals_size ATTRIBUTE_UNUSED)
{
/* Emit an \n for readability of the generated assembly. */
fputc ('\n', stream);
@@ -808,12 +768,11 @@ mmix_target_asm_function_epilogue (stream, locals_size)
/* TARGET_ASM_OUTPUT_MI_THUNK. */
static void
-mmix_asm_output_mi_thunk (stream, fndecl, delta, vcall_offset, func)
- FILE * stream;
- tree fndecl ATTRIBUTE_UNUSED;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED;
- tree func;
+mmix_asm_output_mi_thunk (FILE *stream,
+ tree fndecl ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta,
+ HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
+ tree func)
{
/* If you define STRUCT_VALUE to 0, rather than use STRUCT_VALUE_REGNUM,
(i.e. pass location of structure to return as invisible first
@@ -838,9 +797,8 @@ mmix_asm_output_mi_thunk (stream, fndecl, delta, vcall_offset, func)
/* FUNCTION_PROFILER. */
void
-mmix_function_profiler (stream, labelno)
- FILE *stream ATTRIBUTE_UNUSED;
- int labelno ATTRIBUTE_UNUSED;
+mmix_function_profiler (FILE *stream ATTRIBUTE_UNUSED,
+ int labelno ATTRIBUTE_UNUSED)
{
sorry ("function_profiler support for MMIX");
}
@@ -848,13 +806,11 @@ mmix_function_profiler (stream, labelno)
/* SETUP_INCOMING_VARARGS. */
void
-mmix_setup_incoming_varargs (args_so_farp, mode, vartype, pretend_sizep,
- second_time)
- CUMULATIVE_ARGS * args_so_farp;
- enum machine_mode mode;
- tree vartype;
- int * pretend_sizep;
- int second_time ATTRIBUTE_UNUSED;
+mmix_setup_incoming_varargs (CUMULATIVE_ARGS *args_so_farp,
+ enum machine_mode mode,
+ tree vartype,
+ int *pretend_sizep,
+ int second_time ATTRIBUTE_UNUSED)
{
/* The last named variable has been handled, but
args_so_farp has not been advanced for it. */
@@ -875,9 +831,7 @@ mmix_setup_incoming_varargs (args_so_farp, mode, vartype, pretend_sizep,
pass-by-reference, then perform an indirection. */
rtx
-mmix_expand_builtin_va_arg (valist, type)
- tree valist;
- tree type;
+mmix_expand_builtin_va_arg (tree valist, tree type)
{
tree ptr_size = size_int (BITS_PER_WORD / BITS_PER_UNIT);
tree addr_tree, type_size = NULL;
@@ -982,8 +936,7 @@ int mmix_trampoline_size = 32;
/* TRAMPOLINE_TEMPLATE. */
void
-mmix_trampoline_template (stream)
- FILE * stream;
+mmix_trampoline_template (FILE *stream)
{
/* Read a value into the static-chain register and jump somewhere. The
static chain is stored at offset 16, and the function address is
@@ -1005,10 +958,7 @@ mmix_trampoline_template (stream)
some day it will). */
void
-mmix_initialize_trampoline (trampaddr, fnaddr, static_chain)
- rtx trampaddr;
- rtx fnaddr;
- rtx static_chain;
+mmix_initialize_trampoline (rtx trampaddr, rtx fnaddr, rtx static_chain)
{
emit_move_insn (gen_rtx_MEM (DImode, plus_constant (trampaddr, 16)),
static_chain);
@@ -1025,8 +975,7 @@ mmix_initialize_trampoline (trampaddr, fnaddr, static_chain)
instruction, unless TARGET_BASE_ADDRESSES. */
int
-mmix_constant_address_p (x)
- rtx x;
+mmix_constant_address_p (rtx x)
{
RTX_CODE code = GET_CODE (x);
int addend = 0;
@@ -1089,10 +1038,9 @@ mmix_constant_address_p (x)
Used by GO_IF_LEGITIMATE_ADDRESS. */
int
-mmix_legitimate_address (mode, x, strict_checking)
- enum machine_mode mode ATTRIBUTE_UNUSED;
- rtx x;
- int strict_checking;
+mmix_legitimate_address (enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx x,
+ int strict_checking)
{
#define MMIX_REG_OK(X) \
((strict_checking \
@@ -1151,8 +1099,7 @@ mmix_legitimate_address (mode, x, strict_checking)
/* LEGITIMATE_CONSTANT_P. */
int
-mmix_legitimate_constant_p (x)
- rtx x;
+mmix_legitimate_constant_p (rtx x)
{
RTX_CODE code = GET_CODE (x);
@@ -1168,10 +1115,7 @@ mmix_legitimate_constant_p (x)
/* SELECT_CC_MODE. */
enum machine_mode
-mmix_select_cc_mode (op, x, y)
- RTX_CODE op;
- rtx x;
- rtx y ATTRIBUTE_UNUSED;
+mmix_select_cc_mode (RTX_CODE op, rtx x, rtx y ATTRIBUTE_UNUSED)
{
/* We use CCmode, CC_UNSmode, CC_FPmode, CC_FPEQmode and CC_FUNmode to
output different compare insns. Note that we do not check the
@@ -1198,8 +1142,7 @@ mmix_select_cc_mode (op, x, y)
/* REVERSIBLE_CC_MODE. */
int
-mmix_reversible_cc_mode (mode)
- enum machine_mode mode;
+mmix_reversible_cc_mode (enum machine_mode mode)
{
/* That is, all integer and the EQ, NE, ORDERED and UNORDERED float
compares. */
@@ -1209,11 +1152,10 @@ mmix_reversible_cc_mode (mode)
/* TARGET_RTX_COSTS. */
static bool
-mmix_rtx_costs (x, code, outer_code, total)
- rtx x ATTRIBUTE_UNUSED;
- int code ATTRIBUTE_UNUSED;
- int outer_code ATTRIBUTE_UNUSED;
- int *total ATTRIBUTE_UNUSED;
+mmix_rtx_costs (rtx x ATTRIBUTE_UNUSED,
+ int code ATTRIBUTE_UNUSED,
+ int outer_code ATTRIBUTE_UNUSED,
+ int *total ATTRIBUTE_UNUSED)
{
/* For the time being, this is just a stub and we'll accept the
generic calculations, until we can do measurements, at least.
@@ -1224,10 +1166,9 @@ mmix_rtx_costs (x, code, outer_code, total)
/* REGISTER_MOVE_COST. */
int
-mmix_register_move_cost (mode, from, to)
- enum machine_mode mode ATTRIBUTE_UNUSED;
- enum reg_class from;
- enum reg_class to;
+mmix_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+ enum reg_class from,
+ enum reg_class to)
{
return (from == GENERAL_REGS && from == to) ? 2 : 3;
}
@@ -1239,16 +1180,13 @@ mmix_register_move_cost (mode, from, to)
/* DATA_SECTION_ASM_OP. */
const char *
-mmix_data_section_asm_op ()
+mmix_data_section_asm_op (void)
{
return "\t.data ! mmixal:= 8H LOC 9B";
}
static void
-mmix_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+mmix_encode_section_info (tree decl, rtx rtl, int first)
{
/* Test for an external declaration, and do nothing if it is one. */
if ((TREE_CODE (decl) == VAR_DECL
@@ -1293,8 +1231,7 @@ mmix_encode_section_info (decl, rtl, first)
}
static const char *
-mmix_strip_name_encoding (name)
- const char *name;
+mmix_strip_name_encoding (const char *name)
{
for (; (*name == '@' || *name == '*'); name++)
;
@@ -1306,7 +1243,7 @@ mmix_strip_name_encoding (name)
We just emit a little comment for the time being. */
static void
-mmix_file_start ()
+mmix_file_start (void)
{
default_file_start ();
@@ -1319,7 +1256,7 @@ mmix_file_start ()
/* TARGET_ASM_FILE_END. */
static void
-mmix_file_end ()
+mmix_file_end (void)
{
/* Make sure each file ends with the data section. */
data_section ();
@@ -1328,9 +1265,7 @@ mmix_file_end ()
/* ASM_OUTPUT_SOURCE_FILENAME. */
void
-mmix_asm_output_source_filename (stream, name)
- FILE * stream;
- const char * name;
+mmix_asm_output_source_filename (FILE *stream, const char *name)
{
fprintf (stream, "# 1 ");
OUTPUT_QUOTED_STRING (stream, name);
@@ -1340,10 +1275,7 @@ mmix_asm_output_source_filename (stream, name)
/* OUTPUT_QUOTED_STRING. */
void
-mmix_output_quoted_string (stream, string, length)
- FILE * stream;
- const char * string;
- int length;
+mmix_output_quoted_string (FILE *stream, const char *string, int length)
{
const char * string_end = string + length;
static const char *const unwanted_chars = "\"[]\\";
@@ -1387,9 +1319,7 @@ mmix_output_quoted_string (stream, string, length)
/* ASM_OUTPUT_SOURCE_LINE. */
void
-mmix_asm_output_source_line (stream, lineno)
- FILE * stream;
- int lineno;
+mmix_asm_output_source_line (FILE *stream, int lineno)
{
fprintf (stream, "# %d ", lineno);
OUTPUT_QUOTED_STRING (stream, main_input_filename);
@@ -1401,10 +1331,7 @@ mmix_asm_output_source_line (stream, lineno)
CONST_DOUBLEs. */
static bool
-mmix_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+mmix_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if (aligned_p)
switch (size)
@@ -1465,10 +1392,7 @@ mmix_assemble_integer (x, size, aligned_p)
/* ASM_OUTPUT_ASCII. */
void
-mmix_asm_output_ascii (stream, string, length)
- FILE *stream;
- const char *string;
- int length;
+mmix_asm_output_ascii (FILE *stream, const char *string, int length)
{
while (length > 0)
{
@@ -1484,11 +1408,10 @@ mmix_asm_output_ascii (stream, string, length)
/* ASM_OUTPUT_ALIGNED_COMMON. */
void
-mmix_asm_output_aligned_common (stream, name, size, align)
- FILE *stream;
- const char *name;
- int size;
- int align;
+mmix_asm_output_aligned_common (FILE *stream,
+ const char *name,
+ int size,
+ int align)
{
/* This is mostly the elfos.h one. There doesn't seem to be a way to
express this in a mmixal-compatible way. */
@@ -1501,11 +1424,10 @@ mmix_asm_output_aligned_common (stream, name, size, align)
/* ASM_OUTPUT_ALIGNED_LOCAL. */
void
-mmix_asm_output_aligned_local (stream, name, size, align)
- FILE * stream;
- const char * name;
- int size;
- int align;
+mmix_asm_output_aligned_local (FILE *stream,
+ const char *name,
+ int size,
+ int align)
{
data_section ();
@@ -1517,9 +1439,7 @@ mmix_asm_output_aligned_local (stream, name, size, align)
/* ASM_OUTPUT_LABEL. */
void
-mmix_asm_output_label (stream, name)
- FILE *stream;
- const char * name;
+mmix_asm_output_label (FILE *stream, const char *name)
{
assemble_name (stream, name);
fprintf (stream, "\tIS @\n");
@@ -1528,11 +1448,10 @@ mmix_asm_output_label (stream, name)
/* ASM_DECLARE_REGISTER_GLOBAL. */
void
-mmix_asm_declare_register_global (stream, decl, regno, name)
- FILE *stream ATTRIBUTE_UNUSED;
- tree decl ATTRIBUTE_UNUSED;
- int regno ATTRIBUTE_UNUSED;
- const char *name ATTRIBUTE_UNUSED;
+mmix_asm_declare_register_global (FILE *stream ATTRIBUTE_UNUSED,
+ tree decl ATTRIBUTE_UNUSED,
+ int regno ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED)
{
/* Nothing to do here, but there *will* be, therefore the framework is
here. */
@@ -1541,9 +1460,8 @@ mmix_asm_declare_register_global (stream, decl, regno, name)
/* ASM_WEAKEN_LABEL. */
void
-mmix_asm_weaken_label (stream, name)
- FILE * stream ATTRIBUTE_UNUSED;
- const char * name ATTRIBUTE_UNUSED;
+mmix_asm_weaken_label (FILE *stream ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED)
{
fprintf (stream, "\t.weak ");
assemble_name (stream, name);
@@ -1553,8 +1471,7 @@ mmix_asm_weaken_label (stream, name)
/* MAKE_DECL_ONE_ONLY. */
void
-mmix_make_decl_one_only (decl)
- tree decl;
+mmix_make_decl_one_only (tree decl)
{
DECL_WEAK (decl) = 1;
}
@@ -1563,9 +1480,7 @@ mmix_make_decl_one_only (decl)
Strip GCC's '*' and our own '@'. No order is assumed. */
void
-mmix_asm_output_labelref (stream, name)
- FILE *stream;
- const char *name;
+mmix_asm_output_labelref (FILE *stream, const char *name)
{
int is_extern = 1;
@@ -1581,10 +1496,7 @@ mmix_asm_output_labelref (stream, name)
/* ASM_OUTPUT_DEF. */
void
-mmix_asm_output_def (stream, name, value)
- FILE * stream;
- const char * name;
- const char * value;
+mmix_asm_output_def (FILE *stream, const char *name, const char *value)
{
assemble_name (stream, name);
fprintf (stream, "\tIS ");
@@ -1595,10 +1507,7 @@ mmix_asm_output_def (stream, name, value)
/* PRINT_OPERAND. */
void
-mmix_print_operand (stream, x, code)
- FILE * stream;
- rtx x;
- int code;
+mmix_print_operand (FILE *stream, rtx x, int code)
{
/* When we add support for different codes later, we can, when needed,
drop through to the main handler with a modified operand. */
@@ -1825,8 +1734,7 @@ mmix_print_operand (stream, x, code)
/* PRINT_OPERAND_PUNCT_VALID_P. */
int
-mmix_print_operand_punct_valid_p (code)
- int code ATTRIBUTE_UNUSED;
+mmix_print_operand_punct_valid_p (int code ATTRIBUTE_UNUSED)
{
/* A '+' is used for branch prediction, similar to other ports. */
return code == '+'
@@ -1837,9 +1745,7 @@ mmix_print_operand_punct_valid_p (code)
/* PRINT_OPERAND_ADDRESS. */
void
-mmix_print_operand_address (stream, x)
- FILE *stream;
- rtx x;
+mmix_print_operand_address (FILE *stream, rtx x)
{
if (REG_P (x))
{
@@ -1884,9 +1790,7 @@ mmix_print_operand_address (stream, x)
/* ASM_OUTPUT_REG_PUSH. */
void
-mmix_asm_output_reg_push (stream, regno)
- FILE * stream;
- int regno;
+mmix_asm_output_reg_push (FILE *stream, int regno)
{
fprintf (stream, "\tSUBU %s,%s,8\n\tSTOU %s,%s,0\n",
reg_names[MMIX_STACK_POINTER_REGNUM],
@@ -1898,9 +1802,7 @@ mmix_asm_output_reg_push (stream, regno)
/* ASM_OUTPUT_REG_POP. */
void
-mmix_asm_output_reg_pop (stream, regno)
- FILE * stream;
- int regno;
+mmix_asm_output_reg_pop (FILE *stream, int regno)
{
fprintf (stream, "\tLDOU %s,%s,0\n\tINCL %s,8\n",
reg_names[MMIX_OUTPUT_REGNO (regno)],
@@ -1911,11 +1813,10 @@ mmix_asm_output_reg_pop (stream, regno)
/* ASM_OUTPUT_ADDR_DIFF_ELT. */
void
-mmix_asm_output_addr_diff_elt (stream, body, value, rel)
- FILE *stream;
- rtx body ATTRIBUTE_UNUSED;
- int value;
- int rel;
+mmix_asm_output_addr_diff_elt (FILE *stream,
+ rtx body ATTRIBUTE_UNUSED,
+ int value,
+ int rel)
{
fprintf (stream, "\tTETRA L%d-L%d\n", value, rel);
}
@@ -1923,9 +1824,7 @@ mmix_asm_output_addr_diff_elt (stream, body, value, rel)
/* ASM_OUTPUT_ADDR_VEC_ELT. */
void
-mmix_asm_output_addr_vec_elt (stream, value)
- FILE *stream;
- int value;
+mmix_asm_output_addr_vec_elt (FILE *stream, int value)
{
fprintf (stream, "\tOCTA L:%d\n", value);
}
@@ -1933,9 +1832,7 @@ mmix_asm_output_addr_vec_elt (stream, value)
/* ASM_OUTPUT_SKIP. */
void
-mmix_asm_output_skip (stream, nbytes)
- FILE *stream;
- int nbytes;
+mmix_asm_output_skip (FILE *stream, int nbytes)
{
fprintf (stream, "\tLOC @+%d\n", nbytes);
}
@@ -1943,9 +1840,7 @@ mmix_asm_output_skip (stream, nbytes)
/* ASM_OUTPUT_ALIGN. */
void
-mmix_asm_output_align (stream, power)
- FILE *stream;
- int power;
+mmix_asm_output_align (FILE *stream, int power)
{
/* We need to record the needed alignment of this section in the object,
so we have to output an alignment directive. Use a .p2align (not
@@ -1960,8 +1855,7 @@ mmix_asm_output_align (stream, power)
/* DBX_REGISTER_NUMBER. */
int
-mmix_dbx_register_number (regno)
- int regno;
+mmix_dbx_register_number (int regno)
{
/* Adjust the register number to the one it will be output as, dammit.
It'd be nice if we could check the assumption that we're filling a
@@ -1979,15 +1873,13 @@ mmix_dbx_register_number (regno)
/* End of target macro support functions.
- Now MMIX's own functions. First the exported ones. */
+ Now the MMIX port's own functions. First the exported ones. */
/* Wrapper for get_hard_reg_initial_val since integrate.h isn't included
from insn-emit.c. */
rtx
-mmix_get_hard_reg_initial_val (mode, regno)
- enum machine_mode mode;
- int regno;
+mmix_get_hard_reg_initial_val (enum machine_mode mode, int regno)
{
return get_hard_reg_initial_val (mode, regno);
}
@@ -1996,7 +1888,7 @@ mmix_get_hard_reg_initial_val (mode, regno)
"POP %d,0" should be used even within the function. */
int
-mmix_use_simple_return ()
+mmix_use_simple_return (void)
{
int regno;
@@ -2033,7 +1925,7 @@ mmix_use_simple_return ()
/* Expands the function prologue into RTX. */
void
-mmix_expand_prologue ()
+mmix_expand_prologue (void)
{
HOST_WIDE_INT locals_size = get_frame_size ();
int regno;
@@ -2268,7 +2160,7 @@ mmix_expand_prologue ()
/* Expands the function epilogue into RTX. */
void
-mmix_expand_epilogue ()
+mmix_expand_epilogue (void)
{
HOST_WIDE_INT locals_size = get_frame_size ();
int regno;
@@ -2391,11 +2283,10 @@ mmix_expand_epilogue ()
first insn and after the last insn is wanted. */
void
-mmix_output_register_setting (stream, regno, value, do_begin_end)
- FILE *stream;
- int regno;
- HOST_WIDEST_INT value;
- int do_begin_end;
+mmix_output_register_setting (FILE *stream,
+ int regno,
+ HOST_WIDEST_INT value,
+ int do_begin_end)
{
if (do_begin_end)
fprintf (stream, "\t");
@@ -2503,8 +2394,7 @@ mmix_output_register_setting (stream, regno, value, do_begin_end)
else return 0. */
int
-mmix_shiftable_wyde_value (value)
- unsigned HOST_WIDEST_INT value;
+mmix_shiftable_wyde_value (unsigned HOST_WIDEST_INT value)
{
/* Shift by 16 bits per group, stop when we've found two groups with
nonzero bits. */
@@ -2530,9 +2420,7 @@ mmix_shiftable_wyde_value (value)
/* True if this is an address_operand or a symbolic operand. */
int
-mmix_symbolic_or_address_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+mmix_symbolic_or_address_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -2558,9 +2446,7 @@ mmix_symbolic_or_address_operand (op, mode)
doesn't seem to be worth it at the moment. */
int
-mmix_reg_or_constant_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+mmix_reg_or_constant_operand (rtx op, enum machine_mode mode)
{
return register_operand (op, mode)
|| (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) == VOIDmode)
@@ -2570,9 +2456,7 @@ mmix_reg_or_constant_operand (op, mode)
/* True if this is a register with a condition-code mode. */
int
-mmix_reg_cc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+mmix_reg_cc_operand (rtx op, enum machine_mode mode)
{
if (mode == VOIDmode)
mode = GET_MODE (op);
@@ -2587,9 +2471,7 @@ mmix_reg_cc_operand (op, mode)
replaced by (reg). */
int
-mmix_foldable_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+mmix_foldable_comparison_operator (rtx op, enum machine_mode mode)
{
RTX_CODE code = GET_CODE (op);
@@ -2614,9 +2496,7 @@ mmix_foldable_comparison_operator (op, mode)
code with -ffast-math (gcc.dg/20001228-1.c). */
int
-mmix_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+mmix_comparison_operator (rtx op, enum machine_mode mode)
{
RTX_CODE code = GET_CODE (op);
@@ -2652,9 +2532,7 @@ mmix_comparison_operator (op, mode)
/* True if this is a register or 0 (int or float). */
int
-mmix_reg_or_0_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+mmix_reg_or_0_operand (rtx op, enum machine_mode mode)
{
/* FIXME: Is mode calculation necessary and correct? */
return
@@ -2665,9 +2543,7 @@ mmix_reg_or_0_operand (op, mode)
/* True if this is a register or an int 0..255. */
int
-mmix_reg_or_8bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+mmix_reg_or_8bit_operand (rtx op, enum machine_mode mode)
{
return register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
@@ -2679,10 +2555,7 @@ mmix_reg_or_8bit_operand (op, mode)
is the comparison of mode is CC-somethingmode. */
int
-mmix_valid_comparison (code, mode, op)
- RTX_CODE code;
- enum machine_mode mode;
- rtx op;
+mmix_valid_comparison (RTX_CODE code, enum machine_mode mode, rtx op)
{
if (mode == VOIDmode && op != NULL_RTX)
mode = GET_MODE (op);
@@ -2711,9 +2584,7 @@ mmix_valid_comparison (code, mode, op)
NULL_RTX if this is not a valid comparison. */
rtx
-mmix_gen_compare_reg (code, x, y)
- RTX_CODE code;
- rtx x, y;
+mmix_gen_compare_reg (RTX_CODE code, rtx x, rtx y)
{
enum machine_mode ccmode = SELECT_CC_MODE (code, x, y);
rtx cc_reg;
@@ -2748,8 +2619,7 @@ mmix_gen_compare_reg (code, x, y)
/* Local (static) helper functions. */
static void
-mmix_emit_sp_add (offset)
- HOST_WIDE_INT offset;
+mmix_emit_sp_add (HOST_WIDE_INT offset)
{
rtx insn;
@@ -2793,10 +2663,9 @@ mmix_emit_sp_add (offset)
wyde. The type of operator is passed as an asm output modifier. */
static void
-mmix_output_shiftvalue_op_from_str (stream, mainop, value)
- FILE *stream;
- const char *mainop;
- HOST_WIDEST_INT value;
+mmix_output_shiftvalue_op_from_str (FILE *stream,
+ const char *mainop,
+ HOST_WIDEST_INT value)
{
static const char *const op_part[] = {"L", "ML", "MH", "H"};
int i;
@@ -2827,10 +2696,7 @@ mmix_output_shiftvalue_op_from_str (stream, mainop, value)
/* Print a 64-bit value, optionally prefixed by assembly pseudo. */
static void
-mmix_output_octa (stream, value, do_begin_end)
- FILE *stream;
- HOST_WIDEST_INT value;
- int do_begin_end;
+mmix_output_octa (FILE *stream, HOST_WIDEST_INT value, int do_begin_end)
{
/* Snipped from final.c:output_addr_const. We need to avoid the
presumed universal "0x" prefix. We can do it by replacing "0x" with
@@ -2864,9 +2730,7 @@ mmix_output_octa (stream, value, do_begin_end)
be output with an operand). */
static void
-mmix_output_shifted_value (stream, value)
- FILE * stream;
- HOST_WIDEST_INT value;
+mmix_output_shifted_value (FILE *stream, HOST_WIDEST_INT value)
{
int i;
@@ -2878,13 +2742,13 @@ mmix_output_shifted_value (stream, value)
}
for (i = 0; i < 4; i++)
- {
- /* We know we're through when we find one-bits in the low 16 bits. */
- if (value & 0xffff)
{
- fprintf (stream, "#%x", (int) (value & 0xffff));
- return;
- }
+ /* We know we're through when we find one-bits in the low 16 bits. */
+ if (value & 0xffff)
+ {
+ fprintf (stream, "#%x", (int) (value & 0xffff));
+ return;
+ }
value >>= 16;
}
@@ -2902,10 +2766,7 @@ mmix_output_shifted_value (stream, value)
same as swapping the arguments). */
static void
-mmix_output_condition (stream, x, reversed)
- FILE *stream;
- rtx x;
- int reversed;
+mmix_output_condition (FILE *stream, rtx x, int reversed)
{
struct cc_conv
{
@@ -3010,8 +2871,7 @@ mmix_output_condition (stream, x, reversed)
/* Return the bit-value for a const_int or const_double. */
static HOST_WIDEST_INT
-mmix_intval (x)
- rtx x;
+mmix_intval (rtx x)
{
unsigned HOST_WIDEST_INT retval;
diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h
new file mode 100644
index 00000000000..1ae5b013110
--- /dev/null
+++ b/gcc/config/mn10300/linux.h
@@ -0,0 +1,116 @@
+/* Definitions of taret machine for GNU compiler.
+ Matsushita AM33/2.0
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#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)
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{mam33:-D__AM33__} %{!mam33:-D__AM33__=2 -D__AM33_2__} \
+ %{posix:-D_POSIX_SOURCE} \
+ %{pthread:-D_REENTRANT -D_PTHREADS}"
+
+#undef ASM_SPEC
+#define ASM_SPEC "%{Wa,*:%*}"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}"
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ "%{shared: -lc} \
+ %{!static:-rpath-link %R/lib:%R/usr/lib} \
+ %{!shared: %{pthread:-lpthread} \
+ %{profile:-lc_p} %{!profile: -lc}}"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} \
+ %{!profile:crt1.o%s}}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+#undef TARGET_SWITCHES
+#define TARGET_SWITCHES \
+ {{ "am33", -0x4, N_("Target the AM33 processor") }, \
+ { "am33-2", 6, N_("Target the AM33/2.0 processor") }, \
+ { "relax", 0, N_("Enable linker relaxations") }, \
+ { "", TARGET_DEFAULT, NULL }}
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT 6
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (AM33/2.0 GNU/Linux)");
+
+#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
+
+extern int mn10300_protect_label;
+
+#undef PRINT_OPERAND
+#define PRINT_OPERAND(FILE, X, CODE) \
+ do \
+ { \
+ mn10300_protect_label = 1; \
+ print_operand ((FILE), (X), (CODE)); \
+ mn10300_protect_label = 0; \
+ } \
+ while (0)
+
+#undef PRINT_OPERAND_ADDRESS
+#define PRINT_OPERAND_ADDRESS(FILE, X) \
+ do \
+ { \
+ mn10300_protect_label = 1; \
+ print_operand_address ((FILE), (X)); \
+ mn10300_protect_label = 0; \
+ } \
+ while (0)
+
+#undef ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ do \
+ { \
+ const char * real_name; \
+ \
+ real_name = (*targetm.strip_name_encoding) (NAME); \
+ if (mn10300_protect_label) \
+ asm_fprintf (FILE, "+"); \
+ asm_fprintf (FILE, "%U%s", real_name); \
+ } \
+ while (0)
+
diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h
index 209a7e6c891..74154d92494 100644
--- a/gcc/config/mn10300/mn10300-protos.h
+++ b/gcc/config/mn10300/mn10300-protos.h
@@ -26,6 +26,8 @@ extern void mn10300_va_start PARAMS ((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 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));
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index df5d35fb770..3e14de37643 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -44,6 +44,16 @@ Boston, MA 02111-1307, USA. */
#include "target.h"
#include "target-def.h"
+/* This is used by GOTaddr2picreg to uniquely identify
+ UNSPEC_INT_LABELs. */
+int mn10300_unspec_int_label_counter;
+
+/* This is used in the am33_2.0-linux-gnu port, in which global symbol
+ names are not prefixed by underscores, to tell whether to prefix a
+ label with a plus sign or not, so that the assembler can tell
+ symbol names from register names. */
+int mn10300_protect_label;
+
/* The size of the callee register save area. Right now we save everything
on entry since it costs us nothing in code size. It does cost us from a
speed standpoint, so we want to optimize this sooner or later. */
@@ -75,6 +85,10 @@ static void mn10300_file_start PARAMS ((void));
#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO mn10300_encode_section_info
+
+static void mn10300_encode_section_info (tree, rtx, int);
struct gcc_target targetm = TARGET_INITIALIZER;
static void
@@ -82,7 +96,9 @@ mn10300_file_start ()
{
default_file_start ();
- if (TARGET_AM33)
+ if (TARGET_AM33_2)
+ fprintf (asm_out_file, "\t.am33_2\n");
+ else if (TARGET_AM33)
fprintf (asm_out_file, "\t.am33\n");
}
@@ -100,6 +116,58 @@ print_operand (file, x, code)
{
case 'b':
case 'B':
+ if (cc_status.mdep.fpCC)
+ {
+ switch (code == 'b' ? GET_CODE (x)
+ : reverse_condition_maybe_unordered (GET_CODE (x)))
+ {
+ case NE:
+ fprintf (file, "ne");
+ break;
+ case EQ:
+ fprintf (file, "eq");
+ break;
+ case GE:
+ fprintf (file, "ge");
+ break;
+ case GT:
+ fprintf (file, "gt");
+ break;
+ case LE:
+ fprintf (file, "le");
+ break;
+ case LT:
+ fprintf (file, "lt");
+ break;
+ case ORDERED:
+ fprintf (file, "lge");
+ break;
+ case UNORDERED:
+ fprintf (file, "uo");
+ break;
+ case LTGT:
+ fprintf (file, "lg");
+ break;
+ case UNEQ:
+ fprintf (file, "ue");
+ break;
+ case UNGE:
+ fprintf (file, "uge");
+ break;
+ case UNGT:
+ fprintf (file, "ug");
+ break;
+ case UNLE:
+ fprintf (file, "ule");
+ break;
+ case UNLT:
+ fprintf (file, "ul");
+ break;
+ default:
+ abort ();
+ }
+ break;
+ }
/* These are normal and reversed branches. */
switch (code == 'b' ? GET_CODE (x) : reverse_condition (GET_CODE (x)))
{
@@ -151,6 +219,24 @@ print_operand (file, x, code)
print_operand (file, x, 0);
break;
+ case 'D':
+ switch (GET_CODE (x))
+ {
+ case MEM:
+ fputc ('(', file);
+ output_address (XEXP (x, 0));
+ fputc (')', file);
+ break;
+
+ case REG:
+ fprintf (file, "fd%d", REGNO (x) - 18);
+ break;
+
+ default:
+ abort ();
+ }
+ break;
+
/* These are the least significant word in a 64bit value. */
case 'L':
switch (GET_CODE (x))
@@ -338,6 +424,7 @@ print_operand (file, x, code)
case CONST:
case LABEL_REF:
case CODE_LABEL:
+ case UNSPEC:
print_operand_address (file, x);
break;
default:
@@ -388,6 +475,22 @@ print_operand_address (file, addr)
}
}
+/* Count the number of FP registers that have to be saved. */
+static int
+fp_regs_to_save ()
+{
+ int i, n = 0;
+
+ if (! TARGET_AM33_2)
+ return 0;
+
+ for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
+ if (regs_ever_live[i] && ! call_used_regs[i])
+ ++n;
+
+ return n;
+}
+
/* Print a set of registers in the format required by "movm" and "ret".
Register K is saved if bit K of MASK is set. The data and address
registers can be stored individually, but the extended registers cannot.
@@ -446,6 +549,7 @@ can_use_return_insn ()
&& !regs_ever_live[15]
&& !regs_ever_live[16]
&& !regs_ever_live[17]
+ && fp_regs_to_save () == 0
&& !frame_pointer_needed);
}
@@ -460,7 +564,7 @@ mn10300_get_live_callee_saved_regs ()
int i;
mask = 0;
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ for (i = 0; i <= LAST_EXTENDED_REGNUM; i++)
if (regs_ever_live[i] && ! call_used_regs[i])
mask |= (1 << i);
if ((mask & 0x3c000) != 0)
@@ -501,7 +605,7 @@ mn10300_gen_multiple_store (mask)
/* Count how many registers need to be saved. */
count = 0;
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ for (i = 0; i <= LAST_EXTENDED_REGNUM; i++)
if ((mask & (1 << i)) != 0)
count += 1;
@@ -519,7 +623,7 @@ mn10300_gen_multiple_store (mask)
/* Create each store. */
pari = 1;
- for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
+ for (i = LAST_EXTENDED_REGNUM; i >= 0; i--)
if ((mask & (1 << i)) != 0)
{
rtx address = gen_rtx_PLUS (SImode,
@@ -549,6 +653,240 @@ expand_prologue ()
/* If we use any of the callee-saved registers, save them now. */
mn10300_gen_multiple_store (mn10300_get_live_callee_saved_regs ());
+ if (TARGET_AM33_2 && fp_regs_to_save ())
+ {
+ int num_regs_to_save = fp_regs_to_save (), i;
+ HOST_WIDE_INT xsize;
+ enum { save_sp_merge,
+ save_sp_no_merge,
+ save_sp_partial_merge,
+ save_a0_merge,
+ save_a0_no_merge } strategy;
+ unsigned int strategy_size = (unsigned)-1, this_strategy_size;
+ rtx reg;
+ rtx insn;
+
+ /* We have several different strategies to save FP registers.
+ We can store them using SP offsets, which is beneficial if
+ there are just a few registers to save, or we can use `a0' in
+ post-increment mode (`a0' is the only call-clobbered address
+ register that is never used to pass information to a
+ function). Furthermore, if we don't need a frame pointer, we
+ can merge the two SP adds into a single one, but this isn't
+ always beneficial; sometimes we can just split the two adds
+ so that we don't exceed a 16-bit constant size. The code
+ below will select which strategy to use, so as to generate
+ smallest code. Ties are broken in favor or shorter sequences
+ (in terms of number of instructions). */
+
+#define SIZE_ADD_AX(S) ((((S) >= (1 << 15)) || ((S) < -(1 << 15))) ? 6 \
+ : (((S) >= (1 << 7)) || ((S) < -(1 << 7))) ? 4 : 2)
+#define SIZE_ADD_SP(S) ((((S) >= (1 << 15)) || ((S) < -(1 << 15))) ? 6 \
+ : (((S) >= (1 << 7)) || ((S) < -(1 << 7))) ? 4 : 3)
+#define SIZE_FMOV_LIMIT(S,N,L,SIZE1,SIZE2,ELSE) \
+ (((S) >= (L)) ? (SIZE1) * (N) \
+ : ((S) + 4 * (N) >= (L)) ? (((L) - (S)) / 4 * (SIZE2) \
+ + ((S) + 4 * (N) - (L)) / 4 * (SIZE1)) \
+ : (ELSE))
+#define SIZE_FMOV_SP_(S,N) \
+ (SIZE_FMOV_LIMIT ((S), (N), (1 << 24), 7, 6, \
+ SIZE_FMOV_LIMIT ((S), (N), (1 << 8), 6, 4, \
+ (S) ? 4 * (N) : 3 + 4 * ((N) - 1))))
+#define SIZE_FMOV_SP(S,N) (SIZE_FMOV_SP_ ((unsigned HOST_WIDE_INT)(S), (N)))
+
+ /* Consider alternative save_sp_merge only if we don't need the
+ frame pointer and size is nonzero. */
+ if (! frame_pointer_needed && size)
+ {
+ /* Insn: add -(size + 4 * num_regs_to_save), sp. */
+ this_strategy_size = SIZE_ADD_SP (-(size + 4 * num_regs_to_save));
+ /* Insn: fmov fs#, (##, sp), for each fs# to be saved. */
+ this_strategy_size += SIZE_FMOV_SP (size, num_regs_to_save);
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = save_sp_merge;
+ strategy_size = this_strategy_size;
+ }
+ }
+
+ /* Consider alternative save_sp_no_merge unconditionally. */
+ /* Insn: add -4 * num_regs_to_save, sp. */
+ this_strategy_size = SIZE_ADD_SP (-4 * num_regs_to_save);
+ /* Insn: fmov fs#, (##, sp), for each fs# to be saved. */
+ this_strategy_size += SIZE_FMOV_SP (0, num_regs_to_save);
+ if (size)
+ {
+ /* Insn: add -size, sp. */
+ this_strategy_size += SIZE_ADD_SP (-size);
+ }
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = save_sp_no_merge;
+ strategy_size = this_strategy_size;
+ }
+
+ /* Consider alternative save_sp_partial_merge only if we don't
+ need a frame pointer and size is reasonably large. */
+ if (! frame_pointer_needed && size + 4 * num_regs_to_save > 128)
+ {
+ /* Insn: add -128, sp. */
+ this_strategy_size = SIZE_ADD_SP (-128);
+ /* Insn: fmov fs#, (##, sp), for each fs# to be saved. */
+ this_strategy_size += SIZE_FMOV_SP (128 - 4 * num_regs_to_save,
+ num_regs_to_save);
+ if (size)
+ {
+ /* Insn: add 128-size, sp. */
+ this_strategy_size += SIZE_ADD_SP (128 - size);
+ }
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = save_sp_partial_merge;
+ strategy_size = this_strategy_size;
+ }
+ }
+
+ /* Consider alternative save_a0_merge only if we don't need a
+ frame pointer, size is nonzero and the user hasn't
+ changed the calling conventions of a0. */
+ if (! frame_pointer_needed && size
+ && call_used_regs[FIRST_ADDRESS_REGNUM]
+ && ! fixed_regs[FIRST_ADDRESS_REGNUM])
+ {
+ /* Insn: add -(size + 4 * num_regs_to_save), sp. */
+ this_strategy_size = SIZE_ADD_SP (-(size + 4 * num_regs_to_save));
+ /* Insn: mov sp, a0. */
+ this_strategy_size++;
+ if (size)
+ {
+ /* Insn: add size, a0. */
+ this_strategy_size += SIZE_ADD_AX (size);
+ }
+ /* Insn: fmov fs#, (a0+), for each fs# to be saved. */
+ this_strategy_size += 3 * num_regs_to_save;
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = save_a0_merge;
+ strategy_size = this_strategy_size;
+ }
+ }
+
+ /* Consider alternative save_a0_no_merge if the user hasn't
+ changed the calling conventions of a0. */
+ if (call_used_regs[FIRST_ADDRESS_REGNUM]
+ && ! fixed_regs[FIRST_ADDRESS_REGNUM])
+ {
+ /* Insn: add -4 * num_regs_to_save, sp. */
+ this_strategy_size = SIZE_ADD_SP (-4 * num_regs_to_save);
+ /* Insn: mov sp, a0. */
+ this_strategy_size++;
+ /* Insn: fmov fs#, (a0+), for each fs# to be saved. */
+ this_strategy_size += 3 * num_regs_to_save;
+ if (size)
+ {
+ /* Insn: add -size, sp. */
+ this_strategy_size += SIZE_ADD_SP (-size);
+ }
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = save_a0_no_merge;
+ strategy_size = this_strategy_size;
+ }
+ }
+
+ /* Emit the initial SP add, common to all strategies. */
+ switch (strategy)
+ {
+ case save_sp_no_merge:
+ case save_a0_no_merge:
+ emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-4 * num_regs_to_save)));
+ xsize = 0;
+ break;
+
+ case save_sp_partial_merge:
+ emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-128)));
+ xsize = 128 - 4 * num_regs_to_save;
+ size -= xsize;
+ break;
+
+ case save_sp_merge:
+ case save_a0_merge:
+ emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-(size + 4 * num_regs_to_save))));
+ /* We'll have to adjust FP register saves according to the
+ frame size. */
+ xsize = size;
+ /* Since we've already created the stack frame, don't do it
+ again at the end of the function. */
+ size = 0;
+ break;
+
+ default:
+ abort ();
+ }
+
+ /* Now prepare register a0, if we have decided to use it. */
+ switch (strategy)
+ {
+ case save_sp_merge:
+ case save_sp_no_merge:
+ case save_sp_partial_merge:
+ reg = 0;
+ break;
+
+ case save_a0_merge:
+ case save_a0_no_merge:
+ reg = gen_rtx_REG (SImode, FIRST_ADDRESS_REGNUM);
+ emit_insn (gen_movsi (reg, stack_pointer_rtx));
+ if (xsize)
+ emit_insn (gen_addsi3 (reg, reg, GEN_INT (xsize)));
+ reg = gen_rtx_POST_INC (SImode, reg);
+ break;
+
+ default:
+ abort ();
+ }
+
+ /* Now actually save the FP registers. */
+ for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
+ if (regs_ever_live[i] && ! call_used_regs[i])
+ {
+ rtx addr;
+
+ if (reg)
+ addr = reg;
+ else
+ {
+ /* If we aren't using `a0', use an SP offset. */
+ if (xsize)
+ {
+ addr = gen_rtx_PLUS (SImode,
+ stack_pointer_rtx,
+ GEN_INT (xsize));
+ }
+ else
+ addr = stack_pointer_rtx;
+
+ xsize += 4;
+ }
+
+ insn = emit_insn (gen_movsi (gen_rtx_MEM (SImode, addr),
+ gen_rtx_REG (SImode, i)));
+
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+ }
+
/* Now put the frame pointer into the frame pointer register. */
if (frame_pointer_needed)
emit_move_insn (frame_pointer_rtx, stack_pointer_rtx);
@@ -558,6 +896,24 @@ expand_prologue ()
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
GEN_INT (-size)));
+ if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
+ {
+ rtx insn = get_last_insn ();
+ rtx last = emit_insn (gen_GOTaddr2picreg ());
+
+ /* Mark these insns as possibly dead. Sometimes, flow2 may
+ delete all uses of the PIC register. In this case, let it
+ delete the initialization too. */
+ do
+ {
+ insn = NEXT_INSN (insn);
+
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD,
+ const0_rtx,
+ REG_NOTES (insn));
+ }
+ while (insn != last);
+ }
}
void
@@ -569,6 +925,193 @@ expand_epilogue ()
size = get_frame_size () + current_function_outgoing_args_size;
size += (current_function_outgoing_args_size ? 4 : 0);
+ if (TARGET_AM33_2 && fp_regs_to_save ())
+ {
+ int num_regs_to_save = fp_regs_to_save (), i;
+ rtx reg = 0;
+
+ /* We have several options to restore FP registers. We could
+ load them from SP offsets, but, if there are enough FP
+ registers to restore, we win if we use a post-increment
+ addressing mode. */
+
+ /* If we have a frame pointer, it's the best option, because we
+ already know it has the value we want. */
+ if (frame_pointer_needed)
+ reg = gen_rtx_REG (SImode, FRAME_POINTER_REGNUM);
+ /* Otherwise, we may use `a1', since it's call-clobbered and
+ it's never used for return values. But only do so if it's
+ smaller than using SP offsets. */
+ else
+ {
+ enum { restore_sp_post_adjust,
+ restore_sp_pre_adjust,
+ restore_sp_partial_adjust,
+ restore_a1 } strategy;
+ unsigned int this_strategy_size, strategy_size = (unsigned)-1;
+
+ /* Consider using sp offsets before adjusting sp. */
+ /* Insn: fmov (##,sp),fs#, for each fs# to be restored. */
+ this_strategy_size = SIZE_FMOV_SP (size, num_regs_to_save);
+ /* If size is too large, we'll have to adjust SP with an
+ add. */
+ if (size + 4 * num_regs_to_save + REG_SAVE_BYTES > 255)
+ {
+ /* Insn: add size + 4 * num_regs_to_save, sp. */
+ this_strategy_size += SIZE_ADD_SP (size + 4 * num_regs_to_save);
+ }
+ /* If we don't have to restore any non-FP registers,
+ we'll be able to save one byte by using rets. */
+ if (! REG_SAVE_BYTES)
+ this_strategy_size--;
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = restore_sp_post_adjust;
+ strategy_size = this_strategy_size;
+ }
+
+ /* Consider using sp offsets after adjusting sp. */
+ /* Insn: add size, sp. */
+ this_strategy_size = SIZE_ADD_SP (size);
+ /* Insn: fmov (##,sp),fs#, for each fs# to be restored. */
+ this_strategy_size += SIZE_FMOV_SP (0, num_regs_to_save);
+ /* We're going to use ret to release the FP registers
+ save area, so, no savings. */
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = restore_sp_pre_adjust;
+ strategy_size = this_strategy_size;
+ }
+
+ /* Consider using sp offsets after partially adjusting sp.
+ When size is close to 32Kb, we may be able to adjust SP
+ with an imm16 add instruction while still using fmov
+ (d8,sp). */
+ if (size + 4 * num_regs_to_save + REG_SAVE_BYTES > 255)
+ {
+ /* Insn: add size + 4 * num_regs_to_save
+ + REG_SAVE_BYTES - 252,sp. */
+ this_strategy_size = SIZE_ADD_SP (size + 4 * num_regs_to_save
+ + REG_SAVE_BYTES - 252);
+ /* Insn: fmov (##,sp),fs#, fo each fs# to be restored. */
+ this_strategy_size += SIZE_FMOV_SP (252 - REG_SAVE_BYTES
+ - 4 * num_regs_to_save,
+ num_regs_to_save);
+ /* We're going to use ret to release the FP registers
+ save area, so, no savings. */
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = restore_sp_partial_adjust;
+ strategy_size = this_strategy_size;
+ }
+ }
+
+ /* Consider using a1 in post-increment mode, as long as the
+ user hasn't changed the calling conventions of a1. */
+ if (call_used_regs[FIRST_ADDRESS_REGNUM+1]
+ && ! fixed_regs[FIRST_ADDRESS_REGNUM+1])
+ {
+ /* Insn: mov sp,a1. */
+ this_strategy_size = 1;
+ if (size)
+ {
+ /* Insn: add size,a1. */
+ this_strategy_size += SIZE_ADD_AX (size);
+ }
+ /* Insn: fmov (a1+),fs#, for each fs# to be restored. */
+ this_strategy_size += 3 * num_regs_to_save;
+ /* If size is large enough, we may be able to save a
+ couple of bytes. */
+ if (size + 4 * num_regs_to_save + REG_SAVE_BYTES > 255)
+ {
+ /* Insn: mov a1,sp. */
+ this_strategy_size += 2;
+ }
+ /* If we don't have to restore any non-FP registers,
+ we'll be able to save one byte by using rets. */
+ if (! REG_SAVE_BYTES)
+ this_strategy_size--;
+
+ if (this_strategy_size < strategy_size)
+ {
+ strategy = restore_a1;
+ strategy_size = this_strategy_size;
+ }
+ }
+
+ switch (strategy)
+ {
+ case restore_sp_post_adjust:
+ break;
+
+ case restore_sp_pre_adjust:
+ emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (size)));
+ size = 0;
+ break;
+
+ case restore_sp_partial_adjust:
+ emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (size + 4 * num_regs_to_save
+ + REG_SAVE_BYTES - 252)));
+ size = 252 - REG_SAVE_BYTES - 4 * num_regs_to_save;
+ break;
+
+ case restore_a1:
+ reg = gen_rtx_REG (SImode, FIRST_ADDRESS_REGNUM + 1);
+ emit_insn (gen_movsi (reg, stack_pointer_rtx));
+ if (size)
+ emit_insn (gen_addsi3 (reg, reg, GEN_INT (size)));
+ break;
+
+ default:
+ abort ();
+ }
+ }
+
+ /* Adjust the selected register, if any, for post-increment. */
+ if (reg)
+ reg = gen_rtx_POST_INC (SImode, reg);
+
+ for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
+ if (regs_ever_live[i] && ! call_used_regs[i])
+ {
+ rtx addr;
+
+ if (reg)
+ addr = reg;
+ else if (size)
+ {
+ /* If we aren't using a post-increment register, use an
+ SP offset. */
+ addr = gen_rtx_PLUS (SImode,
+ stack_pointer_rtx,
+ GEN_INT (size));
+ }
+ else
+ addr = stack_pointer_rtx;
+
+ size += 4;
+
+ emit_insn (gen_movsi (gen_rtx_REG (SImode, i),
+ gen_rtx_MEM (SImode, addr)));
+ }
+
+ /* If we were using the restore_a1 strategy and the number of
+ bytes to be released won't fit in the `ret' byte, copy `a1'
+ to `sp', to avoid having to use `add' to adjust it. */
+ if (! frame_pointer_needed && reg && size + REG_SAVE_BYTES > 255)
+ {
+ emit_move_insn (stack_pointer_rtx, XEXP (reg, 0));
+ size = 0;
+ }
+ }
+
/* Maybe cut back the stack, except for the register save area.
If the frame pointer exists, then use the frame pointer to
@@ -649,6 +1192,9 @@ notice_update_cc (body, insn)
/* The insn is a compare instruction. */
CC_STATUS_INIT;
cc_status.value1 = SET_SRC (body);
+ if (GET_CODE (cc_status.value1) == COMPARE
+ && GET_MODE (XEXP (cc_status.value1, 0)) == SFmode)
+ cc_status.mdep.fpCC = 1;
break;
case CC_INVERT:
@@ -714,7 +1260,7 @@ store_multiple_operation (op, mode)
LAST keeps track of the smallest-numbered register stored so far.
MASK is the set of stored registers. */
- last = FIRST_PSEUDO_REGISTER;
+ last = LAST_EXTENDED_REGNUM + 1;
mask = 0;
for (i = 1; i < count; i++)
{
@@ -756,6 +1302,9 @@ call_address_operand (op, mode)
rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
+ if (flag_pic)
+ return (EXTRA_CONSTRAINT (op, 'S') || GET_CODE (op) == REG);
+
return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG);
}
@@ -810,6 +1359,14 @@ secondary_reload_class (class, mode, in)
return DATA_REGS;
}
+ if (TARGET_AM33_2 && class == FP_REGS
+ && GET_CODE (in) == MEM && ! OK_FOR_Q (in))
+ {
+ if (TARGET_AM33)
+ return DATA_OR_EXTENDED_REGS;
+ return DATA_REGS;
+ }
+
/* Otherwise assume no secondary reloads are needed. */
return NO_REGS;
}
@@ -826,8 +1383,10 @@ initial_offset (from, to)
|| regs_ever_live[6] || regs_ever_live[7]
|| regs_ever_live[14] || regs_ever_live[15]
|| regs_ever_live[16] || regs_ever_live[17]
+ || fp_regs_to_save ()
|| frame_pointer_needed)
- return REG_SAVE_BYTES;
+ return REG_SAVE_BYTES
+ + 4 * fp_regs_to_save ();
else
return 0;
}
@@ -841,8 +1400,10 @@ initial_offset (from, to)
|| regs_ever_live[6] || regs_ever_live[7]
|| regs_ever_live[14] || regs_ever_live[15]
|| regs_ever_live[16] || regs_ever_live[17]
+ || fp_regs_to_save ()
|| frame_pointer_needed)
return (get_frame_size () + REG_SAVE_BYTES
+ + 4 * fp_regs_to_save ()
+ (current_function_outgoing_args_size
? current_function_outgoing_args_size + 4 : 0));
else
@@ -1155,6 +1716,15 @@ const_8bit_operand (op, mode)
&& INTVAL (op) < 256);
}
+/* 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;
+{
+ return (op == CONST1_RTX (SFmode));
+}
+
/* Similarly, but when using a zero_extract pattern for a btst where
the source operand might end up in memory. */
int
@@ -1222,6 +1792,9 @@ legitimize_address (x, oldx, mode)
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);
+
/* Uh-oh. We might have an address for x[n-100000]. This needs
special handling to avoid creating an indexed memory address
with x-100000 as the base. */
@@ -1252,6 +1825,75 @@ legitimize_address (x, oldx, mode)
return x;
}
+/* 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;
+{
+ if (GET_CODE (orig) == LABEL_REF
+ || (GET_CODE (orig) == SYMBOL_REF
+ && (CONSTANT_POOL_ADDRESS_P (orig)
+ || ! MN10300_GLOBAL_P (orig))))
+ {
+ if (reg == 0)
+ reg = gen_reg_rtx (Pmode);
+
+ emit_insn (gen_symGOTOFF2reg (reg, orig));
+ return reg;
+ }
+ else if (GET_CODE (orig) == SYMBOL_REF)
+ {
+ if (reg == 0)
+ reg = gen_reg_rtx (Pmode);
+
+ emit_insn (gen_symGOT2reg (reg, orig));
+ return reg;
+ }
+ return orig;
+}
+
+/* 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;
+{
+ register const char *fmt;
+ register int i;
+
+ if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
+ return 0;
+
+ if (GET_CODE (x) == UNSPEC
+ && (XINT (x, 1) == UNSPEC_PIC
+ || XINT (x, 1) == UNSPEC_GOT
+ || XINT (x, 1) == UNSPEC_GOTOFF
+ || XINT (x, 1) == UNSPEC_PLT))
+ return 1;
+
+ if (GET_CODE (x) == QUEUED)
+ return legitimate_pic_operand_p (QUEUED_VAR (x));
+
+ fmt = GET_RTX_FORMAT (GET_CODE (x));
+ for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'E')
+ {
+ register int j;
+
+ for (j = XVECLEN (x, i) - 1; j >= 0; j--)
+ if (! legitimate_pic_operand_p (XVECEXP (x, i, j)))
+ return 0;
+ }
+ else if (fmt[i] == 'e' && ! legitimate_pic_operand_p (XEXP (x, i)))
+ return 0;
+ }
+
+ return 1;
+}
+
static int
mn10300_address_cost_1 (x, unsig)
rtx x;
@@ -1271,6 +1913,7 @@ mn10300_address_cost_1 (x, unsig)
case DATA_REGS:
case EXTENDED_REGS:
+ case FP_REGS:
return 3;
case NO_REGS:
@@ -1438,3 +2081,23 @@ mn10300_wide_const_load_uses_clr (operands)
return val[0] == 0 || val[1] == 0;
}
+/* If using PIC, mark a SYMBOL_REF for a non-global symbol so that we
+ may access it using GOTOFF instead of GOT. */
+
+static void
+mn10300_encode_section_info (decl, rtl, first)
+ tree decl;
+ rtx rtl;
+ int first;
+{
+ rtx symbol;
+
+ if (GET_CODE (rtl) != MEM)
+ return;
+ symbol = XEXP (rtl, 0);
+ if (GET_CODE (symbol) != SYMBOL_REF)
+ return;
+
+ if (flag_pic)
+ SYMBOL_REF_FLAG (symbol) = (*targetm.binds_local_p) (decl);
+}
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index cae8f2a3f81..2432a38a1ce 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler.
Matsushita MN10300 series
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
@@ -40,12 +40,14 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
-#define CPP_SPEC "%{mam33:-D__AM33__}"
+#define CPP_SPEC "%{mam33:-D__AM33__} %{mam33-2:-D__AM33__=2 -D__AM33_2__}"
/* Run-time compilation parameters selecting different hardware subsets. */
extern int target_flags;
+extern GTY(()) int mn10300_unspec_int_label_counter;
+
/* Macros used in the machine description to test the flags. */
/* Macro to define tables used to set the flags.
@@ -60,6 +62,9 @@ extern int target_flags;
/* Generate code for the AM33 processor. */
#define TARGET_AM33 (target_flags & 0x2)
+/* Generate code for the AM33/2.0 processor. */
+#define TARGET_AM33_2 (target_flags & 0x4)
+
#define TARGET_SWITCHES \
{{ "mult-bug", 0x1, N_("Work around hardware multiply bug")}, \
{ "no-mult-bug", -0x1, N_("Do not work around hardware multiply bug")},\
@@ -67,6 +72,9 @@ extern int target_flags;
{ "am33", -(0x1), ""},\
{ "no-am33", -0x2, ""}, \
{ "no-crt0", 0, N_("No default crt0.o") }, \
+ { "am33-2", 0x6, N_("Target the AM33/2.0 processor")}, \
+ { "am33-2", -(0x1), ""},\
+ { "no-am33-2", -0x4, ""}, \
{ "relax", 0, N_("Enable linker relaxations") }, \
{ "", TARGET_DEFAULT, NULL}}
@@ -131,7 +139,7 @@ extern int target_flags;
All registers that the compiler knows about must be given numbers,
even those that are not normally considered general registers. */
-#define FIRST_PSEUDO_REGISTER 18
+#define FIRST_PSEUDO_REGISTER 50
/* Specify machine-specific register numbers. */
#define FIRST_DATA_REGNUM 0
@@ -140,6 +148,8 @@ extern int target_flags;
#define LAST_ADDRESS_REGNUM 8
#define FIRST_EXTENDED_REGNUM 10
#define LAST_EXTENDED_REGNUM 17
+#define FIRST_FP_REGNUM 18
+#define LAST_FP_REGNUM 49
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
@@ -162,7 +172,10 @@ extern int target_flags;
and are not available for the register allocator. */
#define FIXED_REGISTERS \
- { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}
+ { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 \
+ , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
+ , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
+ }
/* 1 for registers not available across function calls.
These must include the FIXED_REGISTERS and also any
@@ -173,10 +186,16 @@ extern int target_flags;
like. */
#define CALL_USED_REGISTERS \
- { 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}
+ { 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0 \
+ , 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
+ , 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \
+ }
#define REG_ALLOC_ORDER \
- { 0, 1, 4, 5, 2, 3, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 8, 9}
+ { 0, 1, 4, 5, 2, 3, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 8, 9 \
+ , 42, 43, 44, 45, 46, 47, 48, 49, 34, 35, 36, 37, 38, 39, 40, 41 \
+ , 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 \
+ }
#define CONDITIONAL_REGISTER_USAGE \
{ \
@@ -188,6 +207,15 @@ extern int target_flags;
i <= LAST_EXTENDED_REGNUM; i++) \
fixed_regs[i] = call_used_regs[i] = 1; \
} \
+ if (!TARGET_AM33_2) \
+ { \
+ for (i = FIRST_FP_REGNUM; \
+ i <= LAST_FP_REGNUM; \
+ i++) \
+ fixed_regs[i] = call_used_regs[i] = 1; \
+ } \
+ if (flag_pic) \
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
}
/* Return number of consecutive hard regs needed starting at reg REGNO
@@ -247,6 +275,7 @@ enum reg_class {
DATA_OR_ADDRESS_REGS, SP_OR_ADDRESS_REGS,
EXTENDED_REGS, DATA_OR_EXTENDED_REGS, ADDRESS_OR_EXTENDED_REGS,
SP_OR_EXTENDED_REGS, SP_OR_ADDRESS_OR_EXTENDED_REGS,
+ FP_REGS, FP_ACC_REGS,
GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
};
@@ -260,6 +289,7 @@ enum reg_class {
"EXTENDED_REGS", \
"DATA_OR_EXTENDED_REGS", "ADDRESS_OR_EXTENDED_REGS", \
"SP_OR_EXTENDED_REGS", "SP_OR_ADDRESS_OR_EXTENDED_REGS", \
+ "FP_REGS", "FP_ACC_REGS", \
"GENERAL_REGS", "ALL_REGS", "LIM_REGS" }
/* Define which registers fit in which classes.
@@ -267,19 +297,21 @@ enum reg_class {
of length N_REG_CLASSES. */
#define REG_CLASS_CONTENTS \
-{ {0}, /* No regs */ \
- {0x0000f}, /* DATA_REGS */ \
- {0x001f0}, /* ADDRESS_REGS */ \
- {0x00200}, /* SP_REGS */ \
- {0x001ff}, /* DATA_OR_ADDRESS_REGS */\
- {0x003f0}, /* SP_OR_ADDRESS_REGS */\
- {0x3fc00}, /* EXTENDED_REGS */ \
- {0x3fc0f}, /* DATA_OR_EXTENDED_REGS */ \
- {0x3fdf0}, /* ADDRESS_OR_EXTENDED_REGS */ \
- {0x3fe00}, /* SP_OR_EXTENDED_REGS */ \
- {0x3fff0}, /* SP_OR_ADDRESS_OR_EXTENDED_REGS */ \
- {0x3fdff}, /* GENERAL_REGS */ \
- {0x3ffff}, /* ALL_REGS */ \
+{ { 0, 0 }, /* No regs */ \
+ { 0x0000f, 0 }, /* DATA_REGS */ \
+ { 0x001f0, 0 }, /* ADDRESS_REGS */ \
+ { 0x00200, 0 }, /* SP_REGS */ \
+ { 0x001ff, 0 }, /* DATA_OR_ADDRESS_REGS */\
+ { 0x003f0, 0 }, /* SP_OR_ADDRESS_REGS */\
+ { 0x3fc00, 0 }, /* EXTENDED_REGS */ \
+ { 0x3fc0f, 0 }, /* DATA_OR_EXTENDED_REGS */ \
+ { 0x3fdf0, 0 }, /* ADDRESS_OR_EXTENDED_REGS */ \
+ { 0x3fe00, 0 }, /* SP_OR_EXTENDED_REGS */ \
+ { 0x3fff0, 0 }, /* SP_OR_ADDRESS_OR_EXTENDED_REGS */ \
+ { 0xfffc0000, 0x3ffff }, /* FP_REGS */ \
+ { 0x03fc0000, 0 }, /* FP_ACC_REGS */ \
+ { 0x3fdff, 0 }, /* GENERAL_REGS */ \
+ { 0xffffffff, 0x3ffff } /* ALL_REGS */ \
}
/* The same information, inverted:
@@ -292,6 +324,7 @@ enum reg_class {
(REGNO) <= LAST_ADDRESS_REGNUM ? ADDRESS_REGS : \
(REGNO) == STACK_POINTER_REGNUM ? SP_REGS : \
(REGNO) <= LAST_EXTENDED_REGNUM ? EXTENDED_REGS : \
+ (REGNO) <= LAST_FP_REGNUM ? FP_REGS : \
NO_REGS)
/* The class value for index registers, and the one for base regs. */
@@ -306,6 +339,9 @@ enum reg_class {
(C) == 'y' ? SP_REGS : \
! TARGET_AM33 ? NO_REGS : \
(C) == 'x' ? EXTENDED_REGS : \
+ ! TARGET_AM33_2 ? NO_REGS : \
+ (C) == 'f' ? FP_REGS : \
+ (C) == 'A' ? FP_ACC_REGS : \
NO_REGS)
/* Macros to check register numbers against specific register classes. */
@@ -350,6 +386,8 @@ enum reg_class {
#define REGNO_AM33_P(regno) \
(REGNO_DATA_P ((regno)) || REGNO_ADDRESS_P ((regno)) \
|| REGNO_EXTENDED_P ((regno)))
+#define REGNO_FP_P(regno) \
+ REGNO_IN_RANGE_P ((regno), FIRST_FP_REGNUM, LAST_FP_REGNUM)
#define REGNO_OK_FOR_BASE_P(regno) \
(REGNO_SP_P ((regno)) \
@@ -397,6 +435,11 @@ enum reg_class {
#define CLASS_MAX_NREGS(CLASS, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+/* A class that contains registers which the compiler must always
+ access in a mode that is the same size as the mode in which it
+ loaded the register. */
+#define CLASS_CANNOT_CHANGE_SIZE FP_REGS
+
/* The letters I, J, K, L, M, N, O, P in a register constraint string
can be used to stand for particular ranges of immediate operands.
This macro defines what the ranges are.
@@ -669,6 +712,9 @@ struct cum_arg {int nbytes; };
/* Extra constraints. */
+#define OK_FOR_Q(OP) \
+ (GET_CODE (OP) == MEM && ! CONSTANT_ADDRESS_P (XEXP (OP, 0)))
+
#define OK_FOR_R(OP) \
(GET_CODE (OP) == MEM \
&& GET_MODE (OP) == QImode \
@@ -692,6 +738,10 @@ struct cum_arg {int nbytes; };
#define EXTRA_CONSTRAINT(OP, C) \
((C) == 'R' ? OK_FOR_R (OP) \
+ : (C) == 'Q' ? OK_FOR_Q (OP) \
+ : (C) == 'S' && flag_pic \
+ ? GET_CODE (OP) == UNSPEC && (XINT (OP, 1) == UNSPEC_PLT \
+ || XINT (OP, 1) == UNSPEC_PIC) \
: (C) == 'S' ? GET_CODE (OP) == SYMBOL_REF \
: (C) == 'T' ? OK_FOR_T (OP) \
: 0)
@@ -732,7 +782,8 @@ struct cum_arg {int nbytes; };
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
{ \
- if (CONSTANT_ADDRESS_P (X)) \
+ if (CONSTANT_ADDRESS_P (X) \
+ && (! flag_pic || legitimate_pic_operand_p (X))) \
goto ADDR; \
if (RTX_OK_FOR_BASE_P (X)) \
goto ADDR; \
@@ -754,6 +805,8 @@ struct cum_arg {int nbytes; };
{ \
if (GET_CODE (index) == CONST_INT) \
goto ADDR; \
+ if (GET_CODE (index) == CONST) \
+ goto ADDR; \
} \
} \
}
@@ -790,6 +843,60 @@ struct cum_arg {int nbytes; };
#define LEGITIMATE_CONSTANT_P(X) 1
+/* Zero if this needs fixing up to become PIC. */
+
+#define LEGITIMATE_PIC_OPERAND_P(X) (legitimate_pic_operand_p (X))
+
+/* Register to hold the addressing base for
+ position independent code access to data items. */
+#define PIC_OFFSET_TABLE_REGNUM PIC_REG
+
+/* The name of the pseudo-symbol representing the Global Offset Table. */
+#define GOT_SYMBOL_NAME "*_GLOBAL_OFFSET_TABLE_"
+
+#define SYMBOLIC_CONST_P(X) \
+((GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == LABEL_REF) \
+ && ! LEGITIMATE_PIC_OPERAND_P (X))
+
+/* Non-global SYMBOL_REFs have SYMBOL_REF_FLAG enabled. */
+#define MN10300_GLOBAL_P(X) (! SYMBOL_REF_FLAG (X))
+
+/* Recognize machine-specific patterns that may appear within
+ constants. Used for PIC-specific UNSPECs. */
+#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL) \
+ do \
+ if (GET_CODE (X) == UNSPEC && XVECLEN ((X), 0) == 1) \
+ { \
+ switch (XINT ((X), 1)) \
+ { \
+ case UNSPEC_INT_LABEL: \
+ asm_fprintf ((STREAM), ".%LLIL%d", \
+ INTVAL (XVECEXP ((X), 0, 0))); \
+ break; \
+ case UNSPEC_PIC: \
+ /* GLOBAL_OFFSET_TABLE or local symbols, no suffix. */ \
+ output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
+ break; \
+ case UNSPEC_GOT: \
+ output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
+ fputs ("@GOT", (STREAM)); \
+ break; \
+ case UNSPEC_GOTOFF: \
+ output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
+ fputs ("@GOTOFF", (STREAM)); \
+ break; \
+ case UNSPEC_PLT: \
+ output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
+ fputs ("@PLT", (STREAM)); \
+ break; \
+ default: \
+ goto FAIL; \
+ } \
+ break; \
+ } \
+ else \
+ goto FAIL; \
+ while (0)
/* Tell final.c how to eliminate redundant test instructions. */
@@ -814,6 +921,7 @@ struct cum_arg {int nbytes; };
! TARGET_AM33 ? 6 : \
(CLASS1 == SP_REGS || CLASS2 == SP_REGS) ? 6 : \
(CLASS1 == CLASS2 && CLASS1 == EXTENDED_REGS) ? 6 : \
+ (CLASS1 == FP_REGS || CLASS2 == FP_REGS) ? 6 : \
(CLASS1 == EXTENDED_REGS || CLASS2 == EXTENDED_REGS) ? 4 : \
4)
@@ -885,6 +993,10 @@ struct cum_arg {int nbytes; };
#define REGISTER_NAMES \
{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3", "ap", "sp", \
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7" \
+, "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7" \
+, "fs8", "fs9", "fs10", "fs11", "fs12", "fs13", "fs14", "fs15" \
+, "fs16", "fs17", "fs18", "fs19", "fs20", "fs21", "fs22", "fs23" \
+, "fs24", "fs25", "fs26", "fs27", "fs28", "fs29", "fs30", "fs31" \
}
#define ADDITIONAL_REGISTER_NAMES \
@@ -892,6 +1004,10 @@ struct cum_arg {int nbytes; };
{"r12", 0}, {"r13", 1}, {"r14", 2}, {"r15", 3}, \
{"e0", 10}, {"e1", 11}, {"e2", 12}, {"e3", 13}, \
{"e4", 14}, {"e5", 15}, {"e6", 16}, {"e7", 17} \
+, {"fd0", 18}, {"fd2", 20}, {"fd4", 22}, {"fd6", 24} \
+, {"fd8", 26}, {"fd10", 28}, {"fd12", 30}, {"fd14", 32} \
+, {"fd16", 34}, {"fd18", 36}, {"fd20", 38}, {"fd22", 40} \
+, {"fd24", 42}, {"fd26", 44}, {"fd28", 46}, {"fd30", 48} \
}
/* Print an instruction operand X on file FILE.
@@ -994,3 +1110,15 @@ struct cum_arg {int nbytes; };
#define FILE_ASM_OP "\t.file\n"
+#define PREDICATE_CODES \
+ {"const_1f_operand", {CONST_INT, CONST_DOUBLE}},
+
+typedef struct mn10300_cc_status_mdep
+ {
+ int fpCC;
+ }
+cc_status_mdep;
+
+#define CC_STATUS_MDEP cc_status_mdep
+
+#define CC_STATUS_MDEP_INIT (cc_status.mdep.fpCC = 0)
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index f889aa61cdd..46a8ff125cd 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -37,6 +37,17 @@
;; clobber - value of cc is unknown
(define_attr "cc" "none,none_0hit,set_znv,set_zn,compare,clobber,invert"
(const_string "clobber"))
+
+(define_constants [
+ (PIC_REG 6)
+ (SP_REG 9)
+
+ (UNSPEC_INT_LABEL 0)
+ (UNSPEC_PIC 1)
+ (UNSPEC_GOT 2)
+ (UNSPEC_GOTOFF 3)
+ (UNSPEC_PLT 4)
+])
;; ----------------------------------------------------------------------
;; MOVE INSTRUCTIONS
@@ -57,8 +68,8 @@
}")
(define_insn ""
- [(set (match_operand:QI 0 "nonimmediate_operand" "=d*x*a,d*x,d*x*a,d*x*a,m")
- (match_operand:QI 1 "general_operand" "0,I,d*xai,m,d*xa"))]
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d*x*a*f,d*x,d*x*a,d*x*a,m,*f,d*x*a")
+ (match_operand:QI 1 "general_operand" "0,I,d*xai,m,d*xa,d*xa*f,*f"))]
"TARGET_AM33
&& (register_operand (operands[0], QImode)
|| register_operand (operands[1], QImode))"
@@ -93,11 +104,14 @@
case 3:
case 4:
return \"movbu %1,%0\";
+ case 5:
+ case 6:
+ return \"fmov %1,%0\";
default:
abort ();
}
}"
- [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
+ [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
(define_insn ""
[(set (match_operand:QI 0 "nonimmediate_operand" "=d*a,d,d*a,d,m")
@@ -147,8 +161,8 @@
}")
(define_insn ""
- [(set (match_operand:HI 0 "nonimmediate_operand" "=d*x*a,d*x,d*x*a,d*x*a,m")
- (match_operand:HI 1 "general_operand" "0,I,d*x*ai,m,d*x*a"))]
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d*x*a*f,d*x,d*x*a,d*x*a,m,*f,d*x*a")
+ (match_operand:HI 1 "general_operand" "0,I,d*x*ai,m,d*x*a,d*x*a*f,*f"))]
"TARGET_AM33
&& (register_operand (operands[0], HImode)
|| register_operand (operands[1], HImode))"
@@ -183,11 +197,14 @@
case 3:
case 4:
return \"movhu %1,%0\";
+ case 5:
+ case 6:
+ return \"fmov %1,%0\";
default:
abort ();
}
}"
- [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
+ [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
(define_insn ""
[(set (match_operand:HI 0 "nonimmediate_operand" "=d*a,d,d*a,d,m")
@@ -263,6 +280,12 @@
DONE;
}")
+(define_insn "pop_pic_reg"
+ [(set (reg:SI PIC_REG)
+ (mem:SI (post_inc:SI (reg:SI SP_REG))))]
+ "reload_completed"
+ "movm (sp),[a2]")
+
(define_expand "movsi"
[(set (match_operand:SI 0 "general_operand" "")
(match_operand:SI 1 "general_operand" ""))]
@@ -273,13 +296,40 @@
if (!register_operand (operand1, SImode)
&& !register_operand (operand0, SImode))
operands[1] = copy_to_mode_reg (SImode, operand1);
+ if (flag_pic)
+ {
+ rtx temp;
+ if (SYMBOLIC_CONST_P (operands[1]))
+ {
+ if (GET_CODE (operands[0]) == MEM)
+ operands[1] = force_reg (Pmode, operands[1]);
+ else
+ {
+ temp = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode);
+ operands[1] = legitimize_pic_address (operands[1], temp);
+ }
+ }
+ else if (GET_CODE (operands[1]) == CONST
+ && GET_CODE (XEXP (operands[1], 0)) == PLUS
+ && SYMBOLIC_CONST_P (XEXP (XEXP (operands[1], 0), 0)))
+ {
+ temp = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode);
+ temp = legitimize_pic_address (XEXP (XEXP (operands[1], 0), 0),
+ temp);
+ operands[1] = expand_binop (SImode, add_optab, temp,
+ XEXP (XEXP (operands[1], 0), 1),
+ no_new_pseudos ? temp
+ : gen_reg_rtx (Pmode),
+ 0, OPTAB_LIB_WIDEN);
+ }
+ }
}")
(define_insn ""
[(set (match_operand:SI 0 "nonimmediate_operand"
- "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax,axR,!*y")
+ "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax,axR,!*y,*f,*f,dxaQ")
(match_operand:SI 1 "general_operand"
- "0,0,I,I,dx,ax,dx,ax,dixm,aixm,dixm,aixm,!*y,axR"))]
+ "0,0,I,I,dx,ax,dx,ax,dixm,aixm,dixm,aixm,!*y,axR,0,dxaQi*f,*f"))]
"register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode)"
"*
@@ -321,11 +371,16 @@
return \"movu %1,%0\";
}
return \"mov %1,%0\";
+ case 14:
+ return \"nop\";
+ case 15:
+ case 16:
+ return \"fmov %1,%0\";
default:
abort ();
}
}"
- [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
+ [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none,none_0hit,none_0hit")])
(define_expand "movsf"
[(set (match_operand:SF 0 "general_operand" "")
@@ -340,8 +395,8 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "nonimmediate_operand" "=dx,ax,dx,a,daxm,dax")
- (match_operand:SF 1 "general_operand" "0,0,G,G,dax,daxFm"))]
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,dx,ax,dx,a,f,dxaQ,daxm,dax")
+ (match_operand:SF 1 "general_operand" "0,0,0,G,G,fdxaQF,f,dax,daxFm"))]
"register_operand (operands[0], SFmode)
|| register_operand (operands[1], SFmode)"
"*
@@ -350,12 +405,17 @@
{
case 0:
case 1:
- return \"nop\";
case 2:
- return \"clr %0\";
+ return \"nop\";
case 3:
- case 4:
+ return \"clr %0\";
+ /* case 4: below */
case 5:
+ case 6:
+ return \"fmov %1, %0\";
+ case 4:
+ case 7:
+ case 8:
if (REGNO_REG_CLASS (true_regnum (operands[0])) == EXTENDED_REGS
&& GET_CODE (operands[1]) == CONST_INT)
{
@@ -370,7 +430,7 @@
abort ();
}
}"
- [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit")])
+ [(set_attr "cc" "none,none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
(define_expand "movdi"
[(set (match_operand:DI 0 "general_operand" "")
@@ -386,9 +446,9 @@
(define_insn ""
[(set (match_operand:DI 0 "nonimmediate_operand"
- "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax")
+ "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax,*f,*f,*f,dxa,*f,Q")
(match_operand:DI 1 "general_operand"
- "0,0,I,I,dx,ax,dx,ax,dxim,axim,dxim,axim"))]
+ "0,0,I,I,dx,ax,dx,ax,dxim,axim,dxim,axim,0,*f,dxai,*f,Q,*f"))]
"register_operand (operands[0], DImode)
|| register_operand (operands[1], DImode)"
"*
@@ -516,6 +576,26 @@
output_asm_insn (\"mov %H1,%H0\", operands);
return \"\";
}
+ case 12:
+ return \"nop\";
+ case 13:
+ case 14:
+ case 15:
+ return \"fmov %L1, %L0\;fmov %H1, %H0\";
+ case 16:
+ if (GET_CODE (operands[1]) == MEM
+ && GET_CODE (XEXP (operands[1], 0)) == CONST_INT
+ && (INTVAL (XEXP (operands[1], 0)) & 7) == 0)
+ return \"fmov %D1, %D0\";
+ else
+ return \"fmov %L1, %L0\;fmov %H1, %H0\";
+ case 17:
+ if (GET_CODE (operands[0]) == MEM
+ && GET_CODE (XEXP (operands[0], 0)) == CONST_INT
+ && (INTVAL (XEXP (operands[0], 0)) & 7) == 0)
+ return \"fmov %D1, %D0\";
+ else
+ return \"fmov %L1, %L0\;fmov %H1, %H0\";
default:
abort ();
}
@@ -523,8 +603,9 @@
[(set (attr "cc")
(cond
[
- (lt (symbol_ref "which_alternative") (const_int 2)
- ) (const_string "none")
+ (ior (lt (symbol_ref "which_alternative") (const_int 2))
+ (eq (symbol_ref "which_alternative") (const_int 12))
+ ) (const_string "none")
(eq (symbol_ref "which_alternative") (const_int 2)
) (const_string "clobber")
(eq (symbol_ref "which_alternative") (const_int 3)
@@ -555,9 +636,9 @@
(define_insn ""
[(set (match_operand:DF 0 "nonimmediate_operand"
- "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax")
+ "=f,dx,ax,dx,f,f,dxa,f,Q,a,dxm,dxm,axm,axm,dx,dx,ax,ax")
(match_operand:DF 1 "general_operand"
- "0,0,G,G,dx,ax,dx,ax,dxFm,axFm,dxFm,axFm"))]
+ "0,0,0,G,f,dxaF,f,Q,f,G,dx,ax,dx,ax,dxFm,axFm,dxFm,axFm"))]
"register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode)"
"*
@@ -569,24 +650,46 @@
{
case 0:
case 1:
+ case 2:
return \"nop\";
- case 2:
+ case 3:
return \"clr %L0\;clr %H0\";
- case 3:
- if (rtx_equal_p (operands[0], operands[1]))
- return \"sub %L1,%L0\;mov %L0,%H0\";
- else
- return \"mov %1,%L0\;mov %L0,%H0\";
case 4:
case 5:
case 6:
+ return \"fmov %L1, %L0\;fmov %H1, %H0\";
+
case 7:
+ if (GET_CODE (operands[1]) == MEM
+ && GET_CODE (XEXP (operands[1], 0)) == CONST_INT
+ && (INTVAL (XEXP (operands[1], 0)) & 7) == 0)
+ return \"fmov %D1, %D0\";
+ else
+ return \"fmov %L1, %L0\;fmov %H1, %H0\";
+
case 8:
+ if (GET_CODE (operands[0]) == MEM
+ && GET_CODE (XEXP (operands[0], 0)) == CONST_INT
+ && (INTVAL (XEXP (operands[0], 0)) & 7) == 0)
+ return \"fmov %D1, %D0\";
+ else
+ return \"fmov %L1, %L0\;fmov %H1, %H0\";
+
case 9:
+ if (rtx_equal_p (operands[0], operands[1]))
+ return \"sub %L1,%L0\;mov %L0,%H0\";
+ else
+ return \"mov %1,%L0\;mov %L0,%H0\";
case 10:
case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
if (GET_CODE (operands[1]) == CONST_INT)
{
rtx low, high;
@@ -692,17 +795,17 @@
[(set (attr "cc")
(cond
[
- (lt (symbol_ref "which_alternative") (const_int 2)
+ (lt (symbol_ref "which_alternative") (const_int 3)
) (const_string "none")
- (eq (symbol_ref "which_alternative") (const_int 2)
- ) (const_string "clobber")
(eq (symbol_ref "which_alternative") (const_int 3)
+ ) (const_string "clobber")
+ (eq (symbol_ref "which_alternative") (const_int 9)
) (if_then_else
(ne (symbol_ref "rtx_equal_p (operands[0], operands[1])")
(const_int 0)) (const_string "clobber")
(const_string "none_0hit"))
- (ior (eq (symbol_ref "which_alternative") (const_int 8))
- (eq (symbol_ref "which_alternative") (const_int 9))
+ (ior (eq (symbol_ref "which_alternative") (const_int 14))
+ (eq (symbol_ref "which_alternative") (const_int 15))
) (if_then_else
(ne (symbol_ref "mn10300_wide_const_load_uses_clr
(operands)")
@@ -773,6 +876,14 @@
btst 0,d0
cmp %1,%0"
[(set_attr "cc" "compare,compare")])
+
+(define_insn "cmpsf"
+ [(set (cc0)
+ (compare (match_operand:SF 0 "register_operand" "f,f")
+ (match_operand:SF 1 "nonmemory_operand" "f,F")))]
+ "TARGET_AM33_2"
+ "fcmp %1,%0"
+ [(set_attr "cc" "compare,compare")])
;; ----------------------------------------------------------------------
;; ADD INSTRUCTIONS
@@ -1113,7 +1224,7 @@
return \"and %1,%0\";
return \"and %2,%0\";
}"
- [(set_attr "cc" "none_0hit,set_znv,set_znv")])
+ [(set_attr "cc" "none_0hit,set_zn,set_zn")])
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=dx,dx")
@@ -1144,7 +1255,7 @@
return \"lsr 4,%0\;asl2 %0\;asl2 %0\";
return \"and %2,%0\";
}"
- [(set_attr "cc" "none_0hit,set_znv")])
+ [(set_attr "cc" "none_0hit,set_zn")])
;; ----------------------------------------------------------------------
;; OR INSTRUCTIONS
@@ -1180,7 +1291,7 @@
return \"or %1,%0\";
return \"or %2,%0\";
}"
- [(set_attr "cc" "set_znv")])
+ [(set_attr "cc" "set_zn")])
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=dx")
@@ -1188,7 +1299,7 @@
(match_operand:SI 2 "nonmemory_operand" "dxi")))]
""
"or %2,%0"
- [(set_attr "cc" "set_znv")])
+ [(set_attr "cc" "set_zn")])
;; ----------------------------------------------------------------------
;; XOR INSTRUCTIONS
@@ -1224,7 +1335,7 @@
return \"xor %1,%0\";
return \"xor %2,%0\";
}"
- [(set_attr "cc" "set_znv")])
+ [(set_attr "cc" "set_zn")])
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=dx")
@@ -1232,7 +1343,7 @@
(match_operand:SI 2 "nonmemory_operand" "dxi")))]
""
"xor %2,%0"
- [(set_attr "cc" "set_znv")])
+ [(set_attr "cc" "set_zn")])
;; ----------------------------------------------------------------------
;; NOT INSTRUCTIONS
@@ -1249,14 +1360,14 @@
(not:SI (match_operand:SI 1 "register_operand" "0,0")))]
"TARGET_AM33"
"not %0"
- [(set_attr "cc" "set_znv")])
+ [(set_attr "cc" "set_zn")])
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=dx")
(not:SI (match_operand:SI 1 "register_operand" "0")))]
""
"not %0"
- [(set_attr "cc" "set_znv")])
+ [(set_attr "cc" "set_zn")])
;; -----------------------------------------------------------------
;; BIT FIELDS
@@ -1293,7 +1404,7 @@
"@
bclr %N1,%A0
and %1,%0"
- [(set_attr "cc" "clobber,set_znv")])
+ [(set_attr "cc" "clobber,set_zn")])
(define_insn ""
[(set (match_operand:QI 0 "memory_operand" "=R,T")
@@ -1315,7 +1426,7 @@
"@
bset %U1,%A0
or %1,%0"
- [(set_attr "cc" "clobber,set_znv")])
+ [(set_attr "cc" "clobber,set_zn")])
(define_expand "iorqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "")
@@ -1338,7 +1449,7 @@
bset %U2,%A0
bset %2,%0
or %2,%0"
- [(set_attr "cc" "clobber,clobber,set_znv")])
+ [(set_attr "cc" "clobber,clobber,set_zn")])
(define_insn ""
[(set (match_operand:QI 0 "nonimmediate_operand" "=R,T,d")
@@ -1353,7 +1464,7 @@
bset %U2,%A0
bset %2,%0
or %2,%0"
- [(set_attr "cc" "clobber,clobber,set_znv")])
+ [(set_attr "cc" "clobber,clobber,set_zn")])
(define_insn ""
[(set (cc0)
@@ -1551,6 +1662,8 @@
""
"*
{
+ if (cc_status.mdep.fpCC)
+ return \"fb%b1 %0\";
if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0
&& (GET_CODE (operands[1]) == GT
|| GET_CODE (operands[1]) == GE
@@ -1570,6 +1683,8 @@
""
"*
{
+ if (cc_status.mdep.fpCC)
+ return \"fb%B1 %0\";
if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0
&& (GET_CODE (operands[1]) == GT
|| GET_CODE (operands[1]) == GE
@@ -1595,6 +1710,43 @@
"jmp (%0)"
[(set_attr "cc" "none")])
+(define_expand "builtin_setjmp_receiver"
+ [(match_operand 0 "" "")]
+ "flag_pic"
+ "
+{
+ if (flag_pic)
+ emit_insn (gen_GOTaddr2picreg ());
+
+ DONE;
+}")
+
+(define_expand "casesi"
+ [(match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "immediate_operand" "")
+ (match_operand:SI 2 "immediate_operand" "")
+ (match_operand 3 "" "") (match_operand 4 "" "")]
+ ""
+ "
+{
+ rtx table = gen_reg_rtx (SImode);
+ rtx index = gen_reg_rtx (SImode);
+ rtx addr = gen_reg_rtx (Pmode);
+
+ emit_move_insn (table, gen_rtx_LABEL_REF (VOIDmode, operands[3]));
+ emit_move_insn (index, plus_constant (operands[0], - INTVAL (operands[1])));
+ emit_insn (gen_cmpsi (index, operands[2]));
+ emit_jump_insn (gen_bgtu (operands[4]));
+ emit_move_insn (index, gen_rtx_ASHIFT (SImode, index, GEN_INT (2)));
+ emit_move_insn (addr, gen_rtx_MEM (SImode,
+ gen_rtx_PLUS (SImode, table, index)));
+ if (flag_pic)
+ emit_move_insn (addr, gen_rtx_PLUS (SImode, addr, table));
+
+ emit_jump_insn (gen_tablejump (addr, operands[3]));
+ DONE;
+}")
+
(define_insn "tablejump"
[(set (pc) (match_operand:SI 0 "register_operand" "a"))
(use (label_ref (match_operand 1 "" "")))]
@@ -1610,6 +1762,20 @@
""
"
{
+ if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
+ {
+ if (MN10300_GLOBAL_P (XEXP (operands[0], 0)))
+ {
+ /* The PLT code won't run on AM30, but then, there's no
+ shared library support for AM30 either, so we just assume
+ the linker is going to adjust all @PLT relocs to the
+ actual symbols. */
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
+ XEXP (operands[0], 0) = gen_sym2PLT (XEXP (operands[0], 0));
+ }
+ else
+ XEXP (operands[0], 0) = gen_sym2PIC (XEXP (operands[0], 0));
+ }
if (! call_address_operand (XEXP (operands[0], 0), VOIDmode))
XEXP (operands[0], 0) = force_reg (SImode, XEXP (operands[0], 0));
emit_call_insn (gen_call_internal (XEXP (operands[0], 0), operands[1]));
@@ -1639,6 +1805,20 @@
""
"
{
+ if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
+ {
+ if (MN10300_GLOBAL_P (XEXP (operands[1], 0)))
+ {
+ /* The PLT code won't run on AM30, but then, there's no
+ shared library support for AM30 either, so we just assume
+ the linker is going to adjust all @PLT relocs to the
+ actual symbols. */
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
+ XEXP (operands[1], 0) = gen_sym2PLT (XEXP (operands[1], 0));
+ }
+ else
+ XEXP (operands[1], 0) = gen_sym2PIC (XEXP (operands[1], 0));
+ }
if (! call_address_operand (XEXP (operands[1], 0), VOIDmode))
XEXP (operands[1], 0) = force_reg (SImode, XEXP (operands[1], 0));
emit_call_insn (gen_call_value_internal (operands[0],
@@ -1996,6 +2176,12 @@
rtx result;
rtx target;
+ if (TARGET_AM33_2)
+ {
+ emit_insn (gen_abssf2_am33_2 (operands[0], operands[1]));
+ DONE;
+ }
+
target = operand_subword_force (operands[0], 0, SFmode);
result = expand_binop (SImode, and_optab,
operand_subword_force (operands[1], 0, SFmode),
@@ -2012,6 +2198,15 @@
}")
+(define_insn "abssf2_am33_2"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (abs:SF (match_operand:SF 1 "register_operand" "0,?f")))]
+ "TARGET_AM33_2"
+ "@
+ fabs %0
+ fabs %1, %0"
+ [(set_attr "cc" "none_0hit")])
+
(define_expand "negdf2"
[(set (match_operand:DF 0 "register_operand" "")
(neg:DF (match_operand:DF 1 "register_operand" "")))]
@@ -2052,6 +2247,12 @@
rtx result;
rtx target;
+ if (TARGET_AM33_2)
+ {
+ emit_insn (gen_negsf2_am33_2 (operands[0], operands[1]));
+ DONE;
+ }
+
target = operand_subword_force (operands[0], 0, SFmode);
result = expand_binop (SImode, xor_optab,
operand_subword_force (operands[1], 0, SFmode),
@@ -2068,6 +2269,114 @@
DONE;
}")
+(define_insn "negsf2_am33_2"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (neg:SF (match_operand:SF 1 "register_operand" "0,?f")))]
+ "TARGET_AM33_2"
+ "@
+ fneg %0
+ fneg %1, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_expand "sqrtsf2"
+ [(set (match_operand:SF 0 "register_operand" "")
+ (sqrt:SF (match_operand:SF 1 "register_operand" "")))]
+ "TARGET_AM33_2 && flag_unsafe_math_optimizations"
+ "
+{
+ rtx scratch = gen_reg_rtx (SFmode);
+ emit_insn (gen_rsqrtsf2 (scratch, operands[1], CONST1_RTX (SFmode)));
+ emit_insn (gen_divsf3 (operands[0], force_reg (SFmode, CONST1_RTX (SFmode)),
+ scratch));
+ DONE;
+}")
+
+(define_insn "rsqrtsf2"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (div:SF (match_operand:SF 2 "const_1f_operand" "F,F")
+ (sqrt:SF (match_operand:SF 1 "register_operand" "0,?f"))))]
+ "TARGET_AM33_2"
+ "@
+ frsqrt %0
+ frsqrt %1, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "addsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (plus:SF (match_operand:SF 1 "register_operand" "%0,f")
+ (match_operand:SF 2 "general_operand" "f,?fF")))]
+ "TARGET_AM33_2"
+ "@
+ fadd %2, %0
+ fadd %2, %1, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "subsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (minus:SF (match_operand:SF 1 "register_operand" "0,f")
+ (match_operand:SF 2 "general_operand" "f,?fF")))]
+ "TARGET_AM33_2"
+ "@
+ fsub %2, %0
+ fsub %2, %1, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "mulsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (mult:SF (match_operand:SF 1 "register_operand" "%0,f")
+ (match_operand:SF 2 "general_operand" "f,?fF")))]
+ "TARGET_AM33_2"
+ "@
+ fmul %2, %0
+ fmul %2, %1, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "divsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (div:SF (match_operand:SF 1 "register_operand" "0,f")
+ (match_operand:SF 2 "general_operand" "f,?fF")))]
+ "TARGET_AM33_2"
+ "@
+ fdiv %2, %0
+ fdiv %2, %1, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "fmaddsf4"
+ [(set (match_operand:SF 0 "register_operand" "=A")
+ (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f")
+ (match_operand:SF 2 "register_operand" "f"))
+ (match_operand:SF 3 "register_operand" "f")))]
+ "TARGET_AM33_2"
+ "fmadd %1, %2, %3, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "fmsubsf4"
+ [(set (match_operand:SF 0 "register_operand" "=A")
+ (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f")
+ (match_operand:SF 2 "register_operand" "f"))
+ (match_operand:SF 3 "register_operand" "f")))]
+ "TARGET_AM33_2"
+ "fmsub %1, %2, %3, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "fnmaddsf4"
+ [(set (match_operand:SF 0 "register_operand" "=A")
+ (minus:SF (match_operand:SF 3 "register_operand" "f")
+ (mult:SF (match_operand:SF 1 "register_operand" "%f")
+ (match_operand:SF 2 "register_operand" "f"))))]
+ "TARGET_AM33_2"
+ "fnmadd %1, %2, %3, %0"
+ [(set_attr "cc" "none_0hit")])
+
+(define_insn "fnmsubsf4"
+ [(set (match_operand:SF 0 "register_operand" "=A")
+ (minus:SF (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "%f")
+ (match_operand:SF 2 "register_operand" "f")))
+ (match_operand:SF 3 "register_operand" "f")))]
+ "TARGET_AM33_2"
+ "fnmsub %1, %2, %3, %0"
+ [(set_attr "cc" "none_0hit")])
+
;; ----------------------------------------------------------------------
;; PROLOGUE/EPILOGUE
@@ -2202,3 +2511,134 @@
"add %0,%0\;bcc %1"
[(set_attr "cc" "clobber")])
+(define_expand "int_label"
+ [(unspec [(match_operand:SI 0 "" "")] UNSPEC_INT_LABEL)]
+ "" "")
+
+(define_expand "GOTaddr2picreg"
+ [(match_dup 0)]
+ "" "
+{
+ /* It would be nice to be able to have int_label keep track of the
+ counter and all, but if we add C code to it, we'll get an insn
+ back, and we just want the pattern. */
+ operands[0] = gen_int_label (GEN_INT (mn10300_unspec_int_label_counter++));
+ if (TARGET_AM33)
+ emit_insn (gen_am33_loadPC (operands[0]));
+ else
+ emit_insn (gen_mn10300_loadPC (operands[0]));
+ emit_insn (gen_add_GOT_to_pic_reg (operands[0]));
+ DONE;
+}
+")
+
+(define_insn "am33_loadPC"
+ [(parallel
+ [(set (reg:SI PIC_REG) (pc))
+ (use (match_operand 0 "" ""))])]
+ "TARGET_AM33"
+ "%0:\;mov pc,a2")
+
+
+(define_insn_and_split "mn10300_loadPC"
+ [(parallel
+ [(set (reg:SI PIC_REG) (pc))
+ (use (match_operand 0 "" ""))])]
+ ""
+ "#"
+ "reload_completed"
+ [(match_operand 0 "" "")]
+ "
+{
+ rtx sp_reg = gen_rtx_REG (SImode, SP_REG);
+ int need_stack_space = (get_frame_size () == 0
+ && current_function_outgoing_args_size == 0);
+
+ if (need_stack_space)
+ emit_move_insn (sp_reg, plus_constant (sp_reg, -4));
+
+ emit_insn (gen_call_next_insn (operands[0]));
+
+ if (need_stack_space)
+ emit_insn (gen_pop_pic_reg ());
+ else
+ emit_move_insn (pic_offset_table_rtx, gen_rtx_MEM (SImode, sp_reg));
+
+ DONE;
+}")
+
+(define_insn "call_next_insn"
+ [(parallel
+ [(set (mem:SI (reg:SI SP_REG)) (pc))
+ (use (match_operand 0 "" ""))])]
+ "reload_completed"
+ "calls %0\;%0:")
+
+(define_expand "add_GOT_to_pic_reg"
+ [(set (reg:SI PIC_REG)
+ (plus:SI
+ (reg:SI PIC_REG)
+ (const
+ (unspec [(minus:SI
+ (match_dup 1)
+ (const (minus:SI
+ (const (match_operand:SI 0 "" ""))
+ (pc))))
+ ] UNSPEC_PIC))))]
+ ""
+ "
+{
+ operands[1] = gen_rtx_SYMBOL_REF (VOIDmode, GOT_SYMBOL_NAME);
+}")
+
+(define_expand "symGOT2reg"
+ [(match_operand:SI 0 "" "")
+ (match_operand:SI 1 "" "")]
+ ""
+ "
+{
+ rtx insn = emit_insn (gen_symGOT2reg_i (operands[0], operands[1]));
+
+ RTX_UNCHANGING_P (SET_SRC (PATTERN (insn))) = 1;
+
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1],
+ REG_NOTES (insn));
+
+ DONE;
+}")
+
+(define_expand "symGOT2reg_i"
+ [(set (match_operand:SI 0 "" "")
+ (mem:SI (plus:SI (reg:SI PIC_REG)
+ (const (unspec [(match_operand:SI 1 "" "")]
+ UNSPEC_GOT)))))]
+ ""
+ "")
+
+(define_expand "symGOTOFF2reg"
+ [(match_operand:SI 0 "" "") (match_operand:SI 1 "" "")]
+ ""
+ "
+{
+ rtx insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1]));
+
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1],
+ REG_NOTES (insn));
+
+ DONE;
+}")
+
+(define_expand "symGOTOFF2reg_i"
+ [(set (match_operand:SI 0 "" "")
+ (const (unspec [(match_operand:SI 1 "" "")] UNSPEC_GOTOFF)))
+ (set (match_dup 0) (plus:SI (match_dup 0) (reg:SI PIC_REG)))]
+ ""
+ "")
+
+(define_expand "sym2PIC"
+ [(unspec [(match_operand:SI 0 "" "")] UNSPEC_PIC)]
+ "" "")
+
+(define_expand "sym2PLT"
+ [(unspec [(match_operand:SI 0 "" "")] UNSPEC_PLT)]
+ "" "")
diff --git a/gcc/config/mn10300/t-linux b/gcc/config/mn10300/t-linux
new file mode 100644
index 00000000000..a80c1cf4eec
--- /dev/null
+++ b/gcc/config/mn10300/t-linux
@@ -0,0 +1,11 @@
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+ cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
diff --git a/gcc/config/mn10300/t-mn10300 b/gcc/config/mn10300/t-mn10300
index 2e26e229acc..a35b2c50185 100644
--- a/gcc/config/mn10300/t-mn10300
+++ b/gcc/config/mn10300/t-mn10300
@@ -10,8 +10,8 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
-MULTILIB_OPTIONS = mam33
-MULTILIB_DIRNAMES = am33
+MULTILIB_OPTIONS = mam33/mam33-2
+MULTILIB_DIRNAMES = am33 am33-2
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/pa/elf.h b/gcc/config/pa/elf.h
index 5b35178ea91..0752e7b5b29 100644
--- a/gcc/config/pa/elf.h
+++ b/gcc/config/pa/elf.h
@@ -1,20 +1,20 @@
/* Definitions for ELF assembler support.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/fptr.c b/gcc/config/pa/fptr.c
index 680cb20c3a4..fe48edf765b 100644
--- a/gcc/config/pa/fptr.c
+++ b/gcc/config/pa/fptr.c
@@ -1,21 +1,21 @@
/* Subroutine for function pointer canonicalization on PA-RISC with ELF32.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
Contributed by John David Anglin (dave.anglin@nrc.ca).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/lib2funcs.asm b/gcc/config/pa/lib2funcs.asm
index abd69d5e130..8f5278baedb 100644
--- a/gcc/config/pa/lib2funcs.asm
+++ b/gcc/config/pa/lib2funcs.asm
@@ -2,14 +2,14 @@
; Subroutines for out of line prologues and epilogues on for the HPPA
; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
-; This file is part of GNU CC.
+; This file is part of GCC.
-; GNU CC is free software; you can redistribute it and/or modify
+; GCC is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
-; GNU CC is distributed in the hope that it will be useful,
+; GCC is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
@@ -24,7 +24,7 @@
; executable.)
; You should have received a copy of the GNU General Public License
-; along with GNU CC; see the file COPYING. If not, write to
+; along with GCC; see the file COPYING. If not, write to
; the Free Software Foundation, 59 Temple Place - Suite 330,
; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/pa/long_double.h b/gcc/config/pa/long_double.h
index 5d2c6199bc8..11504cac54a 100644
--- a/gcc/config/pa/long_double.h
+++ b/gcc/config/pa/long_double.h
@@ -1,20 +1,20 @@
/* Definitions of long double support for GNU compiler.
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/milli64.S b/gcc/config/pa/milli64.S
index 99d2d2e12a3..60eb5d210f7 100644
--- a/gcc/config/pa/milli64.S
+++ b/gcc/config/pa/milli64.S
@@ -2,12 +2,12 @@
adapted for gcc by Paul Bame <bame@debian.org>
and Alan Modra <alan@linuxcare.com.au>.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
- This file is part of GNU CC and is released under the terms of
+ This file is part of GCC and is released under the terms of
of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
- See the file COPYING in the top-level GNU CC source directory for a copy
+ See the file COPYING in the top-level GCC source directory for a copy
of the license. */
diff --git a/gcc/config/pa/pa-64.h b/gcc/config/pa/pa-64.h
index 6cb289e3b41..a76a8aab8e1 100644
--- a/gcc/config/pa/pa-64.h
+++ b/gcc/config/pa/pa-64.h
@@ -1,21 +1,21 @@
/* Definitions of target machine for GNU compiler, for HPs using the
64bit runtime model.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/pa-hpux.h b/gcc/config/pa/pa-hpux.h
index 5b99ee5aadc..bea7331d676 100644
--- a/gcc/config/pa/pa-hpux.h
+++ b/gcc/config/pa/pa-hpux.h
@@ -1,20 +1,20 @@
/* Definitions of target machine for GNU compiler, for HP-UX.
- Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1996, 2002, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -28,6 +28,12 @@ Boston, MA 02111-1307, USA. */
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
+/* GCC always defines __STDC__. HP C++ compilers don't define it. This
+ causes trouble when sys/stdsyms.h is included. As a work around,
+ we define __STDC_EXT__. A similar situation exists with respect to
+ the definition of __cplusplus. We define _INCLUDE_LONGLONG
+ to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
+ support). */
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
@@ -46,6 +52,7 @@ Boston, MA 02111-1307, USA. */
{ \
builtin_define ("_HPUX_SOURCE"); \
builtin_define ("_INCLUDE_LONGLONG"); \
+ builtin_define ("__STDC_EXT__"); \
} \
else if (!flag_iso) \
{ \
diff --git a/gcc/config/pa/pa-hpux10.h b/gcc/config/pa/pa-hpux10.h
index 78ac2afef0d..b9d06d5f642 100644
--- a/gcc/config/pa/pa-hpux10.h
+++ b/gcc/config/pa/pa-hpux10.h
@@ -1,25 +1,31 @@
/* Definitions of target machine for GNU compiler, for HP PA-RISC
- Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002
+ Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* GCC always defines __STDC__. HP C++ compilers don't define it. This
+ causes trouble when sys/stdsyms.h is included. As a work around,
+ we define __STDC_EXT__. A similar situation exists with respect to
+ the definition of __cplusplus. We define _INCLUDE_LONGLONG
+ to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
+ support). */
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
@@ -36,6 +42,7 @@ Boston, MA 02111-1307, USA. */
{ \
builtin_define ("_HPUX_SOURCE"); \
builtin_define ("_INCLUDE_LONGLONG"); \
+ builtin_define ("__STDC_EXT__"); \
} \
else if (!flag_iso) \
{ \
diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h
index 5a35ace408b..e8865dfff7f 100644
--- a/gcc/config/pa/pa-hpux11.h
+++ b/gcc/config/pa/pa-hpux11.h
@@ -1,23 +1,29 @@
/* Definitions of target machine for GNU compiler, for HP PA-RISC
Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* GCC always defines __STDC__. HP C++ compilers don't define it. This
+ causes trouble when sys/stdsyms.h is included. As a work around,
+ we define __STDC_EXT__. A similar situation exists with respect to
+ the definition of __cplusplus. We define _INCLUDE_LONGLONG
+ to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
+ support). */
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
@@ -34,6 +40,7 @@ Boston, MA 02111-1307, USA. */
{ \
builtin_define ("_HPUX_SOURCE"); \
builtin_define ("_INCLUDE_LONGLONG"); \
+ builtin_define ("__STDC_EXT__"); \
} \
else \
{ \
@@ -67,6 +74,13 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
+#undef CPP_SPEC
+#define CPP_SPEC \
+ "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
+/* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These
+ affect only aCC's C++ library (Rogue Wave-derived) which we do not
+ use, and they violate the user's name space. */
+
/* We can debug dynamically linked executables on hpux11; we also
want dereferencing of a NULL pointer to cause a SEGV. */
#undef LINK_SPEC
@@ -93,15 +107,12 @@ Boston, MA 02111-1307, USA. */
%{static:-a archive} %{shared:-b}"
#endif
-/* Like the default, except no -lg. */
+/* hpux 11 has posix threads. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{!shared:\
- %{!p:%{!pg:\
- %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
- %{threads:-lcma -lc_r}}}\
- %{p:%{!pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
- %{pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
+ %{mt|pthread:-lpthread} -lc \
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}"
/* Under hpux11, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index ed7c82bf846..027c946dba3 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -1,20 +1,20 @@
/* Definitions for PA_RISC with ELF format
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/pa-modes.def b/gcc/config/pa/pa-modes.def
index 75fba097ee0..c57c9bc4bc9 100644
--- a/gcc/config/pa/pa-modes.def
+++ b/gcc/config/pa/pa-modes.def
@@ -1,23 +1,23 @@
/* Definitions of target machine for GNU compiler, for the HP Spectrum.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support
and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for
Software Science at the University of Utah.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/pa-osf.h b/gcc/config/pa/pa-osf.h
index 74a6e588505..a824da6128d 100644
--- a/gcc/config/pa/pa-osf.h
+++ b/gcc/config/pa/pa-osf.h
@@ -1,21 +1,21 @@
/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1
- Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1996, 2002, 2003 Free Software Foundation, Inc.
Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/pa-pro-end.h b/gcc/config/pa/pa-pro-end.h
index 927f424bc50..5fc06e23e28 100644
--- a/gcc/config/pa/pa-pro-end.h
+++ b/gcc/config/pa/pa-pro-end.h
@@ -1,20 +1,20 @@
/* Definitions of target machine for GNU compiler, for PRO.
- Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2002, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index cff08c2ba1d..f5f15cb3fd3 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -1,165 +1,165 @@
/* Prototypes for pa.c functions used in the md file & elsewhere.
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef RTX_CODE
/* Prototype function used in various macros. */
-extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
+extern int symbolic_operand (rtx, enum machine_mode);
/* Used in insn-*.c. */
-extern int following_call PARAMS ((rtx));
-extern int function_label_operand PARAMS ((rtx, enum machine_mode));
-extern int lhs_lshift_cint_operand PARAMS ((rtx, enum machine_mode));
+extern int following_call (rtx);
+extern int function_label_operand (rtx, enum machine_mode);
+extern int lhs_lshift_cint_operand (rtx, enum machine_mode);
#ifdef TREE_CODE
-extern void hppa_va_start PARAMS ((tree, rtx));
-extern rtx hppa_va_arg PARAMS ((tree, tree));
+extern void hppa_va_start (tree, rtx);
+extern rtx hppa_va_arg (tree, tree);
#endif /* TREE_CODE */
-extern rtx hppa_legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
+extern rtx hppa_legitimize_address (rtx, rtx, enum machine_mode);
/* Define functions in pa.c and used in insn-output.c. */
-extern const char *output_and PARAMS ((rtx *));
-extern const char *output_ior PARAMS ((rtx *));
-extern const char *output_move_double PARAMS ((rtx *));
-extern const char *output_fp_move_double PARAMS ((rtx *));
-extern const char *output_block_move PARAMS ((rtx *, int));
-extern const char *output_cbranch PARAMS ((rtx *, int, int, int, rtx));
-extern const char *output_lbranch PARAMS ((rtx, rtx));
-extern const char *output_bb PARAMS ((rtx *, int, int, int, rtx, int));
-extern const char *output_bvb PARAMS ((rtx *, int, int, int, rtx, int));
-extern const char *output_dbra PARAMS ((rtx *, rtx, int));
-extern const char *output_movb PARAMS ((rtx *, rtx, int, int));
-extern const char *output_parallel_movb PARAMS ((rtx *, int));
-extern const char *output_parallel_addb PARAMS ((rtx *, int));
-extern const char *output_call PARAMS ((rtx, rtx, int));
-extern const char *output_indirect_call PARAMS ((rtx, rtx));
-extern const char *output_millicode_call PARAMS ((rtx, rtx));
-extern const char *output_mul_insn PARAMS ((int, rtx));
-extern const char *output_div_insn PARAMS ((rtx *, int, rtx));
-extern const char *output_mod_insn PARAMS ((int, rtx));
-extern const char *singlemove_string PARAMS ((rtx *));
-extern void output_arg_descriptor PARAMS ((rtx));
-extern void output_global_address PARAMS ((FILE *, rtx, int));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx));
-extern struct rtx_def *gen_cmp_fp PARAMS ((enum rtx_code, rtx, rtx));
-extern void hppa_encode_label PARAMS ((rtx));
-extern int arith11_operand PARAMS ((rtx, enum machine_mode));
-extern int adddi3_operand PARAMS ((rtx, enum machine_mode));
-extern int symbolic_expression_p PARAMS ((rtx));
-extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int pa_adjust_insn_length PARAMS ((rtx, int));
-extern int int11_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_cint_move_operand PARAMS ((rtx, enum machine_mode));
-extern int arith5_operand PARAMS ((rtx, enum machine_mode));
-extern int uint5_operand PARAMS ((rtx, enum machine_mode));
-extern int pic_label_operand PARAMS ((rtx, enum machine_mode));
-extern int plus_xor_ior_operator PARAMS ((rtx, enum machine_mode));
-extern int basereg_operand PARAMS ((rtx, enum machine_mode));
-extern int shadd_operand PARAMS ((rtx, enum machine_mode));
-extern int arith_operand PARAMS ((rtx, enum machine_mode));
-extern int read_only_operand PARAMS ((rtx, enum machine_mode));
-extern int move_operand PARAMS ((rtx, enum machine_mode));
-extern int and_operand PARAMS ((rtx, enum machine_mode));
-extern int ior_operand PARAMS ((rtx, enum machine_mode));
-extern int arith32_operand PARAMS ((rtx, enum machine_mode));
-extern int uint32_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_nonsymb_mem_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_before_reload_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_0_or_nonsymb_mem_operand PARAMS ((rtx, enum machine_mode));
-extern int pre_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int post_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int div_operand PARAMS ((rtx, enum machine_mode));
-extern int int5_operand PARAMS ((rtx, enum machine_mode));
-extern int movb_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int ireg_or_int5_operand PARAMS ((rtx, enum machine_mode));
-extern int fmpyaddoperands PARAMS ((rtx *));
-extern int fmpysuboperands PARAMS ((rtx *));
-extern int call_operand_address PARAMS ((rtx, enum machine_mode));
-extern int ior_operand PARAMS ((rtx, enum machine_mode));
-extern void emit_bcond_fp PARAMS ((enum rtx_code, rtx));
-extern int emit_move_sequence PARAMS ((rtx *, enum machine_mode, rtx));
-extern int emit_hpdiv_const PARAMS ((rtx *, int));
-extern int is_function_label_plus_const PARAMS ((rtx));
-extern int jump_in_call_delay PARAMS ((rtx));
-extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
- enum machine_mode, rtx));
-extern int hppa_fpstore_bypass_p PARAMS ((rtx, rtx));
-extern int attr_length_millicode_call PARAMS ((rtx));
-extern int attr_length_call PARAMS ((rtx, int));
-extern int attr_length_indirect_call PARAMS ((rtx));
-extern int attr_length_save_restore_dltp PARAMS ((rtx));
+extern const char *output_and (rtx *);
+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_cbranch (rtx *, int, int, int, rtx);
+extern const char *output_lbranch (rtx, rtx);
+extern const char *output_bb (rtx *, int, int, int, rtx, int);
+extern const char *output_bvb (rtx *, int, int, int, rtx, int);
+extern const char *output_dbra (rtx *, rtx, int);
+extern const char *output_movb (rtx *, rtx, int, int);
+extern const char *output_parallel_movb (rtx *, int);
+extern const char *output_parallel_addb (rtx *, int);
+extern const char *output_call (rtx, rtx, int);
+extern const char *output_indirect_call (rtx, rtx);
+extern const char *output_millicode_call (rtx, rtx);
+extern const char *output_mul_insn (int, rtx);
+extern const char *output_div_insn (rtx *, int, rtx);
+extern const char *output_mod_insn (int, rtx);
+extern const char *singlemove_string (rtx *);
+extern void output_arg_descriptor (rtx);
+extern void output_global_address (FILE *, rtx, int);
+extern void print_operand (FILE *, rtx, int);
+extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
+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 symbolic_expression_p (rtx);
+extern int symbolic_memory_operand (rtx, enum machine_mode);
+extern int pa_adjust_insn_length (rtx, int);
+extern int int11_operand (rtx, enum machine_mode);
+extern int reg_or_cint_move_operand (rtx, enum machine_mode);
+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 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 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);
+extern int pre_cint_operand (rtx, enum machine_mode);
+extern int post_cint_operand (rtx, enum machine_mode);
+extern int div_operand (rtx, enum machine_mode);
+extern int int5_operand (rtx, enum machine_mode);
+extern int movb_comparison_operator (rtx, enum machine_mode);
+extern int ireg_or_int5_operand (rtx, enum machine_mode);
+extern int fmpyaddoperands (rtx *);
+extern int fmpysuboperands (rtx *);
+extern int call_operand_address (rtx, enum machine_mode);
+extern int ior_operand (rtx, enum machine_mode);
+extern void emit_bcond_fp (enum rtx_code, rtx);
+extern int emit_move_sequence (rtx *, enum machine_mode, rtx);
+extern int emit_hpdiv_const (rtx *, int);
+extern int is_function_label_plus_const (rtx);
+extern int jump_in_call_delay (rtx);
+extern enum reg_class secondary_reload_class (enum reg_class,
+ enum machine_mode, rtx);
+extern int hppa_fpstore_bypass_p (rtx, rtx);
+extern int attr_length_millicode_call (rtx);
+extern int attr_length_call (rtx, int);
+extern int attr_length_indirect_call (rtx);
+extern int attr_length_save_restore_dltp (rtx);
/* Declare functions defined in pa.c and used in templates. */
-extern struct rtx_def *return_addr_rtx PARAMS ((int, rtx));
+extern struct rtx_def *return_addr_rtx (int, rtx);
-extern int fp_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int arith_double_operand PARAMS ((rtx, enum machine_mode));
-extern int ireg_operand PARAMS ((rtx, enum machine_mode));
-extern int lhs_lshift_operand PARAMS ((rtx, enum machine_mode));
-extern int pc_or_label_operand PARAMS ((rtx, enum machine_mode));
+extern int fp_reg_operand (rtx, enum machine_mode);
+extern int arith_double_operand (rtx, enum machine_mode);
+extern int ireg_operand (rtx, enum machine_mode);
+extern int lhs_lshift_operand (rtx, enum machine_mode);
+extern int pc_or_label_operand (rtx, enum machine_mode);
#ifdef ARGS_SIZE_RTX
/* expr.h defines ARGS_SIZE_RTX and `enum direction' */
#ifdef TREE_CODE
-extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree));
+extern enum direction function_arg_padding (enum machine_mode, tree);
#endif
#endif /* ARGS_SIZE_RTX */
-extern int non_hard_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int eq_neq_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int insn_refs_are_delayed PARAMS ((rtx));
+extern int non_hard_reg_operand (rtx, enum machine_mode);
+extern int eq_neq_comparison_operator (rtx, enum machine_mode);
+extern int insn_refs_are_delayed (rtx);
#endif /* RTX_CODE */
/* Prototype function used in macro CONST_OK_FOR_LETTER_P. */
-extern int zdepi_cint_p PARAMS ((unsigned HOST_WIDE_INT));
-
-extern struct rtx_def *hppa_builtin_saveregs PARAMS ((void));
-
-extern void override_options PARAMS ((void));
-extern void output_ascii PARAMS ((FILE *, const char *, int));
-extern int compute_frame_size PARAMS ((int, int *));
-extern int and_mask_p PARAMS ((unsigned HOST_WIDE_INT));
-extern int cint_ok_for_move PARAMS ((HOST_WIDE_INT));
-extern void hppa_expand_prologue PARAMS ((void));
-extern void hppa_expand_epilogue PARAMS ((void));
-extern int hppa_can_use_return_insn_p PARAMS ((void));
-extern int ior_mask_p PARAMS ((unsigned HOST_WIDE_INT));
-extern void compute_zdepdi_operands PARAMS ((unsigned HOST_WIDE_INT,
- unsigned *));
+extern int zdepi_cint_p (unsigned HOST_WIDE_INT);
+
+extern struct rtx_def *hppa_builtin_saveregs (void);
+
+extern void override_options (void);
+extern void output_ascii (FILE *, const char *, int);
+extern int compute_frame_size (int, int *);
+extern int and_mask_p (unsigned HOST_WIDE_INT);
+extern int cint_ok_for_move (HOST_WIDE_INT);
+extern void hppa_expand_prologue (void);
+extern void hppa_expand_epilogue (void);
+extern int hppa_can_use_return_insn_p (void);
+extern int ior_mask_p (unsigned HOST_WIDE_INT);
+extern void compute_zdepdi_operands (unsigned HOST_WIDE_INT,
+ unsigned *);
#ifdef RTX_CODE
-extern const char * output_64bit_and PARAMS ((rtx *));
-extern const char * output_64bit_ior PARAMS ((rtx *));
-extern int cmpib_comparison_operator PARAMS ((rtx, enum machine_mode));
+extern const char * output_64bit_and (rtx *);
+extern const char * output_64bit_ior (rtx *);
+extern int cmpib_comparison_operator (rtx, enum machine_mode);
#endif
#ifdef TREE_CODE
-extern int reloc_needed PARAMS ((tree));
+extern int reloc_needed (tree);
#ifdef RTX_CODE
-extern rtx function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode,
- tree, int));
-extern rtx function_value PARAMS ((tree, tree));
+extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int);
+extern rtx function_value (tree, tree);
#endif
-extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern int function_arg_partial_nregs (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
#endif /* TREE_CODE */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 9287583bd7d..9c207d6d591 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -3,20 +3,20 @@
2002, 2003 Free Software Foundation, Inc.
Contributed by Tim Moore (moore@cs.utah.edu), based on sparc.c
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -50,13 +50,13 @@ Boston, MA 02111-1307, USA. */
#include "target.h"
#include "target-def.h"
-static int hppa_use_dfa_pipeline_interface PARAMS ((void));
+static int hppa_use_dfa_pipeline_interface (void);
#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hppa_use_dfa_pipeline_interface
static int
-hppa_use_dfa_pipeline_interface ()
+hppa_use_dfa_pipeline_interface (void)
{
return 1;
}
@@ -64,8 +64,7 @@ hppa_use_dfa_pipeline_interface ()
/* Return nonzero if there is a bypass for the output of
OUT_INSN and the fp store IN_INSN. */
int
-hppa_fpstore_bypass_p (out_insn, in_insn)
- rtx out_insn, in_insn;
+hppa_fpstore_bypass_p (rtx out_insn, rtx in_insn)
{
enum machine_mode store_mode;
enum machine_mode other_mode;
@@ -96,56 +95,56 @@ hppa_fpstore_bypass_p (out_insn, in_insn)
#endif
#endif
-static int hppa_address_cost PARAMS ((rtx));
-static bool hppa_rtx_costs PARAMS ((rtx, int, int, int *));
-static inline rtx force_mode PARAMS ((enum machine_mode, rtx));
-static void pa_reorg PARAMS ((void));
-static void pa_combine_instructions PARAMS ((void));
-static int pa_can_combine_p PARAMS ((rtx, rtx, rtx, int, rtx, rtx, rtx));
-static int forward_branch_p PARAMS ((rtx));
-static int shadd_constant_p PARAMS ((int));
-static void compute_zdepwi_operands PARAMS ((unsigned HOST_WIDE_INT, unsigned *));
-static int compute_movstrsi_length PARAMS ((rtx));
-static bool pa_assemble_integer PARAMS ((rtx, unsigned int, int));
-static void remove_useless_addtr_insns PARAMS ((int));
-static void store_reg PARAMS ((int, int, int));
-static void store_reg_modify PARAMS ((int, int, int));
-static void load_reg PARAMS ((int, int, int));
-static void set_reg_plus_d PARAMS ((int, int, int, int));
-static void pa_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void update_total_code_bytes PARAMS ((int));
-static void pa_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static int pa_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int pa_adjust_priority PARAMS ((rtx, int));
-static int pa_issue_rate PARAMS ((void));
-static void pa_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT))
+static int hppa_address_cost (rtx);
+static bool hppa_rtx_costs (rtx, int, int, int *);
+static inline rtx force_mode (enum machine_mode, rtx);
+static void pa_reorg (void);
+static void pa_combine_instructions (void);
+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 bool pa_assemble_integer (rtx, unsigned int, int);
+static void remove_useless_addtr_insns (int);
+static void store_reg (int, int, int);
+static void store_reg_modify (int, int, int);
+static void load_reg (int, int, int);
+static void set_reg_plus_d (int, int, int, int);
+static void pa_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void update_total_code_bytes (int);
+static void pa_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static int pa_adjust_cost (rtx, rtx, rtx, int);
+static int pa_adjust_priority (rtx, int);
+static int pa_issue_rate (void);
+static void pa_select_section (tree, int, unsigned HOST_WIDE_INT)
ATTRIBUTE_UNUSED;
-static void pa_encode_section_info PARAMS ((tree, rtx, int));
-static const char *pa_strip_name_encoding PARAMS ((const char *));
-static bool pa_function_ok_for_sibcall PARAMS ((tree, tree));
-static void pa_globalize_label PARAMS ((FILE *, const char *))
+static void pa_encode_section_info (tree, rtx, int);
+static const char *pa_strip_name_encoding (const char *);
+static bool pa_function_ok_for_sibcall (tree, tree);
+static void pa_globalize_label (FILE *, const char *)
ATTRIBUTE_UNUSED;
-static void pa_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
+static void pa_asm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree);
#if !defined(USE_COLLECT2)
-static void pa_asm_out_constructor PARAMS ((rtx, int));
-static void pa_asm_out_destructor PARAMS ((rtx, int));
+static void pa_asm_out_constructor (rtx, int);
+static void pa_asm_out_destructor (rtx, int);
#endif
-static void pa_init_builtins PARAMS ((void));
-static void copy_fp_args PARAMS ((rtx)) ATTRIBUTE_UNUSED;
-static int length_fp_args PARAMS ((rtx)) ATTRIBUTE_UNUSED;
-static struct deferred_plabel *get_plabel PARAMS ((const char *))
+static void pa_init_builtins (void);
+static void copy_fp_args (rtx) ATTRIBUTE_UNUSED;
+static int length_fp_args (rtx) ATTRIBUTE_UNUSED;
+static struct deferred_plabel *get_plabel (const char *)
ATTRIBUTE_UNUSED;
-static inline void pa_file_start_level PARAMS ((void)) ATTRIBUTE_UNUSED;
-static inline void pa_file_start_space PARAMS ((int)) ATTRIBUTE_UNUSED;
-static inline void pa_file_start_file PARAMS ((int)) ATTRIBUTE_UNUSED;
-static inline void pa_file_start_mcount PARAMS ((const char*)) ATTRIBUTE_UNUSED;
-static void pa_elf_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
-static void pa_som_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
-static void pa_linux_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
-static void pa_hpux64_gas_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
-static void pa_hpux64_hpas_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
-static void output_deferred_plabels PARAMS ((void));
+static inline void pa_file_start_level (void) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_space (int) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_file (int) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_mcount (const char*) ATTRIBUTE_UNUSED;
+static void pa_elf_file_start (void) ATTRIBUTE_UNUSED;
+static void pa_som_file_start (void) ATTRIBUTE_UNUSED;
+static void pa_linux_file_start (void) ATTRIBUTE_UNUSED;
+static void pa_hpux64_gas_file_start (void) ATTRIBUTE_UNUSED;
+static void pa_hpux64_hpas_file_start (void) ATTRIBUTE_UNUSED;
+static void output_deferred_plabels (void);
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@@ -168,7 +167,7 @@ const char *pa_arch_string;
registers which were saved by the current function's prologue. */
static int gr_saved, fr_saved;
-static rtx find_addr_reg PARAMS ((rtx));
+static rtx find_addr_reg (rtx);
/* Keep track of the number of bytes we have output in the CODE subspace
during this compilation so we'll know when to emit inline long-calls. */
@@ -257,7 +256,7 @@ static size_t n_deferred_plabels = 0;
struct gcc_target targetm = TARGET_INITIALIZER;
void
-override_options ()
+override_options (void)
{
if (pa_cpu_string == NULL)
pa_cpu_string = TARGET_SCHED_DEFAULT;
@@ -366,7 +365,7 @@ override_options ()
}
static void
-pa_init_builtins ()
+pa_init_builtins (void)
{
#ifdef DONT_HAVE_FPUTC_UNLOCKED
built_in_decls[(int) BUILT_IN_FPUTC_UNLOCKED] = NULL_TREE;
@@ -377,9 +376,7 @@ pa_init_builtins ()
/* Return nonzero only if OP is a register of mode MODE,
or CONST0_RTX. */
int
-reg_or_0_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_0_operand (rtx op, enum machine_mode mode)
{
return (op == CONST0_RTX (mode) || register_operand (op, mode));
}
@@ -390,9 +387,7 @@ reg_or_0_operand (op, mode)
For 2.5 try to eliminate either call_operand_address or
function_label_operand, they perform very similar functions. */
int
-call_operand_address (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+call_operand_address (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_MODE (op) == word_mode
&& CONSTANT_P (op) && ! TARGET_PORTABLE_RUNTIME);
@@ -402,8 +397,7 @@ call_operand_address (op, mode)
expressions will have one of a few well defined forms, so
we need only check those forms. */
int
-symbolic_expression_p (x)
- register rtx x;
+symbolic_expression_p (rtx x)
{
/* Strip off any HIGH. */
@@ -414,9 +408,7 @@ symbolic_expression_p (x)
}
int
-symbolic_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -437,9 +429,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);
@@ -454,9 +444,7 @@ symbolic_memory_operand (op, mode)
not symbolic. */
int
-reg_or_nonsymb_mem_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_nonsymb_mem_operand (rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -471,9 +459,7 @@ reg_or_nonsymb_mem_operand (op, mode)
that is not symbolic. */
int
-reg_or_0_or_nonsymb_mem_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_0_or_nonsymb_mem_operand (rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -494,9 +480,7 @@ reg_or_0_or_nonsymb_mem_operand (op, mode)
if reload didn't find a hard register for the operand. */
int
-reg_before_reload_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_before_reload_operand (rtx op, enum machine_mode mode)
{
/* Don't accept a SUBREG since it will need a reload. */
if (GET_CODE (op) == SUBREG)
@@ -516,8 +500,7 @@ reg_before_reload_operand (op, mode)
/* Accept any constant that can be moved in one instruction into a
general register. */
int
-cint_ok_for_move (intval)
- HOST_WIDE_INT intval;
+cint_ok_for_move (HOST_WIDE_INT intval)
{
/* OK if ldo, ldil, or zdepi, can be used. */
return (CONST_OK_FOR_LETTER_P (intval, 'J')
@@ -528,9 +511,7 @@ cint_ok_for_move (intval)
/* Accept anything that can be moved in one instruction into a general
register. */
int
-move_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_operand (rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -581,9 +562,7 @@ move_operand (op, mode)
/* Accept REG and any CONST_INT that can be moved in one instruction into a
general register. */
int
-reg_or_cint_move_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_cint_move_operand (rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -595,9 +574,7 @@ reg_or_cint_move_operand (op, mode)
}
int
-pic_label_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+pic_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (!flag_pic)
return 0;
@@ -616,9 +593,7 @@ pic_label_operand (op, mode)
}
int
-fp_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+fp_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return reg_renumber && FP_REG_P (op);
}
@@ -629,9 +604,7 @@ fp_reg_operand (op, mode)
three operand arithmetic insn that accepts registers of mode MODE
or 14-bit signed integers. */
int
-arith_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT && INT_14_BITS (op)));
@@ -641,9 +614,7 @@ arith_operand (op, mode)
three operand arithmetic insn that accepts registers of mode MODE
or 11-bit signed integers. */
int
-arith11_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith11_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT && INT_11_BITS (op)));
@@ -652,9 +623,7 @@ arith11_operand (op, mode)
/* Return truth value of whether OP can be used as an operand in a
adddi3 insn. */
int
-adddi3_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+adddi3_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
@@ -664,9 +633,7 @@ adddi3_operand (op, mode)
/* A constant integer suitable for use in a PRE_MODIFY memory
reference. */
int
-pre_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+pre_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) >= -0x2000 && INTVAL (op) < 0x10);
@@ -675,18 +642,14 @@ pre_cint_operand (op, mode)
/* A constant integer suitable for use in a POST_MODIFY memory
reference. */
int
-post_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+post_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) < 0x2000 && INTVAL (op) >= -0x10);
}
int
-arith_double_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith_double_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_DOUBLE
@@ -701,9 +664,7 @@ arith_double_operand (op, mode)
is an integer register. */
int
-ireg_or_int5_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ireg_or_int5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ((GET_CODE (op) == CONST_INT && INT_5_BITS (op))
|| (GET_CODE (op) == REG && REGNO (op) > 0 && REGNO (op) < 32));
@@ -711,9 +672,7 @@ ireg_or_int5_operand (op, mode)
/* Return nonzero if OP is an integer register, else return zero. */
int
-ireg_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ireg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == REG && REGNO (op) > 0 && REGNO (op) < 32);
}
@@ -722,33 +681,25 @@ ireg_operand (op, mode)
range constraining immediate operands in three-address insns. */
int
-int5_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && INT_5_BITS (op));
}
int
-uint5_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+uint5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && INT_U5_BITS (op));
}
int
-int11_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int11_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && INT_11_BITS (op));
}
int
-uint32_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+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. */
@@ -762,9 +713,7 @@ uint32_operand (op, mode)
}
int
-arith5_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith5_operand (rtx op, enum machine_mode mode)
{
return register_operand (op, mode) || int5_operand (op, mode);
}
@@ -773,8 +722,7 @@ arith5_operand (op, mode)
zdepi first sign extends a 5 bit signed number to a given field
length, then places this field anywhere in a zero. */
int
-zdepi_cint_p (x)
- unsigned HOST_WIDE_INT x;
+zdepi_cint_p (unsigned HOST_WIDE_INT x)
{
unsigned HOST_WIDE_INT lsb_mask, t;
@@ -792,8 +740,7 @@ zdepi_cint_p (x)
1....10....0
1..10..01..1 */
int
-and_mask_p (mask)
- unsigned HOST_WIDE_INT mask;
+and_mask_p (unsigned HOST_WIDE_INT mask)
{
mask = ~mask;
mask += mask & -mask;
@@ -802,9 +749,7 @@ and_mask_p (mask)
/* True iff depi or extru can be used to compute (reg & OP). */
int
-and_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+and_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT && and_mask_p (INTVAL (op))));
@@ -812,8 +757,7 @@ and_operand (op, mode)
/* True iff depi can be used to compute (reg | MASK). */
int
-ior_mask_p (mask)
- unsigned HOST_WIDE_INT mask;
+ior_mask_p (unsigned HOST_WIDE_INT mask)
{
mask += mask & -mask;
return (mask & (mask - 1)) == 0;
@@ -821,17 +765,13 @@ ior_mask_p (mask)
/* True iff depi can be used to compute (reg | OP). */
int
-ior_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ior_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && ior_mask_p (INTVAL (op)));
}
int
-lhs_lshift_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+lhs_lshift_operand (rtx op, enum machine_mode mode)
{
return register_operand (op, mode) || lhs_lshift_cint_operand (op, mode);
}
@@ -840,9 +780,7 @@ lhs_lshift_operand (op, mode)
Such values can be the left hand side x in (x << r), using the zvdepi
instruction. */
int
-lhs_lshift_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+lhs_lshift_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
unsigned HOST_WIDE_INT x;
if (GET_CODE (op) != CONST_INT)
@@ -852,17 +790,13 @@ lhs_lshift_cint_operand (op, mode)
}
int
-arith32_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith32_operand (rtx op, enum machine_mode mode)
{
return register_operand (op, mode) || GET_CODE (op) == CONST_INT;
}
int
-pc_or_label_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+pc_or_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == PC || GET_CODE (op) == LABEL_REF);
}
@@ -873,9 +807,7 @@ pc_or_label_operand (op, mode)
than one register, we lose. */
rtx
-legitimize_pic_address (orig, mode, reg)
- rtx orig, reg;
- enum machine_mode mode;
+legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
{
rtx pic_ref = orig;
@@ -997,9 +929,8 @@ legitimize_pic_address (orig, mode, reg)
a register. */
rtx
-hppa_legitimize_address (x, oldx, mode)
- rtx x, oldx ATTRIBUTE_UNUSED;
- enum machine_mode mode;
+hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
+ enum machine_mode mode)
{
rtx orig = x;
@@ -1347,8 +1278,7 @@ hppa_legitimize_address (x, oldx, mode)
as GO_IF_LEGITIMATE_ADDRESS. */
static int
-hppa_address_cost (X)
- rtx X;
+hppa_address_cost (rtx X)
{
switch (GET_CODE (X))
{
@@ -1368,10 +1298,7 @@ hppa_address_cost (X)
scanned. In either case, *TOTAL contains the cost result. */
static bool
-hppa_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+hppa_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
@@ -1447,9 +1374,7 @@ hppa_rtx_costs (x, code, outer_code, total)
/* Ensure mode of ORIG, a REG rtx, is MODE. Returns either ORIG or a
new rtx with the correct mode. */
static inline rtx
-force_mode (mode, orig)
- enum machine_mode mode;
- rtx orig;
+force_mode (enum machine_mode mode, rtx orig)
{
if (mode == GET_MODE (orig))
return orig;
@@ -1471,10 +1396,7 @@ force_mode (mode, orig)
of SCRATCH_REG in the proper mode. */
int
-emit_move_sequence (operands, mode, scratch_reg)
- rtx *operands;
- enum machine_mode mode;
- rtx scratch_reg;
+emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
{
register rtx operand0 = operands[0];
register rtx operand1 = operands[1];
@@ -1966,8 +1888,7 @@ emit_move_sequence (operands, mode, scratch_reg)
it will need a link/runtime reloc). */
int
-reloc_needed (exp)
- tree exp;
+reloc_needed (tree exp)
{
int reloc = 0;
@@ -2011,9 +1932,7 @@ reloc_needed (exp)
will be true. */
int
-read_only_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+read_only_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (operand) == CONST)
operand = XEXP (XEXP (operand, 0), 0);
@@ -2034,8 +1953,7 @@ read_only_operand (operand, mode)
/* Return the best assembler insn template
for moving operands[1] into operands[0] as a fullword. */
const char *
-singlemove_string (operands)
- rtx *operands;
+singlemove_string (rtx *operands)
{
HOST_WIDE_INT intval;
@@ -2080,9 +1998,7 @@ singlemove_string (operands)
useful for copying IMM to a register using the zdepi
instructions. Store the immediate value to insert in OP[0]. */
static void
-compute_zdepwi_operands (imm, op)
- unsigned HOST_WIDE_INT imm;
- unsigned *op;
+compute_zdepwi_operands (unsigned HOST_WIDE_INT imm, unsigned *op)
{
int lsb, len;
@@ -2119,9 +2035,7 @@ compute_zdepwi_operands (imm, op)
useful for copying IMM to a register using the depdi,z
instructions. Store the immediate value to insert in OP[0]. */
void
-compute_zdepdi_operands (imm, op)
- unsigned HOST_WIDE_INT imm;
- unsigned *op;
+compute_zdepdi_operands (unsigned HOST_WIDE_INT imm, unsigned *op)
{
HOST_WIDE_INT lsb, len;
@@ -2159,8 +2073,7 @@ compute_zdepdi_operands (imm, op)
with operands OPERANDS. */
const char *
-output_move_double (operands)
- rtx *operands;
+output_move_double (rtx *operands)
{
enum { REGOP, OFFSOP, MEMOP, CNSTOP, RNDOP } optype0, optype1;
rtx latehalf[2];
@@ -2435,8 +2348,7 @@ output_move_double (operands)
}
const char *
-output_fp_move_double (operands)
- rtx *operands;
+output_fp_move_double (rtx *operands)
{
if (FP_REG_P (operands[0]))
{
@@ -2474,8 +2386,7 @@ output_fp_move_double (operands)
ADDR can be effectively incremented by incrementing REG. */
static rtx
-find_addr_reg (addr)
- rtx addr;
+find_addr_reg (rtx addr)
{
while (GET_CODE (addr) == PLUS)
{
@@ -2506,9 +2417,7 @@ find_addr_reg (addr)
OPERANDS[6] is another temporary register. */
const char *
-output_block_move (operands, size_is_constant)
- rtx *operands;
- int size_is_constant ATTRIBUTE_UNUSED;
+output_block_move (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED)
{
int align = INTVAL (operands[5]);
unsigned long n_bytes = INTVAL (operands[4]);
@@ -2607,8 +2516,7 @@ output_block_move (operands, size_is_constant)
count insns rather than emit them. */
static int
-compute_movstrsi_length (insn)
- rtx insn;
+compute_movstrsi_length (rtx insn)
{
rtx pat = PATTERN (insn);
unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 7), 0));
@@ -2639,8 +2547,7 @@ compute_movstrsi_length (insn)
const char *
-output_and (operands)
- rtx *operands;
+output_and (rtx *operands)
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
{
@@ -2692,8 +2599,7 @@ output_and (operands)
/* Return a string to perform a bitwise-and of operands[1] with operands[2]
storing the result in operands[0]. */
const char *
-output_64bit_and (operands)
- rtx *operands;
+output_64bit_and (rtx *operands)
{
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
{
@@ -2743,8 +2649,7 @@ output_64bit_and (operands)
}
const char *
-output_ior (operands)
- rtx *operands;
+output_ior (rtx *operands)
{
unsigned HOST_WIDE_INT mask = INTVAL (operands[2]);
int bs0, bs1, p, len;
@@ -2774,8 +2679,7 @@ output_ior (operands)
/* Return a string to perform a bitwise-and of operands[1] with operands[2]
storing the result in operands[0]. */
const char *
-output_64bit_ior (operands)
- rtx *operands;
+output_64bit_ior (rtx *operands)
{
unsigned HOST_WIDE_INT mask = INTVAL (operands[2]);
int bs0, bs1, p, len;
@@ -2808,10 +2712,7 @@ output_64bit_ior (operands)
be preceded by P%. */
static bool
-pa_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+pa_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if (size == UNITS_PER_WORD && aligned_p
&& function_label_operand (x, VOIDmode))
@@ -2826,10 +2727,7 @@ pa_assemble_integer (x, size, aligned_p)
/* Output an ascii string. */
void
-output_ascii (file, p, size)
- FILE *file;
- const char *p;
- int size;
+output_ascii (FILE *file, const char *p, int size)
{
int i;
int chars_output;
@@ -2896,8 +2794,7 @@ output_ascii (file, p, size)
when there's a 1:1 correspondence between fcmp and ftest/fbranch
instructions. */
static void
-remove_useless_addtr_insns (check_notes)
- int check_notes;
+remove_useless_addtr_insns (int check_notes)
{
rtx insn;
static int pass = 0;
@@ -3108,8 +3005,7 @@ static int local_fsize, save_fregs;
in %r1. There is code in expand_hppa_{prologue,epilogue} that knows this.*/
static void
-store_reg (reg, disp, base)
- int reg, disp, base;
+store_reg (int reg, int disp, int base)
{
rtx insn, dest, src, basereg;
@@ -3149,8 +3045,7 @@ store_reg (reg, disp, base)
add MOD to BASE. MOD must be <= 8k. */
static void
-store_reg_modify (base, reg, mod)
- int base, reg, mod;
+store_reg_modify (int base, int reg, int mod)
{
rtx insn, basereg, srcreg, delta;
@@ -3197,8 +3092,7 @@ store_reg_modify (base, reg, mod)
There is code in expand_hppa_{prologue,epilogue} that knows about this. */
static void
-set_reg_plus_d (reg, base, disp, note)
- int reg, base, disp, note;
+set_reg_plus_d (int reg, int base, int disp, int note)
{
rtx insn;
@@ -3225,9 +3119,7 @@ set_reg_plus_d (reg, base, disp, note)
}
int
-compute_frame_size (size, fregs_live)
- int size;
- int *fregs_live;
+compute_frame_size (int size, int *fregs_live)
{
int freg_saved = 0;
int i, j;
@@ -3320,9 +3212,7 @@ compute_frame_size (size, fregs_live)
to do this is made in regclass.c. */
static void
-pa_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+pa_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
/* The function's label and associated .PROC must never be
separated and must be output *after* any profiling declarations
@@ -3371,7 +3261,7 @@ pa_output_function_prologue (file, size)
}
void
-hppa_expand_prologue ()
+hppa_expand_prologue (void)
{
int merge_sp_adjust_with_store = 0;
int size = get_frame_size ();
@@ -3664,8 +3554,7 @@ hppa_expand_prologue ()
Handle case where DISP > 8k by using the add_high_const patterns. */
static void
-load_reg (reg, disp, base)
- int reg, disp, base;
+load_reg (int reg, int disp, int base)
{
rtx src, dest, basereg;
@@ -3690,11 +3579,10 @@ load_reg (reg, disp, base)
/* Update the total code bytes output to the text section. */
static void
-update_total_code_bytes (nbytes)
- int nbytes;
+update_total_code_bytes (int nbytes)
{
if ((TARGET_PORTABLE_RUNTIME || !TARGET_GAS || !TARGET_SOM)
- && in_text_section ())
+ && !IN_NAMED_SECTION_P (cfun->decl))
{
if (INSN_ADDRESSES_SET_P ())
{
@@ -3720,9 +3608,7 @@ update_total_code_bytes (nbytes)
adjustments before returning. */
static void
-pa_output_function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
rtx insn = get_last_insn ();
@@ -3770,7 +3656,7 @@ pa_output_function_epilogue (file, size)
}
void
-hppa_expand_epilogue ()
+hppa_expand_epilogue (void)
{
rtx tmpreg;
int offset, i;
@@ -3946,14 +3832,13 @@ hppa_expand_epilogue ()
}
rtx
-hppa_pic_save_rtx ()
+hppa_pic_save_rtx (void)
{
return get_hard_reg_initial_val (word_mode, PIC_OFFSET_TABLE_REGNUM);
}
void
-hppa_profile_hook (label_no)
- int label_no;
+hppa_profile_hook (int label_no)
{
rtx begin_label_rtx, call_insn;
char begin_label_name[16];
@@ -4039,9 +3924,7 @@ hppa_profile_hook (label_no)
return location is in a shared library. */
rtx
-return_addr_rtx (count, frameaddr)
- int count;
- rtx frameaddr;
+return_addr_rtx (int count, rtx frameaddr)
{
rtx label;
rtx rp;
@@ -4120,7 +4003,7 @@ return_addr_rtx (count, frameaddr)
It's only valid if %r2 hasn't been saved into the caller's frame
(we're not profiling and %r2 isn't live anywhere). */
int
-hppa_can_use_return_insn_p ()
+hppa_can_use_return_insn_p (void)
{
return (reload_completed
&& (compute_frame_size (get_frame_size (), 0) ? 0 : 1)
@@ -4129,9 +4012,7 @@ hppa_can_use_return_insn_p ()
}
void
-emit_bcond_fp (code, operand0)
- enum rtx_code code;
- rtx operand0;
+emit_bcond_fp (enum rtx_code code, rtx operand0)
{
emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
gen_rtx_IF_THEN_ELSE (VOIDmode,
@@ -4145,9 +4026,7 @@ emit_bcond_fp (code, operand0)
}
rtx
-gen_cmp_fp (code, operand0, operand1)
- enum rtx_code code;
- rtx operand0, operand1;
+gen_cmp_fp (enum rtx_code code, rtx operand0, rtx operand1)
{
return gen_rtx_SET (VOIDmode, gen_rtx_REG (CCFPmode, 0),
gen_rtx_fmt_ee (code, CCFPmode, operand0, operand1));
@@ -4157,11 +4036,7 @@ gen_cmp_fp (code, operand0, operand1)
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
static int
-pa_adjust_cost (insn, link, dep_insn, cost)
- rtx insn;
- rtx link;
- rtx dep_insn;
- int cost;
+pa_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
{
enum attr_type attr_type;
@@ -4349,9 +4224,7 @@ pa_adjust_cost (insn, link, dep_insn, cost)
/* Adjust scheduling priorities. We use this to try and keep addil
and the next use of %r1 close together. */
static int
-pa_adjust_priority (insn, priority)
- rtx insn;
- int priority;
+pa_adjust_priority (rtx insn, int priority)
{
rtx set = single_set (insn);
rtx src, dest;
@@ -4383,7 +4256,7 @@ pa_adjust_priority (insn, priority)
The 7XXX processors can issue two insns at a time.
The 8000 can issue 4 insns at a time. */
static int
-pa_issue_rate ()
+pa_issue_rate (void)
{
switch (pa_cpu)
{
@@ -4411,29 +4284,13 @@ pa_issue_rate ()
Also compute the length of an inline block move here as it is too
complicated to express as a length attribute in pa.md. */
int
-pa_adjust_insn_length (insn, length)
- rtx insn;
- int length;
+pa_adjust_insn_length (rtx insn, int length)
{
rtx pat = PATTERN (insn);
- /* Call insns which are *not* indirect and have unfilled delay slots. */
- if (GET_CODE (insn) == CALL_INSN)
- {
-
- if (GET_CODE (XVECEXP (pat, 0, 0)) == CALL
- && GET_CODE (XEXP (XEXP (XVECEXP (pat, 0, 0), 0), 0)) == SYMBOL_REF)
- return 4;
- else if (GET_CODE (XVECEXP (pat, 0, 0)) == SET
- && GET_CODE (XEXP (XEXP (XEXP (XVECEXP (pat, 0, 0), 1), 0), 0))
- == SYMBOL_REF)
- return 4;
- else
- return 0;
- }
- /* Jumps inside switch tables which have unfilled delay slots
- also need adjustment. */
- else if (GET_CODE (insn) == JUMP_INSN
+ /* Jumps inside switch tables which have unfilled delay slots need
+ adjustment. */
+ if (GET_CODE (insn) == JUMP_INSN
&& simplejump_p (insn)
&& GET_MODE (insn) == SImode)
return 4;
@@ -4486,10 +4343,7 @@ pa_adjust_insn_length (insn, length)
For `%' followed by punctuation, CODE is the punctuation and X is null. */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
switch (code)
{
@@ -4854,10 +4708,7 @@ print_operand (file, x, code)
/* output a SYMBOL_REF or a CONST expression involving a SYMBOL_REF. */
void
-output_global_address (file, x, round_constant)
- FILE *file;
- rtx x;
- int round_constant;
+output_global_address (FILE *file, rtx x, int round_constant)
{
/* Imagine (high (const (plus ...))). */
@@ -4935,7 +4786,7 @@ output_global_address (file, x, round_constant)
There are several possible versions. */
#define aputs(x) fputs(x, asm_out_file)
static inline void
-pa_file_start_level ()
+pa_file_start_level (void)
{
if (TARGET_64BIT)
aputs ("\t.LEVEL 2.0w\n");
@@ -4948,8 +4799,7 @@ pa_file_start_level ()
}
static inline void
-pa_file_start_space (sortspace)
- int sortspace;
+pa_file_start_space (int sortspace)
{
aputs ("\t.SPACE $PRIVATE$");
if (sortspace)
@@ -4964,8 +4814,7 @@ pa_file_start_space (sortspace)
}
static inline void
-pa_file_start_file (want_version)
- int want_version;
+pa_file_start_file (int want_version)
{
if (write_symbols != NO_DEBUG)
{
@@ -4976,15 +4825,14 @@ pa_file_start_file (want_version)
}
static inline void
-pa_file_start_mcount (aswhat)
- const char *aswhat;
+pa_file_start_mcount (const char *aswhat)
{
if (profile_flag)
fprintf (asm_out_file, "\t.IMPORT _mcount,%s\n", aswhat);
}
static void
-pa_elf_file_start ()
+pa_elf_file_start (void)
{
pa_file_start_level ();
pa_file_start_mcount ("ENTRY");
@@ -4992,7 +4840,7 @@ pa_elf_file_start ()
}
static void
-pa_som_file_start ()
+pa_som_file_start (void)
{
pa_file_start_level ();
pa_file_start_space (0);
@@ -5003,7 +4851,7 @@ pa_som_file_start ()
}
static void
-pa_linux_file_start ()
+pa_linux_file_start (void)
{
pa_file_start_file (1);
pa_file_start_level ();
@@ -5011,7 +4859,7 @@ pa_linux_file_start ()
}
static void
-pa_hpux64_gas_file_start ()
+pa_hpux64_gas_file_start (void)
{
pa_file_start_level ();
#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
@@ -5022,7 +4870,7 @@ pa_hpux64_gas_file_start ()
}
static void
-pa_hpux64_hpas_file_start ()
+pa_hpux64_hpas_file_start (void)
{
pa_file_start_level ();
pa_file_start_space (1);
@@ -5032,8 +4880,7 @@ pa_hpux64_hpas_file_start ()
#undef aputs
static struct deferred_plabel *
-get_plabel (fname)
- const char *fname;
+get_plabel (const char *fname)
{
size_t i;
@@ -5073,7 +4920,7 @@ get_plabel (fname)
}
static void
-output_deferred_plabels ()
+output_deferred_plabels (void)
{
size_t i;
/* If we have deferred plabels, then we need to switch into the data
@@ -5099,15 +4946,14 @@ output_deferred_plabels ()
Keep track of which ones we have used. */
enum millicodes { remI, remU, divI, divU, mulI, end1000 };
-static void import_milli PARAMS ((enum millicodes));
+static void import_milli (enum millicodes);
static char imported[(int) end1000];
static const char * const milli_names[] = {"remI", "remU", "divI", "divU", "mulI"};
static const char import_string[] = ".IMPORT $$....,MILLICODE";
#define MILLI_START 10
static void
-import_milli (code)
- enum millicodes code;
+import_milli (enum millicodes code)
{
char str[sizeof (import_string)];
@@ -5124,9 +4970,7 @@ import_milli (code)
the proper registers. */
const char *
-output_mul_insn (unsignedp, insn)
- int unsignedp ATTRIBUTE_UNUSED;
- rtx insn;
+output_mul_insn (int unsignedp ATTRIBUTE_UNUSED, rtx insn)
{
import_milli (mulI);
return output_millicode_call (insn, gen_rtx_SYMBOL_REF (Pmode, "$$mulI"));
@@ -5145,9 +4989,7 @@ static const int magic_milli[]= {0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0,
static int div_milli[16][2];
int
-div_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+div_operand (rtx op, enum machine_mode mode)
{
return (mode == SImode
&& ((GET_CODE (op) == REG && REGNO (op) == 25)
@@ -5156,9 +4998,7 @@ div_operand (op, mode)
}
int
-emit_hpdiv_const (operands, unsignedp)
- rtx *operands;
- int unsignedp;
+emit_hpdiv_const (rtx *operands, int unsignedp)
{
if (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) > 0
@@ -5188,10 +5028,7 @@ emit_hpdiv_const (operands, unsignedp)
}
const char *
-output_div_insn (operands, unsignedp, insn)
- rtx *operands;
- int unsignedp;
- rtx insn;
+output_div_insn (rtx *operands, int unsignedp, rtx insn)
{
int divisor;
@@ -5245,9 +5082,7 @@ output_div_insn (operands, unsignedp, insn)
/* Output a $$rem millicode to do mod. */
const char *
-output_mod_insn (unsignedp, insn)
- int unsignedp;
- rtx insn;
+output_mod_insn (int unsignedp, rtx insn)
{
if (unsignedp)
{
@@ -5264,8 +5099,7 @@ output_mod_insn (unsignedp, insn)
}
void
-output_arg_descriptor (call_insn)
- rtx call_insn;
+output_arg_descriptor (rtx call_insn)
{
const char *arg_regs[4];
enum machine_mode arg_mode;
@@ -5349,10 +5183,7 @@ output_arg_descriptor (call_insn)
It might be worthwhile to try and make this a leaf function too. */
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)
{
int regno, is_symbolic;
@@ -5440,9 +5271,7 @@ secondary_reload_class (class, mode, in)
}
enum direction
-function_arg_padding (mode, type)
- enum machine_mode mode;
- tree type;
+function_arg_padding (enum machine_mode mode, tree type)
{
if (mode == BLKmode
|| (TARGET_64BIT && type && AGGREGATE_TYPE_P (type)))
@@ -5481,7 +5310,7 @@ function_arg_padding (mode, type)
va_list. A pointer to this constructor is returned. */
struct rtx_def *
-hppa_builtin_saveregs ()
+hppa_builtin_saveregs (void)
{
rtx offset, dest;
tree fntype = TREE_TYPE (current_function_decl);
@@ -5550,17 +5379,14 @@ hppa_builtin_saveregs ()
}
void
-hppa_va_start (valist, nextarg)
- tree valist;
- rtx nextarg;
+hppa_va_start (tree valist, rtx nextarg)
{
nextarg = expand_builtin_saveregs ();
std_expand_builtin_va_start (valist, nextarg);
}
rtx
-hppa_va_arg (valist, type)
- tree valist, type;
+hppa_va_arg (tree valist, tree type)
{
HOST_WIDE_INT size = int_size_in_bytes (type);
HOST_WIDE_INT ofs;
@@ -5668,10 +5494,7 @@ hppa_va_arg (valist, type)
parameters. */
const char *
-output_cbranch (operands, nullify, length, negated, insn)
- rtx *operands;
- int nullify, length, negated;
- rtx insn;
+output_cbranch (rtx *operands, int nullify, int length, int negated, rtx insn)
{
static char buf[100];
int useskip = 0;
@@ -5856,8 +5679,7 @@ output_cbranch (operands, nullify, length, negated, insn)
maximum range of a simple branch instruction. */
const char *
-output_lbranch (dest, insn)
- rtx dest, insn;
+output_lbranch (rtx dest, rtx insn)
{
rtx xoperands[2];
@@ -5975,11 +5797,8 @@ output_lbranch (dest, insn)
above. it returns the appropriate output template to emit the branch. */
const char *
-output_bb (operands, nullify, length, negated, insn, which)
- rtx *operands ATTRIBUTE_UNUSED;
- int nullify, length, negated;
- rtx insn;
- int which;
+output_bb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length,
+ int negated, rtx insn, int which)
{
static char buf[100];
int useskip = 0;
@@ -6123,11 +5942,8 @@ output_bb (operands, nullify, length, negated, insn, which)
branch. */
const char *
-output_bvb (operands, nullify, length, negated, insn, which)
- rtx *operands ATTRIBUTE_UNUSED;
- int nullify, length, negated;
- rtx insn;
- int which;
+output_bvb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length,
+ int negated, rtx insn, int which)
{
static char buf[100];
int useskip = 0;
@@ -6269,10 +6085,7 @@ output_bvb (operands, nullify, length, negated, insn, which)
Note it may perform some output operations on its own before
returning the final output string. */
const char *
-output_dbra (operands, insn, which_alternative)
- rtx *operands;
- rtx insn;
- int which_alternative;
+output_dbra (rtx *operands, rtx insn, int which_alternative)
{
/* A conditional branch to the following instruction (eg the delay slot) is
@@ -6375,11 +6188,8 @@ output_dbra (operands, insn, which_alternative)
Note it may perform some output operations on its own before
returning the final output string. */
const char *
-output_movb (operands, insn, which_alternative, reverse_comparison)
- rtx *operands;
- rtx insn;
- int which_alternative;
- int reverse_comparison;
+output_movb (rtx *operands, rtx insn, int which_alternative,
+ int reverse_comparison)
{
/* A conditional branch to the following instruction (eg the delay slot) is
@@ -6485,8 +6295,7 @@ output_movb (operands, insn, which_alternative, reverse_comparison)
/* Copy any FP arguments in INSN into integer registers. */
static void
-copy_fp_args (insn)
- rtx insn;
+copy_fp_args (rtx insn)
{
rtx link;
rtx xoperands[2];
@@ -6529,8 +6338,7 @@ copy_fp_args (insn)
/* Compute length of the FP argument copy sequence for INSN. */
static int
-length_fp_args (insn)
- rtx insn;
+length_fp_args (rtx insn)
{
int length = 0;
rtx link;
@@ -6567,11 +6375,10 @@ length_fp_args (insn)
over estimate the length than to under estimate it. */
int
-attr_length_millicode_call (insn)
- rtx insn;
+attr_length_millicode_call (rtx insn)
{
unsigned long distance = -1;
- unsigned long total = in_text_section () ? total_code_bytes : 0;
+ unsigned long total = IN_NAMED_SECTION_P (cfun->decl) ? 0 : total_code_bytes;
if (INSN_ADDRESSES_SET_P ())
{
@@ -6607,9 +6414,7 @@ attr_length_millicode_call (insn)
CALL_DEST is the routine we are calling. */
const char *
-output_millicode_call (insn, call_dest)
- rtx insn;
- rtx call_dest;
+output_millicode_call (rtx insn, rtx call_dest)
{
int attr_length = get_attr_length (insn);
int seq_length = dbr_sequence_length ();
@@ -6758,73 +6563,93 @@ output_millicode_call (insn, call_dest)
/* Return the attribute length of the call instruction INSN. The SIBCALL
flag indicates whether INSN is a regular call or a sibling call. The
- length must match the code generated by output_call. We include the delay
- slot in the returned length as it is better to over estimate the length
- than to under estimate it. */
+ length returned must be longer than the code actually generated by
+ output_call. Since branch shortening is done before delay branch
+ sequencing, there is no way to determine whether or not the delay
+ slot will be filled during branch shortening. Even when the delay
+ slot is filled, we may have to add a nop if the delay slot contains
+ a branch that can't reach its target. Thus, we always have to include
+ the delay slot in the length estimate. This used to be done in
+ pa_adjust_insn_length but we do it here now as some sequences always
+ fill the delay slot and we can save four bytes in the estimate for
+ these sequences. */
int
-attr_length_call (insn, sibcall)
- rtx insn;
- int sibcall;
+attr_length_call (rtx insn, int sibcall)
{
+ int local_call;
+ rtx call_dest;
+ tree call_decl;
+ int length = 0;
+ rtx pat = PATTERN (insn);
unsigned long distance = -1;
- unsigned long total = in_text_section ()? total_code_bytes : 0;
if (INSN_ADDRESSES_SET_P ())
{
+ unsigned long total;
+
+ total = IN_NAMED_SECTION_P (cfun->decl) ? 0 : total_code_bytes;
distance = (total + insn_current_reference_address (insn));
if (distance < total)
distance = -1;
}
- if (TARGET_64BIT)
- {
- if (!TARGET_LONG_CALLS
- && ((!sibcall && distance < 7600000) || distance < 240000))
- return 8;
-
- return (sibcall ? 28 : 24);
- }
+ /* Determine if this is a local call. */
+ if (GET_CODE (XVECEXP (pat, 0, 0)) == CALL)
+ call_dest = XEXP (XEXP (XVECEXP (pat, 0, 0), 0), 0);
else
- {
- if (!TARGET_LONG_CALLS
- && ((TARGET_PA_20 && !sibcall && distance < 7600000)
- || distance < 240000))
- return 8;
+ call_dest = XEXP (XEXP (XEXP (XVECEXP (pat, 0, 0), 1), 0), 0);
- if (TARGET_LONG_ABS_CALL && !flag_pic)
- return 12;
+ call_decl = SYMBOL_REF_DECL (call_dest);
+ local_call = call_decl && (*targetm.binds_local_p) (call_decl);
- if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
- || (TARGET_GAS && TARGET_LONG_PIC_PCREL_CALL))
- {
- if (TARGET_PA_20)
- return 20;
+ /* pc-relative branch. */
+ if (!TARGET_LONG_CALLS
+ && ((TARGET_PA_20 && !sibcall && distance < 7600000)
+ || distance < 240000))
+ length += 8;
- return 28;
- }
- else
- {
- int length = 0;
+ /* 64-bit plabel sequence. */
+ else if (TARGET_64BIT && !local_call)
+ length += sibcall ? 28 : 24;
- if (TARGET_SOM)
- length += length_fp_args (insn);
+ /* non-pic long absolute branch sequence. */
+ else if ((TARGET_LONG_ABS_CALL || local_call) && !flag_pic)
+ length += 12;
- if (flag_pic)
- length += 4;
+ /* long pc-relative branch sequence. */
+ else if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
+ || (TARGET_64BIT && !TARGET_GAS)
+ || (TARGET_GAS && (TARGET_LONG_PIC_PCREL_CALL || local_call)))
+ {
+ length += 20;
- if (TARGET_PA_20)
- return (length + 32);
+ if (!TARGET_PA_20 && !TARGET_NO_SPACE_REGS)
+ length += 8;
+ }
- if (!TARGET_NO_SPACE_REGS)
- length += 8;
+ /* 32-bit plabel sequence. */
+ else
+ {
+ length += 32;
+
+ if (TARGET_SOM)
+ length += length_fp_args (insn);
+
+ if (flag_pic)
+ length += 4;
+ if (!TARGET_PA_20)
+ {
if (!sibcall)
length += 8;
- return (length + 32);
+ if (!TARGET_NO_SPACE_REGS)
+ length += 8;
}
}
+
+ return length;
}
/* INSN is a function call. It may have an unconditional jump
@@ -6833,16 +6658,13 @@ attr_length_call (insn, sibcall)
CALL_DEST is the routine we are calling. */
const char *
-output_call (insn, call_dest, sibcall)
- rtx insn;
- rtx call_dest;
- int sibcall;
+output_call (rtx insn, rtx call_dest, int sibcall)
{
int delay_insn_deleted = 0;
int delay_slot_filled = 0;
int seq_length = dbr_sequence_length ();
tree call_decl = SYMBOL_REF_DECL (call_dest);
- int local_call = call_decl && !TREE_PUBLIC (call_decl);
+ int local_call = call_decl && (*targetm.binds_local_p) (call_decl);
rtx xoperands[2];
xoperands[0] = call_dest;
@@ -7077,7 +6899,7 @@ output_call (insn, call_dest, sibcall)
}
}
- if (seq_length == 0 || (delay_insn_deleted && !delay_slot_filled))
+ if (!delay_slot_filled && (seq_length == 0 || delay_insn_deleted))
output_asm_insn ("nop", xoperands);
/* We are done if there isn't a jump in the delay slot. */
@@ -7129,11 +6951,10 @@ output_call (insn, call_dest, sibcall)
the sequence itself. */
int
-attr_length_indirect_call (insn)
- rtx insn;
+attr_length_indirect_call (rtx insn)
{
unsigned long distance = -1;
- unsigned long total = in_text_section () ? total_code_bytes : 0;
+ unsigned long total = IN_NAMED_SECTION_P (cfun->decl) ? 0 : total_code_bytes;
if (INSN_ADDRESSES_SET_P ())
{
@@ -7161,9 +6982,7 @@ attr_length_indirect_call (insn)
}
const char *
-output_indirect_call (insn, call_dest)
- rtx insn;
- rtx call_dest;
+output_indirect_call (rtx insn, rtx call_dest)
{
rtx xoperands[1];
@@ -7225,8 +7044,7 @@ output_indirect_call (insn, call_dest)
within the same translation unit. */
int
-attr_length_save_restore_dltp (insn)
- rtx insn;
+attr_length_save_restore_dltp (rtx insn)
{
if (find_reg_note (insn, REG_NORETURN, NULL_RTX))
return 0;
@@ -7240,8 +7058,7 @@ attr_length_save_restore_dltp (insn)
space), and special magic is needed to construct their address. */
void
-hppa_encode_label (sym)
- rtx sym;
+hppa_encode_label (rtx sym)
{
const char *str = XSTR (sym, 0);
int len = strlen (str) + 1;
@@ -7255,10 +7072,7 @@ hppa_encode_label (sym)
}
static void
-pa_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+pa_encode_section_info (tree decl, rtx rtl, int first)
{
if (first && TEXT_SPACE_P (decl))
{
@@ -7271,8 +7085,7 @@ pa_encode_section_info (decl, rtl, first)
/* This is sort of inverse to pa_encode_section_info. */
static const char *
-pa_strip_name_encoding (str)
- const char *str;
+pa_strip_name_encoding (const char *str)
{
str += (*str == '@');
str += (*str == '*');
@@ -7280,9 +7093,7 @@ pa_strip_name_encoding (str)
}
int
-function_label_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+function_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == SYMBOL_REF && FUNCTION_NAME_P (XSTR (op, 0));
}
@@ -7291,8 +7102,7 @@ function_label_operand (op, mode)
with a constant. Used to keep certain patterns from matching
during instruction combination. */
int
-is_function_label_plus_const (op)
- rtx op;
+is_function_label_plus_const (rtx op)
{
/* Strip off any CONST. */
if (GET_CODE (op) == CONST)
@@ -7306,12 +7116,9 @@ is_function_label_plus_const (op)
/* Output assembly code for a thunk to FUNCTION. */
static void
-pa_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
- FILE *file;
- tree thunk_fndecl;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED;
- tree function;
+pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
+ HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
+ tree function)
{
const char *fname = XSTR (XEXP (DECL_RTL (function), 0), 0);
const char *tname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
@@ -7465,7 +7272,7 @@ pa_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
}
else
{
- fprintf (file, "\tldsid (%%sr0,%%r22),%%r1\n");
+ fprintf (file, "\tldsid (%%sr0,%%r22),%%r21\n");
fprintf (file, "\tmtsp %%r21,%%sr0\n");
fprintf (file, "\tbe 0(%%sr0,%%r22)\n\tldo ");
nbytes += 44;
@@ -7572,9 +7379,7 @@ pa_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
It is safe to perform a sibcall optimization when the target function
will never return. */
static bool
-pa_function_ok_for_sibcall (decl, exp)
- tree decl;
- tree exp ATTRIBUTE_UNUSED;
+pa_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
/* Sibcalls are ok for TARGET_ELF32 as along as the linker is used in
single subspace mode and the call is not indirect. As far as I know,
@@ -7601,8 +7406,7 @@ pa_function_ok_for_sibcall (decl, exp)
/* Returns 1 if the 6 operands specified in OPERANDS are suitable for
use in fmpyadd instructions. */
int
-fmpyaddoperands (operands)
- rtx *operands;
+fmpyaddoperands (rtx *operands)
{
enum machine_mode mode = GET_MODE (operands[0]);
@@ -7659,9 +7463,7 @@ fmpyaddoperands (operands)
#if !defined(USE_COLLECT2)
static void
-pa_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority;
+pa_asm_out_constructor (rtx symbol, int priority)
{
if (!function_label_operand (symbol, VOIDmode))
hppa_encode_label (symbol);
@@ -7678,9 +7480,7 @@ pa_asm_out_constructor (symbol, priority)
}
static void
-pa_asm_out_destructor (symbol, priority)
- rtx symbol;
- int priority;
+pa_asm_out_destructor (rtx symbol, int priority)
{
if (!function_label_operand (symbol, VOIDmode))
hppa_encode_label (symbol);
@@ -7700,8 +7500,7 @@ pa_asm_out_destructor (symbol, priority)
/* Returns 1 if the 6 operands specified in OPERANDS are suitable for
use in fmpysub instructions. */
int
-fmpysuboperands (operands)
- rtx *operands;
+fmpysuboperands (rtx *operands)
{
enum machine_mode mode = GET_MODE (operands[0]);
@@ -7755,9 +7554,7 @@ fmpysuboperands (operands)
}
int
-plus_xor_ior_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+plus_xor_ior_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == PLUS || GET_CODE (op) == XOR
|| GET_CODE (op) == IOR);
@@ -7766,8 +7563,7 @@ plus_xor_ior_operator (op, mode)
/* Return 1 if the given constant is 2, 4, or 8. These are the valid
constants for shadd instructions. */
static int
-shadd_constant_p (val)
- int val;
+shadd_constant_p (int val)
{
if (val == 2 || val == 4 || val == 8)
return 1;
@@ -7778,9 +7574,7 @@ shadd_constant_p (val)
/* Return 1 if OP is a CONST_INT with the value 2, 4, or 8. These are
the valid constant for shadd instructions. */
int
-shadd_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+shadd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && shadd_constant_p (INTVAL (op)));
}
@@ -7788,9 +7582,7 @@ shadd_operand (op, mode)
/* Return 1 if OP is valid as a base register in a reg + reg address. */
int
-basereg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+basereg_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
@@ -7818,9 +7610,7 @@ basereg_operand (op, mode)
/* Return 1 if this operand is anything other than a hard register. */
int
-non_hard_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+non_hard_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ! (GET_CODE (op) == REG && REGNO (op) < FIRST_PSEUDO_REGISTER);
}
@@ -7828,8 +7618,7 @@ non_hard_reg_operand (op, mode)
/* Return 1 if INSN branches forward. Should be using insn_addresses
to avoid walking through all the insns... */
static int
-forward_branch_p (insn)
- rtx insn;
+forward_branch_p (rtx insn)
{
rtx label = JUMP_LABEL (insn);
@@ -7846,18 +7635,14 @@ forward_branch_p (insn)
/* Return 1 if OP is an equality comparison, else return 0. */
int
-eq_neq_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+eq_neq_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == EQ || GET_CODE (op) == NE);
}
/* Return 1 if OP is an operator suitable for use in a movb instruction. */
int
-movb_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+movb_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == EQ || GET_CODE (op) == NE
|| GET_CODE (op) == LT || GET_CODE (op) == GE);
@@ -7865,8 +7650,7 @@ movb_comparison_operator (op, mode)
/* Return 1 if INSN is in the delay slot of a call instruction. */
int
-jump_in_call_delay (insn)
- rtx insn;
+jump_in_call_delay (rtx insn)
{
if (GET_CODE (insn) != JUMP_INSN)
@@ -7889,9 +7673,7 @@ jump_in_call_delay (insn)
/* Output an unconditional move and branch insn. */
const char *
-output_parallel_movb (operands, length)
- rtx *operands;
- int length;
+output_parallel_movb (rtx *operands, int length)
{
/* These are the cases in which we win. */
if (length == 4)
@@ -7920,9 +7702,7 @@ output_parallel_movb (operands, length)
/* Output an unconditional add and branch insn. */
const char *
-output_parallel_addb (operands, length)
- rtx *operands;
- int length;
+output_parallel_addb (rtx *operands, int length)
{
/* To make life easy we want operand0 to be the shared input/output
operand and operand1 to be the readonly operand. */
@@ -7953,8 +7733,7 @@ output_parallel_addb (operands, length)
the delay slot of the call. */
int
-following_call (insn)
- rtx insn;
+following_call (rtx insn)
{
if (! TARGET_JUMP_IN_DELAY)
return 0;
@@ -8012,7 +7791,7 @@ following_call (insn)
when using GAS (allows for better link time optimizations). */
static void
-pa_reorg ()
+pa_reorg (void)
{
rtx insn;
@@ -8183,7 +7962,7 @@ pa_reorg ()
branch length restrictions. */
static void
-pa_combine_instructions ()
+pa_combine_instructions (void)
{
rtx anchor, new;
@@ -8379,10 +8158,8 @@ pa_combine_instructions ()
}
static int
-pa_can_combine_p (new, anchor, floater, reversed, dest, src1, src2)
- rtx new, anchor, floater;
- int reversed;
- rtx dest, src1, src2;
+pa_can_combine_p (rtx new, rtx anchor, rtx floater, int reversed, rtx dest,
+ rtx src1, rtx src2)
{
int insn_code_number;
rtx start, end;
@@ -8457,8 +8234,7 @@ pa_can_combine_p (new, anchor, floater, reversed, dest, src1, src2)
filter out things it will not accept -- SEQUENCE, USE and CLOBBER insns
in particular. */
int
-insn_refs_are_delayed (insn)
- rtx insn;
+insn_refs_are_delayed (rtx insn)
{
return ((GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) != SEQUENCE
@@ -8477,9 +8253,7 @@ insn_refs_are_delayed (insn)
to match the HP Compiler ABI. */
rtx
-function_value (valtype, func)
- tree valtype;
- tree func ATTRIBUTE_UNUSED;
+function_value (tree valtype, tree func ATTRIBUTE_UNUSED)
{
enum machine_mode valmode;
@@ -8527,11 +8301,8 @@ function_value (valtype, func)
??? We might want to restructure this so that it looks more like other
ports. */
rtx
-function_arg (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
+ int named ATTRIBUTE_UNUSED)
{
int max_arg_words = (TARGET_64BIT ? 8 : 4);
int alignment = 0;
@@ -8730,11 +8501,8 @@ function_arg (cum, mode, type, named)
then this routine should return zero. It is currently called only for
the 64-bit target. */
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)
{
unsigned int max_arg_words = 8;
unsigned int offset = 0;
@@ -8758,9 +8526,7 @@ function_arg_partial_nregs (cum, mode, type, named)
MATCH_OPERATOR to recognize all the branch insns. */
int
-cmpib_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+cmpib_comparison_operator (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || GET_MODE (op) == mode)
&& (GET_CODE (op) == EQ
@@ -8801,9 +8567,7 @@ pa_select_section (exp, reloc, align)
}
static void
-pa_globalize_label (stream, name)
- FILE *stream;
- const char *name;
+pa_globalize_label (FILE *stream, const char *name)
{
/* We only handle DATA objects here, functions are globalized in
ASM_DECLARE_FUNCTION_NAME. */
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 3f61074e632..ce69b3bc19b 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -5,20 +5,20 @@
and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for
Software Science at the University of Utah.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -325,9 +325,7 @@ extern int target_flags;
#define OVERRIDE_OPTIONS override_options ()
-/* stabs-in-som is nearly identical to stabs-in-elf. To avoid useless
- code duplication we simply include this file and override as needed. */
-#include "dbxelf.h"
+/* Override some settings from dbxelf.h. */
/* We do not have to be compatible with dbx, so we enable gdb extensions
by default. */
@@ -552,7 +550,7 @@ do { \
/* Function to return the rtx used to save the pic offset table register
across function calls. */
-extern struct rtx_def *hppa_pic_save_rtx PARAMS ((void));
+extern struct rtx_def *hppa_pic_save_rtx (void);
#define DEFAULT_PCC_STRUCT_RETURN 0
@@ -654,10 +652,14 @@ extern struct rtx_def *hppa_pic_save_rtx PARAMS ((void));
&& REGNO (IN) < FIRST_PSEUDO_REGISTER) \
? NO_REGS : secondary_reload_class (CLASS, MODE, IN))
+#define MAYBE_FP_REG_CLASS_P(CLASS) \
+ reg_classes_intersect_p ((CLASS), FP_REGS)
+
/* On the PA it is not possible to directly move data between
GENERAL_REGS and FP_REGS. */
-#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
- (FP_REG_CLASS_P (CLASS1) != FP_REG_CLASS_P (CLASS2))
+#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
+ (MAYBE_FP_REG_CLASS_P (CLASS1) != FP_REG_CLASS_P (CLASS2) \
+ || MAYBE_FP_REG_CLASS_P (CLASS2) != FP_REG_CLASS_P (CLASS1))
/* Return the stack location to use for secondary memory needed reloads. */
#define SECONDARY_MEMORY_NEEDED_RTX(MODE) \
@@ -960,7 +962,7 @@ extern enum cmp_type hppa_branch_type;
(*targetm.asm_out.internal_label) (FILE, FUNC_BEGIN_PROLOG_LABEL, LABEL)
#define PROFILE_HOOK(label_no) hppa_profile_hook (label_no)
-void hppa_profile_hook PARAMS ((int label_no));
+void hppa_profile_hook (int label_no);
/* The profile counter if emitted must come before the prologue. */
#define PROFILE_BEFORE_PROLOGUE 1
@@ -1515,6 +1517,11 @@ do { \
#define TARGET_ASM_SELECT_SECTION pa_select_section
+/* Return a nonzero value if DECL has a section attribute. */
+#define IN_NAMED_SECTION_P(DECL) \
+ ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
+ && DECL_SECTION_NAME (DECL) != NULL_TREE)
+
/* Define this macro if references to a symbol must be treated
differently depending on something about the variable or
function named by the symbol (such as what section it is in).
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 35369966d59..b5c994017ba 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -1,23 +1,23 @@
-;;- Machine description for HP PA-RISC architecture for GNU C compiler
+;;- Machine description for HP PA-RISC architecture for GCC compiler
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
;; 2002, 2003 Free Software Foundation, Inc.
;; Contributed by the Center for Software Science at the University
;; of Utah.
-;; This file is part of GNU CC.
+;; This file is part of GCC.
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
-;; GNU CC is distributed in the hope that it will be useful,
+;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU CC; see the file COPYING. If not, write to
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
@@ -7145,6 +7145,7 @@
[(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" "")
(zero_extract (match_operand 1 "register_operand" "")
@@ -7153,34 +7154,34 @@
""
"
{
- /* PA extraction insns don't support zero length bitfields. */
- if (INTVAL (operands[2]) == 0)
+ HOST_WIDE_INT len = INTVAL (operands[2]);
+ HOST_WIDE_INT pos = INTVAL (operands[3]);
+
+ /* PA extraction insns don't support zero length bitfields or fields
+ extending beyond the left or right-most bits. Also, we reject lengths
+ equal to a word as they are better handled by the move patterns. */
+ if (len <= 0 || len >= BITS_PER_WORD || pos < 0 || pos + len > BITS_PER_WORD)
+ FAIL;
+
+ /* From mips.md: extract_bit_field doesn't verify that our source
+ matches the predicate, so check it again here. */
+ if (!register_operand (operands[1], VOIDmode))
FAIL;
if (TARGET_64BIT)
- {
- if ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 64
- || (unsigned HOST_WIDE_INT) INTVAL (operands[3]) > 63)
- FAIL;
- emit_insn (gen_extzv_64 (operands[0], operands[1],
- operands[2], operands[3]));
- }
+ emit_insn (gen_extzv_64 (operands[0], operands[1],
+ operands[2], operands[3]));
else
- {
- if ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 32
- || (unsigned HOST_WIDE_INT) INTVAL (operands[3]) > 31)
- FAIL;
- emit_insn (gen_extzv_32 (operands[0], operands[1],
- operands[2], operands[3]));
- }
+ emit_insn (gen_extzv_32 (operands[0], operands[1],
+ operands[2], operands[3]));
DONE;
}")
(define_insn "extzv_32"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "uint32_operand" "")
- (match_operand:SI 3 "uint32_operand" "")))]
+ (match_operand:SI 2 "uint5_operand" "")
+ (match_operand:SI 3 "uint5_operand" "")))]
""
"{extru|extrw,u} %1,%3+%2-1,%2,%0"
[(set_attr "type" "shift")
@@ -7216,6 +7217,7 @@
[(set_attr "type" "shift")
(set_attr "length" "4")])
+;;; Operands 2 and 3 are assumed to be CONST_INTs.
(define_expand "extv"
[(set (match_operand 0 "register_operand" "")
(sign_extract (match_operand 1 "register_operand" "")
@@ -7224,34 +7226,34 @@
""
"
{
- /* PA extraction insns don't support zero length bitfields. */
- if (INTVAL (operands[2]) == 0)
+ HOST_WIDE_INT len = INTVAL (operands[2]);
+ HOST_WIDE_INT pos = INTVAL (operands[3]);
+
+ /* PA extraction insns don't support zero length bitfields or fields
+ extending beyond the left or right-most bits. Also, we reject lengths
+ equal to a word as they are better handled by the move patterns. */
+ if (len <= 0 || len >= BITS_PER_WORD || pos < 0 || pos + len > BITS_PER_WORD)
+ FAIL;
+
+ /* From mips.md: extract_bit_field doesn't verify that our source
+ matches the predicate, so check it again here. */
+ if (!register_operand (operands[1], VOIDmode))
FAIL;
if (TARGET_64BIT)
- {
- if ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 64
- || (unsigned HOST_WIDE_INT) INTVAL (operands[3]) > 63)
- FAIL;
- emit_insn (gen_extv_64 (operands[0], operands[1],
- operands[2], operands[3]));
- }
+ emit_insn (gen_extv_64 (operands[0], operands[1],
+ operands[2], operands[3]));
else
- {
- if ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 32
- || (unsigned HOST_WIDE_INT) INTVAL (operands[3]) > 31)
- FAIL;
- emit_insn (gen_extv_32 (operands[0], operands[1],
- operands[2], operands[3]));
- }
+ emit_insn (gen_extv_32 (operands[0], operands[1],
+ operands[2], operands[3]));
DONE;
}")
(define_insn "extv_32"
[(set (match_operand:SI 0 "register_operand" "=r")
(sign_extract:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "uint32_operand" "")
- (match_operand:SI 3 "uint32_operand" "")))]
+ (match_operand:SI 2 "uint5_operand" "")
+ (match_operand:SI 3 "uint5_operand" "")))]
""
"{extrs|extrw,s} %1,%3+%2-1,%2,%0"
[(set_attr "type" "shift")
@@ -7287,7 +7289,7 @@
[(set_attr "type" "shift")
(set_attr "length" "4")])
-;; Only specify the mode operands 0, the rest are assumed to be word_mode.
+;;; Operands 1 and 2 are assumed to be CONST_INTs.
(define_expand "insv"
[(set (zero_extract (match_operand 0 "register_operand" "")
(match_operand 1 "uint32_operand" "")
@@ -7296,29 +7298,33 @@
""
"
{
+ HOST_WIDE_INT len = INTVAL (operands[1]);
+ HOST_WIDE_INT pos = INTVAL (operands[2]);
+
+ /* PA insertion insns don't support zero length bitfields or fields
+ extending beyond the left or right-most bits. Also, we reject lengths
+ equal to a word as they are better handled by the move patterns. */
+ if (len <= 0 || len >= BITS_PER_WORD || pos < 0 || pos + len > BITS_PER_WORD)
+ FAIL;
+
+ /* From mips.md: insert_bit_field doesn't verify that our destination
+ matches the predicate, so check it again here. */
+ if (!register_operand (operands[0], VOIDmode))
+ FAIL;
+
if (TARGET_64BIT)
- {
- if ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 64
- || (unsigned HOST_WIDE_INT) INTVAL (operands[3]) > 63)
- FAIL;
- emit_insn (gen_insv_64 (operands[0], operands[1],
- operands[2], operands[3]));
- }
+ emit_insn (gen_insv_64 (operands[0], operands[1],
+ operands[2], operands[3]));
else
- {
- if ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 32
- || (unsigned HOST_WIDE_INT) INTVAL (operands[3]) > 31)
- FAIL;
- emit_insn (gen_insv_32 (operands[0], operands[1],
- operands[2], operands[3]));
- }
+ emit_insn (gen_insv_32 (operands[0], operands[1],
+ operands[2], operands[3]));
DONE;
}")
(define_insn "insv_32"
[(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r,r")
- (match_operand:SI 1 "uint32_operand" "")
- (match_operand:SI 2 "uint32_operand" ""))
+ (match_operand:SI 1 "uint5_operand" "")
+ (match_operand:SI 2 "uint5_operand" ""))
(match_operand:SI 3 "arith5_operand" "r,L"))]
""
"@
diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h
index c8e7b37012b..49439594920 100644
--- a/gcc/config/pa/pa32-linux.h
+++ b/gcc/config/pa/pa32-linux.h
@@ -1,20 +1,20 @@
/* Definitions for PA_RISC with ELF-32 format
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h
index d16d741e2d1..a29583b561b 100644
--- a/gcc/config/pa/pa64-hpux.h
+++ b/gcc/config/pa/pa64-hpux.h
@@ -2,20 +2,20 @@
HPUX using the 64bit runtime model.
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -383,3 +383,7 @@ PA_INIT_FINI_HACK
and returns 0. /bin/true cannot be used because it is a script without
an interpreter. */
#define INIT_ENVIRONMENT "LD_PXDB=/usr/ccs/bin/size"
+
+/* The HPUX dynamic linker objects to weak symbols with no
+ definitions, so do not use them in gthr-posix.h. */
+#define GTHREAD_USE_WEAK 0
diff --git a/gcc/config/pa/pa64-linux.h b/gcc/config/pa/pa64-linux.h
index 82a2b05005b..5d7fdbee181 100644
--- a/gcc/config/pa/pa64-linux.h
+++ b/gcc/config/pa/pa64-linux.h
@@ -1,20 +1,20 @@
/* Definitions for PA_RISC with ELF format on 64-bit Linux
Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/pa64-regs.h b/gcc/config/pa/pa64-regs.h
index ced7df737e7..29cc230c79b 100644
--- a/gcc/config/pa/pa64-regs.h
+++ b/gcc/config/pa/pa64-regs.h
@@ -1,20 +1,20 @@
-/* Configuration for GNU C-compiler for PA-RISC.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Configuration for GCC-compiler for PA-RISC.
+ Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/quadlib.c b/gcc/config/pa/quadlib.c
index 05d632a25c6..cfec5e9723c 100644
--- a/gcc/config/pa/quadlib.c
+++ b/gcc/config/pa/quadlib.c
@@ -1,9 +1,9 @@
/* Subroutines for long double support.
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
@@ -17,13 +17,13 @@ do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/rtems.h b/gcc/config/pa/rtems.h
index 14a8b2a6d6c..5450cfb2fb1 100644
--- a/gcc/config/pa/rtems.h
+++ b/gcc/config/pa/rtems.h
@@ -2,20 +2,20 @@
Copyright (C) 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 6d34bf93fd3..fae73922a98 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -1,20 +1,20 @@
/* Definitions for SOM assembler support.
Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -232,7 +232,7 @@ do { \
#define EXTRA_SECTIONS in_readonly_data
#define EXTRA_SECTION_FUNCTIONS \
-extern void readonly_data PARAMS ((void)); \
+extern void readonly_data (void); \
void \
readonly_data () \
{ \
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index d40221513aa..991d2c31153 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -149,6 +149,29 @@
? MAX (MAX ((COMPUTED), (SPECIFIED)), 64) \
: MAX ((COMPUTED), (SPECIFIED)))
+/* The AIX ABI isn't explicit on whether aggregates smaller than a
+ word/doubleword should be padded upward or downward. One could
+ reasonably assume that they follow the normal rules for structure
+ layout treating the parameter area as any other block of memory,
+ then map the reg param area to registers, i.e., pad upward, which
+ is the way IBM Compilers for AIX behave.
+ Setting both of the following defines results in this behaviour. */
+#define AGGREGATE_PADDING_FIXED 1
+#define AGGREGATES_PAD_UPWARD_ALWAYS 1
+
+/* We don't want anything in the reg parm area being passed on the
+ stack. */
+#define MUST_PASS_IN_STACK(MODE, TYPE) \
+ ((TYPE) != 0 \
+ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
+ || TREE_ADDRESSABLE (TYPE)))
+
+/* Specify padding for the last element of a block move between
+ registers and memory. FIRST is nonzero if this is the only
+ element. */
+#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
+ (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
+
/* Indicate that jump tables go in the text section. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
@@ -209,6 +232,38 @@
So we have to squirrel it away with this. */
#define SETUP_FRAME_ADDRESSES() rs6000_aix_emit_builtin_unwind_init ()
+/* If the current unwind info (FS) does not contain explicit info
+ saving R2, then we have to do a minor amount of code reading to
+ figure out if it was saved. The big problem here is that the
+ code that does the save/restore is generated by the linker, so
+ we have no good way to determine at compile time what to do. */
+
+#ifdef __powerpc64__
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \
+ do { \
+ if ((FS)->regs.reg[2].how == REG_UNSAVED) \
+ { \
+ unsigned int *insn \
+ = (unsigned int *) \
+ _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \
+ if (*insn == 0xE8410028) \
+ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \
+ } \
+ } while (0)
+#else
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \
+ do { \
+ if ((FS)->regs.reg[2].how == REG_UNSAVED) \
+ { \
+ unsigned int *insn \
+ = (unsigned int *) \
+ _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \
+ if (*insn == 0x80410014) \
+ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20); \
+ } \
+ } while (0)
+#endif
+
#define PROFILE_HOOK(LABEL) output_profile_hook (LABEL)
/* Print subsidiary information on the compiler version in use. */
diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
index 736d4fd6b1f..d7718fee98b 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -1198,7 +1198,7 @@ vec_dss (const char a1)
/* vec_dssall */
inline void
-vec_dssall ()
+vec_dssall (void)
{
__builtin_altivec_dssall ();
}
@@ -2419,7 +2419,7 @@ vec_vmrglb (vector unsigned char a1, vector unsigned char a2)
/* vec_mfvscr */
inline vector unsigned short
-vec_mfvscr ()
+vec_mfvscr (void)
{
return (vector unsigned short) __builtin_altivec_mfvscr ();
}
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index b28544ade3b..4722826d691 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -97,6 +97,14 @@ do { \
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
%{!static:%{!mdynamic-no-pic:-fPIC}}"
+#define ASM_SPEC "-arch ppc \
+ %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
+ %{!Zforce_cpusubtype_ALL:%{faltivec:-force_cpusubtype_ALL}}"
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "darwin_arch", "ppc" },
+
/* Make both r2 and r3 available for allocation. */
#define FIXED_R2 0
#define FIXED_R13 0
@@ -237,16 +245,17 @@ do { \
a SYMBOL_REF. */
#undef PREFERRED_RELOAD_CLASS
-#define PREFERRED_RELOAD_CLASS(X,CLASS) \
- (((GET_CODE (X) == CONST_DOUBLE \
- && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \
- ? NO_REGS \
- : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
- && (CLASS) == NON_SPECIAL_REGS) \
- ? GENERAL_REGS \
- : (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == HIGH) \
- ? BASE_REGS \
- : (CLASS)))
+#define PREFERRED_RELOAD_CLASS(X,CLASS) \
+ ((GET_CODE (X) == CONST_DOUBLE \
+ && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \
+ ? NO_REGS \
+ : ((GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == HIGH) \
+ && reg_class_subset_p (BASE_REGS, (CLASS))) \
+ ? BASE_REGS \
+ : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
+ && (CLASS) == NON_SPECIAL_REGS) \
+ ? GENERAL_REGS \
+ : (CLASS))
/* Fix for emit_group_load (): force large constants to be pushed via regs. */
#define ALWAYS_PUSH_CONSTS_USING_REGS_P 1
diff --git a/gcc/config/rs6000/host-darwin.c b/gcc/config/rs6000/host-darwin.c
index 294a6544910..7e8055690e4 100644
--- a/gcc/config/rs6000/host-darwin.c
+++ b/gcc/config/rs6000/host-darwin.c
@@ -23,17 +23,19 @@
#include "coretypes.h"
#include <signal.h>
#include <sys/ucontext.h>
+#include <sys/mman.h>
#include "hosthooks.h"
#include "hosthooks-def.h"
#include "toplev.h"
#include "diagnostic.h"
-static void segv_crash_handler PARAMS ((int));
-static void segv_handler PARAMS ((int, siginfo_t *, void *));
-static void darwin_rs6000_extra_signals PARAMS ((void));
+static void segv_crash_handler (int);
+static void segv_handler (int, siginfo_t *, void *);
+static void darwin_rs6000_extra_signals (void);
-/* No prototype for this, filed as Radar 3150910. */
-extern int sigaltstack(const stack_t *, stack_t *);
+/* This doesn't have a prototype in signal.h in 10.2.x and earlier,
+ fixed in later releases. */
+extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *);
#undef HOST_HOOKS_EXTRA_SIGNALS
#define HOST_HOOKS_EXTRA_SIGNALS darwin_rs6000_extra_signals
@@ -45,17 +47,15 @@ extern int sigaltstack(const stack_t *, stack_t *);
the previous bottom of the stack. */
static void
-segv_crash_handler (sig)
- int sig ATTRIBUTE_UNUSED;
+segv_crash_handler (int sig ATTRIBUTE_UNUSED)
{
internal_error ("Segmentation Fault (code)");
}
static void
-segv_handler (sig, sip, scp)
- int sig ATTRIBUTE_UNUSED;
- siginfo_t *sip ATTRIBUTE_UNUSED;
- void *scp;
+segv_handler (int sig ATTRIBUTE_UNUSED,
+ siginfo_t *sip ATTRIBUTE_UNUSED,
+ void *scp)
{
ucontext_t *uc = (ucontext_t *)scp;
unsigned faulting_insn;
@@ -119,7 +119,7 @@ segv_handler (sig, sip, scp)
}
static void
-darwin_rs6000_extra_signals ()
+darwin_rs6000_extra_signals (void)
{
struct sigaction sact;
stack_t sigstk;
@@ -136,5 +136,54 @@ darwin_rs6000_extra_signals ()
if (sigaction (SIGSEGV, &sact, 0) < 0)
fatal_error ("While setting up signal handler: %m");
}
+
+static void * darwin_rs6000_gt_pch_get_address (size_t);
+static bool darwin_rs6000_gt_pch_use_address (void *, size_t);
+
+#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
+#define HOST_HOOKS_GT_PCH_GET_ADDRESS darwin_rs6000_gt_pch_get_address
+#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
+#define HOST_HOOKS_GT_PCH_USE_ADDRESS darwin_rs6000_gt_pch_use_address
+
+
+/* Yes, this is really supposed to work. */
+static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096)));
+
+/* Return the address of the PCH address space, if the PCH will fit in it. */
+
+static void *
+darwin_rs6000_gt_pch_get_address (size_t sz)
+{
+ if (sz <= sizeof (pch_address_space))
+ return pch_address_space;
+ else
+ return NULL;
+}
+
+/* Check ADDR and SZ for validity, and deallocate (using munmap) that part of
+ pch_address_space beyond SZ. */
+
+static bool
+darwin_rs6000_gt_pch_use_address (void *addr, size_t sz)
+{
+ const size_t pagesize = getpagesize();
+ bool result;
+
+ if ((size_t)pch_address_space % pagesize != 0
+ || sizeof (pch_address_space) % pagesize != 0)
+ abort ();
+
+ result = (addr == pch_address_space && sz <= sizeof (pch_address_space));
+ if (! result)
+ sz = 0;
+
+ /* Round the size to a whole page size. Normally this is a no-op. */
+ sz = (sz + pagesize - 1) / pagesize * pagesize;
+
+ if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0)
+ fatal_error ("couldn't unmap pch_address_space: %m\n");
+
+ return result;
+}
const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index c3e4a586570..1ef484e629d 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -63,6 +63,9 @@
#undef LINK_OS_DEFAULT_SPEC
#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index c1c1edb4d30..cbe18645066 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -160,6 +160,10 @@
#ifndef RS6000_BI_ARCH
+/* 64-bit PowerPC Linux is always big-endian. */
+#undef TARGET_LITTLE_ENDIAN
+#define TARGET_LITTLE_ENDIAN 0
+
/* 64-bit PowerPC Linux always has a TOC. */
#undef TARGET_TOC
#define TARGET_TOC 1
@@ -232,6 +236,35 @@
#undef JUMP_TABLES_IN_TEXT_SECTION
#define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
+/* The linux ppc64 ABI isn't explicit on whether aggregates smaller
+ than a doubleword should be padded upward or downward. You could
+ reasonably assume that they follow the normal rules for structure
+ layout treating the parameter area as any other block of memory,
+ then map the reg param area to registers. ie. pad updard.
+ Setting both of the following defines results in this behaviour.
+ Setting just the first one will result in aggregates that fit in a
+ doubleword being padded downward, and others being padded upward.
+ Not a bad idea as this results in struct { int x; } being passed
+ the same way as an int. */
+#define AGGREGATE_PADDING_FIXED TARGET_64BIT
+#define AGGREGATES_PAD_UPWARD_ALWAYS 0
+
+/* We don't want anything in the reg parm area being passed on the
+ stack. */
+#define MUST_PASS_IN_STACK(MODE, TYPE) \
+ ((TARGET_64BIT \
+ && (TYPE) != 0 \
+ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
+ || TREE_ADDRESSABLE (TYPE))) \
+ || (!TARGET_64BIT \
+ && default_must_pass_in_stack ((MODE), (TYPE))))
+
+/* Specify padding for the last element of a block move between
+ registers and memory. FIRST is nonzero if this is the only
+ element. */
+#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
+ (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
+
/* __throw will restore its own return address to be the same as the
return address of the function that the throw is being made to.
This is unfortunate, because we want to check the original
@@ -504,6 +537,9 @@ while (0)
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
@@ -520,6 +556,24 @@ enum { SIGNAL_FRAMESIZE = 64 };
#ifdef __powerpc64__
+/* If the current unwind info (FS) does not contain explicit info
+ saving R2, then we have to do a minor amount of code reading to
+ figure out if it was saved. The big problem here is that the
+ code that does the save/restore is generated by the linker, so
+ we have no good way to determine at compile time what to do. */
+
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \
+ do { \
+ if ((FS)->regs.reg[2].how == REG_UNSAVED) \
+ { \
+ unsigned int *insn \
+ = (unsigned int *) \
+ _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \
+ if (*insn == 0xE8410028) \
+ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \
+ } \
+ } while (0)
+
#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
do { \
unsigned char *pc_ = (CONTEXT)->ra; \
diff --git a/gcc/config/rs6000/lynx.h b/gcc/config/rs6000/lynx.h
index 04ed1219aab..b32b07890ae 100644
--- a/gcc/config/rs6000/lynx.h
+++ b/gcc/config/rs6000/lynx.h
@@ -19,31 +19,6 @@
Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
-/* Definitions we want to override with those from rs6000.h: */
-#undef LIB_SPEC
-#undef PTRDIFF_TYPE
-#undef WCHAR_TYPE
-#undef WCHAR_TYPE_SIZE
-#undef EXTRA_SECTIONS
-#undef READONLY_DATA_SECTION
-#undef READONLY_DATA_SECTION_ASM_OP
-#undef EXTRA_SECTION_FUNCTIONS
-#undef TARGET_ASM_SELECT_RTX_SECTION
-#undef TARGET_ASM_SELECT_SECTION
-#undef USER_LABEL_PREFIX
-#undef ASM_OUTPUT_LABELREF
-#undef ASM_GENERATE_INTERNAL_LABEL
-#undef ASM_OUTPUT_COMMON
-#undef ASM_OUTPUT_LOCAL
-
-#undef SDB_DEBUGGING_INFO
-#undef DBX_DEBUGGING_INFO
-#undef PREFERRED_DEBUGGING_TYPE
-
-#undef FUNCTION_PROFILER
-
-#include <rs6000/rs6000.h>
-
/* Print subsidiary information on the compiler version in use. */
#define TARGET_VERSION fprintf (stderr, " (LynxOS-RS/6000)");
diff --git a/gcc/config/rs6000/lynxbase.h b/gcc/config/rs6000/lynxbase.h
new file mode 100644
index 00000000000..02a255254a5
--- /dev/null
+++ b/gcc/config/rs6000/lynxbase.h
@@ -0,0 +1,45 @@
+/* Definitions for Rs6000 running LynxOS.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by David Henkel-Wallace, Cygnus Support (gumby@cygnus.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. */
+
+/* Definitions we want to override with those from rs6000.h: */
+#undef LIB_SPEC
+#undef PTRDIFF_TYPE
+#undef SIZE_TYPE
+#undef WCHAR_TYPE
+#undef WCHAR_TYPE_SIZE
+#undef EXTRA_SECTIONS
+#undef READONLY_DATA_SECTION
+#undef READONLY_DATA_SECTION_ASM_OP
+#undef EXTRA_SECTION_FUNCTIONS
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#undef TARGET_ASM_SELECT_SECTION
+#undef USER_LABEL_PREFIX
+#undef ASM_OUTPUT_LABELREF
+#undef ASM_GENERATE_INTERNAL_LABEL
+#undef ASM_OUTPUT_COMMON
+#undef ASM_OUTPUT_LOCAL
+
+#undef SDB_DEBUGGING_INFO
+#undef DBX_DEBUGGING_INFO
+#undef PREFERRED_DEBUGGING_TYPE
+
+#undef FUNCTION_PROFILER
+#undef SUBTARGET_SWITCHES
diff --git a/gcc/config/rs6000/ppc64-fp.c b/gcc/config/rs6000/ppc64-fp.c
index 3f6d7cd1bb0..755827fb0b4 100644
--- a/gcc/config/rs6000/ppc64-fp.c
+++ b/gcc/config/rs6000/ppc64-fp.c
@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#if defined(__powerpc64__)
-#include "fp-bit.h"
+#include "config/fp-bit.h"
extern DItype __fixdfdi (DFtype);
extern DItype __fixsfdi (SFtype);
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index a7e8dd3a7c2..a47afee59b3 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -48,8 +48,7 @@
} while (0)
void
-rs6000_pragma_longcall (pfile)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
+rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
tree x, n;
@@ -80,8 +79,7 @@ rs6000_pragma_longcall (pfile)
#define builtin_assert(TXT) cpp_assert (pfile, TXT)
void
-rs6000_cpu_cpp_builtins (pfile)
- cpp_reader *pfile;
+rs6000_cpu_cpp_builtins (cpp_reader *pfile)
{
if (TARGET_POWER2)
builtin_define ("_ARCH_PWR2");
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index fc7e9cb96d8..8340c2b5931 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -27,186 +27,182 @@
#ifdef RTX_CODE
#ifdef TREE_CODE
-extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int, int));
-extern void rs6000_va_start PARAMS ((tree, rtx));
+extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, int, int);
+extern void rs6000_va_start (tree, rtx);
#endif /* TREE_CODE */
-extern struct rtx_def *rs6000_got_register PARAMS ((rtx));
-extern struct rtx_def *find_addr_reg PARAMS ((rtx));
-extern int any_operand PARAMS ((rtx, enum machine_mode));
-extern int short_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int u_short_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int non_short_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int exact_log2_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int gpc_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int cc_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int cc_reg_not_cr0_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_short_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_neg_short_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_aligned_short_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_u_short_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_arith_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_add_cint64_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_sub_cint64_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_logical_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int got_operand PARAMS ((rtx, enum machine_mode));
-extern int got_no_const_operand PARAMS ((rtx, enum machine_mode));
-extern int num_insns_constant PARAMS ((rtx, enum machine_mode));
-extern int easy_fp_constant PARAMS ((rtx, enum machine_mode));
-extern int easy_vector_constant PARAMS ((rtx, enum machine_mode));
-extern const char *output_vec_const_move PARAMS ((rtx *));
-extern int zero_fp_constant PARAMS ((rtx, enum machine_mode));
-extern int zero_constant PARAMS ((rtx, enum machine_mode));
-extern int volatile_mem_operand PARAMS ((rtx, enum machine_mode));
-extern int offsettable_mem_operand PARAMS ((rtx, enum machine_mode));
-extern int mem_or_easy_const_operand PARAMS ((rtx, enum machine_mode));
-extern int add_operand PARAMS ((rtx, enum machine_mode));
-extern int non_add_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int non_logical_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int logical_operand PARAMS ((rtx, enum machine_mode));
-extern int mask_operand PARAMS ((rtx, enum machine_mode));
-extern int mask_operand_wrap PARAMS ((rtx, enum machine_mode));
-extern int mask64_operand PARAMS ((rtx, enum machine_mode));
-extern int mask64_2_operand PARAMS ((rtx, enum machine_mode));
-extern void build_mask64_2_operands PARAMS ((rtx, rtx *));
-extern int and64_operand PARAMS ((rtx, enum machine_mode));
-extern int and64_2_operand PARAMS ((rtx, enum machine_mode));
-extern int and_operand PARAMS ((rtx, enum machine_mode));
-extern int count_register_operand PARAMS ((rtx, enum machine_mode));
-extern int xer_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_mem_operand PARAMS ((rtx, enum machine_mode));
-extern int lwa_operand PARAMS ((rtx, enum machine_mode));
-extern int call_operand PARAMS ((rtx, enum machine_mode));
-extern int current_file_function_operand PARAMS ((rtx, enum machine_mode));
-extern int input_operand PARAMS ((rtx, enum machine_mode));
-extern int small_data_operand PARAMS ((rtx, enum machine_mode));
-extern int s8bit_cint_operand PARAMS ((rtx, enum machine_mode));
-extern bool legitimate_constant_pool_address_p PARAMS ((rtx));
-extern int expand_block_move PARAMS ((rtx[]));
-extern int load_multiple_operation PARAMS ((rtx, enum machine_mode));
-extern const char * rs6000_output_load_multiple PARAMS ((rtx[]));
-extern int store_multiple_operation PARAMS ((rtx, enum machine_mode));
-extern int branch_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int branch_positive_comparison_operator
- PARAMS ((rtx, enum machine_mode));
-extern int scc_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int trap_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int boolean_operator PARAMS ((rtx, enum machine_mode));
-extern int boolean_or_operator PARAMS ((rtx, enum machine_mode));
-extern int min_max_operator PARAMS ((rtx, enum machine_mode));
-extern int includes_lshift_p PARAMS ((rtx, rtx));
-extern int includes_rshift_p PARAMS ((rtx, rtx));
-extern int includes_rldic_lshift_p PARAMS ((rtx, rtx));
-extern int includes_rldicr_lshift_p PARAMS ((rtx, rtx));
-extern int registers_ok_for_quad_peep PARAMS ((rtx, rtx));
-extern int addrs_ok_for_quad_peep PARAMS ((rtx, rtx));
+extern struct rtx_def *rs6000_got_register (rtx);
+extern struct rtx_def *find_addr_reg (rtx);
+extern int any_operand (rtx, enum machine_mode);
+extern int short_cint_operand (rtx, enum machine_mode);
+extern int u_short_cint_operand (rtx, enum machine_mode);
+extern int non_short_cint_operand (rtx, enum machine_mode);
+extern int exact_log2_cint_operand (rtx, enum machine_mode);
+extern int gpc_reg_operand (rtx, enum machine_mode);
+extern int cc_reg_operand (rtx, enum machine_mode);
+extern int cc_reg_not_cr0_operand (rtx, enum machine_mode);
+extern int reg_or_short_operand (rtx, enum machine_mode);
+extern int reg_or_neg_short_operand (rtx, enum machine_mode);
+extern int reg_or_aligned_short_operand (rtx, enum machine_mode);
+extern int reg_or_u_short_operand (rtx, enum machine_mode);
+extern int reg_or_cint_operand (rtx, enum machine_mode);
+extern int reg_or_arith_cint_operand (rtx, enum machine_mode);
+extern int reg_or_add_cint64_operand (rtx, enum machine_mode);
+extern int reg_or_sub_cint64_operand (rtx, enum machine_mode);
+extern int reg_or_logical_cint_operand (rtx, enum machine_mode);
+extern int got_operand (rtx, enum machine_mode);
+extern int got_no_const_operand (rtx, enum machine_mode);
+extern int num_insns_constant (rtx, enum machine_mode);
+extern int easy_fp_constant (rtx, enum machine_mode);
+extern int easy_vector_constant (rtx, enum machine_mode);
+extern const char *output_vec_const_move (rtx *);
+extern int zero_fp_constant (rtx, enum machine_mode);
+extern int zero_constant (rtx, enum machine_mode);
+extern int volatile_mem_operand (rtx, enum machine_mode);
+extern int offsettable_mem_operand (rtx, enum machine_mode);
+extern int mem_or_easy_const_operand (rtx, enum machine_mode);
+extern int add_operand (rtx, enum machine_mode);
+extern int non_add_cint_operand (rtx, enum machine_mode);
+extern int non_logical_cint_operand (rtx, enum machine_mode);
+extern int logical_operand (rtx, enum machine_mode);
+extern int mask_operand (rtx, enum machine_mode);
+extern int mask_operand_wrap (rtx, enum machine_mode);
+extern int mask64_operand (rtx, enum machine_mode);
+extern int mask64_2_operand (rtx, enum machine_mode);
+extern void build_mask64_2_operands (rtx, rtx *);
+extern int and64_operand (rtx, enum machine_mode);
+extern int and64_2_operand (rtx, enum machine_mode);
+extern int and_operand (rtx, enum machine_mode);
+extern int count_register_operand (rtx, enum machine_mode);
+extern int xer_operand (rtx, enum machine_mode);
+extern int reg_or_mem_operand (rtx, enum machine_mode);
+extern int lwa_operand (rtx, enum machine_mode);
+extern int call_operand (rtx, enum machine_mode);
+extern int current_file_function_operand (rtx, enum machine_mode);
+extern int input_operand (rtx, enum machine_mode);
+extern int small_data_operand (rtx, enum machine_mode);
+extern int s8bit_cint_operand (rtx, enum machine_mode);
+extern bool legitimate_constant_pool_address_p (rtx);
+extern int expand_block_move (rtx[]);
+extern int load_multiple_operation (rtx, enum machine_mode);
+extern const char * rs6000_output_load_multiple (rtx[]);
+extern int store_multiple_operation (rtx, enum machine_mode);
+extern int branch_comparison_operator (rtx, enum machine_mode);
+extern int branch_positive_comparison_operator (rtx, enum machine_mode);
+extern int scc_comparison_operator (rtx, enum machine_mode);
+extern int trap_comparison_operator (rtx, enum machine_mode);
+extern int boolean_operator (rtx, enum machine_mode);
+extern int boolean_or_operator (rtx, enum machine_mode);
+extern int min_max_operator (rtx, enum machine_mode);
+extern int includes_lshift_p (rtx, rtx);
+extern int includes_rshift_p (rtx, rtx);
+extern int includes_rldic_lshift_p (rtx, rtx);
+extern int includes_rldicr_lshift_p (rtx, rtx);
+extern int registers_ok_for_quad_peep (rtx, rtx);
+extern int addrs_ok_for_quad_peep (rtx, rtx);
extern int altivec_in_gprs_p (rtx, rtx);
-extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
- enum machine_mode, rtx));
-extern int ccr_bit PARAMS ((rtx, int));
-extern int extract_MB PARAMS ((rtx));
-extern int extract_ME PARAMS ((rtx));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern enum rtx_code rs6000_reverse_condition PARAMS ((enum machine_mode,
- enum rtx_code));
-extern void rs6000_emit_sCOND PARAMS ((enum rtx_code, rtx));
-extern void rs6000_emit_cbranch PARAMS ((enum rtx_code, rtx));
-extern char * output_cbranch PARAMS ((rtx, const char *, int, rtx));
-extern rtx rs6000_emit_set_const PARAMS ((rtx, enum machine_mode, rtx, int));
-extern int rs6000_emit_cmove PARAMS ((rtx, rtx, rtx, rtx));
-extern void rs6000_emit_minmax PARAMS ((rtx, enum rtx_code, rtx, rtx));
-extern void output_toc PARAMS ((FILE *, rtx, int, enum machine_mode));
-extern void rs6000_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern struct rtx_def *rs6000_longcall_ref PARAMS ((rtx));
-extern void rs6000_fatal_bad_address PARAMS ((rtx));
-extern int stmw_operation PARAMS ((rtx, enum machine_mode));
-extern int mfcr_operation PARAMS ((rtx, enum machine_mode));
-extern int mtcrf_operation PARAMS ((rtx, enum machine_mode));
-extern int lmw_operation PARAMS ((rtx, enum machine_mode));
-extern struct rtx_def *create_TOC_reference PARAMS ((rtx));
-extern void rs6000_emit_eh_toc_restore PARAMS ((rtx));
+extern enum reg_class secondary_reload_class (enum reg_class,
+ enum machine_mode, rtx);
+extern int ccr_bit (rtx, int);
+extern int extract_MB (rtx);
+extern int extract_ME (rtx);
+extern void print_operand (FILE *, rtx, int);
+extern void print_operand_address (FILE *, rtx);
+extern enum rtx_code rs6000_reverse_condition (enum machine_mode,
+ enum rtx_code);
+extern void rs6000_emit_sCOND (enum rtx_code, rtx);
+extern void rs6000_emit_cbranch (enum rtx_code, rtx);
+extern char * output_cbranch (rtx, const char *, int, rtx);
+extern rtx rs6000_emit_set_const (rtx, enum machine_mode, rtx, int);
+extern int rs6000_emit_cmove (rtx, rtx, rtx, rtx);
+extern void rs6000_emit_minmax (rtx, enum rtx_code, rtx, rtx);
+extern void output_toc (FILE *, rtx, int, enum machine_mode);
+extern void rs6000_initialize_trampoline (rtx, rtx, rtx);
+extern struct rtx_def *rs6000_longcall_ref (rtx);
+extern void rs6000_fatal_bad_address (rtx);
+extern int stmw_operation (rtx, enum machine_mode);
+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_altivec_in_gprs (rtx *);
-extern void rs6000_emit_move PARAMS ((rtx, rtx, enum machine_mode));
-extern rtx rs6000_legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
-extern rtx rs6000_legitimize_reload_address PARAMS ((rtx, enum machine_mode,
- int, int, int, int *));
-extern int rs6000_legitimate_address PARAMS ((enum machine_mode, rtx, int));
-extern bool rs6000_mode_dependent_address PARAMS ((rtx));
-extern rtx rs6000_return_addr PARAMS ((int, rtx));
-extern void rs6000_output_symbol_ref PARAMS ((FILE*, rtx));
-
-extern rtx rs6000_machopic_legitimize_pic_address PARAMS ((rtx orig, enum machine_mode mode, rtx reg));
+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,
+ int, int, int, int *);
+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 rtx rs6000_machopic_legitimize_pic_address (rtx orig,
+ enum machine_mode mode, rtx reg);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode,
- tree, int));
-extern int function_arg_boundary PARAMS ((enum machine_mode, tree));
-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 int function_arg_pass_by_reference PARAMS ((CUMULATIVE_ARGS *,
+extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int);
+extern int function_arg_boundary (enum machine_mode, 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 int function_arg_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode,
- tree, int));
-extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
+ tree, int);
+extern void setup_incoming_varargs (CUMULATIVE_ARGS *,
enum machine_mode, tree,
- int *, int));
+ int *, int);
extern rtx rs6000_function_value (tree, tree);
extern rtx rs6000_libcall_value (enum machine_mode);
-extern struct rtx_def *rs6000_va_arg PARAMS ((tree, tree));
-extern int function_ok_for_sibcall PARAMS ((tree));
-extern void rs6000_elf_declare_function_name
- PARAMS ((FILE *, const char *, tree));
+extern struct rtx_def *rs6000_va_arg (tree, tree);
+extern int function_ok_for_sibcall (tree);
+extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
#ifdef ARGS_SIZE_RTX
/* expr.h defines ARGS_SIZE_RTX and `enum direction' */
-extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree));
+extern enum direction function_arg_padding (enum machine_mode, tree);
#endif /* ARGS_SIZE_RTX */
#endif /* TREE_CODE */
-extern void optimization_options PARAMS ((int, int));
-extern void rs6000_override_options PARAMS ((const char *));
-extern int direct_return PARAMS ((void));
-extern union tree_node *rs6000_build_va_list PARAMS ((void));
-extern int first_reg_to_save PARAMS ((void));
-extern int first_fp_reg_to_save PARAMS ((void));
-extern rs6000_stack_t *rs6000_stack_info PARAMS ((void));
-extern void output_ascii PARAMS ((FILE *, const char *, int));
-extern void rs6000_gen_section_name PARAMS ((char **, const char *,
- const char *));
-extern void output_function_profiler PARAMS ((FILE *, int));
-extern void output_profile_hook PARAMS ((int));
-extern int rs6000_trampoline_size PARAMS ((void));
-extern void toc_section PARAMS ((void));
-extern void sdata_section PARAMS ((void));
-extern void sdata2_section PARAMS ((void));
-extern void sbss_section PARAMS ((void));
-extern void private_data_section PARAMS ((void));
-extern void read_only_data_section PARAMS ((void));
-extern void read_only_private_data_section PARAMS ((void));
-extern int get_TOC_alias_set PARAMS ((void));
-extern int uses_TOC PARAMS ((void));
-extern void rs6000_emit_prologue PARAMS ((void));
-extern void rs6000_emit_load_toc_table PARAMS ((int));
-extern void rs6000_aix_emit_builtin_unwind_init PARAMS ((void));
-extern void rs6000_emit_epilogue PARAMS ((int));
-extern void debug_stack_info PARAMS ((rs6000_stack_t *));
-extern const char * output_isel PARAMS ((rtx *));
-extern int vrsave_operation PARAMS ((rtx, enum machine_mode));
-extern int rs6000_register_move_cost PARAMS ((enum machine_mode,
- enum reg_class, enum reg_class));
-extern int rs6000_memory_move_cost PARAMS ((enum machine_mode,
- enum reg_class, int));
-extern bool rs6000_tls_referenced_p PARAMS ((rtx));
-extern int rs6000_tls_symbol_ref PARAMS ((rtx, enum machine_mode));
+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);
+extern void output_profile_hook (int);
+extern int rs6000_trampoline_size (void);
+extern void toc_section (void);
+extern void sdata_section (void);
+extern void sdata2_section (void);
+extern void sbss_section (void);
+extern void private_data_section (void);
+extern void read_only_data_section (void);
+extern void read_only_private_data_section (void);
+extern int get_TOC_alias_set (void);
+extern int uses_TOC (void);
+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 const char * output_isel (rtx *);
+extern int vrsave_operation (rtx, enum machine_mode);
+extern int rs6000_register_move_cost (enum machine_mode,
+ enum reg_class, enum reg_class);
+extern int rs6000_memory_move_cost (enum machine_mode, enum reg_class, int);
+extern bool rs6000_tls_referenced_p (rtx);
+extern int rs6000_tls_symbol_ref (rtx, enum machine_mode);
/* Declare functions in rs6000-c.c */
-extern void rs6000_pragma_longcall PARAMS ((struct cpp_reader *));
-extern void rs6000_cpu_cpp_builtins PARAMS ((struct cpp_reader *));
+extern void rs6000_pragma_longcall (struct cpp_reader *);
+extern void rs6000_cpu_cpp_builtins (struct cpp_reader *);
#endif /* rs6000-protos.h */
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 7ff59de6b76..ae702fc012b 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -198,129 +198,126 @@ struct builtin_description
const enum rs6000_builtins code;
};
-static bool rs6000_function_ok_for_sibcall PARAMS ((tree, tree));
-static int num_insns_constant_wide PARAMS ((HOST_WIDE_INT));
-static void validate_condition_mode
- PARAMS ((enum rtx_code, enum machine_mode));
-static rtx rs6000_generate_compare PARAMS ((enum rtx_code));
-static void rs6000_maybe_dead PARAMS ((rtx));
-static void rs6000_emit_stack_tie PARAMS ((void));
-static void rs6000_frame_related PARAMS ((rtx, rtx, HOST_WIDE_INT, rtx, rtx));
-static rtx spe_synthesize_frame_save PARAMS ((rtx));
-static bool spe_func_has_64bit_regs_p PARAMS ((void));
-static void emit_frame_save PARAMS ((rtx, rtx, enum machine_mode,
- unsigned int, int, int));
-static rtx gen_frame_mem_offset PARAMS ((enum machine_mode, rtx, int));
-static void rs6000_emit_allocate_stack PARAMS ((HOST_WIDE_INT, int));
-static unsigned rs6000_hash_constant PARAMS ((rtx));
-static unsigned toc_hash_function PARAMS ((const void *));
-static int toc_hash_eq PARAMS ((const void *, const void *));
-static int constant_pool_expr_1 PARAMS ((rtx, int *, int *));
-static bool constant_pool_expr_p PARAMS ((rtx));
-static bool toc_relative_expr_p PARAMS ((rtx));
-static bool legitimate_small_data_p PARAMS ((enum machine_mode, rtx));
-static bool legitimate_offset_address_p PARAMS ((enum machine_mode, rtx, int));
-static bool legitimate_indexed_address_p PARAMS ((rtx, int));
-static bool legitimate_indirect_address_p PARAMS ((rtx, int));
-static bool legitimate_lo_sum_address_p PARAMS ((enum machine_mode, rtx, int));
-static struct machine_function * rs6000_init_machine_status PARAMS ((void));
-static bool rs6000_assemble_integer PARAMS ((rtx, unsigned int, int));
+static bool rs6000_function_ok_for_sibcall (tree, tree);
+static int num_insns_constant_wide (HOST_WIDE_INT);
+static void validate_condition_mode (enum rtx_code, enum machine_mode);
+static rtx rs6000_generate_compare (enum rtx_code);
+static void rs6000_maybe_dead (rtx);
+static void rs6000_emit_stack_tie (void);
+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);
+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);
+static unsigned toc_hash_function (const void *);
+static int toc_hash_eq (const void *, const void *);
+static int constant_pool_expr_1 (rtx, int *, int *);
+static bool constant_pool_expr_p (rtx);
+static bool toc_relative_expr_p (rtx);
+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 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);
#ifdef HAVE_GAS_HIDDEN
-static void rs6000_assemble_visibility PARAMS ((tree, int));
+static void rs6000_assemble_visibility (tree, int);
#endif
-static int rs6000_ra_ever_killed PARAMS ((void));
-static tree rs6000_handle_longcall_attribute PARAMS ((tree *, tree, tree, int, bool *));
+static int rs6000_ra_ever_killed (void);
+static tree rs6000_handle_longcall_attribute (tree *, tree, tree, int, bool *);
extern const struct attribute_spec rs6000_attribute_table[];
-static void rs6000_set_default_type_attributes PARAMS ((tree));
-static void rs6000_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void rs6000_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void rs6000_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
-static rtx rs6000_emit_set_long_const PARAMS ((rtx,
- HOST_WIDE_INT, HOST_WIDE_INT));
-static void rs6000_file_start PARAMS ((void));
+static void rs6000_set_default_type_attributes (tree);
+static void rs6000_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void rs6000_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void rs6000_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree);
+static rtx rs6000_emit_set_long_const (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
+static void rs6000_file_start (void);
#if TARGET_ELF
-static unsigned int rs6000_elf_section_type_flags PARAMS ((tree, const char *,
- int));
-static void rs6000_elf_asm_out_constructor PARAMS ((rtx, int));
-static void rs6000_elf_asm_out_destructor PARAMS ((rtx, int));
-static void rs6000_elf_select_section PARAMS ((tree, int,
- unsigned HOST_WIDE_INT));
-static void rs6000_elf_unique_section PARAMS ((tree, int));
-static void rs6000_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT));
-static void rs6000_elf_encode_section_info PARAMS ((tree, rtx, int))
+static unsigned int rs6000_elf_section_type_flags (tree, const char *, int);
+static void rs6000_elf_asm_out_constructor (rtx, int);
+static void rs6000_elf_asm_out_destructor (rtx, int);
+static void rs6000_elf_select_section (tree, int, unsigned HOST_WIDE_INT);
+static void rs6000_elf_unique_section (tree, int);
+static void rs6000_elf_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT);
+static void rs6000_elf_encode_section_info (tree, rtx, int)
ATTRIBUTE_UNUSED;
-static bool rs6000_elf_in_small_data_p PARAMS ((tree));
+static bool rs6000_elf_in_small_data_p (tree);
#endif
#if TARGET_XCOFF
-static void rs6000_xcoff_asm_globalize_label PARAMS ((FILE *, const char *));
-static void rs6000_xcoff_asm_named_section PARAMS ((const char *, unsigned int));
-static void rs6000_xcoff_select_section PARAMS ((tree, int,
- unsigned HOST_WIDE_INT));
-static void rs6000_xcoff_unique_section PARAMS ((tree, int));
-static void rs6000_xcoff_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT));
-static const char * rs6000_xcoff_strip_name_encoding PARAMS ((const char *));
-static unsigned int rs6000_xcoff_section_type_flags PARAMS ((tree, const char *, int));
-static void rs6000_xcoff_file_start PARAMS ((void));
-static void rs6000_xcoff_file_end PARAMS ((void));
+static void rs6000_xcoff_asm_globalize_label (FILE *, const char *);
+static void rs6000_xcoff_asm_named_section (const char *, unsigned int);
+static void rs6000_xcoff_select_section (tree, int, unsigned HOST_WIDE_INT);
+static void rs6000_xcoff_unique_section (tree, int);
+static void rs6000_xcoff_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT);
+static const char * rs6000_xcoff_strip_name_encoding (const char *);
+static unsigned int rs6000_xcoff_section_type_flags (tree, const char *, int);
+static void rs6000_xcoff_file_start (void);
+static void rs6000_xcoff_file_end (void);
#endif
#if TARGET_MACHO
-static bool rs6000_binds_local_p PARAMS ((tree));
+static bool rs6000_binds_local_p (tree);
#endif
-static int rs6000_use_dfa_pipeline_interface PARAMS ((void));
-static int rs6000_variable_issue PARAMS ((FILE *, int, rtx, int));
-static bool rs6000_rtx_costs PARAMS ((rtx, int, int, int *));
-static int rs6000_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int rs6000_adjust_priority PARAMS ((rtx, int));
-static int rs6000_issue_rate PARAMS ((void));
-static int rs6000_use_sched_lookahead PARAMS ((void));
-
-static void rs6000_init_builtins PARAMS ((void));
-static rtx rs6000_expand_unop_builtin PARAMS ((enum insn_code, tree, rtx));
-static rtx rs6000_expand_binop_builtin PARAMS ((enum insn_code, tree, rtx));
-static rtx rs6000_expand_ternop_builtin PARAMS ((enum insn_code, tree, rtx));
-static rtx rs6000_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
-static void altivec_init_builtins PARAMS ((void));
-static void rs6000_common_init_builtins PARAMS ((void));
-
-static void enable_mask_for_builtins PARAMS ((struct builtin_description *,
+static int rs6000_use_dfa_pipeline_interface (void);
+static int rs6000_variable_issue (FILE *, int, rtx, int);
+static bool rs6000_rtx_costs (rtx, int, int, int *);
+static int rs6000_adjust_cost (rtx, rtx, rtx, int);
+static int rs6000_adjust_priority (rtx, int);
+static int rs6000_issue_rate (void);
+static int rs6000_use_sched_lookahead (void);
+
+static void rs6000_init_builtins (void);
+static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx);
+static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx);
+static rtx rs6000_expand_ternop_builtin (enum insn_code, tree, rtx);
+static rtx rs6000_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+static void altivec_init_builtins (void);
+static void rs6000_common_init_builtins (void);
+
+static void enable_mask_for_builtins (struct builtin_description *,
int, enum rs6000_builtins,
- enum rs6000_builtins));
-static void spe_init_builtins PARAMS ((void));
-static rtx spe_expand_builtin PARAMS ((tree, rtx, bool *));
-static rtx spe_expand_predicate_builtin PARAMS ((enum insn_code, tree, rtx));
-static rtx spe_expand_evsel_builtin PARAMS ((enum insn_code, tree, rtx));
-static int rs6000_emit_int_cmove PARAMS ((rtx, rtx, rtx, rtx));
-
-static rtx altivec_expand_builtin PARAMS ((tree, rtx, bool *));
-static rtx altivec_expand_ld_builtin PARAMS ((tree, rtx, bool *));
-static rtx altivec_expand_st_builtin PARAMS ((tree, rtx, bool *));
-static rtx altivec_expand_dst_builtin PARAMS ((tree, rtx, bool *));
-static rtx altivec_expand_abs_builtin PARAMS ((enum insn_code, tree, rtx));
-static rtx altivec_expand_predicate_builtin PARAMS ((enum insn_code, const char *, tree, rtx));
-static rtx altivec_expand_stv_builtin PARAMS ((enum insn_code, tree));
-static void rs6000_parse_abi_options PARAMS ((void));
-static void rs6000_parse_alignment_option PARAMS ((void));
-static void rs6000_parse_tls_size_option PARAMS ((void));
+ enum rs6000_builtins);
+static void spe_init_builtins (void);
+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 rtx altivec_expand_builtin (tree, rtx, bool *);
+static rtx altivec_expand_ld_builtin (tree, rtx, bool *);
+static rtx altivec_expand_st_builtin (tree, rtx, bool *);
+static rtx altivec_expand_dst_builtin (tree, rtx, bool *);
+static rtx altivec_expand_abs_builtin (enum insn_code, tree, rtx);
+static rtx altivec_expand_predicate_builtin (enum insn_code,
+ const char *, tree, rtx);
+static rtx altivec_expand_stv_builtin (enum insn_code, tree);
+static void rs6000_parse_abi_options (void);
+static void rs6000_parse_alignment_option (void);
+static void rs6000_parse_tls_size_option (void);
static void rs6000_parse_yes_no_option (const char *, const char *, int *);
-static int first_altivec_reg_to_save PARAMS ((void));
-static unsigned int compute_vrsave_mask PARAMS ((void));
-static void is_altivec_return_reg PARAMS ((rtx, void *));
-static rtx generate_set_vrsave PARAMS ((rtx, rs6000_stack_t *, int));
-int easy_vector_constant PARAMS ((rtx, enum machine_mode));
-static int easy_vector_same PARAMS ((rtx, enum machine_mode));
-static bool is_ev64_opaque_type PARAMS ((tree));
-static rtx rs6000_dwarf_register_span PARAMS ((rtx));
-static rtx rs6000_legitimize_tls_address PARAMS ((rtx, enum tls_model));
-static rtx rs6000_tls_get_addr PARAMS ((void));
-static rtx rs6000_got_sym PARAMS ((void));
-static inline int rs6000_tls_symbol_ref_1 PARAMS ((rtx *, void *));
-static const char *rs6000_get_some_local_dynamic_name PARAMS ((void));
-static int rs6000_get_some_local_dynamic_name_1 PARAMS ((rtx *, void *));
+static int first_altivec_reg_to_save (void);
+static unsigned int compute_vrsave_mask (void);
+static void is_altivec_return_reg (rtx, void *);
+static rtx generate_set_vrsave (rtx, rs6000_stack_t *, int);
+int easy_vector_constant (rtx, enum machine_mode);
+static int easy_vector_same (rtx, enum machine_mode);
+static bool is_ev64_opaque_type (tree);
+static rtx rs6000_dwarf_register_span (rtx);
+static rtx rs6000_legitimize_tls_address (rtx, enum tls_model);
+static rtx rs6000_tls_get_addr (void);
+static rtx rs6000_got_sym (void);
+static inline int rs6000_tls_symbol_ref_1 (rtx *, void *);
+static const char *rs6000_get_some_local_dynamic_name (void);
+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_spe_function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode, tree);
/* Hash table stuff for keeping track of TOC entries. */
@@ -501,8 +498,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
type and sometimes adjust other TARGET_ options. */
void
-rs6000_override_options (default_cpu)
- const char *default_cpu;
+rs6000_override_options (const char *default_cpu)
{
size_t i, j;
struct rs6000_cpu_select *ptr;
@@ -888,7 +884,7 @@ rs6000_parse_yes_no_option (const char *name, const char *value, int *flag)
/* Handle -mabi= options. */
static void
-rs6000_parse_abi_options ()
+rs6000_parse_abi_options (void)
{
if (rs6000_abi_string == 0)
return;
@@ -911,7 +907,7 @@ rs6000_parse_abi_options ()
/* Handle -malign-XXXXXX options. */
static void
-rs6000_parse_alignment_option ()
+rs6000_parse_alignment_option (void)
{
if (rs6000_alignment_string == 0
|| ! strcmp (rs6000_alignment_string, "power"))
@@ -926,7 +922,7 @@ rs6000_parse_alignment_option ()
/* Validate and record the size specified with the -mtls-size option. */
static void
-rs6000_parse_tls_size_option ()
+rs6000_parse_tls_size_option (void)
{
if (rs6000_tls_size_string == 0)
return;
@@ -941,16 +937,14 @@ rs6000_parse_tls_size_option ()
}
void
-optimization_options (level, size)
- int level ATTRIBUTE_UNUSED;
- int size ATTRIBUTE_UNUSED;
+optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
{
}
/* Do anything needed at the start of the asm file. */
static void
-rs6000_file_start ()
+rs6000_file_start (void)
{
size_t i;
char buffer[80];
@@ -1006,7 +1000,7 @@ rs6000_file_start ()
/* Return nonzero if this function is known to have a null epilogue. */
int
-direct_return ()
+direct_return (void)
{
if (reload_completed)
{
@@ -1028,18 +1022,15 @@ direct_return ()
/* Returns 1 always. */
int
-any_operand (op, mode)
- rtx op ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+any_operand (rtx op ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
return 1;
}
/* Returns 1 if op is the count register. */
int
-count_register_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+count_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != REG)
return 0;
@@ -1055,9 +1046,7 @@ count_register_operand (op, mode)
/* Returns 1 if op is an altivec register. */
int
-altivec_register_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+altivec_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (register_operand (op, mode)
@@ -1067,9 +1056,7 @@ altivec_register_operand (op, mode)
}
int
-xer_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+xer_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != REG)
return 0;
@@ -1084,9 +1071,7 @@ xer_operand (op, mode)
by such constants completes more quickly. */
int
-s8bit_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+s8bit_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ( GET_CODE (op) == CONST_INT
&& (INTVAL (op) >= -128 && INTVAL (op) <= 127));
@@ -1095,9 +1080,7 @@ s8bit_cint_operand (op, mode)
/* Return 1 if OP is a constant that can fit in a D field. */
int
-short_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+short_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'I'));
@@ -1106,9 +1089,7 @@ short_cint_operand (op, mode)
/* Similar for an unsigned D field. */
int
-u_short_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+u_short_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& CONST_OK_FOR_LETTER_P (INTVAL (op) & GET_MODE_MASK (mode), 'K'));
@@ -1117,9 +1098,7 @@ u_short_cint_operand (op, mode)
/* Return 1 if OP is a CONST_INT that cannot fit in a signed D field. */
int
-non_short_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+non_short_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) >= 0x10000);
@@ -1129,9 +1108,7 @@ non_short_cint_operand (op, mode)
and an exact power of 2. */
int
-exact_log2_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+exact_log2_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) > 0
@@ -1142,9 +1119,7 @@ exact_log2_cint_operand (op, mode)
ctr, or lr). */
int
-gpc_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gpc_reg_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
&& (GET_CODE (op) != REG
@@ -1157,9 +1132,7 @@ gpc_reg_operand (op, mode)
CR field. */
int
-cc_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+cc_reg_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
&& (GET_CODE (op) != REG
@@ -1171,9 +1144,7 @@ cc_reg_operand (op, mode)
CR field that isn't CR0. */
int
-cc_reg_not_cr0_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+cc_reg_not_cr0_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
&& (GET_CODE (op) != REG
@@ -1186,9 +1157,7 @@ cc_reg_not_cr0_operand (op, mode)
mode unless MODE is VOIDmode. */
int
-reg_or_short_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_short_operand (rtx op, enum machine_mode mode)
{
return short_cint_operand (op, mode) || gpc_reg_operand (op, mode);
}
@@ -1197,9 +1166,7 @@ reg_or_short_operand (op, mode)
valid for a D-field. */
int
-reg_or_neg_short_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_neg_short_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return CONST_OK_FOR_LETTER_P (INTVAL (op), 'P');
@@ -1212,9 +1179,7 @@ reg_or_neg_short_operand (op, mode)
mode unless MODE is VOIDmode. */
int
-reg_or_aligned_short_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_aligned_short_operand (rtx op, enum machine_mode mode)
{
if (gpc_reg_operand (op, mode))
return 1;
@@ -1229,9 +1194,7 @@ reg_or_aligned_short_operand (op, mode)
high-order 16 bits are zero. */
int
-reg_or_u_short_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_u_short_operand (rtx op, enum machine_mode mode)
{
return u_short_cint_operand (op, mode) || gpc_reg_operand (op, mode);
}
@@ -1240,9 +1203,7 @@ reg_or_u_short_operand (op, mode)
constant integer. */
int
-reg_or_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_cint_operand (rtx op, enum machine_mode mode)
{
return (GET_CODE (op) == CONST_INT || gpc_reg_operand (op, mode));
}
@@ -1251,9 +1212,7 @@ reg_or_cint_operand (op, mode)
32-bit signed constant integer. */
int
-reg_or_arith_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_arith_cint_operand (rtx op, enum machine_mode mode)
{
return (gpc_reg_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
@@ -1268,9 +1227,7 @@ reg_or_arith_cint_operand (op, mode)
signed constant integer valid for 64-bit addition. */
int
-reg_or_add_cint64_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_add_cint64_operand (rtx op, enum machine_mode mode)
{
return (gpc_reg_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
@@ -1287,9 +1244,7 @@ reg_or_add_cint64_operand (op, mode)
signed constant integer valid for 64-bit subtraction. */
int
-reg_or_sub_cint64_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_sub_cint64_operand (rtx op, enum machine_mode mode)
{
return (gpc_reg_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
@@ -1306,9 +1261,7 @@ reg_or_sub_cint64_operand (op, mode)
32-bit unsigned constant integer. */
int
-reg_or_logical_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_logical_cint_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -1339,9 +1292,7 @@ reg_or_logical_cint_operand (op, mode)
/* Return 1 if the operand is an operand that can be loaded via the GOT. */
int
-got_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+got_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == SYMBOL_REF
|| GET_CODE (op) == CONST
@@ -1352,9 +1303,7 @@ got_operand (op, mode)
the GOT (labels involving addition aren't allowed). */
int
-got_no_const_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+got_no_const_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF);
}
@@ -1363,8 +1312,7 @@ got_no_const_operand (op, mode)
integer register. */
static int
-num_insns_constant_wide (value)
- HOST_WIDE_INT value;
+num_insns_constant_wide (HOST_WIDE_INT value)
{
/* signed constant loadable with {cal|addi} */
if (CONST_OK_FOR_LETTER_P (value, 'I'))
@@ -1398,9 +1346,7 @@ num_insns_constant_wide (value)
}
int
-num_insns_constant (op, mode)
- rtx op;
- enum machine_mode mode;
+num_insns_constant (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -1477,9 +1423,7 @@ num_insns_constant (op, mode)
safely read CONST_DOUBLE_{LOW,HIGH}. */
int
-easy_fp_constant (op, mode)
- rtx op;
- enum machine_mode mode;
+easy_fp_constant (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != CONST_DOUBLE
|| GET_MODE (op) != mode
@@ -1553,9 +1497,7 @@ easy_fp_constant (op, mode)
/* Return nonzero if all elements of a vector have the same value. */
static int
-easy_vector_same (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+easy_vector_same (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int units, i, cst;
@@ -1574,9 +1516,7 @@ easy_vector_same (op, mode)
register without using memory. */
int
-easy_vector_constant (op, mode)
- rtx op;
- enum machine_mode mode;
+easy_vector_constant (rtx op, enum machine_mode mode)
{
int cst, cst2;
@@ -1625,9 +1565,7 @@ easy_vector_constant (op, mode)
/* Same as easy_vector_constant but only for EASY_VECTOR_15_ADD_SELF. */
int
-easy_vector_constant_add_self (op, mode)
- rtx op;
- enum machine_mode mode;
+easy_vector_constant_add_self (rtx op, enum machine_mode mode)
{
int cst;
@@ -1640,8 +1578,7 @@ easy_vector_constant_add_self (op, mode)
}
const char *
-output_vec_const_move (operands)
- rtx *operands;
+output_vec_const_move (rtx *operands)
{
int cst, cst2;
enum machine_mode mode;
@@ -1701,18 +1638,14 @@ output_vec_const_move (operands)
/* Return 1 if the operand is the constant 0. This works for scalars
as well as vectors. */
int
-zero_constant (op, mode)
- rtx op;
- enum machine_mode mode;
+zero_constant (rtx op, enum machine_mode mode)
{
return op == CONST0_RTX (mode);
}
/* Return 1 if the operand is 0.0. */
int
-zero_fp_constant (op, mode)
- rtx op;
- enum machine_mode mode;
+zero_fp_constant (rtx op, enum machine_mode mode)
{
return GET_MODE_CLASS (mode) == MODE_FLOAT && op == CONST0_RTX (mode);
}
@@ -1723,9 +1656,7 @@ zero_fp_constant (op, mode)
recognize volatile references where its safe. */
int
-volatile_mem_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+volatile_mem_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != MEM)
return 0;
@@ -1748,9 +1679,7 @@ volatile_mem_operand (op, mode)
/* Return 1 if the operand is an offsettable memory operand. */
int
-offsettable_mem_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+offsettable_mem_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == MEM)
&& offsettable_address_p (reload_completed || reload_in_progress,
@@ -1761,9 +1690,7 @@ offsettable_mem_operand (op, mode)
memory. */
int
-mem_or_easy_const_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+mem_or_easy_const_operand (rtx op, enum machine_mode mode)
{
return memory_operand (op, mode) || easy_fp_constant (op, mode);
}
@@ -1772,9 +1699,7 @@ mem_or_easy_const_operand (op, mode)
that can be used as the operand of a `mode' add insn. */
int
-add_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+add_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')
@@ -1786,9 +1711,7 @@ add_operand (op, mode)
/* Return 1 if OP is a constant but not a valid add_operand. */
int
-non_add_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+non_add_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& !CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')
@@ -1799,9 +1722,7 @@ non_add_cint_operand (op, mode)
can be used as the operand of an OR or XOR insn on the RS/6000. */
int
-logical_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+logical_operand (rtx op, enum machine_mode mode)
{
HOST_WIDE_INT opl, oph;
@@ -1838,9 +1759,7 @@ logical_operand (op, mode)
above), but could be split into one. */
int
-non_logical_cint_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+non_logical_cint_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT || GET_CODE (op) == CONST_DOUBLE)
&& ! logical_operand (op, mode)
@@ -1853,9 +1772,7 @@ non_logical_cint_operand (op, mode)
away and confuse the making of MB and ME. */
int
-mask_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mask_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT c, lsb;
@@ -1897,9 +1814,7 @@ mask_operand (op, mode)
/* Return 1 for the PowerPC64 rlwinm corner case. */
int
-mask_operand_wrap (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mask_operand_wrap (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT c, lsb;
@@ -1928,9 +1843,7 @@ mask_operand_wrap (op, mode)
confuses the making of MB and ME. */
int
-mask64_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mask64_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -1961,9 +1874,7 @@ mask64_operand (op, mode)
rldicr machine insns. */
int
-mask64_2_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mask64_2_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -2010,9 +1921,7 @@ mask64_2_operand (op, mode)
/* Generates shifts and masks for a pair of rldicl or rldicr insns to
implement ANDing by the mask IN. */
void
-build_mask64_2_operands (in, out)
- rtx in;
- rtx *out;
+build_mask64_2_operands (rtx in, rtx *out)
{
#if HOST_BITS_PER_WIDE_INT >= 64
unsigned HOST_WIDE_INT c, lsb, m1, m2;
@@ -2083,9 +1992,7 @@ build_mask64_2_operands (in, out)
that can be used as the operand of a PowerPC64 logical AND insn. */
int
-and64_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+and64_operand (rtx op, enum machine_mode mode)
{
if (fixed_regs[CR0_REGNO]) /* CR0 not available, don't do andi./andis. */
return (gpc_reg_operand (op, mode) || mask64_operand (op, mode));
@@ -2097,9 +2004,7 @@ and64_operand (op, mode)
with two rldicl or rldicr insns. */
int
-and64_2_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+and64_2_operand (rtx op, enum machine_mode mode)
{
if (fixed_regs[CR0_REGNO]) /* CR0 not available, don't do andi./andis. */
return gpc_reg_operand (op, mode) || mask64_2_operand (op, mode);
@@ -2111,9 +2016,7 @@ and64_2_operand (op, mode)
constant that can be used as the operand of an RS/6000 logical AND insn. */
int
-and_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+and_operand (rtx op, enum machine_mode mode)
{
if (fixed_regs[CR0_REGNO]) /* CR0 not available, don't do andi./andis. */
return (gpc_reg_operand (op, mode) || mask_operand (op, mode));
@@ -2124,9 +2027,7 @@ and_operand (op, mode)
/* Return 1 if the operand is a general register or memory operand. */
int
-reg_or_mem_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_mem_operand (rtx op, enum machine_mode mode)
{
return (gpc_reg_operand (op, mode)
|| memory_operand (op, mode)
@@ -2138,9 +2039,7 @@ reg_or_mem_operand (op, mode)
instruction. */
int
-lwa_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+lwa_operand (rtx op, enum machine_mode mode)
{
rtx inner = op;
@@ -2159,9 +2058,7 @@ lwa_operand (op, mode)
/* Return 1 if the operand, used inside a MEM, is a SYMBOL_REF. */
int
-symbol_ref_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+symbol_ref_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != mode)
return 0;
@@ -2174,9 +2071,7 @@ symbol_ref_operand (op, mode)
to CALL. This is a SYMBOL_REF, a pseudo-register, LR or CTR. */
int
-call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != mode)
return 0;
@@ -2192,9 +2087,8 @@ call_operand (op, mode)
this file. */
int
-current_file_function_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+current_file_function_operand (rtx op,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == SYMBOL_REF
&& (DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op))
@@ -2205,9 +2099,7 @@ current_file_function_operand (op, mode)
/* Return 1 if this operand is a valid input for a move insn. */
int
-input_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+input_operand (rtx op, enum machine_mode mode)
{
/* Memory is always valid. */
if (memory_operand (op, mode))
@@ -2267,9 +2159,8 @@ input_operand (op, mode)
/* Return 1 for an operand in small memory on V.4/eabi. */
int
-small_data_operand (op, mode)
- rtx op ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_data_operand (rtx op ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
#if TARGET_ELF
rtx sym_ref;
@@ -2327,10 +2218,7 @@ altivec_in_gprs_p (rtx op0, rtx op1)
/* Subroutines of rs6000_legitimize_address and rs6000_legitimate_address. */
static int
-constant_pool_expr_1 (op, have_sym, have_toc)
- rtx op;
- int *have_sym;
- int *have_toc;
+constant_pool_expr_1 (rtx op, int *have_sym, int *have_toc)
{
switch (GET_CODE(op))
{
@@ -2368,8 +2256,7 @@ constant_pool_expr_1 (op, have_sym, have_toc)
}
static bool
-constant_pool_expr_p (op)
- rtx op;
+constant_pool_expr_p (rtx op)
{
int have_sym = 0;
int have_toc = 0;
@@ -2377,8 +2264,7 @@ constant_pool_expr_p (op)
}
static bool
-toc_relative_expr_p (op)
- rtx op;
+toc_relative_expr_p (rtx op)
{
int have_sym = 0;
int have_toc = 0;
@@ -2389,8 +2275,7 @@ toc_relative_expr_p (op)
#define SPE_CONST_OFFSET_OK(x) (((x) & ~0xf8) == 0)
bool
-legitimate_constant_pool_address_p (x)
- rtx x;
+legitimate_constant_pool_address_p (rtx x)
{
return (TARGET_TOC
&& GET_CODE (x) == PLUS
@@ -2400,9 +2285,7 @@ legitimate_constant_pool_address_p (x)
}
static bool
-legitimate_small_data_p (mode, x)
- enum machine_mode mode;
- rtx x;
+legitimate_small_data_p (enum machine_mode mode, rtx x)
{
return (DEFAULT_ABI == ABI_V4
&& !flag_pic && !TARGET_TOC
@@ -2411,10 +2294,7 @@ legitimate_small_data_p (mode, x)
}
static bool
-legitimate_offset_address_p (mode, x, strict)
- enum machine_mode mode;
- rtx x;
- int strict;
+legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict)
{
unsigned HOST_WIDE_INT offset, extra;
@@ -2473,9 +2353,7 @@ legitimate_offset_address_p (mode, x, strict)
}
static bool
-legitimate_indexed_address_p (x, strict)
- rtx x;
- int strict;
+legitimate_indexed_address_p (rtx x, int strict)
{
rtx op0, op1;
@@ -2494,18 +2372,13 @@ legitimate_indexed_address_p (x, strict)
}
static inline bool
-legitimate_indirect_address_p (x, strict)
- rtx x;
- int strict;
+legitimate_indirect_address_p (rtx x, int strict)
{
return GET_CODE (x) == REG && INT_REG_OK_FOR_BASE_P (x, strict);
}
static bool
-legitimate_lo_sum_address_p (mode, x, strict)
- enum machine_mode mode;
- rtx x;
- int strict;
+legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict)
{
if (GET_CODE (x) != LO_SUM)
return false;
@@ -2558,10 +2431,8 @@ legitimate_lo_sum_address_p (mode, x, strict)
load the other things into a register and return the sum. */
rtx
-rs6000_legitimize_address (x, oldx, mode)
- rtx x;
- rtx oldx ATTRIBUTE_UNUSED;
- enum machine_mode mode;
+rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
+ enum machine_mode mode)
{
if (GET_CODE (x) == SYMBOL_REF)
{
@@ -2674,7 +2545,7 @@ rs6000_legitimize_address (x, oldx, mode)
static GTY(()) rtx rs6000_tls_symbol;
static rtx
-rs6000_tls_get_addr ()
+rs6000_tls_get_addr (void)
{
if (!rs6000_tls_symbol)
rs6000_tls_symbol = init_one_libfunc ("__tls_get_addr");
@@ -2686,7 +2557,7 @@ rs6000_tls_get_addr ()
static GTY(()) rtx rs6000_got_symbol;
static rtx
-rs6000_got_sym ()
+rs6000_got_sym (void)
{
if (!rs6000_got_symbol)
{
@@ -2702,9 +2573,7 @@ rs6000_got_sym ()
this (thread-local) address. */
static rtx
-rs6000_legitimize_tls_address (addr, model)
- rtx addr;
- enum tls_model model;
+rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
{
rtx dest, insn;
@@ -2890,9 +2759,7 @@ rs6000_legitimize_tls_address (addr, model)
instruction definitions. */
int
-rs6000_tls_symbol_ref (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+rs6000_tls_symbol_ref (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return RS6000_SYMBOL_REF_TLS_P (x);
}
@@ -2900,8 +2767,7 @@ rs6000_tls_symbol_ref (x, mode)
/* Return 1 if X contains a thread-local symbol. */
bool
-rs6000_tls_referenced_p (x)
- rtx x;
+rs6000_tls_referenced_p (rtx x)
{
return for_each_rtx (&x, &rs6000_tls_symbol_ref_1, 0);
}
@@ -2910,9 +2776,7 @@ rs6000_tls_referenced_p (x)
rs6000_tls_symbol_ref except for the type of the unused argument. */
static inline int
-rs6000_tls_symbol_ref_1 (x, data)
- rtx *x;
- void *data ATTRIBUTE_UNUSED;
+rs6000_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
{
return RS6000_SYMBOL_REF_TLS_P (*x);
}
@@ -2938,13 +2802,8 @@ rs6000_tls_symbol_ref_1 (x, data)
The Darwin code is inside #if TARGET_MACHO because only then is
machopic_function_base_name() defined. */
rtx
-rs6000_legitimize_reload_address (x, mode, opnum, type, ind_levels, win)
- rtx x;
- enum machine_mode mode;
- int opnum;
- int type;
- int ind_levels ATTRIBUTE_UNUSED;
- int *win;
+rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
+ int opnum, int type, int ind_levels ATTRIBUTE_UNUSED, int *win)
{
/* We must recognize output that we have already generated ourselves. */
if (GET_CODE (x) == PLUS
@@ -3080,10 +2939,7 @@ rs6000_legitimize_reload_address (x, mode, opnum, type, ind_levels, win)
adjacent memory cells are accessed by adding word-sized offsets
during assembly output. */
int
-rs6000_legitimate_address (mode, x, reg_ok_strict)
- enum machine_mode mode;
- rtx x;
- int reg_ok_strict;
+rs6000_legitimate_address (enum machine_mode mode, rtx x, int reg_ok_strict)
{
if (RS6000_SYMBOL_REF_TLS_P (x))
return 0;
@@ -3132,8 +2988,7 @@ rs6000_legitimate_address (mode, x, reg_ok_strict)
sub-words of a TFmode operand, which is what we had before. */
bool
-rs6000_mode_dependent_address (addr)
- rtx addr;
+rs6000_mode_dependent_address (rtx addr)
{
switch (GET_CODE (addr))
{
@@ -3166,10 +3021,8 @@ rs6000_mode_dependent_address (addr)
insns, zero is returned and no insns and emitted. */
rtx
-rs6000_emit_set_const (dest, mode, source, n)
- rtx dest, source;
- enum machine_mode mode;
- int n ATTRIBUTE_UNUSED;
+rs6000_emit_set_const (rtx dest, enum machine_mode mode,
+ rtx source, int n ATTRIBUTE_UNUSED)
{
rtx result, insn, set;
HOST_WIDE_INT c0, c1;
@@ -3231,9 +3084,7 @@ rs6000_emit_set_const (dest, mode, source, n)
exponential run times encountered when looking for longer sequences
with rs6000_emit_set_const. */
static rtx
-rs6000_emit_set_long_const (dest, c1, c2)
- rtx dest;
- HOST_WIDE_INT c1, c2;
+rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2)
{
if (!TARGET_POWERPC64)
{
@@ -3317,10 +3168,7 @@ rs6000_emit_set_long_const (dest, c1, c2)
/* Emit a move from SOURCE to DEST in mode MODE. */
void
-rs6000_emit_move (dest, source, mode)
- rtx dest;
- rtx source;
- enum machine_mode mode;
+rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode)
{
rtx operands[2];
operands[0] = dest;
@@ -3669,12 +3517,8 @@ rs6000_emit_move (dest, source, mode)
so we never return a PARALLEL. */
void
-init_cumulative_args (cum, fntype, libname, incoming, libcall)
- CUMULATIVE_ARGS *cum;
- tree fntype;
- rtx libname ATTRIBUTE_UNUSED;
- int incoming;
- int libcall;
+init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
+ rtx libname ATTRIBUTE_UNUSED, int incoming, int libcall)
{
static CUMULATIVE_ARGS zero_cumulative;
@@ -3702,8 +3546,6 @@ init_cumulative_args (cum, fntype, libname, incoming, libcall)
else
cum->nargs_prototype = 0;
- cum->orig_nargs = cum->nargs_prototype;
-
/* Check for a longcall attribute. */
if (fntype
&& lookup_attribute ("longcall", TYPE_ATTRIBUTES (fntype))
@@ -3738,21 +3580,52 @@ init_cumulative_args (cum, fntype, libname, incoming, libcall)
argument slot. */
enum direction
-function_arg_padding (mode, type)
- enum machine_mode mode;
- tree type;
+function_arg_padding (enum machine_mode mode, tree type)
{
- if (type != 0 && AGGREGATE_TYPE_P (type))
- return upward;
+#ifndef AGGREGATE_PADDING_FIXED
+#define AGGREGATE_PADDING_FIXED 0
+#endif
+#ifndef AGGREGATES_PAD_UPWARD_ALWAYS
+#define AGGREGATES_PAD_UPWARD_ALWAYS 0
+#endif
+
+ if (!AGGREGATE_PADDING_FIXED)
+ {
+ /* GCC used to pass structures of the same size as integer types as
+ if they were in fact integers, ignoring FUNCTION_ARG_PADDING.
+ ie. Structures of size 1 or 2 (or 4 when TARGET_64BIT) were
+ passed padded downward, except that -mstrict-align further
+ muddied the water in that multi-component structures of 2 and 4
+ bytes in size were passed padded upward.
+
+ The following arranges for best compatibility with previous
+ versions of gcc, but removes the -mstrict-align dependency. */
+ if (BYTES_BIG_ENDIAN)
+ {
+ HOST_WIDE_INT size = 0;
+
+ if (mode == BLKmode)
+ {
+ if (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
+ size = int_size_in_bytes (type);
+ }
+ else
+ size = GET_MODE_SIZE (mode);
- /* This is the default definition. */
- return (! BYTES_BIG_ENDIAN
- ? upward
- : ((mode == BLKmode
- ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && int_size_in_bytes (type) < (PARM_BOUNDARY / BITS_PER_UNIT))
- : GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)
- ? downward : upward));
+ if (size == 1 || size == 2 || size == 4)
+ return downward;
+ }
+ return upward;
+ }
+
+ if (AGGREGATES_PAD_UPWARD_ALWAYS)
+ {
+ if (type != 0 && AGGREGATE_TYPE_P (type))
+ return upward;
+ }
+
+ /* Fall back to the default. */
+ return DEFAULT_FUNCTION_ARG_PADDING (mode, type);
}
/* If defined, a C expression that gives the alignment boundary, in bits,
@@ -3762,9 +3635,7 @@ function_arg_padding (mode, type)
V.4 wants long longs to be double word aligned. */
int
-function_arg_boundary (mode, type)
- enum machine_mode mode;
- tree type ATTRIBUTE_UNUSED;
+function_arg_boundary (enum machine_mode mode, tree type ATTRIBUTE_UNUSED)
{
if (DEFAULT_ABI == ABI_V4 && (mode == DImode || mode == DFmode))
return 64;
@@ -3781,11 +3652,8 @@ function_arg_boundary (mode, type)
(TYPE is null for libcalls where that information may not be available.) */
void
-function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
+function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named)
{
cum->nargs_prototype--;
@@ -3880,7 +3748,8 @@ function_arg_advance (cum, mode, type, named)
/* 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)
+rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type)
{
if (cum->stdarg)
{
@@ -3938,11 +3807,8 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type
doesn't support PARALLEL anyway. */
struct rtx_def *
-function_arg (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
+function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named)
{
enum rs6000_abi abi = DEFAULT_ABI;
@@ -4065,11 +3931,8 @@ function_arg (cum, mode, type, named)
For args passed entirely in registers or entirely in memory, zero. */
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)
{
if (DEFAULT_ABI == ABI_V4)
return 0;
@@ -4106,11 +3969,9 @@ function_arg_partial_nregs (cum, mode, type, named)
reference. */
int
-function_arg_pass_by_reference (cum, mode, type, named)
- CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type, int named ATTRIBUTE_UNUSED)
{
if (DEFAULT_ABI == ABI_V4
&& ((type && AGGREGATE_TYPE_P (type))
@@ -4139,13 +4000,8 @@ function_arg_pass_by_reference (cum, mode, type, named)
stack and set PRETEND_SIZE to the length of the registers pushed. */
void
-setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int *pretend_size ATTRIBUTE_UNUSED;
- int no_rtl;
-
+setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int *pretend_size ATTRIBUTE_UNUSED, int no_rtl)
{
CUMULATIVE_ARGS next_cum;
int reg_size = TARGET_32BIT ? 4 : 8;
@@ -4233,7 +4089,7 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
/* Create the va_list data type. */
tree
-rs6000_build_va_list ()
+rs6000_build_va_list (void)
{
tree f_gpr, f_fpr, f_res, f_ovf, f_sav, record, type_decl;
@@ -4281,9 +4137,7 @@ rs6000_build_va_list ()
/* Implement va_start. */
void
-rs6000_va_start (valist, nextarg)
- tree valist;
- rtx nextarg;
+rs6000_va_start (tree valist, rtx nextarg)
{
HOST_WIDE_INT words, n_gpr, n_fpr;
tree f_gpr, f_fpr, f_res, f_ovf, f_sav;
@@ -4347,8 +4201,7 @@ rs6000_va_start (valist, nextarg)
/* Implement va_arg. */
rtx
-rs6000_va_arg (valist, type)
- tree valist, type;
+rs6000_va_arg (tree valist, tree type)
{
tree f_gpr, f_fpr, f_res, f_ovf, f_sav;
tree gpr, fpr, ovf, sav, reg, t, u;
@@ -4973,18 +4826,13 @@ static struct builtin_description bdesc_1arg[] =
{ 0, CODE_FOR_spe_evsubfsmiaaw, "__builtin_spe_evsubfsmiaaw", SPE_BUILTIN_EVSUBFSMIAAW },
{ 0, CODE_FOR_spe_evsubfssiaaw, "__builtin_spe_evsubfssiaaw", SPE_BUILTIN_EVSUBFSSIAAW },
{ 0, CODE_FOR_spe_evsubfumiaaw, "__builtin_spe_evsubfumiaaw", SPE_BUILTIN_EVSUBFUMIAAW },
- { 0, CODE_FOR_spe_evsplatfi, "__builtin_spe_evsplatfi", SPE_BUILTIN_EVSPLATFI },
- { 0, CODE_FOR_spe_evsplati, "__builtin_spe_evsplati", SPE_BUILTIN_EVSPLATI },
/* Place-holder. Leave as last unary SPE builtin. */
{ 0, CODE_FOR_spe_evsubfusiaaw, "__builtin_spe_evsubfusiaaw", SPE_BUILTIN_EVSUBFUSIAAW },
};
static rtx
-rs6000_expand_unop_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+rs6000_expand_unop_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
tree arg0 = TREE_VALUE (arglist);
@@ -5033,10 +4881,7 @@ rs6000_expand_unop_builtin (icode, arglist, target)
}
static rtx
-altivec_expand_abs_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+altivec_expand_abs_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat, scratch1, scratch2;
tree arg0 = TREE_VALUE (arglist);
@@ -5068,10 +4913,7 @@ altivec_expand_abs_builtin (icode, arglist, target)
}
static rtx
-rs6000_expand_binop_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+rs6000_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
tree arg0 = TREE_VALUE (arglist);
@@ -5143,11 +4985,8 @@ rs6000_expand_binop_builtin (icode, arglist, target)
}
static rtx
-altivec_expand_predicate_builtin (icode, opcode, arglist, target)
- enum insn_code icode;
- const char *opcode;
- tree arglist;
- rtx target;
+altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode,
+ tree arglist, rtx target)
{
rtx pat, scratch;
tree cr6_form = TREE_VALUE (arglist);
@@ -5224,9 +5063,7 @@ altivec_expand_predicate_builtin (icode, opcode, arglist, target)
}
static rtx
-altivec_expand_stv_builtin (icode, arglist)
- enum insn_code icode;
- tree arglist;
+altivec_expand_stv_builtin (enum insn_code icode, tree arglist)
{
tree arg0 = TREE_VALUE (arglist);
tree arg1 = TREE_VALUE (TREE_CHAIN (arglist));
@@ -5259,10 +5096,7 @@ altivec_expand_stv_builtin (icode, arglist)
}
static rtx
-rs6000_expand_ternop_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+rs6000_expand_ternop_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
tree arg0 = TREE_VALUE (arglist);
@@ -5322,10 +5156,7 @@ rs6000_expand_ternop_builtin (icode, arglist, target)
/* Expand the lvx builtins. */
static rtx
-altivec_expand_ld_builtin (exp, target, expandedp)
- tree exp;
- rtx target;
- bool *expandedp;
+altivec_expand_ld_builtin (tree exp, rtx target, bool *expandedp)
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
@@ -5378,10 +5209,8 @@ altivec_expand_ld_builtin (exp, target, expandedp)
/* Expand the stvx builtins. */
static rtx
-altivec_expand_st_builtin (exp, target, expandedp)
- tree exp;
- rtx target ATTRIBUTE_UNUSED;
- bool *expandedp;
+altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED,
+ bool *expandedp)
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
@@ -5432,10 +5261,8 @@ altivec_expand_st_builtin (exp, target, expandedp)
/* Expand the dst builtins. */
static rtx
-altivec_expand_dst_builtin (exp, target, expandedp)
- tree exp;
- rtx target ATTRIBUTE_UNUSED;
- bool *expandedp;
+altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED,
+ bool *expandedp)
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
@@ -5495,10 +5322,7 @@ altivec_expand_dst_builtin (exp, target, expandedp)
/* Expand the builtin in EXP and store the result in TARGET. Store
true in *EXPANDEDP if we found a builtin to expand. */
static rtx
-altivec_expand_builtin (exp, target, expandedp)
- tree exp;
- rtx target;
- bool *expandedp;
+altivec_expand_builtin (tree exp, rtx target, bool *expandedp)
{
struct builtin_description *d;
struct builtin_description_predicates *dp;
@@ -5678,10 +5502,7 @@ static struct builtin_description bdesc_2arg_spe[] =
This expands the SPE builtins that are not simple unary and binary
operations. */
static rtx
-spe_expand_builtin (exp, target, expandedp)
- tree exp;
- rtx target;
- bool *expandedp;
+spe_expand_builtin (tree exp, rtx target, bool *expandedp)
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
@@ -5717,6 +5538,19 @@ spe_expand_builtin (exp, target, expandedp)
break;
}
+ /* The evsplat*i instructions are not quite generic. */
+ switch (fcode)
+ {
+ case SPE_BUILTIN_EVSPLATFI:
+ return rs6000_expand_unop_builtin (CODE_FOR_spe_evsplatfi,
+ arglist, target);
+ case SPE_BUILTIN_EVSPLATI:
+ return rs6000_expand_unop_builtin (CODE_FOR_spe_evsplati,
+ arglist, target);
+ default:
+ break;
+ }
+
d = (struct builtin_description *) bdesc_2arg_spe;
for (i = 0; i < ARRAY_SIZE (bdesc_2arg_spe); ++i, ++d)
if (d->code == fcode)
@@ -5801,10 +5635,7 @@ spe_expand_builtin (exp, target, expandedp)
}
static rtx
-spe_expand_predicate_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+spe_expand_predicate_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat, scratch, tmp;
tree form = TREE_VALUE (arglist);
@@ -5913,10 +5744,7 @@ spe_expand_predicate_builtin (icode, arglist, target)
*/
static rtx
-spe_expand_evsel_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+spe_expand_evsel_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat, scratch;
tree arg0 = TREE_VALUE (arglist);
@@ -5973,12 +5801,9 @@ spe_expand_evsel_builtin (icode, arglist, target)
IGNORE is nonzero if the value is to be ignored. */
static rtx
-rs6000_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;
+rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int ignore ATTRIBUTE_UNUSED)
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
@@ -6029,7 +5854,7 @@ rs6000_expand_builtin (exp, target, subtarget, mode, ignore)
}
static void
-rs6000_init_builtins ()
+rs6000_init_builtins (void)
{
opaque_V2SI_type_node = copy_node (V2SI_type_node);
opaque_V2SF_type_node = copy_node (V2SF_type_node);
@@ -6049,10 +5874,9 @@ rs6000_init_builtins ()
START is the builtin enum at which to start.
END is the builtin enum at which to end. */
static void
-enable_mask_for_builtins (desc, size, start, end)
- struct builtin_description *desc;
- int size;
- enum rs6000_builtins start, end;
+enable_mask_for_builtins (struct builtin_description *desc, int size,
+ enum rs6000_builtins start,
+ enum rs6000_builtins end)
{
int i;
@@ -6073,7 +5897,7 @@ enable_mask_for_builtins (desc, size, start, end)
}
static void
-spe_init_builtins ()
+spe_init_builtins (void)
{
tree endlink = void_list_node;
tree puint_type_node = build_pointer_type (unsigned_type_node);
@@ -6172,6 +5996,11 @@ spe_init_builtins ()
tree_cons (NULL_TREE, integer_type_node,
endlink)));
+ tree v2si_ftype_signed_char
+ = build_function_type (opaque_V2SI_type_node,
+ tree_cons (NULL_TREE, signed_char_type_node,
+ endlink));
+
/* The initialization of the simple binary and unary builtins is
done in rs6000_common_init_builtins, but we have to enable the
mask bits here manually because we have run out of `target_flags'
@@ -6194,6 +6023,10 @@ spe_init_builtins ()
SPE_BUILTIN_EVSEL_CMPGTS,
SPE_BUILTIN_EVSEL_FSTSTEQ);
+ (*lang_hooks.decls.pushdecl)
+ (build_decl (TYPE_DECL, get_identifier ("__ev64_opaque__"),
+ opaque_V2SI_type_node));
+
/* Initialize irregular SPE builtins. */
def_builtin (target_flags, "__builtin_spe_mtspefscr", void_ftype_int, SPE_BUILTIN_MTSPEFSCR);
@@ -6212,6 +6045,8 @@ spe_init_builtins ()
def_builtin (target_flags, "__builtin_spe_evstwho", void_ftype_v2si_puint_char, SPE_BUILTIN_EVSTWHO);
def_builtin (target_flags, "__builtin_spe_evstwwe", void_ftype_v2si_puint_char, SPE_BUILTIN_EVSTWWE);
def_builtin (target_flags, "__builtin_spe_evstwwo", void_ftype_v2si_puint_char, SPE_BUILTIN_EVSTWWO);
+ def_builtin (target_flags, "__builtin_spe_evsplatfi", v2si_ftype_signed_char, SPE_BUILTIN_EVSPLATFI);
+ def_builtin (target_flags, "__builtin_spe_evsplati", v2si_ftype_signed_char, SPE_BUILTIN_EVSPLATI);
/* Loads. */
def_builtin (target_flags, "__builtin_spe_evlddx", v2si_ftype_pv2si_int, SPE_BUILTIN_EVLDDX);
@@ -6281,7 +6116,7 @@ spe_init_builtins ()
}
static void
-altivec_init_builtins ()
+altivec_init_builtins (void)
{
struct builtin_description *d;
struct builtin_description_predicates *dp;
@@ -6480,7 +6315,7 @@ altivec_init_builtins ()
}
static void
-rs6000_common_init_builtins ()
+rs6000_common_init_builtins (void)
{
struct builtin_description *d;
size_t i;
@@ -6950,8 +6785,7 @@ rs6000_common_init_builtins ()
#define MAX_MOVE_REG 4
int
-expand_block_move (operands)
- rtx operands[];
+expand_block_move (rtx operands[])
{
rtx orig_dest = operands[0];
rtx orig_src = operands[1];
@@ -6987,8 +6821,8 @@ expand_block_move (operands)
for (offset = 0; bytes > 0; offset += move_bytes, bytes -= move_bytes)
{
union {
- rtx (*movstrsi) PARAMS ((rtx, rtx, rtx, rtx));
- rtx (*mov) PARAMS ((rtx, rtx));
+ rtx (*movstrsi) (rtx, rtx, rtx, rtx);
+ rtx (*mov) (rtx, rtx);
} gen_func;
enum machine_mode mode = BLKmode;
rtx src, dest;
@@ -7118,9 +6952,7 @@ expand_block_move (operands)
PARALLEL and the first section will be tested. */
int
-load_multiple_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+load_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count = XVECLEN (op, 0);
unsigned int dest_regno;
@@ -7161,9 +6993,7 @@ load_multiple_operation (op, mode)
is a CLOBBER. It will be tested later. */
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 = XVECLEN (op, 0) - 1;
unsigned int src_regno;
@@ -7206,8 +7036,7 @@ store_multiple_operation (op, mode)
operands[2] is the first destination register. */
const char *
-rs6000_output_load_multiple (operands)
- rtx operands[3];
+rs6000_output_load_multiple (rtx operands[3])
{
/* We have to handle the case where the pseudo used to contain the address
is assigned to one of the output registers. */
@@ -7261,9 +7090,7 @@ rs6000_output_load_multiple (operands)
/* Return 1 for a parallel vrsave operation. */
int
-vrsave_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+vrsave_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count = XVECLEN (op, 0);
unsigned int dest_regno, src_regno;
@@ -7297,9 +7124,7 @@ vrsave_operation (op, mode)
/* Return 1 for an PARALLEL suitable for mfcr. */
int
-mfcr_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mfcr_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count = XVECLEN (op, 0);
int i;
@@ -7347,9 +7172,7 @@ mfcr_operation (op, mode)
/* Return 1 for an PARALLEL suitable for mtcrf. */
int
-mtcrf_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mtcrf_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count = XVECLEN (op, 0);
int i;
@@ -7396,9 +7219,7 @@ mtcrf_operation (op, mode)
/* Return 1 for an PARALLEL suitable for lmw. */
int
-lmw_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+lmw_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count = XVECLEN (op, 0);
unsigned int dest_regno;
@@ -7474,9 +7295,7 @@ lmw_operation (op, mode)
/* Return 1 for an PARALLEL suitable for stmw. */
int
-stmw_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+stmw_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count = XVECLEN (op, 0);
unsigned int src_regno;
@@ -7554,9 +7373,7 @@ stmw_operation (op, mode)
never be generated. */
static void
-validate_condition_mode (code, mode)
- enum rtx_code code;
- enum machine_mode mode;
+validate_condition_mode (enum rtx_code code, enum machine_mode mode)
{
if (GET_RTX_CLASS (code) != '<'
|| GET_MODE_CLASS (mode) != MODE_CC)
@@ -7597,9 +7414,7 @@ validate_condition_mode (code, mode)
We only check the opcode against the mode of the CC value here. */
int
-branch_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+branch_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
enum machine_mode cc_mode;
@@ -7621,9 +7436,7 @@ branch_comparison_operator (op, mode)
is set. */
int
-branch_positive_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+branch_positive_comparison_operator (rtx op, enum machine_mode mode)
{
enum rtx_code code;
@@ -7641,17 +7454,13 @@ branch_positive_comparison_operator (op, mode)
insn: it must be a positive comparison. */
int
-scc_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+scc_comparison_operator (rtx op, enum machine_mode mode)
{
return branch_positive_comparison_operator (op, mode);
}
int
-trap_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+trap_comparison_operator (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -7659,27 +7468,21 @@ trap_comparison_operator (op, mode)
}
int
-boolean_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+boolean_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
return (code == AND || code == IOR || code == XOR);
}
int
-boolean_or_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+boolean_or_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
return (code == IOR || code == XOR);
}
int
-min_max_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+min_max_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
return (code == SMIN || code == SMAX || code == UMIN || code == UMAX);
@@ -7690,9 +7493,7 @@ min_max_operator (op, mode)
left insn of SHIFTOP bits. Both are known to be SImode CONST_INT. */
int
-includes_lshift_p (shiftop, andop)
- rtx shiftop;
- rtx andop;
+includes_lshift_p (rtx shiftop, rtx andop)
{
unsigned HOST_WIDE_INT shift_mask = ~(unsigned HOST_WIDE_INT) 0;
@@ -7704,9 +7505,7 @@ includes_lshift_p (shiftop, andop)
/* Similar, but for right shift. */
int
-includes_rshift_p (shiftop, andop)
- rtx shiftop;
- rtx andop;
+includes_rshift_p (rtx shiftop, rtx andop)
{
unsigned HOST_WIDE_INT shift_mask = ~(unsigned HOST_WIDE_INT) 0;
@@ -7720,9 +7519,7 @@ includes_rshift_p (shiftop, andop)
significant 0's, then one or more 1's, then zero or more 0's. */
int
-includes_rldic_lshift_p (shiftop, andop)
- rtx shiftop;
- rtx andop;
+includes_rldic_lshift_p (rtx shiftop, rtx andop)
{
if (GET_CODE (andop) == CONST_INT)
{
@@ -7815,9 +7612,7 @@ includes_rldic_lshift_p (shiftop, andop)
significant 0's, with the remainder of the word 1's. */
int
-includes_rldicr_lshift_p (shiftop, andop)
- rtx shiftop;
- rtx andop;
+includes_rldicr_lshift_p (rtx shiftop, rtx andop)
{
if (GET_CODE (andop) == CONST_INT)
{
@@ -7889,8 +7684,7 @@ includes_rldicr_lshift_p (shiftop, andop)
abort if we are passed pseudo registers. */
int
-registers_ok_for_quad_peep (reg1, reg2)
- rtx reg1, reg2;
+registers_ok_for_quad_peep (rtx reg1, rtx reg2)
{
/* We might have been passed a SUBREG. */
if (GET_CODE (reg1) != REG || GET_CODE (reg2) != REG)
@@ -7904,9 +7698,7 @@ registers_ok_for_quad_peep (reg1, reg2)
(addr2 == addr1 + 8). */
int
-addrs_ok_for_quad_peep (addr1, addr2)
- rtx addr1;
- rtx addr2;
+addrs_ok_for_quad_peep (rtx addr1, rtx addr2)
{
unsigned int reg1;
int offset1;
@@ -7935,9 +7727,9 @@ addrs_ok_for_quad_peep (addr1, addr2)
offset1 = 0;
}
-/* Make sure the second address is a (mem (plus (reg) (const_int)))
- or if it is (mem (reg)) then make sure that offset1 is -8 and the same
- register as addr1. */
+ /* Make sure the second address is a (mem (plus (reg) (const_int)))
+ or if it is (mem (reg)) then make sure that offset1 is -8 and the same
+ register as addr1. */
if (offset1 == -8 && GET_CODE (addr2) == REG && reg1 == REGNO (addr2))
return 1;
if (GET_CODE (addr2) != PLUS)
@@ -7964,10 +7756,8 @@ addrs_ok_for_quad_peep (addr1, addr2)
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;
@@ -8045,9 +7835,7 @@ secondary_reload_class (class, mode, in)
Return -1 if OP isn't a valid comparison for some reason. */
int
-ccr_bit (op, scc_p)
- rtx op;
- int scc_p;
+ccr_bit (rtx op, int scc_p)
{
enum rtx_code code = GET_CODE (op);
enum machine_mode cc_mode;
@@ -8112,8 +7900,7 @@ ccr_bit (op, scc_p)
/* Return the GOT register. */
struct rtx_def *
-rs6000_got_register (value)
- rtx value ATTRIBUTE_UNUSED;
+rs6000_got_register (rtx value ATTRIBUTE_UNUSED)
{
/* The second flow pass currently (June 1999) can't update
regs_ever_live without disturbing other parts of the compiler, so
@@ -8131,7 +7918,7 @@ rs6000_got_register (value)
from push_function_context. */
static struct machine_function *
-rs6000_init_machine_status ()
+rs6000_init_machine_status (void)
{
return ggc_alloc_cleared (sizeof (machine_function));
}
@@ -8145,8 +7932,7 @@ rs6000_init_machine_status ()
(GET_CODE (X) == CONST_INT ? INTVAL (X) : CONST_DOUBLE_LOW (X))
int
-extract_MB (op)
- rtx op;
+extract_MB (rtx op)
{
int i;
unsigned long val = INT_LOWPART (op);
@@ -8179,8 +7965,7 @@ extract_MB (op)
}
int
-extract_ME (op)
- rtx op;
+extract_ME (rtx op)
{
int i;
unsigned long val = INT_LOWPART (op);
@@ -8217,7 +8002,7 @@ extract_ME (op)
so that we can print its name in some tls_ld pattern. */
static const char *
-rs6000_get_some_local_dynamic_name ()
+rs6000_get_some_local_dynamic_name (void)
{
rtx insn;
@@ -8236,9 +8021,7 @@ rs6000_get_some_local_dynamic_name ()
/* Helper function for rs6000_get_some_local_dynamic_name. */
static int
-rs6000_get_some_local_dynamic_name_1 (px, data)
- rtx *px;
- void *data ATTRIBUTE_UNUSED;
+rs6000_get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
{
rtx x = *px;
@@ -8266,10 +8049,7 @@ rs6000_get_some_local_dynamic_name_1 (px, data)
#endif
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
int i;
HOST_WIDE_INT val;
@@ -8887,9 +8667,7 @@ print_operand (file, x, code)
/* Print the address of an operand. */
void
-print_operand_address (file, x)
- FILE *file;
- rtx x;
+print_operand_address (FILE *file, rtx x)
{
if (GET_CODE (x) == REG)
fprintf (file, "0(%s)", reg_names[ REGNO (x) ]);
@@ -8978,16 +8756,13 @@ print_operand_address (file, x)
targets. */
static bool
-rs6000_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+rs6000_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
#ifdef RELOCATABLE_NEEDS_FIXUP
/* Special handling for SI values. */
if (size == 4 && aligned_p)
{
- extern int in_toc_section PARAMS ((void));
+ extern int in_toc_section (void);
static int recurse = 0;
/* For -mrelocatable, we mark all addresses that need to be fixed up
@@ -9041,9 +8816,7 @@ rs6000_assemble_integer (x, size, aligned_p)
VISIBILITY_TYPE. */
static void
-rs6000_assemble_visibility (decl, vis)
- tree decl;
- int vis;
+rs6000_assemble_visibility (tree decl, int vis)
{
/* Functions need to have their entry point symbol visibility set as
well as their descriptor symbol visibility. */
@@ -9068,9 +8841,7 @@ rs6000_assemble_visibility (decl, vis)
#endif
enum rtx_code
-rs6000_reverse_condition (mode, code)
- enum machine_mode mode;
- enum rtx_code code;
+rs6000_reverse_condition (enum machine_mode mode, enum rtx_code code)
{
/* Reversal of FP compares takes care -- an ordered compare
becomes an unordered compare and vice versa. */
@@ -9087,8 +8858,7 @@ rs6000_reverse_condition (mode, code)
represents the result of the compare. */
static rtx
-rs6000_generate_compare (code)
- enum rtx_code code;
+rs6000_generate_compare (enum rtx_code code)
{
enum machine_mode comp_mode;
rtx compare_result;
@@ -9272,9 +9042,7 @@ rs6000_generate_compare (code)
/* Emit the RTL for an sCOND pattern. */
void
-rs6000_emit_sCOND (code, result)
- enum rtx_code code;
- rtx result;
+rs6000_emit_sCOND (enum rtx_code code, rtx result)
{
rtx condition_rtx;
enum machine_mode op_mode;
@@ -9320,9 +9088,7 @@ rs6000_emit_sCOND (code, result)
/* Emit a branch of kind CODE to location LOC. */
void
-rs6000_emit_cbranch (code, loc)
- enum rtx_code code;
- rtx loc;
+rs6000_emit_cbranch (enum rtx_code code, rtx loc)
{
rtx condition_rtx, loc_ref;
@@ -9346,11 +9112,7 @@ rs6000_emit_cbranch (code, loc)
INSN is the insn. */
char *
-output_cbranch (op, label, reversed, insn)
- rtx op;
- const char * label;
- int reversed;
- rtx insn;
+output_cbranch (rtx op, const char *label, int reversed, rtx insn)
{
static char string[64];
enum rtx_code code = GET_CODE (op);
@@ -9472,11 +9234,7 @@ output_cbranch (op, label, reversed, insn)
is zero/false. Return 0 if the hardware has no such operation. */
int
-rs6000_emit_cmove (dest, op, true_cond, false_cond)
- rtx dest;
- rtx op;
- rtx true_cond;
- rtx false_cond;
+rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
{
enum rtx_code code = GET_CODE (op);
rtx op0 = rs6000_compare_op0;
@@ -9641,11 +9399,7 @@ rs6000_emit_cmove (dest, op, true_cond, false_cond)
/* Same as above, but for ints (isel). */
static int
-rs6000_emit_int_cmove (dest, op, true_cond, false_cond)
- rtx dest;
- rtx op;
- rtx true_cond;
- rtx false_cond;
+rs6000_emit_int_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
{
rtx condition_rtx, cr;
@@ -9670,8 +9424,7 @@ rs6000_emit_int_cmove (dest, op, true_cond, false_cond)
}
const char *
-output_isel (operands)
- rtx *operands;
+output_isel (rtx *operands)
{
enum rtx_code code;
@@ -9686,11 +9439,7 @@ output_isel (operands)
}
void
-rs6000_emit_minmax (dest, code, op0, op1)
- rtx dest;
- enum rtx_code code;
- rtx op0;
- rtx op1;
+rs6000_emit_minmax (rtx dest, enum rtx_code code, rtx op0, rtx op1)
{
enum machine_mode mode = GET_MODE (op0);
enum rtx_code c;
@@ -9797,7 +9546,7 @@ rs6000_split_altivec_in_gprs (rtx *operands)
saved. 32 if none. */
int
-first_reg_to_save ()
+first_reg_to_save (void)
{
int first_reg;
@@ -9823,7 +9572,7 @@ first_reg_to_save ()
/* Similar, for FP regs. */
int
-first_fp_reg_to_save ()
+first_fp_reg_to_save (void)
{
int first_reg;
@@ -9838,7 +9587,7 @@ first_fp_reg_to_save ()
/* Similar, for AltiVec regs. */
static int
-first_altivec_reg_to_save ()
+first_altivec_reg_to_save (void)
{
int i;
@@ -9859,7 +9608,7 @@ first_altivec_reg_to_save ()
the 32-bit word is 0. */
static unsigned int
-compute_vrsave_mask ()
+compute_vrsave_mask (void)
{
unsigned int i, mask = 0;
@@ -9891,9 +9640,7 @@ compute_vrsave_mask ()
}
static void
-is_altivec_return_reg (reg, xyes)
- rtx reg;
- void *xyes;
+is_altivec_return_reg (rtx reg, void *xyes)
{
bool *yes = (bool *) xyes;
if (REGNO (reg) == ALTIVEC_ARG_RETURN)
@@ -9999,7 +9746,7 @@ is_altivec_return_reg (reg, xyes)
#endif
rs6000_stack_t *
-rs6000_stack_info ()
+rs6000_stack_info (void)
{
static rs6000_stack_t info, zero_info;
rs6000_stack_t *info_ptr = &info;
@@ -10308,7 +10055,7 @@ rs6000_stack_info ()
mode. */
static bool
-spe_func_has_64bit_regs_p ()
+spe_func_has_64bit_regs_p (void)
{
rtx insns, insn;
@@ -10338,8 +10085,7 @@ spe_func_has_64bit_regs_p ()
}
void
-debug_stack_info (info)
- rs6000_stack_t *info;
+debug_stack_info (rs6000_stack_t *info)
{
const char *abi_string;
@@ -10483,9 +10229,7 @@ debug_stack_info (info)
}
rtx
-rs6000_return_addr (count, frame)
- int count;
- rtx frame;
+rs6000_return_addr (int count, rtx frame)
{
/* Currently we don't optimize very well between prolog and body
code and for PIC code the code can be actually quite bad, so
@@ -10505,6 +10249,7 @@ rs6000_return_addr (count, frame)
RETURN_ADDRESS_OFFSET)));
}
+ cfun->machine->ra_need_lr = 1;
return get_hard_reg_initial_val (Pmode, LINK_REGISTER_REGNUM);
}
@@ -10516,9 +10261,7 @@ rs6000_return_addr (count, frame)
type info must be available here. (The tail recursion case can work
with vector parameters, but there's no way to distinguish here.) */
static bool
-rs6000_function_ok_for_sibcall (decl, exp)
- tree decl;
- tree exp ATTRIBUTE_UNUSED;
+rs6000_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
tree type;
if (decl)
@@ -10546,7 +10289,7 @@ rs6000_function_ok_for_sibcall (decl, exp)
}
static int
-rs6000_ra_ever_killed ()
+rs6000_ra_ever_killed (void)
{
rtx top;
rtx reg;
@@ -10599,8 +10342,7 @@ rs6000_ra_ever_killed ()
/* Add a REG_MAYBE_DEAD note to the insn. */
static void
-rs6000_maybe_dead (insn)
- rtx insn;
+rs6000_maybe_dead (rtx insn)
{
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD,
const0_rtx,
@@ -10612,8 +10354,7 @@ rs6000_maybe_dead (insn)
a constant pool; or for SVR4 -fpic. */
void
-rs6000_emit_load_toc_table (fromprolog)
- int fromprolog;
+rs6000_emit_load_toc_table (int fromprolog)
{
rtx dest, insn;
dest = gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);
@@ -10712,7 +10453,7 @@ rs6000_emit_load_toc_table (fromprolog)
}
int
-get_TOC_alias_set ()
+get_TOC_alias_set (void)
{
static int set = -1;
if (set == -1)
@@ -10753,8 +10494,7 @@ uses_TOC ()
}
rtx
-create_TOC_reference (symbol)
- rtx symbol;
+create_TOC_reference (rtx symbol)
{
return gen_rtx_PLUS (Pmode,
gen_rtx_REG (Pmode, TOC_REGISTER),
@@ -10763,139 +10503,47 @@ create_TOC_reference (symbol)
gen_rtx_SYMBOL_REF (Pmode, toc_label_name))));
}
-/* __throw will restore its own return address to be the same as the
- return address of the function that the throw is being made to.
- This is unfortunate, because we want to check the original
- return address to see if we need to restore the TOC.
- So we have to squirrel it away here.
- This is used only in compiling __throw and __rethrow.
-
- Most of this code should be removed by CSE. */
-static rtx insn_after_throw;
+/* If _Unwind_* has been called from within the same module,
+ toc register is not guaranteed to be saved to 40(1) on function
+ entry. Save it there in that case. */
-/* This does the saving... */
void
-rs6000_aix_emit_builtin_unwind_init ()
+rs6000_aix_emit_builtin_unwind_init (void)
{
rtx mem;
rtx stack_top = gen_reg_rtx (Pmode);
rtx opcode_addr = gen_reg_rtx (Pmode);
-
- insn_after_throw = gen_reg_rtx (SImode);
+ rtx opcode = gen_reg_rtx (SImode);
+ rtx tocompare = gen_reg_rtx (SImode);
+ rtx no_toc_save_needed = gen_label_rtx ();
mem = gen_rtx_MEM (Pmode, hard_frame_pointer_rtx);
emit_move_insn (stack_top, mem);
- mem = gen_rtx_MEM (Pmode,
- gen_rtx_PLUS (Pmode, stack_top,
+ mem = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode, stack_top,
GEN_INT (2 * GET_MODE_SIZE (Pmode))));
emit_move_insn (opcode_addr, mem);
- emit_move_insn (insn_after_throw, gen_rtx_MEM (SImode, opcode_addr));
-}
-
-/* Emit insns to _restore_ the TOC register, at runtime (specifically
- in _eh.o). Only used on AIX.
-
- The idea is that on AIX, function calls look like this:
- bl somefunction-trampoline
- lwz r2,20(sp)
-
- and later,
- somefunction-trampoline:
- stw r2,20(sp)
- ... load function address in the count register ...
- bctr
- or like this, if the linker determines that this is not a cross-module call
- and so the TOC need not be restored:
- bl somefunction
- nop
- or like this, if the compiler could determine that this is not a
- cross-module call:
- bl somefunction
- now, the tricky bit here is that register 2 is saved and restored
- by the _linker_, so we can't readily generate debugging information
- for it. So we need to go back up the call chain looking at the
- insns at return addresses to see which calls saved the TOC register
- and so see where it gets restored from.
-
- Oh, and all this gets done in RTL inside the eh_epilogue pattern,
- just before the actual epilogue.
-
- On the bright side, this incurs no space or time overhead unless an
- exception is thrown, except for the extra code in libgcc.a.
-
- The parameter STACKSIZE is a register containing (at runtime)
- the amount to be popped off the stack in addition to the stack frame
- of this routine (which will be __throw or __rethrow, and so is
- guaranteed to have a stack frame). */
-
-void
-rs6000_emit_eh_toc_restore (stacksize)
- rtx stacksize;
-{
- rtx top_of_stack;
- rtx bottom_of_stack = gen_reg_rtx (Pmode);
- rtx tocompare = gen_reg_rtx (SImode);
- rtx opcode = gen_reg_rtx (SImode);
- rtx opcode_addr = gen_reg_rtx (Pmode);
- rtx mem;
- rtx loop_start = gen_label_rtx ();
- rtx no_toc_restore_needed = gen_label_rtx ();
- rtx loop_exit = gen_label_rtx ();
-
- mem = gen_rtx_MEM (Pmode, hard_frame_pointer_rtx);
- set_mem_alias_set (mem, rs6000_sr_alias_set);
- emit_move_insn (bottom_of_stack, mem);
-
- top_of_stack = expand_binop (Pmode, add_optab,
- bottom_of_stack, stacksize,
- NULL_RTX, 1, OPTAB_WIDEN);
-
- emit_move_insn (tocompare, gen_int_mode (TARGET_32BIT ? 0x80410014
+ emit_move_insn (opcode, gen_rtx_MEM (SImode, opcode_addr));
+ emit_move_insn (tocompare, gen_int_mode (TARGET_32BIT ? 0x80410014
: 0xE8410028, SImode));
- if (insn_after_throw == NULL_RTX)
- abort ();
- emit_move_insn (opcode, insn_after_throw);
-
- emit_note (NOTE_INSN_LOOP_BEG);
- emit_label (loop_start);
-
- do_compare_rtx_and_jump (opcode, tocompare, NE, 1,
+ do_compare_rtx_and_jump (opcode, tocompare, EQ, 1,
SImode, NULL_RTX, NULL_RTX,
- no_toc_restore_needed);
-
- mem = gen_rtx_MEM (Pmode,
- gen_rtx_PLUS (Pmode, bottom_of_stack,
- GEN_INT (5 * GET_MODE_SIZE (Pmode))));
- emit_move_insn (gen_rtx_REG (Pmode, 2), mem);
-
- emit_label (no_toc_restore_needed);
- do_compare_rtx_and_jump (top_of_stack, bottom_of_stack, EQ, 1,
- Pmode, NULL_RTX, NULL_RTX,
- loop_exit);
-
- mem = gen_rtx_MEM (Pmode, bottom_of_stack);
- set_mem_alias_set (mem, rs6000_sr_alias_set);
- emit_move_insn (bottom_of_stack, mem);
-
- mem = gen_rtx_MEM (Pmode,
- gen_rtx_PLUS (Pmode, bottom_of_stack,
- GEN_INT (2 * GET_MODE_SIZE (Pmode))));
- emit_move_insn (opcode_addr, mem);
- emit_move_insn (opcode, gen_rtx_MEM (SImode, opcode_addr));
+ no_toc_save_needed);
- emit_note (NOTE_INSN_LOOP_CONT);
- emit_jump (loop_start);
- emit_note (NOTE_INSN_LOOP_END);
- emit_label (loop_exit);
+ mem = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode, stack_top,
+ GEN_INT (5 * GET_MODE_SIZE (Pmode))));
+ emit_move_insn (mem, gen_rtx_REG (Pmode, 2));
+ emit_label (no_toc_save_needed);
}
/* This ties together stack memory (MEM with an alias set of
rs6000_sr_alias_set) and the change to the stack pointer. */
static void
-rs6000_emit_stack_tie ()
+rs6000_emit_stack_tie (void)
{
rtx mem = gen_rtx_MEM (BLKmode, gen_rtx_REG (Pmode, STACK_POINTER_REGNUM));
@@ -10908,9 +10556,7 @@ rs6000_emit_stack_tie ()
The generated code may use hard register 0 as a temporary. */
static void
-rs6000_emit_allocate_stack (size, copy_r12)
- HOST_WIDE_INT size;
- int copy_r12;
+rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12)
{
rtx insn;
rtx stack_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
@@ -10998,12 +10644,8 @@ rs6000_emit_allocate_stack (size, copy_r12)
its hand so much. */
static void
-rs6000_frame_related (insn, reg, val, reg2, rreg)
- rtx insn;
- rtx reg;
- HOST_WIDE_INT val;
- rtx reg2;
- rtx rreg;
+rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val,
+ rtx reg2, rtx rreg)
{
rtx real, temp;
@@ -11085,8 +10727,7 @@ rs6000_frame_related (insn, reg, val, reg2, rreg)
original note, plus a synthetic register save. */
static rtx
-spe_synthesize_frame_save (real)
- rtx real;
+spe_synthesize_frame_save (rtx real)
{
rtx synth, offset, reg, real2;
@@ -11149,10 +10790,7 @@ spe_synthesize_frame_save (real)
appropriate CLOBBERs. */
static rtx
-generate_set_vrsave (reg, info, epiloguep)
- rtx reg;
- rs6000_stack_t *info;
- int epiloguep;
+generate_set_vrsave (rtx reg, rs6000_stack_t *info, int epiloguep)
{
int nclobs, i;
rtx insn, clobs[TOTAL_ALTIVEC_REGS + 1];
@@ -11211,13 +10849,8 @@ generate_set_vrsave (reg, info, epiloguep)
Save REGNO into [FRAME_REG + OFFSET] in mode MODE. */
static void
-emit_frame_save (frame_reg, frame_ptr, mode, regno, offset, total_size)
- rtx frame_reg;
- rtx frame_ptr;
- enum machine_mode mode;
- unsigned int regno;
- int offset;
- int total_size;
+emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode,
+ unsigned int regno, int offset, int total_size)
{
rtx reg, offset_rtx, insn, mem, addr, int_rtx;
rtx replacea, replaceb;
@@ -11259,10 +10892,7 @@ emit_frame_save (frame_reg, frame_ptr, mode, regno, offset, total_size)
converting to a valid addressing mode. */
static rtx
-gen_frame_mem_offset (mode, reg, offset)
- enum machine_mode mode;
- rtx reg;
- int offset;
+gen_frame_mem_offset (enum machine_mode mode, rtx reg, int offset)
{
rtx int_rtx, offset_rtx;
@@ -11282,7 +10912,7 @@ gen_frame_mem_offset (mode, reg, offset)
/* Emit function prologue as insns. */
void
-rs6000_emit_prologue ()
+rs6000_emit_prologue (void)
{
rs6000_stack_t *info = rs6000_stack_info ();
enum machine_mode reg_mode = TARGET_POWERPC64 ? DImode : SImode;
@@ -11307,10 +10937,14 @@ rs6000_emit_prologue ()
|| info->spe_64bit_regs_used == 0)
&& info->first_gp_reg_save < 31);
saving_FPRs_inline = (info->first_fp_reg_save == 64
- || FP_SAVE_INLINE (info->first_fp_reg_save));
+ || FP_SAVE_INLINE (info->first_fp_reg_save)
+ || current_function_calls_eh_return
+ || cfun->machine->ra_need_lr);
/* For V.4, update stack before we do any saving and set back pointer. */
- if (info->push_p && DEFAULT_ABI == ABI_V4)
+ if (info->push_p
+ && (DEFAULT_ABI == ABI_V4
+ || current_function_calls_eh_return))
{
if (info->total_size < 32767)
sp_offset = info->total_size;
@@ -11538,6 +11172,23 @@ rs6000_emit_prologue ()
{
unsigned int i, regno;
+ /* In AIX ABI we need to pretend we save r2 here. */
+ if (TARGET_AIX)
+ {
+ rtx addr, reg, mem;
+
+ reg = gen_rtx_REG (reg_mode, 2);
+ addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
+ GEN_INT (sp_offset + 5 * reg_size));
+ mem = gen_rtx_MEM (reg_mode, addr);
+ set_mem_alias_set (mem, rs6000_sr_alias_set);
+
+ insn = emit_move_insn (mem, reg);
+ rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
+ NULL_RTX, NULL_RTX);
+ PATTERN (insn) = gen_blockage ();
+ }
+
for (i = 0; ; ++i)
{
regno = EH_RETURN_DATA_REGNO (i);
@@ -11596,7 +11247,8 @@ rs6000_emit_prologue ()
/* Update stack and set back pointer unless this is V.4,
for which it was done previously. */
- if (info->push_p && DEFAULT_ABI != ABI_V4)
+ if (info->push_p
+ && !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return))
rs6000_emit_allocate_stack (info->total_size, FALSE);
/* Set frame pointer, if needed. */
@@ -11652,9 +11304,8 @@ rs6000_emit_prologue ()
/* Write function prologue. */
static void
-rs6000_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+rs6000_output_function_prologue (FILE *file,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
rs6000_stack_t *info = rs6000_stack_info ();
@@ -11720,8 +11371,7 @@ rs6000_output_function_prologue (file, size)
need special notes to explain where r11 is in relation to the stack. */
void
-rs6000_emit_epilogue (sibcall)
- int sibcall;
+rs6000_emit_epilogue (int sibcall)
{
rs6000_stack_t *info;
int restoring_FPRs_inline;
@@ -11775,7 +11425,8 @@ rs6000_emit_epilogue (sibcall)
}
else if (info->push_p)
{
- if (DEFAULT_ABI == ABI_V4)
+ if (DEFAULT_ABI == ABI_V4
+ || current_function_calls_eh_return)
sp_offset = info->total_size;
else
{
@@ -11860,6 +11511,17 @@ rs6000_emit_epilogue (sibcall)
{
unsigned int i, regno;
+ if (TARGET_AIX)
+ {
+ rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
+ GEN_INT (sp_offset + 5 * reg_size));
+ rtx mem = gen_rtx_MEM (reg_mode, addr);
+
+ set_mem_alias_set (mem, rs6000_sr_alias_set);
+
+ emit_move_insn (gen_rtx_REG (reg_mode, 2), mem);
+ }
+
for (i = 0; ; ++i)
{
rtx mem;
@@ -12011,7 +11673,8 @@ rs6000_emit_epilogue (sibcall)
(which may not have any obvious dependency on the stack). This
doesn't hurt performance, because there is no scheduling that can
be done after this point. */
- if (DEFAULT_ABI == ABI_V4)
+ if (DEFAULT_ABI == ABI_V4
+ || current_function_calls_eh_return)
{
if (frame_reg_rtx != sp_reg_rtx)
rs6000_emit_stack_tie ();
@@ -12088,9 +11751,8 @@ rs6000_emit_epilogue (sibcall)
/* Write function epilogue. */
static void
-rs6000_output_function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+rs6000_output_function_epilogue (FILE *file,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
rs6000_stack_t *info = rs6000_stack_info ();
@@ -12131,6 +11793,23 @@ rs6000_output_function_epilogue (file, size)
}
}
+#if TARGET_OBJECT_FORMAT == OBJECT_MACHO
+ /* Mach-O doesn't support labels at the end of objects, so if
+ it looks like we might want one, insert a NOP. */
+ {
+ rtx insn = get_last_insn ();
+ while (insn
+ && NOTE_P (insn)
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL)
+ insn = PREV_INSN (insn);
+ if (insn
+ && (LABEL_P (insn)
+ || (NOTE_P (insn)
+ && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
+ fputs ("\tnop\n", file);
+ }
+#endif
+
/* Output a traceback table here. See /usr/include/sys/debug.h for info
on its format.
@@ -12392,12 +12071,9 @@ rs6000_output_function_epilogue (file, size)
not support varargs. */
static void
-rs6000_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;
- tree function;
+rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
+ tree function)
{
rtx this, insn, funexp;
@@ -12410,7 +12086,7 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
/* Find the "this" pointer. If the function returns a structure,
the structure return pointer is in r3. */
- if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function))))
+ if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
this = gen_rtx_REG (Pmode, 4);
else
this = gen_rtx_REG (Pmode, 3);
@@ -12524,8 +12200,7 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
/* Hash functions for the hash table. */
static unsigned
-rs6000_hash_constant (k)
- rtx k;
+rs6000_hash_constant (rtx k)
{
enum rtx_code code = GET_CODE (k);
enum machine_mode mode = GET_MODE (k);
@@ -12598,8 +12273,7 @@ rs6000_hash_constant (k)
}
static unsigned
-toc_hash_function (hash_entry)
- const void * hash_entry;
+toc_hash_function (const void *hash_entry)
{
const struct toc_hash_struct *thc =
(const struct toc_hash_struct *) hash_entry;
@@ -12609,9 +12283,7 @@ toc_hash_function (hash_entry)
/* Compare H1 and H2 for equivalence. */
static int
-toc_hash_eq (h1, h2)
- const void * h1;
- const void * h2;
+toc_hash_eq (const void *h1, const void *h2)
{
rtx r1 = ((const struct toc_hash_struct *) h1)->key;
rtx r2 = ((const struct toc_hash_struct *) h2)->key;
@@ -12635,9 +12307,7 @@ toc_hash_eq (h1, h2)
|| strncmp ("_ZTC", name, strlen ("_ZTC")) == 0)
void
-rs6000_output_symbol_ref (file, x)
- FILE *file;
- rtx x;
+rs6000_output_symbol_ref (FILE *file, rtx x)
{
/* Currently C++ toc references to vtables can be emitted before it
is decided whether the vtable is public or private. If this is
@@ -12659,11 +12329,7 @@ rs6000_output_symbol_ref (file, x)
written. */
void
-output_toc (file, x, labelno, mode)
- FILE *file;
- rtx x;
- int labelno;
- enum machine_mode mode;
+output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode)
{
char buf[256];
const char *name = buf;
@@ -12963,10 +12629,7 @@ output_toc (file, x, labelno, mode)
so we must artificially break them up early. */
void
-output_ascii (file, p, n)
- FILE *file;
- const char *p;
- int n;
+output_ascii (FILE *file, const char *p, int n)
{
char c;
int i, count_string;
@@ -13037,10 +12700,8 @@ output_ascii (file, p, n)
the name. */
void
-rs6000_gen_section_name (buf, filename, section_desc)
- char **buf;
- const char *filename;
- const char *section_desc;
+rs6000_gen_section_name (char **buf, const char *filename,
+ const char *section_desc)
{
const char *q, *after_last_slash, *last_period = 0;
char *p;
@@ -13083,8 +12744,7 @@ rs6000_gen_section_name (buf, filename, section_desc)
/* Emit profile function. */
void
-output_profile_hook (labelno)
- int labelno ATTRIBUTE_UNUSED;
+output_profile_hook (int labelno ATTRIBUTE_UNUSED)
{
if (TARGET_PROFILE_KERNEL)
return;
@@ -13137,9 +12797,7 @@ output_profile_hook (labelno)
/* Write function profiler code. */
void
-output_function_profiler (file, labelno)
- FILE *file;
- int labelno;
+output_function_profiler (FILE *file, int labelno)
{
char buf[100];
int save_lr = 8;
@@ -13229,7 +12887,7 @@ output_function_profiler (file, labelno)
static int
-rs6000_use_dfa_pipeline_interface ()
+rs6000_use_dfa_pipeline_interface (void)
{
return 1;
}
@@ -13241,11 +12899,9 @@ rs6000_use_dfa_pipeline_interface ()
instructions to issue in this cycle. */
static int
-rs6000_variable_issue (stream, verbose, insn, more)
- FILE *stream ATTRIBUTE_UNUSED;
- int verbose ATTRIBUTE_UNUSED;
- rtx insn;
- int more;
+rs6000_variable_issue (FILE *stream ATTRIBUTE_UNUSED,
+ int verbose ATTRIBUTE_UNUSED,
+ rtx insn, int more)
{
if (GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER)
@@ -13276,11 +12932,8 @@ rs6000_variable_issue (stream, verbose, insn, more)
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
static int
-rs6000_adjust_cost (insn, link, dep_insn, cost)
- rtx insn;
- rtx link;
- rtx dep_insn ATTRIBUTE_UNUSED;
- int cost;
+rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn ATTRIBUTE_UNUSED,
+ int cost)
{
if (! recog_memoized (insn))
return 0;
@@ -13340,9 +12993,7 @@ rs6000_adjust_cost (insn, link, dep_insn, cost)
priorities of insns. */
static int
-rs6000_adjust_priority (insn, priority)
- rtx insn ATTRIBUTE_UNUSED;
- int priority;
+rs6000_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority)
{
/* On machines (like the 750) which have asymmetric integer units,
where one integer unit can do multiply and divides and the other
@@ -13380,7 +13031,7 @@ rs6000_adjust_priority (insn, priority)
/* Return how many instructions the machine can issue per cycle. */
static int
-rs6000_issue_rate ()
+rs6000_issue_rate (void)
{
/* Use issue rate of 1 for first scheduling pass to decrease degradation. */
if (!reload_completed)
@@ -13414,7 +13065,7 @@ rs6000_issue_rate ()
scheduling. */
static int
-rs6000_use_sched_lookahead ()
+rs6000_use_sched_lookahead (void)
{
if (rs6000_cpu_attr == CPU_PPC8540)
return 4;
@@ -13425,7 +13076,7 @@ rs6000_use_sched_lookahead ()
/* Length in units of the trampoline for entering a nested function. */
int
-rs6000_trampoline_size ()
+rs6000_trampoline_size (void)
{
int ret = 0;
@@ -13452,10 +13103,7 @@ rs6000_trampoline_size ()
CXT is an RTX for the static chain value for the function. */
void
-rs6000_initialize_trampoline (addr, fnaddr, cxt)
- rtx addr;
- rtx fnaddr;
- rtx cxt;
+rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
{
enum machine_mode pmode = Pmode;
int regsize = (TARGET_32BIT) ? 4 : 8;
@@ -13514,12 +13162,10 @@ const struct attribute_spec rs6000_attribute_table[] =
struct attribute_spec.handler. */
static tree
-rs6000_handle_longcall_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+rs6000_handle_longcall_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
@@ -13536,8 +13182,7 @@ rs6000_handle_longcall_attribute (node, name, args, flags, no_add_attrs)
/* Set longcall attributes on all functions declared when
rs6000_default_long_calls is true. */
static void
-rs6000_set_default_type_attributes (type)
- tree type;
+rs6000_set_default_type_attributes (tree type)
{
if (rs6000_default_long_calls
&& (TREE_CODE (type) == FUNCTION_TYPE
@@ -13551,8 +13196,7 @@ rs6000_set_default_type_attributes (type)
longcall attribute. */
struct rtx_def *
-rs6000_longcall_ref (call_ref)
- rtx call_ref;
+rs6000_longcall_ref (rtx call_ref)
{
const char *call_name;
tree node;
@@ -13586,10 +13230,8 @@ rs6000_longcall_ref (call_ref)
data section. */
static void
-rs6000_elf_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align;
+rs6000_elf_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align)
{
if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode))
toc_section ();
@@ -13603,10 +13245,8 @@ rs6000_elf_select_rtx_section (mode, x, align)
the initial value of DECL requires link-time relocations. */
static void
-rs6000_elf_select_section (decl, reloc, align)
- tree decl;
- int reloc;
- unsigned HOST_WIDE_INT align;
+rs6000_elf_select_section (tree decl, int reloc,
+ unsigned HOST_WIDE_INT align)
{
/* Pretend that we're always building for a shared library when
ABI_AIX, because otherwise we end up with dynamic relocations
@@ -13625,9 +13265,7 @@ rs6000_elf_select_section (decl, reloc, align)
initialized data and functions. */
static void
-rs6000_elf_unique_section (decl, reloc)
- tree decl;
- int reloc;
+rs6000_elf_unique_section (tree decl, int reloc)
{
/* As above, pretend that we're always building for a shared library
when ABI_AIX, to avoid dynamic relocations in read-only sections. */
@@ -13644,10 +13282,7 @@ rs6000_elf_unique_section (decl, reloc)
read the prefixes. */
static void
-rs6000_elf_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+rs6000_elf_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
@@ -13666,8 +13301,7 @@ rs6000_elf_encode_section_info (decl, rtl, first)
}
static bool
-rs6000_elf_in_small_data_p (decl)
- tree decl;
+rs6000_elf_in_small_data_p (tree decl)
{
if (rs6000_sdata == SDATA_NONE)
return false;
@@ -13709,8 +13343,7 @@ rs6000_elf_in_small_data_p (decl)
increment the returned register via an "la" instruction. */
struct rtx_def *
-find_addr_reg (addr)
- rtx addr;
+find_addr_reg (rtx addr)
{
while (GET_CODE (addr) == PLUS)
{
@@ -13733,8 +13366,7 @@ find_addr_reg (addr)
}
void
-rs6000_fatal_bad_address (op)
- rtx op;
+rs6000_fatal_bad_address (rtx op)
{
fatal_insn ("bad address", op);
}
@@ -13746,8 +13378,7 @@ rs6000_fatal_bad_address (op)
reference and a constant. */
int
-symbolic_operand (op)
- rtx op;
+symbolic_operand (rtx op)
{
switch (GET_CODE (op))
{
@@ -13774,10 +13405,7 @@ static tree stub_list = 0;
procedure calls to the linked list. */
void
-add_compiler_stub (label_name, function_name, line_number)
- tree label_name;
- tree function_name;
- int line_number;
+add_compiler_stub (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);
@@ -13794,7 +13422,7 @@ add_compiler_stub (label_name, function_name, line_number)
linked list. */
void
-output_compiler_stub ()
+output_compiler_stub (void)
{
char tmp_buf[256];
char label_buf[256];
@@ -13841,8 +13469,7 @@ output_compiler_stub ()
already there or not. */
int
-no_previous_def (function_name)
- tree function_name;
+no_previous_def (tree function_name)
{
tree stub;
for (stub = stub_list; stub; stub = TREE_CHAIN (stub))
@@ -13855,8 +13482,7 @@ no_previous_def (function_name)
the function. */
tree
-get_prev_label (function_name)
- tree function_name;
+get_prev_label (tree function_name)
{
tree stub;
for (stub = stub_list; stub; stub = TREE_CHAIN (stub))
@@ -13871,10 +13497,7 @@ get_prev_label (function_name)
CALL_DEST is the routine we are calling. */
char *
-output_call (insn, call_dest, operand_number)
- rtx insn;
- rtx call_dest;
- int operand_number;
+output_call (rtx insn, rtx call_dest, int operand_number)
{
static char buf[256];
if (GET_CODE (call_dest) == SYMBOL_REF && TARGET_LONG_BRANCH && !flag_pic)
@@ -13912,31 +13535,10 @@ output_call (insn, call_dest, operand_number)
#endif /* RS6000_LONG_BRANCH */
-#define GEN_LOCAL_LABEL_FOR_SYMBOL(BUF,SYMBOL,LENGTH,N) \
- do { \
- const char *const symbol_ = (SYMBOL); \
- char *buffer_ = (BUF); \
- if (symbol_[0] == '"') \
- { \
- sprintf(buffer_, "\"L%d$%s", (N), symbol_+1); \
- } \
- else if (name_needs_quotes(symbol_)) \
- { \
- sprintf(buffer_, "\"L%d$%s\"", (N), symbol_); \
- } \
- else \
- { \
- sprintf(buffer_, "L%d$%s", (N), symbol_); \
- } \
- } while (0)
-
-
/* Generate PIC and indirect symbol stubs. */
void
-machopic_output_stub (file, symb, stub)
- FILE *file;
- const char *symb, *stub;
+machopic_output_stub (FILE *file, const char *symb, const char *stub)
{
unsigned int length;
char *symbol_name, *lazy_ptr_name;
@@ -13946,7 +13548,6 @@ machopic_output_stub (file, symb, stub)
/* Lose our funky encoding stuff so it doesn't contaminate the stub. */
symb = (*targetm.strip_name_encoding) (symb);
- label += 1;
length = strlen (symb);
symbol_name = alloca (length + 32);
@@ -13955,9 +13556,6 @@ machopic_output_stub (file, symb, stub)
lazy_ptr_name = alloca (length + 32);
GEN_LAZY_PTR_NAME_FOR_SYMBOL (lazy_ptr_name, symb, length);
- local_label_0 = alloca (length + 32);
- GEN_LOCAL_LABEL_FOR_SYMBOL (local_label_0, symb, length, 0);
-
if (flag_pic == 2)
machopic_picsymbol_stub1_section ();
else
@@ -13969,6 +13567,10 @@ machopic_output_stub (file, symb, stub)
if (flag_pic == 2)
{
+ label++;
+ local_label_0 = alloca (sizeof("\"L0000000000$spb\""));
+ sprintf (local_label_0, "\"L%011d$spb\"", label);
+
fprintf (file, "\tmflr r0\n");
fprintf (file, "\tbcl 20,31,%s\n", local_label_0);
fprintf (file, "%s:\n\tmflr r11\n", local_label_0);
@@ -14002,10 +13604,8 @@ machopic_output_stub (file, symb, stub)
#define SMALL_INT(X) ((unsigned) (INTVAL(X) + 0x8000) < 0x10000)
rtx
-rs6000_machopic_legitimize_pic_address (orig, mode, reg)
- rtx orig;
- enum machine_mode mode;
- rtx reg;
+rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode,
+ rtx reg)
{
rtx base, offset;
@@ -14055,7 +13655,7 @@ rs6000_machopic_legitimize_pic_address (orig, mode, reg)
real definition. */
void
-toc_section ()
+toc_section (void)
{
}
@@ -14063,10 +13663,7 @@ toc_section ()
#if TARGET_ELF
static unsigned int
-rs6000_elf_section_type_flags (decl, name, reloc)
- tree decl;
- const char *name;
- int reloc;
+rs6000_elf_section_type_flags (tree decl, const char *name, int reloc)
{
unsigned int flags
= default_section_type_flags_1 (decl, name, reloc,
@@ -14086,9 +13683,7 @@ rs6000_elf_section_type_flags (decl, name, reloc)
that we have special handling for -mrelocatable. */
static void
-rs6000_elf_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority;
+rs6000_elf_asm_out_constructor (rtx symbol, int priority)
{
const char *section = ".ctors";
char buf[16];
@@ -14117,9 +13712,7 @@ rs6000_elf_asm_out_constructor (symbol, priority)
}
static void
-rs6000_elf_asm_out_destructor (symbol, priority)
- rtx symbol;
- int priority;
+rs6000_elf_asm_out_destructor (rtx symbol, int priority)
{
const char *section = ".dtors";
char buf[16];
@@ -14148,10 +13741,7 @@ rs6000_elf_asm_out_destructor (symbol, priority)
}
void
-rs6000_elf_declare_function_name (file, name, decl)
- FILE *file;
- const char *name;
- tree decl;
+rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl)
{
if (TARGET_64BIT)
{
@@ -14223,9 +13813,7 @@ rs6000_elf_declare_function_name (file, name, decl)
#if TARGET_XCOFF
static void
-rs6000_xcoff_asm_globalize_label (stream, name)
- FILE *stream;
- const char *name;
+rs6000_xcoff_asm_globalize_label (FILE *stream, const char *name)
{
fputs (GLOBAL_ASM_OP, stream);
RS6000_OUTPUT_BASENAME (stream, name);
@@ -14233,9 +13821,7 @@ rs6000_xcoff_asm_globalize_label (stream, name)
}
static void
-rs6000_xcoff_asm_named_section (name, flags)
- const char *name;
- unsigned int flags;
+rs6000_xcoff_asm_named_section (const char *name, unsigned int flags)
{
int smclass;
static const char * const suffix[3] = { "PR", "RO", "RW" };
@@ -14253,10 +13839,8 @@ rs6000_xcoff_asm_named_section (name, flags)
}
static void
-rs6000_xcoff_select_section (decl, reloc, align)
- tree decl;
- int reloc;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+rs6000_xcoff_select_section (tree decl, int reloc,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
if (decl_readonly_section_1 (decl, reloc, 1))
{
@@ -14275,9 +13859,7 @@ rs6000_xcoff_select_section (decl, reloc, align)
}
static void
-rs6000_xcoff_unique_section (decl, reloc)
- tree decl;
- int reloc ATTRIBUTE_UNUSED;
+rs6000_xcoff_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
{
const char *name;
@@ -14302,10 +13884,8 @@ rs6000_xcoff_unique_section (decl, reloc)
toc entry. */
static void
-rs6000_xcoff_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+rs6000_xcoff_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode))
toc_section ();
@@ -14316,8 +13896,7 @@ rs6000_xcoff_select_rtx_section (mode, x, align)
/* Remove any trailing [DS] or the like from the symbol name. */
static const char *
-rs6000_xcoff_strip_name_encoding (name)
- const char *name;
+rs6000_xcoff_strip_name_encoding (const char *name)
{
size_t len;
if (*name == '*')
@@ -14332,10 +13911,7 @@ rs6000_xcoff_strip_name_encoding (name)
/* Section attributes. AIX is always PIC. */
static unsigned int
-rs6000_xcoff_section_type_flags (decl, name, reloc)
- tree decl;
- const char *name;
- int reloc;
+rs6000_xcoff_section_type_flags (tree decl, const char *name, int reloc)
{
unsigned int align;
unsigned int flags = default_section_type_flags_1 (decl, name, reloc, 1);
@@ -14365,7 +13941,7 @@ rs6000_xcoff_section_type_flags (decl, name, reloc)
Finally, declare mcount when profiling to make the assembler happy. */
static void
-rs6000_xcoff_file_start ()
+rs6000_xcoff_file_start (void)
{
rs6000_gen_section_name (&xcoff_bss_section_name,
main_input_filename, ".bss_");
@@ -14390,7 +13966,7 @@ rs6000_xcoff_file_start ()
On the RS/6000, referencing data should automatically pull in text. */
static void
-rs6000_xcoff_file_end ()
+rs6000_xcoff_file_end (void)
{
text_section ();
fputs ("_section_.text:\n", asm_out_file);
@@ -14406,8 +13982,7 @@ rs6000_xcoff_file_end ()
functions at dynamic-link time. */
static bool
-rs6000_binds_local_p (decl)
- tree decl;
+rs6000_binds_local_p (tree decl)
{
return default_binds_local_p_1 (decl, 0);
}
@@ -14418,10 +13993,8 @@ rs6000_binds_local_p (decl)
scanned. In either case, *TOTAL contains the cost result. */
static bool
-rs6000_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code ATTRIBUTE_UNUSED;
- int *total;
+rs6000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED,
+ int *total)
{
switch (code)
{
@@ -14642,9 +14215,8 @@ rs6000_rtx_costs (x, code, outer_code, total)
CLASS1 to one of CLASS2. */
int
-rs6000_register_move_cost (mode, from, to)
- enum machine_mode mode;
- enum reg_class from, to;
+rs6000_register_move_cost (enum machine_mode mode,
+ enum reg_class from, enum reg_class to)
{
/* Moves from/to GENERAL_REGS. */
if (reg_classes_intersect_p (to, GENERAL_REGS)
@@ -14680,10 +14252,8 @@ rs6000_register_move_cost (mode, from, to)
or from memory. */
int
-rs6000_memory_move_cost (mode, class, in)
- enum machine_mode mode;
- enum reg_class class;
- int in ATTRIBUTE_UNUSED;
+rs6000_memory_move_cost (enum machine_mode mode, enum reg_class class,
+ int in ATTRIBUTE_UNUSED)
{
if (reg_classes_intersect_p (class, GENERAL_REGS))
return 4 * HARD_REGNO_NREGS (0, mode);
@@ -14783,24 +14353,16 @@ rs6000_libcall_value (enum machine_mode mode)
/* Return true if TYPE is of type __ev64_opaque__. */
static bool
-is_ev64_opaque_type (type)
- tree type;
+is_ev64_opaque_type (tree type)
{
return (TARGET_SPE
&& (type == opaque_V2SI_type_node
|| type == opaque_V2SF_type_node
- || type == opaque_p_V2SI_type_node
- || (TREE_CODE (type) == VECTOR_TYPE
- && TYPE_NAME (type)
- && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (type))
- && strcmp (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))),
- "__ev64_opaque__") == 0)));
+ || type == opaque_p_V2SI_type_node));
}
static rtx
-rs6000_dwarf_register_span (reg)
- rtx reg;
+rs6000_dwarf_register_span (rtx reg)
{
unsigned regno;
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index e91571967d5..dd10fa9953b 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1708,6 +1708,8 @@ typedef struct machine_function GTY(())
const char *some_ld_name;
/* Whether the instruction chain has been scanned already. */
int insn_chain_scanned_p;
+ /* Flags if __builtin_return_address (0) was used. */
+ int ra_need_lr;
} machine_function;
/* Define a data type for recording info about an argument list
@@ -1734,7 +1736,6 @@ typedef struct rs6000_args
int fregno; /* next available FP register */
int vregno; /* next available AltiVec register */
int nargs_prototype; /* # args left in the current prototype */
- int orig_nargs; /* Original value of nargs_prototype */
int prototype; /* Whether a prototype was defined */
int stdarg; /* Whether function is a stdarg function. */
int call_cookie; /* Do special things for this call */
@@ -1878,13 +1879,8 @@ typedef struct rs6000_args
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
rs6000_va_arg (valist, type)
-/* For AIX, the rule is that structures are passed left-aligned in
- their stack slot. However, GCC does not presently do this:
- structures which are the same size as integer types are passed
- right-aligned, as if they were in fact integers. This only
- matters for structures of size 1 or 2, or 4 when TARGET_64BIT.
- ABI_V4 does not use std_expand_builtin_va_arg. */
-#define PAD_VARARGS_DOWN (TYPE_MODE (type) != BLKmode)
+#define PAD_VARARGS_DOWN \
+ (FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward)
/* Define this macro to be a nonzero value if the location where a function
argument is passed depends on whether or not it is a named argument. */
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index bf778e2e22c..5f91155179f 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -14039,7 +14039,7 @@
return \"bdz $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrsi_internal2"
[(set (pc)
@@ -14063,7 +14063,7 @@
return \"{bdn|bdnz} $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrdi_internal1"
[(set (pc)
@@ -14087,7 +14087,7 @@
return \"bdz $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrdi_internal2"
[(set (pc)
@@ -14111,7 +14111,7 @@
return \"{bdn|bdnz} $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
;; Similar, but we can use GE since we have a REG_NONNEG.
@@ -14137,7 +14137,7 @@
return \"bdz $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrsi_internal4"
[(set (pc)
@@ -14161,7 +14161,7 @@
return \"{bdn|bdnz} $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrdi_internal3"
[(set (pc)
@@ -14185,7 +14185,7 @@
return \"bdz $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrdi_internal4"
[(set (pc)
@@ -14209,7 +14209,7 @@
return \"{bdn|bdnz} $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
;; Similar but use EQ
@@ -14235,7 +14235,7 @@
return \"{bdn|bdnz} $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrsi_internal6"
[(set (pc)
@@ -14259,7 +14259,7 @@
return \"bdz $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrdi_internal5"
[(set (pc)
@@ -14283,7 +14283,7 @@
return \"{bdn|bdnz} $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
(define_insn "*ctrdi_internal6"
[(set (pc)
@@ -14307,7 +14307,7 @@
return \"bdz $+8\;b %l0\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,12,16,16")])
+ (set_attr "length" "*,12,16,16")])
;; Now the splitters if we could not allocate the CTR register
@@ -14637,8 +14637,6 @@
""
"
{
- if (TARGET_AIX)
- rs6000_emit_eh_toc_restore (EH_RETURN_STACKADJ_RTX);
if (TARGET_32BIT)
emit_insn (gen_eh_set_lr_si (operands[0]));
else
diff --git a/gcc/config/rs6000/spe.h b/gcc/config/rs6000/spe.h
index ca90b8068d8..16765161fde 100644
--- a/gcc/config/rs6000/spe.h
+++ b/gcc/config/rs6000/spe.h
@@ -45,7 +45,6 @@ typedef unsigned __vector __ev64_u32__;
typedef long long __vector __ev64_s64__;
typedef unsigned long long __vector __ev64_u64__;
typedef float __vector __ev64_fs__;
-typedef int __vector __ev64_opaque__;
#define __v2si __ev64_opaque__
#define __v2sf __ev64_fs__
diff --git a/gcc/config/rs6000/spe.md b/gcc/config/rs6000/spe.md
index 82ab17be127..becdaa42bb2 100644
--- a/gcc/config/rs6000/spe.md
+++ b/gcc/config/rs6000/spe.md
@@ -37,6 +37,13 @@
"efsabs %0,%1"
[(set_attr "type" "fpsimple")])
+(define_insn "*nabssf2_gpr"
+ [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
+ (neg:SF (abs:SF (match_operand:SF 1 "gpc_reg_operand" "r"))))]
+ "TARGET_HARD_FLOAT && !TARGET_FPRS"
+ "efsnabs %0,%1"
+ [(set_attr "type" "fpsimple")])
+
(define_insn "*addsf3_gpr"
[(set (match_operand:SF 0 "gpc_reg_operand" "=r")
(plus:SF (match_operand:SF 1 "gpc_reg_operand" "%r")
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 822a4380f2e..3e8b3540128 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -494,7 +494,7 @@ toc_section () \
} \
} \
\
-extern int in_toc_section PARAMS ((void)); \
+extern int in_toc_section (void); \
int in_toc_section () \
{ \
return in_section == in_toc; \
@@ -1065,8 +1065,8 @@ extern int fixuplabelno;
/* GNU/Linux support. */
#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
-%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
-%{profile:-lc_p} %{!profile:-lc}}}"
+%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
+%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
#ifdef HAVE_LD_PIE
#define STARTFILE_LINUX_SPEC "\
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index 7641fcb2076..40026d3b85f 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -21,76 +21,83 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Declare functions in s390.c. */
-extern void optimization_options PARAMS ((int, int));
-extern void override_options PARAMS ((void));
-extern int s390_arg_frame_offset PARAMS ((void));
-extern void s390_emit_prologue PARAMS ((void));
-extern void s390_emit_epilogue PARAMS ((void));
-extern void s390_function_profiler PARAMS ((FILE *, int));
+extern void optimization_options (int, int);
+extern void override_options (void);
+extern int s390_arg_frame_offset (void);
+extern void s390_load_got (int);
+extern void s390_emit_prologue (void);
+extern void s390_emit_epilogue (void);
+extern void s390_function_profiler (FILE *, int);
#ifdef RTX_CODE
-extern int s390_extra_constraint PARAMS ((rtx, int));
-extern int const0_operand PARAMS ((rtx, enum machine_mode));
-extern int consttable_operand PARAMS ((rtx, enum machine_mode));
-extern int larl_operand PARAMS ((rtx, enum machine_mode));
-extern int s_operand PARAMS ((rtx, enum machine_mode));
-extern int s_imm_operand PARAMS ((rtx, enum machine_mode));
-extern int bras_sym_operand PARAMS ((rtx, enum machine_mode));
-extern int load_multiple_operation PARAMS ((rtx, enum machine_mode));
-extern int store_multiple_operation PARAMS ((rtx, enum machine_mode));
-extern int s390_single_hi PARAMS ((rtx, enum machine_mode, int));
-extern int s390_extract_hi PARAMS ((rtx, enum machine_mode, int));
-extern int s390_single_qi PARAMS ((rtx, enum machine_mode, int));
-extern int s390_extract_qi PARAMS ((rtx, enum machine_mode, int));
-extern bool s390_split_ok_p PARAMS ((rtx, rtx, enum machine_mode, int));
-extern int tls_symbolic_operand PARAMS ((rtx));
+extern int s390_extra_constraint (rtx, int);
+extern int const0_operand (rtx, enum machine_mode);
+extern int consttable_operand (rtx, enum machine_mode);
+extern int larl_operand (rtx, enum machine_mode);
+extern int s_operand (rtx, enum machine_mode);
+extern int s_imm_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 bool s390_split_ok_p (rtx, rtx, enum machine_mode, int);
+extern int tls_symbolic_operand (rtx);
-extern int s390_match_ccmode PARAMS ((rtx, enum machine_mode));
-extern enum machine_mode s390_tm_ccmode PARAMS ((rtx, rtx, int));
-extern enum machine_mode s390_select_ccmode PARAMS ((enum rtx_code, rtx, rtx));
-extern int symbolic_reference_mentioned_p PARAMS ((rtx));
-extern int tls_symbolic_reference_mentioned_p PARAMS ((rtx));
-extern rtx s390_tls_get_offset PARAMS ((void));
-extern int legitimate_la_operand_p PARAMS ((rtx));
-extern int preferred_la_operand_p PARAMS ((rtx));
-extern int legitimate_pic_operand_p PARAMS ((rtx));
-extern int legitimate_constant_p PARAMS ((rtx));
-extern int legitimate_reload_constant_p PARAMS ((rtx));
-extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
-extern rtx legitimize_pic_address PARAMS ((rtx, rtx));
-extern rtx legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
-extern enum reg_class s390_preferred_reload_class PARAMS ((rtx, enum reg_class));
-extern enum reg_class s390_secondary_input_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx));
-extern enum reg_class s390_secondary_output_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx));
-extern int s390_plus_operand PARAMS ((rtx, enum machine_mode));
-extern void s390_expand_plus_operand PARAMS ((rtx, rtx, rtx));
-extern void emit_symbolic_move PARAMS ((rtx *));
-extern void s390_load_address PARAMS ((rtx, rtx));
-extern void s390_expand_movstr PARAMS ((rtx, rtx, rtx));
-extern void s390_expand_clrstr PARAMS ((rtx, rtx));
-extern void s390_expand_cmpstr PARAMS ((rtx, rtx, rtx, rtx));
-extern rtx s390_return_addr_rtx PARAMS ((int, rtx));
+extern int s390_match_ccmode (rtx, enum machine_mode);
+extern enum machine_mode s390_tm_ccmode (rtx, rtx, int);
+extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx);
+extern int symbolic_reference_mentioned_p (rtx);
+extern int tls_symbolic_reference_mentioned_p (rtx);
+extern rtx s390_tls_get_offset (void);
+extern int legitimate_la_operand_p (rtx);
+extern int preferred_la_operand_p (rtx);
+extern int legitimate_pic_operand_p (rtx);
+extern int legitimate_constant_p (rtx);
+extern int legitimate_reload_constant_p (rtx);
+extern int legitimate_address_p (enum machine_mode, rtx, int);
+extern rtx legitimize_pic_address (rtx, rtx);
+extern rtx legitimize_address (rtx, rtx, enum machine_mode);
+extern enum reg_class s390_preferred_reload_class (rtx, enum reg_class);
+extern enum reg_class s390_secondary_input_reload_class (enum reg_class,
+ enum machine_mode,
+ rtx);
+extern enum reg_class s390_secondary_output_reload_class (enum reg_class,
+ enum machine_mode,
+ rtx);
+extern int s390_plus_operand (rtx, enum machine_mode);
+extern void s390_expand_plus_operand (rtx, rtx, rtx);
+extern void emit_symbolic_move (rtx *);
+extern void s390_load_address (rtx, rtx);
+extern void s390_expand_movstr (rtx, rtx, rtx);
+extern void s390_expand_clrstr (rtx, rtx);
+extern void s390_expand_cmpmem (rtx, rtx, rtx, rtx);
+extern rtx s390_return_addr_rtx (int, rtx);
-extern void s390_output_symbolic_const PARAMS ((FILE *, rtx));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void s390_output_constant_pool PARAMS ((rtx, rtx));
-extern void s390_trampoline_template PARAMS ((FILE *));
-extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern rtx s390_gen_rtx_const_DI PARAMS ((int, int));
-extern void s390_output_dwarf_dtprel PARAMS ((FILE*, int, rtx));
-extern int s390_agen_dep_p PARAMS ((rtx, rtx));
+extern void s390_output_symbolic_const (FILE *, rtx);
+extern void print_operand_address (FILE *, rtx);
+extern void print_operand (FILE *, rtx, int);
+extern void s390_output_constant_pool (rtx, rtx);
+extern void s390_output_pool_entry (FILE *, rtx, enum machine_mode,
+ unsigned int);
+extern void s390_trampoline_template (FILE *);
+extern void s390_initialize_trampoline (rtx, rtx, rtx);
+extern rtx s390_gen_rtx_const_DI (int, int);
+extern void s390_output_dwarf_dtprel (FILE*, int, rtx);
+extern int s390_agen_dep_p (rtx, rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern int s390_function_arg_pass_by_reference PARAMS ((enum machine_mode, tree));
-extern void s390_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
-extern tree s390_build_va_list PARAMS ((void));
+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 PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
-extern void s390_va_start PARAMS ((tree, rtx));
-extern rtx s390_va_arg PARAMS ((tree, tree));
+extern rtx s390_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern void s390_va_start (tree, rtx);
+extern rtx s390_va_arg (tree, tree);
#endif /* RTX_CODE */
#endif /* TREE_CODE */
-
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 7db180d8141..7086d5b6932 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -54,29 +54,28 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0)
-static bool s390_assemble_integer PARAMS ((rtx, unsigned int, int));
-static void s390_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT));
-static void s390_encode_section_info PARAMS ((tree, rtx, int));
-static bool s390_cannot_force_const_mem PARAMS ((rtx));
-static rtx s390_delegitimize_address PARAMS ((rtx));
-static void s390_init_builtins PARAMS ((void));
-static rtx s390_expand_builtin PARAMS ((tree, rtx, rtx,
- enum machine_mode, int));
-static void s390_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
-static enum attr_type s390_safe_attr_type PARAMS ((rtx));
-
-static int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int s390_adjust_priority PARAMS ((rtx, int));
-static int s390_issue_rate PARAMS ((void));
-static int s390_use_dfa_pipeline_interface PARAMS ((void));
-static int s390_first_cycle_multipass_dfa_lookahead PARAMS ((void));
-static int s390_sched_reorder2 PARAMS ((FILE *, int, rtx *, int *, int));
-static bool s390_rtx_costs PARAMS ((rtx, int, int, int *));
-static int s390_address_cost PARAMS ((rtx));
-static void s390_reorg PARAMS ((void));
-
+static bool s390_assemble_integer (rtx, unsigned int, int);
+static void s390_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT);
+static void s390_encode_section_info (tree, rtx, int);
+static bool s390_cannot_force_const_mem (rtx);
+static rtx s390_delegitimize_address (rtx);
+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,
+ HOST_WIDE_INT, tree);
+static enum attr_type s390_safe_attr_type (rtx);
+
+static int s390_adjust_cost (rtx, rtx, rtx, int);
+static int s390_adjust_priority (rtx, int);
+static int s390_issue_rate (void);
+static int s390_use_dfa_pipeline_interface (void);
+static int s390_first_cycle_multipass_dfa_lookahead (void);
+static int s390_sched_reorder2 (FILE *, int, rtx *, int *, int);
+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);
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
@@ -138,6 +137,9 @@ static void s390_reorg PARAMS ((void));
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG s390_reorg
+#undef TARGET_VALID_POINTER_MODE
+#define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode
+
struct gcc_target targetm = TARGET_INITIALIZER;
extern int reload_completed;
@@ -181,12 +183,13 @@ const char *s390_arch_string; /* for -march=<xxx> */
struct machine_function GTY(())
{
- /* Label of start of initial literal pool. */
- rtx literal_pool_label;
-
/* 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). */
+ bool save_return_addr_p;
+
/* Number of first and last gpr to be saved, restored. */
int first_save_gpr;
int first_restore_gpr;
@@ -199,50 +202,46 @@ struct machine_function GTY(())
const char *some_ld_name;
};
-static int s390_match_ccmode_set PARAMS ((rtx, enum machine_mode));
-static int s390_branch_condition_mask PARAMS ((rtx));
-static const char *s390_branch_condition_mnemonic PARAMS ((rtx, int));
-static int check_mode PARAMS ((rtx, enum machine_mode *));
-static int general_s_operand PARAMS ((rtx, enum machine_mode, int));
-static int s390_short_displacement PARAMS ((rtx));
-static int s390_decompose_address PARAMS ((rtx, struct s390_address *));
-static rtx get_thread_pointer PARAMS ((void));
-static rtx legitimize_tls_address PARAMS ((rtx, rtx));
-static const char *get_some_local_dynamic_name PARAMS ((void));
-static int get_some_local_dynamic_name_1 PARAMS ((rtx *, void *));
-static int reg_used_in_mem_p PARAMS ((int, rtx));
-static int addr_generation_dependency_p PARAMS ((rtx, rtx));
-static int s390_split_branches PARAMS ((rtx, bool *));
-static void find_constant_pool_ref PARAMS ((rtx, rtx *));
-static void replace_constant_pool_ref PARAMS ((rtx *, rtx, rtx));
-static int find_base_register_in_addr PARAMS ((struct s390_address *));
-static bool find_base_register_ref PARAMS ((rtx));
-static void replace_base_register_ref PARAMS ((rtx *, rtx));
-static void s390_optimize_prolog PARAMS ((int));
-static bool s390_fixup_clobbered_return_reg PARAMS ((rtx));
-static int find_unused_clobbered_reg PARAMS ((void));
-static void s390_frame_info PARAMS ((void));
-static rtx save_fpr PARAMS ((rtx, int, int));
-static rtx restore_fpr PARAMS ((rtx, int, int));
-static rtx save_gprs PARAMS ((rtx, int, int, int));
-static rtx restore_gprs PARAMS ((rtx, int, int, int));
-static int s390_function_arg_size PARAMS ((enum machine_mode, tree));
-static bool s390_function_arg_float PARAMS ((enum machine_mode, tree));
-static struct machine_function * s390_init_machine_status PARAMS ((void));
+static int s390_match_ccmode_set (rtx, enum machine_mode);
+static int s390_branch_condition_mask (rtx);
+static const char *s390_branch_condition_mnemonic (rtx, int);
+static int check_mode (rtx, enum machine_mode *);
+static int general_s_operand (rtx, enum machine_mode, int);
+static int s390_short_displacement (rtx);
+static int s390_decompose_address (rtx, struct s390_address *);
+static rtx get_thread_pointer (void);
+static rtx legitimize_tls_address (rtx, rtx);
+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 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 int find_unused_clobbered_reg (void);
+static void s390_frame_info (void);
+static rtx save_fpr (rtx, int, int);
+static rtx restore_fpr (rtx, int, int);
+static rtx save_gprs (rtx, int, int, int);
+static rtx restore_gprs (rtx, int, int, int);
+static int s390_function_arg_size (enum machine_mode, tree);
+static bool s390_function_arg_float (enum machine_mode, tree);
+static struct machine_function * s390_init_machine_status (void);
/* Check whether integer displacement is in range. */
#define DISP_IN_RANGE(d) \
(TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \
: ((d) >= 0 && (d) <= 4095))
-
+
/* Return true if SET either doesn't set the CC register, or else
- the source and destination have matching CC modes and that
+ the source and destination have matching CC modes and that
CC mode is at least as constrained as REQ_MODE. */
-
+
static int
-s390_match_ccmode_set (set, req_mode)
- rtx set;
- enum machine_mode req_mode;
+s390_match_ccmode_set (rtx set, enum machine_mode req_mode)
{
enum machine_mode set_mode;
@@ -280,23 +279,21 @@ s390_match_ccmode_set (set, req_mode)
if (req_mode != CCAmode)
return 0;
break;
-
+
default:
abort ();
}
-
+
return (GET_MODE (SET_SRC (set)) == set_mode);
}
-/* Return true if every SET in INSN that sets the CC register
- has source and destination with matching CC modes and that
- CC mode is at least as constrained as REQ_MODE.
+/* Return true if every SET in INSN that sets the CC register
+ has source and destination with matching CC modes and that
+ CC mode is at least as constrained as REQ_MODE.
If REQ_MODE is VOIDmode, always return false. */
-
+
int
-s390_match_ccmode (insn, req_mode)
- rtx insn;
- enum machine_mode req_mode;
+s390_match_ccmode (rtx insn, enum machine_mode req_mode)
{
int i;
@@ -319,18 +316,15 @@ s390_match_ccmode (insn, req_mode)
return 1;
}
-/* If a test-under-mask instruction can be used to implement
+/* If a test-under-mask instruction can be used to implement
(compare (and ... OP1) OP2), return the CC mode required
- to do that. Otherwise, return VOIDmode.
+ to do that. Otherwise, return VOIDmode.
MIXED is true if the instruction can distinguish between
CC1 and CC2 for mixed selected bits (TMxx), it is false
if the instruction cannot (TM). */
enum machine_mode
-s390_tm_ccmode (op1, op2, mixed)
- rtx op1;
- rtx op2;
- int mixed;
+s390_tm_ccmode (rtx op1, rtx op2, int mixed)
{
int bit0, bit1;
@@ -358,25 +352,23 @@ s390_tm_ccmode (op1, op2, mixed)
return VOIDmode;
}
-/* Given a comparison code OP (EQ, NE, etc.) and the operands
- OP0 and OP1 of a COMPARE, return the mode to be used for the
+/* Given a comparison code OP (EQ, NE, etc.) and the operands
+ OP0 and OP1 of a COMPARE, return the mode to be used for the
comparison. */
enum machine_mode
-s390_select_ccmode (code, op0, op1)
- enum rtx_code code;
- rtx op0;
- rtx op1;
+s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1)
{
switch (code)
{
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_LETTER_P (INTVAL (XEXP (op0, 1)), 'K'))
return CCAPmode;
- if (GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
- || GET_CODE (op1) == NEG)
+ if ((GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
+ || GET_CODE (op1) == NEG)
+ && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT)
return CCLmode;
if (GET_CODE (op0) == AND)
@@ -392,11 +384,11 @@ s390_select_ccmode (code, op0, op1)
}
}
- if (register_operand (op0, HImode)
+ if (register_operand (op0, HImode)
&& GET_CODE (op1) == CONST_INT
&& (INTVAL (op1) == -1 || INTVAL (op1) == 65535))
return CCT3mode;
- if (register_operand (op0, QImode)
+ if (register_operand (op0, QImode)
&& GET_CODE (op1) == CONST_INT
&& (INTVAL (op1) == -1 || INTVAL (op1) == 255))
return CCT3mode;
@@ -408,7 +400,7 @@ s390_select_ccmode (code, op0, 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_LETTER_P (INTVAL (XEXP (op0, 1)), 'K'))
{
if (INTVAL (XEXP((op0), 1)) < 0)
return CCANmode;
@@ -430,7 +422,8 @@ s390_select_ccmode (code, op0, op1)
case LTU:
case GEU:
- if (GET_CODE (op0) == PLUS)
+ if (GET_CODE (op0) == PLUS
+ && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT)
return CCL1mode;
if ((GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op0) == ZERO_EXTEND)
@@ -440,7 +433,8 @@ s390_select_ccmode (code, op0, op1)
case LEU:
case GTU:
- if (GET_CODE (op0) == MINUS)
+ if (GET_CODE (op0) == MINUS
+ && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT)
return CCL2mode;
if ((GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op0) == ZERO_EXTEND)
@@ -453,13 +447,12 @@ s390_select_ccmode (code, op0, op1)
}
}
-/* Return branch condition mask to implement a branch
+/* Return branch condition mask to implement a branch
specified by CODE. */
static int
-s390_branch_condition_mask (code)
- rtx code;
-{
+s390_branch_condition_mask (rtx code)
+{
const int CC0 = 1 << 3;
const int CC1 = 1 << 2;
const int CC2 = 1 << 1;
@@ -647,14 +640,12 @@ s390_branch_condition_mask (code)
}
}
-/* If INV is false, return assembler mnemonic string to implement
- a branch specified by CODE. If INV is true, return mnemonic
+/* If INV is false, return assembler mnemonic string to implement
+ a branch specified by CODE. If INV is true, return mnemonic
for the corresponding inverted branch. */
static const char *
-s390_branch_condition_mnemonic (code, inv)
- rtx code;
- int inv;
+s390_branch_condition_mnemonic (rtx code, int inv)
{
static const char *const mnemonic[16] =
{
@@ -676,15 +667,12 @@ s390_branch_condition_mnemonic (code, inv)
}
/* If OP is an integer constant of mode MODE with exactly one
- HImode subpart unequal to DEF, return the number of that
+ 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 (op, mode, def)
- rtx op;
- enum machine_mode mode;
- int def;
+s390_single_hi (rtx op, enum machine_mode mode, int def)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -739,17 +727,14 @@ s390_single_hi (op, mode, def)
return part == -1 ? 0 : (n_parts - 1 - part);
}
- return -1;
+ return -1;
}
-/* Extract the HImode part number PART from integer
+/* Extract the HImode part number PART from integer
constant OP of mode MODE. */
int
-s390_extract_hi (op, mode, part)
- rtx op;
- enum machine_mode mode;
- int part;
+s390_extract_hi (rtx op, enum machine_mode mode, int part)
{
int n_parts = GET_MODE_SIZE (mode) / 2;
if (part < 0 || part >= n_parts)
@@ -772,22 +757,19 @@ s390_extract_hi (op, mode, part)
value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op),
part -= HOST_BITS_PER_WIDE_INT / 16;
- return ((value >> (16 * part)) & 0xffff);
+ return ((value >> (16 * part)) & 0xffff);
}
abort ();
}
/* If OP is an integer constant of mode MODE with exactly one
- QImode subpart unequal to DEF, return the number of that
+ 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. */
int
-s390_single_qi (op, mode, def)
- rtx op;
- enum machine_mode mode;
- int def;
+s390_single_qi (rtx op, enum machine_mode mode, int def)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -842,17 +824,14 @@ s390_single_qi (op, mode, def)
return part == -1 ? 0 : (n_parts - 1 - part);
}
- return -1;
+ return -1;
}
-/* Extract the QImode part number PART from integer
+/* Extract the QImode part number PART from integer
constant OP of mode MODE. */
int
-s390_extract_qi (op, mode, part)
- rtx op;
- enum machine_mode mode;
- int part;
+s390_extract_qi (rtx op, enum machine_mode mode, int part)
{
int n_parts = GET_MODE_SIZE (mode);
if (part < 0 || part >= n_parts)
@@ -875,22 +854,18 @@ s390_extract_qi (op, mode, part)
value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op),
part -= HOST_BITS_PER_WIDE_INT / 8;
- return ((value >> (8 * part)) & 0xff);
+ return ((value >> (8 * part)) & 0xff);
}
abort ();
}
-/* Check whether we can (and want to) split a double-word
- move in mode MODE from SRC to DST into two single-word
+/* Check whether we can (and want to) split a double-word
+ move in mode MODE from SRC to DST into two single-word
moves, moving the subword FIRST_SUBWORD first. */
bool
-s390_split_ok_p (dst, src, mode, first_subword)
- rtx dst;
- rtx src;
- enum machine_mode mode;
- int first_subword;
+s390_split_ok_p (rtx dst, rtx src, enum machine_mode mode, int first_subword)
{
/* Floating point registers cannot be split. */
if (FP_REG_P (src) || FP_REG_P (dst))
@@ -918,7 +893,7 @@ s390_split_ok_p (dst, src, mode, first_subword)
}
-/* Change optimizations to be performed, depending on the
+/* Change optimizations to be performed, depending on the
optimization level.
LEVEL is the optimization level specified; 2 if `-O2' is
@@ -927,9 +902,7 @@ s390_split_ok_p (dst, src, mode, first_subword)
SIZE is nonzero if `-Os' is specified and zero otherwise. */
void
-optimization_options (level, size)
- int level ATTRIBUTE_UNUSED;
- int size ATTRIBUTE_UNUSED;
+optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
{
/* ??? There are apparently still problems with -fcaller-saves. */
flag_caller_saves = 0;
@@ -940,7 +913,7 @@ optimization_options (level, size)
}
void
-override_options ()
+override_options (void)
{
int i;
static struct pta
@@ -954,7 +927,7 @@ override_options ()
{"g5", PROCESSOR_9672_G5, PF_IEEE_FLOAT},
{"g6", PROCESSOR_9672_G6, PF_IEEE_FLOAT},
{"z900", PROCESSOR_2064_Z900, PF_IEEE_FLOAT | PF_ZARCH},
- {"z990", PROCESSOR_2084_Z990, PF_IEEE_FLOAT | PF_ZARCH
+ {"z990", PROCESSOR_2084_Z990, PF_IEEE_FLOAT | PF_ZARCH
| PF_LONG_DISPLACEMENT},
};
@@ -1027,14 +1000,13 @@ const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] =
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
- ADDR_REGS, NO_REGS, ADDR_REGS
+ ADDR_REGS, NO_REGS, ADDR_REGS
};
/* Return attribute type of insn. */
static enum attr_type
-s390_safe_attr_type (insn)
- rtx insn;
+s390_safe_attr_type (rtx insn)
{
if (recog_memoized (insn) >= 0)
return get_attr_type (insn);
@@ -1045,11 +1017,9 @@ s390_safe_attr_type (insn)
/* Return true if OP a (const_int 0) operand.
OP is the current operation.
MODE is the current operation mode. */
-
+
int
-const0_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+const0_operand (register rtx op, enum machine_mode mode)
{
return op == CONST0_RTX (mode);
}
@@ -1059,20 +1029,16 @@ const0_operand (op, mode)
MODE is the current operation mode. */
int
-consttable_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+consttable_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return CONSTANT_P (op);
}
/* Return true if the mode of operand OP matches MODE.
- If MODE is set to VOIDmode, set it to the mode of OP. */
+ If MODE is set to VOIDmode, set it to the mode of OP. */
static int
-check_mode (op, mode)
- register rtx op;
- enum machine_mode *mode;
+check_mode (register rtx op, enum machine_mode *mode)
{
if (*mode == VOIDmode)
*mode = GET_MODE (op);
@@ -1089,9 +1055,7 @@ check_mode (op, mode)
MODE is the current operation mode. */
int
-larl_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+larl_operand (register rtx op, enum machine_mode mode)
{
if (! check_mode (op, &mode))
return 0;
@@ -1119,7 +1083,7 @@ larl_operand (op, mode)
if (INTVAL (XEXP (op, 1)) >= (HOST_WIDE_INT)1 << 32
|| INTVAL (XEXP (op, 1)) < -((HOST_WIDE_INT)1 << 32))
return 0;
-#endif
+#endif
op = XEXP (op, 0);
}
@@ -1134,10 +1098,10 @@ larl_operand (op, mode)
/* Now we must have a @GOTENT offset or @PLT stub
or an @INDNTPOFF TLS offset. */
if (GET_CODE (op) == UNSPEC
- && XINT (op, 1) == 111)
+ && XINT (op, 1) == UNSPEC_GOTENT)
return 1;
if (GET_CODE (op) == UNSPEC
- && XINT (op, 1) == 113)
+ && XINT (op, 1) == UNSPEC_PLT)
return 1;
if (GET_CODE (op) == UNSPEC
&& XINT (op, 1) == UNSPEC_INDNTPOFF)
@@ -1153,10 +1117,8 @@ larl_operand (op, mode)
be accepted or not. */
static int
-general_s_operand (op, mode, allow_immediate)
- register rtx op;
- enum machine_mode mode;
- int allow_immediate;
+general_s_operand (register rtx op, enum machine_mode mode,
+ int allow_immediate)
{
struct s390_address addr;
@@ -1167,37 +1129,37 @@ general_s_operand (op, mode, allow_immediate)
/* Just like memory_operand, allow (subreg (mem ...))
after reload. */
- if (reload_completed
- && GET_CODE (op) == SUBREG
+ if (reload_completed
+ && GET_CODE (op) == SUBREG
&& GET_CODE (SUBREG_REG (op)) == MEM)
op = SUBREG_REG (op);
switch (GET_CODE (op))
{
- /* Constants that we are sure will be forced to the
- literal pool in reload are OK as s-operand. Note
- that we cannot call s390_preferred_reload_class here
- because it might not be known yet at this point
- whether the current function is a leaf or not. */
+ /* Constants are OK as s-operand if ALLOW_IMMEDIATE
+ is true and we are still before reload. */
case CONST_INT:
case CONST_DOUBLE:
if (!allow_immediate || reload_completed)
- break;
- if (!legitimate_reload_constant_p (op))
- return 1;
- if (!TARGET_64BIT)
- return 1;
- break;
+ return 0;
+ return 1;
/* Memory operands are OK unless they already use an
index register. */
case MEM:
if (GET_CODE (XEXP (op, 0)) == ADDRESSOF)
return 1;
- if (s390_decompose_address (XEXP (op, 0), &addr)
- && !addr.indx)
- return 1;
- break;
+ if (!s390_decompose_address (XEXP (op, 0), &addr))
+ return 0;
+ if (addr.indx)
+ return 0;
+ /* Do not allow literal pool references unless ALLOW_IMMEDIATE
+ is true. This prevents compares between two literal pool
+ entries from being accepted. */
+ if (!allow_immediate
+ && addr.base && REGNO (addr.base) == BASE_REGISTER)
+ return 0;
+ return 1;
default:
break;
@@ -1211,23 +1173,19 @@ general_s_operand (op, mode, allow_immediate)
MODE is the current operation mode. */
int
-s_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+s_operand (register rtx op, enum machine_mode mode)
{
return general_s_operand (op, mode, 0);
}
-/* Return true if OP is a valid S-type operand or an immediate
- operand that can be addressed as S-type operand by forcing
+/* Return true if OP is a valid S-type operand or an immediate
+ operand that can be addressed as S-type operand by forcing
it into the literal pool.
OP is the current operation.
MODE is the current operation mode. */
int
-s_imm_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+s_imm_operand (register rtx op, enum machine_mode mode)
{
return general_s_operand (op, mode, 1);
}
@@ -1235,8 +1193,7 @@ s_imm_operand (op, mode)
/* Return true if DISP is a valid short displacement. */
static int
-s390_short_displacement (disp)
- rtx disp;
+s390_short_displacement (rtx disp)
{
/* No displacement is OK. */
if (!disp)
@@ -1249,7 +1206,7 @@ s390_short_displacement (disp)
/* GOT offset is not OK, the GOT can be large. */
if (GET_CODE (disp) == CONST
&& GET_CODE (XEXP (disp, 0)) == UNSPEC
- && XINT (XEXP (disp, 0), 1) == 110)
+ && XINT (XEXP (disp, 0), 1) == UNSPEC_GOT)
return 0;
/* All other symbolic constants are literal pool references,
@@ -1263,9 +1220,7 @@ s390_short_displacement (disp)
/* Return true if OP is a valid operand for a C constraint. */
int
-s390_extra_constraint (op, c)
- rtx op;
- int c;
+s390_extra_constraint (rtx op, int c)
{
struct s390_address addr;
@@ -1356,10 +1311,7 @@ s390_extra_constraint (op, c)
scanned. In either case, *TOTAL contains the cost result. */
static bool
-s390_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+s390_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
@@ -1427,8 +1379,7 @@ s390_rtx_costs (x, code, outer_code, total)
/* Return the cost of an address rtx ADDR. */
static int
-s390_address_cost (addr)
- rtx addr;
+s390_address_cost (rtx addr)
{
struct s390_address ad;
if (!s390_decompose_address (addr, &ad))
@@ -1442,9 +1393,7 @@ s390_address_cost (addr)
MODE is the current operation mode. */
int
-bras_sym_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+bras_sym_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
register enum rtx_code code = GET_CODE (op);
@@ -1455,7 +1404,7 @@ bras_sym_operand (op, mode)
/* Allow @PLT stubs. */
if (code == CONST
&& GET_CODE (XEXP (op, 0)) == UNSPEC
- && XINT (XEXP (op, 0), 1) == 113)
+ && XINT (XEXP (op, 0), 1) == UNSPEC_PLT)
return 1;
return 0;
}
@@ -1464,8 +1413,7 @@ bras_sym_operand (op, mode)
otherwise return 0. */
int
-tls_symbolic_operand (op)
- register rtx op;
+tls_symbolic_operand (register rtx op)
{
if (GET_CODE (op) != SYMBOL_REF)
return 0;
@@ -1473,14 +1421,12 @@ tls_symbolic_operand (op)
}
/* Return true if OP is a load multiple operation. It is known to be a
- PARALLEL and the first section will be tested.
+ PARALLEL and the first section will be tested.
OP is the current operation.
MODE is the current operation mode. */
int
-load_multiple_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+load_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count = XVECLEN (op, 0);
unsigned int dest_regno;
@@ -1503,7 +1449,7 @@ load_multiple_operation (op, mode)
if (GET_CODE (src_addr) == REG)
off = 0;
else if (GET_CODE (src_addr) == PLUS
- && GET_CODE (XEXP (src_addr, 0)) == REG
+ && GET_CODE (XEXP (src_addr, 0)) == REG
&& GET_CODE (XEXP (src_addr, 1)) == CONST_INT)
{
off = INTVAL (XEXP (src_addr, 1));
@@ -1537,14 +1483,12 @@ load_multiple_operation (op, mode)
}
/* Return true if OP is a store multiple operation. It is known to be a
- PARALLEL and the first section will be tested.
+ PARALLEL and the first section will be tested.
OP is the current operation.
MODE is the current operation mode. */
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 = XVECLEN (op, 0);
unsigned int src_regno;
@@ -1566,7 +1510,7 @@ store_multiple_operation (op, mode)
if (GET_CODE (dest_addr) == REG)
off = 0;
else if (GET_CODE (dest_addr) == PLUS
- && GET_CODE (XEXP (dest_addr, 0)) == REG
+ && GET_CODE (XEXP (dest_addr, 0)) == REG
&& GET_CODE (XEXP (dest_addr, 1)) == CONST_INT)
{
off = INTVAL (XEXP (dest_addr, 1));
@@ -1602,8 +1546,7 @@ store_multiple_operation (op, mode)
/* Return true 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;
@@ -1633,8 +1576,7 @@ symbolic_reference_mentioned_p (op)
/* Return true if OP contains a reference to a thread-local symbol. */
int
-tls_symbolic_reference_mentioned_p (op)
- rtx op;
+tls_symbolic_reference_mentioned_p (rtx op)
{
register const char *fmt;
register int i;
@@ -1662,19 +1604,18 @@ tls_symbolic_reference_mentioned_p (op)
}
-/* Return true if OP is a legitimate general operand when
- generating PIC code. It is given that flag_pic is on
+/* Return true if OP is a legitimate general operand when
+ generating PIC code. It is given that flag_pic is on
and that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */
int
-legitimate_pic_operand_p (op)
- register rtx op;
+legitimate_pic_operand_p (register rtx op)
{
/* Accept all non-symbolic constants. */
if (!SYMBOLIC_CONST (op))
return 1;
- /* Reject everything else; must be handled
+ /* Reject everything else; must be handled
via emit_symbolic_move. */
return 0;
}
@@ -1683,15 +1624,14 @@ legitimate_pic_operand_p (op)
It is given that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */
int
-legitimate_constant_p (op)
- register rtx op;
+legitimate_constant_p (register rtx op)
{
/* Accept all non-symbolic constants. */
if (!SYMBOLIC_CONST (op))
return 1;
/* Accept immediate LARL operands. */
- if (TARGET_64BIT && larl_operand (op, VOIDmode))
+ if (TARGET_CPU_ZARCH && larl_operand (op, VOIDmode))
return 1;
/* Thread-local symbols are never legal constants. This is
@@ -1716,8 +1656,7 @@ legitimate_constant_p (op)
not constant (TLS) or not known at final link time (PIC). */
static bool
-s390_cannot_force_const_mem (x)
- rtx x;
+s390_cannot_force_const_mem (rtx x)
{
switch (GET_CODE (x))
{
@@ -1749,10 +1688,10 @@ s390_cannot_force_const_mem (x)
switch (XINT (x, 1))
{
/* Only lt-relative or GOT-relative UNSPECs are OK. */
- case 100:
- case 104:
- case 112:
- case 114:
+ case UNSPEC_LTREL_OFFSET:
+ case UNSPEC_GOT:
+ case UNSPEC_GOTOFF:
+ case UNSPEC_PLTOFF:
case UNSPEC_TLSGD:
case UNSPEC_TLSLDM:
case UNSPEC_NTPOFF:
@@ -1772,17 +1711,16 @@ s390_cannot_force_const_mem (x)
}
/* Returns true if the constant value OP is a legitimate general
- operand during and after reload. The difference to
+ operand during and after reload. The difference to
legitimate_constant_p is that this function will not accept
a constant that would need to be forced to the literal pool
before it can be used as operand. */
int
-legitimate_reload_constant_p (op)
- register rtx op;
+legitimate_reload_constant_p (register rtx op)
{
/* Accept la(y) operands. */
- if (GET_CODE (op) == CONST_INT
+ if (GET_CODE (op) == CONST_INT
&& DISP_IN_RANGE (INTVAL (op)))
return 1;
@@ -1792,12 +1730,12 @@ legitimate_reload_constant_p (op)
return 1;
/* Accept lliXX operands. */
- if (TARGET_64BIT
+ if (TARGET_ZARCH
&& s390_single_hi (op, DImode, 0) >= 0)
return 1;
/* Accept larl operands. */
- if (TARGET_64BIT
+ if (TARGET_CPU_ZARCH
&& larl_operand (op, VOIDmode))
return 1;
@@ -1809,9 +1747,7 @@ legitimate_reload_constant_p (op)
return the class of reg to actually use. */
enum reg_class
-s390_preferred_reload_class (op, class)
- rtx op;
- enum reg_class class;
+s390_preferred_reload_class (rtx op, enum reg_class class)
{
/* This can happen if a floating point constant is being
reloaded into an integer register. Leave well alone. */
@@ -1858,10 +1794,8 @@ s390_preferred_reload_class (op, class)
is not a legitimate operand of the LOAD ADDRESS instruction. */
enum reg_class
-s390_secondary_input_reload_class (class, mode, in)
- enum reg_class class ATTRIBUTE_UNUSED;
- enum machine_mode mode;
- rtx in;
+s390_secondary_input_reload_class (enum reg_class class ATTRIBUTE_UNUSED,
+ enum machine_mode mode, rtx in)
{
if (s390_plus_operand (in, mode))
return ADDR_REGS;
@@ -1872,14 +1806,12 @@ s390_secondary_input_reload_class (class, mode, in)
/* Return the register class of a scratch register needed to
store a register of class CLASS in MODE into OUT:
- We need a temporary when storing a double-word to a
+ We need a temporary when storing a double-word to a
non-offsettable memory address. */
enum reg_class
-s390_secondary_output_reload_class (class, mode, out)
- enum reg_class class;
- enum machine_mode mode;
- rtx out;
+s390_secondary_output_reload_class (enum reg_class class,
+ enum machine_mode mode, rtx out)
{
if ((TARGET_64BIT ? mode == TImode
: (mode == DImode || mode == DFmode))
@@ -1893,14 +1825,12 @@ s390_secondary_output_reload_class (class, mode, out)
}
/* Return true if OP is a PLUS that is not a legitimate
- operand for the LA instruction.
+ operand for the LA instruction.
OP is the current operation.
MODE is the current operation mode. */
int
-s390_plus_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+s390_plus_operand (register rtx op, enum machine_mode mode)
{
if (!check_mode (op, &mode) || mode != Pmode)
return FALSE;
@@ -1919,10 +1849,8 @@ s390_plus_operand (op, mode)
SCRATCH may be used as scratch register. */
void
-s390_expand_plus_operand (target, src, scratch)
- register rtx target;
- register rtx src;
- register rtx scratch;
+s390_expand_plus_operand (register rtx target, register rtx src,
+ register rtx scratch)
{
rtx sum1, sum2;
struct s390_address ad;
@@ -1988,14 +1916,14 @@ s390_expand_plus_operand (target, src, scratch)
canonical form so that they will be recognized. */
static int
-s390_decompose_address (addr, out)
- register rtx addr;
- struct s390_address *out;
+s390_decompose_address (register rtx addr, struct s390_address *out)
{
rtx base = NULL_RTX;
rtx indx = NULL_RTX;
rtx disp = NULL_RTX;
int pointer = FALSE;
+ int base_ptr = FALSE;
+ int indx_ptr = FALSE;
/* Decompose address into base + index + displacement. */
@@ -2041,35 +1969,18 @@ s390_decompose_address (addr, out)
disp = addr; /* displacement */
- /* Prefer to use pointer as base, not index. */
- if (base && indx)
- {
- int base_ptr = GET_CODE (base) == UNSPEC
- || (REG_P (base) && REG_POINTER (base));
- int indx_ptr = GET_CODE (indx) == UNSPEC
- || (REG_P (indx) && REG_POINTER (indx));
-
- if (!base_ptr && indx_ptr)
- {
- rtx tmp = base;
- base = indx;
- indx = tmp;
- }
- }
-
/* Validate base register. */
if (base)
{
if (GET_CODE (base) == UNSPEC)
{
- if (XVECLEN (base, 0) != 1 || XINT (base, 1) != 101)
- return FALSE;
- base = XVECEXP (base, 0, 0);
- pointer = TRUE;
+ if (XVECLEN (base, 0) != 1 || XINT (base, 1) != UNSPEC_LTREL_BASE)
+ return FALSE;
+ base = gen_rtx_REG (Pmode, BASE_REGISTER);
}
if (GET_CODE (base) != REG || GET_MODE (base) != Pmode)
- return FALSE;
+ return FALSE;
if (REGNO (base) == BASE_REGISTER
|| REGNO (base) == STACK_POINTER_REGNUM
@@ -2082,7 +1993,7 @@ s390_decompose_address (addr, out)
&& REGNO (base) <= LAST_VIRTUAL_REGISTER)
|| (flag_pic
&& REGNO (base) == PIC_OFFSET_TABLE_REGNUM))
- pointer = TRUE;
+ pointer = base_ptr = TRUE;
}
/* Validate index register. */
@@ -2090,14 +2001,13 @@ s390_decompose_address (addr, out)
{
if (GET_CODE (indx) == UNSPEC)
{
- if (XVECLEN (indx, 0) != 1 || XINT (indx, 1) != 101)
- return FALSE;
- indx = XVECEXP (indx, 0, 0);
- pointer = TRUE;
+ if (XVECLEN (indx, 0) != 1 || XINT (indx, 1) != UNSPEC_LTREL_BASE)
+ return FALSE;
+ indx = gen_rtx_REG (Pmode, BASE_REGISTER);
}
if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode)
- return FALSE;
+ return FALSE;
if (REGNO (indx) == BASE_REGISTER
|| REGNO (indx) == STACK_POINTER_REGNUM
@@ -2110,7 +2020,16 @@ s390_decompose_address (addr, out)
&& REGNO (indx) <= LAST_VIRTUAL_REGISTER)
|| (flag_pic
&& REGNO (indx) == PIC_OFFSET_TABLE_REGNUM))
- pointer = TRUE;
+ pointer = indx_ptr = TRUE;
+ }
+
+ /* Prefer to use pointer as base, not index. */
+ if (base && indx && !base_ptr
+ && (indx_ptr || (!REG_POINTER (base) && REG_POINTER (indx))))
+ {
+ rtx tmp = base;
+ base = indx;
+ indx = tmp;
}
/* Validate displacement. */
@@ -2134,11 +2053,11 @@ s390_decompose_address (addr, out)
}
}
- /* In the small-PIC case, the linker converts @GOT12
+ /* In the small-PIC case, the linker converts @GOT
and @GOTNTPOFF offsets to possible displacements. */
else if (GET_CODE (disp) == CONST
&& GET_CODE (XEXP (disp, 0)) == UNSPEC
- && (XINT (XEXP (disp, 0), 1) == 110
+ && (XINT (XEXP (disp, 0), 1) == UNSPEC_GOT
|| XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF))
{
if (flag_pic != 1)
@@ -2155,7 +2074,7 @@ s390_decompose_address (addr, out)
{
pointer = TRUE;
}
-
+
/* Likewise if a constant offset is present. */
else if (GET_CODE (disp) == CONST
&& GET_CODE (XEXP (disp, 0)) == PLUS
@@ -2167,7 +2086,7 @@ s390_decompose_address (addr, out)
pointer = TRUE;
}
- /* We can convert literal pool addresses to
+ /* We can convert literal pool addresses to
displacements by basing them off the base register. */
else
{
@@ -2194,7 +2113,7 @@ s390_decompose_address (addr, out)
if (offset && offset >= GET_MODE_SIZE (get_pool_mode (disp)))
return FALSE;
- /* Either base or index must be free to
+ /* Either base or index must be free to
hold the base register. */
if (base && indx)
return FALSE;
@@ -2205,7 +2124,8 @@ s390_decompose_address (addr, out)
else
base = gen_rtx_REG (Pmode, BASE_REGISTER);
- disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp), 100);
+ disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp),
+ UNSPEC_LTREL_OFFSET);
disp = gen_rtx_CONST (Pmode, disp);
if (offset)
@@ -2217,7 +2137,7 @@ s390_decompose_address (addr, out)
if (!base && !indx)
pointer = TRUE;
-
+
if (out)
{
out->base = base;
@@ -2233,10 +2153,8 @@ s390_decompose_address (addr, out)
STRICT specifies whether strict register checking applies. */
int
-legitimate_address_p (mode, addr, strict)
- enum machine_mode mode ATTRIBUTE_UNUSED;
- register rtx addr;
- int strict;
+legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+ register rtx addr, int strict)
{
struct s390_address ad;
if (!s390_decompose_address (addr, &ad))
@@ -2265,8 +2183,7 @@ legitimate_address_p (mode, addr, strict)
address, as LA performs only a 31-bit addition. */
int
-legitimate_la_operand_p (op)
- register rtx op;
+legitimate_la_operand_p (register rtx op)
{
struct s390_address addr;
if (!s390_decompose_address (op, &addr))
@@ -2280,10 +2197,9 @@ legitimate_la_operand_p (op)
/* Return 1 if OP is a valid operand for the LA instruction,
and we prefer to use LA over addition to compute it. */
-
+
int
-preferred_la_operand_p (op)
- register rtx op;
+preferred_la_operand_p (register rtx op)
{
struct s390_address addr;
if (!s390_decompose_address (op, &addr))
@@ -2307,9 +2223,7 @@ preferred_la_operand_p (op)
where legitimate_la_operand_p (SRC) returns false. */
void
-s390_load_address (dst, src)
- rtx dst;
- rtx src;
+s390_load_address (rtx dst, rtx src)
{
if (TARGET_64BIT)
emit_move_insn (dst, src);
@@ -2336,9 +2250,7 @@ s390_load_address (dst, src)
reg also appears in the address. */
rtx
-legitimize_pic_address (orig, reg)
- rtx orig;
- rtx reg;
+legitimize_pic_address (rtx orig, rtx reg)
{
rtx addr = orig;
rtx new = orig;
@@ -2348,27 +2260,27 @@ legitimize_pic_address (orig, reg)
|| (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (addr)))
{
/* This is a local symbol. */
- if (TARGET_64BIT && larl_operand (addr, VOIDmode))
+ if (TARGET_CPU_ZARCH && larl_operand (addr, VOIDmode))
{
- /* Access local symbols PC-relative via LARL.
- This is the same as in the non-PIC case, so it is
+ /* Access local symbols PC-relative via LARL.
+ This is the same as in the non-PIC case, so it is
handled automatically ... */
}
else
{
- /* Access local symbols relative to the literal pool. */
+ /* Access local symbols relative to the GOT. */
rtx temp = reg? reg : gen_reg_rtx (Pmode);
- addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 100);
+ if (reload_in_progress || reload_completed)
+ regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
+
+ addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTOFF);
addr = gen_rtx_CONST (Pmode, addr);
addr = force_const_mem (Pmode, addr);
emit_move_insn (temp, addr);
- base = gen_rtx_REG (Pmode, BASE_REGISTER);
- base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101);
- new = gen_rtx_PLUS (Pmode, base, temp);
-
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
if (reg != 0)
{
emit_move_insn (reg, new);
@@ -2384,12 +2296,12 @@ legitimize_pic_address (orig, reg)
if (flag_pic == 1)
{
/* Assume GOT offset < 4k. This is handled the same way
- in both 31- and 64-bit code (@GOT12). */
+ in both 31- and 64-bit code (@GOT). */
if (reload_in_progress || reload_completed)
regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 110);
+ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT);
new = gen_rtx_CONST (Pmode, new);
new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
new = gen_rtx_MEM (Pmode, new);
@@ -2397,14 +2309,14 @@ legitimize_pic_address (orig, reg)
emit_move_insn (reg, new);
new = reg;
}
- else if (TARGET_64BIT)
+ else if (TARGET_CPU_ZARCH)
{
/* If the GOT offset might be >= 4k, we determine the position
of the GOT entry via a PC-relative LARL (@GOTENT). */
rtx temp = gen_reg_rtx (Pmode);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 111);
+ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTENT);
new = gen_rtx_CONST (Pmode, new);
emit_move_insn (temp, new);
@@ -2415,7 +2327,7 @@ legitimize_pic_address (orig, reg)
}
else
{
- /* If the GOT offset might be >= 4k, we have to load it
+ /* If the GOT offset might be >= 4k, we have to load it
from the literal pool (@GOT). */
rtx temp = gen_reg_rtx (Pmode);
@@ -2423,7 +2335,7 @@ legitimize_pic_address (orig, reg)
if (reload_in_progress || reload_completed)
regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
- addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 112);
+ addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT);
addr = gen_rtx_CONST (Pmode, addr);
addr = force_const_mem (Pmode, addr);
emit_move_insn (temp, addr);
@@ -2434,7 +2346,7 @@ legitimize_pic_address (orig, reg)
emit_move_insn (reg, new);
new = reg;
}
- }
+ }
else
{
if (GET_CODE (addr) == CONST)
@@ -2446,35 +2358,41 @@ legitimize_pic_address (orig, reg)
abort ();
switch (XINT (addr, 1))
{
- /* If someone moved an @GOT or lt-relative UNSPEC
+ /* If someone moved a GOT-relative UNSPEC
out of the literal pool, force them back in. */
- case 100:
- case 112:
- case 114:
+ case UNSPEC_GOTOFF:
+ case UNSPEC_PLTOFF:
new = force_const_mem (Pmode, orig);
break;
+ /* @GOT is OK as is if small. */
+ case UNSPEC_GOT:
+ if (flag_pic == 2)
+ new = force_const_mem (Pmode, orig);
+ break;
+
/* @GOTENT is OK as is. */
- case 111:
+ case UNSPEC_GOTENT:
break;
/* @PLT is OK as is on 64-bit, must be converted to
- lt-relative PLT on 31-bit. */
- case 113:
- if (!TARGET_64BIT)
+ GOT-relative @PLTOFF on 31-bit. */
+ case UNSPEC_PLT:
+ if (!TARGET_CPU_ZARCH)
{
rtx temp = reg? reg : gen_reg_rtx (Pmode);
+ if (reload_in_progress || reload_completed)
+ regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
+
addr = XVECEXP (addr, 0, 0);
- addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 114);
+ addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr),
+ UNSPEC_PLTOFF);
addr = gen_rtx_CONST (Pmode, addr);
addr = force_const_mem (Pmode, addr);
emit_move_insn (temp, addr);
- base = gen_rtx_REG (Pmode, BASE_REGISTER);
- base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101);
- new = gen_rtx_PLUS (Pmode, base, temp);
-
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
if (reg != 0)
{
emit_move_insn (reg, new);
@@ -2494,17 +2412,17 @@ legitimize_pic_address (orig, reg)
if (GET_CODE (addr) == PLUS)
{
rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1);
- /* Check first to see if this is a constant offset
+ /* Check first to see if this is a constant offset
from a local symbol reference. */
if ((GET_CODE (op0) == LABEL_REF
|| (GET_CODE (op0) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (op0)))
&& GET_CODE (op1) == CONST_INT)
{
- if (TARGET_64BIT && larl_operand (op0, VOIDmode))
+ if (TARGET_CPU_ZARCH && larl_operand (op0, VOIDmode))
{
if (INTVAL (op1) & 1)
{
- /* LARL can't handle odd offsets, so emit a
+ /* LARL can't handle odd offsets, so emit a
pair of LARL and LA. */
rtx temp = reg? reg : gen_reg_rtx (Pmode);
@@ -2533,20 +2451,21 @@ legitimize_pic_address (orig, reg)
}
else
{
- /* Access local symbols relative to the literal pool. */
+ /* Access local symbols relative to the GOT. */
rtx temp = reg? reg : gen_reg_rtx (Pmode);
- addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op0), 100);
+ if (reload_in_progress || reload_completed)
+ regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
+
+ addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op0),
+ UNSPEC_GOTOFF);
addr = gen_rtx_PLUS (Pmode, addr, op1);
addr = gen_rtx_CONST (Pmode, addr);
addr = force_const_mem (Pmode, addr);
- emit_move_insn (temp, addr);
-
- base = gen_rtx_REG (Pmode, BASE_REGISTER);
- base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101);
- new = gen_rtx_PLUS (Pmode, base, temp);
+ emit_move_insn (temp, addr);
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
if (reg != 0)
{
emit_move_insn (reg, new);
@@ -2555,7 +2474,7 @@ legitimize_pic_address (orig, reg)
}
}
- /* Now, check whether it is an LT-relative symbol plus offset
+ /* Now, check whether it is a GOT relative symbol plus offset
that was pulled out of the literal pool. Force it back in. */
else if (GET_CODE (op0) == UNSPEC
@@ -2563,7 +2482,7 @@ legitimize_pic_address (orig, reg)
{
if (XVECLEN (op0, 0) != 1)
abort ();
- if (XINT (op0, 1) != 100)
+ if (XINT (op0, 1) != UNSPEC_GOTOFF)
abort ();
new = force_const_mem (Pmode, orig);
@@ -2599,7 +2518,7 @@ legitimize_pic_address (orig, reg)
/* Load the thread pointer into a register. */
static rtx
-get_thread_pointer ()
+get_thread_pointer (void)
{
rtx tp;
@@ -2614,7 +2533,7 @@ get_thread_pointer ()
static GTY(()) rtx s390_tls_symbol;
rtx
-s390_tls_get_offset ()
+s390_tls_get_offset (void)
{
if (!s390_tls_symbol)
s390_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tls_get_offset");
@@ -2626,9 +2545,7 @@ s390_tls_get_offset ()
this (thread-local) address. REG may be used as temporary. */
static rtx
-legitimize_tls_address (addr, reg)
- rtx addr;
- rtx reg;
+legitimize_tls_address (rtx addr, rtx reg)
{
rtx new, tls_call, temp, base, r2, insn;
@@ -2708,7 +2625,7 @@ legitimize_tls_address (addr, reg)
temp = gen_reg_rtx (Pmode);
emit_move_insn (temp, new);
}
- else if (TARGET_64BIT)
+ else if (TARGET_CPU_ZARCH)
{
/* If the GOT offset might be >= 4k, we determine the position
of the GOT entry via a PC-relative LARL. */
@@ -2725,7 +2642,7 @@ legitimize_tls_address (addr, reg)
}
else if (flag_pic)
{
- /* If the GOT offset might be >= 4k, we have to load it
+ /* If the GOT offset might be >= 4k, we have to load it
from the literal pool. */
if (reload_in_progress || reload_completed)
@@ -2797,7 +2714,7 @@ legitimize_tls_address (addr, reg)
switch (XINT (XEXP (addr, 0), 1))
{
case UNSPEC_INDNTPOFF:
- if (TARGET_64BIT)
+ if (TARGET_CPU_ZARCH)
new = addr;
else
abort ();
@@ -2817,8 +2734,7 @@ legitimize_tls_address (addr, reg)
/* Emit insns to move operands[1] into operands[0]. */
void
-emit_symbolic_move (operands)
- rtx *operands;
+emit_symbolic_move (rtx *operands)
{
rtx temp = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode);
@@ -2842,10 +2758,8 @@ emit_symbolic_move (operands)
See comments by legitimize_pic_address for details. */
rtx
-legitimize_address (x, oldx, mode)
- register rtx x;
- register rtx oldx ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
rtx constant_term = const0_rtx;
@@ -2859,8 +2773,8 @@ legitimize_address (x, oldx, mode)
else if (flag_pic)
{
if (SYMBOLIC_CONST (x)
- || (GET_CODE (x) == PLUS
- && (SYMBOLIC_CONST (XEXP (x, 0))
+ || (GET_CODE (x) == PLUS
+ && (SYMBOLIC_CONST (XEXP (x, 0))
|| SYMBOLIC_CONST (XEXP (x, 1)))))
x = legitimize_pic_address (x, 0);
@@ -2872,7 +2786,7 @@ legitimize_address (x, oldx, mode)
/* Optimize loading of large displacements by splitting them
into the multiple of 4K and the rest; this allows the
- former to be CSE'd if possible.
+ former to be CSE'd if possible.
Don't do this if the displacement is added to a register
pointing into the stack frame, as the offsets will
@@ -2927,21 +2841,18 @@ legitimize_address (x, oldx, mode)
/* Emit code to move LEN bytes from DST to SRC. */
void
-s390_expand_movstr (dst, src, len)
- rtx dst;
- rtx src;
- rtx len;
+s390_expand_movstr (rtx dst, rtx src, rtx len)
{
- rtx (*gen_short) PARAMS ((rtx, rtx, rtx)) =
+ rtx (*gen_short) (rtx, rtx, rtx) =
TARGET_64BIT ? gen_movstr_short_64 : gen_movstr_short_31;
- rtx (*gen_long) PARAMS ((rtx, rtx, rtx, rtx)) =
+ rtx (*gen_long) (rtx, rtx, rtx, rtx) =
TARGET_64BIT ? gen_movstr_long_64 : gen_movstr_long_31;
if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256)
{
if (INTVAL (len) > 0)
- emit_insn ((*gen_short) (dst, src, GEN_INT (INTVAL (len) - 1)));
+ emit_insn (gen_short (dst, src, GEN_INT (INTVAL (len) - 1)));
}
else if (TARGET_MVCLE)
@@ -2951,15 +2862,15 @@ s390_expand_movstr (dst, src, len)
rtx reg0 = gen_reg_rtx (double_mode);
rtx reg1 = gen_reg_rtx (double_mode);
- emit_move_insn (gen_highpart (single_mode, reg0),
+ emit_move_insn (gen_highpart (single_mode, reg0),
force_operand (XEXP (dst, 0), NULL_RTX));
- emit_move_insn (gen_highpart (single_mode, reg1),
+ emit_move_insn (gen_highpart (single_mode, reg1),
force_operand (XEXP (src, 0), NULL_RTX));
convert_move (gen_lowpart (single_mode, reg0), len, 1);
convert_move (gen_lowpart (single_mode, reg1), len, 1);
- emit_insn ((*gen_long) (reg0, reg1, reg0, reg1));
+ emit_insn (gen_long (reg0, reg1, reg0, reg1));
}
else
@@ -2973,7 +2884,7 @@ s390_expand_movstr (dst, src, len)
if (mode == VOIDmode)
mode = word_mode;
- type = (*lang_hooks.types.type_for_mode) (mode, 1);
+ type = lang_hooks.types.type_for_mode (mode, 1);
if (!type)
abort ();
@@ -2983,14 +2894,14 @@ s390_expand_movstr (dst, src, len)
blocks = gen_reg_rtx (mode);
convert_move (count, len, 1);
- emit_cmp_and_jump_insns (count, const0_rtx,
+ emit_cmp_and_jump_insns (count, const0_rtx,
EQ, NULL_RTX, mode, 1, end_label);
emit_move_insn (dst_addr, force_operand (XEXP (dst, 0), NULL_RTX));
emit_move_insn (src_addr, force_operand (XEXP (src, 0), NULL_RTX));
dst = change_address (dst, VOIDmode, dst_addr);
src = change_address (src, VOIDmode, src_addr);
-
+
temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0);
if (temp != count)
emit_move_insn (count, temp);
@@ -3004,19 +2915,19 @@ s390_expand_movstr (dst, src, len)
make_tree (type, blocks),
make_tree (type, const0_rtx)));
- emit_insn ((*gen_short) (dst, src, GEN_INT (255)));
- s390_load_address (dst_addr,
+ emit_insn (gen_short (dst, src, GEN_INT (255)));
+ s390_load_address (dst_addr,
gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256)));
- s390_load_address (src_addr,
+ s390_load_address (src_addr,
gen_rtx_PLUS (Pmode, src_addr, GEN_INT (256)));
-
+
temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, 0);
if (temp != blocks)
emit_move_insn (blocks, temp);
expand_end_loop ();
- emit_insn ((*gen_short) (dst, src, convert_to_mode (word_mode, count, 1)));
+ emit_insn (gen_short (dst, src, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
}
}
@@ -3024,20 +2935,18 @@ s390_expand_movstr (dst, src, len)
/* Emit code to clear LEN bytes at DST. */
void
-s390_expand_clrstr (dst, len)
- rtx dst;
- rtx len;
+s390_expand_clrstr (rtx dst, rtx len)
{
- rtx (*gen_short) PARAMS ((rtx, rtx)) =
+ rtx (*gen_short) (rtx, rtx) =
TARGET_64BIT ? gen_clrstr_short_64 : gen_clrstr_short_31;
- rtx (*gen_long) PARAMS ((rtx, rtx, rtx)) =
+ rtx (*gen_long) (rtx, rtx, rtx) =
TARGET_64BIT ? gen_clrstr_long_64 : gen_clrstr_long_31;
if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256)
{
if (INTVAL (len) > 0)
- emit_insn ((*gen_short) (dst, GEN_INT (INTVAL (len) - 1)));
+ emit_insn (gen_short (dst, GEN_INT (INTVAL (len) - 1)));
}
else if (TARGET_MVCLE)
@@ -3047,14 +2956,14 @@ s390_expand_clrstr (dst, len)
rtx reg0 = gen_reg_rtx (double_mode);
rtx reg1 = gen_reg_rtx (double_mode);
- emit_move_insn (gen_highpart (single_mode, reg0),
+ emit_move_insn (gen_highpart (single_mode, reg0),
force_operand (XEXP (dst, 0), NULL_RTX));
convert_move (gen_lowpart (single_mode, reg0), len, 1);
emit_move_insn (gen_highpart (single_mode, reg1), const0_rtx);
emit_move_insn (gen_lowpart (single_mode, reg1), const0_rtx);
- emit_insn ((*gen_long) (reg0, reg1, reg0));
+ emit_insn (gen_long (reg0, reg1, reg0));
}
else
@@ -3068,7 +2977,7 @@ s390_expand_clrstr (dst, len)
if (mode == VOIDmode)
mode = word_mode;
- type = (*lang_hooks.types.type_for_mode) (mode, 1);
+ type = lang_hooks.types.type_for_mode (mode, 1);
if (!type)
abort ();
@@ -3078,12 +2987,12 @@ s390_expand_clrstr (dst, len)
blocks = gen_reg_rtx (mode);
convert_move (count, len, 1);
- emit_cmp_and_jump_insns (count, const0_rtx,
+ emit_cmp_and_jump_insns (count, const0_rtx,
EQ, NULL_RTX, mode, 1, end_label);
emit_move_insn (dst_addr, force_operand (XEXP (dst, 0), NULL_RTX));
dst = change_address (dst, VOIDmode, dst_addr);
-
+
temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0);
if (temp != count)
emit_move_insn (count, temp);
@@ -3097,17 +3006,17 @@ s390_expand_clrstr (dst, len)
make_tree (type, blocks),
make_tree (type, const0_rtx)));
- emit_insn ((*gen_short) (dst, GEN_INT (255)));
- s390_load_address (dst_addr,
+ emit_insn (gen_short (dst, GEN_INT (255)));
+ s390_load_address (dst_addr,
gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256)));
-
+
temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, 0);
if (temp != blocks)
emit_move_insn (blocks, temp);
expand_end_loop ();
- emit_insn ((*gen_short) (dst, convert_to_mode (word_mode, count, 1)));
+ emit_insn (gen_short (dst, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
}
}
@@ -3116,17 +3025,13 @@ s390_expand_clrstr (dst, len)
and return the result in TARGET. */
void
-s390_expand_cmpstr (target, op0, op1, len)
- rtx target;
- rtx op0;
- rtx op1;
- rtx len;
-{
- rtx (*gen_short) PARAMS ((rtx, rtx, rtx)) =
- TARGET_64BIT ? gen_cmpstr_short_64 : gen_cmpstr_short_31;
- rtx (*gen_long) PARAMS ((rtx, rtx, rtx, rtx)) =
- TARGET_64BIT ? gen_cmpstr_long_64 : gen_cmpstr_long_31;
- rtx (*gen_result) PARAMS ((rtx)) =
+s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len)
+{
+ rtx (*gen_short) (rtx, rtx, rtx) =
+ TARGET_64BIT ? gen_cmpmem_short_64 : gen_cmpmem_short_31;
+ rtx (*gen_long) (rtx, rtx, rtx, rtx) =
+ TARGET_64BIT ? gen_cmpmem_long_64 : gen_cmpmem_long_31;
+ rtx (*gen_result) (rtx) =
GET_MODE (target) == DImode ? gen_cmpint_di : gen_cmpint_si;
op0 = protect_from_queue (op0, 0);
@@ -3137,8 +3042,8 @@ s390_expand_cmpstr (target, op0, op1, len)
{
if (INTVAL (len) > 0)
{
- emit_insn ((*gen_short) (op0, op1, GEN_INT (INTVAL (len) - 1)));
- emit_insn ((*gen_result) (target));
+ emit_insn (gen_short (op0, op1, GEN_INT (INTVAL (len) - 1)));
+ emit_insn (gen_result (target));
}
else
emit_move_insn (target, const0_rtx);
@@ -3151,16 +3056,16 @@ s390_expand_cmpstr (target, op0, op1, len)
rtx reg0 = gen_reg_rtx (double_mode);
rtx reg1 = gen_reg_rtx (double_mode);
- emit_move_insn (gen_highpart (single_mode, reg0),
+ emit_move_insn (gen_highpart (single_mode, reg0),
force_operand (XEXP (op0, 0), NULL_RTX));
- emit_move_insn (gen_highpart (single_mode, reg1),
+ emit_move_insn (gen_highpart (single_mode, reg1),
force_operand (XEXP (op1, 0), NULL_RTX));
convert_move (gen_lowpart (single_mode, reg0), len, 1);
convert_move (gen_lowpart (single_mode, reg1), len, 1);
- emit_insn ((*gen_long) (reg0, reg1, reg0, reg1));
- emit_insn ((*gen_result) (target));
+ emit_insn (gen_long (reg0, reg1, reg0, reg1));
+ emit_insn (gen_result (target));
}
#if 0
@@ -3177,7 +3082,7 @@ s390_expand_cmpstr (target, op0, op1, len)
if (mode == VOIDmode)
mode = word_mode;
- type = (*lang_hooks.types.type_for_mode) (mode, 1);
+ type = lang_hooks.types.type_for_mode (mode, 1);
if (!type)
abort ();
@@ -3187,14 +3092,14 @@ s390_expand_cmpstr (target, op0, op1, len)
blocks = gen_reg_rtx (mode);
convert_move (count, len, 1);
- emit_cmp_and_jump_insns (count, const0_rtx,
+ emit_cmp_and_jump_insns (count, const0_rtx,
EQ, NULL_RTX, mode, 1, end_label);
emit_move_insn (addr0, force_operand (XEXP (op0, 0), NULL_RTX));
emit_move_insn (addr1, force_operand (XEXP (op1, 0), NULL_RTX));
op0 = change_address (op0, VOIDmode, addr0);
op1 = change_address (op1, VOIDmode, addr1);
-
+
temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0);
if (temp != count)
emit_move_insn (count, temp);
@@ -3208,28 +3113,28 @@ s390_expand_cmpstr (target, op0, op1, len)
make_tree (type, blocks),
make_tree (type, const0_rtx)));
- emit_insn ((*gen_short) (op0, op1, GEN_INT (255)));
+ emit_insn (gen_short (op0, op1, GEN_INT (255)));
temp = gen_rtx_NE (VOIDmode, gen_rtx_REG (CCSmode, 33), const0_rtx);
- temp = gen_rtx_IF_THEN_ELSE (VOIDmode, temp,
+ temp = gen_rtx_IF_THEN_ELSE (VOIDmode, temp,
gen_rtx_LABEL_REF (VOIDmode, end_label), pc_rtx);
temp = gen_rtx_SET (VOIDmode, pc_rtx, temp);
emit_jump_insn (temp);
- s390_load_address (addr0,
+ s390_load_address (addr0,
gen_rtx_PLUS (Pmode, addr0, GEN_INT (256)));
- s390_load_address (addr1,
+ s390_load_address (addr1,
gen_rtx_PLUS (Pmode, addr1, GEN_INT (256)));
-
+
temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, 0);
if (temp != blocks)
emit_move_insn (blocks, temp);
expand_end_loop ();
- emit_insn ((*gen_short) (op0, op1, convert_to_mode (word_mode, count, 1)));
+ emit_insn (gen_short (op0, op1, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
- emit_insn ((*gen_result) (target));
+ emit_insn (gen_result (target));
}
#endif
}
@@ -3238,10 +3143,7 @@ s390_expand_cmpstr (target, op0, op1, len)
We need to emit DTP-relative relocations. */
void
-s390_output_dwarf_dtprel (file, size, x)
- FILE *file;
- int size;
- rtx x;
+s390_output_dwarf_dtprel (FILE *file, int size, rtx x)
{
switch (size)
{
@@ -3263,8 +3165,7 @@ s390_output_dwarf_dtprel (file, size, x)
and turn them back into a direct symbol reference. */
static rtx
-s390_delegitimize_address (orig_x)
- rtx orig_x;
+s390_delegitimize_address (rtx orig_x)
{
rtx x = orig_x, y;
@@ -3279,7 +3180,7 @@ s390_delegitimize_address (orig_x)
{
y = XEXP (XEXP (x, 1), 0);
if (GET_CODE (y) == UNSPEC
- && XINT (y, 1) == 110)
+ && XINT (y, 1) == UNSPEC_GOT)
return XVECEXP (y, 0, 0);
return orig_x;
}
@@ -3288,19 +3189,19 @@ s390_delegitimize_address (orig_x)
{
y = XEXP (x, 0);
if (GET_CODE (y) == UNSPEC
- && XINT (y, 1) == 111)
+ && XINT (y, 1) == UNSPEC_GOTENT)
return XVECEXP (y, 0, 0);
return orig_x;
}
- return orig_x;
+ return orig_x;
}
/* Locate some local-dynamic symbol still in use by this function
so that we can print its name in local-dynamic base patterns. */
static const char *
-get_some_local_dynamic_name ()
+get_some_local_dynamic_name (void)
{
rtx insn;
@@ -3316,9 +3217,7 @@ get_some_local_dynamic_name ()
}
static int
-get_some_local_dynamic_name_1 (px, data)
- rtx *px;
- void *data ATTRIBUTE_UNUSED;
+get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
{
rtx x = *px;
@@ -3338,13 +3237,11 @@ get_some_local_dynamic_name_1 (px, data)
return 0;
}
-/* Output symbolic constant X in assembler syntax to
+/* Output symbolic constant X in assembler syntax to
stdio stream FILE. */
void
-s390_output_symbolic_const (file, x)
- FILE *file;
- rtx x;
+s390_output_symbolic_const (FILE *file, rtx x)
{
switch (GET_CODE (x))
{
@@ -3378,37 +3275,25 @@ s390_output_symbolic_const (file, x)
output_operand_lossage ("invalid UNSPEC as operand (1)");
switch (XINT (x, 1))
{
- case 100:
- case 104:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "-");
- s390_output_symbolic_const (file, cfun->machine->literal_pool_label);
- break;
- case 105:
- s390_output_symbolic_const (file, cfun->machine->literal_pool_label);
- fprintf (file, "-");
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- break;
- case 110:
- s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@GOT12");
- break;
- case 111:
+ case UNSPEC_GOTENT:
s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
fprintf (file, "@GOTENT");
break;
- case 112:
+ case UNSPEC_GOT:
s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
fprintf (file, "@GOT");
break;
- case 113:
+ case UNSPEC_GOTOFF:
+ s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOTOFF");
+ break;
+ case UNSPEC_PLT:
s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
fprintf (file, "@PLT");
break;
- case 114:
+ case UNSPEC_PLTOFF:
s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
- fprintf (file, "@PLT-");
- s390_output_symbolic_const (file, cfun->machine->literal_pool_label);
+ fprintf (file, "@PLTOFF");
break;
case UNSPEC_TLSGD:
s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
@@ -3446,13 +3331,11 @@ s390_output_symbolic_const (file, x)
}
}
-/* Output address operand ADDR in assembler syntax to
+/* Output address operand ADDR in assembler syntax to
stdio stream FILE. */
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
struct s390_address ad;
@@ -3460,7 +3343,7 @@ print_operand_address (file, addr)
|| (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base))
|| (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx)))
output_operand_lossage ("Cannot decompose address.");
-
+
if (ad.disp)
s390_output_symbolic_const (file, ad.disp);
else
@@ -3473,8 +3356,8 @@ print_operand_address (file, addr)
fprintf (file, "(%s)", reg_names[REGNO (ad.base)]);
}
-/* Output operand X in assembler syntax to stdio stream FILE.
- CODE specified the format flag. The following format flags
+/* Output operand X in assembler syntax to stdio stream FILE.
+ CODE specified the format flag. The following format flags
are recognized:
'C': print opcode suffix for branch condition.
@@ -3490,10 +3373,7 @@ print_operand_address (file, addr)
'h': print integer X as if it's a signed word. */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
switch (code)
{
@@ -3630,10 +3510,7 @@ print_operand (file, x, code)
handle values smaller than INT_MIN when printed in decimal. */
static bool
-s390_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+s390_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if (size == 8 && aligned_p
&& GET_CODE (x) == CONST_INT && INTVAL (x) < INT_MIN)
@@ -3645,25 +3522,23 @@ s390_assemble_integer (x, size, aligned_p)
return default_assemble_integer (x, size, aligned_p);
}
-/* Returns true if register REGNO is used for forming
+/* Returns true if register REGNO is used for forming
a memory address in expression X. */
static int
-reg_used_in_mem_p (regno, x)
- int regno;
- rtx x;
+reg_used_in_mem_p (int regno, rtx x)
{
enum rtx_code code = GET_CODE (x);
int i, j;
const char *fmt;
-
+
if (code == MEM)
{
if (refers_to_regno_p (regno, regno+1,
XEXP (x, 0), 0))
return 1;
}
- else if (code == SET
+ else if (code == SET
&& GET_CODE (SET_DEST (x)) == PC)
{
if (refers_to_regno_p (regno, regno+1,
@@ -3677,7 +3552,7 @@ reg_used_in_mem_p (regno, x)
if (fmt[i] == 'e'
&& reg_used_in_mem_p (regno, XEXP (x, i)))
return 1;
-
+
else if (fmt[i] == 'E')
for (j = 0; j < XVECLEN (x, i); j++)
if (reg_used_in_mem_p (regno, XVECEXP (x, i, j)))
@@ -3689,10 +3564,8 @@ reg_used_in_mem_p (regno, x)
/* Returns true if expression DEP_RTX sets an address register
used by instruction INSN to address memory. */
-static int
-addr_generation_dependency_p (dep_rtx, insn)
- rtx dep_rtx;
- rtx insn;
+static int
+addr_generation_dependency_p (rtx dep_rtx, rtx insn)
{
rtx target, pat;
@@ -3734,15 +3607,13 @@ addr_generation_dependency_p (dep_rtx, insn)
/* Return 1, if dep_insn sets register used in insn in the agen unit. */
-int
-s390_agen_dep_p(dep_insn, insn)
- rtx dep_insn;
- rtx insn;
-{
+int
+s390_agen_dep_p (rtx dep_insn, rtx insn)
+{
rtx dep_rtx = PATTERN (dep_insn);
int i;
-
- if (GET_CODE (dep_rtx) == SET
+
+ if (GET_CODE (dep_rtx) == SET
&& addr_generation_dependency_p (dep_rtx, insn))
return 1;
else if (GET_CODE (dep_rtx) == PARALLEL)
@@ -3757,22 +3628,18 @@ s390_agen_dep_p(dep_insn, insn)
}
/* Return the modified cost of the dependency of instruction INSN
- on instruction DEP_INSN through the link LINK. COST is the
+ on instruction DEP_INSN through the link LINK. COST is the
default cost of that dependency.
Data dependencies are all handled without delay. However, if a
- register is modified and subsequently used as base or index
+ register is modified and subsequently used as base or index
register of a memory reference, at least 4 cycles need to pass
- between setting and using the register to avoid pipeline stalls.
+ between setting and using the register to avoid pipeline stalls.
An exception is the LA instruction. An address generated by LA can
be used by introducing only a one cycle stall on the pipeline. */
static int
-s390_adjust_cost (insn, link, dep_insn, cost)
- rtx insn;
- rtx link;
- rtx dep_insn;
- int cost;
+s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
{
rtx dep_rtx;
int i;
@@ -3791,7 +3658,7 @@ s390_adjust_cost (insn, link, dep_insn, cost)
/* DFA based scheduling checks address dependency in md file. */
if (s390_use_dfa_pipeline_interface ())
{
- /* Operand forward in case of lr, load and la. */
+ /* Operand forward in case of lr, load and la. */
if (s390_tune == PROCESSOR_2084_Z990
&& cost == 1
&& (s390_safe_attr_type (dep_insn) == TYPE_LA
@@ -3803,15 +3670,15 @@ s390_adjust_cost (insn, link, dep_insn, cost)
dep_rtx = PATTERN (dep_insn);
- if (GET_CODE (dep_rtx) == SET
+ if (GET_CODE (dep_rtx) == SET
&& addr_generation_dependency_p (dep_rtx, insn))
- cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4;
+ cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4;
else if (GET_CODE (dep_rtx) == PARALLEL)
{
for (i = 0; i < XVECLEN (dep_rtx, 0); i++)
{
if (addr_generation_dependency_p (XVECEXP (dep_rtx, 0, i), insn))
- cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4;
+ cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4;
}
}
@@ -3820,15 +3687,13 @@ s390_adjust_cost (insn, link, dep_insn, cost)
/* A C statement (sans semicolon) to update the integer scheduling priority
INSN_PRIORITY (INSN). Increase the priority to execute the INSN earlier,
reduce the priority to execute INSN later. Do not define this macro if
- you do not need to adjust the scheduling priorities of insns.
+ you do not need to adjust the scheduling priorities of insns.
- A STD instruction should be scheduled earlier,
+ A STD instruction should be scheduled earlier,
in order to use the bypass. */
static int
-s390_adjust_priority (insn, priority)
- rtx insn ATTRIBUTE_UNUSED;
- int priority;
+s390_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority)
{
if (! INSN_P (insn))
return priority;
@@ -3854,9 +3719,9 @@ s390_adjust_priority (insn, priority)
/* The number of instructions that can be issued per cycle. */
static int
-s390_issue_rate ()
+s390_issue_rate (void)
{
- if (s390_tune == PROCESSOR_2084_Z990)
+ if (s390_tune == PROCESSOR_2084_Z990)
return 3;
return 1;
}
@@ -3865,7 +3730,7 @@ s390_issue_rate ()
insn scheduler. */
static int
-s390_use_dfa_pipeline_interface ()
+s390_use_dfa_pipeline_interface (void)
{
if (s390_tune == PROCESSOR_2064_Z900
|| s390_tune == PROCESSOR_2084_Z990)
@@ -3875,7 +3740,7 @@ s390_use_dfa_pipeline_interface ()
}
static int
-s390_first_cycle_multipass_dfa_lookahead ()
+s390_first_cycle_multipass_dfa_lookahead (void)
{
return s390_use_dfa_pipeline_interface () ? 4 : 0;
}
@@ -3884,28 +3749,25 @@ s390_first_cycle_multipass_dfa_lookahead ()
Triggers default sort algorithm to better slot instructions. */
static int
-s390_sched_reorder2 (dump, sched_verbose, ready, pn_ready, clock_var)
- FILE *dump ATTRIBUTE_UNUSED;
- int sched_verbose ATTRIBUTE_UNUSED;
- rtx *ready ATTRIBUTE_UNUSED;
- int *pn_ready ATTRIBUTE_UNUSED;
- int clock_var ATTRIBUTE_UNUSED;
+s390_sched_reorder2 (FILE *dump ATTRIBUTE_UNUSED,
+ int sched_verbose ATTRIBUTE_UNUSED,
+ rtx *ready ATTRIBUTE_UNUSED,
+ int *pn_ready ATTRIBUTE_UNUSED,
+ int clock_var ATTRIBUTE_UNUSED)
{
return s390_issue_rate();
}
-/* Split all branches that exceed the maximum distance.
- Returns true if this created a new literal pool entry.
+/* 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. */
-static int
-s390_split_branches (temp_reg, temp_used)
- rtx temp_reg;
- bool *temp_used;
+static int
+s390_split_branches (rtx temp_reg, bool *temp_used)
{
int new_literal = 0;
rtx insn, pat, tmp, target;
@@ -3928,15 +3790,15 @@ s390_split_branches (temp_reg, temp_used)
if (GET_CODE (pat) != SET || SET_DEST (pat) != pc_rtx)
continue;
- if (GET_CODE (SET_SRC (pat)) == LABEL_REF)
+ if (GET_CODE (SET_SRC (pat)) == LABEL_REF)
{
label = &SET_SRC (pat);
- }
- else if (GET_CODE (SET_SRC (pat)) == IF_THEN_ELSE)
+ }
+ else if (GET_CODE (SET_SRC (pat)) == IF_THEN_ELSE)
{
- if (GET_CODE (XEXP (SET_SRC (pat), 1)) == LABEL_REF)
+ if (GET_CODE (XEXP (SET_SRC (pat), 1)) == LABEL_REF)
label = &XEXP (SET_SRC (pat), 1);
- else if (GET_CODE (XEXP (SET_SRC (pat), 2)) == LABEL_REF)
+ else if (GET_CODE (XEXP (SET_SRC (pat), 2)) == LABEL_REF)
label = &XEXP (SET_SRC (pat), 2);
else
continue;
@@ -3944,12 +3806,12 @@ s390_split_branches (temp_reg, temp_used)
else
continue;
- if (get_attr_length (insn) <= (TARGET_64BIT ? 6 : 4))
+ if (get_attr_length (insn) <= (TARGET_CPU_ZARCH ? 6 : 4))
continue;
*temp_used = 1;
- if (TARGET_64BIT)
+ if (TARGET_CPU_ZARCH)
{
tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, *label), insn);
INSN_ADDRESSES_NEW (tmp, -1);
@@ -3968,14 +3830,16 @@ s390_split_branches (temp_reg, temp_used)
else
{
new_literal = 1;
- tmp = gen_rtx_UNSPEC (SImode, gen_rtvec (1, *label), 104);
- tmp = gen_rtx_CONST (SImode, tmp);
- tmp = force_const_mem (SImode, tmp);
- tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, tmp), insn);
+ target = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, *label),
+ UNSPEC_LTREL_OFFSET);
+ target = gen_rtx_CONST (Pmode, target);
+ target = force_const_mem (Pmode, target);
+ tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, target), insn);
INSN_ADDRESSES_NEW (tmp, -1);
- target = gen_rtx_REG (Pmode, BASE_REGISTER);
- target = gen_rtx_PLUS (Pmode, target, temp_reg);
+ target = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, XEXP (target, 0)),
+ UNSPEC_LTREL_BASE);
+ target = gen_rtx_PLUS (Pmode, temp_reg, target);
}
if (!validate_change (insn, label, target, 0))
@@ -3986,22 +3850,29 @@ s390_split_branches (temp_reg, temp_used)
}
-/* Find a literal pool symbol referenced in RTX X, and store
- it at REF. Will abort if X contains references to more than
+/* Find a literal pool symbol referenced in RTX X, and store
+ it at REF. Will abort if X contains references to more than
one such pool symbol; multiple references to the same symbol
- are allowed, however.
+ are allowed, however.
- The rtx pointed to by REF must be initialized to NULL_RTX
+ The rtx pointed to by REF must be initialized to NULL_RTX
by the caller before calling this routine. */
static void
-find_constant_pool_ref (x, ref)
- rtx x;
- rtx *ref;
+find_constant_pool_ref (rtx x, rtx *ref)
{
int i, j;
const char *fmt;
+ /* Ignore LTREL_BASE references. */
+ if (GET_CODE (x) == UNSPEC
+ && XINT (x, 1) == UNSPEC_LTREL_BASE)
+ return;
+ /* Likewise POOL_ENTRY insns. */
+ if (GET_CODE (x) == UNSPEC_VOLATILE
+ && XINT (x, 1) == UNSPECV_POOL_ENTRY)
+ return;
+
if (GET_CODE (x) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (x))
{
@@ -4030,10 +3901,7 @@ find_constant_pool_ref (x, ref)
in X by the address ADDR. Fix up MEMs as required. */
static void
-replace_constant_pool_ref (x, ref, addr)
- rtx *x;
- rtx ref;
- rtx addr;
+replace_constant_pool_ref (rtx *x, rtx ref, rtx addr)
{
int i, j;
const char *fmt;
@@ -4100,135 +3968,55 @@ replace_constant_pool_ref (x, ref, addr)
}
}
-/* Check whether ADDR is an address that uses the base register,
- without actually constituting a literal pool access. (This happens
- in 31-bit PIC mode, where the base register is used as anchor for
- relative addressing of local symbols.)
-
- Returns 1 if the base register occupies the base slot,
- returns 2 if the base register occupies the index slot,
- returns 0 if the address is not of this form. */
-
-static int
-find_base_register_in_addr (addr)
- struct s390_address *addr;
-{
- /* If DISP is complex, we might have a literal pool reference. */
- if (addr->disp && GET_CODE (addr->disp) != CONST_INT)
- return 0;
-
- if (addr->base && REG_P (addr->base) && REGNO (addr->base) == BASE_REGISTER)
- return 1;
-
- if (addr->indx && REG_P (addr->indx) && REGNO (addr->indx) == BASE_REGISTER)
- return 2;
-
- return 0;
-}
-
-/* Return true if X contains an address that uses the base register,
- without actually constituting a literal pool access. */
+/* Check whether X contains an UNSPEC_LTREL_BASE.
+ Return its constant pool symbol if found, NULL_RTX otherwise. */
-static bool
-find_base_register_ref (x)
- rtx x;
+static rtx
+find_ltrel_base (rtx x)
{
- bool retv = FALSE;
- struct s390_address addr;
int i, j;
const char *fmt;
- /* Addresses can only occur inside a MEM ... */
- if (GET_CODE (x) == MEM)
- {
- if (s390_decompose_address (XEXP (x, 0), &addr)
- && find_base_register_in_addr (&addr))
- return TRUE;
- }
-
- /* ... or a load-address type pattern. */
- if (GET_CODE (x) == SET && GET_CODE (SET_DEST (x)) == REG)
- {
- if (s390_decompose_address (SET_SRC (x), &addr)
- && find_base_register_in_addr (&addr))
- return TRUE;
- }
+ if (GET_CODE (x) == UNSPEC
+ && XINT (x, 1) == UNSPEC_LTREL_BASE)
+ return XVECEXP (x, 0, 0);
fmt = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
{
- retv |= find_base_register_ref (XEXP (x, i));
+ rtx fnd = find_ltrel_base (XEXP (x, i));
+ if (fnd)
+ return fnd;
}
else if (fmt[i] == 'E')
{
for (j = 0; j < XVECLEN (x, i); j++)
- retv |= find_base_register_ref (XVECEXP (x, i, j));
+ {
+ rtx fnd = find_ltrel_base (XVECEXP (x, i, j));
+ if (fnd)
+ return fnd;
+ }
}
}
- return retv;
+ return NULL_RTX;
}
-/* If X contains an address that uses the base register,
- without actually constituting a literal pool access,
- replace the base register with REPL in all such cases.
-
- Handles both MEMs and load address patterns. */
+/* Replace any occurrence of UNSPEC_LTREL_BASE in X with BASE. */
static void
-replace_base_register_ref (x, repl)
- rtx *x;
- rtx repl;
+replace_ltrel_base (rtx *x, rtx base)
{
- struct s390_address addr;
- rtx new_addr;
- int i, j, pos;
+ int i, j;
const char *fmt;
- /* Addresses can only occur inside a MEM ... */
- if (GET_CODE (*x) == MEM)
+ if (GET_CODE (*x) == UNSPEC
+ && XINT (*x, 1) == UNSPEC_LTREL_BASE)
{
- if (s390_decompose_address (XEXP (*x, 0), &addr)
- && (pos = find_base_register_in_addr (&addr)))
- {
- if (pos == 1)
- addr.base = repl;
- else
- addr.indx = repl;
-
- new_addr = addr.base;
- if (addr.indx)
- new_addr = gen_rtx_PLUS (Pmode, new_addr, addr.indx);
- if (addr.disp)
- new_addr = gen_rtx_PLUS (Pmode, new_addr, addr.disp);
-
- *x = replace_equiv_address (*x, new_addr);
- return;
- }
- }
-
- /* ... or a load-address type pattern. */
- if (GET_CODE (*x) == SET && GET_CODE (SET_DEST (*x)) == REG)
- {
- if (s390_decompose_address (SET_SRC (*x), &addr)
- && (pos = find_base_register_in_addr (&addr)))
- {
- if (pos == 1)
- addr.base = repl;
- else
- addr.indx = repl;
-
- new_addr = addr.base;
- if (addr.indx)
- new_addr = gen_rtx_PLUS (Pmode, new_addr, addr.indx);
- if (addr.disp)
- new_addr = gen_rtx_PLUS (Pmode, new_addr, addr.disp);
-
- SET_SRC (*x) = new_addr;
- return;
- }
+ *x = base;
+ return;
}
fmt = GET_RTX_FORMAT (GET_CODE (*x));
@@ -4236,37 +4024,30 @@ replace_base_register_ref (x, repl)
{
if (fmt[i] == 'e')
{
- replace_base_register_ref (&XEXP (*x, i), repl);
+ replace_ltrel_base (&XEXP (*x, i), base);
}
else if (fmt[i] == 'E')
{
for (j = 0; j < XVECLEN (*x, i); j++)
- replace_base_register_ref (&XVECEXP (*x, i, j), repl);
+ replace_ltrel_base (&XVECEXP (*x, i, j), base);
}
}
}
-/* We keep a list of constants we which we have to add to internal
+/* We keep a list of constants which we have to add to internal
constant tables in the middle of large functions. */
-#define NR_C_MODES 6
-enum machine_mode constant_modes[NR_C_MODES] =
+#define NR_C_MODES 7
+enum machine_mode constant_modes[NR_C_MODES] =
{
+ TImode,
DFmode, DImode,
SFmode, SImode,
HImode,
QImode
};
-rtx (*gen_consttable[NR_C_MODES])(rtx) =
-{
- gen_consttable_df, gen_consttable_di,
- gen_consttable_sf, gen_consttable_si,
- gen_consttable_hi,
- gen_consttable_qi
-};
-
struct constant
{
struct constant *next;
@@ -4284,45 +4065,36 @@ struct constant_pool
struct constant *constants[NR_C_MODES];
rtx label;
int size;
- bool anchor;
};
-static struct constant_pool * s390_chunkify_start PARAMS ((rtx, bool *));
-static void s390_chunkify_finish PARAMS ((struct constant_pool *, rtx));
-static void s390_chunkify_cancel PARAMS ((struct constant_pool *));
+static struct constant_pool * s390_mainpool_start (void);
+static void s390_mainpool_finish (struct constant_pool *, rtx base_reg);
+static void s390_mainpool_cancel (struct constant_pool *);
+
+static struct constant_pool * s390_chunkify_start (rtx base_reg);
+static void s390_chunkify_finish (struct constant_pool *, rtx base_reg);
+static void s390_chunkify_cancel (struct constant_pool *);
-static struct constant_pool *s390_start_pool PARAMS ((struct constant_pool **, rtx));
-static void s390_end_pool PARAMS ((struct constant_pool *, rtx));
-static void s390_add_pool_insn PARAMS ((struct constant_pool *, rtx));
-static struct constant_pool *s390_find_pool PARAMS ((struct constant_pool *, rtx));
-static void s390_add_constant PARAMS ((struct constant_pool *, rtx, enum machine_mode));
-static rtx s390_find_constant PARAMS ((struct constant_pool *, rtx, enum machine_mode));
-static void s390_add_anchor PARAMS ((struct constant_pool *));
-static rtx s390_dump_pool PARAMS ((struct constant_pool *));
-static void s390_free_pool PARAMS ((struct constant_pool *));
+static struct constant_pool *s390_start_pool (struct constant_pool **, rtx);
+static void s390_end_pool (struct constant_pool *, rtx);
+static void s390_add_pool_insn (struct constant_pool *, rtx);
+static struct constant_pool *s390_find_pool (struct constant_pool *, rtx);
+static void s390_add_constant (struct constant_pool *, rtx, enum machine_mode);
+static rtx s390_find_constant (struct constant_pool *, rtx, enum machine_mode);
+static rtx s390_dump_pool (struct constant_pool *, bool);
+static struct constant_pool *s390_alloc_pool (void);
+static void s390_free_pool (struct constant_pool *);
/* Create new constant pool covering instructions starting at INSN
and chain it to the end of POOL_LIST. */
static struct constant_pool *
-s390_start_pool (pool_list, insn)
- struct constant_pool **pool_list;
- rtx insn;
+s390_start_pool (struct constant_pool **pool_list, rtx insn)
{
struct constant_pool *pool, **prev;
- int i;
-
- pool = (struct constant_pool *) xmalloc (sizeof *pool);
- pool->next = NULL;
- for (i = 0; i < NR_C_MODES; i++)
- pool->constants[i] = NULL;
- pool->label = gen_label_rtx ();
+ pool = s390_alloc_pool ();
pool->first_insn = insn;
- pool->pool_insn = NULL_RTX;
- pool->insns = BITMAP_XMALLOC ();
- pool->size = 0;
- pool->anchor = FALSE;
for (prev = pool_list; *prev; prev = &(*prev)->next)
;
@@ -4335,9 +4107,7 @@ s390_start_pool (pool_list, insn)
placeholder insn representing the pool. */
static void
-s390_end_pool (pool, insn)
- struct constant_pool *pool;
- rtx insn;
+s390_end_pool (struct constant_pool *pool, rtx insn)
{
rtx pool_size = GEN_INT (pool->size + 8 /* alignment slop */);
@@ -4351,9 +4121,7 @@ s390_end_pool (pool, insn)
/* Add INSN to the list of insns covered by POOL. */
static void
-s390_add_pool_insn (pool, insn)
- struct constant_pool *pool;
- rtx insn;
+s390_add_pool_insn (struct constant_pool *pool, rtx insn)
{
bitmap_set_bit (pool->insns, INSN_UID (insn));
}
@@ -4361,9 +4129,7 @@ s390_add_pool_insn (pool, insn)
/* Return pool out of POOL_LIST that covers INSN. */
static struct constant_pool *
-s390_find_pool (pool_list, insn)
- struct constant_pool *pool_list;
- rtx insn;
+s390_find_pool (struct constant_pool *pool_list, rtx insn)
{
struct constant_pool *pool;
@@ -4377,10 +4143,7 @@ s390_find_pool (pool_list, insn)
/* Add constant VAL of mode MODE to the constant pool POOL. */
static void
-s390_add_constant (pool, val, mode)
- struct constant_pool *pool;
- rtx val;
- enum machine_mode mode;
+s390_add_constant (struct constant_pool *pool, rtx val, enum machine_mode mode)
{
struct constant *c;
int i;
@@ -4409,77 +4172,55 @@ s390_add_constant (pool, val, mode)
/* Find constant VAL of mode MODE in the constant pool POOL.
Return an RTX describing the distance from the start of
the pool to the location of the new constant. */
-
+
static rtx
-s390_find_constant (pool, val, mode)
- struct constant_pool *pool;
- rtx val;
- enum machine_mode mode;
+s390_find_constant (struct constant_pool *pool, rtx val,
+ enum machine_mode mode)
{
struct constant *c;
rtx offset;
int i;
-
+
for (i = 0; i < NR_C_MODES; i++)
if (constant_modes[i] == mode)
break;
if (i == NR_C_MODES)
abort ();
-
+
for (c = pool->constants[i]; c != NULL; c = c->next)
if (rtx_equal_p (val, c->value))
break;
-
+
if (c == NULL)
abort ();
-
+
offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label),
gen_rtx_LABEL_REF (Pmode, pool->label));
offset = gen_rtx_CONST (Pmode, offset);
return offset;
}
-/* Set 'anchor' flag in POOL. */
-
-static void
-s390_add_anchor (pool)
- struct constant_pool *pool;
-{
- if (!pool->anchor)
- {
- pool->anchor = TRUE;
- pool->size += 4;
- }
-}
-
-/* Dump out the constants in POOL. */
+/* Dump out the constants in POOL. If REMOTE_LABEL is true,
+ do not emit the pool base label. */
static rtx
-s390_dump_pool (pool)
- struct constant_pool *pool;
+s390_dump_pool (struct constant_pool *pool, bool remote_label)
{
struct constant *c;
rtx insn;
int i;
- /* Pool start insn switches to proper section
+ /* Pool start insn switches to proper section
and guarantees necessary alignment. */
- if (TARGET_64BIT)
+ if (TARGET_CPU_ZARCH)
insn = emit_insn_after (gen_pool_start_64 (), pool->pool_insn);
else
insn = emit_insn_after (gen_pool_start_31 (), pool->pool_insn);
INSN_ADDRESSES_NEW (insn, -1);
- insn = emit_label_after (pool->label, insn);
- INSN_ADDRESSES_NEW (insn, -1);
-
- /* Emit anchor if we need one. */
- if (pool->anchor)
+ if (!remote_label)
{
- rtx anchor = gen_rtx_LABEL_REF (VOIDmode, pool->label);
- anchor = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, anchor), 105);
- anchor = gen_rtx_CONST (VOIDmode, anchor);
- insn = emit_insn_after (gen_consttable_si (anchor), insn);
+ insn = emit_label_after (pool->label, insn);
INSN_ADDRESSES_NEW (insn, -1);
}
@@ -4488,27 +4229,31 @@ s390_dump_pool (pool)
for (i = 0; i < NR_C_MODES; i++)
for (c = pool->constants[i]; c; c = c->next)
{
- /* Convert 104 unspecs to pool-relative references. */
+ /* Convert UNSPEC_LTREL_OFFSET unspecs to pool-relative references. */
rtx value = c->value;
if (GET_CODE (value) == CONST
&& GET_CODE (XEXP (value, 0)) == UNSPEC
- && XINT (XEXP (value, 0), 1) == 104
+ && XINT (XEXP (value, 0), 1) == UNSPEC_LTREL_OFFSET
&& XVECLEN (XEXP (value, 0), 0) == 1)
{
value = gen_rtx_MINUS (Pmode, XVECEXP (XEXP (value, 0), 0, 0),
- gen_rtx_LABEL_REF (VOIDmode, pool->label));
+ gen_rtx_LABEL_REF (VOIDmode, pool->label));
value = gen_rtx_CONST (VOIDmode, value);
}
insn = emit_label_after (c->label, insn);
INSN_ADDRESSES_NEW (insn, -1);
- insn = emit_insn_after (gen_consttable[i] (value), insn);
+
+ value = gen_rtx_UNSPEC_VOLATILE (constant_modes[i],
+ gen_rtvec (1, value),
+ UNSPECV_POOL_ENTRY);
+ insn = emit_insn_after (value, insn);
INSN_ADDRESSES_NEW (insn, -1);
}
- /* Pool end insn switches back to previous section
+ /* Pool end insn switches back to previous section
and guarantees necessary alignment. */
- if (TARGET_64BIT)
+ if (TARGET_CPU_ZARCH)
insn = emit_insn_after (gen_pool_end_64 (), insn);
else
insn = emit_insn_after (gen_pool_end_31 (), insn);
@@ -4523,11 +4268,32 @@ s390_dump_pool (pool)
return insn;
}
+/* Allocate new constant_pool structure. */
+
+static struct constant_pool *
+s390_alloc_pool (void)
+{
+ struct constant_pool *pool;
+ int i;
+
+ pool = (struct constant_pool *) xmalloc (sizeof *pool);
+ pool->next = NULL;
+ for (i = 0; i < NR_C_MODES; i++)
+ pool->constants[i] = NULL;
+
+ pool->label = gen_label_rtx ();
+ pool->first_insn = NULL_RTX;
+ pool->pool_insn = NULL_RTX;
+ pool->insns = BITMAP_XMALLOC ();
+ pool->size = 0;
+
+ return pool;
+}
+
/* Free all memory used by POOL. */
static void
-s390_free_pool (pool)
- struct constant_pool *pool;
+s390_free_pool (struct constant_pool *pool)
{
int i;
@@ -4544,90 +4310,259 @@ s390_free_pool (pool)
BITMAP_XFREE (pool->insns);
free (pool);
-}
+}
-/* Chunkify the literal pool if required.
+/* Collect main literal pool. Return NULL on overflow. */
- 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. */
+static struct constant_pool *
+s390_mainpool_start (void)
+{
+ struct constant_pool *pool;
+ rtx insn;
+
+ pool = s390_alloc_pool ();
+
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ if (GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
+ && XINT (PATTERN (insn), 1) == UNSPECV_MAIN_POOL)
+ {
+ if (pool->pool_insn)
+ abort ();
+ pool->pool_insn = insn;
+ }
+
+ if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
+ {
+ rtx pool_ref = NULL_RTX;
+ find_constant_pool_ref (PATTERN (insn), &pool_ref);
+ if (pool_ref)
+ {
+ rtx constant = get_pool_constant (pool_ref);
+ enum machine_mode mode = get_pool_mode (pool_ref);
+ s390_add_constant (pool, constant, mode);
+ }
+ }
+ }
+
+ if (!pool->pool_insn)
+ abort ();
+
+ if (pool->size >= 4096)
+ {
+ s390_free_pool (pool);
+ pool = NULL;
+ }
+
+ return pool;
+}
+
+/* POOL holds the main literal pool as collected by s390_mainpool_start.
+ Modify the current function to output the pool constants as well as
+ the pool register setup instruction. BASE_REG is the register to
+ be used as pool base register. */
+
+static void
+s390_mainpool_finish (struct constant_pool *pool, rtx base_reg)
+{
+ rtx insn;
+
+ /* If the pool is empty, we're done. */
+ if (pool->size == 0)
+ {
+ remove_insn (pool->pool_insn);
+ s390_free_pool (pool);
+ return;
+ }
+
+ /* We need correct insn addresses. */
+ shorten_branches (get_insns ());
+
+ /* On zSeries, we use a LARL to load the pool register. The pool is
+ located in the .rodata section, so we emit it after the function. */
+ if (TARGET_CPU_ZARCH)
+ {
+ insn = gen_main_base_64 (base_reg, pool->label);
+ insn = emit_insn_after (insn, pool->pool_insn);
+ INSN_ADDRESSES_NEW (insn, -1);
+ remove_insn (pool->pool_insn);
+
+ insn = get_last_insn ();
+ pool->pool_insn = emit_insn_after (gen_pool (const0_rtx), insn);
+ INSN_ADDRESSES_NEW (pool->pool_insn, -1);
+
+ s390_dump_pool (pool, 0);
+ }
+
+ /* On S/390, if the total size of the function's code plus literal pool
+ does not exceed 4096 bytes, we use BASR to set up a function base
+ pointer, and emit the literal pool at the end of the function. */
+ else if (INSN_ADDRESSES (INSN_UID (get_last_insn ()))
+ + pool->size + 8 /* alignment slop */ < 4096)
+ {
+ insn = gen_main_base_31_small (base_reg, pool->label);
+ insn = emit_insn_after (insn, pool->pool_insn);
+ INSN_ADDRESSES_NEW (insn, -1);
+ remove_insn (pool->pool_insn);
+
+ insn = emit_label_after (pool->label, insn);
+ INSN_ADDRESSES_NEW (insn, -1);
+
+ insn = get_last_insn ();
+ pool->pool_insn = emit_insn_after (gen_pool (const0_rtx), insn);
+ INSN_ADDRESSES_NEW (pool->pool_insn, -1);
+
+ s390_dump_pool (pool, 1);
+ }
+
+ /* Otherwise, we emit an inline literal pool and use BASR to branch
+ over it, setting up the pool register at the same time. */
+ else
+ {
+ rtx pool_end = gen_label_rtx ();
+
+ insn = gen_main_base_31_large (base_reg, pool->label, pool_end);
+ insn = emit_insn_after (insn, pool->pool_insn);
+ INSN_ADDRESSES_NEW (insn, -1);
+ remove_insn (pool->pool_insn);
+
+ insn = emit_label_after (pool->label, insn);
+ INSN_ADDRESSES_NEW (insn, -1);
+
+ pool->pool_insn = emit_insn_after (gen_pool (const0_rtx), insn);
+ INSN_ADDRESSES_NEW (pool->pool_insn, -1);
+
+ insn = emit_label_after (pool_end, pool->pool_insn);
+ INSN_ADDRESSES_NEW (insn, -1);
+
+ s390_dump_pool (pool, 1);
+ }
+
+
+ /* Replace all literal pool references. */
+
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ if (INSN_P (insn))
+ replace_ltrel_base (&PATTERN (insn), base_reg);
+
+ if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
+ {
+ rtx addr, pool_ref = NULL_RTX;
+ find_constant_pool_ref (PATTERN (insn), &pool_ref);
+ if (pool_ref)
+ {
+ addr = s390_find_constant (pool, get_pool_constant (pool_ref),
+ get_pool_mode (pool_ref));
+ addr = gen_rtx_PLUS (Pmode, base_reg, addr);
+ replace_constant_pool_ref (&PATTERN (insn), pool_ref, addr);
+ INSN_CODE (insn) = -1;
+ }
+ }
+ }
+
+
+ /* Free the pool. */
+ s390_free_pool (pool);
+}
+
+/* POOL holds the main literal pool as collected by s390_mainpool_start.
+ We have decided we cannot use this pool, so revert all changes
+ to the current function that were done by s390_mainpool_start. */
+static void
+s390_mainpool_cancel (struct constant_pool *pool)
+{
+ /* We didn't actually change the instruction stream, so simply
+ free the pool memory. */
+ s390_free_pool (pool);
+}
+
+
+/* Chunkify the literal pool. BASE_REG is to be used as pool
+ register. */
#define S390_POOL_CHUNK_MIN 0xc00
#define S390_POOL_CHUNK_MAX 0xe00
-static struct constant_pool *
-s390_chunkify_start (temp_reg, temp_used)
- rtx temp_reg;
- bool *temp_used;
+static struct constant_pool *
+s390_chunkify_start (rtx base_reg)
{
- rtx base_reg = gen_rtx_REG (Pmode, BASE_REGISTER);
-
struct constant_pool *curr_pool = NULL, *pool_list = NULL;
int extra_size = 0;
bitmap far_labels;
+ rtx pending_ltrel = NULL_RTX;
rtx insn;
- rtx (*gen_reload_base) PARAMS ((rtx, rtx)) =
- TARGET_64BIT? gen_reload_base_64 : gen_reload_base_31;
-
+ rtx (*gen_reload_base) (rtx, rtx) =
+ TARGET_CPU_ZARCH? gen_reload_base_64 : gen_reload_base_31;
- /* Do we need to chunkify the literal pool? */
-
- if (get_pool_size () < S390_POOL_CHUNK_MAX)
- return NULL;
/* We need correct insn addresses. */
shorten_branches (get_insns ());
- /* Scan all insns and move literals to pool chunks.
- Also, emit anchor reload insns before every insn that uses
- the literal pool base register as anchor pointer. */
+ /* Scan all insns and move literals to pool chunks. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
+ /* Check for pending LTREL_BASE. */
+ if (INSN_P (insn))
+ {
+ rtx ltrel_base = find_ltrel_base (PATTERN (insn));
+ if (ltrel_base)
+ {
+ if (ltrel_base == pending_ltrel)
+ pending_ltrel = NULL_RTX;
+ else
+ abort ();
+ }
+ }
+
if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
{
rtx pool_ref = NULL_RTX;
find_constant_pool_ref (PATTERN (insn), &pool_ref);
if (pool_ref)
{
+ rtx constant = get_pool_constant (pool_ref);
+ enum machine_mode mode = get_pool_mode (pool_ref);
+
if (!curr_pool)
curr_pool = s390_start_pool (&pool_list, insn);
- s390_add_constant (curr_pool, get_pool_constant (pool_ref),
- get_pool_mode (pool_ref));
+ s390_add_constant (curr_pool, constant, mode);
s390_add_pool_insn (curr_pool, insn);
- }
-
- else if (!TARGET_64BIT && flag_pic
- && find_base_register_ref (PATTERN (insn)))
- {
- rtx new = gen_reload_anchor (temp_reg, base_reg);
- new = emit_insn_before (new, insn);
- INSN_ADDRESSES_NEW (new, INSN_ADDRESSES (INSN_UID (insn)));
- extra_size += 8;
- *temp_used = 1;
-
- if (!curr_pool)
- curr_pool = s390_start_pool (&pool_list, new);
- s390_add_anchor (curr_pool);
- s390_add_pool_insn (curr_pool, insn);
+ /* Don't split the pool chunk between a LTREL_OFFSET load
+ and the corresponding LTREL_BASE. */
+ if (GET_CODE (constant) == CONST
+ && GET_CODE (XEXP (constant, 0)) == UNSPEC
+ && XINT (XEXP (constant, 0), 1) == UNSPEC_LTREL_OFFSET)
+ {
+ if (pending_ltrel)
+ abort ();
+ pending_ltrel = pool_ref;
+ }
}
}
if (GET_CODE (insn) == JUMP_INSN || GET_CODE (insn) == CODE_LABEL)
- if (curr_pool)
- s390_add_pool_insn (curr_pool, insn);
+ {
+ if (curr_pool)
+ s390_add_pool_insn (curr_pool, insn);
+ /* An LTREL_BASE must follow within the same basic block. */
+ if (pending_ltrel)
+ abort ();
+ }
- if (!curr_pool
+ if (!curr_pool
|| INSN_ADDRESSES_SIZE () <= (size_t) INSN_UID (insn)
|| INSN_ADDRESSES (INSN_UID (insn)) == -1)
continue;
- if (TARGET_64BIT)
+ if (TARGET_CPU_ZARCH)
{
if (curr_pool->size < S390_POOL_CHUNK_MAX)
continue;
@@ -4638,7 +4573,7 @@ s390_chunkify_start (temp_reg, temp_used)
else
{
int chunk_size = INSN_ADDRESSES (INSN_UID (insn))
- - INSN_ADDRESSES (INSN_UID (curr_pool->first_insn))
+ - INSN_ADDRESSES (INSN_UID (curr_pool->first_insn))
+ extra_size;
/* We will later have to insert base register reload insns.
@@ -4672,13 +4607,12 @@ s390_chunkify_start (temp_reg, temp_used)
if (get_attr_length (insn) == 0)
continue;
- /* Don't separate insns created by s390_split_branches. */
- if (GET_CODE (insn) == INSN
- && GET_CODE (PATTERN (insn)) == SET
- && rtx_equal_p (SET_DEST (PATTERN (insn)), temp_reg))
+ /* Don't separate LTREL_BASE from the corresponding
+ LTREL_OFFSET load. */
+ if (pending_ltrel)
continue;
- label = gen_label_rtx ();
+ label = gen_label_rtx ();
jump = emit_jump_insn_after (gen_jump (label), insn);
barrier = emit_barrier_after (jump);
insn = emit_label_after (label, barrier);
@@ -4698,9 +4632,11 @@ s390_chunkify_start (temp_reg, temp_used)
if (curr_pool)
s390_end_pool (curr_pool, NULL_RTX);
+ if (pending_ltrel)
+ abort ();
- /* Find all labels that are branched into
+ /* Find all labels that are branched into
from an insn belonging to a different chunk. */
far_labels = BITMAP_XMALLOC ();
@@ -4714,11 +4650,11 @@ s390_chunkify_start (temp_reg, temp_used)
Don't do that, however, if it is the label before
a jump table. */
- if (GET_CODE (insn) == CODE_LABEL
+ if (GET_CODE (insn) == CODE_LABEL
&& (LABEL_PRESERVE_P (insn) || LABEL_NAME (insn)))
{
rtx vec_insn = next_real_insn (insn);
- rtx vec_pat = vec_insn && GET_CODE (vec_insn) == JUMP_INSN ?
+ rtx vec_pat = vec_insn && GET_CODE (vec_insn) == JUMP_INSN ?
PATTERN (vec_insn) : NULL_RTX;
if (!vec_pat
|| !(GET_CODE (vec_pat) == ADDR_VEC
@@ -4728,22 +4664,22 @@ s390_chunkify_start (temp_reg, temp_used)
/* If we have a direct jump (conditional or unconditional)
or a casesi jump, check all potential targets. */
- else if (GET_CODE (insn) == JUMP_INSN)
+ else if (GET_CODE (insn) == JUMP_INSN)
{
rtx pat = PATTERN (insn);
if (GET_CODE (pat) == PARALLEL && XVECLEN (pat, 0) > 2)
pat = XVECEXP (pat, 0, 0);
- if (GET_CODE (pat) == SET)
+ if (GET_CODE (pat) == SET)
{
rtx label = JUMP_LABEL (insn);
if (label)
{
- if (s390_find_pool (pool_list, label)
+ if (s390_find_pool (pool_list, label)
!= s390_find_pool (pool_list, insn))
bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label));
}
- }
+ }
else if (GET_CODE (pat) == PARALLEL
&& XVECLEN (pat, 0) == 2
&& GET_CODE (XVECEXP (pat, 0, 0)) == SET
@@ -4753,7 +4689,7 @@ s390_chunkify_start (temp_reg, temp_used)
/* Find the jump table used by this casesi jump. */
rtx vec_label = XEXP (XEXP (XVECEXP (pat, 0, 1), 0), 0);
rtx vec_insn = next_real_insn (vec_label);
- rtx vec_pat = vec_insn && GET_CODE (vec_insn) == JUMP_INSN ?
+ rtx vec_pat = vec_insn && GET_CODE (vec_insn) == JUMP_INSN ?
PATTERN (vec_insn) : NULL_RTX;
if (vec_pat
&& (GET_CODE (vec_pat) == ADDR_VEC
@@ -4765,7 +4701,7 @@ s390_chunkify_start (temp_reg, temp_used)
{
rtx label = XEXP (XVECEXP (vec_pat, diff_p, i), 0);
- if (s390_find_pool (pool_list, label)
+ if (s390_find_pool (pool_list, label)
!= s390_find_pool (pool_list, insn))
bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label));
}
@@ -4786,7 +4722,7 @@ s390_chunkify_start (temp_reg, temp_used)
/* Insert base register reload insns at every far label. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == CODE_LABEL
+ if (GET_CODE (insn) == CODE_LABEL
&& bitmap_bit_p (far_labels, CODE_LABEL_NUMBER (insn)))
{
struct constant_pool *pool = s390_find_pool (pool_list, insn);
@@ -4810,26 +4746,24 @@ s390_chunkify_start (temp_reg, temp_used)
}
/* POOL_LIST is a chunk list as prepared by s390_chunkify_start.
- After we have decided to use this list, finish implementing
- all changes to the current function as required.
+ After we have decided to use this list, finish implementing
+ all changes to the current function as required. BASE_REG is
+ to be used as pool base register. */
- Code generated by this routine is allowed to use
- TEMP_REG as temporary scratch register. */
-
static void
-s390_chunkify_finish (pool_list, temp_reg)
- struct constant_pool *pool_list;
- rtx temp_reg;
+s390_chunkify_finish (struct constant_pool *pool_list, rtx base_reg)
{
- rtx base_reg = gen_rtx_REG (Pmode, BASE_REGISTER);
struct constant_pool *curr_pool = NULL;
rtx insn;
-
-
+
+
/* Replace all literal pool references. */
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
+ if (INSN_P (insn))
+ replace_ltrel_base (&PATTERN (insn), base_reg);
+
curr_pool = s390_find_pool (pool_list, insn);
if (!curr_pool)
continue;
@@ -4846,20 +4780,14 @@ s390_chunkify_finish (pool_list, temp_reg)
replace_constant_pool_ref (&PATTERN (insn), pool_ref, addr);
INSN_CODE (insn) = -1;
}
-
- else if (!TARGET_64BIT && flag_pic
- && find_base_register_ref (PATTERN (insn)))
- {
- replace_base_register_ref (&PATTERN (insn), temp_reg);
- }
}
}
/* Dump out all literal pools. */
-
+
for (curr_pool = pool_list; curr_pool; curr_pool = curr_pool->next)
- s390_dump_pool (curr_pool);
-
+ s390_dump_pool (curr_pool, 0);
+
/* Free pool list. */
while (pool_list)
@@ -4873,10 +4801,9 @@ s390_chunkify_finish (pool_list, temp_reg)
/* POOL_LIST is a chunk list as prepared by s390_chunkify_start.
We have decided we cannot use this list, so revert all changes
to the current function that were done by s390_chunkify_start. */
-
+
static void
-s390_chunkify_cancel (pool_list)
- struct constant_pool *pool_list;
+s390_chunkify_cancel (struct constant_pool *pool_list)
{
struct constant_pool *curr_pool = NULL;
rtx insn;
@@ -4906,7 +4833,7 @@ s390_chunkify_cancel (pool_list)
remove_insn (curr_pool->pool_insn);
}
- /* Remove all base/anchor register reload insns. */
+ /* Remove all base register reload insns. */
for (insn = get_insns (); insn; )
{
@@ -4915,8 +4842,7 @@ s390_chunkify_cancel (pool_list)
if (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) == SET
&& GET_CODE (SET_SRC (PATTERN (insn))) == UNSPEC
- && (XINT (SET_SRC (PATTERN (insn)), 1) == 210
- || XINT (SET_SRC (PATTERN (insn)), 1) == 211))
+ && XINT (SET_SRC (PATTERN (insn)), 1) == UNSPEC_RELOAD_BASE)
remove_insn (insn);
insn = next_insn;
@@ -4933,99 +4859,90 @@ s390_chunkify_cancel (pool_list)
}
-/* Index of constant pool chunk that is currently being processed.
- Set to -1 before function output has started. */
-int s390_pool_count = -1;
-
-/* Number of elements of current constant pool. */
-int s390_nr_constants;
-
-/* Output main constant pool to stdio stream FILE. */
+/* Output to FILE the constant pool entry EXP in mode MODE
+ with alignment ALIGN. */
void
-s390_output_constant_pool (start_label, end_label)
- rtx start_label;
- rtx end_label;
+s390_output_pool_entry (FILE *file, rtx exp, enum machine_mode mode,
+ unsigned int align)
{
- if (TARGET_64BIT)
- {
- readonly_data_section ();
- ASM_OUTPUT_ALIGN (asm_out_file, 3);
- (*targetm.asm_out.internal_label) (asm_out_file, "L",
- CODE_LABEL_NUMBER (start_label));
- }
- else
- {
- (*targetm.asm_out.internal_label) (asm_out_file, "L",
- CODE_LABEL_NUMBER (start_label));
- ASM_OUTPUT_ALIGN (asm_out_file, 2);
- }
+ REAL_VALUE_TYPE r;
- s390_pool_count = 0;
- output_constant_pool (current_function_name, current_function_decl);
- s390_pool_count = -1;
- if (TARGET_64BIT)
- function_section (current_function_decl);
- else
+ switch (GET_MODE_CLASS (mode))
{
- ASM_OUTPUT_ALIGN (asm_out_file, 1);
- (*targetm.asm_out.internal_label) (asm_out_file, "L",
- CODE_LABEL_NUMBER (end_label));
+ case MODE_FLOAT:
+ if (GET_CODE (exp) != CONST_DOUBLE)
+ abort ();
+
+ REAL_VALUE_FROM_CONST_DOUBLE (r, exp);
+ assemble_real (r, mode, align);
+ break;
+
+ case MODE_INT:
+ if (GET_CODE (exp) == CONST
+ || GET_CODE (exp) == SYMBOL_REF
+ || GET_CODE (exp) == LABEL_REF)
+ {
+ fputs (integer_asm_op (GET_MODE_SIZE (mode), TRUE), file);
+ s390_output_symbolic_const (file, exp);
+ fputc ('\n', file);
+ }
+ else
+ {
+ assemble_integer (exp, GET_MODE_SIZE (mode), align, 1);
+ }
+ break;
+
+ default:
+ abort ();
}
}
+
/* Rework the prolog/epilog to avoid saving/restoring
- registers unnecessarily. If TEMP_REGNO is nonnegative,
- it specifies the number of a caller-saved register used
- as temporary scratch register by code emitted during
- machine dependent reorg. */
+ 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. */
static void
-s390_optimize_prolog (temp_regno)
- int temp_regno;
+s390_optimize_prolog (bool base_used, bool temp_used)
{
int save_first, save_last, restore_first, restore_last;
int i, j;
rtx insn, new_insn, next_insn;
/* Recompute regs_ever_live data for special registers. */
- regs_ever_live[BASE_REGISTER] = 0;
- regs_ever_live[RETURN_REGNUM] = 0;
+ regs_ever_live[BASE_REGISTER] = base_used;
+ regs_ever_live[RETURN_REGNUM] = temp_used;
regs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0;
- /* If there is (possibly) any pool entry, we need to
- load the base register.
- ??? FIXME: this should be more precise. */
- if (get_pool_size ())
- regs_ever_live[BASE_REGISTER] = 1;
-
- /* In non-leaf functions, the prolog/epilog code relies
- on RETURN_REGNUM being saved in any case. */
- if (!current_function_is_leaf)
+ /* 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;
- /* We need to save/restore the temporary register. */
- if (temp_regno >= 0)
- regs_ever_live[temp_regno] = 1;
-
/* Find first and last gpr to be saved. */
-
+
for (i = 6; i < 16; i++)
if (regs_ever_live[i])
if (!global_regs[i]
- || i == STACK_POINTER_REGNUM
+ || i == STACK_POINTER_REGNUM
|| i == RETURN_REGNUM
- || i == BASE_REGISTER
+ || i == BASE_REGISTER
|| (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM))
break;
for (j = 15; j > i; j--)
if (regs_ever_live[j])
if (!global_regs[j]
- || j == STACK_POINTER_REGNUM
+ || j == STACK_POINTER_REGNUM
|| j == RETURN_REGNUM
- || j == BASE_REGISTER
+ || j == BASE_REGISTER
|| (flag_pic && j == (int)PIC_OFFSET_TABLE_REGNUM))
break;
@@ -5126,98 +5043,53 @@ s390_optimize_prolog (temp_regno)
}
}
-/* Check whether any insn in the function makes use of the original
- value of RETURN_REG (e.g. for __builtin_return_address).
- If so, insert an insn reloading that value.
-
- Return true if any such insn was found. */
-
-static bool
-s390_fixup_clobbered_return_reg (return_reg)
- rtx return_reg;
-{
- bool replacement_done = 0;
- rtx insn;
-
- /* If we never called __builtin_return_address, register 14
- might have been used as temp during the prolog; we do
- not want to touch those uses. */
- if (!has_hard_reg_initial_val (Pmode, REGNO (return_reg)))
- return false;
-
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- {
- rtx reg, off, new_insn;
-
- if (GET_CODE (insn) != INSN)
- continue;
- if (!reg_referenced_p (return_reg, PATTERN (insn)))
- continue;
- if (GET_CODE (PATTERN (insn)) == PARALLEL
- && store_multiple_operation (PATTERN (insn), VOIDmode))
- continue;
-
- if (frame_pointer_needed)
- reg = hard_frame_pointer_rtx;
- else
- reg = stack_pointer_rtx;
-
- off = GEN_INT (cfun->machine->frame_size + REGNO (return_reg) * UNITS_PER_WORD);
- if (!DISP_IN_RANGE (INTVAL (off)))
- {
- off = force_const_mem (Pmode, off);
- new_insn = gen_rtx_SET (Pmode, return_reg, off);
- new_insn = emit_insn_before (new_insn, insn);
- INSN_ADDRESSES_NEW (new_insn, -1);
- off = return_reg;
- }
-
- new_insn = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, reg, off));
- new_insn = gen_rtx_SET (Pmode, return_reg, new_insn);
- new_insn = emit_insn_before (new_insn, insn);
- INSN_ADDRESSES_NEW (new_insn, -1);
-
- replacement_done = 1;
- }
-
- return replacement_done;
-}
-
/* Perform machine-dependent processing. */
static void
-s390_reorg ()
+s390_reorg (void)
{
- bool fixed_up_clobbered_return_reg = 0;
rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
- bool temp_used = 0;
+ rtx base_reg = gen_rtx_REG (Pmode, BASE_REGISTER);
+ bool temp_used = false;
+ bool base_used = false;
+ bool pool_overflow = false;
/* Make sure all splits have been performed; splits after
machine_dependent_reorg might confuse insn length counts. */
split_all_insns_noflow ();
- /* There are two problematic situations we need to correct:
-
+ /* In small leaf functions, try to use an unused call-clobbered
+ register as base register to avoid save/restore overhead. */
+ if (current_function_is_leaf && !regs_ever_live[5])
+ base_reg = gen_rtx_REG (Pmode, 5);
+
+
+ /* Install the main literal pool and the associated base
+ register load insns.
+
+ In addition, there are two problematic situations we need
+ to correct:
+
- the literal pool might be > 4096 bytes in size, so that
some of its elements cannot be directly accessed
-
+
- a branch target might be > 64K away from the branch, so that
it is not possible to use a PC-relative instruction.
-
+
To fix those, we split the single literal pool into multiple
pool chunks, reloading the pool base register at various
points throughout the function to ensure it always points to
the pool chunk the following code expects, and / or replace
PC-relative branches by absolute branches.
-
+
However, the two problems are interdependent: splitting the
literal pool can move a branch further away from its target,
causing the 64K limit to overflow, and on the other hand,
replacing a PC-relative branch by an absolute branch means
we need to put the branch target address into the literal
pool, possibly causing it to overflow.
-
+
So, we loop trying to fix up both problems until we manage
to satisfy both conditions at the same time. Note that the
loop is guaranteed to terminate as every pass of the loop
@@ -5225,49 +5097,51 @@ s390_reorg ()
in the function. (This is not completely true as there
might be branch-over-pool insns introduced by chunkify_start.
Those never need to be split however.) */
-
+
for (;;)
{
- struct constant_pool *pool_list;
-
- /* Try to chunkify the literal pool. */
- pool_list = s390_chunkify_start (temp_reg, &temp_used);
+ struct constant_pool *pool = NULL;
+
+ /* Collect the literal pool. */
+ if (!pool_overflow)
+ {
+ pool = s390_mainpool_start ();
+ if (!pool)
+ pool_overflow = true;
+ }
+
+ /* If literal pool overflowed, start to chunkify it. */
+ if (pool_overflow)
+ pool = s390_chunkify_start (base_reg);
/* 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))
{
- if (pool_list)
- s390_chunkify_cancel (pool_list);
-
+ if (pool_overflow)
+ s390_chunkify_cancel (pool);
+ else
+ s390_mainpool_cancel (pool);
+
continue;
}
- /* Check whether we have clobbered a use of the return
- register (e.g. for __builtin_return_address). If so,
- add insns reloading the register where necessary. */
- if (temp_used && !fixed_up_clobbered_return_reg
- && s390_fixup_clobbered_return_reg (temp_reg))
- {
- fixed_up_clobbered_return_reg = 1;
+ /* If we made it up to here, both conditions are satisfied.
+ Finish up literal pool related changes. */
+ if ((pool_overflow || pool->size > 0)
+ && REGNO (base_reg) == BASE_REGISTER)
+ base_used = true;
- /* The fixup insns might have caused a jump to overflow. */
- if (pool_list)
- s390_chunkify_cancel (pool_list);
+ if (pool_overflow)
+ s390_chunkify_finish (pool, base_reg);
+ else
+ s390_mainpool_finish (pool, base_reg);
- continue;
- }
-
- /* If we made it up to here, both conditions are satisfied.
- Finish up pool chunkification if required. */
- if (pool_list)
- s390_chunkify_finish (pool_list, temp_reg);
-
break;
}
-
- s390_optimize_prolog (temp_used? RETURN_REGNUM : -1);
+
+ s390_optimize_prolog (base_used, temp_used);
}
@@ -5276,32 +5150,30 @@ s390_reorg ()
frame pointer of that frame. */
rtx
-s390_return_addr_rtx (count, frame)
- int count;
- rtx frame;
+s390_return_addr_rtx (int count, rtx frame)
{
rtx addr;
- /* For the current frame, we use the initial value of RETURN_REGNUM.
- This works both in leaf and non-leaf functions. */
+ /* For the current frame, we need to make sure the initial
+ value of RETURN_REGNUM is actually saved. */
if (count == 0)
- return get_hard_reg_initial_val (Pmode, RETURN_REGNUM);
+ cfun->machine->save_return_addr_p = true;
- /* For frames farther back, we read the stack slot where the
+ /* To retrieve the return address we read the stack slot where the
corresponding RETURN_REGNUM value was saved. */
addr = plus_constant (frame, RETURN_REGNUM * UNITS_PER_WORD);
addr = memory_address (Pmode, addr);
return gen_rtx_MEM (Pmode, addr);
-}
+}
/* Find first call clobbered register unsused in a function.
This could be used as base register in a leaf function
or for holding the return address before epilogue. */
static int
-find_unused_clobbered_reg ()
+find_unused_clobbered_reg (void)
{
int i;
for (i = 0; i < 6; i++)
@@ -5313,7 +5185,7 @@ find_unused_clobbered_reg ()
/* Fill FRAME with info about frame of current function. */
static void
-s390_frame_info ()
+s390_frame_info (void)
{
char gprs_ever_live[16];
int i, j;
@@ -5325,7 +5197,7 @@ s390_frame_info ()
/* fprs 8 - 15 are caller saved for 64 Bit ABI. */
cfun->machine->save_fprs_p = 0;
if (TARGET_64BIT)
- for (i = 24; i < 32; i++)
+ for (i = 24; i < 32; i++)
if (regs_ever_live[i] && !global_regs[i])
{
cfun->machine->save_fprs_p = 1;
@@ -5335,10 +5207,10 @@ s390_frame_info ()
cfun->machine->frame_size = fsize + cfun->machine->save_fprs_p * 64;
/* Does function need to setup frame and save area. */
-
+
if (! current_function_is_leaf
|| cfun->machine->frame_size > 0
- || current_function_calls_alloca
+ || current_function_calls_alloca
|| current_function_stdarg)
cfun->machine->frame_size += STARTING_FRAME_OFFSET;
@@ -5358,7 +5230,7 @@ s390_frame_info ()
gprs_ever_live[BASE_REGISTER] = 1;
gprs_ever_live[RETURN_REGNUM] = 1;
gprs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0;
-
+
for (i = 6; i < 16; i++)
if (gprs_ever_live[i])
break;
@@ -5378,11 +5250,11 @@ s390_frame_info ()
cfun->machine->first_save_gpr = 2;
}
-/* Return offset between argument pointer and frame pointer
+/* Return offset between argument pointer and frame pointer
initially after prologue. */
-int
-s390_arg_frame_offset ()
+int
+s390_arg_frame_offset (void)
{
HOST_WIDE_INT fsize = get_frame_size ();
int save_fprs_p, i;
@@ -5390,7 +5262,7 @@ s390_arg_frame_offset ()
/* fprs 8 - 15 are caller saved for 64 Bit ABI. */
save_fprs_p = 0;
if (TARGET_64BIT)
- for (i = 24; i < 32; i++)
+ for (i = 24; i < 32; i++)
if (regs_ever_live[i] && !global_regs[i])
{
save_fprs_p = 1;
@@ -5400,23 +5272,20 @@ s390_arg_frame_offset ()
fsize = fsize + save_fprs_p * 64;
/* Does function need to setup frame and save area. */
-
+
if (! current_function_is_leaf
|| fsize > 0
- || current_function_calls_alloca
+ || current_function_calls_alloca
|| current_function_stdarg)
fsize += STARTING_FRAME_OFFSET;
return fsize + STACK_POINTER_OFFSET;
}
/* Emit insn to save fpr REGNUM at offset OFFSET relative
- to register BASE. Return generated insn. */
+ to register BASE. Return generated insn. */
static rtx
-save_fpr (base, offset, regnum)
- rtx base;
- int offset;
- int regnum;
+save_fpr (rtx base, int offset, int regnum)
{
rtx addr;
addr = gen_rtx_MEM (DFmode, plus_constant (base, offset));
@@ -5426,13 +5295,10 @@ save_fpr (base, offset, regnum)
}
/* Emit insn to restore fpr REGNUM from offset OFFSET relative
- to register BASE. Return generated insn. */
+ to register BASE. Return generated insn. */
static rtx
-restore_fpr (base, offset, regnum)
- rtx base;
- int offset;
- int regnum;
+restore_fpr (rtx base, int offset, int regnum)
{
rtx addr;
addr = gen_rtx_MEM (DFmode, plus_constant (base, offset));
@@ -5442,15 +5308,11 @@ restore_fpr (base, offset, regnum)
}
/* Generate insn to save registers FIRST to LAST into
- the register save area located at offset OFFSET
+ the register save area located at offset OFFSET
relative to register BASE. */
static rtx
-save_gprs (base, offset, first, last)
- rtx base;
- int offset;
- int first;
- int last;
+save_gprs (rtx base, int offset, int first, int last)
{
rtx addr, insn, note;
int i;
@@ -5481,7 +5343,7 @@ save_gprs (base, offset, first, last)
inside the store-multiple pattern.
However, we must not emit DWARF records for registers 2..5
- if they are stored for use by variable arguments ...
+ if they are stored for use by variable arguments ...
??? Unfortunately, it is not enough to simply not the the
FRAME_RELATED flags for those SETs, because the first SET
@@ -5502,13 +5364,13 @@ save_gprs (base, offset, first, last)
else if (last >= 6)
{
addr = plus_constant (base, offset + 6 * UNITS_PER_WORD);
- note = gen_store_multiple (gen_rtx_MEM (Pmode, addr),
+ note = gen_store_multiple (gen_rtx_MEM (Pmode, addr),
gen_rtx_REG (Pmode, 6),
GEN_INT (last - 6 + 1));
note = PATTERN (note);
REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
note, REG_NOTES (insn));
for (i = 0; i < XVECLEN (note, 0); i++)
@@ -5522,15 +5384,11 @@ save_gprs (base, offset, first, last)
}
/* Generate insn to restore registers FIRST to LAST from
- the register save area located at offset OFFSET
+ the register save area located at offset OFFSET
relative to register BASE. */
static rtx
-restore_gprs (base, offset, first, last)
- rtx base;
- int offset;
- int first;
- int last;
+restore_gprs (rtx base, int offset, int first, int last)
{
rtx addr, insn;
@@ -5555,63 +5413,98 @@ restore_gprs (base, offset, first, last)
return insn;
}
+/* Emit code to load the GOT register. If MAYBE_DEAD is true,
+ annotate generated insns with REG_MAYBE_DEAD notes. */
+
+static GTY(()) rtx got_symbol;
+void
+s390_load_got (int maybe_dead)
+{
+ if (!got_symbol)
+ {
+ got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
+ SYMBOL_REF_FLAGS (got_symbol) = SYMBOL_FLAG_LOCAL;
+ }
+
+ if (TARGET_CPU_ZARCH)
+ {
+ rtx insn = emit_move_insn (pic_offset_table_rtx, got_symbol);
+ if (maybe_dead)
+ REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
+ REG_NOTES (insn));
+ }
+ else
+ {
+ rtx offset, insn;
+
+ offset = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, got_symbol),
+ UNSPEC_LTREL_OFFSET);
+ offset = gen_rtx_CONST (Pmode, offset);
+ offset = force_const_mem (Pmode, offset);
+
+ insn = emit_move_insn (pic_offset_table_rtx, offset);
+ if (maybe_dead)
+ REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
+ REG_NOTES (insn));
+
+ offset = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, XEXP (offset, 0)),
+ UNSPEC_LTREL_BASE);
+ offset = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, offset);
+
+ insn = emit_move_insn (pic_offset_table_rtx, offset);
+ if (maybe_dead)
+ REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
+ REG_NOTES (insn));
+ }
+}
+
/* Expand the prologue into a bunch of separate insns. */
void
-s390_emit_prologue ()
+s390_emit_prologue (void)
{
rtx insn, addr;
rtx temp_reg;
- rtx pool_start_label, pool_end_label;
int i;
/* Compute frame_info. */
s390_frame_info ();
- /* Choose best register to use for temp use within prologue. */
-
+ /* Choose best register to use for temp use within prologue.
+ See below for why TPF must use the register 1. */
+
if (!current_function_is_leaf
- && !has_hard_reg_initial_val (Pmode, RETURN_REGNUM)
- && get_pool_size () < S390_POOL_CHUNK_MAX / 2)
+ && !TARGET_TPF)
temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
else
temp_reg = gen_rtx_REG (Pmode, 1);
/* Save call saved gprs. */
- insn = save_gprs (stack_pointer_rtx, 0,
+ insn = save_gprs (stack_pointer_rtx, 0,
cfun->machine->first_save_gpr, cfun->machine->last_save_gpr);
emit_insn (insn);
- /* Dump constant pool and set constant pool register. */
+ /* Dummy insn to mark literal pool slot. */
+
+ emit_insn (gen_main_pool ());
- pool_start_label = gen_label_rtx();
- pool_end_label = gen_label_rtx();
- cfun->machine->literal_pool_label = pool_start_label;
-
- if (TARGET_64BIT)
- insn = emit_insn (gen_literal_pool_64 (gen_rtx_REG (Pmode, BASE_REGISTER),
- pool_start_label, pool_end_label));
- else
- insn = emit_insn (gen_literal_pool_31 (gen_rtx_REG (Pmode, BASE_REGISTER),
- pool_start_label, pool_end_label));
-
/* Save fprs for variable args. */
if (current_function_stdarg)
{
- /* Save fpr 0 and 2. */
+ /* Save fpr 0 and 2. */
+
+ save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 32, 16);
+ save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 24, 17);
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 32, 16);
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 24, 17);
-
if (TARGET_64BIT)
{
/* Save fpr 4 and 6. */
-
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 16, 18);
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 8, 19);
+
+ save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 16, 18);
+ save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 8, 19);
}
}
@@ -5627,7 +5520,7 @@ s390_emit_prologue ()
}
if (regs_ever_live[19] && !global_regs[19])
{
- insn = save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 8, 19);
+ insn = save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 8, 19);
RTX_FRAME_RELATED_P (insn) = 1;
}
}
@@ -5639,19 +5532,19 @@ s390_emit_prologue ()
rtx frame_off = GEN_INT (-cfun->machine->frame_size);
/* Save incoming stack pointer into temp reg. */
-
+
if (TARGET_BACKCHAIN || cfun->machine->save_fprs_p)
{
insn = emit_insn (gen_move_insn (temp_reg, stack_pointer_rtx));
}
-
+
/* Subtract frame size from stack pointer. */
if (DISP_IN_RANGE (INTVAL (frame_off)))
{
- insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- frame_off));
+ insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ frame_off));
insn = emit_insn (insn);
}
else
@@ -5663,7 +5556,7 @@ s390_emit_prologue ()
}
RTX_FRAME_RELATED_P (insn) = 1;
- REG_NOTES (insn) =
+ REG_NOTES (insn) =
gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
gen_rtx_PLUS (Pmode, stack_pointer_rtx,
@@ -5671,7 +5564,7 @@ s390_emit_prologue ()
REG_NOTES (insn));
/* Set backchain. */
-
+
if (TARGET_BACKCHAIN)
{
addr = gen_rtx_MEM (Pmode, stack_pointer_rtx);
@@ -5691,7 +5584,7 @@ s390_emit_prologue ()
}
/* Save fprs 8 - 15 (64 bit ABI). */
-
+
if (cfun->machine->save_fprs_p)
{
insn = emit_insn (gen_add2_insn (temp_reg, GEN_INT(-64)));
@@ -5699,22 +5592,22 @@ s390_emit_prologue ()
for (i = 24; i < 32; i++)
if (regs_ever_live[i] && !global_regs[i])
{
- rtx addr = plus_constant (stack_pointer_rtx,
+ rtx addr = plus_constant (stack_pointer_rtx,
cfun->machine->frame_size - 64 + (i-24)*8);
insn = save_fpr (temp_reg, (i-24)*8, i);
RTX_FRAME_RELATED_P (insn) = 1;
- REG_NOTES (insn) =
+ REG_NOTES (insn) =
gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode,
+ gen_rtx_SET (VOIDmode,
gen_rtx_MEM (DFmode, addr),
gen_rtx_REG (DFmode, i)),
REG_NOTES (insn));
}
}
-
+
/* Set frame pointer, if needed. */
-
+
if (frame_pointer_needed)
{
insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
@@ -5722,54 +5615,69 @@ s390_emit_prologue ()
}
/* Set up got pointer, if needed. */
-
+
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
+ s390_load_got(true);
+
+ if (TARGET_TPF)
{
- rtx got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
- SYMBOL_REF_FLAGS (got_symbol) = SYMBOL_FLAG_LOCAL;
+ /* Generate a BAS instruction to serve as a function
+ entry intercept to facilitate the use of tracing
+ algorithms located at the branch target.
- if (TARGET_64BIT)
- {
- insn = emit_insn (gen_movdi (pic_offset_table_rtx,
- got_symbol));
+ This must use register 1. */
+ rtx addr;
+ rtx unkn;
+ rtx link;
- /* It can happen that the GOT pointer isn't really needed ... */
- REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
- REG_NOTES (insn));
- }
- else
- {
- got_symbol = gen_rtx_UNSPEC (VOIDmode,
- gen_rtvec (1, got_symbol), 100);
- got_symbol = gen_rtx_CONST (VOIDmode, got_symbol);
- got_symbol = force_const_mem (Pmode, got_symbol);
- insn = emit_move_insn (pic_offset_table_rtx,
- got_symbol);
- REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
- REG_NOTES (insn));
-
- got_symbol = gen_rtx_REG (Pmode, BASE_REGISTER);
- got_symbol = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, got_symbol), 101);
- got_symbol = gen_rtx_PLUS (Pmode, got_symbol, pic_offset_table_rtx);
- insn = emit_move_insn (pic_offset_table_rtx, got_symbol);
- REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
- REG_NOTES (insn));
- }
- }
+ addr = GEN_INT (0xfe0);
+ unkn = CONST0_RTX (SImode);
+ link = gen_rtx_REG (Pmode, 1);
+
+ emit_call_insn (gen_call_exp (gen_rtx_MEM (QImode, addr), unkn, link));
+
+ /* Emit a blockage here so that all code
+ lies between the profiling mechanisms. */
+ emit_insn (gen_blockage ());
+ }
}
/* Expand the epilogue into a bunch of separate insns. */
void
-s390_emit_epilogue ()
+s390_emit_epilogue (void)
{
rtx frame_pointer, return_reg;
int area_bottom, area_top, offset = 0;
rtvec p;
+ if (TARGET_TPF)
+ {
+
+ /* Generate a BAS instruction to serve as a function
+ entry intercept to facilitate the use of tracing
+ algorithms located at the branch target.
+
+ This must use register 1. */
+
+ rtx addr;
+ rtx unkn;
+ rtx link;
+
+ addr = GEN_INT (0xfe6);
+ unkn = CONST0_RTX (SImode);
+ link = gen_rtx_REG (Pmode, 1);
+
+ /* Emit a blockage here so that all code
+ lies between the profiling mechanisms. */
+ emit_insn (gen_blockage ());
+
+ emit_call_insn (gen_call_exp (gen_rtx_MEM (QImode, addr), unkn, link));
+ }
+
/* Check whether to use frame or stack pointer for restore. */
- frame_pointer = frame_pointer_needed ?
+ frame_pointer = frame_pointer_needed ?
hard_frame_pointer_rtx : stack_pointer_rtx;
/* Compute which parts of the save area we need to access. */
@@ -5813,7 +5721,7 @@ s390_emit_epilogue ()
}
}
- /* Check whether we can access the register save area.
+ /* Check whether we can access the register save area.
If not, increment the frame pointer as required. */
if (area_top <= area_bottom)
@@ -5830,12 +5738,12 @@ s390_emit_epilogue ()
{
rtx insn, frame_off;
- offset = area_bottom < 0 ? -area_bottom : 0;
+ offset = area_bottom < 0 ? -area_bottom : 0;
frame_off = GEN_INT (cfun->machine->frame_size - offset);
if (DISP_IN_RANGE (INTVAL (frame_off)))
{
- insn = gen_rtx_SET (VOIDmode, frame_pointer,
+ insn = gen_rtx_SET (VOIDmode, frame_pointer,
gen_rtx_PLUS (Pmode, frame_pointer, frame_off));
insn = emit_insn (insn);
}
@@ -5857,7 +5765,7 @@ s390_emit_epilogue ()
if (cfun->machine->save_fprs_p)
for (i = 24; i < 32; i++)
if (regs_ever_live[i] && !global_regs[i])
- restore_fpr (frame_pointer,
+ restore_fpr (frame_pointer,
offset - 64 + (i-24) * 8, i);
}
else
@@ -5870,7 +5778,7 @@ s390_emit_epilogue ()
/* Return register. */
- return_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
+ return_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
/* Restore call saved gprs. */
@@ -5879,29 +5787,29 @@ s390_emit_epilogue ()
rtx insn, addr;
int i;
- /* Check for global register and save them
+ /* Check for global register and save them
to stack location from where they get restored. */
- for (i = cfun->machine->first_restore_gpr;
+ for (i = cfun->machine->first_restore_gpr;
i <= cfun->machine->last_save_gpr;
i++)
{
- /* These registers are special and need to be
+ /* These registers are special and need to be
restored in any case. */
- if (i == STACK_POINTER_REGNUM
+ if (i == STACK_POINTER_REGNUM
|| i == RETURN_REGNUM
- || i == BASE_REGISTER
+ || i == BASE_REGISTER
|| (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM))
continue;
if (global_regs[i])
{
- addr = plus_constant (frame_pointer,
+ addr = plus_constant (frame_pointer,
offset + i * UNITS_PER_WORD);
addr = gen_rtx_MEM (Pmode, addr);
set_mem_alias_set (addr, s390_sr_alias_set);
emit_move_insn (addr, gen_rtx_REG (Pmode, i));
- }
+ }
}
/* Fetch return address from stack before load multiple,
@@ -5913,9 +5821,9 @@ s390_emit_epilogue ()
if (!return_regnum)
return_regnum = 4;
return_reg = gen_rtx_REG (Pmode, return_regnum);
-
- addr = plus_constant (frame_pointer,
- offset + RETURN_REGNUM * UNITS_PER_WORD);
+
+ addr = plus_constant (frame_pointer,
+ offset + RETURN_REGNUM * UNITS_PER_WORD);
addr = gen_rtx_MEM (Pmode, addr);
set_mem_alias_set (addr, s390_sr_alias_set);
emit_move_insn (return_reg, addr);
@@ -5925,10 +5833,10 @@ s390_emit_epilogue ()
explicit in insn RTX code, we have to add a barrier here
to prevent incorrect scheduling. */
- emit_insn (gen_blockage());
+ emit_insn (gen_blockage());
- insn = restore_gprs (frame_pointer, offset,
- cfun->machine->first_restore_gpr,
+ insn = restore_gprs (frame_pointer, offset,
+ cfun->machine->first_restore_gpr,
cfun->machine->last_save_gpr);
emit_insn (insn);
}
@@ -5936,21 +5844,19 @@ s390_emit_epilogue ()
/* Return to caller. */
p = rtvec_alloc (2);
-
+
RTVEC_ELT (p, 0) = gen_rtx_RETURN (VOIDmode);
RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode, return_reg);
emit_jump_insn (gen_rtx_PARALLEL (VOIDmode, p));
}
-/* Return the size in bytes of a function argument of
+/* Return the size in bytes of a function argument of
type TYPE and/or mode MODE. At least one of TYPE or
MODE must be specified. */
static int
-s390_function_arg_size (mode, type)
- enum machine_mode mode;
- tree type;
+s390_function_arg_size (enum machine_mode mode, tree type)
{
if (type)
return int_size_in_bytes (type);
@@ -5967,9 +5873,7 @@ s390_function_arg_size (mode, type)
is to be passed in a floating-point register, if available. */
static bool
-s390_function_arg_float (mode, type)
- enum machine_mode mode;
- tree type;
+s390_function_arg_float (enum machine_mode mode, tree type)
{
/* Soft-float changes the ABI: no floating-point registers are used. */
if (TARGET_SOFT_FLOAT)
@@ -6012,9 +5916,7 @@ s390_function_arg_float (mode, type)
reference. */
int
-s390_function_arg_pass_by_reference (mode, type)
- enum machine_mode mode;
- tree type;
+s390_function_arg_pass_by_reference (enum machine_mode mode, tree type)
{
int size = s390_function_arg_size (mode, type);
@@ -6028,7 +5930,7 @@ s390_function_arg_pass_by_reference (mode, type)
if (TREE_CODE (type) == COMPLEX_TYPE)
return 1;
}
-
+
return 0;
}
@@ -6039,11 +5941,8 @@ s390_function_arg_pass_by_reference (mode, type)
matching an ellipsis). */
void
-s390_function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named ATTRIBUTE_UNUSED)
{
if (s390_function_arg_pass_by_reference (mode, type))
{
@@ -6071,7 +5970,7 @@ s390_function_arg_advance (cum, mode, type, named)
CUM is a variable of type CUMULATIVE_ARGS which gives info about
the preceding args and about the function being called.
NAMED is nonzero if this argument is a named parameter
- (otherwise it is an extra parameter matching an ellipsis).
+ (otherwise it is an extra parameter matching an ellipsis).
On S/390, we use general purpose registers 2 through 6 to
pass integer, pointer, and certain structure arguments, and
@@ -6080,11 +5979,8 @@ s390_function_arg_advance (cum, mode, type, named)
are pushed to the stack. */
rtx
-s390_function_arg (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
+ int named ATTRIBUTE_UNUSED)
{
if (s390_function_arg_pass_by_reference (mode, type))
return 0;
@@ -6119,12 +6015,12 @@ s390_function_arg (cum, mode, type, named)
long __fpr;
void *__overflow_arg_area;
void *__reg_save_area;
-
+
} va_list[1];
where __gpr and __fpr hold the number of general purpose
or floating point arguments used up to now, respectively,
- __overflow_arg_area points to the stack location of the
+ __overflow_arg_area points to the stack location of the
next argument passed on the stack, and __reg_save_area
always points to the start of the register area in the
call frame of the current function. The function prologue
@@ -6132,18 +6028,18 @@ s390_function_arg (cum, mode, type, named)
area if the function uses variable arguments. */
tree
-s390_build_va_list ()
+s390_build_va_list (void)
{
tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
- record = (*lang_hooks.types.make_type) (RECORD_TYPE);
+ record = lang_hooks.types.make_type (RECORD_TYPE);
type_decl =
build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
- f_gpr = build_decl (FIELD_DECL, get_identifier ("__gpr"),
+ f_gpr = build_decl (FIELD_DECL, get_identifier ("__gpr"),
long_integer_type_node);
- f_fpr = build_decl (FIELD_DECL, get_identifier ("__fpr"),
+ f_fpr = build_decl (FIELD_DECL, get_identifier ("__fpr"),
long_integer_type_node);
f_ovf = build_decl (FIELD_DECL, get_identifier ("__overflow_arg_area"),
ptr_type_node);
@@ -6182,9 +6078,7 @@ s390_build_va_list ()
(relative to the virtual arg pointer). */
void
-s390_va_start (valist, nextarg)
- tree valist;
- rtx nextarg ATTRIBUTE_UNUSED;
+s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT n_gpr, n_fpr;
int off;
@@ -6239,15 +6133,15 @@ s390_va_start (valist, nextarg)
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
-/* Implement va_arg by updating the va_list structure
+/* Implement va_arg by updating the va_list structure
VALIST as required to retrieve an argument of type
- TYPE, and returning that argument.
-
+ TYPE, and returning that argument.
+
Generates code equivalent to:
-
+
if (integral value) {
if (size <= 4 && args.gpr < 5 ||
- size > 4 && args.gpr < 4 )
+ size > 4 && args.gpr < 4 )
ret = args.reg_save_area[args.gpr+8]
else
ret = *args.overflow_arg_area++;
@@ -6264,9 +6158,7 @@ s390_va_start (valist, nextarg)
} */
rtx
-s390_va_arg (valist, type)
- tree valist;
- tree type;
+s390_va_arg (tree valist, tree type)
{
tree f_gpr, f_fpr, f_ovf, f_sav;
tree gpr, fpr, ovf, sav, reg, t, u;
@@ -6333,6 +6225,7 @@ s390_va_arg (valist, type)
reg = gpr;
n_reg = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
sav_ofs = 2 * UNITS_PER_WORD;
+
if (size < UNITS_PER_WORD)
sav_ofs += UNITS_PER_WORD - size;
@@ -6401,10 +6294,10 @@ s390_va_arg (valist, type)
emit_label (lab_over);
- /* If less than max_regs a registers are retrieved out
+ /* If less than max_regs a registers are retrieved out
of register save area, increment. */
- u = build (PREINCREMENT_EXPR, TREE_TYPE (reg), reg,
+ u = build (PREINCREMENT_EXPR, TREE_TYPE (reg), reg,
build_int_2 (n_reg, 0));
TREE_SIDE_EFFECTS (u) = 1;
expand_expr (u, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6442,7 +6335,7 @@ static unsigned int const code_for_builtin_31[S390_BUILTIN_max] = {
};
static void
-s390_init_builtins ()
+s390_init_builtins (void)
{
tree ftype;
@@ -6464,16 +6357,13 @@ s390_init_builtins ()
IGNORE is nonzero if the value is to be ignored. */
static rtx
-s390_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;
+s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int ignore ATTRIBUTE_UNUSED)
{
#define MAX_ARGS 2
- unsigned int const *code_for_builtin =
+ unsigned int const *code_for_builtin =
TARGET_64BIT ? code_for_builtin_64 : code_for_builtin_31;
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
@@ -6556,8 +6446,7 @@ s390_expand_builtin (exp, target, subtarget, mode, ignore)
gpr 0 is used to hold the static chain. */
void
-s390_trampoline_template (file)
- FILE *file;
+s390_trampoline_template (FILE *file)
{
if (TARGET_64BIT)
{
@@ -6584,18 +6473,15 @@ s390_trampoline_template (file)
CXT is an RTX for the static chain value for the function. */
void
-s390_initialize_trampoline (addr, fnaddr, cxt)
- rtx addr;
- rtx fnaddr;
- rtx cxt;
+s390_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt)
{
- emit_move_insn (gen_rtx
+ emit_move_insn (gen_rtx
(MEM, Pmode,
- memory_address (Pmode,
+ memory_address (Pmode,
plus_constant (addr, (TARGET_64BIT ? 20 : 12) ))), cxt);
emit_move_insn (gen_rtx
(MEM, Pmode,
- memory_address (Pmode,
+ memory_address (Pmode,
plus_constant (addr, (TARGET_64BIT ? 28 : 16) ))), fnaddr);
}
@@ -6603,16 +6489,14 @@ s390_initialize_trampoline (addr, fnaddr, cxt)
LOW and HIGH, independent of the host word size. */
rtx
-s390_gen_rtx_const_DI (high, low)
- int high;
- int low;
+s390_gen_rtx_const_DI (int high, int low)
{
#if HOST_BITS_PER_WIDE_INT >= 64
HOST_WIDE_INT val;
val = (HOST_WIDE_INT)high;
val <<= 32;
val |= (HOST_WIDE_INT)low;
-
+
return GEN_INT (val);
#else
#if HOST_BITS_PER_WIDE_INT >= 32
@@ -6621,15 +6505,13 @@ s390_gen_rtx_const_DI (high, low)
abort ();
#endif
#endif
-}
+}
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
void
-s390_function_profiler (file, labelno)
- FILE *file;
- int labelno;
+s390_function_profiler (FILE *file, int labelno)
{
rtx op[7];
@@ -6649,7 +6531,7 @@ s390_function_profiler (file, labelno)
op[4] = gen_rtx_SYMBOL_REF (Pmode, "_mcount");
if (flag_pic)
{
- op[4] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op[4]), 113);
+ op[4] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op[4]), UNSPEC_PLT);
op[4] = gen_rtx_CONST (Pmode, op[4]);
}
@@ -6668,7 +6550,7 @@ s390_function_profiler (file, labelno)
output_asm_insn ("bras\t%2,%l6", op);
output_asm_insn (".long\t%4", op);
output_asm_insn (".long\t%3", op);
- (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[6]));
+ targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("l\t%0,0(%2)", op);
output_asm_insn ("l\t%2,4(%2)", op);
output_asm_insn ("basr\t%0,%0", op);
@@ -6681,10 +6563,10 @@ s390_function_profiler (file, labelno)
output_asm_insn ("st\t%0,%1", op);
output_asm_insn ("bras\t%2,%l6", op);
- (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[5]));
+ targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[5]));
output_asm_insn (".long\t%4-%l5", op);
output_asm_insn (".long\t%3-%l5", op);
- (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[6]));
+ targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("lr\t%0,%2", op);
output_asm_insn ("a\t%0,0(%2)", op);
output_asm_insn ("a\t%2,4(%2)", op);
@@ -6697,12 +6579,11 @@ s390_function_profiler (file, labelno)
constants go in the function section; in 64-bit mode in .rodata. */
static void
-s390_select_rtx_section (mode, x, align)
- enum machine_mode mode ATTRIBUTE_UNUSED;
- rtx x ATTRIBUTE_UNUSED;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+s390_select_rtx_section (enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx x ATTRIBUTE_UNUSED,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
- if (TARGET_64BIT)
+ if (TARGET_CPU_ZARCH)
readonly_data_section ();
else
function_section (current_function_decl);
@@ -6712,33 +6593,27 @@ s390_select_rtx_section (mode, x, align)
into its SYMBOL_REF_FLAGS. */
static void
-s390_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+s390_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
/* If a variable has a forced alignment to < 2 bytes, mark it with
SYMBOL_FLAG_ALIGN1 to prevent it from being used as LARL operand. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (TREE_CODE (decl) == VAR_DECL
&& DECL_USER_ALIGN (decl) && DECL_ALIGN (decl) < 16)
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1;
}
/* Output thunk to FILE that implements a C++ virtual function call (with
- multiple inheritance) to FUNCTION. The thunk adjusts the this pointer
+ multiple inheritance) to FUNCTION. The thunk adjusts the this pointer
by DELTA, and unless VCALL_OFFSET is zero, applies an additional adjustment
stored at VCALL_OFFSET in the vtable whose address is located at offset 0
relative to the resulting this pointer. */
static void
-s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
- FILE *file;
- tree thunk ATTRIBUTE_UNUSED;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset;
- tree function;
+s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
+ tree function)
{
rtx op[10];
int nonlocal = 0;
@@ -6749,12 +6624,12 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
{
nonlocal = 1;
op[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op[0]),
- TARGET_64BIT ? 113 : flag_pic == 2 ? 112 : 110);
+ TARGET_64BIT ? UNSPEC_PLT : UNSPEC_GOT);
op[0] = gen_rtx_CONST (Pmode, op[0]);
}
/* Operand 1 is the 'this' pointer. */
- if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function))))
+ if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
op[1] = gen_rtx_REG (Pmode, 3);
else
op[1] = gen_rtx_REG (Pmode, 2);
@@ -6781,9 +6656,9 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
if (TARGET_64BIT)
{
/* Setup literal pool pointer if required. */
- if ((!DISP_IN_RANGE (delta)
+ if ((!DISP_IN_RANGE (delta)
&& !CONST_OK_FOR_LETTER_P (delta, 'K'))
- || (!DISP_IN_RANGE (vcall_offset)
+ || (!DISP_IN_RANGE (vcall_offset)
&& !CONST_OK_FOR_LETTER_P (vcall_offset, 'K')))
{
op[5] = gen_label_rtx ();
@@ -6828,7 +6703,7 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
output_asm_insn ("ag\t%1,0(%4)", op);
}
}
-
+
/* Jump to target. */
output_asm_insn ("jg\t%0", op);
@@ -6836,19 +6711,19 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
if (op[5])
{
output_asm_insn (".align\t4", op);
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (op[5]));
+ targetm.asm_out.internal_label (file, "L",
+ CODE_LABEL_NUMBER (op[5]));
}
if (op[6])
{
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (op[6]));
+ targetm.asm_out.internal_label (file, "L",
+ CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (op[7]));
+ targetm.asm_out.internal_label (file, "L",
+ CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
@@ -6863,8 +6738,8 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
{
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (op[5]));
+ targetm.asm_out.internal_label (file, "L",
+ CODE_LABEL_NUMBER (op[5]));
}
/* Add DELTA to this pointer. */
@@ -6914,8 +6789,8 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
Re-setup the base pointer (with a different base). */
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (op[5]));
+ targetm.asm_out.internal_label (file, "L",
+ CODE_LABEL_NUMBER (op[5]));
}
/* Jump to target. */
@@ -6953,7 +6828,7 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
SYMBOL_REF_FLAGS (op[0]) = SYMBOL_FLAG_LOCAL;
}
- (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[8]));
+ targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[8]));
if (!flag_pic)
output_asm_insn (".long\t%0", op);
else
@@ -6961,23 +6836,29 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
if (op[6])
{
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (op[6]));
+ targetm.asm_out.internal_label (file, "L",
+ CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
- (*targetm.asm_out.internal_label) (file, "L",
- CODE_LABEL_NUMBER (op[7]));
+ targetm.asm_out.internal_label (file, "L",
+ CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
}
+bool
+s390_valid_pointer_mode (enum machine_mode mode)
+{
+ return (mode == SImode || (TARGET_64BIT && mode == DImode));
+}
+
/* How to allocate a 'struct machine_function'. */
static struct machine_function *
-s390_init_machine_status ()
+s390_init_machine_status (void)
{
return ggc_alloc_cleared (sizeof (struct machine_function));
}
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 15bcc87b8ee..5cd1d46d666 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -26,18 +26,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Override the __fixdfdi etc. routines when building libgcc2.
??? This should be done in a cleaner way ... */
#if defined (IN_LIBGCC2) && !defined (__s390x__)
-#include <s390/fixdfdi.h>
+#include <config/s390/fixdfdi.h>
#endif
-/* Which processor to generate code or schedule for. The cpu attribute
+/* Which processor to generate code or schedule for. The cpu attribute
defines a list that mirrors this list, so changes to s390.md must be
made at the same time. */
enum processor_type
{
- PROCESSOR_9672_G5,
- PROCESSOR_9672_G6,
- PROCESSOR_2064_Z900,
+ PROCESSOR_9672_G5,
+ PROCESSOR_9672_G6,
+ PROCESSOR_2064_Z900,
PROCESSOR_2084_Z990,
PROCESSOR_max
};
@@ -94,6 +94,7 @@ extern int target_flags;
#define MASK_64BIT 0x10
#define MASK_ZARCH 0x20
#define MASK_MVCLE 0x40
+#define MASK_TPF 0x80
#define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT)
#define TARGET_SOFT_FLOAT (!(target_flags & MASK_HARD_FLOAT))
@@ -103,6 +104,7 @@ extern int target_flags;
#define TARGET_64BIT (target_flags & MASK_64BIT)
#define TARGET_ZARCH (target_flags & MASK_ZARCH)
#define TARGET_MVCLE (target_flags & MASK_MVCLE)
+#define TARGET_TPF (target_flags & MASK_TPF)
/* ??? Once this actually works, it could be made a runtime option. */
#define TARGET_IBM_FLOAT 0
@@ -129,6 +131,8 @@ extern int target_flags;
{ "esa", -32, N_("ESA/390 architecture")}, \
{ "mvcle", 64, N_("mvcle use")}, \
{ "no-mvcle", -64, N_("mvc&ex")}, \
+ { "tpf", 128, N_("enable tpf OS code")}, \
+ { "no-tpf", -128, N_("disable tpf OS code")}, \
{ "", TARGET_DEFAULT, 0 } }
#define TARGET_OPTIONS \
@@ -264,7 +268,7 @@ if (INTEGRAL_MODE_P (MODE) && \
/* We have 16 general purpose registers (registers 0-15),
and 16 floating point registers (registers 16-31).
(On non-IEEE machines, we have only 4 fp registers.)
-
+
Amongst the general purpose registers, some are used
for specific purposes:
GPR 11: Hard frame pointer (if needed)
@@ -272,7 +276,7 @@ if (INTEGRAL_MODE_P (MODE) && \
GPR 13: Literal pool base register
GPR 14: Return address register
GPR 15: Stack pointer
-
+
Registers 32-34 are 'fake' hard registers that do not
correspond to actual hardware:
Reg 32: Argument pointer
@@ -376,19 +380,19 @@ do \
/* Fitting values into registers. */
-
+
/* Integer modes <= word size fit into any GPR.
Integer modes > word size fit into successive GPRs, starting with
an even-numbered register.
SImode and DImode fit into FPRs as well.
-
+
Floating point modes <= word size fit into any FPR or GPR.
Floating point modes > word size (i.e. DFmode on 32-bit) fit
into any FPR, or an even-odd GPR pair.
-
+
Complex floating point modes fit either into two FPRs, or into
successive GPRs (again starting with an even number).
-
+
Condition code modes fit only into the CC register. */
#define HARD_REGNO_NREGS(REGNO, MODE) \
@@ -430,19 +434,19 @@ do \
? reg_classes_intersect_p (FP_REGS, CLASS) : 0)
/* Register classes. */
-
+
/* We use the following register classes:
GENERAL_REGS All general purpose registers
ADDR_REGS All general purpose registers except %r0
(These registers can be used in address generation)
FP_REGS All floating point registers
-
+
GENERAL_FP_REGS Union of GENERAL_REGS and FP_REGS
ADDR_FP_REGS Union of ADDR_REGS and FP_REGS
-
+
NO_REGS No registers
ALL_REGS All registers
-
+
Note that the 'fake' frame pointer and argument pointer registers
are included amongst the address registers here. The condition
code register is only included in ALL_REGS. */
@@ -539,7 +543,7 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
/* Stack layout and calling conventions. */
-
+
/* Our stack grows from higher to lower addresses. However, local variables
are accessed by positive offsets, and function arguments are stored at
increasing addresses. */
@@ -569,7 +573,7 @@ extern int current_function_outgoing_args_size;
the argument area. */
#define FIRST_PARM_OFFSET(FNDECL) 0
-/* The return address of the current frame is retrieved
+/* The return address of the current frame is retrieved
from the initial value of register RETURN_REGNUM.
For frames farther back, we use the stack slot where
the corresponding RETURN_REGNUM register was saved. */
@@ -577,7 +581,7 @@ extern int current_function_outgoing_args_size;
#define DYNAMIC_CHAIN_ADDRESS(FRAME) \
((FRAME) != hard_frame_pointer_rtx ? (FRAME) : \
plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET))
-
+
#define RETURN_ADDR_RTX(COUNT, FRAME) \
s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME)))
@@ -586,7 +590,7 @@ extern int current_function_outgoing_args_size;
/* Exception handling. */
-
+
/* Describe calling conventions for DWARF-2 exception handling. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, RETURN_REGNUM)
#define INCOMING_FRAME_SP_OFFSET STACK_POINTER_OFFSET
@@ -596,7 +600,7 @@ extern int current_function_outgoing_args_size;
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM)
#define EH_RETURN_HANDLER_RTX \
gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, \
- TARGET_64BIT? -48 : -40))
+ -STACK_POINTER_OFFSET + UNITS_PER_WORD*RETURN_REGNUM))
/* Select a format to encode pointers in exception handling data. */
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
@@ -612,8 +616,8 @@ extern int current_function_outgoing_args_size;
#define HARD_FRAME_POINTER_REGNUM 11
#define ARG_POINTER_REGNUM 32
-/* The static chain must be call-clobbered, but not used for
- function argument passing. As register 1 is clobbered by
+/* The static chain must be call-clobbered, but not used for
+ function argument passing. As register 1 is clobbered by
the trampoline code, we only have one option. */
#define STATIC_CHAIN_REGNUM 0
@@ -633,7 +637,7 @@ extern int current_function_outgoing_args_size;
{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
- { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
+ { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
#define CAN_ELIMINATE(FROM, TO) (1)
@@ -654,7 +658,7 @@ extern int current_function_outgoing_args_size;
/* Stack arguments. */
-
+
/* We need current_function_outgoing_args to be valid. */
#define ACCUMULATE_OUTGOING_ARGS 1
@@ -663,7 +667,7 @@ extern int current_function_outgoing_args_size;
/* Register arguments. */
-
+
typedef struct s390_arg_structure
{
int gprs; /* gpr so far */
@@ -692,7 +696,7 @@ 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) \
@@ -726,7 +730,7 @@ CUMULATIVE_ARGS;
/* Function entry and exit. */
-
+
/* When returning from a function, the stack pointer does not matter. */
#define EXIT_IGNORE_STACK 1
@@ -763,7 +767,7 @@ CUMULATIVE_ARGS;
/* Library calls. */
-
+
/* We should use memcpy, not bcopy. */
#define TARGET_MEM_FUNCTIONS
@@ -790,7 +794,7 @@ CUMULATIVE_ARGS;
#define REG_OK_FOR_INDEX_NONSTRICT_P(X) \
((GET_MODE (X) == Pmode) && \
((REGNO (X) >= FIRST_PSEUDO_REGISTER) \
- || REGNO_REG_CLASS (REGNO (X)) == ADDR_REGS))
+ || REGNO_REG_CLASS (REGNO (X)) == ADDR_REGS))
#define REG_OK_FOR_BASE_NONSTRICT_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X)
@@ -860,7 +864,7 @@ CUMULATIVE_ARGS;
/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
return the mode to be used for the comparison. */
#define SELECT_CC_MODE(OP, X, Y) s390_select_ccmode ((OP), (X), (Y))
-
+
/* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. Note that we can't use "rtx" here
since it hasn't been defined! */
@@ -933,7 +937,7 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1;
/* Position independent code. */
-extern int flag_pic;
+extern int flag_pic;
#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 12 : INVALID_REGNUM)
@@ -1008,65 +1012,6 @@ do { \
} while (0)
-/* Constant Pool for all symbols operands which are changed with
- force_const_mem during insn generation (expand_insn). */
-
-extern int s390_pool_count;
-extern int s390_nr_constants;
-
-#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, fndecl, size) \
-{ \
- struct pool_constant *pool; \
- \
- if (s390_pool_count == -1) \
- { \
- s390_nr_constants = 0; \
- for (pool = first_pool; pool; pool = pool->next) \
- if (pool->mark) s390_nr_constants++; \
- return; \
- } \
-}
-
-#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, EXP, MODE, ALIGN, LABELNO, WIN) \
-{ \
- fprintf (FILE, ".LC%d:\n", LABELNO); \
- \
- /* Output the value of the constant itself. */ \
- switch (GET_MODE_CLASS (MODE)) \
- { \
- case MODE_FLOAT: \
- if (GET_CODE (EXP) != CONST_DOUBLE) \
- abort (); \
- \
- REAL_VALUE_FROM_CONST_DOUBLE (r, EXP); \
- assemble_real (r, MODE, ALIGN); \
- break; \
- \
- case MODE_INT: \
- case MODE_PARTIAL_INT: \
- if (GET_CODE (EXP) == CONST \
- || GET_CODE (EXP) == SYMBOL_REF \
- || GET_CODE (EXP) == LABEL_REF) \
- { \
- fputs (integer_asm_op (UNITS_PER_WORD, TRUE), FILE); \
- s390_output_symbolic_const (FILE, EXP); \
- fputc ('\n', (FILE)); \
- } \
- else \
- { \
- assemble_integer (EXP, GET_MODE_SIZE (MODE), ALIGN, 1); \
- if (GET_MODE_SIZE (MODE) == 1) \
- ASM_OUTPUT_SKIP ((FILE), (unsigned HOST_WIDE_INT)1); \
- } \
- break; \
- \
- default: \
- abort (); \
- } \
- goto WIN; \
-}
-
-
/* Miscellaneous parameters. */
/* Define the codes that are matched by predicates in aux-output.c. */
@@ -1086,14 +1031,6 @@ extern int s390_nr_constants;
tablejump instruction. */
#define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode)
-/* Load from integral MODE < SI from memory into register makes sign_extend
- or zero_extend
- In our case sign_extension happens for Halfwords, other no extension. */
-#define LOAD_EXTEND_OP(MODE) \
-(TARGET_64BIT ? ((MODE) == QImode ? ZERO_EXTEND : \
- (MODE) == HImode ? SIGN_EXTEND : NIL) \
- : ((MODE) == HImode ? SIGN_EXTEND : NIL))
-
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
@@ -1103,6 +1040,9 @@ extern int s390_nr_constants;
between pointers and any other objects of this machine mode. */
#define Pmode ((enum machine_mode) (TARGET_64BIT ? DImode : SImode))
+/* This is -1 for "pointer mode" extend. See ptr_extend in s390.md. */
+#define POINTERS_EXTEND_UNSIGNED -1
+
/* A function address in a call instruction is a byte address (for
indexing purposes) so give the MEM rtx a byte's mode. */
#define FUNCTION_MODE QImode
@@ -1110,4 +1050,4 @@ extern int s390_nr_constants;
/* This macro definition sets up a default value for `main' to return. */
#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
-#endif
+#endif
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 703f0d7a484..b2eff87c640 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -50,7 +50,24 @@
;;
(define_constants
- [; TLS relocation specifiers
+ [; Miscellaneous
+ (UNSPEC_ROUND 1)
+ (UNSPEC_SETHIGH 10)
+
+ ; GOT/PLT and lt-relative accesses
+ (UNSPEC_LTREL_OFFSET 100)
+ (UNSPEC_LTREL_BASE 101)
+ (UNSPEC_GOTENT 110)
+ (UNSPEC_GOT 111)
+ (UNSPEC_GOTOFF 112)
+ (UNSPEC_PLT 113)
+ (UNSPEC_PLTOFF 114)
+
+ ; Literal pool
+ (UNSPEC_RELOAD_BASE 210)
+ (UNSPEC_MAIN_BASE 211)
+
+ ; TLS relocation specifiers
(UNSPEC_TLSGD 500)
(UNSPEC_TLSLDM 501)
(UNSPEC_NTPOFF 502)
@@ -69,7 +86,17 @@
;;
(define_constants
- [; TLS support
+ [; Blockage
+ (UNSPECV_BLOCKAGE 0)
+
+ ; Literal pool
+ (UNSPECV_POOL 200)
+ (UNSPECV_POOL_START 201)
+ (UNSPECV_POOL_END 202)
+ (UNSPECV_POOL_ENTRY 203)
+ (UNSPECV_MAIN_POOL 300)
+
+ ; TLS support
(UNSPECV_SET_TP 500)
])
@@ -90,7 +117,7 @@
fmuld,fmuls,fdivd,fdivs,
ftoi,itof,fsqrtd,fsqrts,
other,o2,o3"
- (const_string "integer"))
+ (const_string "integer"))
;; Operand type. Used to default length attribute values
@@ -122,7 +149,7 @@
(eq_attr "op_type" "SIY") (const_string "agen")]
(const_string "reg")))
-;; Generic pipeline function unit.
+;; Generic pipeline function unit.
(define_function_unit "integer" 1 0
(eq_attr "type" "none") 0 0)
@@ -261,11 +288,11 @@
; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
-
+
; CCZ -> CCL / CCZ1
; CCZ1 -> CCA/CCU/CCS/CCT
; CCS -> CCA
-
+
; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
@@ -279,48 +306,44 @@
(compare:CC (match_operand:DI 0 "register_operand" "")
(match_operand:DI 1 "general_operand" "")))]
"TARGET_64BIT"
- "
{
s390_compare_op0 = operands[0];
s390_compare_op1 = operands[1];
DONE;
-}")
+})
(define_expand "cmpsi"
[(set (reg:CC 33)
(compare:CC (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "general_operand" "")))]
""
- "
{
s390_compare_op0 = operands[0];
s390_compare_op1 = operands[1];
DONE;
-}")
+})
(define_expand "cmpdf"
[(set (reg:CC 33)
(compare:CC (match_operand:DF 0 "register_operand" "")
(match_operand:DF 1 "general_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
s390_compare_op0 = operands[0];
s390_compare_op1 = operands[1];
DONE;
-}")
+})
(define_expand "cmpsf"
[(set (reg:CC 33)
(compare:CC (match_operand:SF 0 "register_operand" "")
(match_operand:SF 1 "general_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
s390_compare_op0 = operands[0];
s390_compare_op1 = operands[1];
DONE;
-}")
+})
; Test-under-Mask (zero_extract) instructions
@@ -332,11 +355,10 @@
(match_operand:DI 2 "const_int_operand" "n"))
(const_int 0)))]
"s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
- && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
+ && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
&& INTVAL (operands[1]) + INTVAL (operands[2]) <= 64
&& (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
== INTVAL (operands[2]) >> 4"
- "*
{
int part = INTVAL (operands[2]) >> 4;
int block = (1 << INTVAL (operands[1])) - 1;
@@ -346,13 +368,13 @@
switch (part)
{
- case 0: return \"tmhh\\t%0,%x2\";
- case 1: return \"tmhl\\t%0,%x2\";
- case 2: return \"tmlh\\t%0,%x2\";
- case 3: return \"tmll\\t%0,%x2\";
+ case 0: return "tmhh\t%0,%x2";
+ case 1: return "tmhl\t%0,%x2";
+ case 2: return "tmlh\t%0,%x2";
+ case 3: return "tmll\t%0,%x2";
default: abort ();
}
-}"
+}
[(set_attr "op_type" "RI")])
(define_insn "*tmsi_ext"
@@ -362,11 +384,10 @@
(match_operand:SI 2 "const_int_operand" "n"))
(const_int 0)))]
"s390_match_ccmode(insn, CCTmode)
- && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
+ && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
&& INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
&& (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
== INTVAL (operands[2]) >> 4"
- "*
{
int part = INTVAL (operands[2]) >> 4;
int block = (1 << INTVAL (operands[1])) - 1;
@@ -376,11 +397,11 @@
switch (part)
{
- case 0: return \"tmh\\t%0,%x2\";
- case 1: return \"tml\\t%0,%x2\";
+ case 0: return "tmh\t%0,%x2";
+ case 1: return "tml\t%0,%x2";
default: abort ();
}
-}"
+}
[(set_attr "op_type" "RI")])
(define_insn "*tmqi_ext"
@@ -390,16 +411,15 @@
(match_operand:SI 2 "const_int_operand" "n,n"))
(const_int 0)))]
"s390_match_ccmode(insn, CCTmode)
- && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
+ && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
&& INTVAL (operands[1]) + INTVAL (operands[2]) <= 8"
- "*
{
int block = (1 << INTVAL (operands[1])) - 1;
int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]);
operands[2] = GEN_INT (block << shift);
- return which_alternative == 0 ? \"tm\\t%0,%b2\" : \"tmy\\t%0,%b2\";
-}"
+ return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2";
+}
[(set_attr "op_type" "SI,SIY")])
; Test-under-Mask instructions
@@ -409,18 +429,16 @@
(compare (and:DI (match_operand:DI 0 "memory_operand" "Q,S")
(match_operand:DI 1 "immediate_operand" "n,n"))
(match_operand:DI 2 "immediate_operand" "n,n")))]
- "TARGET_64BIT
- && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
+ "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
&& s390_single_qi (operands[1], DImode, 0) >= 0"
- "*
{
int part = s390_single_qi (operands[1], DImode, 0);
operands[1] = GEN_INT (s390_extract_qi (operands[1], DImode, part));
- operands[0] = gen_rtx_MEM (QImode,
+ operands[0] = gen_rtx_MEM (QImode,
plus_constant (XEXP (operands[0], 0), part));
- return which_alternative == 0 ? \"tm\\t%0,%b1\" : \"tmy\\t%0,%b1\";
-}"
+ return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
+}
[(set_attr "op_type" "SI,SIY")])
(define_insn "*tmsi_mem"
@@ -430,15 +448,14 @@
(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"
- "*
{
int part = s390_single_qi (operands[1], SImode, 0);
operands[1] = GEN_INT (s390_extract_qi (operands[1], SImode, part));
- operands[0] = gen_rtx_MEM (QImode,
+ operands[0] = gen_rtx_MEM (QImode,
plus_constant (XEXP (operands[0], 0), part));
- return which_alternative == 0 ? \"tm\\t%0,%b1\" : \"tmy\\t%0,%b1\";
-}"
+ return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
+}
[(set_attr "op_type" "SI")])
(define_insn "*tmhi_mem"
@@ -448,15 +465,14 @@
(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"
- "*
{
int part = s390_single_qi (operands[1], HImode, 0);
operands[1] = GEN_INT (s390_extract_qi (operands[1], HImode, part));
- operands[0] = gen_rtx_MEM (QImode,
+ operands[0] = gen_rtx_MEM (QImode,
plus_constant (XEXP (operands[0], 0), part));
- return which_alternative == 0 ? \"tm\\t%0,%b1\" : \"tmy\\t%0,%b1\";
-}"
+ return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
+}
[(set_attr "op_type" "SI")])
(define_insn "*tmqi_mem"
@@ -466,8 +482,8 @@
(match_operand:SI 2 "immediate_operand" "n,n")))]
"s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))"
"@
- tm\\t%0,%b1
- tmy\\t%0,%b1"
+ tm\t%0,%b1
+ tmy\t%0,%b1"
[(set_attr "op_type" "SI,SIY")])
(define_insn "*tmdi_reg"
@@ -478,20 +494,19 @@
"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\";
+ 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 ();
}
-}"
+}
[(set_attr "op_type" "RI")])
(define_insn "*tmsi_reg"
@@ -501,18 +516,17 @@
(match_operand:SI 2 "immediate_operand" "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\";
+ case 0: return "tmh\t%0,%x1";
+ case 1: return "tml\t%0,%x1";
default: abort ();
}
-}"
+}
[(set_attr "op_type" "RI")])
(define_insn "*tmhi_full"
@@ -520,7 +534,7 @@
(compare (match_operand:HI 0 "register_operand" "d")
(match_operand:HI 1 "immediate_operand" "n")))]
"s390_match_ccmode (insn, s390_tm_ccmode (GEN_INT (-1), operands[1], 1))"
- "tml\\t%0,65535"
+ "tml\t%0,65535"
[(set_attr "op_type" "RX")])
(define_insn "*tmqi_full"
@@ -528,7 +542,7 @@
(compare (match_operand:QI 0 "register_operand" "d")
(match_operand:QI 1 "immediate_operand" "n")))]
"s390_match_ccmode (insn, s390_tm_ccmode (GEN_INT (-1), operands[1], 1))"
- "tml\\t%0,255"
+ "tml\t%0,255"
[(set_attr "op_type" "RI")])
@@ -542,7 +556,7 @@
(set (match_operand:DI 2 "register_operand" "=d")
(sign_extend:DI (match_dup 0)))]
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
- "ltgfr\\t%2,%0"
+ "ltgfr\t%2,%0"
[(set_attr "op_type" "RRE")])
(define_insn "*tstdi"
@@ -552,7 +566,7 @@
(set (match_operand:DI 2 "register_operand" "=d")
(match_dup 0))]
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
- "ltgr\\t%2,%0"
+ "ltgr\t%2,%0"
[(set_attr "op_type" "RRE")])
(define_insn "*tstdi_cconly"
@@ -560,7 +574,7 @@
(compare (match_operand:DI 0 "register_operand" "d")
(match_operand:DI 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
- "ltgr\\t%0,%0"
+ "ltgr\t%0,%0"
[(set_attr "op_type" "RRE")])
(define_insn "*tstdi_cconly_31"
@@ -568,7 +582,7 @@
(compare (match_operand:DI 0 "register_operand" "d")
(match_operand:DI 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
- "srda\\t%0,0"
+ "srda\t%0,0"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -581,9 +595,9 @@
(match_dup 0))]
"s390_match_ccmode(insn, CCSmode)"
"@
- ltr\\t%2,%0
- icm\\t%2,15,%0
- icmy\\t%2,15,%0"
+ ltr\t%2,%0
+ icm\t%2,15,%0
+ icmy\t%2,15,%0"
[(set_attr "op_type" "RR,RS,RSY")])
(define_insn "*tstsi_cconly"
@@ -593,9 +607,9 @@
(clobber (match_scratch:SI 2 "=X,d,d"))]
"s390_match_ccmode(insn, CCSmode)"
"@
- ltr\\t%0,%0
- icm\\t%2,15,%0
- icmy\\t%2,15,%0"
+ ltr\t%0,%0
+ icm\t%2,15,%0
+ icmy\t%2,15,%0"
[(set_attr "op_type" "RR,RS,RSY")])
(define_insn "*tstsi_cconly2"
@@ -603,7 +617,7 @@
(compare (match_operand:SI 0 "register_operand" "d")
(match_operand:SI 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode)"
- "ltr\\t%0,%0"
+ "ltr\t%0,%0"
[(set_attr "op_type" "RR")])
(define_insn "*tsthiCCT"
@@ -614,9 +628,9 @@
(match_dup 0))]
"s390_match_ccmode(insn, CCTmode)"
"@
- icm\\t%2,3,%0
- icmy\\t%2,3,%0
- tml\\t%0,65535"
+ icm\t%2,3,%0
+ icmy\t%2,3,%0
+ tml\t%0,65535"
[(set_attr "op_type" "RS,RSY,RI")])
(define_insn "*tsthiCCT_cconly"
@@ -626,9 +640,9 @@
(clobber (match_scratch:HI 2 "=d,d,X"))]
"s390_match_ccmode(insn, CCTmode)"
"@
- icm\\t%2,3,%0
- icmy\\t%2,3,%0
- tml\\t%0,65535"
+ icm\t%2,3,%0
+ icmy\t%2,3,%0
+ tml\t%0,65535"
[(set_attr "op_type" "RS,RSY,RI")])
(define_insn "*tsthi"
@@ -639,8 +653,8 @@
(match_dup 0))]
"s390_match_ccmode(insn, CCSmode)"
"@
- icm\\t%2,3,%0
- icmy\\t%2,3,%0"
+ icm\t%2,3,%0
+ icmy\t%2,3,%0"
[(set_attr "op_type" "RS,RSY")])
(define_insn "*tsthi_cconly"
@@ -650,8 +664,8 @@
(clobber (match_scratch:HI 2 "=d,d"))]
"s390_match_ccmode(insn, CCSmode)"
"@
- icm\\t%2,3,%0
- icmy\\t%2,3,%0"
+ icm\t%2,3,%0
+ icmy\t%2,3,%0"
[(set_attr "op_type" "RS,RSY")])
(define_insn "*tstqiCCT"
@@ -662,9 +676,9 @@
(match_dup 0))]
"s390_match_ccmode(insn, CCTmode)"
"@
- icm\\t%2,1,%0
- icmy\\t%2,1,%0
- tml\\t%0,255"
+ icm\t%2,1,%0
+ icmy\t%2,1,%0
+ tml\t%0,255"
[(set_attr "op_type" "RS,RSY,RI")])
(define_insn "*tstqiCCT_cconly"
@@ -673,9 +687,9 @@
(match_operand:QI 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCTmode)"
"@
- cli\\t%0,0
- cliy\\t%0,0
- tml\\t%0,255"
+ cli\t%0,0
+ cliy\t%0,0
+ tml\t%0,255"
[(set_attr "op_type" "SI,SIY,RI")])
(define_insn "*tstqi"
@@ -686,8 +700,8 @@
(match_dup 0))]
"s390_match_ccmode(insn, CCSmode)"
"@
- icm\\t%2,1,%0
- icmy\\t%2,1,%0"
+ icm\t%2,1,%0
+ icmy\t%2,1,%0"
[(set_attr "op_type" "RS,RSY")])
(define_insn "*tstqi_cconly"
@@ -697,8 +711,8 @@
(clobber (match_scratch:QI 2 "=d,d"))]
"s390_match_ccmode(insn, CCSmode)"
"@
- icm\\t%2,1,%0
- icmy\\t%2,1,%0"
+ icm\t%2,1,%0
+ icmy\t%2,1,%0"
[(set_attr "op_type" "RS,RSY")])
@@ -710,8 +724,8 @@
(match_operand:DI 0 "register_operand" "d,d")))]
"s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT"
"@
- cgfr\\t%0,%1
- cgf\\t%0,%1"
+ cgfr\t%0,%1
+ cgf\t%0,%1"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*cmpdi_ccs"
@@ -720,19 +734,19 @@
(match_operand:DI 1 "general_operand" "d,K,m")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
"@
- cgr\\t%0,%1
- cghi\\t%0,%c1
- cg\\t%0,%1"
+ cgr\t%0,%1
+ cghi\t%0,%c1
+ cg\t%0,%1"
[(set_attr "op_type" "RRE,RI,RXY")])
-
+
(define_insn "*cmpsi_ccs_sign"
[(set (reg 33)
(compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T"))
(match_operand:SI 0 "register_operand" "d,d")))]
"s390_match_ccmode(insn, CCSRmode)"
"@
- ch\\t%0,%1
- chy\\t%0,%1"
+ ch\t%0,%1
+ chy\t%0,%1"
[(set_attr "op_type" "RX,RXY")])
(define_insn "*cmpsi_ccs"
@@ -741,12 +755,12 @@
(match_operand:SI 1 "general_operand" "d,K,R,T")))]
"s390_match_ccmode(insn, CCSmode)"
"@
- cr\\t%0,%1
- chi\\t%0,%c1
- c\\t%0,%1
- cy\\t%0,%1"
+ cr\t%0,%1
+ chi\t%0,%c1
+ c\t%0,%1
+ cy\t%0,%1"
[(set_attr "op_type" "RR,RI,RX,RXY")])
-
+
; Compare (unsigned) instructions
@@ -756,8 +770,8 @@
(match_operand:DI 0 "register_operand" "d,d")))]
"s390_match_ccmode(insn, CCURmode) && TARGET_64BIT"
"@
- clgfr\\t%0,%1
- clgf\\t%0,%1"
+ clgfr\t%0,%1
+ clgf\t%0,%1"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*cmpdi_ccu"
@@ -766,8 +780,8 @@
(match_operand:DI 1 "general_operand" "d,m")))]
"s390_match_ccmode(insn, CCUmode) && TARGET_64BIT"
"@
- clgr\\t%0,%1
- clg\\t%0,%1"
+ clgr\t%0,%1
+ clg\t%0,%1"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*cmpsi_ccu"
@@ -776,9 +790,9 @@
(match_operand:SI 1 "general_operand" "d,R,T")))]
"s390_match_ccmode(insn, CCUmode)"
"@
- clr\\t%0,%1
- cl\\t%0,%1
- cly\\t%0,%1"
+ clr\t%0,%1
+ cl\t%0,%1
+ cly\t%0,%1"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*cmphi_ccu"
@@ -787,8 +801,8 @@
(match_operand:HI 1 "s_imm_operand" "Q,S")))]
"s390_match_ccmode(insn, CCUmode)"
"@
- clm\\t%0,3,%1
- clmy\\t%0,3,%1"
+ clm\t%0,3,%1
+ clmy\t%0,3,%1"
[(set_attr "op_type" "RS,RSY")])
(define_insn "*cmpqi_ccu"
@@ -797,8 +811,8 @@
(match_operand:QI 1 "s_imm_operand" "Q,S")))]
"s390_match_ccmode(insn, CCUmode)"
"@
- clm\\t%0,1,%1
- clmy\\t%0,1,%1"
+ clm\t%0,1,%1
+ clmy\t%0,1,%1"
[(set_attr "op_type" "RS,RSY")])
(define_insn "*cli"
@@ -807,8 +821,8 @@
(match_operand:QI 1 "immediate_operand" "n,n")))]
"s390_match_ccmode (insn, CCUmode)"
"@
- cli\\t%0,%b1
- cliy\\t%0,%b1"
+ cli\t%0,%b1
+ cliy\t%0,%b1"
[(set_attr "op_type" "SI,SIY")])
(define_insn "*cmpdi_ccu_mem"
@@ -816,7 +830,7 @@
(compare (match_operand:DI 0 "s_operand" "Q")
(match_operand:DI 1 "s_imm_operand" "Q")))]
"s390_match_ccmode(insn, CCUmode)"
- "clc\\t%O0(8,%R0),%1"
+ "clc\t%O0(8,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*cmpsi_ccu_mem"
@@ -824,7 +838,7 @@
(compare (match_operand:SI 0 "s_operand" "Q")
(match_operand:SI 1 "s_imm_operand" "Q")))]
"s390_match_ccmode(insn, CCUmode)"
- "clc\\t%O0(4,%R0),%1"
+ "clc\t%O0(4,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*cmphi_ccu_mem"
@@ -832,7 +846,7 @@
(compare (match_operand:HI 0 "s_operand" "Q")
(match_operand:HI 1 "s_imm_operand" "Q")))]
"s390_match_ccmode(insn, CCUmode)"
- "clc\\t%O0(2,%R0),%1"
+ "clc\t%O0(2,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*cmpqi_ccu_mem"
@@ -840,7 +854,7 @@
(compare (match_operand:QI 0 "s_operand" "Q")
(match_operand:QI 1 "s_imm_operand" "Q")))]
"s390_match_ccmode(insn, CCUmode)"
- "clc\\t%O0(1,%R0),%1"
+ "clc\t%O0(1,%R0),%1"
[(set_attr "op_type" "SS")])
@@ -851,7 +865,7 @@
(compare (match_operand:DF 0 "register_operand" "f")
(match_operand:DF 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "ltdbr\\t%0,%0"
+ "ltdbr\t%0,%0"
[(set_attr "op_type" "RRE")
(set_attr "type" "fsimpd")])
@@ -860,7 +874,7 @@
(compare (match_operand:DF 0 "register_operand" "f")
(match_operand:DF 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "ltdr\\t%0,%0"
+ "ltdr\t%0,%0"
[(set_attr "op_type" "RR")
(set_attr "type" "fsimpd")])
@@ -870,8 +884,8 @@
(match_operand:DF 1 "general_operand" "f,R")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- cdbr\\t%0,%1
- cdb\\t%0,%1"
+ cdbr\t%0,%1
+ cdb\t%0,%1"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fsimpd")])
@@ -881,8 +895,8 @@
(match_operand:DF 1 "general_operand" "f,R")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- cdr\\t%0,%1
- cd\\t%0,%1"
+ cdr\t%0,%1
+ cd\t%0,%1"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fsimpd")])
@@ -894,7 +908,7 @@
(compare (match_operand:SF 0 "register_operand" "f")
(match_operand:SF 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "ltebr\\t%0,%0"
+ "ltebr\t%0,%0"
[(set_attr "op_type" "RRE")
(set_attr "type" "fsimps")])
@@ -903,7 +917,7 @@
(compare (match_operand:SF 0 "register_operand" "f")
(match_operand:SF 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "lter\\t%0,%0"
+ "lter\t%0,%0"
[(set_attr "op_type" "RR")
(set_attr "type" "fsimps")])
@@ -913,8 +927,8 @@
(match_operand:SF 1 "general_operand" "f,R")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- cebr\\t%0,%1
- ceb\\t%0,%1"
+ cebr\t%0,%1
+ ceb\t%0,%1"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fsimps")])
@@ -924,8 +938,8 @@
(match_operand:SF 1 "general_operand" "f,R")))]
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- cer\\t%0,%1
- ce\\t%0,%1"
+ cer\t%0,%1
+ ce\t%0,%1"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fsimps")])
@@ -943,11 +957,11 @@
(match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))]
"TARGET_64BIT"
"@
- lmg\\t%0,%N0,%1
- stmg\\t%1,%N1,%0
+ lmg\t%0,%N0,%1
+ stmg\t%1,%N1,%0
#
#
- mvc\\t%O0(16,%R0),%1"
+ mvc\t%O0(16,%R0),%1"
[(set_attr "op_type" "RSY,RSY,NN,NN,SS")
(set_attr "type" "lm,stm,*,*,cs")])
@@ -1011,7 +1025,6 @@
[(set (match_operand:DI 0 "general_operand" "")
(match_operand:DI 1 "general_operand" ""))]
""
- "
{
/* Handle symbolic constants. */
if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
@@ -1020,11 +1033,11 @@
/* During and after reload, we need to force constants
to the literal pool ourselves, if necessary. */
if ((reload_in_progress || reload_completed)
- && CONSTANT_P (operands[1])
+ && CONSTANT_P (operands[1])
&& (!legitimate_reload_constant_p (operands[1])
|| FP_REG_P (operands[0])))
operands[1] = force_const_mem (DImode, operands[1]);
-}")
+})
(define_insn "*movdi_lhi"
[(set (match_operand:DI 0 "register_operand" "=d")
@@ -1033,7 +1046,7 @@
&& GET_CODE (operands[1]) == CONST_INT
&& CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K')
&& !FP_REG_P (operands[0])"
- "lghi\\t%0,%h1"
+ "lghi\t%0,%h1"
[(set_attr "op_type" "RI")])
(define_insn "*movdi_lli"
@@ -1041,30 +1054,29 @@
(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\";
+ 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_64BIT
&& TARGET_LONG_DISPLACEMENT
&& GET_CODE (operands[1]) == CONST_INT
&& !FP_REG_P (operands[0])"
- "lay\\t%0,%a1"
+ "lay\t%0,%a1"
[(set_attr "op_type" "RXY")
(set_attr "type" "la")])
@@ -1073,7 +1085,7 @@
(match_operand:DI 1 "larl_operand" "X"))]
"TARGET_64BIT
&& !FP_REG_P (operands[0])"
- "larl\\t%0,%1"
+ "larl\t%0,%1"
[(set_attr "op_type" "RIL")
(set_attr "type" "larl")])
@@ -1082,15 +1094,15 @@
(match_operand:DI 1 "general_operand" "d,m,d,*f,R,T,*f,*f,?Q"))]
"TARGET_64BIT"
"@
- lgr\\t%0,%1
- lg\\t%0,%1
- stg\\t%1,%0
- ldr\\t%0,%1
- ld\\t%0,%1
- ldy\\t%0,%1
- std\\t%1,%0
- stdy\\t%1,%0
- mvc\\t%O0(8,%R0),%1"
+ lgr\t%0,%1
+ lg\t%0,%1
+ stg\t%1,%0
+ ldr\t%0,%1
+ ld\t%0,%1
+ ldy\t%0,%1
+ 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")])
@@ -1099,16 +1111,16 @@
(match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,R,T,*f,*f,Q"))]
"!TARGET_64BIT"
"@
- lm\\t%0,%N0,%1
- stm\\t%1,%N1,%0
+ lm\t%0,%N0,%1
+ stm\t%1,%N1,%0
#
#
- ldr\\t%0,%1
- ld\\t%0,%1
- ldy\\t%0,%1
- std\\t%1,%0
- stdy\\t%1,%0
- mvc\\t%O0(8,%R0),%1"
+ ldr\t%0,%1
+ ld\t%0,%1
+ ldy\t%0,%1
+ std\t%1,%0
+ stdy\t%1,%0
+ mvc\t%O0(8,%R0),%1"
[(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RXY,RX,RXY,SS")
(set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,cs")])
@@ -1185,14 +1197,13 @@
[(set (match_operand:SI 0 "general_operand" "")
(match_operand:SI 1 "general_operand" ""))]
""
- "
{
/* Handle symbolic constants. */
if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
emit_symbolic_move (operands);
- /* expr.c tries to load an effective address using
- force_reg. This fails because we don't have a
+ /* expr.c tries to load an effective address using
+ force_reg. This fails because we don't have a
generic load_address pattern. Convert the move
to a proper arithmetic operation instead, unless
it is guaranteed to be OK. */
@@ -1207,11 +1218,11 @@
/* During and after reload, we need to force constants
to the literal pool ourselves, if necessary. */
if ((reload_in_progress || reload_completed)
- && CONSTANT_P (operands[1])
+ && CONSTANT_P (operands[1])
&& (!legitimate_reload_constant_p (operands[1])
|| FP_REG_P (operands[0])))
operands[1] = force_const_mem (SImode, operands[1]);
-}")
+})
(define_insn "*movsi_lhi"
[(set (match_operand:SI 0 "register_operand" "=d")
@@ -1219,26 +1230,25 @@
"GET_CODE (operands[1]) == CONST_INT
&& CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K')
&& !FP_REG_P (operands[0])"
- "lhi\\t%0,%h1"
+ "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_64BIT && s390_single_hi (operands[1], SImode, 0) >= 0
+ "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\";
+ 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"
@@ -1247,26 +1257,35 @@
"TARGET_LONG_DISPLACEMENT
&& GET_CODE (operands[1]) == CONST_INT
&& !FP_REG_P (operands[0])"
- "lay\\t%0,%a1"
+ "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"))]
+ "!TARGET_64BIT && TARGET_CPU_ZARCH
+ && !FP_REG_P (operands[0])"
+ "larl\t%0,%1"
+ [(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"))]
""
"@
- lr\\t%0,%1
- l\\t%0,%1
- ly\\t%0,%1
- st\\t%1,%0
- sty\\t%1,%0
- ler\\t%0,%1
- le\\t%0,%1
- ley\\t%0,%1
- ste\\t%1,%0
- stey\\t%1,%0
- mvc\\t%O0(4,%R0),%1"
+ lr\t%0,%1
+ l\t%0,%1
+ ly\t%0,%1
+ st\t%1,%0
+ sty\t%1,%0
+ ler\t%0,%1
+ le\t%0,%1
+ ley\t%0,%1
+ 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")])
@@ -1285,18 +1304,36 @@
; movhi instruction pattern(s).
;
-(define_insn "movhi"
+(define_expand "movhi"
+ [(set (match_operand:HI 0 "nonimmediate_operand" "")
+ (match_operand:HI 1 "general_operand" ""))]
+ ""
+{
+ /* Make it explicit that loading a register from memory
+ always sign-extends (at least) to SImode. */
+ if (optimize && !no_new_pseudos
+ && register_operand (operands[0], VOIDmode)
+ && memory_operand (operands[1], VOIDmode))
+ {
+ rtx tmp = gen_reg_rtx (SImode);
+ rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
+ emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
+ operands[1] = gen_lowpart (HImode, tmp);
+ }
+})
+
+(define_insn "*movhi"
[(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
(match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
""
"@
- lr\\t%0,%1
- lhi\\t%0,%h1
- lh\\t%0,%1
- lhy\\t%0,%1
- sth\\t%1,%0
- sthy\\t%1,%0
- mvc\\t%O0(2,%R0),%1"
+ lr\t%0,%1
+ lhi\t%0,%h1
+ lh\t%0,%1
+ lhy\t%0,%1
+ sth\t%1,%0
+ sthy\t%1,%0
+ mvc\t%O0(2,%R0),%1"
[(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
(set_attr "type" "lr,*,*,*,store,store,cs")])
@@ -1314,36 +1351,38 @@
; movqi instruction pattern(s).
;
-(define_insn "movqi_64"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,R,T,Q,S,?Q")
- (match_operand:QI 1 "general_operand" "d,n,m,d,d,n,n,?Q"))]
- "TARGET_64BIT"
- "@
- lr\\t%0,%1
- lhi\\t%0,%b1
- llgc\\t%0,%1
- stc\\t%1,%0
- stcy\\t%1,%0
- mvi\\t%0,%b1
- mviy\\t%0,%b1
- mvc\\t%O0(1,%R0),%1"
- [(set_attr "op_type" "RR,RI,RXY,RX,RXY,SI,SIY,SS")
- (set_attr "type" "lr,*,*,store,store,store,store,cs")])
-
-(define_insn "movqi"
+(define_expand "movqi"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "")
+ (match_operand:QI 1 "general_operand" ""))]
+ ""
+{
+ /* On 64-bit, zero-extending from memory to register
+ is just as fast as a QImode load. */
+ if (TARGET_64BIT && optimize && !no_new_pseudos
+ && register_operand (operands[0], VOIDmode)
+ && memory_operand (operands[1], VOIDmode))
+ {
+ rtx tmp = gen_reg_rtx (DImode);
+ rtx ext = gen_rtx_ZERO_EXTEND (DImode, operands[1]);
+ emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
+ operands[1] = gen_lowpart (QImode, tmp);
+ }
+})
+
+(define_insn "*movqi"
[(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
(match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
""
"@
- lr\\t%0,%1
- lhi\\t%0,%b1
- ic\\t%0,%1
- icy\\t%0,%1
- stc\\t%1,%0
- stcy\\t%1,%0
- mvi\\t%0,%b1
- mviy\\t%0,%b1
- mvc\\t%O0(1,%R0),%1"
+ lr\t%0,%1
+ lhi\t%0,%b1
+ ic\t%0,%1
+ icy\t%0,%1
+ stc\t%1,%0
+ stcy\t%1,%0
+ mvi\t%0,%b1
+ mviy\t%0,%b1
+ mvc\t%O0(1,%R0),%1"
[(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
(set_attr "type" "lr,*,*,*,store,store,store,store,cs")])
@@ -1366,8 +1405,8 @@
(match_operand:QI 1 "memory_operand" "R,T"))]
""
"@
- ic\\t%0,%1
- icy\\t%0,%1"
+ ic\t%0,%1
+ icy\t%0,%1"
[(set_attr "op_type" "RX,RXY")])
;
@@ -1380,8 +1419,8 @@
(clobber (reg:CC 33))]
""
"@
- icm\\t%0,3,%1
- icmy\\t%0,3,%1"
+ icm\t%0,3,%1
+ icmy\t%0,3,%1"
[(set_attr "op_type" "RS,RSY")])
;
@@ -1393,9 +1432,9 @@
(match_operand:SI 1 "general_operand" "d,R,T"))]
"TARGET_64BIT"
"@
- lr\\t%0,%1
- l\\t%0,%1
- ly\\t%0,%1"
+ lr\t%0,%1
+ l\t%0,%1
+ ly\t%0,%1"
[(set_attr "op_type" "RR,RX,RXY")
(set_attr "type" "lr,load,load")])
@@ -1407,29 +1446,28 @@
[(set (match_operand:DF 0 "nonimmediate_operand" "")
(match_operand:DF 1 "general_operand" ""))]
""
- "
{
/* During and after reload, we need to force constants
to the literal pool ourselves, if necessary. */
if ((reload_in_progress || reload_completed)
&& CONSTANT_P (operands[1]))
operands[1] = force_const_mem (DFmode, operands[1]);
-}")
+})
(define_insn "*movdf_64"
[(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
(match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
"TARGET_64BIT"
"@
- ldr\\t%0,%1
- ld\\t%0,%1
- ldy\\t%0,%1
- std\\t%1,%0
- stdy\\t%1,%0
- lgr\\t%0,%1
- lg\\t%0,%1
- stg\\t%1,%0
- mvc\\t%O0(8,%R0),%1"
+ ldr\t%0,%1
+ ld\t%0,%1
+ ldy\t%0,%1
+ std\t%1,%0
+ stdy\t%1,%0
+ lgr\t%0,%1
+ lg\t%0,%1
+ stg\t%1,%0
+ mvc\t%O0(8,%R0),%1"
[(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
(set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")])
@@ -1438,16 +1476,16 @@
(match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
"!TARGET_64BIT"
"@
- ldr\\t%0,%1
- ld\\t%0,%1
- ldy\\t%0,%1
- std\\t%1,%0
- stdy\\t%1,%0
- lm\\t%0,%N0,%1
- stm\\t%1,%N1,%0
+ ldr\t%0,%1
+ ld\t%0,%1
+ ldy\t%0,%1
+ std\t%1,%0
+ stdy\t%1,%0
+ lm\t%0,%N0,%1
+ stm\t%1,%N1,%0
#
#
- mvc\\t%O0(8,%R0),%1"
+ mvc\t%O0(8,%R0),%1"
[(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS")
(set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")])
@@ -1512,31 +1550,30 @@
[(set (match_operand:SF 0 "nonimmediate_operand" "")
(match_operand:SF 1 "general_operand" ""))]
""
- "
{
/* During and after reload, we need to force constants
to the literal pool ourselves, if necessary. */
if ((reload_in_progress || reload_completed)
&& CONSTANT_P (operands[1]))
operands[1] = force_const_mem (SFmode, operands[1]);
-}")
+})
(define_insn "*movsf"
[(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
(match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
""
"@
- ler\\t%0,%1
- le\\t%0,%1
- ley\\t%0,%1
- ste\\t%1,%0
- stey\\t%1,%0
- lr\\t%0,%1
- l\\t%0,%1
- ly\\t%0,%1
- st\\t%1,%0
- sty\\t%1,%0
- mvc\\t%O0(4,%R0),%1"
+ ler\t%0,%1
+ le\t%0,%1
+ ley\t%0,%1
+ ste\t%1,%0
+ stey\t%1,%0
+ lr\t%0,%1
+ l\t%0,%1
+ ly\t%0,%1
+ st\t%1,%0
+ sty\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" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")])
@@ -1549,7 +1586,6 @@
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))])]
""
- "
{
int regno;
int count;
@@ -1602,19 +1638,18 @@
change_address (operands[1], Pmode,
plus_constant (from,
off + i * UNITS_PER_WORD)));
-}")
+})
(define_insn "*load_multiple_di"
[(match_parallel 0 "load_multiple_operation"
[(set (match_operand:DI 1 "register_operand" "=r")
(match_operand:DI 2 "s_operand" "QS"))])]
""
- "*
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
- return \"lmg\\t%1,%0,%2\";
-}"
+ return "lmg\t%1,%0,%2";
+}
[(set_attr "op_type" "RSY")
(set_attr "type" "lm")])
@@ -1623,17 +1658,16 @@
[(set (match_operand:SI 1 "register_operand" "=r,r")
(match_operand:SI 2 "s_operand" "Q,S"))])]
""
- "*
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
- return which_alternative == 0 ? \"lm\\t%1,%0,%2\" : \"lmy\\t%1,%0,%2\";
-}"
+ return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
+}
[(set_attr "op_type" "RS,RSY")
(set_attr "type" "lm")])
;
-; store multiple pattern(s).
+; store multiple pattern(s).
;
(define_expand "store_multiple"
@@ -1641,7 +1675,6 @@
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))])]
""
- "
{
int regno;
int count;
@@ -1683,7 +1716,7 @@
if (to == frame_pointer_rtx || to == arg_pointer_rtx)
FAIL;
}
- else
+ else
{
to = force_reg (Pmode, XEXP (operands[0], 0));
off = 0;
@@ -1696,19 +1729,18 @@
plus_constant (to,
off + i * UNITS_PER_WORD)),
gen_rtx_REG (Pmode, regno + i));
-}")
+})
(define_insn "*store_multiple_di"
[(match_parallel 0 "store_multiple_operation"
[(set (match_operand:DI 1 "s_operand" "=QS")
(match_operand:DI 2 "register_operand" "r"))])]
""
- "*
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
- return \"stmg\\t%2,%0,%1\";
-}"
+ return "stmg\t%2,%0,%1";
+}
[(set_attr "op_type" "RSY")
(set_attr "type" "stm")])
@@ -1718,12 +1750,11 @@
[(set (match_operand:SI 1 "s_operand" "=Q,S")
(match_operand:SI 2 "register_operand" "r,r"))])]
""
- "*
{
int words = XVECLEN (operands[0], 0);
operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
- return which_alternative == 0 ? \"stm\\t%2,%0,%1\" : \"stmy\\t%2,%0,%1\";
-}"
+ return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
+}
[(set_attr "op_type" "RS,RSY")
(set_attr "type" "stm")])
@@ -1760,22 +1791,21 @@
(use (match_operand:DI 2 "nonmemory_operand" "n,a"))
(clobber (match_scratch:DI 3 "=X,&a"))]
"TARGET_64BIT"
- "*
{
switch (which_alternative)
{
case 0:
- return \"mvc\\t%O0(%b2+1,%R0),%1\";
+ return "mvc\t%O0(%b2+1,%R0),%1";
case 1:
- output_asm_insn (\"bras\\t%3,.+10\", operands);
- output_asm_insn (\"mvc\\t%O0(1,%R0),%1\", operands);
- return \"ex\\t%2,0(%3)\";
+ output_asm_insn ("bras\t%3,.+10", operands);
+ output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
+ return "ex\t%2,0(%3)";
default:
abort ();
}
-}"
+}
[(set_attr "op_type" "SS,NN")
(set_attr "type" "cs,cs")
(set_attr "atype" "*,agen")
@@ -1787,22 +1817,21 @@
(use (match_operand:SI 2 "nonmemory_operand" "n,a"))
(clobber (match_scratch:SI 3 "=X,&a"))]
"!TARGET_64BIT"
- "*
{
switch (which_alternative)
{
case 0:
- return \"mvc\\t%O0(%b2+1,%R0),%1\";
+ return "mvc\t%O0(%b2+1,%R0),%1";
case 1:
- output_asm_insn (\"bras\\t%3,.+10\", operands);
- output_asm_insn (\"mvc\\t%O0(1,%R0),%1\", operands);
- return \"ex\\t%2,0(%3)\";
+ output_asm_insn ("bras\t%3,.+10", operands);
+ output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
+ return "ex\t%2,0(%3)";
default:
abort ();
}
-}"
+}
[(set_attr "op_type" "SS,NN")
(set_attr "type" "cs,cs")
(set_attr "atype" "*,agen")
@@ -1823,7 +1852,7 @@
(mem:BLK (subreg:DI (match_dup 3) 0)))
(clobber (reg:CC 33))]
"TARGET_64BIT"
- "mvcle\\t%0,%1,0\;jo\\t.-4"
+ "mvcle\t%0,%1,0\;jo\t.-4"
[(set_attr "op_type" "NN")
(set_attr "type" "vs")
(set_attr "length" "8")])
@@ -1841,7 +1870,7 @@
(mem:BLK (subreg:SI (match_dup 3) 0)))
(clobber (reg:CC 33))]
"!TARGET_64BIT"
- "mvcle\\t%0,%1,0\;jo\\t.-4"
+ "mvcle\t%0,%1,0\;jo\t.-4"
[(set_attr "op_type" "NN")
(set_attr "type" "vs")
(set_attr "length" "8")])
@@ -1876,22 +1905,21 @@
(clobber (match_scratch:DI 2 "=X,&a"))
(clobber (reg:CC 33))]
"TARGET_64BIT"
- "*
{
switch (which_alternative)
{
case 0:
- return \"xc\\t%O0(%b1+1,%R0),%0\";
+ return "xc\t%O0(%b1+1,%R0),%0";
case 1:
- output_asm_insn (\"bras\\t%2,.+10\", operands);
- output_asm_insn (\"xc\\t%O0(1,%R0),%0\", operands);
- return \"ex\\t%1,0(%2)\";
+ output_asm_insn ("bras\t%2,.+10", operands);
+ output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
+ return "ex\t%1,0(%2)";
default:
abort ();
}
-}"
+}
[(set_attr "op_type" "SS,NN")
(set_attr "type" "cs,cs")
(set_attr "atype" "*,agen")
@@ -1904,22 +1932,21 @@
(clobber (match_scratch:SI 2 "=X,&a"))
(clobber (reg:CC 33))]
"!TARGET_64BIT"
- "*
{
switch (which_alternative)
{
case 0:
- return \"xc\\t%O0(%b1+1,%R0),%0\";
+ return "xc\t%O0(%b1+1,%R0),%0";
case 1:
- output_asm_insn (\"bras\\t%2,.+10\", operands);
- output_asm_insn (\"xc\\t%O0(1,%R0),%0\", operands);
- return \"ex\\t%1,0(%2)\";
+ output_asm_insn ("bras\t%2,.+10", operands);
+ output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
+ return "ex\t%1,0(%2)";
default:
abort ();
}
-}"
+}
[(set_attr "op_type" "SS,NN")
(set_attr "type" "cs,cs")
(set_attr "atype" "*,agen")
@@ -1937,7 +1964,7 @@
(use (match_operand:TI 1 "register_operand" "d"))
(clobber (reg:CC 33))]
"TARGET_64BIT"
- "mvcle\\t%0,%1,0\;jo\\t.-4"
+ "mvcle\t%0,%1,0\;jo\t.-4"
[(set_attr "op_type" "NN")
(set_attr "type" "vs")
(set_attr "length" "8")])
@@ -1952,89 +1979,87 @@
(use (match_operand:DI 1 "register_operand" "d"))
(clobber (reg:CC 33))]
"!TARGET_64BIT"
- "mvcle\\t%0,%1,0\;jo\\t.-4"
+ "mvcle\t%0,%1,0\;jo\t.-4"
[(set_attr "op_type" "NN")
(set_attr "type" "vs")
(set_attr "length" "8")])
;
-; cmpstrM instruction pattern(s).
+; cmpmemM instruction pattern(s).
;
-(define_expand "cmpstrdi"
+(define_expand "cmpmemdi"
[(set (match_operand:DI 0 "register_operand" "")
(compare:DI (match_operand:BLK 1 "memory_operand" "")
(match_operand:BLK 2 "memory_operand" "") ) )
(use (match_operand:DI 3 "general_operand" ""))
(use (match_operand:DI 4 "" ""))]
"TARGET_64BIT"
- "s390_expand_cmpstr (operands[0], operands[1],
+ "s390_expand_cmpmem (operands[0], operands[1],
operands[2], operands[3]); DONE;")
-(define_expand "cmpstrsi"
+(define_expand "cmpmemsi"
[(set (match_operand:SI 0 "register_operand" "")
(compare:SI (match_operand:BLK 1 "memory_operand" "")
(match_operand:BLK 2 "memory_operand" "") ) )
(use (match_operand:SI 3 "general_operand" ""))
(use (match_operand:SI 4 "" ""))]
""
- "s390_expand_cmpstr (operands[0], operands[1],
+ "s390_expand_cmpmem (operands[0], operands[1],
operands[2], operands[3]); DONE;")
; Compare a block that is up to 256 bytes in length.
; The block length is taken as (operands[2] % 256) + 1.
-(define_insn "cmpstr_short_64"
+(define_insn "cmpmem_short_64"
[(set (reg:CCS 33)
(compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
(match_operand:BLK 1 "memory_operand" "Q,Q")))
(use (match_operand:DI 2 "nonmemory_operand" "n,a"))
(clobber (match_scratch:DI 3 "=X,&a"))]
"TARGET_64BIT"
- "*
{
switch (which_alternative)
{
case 0:
- return \"clc\\t%O0(%b2+1,%R0),%1\";
+ return "clc\t%O0(%b2+1,%R0),%1";
case 1:
- output_asm_insn (\"bras\\t%3,.+10\", operands);
- output_asm_insn (\"clc\\t%O0(1,%R0),%1\", operands);
- return \"ex\\t%2,0(%3)\";
+ output_asm_insn ("bras\t%3,.+10", operands);
+ output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
+ return "ex\t%2,0(%3)";
default:
abort ();
}
-}"
+}
[(set_attr "op_type" "SS,NN")
(set_attr "type" "cs,cs")
(set_attr "atype" "*,agen")
(set_attr "length" "*,14")])
-(define_insn "cmpstr_short_31"
+(define_insn "cmpmem_short_31"
[(set (reg:CCS 33)
(compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
(match_operand:BLK 1 "memory_operand" "Q,Q")))
(use (match_operand:SI 2 "nonmemory_operand" "n,a"))
(clobber (match_scratch:SI 3 "=X,&a"))]
"!TARGET_64BIT"
- "*
{
switch (which_alternative)
{
case 0:
- return \"clc\\t%O0(%b2+1,%R0),%1\";
+ return "clc\t%O0(%b2+1,%R0),%1";
case 1:
- output_asm_insn (\"bras\\t%3,.+10\", operands);
- output_asm_insn (\"clc\\t%O0(1,%R0),%1\", operands);
- return \"ex\\t%2,0(%3)\";
+ output_asm_insn ("bras\t%3,.+10", operands);
+ output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
+ return "ex\t%2,0(%3)";
default:
abort ();
}
-}"
+}
[(set_attr "op_type" "SS,NN")
(set_attr "type" "cs,cs")
(set_attr "atype" "*,agen")
@@ -2042,7 +2067,7 @@
; Compare a block of arbitrary length.
-(define_insn "cmpstr_long_64"
+(define_insn "cmpmem_long_64"
[(clobber (match_operand:TI 0 "register_operand" "=d"))
(clobber (match_operand:TI 1 "register_operand" "=d"))
(set (reg:CCS 33)
@@ -2051,11 +2076,11 @@
(use (match_dup 2))
(use (match_dup 3))]
"TARGET_64BIT"
- "clcl\\t%0,%1"
+ "clcl\t%0,%1"
[(set_attr "op_type" "RR")
(set_attr "type" "vs")])
-(define_insn "cmpstr_long_31"
+(define_insn "cmpmem_long_31"
[(clobber (match_operand:DI 0 "register_operand" "=d"))
(clobber (match_operand:DI 1 "register_operand" "=d"))
(set (reg:CCS 33)
@@ -2064,7 +2089,7 @@
(use (match_dup 2))
(use (match_dup 3))]
"!TARGET_64BIT"
- "clcl\\t%0,%1"
+ "clcl\t%0,%1"
[(set_attr "op_type" "RR")
(set_attr "type" "vs")])
@@ -2074,14 +2099,13 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(compare:SI (reg:CCS 33) (const_int 0)))]
""
- "*
{
- output_asm_insn (\"lhi\\t%0,1\", operands);
- output_asm_insn (\"jh\\t.+12\", operands);
- output_asm_insn (\"jl\\t.+6\", operands);
- output_asm_insn (\"sr\\t%0,%0\", operands);
- return \"lcr\\t%0,%0\";
-}"
+ output_asm_insn ("lhi\t%0,1", operands);
+ output_asm_insn ("jh\t.+12", operands);
+ output_asm_insn ("jl\t.+6", operands);
+ output_asm_insn ("sr\t%0,%0", operands);
+ return "lcr\t%0,%0";
+}
[(set_attr "op_type" "NN")
(set_attr "length" "16")
(set_attr "type" "other")])
@@ -2090,14 +2114,13 @@
[(set (match_operand:DI 0 "register_operand" "=d")
(compare:DI (reg:CCS 33) (const_int 0)))]
"TARGET_64BIT"
- "*
{
- output_asm_insn (\"lghi\\t%0,1\", operands);
- output_asm_insn (\"jh\\t.+12\", operands);
- output_asm_insn (\"jl\\t.+6\", operands);
- output_asm_insn (\"sgr\\t%0,%0\", operands);
- return \"lcgr\\t%0,%0\";
-}"
+ output_asm_insn ("lghi\t%0,1", operands);
+ output_asm_insn ("jh\t.+12", operands);
+ output_asm_insn ("jl\t.+6", operands);
+ output_asm_insn ("sgr\t%0,%0", operands);
+ return "lcgr\t%0,%0";
+}
[(set_attr "op_type" "NN")
(set_attr "length" "22")
(set_attr "type" "other")])
@@ -2109,40 +2132,40 @@
(define_insn "*sethighqisi"
[(set (match_operand:SI 0 "register_operand" "=d,d")
- (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] 10))
+ (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
(clobber (reg:CC 33))]
""
"@
- icm\\t%0,8,%1
- icmy\\t%0,8,%1"
+ icm\t%0,8,%1
+ icmy\t%0,8,%1"
[(set_attr "op_type" "RS,RSY")])
(define_insn "*sethighhisi"
[(set (match_operand:SI 0 "register_operand" "=d,d")
- (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] 10))
+ (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
(clobber (reg:CC 33))]
""
"@
- icm\\t%0,12,%1
- icmy\\t%0,12,%1"
+ icm\t%0,12,%1
+ icmy\t%0,12,%1"
[(set_attr "op_type" "RS,RSY")])
(define_insn "*sethighqidi_64"
[(set (match_operand:DI 0 "register_operand" "=d")
- (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] 10))
+ (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
(clobber (reg:CC 33))]
"TARGET_64BIT"
- "icmh\\t%0,8,%1"
+ "icmh\t%0,8,%1"
[(set_attr "op_type" "RSY")])
(define_insn "*sethighqidi_31"
[(set (match_operand:DI 0 "register_operand" "=d,d")
- (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] 10))
+ (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
(clobber (reg:CC 33))]
"!TARGET_64BIT"
"@
- icm\\t%0,8,%1
- icmy\\t%0,8,%1"
+ icm\t%0,8,%1
+ icmy\t%0,8,%1"
[(set_attr "op_type" "RS,RSY")])
(define_insn_and_split "*extractqi"
@@ -2156,14 +2179,13 @@
"#"
"&& reload_completed"
[(parallel
- [(set (match_dup 0) (unspec:SI [(match_dup 1)] 10))
+ [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
(clobber (reg:CC 33))])
(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
- "
{
operands[2] = GEN_INT (32 - INTVAL (operands[2]));
operands[1] = change_address (operands[1], QImode, 0);
-}"
+}
[(set_attr "atype" "agen")])
(define_insn_and_split "*extracthi"
@@ -2177,14 +2199,13 @@
"#"
"&& reload_completed"
[(parallel
- [(set (match_dup 0) (unspec:SI [(match_dup 1)] 10))
+ [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
(clobber (reg:CC 33))])
(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
- "
{
operands[2] = GEN_INT (32 - INTVAL (operands[2]));
operands[1] = change_address (operands[1], HImode, 0);
-}"
+}
[(set_attr "atype" "agen")])
;
@@ -2213,8 +2234,8 @@
(sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
"TARGET_64BIT"
"@
- lgfr\\t%0,%1
- lgf\\t%0,%1"
+ lgfr\t%0,%1
+ lgf\t%0,%1"
[(set_attr "op_type" "RRE,RXY")])
;
@@ -2238,7 +2259,7 @@
{
operands[1] = gen_lowpart (DImode, operands[1]);
emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
- emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
+ emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
DONE;
}
}
@@ -2248,7 +2269,7 @@
[(set (match_operand:DI 0 "register_operand" "=d")
(sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
"TARGET_64BIT"
- "lgh\\t%0,%1"
+ "lgh\t%0,%1"
[(set_attr "op_type" "RXY")])
;
@@ -2272,7 +2293,7 @@
{
operands[1] = gen_lowpart (DImode, operands[1]);
emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
- emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
+ emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
DONE;
}
}
@@ -2282,7 +2303,7 @@
[(set (match_operand:DI 0 "register_operand" "=d")
(sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
"TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
- "lgb\\t%0,%1"
+ "lgb\t%0,%1"
[(set_attr "op_type" "RXY")])
(define_split
@@ -2290,7 +2311,7 @@
(sign_extend:DI (match_operand:QI 1 "s_operand" "")))]
"TARGET_64BIT && !TARGET_LONG_DISPLACEMENT && !reload_completed"
[(parallel
- [(set (match_dup 0) (unspec:DI [(match_dup 1)] 10))
+ [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
(clobber (reg:CC 33))])
(parallel
[(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
@@ -2309,7 +2330,7 @@
{
operands[1] = gen_lowpart (SImode, operands[1]);
emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
- emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
+ emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
DONE;
}
")
@@ -2319,8 +2340,8 @@
(sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
""
"@
- lh\\t%0,%1
- lhy\\t%0,%1"
+ lh\t%0,%1
+ lhy\t%0,%1"
[(set_attr "op_type" "RX,RXY")])
;
@@ -2335,7 +2356,7 @@
{
operands[1] = gen_lowpart (SImode, operands[1]);
emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
- emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
+ emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
DONE;
}
")
@@ -2343,16 +2364,16 @@
(define_insn "*extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=d")
(sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
- "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
- "lb\\t%0,%1"
+ "TARGET_LONG_DISPLACEMENT"
+ "lb\t%0,%1"
[(set_attr "op_type" "RXY")])
(define_split
[(set (match_operand:SI 0 "register_operand" "")
(sign_extend:SI (match_operand:QI 1 "s_operand" "")))]
- "(!TARGET_64BIT || !TARGET_LONG_DISPLACEMENT) && !reload_completed"
+ "!TARGET_LONG_DISPLACEMENT && !reload_completed"
[(parallel
- [(set (match_dup 0) (unspec:SI [(match_dup 1)] 10))
+ [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
(clobber (reg:CC 33))])
(parallel
[(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
@@ -2389,8 +2410,8 @@
(zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
"TARGET_64BIT"
"@
- llgfr\\t%0,%1
- llgf\\t%0,%1"
+ llgfr\t%0,%1
+ llgf\t%0,%1"
[(set_attr "op_type" "RRE,RXY")])
;
@@ -2414,7 +2435,7 @@
{
operands[1] = gen_lowpart (DImode, operands[1]);
emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
- emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
+ emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
DONE;
}
}
@@ -2424,10 +2445,81 @@
[(set (match_operand:DI 0 "register_operand" "=d")
(zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
"TARGET_64BIT"
- "llgh\\t%0,%1"
+ "llgh\t%0,%1"
[(set_attr "op_type" "RXY")])
;
+; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
+;
+
+(define_insn "*llgt_sisi"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
+ (const_int 2147483647)))]
+ "TARGET_64BIT"
+ "@
+ llgtr\t%0,%1
+ 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")
+ (const_int 2147483647)))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (and:SI (match_dup 1)
+ (const_int 2147483647)))]
+ "")
+
+(define_insn "*llgt_didi"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
+ (const_int 2147483647)))]
+ "TARGET_64BIT"
+ "@
+ llgtr\t%0,%1
+ 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")
+ (const_int 2147483647)))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (and:DI (match_dup 1)
+ (const_int 2147483647)))]
+ "")
+
+(define_insn "*llgt_sidi"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
+ (const_int 2147483647)))]
+ "TARGET_64BIT"
+ "llgt\t%0,%1"
+ [(set_attr "op_type" "RXE")])
+
+(define_insn_and_split "*llgt_sidi_split"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
+ (const_int 2147483647)))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (and:DI (subreg:DI (match_dup 1) 0)
+ (const_int 2147483647)))]
+ "")
+
+;
; zero_extendqidi2 instruction pattern(s)
;
@@ -2448,7 +2540,7 @@
{
operands[1] = gen_lowpart (DImode, operands[1]);
emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
- emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
+ emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
DONE;
}
}
@@ -2458,7 +2550,7 @@
[(set (match_operand:DI 0 "register_operand" "=d")
(zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
"TARGET_64BIT"
- "llgc\\t%0,%1"
+ "llgc\t%0,%1"
[(set_attr "op_type" "RXY")])
;
@@ -2481,12 +2573,12 @@
[(set (match_operand:SI 0 "register_operand" "=d")
(zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
"TARGET_64BIT"
- "llgh\\t%0,%1"
+ "llgh\t%0,%1"
[(set_attr "op_type" "RXY")])
(define_insn_and_split "*zero_extendhisi2_31"
[(set (match_operand:SI 0 "register_operand" "=&d")
- (zero_extend:SI (match_operand:HI 1 "memory_operand" "QS")))
+ (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
(clobber (reg:CC 33))]
"!TARGET_64BIT"
"#"
@@ -2497,7 +2589,7 @@
(clobber (reg:CC 33))])]
"operands[2] = gen_lowpart (HImode, operands[0]);"
[(set_attr "atype" "agen")])
-
+
;
; zero_extendqisi2 instruction pattern(s).
;
@@ -2517,21 +2609,21 @@
(define_insn "*zero_extendqisi2_64"
[(set (match_operand:SI 0 "register_operand" "=d")
(zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
- "TARGET_64BIT"
- "llgc\\t%0,%1"
+ "TARGET_ZARCH"
+ "llgc\t%0,%1"
[(set_attr "op_type" "RXY")])
(define_insn_and_split "*zero_extendqisi2_31"
[(set (match_operand:SI 0 "register_operand" "=&d")
(zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
- "!TARGET_64BIT"
+ "!TARGET_ZARCH"
"#"
"&& reload_completed"
[(set (match_dup 0) (const_int 0))
(set (strict_low_part (match_dup 2)) (match_dup 1))]
"operands[2] = gen_lowpart (QImode, operands[0]);"
[(set_attr "atype" "agen")])
-
+
;
; zero_extendqihi2 instruction pattern(s).
;
@@ -2539,7 +2631,7 @@
(define_expand "zero_extendqihi2"
[(set (match_operand:HI 0 "register_operand" "")
(zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
- "TARGET_64BIT"
+ "TARGET_ZARCH"
"
{
operands[1] = gen_lowpart (HImode, operands[1]);
@@ -2551,14 +2643,14 @@
(define_insn "*zero_extendqihi2_64"
[(set (match_operand:HI 0 "register_operand" "=d")
(zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
- "TARGET_64BIT"
- "llgc\\t%0,%1"
+ "TARGET_ZARCH"
+ "llgc\t%0,%1"
[(set_attr "op_type" "RXY")])
(define_insn_and_split "*zero_extendqihi2_31"
[(set (match_operand:HI 0 "register_operand" "=&d")
(zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
- "!TARGET_64BIT"
+ "!TARGET_ZARCH"
"#"
"&& reload_completed"
[(set (match_dup 0) (const_int 0))
@@ -2575,20 +2667,19 @@
[(set (match_operand:DI 0 "register_operand" "")
(unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "
{
rtx label1 = gen_label_rtx ();
rtx label2 = gen_label_rtx ();
rtx temp = gen_reg_rtx (DFmode);
operands[1] = force_reg (DFmode, operands[1]);
- emit_insn (gen_cmpdf (operands[1],
+ emit_insn (gen_cmpdf (operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"9223372036854775808.0\", DFmode), DFmode)));
+ REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
emit_jump_insn (gen_blt (label1));
emit_insn (gen_subdf3 (temp, operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"18446744073709551616.0\", DFmode), DFmode)));
+ REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
emit_jump (label2);
@@ -2596,26 +2687,25 @@
emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
emit_label (label2);
DONE;
-}")
+})
(define_expand "fix_truncdfdi2"
[(set (match_operand:DI 0 "register_operand" "")
(fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "
{
operands[1] = force_reg (DFmode, operands[1]);
emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
DONE;
-}")
+})
(define_insn "fix_truncdfdi2_ieee"
[(set (match_operand:DI 0 "register_operand" "=d")
(fix:DI (match_operand:DF 1 "register_operand" "f")))
- (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1)
+ (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
(clobber (reg:CC 33))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cgdbr\\t%0,%h2,%1"
+ "cgdbr\t%0,%h2,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "ftoi")])
@@ -2627,20 +2717,19 @@
[(set (match_operand:SI 0 "register_operand" "")
(unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "
{
rtx label1 = gen_label_rtx ();
rtx label2 = gen_label_rtx ();
rtx temp = gen_reg_rtx (DFmode);
operands[1] = force_reg (DFmode,operands[1]);
- emit_insn (gen_cmpdf (operands[1],
+ emit_insn (gen_cmpdf (operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"2147483648.0\", DFmode), DFmode)));
+ REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
emit_jump_insn (gen_blt (label1));
emit_insn (gen_subdf3 (temp, operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"4294967296.0\", DFmode), DFmode)));
+ REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
emit_jump (label2);
@@ -2648,15 +2737,14 @@
emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
emit_label (label2);
DONE;
-}")
+})
(define_expand "fix_truncdfsi2"
[(set (match_operand:SI 0 "register_operand" "")
(fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
- if (TARGET_IBM_FLOAT)
+ if (TARGET_IBM_FLOAT)
{
/* This is the algorithm from POP chapter A.5.7.2. */
@@ -2665,25 +2753,25 @@
rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
operands[1] = force_reg (DFmode, operands[1]);
- emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
+ emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
two31r, two32, temp));
- }
- else
+ }
+ else
{
operands[1] = force_reg (DFmode, operands[1]);
emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
}
DONE;
-}")
+})
(define_insn "fix_truncdfsi2_ieee"
[(set (match_operand:SI 0 "register_operand" "=d")
(fix:SI (match_operand:DF 1 "register_operand" "f")))
- (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1)
+ (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cfdbr\\t%0,%h2,%1"
+ "cfdbr\t%0,%h2,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "other" )])
@@ -2695,14 +2783,13 @@
(use (match_operand:BLK 4 "memory_operand" "m"))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "*
{
- output_asm_insn (\"sd\\t%1,%2\", operands);
- output_asm_insn (\"aw\\t%1,%3\", operands);
- output_asm_insn (\"std\\t%1,%4\", operands);
- output_asm_insn (\"xi\\t%N4,128\", operands);
- return \"l\\t%0,%N4\";
-}"
+ output_asm_insn ("sd\t%1,%2", operands);
+ output_asm_insn ("aw\t%1,%3", operands);
+ output_asm_insn ("std\t%1,%4", operands);
+ output_asm_insn ("xi\t%N4,128", operands);
+ return "l\t%0,%N4";
+}
[(set_attr "op_type" "NN")
(set_attr "type" "ftoi")
(set_attr "atype" "agen")
@@ -2716,21 +2803,20 @@
[(set (match_operand:DI 0 "register_operand" "")
(unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "
{
rtx label1 = gen_label_rtx ();
rtx label2 = gen_label_rtx ();
rtx temp = gen_reg_rtx (SFmode);
operands[1] = force_reg (SFmode, operands[1]);
- emit_insn (gen_cmpsf (operands[1],
+ emit_insn (gen_cmpsf (operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"9223372036854775808.0\", SFmode), SFmode)));
+ REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
emit_jump_insn (gen_blt (label1));
emit_insn (gen_subsf3 (temp, operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"18446744073709551616.0\", SFmode), SFmode)));
+ REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
emit_jump (label2);
@@ -2738,26 +2824,25 @@
emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
emit_label (label2);
DONE;
-}")
+})
(define_expand "fix_truncsfdi2"
[(set (match_operand:DI 0 "register_operand" "")
(fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "
{
operands[1] = force_reg (SFmode, operands[1]);
emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
DONE;
-}")
+})
(define_insn "fix_truncsfdi2_ieee"
[(set (match_operand:DI 0 "register_operand" "=d")
(fix:DI (match_operand:SF 1 "register_operand" "f")))
- (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1)
+ (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
(clobber (reg:CC 33))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cgebr\\t%0,%h2,%1"
+ "cgebr\t%0,%h2,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "ftoi")])
@@ -2769,7 +2854,6 @@
[(set (match_operand:SI 0 "register_operand" "")
(unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "
{
rtx label1 = gen_label_rtx ();
rtx label2 = gen_label_rtx ();
@@ -2778,11 +2862,11 @@
operands[1] = force_reg (SFmode, operands[1]);
emit_insn (gen_cmpsf (operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"2147483648.0\", SFmode), SFmode)));
+ REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
emit_jump_insn (gen_blt (label1));
emit_insn (gen_subsf3 (temp, operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (
- REAL_VALUE_ATOF (\"4294967296.0\", SFmode), SFmode)));
+ REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
emit_jump (label2);
@@ -2790,13 +2874,12 @@
emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
emit_label (label2);
DONE;
-}")
+})
(define_expand "fix_truncsfsi2"
[(set (match_operand:SI 0 "register_operand" "")
(fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
if (TARGET_IBM_FLOAT)
{
@@ -2812,15 +2895,15 @@
}
DONE;
-}")
+})
(define_insn "fix_truncsfsi2_ieee"
[(set (match_operand:SI 0 "register_operand" "=d")
(fix:SI (match_operand:SF 1 "register_operand" "f")))
- (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1)
+ (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cfebr\\t%0,%h2,%1"
+ "cfebr\t%0,%h2,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "ftoi")])
@@ -2833,7 +2916,7 @@
(float:DF (match_operand:DI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cdgbr\\t%0,%1"
+ "cdgbr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "itof" )])
@@ -2846,7 +2929,7 @@
(float:SF (match_operand:DI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cegbr\\t%0,%1"
+ "cegbr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "itof" )])
@@ -2860,26 +2943,25 @@
(float:DF (match_operand:SI 1 "register_operand" "")))
(clobber (reg:CC 33))])]
"TARGET_HARD_FLOAT"
- "
{
- if (TARGET_IBM_FLOAT)
+ if (TARGET_IBM_FLOAT)
{
/* This is the algorithm from POP chapter A.5.7.1. */
rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
- rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
+ rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
DONE;
}
-}")
+})
(define_insn "floatsidf2_ieee"
[(set (match_operand:DF 0 "register_operand" "=f")
(float:DF (match_operand:SI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cdfbr\\t%0,%1"
+ "cdfbr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "itof" )])
@@ -2890,14 +2972,13 @@
(use (match_operand:BLK 3 "memory_operand" "m"))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "*
{
- output_asm_insn (\"st\\t%1,%N3\", operands);
- output_asm_insn (\"xi\\t%N3,128\", operands);
- output_asm_insn (\"mvc\\t%O3(4,%R3),%2\", operands);
- output_asm_insn (\"ld\\t%0,%3\", operands);
- return \"sd\\t%0,%2\";
-}"
+ output_asm_insn ("st\t%1,%N3", operands);
+ output_asm_insn ("xi\t%N3,128", operands);
+ output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
+ output_asm_insn ("ld\t%0,%3", operands);
+ return "sd\t%0,%2";
+}
[(set_attr "op_type" "NN")
(set_attr "type" "other" )
(set_attr "atype" "agen")
@@ -2913,7 +2994,6 @@
(float:SF (match_operand:SI 1 "register_operand" "")))
(clobber (reg:CC 33))])]
"TARGET_HARD_FLOAT"
- "
{
if (TARGET_IBM_FLOAT)
{
@@ -2923,14 +3003,14 @@
emit_insn (gen_truncdfsf2 (operands[0], temp));
DONE;
}
-}")
+})
(define_insn "floatsisf2_ieee"
[(set (match_operand:SF 0 "register_operand" "=f")
(float:SF (match_operand:SI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "cefbr\\t%0,%1"
+ "cefbr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "itof" )])
@@ -2948,7 +3028,7 @@
[(set (match_operand:SF 0 "register_operand" "=f")
(float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "ledbr\\t%0,%1"
+ "ledbr\t%0,%1"
[(set_attr "op_type" "RRE")])
(define_insn "truncdfsf2_ibm"
@@ -2956,8 +3036,8 @@
(float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- lrer\\t%0,%1
- le\\t%0,%1"
+ lrer\t%0,%1
+ le\t%0,%1"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "floads,floads")])
@@ -2969,22 +3049,21 @@
[(set (match_operand:DF 0 "register_operand" "")
(float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
if (TARGET_IBM_FLOAT)
{
emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
DONE;
}
-}")
+})
(define_insn "extendsfdf2_ieee"
[(set (match_operand:DF 0 "register_operand" "=f,f")
(float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- ldebr\\t%0,%1
- ldeb\\t%0,%1"
+ ldebr\t%0,%1
+ ldeb\t%0,%1"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "floads,floads")])
@@ -2994,12 +3073,12 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- sdr\\t%0,%0\;ler\\t%0,%1
- sdr\\t%0,%0\;le\\t%0,%1"
+ sdr\t%0,%0\;ler\t%0,%1
+ sdr\t%0,%0\;le\t%0,%1"
[(set_attr "op_type" "NN,NN")
(set_attr "atype" "reg,agen")
(set_attr "length" "4,6")
- (set_attr "type" "o2,o2")])
+ (set_attr "type" "o2,o2")])
;;
@@ -3024,12 +3103,12 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- agfr\\t%0,%2
- agf\\t%0,%2"
+ agfr\t%0,%2
+ agf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*adddi3_zero_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
(match_operand:DI 1 "register_operand" "0,0"))
(const_int 0)))
@@ -3037,20 +3116,20 @@
(plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
"s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
"@
- algfr\\t%0,%2
- algf\\t%0,%2"
+ algfr\t%0,%2
+ algf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*adddi3_zero_cconly"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
(match_operand:DI 1 "register_operand" "0,0"))
(const_int 0)))
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
"@
- algfr\\t%0,%2
- algf\\t%0,%2"
+ algfr\t%0,%2
+ algf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*adddi3_zero"
@@ -3060,25 +3139,25 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- algfr\\t%0,%2
- algf\\t%0,%2"
+ algfr\t%0,%2
+ algf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*adddi3_imm_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
(match_operand:DI 2 "const_int_operand" "K"))
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=d")
(plus:DI (match_dup 1) (match_dup 2)))]
- "TARGET_64BIT
- && s390_match_ccmode (insn, CCAmode)
+ "TARGET_64BIT
+ && s390_match_ccmode (insn, CCAmode)
&& CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
- "aghi\\t%0,%h2"
+ "aghi\t%0,%h2"
[(set_attr "op_type" "RI")])
(define_insn "*adddi3_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
(match_operand:DI 2 "general_operand" "d,m"))
(const_int 0)))
@@ -3086,31 +3165,31 @@
(plus:DI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
"@
- algr\\t%0,%2
- alg\\t%0,%2"
+ algr\t%0,%2
+ alg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*adddi3_cconly"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
(match_operand:DI 2 "general_operand" "d,m"))
(const_int 0)))
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
"@
- algr\\t%0,%2
- alg\\t%0,%2"
+ algr\t%0,%2
+ alg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*adddi3_cconly2"
- [(set (reg 33)
+ [(set (reg 33)
(compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
(neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
"@
- algr\\t%0,%2
- alg\\t%0,%2"
+ algr\t%0,%2
+ alg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*adddi3_64"
@@ -3120,9 +3199,9 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- agr\\t%0,%2
- aghi\\t%0,%h2
- ag\\t%0,%2"
+ agr\t%0,%2
+ aghi\t%0,%h2
+ ag\t%0,%2"
[(set_attr "op_type" "RRE,RI,RXY")])
(define_insn_and_split "*adddi3_31"
@@ -3172,8 +3251,8 @@
(match_operand:QI 1 "address_operand" "U,W"))]
"TARGET_64BIT"
"@
- la\\t%0,%a1
- lay\\t%0,%a1"
+ la\t%0,%a1
+ lay\t%0,%a1"
[(set_attr "op_type" "RX,RXY")
(set_attr "type" "la")])
@@ -3208,19 +3287,18 @@
(match_operand:DI 1 "s390_plus_operand" "")
(match_operand:DI 2 "register_operand" "=&a")])]
"TARGET_64BIT"
- "
{
s390_expand_plus_operand (operands[0], operands[1], operands[2]);
DONE;
-}")
+})
+
-
;
; addsi3 instruction pattern(s).
;
(define_insn "*addsi3_imm_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:SI 2 "const_int_operand" "K"))
(const_int 0)))
@@ -3228,100 +3306,100 @@
(plus:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode (insn, CCAmode)
&& CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
- "ahi\\t%0,%h2"
+ "ahi\t%0,%h2"
[(set_attr "op_type" "RI")])
(define_insn "*addsi3_carry1_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:SI 2 "general_operand" "d,R,T"))
(match_dup 1)))
(set (match_operand:SI 0 "register_operand" "=d,d,d")
(plus:SI (match_dup 1) (match_dup 2)))]
- "s390_match_ccmode (insn, CCL1mode)"
+ "s390_match_ccmode (insn, CCL1mode)"
"@
- alr\\t%0,%2
- al\\t%0,%2
- aly\\t%0,%2"
+ alr\t%0,%2
+ al\t%0,%2
+ aly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*addsi3_carry1_cconly"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:SI 2 "general_operand" "d,R,T"))
(match_dup 1)))
(clobber (match_scratch:SI 0 "=d,d,d"))]
- "s390_match_ccmode (insn, CCL1mode)"
+ "s390_match_ccmode (insn, CCL1mode)"
"@
- alr\\t%0,%2
- al\\t%0,%2
- aly\\t%0,%2"
+ alr\t%0,%2
+ al\t%0,%2
+ aly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*addsi3_carry2_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:SI 2 "general_operand" "d,R,T"))
(match_dup 2)))
(set (match_operand:SI 0 "register_operand" "=d,d,d")
(plus:SI (match_dup 1) (match_dup 2)))]
- "s390_match_ccmode (insn, CCL1mode)"
+ "s390_match_ccmode (insn, CCL1mode)"
"@
- alr\\t%0,%2
- al\\t%0,%2
- aly\\t%0,%2"
+ alr\t%0,%2
+ al\t%0,%2
+ aly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*addsi3_carry2_cconly"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:SI 2 "general_operand" "d,R,T"))
(match_dup 2)))
(clobber (match_scratch:SI 0 "=d,d,d"))]
- "s390_match_ccmode (insn, CCL1mode)"
+ "s390_match_ccmode (insn, CCL1mode)"
"@
- alr\\t%0,%2
- al\\t%0,%2
- aly\\t%0,%2"
+ alr\t%0,%2
+ al\t%0,%2
+ aly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*addsi3_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:SI 2 "general_operand" "d,R,T"))
(const_int 0)))
(set (match_operand:SI 0 "register_operand" "=d,d,d")
(plus:SI (match_dup 1) (match_dup 2)))]
- "s390_match_ccmode (insn, CCLmode)"
+ "s390_match_ccmode (insn, CCLmode)"
"@
- alr\\t%0,%2
- al\\t%0,%2
- aly\\t%0,%2"
+ alr\t%0,%2
+ al\t%0,%2
+ aly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*addsi3_cconly"
- [(set (reg 33)
+ [(set (reg 33)
(compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:SI 2 "general_operand" "d,R,T"))
(const_int 0)))
(clobber (match_scratch:SI 0 "=d,d,d"))]
- "s390_match_ccmode (insn, CCLmode)"
+ "s390_match_ccmode (insn, CCLmode)"
"@
- alr\\t%0,%2
- al\\t%0,%2
- aly\\t%0,%2"
+ alr\t%0,%2
+ al\t%0,%2
+ aly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*addsi3_cconly2"
- [(set (reg 33)
+ [(set (reg 33)
(compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
(neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
(clobber (match_scratch:SI 0 "=d,d,d"))]
"s390_match_ccmode(insn, CCLmode)"
"@
- alr\\t%0,%2
- al\\t%0,%2
- aly\\t%0,%2"
+ alr\t%0,%2
+ al\t%0,%2
+ aly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*addsi3_sign"
@@ -3331,8 +3409,8 @@
(clobber (reg:CC 33))]
""
"@
- ah\\t%0,%2
- ahy\\t%0,%2"
+ ah\t%0,%2
+ ahy\t%0,%2"
[(set_attr "op_type" "RX,RXY")])
(define_insn "*addsi3_sub"
@@ -3342,8 +3420,8 @@
(clobber (reg:CC 33))]
""
"@
- ah\\t%0,%2
- ahy\\t%0,%2"
+ ah\t%0,%2
+ ahy\t%0,%2"
[(set_attr "op_type" "RX,RXY")])
(define_insn "addsi3"
@@ -3353,10 +3431,10 @@
(clobber (reg:CC 33))]
""
"@
- ar\\t%0,%2
- ahi\\t%0,%h2
- a\\t%0,%2
- ay\\t%0,%2"
+ ar\t%0,%2
+ ahi\t%0,%h2
+ a\t%0,%2
+ ay\t%0,%2"
[(set_attr "op_type" "RR,RI,RX,RXY")])
(define_insn "*la_31"
@@ -3364,8 +3442,8 @@
(match_operand:QI 1 "address_operand" "U,W"))]
"!TARGET_64BIT && legitimate_la_operand_p (operands[1])"
"@
- la\\t%0,%a1
- lay\\t%0,%a1"
+ la\t%0,%a1
+ lay\t%0,%a1"
[(set_attr "op_type" "RX,RXY")
(set_attr "type" "la")])
@@ -3401,8 +3479,8 @@
(const_int 2147483647)))]
"!TARGET_64BIT"
"@
- la\\t%0,%a1
- lay\\t%0,%a1"
+ la\t%0,%a1
+ lay\t%0,%a1"
[(set_attr "op_type" "RX,RXY")
(set_attr "type" "la")])
@@ -3414,7 +3492,7 @@
"!TARGET_64BIT"
"#"
"&& reload_completed"
- [(set (match_dup 0)
+ [(set (match_dup 0)
(and:SI (match_dup 1) (const_int 2147483647)))]
""
[(set_attr "op_type" "RX")
@@ -3426,8 +3504,8 @@
(use (const_int 0))]
"!TARGET_64BIT"
"@
- la\\t%0,%a1
- lay\\t%0,%a1"
+ la\t%0,%a1
+ lay\t%0,%a1"
[(set_attr "op_type" "RX")
(set_attr "type" "la")])
@@ -3436,11 +3514,10 @@
(match_operand:SI 1 "s390_plus_operand" "")
(match_operand:SI 2 "register_operand" "=&a")])]
"!TARGET_64BIT"
- "
{
s390_expand_plus_operand (operands[0], operands[1], operands[2]);
DONE;
-}")
+})
;
@@ -3463,8 +3540,35 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- adbr\\t%0,%2
- adb\\t%0,%2"
+ adbr\t%0,%2
+ adb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimpd,fsimpd")])
+
+(define_insn "*adddf3_cc"
+ [(set (reg 33)
+ (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:DF 2 "general_operand" "f,R"))
+ (match_operand:DF 3 "const0_operand" "")))
+ (set (match_operand:DF 0 "register_operand" "=f,f")
+ (plus:DF (match_dup 1) (match_dup 2)))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ adbr\t%0,%2
+ adb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimpd,fsimpd")])
+
+(define_insn "*adddf3_cconly"
+ [(set (reg 33)
+ (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:DF 2 "general_operand" "f,R"))
+ (match_operand:DF 3 "const0_operand" "")))
+ (clobber (match_scratch:DF 0 "=f,f"))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ adbr\t%0,%2
+ adb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fsimpd,fsimpd")])
@@ -3475,8 +3579,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- adr\\t%0,%2
- ad\\t%0,%2"
+ adr\t%0,%2
+ ad\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fsimpd,fsimpd")])
@@ -3500,8 +3604,35 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- aebr\\t%0,%2
- aeb\\t%0,%2"
+ aebr\t%0,%2
+ aeb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimps,fsimps")])
+
+(define_insn "*addsf3_cc"
+ [(set (reg 33)
+ (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:SF 2 "general_operand" "f,R"))
+ (match_operand:SF 3 "const0_operand" "")))
+ (set (match_operand:SF 0 "register_operand" "=f,f")
+ (plus:SF (match_dup 1) (match_dup 2)))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ aebr\t%0,%2
+ aeb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimps,fsimps")])
+
+(define_insn "*addsf3_cconly"
+ [(set (reg 33)
+ (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:SF 2 "general_operand" "f,R"))
+ (match_operand:SF 3 "const0_operand" "")))
+ (clobber (match_scratch:SF 0 "=f,f"))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ aebr\t%0,%2
+ aeb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fsimps,fsimps")])
@@ -3512,8 +3643,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- aer\\t%0,%2
- ae\\t%0,%2"
+ aer\t%0,%2
+ ae\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fsimps,fsimps")])
@@ -3533,12 +3664,12 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- sgfr\\t%0,%2
- sgf\\t%0,%2"
+ sgfr\t%0,%2
+ sgf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*subdi3_zero_cc"
- [(set (reg 33)
+ [(set (reg 33)
(compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
(zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
(const_int 0)))
@@ -3546,20 +3677,20 @@
(minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
"s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
"@
- slgfr\\t%0,%2
- slgf\\t%0,%2"
+ slgfr\t%0,%2
+ slgf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*subdi3_zero_cconly"
- [(set (reg 33)
+ [(set (reg 33)
(compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
(zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
(const_int 0)))
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
"@
- slgfr\\t%0,%2
- slgf\\t%0,%2"
+ slgfr\t%0,%2
+ slgf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*subdi3_zero"
@@ -3569,8 +3700,8 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- slgfr\\t%0,%2
- slgf\\t%0,%2"
+ slgfr\t%0,%2
+ slgf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*subdi3_cc"
@@ -3582,8 +3713,8 @@
(minus:DI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode (insn, CCLmode)"
"@
- slgr\\t%0,%2
- slg\\t%0,%2"
+ slgr\t%0,%2
+ slg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*subdi3_cconly"
@@ -3594,8 +3725,8 @@
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode (insn, CCLmode)"
"@
- slgr\\t%0,%2
- slg\\t%0,%2"
+ slgr\t%0,%2
+ slg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*subdi3_64"
@@ -3605,8 +3736,8 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- sgr\\t%0,%2
- sg\\t%0,%2"
+ sgr\t%0,%2
+ sg\t%0,%2"
[(set_attr "op_type" "RRE,RRE")])
(define_insn_and_split "*subdi3_31"
@@ -3664,9 +3795,9 @@
(minus:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCL2mode)"
"@
- slr\\t%0,%2
- sl\\t%0,%2
- sly\\t%0,%2"
+ slr\t%0,%2
+ sl\t%0,%2
+ sly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*subsi3_borrow_cconly"
@@ -3677,9 +3808,9 @@
(clobber (match_scratch:SI 0 "=d,d,d"))]
"s390_match_ccmode(insn, CCL2mode)"
"@
- slr\\t%0,%2
- sl\\t%0,%2
- sly\\t%0,%2"
+ slr\t%0,%2
+ sl\t%0,%2
+ sly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXE")])
(define_insn "*subsi3_cc"
@@ -3691,9 +3822,9 @@
(minus:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCLmode)"
"@
- slr\\t%0,%2
- sl\\t%0,%2
- sly\\t%0,%2"
+ slr\t%0,%2
+ sl\t%0,%2
+ sly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*subsi3_cconly"
@@ -3704,9 +3835,9 @@
(clobber (match_scratch:SI 0 "=d,d,d"))]
"s390_match_ccmode(insn, CCLmode)"
"@
- slr\\t%0,%2
- sl\\t%0,%2
- sly\\t%0,%2"
+ slr\t%0,%2
+ sl\t%0,%2
+ sly\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*subsi3_sign"
@@ -3716,8 +3847,8 @@
(clobber (reg:CC 33))]
""
"@
- sh\\t%0,%2
- shy\\t%0,%2"
+ sh\t%0,%2
+ shy\t%0,%2"
[(set_attr "op_type" "RX,RXY")])
(define_insn "*subsi3_sub"
@@ -3727,8 +3858,8 @@
(clobber (reg:CC 33))]
""
"@
- sh\\t%0,%2
- shy\\t%0,%2"
+ sh\t%0,%2
+ shy\t%0,%2"
[(set_attr "op_type" "RX,RXY")])
(define_insn "subsi3"
@@ -3738,9 +3869,9 @@
(clobber (reg:CC 33))]
""
"@
- sr\\t%0,%2
- s\\t%0,%2
- sy\\t%0,%2"
+ sr\t%0,%2
+ s\t%0,%2
+ sy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
@@ -3764,8 +3895,35 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- sdbr\\t%0,%2
- sdb\\t%0,%2"
+ sdbr\t%0,%2
+ sdb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimpd,fsimpd")])
+
+(define_insn "*subdf3_cc"
+ [(set (reg 33)
+ (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:DF 2 "general_operand" "f,R"))
+ (match_operand:DF 3 "const0_operand" "")))
+ (set (match_operand:DF 0 "register_operand" "=f,f")
+ (plus:DF (match_dup 1) (match_dup 2)))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ sdbr\t%0,%2
+ sdb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimpd,fsimpd")])
+
+(define_insn "*subdf3_cconly"
+ [(set (reg 33)
+ (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:DF 2 "general_operand" "f,R"))
+ (match_operand:DF 3 "const0_operand" "")))
+ (clobber (match_scratch:DF 0 "=f,f"))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ sdbr\t%0,%2
+ sdb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fsimpd,fsimpd")])
@@ -3776,8 +3934,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- sdr\\t%0,%2
- sd\\t%0,%2"
+ sdr\t%0,%2
+ sd\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fsimpd,fsimpd")])
@@ -3801,8 +3959,35 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- sebr\\t%0,%2
- seb\\t%0,%2"
+ sebr\t%0,%2
+ seb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimps,fsimps")])
+
+(define_insn "*subsf3_cc"
+ [(set (reg 33)
+ (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:SF 2 "general_operand" "f,R"))
+ (match_operand:SF 3 "const0_operand" "")))
+ (set (match_operand:SF 0 "register_operand" "=f,f")
+ (minus:SF (match_dup 1) (match_dup 2)))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ sebr\t%0,%2
+ seb\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fsimps,fsimps")])
+
+(define_insn "*subsf3_cconly"
+ [(set (reg 33)
+ (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
+ (match_operand:SF 2 "general_operand" "f,R"))
+ (match_operand:SF 3 "const0_operand" "")))
+ (clobber (match_scratch:SF 0 "=f,f"))]
+ "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ sebr\t%0,%2
+ seb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fsimps,fsimps")])
@@ -3813,8 +3998,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- ser\\t%0,%2
- se\\t%0,%2"
+ ser\t%0,%2
+ se\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fsimps,fsimps")])
@@ -3833,21 +4018,20 @@
(match_operand:DI 1 "register_operand" "0,0")))]
"TARGET_64BIT"
"@
- msgfr\\t%0,%2
- msgf\\t%0,%2"
+ msgfr\t%0,%2
+ msgf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")
(set_attr "type" "imul")])
-
(define_insn "muldi3"
[(set (match_operand:DI 0 "register_operand" "=d,d,d")
(mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:DI 2 "general_operand" "d,K,m")))]
"TARGET_64BIT"
"@
- msgr\\t%0,%2
- mghi\\t%0,%h2
- msg\\t%0,%2"
+ msgr\t%0,%2
+ mghi\t%0,%h2
+ msg\t%0,%2"
[(set_attr "op_type" "RRE,RI,RXY")
(set_attr "type" "imul")])
@@ -3855,16 +4039,25 @@
; mulsi3 instruction pattern(s).
;
+(define_insn "*mulsi3_sign"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
+ (match_operand:SI 1 "register_operand" "0")))]
+ ""
+ "mh\t%0,%2"
+ [(set_attr "op_type" "RX")
+ (set_attr "type" "imul")])
+
(define_insn "mulsi3"
[(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
(mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
(match_operand:SI 2 "general_operand" "d,K,R,T")))]
""
"@
- msr\\t%0,%2
- mhi\\t%0,%h2
- ms\\t%0,%2
- msy\\t%0,%2"
+ msr\t%0,%2
+ mhi\t%0,%h2
+ ms\t%0,%2
+ msy\t%0,%2"
[(set_attr "op_type" "RRE,RI,RX,RXY")
(set_attr "type" "imul")])
@@ -3872,40 +4065,36 @@
; mulsidi3 instruction pattern(s).
;
-(define_expand "mulsidi3"
- [(set (match_operand:DI 0 "register_operand" "")
- (mult:DI (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" ""))
- (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" ""))))]
+(define_insn "mulsidi3"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (mult:DI (sign_extend:DI
+ (match_operand:SI 1 "register_operand" "%0,0"))
+ (sign_extend:DI
+ (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
"!TARGET_64BIT"
- "
-{
- rtx insn;
+ "@
+ mr\t%0,%2
+ m\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "type" "imul")])
- emit_insn (gen_zero_extendsidi2 (operands[0], operands[1]));
- insn = emit_insn (gen_mulsi_6432 (operands[0], operands[0], operands[2]));
+;
+; umulsidi3 instruction pattern(s).
+;
- REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_EQUAL,
- gen_rtx_MULT (DImode,
- gen_rtx_SIGN_EXTEND (DImode, operands[1]),
- gen_rtx_SIGN_EXTEND (DImode, operands[2])),
- REG_NOTES (insn));
- DONE;
-}")
-
-(define_insn "mulsi_6432"
- [(set (match_operand:DI 0 "register_operand" "=d,d")
- (mult:DI (sign_extend:DI
- (truncate:SI (match_operand:DI 1 "register_operand" "0,0")))
- (sign_extend:DI
- (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
- "!TARGET_64BIT"
- "@
- mr\\t%0,%2
- m\\t%0,%2"
- [(set_attr "op_type" "RR,RX")
+(define_insn "umulsidi3"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (mult:DI (zero_extend:DI
+ (match_operand:SI 1 "register_operand" "%0,0"))
+ (zero_extend:DI
+ (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
+ "!TARGET_64BIT && TARGET_CPU_ZARCH"
+ "@
+ mlr\t%0,%2
+ ml\t%0,%2"
+ [(set_attr "op_type" "RRE,RXY")
(set_attr "type" "imul")])
-
+
;
; muldf3 instruction pattern(s).
;
@@ -3926,8 +4115,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- mdbr\\t%0,%2
- mdb\\t%0,%2"
+ mdbr\t%0,%2
+ mdb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fmuld")])
@@ -3938,11 +4127,35 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- mdr\\t%0,%2
- md\\t%0,%2"
+ mdr\t%0,%2
+ md\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fmuld")])
+(define_insn "*fmadddf"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
+ (match_operand:DF 2 "nonimmediate_operand" "f,R"))
+ (match_operand:DF 3 "register_operand" "0,0")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
+ "@
+ madbr\t%0,%1,%2
+ madb\t%0,%1,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fmuld")])
+
+(define_insn "*fmsubdf"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
+ (match_operand:DF 2 "nonimmediate_operand" "f,R"))
+ (match_operand:DF 3 "register_operand" "0,0")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
+ "@
+ msdbr\t%0,%1,%2
+ msdb\t%0,%1,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fmuld")])
+
;
; mulsf3 instruction pattern(s).
;
@@ -3963,8 +4176,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- meebr\\t%0,%2
- meeb\\t%0,%2"
+ meebr\t%0,%2
+ meeb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fmuls")])
@@ -3975,11 +4188,34 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- mer\\t%0,%2
- me\\t%0,%2"
+ mer\t%0,%2
+ me\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fmuls")])
+(define_insn "*fmaddsf"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
+ (match_operand:SF 2 "nonimmediate_operand" "f,R"))
+ (match_operand:SF 3 "register_operand" "0,0")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
+ "@
+ maebr\t%0,%1,%2
+ maeb\t%0,%1,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fmuls")])
+
+(define_insn "*fmsubsf"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
+ (match_operand:SF 2 "nonimmediate_operand" "f,R"))
+ (match_operand:SF 3 "register_operand" "0,0")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
+ "@
+ msebr\t%0,%1,%2
+ mseb\t%0,%1,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "type" "fmuls")])
;;
;;- Divide and modulo instructions.
@@ -3991,31 +4227,20 @@
(define_expand "divmoddi4"
[(parallel [(set (match_operand:DI 0 "general_operand" "")
- (div:DI (match_operand:DI 1 "general_operand" "")
+ (div:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "general_operand" "")))
(set (match_operand:DI 3 "general_operand" "")
(mod:DI (match_dup 1) (match_dup 2)))])
(clobber (match_dup 4))]
"TARGET_64BIT"
- "
{
- rtx insn, div_equal, mod_equal, equal;
+ rtx insn, div_equal, mod_equal;
div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
- equal = gen_rtx_IOR (TImode,
- gen_rtx_ZERO_EXTEND (TImode, div_equal),
- gen_rtx_ASHIFT (TImode,
- gen_rtx_ZERO_EXTEND (TImode, mod_equal),
- GEN_INT (64)));
operands[4] = gen_reg_rtx(TImode);
- emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
- emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
- emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
- insn = emit_insn (gen_divmodtidi3 (operands[4], operands[4], operands[2]));
- REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
+ emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
REG_NOTES (insn) =
@@ -4026,23 +4251,23 @@
gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
DONE;
-}")
+})
(define_insn "divmodtidi3"
[(set (match_operand:TI 0 "register_operand" "=d,d")
(ior:TI
(zero_extend:TI
- (div:DI (truncate:DI (match_operand:TI 1 "register_operand" "0,0"))
+ (div:DI (match_operand:DI 1 "register_operand" "0,0")
(match_operand:DI 2 "general_operand" "d,m")))
(ashift:TI
(zero_extend:TI
- (mod:DI (truncate:DI (match_dup 1))
+ (mod:DI (match_dup 1)
(match_dup 2)))
(const_int 64))))]
"TARGET_64BIT"
"@
- dsgr\\t%0,%2
- dsg\\t%0,%2"
+ dsgr\t%0,%2
+ dsg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")
(set_attr "type" "idiv")])
@@ -4050,17 +4275,17 @@
[(set (match_operand:TI 0 "register_operand" "=d,d")
(ior:TI
(zero_extend:TI
- (div:DI (truncate:DI (match_operand:TI 1 "register_operand" "0,0"))
+ (div:DI (match_operand:DI 1 "register_operand" "0,0")
(sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
(ashift:TI
(zero_extend:TI
- (mod:DI (truncate:DI (match_dup 1))
+ (mod:DI (match_dup 1)
(sign_extend:DI (match_dup 2))))
(const_int 64))))]
"TARGET_64BIT"
"@
- dsgfr\\t%0,%2
- dsgf\\t%0,%2"
+ dsgfr\t%0,%2
+ dsgf\t%0,%2"
[(set_attr "op_type" "RRE,RXY")
(set_attr "type" "idiv")])
@@ -4076,7 +4301,6 @@
(umod:DI (match_dup 1) (match_dup 2)))])
(clobber (match_dup 4))]
"TARGET_64BIT"
- "
{
rtx insn, div_equal, mod_equal, equal;
@@ -4105,11 +4329,11 @@
gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
DONE;
-}")
+})
(define_insn "udivmodtidi3"
[(set (match_operand:TI 0 "register_operand" "=d,d")
- (ior:TI (zero_extend:TI
+ (ior:TI (zero_extend:TI
(truncate:DI
(udiv:TI (match_operand:TI 1 "register_operand" "0,0")
(zero_extend:TI
@@ -4121,8 +4345,8 @@
(const_int 64))))]
"TARGET_64BIT"
"@
- dlgr\\t%0,%2
- dlg\\t%0,%2"
+ dlgr\t%0,%2
+ dlg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")
(set_attr "type" "idiv")])
@@ -4138,7 +4362,6 @@
(mod:SI (match_dup 1) (match_dup 2)))])
(clobber (match_dup 4))]
"!TARGET_64BIT"
- "
{
rtx insn, div_equal, mod_equal, equal;
@@ -4165,14 +4388,14 @@
gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
DONE;
-}")
+})
(define_insn "divmoddisi3"
[(set (match_operand:DI 0 "register_operand" "=d,d")
(ior:DI (zero_extend:DI
(truncate:SI
(div:DI (match_operand:DI 1 "register_operand" "0,0")
- (sign_extend:DI
+ (sign_extend:DI
(match_operand:SI 2 "nonimmediate_operand" "d,R")))))
(ashift:DI
(zero_extend:DI
@@ -4181,8 +4404,8 @@
(const_int 32))))]
"!TARGET_64BIT"
"@
- dr\\t%0,%2
- d\\t%0,%2"
+ dr\t%0,%2
+ d\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "idiv")])
@@ -4190,14 +4413,69 @@
; udivsi3 and umodsi3 instruction pattern(s).
;
+(define_expand "udivmodsi4"
+ [(parallel [(set (match_operand:SI 0 "general_operand" "")
+ (udiv:SI (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "nonimmediate_operand" "")))
+ (set (match_operand:SI 3 "general_operand" "")
+ (umod:SI (match_dup 1) (match_dup 2)))])
+ (clobber (match_dup 4))]
+ "!TARGET_64BIT && TARGET_CPU_ZARCH"
+{
+ rtx insn, div_equal, mod_equal, equal;
+
+ div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
+ mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
+ equal = gen_rtx_IOR (DImode,
+ gen_rtx_ZERO_EXTEND (DImode, div_equal),
+ gen_rtx_ASHIFT (DImode,
+ gen_rtx_ZERO_EXTEND (DImode, mod_equal),
+ GEN_INT (32)));
+
+ operands[4] = gen_reg_rtx(DImode);
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
+ emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
+ emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
+ insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
+ REG_NOTES (insn) =
+ gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
+
+ insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
+ REG_NOTES (insn) =
+ gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
+
+ insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
+ REG_NOTES (insn) =
+ gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
+
+ DONE;
+})
+
+(define_insn "udivmoddisi3"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (ior:DI (zero_extend:DI
+ (truncate:SI
+ (udiv:DI (match_operand:DI 1 "register_operand" "0,0")
+ (zero_extend:DI
+ (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
+ (ashift:DI
+ (zero_extend:DI
+ (truncate:SI
+ (umod:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))
+ (const_int 32))))]
+ "!TARGET_64BIT && TARGET_CPU_ZARCH"
+ "@
+ dlr\t%0,%2
+ dl\t%0,%2"
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "type" "idiv")])
(define_expand "udivsi3"
[(set (match_operand:SI 0 "register_operand" "=d")
(udiv:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" "")))
(clobber (match_dup 3))]
- "!TARGET_64BIT"
- "
+ "!TARGET_64BIT && !TARGET_CPU_ZARCH"
{
rtx insn, udiv_equal, umod_equal, equal;
@@ -4226,32 +4504,32 @@
}
else
{
- operands[2] = force_reg (SImode, operands[2]);
- operands[2] = make_safe_from (operands[2], operands[0]);
+ operands[2] = force_reg (SImode, operands[2]);
+ operands[2] = make_safe_from (operands[2], operands[0]);
emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
operands[2]));
REG_NOTES (insn) =
gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
-
- insn = emit_move_insn (operands[0],
+
+ insn = emit_move_insn (operands[0],
gen_lowpart (SImode, operands[3]));
REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_EXPR_LIST (REG_EQUAL,
udiv_equal, REG_NOTES (insn));
}
}
else
- {
+ {
rtx label1 = gen_label_rtx ();
rtx label2 = gen_label_rtx ();
rtx label3 = gen_label_rtx ();
- operands[1] = force_reg (SImode, operands[1]);
- operands[1] = make_safe_from (operands[1], operands[0]);
- operands[2] = force_reg (SImode, operands[2]);
- operands[2] = make_safe_from (operands[2], operands[0]);
+ operands[1] = force_reg (SImode, operands[1]);
+ operands[1] = make_safe_from (operands[1], operands[0]);
+ operands[2] = force_reg (SImode, operands[2]);
+ operands[2] = make_safe_from (operands[2], operands[0]);
emit_move_insn (operands[0], const0_rtx);
emit_insn (gen_cmpsi (operands[2], operands[1]));
@@ -4265,11 +4543,11 @@
operands[2]));
REG_NOTES (insn) =
gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
-
- insn = emit_move_insn (operands[0],
+
+ insn = emit_move_insn (operands[0],
gen_lowpart (SImode, operands[3]));
REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_EXPR_LIST (REG_EQUAL,
udiv_equal, REG_NOTES (insn));
emit_jump (label3);
emit_label (label1);
@@ -4279,17 +4557,16 @@
emit_move_insn (operands[0], const1_rtx);
emit_label (label3);
}
- emit_move_insn (operands[0], operands[0]);
+ emit_move_insn (operands[0], operands[0]);
DONE;
-}")
+})
(define_expand "umodsi3"
[(set (match_operand:SI 0 "register_operand" "=d")
(umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
(match_operand:SI 2 "nonimmediate_operand" "")))
(clobber (match_dup 3))]
- "!TARGET_64BIT"
- "
+ "!TARGET_64BIT && !TARGET_CPU_ZARCH"
{
rtx insn, udiv_equal, umod_equal, equal;
@@ -4319,19 +4596,19 @@
}
else
{
- operands[2] = force_reg (SImode, operands[2]);
- operands[2] = make_safe_from (operands[2], operands[0]);
+ operands[2] = force_reg (SImode, operands[2]);
+ operands[2] = make_safe_from (operands[2], operands[0]);
emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
operands[2]));
REG_NOTES (insn) =
gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
-
- insn = emit_move_insn (operands[0],
+
+ insn = emit_move_insn (operands[0],
gen_highpart (SImode, operands[3]));
REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_EXPR_LIST (REG_EQUAL,
umod_equal, REG_NOTES (insn));
}
}
@@ -4341,12 +4618,12 @@
rtx label2 = gen_label_rtx ();
rtx label3 = gen_label_rtx ();
- operands[1] = force_reg (SImode, operands[1]);
- operands[1] = make_safe_from (operands[1], operands[0]);
- operands[2] = force_reg (SImode, operands[2]);
- operands[2] = make_safe_from (operands[2], operands[0]);
+ operands[1] = force_reg (SImode, operands[1]);
+ operands[1] = make_safe_from (operands[1], operands[0]);
+ operands[2] = force_reg (SImode, operands[2]);
+ operands[2] = make_safe_from (operands[2], operands[0]);
- emit_move_insn(operands[0], operands[1]);
+ emit_move_insn(operands[0], operands[1]);
emit_insn (gen_cmpsi (operands[2], operands[1]));
emit_jump_insn (gen_bgtu (label3));
emit_insn (gen_cmpsi (operands[2], const1_rtx));
@@ -4358,11 +4635,11 @@
operands[2]));
REG_NOTES (insn) =
gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
-
- insn = emit_move_insn (operands[0],
+
+ insn = emit_move_insn (operands[0],
gen_highpart (SImode, operands[3]));
REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_EXPR_LIST (REG_EQUAL,
umod_equal, REG_NOTES (insn));
emit_jump (label3);
emit_label (label1);
@@ -4373,7 +4650,7 @@
emit_label (label3);
}
DONE;
-}")
+})
;
; divdf3 instruction pattern(s).
@@ -4395,8 +4672,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- ddbr\\t%0,%2
- ddb\\t%0,%2"
+ ddbr\t%0,%2
+ ddb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fdivd")])
@@ -4407,8 +4684,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- ddr\\t%0,%2
- dd\\t%0,%2"
+ ddr\t%0,%2
+ dd\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fdivd")])
@@ -4432,8 +4709,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- debr\\t%0,%2
- deb\\t%0,%2"
+ debr\t%0,%2
+ deb\t%0,%2"
[(set_attr "op_type" "RRE,RXE")
(set_attr "type" "fdivs")])
@@ -4444,8 +4721,8 @@
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
"@
- der\\t%0,%2
- de\\t%0,%2"
+ der\t%0,%2
+ de\t%0,%2"
[(set_attr "op_type" "RR,RX")
(set_attr "type" "fdivs")])
@@ -4467,8 +4744,8 @@
(and:DI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
"@
- ngr\\t%0,%2
- ng\\t%0,%2"
+ ngr\t%0,%2
+ ng\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*anddi3_cconly"
@@ -4479,8 +4756,8 @@
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
"@
- ngr\\t%0,%2
- ng\\t%0,%2"
+ ngr\t%0,%2
+ ng\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*anddi3_ni"
@@ -4489,20 +4766,19 @@
(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\";
+ 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"
@@ -4512,8 +4788,8 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- ngr\\t%0,%2
- ng\\t%0,%2"
+ ngr\t%0,%2
+ ng\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*anddi3_ss"
@@ -4522,7 +4798,7 @@
(match_operand:DI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "nc\\t%O0(8,%R0),%1"
+ "nc\t%O0(8,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*anddi3_ss_inv"
@@ -4531,7 +4807,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "nc\\t%O0(8,%R0),%1"
+ "nc\t%O0(8,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -4547,9 +4823,9 @@
(and:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCTmode)"
"@
- nr\\t%0,%2
- n\\t%0,%2
- ny\\t%0,%2"
+ nr\t%0,%2
+ n\t%0,%2
+ ny\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*andsi3_cconly"
@@ -4560,9 +4836,9 @@
(clobber (match_scratch:SI 0 "=d,d,d"))]
"s390_match_ccmode(insn, CCTmode)"
"@
- nr\\t%0,%2
- n\\t%0,%2
- ny\\t%0,%2"
+ nr\t%0,%2
+ n\t%0,%2
+ ny\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*andsi3_ni"
@@ -4570,19 +4846,18 @@
(and:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:SI 2 "immediate_operand" "n")))
(clobber (reg:CC 33))]
- "TARGET_64BIT && s390_single_hi (operands[2], SImode, -1) >= 0"
- "*
+ "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\";
+ case 0: return "nilh\t%0,%x2";
+ case 1: return "nill\t%0,%x2";
default: abort ();
}
-}"
+}
[(set_attr "op_type" "RI")])
(define_insn "andsi3"
@@ -4592,9 +4867,9 @@
(clobber (reg:CC 33))]
""
"@
- nr\\t%0,%2
- n\\t%0,%2
- ny\\t%0,%2"
+ nr\t%0,%2
+ n\t%0,%2
+ ny\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*andsi3_ss"
@@ -4603,7 +4878,7 @@
(match_operand:SI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "nc\\t%O0(4,%R0),%1"
+ "nc\t%O0(4,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*andsi3_ss_inv"
@@ -4612,7 +4887,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "nc\\t%O0(4,%R0),%1"
+ "nc\t%O0(4,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -4624,10 +4899,10 @@
(and:HI (match_operand:HI 1 "register_operand" "%0,0")
(match_operand:HI 2 "nonmemory_operand" "d,n")))
(clobber (reg:CC 33))]
- "TARGET_64BIT"
+ "TARGET_ZARCH"
"@
- nr\\t%0,%2
- nill\\t%0,%x2"
+ nr\t%0,%2
+ nill\t%0,%x2"
[(set_attr "op_type" "RR,RI")])
(define_insn "andhi3"
@@ -4636,7 +4911,7 @@
(match_operand:HI 2 "nonmemory_operand" "d")))
(clobber (reg:CC 33))]
""
- "nr\\t%0,%2"
+ "nr\t%0,%2"
[(set_attr "op_type" "RR")])
(define_insn "*andhi3_ss"
@@ -4645,7 +4920,7 @@
(match_operand:HI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "nc\\t%O0(2,%R0),%1"
+ "nc\t%O0(2,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*andhi3_ss_inv"
@@ -4654,7 +4929,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "nc\\t%O0(2,%R0),%1"
+ "nc\t%O0(2,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -4666,10 +4941,10 @@
(and:QI (match_operand:QI 1 "register_operand" "%0,0")
(match_operand:QI 2 "nonmemory_operand" "d,n")))
(clobber (reg:CC 33))]
- "TARGET_64BIT"
+ "TARGET_ZARCH"
"@
- nr\\t%0,%2
- nill\\t%0,%b2"
+ nr\t%0,%2
+ nill\t%0,%b2"
[(set_attr "op_type" "RR,RI")])
(define_insn "andqi3"
@@ -4678,7 +4953,7 @@
(match_operand:QI 2 "nonmemory_operand" "d")))
(clobber (reg:CC 33))]
""
- "nr\\t%0,%2"
+ "nr\t%0,%2"
[(set_attr "op_type" "RR")])
(define_insn "*andqi3_ss"
@@ -4688,9 +4963,9 @@
(clobber (reg:CC 33))]
""
"@
- ni\\t%0,%b1
- niy\\t%0,%b1
- nc\\t%O0(1,%R0),%1"
+ ni\t%0,%b1
+ niy\t%0,%b1
+ nc\t%O0(1,%R0),%1"
[(set_attr "op_type" "SI,SIY,SS")])
(define_insn "*andqi3_ss_inv"
@@ -4700,9 +4975,9 @@
(clobber (reg:CC 33))]
""
"@
- ni\\t%0,%b1
- niy\\t%0,%b1
- nc\\t%O0(1,%R0),%1"
+ ni\t%0,%b1
+ niy\t%0,%b1
+ nc\t%O0(1,%R0),%1"
[(set_attr "op_type" "SI,SIY,SS")])
@@ -4723,8 +4998,8 @@
(ior:DI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
"@
- ogr\\t%0,%2
- og\\t%0,%2"
+ ogr\t%0,%2
+ og\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*iordi3_cconly"
@@ -4735,8 +5010,8 @@
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
"@
- ogr\\t%0,%2
- og\\t%0,%2"
+ ogr\t%0,%2
+ og\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*iordi3_oi"
@@ -4745,20 +5020,19 @@
(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\";
+ 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"
@@ -4768,8 +5042,8 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- ogr\\t%0,%2
- og\\t%0,%2"
+ ogr\t%0,%2
+ og\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*iordi3_ss"
@@ -4778,7 +5052,7 @@
(match_operand:DI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "oc\\t%O0(8,%R0),%1"
+ "oc\t%O0(8,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*iordi3_ss_inv"
@@ -4787,7 +5061,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "oc\\t%O0(8,%R0),%1"
+ "oc\t%O0(8,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -4803,9 +5077,9 @@
(ior:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCTmode)"
"@
- or\\t%0,%2
- o\\t%0,%2
- oy\\t%0,%2"
+ or\t%0,%2
+ o\t%0,%2
+ oy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*iorsi3_cconly"
@@ -4816,9 +5090,9 @@
(clobber (match_scratch:SI 0 "=d,d,d"))]
"s390_match_ccmode(insn, CCTmode)"
"@
- or\\t%0,%2
- o\\t%0,%2
- oy\\t%0,%2"
+ or\t%0,%2
+ o\t%0,%2
+ oy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*iorsi3_oi"
@@ -4826,19 +5100,18 @@
(ior:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:SI 2 "immediate_operand" "n")))
(clobber (reg:CC 33))]
- "TARGET_64BIT && s390_single_hi (operands[2], SImode, 0) >= 0"
- "*
+ "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\";
+ case 0: return "oilh\t%0,%x2";
+ case 1: return "oill\t%0,%x2";
default: abort ();
}
-}"
+}
[(set_attr "op_type" "RI")])
(define_insn "iorsi3"
@@ -4848,9 +5121,9 @@
(clobber (reg:CC 33))]
""
"@
- or\\t%0,%2
- o\\t%0,%2
- oy\\t%0,%2"
+ or\t%0,%2
+ o\t%0,%2
+ oy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*iorsi3_ss"
@@ -4859,7 +5132,7 @@
(match_operand:SI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "oc\\t%O0(4,%R0),%1"
+ "oc\t%O0(4,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*iorsi3_ss_inv"
@@ -4868,7 +5141,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "oc\\t%O0(4,%R0),%1"
+ "oc\t%O0(4,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -4880,10 +5153,10 @@
(ior:HI (match_operand:HI 1 "register_operand" "%0,0")
(match_operand:HI 2 "nonmemory_operand" "d,n")))
(clobber (reg:CC 33))]
- "TARGET_64BIT"
+ "TARGET_ZARCH"
"@
- or\\t%0,%2
- oill\\t%0,%x2"
+ or\t%0,%2
+ oill\t%0,%x2"
[(set_attr "op_type" "RR,RI")])
(define_insn "iorhi3"
@@ -4892,7 +5165,7 @@
(match_operand:HI 2 "nonmemory_operand" "d")))
(clobber (reg:CC 33))]
""
- "or\\t%0,%2"
+ "or\t%0,%2"
[(set_attr "op_type" "RR")])
(define_insn "*iorhi3_ss"
@@ -4901,7 +5174,7 @@
(match_operand:HI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "oc\\t%O0(2,%R0),%1"
+ "oc\t%O0(2,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*iorhi3_ss_inv"
@@ -4910,7 +5183,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "oc\\t%O0(2,%R0),%1"
+ "oc\t%O0(2,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -4922,10 +5195,10 @@
(ior:QI (match_operand:QI 1 "register_operand" "%0,0")
(match_operand:QI 2 "nonmemory_operand" "d,n")))
(clobber (reg:CC 33))]
- "TARGET_64BIT"
+ "TARGET_ZARCH"
"@
- or\\t%0,%2
- oill\\t%0,%b2"
+ or\t%0,%2
+ oill\t%0,%b2"
[(set_attr "op_type" "RR,RI")])
(define_insn "iorqi3"
@@ -4934,7 +5207,7 @@
(match_operand:QI 2 "nonmemory_operand" "d")))
(clobber (reg:CC 33))]
""
- "or\\t%0,%2"
+ "or\t%0,%2"
[(set_attr "op_type" "RR")])
(define_insn "*iorqi3_ss"
@@ -4944,9 +5217,9 @@
(clobber (reg:CC 33))]
""
"@
- oi\\t%0,%b1
- oiy\\t%0,%b1
- oc\\t%O0(1,%R0),%1"
+ oi\t%0,%b1
+ oiy\t%0,%b1
+ oc\t%O0(1,%R0),%1"
[(set_attr "op_type" "SI,SIY,SS")])
(define_insn "*iorqi3_ss_inv"
@@ -4956,9 +5229,9 @@
(clobber (reg:CC 33))]
""
"@
- oi\\t%0,%b1
- oiy\\t%0,%b1
- oc\\t%O0(1,%R0),%1"
+ oi\t%0,%b1
+ oiy\t%0,%b1
+ oc\t%O0(1,%R0),%1"
[(set_attr "op_type" "SI,SIY,SS")])
@@ -4979,8 +5252,8 @@
(xor:DI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
"@
- xgr\\t%0,%2
- xg\\t%0,%2"
+ xgr\t%0,%2
+ xg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*xordi3_cconly"
@@ -4991,8 +5264,8 @@
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
"@
- xgr\\t%0,%2
- xr\\t%0,%2"
+ xgr\t%0,%2
+ xr\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "xordi3"
@@ -5002,8 +5275,8 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- xgr\\t%0,%2
- xg\\t%0,%2"
+ xgr\t%0,%2
+ xg\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
(define_insn "*xordi3_ss"
@@ -5012,7 +5285,7 @@
(match_operand:DI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "xc\\t%O0(8,%R0),%1"
+ "xc\t%O0(8,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*xordi3_ss_inv"
@@ -5021,7 +5294,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "xc\\t%O0(8,%R0),%1"
+ "xc\t%O0(8,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -5037,9 +5310,9 @@
(xor:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCTmode)"
"@
- xr\\t%0,%2
- x\\t%0,%2
- xy\\t%0,%2"
+ xr\t%0,%2
+ x\t%0,%2
+ xy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*xorsi3_cconly"
@@ -5050,9 +5323,9 @@
(clobber (match_scratch:SI 0 "=d,d,d"))]
"s390_match_ccmode(insn, CCTmode)"
"@
- xr\\t%0,%2
- x\\t%0,%2
- xy\\t%0,%2"
+ xr\t%0,%2
+ x\t%0,%2
+ xy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "xorsi3"
@@ -5062,9 +5335,9 @@
(clobber (reg:CC 33))]
""
"@
- xr\\t%0,%2
- x\\t%0,%2
- xy\\t%0,%2"
+ xr\t%0,%2
+ x\t%0,%2
+ xy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
(define_insn "*xorsi3_ss"
@@ -5073,7 +5346,7 @@
(match_operand:SI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "xc\\t%O0(4,%R0),%1"
+ "xc\t%O0(4,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*xorsi3_ss_inv"
@@ -5082,7 +5355,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "xc\\t%O0(4,%R0),%1"
+ "xc\t%O0(4,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -5095,7 +5368,7 @@
(match_operand:HI 2 "nonmemory_operand" "d")))
(clobber (reg:CC 33))]
""
- "xr\\t%0,%2"
+ "xr\t%0,%2"
[(set_attr "op_type" "RR")])
(define_insn "*xorhi3_ss"
@@ -5104,7 +5377,7 @@
(match_operand:HI 1 "s_imm_operand" "Q")))
(clobber (reg:CC 33))]
""
- "xc\\t%O0(2,%R0),%1"
+ "xc\t%O0(2,%R0),%1"
[(set_attr "op_type" "SS")])
(define_insn "*xorhi3_ss_inv"
@@ -5113,7 +5386,7 @@
(match_dup 0)))
(clobber (reg:CC 33))]
""
- "xc\\t%O0(2,%R0),%1"
+ "xc\t%O0(2,%R0),%1"
[(set_attr "op_type" "SS")])
;
@@ -5126,7 +5399,7 @@
(match_operand:QI 2 "nonmemory_operand" "d")))
(clobber (reg:CC 33))]
""
- "xr\\t%0,%2"
+ "xr\t%0,%2"
[(set_attr "op_type" "RR")])
(define_insn "*xorqi3_ss"
@@ -5136,9 +5409,9 @@
(clobber (reg:CC 33))]
""
"@
- xi\\t%0,%b1
- xiy\\t%0,%b1
- xc\\t%O0(1,%R0),%1"
+ xi\t%0,%b1
+ xiy\t%0,%b1
+ xc\t%O0(1,%R0),%1"
[(set_attr "op_type" "SI,SIY,SS")])
(define_insn "*xorqi3_ss_inv"
@@ -5148,9 +5421,9 @@
(clobber (reg:CC 33))]
""
"@
- xi\\t%0,%b1
- xiy\\t%0,%b1
- xc\\t%O0(1,%R0),%1"
+ xi\t%0,%b1
+ xiy\t%0,%b1
+ xc\t%O0(1,%R0),%1"
[(set_attr "op_type" "SI,SIY,SS")])
@@ -5175,7 +5448,7 @@
(neg:DI (match_operand:DI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
"TARGET_64BIT"
- "lcgr\\t%0,%1"
+ "lcgr\t%0,%1"
[(set_attr "op_type" "RR")])
(define_insn "*negdi2_31"
@@ -5183,18 +5456,17 @@
(neg:DI (match_operand:DI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
"!TARGET_64BIT"
- "*
{
rtx xop[1];
xop[0] = gen_label_rtx ();
- output_asm_insn (\"lcr\\t%0,%1\", operands);
- output_asm_insn (\"lcr\\t%N0,%N1\", operands);
- output_asm_insn (\"je\\t%l0\", xop);
- output_asm_insn (\"bctr\\t%0,0\", operands);
- (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
+ output_asm_insn ("lcr\t%0,%1", operands);
+ output_asm_insn ("lcr\t%N0,%N1", operands);
+ output_asm_insn ("je\t%l0", xop);
+ output_asm_insn ("bctr\t%0,0", operands);
+ targetm.asm_out.internal_label (asm_out_file, "L",
CODE_LABEL_NUMBER (xop[0]));
- return \"\";
-}"
+ return "";
+}
[(set_attr "op_type" "NN")
(set_attr "type" "other")
(set_attr "length" "10")])
@@ -5208,7 +5480,7 @@
(neg:SI (match_operand:SI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
""
- "lcr\\t%0,%1"
+ "lcr\t%0,%1"
[(set_attr "op_type" "RR")])
;
@@ -5228,7 +5500,7 @@
(neg:DF (match_operand:DF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "lcdbr\\t%0,%1"
+ "lcdbr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "fsimpd")])
@@ -5237,7 +5509,7 @@
(neg:DF (match_operand:DF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "lcdr\\t%0,%1"
+ "lcdr\t%0,%1"
[(set_attr "op_type" "RR")
(set_attr "type" "fsimpd")])
@@ -5258,7 +5530,7 @@
(neg:SF (match_operand:SF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "lcebr\\t%0,%1"
+ "lcebr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "fsimps")])
@@ -5267,7 +5539,7 @@
(neg:SF (match_operand:SF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "lcer\\t%0,%1"
+ "lcer\t%0,%1"
[(set_attr "op_type" "RR")
(set_attr "type" "fsimps")])
@@ -5285,7 +5557,7 @@
(abs:DI (match_operand:DI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
"TARGET_64BIT"
- "lpgr\\t%0,%1"
+ "lpgr\t%0,%1"
[(set_attr "op_type" "RRE")])
;
@@ -5297,7 +5569,7 @@
(abs:SI (match_operand:SI 1 "register_operand" "d")))
(clobber (reg:CC 33))]
""
- "lpr\\t%0,%1"
+ "lpr\t%0,%1"
[(set_attr "op_type" "RR")])
;
@@ -5317,7 +5589,7 @@
(abs:DF (match_operand:DF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "lpdbr\\t%0,%1"
+ "lpdbr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "fsimpd")])
@@ -5326,7 +5598,7 @@
(abs:DF (match_operand:DF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "lpdr\\t%0,%1"
+ "lpdr\t%0,%1"
[(set_attr "op_type" "RR")
(set_attr "type" "fsimpd")])
@@ -5347,7 +5619,7 @@
(abs:SF (match_operand:SF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
- "lpebr\\t%0,%1"
+ "lpebr\t%0,%1"
[(set_attr "op_type" "RRE")
(set_attr "type" "fsimps")])
@@ -5356,11 +5628,57 @@
(abs:SF (match_operand:SF 1 "register_operand" "f")))
(clobber (reg:CC 33))]
"TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
- "lper\\t%0,%1"
+ "lper\t%0,%1"
[(set_attr "op_type" "RR")
(set_attr "type" "fsimps")])
;;
+;;- Negated absolute value instructions
+;;
+
+;
+; Integer
+;
+
+(define_insn "*negabssi2"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
+ (clobber (reg:CC 33))]
+ ""
+ "lnr\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+(define_insn "*negabsdi2"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "lngr\t%0,%1"
+ [(set_attr "op_type" "RRE")])
+
+;
+; Floating point
+;
+
+(define_insn "*negabssf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "lnebr\t%0,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "type" "fsimps")])
+
+(define_insn "*negabsdf2"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "lndbr\t%0,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "type" "fsimpd")])
+
+;;
;;- Square root instructions.
;;
@@ -5373,8 +5691,8 @@
(sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- sqdbr\\t%0,%1
- sqdb\\t%0,%1"
+ sqdbr\t%0,%1
+ sqdb\t%0,%1"
[(set_attr "op_type" "RRE,RXE")])
;
@@ -5386,8 +5704,8 @@
(sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
"TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
"@
- sqebr\\t%0,%1
- sqeb\\t%0,%1"
+ sqebr\t%0,%1
+ sqeb\t%0,%1"
[(set_attr "op_type" "RRE,RXE")])
;;
@@ -5397,7 +5715,7 @@
;
; one_cmpldi2 instruction pattern(s).
;
-
+
(define_expand "one_cmpldi2"
[(parallel
[(set (match_operand:DI 0 "register_operand" "")
@@ -5406,11 +5724,11 @@
(clobber (reg:CC 33))])]
"TARGET_64BIT"
"")
-
+
;
; one_cmplsi2 instruction pattern(s).
;
-
+
(define_expand "one_cmplsi2"
[(parallel
[(set (match_operand:SI 0 "register_operand" "")
@@ -5419,11 +5737,11 @@
(clobber (reg:CC 33))])]
""
"")
-
+
;
; one_cmplhi2 instruction pattern(s).
;
-
+
(define_expand "one_cmplhi2"
[(parallel
[(set (match_operand:HI 0 "register_operand" "")
@@ -5432,11 +5750,11 @@
(clobber (reg:CC 33))])]
""
"")
-
+
;
; one_cmplqi2 instruction pattern(s).
;
-
+
(define_expand "one_cmplqi2"
[(parallel
[(set (match_operand:QI 0 "register_operand" "")
@@ -5461,8 +5779,8 @@
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
"TARGET_64BIT"
"@
- rllg\\t%0,%1,%c2
- rllg\\t%0,%1,0(%2)"
+ rllg\t%0,%1,%c2
+ rllg\t%0,%1,0(%2)"
[(set_attr "op_type" "RSE")
(set_attr "atype" "reg")])
@@ -5474,10 +5792,10 @@
[(set (match_operand:SI 0 "register_operand" "=d,d")
(rotate:SI (match_operand:SI 1 "register_operand" "d,d")
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
- "TARGET_64BIT"
+ "TARGET_CPU_ZARCH"
"@
- rll\\t%0,%1,%c2
- rll\\t%0,%1,0(%2)"
+ rll\t%0,%1,%c2
+ rll\t%0,%1,0(%2)"
[(set_attr "op_type" "RSE")
(set_attr "atype" "reg")])
@@ -5503,8 +5821,8 @@
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
"!TARGET_64BIT"
"@
- sldl\\t%0,%c2
- sldl\\t%0,0(%2)"
+ sldl\t%0,%c2
+ sldl\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5514,8 +5832,8 @@
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
"TARGET_64BIT"
"@
- sllg\\t%0,%1,%2
- sllg\\t%0,%1,0(%2)"
+ sllg\t%0,%1,%2
+ sllg\t%0,%1,0(%2)"
[(set_attr "op_type" "RSE")
(set_attr "atype" "reg")])
@@ -5541,8 +5859,8 @@
(ashiftrt:DI (match_dup 1) (match_dup 2)))]
"!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
"@
- srda\\t%0,%c2
- srda\\t%0,0(%2)"
+ srda\t%0,%c2
+ srda\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5554,8 +5872,8 @@
(clobber (match_scratch:DI 0 "=d,d"))]
"!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
"@
- srda\\t%0,%c2
- srda\\t%0,0(%2)"
+ srda\t%0,%c2
+ srda\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5566,11 +5884,11 @@
(clobber (reg:CC 33))]
"!TARGET_64BIT"
"@
- srda\\t%0,%c2
- srda\\t%0,0(%2)"
+ srda\t%0,%c2
+ srda\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
-
+
(define_insn "*ashrdi3_cc_64"
[(set (reg 33)
(compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
@@ -5580,8 +5898,8 @@
(ashiftrt:DI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
"@
- srag\\t%0,%1,%c2
- srag\\t%0,%1,0(%2)"
+ srag\t%0,%1,%c2
+ srag\t%0,%1,0(%2)"
[(set_attr "op_type" "RSE")
(set_attr "atype" "reg")])
@@ -5593,8 +5911,8 @@
(clobber (match_scratch:DI 0 "=d,d"))]
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
"@
- srag\\t%0,%1,%c2
- srag\\t%0,%1,0(%2)"
+ srag\t%0,%1,%c2
+ srag\t%0,%1,0(%2)"
[(set_attr "op_type" "RSE")
(set_attr "atype" "reg")])
@@ -5605,8 +5923,8 @@
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
- srag\\t%0,%1,%c2
- srag\\t%0,%1,0(%2)"
+ srag\t%0,%1,%c2
+ srag\t%0,%1,0(%2)"
[(set_attr "op_type" "RSE")
(set_attr "atype" "reg")])
@@ -5621,8 +5939,8 @@
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
""
"@
- sll\\t%0,%c2
- sll\\t%0,0(%2)"
+ sll\t%0,%c2
+ sll\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5639,8 +5957,8 @@
(ashiftrt:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode(insn, CCSmode)"
"@
- sra\\t%0,%c2
- sra\\t%0,0(%2)"
+ sra\t%0,%c2
+ sra\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5653,8 +5971,8 @@
(clobber (match_scratch:SI 0 "=d,d"))]
"s390_match_ccmode(insn, CCSmode)"
"@
- sra\\t%0,%c2
- sra\\t%0,0(%2)"
+ sra\t%0,%c2
+ sra\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5665,8 +5983,8 @@
(clobber (reg:CC 33))]
""
"@
- sra\\t%0,%c2
- sra\\t%0,0(%2)"
+ sra\t%0,%c2
+ sra\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5692,8 +6010,8 @@
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
"!TARGET_64BIT"
"@
- srdl\\t%0,%c2
- srdl\\t%0,0(%2)"
+ srdl\t%0,%c2
+ srdl\t%0,0(%2)"
[(set_attr "op_type" "RS,RS")
(set_attr "atype" "reg")])
@@ -5703,8 +6021,8 @@
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
"TARGET_64BIT"
"@
- srlg\\t%0,%1,%c2
- srlg\\t%0,%1,0(%2)"
+ srlg\t%0,%1,%c2
+ srlg\t%0,%1,0(%2)"
[(set_attr "op_type" "RSE,RSE")
(set_attr "atype" "reg")])
@@ -5718,8 +6036,8 @@
(match_operand:SI 2 "nonmemory_operand" "J,a")))]
""
"@
- srl\\t%0,%c2
- srl\\t%0,0(%2)"
+ srl\t%0,%c2
+ srl\t%0,0(%2)"
[(set_attr "op_type" "RS")
(set_attr "atype" "reg")])
@@ -5735,7 +6053,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bne"
[(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
@@ -5744,7 +6062,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bgt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5753,7 +6071,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bgtu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
@@ -5762,7 +6080,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "blt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5771,7 +6089,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bltu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
@@ -5780,7 +6098,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bge"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5789,7 +6107,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bgeu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
@@ -5798,7 +6116,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "ble"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5807,7 +6125,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bleu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
@@ -5816,7 +6134,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bunordered"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5825,7 +6143,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bordered"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5834,7 +6152,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "buneq"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5843,7 +6161,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bungt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5852,7 +6170,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bunlt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5861,7 +6179,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bunge"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5870,7 +6188,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bunle"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5879,7 +6197,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bltgt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
@@ -5888,7 +6206,7 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+ "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
;;
@@ -5897,26 +6215,25 @@
(define_insn "cjump"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "*
{
if (get_attr_length (insn) == 4)
- return \"j%C1\\t%l0\";
- else if (TARGET_64BIT)
- return \"jg%C1\\t%l0\";
+ return "j%C1\t%l0";
+ else if (TARGET_CPU_ZARCH)
+ return "jg%C1\t%l0";
else
abort ();
-}"
+}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4)
- (ne (symbol_ref "TARGET_64BIT") (const_int 0))
+ (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
(const_int 6)
(eq (symbol_ref "flag_pic") (const_int 0))
(const_int 6)] (const_int 8)))])
@@ -5928,14 +6245,13 @@
(match_operand 0 "address_operand" "U")
(pc)))]
""
- "*
{
if (get_attr_op_type (insn) == OP_TYPE_RR)
- return \"b%C1r\\t%0\";
+ return "b%C1r\t%0";
else
- return \"b%C1\\t%a0\";
-}"
- [(set (attr "op_type")
+ return "b%C1\t%a0";
+}
+ [(set (attr "op_type")
(if_then_else (match_operand 0 "register_operand" "")
(const_string "RR") (const_string "RX")))
(set_attr "type" "branch")
@@ -5950,24 +6266,23 @@
[(set (pc)
(if_then_else
(match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
- (pc)
+ (pc)
(label_ref (match_operand 0 "" ""))))]
""
- "*
-{
+{
if (get_attr_length (insn) == 4)
- return \"j%D1\\t%l0\";
- else if (TARGET_64BIT)
- return \"jg%D1\\t%l0\";
+ return "j%D1\t%l0";
+ else if (TARGET_CPU_ZARCH)
+ return "jg%D1\t%l0";
else
abort ();
-}"
+}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4)
- (ne (symbol_ref "TARGET_64BIT") (const_int 0))
+ (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
(const_int 6)
(eq (symbol_ref "flag_pic") (const_int 0))
(const_int 6)] (const_int 8)))])
@@ -5979,14 +6294,13 @@
(pc)
(match_operand 0 "address_operand" "U")))]
""
- "*
{
if (get_attr_op_type (insn) == OP_TYPE_RR)
- return \"b%D1r\\t%0\";
+ return "b%D1r\t%0";
else
- return \"b%D1\\t%a0\";
-}"
- [(set (attr "op_type")
+ return "b%D1\t%a0";
+}
+ [(set (attr "op_type")
(if_then_else (match_operand 0 "register_operand" "")
(const_string "RR") (const_string "RX")))
(set_attr "type" "branch")
@@ -5999,7 +6313,7 @@
(define_insn "trap"
[(trap_if (const_int 1) (const_int 0))]
""
- "j\\t.+2"
+ "j\t.+2"
[(set_attr "op_type" "RX")
(set_attr "type" "branch")])
@@ -6009,23 +6323,22 @@
[(match_dup 2) (const_int 0)])
(match_operand:SI 1 "general_operand" ""))]
""
- "
{
enum machine_mode ccmode;
- if (operands[1] != const0_rtx) FAIL;
+ if (operands[1] != const0_rtx) FAIL;
- ccmode = s390_select_ccmode (GET_CODE (operands[0]),
- s390_compare_op0, s390_compare_op1);
+ ccmode = s390_select_ccmode (GET_CODE (operands[0]),
+ s390_compare_op0, s390_compare_op1);
operands[2] = gen_rtx_REG (ccmode, 33);
operands[3] = gen_rtx_COMPARE (ccmode, s390_compare_op0, s390_compare_op1);
-}")
+})
(define_insn "*trap"
[(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
(const_int 0))]
""
- "j%C0\\t.+2";
+ "j%C0\t.+2";
[(set_attr "op_type" "RI")
(set_attr "type" "branch")])
@@ -6034,7 +6347,7 @@
;;
;; This is all complicated by the fact that since this is a jump insn
;; we must handle our own output reloads.
-
+
(define_expand "doloop_end"
[(use (match_operand 0 "" "")) ; loop pseudo
(use (match_operand 1 "" "")) ; iterations; zero if unknown
@@ -6042,7 +6355,6 @@
(use (match_operand 3 "" "")) ; loop level
(use (match_operand 4 "" ""))] ; label
""
- "
{
if (GET_MODE (operands[0]) == SImode)
emit_jump_insn (gen_doloop_si (operands[4], operands[0], operands[0]));
@@ -6052,7 +6364,7 @@
FAIL;
DONE;
-}")
+})
(define_insn "doloop_si"
[(set (pc)
@@ -6066,21 +6378,20 @@
(clobber (match_scratch:SI 3 "=X,&d"))
(clobber (reg:CC 33))]
""
- "*
{
if (which_alternative != 0)
- return \"#\";
+ return "#";
else if (get_attr_length (insn) == 4)
- return \"brct\\t%1,%l0\";
+ return "brct\t%1,%l0";
else
abort ();
-}"
+}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4)
- (ne (symbol_ref "TARGET_64BIT") (const_int 0))
+ (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
(const_int 10)
(eq (symbol_ref "flag_pic") (const_int 0))
(const_int 6)] (const_int 8)))])
@@ -6097,14 +6408,13 @@
(clobber (match_scratch:SI 3 "=X,&d"))
(clobber (reg:CC 33))]
""
- "*
{
if (get_attr_op_type (insn) == OP_TYPE_RR)
- return \"bctr\\t%1,%0\";
+ return "bctr\t%1,%0";
else
- return \"bct\\t%1,%a0\";
-}"
- [(set (attr "op_type")
+ return "bct\t%1,%a0";
+}
+ [(set (attr "op_type")
(if_then_else (match_operand 0 "register_operand" "")
(const_string "RR") (const_string "RX")))
(set_attr "type" "branch")
@@ -6146,15 +6456,14 @@
(clobber (match_scratch:DI 3 "=X,&d"))
(clobber (reg:CC 33))]
"TARGET_64BIT"
- "*
{
if (which_alternative != 0)
- return \"#\";
+ return "#";
else if (get_attr_length (insn) == 4)
- return \"brctg\\t%1,%l0\";
+ return "brctg\t%1,%l0";
else
abort ();
-}"
+}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
@@ -6173,14 +6482,13 @@
(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\";
+ return "bctgr\t%1,%0";
else
- return \"bctg\\t%1,%a0\";
-}"
- [(set (attr "op_type")
+ 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")
@@ -6221,21 +6529,20 @@
(define_insn "jump"
[(set (pc) (label_ref (match_operand 0 "" "")))]
""
- "*
{
if (get_attr_length (insn) == 4)
- return \"j\\t%l0\";
- else if (TARGET_64BIT)
- return \"jg\\t%l0\";
+ return "j\t%l0";
+ else if (TARGET_CPU_ZARCH)
+ return "jg\t%l0";
else
abort ();
-}"
+}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4)
- (ne (symbol_ref "TARGET_64BIT") (const_int 0))
+ (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
(const_int 6)
(eq (symbol_ref "flag_pic") (const_int 0))
(const_int 6)] (const_int 8)))])
@@ -6247,14 +6554,13 @@
(define_insn "indirect_jump"
[(set (pc) (match_operand 0 "address_operand" "U"))]
""
- "*
{
if (get_attr_op_type (insn) == OP_TYPE_RR)
- return \"br\\t%0\";
+ return "br\t%0";
else
- return \"b\\t%a0\";
-}"
- [(set (attr "op_type")
+ return "b\t%a0";
+}
+ [(set (attr "op_type")
(if_then_else (match_operand 0 "register_operand" "")
(const_string "RR") (const_string "RX")))
(set_attr "type" "branch")
@@ -6268,14 +6574,13 @@
[(set (pc) (match_operand 0 "address_operand" "U"))
(use (label_ref (match_operand 1 "" "")))]
""
- "*
{
if (get_attr_op_type (insn) == OP_TYPE_RR)
- return \"br\\t%0\";
+ return "br\t%0";
else
- return \"b\\t%a0\";
-}"
- [(set (attr "op_type")
+ return "b\t%a0";
+}
+ [(set (attr "op_type")
(if_then_else (match_operand 0 "register_operand" "")
(const_string "RR") (const_string "RX")))
(set_attr "type" "branch")
@@ -6288,7 +6593,6 @@
(label_ref (match_operand 3 "" ""))
(label_ref (match_operand 4 "" ""))]
""
- "
{
rtx index = gen_reg_rtx (SImode);
rtx base = gen_reg_rtx (Pmode);
@@ -6319,7 +6623,7 @@
emit_jump_insn (gen_casesi_jump (target, operands[3]));
DONE;
-}")
+})
;;
@@ -6338,7 +6642,6 @@
(match_operand 1 "" "")
(match_operand 2 "" "")])]
""
- "
{
int i;
@@ -6357,13 +6660,13 @@
emit_insn (gen_blockage ());
DONE;
-}")
+})
;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
;; all of memory. This blocks insns from being moved across this point.
(define_insn "blockage"
- [(unspec_volatile [(const_int 0)] 0)]
+ [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
""
""
[(set_attr "type" "none")
@@ -6380,9 +6683,8 @@
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))]
""
- "
{
- int plt_call = 0;
+ bool plt_call = false;
rtx insn;
/* Direct function calls need special treatment. */
@@ -6394,20 +6696,20 @@
replace the symbol itself with the PLT stub. */
if (flag_pic && !SYMBOL_REF_LOCAL_P (sym))
{
- sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113);
+ sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
sym = gen_rtx_CONST (Pmode, sym);
-
- plt_call = 1;
+ plt_call = true;
}
- /* Unless we can use the bras(l) insn, force the
+ /* Unless we can use the bras(l) insn, force the
routine address into a register. */
- if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
- {
- rtx target = gen_reg_rtx (Pmode);
- emit_move_insn (target, sym);
- sym = target;
- }
+ if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH)
+ {
+ if (flag_pic)
+ sym = legitimize_pic_address (sym, 0);
+ else
+ sym = force_reg (Pmode, sym);
+ }
operands[0] = gen_rtx_MEM (QImode, sym);
}
@@ -6416,14 +6718,12 @@
insn = emit_call_insn (gen_call_exp (operands[0], operands[1],
gen_rtx_REG (Pmode, RETURN_REGNUM)));
- /* In 31-bit, we must load the GOT register even if the
- compiler doesn't know about it, because the PLT glue
- code uses it. In 64-bit, this is not necessary. */
- if (plt_call && !TARGET_64BIT)
+ /* 31-bit PLT stubs use the GOT register implicitly. */
+ if (!TARGET_64BIT && plt_call)
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
-
+
DONE;
-}")
+})
(define_expand "call_exp"
[(parallel [(call (match_operand 0 "" "")
@@ -6432,62 +6732,40 @@
""
"")
-(define_insn "brasl"
- [(call (mem:QI (match_operand:DI 0 "bras_sym_operand" "X"))
- (match_operand:SI 1 "const_int_operand" "n"))
- (clobber (match_operand:DI 2 "register_operand" "=r"))]
- "TARGET_64BIT"
- "brasl\\t%2,%0"
- [(set_attr "op_type" "RIL")
- (set_attr "type" "jsr")])
-
-(define_insn "bras"
- [(call (mem:QI (match_operand:SI 0 "bras_sym_operand" "X"))
- (match_operand:SI 1 "const_int_operand" "n"))
- (clobber (match_operand:SI 2 "register_operand" "=r"))]
- "TARGET_SMALL_EXEC"
- "bras\\t%2,%0"
+(define_insn "*bras"
+ [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
+ (match_operand 1 "const_int_operand" "n"))
+ (clobber (match_operand 2 "register_operand" "=r"))]
+ "TARGET_SMALL_EXEC && GET_MODE (operands[2]) == Pmode"
+ "bras\t%2,%0"
[(set_attr "op_type" "RI")
(set_attr "type" "jsr")])
-(define_insn "basr_64"
- [(call (mem:QI (match_operand:DI 0 "register_operand" "a"))
- (match_operand:SI 1 "const_int_operand" "n"))
- (clobber (match_operand:DI 2 "register_operand" "=r"))]
- "TARGET_64BIT"
- "basr\\t%2,%0"
- [(set_attr "op_type" "RR")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
-
-(define_insn "basr_31"
- [(call (mem:QI (match_operand:SI 0 "register_operand" "a"))
- (match_operand:SI 1 "const_int_operand" "n"))
- (clobber (match_operand:SI 2 "register_operand" "=r"))]
- "!TARGET_64BIT"
- "basr\\t%2,%0"
- [(set_attr "op_type" "RR")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
-
-(define_insn "bas_64"
- [(call (mem:QI (match_operand:QI 0 "address_operand" "U"))
- (match_operand:SI 1 "const_int_operand" "n"))
- (clobber (match_operand:DI 2 "register_operand" "=r"))]
- "TARGET_64BIT"
- "bas\\t%2,%a0"
- [(set_attr "op_type" "RX")
- (set_attr "type" "jsr")])
-
-(define_insn "bas_31"
- [(call (mem:QI (match_operand:QI 0 "address_operand" "U"))
- (match_operand:SI 1 "const_int_operand" "n"))
- (clobber (match_operand:SI 2 "register_operand" "=r"))]
- "!TARGET_64BIT"
- "bas\\t%2,%a0"
- [(set_attr "op_type" "RX")
+(define_insn "*brasl"
+ [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
+ (match_operand 1 "const_int_operand" "n"))
+ (clobber (match_operand 2 "register_operand" "=r"))]
+ "TARGET_CPU_ZARCH && GET_MODE (operands[2]) == Pmode"
+ "brasl\t%2,%0"
+ [(set_attr "op_type" "RIL")
(set_attr "type" "jsr")])
+(define_insn "*basr"
+ [(call (mem:QI (match_operand 0 "address_operand" "U"))
+ (match_operand 1 "const_int_operand" "n"))
+ (clobber (match_operand 2 "register_operand" "=r"))]
+ "GET_MODE (operands[2]) == Pmode"
+{
+ if (get_attr_op_type (insn) == OP_TYPE_RR)
+ return "basr\t%2,%0";
+ else
+ return "bas\t%2,%a0";
+}
+ [(set (attr "op_type")
+ (if_then_else (match_operand 0 "register_operand" "")
+ (const_string "RR") (const_string "RX")))
+ (set_attr "type" "jsr")
+ (set_attr "atype" "agen")])
;
; call_value instruction pattern(s).
@@ -6499,9 +6777,8 @@
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))]
""
- "
{
- int plt_call = 0;
+ bool plt_call = false;
rtx insn;
/* Direct function calls need special treatment. */
@@ -6513,19 +6790,19 @@
replace the symbol itself with the PLT stub. */
if (flag_pic && !SYMBOL_REF_LOCAL_P (sym))
{
- sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113);
+ sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
sym = gen_rtx_CONST (Pmode, sym);
-
- plt_call = 1;
+ plt_call = true;
}
- /* Unless we can use the bras(l) insn, force the
+ /* Unless we can use the bras(l) insn, force the
routine address into a register. */
- if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
+ if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH)
{
- rtx target = gen_reg_rtx (Pmode);
- emit_move_insn (target, sym);
- sym = target;
+ if (flag_pic)
+ sym = legitimize_pic_address (sym, 0);
+ else
+ sym = force_reg (Pmode, sym);
}
operands[1] = gen_rtx_MEM (QImode, sym);
@@ -6536,14 +6813,12 @@
gen_call_value_exp (operands[0], operands[1], operands[2],
gen_rtx_REG (Pmode, RETURN_REGNUM)));
- /* In 31-bit, we must load the GOT register even if the
- compiler doesn't know about it, because the PLT glue
- code uses it. In 64-bit, this is not necessary. */
- if (plt_call && !TARGET_64BIT)
+ /* 31-bit PLT stubs use the GOT register implicitly. */
+ if (!TARGET_64BIT && plt_call)
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
-
+
DONE;
-}")
+})
(define_expand "call_value_exp"
[(parallel [(set (match_operand 0 "" "")
@@ -6553,68 +6828,43 @@
""
"")
-(define_insn "brasl_r"
+(define_insn "*bras_r"
[(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:DI 1 "bras_sym_operand" "X"))
+ (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
(match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:DI 3 "register_operand" "=r"))]
- "TARGET_64BIT"
- "brasl\\t%3,%1"
- [(set_attr "op_type" "RIL")
- (set_attr "type" "jsr")])
-
-(define_insn "bras_r"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:SI 1 "bras_sym_operand" "X"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:SI 3 "register_operand" "=r"))]
- "TARGET_SMALL_EXEC"
- "bras\\t%3,%1"
+ (clobber (match_operand 3 "register_operand" "=r"))]
+ "TARGET_SMALL_EXEC && GET_MODE (operands[3]) == Pmode"
+ "bras\t%3,%1"
[(set_attr "op_type" "RI")
(set_attr "type" "jsr")])
-(define_insn "basr_r_64"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:DI 1 "register_operand" "a"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:DI 3 "register_operand" "=r"))]
- "TARGET_64BIT"
- "basr\\t%3,%1"
- [(set_attr "op_type" "RR")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
-
-(define_insn "basr_r_31"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:SI 1 "register_operand" "a"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:SI 3 "register_operand" "=r"))]
- "!TARGET_64BIT"
- "basr\\t%3,%1"
- [(set_attr "op_type" "RR")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
-
-(define_insn "bas_r_64"
+(define_insn "*brasl_r"
[(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:DI 3 "register_operand" "=r"))]
- "TARGET_64BIT"
- "bas\\t%3,%a1"
- [(set_attr "op_type" "RX")
+ (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
+ (match_operand 2 "const_int_operand" "n")))
+ (clobber (match_operand 3 "register_operand" "=r"))]
+ "TARGET_CPU_ZARCH && GET_MODE (operands[3]) == Pmode"
+ "brasl\t%3,%1"
+ [(set_attr "op_type" "RIL")
(set_attr "type" "jsr")])
-(define_insn "bas_r_31"
+(define_insn "*basr_r"
[(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:SI 3 "register_operand" "=r"))]
- "!TARGET_64BIT"
- "bas\\t%3,%a1"
- [(set_attr "op_type" "RX")
- (set_attr "type" "jsr")])
-
+ (call (mem:QI (match_operand 1 "address_operand" "U"))
+ (match_operand 2 "const_int_operand" "n")))
+ (clobber (match_operand 3 "register_operand" "=r"))]
+ "GET_MODE (operands[3]) == Pmode"
+{
+ if (get_attr_op_type (insn) == OP_TYPE_RR)
+ return "basr\t%3,%1";
+ else
+ return "bas\t%3,%a1";
+}
+ [(set (attr "op_type")
+ (if_then_else (match_operand 1 "register_operand" "")
+ (const_string "RR") (const_string "RX")))
+ (set_attr "type" "jsr")
+ (set_attr "atype" "agen")])
;;
;;- Thread-local storage support.
@@ -6625,8 +6875,8 @@
(unspec:DI [(const_int 0)] UNSPEC_TP))]
"TARGET_64BIT"
"@
- ear\\t%0,%%a0\;sllg\\t%0,%0,32\;ear\\t%0,%%a1
- stam\\t%%a0,%%a1,%0"
+ ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
+ stam\t%%a0,%%a1,%0"
[(set_attr "op_type" "NN,RS")
(set_attr "atype" "reg,*")
(set_attr "type" "o3,*")
@@ -6637,8 +6887,8 @@
(unspec:SI [(const_int 0)] UNSPEC_TP))]
"!TARGET_64BIT"
"@
- ear\\t%0,%%a0
- stam\\t%%a0,%%a0,%0"
+ ear\t%0,%%a0
+ stam\t%%a0,%%a0,%0"
[(set_attr "op_type" "RRE,RS")])
(define_insn "set_tp_64"
@@ -6646,8 +6896,8 @@
(clobber (match_scratch:SI 1 "=d,X"))]
"TARGET_64BIT"
"@
- sar\\t%%a1,%0\;srlg\\t%1,%0,32\;sar\\t%%a0,%1
- lam\\t%%a0,%%a1,%0"
+ sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
+ lam\t%%a0,%%a1,%0"
[(set_attr "op_type" "NN,RS")
(set_attr "atype" "reg,*")
(set_attr "type" "o3,*")
@@ -6657,17 +6907,17 @@
[(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
"!TARGET_64BIT"
"@
- sar\\t%%a0,%0
- lam\\t%%a0,%%a0,%0"
+ sar\t%%a0,%0
+ lam\t%%a0,%%a0,%0"
[(set_attr "op_type" "RRE,RS")])
-
+
(define_insn "*tls_load_64"
[(set (match_operand:DI 0 "register_operand" "=d")
(unspec:DI [(match_operand:DI 1 "memory_operand" "m")
(match_operand:DI 2 "" "")]
UNSPEC_TLS_LOAD))]
"TARGET_64BIT"
- "lg\\t%0,%1%J2"
+ "lg\t%0,%1%J2"
[(set_attr "op_type" "RXE")])
(define_insn "*tls_load_31"
@@ -6677,8 +6927,8 @@
UNSPEC_TLS_LOAD))]
"!TARGET_64BIT"
"@
- l\\t%0,%1%J2
- ly\\t%0,%1%J2"
+ l\t%0,%1%J2
+ ly\t%0,%1%J2"
[(set_attr "op_type" "RX,RXY")])
(define_expand "call_value_tls"
@@ -6686,7 +6936,6 @@
(call (const_int 0) (const_int 0)))
(use (match_operand 1 "" ""))]
""
- "
{
rtx insn, sym;
@@ -6694,16 +6943,17 @@
abort ();
sym = s390_tls_get_offset ();
- sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113);
+ sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
sym = gen_rtx_CONST (Pmode, sym);
- /* Unless we can use the bras(l) insn, force the
+ /* Unless we can use the bras(l) insn, force the
routine address into a register. */
- if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
+ if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH)
{
- rtx target = gen_reg_rtx (Pmode);
- emit_move_insn (target, sym);
- sym = target;
+ if (flag_pic)
+ sym = legitimize_pic_address (sym, 0);
+ else
+ sym = force_reg (Pmode, sym);
}
sym = gen_rtx_MEM (QImode, sym);
@@ -6721,7 +6971,7 @@
CONST_OR_PURE_CALL_P (insn) = 1;
DONE;
-}")
+})
(define_expand "call_value_tls_exp"
[(parallel [(set (match_operand 0 "" "")
@@ -6732,74 +6982,46 @@
""
"")
-(define_insn "brasl_tls"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:DI 1 "bras_sym_operand" "X"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:DI 3 "register_operand" "=r"))
- (use (match_operand:DI 4 "" ""))]
- "TARGET_64BIT"
- "brasl\\t%3,%1%J4"
- [(set_attr "op_type" "RIL")
- (set_attr "type" "jsr")])
-
-(define_insn "bras_tls"
+(define_insn "*bras_tls"
[(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:SI 1 "bras_sym_operand" "X"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:SI 3 "register_operand" "=r"))
- (use (match_operand:SI 4 "" ""))]
- "TARGET_SMALL_EXEC"
- "bras\\t%3,%1%J4"
+ (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
+ (match_operand 2 "const_int_operand" "n")))
+ (clobber (match_operand 3 "register_operand" "=r"))
+ (use (match_operand 4 "" ""))]
+ "TARGET_SMALL_EXEC && GET_MODE (operands[3]) == Pmode"
+ "bras\t%3,%1%J4"
[(set_attr "op_type" "RI")
(set_attr "type" "jsr")])
-(define_insn "basr_tls_64"
+(define_insn "*brasl_tls"
[(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:DI 1 "register_operand" "a"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:DI 3 "register_operand" "=r"))
- (use (match_operand:DI 4 "" ""))]
- "TARGET_64BIT"
- "basr\\t%3,%1%J4"
- [(set_attr "op_type" "RR")
+ (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
+ (match_operand 2 "const_int_operand" "n")))
+ (clobber (match_operand 3 "register_operand" "=r"))
+ (use (match_operand 4 "" ""))]
+ "TARGET_CPU_ZARCH && GET_MODE (operands[3]) == Pmode"
+ "brasl\t%3,%1%J4"
+ [(set_attr "op_type" "RIL")
(set_attr "type" "jsr")])
-(define_insn "basr_tls_31"
+(define_insn "*basr_tls"
[(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:SI 1 "register_operand" "a"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:SI 3 "register_operand" "=r"))
- (use (match_operand:SI 4 "" ""))]
- "!TARGET_64BIT"
- "basr\\t%3,%1%J4"
- [(set_attr "op_type" "RR")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
-
-(define_insn "bas_tls_64"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:DI 3 "register_operand" "=r"))
- (use (match_operand:DI 4 "" ""))]
- "TARGET_64BIT"
- "bas\\t%3,%a1%J4"
- [(set_attr "op_type" "RX")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
-
-(define_insn "bas_tls_31"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
- (match_operand:SI 2 "const_int_operand" "n")))
- (clobber (match_operand:SI 3 "register_operand" "=r"))
- (use (match_operand:SI 4 "" ""))]
- "!TARGET_64BIT"
- "bas\\t%3,%a1%J4"
- [(set_attr "op_type" "RX")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
+ (call (mem:QI (match_operand 1 "address_operand" "U"))
+ (match_operand 2 "const_int_operand" "n")))
+ (clobber (match_operand 3 "register_operand" "=r"))
+ (use (match_operand 4 "" ""))]
+ "GET_MODE (operands[3]) == Pmode"
+{
+ if (get_attr_op_type (insn) == OP_TYPE_RR)
+ return "basr\t%3,%1%J4";
+ else
+ return "bas\t%3,%a1%J4";
+}
+ [(set (attr "op_type")
+ (if_then_else (match_operand 1 "register_operand" "")
+ (const_string "RR") (const_string "RX")))
+ (set_attr "type" "jsr")
+ (set_attr "atype" "agen")])
;;
;;- Miscellaneous instructions.
@@ -6815,12 +7037,11 @@
(set (match_operand 0 "general_operand" "")
(reg 15))]
""
- "
{
rtx stack = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM);
rtx chain = gen_rtx (MEM, Pmode, stack);
rtx temp = gen_reg_rtx (Pmode);
-
+
emit_move_insn (temp, chain);
if (TARGET_64BIT)
@@ -6830,9 +7051,9 @@
emit_move_insn (chain, temp);
- emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
+ emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
DONE;
-}")
+})
;
@@ -6840,35 +7061,28 @@
;
(define_expand "builtin_setjmp_setup"
- [(unspec [(match_operand 0 "register_operand" "a")] 1)]
+ [(match_operand 0 "register_operand" "")]
""
- "
{
rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
emit_move_insn (base, basereg);
DONE;
-}")
+})
(define_expand "builtin_setjmp_receiver"
- [(unspec_volatile [(label_ref (match_operand 0 "" ""))] 2)]
+ [(match_operand 0 "" "")]
"flag_pic"
- "
{
- rtx gotreg = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
- rtx got = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\");
- SYMBOL_REF_FLAGS (got) = SYMBOL_FLAG_LOCAL;
-
- emit_move_insn (gotreg, got);
- emit_insn (gen_rtx_USE (VOIDmode, gotreg));
+ s390_load_got (false);
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
DONE;
-}")
+})
(define_expand "builtin_longjmp"
- [(unspec_volatile [(match_operand 0 "register_operand" "r")] 3)]
+ [(match_operand 0 "register_operand" "")]
""
- "
{
/* The elements of the buffer are, in order: */
rtx fp = gen_rtx_MEM (Pmode, operands[0]);
@@ -6876,7 +7090,7 @@
rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 2 * GET_MODE_SIZE (Pmode)));
rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
- rtx jmp = gen_rtx_REG (Pmode, 14);
+ rtx jmp = gen_reg_rtx (Pmode);
emit_move_insn (jmp, lab);
emit_move_insn (basereg, base);
@@ -6888,7 +7102,7 @@
emit_insn (gen_rtx_USE (VOIDmode, basereg));
emit_indirect_jump (jmp);
DONE;
-}")
+})
;; These patterns say how to save and restore the stack pointer. We need not
@@ -6918,17 +7132,15 @@
(set (match_dup 0) (match_operand 1 "register_operand" ""))
(set (match_dup 3) (match_dup 2))]
""
- "
{
operands[2] = gen_reg_rtx (Pmode);
operands[3] = gen_rtx_MEM (Pmode, operands[0]);
-}")
+})
(define_expand "save_stack_nonlocal"
[(match_operand 0 "memory_operand" "")
(match_operand 1 "register_operand" "")]
""
- "
{
rtx temp = gen_reg_rtx (Pmode);
@@ -6941,13 +7153,12 @@
TARGET_64BIT ? TImode : DImode),
operands[1]);
DONE;
-}")
+})
(define_expand "restore_stack_nonlocal"
[(match_operand 0 "register_operand" "")
(match_operand 1 "memory_operand" "")]
""
- "
{
rtx temp = gen_reg_rtx (Pmode);
@@ -6960,7 +7171,7 @@
TARGET_64BIT ? TImode : DImode));
emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
DONE;
-}")
+})
;
@@ -6970,7 +7181,7 @@
(define_insn "nop"
[(const_int 0)]
""
- "lr\\t0,0"
+ "lr\t0,0"
[(set_attr "op_type" "RR")])
@@ -6978,144 +7189,97 @@
; Special literal pool access instruction pattern(s).
;
-(define_insn "consttable_qi"
- [(unspec_volatile [(match_operand:QI 0 "consttable_operand" "X")] 200)]
+(define_insn "*pool_entry"
+ [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
+ UNSPECV_POOL_ENTRY)]
""
- "*
{
- assemble_integer (operands[0], 1, BITS_PER_UNIT, 1);
- return \"\";
-}"
- [(set_attr "op_type" "NN")
- (set_attr "length" "1")])
-
-(define_insn "consttable_hi"
- [(unspec_volatile [(match_operand:HI 0 "consttable_operand" "X")] 201)]
- ""
- "*
-{
- assemble_integer (operands[0], 2, 2*BITS_PER_UNIT, 1);
- return \"\";
-}"
- [(set_attr "op_type" "NN")
- (set_attr "length" "2")])
-
-(define_insn "consttable_si"
- [(unspec_volatile [(match_operand:SI 0 "consttable_operand" "X")] 202)]
- ""
- "*
-{
- if (!TARGET_64BIT && flag_pic && SYMBOLIC_CONST (operands[0]))
- return \".long\\t%0\";
-
- assemble_integer (operands[0], 4, 4*BITS_PER_UNIT, 1);
- return \"\";
-}"
- [(set_attr "op_type" "NN")
- (set_attr "length" "4")])
-
-(define_insn "consttable_di"
- [(unspec_volatile [(match_operand:DI 0 "consttable_operand" "X")] 203)]
- ""
- "*
-{
- assemble_integer (operands[0], 8, 8*BITS_PER_UNIT, 1);
- return \"\";
-}"
- [(set_attr "op_type" "NN")
- (set_attr "length" "8")])
-
-(define_insn "consttable_sf"
- [(unspec_volatile [(match_operand:SF 0 "consttable_operand" "X")] 204)]
- ""
- "*
-{
- REAL_VALUE_TYPE r;
-
- if (GET_CODE (operands[0]) != CONST_DOUBLE)
- abort ();
-
- REAL_VALUE_FROM_CONST_DOUBLE (r, operands[0]);
- assemble_real (r, SFmode, 4*BITS_PER_UNIT);
- return \"\";
-}"
- [(set_attr "op_type" "NN")
- (set_attr "length" "4")])
-
-(define_insn "consttable_df"
- [(unspec_volatile [(match_operand:DF 0 "consttable_operand" "X")] 205)]
- ""
- "*
-{
- REAL_VALUE_TYPE r;
-
- if (GET_CODE (operands[0]) != CONST_DOUBLE)
- abort ();
-
- REAL_VALUE_FROM_CONST_DOUBLE (r, operands[0]);
- assemble_real (r, DFmode, 8*BITS_PER_UNIT);
- return \"\";
-}"
- [(set_attr "op_type" "NN")
- (set_attr "length" "8")])
+ enum machine_mode mode = GET_MODE (PATTERN (insn));
+ unsigned int align = GET_MODE_BITSIZE (mode);
+ s390_output_pool_entry (asm_out_file, operands[0], mode, align);
+ return "";
+}
+ [(set_attr "op_type" "NN")
+ (set (attr "length")
+ (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
(define_insn "pool_start_31"
- [(unspec_volatile [(const_int 0)] 206)]
- "!TARGET_64BIT"
- ".align\\t4"
+ [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
+ "!TARGET_CPU_ZARCH"
+ ".align\t4"
[(set_attr "op_type" "NN")
(set_attr "length" "2")])
(define_insn "pool_end_31"
- [(unspec_volatile [(const_int 0)] 207)]
- "!TARGET_64BIT"
- ".align\\t2"
+ [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
+ "!TARGET_CPU_ZARCH"
+ ".align\t2"
[(set_attr "op_type" "NN")
(set_attr "length" "2")])
(define_insn "pool_start_64"
- [(unspec_volatile [(const_int 0)] 206)]
- "TARGET_64BIT"
- ".section\\t.rodata\;.align\\t8"
+ [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
+ "TARGET_CPU_ZARCH"
+ ".section\t.rodata\;.align\t8"
[(set_attr "op_type" "NN")
(set_attr "length" "0")])
(define_insn "pool_end_64"
- [(unspec_volatile [(const_int 0)] 207)]
- "TARGET_64BIT"
+ [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
+ "TARGET_CPU_ZARCH"
".previous"
[(set_attr "op_type" "NN")
(set_attr "length" "0")])
+(define_insn "main_base_31_small"
+ [(set (match_operand 0 "register_operand" "=a")
+ (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
+ "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
+ "basr\t%0,0"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "la")])
+
+(define_insn "main_base_31_large"
+ [(set (match_operand 0 "register_operand" "=a")
+ (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
+ (set (pc) (label_ref (match_operand 2 "" "")))]
+ "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
+ "bras\t%0,%2"
+ [(set_attr "op_type" "RI")])
+
+(define_insn "main_base_64"
+ [(set (match_operand 0 "register_operand" "=a")
+ (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
+ "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
+ "larl\t%0,%1"
+ [(set_attr "op_type" "RIL")
+ (set_attr "type" "larl")])
+
+(define_insn "main_pool"
+ [(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL)]
+ ""
+ "* abort ();"
+ [(set_attr "op_type" "NN")])
+
(define_insn "reload_base_31"
- [(set (match_operand:SI 0 "register_operand" "=a")
- (unspec:SI [(label_ref (match_operand 1 "" ""))] 210))]
- "!TARGET_64BIT"
- "basr\\t%0,0\;la\\t%0,%1-.(%0)"
+ [(set (match_operand 0 "register_operand" "=a")
+ (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
+ "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
+ "basr\t%0,0\;la\t%0,%1-.(%0)"
[(set_attr "op_type" "NN")
(set_attr "type" "la")
(set_attr "length" "6")])
(define_insn "reload_base_64"
- [(set (match_operand:DI 0 "register_operand" "=a")
- (unspec:DI [(label_ref (match_operand 1 "" ""))] 210))]
- "TARGET_64BIT"
- "larl\\t%0,%1"
+ [(set (match_operand 0 "register_operand" "=a")
+ (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
+ "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
+ "larl\t%0,%1"
[(set_attr "op_type" "RIL")
(set_attr "type" "larl")])
-(define_insn "reload_anchor"
- [(set (match_operand:SI 0 "register_operand" "=a")
- (unspec:SI [(match_operand:SI 1 "register_operand" "a")] 211))]
- "!TARGET_64BIT"
- "l\\t%0,0(%1)\;la\\t%0,0(%0,%1)"
- [(set_attr "op_type" "NN")
- (set_attr "type" "la")
- (set_attr "atype" "agen")
- (set_attr "length" "8")])
-
(define_insn "pool"
- [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] 220)]
+ [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
""
"* abort ();"
[(set_attr "op_type" "NN")
@@ -7129,78 +7293,33 @@
(define_expand "prologue"
[(use (const_int 0))]
""
- "
-{
- s390_emit_prologue ();
- DONE;
-}")
+ "s390_emit_prologue (); DONE;")
(define_expand "epilogue"
[(use (const_int 1))]
""
- "
-{
- s390_emit_epilogue ();
- DONE;
-}")
+ "s390_emit_epilogue (); DONE;")
-
-(define_insn "*return_si"
+(define_insn "*return"
[(return)
- (use (match_operand:SI 0 "register_operand" "a"))]
- "!TARGET_64BIT"
- "br\\t%0"
+ (use (match_operand 0 "register_operand" "a"))]
+ "GET_MODE (operands[0]) == Pmode"
+ "br\t%0"
[(set_attr "op_type" "RR")
- (set_attr "type" "jsr")
+ (set_attr "type" "jsr")
(set_attr "atype" "agen")])
-(define_insn "*return_di"
- [(return)
- (use (match_operand:DI 0 "register_operand" "a"))]
- "TARGET_64BIT"
- "br\\t%0"
- [(set_attr "op_type" "RR")
- (set_attr "type" "jsr")
- (set_attr "atype" "agen")])
-(define_insn "literal_pool_31"
- [(unspec_volatile [(const_int 0)] 300)
- (set (match_operand:SI 0 "register_operand" "=a")
- (label_ref (match_operand 1 "" "")))
- (use (label_ref (match_operand 2 "" "")))]
- ""
-{
- if (s390_nr_constants)
- {
- output_asm_insn ("bras\\t%0,%2", operands);
- s390_output_constant_pool (operands[1], operands[2]);
- }
- else if (flag_pic)
- {
- /* We need the anchor label in any case. */
- (*targetm.asm_out.internal_label) (asm_out_file, "L",
- CODE_LABEL_NUMBER (operands[1]));
- }
-
- return "";
-}
- [(set_attr "op_type" "NN")
- (set_attr "type" "larl")])
+;; Instruction definition to extend a 31-bit pointer into a 64-bit
+;; pointer. This is used for compatability.
-(define_insn "literal_pool_64"
- [(unspec_volatile [(const_int 0)] 300)
- (set (match_operand:DI 0 "register_operand" "=a")
- (label_ref (match_operand 1 "" "")))
- (use (label_ref (match_operand 2 "" "")))]
- ""
+(define_expand "ptr_extend"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (match_operand:SI 1 "register_operand" "r"))]
+ "TARGET_64BIT"
{
- if (s390_nr_constants)
- {
- output_asm_insn ("larl\\t%0,%1", operands);
- s390_output_constant_pool (operands[1], operands[2]);
- }
-
- return "";
-}
- [(set_attr "op_type" "NN")
- (set_attr "type" "larl")])
+ emit_insn (gen_anddi3 (operands[0],
+ gen_lowpart (DImode, operands[1]),
+ GEN_INT (0x7fffffff)));
+ DONE;
+})
diff --git a/gcc/config/sh/embed-elf.h b/gcc/config/sh/embed-elf.h
index 3d8fd59c204..e96de90b860 100644
--- a/gcc/config/sh/embed-elf.h
+++ b/gcc/config/sh/embed-elf.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler for Renesas / SuperH SH
non-Linux embedded targets.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by J"orn Rennecke <joern.rennecke@superh.com>
This file is part of GNU CC.
@@ -20,8 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "sh/elf.h"
-
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
diff --git a/gcc/config/sh/lib1funcs.asm b/gcc/config/sh/lib1funcs.asm
index 4173d8043f6..eebce2ecf96 100644
--- a/gcc/config/sh/lib1funcs.asm
+++ b/gcc/config/sh/lib1funcs.asm
@@ -1638,6 +1638,7 @@ LOCAL(large_divisor):
.section .text..SHmedia32,"ax"
.align 2
.global GLOBAL(udivdi3)
+ FUNC(GLOBAL(udivdi3))
GLOBAL(udivdi3):
shlri r3,1,r4
nsb r4,r22
@@ -1745,6 +1746,7 @@ LOCAL(no_lo_adj):
cmpgtu r5,r2,r5
sub r8,r5,r2
blink tr0,r63
+ ENDFUNC(GLOBAL(udivdi3))
/* Note 1: To shift the result of the second divide stage so that the result
always fits into 32 bits, yet we still reduce the rest sufficiently
would require a lot of instructions to do the shifts just right. Using
@@ -1763,6 +1765,7 @@ LOCAL(no_lo_adj):
.section .text..SHmedia32,"ax"
.align 2
.global GLOBAL(divdi3)
+ FUNC(GLOBAL(divdi3))
GLOBAL(divdi3):
pta GLOBAL(udivdi3),tr0
shari r2,63,r22
@@ -1776,6 +1779,7 @@ GLOBAL(divdi3):
blink tr0,r18
sub r63,r2,r2
blink tr1,r63
+ ENDFUNC(GLOBAL(divdi3))
#endif /* __SHMEDIA__ */
#endif /* L_divdi3 */
@@ -1785,6 +1789,7 @@ GLOBAL(divdi3):
.section .text..SHmedia32,"ax"
.align 2
.global GLOBAL(umoddi3)
+ FUNC(GLOBAL(umoddi3))
GLOBAL(umoddi3):
shlri r3,1,r4
nsb r4,r22
@@ -1893,6 +1898,7 @@ LOCAL(no_lo_adj):
sub r2,r5,r2
shlrd r2,r22,r2
blink tr0,r63
+ ENDFUNC(GLOBAL(umoddi3))
/* Note 1: To shift the result of the second divide stage so that the result
always fits into 32 bits, yet we still reduce the rest sufficiently
would require a lot of instructions to do the shifts just right. Using
@@ -1911,6 +1917,7 @@ LOCAL(no_lo_adj):
.section .text..SHmedia32,"ax"
.align 2
.global GLOBAL(moddi3)
+ FUNC(GLOBAL(moddi3))
GLOBAL(moddi3):
pta GLOBAL(umoddi3),tr0
shari r2,63,r22
@@ -1924,6 +1931,7 @@ GLOBAL(moddi3):
blink tr0,r18
sub r63,r2,r2
blink tr1,r63
+ ENDFUNC(GLOBAL(moddi3))
#endif /* __SHMEDIA__ */
#endif /* L_moddi3 */
@@ -1936,7 +1944,17 @@ GLOBAL(moddi3):
FUNC(GLOBAL(set_fpscr))
GLOBAL(set_fpscr):
lds r4,fpscr
+#ifdef __PIC__
+ mov.l r12,@-r15
+ mova LOCAL(set_fpscr_L0),r0
+ mov.l LOCAL(set_fpscr_L0),r12
+ add r0,r12
+ mov.l LOCAL(set_fpscr_L1),r0
+ mov.l @(r0,r12),r1
+ mov.l @r15+,r12
+#else
mov.l LOCAL(set_fpscr_L1),r1
+#endif
swap.w r4,r0
or #24,r0
#ifndef FMOVD_WORKS
@@ -1964,8 +1982,15 @@ GLOBAL(set_fpscr):
mov.l r3,@(4,r1)
#endif
.align 2
+#ifdef __PIC__
+LOCAL(set_fpscr_L0):
+ .long _GLOBAL_OFFSET_TABLE_
+LOCAL(set_fpscr_L1):
+ .long GLOBAL(fpscr_values@GOT)
+#else
LOCAL(set_fpscr_L1):
.long GLOBAL(fpscr_values)
+#endif
ENDFUNC(GLOBAL(set_fpscr))
#ifndef NO_FPSCR_VALUES
@@ -1983,6 +2008,7 @@ LOCAL(set_fpscr_L1):
.section .text..SHmedia32,"ax"
.align 2
.global GLOBAL(init_trampoline)
+ FUNC(GLOBAL(init_trampoline))
GLOBAL(init_trampoline):
st.l r0,8,r2
#ifdef __LITTLE_ENDIAN__
@@ -1999,6 +2025,7 @@ GLOBAL(init_trampoline):
st.q r0,0,r20
st.l r0,12,r3
.global GLOBAL(ic_invalidate)
+ FUNC(GLOBAL(ic_invalidate))
GLOBAL(ic_invalidate):
ocbwb r0,0
synco
@@ -2006,6 +2033,9 @@ GLOBAL(ic_invalidate):
ptabs r18, tr0
synci
blink tr0, r63
+
+ ENDFUNC(GLOBAL(ic_invalidate))
+ ENDFUNC(GLOBAL(init_trampoline))
#elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
.global GLOBAL(ic_invalidate)
FUNC(GLOBAL(ic_invalidate))
diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
index 78a40e5e3b5..f6a9d7c6449 100644
--- a/gcc/config/sh/linux.h
+++ b/gcc/config/sh/linux.h
@@ -73,15 +73,16 @@ do { \
"%{shared:-shared} \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
- %{!rpath:-rpath /lib}} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
%{static:-static}"
#undef LIB_SPEC
#define LIB_SPEC \
- "%{shared: -lc} \
+ "%{pthread:-lpthread} \
+ %{shared: -lc} \
%{!static:-rpath-link %R/lib:%R/usr/lib} \
- %{!shared: %{pthread:-lthread} \
+ %{!shared: \
+ %{mieee-fp:-lieee} \
%{profile:-lc_p} %{!profile: -lc}}"
#if defined(HAVE_LD_EH_FRAME_HDR)
@@ -104,6 +105,9 @@ do { \
#define ENDFILE_SPEC \
"%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
/* Output assembler code to STREAM to call the profiler. */
#undef FUNCTION_PROFILER
@@ -170,11 +174,11 @@ do { \
#define SH_DWARF_FRAME_FPSCR 24
#endif /* defined (__SH5__) */
-#if defined (__SH5__) && __SH5__ != 32
+#if defined (__SH5__)
/* MD_FALLBACK_FRAME_STATE_FOR is not yet defined for SHMEDIA. */
-#else /* defined (__SH5__) && __SH5__ != 32 */
+#else /* defined (__SH5__) */
-#if defined (__SH3E__) || defined (__SH4__) || defined (__SH5__)
+#if defined (__SH3E__) || defined (__SH4__)
#define SH_FALLBACK_FRAME_FLOAT_STATE(SC, FS, CFA) \
do { \
int i_, r_; \
@@ -274,5 +278,16 @@ do { \
goto SUCCESS; \
} while (0)
-#endif /* defined (__SH5__) && __SH5__ != 32 */
+#endif /* defined (__SH5__) */
#endif /* IN_LIBGCC2 */
+
+/* For SH3 and SH4, we use a slot of the unwind frame which correspond
+ to a fake register number 16 as a placeholder for the return address
+ in MD_FALLBACK_FRAME_STATE_FOR and its content will be read with
+ _Unwind_GetGR which uses dwarf_reg_size_table to get the size of
+ the register. So the entry of dwarf_reg_size_table corresponding to
+ this slot must be set. To do this, we redefine DBX_REGISTER_NUMBER
+ so as to return itself for 16. */
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(REGNO) \
+ ((! TARGET_SH5 && (REGNO) == 16) ? 16 : SH_DBX_REGISTER_NUMBER (REGNO))
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 10ef2e4a591..b87aecd0181 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
#define GCC_SH_PROTOS_H
#ifdef RTX_CODE
-extern struct rtx_def *sh_builtin_saveregs PARAMS ((void));
extern struct rtx_def *prepare_scc_operands PARAMS ((enum rtx_code));
/* Declare functions defined in sh.c and used in templates. */
@@ -121,6 +120,8 @@ extern int fldi_ok PARAMS ((void));
extern int sh_pr_n_sets PARAMS ((void));
extern int sh_hard_regno_rename_ok PARAMS ((unsigned int, unsigned int));
extern int sh_cfun_interrupt_handler_p PARAMS ((void));
+extern int sh_attr_renesas_p PARAMS ((tree));
+extern int sh_cfun_attr_renesas_p PARAMS ((void));
extern void sh_initialize_trampoline PARAMS ((rtx, rtx, rtx));
extern bool sh_cannot_change_mode_class
PARAMS ((enum machine_mode, enum machine_mode, enum reg_class));
@@ -136,5 +137,10 @@ extern void sh_pr_interrupt PARAMS ((struct cpp_reader *));
extern void sh_pr_trapa PARAMS ((struct cpp_reader *));
extern void sh_pr_nosave_low_regs PARAMS ((struct cpp_reader *));
extern rtx function_symbol (const char *);
+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);
#endif /* ! GCC_SH_PROTOS_H */
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index e1c81c9c178..a266471b063 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -108,7 +108,7 @@ rtx sh_compare_op1;
/* Provides the class number of the smallest class containing
reg number. */
-int regno_reg_class[FIRST_PSEUDO_REGISTER] =
+enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER] =
{
R0_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
@@ -190,7 +190,7 @@ static rtx find_barrier PARAMS ((int, rtx, rtx));
static int noncall_uses_reg PARAMS ((rtx, rtx, rtx *));
static rtx gen_block_redirect PARAMS ((rtx, int, int));
static void sh_reorg PARAMS ((void));
-static void output_stack_adjust PARAMS ((int, rtx, int, rtx (*) (rtx)));
+static void output_stack_adjust (int, rtx, int, HARD_REG_SET *);
static rtx frame_insn PARAMS ((rtx));
static rtx push PARAMS ((int));
static void pop PARAMS ((int));
@@ -203,6 +203,7 @@ const struct attribute_spec sh_attribute_table[];
static tree sh_handle_interrupt_handler_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree sh_handle_sp_switch_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree sh_handle_trap_exit_attribute PARAMS ((tree *, tree, tree, int, bool *));
+static tree sh_handle_renesas_attribute PARAMS ((tree *, tree, tree, int, bool *));
static void sh_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void sh_insert_attributes PARAMS ((tree, tree *));
static int sh_adjust_cost PARAMS ((rtx, rtx, rtx, int));
@@ -234,6 +235,19 @@ static int sh_address_cost PARAMS ((rtx));
static int shmedia_target_regs_stack_space (HARD_REG_SET *);
static int shmedia_reserve_space_for_target_registers_p (int, HARD_REG_SET *);
static int shmedia_target_regs_stack_adjust (HARD_REG_SET *);
+static int scavenge_reg (HARD_REG_SET *s);
+struct save_schedule_s;
+static struct save_entry_s *sh5_schedule_saves (HARD_REG_SET *,
+ struct save_schedule_s *, int);
+
+static bool sh_promote_prototypes PARAMS ((tree));
+static rtx sh_struct_value_rtx PARAMS ((tree, int));
+static bool sh_return_in_memory PARAMS ((tree, tree));
+static rtx sh_builtin_saveregs PARAMS ((void));
+static void sh_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int));
+static bool sh_strict_argument_naming PARAMS ((CUMULATIVE_ARGS *));
+static bool sh_pretend_outgoing_varargs_named PARAMS ((CUMULATIVE_ARGS *));
+
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
@@ -311,6 +325,27 @@ static int shmedia_target_regs_stack_adjust (HARD_REG_SET *);
#define TARGET_HAVE_TLS true
#endif
+#undef TARGET_PROMOTE_PROTOTYPES
+#define TARGET_PROMOTE_PROTOTYPES sh_promote_prototypes
+#undef TARGET_PROMOTE_FUNCTION_ARGS
+#define TARGET_PROMOTE_FUNCTION_ARGS sh_promote_prototypes
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN sh_promote_prototypes
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX sh_struct_value_rtx
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY sh_return_in_memory
+
+#undef TARGET_EXPAND_BUILTIN_SAVEREGS
+#define TARGET_EXPAND_BUILTIN_SAVEREGS sh_builtin_saveregs
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS sh_setup_incoming_varargs
+#undef TARGET_STRICT_ARGUMENT_NAMING
+#define TARGET_STRICT_ARGUMENT_NAMING sh_strict_argument_naming
+#undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
+#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED sh_pretend_outgoing_varargs_named
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Print the operand address in x to the stream. */
@@ -4558,17 +4593,16 @@ output_jump_label_table ()
static int extra_push;
-/* Adjust the stack by SIZE bytes. REG holds the rtl of the register
- to be adjusted, and TEMP, if nonnegative, holds the register number
- of a general register that we may clobber. */
+/* Adjust the stack by SIZE bytes. REG holds the rtl of the register to be
+ adjusted. If epilogue_p is zero, this is for a prologue; otherwise, it's
+ for an epilogue. If LIVE_REGS_MASK is nonzero, it points to a HARD_REG_SET
+ of all the registers that are about to be restored, and hence dead. */
static void
-output_stack_adjust (size, reg, temp, emit_fn)
- int size;
- rtx reg;
- int temp;
- rtx (*emit_fn) PARAMS ((rtx));
+output_stack_adjust (int size, rtx reg, int epilogue_p,
+ HARD_REG_SET *live_regs_mask)
{
+ rtx (*emit_fn) (rtx) = epilogue_p ? &emit_insn : &frame_insn;
if (size)
{
HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT;
@@ -4591,10 +4625,43 @@ output_stack_adjust (size, reg, temp, emit_fn)
{
rtx const_reg;
rtx insn;
+ int temp = epilogue_p ? 7 : (TARGET_SH5 ? 0 : 1);
+ int i;
/* If TEMP is invalid, we could temporarily save a general
register to MACL. However, there is currently no need
to handle this case, so just abort when we see it. */
+ if (current_function_interrupt
+ || ! call_used_regs[temp] || fixed_regs[temp])
+ temp = -1;
+ if (temp < 0 && ! current_function_interrupt)
+ {
+ HARD_REG_SET temps;
+ COPY_HARD_REG_SET (temps, call_used_reg_set);
+ AND_COMPL_HARD_REG_SET (temps, call_fixed_reg_set);
+ if (epilogue_p)
+ {
+ for (i = 0; i < HARD_REGNO_NREGS (FIRST_RET_REG, DImode); i++)
+ CLEAR_HARD_REG_BIT (temps, FIRST_RET_REG + i);
+ if (current_function_calls_eh_return)
+ {
+ CLEAR_HARD_REG_BIT (temps, EH_RETURN_STACKADJ_REGNO);
+ for (i = 0; i <= 3; i++)
+ CLEAR_HARD_REG_BIT (temps, EH_RETURN_DATA_REGNO (i));
+ }
+ }
+ else
+ {
+ for (i = FIRST_PARM_REG;
+ i < FIRST_PARM_REG + NPARM_REGS (SImode); i++)
+ CLEAR_HARD_REG_BIT (temps, i);
+ if (current_function_needs_context)
+ CLEAR_HARD_REG_BIT (temps, STATIC_CHAIN_REGNUM);
+ }
+ temp = scavenge_reg (&temps);
+ }
+ if (temp < 0 && live_regs_mask)
+ temp = scavenge_reg (live_regs_mask);
if (temp < 0)
abort ();
const_reg = gen_rtx_REG (GET_MODE (reg), temp);
@@ -4612,7 +4679,7 @@ output_stack_adjust (size, reg, temp, emit_fn)
emit_insn (GEN_MOV (const_reg, GEN_INT (size)));
insn = emit_fn (GEN_ADD3 (reg, reg, const_reg));
}
- if (emit_fn == frame_insn)
+ if (! epilogue_p)
REG_NOTES (insn)
= (gen_rtx_EXPR_LIST
(REG_FRAME_RELATED_EXPR,
@@ -4789,12 +4856,11 @@ calc_live_regs (live_regs_mask)
int reg;
int count;
int interrupt_handler;
- int pr_live;
+ int pr_live, has_call;
interrupt_handler = sh_cfun_interrupt_handler_p ();
- for (count = 0; 32 * count < FIRST_PSEUDO_REGISTER; count++)
- CLEAR_HARD_REG_SET (*live_regs_mask);
+ CLEAR_HARD_REG_SET (*live_regs_mask);
if (TARGET_SH4 && TARGET_FMOVD && interrupt_handler
&& regs_ever_live[FPSCR_REG])
target_flags &= ~FPU_SINGLE_BIT;
@@ -4813,7 +4879,9 @@ calc_live_regs (live_regs_mask)
the initial value can become the PR_MEDIA_REG hard register, as seen for
execute/20010122-1.c:test9. */
if (TARGET_SHMEDIA)
- pr_live = regs_ever_live[PR_MEDIA_REG];
+ /* ??? this function is called from initial_elimination_offset, hence we
+ can't use the result of sh_media_register_for_return here. */
+ pr_live = sh_pr_n_sets ();
else
{
rtx pr_initial = has_hard_reg_initial_val (Pmode, PR_REG);
@@ -4821,6 +4889,10 @@ calc_live_regs (live_regs_mask)
? (GET_CODE (pr_initial) != REG
|| REGNO (pr_initial) != (PR_REG))
: regs_ever_live[PR_REG]);
+ /* For Shcompact, if not optimizing, we end up with a memory reference
+ using the return address pointer for __builtin_return_address even
+ though there is no actual need to put the PR register on the stack. */
+ pr_live |= regs_ever_live[RETURN_ADDRESS_POINTER_REGNUM];
}
/* Force PR to be live if the prologue has to call the SHmedia
argument decoder or register saver. */
@@ -4829,6 +4901,7 @@ calc_live_regs (live_regs_mask)
& ~ CALL_COOKIE_RET_TRAMP (1))
|| current_function_has_nonlocal_label))
pr_live = 1;
+ has_call = TARGET_SHMEDIA ? ! leaf_function_p () : pr_live;
for (count = 0, reg = FIRST_PSEUDO_REGISTER - 1; reg >= 0; reg--)
{
if (reg == (TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG)
@@ -4838,7 +4911,9 @@ calc_live_regs (live_regs_mask)
(regs_ever_live[reg]
|| (call_used_regs[reg]
&& (! fixed_regs[reg] || reg == MACH_REG || reg == MACL_REG)
- && pr_live))
+ && has_call)
+ || (has_call && REGISTER_NATURAL_MODE (reg) == SImode
+ && (GENERAL_REGISTER_P (reg) || TARGET_REGISTER_P (reg))))
&& reg != STACK_POINTER_REGNUM && reg != ARG_POINTER_REGNUM
&& reg != RETURN_ADDRESS_POINTER_REGNUM
&& reg != T_REG && reg != GBR_REG
@@ -4848,13 +4923,17 @@ calc_live_regs (live_regs_mask)
(TARGET_SHCOMPACT
&& flag_pic
&& current_function_args_info.call_cookie
- && reg == PIC_OFFSET_TABLE_REGNUM)
+ && reg == (int) PIC_OFFSET_TABLE_REGNUM)
|| (regs_ever_live[reg] && ! call_used_regs[reg])
|| (current_function_calls_eh_return
- && (reg == EH_RETURN_DATA_REGNO (0)
- || reg == EH_RETURN_DATA_REGNO (1)
- || reg == EH_RETURN_DATA_REGNO (2)
- || reg == EH_RETURN_DATA_REGNO (3)))))
+ && (reg == (int) EH_RETURN_DATA_REGNO (0)
+ || reg == (int) EH_RETURN_DATA_REGNO (1)
+ || reg == (int) EH_RETURN_DATA_REGNO (2)
+ || reg == (int) EH_RETURN_DATA_REGNO (3)))
+ || ((reg == MACL_REG || reg == MACH_REG)
+ && regs_ever_live[reg]
+ && sh_cfun_attr_renesas_p ())
+ ))
{
SET_HARD_REG_BIT (*live_regs_mask, reg);
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
@@ -4891,6 +4970,19 @@ calc_live_regs (live_regs_mask)
SET_HARD_REG_BIT (*live_regs_mask, reg);
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
}
+ /* If this is an interrupt handler, we don't have any call-clobbered
+ registers we can conveniently use for target register save/restore.
+ Make sure we save at least one general purpose register when we need
+ to save target registers. */
+ if (interrupt_handler
+ && hard_regs_intersect_p (live_regs_mask,
+ &reg_class_contents[TARGET_REGS])
+ && ! hard_regs_intersect_p (live_regs_mask,
+ &reg_class_contents[GENERAL_REGS]))
+ {
+ SET_HARD_REG_BIT (*live_regs_mask, R0_REG);
+ count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (R0_REG));
+ }
return count;
}
@@ -4921,6 +5013,9 @@ sh_media_register_for_return ()
if (! current_function_is_leaf)
return -1;
+ if (lookup_attribute ("interrupt_handler",
+ DECL_ATTRIBUTES (current_function_decl)))
+ return -1;
tr0_used = flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM];
@@ -4931,6 +5026,130 @@ sh_media_register_for_return ()
return -1;
}
+/* The maximum registers we need to save are:
+ - 62 general purpose registers (r15 is stack pointer, r63 is zero)
+ - 32 floating point registers (for each pair, we save none,
+ one single precision value, or a double precision value).
+ - 8 target registers
+ - add 1 entry for a delimiter. */
+#define MAX_SAVED_REGS (62+32+8)
+
+typedef struct save_entry_s
+{
+ unsigned char reg;
+ unsigned char mode;
+ short offset;
+} save_entry;
+
+#define MAX_TEMPS 4
+
+/* There will be a delimiter entry with VOIDmode both at the start and the
+ end of a filled in schedule. The end delimiter has the offset of the
+ save with the smallest (i.e. most negative) offset. */
+typedef struct save_schedule_s
+{
+ save_entry entries[MAX_SAVED_REGS + 2];
+ int temps[MAX_TEMPS+1];
+} save_schedule;
+
+/* Fill in SCHEDULE according to LIVE_REGS_MASK. If RESTORE is nonzero,
+ use reverse order. Returns the last entry written to (not counting
+ the delimiter). OFFSET_BASE is a number to be added to all offset
+ entries. */
+
+static save_entry *
+sh5_schedule_saves (HARD_REG_SET *live_regs_mask, save_schedule *schedule,
+ int offset_base)
+{
+ int align, i;
+ save_entry *entry = schedule->entries;
+ int tmpx = 0;
+ int offset;
+
+ if (! current_function_interrupt)
+ for (i = FIRST_GENERAL_REG; tmpx < MAX_TEMPS && i <= LAST_GENERAL_REG; i++)
+ if (call_used_regs[i] && ! fixed_regs[i] && i != PR_MEDIA_REG
+ && ! FUNCTION_ARG_REGNO_P (i)
+ && i != FIRST_RET_REG
+ && ! (current_function_needs_context && i == STATIC_CHAIN_REGNUM)
+ && ! (current_function_calls_eh_return
+ && (i == EH_RETURN_STACKADJ_REGNO
+ || ((unsigned)i <= EH_RETURN_DATA_REGNO (0)
+ && (unsigned)i >= EH_RETURN_DATA_REGNO (3)))))
+ schedule->temps[tmpx++] = i;
+ entry->reg = -1;
+ entry->mode = VOIDmode;
+ entry->offset = offset_base;
+ entry++;
+ /* We loop twice: first, we save 8-byte aligned registers in the
+ higher addresses, that are known to be aligned. Then, we
+ proceed to saving 32-bit registers that don't need 8-byte
+ alignment.
+ If this is an interrupt function, all registers that need saving
+ need to be saved in full. moreover, we need to postpone saving
+ target registers till we have saved some general purpose registers
+ we can then use as scratch registers. */
+ offset = offset_base;
+ for (align = 1; align >= 0; align--)
+ {
+ for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
+ if (TEST_HARD_REG_BIT (*live_regs_mask, i))
+ {
+ enum machine_mode mode = REGISTER_NATURAL_MODE (i);
+ int reg = i;
+
+ if (current_function_interrupt)
+ {
+ if (TARGET_REGISTER_P (i))
+ continue;
+ if (GENERAL_REGISTER_P (i))
+ mode = DImode;
+ }
+ if (mode == SFmode && (i % 2) == 1
+ && ! TARGET_FPU_SINGLE && FP_REGISTER_P (i)
+ && (TEST_HARD_REG_BIT (*live_regs_mask, (i ^ 1))))
+ {
+ mode = DFmode;
+ i--;
+ reg--;
+ }
+
+ /* If we're doing the aligned pass and this is not aligned,
+ or we're doing the unaligned pass and this is aligned,
+ skip it. */
+ if ((GET_MODE_SIZE (mode) % (STACK_BOUNDARY / BITS_PER_UNIT) == 0)
+ != align)
+ continue;
+
+ if (current_function_interrupt
+ && GENERAL_REGISTER_P (i)
+ && tmpx < MAX_TEMPS)
+ schedule->temps[tmpx++] = i;
+
+ offset -= GET_MODE_SIZE (mode);
+ entry->reg = i;
+ entry->mode = mode;
+ entry->offset = offset;
+ entry++;
+ }
+ if (align && current_function_interrupt)
+ for (i = LAST_TARGET_REG; i >= FIRST_TARGET_REG; i--)
+ if (TEST_HARD_REG_BIT (*live_regs_mask, i))
+ {
+ offset -= GET_MODE_SIZE (DImode);
+ entry->reg = i;
+ entry->mode = DImode;
+ entry->offset = offset;
+ entry++;
+ }
+ }
+ entry->reg = -1;
+ entry->mode = VOIDmode;
+ entry->offset = offset;
+ schedule->temps[tmpx] = -1;
+ return entry - 1;
+}
+
void
sh_expand_prologue ()
{
@@ -4945,7 +5164,7 @@ sh_expand_prologue ()
and partially on the stack, e.g. a large structure. */
output_stack_adjust (-current_function_pretend_args_size
- current_function_args_info.stack_regs * 8,
- stack_pointer_rtx, TARGET_SH5 ? 0 : 1, frame_insn);
+ stack_pointer_rtx, 0, NULL);
extra_push = 0;
@@ -4991,6 +5210,9 @@ sh_expand_prologue ()
rtx insn = emit_move_insn (gen_rtx_REG (DImode, tr),
gen_rtx_REG (DImode, PR_MEDIA_REG));
+ /* ??? We should suppress saving pr when we don't need it, but this
+ is tricky because of builtin_return_address. */
+
/* If this function only exits with sibcalls, this copy
will be flagged as dead. */
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD,
@@ -5003,7 +5225,8 @@ sh_expand_prologue ()
if (current_function_stdarg)
{
/* This is not used by the SH2E calling convention */
- if (TARGET_SH1 && ! TARGET_SH2E && ! TARGET_SH5 && ! TARGET_HITACHI)
+ if (TARGET_SH1 && ! TARGET_SH2E && ! TARGET_SH5
+ && ! (TARGET_HITACHI || sh_cfun_attr_renesas_p ()))
{
/* Push arg regs as if they'd been provided by caller in stack. */
for (i = 0; i < NPARM_REGS(SImode); i++)
@@ -5034,14 +5257,19 @@ sh_expand_prologue ()
if (TARGET_SH5)
{
- int i;
- int offset;
- int align;
- rtx r0 = gen_rtx_REG (Pmode, R0_REG);
+ int offset_base, offset;
+ rtx r0 = NULL_RTX;
int offset_in_r0 = -1;
int sp_in_r0 = 0;
int tregs_space = shmedia_target_regs_stack_adjust (&live_regs_mask);
int total_size, save_size;
+ save_schedule schedule;
+ save_entry *entry;
+ int *tmp_pnt;
+
+ if (call_used_regs[R0_REG] && ! fixed_regs[R0_REG]
+ && ! current_function_interrupt)
+ r0 = gen_rtx_REG (Pmode, R0_REG);
/* D is the actual number of bytes that we need for saving registers,
however, in initial_elimination_offset we have committed to using
@@ -5067,146 +5295,153 @@ sh_expand_prologue ()
&& total_size <= 2044)))
d_rounding = total_size - save_size;
- offset = d + d_rounding;
+ offset_base = d + d_rounding;
output_stack_adjust (-(save_size + d_rounding), stack_pointer_rtx,
- 1, frame_insn);
-
- /* We loop twice: first, we save 8-byte aligned registers in the
- higher addresses, that are known to be aligned. Then, we
- proceed to saving 32-bit registers that don't need 8-byte
- alignment. */
- /* Note that if you change this code in a way that affects where
- the return register is saved, you have to update not only
- sh_expand_epilogue, but also sh_set_return_address. */
- for (align = 1; align >= 0; align--)
- for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
- if (TEST_HARD_REG_BIT (live_regs_mask, i))
- {
- enum machine_mode mode = REGISTER_NATURAL_MODE (i);
- int reg = i;
- rtx reg_rtx, mem_rtx, pre_dec = NULL_RTX;
+ 0, NULL);
- if (mode == SFmode && (i % 2) == 1
- && ! TARGET_FPU_SINGLE && FP_REGISTER_P (i)
- && (TEST_HARD_REG_BIT (live_regs_mask, (i ^ 1))))
- {
- mode = DFmode;
- i--;
- reg--;
- }
-
- /* If we're doing the aligned pass and this is not aligned,
- or we're doing the unaligned pass and this is aligned,
- skip it. */
- if ((GET_MODE_SIZE (mode) % (STACK_BOUNDARY / BITS_PER_UNIT)
- == 0) != align)
- continue;
+ sh5_schedule_saves (&live_regs_mask, &schedule, offset_base);
+ tmp_pnt = schedule.temps;
+ for (entry = &schedule.entries[1]; entry->mode != VOIDmode; entry++)
+ {
+ enum machine_mode mode = entry->mode;
+ int reg = entry->reg;
+ rtx reg_rtx, mem_rtx, pre_dec = NULL_RTX;
- offset -= GET_MODE_SIZE (mode);
+ offset = entry->offset;
- reg_rtx = gen_rtx_REG (mode, reg);
+ reg_rtx = gen_rtx_REG (mode, reg);
- mem_rtx = gen_rtx_MEM (mode,
- gen_rtx_PLUS (Pmode,
- stack_pointer_rtx,
- GEN_INT (offset)));
+ mem_rtx = gen_rtx_MEM (mode,
+ gen_rtx_PLUS (Pmode,
+ stack_pointer_rtx,
+ GEN_INT (offset)));
- GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (mem_rtx, 0), try_pre_dec);
+ GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (mem_rtx, 0), try_pre_dec);
- mem_rtx = NULL_RTX;
+ if (! r0)
+ abort ();
+ mem_rtx = NULL_RTX;
- try_pre_dec:
- do
- if (HAVE_PRE_DECREMENT
- && (offset_in_r0 - offset == GET_MODE_SIZE (mode)
- || mem_rtx == NULL_RTX
- || i == PR_REG || SPECIAL_REGISTER_P (i)))
- {
- pre_dec = gen_rtx_MEM (mode,
- gen_rtx_PRE_DEC (Pmode, r0));
+ try_pre_dec:
+ do
+ if (HAVE_PRE_DECREMENT
+ && (offset_in_r0 - offset == GET_MODE_SIZE (mode)
+ || mem_rtx == NULL_RTX
+ || reg == PR_REG || SPECIAL_REGISTER_P (reg)))
+ {
+ pre_dec = gen_rtx_MEM (mode,
+ gen_rtx_PRE_DEC (Pmode, r0));
- GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (pre_dec, 0),
- pre_dec_ok);
+ GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (pre_dec, 0),
+ pre_dec_ok);
- pre_dec = NULL_RTX;
+ pre_dec = NULL_RTX;
- break;
+ break;
- pre_dec_ok:
- mem_rtx = NULL_RTX;
- offset += GET_MODE_SIZE (mode);
- }
- while (0);
+ pre_dec_ok:
+ mem_rtx = NULL_RTX;
+ offset += GET_MODE_SIZE (mode);
+ }
+ while (0);
- if (mem_rtx != NULL_RTX)
- goto addr_ok;
+ if (mem_rtx != NULL_RTX)
+ goto addr_ok;
- if (offset_in_r0 == -1)
- {
- emit_move_insn (r0, GEN_INT (offset));
- offset_in_r0 = offset;
- }
- else if (offset != offset_in_r0)
+ if (offset_in_r0 == -1)
+ {
+ emit_move_insn (r0, GEN_INT (offset));
+ offset_in_r0 = offset;
+ }
+ else if (offset != offset_in_r0)
+ {
+ emit_move_insn (r0,
+ gen_rtx_PLUS
+ (Pmode, r0,
+ GEN_INT (offset - offset_in_r0)));
+ offset_in_r0 += offset - offset_in_r0;
+ }
+
+ if (pre_dec != NULL_RTX)
+ {
+ if (! sp_in_r0)
{
emit_move_insn (r0,
gen_rtx_PLUS
- (Pmode, r0,
- GEN_INT (offset - offset_in_r0)));
- offset_in_r0 += offset - offset_in_r0;
+ (Pmode, r0, stack_pointer_rtx));
+ sp_in_r0 = 1;
}
-
- if (pre_dec != NULL_RTX)
- {
- if (! sp_in_r0)
- {
- emit_move_insn (r0,
- gen_rtx_PLUS
- (Pmode, r0, stack_pointer_rtx));
- sp_in_r0 = 1;
- }
- offset -= GET_MODE_SIZE (mode);
- offset_in_r0 -= GET_MODE_SIZE (mode);
+ offset -= GET_MODE_SIZE (mode);
+ offset_in_r0 -= GET_MODE_SIZE (mode);
- mem_rtx = pre_dec;
- }
- else if (sp_in_r0)
- mem_rtx = gen_rtx_MEM (mode, r0);
- else
- mem_rtx = gen_rtx_MEM (mode,
- gen_rtx_PLUS (Pmode,
- stack_pointer_rtx,
- r0));
-
- /* We must not use an r0-based address for target-branch
- registers or for special registers without pre-dec
- memory addresses, since we store their values in r0
- first. */
- if (TARGET_REGISTER_P (i)
- || ((i == PR_REG || SPECIAL_REGISTER_P (i))
- && mem_rtx != pre_dec))
- abort ();
-
- addr_ok:
- if (TARGET_REGISTER_P (i)
- || ((i == PR_REG || SPECIAL_REGISTER_P (i))
- && mem_rtx != pre_dec))
- {
- rtx r0mode = gen_rtx_REG (GET_MODE (reg_rtx), R0_REG);
+ mem_rtx = pre_dec;
+ }
+ else if (sp_in_r0)
+ mem_rtx = gen_rtx_MEM (mode, r0);
+ else
+ mem_rtx = gen_rtx_MEM (mode,
+ gen_rtx_PLUS (Pmode,
+ stack_pointer_rtx,
+ r0));
+
+ /* We must not use an r0-based address for target-branch
+ registers or for special registers without pre-dec
+ memory addresses, since we store their values in r0
+ first. */
+ if (TARGET_REGISTER_P (reg)
+ || ((reg == PR_REG || SPECIAL_REGISTER_P (reg))
+ && mem_rtx != pre_dec))
+ abort ();
- emit_move_insn (r0mode, reg_rtx);
+ addr_ok:
+ if (TARGET_REGISTER_P (reg)
+ || ((reg == PR_REG || SPECIAL_REGISTER_P (reg))
+ && mem_rtx != pre_dec))
+ {
+ rtx tmp_reg = gen_rtx_REG (GET_MODE (reg_rtx), *tmp_pnt);
+
+ emit_move_insn (tmp_reg, reg_rtx);
+ if (REGNO (tmp_reg) == R0_REG)
+ {
offset_in_r0 = -1;
sp_in_r0 = 0;
-
- reg_rtx = r0mode;
+ if (refers_to_regno_p (R0_REG, R0_REG+1, mem_rtx, (rtx *) 0))
+ abort ();
}
- emit_move_insn (mem_rtx, reg_rtx);
+ if (*++tmp_pnt <= 0)
+ tmp_pnt = schedule.temps;
+
+ reg_rtx = tmp_reg;
}
+ {
+ rtx insn;
+
+ /* Mark as interesting for dwarf cfi generator */
+ insn = emit_move_insn (mem_rtx, reg_rtx);
+ RTX_FRAME_RELATED_P (insn) = 1;
- if (offset != d_rounding)
+ if (TARGET_SHCOMPACT && (offset_in_r0 != -1))
+ {
+ rtx reg_rtx = gen_rtx_REG (mode, reg);
+ rtx set, note_rtx;
+ rtx mem_rtx = gen_rtx_MEM (mode,
+ gen_rtx_PLUS (Pmode,
+ stack_pointer_rtx,
+ GEN_INT (offset)));
+
+ set = gen_rtx_SET (VOIDmode, mem_rtx, reg_rtx);
+ note_rtx = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, set,
+ REG_NOTES (insn));
+ REG_NOTES (insn) = note_rtx;
+ }
+ }
+ }
+
+ if (entry->offset != d_rounding)
abort ();
}
else
@@ -5258,7 +5493,7 @@ sh_expand_prologue ()
target_flags = save_flags;
output_stack_adjust (-rounded_frame_size (d) + d_rounding,
- stack_pointer_rtx, TARGET_SH5 ? 0 : 1, frame_insn);
+ stack_pointer_rtx, 0, NULL);
if (frame_pointer_needed)
frame_insn (GEN_MOV (frame_pointer_rtx, stack_pointer_rtx));
@@ -5318,7 +5553,7 @@ sh_expand_epilogue ()
if (frame_pointer_needed)
{
- output_stack_adjust (frame_size, frame_pointer_rtx, 7, emit_insn);
+ output_stack_adjust (frame_size, frame_pointer_rtx, 1, &live_regs_mask);
/* We must avoid moving the stack pointer adjustment past code
which reads from the local frame, else an interrupt could
@@ -5334,7 +5569,7 @@ sh_expand_epilogue ()
occur after the SP adjustment and clobber data in the local
frame. */
emit_insn (gen_blockage ());
- output_stack_adjust (frame_size, stack_pointer_rtx, 7, emit_insn);
+ output_stack_adjust (frame_size, stack_pointer_rtx, 1, &live_regs_mask);
}
if (SHMEDIA_REGS_STACK_ADJUST ())
@@ -5355,143 +5590,129 @@ sh_expand_epilogue ()
emit_insn (gen_toggle_sz ());
if (TARGET_SH5)
{
- int offset = d_rounding;
+ int offset_base, offset;
int offset_in_r0 = -1;
int sp_in_r0 = 0;
- int align;
rtx r0 = gen_rtx_REG (Pmode, R0_REG);
- int tmp_regno = R20_REG;
-
- /* We loop twice: first, we save 8-byte aligned registers in the
- higher addresses, that are known to be aligned. Then, we
- proceed to saving 32-bit registers that don't need 8-byte
- alignment. */
- for (align = 0; align <= 1; align++)
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (TEST_HARD_REG_BIT (live_regs_mask, i))
- {
- enum machine_mode mode = REGISTER_NATURAL_MODE (i);
- int reg = i;
- rtx reg_rtx, mem_rtx, post_inc = NULL_RTX, insn;
+ save_schedule schedule;
+ save_entry *entry;
+ int *tmp_pnt;
+
+ entry = sh5_schedule_saves (&live_regs_mask, &schedule, d_rounding);
+ offset_base = -entry[1].offset + d_rounding;
+ tmp_pnt = schedule.temps;
+ for (; entry->mode != VOIDmode; entry--)
+ {
+ enum machine_mode mode = entry->mode;
+ int reg = entry->reg;
+ rtx reg_rtx, mem_rtx, post_inc = NULL_RTX, insn;
- if (mode == SFmode && (i % 2) == 0
- && ! TARGET_FPU_SINGLE && FP_REGISTER_P (i)
- && (TEST_HARD_REG_BIT (live_regs_mask, (i ^ 1))))
- {
- mode = DFmode;
- i++;
- }
+ offset = offset_base + entry->offset;
+ reg_rtx = gen_rtx_REG (mode, reg);
- /* If we're doing the aligned pass and this is not aligned,
- or we're doing the unaligned pass and this is aligned,
- skip it. */
- if ((GET_MODE_SIZE (mode) % (STACK_BOUNDARY / BITS_PER_UNIT)
- == 0) != align)
- continue;
+ mem_rtx = gen_rtx_MEM (mode,
+ gen_rtx_PLUS (Pmode,
+ stack_pointer_rtx,
+ GEN_INT (offset)));
- reg_rtx = gen_rtx_REG (mode, reg);
+ GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (mem_rtx, 0), try_post_inc);
- mem_rtx = gen_rtx_MEM (mode,
- gen_rtx_PLUS (Pmode,
- stack_pointer_rtx,
- GEN_INT (offset)));
+ mem_rtx = NULL_RTX;
- GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (mem_rtx, 0), try_post_inc);
-
- mem_rtx = NULL_RTX;
+ try_post_inc:
+ do
+ if (HAVE_POST_INCREMENT
+ && (offset == offset_in_r0
+ || (offset + GET_MODE_SIZE (mode) != d + d_rounding
+ && mem_rtx == NULL_RTX)
+ || reg == PR_REG || SPECIAL_REGISTER_P (reg)))
+ {
+ post_inc = gen_rtx_MEM (mode,
+ gen_rtx_POST_INC (Pmode, r0));
- try_post_inc:
- do
- if (HAVE_POST_INCREMENT
- && (offset == offset_in_r0
- || (offset + GET_MODE_SIZE (mode) != d + d_rounding
- && mem_rtx == NULL_RTX)
- || i == PR_REG || SPECIAL_REGISTER_P (i)))
- {
- post_inc = gen_rtx_MEM (mode,
- gen_rtx_POST_INC (Pmode, r0));
+ GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (post_inc, 0),
+ post_inc_ok);
- GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (post_inc, 0),
- post_inc_ok);
+ post_inc = NULL_RTX;
- post_inc = NULL_RTX;
+ break;
+
+ post_inc_ok:
+ mem_rtx = NULL_RTX;
+ }
+ while (0);
+
+ if (mem_rtx != NULL_RTX)
+ goto addr_ok;
- break;
-
- post_inc_ok:
- mem_rtx = NULL_RTX;
- }
- while (0);
+ if (offset_in_r0 == -1)
+ {
+ emit_move_insn (r0, GEN_INT (offset));
+ offset_in_r0 = offset;
+ }
+ else if (offset != offset_in_r0)
+ {
+ emit_move_insn (r0,
+ gen_rtx_PLUS
+ (Pmode, r0,
+ GEN_INT (offset - offset_in_r0)));
+ offset_in_r0 += offset - offset_in_r0;
+ }
- if (mem_rtx != NULL_RTX)
- goto addr_ok;
-
- if (offset_in_r0 == -1)
- {
- emit_move_insn (r0, GEN_INT (offset));
- offset_in_r0 = offset;
- }
- else if (offset != offset_in_r0)
+ if (post_inc != NULL_RTX)
+ {
+ if (! sp_in_r0)
{
emit_move_insn (r0,
gen_rtx_PLUS
- (Pmode, r0,
- GEN_INT (offset - offset_in_r0)));
- offset_in_r0 += offset - offset_in_r0;
+ (Pmode, r0, stack_pointer_rtx));
+ sp_in_r0 = 1;
}
-
- if (post_inc != NULL_RTX)
- {
- if (! sp_in_r0)
- {
- emit_move_insn (r0,
- gen_rtx_PLUS
- (Pmode, r0, stack_pointer_rtx));
- sp_in_r0 = 1;
- }
-
- mem_rtx = post_inc;
+
+ mem_rtx = post_inc;
- offset_in_r0 += GET_MODE_SIZE (mode);
- }
- else if (sp_in_r0)
- mem_rtx = gen_rtx_MEM (mode, r0);
- else
- mem_rtx = gen_rtx_MEM (mode,
- gen_rtx_PLUS (Pmode,
- stack_pointer_rtx,
- r0));
-
- if ((i == PR_REG || SPECIAL_REGISTER_P (i))
- && mem_rtx != post_inc)
- abort ();
-
- addr_ok:
- if ((i == PR_REG || SPECIAL_REGISTER_P (i))
- && mem_rtx != post_inc)
- {
- insn = emit_move_insn (r0, mem_rtx);
- mem_rtx = r0;
- }
- else if (TARGET_REGISTER_P (i))
- {
- rtx tmp_reg = gen_rtx_REG (mode, tmp_regno);
-
- /* Give the scheduler a bit of freedom by using R20..R23
- in a round-robin fashion. Don't use R1 here because
- we want to use it for EH_RETURN_STACKADJ_RTX. */
- insn = emit_move_insn (tmp_reg, mem_rtx);
- mem_rtx = tmp_reg;
- if (++tmp_regno > R23_REG)
- tmp_regno = R20_REG;
- }
+ offset_in_r0 += GET_MODE_SIZE (mode);
+ }
+ else if (sp_in_r0)
+ mem_rtx = gen_rtx_MEM (mode, r0);
+ else
+ mem_rtx = gen_rtx_MEM (mode,
+ gen_rtx_PLUS (Pmode,
+ stack_pointer_rtx,
+ r0));
- insn = emit_move_insn (reg_rtx, mem_rtx);
+ if ((reg == PR_REG || SPECIAL_REGISTER_P (reg))
+ && mem_rtx != post_inc)
+ abort ();
- offset += GET_MODE_SIZE (mode);
+ addr_ok:
+ if ((reg == PR_REG || SPECIAL_REGISTER_P (reg))
+ && mem_rtx != post_inc)
+ {
+ insn = emit_move_insn (r0, mem_rtx);
+ mem_rtx = r0;
}
+ else if (TARGET_REGISTER_P (reg))
+ {
+ rtx tmp_reg = gen_rtx_REG (mode, *tmp_pnt);
+
+ /* Give the scheduler a bit of freedom by using up to
+ MAX_TEMPS registers in a round-robin fashion. */
+ insn = emit_move_insn (tmp_reg, mem_rtx);
+ mem_rtx = tmp_reg;
+ if (*++tmp_pnt < 0)
+ tmp_pnt = schedule.temps;
+ }
+
+ insn = emit_move_insn (reg_rtx, mem_rtx);
+ if (reg == PR_MEDIA_REG && sh_media_register_for_return () >= 0)
+ /* This is dead, unless we return with a sibcall. */
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD,
+ const0_rtx,
+ REG_NOTES (insn));
+ }
- if (offset != d + d_rounding)
+ if (entry->offset + offset_base != d + d_rounding)
abort ();
}
else /* ! TARGET_SH5 */
@@ -5521,7 +5742,7 @@ sh_expand_epilogue ()
output_stack_adjust (extra_push + current_function_pretend_args_size
+ save_size + d_rounding
+ current_function_args_info.stack_regs * 8,
- stack_pointer_rtx, 7, emit_insn);
+ stack_pointer_rtx, 1, NULL);
if (current_function_calls_eh_return)
emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx,
@@ -5566,7 +5787,6 @@ sh_set_return_address (ra, tmp)
{
HARD_REG_SET live_regs_mask;
int d;
- int d_rounding = 0;
int pr_reg = TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG;
int pr_offset;
@@ -5598,56 +5818,26 @@ sh_set_return_address (ra, tmp)
if (TARGET_SH5)
{
- int i;
int offset;
- int align;
+ save_schedule schedule;
+ save_entry *entry;
- if (d % (STACK_BOUNDARY / BITS_PER_UNIT))
- d_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
- - d % (STACK_BOUNDARY / BITS_PER_UNIT));
-
- offset = 0;
-
- /* We loop twice: first, we save 8-byte aligned registers in the
- higher addresses, that are known to be aligned. Then, we
- proceed to saving 32-bit registers that don't need 8-byte
- alignment. */
- for (align = 0; align <= 1; align++)
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (TEST_HARD_REG_BIT (live_regs_mask, i))
- {
- enum machine_mode mode = REGISTER_NATURAL_MODE (i);
-
- if (mode == SFmode && (i % 2) == 0
- && ! TARGET_FPU_SINGLE && FP_REGISTER_P (i)
- && (TEST_HARD_REG_BIT (live_regs_mask, (i ^ 1))))
- {
- mode = DFmode;
- i++;
- }
-
- /* If we're doing the aligned pass and this is not aligned,
- or we're doing the unaligned pass and this is aligned,
- skip it. */
- if ((GET_MODE_SIZE (mode) % (STACK_BOUNDARY / BITS_PER_UNIT)
- == 0) != align)
- continue;
-
- if (i == pr_reg)
- goto found;
-
- offset += GET_MODE_SIZE (mode);
- }
+ entry = sh5_schedule_saves (&live_regs_mask, &schedule, 0);
+ offset = entry[1].offset;
+ for (; entry->mode != VOIDmode; entry--)
+ if (entry->reg == pr_reg)
+ goto found;
/* We can't find pr register. */
abort ();
found:
- pr_offset = (rounded_frame_size (d) - d_rounding + offset
+ offset = entry->offset - offset;
+ pr_offset = (rounded_frame_size (d) + offset
+ SHMEDIA_REGS_STACK_ADJUST ());
}
else
- pr_offset = rounded_frame_size (d) - d_rounding;
+ pr_offset = rounded_frame_size (d);
emit_insn (GEN_MOV (tmp, GEN_INT (pr_offset)));
emit_insn (GEN_ADD3 (tmp, tmp, frame_pointer_rtx));
@@ -5668,7 +5858,7 @@ sh_output_function_epilogue (file, size)
sp_switch = NULL_RTX;
}
-rtx
+static rtx
sh_builtin_saveregs ()
{
/* First unnamed integer register. */
@@ -5818,7 +6008,8 @@ sh_build_va_list ()
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
tree record;
- if (TARGET_SH5 || (! TARGET_SH2E && ! TARGET_SH4) || TARGET_HITACHI)
+ if (TARGET_SH5 || (! TARGET_SH2E && ! TARGET_SH4)
+ || TARGET_HITACHI || sh_cfun_attr_renesas_p ())
return ptr_type_node;
record = make_node (RECORD_TYPE);
@@ -5872,7 +6063,8 @@ sh_va_start (valist, nextarg)
return;
}
- if ((! TARGET_SH2E && ! TARGET_SH4) || TARGET_HITACHI)
+ if ((! TARGET_SH2E && ! TARGET_SH4)
+ || TARGET_HITACHI || sh_cfun_attr_renesas_p ())
{
std_expand_builtin_va_start (valist, nextarg);
return;
@@ -5951,7 +6143,8 @@ sh_va_arg (valist, type)
if (pass_by_ref)
type = build_pointer_type (type);
- if (! TARGET_SH5 && (TARGET_SH2E || TARGET_SH4) && ! TARGET_HITACHI)
+ if (! TARGET_SH5 && (TARGET_SH2E || TARGET_SH4)
+ && ! (TARGET_HITACHI || sh_cfun_attr_renesas_p ()))
{
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
@@ -6135,6 +6328,343 @@ sh_va_arg (valist, type)
return result;
}
+static bool
+sh_promote_prototypes (type)
+ tree type;
+{
+ if (TARGET_HITACHI)
+ return 0;
+ if (! type)
+ return 1;
+ return ! sh_attr_renesas_p (type);
+}
+
+/* Define where to put the arguments to a function.
+ Value is zero to push the argument on the stack,
+ or a hard register in which to store the argument.
+
+ MODE is the argument's machine mode.
+ TYPE is the data type of the argument (as a tree).
+ This is null for libcalls where that information may
+ not be available.
+ CUM is a variable of type CUMULATIVE_ARGS which gives info about
+ the preceding args and about the function being called.
+ NAMED is nonzero if this argument is a named parameter
+ (otherwise it is an extra parameter matching an ellipsis).
+
+ On SH the first args are normally in registers
+ and the rest are pushed. Any arg that starts within the first
+ NPARM_REGS words is at least partially passed in a register unless
+ its data type forbids. */
+
+
+rtx
+sh_function_arg (ca, mode, type, named)
+ CUMULATIVE_ARGS *ca;
+ enum machine_mode mode;
+ tree type;
+ int named;
+{
+ if (! TARGET_SH5 && mode == VOIDmode)
+ return GEN_INT (ca->renesas_abi ? 1 : 0);
+
+ if (! TARGET_SH5
+ && PASS_IN_REG_P (*ca, mode, type)
+ && (named || ! (TARGET_HITACHI || ca->renesas_abi)))
+ {
+ int regno;
+
+ if (mode == SCmode && TARGET_SH4 && TARGET_LITTLE_ENDIAN
+ && (! FUNCTION_ARG_SCmode_WART || (ROUND_REG (*ca, mode) & 1)))
+ {
+ rtx r1 = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SFmode,
+ BASE_ARG_REG (mode)
+ + (ROUND_REG (*ca, mode) ^ 1)),
+ const0_rtx);
+ rtx r2 = gen_rtx_EXPR_LIST(VOIDmode,
+ gen_rtx_REG (SFmode,
+ BASE_ARG_REG (mode)
+ + ((ROUND_REG (*ca, mode) + 1) ^ 1)),
+ GEN_INT (4));
+ return gen_rtx_PARALLEL(SCmode, gen_rtvec(2, r1, r2));
+ }
+
+ /* If the alignment of a DF value causes an SF register to be
+ skipped, we will use that skipped register for the next SF
+ value. */
+ if ((TARGET_HITACHI || ca->renesas_abi)
+ && ca->free_single_fp_reg
+ && mode == SFmode)
+ return gen_rtx_REG (mode, ca->free_single_fp_reg);
+
+ regno = (BASE_ARG_REG (mode) + ROUND_REG (*ca, mode))
+ ^ (mode == SFmode && TARGET_SH4
+ && TARGET_LITTLE_ENDIAN != 0
+ && ! TARGET_HITACHI && ! ca->renesas_abi);
+ return gen_rtx_REG (mode, regno);
+
+ }
+
+ if (TARGET_SH5)
+ {
+ if (mode == VOIDmode && TARGET_SHCOMPACT)
+ return GEN_INT (ca->call_cookie);
+
+ /* The following test assumes unnamed arguments are promoted to
+ DFmode. */
+ if (mode == SFmode && ca->free_single_fp_reg)
+ return SH5_PROTOTYPED_FLOAT_ARG (*ca, mode, ca->free_single_fp_reg);
+
+ if ((GET_SH_ARG_CLASS (mode) == SH_ARG_FLOAT)
+ && (named || ! ca->prototype_p)
+ && ca->arg_count[(int) SH_ARG_FLOAT] < NPARM_REGS (SFmode))
+ {
+ if (! ca->prototype_p && TARGET_SHMEDIA)
+ return SH5_PROTOTYPELESS_FLOAT_ARG (*ca, mode);
+
+ return SH5_PROTOTYPED_FLOAT_ARG (*ca, mode,
+ FIRST_FP_PARM_REG
+ + ca->arg_count[(int) SH_ARG_FLOAT]);
+ }
+
+ if (ca->arg_count[(int) SH_ARG_INT] < NPARM_REGS (SImode)
+ && (! TARGET_SHCOMPACT
+ || (! SHCOMPACT_FORCE_ON_STACK (mode, type)
+ && ! SH5_WOULD_BE_PARTIAL_NREGS (*ca, mode,
+ type, named))))
+ {
+ return gen_rtx_REG (mode, (FIRST_PARM_REG
+ + ca->arg_count[(int) SH_ARG_INT]));
+ }
+
+ return 0;
+ }
+
+ return 0;
+}
+
+/* Update the data in CUM to advance over an argument
+ of mode MODE and data type TYPE.
+ (TYPE is null for libcalls where that information may not be
+ available.) */
+
+void
+sh_function_arg_advance (ca, mode, type, named)
+ CUMULATIVE_ARGS *ca;
+ enum machine_mode mode;
+ tree type;
+ int named;
+{
+ if (ca->force_mem)
+ ca->force_mem = 0;
+ else if (TARGET_SH5)
+ {
+ tree type2 = (ca->byref && type
+ ? TREE_TYPE (type)
+ : type);
+ enum machine_mode mode2 = (ca->byref && type
+ ? TYPE_MODE (type2)
+ : mode);
+ int dwords = ((ca->byref
+ ? ca->byref
+ : mode2 == BLKmode
+ ? int_size_in_bytes (type2)
+ : GET_MODE_SIZE (mode2)) + 7) / 8;
+ int numregs = MIN (dwords, NPARM_REGS (SImode)
+ - ca->arg_count[(int) SH_ARG_INT]);
+
+ if (numregs)
+ {
+ ca->arg_count[(int) SH_ARG_INT] += numregs;
+ if (TARGET_SHCOMPACT
+ && SHCOMPACT_FORCE_ON_STACK (mode2, type2))
+ {
+ ca->call_cookie
+ |= CALL_COOKIE_INT_REG (ca->arg_count[(int) SH_ARG_INT]
+ - numregs, 1);
+ /* N.B. We want this also for outgoing. */
+ ca->stack_regs += numregs;
+ }
+ else if (ca->byref)
+ {
+ if (! ca->outgoing)
+ ca->stack_regs += numregs;
+ ca->byref_regs += numregs;
+ ca->byref = 0;
+ do
+ ca->call_cookie
+ |= CALL_COOKIE_INT_REG (ca->arg_count[(int) SH_ARG_INT]
+ - numregs, 2);
+ while (--numregs);
+ ca->call_cookie
+ |= CALL_COOKIE_INT_REG (ca->arg_count[(int) SH_ARG_INT]
+ - 1, 1);
+ }
+ else if (dwords > numregs)
+ {
+ int pushregs = numregs;
+
+ if (TARGET_SHCOMPACT)
+ ca->stack_regs += numregs;
+ while (pushregs < NPARM_REGS (SImode) - 1
+ && (CALL_COOKIE_INT_REG_GET
+ (ca->call_cookie,
+ NPARM_REGS (SImode) - pushregs)
+ == 1))
+ {
+ ca->call_cookie
+ &= ~ CALL_COOKIE_INT_REG (NPARM_REGS (SImode)
+ - pushregs, 1);
+ pushregs++;
+ }
+ if (numregs == NPARM_REGS (SImode))
+ ca->call_cookie
+ |= CALL_COOKIE_INT_REG (0, 1)
+ | CALL_COOKIE_STACKSEQ (numregs - 1);
+ else
+ ca->call_cookie
+ |= CALL_COOKIE_STACKSEQ (numregs);
+ }
+ }
+ if (GET_SH_ARG_CLASS (mode2) == SH_ARG_FLOAT
+ && (named || ! ca->prototype_p))
+ {
+ if (mode2 == SFmode && ca->free_single_fp_reg)
+ ca->free_single_fp_reg = 0;
+ else if (ca->arg_count[(int) SH_ARG_FLOAT]
+ < NPARM_REGS (SFmode))
+ {
+ int numfpregs
+ = MIN ((GET_MODE_SIZE (mode2) + 7) / 8 * 2,
+ NPARM_REGS (SFmode)
+ - ca->arg_count[(int) SH_ARG_FLOAT]);
+
+ ca->arg_count[(int) SH_ARG_FLOAT] += numfpregs;
+
+ if (TARGET_SHCOMPACT && ! ca->prototype_p)
+ {
+ if (ca->outgoing && numregs > 0)
+ do
+ {
+ ca->call_cookie
+ |= (CALL_COOKIE_INT_REG
+ (ca->arg_count[(int) SH_ARG_INT]
+ - numregs + ((numfpregs - 2) / 2),
+ 4 + (ca->arg_count[(int) SH_ARG_FLOAT]
+ - numfpregs) / 2));
+ }
+ while (numfpregs -= 2);
+ }
+ else if (mode2 == SFmode && (named)
+ && (ca->arg_count[(int) SH_ARG_FLOAT]
+ < NPARM_REGS (SFmode)))
+ ca->free_single_fp_reg
+ = FIRST_FP_PARM_REG - numfpregs
+ + ca->arg_count[(int) SH_ARG_FLOAT] + 1;
+ }
+ }
+ return;
+ }
+
+ if ((TARGET_HITACHI || ca->renesas_abi) && TARGET_FPU_DOUBLE)
+ {
+ /* Note that we've used the skipped register. */
+ if (mode == SFmode && ca->free_single_fp_reg)
+ {
+ ca->free_single_fp_reg = 0;
+ return;
+ }
+ /* When we have a DF after an SF, there's an SF register that get
+ skipped in order to align the DF value. We note this skipped
+ register, because the next SF value will use it, and not the
+ SF that follows the DF. */
+ if (mode == DFmode
+ && ROUND_REG (*ca, DFmode) != ROUND_REG (*ca, SFmode))
+ {
+ ca->free_single_fp_reg = (ROUND_REG (*ca, SFmode)
+ + BASE_ARG_REG (mode));
+ }
+ }
+
+ if (! (TARGET_SH4 || ca->renesas_abi)
+ || PASS_IN_REG_P (*ca, mode, type))
+ (ca->arg_count[(int) GET_SH_ARG_CLASS (mode)]
+ = (ROUND_REG (*ca, mode)
+ + (mode == BLKmode
+ ? ROUND_ADVANCE (int_size_in_bytes (type))
+ : ROUND_ADVANCE (GET_MODE_SIZE (mode)))));
+}
+
+/* If the structure value address is not passed in a register, define
+ `STRUCT_VALUE' as an expression returning an RTX for the place
+ where the address is passed. If it returns 0, the address is
+ passed as an "invisible" first argument. */
+/* The Renesas calling convention doesn't quite fit into this scheme since
+ the address is passed like an invisible argument, but one that is always
+ passed in memory. */
+static rtx
+sh_struct_value_rtx (fndecl, incoming)
+ tree fndecl;
+ int incoming ATTRIBUTE_UNUSED;
+{
+ if (TARGET_HITACHI || sh_attr_renesas_p (fndecl))
+ return 0;
+ return gen_rtx_REG (Pmode, 2);
+}
+
+static bool
+sh_return_in_memory (type, fndecl)
+ tree type;
+ tree fndecl;
+{
+ if (TARGET_SH5)
+ {
+ if (TYPE_MODE (type) == BLKmode)
+ return ((unsigned HOST_WIDE_INT) int_size_in_bytes (type)) > 8;
+ else
+ return GET_MODE_SIZE (TYPE_MODE (type)) > 8;
+ }
+ else
+ {
+ return (TYPE_MODE (type) == BLKmode
+ || ((TARGET_HITACHI || sh_attr_renesas_p (fndecl))
+ && TREE_CODE (type) == RECORD_TYPE));
+ }
+}
+
+/* We actually emit the code in sh_expand_prologue. We used to use
+ a static variable to flag that we need to emit this code, but that
+ doesn't when inlining, when functions are deferred and then emitted
+ later. Fortunately, we already have two flags that are part of struct
+ function that tell if a function uses varargs or stdarg. */
+static void
+sh_setup_incoming_varargs (ca, mode, type, pretend_arg_size, second_time)
+ CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+ tree type ATTRIBUTE_UNUSED;
+ int *pretend_arg_size ATTRIBUTE_UNUSED;
+ int second_time ATTRIBUTE_UNUSED;
+{
+ if (! current_function_stdarg)
+ abort ();
+}
+
+static bool
+sh_strict_argument_naming (ca)
+ CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED;
+{
+ return TARGET_SH5;
+}
+
+static bool
+sh_pretend_outgoing_varargs_named (ca)
+ CUMULATIVE_ARGS *ca;
+{
+ return ! (TARGET_HITACHI || ca->renesas_abi) && ! TARGET_SH5;
+}
+
+
/* Define the offset between two registers, one to be eliminated, and
the other its replacement, at the start of a routine. */
@@ -6188,9 +6718,10 @@ initial_elimination_offset (from, to)
{
if (TARGET_SH5)
{
- int i, n = total_saved_regs_space;
- int align;
+ int n = total_saved_regs_space;
int pr_reg = TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG;
+ save_schedule schedule;
+ save_entry *entry;
n += total_auto_space;
@@ -6200,40 +6731,13 @@ initial_elimination_offset (from, to)
target_flags = copy_flags;
- /* We loop twice: first, check 8-byte aligned registers,
- that are stored in the higher addresses, that are known
- to be aligned. Then, check 32-bit registers that don't
- need 8-byte alignment. */
- for (align = 1; align >= 0; align--)
- for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
- if (TEST_HARD_REG_BIT (live_regs_mask, i))
- {
- enum machine_mode mode = REGISTER_NATURAL_MODE (i);
-
- if (mode == SFmode && (i % 2) == 1
- && ! TARGET_FPU_SINGLE && FP_REGISTER_P (i)
- && TEST_HARD_REG_BIT (live_regs_mask, (i ^ 1)))
- {
- mode = DFmode;
- i--;
- }
-
- /* If we're doing the aligned pass and this is not aligned,
- or we're doing the unaligned pass and this is aligned,
- skip it. */
- if ((GET_MODE_SIZE (mode) % (STACK_BOUNDARY / BITS_PER_UNIT)
- == 0) != align)
- continue;
-
- n -= GET_MODE_SIZE (mode);
-
- if (i == pr_reg)
- {
- target_flags = save_flags;
- return n;
- }
- }
-
+ sh5_schedule_saves (&live_regs_mask, &schedule, n);
+ for (entry = &schedule.entries[1]; entry->mode != VOIDmode; entry++)
+ if (entry->reg == pr_reg)
+ {
+ target_flags = save_flags;
+ return entry->offset;
+ }
abort ();
}
else
@@ -6296,7 +6800,12 @@ sh_insert_attributes (node, attributes)
to run on.
trap_exit -- use a trapa to exit an interrupt function instead of
- an rte instruction. */
+ an rte instruction.
+
+ renesas -- use Renesas calling/layout conventions (functions and
+ structures).
+
+*/
const struct attribute_spec sh_attribute_table[] =
{
@@ -6304,6 +6813,7 @@ const struct attribute_spec sh_attribute_table[] =
{ "interrupt_handler", 0, 0, true, false, false, sh_handle_interrupt_handler_attribute },
{ "sp_switch", 1, 1, true, false, false, sh_handle_sp_switch_attribute },
{ "trap_exit", 1, 1, true, false, false, sh_handle_trap_exit_attribute },
+ { "renesas", 0, 0, false, true, false, sh_handle_renesas_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
@@ -6409,6 +6919,40 @@ sh_handle_trap_exit_attribute (node, name, args, flags, no_add_attrs)
return NULL_TREE;
}
+static tree
+sh_handle_renesas_attribute (node, name, args, flags, no_add_attrs)
+ tree *node ATTRIBUTE_UNUSED;
+ tree name ATTRIBUTE_UNUSED;
+ tree args ATTRIBUTE_UNUSED;
+ int flags ATTRIBUTE_UNUSED;
+ bool *no_add_attrs ATTRIBUTE_UNUSED;
+{
+ return NULL_TREE;
+}
+
+/* True if __attribute__((renesas)) or -mrenesas. */
+int
+sh_attr_renesas_p (td)
+ tree td;
+{
+ if (TARGET_HITACHI)
+ return 1;
+ if (td == 0)
+ return 0;
+ if (DECL_P (td))
+ td = TREE_TYPE (td);
+ return (lookup_attribute ("renesas", TYPE_ATTRIBUTES (td))
+ != NULL_TREE);
+}
+
+/* True if __attribute__((renesas)) or -mrenesas, for the current
+ function. */
+int
+sh_cfun_attr_renesas_p ()
+{
+ return sh_attr_renesas_p (current_function_decl);
+}
+
int
sh_cfun_interrupt_handler_p ()
{
@@ -7872,7 +8416,7 @@ static bool
sh_ms_bitfield_layout_p (record_type)
tree record_type ATTRIBUTE_UNUSED;
{
- return TARGET_SH5;
+ return (TARGET_SH5 || TARGET_HITACHI || sh_attr_renesas_p (record_type));
}
/*
@@ -8226,7 +8770,7 @@ sh_media_init_builtins ()
const struct builtin_description *d;
memset (shared, 0, sizeof shared);
- for (d = bdesc; d - bdesc < (int) (sizeof bdesc / sizeof bdesc[0]); d++)
+ for (d = bdesc; d - bdesc < (int) ARRAY_SIZE (bdesc); d++)
{
tree type, arg_type;
int signature = d->signature;
@@ -8555,10 +9099,10 @@ sh_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
comes first, in which case "this" comes second. */
INIT_CUMULATIVE_ARGS (cum, funtype, NULL_RTX, 0);
#ifndef PCC_STATIC_STRUCT_RETURN
- if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function))))
+ if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
structure_value_byref = 1;
#endif /* not PCC_STATIC_STRUCT_RETURN */
- if (structure_value_byref && struct_value_rtx == 0)
+ if (structure_value_byref && sh_struct_value_rtx (function, 0) == 0)
{
tree ptype = build_pointer_type (TREE_TYPE (funtype));
@@ -8705,4 +9249,47 @@ function_symbol (const char *name)
return sym;
}
+/* Find the number of a general purpose register in S. */
+static int
+scavenge_reg (HARD_REG_SET *s)
+{
+ int r;
+ for (r = FIRST_GENERAL_REG; r <= LAST_GENERAL_REG; r++)
+ if (TEST_HARD_REG_BIT (*s, r))
+ return r;
+ return -1;
+}
+
+rtx
+sh_get_pr_initial_val (void)
+{
+ rtx val;
+
+ /* ??? Unfortunately, get_hard_reg_initial_val doesn't always work for the
+ PR register on SHcompact, because it might be clobbered by the prologue.
+ We check first if that is known to be the case. */
+ if (TARGET_SHCOMPACT
+ && ((current_function_args_info.call_cookie
+ & ~ CALL_COOKIE_RET_TRAMP (1))
+ || current_function_has_nonlocal_label))
+ return gen_rtx_MEM (SImode, return_address_pointer_rtx);
+
+ /* If we haven't finished rtl generation, there might be a nonlocal label
+ that we haven't seen yet.
+ ??? get_hard_reg_initial_val fails if it is called while no_new_pseudos
+ is set, unless it has been called before for the same register. And even
+ then, we end in trouble if we didn't use the register in the same
+ basic block before. So call get_hard_reg_initial_val now and wrap it
+ in an unspec if we might need to replace it. */
+ /* ??? We also must do this for TARGET_SH1 in general, because otherwise
+ combine can put the pseudo returned by get_hard_reg_initial_val into
+ instructions that need a general purpose registers, which will fail to
+ be recognized when the pseudo becomes allocated to PR. */
+ val
+ = get_hard_reg_initial_val (Pmode, TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG);
+ if (TARGET_SH1)
+ return gen_rtx_UNSPEC (SImode, gen_rtvec (1, val), UNSPEC_RA);
+ return val;
+}
+
#include "gt-sh.h"
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 9ab647aff5d..3ccfdf9c898 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -319,6 +319,7 @@ extern int target_flags;
{"dalign", DALIGN_BIT, "Aligns doubles at 64-bit boundaries" }, \
{"fmovd", FMOVD_BIT, "" }, \
{"hitachi", HITACHI_BIT, "Follow Renesas (formerly Hitachi) / SuperH calling conventions" }, \
+ {"renesas", HITACHI_BIT, "Follow Renesas (formerly Hitachi) / SuperH calling conventions" }, \
{"nomacsave", NOMACSAVE_BIT, "Mark MAC register as call-clobbered" }, \
{"ieee", IEEE_BIT, "Increase the IEEE compliance for floating-point code" }, \
{"isize", ISIZE_BIT, "" }, \
@@ -591,6 +592,13 @@ do { \
#define UNITS_PER_WORD (TARGET_SHMEDIA ? 8 : 4)
#define MIN_UNITS_PER_WORD 4
+/* Scaling factor for Dwarf data offsets for CFI information.
+ The dwarf2out.c default would use -UNITS_PER_WORD, which is -8 for
+ SHmedia; however, since we do partial register saves for the registers
+ visible to SHcompact, and for target registers for SHMEDIA32, we have
+ to allow saves that are only 4-byte aligned. */
+#define DWARF_CIE_DATA_ALIGNMENT -4
+
/* Width in bits of a pointer.
See also the macro `Pmode' defined below. */
#define POINTER_SIZE (TARGET_SHMEDIA64 ? 64 : 32)
@@ -639,8 +647,8 @@ do { \
#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
((GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_INT \
|| GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_FLOAT) \
- ? MIN (BIGGEST_ALIGNMENT, GET_MODE_BITSIZE (TYPE_MODE (TYPE))) \
- : ALIGN)
+ ? (unsigned) MIN (BIGGEST_ALIGNMENT, GET_MODE_BITSIZE (TYPE_MODE (TYPE))) \
+ : (unsigned) ALIGN)
/* Make arrays of chars word-aligned for the same reasons. */
#define DATA_ALIGNMENT(TYPE, ALIGN) \
@@ -816,16 +824,18 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
#define LAST_TARGET_REG (FIRST_TARGET_REG + (TARGET_SHMEDIA ? 7 : -1))
#define GENERAL_REGISTER_P(REGNO) \
- IN_RANGE ((REGNO), FIRST_GENERAL_REG, LAST_GENERAL_REG)
+ IN_RANGE ((REGNO), \
+ (unsigned HOST_WIDE_INT) FIRST_GENERAL_REG, \
+ (unsigned HOST_WIDE_INT) LAST_GENERAL_REG)
#define GENERAL_OR_AP_REGISTER_P(REGNO) \
(GENERAL_REGISTER_P (REGNO) || ((REGNO) == AP_REG))
#define FP_REGISTER_P(REGNO) \
- ((REGNO) >= FIRST_FP_REG && (REGNO) <= LAST_FP_REG)
+ ((int) (REGNO) >= FIRST_FP_REG && (int) (REGNO) <= LAST_FP_REG)
#define XD_REGISTER_P(REGNO) \
- ((REGNO) >= FIRST_XD_REG && (REGNO) <= LAST_XD_REG)
+ ((int) (REGNO) >= FIRST_XD_REG && (int) (REGNO) <= LAST_XD_REG)
#define FP_OR_XD_REGISTER_P(REGNO) \
(FP_REGISTER_P (REGNO) || XD_REGISTER_P (REGNO))
@@ -838,7 +848,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
|| (REGNO) == MACH_REG || (REGNO) == MACL_REG)
#define TARGET_REGISTER_P(REGNO) \
- ((REGNO) >= FIRST_TARGET_REG && (REGNO) <= LAST_TARGET_REG)
+ ((int) (REGNO) >= FIRST_TARGET_REG && (int) (REGNO) <= LAST_TARGET_REG)
#define SHMEDIA_REGISTER_P(REGNO) \
(GENERAL_REGISTER_P (REGNO) || FP_REGISTER_P (REGNO) \
@@ -917,7 +927,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
Only the lower 32bits of R10-R14 are guaranteed to be preserved \
across SH5 function calls. */ \
0, 0, 0, 0, 0, 0, 0, 1, \
- 1, 1, 0, 1, 1, 1, 1, 1, \
+ 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 0, 0, 0, 0, \
0, 0, 0, 0, 1, 1, 1, 1, \
1, 1, 1, 1, 0, 0, 0, 0, \
@@ -937,7 +947,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
/* XD registers. */ \
1, 1, 1, 1, 1, 1, 0, 0, \
/*"gbr", "ap", "pr", "t", "mach", "macl", "fpul", "fpscr", */ \
- 1, 1, 0, 1, 1, 1, 1, 1, \
+ 1, 1, 1, 1, 1, 1, 1, 1, \
/*"rap" */ \
1, \
}
@@ -951,7 +961,8 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
(TARGET_SHMEDIA32 \
&& GET_MODE_SIZE (MODE) > 4 \
&& (((REGNO) >= FIRST_GENERAL_REG + 10 \
- && (REGNO) <= FIRST_GENERAL_REG + 14) \
+ && (REGNO) <= FIRST_GENERAL_REG + 15) \
+ || TARGET_REGISTER_P (REGNO) \
|| (REGNO) == PR_MEDIA_REG))
/* Return number of consecutive hard regs needed starting at reg REGNO
@@ -1008,7 +1019,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
? (MODE) == DFmode \
: TARGET_REGISTER_P (REGNO) \
? ((MODE) == DImode || (MODE) == SImode) \
- : (REGNO) == PR_REG ? 0 \
+ : (REGNO) == PR_REG ? (MODE) == SImode \
: (REGNO) == FPSCR_REG ? (MODE) == PSImode \
: 1)
@@ -1116,29 +1127,6 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
/* Register in which the static-chain is passed to a function. */
#define STATIC_CHAIN_REGNUM (TARGET_SH5 ? 1 : 3)
-/* The register in which a struct value address is passed. */
-
-#define STRUCT_VALUE_REGNUM 2
-
-/* If the structure value address is not passed in a register, define
- `STRUCT_VALUE' as an expression returning an RTX for the place
- where the address is passed. If it returns 0, the address is
- passed as an "invisible" first argument. */
-
-/* The Renesas calling convention doesn't quite fit into this scheme since
- the address is passed like an invisible argument, but one that is always
- passed in memory. */
-#define STRUCT_VALUE \
- (TARGET_HITACHI ? 0 : gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM))
-
-#define RETURN_IN_MEMORY(TYPE) \
- (TARGET_SH5 \
- ? ((TYPE_MODE (TYPE) == BLKmode \
- ? (unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) \
- : GET_MODE_SIZE (TYPE_MODE (TYPE))) > 8) \
- : (TYPE_MODE (TYPE) == BLKmode \
- || TARGET_HITACHI && TREE_CODE (TYPE) == RECORD_TYPE))
-
/* Don't default to pcc-struct-return, because we have already specified
exactly how to return structures in the RETURN_IN_MEMORY macro. */
@@ -1273,7 +1261,7 @@ enum reg_class
reg number REGNO. This could be a conditional expression
or could index an array. */
-extern int regno_reg_class[FIRST_PSEUDO_REGISTER];
+extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
#define REGNO_REG_CLASS(REGNO) regno_reg_class[(REGNO)]
/* When defined, the compiler allows registers explicitly used in the
@@ -1363,7 +1351,9 @@ extern enum reg_class reg_class_from_letter[];
#define CONSTRAINT_LEN(C,STR) \
(((C) == 'L' || (C) == 'O' || (C) == 'D' || (C) == 'T' || (C) == 'U' \
|| (C) == 'Y' \
- || ((C) == 'I' && (((STR)[1] != '0' && (STR)[1] != '1') || ! isdigit ((STR)[2]))) \
+ || ((C) == 'I' \
+ && (((STR)[1] != '0' && (STR)[1] != '1') \
+ || (STR)[2] < '0' || (STR)[2] > '9')) \
|| ((C) == 'B' && ((STR)[1] != 's' || (STR)[2] != 'c')) \
|| ((C) == 'J' && ((STR)[1] != '1' || (STR)[2] != '6')) \
|| ((C) == 'K' && ((STR)[1] != '0' || (STR)[2] != '8')) \
@@ -1667,12 +1657,15 @@ extern enum reg_class reg_class_from_letter[];
|| (TARGET_SHMEDIA_FPU && (REGNO) == FIRST_FP_RET_REG))
/* 1 if N is a possible register number for function argument passing. */
+/* ??? There are some callers that pass REGNO as int, and others that pass
+ it as unsigned. We get warnings unless we do casts everywhere. */
#define FUNCTION_ARG_REGNO_P(REGNO) \
- (((REGNO) >= FIRST_PARM_REG && (REGNO) < (FIRST_PARM_REG \
- + NPARM_REGS (SImode))) \
+ (((unsigned) (REGNO) >= (unsigned) FIRST_PARM_REG \
+ && (unsigned) (REGNO) < (unsigned) (FIRST_PARM_REG + NPARM_REGS (SImode)))\
|| (TARGET_FPU_ANY \
- && (REGNO) >= FIRST_FP_PARM_REG && (REGNO) < (FIRST_FP_PARM_REG \
- + NPARM_REGS (SFmode))))
+ && (unsigned) (REGNO) >= (unsigned) FIRST_FP_PARM_REG \
+ && (unsigned) (REGNO) < (unsigned) (FIRST_FP_PARM_REG \
+ + NPARM_REGS (SFmode))))
/* Define a data type for recording info about an argument list
during the scan of that argument list. This data type should
@@ -1782,6 +1775,10 @@ struct sh_args {
#define CALL_COOKIE_INT_REG_GET(COOKIE, REG) \
(((COOKIE) >> CALL_COOKIE_INT_REG_SHIFT (REG)) & ((REG) < 4 ? 7 : 15))
long call_cookie;
+
+ /* This is set to nonzero when the call in question must use the Renesas ABI,
+ even without the -mrenesas option. */
+ int renesas_abi;
};
#define CUMULATIVE_ARGS struct sh_args
@@ -1824,17 +1821,18 @@ struct sh_args {
For TARGET_HITACHI, the structure value pointer is passed in memory. */
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \
do { \
(CUM).arg_count[(int) SH_ARG_INT] = 0; \
(CUM).arg_count[(int) SH_ARG_FLOAT] = 0; \
+ (CUM).renesas_abi = sh_attr_renesas_p (FNTYPE) ? 1 : 0; \
(CUM).force_mem \
- = (TARGET_HITACHI && FNTYPE \
- && aggregate_value_p (TREE_TYPE (FNTYPE))); \
+ = ((TARGET_HITACHI || (CUM).renesas_abi) && (FNTYPE) \
+ && aggregate_value_p (TREE_TYPE (FNTYPE), (FNDECL))); \
(CUM).prototype_p = (FNTYPE) && TYPE_ARG_TYPES (FNTYPE); \
(CUM).arg_count[(int) SH_ARG_INT] \
= (TARGET_SH5 && (FNTYPE) \
- && aggregate_value_p (TREE_TYPE (FNTYPE))); \
+ && aggregate_value_p (TREE_TYPE (FNTYPE), (FNDECL))); \
(CUM).free_single_fp_reg = 0; \
(CUM).outgoing = 1; \
(CUM).stack_regs = 0; \
@@ -1866,128 +1864,11 @@ struct sh_args {
INIT_CUMULATIVE_ARGS ((CUM), (FNTYPE), (LIBNAME), 0); \
(CUM).outgoing = 0; \
} while (0)
-
-/* Update the data in CUM to advance over an argument
- of mode MODE and data type TYPE.
- (TYPE is null for libcalls where that information may not be
- available.) */
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- if ((CUM).force_mem) \
- (CUM).force_mem = 0; \
- else if (TARGET_SH5) \
- { \
- tree TYPE_ = ((CUM).byref && (TYPE) \
- ? TREE_TYPE (TYPE) \
- : (TYPE)); \
- enum machine_mode MODE_ = ((CUM).byref && (TYPE) \
- ? TYPE_MODE (TYPE_) \
- : (MODE)); \
- int dwords = (((CUM).byref \
- ? (CUM).byref \
- : (MODE_) == BLKmode \
- ? int_size_in_bytes (TYPE_) \
- : GET_MODE_SIZE (MODE_)) + 7) / 8; \
- int numregs = MIN (dwords, NPARM_REGS (SImode) \
- - (CUM).arg_count[(int) SH_ARG_INT]); \
- \
- if (numregs) \
- { \
- (CUM).arg_count[(int) SH_ARG_INT] += numregs; \
- if (TARGET_SHCOMPACT \
- && SHCOMPACT_FORCE_ON_STACK (MODE_, TYPE_)) \
- { \
- (CUM).call_cookie \
- |= CALL_COOKIE_INT_REG (((CUM).arg_count[(int) SH_ARG_INT] \
- - numregs), 1); \
- /* N.B. We want this also for outgoing. */\
- (CUM).stack_regs += numregs; \
- } \
- else if ((CUM).byref) \
- { \
- if (! (CUM).outgoing) \
- (CUM).stack_regs += numregs; \
- (CUM).byref_regs += numregs; \
- (CUM).byref = 0; \
- do \
- (CUM).call_cookie \
- |= CALL_COOKIE_INT_REG (((CUM).arg_count[(int) SH_ARG_INT] \
- - numregs), 2); \
- while (--numregs); \
- (CUM).call_cookie \
- |= CALL_COOKIE_INT_REG (((CUM).arg_count[(int) SH_ARG_INT] \
- - 1), 1); \
- } \
- else if (dwords > numregs) \
- { \
- int pushregs = numregs; \
- \
- if (TARGET_SHCOMPACT) \
- (CUM).stack_regs += numregs; \
- while (pushregs < NPARM_REGS (SImode) - 1 \
- && (CALL_COOKIE_INT_REG_GET \
- ((CUM).call_cookie, \
- NPARM_REGS (SImode) - pushregs) \
- == 1)) \
- { \
- (CUM).call_cookie \
- &= ~ CALL_COOKIE_INT_REG (NPARM_REGS (SImode) \
- - pushregs, 1); \
- pushregs++; \
- } \
- if (numregs == NPARM_REGS (SImode)) \
- (CUM).call_cookie \
- |= CALL_COOKIE_INT_REG (0, 1) \
- | CALL_COOKIE_STACKSEQ (numregs - 1); \
- else \
- (CUM).call_cookie \
- |= CALL_COOKIE_STACKSEQ (numregs); \
- } \
- } \
- if (GET_SH_ARG_CLASS (MODE_) == SH_ARG_FLOAT \
- && ((NAMED) || ! (CUM).prototype_p)) \
- { \
- if ((MODE_) == SFmode && (CUM).free_single_fp_reg) \
- (CUM).free_single_fp_reg = 0; \
- else if ((CUM).arg_count[(int) SH_ARG_FLOAT] \
- < NPARM_REGS (SFmode)) \
- { \
- int numfpregs \
- = MIN ((GET_MODE_SIZE (MODE_) + 7) / 8 * 2, \
- NPARM_REGS (SFmode) \
- - (CUM).arg_count[(int) SH_ARG_FLOAT]); \
- \
- (CUM).arg_count[(int) SH_ARG_FLOAT] += numfpregs; \
- \
- if (TARGET_SHCOMPACT && ! (CUM).prototype_p) \
- { \
- if ((CUM).outgoing && numregs > 0) \
- do \
- { \
- (CUM).call_cookie \
- |= (CALL_COOKIE_INT_REG \
- ((CUM).arg_count[(int) SH_ARG_INT] \
- - numregs + ((numfpregs - 2) / 2), \
- 4 + ((CUM).arg_count[(int) SH_ARG_FLOAT] \
- - numfpregs) / 2)); \
- } \
- while (numfpregs -= 2); \
- } \
- else if ((MODE_) == SFmode && (NAMED) \
- && ((CUM).arg_count[(int) SH_ARG_FLOAT] \
- < NPARM_REGS (SFmode))) \
- (CUM).free_single_fp_reg \
- = FIRST_FP_PARM_REG - numfpregs \
- + (CUM).arg_count[(int) SH_ARG_FLOAT] + 1; \
- } \
- } \
- } \
- else if (! TARGET_SH4 || PASS_IN_REG_P ((CUM), (MODE), (TYPE))) \
- ((CUM).arg_count[(int) GET_SH_ARG_CLASS (MODE)] \
- = (ROUND_REG ((CUM), (MODE)) \
- + ((MODE) == BLKmode \
- ? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \
- : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))))
+ sh_function_arg_advance (&(CUM), (MODE), (TYPE), (NAMED))
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+ sh_function_arg (&(CUM), (MODE), (TYPE), (NAMED))
/* Return boolean indicating arg of mode MODE will be passed in a reg.
This macro is only used in this file. */
@@ -1995,7 +1876,11 @@ struct sh_args {
#define PASS_IN_REG_P(CUM, MODE, TYPE) \
(((TYPE) == 0 \
|| (! TREE_ADDRESSABLE ((tree)(TYPE)) \
- && (! TARGET_HITACHI || ! AGGREGATE_TYPE_P (TYPE)))) \
+ && (! (TARGET_HITACHI || (CUM).renesas_abi) \
+ || ! (AGGREGATE_TYPE_P (TYPE) \
+ || (!TARGET_FPU_ANY \
+ && (GET_MODE_CLASS (MODE) == MODE_FLOAT \
+ && GET_MODE_SIZE (MODE) > GET_MODE_SIZE (SFmode))))))) \
&& ! (CUM).force_mem \
&& (TARGET_SH2E \
? ((MODE) == BLKmode \
@@ -2025,75 +1910,6 @@ struct sh_args {
foo (float a, __complex float b); a: fr5 b.real: fr4 b.imag: fr7 */
#define FUNCTION_ARG_SCmode_WART 1
-/* Define where to put the arguments to a function.
- Value is zero to push the argument on the stack,
- or a hard register in which to store the argument.
-
- MODE is the argument's machine mode.
- TYPE is the data type of the argument (as a tree).
- This is null for libcalls where that information may
- not be available.
- CUM is a variable of type CUMULATIVE_ARGS which gives info about
- the preceding args and about the function being called.
- NAMED is nonzero if this argument is a named parameter
- (otherwise it is an extra parameter matching an ellipsis).
-
- On SH the first args are normally in registers
- and the rest are pushed. Any arg that starts within the first
- NPARM_REGS words is at least partially passed in a register unless
- its data type forbids. */
-
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- ((! TARGET_SH5 \
- && PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \
- && ((NAMED) || !TARGET_HITACHI)) \
- ? (((MODE) == SCmode && TARGET_SH4 && TARGET_LITTLE_ENDIAN \
- && (! FUNCTION_ARG_SCmode_WART || (ROUND_REG ((CUM), (MODE)) & 1)))\
- ? (gen_rtx_PARALLEL \
- (SCmode, \
- (gen_rtvec \
- (2, \
- (gen_rtx_EXPR_LIST \
- (VOIDmode, \
- gen_rtx_REG (SFmode, \
- BASE_ARG_REG (MODE) \
- + ROUND_REG ((CUM), (MODE)) ^ 1), \
- const0_rtx)), \
- (gen_rtx_EXPR_LIST \
- (VOIDmode, \
- gen_rtx_REG (SFmode, \
- BASE_ARG_REG (MODE) \
- + (ROUND_REG ((CUM), (MODE)) + 1) ^ 1), \
- GEN_INT (4))))))) \
- : gen_rtx_REG ((MODE), \
- ((BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE))) \
- ^ ((MODE) == SFmode && TARGET_SH4 \
- && TARGET_LITTLE_ENDIAN != 0)))) \
- : TARGET_SH5 \
- ? ((MODE) == VOIDmode && TARGET_SHCOMPACT \
- ? GEN_INT ((CUM).call_cookie) \
- /* The following test assumes unnamed arguments are promoted to \
- DFmode. */ \
- : (MODE) == SFmode && (CUM).free_single_fp_reg \
- ? SH5_PROTOTYPED_FLOAT_ARG ((CUM), (MODE), (CUM).free_single_fp_reg) \
- : (GET_SH_ARG_CLASS (MODE) == SH_ARG_FLOAT \
- && ((NAMED) || ! (CUM).prototype_p) \
- && (CUM).arg_count[(int) SH_ARG_FLOAT] < NPARM_REGS (SFmode)) \
- ? ((! (CUM).prototype_p && TARGET_SHMEDIA) \
- ? SH5_PROTOTYPELESS_FLOAT_ARG ((CUM), (MODE)) \
- : SH5_PROTOTYPED_FLOAT_ARG ((CUM), (MODE), \
- FIRST_FP_PARM_REG \
- + (CUM).arg_count[(int) SH_ARG_FLOAT])) \
- : ((CUM).arg_count[(int) SH_ARG_INT] < NPARM_REGS (SImode) \
- && (! TARGET_SHCOMPACT \
- || (! SHCOMPACT_FORCE_ON_STACK ((MODE), (TYPE)) \
- && ! SH5_WOULD_BE_PARTIAL_NREGS ((CUM), (MODE), \
- (TYPE), (NAMED))))) \
- ? gen_rtx_REG ((MODE), (FIRST_PARM_REG \
- + (CUM).arg_count[(int) SH_ARG_INT])) \
- : 0) \
- : 0)
-
/* Whether an argument must be passed by reference. On SHcompact, we
pretend arguments wider than 32-bits that would have been passed in
registers are passed by reference, so that an SHmedia trampoline
@@ -2188,10 +2004,6 @@ struct sh_args {
(REG)), \
const0_rtx))))
-#define STRICT_ARGUMENT_NAMING TARGET_SH5
-
-#define PRETEND_OUTGOING_VARARGS_NAMED (! TARGET_HITACHI && ! TARGET_SH5)
-
/* For an arg passed partly in registers and partly in memory,
this is the number of registers used.
For args passed entirely in registers or entirely in memory, zero.
@@ -2223,16 +2035,6 @@ struct sh_args {
/* Perform any needed actions needed for a function that is receiving a
variable number of arguments. */
-/* We actually emit the code in sh_expand_prologue. We used to use
- a static variable to flag that we need to emit this code, but that
- doesn't when inlining, when functions are deferred and then emitted
- later. Fortunately, we already have two flags that are part of struct
- function that tell if a function uses varargs or stdarg. */
-#define SETUP_INCOMING_VARARGS(ASF, MODE, TYPE, PAS, ST) do \
- if (! current_function_stdarg) \
- abort (); \
-while (0)
-
/* Define the `__builtin_va_list' type for the ABI. */
#define BUILD_VA_LIST_TYPE(VALIST) \
(VALIST) = sh_build_va_list ()
@@ -2311,9 +2113,7 @@ while (0)
can ignore COUNT. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
- (((COUNT) == 0) \
- ? get_hard_reg_initial_val (Pmode, TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG) \
- : (rtx) 0)
+ (((COUNT) == 0) ? sh_get_pr_initial_val () : (rtx) 0)
/* A C expression whose value is RTL representing the location of the
incoming return address at the beginning of any function, before the
@@ -2323,9 +2123,6 @@ while (0)
#define INCOMING_RETURN_ADDR_RTX \
gen_rtx_REG (Pmode, TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG)
-/* Generate necessary RTL for __builtin_saveregs(). */
-#define EXPAND_BUILTIN_SAVEREGS() sh_builtin_saveregs ()
-
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT TARGET_SH1
#define HAVE_PRE_DECREMENT TARGET_SH1
@@ -2906,9 +2703,6 @@ while (0)
but a CALL with constant address is cheap. */
/*#define NO_FUNCTION_CSE 1*/
-/* Chars and shorts should be passed as ints. */
-#define PROMOTE_PROTOTYPES 1
-
/* The machine modes of pointers and functions. */
#define Pmode (TARGET_SHMEDIA64 ? DImode : SImode)
#define FUNCTION_MODE Pmode
@@ -3083,20 +2877,32 @@ while (0)
register exists, so we should return -1 for invalid register numbers. */
#define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
+/* SHcompact PR_REG used to use the encoding 241, and SHcompact FP registers
+ 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.
+ Likewise, we need to support unwind information for SHmedia registers
+ even in compact code. */
#define SH_DBX_REGISTER_NUMBER(REGNO) \
- (GENERAL_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_GENERAL_REG) \
- : FP_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_FP_REG + (TARGET_SH5 ? (TARGET_SHCOMPACT ? 245 \
- : 77) : 25)) \
+ (IN_RANGE ((REGNO), \
+ (unsigned HOST_WIDE_INT) FIRST_GENERAL_REG, \
+ FIRST_GENERAL_REG + (TARGET_SH5 ? 63U :15U)) \
+ ? ((unsigned) (REGNO) - FIRST_GENERAL_REG) \
+ : ((int) (REGNO) >= FIRST_FP_REG \
+ && ((int) (REGNO) \
+ <= (FIRST_FP_REG + \
+ ((TARGET_SH5 && TARGET_FPU_ANY) ? 63 : TARGET_SH2E ? 15 : -1)))) \
+ ? ((unsigned) (REGNO) - FIRST_FP_REG \
+ + (TARGET_SH5 ? 77 : 25)) \
: XD_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_XD_REG + (TARGET_SH5 ? 289 : 87)) \
+ ? ((unsigned) (REGNO) - FIRST_XD_REG + (TARGET_SH5 ? 289 : 87)) \
: TARGET_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_TARGET_REG + 68) \
+ ? ((unsigned) (REGNO) - FIRST_TARGET_REG + 68) \
: (REGNO) == PR_REG \
- ? (TARGET_SH5 ? 241 : 17) \
+ ? (TARGET_SH5 ? 18 : 17) \
: (REGNO) == PR_MEDIA_REG \
- ? (TARGET_SH5 ? 18 : -1) \
+ ? (TARGET_SH5 ? 18 : (unsigned) -1) \
: (REGNO) == T_REG \
? (TARGET_SH5 ? 242 : 18) \
: (REGNO) == GBR_REG \
@@ -3107,7 +2913,7 @@ while (0)
? (TARGET_SH5 ? 240 : 21) \
: (REGNO) == FPUL_REG \
? (TARGET_SH5 ? 244 : 23) \
- : -1)
+ : (unsigned) -1)
/* This is how to output a reference to a symbol_ref. On SH5,
references to non-code symbols must be preceded by `datalabel'. */
@@ -3449,9 +3255,31 @@ extern int rtx_equal_function_value_matters;
(TARGET_SH5 ? DWARF_FRAME_REGNUM (PR_MEDIA_REG) : DWARF_FRAME_REGNUM (PR_REG))
#define EH_RETURN_DATA_REGNO(N) \
- ((N) < 4 ? (N) + (TARGET_SH5 ? 2 : 4) : INVALID_REGNUM)
-
-#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM)
+ ((N) < 4 ? (N) + (TARGET_SH5 ? 2U : 4U) : INVALID_REGNUM)
+
+#define EH_RETURN_STACKADJ_REGNO STATIC_CHAIN_REGNUM
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, EH_RETURN_STACKADJ_REGNO)
+
+/* We have to distinguish between code and data, so that we apply
+ datalabel where and only where appropriate. Use textrel for code. */
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
+ ((flag_pic && (GLOBAL) ? DW_EH_PE_indirect : 0) \
+ | ((CODE) ? DW_EH_PE_textrel : flag_pic ? DW_EH_PE_pcrel : DW_EH_PE_absptr))
+
+/* Handle special EH pointer encodings. Absolute, pc-relative, and
+ indirect are handled automatically. */
+#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
+ do { \
+ if (((ENCODING) & 0x70) == DW_EH_PE_textrel) \
+ { \
+ encoding &= ~DW_EH_PE_textrel; \
+ encoding |= flag_pic ? DW_EH_PE_pcrel : DW_EH_PE_absptr; \
+ if (GET_CODE (ADDR) != SYMBOL_REF) \
+ abort (); \
+ SYMBOL_REF_FLAGS (ADDR) |= SYMBOL_FLAG_FUNCTION; \
+ if (0) goto DONE; \
+ } \
+ } while (0)
#if (defined CRT_BEGIN || defined CRT_END) && ! __SHMEDIA__
/* SH constant pool breaks the devices in crtstuff.c to control section
@@ -3468,8 +3296,13 @@ extern int rtx_equal_function_value_matters;
#endif /* (defined CRT_BEGIN || defined CRT_END) && ! __SHMEDIA__ */
#define ALLOCATE_INITIAL_VALUE(hard_reg) \
- (REGNO (hard_reg) == (TARGET_SH5 ? PR_MEDIA_REG : PR_REG) \
- ? (current_function_is_leaf && ! sh_pr_n_sets () \
+ (REGNO (hard_reg) == (TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG) \
+ ? (current_function_is_leaf \
+ && ! sh_pr_n_sets () \
+ && ! (TARGET_SHCOMPACT \
+ && ((current_function_args_info.call_cookie \
+ & ~ CALL_COOKIE_RET_TRAMP (1)) \
+ || current_function_has_nonlocal_label)) \
? (hard_reg) \
: gen_rtx_MEM (Pmode, TARGET_SH5 \
? (plus_constant (arg_pointer_rtx, \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 2af568b772c..c5c55c76bf2 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -142,6 +142,7 @@
(UNSPEC_DTPOFF 23)
(UNSPEC_GOTTPOFF 24)
(UNSPEC_TPOFF 25)
+ (UNSPEC_RA 26)
;; These are used with unspec_volatile.
(UNSPECV_BLOCKAGE 0)
@@ -2052,7 +2053,7 @@
"
{
enum machine_mode inmode = GET_MODE (operands[1]);
- int regno, offset = 0;
+ int offset = 0;
if (GET_CODE (operands[0]) == SUBREG)
{
@@ -3471,6 +3472,19 @@
fake %1,%0"
[(set_attr "type" "pcload,move,load,move,prget,move,store,pcload")])
+(define_insn_and_split "load_ra"
+ [(set (match_operand:SI 0 "general_movdst_operand" "")
+ (unspec:SI [(match_operand 1 "register_operand" "")] UNSPEC_RA))]
+ "TARGET_SH1"
+ "#"
+ "&& ! rtx_equal_function_value_matters"
+ [(set (match_dup 0) (match_dup 1))]
+ "
+{
+ if (TARGET_SHCOMPACT && current_function_has_nonlocal_label)
+ operands[1] = gen_rtx_MEM (SImode, return_address_pointer_rtx);
+}")
+
(define_insn "*movsi_media"
[(set (match_operand:SI 0 "general_movdst_operand"
"=r,r,r,r,m,f,m,f,r,f,*b,r,b")
@@ -5855,7 +5869,10 @@
DONE;
}
else
+ {
operands[0] = force_reg (SImode, XEXP (operands[0], 0));
+ operands[1] = operands[2];
+ }
emit_call_insn (gen_calli (operands[0], operands[1]));
DONE;
@@ -6163,6 +6180,7 @@
(define_insn "sibcall_media"
[(call (mem:DI (match_operand:DI 0 "target_reg_operand" "k"))
(match_operand 1 "" ""))
+ (use (reg:SI PR_MEDIA_REG))
(return)]
"TARGET_SHMEDIA"
"blink %0, r63"
@@ -7247,6 +7265,8 @@ mov.l\\t1f,r0\\n\\
{
rtx r18 = gen_rtx_REG (DImode, PR_MEDIA_REG);
+ if (! call_used_regs[TR0_REG] || fixed_regs[TR0_REG])
+ abort ();
tr_regno = TR0_REG;
tr = gen_rtx_REG (DImode, tr_regno);
emit_move_insn (tr, r18);
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 950472d77ac..49dc1ce2ae4 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -1,6 +1,6 @@
/* Operating system specific defines to be used when targeting GCC for any
Solaris 2 system.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -76,6 +76,9 @@ Boston, MA 02111-1307, USA. */
TARGET_SUB_OS_CPP_BUILTINS(); \
} while (0)
+/* The system headers under Solaris 2 are C++-aware since 2.0. */
+#define NO_IMPLICIT_EXTERN_C
+
/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
@@ -166,13 +169,9 @@ Boston, MA 02111-1307, USA. */
*
*/
-/* This declares mprotect (used in TRANSFER_FROM_TRAMPOLINE) for
- libgcc2.c. */
-/* We don't want to include this because sys/mman.h is not present on
- some non-Solaris configurations that use sol2.h. */
-#if 0 /* def L_trampoline */
-#include <sys/mman.h>
-#endif
+/* sys/mman.h is not present on some non-Solaris configurations
+ that use sol2.h, so TRANSFER_FROM_TRAMPOLINE must use a magic
+ number instead of the appropriate PROT_* flags. */
#define TRANSFER_FROM_TRAMPOLINE \
\
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index a7a48e60c2d..cf943907d22 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -1,5 +1,6 @@
/* Definitions for SPARC running Linux-based GNU systems with ELF.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003
+ Free Software Foundation, Inc.
Contributed by Eddie C. Dost (ecd@skynet.be)
This file is part of GCC.
@@ -30,8 +31,6 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
-#define LINUX_DEFAULT_ELF
-
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
@@ -154,15 +153,6 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#ifdef USE_GNULIBC_1
-#ifndef LINUX_DEFAULT_ELF
-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
- %{!shared: \
- %{!ibcs: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/elf/ld-linux.so.1} \
- %{!rpath:-rpath /lib/elf/}} %{static:-static}}}"
-#else
#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
@@ -170,7 +160,6 @@ Boston, MA 02111-1307, USA. */
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
%{static:-static}}}"
-#endif
#else
#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
@@ -244,6 +233,13 @@ do { \
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
+#ifdef HAVE_AS_TLS
+#undef TARGET_SUN_TLS
+#undef TARGET_GNU_TLS
+#define TARGET_SUN_TLS 0
+#define TARGET_GNU_TLS 1
+#endif
+
/* Don't be different from other Linux platforms in this regard. */
#define HANDLE_PRAGMA_PACK_PUSH_POP
@@ -253,6 +249,9 @@ do { \
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 10c83960b38..c3ecfaf1dee 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -1,5 +1,5 @@
/* Definitions for 64-bit SPARC running Linux-based GNU systems with ELF.
- Copyright 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by David S. Miller (davem@caip.rutgers.edu)
This file is part of GCC.
@@ -31,8 +31,6 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
-#define LINUX_DEFAULT_ELF
-
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
@@ -317,6 +315,13 @@ do { \
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
+#ifdef HAVE_AS_TLS
+#undef TARGET_SUN_TLS
+#undef TARGET_GNU_TLS
+#define TARGET_SUN_TLS 0
+#define TARGET_GNU_TLS 1
+#endif
+
/* Don't be different from other Linux platforms in this regard. */
#define HANDLE_PRAGMA_PACK_PUSH_POP
@@ -326,6 +331,9 @@ do { \
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/sparc/openbsd.h b/gcc/config/sparc/openbsd.h
index 6717e222151..e36f51eb602 100644
--- a/gcc/config/sparc/openbsd.h
+++ b/gcc/config/sparc/openbsd.h
@@ -1,5 +1,5 @@
/* Configuration file for sparc OpenBSD target.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -18,10 +18,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. */
-/* Get generic OpenBSD definitions. */
-#define OBSD_OLD_GAS
-#include <openbsd.h>
-
/* Target OS builtins. */
#define TARGET_OS_CPP_BUILTINS() \
do \
diff --git a/gcc/config/sparc/sol2-c1.asm b/gcc/config/sparc/sol2-c1.asm
index 894a8c34c08..a1cc68d6756 100644
--- a/gcc/config/sparc/sol2-c1.asm
+++ b/gcc/config/sparc/sol2-c1.asm
@@ -92,6 +92,10 @@ _start:
! access those data anyway. Instead, go straight to main:
mov %l0, %o0 ! argc
mov %l1, %o1 ! argv
+#ifdef GCRT1
+ setn(___Argv, %o4, %o3)
+ stn %o1, [%o3] ! *___Argv
+#endif
! Skip argc words past argv, to env:
sll %l0, CPTRSHIFT, %o2
add %o2, CPTRSIZE, %o2
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index 0de1e128551..4b9582d96b8 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -27,99 +27,104 @@ Boston, MA 02111-1307, USA. */
extern bool sparc_emitting_epilogue;
#ifdef TREE_CODE
-extern struct rtx_def *function_value PARAMS ((tree, enum machine_mode, int));
-extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode, tree, int));
-extern struct rtx_def *function_arg PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int, int));
-extern int function_arg_partial_nregs PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern int function_arg_pass_by_reference PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern struct rtx_def *sparc_builtin_saveregs PARAMS ((void));
+extern struct rtx_def *function_value (tree, enum machine_mode, int);
+extern void function_arg_advance (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern struct rtx_def *function_arg (const CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int, int);
+extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern int function_arg_pass_by_reference (const CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern struct rtx_def *sparc_builtin_saveregs (void);
#ifdef RTX_CODE
-extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, tree));
-extern void sparc_va_start PARAMS ((tree, rtx));
+extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
+extern void sparc_va_start (tree, rtx);
#endif
-extern struct rtx_def *sparc_va_arg PARAMS ((tree, tree));
-extern unsigned long sparc_type_code PARAMS ((tree));
+extern struct rtx_def *sparc_va_arg (tree, tree);
+extern unsigned long sparc_type_code (tree);
#ifdef ARGS_SIZE_RTX
/* expr.h defines ARGS_SIZE_RTX and `enum direction' */
-extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree));
+extern enum direction function_arg_padding (enum machine_mode, tree);
#endif /* ARGS_SIZE_RTX */
#endif /* TREE_CODE */
-extern void load_pic_register PARAMS ((void));
-extern void order_regs_for_local_alloc PARAMS ((void));
-extern int compute_frame_size PARAMS ((int, int));
-extern int check_pic PARAMS ((int));
-extern int short_branch PARAMS ((int, int));
-extern int sparc_flat_epilogue_delay_slots PARAMS ((void));
-extern unsigned long sparc_flat_compute_frame_size PARAMS ((int));
-extern void sparc_profile_hook PARAMS ((int));
-extern void sparc_override_options PARAMS ((void));
-extern int leaf_return_peephole_ok PARAMS ((void));
-extern void sparc_output_scratch_registers PARAMS ((FILE *));
-extern void sparc_flat_save_restore PARAMS ((FILE *, const char *,
- unsigned int, unsigned long,
- unsigned long, const char *,
- const char *, unsigned long));
+extern void load_pic_register (void);
+extern void order_regs_for_local_alloc (void);
+extern int compute_frame_size (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 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 PARAMS ((enum rtx_code, rtx, rtx));
+extern enum machine_mode select_cc_mode (enum rtx_code, rtx, rtx);
/* Define the function that build the compare insn for scc and bcc. */
-extern rtx gen_compare_reg PARAMS ((enum rtx_code code, rtx, rtx));
-extern void sparc_emit_float_lib_cmp PARAMS ((rtx, rtx, enum rtx_code));
-extern void sparc_emit_floatunsdi PARAMS ((rtx [2]));
-extern void emit_tfmode_binop PARAMS ((enum rtx_code, rtx *));
-extern void emit_tfmode_unop PARAMS ((enum rtx_code, rtx *));
-extern void emit_tfmode_cvt PARAMS ((enum rtx_code, rtx *));
+extern rtx gen_compare_reg (enum rtx_code code, rtx, rtx);
+extern void sparc_emit_float_lib_cmp (rtx, rtx, enum rtx_code);
+extern void sparc_emit_floatunsdi (rtx [2]);
+extern void emit_tfmode_binop (enum rtx_code, rtx *);
+extern void emit_tfmode_unop (enum rtx_code, rtx *);
+extern void emit_tfmode_cvt (enum rtx_code, rtx *);
/* This function handles all v9 scc insns */
-extern int gen_v9_scc PARAMS ((enum rtx_code, rtx *));
-extern void sparc_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern void sparc64_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx));
-extern void sparc_defer_case_vector PARAMS ((rtx, rtx, int));
-extern void sparc_emit_set_const32 PARAMS ((rtx, rtx));
-extern void sparc_emit_set_const64 PARAMS ((rtx, rtx));
-extern void sparc_emit_set_symbolic_const64 PARAMS ((rtx, rtx, rtx));
-extern int sparc_splitdi_legitimate PARAMS ((rtx, rtx));
-extern int sparc_absnegfloat_split_legitimate PARAMS ((rtx, rtx));
-extern char *output_cbranch PARAMS ((rtx, rtx, int, int, int, int, rtx));
-extern const char *output_sibcall PARAMS ((rtx, rtx));
-extern char *output_v9branch PARAMS ((rtx, rtx, int, int, int, int, int,
- rtx));
-extern void emit_v9_brxx_insn PARAMS ((enum rtx_code, rtx, rtx));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern int mems_ok_for_ldd_peep PARAMS ((rtx, rtx, rtx));
-extern int arith_double_4096_operand PARAMS ((rtx, enum machine_mode));
-extern int arith_4096_operand PARAMS ((rtx, enum machine_mode));
-extern int zero_operand PARAMS ((rtx, enum machine_mode));
-extern int fp_zero_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode));
-extern int empty_delay_slot PARAMS ((rtx));
-extern int eligible_for_epilogue_delay PARAMS ((rtx, int));
-extern int eligible_for_sibcall_delay PARAMS ((rtx));
-extern int emit_move_sequence PARAMS ((rtx, enum machine_mode));
-extern int fp_sethi_p PARAMS ((rtx));
-extern int fp_mov_p PARAMS ((rtx));
-extern int fp_high_losum_p PARAMS ((rtx));
-extern int mem_min_alignment PARAMS ((rtx, int));
-extern int pic_address_needs_scratch PARAMS ((rtx));
-extern int reg_unused_after PARAMS ((rtx, rtx));
-extern int register_ok_for_ldd PARAMS ((rtx));
-extern int registers_ok_for_ldd_peep PARAMS ((rtx, rtx));
-extern int sparc_flat_eligible_for_epilogue_delay PARAMS ((rtx, int));
-extern int v9_regcmp_p PARAMS ((enum rtx_code));
-extern char *sparc_v8plus_shift PARAMS ((rtx *, rtx, const char *));
+extern int gen_v9_scc (enum rtx_code, rtx *);
+extern void sparc_initialize_trampoline (rtx, rtx, rtx);
+extern void sparc64_initialize_trampoline (rtx, rtx, rtx);
+extern bool legitimate_constant_p (rtx);
+extern bool constant_address_p (rtx);
+extern bool legitimate_pic_operand_p (rtx);
+extern int legitimate_address_p (enum machine_mode, rtx, int);
+extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
+extern rtx legitimize_tls_address (rtx);
+extern rtx legitimize_address (rtx, rtx, enum machine_mode);
+extern void sparc_defer_case_vector (rtx, rtx, int);
+extern void sparc_emit_set_const32 (rtx, rtx);
+extern void sparc_emit_set_const64 (rtx, rtx);
+extern void sparc_emit_set_symbolic_const64 (rtx, rtx, rtx);
+extern int sparc_splitdi_legitimate (rtx, rtx);
+extern int sparc_absnegfloat_split_legitimate (rtx, rtx);
+extern char *output_cbranch (rtx, rtx, int, int, int, int, rtx);
+extern const char *output_sibcall (rtx, rtx);
+extern char *output_v9branch (rtx, rtx, int, int, int, int, int, rtx);
+extern void emit_v9_brxx_insn (enum rtx_code, rtx, rtx);
+extern void print_operand (FILE *, rtx, int);
+extern int mems_ok_for_ldd_peep (rtx, rtx, rtx);
+extern int arith_double_4096_operand (rtx, enum machine_mode);
+extern int arith_4096_operand (rtx, enum machine_mode);
+extern int zero_operand (rtx, enum machine_mode);
+extern int fp_zero_operand (rtx, enum machine_mode);
+extern int reg_or_0_operand (rtx, enum machine_mode);
+extern int tls_symbolic_operand (rtx);
+extern int empty_delay_slot (rtx);
+extern int eligible_for_epilogue_delay (rtx, int);
+extern int eligible_for_sibcall_delay (rtx);
+extern int tls_call_delay (rtx);
+extern int emit_move_sequence (rtx, enum machine_mode);
+extern int fp_sethi_p (rtx);
+extern int fp_mov_p (rtx);
+extern int fp_high_losum_p (rtx);
+extern int mem_min_alignment (rtx, int);
+extern int pic_address_needs_scratch (rtx);
+extern int reg_unused_after (rtx, rtx);
+extern int register_ok_for_ldd (rtx);
+extern int registers_ok_for_ldd_peep (rtx, rtx);
+extern int sparc_flat_eligible_for_epilogue_delay (rtx, int);
+extern int v9_regcmp_p (enum rtx_code);
+extern char *sparc_v8plus_shift (rtx *, rtx, const char *);
/* Function used for V8+ code generation. Returns 1 if the high
32 bits of REG are 0 before INSN. */
-extern int sparc_check_64 PARAMS ((rtx, rtx));
-extern rtx gen_df_reg PARAMS ((rtx, int));
-extern int sparc_extra_constraint_check PARAMS ((rtx, int, int));
+extern int sparc_check_64 (rtx, rtx);
+extern rtx gen_df_reg (rtx, int);
+extern int sparc_extra_constraint_check (rtx, int, int);
+extern void sparc_output_dwarf_dtprel (FILE*, int, rtx);
#endif /* RTX_CODE */
#endif /* __SPARC_PROTOS_H__ */
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 617a964b619..8441783261a 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -120,6 +120,12 @@ char sparc_leaf_regs[] =
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1};
+struct machine_function GTY(())
+{
+ /* Some local-dynamic TLS symbol name. */
+ const char *some_ld_name;
+};
+
/* Name of where we pretend to think the frame pointer points.
Normally, this is "%fp", but if we are in a leaf procedure,
this is "%sp+something". We record "something" separately as it may be
@@ -128,60 +134,61 @@ char sparc_leaf_regs[] =
static const char *frame_base_name;
static int frame_base_offset;
-static void sparc_init_modes PARAMS ((void));
-static int save_regs PARAMS ((FILE *, int, int, const char *,
- int, int, int));
-static int restore_regs PARAMS ((FILE *, int, int, const char *, int, int));
-static void build_big_number PARAMS ((FILE *, int, const char *));
-static int function_arg_slotno PARAMS ((const CUMULATIVE_ARGS *,
- enum machine_mode, tree, int, int,
- int *, int *));
-
-static int supersparc_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int hypersparc_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-
-static void sparc_output_addr_vec PARAMS ((rtx));
-static void sparc_output_addr_diff_vec PARAMS ((rtx));
-static void sparc_output_deferred_case_vectors PARAMS ((void));
-static int check_return_regs PARAMS ((rtx));
-static int epilogue_renumber PARAMS ((rtx *, int));
-static bool sparc_assemble_integer PARAMS ((rtx, unsigned int, int));
-static int set_extends PARAMS ((rtx));
-static void output_restore_regs PARAMS ((FILE *, int));
-static void sparc_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void sparc_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void sparc_flat_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void sparc_flat_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void sparc_nonflat_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT,
- int));
-static void sparc_nonflat_function_prologue PARAMS ((FILE *, HOST_WIDE_INT,
- int));
+static void sparc_init_modes (void);
+static int save_regs (FILE *, int, int, const char *, int, int, int);
+static int restore_regs (FILE *, int, int, const char *, int, int);
+static void build_big_number (FILE *, int, const char *);
+static int function_arg_slotno (const CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int, int, int *, int *);
+
+static int supersparc_adjust_cost (rtx, rtx, rtx, int);
+static int hypersparc_adjust_cost (rtx, rtx, rtx, int);
+
+static void sparc_output_addr_vec (rtx);
+static void sparc_output_addr_diff_vec (rtx);
+static void sparc_output_deferred_case_vectors (void);
+static int check_return_regs (rtx);
+static int epilogue_renumber (rtx *, int);
+static bool sparc_assemble_integer (rtx, unsigned int, int);
+static int set_extends (rtx);
+static void output_restore_regs (FILE *, int);
+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_nonflat_function_epilogue (FILE *, HOST_WIDE_INT, int);
+static void sparc_nonflat_function_prologue (FILE *, HOST_WIDE_INT, int);
#ifdef OBJECT_FORMAT_ELF
-static void sparc_elf_asm_named_section PARAMS ((const char *, unsigned int));
+static void sparc_elf_asm_named_section (const char *, unsigned int);
#endif
-static void sparc_aout_select_section PARAMS ((tree, int,
- unsigned HOST_WIDE_INT))
+static void sparc_aout_select_section (tree, int, unsigned HOST_WIDE_INT)
ATTRIBUTE_UNUSED;
-static void sparc_aout_select_rtx_section PARAMS ((enum machine_mode, rtx,
- unsigned HOST_WIDE_INT))
+static void sparc_aout_select_rtx_section (enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT)
ATTRIBUTE_UNUSED;
-static int sparc_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int sparc_issue_rate PARAMS ((void));
-static void sparc_sched_init PARAMS ((FILE *, int, int));
-static int sparc_use_dfa_pipeline_interface PARAMS ((void));
-static int sparc_use_sched_lookahead PARAMS ((void));
-
-static void emit_soft_tfmode_libcall PARAMS ((const char *, int, rtx *));
-static void emit_soft_tfmode_binop PARAMS ((enum rtx_code, rtx *));
-static void emit_soft_tfmode_unop PARAMS ((enum rtx_code, rtx *));
-static void emit_soft_tfmode_cvt PARAMS ((enum rtx_code, rtx *));
-static void emit_hard_tfmode_operation PARAMS ((enum rtx_code, rtx *));
-
-static bool sparc_function_ok_for_sibcall PARAMS ((tree, tree));
-static void sparc_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
-static bool sparc_rtx_costs PARAMS ((rtx, int, int, int *));
+static int sparc_adjust_cost (rtx, rtx, rtx, int);
+static int sparc_issue_rate (void);
+static void sparc_sched_init (FILE *, int, int);
+static int sparc_use_dfa_pipeline_interface (void);
+static int sparc_use_sched_lookahead (void);
+
+static void emit_soft_tfmode_libcall (const char *, int, rtx *);
+static void emit_soft_tfmode_binop (enum rtx_code, rtx *);
+static void emit_soft_tfmode_unop (enum rtx_code, rtx *);
+static void emit_soft_tfmode_cvt (enum rtx_code, rtx *);
+static void emit_hard_tfmode_operation (enum rtx_code, rtx *);
+
+static bool sparc_function_ok_for_sibcall (tree, tree);
+static void sparc_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree);
+static struct machine_function * sparc_init_machine_status (void);
+static bool sparc_cannot_force_const_mem (rtx);
+static rtx sparc_tls_get_addr (void);
+static rtx sparc_tls_got (void);
+static const char *get_some_local_dynamic_name (void);
+static int get_some_local_dynamic_name_1 (rtx *, void *);
+static bool sparc_rtx_costs (rtx, int, int, int *);
/* Option handling. */
@@ -245,6 +252,13 @@ enum processor_type sparc_cpu;
#undef TARGET_FUNCTION_OK_FOR_SIBCALL
#define TARGET_FUNCTION_OK_FOR_SIBCALL sparc_function_ok_for_sibcall
+#ifdef HAVE_AS_TLS
+#undef TARGET_HAVE_TLS
+#define TARGET_HAVE_TLS true
+#endif
+#undef TARGET_CANNOT_FORCE_CONST_MEM
+#define TARGET_CANNOT_FORCE_CONST_MEM sparc_cannot_force_const_mem
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK sparc_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -261,7 +275,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
initialization. */
void
-sparc_override_options ()
+sparc_override_options (void)
{
static struct code_model {
const char *const name;
@@ -453,6 +467,9 @@ sparc_override_options ()
/* Do various machine dependent initializations. */
sparc_init_modes ();
+
+ /* Set up function hooks. */
+ init_machine_status = sparc_init_machine_status;
}
/* Miscellaneous utilities. */
@@ -461,8 +478,7 @@ sparc_override_options ()
or branch on register contents instructions. */
int
-v9_regcmp_p (code)
- enum rtx_code code;
+v9_regcmp_p (enum rtx_code code)
{
return (code == EQ || code == NE || code == GE || code == LT
|| code == LE || code == GT);
@@ -475,9 +491,7 @@ v9_regcmp_p (code)
or const0_rtx. */
int
-reg_or_0_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_0_operand (rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -495,9 +509,7 @@ reg_or_0_operand (op, mode)
/* Return nonzero only if OP is const1_rtx. */
int
-const1_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return op == const1_rtx;
}
@@ -505,9 +517,7 @@ const1_operand (op, mode)
/* Nonzero if OP is a floating point value with value 0.0. */
int
-fp_zero_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fp_zero_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE_CLASS (GET_MODE (op)) != MODE_FLOAT)
return 0;
@@ -517,9 +527,7 @@ fp_zero_operand (op, mode)
/* Nonzero if OP is a register operand in floating point register. */
int
-fp_register_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fp_register_operand (rtx op, enum machine_mode mode)
{
if (! register_operand (op, mode))
return 0;
@@ -533,8 +541,7 @@ fp_register_operand (op, mode)
sethi instruction. */
int
-fp_sethi_p (op)
- rtx op;
+fp_sethi_p (rtx op)
{
if (GET_CODE (op) == CONST_DOUBLE)
{
@@ -558,8 +565,7 @@ fp_sethi_p (op)
mov instruction. */
int
-fp_mov_p (op)
- rtx op;
+fp_mov_p (rtx op)
{
if (GET_CODE (op) == CONST_DOUBLE)
{
@@ -583,8 +589,7 @@ fp_mov_p (op)
instruction sequence. */
int
-fp_high_losum_p (op)
- rtx op;
+fp_high_losum_p (rtx op)
{
/* The constraints calling this should only be in
SFmode move insns, so any constant which cannot
@@ -610,9 +615,7 @@ fp_high_losum_p (op)
/* Nonzero if OP is an integer register. */
int
-intreg_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+intreg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (register_operand (op, SImode)
|| (TARGET_ARCH64 && register_operand (op, DImode)));
@@ -621,9 +624,7 @@ intreg_operand (op, mode)
/* Nonzero if OP is a floating point condition code register. */
int
-fcc_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fcc_reg_operand (rtx op, enum machine_mode mode)
{
/* This can happen when recog is called from combine. Op may be a MEM.
Fail instead of calling abort in this case. */
@@ -648,9 +649,7 @@ fcc_reg_operand (op, mode)
/* Nonzero if OP is a floating point condition code fcc0 register. */
int
-fcc0_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fcc0_reg_operand (rtx op, enum machine_mode mode)
{
/* This can happen when recog is called from combine. Op may be a MEM.
Fail instead of calling abort in this case. */
@@ -669,9 +668,7 @@ fcc0_reg_operand (op, mode)
/* Nonzero if OP is an integer or floating point condition code register. */
int
-icc_or_fcc_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+icc_or_fcc_reg_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == REG && REGNO (op) == SPARC_ICC_REG)
{
@@ -688,9 +685,7 @@ icc_or_fcc_reg_operand (op, mode)
/* Nonzero if OP can appear as the dest of a RESTORE insn. */
int
-restore_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+restore_operand (rtx op, enum machine_mode mode)
{
return (GET_CODE (op) == REG && GET_MODE (op) == mode
&& (REGNO (op) < 8 || (REGNO (op) >= 24 && REGNO (op) < 32)));
@@ -700,9 +695,7 @@ restore_operand (op, mode)
memory address. */
int
-call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != MEM)
abort ();
@@ -711,20 +704,51 @@ call_operand (op, mode)
}
int
-call_operand_address (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand_address (rtx op, enum machine_mode mode)
{
return (symbolic_operand (op, mode) || memory_address_p (Pmode, op));
}
+/* If OP is a SYMBOL_REF of a thread-local symbol, return its TLS mode,
+ otherwise return 0. */
+
+int
+tls_symbolic_operand (rtx op)
+{
+ if (GET_CODE (op) != SYMBOL_REF)
+ return 0;
+ return SYMBOL_REF_TLS_MODEL (op);
+}
+
+int
+tgd_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+ return tls_symbolic_operand (op) == TLS_MODEL_GLOBAL_DYNAMIC;
+}
+
+int
+tld_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+ return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_DYNAMIC;
+}
+
+int
+tie_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+ return tls_symbolic_operand (op) == TLS_MODEL_INITIAL_EXEC;
+}
+
+int
+tle_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+ return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_EXEC;
+}
+
/* Returns 1 if OP is either a symbol reference or a sum of a symbol
reference and a constant. */
int
-symbolic_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+symbolic_operand (register rtx op, enum machine_mode mode)
{
enum machine_mode omode = GET_MODE (op);
@@ -734,12 +758,15 @@ symbolic_operand (op, mode)
switch (GET_CODE (op))
{
case SYMBOL_REF:
+ return !SYMBOL_REF_TLS_MODEL (op);
+
case LABEL_REF:
return 1;
case CONST:
op = XEXP (op, 0);
- return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+ return (((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+ && !SYMBOL_REF_TLS_MODEL (XEXP (op, 0)))
|| GET_CODE (XEXP (op, 0)) == LABEL_REF)
&& GET_CODE (XEXP (op, 1)) == CONST_INT);
@@ -752,25 +779,22 @@ 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);
if (GET_CODE (op) != MEM)
return 0;
op = XEXP (op, 0);
- return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST
- || GET_CODE (op) == HIGH || GET_CODE (op) == LABEL_REF);
+ return ((GET_CODE (op) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (op))
+ || GET_CODE (op) == CONST || GET_CODE (op) == HIGH
+ || GET_CODE (op) == LABEL_REF);
}
/* Return truth value of statement that OP is a LABEL_REF of mode MODE. */
int
-label_ref_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+label_ref_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != LABEL_REF)
return 0;
@@ -783,9 +807,7 @@ label_ref_operand (op, mode)
in either the medium/low or medium/anywhere code models of sparc64. */
int
-sp64_medium_pic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+sp64_medium_pic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
/* Check for (const (minus (symbol_ref:GOT)
(const (minus (label) (pc))))). */
@@ -810,9 +832,7 @@ sp64_medium_pic_operand (op, mode)
are accessed with EMBMEDANY_BASE_REG. */
int
-data_segment_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+data_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -832,9 +852,7 @@ data_segment_operand (op, mode)
This is needed in the medium/anywhere code model on v9. */
int
-text_segment_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+text_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -856,9 +874,7 @@ text_segment_operand (op, mode)
not symbolic. */
int
-reg_or_nonsymb_mem_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_nonsymb_mem_operand (register rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -870,9 +886,8 @@ reg_or_nonsymb_mem_operand (op, mode)
}
int
-splittable_symbolic_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+splittable_symbolic_memory_operand (rtx op,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != MEM)
return 0;
@@ -882,9 +897,8 @@ splittable_symbolic_memory_operand (op, mode)
}
int
-splittable_immediate_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+splittable_immediate_memory_operand (rtx op,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != MEM)
return 0;
@@ -896,9 +910,7 @@ splittable_immediate_memory_operand (op, mode)
/* Return truth value of whether OP is EQ or NE. */
int
-eq_or_neq (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+eq_or_neq (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == EQ || GET_CODE (op) == NE);
}
@@ -907,9 +919,7 @@ eq_or_neq (op, mode)
or LTU for non-floating-point. We handle those specially. */
int
-normal_comp_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+normal_comp_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -927,9 +937,7 @@ normal_comp_operator (op, mode)
MATCH_OPERATOR to recognize all the branch insns. */
int
-noov_compare_op (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+noov_compare_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -947,9 +955,7 @@ noov_compare_op (op, mode)
MATCH_OPERATOR to recognize all the branch insns. */
int
-noov_compare64_op (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+noov_compare64_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -969,9 +975,7 @@ noov_compare64_op (op, mode)
conditional move or branch on register contents instructions. */
int
-v9_regcmp_op (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+v9_regcmp_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -984,9 +988,7 @@ v9_regcmp_op (op, mode)
/* Return 1 if this is a SIGN_EXTEND or ZERO_EXTEND operation. */
int
-extend_op (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+extend_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND;
}
@@ -996,9 +998,7 @@ extend_op (op, mode)
because these require CC_NOOVmode, which we handle explicitly. */
int
-cc_arithop (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+cc_arithop (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == AND
|| GET_CODE (op) == IOR
@@ -1012,9 +1012,7 @@ cc_arithop (op, mode)
complement its second operand and set the condition codes explicitly. */
int
-cc_arithopn (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+cc_arithopn (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
/* XOR is not here because combine canonicalizes (xor (not ...) ...)
and (xor ... (not ...)) to (not (xor ...)). */
@@ -1027,9 +1025,7 @@ cc_arithopn (op, mode)
most 3 address instructions. */
int
-arith_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith_operand (rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -1041,9 +1037,7 @@ arith_operand (op, mode)
/* Return true if OP is a constant 4096 */
int
-arith_4096_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+arith_4096_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -1054,9 +1048,7 @@ arith_4096_operand (op, mode)
/* Return true if OP is suitable as second operand for add/sub */
int
-arith_add_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith_add_operand (rtx op, enum machine_mode mode)
{
return arith_operand (op, mode) || arith_4096_operand (op, mode);
}
@@ -1065,9 +1057,7 @@ arith_add_operand (op, mode)
immediate field of OR and XOR instructions. Used for 64-bit
constant formation patterns. */
int
-const64_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const64_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ((GET_CODE (op) == CONST_INT
&& SPARC_SIMM13_P (INTVAL (op)))
@@ -1083,9 +1073,7 @@ const64_operand (op, mode)
/* The same, but only for sethi instructions. */
int
-const64_high_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+const64_high_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT
&& (INTVAL (op) & ~(HOST_WIDE_INT)0x3ff) != 0
@@ -1102,9 +1090,7 @@ const64_high_operand (op, mode)
the movcc instructions. */
int
-arith11_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith11_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT && SPARC_SIMM11_P (INTVAL (op))));
@@ -1115,9 +1101,7 @@ arith11_operand (op, mode)
the movrcc instructions. */
int
-arith10_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith10_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT && SPARC_SIMM10_P (INTVAL (op))));
@@ -1131,9 +1115,7 @@ arith10_operand (op, mode)
for most 3 address instructions. */
int
-arith_double_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith_double_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_INT && SMALL_INT (op))
@@ -1153,9 +1135,7 @@ arith_double_operand (op, mode)
/* Return true if OP is a constant 4096 for DImode on ARCH64 */
int
-arith_double_4096_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+arith_double_4096_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (TARGET_ARCH64 &&
((GET_CODE (op) == CONST_INT && INTVAL (op) == 4096) ||
@@ -1167,9 +1147,7 @@ arith_double_4096_operand (op, mode)
/* Return true if OP is suitable as second operand for add/sub in DImode */
int
-arith_double_add_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith_double_add_operand (rtx op, enum machine_mode mode)
{
return arith_double_operand (op, mode) || arith_double_4096_operand (op, mode);
}
@@ -1180,9 +1158,7 @@ arith_double_add_operand (op, mode)
/* ??? Replace with arith11_operand? */
int
-arith11_double_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith11_double_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_DOUBLE
@@ -1203,9 +1179,7 @@ arith11_double_operand (op, mode)
/* ??? Replace with arith10_operand? */
int
-arith10_double_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+arith10_double_operand (rtx op, enum machine_mode mode)
{
return (register_operand (op, mode)
|| (GET_CODE (op) == CONST_DOUBLE
@@ -1225,17 +1199,13 @@ arith10_double_operand (op, mode)
which have a 13 bit immediate field. */
int
-small_int (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && SMALL_INT (op));
}
int
-small_int_or_double (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_int_or_double (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ((GET_CODE (op) == CONST_INT && SMALL_INT (op))
|| (GET_CODE (op) == CONST_DOUBLE
@@ -1248,9 +1218,7 @@ small_int_or_double (op, mode)
interprets the extended result as an unsigned number. */
int
-uns_small_int (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+uns_small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
#if HOST_BITS_PER_WIDE_INT > 32
/* All allowed constants will fit a CONST_INT. */
@@ -1267,18 +1235,14 @@ uns_small_int (op, mode)
}
int
-uns_arith_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+uns_arith_operand (rtx op, enum machine_mode mode)
{
return register_operand (op, mode) || uns_small_int (op, mode);
}
/* Return truth value of statement that OP is a call-clobbered register. */
int
-clobbered_register (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+clobbered_register (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == REG && call_used_regs[REGNO (op)]);
}
@@ -1286,9 +1250,7 @@ clobbered_register (op, mode)
/* Return 1 if OP is a valid operand for the source of a move insn. */
int
-input_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+input_operand (rtx op, enum machine_mode mode)
{
/* If both modes are non-void they must be the same. */
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
@@ -1370,9 +1332,7 @@ input_operand (op, mode)
/* We know it can't be done in one insn when we get here,
the movsi expander guarantees this. */
void
-sparc_emit_set_const32 (op0, op1)
- rtx op0;
- rtx op1;
+sparc_emit_set_const32 (rtx op0, rtx op1)
{
enum machine_mode mode = GET_MODE (op0);
rtx temp;
@@ -1428,10 +1388,7 @@ sparc_emit_set_const32 (op0, op1)
/* SPARC-v9 code-model support. */
void
-sparc_emit_set_symbolic_const64 (op0, op1, temp1)
- rtx op0;
- rtx op1;
- rtx temp1;
+sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp1)
{
rtx ti_temp1 = 0;
@@ -1571,10 +1528,10 @@ sparc_emit_set_symbolic_const64 (op0, op1, temp1)
/* These avoid problems when cross compiling. If we do not
go through all this hair then the optimizer will see
invalid REG_EQUAL notes or in some cases none at all. */
-static void sparc_emit_set_safe_HIGH64 PARAMS ((rtx, HOST_WIDE_INT));
-static rtx gen_safe_SET64 PARAMS ((rtx, HOST_WIDE_INT));
-static rtx gen_safe_OR64 PARAMS ((rtx, HOST_WIDE_INT));
-static rtx gen_safe_XOR64 PARAMS ((rtx, HOST_WIDE_INT));
+static void sparc_emit_set_safe_HIGH64 (rtx, HOST_WIDE_INT);
+static rtx gen_safe_SET64 (rtx, HOST_WIDE_INT);
+static rtx gen_safe_OR64 (rtx, HOST_WIDE_INT);
+static rtx gen_safe_XOR64 (rtx, HOST_WIDE_INT);
#if HOST_BITS_PER_WIDE_INT == 64
#define GEN_HIGHINT64(__x) GEN_INT ((__x) & ~(HOST_WIDE_INT)0x3ff)
@@ -1593,33 +1550,25 @@ static rtx gen_safe_XOR64 PARAMS ((rtx, HOST_WIDE_INT));
during CSE. We mask out the non-HIGH bits, and matches
a plain movdi, to alleviate this problem. */
static void
-sparc_emit_set_safe_HIGH64 (dest, val)
- rtx dest;
- HOST_WIDE_INT val;
+sparc_emit_set_safe_HIGH64 (rtx dest, HOST_WIDE_INT val)
{
emit_insn (gen_rtx_SET (VOIDmode, dest, GEN_HIGHINT64 (val)));
}
static rtx
-gen_safe_SET64 (dest, val)
- rtx dest;
- HOST_WIDE_INT val;
+gen_safe_SET64 (rtx dest, HOST_WIDE_INT val)
{
return gen_rtx_SET (VOIDmode, dest, GEN_INT64 (val));
}
static rtx
-gen_safe_OR64 (src, val)
- rtx src;
- HOST_WIDE_INT val;
+gen_safe_OR64 (rtx src, HOST_WIDE_INT val)
{
return gen_rtx_IOR (DImode, src, GEN_INT64 (val));
}
static rtx
-gen_safe_XOR64 (src, val)
- rtx src;
- HOST_WIDE_INT val;
+gen_safe_XOR64 (rtx src, HOST_WIDE_INT val)
{
return gen_rtx_XOR (DImode, src, GEN_INT64 (val));
}
@@ -1632,15 +1581,12 @@ gen_safe_XOR64 (src, val)
Without doing this, the optimizer cannot see such
opportunities. */
-static void sparc_emit_set_const64_quick1
- PARAMS ((rtx, rtx, unsigned HOST_WIDE_INT, int));
+static void sparc_emit_set_const64_quick1 (rtx, rtx,
+ unsigned HOST_WIDE_INT, int);
static void
-sparc_emit_set_const64_quick1 (op0, temp, low_bits, is_neg)
- rtx op0;
- rtx temp;
- unsigned HOST_WIDE_INT low_bits;
- int is_neg;
+sparc_emit_set_const64_quick1 (rtx op0, rtx temp,
+ unsigned HOST_WIDE_INT low_bits, int is_neg)
{
unsigned HOST_WIDE_INT high_bits;
@@ -1675,17 +1621,14 @@ sparc_emit_set_const64_quick1 (op0, temp, low_bits, is_neg)
}
}
-static void sparc_emit_set_const64_quick2
- PARAMS ((rtx, rtx, unsigned HOST_WIDE_INT,
- unsigned HOST_WIDE_INT, int));
+static void sparc_emit_set_const64_quick2 (rtx, rtx, unsigned HOST_WIDE_INT,
+ unsigned HOST_WIDE_INT, int);
static void
-sparc_emit_set_const64_quick2 (op0, temp, high_bits, low_immediate, shift_count)
- rtx op0;
- rtx temp;
- unsigned HOST_WIDE_INT high_bits;
- unsigned HOST_WIDE_INT low_immediate;
- int shift_count;
+sparc_emit_set_const64_quick2 (rtx op0, rtx temp,
+ unsigned HOST_WIDE_INT high_bits,
+ unsigned HOST_WIDE_INT low_immediate,
+ int shift_count)
{
rtx temp2 = op0;
@@ -1716,17 +1659,15 @@ sparc_emit_set_const64_quick2 (op0, temp, high_bits, low_immediate, shift_count)
gen_safe_OR64 (op0, low_immediate)));
}
-static void sparc_emit_set_const64_longway
- PARAMS ((rtx, rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT));
+static void sparc_emit_set_const64_longway (rtx, rtx, unsigned HOST_WIDE_INT,
+ unsigned HOST_WIDE_INT);
/* Full 64-bit constant decomposition. Even though this is the
'worst' case, we still optimize a few things away. */
static void
-sparc_emit_set_const64_longway (op0, temp, high_bits, low_bits)
- rtx op0;
- rtx temp;
- unsigned HOST_WIDE_INT high_bits;
- unsigned HOST_WIDE_INT low_bits;
+sparc_emit_set_const64_longway (rtx op0, rtx temp,
+ unsigned HOST_WIDE_INT high_bits,
+ unsigned HOST_WIDE_INT low_bits)
{
rtx sub_temp;
@@ -1824,15 +1765,14 @@ sparc_emit_set_const64_longway (op0, temp, high_bits, low_bits)
}
/* Analyze a 64-bit constant for certain properties. */
-static void analyze_64bit_constant
- PARAMS ((unsigned HOST_WIDE_INT,
- unsigned HOST_WIDE_INT,
- int *, int *, int *));
+static void analyze_64bit_constant (unsigned HOST_WIDE_INT,
+ unsigned HOST_WIDE_INT,
+ int *, int *, int *);
static void
-analyze_64bit_constant (high_bits, low_bits, hbsp, lbsp, abbasp)
- unsigned HOST_WIDE_INT high_bits, low_bits;
- int *hbsp, *lbsp, *abbasp;
+analyze_64bit_constant (unsigned HOST_WIDE_INT high_bits,
+ unsigned HOST_WIDE_INT low_bits,
+ int *hbsp, int *lbsp, int *abbasp)
{
int lowest_bit_set, highest_bit_set, all_bits_between_are_set;
int i;
@@ -1893,12 +1833,11 @@ analyze_64bit_constant (high_bits, low_bits, hbsp, lbsp, abbasp)
*abbasp = all_bits_between_are_set;
}
-static int const64_is_2insns
- PARAMS ((unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT));
+static int const64_is_2insns (unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT);
static int
-const64_is_2insns (high_bits, low_bits)
- unsigned HOST_WIDE_INT high_bits, low_bits;
+const64_is_2insns (unsigned HOST_WIDE_INT high_bits,
+ unsigned HOST_WIDE_INT low_bits)
{
int highest_bit_set, lowest_bit_set, all_bits_between_are_set;
@@ -1921,14 +1860,14 @@ const64_is_2insns (high_bits, low_bits)
return 0;
}
-static unsigned HOST_WIDE_INT create_simple_focus_bits
- PARAMS ((unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT,
- int, int));
+static unsigned HOST_WIDE_INT create_simple_focus_bits (unsigned HOST_WIDE_INT,
+ unsigned HOST_WIDE_INT,
+ int, int);
static unsigned HOST_WIDE_INT
-create_simple_focus_bits (high_bits, low_bits, lowest_bit_set, shift)
- unsigned HOST_WIDE_INT high_bits, low_bits;
- int lowest_bit_set, shift;
+create_simple_focus_bits (unsigned HOST_WIDE_INT high_bits,
+ unsigned HOST_WIDE_INT low_bits,
+ int lowest_bit_set, int shift)
{
HOST_WIDE_INT hi, lo;
@@ -1952,9 +1891,7 @@ create_simple_focus_bits (high_bits, low_bits, lowest_bit_set, shift)
insn sequence possible. Detection of all the 1-insn cases
has been done already. */
void
-sparc_emit_set_const64 (op0, op1)
- rtx op0;
- rtx op1;
+sparc_emit_set_const64 (rtx op0, rtx op1)
{
unsigned HOST_WIDE_INT high_bits, low_bits;
int lowest_bit_set, highest_bit_set;
@@ -2232,10 +2169,7 @@ sparc_emit_set_const64 (op0, op1)
processing is needed. */
enum machine_mode
-select_cc_mode (op, x, y)
- enum rtx_code op;
- rtx x;
- rtx y ATTRIBUTE_UNUSED;
+select_cc_mode (enum rtx_code op, rtx x, rtx y ATTRIBUTE_UNUSED)
{
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
{
@@ -2284,9 +2218,7 @@ select_cc_mode (op, x, y)
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;
@@ -2367,9 +2299,7 @@ gen_compare_reg (code, x, y)
sparc_compare_op1. */
int
-gen_v9_scc (compare_code, operands)
- enum rtx_code compare_code;
- register rtx *operands;
+gen_v9_scc (enum rtx_code compare_code, register rtx *operands)
{
rtx temp, op0, op1;
@@ -2457,9 +2387,7 @@ gen_v9_scc (compare_code, operands)
This function exists to take advantage of the v9 brxx insns. */
void
-emit_v9_brxx_insn (code, op0, label)
- enum rtx_code code;
- rtx op0, label;
+emit_v9_brxx_insn (enum rtx_code code, rtx op0, rtx label)
{
emit_jump_insn (gen_rtx_SET (VOIDmode,
pc_rtx,
@@ -2475,9 +2403,7 @@ emit_v9_brxx_insn (code, op0, label)
low 64bit of the register and 0 otherwise.
*/
rtx
-gen_df_reg (reg, low)
- rtx reg;
- int low;
+gen_df_reg (rtx reg, int low)
{
int regno = REGNO (reg);
@@ -2491,10 +2417,7 @@ gen_df_reg (reg, low)
assumed that no more than 3 operands are required. */
static void
-emit_soft_tfmode_libcall (func_name, nargs, operands)
- const char *func_name;
- int nargs;
- rtx *operands;
+emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands)
{
rtx ret_slot = NULL, arg[3], func_sym;
int i;
@@ -2579,9 +2502,7 @@ emit_soft_tfmode_libcall (func_name, nargs, operands)
/* Expand soft-float TFmode calls to sparc abi routines. */
static void
-emit_soft_tfmode_binop (code, operands)
- enum rtx_code code;
- rtx *operands;
+emit_soft_tfmode_binop (enum rtx_code code, rtx *operands)
{
const char *func;
@@ -2607,9 +2528,7 @@ emit_soft_tfmode_binop (code, operands)
}
static void
-emit_soft_tfmode_unop (code, operands)
- enum rtx_code code;
- rtx *operands;
+emit_soft_tfmode_unop (enum rtx_code code, rtx *operands)
{
const char *func;
@@ -2626,9 +2545,7 @@ emit_soft_tfmode_unop (code, operands)
}
static void
-emit_soft_tfmode_cvt (code, operands)
- enum rtx_code code;
- rtx *operands;
+emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands)
{
const char *func;
@@ -2729,9 +2646,7 @@ emit_soft_tfmode_cvt (code, operands)
registers. */
static void
-emit_hard_tfmode_operation (code, operands)
- enum rtx_code code;
- rtx *operands;
+emit_hard_tfmode_operation (enum rtx_code code, rtx *operands)
{
rtx op, dest;
@@ -2760,9 +2675,7 @@ emit_hard_tfmode_operation (code, operands)
}
void
-emit_tfmode_binop (code, operands)
- enum rtx_code code;
- rtx *operands;
+emit_tfmode_binop (enum rtx_code code, rtx *operands)
{
if (TARGET_HARD_QUAD)
emit_hard_tfmode_operation (code, operands);
@@ -2771,9 +2684,7 @@ emit_tfmode_binop (code, operands)
}
void
-emit_tfmode_unop (code, operands)
- enum rtx_code code;
- rtx *operands;
+emit_tfmode_unop (enum rtx_code code, rtx *operands)
{
if (TARGET_HARD_QUAD)
emit_hard_tfmode_operation (code, operands);
@@ -2782,9 +2693,7 @@ emit_tfmode_unop (code, operands)
}
void
-emit_tfmode_cvt (code, operands)
- enum rtx_code code;
- rtx *operands;
+emit_tfmode_cvt (enum rtx_code code, rtx *operands)
{
if (TARGET_HARD_QUAD)
emit_hard_tfmode_operation (code, operands);
@@ -2795,7 +2704,7 @@ emit_tfmode_cvt (code, operands)
/* Return nonzero if a return peephole merging return with
setting of output register is ok. */
int
-leaf_return_peephole_ok ()
+leaf_return_peephole_ok (void)
{
return (actual_fsize == 0);
}
@@ -2804,8 +2713,7 @@ leaf_return_peephole_ok ()
nop into its delay slot. */
int
-empty_delay_slot (insn)
- rtx insn;
+empty_delay_slot (rtx insn)
{
rtx seq;
@@ -2824,9 +2732,7 @@ empty_delay_slot (insn)
delay slot. SLOT is the slot we are trying to fill. */
int
-eligible_for_epilogue_delay (trial, slot)
- rtx trial;
- int slot;
+eligible_for_epilogue_delay (rtx trial, int slot)
{
rtx pat, src;
@@ -2948,12 +2854,37 @@ eligible_for_epilogue_delay (trial, slot)
return 0;
}
+/* Return nonzero if TRIAL can go into the call delay slot. */
+int
+tls_call_delay (rtx trial)
+{
+ rtx pat, unspec;
+
+ /* Binutils allows
+ call __tls_get_addr, %tgd_call (foo)
+ add %l7, %o0, %o0, %tgd_add (foo)
+ while Sun as/ld does not. */
+ if (TARGET_GNU_TLS || !TARGET_TLS)
+ return 1;
+
+ pat = PATTERN (trial);
+ if (GET_CODE (pat) != SET || GET_CODE (SET_DEST (pat)) != PLUS)
+ return 1;
+
+ unspec = XEXP (SET_DEST (pat), 1);
+ if (GET_CODE (unspec) != UNSPEC
+ || (XINT (unspec, 1) != UNSPEC_TLSGD
+ && XINT (unspec, 1) != UNSPEC_TLSLDM))
+ return 1;
+
+ return 0;
+}
+
/* Return nonzero if TRIAL can go into the sibling call
delay slot. */
int
-eligible_for_sibcall_delay (trial)
- rtx trial;
+eligible_for_sibcall_delay (rtx trial)
{
rtx pat, src;
@@ -3043,8 +2974,7 @@ eligible_for_sibcall_delay (trial)
}
static int
-check_return_regs (x)
- rtx x;
+check_return_regs (rtx x)
{
switch (GET_CODE (x))
{
@@ -3078,8 +3008,7 @@ check_return_regs (x)
}
int
-short_branch (uid1, uid2)
- int uid1, uid2;
+short_branch (int uid1, int uid2)
{
int delta = INSN_ADDRESSES (uid1) - INSN_ADDRESSES (uid2);
@@ -3094,9 +3023,7 @@ short_branch (uid1, uid2)
We assume REG is a reload reg, and therefore does
not live past labels or calls or jumps. */
int
-reg_unused_after (reg, insn)
- rtx reg;
- rtx insn;
+reg_unused_after (rtx reg, rtx insn)
{
enum rtx_code code, prev_code = UNKNOWN;
@@ -3125,6 +3052,45 @@ reg_unused_after (reg, insn)
return 1;
}
+/* Determine if it's legal to put X into the constant pool. This
+ is not possible if X contains the address of a symbol that is
+ not constant (TLS) or not known at final link time (PIC). */
+
+static bool
+sparc_cannot_force_const_mem (rtx x)
+{
+ switch (GET_CODE (x))
+ {
+ case CONST_INT:
+ case CONST_DOUBLE:
+ /* Accept all non-symbolic constants. */
+ return false;
+
+ case LABEL_REF:
+ /* Labels are OK iff we are non-PIC. */
+ return flag_pic != 0;
+
+ case SYMBOL_REF:
+ /* 'Naked' TLS symbol references are never OK,
+ non-TLS symbols are OK iff we are non-PIC. */
+ if (SYMBOL_REF_TLS_MODEL (x))
+ return true;
+ else
+ return flag_pic != 0;
+
+ case CONST:
+ return sparc_cannot_force_const_mem (XEXP (x, 0));
+ case PLUS:
+ case MINUS:
+ return sparc_cannot_force_const_mem (XEXP (x, 0))
+ || sparc_cannot_force_const_mem (XEXP (x, 1));
+ case UNSPEC:
+ return true;
+ default:
+ abort ();
+ }
+}
+
/* The table we use to reference PIC data. */
static GTY(()) rtx global_offset_table;
@@ -3135,8 +3101,7 @@ static char get_pc_symbol_name[256];
/* Ensure that we are not using patterns that are not OK with PIC. */
int
-check_pic (i)
- int i;
+check_pic (int i)
{
switch (flag_pic)
{
@@ -3159,8 +3124,7 @@ check_pic (i)
reloaded while generating PIC code. */
int
-pic_address_needs_scratch (x)
- rtx x;
+pic_address_needs_scratch (rtx x)
{
/* An address which is a symbolic plus a non SMALL_INT needs a temp reg. */
if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS
@@ -3172,16 +3136,399 @@ pic_address_needs_scratch (x)
return 0;
}
+/* Determine if a given RTX is a valid constant. We already know this
+ satisfies CONSTANT_P. */
+
+bool
+legitimate_constant_p (rtx x)
+{
+ rtx inner;
+
+ switch (GET_CODE (x))
+ {
+ case SYMBOL_REF:
+ /* TLS symbols are not constant. */
+ if (SYMBOL_REF_TLS_MODEL (x))
+ return false;
+ break;
+
+ case CONST:
+ inner = XEXP (x, 0);
+
+ /* Offsets of TLS symbols are never valid.
+ Discourage CSE from creating them. */
+ if (GET_CODE (inner) == PLUS
+ && tls_symbolic_operand (XEXP (inner, 0)))
+ return false;
+ break;
+
+ case CONST_DOUBLE:
+ if (GET_MODE (x) == VOIDmode)
+ return true;
+
+ /* Floating point constants are generally not ok.
+ The only exception is 0.0 in VIS. */
+ if (TARGET_VIS
+ && (GET_MODE (x) == SFmode
+ || GET_MODE (x) == DFmode
+ || GET_MODE (x) == TFmode)
+ && fp_zero_operand (x, GET_MODE (x)))
+ return true;
+
+ return false;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
+/* Determine if a given RTX is a valid constant address. */
+
+bool
+constant_address_p (rtx x)
+{
+ switch (GET_CODE (x))
+ {
+ case LABEL_REF:
+ case CONST_INT:
+ case HIGH:
+ return true;
+
+ case CONST:
+ if (flag_pic && pic_address_needs_scratch (x))
+ return false;
+ return legitimate_constant_p (x);
+
+ case SYMBOL_REF:
+ return !flag_pic && legitimate_constant_p (x);
+
+ default:
+ return false;
+ }
+}
+
+/* Nonzero if the constant value X is a legitimate general operand
+ when generating PIC code. It is given that flag_pic is on and
+ that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
+
+bool
+legitimate_pic_operand_p (rtx x)
+{
+ if (pic_address_needs_scratch (x))
+ return false;
+ if (tls_symbolic_operand (x)
+ || (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == PLUS
+ && tls_symbolic_operand (XEXP (XEXP (x, 0), 0))))
+ return false;
+ return true;
+}
+
+/* Return nonzero if ADDR is a valid memory address.
+ STRICT specifies whether strict register checking applies. */
+
+int
+legitimate_address_p (enum machine_mode mode, rtx addr, int strict)
+{
+ rtx rs1 = NULL, rs2 = NULL, imm1 = NULL, imm2;
+
+ if (REG_P (addr) || GET_CODE (addr) == SUBREG)
+ rs1 = addr;
+ else if (GET_CODE (addr) == PLUS)
+ {
+ rs1 = XEXP (addr, 0);
+ rs2 = XEXP (addr, 1);
+
+ /* Canonicalize. REG comes first, if there are no regs,
+ LO_SUM comes first. */
+ if (!REG_P (rs1)
+ && GET_CODE (rs1) != SUBREG
+ && (REG_P (rs2)
+ || GET_CODE (rs2) == SUBREG
+ || (GET_CODE (rs2) == LO_SUM && GET_CODE (rs1) != LO_SUM)))
+ {
+ rs1 = XEXP (addr, 1);
+ rs2 = XEXP (addr, 0);
+ }
+
+ if ((flag_pic == 1
+ && rs1 == pic_offset_table_rtx
+ && !REG_P (rs2)
+ && GET_CODE (rs2) != SUBREG
+ && GET_CODE (rs2) != LO_SUM
+ && GET_CODE (rs2) != MEM
+ && !tls_symbolic_operand (rs2)
+ && (! symbolic_operand (rs2, VOIDmode) || mode == Pmode)
+ && (GET_CODE (rs2) != CONST_INT || SMALL_INT (rs2)))
+ || ((REG_P (rs1)
+ || GET_CODE (rs1) == SUBREG)
+ && RTX_OK_FOR_OFFSET_P (rs2)))
+ {
+ imm1 = rs2;
+ rs2 = NULL;
+ }
+ else if ((REG_P (rs1) || GET_CODE (rs1) == SUBREG)
+ && (REG_P (rs2) || GET_CODE (rs2) == SUBREG))
+ {
+ /* We prohibit REG + REG for TFmode when there are no instructions
+ which accept REG+REG instructions. We do this because REG+REG
+ is not an offsetable address. If we get the situation in reload
+ where source and destination of a movtf pattern are both MEMs with
+ REG+REG address, then only one of them gets converted to an
+ offsetable address. */
+ if (mode == TFmode
+ && !(TARGET_FPU && TARGET_ARCH64 && TARGET_V9
+ && TARGET_HARD_QUAD))
+ return 0;
+
+ /* We prohibit REG + REG on ARCH32 if not optimizing for
+ DFmode/DImode because then mem_min_alignment is likely to be zero
+ after reload and the forced split would lack a matching splitter
+ pattern. */
+ if (TARGET_ARCH32 && !optimize
+ && (mode == DFmode || mode == DImode))
+ return 0;
+ }
+ else if (USE_AS_OFFSETABLE_LO10
+ && GET_CODE (rs1) == LO_SUM
+ && TARGET_ARCH64
+ && ! TARGET_CM_MEDMID
+ && RTX_OK_FOR_OLO10_P (rs2))
+ {
+ imm2 = rs2;
+ rs2 = NULL;
+ imm1 = XEXP (rs1, 1);
+ rs1 = XEXP (rs1, 0);
+ if (! CONSTANT_P (imm1) || tls_symbolic_operand (rs1))
+ return 0;
+ }
+ }
+ else if (GET_CODE (addr) == LO_SUM)
+ {
+ rs1 = XEXP (addr, 0);
+ imm1 = XEXP (addr, 1);
+
+ if (! CONSTANT_P (imm1) || tls_symbolic_operand (rs1))
+ return 0;
+
+ /* We can't allow TFmode, because an offset greater than or equal to the
+ alignment (8) may cause the LO_SUM to overflow if !v9. */
+ if (mode == TFmode && !TARGET_V9)
+ return 0;
+ }
+ else if (GET_CODE (addr) == CONST_INT && SMALL_INT (addr))
+ return 1;
+ else
+ return 0;
+
+ if (GET_CODE (rs1) == SUBREG)
+ rs1 = SUBREG_REG (rs1);
+ if (!REG_P (rs1))
+ return 0;
+
+ if (rs2)
+ {
+ if (GET_CODE (rs2) == SUBREG)
+ rs2 = SUBREG_REG (rs2);
+ if (!REG_P (rs2))
+ return 0;
+ }
+
+ if (strict)
+ {
+ if (!REGNO_OK_FOR_BASE_P (REGNO (rs1))
+ || (rs2 && !REGNO_OK_FOR_BASE_P (REGNO (rs2))))
+ return 0;
+ }
+ else
+ {
+ if ((REGNO (rs1) >= 32
+ && REGNO (rs1) != FRAME_POINTER_REGNUM
+ && REGNO (rs1) < FIRST_PSEUDO_REGISTER)
+ || (rs2
+ && (REGNO (rs2) >= 32
+ && REGNO (rs2) != FRAME_POINTER_REGNUM
+ && REGNO (rs2) < FIRST_PSEUDO_REGISTER)))
+ return 0;
+ }
+ return 1;
+}
+
+/* Construct the SYMBOL_REF for the tls_get_offset function. */
+
+static GTY(()) rtx sparc_tls_symbol;
+static rtx
+sparc_tls_get_addr (void)
+{
+ if (!sparc_tls_symbol)
+ sparc_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tls_get_addr");
+
+ return sparc_tls_symbol;
+}
+
+static rtx
+sparc_tls_got (void)
+{
+ rtx temp;
+ if (flag_pic)
+ {
+ current_function_uses_pic_offset_table = 1;
+ return pic_offset_table_rtx;
+ }
+
+ if (!global_offset_table)
+ global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
+ temp = gen_reg_rtx (Pmode);
+ emit_move_insn (temp, global_offset_table);
+ return temp;
+}
+
+
+/* ADDR contains a thread-local SYMBOL_REF. Generate code to compute
+ this (thread-local) address. */
+
+rtx
+legitimize_tls_address (rtx addr)
+{
+ rtx temp1, temp2, temp3, ret, o0, got, insn;
+
+ if (no_new_pseudos)
+ abort ();
+
+ if (GET_CODE (addr) == SYMBOL_REF)
+ switch (SYMBOL_REF_TLS_MODEL (addr))
+ {
+ case TLS_MODEL_GLOBAL_DYNAMIC:
+ start_sequence ();
+ temp1 = gen_reg_rtx (SImode);
+ temp2 = gen_reg_rtx (SImode);
+ ret = gen_reg_rtx (Pmode);
+ o0 = gen_rtx_REG (Pmode, 8);
+ got = sparc_tls_got ();
+ emit_insn (gen_tgd_hi22 (temp1, addr));
+ emit_insn (gen_tgd_lo10 (temp2, temp1, addr));
+ if (TARGET_ARCH32)
+ {
+ emit_insn (gen_tgd_add32 (o0, got, temp2, addr));
+ insn = emit_call_insn (gen_tgd_call32 (o0, sparc_tls_get_addr (),
+ addr, const1_rtx));
+ }
+ else
+ {
+ emit_insn (gen_tgd_add64 (o0, got, temp2, addr));
+ insn = emit_call_insn (gen_tgd_call64 (o0, sparc_tls_get_addr (),
+ addr, const1_rtx));
+ }
+ CALL_INSN_FUNCTION_USAGE (insn)
+ = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, o0),
+ CALL_INSN_FUNCTION_USAGE (insn));
+ insn = get_insns ();
+ end_sequence ();
+ emit_libcall_block (insn, ret, o0, addr);
+ break;
+
+ case TLS_MODEL_LOCAL_DYNAMIC:
+ start_sequence ();
+ temp1 = gen_reg_rtx (SImode);
+ temp2 = gen_reg_rtx (SImode);
+ temp3 = gen_reg_rtx (Pmode);
+ ret = gen_reg_rtx (Pmode);
+ o0 = gen_rtx_REG (Pmode, 8);
+ got = sparc_tls_got ();
+ emit_insn (gen_tldm_hi22 (temp1));
+ emit_insn (gen_tldm_lo10 (temp2, temp1));
+ if (TARGET_ARCH32)
+ {
+ emit_insn (gen_tldm_add32 (o0, got, temp2));
+ insn = emit_call_insn (gen_tldm_call32 (o0, sparc_tls_get_addr (),
+ const1_rtx));
+ }
+ else
+ {
+ emit_insn (gen_tldm_add64 (o0, got, temp2));
+ insn = emit_call_insn (gen_tldm_call64 (o0, sparc_tls_get_addr (),
+ const1_rtx));
+ }
+ CALL_INSN_FUNCTION_USAGE (insn)
+ = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, o0),
+ CALL_INSN_FUNCTION_USAGE (insn));
+ insn = get_insns ();
+ end_sequence ();
+ emit_libcall_block (insn, temp3, o0,
+ gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
+ UNSPEC_TLSLD_BASE));
+ temp1 = gen_reg_rtx (SImode);
+ temp2 = gen_reg_rtx (SImode);
+ emit_insn (gen_tldo_hix22 (temp1, addr));
+ emit_insn (gen_tldo_lox10 (temp2, temp1, addr));
+ if (TARGET_ARCH32)
+ emit_insn (gen_tldo_add32 (ret, temp3, temp2, addr));
+ else
+ emit_insn (gen_tldo_add64 (ret, temp3, temp2, addr));
+ break;
+
+ case TLS_MODEL_INITIAL_EXEC:
+ temp1 = gen_reg_rtx (SImode);
+ temp2 = gen_reg_rtx (SImode);
+ temp3 = gen_reg_rtx (Pmode);
+ got = sparc_tls_got ();
+ emit_insn (gen_tie_hi22 (temp1, addr));
+ emit_insn (gen_tie_lo10 (temp2, temp1, addr));
+ if (TARGET_ARCH32)
+ emit_insn (gen_tie_ld32 (temp3, got, temp2, addr));
+ else
+ emit_insn (gen_tie_ld64 (temp3, got, temp2, addr));
+ if (TARGET_SUN_TLS)
+ {
+ ret = gen_reg_rtx (Pmode);
+ if (TARGET_ARCH32)
+ emit_insn (gen_tie_add32 (ret, gen_rtx_REG (Pmode, 7),
+ temp3, addr));
+ else
+ emit_insn (gen_tie_add64 (ret, gen_rtx_REG (Pmode, 7),
+ temp3, addr));
+ }
+ else
+ ret = gen_rtx_PLUS (Pmode, gen_rtx_REG (Pmode, 7), temp3);
+ break;
+
+ case TLS_MODEL_LOCAL_EXEC:
+ temp1 = gen_reg_rtx (Pmode);
+ temp2 = gen_reg_rtx (Pmode);
+ if (TARGET_ARCH32)
+ {
+ emit_insn (gen_tle_hix22_sp32 (temp1, addr));
+ emit_insn (gen_tle_lox10_sp32 (temp2, temp1, addr));
+ }
+ else
+ {
+ emit_insn (gen_tle_hix22_sp64 (temp1, addr));
+ emit_insn (gen_tle_lox10_sp64 (temp2, temp1, addr));
+ }
+ ret = gen_rtx_PLUS (Pmode, gen_rtx_REG (Pmode, 7), temp2);
+ break;
+
+ default:
+ abort ();
+ }
+
+ else
+ abort (); /* for now ... */
+
+ return ret;
+}
+
+
/* Legitimize PIC addresses. If the address is already position-independent,
we return ORIG. Newly generated position-independent addresses go into a
reg. This is REG if nonzero, otherwise we allocate register(s) as
necessary. */
rtx
-legitimize_pic_address (orig, mode, reg)
- rtx orig;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- rtx reg;
+legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx reg)
{
if (GET_CODE (orig) == SYMBOL_REF)
{
@@ -3281,10 +3628,56 @@ legitimize_pic_address (orig, mode, reg)
return orig;
}
+/* Try machine-dependent ways of modifying an illegitimate address X
+ to be legitimate. If we find one, return the new, valid address.
+
+ OLDX is the address as it was before break_out_memory_refs was called.
+ In some cases it is useful to look at this to decide what needs to be done.
+
+ MODE is the mode of the operand pointed to by X. */
+
+rtx
+legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode)
+{
+ rtx orig_x = x;
+
+ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == MULT)
+ x = gen_rtx_PLUS (Pmode, XEXP (x, 1),
+ force_operand (XEXP (x, 0), NULL_RTX));
+ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == MULT)
+ x = gen_rtx_PLUS (Pmode, XEXP (x, 0),
+ force_operand (XEXP (x, 1), NULL_RTX));
+ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == PLUS)
+ x = gen_rtx_PLUS (Pmode, force_operand (XEXP (x, 0), NULL_RTX),
+ XEXP (x, 1));
+ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == PLUS)
+ x = gen_rtx_PLUS (Pmode, XEXP (x, 0),
+ force_operand (XEXP (x, 1), NULL_RTX));
+
+ if (x != orig_x && legitimate_address_p (mode, x, FALSE))
+ return x;
+
+ if (tls_symbolic_operand (x))
+ x = legitimize_tls_address (x);
+ else if (flag_pic)
+ x = legitimize_pic_address (x, mode, 0);
+ else if (GET_CODE (x) == PLUS && CONSTANT_ADDRESS_P (XEXP (x, 1)))
+ x = gen_rtx_PLUS (Pmode, XEXP (x, 0),
+ copy_to_mode_reg (Pmode, XEXP (x, 1)));
+ else if (GET_CODE (x) == PLUS && CONSTANT_ADDRESS_P (XEXP (x, 0)))
+ x = gen_rtx_PLUS (Pmode, XEXP (x, 1),
+ copy_to_mode_reg (Pmode, XEXP (x, 0)));
+ else if (GET_CODE (x) == SYMBOL_REF
+ || GET_CODE (x) == CONST
+ || GET_CODE (x) == LABEL_REF)
+ x = copy_to_suggested_reg (x, NULL_RTX, Pmode);
+ return x;
+}
+
/* Emit special PIC prologues. */
void
-load_pic_register ()
+load_pic_register (void)
{
/* Labels to get the PC in the prologue of this function. */
int orig_flag_pic = flag_pic;
@@ -3329,9 +3722,7 @@ load_pic_register ()
least a DESIRED byte boundary. */
int
-mem_min_alignment (mem, desired)
- rtx mem;
- int desired;
+mem_min_alignment (rtx mem, int desired)
{
rtx addr, base, offset;
@@ -3524,7 +3915,7 @@ int sparc_mode_class [NUM_MACHINE_MODES];
enum reg_class sparc_regno_reg_class[FIRST_PSEUDO_REGISTER];
static void
-sparc_init_modes ()
+sparc_init_modes (void)
{
int i;
@@ -3602,13 +3993,8 @@ sparc_init_modes ()
v9 int regs as it simplifies the code. */
static int
-save_regs (file, low, high, base, offset, n_regs, real_offset)
- FILE *file;
- int low, high;
- const char *base;
- int offset;
- int n_regs;
- int real_offset;
+save_regs (FILE *file, int low, int high, const char *base,
+ int offset, int n_regs, int real_offset)
{
int i;
@@ -3675,12 +4061,8 @@ save_regs (file, low, high, base, offset, n_regs, real_offset)
v9 int regs as it simplifies the code. */
static int
-restore_regs (file, low, high, base, offset, n_regs)
- FILE *file;
- int low, high;
- const char *base;
- int offset;
- int n_regs;
+restore_regs (FILE *file, int low, int high, const char *base,
+ int offset, int n_regs)
{
int i;
@@ -3720,9 +4102,7 @@ restore_regs (file, low, high, base, offset, n_regs)
during the reload pass and also by output_function_prologue(). */
int
-compute_frame_size (size, leaf_function)
- int size;
- int leaf_function;
+compute_frame_size (int size, int leaf_function)
{
int n_regs = 0, i;
int outgoing_args_size = (current_function_outgoing_args_size
@@ -3780,10 +4160,7 @@ compute_frame_size (size, leaf_function)
/* ??? We may be able to use the set macro here too. */
static void
-build_big_number (file, num, reg)
- FILE *file;
- int num;
- const char *reg;
+build_big_number (FILE *file, int num, const char *reg)
{
if (num >= 0 || ! TARGET_ARCH64)
{
@@ -3809,8 +4186,7 @@ build_big_number (file, num, reg)
/* Output any necessary .register pseudo-ops. */
void
-sparc_output_scratch_registers (file)
- FILE *file ATTRIBUTE_UNUSED;
+sparc_output_scratch_registers (FILE *file ATTRIBUTE_UNUSED)
{
#ifdef HAVE_AS_REGISTER_PSEUDO_OP
int i;
@@ -3850,9 +4226,7 @@ sparc_output_scratch_registers (file)
to do this is made in regclass.c. */
static void
-sparc_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+sparc_output_function_prologue (FILE *file, HOST_WIDE_INT size)
{
if (TARGET_FLAT)
sparc_flat_function_prologue (file, size);
@@ -3864,10 +4238,8 @@ sparc_output_function_prologue (file, size)
/* Output code for the function prologue. */
static void
-sparc_nonflat_function_prologue (file, size, leaf_function)
- FILE *file;
- HOST_WIDE_INT size;
- int leaf_function;
+sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size,
+ int leaf_function)
{
sparc_output_scratch_registers (file);
@@ -3982,9 +4354,7 @@ sparc_nonflat_function_prologue (file, size, leaf_function)
/* Output code to restore any call saved registers. */
static void
-output_restore_regs (file, leaf_function)
- FILE *file;
- int leaf_function ATTRIBUTE_UNUSED;
+output_restore_regs (FILE *file, int leaf_function ATTRIBUTE_UNUSED)
{
int offset, n_regs;
const char *base;
@@ -4015,9 +4385,7 @@ output_restore_regs (file, leaf_function)
before returning. */
static void
-sparc_output_function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+sparc_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
{
if (TARGET_FLAT)
sparc_flat_function_epilogue (file, size);
@@ -4029,10 +4397,9 @@ sparc_output_function_epilogue (file, size)
/* Output code for the function epilogue. */
static void
-sparc_nonflat_function_epilogue (file, size, leaf_function)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
- int leaf_function;
+sparc_nonflat_function_epilogue (FILE *file,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED,
+ int leaf_function)
{
const char *ret;
@@ -4046,11 +4413,19 @@ sparc_nonflat_function_epilogue (file, size, leaf_function)
of a function were call foo; dslot; this can make the return
PC of foo (ie. address of call instruction plus 8) point to
the first instruction in the next function. */
- rtx insn;
-
- fputs("\tnop\n", file);
+ rtx insn, last_real_insn;
insn = get_last_insn ();
+
+ last_real_insn = prev_real_insn (insn);
+ if (last_real_insn
+ && GET_CODE (last_real_insn) == INSN
+ && GET_CODE (PATTERN (last_real_insn)) == SEQUENCE)
+ last_real_insn = XVECEXP (PATTERN (last_real_insn), 0, 0);
+
+ if (last_real_insn && GET_CODE (last_real_insn) == CALL_INSN)
+ fputs("\tnop\n", file);
+
if (GET_CODE (insn) == NOTE)
insn = prev_nonnote_insn (insn);
if (insn && GET_CODE (insn) == BARRIER)
@@ -4161,8 +4536,7 @@ sparc_nonflat_function_epilogue (file, size, leaf_function)
/* Output a sibling call. */
const char *
-output_sibcall (insn, call_operand)
- rtx insn, call_operand;
+output_sibcall (rtx insn, rtx call_operand)
{
int leaf_regs = current_function_uses_only_leaf_regs;
rtx operands[3];
@@ -4364,11 +4738,9 @@ output_sibcall (insn, call_operand)
For a library call, FNTYPE is 0. */
void
-init_cumulative_args (cum, fntype, libname, fndecl)
- CUMULATIVE_ARGS *cum;
- tree fntype;
- rtx libname ATTRIBUTE_UNUSED;
- tree fndecl ATTRIBUTE_UNUSED;
+init_cumulative_args (struct sparc_args *cum, tree fntype,
+ rtx libname ATTRIBUTE_UNUSED,
+ tree fndecl ATTRIBUTE_UNUSED)
{
cum->words = 0;
cum->prototype_p = fntype && TYPE_ARG_TYPES (fntype);
@@ -4391,14 +4763,9 @@ init_cumulative_args (cum, fntype, libname, fndecl)
*PPADDING records the amount of padding needed in words. */
static int
-function_arg_slotno (cum, mode, type, named, incoming_p, pregno, ppadding)
- const CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
- int incoming_p;
- int *pregno;
- int *ppadding;
+function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode,
+ tree type, int named, int incoming_p,
+ int *pregno, int *ppadding)
{
int regbase = (incoming_p
? SPARC_INCOMING_INT_ARG_FIRST
@@ -4541,24 +4908,19 @@ struct function_arg_record_value_parms
};
static void function_arg_record_value_3
- PARAMS ((HOST_WIDE_INT, struct function_arg_record_value_parms *));
+ (HOST_WIDE_INT, struct function_arg_record_value_parms *);
static void function_arg_record_value_2
- PARAMS ((tree, HOST_WIDE_INT,
- struct function_arg_record_value_parms *));
+ (tree, HOST_WIDE_INT, struct function_arg_record_value_parms *);
static void function_arg_record_value_1
- PARAMS ((tree, HOST_WIDE_INT,
- struct function_arg_record_value_parms *));
-static rtx function_arg_record_value
- PARAMS ((tree, enum machine_mode, int, int, int));
+ (tree, HOST_WIDE_INT, struct function_arg_record_value_parms *);
+static rtx function_arg_record_value (tree, enum machine_mode, int, int, int);
/* A subroutine of function_arg_record_value. Traverse the structure
recursively and determine how many registers will be required. */
static void
-function_arg_record_value_1 (type, startbitpos, parms)
- tree type;
- HOST_WIDE_INT startbitpos;
- struct function_arg_record_value_parms *parms;
+function_arg_record_value_1 (tree type, HOST_WIDE_INT startbitpos,
+ struct function_arg_record_value_parms *parms)
{
tree field;
@@ -4642,9 +5004,8 @@ function_arg_record_value_1 (type, startbitpos, parms)
structure between parms->intoffset and bitpos to integer registers. */
static void
-function_arg_record_value_3 (bitpos, parms)
- HOST_WIDE_INT bitpos;
- struct function_arg_record_value_parms *parms;
+function_arg_record_value_3 (HOST_WIDE_INT bitpos,
+ struct function_arg_record_value_parms *parms)
{
enum machine_mode mode;
unsigned int regno;
@@ -4700,10 +5061,8 @@ function_arg_record_value_3 (bitpos, parms)
to make that happen. */
static void
-function_arg_record_value_2 (type, startbitpos, parms)
- tree type;
- HOST_WIDE_INT startbitpos;
- struct function_arg_record_value_parms *parms;
+function_arg_record_value_2 (tree type, HOST_WIDE_INT startbitpos,
+ struct function_arg_record_value_parms *parms)
{
tree field;
int packed_p = 0;
@@ -4795,10 +5154,8 @@ function_arg_record_value_2 (type, startbitpos, parms)
REGBASE is the regno of the base register for the parameter array. */
static rtx
-function_arg_record_value (type, mode, slotno, named, regbase)
- tree type;
- enum machine_mode mode;
- int slotno, named, regbase;
+function_arg_record_value (tree type, enum machine_mode mode,
+ int slotno, int named, int regbase)
{
HOST_WIDE_INT typesize = int_size_in_bytes (type);
struct function_arg_record_value_parms parms;
@@ -4900,12 +5257,8 @@ function_arg_record_value (type, mode, slotno, named, regbase)
INCOMING_P is zero for FUNCTION_ARG, nonzero for FUNCTION_INCOMING_ARG. */
rtx
-function_arg (cum, mode, type, named, incoming_p)
- const CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
- int incoming_p;
+function_arg (const struct sparc_args *cum, enum machine_mode mode,
+ tree type, int named, int incoming_p)
{
int regbase = (incoming_p
? SPARC_INCOMING_INT_ARG_FIRST
@@ -5036,11 +5389,8 @@ function_arg (cum, mode, type, named, incoming_p)
mode] will be split between that reg and memory. */
int
-function_arg_partial_nregs (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
+function_arg_partial_nregs (const struct sparc_args *cum,
+ enum machine_mode mode, tree type, int named)
{
int slotno, regno, padding;
@@ -5107,11 +5457,9 @@ function_arg_partial_nregs (cum, mode, type, named)
For Pascal, also pass arrays by reference. */
int
-function_arg_pass_by_reference (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg_pass_by_reference (const struct sparc_args *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode, tree type,
+ int named ATTRIBUTE_UNUSED)
{
if (TARGET_ARCH32)
{
@@ -5135,11 +5483,8 @@ function_arg_pass_by_reference (cum, mode, type, named)
TYPE is null for libcalls where that information may not be available. */
void
-function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
+function_arg_advance (struct sparc_args *cum, enum machine_mode mode,
+ tree type, int named)
{
int slotno, regno, padding;
@@ -5191,21 +5536,13 @@ function_arg_advance (cum, mode, type, named)
argument slot. */
enum direction
-function_arg_padding (mode, type)
- enum machine_mode mode;
- tree type;
+function_arg_padding (enum machine_mode mode, tree type)
{
if (TARGET_ARCH64 && type != 0 && AGGREGATE_TYPE_P (type))
return upward;
- /* This is the default definition. */
- return (! BYTES_BIG_ENDIAN
- ? upward
- : ((mode == BLKmode
- ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && int_size_in_bytes (type) < (PARM_BOUNDARY / BITS_PER_UNIT))
- : GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)
- ? downward : upward));
+ /* Fall back to the default. */
+ return DEFAULT_FUNCTION_ARG_PADDING (mode, type);
}
/* Handle FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE, and LIBCALL_VALUE macros.
@@ -5213,10 +5550,7 @@ function_arg_padding (mode, type)
except that up to 32-bytes may be returned in registers. */
rtx
-function_value (type, mode, incoming_p)
- tree type;
- enum machine_mode mode;
- int incoming_p;
+function_value (tree type, enum machine_mode mode, int incoming_p)
{
int regno;
int regbase = (incoming_p
@@ -5267,7 +5601,7 @@ function_value (type, mode, incoming_p)
the first unnamed parameter. */
rtx
-sparc_builtin_saveregs ()
+sparc_builtin_saveregs (void)
{
int first_reg = current_function_args_info.words;
rtx address;
@@ -5294,9 +5628,7 @@ sparc_builtin_saveregs ()
/* Implement `va_start' for varargs and stdarg. */
void
-sparc_va_start (valist, nextarg)
- tree valist;
- rtx nextarg;
+sparc_va_start (tree valist, rtx nextarg)
{
nextarg = expand_builtin_saveregs ();
std_expand_builtin_va_start (valist, nextarg);
@@ -5305,8 +5637,7 @@ sparc_va_start (valist, nextarg)
/* Implement `va_arg'. */
rtx
-sparc_va_arg (valist, type)
- tree valist, type;
+sparc_va_arg (tree valist, tree type)
{
HOST_WIDE_INT size, rsize, align;
tree addr, incr;
@@ -5430,11 +5761,8 @@ sparc_va_arg (valist, type)
INSN, if set, is the insn. */
char *
-output_cbranch (op, dest, label, reversed, annul, noop, insn)
- rtx op, dest;
- int label;
- int reversed, annul, noop;
- rtx insn;
+output_cbranch (rtx op, rtx dest, int label, int reversed, int annul,
+ int noop, rtx insn)
{
static char string[50];
enum rtx_code code = GET_CODE (op);
@@ -5678,9 +6006,7 @@ output_cbranch (op, dest, label, reversed, annul, noop, insn)
values as arguments instead of the TFmode registers themselves,
that's why we cannot call emit_float_lib_cmp. */
void
-sparc_emit_float_lib_cmp (x, y, comparison)
- rtx x, y;
- enum rtx_code comparison;
+sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison)
{
const char *qpfunc;
rtx slot0, slot1, result, tem, tem2;
@@ -5817,8 +6143,7 @@ sparc_emit_float_lib_cmp (x, y, comparison)
optabs would emit if we didn't have TFmode patterns. */
void
-sparc_emit_floatunsdi (operands)
- rtx operands[2];
+sparc_emit_floatunsdi (rtx *operands)
{
rtx neglab, donelab, i0, i1, f0, in, out;
enum machine_mode mode;
@@ -5861,11 +6186,8 @@ sparc_emit_floatunsdi (operands)
NOOP is nonzero if we have to follow this branch by a noop. */
char *
-output_v9branch (op, dest, reg, label, reversed, annul, noop, insn)
- rtx op, dest;
- int reg, label;
- int reversed, annul, noop;
- rtx insn;
+output_v9branch (rtx op, rtx dest, int reg, int label, int reversed,
+ int annul, int noop, rtx insn)
{
static char string[50];
enum rtx_code code = GET_CODE (op);
@@ -6005,9 +6327,7 @@ output_v9branch (op, dest, reg, label, reversed, annul, noop, insn)
*/
static int
-epilogue_renumber (where, test)
- register rtx *where;
- int test;
+epilogue_renumber (register rtx *where, int test)
{
register const char *fmt;
register int i;
@@ -6091,7 +6411,7 @@ static const int *const reg_alloc_orders[] = {
reg_nonleaf_alloc_order};
void
-order_regs_for_local_alloc ()
+order_regs_for_local_alloc (void)
{
static int last_order_nonleaf = 1;
@@ -6108,9 +6428,7 @@ order_regs_for_local_alloc ()
mem<-->reg splits to be run. */
int
-sparc_splitdi_legitimate (reg, mem)
- rtx reg;
- rtx mem;
+sparc_splitdi_legitimate (rtx reg, rtx mem)
{
/* Punt if we are here by mistake. */
if (! reload_completed)
@@ -6135,8 +6453,7 @@ sparc_splitdi_legitimate (reg, mem)
run after reload. */
int
-sparc_absnegfloat_split_legitimate (x, y)
- rtx x, y;
+sparc_absnegfloat_split_legitimate (rtx x, rtx y)
{
if (GET_CODE (x) != REG)
return 0;
@@ -6153,8 +6470,7 @@ sparc_absnegfloat_split_legitimate (x, y)
Note reg1 and reg2 *must* be hard registers. */
int
-registers_ok_for_ldd_peep (reg1, reg2)
- rtx reg1, reg2;
+registers_ok_for_ldd_peep (rtx reg1, rtx reg2)
{
/* We might have been passed a SUBREG. */
if (GET_CODE (reg1) != REG || GET_CODE (reg2) != REG)
@@ -6202,8 +6518,7 @@ registers_ok_for_ldd_peep (reg1, reg2)
NULL_RTX. */
int
-mems_ok_for_ldd_peep (mem1, mem2, dependent_reg_rtx)
- rtx mem1, mem2, dependent_reg_rtx;
+mems_ok_for_ldd_peep (rtx mem1, rtx mem2, rtx dependent_reg_rtx)
{
rtx addr1, addr2;
unsigned int reg1;
@@ -6277,8 +6592,7 @@ mems_ok_for_ldd_peep (mem1, mem2, dependent_reg_rtx)
ldd and std insns. */
int
-register_ok_for_ldd (reg)
- rtx reg;
+register_ok_for_ldd (rtx reg)
{
/* We might have been passed a SUBREG. */
if (GET_CODE (reg) != REG)
@@ -6295,10 +6609,7 @@ register_ok_for_ldd (reg)
For `%' followed by punctuation, CODE is the punctuation and X is null. */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
switch (code)
{
@@ -6335,6 +6646,10 @@ print_operand (file, x, code)
/* ??? What if offset is too big? Perhaps the caller knows it isn't? */
fprintf (file, "%s+%d", frame_base_name, frame_base_offset);
return;
+ case '&':
+ /* Print some local dynamic TLS name. */
+ assemble_name (file, get_some_local_dynamic_name ());
+ return;
case 'Y':
/* Adjust the operand to take into account a RESTORE operation. */
if (GET_CODE (x) == CONST_INT)
@@ -6583,10 +6898,7 @@ print_operand (file, x, code)
special handling for aligned DI-mode objects. */
static bool
-sparc_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+sparc_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
/* ??? We only output .xword's for symbols and only then in environments
where the assembler can handle them. */
@@ -6641,8 +6953,7 @@ sparc_assemble_integer (x, size, aligned_p)
#endif
unsigned long
-sparc_type_code (type)
- register tree type;
+sparc_type_code (register tree type)
{
register unsigned long qualifiers = 0;
register unsigned shift;
@@ -6766,8 +7077,7 @@ sparc_type_code (type)
Emit enough FLUSH insns to synchronize the data and instruction caches. */
void
-sparc_initialize_trampoline (tramp, fnaddr, cxt)
- rtx tramp, fnaddr, cxt;
+sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
{
/* SPARC 32 bit trampoline:
@@ -6828,8 +7138,7 @@ sparc_initialize_trampoline (tramp, fnaddr, cxt)
we can read the PC without clobbering a register. */
void
-sparc64_initialize_trampoline (tramp, fnaddr, cxt)
- rtx tramp, fnaddr, cxt;
+sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
{
#ifdef TRANSFER_FROM_TRAMPOLINE
emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
@@ -6960,8 +7269,8 @@ struct sparc_frame_info zero_frame_info;
stack pointer. */
unsigned long
-sparc_flat_compute_frame_size (size)
- int size; /* # of var. bytes allocated. */
+sparc_flat_compute_frame_size (int size)
+ /* # of var. bytes allocated. */
{
int regno;
unsigned long total_size; /* # bytes that the entire frame takes up. */
@@ -7079,16 +7388,11 @@ sparc_flat_compute_frame_size (size)
DOUBLEWORD_OP is either "std" for save, "ldd" for restore. */
void
-sparc_flat_save_restore (file, base_reg, offset, gmask, fmask, word_op,
- doubleword_op, base_offset)
- FILE *file;
- const char *base_reg;
- unsigned int offset;
- unsigned long gmask;
- unsigned long fmask;
- const char *word_op;
- const char *doubleword_op;
- unsigned long base_offset;
+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)
{
int regno;
@@ -7183,9 +7487,7 @@ sparc_flat_save_restore (file, base_reg, offset, gmask, fmask, word_op,
/* Set up the stack and frame (if desired) for the function. */
static void
-sparc_flat_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size)
{
const char *sp_str = reg_names[STACK_POINTER_REGNUM];
unsigned long gmask = current_frame_info.gmask;
@@ -7371,9 +7673,7 @@ sparc_flat_function_prologue (file, size)
and regs. */
static void
-sparc_flat_function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size)
{
rtx epilogue_delay = current_function_epilogue_delay_list;
int noepilogue = FALSE;
@@ -7518,7 +7818,7 @@ sparc_flat_function_epilogue (file, size)
or the only register saved is the return register. */
int
-sparc_flat_epilogue_delay_slots ()
+sparc_flat_epilogue_delay_slots (void)
{
if (!current_frame_info.initialized)
(void) sparc_flat_compute_frame_size (get_frame_size ());
@@ -7534,9 +7834,7 @@ sparc_flat_epilogue_delay_slots ()
pointer is OK. */
int
-sparc_flat_eligible_for_epilogue_delay (trial, slot)
- rtx trial;
- int slot ATTRIBUTE_UNUSED;
+sparc_flat_eligible_for_epilogue_delay (rtx trial, int slot ATTRIBUTE_UNUSED)
{
rtx pat = PATTERN (trial);
@@ -7554,11 +7852,7 @@ sparc_flat_eligible_for_epilogue_delay (trial, slot)
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
static int
-supersparc_adjust_cost (insn, link, dep_insn, cost)
- rtx insn;
- rtx link;
- rtx dep_insn;
- int cost;
+supersparc_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
{
enum attr_type insn_type;
@@ -7619,11 +7913,7 @@ supersparc_adjust_cost (insn, link, dep_insn, cost)
}
static int
-hypersparc_adjust_cost (insn, link, dep_insn, cost)
- rtx insn;
- rtx link;
- rtx dep_insn;
- int cost;
+hypersparc_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
{
enum attr_type insn_type, dep_type;
rtx pat = PATTERN(insn);
@@ -7700,11 +7990,7 @@ hypersparc_adjust_cost (insn, link, dep_insn, cost)
}
static int
-sparc_adjust_cost(insn, link, dep, cost)
- rtx insn;
- rtx link;
- rtx dep;
- int cost;
+sparc_adjust_cost(rtx insn, rtx link, rtx dep, int cost)
{
switch (sparc_cpu)
{
@@ -7722,15 +8008,14 @@ sparc_adjust_cost(insn, link, dep, cost)
}
static void
-sparc_sched_init (dump, sched_verbose, max_ready)
- FILE *dump ATTRIBUTE_UNUSED;
- int sched_verbose ATTRIBUTE_UNUSED;
- int max_ready ATTRIBUTE_UNUSED;
+sparc_sched_init (FILE *dump ATTRIBUTE_UNUSED,
+ int sched_verbose ATTRIBUTE_UNUSED,
+ int max_ready ATTRIBUTE_UNUSED)
{
}
static int
-sparc_use_dfa_pipeline_interface ()
+sparc_use_dfa_pipeline_interface (void)
{
if ((1 << sparc_cpu) &
((1 << PROCESSOR_ULTRASPARC) | (1 << PROCESSOR_CYPRESS) |
@@ -7742,7 +8027,7 @@ sparc_use_dfa_pipeline_interface ()
}
static int
-sparc_use_sched_lookahead ()
+sparc_use_sched_lookahead (void)
{
if (sparc_cpu == PROCESSOR_ULTRASPARC
|| sparc_cpu == PROCESSOR_ULTRASPARC3)
@@ -7755,7 +8040,7 @@ sparc_use_sched_lookahead ()
}
static int
-sparc_issue_rate ()
+sparc_issue_rate (void)
{
switch (sparc_cpu)
{
@@ -7776,8 +8061,7 @@ sparc_issue_rate ()
}
static int
-set_extends (insn)
- rtx insn;
+set_extends (rtx insn)
{
register rtx pat = PATTERN (insn);
@@ -7844,9 +8128,7 @@ static GTY(()) rtx sparc_addr_diff_list;
static GTY(()) rtx sparc_addr_list;
void
-sparc_defer_case_vector (lab, vec, diff)
- rtx lab, vec;
- int diff;
+sparc_defer_case_vector (rtx lab, rtx vec, int diff)
{
vec = gen_rtx_EXPR_LIST (VOIDmode, lab, vec);
if (diff)
@@ -7857,8 +8139,7 @@ sparc_defer_case_vector (lab, vec, diff)
}
static void
-sparc_output_addr_vec (vec)
- rtx vec;
+sparc_output_addr_vec (rtx vec)
{
rtx lab = XEXP (vec, 0), body = XEXP (vec, 1);
int idx, vlen = XVECLEN (body, 0);
@@ -7886,8 +8167,7 @@ sparc_output_addr_vec (vec)
}
static void
-sparc_output_addr_diff_vec (vec)
- rtx vec;
+sparc_output_addr_diff_vec (rtx vec)
{
rtx lab = XEXP (vec, 0), body = XEXP (vec, 1);
rtx base = XEXP (XEXP (body, 0), 0);
@@ -7919,7 +8199,7 @@ sparc_output_addr_diff_vec (vec)
}
static void
-sparc_output_deferred_case_vectors ()
+sparc_output_deferred_case_vectors (void)
{
rtx t;
int align;
@@ -7947,8 +8227,7 @@ sparc_output_deferred_case_vectors ()
unknown. Return 1 if the high bits are zero, -1 if the register is
sign extended. */
int
-sparc_check_64 (x, insn)
- rtx x, insn;
+sparc_check_64 (rtx x, rtx insn)
{
/* If a register is set only once it is safe to ignore insns this
code does not know how to handle. The loop will either recognize
@@ -8008,10 +8287,7 @@ sparc_check_64 (x, insn)
/* Returns assembly code to perform a DImode shift using
a 64-bit global or out register on SPARC-V8+. */
char *
-sparc_v8plus_shift (operands, insn, opcode)
- rtx *operands;
- rtx insn;
- const char *opcode;
+sparc_v8plus_shift (rtx *operands, rtx insn, const char *opcode)
{
static char asm_code[60];
@@ -8020,6 +8296,10 @@ sparc_v8plus_shift (operands, insn, opcode)
if (which_alternative != 2)
operands[3] = operands[0];
+ /* We can only shift by constants <= 63. */
+ if (GET_CODE (operands[2]) == CONST_INT)
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
+
if (GET_CODE (operands[1]) == CONST_INT)
{
output_asm_insn ("mov\t%1, %3", operands);
@@ -8044,8 +8324,7 @@ sparc_v8plus_shift (operands, insn, opcode)
for profiling a function entry. */
void
-sparc_profile_hook (labelno)
- int labelno;
+sparc_profile_hook (int labelno)
{
char buf[32];
rtx lab, fun;
@@ -8059,9 +8338,7 @@ sparc_profile_hook (labelno)
#ifdef OBJECT_FORMAT_ELF
static void
-sparc_elf_asm_named_section (name, flags)
- const char *name;
- unsigned int flags;
+sparc_elf_asm_named_section (const char *name, unsigned int flags)
{
if (flags & SECTION_MERGE)
{
@@ -8103,9 +8380,7 @@ sparc_elf_asm_named_section (name, flags)
void) and then nothing else happens. Such a sibling call would look
valid without the added check here. */
static bool
-sparc_function_ok_for_sibcall (decl, exp)
- tree decl;
- tree exp ATTRIBUTE_UNUSED;
+sparc_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
return (decl
&& ! TARGET_FLAT
@@ -8117,10 +8392,7 @@ sparc_function_ok_for_sibcall (decl, exp)
pretending PIC always on), but that's what the old code did. */
static void
-sparc_aout_select_section (t, reloc, align)
- tree t;
- int reloc;
- unsigned HOST_WIDE_INT align;
+sparc_aout_select_section (tree t, int reloc, unsigned HOST_WIDE_INT align)
{
default_select_section (t, reloc | SUNOS4_SHARED_LIBRARIES, align);
}
@@ -8129,10 +8401,8 @@ sparc_aout_select_section (t, reloc, align)
that offers. */
static void
-sparc_aout_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align;
+sparc_aout_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align)
{
if (align <= MAX_TEXT_ALIGN
&& ! (flag_pic && (symbolic_operand (x, mode)
@@ -8143,10 +8413,7 @@ sparc_aout_select_rtx_section (mode, x, align)
}
int
-sparc_extra_constraint_check (op, c, strict)
- rtx op;
- int c;
- int strict;
+sparc_extra_constraint_check (rtx op, int c, int strict)
{
int reload_ok_mem;
@@ -8209,9 +8476,7 @@ sparc_extra_constraint_check (op, c, strict)
??? the latencies and then CSE will just use that. */
static bool
-sparc_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code, *total;
+sparc_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
@@ -8579,12 +8844,10 @@ sparc_rtx_costs (x, code, outer_code, total)
Used for C++ multiple inheritance. */
static void
-sparc_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;
+sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta,
+ HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
+ tree function)
{
rtx this, insn, funexp, delta_rtx, tmp;
@@ -8597,7 +8860,7 @@ sparc_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
/* Find the "this" pointer. Normally in %o0, but in ARCH64 if the function
returns a structure, the structure return pointer is there instead. */
- if (TARGET_ARCH64 && aggregate_value_p (TREE_TYPE (TREE_TYPE (function))))
+ if (TARGET_ARCH64 && aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
this = gen_rtx_REG (Pmode, SPARC_INCOMING_INT_ARG_FIRST + 1);
else
this = gen_rtx_REG (Pmode, SPARC_INCOMING_INT_ARG_FIRST);
@@ -8646,4 +8909,68 @@ sparc_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
no_new_pseudos = 0;
}
+/* How to allocate a 'struct machine_function'. */
+
+static struct machine_function *
+sparc_init_machine_status (void)
+{
+ return ggc_alloc_cleared (sizeof (struct machine_function));
+}
+
+/* Locate some local-dynamic symbol still in use by this function
+ so that we can print its name in local-dynamic base patterns. */
+
+static const char *
+get_some_local_dynamic_name (void)
+{
+ rtx insn;
+
+ if (cfun->machine->some_ld_name)
+ return cfun->machine->some_ld_name;
+
+ for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
+ if (INSN_P (insn)
+ && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0))
+ return cfun->machine->some_ld_name;
+
+ abort ();
+}
+
+static int
+get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
+{
+ rtx x = *px;
+
+ if (x
+ && GET_CODE (x) == SYMBOL_REF
+ && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
+ {
+ cfun->machine->some_ld_name = XSTR (x, 0);
+ return 1;
+ }
+
+ return 0;
+}
+
+/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL.
+ We need to emit DTP-relative relocations. */
+
+void
+sparc_output_dwarf_dtprel (FILE *file, int size, rtx x)
+{
+ switch (size)
+ {
+ case 4:
+ fputs ("\t.word\t%r_tls_dtpoff32(", file);
+ break;
+ case 8:
+ fputs ("\t.xword\t%r_tls_dtpoff64(", file);
+ break;
+ default:
+ abort ();
+ }
+ output_addr_const (file, x);
+ fputs (")", file);
+}
+
#include "gt-sparc.h"
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 9235f66bf53..a997602daff 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2099,27 +2099,18 @@ do { \
When PIC, we do not accept an address that would require a scratch reg
to load into a register. */
-#define CONSTANT_ADDRESS_P(X) \
- (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
- || GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH \
- || (GET_CODE (X) == CONST \
- && ! (flag_pic && pic_address_needs_scratch (X))))
+#define CONSTANT_ADDRESS_P(X) constant_address_p (X)
/* Define this, so that when PIC, reload won't try to reload invalid
addresses which require two reload registers. */
-#define LEGITIMATE_PIC_OPERAND_P(X) (! pic_address_needs_scratch (X))
+#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
/* Nonzero if the constant value X is a legitimate general operand.
Anything can be made to work except floating point constants.
If TARGET_VIS, 0.0 can be made to work as well. */
-#define LEGITIMATE_CONSTANT_P(X) \
- (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode || \
- (TARGET_VIS && \
- (GET_MODE (X) == SFmode || GET_MODE (X) == DFmode || \
- GET_MODE (X) == TFmode) && \
- fp_zero_operand (X, GET_MODE (X))))
+#define LEGITIMATE_CONSTANT_P(X) legitimate_constant_p (X)
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
and check its validity for a certain class.
@@ -2226,110 +2217,19 @@ do { \
#define RTX_OK_FOR_OLO10_P(X) \
(GET_CODE (X) == CONST_INT && INTVAL (X) >= -0x1000 && INTVAL (X) < 0xc00 - 8)
+#ifdef REG_OK_STRICT
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-{ if (RTX_OK_FOR_BASE_P (X)) \
+{ \
+ if (legitimate_address_p (MODE, X, 1)) \
goto ADDR; \
- else if (GET_CODE (X) == PLUS) \
- { \
- register rtx op0 = XEXP (X, 0); \
- register rtx op1 = XEXP (X, 1); \
- if (flag_pic && op0 == pic_offset_table_rtx) \
- { \
- if (RTX_OK_FOR_BASE_P (op1)) \
- goto ADDR; \
- else if (flag_pic == 1 \
- && GET_CODE (op1) != REG \
- && GET_CODE (op1) != LO_SUM \
- && GET_CODE (op1) != MEM \
- && (! SYMBOLIC_CONST (op1) \
- || MODE == Pmode) \
- && (GET_CODE (op1) != CONST_INT \
- || SMALL_INT (op1))) \
- goto ADDR; \
- } \
- else if (RTX_OK_FOR_BASE_P (op0)) \
- { \
- if ((RTX_OK_FOR_INDEX_P (op1) \
- /* We prohibit REG + REG for TFmode when \
- there are no instructions which accept \
- REG+REG instructions. We do this \
- because REG+REG is not an offsetable \
- address. If we get the situation \
- in reload where source and destination \
- of a movtf pattern are both MEMs with \
- REG+REG address, then only one of them \
- gets converted to an offsetable \
- address. */ \
- && (MODE != TFmode \
- || (TARGET_FPU && TARGET_ARCH64 \
- && TARGET_V9 \
- && TARGET_HARD_QUAD)) \
- /* We prohibit REG + REG on ARCH32 if \
- not optimizing for DFmode/DImode \
- because then mem_min_alignment is \
- likely to be zero after reload and the \
- forced split would lack a matching \
- splitter pattern. */ \
- && (TARGET_ARCH64 || optimize \
- || (MODE != DFmode \
- && MODE != DImode))) \
- || RTX_OK_FOR_OFFSET_P (op1)) \
- goto ADDR; \
- } \
- else if (RTX_OK_FOR_BASE_P (op1)) \
- { \
- if ((RTX_OK_FOR_INDEX_P (op0) \
- /* See the previous comment. */ \
- && (MODE != TFmode \
- || (TARGET_FPU && TARGET_ARCH64 \
- && TARGET_V9 \
- && TARGET_HARD_QUAD)) \
- && (TARGET_ARCH64 || optimize \
- || (MODE != DFmode \
- && MODE != DImode))) \
- || RTX_OK_FOR_OFFSET_P (op0)) \
- goto ADDR; \
- } \
- else if (USE_AS_OFFSETABLE_LO10 \
- && GET_CODE (op0) == LO_SUM \
- && TARGET_ARCH64 \
- && ! TARGET_CM_MEDMID \
- && RTX_OK_FOR_OLO10_P (op1)) \
- { \
- register rtx op00 = XEXP (op0, 0); \
- register rtx op01 = XEXP (op0, 1); \
- if (RTX_OK_FOR_BASE_P (op00) \
- && CONSTANT_P (op01)) \
- goto ADDR; \
- } \
- else if (USE_AS_OFFSETABLE_LO10 \
- && GET_CODE (op1) == LO_SUM \
- && TARGET_ARCH64 \
- && ! TARGET_CM_MEDMID \
- && RTX_OK_FOR_OLO10_P (op0)) \
- { \
- register rtx op10 = XEXP (op1, 0); \
- register rtx op11 = XEXP (op1, 1); \
- if (RTX_OK_FOR_BASE_P (op10) \
- && CONSTANT_P (op11)) \
- goto ADDR; \
- } \
- } \
- else if (GET_CODE (X) == LO_SUM) \
- { \
- register rtx op0 = XEXP (X, 0); \
- register rtx op1 = XEXP (X, 1); \
- if (RTX_OK_FOR_BASE_P (op0) \
- && CONSTANT_P (op1) \
- /* We can't allow TFmode, because an offset \
- greater than or equal to the alignment (8) \
- may cause the LO_SUM to overflow if !v9. */\
- && (MODE != TFmode || TARGET_V9)) \
- goto ADDR; \
- } \
- else if (GET_CODE (X) == CONST_INT && SMALL_INT (X)) \
+}
+#else
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+{ \
+ if (legitimate_address_p (MODE, X, 0)) \
goto ADDR; \
}
+#endif
/* Go to LABEL if ADDR (a legitimate address expression)
has an effect that depends on the machine mode it is used for.
@@ -2374,33 +2274,11 @@ do { \
/* On SPARC, change REG+N into REG+REG, and REG+(X*Y) into REG+REG. */
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
-{ rtx sparc_x = (X); \
- if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \
- (X) = gen_rtx_PLUS (Pmode, XEXP (X, 1), \
- force_operand (XEXP (X, 0), NULL_RTX)); \
- if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \
- (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
- force_operand (XEXP (X, 1), NULL_RTX)); \
- if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == PLUS) \
- (X) = gen_rtx_PLUS (Pmode, force_operand (XEXP (X, 0), NULL_RTX),\
- XEXP (X, 1)); \
- if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == PLUS) \
- (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
- force_operand (XEXP (X, 1), NULL_RTX)); \
- if (sparc_x != (X) && memory_address_p (MODE, X)) \
- goto WIN; \
- if (flag_pic) (X) = legitimize_pic_address (X, MODE, 0); \
- else if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \
- (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
- copy_to_mode_reg (Pmode, XEXP (X, 1))); \
- else if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \
- (X) = gen_rtx_PLUS (Pmode, XEXP (X, 1), \
- copy_to_mode_reg (Pmode, XEXP (X, 0))); \
- else if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST \
- || GET_CODE (X) == LABEL_REF) \
- (X) = copy_to_suggested_reg (X, NULL_RTX, Pmode); \
- if (memory_address_p (MODE, X)) \
- goto WIN; }
+{ \
+ (X) = legitimize_address (X, OLDX, MODE); \
+ if (memory_address_p (MODE, X)) \
+ goto WIN; \
+}
/* Try a machine-dependent way of reloading an illegitimate address
operand. If we find one, push the reload and jump to WIN. This
@@ -2845,8 +2723,16 @@ do { \
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
+/* Emit a dtp-relative reference to a TLS variable. */
+
+#ifdef HAVE_AS_TLS
+#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \
+ sparc_output_dwarf_dtprel (FILE, SIZE, X)
+#endif
+
#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
- ((CHAR) == '#' || (CHAR) == '*' || (CHAR) == '^' || (CHAR) == '(' || (CHAR) == '_')
+ ((CHAR) == '#' || (CHAR) == '*' || (CHAR) == '^' \
+ || (CHAR) == '(' || (CHAR) == '_' || (CHAR) == '&')
/* Print operand X (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
@@ -2933,6 +2819,14 @@ do { \
} \
}
+#ifdef HAVE_AS_TLS
+#define TARGET_TLS 1
+#else
+#define TARGET_TLS 0
+#endif
+#define TARGET_SUN_TLS TARGET_TLS
+#define TARGET_GNU_TLS 0
+
/* Define the codes that are matched by predicates in sparc.c. */
#define PREDICATE_CODES \
@@ -2980,7 +2874,11 @@ do { \
{"clobbered_register", {REG}}, \
{"input_operand", {SUBREG, REG, CONST_INT, MEM, CONST}}, \
{"const64_operand", {CONST_INT, CONST_DOUBLE}}, \
-{"const64_high_operand", {CONST_INT, CONST_DOUBLE}},
+{"const64_high_operand", {CONST_INT, CONST_DOUBLE}}, \
+{"tgd_symbolic_operand", {SYMBOL_REF}}, \
+{"tld_symbolic_operand", {SYMBOL_REF}}, \
+{"tie_symbolic_operand", {SYMBOL_REF}}, \
+{"tle_symbolic_operand", {SYMBOL_REF}},
/* The number of Pmode words for the setjmp buffer. */
#define JMP_BUF_SIZE 12
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 07ce71874c6..a987041af81 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -38,6 +38,13 @@
(UNSPEC_EMB_TEXTHI 14)
(UNSPEC_EMB_TEXTULO 15)
(UNSPEC_EMB_SETHM 18)
+
+ (UNSPEC_TLSGD 30)
+ (UNSPEC_TLSLDM 31)
+ (UNSPEC_TLSLDO 32)
+ (UNSPEC_TLSIE 33)
+ (UNSPEC_TLSLE 34)
+ (UNSPEC_TLSLD_BASE 35)
])
(define_constants
@@ -195,6 +202,9 @@
;; Attributes for instruction and branch scheduling
+(define_attr "tls_call_delay" "false,true"
+ (symbol_ref "tls_call_delay (insn)"))
+
(define_attr "in_call_delay" "false,true"
(cond [(eq_attr "type" "uncond_branch,branch,call,sibcall,call_no_delay_slot,multi")
(const_string "false")
@@ -202,7 +212,8 @@
(if_then_else (eq_attr "length" "1")
(const_string "true")
(const_string "false"))]
- (if_then_else (eq_attr "length" "1")
+ (if_then_else (and (eq_attr "length" "1")
+ (eq_attr "tls_call_delay" "true"))
(const_string "true")
(const_string "false"))))
@@ -1681,6 +1692,10 @@
}
}
+ /* Fixup TLS cases. */
+ if (tls_symbolic_operand (operands [1]))
+ operands[1] = legitimize_tls_address (operands[1]);
+
/* Fixup PIC cases. */
if (flag_pic)
{
@@ -1740,6 +1755,10 @@
}
}
+ /* Fixup TLS cases. */
+ if (tls_symbolic_operand (operands [1]))
+ operands[1] = legitimize_tls_address (operands[1]);
+
/* Fixup PIC cases. */
if (flag_pic)
{
@@ -1822,6 +1841,10 @@
}
}
+ /* Fixup TLS cases. */
+ if (tls_symbolic_operand (operands [1]))
+ operands[1] = legitimize_tls_address (operands[1]);
+
/* Fixup PIC cases. */
if (flag_pic)
{
@@ -1998,6 +2021,10 @@
}
}
+ /* Fixup TLS cases. */
+ if (tls_symbolic_operand (operands [1]))
+ operands[1] = legitimize_tls_address (operands[1]);
+
if (flag_pic)
{
if (CONSTANT_P (operands[1])
@@ -6881,6 +6908,8 @@
{
if (operands[2] == const1_rtx)
return "add\t%1, %1, %0";
+ if (GET_CODE (operands[2]) == CONST_INT)
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return "sll\t%1, %2, %0";
}
[(set (attr "type")
@@ -6910,6 +6939,8 @@
{
if (operands[2] == const1_rtx)
return "add\t%1, %1, %0";
+ if (GET_CODE (operands[2]) == CONST_INT)
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
return "sllx\t%1, %2, %0";
}
[(set (attr "type")
@@ -6969,7 +7000,11 @@
(ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "rI")))]
""
- "sra\t%1, %2, %0"
+ {
+ if (GET_CODE (operands[2]) == CONST_INT)
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
+ return "sra\t%1, %2, %0";
+ }
[(set_attr "type" "shift")])
(define_insn "*ashrsi3_extend"
@@ -7016,12 +7051,17 @@
}
})
-(define_insn ""
+(define_insn "*ashrdi3_sp64"
[(set (match_operand:DI 0 "register_operand" "=r")
(ashiftrt:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "rI")))]
"TARGET_ARCH64"
- "srax\t%1, %2, %0"
+
+ {
+ if (GET_CODE (operands[2]) == CONST_INT)
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
+ return "srax\t%1, %2, %0";
+ }
[(set_attr "type" "shift")])
;; XXX
@@ -7040,7 +7080,11 @@
(lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "rI")))]
""
- "srl\t%1, %2, %0"
+ {
+ if (GET_CODE (operands[2]) == CONST_INT)
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
+ return "srl\t%1, %2, %0";
+ }
[(set_attr "type" "shift")])
;; This handles the case where
@@ -7097,12 +7141,16 @@
}
})
-(define_insn ""
+(define_insn "*lshrdi3_sp64"
[(set (match_operand:DI 0 "register_operand" "=r")
(lshiftrt:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "rI")))]
"TARGET_ARCH64"
- "srlx\t%1, %2, %0"
+ {
+ if (GET_CODE (operands[2]) == CONST_INT)
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
+ return "srlx\t%1, %2, %0";
+ }
[(set_attr "type" "shift")])
;; XXX
@@ -8366,3 +8414,566 @@
"TARGET_V9"
"t%C0\t%%xcc, %1"
[(set_attr "type" "trap")])
+
+;; TLS support
+(define_insn "tgd_hi22"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")]
+ UNSPEC_TLSGD)))]
+ "TARGET_TLS"
+ "sethi\\t%%tgd_hi22(%a1), %0")
+
+(define_insn "tgd_lo10"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand 2 "tgd_symbolic_operand" "")]
+ UNSPEC_TLSGD)))]
+ "TARGET_TLS"
+ "add\\t%1, %%tgd_lo10(%a2), %0")
+
+(define_insn "tgd_add32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tgd_symbolic_operand" "")]
+ UNSPEC_TLSGD)))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "add\\t%1, %2, %0, %%tgd_add(%a3)")
+
+(define_insn "tgd_add64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (plus:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tgd_symbolic_operand" "")]
+ UNSPEC_TLSGD)))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "add\\t%1, %2, %0, %%tgd_add(%a3)")
+
+(define_insn "tgd_call32"
+ [(set (match_operand 0 "register_operand" "=r")
+ (call (mem:SI (unspec:SI [(match_operand:SI 1 "symbolic_operand" "s")
+ (match_operand 2 "tgd_symbolic_operand" "")]
+ UNSPEC_TLSGD))
+ (match_operand 3 "" "")))
+ (clobber (reg:SI 15))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "call\t%a1, %%tgd_call(%a2)%#"
+ [(set_attr "type" "call")])
+
+(define_insn "tgd_call64"
+ [(set (match_operand 0 "register_operand" "=r")
+ (call (mem:DI (unspec:DI [(match_operand:DI 1 "symbolic_operand" "s")
+ (match_operand 2 "tgd_symbolic_operand" "")]
+ UNSPEC_TLSGD))
+ (match_operand 3 "" "")))
+ (clobber (reg:DI 15))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "call\t%a1, %%tgd_call(%a2)%#"
+ [(set_attr "type" "call")])
+
+(define_insn "tldm_hi22"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (unspec:SI [(const_int 0)] UNSPEC_TLSLDM)))]
+ "TARGET_TLS"
+ "sethi\\t%%tldm_hi22(%&), %0")
+
+(define_insn "tldm_lo10"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(const_int 0)] UNSPEC_TLSLDM)))]
+ "TARGET_TLS"
+ "add\\t%1, %%tldm_lo10(%&), %0")
+
+(define_insn "tldm_add32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand:SI 2 "register_operand" "r")]
+ UNSPEC_TLSLDM)))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "add\\t%1, %2, %0, %%tldm_add(%&)")
+
+(define_insn "tldm_add64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (plus:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:SI 2 "register_operand" "r")]
+ UNSPEC_TLSLDM)))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "add\\t%1, %2, %0, %%tldm_add(%&)")
+
+(define_insn "tldm_call32"
+ [(set (match_operand 0 "register_operand" "=r")
+ (call (mem:SI (unspec:SI [(match_operand:SI 1 "symbolic_operand" "s")]
+ UNSPEC_TLSLDM))
+ (match_operand 2 "" "")))
+ (clobber (reg:SI 15))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "call\t%a1, %%tldm_call(%&)%#"
+ [(set_attr "type" "call")])
+
+(define_insn "tldm_call64"
+ [(set (match_operand 0 "register_operand" "=r")
+ (call (mem:DI (unspec:DI [(match_operand:DI 1 "symbolic_operand" "s")]
+ UNSPEC_TLSLDM))
+ (match_operand 2 "" "")))
+ (clobber (reg:DI 15))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "call\t%a1, %%tldm_call(%&)%#"
+ [(set_attr "type" "call")])
+
+(define_insn "tldo_hix22"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)))]
+ "TARGET_TLS"
+ "sethi\\t%%tldo_hix22(%a1), %0")
+
+(define_insn "tldo_lox10"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand 2 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)))]
+ "TARGET_TLS"
+ "xor\\t%1, %%tldo_lox10(%a2), %0")
+
+(define_insn "tldo_add32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "add\\t%1, %2, %0, %%tldo_add(%a3)")
+
+(define_insn "tldo_add64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (plus:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "add\\t%1, %2, %0, %%tldo_add(%a3)")
+
+(define_insn "tie_hi22"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")]
+ UNSPEC_TLSIE)))]
+ "TARGET_TLS"
+ "sethi\\t%%tie_hi22(%a1), %0")
+
+(define_insn "tie_lo10"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand 2 "tie_symbolic_operand" "")]
+ UNSPEC_TLSIE)))]
+ "TARGET_TLS"
+ "add\\t%1, %%tie_lo10(%a2), %0")
+
+(define_insn "tie_ld32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tie_symbolic_operand" "")]
+ UNSPEC_TLSIE))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ld\\t[%1 + %2], %0, %%tie_ld(%a3)"
+ [(set_attr "type" "load")])
+
+(define_insn "tie_ld64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec:DI [(match_operand:DI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tie_symbolic_operand" "")]
+ UNSPEC_TLSIE))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldx\\t[%1 + %2], %0, %%tie_ldx(%a3)"
+ [(set_attr "type" "load")])
+
+(define_insn "tie_add32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSIE)))]
+ "TARGET_SUN_TLS && TARGET_ARCH32"
+ "add\\t%1, %2, %0, %%tie_add(%a3)")
+
+(define_insn "tie_add64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (plus:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:DI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSIE)))]
+ "TARGET_SUN_TLS && TARGET_ARCH64"
+ "add\\t%1, %2, %0, %%tie_add(%a3)")
+
+(define_insn "tle_hix22_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (unspec:SI [(match_operand 1 "tle_symbolic_operand" "")]
+ UNSPEC_TLSLE)))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "sethi\\t%%tle_hix22(%a1), %0")
+
+(define_insn "tle_lox10_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand 2 "tle_symbolic_operand" "")]
+ UNSPEC_TLSLE)))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "xor\\t%1, %%tle_lox10(%a2), %0")
+
+(define_insn "tle_hix22_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand 1 "tle_symbolic_operand" "")]
+ UNSPEC_TLSLE)))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "sethi\\t%%tle_hix22(%a1), %0")
+
+(define_insn "tle_lox10_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand 2 "tle_symbolic_operand" "")]
+ UNSPEC_TLSLE)))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "xor\\t%1, %%tle_lox10(%a2), %0")
+
+;; Now patterns combinding 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")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r"))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ldub\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldub1_sp32"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (zero_extend:HI (mem:QI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ldub\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldub2_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (zero_extend:SI (mem:QI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ldub\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsb1_sp32"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (sign_extend:HI (mem:QI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ldsb\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsb2_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (sign_extend:SI (mem:QI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ldsb\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldub_sp64"
+ [(set (match_operand:QI 0 "register_operand" "=r")
+ (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r"))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldub\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldub1_sp64"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (zero_extend:HI (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldub\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldub2_sp64"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (zero_extend:SI (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldub\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldub3_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldub\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsb1_sp64"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (sign_extend:HI (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldsb\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsb2_sp64"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (sign_extend:SI (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldsb\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsb3_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (sign_extend:DI (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldsb\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_lduh_sp32"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mem:HI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r"))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "lduh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_lduh1_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (zero_extend:SI (mem:HI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "lduh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsh1_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (sign_extend:SI (mem:HI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ldsh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_lduh_sp64"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (mem:HI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r"))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "lduh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_lduh1_sp64"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (zero_extend:SI (mem:HI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "lduh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_lduh2_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (mem:HI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "lduh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsh1_sp64"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (sign_extend:SI (mem:HI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldsh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldsh2_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (sign_extend:DI (mem:HI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldsh\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_lduw_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (mem:SI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r"))))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "ld\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")])
+
+(define_insn "*tldo_lduw_sp64"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (mem:SI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r"))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "lduw\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")])
+
+(define_insn "*tldo_lduw1_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (mem:SI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "lduw\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")])
+
+(define_insn "*tldo_ldsw1_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (sign_extend:DI (mem:SI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldsw\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "sload")
+ (set_attr "us3load_type" "3cycle")])
+
+(define_insn "*tldo_ldx_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (mem:DI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r"))))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "ldx\t[%1 + %2], %0, %%tldo_add(%3)"
+ [(set_attr "type" "load")])
+
+(define_insn "*tldo_stb_sp32"
+ [(set (mem:QI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))
+ (match_operand:QI 0 "register_operand" "=r"))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "stb\t%0, [%1 + %2], %%tldo_add(%3)"
+ [(set_attr "type" "store")])
+
+(define_insn "*tldo_stb_sp64"
+ [(set (mem:QI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))
+ (match_operand:QI 0 "register_operand" "=r"))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "stb\t%0, [%1 + %2], %%tldo_add(%3)"
+ [(set_attr "type" "store")])
+
+(define_insn "*tldo_sth_sp32"
+ [(set (mem:HI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))
+ (match_operand:HI 0 "register_operand" "=r"))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "sth\t%0, [%1 + %2], %%tldo_add(%3)"
+ [(set_attr "type" "store")])
+
+(define_insn "*tldo_sth_sp64"
+ [(set (mem:HI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))
+ (match_operand:HI 0 "register_operand" "=r"))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "sth\t%0, [%1 + %2], %%tldo_add(%3)"
+ [(set_attr "type" "store")])
+
+(define_insn "*tldo_stw_sp32"
+ [(set (mem:SI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:SI 1 "register_operand" "r")))
+ (match_operand:SI 0 "register_operand" "=r"))]
+ "TARGET_TLS && TARGET_ARCH32"
+ "st\t%0, [%1 + %2], %%tldo_add(%3)"
+ [(set_attr "type" "store")])
+
+(define_insn "*tldo_stw_sp64"
+ [(set (mem:SI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))
+ (match_operand:SI 0 "register_operand" "=r"))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "stw\t%0, [%1 + %2], %%tldo_add(%3)"
+ [(set_attr "type" "store")])
+
+(define_insn "*tldo_stx_sp64"
+ [(set (mem:DI (plus:DI (unspec:DI [(match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "tld_symbolic_operand" "")]
+ UNSPEC_TLSLDO)
+ (match_operand:DI 1 "register_operand" "r")))
+ (match_operand:DI 0 "register_operand" "=r"))]
+ "TARGET_TLS && TARGET_ARCH64"
+ "stx\t%0, [%1 + %2], %%tldo_add(%3)"
+ [(set_attr "type" "store")])
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 8ce526f90d2..d493b7ce797 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1562,7 +1562,7 @@ xstormy16_asm_output_mi_thunk (file, thunk_fndecl, delta,
int regnum = FIRST_ARGUMENT_REGISTER;
/* There might be a hidden first argument for a returned structure. */
- if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function))))
+ if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
regnum += 1;
fprintf (file, "\tadd %s,#0x%x\n", reg_names[regnum], (int) delta & 0xFFFF);
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index c6d1596a4d9..3d1ab50756f 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -540,11 +540,7 @@ enum reg_class
The obvious choice would be `float'--but that won't work with traditional C
compilers that expect all arguments declared as `float' to arrive as
`double'. To avoid this conversion, the library routines ask for the value
- as some other type and then treat it as a `float'.
-
- On some systems, no other type will work for this. For these systems, you
- must use `LIBGCC_NEEDS_DOUBLE' instead, to force conversion of the values
- `double' before they are passed. */
+ as some other type and then treat it as a `float'. */
/* #define FLOAT_ARG_TYPE */
/* Define this macro to override the way library routines redesignate a `float'
diff --git a/gcc/config/v850/t-v850 b/gcc/config/v850/t-v850
index 75c3b4695bd..4890ee3a9ff 100644
--- a/gcc/config/v850/t-v850
+++ b/gcc/config/v850/t-v850
@@ -81,12 +81,17 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
# Create target-specific versions of the libraries
-MULTILIB_OPTIONS = mv850/mv850e
-MULTILIB_DIRNAMES = v850 v850e
+MULTILIB_OPTIONS = mv850e
+MULTILIB_DIRNAMES = v850e
INSTALL_LIBGCC = install-multilib
+MULTILIB_MATCHES = mv850e=mv850e1
TCFLAGS = -mno-app-regs -msmall-sld -Wa,-mwarn-signed-overflow -Wa,-mwarn-unsigned-overflow
v850-c.o: $(srcdir)/config/v850/v850-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/v850/v850-c.c
+
+# Local Variables:
+# mode: Makefile
+# End:
diff --git a/gcc/config/v850/t-v850e b/gcc/config/v850/t-v850e
new file mode 100644
index 00000000000..97724e58109
--- /dev/null
+++ b/gcc/config/v850/t-v850e
@@ -0,0 +1,96 @@
+LIB1ASMSRC = v850/lib1funcs.asm
+LIB1ASMFUNCS = _mulsi3 \
+ _divsi3 \
+ _udivsi3 \
+ _modsi3 \
+ _umodsi3 \
+ _save_2 \
+ _save_20 \
+ _save_21 \
+ _save_22 \
+ _save_23 \
+ _save_24 \
+ _save_25 \
+ _save_26 \
+ _save_27 \
+ _save_28 \
+ _save_29 \
+ _save_2c \
+ _save_20c \
+ _save_21c \
+ _save_22c \
+ _save_23c \
+ _save_24c \
+ _save_25c \
+ _save_26c \
+ _save_27c \
+ _save_28c \
+ _save_29c \
+ _save_31c \
+ _save_varargs \
+ _save_interrupt \
+ _save_all_interrupt \
+ _callt_save_20 \
+ _callt_save_21 \
+ _callt_save_22 \
+ _callt_save_23 \
+ _callt_save_24 \
+ _callt_save_25 \
+ _callt_save_26 \
+ _callt_save_27 \
+ _callt_save_28 \
+ _callt_save_29 \
+ _callt_save_20c \
+ _callt_save_21c \
+ _callt_save_22c \
+ _callt_save_23c \
+ _callt_save_24c \
+ _callt_save_25c \
+ _callt_save_26c \
+ _callt_save_27c \
+ _callt_save_28c \
+ _callt_save_29c \
+ _callt_save_31c \
+ _callt_save_varargs \
+ _callt_save_interrupt \
+ _callt_save_all_interrupt \
+ _callt_save_r2_r29 \
+ _callt_save_r2_r31 \
+ _callt_save_r6_r9 \
+ _negdi2 \
+ _cmpdi2 \
+ _ucmpdi2 \
+ _muldi3
+
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
+ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
+ echo '#endif' >> dp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
+ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
+ echo '#endif' >> fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+# Create target-specific versions of the libraries
+MULTILIB_OPTIONS = mv850
+MULTILIB_DIRNAMES = v850
+INSTALL_LIBGCC = install-multilib
+
+TCFLAGS = -mno-app-regs -msmall-sld -Wa,-mwarn-signed-overflow -Wa,-mwarn-unsigned-overflow
+
+v850-c.o: $(srcdir)/config/v850/v850-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/v850/v850-c.c
+
+# Local Variables:
+# mode: Makefile
+# End:
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 4db79a99d3b..3c40da1815c 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2257,8 +2257,8 @@ v850_handle_data_area_attribute (node, name, args, flags, no_add_attrs)
case VAR_DECL:
if (current_function_decl != NULL_TREE)
{
- error_with_decl (decl, "\
-a data area attribute cannot be specified for local variables");
+ error ("%Jdata area attributes cannot be specified for "
+ "local variables", decl, decl);
*no_add_attrs = true;
}
@@ -2268,8 +2268,8 @@ a data area attribute cannot be specified for local variables");
area = v850_get_data_area (decl);
if (area != DATA_AREA_NORMAL && data_area != area)
{
- error_with_decl (decl, "\
-data area of '%s' conflicts with previous declaration");
+ error ("%Jdata area of '%D' conflicts with previous declaration",
+ decl, decl);
*no_add_attrs = true;
}
break;
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 52e631334e5..7ebf12d6693 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -32,6 +32,7 @@
#define TARGET_CPU_generic 1
#define TARGET_CPU_v850e 2
+#define TARGET_CPU_v850e1 3
#ifndef TARGET_CPU_DEFAULT
#define TARGET_CPU_DEFAULT TARGET_CPU_generic
@@ -56,6 +57,17 @@
#define TARGET_VERSION fprintf (stderr, " (NEC V850E)");
#endif
+#if TARGET_CPU_DEFAULT == TARGET_CPU_v850e1
+#undef MASK_DEFAULT
+#define MASK_DEFAULT MASK_V850E /* No practical difference. */
+#undef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC "%{!mv*:-mv850e1}"
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "%{!mv*:-D__v850e1__} %{mv850e1:-D__v850e1__}"
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (NEC V850E1)");
+#endif
+
#define ASM_SPEC "%{mv*:-mv%*}"
#define CPP_SPEC "%{mv850e:-D__v850e__} %{mv850:-D__v850__} %(subtarget_cpp_spec)"
@@ -176,6 +188,8 @@ extern int target_flags;
{ "v850", MASK_V850, \
N_("Compile for the v850 processor") }, \
{ "v850", -(MASK_V850 ^ MASK_CPU), "" }, \
+ { "v850e1", MASK_V850E, N_("Compile for v850e1 processor") }, \
+ { "v850e1", -(MASK_V850E ^ MASK_CPU), "" }, /* Make sure that the other bits are cleared. */ \
{ "v850e", MASK_V850E, N_("Compile for v850e processor") }, \
{ "v850e", -(MASK_V850E ^ MASK_CPU), "" }, /* Make sure that the other bits are cleared. */ \
{ "small-sld", MASK_SMALL_SLD, N_("Enable the use of the short load instructions") }, \
diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h
index 199db19af55..978083b48c5 100644
--- a/gcc/config/vax/vax-protos.h
+++ b/gcc/config/vax/vax-protos.h
@@ -18,16 +18,16 @@ 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 override_options PARAMS ((void));
+extern void override_options (void);
#ifdef RTX_CODE
-extern const char *rev_cond_name PARAMS ((rtx));
-extern void split_quadword_operands PARAMS ((rtx *, rtx *, int));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern int vax_float_literal PARAMS ((rtx));
+extern const char *rev_cond_name (rtx);
+extern void split_quadword_operands (rtx *, rtx *, int);
+extern void print_operand_address (FILE *, rtx);
+extern int vax_float_literal (rtx);
#endif /* RTX_CODE */
#ifdef REAL_VALUE_TYPE
-extern int check_float_value PARAMS ((enum machine_mode, REAL_VALUE_TYPE *, int));
+extern int check_float_value (enum machine_mode, REAL_VALUE_TYPE *, int);
#endif /* REAL_VALUE_TYPE */
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 1b94beef01d..ad40e982fec 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -41,14 +41,14 @@ Boston, MA 02111-1307, USA. */
#include "target.h"
#include "target-def.h"
-static void vax_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void vax_file_start PARAMS ((void));
-static void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
-static int vax_address_cost_1 PARAMS ((rtx));
-static int vax_address_cost PARAMS ((rtx));
-static int vax_rtx_costs_1 PARAMS ((rtx, enum rtx_code, enum rtx_code));
-static bool vax_rtx_costs PARAMS ((rtx, int, int, int *));
+static void vax_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void vax_file_start (void);
+static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree);
+static int vax_address_cost_1 (rtx);
+static int vax_address_cost (rtx);
+static int vax_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code);
+static bool vax_rtx_costs (rtx, int, int, int *);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -77,7 +77,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
/* Set global variables as needed for the options enabled. */
void
-override_options ()
+override_options (void)
{
/* We're VAX floating point, not IEEE floating point. */
memset (real_format_for_mode, 0, sizeof real_format_for_mode);
@@ -96,9 +96,7 @@ override_options ()
which registers should not be saved even if used. */
static void
-vax_output_function_prologue (file, size)
- FILE * file;
- HOST_WIDE_INT size;
+vax_output_function_prologue (FILE * file, HOST_WIDE_INT size)
{
register int regno;
register int mask = 0;
@@ -135,7 +133,7 @@ vax_output_function_prologue (file, size)
so that gas can distinguish between D_float and G_float prior to
processing the .stabs directive identifying type double. */
static void
-vax_file_start ()
+vax_file_start (void)
{
default_file_start ();
@@ -146,9 +144,7 @@ vax_file_start ()
/* This is like nonimmediate_operand with a restriction on the type of MEM. */
void
-split_quadword_operands (operands, low, n)
- rtx *operands, *low;
- int n ATTRIBUTE_UNUSED;
+split_quadword_operands (rtx * operands, rtx * low, int n ATTRIBUTE_UNUSED)
{
int i;
/* Split operands. */
@@ -178,9 +174,7 @@ split_quadword_operands (operands, low, n)
}
void
-print_operand_address (file, addr)
- FILE *file;
- register rtx addr;
+print_operand_address (FILE * file, register rtx addr)
{
register rtx reg1, breg, ireg;
rtx offset;
@@ -361,8 +355,7 @@ print_operand_address (file, addr)
}
const char *
-rev_cond_name (op)
- rtx op;
+rev_cond_name (rtx op)
{
switch (GET_CODE (op))
{
@@ -393,8 +386,7 @@ rev_cond_name (op)
}
int
-vax_float_literal(c)
- register rtx c;
+vax_float_literal(register rtx c)
{
register enum machine_mode mode;
REAL_VALUE_TYPE r, s;
@@ -440,8 +432,7 @@ vax_float_literal(c)
static int
-vax_address_cost_1 (addr)
- register rtx addr;
+vax_address_cost_1 (register rtx addr)
{
int reg = 0, indexed = 0, indir = 0, offset = 0, predec = 0;
rtx plus_op0 = 0, plus_op1 = 0;
@@ -509,8 +500,7 @@ vax_address_cost_1 (addr)
}
static int
-vax_address_cost (x)
- rtx x;
+vax_address_cost (rtx x)
{
return (1 + (GET_CODE (x) == REG ? 0 : vax_address_cost_1 (x)));
}
@@ -520,9 +510,7 @@ vax_address_cost (x)
other models. */
static int
-vax_rtx_costs_1 (x, code, outer_code)
- register rtx x;
- enum rtx_code code, outer_code;
+vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code)
{
enum machine_mode mode = GET_MODE (x);
register int c;
@@ -745,10 +733,7 @@ vax_rtx_costs_1 (x, code, outer_code)
}
static bool
-vax_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+vax_rtx_costs (rtx x, int code, int outer_code, int * total)
{
*total = vax_rtx_costs_1 (x, code, outer_code);
return true;
@@ -762,12 +747,11 @@ vax_rtx_costs (x, code, outer_code, total)
*/
static void
-vax_output_mi_thunk (file, thunk, delta, vcall_offset, function)
- FILE *file;
- tree thunk ATTRIBUTE_UNUSED;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED;
- tree function;
+vax_output_mi_thunk (FILE * file,
+ tree thunk ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta,
+ HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
+ tree function)
{
fprintf (file, "\t.word 0x0ffc\n\taddl2 $" HOST_WIDE_INT_PRINT_DEC, delta);
asm_fprintf (file, ",4(%Rap)\n");
diff --git a/gcc/config/xtensa/crti.asm b/gcc/config/xtensa/crti.asm
index 8019ed1c3db..8e5cbe23fbd 100644
--- a/gcc/config/xtensa/crti.asm
+++ b/gcc/config/xtensa/crti.asm
@@ -29,16 +29,28 @@
# .init sections. Users may put any desired instructions in those
# sections.
+#include "xtensa-config.h"
+
.section .init
.globl _init
.type _init,@function
.align 4
_init:
- entry sp, 40
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
+ entry sp, 64
+#else
+ addi sp, sp, -32
+ s32i a0, sp, 0
+#endif
.section .fini
.globl _fini
.type _fini,@function
.align 4
_fini:
- entry sp, 40
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
+ entry sp, 64
+#else
+ addi sp, sp, -32
+ s32i a0, sp, 0
+#endif
diff --git a/gcc/config/xtensa/crtn.asm b/gcc/config/xtensa/crtn.asm
index b4bdad93fe4..9ccf2e61ab0 100644
--- a/gcc/config/xtensa/crtn.asm
+++ b/gcc/config/xtensa/crtn.asm
@@ -29,8 +29,22 @@
# fact return. Users may put any desired instructions in those sections.
# This file is the last thing linked into any executable.
+#include "xtensa-config.h"
+
.section .init
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
retw
+#else
+ l32i a0, sp, 0
+ addi sp, sp, 32
+ ret
+#endif
.section .fini
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
retw
+#else
+ l32i a0, sp, 0
+ addi sp, sp, 32
+ ret
+#endif
diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
index 65b0f6eb337..849be87edb0 100644
--- a/gcc/config/xtensa/elf.h
+++ b/gcc/config/xtensa/elf.h
@@ -43,13 +43,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define WCHAR_TYPE_SIZE 16
#undef ASM_SPEC
-#define ASM_SPEC "%{v} %{mno-density:--no-density} \
- %{mtext-section-literals:--text-section-literals} \
- %{mno-text-section-literals:--no-text-section-literals} \
- %{mtarget-align:--target-align} \
- %{mno-target-align:--no-target-align} \
- %{mlongcalls:--longcalls} \
- %{mno-longcalls:--no-longcalls}"
+#define ASM_SPEC \
+ "%{v} \
+ %{mtext-section-literals:--text-section-literals} \
+ %{mno-text-section-literals:--no-text-section-literals} \
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls}"
#undef LIB_SPEC
#define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
diff --git a/gcc/config/xtensa/lib1funcs.asm b/gcc/config/xtensa/lib1funcs.asm
index 72cd958841b..2df00218a5a 100644
--- a/gcc/config/xtensa/lib1funcs.asm
+++ b/gcc/config/xtensa/lib1funcs.asm
@@ -30,8 +30,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "xtensa-config.h"
- # Define macros for the ABS and ADDX* instructions to handle cases
- # where they are not included in the Xtensa processor configuration.
+# Note: These functions use a minimum stack frame size of 32. This is
+# necessary for Xtensa configurations that only support a fixed register
+# window size of 8, where even leaf functions (such as these) need to
+# allocate space for a 4-word "extra save area".
+
+# Define macros for the ABS and ADDX* instructions to handle cases
+# where they are not included in the Xtensa processor configuration.
.macro do_abs dst, src, tmp
#if XCHAL_HAVE_ABS
@@ -70,19 +75,41 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
.endm
+# Define macros for function entry and return, supporting either the
+# standard register windowed ABI or the non-windowed call0 ABI. These
+# macros do not allocate any extra stack space, so they only work for
+# leaf functions that do not need to spill anything to the stack.
+
+ .macro abi_entry reg, size
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
+ entry \reg, \size
+#else
+ /* do nothing */
+#endif
+ .endm
+
+ .macro abi_return
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
+ retw
+#else
+ ret
+#endif
+ .endm
+
+
#ifdef L_mulsi3
.align 4
.global __mulsi3
.type __mulsi3,@function
__mulsi3:
- entry sp, 16
+ abi_entry sp, 32
#if XCHAL_HAVE_MUL16
or a4, a2, a3
srai a4, a4, 16
bnez a4, .LMUL16
mul16u a2, a2, a3
- retw
+ abi_return
.LMUL16:
srai a4, a2, 16
srai a5, a3, 16
@@ -138,7 +165,7 @@ __mulsi3:
bgeui a3, 16, .Lmult_main_loop
neg a3, a2
movltz a2, a3, a5
- retw
+ abi_return
.align 4
.Lmult_main_loop:
@@ -168,17 +195,17 @@ __mulsi3:
#endif /* !XCHAL_HAVE_MUL16 && !XCHAL_HAVE_MAC16 */
- retw
+ abi_return
.size __mulsi3,.-__mulsi3
#endif /* L_mulsi3 */
- # Define a macro for the NSAU (unsigned normalize shift amount)
- # instruction, which computes the number of leading zero bits,
- # to handle cases where it is not included in the Xtensa processor
- # configuration.
-
+# Define a macro for the NSAU (unsigned normalize shift amount)
+# instruction, which computes the number of leading zero bits,
+# to handle cases where it is not included in the Xtensa processor
+# configuration.
+
.macro do_nsau cnt, val, tmp, a
#if XCHAL_HAVE_NSA
nsau \cnt, \val
@@ -237,7 +264,7 @@ __nsau_data:
.global __udivsi3
.type __udivsi3,@function
__udivsi3:
- entry sp, 16
+ abi_entry sp, 32
bltui a3, 2, .Lle_one # check if the divisor <= 1
mov a6, a2 # keep dividend in a6
@@ -270,7 +297,7 @@ __udivsi3:
bltu a6, a3, .Lreturn
addi a2, a2, 1 # increment quotient if dividend >= divisor
.Lreturn:
- retw
+ abi_return
.Lspecial:
# return dividend >= divisor
@@ -278,14 +305,14 @@ __udivsi3:
bltu a6, a3, .Lreturn2
movi a2, 1
.Lreturn2:
- retw
+ abi_return
.Lle_one:
beqz a3, .Lerror # if divisor == 1, return the dividend
- retw
+ abi_return
.Lerror:
movi a2, 0 # just return 0; could throw an exception
- retw
+ abi_return
.size __udivsi3,.-__udivsi3
#endif /* L_udivsi3 */
@@ -296,7 +323,7 @@ __udivsi3:
.global __divsi3
.type __divsi3,@function
__divsi3:
- entry sp, 16
+ abi_entry sp, 32
xor a7, a2, a3 # sign = dividend ^ divisor
do_abs a6, a2, a4 # udividend = abs(dividend)
do_abs a3, a3, a4 # udivisor = abs(divisor)
@@ -332,7 +359,7 @@ __divsi3:
.Lreturn:
neg a5, a2
movltz a2, a5, a7 # return (sign < 0) ? -quotient : quotient
- retw
+ abi_return
.Lspecial:
movi a2, 0
@@ -341,16 +368,16 @@ __divsi3:
movi a4, -1
movltz a2, a4, a7 # else return (sign < 0) ? -1 : 1
.Lreturn2:
- retw
+ abi_return
.Lle_one:
beqz a3, .Lerror
neg a2, a6 # if udivisor == 1, then return...
movgez a2, a6, a7 # (sign < 0) ? -udividend : udividend
- retw
+ abi_return
.Lerror:
movi a2, 0 # just return 0; could throw an exception
- retw
+ abi_return
.size __divsi3,.-__divsi3
#endif /* L_divsi3 */
@@ -361,7 +388,7 @@ __divsi3:
.global __umodsi3
.type __umodsi3,@function
__umodsi3:
- entry sp, 16
+ abi_entry sp, 32
bltui a3, 2, .Lle_one # check if the divisor is <= 1
do_nsau a5, a2, a6, a7 # dividend_shift = nsau(dividend)
@@ -390,19 +417,19 @@ __umodsi3:
bltu a2, a3, .Lreturn
sub a2, a2, a3 # subtract once more if dividend >= divisor
.Lreturn:
- retw
+ abi_return
.Lspecial:
bltu a2, a3, .Lreturn2
sub a2, a2, a3 # subtract once if dividend >= divisor
.Lreturn2:
- retw
+ abi_return
.Lle_one:
# the divisor is either 0 or 1, so just return 0.
# someday we may want to throw an exception if the divisor is 0.
movi a2, 0
- retw
+ abi_return
.size __umodsi3,.-__umodsi3
#endif /* L_umodsi3 */
@@ -413,7 +440,7 @@ __umodsi3:
.global __modsi3
.type __modsi3,@function
__modsi3:
- entry sp, 16
+ abi_entry sp, 32
mov a7, a2 # save original (signed) dividend
do_abs a2, a2, a4 # udividend = abs(dividend)
do_abs a3, a3, a4 # udivisor = abs(divisor)
@@ -447,7 +474,7 @@ __modsi3:
bgez a7, .Lpositive
neg a2, a2 # if (dividend < 0), return -udividend
.Lpositive:
- retw
+ abi_return
.Lspecial:
bltu a2, a3, .Lreturn2
@@ -456,13 +483,13 @@ __modsi3:
bgez a7, .Lpositive2
neg a2, a2 # if (dividend < 0), return -udividend
.Lpositive2:
- retw
+ abi_return
.Lle_one:
# udivisor is either 0 or 1, so just return 0.
# someday we may want to throw an exception if udivisor is 0.
movi a2, 0
- retw
+ abi_return
.size __modsi3,.-__modsi3
#endif /* L_modsi3 */
diff --git a/gcc/config/xtensa/lib2funcs.S b/gcc/config/xtensa/lib2funcs.S
index d06e1222ae8..80f5f0bcb48 100644
--- a/gcc/config/xtensa/lib2funcs.S
+++ b/gcc/config/xtensa/lib2funcs.S
@@ -150,7 +150,7 @@ __xtensa_nonlocal_goto:
be touched by the trampoline. An ISYNC instruction is also needed to
make sure that the modified instructions are loaded into the instruction
fetch buffer. */
-
+
#define TRAMPOLINE_SIZE 59
.text
diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
index d8b230f2337..ef5aae04f63 100644
--- a/gcc/config/xtensa/linux.h
+++ b/gcc/config/xtensa/linux.h
@@ -40,13 +40,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define WCHAR_TYPE_SIZE 32
#undef ASM_SPEC
-#define ASM_SPEC "%{v} %{mno-density:--no-density} \
- %{mtext-section-literals:--text-section-literals} \
- %{mno-text-section-literals:--no-text-section-literals} \
- %{mtarget-align:--target-align} \
- %{mno-target-align:--no-target-align} \
- %{mlongcalls:--longcalls} \
- %{mno-longcalls:--no-longcalls}"
+#define ASM_SPEC \
+ "%{v} \
+ %{mtext-section-literals:--text-section-literals} \
+ %{mno-text-section-literals:--no-text-section-literals} \
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls}"
#undef LINK_SPEC
#define LINK_SPEC \
diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa
index 5597650273a..d39f7fe0e0f 100644
--- a/gcc/config/xtensa/t-xtensa
+++ b/gcc/config/xtensa/t-xtensa
@@ -17,11 +17,11 @@ LIB1ASMFUNCS = _mulsi3 _nsau _divsi3 _modsi3 _udivsi3 _umodsi3
LIB2FUNCS_EXTRA += $(srcdir)/config/xtensa/lib2funcs.S
$(T)crti.o: $(srcdir)/config/xtensa/crti.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o \
- -x assembler-with-cpp $(srcdir)/config/xtensa/crti.asm
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/xtensa/crti.asm
$(T)crtn.o: $(srcdir)/config/xtensa/crtn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o \
- -x assembler-with-cpp $(srcdir)/config/xtensa/crtn.asm
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/xtensa/crtn.asm
$(out_object_file): gt-xtensa.h
gt-xtensa.h : s-gtype ; @true
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 3c382d96ca5..32d5030c239 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -200,7 +200,7 @@ static struct machine_function * xtensa_init_machine_status PARAMS ((void));
static void printx PARAMS ((FILE *, signed int));
static void xtensa_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static unsigned int xtensa_multibss_section_type_flags
- PARAMS ((tree, const char *, int));
+ PARAMS ((tree, const char *, int)) ATTRIBUTE_UNUSED;
static void xtensa_select_rtx_section
PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT));
static bool xtensa_rtx_costs PARAMS ((rtx, int, int, int *));
@@ -581,8 +581,37 @@ call_insn_operand (op, mode)
if (CONSTANT_ADDRESS_P (op))
{
/* Direct calls only allowed to static functions with PIC. */
- return (!flag_pic
- || (GET_CODE (op) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (op)));
+ if (flag_pic)
+ {
+ tree callee, callee_sec, caller_sec;
+
+ if (GET_CODE (op) != SYMBOL_REF || !SYMBOL_REF_LOCAL_P (op))
+ return FALSE;
+
+ /* Don't attempt a direct call if the callee is known to be in
+ a different section, since there's a good chance it will be
+ out of range. */
+
+ if (flag_function_sections
+ || DECL_ONE_ONLY (current_function_decl))
+ return FALSE;
+ caller_sec = DECL_SECTION_NAME (current_function_decl);
+ callee = SYMBOL_REF_DECL (op);
+ if (callee)
+ {
+ if (DECL_ONE_ONLY (callee))
+ return FALSE;
+ callee_sec = DECL_SECTION_NAME (callee);
+ if (((caller_sec == NULL_TREE) ^ (callee_sec == NULL_TREE))
+ || (caller_sec != NULL_TREE
+ && strcmp (TREE_STRING_POINTER (caller_sec),
+ TREE_STRING_POINTER (callee_sec)) != 0))
+ return FALSE;
+ }
+ else if (caller_sec != NULL_TREE)
+ return FALSE;
+ }
+ return TRUE;
}
return FALSE;
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 5f5e112cd85..621dd5fbbb6 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -42,148 +42,43 @@ extern struct rtx_def * branch_cmp[2]; /* operands for compare */
extern enum cmp_type branch_type; /* what type of branch to use */
extern unsigned xtensa_current_frame_size;
-/* Run-time compilation parameters selecting different hardware subsets. */
-
-#define MASK_BIG_ENDIAN 0x00000001 /* big or little endian */
-#define MASK_DENSITY 0x00000002 /* code density option */
-#define MASK_MAC16 0x00000004 /* MAC16 option */
-#define MASK_MUL16 0x00000008 /* 16-bit integer multiply */
-#define MASK_MUL32 0x00000010 /* integer multiply/divide */
-#define MASK_DIV32 0x00000020 /* integer multiply/divide */
-#define MASK_NSA 0x00000040 /* nsa instruction option */
-#define MASK_MINMAX 0x00000080 /* min/max instructions */
-#define MASK_SEXT 0x00000100 /* sign extend insn option */
-#define MASK_BOOLEANS 0x00000200 /* boolean register option */
-#define MASK_HARD_FLOAT 0x00000400 /* floating-point option */
-#define MASK_HARD_FLOAT_DIV 0x00000800 /* floating-point divide */
-#define MASK_HARD_FLOAT_RECIP 0x00001000 /* floating-point reciprocal */
-#define MASK_HARD_FLOAT_SQRT 0x00002000 /* floating-point sqrt */
-#define MASK_HARD_FLOAT_RSQRT 0x00004000 /* floating-point recip sqrt */
-#define MASK_NO_FUSED_MADD 0x00008000 /* avoid f-p mul/add */
-#define MASK_CONST16 0x00010000 /* use CONST16 instruction */
-#define MASK_ABS 0x00020000 /* use ABS instruction */
-#define MASK_ADDX 0x00040000 /* use ADDX* and SUBX* */
-
-/* Macros used in the machine description to test the flags. */
-
-#define TARGET_BIG_ENDIAN (target_flags & MASK_BIG_ENDIAN)
-#define TARGET_DENSITY (target_flags & MASK_DENSITY)
-#define TARGET_MAC16 (target_flags & MASK_MAC16)
-#define TARGET_MUL16 (target_flags & MASK_MUL16)
-#define TARGET_MUL32 (target_flags & MASK_MUL32)
-#define TARGET_DIV32 (target_flags & MASK_DIV32)
-#define TARGET_NSA (target_flags & MASK_NSA)
-#define TARGET_MINMAX (target_flags & MASK_MINMAX)
-#define TARGET_SEXT (target_flags & MASK_SEXT)
-#define TARGET_BOOLEANS (target_flags & MASK_BOOLEANS)
-#define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT)
-#define TARGET_HARD_FLOAT_DIV (target_flags & MASK_HARD_FLOAT_DIV)
-#define TARGET_HARD_FLOAT_RECIP (target_flags & MASK_HARD_FLOAT_RECIP)
-#define TARGET_HARD_FLOAT_SQRT (target_flags & MASK_HARD_FLOAT_SQRT)
-#define TARGET_HARD_FLOAT_RSQRT (target_flags & MASK_HARD_FLOAT_RSQRT)
+/* Masks for the -m switches */
+#define MASK_NO_FUSED_MADD 0x00000001 /* avoid f-p mul/add */
+#define MASK_CONST16 0x00000002 /* use CONST16 instruction */
+
+/* Macros used in the machine description to select various Xtensa
+ configuration options. */
+#define TARGET_BIG_ENDIAN XCHAL_HAVE_BE
+#define TARGET_DENSITY XCHAL_HAVE_DENSITY
+#define TARGET_MAC16 XCHAL_HAVE_MAC16
+#define TARGET_MUL16 XCHAL_HAVE_MUL16
+#define TARGET_MUL32 XCHAL_HAVE_MUL32
+#define TARGET_DIV32 XCHAL_HAVE_DIV32
+#define TARGET_NSA XCHAL_HAVE_NSA
+#define TARGET_MINMAX XCHAL_HAVE_MINMAX
+#define TARGET_SEXT XCHAL_HAVE_SEXT
+#define TARGET_BOOLEANS XCHAL_HAVE_BOOLEANS
+#define TARGET_HARD_FLOAT XCHAL_HAVE_FP
+#define TARGET_HARD_FLOAT_DIV XCHAL_HAVE_FP_DIV
+#define TARGET_HARD_FLOAT_RECIP XCHAL_HAVE_FP_RECIP
+#define TARGET_HARD_FLOAT_SQRT XCHAL_HAVE_FP_SQRT
+#define TARGET_HARD_FLOAT_RSQRT XCHAL_HAVE_FP_RSQRT
+#define TARGET_ABS XCHAL_HAVE_ABS
+#define TARGET_ADDX XCHAL_HAVE_ADDX
+
+/* Macros controlled by command-line options. */
#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD)
#define TARGET_CONST16 (target_flags & MASK_CONST16)
-#define TARGET_ABS (target_flags & MASK_ABS)
-#define TARGET_ADDX (target_flags & MASK_ADDX)
-
-/* Default target_flags if no switches are specified */
#define TARGET_DEFAULT ( \
- (XCHAL_HAVE_BE ? MASK_BIG_ENDIAN : 0) | \
- (XCHAL_HAVE_DENSITY ? MASK_DENSITY : 0) | \
- (XCHAL_HAVE_L32R ? 0 : MASK_CONST16) | \
- (XCHAL_HAVE_ABS ? MASK_ABS : 0) | \
- (XCHAL_HAVE_ADDX ? MASK_ADDX : 0) | \
- (XCHAL_HAVE_MAC16 ? MASK_MAC16 : 0) | \
- (XCHAL_HAVE_MUL16 ? MASK_MUL16 : 0) | \
- (XCHAL_HAVE_MUL32 ? MASK_MUL32 : 0) | \
- (XCHAL_HAVE_DIV32 ? MASK_DIV32 : 0) | \
- (XCHAL_HAVE_NSA ? MASK_NSA : 0) | \
- (XCHAL_HAVE_MINMAX ? MASK_MINMAX : 0) | \
- (XCHAL_HAVE_SEXT ? MASK_SEXT : 0) | \
- (XCHAL_HAVE_BOOLEANS ? MASK_BOOLEANS : 0) | \
- (XCHAL_HAVE_FP ? MASK_HARD_FLOAT : 0) | \
- (XCHAL_HAVE_FP_DIV ? MASK_HARD_FLOAT_DIV : 0) | \
- (XCHAL_HAVE_FP_RECIP ? MASK_HARD_FLOAT_RECIP : 0) | \
- (XCHAL_HAVE_FP_SQRT ? MASK_HARD_FLOAT_SQRT : 0) | \
- (XCHAL_HAVE_FP_RSQRT ? MASK_HARD_FLOAT_RSQRT : 0))
-
-/* Macro to define tables used to set the flags. */
+ (XCHAL_HAVE_L32R ? 0 : MASK_CONST16))
#define TARGET_SWITCHES \
{ \
- {"big-endian", MASK_BIG_ENDIAN, \
- N_("Use big-endian byte order")}, \
- {"little-endian", -MASK_BIG_ENDIAN, \
- N_("Use little-endian byte order")}, \
- {"density", MASK_DENSITY, \
- N_("Use the Xtensa code density option")}, \
- {"no-density", -MASK_DENSITY, \
- N_("Do not use the Xtensa code density option")}, \
{"const16", MASK_CONST16, \
N_("Use CONST16 instruction to load constants")}, \
{"no-const16", -MASK_CONST16, \
N_("Use PC-relative L32R instruction to load constants")}, \
- {"abs", MASK_ABS, \
- N_("Use the Xtensa ABS instruction")}, \
- {"no-abs", -MASK_ABS, \
- N_("Do not use the Xtensa ABS instruction")}, \
- {"addx", MASK_ADDX, \
- N_("Use the Xtensa ADDX and SUBX instructions")}, \
- {"no-addx", -MASK_ADDX, \
- N_("Do not use the Xtensa ADDX and SUBX instructions")}, \
- {"mac16", MASK_MAC16, \
- N_("Use the Xtensa MAC16 option")}, \
- {"no-mac16", -MASK_MAC16, \
- N_("Do not use the Xtensa MAC16 option")}, \
- {"mul16", MASK_MUL16, \
- N_("Use the Xtensa MUL16 option")}, \
- {"no-mul16", -MASK_MUL16, \
- N_("Do not use the Xtensa MUL16 option")}, \
- {"mul32", MASK_MUL32, \
- N_("Use the Xtensa MUL32 option")}, \
- {"no-mul32", -MASK_MUL32, \
- N_("Do not use the Xtensa MUL32 option")}, \
- {"div32", MASK_DIV32, \
- 0 /* undocumented */}, \
- {"no-div32", -MASK_DIV32, \
- 0 /* undocumented */}, \
- {"nsa", MASK_NSA, \
- N_("Use the Xtensa NSA option")}, \
- {"no-nsa", -MASK_NSA, \
- N_("Do not use the Xtensa NSA option")}, \
- {"minmax", MASK_MINMAX, \
- N_("Use the Xtensa MIN/MAX option")}, \
- {"no-minmax", -MASK_MINMAX, \
- N_("Do not use the Xtensa MIN/MAX option")}, \
- {"sext", MASK_SEXT, \
- N_("Use the Xtensa SEXT option")}, \
- {"no-sext", -MASK_SEXT, \
- N_("Do not use the Xtensa SEXT option")}, \
- {"booleans", MASK_BOOLEANS, \
- N_("Use the Xtensa boolean register option")}, \
- {"no-booleans", -MASK_BOOLEANS, \
- N_("Do not use the Xtensa boolean register option")}, \
- {"hard-float", MASK_HARD_FLOAT, \
- N_("Use the Xtensa floating-point unit")}, \
- {"soft-float", -MASK_HARD_FLOAT, \
- N_("Do not use the Xtensa floating-point unit")}, \
- {"hard-float-div", MASK_HARD_FLOAT_DIV, \
- 0 /* undocumented */}, \
- {"no-hard-float-div", -MASK_HARD_FLOAT_DIV, \
- 0 /* undocumented */}, \
- {"hard-float-recip", MASK_HARD_FLOAT_RECIP, \
- 0 /* undocumented */}, \
- {"no-hard-float-recip", -MASK_HARD_FLOAT_RECIP, \
- 0 /* undocumented */}, \
- {"hard-float-sqrt", MASK_HARD_FLOAT_SQRT, \
- 0 /* undocumented */}, \
- {"no-hard-float-sqrt", -MASK_HARD_FLOAT_SQRT, \
- 0 /* undocumented */}, \
- {"hard-float-rsqrt", MASK_HARD_FLOAT_RSQRT, \
- 0 /* undocumented */}, \
- {"no-hard-float-rsqrt", -MASK_HARD_FLOAT_RSQRT, \
- 0 /* undocumented */}, \
{"no-fused-madd", MASK_NO_FUSED_MADD, \
N_("Disable fused multiply/add and multiply/subtract FP instructions")}, \
{"fused-madd", -MASK_NO_FUSED_MADD, \
@@ -1207,7 +1102,7 @@ typedef struct xtensa_args {
operand on the target machine when generating position independent
code. */
#define LEGITIMATE_PIC_OPERAND_P(X) \
- ((GET_CODE (X) != SYMBOL_REF || SYMBOL_REF_FLAG (X)) \
+ ((GET_CODE (X) != SYMBOL_REF || SYMBOL_REF_LOCAL_P (X)) \
&& GET_CODE (X) != LABEL_REF \
&& GET_CODE (X) != CONST)
@@ -1482,3 +1377,13 @@ typedef struct xtensa_args {
/* Exception handling TODO!! */
#define DWARF_UNWIND_INFO 0
+/* Xtensa constant pool breaks the devices in crtstuff.c to control
+ section in where code resides. We have to write it as asm code. Use
+ a MOVI and let the assembler relax it -- for the .init and .fini
+ sections, the assembler knows to put the literal in the right
+ place. */
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
+ asm (SECTION_OP "\n\
+ movi\ta8, " USER_LABEL_PREFIX #FUNC "\n\
+ callx8\ta8\n" \
+ TEXT_SECTION_ASM_OP);
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 26bad87cf7f..01ec40d63a7 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -19,13 +19,6 @@
;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
;; 02111-1307, USA.
-;;
-;; ....................
-;;
-;; CONSTANTS
-;;
-;; ....................
-;;
(define_constants [
(A0_REG 0)
@@ -41,13 +34,8 @@
(UNSPECV_ENTRY 2)
])
-;;
-;; ....................
-;;
-;; ATTRIBUTES
-;;
-;; ....................
-;;
+
+;; Attributes.
(define_attr "type"
"unknown,jump,call,load,store,move,arith,multi,nop,farith,fmadd,fdiv,fsqrt,fconv,fload,fstore,mul16,mul32,div32,mac16,rsr,wsr"
@@ -63,14 +51,8 @@
(define_asm_attributes
[(set_attr "type" "multi")])
-
-;;
-;; ....................
-;;
-;; FUNCTIONAL UNITS
-;;
-;; ....................
-;;
+
+;; Functional units.
(define_function_unit "memory" 1 0 (eq_attr "type" "load,fload") 2 0)
@@ -84,21 +66,14 @@
(define_function_unit "fpconv" 1 0 (eq_attr "type" "fconv") 2 0)
-
-;;
-;; ....................
-;;
-;; ADDITION
-;;
-;; ....................
-;;
+
+;; Addition.
(define_expand "adddi3"
[(set (match_operand:DI 0 "register_operand" "")
(plus:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))]
""
- "
{
rtx srclo;
rtx dstlo = gen_lowpart (SImode, operands[0]);
@@ -125,7 +100,7 @@
emit_insn (gen_addsi3 (dsthi, src1hi, src2hi));
emit_insn (gen_adddi_carry (dsthi, dstlo, srclo));
DONE;
-}")
+})
;; Represent the add-carry operation as an atomic operation instead of
;; expanding it to a conditional branch. Otherwise, the edge
@@ -138,7 +113,7 @@
(match_operand:SI 2 "register_operand" "r"))
(match_dup 0)))]
""
- "bgeu\\t%1, %2, 0f\;addi\\t%0, %0, 1\;0:"
+ "bgeu\t%1, %2, 0f\;addi\t%0, %0, 1\;0:"
[(set_attr "type" "multi")
(set_attr "mode" "SI")
(set_attr "length" "6")])
@@ -149,11 +124,11 @@
(match_operand:SI 2 "add_operand" "d,O,r,J,N")))]
""
"@
- add.n\\t%0, %1, %2
- addi.n\\t%0, %1, %d2
- add\\t%0, %1, %2
- addi\\t%0, %1, %d2
- addmi\\t%0, %1, %x2"
+ add.n\t%0, %1, %2
+ addi.n\t%0, %1, %d2
+ add\t%0, %1, %2
+ addi\t%0, %1, %d2
+ addmi\t%0, %1, %x2"
[(set_attr "type" "arith,arith,arith,arith,arith")
(set_attr "mode" "SI")
(set_attr "length" "2,2,3,3,3")])
@@ -164,7 +139,7 @@
(const_int 2))
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_ADDX"
- "addx2\\t%0, %1, %2"
+ "addx2\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -175,7 +150,7 @@
(const_int 4))
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_ADDX"
- "addx4\\t%0, %1, %2"
+ "addx4\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -186,7 +161,7 @@
(const_int 8))
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_ADDX"
- "addx8\\t%0, %1, %2"
+ "addx8\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -196,26 +171,19 @@
(plus:SF (match_operand:SF 1 "register_operand" "%f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "add.s\\t%0, %1, %2"
+ "add.s\t%0, %1, %2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; SUBTRACTION
-;;
-;; ....................
-;;
+
+;; Subtraction.
(define_expand "subdi3"
[(set (match_operand:DI 0 "register_operand" "")
(minus:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))]
""
- "
{
rtx dstlo = gen_lowpart (SImode, operands[0]);
rtx src1lo = gen_lowpart (SImode, operands[1]);
@@ -229,7 +197,7 @@
emit_insn (gen_subdi_carry (dsthi, src1lo, src2lo));
emit_insn (gen_subsi3 (dstlo, src1lo, src2lo));
DONE;
-}")
+})
(define_insn "subdi_carry"
[(set (match_operand:SI 0 "register_operand" "+a")
@@ -237,7 +205,7 @@
(ltu:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "register_operand" "r"))))]
""
- "bgeu\\t%1, %2, 0f\;addi\\t%0, %0, -1\;0:"
+ "bgeu\t%1, %2, 0f\;addi\t%0, %0, -1\;0:"
[(set_attr "type" "multi")
(set_attr "mode" "SI")
(set_attr "length" "6")])
@@ -247,7 +215,7 @@
(minus:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "register_operand" "r")))]
""
- "sub\\t%0, %1, %2"
+ "sub\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -258,7 +226,7 @@
(const_int 2))
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_ADDX"
- "subx2\\t%0, %1, %2"
+ "subx2\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -269,7 +237,7 @@
(const_int 4))
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_ADDX"
- "subx4\\t%0, %1, %2"
+ "subx4\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -280,7 +248,7 @@
(const_int 8))
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_ADDX"
- "subx8\\t%0, %1, %2"
+ "subx8\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -290,26 +258,20 @@
(minus:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "sub.s\\t%0, %1, %2"
+ "sub.s\t%0, %1, %2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; MULTIPLICATION
-;;
-;; ....................
-;;
+
+;; Multiplication.
(define_insn "mulsi3"
[(set (match_operand:SI 0 "register_operand" "=a")
(mult:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_MUL32"
- "mull\\t%0, %1, %2"
+ "mull\t%0, %1, %2"
[(set_attr "type" "mul32")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -322,8 +284,8 @@
(match_operand:HI 2 "register_operand" "r,r"))))]
"TARGET_MUL16 || TARGET_MAC16"
"@
- mul16s\\t%0, %1, %2
- mul.aa.ll\\t%1, %2"
+ mul16s\t%0, %1, %2
+ mul.aa.ll\t%1, %2"
[(set_attr "type" "mul16,mac16")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
@@ -336,8 +298,8 @@
(match_operand:HI 2 "register_operand" "r,r"))))]
"TARGET_MUL16 || TARGET_MAC16"
"@
- mul16u\\t%0, %1, %2
- umul.aa.ll\\t%1, %2"
+ mul16u\t%0, %1, %2
+ umul.aa.ll\t%1, %2"
[(set_attr "type" "mul16,mac16")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
@@ -350,7 +312,7 @@
(match_operand:HI 2 "register_operand" "r")))
(match_operand:SI 3 "register_operand" "0")))]
"TARGET_MAC16"
- "mula.aa.ll\\t%1, %2"
+ "mula.aa.ll\t%1, %2"
[(set_attr "type" "mac16")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -363,7 +325,7 @@
(sign_extend:SI
(match_operand:HI 3 "register_operand" "r")))))]
"TARGET_MAC16"
- "muls.aa.ll\\t%2, %3"
+ "muls.aa.ll\t%2, %3"
[(set_attr "type" "mac16")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -373,7 +335,7 @@
(mult:SF (match_operand:SF 1 "register_operand" "%f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "mul.s\\t%0, %1, %2"
+ "mul.s\t%0, %1, %2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -384,7 +346,7 @@
(match_operand:SF 2 "register_operand" "f"))
(match_operand:SF 3 "register_operand" "0")))]
"TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD"
- "madd.s\\t%0, %1, %2"
+ "madd.s\t%0, %1, %2"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -395,26 +357,20 @@
(mult:SF (match_operand:SF 2 "register_operand" "%f")
(match_operand:SF 3 "register_operand" "f"))))]
"TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD"
- "msub.s\\t%0, %2, %3"
+ "msub.s\t%0, %2, %3"
[(set_attr "type" "fmadd")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; DIVISION
-;;
-;; ....................
-;;
+
+;; Division.
(define_insn "divsi3"
[(set (match_operand:SI 0 "register_operand" "=a")
(div:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_DIV32"
- "quos\\t%0, %1, %2"
+ "quos\t%0, %1, %2"
[(set_attr "type" "div32")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -424,7 +380,7 @@
(udiv:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_DIV32"
- "quou\\t%0, %1, %2"
+ "quou\t%0, %1, %2"
[(set_attr "type" "div32")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -434,7 +390,7 @@
(div:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT_DIV"
- "div.s\\t%0, %1, %2"
+ "div.s\t%0, %1, %2"
[(set_attr "type" "fdiv")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -444,26 +400,20 @@
(div:SF (match_operand:SF 1 "const_float_1_operand" "")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT_RECIP && flag_unsafe_math_optimizations"
- "recip.s\\t%0, %2"
+ "recip.s\t%0, %2"
[(set_attr "type" "fdiv")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; REMAINDER
-;;
-;; ....................
-;;
+
+;; Remainders.
(define_insn "modsi3"
[(set (match_operand:SI 0 "register_operand" "=a")
(mod:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_DIV32"
- "rems\\t%0, %1, %2"
+ "rems\t%0, %1, %2"
[(set_attr "type" "div32")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -473,25 +423,19 @@
(umod:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_DIV32"
- "remu\\t%0, %1, %2"
+ "remu\t%0, %1, %2"
[(set_attr "type" "div32")
(set_attr "mode" "SI")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; SQUARE ROOT
-;;
-;; ....................
-;;
+
+;; Square roots.
(define_insn "sqrtsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT_SQRT"
- "sqrt.s\\t%0, %1"
+ "sqrt.s\t%0, %1"
[(set_attr "type" "fsqrt")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -501,25 +445,19 @@
(div:SF (match_operand:SF 1 "const_float_1_operand" "")
(sqrt:SF (match_operand:SF 2 "register_operand" "f"))))]
"TARGET_HARD_FLOAT_RSQRT && flag_unsafe_math_optimizations"
- "rsqrt.s\\t%0, %2"
+ "rsqrt.s\t%0, %2"
[(set_attr "type" "fsqrt")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; ABSOLUTE VALUE
-;;
-;; ....................
-;;
+
+;; Absolute value.
(define_insn "abssi2"
[(set (match_operand:SI 0 "register_operand" "=a")
(abs:SI (match_operand:SI 1 "register_operand" "r")))]
"TARGET_ABS"
- "abs\\t%0, %1"
+ "abs\t%0, %1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -528,26 +466,20 @@
[(set (match_operand:SF 0 "register_operand" "=f")
(abs:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "abs.s\\t%0, %1"
+ "abs.s\t%0, %1"
[(set_attr "type" "farith")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; MIN AND MAX INSTRUCTIONS
-;;
-;; ....................
-;;
+
+;; Min and max.
(define_insn "sminsi3"
[(set (match_operand:SI 0 "register_operand" "=a")
(smin:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_MINMAX"
- "min\\t%0, %1, %2"
+ "min\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -557,7 +489,7 @@
(umin:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_MINMAX"
- "minu\\t%0, %1, %2"
+ "minu\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -567,7 +499,7 @@
(smax:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_MINMAX"
- "max\\t%0, %1, %2"
+ "max\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -577,25 +509,18 @@
(umax:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_MINMAX"
- "maxu\\t%0, %1, %2"
+ "maxu\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; FIND FIRST BIT INSTRUCTION
-;;
-;; ....................
-;;
+
+;; Find first bit.
(define_expand "ffssi2"
[(set (match_operand:SI 0 "register_operand" "")
(ffs:SI (match_operand:SI 1 "register_operand" "")))]
"TARGET_NSA"
- "
{
rtx temp = gen_reg_rtx (SImode);
emit_insn (gen_negsi2 (temp, operands[1]));
@@ -604,32 +529,26 @@
emit_insn (gen_negsi2 (temp, temp));
emit_insn (gen_addsi3 (operands[0], temp, GEN_INT (32)));
DONE;
-}")
+})
-;; there is no RTL operator corresponding to NSAU
+;; There is no RTL operator corresponding to NSAU.
(define_insn "nsau"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(match_operand:SI 1 "register_operand" "r")] UNSPEC_NSAU))]
"TARGET_NSA"
- "nsau\\t%0, %1"
+ "nsau\t%0, %1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; NEGATION and ONE'S COMPLEMENT
-;;
-;; ....................
-;;
+
+;; Negation and one's complement.
(define_insn "negsi2"
[(set (match_operand:SI 0 "register_operand" "=a")
(neg:SI (match_operand:SI 1 "register_operand" "r")))]
""
- "neg\\t%0, %1"
+ "neg\t%0, %1"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -638,31 +557,24 @@
[(set (match_operand:SI 0 "register_operand" "")
(not:SI (match_operand:SI 1 "register_operand" "")))]
""
- "
{
rtx temp = gen_reg_rtx (SImode);
emit_insn (gen_movsi (temp, constm1_rtx));
emit_insn (gen_xorsi3 (operands[0], temp, operands[1]));
DONE;
-}")
+})
(define_insn "negsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(neg:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "neg.s\\t%0, %1"
+ "neg.s\t%0, %1"
[(set_attr "type" "farith")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; LOGICAL
-;;
-;; ....................
-;;
+
+;; Logical instructions.
(define_insn "andsi3"
[(set (match_operand:SI 0 "register_operand" "=a,a")
@@ -670,8 +582,8 @@
(match_operand:SI 2 "mask_operand" "P,r")))]
""
"@
- extui\\t%0, %1, 0, %K2
- and\\t%0, %1, %2"
+ extui\t%0, %1, 0, %K2
+ and\t%0, %1, %2"
[(set_attr "type" "arith,arith")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
@@ -681,7 +593,7 @@
(ior:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))]
""
- "or\\t%0, %1, %2"
+ "or\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -691,27 +603,21 @@
(xor:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))]
""
- "xor\\t%0, %1, %2"
+ "xor\t%0, %1, %2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; ZERO EXTENSION
-;;
-;; ....................
-;;
+
+;; Zero-extend instructions.
(define_insn "zero_extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=a,a")
(zero_extend:SI (match_operand:HI 1 "nonimmed_operand" "r,U")))]
""
"@
- extui\\t%0, %1, 0, 16
- l16ui\\t%0, %1"
+ extui\t%0, %1, 0, 16
+ l16ui\t%0, %1"
[(set_attr "type" "arith,load")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
@@ -721,41 +627,34 @@
(zero_extend:SI (match_operand:QI 1 "nonimmed_operand" "r,U")))]
""
"@
- extui\\t%0, %1, 0, 8
- l8ui\\t%0, %1"
+ extui\t%0, %1, 0, 8
+ l8ui\t%0, %1"
[(set_attr "type" "arith,load")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
-
-;;
-;; ....................
-;;
-;; SIGN EXTENSION
-;;
-;; ....................
-;;
+
+;; Sign-extend instructions.
(define_expand "extendhisi2"
[(set (match_operand:SI 0 "register_operand" "")
(sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
""
- "
{
if (sext_operand (operands[1], HImode))
emit_insn (gen_extendhisi2_internal (operands[0], operands[1]));
else
xtensa_extend_reg (operands[0], operands[1]);
DONE;
-}")
+})
(define_insn "extendhisi2_internal"
[(set (match_operand:SI 0 "register_operand" "=B,a")
(sign_extend:SI (match_operand:HI 1 "sext_operand" "r,U")))]
""
"@
- sext\\t%0, %1, 15
- l16si\\t%0, %1"
+ sext\t%0, %1, 15
+ l16si\t%0, %1"
[(set_attr "type" "arith,load")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
@@ -764,34 +663,25 @@
[(set (match_operand:SI 0 "register_operand" "")
(sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
""
- "
{
if (TARGET_SEXT)
- {
- emit_insn (gen_extendqisi2_internal (operands[0], operands[1]));
- DONE;
- }
- xtensa_extend_reg (operands[0], operands[1]);
+ emit_insn (gen_extendqisi2_internal (operands[0], operands[1]));
+ else
+ xtensa_extend_reg (operands[0], operands[1]);
DONE;
-}")
+})
(define_insn "extendqisi2_internal"
[(set (match_operand:SI 0 "register_operand" "=B")
(sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
"TARGET_SEXT"
- "sext\\t%0, %1, 7"
+ "sext\t%0, %1, 7"
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; FIELD EXTRACT
-;;
-;; ....................
-;;
+
+;; Field extract instructions.
(define_expand "extv"
[(set (match_operand:SI 0 "register_operand" "")
@@ -799,16 +689,19 @@
(match_operand:SI 2 "const_int_operand" "")
(match_operand:SI 3 "const_int_operand" "")))]
"TARGET_SEXT"
- "
{
- if (!sext_fldsz_operand (operands[2], SImode)) FAIL;
- /* we could expand to a right shift followed by sext but that's
- no better than the standard left and right shift sequence */
- if (!lsbitnum_operand (operands[3], SImode)) FAIL;
+ if (!sext_fldsz_operand (operands[2], SImode))
+ FAIL;
+
+ /* We could expand to a right shift followed by SEXT but that's
+ no better than the standard left and right shift sequence. */
+ if (!lsbitnum_operand (operands[3], SImode))
+ FAIL;
+
emit_insn (gen_extv_internal (operands[0], operands[1],
operands[2], operands[3]));
DONE;
-}")
+})
(define_insn "extv_internal"
[(set (match_operand:SI 0 "register_operand" "=a")
@@ -816,12 +709,11 @@
(match_operand:SI 2 "sext_fldsz_operand" "i")
(match_operand:SI 3 "lsbitnum_operand" "i")))]
"TARGET_SEXT"
- "*
{
int fldsz = INTVAL (operands[2]);
operands[2] = GEN_INT (fldsz - 1);
- return \"sext\\t%0, %1, %2\";
-}"
+ return "sext\t%0, %1, %2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -832,13 +724,13 @@
(match_operand:SI 2 "const_int_operand" "")
(match_operand:SI 3 "const_int_operand" "")))]
""
- "
{
- if (!extui_fldsz_operand (operands[2], SImode)) FAIL;
+ if (!extui_fldsz_operand (operands[2], SImode))
+ FAIL;
emit_insn (gen_extzv_internal (operands[0], operands[1],
operands[2], operands[3]));
DONE;
-}")
+})
(define_insn "extzv_internal"
[(set (match_operand:SI 0 "register_operand" "=a")
@@ -846,7 +738,6 @@
(match_operand:SI 2 "extui_fldsz_operand" "i")
(match_operand:SI 3 "const_int_operand" "i")))]
""
- "*
{
int shift;
if (BITS_BIG_ENDIAN)
@@ -854,26 +745,20 @@
else
shift = INTVAL (operands[3]) & 0x1f;
operands[3] = GEN_INT (shift);
- return \"extui\\t%0, %1, %3, %2\";
-}"
+ return "extui\t%0, %1, %3, %2";
+}
[(set_attr "type" "arith")
(set_attr "mode" "SI")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; CONVERSIONS
-;;
-;; ....................
-;;
+
+;; Conversions.
(define_insn "fix_truncsfsi2"
[(set (match_operand:SI 0 "register_operand" "=a")
(fix:SI (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "trunc.s\\t%0, %1, 0"
+ "trunc.s\t%0, %1, 0"
[(set_attr "type" "fconv")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -882,7 +767,7 @@
[(set (match_operand:SI 0 "register_operand" "=a")
(unsigned_fix:SI (match_operand:SF 1 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "utrunc.s %0, %1, 0"
+ "utrunc.s\t%0, %1, 0"
[(set_attr "type" "fconv")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -891,7 +776,7 @@
[(set (match_operand:SF 0 "register_operand" "=f")
(float:SF (match_operand:SI 1 "register_operand" "a")))]
"TARGET_HARD_FLOAT"
- "float.s\\t%0, %1, 0"
+ "float.s\t%0, %1, 0"
[(set_attr "type" "fconv")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -900,19 +785,13 @@
[(set (match_operand:SF 0 "register_operand" "=f")
(unsigned_float:SF (match_operand:SI 1 "register_operand" "a")))]
"TARGET_HARD_FLOAT"
- "ufloat.s %0, %1, 0"
+ "ufloat.s\t%0, %1, 0"
[(set_attr "type" "fconv")
(set_attr "mode" "SF")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; DATA MOVEMENT
-;;
-;; ....................
-;;
+
+;; Data movement instructions.
;; 64-bit Integer moves
@@ -920,7 +799,6 @@
[(set (match_operand:DI 0 "nonimmed_operand" "")
(match_operand:DI 1 "general_operand" ""))]
""
- "
{
if (CONSTANT_P (operands[1]) && !TARGET_CONST16)
operands[1] = force_const_mem (DImode, operands[1]);
@@ -931,7 +809,7 @@
if (xtensa_copy_incoming_a7 (operands, DImode))
DONE;
-}")
+})
(define_insn_and_split "movdi_internal"
[(set (match_operand:DI 0 "nonimmed_operand" "=a,W,a,a,U")
@@ -952,39 +830,37 @@
}
})
-
;; 32-bit Integer moves
(define_expand "movsi"
[(set (match_operand:SI 0 "nonimmed_operand" "")
(match_operand:SI 1 "general_operand" ""))]
""
- "
{
if (xtensa_emit_move_sequence (operands, SImode))
DONE;
-}")
+})
(define_insn "movsi_internal"
[(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,W,a,a,U,*a,*A")
(match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,i,T,U,r,*A,*r"))]
"xtensa_valid_move (SImode, operands)"
"@
- movi.n\\t%0, %x1
- mov.n\\t%0, %1
- mov.n\\t%0, %1
- %v1l32i.n\\t%0, %1
- %v0s32i.n\\t%1, %0
- %v0s32i.n\\t%1, %0
- mov\\t%0, %1
- movsp\\t%0, %1
- movi\\t%0, %x1
- const16\\t%0, %t1\;const16\\t%0, %b1
- %v1l32r\\t%0, %1
- %v1l32i\\t%0, %1
- %v0s32i\\t%1, %0
- rsr\\t%0, 16 # ACCLO
- wsr\\t%1, 16 # ACCLO"
+ movi.n\t%0, %x1
+ mov.n\t%0, %1
+ mov.n\t%0, %1
+ %v1l32i.n\t%0, %1
+ %v0s32i.n\t%1, %0
+ %v0s32i.n\t%1, %0
+ mov\t%0, %1
+ movsp\t%0, %1
+ movi\t%0, %x1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0
+ rsr\t%0, 16 # ACCLO
+ wsr\t%1, 16 # ACCLO"
[(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr")
(set_attr "mode" "SI")
(set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")])
@@ -995,25 +871,24 @@
[(set (match_operand:HI 0 "nonimmed_operand" "")
(match_operand:HI 1 "general_operand" ""))]
""
- "
{
if (xtensa_emit_move_sequence (operands, HImode))
DONE;
-}")
+})
(define_insn "movhi_internal"
[(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
(match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
"xtensa_valid_move (HImode, operands)"
"@
- movi.n\\t%0, %x1
- mov.n\\t%0, %1
- mov\\t%0, %1
- movi\\t%0, %x1
- %v1l16ui\\t%0, %1
- %v0s16i\\t%1, %0
- rsr\\t%0, 16 # ACCLO
- wsr\\t%1, 16 # ACCLO"
+ movi.n\t%0, %x1
+ mov.n\t%0, %1
+ mov\t%0, %1
+ movi\t%0, %x1
+ %v1l16ui\t%0, %1
+ %v0s16i\t%1, %0
+ rsr\t%0, 16 # ACCLO
+ wsr\t%1, 16 # ACCLO"
[(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
(set_attr "mode" "HI")
(set_attr "length" "2,2,3,3,3,3,3,3")])
@@ -1024,25 +899,24 @@
[(set (match_operand:QI 0 "nonimmed_operand" "")
(match_operand:QI 1 "general_operand" ""))]
""
- "
{
if (xtensa_emit_move_sequence (operands, QImode))
DONE;
-}")
+})
(define_insn "movqi_internal"
[(set (match_operand:QI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
(match_operand:QI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
"xtensa_valid_move (QImode, operands)"
"@
- movi.n\\t%0, %x1
- mov.n\\t%0, %1
- mov\\t%0, %1
- movi\\t%0, %x1
- %v1l8ui\\t%0, %1
- %v0s8i\\t%1, %0
- rsr\\t%0, 16 # ACCLO
- wsr\\t%1, 16 # ACCLO"
+ movi.n\t%0, %x1
+ mov.n\t%0, %1
+ mov\t%0, %1
+ movi\t%0, %x1
+ %v1l8ui\t%0, %1
+ %v0s8i\t%1, %0
+ rsr\t%0, 16 # ACCLO
+ wsr\t%1, 16 # ACCLO"
[(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
(set_attr "mode" "QI")
(set_attr "length" "2,2,3,3,3,3,3,3")])
@@ -1053,7 +927,6 @@
[(set (match_operand:SF 0 "nonimmed_operand" "")
(match_operand:SF 1 "general_operand" ""))]
""
- "
{
if (!TARGET_CONST16 && CONSTANT_P (operands[1]))
operands[1] = force_const_mem (SFmode, operands[1]);
@@ -1070,7 +943,7 @@
if (xtensa_copy_incoming_a7 (operands, SFmode))
DONE;
}
-}")
+})
(define_insn "movsf_internal"
[(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,W,a,a,U")
@@ -1080,19 +953,19 @@
&& !(FP_REG_P (xt_true_regnum (operands[0]))
&& (constantpool_mem_p (operands[1]) || CONSTANT_P (operands[1]))))"
"@
- mov.s\\t%0, %1
- %v1lsi\\t%0, %1
- %v0ssi\\t%1, %0
- mov.n\\t%0, %1
- %v1l32i.n\\t%0, %1
- %v0s32i.n\\t%1, %0
- mov\\t%0, %1
- wfr\\t%0, %1
- rfr\\t%0, %1
- const16\\t%0, %t1\;const16\\t%0, %b1
- %v1l32r\\t%0, %1
- %v1l32i\\t%0, %1
- %v0s32i\\t%1, %0"
+ mov.s\t%0, %1
+ %v1lsi\t%0, %1
+ %v0ssi\t%1, %0
+ mov.n\t%0, %1
+ %v1l32i.n\t%0, %1
+ %v0s32i.n\t%1, %0
+ mov\t%0, %1
+ wfr\t%0, %1
+ rfr\t%0, %1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0"
[(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,load,load,store")
(set_attr "mode" "SF")
(set_attr "length" "3,3,3,2,2,2,3,3,3,6,3,3,3")])
@@ -1104,12 +977,11 @@
(set (match_dup 1)
(plus:SI (match_dup 1) (match_dup 2)))]
"TARGET_HARD_FLOAT"
- "*
{
if (volatile_refs_p (PATTERN (insn)))
- output_asm_insn (\"memw\", operands);
- return \"lsiu\\t%0, %1, %2\";
-}"
+ output_asm_insn ("memw", operands);
+ return "lsiu\t%0, %1, %2";
+}
[(set_attr "type" "fload")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -1121,12 +993,11 @@
(set (match_dup 0)
(plus:SI (match_dup 0) (match_dup 1)))]
"TARGET_HARD_FLOAT"
- "*
{
if (volatile_refs_p (PATTERN (insn)))
- output_asm_insn (\"memw\", operands);
- return \"ssiu\\t%2, %0, %1\";
-}"
+ output_asm_insn ("memw", operands);
+ return "ssiu\t%2, %0, %1";
+}
[(set_attr "type" "fstore")
(set_attr "mode" "SF")
(set_attr "length" "3")])
@@ -1137,7 +1008,6 @@
[(set (match_operand:DF 0 "nonimmed_operand" "")
(match_operand:DF 1 "general_operand" ""))]
""
- "
{
if (CONSTANT_P (operands[1]) && !TARGET_CONST16)
operands[1] = force_const_mem (DFmode, operands[1]);
@@ -1148,7 +1018,7 @@
if (xtensa_copy_incoming_a7 (operands, DFmode))
DONE;
-}")
+})
(define_insn_and_split "movdf_internal"
[(set (match_operand:DF 0 "nonimmed_operand" "=a,W,a,a,U")
@@ -1168,7 +1038,6 @@
tmp = operands[2], operands[2] = operands[3], operands[3] = tmp;
}
})
-
;; Block moves
@@ -1178,11 +1047,11 @@
(use (match_operand:SI 2 "arith_operand" ""))
(use (match_operand:SI 3 "const_int_operand" ""))])]
""
- "
{
- if (!xtensa_expand_block_move (operands)) FAIL;
+ if (!xtensa_expand_block_move (operands))
+ FAIL;
DONE;
-}")
+})
(define_insn "movstrsi_internal"
[(set (match_operand:BLK 0 "memory_operand" "=U")
@@ -1192,26 +1061,19 @@
(clobber (match_scratch:SI 4 "=&r"))
(clobber (match_scratch:SI 5 "=&r"))]
""
- "*
{
rtx tmpregs[2];
tmpregs[0] = operands[4];
tmpregs[1] = operands[5];
xtensa_emit_block_move (operands, tmpregs, 1);
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "multi")
(set_attr "mode" "none")
(set_attr "length" "300")])
-
-;;
-;; ....................
-;;
-;; SHIFTS
-;;
-;; ....................
-;;
+
+;; Shift instructions.
(define_insn "ashlsi3"
[(set (match_operand:SI 0 "register_operand" "=a,a")
@@ -1219,8 +1081,8 @@
(match_operand:SI 2 "arith_operand" "J,r")))]
""
"@
- slli\\t%0, %1, %R2
- ssl\\t%2\;sll\\t%0, %1"
+ slli\t%0, %1, %R2
+ ssl\t%2\;sll\t%0, %1"
[(set_attr "type" "arith,arith")
(set_attr "mode" "SI")
(set_attr "length" "3,6")])
@@ -1231,8 +1093,8 @@
(match_operand:SI 2 "arith_operand" "J,r")))]
""
"@
- srai\\t%0, %1, %R2
- ssr\\t%2\;sra\\t%0, %1"
+ srai\t%0, %1, %R2
+ ssr\t%2\;sra\t%0, %1"
[(set_attr "type" "arith,arith")
(set_attr "mode" "SI")
(set_attr "length" "3,6")])
@@ -1242,17 +1104,16 @@
(lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
(match_operand:SI 2 "arith_operand" "J,r")))]
""
- "*
{
if (which_alternative == 0)
{
if ((INTVAL (operands[2]) & 0x1f) < 16)
- return \"srli\\t%0, %1, %R2\";
+ return "srli\t%0, %1, %R2";
else
- return \"extui\\t%0, %1, %R2, %L2\";
+ return "extui\t%0, %1, %R2, %L2";
}
- return \"ssr\\t%2\;srl\\t%0, %1\";
-}"
+ return "ssr\t%2\;srl\t%0, %1";
+}
[(set_attr "type" "arith,arith")
(set_attr "mode" "SI")
(set_attr "length" "3,6")])
@@ -1263,8 +1124,8 @@
(match_operand:SI 2 "arith_operand" "J,r")))]
""
"@
- ssai\\t%L2\;src\\t%0, %1, %1
- ssl\\t%2\;src\\t%0, %1, %1"
+ ssai\t%L2\;src\t%0, %1, %1
+ ssl\t%2\;src\t%0, %1, %1"
[(set_attr "type" "multi,multi")
(set_attr "mode" "SI")
(set_attr "length" "6,6")])
@@ -1275,71 +1136,55 @@
(match_operand:SI 2 "arith_operand" "J,r")))]
""
"@
- ssai\\t%R2\;src\\t%0, %1, %1
- ssr\\t%2\;src\\t%0, %1, %1"
+ ssai\t%R2\;src\t%0, %1, %1
+ ssr\t%2\;src\t%0, %1, %1"
[(set_attr "type" "multi,multi")
(set_attr "mode" "SI")
(set_attr "length" "6,6")])
+
+;; Comparisons.
-;;
-;; ....................
-;;
-;; COMPARISONS
-;;
-;; ....................
-;;
-
-;; Like the md files for MIPS and SPARC, we handle comparisons by stashing
-;; away the operands and then using that information in the subsequent
-;; conditional branch.
+;; Handle comparisons by stashing away the operands and then using that
+;; information in the subsequent conditional branch.
(define_expand "cmpsi"
[(set (cc0)
(compare:CC (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "nonmemory_operand" "")))]
""
- "
{
branch_cmp[0] = operands[0];
branch_cmp[1] = operands[1];
branch_type = CMP_SI;
DONE;
-}")
+})
(define_expand "tstsi"
[(set (cc0)
(match_operand:SI 0 "register_operand" ""))]
""
- "
{
branch_cmp[0] = operands[0];
branch_cmp[1] = const0_rtx;
branch_type = CMP_SI;
DONE;
-}")
+})
(define_expand "cmpsf"
[(set (cc0)
(compare:CC (match_operand:SF 0 "register_operand" "")
(match_operand:SF 1 "register_operand" "")))]
"TARGET_HARD_FLOAT"
- "
{
branch_cmp[0] = operands[0];
branch_cmp[1] = operands[1];
branch_type = CMP_SF;
DONE;
-}")
-
+})
-;;
-;; ....................
-;;
-;; CONDITIONAL BRANCHES
-;;
-;; ....................
-;;
+
+;; Conditional branches.
(define_expand "beq"
[(set (pc)
@@ -1347,11 +1192,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, EQ);
DONE;
-}")
+})
(define_expand "bne"
[(set (pc)
@@ -1359,11 +1203,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, NE);
DONE;
-}")
+})
(define_expand "bgt"
[(set (pc)
@@ -1371,11 +1214,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, GT);
DONE;
-}")
+})
(define_expand "bge"
[(set (pc)
@@ -1383,11 +1225,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, GE);
DONE;
-}")
+})
(define_expand "blt"
[(set (pc)
@@ -1395,11 +1236,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, LT);
DONE;
-}")
+})
(define_expand "ble"
[(set (pc)
@@ -1407,11 +1247,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, LE);
DONE;
-}")
+})
(define_expand "bgtu"
[(set (pc)
@@ -1419,11 +1258,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, GTU);
DONE;
-}")
+})
(define_expand "bgeu"
[(set (pc)
@@ -1431,11 +1269,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, GEU);
DONE;
-}")
+})
(define_expand "bltu"
[(set (pc)
@@ -1443,11 +1280,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, LTU);
DONE;
-}")
+})
(define_expand "bleu"
[(set (pc)
@@ -1455,11 +1291,10 @@
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
{
xtensa_expand_conditional_branch (operands, LEU);
DONE;
-}")
+})
;; Branch patterns for standard integer comparisons
@@ -1471,16 +1306,15 @@
(label_ref (match_operand 2 "" ""))
(pc)))]
""
- "*
{
if (which_alternative == 1)
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"beq\\t%0, %1, %2\";
- case NE: return \"bne\\t%0, %1, %2\";
- case LT: return \"blt\\t%0, %1, %2\";
- case GE: return \"bge\\t%0, %1, %2\";
+ case EQ: return "beq\t%0, %1, %2";
+ case NE: return "bne\t%0, %1, %2";
+ case LT: return "blt\t%0, %1, %2";
+ case GE: return "bge\t%0, %1, %2";
default: break;
}
}
@@ -1489,13 +1323,13 @@
switch (GET_CODE (operands[3]))
{
case EQ: return (TARGET_DENSITY
- ? \"beqz.n\\t%0, %2\"
- : \"beqz\\t%0, %2\");
+ ? "beqz.n\t%0, %2"
+ : "beqz\t%0, %2");
case NE: return (TARGET_DENSITY
- ? \"bnez.n\\t%0, %2\"
- : \"bnez\\t%0, %2\");
- case LT: return \"bltz\\t%0, %2\";
- case GE: return \"bgez\\t%0, %2\";
+ ? "bnez.n\t%0, %2"
+ : "bnez\t%0, %2");
+ case LT: return "bltz\t%0, %2";
+ case GE: return "bgez\t%0, %2";
default: break;
}
}
@@ -1503,16 +1337,16 @@
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"beqi\\t%0, %d1, %2\";
- case NE: return \"bnei\\t%0, %d1, %2\";
- case LT: return \"blti\\t%0, %d1, %2\";
- case GE: return \"bgei\\t%0, %d1, %2\";
+ case EQ: return "beqi\t%0, %d1, %2";
+ case NE: return "bnei\t%0, %d1, %2";
+ case LT: return "blti\t%0, %d1, %2";
+ case GE: return "bgei\t%0, %d1, %2";
default: break;
}
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
(set_attr "length" "3,3")])
@@ -1525,16 +1359,15 @@
(pc)
(label_ref (match_operand 2 "" ""))))]
""
- "*
{
if (which_alternative == 1)
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bne\\t%0, %1, %2\";
- case NE: return \"beq\\t%0, %1, %2\";
- case LT: return \"bge\\t%0, %1, %2\";
- case GE: return \"blt\\t%0, %1, %2\";
+ case EQ: return "bne\t%0, %1, %2";
+ case NE: return "beq\t%0, %1, %2";
+ case LT: return "bge\t%0, %1, %2";
+ case GE: return "blt\t%0, %1, %2";
default: break;
}
}
@@ -1543,13 +1376,13 @@
switch (GET_CODE (operands[3]))
{
case EQ: return (TARGET_DENSITY
- ? \"bnez.n\\t%0, %2\"
- : \"bnez\\t%0, %2\");
+ ? "bnez.n\t%0, %2"
+ : "bnez\t%0, %2");
case NE: return (TARGET_DENSITY
- ? \"beqz.n\\t%0, %2\"
- : \"beqz\\t%0, %2\");
- case LT: return \"bgez\\t%0, %2\";
- case GE: return \"bltz\\t%0, %2\";
+ ? "beqz.n\t%0, %2"
+ : "beqz\t%0, %2");
+ case LT: return "bgez\t%0, %2";
+ case GE: return "bltz\t%0, %2";
default: break;
}
}
@@ -1557,16 +1390,16 @@
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bnei\\t%0, %d1, %2\";
- case NE: return \"beqi\\t%0, %d1, %2\";
- case LT: return \"bgei\\t%0, %d1, %2\";
- case GE: return \"blti\\t%0, %d1, %2\";
+ case EQ: return "bnei\t%0, %d1, %2";
+ case NE: return "beqi\t%0, %d1, %2";
+ case LT: return "bgei\t%0, %d1, %2";
+ case GE: return "blti\t%0, %d1, %2";
default: break;
}
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
(set_attr "length" "3,3")])
@@ -1579,14 +1412,13 @@
(label_ref (match_operand 2 "" ""))
(pc)))]
""
- "*
{
if (which_alternative == 1)
{
switch (GET_CODE (operands[3]))
{
- case LTU: return \"bltu\\t%0, %1, %2\";
- case GEU: return \"bgeu\\t%0, %1, %2\";
+ case LTU: return "bltu\t%0, %1, %2";
+ case GEU: return "bgeu\t%0, %1, %2";
default: break;
}
}
@@ -1594,14 +1426,14 @@
{
switch (GET_CODE (operands[3]))
{
- case LTU: return \"bltui\\t%0, %d1, %2\";
- case GEU: return \"bgeui\\t%0, %d1, %2\";
+ case LTU: return "bltui\t%0, %d1, %2";
+ case GEU: return "bgeui\t%0, %d1, %2";
default: break;
}
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
(set_attr "length" "3,3")])
@@ -1614,14 +1446,13 @@
(pc)
(label_ref (match_operand 2 "" ""))))]
""
- "*
{
if (which_alternative == 1)
{
switch (GET_CODE (operands[3]))
{
- case LTU: return \"bgeu\\t%0, %1, %2\";
- case GEU: return \"bltu\\t%0, %1, %2\";
+ case LTU: return "bgeu\t%0, %1, %2";
+ case GEU: return "bltu\t%0, %1, %2";
default: break;
}
}
@@ -1629,14 +1460,14 @@
{
switch (GET_CODE (operands[3]))
{
- case LTU: return \"bgeui\\t%0, %d1, %2\";
- case GEU: return \"bltui\\t%0, %d1, %2\";
+ case LTU: return "bgeui\t%0, %d1, %2";
+ case GEU: return "bltui\t%0, %d1, %2";
default: break;
}
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
(set_attr "length" "3,3")])
@@ -1654,7 +1485,6 @@
(label_ref (match_operand 2 "" ""))
(pc)))]
""
- "*
{
if (which_alternative == 0)
{
@@ -1662,8 +1492,8 @@
operands[1] = GEN_INT(bitnum);
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bbci\\t%0, %d1, %2\";
- case NE: return \"bbsi\\t%0, %d1, %2\";
+ case EQ: return "bbci\t%0, %d1, %2";
+ case NE: return "bbsi\t%0, %d1, %2";
default: break;
}
}
@@ -1671,14 +1501,14 @@
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bbc\\t%0, %1, %2\";
- case NE: return \"bbs\\t%0, %1, %2\";
+ case EQ: return "bbc\t%0, %1, %2";
+ case NE: return "bbs\t%0, %1, %2";
default: break;
}
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -1694,7 +1524,6 @@
(pc)
(label_ref (match_operand 2 "" ""))))]
""
- "*
{
if (which_alternative == 0)
{
@@ -1702,23 +1531,23 @@
operands[1] = GEN_INT (bitnum);
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bbsi\\t%0, %d1, %2\";
- case NE: return \"bbci\\t%0, %d1, %2\";
- default: break;
+ case EQ: return "bbsi\t%0, %d1, %2";
+ case NE: return "bbci\t%0, %d1, %2";
+ default: break;
}
}
else
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bbs\\t%0, %1, %2\";
- case NE: return \"bbc\\t%0, %1, %2\";
+ case EQ: return "bbs\t%0, %1, %2";
+ case NE: return "bbc\t%0, %1, %2";
default: break;
}
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -1732,17 +1561,16 @@
(label_ref (match_operand 2 "" ""))
(pc)))]
""
- "*
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bnone\\t%0, %1, %2\";
- case NE: return \"bany\\t%0, %1, %2\";
- default: break;
+ case EQ: return "bnone\t%0, %1, %2";
+ case NE: return "bany\t%0, %1, %2";
+ default: break;
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -1756,138 +1584,127 @@
(pc)
(label_ref (match_operand 2 "" ""))))]
""
- "*
{
switch (GET_CODE (operands[3]))
{
- case EQ: return \"bany\\t%0, %1, %2\";
- case NE: return \"bnone\\t%0, %1, %2\";
- default: break;
+ case EQ: return "bany\t%0, %1, %2";
+ case NE: return "bnone\t%0, %1, %2";
+ default: break;
}
- fatal_insn (\"unexpected branch operator\", operands[3]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
-;; Define the loop insns that is used by bct optimization to represent the
-;; start and end of a zero-overhead loop (in loop.c). This start template
-;; generates the loop insn, the end template doesn't generate any instructions
-;; since since loop end is handled in hardware.
+;; Define the loop insns used by bct optimization to represent the
+;; start and end of a zero-overhead loop (in loop.c). This start
+;; template generates the loop insn; the end template doesn't generate
+;; any instructions since loop end is handled in hardware.
(define_insn "zero_cost_loop_start"
- [(set (pc) (if_then_else (eq (match_operand:SI 0 "register_operand" "a")
- (const_int 0))
- (label_ref (match_operand 1 "" ""))
- (pc)))
+ [(set (pc)
+ (if_then_else (eq (match_operand:SI 0 "register_operand" "a")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
(set (reg:SI 19)
(plus:SI (match_dup 0) (const_int -1)))]
""
- "loopnez %0, %l1"
+ "loopnez\t%0, %l1"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
(define_insn "zero_cost_loop_end"
- [(set (pc) (if_then_else (ne (reg:SI 19) (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))
+ [(set (pc)
+ (if_then_else (ne (reg:SI 19) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))
(set (reg:SI 19)
(plus:SI (reg:SI 19) (const_int -1)))]
""
- "*
+{
xtensa_emit_loop_end (insn, operands);
- return \"\";
- "
+ return "";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "0")])
-
-;;
-;; ....................
-;;
-;; SETTING A REGISTER FROM A COMPARISON
-;;
-;; ....................
-;;
+
+;; Setting a register from a comparison.
(define_expand "seq"
[(set (match_operand:SI 0 "register_operand" "")
(match_dup 1))]
""
- "
{
operands[1] = gen_rtx (EQ, SImode, branch_cmp[0], branch_cmp[1]);
- if (!xtensa_expand_scc (operands)) FAIL;
+ if (!xtensa_expand_scc (operands))
+ FAIL;
DONE;
-}")
+})
(define_expand "sne"
[(set (match_operand:SI 0 "register_operand" "")
(match_dup 1))]
""
- "
{
operands[1] = gen_rtx (NE, SImode, branch_cmp[0], branch_cmp[1]);
- if (!xtensa_expand_scc (operands)) FAIL;
+ if (!xtensa_expand_scc (operands))
+ FAIL;
DONE;
-}")
+})
(define_expand "sgt"
[(set (match_operand:SI 0 "register_operand" "")
(match_dup 1))]
""
- "
{
operands[1] = gen_rtx (GT, SImode, branch_cmp[0], branch_cmp[1]);
- if (!xtensa_expand_scc (operands)) FAIL;
+ if (!xtensa_expand_scc (operands))
+ FAIL;
DONE;
-}")
+})
(define_expand "sge"
[(set (match_operand:SI 0 "register_operand" "")
(match_dup 1))]
""
- "
{
operands[1] = gen_rtx (GE, SImode, branch_cmp[0], branch_cmp[1]);
- if (!xtensa_expand_scc (operands)) FAIL;
+ if (!xtensa_expand_scc (operands))
+ FAIL;
DONE;
-}")
+})
(define_expand "slt"
[(set (match_operand:SI 0 "register_operand" "")
(match_dup 1))]
""
- "
{
operands[1] = gen_rtx (LT, SImode, branch_cmp[0], branch_cmp[1]);
- if (!xtensa_expand_scc (operands)) FAIL;
+ if (!xtensa_expand_scc (operands))
+ FAIL;
DONE;
-}")
+})
(define_expand "sle"
[(set (match_operand:SI 0 "register_operand" "")
(match_dup 1))]
""
- "
{
operands[1] = gen_rtx (LE, SImode, branch_cmp[0], branch_cmp[1]);
- if (!xtensa_expand_scc (operands)) FAIL;
+ if (!xtensa_expand_scc (operands))
+ FAIL;
DONE;
-}")
-
+})
-;;
-;; ....................
-;;
-;; CONDITIONAL MOVES
-;;
-;; ....................
-;;
+
+;; Conditional moves.
(define_expand "movsicc"
[(set (match_operand:SI 0 "register_operand" "")
@@ -1895,11 +1712,11 @@
(match_operand:SI 2 "register_operand" "")
(match_operand:SI 3 "register_operand" "")))]
""
- "
{
- if (!xtensa_expand_conditional_move (operands, 0)) FAIL;
+ if (!xtensa_expand_conditional_move (operands, 0))
+ FAIL;
DONE;
-}")
+})
(define_expand "movsfcc"
[(set (match_operand:SF 0 "register_operand" "")
@@ -1907,11 +1724,11 @@
(match_operand:SF 2 "register_operand" "")
(match_operand:SF 3 "register_operand" "")))]
""
- "
{
- if (!xtensa_expand_conditional_move (operands, 1)) FAIL;
+ if (!xtensa_expand_conditional_move (operands, 1))
+ FAIL;
DONE;
-}")
+})
(define_insn "movsicc_internal0"
[(set (match_operand:SI 0 "register_operand" "=a,a")
@@ -1921,16 +1738,15 @@
(match_operand:SI 2 "register_operand" "r,0")
(match_operand:SI 3 "register_operand" "0,r")))]
""
- "*
{
if (which_alternative == 0)
{
switch (GET_CODE (operands[4]))
{
- case EQ: return \"moveqz\\t%0, %2, %1\";
- case NE: return \"movnez\\t%0, %2, %1\";
- case LT: return \"movltz\\t%0, %2, %1\";
- case GE: return \"movgez\\t%0, %2, %1\";
+ case EQ: return "moveqz\t%0, %2, %1";
+ case NE: return "movnez\t%0, %2, %1";
+ case LT: return "movltz\t%0, %2, %1";
+ case GE: return "movgez\t%0, %2, %1";
default: break;
}
}
@@ -1938,16 +1754,16 @@
{
switch (GET_CODE (operands[4]))
{
- case EQ: return \"movnez\\t%0, %3, %1\";
- case NE: return \"moveqz\\t%0, %3, %1\";
- case LT: return \"movgez\\t%0, %3, %1\";
- case GE: return \"movltz\\t%0, %3, %1\";
+ case EQ: return "movnez\t%0, %3, %1";
+ case NE: return "moveqz\t%0, %3, %1";
+ case LT: return "movgez\t%0, %3, %1";
+ case GE: return "movltz\t%0, %3, %1";
default: break;
}
}
- fatal_insn (\"unexpected cmov operator\", operands[4]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "move,move")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
@@ -1960,21 +1776,20 @@
(match_operand:SI 2 "register_operand" "r,0")
(match_operand:SI 3 "register_operand" "0,r")))]
"TARGET_BOOLEANS"
- "*
{
int isEq = (GET_CODE (operands[4]) == EQ);
switch (which_alternative)
{
case 0:
- if (isEq) return \"movf\\t%0, %2, %1\";
- return \"movt\\t%0, %2, %1\";
+ if (isEq) return "movf\t%0, %2, %1";
+ return "movt\t%0, %2, %1";
case 1:
- if (isEq) return \"movt\\t%0, %3, %1\";
- return \"movf\\t%0, %3, %1\";
+ if (isEq) return "movt\t%0, %3, %1";
+ return "movf\t%0, %3, %1";
}
abort ();
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "move,move")
(set_attr "mode" "SI")
(set_attr "length" "3,3")])
@@ -1987,16 +1802,15 @@
(match_operand:SF 2 "register_operand" "r,0,f,0")
(match_operand:SF 3 "register_operand" "0,r,0,f")))]
""
- "*
{
if (which_alternative == 0)
{
switch (GET_CODE (operands[4]))
{
- case EQ: return \"moveqz\\t%0, %2, %1\";
- case NE: return \"movnez\\t%0, %2, %1\";
- case LT: return \"movltz\\t%0, %2, %1\";
- case GE: return \"movgez\\t%0, %2, %1\";
+ case EQ: return "moveqz\t%0, %2, %1";
+ case NE: return "movnez\t%0, %2, %1";
+ case LT: return "movltz\t%0, %2, %1";
+ case GE: return "movgez\t%0, %2, %1";
default: break;
}
}
@@ -2004,10 +1818,10 @@
{
switch (GET_CODE (operands[4]))
{
- case EQ: return \"movnez\\t%0, %3, %1\";
- case NE: return \"moveqz\\t%0, %3, %1\";
- case LT: return \"movgez\\t%0, %3, %1\";
- case GE: return \"movltz\\t%0, %3, %1\";
+ case EQ: return "movnez\t%0, %3, %1";
+ case NE: return "moveqz\t%0, %3, %1";
+ case LT: return "movgez\t%0, %3, %1";
+ case GE: return "movltz\t%0, %3, %1";
default: break;
}
}
@@ -2015,10 +1829,10 @@
{
switch (GET_CODE (operands[4]))
{
- case EQ: return \"moveqz.s %0, %2, %1\";
- case NE: return \"movnez.s %0, %2, %1\";
- case LT: return \"movltz.s %0, %2, %1\";
- case GE: return \"movgez.s %0, %2, %1\";
+ case EQ: return "moveqz.s %0, %2, %1";
+ case NE: return "movnez.s %0, %2, %1";
+ case LT: return "movltz.s %0, %2, %1";
+ case GE: return "movgez.s %0, %2, %1";
default: break;
}
}
@@ -2026,16 +1840,16 @@
{
switch (GET_CODE (operands[4]))
{
- case EQ: return \"movnez.s %0, %3, %1\";
- case NE: return \"moveqz.s %0, %3, %1\";
- case LT: return \"movgez.s %0, %3, %1\";
- case GE: return \"movltz.s %0, %3, %1\";
+ case EQ: return "movnez.s %0, %3, %1";
+ case NE: return "moveqz.s %0, %3, %1";
+ case LT: return "movgez.s %0, %3, %1";
+ case GE: return "movltz.s %0, %3, %1";
default: break;
}
}
- fatal_insn (\"unexpected cmov operator\", operands[4]);
- return \"\";
-}"
+ abort ();
+ return "";
+}
[(set_attr "type" "move,move,move,move")
(set_attr "mode" "SF")
(set_attr "length" "3,3,3,3")])
@@ -2048,46 +1862,39 @@
(match_operand:SF 2 "register_operand" "r,0,f,0")
(match_operand:SF 3 "register_operand" "0,r,0,f")))]
"TARGET_BOOLEANS"
- "*
{
int isEq = (GET_CODE (operands[4]) == EQ);
switch (which_alternative)
{
case 0:
- if (isEq) return \"movf\\t%0, %2, %1\";
- return \"movt\\t%0, %2, %1\";
+ if (isEq) return "movf\t%0, %2, %1";
+ return "movt\t%0, %2, %1";
case 1:
- if (isEq) return \"movt\\t%0, %3, %1\";
- return \"movf\\t%0, %3, %1\";
+ if (isEq) return "movt\t%0, %3, %1";
+ return "movf\t%0, %3, %1";
case 2:
- if (isEq) return \"movf.s\\t%0, %2, %1\";
- return \"movt.s\\t%0, %2, %1\";
+ if (isEq) return "movf.s\t%0, %2, %1";
+ return "movt.s\t%0, %2, %1";
case 3:
- if (isEq) return \"movt.s\\t%0, %3, %1\";
- return \"movf.s\\t%0, %3, %1\";
+ if (isEq) return "movt.s\t%0, %3, %1";
+ return "movf.s\t%0, %3, %1";
}
abort ();
- return \"\";
-}"
+ return "";
+}
[(set_attr "type" "move,move,move,move")
(set_attr "mode" "SF")
(set_attr "length" "3,3,3,3")])
-
-;;
-;; ....................
-;;
-;; FLOATING POINT COMPARISONS
-;;
-;; ....................
-;;
+
+;; Floating-point comparisons.
(define_insn "seq_sf"
[(set (match_operand:CC 0 "register_operand" "=b")
(eq:CC (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "oeq.s\\t%0, %1, %2"
+ "oeq.s\t%0, %1, %2"
[(set_attr "type" "farith")
(set_attr "mode" "BL")
(set_attr "length" "3")])
@@ -2097,7 +1904,7 @@
(lt:CC (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "olt.s\\t%0, %1, %2"
+ "olt.s\t%0, %1, %2"
[(set_attr "type" "farith")
(set_attr "mode" "BL")
(set_attr "length" "3")])
@@ -2107,33 +1914,27 @@
(le:CC (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_HARD_FLOAT"
- "ole.s\\t%0, %1, %2"
+ "ole.s\t%0, %1, %2"
[(set_attr "type" "farith")
(set_attr "mode" "BL")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; UNCONDITIONAL BRANCHES
-;;
-;; ....................
-;;
+
+;; Unconditional branches.
(define_insn "jump"
[(set (pc)
(label_ref (match_operand 0 "" "")))]
""
- "j\\t%l0"
+ "j\t%l0"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
(define_expand "indirect_jump"
- [(set (pc) (match_operand 0 "register_operand" ""))]
+ [(set (pc)
+ (match_operand 0 "register_operand" ""))]
""
- "
{
rtx dest = operands[0];
if (GET_CODE (dest) != REG || GET_MODE (dest) != Pmode)
@@ -2141,12 +1942,12 @@
emit_jump_insn (gen_indirect_jump_internal (dest));
DONE;
-}")
+})
(define_insn "indirect_jump_internal"
[(set (pc) (match_operand:SI 0 "register_operand" "r"))]
""
- "jx\\t%0"
+ "jx\t%0"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -2156,12 +1957,11 @@
[(use (match_operand:SI 0 "register_operand" ""))
(use (label_ref (match_operand 1 "" "")))]
""
- "
{
rtx target = operands[0];
if (flag_pic)
{
- /* For PIC, the table entry is relative to the start of the table. */
+ /* For PIC, the table entry is relative to the start of the table. */
rtx label = gen_reg_rtx (SImode);
target = gen_reg_rtx (SImode);
emit_move_insn (label, gen_rtx_LABEL_REF (SImode, operands[1]));
@@ -2169,26 +1969,20 @@
}
emit_jump_insn (gen_tablejump_internal (target, operands[1]));
DONE;
-}")
+})
(define_insn "tablejump_internal"
[(set (pc)
(match_operand:SI 0 "register_operand" "r"))
(use (label_ref (match_operand 1 "" "")))]
""
- "jx\\t%0"
+ "jx\t%0"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
-
-;;
-;; ....................
-;;
-;; FUNCTION CALLS
-;;
-;; ....................
-;;
+
+;; Function calls.
(define_expand "sym_PLT"
[(const (unspec [(match_operand:SI 0 "" "")] UNSPEC_PLT))]
@@ -2199,22 +1993,21 @@
[(call (match_operand 0 "memory_operand" "")
(match_operand 1 "" ""))]
""
- "
{
rtx addr = XEXP (operands[0], 0);
if (flag_pic && GET_CODE (addr) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (addr))
addr = gen_sym_PLT (addr);
if (!call_insn_operand (addr, VOIDmode))
XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, addr);
-}")
+})
(define_insn "call_internal"
[(call (mem (match_operand:SI 0 "call_insn_operand" "n,i,r"))
(match_operand 1 "" "i,i,i"))]
""
- "*
- return xtensa_emit_call (0, operands);
- "
+{
+ return xtensa_emit_call (0, operands);
+}
[(set_attr "type" "call")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -2224,19 +2017,18 @@
(call (match_operand 1 "memory_operand" "")
(match_operand 2 "" "")))]
""
- "
{
rtx addr = XEXP (operands[1], 0);
if (flag_pic && GET_CODE (addr) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (addr))
addr = gen_sym_PLT (addr);
if (!call_insn_operand (addr, VOIDmode))
XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, addr);
-}")
+})
-;; cannot combine constraints for operand 0 into "afvb"
+;; Cannot combine constraints for operand 0 into "afvb":
;; reload.c:find_reloads seems to assume that grouped constraints somehow
;; specify related register classes, and when they don't the constraints
-;; fail to match. By not grouping the constraints, we get the correct
+;; fail to match. By not grouping the constraints, we get the correct
;; behavior.
(define_insn "call_value_internal"
[(set (match_operand 0 "register_operand" "=af,af,af,v,v,v,b,b,b")
@@ -2244,9 +2036,9 @@
"n,i,r,n,i,r,n,i,r"))
(match_operand 2 "" "i,i,i,i,i,i,i,i,i")))]
""
- "*
- return xtensa_emit_call (1, operands);
- "
+{
+ return xtensa_emit_call (1, operands);
+}
[(set_attr "type" "call")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -2257,14 +2049,13 @@
(match_operand:SI 1 "const_int_operand" "i")]
UNSPECV_ENTRY))]
""
- "*
{
if (frame_pointer_needed)
- output_asm_insn (\".frame\\ta7, %0\", operands);
+ output_asm_insn (".frame\ta7, %0", operands);
else
- output_asm_insn (\".frame\\tsp, %0\", operands);
- return \"entry\\tsp, %1\";
-}"
+ output_asm_insn (".frame\tsp, %0", operands);
+ return "entry\tsp, %1";
+}
[(set_attr "type" "move")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -2273,48 +2064,38 @@
[(return)
(use (reg:SI A0_REG))]
"reload_completed"
- "*
{
- return (TARGET_DENSITY ? \"retw.n\" : \"retw\");
-}"
+ return (TARGET_DENSITY ? "retw.n" : "retw");
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "2")])
-
-;;
-;; ....................
-;;
-;; MISC.
-;;
-;; ....................
-;;
+
+;; Miscellaneous instructions.
(define_expand "prologue"
[(const_int 0)]
""
- "
{
xtensa_expand_prologue ();
DONE;
-}")
+})
(define_expand "epilogue"
[(return)]
""
- "
{
emit_jump_insn (gen_return ());
DONE;
-}")
+})
(define_insn "nop"
[(const_int 0)]
""
- "*
{
- return (TARGET_DENSITY ? \"nop.n\" : \"nop\");
-}"
+ return (TARGET_DENSITY ? "nop.n" : "nop");
+}
[(set_attr "type" "nop")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -2325,16 +2106,15 @@
(match_operand:SI 2 "general_operand" "")
(match_operand:SI 3 "" "")]
""
- "
{
xtensa_expand_nonlocal_goto (operands);
DONE;
-}")
+})
;; Setting up a frame pointer is tricky for Xtensa because GCC doesn't
;; know if a frame pointer is required until the reload pass, and
;; because there may be an incoming argument value in the hard frame
-;; pointer register (a7). If there is an incoming argument in that
+;; pointer register (a7). If there is an incoming argument in that
;; register, the "set_frame_ptr" insn gets inserted immediately after
;; the insn that copies the incoming argument to a pseudo or to the
;; stack. This serves several purposes here: (1) it keeps the
@@ -2342,19 +2122,18 @@
;; incoming argument away from the beginning of the function; (2) we
;; can use a post-reload splitter to expand away the insn if a frame
;; pointer is not required, so that the post-reload scheduler can do
-;; the right thing; and (3) it makes it easy for xtensa_reorg() to
-;; search for this insn to determine whether it should add a new insn
+;; the right thing; and (3) it makes it easy for the prologue expander
+;; to search for this insn to determine whether it should add a new insn
;; to set up the frame pointer.
(define_insn "set_frame_ptr"
[(set (reg:SI A7_REG) (unspec_volatile:SI [(const_int 0)] UNSPECV_SET_FP))]
""
- "*
{
if (frame_pointer_needed)
- return \"mov\\ta7, sp\";
- return \"\";
-}"
+ return "mov\ta7, sp";
+ return "";
+}
[(set_attr "type" "move")
(set_attr "mode" "SI")
(set_attr "length" "3")])
@@ -2379,7 +2158,6 @@
;; The fix_return_addr pattern sets the high 2 bits of an address in a
;; register to match the high bits of the current PC.
-
(define_insn "fix_return_addr"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(match_operand:SI 1 "register_operand" "r")]
@@ -2387,22 +2165,14 @@
(clobber (match_scratch:SI 2 "=r"))
(clobber (match_scratch:SI 3 "=r"))]
""
- "mov\\t%2, a0\;call0\\t0f\;.align\\t4\;0:\;mov\\t%3, a0\;mov\\ta0, %2\;\
-srli\\t%3, %3, 30\;slli\\t%0, %1, 2\;ssai\\t2\;src\\t%0, %3, %0"
+ "mov\t%2, a0\;call0\t0f\;.align\t4\;0:\;mov\t%3, a0\;mov\ta0, %2\;\
+srli\t%3, %3, 30\;slli\t%0, %1, 2\;ssai\t2\;src\t%0, %3, %0"
[(set_attr "type" "multi")
(set_attr "mode" "SI")
(set_attr "length" "24")])
-
-;;
-;; ....................
-;;
-;; BOOLEANS
-;;
-;; ....................
-;;
-
-;; branch patterns
+
+;; Instructions for the Xtensa "boolean" option.
(define_insn "*booltrue"
[(set (pc)
@@ -2412,13 +2182,12 @@ srli\\t%3, %3, 30\;slli\\t%0, %1, 2\;ssai\\t2\;src\\t%0, %3, %0"
(label_ref (match_operand 1 "" ""))
(pc)))]
"TARGET_BOOLEANS"
- "*
{
if (GET_CODE (operands[2]) == EQ)
- return \"bf\\t%0, %1\";
+ return "bf\t%0, %1";
else
- return \"bt\\t%0, %1\";
-}"
+ return "bt\t%0, %1";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
@@ -2431,13 +2200,12 @@ srli\\t%3, %3, 30\;slli\\t%0, %1, 2\;ssai\\t2\;src\\t%0, %3, %0"
(pc)
(label_ref (match_operand 1 "" ""))))]
"TARGET_BOOLEANS"
- "*
{
if (GET_CODE (operands[2]) == EQ)
- return \"bt\\t%0, %1\";
+ return "bt\t%0, %1";
else
- return \"bf\\t%0, %1\";
-}"
+ return "bf\t%0, %1";
+}
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "3")])
diff --git a/gcc/configure b/gcc/configure
index 798361b7ec4..16a86d7400c 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -34,7 +34,7 @@ ac_help="$ac_help
--enable-checking[=LIST]
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
- Categories are: misc,tree,rtl,rtlflag,gc,gcac;
+ Categories are: misc,tree,rtl,rtlflag,gc,gcac,fold;
default is misc,tree,gc,rtlflag"
ac_help="$ac_help
--enable-coverage[=LEVEL]
@@ -46,8 +46,6 @@ ac_help="$ac_help
ac_help="$ac_help
--with-stabs arrange to use stabs instead of host debug format"
ac_help="$ac_help
- --with-elf arrange to use ELF instead of host debug format"
-ac_help="$ac_help
--enable-multilib enable library support for multiple ABIs"
ac_help="$ac_help
--enable-__cxa_atexit enable __cxa_atexit for C++"
@@ -64,6 +62,8 @@ ac_help="$ac_help
ac_help="$ac_help
--with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR."
ac_help="$ac_help
+ --enable-intermodule build the compiler in one step"
+ac_help="$ac_help
--with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
ac_help="$ac_help
--enable-initfini-array use .init_array/.fini_array sections"
@@ -1931,6 +1931,7 @@ ac_rtl_checking=
ac_rtlflag_checking=
ac_gc_checking=
ac_gc_always_collect=
+ac_fold_checking=
case "${enableval}" in
yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;
ac_rtlflag_checking=1 ;;
@@ -1947,6 +1948,7 @@ no) ;;
rtl) ac_rtl_checking=1 ;;
gc) ac_gc_checking=1 ;;
gcac) ac_gc_always_collect=1 ;;
+ fold) ac_fold_checking=1 ;;
valgrind) ac_checking_valgrind=1 ;;
*) { echo "configure: error: unknown check category $check" 1>&2; exit 1; } ;;
esac
@@ -1998,15 +2000,21 @@ if test x$ac_gc_always_collect != x ; then
EOF
fi
+if test x$ac_fold_checking != x ; then
+ cat >> confdefs.h <<\EOF
+#define ENABLE_FOLD_CHECKING 1
+EOF
+
+fi
valgrind_path_defines=
valgrind_command=
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:2008: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
+echo "configure:2016: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
cat > conftest.$ac_ext <<EOF
-#line 2010 "configure"
+#line 2018 "configure"
#include "confdefs.h"
#include <memcheck.h>
#ifndef VALGRIND_DISCARD
@@ -2014,7 +2022,7 @@ echo "configure:2008: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
#endif
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2026: \"$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*
@@ -2030,17 +2038,17 @@ rm -f conftest*
echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6
ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6
-echo "configure:2034: checking for valgrind.h" >&5
+echo "configure:2042: 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 2039 "configure"
+#line 2047 "configure"
#include "confdefs.h"
#include <valgrind.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2052: \"$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*
@@ -2094,7 +2102,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:2098: checking for $ac_word" >&5
+echo "configure:2106: 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
@@ -2181,16 +2189,6 @@ else
fi
-# With ELF
-# Check whether --with-elf or --without-elf was given.
-if test "${with_elf+set}" = set; then
- withval="$with_elf"
- elf="$with_elf"
-else
- elf=no
-fi
-
-
# Determine whether or not multilibs are enabled.
# Check whether --enable-multilib or --disable-multilib was given.
if test "${enable_multilib+set}" = set; then
@@ -2330,12 +2328,26 @@ fi
+# Build with intermodule optimisations
+# Check whether --enable-intermodule or --disable-intermodule was given.
+if test "${enable_intermodule+set}" = set; then
+ enableval="$enable_intermodule"
+ case ${enable_intermodule} in
+ yes) onestep="-onestep";;
+ *) onestep="";;
+esac
+else
+ onestep=""
+fi
+
+
+
# -------------------------
# Checks for other programs
# -------------------------
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:2339: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2351: 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
@@ -2368,7 +2380,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:2372: checking for $ac_word" >&5
+echo "configure:2384: 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
@@ -2398,7 +2410,7 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:2402: checking whether ln works" >&5
+echo "configure:2414: 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
@@ -2430,7 +2442,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2434: checking whether ln -s works" >&5
+echo "configure:2446: 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
@@ -2464,7 +2476,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:2468: checking for $ac_word" >&5
+echo "configure:2480: 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
@@ -2502,7 +2514,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:2506: checking for a BSD compatible install" >&5
+echo "configure:2518: 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
@@ -2552,11 +2564,37 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
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:2570: 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
+ echo abfoo >t1
+ echo cdfoo >t2
+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
+ gcc_cv_prog_cmp_skip=slowcompare
+ else
+ gcc_cv_prog_cmp_skip=gnucompare
+ fi
+ else
+ gcc_cv_prog_cmp_skip=slowcompare
+ fi
+ rm t1 t2
+
+fi
+
+echo "$ac_t""$gcc_cv_prog_cmp_skip" 1>&6
+make_compare_target=$gcc_cv_prog_cmp_skip
+
+
+
# See if we have the mktemp command.
# 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:2560: checking for $ac_word" >&5
+echo "configure:2598: 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
@@ -2595,7 +2633,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:2599: checking for $ac_word" >&5
+echo "configure:2637: 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
@@ -2624,13 +2662,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:2628: checking for modern makeinfo" >&5
+echo "configure:2666: 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:2634: version of makeinfo is $ac_prog_version" >&5
+ echo "configure:2672: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
4.[2-9]*)
@@ -2658,7 +2696,7 @@ fi
# Is pod2man recent enough to regenerate manpages?
echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
-echo "configure:2662: checking for recent Pod::Man" >&5
+echo "configure:2700: 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
@@ -2667,27 +2705,6 @@ else
GENERATED_MANPAGES=
fi
-# 'make compare' can be significantly faster, if cmp itself can
-# skip bytes instead of using tail. The test being performed is
-# "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
-# but we need to sink errors and handle broken shells.
-echo $ac_n "checking for cmp's capabilities""... $ac_c" 1>&6
-echo "configure:2676: checking for cmp's capabilities" >&5
-echo abfoo >t1
-echo cdfoo >t2
-if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
- make_compare_target=slowcompare
- else
- make_compare_target=gnucompare
- fi
-else
- make_compare_target=slowcompare
-fi
-rm t1 t2
-
-echo "$ac_t""$make_compare_target" 1>&6
-
# How about lex?
if test -f $srcdir/../flex/skel.c; then
FLEX='$(objdir)/../flex/flex'
@@ -2695,7 +2712,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:2699: checking for $ac_word" >&5
+echo "configure:2716: 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
@@ -2732,7 +2749,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:2736: checking for $ac_word" >&5
+echo "configure:2753: 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
@@ -2766,12 +2783,12 @@ fi
# --------------------
echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
-echo "configure:2770: checking for GNU C library" >&5
+echo "configure:2787: 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 2775 "configure"
+#line 2792 "configure"
#include "confdefs.h"
#include <features.h>
int main() {
@@ -2781,7 +2798,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:2785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_glibc=yes
else
@@ -2802,12 +2819,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2806: checking for ANSI C header files" >&5
+echo "configure:2823: 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 2811 "configure"
+#line 2828 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2815,7 +2832,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2836: \"$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*
@@ -2832,7 +2849,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 2836 "configure"
+#line 2853 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2850,7 +2867,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 2854 "configure"
+#line 2871 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2871,7 +2888,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2875 "configure"
+#line 2892 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2882,7 +2899,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2906,12 +2923,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2910: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2927: 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 2915 "configure"
+#line 2932 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2920,7 +2937,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -2941,19 +2958,19 @@ EOF
fi
echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6
-echo "configure:2945: checking for working stdbool.h" >&5
+echo "configure:2962: 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 2950 "configure"
+#line 2967 "configure"
#include "confdefs.h"
#include <stdbool.h>
int main() {
bool foo = false;
; return 0; }
EOF
-if { (eval echo configure:2957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_stdbool_h=yes
else
@@ -2974,12 +2991,12 @@ EOF
fi
echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:2978: checking whether string.h and strings.h may both be included" >&5
+echo "configure:2995: 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 2983 "configure"
+#line 3000 "configure"
#include "confdefs.h"
#include <string.h>
#include <strings.h>
@@ -2987,7 +3004,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:2991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_string=yes
else
@@ -3008,12 +3025,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:3012: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:3029: 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 3017 "configure"
+#line 3034 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -3029,7 +3046,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:3033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -3056,17 +3073,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:3060: checking for $ac_hdr" >&5
+echo "configure:3077: 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 3065 "configure"
+#line 3082 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3087: \"$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*
@@ -3096,17 +3113,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:3100: checking for thread.h" >&5
+echo "configure:3117: 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 3105 "configure"
+#line 3122 "configure"
#include "confdefs.h"
#include <thread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3127: \"$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*
@@ -3130,17 +3147,17 @@ fi
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:3134: checking for pthread.h" >&5
+echo "configure:3151: 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 3139 "configure"
+#line 3156 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3161: \"$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*
@@ -3165,12 +3182,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:3169: checking for CHAR_BIT" >&5
+echo "configure:3186: 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 3174 "configure"
+#line 3191 "configure"
#include "confdefs.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -3195,7 +3212,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:3199: checking number of bits in a byte" >&5
+echo "configure:3216: 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
@@ -3203,7 +3220,7 @@ else
gcc_cv_c_nbby=
while test $i -lt 65; do
cat > conftest.$ac_ext <<EOF
-#line 3207 "configure"
+#line 3224 "configure"
#include "confdefs.h"
int main() {
@@ -3213,7 +3230,7 @@ switch(0) {
; }
; return 0; }
EOF
-if { (eval echo configure:3217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_nbby=$i; break
else
@@ -3238,14 +3255,14 @@ EOF
fi
fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3242: checking whether byte ordering is bigendian" >&5
+echo "configure:3259: 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 3249 "configure"
+#line 3266 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3256,11 +3273,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3277: \"$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 3264 "configure"
+#line 3281 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3271,7 +3288,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3291,7 +3308,7 @@ if test "$cross_compiling" = yes; then
echo $ac_n "cross-compiling... " 2>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3295 "configure"
+#line 3312 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3304,7 +3321,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3325: \"$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
@@ -3322,7 +3339,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:3326: checking to probe for byte ordering" >&5
+echo "configure:3343: checking to probe for byte ordering" >&5
cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -3402,7 +3419,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:3406: checking for collect2 libraries" >&5
+echo "configure:3423: 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
@@ -3413,7 +3430,7 @@ for libs in '' -lld -lmld \
do
LIBS="$libs"
cat > conftest.$ac_ext <<EOF
-#line 3417 "configure"
+#line 3434 "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
@@ -3424,7 +3441,7 @@ int main() {
ldopen()
; return 0; }
EOF
-if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3445: \"$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
@@ -3450,14 +3467,14 @@ save_LIBS="$LIBS"
LIBS=
echo $ac_n "checking for library containing exc_resume""... $ac_c" 1>&6
-echo "configure:3454: checking for library containing exc_resume" >&5
+echo "configure:3471: 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 3461 "configure"
+#line 3478 "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
@@ -3468,7 +3485,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3489: \"$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
@@ -3479,7 +3496,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 3483 "configure"
+#line 3500 "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
@@ -3490,7 +3507,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3511: \"$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
@@ -3520,14 +3537,14 @@ save_LIBS="$LIBS"
LIBS=
echo $ac_n "checking for library containing ldexp""... $ac_c" 1>&6
-echo "configure:3524: checking for library containing ldexp" >&5
+echo "configure:3541: 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 3531 "configure"
+#line 3548 "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
@@ -3538,7 +3555,7 @@ int main() {
ldexp()
; return 0; }
EOF
-if { (eval echo configure:3542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3559: \"$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
@@ -3549,7 +3566,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 3553 "configure"
+#line 3570 "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
@@ -3560,7 +3577,7 @@ int main() {
ldexp()
; return 0; }
EOF
-if { (eval echo configure:3564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3581: \"$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
@@ -3587,12 +3604,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:3591: checking for inttypes.h" >&5
+echo "configure:3608: 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 3596 "configure"
+#line 3613 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -3600,7 +3617,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:3604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_inttypes_h=yes
else
@@ -3623,17 +3640,17 @@ fi
for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \
sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
- fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
+ fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \
scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \
setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3632: checking for $ac_func" >&5
+echo "configure:3649: 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 3637 "configure"
+#line 3654 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3656,7 +3673,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3677: \"$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
@@ -3683,7 +3700,7 @@ done
if test x$ac_cv_func_mbstowcs = xyes; then
echo $ac_n "checking whether mbstowcs works""... $ac_c" 1>&6
-echo "configure:3687: checking whether mbstowcs works" >&5
+echo "configure:3704: 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
@@ -3691,7 +3708,7 @@ else
gcc_cv_func_mbstowcs_works=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3695 "configure"
+#line 3712 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main()
@@ -3700,7 +3717,7 @@ int main()
return 0;
}
EOF
-if { (eval echo configure:3704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3721: \"$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
@@ -3724,12 +3741,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:3728: checking for ssize_t" >&5
+echo "configure:3745: 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 3733 "configure"
+#line 3750 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3760,12 +3777,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:3764: checking for uid_t in sys/types.h" >&5
+echo "configure:3781: 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 3769 "configure"
+#line 3786 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3794,7 +3811,7 @@ EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:3798: checking type of array argument to getgroups" >&5
+echo "configure:3815: 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
@@ -3802,7 +3819,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 3806 "configure"
+#line 3823 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -3827,7 +3844,7 @@ main()
}
EOF
-if { (eval echo configure:3831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3848: \"$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
@@ -3841,7 +3858,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 3845 "configure"
+#line 3862 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -3882,7 +3899,7 @@ fi
echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:3886: checking whether the printf functions support %p" >&5
+echo "configure:3903: 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
@@ -3890,7 +3907,7 @@ else
gcc_cv_func_printf_ptr=no
else
cat > conftest.$ac_ext <<EOF
-#line 3894 "configure"
+#line 3911 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3903,7 +3920,7 @@ int main()
return (p != q);
}
EOF
-if { (eval echo configure:3907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3924: \"$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
@@ -3933,7 +3950,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:3937: checking whether read-only mmap of a plain file works" >&5
+echo "configure:3954: 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
@@ -3952,7 +3969,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:3956: checking whether mmap from /dev/zero works" >&5
+echo "configure:3973: 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
@@ -3978,12 +3995,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:3982: checking for MAP_ANON(YMOUS)" >&5
+echo "configure:3999: 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 3987 "configure"
+#line 4004 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/mman.h>
@@ -3997,7 +4014,7 @@ int main() {
int n = MAP_ANONYMOUS;
; return 0; }
EOF
-if { (eval echo configure:4001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_decl_map_anon=yes
else
@@ -4015,7 +4032,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:4019: checking whether mmap with MAP_ANON(YMOUS) works" >&5
+echo "configure:4036: 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
@@ -4070,12 +4087,12 @@ case "${host}" in
;;
esac
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:4074: checking for pid_t" >&5
+echo "configure:4091: 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 4079 "configure"
+#line 4096 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4104,17 +4121,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:4108: checking for vfork.h" >&5
+echo "configure:4125: 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 4113 "configure"
+#line 4130 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4118: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4135: \"$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*
@@ -4139,18 +4156,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:4143: checking for working vfork" >&5
+echo "configure:4160: 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:4149: checking for vfork" >&5
+echo "configure:4166: 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 4154 "configure"
+#line 4171 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -4173,7 +4190,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:4177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4194: \"$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
@@ -4195,7 +4212,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 4199 "configure"
+#line 4216 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -4290,7 +4307,7 @@ main() {
}
}
EOF
-if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4311: \"$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
@@ -4329,7 +4346,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:4333: checking for iconv" >&5
+echo "configure:4350: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4337,7 +4354,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 4341 "configure"
+#line 4358 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4347,7 +4364,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -4359,7 +4376,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 4363 "configure"
+#line 4380 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4369,7 +4386,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4390: \"$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
@@ -4390,13 +4407,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:4394: checking for iconv declaration" >&5
+echo "configure:4411: 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 4400 "configure"
+#line 4417 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -4415,7 +4432,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -4448,19 +4465,19 @@ LIBICONV_DEP=
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:4452: checking for LC_MESSAGES" >&5
+echo "configure:4469: 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 4457 "configure"
+#line 4474 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:4464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4481: \"$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
@@ -4491,12 +4508,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:4495: checking whether $ac_func is declared" >&5
+echo "configure:4512: 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 4500 "configure"
+#line 4517 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4510,7 +4527,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4612,12 +4629,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:4616: checking whether $ac_func is declared" >&5
+echo "configure:4633: 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 4621 "configure"
+#line 4638 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4635,7 +4652,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4674,7 +4691,7 @@ fi
cat > conftest.$ac_ext <<EOF
-#line 4678 "configure"
+#line 4695 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4687,7 +4704,7 @@ int main() {
rlim_t l = 0;
; return 0; }
EOF
-if { (eval echo configure:4691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5
@@ -4704,12 +4721,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:4708: checking whether $ac_func is declared" >&5
+echo "configure:4725: 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 4713 "configure"
+#line 4730 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4727,7 +4744,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4763,12 +4780,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:4767: checking whether $ac_func is declared" >&5
+echo "configure:4784: 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 4772 "configure"
+#line 4789 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4786,7 +4803,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4820,13 +4837,13 @@ fi
# More time-related stuff.
echo $ac_n "checking for struct tms""... $ac_c" 1>&6
-echo "configure:4824: checking for struct tms" >&5
+echo "configure:4841: 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 4830 "configure"
+#line 4847 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4839,7 +4856,7 @@ int main() {
struct tms tms;
; return 0; }
EOF
-if { (eval echo configure:4843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tms=yes
else
@@ -4862,13 +4879,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:4866: checking for clock_t" >&5
+echo "configure:4883: 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 4872 "configure"
+#line 4889 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4878,7 +4895,7 @@ int main() {
clock_t x;
; return 0; }
EOF
-if { (eval echo configure:4882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_type_clock_t=yes
else
@@ -4899,12 +4916,12 @@ EOF
fi
echo $ac_n "checking for uchar""... $ac_c" 1>&6
-echo "configure:4903: checking for uchar" >&5
+echo "configure:4920: 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 4908 "configure"
+#line 4925 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4915,7 +4932,7 @@ if ((uchar *)0) return 0;
if (sizeof(uchar)) return 0;
; return 0; }
EOF
-if { (eval echo configure:4919: \"$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_type_uchar=yes
else
@@ -4945,7 +4962,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:4949: checking for .preinit_array/.init_array/.fini_array support" >&5
+echo "configure:4966: 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
@@ -4953,7 +4970,7 @@ else
gcc_cv_initfini_array=no
else
cat > conftest.$ac_ext <<EOF
-#line 4957 "configure"
+#line 4974 "configure"
#include "confdefs.h"
static int x = -1;
@@ -4961,7 +4978,7 @@ int main (void) { return x; }
int foo (void) { x = 0; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
EOF
-if { (eval echo configure:4965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4982: \"$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
@@ -4989,12 +5006,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:4993: checking if mkdir takes one argument" >&5
+echo "configure:5010: 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 4998 "configure"
+#line 5015 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -5011,7 +5028,7 @@ int main() {
mkdir ("foo", 0);
; return 0; }
EOF
-if { (eval echo configure:5015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_mkdir_takes_one_arg=no
else
@@ -5051,7 +5068,7 @@ fi
echo $ac_n "checking for main in -lunwind""... $ac_c" 1>&6
-echo "configure:5055: checking for main in -lunwind" >&5
+echo "configure:5072: 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
@@ -5059,14 +5076,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lunwind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5063 "configure"
+#line 5080 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5070: \"$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*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5107,21 +5124,16 @@ fi
# Build, host, and target specific configuration fragments
# --------------------------------------------------------
+# Collect build-machine-specific information.
+. ${srcdir}/config.build
+
+# Collect host-machine-specific information.
+. ${srcdir}/config.host
+
target_gtfiles=
-build_xm_file=
-build_xm_defines=
-build_install_headers_dir=install-headers-tar
-build_exeext=
-host_xm_file=
-host_xm_defines=
-host_xmake_file=
-host_exeext=
-
-# Decode the host machine, then the target machine.
-# For the host machine, we save the xm_file variable as host_xm_file;
-# then we decode the target machine and forget everything else
-# that came from the host machine.
-for machine in $build $host $target; do
+
+# Collect target-machine-specific information.
+for machine in $target ; do
. ${srcdir}/config.gcc
done
@@ -5256,7 +5268,7 @@ if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
extra_modes_file='$(srcdir)'/config/${extra_modes}
cat >> confdefs.h <<EOF
-#define EXTRA_MODES_FILE "$extra_modes"
+#define EXTRA_MODES_FILE "config/$extra_modes"
EOF
cat >> confdefs.h <<\EOF
@@ -5332,9 +5344,18 @@ if test -f configargs.h ; then
else
gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
fi
+
+# Double all backslashes and backslash all quotes to turn
+# gcc_config_arguments into a C string.
+sed -e 's/\\/\\\\/g; s/"/\\"/g' <<EOF >conftest.out
+$gcc_config_arguments
+EOF
+gcc_config_arguments_str=`cat conftest.out`
+rm -f conftest.out
+
cat > configargs.h <<EOF
/* Generated automatically. */
-static const char configuration_arguments[] = "$gcc_config_arguments";
+static const char configuration_arguments[] = "$gcc_config_arguments_str";
static const char thread_model[] = "$thread_file";
static const struct {
@@ -5361,7 +5382,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:5365: checking whether NLS is requested" >&5
+echo "configure:5386: checking whether NLS is requested" >&5
if test x"$USE_NLS" != xyes; then
echo "$ac_t""no" 1>&6
else
@@ -5372,7 +5393,7 @@ EOF
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:5376: checking for catalogs to be installed" >&5
+echo "configure:5397: checking for catalogs to be installed" >&5
# Look for .po and .gmo files in the source directory.
CATALOGS=
XLINGUAS=
@@ -5422,7 +5443,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:5426: checking whether windows registry support is requested" >&5
+echo "configure:5447: 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
@@ -5431,14 +5452,14 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
-echo "configure:5435: checking for library containing RegOpenKeyExA" >&5
+echo "configure:5456: 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 5442 "configure"
+#line 5463 "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
@@ -5449,7 +5470,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:5453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5474: \"$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
@@ -5460,7 +5481,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 5464 "configure"
+#line 5485 "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
@@ -5471,7 +5492,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:5475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5496: \"$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
@@ -5513,7 +5534,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:5517: checking registry key on windows hosts" >&5
+echo "configure:5538: checking registry key on windows hosts" >&5
cat >> confdefs.h <<EOF
#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
EOF
@@ -5530,30 +5551,25 @@ topdir=`${PWDCMD-pwd}`
cd $holddir
# Conditionalize the makefile for this host machine.
-# Make-host contains the concatenation of all host makefile fragments
-# [there can be more than one]. This file is built by configure.frag.
-host_overrides=Make-host
-dep_host_xmake_file=
-for f in .. ${host_xmake_file}
+xmake_file=
+for f in ${host_xmake_file}
do
if test -f ${srcdir}/config/$f
then
- dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
+ xmake_file="${xmake_file} \$(srcdir)/config/$f"
fi
done
# Conditionalize the makefile for this target machine.
-# Make-target contains the concatenation of all host makefile fragments
-# [there can be more than one]. This file is built by configure.frag.
-target_overrides=Make-target
-dep_tmake_file=
-for f in .. ${tmake_file}
+tmake_file_=
+for f in ${tmake_file}
do
if test -f ${srcdir}/config/$f
then
- dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
+ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
fi
done
+tmake_file="${tmake_file_}"
symbolic_link='ln -s'
@@ -5585,35 +5601,69 @@ rm -f symtest.tem
out_object_file=`basename $out_file .c`.o
tm_file_list=
+tm_include_list=
for f in $tm_file; do
case $f in
- ansidecl.h )
- tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
defaults.h )
- tm_file_list="${tm_file_list} \$(srcdir)/$f" ;;
- *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
+ tm_file_list="${tm_file_list} \$(srcdir)/$f"
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+ tm_include_list="${tm_include_list} config/$f"
+ ;;
esac
done
tm_p_file_list=
+tm_p_include_list=
for f in $tm_p_file; do
case $f in
tm-preds.h )
- tm_p_file_list="${tm_p_file_list} $f" ;;
- *) tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" ;;
+ tm_p_file_list="${tm_p_file_list} $f"
+ tm_p_include_list="${tm_p_include_list} $f"
+ ;;
+ * )
+ tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+ tm_p_include_list="${tm_p_include_list} config/$f"
+ esac
+done
+
+xm_file_list=
+xm_include_list=
+for f in $xm_file; do
+ case $f in
+ ansidecl.h )
+ xm_file_list="${xm_file_list} \$(srcdir)/../include/$f"
+ xm_include_list="${xm_include_list} $f"
+ ;;
+ auto-host.h )
+ xm_file_list="${xm_file_list} $f"
+ xm_include_list="${xm_include_list} $f"
+ ;;
+ * )
+ xm_file_list="${xm_file_list} \$(srcdir)/config/$f"
+ xm_include_list="${xm_include_list} config/$f"
+ ;;
esac
done
host_xm_file_list=
+host_xm_include_list=
for f in $host_xm_file; do
case $f in
ansidecl.h )
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/$f"
+ host_xm_include_list="${host_xm_include_list} $f"
+ ;;
auto-host.h )
- host_xm_file_list="${host_xm_file_list} $f" ;;
- defaults.h )
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
- *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
+ host_xm_file_list="${host_xm_file_list} $f"
+ host_xm_include_list="${host_xm_include_list} $f"
+ ;;
+ * )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
+ host_xm_include_list="${host_xm_include_list} config/$f"
+ ;;
esac
done
@@ -5621,12 +5671,17 @@ build_xm_file_list=
for f in $build_xm_file; do
case $f in
ansidecl.h )
- build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/$f"
+ build_xm_include_list="${build_xm_include_list} $f"
+ ;;
auto-build.h | auto-host.h )
- build_xm_file_list="${build_xm_file_list} $f" ;;
- defaults.h )
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
- *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
+ build_xm_file_list="${build_xm_file_list} $f"
+ build_xm_include_list="${build_xm_include_list} $f"
+ ;;
+ * )
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
+ build_xm_include_list="${build_xm_include_list} config/$f"
+ ;;
esac
done
@@ -5641,6 +5696,21 @@ then
ALL=all.cross
SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
case "$host","$target" in
+ # Darwin crosses can use the host system's libraries and headers,
+ # because of the fat library support. Of course, it must be the
+ # same version of Darwin on both sides. Allow the user to
+ # just say --target=foo-darwin without a version number to mean
+ # "the version on this system".
+ *-*-darwin*,*-*-darwin*)
+ hostos=`echo $host | sed 's/.*-darwin/darwin/'`
+ targetos=`echo $target | sed 's/.*-darwin/darwin/'`
+ if test $hostos = $targetos -o $targetos = darwin ; then
+ CROSS=
+ SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'
+ with_headers=yes
+ fi
+ ;;
+
i?86-*-*,x86_64-*-* \
| powerpc*-*-*,powerpc64*-*-*)
CROSS="$CROSS -DNATIVE_CROSS" ;;
@@ -5661,7 +5731,7 @@ fi
inhibit_libc=
if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
test x$with_newlib = xyes ; } &&
- test "x$with_headers" = x ; then
+ { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
inhibit_libc=-Dinhibit_libc
fi
@@ -5723,7 +5793,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:5727: checking what assembler to use" >&5
+echo "configure:5797: checking what assembler to use" >&5
in_tree_gas=no
gcc_cv_as=
gcc_cv_gas_major_version=
@@ -5753,6 +5823,12 @@ done
gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
+case $gcc_cv_gas_patch_version in
+ "") gcc_cv_gas_patch_version="0" ;;
+esac
+gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
+ + $gcc_cv_gas_minor_version \) \* 1000 \
+ + $gcc_cv_gas_patch_version`
rm -f as$host_exeext
$symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
@@ -5841,7 +5917,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:5845: checking what linker to use" >&5
+echo "configure:5921: checking what linker to use" >&5
in_tree_ld=no
gcc_cv_ld=
gcc_cv_gld_major_version=
@@ -5949,7 +6025,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:5953: checking what nm to use" >&5
+echo "configure:6029: checking what nm to use" >&5
in_tree_nm=no
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
@@ -5972,7 +6048,7 @@ esac
# Figure out what objdump we will be using.
echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
-echo "configure:5976: checking what objdump to use" >&5
+echo "configure:6052: checking what objdump to use" >&5
in_tree_objdump=no
if test -x objdump$host_exeext; then
gcc_cv_objdump=./objdump$host_exeext
@@ -5996,305 +6072,307 @@ case $in_tree_objdump in
esac
# Figure out what assembler alignment features are present.
-echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:6001: checking assembler alignment features" >&5
-gcc_cv_as_alignment_features=none
-if test $in_tree_gas = yes; then
- # Gas version 2.6 and later support for .balign and .p2align.
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 6 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
+echo $ac_n "checking assembler for .balign and .p2align""... $ac_c" 1>&6
+echo "configure:6077: 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
+ gcc_cv_as_balign_and_p2align=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 6 \) \* 1000 + 0`
+ then gcc_cv_as_balign_and_p2align=yes
+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:6089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_balign_and_p2align=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
- gcc_cv_as_alignment_features=".balign and .p2align"
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_balign_and_p2align" 1>&6
+if test $gcc_cv_as_balign_and_p2align = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
EOF
-
-
fi
- # Gas version 2.8 and later support specifying the maximum
- # bytes to skip when using .p2align.
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 8 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- gcc_cv_as_alignment_features=".p2align including maximum skip"
- cat >> confdefs.h <<\EOF
-#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
-EOF
-
-
-
+echo $ac_n "checking assembler for .p2align with maximum skip""... $ac_c" 1>&6
+echo "configure:6109: 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
+ gcc_cv_as_max_skip_p2align=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 8 \) \* 1000 + 0`
+ then gcc_cv_as_max_skip_p2align=yes
+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:6120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_max_skip_p2align=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-elif test x$gcc_cv_as != x; then
- # Check if we have .balign and .p2align
- echo ".balign 4" > conftest.s
- echo ".p2align 2" >> conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_alignment_features=".balign and .p2align"
- cat >> confdefs.h <<\EOF
-#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
-EOF
-
- fi
- rm -f conftest.s conftest.o
- # Check if specifying the maximum bytes to skip when
- # using .p2align is supported.
- echo ".p2align 4,,7" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_alignment_features=".p2align including maximum skip"
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_max_skip_p2align" 1>&6
+if test $gcc_cv_as_max_skip_p2align = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
EOF
- fi
- rm -f conftest.s conftest.o
fi
-echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
-
-echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:6062: checking assembler subsection support" >&5
-gcc_cv_as_subsections=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 9 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- test $in_tree_gas_is_elf = yes \
- && gcc_cv_as_subsections="working .subsection -1"
-
+echo $ac_n "checking assembler for working .subsection -1""... $ac_c" 1>&6
+echo "configure:6140: 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
+ gcc_cv_as_subsection_m1=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 9 \) \* 1000 + 0`
+ then gcc_cv_as_subsection_m1=yes
fi
-
-elif test x$gcc_cv_as != x; then
- # Check if we have .subsection
- echo ".subsection 1" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_subsections=".subsection"
- if test x$gcc_cv_nm != x; then
- cat > conftest.s <<EOF
-conftest_label1: .word 0
+ elif test x$gcc_cv_as != x; then
+ echo 'conftest_label1: .word 0
.subsection -1
conftest_label2: .word 0
-.previous
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
- $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
- if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
- :
- else
- gcc_cv_as_subsections="working .subsection -1"
- fi
- fi
- fi
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+.previous' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6155: \"$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
+ $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
+ if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1
+ then :
+ else gcc_cv_as_subsection_m1=yes
+ fi
+ rm -f conftest.nm1 conftest.nm2
+ fi
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-if test x"$gcc_cv_as_subsections" = x"working .subsection -1"; then
- cat >> confdefs.h <<\EOF
+
+echo "$ac_t""$gcc_cv_as_subsection_m1" 1>&6
+if test $gcc_cv_as_subsection_m1 = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_GAS_SUBSECTION_ORDERING 1
EOF
fi
-echo "$ac_t""$gcc_cv_as_subsections" 1>&6
-
-echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
-echo "configure:6110: checking assembler weak support" >&5
-gcc_cv_as_weak=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 2 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- gcc_cv_as_weak="yes"
-
+echo $ac_n "checking assembler for .weak""... $ac_c" 1>&6
+echo "configure:6183: 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
+ gcc_cv_as_weak=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 2 \) \* 1000 + 0`
+ then gcc_cv_as_weak=yes
fi
-
-elif test x$gcc_cv_as != x; then
- # Check if we have .weak
- echo " .weak foobar" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_weak="yes"
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+ 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:6194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_weak=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-if test x"$gcc_cv_as_weak" = xyes; then
- cat >> confdefs.h <<\EOF
+
+echo "$ac_t""$gcc_cv_as_weak" 1>&6
+if test $gcc_cv_as_weak = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_GAS_WEAK 1
EOF
fi
-echo "$ac_t""$gcc_cv_as_weak" 1>&6
-
-echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
-echo "configure:6140: checking assembler hidden support" >&5
-gcc_cv_as_hidden=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& (test $gcc_cv_gas_minor_version -gt 12 \
- || (test $gcc_cv_gas_minor_version -eq 12 \
- && test $gcc_cv_gas_patch_version -ge 1 )) \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
+# .hidden needs to be supported in both the assembler and the linker,
+# because GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
+# This is irritatingly difficult to feature test for; we have to check the
+# date string after the version number. If we've got an in-tree
+# ld, we don't know its patchlevel version, so we set the baseline at 2.13
+# 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:6221: 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
+ gcc_cv_as_hidden=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 13 \) \* 1000 + 0`
+ then gcc_cv_as_hidden=yes
+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:6234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_hidden=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
- test $in_tree_gas_is_elf = yes && gcc_cv_as_hidden="yes"
-
+echo "$ac_t""$gcc_cv_as_hidden" 1>&6
-fi
-elif test x$gcc_cv_as != x; then
- # Check if we have .hidden
- echo " .hidden foobar" > conftest.s
- echo "foobar:" >> conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_hidden="yes"
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
-
- # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
- # This is irritatingly difficult to feature test for. Look for
- # the date string after the version number.
- ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
- if echo "$ld_ver" | grep GNU > /dev/null; then
- ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'`
- ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
- if test 0"$ld_date" -lt 20020404; then
- if test -n "$ld_date"; then
- # If there was date string, but was earlier than 2002-04-04, fail
- gcc_cv_as_hidden="no"
- elif test -z "$ld_vers"; then
- # If there was no date string nor ld version number, something is wrong
- gcc_cv_as_hidden="no"
- else
- ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
- ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
- ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
- test -z "$ld_vers_patch" && ld_vers_patch=0
- if test "$ld_vers_major" -lt 2; then
- gcc_cv_as_hidden="no"
- elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
- gcc_cv_as_hidden="no"
- elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 \
- -a "$ld_vers_patch" -eq 0; then
- gcc_cv_as_hidden="no"
- fi
- fi
- fi
+echo $ac_n "checking linker for .hidden support""... $ac_c" 1>&6
+echo "configure:6249: 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
+ if test $in_tree_ld = yes ; then
+ gcc_cv_ld_hidden=no
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 13 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_hidden=yes
+ fi
+else
+ gcc_cv_ld_hidden=yes
+ ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
+ if echo "$ld_ver" | grep GNU > /dev/null; then
+ ld_vers=`echo $ld_ver | sed -n \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'`
+ ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
+ if test 0"$ld_date" -lt 20020404; then
+ if test -n "$ld_date"; then
+ # If there was date string, but was earlier than 2002-04-04, fail
+ gcc_cv_ld_hidden=no
+ elif test -z "$ld_vers"; then
+ # If there was no date string nor ld version number, something is wrong
+ gcc_cv_ld_hidden=no
+ else
+ ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
+ ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
+ ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+ test -z "$ld_vers_patch" && ld_vers_patch=0
+ if test "$ld_vers_major" -lt 2; then
+ gcc_cv_ld_hidden=no
+ elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
+ gcc_cv_ld_hidden="no"
+ elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 -a "$ld_vers_patch" -eq 0; then
+ gcc_cv_ld_hidden=no
fi
-fi
-case "$target" in
- mips-sgi-irix6*)
- if test x"$gnu_ld_flag" = x"no"; then
- # Even if using gas with .hidden support, the resulting object files
- # cannot be linked with the IRIX 6 O32 linker. With the N32 and
- # N64 linkers, the problem is that the linker refuses to accept
- # -call_shared (passed by default to the linker) and -r (used to
- # link the object file generated without .hidden directives with
- # one that hides symbols), so we also lose.
- gcc_cv_as_hidden=no
+ fi
fi
- ;;
-esac
-if test x"$gcc_cv_as_hidden" = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_GAS_HIDDEN 1
-EOF
-
+ else
+ # non-GNU linkers don't seem to support .hidden yet
+ gcc_cv_ld_hidden=no
+ fi
+fi
fi
-echo "$ac_t""$gcc_cv_as_hidden" 1>&6
-libgcc_visibility=$gcc_cv_as_hidden
-
-
-echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
-echo "configure:6225: checking assembler leb128 support" >&5
-gcc_cv_as_leb128=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 11 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
+echo "$ac_t""$gcc_cv_ld_hidden" 1>&6
+libgcc_visibility=no
- test $in_tree_gas_is_elf = yes && gcc_cv_as_leb128="yes"
-
+if test $gcc_cv_as_hidden = yes && test $gcc_cv_ld_hidden = yes; then
+ libgcc_visibility=yes
+ cat >> confdefs.h <<\EOF
+#define HAVE_GAS_HIDDEN 1
+EOF
fi
-elif test x$gcc_cv_as != x; then
- # Check if we have .[us]leb128, and support symbol arithmetic with it.
- cat > conftest.s <<EOF
- .data
+# 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:6312: 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
+ gcc_cv_as_leb128=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
+ then gcc_cv_as_leb128=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ echo ' .data
.uleb128 L2 - L1
L1:
.uleb128 1280
.sleb128 -1010
-L2:
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_leb128="yes"
-
- # GAS versions before 2.11 do not support uleb128,
- # despite appearing to.
- # ??? There exists an elf-specific test that will crash
- # the assembler. Perhaps it's better to figure out whether
- # arbitrary sections are supported and try the test.
- as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
- if echo "$as_ver" | grep GNU > /dev/null; then
- as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
- as_major=`echo $as_ver | sed 's/\..*//'`
- as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
- if test $as_major -eq 2 -a $as_minor -lt 11; then
- gcc_cv_as_leb128="no"
- fi
- fi
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+L2:' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ # GAS versions before 2.11 do not support uleb128,
+ # despite appearing to.
+ # ??? There exists an elf-specific test that will crash
+ # the assembler. Perhaps it's better to figure out whether
+ # arbitrary sections are supported and try the test.
+ as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
+ if echo "$as_ver" | grep GNU > /dev/null; then
+ as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
+ as_major=`echo $as_ver | sed 's/\..*//'`
+ as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
+ if test $as_major -eq 2 && test $as_minor -lt 11
+ then :
+ else gcc_cv_as_leb128=yes
+ fi
+ fi
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-if test x"$gcc_cv_as_leb128" = xyes; then
- cat >> confdefs.h <<\EOF
+
+echo "$ac_t""$gcc_cv_as_leb128" 1>&6
+if test $gcc_cv_as_leb128 = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_LEB128 1
EOF
fi
-echo "$ac_t""$gcc_cv_as_leb128" 1>&6
-
-echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
-echo "configure:6277: checking assembler eh_frame optimization" >&5
-gcc_cv_as_eh_frame=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 12 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- test $in_tree_gas_is_elf = yes && gcc_cv_as_eh_frame="yes"
-
+# 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:6365: 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
+ gcc_cv_as_eh_frame=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
+ then gcc_cv_as_eh_frame=yes
fi
-
-elif test x$gcc_cv_as != x; then
- # Check if this is GAS.
- as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
- rm -f a.out 2> /dev/null
- if echo "$as_ver" | grep GNU > /dev/null; then
- # Versions up to and including 2.11.0 may mis-optimize
- # .eh_frame data. Try something.
- cat > conftest.s <<EOF
- .text
+ elif test x$gcc_cv_as != x; then
+ echo ' .text
.LFB1:
.4byte 0
.L1:
@@ -6325,74 +6403,85 @@ __FRAME_BEGIN__:
.4byte .LFE1-.LFB1
.byte 0x4
.4byte .L1-.LFB1
-.LEFDE1:
-EOF
- cat > conftest.lit <<EOF
+.LEFDE1:' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ cat > conftest.lit <<EOF
0000 10000000 00000000 017a0001 781a0004 .........z..x...
0010 01000000 12000000 18000000 00000000 ................
0020 08000000 04080000 0044 .........D
EOF
- cat > conftest.big <<EOF
+ cat > conftest.big <<EOF
0000 00000010 00000000 017a0001 781a0004 .........z..x...
0010 00000001 00000012 00000018 00000000 ................
0020 00000008 04000000 0844 .........D
EOF
- # If the assembler didn't choke, and we can objdump,
- # and we got the correct data, then succeed.
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
- && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
- | tail -3 > conftest.got \
- && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
- || cmp conftest.big conftest.got > /dev/null 2>&1; }
- then
- gcc_cv_as_eh_frame="yes"
- else
- gcc_cv_as_eh_frame="bad"
- if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
- cat >> confdefs.h <<\EOF
-#define USE_AS_TRADITIONAL_FORMAT 1
-EOF
-
- fi
- fi
- fi
- rm -f conftest.*
+ # If the assembler didn't choke, and we can objdump,
+ # and we got the correct data, then succeed.
+ if test x$gcc_cv_objdump != x \
+ && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
+ | tail -3 > conftest.got \
+ && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+ || cmp conftest.big conftest.got > /dev/null 2>&1; }
+ then
+ gcc_cv_as_eh_frame=yes
+ elif { ac_try='$gcc_cv_as -o conftest.o --traditional-format /dev/null'; { (eval echo configure:6429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ gcc_cv_as_eh_frame=buggy
+ else
+ # Uh oh, what do we do now?
+ gcc_cv_as_eh_frame=no
+ fi
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
-echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
-echo "configure:6365: checking assembler section merging support" >&5
-gcc_cv_as_shf_merge=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 12 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
+echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
- test $in_tree_gas_is_elf = yes && gcc_cv_as_shf_merge="yes"
-
+if test $gcc_cv_as_eh_frame = buggy; then
+ cat >> confdefs.h <<\EOF
+#define USE_AS_TRADITIONAL_FORMAT 1
+EOF
fi
-elif test x$gcc_cv_as != x; then
- # Check if we support SHF_MERGE sections
- echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
- if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_shf_merge=yes
- fi
- rm -f conftest.s conftest.o
+echo $ac_n "checking assembler for section merging support""... $ac_c" 1>&6
+echo "configure:6454: 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
+ gcc_cv_as_shf_merge=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
+ then gcc_cv_as_shf_merge=yes
+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:6466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_shf_merge=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-if test x"$gcc_cv_as_shf_merge" = xyes; then
- cat >> confdefs.h <<\EOF
+
+echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
+if test $gcc_cv_as_shf_merge = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_GAS_SHF_MERGE 1
EOF
fi
-echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
-echo $ac_n "checking assembler thread-local storage support""... $ac_c" 1>&6
-echo "configure:6395: checking assembler thread-local storage support" >&5
-gcc_cv_as_tls=no
+# Thread-local storage - the check is heavily parametrized.
conftest_s=
tls_first_major=
tls_first_minor=
@@ -6567,60 +6656,86 @@ foo: .long 25
tls_first_minor=14
tls_as_opt="-m64 -Aesame"
;;
+ sparc*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+foo: .long 25
+ .text
+ sethi %tgd_hi22(foo), %o0
+ add %o0, %tgd_lo10(foo), %o1
+ add %l7, %o1, %o0, %tgd_add(foo)
+ call __tls_get_addr, %tgd_call(foo)
+ sethi %tldm_hi22(foo), %l1
+ add %l1, %tldm_lo10(foo), %l2
+ add %l7, %l2, %o0, %tldm_add(foo)
+ call __tls_get_addr, %tldm_call(foo)
+ sethi %tldo_hix22(foo), %l3
+ xor %l3, %tldo_lox10(foo), %l4
+ add %o0, %l4, %l5, %tldo_add(foo)
+ sethi %tie_hi22(foo), %o3
+ add %o3, %tie_lo10(foo), %o3
+ ld [%l7 + %o3], %o2, %tie_ld(foo)
+ add %g7, %o2, %o4, %tie_add(foo)
+ sethi %tle_hix22(foo), %l1
+ xor %l1, %tle_lox10(foo), %o5
+ ld [%g7 + %o5], %o1'
+ tls_first_major=2
+ tls_first_minor=14
+ tls_as_opt=-32
+ ;;
esac
if test -z "$tls_first_major"; then
- :
-elif test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq $tls_first_major \
-&& test $gcc_cv_gas_minor_version -ge $tls_first_minor \
-|| test $gcc_cv_gas_major_version -gt $tls_first_major ; then
-
-
- gcc_cv_as_tls=yes
-
-
+ : # 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:6692: 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
+ gcc_cv_as_tls=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( $tls_first_major \* 1000 \) + $tls_first_minor \) \* 1000 + 0`
+ then gcc_cv_as_tls=yes
fi
-
-elif test x$gcc_cv_as != x; then
- echo "$conftest_s" > conftest.s
- if $gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
- then
- gcc_cv_as_tls=yes
+ 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:6703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_tls=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
fi
- rm -f conftest.s conftest.o
fi
-if test "$gcc_cv_as_tls" = yes; then
+
+echo "$ac_t""$gcc_cv_as_tls" 1>&6
+if test $gcc_cv_as_tls = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_AS_TLS 1
EOF
fi
-echo "$ac_t""$gcc_cv_as_tls" 1>&6
+fi
+
+# Target-specific assembler checks.
case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
- echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6
-echo "configure:6605: checking assembler supports explicit relocations" >&5
-if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then
+ echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6
+echo "configure:6729: 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
-
- gcc_cv_as_explicit_relocs=unknown
- if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 12 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- gcc_cv_as_explicit_relocs=yes
-
-
+ gcc_cv_as_alpha_explicit_relocs=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
+ then gcc_cv_as_alpha_explicit_relocs=yes
fi
-
- elif test x$gcc_cv_as != x; then
- cat > conftest.s << 'EOF'
- .set nomacro
+ elif test x$gcc_cv_as != x; then
+ echo ' .set nomacro
.text
extbl $3, $2, $3 !lituse_bytoff!1
ldq $2, a($29) !literal!1
@@ -6632,354 +6747,407 @@ fi
lda $0, c($29) !gprel
ldah $1, d($29) !gprelhigh
lda $1, d($1) !gprellow
- lda $29, 0($29) !gpdisp!3
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_explicit_relocs=yes
- else
- gcc_cv_as_explicit_relocs=no
- fi
- rm -f conftest.s conftest.o
- fi
-
+ lda $29, 0($29) !gpdisp!3' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_alpha_explicit_relocs=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-echo "$ac_t""$gcc_cv_as_explicit_relocs" 1>&6
- if test "x$gcc_cv_as_explicit_relocs" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_alpha_explicit_relocs" 1>&6
+if test $gcc_cv_as_alpha_explicit_relocs = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_EXPLICIT_RELOCS 1
EOF
- fi
+fi
;;
+
sparc*-*-*)
- echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:6658: checking assembler .register pseudo-op support" >&5
-if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
+ echo $ac_n "checking assembler for .register""... $ac_c" 1>&6
+echo "configure:6774: 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_register_pseudo_op=unknown
- if test x$gcc_cv_as != x; then
- # Check if we have .register
- echo ".register %g2, #scratch" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_register_pseudo_op=yes
- else
- gcc_cv_as_register_pseudo_op=no
- fi
- rm -f conftest.s conftest.o
- fi
-
+ 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:6781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_sparc_register_op=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-echo "$ac_t""$gcc_cv_as_register_pseudo_op" 1>&6
- if test "x$gcc_cv_as_register_pseudo_op" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_sparc_register_op" 1>&6
+if test $gcc_cv_as_sparc_register_op = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_REGISTER_PSEUDO_OP 1
EOF
- fi
+fi
- echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
-echo "configure:6686: checking assembler supports -relax" >&5
-if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
+ echo $ac_n "checking assembler for -relax option""... $ac_c" 1>&6
+echo "configure:6801: 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_relax_opt=unknown
- if test x$gcc_cv_as != x; then
- # Check if gas supports -relax
- echo ".text" > conftest.s
- if $gcc_cv_as -relax -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_relax_opt=yes
- else
- gcc_cv_as_relax_opt=no
- fi
- rm -f conftest.s conftest.o
- fi
-
+ 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:6808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_sparc_relax=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-echo "$ac_t""$gcc_cv_as_relax_opt" 1>&6
- if test "x$gcc_cv_as_relax_opt" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_sparc_relax" 1>&6
+if test $gcc_cv_as_sparc_relax = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_RELAX_OPTION 1
EOF
- fi
+fi
- echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
-echo "configure:6714: checking assembler and linker support unaligned pc related relocs" >&5
+ echo $ac_n "checking assembler for unaligned pcrel relocs""... $ac_c" 1>&6
+echo "configure:6828: 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
-
- gcc_cv_as_sparc_ua_pcrel=unknown
- if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
- gcc_cv_as_sparc_ua_pcrel=no
- echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
- if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
- && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
- gcc_cv_as_sparc_ua_pcrel=yes
- fi
- rm -f conftest.s conftest.o conftest
- fi
-
+ gcc_cv_as_sparc_ua_pcrel=no
+ if test x$gcc_cv_as != x; then
+ echo '.text
+foo:
+ nop
+.data
+.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:6841: \"$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
+ gcc_cv_as_sparc_ua_pcrel=yes
+ fi
+ rm -f conftest
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel" 1>&6
- if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
- cat >> confdefs.h <<\EOF
+if test $gcc_cv_as_sparc_ua_pcrel = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_SPARC_UA_PCREL 1
EOF
- fi
- echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
-echo "configure:6741: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
+ echo $ac_n "checking assembler for unaligned pcrel relocs against hidden symbols""... $ac_c" 1>&6
+echo "configure:6864: 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
-
- if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
- gcc_cv_as_sparc_ua_pcrel_hidden=unknown
- if test x$gcc_cv_objdump != x; then
- gcc_cv_as_sparc_ua_pcrel_hidden=no
- echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
- echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
- echo "foo: .skip 4" >> conftest.s
- if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
- && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
- && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
- | grep ' 31000000 07323334' > /dev/null 2>&1; then
- if $gcc_cv_objdump -R conftest 2> /dev/null \
- | grep 'DISP32' > /dev/null 2>&1; then
- :
- else
- gcc_cv_as_sparc_ua_pcrel_hidden=yes
- fi
- fi
+ gcc_cv_as_sparc_ua_pcrel_hidden=no
+ if test x$gcc_cv_as != x; then
+ echo '.data
+.align 4
+.byte 0x31
+.uaword %r_disp32(foo)
+.byte 0x32, 0x33, 0x34
+.global foo
+.hidden foo
+foo:
+.skip 4' > conftest.s
+ if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6879: \"$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 \
+ && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
+ | grep ' 31000000 07323334' > /dev/null 2>&1; then
+ if $gcc_cv_objdump -R conftest 2> /dev/null \
+ | grep 'DISP32' > /dev/null 2>&1; then
+ :
+ else
+ gcc_cv_as_sparc_ua_pcrel_hidden=yes
fi
- rm -f conftest.s conftest.o conftest
- else
- gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
- fi
-
+ fi
+ rm -f conftest
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel_hidden" 1>&6
- if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
- cat >> confdefs.h <<\EOF
+if test $gcc_cv_as_sparc_ua_pcrel_hidden = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_SPARC_UA_PCREL_HIDDEN 1
EOF
- fi
+fi
+
+fi # unaligned pcrel relocs
- echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
-echo "configure:6781: checking for assembler offsetable %lo() support" >&5
-if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
+ echo $ac_n "checking assembler for offsetable %lo()""... $ac_c" 1>&6
+echo "configure:6912: 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
-
- gcc_cv_as_offsetable_lo10=unknown
- if test "x$gcc_cv_as" != x; then
- # Check if assembler has offsetable %lo()
- echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
- echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
- if $gcc_cv_as -xarch=v9 -o conftest.o conftest.s \
- > /dev/null 2>&1 &&
- $gcc_cv_as -xarch=v9 -o conftest1.o conftest1.s \
- > /dev/null 2>&1; then
- if cmp conftest.o conftest1.o > /dev/null 2>&1; then
- gcc_cv_as_offsetable_lo10=no
- else
- gcc_cv_as_offsetable_lo10=yes
- fi
- else
- gcc_cv_as_offsetable_lo10=no
- fi
- rm -f conftest.s conftest.o conftest1.s conftest1.o
- fi
-
+ gcc_cv_as_sparc_offsetable_lo10=no
+ if test x$gcc_cv_as != x; then
+ 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:6921: \"$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 \
+ | grep ' 82106000 82106000' > /dev/null 2>&1; then
+ gcc_cv_as_offsetable_lo10=yes
+ fi
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-echo "$ac_t""$gcc_cv_as_offsetable_lo10" 1>&6
- if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_sparc_offsetable_lo10" 1>&6
+if test $gcc_cv_as_sparc_offsetable_lo10 = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_OFFSETABLE_LO10 1
EOF
- fi
-
+fi
;;
i[34567]86-*-* | x86_64-*-*)
- echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:6820: checking assembler instructions" >&5
- gcc_cv_as_instructions=
- if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 9 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- gcc_cv_as_instructions="filds fists"
-
-
+ echo $ac_n "checking assembler for filds and fists mnemonics""... $ac_c" 1>&6
+echo "configure:6947: 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
+ gcc_cv_as_ix86_filds_fists=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 9 \) \* 1000 + 0`
+ then gcc_cv_as_ix86_filds_fists=yes
fi
-
- elif test x$gcc_cv_as != x; then
- set "filds fists" "filds mem; fists mem"
- while test $# -gt 0
- do
- echo "$2" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
- fi
- shift 2
- done
- rm -f conftest.s conftest.o
+ 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:6958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_ix86_filds_fists=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
fi
- if test x"$gcc_cv_as_instructions" != x; then
- cat >> confdefs.h <<EOF
-#define HAVE_GAS_`echo "$gcc_cv_as_instructions" | sed -e 's/ $//' | tr 'a-z ' 'A-Z_'` 1
-EOF
+ rm -f conftest.o conftest.s
+ fi
+fi
- fi
- echo "$ac_t""$gcc_cv_as_instructions" 1>&6
+echo "$ac_t""$gcc_cv_as_ix86_filds_fists" 1>&6
+if test $gcc_cv_as_ix86_filds_fists = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GAS_FILDS_FISTS 1
+EOF
- echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
-echo "configure:6854: checking assembler GOTOFF in data directives" >&5
- gcc_cv_as_gotoff_in_data=no
- if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 11 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
+fi
+ echo $ac_n "checking assembler for cmov syntax""... $ac_c" 1>&6
+echo "configure:6978: 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:6985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_ix86_cmov_sun_syntax=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
- gcc_cv_as_gotoff_in_data=yes
-
+echo "$ac_t""$gcc_cv_as_ix86_cmov_sun_syntax" 1>&6
+if test $gcc_cv_as_ix86_cmov_sun_syntax = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_AS_IX86_CMOV_SUN_SYNTAX 1
+EOF
fi
- elif test x$gcc_cv_as != x; then
- cat > conftest.s <<EOF
- .text
+ # 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:7007: 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
+ gcc_cv_as_ix86_gotoff_in_data=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
+ then gcc_cv_as_ix86_gotoff_in_data=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ echo ' .text
.L0:
nop
.data
- .long .L0@GOTOFF
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_gotoff_in_data=yes
- fi
+ .long .L0@GOTOFF' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_ix86_gotoff_in_data=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+
+echo "$ac_t""$gcc_cv_as_ix86_gotoff_in_data" 1>&6
+
cat >> confdefs.h <<EOF
-#define HAVE_AS_GOTOFF_IN_DATA `if test $gcc_cv_as_gotoff_in_data = yes; then echo 1; else echo 0; fi`
+#define HAVE_AS_GOTOFF_IN_DATA `if test $gcc_cv_as_ix86_gotoff_in_data = yes; then echo 1; else echo 0; fi`
EOF
- echo "$ac_t""$gcc_cv_as_gotoff_in_data" 1>&6
;;
ia64*-*-*)
- echo $ac_n "checking assembler supports ltoffx and ldxmov""... $ac_c" 1>&6
-echo "configure:6888: checking assembler supports ltoffx and ldxmov" >&5
-if eval "test \"`echo '$''{'gcc_cv_as_ltoffx_ldxmov_relocs'+set}'`\" = set"; then
+ echo $ac_n "checking assembler for ltoffx and ldxmov relocs""... $ac_c" 1>&6
+echo "configure:7043: 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
-
- gcc_cv_as_ltoffx_ldxmov_relocs=unknown
- if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 14 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- gcc_cv_as_ltoffx_ldxmov_relocs=yes
-
-
+ gcc_cv_as_ia64_ltoffx_ldxmov_relocs=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
+ then gcc_cv_as_ia64_ltoffx_ldxmov_relocs=yes
fi
-
- elif test x$gcc_cv_as != x; then
- cat > conftest.s << 'EOF'
- .text
+ elif test x$gcc_cv_as != x; then
+ echo ' .text
addl r15 = @ltoffx(x#), gp
;;
- ld8.mov r16 = [r15], x#
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_ltoffx_ldxmov_relocs=yes
- else
- gcc_cv_as_ltoffx_ldxmov_relocs=no
- fi
- rm -f conftest.s conftest.o
- fi
-
+ ld8.mov r16 = [r15], x#' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_ia64_ltoffx_ldxmov_relocs=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-echo "$ac_t""$gcc_cv_as_ltoffx_ldxmov_relocs" 1>&6
- if test "x$gcc_cv_as_ltoffx_ldxmov_relocs" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_ia64_ltoffx_ldxmov_relocs" 1>&6
+if test $gcc_cv_as_ia64_ltoffx_ldxmov_relocs = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_LTOFFX_LDXMOV_RELOCS 1
EOF
- fi
+fi
+
;;
+
powerpc*-*-*)
- echo $ac_n "checking assembler supports mfcr field""... $ac_c" 1>&6
-echo "configure:6932: checking assembler supports mfcr field" >&5
-if eval "test \"`echo '$''{'gcc_cv_as_mfcrf'+set}'`\" = set"; then
+ case $target in
+ *-*-aix) conftest_s=' .csect .textPR';;
+ *) conftest_s=' .text';;
+ esac
+ conftest_s="$conftest_s
+ mfcr 3,128"
+
+ echo $ac_n "checking assembler for mfcr field support""... $ac_c" 1>&6
+echo "configure:7087: 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
-
- gcc_cv_as_mfcrf=unknown
- if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 14 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- gcc_cv_as_mfcrf=yes
-
-
+ gcc_cv_as_powerpc_mfcrf=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
+ then gcc_cv_as_powerpc_mfcrf=yes
fi
-
- elif test x$gcc_cv_as != x; then
- cat > conftest.s << 'EOF'
- case "$target" in
- *-*-aix*)
- .csect .text[PR]
- ;;
- *)
- .text
- ;;
- esac
- mfcr 3,128
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_mfcrf=yes
- else
- gcc_cv_as_mfcrf=no
- fi
- rm -f conftest.s conftest.o
- 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:7098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_powerpc_mfcrf=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-echo "$ac_t""$gcc_cv_as_mfcrf" 1>&6
- if test "x$gcc_cv_as_mfcrf" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_powerpc_mfcrf" 1>&6
+if test $gcc_cv_as_powerpc_mfcrf = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_MFCRF 1
EOF
+fi
+ ;;
+
+ mips*-*-*)
+ echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6
+echo "configure:7120: 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
+ gcc_cv_as_mips_explicit_relocs=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
+ then gcc_cv_as_mips_explicit_relocs=yes
+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:7131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_mips_explicit_relocs=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+
+echo "$ac_t""$gcc_cv_as_mips_explicit_relocs" 1>&6
+if test $gcc_cv_as_mips_explicit_relocs = yes; then
+ if test x$target_cpu_default = x
+ then target_cpu_default=MASK_EXPLICIT_RELOCS
+ else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS"
+ fi
+fi
+
;;
esac
-
-echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:6982: checking assembler dwarf2 debug_line support" >&5
-gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
# info to the output file. So, as supported targets are added to gas 2.11,
@@ -6998,121 +7166,150 @@ case "$target" in
mmix-*-*)
insn="swym 0"
;;
- esac
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 11 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
+esac
+if test x"$insn" != x; then
+ conftest_s="\
+ .file 1 \"conftest.s\"
+ .loc 1 3 0
+ $insn"
+ echo $ac_n "checking assembler for dwarf2 debug_line support""... $ac_c" 1>&6
+echo "configure:7177: 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
+ gcc_cv_as_dwarf2_debug_line=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
+ then gcc_cv_as_dwarf2_debug_line=yes
+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:7189: \"$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
+ gcc_cv_as_dwarf2_debug_line=yes
+ fi
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
- test $in_tree_gas_is_elf = yes && test x"$insn" != x \
- && gcc_cv_as_dwarf2_debug_line="yes"
-
+# The .debug_line file table must be in the exact order that
+# we specified the files, since these indices are also used
+# by DW_AT_decl_file. Approximate this test by testing if
+# the assembler bitches if the same index is assigned twice.
+ echo $ac_n "checking assembler for buggy dwarf2 .file directive""... $ac_c" 1>&6
+echo "configure:7211: 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
+ gcc_cv_as_dwarf2_file_buggy=no
+ 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:7219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_dwarf2_file_buggy=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo ' .file 1 "conftest.s"' > conftest.s
- echo ' .loc 1 3 0' >> conftest.s
- echo " $insn" >> conftest.s
- # ??? This fails with non-gnu grep.
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
- && grep debug_line conftest.o > /dev/null 2>&1 ; then
- # The .debug_line file table must be in the exact order that
- # we specified the files, since these indices are also used
- # by DW_AT_decl_file. Approximate this test by testing if
- # the assembler bitches if the same index is assigned twice.
- echo ' .file 1 "foo.s"' > conftest.s
- echo ' .file 1 "bar.s"' >> conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
- then
- gcc_cv_as_dwarf2_debug_line="no"
- else
- gcc_cv_as_dwarf2_debug_line="yes"
- fi
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
-fi
-if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
+echo "$ac_t""$gcc_cv_as_dwarf2_file_buggy" 1>&6
+
+
+ if test $gcc_cv_as_dwarf2_debug_line = yes \
+ && test $gcc_cv_as_dwarf2_file_buggy = no; then
cat >> confdefs.h <<\EOF
#define HAVE_AS_DWARF2_DEBUG_LINE 1
EOF
-fi
-echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
-
-echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
-echo "configure:7046: checking assembler --gdwarf2 support" >&5
-gcc_cv_as_gdwarf2_flag=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 11 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- test $in_tree_gas_is_elf = yes && test x"$insn" != x \
- && gcc_cv_as_gdwarf2_flag="yes"
-
+ fi
+ echo $ac_n "checking assembler for --gdwarf2 option""... $ac_c" 1>&6
+echo "configure:7242: 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
+ gcc_cv_as_gdwarf2_flag=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
+ then gcc_cv_as_gdwarf2_flag=yes
+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:7254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ gcc_cv_as_gdwarf2_flag=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo '' > conftest.s
- # ??? This fails with non-gnu grep.
- if $gcc_cv_as --gdwarf2 -o conftest.o conftest.s > /dev/null 2>&1
- then
- gcc_cv_as_gdwarf2_flag="yes"
- fi
- rm -f conftest.s conftest.o
-fi
-if test x"$gcc_cv_as_gdwarf2_flag" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
+if test $gcc_cv_as_gdwarf2_flag = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_GDWARF2_DEBUG_FLAG 1
EOF
fi
-echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
-
-echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
-echo "configure:7078: checking assembler --gstabs support" >&5
-gcc_cv_as_gstabs_flag=no
-if test $in_tree_gas = yes ; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 11 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- test $in_tree_gas_is_elf = yes && test x"$insn" != x \
- && gcc_cv_as_gstabs_flag="yes"
-
+ echo $ac_n "checking assembler for --gstabs option""... $ac_c" 1>&6
+echo "configure:7274: 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
+ gcc_cv_as_gstabs_flag=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
+ then gcc_cv_as_gstabs_flag=yes
+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:7286: \"$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:7291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then :
+ else gcc_cv_as_gstabs_flag=yes
+ fi
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
fi
-elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo '' > conftest.s
- # ??? This fails with non-gnu grep.
- if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
- gcc_cv_as_gstabs_flag="yes"
- # The native Solaris 9/Intel assembler doesn't understand --gstabs
- # and warns about it, but still exits successfully. So check for
- # this.
- if $gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | \
- grep -i warning > /dev/null ; then
- gcc_cv_as_gstabs_flag="no"
- fi
- fi
- rm -f conftest.s conftest.o
-fi
-if test x"$gcc_cv_as_gstabs_flag" = xyes; then
- cat >> confdefs.h <<\EOF
+echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
+if test $gcc_cv_as_gstabs_flag = yes; then
+ cat >> confdefs.h <<\EOF
#define HAVE_AS_GSTABS_DEBUG_FLAG 1
EOF
fi
-echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
+fi
echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6
-echo "configure:7116: checking linker read-only and read-write section mixing" >&5
+echo "configure:7313: 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 \
@@ -7151,7 +7348,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:7155: checking linker PT_GNU_EH_FRAME support" >&5
+echo "configure:7352: 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 \
@@ -7173,7 +7370,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:7177: checking linker position independent executable support" >&5
+echo "configure:7374: 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 \
@@ -7198,7 +7395,7 @@ echo "$ac_t""$gcc_cv_ld_pie" 1>&6
case "$target" in
mips*-*-*)
echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
-echo "configure:7202: checking whether libgloss uses STARTUP directives consistently" >&5
+echo "configure:7399: 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
@@ -7224,35 +7421,6 @@ EOF
fi
echo "$ac_t""$gcc_cv_mips_libgloss_startup" 1>&6
-
- echo $ac_n "checking whether the assembler has explicit relocation support""... $ac_c" 1>&6
-echo "configure:7230: checking whether the assembler has explicit relocation support" >&5
- if test x$gcc_cv_mips_explicit_relocs = x; then
- gcc_cv_mips_explicit_relocs=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_major_version -eq 2 \
-&& test $gcc_cv_gas_minor_version -ge 14 \
-|| test $gcc_cv_gas_major_version -gt 2 ; then
-
-
- gcc_cv_mips_explicit_relocs=yes
-
-
-fi
-
- elif test x$gcc_cv_as != x; then
- echo ' lw $4,%gp_rel(foo)($4)' > conftest.s
- if $gcc_cv_as conftest.s -o conftest.o > /dev/null 2>&1; then
- gcc_cv_mips_explicit_relocs=yes
- fi
- rm -f conftest.s conftest.o
- fi
- fi
- if test $gcc_cv_mips_explicit_relocs = yes; then
- test x$target_cpu_default != x || target_cpu_default=0
- target_cpu_default="(${target_cpu_default}|MASK_EXPLICIT_RELOCS)"
- fi
- echo "$ac_t""$gcc_cv_mips_explicit_relocs" 1>&6
;;
esac
@@ -7289,11 +7457,9 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/
# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
-for lang in ${srcdir}/*/config-lang.in ..
+for lang in ${srcdir}/*/config-lang.in
do
case $lang in
- ..)
- ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/[*]/config-lang.in)
@@ -7320,10 +7486,9 @@ done
expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'`
found_languages=
subdirs=
-for lang in ${srcdir}/*/config-lang.in ..
+for lang in ${srcdir}/*/config-lang.in
do
case $lang in
- ..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/[*]/config-lang.in) ;;
@@ -7432,7 +7597,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:7436: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:7601: 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"
@@ -7455,7 +7620,6 @@ fi
lang_opt_files=
lang_specs_files=
-lang_options_files=
lang_tree_files=
for subdir in . $subdirs
do
@@ -7465,9 +7629,6 @@ do
if test -f $srcdir/$subdir/lang-specs.h; then
lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
fi
- if test -f $srcdir/$subdir/lang-options.h; then
- lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
- fi
if test -f $srcdir/$subdir/$subdir-tree.def; then
lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
fi
@@ -7481,6 +7642,8 @@ all_compilers=
all_stagestuff=
all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
# List of language makefile fragments.
+all_lang_makefrags=
+# List of language subdirectory makefiles. Deprecated.
all_lang_makefiles=
# Files for gengtype
all_gtfiles="$target_gtfiles"
@@ -7495,13 +7658,10 @@ all_gtfiles_files_files=
# The other mechanism is a set of hooks for each of the main targets
# like `clean', `install', etc.
-language_fragments="Make-lang"
language_hooks="Make-hooks"
-for s in .. $subdirs
+for s in $subdirs
do
- if test $s != ".."
- then
language=
boot_language=
compilers=
@@ -7514,9 +7674,9 @@ do
echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
exit 1
fi
- all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in"
+ all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$s/Make-lang.in"
if test -f ${srcdir}/$s/Makefile.in
- then all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Makefile.in"
+ then all_lang_makefiles="$s/Makefile"
fi
all_languages="$all_languages $language"
if test "x$boot_language" = xyes
@@ -7527,15 +7687,11 @@ do
all_stagestuff="$all_stagestuff $stagestuff"
all_outputs="$all_outputs $outputs"
all_gtfiles="$all_gtfiles $gtfiles"
- for f in .. $gtfiles
+ for f in $gtfiles
do
- if test $f != ".."
- then
all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
- fi
done
- fi
done
# Pick up gtfiles for c
@@ -7543,22 +7699,16 @@ gtfiles=
s="c"
. ${srcdir}/c-config-lang.in
all_gtfiles="$all_gtfiles $gtfiles"
-for f in .. $gtfiles
+for f in $gtfiles
do
- if test $f != ".."
- then
all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
- fi
done
check_languages=
-for language in .. $all_languages
+for language in $all_languages
do
- if test $language != ".."
- then
check_languages="$check_languages check-$language"
- fi
done
# Since we can't use `::' targets, we link each language in
@@ -7575,11 +7725,9 @@ target_list="all.build all.cross start.encap rest.encap tags \
for t in $target_list
do
x=
- for lang in .. $all_languages
+ for lang in $all_languages
do
- if test $lang != ".."; then
x="$x $lang.$t"
- fi
done
echo "lang.$t: $x" >> Make-hooks
done
@@ -7665,9 +7813,6 @@ fi
objdir=`${PWDCMD-pwd}`
-# Process the language and host/target makefile fragments.
-${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
-
# Substitute configuration variables
@@ -7737,8 +7882,6 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
-
-
# Echo that links are built
if test x$host = x$target
then
@@ -7939,6 +8082,7 @@ s%@enable_shared@%$enable_shared%g
s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g
s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g
s%@CROSS_SYSTEM_HEADER_DIR@%$CROSS_SYSTEM_HEADER_DIR%g
+s%@onestep@%$onestep%g
s%@SET_MAKE@%$SET_MAKE%g
s%@AWK@%$AWK%g
s%@LN@%$LN%g
@@ -7947,11 +8091,11 @@ s%@RANLIB@%$RANLIB%g
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@make_compare_target@%$make_compare_target%g
s%@have_mktemp_command@%$have_mktemp_command%g
s%@MAKEINFO@%$MAKEINFO%g
s%@BUILD_INFO@%$BUILD_INFO%g
s%@GENERATED_MANPAGES@%$GENERATED_MANPAGES%g
-s%@make_compare_target@%$make_compare_target%g
s%@FLEX@%$FLEX%g
s%@BISON@%$BISON%g
s%@stage1_cflags@%$stage1_cflags%g
@@ -8002,20 +8146,21 @@ s%@all_compilers@%$all_compilers%g
s%@all_gtfiles@%$all_gtfiles%g
s%@all_gtfiles_files_langs@%$all_gtfiles_files_langs%g
s%@all_gtfiles_files_files@%$all_gtfiles_files_files%g
+s%@all_lang_makefrags@%$all_lang_makefrags%g
s%@all_lang_makefiles@%$all_lang_makefiles%g
s%@all_languages@%$all_languages%g
s%@all_stagestuff@%$all_stagestuff%g
s%@build_exeext@%$build_exeext%g
s%@build_install_headers_dir@%$build_install_headers_dir%g
s%@build_xm_file_list@%$build_xm_file_list%g
-s%@build_xm_file@%$build_xm_file%g
+s%@build_xm_include_list@%$build_xm_include_list%g
s%@build_xm_defines@%$build_xm_defines%g
s%@check_languages@%$check_languages%g
s%@cc_set_by_configure@%$cc_set_by_configure%g
s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
s%@cpp_install_dir@%$cpp_install_dir%g
-s%@dep_host_xmake_file@%$dep_host_xmake_file%g
-s%@dep_tmake_file@%$dep_tmake_file%g
+s%@xmake_file@%$xmake_file%g
+s%@tmake_file@%$tmake_file%g
s%@extra_headers_list@%$extra_headers_list%g
s%@extra_objs@%$extra_objs%g
s%@extra_parts@%$extra_parts%g
@@ -8031,12 +8176,11 @@ s%@gcc_version_trigger@%$gcc_version_trigger%g
s%@host_exeext@%$host_exeext%g
s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
s%@host_xm_file_list@%$host_xm_file_list%g
-s%@host_xm_file@%$host_xm_file%g
+s%@host_xm_include_list@%$host_xm_include_list%g
s%@host_xm_defines@%$host_xm_defines%g
s%@out_host_hook_obj@%$out_host_hook_obj%g
s%@install@%$install%g
s%@lang_opt_files@%$lang_opt_files%g
-s%@lang_options_files@%$lang_options_files%g
s%@lang_specs_files@%$lang_specs_files%g
s%@lang_tree_files@%$lang_tree_files%g
s%@local_prefix@%$local_prefix%g
@@ -8049,21 +8193,16 @@ s%@quoted_stage_prefix_set_by_configure@%$quoted_stage_prefix_set_by_configure%g
s%@symbolic_link@%$symbolic_link%g
s%@thread_file@%$thread_file%g
s%@tm_file_list@%$tm_file_list%g
-s%@tm_file@%$tm_file%g
+s%@tm_include_list@%$tm_include_list%g
s%@tm_defines@%$tm_defines%g
s%@tm_p_file_list@%$tm_p_file_list%g
-s%@tm_p_file@%$tm_p_file%g
-s%@xm_file@%$xm_file%g
+s%@tm_p_include_list@%$tm_p_include_list%g
+s%@xm_file_list@%$xm_file_list%g
+s%@xm_include_list@%$xm_include_list%g
s%@xm_defines@%$xm_defines%g
s%@c_target_objs@%$c_target_objs%g
s%@cxx_target_objs@%$cxx_target_objs%g
s%@target_cpu_default@%$target_cpu_default%g
-/@target_overrides@/r $target_overrides
-s%@target_overrides@%%g
-/@host_overrides@/r $host_overrides
-s%@host_overrides@%%g
-/@language_fragments@/r $language_fragments
-s%@language_fragments@%%g
/@language_hooks@/r $language_hooks
s%@language_hooks@%%g
@@ -8280,6 +8419,11 @@ case x$CONFIG_HEADERS in
xauto-host.h:config.in)
echo > cstamp-h ;;
esac
+# Make sure all the subdirs exist.
+for d in $subdirs
+do
+ test -d $d || mkdir $d
+done
# If the host supports symlinks, point stage[1234] at ../stage[1234] so
# bootstrapping and the installation procedure can still use
# CC="stage1/xgcc -Bstage1/". If the host doesn't support symlinks,
@@ -8287,8 +8431,7 @@ esac
# This is virtually a duplicate of what happens in configure.lang; we do
# an extra check to make sure this only happens if ln -s can be used.
if test "$symbolic_link" = "ln -s"; then
- for d in .. ${subdirs} fixinc ; do
- if test $d != ..; then
+ for d in ${subdirs} fixinc ; do
STARTDIR=`${PWDCMD-pwd}`
cd $d
for t in stage1 stage2 stage3 stage4 stageprofile stagefeedback include
@@ -8297,7 +8440,6 @@ if test "$symbolic_link" = "ln -s"; then
$symbolic_link ../$t $t 2>/dev/null
done
cd $STARTDIR
- fi
done
else true ; fi
diff --git a/gcc/configure.frag b/gcc/configure.frag
deleted file mode 100644
index 2fdbca8bd41..00000000000
--- a/gcc/configure.frag
+++ /dev/null
@@ -1,77 +0,0 @@
-# configure.frag for GCC
-# Process the host/target/language Makefile fragments.
-
-# Copyright (C) 1997 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.
-
-# First parameter is the source directory, second is list of subdirectories,
-# third is list of host makefile fragments, fourth is list of target makefile
-# fragments.
-
-srcdir=$1
-subdirs=$2
-xmake_files=$3
-tmake_files=$4
-
-# Copy all the host makefile fragments into Make-host.
-
-rm -f Make-host
-touch Make-host
-for f in .. $xmake_files
-do
- if [ -f $f ]
- then
- cat $f >> Make-host
- fi
-done
-
-# Copy all the target makefile fragments into Make-target.
-
-rm -f Make-target
-touch Make-target
-for f in .. $tmake_files
-do
- if [ -f $f ]
- then
- cat $f >> Make-target
- fi
-done
-
-# Ensure the language build subdirectories exist.
-
-for subdir in . $subdirs
-do
- if [ $subdir != . ]
- then
- test -d $subdir || mkdir $subdir
- fi
-done
-
-# Now copy each language's Make-lang.in file to Make-lang.
-
-rm -f Make-lang
-touch Make-lang
-
-for subdir in . $subdirs
-do
- if [ $subdir != . ]
- then
- cat $srcdir/$subdir/Make-lang.in >> Make-lang
- fi
-done
diff --git a/gcc/configure.in b/gcc/configure.in
index 16bd3ea583f..6cb114c1dc3 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -318,7 +318,7 @@ AC_ARG_ENABLE(checking,
[ --enable-checking[=LIST]
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
- Categories are: misc,tree,rtl,rtlflag,gc,gcac;
+ Categories are: misc,tree,rtl,rtlflag,gc,gcac,fold;
default is misc,tree,gc,rtlflag],
[ac_checking=
ac_tree_checking=
@@ -326,6 +326,7 @@ ac_rtl_checking=
ac_rtlflag_checking=
ac_gc_checking=
ac_gc_always_collect=
+ac_fold_checking=
case "${enableval}" in
yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;
ac_rtlflag_checking=1 ;;
@@ -342,6 +343,7 @@ no) ;;
rtl) ac_rtl_checking=1 ;;
gc) ac_gc_checking=1 ;;
gcac) ac_gc_always_collect=1 ;;
+ fold) ac_fold_checking=1 ;;
valgrind) ac_checking_valgrind=1 ;;
*) AC_MSG_ERROR(unknown check category $check) ;;
esac
@@ -388,6 +390,11 @@ if test x$ac_gc_always_collect != x ; then
paranoid mode, validating the entire heap and collecting garbage at
every opportunity. This is extremely expensive.])
fi
+if test x$ac_fold_checking != x ; then
+ AC_DEFINE(ENABLE_FOLD_CHECKING, 1,
+[Define if you want fold checked that it never destructs its argument.
+ This is quite expensive.])
+fi
valgrind_path_defines=
valgrind_command=
if test x$ac_checking_valgrind != x ; then
@@ -453,12 +460,6 @@ AC_ARG_WITH(stabs,
stabs="$with_stabs",
stabs=no)
-# With ELF
-AC_ARG_WITH(elf,
-[ --with-elf arrange to use ELF instead of host debug format],
-elf="$with_elf",
-elf=no)
-
# Determine whether or not multilibs are enabled.
AC_ARG_ENABLE(multilib,
[ --enable-multilib enable library support for multiple ABIs],
@@ -569,6 +570,16 @@ AC_SUBST(TARGET_SYSTEM_ROOT)
AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
+# Build with intermodule optimisations
+AC_ARG_ENABLE(intermodule,
+[ --enable-intermodule build the compiler in one step],
+[case ${enable_intermodule} in
+ yes) onestep="-onestep";;
+ *) onestep="";;
+esac],
+[onestep=""])
+AC_SUBST(onestep)
+
# -------------------------
# Checks for other programs
# -------------------------
@@ -582,6 +593,9 @@ gcc_AC_PROG_LN_S
AC_PROG_RANLIB
gcc_AC_PROG_INSTALL
+# See if cmp has --ignore-initial.
+gcc_AC_PROG_CMP_IGNORE_INITIAL
+
# See if we have the mktemp command.
AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
@@ -617,26 +631,6 @@ else
GENERATED_MANPAGES=
fi
-# 'make compare' can be significantly faster, if cmp itself can
-# skip bytes instead of using tail. The test being performed is
-# "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
-# but we need to sink errors and handle broken shells.
-AC_MSG_CHECKING([for cmp's capabilities])
-echo abfoo >t1
-echo cdfoo >t2
-if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
- make_compare_target=slowcompare
- else
- make_compare_target=gnucompare
- fi
-else
- make_compare_target=slowcompare
-fi
-rm t1 t2
-AC_SUBST(make_compare_target)
-AC_MSG_RESULT($make_compare_target)
-
# How about lex?
dnl Don't use AC_PROG_LEX; we insist on flex.
dnl LEXLIB is not useful in gcc.
@@ -774,7 +768,7 @@ dnl gcc_AC_C_ENUM_BF_UNSIGNED
AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
- fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat \
+ fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \
scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \
setlocale)
@@ -796,7 +790,7 @@ int main()
fi
fi
-AC_CHECK_TYPE(ssize_t, int)
+gcc_AC_CHECK_TYPE(ssize_t, int)
# Try to determine the array type of the second argument of getgroups
# for the target system (int or gid_t).
@@ -962,21 +956,16 @@ fi
# Build, host, and target specific configuration fragments
# --------------------------------------------------------
+# Collect build-machine-specific information.
+. ${srcdir}/config.build
+
+# Collect host-machine-specific information.
+. ${srcdir}/config.host
+
target_gtfiles=
-build_xm_file=
-build_xm_defines=
-build_install_headers_dir=install-headers-tar
-build_exeext=
-host_xm_file=
-host_xm_defines=
-host_xmake_file=
-host_exeext=
-
-# Decode the host machine, then the target machine.
-# For the host machine, we save the xm_file variable as host_xm_file;
-# then we decode the target machine and forget everything else
-# that came from the host machine.
-for machine in $build $host $target; do
+
+# Collect target-machine-specific information.
+for machine in $target ; do
. ${srcdir}/config.gcc
done
@@ -1109,7 +1098,7 @@ fi
if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
extra_modes_file='$(srcdir)'/config/${extra_modes}
AC_SUBST(extra_modes_file)
- AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE, "$extra_modes",
+ AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE, "config/$extra_modes",
[Define to the name of a file containing a list of extra machine modes
for this architecture.])
AC_DEFINE(EXTRA_CC_MODES, 1,
@@ -1185,9 +1174,18 @@ if test -f configargs.h ; then
else
gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
fi
+
+# Double all backslashes and backslash all quotes to turn
+# gcc_config_arguments into a C string.
+sed -e 's/\\/\\\\/g; s/"/\\"/g' <<EOF >conftest.out
+$gcc_config_arguments
+EOF
+gcc_config_arguments_str=`cat conftest.out`
+rm -f conftest.out
+
cat > configargs.h <<EOF
/* Generated automatically. */
-static const char configuration_arguments[] = "$gcc_config_arguments";
+static const char configuration_arguments[] = "$gcc_config_arguments_str";
static const char thread_model[] = "$thread_file";
static const struct {
@@ -1264,30 +1262,25 @@ topdir=`${PWDCMD-pwd}`
cd $holddir
# Conditionalize the makefile for this host machine.
-# Make-host contains the concatenation of all host makefile fragments
-# [there can be more than one]. This file is built by configure.frag.
-host_overrides=Make-host
-dep_host_xmake_file=
-for f in .. ${host_xmake_file}
+xmake_file=
+for f in ${host_xmake_file}
do
if test -f ${srcdir}/config/$f
then
- dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
+ xmake_file="${xmake_file} \$(srcdir)/config/$f"
fi
done
# Conditionalize the makefile for this target machine.
-# Make-target contains the concatenation of all host makefile fragments
-# [there can be more than one]. This file is built by configure.frag.
-target_overrides=Make-target
-dep_tmake_file=
-for f in .. ${tmake_file}
+tmake_file_=
+for f in ${tmake_file}
do
if test -f ${srcdir}/config/$f
then
- dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
+ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
fi
done
+tmake_file="${tmake_file_}"
symbolic_link='ln -s'
@@ -1319,35 +1312,69 @@ rm -f symtest.tem
out_object_file=`basename $out_file .c`.o
tm_file_list=
+tm_include_list=
for f in $tm_file; do
case $f in
- ansidecl.h )
- tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
defaults.h )
- tm_file_list="${tm_file_list} \$(srcdir)/$f" ;;
- *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
+ tm_file_list="${tm_file_list} \$(srcdir)/$f"
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+ tm_include_list="${tm_include_list} config/$f"
+ ;;
esac
done
tm_p_file_list=
+tm_p_include_list=
for f in $tm_p_file; do
case $f in
tm-preds.h )
- tm_p_file_list="${tm_p_file_list} $f" ;;
- *) tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" ;;
+ tm_p_file_list="${tm_p_file_list} $f"
+ tm_p_include_list="${tm_p_include_list} $f"
+ ;;
+ * )
+ tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+ tm_p_include_list="${tm_p_include_list} config/$f"
+ esac
+done
+
+xm_file_list=
+xm_include_list=
+for f in $xm_file; do
+ case $f in
+ ansidecl.h )
+ xm_file_list="${xm_file_list} \$(srcdir)/../include/$f"
+ xm_include_list="${xm_include_list} $f"
+ ;;
+ auto-host.h )
+ xm_file_list="${xm_file_list} $f"
+ xm_include_list="${xm_include_list} $f"
+ ;;
+ * )
+ xm_file_list="${xm_file_list} \$(srcdir)/config/$f"
+ xm_include_list="${xm_include_list} config/$f"
+ ;;
esac
done
host_xm_file_list=
+host_xm_include_list=
for f in $host_xm_file; do
case $f in
ansidecl.h )
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/$f"
+ host_xm_include_list="${host_xm_include_list} $f"
+ ;;
auto-host.h )
- host_xm_file_list="${host_xm_file_list} $f" ;;
- defaults.h )
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
- *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
+ host_xm_file_list="${host_xm_file_list} $f"
+ host_xm_include_list="${host_xm_include_list} $f"
+ ;;
+ * )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f"
+ host_xm_include_list="${host_xm_include_list} config/$f"
+ ;;
esac
done
@@ -1355,12 +1382,17 @@ build_xm_file_list=
for f in $build_xm_file; do
case $f in
ansidecl.h )
- build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/$f"
+ build_xm_include_list="${build_xm_include_list} $f"
+ ;;
auto-build.h | auto-host.h )
- build_xm_file_list="${build_xm_file_list} $f" ;;
- defaults.h )
- host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
- *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
+ build_xm_file_list="${build_xm_file_list} $f"
+ build_xm_include_list="${build_xm_include_list} $f"
+ ;;
+ * )
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f"
+ build_xm_include_list="${build_xm_include_list} config/$f"
+ ;;
esac
done
@@ -1375,6 +1407,21 @@ then
ALL=all.cross
SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
case "$host","$target" in
+ # Darwin crosses can use the host system's libraries and headers,
+ # because of the fat library support. Of course, it must be the
+ # same version of Darwin on both sides. Allow the user to
+ # just say --target=foo-darwin without a version number to mean
+ # "the version on this system".
+ *-*-darwin*,*-*-darwin*)
+ hostos=`echo $host | sed 's/.*-darwin/darwin/'`
+ targetos=`echo $target | sed 's/.*-darwin/darwin/'`
+ if test $hostos = $targetos -o $targetos = darwin ; then
+ CROSS=
+ SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'
+ with_headers=yes
+ fi
+ ;;
+
i?86-*-*,x86_64-*-* \
| powerpc*-*-*,powerpc64*-*-*)
CROSS="$CROSS -DNATIVE_CROSS" ;;
@@ -1395,7 +1442,7 @@ fi
inhibit_libc=
if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
test x$with_newlib = xyes ; } &&
- test "x$with_headers" = x ; then
+ { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
inhibit_libc=-Dinhibit_libc
fi
AC_SUBST(inhibit_libc)
@@ -1717,232 +1764,145 @@ case $in_tree_objdump in
esac
# Figure out what assembler alignment features are present.
-AC_MSG_CHECKING(assembler alignment features)
-gcc_cv_as_alignment_features=none
-if test $in_tree_gas = yes; then
- # Gas version 2.6 and later support for .balign and .p2align.
- gcc_GAS_VERSION_GTE_IFELSE(2,6,0,[
- gcc_cv_as_alignment_features=".balign and .p2align"
- AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
- ])
- # Gas version 2.8 and later support specifying the maximum
- # bytes to skip when using .p2align.
- gcc_GAS_VERSION_GTE_IFELSE(2,8,0,[
- gcc_cv_as_alignment_features=".p2align including maximum skip"
- AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
- ])
-elif test x$gcc_cv_as != x; then
- # Check if we have .balign and .p2align
- echo ".balign 4" > conftest.s
- echo ".p2align 2" >> conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_alignment_features=".balign and .p2align"
- AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
- fi
- rm -f conftest.s conftest.o
- # Check if specifying the maximum bytes to skip when
- # using .p2align is supported.
- echo ".p2align 4,,7" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_alignment_features=".p2align including maximum skip"
- AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
- fi
- rm -f conftest.s conftest.o
-fi
-AC_MSG_RESULT($gcc_cv_as_alignment_features)
-
-AC_MSG_CHECKING(assembler subsection support)
-gcc_cv_as_subsections=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,9,0,[
- test $in_tree_gas_is_elf = yes \
- && gcc_cv_as_subsections="working .subsection -1"
- ])
-elif test x$gcc_cv_as != x; then
- # Check if we have .subsection
- echo ".subsection 1" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_subsections=".subsection"
- if test x$gcc_cv_nm != x; then
- cat > conftest.s <<EOF
-conftest_label1: .word 0
+gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align,
+ [2,6,0],,
+[.balign 4
+.p2align 2],,
+[AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN, 1,
+ [Define if your assembler supports .balign and .p2align.])])
+
+gcc_GAS_CHECK_FEATURE([.p2align with maximum skip], gcc_cv_as_max_skip_p2align,
+ [2,8,0],,
+ [.p2align 4,,7],,
+[AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN, 1,
+ [Define if your assembler supports specifying the maximum number
+ of bytes to skip when using the GAS .p2align command.])])
+
+gcc_GAS_CHECK_FEATURE([working .subsection -1], gcc_cv_as_subsection_m1,
+ [elf,2,9,0],,
+ [conftest_label1: .word 0
.subsection -1
conftest_label2: .word 0
-.previous
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
- $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
- if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
- :
- else
- gcc_cv_as_subsections="working .subsection -1"
- fi
- fi
- fi
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
-fi
-if test x"$gcc_cv_as_subsections" = x"working .subsection -1"; then
- AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING, 1,
-[Define if your assembler supports .subsection and .subsection -1 starts
- emitting at the beginning of your section.])
-fi
-AC_MSG_RESULT($gcc_cv_as_subsections)
-
-AC_MSG_CHECKING(assembler weak support)
-gcc_cv_as_weak=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,2,0,[
- gcc_cv_as_weak="yes"
- ])
-elif test x$gcc_cv_as != x; then
- # Check if we have .weak
- echo " .weak foobar" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_weak="yes"
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
-fi
-if test x"$gcc_cv_as_weak" = xyes; then
- AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])
-fi
-AC_MSG_RESULT($gcc_cv_as_weak)
-
-AC_MSG_CHECKING(assembler hidden support)
-gcc_cv_as_hidden=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,12,1,[
- test $in_tree_gas_is_elf = yes && gcc_cv_as_hidden="yes"
- ])
-elif test x$gcc_cv_as != x; then
- # Check if we have .hidden
- echo " .hidden foobar" > conftest.s
- echo "foobar:" >> conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_hidden="yes"
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
-
- # GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
- # This is irritatingly difficult to feature test for. Look for
- # the date string after the version number.
- ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
- if echo "$ld_ver" | grep GNU > /dev/null; then
+.previous],
+ [if test x$gcc_cv_nm != x; then
+ $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
+ $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
+ if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1
+ then :
+ else gcc_cv_as_subsection_m1=yes
+ fi
+ rm -f conftest.nm1 conftest.nm2
+ fi],
+ [AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING, 1,
+ [Define if your assembler supports .subsection and .subsection -1 starts
+ emitting at the beginning of your section.])])
+
+gcc_GAS_CHECK_FEATURE([.weak], gcc_cv_as_weak,
+ [2,2,0],,
+ [ .weak foobar],,
+[AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])])
+
+# .hidden needs to be supported in both the assembler and the linker,
+# because GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
+# This is irritatingly difficult to feature test for; we have to check the
+# date string after the version number. If we've got an in-tree
+# ld, we don't know its patchlevel version, so we set the baseline at 2.13
+# to be safe.
+# The gcc_GAS_CHECK_FEATURE call just sets a cache variable.
+gcc_GAS_CHECK_FEATURE([.hidden], gcc_cv_as_hidden,
+ [elf,2,13,0],,
+[ .hidden foobar
+foobar:])
+
+AC_CACHE_CHECK(linker for .hidden support, gcc_cv_ld_hidden,
+[if test $in_tree_ld = yes ; then
+ gcc_cv_ld_hidden=no
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 13 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_hidden=yes
+ fi
+else
+ gcc_cv_ld_hidden=yes
+ ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
+ if echo "$ld_ver" | grep GNU > /dev/null; then
changequote(,)dnl
- ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'`
- ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
- if test 0"$ld_date" -lt 20020404; then
- if test -n "$ld_date"; then
- # If there was date string, but was earlier than 2002-04-04, fail
- gcc_cv_as_hidden="no"
- elif test -z "$ld_vers"; then
- # If there was no date string nor ld version number, something is wrong
- gcc_cv_as_hidden="no"
- else
- ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
- ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
- ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
- test -z "$ld_vers_patch" && ld_vers_patch=0
- if test "$ld_vers_major" -lt 2; then
- gcc_cv_as_hidden="no"
- elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
- gcc_cv_as_hidden="no"
- elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 \
- -a "$ld_vers_patch" -eq 0; then
- gcc_cv_as_hidden="no"
- fi
- fi
- fi
-changequote([,])dnl
+ ld_vers=`echo $ld_ver | sed -n \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'`
+ ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
+ if test 0"$ld_date" -lt 20020404; then
+ if test -n "$ld_date"; then
+ # If there was date string, but was earlier than 2002-04-04, fail
+ gcc_cv_ld_hidden=no
+ elif test -z "$ld_vers"; then
+ # If there was no date string nor ld version number, something is wrong
+ gcc_cv_ld_hidden=no
+ else
+ ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
+ ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
+ ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+ test -z "$ld_vers_patch" && ld_vers_patch=0
+ if test "$ld_vers_major" -lt 2; then
+ gcc_cv_ld_hidden=no
+ elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
+ gcc_cv_ld_hidden="no"
+ elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 -a "$ld_vers_patch" -eq 0; then
+ gcc_cv_ld_hidden=no
fi
-fi
-case "$target" in
- mips-sgi-irix6*)
- if test x"$gnu_ld_flag" = x"no"; then
- # Even if using gas with .hidden support, the resulting object files
- # cannot be linked with the IRIX 6 O32 linker. With the N32 and
- # N64 linkers, the problem is that the linker refuses to accept
- # -call_shared (passed by default to the linker) and -r (used to
- # link the object file generated without .hidden directives with
- # one that hides symbols), so we also lose.
- gcc_cv_as_hidden=no
+ fi
+changequote([,])dnl
fi
- ;;
-esac
-if test x"$gcc_cv_as_hidden" = xyes; then
- AC_DEFINE(HAVE_GAS_HIDDEN, 1,
- [Define if your assembler supports .hidden.])
-fi
-AC_MSG_RESULT($gcc_cv_as_hidden)
-libgcc_visibility=$gcc_cv_as_hidden
+ else
+ # non-GNU linkers don't seem to support .hidden yet
+ gcc_cv_ld_hidden=no
+ fi
+fi])
+libgcc_visibility=no
AC_SUBST(libgcc_visibility)
+if test $gcc_cv_as_hidden = yes && test $gcc_cv_ld_hidden = yes; then
+ libgcc_visibility=yes
+ AC_DEFINE(HAVE_GAS_HIDDEN, 1,
+ [Define if your assembler and linker support .hidden.])
+fi
-AC_MSG_CHECKING(assembler leb128 support)
-gcc_cv_as_leb128=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- test $in_tree_gas_is_elf = yes && gcc_cv_as_leb128="yes"
- ])
-elif test x$gcc_cv_as != x; then
- # Check if we have .[us]leb128, and support symbol arithmetic with it.
- cat > conftest.s <<EOF
- .data
+# Check if we have .[us]leb128, and support symbol arithmetic with it.
+gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128,
+ [elf,2,11,0],,
+[ .data
.uleb128 L2 - L1
L1:
.uleb128 1280
.sleb128 -1010
-L2:
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_leb128="yes"
-
- # GAS versions before 2.11 do not support uleb128,
- # despite appearing to.
- # ??? There exists an elf-specific test that will crash
- # the assembler. Perhaps it's better to figure out whether
- # arbitrary sections are supported and try the test.
- as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
- if echo "$as_ver" | grep GNU > /dev/null; then
+L2:],
+ [# GAS versions before 2.11 do not support uleb128,
+ # despite appearing to.
+ # ??? There exists an elf-specific test that will crash
+ # the assembler. Perhaps it's better to figure out whether
+ # arbitrary sections are supported and try the test.
+ as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
+ if echo "$as_ver" | grep GNU > /dev/null; then
changequote(,)dnl
- as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
- as_major=`echo $as_ver | sed 's/\..*//'`
- as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
+ as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
+ as_major=`echo $as_ver | sed 's/\..*//'`
+ as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
changequote([,])dnl
- if test $as_major -eq 2 -a $as_minor -lt 11; then
- gcc_cv_as_leb128="no"
- fi
- fi
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
-fi
-if test x"$gcc_cv_as_leb128" = xyes; then
- AC_DEFINE(HAVE_AS_LEB128, 1,
- [Define if your assembler supports .uleb128.])
-fi
-AC_MSG_RESULT($gcc_cv_as_leb128)
-
-AC_MSG_CHECKING(assembler eh_frame optimization)
-gcc_cv_as_eh_frame=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,12,0,[
- test $in_tree_gas_is_elf = yes && gcc_cv_as_eh_frame="yes"
- ])
-elif test x$gcc_cv_as != x; then
- # Check if this is GAS.
- as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
- rm -f a.out 2> /dev/null
- if echo "$as_ver" | grep GNU > /dev/null; then
- # Versions up to and including 2.11.0 may mis-optimize
- # .eh_frame data. Try something.
- cat > conftest.s <<EOF
- .text
+ if test $as_major -eq 2 && test $as_minor -lt 11
+ then :
+ else gcc_cv_as_leb128=yes
+ fi
+ fi],
+ [AC_DEFINE(HAVE_AS_LEB128, 1,
+ [Define if your assembler supports .sleb128 and .uleb128.])])
+
+# GAS versions up to and including 2.11.0 may mis-optimize
+# .eh_frame data.
+gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame,
+ [elf,2,12,0],,
+[ .text
.LFB1:
.4byte 0
.L1:
@@ -1973,61 +1933,45 @@ __FRAME_BEGIN__:
.4byte .LFE1-.LFB1
.byte 0x4
.4byte .L1-.LFB1
-.LEFDE1:
-EOF
- cat > conftest.lit <<EOF
+.LEFDE1:],
+[ cat > conftest.lit <<EOF
0000 10000000 00000000 017a0001 781a0004 .........z..x...
0010 01000000 12000000 18000000 00000000 ................
0020 08000000 04080000 0044 .........D
EOF
- cat > conftest.big <<EOF
+ cat > conftest.big <<EOF
0000 00000010 00000000 017a0001 781a0004 .........z..x...
0010 00000001 00000012 00000018 00000000 ................
0020 00000008 04000000 0844 .........D
EOF
- # If the assembler didn't choke, and we can objdump,
- # and we got the correct data, then succeed.
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
- && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
- | tail -3 > conftest.got \
- && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
- || cmp conftest.big conftest.got > /dev/null 2>&1; }
- then
- gcc_cv_as_eh_frame="yes"
- else
- gcc_cv_as_eh_frame="bad"
- if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
- AC_DEFINE(USE_AS_TRADITIONAL_FORMAT, 1,
- [Define if your assembler mis-optimizes .eh_frame data.])
- fi
- fi
- fi
- rm -f conftest.*
-fi
-AC_MSG_RESULT($gcc_cv_as_eh_frame)
-
-AC_MSG_CHECKING(assembler section merging support)
-gcc_cv_as_shf_merge=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,12,0,[
- test $in_tree_gas_is_elf = yes && gcc_cv_as_shf_merge="yes"
- ])
-elif test x$gcc_cv_as != x; then
- # Check if we support SHF_MERGE sections
- echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
- if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_shf_merge=yes
- fi
- rm -f conftest.s conftest.o
-fi
-if test x"$gcc_cv_as_shf_merge" = xyes; then
- AC_DEFINE(HAVE_GAS_SHF_MERGE, 1,
-[Define if your assembler supports marking sections with SHF_MERGE flag.])
+ # If the assembler didn't choke, and we can objdump,
+ # and we got the correct data, then succeed.
+ if test x$gcc_cv_objdump != x \
+ && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
+ | tail -3 > conftest.got \
+ && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+ || cmp conftest.big conftest.got > /dev/null 2>&1; }
+ then
+ gcc_cv_as_eh_frame=yes
+ elif AC_TRY_COMMAND($gcc_cv_as -o conftest.o --traditional-format /dev/null); then
+ gcc_cv_as_eh_frame=buggy
+ else
+ # Uh oh, what do we do now?
+ gcc_cv_as_eh_frame=no
+ fi])
+
+if test $gcc_cv_as_eh_frame = buggy; then
+ AC_DEFINE(USE_AS_TRADITIONAL_FORMAT, 1,
+ [Define if your assembler mis-optimizes .eh_frame data.])
fi
-AC_MSG_RESULT($gcc_cv_as_shf_merge)
-AC_MSG_CHECKING(assembler thread-local storage support)
-gcc_cv_as_tls=no
+gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge,
+ [elf,2,12,0], [--fatal-warnings],
+ [.section .rodata.str, "aMS", @progbits, 1],,
+ [AC_DEFINE(HAVE_GAS_SHF_MERGE, 1,
+[Define if your assembler supports marking sections with SHF_MERGE flag.])])
+
+# Thread-local storage - the check is heavily parametrized.
conftest_s=
tls_first_major=
tls_first_minor=
@@ -2057,7 +2001,6 @@ foo: .long 25
tls_first_minor=13
;;
i[34567]86-*-*)
-changequote([,])dnl
conftest_s='
.section ".tdata","awT",@progbits
foo: .long 25
@@ -2204,40 +2147,53 @@ foo: .long 25
tls_first_minor=14
tls_as_opt="-m64 -Aesame"
;;
+ sparc*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+foo: .long 25
+ .text
+ sethi %tgd_hi22(foo), %o0
+ add %o0, %tgd_lo10(foo), %o1
+ add %l7, %o1, %o0, %tgd_add(foo)
+ call __tls_get_addr, %tgd_call(foo)
+ sethi %tldm_hi22(foo), %l1
+ add %l1, %tldm_lo10(foo), %l2
+ add %l7, %l2, %o0, %tldm_add(foo)
+ call __tls_get_addr, %tldm_call(foo)
+ sethi %tldo_hix22(foo), %l3
+ xor %l3, %tldo_lox10(foo), %l4
+ add %o0, %l4, %l5, %tldo_add(foo)
+ sethi %tie_hi22(foo), %o3
+ add %o3, %tie_lo10(foo), %o3
+ ld [%l7 + %o3], %o2, %tie_ld(foo)
+ add %g7, %o2, %o4, %tie_add(foo)
+ sethi %tle_hix22(foo), %l1
+ xor %l1, %tle_lox10(foo), %o5
+ ld [%g7 + %o5], %o1'
+ tls_first_major=2
+ tls_first_minor=14
+ tls_as_opt=-32
+ ;;
+changequote([,])dnl
esac
if test -z "$tls_first_major"; then
- :
-elif test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE($tls_first_major,$tls_first_minor,0,[
- gcc_cv_as_tls=yes
- ])
-elif test x$gcc_cv_as != x; then
- echo "$conftest_s" > conftest.s
- if $gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
- then
- gcc_cv_as_tls=yes
- fi
- rm -f conftest.s conftest.o
-fi
-if test "$gcc_cv_as_tls" = yes; then
- AC_DEFINE(HAVE_AS_TLS, 1,
- [Define if your assembler supports thread-local storage.])
+ : # If we don't have a check, assume no support.
+else
+ gcc_GAS_CHECK_FEATURE(thread-local storage support, gcc_cv_as_tls,
+ [$tls_first_major,$tls_first_minor,0], [$tls_as_opt --fatal-warnings],
+ [$conftest_s],,
+ [AC_DEFINE(HAVE_AS_TLS, 1,
+ [Define if your assembler supports thread-local storage.])])
fi
-AC_MSG_RESULT($gcc_cv_as_tls)
+
+# Target-specific assembler checks.
case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
- AC_CACHE_CHECK([assembler supports explicit relocations],
- gcc_cv_as_explicit_relocs, [
- gcc_cv_as_explicit_relocs=unknown
- if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,12,0,[
- gcc_cv_as_explicit_relocs=yes
- ])
- elif test x$gcc_cv_as != x; then
- cat > conftest.s << 'EOF'
- .set nomacro
+ gcc_GAS_CHECK_FEATURE([explicit relocation support],
+ gcc_cv_as_alpha_explicit_relocs, [2,12,0],,
+[ .set nomacro
.text
extbl $3, $2, $3 !lituse_bytoff!1
ldq $2, a($29) !literal!1
@@ -2249,257 +2205,150 @@ case "$target" in
lda $0, c($29) !gprel
ldah $1, d($29) !gprelhigh
lda $1, d($1) !gprellow
- lda $29, 0($29) !gpdisp!3
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_explicit_relocs=yes
- else
- gcc_cv_as_explicit_relocs=no
- fi
- rm -f conftest.s conftest.o
- fi
- ])
- if test "x$gcc_cv_as_explicit_relocs" = xyes; then
- AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
- [Define if your assembler supports explicit relocations.])
- fi
+ lda $29, 0($29) !gpdisp!3],,
+ [AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
+ [Define if your assembler supports explicit relocations.])])
;;
- sparc*-*-*)
- AC_CACHE_CHECK([assembler .register pseudo-op support],
- gcc_cv_as_register_pseudo_op, [
- gcc_cv_as_register_pseudo_op=unknown
- if test x$gcc_cv_as != x; then
- # Check if we have .register
- echo ".register %g2, #scratch" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_register_pseudo_op=yes
- else
- gcc_cv_as_register_pseudo_op=no
- fi
- rm -f conftest.s conftest.o
- fi
- ])
- if test "x$gcc_cv_as_register_pseudo_op" = xyes; then
- AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
- [Define if your assembler supports .register.])
- fi
- AC_CACHE_CHECK([assembler supports -relax],
- gcc_cv_as_relax_opt, [
- gcc_cv_as_relax_opt=unknown
- if test x$gcc_cv_as != x; then
- # Check if gas supports -relax
- echo ".text" > conftest.s
- if $gcc_cv_as -relax -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_relax_opt=yes
- else
- gcc_cv_as_relax_opt=no
- fi
- rm -f conftest.s conftest.o
- fi
- ])
- if test "x$gcc_cv_as_relax_opt" = xyes; then
- AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,
- [Define if your assembler supports -relax option.])
- fi
-
- AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
- gcc_cv_as_sparc_ua_pcrel, [
- gcc_cv_as_sparc_ua_pcrel=unknown
- if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
- gcc_cv_as_sparc_ua_pcrel=no
- echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
- if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
- && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
- gcc_cv_as_sparc_ua_pcrel=yes
- fi
- rm -f conftest.s conftest.o conftest
- fi
- ])
- if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
- AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
+ sparc*-*-*)
+ gcc_GAS_CHECK_FEATURE([.register], gcc_cv_as_sparc_register_op,,,
+ [.register %g2, #scratch],,
+ [AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
+ [Define if your assembler supports .register.])])
+
+ gcc_GAS_CHECK_FEATURE([-relax option], gcc_cv_as_sparc_relax,,
+ [-relax], [.text],,
+ [AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,
+ [Define if your assembler supports -relax option.])])
+
+ gcc_GAS_CHECK_FEATURE([unaligned pcrel relocs],
+ gcc_cv_as_sparc_ua_pcrel,,
+ [-K PIC],
+[.text
+foo:
+ nop
+.data
+.align 4
+.byte 0
+.uaword %r_disp32(foo)],
+ [if test x$gcc_cv_ld != x \
+ && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
+ gcc_cv_as_sparc_ua_pcrel=yes
+ fi
+ rm -f conftest],
+ [AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
[Define if your assembler and linker support unaligned PC relative relocs.])
- fi
- AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs against hidden symbols],
- gcc_cv_as_sparc_ua_pcrel_hidden, [
- if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
- gcc_cv_as_sparc_ua_pcrel_hidden=unknown
- if test x$gcc_cv_objdump != x; then
- gcc_cv_as_sparc_ua_pcrel_hidden=no
- echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
- echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
- echo "foo: .skip 4" >> conftest.s
- if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
- && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
- && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
- | grep ' 31000000 07323334' > /dev/null 2>&1; then
- if $gcc_cv_objdump -R conftest 2> /dev/null \
- | grep 'DISP32' > /dev/null 2>&1; then
- :
- else
- gcc_cv_as_sparc_ua_pcrel_hidden=yes
- fi
- fi
- fi
- rm -f conftest.s conftest.o conftest
- else
- gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
- fi
- ])
- if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
- AC_DEFINE(HAVE_AS_SPARC_UA_PCREL_HIDDEN, 1,
- [Define if your assembler and linker support unaligned PC relative relocs against hidden symbols.])
- fi
-
- AC_CACHE_CHECK([for assembler offsetable %lo() support],
- gcc_cv_as_offsetable_lo10, [
- gcc_cv_as_offsetable_lo10=unknown
- if test "x$gcc_cv_as" != x; then
- # Check if assembler has offsetable %lo()
- echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
- echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
- if $gcc_cv_as -xarch=v9 -o conftest.o conftest.s \
- > /dev/null 2>&1 &&
- $gcc_cv_as -xarch=v9 -o conftest1.o conftest1.s \
- > /dev/null 2>&1; then
- if cmp conftest.o conftest1.o > /dev/null 2>&1; then
- gcc_cv_as_offsetable_lo10=no
- else
- gcc_cv_as_offsetable_lo10=yes
- fi
+ gcc_GAS_CHECK_FEATURE([unaligned pcrel relocs against hidden symbols],
+ gcc_cv_as_sparc_ua_pcrel_hidden,,
+ [-K PIC],
+[.data
+.align 4
+.byte 0x31
+.uaword %r_disp32(foo)
+.byte 0x32, 0x33, 0x34
+.global foo
+.hidden foo
+foo:
+.skip 4],
+ [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 \
+ && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
+ | grep ' 31000000 07323334' > /dev/null 2>&1; then
+ if $gcc_cv_objdump -R conftest 2> /dev/null \
+ | grep 'DISP32' > /dev/null 2>&1; then
+ :
else
- gcc_cv_as_offsetable_lo10=no
+ gcc_cv_as_sparc_ua_pcrel_hidden=yes
fi
- rm -f conftest.s conftest.o conftest1.s conftest1.o
- fi
- ])
- if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
- AC_DEFINE(HAVE_AS_OFFSETABLE_LO10, 1,
- [Define if your assembler supports offsetable %lo().])
- fi
-
+ fi
+ rm -f conftest],
+ [AC_DEFINE(HAVE_AS_SPARC_UA_PCREL_HIDDEN, 1,
+ [Define if your assembler and linker support unaligned PC relative relocs against hidden symbols.])])
+ ]) # unaligned pcrel relocs
+
+ gcc_GAS_CHECK_FEATURE([offsetable %lo()],
+ gcc_cv_as_sparc_offsetable_lo10,,
+ [-xarch=v9],
+[.text
+ or %g1, %lo(ab) + 12, %g1
+ or %g1, %lo(ab + 12), %g1],
+ [if test x$gcc_cv_objdump != x \
+ && %gcc_cv_objdump -s -j .text conftest.o 2> /dev/null \
+ | grep ' 82106000 82106000' > /dev/null 2>&1; then
+ gcc_cv_as_offsetable_lo10=yes
+ fi],
+ [AC_DEFINE(HAVE_AS_OFFSETABLE_LO10, 1,
+ [Define if your assembler supports offsetable %lo().])])
;;
changequote(,)dnl
i[34567]86-*-* | x86_64-*-*)
changequote([,])dnl
- AC_MSG_CHECKING(assembler instructions)
- gcc_cv_as_instructions=
- if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,9,0,[
- gcc_cv_as_instructions="filds fists"
- ])
- elif test x$gcc_cv_as != x; then
- set "filds fists" "filds mem; fists mem"
- while test $# -gt 0
- do
- echo "$2" > conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
- fi
- shift 2
- done
- rm -f conftest.s conftest.o
- fi
- if test x"$gcc_cv_as_instructions" != x; then
- AC_DEFINE_UNQUOTED(HAVE_GAS_`echo "$gcc_cv_as_instructions" | sed -e 's/ $//' | tr '[a-z ]' '[A-Z_]'`)
- fi
- AC_MSG_RESULT($gcc_cv_as_instructions)
-
- AC_MSG_CHECKING(assembler GOTOFF in data directives)
- gcc_cv_as_gotoff_in_data=no
- if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- gcc_cv_as_gotoff_in_data=yes
- ])
- elif test x$gcc_cv_as != x; then
- cat > conftest.s <<EOF
- .text
+ gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
+ gcc_cv_as_ix86_filds_fists,
+ [2,9,0],, [filds mem; fists mem],,
+ [AC_DEFINE(HAVE_GAS_FILDS_FISTS, 1,
+ [Define if your assembler uses the new HImode fild and fist notation.])])
+
+ gcc_GAS_CHECK_FEATURE([cmov syntax],
+ gcc_cv_as_ix86_cmov_sun_syntax,,,
+ [cmovl.l %edx, %eax],,
+ [AC_DEFINE(HAVE_AS_IX86_CMOV_SUN_SYNTAX, 1,
+ [Define if your assembler supports the Sun syntax for cmov.])])
+
+ # This one is used unconditionally by i386.[ch]; it is to be defined
+ # to 1 if the feature is present, 0 otherwise.
+ gcc_GAS_CHECK_FEATURE([GOTOFF in data],
+ gcc_cv_as_ix86_gotoff_in_data, [2,11,0],,
+[ .text
.L0:
nop
.data
- .long .L0@GOTOFF
-EOF
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_gotoff_in_data=yes
- fi
- fi
+ .long .L0@GOTOFF])
AC_DEFINE_UNQUOTED(HAVE_AS_GOTOFF_IN_DATA,
- [`if test $gcc_cv_as_gotoff_in_data = yes; then echo 1; else echo 0; fi`],
+ [`if test $gcc_cv_as_ix86_gotoff_in_data = yes; then echo 1; else echo 0; fi`],
[Define true if the assembler supports '.long foo@GOTOFF'.])
- AC_MSG_RESULT($gcc_cv_as_gotoff_in_data)
;;
ia64*-*-*)
- AC_CACHE_CHECK([assembler supports ltoffx and ldxmov],
- gcc_cv_as_ltoffx_ldxmov_relocs, [
- gcc_cv_as_ltoffx_ldxmov_relocs=unknown
- if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,14,0,[
- gcc_cv_as_ltoffx_ldxmov_relocs=yes
- ])
- elif test x$gcc_cv_as != x; then
- cat > conftest.s << 'EOF'
-changequote(,)dnl
- .text
+ gcc_GAS_CHECK_FEATURE([ltoffx and ldxmov relocs],
+ gcc_cv_as_ia64_ltoffx_ldxmov_relocs, [2,14,0],,
+[ .text
addl r15 = @ltoffx(x#), gp
;;
- ld8.mov r16 = [r15], x#
-EOF
-changequote([,])dnl
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_ltoffx_ldxmov_relocs=yes
- else
- gcc_cv_as_ltoffx_ldxmov_relocs=no
- fi
- rm -f conftest.s conftest.o
- fi
- ])
- if test "x$gcc_cv_as_ltoffx_ldxmov_relocs" = xyes; then
- AC_DEFINE(HAVE_AS_LTOFFX_LDXMOV_RELOCS, 1,
- [Define if your assembler supports ltoffx and ldxmov relocations.])
- fi
+ ld8.mov r16 = [[r15]], x#],,
+ [AC_DEFINE(HAVE_AS_LTOFFX_LDXMOV_RELOCS, 1,
+ [Define if your assembler supports ltoffx and ldxmov relocations.])])
+
;;
+
powerpc*-*-*)
- AC_CACHE_CHECK([assembler supports mfcr field],
- gcc_cv_as_mfcrf, [
- gcc_cv_as_mfcrf=unknown
- if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,14,0,[
- gcc_cv_as_mfcrf=yes
- ])
- elif test x$gcc_cv_as != x; then
- cat > conftest.s << 'EOF'
- case "$target" in
-changequote(,)dnl
- *-*-aix*)
- .csect .text[PR]
- ;;
- *)
- .text
- ;;
- esac
- mfcr 3,128
-EOF
-changequote([,])dnl
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
- gcc_cv_as_mfcrf=yes
- else
- gcc_cv_as_mfcrf=no
- fi
- rm -f conftest.s conftest.o
- fi
- ])
- if test "x$gcc_cv_as_mfcrf" = xyes; then
- AC_DEFINE(HAVE_AS_MFCRF, 1,
- [Define if your assembler supports mfcr field.])
- fi
+ case $target in
+ *-*-aix) conftest_s=' .csect .text[PR]';;
+ *) conftest_s=' .text';;
+ esac
+ conftest_s="$conftest_s
+ mfcr 3,128"
+
+ gcc_GAS_CHECK_FEATURE([mfcr field support],
+ gcc_cv_as_powerpc_mfcrf, [2,14,0],,
+ [$conftest_s],,
+ [AC_DEFINE(HAVE_AS_MFCRF, 1,
+ [Define if your assembler supports mfcr field.])])
;;
-esac
-AC_MSG_CHECKING(assembler dwarf2 debug_line support)
-gcc_cv_as_dwarf2_debug_line=no
+ mips*-*-*)
+ gcc_GAS_CHECK_FEATURE([explicit relocation support],
+ gcc_cv_as_mips_explicit_relocs, [2,14,0],,
+[ lw $4,%gp_rel(foo)($4)],,
+ [if test x$target_cpu_default = x
+ then target_cpu_default=MASK_EXPLICIT_RELOCS
+ else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS"
+ fi])
+
+ ;;
+esac
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
# info to the output file. So, as supported targets are added to gas 2.11,
@@ -2518,90 +2367,55 @@ case "$target" in
mmix-*-*)
insn="swym 0"
;;
- esac
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- test $in_tree_gas_is_elf = yes && test x"$insn" != x \
- && gcc_cv_as_dwarf2_debug_line="yes"
- ])
-elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo ' .file 1 "conftest.s"' > conftest.s
- echo ' .loc 1 3 0' >> conftest.s
- echo " $insn" >> conftest.s
- # ??? This fails with non-gnu grep.
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
- && grep debug_line conftest.o > /dev/null 2>&1 ; then
- # The .debug_line file table must be in the exact order that
- # we specified the files, since these indices are also used
- # by DW_AT_decl_file. Approximate this test by testing if
- # the assembler bitches if the same index is assigned twice.
- echo ' .file 1 "foo.s"' > conftest.s
- echo ' .file 1 "bar.s"' >> conftest.s
- if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
- then
- gcc_cv_as_dwarf2_debug_line="no"
- else
- gcc_cv_as_dwarf2_debug_line="yes"
- fi
- fi
- rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
-fi
-if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
+esac
+if test x"$insn" != x; then
+ conftest_s="\
+ .file 1 \"conftest.s\"
+ .loc 1 3 0
+ $insn"
+ gcc_GAS_CHECK_FEATURE([dwarf2 debug_line support],
+ gcc_cv_as_dwarf2_debug_line,
+ [elf,2,11,0],, [$conftest_s],
+ [# ??? This fails with non-gnu grep. Maybe use objdump?
+ if grep debug_line conftest.o > /dev/null 2>&1; then
+ gcc_cv_as_dwarf2_debug_line=yes
+ fi])
+
+# The .debug_line file table must be in the exact order that
+# we specified the files, since these indices are also used
+# by DW_AT_decl_file. Approximate this test by testing if
+# the assembler bitches if the same index is assigned twice.
+ gcc_GAS_CHECK_FEATURE([buggy dwarf2 .file directive],
+ gcc_cv_as_dwarf2_file_buggy,,,
+[ .file 1 "foo.s"
+ .file 1 "bar.s"])
+
+ if test $gcc_cv_as_dwarf2_debug_line = yes \
+ && test $gcc_cv_as_dwarf2_file_buggy = no; then
AC_DEFINE(HAVE_AS_DWARF2_DEBUG_LINE, 1,
-[Define if your assembler supports dwarf2 .file/.loc directives,
+ [Define if your assembler supports dwarf2 .file/.loc directives,
and preserves file table indices exactly as given.])
+ fi
+
+ gcc_GAS_CHECK_FEATURE([--gdwarf2 option],
+ gcc_cv_as_gdwarf2_flag,
+ [elf,2,11,0], [--gdwarf2], [$insn],,
+ [AC_DEFINE(HAVE_AS_GDWARF2_DEBUG_FLAG, 1,
+[Define if your assembler supports the --gdwarf2 option.])])
+
+ gcc_GAS_CHECK_FEATURE([--gstabs option],
+ gcc_cv_as_gstabs_flag,
+ [elf,2,11,0], [--gstabs], [$insn],
+ [# 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_COMMAND([$gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null])
+ then :
+ else gcc_cv_as_gstabs_flag=yes
+ fi],
+ [AC_DEFINE(HAVE_AS_GSTABS_DEBUG_FLAG, 1,
+[Define if your assembler supports the --gstabs option.])])
fi
-AC_MSG_RESULT($gcc_cv_as_dwarf2_debug_line)
-
-AC_MSG_CHECKING(assembler --gdwarf2 support)
-gcc_cv_as_gdwarf2_flag=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- test $in_tree_gas_is_elf = yes && test x"$insn" != x \
- && gcc_cv_as_gdwarf2_flag="yes"
- ])
-elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo '' > conftest.s
- # ??? This fails with non-gnu grep.
- if $gcc_cv_as --gdwarf2 -o conftest.o conftest.s > /dev/null 2>&1
- then
- gcc_cv_as_gdwarf2_flag="yes"
- fi
- rm -f conftest.s conftest.o
-fi
-if test x"$gcc_cv_as_gdwarf2_flag" = xyes; then
- AC_DEFINE(HAVE_AS_GDWARF2_DEBUG_FLAG, 1,
-[Define if your assembler supports the --gdwarf2 option.])
-fi
-AC_MSG_RESULT($gcc_cv_as_gdwarf2_flag)
-
-AC_MSG_CHECKING(assembler --gstabs support)
-gcc_cv_as_gstabs_flag=no
-if test $in_tree_gas = yes ; then
- gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- test $in_tree_gas_is_elf = yes && test x"$insn" != x \
- && gcc_cv_as_gstabs_flag="yes"
- ])
-elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo '' > conftest.s
- # ??? This fails with non-gnu grep.
- if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
- gcc_cv_as_gstabs_flag="yes"
- # The native Solaris 9/Intel assembler doesn't understand --gstabs
- # and warns about it, but still exits successfully. So check for
- # this.
- if $gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | \
- grep -i warning > /dev/null ; then
- gcc_cv_as_gstabs_flag="no"
- fi
- fi
- rm -f conftest.s conftest.o
-fi
-if test x"$gcc_cv_as_gstabs_flag" = xyes; then
- AC_DEFINE(HAVE_AS_GSTABS_DEBUG_FLAG, 1,
-[Define if your assembler supports the --gstabs option.])
-fi
-AC_MSG_RESULT($gcc_cv_as_gstabs_flag)
AC_MSG_CHECKING(linker read-only and read-write section mixing)
gcc_cv_ld_ro_rw_mix=unknown
@@ -2707,33 +2521,13 @@ case "$target" in
[Define if your MIPS libgloss linker scripts consistently include STARTUP directives.])
fi
AC_MSG_RESULT($gcc_cv_mips_libgloss_startup)
-
- AC_MSG_CHECKING(whether the assembler has explicit relocation support)
- if test x$gcc_cv_mips_explicit_relocs = x; then
- gcc_cv_mips_explicit_relocs=no
- if test $in_tree_gas = yes; then
- gcc_GAS_VERSION_GTE_IFELSE(2,14,0,[
- gcc_cv_mips_explicit_relocs=yes
- ])
- elif test x$gcc_cv_as != x; then
- echo ' lw $4,%gp_rel(foo)($4)' > conftest.s
- if $gcc_cv_as conftest.s -o conftest.o > /dev/null 2>&1; then
- gcc_cv_mips_explicit_relocs=yes
- fi
- rm -f conftest.s conftest.o
- fi
- fi
- if test $gcc_cv_mips_explicit_relocs = yes; then
- test x$target_cpu_default != x || target_cpu_default=0
- target_cpu_default="(${target_cpu_default}|MASK_EXPLICIT_RELOCS)"
- fi
- AC_MSG_RESULT($gcc_cv_mips_explicit_relocs)
;;
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")
+ AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include",
+[Define to PREFIX/include if cpp should also search that directory.])
fi
# Figure out what language subdirectories are present.
@@ -2761,11 +2555,9 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e
# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
-for lang in ${srcdir}/*/config-lang.in ..
+for lang in ${srcdir}/*/config-lang.in
do
case $lang in
- ..)
- ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
changequote(,)dnl
@@ -2794,10 +2586,9 @@ done
expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'`
found_languages=
subdirs=
-for lang in ${srcdir}/*/config-lang.in ..
+for lang in ${srcdir}/*/config-lang.in
do
case $lang in
- ..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
changequote(,)dnl
@@ -2925,7 +2716,6 @@ AC_SUBST(MAINT)dnl
lang_opt_files=
lang_specs_files=
-lang_options_files=
lang_tree_files=
for subdir in . $subdirs
do
@@ -2935,9 +2725,6 @@ do
if test -f $srcdir/$subdir/lang-specs.h; then
lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
fi
- if test -f $srcdir/$subdir/lang-options.h; then
- lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
- fi
if test -f $srcdir/$subdir/$subdir-tree.def; then
lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
fi
@@ -2951,6 +2738,8 @@ all_compilers=
all_stagestuff=
all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
# List of language makefile fragments.
+all_lang_makefrags=
+# List of language subdirectory makefiles. Deprecated.
all_lang_makefiles=
# Files for gengtype
all_gtfiles="$target_gtfiles"
@@ -2965,13 +2754,10 @@ all_gtfiles_files_files=
# The other mechanism is a set of hooks for each of the main targets
# like `clean', `install', etc.
-language_fragments="Make-lang"
language_hooks="Make-hooks"
-for s in .. $subdirs
+for s in $subdirs
do
- if test $s != ".."
- then
language=
boot_language=
compilers=
@@ -2984,9 +2770,9 @@ do
echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
exit 1
fi
- all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in"
+ all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$s/Make-lang.in"
if test -f ${srcdir}/$s/Makefile.in
- then all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Makefile.in"
+ then all_lang_makefiles="$s/Makefile"
fi
all_languages="$all_languages $language"
if test "x$boot_language" = xyes
@@ -2997,15 +2783,11 @@ do
all_stagestuff="$all_stagestuff $stagestuff"
all_outputs="$all_outputs $outputs"
all_gtfiles="$all_gtfiles $gtfiles"
- for f in .. $gtfiles
+ for f in $gtfiles
do
- if test $f != ".."
- then
all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
- fi
done
- fi
done
# Pick up gtfiles for c
@@ -3013,22 +2795,16 @@ gtfiles=
s="c"
. ${srcdir}/c-config-lang.in
all_gtfiles="$all_gtfiles $gtfiles"
-for f in .. $gtfiles
+for f in $gtfiles
do
- if test $f != ".."
- then
all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
- fi
done
check_languages=
-for language in .. $all_languages
+for language in $all_languages
do
- if test $language != ".."
- then
check_languages="$check_languages check-$language"
- fi
done
# Since we can't use `::' targets, we link each language in
@@ -3045,11 +2821,9 @@ target_list="all.build all.cross start.encap rest.encap tags \
for t in $target_list
do
x=
- for lang in .. $all_languages
+ for lang in $all_languages
do
- if test $lang != ".."; then
x="$x $lang.$t"
- fi
done
echo "lang.$t: $x" >> Make-hooks
done
@@ -3131,9 +2905,6 @@ AC_SUBST(slibdir)
objdir=`${PWDCMD-pwd}`
AC_SUBST(objdir)
-# Process the language and host/target makefile fragments.
-${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
-
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
@@ -3142,20 +2913,21 @@ AC_SUBST(all_compilers)
AC_SUBST(all_gtfiles)
AC_SUBST(all_gtfiles_files_langs)
AC_SUBST(all_gtfiles_files_files)
+AC_SUBST(all_lang_makefrags)
AC_SUBST(all_lang_makefiles)
AC_SUBST(all_languages)
AC_SUBST(all_stagestuff)
AC_SUBST(build_exeext)
AC_SUBST(build_install_headers_dir)
AC_SUBST(build_xm_file_list)
-AC_SUBST(build_xm_file)
+AC_SUBST(build_xm_include_list)
AC_SUBST(build_xm_defines)
AC_SUBST(check_languages)
AC_SUBST(cc_set_by_configure)
AC_SUBST(quoted_cc_set_by_configure)
AC_SUBST(cpp_install_dir)
-AC_SUBST(dep_host_xmake_file)
-AC_SUBST(dep_tmake_file)
+AC_SUBST(xmake_file)
+AC_SUBST(tmake_file)
AC_SUBST(extra_headers_list)
AC_SUBST(extra_objs)
AC_SUBST(extra_parts)
@@ -3171,12 +2943,11 @@ AC_SUBST(gcc_version_trigger)
AC_SUBST(host_exeext)
AC_SUBST(host_extra_gcc_objs)
AC_SUBST(host_xm_file_list)
-AC_SUBST(host_xm_file)
+AC_SUBST(host_xm_include_list)
AC_SUBST(host_xm_defines)
AC_SUBST(out_host_hook_obj)
AC_SUBST(install)
AC_SUBST(lang_opt_files)
-AC_SUBST(lang_options_files)
AC_SUBST(lang_specs_files)
AC_SUBST(lang_tree_files)
AC_SUBST(local_prefix)
@@ -3189,20 +2960,18 @@ AC_SUBST(quoted_stage_prefix_set_by_configure)
AC_SUBST(symbolic_link)
AC_SUBST(thread_file)
AC_SUBST(tm_file_list)
-AC_SUBST(tm_file)
+AC_SUBST(tm_include_list)
AC_SUBST(tm_defines)
AC_SUBST(tm_p_file_list)
-AC_SUBST(tm_p_file)
-AC_SUBST(xm_file)
+AC_SUBST(tm_p_include_list)
+AC_SUBST(xm_file_list)
+AC_SUBST(xm_include_list)
AC_SUBST(xm_defines)
AC_SUBST(target_alias)
AC_SUBST(c_target_objs)
AC_SUBST(cxx_target_objs)
AC_SUBST(target_cpu_default)
-AC_SUBST_FILE(target_overrides)
-AC_SUBST_FILE(host_overrides)
-AC_SUBST_FILE(language_fragments)
AC_SUBST_FILE(language_hooks)
# Echo that links are built
@@ -3242,6 +3011,11 @@ case x$CONFIG_HEADERS in
xauto-host.h:config.in)
echo > cstamp-h ;;
esac
+# Make sure all the subdirs exist.
+for d in $subdirs
+do
+ test -d $d || mkdir $d
+done
# If the host supports symlinks, point stage[1234] at ../stage[1234] so
# bootstrapping and the installation procedure can still use
# CC="stage1/xgcc -Bstage1/". If the host doesn't support symlinks,
@@ -3249,8 +3023,7 @@ esac
# This is virtually a duplicate of what happens in configure.lang; we do
# an extra check to make sure this only happens if ln -s can be used.
if test "$symbolic_link" = "ln -s"; then
- for d in .. ${subdirs} fixinc ; do
- if test $d != ..; then
+ for d in ${subdirs} fixinc ; do
STARTDIR=`${PWDCMD-pwd}`
cd $d
for t in stage1 stage2 stage3 stage4 stageprofile stagefeedback include
@@ -3259,7 +3032,6 @@ if test "$symbolic_link" = "ln -s"; then
$symbolic_link ../$t $t 2>/dev/null
done
cd $STARTDIR
- fi
done
else true ; fi
],
diff --git a/gcc/conflict.c b/gcc/conflict.c
index 0aec9273b0e..c832b7df52c 100644
--- a/gcc/conflict.c
+++ b/gcc/conflict.c
@@ -148,8 +148,7 @@ arc_eq (const void *arcp1, const void *arcp2)
conflict_graph
conflict_graph_new (int num_regs)
{
- conflict_graph graph
- = (conflict_graph) xmalloc (sizeof (struct conflict_graph_def));
+ conflict_graph graph = xmalloc (sizeof (struct conflict_graph_def));
graph->num_regs = num_regs;
/* Set up the hash table. No delete action is specified; memory
@@ -161,10 +160,8 @@ conflict_graph_new (int num_regs)
obstack_init (&graph->arc_obstack);
/* Create and zero the lookup table by register number. */
- graph->neighbor_heads
- = (conflict_graph_arc *) xmalloc (num_regs * sizeof (conflict_graph_arc));
+ graph->neighbor_heads = xcalloc (num_regs, sizeof (conflict_graph_arc));
- memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
return graph;
}
@@ -206,8 +203,7 @@ conflict_graph_add (conflict_graph graph, int reg1, int reg2)
/* Allocate an arc. */
arc
- = (conflict_graph_arc)
- obstack_alloc (&graph->arc_obstack,
+ = obstack_alloc (&graph->arc_obstack,
sizeof (struct conflict_graph_arc_def));
/* Record the reg numbers. */
diff --git a/gcc/convert.c b/gcc/convert.c
index fc001b6e74e..9096541fe2a 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -203,7 +203,7 @@ convert_to_real (tree type, tree expr)
if (itype != type && FLOAT_TYPE_P (type))
switch (TREE_CODE (expr))
{
- /* convert (float)-x into -(float)x. This is always safe. */
+ /* Convert (float)-x into -(float)x. This is always safe. */
case ABS_EXPR:
case NEGATE_EXPR:
if (TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr)))
@@ -211,7 +211,7 @@ convert_to_real (tree type, tree expr)
fold (convert_to_real (type,
TREE_OPERAND (expr, 0))));
break;
- /* convert (outertype)((innertype0)a+(innertype1)b)
+ /* Convert (outertype)((innertype0)a+(innertype1)b)
into ((newtype)a+(newtype)b) where newtype
is the widest mode from all of these. */
case PLUS_EXPR:
@@ -320,6 +320,7 @@ convert_to_integer (tree type, tree expr)
if (TREE_CODE_CLASS (ex_form) == '<')
{
+ expr = copy_node (expr);
TREE_TYPE (expr) = type;
return expr;
}
@@ -328,6 +329,7 @@ convert_to_integer (tree type, tree expr)
|| ex_form == TRUTH_OR_EXPR || ex_form == TRUTH_ORIF_EXPR
|| ex_form == TRUTH_XOR_EXPR)
{
+ expr = copy_node (expr);
TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
TREE_OPERAND (expr, 1) = convert (type, TREE_OPERAND (expr, 1));
TREE_TYPE (expr) = type;
@@ -336,6 +338,7 @@ convert_to_integer (tree type, tree expr)
else if (ex_form == TRUTH_NOT_EXPR)
{
+ expr = copy_node (expr);
TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
TREE_TYPE (expr) = type;
return expr;
@@ -346,7 +349,27 @@ convert_to_integer (tree type, tree expr)
we are truncating EXPR. */
else if (outprec >= inprec)
- return build1 (NOP_EXPR, type, expr);
+ {
+ enum tree_code code;
+
+ /* If the precision of the EXPR's type is K bits and the
+ destination mode has more bits, and the sign is changing,
+ it is not safe to use a NOP_EXPR. For example, suppose
+ that EXPR's type is a 3-bit unsigned integer type, the
+ TYPE is a 3-bit signed integer type, and the machine mode
+ for the types is 8-bit QImode. In that case, the
+ conversion necessitates an explicit sign-extension. In
+ the signed-to-unsigned case the high-order bits have to
+ be cleared. */
+ if (TREE_UNSIGNED (type) != TREE_UNSIGNED (TREE_TYPE (expr))
+ && (TYPE_PRECISION (TREE_TYPE (expr))
+ != GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (expr)))))
+ code = CONVERT_EXPR;
+ else
+ code = NOP_EXPR;
+
+ return build1 (code, type, expr);
+ }
/* If TYPE is an enumeral type or a type with a precision less
than the number of bits in its mode, do the conversion to the
@@ -450,7 +473,6 @@ convert_to_integer (tree type, tree expr)
case BIT_AND_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
- case BIT_ANDTC_EXPR:
trunc1:
{
tree arg0 = get_unwidened (TREE_OPERAND (expr, 0), type);
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 0bc7a26cecb..e6f4129dd79 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -167,15 +167,18 @@ read_counts_file (void)
}
else if ((tag = gcov_read_unsigned ()) != GCOV_VERSION)
{
- gcov_unsigned_t required = GCOV_VERSION;
+ char v[4], e[4];
+
+ GCOV_UNSIGNED2STRING (v, tag);
+ GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
warning ("`%s' is version `%.4s', expected version `%.4s'",
- da_file_name, (const char *)&tag, (const char *)&required);
+ da_file_name, v, e);
gcov_close ();
return;
}
- /* Read and discard the stamp. */
+ /* Read and discard the stamp. */
gcov_read_unsigned ();
counts_hash = htab_create (10,
@@ -229,7 +232,7 @@ read_counts_file (void)
else if (GCOV_TAG_IS_COUNTER (tag) && fn_ident)
{
counts_entry_t **slot, *entry, elt;
- unsigned n_counts = length / 8;
+ unsigned n_counts = GCOV_TAG_COUNTER_NUM (length);
unsigned ix;
elt.ident = fn_ident;
@@ -851,19 +854,18 @@ create_coverage (void)
rest_of_decl_compilation (ctor, 0, 1, 0);
announce_function (ctor);
current_function_decl = ctor;
- DECL_INITIAL (ctor) = error_mark_node;
make_decl_rtl (ctor, NULL);
init_function_start (ctor);
- (*lang_hooks.decls.pushlevel) (0);
expand_function_start (ctor, 0);
-
/* Actually generate the code to call __gcov_init. */
gcov_info_address = force_reg (Pmode, XEXP (DECL_RTL (gcov_info), 0));
emit_library_call (gcov_init_libfunc, LCT_NORMAL, VOIDmode, 1,
gcov_info_address, Pmode);
expand_function_end ();
- (*lang_hooks.decls.poplevel) (1, 0, 1);
+ /* Create a dummy BLOCK. */
+ DECL_INITIAL (ctor) = make_node (BLOCK);
+ TREE_USED (DECL_INITIAL (ctor)) = 1;
rest_of_compilation (ctor);
@@ -885,12 +887,12 @@ coverage_init (const char *filename)
int len = strlen (filename);
/* Name of da file. */
- da_file_name = (char *) xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1);
+ da_file_name = xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1);
strcpy (da_file_name, filename);
strcat (da_file_name, GCOV_DATA_SUFFIX);
/* Name of bbg file. */
- bbg_file_name = (char *) xmalloc (len + strlen (GCOV_NOTE_SUFFIX) + 1);
+ bbg_file_name = xmalloc (len + strlen (GCOV_NOTE_SUFFIX) + 1);
strcpy (bbg_file_name, filename);
strcat (bbg_file_name, GCOV_NOTE_SUFFIX);
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8d83247f636..7f85eaf9c79 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,1930 @@
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
+ method.c, optimize.c, pt.c, semantics.c, tree.c: Revert.
+
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
+ method.c, optimize.c, pt.c, semantics.c, tree.c: Update for
+ DECL_SOURCE_LOCATION rename and change to const.
+
+2003-09-20 Richard Henderson <rth@redhat.com>
+
+ * decl.c, decl2.c, pt.c: Use %J in diagnostics.
+
+2003-09-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/157
+ * parser.c (cp_parser_direct_declarator): Clear
+ parser->num_template_parameter_lists when parsing function
+ parameters.
+ (cp_parser_constructor_declarator_p): Likewise.
+
+2003-09-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/495
+ * pt.c (tsubst_friend_class): Only use innermost template
+ arguments for the injected friend class template.
+
+2003-09-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12332
+ * pt.c (instantiate_class_template): Increment
+ processing_template_decl around the tsubst of a template member
+ function.
+
+2003-09-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * decl.c (cxx_scope_descriptor): Fix thinko.
+ (struct cp_binding_level): Adjust type of binding_depth field.
+
+2003-09-18 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR c++/12320
+ * call.c (type_passed_as): Check for incomplete type.
+ (convert_for_arg_passing): Likewise.
+
+2003-09-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9848
+ * optimize.c (maybe_clone_body): Don't set MARK_USED on parameters
+ here.
+ * semantics.c (expand_body): Set it here on the remaining clones.
+
+2003-09-18 Roger Sayle <roger@eyesopen.com>
+
+ * lex.c (init_operators): Remove operator_name_info for FFS_EXPR.
+ * class.c (instantiate_type): Remove FFS_EXPR case.
+
+2003-09-18 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * ChangeLog: Fix recent commit.
+
+2003-09-18 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * ChangeLog: Add PR number to patch for PR c++/12316.
+
+2003-09-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * error.c (dump_type): Simplify. Use pp_type_specifier_seq for
+ "C" types.
+ * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko.
+
+2003-09-17 Richard Henderson <rth@redhat.com>
+
+ * semantics.c (expand_body): Don't save/restore input_location.
+
+2003-09-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12266
+ * cp-tree.h (tsubst_flags_t): Add tf_conv.
+ * class.c (standard_conversion): Pass tf_conv to
+ instantiate_type.
+ (resolve_address_of_overloaded_function): Do not call mark_used
+ when just checking conversions.
+
+ PR debug/12066
+ * cp-lang.c (LANG_HOOKS_BUILTIN_TYPE_DECLS): Define.
+ * cp-tree.h (cxx_builtin_type_decls): Declare.
+ * decl.c (builtin_type_decls): New variables.
+ (cxx_builtin_type_decls): New function.
+ (record_builtin_type): Add to builtin_type_decls.
+
+2003-09-17 Richard Henderson <rth@redhat.com>
+
+ PR c++/12316
+ * semantics.c (expand_or_defer_fn): Inc/dec function_depth.
+
+2003-09-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/7939
+ * typeck.c (comptypes): Don't ICE when its first argument is
+ error_mark_node.
+ (compparms): Reverse the arguments of same_type_p.
+
+2003-09-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12184
+ * typeck.c (convert_arguments): Return error_mark_node for an
+ incomplete parameter. Make error message more informative.
+
+2003-09-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/3907
+ * class.c (maybe_note_name_used_in_class): Refine test for whether
+ or not we are in a class scope.
+
+ * cp-tree.h (language_function): Remove x_expanding_p.
+ (expanding_p): Remove.
+ (doing_semantic_analysis_p): Remove.
+ (scope_kind): Add sk_function_parms, sk_class,
+ sk_namespace.
+ (innermost_scope_kind): New method.
+ * call.c (cxx_type_promotes_to): Use type_decays_to.
+ * cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine.
+ (LANG_HOOKS_POPLEVEL): Likewise.
+ * decl.c (cp_binding_level): Remove parm_flag, template_parms_p,
+ template_spec_p, namespace_p, is_for_scope, is_try_scope, and
+ is_catch_scope. Add kind and explicit_spec_p.
+ (cxx_scope_descriptor): Use a lookup table.
+ (find_class_binding_level): Use "kind" field in binding_level, not
+ the various flags.
+ (pop_binding_level): Likewise.
+ (innermost_nonclass_level): Likewise.
+ (toplevel_bindings_p): Likewise.
+ (namespace_bindings_p): Likewise.
+ (template_parm_scope_p): Likewise.
+ (innermost_scope_kind): New method.
+ (current_tmpl_spec_kind): Use "kind" field in binding_level, not
+ the various flags.
+ (pushlevel): Remove check for doing_semantic_analysis_p.
+ (begin_scope): Simplify.
+ (add_decl_to_level): Use "kind" field in binding_level, not
+ the various flags.
+ (push_local_binding): Likewise.
+ (pop_label): Remove check for doing_semantic_analysis_p.
+ (poplevel): Use "kind" field in binding_level, not
+ the various flags.
+ (set_block): Remove check for doing_semantic_analysis_p.
+ (pushlevel_class): Use "kind" field in binding_level, not
+ the various flags.
+ (poplevel_class): Likewise.
+ (initial_push_namespace_scope): Likewise.
+ (maybe_push_to_top_level): Likewise.
+ (set_identifier_type_value_with_scope): Likewise.
+ (pop_everything): Likewise.
+ (maybe_process_template_type_declaration): Likewise.
+ (pushtag): Likewise.
+ (pushdecl): Likewise.
+ (pushdecl_with_scope): Likewise.
+ (check_previous_goto_1): Likewise.
+ (define_label): Likewise.
+ (finish_case_label): Likewise.
+ (lookup_tag): Likewise.
+ (unqualified_namespace_lookup): Likewise.
+ (lookup_name_real): Likewise.
+ (lookup_name_current_level): Likewise.
+ (lookup_type_current_level): Likewise.
+ (record_builtin_type): Likewise.
+ (cp_make_fname_decl): Likewise.
+ (maybe_inject_for_scope_var): Likewise.
+ (cp_finish_decl): Remove check for doing_semantic_analysis_p.
+ (start_function): Use begin_scope, not pushlevel.
+ (finish_function): Use "kind" field in binding_level, not
+ the various flags.
+ (start_method): Use begin_scope, not pushlevel.
+ (make_label_decl): Do not check expanding_p.
+ (save_function-data): Do not set expanding_p.
+ (cxx_push_function_context): Do not clear expanding_p.
+ * semantics.c (cxx_expand_function_start): Do not set expanding_p.
+
+2003-09-14 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for
+ an bit-field whose width exceeds that of its type.
+
+2003-09-14 Geoffrey Keating <geoffk@apple.com>
+
+ * rtti.c (get_tinfo_decl): Set TREE_PUBLIC for typeinfo decls.
+
+2003-09-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ChangeLog: Follow spelling conventions.
+ * parser.c: Likewise.
+
+2003-09-13 Richard Henderson <rth@redhat.com>
+
+ * decl2.c (finish_file): Check cgraph_assemble_pending_functions
+ during relaxation loop.
+
+2003-09-11 David Edelsohn <edelsohn@gnu.org>
+
+ * decl2.c (var_finalized_p): Swap arms of conditional.
+
+2003-09-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11788
+ * typeck.c (build_address): If it is a function, mark it used.
+ (build_unary_op): Do not lose object's side-effects when taking
+ address of static member function.
+ * class.c (resolve_address_of_overloaded_function): Use
+ tsubst_flags_t parameter. Only expect overload sets. Adjust.
+ (instantiate_type): Adjust flags passing. Do not lose object's
+ side-effects when taking address of static member function.
+
+2003-09-11 Richard Henderson <rth@redhat.com>
+
+ * semantics.c (expand_or_defer_fn): Update for new
+ cgraph_finalize_function argument.
+
+2003-09-10 Richard Henderson <rth@redhat.com>
+
+ * decl2.c (cxx_callgraph_analyze_expr): Mark argument unused.
+
+2003-09-10 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (var_finalized_p): New.
+ (maybe_emit_vtables, write_out_vars, finish_file): Use it.
+
+2003-09-10 Richard Henderson <rth@redhat.com>
+
+ * decl2.c (cxx_callgraph_analyze_expr): New, from corpse of
+ mark_member_pointers.
+ (lower_function): Remove.
+ * cp-tree.h: Update to match.
+ * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New.
+ (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove.
+
+2003-09-09 Richard Henderson <rth@redhat.com>
+
+ * semantics.c (expand_or_defer_fn): Update call to
+ cgraph_finalize_function.
+
+ * semantics.c (expand_or_defer_fn): Use cgraph_finalize_function
+ always.
+
+ * decl2.c (finish_file): Avoid out-of-bounds array reference
+ during memmove.
+
+2003-09-09 Richard Henderson <rth@redhat.com>
+
+ * decl2.c (mark_member_pointers): Rename from
+ mark_member_pointers_and_eh_handlers and don't check eh handlers.
+
+2003-09-09 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+ PR bootstrap/12168
+ * method.c (use_thunk): Clear DECL_RTL of copied nodes.
+
+2003-09-08 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
+ c_register_builtin_type.
+
+ PR c++/11786
+ * decl2.c (add_function): Do not complain about seeing the same
+ non-function twice.
+ * semantics.c (perform_koenig_lookup): Improve documentation.
+
+ PR c++/5296
+ * pt.c (try_one_overload): Add addr_p parameter.
+ (resolve_overloaded_unification): Pass it.
+
+2003-09-08 Richard Henderson <rth@redhat.com>
+
+ * optimize.c (maybe_clone_body): Inc/dec function_depth.
+
+2003-09-08 Richard Henderson <rth@redhat.com>
+
+ * decl.c (finish_function): Clear current_function_decl.
+ * decl2.c (mark_used): Don't push/pop gc context.
+ * optimize.c (optimize_function): Likewise.
+ * tree.c (cp_cannot_inline_tree_fn): Likewise.
+ * pt.c (instantiate_decl): Inc/dec function_depth instead.
+ * semantics.c (expand_body): Update for tree_rest_of_compilation
+ nested argument.
+
+2003-09-07 Gabriel Dos Reis <gcc@integrable-solutions.net>
+
+ PR c++/11762
+ * error.c (dump_decl): Handle namespace-alias-definition.
+ * decl.c (warn_extern_redeclared_static): There is no point in
+ checking changes in storage class specifier for a namespace
+ declaration.
+ (duplicate_decls): Tidy diagnostic message.
+ * cxx-pretty-print.c (pp_cxx_left_brace): New macro.
+ (pp_cxx_right_brace): Likewise.
+ (pp_cxx_original_namespace_definition): New function.
+ (pp_cxx_namespace_alias_definition): Likewise.
+ (pp_cxx_declaration): Use them. Handle NAMESPACE_DECLs.
+
+2003-09-07 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (maybe_emit_vtables, write_out_vars, finish_file):
+ Avoid re-emitting variables in unit-at-a-time mode.
+
+2003-09-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11867
+ * call.c (standard_conversion): Improve comments.
+ (perform_direct_initialization): Make sure we return an expression
+ of the correct type.
+ * typeck.c (build_static_cast): Check for ambiguity and
+ accessibility when performing conversions.
+
+2003-09-06 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cp-tree.h (add_binding): Remove declaration.
+ * name-lookup.h (supplement_binding): Declare.
+ * decl.c (add_binding): Move to name-lookup.c.
+ (push_local_binding): Adjust.
+ (push_class_binding): Likewise.
+ (set_identifier_type_value_with_scope): Likewise.
+ * name-lookup.c (supplement_binding): Rename from add_binding.
+ Return a bool. Improve documentation.
+ (set_namespace_binding): Adjust.
+ * Make-lang.in (cp/name-lookup.o): Depend on toplev.h
+
+2003-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11794
+ * class.c (pushclass): Push dependent using decls for nested
+ classes of templates too.
+
+2003-09-06 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/11409
+ * class.c (resolve_address_of_overloaded_function): When building
+ list of matching non-template function decls, ignore anticipated
+ declarations of undeclared or shadowed GCC builtins.
+
+2003-09-06 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c++/11595
+ * decl.c (define_label): Remove unreachable timevar pop.
+ Always return the decl, even if the definition is invalid.
+
+2003-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12167
+ * parser.c (cp_parser_late_parsing_default_args): Push & pop the
+ unparsed functions queue.
+
+2003-09-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12163
+ * call.c (perform_direct_initialization): Correct logic for
+ direct-initialization of a class type.
+
+ PR c++/12146
+ * pt.c (lookup_template_function): Robustify.
+
+2003-09-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11922
+ * pt.c (tsubst_qualified_id): Make sure we get a non-type.
+ (tsubst_expr, tsubst_copy_and_build): Pass false, not zero, as
+ is_type_p to lookup_qualified_name.
+
+ * semantics.c (finish_call_expr): Refactor some code.
+
+ PR c++/12037
+ * cp-tree.h (COMPOUND_EXPR_OVERLOADED): New.
+ (build_min_non_dep): Declare.
+ * tree.c (build_min): Propagate TREE_SIDE_EFFECTS.
+ (build_min_non_dep): New.
+ * cvt.c (convert_to_void): Don't explicitly copy
+ TREE_SIDE_EFFECTS, TREE_NO_UNUSED_WARNING.
+ * call.c (build_new_method_call): Use build_min_non_dep.
+ * decl2.c (grok_array_decl): Likewise.
+ (build_offset_ref_call_from_tree): Likewise.
+ * typeck.c (finish_class_member_access_expr,
+ build_x_indirect_ref, build_x_binary_op, build_x_unary_op,
+ build_x_conditional_expr, build_x_compound_expr): Likewise.
+ (build_static_cast, build_reinterpret_cast,
+ build_const_cast): Propagate TREE_SIDE_EFFECTS inside a template.
+ * typeck2.c (build_x_arrow): Use build_min_non_dep.
+ (build_functional_cast): Propagate TREE_SIDE_EFFECTS inside a
+ template.
+ * rtti.c (build_dynamic_cast_1): Set DECL_IS_PURE.
+ (build_dynamic_cast): Set TREE_SIDE_EFFECTS.
+ * pt.c (build_non_dependent_expr): Check COMPOUND_EXPR_OVERLOADED.
+
+2003-09-04 Richard Henderson <rth@redhat.com>
+
+ * decl2.c (mark_member_pointers_and_eh_handlers): Update for
+ change in cgraph_mark_needed_node arguments.
+
+2003-09-02 Geoffrey Keating <geoffk@apple.com>
+
+ PR 12161
+ * decl2.c (mark_used): Use ggc_push_context/ggc_pop_context.
+ * tree.c (cp_cannot_inline_tree_fn): Likewise.
+
+2003-09-04 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (finish_sizeof, finish_alignof): Remove.
+ (expr_sizeof): Replace with ...
+ (cxx_sizeof_or_alignof_expr): ... here.
+ (cxx_sizeof_or_alignof_type): Make complain parameter a bool.
+ * parser.c (cp_parser_unary_expression): Commonize alignof and
+ sizeof handling.
+ * pt.c (tsubst_copy_and_build): Adjust alignof and sizeof
+ substitution.
+ * semantics.c (finish_sizeof, finish_alignof): Remove.
+ * typeck.c (cxx_sizeof_or_alignof_type): Complain parameter
+ becomes bool. Set TREE_READONLY.
+ (expr_sizeof): Replace with ...
+ (cxx_sizeof_or_alignof_expr): ... here. Clear TREE_SIDE_EFFECTS.
+
+2003-09-04 Mark Mitchell <mark@codesourcery.com>
+
+ Remove cast-as-lvalue extension.
+ * call.c (build_conditional_expr): Correct formatting.
+ (convert_like_real): Use lvalue_p, not non_cast_lvalue_p.
+ (initialize_real): Use real_lvalue_p, not real_non_cast_lvalue_p.
+ * cp-tree.h (non_cast_lvalue_p): Remove.
+ (real_non_cast_lvalue_p): Remove.
+ (non_cast_lvalue_or_else): Remove.
+ * tree.c (lvalue_p_1): Remove allow_cast_as_lvalue parameter.
+ (real_lvalue_p): Adjust call to lvalue_p_1.
+ (non_cast_lvalue_p): Remove.
+ (non_cast_lvalue_or_else): Remove.
+ (lvalue_p): Adjust call to lvalue_p_1.
+ (lvalue_or_else): Simplify.
+ * typeck.c (build_unary_op): Use lvalue_or_else, not
+ non_cast_lvalue_or_else.
+ (build_static_cast): Use real_lvalue_p, not real_non_cast_lvalue_p.
+
+2003-09-03 DJ Delorie <dj@redhat.com>
+
+ * decl.c (finish_function): Pass fndecl to aggregate_value_p.
+
+2003-09-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12053
+ * class.c (include_empty_classes): Correct logic for ABI version 1.
+
+2003-09-03 Richard Henderson <rth@redhat.com>
+
+ * optimize.c (optimize_function): Push/pop ggc context around
+ the call to optimize_inline_calls.
+
+2003-09-02 Scott Brumbaugh <scottb.lists@verizon.net>
+
+ PR c++/11553
+ * parser.c (cp_parser_decl_specifier_seq): Add check for a
+ duplicate friend decl-specifier.
+
+2003-09-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11847
+ * pt.c (convert_nontype_argument): Correct representation of
+ REFERENCE_TYPE expressions.
+
+ PR c++/11808
+ * cp-tree.h (KOENIG_LOOKUP_P): New macro.
+ (finish_call_expr): Change prototype.
+ * parser.c (cp_parser_postfix_expression): Adjust call to
+ finish_call_expr.
+ * pt.c (tsubst_copy_and_build): Use KOENIG_LOOKUP_P.
+ * semantics.c (finish_call_expr): Add koenig_p parameter.
+
+2003-09-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12114
+ * cp-tree.h (initialize_reference): Change prototype.
+ * call.c (initialize_reference): Add cleanup parameter.
+ * decl.c (grok_reference_init): Likewise.
+ (check_initializer): Likewise.
+ (cp_finish_decl): Insert a CLEANUP_STMT if necessary.
+ (duplicate_decls): When replacing an anticipated builtin, do not
+ honor TREE_NOTHROW.
+ * typeck.c (convert_for_initialization): Correct call to
+ initialize_reference.
+
+ PR c++/11972
+ * pt.c (dependent_type_p_r): Pass only the innermost template
+ arguments to any_dependent_template_arguments_p.
+
+2003-09-01 Josef Zlomek <zlomekj@suse.cz>
+
+ * error.c (dump_expr): Kill BIT_ANDTC_EXPR.
+ * lex.c (init_operators): Kill BIT_ANDTC_EXPR.
+ * pt.c (tsubst_copy): Kill BIT_ANDTC_EXPR.
+ * typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR.
+ (tsubst_copy_and_build): Kill BIT_ANDTC_EXPR.
+
+2003-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12093
+ * pt.c (build_non_dependent_expr): Do not build a
+ NON_DEPENDENT_EXPR for a STRING_CST.
+
+ PR c++/11928
+ * search.c (add_conversions): Avoid adding two conversion
+ operators for the same type.
+
+2003-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/6196
+ * pt.c (tsubst_copy_and_build): Correct handling of
+ address-of-label extension.
+ * semantics.c (finish_goto_stmt): The address of a label must go
+ through the lvalue-to-rvalue conversion.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+ Jason Merrill <jason@redhat.com>
+
+ * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New.
+ (LANG_HOOKS_RTL_EXPAND_STMT): New.
+ * cp-tree.h (cxx_expand_function_start): Declare.
+ * decl.c (start_function): Use allocate_struct_function.
+ Move stmts_are_full_exprs_p assertion from expand_body.
+ Do not free_after_parsing or free_after_compilation.
+ (cxx_push_function_context): Move code to set struct function
+ data from genrtl_start_function.
+ * optimize.c (optimize_function): Don't inc/dec function_depth.
+ * semantics.c (expand_body): Use tree_rest_of_compilation.
+ (cxx_expand_function_start): Rename from genrtl_start_function,
+ omit bits done by tree_rest_of_compilation.
+ (genrtl_finish_function): Remove.
+ (clear_decl_rtl): Move to ../tree-optimize.c.
+
+2003-08-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/11811
+ * cxx-pretty-print.c (pp_cxx_canonical_template_parameter): New
+ function.
+ * cxx-pretty-print.h: Declare.
+ * error.c (dump_template_parameter): Use it.
+ (dump_type): Likewise.
+
+2003-08-28 Mark Mitchell <mark@codesourcery.com>
+
+ * init.c (decl_constant_value): Deal with COND_EXPR specially.
+ * call.c (build_conditional_expr): Revert previous patch.
+
+ PR optimization/5079
+ * call.c (build_conditional_expr): Use decl_constant_value to
+ simplify the arguments.
+
+2003-08-26 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * parser.c (struct cp_token): Use enum bitfields.
+ (CP_TOKEN_BLOCK_NUM_TOKENS): Make sure cp_token_block fits in a
+ 512B allocation unit.
+ (cp_parser_token_tree_map_node): Use enum bitfields.
+
+2003-08-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11871
+ * decl.c (push_class_level_binding): Correct old_decl value from
+ my 2003-07-29 reorganization.
+
+ * call.c (build_call): Don't set TREE_SIDE_EFFECTS here.
+ (build_new_method_call): Add goto finish.
+ * semantics.c (simplify_aggr_init_exprs_r): Don't set
+ TREE_SIDE_EFFECTS on a call.
+
+2003-08-25 Richard Henderson <rth@redhat.com>
+
+ * cxx-pretty-print.c (pp_cxx_class_name): Remove unused function.
+
+2003-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag.
+ (cxx_pretty_printer): Adjust base type.
+ (pp_cxx_function_specifier): Declare.
+ * cxx-pretty-print.c (pp_cxx_whitespace): New macro.
+ (pp_cxx_left_paren): Likewise.
+ (pp_cxx_right_paren): Likewise.
+ (pp_cxx_dot): Likewise.
+ (pp_cxx_arrow): Likewise.
+ (pp_cxx_semicolon): Likewise.
+ (pp_cxx_identifier): Likewise.
+ (pp_cxx_cv_qualifier_seq): Likewise.
+ (pp_cxx_storage_class_specifier): Likewise.
+ (pp_cxx_expression_list): Likewise.
+ (pp_cxx_space_for_pointer_operator): Likewise.
+ (pp_cxx_init_declarator): Likewise.
+ (pp_cxx_call_argument_list): Likewise.
+ (pp_cxx_nonconsecutive_character): Tidy.
+ (pp_cxx_conversion_function_id): New function.
+ (pp_cxx_template_id): Likewise.
+ (pp_cxx_template_keyword_if_needed): Likewise.
+ (pp_cxx_nested_name_specifier): Likewise.
+ (pp_cxx_unqualified_id): Tidy
+ (pp_cxx_qualified_id): Handle more nodes.
+ (pp_cxx_primary_expression): Tidy.
+ (pp_cxx_postfix_expression): Likewise.
+ (pp_cxx_new_expression): Tidy.
+ (pp_cxx_delete_expression): Likewise.
+ (pp_cxx_cast_expression): New function.
+ (pp_cxx_pm_expression): Tidy.
+ (pp_cxx_conditional_expression): Likewise.
+ (pp_cxx_assignment_operator): New function.
+ (pp_cxx_assignment_expression): Tidy.
+ (pp_cxx_expression): New function.
+ (pp_cxx_function_specifier): Likewise.
+ (pp_cxx_decl_specifier_seq): Likewise.
+ (pp_cxx_simple_type_specifier): Tidy.
+ (pp_cxx_type_specifier_seq): Likewise.
+ (pp_cxx_ptr_operator): New function.
+ (pp_cxx_implicit_parameter_type): Likewise.
+ (pp_cxx_parameter_declaration): Tidy.
+ (pp_cxx_parameter_declaration_clause): New function.
+ (pp_cxx_exception_specification): Likewise.
+ (pp_cxx_direct_declarator): Tidy.
+ (pp_cxx_declarator): Likewise.
+ (pp_cxx_ctor_initializer): New function.
+ (pp_cxx_function_definition): Likewise.
+ (pp_cxx_abstract_declarator): Tidy.
+ (pp_cxx_direct_abstract_declarator): Likewise.
+ (pp_cxx_type_id): Likewise.
+ (pp_cxx_exception_declaration): New function.
+ (pp_cxx_statement): Likewise.
+ (pp_cxx_simple_declaration): Likewise.
+ (pp_cxx_template_parameter_list): Likewise.
+ (pp_cxx_template_parameter): Likewise.
+ (pp_cxx_template_declaration): Likewise.
+ (pp_cxx_explicit_specialization): Likewise.
+ (pp_cxx_explicit_instantiation): Likewise.
+ (pp_cxx_declaration): Tidy.
+ (pp_cxx_pretty_printer_init): Initialize more fields.
+
+2003-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8795
+ * cp-tree.h (build_cplus_method_type): Remove.
+ * call.c (standard_conversion): Use build_method_type_directly
+ instead of build_cplus_method_type.
+ * class.c (build_clone): Likewise.
+ (adjust_clone_args): Likewise.
+ * decl.c (build_ptrmem_type): Likewise.
+ (grokdeclarator): Likewise.
+ (check_function_type): Likewise.
+ * decl2.c (grok_method_quals): Likewise.
+ (maybe_retrofit_in_chrg): Likewise.
+ * pt.c (copy_default_args_to_explicit_spec): Likewise.
+ (tsubst_function_type): Likewise.
+ (tsubst): Likewise.
+ * tree.c (build_cplus_method_type): Remove.
+ * typeck.c (merge_types): Use build_method_type_directly.
+
+2003-08-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/3765
+ * search.c (dfs_access_in_type): Fix typo in comment.
+ (dfs_accessible_queue_p): Likewise.
+ (dfs_accessible_p): Only terminate when a friend is found.
+ (accessible_p): Return immediately if access_in_type allows
+ access.
+
+2003-08-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/641, c++/11876
+ * friend.c (add_friend): Add complain parameter.
+ (make_friend_class): Likewise.
+ (do_friend): Adjust add_friend call.
+ * decl.c (grokdeclarator): Adjust make_friend_class call.
+ * parser.c (cp_parser_member_declaration): Likewise.
+ (cp_parser_template_declaration_after_exp): Likewise.
+ * pt.c (instantiate_class_template): Adjust make_friend_class
+ and add_friend call.
+ * cp-tree.h (make_friend_class): Adjust declaration.
+ (add_friend): Likewise.
+
+2003-08-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/11283
+ * call.c (build_conditional_expr): Ignore cv-qual differences for
+ non-class types.
+
+2003-08-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11551
+ * parser.c (cp_parser_id_expression): Add declarator_p parameter.
+ (cp_parser_primary_expression): Adjust call to
+ cp_parser_id_expression.
+ (cp_parser_unqualified_id): Complain about the use of
+ typedef-names in a destructor declarator.
+ (cp_parser_postfix_expression): Adjust call to
+ cp_parser_id_expression.
+ (cp_parser_type_parameter): Likewise.
+ (cp_parser_template_argument): Likewise.
+ (cp_parser_declarator_id): Likewise.
+
+ PR c++/11919
+ * call.c (standard_conversion): Use same_type_p, not pointer
+ equality, to compare types.
+
+ PR c++/10762
+ * parser.c (cp_parser_using_declaration): Check for invalid uses
+ of template-ids here...
+ * decl2.c (do_class_using_decl): ... rather than here.
+
+2003-08-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11834
+ * pt.c (more_specialized): Bump processing_template_decl.
+
+2003-08-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/11614
+ * decl.c (grokdeclarator): Recognize a flexible array based on the
+ type, not the form of the declarator.
+
+2003-08-20 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (simplify_aggr_init_expr): Split out from
+ simplify_aggr_init_exprs_r. Convert slot address to match
+ the return type.
+ * cp-tree.h: Declare it.
+ * tree.c (cp_copy_res_decl_for_inlining): Don't clobber the
+ DECL_NAME of a user variable.
+
+2003-08-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11945
+ * pt.c (build_non_dependent_expr): Look inside COND_EXPR and
+ COMPOUND_EXPR.
+ * semantics.c (finish_expr_stmt): Always convert to void.
+ * typeck.c (build_x_compound_exp): Always convert to void.
+
+2003-08-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11684
+ * cp-tree.h (grok_op_properties): Change prototype.
+ * decl.c (grok_op_properties): Add complain parameter.
+ (grokfndecl): Pass it.
+ * pt.c (tsubst_decl): Adjust accordingly.
+
+ PR c++/10926
+ * decl.c (start_method): Return immediately if push_template_decl
+ does not like the declaration.
+ * pt.c (push_template_decl_real): Disallow member template
+ destructors.
+
+ PR c++/11036
+ * cp-tree.h (add_binding): Add prototype.
+ * class.c (add_method): Set TYPE_HAS_DESTRUCTOR if appropriate.
+ (maybe_warn_about_overly_private_class): Use
+ CLASSTYPE_DESTRUCTORS.
+ (pushclass): Adjust call to set_identifier_type_value.
+ * decl.c (add_binding): Give it external linkage.
+ (push_local_binding): Adjust call to add_binding.
+ (push_class_binding): Likewise.
+ (set_identifier_type_value_with_scope): Change prototype. Use
+ add_binding for global bindings.
+ (set_identifier_type_value): Adjust accordingly.
+ (pushtag): Likewise.
+ (pushdecl): Use set_identifier_type_value, not
+ set_identifier_type_value_with_scope.
+ (pushdecl_namespace_level): Adjust calls to
+ SET_IDENTIFIER_TYPE_VALUE to pass a DECL.
+ (pushdecl_class_level): Likewise.
+ (lookup_tag): Use select_decl.
+ (select_decl): Improve comment.
+ (record_builtin_type): Do not call pushdecl.
+ (cxx_init_decl_processing): Do not call xref_tag for bad_alloc.
+ (cp_finish_decl): Adjust call to set_identifier_type_value.
+ (check_elaborated_type_specifier): Improve checks for invalid uses
+ of typedefs.
+ (xref_tag): Adjust call to check_elaborated_type_specifier.
+ * decl2.c (grokclassfn): Do not set TYPE_HAS_DESTRUCTOR.
+ * name-lookup.c (set_namespace_binding): Use add_binding.
+ * parser.c (cp_parser_simple_type_specifier): Return a TYPE_DECL,
+ rather than an IDENTIFIER_NODE, to represent built-in types, if
+ requested by the caller.
+ (cp_parser_postfix_expression): Adjust call.
+ (cp_parser_type_specifier): Likewise.
+ (cp_parser_elaborated_type_specifier): Adjust call to
+ check_elaborated_type_specifier.
+ * typeck2.c (build_functional_cast): Do not perform name lookups.
+
+ PR c++/10717
+ * decl.c (expand_static_init): Remove unncessary code.
+
+2003-08-19 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/10538, PR c/5582
+ * cp/cp-lang.c (LANG_HOOKS_DECL_UNINIT): Define.
+
+2003-08-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11174
+ * init.c (build_offset_ref): Perform access checking for
+ pointer to member correctly.
+
+2003-08-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling.
+
+2003-08-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11957
+ * cp-tree.h (finish_stmt_expr): Add bool parameter.
+ * init.c (finish_init_stmts): Pass true to finish_stmt_expr. Don't
+ adjust the stmt_expr here.
+ (build_vec_init): Use finish_stmt_expr_expr, convert result to
+ array type.
+ * parser.c (cp_parser_primar_expression): Adjust finish_stmt_expr
+ call.
+ * pt.c (tsubst_copy): Likewise.
+ * semantics.c (finish_stmt_expr): Add parameter.
+
+ * pt.c (instantiate_class_template): Push to class's scope before
+ tsubsting base.
+
+2003-08-17 Jan Hubicka <jh@suse.cz>
+
+ PR C++/11702
+ * semantics.c (finish_id_expression): Mark all functions as used.
+
+2003-08-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11512
+ * cvt.c (convert_to_void): Indicate which side of conditional has
+ no effects, and rhs of comma operator. Test for no sideeffect
+ expressions here and always build a convert expr.
+ * init.c (expand_default_init): Convert the init to void.
+ * typeck.c (build_x_compound_expr): Do not check for side effects
+ here.
+ (build_compound_expr): Do not convert lhs when building a
+ template.
+
+2003-08-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.def (NON_DEPENDENT_EXPR): Add operand.
+ * decl2.c (build_offset_ref_call_from_tree): Use
+ build_non_dependent_expr.
+ * error.c (dump_expr) <NON_DEPENDENT_EXPR case>: Dump the operand.
+ * pt.c (build_non_dependent_expr): Set operand.
+
+2003-08-14 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (mark_member_pointers): Rename to...
+ (mark_member_pointers_and_eh_tinfos): ... this one; deal with eh tinfos
+ (lower_function): Update call.
+ * except.c (eh_type_info): Break out from ...
+ (build_eh_type): ... here; tinfo is already used.
+ (finish_eh_spec_block): Mark tinfos as used.
+ * semantics.c (finish_handler_params): Mark tinfo as used.
+ * cp-tree.h (eh_type_info): Declare.
+
+2003-08-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * pt.c (instantiate_class_template): Set location before
+ substuting bases.
+
+ * decl.c (make_typename_type): Use my_friendly_assert.
+ * pt.c (tsubst_aggr_type): Rearrange context substitution.
+
+2003-08-14 Jan Hubicka <jh@suse.cz>
+
+ * method.c (use_thunk): Expand body directly.
+
+2003-08-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11703
+ * call.c (type_passed_as): Use TYPE_SIZE, not TYPE_PRECISION to
+ determine whether or not to promote types.
+ (convert_for_arg_passing): Likewise.
+ * decl2.c (cp_build_parm_decl): Do not set DECL_ARG_TYPE in
+ templates.
+ * pt.c (tsubst_decl): Do not expect it to be set.
+
+ PR c++/9512
+ PR c++/10923
+ * cp-tree.h (check_elaborated_type_specifier): Declare.
+ (handle_class_head): Remove.
+ (note_got_semicolon): Likewise.
+ (note_list_got_semicolon): Likewise.
+ (finish_class_definition): Likewise.
+ * decl.c (check_elaborated_type_specifier): Make it public.
+ Robustify.
+ (handle_class_head): Remove.
+ * parser.c (cp_parser_elaborated_type_specifier): Use
+ check_elaborated_type_specifier.
+ (cp_parser_class_specifier): Do not call finish_class_definition.
+ (cp_parser_class_head): Or handle_class_head. Check for
+ over-qualified names.
+ * semantics.c (finish_class_definition): Remove.
+
+ * parser.c (cp_parser_check_for_definition_in_return_type): New
+ function.
+ (cp_parser_simple_declaration): Adjust call to
+ cp_parser_init_declarator.
+ (cp_parser_decl_specifier_seq): Change type of
+ declares_class_or_enum parameter.
+ (cp_parser_explicit_instantiation): Adjust accordingly.
+ (cp_parser_type_specifier): Change type of
+ declares_class_or_enum parameter.
+ (cp_parser_init_declarator): Add declares_class_or_enum
+ parameter.
+ (cp_parser_parameter_declaration): Adjust call to
+ cp_parser_decl_specifier_seq.
+ (cp_parser_function_definition): Likewise.
+ (cp_parser_member_declaration): Likewise.
+ (cp_parser_single_declaration): Likewise.
+
+ * cp-tree.h (lang_type_class): Remove has_call_overloaded,
+ has_array_ref_overloaded, has_arrow_overloaded, and got_semicolon.
+ (TYPE_OVERLOADS_CALL_EXPR): Remove.
+ (TYPE_OVERLOADS_ARRAY_REF): Likewise.
+ (TYPE_OVERLOADS_ARROW): Likewise.
+ (CLASSTYPE_GOT_SEMICOLON): Likewise.
+ * class.c (check_bases): Do not set them.
+ (finish_struct_1): Likewise.
+ * decl.c (cp_finish_decl): Do not set CLASSTYPE_GOT_SEMICOLON.
+ (build_ptrmemfunc_type): Likewise.
+ (grok_op_properties): Do not set TYPE_OVERLOADS_*.
+ (start_function): Do not check CLASSTYPE_GOT_SEMICOLON.
+ * decl2.c (grokfield): Do not set CLASSTYPE_GOT_SEMICOLON.
+ * lex.c (note_got_semicolon): Remove.
+ (note_list_got_semicolon): Likewise.
+ * parser.c (cp_parser_simple_declaration): Do not call
+ note_list_got_semicolon.
+ * pt.c (list_eq): Remove.
+ (lookup_template_class): Do not set CLASSTYPE_GOT_SEMICOLON.
+ (instantiate_class_template): Do not set TYPE_OVERLOADS*.
+ (instantiate_class_template): Do not set CLASSTYPE_GOT_SEMICOLON.
+ * ptree.c (cxx_print_type): Do not print them.
+ * semantics.c (finish_member_class_template): Do not call
+ note_list_got_semicolon.
+
+2003-08-11 Aldy Hernandez <aldyh@redhat.com>
+
+ * call.c (standard_conversion): Opaque pointers interconvert.
+
+ * testsuite/g++.dg/other/opaque-3.C: New.
+
+2003-08-11 Mark Mitchell <mark@codesourcery.com>
+
+ * typeck.c (merge_types): Handle cv-qualified pointer-to-member
+ types correctly.
+
+2003-08-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11789
+ * cp-tree.h (get_vbase): Remove.
+ (get_vbase_types): Remove.
+ * init.c (expand_member_init): Correct logic for looking up base
+ classes.
+
+2003-08-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * error.c (dump_expr): Tidy.
+ * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New.
+ (pp_cxx_begin_template_argument_list): Likewise.
+ (pp_cxx_end_template_argument_list): Likewise.
+ (is_destructor_name): Likewise.
+ (pp_cxx_unqualified_id): Likewise.
+ (pp_cxx_qualified_id): Likewise.
+ (pp_cxx_id_expression): Likewise.
+ (pp_cxx_new_expression): Likewise.
+ (pp_cxx_delete_expression): Likewise.
+ (pp_cxx_pm_expression): Likewise.
+ (pp_cxx_type_specifier): Rework.
+ (pp_cxx_type_id): Likewise.
+ (pp_cxx_primary_expression): Likewise.
+ (pp_cxx_postfix_expression): Likewise.
+ (pp_cxx_unary_expression): Likewise.
+ (pp_cxx_multiplicative_expression): Likewise.
+ (pp_cxx_conditional_expression): Likewise.
+ (pp_cxx_assignment_expression): Likewise.
+ (pp_cxx_pretty_printer_init): Tidy.
+
+2003-08-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL
+ NODE is always a TREE_VEC of nonzero size.
+ (NUM_TMPL_ARGS): NODE is always a TREE_VEC.
+ * decl2.c (arg_assoc): Template args will be a vec.
+ * error.c (dump_decl) <TEMPLATE_ID_EXPR case>: Call
+ dump_template_argument_list.
+ (dump_template_parms): Args will be a vec.
+ * parser.c (cp_parser_template_argument_list): Produce a
+ vector, not a list.
+ * pt.c (coerce_template_parms): Args are always vectors.
+ (mangle_class_name_for_template): Likewise.
+ (lookup_template_function): Likewise.
+ (lookup_template_class): Likewise.
+ (tsubst_template_args): Likewise.
+ (tsubst_baselink): Use tsubst_template_args.
+ (tsubst_qualified_id): Likewise.
+ (tsubst_copy) <TEMPLATE_ID_EXPR case>: Likewise.
+ (tsubst_copy_and_build) <TEMPLATE_ID_EXPR case>: Likewise.
+ (any_dependent_template_args_p): Args are always vectors.
+ * tree.c (cp_tree_equal): Add TEMPLATE_ID_EXPR case.
+
+ PR c++/11670
+ * call.c (convert_like_real): Add rvalue binding error message.
+ * error.c (dump_expr) <NOP_EXPR case>: Detect when the no expr is
+ really a cast.
+
+ PR c++/10530
+ * pt.c (dependent_type_p_r): A dependent template-id is a class
+ type with dependent template arguments, or a bound template
+ template parameter.
+ (type_dependent_expression_p): A template function decl cannot
+ have a dependent context.
+
+2003-08-07 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5767
+ * parser.c (cp_parser_class_name): Return immediately when scope
+ is error_mark_node.
+
+2003-08-07 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp/Make-lang.in (cp/call.o): Add dependency for target.h.
+
+ * cp/call.c (standard_conversion): Support opaque types.
+ Include target.h.
+ (strip_top_quals): Use cp_build_qualified_type instead of
+ TYPE_MAIN_VARIANT.
+
+ * cp/typeck.c (convert_for_assignment): Support opaque types.
+
+ * testsuite/g++.dg/other/opaque-1.C: New.
+
+ * testsuite/g++.dg/other/opaque-2.C: New.
+
+2003-08-06 Aldy Hernandez <aldyh@redhat.com>
+
+ * decl.c (grokparms): Use cp_build_qualified_type instead
+ TYPE_MAIN_VARIANT.
+
+2003-08-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cxx-pretty-print.h: New file.
+ * cxx-pretty-print.c: Likewise.
+ * error.c (scratch_pretty_printer): Change type.
+ (init_error): Tidy.
+ (dump_aggr_type): Likewise.
+ (dump_global_iord): Likewise.
+ (dump_expr): Likewise.
+ (dump_char): Remove.
+ * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define.
+ (cxx_initialize_diagnostics): New function.
+ * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o
+ (CXX_PRETTY_PRINT_H): New variable.
+ (cp/cxx-pretty-print.o): New rule.
+ (cp/cp-lang.o): Update dependence.
+ (cp/error.o): Likewise.
+
+2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
+
+ * cp-tree.h (struct lang_decl): Don't include c_lang_decl.
+ (DECL_DECLARED_INLINE_P): Remove.
+ * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P
+ if decl is a FUNCTION_DECL. This never made sense, but now it is
+ required to avoid a tree check failure.
+ * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC.
+ * optimize.c (maybe_clone_body): Likewise.
+
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ * decl.c (cxx_insert_default_attributes): Delete.
+ * cp-tree.h (cxx_insert_default_attributes): Don't prototype.
+ * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
+
+2003-08-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11704
+ * pt.c (type_dependent_expression_p): Cope with COMPONENT_REF with
+ unknown type.
+
+ PR c++/11766
+ * typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to
+ member functions.
+
+2003-08-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9447
+ * cp-tree.def (USING_DECL): Document its type.
+ * class.c (pushclass): If we're entering a template, push any
+ dependent using decls it has.
+ * decl2.c (do_class_using_decl): Refactor. Type is NULL iff it is
+ a dependent scope.
+ * pt.c (tsubst_decl) <USING_DECL case>: Set type.
+ (tsubst): Remove USING_DECL checks.
+ (type_dependent_expression_p): Remove USING_DECL case.
+ * semantics.c (finish_member_declaration): A USING_DECL's type
+ indicates whether it is dependent.
+
+2003-08-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (pushclass): Remove unneeded parameter.
+ * class.c (pushclass): Remove unneeded MODIFY parm. Adjust.
+ (push_nested_class): Adjust pushclass call.
+ * pt.c (instantiate_class_template): Likewise.
+ * semantics.c (begin_class_definition): Likewise.
+
+2003-08-01 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * typeck2.c (add_exception_specifier): Use 'bool' where appropriate.
+
+2003-08-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11697
+ * decl.c (decls_match): Don't ignore the types of template
+ classes.
+
+ PR c++/11744
+ * pt.c (tsubst_copy_and_build): Refine Koenig lookup logic.
+
+2003-08-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/8442, c++/8806
+ * decl.c (qualify_lookup): Accept TEMPLATE_DECL if types are
+ preferred.
+ (check_elaborated_type_specifier): Add allow_template_p
+ parameter. Check tag mismatch and class template.
+ (xref_tag): Add template_header_p parameter. Add assertion
+ that name is an IDENTIFIER_NODE. Remove implicit typename
+ warning. Simplify lookup process if globalize is true.
+ (cxx_init_decl_processing): Adjust call to xref_tag.
+ (xref_tag_from_type): Likewise.
+ * decl2.c (handle_class_head): Likewise.
+ * parser.c (cp_parser_elaborated_type_specifier,
+ cp_parser_class_head): Likewise.
+ * rtti.c (init_rtti_processing, build_dynamic_cast1,
+ tinfo_base_init, emit_support_tinfos): Likewise.
+ * class.c (is_base_of_enclosing_class): Remove.
+ * pt.c (convert_template_argument): Don't accept RECORD_TYPE as
+ template template argument.
+ * cp-tree.h (xref_tag): Adjust declaration.
+ (is_base_of_enclosing_class): Remove.
+ * NEWS: Document template template argument change.
+
+2003-08-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * parser.c (cp_parser_init_declarator,
+ cp_paser_member_declaration): Reformat.
+ * pt.c (lookup_template_class, type_unification_real, unify,
+ type_dependent_expression_p): Reformat.
+
+ PR c++/11295
+ * cp-tree.h (tubst_flags_t): Add tf_stmt_expr_cmpd,
+ tf_stmt_expr_body.
+ (finish_stmt_expr_expr): Declare.
+ * parser.c (cp_parser_primary_expression): Tell
+ cp_parser_compount_statement that it is a statement expression.
+ (cp_parser_statement, cp_parser_labeled_statement,
+ cp_parser_compound_statement, cp_parser_statement_seq_opt): Add
+ in_statement_expr_p parameter.
+ (cp_parser_expression_statement): Likewise. Call
+ finish_stmt_expr_expr for final expression of a statement
+ expression.
+ (cp_parser_for_init_statement,
+ cp_parser_implicitly_scoped_statement,
+ cp_parser_already_scoped_statement, cp_parser_function_definition,
+ cp_parser_try_block, cp_parser_handled): Adjust.
+ * pt.c (tsubst_copy) <STMT_EXPR case>: Pass tf_stmt_expr.
+ (tsubst_expr): Process tf_stmt_expr and tf_stmt_exprs flags.
+ (tsubst_expr) <EXPR_STMT case>: Check tf_stmt_exprs flag.
+ * semantics.c (finish_expr_stmt): Do not deal with statement
+ expressions.
+ (begin_stmt_expr): Clear last_expr_type.
+ (finish_stmt_expr_expr): New.
+ (finish_stmt_expr): Process the value expression.
+
+ * typeck.c (build_compound_expr): If RHS is a TARGET_EXPR, put the
+ compound expr inside the target's initializer.
+
+ PR c++/11525
+ * parser.c (cp_parser_primary_expression): Do not set
+ non-constant-p merely because it is a dependent scope.
+
+ PR c++/9447
+ * decl2.c (do_class_using_decl): Set type to NULL_TREE.
+ * semantics.c (finish_expr_stmt): Do not convert to void in a
+ template.
+
+2003-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * pt.c (coerce_template_parms): Refactor.
+ (fn_type_unification): Increment processing_template_decl when
+ tsubsting an incomplete set of explicit args.
+
+ PR c++/11347
+ * pt.c (instantiate_class_template): Increment
+ processing_template_decl around the tsubst of a template member
+ class.
+ (tsubst_qualified_id): Assert we do not have a dependent scope.
+
+ * pt.c (coerce_template_template_parms, lookup_template_class,
+ can_complete_type_without_circularity, instantiate_class_template,
+ tsubst_decl, unify): Reformat.
+
+2003-07-31 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (maybe_make_one_only): Use mark_referenced.
+ * method.c (use_thunk): Likewsie.
+
+2003-07-30 Jan Hubicka <jh@suse.cz>
+
+ * class.c (build_vtable_entry_ref): Kill.
+ (build_vtbl_ref_1): Do not call build_vtable_entry_ref.
+ (build_vfn_ref): Do not call build_vtable_entry_ref.
+ * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Kill.
+ * cp-tree.h (prepare_assemble_variable): Kill.
+ * cp-decl.c (prepare_assemble_variable): Kill.
+
+2003-07-29 Geoffrey Keating <geoffk@apple.com>
+
+ * parser.c (cp_lexer_new_main): Use c_common_no_more_pch instead
+ of setting valid_pch by hand.
+
+2003-07-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * decl.c (finish_enum): Initialize underlying_type.
+
+2003-07-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9447
+ * decl.c (add_binding): Add bval local variable.
+ (push_class_level_binding): Likewise. Allow a USING_DECL to be
+ pushed.
+ * decl2.c (do_class_using_decl): The type of a using decl is
+ unknown.
+ * parser.c (cp_parser_postfix_expression): Refactor unqualified-id
+ function call lookup code.
+ * pt.c (tsubst): A USING_DECL will have unknown type.
+ (tsubst_copy_and_build): Allow a using decl.
+ (type_dependent_expression_p): A USING_DECL will make it
+ dependent.
+ * semantics.c (finish_member_declaration): Push a dependent using
+ declaration.
+
+2003-07-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11530
+ * parser.c (cp_parser_postfix_expression): Do not call mark_used.
+ * semantics.c (finish_id_expression): Call mark_used for all
+ declarations.
+
+2003-07-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11667
+ * call.c (standard_conversion): Allow all integral->enumeral
+ conversions, after marking them as bad.
+ * decl.c (finish_enum): Make sure that all enumerators are
+ properly converted to the underlying type.
+ (build_enumerator): Set DECL_CONTEXT for namespace-scope
+ enumeration types.
+ * pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly.
+ (tsubst_enum): Tidy.
+
+ * Make-lang.in (typeck.o): Depend on convert.h.
+ (class.o): Likewise.
+ (rtti.o): Likewise.
+ * call.c: Include convert.h.
+ (convert_arg_to_ellipsis): Use convert_to_real.
+ * class.c: Include convert.h.
+ (build_base_path): Use convert_to_integer.
+ * rtti.c: Include convert.h.
+ (build_headof): Use convert_to_integer.
+ * typeck.c: Include convert.h.
+ (decay_conversion): Use convert_to_integer.
+ (build_unary_op): Use build_nop.
+ (get_delta_difference): Use convert_to_integer.
+ (build_ptrmemfunc): Avoid unncessary conversions.
+
+2003-07-28 Jan Hubicka <jh@suse.cz>
+
+ * decl2.c (mark_member_pointers): Verify that member pointer points to
+ the function.
+
+2003-07-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (begin_compound_stmt): No scope arg is a bool.
+ (finish_compound_stmt): Remove no scope arg.
+ * decl.c (register_dtor_fn): Adjust begin_compound_stmt and
+ end_compound_stmt calls.
+ (expand_static_init, begin_destructor_body, begin_function_body,
+ finish_function_body): Likewise.
+ * decl2.c (start_objects, finish_objects,
+ start_static_storage_duration_function,
+ finish_static_storage_duration_function): Likewise.
+ * init.c (begin_init_stmts, finish_init_stmts,
+ construct_virtual_base, build_vec_init): Likewise.
+ * method.c (do_build_assign_ref, synthesize_method): Likewise.
+ * parser.c (cp_parser_compound_statement,
+ cp_parser_implicitly_scoped_statement,
+ cp_parser_already_scoped_statement): Likewise.
+ * pt.c (tsubst_expr): Likewise.
+ * semantics.c (begin_compound_stmt): No scope arg is a bool.
+ (finish_compound_stmt): Remove no scope arg.
+
+ * error.c (dump_expr) <COMPOUND_EXPR case>: A compound expr is
+ always dyadic.
+
+2003-07-27 Mark Mitchell <mark@codesourcery.com>
+
+ * call.c (standard_conversion): Tweak handling of
+ pointer-to-member types.
+ * pt.c (tsubst): Correctly qualify pointers-to-data member types.
+ * typeck.c (comp_ptr_ttypes_real): Check qualifiers on
+ pointer-to-data member types.
+
+2003-07-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * parser.c (cp_parser_type_parameter): Reformat.
+ (cp_parser_parameter_declaration): Deprecate default args where
+ not allowed.
+
+2003-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cfns.h: Rebuilt.
+
+ * cp-tree.h (begin_init_stmts, finish_init_stmts): Remove.
+ (begin_global_stmt_expr, finish_global_stmt_expr): Remove.
+ * init.c (begin_init_stmts): Make static. Return is_global
+ value. Always call begin_stmt_expr.
+ (finish_init_stmts): Make static. Add is_global parm. Always
+ building a stmt tree.
+ (build_aggr_init): Adjust begin_init_stmts, finish_init_stmts calls.
+ (build_vec_init): Likewise. Always building a stmt tree.
+ (expand_default_init): Always building a stmt tree.
+ (get_temp_regvar): Likewise.
+ * semantics.c (begin_global_stmt_expr,
+ finish_global_stmt_expr): Remove.
+
+2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (build_compound_expr): Take LHS & RHS args.
+ (build_x_compound_expr_from_list): Declare.
+ * typeck.c (build_x_compound_expr_from_list): New.
+ (build_x_compound_expr): Adjust.
+ (build_compound_expr): Remove unreachable code. Take two
+ parameters, adjust.
+ * decl.c (grok_reference_init): Use
+ build_x_compound_expr_from_list.
+ (expand_static_init): Adjust build_compound_expr call.
+ (cxx_maybe_build_cleanup): Likewise.
+ * init.c (perform_member_init): Use
+ build_x_compound_expr_from_list.
+ (build_new_1): Likewise.
+ (build_vec_delete): Adjust build_compound_expr calls.
+ (build_vbase_delete): Likewise.
+ * typeck2.c (store_init_value): Use
+ build_x_compound_expr_from_list.
+ (build_functional_cast): Likewise.
+
+2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (enum tsubst_flags_t): Add tf_user.
+ * decl.c (make_typename_type): Pass it.
+ * pt.c (lookup_template_class): Use it.
+ (resolve_typename_type): Pass it.
+ * semantics.c (finish_template_type): Pass it.
+
+2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11617
+ * cp-tree.h (qualified_name_lookup_error): Declare.
+ * pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for
+ errors.
+ (tsubst_expr) <DECL_STMT case>: Likewise.
+ (tsubst_copy_and_build) <COMPONENT_REF case>: Likewise.
+ * semantics.c (qualified_name_lookup_error): New, broken out of ...
+ (finish_id_expression): ... here. Use it.
+
+2003-07-25 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ * cfns.gperf: Add '%%' delimiter to placate gperf 3.0.
+
+2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11596
+ * pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove.
+ (tsubst_template_arg): New.
+ (tsubst_template_arg_vector): Rename to ...
+ (tsubst_template_args): ... this. Accept a TREE_LIST form. Use
+ tsubst_template_arg.
+ (coerce_template_parms): Use tsubst_template_arg for default
+ value.
+ (tsubst_template_parms): Likewise.
+ (tsubst_aggr_type): Adjust.
+ (tsubst_decl): Likewise.
+ (tsubst): Use tsubst_template_arg for a DOMAIN. Adjust.
+ (tsubst_copy) <TEMPLATE_ID_EXPR case>: Use tsubst_template_args.
+
+2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H.
+ * error.c: Use the new pretty-printer framework.
+
+2003-07-24 Per Bothner <pbothner@apple.com>
+
+ * decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc
+ which causes errors messages to incorrectly mention included files.
+
+2003-07-24 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (convert_to_base_statically): Declare.
+ * call.c (build_special_member_call): Convert INSTANCE to the base
+ type.
+ * class.c (convert_to_base_statically): New method.
+ * init.c (construct_virtual_base): Use it.
+ * method.c (do_build_assign_ref): Fix typo in comment.
+
+2003-07-24 Jason Merrill <jason@redhat.com>
+
+ * decl.c: Just set truthvalue_* to boolean_*.
+
+2003-07-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (reshape_init): Remove unreachable code.
+
+2003-07-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11513
+ * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope.
+
+2003-07-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11645
+ * cp-tree.h (accessible_base_p): Declare.
+ * call.c (build_over_call): Use it.
+ * search.c (accessible_base_p): New function, split out from ...
+ (lookup_base): ... here.
+
+ PR c++/11517
+ * call.c (build_conditional_expr): Use perform_implicit_conversion
+ and error_operand_p. Robustify.
+ * typeck.c (build_unary_op): Use perform_implicit_conversion.
+
+2003-07-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/10953
+ * parser.c (cp_parser_nested_name_specifier): Reset scope on
+ failure.
+ (cp_parser_elaborated_type_specifier): Likewise.
+
+2003-07-22 Mark Mitchell <mark@codesourcery.com>
+
+ Eliminate use of POINTER_TYPE for pointers-to-members.
+ * call.c (standard_conversion): Rework pointer-to-member handling.
+ Add comments.
+ (add_builtin_candidate): Likewise.
+ (resolve_scoped_fn_name): Remove.
+ (build_conditional_expr): Rework pointer-to-member handling.
+ (compare_ics): Likewise.
+ * class.c (check_field_decls): Use TYPE_PTR_P.
+ * cp-lang.c (cp_var_mod_type_p): Rework pointer-to-member
+ handling.
+ * cp-tree.h (SCALAR_TYPE_P): Use TYPE_PTR_TO_MEMBER_P.
+ (TYPE_PTRMEM_P): Add comment.
+ (TYPE_PTR_P): Simplify.
+ (TYPE_PTROB_P): Correct definition.
+ (TYPE_PTR_TO_MEMBER_P): New macro.
+ (TYPE_PTRMEM_CLASS_TYPE): Adjust.
+ (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
+ (resolved_scoped_fn_name): Remove declaration.
+ (build_offset_ref): Change prototype.
+ (resolve_offset_ref): Remove.
+ (comp_target_types): Remove.
+ * cvt.c (cp_convert_to_pointer): Rework pointer-to-member
+ handling.
+ (convert_to_reference): Use can_convert.
+ (ocp_convert): Improve error handling. Rework pointer-to-member
+ handling.
+ (perform_qualification_conversions): Rework pointer-to-member
+ handling.
+ * decl.c (build_ptrmem_type): Handle functions too.
+ (create_array_type_for_decl): Remove OFFSET_TYPE error message.
+ (grokdeclarator): Use OFFSET_TYPE for pointers to data members.
+ (grokparms): Remove OFFSET_TYPE error message.
+ * dump.c (cp_dump_tree): Rework pointer-to-member handling.
+ * error.c (dump_type_prefix): Likewise.
+ * expr.c (cplus_expand_constant): Use build_nop.
+ * init.c (build_offset_ref): Add address_p parameter. Fold in
+ necessary bits from resolve_offset_ref.
+ (resolve_offset_ref): Remove.
+ * parser.c (cp_parser_postfix_expression): Remove special case
+ code for OFFSET_TYPE.
+ * pt.c (convert_nontype_argument): Rework pointer-to-member
+ handling.
+ (convert_template_argument): Likewise.
+ (unify): Likewise.
+ (invalid_nontype_parm_type_p): Likewise.
+ (dependent_type_p_r): Likewise.
+ * rtti.c (get_tinfo_decl): Remove OFFSET_TYPE special case.
+ (target_incomplete_p_): Rework pointer-to-member
+ handling.
+ (get_pseudo_ti_init): Likewise.
+ (get_pseudo_ti_desc): Likewise.
+ * semantics.c (finish_qualified_id_expr): Adjust call to
+ build_offset_ref. Remove use of resolve_offset_ref.
+ * tree.c (pod_type_p): Use TYPE_PTR_TO_MEMBER_P.
+ * typeck.c (target_type): Use TYPE_PTRMEM_P.
+ (type_unknown_p): Remove obsolete code about the time before
+ non-dependent expressions were handled correctly.
+ (qualify_type_recursive): Remove.
+ (composite_pointer_type_r): New function.
+ (composite_pointer_type): Use it.
+ (merge_types): Remove dead comments.
+ (comp_cv_target_types): Remove.
+ (comp_target_types): Likewise.
+ (comp_target_parms): Likewise.
+ (cxx_sizeof_or_alignof_type): Remove OFFSET_TYPE error.
+ (build_indirect_ref): Use TYPE_PTR_TO_MEMBER_P.
+ (build_binary_op): Do not use of comp_target_types.
+ (pointer_diff): Remove OFFSET_TYPE case.
+ (build_unary_op): Adjust pointer-to-member handling.
+ (unary_complex_lvalue): Likewise.
+ (check_for_casting_away_constness): Add description parameter.
+ (build_static_cast): Pass it.
+ (build_reinterpret_cast): Use check_for_casting_away_constness.
+ (build_const_cast): Adjust pointer-to-member handling.
+ (build_c_cast): Likewise.
+ (convert_for_assignment): Remove OFFSET_TYPE error message.
+ (comp_ptr_ttypes_real): Adjust pointer-to-member handling.
+ (comp_ptr_ttypes_reinterpret): Remove.
+ (casts_away_constness_r): Adjust pointer-to-member handling.
+ (casts_away_constness): Liekwise.
+ (strip_all_pointer_quals): Remove.
+ * typeck2.c (digest_init): Adjust pointer-to-member handling.
+ (build_m_component_ref): Likewise.
+
+2003-07-22 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * lex.c (unqualified_fn_lookup_error): Mention that the error
+ message needs to be kept in synch with the manual.
+
+2003-07-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11614
+ * decl.c (grokdeclarator): An array member is only a flexible
+ array member if the field itself is the array.
+
+2003-07-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10793
+ * decl.c (xref_basetypes): Handle error_mark_node.
+
+2003-07-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (enum cp_lvalue_kind): Add clk_packed.
+ * tree.c (lvalue_p_1): Set it.
+ * class.c (check_field): Don't allow non-packed non-POD fields to
+ be packed.
+ * call.c (reference_binding): Need a temporary for all bitfield
+ and packed fields.
+ (convert_like_real): Check it is ok to make a temporary here.
+
+2003-07-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (hack_identifier): Remove.
+ * method.c (hack_identifier): Remove.
+ * semantics.c (finish_id_expression): Expand hack_identifier
+ here. Simplify.
+
+2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c
+ semantics.c typeck.c: Remove unnecessary casts.
+
+2003-07-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (hack_identifier): Remove.
+ * method.c (hack_identifier): Remove.
+ * semantics.c (finish_id_expression): Expand hack_identifier
+ here. Simplify.
+
+2003-07-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (finish_non_static_data_member): Add object param.
+ * method.c (hack_identifier): Adjust.
+ * pt.c (tsubst_copy_and_build) <COMPONENT_REF case>: Don't search
+ again for a FIELD_DECL.
+ * semantics.c (finish_non_static_data_member): Add object
+ parameter. Always save the DECL in the COMPONENT_REF.
+ * call.c (resolve_scoped_fn_name): Adjust.
+
+2003-07-17 Zack Weinberg <zack@codesourcery.com>
+
+ * pt.c (get_bindings): Make definition consistent with
+ forward declaration.
+
+2003-07-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/7809
+ * friend.c (add_friend): Check access for member functions
+ and templates.
+
+2003-07-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/10668
+ * typeck.c (build_class_member_access_expr): Improve diagnostic.
+
+2003-07-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11547
+ * cp-tree.h (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P): New
+ macro.
+ (DECL_PRETTY_FUNCTION_P): Use VAR_DECL_CHECK.
+ * decl.c (duplicate_decls): Merge
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
+ * parser.c (cp_parser_postfix_expression): Adjust call to
+ cp_parser_initializer_list and
+ cp_parser_parenthesized_expression_list.
+ (cp_parser_parenthesized_expression_list): Add non_constant_p.
+ (cp_parser_new_placement): Adjust call to
+ cp_parser_parenthesized_expression_list.
+ (cp_parser_direct_new_declarator): Likewise.
+ (cp_parser_conditional_expression): Remove.
+ (cp_parser_constant_expression): Parse an assignment-expression,
+ not a conditional-expression.
+ (cp_parser_simple_declaration): Resolve expression/declaration
+ ambiguity more quickly.
+ (cp_parser_mem_initializer): Adjust call to
+ cp_parser_parenthesized_expression_list.
+ (cp_parser_init_declarator): Keep track of whether or not the
+ initializer is a constant-expression.
+ (cp_parser_initializer): Add non_constant_p parameter.
+ (cp_parser_initializer_clause): Likewise.
+ (cp_parser_initializer_list): Likewise.
+ (cp_parser_attribute_list): Adjust call to
+ cp_parser_parenthesized_expression_list.
+ (cp_parser_functional_cast): Likewise.
+ * pt.c (tsubst_decl): Copy
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
+ (tsubst_expr): Tweak use of DECL_PRETTY_FUNCTION_P.
+ * semantics.c (finish_id_expression): Use
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
+
+2003-07-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang-options.h: Remove.
+
+2003-07-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c/10962
+ * class.c (field_decl_cmp): Remove.
+ (resort_field_decl_cmp): Remove.
+ (resort_sorted_fields): Remove.
+ (add_fields_to_vec): Rename to ...
+ (add_fields_to_record_type): this.
+ (finish_struct_1): Change to be using
+ sorted_fields_type's fields.
+ * cp-tree.h (lang_decl): In lang_decl_u3
+ change sorted_fields to be a pointer to
+ sorted_fields_type.
+ (resort_sorted_fields): Remove prototype.
+ * search.c (lookup_field_1): Change to be using
+ sorted_fields_type's fields.
+
+2003-07-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5421
+ * decl.c (grokdeclarator): Handle TEMPLATE_ID_EXPR if friend
+ is a member of other class.
+ * friend.c (do_friend): Don't build TEMPLATE_DECL if friend
+ is a specialization of function template.
+
+2003-07-16 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/10903
+ * pt.c (convert_nontype_argument): Fix thinko in diagnostic.
+ Improve.
+
+2003-07-15 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.def (LOOKUP_EXPR): Remove.
+ * cp-tree.h (cp_id_kind): Add CP_ID_KIND_UNQUALIFIED_DEPENDENT.
+ (LOOKUP_EXPR_GLOBAL): Remove.
+ (get_bindings): Remove.
+ (is_aggr_type_2): Remove.
+ * call.c (resolved_scoped_fn_name): Remove support for
+ LOOKUP_EXPR.
+ * decl.c (grokfndecl): Likewise.
+ (grokdeclarator): Likewise.
+ * error.c (dump_decl): Likewise.
+ (dump_expr): Likewise.
+ * friend.c (do_friend): Likewise.
+ * init.c (build_offset_ref): Likewise.
+ * lex.c (unqualified_fn_lookup_error): Use pedwarn. Do not create
+ LOOKUP_EXPRs
+ * mangle.c (write_expression): Remove support for LOOKUP_EXPR.
+ * parser.c (cp_parser_postfix_expression): Modify Koenig lookup
+ test.
+ * pt.c (get_bindings): Give it internal linkage.
+ (check_explicit_specialization): Remove support for LOOKUP_EXPR.
+ (lookup_template_function): Likewise.
+ (for_each_tempalte_parm_r): Likewise.
+ (tsubst_decl): Likewise.
+ (tsubst_qualified_id): Handle template template parameters.
+ (tsubst_copy): Remove support for LOOKUP_EXPR.
+ (tsubst_copy_and_build): Likewise.
+ (most_general_template): Likewise.
+ (value_dependent_expression_p): Likewise.
+ (type_dependent_expression_p): Note that IDENTIFIER_NODEs are
+ always dependent.
+ * semantics.c (perform_koenig_lookup): Do not create
+ IDENTIFIER_NODEs.
+ (finish_fname): Likewise.
+ (finish_id_expression): Likewise.
+ * tree.c (is_aggr_type_2): Remove.
+
+2003-07-16 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/11531
+ * typeck.c (check_return_expr): Fix thinko in diagnostic.
+
+2003-07-15 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10108
+ * pt.c (tsubst_decl) <TEMPLATE_DECL>: Add a check for
+ error_mark_node.
+
+2003-07-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11509
+ * pt.c (dependent_scope_ref_p): New function.
+ (value_dependent_expression_p): Use it.
+ (type_dependent_expression_p): Likewise.
+
+ * pt.c (tsubst_friend_function): Use reregister_specialization.
+
+ PR c++/7019
+ * cp-tree.h (lookup_qualified_name): Adjust prototype.
+ * decl.c (lookup_qualified_name): Add complain parameter. Adjust
+ call to is_aggr_type.
+ * parser.c (cp_parser_lookup_name): Adjust call to
+ lookup_qualified_name.
+ * pt.c (tsubst_qualified_id): Likewise.
+ (tsubst_copy_and_build): Likewise.
+ * semantics.c (finish_qualified_id_expr): Deal with erroneous
+ expressions.
+
+2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/11510
+ * call.c (op_error): Properly format REALPART_EXPR and
+ IMAGPART_EXPR.
+ * error.c (dump_expr): Likewise.
+
+2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * error.c (dump_expr): Handle EMPTY_CLASS_EXPR.
+
+2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/5293
+ * call.c (initialize_reference): Improve diagnostic.
+
+2003-07-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11154
+ * pt.c (more_specialized_class): Add full_args parameter.
+ (most_specialized_class): Adjust calls to more_specialized_class.
+ * cp-tree.h (more_specialized_class): Adjust declaration.
+
+2003-07-14 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * lex.c (enum tree_node_kind): Delete.
+
+2003-07-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11503
+ * cp-tree.h (DECL_SELF_REFERENCE_P): New macro.
+ (SET_DECL_SELF_REFERENCE_P): Likewise.
+ * class.c (build_self_reference): Use SET_DECL_SELF_REFERENCE_P.
+ * pt.c (tsubst_decl): Copy it.
+ * search.c (lookup_base): Use DECL_SELF_REFERENCE_P.
+
+ * pt.c (reregister_specialization): Fix thinko in previous change.
+
+ * cp-tree.h (cp_id_kind): New type.
+ (unqualified_name_lookup_error): Change prototype.
+ (unqualified_fn_lookup_error): New function.
+ (do_identifier): Remove.
+ (do_scoped_id): Likewise.
+ (tsubst_copy_and_build): Change prototype.
+ (reregister_specialization): New function.
+ (perform_koenig_lookup): Likewise.
+ (finish_id_expression): Likewise.
+ * call.c (build_method_call): Adjust call to
+ unqualified_name_lookup_error.
+ * decl.c (duplicate_decls): Use reregister_specialization.
+ * lex.c (is_global): Remove.
+ (unqualified_name_lookup_error): Return a value.
+ (do_identifier): Remove.
+ (do_scoped_id): Likewise.
+ (identifier_typedecl_value): Remove.
+ (unqualified_fn_lookup_error): New function.
+ * parser.c (cp_parser_id_kind): Remove.
+ (cp_parser_non_constant_id_expression): Remove.
+ (cp_parser_primary_expression): Use finish_id_expression.
+ (cp_parser_class_or_namespace_name): Use cp_id_kind, not
+ cp_parser_id_kind.
+ (cp_parser_postfix_expression): Use perform_koenig_lookup.
+ (cp_parser_template_argument): Use cp_id_kind.
+ (cp_parser_fold_non_dependent_expr): Adjust call to
+ tsubst_copy_and_build.
+ * pt.c (unregister_specialization): Rename to ...
+ (reregister_specialization): This.
+ (tsubst_friend_function): Use it.
+ (maybe_fold_nontype_arg): Adjust call to tsubst_copy_and_build.
+ (tsubst_qualified_id): Likewise.
+ (tsubst_expr): Likewise.
+ (tsubst_copy_and_build): Add function_p parameter. Use
+ finish_id_expression. Introduce RECUR macro.
+ (tsubst_non_call_postfix_expression): New function.
+ (regenerate_decl_from_template): Use reregister_specialization.
+ * semantics.c (perform_koenig_lookup): New function.
+ (finish_id_expression): Likewise.
+
+2003-07-13 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * pt.c (push_access_scope_real): Remove.
+ (push_access_scope): Move code from push_access_scope_real.
+ (pop_access_scope): Don't check for TEMPLATE_DECL.
+ (instantiate_template): Defer access checking during template
+ substitution.
+ (regenerate_decl_from_template): Tidy.
+
+2003-07-11 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR c++/11437
+ * operators.def: Add definitions for __imag__, __real__.
+
+2003-07-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11050
+ * parser.c (cp_parser_expression_list): Rename to ...
+ (cp_parser_parenthesized_expression_list): ... here. Add attribute
+ parameter, parse the surounding parentheses.
+ (cp_parser_skip_to_closing_parenthesis): Add recover and or_comma
+ parameters. Return int.
+ (cp_parser_skip_to_closing_parenthesis or comma): Remove.
+ (cp_parser_postfix_expression): Adjust function call parsing.
+ (cp_parser_new_placement): Adjust.
+ (cp_parser_new_initializer): Likewise.
+ (cp_parser_cast_expression): Likewise.
+ (cp_parser_selection_statement): Likewise.
+ (cp_parser_mem_initializer): Likewise.
+ (cp_parser_asm_definition): Likewise.
+ (cp_parser_init_declarator): Likewise.
+ (cp_parser_declarator): Make
+ cdtor_or_conv_p an int ptr.
+ (cp_parser_direct_declarator): Likewise. Check for a parameter
+ list on cdtors & conv functions.
+ (cp_parser_initializer): Adjust.
+ (cp_parser_member_declaration): Adjust.
+ (cp_parser_attribute_list): Move code into
+ cp_parser_parens_expression_list.
+ (cp_parser_functional_cast): Adjust.
+ * pt.c (type_dependent_expression_p): Erroneous expressions are
+ non-dependent.
+
+2003-07-11 Geoffrey Keating <geoffk@apple.com>
+
+ * decl.c (cp_finish_decl): Handle 'used' attribute.
+
+ * cp-lang.c (c_reset_state): New dummy routine.
+ * cp-tree.h (finish_file): Move prototype to c-common.h.
+ * parser.c (c_parse_file): Rename from yyparse; don't call finish_file.
+
+2003-07-11 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8327
+ * pt.c (tsubst_qualified_id): Implement suggested resolution for
+ Core Issue 2.
+ (type_dependent_expression_p): Likewise.
+
+2003-07-10 Mark Mitchell <mark@codesourcery.com>
+
+ * typeck.c (build_binary_op): Do not warn about signed
+ vs. unsigned comparisons in the bodies of templates.
+
+ PR c++/9411
+ * parser.c (cp_parser_postfix_expression): Check dependency of
+ functions.
+
+2003-07-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10032
+ * decl.c (cxx_init_decl_processing): With -pedantic, pedwarns are
+ still errors.
+
+ PR c++/10527
+ * error.c (decl_to_string): Do not print default argument
+ expressions.
+
+ * cp-tree.h (break_out_calls): Remove declaration.
+ * tree.c (break_out_calls): Remove.
+ * typeck.c (build_modify_expr): Avoid invalid sharing of trees.
+
+2003-07-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++ 9483
+ * class.c (check_field_decls): Pass DECL_NAME to constructor_name_p.
+ * decl2.c (constructor_name_p): Avoid repeated constructor_name
+ calls.
+ * decl.c (grokdeclarator): Refactor ctor/dtor detection.
+
+2003-07-09 Mark Mitchell <mark@codesourcery.com>
+
+ * typeck.c (build_x_unary_op): Take note of the fact that
+ PREINCREMENT_EXPR and POSTINCREMENT_EXPR are binary operations on
+ trees.
+
+ * parser.c (cp_parser_primary_expression): Preserve the form of
+ qualified expressions in templates, even if they are not
+ dependent.
+ * pt.c (convert_nontype_argument): Handle non-dependent SCOPE_REFs.
+ (tsubst_qualified_id): Likewise.
+ * search.c (accessible_p): Treat everything in the body of a
+ template as accessible.
+
2003-07-08 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (NON_DEPENDENT_EXPR): New node.
@@ -65,7 +1992,7 @@
(build_x_compound_expr): Likewise.
* typeck2.c (build_x_arrow): Likewise.
-Wed Jul 9 02:28:39 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-09 Jan Hubicka <jh@suse.cz>
* cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
* decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
@@ -369,7 +2296,7 @@ Wed Jul 9 02:28:39 CEST 2003 Jan Hubicka <jh@suse.cz>
* error.c (locate_error): %P takes an `int', not a `tree'.
-Wed Jul 2 00:36:48 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-07-02 Jan Hubicka <jh@suse.cz>
* decl2.c (defer_fn): Set DECL_DEFER_OUTPUT.
(finish-file): Do not process function with DECL_DEFER_OUTPUT clear;
@@ -576,12 +2503,12 @@ Wed Jul 2 00:36:48 CEST 2003 Jan Hubicka <jh@suse.cz>
* pt.c (check_default_tmpl_args): Likewise.
(lookup_template_class): Likewise.
-Tue Jun 24 15:30:05 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-24 Jan Hubicka <jh@suse.cz>
* method.c (thunk_labelno): Move outside ifdef block to make garbage
collector happy.
-Tue Jun 24 13:52:34 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-24 Jan Hubicka <jh@suse.cz>
* class.c (build_vtable): Make vtables.
* cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro.
@@ -608,7 +2535,7 @@ Tue Jun 24 13:52:34 CEST 2003 Jan Hubicka <jh@suse.cz>
(cp/method.o): Depend on gt-cp-method.h.
* config-lang.in (gtfiles): Add $(srcdir)/cp/method.c.
-Mon Jun 23 19:41:27 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-23 Jan Hubicka <jh@suse.cz>
* decl.c (register_dtor_fn): Mark cleanup as used.
* decl2.c (mark_vtable_entries): Skip nops.
@@ -902,7 +2829,7 @@ Mon Jun 23 19:41:27 CEST 2003 Jan Hubicka <jh@suse.cz>
* cp-tree.h (cxx_init_options): Update.
* lex.c (cxx_init_options): Update.
-Thu Jun 5 18:33:40 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-05 Jan Hubicka <jh@suse.cz>
* Make-lang.in: Add support for stageprofile and stagefeedback
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index df1d8a79216..1f78e81f587 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -86,8 +86,8 @@ CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \
CXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptree.o cp/rtti.o \
cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \
- cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o \
- cp/optimize.o cp/mangle.o cp/cp-lang.o cp/name-lookup.o
+ cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o \
+ cp/mangle.o cp/cp-lang.o cp/name-lookup.o cp/cxx-pretty-print.o
# Use strict warnings for this front end.
cp-warn = $(STRICT_WARN) $(WERROR)
@@ -231,10 +231,12 @@ CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h c-common.h \
$(GGC_H) \
$(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h
+CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H)
+
cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h \
c-pragma.h toplev.h output.h input.h cp/operators.def $(TM_P_H)
cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h langhooks.h \
- $(LANGHOOKS_DEF_H) c-common.h
+ $(LANGHOOKS_DEF_H) c-common.h $(CXX_PRETTY_PRINT_H) $(DIAGNOSTIC_H)
cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h stack.h \
output.h $(EXPR_H) except.h toplev.h $(HASHTAB_H) $(RTL_H) \
cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \
@@ -244,10 +246,10 @@ cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h $(EXPR_H
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h $(TM_P_H) \
diagnostic.h
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
- diagnostic.h
-cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H)
+ diagnostic.h convert.h
+cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H) convert.h
cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \
- diagnostic.h intl.h gt-cp-call.h
+ diagnostic.h intl.h gt-cp-call.h convert.h target.h
cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) toplev.h $(EXPR_H)
cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
except.h
@@ -258,15 +260,15 @@ cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) stack.h flags.h toplev.h $(RTL_H)
cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) \
insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h $(TARGET_H)
cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H)
-cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h
+cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h convert.h
cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) except.h toplev.h \
cp/cfns.h $(EXPR_H) libfuncs.h tree-inline.h
cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
except.h $(TM_P_H)
cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/lex.h \
toplev.h $(RTL_H) except.h tree-inline.h gt-cp-pt.h
-cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h flags.h real.h \
- $(LANGHOOKS_DEF_H)
+cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
+ flags.h real.h $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H)
cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h \
gt-cp-repo.h
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) cp/lex.h except.h toplev.h \
@@ -280,4 +282,7 @@ cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h real.h gt-cp-mangle.h $(
cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) diagnostic.h gt-cp-parser.h output.h
cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(CXX_TREE_H) timevar.h gt-cp-name-lookup.h
+ $(TM_H) $(CXX_TREE_H) timevar.h gt-cp-name-lookup.h toplev.h
+
+cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \
+ $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H)
diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS
index a94852cfac7..75a5823fc96 100644
--- a/gcc/cp/NEWS
+++ b/gcc/cp/NEWS
@@ -1,74 +1,6 @@
*** Changes in GCC 3.4:
-* The C++ parser in G++ has been rewritten from scratch. As a result, G++
- is considerably more compliant to the C++ standard. As a result, it
- accepts more valid programs, and rejects more invalid programs.
-
- Many of the changes below are a consequence of the new parser.
-
-* Friend declarations that refer to template specializations are rejected
- if the template has not already been declared.
-
- For example:
-
- template <typename T>
- class C {
- friend void f<>(C&);
- };
-
- is rejected; you must first declare `f' as a template:
-
- template <typename T>
- void f(T);
-
-* You must use "template <>" to introduce template specializations, as
- required by the standard. For example:
-
- template <typename T>
- struct S;
-
- struct S<int> { };
-
- is rejected; you must write:
-
- template <> struct S<int> {};
-
-* You must now use the `typename' and `template' keywords to disambiguate
- dependent names, as required by the C++ standard.
-
-* The "named return value" extension has been removed.
-
-* The "implicit typename" extension has been removed.
-
-* G++ used to accept code like this:
-
- struct S {
- int h();
- void f(int i = g());
- int g(int i = h());
- };
-
- This behavior is not mandated by the standard.
-
- Now G++ issues an error about this code. To avoid the error, you must
- move the declaration of `g' before the declaration of `f'. The
- default arguments for `g' must be visible at the point where it is
- called.
-
-* When -pedantic is used, G++ now issues errors about spurious semicolons;
- for example:
-
- namespace N {}; // Invalid semicolon.
- void f() {}; // Invalid semicolon.
-
-* G++ no longer accepts attributes for a declarator after the
- initializer associated with that declarator. For example:
-
- X x(1) __attribute__((...));
-
- is no longer accepted. Instead, use:
-
- X x __attribute__((...)) (1);
+* Changes in GCC 3.4 are described in 'gcc-3.4/changes.html'
*** Changes in GCC 3.3:
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 6659592b22d..424ec8d3728 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -37,6 +37,8 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "diagnostic.h"
#include "intl.h"
+#include "target.h"
+#include "convert.h"
static tree build_field_call (tree, tree, tree);
static struct z_candidate * tourney (struct z_candidate *);
@@ -301,10 +303,8 @@ build_call (tree function, tree parms)
TREE_VALUE (tmp), t);
}
- function = build_nt (CALL_EXPR, function, parms, NULL_TREE);
+ function = build (CALL_EXPR, result_type, function, parms);
TREE_HAS_CONSTRUCTOR (function) = is_constructor;
- TREE_TYPE (function) = result_type;
- TREE_SIDE_EFFECTS (function) = 1;
TREE_NOTHROW (function) = nothrow;
return function;
@@ -423,10 +423,7 @@ build_method_call (tree instance, tree name, tree parms,
/* If the name could not be found, issue an error. */
if (!fn)
- {
- unqualified_name_lookup_error (name);
- return error_mark_node;
- }
+ return unqualified_name_lookup_error (name);
if (BASELINK_P (fn) && has_template_args)
BASELINK_FUNCTIONS (fn)
@@ -570,7 +567,7 @@ strip_top_quals (tree t)
{
if (TREE_CODE (t) == ARRAY_TYPE)
return t;
- return TYPE_MAIN_VARIANT (t);
+ return cp_build_qualified_type (t, 0);
}
/* Returns the standard conversion path (see [conv]) from type FROM to type
@@ -596,7 +593,7 @@ standard_conversion (tree to, tree from, tree expr)
if ((TYPE_PTRFN_P (to) || TYPE_PTRMEMFUNC_P (to))
&& expr && type_unknown_p (expr))
{
- expr = instantiate_type (to, expr, tf_none);
+ expr = instantiate_type (to, expr, tf_conv);
if (expr == error_mark_node)
return NULL_TREE;
from = TREE_TYPE (expr);
@@ -645,11 +642,15 @@ standard_conversion (tree to, tree from, tree expr)
if (same_type_p (from, to))
return conv;
- if ((tcode == POINTER_TYPE || TYPE_PTRMEMFUNC_P (to))
+ if ((tcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to))
&& expr && null_ptr_cst_p (expr))
- {
- conv = build_conv (STD_CONV, to, conv);
- }
+ conv = build_conv (STD_CONV, to, conv);
+ else if (tcode == POINTER_TYPE && fcode == POINTER_TYPE
+ && TREE_CODE (TREE_TYPE (to)) == VECTOR_TYPE
+ && TREE_CODE (TREE_TYPE (from)) == VECTOR_TYPE
+ && ((*targetm.vector_opaque_p) (TREE_TYPE (to))
+ || (*targetm.vector_opaque_p) (TREE_TYPE (from))))
+ conv = build_conv (STD_CONV, to, conv);
else if ((tcode == INTEGER_TYPE && fcode == POINTER_TYPE)
|| (tcode == POINTER_TYPE && fcode == INTEGER_TYPE))
{
@@ -658,65 +659,88 @@ standard_conversion (tree to, tree from, tree expr)
conv = build_conv (STD_CONV, to, conv);
ICS_BAD_FLAG (conv) = 1;
}
- else if (tcode == ENUMERAL_TYPE && fcode == INTEGER_TYPE
- && TYPE_PRECISION (to) == TYPE_PRECISION (from))
+ else if (tcode == ENUMERAL_TYPE && fcode == INTEGER_TYPE)
{
/* For backwards brain damage compatibility, allow interconversion of
enums and integers with a pedwarn. */
conv = build_conv (STD_CONV, to, conv);
ICS_BAD_FLAG (conv) = 1;
}
- else if (tcode == POINTER_TYPE && fcode == POINTER_TYPE)
+ else if ((tcode == POINTER_TYPE && fcode == POINTER_TYPE)
+ || (TYPE_PTRMEM_P (to) && TYPE_PTRMEM_P (from)))
{
- enum tree_code ufcode = TREE_CODE (TREE_TYPE (from));
- enum tree_code utcode = TREE_CODE (TREE_TYPE (to));
+ tree to_pointee;
+ tree from_pointee;
- if (same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (from),
- TREE_TYPE (to)))
+ if (tcode == POINTER_TYPE
+ && same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (from),
+ TREE_TYPE (to)))
;
- else if (utcode == VOID_TYPE && ufcode != OFFSET_TYPE
- && ufcode != FUNCTION_TYPE)
+ else if (VOID_TYPE_P (TREE_TYPE (to))
+ && !TYPE_PTRMEM_P (from)
+ && TREE_CODE (TREE_TYPE (from)) != FUNCTION_TYPE)
{
from = build_pointer_type
(cp_build_qualified_type (void_type_node,
cp_type_quals (TREE_TYPE (from))));
conv = build_conv (PTR_CONV, from, conv);
}
- else if (ufcode == OFFSET_TYPE && utcode == OFFSET_TYPE)
+ else if (TYPE_PTRMEM_P (from))
{
- tree fbase = TYPE_OFFSET_BASETYPE (TREE_TYPE (from));
- tree tbase = TYPE_OFFSET_BASETYPE (TREE_TYPE (to));
+ tree fbase = TYPE_PTRMEM_CLASS_TYPE (from);
+ tree tbase = TYPE_PTRMEM_CLASS_TYPE (to);
if (DERIVED_FROM_P (fbase, tbase)
&& (same_type_ignoring_top_level_qualifiers_p
- (TREE_TYPE (TREE_TYPE (from)),
- TREE_TYPE (TREE_TYPE (to)))))
+ (TYPE_PTRMEM_POINTED_TO_TYPE (from),
+ TYPE_PTRMEM_POINTED_TO_TYPE (to))))
{
- from = build_ptrmem_type (tbase, TREE_TYPE (TREE_TYPE (from)));
+ from = build_ptrmem_type (tbase,
+ TYPE_PTRMEM_POINTED_TO_TYPE (from));
conv = build_conv (PMEM_CONV, from, conv);
}
}
else if (IS_AGGR_TYPE (TREE_TYPE (from))
- && IS_AGGR_TYPE (TREE_TYPE (to)))
+ && IS_AGGR_TYPE (TREE_TYPE (to))
+ /* [conv.ptr]
+
+ An rvalue of type "pointer to cv D," where D is a
+ class type, can be converted to an rvalue of type
+ "pointer to cv B," where B is a base class (clause
+ _class.derived_) of D. If B is an inaccessible
+ (clause _class.access_) or ambiguous
+ (_class.member.lookup_) base class of D, a program
+ that necessitates this conversion is ill-formed. */
+ /* Therefore, we use DERIVED_FROM_P, and not
+ ACESSIBLY_UNIQUELY_DERIVED_FROM_P, in this test. */
+ && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from)))
{
- if (DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from)))
- {
- from =
- cp_build_qualified_type (TREE_TYPE (to),
- cp_type_quals (TREE_TYPE (from)));
- from = build_pointer_type (from);
- conv = build_conv (PTR_CONV, from, conv);
- }
+ from =
+ cp_build_qualified_type (TREE_TYPE (to),
+ cp_type_quals (TREE_TYPE (from)));
+ from = build_pointer_type (from);
+ conv = build_conv (PTR_CONV, from, conv);
+ }
+
+ if (tcode == POINTER_TYPE)
+ {
+ to_pointee = TREE_TYPE (to);
+ from_pointee = TREE_TYPE (from);
+ }
+ else
+ {
+ to_pointee = TYPE_PTRMEM_POINTED_TO_TYPE (to);
+ from_pointee = TYPE_PTRMEM_POINTED_TO_TYPE (from);
}
if (same_type_p (from, to))
/* OK */;
- else if (comp_ptr_ttypes (TREE_TYPE (to), TREE_TYPE (from)))
+ else if (comp_ptr_ttypes (to_pointee, from_pointee))
conv = build_conv (QUAL_CONV, to, conv);
else if (expr && string_conv_p (to, expr, 0))
/* converting from string constant to char *. */
conv = build_conv (QUAL_CONV, to, conv);
- else if (ptr_reasonably_similar (TREE_TYPE (to), TREE_TYPE (from)))
+ else if (ptr_reasonably_similar (to_pointee, from_pointee))
{
conv = build_conv (PTR_CONV, to, conv);
ICS_BAD_FLAG (conv) = 1;
@@ -741,21 +765,33 @@ standard_conversion (tree to, tree from, tree expr)
return 0;
from = cp_build_qualified_type (tbase, cp_type_quals (fbase));
- from = build_cplus_method_type (from, TREE_TYPE (fromfn),
- TREE_CHAIN (TYPE_ARG_TYPES (fromfn)));
+ from = build_method_type_directly (from,
+ TREE_TYPE (fromfn),
+ TREE_CHAIN (TYPE_ARG_TYPES (fromfn)));
from = build_ptrmemfunc_type (build_pointer_type (from));
conv = build_conv (PMEM_CONV, from, conv);
}
else if (tcode == BOOLEAN_TYPE)
{
- if (! (INTEGRAL_CODE_P (fcode) || fcode == REAL_TYPE
- || fcode == POINTER_TYPE || TYPE_PTRMEMFUNC_P (from)))
- return 0;
+ /* [conv.bool]
- conv = build_conv (STD_CONV, to, conv);
- if (fcode == POINTER_TYPE
- || (TYPE_PTRMEMFUNC_P (from) && ICS_STD_RANK (conv) < PBOOL_RANK))
- ICS_STD_RANK (conv) = PBOOL_RANK;
+ An rvalue of arithmetic, enumeration, pointer, or pointer to
+ member type can be converted to an rvalue of type bool. */
+ if (ARITHMETIC_TYPE_P (from)
+ || fcode == ENUMERAL_TYPE
+ || fcode == POINTER_TYPE
+ || TYPE_PTR_TO_MEMBER_P (from))
+ {
+ conv = build_conv (STD_CONV, to, conv);
+ if (fcode == POINTER_TYPE
+ || TYPE_PTRMEM_P (from)
+ || (TYPE_PTRMEMFUNC_P (from)
+ && ICS_STD_RANK (conv) < PBOOL_RANK))
+ ICS_STD_RANK (conv) = PBOOL_RANK;
+ return conv;
+ }
+
+ return NULL_TREE;
}
/* We don't check for ENUMERAL_TYPE here because there are no standard
conversions to enum type. */
@@ -767,10 +803,14 @@ standard_conversion (tree to, tree from, tree expr)
conv = build_conv (STD_CONV, to, conv);
/* Give this a better rank if it's a promotion. */
- if (to == type_promotes_to (from)
+ if (same_type_p (to, type_promotes_to (from))
&& ICS_STD_RANK (TREE_OPERAND (conv, 0)) <= PROMO_RANK)
ICS_STD_RANK (conv) = PROMO_RANK;
}
+ else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE
+ && ((*targetm.vector_opaque_p) (from)
+ || (*targetm.vector_opaque_p) (to)))
+ return build_conv (STD_CONV, to, conv);
else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
&& is_properly_derived_from (from, to))
{
@@ -1057,10 +1097,10 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags)
lvalue. */
conv = build1 (IDENTITY_CONV, from, expr);
conv = direct_reference_binding (rto, conv);
- if ((lvalue_p & clk_bitfield) != 0
- && CP_TYPE_CONST_NON_VOLATILE_P (to))
+ if ((lvalue_p & clk_bitfield) != 0
+ || ((lvalue_p & clk_packed) != 0 && !TYPE_PACKED (to)))
/* For the purposes of overload resolution, we ignore the fact
- this expression is a bitfield. (In particular,
+ this expression is a bitfield or packed field. (In particular,
[over.ics.ref] says specifically that a function with a
non-const reference parameter is viable even if the
argument is a bitfield.)
@@ -1071,6 +1111,7 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags)
a temporary, so we just issue an error when the conversion
actually occurs. */
NEED_TEMPORARY_P (conv) = 1;
+
return conv;
}
else if (CLASS_TYPE_P (from) && !(flags & LOOKUP_NO_CONVERSION))
@@ -1210,8 +1251,7 @@ add_candidate (struct z_candidate **candidates,
tree fn, tree args, tree convs, tree access_path,
tree conversion_path, int viable)
{
- struct z_candidate *cand
- = (struct z_candidate *) ggc_alloc_cleared (sizeof (struct z_candidate));
+ struct z_candidate *cand = ggc_alloc_cleared (sizeof (struct z_candidate));
cand->fn = fn;
cand->args = args;
@@ -1595,8 +1635,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
T operator-(T); */
case CONVERT_EXPR: /* unary + */
- if (TREE_CODE (type1) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (type1)) != OFFSET_TYPE)
+ if (TREE_CODE (type1) == POINTER_TYPE)
break;
case NEGATE_EXPR:
if (ARITHMETIC_TYPE_P (type1))
@@ -1621,12 +1660,10 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
case MEMBER_REF:
if (TREE_CODE (type1) == POINTER_TYPE
- && (TYPE_PTRMEMFUNC_P (type2) || TYPE_PTRMEM_P (type2)))
+ && TYPE_PTR_TO_MEMBER_P (type2))
{
tree c1 = TREE_TYPE (type1);
- tree c2 = (TYPE_PTRMEMFUNC_P (type2)
- ? TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type2)))
- : TYPE_OFFSET_BASETYPE (TREE_TYPE (type2)));
+ tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2);
if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1)
&& (TYPE_PTRMEMFUNC_P (type2)
@@ -1696,14 +1733,12 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
if ((TYPE_PTRMEMFUNC_P (type1) && TYPE_PTRMEMFUNC_P (type2))
|| (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2)))
break;
- if ((TYPE_PTRMEMFUNC_P (type1) || TYPE_PTRMEM_P (type1))
- && null_ptr_cst_p (args[1]))
+ if (TYPE_PTR_TO_MEMBER_P (type1) && null_ptr_cst_p (args[1]))
{
type2 = type1;
break;
}
- if ((TYPE_PTRMEMFUNC_P (type2) || TYPE_PTRMEM_P (type2))
- && null_ptr_cst_p (args[0]))
+ if (TYPE_PTR_TO_MEMBER_P (type2) && null_ptr_cst_p (args[0]))
{
type1 = type2;
break;
@@ -1874,12 +1909,8 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
break;
/* Otherwise, the types should be pointers. */
- if (!(TREE_CODE (type1) == POINTER_TYPE
- || TYPE_PTRMEM_P (type1)
- || TYPE_PTRMEMFUNC_P (type1))
- || !(TREE_CODE (type2) == POINTER_TYPE
- || TYPE_PTRMEM_P (type2)
- || TYPE_PTRMEMFUNC_P (type2)))
+ if (!(TYPE_PTR_P (type1) || TYPE_PTR_TO_MEMBER_P (type1))
+ || !(TYPE_PTR_P (type2) || TYPE_PTR_TO_MEMBER_P (type2)))
return;
/* We don't check that the two types are the same; the logic
@@ -1897,8 +1928,8 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
if (type2 && !same_type_p (type1, type2)
&& TREE_CODE (type1) == TREE_CODE (type2)
&& (TREE_CODE (type1) == REFERENCE_TYPE
- || (TREE_CODE (type1) == POINTER_TYPE
- && TYPE_PTRMEM_P (type1) == TYPE_PTRMEM_P (type2))
+ || (TYPE_PTR_P (type1) && TYPE_PTR_P (type2))
+ || (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2))
|| TYPE_PTRMEMFUNC_P (type1)
|| IS_AGGR_TYPE (type1)
|| TREE_CODE (type1) == ENUMERAL_TYPE))
@@ -2331,11 +2362,9 @@ print_z_candidate (const char *msgstr, struct z_candidate *candidate)
else if (TYPE_P (candidate->fn))
inform ("%s %T <conversion>", msgstr, candidate->fn);
else if (candidate->viable == -1)
- inform ("%H%s %+#D <near match>",
- &DECL_SOURCE_LOCATION (candidate->fn), msgstr, candidate->fn);
+ inform ("%J%s %+#D <near match>", candidate->fn, msgstr, candidate->fn);
else
- inform ("%H%s %+#D",
- &DECL_SOURCE_LOCATION (candidate->fn), msgstr, candidate->fn);
+ inform ("%J%s %+#D", candidate->fn, msgstr, candidate->fn);
}
static void
@@ -2608,78 +2637,6 @@ build_user_type_conversion (tree totype, tree expr, int flags)
return NULL_TREE;
}
-/* Find the possibly overloaded set of functions corresponding to a
- call of the form SCOPE::NAME (...). NAME might be a
- TEMPLATE_ID_EXPR, OVERLOAD, _DECL, IDENTIFIER_NODE or LOOKUP_EXPR. */
-
-tree
-resolve_scoped_fn_name (tree scope, tree name)
-{
- tree fn = NULL_TREE;
- tree template_args = NULL_TREE;
- bool is_template_id = TREE_CODE (name) == TEMPLATE_ID_EXPR;
-
- if (is_template_id)
- {
- 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 (TREE_CODE (name) == LOOKUP_EXPR)
- name = TREE_OPERAND (name, 0);
-
- if (TREE_CODE (scope) == NAMESPACE_DECL)
- fn = lookup_namespace_name (scope, name);
- else if (!CLASS_TYPE_P (scope))
- {
- error ("`%T' is not a class type", scope);
- return error_mark_node;
- }
- else
- {
- if (!TYPE_BEING_DEFINED (scope)
- && !COMPLETE_TYPE_P (complete_type (scope)))
- {
- error ("incomplete type '%T' cannot be used to name a scope",
- scope);
- return error_mark_node;
- }
-
- if (BASELINK_P (name))
- fn = name;
- else
- fn = lookup_member (scope, name, /*protect=*/1, /*want_type=*/false);
- if (fn && current_class_type)
- fn = (adjust_result_of_qualified_name_lookup
- (fn, scope, current_class_type));
-
- /* It might be the name of a function pointer member. */
- if (fn && TREE_CODE (fn) == FIELD_DECL)
- fn = finish_non_static_data_member (fn, scope);
- }
-
- if (!fn)
- {
- error ("'%D' has no member named '%E'", scope, name);
- return error_mark_node;
- }
- if (is_template_id)
- {
- tree fns = fn;
-
- if (BASELINK_P (fn))
- fns = BASELINK_FUNCTIONS (fns);
- fns = build_nt (TEMPLATE_ID_EXPR, fns, template_args);
- if (BASELINK_P (fn))
- BASELINK_FUNCTIONS (fn) = fns;
- else
- fn = fns;
- }
-
- return fn;
-}
-
/* Do any initial processing on the arguments to a function call. */
static tree
@@ -3013,6 +2970,11 @@ op_error (enum tree_code code, enum tree_code code2,
case ARRAY_REF:
error ("%s for 'operator[]' in '%E[%E]'", problem, arg1, arg2);
break;
+
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ error ("%s for '%s' in '%s %E'", problem, opname, opname, arg1);
+ break;
default:
if (arg2)
@@ -3127,16 +3089,13 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
The first expr ession is implicitly converted to bool (clause
_conv_). */
- arg1 = cp_convert (boolean_type_node, arg1);
+ arg1 = perform_implicit_conversion (boolean_type_node, arg1);
/* If something has already gone wrong, just pass that fact up the
tree. */
- if (arg1 == error_mark_node
- || arg2 == error_mark_node
- || arg3 == error_mark_node
- || TREE_TYPE (arg1) == error_mark_node
- || TREE_TYPE (arg2) == error_mark_node
- || TREE_TYPE (arg3) == error_mark_node)
+ if (error_operand_p (arg1)
+ || error_operand_p (arg2)
+ || error_operand_p (arg3))
return error_mark_node;
/* [expr.cond]
@@ -3218,7 +3177,11 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
{
arg2 = convert_like (conv2, arg2);
arg2 = convert_from_reference (arg2);
- if (!same_type_p (TREE_TYPE (arg2), arg3_type))
+ if (!same_type_p (TREE_TYPE (arg2), arg3_type)
+ && CLASS_TYPE_P (arg3_type))
+ /* The types need to match if we're converting to a class type.
+ If not, we don't care about cv-qual mismatches, since
+ non-class rvalues are not cv-qualified. */
abort ();
arg2_type = TREE_TYPE (arg2);
}
@@ -3226,7 +3189,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
{
arg3 = convert_like (conv3, arg3);
arg3 = convert_from_reference (arg3);
- if (!same_type_p (TREE_TYPE (arg3), arg2_type))
+ if (!same_type_p (TREE_TYPE (arg3), arg2_type)
+ && CLASS_TYPE_P (arg2_type))
abort ();
arg3_type = TREE_TYPE (arg3);
}
@@ -3236,8 +3200,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
If the second and third operands are lvalues and have the same
type, the result is of that type and is an lvalue. */
- if (real_lvalue_p (arg2) && real_lvalue_p (arg3) &&
- same_type_p (arg2_type, arg3_type))
+ if (real_lvalue_p (arg2)
+ && real_lvalue_p (arg3)
+ && same_type_p (arg2_type, arg3_type))
{
result_type = arg2_type;
goto valid_operands;
@@ -3379,18 +3344,17 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
cv-qualification of either the second or the third operand.
The result is of the common type. */
else if ((null_ptr_cst_p (arg2)
- && (TYPE_PTR_P (arg3_type) || TYPE_PTRMEM_P (arg3_type)
- || TYPE_PTRMEMFUNC_P (arg3_type)))
+ && (TYPE_PTR_P (arg3_type) || TYPE_PTR_TO_MEMBER_P (arg3_type)))
|| (null_ptr_cst_p (arg3)
- && (TYPE_PTR_P (arg2_type) || TYPE_PTRMEM_P (arg2_type)
- || TYPE_PTRMEMFUNC_P (arg2_type)))
+ && (TYPE_PTR_P (arg2_type) || TYPE_PTR_TO_MEMBER_P (arg2_type)))
|| (TYPE_PTR_P (arg2_type) && TYPE_PTR_P (arg3_type))
|| (TYPE_PTRMEM_P (arg2_type) && TYPE_PTRMEM_P (arg3_type))
- || (TYPE_PTRMEMFUNC_P (arg2_type)
- && TYPE_PTRMEMFUNC_P (arg3_type)))
+ || (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type)))
{
result_type = composite_pointer_type (arg2_type, arg3_type, arg2,
arg3, "conditional expression");
+ if (result_type == error_mark_node)
+ return error_mark_node;
arg2 = perform_implicit_conversion (result_type, arg2);
arg3 = perform_implicit_conversion (result_type, arg3);
}
@@ -4170,9 +4134,26 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner,
tree ref_type = totype;
/* If necessary, create a temporary. */
- if (NEED_TEMPORARY_P (convs) || !non_cast_lvalue_p (expr))
+ if (NEED_TEMPORARY_P (convs) || !lvalue_p (expr))
{
tree type = TREE_TYPE (TREE_OPERAND (convs, 0));
+
+ if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)))
+ {
+ /* If the reference is volatile or non-const, we
+ cannot create a temporary. */
+ cp_lvalue_kind lvalue = real_lvalue_p (expr);
+
+ if (lvalue & clk_bitfield)
+ error ("cannot bind bitfield `%E' to `%T'",
+ expr, ref_type);
+ else if (lvalue & clk_packed)
+ error ("cannot bind packed field `%E' to `%T'",
+ expr, ref_type);
+ else
+ error ("cannot bind rvalue `%E' to `%T'", expr, ref_type);
+ return error_mark_node;
+ }
expr = build_target_expr_with_type (expr, type);
}
@@ -4243,7 +4224,7 @@ convert_arg_to_ellipsis (tree arg)
if (TREE_CODE (TREE_TYPE (arg)) == REAL_TYPE
&& (TYPE_PRECISION (TREE_TYPE (arg))
< TYPE_PRECISION (double_type_node)))
- arg = cp_convert (double_type_node, arg);
+ arg = convert_to_real (double_type_node, arg);
else if (INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (arg)))
arg = perform_integral_promotions (arg);
@@ -4295,11 +4276,9 @@ cxx_type_promotes_to (tree type)
{
tree promote;
- if (TREE_CODE (type) == ARRAY_TYPE)
- return build_pointer_type (TREE_TYPE (type));
-
- if (TREE_CODE (type) == FUNCTION_TYPE)
- return build_pointer_type (type);
+ /* Perform the array-to-pointer and function-to-pointer
+ conversions. */
+ type = type_decays_to (type);
promote = type_promotes_to (type);
if (same_type_p (type, promote))
@@ -4361,7 +4340,9 @@ type_passed_as (tree type)
type = build_reference_type (type);
else if (PROMOTE_PROTOTYPES
&& INTEGRAL_TYPE_P (type)
- && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
+ && COMPLETE_TYPE_P (type)
+ && INT_CST_LT_UNSIGNED (TYPE_SIZE (type),
+ TYPE_SIZE (integer_type_node)))
type = integer_type_node;
return type;
@@ -4379,7 +4360,9 @@ convert_for_arg_passing (tree type, tree val)
val = build1 (ADDR_EXPR, build_reference_type (type), val);
else if (PROMOTE_PROTOTYPES
&& INTEGRAL_TYPE_P (type)
- && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
+ && COMPLETE_TYPE_P (type)
+ && INT_CST_LT_UNSIGNED (TYPE_SIZE (type),
+ TYPE_SIZE (integer_type_node)))
val = perform_integral_promotions (val);
return val;
}
@@ -4456,12 +4439,17 @@ build_over_call (struct z_candidate *cand, int flags)
TREE_VALUE (arg),
cand->conversion_path,
1);
+ /* Check that the base class is accessible. */
+ if (!accessible_base_p (TREE_TYPE (argtype),
+ BINFO_TYPE (cand->conversion_path)))
+ error ("`%T' is not an accessible base of `%T'",
+ BINFO_TYPE (cand->conversion_path),
+ TREE_TYPE (argtype));
/* If fn was found by a using declaration, the conversion path
will be to the derived class, not the base declaring fn. We
must convert from derived to base. */
base_binfo = lookup_base (TREE_TYPE (TREE_TYPE (converted_arg)),
TREE_TYPE (parmtype), ba_ignore, NULL);
-
converted_arg = build_base_path (PLUS_EXPR, converted_arg,
base_binfo, 1);
@@ -4784,11 +4772,23 @@ build_special_member_call (tree instance, tree name, tree args,
TREE_TYPE (instance) = build_pointer_type (class_type);
instance = build1 (INDIRECT_REF, class_type, instance);
}
- else if (name == complete_dtor_identifier
- || name == base_dtor_identifier
- || name == deleting_dtor_identifier)
- my_friendly_assert (args == NULL_TREE, 20020712);
+ else
+ {
+ if (name == complete_dtor_identifier
+ || name == base_dtor_identifier
+ || 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.) */
+ if (!same_type_ignoring_top_level_qualifiers_p
+ (TREE_TYPE (instance), BINFO_TYPE (binfo)))
+ instance = convert_to_base_statically (instance, binfo);
+ }
+
my_friendly_assert (instance != NULL_TREE, 20020712);
/* Resolve the name. */
@@ -4824,7 +4824,9 @@ build_special_member_call (tree instance, tree name, tree args,
args = tree_cons (NULL_TREE, sub_vtt, args);
}
- return build_new_method_call (instance, fns, args, binfo, flags);
+ return build_new_method_call (instance, fns, args,
+ TYPE_BINFO (BINFO_TYPE (binfo)),
+ flags);
}
/* Return the NAME, as a C string. The NAME indicates a function that
@@ -4922,7 +4924,7 @@ build_new_method_call (tree instance, tree fns, tree args,
{
call = build_field_call (instance_ptr, fns, args);
if (call)
- return call;
+ goto finish;
error ("call to non-function `%D'", fns);
return error_mark_node;
}
@@ -5083,14 +5085,13 @@ build_new_method_call (tree instance, tree fns, tree args,
if (!is_dummy_object (instance_ptr) && TREE_SIDE_EFFECTS (instance))
call = build (COMPOUND_EXPR, TREE_TYPE (call), instance, call);
}
-
+ finish:;
+
if (processing_template_decl && call != error_mark_node)
- return build_min (CALL_EXPR,
- TREE_TYPE (call),
- build_min_nt (COMPONENT_REF,
- orig_instance,
- orig_fns),
- orig_args);
+ return build_min_non_dep
+ (CALL_EXPR, call,
+ build_min_nt (COMPONENT_REF, orig_instance, orig_fns),
+ orig_args);
return call;
}
@@ -5384,25 +5385,17 @@ compare_ics (tree ics1, tree ics2)
for pointers A*, except opposite: if B is derived from A then
A::* converts to B::*, not vice versa. For that reason, we
switch the from_ and to_ variables here. */
- else if (TYPE_PTRMEM_P (from_type1)
- && TYPE_PTRMEM_P (from_type2)
- && TYPE_PTRMEM_P (to_type1)
- && TYPE_PTRMEM_P (to_type2))
- {
- deref_to_type1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (from_type1));
- deref_to_type2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (from_type2));
- deref_from_type1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (to_type1));
- deref_from_type2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (to_type2));
- }
- else if (TYPE_PTRMEMFUNC_P (from_type1)
- && TYPE_PTRMEMFUNC_P (from_type2)
- && TYPE_PTRMEMFUNC_P (to_type1)
- && TYPE_PTRMEMFUNC_P (to_type2))
+ else if ((TYPE_PTRMEM_P (from_type1) && TYPE_PTRMEM_P (from_type2)
+ && TYPE_PTRMEM_P (to_type1) && TYPE_PTRMEM_P (to_type2))
+ || (TYPE_PTRMEMFUNC_P (from_type1)
+ && TYPE_PTRMEMFUNC_P (from_type2)
+ && TYPE_PTRMEMFUNC_P (to_type1)
+ && TYPE_PTRMEMFUNC_P (to_type2)))
{
- deref_to_type1 = TYPE_PTRMEMFUNC_OBJECT_TYPE (from_type1);
- deref_to_type2 = TYPE_PTRMEMFUNC_OBJECT_TYPE (from_type2);
- deref_from_type1 = TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type1);
- deref_from_type2 = TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type2);
+ deref_to_type1 = TYPE_PTRMEM_CLASS_TYPE (from_type1);
+ deref_to_type2 = TYPE_PTRMEM_CLASS_TYPE (from_type2);
+ deref_from_type1 = TYPE_PTRMEM_CLASS_TYPE (to_type1);
+ deref_from_type2 = TYPE_PTRMEM_CLASS_TYPE (to_type2);
}
if (deref_from_type1 != NULL_TREE
@@ -5965,7 +5958,8 @@ perform_implicit_conversion (tree type, tree expr)
/* Convert EXPR to TYPE (as a direct-initialization) if that is
permitted. If the conversion is valid, the converted expression is
- returned. Otherwise, NULL_TREE is returned. */
+ returned. Otherwise, NULL_TREE is returned, except in the case
+ that TYPE is a class type; in that case, an error is issued. */
tree
perform_direct_initialization_if_possible (tree type, tree expr)
@@ -5974,6 +5968,22 @@ perform_direct_initialization_if_possible (tree type, tree expr)
if (type == error_mark_node || error_operand_p (expr))
return error_mark_node;
+ /* [dcl.init]
+
+ If the destination type is a (possibly cv-qualified) class type:
+
+ -- If the initialization is direct-initialization ...,
+ constructors are considered. ... If no constructor applies, or
+ the overload resolution is ambiguous, the initialization is
+ ill-formed. */
+ if (CLASS_TYPE_P (type))
+ {
+ expr = build_special_member_call (NULL_TREE, complete_ctor_identifier,
+ build_tree_list (NULL_TREE, expr),
+ TYPE_BINFO (type),
+ LOOKUP_NORMAL);
+ return build_cplus_new (type, expr);
+ }
conv = implicit_conversion (type, TREE_TYPE (expr), expr,
LOOKUP_NORMAL);
if (!conv || ICS_BAD_FLAG (conv))
@@ -6021,14 +6031,18 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
}
/* Convert EXPR to the indicated reference TYPE, in a way suitable for
- initializing a variable of that TYPE. If DECL is non-NULL, it is
+ initializing a variable of that TYPE. If DECL is non-NULL, it is
the VAR_DECL being initialized with the EXPR. (In that case, the
- type of DECL will be TYPE.)
+ type of DECL will be TYPE.) If DECL is non-NULL, then CLEANUP must
+ also be non-NULL, and with *CLEANUP initialized to NULL. Upon
+ return, if *CLEANUP is no longer NULL, it will be a CLEANUP_STMT
+ that should be inserted after the returned expression is used to
+ initialize DECL.
Return the converted expression. */
tree
-initialize_reference (tree type, tree expr, tree decl)
+initialize_reference (tree type, tree expr, tree decl, tree *cleanup)
{
tree conv;
@@ -6038,7 +6052,13 @@ initialize_reference (tree type, tree expr, tree decl)
conv = reference_binding (type, TREE_TYPE (expr), expr, LOOKUP_NORMAL);
if (!conv || ICS_BAD_FLAG (conv))
{
- error ("could not convert `%E' to `%T'", expr, type);
+ if (!(TYPE_QUALS (TREE_TYPE (type)) & TYPE_QUAL_CONST)
+ && !real_lvalue_p (expr))
+ error ("invalid initialization of non-const reference of "
+ "type '%T' from a temporary of type '%T'",
+ type, TREE_TYPE (expr));
+ else
+ error ("could not convert `%E' to `%T'", expr, type);
return error_mark_node;
}
@@ -6095,7 +6115,7 @@ initialize_reference (tree type, tree expr, tree decl)
base_conv_type = NULL_TREE;
/* Perform the remainder of the conversion. */
expr = convert_like (conv, expr);
- if (!real_non_cast_lvalue_p (expr))
+ if (!real_lvalue_p (expr))
{
tree init;
tree type;
@@ -6104,14 +6124,33 @@ initialize_reference (tree type, tree expr, tree decl)
type = TREE_TYPE (expr);
var = make_temporary_var_for_ref_to_temp (decl, type);
layout_decl (var, 0);
+ /* Create the INIT_EXPR that will initialize the temporary
+ variable. */
+ init = build (INIT_EXPR, type, var, expr);
if (at_function_scope_p ())
{
- tree cleanup;
-
add_decl_stmt (var);
- cleanup = cxx_maybe_build_cleanup (var);
- if (cleanup)
- finish_decl_cleanup (var, cleanup);
+ *cleanup = cxx_maybe_build_cleanup (var);
+ if (*cleanup)
+ /* We must be careful to destroy the temporary only
+ after its initialization has taken place. If the
+ initialization throws an exception, then the
+ destructor should not be run. We cannot simply
+ transform INIT into something like:
+
+ (INIT, ({ CLEANUP_STMT; }))
+
+ because emit_local_var always treats the
+ initializer as a full-expression. Thus, the
+ destructor would run too early; it would run at the
+ end of initializing the reference variable, rather
+ than at the end of the block enclosing the
+ reference variable.
+
+ The solution is to pass back a CLEANUP_STMT which
+ the caller is responsible for attaching to the
+ statement tree. */
+ *cleanup = build_stmt (CLEANUP_STMT, var, *cleanup);
}
else
{
@@ -6120,7 +6159,6 @@ initialize_reference (tree type, tree expr, tree decl)
static_aggregates = tree_cons (NULL_TREE, var,
static_aggregates);
}
- init = build (INIT_EXPR, type, var, expr);
/* Use its address to initialize the reference variable. */
expr = build_address (var);
expr = build (COMPOUND_EXPR, TREE_TYPE (expr), init, expr);
diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
index 6ee56b5ea53..c713eb0c2bd 100644
--- a/gcc/cp/cfns.gperf
+++ b/gcc/cp/cfns.gperf
@@ -8,6 +8,7 @@ __inline
#endif
const char * libc_name_p (const char *, unsigned int);
%}
+%%
# The standard C library functions, for feeding to gperf; the result is used
# by nothrow_libfn_p.
#
diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
index 415518bf854..5dc71ce46cb 100644
--- a/gcc/cp/cfns.h
+++ b/gcc/cp/cfns.h
@@ -1,5 +1,35 @@
-/* ANSI-C code produced by gperf version 2.7.2 */
-/* Command-line: gperf -o -L ANSI-C -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cp/cfns.gperf */
+/* ANSI-C code produced by gperf version 3.0.1 */
+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C ../../gcc/gcc/cp/cfns.gperf */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646. */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
+#endif
+
+#line 1 "../../gcc/gcc/cp/cfns.gperf"
+
#ifdef __GNUC__
__inline
#endif
@@ -8,7 +38,7 @@ static unsigned int hash (const char *, unsigned int);
__inline
#endif
const char * libc_name_p (const char *, unsigned int);
-/* maximum key range = 480, duplicates = 1 */
+/* maximum key range = 391, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -22,48 +52,52 @@ hash (register const char *str, register unsigned int len)
{
static const unsigned short asso_values[] =
{
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 0, 0,
- 1, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 106, 76, 0,
- 21, 0, 0, 11, 43, 26, 0, 66, 106, 17,
- 121, 0, 17, 0, 7, 0, 3, 19, 49, 1,
- 3, 41, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 483, 483, 483, 483, 483
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 0, 0,
+ 1, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 28, 90, 0,
+ 95, 0, 51, 93, 114, 26, 109, 124, 5, 1,
+ 6, 13, 37, 128, 3, 0, 0, 49, 38, 0,
+ 104, 45, 0, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
+ 400, 400, 400, 400, 400, 400, 400
};
register int hval = len;
switch (hval)
{
default:
- case 6:
- hval += asso_values[(unsigned char)str[5]];
+ hval += asso_values[(unsigned char)str[5]+1];
+ /*FALLTHROUGH*/
case 5:
hval += asso_values[(unsigned char)str[4]];
+ /*FALLTHROUGH*/
case 4:
hval += asso_values[(unsigned char)str[3]];
+ /*FALLTHROUGH*/
case 3:
hval += asso_values[(unsigned char)str[2]];
+ /*FALLTHROUGH*/
case 2:
hval += asso_values[(unsigned char)str[1]];
+ /*FALLTHROUGH*/
case 1:
hval += asso_values[(unsigned char)str[0]];
break;
@@ -82,233 +116,212 @@ libc_name_p (register const char *str, register unsigned int len)
TOTAL_KEYWORDS = 156,
MIN_WORD_LENGTH = 3,
MAX_WORD_LENGTH = 10,
- MIN_HASH_VALUE = 3,
- MAX_HASH_VALUE = 482
+ MIN_HASH_VALUE = 9,
+ MAX_HASH_VALUE = 399
};
static const char * const wordlist[] =
{
+ "wcsstr",
+ "strstr",
"cos",
- "feof",
- "free",
- "sqrt",
- "wcsrtombs",
- "pow",
"towctrans",
- "wcsstr",
+ "memmove",
+ "wcstol",
+ "wcscoll",
"wcstombs",
- "strstr",
- "ferror",
- "wcsxfrm",
- "wcsftime",
- "exit",
- "exp",
- "modf",
- "strxfrm",
- "wmemset",
- "memset",
- "strftime",
- "frexp",
+ "strtol",
+ "strcoll",
+ "wcslen",
"time",
"ctime",
- "wcstod",
- "fwide",
- "wcscmp",
- "wmemmove",
- "strtod",
- "fmod",
- "wcschr",
+ "strlen",
+ "iswctype",
+ "wmemchr",
"wcsrchr",
- "strcmp",
- "wctype",
- "toupper",
- "towupper",
- "strchr",
+ "ceil",
+ "sin",
"strrchr",
+ "tan",
+ "iscntrl",
+ "acos",
+ "wmemmove",
+ "wcsrtombs",
+ "wctrans",
"wmemcmp",
- "iswctype",
- "gmtime",
- "difftime",
- "btowc",
- "iswprint",
- "iswxdigit",
- "cosh",
- "memcmp",
- "wmemchr",
- "isupper",
- "iswupper",
- "iswdigit",
- "memchr",
- "isxdigit",
- "wmemcpy",
- "mbtowc",
- "setbuf",
- "mbstowcs",
+ "pow",
+ "atol",
+ "wcsncmp",
+ "memset",
+ "free",
+ "strncmp",
+ "wmemset",
+ "wcsspn",
+ "wcstoul",
+ "strspn",
+ "strtoul",
+ "asctime",
+ "atan2",
+ "asin",
+ "atan",
+ "ferror",
+ "iswalnum",
+ "wcscat",
+ "realloc",
+ "strcat",
"wcscpy",
- "memmove",
- "vswprintf",
- "acos",
- "mbrtowc",
- "wcrtomb",
- "mbsrtowcs",
- "atof",
+ "memcpy",
"strcpy",
- "setlocale",
- "wcscat",
- "isdigit",
- "log10",
"tolower",
"floor",
+ "iswcntrl",
+ "atoi",
+ "clearerr",
+ "swscanf",
+ "wcsncat",
+ "islower",
+ "strncat",
+ "btowc",
+ "localtime",
+ "wctomb",
+ "isalnum",
+ "isprint",
+ "mblen",
+ "wcstod",
+ "log10",
+ "strtod",
+ "wcrtomb",
+ "abs",
+ "setlocale",
+ "wcschr",
+ "mbrlen",
+ "memchr",
+ "strchr",
+ "labs",
+ "iswpunct",
+ "exit",
+ "sqrt",
+ "swprintf",
+ "wctype",
+ "mbsrtowcs",
+ "wcscspn",
+ "getenv",
+ "strcspn",
"towlower",
- "strcat",
- "log",
- "mktime",
- "wcstoul",
- "fseek",
- "memcpy",
+ "atof",
"wcstok",
- "strtoul",
- "wcscspn",
- "islower",
- "div",
- "iswlower",
- "atexit",
+ "localeconv",
"strtok",
- "setvbuf",
- "strcspn",
- "isspace",
+ "calloc",
+ "malloc",
+ "isalpha",
+ "iswlower",
"iswspace",
- "asctime",
- "wctob",
- "wcsncmp",
- "atoi",
- "ldexp",
- "strncmp",
- "wcspbrk",
- "wctomb",
- "swprintf",
- "sprintf",
- "strpbrk",
- "abs",
+ "wcsxfrm",
+ "signal",
+ "strxfrm",
+ "wcsftime",
+ "feof",
+ "strftime",
+ "wcscmp",
"fabs",
- "wcsncpy",
- "ispunct",
- "iswpunct",
- "strncpy",
- "iswgraph",
- "isprint",
- "isgraph",
- "wcscoll",
- "wcstol",
+ "memcmp",
+ "strcmp",
"vsprintf",
- "strcoll",
- "strtol",
+ "fwide",
+ "gmtime",
+ "sprintf",
+ "exp",
+ "wmemcpy",
+ "iswprint",
"sscanf",
- "clearerr",
- "swscanf",
- "sinh",
- "wcsncat",
- "getenv",
- "ceil",
- "clock",
- "wctrans",
- "strncat",
+ "wcsncpy",
+ "strncpy",
+ "isspace",
+ "toupper",
+ "wctob",
+ "div",
+ "mbtowc",
"ldiv",
- "iswcntrl",
- "wcsspn",
- "iscntrl",
- "sin",
- "strspn",
- "mbsinit",
- "longjmp",
+ "log",
+ "mktime",
+ "isupper",
+ "atexit",
+ "modf",
+ "mbstowcs",
+ "mbrtowc",
+ "ispunct",
+ "iswalpha",
+ "setvbuf",
"rand",
"srand",
- "labs",
+ "frexp",
+ "towupper",
+ "mbsinit",
+ "cosh",
+ "vswprintf",
+ "iswupper",
+ "wcspbrk",
+ "fmod",
+ "strpbrk",
+ "sinh",
"tanh",
- "calloc",
- "atol",
- "localtime",
- "realloc",
- "malloc",
- "atan2",
- "tan",
- "wcslen",
- "strlen",
- "iswalpha",
- "localeconv",
- "asin",
- "iswalnum",
- "isalnum",
- "isalpha",
- "mblen",
- "mbrlen",
- "atan",
- "signal"
+ "iswdigit",
+ "clock",
+ "longjmp",
+ "ldexp",
+ "setbuf",
+ "fseek",
+ "iswgraph",
+ "difftime",
+ "iswxdigit",
+ "isdigit",
+ "isxdigit",
+ "isgraph"
};
static const short lookup[] =
{
- -1, -1, -1, 0, 1, -1, -1, -1,
- -1, -1, -1, 2, -1, -1, -1, -1,
- -1, 3, -1, -1, 4, -1, 5, 6,
- 7, -1, -1, -1, -1, 8, -1, -1,
- -1, 9, 10, 11, -1, -1, 12, 13,
- 14, -1, 15, -1, 16, 17, 18, 19,
- -1, 20, 21, 22, 23, 24, -1, -1,
- -1, -1, 25, -1, 26, 27, -1, 28,
- 29, 30, -1, 31, 32, -1, 33, -1,
- 34, 35, 36, -1, 37, -1, -1, 38,
- 39, -1, -1, -1, 40, 41, -1, -1,
- 42, 43, 44, 45, 46, 47, -1, 48,
- 49, 50, 51, -1, 52, -1, -1, 53,
- 54, 55, 56, 57, -1, 58, 59, -273,
- 62, 63, -1, 64, -96, -2, 65, 66,
- 67, -1, 68, -1, 69, 70, 71, -1,
- 72, -1, -1, 73, -1, -1, -1, 74,
- 75, 76, -1, 77, -1, -1, 78, -1,
- -1, 79, 80, 81, 82, 83, 84, 85,
- -1, -1, 86, 87, 88, -1, 89, 90,
- -1, 91, -1, 92, -1, 93, -1, -1,
- -1, 94, -1, -1, 95, -1, 96, -1,
- -1, -1, -1, 97, 98, 99, -1, 100,
- -1, 101, 102, 103, -1, -1, -1, -1,
- -1, 104, -1, 105, 106, -1, -1, -1,
- -1, -1, 107, -1, -1, -1, -1, 108,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 109, -1, -1, 110, -1, 111, -1,
- -1, -1, -1, -1, 112, 113, -1, 114,
- -1, 115, 116, 117, -1, 118, 119, 120,
- -1, -1, 121, 122, -1, 123, -1, 124,
- -1, -1, -1, -1, -1, -1, -1, 125,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 126, 127, -1, -1, -1, 128, 129,
- -1, -1, -1, 130, 131, -1, -1, 132,
- 133, 134, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 135, -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,
- 136, -1, -1, -1, 137, 138, -1, -1,
- -1, -1, 139, -1, 140, -1, -1, -1,
- -1, -1, -1, -1, -1, 141, -1, 142,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 143, 144, -1, -1, -1, -1,
- -1, -1, -1, -1, 145, -1, -1, -1,
- -1, -1, 146, -1, -1, -1, -1, -1,
- -1, 147, 148, -1, -1, -1, -1, -1,
- -1, 149, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 150, -1, -1, -1, -1, -1,
- -1, -1, -1, 151, -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, 152, -1,
- -1, -1, -1, -1, -1, -1, 153, -1,
- -1, -1, -1, -1, -1, 154, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 155
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
+ -1, -1, 1, -1, -1, -1, 2, -1, -1, -1,
+ -1, -1, 3, 4, -1, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, -1, -1, -1, 15, 16,
+ 17, 18, 19, 20, 21, 22, -1, -1, 23, 24,
+ -1, 25, 26, 27, -1, 28, 29, 30, 31, 32,
+ 33, -1, 34, 35, -1, 36, 37, 38, -1, 39,
+ 40, -1, 41, -1, -1, -1, -1, -1, -1, 42,
+ -1, 43, -1, 44, -1, 45, 46, -1, 47, -1,
+ 48, 49, 50, 51, 52, -1, -1, 53, 54, 55,
+ -1, -1, -1, 56, -1, 57, 58, -1, 59, 60,
+ 61, 62, 63, 64, 65, -1, 66, 67, -1, 68,
+ -1, 69, 70, 71, 72, 73, 74, 75, -1, -1,
+ -1, -1, -1, 76, 77, 78, -1, -1, 79, 80,
+ 81, 82, -1, 83, 84, -1, 85, 86, 87, -1,
+ 88, 89, 90, 91, -1, -1, -1, 92, -1, 93,
+ -1, 94, -1, 95, -1, 96, 97, -1, 98, -1,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ -1, 109, 110, 111, 112, -1, 113, -1, -1, 114,
+ -1, -1, -1, 115, -1, -1, -1, 116, 117, -1,
+ 118, -1, -1, -1, -1, 119, 120, 121, -1, 122,
+ 123, -1, -1, 124, -1, 125, 126, -1, 127, -1,
+ 128, -1, -1, 129, 130, -1, -1, -1, -1, -1,
+ -1, 131, 132, -1, -1, -1, -1, 133, 134, 135,
+ -1, -1, -1, -1, -1, 136, -1, 137, -1, -1,
+ -1, 138, -1, -1, -1, -1, -1, -1, 139, 140,
+ -1, 141, -1, -1, 142, -1, 143, -1, -1, 144,
+ -1, 145, -1, -1, -1, -1, 146, -1, -1, -1,
+ -1, -1, -1, 147, -1, -1, -1, -1, -1, 148,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 149, -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, 150, -1, -1, -1, -1, -1,
+ 151, -1, -1, 152, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 153, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 154, -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, 155
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -326,21 +339,6 @@ libc_name_p (register const char *str, register unsigned int len)
if (*str == *s && !strcmp (str + 1, s + 1))
return s;
}
- else if (index < -TOTAL_KEYWORDS)
- {
- register int offset = - 1 - TOTAL_KEYWORDS - index;
- register const char * const *wordptr = &wordlist[TOTAL_KEYWORDS + lookup[offset]];
- register const char * const *wordendptr = wordptr + -lookup[offset + 1];
-
- while (wordptr < wordendptr)
- {
- register const char *s = *wordptr;
-
- if (*str == *s && !strcmp (str + 1, s + 1))
- return s;
- wordptr++;
- }
- }
}
}
return 0;
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 5c276a4a3d0..17ff0e49674 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "lex.h"
#include "target.h"
+#include "convert.h"
/* The number of nested classes being processed. If we are not in the
scope of any class, this is zero. */
@@ -124,19 +125,16 @@ static tree modify_all_vtables (tree, tree);
static void determine_primary_base (tree);
static void finish_struct_methods (tree);
static void maybe_warn_about_overly_private_class (tree);
-static int field_decl_cmp (const void *, const void *);
-static int resort_field_decl_cmp (const void *, const void *);
static int method_name_cmp (const void *, const void *);
static int resort_method_name_cmp (const void *, const void *);
static void add_implicitly_declared_members (tree, int, int, int);
static tree fixed_type_or_null (tree, int *, int *);
-static tree resolve_address_of_overloaded_function (tree, tree, int,
- int, int, tree);
-static tree build_vtable_entry_ref (tree, tree, tree);
+static tree resolve_address_of_overloaded_function (tree, tree, tsubst_flags_t,
+ bool, tree);
static tree build_vtbl_ref_1 (tree, tree);
static tree build_vtbl_initializer (tree, tree, tree, tree, int *);
static int count_fields (tree);
-static int add_fields_to_vec (tree, tree, int);
+static int add_fields_to_record_type (tree, struct sorted_fields_type*, int);
static void check_bitfield_decl (tree);
static void check_field_decl (tree, tree, int *, int *, int *, int *);
static void check_field_decls (tree, tree *, int *, int *, int *);
@@ -330,8 +328,9 @@ build_base_path (enum tree_code code,
v_offset = build_indirect_ref (v_offset, NULL);
TREE_CONSTANT (v_offset) = 1;
- offset = cp_convert (ptrdiff_type_node,
- size_diffop (offset, BINFO_OFFSET (v_binfo)));
+ offset = convert_to_integer (ptrdiff_type_node,
+ size_diffop (offset,
+ BINFO_OFFSET (v_binfo)));
if (!integer_zerop (offset))
v_offset = build (code, ptrdiff_type_node, v_offset, offset);
@@ -393,33 +392,34 @@ convert_to_base (tree object, tree type, bool check_access)
return build_base_path (PLUS_EXPR, object, binfo, /*nonnull=*/1);
}
-
-/* Virtual function things. */
+/* EXPR is an expression with class type. BASE is a base class (a
+ BINFO) of that class type. Returns EXPR, converted to the BASE
+ type. This function assumes that EXPR is the most derived class;
+ therefore virtual bases can be found at their static offsets. */
-static tree
-build_vtable_entry_ref (tree array_ref, tree instance, tree idx)
+tree
+convert_to_base_statically (tree expr, tree base)
{
- tree i, i2, vtable, first_fn, basetype;
+ tree expr_type;
- basetype = non_reference (TREE_TYPE (instance));
-
- vtable = get_vtbl_decl_for_binfo (TYPE_BINFO (basetype));
- first_fn = TYPE_BINFO_VTABLE (basetype);
-
- i = fold (build_array_ref (first_fn, idx));
- i = fold (build_c_cast (ptrdiff_type_node,
- build_unary_op (ADDR_EXPR, i, 0)));
- i2 = fold (build_array_ref (vtable, build_int_2 (0,0)));
- i2 = fold (build_c_cast (ptrdiff_type_node,
- build_unary_op (ADDR_EXPR, i2, 0)));
- i = fold (cp_build_binary_op (MINUS_EXPR, i, i2));
+ expr_type = TREE_TYPE (expr);
+ if (!same_type_p (expr_type, BINFO_TYPE (base)))
+ {
+ tree pointer_type;
- if (TREE_CODE (i) != INTEGER_CST)
- abort ();
+ pointer_type = build_pointer_type (expr_type);
+ expr = build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1);
+ if (!integer_zerop (BINFO_OFFSET (base)))
+ expr = build (PLUS_EXPR, pointer_type, expr,
+ build_nop (pointer_type, BINFO_OFFSET (base)));
+ expr = build_nop (build_pointer_type (BINFO_TYPE (base)), expr);
+ expr = build1 (INDIRECT_REF, BINFO_TYPE (base), expr);
+ }
- return build (VTABLE_REF, TREE_TYPE (array_ref), array_ref, vtable, i);
+ return expr;
}
+
/* Given an object INSTANCE, return an expression which yields the
vtable element corresponding to INDEX. There are many special
cases for INSTANCE which we take care of here, mainly to avoid
@@ -463,9 +463,6 @@ build_vtbl_ref (tree instance, tree idx)
{
tree aref = build_vtbl_ref_1 (instance, idx);
- if (flag_vtable_gc)
- aref = build_vtable_entry_ref (aref, instance, idx);
-
return aref;
}
@@ -483,9 +480,6 @@ build_vfn_ref (tree instance, tree idx)
aref = build1 (NOP_EXPR, TREE_TYPE (aref),
build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1));
- if (flag_vtable_gc)
- aref = build_vtable_entry_ref (aref, instance, idx);
-
return aref;
}
@@ -756,7 +750,10 @@ add_method (tree type, tree method, int error_p)
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (method))
slot = CLASSTYPE_CONSTRUCTOR_SLOT;
else if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (method))
- slot = CLASSTYPE_DESTRUCTOR_SLOT;
+ {
+ slot = CLASSTYPE_DESTRUCTOR_SLOT;
+ TYPE_HAS_DESTRUCTOR (type) = 1;
+ }
else
{
int have_template_convs_p = 0;
@@ -1290,9 +1287,6 @@ check_bases (tree t,
TYPE_HAS_COMPLEX_ASSIGN_REF (t)
|= TYPE_HAS_COMPLEX_ASSIGN_REF (basetype);
TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (basetype);
- TYPE_OVERLOADS_CALL_EXPR (t) |= TYPE_OVERLOADS_CALL_EXPR (basetype);
- TYPE_OVERLOADS_ARRAY_REF (t) |= TYPE_OVERLOADS_ARRAY_REF (basetype);
- TYPE_OVERLOADS_ARROW (t) |= TYPE_OVERLOADS_ARROW (basetype);
TYPE_POLYMORPHIC_P (t) |= TYPE_POLYMORPHIC_P (basetype);
CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t)
|= CLASSTYPE_CONTAINS_EMPTY_CLASS_P (basetype);
@@ -1655,16 +1649,12 @@ maybe_warn_about_overly_private_class (tree t)
/* Even if some of the member functions are non-private, the class
won't be useful for much if all the constructors or destructors
are private: such an object can never be created or destroyed. */
- if (TYPE_HAS_DESTRUCTOR (t))
+ if (TYPE_HAS_DESTRUCTOR (t)
+ && TREE_PRIVATE (CLASSTYPE_DESTRUCTORS (t)))
{
- tree dtor = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1);
-
- if (TREE_PRIVATE (dtor))
- {
- warning ("`%#T' only defines a private destructor and has no friends",
- t);
- return;
- }
+ warning ("`%#T' only defines a private destructor and has no friends",
+ t);
+ return;
}
if (TYPE_HAS_CONSTRUCTOR (t))
@@ -1711,72 +1701,11 @@ maybe_warn_about_overly_private_class (tree t)
}
}
-/* Function to help qsort sort FIELD_DECLs by name order. */
-
-static int
-field_decl_cmp (const void* x_p, const void* y_p)
-{
- const tree *const x = x_p;
- const tree *const y = y_p;
- if (DECL_NAME (*x) == DECL_NAME (*y))
- /* A nontype is "greater" than a type. */
- return DECL_DECLARES_TYPE_P (*y) - DECL_DECLARES_TYPE_P (*x);
- if (DECL_NAME (*x) == NULL_TREE)
- return -1;
- if (DECL_NAME (*y) == NULL_TREE)
- return 1;
- if (DECL_NAME (*x) < DECL_NAME (*y))
- return -1;
- return 1;
-}
-
static struct {
gt_pointer_operator new_value;
void *cookie;
} resort_data;
-/* This routine compares two fields like field_decl_cmp but using the
- pointer operator in resort_data. */
-
-static int
-resort_field_decl_cmp (const void* x_p, const void* y_p)
-{
- const tree *const x = x_p;
- const tree *const y = y_p;
-
- if (DECL_NAME (*x) == DECL_NAME (*y))
- /* A nontype is "greater" than a type. */
- return DECL_DECLARES_TYPE_P (*y) - DECL_DECLARES_TYPE_P (*x);
- if (DECL_NAME (*x) == NULL_TREE)
- return -1;
- if (DECL_NAME (*y) == NULL_TREE)
- return 1;
- {
- tree d1 = DECL_NAME (*x);
- tree d2 = DECL_NAME (*y);
- resort_data.new_value (&d1, resort_data.cookie);
- resort_data.new_value (&d2, resort_data.cookie);
- if (d1 < d2)
- return -1;
- }
- return 1;
-}
-
-/* Resort DECL_SORTED_FIELDS because pointers have been reordered. */
-
-void
-resort_sorted_fields (void* obj,
- void* orig_obj ATTRIBUTE_UNUSED ,
- gt_pointer_operator new_value,
- void* cookie)
-{
- tree sf = obj;
- resort_data.new_value = new_value;
- resort_data.cookie = cookie;
- qsort (&TREE_VEC_ELT (sf, 0), TREE_VEC_LENGTH (sf), sizeof (tree),
- resort_field_decl_cmp);
-}
-
/* Comparison function to compare two TYPE_METHOD_VEC entries by name. */
static int
@@ -2786,18 +2715,18 @@ count_fields (tree fields)
}
/* Subroutine of finish_struct_1. Recursively add all the fields in the
- TREE_LIST FIELDS to the TREE_VEC FIELD_VEC, starting at offset IDX. */
+ TREE_LIST FIELDS to the SORTED_FIELDS_TYPE elts, starting at offset IDX. */
static int
-add_fields_to_vec (tree fields, tree field_vec, int idx)
+add_fields_to_record_type (tree fields, struct sorted_fields_type *field_vec, int idx)
{
tree x;
for (x = fields; x; x = TREE_CHAIN (x))
{
if (TREE_CODE (x) == FIELD_DECL && ANON_AGGR_TYPE_P (TREE_TYPE (x)))
- idx = add_fields_to_vec (TYPE_FIELDS (TREE_TYPE (x)), field_vec, idx);
+ idx = add_fields_to_record_type (TYPE_FIELDS (TREE_TYPE (x)), field_vec, idx);
else
- TREE_VEC_ELT (field_vec, idx++) = x;
+ field_vec->elts[idx++] = x;
}
return idx;
}
@@ -3022,7 +2951,15 @@ check_field_decls (tree t, tree *access_decls,
if (TREE_CODE (x) == FIELD_DECL)
{
- DECL_PACKED (x) |= TYPE_PACKED (t);
+ if (TYPE_PACKED (t))
+ {
+ if (!pod_type_p (TREE_TYPE (x)) && !TYPE_PACKED (TREE_TYPE (x)))
+ cp_warning_at
+ ("ignoring packed attribute on unpacked non-POD field `%#D'",
+ x);
+ else
+ DECL_PACKED (x) = 1;
+ }
if (DECL_C_BIT_FIELD (x) && integer_zerop (DECL_INITIAL (x)))
/* We don't treat zero-width bitfields as making a class
@@ -3133,7 +3070,7 @@ check_field_decls (tree t, tree *access_decls,
type = strip_array_types (type);
- if (TREE_CODE (type) == POINTER_TYPE)
+ if (TYPE_PTR_P (type))
has_pointers = 1;
if (DECL_MUTABLE_P (x) || TYPE_HAS_MUTABLE_P (type))
@@ -3177,7 +3114,7 @@ check_field_decls (tree t, tree *access_decls,
/* Core issue 80: A nonstatic data member is required to have a
different name from the class iff the class has a
user-defined constructor. */
- if (constructor_name_p (x, t) && TYPE_HAS_CONSTRUCTOR (t))
+ if (constructor_name_p (DECL_NAME (x), t) && TYPE_HAS_CONSTRUCTOR (t))
cp_pedwarn_at ("field `%#D' with same name as class", x);
/* We set DECL_C_BIT_FIELD in grokbitfield.
@@ -3896,9 +3833,9 @@ build_clone (tree fn, tree name)
/* If this is subobject constructor or destructor, add the vtt
parameter. */
TREE_TYPE (clone)
- = build_cplus_method_type (basetype,
- TREE_TYPE (TREE_TYPE (clone)),
- parmtypes);
+ = build_method_type_directly (basetype,
+ TREE_TYPE (TREE_TYPE (clone)),
+ parmtypes);
if (exceptions)
TREE_TYPE (clone) = build_exception_variant (TREE_TYPE (clone),
exceptions);
@@ -4075,9 +4012,9 @@ adjust_clone_args (tree decl)
clone_parms);
TREE_TYPE (clone_parms) = TREE_TYPE (orig_clone_parms);
}
- type = build_cplus_method_type (basetype,
- TREE_TYPE (TREE_TYPE (clone)),
- clone_parms);
+ type = build_method_type_directly (basetype,
+ TREE_TYPE (TREE_TYPE (clone)),
+ clone_parms);
if (exceptions)
type = build_exception_variant (type, exceptions);
TREE_TYPE (clone) = type;
@@ -4649,7 +4586,19 @@ include_empty_classes (record_layout_info rli)
if (TREE_CODE (rli_size) == INTEGER_CST
&& INT_CST_LT_UNSIGNED (rli_size, eoc))
{
- rli->bitpos = round_up (rli->bitpos, BITS_PER_UNIT);
+ if (!abi_version_at_least (2))
+ /* In version 1 of the ABI, the size of a class that ends with
+ a bitfield was not rounded up to a whole multiple of a
+ byte. Because rli_size_unit_so_far returns only the number
+ of fully allocated bytes, any extra bits were not included
+ in the size. */
+ rli->bitpos = round_down (rli->bitpos, BITS_PER_UNIT);
+ else
+ /* The size should have been rounded to a whole byte. */
+ my_friendly_assert (tree_int_cst_equal (rli->bitpos,
+ round_down (rli->bitpos,
+ BITS_PER_UNIT)),
+ 20030903);
rli->bitpos
= size_binop (PLUS_EXPR,
rli->bitpos,
@@ -4810,6 +4759,15 @@ layout_class_type (tree t, tree *virtuals_p)
field to the size of its declared type; the rest of the
field is effectively invisible. */
DECL_SIZE (field) = TYPE_SIZE (type);
+ /* We must also reset the DECL_MODE of the field. */
+ if (abi_version_at_least (2))
+ DECL_MODE (field) = TYPE_MODE (type);
+ else if (warn_abi
+ && DECL_MODE (field) != TYPE_MODE (type))
+ /* Versions of G++ before G++ 3.4 did not reset the
+ DECL_MODE. */
+ warning ("the offset of `%D' may not be ABI-compliant and may "
+ "change in a future version of GCC", field);
}
else
layout_nonempty_base_or_field (rli, field, NULL_TREE,
@@ -5036,7 +4994,6 @@ finish_struct_1 (tree t)
/* If this type was previously laid out as a forward reference,
make sure we lay it out again. */
TYPE_SIZE (t) = NULL_TREE;
- CLASSTYPE_GOT_SEMICOLON (t) = 0;
CLASSTYPE_PRIMARY_BINFO (t) = NULL_TREE;
fixup_inline_methods (t);
@@ -5160,9 +5117,11 @@ finish_struct_1 (tree t)
n_fields = count_fields (TYPE_FIELDS (t));
if (n_fields > 7)
{
- tree field_vec = make_tree_vec (n_fields);
- add_fields_to_vec (TYPE_FIELDS (t), field_vec, 0);
- qsort (&TREE_VEC_ELT (field_vec, 0), n_fields, sizeof (tree),
+ struct sorted_fields_type *field_vec = ggc_alloc (sizeof (struct sorted_fields_type)
+ + n_fields * sizeof (tree));
+ field_vec->len = n_fields;
+ add_fields_to_record_type (TYPE_FIELDS (t), field_vec, 0);
+ qsort (field_vec->elts, n_fields, sizeof (tree),
field_decl_cmp);
if (! DECL_LANG_SPECIFIC (TYPE_MAIN_DECL (t)))
retrofit_lang_decl (TYPE_MAIN_DECL (t));
@@ -5441,8 +5400,7 @@ init_class_processing (void)
current_class_depth = 0;
current_class_stack_size = 10;
current_class_stack
- = (class_stack_node_t) xmalloc (current_class_stack_size
- * sizeof (struct class_stack_node));
+ = xmalloc (current_class_stack_size * sizeof (struct class_stack_node));
VARRAY_TREE_INIT (local_classes, 8, "local_classes");
ridpointers[(int) RID_PUBLIC] = access_public_node;
@@ -5453,19 +5411,6 @@ init_class_processing (void)
/* Set global variables CURRENT_CLASS_NAME and CURRENT_CLASS_TYPE as
appropriate for TYPE.
- If MODIFY is 1, we set IDENTIFIER_CLASS_VALUE's of names
- which can be seen locally to the class. They are shadowed by
- any subsequent local declaration (including parameter names).
-
- If MODIFY is 2, we set IDENTIFIER_CLASS_VALUE's of names
- which have static meaning (i.e., static members, static
- member functions, enum declarations, etc).
-
- If MODIFY is 3, we set IDENTIFIER_CLASS_VALUE of names
- which can be seen locally to the class (as in 1), but
- know that we are doing this for declaration purposes
- (i.e. friend foo::bar (int)).
-
So that we may avoid calls to lookup_name, we cache the _TYPE
nodes of local TYPE_DECLs in the TREE_TYPE field of the name.
@@ -5478,7 +5423,7 @@ init_class_processing (void)
that name becomes `error_mark_node'. */
void
-pushclass (tree type, bool modify)
+pushclass (tree type)
{
type = TYPE_MAIN_VARIANT (type);
@@ -5487,9 +5432,9 @@ pushclass (tree type, bool modify)
{
current_class_stack_size *= 2;
current_class_stack
- = (class_stack_node_t) xrealloc (current_class_stack,
- current_class_stack_size
- * sizeof (struct class_stack_node));
+ = xrealloc (current_class_stack,
+ current_class_stack_size
+ * sizeof (struct class_stack_node));
}
/* Insert a new entry on the class stack. */
@@ -5522,39 +5467,50 @@ pushclass (tree type, bool modify)
/* If we're about to enter a nested class, clear
IDENTIFIER_CLASS_VALUE for the enclosing classes. */
- if (modify && current_class_depth > 1)
+ if (current_class_depth > 1)
clear_identifier_class_values ();
pushlevel_class ();
- if (modify)
+ if (type != previous_class_type || current_class_depth > 1)
{
- if (type != previous_class_type || current_class_depth > 1)
- push_class_decls (type);
- else
+ push_class_decls (type);
+ if (CLASSTYPE_TEMPLATE_INFO (type) && !CLASSTYPE_USE_TEMPLATE (type))
{
- tree item;
-
- /* We are re-entering the same class we just left, so we
- don't have to search the whole inheritance matrix to find
- all the decls to bind again. Instead, we install the
- cached class_shadowed list, and walk through it binding
- names and setting up IDENTIFIER_TYPE_VALUEs. */
- set_class_shadows (previous_class_values);
- for (item = previous_class_values; item; item = TREE_CHAIN (item))
- {
- tree id = TREE_PURPOSE (item);
- tree decl = TREE_TYPE (item);
-
- push_class_binding (id, decl);
- if (TREE_CODE (decl) == TYPE_DECL)
- set_identifier_type_value (id, TREE_TYPE (decl));
- }
- unuse_fields (type);
+ /* If we are entering the scope of a template declaration (not a
+ specialization), we need to push all the using decls with
+ dependent scope too. */
+ tree fields;
+
+ for (fields = TYPE_FIELDS (type);
+ fields; fields = TREE_CHAIN (fields))
+ if (TREE_CODE (fields) == USING_DECL && !TREE_TYPE (fields))
+ pushdecl_class_level (fields);
}
+ }
+ else
+ {
+ tree item;
- cxx_remember_type_decls (CLASSTYPE_NESTED_UTDS (type));
+ /* We are re-entering the same class we just left, so we don't
+ have to search the whole inheritance matrix to find all the
+ decls to bind again. Instead, we install the cached
+ class_shadowed list, and walk through it binding names and
+ setting up IDENTIFIER_TYPE_VALUEs. */
+ set_class_shadows (previous_class_values);
+ for (item = previous_class_values; item; item = TREE_CHAIN (item))
+ {
+ tree id = TREE_PURPOSE (item);
+ tree decl = TREE_TYPE (item);
+
+ push_class_binding (id, decl);
+ if (TREE_CODE (decl) == TYPE_DECL)
+ set_identifier_type_value (id, decl);
+ }
+ unuse_fields (type);
}
+
+ cxx_remember_type_decls (CLASSTYPE_NESTED_UTDS (type));
}
/* When we exit a toplevel class scope, we save the
@@ -5656,7 +5612,7 @@ push_nested_class (tree type)
if (context && CLASS_TYPE_P (context))
push_nested_class (context);
- pushclass (type, true);
+ pushclass (type);
}
/* Undoes a push_nested_class call. */
@@ -5728,18 +5684,17 @@ pop_lang_context (void)
/* Given an OVERLOAD and a TARGET_TYPE, return the function that
matches the TARGET_TYPE. If there is no satisfactory match, return
- error_mark_node, and issue an error message if COMPLAIN is
- nonzero. Permit pointers to member function if PTRMEM is nonzero.
- If TEMPLATE_ONLY, the name of the overloaded function
- was a template-id, and EXPLICIT_TARGS are the explicitly provided
+ error_mark_node, and issue a error & warning messages under control
+ of FLAGS. Permit pointers to member function if FLAGS permits. If
+ TEMPLATE_ONLY, the name of the overloaded function was a
+ template-id, and EXPLICIT_TARGS are the explicitly provided
template arguments. */
static tree
resolve_address_of_overloaded_function (tree target_type,
tree overload,
- int complain,
- int ptrmem,
- int template_only,
+ tsubst_flags_t flags,
+ bool template_only,
tree explicit_targs)
{
/* Here's what the standard says:
@@ -5783,9 +5738,8 @@ resolve_address_of_overloaded_function (tree target_type,
&& (TREE_CODE (TREE_TYPE (target_type))
== METHOD_TYPE)), 0);
- if (TREE_CODE (overload) == COMPONENT_REF)
- overload = TREE_OPERAND (overload, 1);
-
+ my_friendly_assert (is_overloaded_fn (overload), 20030910);
+
/* Check that the TARGET_TYPE is reasonable. */
if (TYPE_PTRFN_P (target_type))
/* This is OK. */;
@@ -5801,7 +5755,7 @@ resolve_address_of_overloaded_function (tree target_type,
}
else
{
- if (complain)
+ if (flags & tf_error)
error ("\
cannot resolve overloaded function `%D' based on conversion to type `%T'",
DECL_NAME (OVL_FUNCTION (overload)), target_type);
@@ -5830,7 +5784,11 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
/* We're looking for a non-static member, and this isn't
one, or vice versa. */
continue;
-
+
+ /* Ignore anticipated decls of undeclared builtins. */
+ if (DECL_ANTICIPATED (fn))
+ continue;
+
/* See if there's a match. */
fntype = TREE_TYPE (fn);
if (is_ptrmem)
@@ -5891,8 +5849,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
continue;
/* Instantiate the template. */
- instantiation = instantiate_template (fn, targs,
- complain ? tf_error : tf_none);
+ instantiation = instantiate_template (fn, targs, flags);
if (instantiation == error_mark_node)
/* Instantiation failed. */
continue;
@@ -5922,7 +5879,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
if (matches == NULL_TREE)
{
/* There were *no* matches. */
- if (complain)
+ if (flags & tf_error)
{
error ("no matches converting function `%D' to type `%#T'",
DECL_NAME (OVL_FUNCTION (overload)),
@@ -5943,7 +5900,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
{
/* There were too many matches. */
- if (complain)
+ if (flags & tf_error)
{
tree match;
@@ -5966,11 +5923,11 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
fn = TREE_PURPOSE (matches);
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
- && !ptrmem && !flag_ms_extensions)
+ && !(flags & tf_ptrmem_ok) && !flag_ms_extensions)
{
static int explained;
- if (!complain)
+ if (!(flags & tf_error))
return error_mark_node;
pedwarn ("assuming pointer to member `%D'", fn);
@@ -5980,7 +5937,13 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
explained = 1;
}
}
- mark_used (fn);
+
+ /* If we're doing overload resolution purely for the purpose of
+ determining conversion sequences, we should not consider the
+ function used. If this conversion sequence is selected, the
+ function will be marked as used at this point. */
+ if (!(flags & tf_conv))
+ mark_used (fn);
if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type))
return build_unary_op (ADDR_EXPR, fn, 0);
@@ -5997,7 +5960,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
/* This function will instantiate the type of the expression given in
RHS to match the type of LHSTYPE. If errors exist, then return
- error_mark_node. FLAGS is a bit mask. If ITF_COMPLAIN is set, then
+ error_mark_node. FLAGS is a bit mask. If TF_ERROR is set, then
we complain on errors. If we are not complaining, never modify rhs,
as overload resolution wants to try many possible instantiations, in
the hope that at least one will work.
@@ -6008,14 +5971,13 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
tree
instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
{
- int complain = (flags & tf_error);
- int allow_ptrmem = flags & tf_ptrmem_ok;
+ tsubst_flags_t flags_in = flags;
flags &= ~tf_ptrmem_ok;
if (TREE_CODE (lhstype) == UNKNOWN_TYPE)
{
- if (complain)
+ if (flags & tf_error)
error ("not enough type information");
return error_mark_node;
}
@@ -6032,7 +5994,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
;
else
{
- if (complain)
+ if (flags & tf_error)
error ("argument of type `%T' does not match `%T'",
TREE_TYPE (rhs), lhstype);
return error_mark_node;
@@ -6083,13 +6045,21 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
return instantiate_type (lhstype, rhs, flags);
case COMPONENT_REF:
- return instantiate_type (lhstype, TREE_OPERAND (rhs, 1), flags);
+ {
+ tree addr = instantiate_type (lhstype, TREE_OPERAND (rhs, 1), flags);
+
+ if (addr != error_mark_node
+ && TREE_SIDE_EFFECTS (TREE_OPERAND (rhs, 0)))
+ /* Do not lose object's side effects. */
+ addr = build (COMPOUND_EXPR, TREE_TYPE (addr),
+ TREE_OPERAND (rhs, 0), addr);
+ return addr;
+ }
case OFFSET_REF:
rhs = TREE_OPERAND (rhs, 1);
if (BASELINK_P (rhs))
- return instantiate_type (lhstype, BASELINK_FUNCTIONS (rhs),
- flags | allow_ptrmem);
+ return instantiate_type (lhstype, BASELINK_FUNCTIONS (rhs), flags_in);
/* This can happen if we are forming a pointer-to-member for a
member template. */
@@ -6103,22 +6073,16 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
tree args = TREE_OPERAND (rhs, 1);
return
- resolve_address_of_overloaded_function (lhstype,
- fns,
- complain,
- allow_ptrmem,
- /*template_only=*/1,
+ resolve_address_of_overloaded_function (lhstype, fns, flags_in,
+ /*template_only=*/true,
args);
}
case OVERLOAD:
case FUNCTION_DECL:
return
- resolve_address_of_overloaded_function (lhstype,
- rhs,
- complain,
- allow_ptrmem,
- /*template_only=*/0,
+ resolve_address_of_overloaded_function (lhstype, rhs, flags_in,
+ /*template_only=*/false,
/*explicit_targs=*/NULL_TREE);
case TREE_LIST:
@@ -6166,7 +6130,6 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
case ABS_EXPR:
case MAX_EXPR:
case MIN_EXPR:
- case FFS_EXPR:
case BIT_AND_EXPR:
case BIT_IOR_EXPR:
@@ -6180,7 +6143,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
case PREDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
- if (complain)
+ if (flags & tf_error)
error ("invalid operation on uninstantiated type");
return error_mark_node;
@@ -6196,14 +6159,14 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
case TRUTH_NOT_EXPR:
- if (complain)
+ if (flags & tf_error)
error ("not enough type information");
return error_mark_node;
case COND_EXPR:
if (type_unknown_p (TREE_OPERAND (rhs, 0)))
{
- if (complain)
+ if (flags & tf_error)
error ("not enough type information");
return error_mark_node;
}
@@ -6266,8 +6229,7 @@ get_vfield_name (tree type)
binfo = BINFO_BASETYPE (binfo, 0);
type = BINFO_TYPE (binfo);
- buf = (char *) alloca (sizeof (VFIELD_NAME_FORMAT)
- + TYPE_NAME_LENGTH (type) + 2);
+ buf = alloca (sizeof (VFIELD_NAME_FORMAT) + TYPE_NAME_LENGTH (type) + 2);
sprintf (buf, VFIELD_NAME_FORMAT,
IDENTIFIER_POINTER (constructor_name (type)));
return get_identifier (buf);
@@ -6307,6 +6269,7 @@ build_self_reference (void)
DECL_NONLOCAL (value) = 1;
DECL_CONTEXT (value) = current_class_type;
DECL_ARTIFICIAL (value) = 1;
+ SET_DECL_SELF_REFERENCE_P (value);
if (processing_template_decl)
value = push_template_decl (value);
@@ -6391,21 +6354,6 @@ get_enclosing_class (tree type)
return NULL_TREE;
}
-/* Return 1 if TYPE or one of its enclosing classes is derived from BASE. */
-
-int
-is_base_of_enclosing_class (tree base, tree type)
-{
- while (type)
- {
- if (lookup_base (type, base, ba_any, NULL))
- return 1;
-
- type = get_enclosing_class (type);
- }
- return 0;
-}
-
/* Note that NAME was looked up while the current class was being
defined and that the result of that lookup was DECL. */
@@ -6415,7 +6363,7 @@ maybe_note_name_used_in_class (tree name, tree decl)
splay_tree names_used;
/* If we're not defining a class, there's nothing to do. */
- if (!current_class_type || !TYPE_BEING_DEFINED (current_class_type))
+ if (innermost_scope_kind() != sk_class)
return;
/* If there's already a binding for this NAME, then we don't have
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 741a0cc7747..92e6b914b3e 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -29,6 +29,8 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "langhooks.h"
#include "langhooks-def.h"
+#include "diagnostic.h"
+#include "cxx-pretty-print.h"
enum c_language_kind c_language = clk_cxx;
@@ -38,6 +40,7 @@ static bool cxx_warn_unused_global_decl (tree);
static tree cp_expr_size (tree);
static size_t cp_tree_size (enum tree_code);
static bool cp_var_mod_type_p (tree);
+static void cxx_initialize_diagnostics (diagnostic_context *);
#undef LANG_HOOKS_NAME
#define LANG_HOOKS_NAME "GNU C++"
@@ -51,6 +54,8 @@ static bool cp_var_mod_type_p (tree);
#define LANG_HOOKS_CLEAR_BINDING_STACK pop_everything
#undef LANG_HOOKS_INIT_OPTIONS
#define LANG_HOOKS_INIT_OPTIONS c_common_init_options
+#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS
+#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS cxx_initialize_diagnostics
#undef LANG_HOOKS_HANDLE_OPTION
#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option
#undef LANG_HOOKS_HANDLE_FILENAME
@@ -77,8 +82,6 @@ static bool cp_var_mod_type_p (tree);
#define LANG_HOOKS_MAYBE_BUILD_CLEANUP cxx_maybe_build_cleanup
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES cxx_insert_default_attributes
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
@@ -99,10 +102,18 @@ static bool cp_var_mod_type_p (tree);
#define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name
#undef LANG_HOOKS_PRINT_ERROR_FUNCTION
#define LANG_HOOKS_PRINT_ERROR_FUNCTION cxx_print_error_function
+#undef LANG_HOOKS_BUILTIN_TYPE_DECLS
+#define LANG_HOOKS_BUILTIN_TYPE_DECLS cxx_builtin_type_decls
+#undef LANG_HOOKS_PUSHLEVEL
+#define LANG_HOOKS_PUSHLEVEL lhd_do_nothing_i
+#undef LANG_HOOKS_POPLEVEL
+#define LANG_HOOKS_POPLEVEL lhd_do_nothing_iii_return_null_tree
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL cxx_warn_unused_global_decl
#undef LANG_HOOKS_WRITE_GLOBALS
#define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing
+#undef LANG_HOOKS_DECL_UNINIT
+#define LANG_HOOKS_DECL_UNINIT c_decl_uninit
#undef LANG_HOOKS_FUNCTION_INIT
@@ -110,6 +121,11 @@ static bool cp_var_mod_type_p (tree);
#undef LANG_HOOKS_FUNCTION_FINAL
#define LANG_HOOKS_FUNCTION_FINAL cxx_pop_function_context
+#undef LANG_HOOKS_RTL_EXPAND_START
+#define LANG_HOOKS_RTL_EXPAND_START cxx_expand_function_start
+#undef LANG_HOOKS_RTL_EXPAND_STMT
+#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt
+
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
@@ -153,13 +169,10 @@ static bool cp_var_mod_type_p (tree);
#undef LANG_HOOKS_EXPR_SIZE
#define LANG_HOOKS_EXPR_SIZE cp_expr_size
-#undef LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE
-#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE prepare_assemble_variable
-
+#undef LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR
+#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR cxx_callgraph_analyze_expr
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION expand_body
-#undef LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION
-#define LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION lower_function
#undef LANG_HOOKS_MAKE_TYPE
#define LANG_HOOKS_MAKE_TYPE cxx_make_type
@@ -177,6 +190,8 @@ static bool cp_var_mod_type_p (tree);
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR cxx_incomplete_type_error
#undef LANG_HOOKS_TYPE_PROMOTES_TO
#define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to
+#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
+#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
/* Each front end provides its own hooks, for toplev.c. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -364,7 +379,7 @@ cp_var_mod_type_p (tree type)
{
/* If TYPE is a pointer-to-member, it is variably modified if either
the class or the member are variably modified. */
- if (TYPE_PTRMEM_P (type) || TYPE_PTRMEMFUNC_P (type))
+ if (TYPE_PTR_TO_MEMBER_P (type))
return (variably_modified_type_p (TYPE_PTRMEM_CLASS_TYPE (type))
|| variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type)));
@@ -372,3 +387,24 @@ cp_var_mod_type_p (tree type)
return false;
}
+/* Stub routine to tell people that this doesn't work yet. */
+void
+c_reset_state (void)
+{
+ sorry ("inter-module optimisations not implemented yet");
+}
+
+/* Construct a C++-aware pretty-printer for CONTEXT. It is assumed
+ that CONTEXT->printer is an already constructed basic pretty_printer. */
+static void
+cxx_initialize_diagnostics (diagnostic_context *context)
+{
+ pretty_printer *base = context->printer;
+ cxx_pretty_printer *pp = xmalloc (sizeof (cxx_pretty_printer));
+ memcpy (pp_base (pp), base, sizeof (pretty_printer));
+ pp_cxx_pretty_printer_init (pp);
+ context->printer = (pretty_printer *) pp;
+
+ /* It is safe to free this object because it was previously malloc()'d. */
+ free (base);
+}
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index f9819ec1cad..36b7aaa85e8 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -195,7 +195,9 @@ DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", 't', 0)
DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0)
/* A using declaration. DECL_INITIAL contains the specified scope.
- This is not an alias, but is later expanded into multiple aliases. */
+ This is not an alias, but is later expanded into multiple aliases.
+ The decl will have a NULL_TYPE iff the scope is a dependent scope,
+ otherwise it will have a void type. */
DEFTREECODE (USING_DECL, "using_decl", 'd', 0)
/* A using directive. The operand is USING_STMT_NAMESPACE. */
@@ -205,11 +207,10 @@ DEFTREECODE (USING_STMT, "using_directive", 'e', 1)
DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 0)
/* A template-id, like foo<int>. The first operand is the template.
- The second is the TREE_LIST or TREE_VEC of explicitly specified
- arguments. The template will be a FUNCTION_DECL, TEMPLATE_DECL, or
- an OVERLOAD. If the template-id refers to a member template, the
- template may be an IDENTIFIER_NODE. In an uninstantiated template,
- the template may be a LOOKUP_EXPR. */
+ The second is NULL if there are no explicit arguments, or a
+ TREE_VEC of arguments. The template will be a FUNCTION_DECL,
+ TEMPLATE_DECL, or an OVERLOAD. If the template-id refers to a
+ member template, the template may be an IDENTIFIER_NODE. */
DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", 'e', 2)
/* A list-like node for chaining overloading candidates. TREE_TYPE is
@@ -220,12 +221,6 @@ DEFTREECODE (OVERLOAD, "overload", 'x', 0)
tree structure. */
DEFTREECODE (WRAPPER, "wrapper", 'x', 0)
-/* Used to represent deferred name lookup for dependent names while
- parsing a template declaration. The first argument is an
- IDENTIFIER_NODE for the name in question. The TREE_TYPE is
- unused. */
-DEFTREECODE (LOOKUP_EXPR, "lookup_expr", 'e', 1)
-
/* A whole bunch of tree codes for the initial, superficial parsing of
templates. */
DEFTREECODE (MODOP_EXPR, "modop_expr", 'e', 3)
@@ -245,8 +240,9 @@ DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3)
modify the original expression, which would change the mangling of
that expression if it appeared in a template argument list. In
that situation, we create a NON_DEPENDENT_EXPR to take the place of
- the original expression. */
-DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", 'e', 0)
+ the original expression. The expression is the only operand -- it
+ is only needed for diagnostics. */
+DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", 'e', 1)
/* CTOR_INITIALIZER is a placeholder in template code for a call to
setup_vtbl_pointer (and appears in all functions, not just ctors). */
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 58eabc3a396..ef38d5565d8 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -39,13 +39,15 @@ struct diagnostic_context;
IDENTIFIER_MARKED (IDENTIFIER_NODEs)
NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
- LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
+ COMPOUND_EXPR_OVERLOADED (in COMPOUND_EXPR).
TREE_INDIRECT_USING (in NAMESPACE_DECL).
ICS_USER_FLAG (in _CONV)
CLEANUP_P (in TRY_BLOCK)
AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF)
PARMLIST_ELLIPSIS_P (in PARMLIST)
+ DECL_PRETTY_FUNCTION_P (in VAR_DECL)
+ KOENIG_LOOKUP_P (in CALL_EXPR)
1: IDENTIFIER_VIRTUAL_P.
TI_PENDING_TEMPLATE_FLAG.
TEMPLATE_PARMS_FOR_INLINE.
@@ -60,6 +62,7 @@ struct diagnostic_context;
ICS_THIS_FLAG (in _CONV)
BINFO_LOST_PRIMARY_P (in BINFO)
TREE_PARMLIST (in TREE_LIST)
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL)
3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
BINFO_VTABLE_PATH_MARKED.
BINFO_PUSHDECLS_MARKED.
@@ -97,6 +100,7 @@ struct diagnostic_context;
3: DECL_IN_AGGR_P.
4: DECL_C_BIT_FIELD (in a FIELD_DECL)
DECL_VAR_MARKED_P (in a VAR_DECL)
+ DECL_SELF_REFERENCE_P (in a TYPE_DECL)
5: DECL_INTERFACE_KNOWN.
6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
@@ -350,6 +354,22 @@ struct tree_wrapper GTY(())
struct z_candidate *z_c;
};
+/* The different kinds of ids that we ecounter. */
+
+typedef enum cp_id_kind
+{
+ /* Not an id at all. */
+ CP_ID_KIND_NONE,
+ /* An unqualified-id that is not a template-id. */
+ CP_ID_KIND_UNQUALIFIED,
+ /* An uqualified-id that is a dependent name. */
+ CP_ID_KIND_UNQUALIFIED_DEPENDENT,
+ /* An unqualified template-id. */
+ CP_ID_KIND_TEMPLATE_ID,
+ /* A qualified-id. */
+ CP_ID_KIND_QUALIFIED
+} cp_id_kind;
+
/* Macros for access to language-specific slots in an identifier. */
#define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \
@@ -778,7 +798,6 @@ struct language_function GTY(())
int returns_abnormally;
int in_function_try_handler;
int in_base_initializer;
- int x_expanding_p;
/* True if this function can throw an exception. */
bool can_throw : 1;
@@ -840,17 +859,6 @@ struct language_function GTY(())
#define current_function_returns_abnormally \
cp_function_chain->returns_abnormally
-/* Nonzero if we should generate RTL for functions that we process.
- When this is zero, we just accumulate tree structure, without
- interacting with the back end. */
-
-#define expanding_p cp_function_chain->x_expanding_p
-
-/* Nonzero if we are in the semantic analysis phase for the current
- function. */
-
-#define doing_semantic_analysis_p() (!expanding_p)
-
/* Nonzero if we are processing a base initializer. Zero elsewhere. */
#define in_base_initializer cp_function_chain->in_base_initializer
@@ -1053,12 +1061,12 @@ struct lang_type_class GTY(())
unsigned has_array_new : 1;
unsigned gets_delete : 2;
- unsigned has_call_overloaded : 1;
- unsigned has_array_ref_overloaded : 1;
- unsigned has_arrow_overloaded : 1;
unsigned interface_only : 1;
unsigned interface_unknown : 1;
unsigned contains_empty_class_p : 1;
+ unsigned anon_aggr : 1;
+ unsigned non_zero_init : 1;
+ unsigned empty_p : 1;
unsigned marks: 6;
unsigned vec_new_uses_cookie : 1;
@@ -1068,7 +1076,7 @@ struct lang_type_class GTY(())
unsigned redefined : 1;
unsigned debug_requested : 1;
unsigned use_template : 2;
- unsigned got_semicolon : 1;
+ unsigned fields_readonly : 1;
unsigned ptrmemfunc_flag : 1;
unsigned was_anonymous : 1;
@@ -1079,11 +1087,6 @@ struct lang_type_class GTY(())
unsigned has_abstract_assign_ref : 1;
unsigned non_aggregate : 1;
unsigned java_interface : 1;
- unsigned anon_aggr : 1;
-
- unsigned non_zero_init : 1;
- unsigned empty_p : 1;
- unsigned fields_readonly : 1;
/* When adding a flag here, consider whether or not it ought to
apply to a template instance if it applies to the template. If
@@ -1092,7 +1095,7 @@ struct lang_type_class GTY(())
/* There are some bits left to fill out a 32-bit word. Keep track
of this by updating the size of this bitfield whenever you add or
remove a flag. */
- unsigned dummy : 5;
+ unsigned dummy : 9;
tree primary_base;
tree vfields;
@@ -1203,18 +1206,6 @@ struct lang_type GTY(())
convenient, don't reprocess any methods that appear in its redefinition. */
#define TYPE_REDEFINED(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->redefined)
-/* Nonzero means that this _CLASSTYPE node overloads operator(). */
-#define TYPE_OVERLOADS_CALL_EXPR(NODE) \
- (LANG_TYPE_CLASS_CHECK (NODE)->has_call_overloaded)
-
-/* Nonzero means that this _CLASSTYPE node overloads operator[]. */
-#define TYPE_OVERLOADS_ARRAY_REF(NODE) \
- (LANG_TYPE_CLASS_CHECK (NODE)->has_array_ref_overloaded)
-
-/* Nonzero means that this _CLASSTYPE node overloads operator->. */
-#define TYPE_OVERLOADS_ARROW(NODE) \
- (LANG_TYPE_CLASS_CHECK (NODE)->has_arrow_overloaded)
-
/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
multiple inheritance. If this is 0 for the root of a type
hierarchy, then we can use more efficient search techniques. */
@@ -1364,9 +1355,6 @@ struct lang_type GTY(())
class must provide its own definition for each of these functions. */
#define CLASSTYPE_PURE_VIRTUALS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->pure_virtuals)
-/* Nonzero means that this aggr type has been `closed' by a semicolon. */
-#define CLASSTYPE_GOT_SEMICOLON(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->got_semicolon)
-
/* Nonzero means that this type has an X() constructor. */
#define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->h.has_default_ctor)
@@ -1619,8 +1607,6 @@ struct lang_type GTY(())
struct lang_decl_flags GTY(())
{
- struct c_lang_decl base;
-
ENUM_BITFIELD(languages) language : 8;
unsigned operator_attr : 1;
@@ -1711,7 +1697,7 @@ struct lang_decl GTY(())
union lang_decl_u3
{
- tree GTY ((tag ("0"), reorder ("resort_sorted_fields")))
+ struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields")))
sorted_fields;
struct cp_token_cache * GTY ((tag ("2"))) pending_inline_info;
struct language_function * GTY ((tag ("1")))
@@ -1910,6 +1896,11 @@ struct lang_decl GTY(())
#define DECL_INITIALIZED_P(NODE) \
(TREE_LANG_FLAG_1 (VAR_DECL_CHECK (NODE)))
+/* Nonzero for a VAR_DECL that was initialized with a
+ constant-expression. */
+#define DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P(NODE) \
+ (TREE_LANG_FLAG_2 (VAR_DECL_CHECK (NODE)))
+
/* Nonzero if the DECL was initialized in the class definition itself,
rather than outside the class. This is used for both static member
VAR_DECLS, and FUNTION_DECLS that are defined in the class. */
@@ -2017,7 +2008,7 @@ struct lang_decl GTY(())
/* Nonzero if this DECL is the __PRETTY_FUNCTION__ variable in a
template function. */
#define DECL_PRETTY_FUNCTION_P(NODE) \
- (TREE_LANG_FLAG_0 (NODE))
+ (TREE_LANG_FLAG_0 (VAR_DECL_CHECK (NODE)))
/* The _TYPE context in which this _DECL appears. This field holds the
class where a virtual function instance is actually defined. */
@@ -2182,11 +2173,8 @@ struct lang_decl GTY(())
/* Nonzero if the template arguments is actually a vector of vectors,
rather than just a vector. */
-#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \
- ((NODE) != NULL_TREE \
- && TREE_CODE (NODE) == TREE_VEC \
- && TREE_VEC_LENGTH (NODE) > 0 \
- && TREE_VEC_ELT (NODE, 0) != NULL_TREE \
+#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \
+ (NODE && TREE_VEC_ELT (NODE, 0) \
&& TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC)
/* The depth of a template argument vector. When called directly by
@@ -2220,9 +2208,7 @@ struct lang_decl GTY(())
/* Given a single level of template arguments in NODE, return the
number of arguments. */
#define NUM_TMPL_ARGS(NODE) \
- ((NODE) == NULL_TREE ? 0 \
- : (TREE_CODE (NODE) == TREE_VEC \
- ? TREE_VEC_LENGTH (NODE) : list_length (NODE)))
+ (TREE_VEC_LENGTH (NODE))
/* Returns the innermost level of template arguments in ARGS. */
#define INNERMOST_TEMPLATE_ARGS(NODE) \
@@ -2242,14 +2228,13 @@ struct lang_decl GTY(())
DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
As a special case, for a member friend template of a template
- class, this value will not be a TEMPLATE_DECL, but rather a
- LOOKUP_EXPR, IDENTIFIER_NODE or OVERLOAD indicating the name of
- the template and any explicit template arguments provided. For
- example, in:
+ class, this value will not be a TEMPLATE_DECL, but rather an
+ IDENTIFIER_NODE or OVERLOAD indicating the name of the template and
+ any explicit template arguments provided. For example, in:
template <class T> struct S { friend void f<int>(int, double); }
- the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
+ the DECL_TI_TEMPLATE will be an IDENTIFIER_NODE for `f' and the
DECL_TI_ARGS will be {int}. */
#define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
@@ -2297,7 +2282,14 @@ struct lang_decl GTY(())
#define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
#define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
#define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
-#define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
+
+/* Indicates that this is a non-dependent COMPOUND_EXPR which will
+ resolve to a function call. */
+#define COMPOUND_EXPR_OVERLOADED(NODE) TREE_LANG_FLAG_0 (NODE)
+
+/* In a CALL_EXPR appearing in a template, true if Koenig lookup
+ should be performed at instantiation time. */
+#define KOENIG_LOOKUP_P(NODE) TREE_LANG_FLAG_0(NODE)
/* Nonzero if this AGGR_INIT_EXPR provides for initialization via a
constructor call, rather than an ordinary function call. */
@@ -2400,8 +2392,7 @@ struct lang_decl GTY(())
(ARITHMETIC_TYPE_P (TYPE) \
|| TREE_CODE (TYPE) == ENUMERAL_TYPE \
|| TYPE_PTR_P (TYPE) \
- || TYPE_PTRMEM_P (TYPE) \
- || TYPE_PTRMEMFUNC_P (TYPE))
+ || TYPE_PTR_TO_MEMBER_P (TYPE))
/* [dcl.init.aggr]
@@ -2487,14 +2478,15 @@ struct lang_decl GTY(())
#define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \
(TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))
-#define TYPE_PTRMEM_P(NODE) \
- (TREE_CODE (NODE) == POINTER_TYPE \
- && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)
-#define TYPE_PTR_P(NODE) \
- (TREE_CODE (NODE) == POINTER_TYPE \
- && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)
-#define TYPE_PTROB_P(NODE) \
- (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \
+/* Returns true if NODE is a pointer-to-data-member. */
+#define TYPE_PTRMEM_P(NODE) \
+ (TREE_CODE (NODE) == OFFSET_TYPE)
+#define TYPE_PTR_P(NODE) \
+ (TREE_CODE (NODE) == POINTER_TYPE)
+#define TYPE_PTROB_P(NODE) \
+ (TYPE_PTR_P (NODE) \
+ && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \
+ && TREE_CODE (TREE_TYPE (NODE)) != METHOD_TYPE \
&& TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)
#define TYPE_PTROBV_P(NODE) \
(TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)
@@ -2515,6 +2507,10 @@ struct lang_decl GTY(())
#define TYPE_PTRMEMFUNC_FLAG(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->ptrmemfunc_flag)
+/* Returns true if NODE is a pointer-to-member. */
+#define TYPE_PTR_TO_MEMBER_P(NODE) \
+ (TYPE_PTRMEM_P (NODE) || TYPE_PTRMEMFUNC_P (NODE))
+
/* Indicates when overload resolution may resolve to a pointer to
member function. [expr.unary.op]/3 */
#define PTRMEM_OK_P(NODE) TREE_LANG_FLAG_0 (NODE)
@@ -2553,13 +2549,13 @@ struct lang_decl GTY(())
type `const X*'. */
#define TYPE_PTRMEM_CLASS_TYPE(NODE) \
(TYPE_PTRMEM_P (NODE) \
- ? TYPE_OFFSET_BASETYPE (TREE_TYPE (NODE)) \
+ ? TYPE_OFFSET_BASETYPE (NODE) \
: TYPE_PTRMEMFUNC_OBJECT_TYPE (NODE))
/* For a pointer-to-member type of the form `T X::*', this is `T'. */
#define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \
(TYPE_PTRMEM_P (NODE) \
- ? TREE_TYPE (TREE_TYPE (NODE)) \
+ ? TREE_TYPE (NODE) \
: TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
/* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
@@ -2737,16 +2733,20 @@ struct lang_decl GTY(())
(TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
/* Nonzero if NODE is the typedef implicitly generated for a type when
- the type is declared. (In C++, `struct S {};' is roughly equivalent
- to `struct S {}; typedef struct S S;' in C. This macro will hold
- for the typedef indicated in this example. Note that in C++, there
- is a second implicit typedef for each class, in the scope of `S'
- itself, so that you can say `S::S'. This macro does *not* hold for
- those typedefs. */
+ the type is declared. In C++, `struct S {};' is roughly
+ equivalent to `struct S {}; typedef struct S S;' in C.
+ DECL_IMPLICIT_TYPEDEF_P will hold for the typedef indicated in this
+ example. In C++, there is a second implicit typedef for each
+ class, in the scope of `S' itself, so that you can say `S::S'.
+ DECL_SELF_REFERENCE_P will hold for that second typedef. */
#define DECL_IMPLICIT_TYPEDEF_P(NODE) \
(TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_2 (NODE))
#define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \
(DECL_LANG_FLAG_2 (NODE) = 1)
+#define DECL_SELF_REFERENCE_P(NODE) \
+ (TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_4 (NODE))
+#define SET_DECL_SELF_REFERENCE_P(NODE) \
+ (DECL_LANG_FLAG_4 (NODE) = 1)
/* A `primary' template is one that has its own template header. A
member function of a class template is a template, but not primary.
@@ -2809,7 +2809,7 @@ struct lang_decl GTY(())
entity with its own template parameter list, and which is not a
full specialization. */
#define PROCESSING_REAL_TEMPLATE_DECL_P() \
- (processing_template_decl > template_class_depth (current_class_type))
+ (processing_template_decl > template_class_depth (current_scope ()))
/* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
instantiated, i.e. its definition has been generated from the
@@ -2820,12 +2820,6 @@ struct lang_decl GTY(())
/* We know what we're doing with this decl now. */
#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
-/* This function was declared inline. This flag controls the linkage
- semantics of 'inline'; whether or not the function is inlined is
- controlled by DECL_INLINE. */
-#define DECL_DECLARED_INLINE_P(NODE) \
- (DECL_LANG_SPECIFIC (NODE)->decl_flags.base.declared_inline)
-
/* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
so that assemble_external will work properly. So we have this flag to
tell us whether the decl is really not external. */
@@ -2930,20 +2924,30 @@ typedef enum cp_lvalue_kind {
clk_none = 0, /* Things that are not an lvalue. */
clk_ordinary = 1, /* An ordinary lvalue. */
clk_class = 2, /* An rvalue of class-type. */
- clk_bitfield = 4 /* An lvalue for a bit-field. */
+ clk_bitfield = 4, /* An lvalue for a bit-field. */
+ clk_packed = 8 /* An lvalue for a packed field. */
} cp_lvalue_kind;
/* The kinds of scopes we recognize. */
typedef enum scope_kind {
- sk_block, /* An ordinary block scope. */
+ sk_block = 0, /* An ordinary block scope. This enumerator must
+ have the value zero because "cp_binding_level"
+ is initialized by using "memset" to set the
+ contents to zero, and the default scope kind
+ is "sk_block". */
sk_try, /* A try-block. */
sk_catch, /* A catch-block. */
sk_for, /* The scope of the variable declared in a
for-init-statement. */
+ sk_function_parms, /* The scope containing function parameters. */
+ sk_class, /* The scope containing the members of a class. */
+ sk_namespace, /* The scope containing the members of a
+ namespace, including the global scope. */
sk_template_parms, /* A scope for template parameters. */
- sk_template_spec /* A scope corresponding to a template
- specialization. There is never anything in
- this scope. */
+ sk_template_spec /* Like sk_template_parms, but for an explicit
+ specialization. Since, by definition, an
+ explicit specialization is introduced by
+ "template <>", this scope is always empty. */
} scope_kind;
/* Various kinds of template specialization, instantiation, etc. */
@@ -3024,8 +3028,19 @@ typedef enum tsubst_flags_t {
tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */
tf_keep_type_decl = 1 << 3, /* retain typedef type decls
(make_typename_type use) */
- tf_ptrmem_ok = 1 << 4 /* pointers to member ok (internal
- instantiate_type use) */
+ tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal
+ instantiate_type use) */
+ tf_user = 1 << 5, /* found template must be a user template
+ (lookup_template_class use) */
+ tf_stmt_expr_cmpd = 1 << 6, /* tsubsting the compound statement of
+ a statement expr. */
+ tf_stmt_expr_body = 1 << 7, /* tsubsting the statements in the
+ body of the compound statement of a
+ statement expr. */
+ tf_conv = 1 << 8 /* We are determining what kind of
+ conversion might be permissible,
+ not actually performing the
+ conversion. */
} tsubst_flags_t;
/* The kind of checking we can do looking in a class hierarchy. */
@@ -3501,7 +3516,6 @@ extern tree build_method_call (tree, tree, tree, tree, int);
extern bool null_ptr_cst_p (tree);
extern bool sufficient_parms_p (tree);
extern tree type_decays_to (tree);
-extern tree resolve_scoped_fn_name (tree, tree);
extern tree build_user_type_conversion (tree, tree, int);
extern tree build_new_function_call (tree, tree);
extern tree build_operator_new_call (tree, tree, tree *, tree *);
@@ -3521,7 +3535,7 @@ extern tree type_passed_as (tree);
extern tree convert_for_arg_passing (tree, tree);
extern tree cp_convert_parm_for_inlining (tree, tree, tree);
extern bool is_properly_derived_from (tree, tree);
-extern tree initialize_reference (tree, tree, tree);
+extern tree initialize_reference (tree, tree, tree, tree *);
extern tree make_temporary_var_for_ref_to_temp (tree, tree);
extern tree strip_top_quals (tree);
extern tree perform_implicit_conversion (tree, tree);
@@ -3532,11 +3546,10 @@ extern tree build_cxx_call (tree, tree, tree);
/* in class.c */
extern tree build_base_path (enum tree_code, tree, tree, int);
extern tree convert_to_base (tree, tree, bool);
+extern tree convert_to_base_statically (tree, tree);
extern tree build_vtbl_ref (tree, tree);
extern tree build_vfn_ref (tree, tree);
extern tree get_vtable_decl (tree, int);
-extern void resort_sorted_fields
- (void *, void *, gt_pointer_operator, void *);
extern void resort_type_method_vec
(void *, void *, gt_pointer_operator, void *);
extern void add_method (tree, tree, int);
@@ -3547,7 +3560,7 @@ extern void finish_struct_1 (tree);
extern int resolves_to_fixed_type_p (tree, int *);
extern void init_class_processing (void);
extern int is_empty_class (tree);
-extern void pushclass (tree, bool);
+extern void pushclass (tree);
extern void popclass (void);
extern void push_nested_class (tree);
extern void pop_nested_class (void);
@@ -3568,7 +3581,6 @@ extern int same_signature_p (tree, tree);
extern void warn_hidden (tree);
extern void maybe_add_class_template_decl_list (tree, tree, int);
extern tree get_enclosing_class (tree);
-int is_base_of_enclosing_class (tree, tree);
extern void unreverse_member_declarations (tree);
extern void invalidate_class_lookup_cache (void);
extern void maybe_note_name_used_in_class (tree, tree);
@@ -3604,7 +3616,6 @@ extern tree pushdecl (tree);
extern void cxx_init_decl_processing (void);
enum cp_tree_node_structure_enum cp_tree_node_structure
(union lang_tree_node *);
-extern void cxx_insert_default_attributes (tree);
extern bool cxx_mark_addressable (tree);
extern void cxx_push_function_context (struct function *);
extern void cxx_pop_function_context (struct function *);
@@ -3612,6 +3623,7 @@ extern void cxx_mark_function_context (struct function *);
extern int toplevel_bindings_p (void);
extern int namespace_bindings_p (void);
extern void keep_next_level (int);
+extern scope_kind innermost_scope_kind (void);
extern int template_parm_scope_p (void);
extern void set_class_shadows (tree);
extern void maybe_push_cleanup_level (tree);
@@ -3660,7 +3672,7 @@ extern tree make_typename_type (tree, tree, tsubst_flags_t);
extern tree make_unbound_class_template (tree, tree, tsubst_flags_t);
extern tree lookup_name_nonclass (tree);
extern tree lookup_function_nonclass (tree, tree);
-extern tree lookup_qualified_name (tree, tree, bool);
+extern tree lookup_qualified_name (tree, tree, bool, bool);
extern tree lookup_name (tree, int);
extern tree lookup_name_current_level (tree);
extern tree lookup_type_current_level (tree);
@@ -3695,8 +3707,8 @@ extern int copy_fn_p (tree);
extern tree get_scope_of_declarator (tree);
extern void grok_special_member_properties (tree);
extern int grok_ctor_properties (tree, tree);
-extern void grok_op_properties (tree, int);
-extern tree xref_tag (enum tag_types, tree, tree, bool);
+extern bool grok_op_properties (tree, int, bool);
+extern tree xref_tag (enum tag_types, tree, tree, bool, bool);
extern tree xref_tag_from_type (tree, tree, int);
extern void xref_basetypes (tree, tree);
extern tree start_enum (tree);
@@ -3743,6 +3755,9 @@ extern tree declare_global_var (tree, tree);
extern void register_dtor_fn (tree);
extern tmpl_spec_kind current_tmpl_spec_kind (int);
extern tree cp_fname_init (const char *);
+extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
+extern tree cxx_builtin_type_decls (void);
+
extern bool have_extern_spec;
/* in decl2.c */
@@ -3773,7 +3788,6 @@ extern void comdat_linkage (tree);
extern void import_export_vtable (tree, tree, int);
extern void import_export_decl (tree);
extern void import_export_tinfo (tree, tree, bool);
-extern void finish_file (void);
extern tree build_cleanup (tree);
extern tree build_offset_ref_call_from_tree (tree, tree);
extern void set_decl_namespace (tree, tree, bool);
@@ -3789,7 +3803,6 @@ extern tree do_class_using_decl (tree);
extern void do_using_directive (tree);
extern void check_default_args (tree);
extern void mark_used (tree);
-extern tree handle_class_head (enum tag_types, tree, tree, tree);
extern tree lookup_arg_dependent (tree, tree, tree);
extern void finish_static_data_member_decl (tree, tree, tree, int);
extern tree cp_build_parm_decl (tree, tree);
@@ -3797,8 +3810,7 @@ extern tree build_artificial_parm (tree, tree);
extern tree get_guard (tree);
extern tree get_guard_cond (tree);
extern tree set_guard (tree);
-extern void prepare_assemble_variable (tree);
-extern void lower_function (tree);
+extern tree cxx_callgraph_analyze_expr (tree *, int *, tree);
/* XXX Not i18n clean. */
#define cp_deprecated(STR) \
@@ -3831,6 +3843,7 @@ extern void mark_all_runtime_matches (void);
extern int nothrow_libfn_p (tree);
extern void check_handlers (tree);
extern void choose_personality_routine (enum languages);
+extern tree eh_type_info (tree);
/* in expr.c */
extern rtx cxx_expand_expr (tree, rtx,
@@ -3840,8 +3853,8 @@ extern tree cplus_expand_constant (tree);
/* friend.c */
extern int is_friend (tree, tree);
-extern void make_friend_class (tree, tree);
-extern void add_friend (tree, tree);
+extern void make_friend_class (tree, tree, bool);
+extern void add_friend (tree, tree, bool);
extern tree do_friend (tree, tree, tree, tree, tree, enum overload_flags, tree, int);
/* in init.c */
@@ -3853,8 +3866,7 @@ extern int is_aggr_type (tree, int);
extern tree get_aggr_from_typedef (tree, int);
extern tree get_type_value (tree);
extern tree build_zero_init (tree, tree, bool);
-extern tree build_offset_ref (tree, tree);
-extern tree resolve_offset_ref (tree);
+extern tree build_offset_ref (tree, tree, bool);
extern tree build_new (tree, tree, tree, int);
extern tree build_vec_init (tree, tree, tree, int);
extern tree build_x_delete (tree, int, tree);
@@ -3863,8 +3875,6 @@ extern void push_base_cleanups (void);
extern tree build_vbase_delete (tree, tree);
extern tree build_vec_delete (tree, tree, special_function_kind, int);
extern tree create_temporary_var (tree);
-extern void begin_init_stmts (tree *, tree *);
-extern tree finish_init_stmts (tree, tree);
extern void initialize_vtbl_ptrs (tree);
extern tree build_java_class_ref (tree);
@@ -3881,13 +3891,9 @@ extern void do_pending_inlines (void);
extern void yyungetc (int, int);
extern void snarf_method (tree);
-extern void note_got_semicolon (tree);
-extern void note_list_got_semicolon (tree);
extern void see_typename (void);
-extern void unqualified_name_lookup_error (tree);
-extern tree do_identifier (tree, tree);
-extern tree do_scoped_id (tree, tree);
-extern tree identifier_typedecl_value (tree);
+extern tree unqualified_name_lookup_error (tree);
+extern tree unqualified_fn_lookup_error (tree);
extern tree build_lang_decl (enum tree_code, tree, tree);
extern void retrofit_lang_decl (tree);
extern tree copy_decl (tree);
@@ -3903,7 +3909,6 @@ extern void cxx_finish (void);
/* in method.c */
extern void init_method (void);
extern void set_mangled_name_for_decl (tree);
-extern tree hack_identifier (tree, tree);
extern tree make_thunk (tree, bool, tree, tree);
extern void finish_thunk (tree);
extern void use_thunk (tree, bool);
@@ -3949,10 +3954,9 @@ extern void mark_class_instantiated (tree, int);
extern void do_decl_instantiation (tree, tree);
extern void do_type_instantiation (tree, tree, tsubst_flags_t);
extern tree instantiate_decl (tree, int);
-extern tree get_bindings (tree, tree, tree);
extern int push_tinst_level (tree);
extern void pop_tinst_level (void);
-extern int more_specialized_class (tree, tree);
+extern int more_specialized_class (tree, tree, tree);
extern int is_member_template (tree);
extern int comp_template_parms (tree, tree);
extern int template_class_depth (tree);
@@ -3964,7 +3968,7 @@ extern tree most_specialized_instantiation (tree);
extern void print_candidates (tree);
extern int instantiate_pending_templates (void);
extern tree tsubst_default_argument (tree, tree, tree);
-extern tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree);
+extern tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree, bool);
extern tree most_general_template (tree);
extern tree get_mostly_instantiated_function_type (tree);
extern int problematic_instantiation_changed (void);
@@ -3983,6 +3987,7 @@ extern tree resolve_typename_type (tree, bool);
extern tree template_for_substitution (tree);
extern tree build_non_dependent_expr (tree);
extern tree build_non_dependent_args (tree);
+extern bool reregister_specialization (tree, tree, tree);
/* in repo.c */
extern void repo_template_used (tree);
@@ -4003,9 +4008,9 @@ extern void emit_support_tinfos (void);
extern bool emit_tinfo_decl (tree);
/* in search.c */
+extern bool accessible_base_p (tree, tree);
extern tree lookup_base (tree, tree, base_access, base_kind *);
extern int types_overlap_p (tree, tree);
-extern tree get_vbase (tree, tree);
extern tree get_dynamic_cast_base_type (tree, tree);
extern int accessible_p (tree, tree);
extern tree lookup_field_1 (tree, tree, bool);
@@ -4015,7 +4020,6 @@ extern tree lookup_fnfields (tree, tree, int);
extern tree lookup_member (tree, tree, int, bool);
extern int look_for_overrides (tree, tree);
extern void get_pure_virtuals (tree);
-extern void get_vbase_types (tree);
extern void maybe_suppress_debug_info (tree);
extern void note_debug_info_needed (tree);
extern void push_class_decls (tree);
@@ -4102,17 +4106,19 @@ extern void finish_handler_parms (tree, tree);
extern void begin_catch_block (tree);
extern void finish_handler (tree);
extern void finish_cleanup (tree, tree);
-extern tree begin_compound_stmt (int);
-extern tree finish_compound_stmt (int, tree);
+extern tree begin_compound_stmt (bool);
+extern tree finish_compound_stmt (tree);
extern tree finish_asm_stmt (tree, tree, tree, tree, tree);
extern tree finish_label_stmt (tree);
extern void finish_label_decl (tree);
extern void finish_subobject (tree);
extern tree finish_parenthesized_expr (tree);
-extern tree finish_non_static_data_member (tree, tree);
+extern tree finish_non_static_data_member (tree, tree, tree);
extern tree begin_stmt_expr (void);
-extern tree finish_stmt_expr (tree);
-extern tree finish_call_expr (tree, tree, bool);
+extern tree finish_stmt_expr_expr (tree);
+extern tree finish_stmt_expr (tree, bool);
+extern tree perform_koenig_lookup (tree, tree);
+extern tree finish_call_expr (tree, tree, bool, bool);
extern tree finish_increment_expr (tree, enum tree_code);
extern tree finish_this_expr (void);
extern tree finish_object_call_expr (tree, tree, tree);
@@ -4126,7 +4132,6 @@ extern tree finish_template_type_parm (tree, tree);
extern tree finish_template_template_parm (tree, tree);
extern tree finish_parmlist (tree, int);
extern tree begin_class_definition (tree);
-extern tree finish_class_definition (tree, tree, int, int);
extern void finish_default_args (void);
extern tree finish_member_class_template (tree);
extern void finish_template_decl (tree);
@@ -4134,24 +4139,27 @@ extern tree finish_template_type (tree, tree, int);
extern tree finish_base_specifier (tree, tree, bool);
extern void finish_member_declaration (tree);
extern void check_multiple_declarators (void);
+extern void qualified_name_lookup_error (tree, tree);
+extern tree finish_id_expression (tree, tree, tree,
+ cp_id_kind *, tree *,
+ bool, bool, bool *,
+ const char **);
extern tree finish_typeof (tree);
-extern tree finish_sizeof (tree);
-extern tree finish_alignof (tree);
extern void finish_decl_cleanup (tree, tree);
extern void finish_eh_cleanup (tree);
extern void expand_body (tree);
+extern void cxx_expand_function_start (void);
extern tree nullify_returns_r (tree *, int *, void *);
extern void do_pushlevel (scope_kind);
extern tree do_poplevel (void);
extern void finish_mem_initializers (tree);
extern void setup_vtbl_ptr (tree, tree);
extern void clear_out_block (void);
-extern tree begin_global_stmt_expr (void);
-extern tree finish_global_stmt_expr (tree);
extern tree check_template_template_default_arg (tree);
extern void expand_or_defer_fn (tree);
extern void check_accessibility_of_qualified_id (tree, tree, tree);
extern tree finish_qualified_id_expr (tree, tree, bool, bool);
+extern void simplify_aggr_init_expr (tree *);
/* in tree.c */
extern void lang_check_failed (const char *, int,
@@ -4165,17 +4173,12 @@ extern int zero_init_p (tree);
extern tree canonical_type_variant (tree);
extern tree copy_base_binfos (tree, tree, tree);
extern int member_p (tree);
-extern cp_lvalue_kind real_lvalue_p (tree);
-extern int non_cast_lvalue_p (tree);
-extern cp_lvalue_kind real_non_cast_lvalue_p (tree);
-extern int non_cast_lvalue_or_else (tree, const char *);
-extern tree build_min (enum tree_code, tree,
- ...);
+extern cp_lvalue_kind real_lvalue_p (tree);
+extern tree build_min (enum tree_code, tree, ...);
extern tree build_min_nt (enum tree_code, ...);
+extern tree build_min_non_dep (enum tree_code, tree, ...);
extern tree build_cplus_new (tree, tree);
extern tree get_target_expr (tree);
-extern tree break_out_calls (tree);
-extern tree build_cplus_method_type (tree, tree, tree);
extern tree build_cplus_staticfn_type (tree, tree, tree);
extern tree build_cplus_array_type (tree, tree);
extern tree hash_tree_cons (tree, tree, tree);
@@ -4190,7 +4193,6 @@ extern tree ovl_cons (tree, tree);
extern tree build_overload (tree, tree);
extern tree function_arg_chain (tree);
extern int promotes_to_aggr_type (tree, enum tree_code);
-extern int is_aggr_type_2 (tree, tree);
extern const char *cxx_printable_name (tree, int);
extern tree build_exception_variant (tree, tree);
extern tree bind_template_template_parm (tree, tree);
@@ -4249,12 +4251,11 @@ extern tree commonparms (tree, tree);
extern tree original_type (tree);
extern bool comp_except_specs (tree, tree, bool);
extern bool comptypes (tree, tree, int);
-extern int comp_target_types (tree, tree, int);
extern bool compparms (tree, tree);
extern int comp_cv_qualification (tree, tree);
extern int comp_cv_qual_signature (tree, tree);
-extern tree expr_sizeof (tree);
-extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, int);
+extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code);
+extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool);
#define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false)
extern tree inline_conversion (tree);
extern tree decay_conversion (tree);
@@ -4270,8 +4271,9 @@ extern tree build_x_binary_op (enum tree_code, tree, tree);
extern tree build_x_unary_op (enum tree_code, tree);
extern tree unary_complex_lvalue (enum tree_code, tree);
extern tree build_x_conditional_expr (tree, tree, tree);
+extern tree build_x_compound_expr_from_list (tree, const char *);
extern tree build_x_compound_expr (tree, tree);
-extern tree build_compound_expr (tree);
+extern tree build_compound_expr (tree, tree);
extern tree build_static_cast (tree, tree);
extern tree build_reinterpret_cast (tree, tree);
extern tree build_const_cast (tree, tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index bc9b309fa25..32d0d794cef 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -180,55 +180,57 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
}
}
- if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
+ if (TYPE_PTRMEMFUNC_P (type))
{
- tree b1;
- tree b2;
- tree binfo;
- enum tree_code code = PLUS_EXPR;
- base_kind bk;
+ error ("cannot convert `%E' from type `%T' to type `%T'",
+ expr, intype, type);
+ return error_mark_node;
+ }
- b1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (type));
- b2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (intype));
- binfo = lookup_base (b1, b2, ba_check, &bk);
- if (!binfo)
- {
- binfo = lookup_base (b2, b1, ba_check, &bk);
- code = MINUS_EXPR;
- }
- if (binfo == error_mark_node)
- return error_mark_node;
+ return build_nop (type, expr);
+ }
+ else if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
+ {
+ tree b1;
+ tree b2;
+ tree binfo;
+ enum tree_code code = PLUS_EXPR;
+ base_kind bk;
+
+ b1 = TYPE_PTRMEM_CLASS_TYPE (type);
+ b2 = TYPE_PTRMEM_CLASS_TYPE (intype);
+ binfo = lookup_base (b1, b2, ba_check, &bk);
+ if (!binfo)
+ {
+ binfo = lookup_base (b2, b1, ba_check, &bk);
+ code = MINUS_EXPR;
+ }
+ if (binfo == error_mark_node)
+ return error_mark_node;
- if (bk == bk_via_virtual)
+ if (bk == bk_via_virtual)
+ {
+ if (force)
+ warning ("pointer to member cast from `%T' to `%T' is via virtual base",
+ intype, type);
+ else
{
- if (force)
- warning ("pointer to member cast from `%T' to `%T' is via virtual base",
- TREE_TYPE (intype), TREE_TYPE (type));
- else
- {
- error ("pointer to member cast from `%T' to `%T' is via virtual base",
- TREE_TYPE (intype), TREE_TYPE (type));
- return error_mark_node;
- }
- /* This is a reinterpret cast, whose result is unspecified.
- We choose to do nothing. */
- return build1 (NOP_EXPR, type, expr);
+ error ("pointer to member cast from `%T' to `%T' is via virtual base",
+ intype, type);
+ return error_mark_node;
}
-
- if (TREE_CODE (expr) == PTRMEM_CST)
- expr = cplus_expand_constant (expr);
-
- if (binfo)
- expr = size_binop (code, convert (sizetype, expr),
- BINFO_OFFSET (binfo));
- }
- else if (TYPE_PTRMEMFUNC_P (type))
- {
- error ("cannot convert `%E' from type `%T' to type `%T'",
- expr, intype, type);
- return error_mark_node;
+ /* This is a reinterpret cast, whose result is unspecified.
+ We choose to do nothing. */
+ return build1 (NOP_EXPR, type, expr);
}
+ if (TREE_CODE (expr) == PTRMEM_CST)
+ expr = cplus_expand_constant (expr);
+
+ if (binfo && !integer_zerop (BINFO_OFFSET (binfo)))
+ expr = size_binop (code,
+ build_nop (sizetype, expr),
+ BINFO_OFFSET (binfo));
return build_nop (type, expr);
}
else if (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype))
@@ -253,8 +255,6 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
return error_mark_node;
}
- my_friendly_assert (form != OFFSET_TYPE, 186);
-
if (integer_zerop (expr))
{
if (TYPE_PTRMEMFUNC_P (type))
@@ -271,8 +271,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
force_fit_type (expr, 0);
return expr;
}
- else if ((TYPE_PTRMEM_P (type) || TYPE_PTRMEMFUNC_P (type))
- && INTEGRAL_CODE_P (form))
+ else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form))
{
error ("invalid conversion from '%T' to '%T'", intype, type);
return error_mark_node;
@@ -454,7 +453,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
register tree intype;
tree rval = NULL_TREE;
tree rval_as_conversion = NULL_TREE;
- int i;
+ bool can_convert_intype_to_type;
if (TREE_CODE (type) == FUNCTION_TYPE
&& TREE_TYPE (expr) == unknown_type_node)
@@ -473,9 +472,9 @@ convert_to_reference (tree reftype, tree expr, int convtype,
intype = TYPE_MAIN_VARIANT (intype);
- i = comp_target_types (type, intype, 0);
-
- if (i <= 0 && (convtype & CONV_IMPLICIT) && IS_AGGR_TYPE (intype)
+ can_convert_intype_to_type = can_convert (type, intype);
+ if (!can_convert_intype_to_type
+ && (convtype & CONV_IMPLICIT) && IS_AGGR_TYPE (intype)
&& ! (flags & LOOKUP_NO_CONVERSION))
{
/* Look for a user-defined conversion to lvalue that we can use. */
@@ -489,12 +488,12 @@ convert_to_reference (tree reftype, tree expr, int convtype,
expr = rval_as_conversion;
rval_as_conversion = NULL_TREE;
intype = type;
- i = 1;
+ can_convert_intype_to_type = 1;
}
}
- if (((convtype & CONV_STATIC) && i == -1)
- || ((convtype & CONV_IMPLICIT) && i == 1))
+ if (((convtype & CONV_STATIC) && can_convert (intype, type))
+ || ((convtype & CONV_IMPLICIT) && can_convert_intype_to_type))
{
if (flags & LOOKUP_COMPLAIN)
{
@@ -550,8 +549,6 @@ convert_to_reference (tree reftype, tree expr, int convtype,
return rval;
}
- my_friendly_assert (TREE_CODE (intype) != OFFSET_TYPE, 189);
-
if (flags & LOOKUP_COMPLAIN)
error ("cannot convert type `%T' to type `%T'", intype, reftype);
@@ -618,8 +615,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
register tree e = expr;
register enum tree_code code = TREE_CODE (type);
- if (e == error_mark_node
- || TREE_TYPE (e) == error_mark_node)
+ if (error_operand_p (e) || type == error_mark_node)
return error_mark_node;
complete_type (type);
@@ -671,13 +667,6 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
return e;
}
- /* Just convert to the type of the member. */
- if (code == OFFSET_TYPE)
- {
- type = TREE_TYPE (type);
- code = TREE_CODE (type);
- }
-
if (INTEGRAL_CODE_P (code))
{
tree intype = TREE_TYPE (e);
@@ -721,8 +710,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
}
return fold (convert_to_integer (type, e));
}
- if (code == POINTER_TYPE || code == REFERENCE_TYPE
- || TYPE_PTRMEMFUNC_P (type))
+ if (POINTER_TYPE_P (type) || TYPE_PTR_TO_MEMBER_P (type))
return fold (cp_convert_to_pointer (type, e, false));
if (code == VECTOR_TYPE)
return fold (convert_to_vector (type, e));
@@ -824,8 +812,12 @@ convert_to_void (tree expr, const char *implicit)
/* The two parts of a cond expr might be separate lvalues. */
tree op1 = TREE_OPERAND (expr,1);
tree op2 = TREE_OPERAND (expr,2);
- tree new_op1 = convert_to_void (op1, implicit);
- tree new_op2 = convert_to_void (op2, implicit);
+ tree new_op1 = convert_to_void
+ (op1, (implicit && !TREE_SIDE_EFFECTS (op2)
+ ? "second operand of conditional" : NULL));
+ tree new_op2 = convert_to_void
+ (op2, (implicit && !TREE_SIDE_EFFECTS (op1)
+ ? "third operand of conditional" : NULL));
expr = build (COND_EXPR, TREE_TYPE (new_op1),
TREE_OPERAND (expr, 0), new_op1, new_op2);
@@ -836,14 +828,13 @@ 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);
+ tree new_op1 = convert_to_void
+ (op1, implicit ? "right-hand operand of comma" : NULL);
if (new_op1 != op1)
{
tree t = build (COMPOUND_EXPR, TREE_TYPE (new_op1),
TREE_OPERAND (expr, 0), new_op1);
- TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (expr);
- TREE_NO_UNUSED_WARNING (t) = TREE_NO_UNUSED_WARNING (expr);
expr = t;
}
@@ -913,13 +904,9 @@ convert_to_void (tree expr, const char *implicit)
if (expr != error_mark_node && !VOID_TYPE_P (TREE_TYPE (expr)))
{
- /* FIXME: This is where we should check for expressions with no
- effects. At the moment we do that in both build_x_component_expr
- and expand_expr_stmt -- inconsistently too. For the moment
- leave implicit void conversions unadorned so that expand_expr_stmt
- has a chance of detecting some of the cases. */
- if (!implicit)
- expr = build1 (CONVERT_EXPR, void_type_node, expr);
+ if (implicit && !TREE_SIDE_EFFECTS (expr) && warn_unused_value)
+ warning ("%s has no effect", implicit);
+ expr = build1 (CONVERT_EXPR, void_type_node, expr);
}
return expr;
}
@@ -1178,10 +1165,20 @@ type_promotes_to (tree type)
tree
perform_qualification_conversions (tree type, tree expr)
{
- if (TREE_CODE (type) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE
- && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (TREE_TYPE (expr))))
- return build1 (NOP_EXPR, type, expr);
+ tree expr_type;
+
+ expr_type = TREE_TYPE (expr);
+
+ if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type)
+ && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type)))
+ return build_nop (type, expr);
+ else if (TYPE_PTR_TO_MEMBER_P (type)
+ && TYPE_PTR_TO_MEMBER_P (expr_type)
+ && same_type_p (TYPE_PTRMEM_CLASS_TYPE (type),
+ TYPE_PTRMEM_CLASS_TYPE (expr_type))
+ && comp_ptr_ttypes (TYPE_PTRMEM_POINTED_TO_TYPE (type),
+ TYPE_PTRMEM_POINTED_TO_TYPE (expr_type)))
+ return build_nop (type, expr);
else
return error_mark_node;
}
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
new file mode 100644
index 00000000000..69ee6b53675
--- /dev/null
+++ b/gcc/cp/cxx-pretty-print.c
@@ -0,0 +1,1739 @@
+/* Implementation of subroutines for the GNU C++ pretty-printer.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "real.h"
+#include "cxx-pretty-print.h"
+#include "cp-tree.h"
+#include "toplev.h"
+
+static void pp_cxx_unqualified_id (cxx_pretty_printer *, tree);
+static void pp_cxx_nested_name_specifier (cxx_pretty_printer *, tree);
+static void pp_cxx_qualified_id (cxx_pretty_printer *, tree);
+static void pp_cxx_assignment_expression (cxx_pretty_printer *, tree);
+static void pp_cxx_expression (cxx_pretty_printer *, tree);
+static void pp_cxx_template_argument_list (cxx_pretty_printer *, tree);
+static void pp_cxx_type_specifier_seq (cxx_pretty_printer *, tree);
+static void pp_cxx_ptr_operator (cxx_pretty_printer *, tree);
+static void pp_cxx_type_id (cxx_pretty_printer *, tree);
+static void pp_cxx_direct_abstract_declarator (cxx_pretty_printer *, tree);
+static void pp_cxx_declarator (cxx_pretty_printer *, tree);
+static void pp_cxx_abstract_declarator (cxx_pretty_printer *, tree);
+static void pp_cxx_template_parameter (cxx_pretty_printer *, tree);
+
+#define pp_cxx_whitespace(PP) pp_c_whitespace (pp_c_base (PP))
+#define pp_cxx_left_paren(PP) pp_c_left_paren (pp_c_base (PP))
+#define pp_cxx_right_paren(PP) pp_c_right_paren (pp_c_base (PP))
+#define pp_cxx_left_brace(PP) pp_c_left_brace (pp_c_base (PP))
+#define pp_cxx_right_brace(PP) pp_c_right_brace (pp_c_base (PP))
+#define pp_cxx_dot(PP) pp_c_dot (pp_c_base (PP))
+#define pp_cxx_arrow(PP) pp_c_arrow (pp_c_base (PP))
+#define pp_cxx_semicolon(PP) pp_c_semicolon (pp_c_base (PP))
+
+static inline void
+pp_cxx_nonconsecutive_character (cxx_pretty_printer *pp, int c)
+{
+ const char *p = pp_last_position_in_text (pp);
+
+ if (p != NULL && *p == c)
+ pp_cxx_whitespace (pp);
+ pp_character (pp, c);
+ pp_base (pp)->padding = pp_none;
+}
+
+#define pp_cxx_begin_template_argument_list(PP) \
+ pp_cxx_nonconsecutive_character (PP, '<')
+#define pp_cxx_end_template_argument_list(PP) \
+ pp_cxx_nonconsecutive_character (PP, '>')
+
+#define pp_cxx_identifier(PP, ID) pp_c_identifier (pp_c_base (PP), ID)
+#define pp_cxx_tree_identifier(PP, T) pp_c_tree_identifier (pp_c_base (PP), T)
+
+#define pp_cxx_cv_qualifier_seq(PP, T) \
+ pp_c_type_qualifier_list (pp_c_base (PP), T)
+#define pp_cxx_storage_class_specifier(PP, T) \
+ pp_c_storage_class_specifier (pp_c_base (PP), T)
+#define pp_cxx_expression_list(PP, T) \
+ pp_c_expression_list (pp_c_base (PP), T)
+#define pp_cxx_space_for_pointer_operator(PP, T) \
+ pp_c_space_for_pointer_operator (pp_c_base (PP), T)
+#define pp_cxx_init_declarator(PP, T) \
+ pp_c_init_declarator (pp_c_base (PP), T)
+#define pp_cxx_call_argument_list(PP, T) \
+ pp_c_call_argument_list (pp_c_base (PP), T)
+
+static void
+pp_cxx_colon_colon (cxx_pretty_printer *pp)
+{
+ pp_colon_colon (pp);
+ pp_base (pp)->padding = pp_none;
+}
+
+
+/* Expressions. */
+
+static inline bool
+is_destructor_name (tree name)
+{
+ return name == complete_dtor_identifier
+ || name == base_dtor_identifier
+ || name == deleting_dtor_identifier;
+}
+
+/* conversion-function-id:
+ operator conversion-type-id
+
+ conversion-type-id:
+ type-specifier-seq conversion-declarator(opt)
+
+ conversion-declarator:
+ ptr-operator conversion-declarator(opt) */
+static inline void
+pp_cxx_conversion_function_id (cxx_pretty_printer *pp, tree t)
+{
+ pp_cxx_identifier (pp, "operator");
+ pp_cxx_type_specifier_seq (pp, TREE_TYPE (t));
+}
+
+static inline void
+pp_cxx_template_id (cxx_pretty_printer *pp, tree t)
+{
+ pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 0));
+ pp_cxx_begin_template_argument_list (pp);
+ pp_cxx_template_argument_list (pp, TREE_OPERAND (t, 1));
+ pp_cxx_end_template_argument_list (pp);
+}
+
+/* unqualified-id:
+ identifier
+ operator-function-id
+ conversion-function-id
+ ~ class-name
+ template-id */
+static void
+pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t)
+{
+ enum tree_code code = TREE_CODE (t);
+ switch (code)
+ {
+ case RESULT_DECL:
+ pp_cxx_identifier (pp, "<return-value>");
+ break;
+
+ case OVERLOAD:
+ t = OVL_CURRENT (t);
+ case VAR_DECL:
+ case PARM_DECL:
+ case CONST_DECL:
+ case TYPE_DECL:
+ case FUNCTION_DECL:
+ case NAMESPACE_DECL:
+ case FIELD_DECL:
+ case LABEL_DECL:
+ case USING_DECL:
+ case TEMPLATE_DECL:
+ t = DECL_NAME (t);
+
+ case IDENTIFIER_NODE:
+ if (t == NULL)
+ pp_cxx_identifier (pp, "<anonymous>");
+ else if (IDENTIFIER_TYPENAME_P (t))
+ pp_cxx_conversion_function_id (pp, t);
+ else
+ {
+ if (is_destructor_name (t))
+ {
+ pp_complement (pp);
+ /* FIXME: Why is this necessary? */
+ if (TREE_TYPE (t))
+ t = constructor_name (TREE_TYPE (t));
+ }
+ pp_cxx_tree_identifier (pp, t);
+ }
+ break;
+
+ case TEMPLATE_ID_EXPR:
+ pp_cxx_template_id (pp, t);
+ break;
+
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case ENUMERAL_TYPE:
+ pp_cxx_unqualified_id (pp, TYPE_NAME (t));
+ break;
+
+ case TEMPLATE_TYPE_PARM:
+ t = TYPE_FIELDS (t);
+ case TEMPLATE_PARM_INDEX:
+ pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t));
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
+ }
+}
+
+static inline void
+pp_cxx_template_keyword_if_needed (cxx_pretty_printer *pp, tree scope, tree t)
+{
+ if (TREE_CODE (t) == TEMPLATE_ID_EXPR
+ && TYPE_P (scope) && dependent_type_p (scope))
+ pp_cxx_identifier (pp, "template");
+}
+
+/* nested-name-specifier:
+ class-or-namespace-name :: nested-name-specifier(opt)
+ class-or-namespace-name :: template nested-name-specifier */
+static void
+pp_cxx_nested_name_specifier (cxx_pretty_printer *pp, tree t)
+{
+ if (t != NULL && t != pp->enclosing_scope)
+ {
+ tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t);
+ pp_cxx_nested_name_specifier (pp, scope);
+ pp_cxx_template_keyword_if_needed (pp, scope, t);
+ pp_cxx_unqualified_id (pp, t);
+ pp_cxx_colon_colon (pp);
+ }
+}
+
+/* qualified-id:
+ nested-name-specifier template(opt) unqualified-id */
+static void
+pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case PTRMEM_CST:
+ pp_cxx_nested_name_specifier (pp, PTRMEM_CST_CLASS (t));
+ pp_cxx_unqualified_id (pp, PTRMEM_CST_MEMBER (t));
+ break;
+
+ case OVERLOAD:
+ t = OVL_CURRENT (t);
+ case FUNCTION_DECL:
+ if (DECL_FUNCTION_MEMBER_P (t))
+ pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t));
+ pp_cxx_unqualified_id
+ (pp, DECL_CONSTRUCTOR_P (t) ? DECL_CONTEXT (t) : t);
+ break;
+
+ case OFFSET_REF:
+ case SCOPE_REF:
+ pp_cxx_nested_name_specifier (pp, TREE_OPERAND (t, 0));
+ pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 1));
+ break;
+
+ default:
+ {
+ tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t);
+ if (scope != pp->enclosing_scope)
+ {
+ pp_cxx_nested_name_specifier (pp, scope);
+ pp_cxx_template_keyword_if_needed (pp, scope, t);
+ }
+ pp_cxx_unqualified_id (pp, t);
+ }
+ break;
+ }
+}
+
+/* id-expression:
+ unaqualified-id
+ qualified-id */
+static inline void
+pp_cxx_id_expression (cxx_pretty_printer *pp, tree t)
+{
+ if (TREE_CODE (t) == OVERLOAD)
+ t = OVL_CURRENT (t);
+ if ((TREE_CODE (t) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (t))
+ || (pp_c_base (pp)->flags
+ & (pp_cxx_flag_qualified_id | pp_cxx_flag_global_scope)))
+ pp_cxx_qualified_id (pp, t);
+ else
+ pp_cxx_unqualified_id (pp, t);
+}
+
+/* primary-expression:
+ literal
+ this
+ :: identifier
+ :: operator-function-id
+ :: qualifier-id
+ ( expression )
+ id-expression */
+static void
+pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case STRING_CST:
+ case INTEGER_CST:
+ case REAL_CST:
+ pp_c_constant (pp_c_base (pp), t);
+ break;
+
+ case BASELINK:
+ t = BASELINK_FUNCTIONS (t);
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ case FUNCTION_DECL:
+ case OVERLOAD:
+ case CONST_DECL:
+ case TEMPLATE_DECL:
+ pp_cxx_id_expression (pp, t);
+ break;
+
+ case RESULT_DECL:
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_PARM_INDEX:
+ pp_cxx_unqualified_id (pp, t);
+ break;
+
+ default:
+ pp_c_primary_expression (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* postfix-expression:
+ primary-expression
+ postfix-expression [ expression ]
+ postfix-expression ( expression-list(opt) )
+ simple-type-specifier ( expression-list(opt) )
+ typename ::(opt) nested-name-specifier identifier ( expression-list(opt) )
+ typename ::(opt) nested-name-specifier template(opt)
+ template-id ( expression-list(opt) )
+ postfix-expression . template(opt) ::(opt) id-expression
+ postfix-expression -> template(opt) ::(opt) id-expression
+ postfix-expression . pseudo-destructor-name
+ postfix-expression -> pseudo-destructor-name
+ postfix-expression ++
+ postfix-expression --
+ dynamic_cast < type-id > ( expression )
+ static_cast < type-id > ( expression )
+ reinterpret_cast < type-id > ( expression )
+ const_cast < type-id > ( expression )
+ typeid ( expression )
+ typeif ( type-id ) */
+
+static void
+pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t)
+{
+ enum tree_code code = TREE_CODE (t);
+
+ switch (code)
+ {
+ case AGGR_INIT_EXPR:
+ case CALL_EXPR:
+ {
+ tree fun = TREE_OPERAND (t, 0);
+ tree args = TREE_OPERAND (t, 1);
+ tree saved_scope = pp->enclosing_scope;
+
+ if (TREE_CODE (fun) == ADDR_EXPR)
+ fun = TREE_OPERAND (fun, 0);
+
+ /* In templates, where there is no way to tell whether a given
+ call uses an actual member function. So the parser builds
+ FUN as a COMPONENT_REF or a plain IDENTIFIER_NODE until
+ instantiation time. */
+ if (TREE_CODE (fun) != FUNCTION_DECL)
+ ;
+ else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun))
+ {
+ tree object = code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t)
+ ? TREE_OPERAND (t, 2)
+ : TREE_VALUE (args);
+
+ while (TREE_CODE (object) == NOP_EXPR)
+ object = TREE_OPERAND (object, 0);
+
+ if (TREE_CODE (object) == ADDR_EXPR)
+ object = TREE_OPERAND (object, 0);
+
+ if (TREE_CODE (TREE_TYPE (object)) != POINTER_TYPE)
+ {
+ pp_cxx_postfix_expression (pp, object);
+ pp_cxx_dot (pp);
+ }
+ else
+ {
+ pp_cxx_postfix_expression (pp, object);
+ pp_cxx_arrow (pp);
+ }
+ args = TREE_CHAIN (args);
+ pp->enclosing_scope = strip_pointer_operator (TREE_TYPE (object));
+ }
+
+ pp_cxx_postfix_expression (pp, fun);
+ pp->enclosing_scope = saved_scope;
+ pp_cxx_call_argument_list (pp, args);
+ }
+ if (code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t))
+ {
+ pp_separate_with (pp, ',');
+ pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 2));
+ }
+ break;
+
+ case BASELINK:
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ case FUNCTION_DECL:
+ case OVERLOAD:
+ case CONST_DECL:
+ case TEMPLATE_DECL:
+ case RESULT_DECL:
+ pp_cxx_primary_expression (pp, t);
+ break;
+
+ case DYNAMIC_CAST_EXPR:
+ case STATIC_CAST_EXPR:
+ case REINTERPRET_CAST_EXPR:
+ case CONST_CAST_EXPR:
+ if (code == DYNAMIC_CAST_EXPR)
+ pp_identifier (pp, "dynamic_cast");
+ else if (code == STATIC_CAST_EXPR)
+ pp_identifier (pp, "static_cast");
+ else if (code == REINTERPRET_CAST_EXPR)
+ pp_identifier (pp, "reinterpret_cast");
+ else
+ pp_identifier (pp, "const_cast");
+ pp_cxx_begin_template_argument_list (pp);
+ pp_cxx_type_id (pp, TREE_TYPE (t));
+ pp_cxx_end_template_argument_list (pp);
+ pp_left_paren (pp);
+ pp_cxx_expression (pp, TREE_OPERAND (t, 0));
+ pp_right_paren (pp);
+ break;
+
+ case EMPTY_CLASS_EXPR:
+ pp_cxx_type_id (pp, TREE_TYPE (t));
+ pp_left_paren (pp);
+ pp_right_paren (pp);
+ break;
+
+ case TYPEID_EXPR:
+ t = TREE_OPERAND (t, 0);
+ pp_cxx_identifier (pp, "typeid");
+ pp_left_paren (pp);
+ if (TYPE_P (t))
+ pp_cxx_type_id (pp, t);
+ else
+ pp_cxx_expression (pp, t);
+ pp_right_paren (pp);
+ break;
+
+ case PSEUDO_DTOR_EXPR:
+ pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 0));
+ pp_cxx_dot (pp);
+ pp_cxx_qualified_id (pp, TREE_OPERAND (t, 1));
+ pp_cxx_colon_colon (pp);
+ pp_complement (pp);
+ pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 2));
+ break;
+
+ default:
+ pp_c_postfix_expression (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* new-expression:
+ ::(opt) new new-placement(opt) new-type-id new-initializer(opt)
+ ::(opt) new new-placement(opt) ( type-id ) new-initializer(opt)
+
+ new-placement:
+ ( expression-list )
+
+ new-type-id:
+ type-specifier-seq new-declarator(opt)
+
+ new-declarator:
+ ptr-operator new-declarator(opt)
+ direct-new-declarator
+
+ direct-new-declarator
+ [ expression ]
+ direct-new-declarator [ constant-expression ]
+
+ new-initializer:
+ ( expression-list(opt) ) */
+static void
+pp_cxx_new_expression (cxx_pretty_printer *pp, tree t)
+{
+ enum tree_code code = TREE_CODE (t);
+ switch (code)
+ {
+ case NEW_EXPR:
+ case VEC_NEW_EXPR:
+ if (NEW_EXPR_USE_GLOBAL (t))
+ pp_cxx_colon_colon (pp);
+ pp_cxx_identifier (pp, "new");
+ if (TREE_OPERAND (t, 0))
+ {
+ pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0));
+ pp_space (pp);
+ }
+ /* FIXME: array-types are built with one more element. */
+ pp_cxx_type_id (pp, TREE_OPERAND (t, 1));
+ if (TREE_OPERAND (t, 2))
+ {
+ pp_left_paren (pp);
+ t = TREE_OPERAND (t, 2);
+ if (TREE_CODE (t) == TREE_LIST)
+ pp_c_expression_list (pp_c_base (pp), t);
+ else if (t == void_zero_node)
+ ; /* OK, empty initializer list. */
+ else
+ pp_cxx_expression (pp, t);
+ pp_right_paren (pp);
+ }
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ }
+}
+
+/* delete-expression:
+ ::(opt) delete cast-expression
+ ::(opt) delete [ ] cast-expression */
+static void
+pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
+{
+ enum tree_code code = TREE_CODE (t);
+ switch (code)
+ {
+ case DELETE_EXPR:
+ case VEC_DELETE_EXPR:
+ if (DELETE_EXPR_USE_GLOBAL (t))
+ pp_cxx_colon_colon (pp);
+ pp_cxx_identifier (pp, "delete");
+ if (code == VEC_DELETE_EXPR)
+ {
+ pp_left_bracket (pp);
+ pp_right_bracket (pp);
+ }
+ pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0));
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ }
+}
+
+/* unary-expression:
+ postfix-expression
+ ++ cast-expression
+ -- cast-expression
+ unary-operator cast-expression
+ sizeof unary-expression
+ sizeof ( type-id )
+ new-expression
+ delete-expression
+
+ unary-operator: one of
+ * & + - !
+
+ GNU extensions:
+ __alignof__ unary-expression
+ __alignof__ ( type-id ) */
+static void
+pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t)
+{
+ enum tree_code code = TREE_CODE (t);
+ switch (code)
+ {
+ case NEW_EXPR:
+ case VEC_NEW_EXPR:
+ pp_cxx_new_expression (pp, t);
+ break;
+
+ case DELETE_EXPR:
+ case VEC_DELETE_EXPR:
+ pp_cxx_delete_expression (pp, t);
+ break;
+
+ default:
+ pp_c_unary_expression (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* cast-expression:
+ unary-expression
+ ( type-id ) cast-expression */
+static void
+pp_cxx_cast_expression (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case CAST_EXPR:
+ pp_cxx_type_id (pp, TREE_TYPE (t));
+ pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0));
+ break;
+
+ default:
+ pp_c_cast_expression (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* pm-expression:
+ cast-expression
+ pm-expression .* cast-expression
+ pm-expression ->* cast-expression */
+static void
+pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ /* Handle unfortunate OFFESET_REF overloading here. */
+ case OFFSET_REF:
+ if (TYPE_P (TREE_OPERAND (t, 0)))
+ {
+ pp_cxx_qualified_id (pp, t);
+ break;
+ }
+ /* else fall through */
+ case MEMBER_REF:
+ case DOTSTAR_EXPR:
+ pp_cxx_pm_expression (pp, TREE_OPERAND (t, 0));
+ pp_cxx_dot (pp);
+ pp_star(pp);
+ pp_cxx_cast_expression (pp, TREE_OPERAND (t, 1));
+ break;
+
+
+ default:
+ pp_cxx_cast_expression (pp, t);
+ break;
+ }
+}
+
+/* multiplicative-expression:
+ pm-expression
+ multiplicative-expression * pm-expression
+ multiplicative-expression / pm-expression
+ multiplicative-expression % pm-expression */
+static void
+pp_cxx_multiplicative_expression (cxx_pretty_printer *pp, tree e)
+{
+ enum tree_code code = TREE_CODE (e);
+ switch (code)
+ {
+ case MULT_EXPR:
+ case TRUNC_DIV_EXPR:
+ case TRUNC_MOD_EXPR:
+ pp_cxx_multiplicative_expression (pp, TREE_OPERAND (e, 0));
+ pp_space (pp);
+ if (code == MULT_EXPR)
+ pp_star (pp);
+ else if (code == TRUNC_DIV_EXPR)
+ pp_slash (pp);
+ else
+ pp_modulo (pp);
+ pp_space (pp);
+ pp_cxx_pm_expression (pp, TREE_OPERAND (e, 1));
+ break;
+
+ default:
+ pp_cxx_pm_expression (pp, e);
+ break;
+ }
+}
+
+/* conditional-expression:
+ logical-or-expression
+ logical-or-expression ? expression : assignment-expression */
+static void
+pp_cxx_conditional_expression (cxx_pretty_printer *pp, tree e)
+{
+ if (TREE_CODE (e) == COND_EXPR)
+ {
+ pp_c_logical_or_expression (pp_c_base (pp), TREE_OPERAND (e, 0));
+ pp_space (pp);
+ pp_question (pp);
+ pp_space (pp);
+ pp_cxx_expression (pp, TREE_OPERAND (e, 1));
+ pp_space (pp);
+ pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 2));
+ }
+ else
+ pp_c_logical_or_expression (pp_c_base (pp), e);
+}
+
+static void
+pp_cxx_assignment_operator (cxx_pretty_printer *pp, tree t)
+{
+ const char *op;
+
+ switch (TREE_CODE (t))
+ {
+ case NOP_EXPR:
+ op = "=";
+ break;
+
+ case PLUS_EXPR:
+ op = "+=";
+ break;
+
+ case MINUS_EXPR:
+ op = "-=";
+ break;
+
+ case TRUNC_DIV_EXPR:
+ op = "/=";
+ break;
+
+ case TRUNC_MOD_EXPR:
+ op = "%=";
+ break;
+
+ default:
+ op = tree_code_name[TREE_CODE (t)];
+ break;
+ }
+
+ pp_cxx_identifier (pp, op);
+}
+
+
+/* assignment-expression:
+ conditional-expression
+ logical-or-expression assignment-operator assignment-expression
+ throw-expression
+
+ throw-expression:
+ throw assignment-expression(opt)
+
+ assignment-operator: one of
+ = *= /= %= += -= >>= <<= &= ^= |= */
+static void
+pp_cxx_assignment_expression (cxx_pretty_printer *pp, tree e)
+{
+ switch (TREE_CODE (e))
+ {
+ case MODIFY_EXPR:
+ case INIT_EXPR:
+ pp_c_logical_or_expression (pp_c_base (pp), TREE_OPERAND (e, 0));
+ pp_space (pp);
+ pp_equal (pp);
+ pp_space (pp);
+ pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 1));
+ break;
+
+ case THROW_EXPR:
+ pp_cxx_identifier (pp, "throw");
+ if (TREE_OPERAND (e, 0))
+ pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 0));
+ break;
+
+ case MODOP_EXPR:
+ pp_c_logical_or_expression (pp_c_base (pp), TREE_OPERAND (e, 0));
+ pp_cxx_assignment_operator (pp, TREE_OPERAND (e, 1));
+ pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 2));
+ break;
+
+ default:
+ pp_cxx_conditional_expression (pp, e);
+ break;
+ }
+}
+
+static void
+pp_cxx_expression (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case STRING_CST:
+ case INTEGER_CST:
+ case REAL_CST:
+ pp_c_constant (pp_c_base (pp), t);
+ break;
+
+ case RESULT_DECL:
+ pp_cxx_unqualified_id (pp, t);
+ break;
+
+#if 0
+ case OFFSET_REF:
+#endif
+ case SCOPE_REF:
+ case PTRMEM_CST:
+ pp_cxx_qualified_id (pp, t);
+ break;
+
+ case OVERLOAD:
+ t = OVL_CURRENT (t);
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ case CONST_DECL:
+ case FUNCTION_DECL:
+ case BASELINK:
+ case TEMPLATE_DECL:
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_PARM_INDEX:
+ pp_cxx_primary_expression (pp, t);
+ break;
+
+ case CALL_EXPR:
+ case DYNAMIC_CAST_EXPR:
+ case STATIC_CAST_EXPR:
+ case REINTERPRET_CAST_EXPR:
+ case CONST_CAST_EXPR:
+#if 0
+ case MEMBER_REF:
+#endif
+ case EMPTY_CLASS_EXPR:
+ case TYPEID_EXPR:
+ case PSEUDO_DTOR_EXPR:
+ case AGGR_INIT_EXPR:
+ pp_cxx_postfix_expression (pp, t);
+ break;
+
+ case NEW_EXPR:
+ case VEC_NEW_EXPR:
+ pp_cxx_new_expression (pp, t);
+ break;
+
+ case DELETE_EXPR:
+ case VEC_DELETE_EXPR:
+ pp_cxx_delete_expression (pp, t);
+ break;
+
+ case CAST_EXPR:
+ pp_cxx_cast_expression (pp, t);
+ break;
+
+ case OFFSET_REF:
+ case MEMBER_REF:
+ case DOTSTAR_EXPR:
+ pp_cxx_pm_expression (pp, t);
+ break;
+
+ case MULT_EXPR:
+ case TRUNC_DIV_EXPR:
+ case TRUNC_MOD_EXPR:
+ pp_cxx_multiplicative_expression (pp, t);
+ break;
+
+ case COND_EXPR:
+ pp_cxx_conditional_expression (pp, t);
+ break;
+
+ case MODIFY_EXPR:
+ case INIT_EXPR:
+ case THROW_EXPR:
+ case MODOP_EXPR:
+ pp_cxx_assignment_expression (pp, t);
+ break;
+
+ default:
+ pp_c_expression (pp_c_base (pp), t);
+ break;
+ }
+}
+
+
+/* Declarations. */
+
+/* function-specifier:
+ inline
+ virtual
+ explicit */
+static void
+pp_cxx_function_specifier (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case FUNCTION_DECL:
+ if (DECL_VIRTUAL_P (t))
+ pp_cxx_identifier (pp, "virtual");
+ else if (DECL_CONSTRUCTOR_P (t) && DECL_NONCONVERTING_P (t))
+ pp_cxx_identifier (pp, "explicit");
+ else
+ pp_c_function_specifier (pp_c_base (pp), t);
+
+ default:
+ break;
+ }
+}
+
+/* decl-specifier-seq:
+ decl-specifier-seq(opt) decl-specifier
+
+ decl-specifier:
+ storage-class-specifier
+ type-specifier
+ function-specifier
+ friend
+ typedef */
+static void
+pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case CONST_DECL:
+ case FIELD_DECL:
+ pp_cxx_storage_class_specifier (pp, t);
+ pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t));
+ break;
+
+ case TYPE_DECL:
+ pp_cxx_identifier (pp, "typedef");
+ pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t));
+ break;
+
+ case RECORD_TYPE:
+ if (TYPE_PTRMEMFUNC_P (t))
+ {
+ tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t);
+ pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (pfm)));
+ pp_cxx_whitespace (pp);
+ pp_cxx_ptr_operator (pp, t);
+ }
+ break;
+
+ case FUNCTION_DECL:
+ /* Constructors don't have return types. And conversion functions
+ do not have a type-specifier in their return types. */
+ if (DECL_CONSTRUCTOR_P (t) || DECL_CONV_FN_P (t))
+ pp_cxx_function_specifier (pp, t);
+ else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
+ pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t)));
+ else
+ default:
+ pp_c_declaration_specifiers (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* simple-type-specifier:
+ ::(opt) nested-name-specifier(opt) type-name
+ ::(opt) nested-name-specifier(opt) template(opt) template-id
+ char
+ wchar_t
+ bool
+ short
+ int
+ long
+ signed
+ unsigned
+ float
+ double
+ void */
+static void
+pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case ENUMERAL_TYPE:
+ pp_cxx_qualified_id (pp, t);
+ break;
+
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_PARM_INDEX:
+ pp_cxx_unqualified_id (pp, t);
+ break;
+
+ case TYPENAME_TYPE:
+ pp_cxx_identifier (pp, "typename");
+ pp_cxx_nested_name_specifier (pp, TYPE_CONTEXT (t));
+ pp_cxx_unqualified_id (pp, TYPE_NAME (t));
+ break;
+
+ default:
+ pp_c_type_specifier (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* type-specifier-seq:
+ type-specifier type-specifier-seq(opt)
+
+ type-specifier:
+ simple-type-specifier
+ class-specifier
+ enum-specifier
+ elaborated-type-specifier
+ cv-qualifer */
+
+static void
+pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case TEMPLATE_DECL:
+ case TEMPLATE_TYPE_PARM:
+ case TYPE_DECL:
+ case BOUND_TEMPLATE_TEMPLATE_PARM:
+ pp_c_type_qualifier_list (pp_c_base (pp), t);
+ pp_cxx_simple_type_specifier (pp, t);
+ break;
+
+ case METHOD_TYPE:
+ pp_cxx_type_specifier_seq (pp, TREE_TYPE (t));
+ pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (t));
+ pp_cxx_nested_name_specifier (pp, TYPE_METHOD_BASETYPE (t));
+ break;
+
+ default:
+ if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t)))
+ pp_c_specifier_qualifier_list (pp_c_base (pp), t);
+ }
+}
+
+/* ptr-operator:
+ * cv-qualifier-seq(opt)
+ &
+ ::(opt) nested-name-specifier * cv-qualifier-seq(opt) */
+
+static void
+pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t)
+{
+ if (!TYPE_P (t) && TREE_CODE (t) != TYPE_DECL)
+ t = TREE_TYPE (t);
+ switch (TREE_CODE (t))
+ {
+ case REFERENCE_TYPE:
+ case POINTER_TYPE:
+ if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE
+ || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t)))
+ pp_cxx_ptr_operator (pp, TREE_TYPE (t));
+ if (TREE_CODE (t) == POINTER_TYPE)
+ {
+ pp_star (pp);
+ pp_cxx_cv_qualifier_seq (pp, t);
+ }
+ else
+ pp_ampersand (pp);
+ break;
+
+ case RECORD_TYPE:
+ if (TYPE_PTRMEMFUNC_P (t))
+ {
+ pp_cxx_left_paren (pp);
+ pp_cxx_nested_name_specifier (pp, TYPE_PTRMEMFUNC_OBJECT_TYPE (t));
+ pp_star (pp);
+ break;
+ }
+ case OFFSET_TYPE:
+ if (TYPE_PTR_TO_MEMBER_P (t))
+ {
+ pp_cxx_nested_name_specifier (pp, TYPE_PTRMEM_CLASS_TYPE (t));
+ pp_star (pp);
+ pp_cxx_cv_qualifier_seq (pp, t);
+ break;
+ }
+ /* else fall trhough. */
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
+ }
+}
+
+static inline tree
+pp_cxx_implicit_parameter_type (tree mf)
+{
+ return TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (mf))));
+}
+
+/*
+ parameter-declaration:
+ decl-specifier-seq declarator
+ decl-specifier-seq declarator = assignment-expression
+ decl-specifier-seq abstract-declarator(opt)
+ decl-specifier-seq abstract-declarator(opt) assignment-expression */
+static inline void
+pp_cxx_parameter_declaration (cxx_pretty_printer *pp, tree t)
+{
+ pp_cxx_decl_specifier_seq (pp, t);
+ if (TYPE_P (t))
+ pp_cxx_abstract_declarator (pp, t);
+ else
+ pp_cxx_declarator (pp, t);
+}
+
+/* parameter-declaration-clause:
+ parameter-declaration-list(opt) ...(opt)
+ parameter-declaration-list , ...
+
+ parameter-declaration-list:
+ parameter-declaration
+ parameter-declaration-list , parameter-declaration */
+static void
+pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t)
+{
+ tree args = TYPE_P (t) ? NULL : FUNCTION_FIRST_USER_PARM (t);
+ tree types = TYPE_P (t) ? TYPE_ARG_TYPES (t) : FUNCTION_FIRST_USER_PARMTYPE (t);
+ const bool abstract = args == NULL
+ || pp_c_base (pp)->flags & pp_c_flag_abstract;
+ bool first = true;
+
+ /* Skip artificial parameter for nonstatic member functions. */
+ if (TREE_CODE (t) == METHOD_TYPE)
+ types = TREE_CHAIN (types);
+
+ pp_cxx_left_paren (pp);
+ for (; args; args = TREE_CHAIN (args), types = TREE_CHAIN (types))
+ {
+ if (!first)
+ pp_separate_with (pp, ',');
+ first = false;
+ pp_cxx_parameter_declaration (pp, abstract ? TREE_VALUE (types) : args);
+ if (!abstract && pp_c_base (pp)->flags & pp_cxx_flag_default_argument)
+ {
+ pp_cxx_whitespace (pp);
+ pp_equal (pp);
+ pp_cxx_whitespace (pp);
+ pp_cxx_assignment_expression (pp, TREE_PURPOSE (types));
+ }
+ }
+ pp_cxx_right_paren (pp);
+}
+
+/* exception-specification:
+ throw ( type-id-list(opt) )
+
+ type-id-list
+ type-id
+ type-id-list , type-id */
+static void
+pp_cxx_exception_specification (cxx_pretty_printer *pp, tree t)
+{
+ tree ex_spec = TYPE_RAISES_EXCEPTIONS (t);
+
+ if (!TYPE_NOTHROW_P (t) && ex_spec == NULL)
+ return;
+ pp_cxx_identifier (pp, "throw");
+ pp_cxx_left_paren (pp);
+ for (; ex_spec && TREE_VALUE (ex_spec); ex_spec = TREE_CHAIN (ex_spec))
+ {
+ pp_cxx_type_id (pp, TREE_VALUE (ex_spec));
+ if (TREE_CHAIN (ex_spec))
+ pp_separate_with (pp, ',');
+ }
+ pp_cxx_right_paren (pp);
+}
+
+/* direct-declarator:
+ declarator-id
+ direct-declarator ( parameter-declaration-clause ) cv-qualifier-seq(opt)
+ exception-specification(opt)
+ direct-declaration [ constant-expression(opt) ]
+ ( declarator ) */
+static void
+pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case CONST_DECL:
+ case FIELD_DECL:
+ if (DECL_NAME (t))
+ {
+ pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (t));
+ pp_cxx_id_expression (pp, DECL_NAME (t));
+ }
+ pp_cxx_abstract_declarator (pp, TREE_TYPE (t));
+ break;
+
+ case FUNCTION_DECL:
+ pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t)));
+ pp_cxx_id_expression (pp, t);
+ pp_cxx_parameter_declaration_clause (pp, t);
+
+ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
+ {
+ pp_base (pp)->padding = pp_before;
+ pp_cxx_cv_qualifier_seq (pp, pp_cxx_implicit_parameter_type (t));
+ }
+
+ pp_cxx_exception_specification (pp, TREE_TYPE (t));
+ break;
+
+ case TYPENAME_TYPE:
+ case TEMPLATE_DECL:
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_PARM_INDEX:
+ break;
+
+ default:
+ pp_c_direct_declarator (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* declarator:
+ direct-declarator
+ ptr-operator declarator */
+static void
+pp_cxx_declarator (cxx_pretty_printer *pp, tree t)
+{
+ pp_cxx_direct_declarator (pp, t);
+}
+
+/* ctor-initializer:
+ : mem-initializer-list
+
+ mem-initializer-list:
+ mem-initializer
+ mem-initializer , mem-initializer-list
+
+ mem-initializer:
+ mem-initializer-id ( expression-list(opt) )
+
+ mem-initializer-id:
+ ::(opt) nested-name-specifier(opt) class-name
+ identifier */
+static void
+pp_cxx_ctor_initializer (cxx_pretty_printer *pp, tree t)
+{
+ t = TREE_OPERAND (t, 0);
+ pp_cxx_whitespace (pp);
+ pp_colon (pp);
+ pp_cxx_whitespace (pp);
+ for (; t; t = TREE_CHAIN (t))
+ {
+ pp_cxx_primary_expression (pp, TREE_PURPOSE (t));
+ pp_cxx_call_argument_list (pp, TREE_VALUE (t));
+ if (TREE_CHAIN (t))
+ pp_separate_with (pp, ',');
+ }
+}
+
+/* function-definition:
+ decl-specifier-seq(opt) declarator ctor-initializer(opt) function-body
+ decl-specifier-seq(opt) declarator function-try-block */
+
+void
+pp_cxx_function_definition (cxx_pretty_printer *pp, tree t)
+{
+ tree saved_scope = pp->enclosing_scope;
+ pp_cxx_decl_specifier_seq (pp, t);
+ pp_cxx_declarator (pp, t);
+ pp_needs_newline (pp) = true;
+ pp->enclosing_scope = DECL_CONTEXT (t);
+ if (DECL_SAVED_TREE (t))
+ {
+ tree body = DECL_SAVED_TREE (t);
+ if (TREE_CODE (body) == COMPOUND_STMT
+ && TREE_CODE (COMPOUND_BODY (body)) == CTOR_INITIALIZER)
+ {
+ body = COMPOUND_BODY (body);
+ pp_cxx_ctor_initializer (pp, body);
+ body = TREE_CHAIN (body);
+ }
+ pp_cxx_statement (pp, body);
+ }
+ else
+ {
+ pp_cxx_semicolon (pp);
+ pp_needs_newline (pp) = true;
+ }
+ pp_flush (pp);
+ pp->enclosing_scope = saved_scope;
+}
+
+/* abstract-declarator:
+ ptr-operator abstract-declarator(opt)
+ direct-abstract-declarator */
+static void
+pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t)
+{
+ if (TYPE_PTRMEM_P (t) || TYPE_PTRMEMFUNC_P (t))
+ pp_cxx_right_paren (pp);
+ else if (POINTER_TYPE_P (t))
+ {
+ if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE
+ || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
+ pp_cxx_right_paren (pp);
+ t = TREE_TYPE (t);
+ }
+ pp_cxx_direct_abstract_declarator (pp, t);
+}
+
+/* direct-abstract-declarator:
+ direct-abstract-declarator(opt) ( parameter-declaration-clause )
+ cv-quafilier-seq(opt) exception-specification(opt)
+ direct-abstract-declarator(opt) [ constant-expression(opt) ]
+ ( abstract-declarator ) */
+static void
+pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case REFERENCE_TYPE:
+ pp_cxx_abstract_declarator (pp, t);
+ break;
+
+ case RECORD_TYPE:
+ if (TYPE_PTRMEMFUNC_P (t))
+ pp_cxx_direct_abstract_declarator (pp, TYPE_PTRMEMFUNC_FN_TYPE (t));
+ break;
+
+ case METHOD_TYPE:
+ case FUNCTION_TYPE:
+ pp_cxx_parameter_declaration_clause (pp, t);
+ pp_cxx_direct_abstract_declarator (pp, TREE_TYPE (t));
+ if (TREE_CODE (t) == METHOD_TYPE)
+ {
+ pp_base (pp)->padding = pp_before;
+ pp_cxx_cv_qualifier_seq
+ (pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t))));
+ }
+ pp_cxx_exception_specification (pp, t);
+ break;
+
+ case TYPENAME_TYPE:
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_TEMPLATE_PARM:
+ case BOUND_TEMPLATE_TEMPLATE_PARM:
+ case UNBOUND_CLASS_TEMPLATE:
+ break;
+
+ default:
+ pp_c_direct_abstract_declarator (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* type-id:
+ type-specifier-seq abstract-declarator(opt) */
+static void
+pp_cxx_type_id (cxx_pretty_printer *pp, tree t)
+{
+ pp_flags saved_flags = pp_c_base (pp)->flags;
+ pp_c_base (pp)->flags |= pp_c_flag_abstract;
+
+ switch (TREE_CODE (t))
+ {
+ case TYPE_DECL:
+ case UNION_TYPE:
+ case RECORD_TYPE:
+ case ENUMERAL_TYPE:
+ case TYPENAME_TYPE:
+ case BOUND_TEMPLATE_TEMPLATE_PARM:
+ case UNBOUND_CLASS_TEMPLATE:
+ case TEMPLATE_TEMPLATE_PARM:
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_PARM_INDEX:
+ case TEMPLATE_DECL:
+ case TYPEOF_TYPE:
+ case TEMPLATE_ID_EXPR:
+ /* FIXME: Should be pp_cxx_type_specifier_seq. */
+ pp_cxx_type_specifier_seq (pp, t);
+ pp_cxx_declarator (pp, t);
+ break;
+
+ default:
+ pp_c_type_id (pp_c_base (pp), t);
+ break;
+ }
+
+ pp_c_base (pp)->flags = saved_flags;
+}
+
+/* template-argument-list:
+ template-argument
+ template-argument-list, template-argument
+
+ template-argument:
+ assignment-expression
+ type-id
+ template-name */
+static void
+pp_cxx_template_argument_list (cxx_pretty_printer *pp, tree t)
+{
+ int i;
+ if (t == NULL)
+ return;
+ for (i = 0; i < TREE_VEC_LENGTH (t); ++i)
+ {
+ tree arg = TREE_VEC_ELT (t, i);
+ if (i != 0)
+ pp_separate_with (pp, ',');
+ if (TYPE_P (arg) || (TREE_CODE (arg) == TEMPLATE_DECL
+ && TYPE_P (DECL_TEMPLATE_RESULT (arg))))
+ pp_cxx_type_id (pp, arg);
+ else
+ pp_cxx_expression (pp, arg);
+ }
+}
+
+
+static void
+pp_cxx_exception_declaration (cxx_pretty_printer *pp, tree t)
+{
+ t = DECL_STMT_DECL (t);
+ pp_cxx_type_specifier_seq (pp, t);
+ if (TYPE_P (t))
+ pp_cxx_abstract_declarator (pp, t);
+ else
+ pp_cxx_declarator (pp, t);
+}
+
+/* Statements. */
+
+void
+pp_cxx_statement (cxx_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case USING_STMT:
+ pp_cxx_identifier (pp, "using");
+ pp_cxx_identifier (pp, "namespace");
+ pp_cxx_qualified_id (pp, USING_STMT_NAMESPACE (t));
+ break;
+
+ case USING_DECL:
+ pp_cxx_identifier (pp, "using");
+ pp_cxx_nested_name_specifier (pp, DECL_INITIAL (t));
+ pp_cxx_unqualified_id (pp, DECL_NAME (t));
+ break;
+
+ case EH_SPEC_BLOCK:
+ break;
+
+ /* try-block:
+ try compound-statement handler-seq */
+ case TRY_BLOCK:
+ pp_maybe_newline_and_indent (pp, 0);
+ pp_cxx_identifier (pp, "try");
+ pp_newline_and_indent (pp, 3);
+ pp_cxx_statement (pp, TRY_STMTS (t));
+ pp_newline_and_indent (pp, -3);
+ if (CLEANUP_P (t))
+ ;
+ else
+ pp_cxx_statement (pp, TRY_HANDLERS (t));
+ break;
+
+ /*
+ handler-seq:
+ handler handler-seq(opt)
+
+ handler:
+ catch ( exception-declaration ) compound-statement
+
+ exception-declaration:
+ type-specifier-seq declarator
+ type-specifier-seq abstract-declarator
+ ... */
+ case HANDLER:
+ pp_cxx_identifier (pp, "catch");
+ pp_cxx_left_paren (pp);
+ pp_cxx_exception_declaration (pp, HANDLER_PARMS (t));
+ pp_cxx_right_paren (pp);
+ pp_indentation (pp) += 3;
+ pp_needs_newline (pp) = true;
+ pp_cxx_statement (pp, HANDLER_BODY (t));
+ pp_indentation (pp) -= 3;
+ pp_needs_newline (pp) = true;
+ break;
+
+ default:
+ pp_c_statement (pp_c_base (pp), t);
+ break;
+ }
+}
+
+/* original-namespace-definition:
+ namespace identifier { namespace-body }
+
+ As an edge case, we also handle unnamed namespace definition here. */
+
+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)
+ pp_cxx_unqualified_id (pp, t);
+ pp_cxx_whitespace (pp);
+ pp_cxx_left_brace (pp);
+ /* We do not print the namespace-body. */
+ pp_cxx_whitespace (pp);
+ pp_cxx_right_brace (pp);
+}
+
+/* namespace-alias:
+ identifier
+
+ namespace-alias-definition:
+ namespace identifier = qualified-namespace-specifier ;
+
+ qualified-namespace-specifier:
+ ::(opt) nested-name-specifier(opt) namespace-name */
+
+static void
+pp_cxx_namespace_alias_definition (cxx_pretty_printer *pp, tree t)
+{
+ pp_cxx_identifier (pp, "namespace");
+ pp_cxx_unqualified_id (pp, t);
+ pp_cxx_whitespace (pp);
+ pp_equal (pp);
+ pp_cxx_whitespace (pp);
+ pp_cxx_qualified_id (pp, DECL_NAMESPACE_ALIAS (t));
+ pp_cxx_semicolon (pp);
+}
+
+/* simple-declaration:
+ decl-specifier-seq(opt) init-declarator-list(opt) */
+static void
+pp_cxx_simple_declaration (cxx_pretty_printer *pp, tree t)
+{
+ pp_cxx_decl_specifier_seq (pp, t);
+ pp_cxx_init_declarator (pp, t);
+ pp_cxx_semicolon (pp);
+ pp_needs_newline (pp) = true;
+}
+
+/*
+ template-parameter-list:
+ template-parameter
+ template-parameter-list , template-parameter */
+
+static inline void
+pp_cxx_template_parameter_list (cxx_pretty_printer *pp, tree t)
+{
+ const int n = TREE_VEC_LENGTH (t);
+ int i;
+ for (i = 0; i < n; ++i)
+ {
+ if (i)
+ pp_separate_with (pp, ',');
+ pp_cxx_template_parameter (pp, TREE_VEC_ELT (t, i));
+ }
+}
+
+/* template-parameter:
+ type-parameter
+ parameter-declaration
+
+ type-parameter:
+ class identifier(opt)
+ class identifier(op) = type-id
+ typename identifier(opt)
+ typename identifier(opt) = type-id
+ template < template-parameter-list > class identifier(opt)
+ template < template-parameter-list > class identifier(opt) = template-name
+*/
+static void
+pp_cxx_template_parameter (cxx_pretty_printer *pp, tree t)
+{
+ tree parameter = TREE_VALUE (t);
+ switch (TREE_CODE (parameter))
+ {
+ case TYPE_DECL:
+ pp_cxx_identifier (pp, "class");
+ if (DECL_NAME (parameter))
+ pp_cxx_tree_identifier (pp, DECL_NAME (parameter));
+ /* FIXME: Chech if we should print also default argument. */
+ break;
+
+ case PARM_DECL:
+ pp_cxx_parameter_declaration (pp, parameter);
+ break;
+
+ case TEMPLATE_DECL:
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
+ }
+}
+
+/* Pretty-print a template parameter in the canonical form
+ "template-parameter-<level>-<position in parameter list>". */
+
+void
+pp_cxx_canonical_template_parameter (cxx_pretty_printer *pp, tree parm)
+{
+ const enum tree_code code = TREE_CODE (parm);
+
+ /* Brings type template parameters to the canonical forms */
+ if (code == TEMPLATE_TYPE_PARM || code == TEMPLATE_TEMPLATE_PARM
+ || code == BOUND_TEMPLATE_TEMPLATE_PARM)
+ parm = TEMPLATE_TYPE_PARM_INDEX (parm);
+
+ pp_cxx_begin_template_argument_list (pp);
+ pp_cxx_identifier (pp, "template-parameter-");
+ pp_wide_integer (pp, TEMPLATE_PARM_LEVEL (parm));
+ pp_minus (pp);
+ pp_wide_integer (pp, TEMPLATE_PARM_IDX (parm) + 1);
+ pp_cxx_end_template_argument_list (pp);
+}
+
+/*
+ template-declaration:
+ export(opt) template < template-parameter-list > declaration */
+static void
+pp_cxx_template_declaration (cxx_pretty_printer *pp, tree t)
+{
+ tree tmpl = most_general_template (t);
+ tree level;
+ int i = 0;
+
+ pp_maybe_newline_and_indent (pp, 0);
+ for (level = DECL_TEMPLATE_PARMS (tmpl); level; level = TREE_CHAIN (level))
+ {
+ pp_cxx_identifier (pp, "template");
+ pp_cxx_begin_template_argument_list (pp);
+ pp_cxx_template_parameter_list (pp, TREE_VALUE (level));
+ pp_cxx_end_template_argument_list (pp);
+ pp_newline_and_indent (pp, 3);
+ i += 3;
+ }
+ if (TREE_CODE (t) == FUNCTION_DECL && DECL_SAVED_TREE (t))
+ pp_cxx_function_definition (pp, t);
+ else
+ pp_cxx_simple_declaration (pp, t);
+}
+
+static void
+pp_cxx_explicit_specialization (cxx_pretty_printer *pp, tree t)
+{
+ pp_unsupported_tree (pp, t);
+}
+
+static void
+pp_cxx_explicit_instantiation (cxx_pretty_printer *pp, tree t)
+{
+ pp_unsupported_tree (pp, t);
+}
+
+/*
+ declaration:
+ block-declaration
+ function-definition
+ template-declaration
+ explicit-instantiation
+ explicit-specialization
+ linkage-specification
+ namespace-definition
+
+ block-declaration:
+ simple-declaration
+ asm-definition
+ namespace-alias-definition
+ using-declaration
+ using-directive */
+void
+pp_cxx_declaration (cxx_pretty_printer *pp, tree t)
+{
+ if (!DECL_LANG_SPECIFIC (t))
+ pp_cxx_simple_declaration (pp, t);
+ else if (DECL_USE_TEMPLATE (t))
+ switch (DECL_USE_TEMPLATE (t))
+ {
+ case 1:
+ pp_cxx_template_declaration (pp, t);
+ break;
+
+ case 2:
+ pp_cxx_explicit_specialization (pp, t);
+ break;
+
+ case 3:
+ pp_cxx_explicit_instantiation (pp, t);
+ break;
+
+ default:
+ break;
+ }
+ else switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ case TYPE_DECL:
+ pp_cxx_simple_declaration (pp, t);
+ break;
+
+ case FUNCTION_DECL:
+ if (DECL_SAVED_TREE (t))
+ pp_cxx_function_definition (pp, t);
+ else
+ pp_cxx_simple_declaration (pp, t);
+ break;
+
+ case NAMESPACE_DECL:
+ if (DECL_NAMESPACE_ALIAS (t))
+ pp_cxx_namespace_alias_definition (pp, t);
+ else
+ pp_cxx_original_namespace_definition (pp, t);
+ break;
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
+ }
+}
+
+
+typedef c_pretty_print_fn pp_fun;
+
+void
+pp_cxx_pretty_printer_init (cxx_pretty_printer *pp)
+{
+ pp_c_pretty_printer_init (pp_c_base (pp));
+ pp_set_line_maximum_length (pp, 0);
+
+ pp->c_base.declaration = (pp_fun) pp_cxx_declaration;
+ pp->c_base.declaration_specifiers = (pp_fun) pp_cxx_decl_specifier_seq;
+ pp->c_base.function_specifier = (pp_fun) pp_cxx_function_specifier;
+ pp->c_base.type_specifier_seq = (pp_fun) pp_cxx_type_specifier_seq;
+ pp->c_base.declarator = (pp_fun) pp_cxx_declarator;
+ pp->c_base.direct_declarator = (pp_fun) pp_cxx_direct_declarator;
+ pp->c_base.parameter_list = (pp_fun) pp_cxx_parameter_declaration_clause;
+ pp->c_base.type_id = (pp_fun) pp_cxx_type_id;
+ pp->c_base.abstract_declarator = (pp_fun) pp_cxx_abstract_declarator;
+ pp->c_base.direct_abstract_declarator =
+ (pp_fun) pp_cxx_direct_abstract_declarator;
+ pp->c_base.simple_type_specifier = (pp_fun)pp_cxx_simple_type_specifier;
+
+ /* pp->c_base.statement = (pp_fun) pp_cxx_statement; */
+
+ pp->c_base.id_expression = (pp_fun) pp_cxx_id_expression;
+ pp->c_base.primary_expression = (pp_fun) pp_cxx_primary_expression;
+ pp->c_base.postfix_expression = (pp_fun) pp_cxx_postfix_expression;
+ pp->c_base.unary_expression = (pp_fun) pp_cxx_unary_expression;
+ pp->c_base.multiplicative_expression = (pp_fun) pp_cxx_multiplicative_expression;
+ pp->c_base.conditional_expression = (pp_fun) pp_cxx_conditional_expression;
+ pp->c_base.assignment_expression = (pp_fun) pp_cxx_assignment_expression;
+ pp->c_base.expression = (pp_fun) pp_cxx_expression;
+ pp->enclosing_scope = global_namespace;
+}
diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
new file mode 100644
index 00000000000..d75c2827f95
--- /dev/null
+++ b/gcc/cp/cxx-pretty-print.h
@@ -0,0 +1,54 @@
+/* Interface for the GNU C++ pretty-printer.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#ifndef GCC_CXX_PRETTY_PRINT_H
+#define GCC_CXX_PRETTY_PRINT_H
+
+#include "c-pretty-print.h"
+
+#undef pp_c_base
+#define pp_c_base(PP) (&(PP)->c_base)
+
+typedef enum
+{
+ /* Ask for an qualified-id. */
+ pp_cxx_flag_qualified_id = 1 << pp_c_flag_last_bit,
+ pp_cxx_flag_global_scope = 1 << (pp_c_flag_last_bit + 1),
+ pp_cxx_flag_default_argument = 1 << (pp_c_flag_last_bit + 2)
+
+} cxx_pretty_printer_flags;
+
+typedef struct
+{
+ c_pretty_printer c_base;
+ /* This is the enclosing scope of the entity being pretty-printed. */
+ tree enclosing_scope;
+} cxx_pretty_printer;
+
+void pp_cxx_pretty_printer_init (cxx_pretty_printer *);
+
+void pp_cxx_declaration (cxx_pretty_printer *, tree);
+void pp_cxx_function_definition (cxx_pretty_printer *, tree);
+void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree);
+void pp_cxx_statement (cxx_pretty_printer *, tree);
+
+
+#endif /* GCC_CXX_PRETTY_PRINT_H */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4534a7622b9..892affacc82 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -68,7 +68,7 @@ static cxx_saved_binding *store_bindings (tree, cxx_saved_binding *);
static tree lookup_tag_reverse (tree, tree);
static void push_local_name (tree);
static void warn_extern_redeclared_static (tree, tree);
-static tree grok_reference_init (tree, tree, tree);
+static tree grok_reference_init (tree, tree, tree, tree *);
static tree grokfndecl (tree, tree, tree, tree, int,
enum overload_flags, tree,
tree, int, int, int, int, int, int, tree);
@@ -92,7 +92,6 @@ static void check_for_uninitialized_const_var (tree);
static hashval_t typename_hash (const void *);
static int typename_compare (const void *, const void *);
static void push_binding (tree, tree, struct cp_binding_level*);
-static int add_binding (tree, tree);
static void pop_binding (tree, tree);
static tree local_variable_p_walkfn (tree *, int *, void *);
static tree select_decl (cxx_binding *, int);
@@ -118,7 +117,7 @@ static void pop_labels (tree);
static void maybe_deduce_size_from_array_init (tree, tree);
static void layout_var_decl (tree);
static void maybe_commonize_var (tree);
-static tree check_initializer (tree, tree, int);
+static tree check_initializer (tree, tree, int, tree *);
static void make_rtl_for_nonlocal_decl (tree, tree, const char *);
static void save_function_data (tree);
static void check_function_type (tree, tree);
@@ -371,51 +370,31 @@ struct cp_binding_level GTY(())
TREE_LIST; the TREE_VALUE is the actual declaration. */
tree dead_vars_from_for;
- /* 1 for the level that holds the parameters of a function.
- 2 for the level that holds a class declaration. */
- unsigned parm_flag : 2;
+ /* Binding depth at which this level began. */
+ int binding_depth;
+
+ /* 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;
+
+ /* True if this scope is an SK_TEMPLATE_SPEC scope. This field is
+ only valid if KIND == SK_TEMPLATE_PARMS. */
+ bool explicit_spec_p : 1;
/* 1 means make a BLOCK for this level regardless of all else.
2 for temporary binding contours created by the compiler. */
unsigned keep : 2;
- /* Nonzero if this level "doesn't exist" for tags. */
- unsigned tag_transparent : 1;
-
/* Nonzero if this level can safely have additional
cleanup-needing variables added to it. */
unsigned more_cleanups_ok : 1;
unsigned have_cleanups : 1;
- /* Nonzero if this scope is for storing the decls for template
- parameters and generic decls; these decls will be discarded and
- replaced with a TEMPLATE_DECL. */
- unsigned template_parms_p : 1;
-
- /* Nonzero if this scope corresponds to the `<>' in a
- `template <>' clause. Whenever this flag is set,
- TEMPLATE_PARMS_P will be set as well. */
- unsigned template_spec_p : 1;
-
- /* This is set for a namespace binding level. */
- unsigned namespace_p : 1;
-
- /* True if this level is that of a for-statement where we need to
- worry about ambiguous (ARM or ISO) scope rules. */
- unsigned is_for_scope : 1;
-
- /* True if this level corresponds to a TRY block. Currently this
- information is only available while building the tree structure. */
- unsigned is_try_scope : 1;
-
- /* True if this level corresponds to a CATCH block. Currently this
- information is only available while building the tree structure. */
- unsigned is_catch_scope : 1;
-
- /* Three bits left for this word. */
+ /* Nonzero if this level "doesn't exist" for tags. */
+ unsigned tag_transparent : 1;
- /* Binding depth at which this level began. */
- unsigned binding_depth;
+ /* 20 bits left to fill a 32-bit word. */
};
#define NULL_BINDING_LEVEL ((struct cp_binding_level *) NULL)
@@ -469,28 +448,21 @@ static tree pushdecl_with_scope (tree, struct cp_binding_level *);
static const char *
cxx_scope_descriptor (cxx_scope *scope)
{
- const char *desc;
-
- if (scope->namespace_p)
- desc = "namespace-scope";
- else if (scope->parm_flag == 1)
- desc = "function-prototype-scope";
- else if (scope->parm_flag == 2)
- desc = "class-scope";
- else if (scope->is_for_scope)
- desc = "for-scope";
- else if (scope->is_try_scope)
- desc = "try-scope";
- else if (scope->is_catch_scope)
- desc = "catch-scope";
- else if (scope->template_spec_p)
- desc = "template-explicit-spec-scope";
- else if (scope->template_parms_p)
- desc = "template-prototype-scope";
- else
- desc = "block-scope";
+ /* The order of this table must match the "scope_kind"
+ enumerators. */
+ static const char* scope_kind_names[] = {
+ "block-scope",
+ "try-scope",
+ "catch-scope",
+ "for-scope",
+ "function-parameter-scope",
+ "class-scope",
+ "namespace-scope",
+ "template-parameter-scope",
+ "template-explicit-spec-scope"
+ };
- return desc;
+ return scope_kind_names[scope->kind];
}
/* Output a debugging information about SCOPE when performning
@@ -556,9 +528,9 @@ find_class_binding_level (void)
{
struct cp_binding_level *level = current_binding_level;
- while (level && level->parm_flag != 2)
+ while (level && level->kind != sk_class)
level = level->level_chain;
- if (level && level->parm_flag == 2)
+ if (level && level->kind == sk_class)
class_binding_level = level;
else
class_binding_level = 0;
@@ -587,7 +559,7 @@ pop_binding_level (void)
register struct cp_binding_level *level = current_binding_level;
current_binding_level = current_binding_level->level_chain;
level->level_chain = free_binding_level;
- if (level->parm_flag == 2)
+ if (level->kind == sk_class)
level->type_decls = NULL;
else
binding_table_free (level->type_decls);
@@ -660,7 +632,7 @@ innermost_nonclass_level (void)
struct cp_binding_level *b;
b = current_binding_level;
- while (b->parm_flag == 2)
+ while (b->kind == sk_class)
b = b->level_chain;
return b;
@@ -677,7 +649,7 @@ toplevel_bindings_p (void)
{
struct cp_binding_level *b = innermost_nonclass_level ();
- return b->namespace_p || b->template_parms_p;
+ return b->kind == sk_namespace || b->kind == sk_template_parms;
}
/* Nonzero if this is a namespace scope, or if we are defining a class
@@ -689,7 +661,7 @@ namespace_bindings_p (void)
{
struct cp_binding_level *b = innermost_nonclass_level ();
- return b->namespace_p;
+ return b->kind == sk_namespace;
}
/* If KEEP is nonzero, make a BLOCK node for the next binding level,
@@ -714,13 +686,21 @@ kept_level_p (void)
&& !current_binding_level->tag_transparent));
}
+/* Returns the kind of the innermost scope. */
+
+scope_kind
+innermost_scope_kind (void)
+{
+ return current_binding_level->kind;
+}
+
/* Returns nonzero if this scope was created to store template
parameters. */
int
template_parm_scope_p (void)
{
- return current_binding_level->template_parms_p;
+ return innermost_scope_kind () == sk_template_parms;
}
/* Returns the kind of template specialization we are currently
@@ -736,7 +716,9 @@ current_tmpl_spec_kind (int n_class_scopes)
struct cp_binding_level *b;
/* Scan through the template parameter scopes. */
- for (b = current_binding_level; b->template_parms_p; b = b->level_chain)
+ for (b = current_binding_level;
+ b->kind == sk_template_parms;
+ b = b->level_chain)
{
/* If we see a specialization scope inside a parameter scope,
then something is wrong. That corresponds to a declaration
@@ -747,7 +729,7 @@ current_tmpl_spec_kind (int n_class_scopes)
which is always invalid since [temp.expl.spec] forbids the
specialization of a class member template if the enclosing
class templates are not explicitly specialized as well. */
- if (b->template_spec_p)
+ if (b->explicit_spec_p)
{
if (n_template_parm_scopes == 0)
innermost_specialization_p = 1;
@@ -824,9 +806,6 @@ set_class_shadows (tree shadows)
void
pushlevel (int tag_transparent)
{
- if (cfun && !doing_semantic_analysis_p ())
- return;
-
push_binding_level (make_cxx_scope (tag_transparent, keep_next_level_flag));
keep_next_level_flag = 0;
}
@@ -855,35 +834,12 @@ void
begin_scope (scope_kind sk)
{
pushlevel (0);
-
- switch (sk)
+ if (sk == sk_template_spec)
{
- case sk_block:
- break;
-
- case sk_try:
- current_binding_level->is_try_scope = 1;
- break;
-
- case sk_catch:
- current_binding_level->is_catch_scope = 1;
- break;
-
- case sk_for:
- current_binding_level->is_for_scope = 1;
- break;
-
- case sk_template_spec:
- current_binding_level->template_spec_p = 1;
- /* Fall through. */
-
- case sk_template_parms:
- current_binding_level->template_parms_p = 1;
- break;
-
- default:
- abort ();
+ current_binding_level->explicit_spec_p = true;
+ sk = sk_template_parms;
}
+ current_binding_level->kind = sk;
}
/* Exit the current scope. */
@@ -912,85 +868,6 @@ push_binding (tree id, tree decl, cxx_scope* level)
IDENTIFIER_BINDING (id) = binding;
}
-/* ID is already bound in the current scope. But, DECL is an
- additional binding for ID in the same scope. This is the `struct
- stat' hack whereby a non-typedef class-name or enum-name can be
- bound at the same level as some other kind of entity. It's the
- responsibility of the caller to check that inserting this name is
- valid here. Returns nonzero if the new binding was successful. */
-static int
-add_binding (tree id, tree decl)
-{
- cxx_binding *binding = IDENTIFIER_BINDING (id);
- int ok = 1;
-
- timevar_push (TV_NAME_LOOKUP);
- if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl))
- /* The new name is the type name. */
- BINDING_TYPE (binding) = decl;
- else if (!BINDING_VALUE (binding))
- /* 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. */
- BINDING_VALUE (binding) = decl;
- else if (TREE_CODE (BINDING_VALUE (binding)) == TYPE_DECL
- && DECL_ARTIFICIAL (BINDING_VALUE (binding)))
- {
- /* The old binding was a type name. It was placed in
- BINDING_VALUE because it was thought, at the point it was
- declared, to be the only entity with such a name. Move the
- type name into the type slot; it is now hidden by the new
- binding. */
- BINDING_TYPE (binding) = BINDING_VALUE (binding);
- BINDING_VALUE (binding) = decl;
- INHERITED_VALUE_BINDING_P (binding) = 0;
- }
- else if (TREE_CODE (BINDING_VALUE (binding)) == TYPE_DECL
- && TREE_CODE (decl) == TYPE_DECL
- && DECL_NAME (decl) == DECL_NAME (BINDING_VALUE (binding))
- && (same_type_p (TREE_TYPE (decl),
- TREE_TYPE (BINDING_VALUE (binding)))
- /* If either type involves template parameters, we must
- wait until instantiation. */
- || uses_template_parms (TREE_TYPE (decl))
- || uses_template_parms (TREE_TYPE (BINDING_VALUE (binding)))))
- /* We have two typedef-names, both naming the same type to have
- the same name. This is OK because of:
-
- [dcl.typedef]
-
- In a given scope, a typedef specifier can be used to redefine
- the name of any type declared in that scope to refer to the
- type to which it already refers. */
- ok = 0;
- /* There can be two block-scope declarations of the same variable,
- so long as they are `extern' declarations. However, there cannot
- be two declarations of the same static data member:
-
- [class.mem]
-
- A member shall not be declared twice in the
- member-specification. */
- else if (TREE_CODE (decl) == VAR_DECL
- && TREE_CODE (BINDING_VALUE (binding)) == VAR_DECL
- && DECL_EXTERNAL (decl)
- && DECL_EXTERNAL (BINDING_VALUE (binding))
- && !DECL_CLASS_SCOPE_P (decl))
- {
- duplicate_decls (decl, BINDING_VALUE (binding));
- ok = 0;
- }
- else
- {
- error ("declaration of `%#D'", decl);
- cp_error_at ("conflicts with previous declaration `%#D'",
- BINDING_VALUE (binding));
- ok = 0;
- }
-
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ok);
-}
-
/* Add DECL to the list of things declared in B. */
static void
@@ -1017,7 +894,7 @@ add_decl_to_level (tree decl,
b->names_size++;
/* If appropriate, add decl to separate list of statics */
- if (b->namespace_p)
+ if (b->kind == sk_namespace)
if ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
|| (TREE_CODE (decl) == FUNCTION_DECL
&& (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl))))
@@ -1037,14 +914,12 @@ push_local_binding (tree id, tree decl, int flags)
/* Skip over any local classes. This makes sense if we call
push_local_binding with a friend decl of a local class. */
- b = current_binding_level;
- while (b->parm_flag == 2)
- b = b->level_chain;
+ b = innermost_nonclass_level ();
if (lookup_name_current_level (id))
{
/* Supplement the existing binding. */
- if (!add_binding (id, decl))
+ if (!supplement_binding (IDENTIFIER_BINDING (id), decl))
/* It didn't work. Something else must be bound at this
level. Do not add DECL to the list of things to pop
later. */
@@ -1083,7 +958,7 @@ push_class_binding (tree id, tree decl)
if (binding && BINDING_SCOPE (binding) == class_binding_level)
/* Supplement the existing binding. */
- result = add_binding (id, decl);
+ result = supplement_binding (IDENTIFIER_BINDING (id), decl);
else
/* Create a new binding. */
push_binding (id, decl, class_binding_level);
@@ -1171,7 +1046,7 @@ pop_binding (tree id, tree decl)
static void
pop_label (tree label, tree old_value)
{
- if (!processing_template_decl && doing_semantic_analysis_p ())
+ if (!processing_template_decl)
{
if (DECL_INITIAL (label) == NULL_TREE)
{
@@ -1243,11 +1118,8 @@ poplevel (int keep, int reverse, int functionbody)
int leaving_for_scope;
timevar_push (TV_NAME_LOOKUP);
- if (cfun && !doing_semantic_analysis_p ())
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
- my_friendly_assert (current_binding_level->parm_flag != 2,
- 19990916);
+ my_friendly_assert (current_binding_level->kind != sk_class, 19990916);
real_functionbody = (current_binding_level->keep == 2
? ((functionbody = 0), tmp) : functionbody);
@@ -1278,9 +1150,9 @@ poplevel (int keep, int reverse, int functionbody)
if (labels->binding_level == current_binding_level)
{
tree decl;
- if (current_binding_level->is_try_scope)
+ if (current_binding_level->kind == sk_try)
labels->in_try_scope = 1;
- if (current_binding_level->is_catch_scope)
+ if (current_binding_level->kind == sk_catch)
labels->in_catch_scope = 1;
for (decl = labels->names_in_scope; decl;
decl = TREE_CHAIN (decl))
@@ -1362,7 +1234,7 @@ poplevel (int keep, int reverse, int functionbody)
ended. We only use the new rules if flag_new_for_scope is
nonzero. */
leaving_for_scope
- = current_binding_level->is_for_scope && flag_new_for_scope == 1;
+ = current_binding_level->kind == sk_for && flag_new_for_scope == 1;
/* Remove declarations for all the DECLs in this level. */
for (link = decls; link; link = TREE_CHAIN (link))
@@ -1579,7 +1451,6 @@ set_block (tree block ATTRIBUTE_UNUSED )
{
/* The RTL expansion machinery requires us to provide this callback,
but it is not applicable in function-at-a-time mode. */
- my_friendly_assert (cfun && !doing_semantic_analysis_p (), 20000911);
}
/* Do a pushlevel for class declarations. */
@@ -1590,10 +1461,8 @@ pushlevel_class (void)
if (ENABLE_SCOPE_CHECKING)
is_class_level = 1;
- push_binding_level (make_cxx_scope (false, 0));
-
+ begin_scope (sk_class);
class_binding_level = current_binding_level;
- class_binding_level->parm_flag = 2;
class_binding_level->this_entity = current_class_type;
}
@@ -1626,7 +1495,7 @@ poplevel_class (void)
/* Find the next enclosing class, and recreate
IDENTIFIER_CLASS_VALUEs appropriate for that class. */
b = level->level_chain;
- while (b && b->parm_flag != 2)
+ while (b && b->kind != sk_class)
b = b->level_chain;
if (b)
@@ -2017,9 +1886,8 @@ initial_push_namespace_scope (tree ns)
tree name = DECL_NAME (ns);
cxx_scope *scope;
- pushlevel (0);
+ begin_scope (sk_namespace);
scope = current_binding_level;
- scope->namespace_p = true;
scope->type_decls = binding_table_new (name == std_identifier
? NAMESPACE_STD_HT_SIZE
: (name == global_scope_name
@@ -2220,7 +2088,7 @@ maybe_push_to_top_level (int pseudo)
int need_pop;
timevar_push (TV_NAME_LOOKUP);
- s = (struct saved_scope *) ggc_alloc_cleared (sizeof (struct saved_scope));
+ s = ggc_alloc_cleared (sizeof (struct saved_scope));
b = scope_chain ? current_binding_level : 0;
@@ -2247,13 +2115,13 @@ maybe_push_to_top_level (int pseudo)
inserted into namespace level, finish_file wouldn't find them
when doing pending instantiations. Therefore, don't stop at
namespace level, but continue until :: . */
- if (global_scope_p (b) || (pseudo && b->template_parms_p))
+ if (global_scope_p (b) || (pseudo && b->kind == sk_template_parms))
break;
old_bindings = store_bindings (b->names, old_bindings);
/* We also need to check class_shadowed to save class-level type
bindings, since pushclass doesn't fill in b->names. */
- if (b->parm_flag == 2)
+ if (b->kind == sk_class)
old_bindings = store_bindings (b->class_shadowed, old_bindings);
/* Unwind type-value slots back to top level. */
@@ -2313,37 +2181,39 @@ pop_from_top_level (void)
timevar_pop (TV_NAME_LOOKUP);
}
-/* Push a definition of struct, union or enum tag "name".
- into binding_level "b". "type" should be the type node,
- We assume that the tag "name" is not already defined.
-
- Note that the definition may really be just a forward reference.
- In that case, the TYPE_SIZE will be a NULL_TREE.
-
- C++ gratuitously puts all these tags in the name space. */
-
-/* When setting the IDENTIFIER_TYPE_VALUE field of an identifier ID,
- record the shadowed value for this binding contour. TYPE is
- the type that ID maps to. */
+/* Push a definition of struct, union or enum tag named ID. into
+ binding_level B. DECL is a TYPE_DECL for the type. We assume that
+ the tag ID is not already defined. */
static void
set_identifier_type_value_with_scope (tree id,
- tree type,
+ tree decl,
struct cp_binding_level* b)
{
- if (!b->namespace_p)
+ tree type;
+
+ if (b->kind != sk_namespace)
{
/* Shadow the marker, not the real thing, so that the marker
gets restored later. */
tree old_type_value = REAL_IDENTIFIER_TYPE_VALUE (id);
b->type_shadowed
= tree_cons (id, old_type_value, b->type_shadowed);
+ type = decl ? TREE_TYPE (decl) : NULL_TREE;
}
else
{
cxx_binding *binding =
- binding_for_name (NAMESPACE_LEVEL (current_namespace), id);
- BINDING_TYPE (binding) = type;
+ binding_for_name (NAMESPACE_LEVEL (current_namespace), id);
+ if (decl)
+ {
+ if (BINDING_VALUE (binding))
+ supplement_binding (binding, decl);
+ else
+ BINDING_VALUE (binding) = decl;
+ }
+ else
+ abort ();
/* Store marker instead of real type. */
type = global_type_node;
}
@@ -2353,9 +2223,9 @@ set_identifier_type_value_with_scope (tree id,
/* As set_identifier_type_value_with_scope, but using current_binding_level. */
void
-set_identifier_type_value (tree id, tree type)
+set_identifier_type_value (tree id, tree decl)
{
- set_identifier_type_value_with_scope (id, type, current_binding_level);
+ set_identifier_type_value_with_scope (id, decl, current_binding_level);
}
/* Return the type associated with id. */
@@ -2389,7 +2259,7 @@ pop_everything (void)
verbatim ("XXX entering pop_everything ()\n");
while (!toplevel_bindings_p ())
{
- if (current_binding_level->parm_flag == 2)
+ if (current_binding_level->kind == sk_class)
pop_nested_class ();
else
poplevel (0, 0, 0);
@@ -2445,8 +2315,8 @@ maybe_process_template_type_declaration (tree type,
friend case, push_template_decl will already have put the
friend into global scope, if appropriate. */
if (TREE_CODE (type) != ENUMERAL_TYPE
- && !globalize && b->template_parms_p
- && b->level_chain->parm_flag == 2)
+ && !globalize && b->kind == sk_template_parms
+ && b->level_chain->kind == sk_class)
{
finish_member_declaration (CLASSTYPE_TI_TEMPLATE (type));
/* Put this UDT in the table of UDTs for the class, since
@@ -2542,7 +2412,7 @@ pushtag (tree name, tree type, int globalize)
timevar_push (TV_NAME_LOOKUP);
b = current_binding_level;
while (b->tag_transparent
- || (b->parm_flag == 2
+ || (b->kind == sk_class
&& (globalize
/* We may be defining a new type in the initializer
of a static member variable. We allow this when
@@ -2579,8 +2449,9 @@ pushtag (tree name, tree type, int globalize)
if (!context)
context = current_namespace;
- if ((b->template_parms_p && b->level_chain->parm_flag == 2)
- || b->parm_flag == 2)
+ if (b->kind == sk_class
+ || (b->kind == sk_template_parms
+ && b->level_chain->kind == sk_class))
in_class = 1;
if (current_lang_name == lang_name_java)
@@ -2589,12 +2460,12 @@ pushtag (tree name, tree type, int globalize)
d = create_implicit_typedef (name, type);
DECL_CONTEXT (d) = FROB_CONTEXT (context);
if (! in_class)
- set_identifier_type_value_with_scope (name, type, b);
+ set_identifier_type_value_with_scope (name, d, b);
d = maybe_process_template_type_declaration (type,
globalize, b);
- if (b->parm_flag == 2)
+ if (b->kind == sk_class)
{
if (!PROCESSING_REAL_TEMPLATE_DECL_P ())
/* Put this TYPE_DECL on the TYPE_FIELDS list for the
@@ -2624,14 +2495,12 @@ pushtag (tree name, tree type, int globalize)
&& !processing_template_decl)
VARRAY_PUSH_TREE (local_classes, type);
}
- if (b->parm_flag == 2)
+ if (b->kind == sk_class
+ && !COMPLETE_TYPE_P (current_class_type))
{
- if (!COMPLETE_TYPE_P (current_class_type))
- {
- maybe_add_class_template_decl_list (current_class_type,
- type, /*friend_p=*/0);
- CLASSTYPE_NESTED_UTDS (current_class_type) = b->type_decls;
- }
+ maybe_add_class_template_decl_list (current_class_type,
+ type, /*friend_p=*/0);
+ CLASSTYPE_NESTED_UTDS (current_class_type) = b->type_decls;
}
}
@@ -2761,16 +2630,17 @@ decls_match (tree newdecl, tree olddecl)
}
else if (TREE_CODE (newdecl) == TEMPLATE_DECL)
{
- if (!comp_template_parms (DECL_TEMPLATE_PARMS (newdecl),
- DECL_TEMPLATE_PARMS (olddecl)))
- return 0;
-
if (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl))
!= TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)))
return 0;
+ if (!comp_template_parms (DECL_TEMPLATE_PARMS (newdecl),
+ DECL_TEMPLATE_PARMS (olddecl)))
+ return 0;
+
if (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL)
- types_match = 1;
+ types_match = same_type_p (TREE_TYPE (DECL_TEMPLATE_RESULT (olddecl)),
+ TREE_TYPE (DECL_TEMPLATE_RESULT (newdecl)));
else
types_match = decls_match (DECL_TEMPLATE_RESULT (olddecl),
DECL_TEMPLATE_RESULT (newdecl));
@@ -2813,7 +2683,8 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl)
if (TREE_CODE (newdecl) == TYPE_DECL
|| TREE_CODE (newdecl) == TEMPLATE_DECL
- || TREE_CODE (newdecl) == CONST_DECL)
+ || TREE_CODE (newdecl) == CONST_DECL
+ || TREE_CODE (newdecl) == NAMESPACE_DECL)
return;
/* Don't get confused by static member functions; that's a different
@@ -2884,19 +2755,18 @@ duplicate_decls (tree newdecl, tree olddecl)
&& DECL_UNINLINABLE (olddecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl)))
{
- warning ("%Hfunction '%D' redeclared as inline",
- &DECL_SOURCE_LOCATION (newdecl), newdecl);
- warning ("%Hprevious declaration of '%D' with attribute noinline",
- &DECL_SOURCE_LOCATION (olddecl), olddecl);
+ warning ("%Jfunction '%D' redeclared as inline", newdecl, newdecl);
+ warning ("%Jprevious declaration of '%D' with attribute noinline",
+ olddecl, olddecl);
}
else if (DECL_DECLARED_INLINE_P (olddecl)
&& DECL_UNINLINABLE (newdecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
{
- warning ("%Hfunction '%D' redeclared with attribute noinline",
- &DECL_SOURCE_LOCATION (newdecl), newdecl);
- warning ("%Hprevious declaration of '%D' was inline",
- &DECL_SOURCE_LOCATION (olddecl), olddecl);
+ warning ("%Jfunction '%D' redeclared with attribute noinline",
+ newdecl, newdecl);
+ warning ("%Jprevious declaration of '%D' was inline",
+ olddecl, olddecl);
}
}
@@ -2941,9 +2811,9 @@ duplicate_decls (tree newdecl, tree olddecl)
if (DECL_ANTICIPATED (olddecl))
; /* Do nothing yet. */
else if ((DECL_EXTERN_C_P (newdecl)
- && DECL_EXTERN_C_P (olddecl))
- || compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)),
- TYPE_ARG_TYPES (TREE_TYPE (olddecl))))
+ && DECL_EXTERN_C_P (olddecl))
+ || compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)),
+ TYPE_ARG_TYPES (TREE_TYPE (olddecl))))
{
/* A near match; override the builtin. */
@@ -2970,6 +2840,10 @@ duplicate_decls (tree newdecl, tree olddecl)
else if (DECL_ANTICIPATED (olddecl))
TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
+ /* Whether or not the builtin can throw exceptions has no
+ bearing on this declarator. */
+ TREE_NOTHROW (olddecl) = 0;
+
if (DECL_THIS_STATIC (newdecl) && !DECL_THIS_STATIC (olddecl))
{
/* If a builtin function is redeclared as `static', merge
@@ -3077,8 +2951,10 @@ duplicate_decls (tree newdecl, tree olddecl)
else if (current_class_type == NULL_TREE
|| IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type)
{
- error ("conflicting types for `%#D'", newdecl);
- cp_error_at ("previous declaration as `%#D'", olddecl);
+ error ("conflicting declaration '%#D'", newdecl);
+ cp_error_at ("'%D' has a previous declaration as `%#D'",
+ olddecl, olddecl);
+ return false;
}
}
else if (TREE_CODE (newdecl) == FUNCTION_DECL
@@ -3132,8 +3008,7 @@ duplicate_decls (tree newdecl, tree olddecl)
{
/* Prototype decl follows defn w/o prototype. */
cp_warning_at ("prototype for `%#D'", newdecl);
- warning ("%Hfollows non-prototype definition here",
- &DECL_SOURCE_LOCATION (olddecl));
+ warning ("%Jfollows non-prototype definition here", olddecl);
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl))
@@ -3188,10 +3063,8 @@ duplicate_decls (tree newdecl, tree olddecl)
&& ! DECL_DECLARED_INLINE_P (olddecl)
&& TREE_ADDRESSABLE (olddecl) && warn_inline)
{
- warning ("`%#D' was used before it was declared inline",
- newdecl);
- warning ("%Hprevious non-inline declaration here",
- &DECL_SOURCE_LOCATION (olddecl));
+ warning ("`%#D' was used before it was declared inline", newdecl);
+ warning ("%Jprevious non-inline declaration here", olddecl);
}
}
}
@@ -3306,6 +3179,8 @@ duplicate_decls (tree newdecl, tree olddecl)
{
DECL_THIS_EXTERN (newdecl) |= DECL_THIS_EXTERN (olddecl);
DECL_INITIALIZED_P (newdecl) |= DECL_INITIALIZED_P (olddecl);
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (newdecl)
+ |= DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (olddecl);
}
/* Do this after calling `merge_types' so that default
@@ -3558,36 +3433,30 @@ duplicate_decls (tree newdecl, tree olddecl)
function_size - sizeof (struct tree_common));
if (DECL_TEMPLATE_INSTANTIATION (newdecl))
- {
- /* If newdecl is a template instantiation, it is possible that
- the following sequence of events has occurred:
+ /* If newdecl is a template instantiation, it is possible that
+ the following sequence of events has occurred:
- o A friend function was declared in a class template. The
- class template was instantiated.
+ o A friend function was declared in a class template. The
+ class template was instantiated.
- o The instantiation of the friend declaration was
- recorded on the instantiation list, and is newdecl.
+ o The instantiation of the friend declaration was
+ recorded on the instantiation list, and is newdecl.
- o Later, however, instantiate_class_template called pushdecl
- on the newdecl to perform name injection. But, pushdecl in
- turn called duplicate_decls when it discovered that another
- declaration of a global function with the same name already
- existed.
+ o Later, however, instantiate_class_template called pushdecl
+ on the newdecl to perform name injection. But, pushdecl in
+ turn called duplicate_decls when it discovered that another
+ declaration of a global function with the same name already
+ existed.
- o Here, in duplicate_decls, we decided to clobber newdecl.
+ o Here, in duplicate_decls, we decided to clobber newdecl.
- If we're going to do that, we'd better make sure that
- olddecl, and not newdecl, is on the list of
- instantiations so that if we try to do the instantiation
- again we won't get the clobbered declaration. */
-
- tree tmpl = DECL_TI_TEMPLATE (newdecl);
- tree decls = DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
-
- for (; decls; decls = TREE_CHAIN (decls))
- if (TREE_VALUE (decls) == newdecl)
- TREE_VALUE (decls) = olddecl;
- }
+ If we're going to do that, we'd better make sure that
+ olddecl, and not newdecl, is on the list of
+ instantiations so that if we try to do the instantiation
+ again we won't get the clobbered declaration. */
+ reregister_specialization (newdecl,
+ DECL_TI_TEMPLATE (newdecl),
+ olddecl);
}
else
{
@@ -3633,10 +3502,6 @@ pushdecl (tree x)
int need_new_binding;
timevar_push (TV_NAME_LOOKUP);
- /* We shouldn't be calling pushdecl when we're generating RTL for a
- function that we already did semantic analysis on previously. */
- my_friendly_assert (!cfun || doing_semantic_analysis_p (),
- 19990913);
need_new_binding = 1;
@@ -3858,9 +3723,7 @@ pushdecl (tree x)
if (type != error_mark_node
&& TYPE_NAME (type)
&& TYPE_IDENTIFIER (type))
- set_identifier_type_value_with_scope (DECL_NAME (x), type,
- current_binding_level);
-
+ set_identifier_type_value (DECL_NAME (x), x);
}
/* Multiple external decls of the same identifier ought to match.
@@ -3950,15 +3813,13 @@ pushdecl (tree x)
/* If this is a TYPE_DECL, push it into the type value slot. */
if (TREE_CODE (x) == TYPE_DECL)
- set_identifier_type_value_with_scope (name, TREE_TYPE (x),
- current_binding_level);
+ set_identifier_type_value (name, x);
/* Clear out any TYPE_DECL shadowed by a namespace so that
we won't think this is a type. The C struct hack doesn't
go through namespaces. */
if (TREE_CODE (x) == NAMESPACE_DECL)
- set_identifier_type_value_with_scope (name, NULL_TREE,
- current_binding_level);
+ set_identifier_type_value (name, NULL_TREE);
if (oldlocal)
{
@@ -4021,10 +3882,10 @@ pushdecl (tree x)
b = b->level_chain;
/* ARM $8.3 */
- if (b->parm_flag == 1)
+ if (b->kind == sk_function_parms)
{
error ("declaration of `%#D' shadows a parameter",
- name);
+ name);
err = true;
}
}
@@ -4085,7 +3946,7 @@ pushdecl_with_scope (tree x, struct cp_binding_level* level)
timevar_push (TV_NAME_LOOKUP);
current_function_decl = NULL_TREE;
- if (level->parm_flag == 2)
+ if (level->kind == sk_class)
{
b = class_binding_level;
class_binding_level = level;
@@ -4139,7 +4000,7 @@ pushdecl_namespace_level (tree x)
{
/* @@ This shouldn't be needed. My test case "zstring.cc" trips
up here if this is changed to an assertion. --KR */
- SET_IDENTIFIER_TYPE_VALUE (name, newval);
+ SET_IDENTIFIER_TYPE_VALUE (name, x);
}
else
{
@@ -4202,7 +4063,7 @@ pushdecl_class_level (tree x)
{
is_valid = push_class_level_binding (name, x);
if (TREE_CODE (x) == TYPE_DECL)
- set_identifier_type_value (name, TREE_TYPE (x));
+ set_identifier_type_value (name, x);
}
else if (ANON_AGGR_TYPE_P (TREE_TYPE (x)))
{
@@ -4213,10 +4074,11 @@ pushdecl_class_level (tree x)
for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = TREE_CHAIN (f))
{
- push_srcloc (DECL_SOURCE_FILE (f), DECL_SOURCE_LINE (f));
+ location_t save_location = input_location;
+ input_location = DECL_SOURCE_LOCATION (f);
if (!pushdecl_class_level (f))
is_valid = false;
- pop_srcloc ();
+ input_location = save_location;
}
}
timevar_pop (TV_NAME_LOOKUP);
@@ -4276,47 +4138,56 @@ push_class_level_binding (tree name, tree x)
class, then we will need to restore IDENTIFIER_CLASS_VALUE when
we leave this class. Record the shadowed declaration here. */
binding = IDENTIFIER_BINDING (name);
- if (binding
- && ((TREE_CODE (x) == OVERLOAD
- && BINDING_VALUE (binding)
- && is_overloaded_fn (BINDING_VALUE (binding)))
- || INHERITED_VALUE_BINDING_P (binding)))
+ if (binding && BINDING_VALUE (binding))
{
- tree shadow;
- tree old_decl;
+ tree bval = BINDING_VALUE (binding);
+ tree old_decl = NULL_TREE;
- /* If the old binding was from a base class, and was for a tag
- name, slide it over to make room for the new binding. The
- old binding is still visible if explicitly qualified with a
- class-key. */
- if (INHERITED_VALUE_BINDING_P (binding)
- && BINDING_VALUE (binding)
- && TREE_CODE (BINDING_VALUE (binding)) == TYPE_DECL
- && DECL_ARTIFICIAL (BINDING_VALUE (binding))
- && !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)))
- {
- old_decl = BINDING_TYPE (binding);
- BINDING_TYPE (binding) = BINDING_VALUE (binding);
- BINDING_VALUE (binding) = NULL_TREE;
- INHERITED_VALUE_BINDING_P (binding) = 0;
+ if (INHERITED_VALUE_BINDING_P (binding))
+ {
+ /* If the old binding was from a base class, and was for a
+ tag name, slide it over to make room for the new binding.
+ The old binding is still visible if explicitly qualified
+ with a class-key. */
+ if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)
+ && !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)))
+ {
+ old_decl = BINDING_TYPE (binding);
+ BINDING_TYPE (binding) = bval;
+ BINDING_VALUE (binding) = NULL_TREE;
+ INHERITED_VALUE_BINDING_P (binding) = 0;
+ }
+ else
+ old_decl = bval;
+ }
+ else if (TREE_CODE (x) == OVERLOAD && is_overloaded_fn (bval))
+ old_decl = bval;
+ else if (TREE_CODE (x) == USING_DECL && TREE_CODE (bval) == USING_DECL)
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
+ else if (TREE_CODE (x) == USING_DECL && is_overloaded_fn (bval))
+ old_decl = bval;
+ else if (TREE_CODE (bval) == USING_DECL && is_overloaded_fn (x))
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
+
+ if (old_decl)
+ {
+ tree shadow;
+
+ /* Find the previous binding of name on the class-shadowed
+ list, and update it. */
+ for (shadow = class_binding_level->class_shadowed;
+ shadow;
+ shadow = TREE_CHAIN (shadow))
+ if (TREE_PURPOSE (shadow) == name
+ && TREE_TYPE (shadow) == old_decl)
+ {
+ BINDING_VALUE (binding) = x;
+ INHERITED_VALUE_BINDING_P (binding) = 0;
+ TREE_TYPE (shadow) = x;
+ IDENTIFIER_CLASS_VALUE (name) = x;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
+ }
}
- else
- old_decl = BINDING_VALUE (binding);
-
- /* Find the previous binding of name on the class-shadowed
- list, and update it. */
- for (shadow = class_binding_level->class_shadowed;
- shadow;
- shadow = TREE_CHAIN (shadow))
- if (TREE_PURPOSE (shadow) == name
- && TREE_TYPE (shadow) == old_decl)
- {
- BINDING_VALUE (binding) = x;
- INHERITED_VALUE_BINDING_P (binding) = 0;
- TREE_TYPE (shadow) = x;
- IDENTIFIER_CLASS_VALUE (name) = x;
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
- }
}
/* If we didn't replace an existing binding, put the binding on the
@@ -4642,9 +4513,6 @@ make_label_decl (tree id, int local_p)
tree decl;
decl = build_decl (LABEL_DECL, id, void_type_node);
- if (expanding_p)
- /* Make sure every label has an rtx. */
- label_rtx (decl);
DECL_CONTEXT (decl) = current_function_decl;
DECL_MODE (decl) = VOIDmode;
@@ -4673,8 +4541,7 @@ use_label (tree decl)
|| named_label_uses->label_decl != decl)
{
struct named_label_use_list *new_ent;
- new_ent = ((struct named_label_use_list *)
- ggc_alloc (sizeof (struct named_label_use_list)));
+ new_ent = ggc_alloc (sizeof (struct named_label_use_list));
new_ent->label_decl = decl;
new_ent->names_in_scope = current_binding_level->names;
new_ent->binding_level = current_binding_level;
@@ -4711,8 +4578,7 @@ lookup_label (tree id)
/* Record this label on the list of labels used in this function.
We do this before calling make_label_decl so that we get the
IDENTIFIER_LABEL_VALUE before the new label is declared. */
- ent = ((struct named_label_list *)
- ggc_alloc_cleared (sizeof (struct named_label_list)));
+ ent = ggc_alloc_cleared (sizeof (struct named_label_list));
ent->old_value = IDENTIFIER_LABEL_VALUE (id);
ent->next = named_labels;
named_labels = ent;
@@ -4815,7 +4681,7 @@ check_previous_goto_1 (tree decl,
if (b == level)
break;
- if ((b->is_try_scope || b->is_catch_scope) && ! saw_eh)
+ if ((b->kind == sk_try || b->kind == sk_catch) && ! saw_eh)
{
if (! identified)
{
@@ -4828,7 +4694,7 @@ check_previous_goto_1 (tree decl,
pedwarn ("%H from here", locus);
identified = 1;
}
- if (b->is_try_scope)
+ if (b->kind == sk_try)
error (" enters try block");
else
error (" enters catch block");
@@ -4920,7 +4786,7 @@ check_goto (tree decl)
if (u > 1 && DECL_ARTIFICIAL (b))
/* Can't skip init of __exception_info. */
- error ("%H enters catch block", &DECL_SOURCE_LOCATION (b));
+ error ("%J enters catch block", b);
else if (u > 1)
cp_error_at (" skips initialization of `%#D'", b);
else
@@ -4934,8 +4800,7 @@ check_goto (tree decl)
}
/* Define a label, specifying the location in the source file.
- Return the LABEL_DECL node for the label, if the definition is valid.
- Otherwise return 0. */
+ Return the LABEL_DECL node for the label. */
tree
define_label (location_t location, tree name)
@@ -4951,17 +4816,16 @@ define_label (location_t location, tree name)
/* After labels, make any new cleanups in the function go into their
own new (temporary) binding contour. */
- for (p = current_binding_level; !(p->parm_flag); p = p->level_chain)
+ for (p = current_binding_level;
+ p->kind != sk_function_parms;
+ p = p->level_chain)
p->more_cleanups_ok = 0;
if (name == get_identifier ("wchar_t"))
pedwarn ("label named wchar_t");
if (DECL_INITIAL (decl) != NULL_TREE)
- {
- error ("duplicate label `%D'", decl);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
- }
+ error ("duplicate label `%D'", decl);
else
{
/* Mark label as having been defined. */
@@ -4974,9 +4838,10 @@ define_label (location_t location, tree name)
ent->binding_level = current_binding_level;
}
check_previous_gotos (decl);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
+
timevar_pop (TV_NAME_LOOKUP);
+ return decl;
}
struct cp_switch
@@ -5007,8 +4872,7 @@ static struct cp_switch *switch_stack;
void
push_switch (tree switch_stmt)
{
- struct cp_switch *p
- = (struct cp_switch *) xmalloc (sizeof (struct cp_switch));
+ struct cp_switch *p = xmalloc (sizeof (struct cp_switch));
p->level = current_binding_level;
p->next = switch_stack;
p->switch_stmt = switch_stmt;
@@ -5069,7 +4933,9 @@ finish_case_label (tree low_value, tree high_value)
/* After labels, make any new cleanups in the function go into their
own new (temporary) binding contour. */
- for (p = current_binding_level; !(p->parm_flag); p = p->level_chain)
+ for (p = current_binding_level;
+ p->kind != sk_function_parms;
+ p = p->level_chain)
p->more_cleanups_ok = 0;
return r;
@@ -5178,7 +5044,7 @@ lookup_tag (enum tree_code form, tree name,
if (type != NULL)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, type);
}
- else if (level->namespace_p)
+ else if (level->kind == sk_namespace)
/* Do namespace lookup. */
for (tail = current_namespace; 1; tail = CP_DECL_CONTEXT (tail))
{
@@ -5193,9 +5059,9 @@ lookup_tag (enum tree_code form, tree name,
if (thislevel_only && !allow_template_parms_p
&& binding && BINDING_VALUE (binding)
&& DECL_CLASS_TEMPLATE_P (BINDING_VALUE (binding)))
- old = TREE_TYPE (BINDING_VALUE (binding));
+ old = BINDING_VALUE (binding);
else if (binding)
- old = BINDING_TYPE (binding);
+ old = select_decl (binding, LOOKUP_PREFER_TYPES);
else
old = NULL_TREE;
@@ -5204,6 +5070,7 @@ lookup_tag (enum tree_code form, tree name,
/* We've found something at this binding level. If it is
a typedef, extract the tag it refers to. Lookup fails
if the typedef doesn't refer to a taggable type. */
+ old = TREE_TYPE (old);
old = follow_tag_typedef (old);
if (!old)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
@@ -5238,7 +5105,7 @@ lookup_tag (enum tree_code form, tree name,
}
if (thislevel_only && ! level->tag_transparent)
{
- if (level->template_parms_p && allow_template_parms_p)
+ if (level->kind == sk_template_parms && allow_template_parms_p)
{
/* We must deal with cases like this:
@@ -5493,9 +5360,8 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
error ("`%D' used without template parameters", name);
return error_mark_node;
}
- if (TREE_CODE (name) != IDENTIFIER_NODE)
- abort ();
-
+ my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802);
+
if (TREE_CODE (context) == NAMESPACE_DECL)
{
/* We can get here from typename_sub0 in the explicit_template_type
@@ -5529,7 +5395,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
TREE_OPERAND (fullname, 1),
NULL_TREE, context,
/*entering_scope=*/0,
- tf_error | tf_warning);
+ tf_error | tf_warning | tf_user);
}
else
{
@@ -5647,12 +5513,11 @@ select_decl (cxx_binding *binding, int flags)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
}
- /* If we could have a type and
- we have nothing or we need a type and have none. */
- if (BINDING_TYPE (binding)
- && (!val || ((flags & LOOKUP_PREFER_TYPES)
- && TREE_CODE (val) != TYPE_DECL)))
- val = TYPE_STUB_DECL (BINDING_TYPE (binding));
+ /* If looking for a type, or if there is no non-type binding, select
+ the value binding. */
+ if (BINDING_TYPE (binding)
+ && (!val || (flags & LOOKUP_PREFER_TYPES)))
+ val = BINDING_TYPE (binding);
/* Don't return non-types if we really prefer types. */
else if (val && LOOKUP_TYPES_ONLY (flags) && TREE_CODE (val) != TYPE_DECL
&& (TREE_CODE (val) != TEMPLATE_DECL
@@ -5703,7 +5568,7 @@ unqualified_namespace_lookup (tree name, int flags, tree* spacesp)
/* Add all _DECLs seen through local using-directives. */
for (level = current_binding_level;
- !level->namespace_p;
+ level->kind != sk_namespace;
level = level->level_chain)
if (!lookup_using_namespace (name, &binding, level->using_directives,
scope, flags, spacesp))
@@ -5755,7 +5620,8 @@ qualify_lookup (tree val, int flags)
return val;
if ((flags & LOOKUP_PREFER_NAMESPACES) && TREE_CODE (val) == NAMESPACE_DECL)
return val;
- if ((flags & LOOKUP_PREFER_TYPES) && TREE_CODE (val) == TYPE_DECL)
+ if ((flags & LOOKUP_PREFER_TYPES)
+ && (TREE_CODE (val) == TYPE_DECL || TREE_CODE (val) == TEMPLATE_DECL))
return val;
if (flags & (LOOKUP_PREFER_NAMESPACES | LOOKUP_PREFER_TYPES))
return NULL_TREE;
@@ -5767,10 +5633,12 @@ qualify_lookup (tree val, int flags)
bindings.
Returns a DECL (or OVERLOAD, or BASELINK) representing the
- declaration found. */
+ declaration found. If no suitable declaration can be found,
+ ERROR_MARK_NODE is returned. Iif COMPLAIN is true and SCOPE is
+ neither a class-type nor a namespace a diagnostic is issued. */
tree
-lookup_qualified_name (tree scope, tree name, bool is_type_p)
+lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain)
{
int flags = 0;
@@ -5782,15 +5650,19 @@ lookup_qualified_name (tree scope, tree name, bool is_type_p)
flags |= LOOKUP_COMPLAIN;
if (is_type_p)
flags |= LOOKUP_PREFER_TYPES;
- if (!qualified_lookup_using_namespace (name, scope, &binding,
- flags))
- return NULL_TREE;
- return select_decl (&binding, flags);
+ if (qualified_lookup_using_namespace (name, scope, &binding,
+ flags))
+ return select_decl (&binding, flags);
}
- else if (is_aggr_type (scope, /*or_else=*/1))
- return lookup_member (scope, name, 0, is_type_p);
- else
- return error_mark_node;
+ else if (is_aggr_type (scope, complain))
+ {
+ tree t;
+ t = lookup_member (scope, name, 0, is_type_p);
+ if (t)
+ return t;
+ }
+
+ return error_mark_node;
}
/* Check to see whether or not DECL is a variable that would have been
@@ -5881,7 +5753,7 @@ lookup_name_real (tree name, int prefer_type, int nonclass,
struct cp_binding_level *level;
for (level = current_binding_level;
- level && !level->namespace_p;
+ level && level->kind != sk_namespace;
level = level->level_chain)
{
tree class_type;
@@ -5889,7 +5761,7 @@ lookup_name_real (tree name, int prefer_type, int nonclass,
/* A conversion operator can only be declared in a class
scope. */
- if (level->parm_flag != 2)
+ if (level->kind != sk_class)
continue;
/* Lookup the conversion operator in the class. */
@@ -5979,11 +5851,9 @@ lookup_name_current_level (tree name)
tree t = NULL_TREE;
timevar_push (TV_NAME_LOOKUP);
- b = current_binding_level;
- while (b->parm_flag == 2)
- b = b->level_chain;
+ b = innermost_nonclass_level ();
- if (b->namespace_p)
+ if (b->kind == sk_namespace)
{
t = IDENTIFIER_NAMESPACE_VALUE (name);
@@ -6017,7 +5887,8 @@ lookup_type_current_level (tree name)
register tree t = NULL_TREE;
timevar_push (TV_NAME_LOOKUP);
- my_friendly_assert (! current_binding_level->namespace_p, 980716);
+ my_friendly_assert (current_binding_level->kind != sk_namespace,
+ 980716);
if (REAL_IDENTIFIER_TYPE_VALUE (name) != NULL_TREE
&& REAL_IDENTIFIER_TYPE_VALUE (name) != global_type_node)
@@ -6039,10 +5910,23 @@ lookup_type_current_level (tree name)
}
+
+/* A chain of TYPE_DECLs for the builtin types. */
+
+static GTY(()) tree builtin_type_decls;
+
+/* Return a chain of TYPE_DECLs for the builtin types. */
+
+tree
+cxx_builtin_type_decls ()
+{
+ return builtin_type_decls;
+}
+
/* Push the declarations of builtin types into the namespace.
- RID_INDEX is the index of the builtin type
- in the array RID_POINTERS. NAME is the name used when looking
- up the builtin type. TYPE is the _TYPE node for the builtin type. */
+ RID_INDEX is the index of the builtin type in the array
+ RID_POINTERS. NAME is the name used when looking up the builtin
+ type. TYPE is the _TYPE node for the builtin type. */
void
record_builtin_type (enum rid rid_index,
@@ -6057,26 +5941,34 @@ record_builtin_type (enum rid rid_index,
if (name)
tname = get_identifier (name);
+ /* The calls to SET_IDENTIFIER_GLOBAL_VALUE below should be
+ eliminated. Built-in types should not be looked up name; their
+ names are keywords that the parser can recognize. However, there
+ is code in c-common.c that uses identifier_global_value to look
+ up built-in types by name. */
if (tname)
{
- tdecl = pushdecl (build_decl (TYPE_DECL, tname, type));
- set_identifier_type_value (tname, NULL_TREE);
- if ((int) rid_index < (int) RID_MAX)
- /* Built-in types live in the global namespace. */
- SET_IDENTIFIER_GLOBAL_VALUE (tname, tdecl);
+ tdecl = build_decl (TYPE_DECL, tname, type);
+ DECL_ARTIFICIAL (tdecl) = 1;
+ SET_IDENTIFIER_GLOBAL_VALUE (tname, tdecl);
}
- if (rname != NULL_TREE)
+ if (rname)
{
- if (tname != NULL_TREE)
+ if (!tdecl)
{
- set_identifier_type_value (rname, NULL_TREE);
- SET_IDENTIFIER_GLOBAL_VALUE (rname, tdecl);
- }
- else
- {
- tdecl = pushdecl (build_decl (TYPE_DECL, rname, type));
- set_identifier_type_value (rname, NULL_TREE);
+ tdecl = build_decl (TYPE_DECL, rname, type);
+ DECL_ARTIFICIAL (tdecl) = 1;
}
+ SET_IDENTIFIER_GLOBAL_VALUE (rname, tdecl);
+ }
+
+ if (!TYPE_NAME (type))
+ TYPE_NAME (type) = tdecl;
+
+ if (tdecl)
+ {
+ TREE_CHAIN (tdecl) = builtin_type_decls;
+ builtin_type_decls = tdecl;
}
}
@@ -6213,7 +6105,7 @@ cxx_init_decl_processing (void)
current_lang_name = NULL_TREE;
/* Adjust various flags based on command-line settings. */
- if (! flag_permissive && ! pedantic)
+ if (!flag_permissive)
flag_pedantic_errors = 1;
if (!flag_no_inline)
{
@@ -6261,16 +6153,10 @@ cxx_init_decl_processing (void)
integer_three_node = build_int_2 (3, 0);
TREE_TYPE (integer_three_node) = integer_type_node;
- boolean_type_node = make_unsigned_type (BOOL_TYPE_SIZE);
- TREE_SET_CODE (boolean_type_node, BOOLEAN_TYPE);
- TYPE_MAX_VALUE (boolean_type_node) = build_int_2 (1, 0);
- TREE_TYPE (TYPE_MAX_VALUE (boolean_type_node)) = boolean_type_node;
- TYPE_PRECISION (boolean_type_node) = 1;
record_builtin_type (RID_BOOL, "bool", boolean_type_node);
- boolean_false_node = build_int_2 (0, 0);
- TREE_TYPE (boolean_false_node) = boolean_type_node;
- boolean_true_node = build_int_2 (1, 0);
- TREE_TYPE (boolean_true_node) = boolean_type_node;
+ truthvalue_type_node = boolean_type_node;
+ truthvalue_false_node = boolean_false_node;
+ truthvalue_true_node = boolean_true_node;
empty_except_spec = build_tree_list (NULL_TREE, NULL_TREE);
@@ -6335,14 +6221,22 @@ cxx_init_decl_processing (void)
current_lang_name = lang_name_cplusplus;
{
- tree bad_alloc_type_node, newtype, deltype;
+ tree bad_alloc_id;
+ tree bad_alloc_type_node;
+ tree bad_alloc_decl;
+ tree newtype, deltype;
tree ptr_ftype_sizetype;
push_namespace (std_identifier);
- bad_alloc_type_node
- = xref_tag (class_type, get_identifier ("bad_alloc"),
- /*attributes=*/NULL_TREE, 1);
+ bad_alloc_id = get_identifier ("bad_alloc");
+ bad_alloc_type_node = make_aggr_type (RECORD_TYPE);
+ TYPE_CONTEXT (bad_alloc_type_node) = current_namespace;
+ bad_alloc_decl
+ = create_implicit_typedef (bad_alloc_id, bad_alloc_type_node);
+ DECL_CONTEXT (bad_alloc_decl) = current_namespace;
+ TYPE_STUB_DECL (bad_alloc_type_node) = bad_alloc_decl;
pop_namespace ();
+
ptr_ftype_sizetype
= build_function_type (ptr_type_node,
tree_cons (NULL_TREE,
@@ -6444,7 +6338,7 @@ cp_make_fname_decl (tree id, int type_dep)
if (current_function_decl)
{
struct cp_binding_level *b = current_binding_level;
- while (b->level_chain->parm_flag == 0)
+ while (b->level_chain->kind != sk_function_parms)
b = b->level_chain;
pushdecl_with_scope (decl, b);
}
@@ -6642,19 +6536,6 @@ push_throw_library_fn (tree name, tree type)
TREE_NOTHROW (fn) = 0;
return fn;
}
-
-/* Apply default attributes to a function, if a system function with default
- attributes. */
-
-void
-cxx_insert_default_attributes (tree decl)
-{
- if (!DECL_EXTERN_C_FUNCTION_P (decl))
- return;
- if (!TREE_PUBLIC (decl))
- return;
- c_common_insert_default_attributes (decl);
-}
/* When we call finish_struct for an anonymous union, we create
default copy constructors and such. But, an anonymous union
@@ -6692,8 +6573,8 @@ fixup_anonymous_aggr (tree t)
/* ISO C++ 9.5.3. Anonymous unions may not have function members. */
if (TYPE_METHODS (t))
- error ("%Han anonymous union cannot have function members",
- &DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (t)));
+ error ("%Jan anonymous union cannot have function members",
+ TYPE_MAIN_DECL (t));
/* Anonymous aggregates cannot have fields with ctors, dtors or complex
assignment operators (because they cannot have these methods themselves).
@@ -7026,8 +6907,7 @@ start_decl (tree declarator,
&& DECL_DECLARED_INLINE_P (decl)
&& DECL_UNINLINABLE (decl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (decl)))
- warning ("%Hinline function '%D' given attribute noinline",
- &DECL_SOURCE_LOCATION (decl), decl);
+ warning ("%Jinline function '%D' given attribute noinline", decl, decl);
if (context && COMPLETE_TYPE_P (complete_type (context)))
{
@@ -7178,14 +7058,18 @@ start_decl_1 (tree decl)
DECL_INITIAL (decl) = NULL_TREE;
}
-/* Handle initialization of references.
- These three arguments are from `cp_finish_decl', and have the
- same meaning here that they do there.
+/* Handle initialization of references. DECL, TYPE, and INIT have the
+ same meaning as in cp_finish_decl. *CLEANUP must be NULL on entry,
+ but will be set to a new CLEANUP_STMT if a temporary is created
+ that must be destroeyd subsequently.
+
+ Returns an initializer expression to use to initialize DECL, or
+ NULL if the initialization can be performed statically.
Quotes on semantics can be found in ARM 8.4.3. */
static tree
-grok_reference_init (tree decl, tree type, tree init)
+grok_reference_init (tree decl, tree type, tree init, tree *cleanup)
{
tree tmp;
@@ -7205,7 +7089,7 @@ grok_reference_init (tree decl, tree type, tree init)
}
if (TREE_CODE (init) == TREE_LIST)
- init = build_compound_expr (init);
+ init = build_x_compound_expr_from_list (init, "initializer");
if (TREE_CODE (TREE_TYPE (init)) == REFERENCE_TYPE)
init = convert_from_reference (init);
@@ -7222,7 +7106,7 @@ grok_reference_init (tree decl, tree type, tree init)
DECL_INITIAL for local references (instead assigning to them
explicitly); we need to allow the temporary to be initialized
first. */
- tmp = initialize_reference (type, init, decl);
+ tmp = initialize_reference (type, init, decl, cleanup);
if (tmp == error_mark_node)
return NULL_TREE;
@@ -7392,8 +7276,8 @@ maybe_commonize_var (tree decl)
TREE_PUBLIC (decl) = 0;
DECL_COMMON (decl) = 0;
cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl);
- warning ("%H you can work around this by removing the initializer",
- &DECL_SOURCE_LOCATION (decl));
+ warning ("%J you can work around this by removing the initializer",
+ decl);
}
}
}
@@ -7466,13 +7350,7 @@ reshape_init (tree type, tree *initp)
old_init_value = (TREE_CODE (*initp) == TREE_LIST
? TREE_VALUE (*initp) : old_init);
- /* For some parse errors, OLD_INIT_VALUE may be NULL. */
- if (!old_init_value)
- {
- my_friendly_assert (TREE_CODE (old_init) == TREE_LIST, 20021202);
- TREE_VALUE (old_init) = error_mark_node;
- return old_init;
- }
+ my_friendly_assert (old_init_value, 20030723);
/* If the initializer is brace-enclosed, pull initializers from the
enclosed elements. Advance past the brace-enclosed initializer
@@ -7648,13 +7526,14 @@ reshape_init (tree type, tree *initp)
}
/* Verify INIT (the initializer for DECL), and record the
- initialization in DECL_INITIAL, if appropriate.
+ initialization in DECL_INITIAL, if appropriate. CLEANUP is as for
+ grok_reference_init.
If the return value is non-NULL, it is an expression that must be
evaluated dynamically to initialize DECL. */
static tree
-check_initializer (tree decl, tree init, int flags)
+check_initializer (tree decl, tree init, int flags, tree *cleanup)
{
tree type = TREE_TYPE (decl);
@@ -7704,7 +7583,7 @@ check_initializer (tree decl, tree init, int flags)
init = NULL_TREE;
}
else if (!DECL_EXTERNAL (decl) && TREE_CODE (type) == REFERENCE_TYPE)
- init = grok_reference_init (decl, type, init);
+ init = grok_reference_init (decl, type, init, cleanup);
else if (init)
{
if (TREE_CODE (init) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (init))
@@ -7907,7 +7786,7 @@ maybe_inject_for_scope_var (tree decl)
return;
}
- if (current_binding_level->is_for_scope)
+ if (current_binding_level->kind == sk_for)
{
struct cp_binding_level *outer
= current_binding_level->level_chain;
@@ -7930,7 +7809,7 @@ maybe_inject_for_scope_var (tree decl)
{
BINDING_VALUE (outer_binding)
= DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding));
- current_binding_level->is_for_scope = 0;
+ current_binding_level->kind = sk_block;
}
}
timevar_pop (TV_NAME_LOOKUP);
@@ -8011,8 +7890,9 @@ initialize_local_var (tree decl, tree init)
void
cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
{
- register tree type;
+ tree type;
tree ttype = NULL_TREE;
+ tree cleanup;
const char *asmspec = NULL;
int was_readonly = 0;
@@ -8025,6 +7905,9 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
my_friendly_assert (TREE_CODE (decl) != RESULT_DECL, 20030619);
+ /* Assume no cleanup is required. */
+ cleanup = NULL_TREE;
+
/* If a name was specified, get the string. */
if (global_scope_p (current_binding_level))
asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);
@@ -8084,8 +7967,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
{
if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type)
warning ("shadowing previous type declaration of `%#D'", decl);
- set_identifier_type_value (DECL_NAME (decl), type);
- CLASSTYPE_GOT_SEMICOLON (type) = 1;
+ set_identifier_type_value (DECL_NAME (decl), decl);
}
/* If we have installed this as the canonical typedef for this
@@ -8139,7 +8021,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
is *not* defined. */
&& (!DECL_EXTERNAL (decl) || init))
{
- init = check_initializer (decl, init, flags);
+ init = check_initializer (decl, init, flags, &cleanup);
/* Thread-local storage cannot be dynamically initialized. */
if (DECL_THREAD_LOCAL (decl) && init)
{
@@ -8218,8 +8100,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
if (DECL_FUNCTION_SCOPE_P (decl))
{
/* This is a local declaration. */
- if (doing_semantic_analysis_p ())
- maybe_inject_for_scope_var (decl);
+ maybe_inject_for_scope_var (decl);
/* Initialize the local variable. */
if (processing_template_decl)
{
@@ -8255,10 +8136,19 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
}
}
+ /* If a CLEANUP_STMT was created to destroy a temporary bound to a
+ reference, insert it in the statement-tree now. */
+ if (cleanup)
+ add_stmt (cleanup);
+
finish_end:
if (was_readonly)
TREE_READONLY (decl) = 1;
+
+ /* If this was marked 'used', be sure it will be output. */
+ if (lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
+ mark_referenced (DECL_ASSEMBLER_NAME (decl));
}
/* This is here for a midend callback from c-common.c */
@@ -8483,9 +8373,9 @@ register_dtor_fn (tree decl)
pop_deferring_access_checks ();
/* Create the body of the anonymous function. */
- compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/false);
finish_expr_stmt (fcall);
- finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
+ finish_compound_stmt (compound_stmt);
end_cleanup_fn ();
/* Call atexit with the cleanup function. */
@@ -8512,8 +8402,6 @@ register_dtor_fn (tree decl)
static void
expand_static_init (tree decl, tree init)
{
- tree oldstatic;
-
my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 20021010);
my_friendly_assert (TREE_STATIC (decl), 20021010);
@@ -8523,14 +8411,7 @@ expand_static_init (tree decl, tree init)
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
return;
- oldstatic = value_member (decl, static_aggregates);
-
- if (oldstatic)
- {
- if (TREE_PURPOSE (oldstatic) && init != NULL_TREE)
- error ("multiple initializations given for `%D'", decl);
- }
- else if (! toplevel_bindings_p ())
+ if (! toplevel_bindings_p ())
{
/* Emit code to perform this initialization but once. */
tree if_stmt;
@@ -8570,7 +8451,7 @@ expand_static_init (tree decl, tree init)
/* Begin the conditional initialization. */
if_stmt = begin_if_stmt ();
finish_if_stmt_cond (get_guard_cond (guard), if_stmt);
- then_clause = begin_compound_stmt (/*has_no_scope=*/0);
+ then_clause = begin_compound_stmt (/*has_no_scope=*/false);
/* Do the initialization itself. */
assignment = init ? init : NULL_TREE;
@@ -8585,12 +8466,7 @@ expand_static_init (tree decl, tree init)
run until after TEMP is set to 1. */
guard_init = set_guard (guard);
if (assignment)
- {
- assignment = tree_cons (NULL_TREE, assignment,
- build_tree_list (NULL_TREE,
- guard_init));
- assignment = build_compound_expr (assignment);
- }
+ assignment = build_compound_expr (assignment, guard_init);
else
assignment = guard_init;
finish_expr_stmt (assignment);
@@ -8599,7 +8475,7 @@ expand_static_init (tree decl, tree init)
variable. */
register_dtor_fn (decl);
- finish_compound_stmt (/*has_no_scope=*/0, then_clause);
+ finish_compound_stmt (then_clause);
finish_then_clause (if_stmt);
finish_if_stmt ();
}
@@ -8905,19 +8781,14 @@ grokfndecl (tree ctype,
DECL_NOT_REALLY_EXTERN (decl) = 1;
}
- DID_INLINE_FUNC (decl) = 0;
/* If the declaration was declared inline, mark it as such. */
if (inlinep)
DECL_DECLARED_INLINE_P (decl) = 1;
/* We inline functions that are explicitly declared inline, or, when
the user explicitly asks us to, all functions. */
- if (DECL_DECLARED_INLINE_P (decl))
+ if (DECL_DECLARED_INLINE_P (decl)
+ || (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag))
DECL_INLINE (decl) = 1;
- if (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag)
- {
- DID_INLINE_FUNC (decl) = 1;
- DECL_INLINE (decl) = 1;
- }
DECL_EXTERNAL (decl) = 1;
if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE)
@@ -8928,7 +8799,7 @@ grokfndecl (tree ctype,
}
if (IDENTIFIER_OPNAME_P (DECL_NAME (decl)))
- grok_op_properties (decl, friendp);
+ grok_op_properties (decl, friendp, /*complain=*/true);
if (ctype && decl_function_context (decl))
DECL_NO_STATIC_CHAIN (decl) = 1;
@@ -8978,7 +8849,6 @@ grokfndecl (tree ctype,
fns = TREE_OPERAND (fns, 1);
}
my_friendly_assert (TREE_CODE (fns) == IDENTIFIER_NODE
- || TREE_CODE (fns) == LOOKUP_EXPR
|| TREE_CODE (fns) == OVERLOAD, 20001120);
DECL_TEMPLATE_INFO (decl) = tree_cons (fns, args, NULL_TREE);
@@ -9271,9 +9141,6 @@ build_ptrmemfunc_type (tree type)
later. */
TYPE_SET_PTRMEMFUNC_TYPE (type, t);
- /* Seems to be wanted. */
- CLASSTYPE_GOT_SEMICOLON (t) = 1;
-
return t;
}
@@ -9282,7 +9149,26 @@ build_ptrmemfunc_type (tree type)
tree
build_ptrmem_type (tree class_type, tree member_type)
{
- return build_pointer_type (build_offset_type (class_type, member_type));
+ if (TREE_CODE (member_type) == METHOD_TYPE)
+ {
+ tree arg_types;
+
+ arg_types = TYPE_ARG_TYPES (member_type);
+ class_type = (cp_build_qualified_type
+ (class_type,
+ cp_type_quals (TREE_TYPE (TREE_VALUE (arg_types)))));
+ member_type
+ = build_method_type_directly (class_type,
+ TREE_TYPE (member_type),
+ TREE_CHAIN (arg_types));
+ return build_ptrmemfunc_type (build_pointer_type (member_type));
+ }
+ else
+ {
+ my_friendly_assert (TREE_CODE (member_type) != FUNCTION_TYPE,
+ 20030716);
+ return build_offset_type (class_type, member_type);
+ }
}
/* DECL is a VAR_DECL defined in-class, whose TYPE is also given.
@@ -9519,10 +9405,6 @@ create_array_type_for_decl (tree name, tree type, tree size)
error_msg = "array of references";
break;
- case OFFSET_TYPE:
- error_msg = "array of data members";
- break;
-
case METHOD_TYPE:
error_msg = "array of function members";
break;
@@ -9800,9 +9682,6 @@ grokdeclarator (tree declarator,
{
tree fns = TREE_OPERAND (decl, 0);
- if (TREE_CODE (fns) == LOOKUP_EXPR)
- fns = TREE_OPERAND (fns, 0);
-
dname = fns;
if (TREE_CODE (dname) == COMPONENT_REF)
dname = TREE_OPERAND (dname, 1);
@@ -9911,16 +9790,19 @@ grokdeclarator (tree declarator,
decl = *next;
if (ctype)
{
- if (TREE_CODE (decl) == IDENTIFIER_NODE
- && constructor_name_p (decl, ctype))
+ tree name = decl;
+
+ if (TREE_CODE (name) == BIT_NOT_EXPR)
+ name = TREE_OPERAND (name, 0);
+
+ if (!constructor_name_p (decl, ctype))
+ ;
+ else if (decl == name)
{
sfk = sfk_constructor;
ctor_return_type = ctype;
}
- else if (TREE_CODE (decl) == BIT_NOT_EXPR
- && TREE_CODE (TREE_OPERAND (decl, 0)) == IDENTIFIER_NODE
- && constructor_name_p (TREE_OPERAND (decl, 0),
- ctype))
+ else
{
sfk = sfk_destructor;
ctor_return_type = ctype;
@@ -10610,15 +10492,7 @@ grokdeclarator (tree declarator,
case ARRAY_REF:
{
- register tree size;
-
- size = TREE_OPERAND (declarator, 1);
-
- /* VC++ spells a zero-sized array with []. */
- if (size == NULL_TREE && decl_context == FIELD && ! staticp
- && ! RIDBIT_SETP (RID_TYPEDEF, specbits))
- size = integer_zero_node;
-
+ tree size = TREE_OPERAND (declarator, 1);
declarator = TREE_OPERAND (declarator, 0);
type = create_array_type_for_decl (dname, type, size);
@@ -10958,7 +10832,9 @@ grokdeclarator (tree declarator,
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
if (current_class_type == NULL_TREE || friendp)
- type = build_cplus_method_type (ctype, TREE_TYPE (type),
+ type
+ = build_method_type_directly (ctype,
+ TREE_TYPE (type),
TYPE_ARG_TYPES (type));
else
{
@@ -11000,8 +10876,9 @@ grokdeclarator (tree declarator,
/* In this case, we will deal with it later. */
;
else if (TREE_CODE (type) == FUNCTION_TYPE)
- type = build_cplus_method_type (ctype, TREE_TYPE (type),
- TYPE_ARG_TYPES (type));
+ type = build_method_type_directly (ctype,
+ TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
}
}
break;
@@ -11137,8 +11014,7 @@ grokdeclarator (tree declarator,
{
decl = build_decl (TYPE_DECL, declarator, type);
if (in_namespace || ctype)
- error ("%Htypedef name may not be a nested-name-specifier",
- &DECL_SOURCE_LOCATION (decl));
+ error ("%Jtypedef name may not be a nested-name-specifier", decl);
if (!current_function_decl)
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
}
@@ -11184,8 +11060,8 @@ grokdeclarator (tree declarator,
if (ctype == NULL_TREE)
{
if (TREE_CODE (type) != METHOD_TYPE)
- error ("%Hinvalid type qualifier for non-member function type",
- &DECL_SOURCE_LOCATION (decl));
+ error ("%Jinvalid type qualifier for non-member function type",
+ decl);
else
ctype = TYPE_METHOD_BASETYPE (type);
}
@@ -11277,7 +11153,8 @@ grokdeclarator (tree declarator,
{
/* A friendly class? */
if (current_class_type)
- make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type));
+ make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type),
+ /*complain=*/true);
else
error ("trying to make class `%T' a friend of global scope",
type);
@@ -11354,8 +11231,6 @@ grokdeclarator (tree declarator,
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
type = build_pointer_type (type);
- else if (TREE_CODE (type) == OFFSET_TYPE)
- type = build_pointer_type (type);
}
{
@@ -11370,6 +11245,14 @@ grokdeclarator (tree declarator,
}
else if (decl_context == FIELD)
{
+ /* The C99 flexible array extension. */
+ if (!staticp && TREE_CODE (type) == ARRAY_TYPE
+ && TYPE_DOMAIN (type) == NULL_TREE)
+ {
+ tree itype = compute_array_index_type (dname, integer_zero_node);
+ type = build_cplus_array_type (TREE_TYPE (type), itype);
+ }
+
if (type == error_mark_node)
{
/* Happens when declaring arrays of sizes which
@@ -11430,8 +11313,9 @@ grokdeclarator (tree declarator,
}
}
else if (staticp < 2)
- type = build_cplus_method_type (ctype, TREE_TYPE (type),
- TYPE_ARG_TYPES (type));
+ type = build_method_type_directly (ctype,
+ TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
}
/* Tell grokfndecl if it needs to set TREE_PUBLIC on the node. */
@@ -11485,7 +11369,10 @@ grokdeclarator (tree declarator,
members of other classes. */
/* All method decls are public, so tell grokfndecl to set
TREE_PUBLIC, also. */
- decl = grokfndecl (ctype, type, declarator, declarator,
+ decl = grokfndecl (ctype, type,
+ TREE_CODE (declarator) != TEMPLATE_ID_EXPR
+ ? declarator : dname,
+ declarator,
virtualp, flags, quals, raises,
friendp ? -1 : 0, friendp, 1, 0, funcdef_flag,
template_count, in_namespace);
@@ -11620,7 +11507,8 @@ grokdeclarator (tree declarator,
inlinep, friendp, raises != NULL_TREE);
}
}
- else if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE)
+ else if (TREE_CODE (type) == FUNCTION_TYPE
+ || TREE_CODE (type) == METHOD_TYPE)
{
tree original_name;
int publicp = 0;
@@ -11663,8 +11551,9 @@ grokdeclarator (tree declarator,
}
}
else if (TREE_CODE (type) == FUNCTION_TYPE && staticp < 2)
- type = build_cplus_method_type (ctype, TREE_TYPE (type),
- TYPE_ARG_TYPES (type));
+ type = build_method_type_directly (ctype,
+ TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
/* Record presence of `static'. */
publicp = (ctype != NULL_TREE
@@ -11975,19 +11864,13 @@ grokparms (tree first_parm)
{
/* Top-level qualifiers on the parameters are
ignored for function types. */
- type = TYPE_MAIN_VARIANT (type);
+ type = cp_build_qualified_type (type, 0);
if (TREE_CODE (type) == METHOD_TYPE)
{
error ("parameter `%D' invalidly declared method type", decl);
type = build_pointer_type (type);
TREE_TYPE (decl) = type;
}
- else if (TREE_CODE (type) == OFFSET_TYPE)
- {
- error ("parameter `%D' invalidly declared offset type", decl);
- type = build_pointer_type (type);
- TREE_TYPE (decl) = type;
- }
else if (abstract_virtuals_error (decl, type))
any_error = 1; /* Seems like a good idea. */
else if (POINTER_TYPE_P (type))
@@ -12200,10 +12083,12 @@ unary_op_p (enum tree_code code)
|| code == TYPE_EXPR);
}
-/* Do a little sanity-checking on how they declared their operator. */
+/* DECL is a declaration for an overloaded operator. Returns true if
+ the declaration is valid; false otherwise. If COMPLAIN is true,
+ errors are issued for invalid declarations. */
-void
-grok_op_properties (tree decl, int friendp)
+bool
+grok_op_properties (tree decl, int friendp, bool complain)
{
tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (decl));
tree argtype;
@@ -12211,6 +12096,10 @@ grok_op_properties (tree decl, int friendp)
tree name = DECL_NAME (decl);
enum tree_code operator_code;
int arity;
+ bool ok;
+
+ /* Assume that the declaration is valid. */
+ ok = true;
/* Count the number of arguments. */
for (argtype = argtypes, arity = 0;
@@ -12252,19 +12141,6 @@ grok_op_properties (tree decl, int friendp)
{
switch (operator_code)
{
- case CALL_EXPR:
- TYPE_OVERLOADS_CALL_EXPR (current_class_type) = 1;
- break;
-
- case ARRAY_REF:
- TYPE_OVERLOADS_ARRAY_REF (current_class_type) = 1;
- break;
-
- case COMPONENT_REF:
- case MEMBER_REF:
- TYPE_OVERLOADS_ARROW (current_class_type) = 1;
- break;
-
case NEW_EXPR:
TYPE_HAS_NEW_OPERATOR (current_class_type) = 1;
break;
@@ -12317,33 +12193,38 @@ grok_op_properties (tree decl, int friendp)
error ("`%D' must be a nonstatic member function", decl);
else
{
- tree p = argtypes;
+ tree p;
if (DECL_STATIC_FUNCTION_P (decl))
error ("`%D' must be either a non-static member function or a non-member function", decl);
- if (p)
- for (; TREE_CODE (TREE_VALUE (p)) != VOID_TYPE ; p = TREE_CHAIN (p))
- {
- tree arg = non_reference (TREE_VALUE (p));
-
- /* This lets bad template code slip through. */
- if (IS_AGGR_TYPE (arg)
- || TREE_CODE (arg) == ENUMERAL_TYPE
- || TREE_CODE (arg) == TEMPLATE_TYPE_PARM
- || TREE_CODE (arg) == BOUND_TEMPLATE_TEMPLATE_PARM)
- goto foundaggr;
- }
- error
- ("`%D' must have an argument of class or enumerated type",
- decl);
- foundaggr:
- ;
+ for (p = argtypes; p && p != void_list_node; p = TREE_CHAIN (p))
+ {
+ tree arg = non_reference (TREE_VALUE (p));
+ /* IS_AGGR_TYPE, rather than CLASS_TYPE_P, is used
+ because these checks are performed even on
+ template functions. */
+ if (IS_AGGR_TYPE (arg) || TREE_CODE (arg) == ENUMERAL_TYPE)
+ break;
+ }
+
+ if (!p || p == void_list_node)
+ {
+ if (!complain)
+ return false;
+
+ error ("`%D' must have an argument of class or "
+ "enumerated type",
+ decl);
+ ok = false;
+ }
}
}
+ /* There are no restrictions on the arguments to an overloaded
+ "operator ()". */
if (operator_code == CALL_EXPR)
- return; /* No restrictions on args. */
+ return ok;
if (IDENTIFIER_TYPENAME_P (name) && ! DECL_TEMPLATE_INFO (decl))
{
@@ -12526,6 +12407,8 @@ grok_op_properties (tree decl, int friendp)
}
}
+
+ return ok;
}
static const char *
@@ -12547,57 +12430,110 @@ tag_name (enum tag_types code)
}
/* Name lookup in an elaborated-type-specifier (after the keyword
- indicated by TAG_CODE) has found TYPE. If the
+ indicated by TAG_CODE) has found the TYPE_DECL DECL. If the
elaborated-type-specifier is invalid, issue a diagnostic and return
- error_mark_node; otherwise, return TYPE itself. */
+ error_mark_node; otherwise, return the *_TYPE to which it referred.
+ If ALLOW_TEMPLATE_P is true, TYPE may be a class template. */
-static tree
+tree
check_elaborated_type_specifier (enum tag_types tag_code,
- tree type)
+ tree decl,
+ bool allow_template_p)
{
- tree t;
+ tree type;
- t = follow_tag_typedef (type);
+ /* In the case of:
- /* [dcl.type.elab] If the identifier resolves to a typedef-name or a
- template type-parameter, the elaborated-type-specifier is
- ill-formed. */
- if (!t)
+ struct S { struct S *p; };
+
+ name lookup will find the TYPE_DECL for the implicit "S::S"
+ typedef. Adjust for that here. */
+ if (DECL_SELF_REFERENCE_P (decl))
+ decl = TYPE_NAME (TREE_TYPE (decl));
+
+ type = TREE_TYPE (decl);
+
+ /* [dcl.type.elab]
+
+ If the identifier resolves to a typedef-name or a template
+ type-parameter, the elaborated-type-specifier is ill-formed.
+
+ In other words, the only legitimate declaration to use in the
+ elaborated type specifier is the implicit typedef created when
+ the type is declared. */
+ if (!DECL_IMPLICIT_TYPEDEF_P (decl))
{
- error ("using typedef-name `%D' after `%s'",
- TYPE_NAME (type), tag_name (tag_code));
- t = error_mark_node;
+ error ("using typedef-name `%D' after `%s'", decl, tag_name (tag_code));
+ return IS_AGGR_TYPE (type) ? type : error_mark_node;
}
- else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
+
+ if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
{
error ("using template type parameter `%T' after `%s'",
type, tag_name (tag_code));
- t = error_mark_node;
+ return error_mark_node;
+ }
+ else if (TREE_CODE (type) != RECORD_TYPE
+ && TREE_CODE (type) != UNION_TYPE
+ && tag_code != enum_type)
+ {
+ error ("`%T' referred to as `%s'", type, tag_name (tag_code));
+ return error_mark_node;
}
+ else if (TREE_CODE (type) != ENUMERAL_TYPE
+ && tag_code == enum_type)
+ {
+ error ("`%T' referred to as enum", type);
+ return error_mark_node;
+ }
+ else if (!allow_template_p
+ && TREE_CODE (type) == RECORD_TYPE
+ && CLASSTYPE_IS_TEMPLATE (type))
+ {
+ /* If a class template appears as elaborated type specifier
+ without a template header such as:
- return t;
+ template <class T> class C {};
+ void f(class C); // No template header here
+
+ then the required template argument is missing. */
+
+ error ("template argument required for `%s %T'",
+ tag_name (tag_code),
+ DECL_NAME (CLASSTYPE_TI_TEMPLATE (type)));
+ return error_mark_node;
+ }
+
+ return type;
}
-/* Get the struct, enum or union (CODE says which) with tag NAME.
+/* Get the struct, enum or union (TAG_CODE says which) with tag NAME.
Define the tag as a forward-reference if it is not defined.
- C++: If a class derivation is given, process it here, and report
- an error if multiple derivation declarations are not identical.
+ If a declaration is given, process it here, and report an error if
+ multiple declarations are not identical. ATTRIBUTE is the attribute
+ appeared in this declaration.
- If this is a definition, come in through xref_tag and only look in
+ GLOBALIZE is false when this is also a definition. Only look in
the current frame for the name (since C++ allows new names in any
- scope.) */
+ scope.)
+
+ TEMPLATE_HEADER_P is true when this declaration is preceded by
+ a set of template parameters. */
tree
xref_tag (enum tag_types tag_code, tree name, tree attributes,
- bool globalize)
+ bool globalize, bool template_header_p)
{
enum tree_code code;
- register tree ref, t;
+ register tree t;
struct cp_binding_level *b = current_binding_level;
tree context = NULL_TREE;
timevar_push (TV_NAME_LOOKUP);
+
+ my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
+
switch (tag_code)
{
case record_type:
@@ -12614,93 +12550,50 @@ xref_tag (enum tag_types tag_code, tree name, tree attributes,
abort ();
}
- /* If a cross reference is requested, look up the type
- already defined for this tag and return it. */
- if (TYPE_P (name))
- {
- t = name;
- name = TYPE_IDENTIFIER (t);
- }
- else
- t = IDENTIFIER_TYPE_VALUE (name);
-
- /* Warn about 'friend struct Inherited;' doing the wrong thing. */
- if (t && globalize && TREE_CODE (t) == TYPENAME_TYPE)
- {
- static int explained;
- tree shadowed;
-
- warning ("`%s %T' declares a new type at namespace scope",
- tag_name (tag_code), name);
- if (!explained++)
- warning (" names from dependent base classes are not visible to unqualified name lookup - to refer to the inherited type, say `%s %T::%T'",
- tag_name (tag_code),
- constructor_name (current_class_type),
- TYPE_IDENTIFIER (t));
-
- /* We need to remove the class scope binding for the
- TYPENAME_TYPE as otherwise poplevel_class gets confused. */
- for (shadowed = b->class_shadowed;
- shadowed;
- shadowed = TREE_CHAIN (shadowed))
- if (TREE_TYPE (shadowed) == TYPE_NAME (t))
- {
- TREE_PURPOSE (shadowed) = NULL_TREE;
- break;
- }
- }
-
- if (t && TREE_CODE (t) != code && TREE_CODE (t) != TEMPLATE_TYPE_PARM
- && TREE_CODE (t) != BOUND_TEMPLATE_TEMPLATE_PARM)
- t = NULL_TREE;
-
if (! globalize)
{
/* If we know we are defining this tag, only look it up in
this scope and don't try to find it as a type. */
- ref = lookup_tag (code, name, b, 1);
+ t = lookup_tag (code, name, b, 1);
}
else
{
- if (t)
- {
- ref = check_elaborated_type_specifier (tag_code, t);
- if (ref == error_mark_node)
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
- }
- else
- ref = lookup_tag (code, name, b, 0);
+ tree decl = lookup_name (name, 1);
+
+ if (decl && DECL_CLASS_TEMPLATE_P (decl))
+ decl = DECL_TEMPLATE_RESULT (decl);
- if (! ref)
+ if (decl && TREE_CODE (decl) == TYPE_DECL)
{
- /* Try finding it as a type declaration. If that wins,
- use it. */
- ref = lookup_name (name, 1);
+ /* Two cases we need to consider when deciding if a class
+ template is allowed as an elaborated type specifier:
+ 1. It is a self reference to its own class.
+ 2. It comes with a template header.
- if (ref != NULL_TREE
- && processing_template_decl
- && DECL_CLASS_TEMPLATE_P (ref)
- && template_class_depth (current_class_type) == 0)
- /* Since GLOBALIZE is true, we're declaring a global
- template, so we want this type. */
- ref = DECL_TEMPLATE_RESULT (ref);
+ For example:
- if (ref && TREE_CODE (ref) == TYPE_DECL)
- {
- ref = check_elaborated_type_specifier (tag_code,
- TREE_TYPE (ref));
- if (ref == error_mark_node)
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
- if (ref && TREE_CODE (ref) != code)
- ref = NULL_TREE;
- }
- else
- ref = NULL_TREE;
+ template <class T> class C {
+ class C *c1; // DECL_SELF_REFERENCE_P is true
+ class D;
+ };
+ template <class U> class C; // template_header_p is true
+ template <class T> class C<T>::D {
+ class C *c2; // DECL_SELF_REFERENCE_P is true
+ }; */
+
+ t = check_elaborated_type_specifier (tag_code,
+ decl,
+ template_header_p
+ | DECL_SELF_REFERENCE_P (decl));
+ if (t == error_mark_node)
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
+ else
+ t = NULL_TREE;
- if (ref && current_class_type
+ if (t && current_class_type
&& template_class_depth (current_class_type)
- && PROCESSING_REAL_TEMPLATE_DECL_P ())
+ && template_header_p)
{
/* Since GLOBALIZE is nonzero, we are not looking at a
definition of this tag. Since, in addition, we are currently
@@ -12738,12 +12631,12 @@ xref_tag (enum tag_types tag_code, tree name, tree attributes,
accomplish this by making sure that the new type we
create to represent this declaration has the right
TYPE_CONTEXT. */
- context = TYPE_CONTEXT (ref);
- ref = NULL_TREE;
+ context = TYPE_CONTEXT (t);
+ t = NULL_TREE;
}
}
- if (! ref)
+ if (! t)
{
/* If no such tag is yet defined, create a forward-reference node
and record it as the "definition".
@@ -12753,44 +12646,41 @@ xref_tag (enum tag_types tag_code, tree name, tree attributes,
{
error ("use of enum `%#D' without previous declaration", name);
- ref = make_node (ENUMERAL_TYPE);
+ t = make_node (ENUMERAL_TYPE);
/* Give the type a default layout like unsigned int
to avoid crashing if it does not get defined. */
- TYPE_MODE (ref) = TYPE_MODE (unsigned_type_node);
- TYPE_ALIGN (ref) = TYPE_ALIGN (unsigned_type_node);
- TYPE_USER_ALIGN (ref) = 0;
- TREE_UNSIGNED (ref) = 1;
- TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node);
- TYPE_MIN_VALUE (ref) = TYPE_MIN_VALUE (unsigned_type_node);
- TYPE_MAX_VALUE (ref) = TYPE_MAX_VALUE (unsigned_type_node);
+ TYPE_MODE (t) = TYPE_MODE (unsigned_type_node);
+ TYPE_ALIGN (t) = TYPE_ALIGN (unsigned_type_node);
+ TYPE_USER_ALIGN (t) = 0;
+ TREE_UNSIGNED (t) = 1;
+ TYPE_PRECISION (t) = TYPE_PRECISION (unsigned_type_node);
+ TYPE_MIN_VALUE (t) = TYPE_MIN_VALUE (unsigned_type_node);
+ TYPE_MAX_VALUE (t) = TYPE_MAX_VALUE (unsigned_type_node);
/* Enable us to recognize when a type is created in class context.
To do nested classes correctly, this should probably be cleared
out when we leave this classes scope. Currently this in only
done in `start_enum'. */
- pushtag (name, ref, globalize);
+ pushtag (name, t, globalize);
}
else
{
- struct cp_binding_level *old_b = class_binding_level;
-
- ref = make_aggr_type (code);
- TYPE_CONTEXT (ref) = context;
- pushtag (name, ref, globalize);
- class_binding_level = old_b;
+ t = make_aggr_type (code);
+ TYPE_CONTEXT (t) = context;
+ pushtag (name, t, globalize);
}
}
else
{
- if (!globalize && processing_template_decl && IS_AGGR_TYPE (ref))
- redeclare_class_template (ref, current_template_parms);
+ if (!globalize && processing_template_decl && IS_AGGR_TYPE (t))
+ redeclare_class_template (t, current_template_parms);
}
- TYPE_ATTRIBUTES (ref) = attributes;
+ TYPE_ATTRIBUTES (t) = attributes;
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ref);
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
}
tree
@@ -12806,7 +12696,7 @@ xref_tag_from_type (tree old, tree id, int globalize)
if (id == NULL_TREE)
id = TYPE_IDENTIFIER (old);
- return xref_tag (tag_kind, id, /*attributes=*/NULL_TREE, globalize);
+ return xref_tag (tag_kind, id, /*attributes=*/NULL_TREE, globalize, false);
}
/* REF is a type (named NAME), for which we have just seen some
@@ -12826,6 +12716,9 @@ xref_basetypes (tree ref, tree base_list)
int i;
enum tag_types tag_code;
+ if (ref == error_mark_node)
+ return;
+
if (TREE_CODE (ref) == UNION_TYPE)
{
error ("derived union `%T' invalid", ref);
@@ -13004,8 +12897,7 @@ start_enum (tree name)
if (enumtype != NULL_TREE && TREE_CODE (enumtype) == ENUMERAL_TYPE)
{
error ("multiple definition of `%#T'", enumtype);
- error ("%Hprevious definition here",
- &DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype)));
+ error ("%Jprevious definition here", TYPE_MAIN_DECL (enumtype));
/* Clear out TYPE_VALUES, and start again. */
TYPE_VALUES (enumtype) = NULL_TREE;
}
@@ -13025,7 +12917,9 @@ start_enum (tree name)
void
finish_enum (tree enumtype)
{
- tree pair;
+ tree values;
+ tree decl;
+ tree value;
tree minnode;
tree maxnode;
tree t;
@@ -13033,6 +12927,8 @@ finish_enum (tree enumtype)
int lowprec;
int highprec;
int precision;
+ integer_type_kind itk;
+ tree underlying_type = NULL_TREE;
/* We built up the VALUES in reverse order. */
TYPE_VALUES (enumtype) = nreverse (TYPE_VALUES (enumtype));
@@ -13043,21 +12939,25 @@ finish_enum (tree enumtype)
works. */
if (processing_template_decl)
{
- for (pair = TYPE_VALUES (enumtype); pair; pair = TREE_CHAIN (pair))
- TREE_TYPE (TREE_VALUE (pair)) = enumtype;
+ for (values = TYPE_VALUES (enumtype);
+ values;
+ values = TREE_CHAIN (values))
+ TREE_TYPE (TREE_VALUE (values)) = enumtype;
if (at_function_scope_p ())
add_stmt (build_min (TAG_DEFN, enumtype));
return;
}
+ /* Determine the minimum and maximum values of the enumerators. */
if (TYPE_VALUES (enumtype))
{
minnode = maxnode = NULL_TREE;
- for (pair = TYPE_VALUES (enumtype); pair; pair = TREE_CHAIN (pair))
+ for (values = TYPE_VALUES (enumtype);
+ values;
+ values = TREE_CHAIN (values))
{
- tree decl = TREE_VALUE (pair);
- tree value = DECL_INITIAL (decl);
+ decl = TREE_VALUE (values);
/* [dcl.enum]: Following the closing brace of an enum-specifier,
each enumerator has the type of its enumeration. Prior to the
@@ -13065,6 +12965,8 @@ finish_enum (tree enumtype)
initializing value. */
TREE_TYPE (decl) = enumtype;
+ /* Update the minimum and maximum values, if appropriate. */
+ value = DECL_INITIAL (decl);
/* Figure out what the minimum and maximum values of the
enumerators are. */
if (!minnode)
@@ -13083,13 +12985,13 @@ finish_enum (tree enumtype)
value = DECL_INITIAL (decl) = copy_node (value);
TREE_TYPE (value) = enumtype;
}
-
- /* In addition, transform the TYPE_VALUES list to contain the
- values, rather than the CONST_DECLs for them. */
- TREE_VALUE (pair) = value;
}
}
else
+ /* [dcl.enum]
+
+ If the enumerator-list is empty, the underlying type is as if
+ the enumeration had a single enumerator with value 0. */
minnode = maxnode = integer_zero_node;
/* Compute the number of bits require to represent all values of the
@@ -13101,35 +13003,75 @@ finish_enum (tree enumtype)
highprec = min_precision (maxnode, unsignedp);
precision = MAX (lowprec, highprec);
- /* DR 377
-
- IF no integral type can represent all the enumerator values, the
- enumeration is ill-formed. */
- if (precision > TYPE_PRECISION (long_long_integer_type_node))
+ /* Determine the underlying type of the enumeration.
+
+ [dcl.enum]
+
+ The underlying type of an enumeration is an integral type that
+ can represent all the enumerator values defined in the
+ enumeration. It is implementation-defined which integral type is
+ used as the underlying type for an enumeration except that the
+ underlying type shall not be larger than int unless the value of
+ an enumerator cannot fit in an int or unsigned int.
+
+ We use "int" or an "unsigned int" as the underlying type, even if
+ a smaller integral type would work, unless the user has
+ explicitly requested that we use the smallest possible type. */
+ for (itk = (flag_short_enums ? itk_char : itk_int);
+ itk != itk_none;
+ itk++)
+ {
+ underlying_type = integer_types[itk];
+ if (TYPE_PRECISION (underlying_type) >= precision
+ && TREE_UNSIGNED (underlying_type) == unsignedp)
+ break;
+ }
+ if (itk == itk_none)
{
+ /* DR 377
+
+ IF no integral type can represent all the enumerator values, the
+ enumeration is ill-formed. */
error ("no integral type can represent all of the enumerator values "
"for `%T'", enumtype);
precision = TYPE_PRECISION (long_long_integer_type_node);
+ underlying_type = integer_types[itk_unsigned_long_long];
}
- /* Compute the minium and maximum values for the type, the size of
- the type, and so forth. */
- TYPE_PRECISION (enumtype) = precision;
- TYPE_SIZE (enumtype) = NULL_TREE;
- if (unsignedp)
- fixup_unsigned_type (enumtype);
- else
- fixup_signed_type (enumtype);
+ /* Compute the minium and maximum values for the type.
- /* We use "int" or "unsigned int" as the underlying type, unless all
- the values will not fit or the user has requested that we try to
- use shorter types where possible. */
- if (precision < TYPE_PRECISION (integer_type_node)
- && !flag_short_enums)
- {
- TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
- TYPE_SIZE (enumtype) = NULL_TREE;
- layout_type (enumtype);
+ [dcl.enum]
+
+ For an enumeration where emin is the smallest enumerator and emax
+ is the largest, the values of the enumeration are the values of the
+ underlying type in the range bmin to bmax, where bmin and bmax are,
+ respectively, the smallest and largest values of the smallest bit-
+ field that can store emin and emax. */
+ TYPE_PRECISION (enumtype) = precision;
+ set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp);
+
+ /* [dcl.enum]
+
+ The value of sizeof() applied to an enumeration type, an object
+ of an enumeration type, or an enumerator, is the value of sizeof()
+ applied to the underlying type. */
+ TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type);
+ TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type);
+ TYPE_MODE (enumtype) = TYPE_MODE (underlying_type);
+ TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
+ TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
+ TREE_UNSIGNED (enumtype) = TREE_UNSIGNED (underlying_type);
+
+ /* Convert each of the enumerators to the type of the underlying
+ type of the enumeration. */
+ for (values = TYPE_VALUES (enumtype); values; values = TREE_CHAIN (values))
+ {
+ decl = TREE_VALUE (values);
+ value = perform_implicit_conversion (underlying_type,
+ DECL_INITIAL (decl));
+ TREE_TYPE (value) = enumtype;
+ DECL_INITIAL (decl) = value;
+ TREE_VALUE (values) = value;
}
/* Fix up all variant types of this enum type. */
@@ -13212,6 +13154,8 @@ build_enumerator (tree name, tree value, tree enumtype)
/* C++ associates enums with global, function, or class declarations. */
context = current_scope ();
+ if (!context)
+ context = current_namespace;
/* Build the actual enumeration constant. Note that the enumeration
constants have the type of their initializers until the
@@ -13243,8 +13187,8 @@ build_enumerator (tree name, tree value, tree enumtype)
if (context && context == current_class_type)
/* In something like `struct S { enum E { i = 7 }; };' we put `i'
- on the TYPE_FIELDS list for `S'. (That's so that you can say
- things like `S::i' later.) */
+ on the TYPE_FIELDS list for `S'. (That's so that you can say
+ things like `S::i' later.) */
finish_member_declaration (decl);
else
pushdecl (decl);
@@ -13275,9 +13219,9 @@ check_function_type (tree decl, tree current_function_parms)
{
tree ctype = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype)));
TREE_TYPE (decl)
- = build_cplus_method_type (ctype,
- void_type_node,
- FUNCTION_ARG_CHAIN (decl));
+ = build_method_type_directly (ctype,
+ void_type_node,
+ FUNCTION_ARG_CHAIN (decl));
}
else
TREE_TYPE (decl)
@@ -13377,20 +13321,6 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
fntype = TREE_TYPE (decl1);
restype = TREE_TYPE (fntype);
- if (CLASS_TYPE_P (restype) && !CLASSTYPE_GOT_SEMICOLON (restype))
- {
- error ("semicolon missing after declaration of `%#T'", restype);
- shadow_tag (build_tree_list (NULL_TREE, restype));
- CLASSTYPE_GOT_SEMICOLON (restype) = 1;
- if (TREE_CODE (fntype) == FUNCTION_TYPE)
- fntype = build_function_type (integer_type_node,
- TYPE_ARG_TYPES (fntype));
- else
- fntype = build_cplus_method_type (build_type_variant (TYPE_METHOD_BASETYPE (fntype), TREE_READONLY (decl1), TREE_SIDE_EFFECTS (decl1)),
- integer_type_node,
- TYPE_ARG_TYPES (fntype));
- TREE_TYPE (decl1) = fntype;
- }
if (TREE_CODE (fntype) == METHOD_TYPE)
ctype = TYPE_METHOD_BASETYPE (fntype);
@@ -13409,8 +13339,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
if (DECL_DECLARED_INLINE_P (decl1)
&& lookup_attribute ("noinline", attrs))
- warning ("%Hinline function '%D' given attribute noinline",
- &DECL_SOURCE_LOCATION (decl1), decl1);
+ warning ("%Jinline function '%D' given attribute noinline", decl1, decl1);
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl1))
/* This is a constructor, we must ensure that any default args
@@ -13504,7 +13433,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
CFUN set up, and our per-function variables initialized.
FIXME factor out the non-RTL stuff. */
bl = current_binding_level;
- init_function_start (decl1);
+ allocate_struct_function (decl1);
current_binding_level = bl;
/* Even though we're inside a function body, we still don't want to
@@ -13653,8 +13582,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
DECL_INTERFACE_KNOWN (decl1) = 1;
}
- pushlevel (0);
- current_binding_level->parm_flag = 1;
+ begin_scope (sk_function_parms);
++function_depth;
@@ -13764,8 +13692,7 @@ save_function_data (tree decl)
19990908);
/* Make a copy. */
- f = ((struct language_function *)
- ggc_alloc (sizeof (struct language_function)));
+ f = ggc_alloc (sizeof (struct language_function));
memcpy (f, cp_function_chain, sizeof (struct language_function));
DECL_SAVED_FUNCTION_DATA (decl) = f;
@@ -13776,9 +13703,6 @@ save_function_data (tree decl)
f->bindings = NULL;
f->x_local_names = NULL;
- /* When we get back here again, we will be expanding. */
- f->x_expanding_p = 1;
-
/* If we've already decided that we cannot inline this function, we
must remember that fact when we actually go to expand the
function. */
@@ -13838,14 +13762,14 @@ begin_destructor_body (void)
initialize the vtables.) */
finish_if_stmt_cond (boolean_true_node, if_stmt);
- compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/false);
/* Make all virtual function table pointers in non-virtual base
classes point to CURRENT_CLASS_TYPE's virtual function
tables. */
initialize_vtbl_ptrs (current_class_ptr);
- finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
+ finish_compound_stmt (compound_stmt);
finish_then_clause (if_stmt);
finish_if_stmt ();
@@ -13912,7 +13836,7 @@ begin_function_body (void)
operation of dwarfout.c. */
keep_next_level (1);
- stmt = begin_compound_stmt (0);
+ stmt = begin_compound_stmt (/*has_no_scope=*/false);
COMPOUND_STMT_BODY_BLOCK (stmt) = 1;
if (processing_template_decl)
@@ -13938,7 +13862,7 @@ void
finish_function_body (tree compstmt)
{
/* Close the block. */
- finish_compound_stmt (0, compstmt);
+ finish_compound_stmt (compstmt);
if (processing_template_decl)
/* Do nothing now. */;
@@ -14030,7 +13954,7 @@ finish_function (int flags)
/* If the current binding level isn't the outermost binding level
for this function, either there is a bug, or we have experienced
syntax errors and the statement tree is malformed. */
- if (current_binding_level->parm_flag != 1)
+ if (current_binding_level->kind != sk_function_parms)
{
/* Make sure we have already experienced errors. */
if (errorcount == 0)
@@ -14040,9 +13964,9 @@ finish_function (int flags)
levels. */
DECL_SAVED_TREE (fndecl) = build_stmt (COMPOUND_STMT, NULL_TREE);
- while (current_binding_level->parm_flag != 1)
+ while (current_binding_level->kind != sk_function_parms)
{
- if (current_binding_level->parm_flag == 2)
+ if (current_binding_level->kind == sk_class)
pop_nested_class ();
else
poplevel (0, 0, 0);
@@ -14050,6 +13974,10 @@ finish_function (int flags)
}
poplevel (1, 0, 1);
+ /* Statements should always be full-expressions at the outermost set
+ of curly braces for a function. */
+ my_friendly_assert (stmts_are_full_exprs_p (), 19990831);
+
/* Set up the named return value optimization, if we can. Here, we
eliminate the copy from the nrv into the RESULT_DECL and any cleanup
for the nrv. genrtl_start_function and declare_return_variable
@@ -14062,7 +13990,7 @@ finish_function (int flags)
if (r != error_mark_node
/* This is only worth doing for fns that return in memory--and
simpler, since we don't have to worry about promoted modes. */
- && aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl)))
+ && aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl)), fndecl)
/* Only allow this for variables declared in the outer scope of
the function so we know that their lifetime always ends with a
return; see g++.dg/opt/nrv6.C. We could be more flexible if
@@ -14120,13 +14048,11 @@ finish_function (int flags)
inline function, as we might never be compiled separately. */
&& (DECL_INLINE (fndecl) || processing_template_decl))
warning ("no return statement in function returning non-void");
-
- /* Clear out memory we no longer need. */
- free_after_parsing (cfun);
- /* Since we never call rest_of_compilation, we never clear
- CFUN. Do so explicitly. */
- free_after_compilation (cfun);
+
+ /* We're leaving the context of this function, so zap cfun. It's still in
+ DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation. */
cfun = NULL;
+ current_function_decl = NULL;
/* If this is an in-class inline definition, we may have to pop the
bindings for the template parameters that we added in
@@ -14209,14 +14135,16 @@ start_method (tree declspecs, tree declarator, tree attrlist)
check_template_shadow (fndecl);
DECL_DECLARED_INLINE_P (fndecl) = 1;
-
- DID_INLINE_FUNC (fndecl) = 0;
if (flag_default_inline)
DECL_INLINE (fndecl) = 1;
/* We process method specializations in finish_struct_1. */
if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl))
- fndecl = push_template_decl (fndecl);
+ {
+ fndecl = push_template_decl (fndecl);
+ if (fndecl == error_mark_node)
+ return fndecl;
+ }
if (! DECL_FRIEND_P (fndecl))
{
@@ -14231,8 +14159,7 @@ start_method (tree declspecs, tree declarator, tree attrlist)
cp_finish_decl (fndecl, NULL_TREE, NULL_TREE, 0);
/* Make a place for the parms */
- pushlevel (0);
- current_binding_level->parm_flag = 1;
+ begin_scope (sk_function_parms);
DECL_IN_AGGR_P (fndecl) = 1;
return fndecl;
@@ -14382,8 +14309,7 @@ cxx_maybe_build_cleanup (tree decl)
if (TYPE_USES_VIRTUAL_BASECLASSES (type)
&& ! TYPE_HAS_DESTRUCTOR (type))
- rval = build_compound_expr (tree_cons (NULL_TREE, rval,
- build_tree_list (NULL_TREE, build_vbase_delete (type, decl))));
+ rval = build_compound_expr (rval, build_vbase_delete (type, decl));
return rval;
}
@@ -14434,17 +14360,37 @@ void
cxx_push_function_context (struct function * f)
{
struct language_function *p
- = ((struct language_function *)
- ggc_alloc_cleared (sizeof (struct language_function)));
+ = ggc_alloc_cleared (sizeof (struct language_function));
f->language = p;
- /* It takes an explicit call to expand_body to generate RTL for a
- function. */
- expanding_p = 0;
-
/* Whenever we start a new function, we destroy temporaries in the
usual way. */
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
+
+ if (f->decl)
+ {
+ 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
+ now, restore saved state. */
+ *cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn);
+
+ /* If we decided that we didn't want to inline this function,
+ make sure the back-end knows that. */
+ if (!current_function_cannot_inline)
+ current_function_cannot_inline = cp_function_chain->cannot_inline;
+
+ /* We don't need the saved data anymore. Unless this is an inline
+ function; we need the named return value info for
+ cp_copy_res_decl_for_inlining. */
+ if (! DECL_INLINE (fn))
+ DECL_SAVED_FUNCTION_DATA (fn) = NULL;
+ }
+ }
}
/* Free the language-specific parts of F, now that we've finished
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index c77e5039fb9..b1ee970464e 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -154,10 +154,10 @@ grok_method_quals (tree ctype, tree function, tree quals)
? "member function" : "type");
ctype = cp_build_qualified_type (ctype, type_quals);
- fntype = build_cplus_method_type (ctype, TREE_TYPE (fntype),
- (TREE_CODE (fntype) == METHOD_TYPE
- ? TREE_CHAIN (TYPE_ARG_TYPES (fntype))
- : TYPE_ARG_TYPES (fntype)));
+ fntype = build_method_type_directly (ctype, TREE_TYPE (fntype),
+ (TREE_CODE (fntype) == METHOD_TYPE
+ ? TREE_CHAIN (TYPE_ARG_TYPES (fntype))
+ : TYPE_ARG_TYPES (fntype)));
if (raises)
fntype = build_exception_variant (fntype, raises);
@@ -223,7 +223,10 @@ tree
cp_build_parm_decl (tree name, tree type)
{
tree parm = build_decl (PARM_DECL, name, type);
- DECL_ARG_TYPE (parm) = type_passed_as (type);
+ /* DECL_ARG_TYPE is only used by the back end and the back end never
+ sees templates. */
+ if (!processing_template_decl)
+ DECL_ARG_TYPE (parm) = type_passed_as (type);
return parm;
}
@@ -306,8 +309,8 @@ maybe_retrofit_in_chrg (tree fn)
TREE_CHAIN (DECL_ARGUMENTS (fn)) = parms;
/* And rebuild the function type. */
- fntype = build_cplus_method_type (basetype, TREE_TYPE (TREE_TYPE (fn)),
- arg_types);
+ fntype = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (fn)),
+ arg_types);
if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
fntype = build_exception_variant (fntype,
TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)));
@@ -384,12 +387,6 @@ grokclassfn (tree ctype, tree function, enum overload_flags flags, tree quals)
if (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function))
maybe_retrofit_in_chrg (function);
-
- if (flags == DTOR_FLAG)
- {
- DECL_DESTRUCTOR_P (function) = 1;
- TYPE_HAS_DESTRUCTOR (ctype) = 1;
- }
}
/* Create an ARRAY_REF, checking for the user doing things backwards
@@ -466,8 +463,8 @@ grok_array_decl (tree array_expr, tree index_exp)
expr = build_array_ref (array_expr, index_exp);
}
if (processing_template_decl && expr != error_mark_node)
- return build_min (ARRAY_REF, TREE_TYPE (expr), orig_array_expr,
- orig_index_exp);
+ return build_min_non_dep (ARRAY_REF, expr,
+ orig_array_expr, orig_index_exp);
return expr;
}
@@ -918,9 +915,6 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
DECL_NONLOCAL (value) = 1;
DECL_CONTEXT (value) = current_class_type;
- if (CLASS_TYPE_P (TREE_TYPE (value)))
- CLASSTYPE_GOT_SEMICOLON (TREE_TYPE (value)) = 1;
-
if (processing_template_decl)
value = push_template_decl (value);
@@ -1190,8 +1184,21 @@ constructor_name (tree type)
bool
constructor_name_p (tree name, tree type)
{
- return (name == constructor_name (type)
- || name == constructor_name_full (type));
+ tree ctor_name;
+
+ if (!name)
+ return false;
+
+ if (TREE_CODE (name) != IDENTIFIER_NODE)
+ return false;
+
+ ctor_name = constructor_name_full (type);
+ if (name == ctor_name)
+ return true;
+ if (IDENTIFIER_TEMPLATE (ctor_name)
+ && name == IDENTIFIER_TEMPLATE (ctor_name))
+ return true;
+ return false;
}
@@ -1504,7 +1511,7 @@ maybe_make_one_only (tree decl)
{
DECL_COMDAT (decl) = 1;
/* Mark it needed so we don't forget to emit it. */
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = 1;
+ mark_referenced (DECL_ASSEMBLER_NAME (decl));
}
}
@@ -1613,35 +1620,16 @@ import_export_class (tree ctype)
CLASSTYPE_INTERFACE_ONLY (ctype) = (import_export < 0);
}
}
-
-/* We need to describe to the assembler the relationship between
- a vtable and the vtable of the parent class. */
-void
-prepare_assemble_variable (tree vars)
+/* Return true if VAR has already been provided to the back end; in that
+ case VAR should not be modified further by the front end. */
+static bool
+var_finalized_p (tree var)
{
- tree parent;
- rtx child_rtx, parent_rtx;
-
- if (!flag_vtable_gc || TREE_CODE (vars) != VAR_DECL
- || !DECL_VTABLE_OR_VTT_P (vars))
- return;
-
- child_rtx = XEXP (DECL_RTL (vars), 0); /* strip the mem ref */
-
- parent = binfo_for_vtable (vars);
-
- if (parent == TYPE_BINFO (DECL_CONTEXT (vars)))
- parent_rtx = const0_rtx;
- else if (parent)
- {
- parent = get_vtbl_decl_for_binfo (TYPE_BINFO (BINFO_TYPE (parent)));
- parent_rtx = XEXP (DECL_RTL (parent), 0); /* strip the mem ref */
- }
+ if (flag_unit_at_a_time)
+ return cgraph_varpool_node (var)->finalized;
else
- abort ();
-
- assemble_vtable_inherit (child_rtx, parent_rtx);
+ return TREE_ASM_WRITTEN (var);
}
/* If necessary, write out the vtables for the dynamic class CTYPE.
@@ -1657,7 +1645,7 @@ maybe_emit_vtables (tree ctype)
/* If the vtables for this class have already been emitted there is
nothing more to do. */
primary_vtbl = CLASSTYPE_VTABLES (ctype);
- if (TREE_ASM_WRITTEN (primary_vtbl))
+ if (var_finalized_p (primary_vtbl))
return false;
/* Ignore dummy vtables made by get_vtable_decl. */
if (TREE_TYPE (primary_vtbl) == void_type_node)
@@ -1760,7 +1748,8 @@ import_export_decl (tree decl)
if ((DECL_IMPLICIT_INSTANTIATION (decl)
|| DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl))
&& (flag_implicit_templates
- || (flag_implicit_inline_templates
+ || (flag_implicit_inline_templates
+ && TREE_CODE (decl) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (decl))))
{
if (!TREE_PUBLIC (decl))
@@ -2012,7 +2001,7 @@ start_objects (int method_type, int initp)
DECL_GLOBAL_DTOR_P (current_function_decl) = 1;
DECL_LANG_SPECIFIC (current_function_decl)->decl_flags.u2sel = 1;
- body = begin_compound_stmt (/*has_no_scope=*/0);
+ body = begin_compound_stmt (/*has_no_scope=*/false);
/* We cannot allow these functions to be elided, even if they do not
have external linkage. And, there's no point in deferring
@@ -2033,7 +2022,7 @@ finish_objects (int method_type, int initp, tree body)
tree fn;
/* Finish up. */
- finish_compound_stmt (/*has_no_scope=*/0, body);
+ finish_compound_stmt (body);
fn = finish_function (0);
expand_or_defer_fn (fn);
@@ -2169,7 +2158,7 @@ start_static_storage_duration_function (unsigned count)
SF_PRE_PARSED);
/* Set up the scope of the outermost block in the function. */
- body = begin_compound_stmt (/*has_no_scope=*/0);
+ body = begin_compound_stmt (/*has_no_scope=*/false);
/* This function must not be deferred because we are depending on
its compilation to tell us what is TREE_SYMBOL_REFERENCED. */
@@ -2187,7 +2176,7 @@ static void
finish_static_storage_duration_function (tree body)
{
/* Close out the function. */
- finish_compound_stmt (/*has_no_scope=*/0, body);
+ finish_compound_stmt (body);
expand_or_defer_fn (finish_function (0));
}
@@ -2207,7 +2196,7 @@ get_priority_info (int priority)
{
/* Create a new priority information structure, and insert it
into the map. */
- pi = (priority_info) xmalloc (sizeof (struct priority_info_s));
+ pi = xmalloc (sizeof (struct priority_info_s));
pi->initializations_p = 0;
pi->destructions_p = 0;
splay_tree_insert (priority_info_map,
@@ -2474,7 +2463,7 @@ write_out_vars (tree vars)
tree v;
for (v = vars; v; v = TREE_CHAIN (v))
- if (! TREE_ASM_WRITTEN (TREE_VALUE (v)))
+ if (!var_finalized_p (TREE_VALUE (v)))
rest_of_decl_compilation (TREE_VALUE (v), 0, 1, 1);
}
@@ -2575,24 +2564,30 @@ generate_ctor_and_dtor_functions_for_priority (splay_tree_node n, void * data)
return 0;
}
-/* Callgraph code does not understand the member pointers. Mark the methods
- referenced as used. */
-static tree
-mark_member_pointers (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED)
-{
- if (TREE_CODE (*tp) == PTRMEM_CST)
- cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (*tp)), 1);
- return 0;
-}
+/* Called via LANGHOOK_CALLGRAPH_ANALYZE_EXPR. It is supposed to mark
+ decls referenced from frontend specific constructs; it will be called
+ only for language-specific tree nodes.
-/* Called via LANGHOOK_CALLGRAPH_LOWER_FUNCTION. It is supposed to lower
- frontend specific constructs that would otherwise confuse the middle end. */
-void
-lower_function (tree fn)
+ Here we must deal with member pointers. */
+
+tree
+cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
+ tree from ATTRIBUTE_UNUSED)
{
- walk_tree_without_duplicates (&DECL_SAVED_TREE (fn), mark_member_pointers,
- NULL);
+ tree t = *tp;
+
+ switch (TREE_CODE (t))
+ {
+ case PTRMEM_CST:
+ if (TYPE_PTRMEMFUNC_P (TREE_TYPE (t)))
+ cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (t)));
+ break;
+
+ default:
+ break;
+ }
+
+ return NULL;
}
/* This routine is called from the last rule in yyparse ().
@@ -2710,12 +2705,12 @@ finish_file ()
them to the beginning of the array, then get rid of the
leftovers. */
n_new = VARRAY_ACTIVE_SIZE (unemitted_tinfo_decls) - n_old;
- memmove (&VARRAY_TREE (unemitted_tinfo_decls, 0),
- &VARRAY_TREE (unemitted_tinfo_decls, n_old),
- n_new * sizeof (tree));
+ if (n_new)
+ memmove (&VARRAY_TREE (unemitted_tinfo_decls, 0),
+ &VARRAY_TREE (unemitted_tinfo_decls, n_old),
+ n_new * sizeof (tree));
memset (&VARRAY_TREE (unemitted_tinfo_decls, n_new),
- 0,
- n_old * sizeof (tree));
+ 0, n_old * sizeof (tree));
VARRAY_ACTIVE_SIZE (unemitted_tinfo_decls) = n_new;
/* The list of objects with static storage duration is built up
@@ -2858,7 +2853,7 @@ finish_file ()
for (i = 0; i < pending_statics_used; ++i)
{
tree decl = VARRAY_TREE (pending_statics, i);
- if (TREE_ASM_WRITTEN (decl))
+ if (var_finalized_p (decl))
continue;
import_export_decl (decl);
if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl))
@@ -2868,6 +2863,9 @@ finish_file ()
&& wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
pending_statics_used))
reconsider = true;
+
+ if (cgraph_assemble_pending_functions ())
+ reconsider = true;
}
while (reconsider);
@@ -2958,27 +2956,25 @@ finish_file ()
input_location = locus;
}
-/* FN is an OFFSET_REF indicating the function to call in parse-tree
- form; it has not yet been semantically analyzed. ARGS are the
- arguments to the function. They have already been semantically
- analzyed. */
+/* FN is an OFFSET_REF, DOTSTAR_EXPR or MEMBER_REF indicating the
+ function to call in parse-tree form; it has not yet been
+ semantically analyzed. ARGS are the arguments to the function.
+ They have already been semantically analyzed. */
tree
build_offset_ref_call_from_tree (tree fn, tree args)
{
- tree object_addr;
tree orig_fn;
tree orig_args;
tree expr;
+ tree object;
orig_fn = fn;
orig_args = args;
+ object = TREE_OPERAND (fn, 0);
if (processing_template_decl)
{
- tree object;
- tree object_type;
-
my_friendly_assert (TREE_CODE (fn) == DOTSTAR_EXPR
|| TREE_CODE (fn) == MEMBER_REF,
20030708);
@@ -2990,10 +2986,9 @@ build_offset_ref_call_from_tree (tree fn, tree args)
parameter. That must be done before the FN is transformed
because we depend on the form of FN. */
args = build_non_dependent_args (args);
- object_type = TREE_TYPE (TREE_OPERAND (fn, 0));
if (TREE_CODE (fn) == DOTSTAR_EXPR)
- object_type = build_pointer_type (non_reference (object_type));
- object = build (NON_DEPENDENT_EXPR, object_type);
+ object = build_unary_op (ADDR_EXPR, object, 0);
+ object = build_non_dependent_expr (object);
args = tree_cons (NULL_TREE, object, args);
/* Now that the arguments are done, transform FN. */
fn = build_non_dependent_expr (fn);
@@ -3007,7 +3002,7 @@ build_offset_ref_call_from_tree (tree fn, tree args)
void B::g() { (this->*p)(); } */
if (TREE_CODE (fn) == OFFSET_REF)
{
- object_addr = build_unary_op (ADDR_EXPR, TREE_OPERAND (fn, 0), 0);
+ tree object_addr = build_unary_op (ADDR_EXPR, object, 0);
fn = TREE_OPERAND (fn, 1);
fn = get_member_function_from_ptrfunc (&object_addr, fn);
args = tree_cons (NULL_TREE, object_addr, args);
@@ -3015,7 +3010,7 @@ build_offset_ref_call_from_tree (tree fn, tree args)
expr = build_function_call (fn, args);
if (processing_template_decl && expr != error_mark_node)
- return build_min (CALL_EXPR, TREE_TYPE (expr), orig_fn, orig_args);
+ return build_min_non_dep (CALL_EXPR, expr, orig_fn, orig_args);
return expr;
}
@@ -3229,10 +3224,8 @@ ambiguous_decl (tree name, cxx_binding *old, cxx_binding *new, int flags)
if (flags & LOOKUP_COMPLAIN)
{
error ("`%D' denotes an ambiguous type",name);
- error ("%H first type here",
- &DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (BINDING_TYPE (old))));
- error ("%H other type here",
- &DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)));
+ error ("%J first type here", TYPE_MAIN_DECL (BINDING_TYPE (old)));
+ error ("%J other type here", TYPE_MAIN_DECL (type));
}
}
return old;
@@ -3485,6 +3478,8 @@ add_function (struct arg_lookup *k, tree fn)
/* We must find only functions, or exactly one non-function. */
if (!k->functions)
k->functions = fn;
+ else if (fn == k->functions)
+ ;
else if (is_overloaded_fn (k->functions) && is_overloaded_fn (fn))
k->functions = build_overload (fn, k->functions);
else
@@ -3731,7 +3726,7 @@ arg_assoc (struct arg_lookup *k, tree n)
tree template = TREE_OPERAND (n, 0);
tree args = TREE_OPERAND (n, 1);
tree ctx;
- tree arg;
+ int ix;
if (TREE_CODE (template) == COMPONENT_REF)
template = TREE_OPERAND (template, 1);
@@ -3754,8 +3749,8 @@ arg_assoc (struct arg_lookup *k, tree n)
return true;
/* Now the arguments. */
- for (arg = args; arg != NULL_TREE; arg = TREE_CHAIN (arg))
- if (arg_assoc_template_arg (k, TREE_VALUE (arg)) == 1)
+ for (ix = TREE_VEC_LENGTH (args); ix--;)
+ if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1)
return true;
}
else
@@ -4061,8 +4056,8 @@ do_local_using_decl (tree decl)
tree
do_class_using_decl (tree decl)
{
- tree name, value;
-
+ tree name, value, scope, type;
+
if (TREE_CODE (decl) != SCOPE_REF
|| !TREE_OPERAND (decl, 0)
|| !TYPE_P (TREE_OPERAND (decl, 0)))
@@ -4070,50 +4065,30 @@ do_class_using_decl (tree decl)
error ("using-declaration for non-member at class scope");
return NULL_TREE;
}
+ scope = TREE_OPERAND (decl, 0);
name = TREE_OPERAND (decl, 1);
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
- error ("using-declaration for destructor");
- return NULL_TREE;
- }
- else if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
- {
- name = TREE_OPERAND (name, 0);
- error ("a using-declaration cannot specify a template-id. Try `using %T::%D'", TREE_OPERAND (decl, 0), name);
+ error ("using-declaration cannot name destructor");
return NULL_TREE;
}
if (TREE_CODE (name) == TYPE_DECL)
- {
- tree type = TREE_TYPE (name);
- if (CLASSTYPE_USE_TEMPLATE (TREE_TYPE (name)))
- {
- name = DECL_NAME (CLASSTYPE_TI_TEMPLATE (type));
- error ("a using-declaration cannot specify a template-id.");
- return NULL_TREE;
- }
- name = DECL_NAME (name);
- }
+ name = DECL_NAME (name);
else if (TREE_CODE (name) == TEMPLATE_DECL)
name = DECL_NAME (name);
else if (BASELINK_P (name))
{
- tree fns;
-
- fns = BASELINK_FUNCTIONS (name);
- if (TREE_CODE (fns) == TEMPLATE_ID_EXPR)
- {
- fns = TREE_OPERAND (fns, 0);
- error ("a using-declaration cannot specify a template-id. Try `using %T::%D'",
- BASELINK_ACCESS_BINFO (name),
- DECL_NAME (get_first_fn (fns)));
- }
+ tree fns = BASELINK_FUNCTIONS (name);
name = DECL_NAME (get_first_fn (fns));
}
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716);
- value = build_lang_decl (USING_DECL, name, void_type_node);
- DECL_INITIAL (value) = TREE_OPERAND (decl, 0);
+ /* Dependent using decls have a NULL type, non-dependent ones have a
+ void type. */
+ type = dependent_type_p (scope) ? NULL_TREE : void_type_node;
+ value = build_lang_decl (USING_DECL, name, type);
+ DECL_INITIAL (value) = scope;
return value;
}
@@ -4236,94 +4211,4 @@ mark_used (tree decl)
}
}
-/* Called when a class-head is encountered. TAG_KIND is the class-key
- for the class. SCOPE, if non-NULL, is the type or namespace
- indicated in the nested-name-specifier for the declaration of the
- class. ID is the name of the class, if any; it may be a TYPE_DECL,
- or an IDENTIFIER_NODE. ATTRIBUTES are attributes that apply to the
- class.
-
- Return a TYPE_DECL for the class being defined. */
-
-tree
-handle_class_head (enum tag_types tag_kind, tree scope, tree id,
- tree attributes)
-{
- tree decl = NULL_TREE;
- tree current = current_scope ();
- bool xrefd_p = false;
- bool new_type_p;
- tree context;
-
- if (current == NULL_TREE)
- current = current_namespace;
-
- if (scope)
- {
- if (TREE_CODE (id) == TYPE_DECL)
- /* We must bash typedefs back to the main decl of the
- type. Otherwise we become confused about scopes. */
- decl = TYPE_MAIN_DECL (TREE_TYPE (id));
- else if (DECL_CLASS_TEMPLATE_P (id))
- decl = DECL_TEMPLATE_RESULT (id);
- else
- {
- if (TYPE_P (scope))
- {
- /* According to the suggested resolution of core issue
- 180, 'typename' is assumed after a class-key. */
- decl = make_typename_type (scope, id, tf_error);
- if (decl != error_mark_node)
- decl = TYPE_MAIN_DECL (decl);
- else
- decl = NULL_TREE;
- }
- else if (scope == current)
- {
- /* We've been given AGGR SCOPE::ID, when we're already
- inside SCOPE. Be nice about it. */
- if (pedantic)
- pedwarn ("extra qualification `%T::' on member `%D' ignored",
- scope, id);
- }
- else
- error ("`%T' does not have a class or union named `%D'",
- scope, id);
- }
- }
-
- if (!decl)
- {
- decl = xref_tag (tag_kind, id, attributes, false);
- if (decl == error_mark_node)
- return error_mark_node;
- decl = TYPE_MAIN_DECL (decl);
- xrefd_p = true;
- }
-
- if (!TYPE_BINFO (TREE_TYPE (decl)))
- {
- error ("`%T' is not a class or union type", decl);
- return error_mark_node;
- }
-
- /* For a definition, we want to enter the containing scope before
- looking up any base classes etc. Only do so, if this is different
- to the current scope. */
- context = CP_DECL_CONTEXT (decl);
-
- new_type_p = (current != context
- && TREE_CODE (context) != TEMPLATE_TYPE_PARM
- && TREE_CODE (context) != BOUND_TEMPLATE_TEMPLATE_PARM);
- if (new_type_p)
- push_scope (context);
-
- if (!xrefd_p
- && PROCESSING_REAL_TEMPLATE_DECL_P ()
- && !CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
- decl = push_template_decl (decl);
-
- return decl;
-}
-
#include "gt-cp-decl2.h"
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index c8091892cb7..b48f25b7752 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -237,18 +237,13 @@ cp_dump_tree (void* dump_info, tree t)
}
break;
- case POINTER_TYPE:
- if (TYPE_PTRMEM_P (t))
- {
- dump_string (di, "ptrmem");
- dump_child ("ptd", TYPE_PTRMEM_POINTED_TO_TYPE (t));
- dump_child ("cls", TYPE_PTRMEM_CLASS_TYPE (t));
- return true;
- }
- break;
+ case OFFSET_TYPE:
+ dump_string (di, "ptrmem");
+ dump_child ("ptd", TYPE_PTRMEM_POINTED_TO_TYPE (t));
+ dump_child ("cls", TYPE_PTRMEM_CLASS_TYPE (t));
+ return true;
case RECORD_TYPE:
- case UNION_TYPE:
if (TYPE_PTRMEMFUNC_P (t))
{
dump_string (di, "ptrmem");
@@ -256,7 +251,9 @@ cp_dump_tree (void* dump_info, tree t)
dump_child ("cls", TYPE_PTRMEM_CLASS_TYPE (t));
return true;
}
+ /* Fall through. */
+ case UNION_TYPE:
/* Is it a type used as a base? */
if (TYPE_CONTEXT (t) && TREE_CODE (TYPE_CONTEXT (t)) == TREE_CODE (t)
&& CLASSTYPE_AS_BASE (TYPE_CONTEXT (t)) == t)
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 79803d2dfff..a10dcf6a876 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -30,32 +30,21 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "diagnostic.h"
#include "langhooks-def.h"
+#include "cxx-pretty-print.h"
enum pad { none, before, after };
-#define sorry_for_unsupported_tree(T) \
- sorry ("`%s' not supported by %s", tree_code_name[(int) TREE_CODE (T)], \
- __FUNCTION__)
-
-#define print_scope_operator(BUFFER) output_add_string ((BUFFER), "::")
-#define print_left_paren(BUFFER) output_add_character ((BUFFER), '(')
-#define print_right_paren(BUFFER) output_add_character ((BUFFER), ')')
-#define print_left_bracket(BUFFER) output_add_character ((BUFFER), '[')
-#define print_right_bracket(BUFFER) output_add_character ((BUFFER), ']')
-#define print_template_argument_list_start(BUFFER) \
- print_non_consecutive_character ((BUFFER), '<')
-#define print_template_argument_list_end(BUFFER) \
- print_non_consecutive_character ((BUFFER), '>')
-#define print_tree_identifier(BUFFER, TID) \
- output_add_string ((BUFFER), IDENTIFIER_POINTER (TID))
-#define print_identifier(BUFFER, ID) output_add_string ((BUFFER), (ID))
-#define separate_with_comma(BUFFER) output_add_string ((BUFFER), ", ")
+#define pp_template_argument_list_start(PP) \
+ pp_non_consecutive_character (PP, '<')
+#define pp_template_argument_list_end(PP) \
+ pp_non_consecutive_character (PP, '>')
+#define pp_separate_with_comma(PP) pp_string (PP, ", ")
/* The global buffer where we dump everything. It is there only for
transitional purpose. It is expected, in the near future, to be
completely removed. */
-static output_buffer scratch_buffer_rec;
-static output_buffer *scratch_buffer = &scratch_buffer_rec;
+static cxx_pretty_printer scratch_pretty_printer;
+#define cxx_pp (&scratch_pretty_printer)
# define NEXT_CODE(T) (TREE_CODE (TREE_TYPE (T)))
@@ -89,7 +78,6 @@ static void dump_function_name (tree, int);
static void dump_expr_list (tree, int);
static void dump_global_iord (tree);
static enum pad dump_qualifiers (tree, enum pad);
-static void dump_char (int);
static void dump_parameters (tree, int);
static void dump_exception_spec (tree, int);
static const char *class_key_or_enum (tree);
@@ -109,8 +97,8 @@ static void cp_diagnostic_starter (diagnostic_context *, diagnostic_info *);
static void cp_diagnostic_finalizer (diagnostic_context *, diagnostic_info *);
static void cp_print_error_function (diagnostic_context *, diagnostic_info *);
-static bool cp_printer (output_buffer *, text_info *);
-static void print_non_consecutive_character (output_buffer *, int);
+static bool cp_printer (pretty_printer *, text_info *);
+static void pp_non_consecutive_character (cxx_pretty_printer *, int);
static tree locate_error (const char *, va_list);
static location_t location_of (tree);
@@ -121,7 +109,8 @@ init_error (void)
diagnostic_finalizer (global_dc) = cp_diagnostic_finalizer;
diagnostic_format_decoder (global_dc) = cp_printer;
- init_output_buffer (scratch_buffer, /* prefix */NULL, /* line-width */0);
+ pp_construct (pp_base (cxx_pp), NULL, 0);
+ pp_cxx_pretty_printer_init (cxx_pp);
}
/* Dump a scope, if deemed necessary. */
@@ -139,18 +128,18 @@ dump_scope (tree scope, int flags)
if (scope != global_namespace)
{
dump_decl (scope, f);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
}
}
else if (AGGREGATE_TYPE_P (scope))
{
dump_type (scope, f);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
}
else if ((flags & TFF_SCOPE) && TREE_CODE (scope) == FUNCTION_DECL)
{
dump_function_decl (scope, f);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
}
}
@@ -174,12 +163,12 @@ dump_qualifiers (tree t, enum pad p)
if (masks[ix] & quals)
{
if (p == before)
- output_add_space (scratch_buffer);
+ pp_space (cxx_pp);
p = before;
- print_identifier (scratch_buffer, names[ix]);
+ pp_identifier (cxx_pp, names[ix]);
}
if (do_after)
- output_add_space (scratch_buffer);
+ pp_space (cxx_pp);
}
else
p = none;
@@ -210,7 +199,7 @@ dump_template_argument_list (tree args, int flags)
for (i = 0; i< n; ++i)
{
if (need_comma)
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
dump_template_argument (TREE_VEC_ELT (args, i), flags);
need_comma = 1;
}
@@ -228,24 +217,24 @@ dump_template_parameter (tree parm, int flags)
{
if (flags & TFF_DECL_SPECIFIERS)
{
- print_identifier (scratch_buffer, "class");
+ pp_identifier (cxx_pp, "class");
if (DECL_NAME (p))
{
- output_add_space (scratch_buffer);
- print_tree_identifier (scratch_buffer, DECL_NAME (p));
+ pp_space (cxx_pp);
+ pp_tree_identifier (cxx_pp, DECL_NAME (p));
}
}
else if (DECL_NAME (p))
- print_tree_identifier (scratch_buffer, DECL_NAME (p));
+ pp_tree_identifier (cxx_pp, DECL_NAME (p));
else
- print_identifier (scratch_buffer, "{template default argument error}");
+ pp_cxx_canonical_template_parameter (cxx_pp, TREE_TYPE (p));
}
else
dump_decl (p, flags | TFF_DECL_SPECIFIERS);
if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && a != NULL_TREE)
{
- output_add_string (scratch_buffer, " = ");
+ pp_string (cxx_pp, " = ");
if (TREE_CODE (p) == TYPE_DECL || TREE_CODE (p) == TEMPLATE_DECL)
dump_type (a, flags & ~TFF_CHASE_TYPEDEF);
else
@@ -282,13 +271,13 @@ dump_template_bindings (tree parms, tree args)
}
if (need_comma)
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
dump_template_parameter (TREE_VEC_ELT (p, i), TFF_PLAIN_IDENTIFIER);
- output_add_string (scratch_buffer, " = ");
+ pp_string (cxx_pp, " = ");
if (arg)
dump_template_argument (arg, TFF_PLAIN_IDENTIFIER);
else
- print_identifier (scratch_buffer, "<missing>");
+ pp_identifier (cxx_pp, "<missing>");
++arg_idx;
need_comma = 1;
@@ -313,7 +302,7 @@ dump_type (tree t, int flags)
switch (TREE_CODE (t))
{
case UNKNOWN_TYPE:
- print_identifier (scratch_buffer, "<unknown type>");
+ pp_identifier (cxx_pp, "<unknown type>");
break;
case TREE_LIST:
@@ -322,7 +311,7 @@ dump_type (tree t, int flags)
break;
case IDENTIFIER_NODE:
- print_tree_identifier (scratch_buffer, t);
+ pp_tree_identifier (cxx_pp, t);
break;
case TREE_VEC:
@@ -349,73 +338,41 @@ dump_type (tree t, int flags)
dump_decl (t, flags & ~TFF_DECL_SPECIFIERS);
break;
- case COMPLEX_TYPE:
- output_add_string (scratch_buffer, "__complex__ ");
- dump_type (TREE_TYPE (t), flags);
- break;
-
- case VECTOR_TYPE:
- output_add_string (scratch_buffer, "__vector__ ");
- {
- /* The subtype of a VECTOR_TYPE is something like intQI_type_node,
- which has no name and is not very useful for diagnostics. So
- look up the equivalent C type and print its name. */
- tree elt = TREE_TYPE (t);
- elt = c_common_type_for_mode (TYPE_MODE (elt), TREE_UNSIGNED (elt));
- dump_type (elt, flags);
- }
- break;
-
case INTEGER_TYPE:
- if (!TREE_UNSIGNED (TYPE_MAIN_VARIANT (t)) && TREE_UNSIGNED (t))
- output_add_string (scratch_buffer, "unsigned ");
- else if (TREE_UNSIGNED (TYPE_MAIN_VARIANT (t)) && !TREE_UNSIGNED (t))
- output_add_string (scratch_buffer, "signed ");
-
- /* fall through. */
case REAL_TYPE:
case VOID_TYPE:
case BOOLEAN_TYPE:
- {
- tree type;
- dump_qualifiers (t, after);
- type = flags & TFF_CHASE_TYPEDEF ? TYPE_MAIN_VARIANT (t) : t;
- if (TYPE_NAME (type) && TYPE_IDENTIFIER (type))
- print_tree_identifier (scratch_buffer, TYPE_IDENTIFIER (type));
- else
- /* Types like intQI_type_node and friends have no names.
- These don't come up in user error messages, but it's nice
- to be able to print them from the debugger. */
- print_identifier (scratch_buffer, "<anonymous>");
- }
+ case COMPLEX_TYPE:
+ case VECTOR_TYPE:
+ pp_base (cxx_pp)->padding = pp_none;
+ pp_type_specifier_seq (cxx_pp, t);
break;
case TEMPLATE_TEMPLATE_PARM:
/* For parameters inside template signature. */
if (TYPE_IDENTIFIER (t))
- print_tree_identifier (scratch_buffer, TYPE_IDENTIFIER (t));
+ pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t));
else
- print_identifier
- (scratch_buffer, "<anonymous template template parameter>");
+ pp_cxx_canonical_template_parameter (cxx_pp, t);
break;
case BOUND_TEMPLATE_TEMPLATE_PARM:
{
tree args = TYPE_TI_ARGS (t);
- print_tree_identifier (scratch_buffer, TYPE_IDENTIFIER (t));
- print_template_argument_list_start (scratch_buffer);
+ pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t));
+ pp_template_argument_list_start (cxx_pp);
dump_template_argument_list (args, flags);
- print_template_argument_list_end (scratch_buffer);
+ pp_template_argument_list_end (cxx_pp);
}
break;
case TEMPLATE_TYPE_PARM:
dump_qualifiers (t, after);
if (TYPE_IDENTIFIER (t))
- print_tree_identifier (scratch_buffer, TYPE_IDENTIFIER (t));
+ pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t));
else
- print_identifier
- (scratch_buffer, "<anonymous template type parameter>");
+ pp_cxx_canonical_template_parameter
+ (cxx_pp, TEMPLATE_TYPE_PARM_INDEX (t));
break;
/* This is not always necessary for pointers and such, but doing this
@@ -434,29 +391,29 @@ dump_type (tree t, int flags)
}
case TYPENAME_TYPE:
dump_qualifiers (t, after);
- output_add_string (scratch_buffer, "typename ");
+ pp_string (cxx_pp, "typename ");
dump_typename (t, flags);
break;
case UNBOUND_CLASS_TEMPLATE:
dump_type (TYPE_CONTEXT (t), flags);
- print_scope_operator (scratch_buffer);
- print_identifier (scratch_buffer, "template ");
+ pp_colon_colon (cxx_pp);
+ pp_identifier (cxx_pp, "template ");
dump_type (DECL_NAME (TYPE_NAME (t)), flags);
break;
case TYPEOF_TYPE:
- output_add_string (scratch_buffer, "__typeof (");
+ pp_string (cxx_pp, "__typeof (");
dump_expr (TYPE_FIELDS (t), flags & ~TFF_EXPR_IN_PARENS);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
break;
default:
- sorry_for_unsupported_tree (t);
+ pp_unsupported_tree (cxx_pp, t);
/* Fall through to error. */
case ERROR_MARK:
- print_identifier (scratch_buffer, "<type error>");
+ pp_identifier (cxx_pp, "<type error>");
break;
}
}
@@ -473,7 +430,7 @@ dump_typename (tree t, int flags)
dump_typename (ctx, flags);
else
dump_type (ctx, flags & ~TFF_CLASS_KEY_OR_ENUM);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
dump_decl (TYPENAME_TYPE_FULLNAME (t), flags);
}
@@ -507,8 +464,8 @@ dump_aggr_type (tree t, int flags)
if (flags & TFF_CLASS_KEY_OR_ENUM)
{
- print_identifier (scratch_buffer, variety);
- output_add_space (scratch_buffer);
+ pp_identifier (cxx_pp, variety);
+ pp_space (cxx_pp);
}
if (flags & TFF_CHASE_TYPEDEF)
@@ -542,12 +499,12 @@ dump_aggr_type (tree t, int flags)
if (name == 0 || ANON_AGGRNAME_P (name))
{
if (flags & TFF_CLASS_KEY_OR_ENUM)
- print_identifier (scratch_buffer, "<anonymous>");
+ pp_identifier (cxx_pp, "<anonymous>");
else
- output_printf (scratch_buffer, "<anonymous %s>", variety);
+ pp_printf (pp_base (cxx_pp), "<anonymous %s>", variety);
}
else
- print_tree_identifier (scratch_buffer, name);
+ pp_tree_identifier (cxx_pp, name);
if (tmplate)
dump_template_parms (TYPE_TEMPLATE_INFO (t),
!CLASSTYPE_USE_TEMPLATE (t),
@@ -587,19 +544,13 @@ dump_type_prefix (tree t, int flags)
tree sub = TREE_TYPE (t);
padding = dump_type_prefix (sub, flags);
- /* A tree for a member pointer looks like pointer to offset,
- so let the OFFSET_TYPE case handle it. */
- if (!TYPE_PTRMEM_P (t))
+ if (TREE_CODE (sub) == ARRAY_TYPE)
{
- if (TREE_CODE (sub) == ARRAY_TYPE)
- {
- output_add_space (scratch_buffer);
- print_left_paren (scratch_buffer);
- }
- output_add_character
- (scratch_buffer, "&*"[TREE_CODE (t) == POINTER_TYPE]);
- padding = dump_qualifiers (t, before);
+ pp_space (cxx_pp);
+ pp_left_paren (cxx_pp);
}
+ pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]);
+ padding = dump_qualifiers (t, before);
}
break;
@@ -609,11 +560,11 @@ dump_type_prefix (tree t, int flags)
if (TREE_CODE (t) == OFFSET_TYPE) /* pmfs deal with this in d_t_p */
{
if (padding != none)
- output_add_space (scratch_buffer);
+ pp_space (cxx_pp);
dump_type (TYPE_OFFSET_BASETYPE (t), flags);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
}
- output_add_character (scratch_buffer, '*');
+ pp_star (cxx_pp);
padding = dump_qualifiers (t, none);
break;
@@ -622,19 +573,19 @@ dump_type_prefix (tree t, int flags)
case FUNCTION_TYPE:
padding = dump_type_prefix (TREE_TYPE (t), flags);
if (padding != none)
- output_add_space (scratch_buffer);
- print_left_paren (scratch_buffer);
+ pp_space (cxx_pp);
+ pp_left_paren (cxx_pp);
padding = none;
break;
case METHOD_TYPE:
padding = dump_type_prefix (TREE_TYPE (t), flags);
if (padding != none)
- output_add_space (scratch_buffer);
- print_left_paren (scratch_buffer);
+ pp_space (cxx_pp);
+ pp_left_paren (cxx_pp);
padding = none;
dump_aggr_type (TYPE_METHOD_BASETYPE (t), flags);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
break;
case ARRAY_TYPE:
@@ -665,10 +616,10 @@ dump_type_prefix (tree t, int flags)
break;
default:
- sorry_for_unsupported_tree (t);
+ pp_unsupported_tree (cxx_pp, t);
/* fall through. */
case ERROR_MARK:
- print_identifier (scratch_buffer, "<typeprefixerror>");
+ pp_identifier (cxx_pp, "<typeprefixerror>");
break;
}
return padding;
@@ -689,7 +640,7 @@ dump_type_suffix (tree t, int flags)
case REFERENCE_TYPE:
case OFFSET_TYPE:
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
dump_type_suffix (TREE_TYPE (t), flags);
break;
@@ -698,7 +649,7 @@ dump_type_suffix (tree t, int flags)
case METHOD_TYPE:
{
tree arg;
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
arg = TYPE_ARG_TYPES (t);
if (TREE_CODE (t) == METHOD_TYPE)
arg = TREE_CHAIN (arg);
@@ -716,13 +667,12 @@ dump_type_suffix (tree t, int flags)
}
case ARRAY_TYPE:
- print_left_bracket (scratch_buffer);
+ pp_left_bracket (cxx_pp);
if (TYPE_DOMAIN (t))
{
if (host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0))
- output_host_wide_integer
- (scratch_buffer,
- tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1);
+ pp_wide_integer
+ (cxx_pp, tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1);
else if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) == MINUS_EXPR)
dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0),
flags & ~TFF_EXPR_IN_PARENS);
@@ -732,7 +682,7 @@ dump_type_suffix (tree t, int flags)
integer_one_node)),
flags & ~TFF_EXPR_IN_PARENS);
}
- print_right_bracket (scratch_buffer);
+ pp_right_bracket (cxx_pp);
dump_type_suffix (TREE_TYPE (t), flags);
break;
@@ -758,7 +708,7 @@ dump_type_suffix (tree t, int flags)
break;
default:
- sorry_for_unsupported_tree (t);
+ pp_unsupported_tree (cxx_pp, t);
case ERROR_MARK:
/* Don't mark it here, we should have already done in
dump_type_prefix. */
@@ -778,7 +728,7 @@ dump_global_iord (tree t)
else
abort ();
- output_printf (scratch_buffer, "(static %s for %s)", p, input_filename);
+ pp_printf (pp_base (cxx_pp), "(static %s for %s)", p, input_filename);
}
static void
@@ -787,14 +737,14 @@ dump_simple_decl (tree t, tree type, int flags)
if (flags & TFF_DECL_SPECIFIERS)
{
if (dump_type_prefix (type, flags) != none)
- output_add_space (scratch_buffer);
+ pp_space (cxx_pp);
}
if (!DECL_INITIAL (t) || TREE_CODE (DECL_INITIAL (t)) != TEMPLATE_PARM_INDEX)
dump_scope (CP_DECL_CONTEXT (t), flags);
if (DECL_NAME (t))
dump_decl (DECL_NAME (t), flags);
else
- print_identifier (scratch_buffer, "<anonymous>");
+ pp_identifier (cxx_pp, "<anonymous>");
if (flags & TFF_DECL_SPECIFIERS)
dump_type_suffix (type, flags);
}
@@ -817,14 +767,14 @@ dump_decl (tree t, int flags)
if ((flags & TFF_DECL_SPECIFIERS)
&& TREE_CODE (TREE_TYPE (t)) == TEMPLATE_TYPE_PARM)
/* Say `class T' not just `T'. */
- output_add_string (scratch_buffer, "class ");
+ pp_string (cxx_pp, "class ");
dump_type (TREE_TYPE (t), flags);
break;
}
}
if (flags & TFF_DECL_SPECIFIERS)
- output_add_string (scratch_buffer, "typedef ");
+ pp_string (cxx_pp, "typedef ");
dump_simple_decl (t, DECL_ORIGINAL_TYPE (t)
? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t),
flags);
@@ -833,7 +783,7 @@ dump_decl (tree t, int flags)
case VAR_DECL:
if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t)))
{
- output_add_string (scratch_buffer, "vtable for ");
+ pp_string (cxx_pp, "vtable for ");
my_friendly_assert (TYPE_P (DECL_CONTEXT (t)), 20010720);
dump_type (DECL_CONTEXT (t), flags);
break;
@@ -845,29 +795,34 @@ dump_decl (tree t, int flags)
break;
case RESULT_DECL:
- output_add_string (scratch_buffer, "<return value> ");
+ pp_string (cxx_pp, "<return value> ");
dump_simple_decl (t, TREE_TYPE (t), flags);
break;
case NAMESPACE_DECL:
- dump_scope (CP_DECL_CONTEXT (t), flags);
- if (DECL_NAME (t) == anonymous_namespace_name)
- print_identifier (scratch_buffer, "<unnamed>");
+ if (flags & TFF_DECL_SPECIFIERS)
+ pp_cxx_declaration (cxx_pp, t);
else
- print_tree_identifier (scratch_buffer, DECL_NAME (t));
+ {
+ dump_scope (CP_DECL_CONTEXT (t), flags);
+ if (DECL_NAME (t) == anonymous_namespace_name)
+ pp_identifier (cxx_pp, "<unnamed>");
+ else
+ pp_tree_identifier (cxx_pp, DECL_NAME (t));
+ }
break;
case SCOPE_REF:
dump_decl (TREE_OPERAND (t, 0), flags & ~TFF_DECL_SPECIFIERS);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
dump_decl (TREE_OPERAND (t, 1), flags);
break;
case ARRAY_REF:
dump_decl (TREE_OPERAND (t, 0), flags);
- print_left_bracket (scratch_buffer);
+ pp_left_bracket (cxx_pp);
dump_decl (TREE_OPERAND (t, 1), flags);
- print_right_bracket (scratch_buffer);
+ pp_right_bracket (cxx_pp);
break;
/* So that we can do dump_decl on an aggr type. */
@@ -880,7 +835,7 @@ dump_decl (tree t, int flags)
case BIT_NOT_EXPR:
/* This is a pseudo destructor call which has not been folded into
a PSEUDO_DTOR_EXPR yet. */
- output_add_character (scratch_buffer, '~');
+ pp_complement (cxx_pp);
dump_type (TREE_OPERAND (t, 0), flags);
break;
@@ -893,13 +848,13 @@ dump_decl (tree t, int flags)
case IDENTIFIER_NODE:
if (IDENTIFIER_TYPENAME_P (t))
{
- output_add_string (scratch_buffer, "operator ");
+ pp_string (cxx_pp, "operator ");
/* Not exactly IDENTIFIER_TYPE_VALUE. */
dump_type (TREE_TYPE (t), flags);
break;
}
else
- print_tree_identifier (scratch_buffer, t);
+ pp_tree_identifier (cxx_pp, t);
break;
case OVERLOAD:
@@ -909,12 +864,12 @@ dump_decl (tree t, int flags)
if (DECL_CLASS_SCOPE_P (t))
{
dump_type (DECL_CONTEXT (t), flags);
- output_add_string (scratch_buffer, "::");
+ pp_colon_colon (cxx_pp);
}
else if (DECL_CONTEXT (t))
{
dump_decl (DECL_CONTEXT (t), flags);
- output_add_string (scratch_buffer, "::");
+ pp_colon_colon (cxx_pp);
}
dump_decl (DECL_NAME (t), flags);
break;
@@ -929,7 +884,7 @@ dump_decl (tree t, int flags)
if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
dump_global_iord (t);
else if (! DECL_LANG_SPECIFIC (t))
- print_identifier (scratch_buffer, "<internal>");
+ pp_identifier (cxx_pp, "<internal>");
else
dump_function_decl (t, flags);
break;
@@ -940,28 +895,20 @@ dump_decl (tree t, int flags)
case TEMPLATE_ID_EXPR:
{
- tree args;
tree name = TREE_OPERAND (t, 0);
+
if (is_overloaded_fn (name))
name = DECL_NAME (get_first_fn (name));
dump_decl (name, flags);
- print_template_argument_list_start (scratch_buffer);
- for (args = TREE_OPERAND (t, 1); args; args = TREE_CHAIN (args))
- {
- dump_template_argument (TREE_VALUE (args), flags);
- if (TREE_CHAIN (args))
- separate_with_comma (scratch_buffer);
- }
- print_template_argument_list_end (scratch_buffer);
+ pp_template_argument_list_start (cxx_pp);
+ if (TREE_OPERAND (t, 1))
+ dump_template_argument_list (TREE_OPERAND (t, 1), flags);
+ pp_template_argument_list_end (cxx_pp);
}
break;
- case LOOKUP_EXPR:
- dump_decl (TREE_OPERAND (t, 0), flags);
- break;
-
case LABEL_DECL:
- print_tree_identifier (scratch_buffer, DECL_NAME (t));
+ pp_tree_identifier (cxx_pp, DECL_NAME (t));
break;
case CONST_DECL:
@@ -974,13 +921,13 @@ dump_decl (tree t, int flags)
else if (DECL_INITIAL (t))
dump_expr (DECL_INITIAL (t), flags | TFF_EXPR_IN_PARENS);
else
- print_identifier (scratch_buffer, "<enumerator>");
+ pp_identifier (cxx_pp, "<enumerator>");
break;
case USING_DECL:
- output_add_string (scratch_buffer, "using ");
+ pp_string (cxx_pp, "using ");
dump_type (DECL_INITIAL (t), flags);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
dump_decl (DECL_NAME (t), flags);
break;
@@ -993,11 +940,11 @@ dump_decl (tree t, int flags)
break;
default:
- sorry_for_unsupported_tree (t);
+ pp_unsupported_tree (cxx_pp, t);
/* Fallthrough to error. */
case ERROR_MARK:
- print_identifier (scratch_buffer, "<declaration error>");
+ pp_identifier (cxx_pp, "<declaration error>");
break;
}
}
@@ -1021,7 +968,7 @@ dump_template_decl (tree t, int flags)
tree inner_parms = INNERMOST_TEMPLATE_PARMS (parms);
int len = TREE_VEC_LENGTH (inner_parms);
- output_add_string (scratch_buffer, "template<");
+ pp_string (cxx_pp, "template<");
/* If we've shown the template prefix, we'd better show the
parameters' and decl's type too. */
@@ -1030,17 +977,17 @@ dump_template_decl (tree t, int flags)
for (i = 0; i < len; i++)
{
if (i)
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
dump_template_parameter (TREE_VEC_ELT (inner_parms, i), flags);
}
- print_template_argument_list_end (scratch_buffer);
- output_add_space (scratch_buffer);
+ pp_template_argument_list_end (cxx_pp);
+ pp_space (cxx_pp);
}
nreverse(orig_parms);
if (DECL_TEMPLATE_TEMPLATE_PARM_P (t))
/* Say `template<arg> class TT' not just `template<arg> TT'. */
- output_add_string (scratch_buffer, "class ");
+ pp_string (cxx_pp, "class ");
}
if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL)
@@ -1110,9 +1057,9 @@ dump_function_decl (tree t, int flags)
if (!(flags & TFF_DECL_SPECIFIERS))
/* OK */;
else if (DECL_STATIC_FUNCTION_P (t))
- print_identifier (scratch_buffer, "static ");
+ pp_identifier (cxx_pp, "static ");
else if (DECL_VIRTUAL_P (t))
- print_identifier (scratch_buffer, "virtual ");
+ pp_identifier (cxx_pp, "virtual ");
/* Print the return type? */
if (show_return)
@@ -1121,14 +1068,14 @@ dump_function_decl (tree t, int flags)
if (show_return)
{
dump_type_prefix (TREE_TYPE (fntype), flags);
- output_add_space (scratch_buffer);
+ pp_space (cxx_pp);
}
/* Print the function name. */
if (cname)
{
dump_type (cname, flags);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
}
else
dump_scope (CP_DECL_CONTEXT (t), flags);
@@ -1153,9 +1100,9 @@ dump_function_decl (tree t, int flags)
/* If T is a template instantiation, dump the parameter binding. */
if (template_parms != NULL_TREE && template_args != NULL_TREE)
{
- output_add_string (scratch_buffer, " [with ");
+ pp_string (cxx_pp, " [with ");
dump_template_bindings (template_parms, template_args);
- print_right_bracket (scratch_buffer);
+ pp_right_bracket (cxx_pp);
}
}
@@ -1168,29 +1115,29 @@ dump_parameters (tree parmtypes, int flags)
{
int first;
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
for (first = 1; parmtypes != void_list_node;
parmtypes = TREE_CHAIN (parmtypes))
{
if (!first)
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
first = 0;
if (!parmtypes)
{
- print_identifier (scratch_buffer, "...");
+ pp_identifier (cxx_pp, "...");
break;
}
dump_type (TREE_VALUE (parmtypes), flags);
if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && TREE_PURPOSE (parmtypes))
{
- output_add_string (scratch_buffer, " = ");
+ pp_string (cxx_pp, " = ");
dump_expr (TREE_PURPOSE (parmtypes), flags | TFF_EXPR_IN_PARENS);
}
}
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
/* Print an exception specification. T is the exception specification. */
@@ -1200,7 +1147,7 @@ dump_exception_spec (tree t, int flags)
{
if (t)
{
- output_add_string (scratch_buffer, " throw (");
+ pp_string (cxx_pp, " throw (");
if (TREE_VALUE (t) != NULL_TREE)
while (1)
{
@@ -1208,9 +1155,9 @@ dump_exception_spec (tree t, int flags)
t = TREE_CHAIN (t);
if (!t)
break;
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
}
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
}
@@ -1232,7 +1179,7 @@ dump_function_name (tree t, int flags)
if (DECL_DESTRUCTOR_P (t))
{
- output_add_character (scratch_buffer, '~');
+ pp_complement (cxx_pp);
dump_decl (name, TFF_PLAIN_IDENTIFIER);
}
else if (DECL_CONV_FN_P (t))
@@ -1243,11 +1190,11 @@ dump_function_name (tree t, int flags)
declarations, both will have the same name, yet
the types will be different, hence the TREE_TYPE field
of the first name will be clobbered by the second. */
- output_add_string (scratch_buffer, "operator ");
+ pp_string (cxx_pp, "operator ");
dump_type (TREE_TYPE (TREE_TYPE (t)), flags);
}
else if (IDENTIFIER_OPNAME_P (name))
- print_tree_identifier (scratch_buffer, name);
+ pp_tree_identifier (cxx_pp, name);
else
dump_decl (name, flags);
@@ -1274,47 +1221,30 @@ dump_template_parms (tree info, int primary, int flags)
if (primary && flags & TFF_TEMPLATE_NAME)
return;
flags &= ~(TFF_CLASS_KEY_OR_ENUM | TFF_TEMPLATE_NAME);
- print_template_argument_list_start (scratch_buffer);
+ pp_template_argument_list_start (cxx_pp);
/* Be careful only to print things when we have them, so as not
to crash producing error messages. */
if (args && !primary)
{
- int len = 0;
- int ix = 0;
- int need_comma = 0;
+ int len, ix;
- if (TREE_CODE (args) == TREE_VEC)
- {
- if (TREE_VEC_LENGTH (args) > 0
- && TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
- args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
+ if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args))
+ args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
+
+ len = TREE_VEC_LENGTH (args);
- len = TREE_VEC_LENGTH (args);
- }
- else if (TREE_CODE (args) == TREE_LIST)
- len = -1;
- while (ix != len && args)
+ for (ix = 0; ix != len; ix++)
{
- tree arg;
- if (len >= 0)
- {
- arg = TREE_VEC_ELT (args, ix);
- ix++;
- }
- else
- {
- arg = TREE_VALUE (args);
- args = TREE_CHAIN (args);
- }
- if (need_comma)
- separate_with_comma (scratch_buffer);
+ tree arg = TREE_VEC_ELT (args, ix);
+
+ if (ix)
+ pp_separate_with_comma (cxx_pp);
if (!arg)
- print_identifier (scratch_buffer, "<template parameter error>");
+ pp_identifier (cxx_pp, "<template parameter error>");
else
dump_template_argument (arg, flags);
- need_comma = 1;
}
}
else if (primary)
@@ -1331,56 +1261,12 @@ dump_template_parms (tree info, int primary, int flags)
tree parm = TREE_VALUE (TREE_VEC_ELT (parms, ix));
if (ix)
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
dump_decl (parm, flags & ~TFF_DECL_SPECIFIERS);
}
}
- print_template_argument_list_end (scratch_buffer);
-}
-
-static void
-dump_char (int c)
-{
- switch (c)
- {
- case TARGET_NEWLINE:
- output_add_string (scratch_buffer, "\\n");
- break;
- case TARGET_TAB:
- output_add_string (scratch_buffer, "\\t");
- break;
- case TARGET_VT:
- output_add_string (scratch_buffer, "\\v");
- break;
- case TARGET_BS:
- output_add_string (scratch_buffer, "\\b");
- break;
- case TARGET_CR:
- output_add_string (scratch_buffer, "\\r");
- break;
- case TARGET_FF:
- output_add_string (scratch_buffer, "\\f");
- break;
- case TARGET_BELL:
- output_add_string (scratch_buffer, "\\a");
- break;
- case '\\':
- output_add_string (scratch_buffer, "\\\\");
- break;
- case '\'':
- output_add_string (scratch_buffer, "\\'");
- break;
- case '\"':
- output_add_string (scratch_buffer, "\\\"");
- break;
- default:
- if (ISPRINT (c))
- output_add_character (scratch_buffer, c);
- else
- output_formatted_scalar (scratch_buffer, "\\%03o", (unsigned) c);
- break;
- }
+ pp_template_argument_list_end (cxx_pp);
}
/* Print out a list of initializers (subr of dump_expr) */
@@ -1393,7 +1279,7 @@ dump_expr_list (tree l, int flags)
dump_expr (TREE_VALUE (l), flags | TFF_EXPR_IN_PARENS);
l = TREE_CHAIN (l);
if (l)
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
}
}
@@ -1420,140 +1306,44 @@ dump_expr (tree t, int flags)
break;
case INTEGER_CST:
- {
- tree type = TREE_TYPE (t);
- my_friendly_assert (type != 0, 81);
-
- /* If it's an enum, output its tag, rather than its value. */
- if (TREE_CODE (type) == ENUMERAL_TYPE)
- {
- tree values = TYPE_VALUES (type);
-
- for (; values;
- values = TREE_CHAIN (values))
- if (tree_int_cst_equal (TREE_VALUE (values), t))
- break;
-
- if (values)
- print_tree_identifier (scratch_buffer, TREE_PURPOSE (values));
- else
- {
- /* Value must have been cast. */
- print_left_paren (scratch_buffer);
- dump_type (type, flags);
- print_right_paren (scratch_buffer);
- goto do_int;
- }
- }
- else if (type == boolean_type_node)
- {
- if (t == boolean_false_node || integer_zerop (t))
- print_identifier (scratch_buffer, "false");
- else if (t == boolean_true_node)
- print_identifier (scratch_buffer, "true");
- }
- else if (type == char_type_node)
- {
- output_add_character (scratch_buffer, '\'');
- if (host_integerp (t, TREE_UNSIGNED (type)))
- dump_char (tree_low_cst (t, TREE_UNSIGNED (type)));
- else
- output_printf (scratch_buffer, "\\x%x",
- (unsigned int) TREE_INT_CST_LOW (t));
- output_add_character (scratch_buffer, '\'');
- }
- else
- {
- do_int:
- if (! host_integerp (t, 0))
- {
- tree val = t;
-
- if (tree_int_cst_sgn (val) < 0)
- {
- output_add_character (scratch_buffer, '-');
- val = build_int_2 (-TREE_INT_CST_LOW (val),
- ~TREE_INT_CST_HIGH (val)
- + !TREE_INT_CST_LOW (val));
- }
- sprintf (scratch_buffer->digit_buffer,
- HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- TREE_INT_CST_HIGH (val), TREE_INT_CST_LOW (val));
- output_add_string
- (scratch_buffer, scratch_buffer->digit_buffer);
- }
- else
- output_host_wide_integer (scratch_buffer, TREE_INT_CST_LOW (t));
- }
- }
- break;
-
+ case STRING_CST:
case REAL_CST:
- real_to_decimal (scratch_buffer->digit_buffer, &TREE_REAL_CST (t),
- sizeof (scratch_buffer->digit_buffer), 0, 1);
- output_add_string (scratch_buffer, scratch_buffer->digit_buffer);
+ pp_c_constant (pp_c_base (cxx_pp), t);
break;
case PTRMEM_CST:
- output_add_character (scratch_buffer, '&');
+ pp_ampersand (cxx_pp);
dump_type (PTRMEM_CST_CLASS (t), flags);
- print_scope_operator (scratch_buffer);
- print_tree_identifier
- (scratch_buffer, DECL_NAME (PTRMEM_CST_MEMBER (t)));
- break;
-
- case STRING_CST:
- {
- const char *p = TREE_STRING_POINTER (t);
- int len = TREE_STRING_LENGTH (t) - 1;
- int i;
-
- output_add_character (scratch_buffer, '\"');
- for (i = 0; i < len; i++)
- dump_char (p[i]);
- output_add_character (scratch_buffer, '\"');
- }
+ pp_colon_colon (cxx_pp);
+ pp_tree_identifier (cxx_pp, DECL_NAME (PTRMEM_CST_MEMBER (t)));
break;
case COMPOUND_EXPR:
- print_left_paren (scratch_buffer);
- /* Within templates, a COMPOUND_EXPR has only one operand,
- containing a TREE_LIST of the two operands. */
- if (TREE_CODE (TREE_OPERAND (t, 0)) == TREE_LIST)
- {
- if (TREE_OPERAND (t, 1))
- abort();
- dump_expr_list (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- }
- else
- {
- dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- separate_with_comma (scratch_buffer);
- dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
- }
- print_right_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
+ dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
+ pp_separate_with_comma (cxx_pp);
+ dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
+ pp_right_paren (cxx_pp);
break;
case COND_EXPR:
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- output_add_string (scratch_buffer, " ? ");
+ pp_string (cxx_pp, " ? ");
dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
- output_add_string (scratch_buffer, " : ");
+ pp_string (cxx_pp, " : ");
dump_expr (TREE_OPERAND (t, 2), flags | TFF_EXPR_IN_PARENS);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
break;
case SAVE_EXPR:
if (TREE_HAS_CONSTRUCTOR (t))
{
- output_add_string (scratch_buffer, "new ");
+ pp_string (cxx_pp, "new ");
dump_type (TREE_TYPE (TREE_TYPE (t)), flags);
}
else
- {
- dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- }
+ dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
break;
case AGGR_INIT_EXPR:
@@ -1566,18 +1356,17 @@ dump_expr (tree t, int flags)
if (fn && TREE_CODE (fn) == FUNCTION_DECL)
{
if (DECL_CONSTRUCTOR_P (fn))
- print_tree_identifier
- (scratch_buffer, TYPE_IDENTIFIER (TREE_TYPE (t)));
+ pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (TREE_TYPE (t)));
else
dump_decl (fn, 0);
}
else
dump_expr (TREE_OPERAND (t, 0), 0);
}
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
if (TREE_OPERAND (t, 1))
dump_expr_list (TREE_CHAIN (TREE_OPERAND (t, 1)), flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
break;
case CALL_EXPR:
@@ -1594,20 +1383,20 @@ dump_expr (tree t, int flags)
if (TREE_CODE (ob) == ADDR_EXPR)
{
dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS);
- output_add_character (scratch_buffer, '.');
+ pp_dot (cxx_pp);
}
else if (TREE_CODE (ob) != PARM_DECL
|| strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))
{
dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
- output_add_string (scratch_buffer, "->");
+ pp_arrow (cxx_pp);
}
args = TREE_CHAIN (args);
}
dump_expr (fn, flags | TFF_EXPR_IN_PARENS);
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_expr_list (args, flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
break;
@@ -1616,13 +1405,13 @@ dump_expr (tree t, int flags)
tree type = TREE_OPERAND (t, 1);
tree init = TREE_OPERAND (t, 2);
if (NEW_EXPR_USE_GLOBAL (t))
- print_scope_operator (scratch_buffer);
- output_add_string (scratch_buffer, "new ");
+ pp_colon_colon (cxx_pp);
+ pp_string (cxx_pp, "new ");
if (TREE_OPERAND (t, 0))
{
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_expr_list (TREE_OPERAND (t, 0), flags);
- output_add_string (scratch_buffer, ") ");
+ pp_string (cxx_pp, ") ");
}
if (TREE_CODE (type) == ARRAY_REF)
type = build_cplus_array_type
@@ -1633,7 +1422,7 @@ dump_expr (tree t, int flags)
dump_type (type, flags);
if (init)
{
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
if (TREE_CODE (init) == TREE_LIST)
dump_expr_list (init, flags);
else if (init == void_zero_node)
@@ -1642,7 +1431,7 @@ dump_expr (tree t, int flags)
;
else
dump_expr (init, flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
}
break;
@@ -1671,7 +1460,6 @@ dump_expr (tree t, int flags)
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case BIT_AND_EXPR:
- case BIT_ANDTC_EXPR:
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
case LT_EXPR:
@@ -1706,13 +1494,13 @@ dump_expr (tree t, int flags)
|| strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))
{
dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
- output_add_string (scratch_buffer, "->");
+ pp_arrow (cxx_pp);
}
}
else
{
dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
- output_add_character (scratch_buffer, '.');
+ pp_dot (cxx_pp);
}
dump_expr (TREE_OPERAND (t, 1), flags & ~TFF_EXPR_IN_PARENS);
}
@@ -1720,17 +1508,17 @@ dump_expr (tree t, int flags)
case ARRAY_REF:
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- print_left_bracket (scratch_buffer);
+ pp_left_bracket (cxx_pp);
dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
- print_right_bracket (scratch_buffer);
+ pp_right_bracket (cxx_pp);
break;
case CONVERT_EXPR:
if (TREE_TYPE (t) && VOID_TYPE_P (TREE_TYPE (t)))
{
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_type (TREE_TYPE (t), flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
dump_expr (TREE_OPERAND (t, 0), flags);
}
else
@@ -1756,9 +1544,9 @@ dump_expr (tree t, int flags)
t = TREE_OPERAND (t, 0);
my_friendly_assert (TREE_CODE (t) == CALL_EXPR, 237);
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_expr_list (TREE_CHAIN (TREE_OPERAND (t, 1)), flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
else
{
@@ -1781,11 +1569,10 @@ dump_expr (tree t, int flags)
case POSTDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- print_identifier
- (scratch_buffer, operator_name_info[(int)TREE_CODE (t)].name);
- print_right_paren (scratch_buffer);
+ pp_identifier (cxx_pp, operator_name_info[(int)TREE_CODE (t)].name);
+ pp_right_paren (cxx_pp);
break;
case NON_LVALUE_EXPR:
@@ -1802,11 +1589,11 @@ dump_expr (tree t, int flags)
if (TREE_CODE (next) == FUNCTION_TYPE)
{
if (flags & TFF_EXPR_IN_PARENS)
- print_left_paren (scratch_buffer);
- output_add_character (scratch_buffer, '*');
+ pp_left_paren (cxx_pp);
+ pp_star (cxx_pp);
dump_expr (TREE_OPERAND (t, 0), flags & ~TFF_EXPR_IN_PARENS);
if (flags & TFF_EXPR_IN_PARENS)
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
break;
}
/* else FALLTHRU */
@@ -1815,9 +1602,27 @@ dump_expr (tree t, int flags)
break;
case NOP_EXPR:
- dump_expr (TREE_OPERAND (t, 0), flags);
- break;
-
+ {
+ tree op = TREE_OPERAND (t, 0);
+
+ if (!same_type_p (TREE_TYPE (op), TREE_TYPE (t)))
+ {
+ /* It is a cast, but we cannot tell whether it is a
+ reinterpret or static cast. Use the C style notation. */
+ if (flags & TFF_EXPR_IN_PARENS)
+ pp_left_paren (cxx_pp);
+ pp_left_paren (cxx_pp);
+ dump_type (TREE_TYPE (t), flags);
+ pp_right_paren (cxx_pp);
+ dump_expr (op, flags | TFF_EXPR_IN_PARENS);
+ if (flags & TFF_EXPR_IN_PARENS)
+ pp_right_paren (cxx_pp);
+ }
+ else
+ dump_expr (op, flags);
+ break;
+ }
+
case EXPR_WITH_FILE_LOCATION:
dump_expr (EXPR_WFL_NODE (t), flags);
break;
@@ -1830,9 +1635,11 @@ dump_expr (tree t, int flags)
if (integer_zerop (idx))
{
/* A NULL pointer-to-member constant. */
- output_add_string (scratch_buffer, "((");
+ pp_left_paren (cxx_pp);
+ pp_left_paren (cxx_pp);
dump_type (TREE_TYPE (t), flags);
- output_add_string (scratch_buffer, ") 0)");
+ pp_right_paren (cxx_pp);
+ pp_string (cxx_pp, ")0)");
break;
}
else if (host_integerp (idx, 0))
@@ -1866,14 +1673,14 @@ dump_expr (tree t, int flags)
if (TREE_TYPE (t) && !CONSTRUCTOR_ELTS (t))
{
dump_type (TREE_TYPE (t), 0);
- output_add_character (scratch_buffer, '(');
- output_add_character (scratch_buffer, ')');
+ pp_left_paren (cxx_pp);
+ pp_right_paren (cxx_pp);
}
else
{
- output_add_character (scratch_buffer, '{');
+ pp_left_brace (cxx_pp);
dump_expr_list (CONSTRUCTOR_ELTS (t), flags);
- output_add_character (scratch_buffer, '}');
+ pp_right_brace (cxx_pp);
}
break;
@@ -1898,12 +1705,12 @@ dump_expr (tree t, int flags)
if (TREE_CODE (ob) == INDIRECT_REF)
{
dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS);
- output_add_string (scratch_buffer, "->*");
+ pp_string (cxx_pp, "->*");
}
else
{
dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
- output_add_string (scratch_buffer, ".*");
+ pp_string (cxx_pp, ".*");
}
dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
}
@@ -1916,7 +1723,7 @@ dump_expr (tree t, int flags)
case SCOPE_REF:
dump_type (TREE_OPERAND (t, 0), flags);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
break;
@@ -1925,65 +1732,68 @@ dump_expr (tree t, int flags)
|| TREE_CHAIN (TREE_OPERAND (t, 0)))
{
dump_type (TREE_TYPE (t), flags);
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_expr_list (TREE_OPERAND (t, 0), flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
else
{
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_type (TREE_TYPE (t), flags);
- output_add_string (scratch_buffer, ")(");
+ pp_string (cxx_pp, ")(");
dump_expr_list (TREE_OPERAND (t, 0), flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
break;
case STATIC_CAST_EXPR:
- output_add_string (scratch_buffer, "static_cast<");
+ pp_string (cxx_pp, "static_cast<");
goto cast;
case REINTERPRET_CAST_EXPR:
- output_add_string (scratch_buffer, "reinterpret_cast<");
+ pp_string (cxx_pp, "reinterpret_cast<");
goto cast;
case CONST_CAST_EXPR:
- output_add_string (scratch_buffer, "const_cast<");
+ pp_string (cxx_pp, "const_cast<");
goto cast;
case DYNAMIC_CAST_EXPR:
- output_add_string (scratch_buffer, "dynamic_cast<");
+ pp_string (cxx_pp, "dynamic_cast<");
cast:
dump_type (TREE_TYPE (t), flags);
- output_add_string (scratch_buffer, ">(");
+ pp_string (cxx_pp, ">(");
dump_expr (TREE_OPERAND (t, 0), flags);
- print_right_paren (scratch_buffer);
- break;
-
- case LOOKUP_EXPR:
- print_tree_identifier (scratch_buffer, TREE_OPERAND (t, 0));
+ pp_right_paren (cxx_pp);
break;
case ARROW_EXPR:
dump_expr (TREE_OPERAND (t, 0), flags);
- output_add_string (scratch_buffer, "->");
+ pp_arrow (cxx_pp);
break;
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
if (TREE_CODE (t) == SIZEOF_EXPR)
- output_add_string (scratch_buffer, "sizeof (");
+ pp_string (cxx_pp, "sizeof (");
else
{
my_friendly_assert (TREE_CODE (t) == ALIGNOF_EXPR, 0);
- output_add_string (scratch_buffer, "__alignof__ (");
+ pp_string (cxx_pp, "__alignof__ (");
}
if (TYPE_P (TREE_OPERAND (t, 0)))
dump_type (TREE_OPERAND (t, 0), flags);
else
dump_expr (TREE_OPERAND (t, 0), flags);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
+ break;
+
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ pp_identifier (cxx_pp, operator_name_info[TREE_CODE (t)].name);
+ pp_space (cxx_pp);
+ dump_expr (TREE_OPERAND (t, 0), flags);
break;
case DEFAULT_ARG:
- print_identifier (scratch_buffer, "<unparsed>");
+ pp_identifier (cxx_pp, "<unparsed>");
break;
case TRY_CATCH_EXPR:
@@ -1994,9 +1804,10 @@ dump_expr (tree t, int flags)
case PSEUDO_DTOR_EXPR:
dump_expr (TREE_OPERAND (t, 2), flags);
- output_add_character (scratch_buffer, '.');
+ pp_dot (cxx_pp);
dump_type (TREE_OPERAND (t, 0), flags);
- output_add_string (scratch_buffer, "::~");
+ pp_colon_colon (cxx_pp);
+ pp_complement (cxx_pp);
dump_type (TREE_OPERAND (t, 1), flags);
break;
@@ -2007,45 +1818,49 @@ dump_expr (tree t, int flags)
case STMT_EXPR:
/* We don't yet have a way of dumping statements in a
human-readable format. */
- output_add_string (scratch_buffer, "({...})");
+ pp_string (cxx_pp, "({...})");
break;
case BIND_EXPR:
- output_add_character (scratch_buffer, '{');
+ pp_left_brace (cxx_pp);
dump_expr (TREE_OPERAND (t, 1), flags & ~TFF_EXPR_IN_PARENS);
- output_add_character (scratch_buffer, '}');
+ pp_right_brace (cxx_pp);
break;
case LOOP_EXPR:
- output_add_string (scratch_buffer, "while (1) { ");
+ pp_string (cxx_pp, "while (1) { ");
dump_expr (TREE_OPERAND (t, 0), flags & ~TFF_EXPR_IN_PARENS);
- output_add_character (scratch_buffer, '}');
+ pp_right_brace (cxx_pp);
break;
case EXIT_EXPR:
- output_add_string (scratch_buffer, "if (");
+ pp_string (cxx_pp, "if (");
dump_expr (TREE_OPERAND (t, 0), flags & ~TFF_EXPR_IN_PARENS);
- output_add_string (scratch_buffer, ") break; ");
+ pp_string (cxx_pp, ") break; ");
break;
case BASELINK:
dump_expr (get_first_fn (t), flags & ~TFF_EXPR_IN_PARENS);
break;
- case NON_DEPENDENT_EXPR:
- output_add_string (scratch_buffer, "<expression of type ");
+ case EMPTY_CLASS_EXPR:
dump_type (TREE_TYPE (t), flags);
- output_add_character (scratch_buffer, '>');
+ pp_left_paren (cxx_pp);
+ pp_right_paren (cxx_pp);
+ break;
+
+ case NON_DEPENDENT_EXPR:
+ dump_expr (TREE_OPERAND (t, 0), flags);
break;
/* This list is incomplete, but should suffice for now.
It is very important that `sorry' does not call
`report_error_function'. That could cause an infinite loop. */
default:
- sorry_for_unsupported_tree (t);
+ pp_unsupported_tree (cxx_pp, t);
/* fall through to ERROR_MARK... */
case ERROR_MARK:
- print_identifier (scratch_buffer, "<expression error>");
+ pp_identifier (cxx_pp, "<expression error>");
break;
}
}
@@ -2053,27 +1868,27 @@ dump_expr (tree t, int flags)
static void
dump_binary_op (const char *opstring, tree t, int flags)
{
- print_left_paren (scratch_buffer);
+ pp_left_paren (cxx_pp);
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
- output_add_space (scratch_buffer);
+ pp_space (cxx_pp);
if (opstring)
- print_identifier (scratch_buffer, opstring);
+ pp_identifier (cxx_pp, opstring);
else
- print_identifier (scratch_buffer, "<unknown operator>");
- output_add_space (scratch_buffer);
+ pp_identifier (cxx_pp, "<unknown operator>");
+ pp_space (cxx_pp);
dump_expr (TREE_OPERAND (t, 1), flags | TFF_EXPR_IN_PARENS);
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
static void
dump_unary_op (const char *opstring, tree t, int flags)
{
if (flags & TFF_EXPR_IN_PARENS)
- print_left_paren (scratch_buffer);
- print_identifier (scratch_buffer, opstring);
+ pp_left_paren (cxx_pp);
+ pp_identifier (cxx_pp, opstring);
dump_expr (TREE_OPERAND (t, 0), flags & ~TFF_EXPR_IN_PARENS);
if (flags & TFF_EXPR_IN_PARENS)
- print_right_paren (scratch_buffer);
+ pp_right_paren (cxx_pp);
}
/* Exported interface to stringifying types, exprs and decls under TFF_*
@@ -2082,41 +1897,33 @@ dump_unary_op (const char *opstring, tree t, int flags)
const char *
type_as_string (tree typ, int flags)
{
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_type (typ, flags);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
const char *
expr_as_string (tree decl, int flags)
{
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_expr (decl, flags);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
const char *
decl_as_string (tree decl, int flags)
{
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_decl (decl, flags);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
const char *
context_as_string (tree context, int flags)
{
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_scope (context, flags);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
/* Generate the three forms of printable names for cxx_printable_name. */
@@ -2127,12 +1934,11 @@ lang_decl_name (tree decl, int v)
if (v >= 2)
return decl_as_string (decl, TFF_DECL_SPECIFIERS);
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
if (v == 1 && DECL_CLASS_SCOPE_P (decl))
{
dump_type (CP_DECL_CONTEXT (decl), TFF_PLAIN_IDENTIFIER);
- print_scope_operator (scratch_buffer);
+ pp_colon_colon (cxx_pp);
}
if (TREE_CODE (decl) == FUNCTION_DECL)
@@ -2140,7 +1946,7 @@ lang_decl_name (tree decl, int v)
else
dump_decl (DECL_NAME (decl), TFF_PLAIN_IDENTIFIER);
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
static location_t
@@ -2169,26 +1975,22 @@ decl_to_string (tree decl, int verbose)
|| TREE_CODE (decl) == UNION_TYPE || TREE_CODE (decl) == ENUMERAL_TYPE)
flags = TFF_CLASS_KEY_OR_ENUM;
if (verbose)
- flags |= TFF_DECL_SPECIFIERS | TFF_FUNCTION_DEFAULT_ARGUMENTS;
+ flags |= TFF_DECL_SPECIFIERS;
else if (TREE_CODE (decl) == FUNCTION_DECL)
flags |= TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE;
flags |= TFF_TEMPLATE_HEADER;
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_decl (decl, flags);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
static const char *
expr_to_string (tree decl)
{
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_expr (decl, 0);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
static const char *
@@ -2199,11 +2001,9 @@ fndecl_to_string (tree fndecl, int verbose)
flags = TFF_EXCEPTION_SPECIFICATION | TFF_DECL_SPECIFIERS;
if (verbose)
flags |= TFF_FUNCTION_DEFAULT_ARGUMENTS;
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_decl (fndecl, flags);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
@@ -2238,48 +2038,38 @@ language_to_string (enum languages c)
static const char *
parm_to_string (int p)
{
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
if (p < 0)
- output_add_string (scratch_buffer, "'this'");
+ pp_string (cxx_pp, "'this'");
else
- output_decimal (scratch_buffer, p + 1);
-
- return output_finalize_message (scratch_buffer);
+ pp_decimal_int (cxx_pp, p + 1);
+ return pp_formatted_text (cxx_pp);
}
static const char *
op_to_string (enum tree_code p)
{
- tree id;
-
- id = operator_name_info[(int) p].identifier;
+ tree id = operator_name_info[(int) p].identifier;
return id ? IDENTIFIER_POINTER (id) : "<unknown>";
}
static const char *
type_to_string (tree typ, int verbose)
{
- int flags;
-
- flags = 0;
+ int flags = 0;
if (verbose)
flags |= TFF_CLASS_KEY_OR_ENUM;
flags |= TFF_TEMPLATE_HEADER;
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_type (typ, flags);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
static const char *
assop_to_string (enum tree_code p)
{
- tree id;
-
- id = assignment_operator_name_info[(int) p].identifier;
+ tree id = assignment_operator_name_info[(int) p].identifier;
return id ? IDENTIFIER_POINTER (id) : "{unknown}";
}
@@ -2296,27 +2086,25 @@ args_to_string (tree p, int verbose)
if (TYPE_P (TREE_VALUE (p)))
return type_as_string (p, flags);
- reinit_global_formatting_buffer ();
+ pp_clear_output_area (cxx_pp);
for (; p; p = TREE_CHAIN (p))
{
if (TREE_VALUE (p) == null_node)
- print_identifier (scratch_buffer, "NULL");
+ pp_identifier (cxx_pp, "NULL");
else
dump_type (error_type (TREE_VALUE (p)), flags);
if (TREE_CHAIN (p))
- separate_with_comma (scratch_buffer);
+ pp_separate_with_comma (cxx_pp);
}
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
static const char *
cv_to_string (tree p, int v)
{
- reinit_global_formatting_buffer ();
-
+ pp_clear_output_area (cxx_pp);
dump_qualifiers (p, v ? before : none);
-
- return output_finalize_message (scratch_buffer);
+ return pp_formatted_text (cxx_pp);
}
/* Langhook for print_error_function. */
@@ -2324,7 +2112,7 @@ void
cxx_print_error_function (diagnostic_context *context, const char *file)
{
lhd_print_error_function (context, file);
- output_set_prefix (&context->buffer, file);
+ pp_base_set_prefix (context->printer, file);
maybe_print_instantiation_context (context);
}
@@ -2335,14 +2123,14 @@ cp_diagnostic_starter (diagnostic_context *context,
diagnostic_report_current_module (context);
cp_print_error_function (context, diagnostic);
maybe_print_instantiation_context (context);
- output_set_prefix (&context->buffer, diagnostic_build_prefix (diagnostic));
+ pp_base_set_prefix (context->printer, diagnostic_build_prefix (diagnostic));
}
static void
cp_diagnostic_finalizer (diagnostic_context *context,
diagnostic_info *diagnostic ATTRIBUTE_UNUSED)
{
- output_destroy_prefix (&context->buffer);
+ pp_base_destroy_prefix (context->printer);
}
/* Print current function onto BUFFER, in the process of reporting
@@ -2353,24 +2141,24 @@ cp_print_error_function (diagnostic_context *context,
{
if (diagnostic_last_function_changed (context))
{
- const char *old_prefix = output_prefix (&context->buffer);
+ const char *old_prefix = context->printer->prefix;
char *new_prefix = diagnostic->location.file
? file_name_as_prefix (diagnostic->location.file)
: NULL;
- output_set_prefix (&context->buffer, new_prefix);
+ pp_base_set_prefix (context->printer, new_prefix);
if (current_function_decl == NULL)
- output_add_string (&context->buffer, "At global scope:");
+ pp_base_string (context->printer, "At global scope:");
else
- output_printf (&context->buffer, "In %s `%s':",
- function_category (current_function_decl),
- cxx_printable_name (current_function_decl, 2));
- output_add_newline (&context->buffer);
+ pp_printf (context->printer, "In %s `%s':",
+ function_category (current_function_decl),
+ cxx_printable_name (current_function_decl, 2));
+ pp_base_newline (context->printer);
diagnostic_set_last_function (context);
- output_destroy_prefix (&context->buffer);
- context->buffer.state.prefix = old_prefix;
+ pp_base_destroy_prefix (context->printer);
+ context->printer->prefix = old_prefix;
}
}
@@ -2416,10 +2204,10 @@ print_instantiation_full_context (diagnostic_context *context)
if (current_function_decl == TINST_DECL (p))
/* Avoid redundancy with the the "In function" line. */;
else
- output_verbatim (&context->buffer,
- "%s: In instantiation of `%s':\n", location.file,
- decl_as_string (TINST_DECL (p),
- TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
+ pp_verbatim (context->printer,
+ "%s: In instantiation of `%s':\n", location.file,
+ decl_as_string (TINST_DECL (p),
+ TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
location.line = TINST_LINE (p);
location.file = TINST_FILE (p);
@@ -2437,16 +2225,15 @@ print_instantiation_partial_context (diagnostic_context *context,
{
for (; t; t = TREE_CHAIN (t))
{
- output_verbatim
- (&context->buffer, "%s:%d: instantiated from `%s'\n",
- loc.file, loc.line,
- decl_as_string (TINST_DECL (t),
- TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
+ pp_verbatim (context->printer, "%s:%d: instantiated from `%s'\n",
+ loc.file, loc.line,
+ decl_as_string (TINST_DECL (t),
+ TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
loc.line = TINST_LINE (t);
loc.file = TINST_FILE (t);
}
- output_verbatim (&context->buffer, "%s:%d: instantiated from here\n",
- loc.file, loc.line);
+ pp_verbatim (context->printer, "%s:%d: instantiated from here\n",
+ loc.file, loc.line);
}
/* Called from cp_thing to print the template context for an error. */
@@ -2483,7 +2270,7 @@ print_instantiation_context (void)
%T type.
%V cv-qualifier. */
static bool
-cp_printer (output_buffer *buffer, text_info *text)
+cp_printer (pretty_printer *pp, text_info *text)
{
int verbose = 0;
const char *result;
@@ -2518,7 +2305,7 @@ cp_printer (output_buffer *buffer, text_info *text)
return false;
}
- output_add_string (buffer, result);
+ pp_base_string (pp, result);
return true;
#undef next_tree
#undef next_tcode
@@ -2527,13 +2314,13 @@ cp_printer (output_buffer *buffer, text_info *text)
}
static void
-print_non_consecutive_character (output_buffer *buffer, int c)
+pp_non_consecutive_character (cxx_pretty_printer *pp, int c)
{
- const char *p = output_last_position (buffer);
+ const char *p = pp_last_position_in_text (pp);
if (p != NULL && *p == c)
- output_add_space (buffer);
- output_add_character (buffer, c);
+ pp_space (pp);
+ pp_character (pp, c);
}
/* These are temporary wrapper functions which handle the historic
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 390f12c4551..1303919de37 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -115,11 +115,9 @@ prepare_eh_type (tree type)
return type;
}
-/* Build the address of a typeinfo decl for use in the runtime
- matching field of the exception model. */
-
-static tree
-build_eh_type_type (tree type)
+/* Return the type info for TYPE as used by EH machinery. */
+tree
+eh_type_info (tree type)
{
tree exp;
@@ -131,12 +129,23 @@ build_eh_type_type (tree type)
else
exp = get_tinfo_decl (type);
- mark_used (exp);
- exp = build1 (ADDR_EXPR, ptr_type_node, exp);
-
return exp;
}
+/* Build the address of a typeinfo decl for use in the runtime
+ matching field of the exception model. */
+
+static tree
+build_eh_type_type (tree type)
+{
+ tree exp = eh_type_info (type);
+
+ if (!exp)
+ return NULL;
+
+ return build1 (ADDR_EXPR, ptr_type_node, exp);
+}
+
tree
build_exc_ptr (void)
{
@@ -470,8 +479,13 @@ finish_eh_spec_block (tree raw_raises, tree eh_spec_block)
for (raises = NULL_TREE;
raw_raises && TREE_VALUE (raw_raises);
raw_raises = TREE_CHAIN (raw_raises))
- raises = tree_cons (NULL_TREE, prepare_eh_type (TREE_VALUE (raw_raises)),
- raises);
+ {
+ tree type = prepare_eh_type (TREE_VALUE (raw_raises));
+ tree tinfo = eh_type_info (type);
+
+ mark_used (tinfo);
+ raises = tree_cons (NULL_TREE, type, raises);
+ }
EH_SPEC_RAISES (eh_spec_block) = raises;
}
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 160a946ef9a..630f0789073 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -51,11 +51,8 @@ cplus_expand_constant (tree cst)
member = PTRMEM_CST_MEMBER (cst);
if (TREE_CODE (member) == FIELD_DECL)
- {
- /* Find the offset for the field. */
- tree offset = byte_position (member);
- cst = fold (build1 (NOP_EXPR, type, offset));
- }
+ /* Find the offset for the field. */
+ cst = fold (build_nop (type, byte_position (member)));
else
{
tree delta;
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 8d149a27c4b..1b3d4b46233 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -127,10 +127,14 @@ is_friend (tree type, tree supplicant)
}
/* Add a new friend to the friends of the aggregate type TYPE.
- DECL is the FUNCTION_DECL of the friend being added. */
+ DECL is the FUNCTION_DECL of the friend being added.
+
+ If COMPLAIN is true, warning about duplicate friend is issued.
+ We want to have this diagnostics during parsing but not
+ when a template is being instantiated. */
void
-add_friend (tree type, tree decl)
+add_friend (tree type, tree decl, bool complain)
{
tree typedecl;
tree list;
@@ -153,10 +157,13 @@ add_friend (tree type, tree decl)
{
if (decl == TREE_VALUE (friends))
{
- warning ("`%D' is already a friend of class `%T'",
- decl, type);
- cp_warning_at ("previous friend declaration of `%D'",
- 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));
+ }
return;
}
}
@@ -170,6 +177,9 @@ add_friend (tree type, tree decl)
list = TREE_CHAIN (list);
}
+ if (DECL_CLASS_SCOPE_P (decl))
+ perform_or_defer_access_check (TYPE_BINFO (DECL_CONTEXT (decl)), decl);
+
maybe_add_class_template_decl_list (type, decl, /*friend_p=*/1);
DECL_FRIENDLIST (typedecl)
@@ -189,10 +199,14 @@ add_friend (tree type, tree decl)
classes that are not defined. If a type has not yet been defined,
then the DECL_WAITING_FRIENDS contains a list of types
waiting to make it their friend. Note that these two can both
- be in use at the same time! */
+ be in use at the same time!
+
+ If COMPLAIN is true, warning about duplicate friend is issued.
+ We want to have this diagnostics during parsing but not
+ when a template is being instantiated. */
void
-make_friend_class (tree type, tree friend_type)
+make_friend_class (tree type, tree friend_type, bool complain)
{
tree classes;
int is_template_friend;
@@ -224,8 +238,9 @@ make_friend_class (tree type, tree friend_type)
}
else if (same_type_p (type, friend_type))
{
- pedwarn ("class `%T' is implicitly friends with itself",
- type);
+ if (complain)
+ pedwarn ("class `%T' is implicitly friends with itself",
+ type);
return;
}
else
@@ -272,8 +287,9 @@ make_friend_class (tree type, tree friend_type)
{
if (friend_type == probe)
{
- warning ("`%D' is already a friend of `%T'",
- probe, type);
+ if (complain)
+ warning ("`%D' is already a friend of `%T'",
+ probe, type);
break;
}
}
@@ -281,8 +297,9 @@ make_friend_class (tree type, tree friend_type)
{
if (same_type_p (probe, friend_type))
{
- warning ("`%T' is already a friend of `%T'",
- probe, type);
+ if (complain)
+ warning ("`%T' is already a friend of `%T'",
+ probe, type);
break;
}
}
@@ -333,8 +350,6 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR)
{
declarator = TREE_OPERAND (declarator, 0);
- if (TREE_CODE (declarator) == LOOKUP_EXPR)
- declarator = TREE_OPERAND (declarator, 0);
if (is_overloaded_fn (declarator))
declarator = DECL_NAME (get_first_fn (declarator));
}
@@ -359,6 +374,8 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
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);
@@ -366,7 +383,7 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
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);
+ add_friend (current_class_type, decl, /*complain=*/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. */
@@ -375,7 +392,7 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
decl = check_classfn (ctype, decl);
if (decl)
- add_friend (current_class_type, decl);
+ add_friend (current_class_type, decl, /*complain=*/true);
}
else
error ("member `%D' declared as friend before type `%T' defined",
@@ -443,7 +460,8 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
}
add_friend (current_class_type,
- is_friend_template ? DECL_TI_TEMPLATE (decl) : decl);
+ is_friend_template ? DECL_TI_TEMPLATE (decl) : decl,
+ /*complain=*/true);
DECL_FRIEND_P (decl) = 1;
}
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 26bc383799d..d3407a31604 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -113,7 +113,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
argv = *in_argv;
added_libraries = *in_added_libraries;
- args = (int *) xcalloc (argc, sizeof (int));
+ args = xcalloc (argc, sizeof (int));
for (i = 1; i < argc; i++)
{
@@ -168,12 +168,12 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
saw_speclang = 1;
}
else if (((argv[i][2] == '\0'
- && (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
+ && strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
|| strcmp (argv[i], "-Xlinker") == 0
|| strcmp (argv[i], "-Tdata") == 0))
quote = argv[i];
else if ((argv[i][2] == '\0'
- && (char *) strchr ("cSEM", argv[i][1]) != NULL)
+ && strchr ("cSEM", argv[i][1]) != NULL)
|| strcmp (argv[i], "-MM") == 0
|| strcmp (argv[i], "-fsyntax-only") == 0)
{
@@ -243,7 +243,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
/* Make sure to have room for the trailing NULL argument. */
num_args = argc + added + need_math + shared_libgcc + (library > 0) + 1;
- arglist = (const char **) xmalloc (num_args * sizeof (char *));
+ arglist = xmalloc (num_args * sizeof (char *));
i = 0;
j = 0;
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 4a11b4319fa..ace82cdc39f 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -35,6 +35,8 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "toplev.h"
+static bool begin_init_stmts (tree *, tree *);
+static tree finish_init_stmts (bool, tree, tree);
static void construct_virtual_base (tree, tree);
static void expand_aggr_init_1 (tree, tree, tree, tree, int);
static void expand_default_init (tree, tree, tree, tree, int);
@@ -64,40 +66,29 @@ static tree build_vtbl_address (tree);
pass them back to finish_init_stmts when the expression is
complete. */
-void
+static bool
begin_init_stmts (tree *stmt_expr_p, tree *compound_stmt_p)
{
- if (building_stmt_tree ())
- *stmt_expr_p = begin_stmt_expr ();
- else
- *stmt_expr_p = begin_global_stmt_expr ();
+ bool is_global = !building_stmt_tree ();
- if (building_stmt_tree ())
- *compound_stmt_p = begin_compound_stmt (/*has_no_scope=*/1);
+ *stmt_expr_p = begin_stmt_expr ();
+ *compound_stmt_p = begin_compound_stmt (/*has_no_scope=*/true);
+
+ return is_global;
}
/* Finish out the statement-expression begun by the previous call to
begin_init_stmts. Returns the statement-expression itself. */
-tree
-finish_init_stmts (tree stmt_expr, tree compound_stmt)
+static tree
+finish_init_stmts (bool is_global, tree stmt_expr, tree compound_stmt)
{
- if (building_stmt_tree ())
- finish_compound_stmt (/*has_no_scope=*/1, compound_stmt);
+ finish_compound_stmt (compound_stmt);
- if (building_stmt_tree ())
- {
- stmt_expr = finish_stmt_expr (stmt_expr);
- STMT_EXPR_NO_SCOPE (stmt_expr) = true;
- }
- else
- stmt_expr = finish_global_stmt_expr (stmt_expr);
-
- /* To avoid spurious warnings about unused values, we set
- TREE_USED. */
- if (stmt_expr)
- TREE_USED (stmt_expr) = 1;
+ stmt_expr = finish_stmt_expr (stmt_expr, true);
+ my_friendly_assert (!building_stmt_tree () == is_global, 20030726);
+
return stmt_expr;
}
@@ -379,17 +370,9 @@ perform_member_init (tree member, tree init)
pedwarn ("uninitialized reference member `%D'", member);
}
else if (TREE_CODE (init) == TREE_LIST)
- {
- /* There was an explicit member initialization. Do some
- work in that case. */
- if (TREE_CHAIN (init))
- {
- warning ("initializer list treated as compound expression");
- init = build_compound_expr (init);
- }
- else
- init = TREE_VALUE (init);
- }
+ /* There was an explicit member initialization. Do some work
+ in that case. */
+ init = build_x_compound_expr_from_list (init, "member initializer");
if (init)
finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
@@ -857,25 +840,17 @@ construct_virtual_base (tree vbase, tree arguments)
flag = TREE_CHAIN (DECL_ARGUMENTS (current_function_decl));
inner_if_stmt = begin_if_stmt ();
finish_if_stmt_cond (flag, inner_if_stmt);
- compound_stmt = begin_compound_stmt (/*has_no_scope=*/1);
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/true);
/* Compute the location of the virtual base. If we're
constructing virtual bases, then we must be the most derived
class. Therefore, we don't have to look up the virtual base;
we already know where it is. */
- exp = build (PLUS_EXPR,
- TREE_TYPE (current_class_ptr),
- current_class_ptr,
- fold (build1 (NOP_EXPR, TREE_TYPE (current_class_ptr),
- BINFO_OFFSET (vbase))));
- exp = build1 (NOP_EXPR,
- build_pointer_type (BINFO_TYPE (vbase)),
- exp);
- exp = build1 (INDIRECT_REF, BINFO_TYPE (vbase), exp);
-
- expand_aggr_init_1 (vbase, current_class_ref, exp,
- arguments, LOOKUP_COMPLAIN);
- finish_compound_stmt (/*has_no_scope=*/1, compound_stmt);
+ exp = convert_to_base_statically (current_class_ref, vbase);
+
+ expand_aggr_init_1 (vbase, current_class_ref, exp, arguments,
+ LOOKUP_COMPLAIN);
+ finish_compound_stmt (compound_stmt);
finish_then_clause (inner_if_stmt);
finish_if_stmt ();
@@ -986,16 +961,50 @@ expand_member_init (tree name)
if (basetype)
{
- tree binfo;
+ tree class_binfo;
+ tree direct_binfo;
+ tree virtual_binfo;
+ int i;
if (current_template_parms)
return basetype;
- binfo = lookup_base (current_class_type, basetype,
- ba_ignore, NULL);
- if (!binfo || (!TREE_VIA_VIRTUAL (binfo)
- && (BINFO_INHERITANCE_CHAIN (binfo)
- != TYPE_BINFO (current_class_type))))
+ class_binfo = TYPE_BINFO (current_class_type);
+ direct_binfo = NULL_TREE;
+ virtual_binfo = NULL_TREE;
+
+ /* Look for a direct base. */
+ for (i = 0; i < BINFO_N_BASETYPES (class_binfo); ++i)
+ if (same_type_p (basetype,
+ TYPE_BINFO_BASETYPE (current_class_type, i)))
+ {
+ direct_binfo = BINFO_BASETYPE (class_binfo, i);
+ break;
+ }
+ /* Look for a virtual base -- unless the direct base is itself
+ virtual. */
+ if (!direct_binfo || !TREE_VIA_VIRTUAL (direct_binfo))
+ {
+ virtual_binfo
+ = purpose_member (basetype,
+ CLASSTYPE_VBASECLASSES (current_class_type));
+ if (virtual_binfo)
+ virtual_binfo = TREE_VALUE (virtual_binfo);
+ }
+
+ /* [class.base.init]
+
+ If a mem-initializer-id is ambiguous because it designates
+ both a direct non-virtual base class and an inherited virtual
+ base class, the mem-initializer is ill-formed. */
+ if (direct_binfo && virtual_binfo)
+ {
+ error ("'%D' is both a direct base and an indirect virtual base",
+ basetype);
+ return NULL_TREE;
+ }
+
+ if (!direct_binfo && !virtual_binfo)
{
if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
error ("type `%D' is not a direct or virtual base of `%T'",
@@ -1005,7 +1014,8 @@ expand_member_init (tree name)
name, current_class_type);
return NULL_TREE;
}
- return binfo;
+
+ return direct_binfo ? direct_binfo : virtual_binfo;
}
else
{
@@ -1061,6 +1071,7 @@ build_aggr_init (tree exp, tree init, int flags)
tree type = TREE_TYPE (exp);
int was_const = TREE_READONLY (exp);
int was_volatile = TREE_THIS_VOLATILE (exp);
+ int is_global;
if (init == error_mark_node)
return error_mark_node;
@@ -1114,12 +1125,12 @@ build_aggr_init (tree exp, tree init, int flags)
TREE_USED (exp) = 1;
TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type);
- begin_init_stmts (&stmt_expr, &compound_stmt);
+ is_global = begin_init_stmts (&stmt_expr, &compound_stmt);
destroy_temps = stmts_are_full_exprs_p ();
current_stmt_tree ()->stmts_are_full_exprs_p = 0;
expand_aggr_init_1 (TYPE_BINFO (type), exp, exp,
init, LOOKUP_NORMAL|flags);
- stmt_expr = finish_init_stmts (stmt_expr, compound_stmt);
+ stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt);
current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps;
TREE_TYPE (exp) = type;
TREE_READONLY (exp) = was_const;
@@ -1216,12 +1227,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags)
rval = build_special_member_call (exp, ctor_name, parms, binfo, flags);
if (TREE_SIDE_EFFECTS (rval))
- {
- if (building_stmt_tree ())
- finish_expr_stmt (rval);
- else
- genrtl_expr_stmt (rval);
- }
+ finish_expr_stmt (convert_to_void (rval, NULL));
}
/* This function is responsible for initializing EXP with INIT
@@ -1337,10 +1343,11 @@ get_type_value (tree name)
return NULL_TREE;
}
-/* Build a reference to a member of an aggregate. This is not a
- C++ `&', but really something which can have its address taken,
- and then act as a pointer to member, for example TYPE :: FIELD
- can have its address taken by saying & TYPE :: FIELD.
+/* Build a reference to a member of an aggregate. This is not a C++
+ `&', but really something which can have its address taken, and
+ then act as a pointer to member, for example TYPE :: FIELD can have
+ its address taken by saying & TYPE :: FIELD. ADDRESS_P is true if
+ this expression is the operand of "&".
@@ Prints out lousy diagnostics for operator <typename>
@@ fields.
@@ -1348,7 +1355,7 @@ get_type_value (tree name)
@@ This function should be rewritten and placed in search.c. */
tree
-build_offset_ref (tree type, tree name)
+build_offset_ref (tree type, tree name, bool address_p)
{
tree decl;
tree member;
@@ -1374,16 +1381,10 @@ build_offset_ref (tree type, tree name)
name = DECL_NAME (name);
else
{
- if (TREE_CODE (name) == LOOKUP_EXPR)
- /* This can happen during tsubst'ing. */
- name = TREE_OPERAND (name, 0);
- else
- {
- if (TREE_CODE (name) == COMPONENT_REF)
- name = TREE_OPERAND (name, 1);
- if (TREE_CODE (name) == OVERLOAD)
- name = DECL_NAME (OVL_CURRENT (name));
- }
+ if (TREE_CODE (name) == COMPONENT_REF)
+ name = TREE_OPERAND (name, 1);
+ if (TREE_CODE (name) == OVERLOAD)
+ name = DECL_NAME (OVL_CURRENT (name));
}
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
@@ -1441,8 +1442,33 @@ build_offset_ref (tree type, tree name)
return error_mark_node;
}
+ if (!member)
+ {
+ error ("`%D' is not a member of type `%T'", name, type);
+ return error_mark_node;
+ }
+
+ if (TREE_CODE (member) == TYPE_DECL)
+ {
+ TREE_USED (member) = 1;
+ return member;
+ }
+ /* static class members and class-specific enum
+ values can be returned without further ado. */
+ if (TREE_CODE (member) == VAR_DECL || TREE_CODE (member) == CONST_DECL)
+ {
+ mark_used (member);
+ return convert_from_reference (member);
+ }
+
+ if (TREE_CODE (member) == FIELD_DECL && DECL_C_BIT_FIELD (member))
+ {
+ error ("invalid pointer to bit-field `%D'", member);
+ return error_mark_node;
+ }
+
/* A lot of this logic is now handled in lookup_member. */
- if (member && BASELINK_P (member))
+ if (BASELINK_P (member))
{
/* Go from the TREE_BASELINK to the member function info. */
tree fnfields = member;
@@ -1476,115 +1502,109 @@ build_offset_ref (tree type, tree name)
/* Get rid of a potential OVERLOAD around it */
t = OVL_CURRENT (t);
- /* unique functions are handled easily. */
- perform_or_defer_access_check (basebinfo, t);
+ /* Unique functions are handled easily. */
+
+ /* For non-static member of base class, we need a special rule
+ for access checking [class.protected]:
+
+ If the access is to form a pointer to member, the
+ nested-name-specifier shall name the derived class
+ (or any class derived from that class). */
+ if (address_p && DECL_P (t)
+ && DECL_NONSTATIC_MEMBER_P (t))
+ perform_or_defer_access_check (TYPE_BINFO (type), t);
+ else
+ perform_or_defer_access_check (basebinfo, t);
+
mark_used (t);
if (DECL_STATIC_FUNCTION_P (t))
return t;
- t = build (OFFSET_REF, TREE_TYPE (t), decl, t);
- PTRMEM_OK_P (t) = 1;
- return t;
+ member = t;
+ }
+ else
+ {
+ TREE_TYPE (fnfields) = unknown_type_node;
+ member = fnfields;
}
-
- TREE_TYPE (fnfields) = unknown_type_node;
-
- t = build (OFFSET_REF, unknown_type_node, decl, fnfields);
- PTRMEM_OK_P (t) = 1;
- return t;
}
+ else if (address_p && TREE_CODE (member) == FIELD_DECL)
+ /* We need additional test besides the one in
+ check_accessibility_of_qualified_id in case it is
+ a pointer to non-static member. */
+ perform_or_defer_access_check (TYPE_BINFO (type), member);
- if (member == NULL_TREE)
+ if (!address_p)
{
- error ("`%D' is not a member of type `%T'", name, type);
- return error_mark_node;
- }
+ /* If MEMBER is non-static, then the program has fallen afoul of
+ [expr.prim]:
- if (TREE_CODE (member) == TYPE_DECL)
- {
- TREE_USED (member) = 1;
- return member;
- }
- /* static class members and class-specific enum
- values can be returned without further ado. */
- if (TREE_CODE (member) == VAR_DECL || TREE_CODE (member) == CONST_DECL)
- {
- mark_used (member);
- return convert_from_reference (member);
- }
+ An id-expression that denotes a nonstatic data member or
+ nonstatic member function of a class can only be used:
- if (TREE_CODE (member) == FIELD_DECL && DECL_C_BIT_FIELD (member))
- {
- error ("invalid pointer to bit-field `%D'", member);
- return error_mark_node;
- }
+ -- as part of a class member access (_expr.ref_) in which the
+ object-expression refers to the member's class or a class
+ derived from that class, or
- /* static class functions too. */
- if (TREE_CODE (member) == FUNCTION_DECL
- && TREE_CODE (TREE_TYPE (member)) == FUNCTION_TYPE)
- abort ();
+ -- to form a pointer to member (_expr.unary.op_), or
+
+ -- in the body of a nonstatic member function of that class or
+ of a class derived from that class (_class.mfct.nonstatic_), or
+
+ -- in a mem-initializer for a constructor for that class or for
+ a class derived from that class (_class.base.init_). */
+ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (member))
+ {
+ /* In Microsoft mode, treat a non-static member function as if
+ it were a pointer-to-member. */
+ if (flag_ms_extensions)
+ {
+ member = build (OFFSET_REF, TREE_TYPE (member), decl, member);
+ PTRMEM_OK_P (member) = 1;
+ return build_unary_op (ADDR_EXPR, member, 0);
+ }
+ error ("invalid use of non-static member function `%D'", member);
+ return error_mark_node;
+ }
+ else if (TREE_CODE (member) == FIELD_DECL)
+ {
+ error ("invalid use of non-static data member `%D'", member);
+ return error_mark_node;
+ }
+ return member;
+ }
/* In member functions, the form `type::name' is no longer
equivalent to `this->type::name', at least not until
resolve_offset_ref. */
- member = build (OFFSET_REF, build_offset_type (type, TREE_TYPE (member)),
- decl, member);
+ member = build (OFFSET_REF, TREE_TYPE (member), decl, member);
PTRMEM_OK_P (member) = 1;
return member;
}
-/* If a OFFSET_REF made it through to here, then it did
- not have its address taken. */
+/* If DECL is a `const' declaration, and its value is a known
+ constant, then return that value. */
tree
-resolve_offset_ref (tree exp)
+decl_constant_value (tree decl)
{
- tree member;
-
- my_friendly_assert (TREE_CODE (exp) == OFFSET_REF, 20030703);
-
- member = TREE_OPERAND (exp, 1);
-
- /* If MEMBER is non-static, then the program has fallen afoul of
- [expr.prim]:
-
- An id-expression that denotes a nonstatic data member or
- nonstatic member function of a class can only be used:
-
- -- as part of a class member access (_expr.ref_) in which the
- object-expression refers to the member's class or a class
- derived from that class, or
-
- -- to form a pointer to member (_expr.unary.op_), or
-
- -- in the body of a nonstatic member function of that class or
- of a class derived from that class (_class.mfct.nonstatic_), or
-
- -- in a mem-initializer for a constructor for that class or for
- a class derived from that class (_class.base.init_). */
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (member))
- {
- /* In Microsoft mode, treat a non-static member function as if
- it were a pointer-to-member. */
- if (flag_ms_extensions)
- return build_unary_op (ADDR_EXPR, exp, 0);
- error ("invalid use of non-static member function `%D'", member);
- return error_mark_node;
- }
- else if (TREE_CODE (member) == FIELD_DECL)
+ /* When we build a COND_EXPR, we don't know whether it will be used
+ as an lvalue or as an rvalue. If it is an lvalue, it's not safe
+ to replace the second and third operands with their
+ initializers. So, we do that here. */
+ if (TREE_CODE (decl) == COND_EXPR)
{
- error ("invalid use of non-static data member `%D'", member);
- return error_mark_node;
- }
+ tree d1;
+ tree d2;
- return member;
-}
+ d1 = decl_constant_value (TREE_OPERAND (decl, 1));
+ d2 = decl_constant_value (TREE_OPERAND (decl, 2));
-/* If DECL is a `const' declaration, and its value is a known
- constant, then return that value. */
+ if (d1 != TREE_OPERAND (decl, 1) || d2 != TREE_OPERAND (decl, 2))
+ return build (COND_EXPR,
+ TREE_TYPE (decl),
+ TREE_OPERAND (decl, 0), d1, d2);
+ }
-tree
-decl_constant_value (tree decl)
-{
if (TREE_READONLY_DECL_P (decl)
&& ! TREE_THIS_VOLATILE (decl)
&& DECL_INITIAL (decl)
@@ -2139,12 +2159,8 @@ build_new_1 (tree exp)
means allocate an int, and initialize it with 10. */
if (TREE_CODE (init) == TREE_LIST)
- {
- if (TREE_CHAIN (init) != NULL_TREE)
- pedwarn
- ("initializer list being treated as compound expression");
- init = build_compound_expr (init);
- }
+ init = build_x_compound_expr_from_list (init, "new initializer");
+
else if (TREE_CODE (init) == CONSTRUCTOR
&& TREE_TYPE (init) == NULL_TREE)
{
@@ -2279,7 +2295,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
tree body;
/* This is the LOOP_EXPR that governs the deletion of the elements. */
- tree loop;
+ tree loop = 0;
/* This is the thing that governs what to do after the loop has run. */
tree deallocate_expr = 0;
@@ -2295,10 +2311,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
abort ();
if (! IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
- {
- loop = integer_zero_node;
- goto no_destructor;
- }
+ goto no_destructor;
/* The below is short by the cookie size. */
virtual_size = size_binop (MULT_EXPR, size_exp,
@@ -2313,32 +2326,21 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
controller = build (BIND_EXPR, void_type_node, tbase, NULL_TREE, NULL_TREE);
TREE_SIDE_EFFECTS (controller) = 1;
- body = NULL_TREE;
-
- body = tree_cons (NULL_TREE,
- build_delete (ptype, tbase, sfk_complete_destructor,
- LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1),
- body);
-
- body = tree_cons (NULL_TREE,
- build_modify_expr (tbase, NOP_EXPR, build (MINUS_EXPR, ptype, tbase, size_exp)),
- body);
-
- body = tree_cons (NULL_TREE,
- build (EXIT_EXPR, void_type_node,
- build (EQ_EXPR, boolean_type_node, base, tbase)),
- body);
-
- loop = build (LOOP_EXPR, void_type_node, build_compound_expr (body));
+ body = build (EXIT_EXPR, void_type_node,
+ build (EQ_EXPR, boolean_type_node, base, tbase));
+ body = build_compound_expr
+ (body, build_modify_expr (tbase, NOP_EXPR,
+ build (MINUS_EXPR, ptype, tbase, size_exp)));
+ body = build_compound_expr
+ (body, build_delete (ptype, tbase, sfk_complete_destructor,
+ LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1));
- loop = tree_cons (NULL_TREE, tbase_init,
- tree_cons (NULL_TREE, loop, NULL_TREE));
- loop = build_compound_expr (loop);
+ loop = build (LOOP_EXPR, void_type_node, body);
+ loop = build_compound_expr (tbase_init, loop);
no_destructor:
/* If the delete flag is one, or anything else with the low bit set,
delete the storage. */
- deallocate_expr = integer_zero_node;
if (auto_delete_vec != sfk_base_destructor)
{
tree base_tbd;
@@ -2371,15 +2373,17 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
virtual_size);
}
- if (loop && deallocate_expr != integer_zero_node)
- {
- body = tree_cons (NULL_TREE, loop,
- tree_cons (NULL_TREE, deallocate_expr, NULL_TREE));
- body = build_compound_expr (body);
- }
+ body = loop;
+ if (!deallocate_expr)
+ ;
+ else if (!body)
+ body = deallocate_expr;
else
- body = loop;
-
+ body = build_compound_expr (body, deallocate_expr);
+
+ if (!body)
+ body = integer_zero_node;
+
/* Outermost wrapper: If pointer is null, punt. */
body = fold (build (COND_EXPR, void_type_node,
fold (build (NE_EXPR, boolean_type_node, base,
@@ -2430,10 +2434,8 @@ get_temp_regvar (tree type, tree init)
tree decl;
decl = create_temporary_var (type);
- if (building_stmt_tree ())
- add_decl_stmt (decl);
- else
- SET_DECL_RTL (decl, assign_temp (type, 2, 0, 1));
+ add_decl_stmt (decl);
+
finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
return decl;
@@ -2475,7 +2477,8 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
tree try_block = NULL_TREE;
tree try_body = NULL_TREE;
int num_initialized_elts = 0;
-
+ bool is_global;
+
if (TYPE_DOMAIN (atype))
maxindex = array_type_nelts (atype);
@@ -2508,7 +2511,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
base = cp_convert (ptype, decay_conversion (base));
/* The code we are generating looks like:
-
+ ({
T* t1 = (T*) base;
T* rval = t1;
ptrdiff_t iterator = maxindex;
@@ -2520,7 +2523,8 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
} catch (...) {
... destroy elements that were constructed ...
}
- return rval;
+ rval;
+ })
We can omit the try and catch blocks if we know that the
initialization will never throw an exception, or if the array
@@ -2536,7 +2540,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
of whatever cleverness the back-end has for dealing with copies
of blocks of memory. */
- begin_init_stmts (&stmt_expr, &compound_stmt);
+ is_global = begin_init_stmts (&stmt_expr, &compound_stmt);
destroy_temps = stmts_are_full_exprs_p ();
current_stmt_tree ()->stmts_are_full_exprs_p = 0;
rval = get_temp_regvar (ptype, base);
@@ -2550,7 +2554,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
&& from_array != 2)
{
try_block = begin_try_block ();
- try_body = begin_compound_stmt (/*has_no_scope=*/1);
+ try_body = begin_compound_stmt (/*has_no_scope=*/true);
}
if (init != NULL_TREE && TREE_CODE (init) == CONSTRUCTOR)
@@ -2629,21 +2633,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
for_stmt);
/* Otherwise, loop through the elements. */
- for_body = begin_compound_stmt (/*has_no_scope=*/1);
-
- /* When we're not building a statement-tree, things are a little
- complicated. If, when we recursively call build_aggr_init,
- an expression containing a TARGET_EXPR is expanded, then it
- may get a cleanup. Then, the result of that expression is
- passed to finish_expr_stmt, which will call
- expand_start_target_temps/expand_end_target_temps. However,
- the latter call will not cause the cleanup to run because
- that block will still be on the block stack. So, we call
- expand_start_target_temps here manually; the corresponding
- call to expand_end_target_temps below will cause the cleanup
- to be performed. */
- if (!building_stmt_tree ())
- expand_start_target_temps ();
+ for_body = begin_compound_stmt (/*has_no_scope=*/true);
if (from_array)
{
@@ -2676,25 +2666,15 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
elt_init = build_aggr_init (build1 (INDIRECT_REF, type, base),
init, 0);
- /* The initialization of each array element is a
- full-expression, as per core issue 124. */
- if (!building_stmt_tree ())
- {
- genrtl_expr_stmt (elt_init);
- expand_end_target_temps ();
- }
- else
- {
- current_stmt_tree ()->stmts_are_full_exprs_p = 1;
- finish_expr_stmt (elt_init);
- current_stmt_tree ()->stmts_are_full_exprs_p = 0;
- }
+ current_stmt_tree ()->stmts_are_full_exprs_p = 1;
+ finish_expr_stmt (elt_init);
+ current_stmt_tree ()->stmts_are_full_exprs_p = 0;
finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base, 0));
if (base2)
finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base2, 0));
- finish_compound_stmt (/*has_no_scope=*/1, for_body);
+ finish_compound_stmt (for_body);
finish_for_stmt (for_stmt);
}
@@ -2714,20 +2694,24 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
type = strip_array_types (type);
}
- finish_compound_stmt (/*has_no_scope=*/1, try_body);
+ finish_compound_stmt (try_body);
finish_cleanup_try_block (try_block);
- e = build_vec_delete_1 (rval, m,
- type,
- sfk_base_destructor,
+ e = build_vec_delete_1 (rval, m, type, sfk_base_destructor,
/*use_global_delete=*/0);
finish_cleanup (e, try_block);
}
- /* The value of the array initialization is the address of the
- first element in the array. */
- finish_expr_stmt (rval);
+ /* The value of the array initialization is the array itself, RVAL
+ is a pointer to the first element. */
+ finish_stmt_expr_expr (rval);
+
+ stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt);
- stmt_expr = finish_init_stmts (stmt_expr, compound_stmt);
+ /* Now convert make the result have the correct type. */
+ atype = build_pointer_type (atype);
+ stmt_expr = build1 (NOP_EXPR, atype, stmt_expr);
+ stmt_expr = build_indirect_ref (stmt_expr, NULL);
+
current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps;
return stmt_expr;
}
@@ -3034,24 +3018,23 @@ tree
build_vbase_delete (tree type, tree decl)
{
tree vbases = CLASSTYPE_VBASECLASSES (type);
- tree result = NULL_TREE;
+ tree result;
tree addr = build_unary_op (ADDR_EXPR, decl, 0);
my_friendly_assert (addr != error_mark_node, 222);
- while (vbases)
+ for (result = convert_to_void (integer_zero_node, NULL);
+ vbases; vbases = TREE_CHAIN (vbases))
{
- tree this_addr
- = convert_force (build_pointer_type (BINFO_TYPE (TREE_VALUE (vbases))),
- addr, 0);
- result = tree_cons (NULL_TREE,
- build_delete (TREE_TYPE (this_addr), this_addr,
- sfk_base_destructor,
- LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 0),
- result);
- vbases = TREE_CHAIN (vbases);
+ tree base_addr = convert_force
+ (build_pointer_type (BINFO_TYPE (TREE_VALUE (vbases))), addr, 0);
+ tree base_delete = build_delete
+ (TREE_TYPE (base_addr), base_addr, sfk_base_destructor,
+ LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 0);
+
+ result = build_compound_expr (result, base_delete);
}
- return build_compound_expr (nreverse (result));
+ return result;
}
/* Build a C++ vector delete expression.
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 7d63e2c99da..6d5482330b2 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -49,7 +49,6 @@ static void handle_pragma_interface (cpp_reader *);
static void handle_pragma_implementation (cpp_reader *);
static void handle_pragma_java_exceptions (cpp_reader *);
-static int is_global (tree);
static void init_operators (void);
static void copy_lang_type (tree);
@@ -206,8 +205,6 @@ init_operators (void)
operator_name_info [(int) FLOOR_MOD_EXPR].name = "(floor %)";
operator_name_info [(int) ROUND_MOD_EXPR].name = "(round %)";
operator_name_info [(int) ABS_EXPR].name = "abs";
- operator_name_info [(int) FFS_EXPR].name = "ffs";
- operator_name_info [(int) BIT_ANDTC_EXPR].name = "&~";
operator_name_info [(int) TRUTH_AND_EXPR].name = "strict &&";
operator_name_info [(int) TRUTH_OR_EXPR].name = "strict ||";
operator_name_info [(int) IN_EXPR].name = "in";
@@ -355,7 +352,7 @@ init_reswords (void)
int mask = ((flag_no_asm ? D_ASM : 0)
| (flag_no_gnu_keywords ? D_EXT : 0));
- ridpointers = (tree *) ggc_calloc ((int) RID_MAX, sizeof (tree));
+ ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree));
for (i = 0; i < ARRAY_SIZE (reswords); i++)
{
id = get_identifier (reswords[i].word);
@@ -507,28 +504,6 @@ interface_strcmp (const char* s)
return 1;
}
-void
-note_got_semicolon (tree type)
-{
- if (!TYPE_P (type))
- abort ();
- if (CLASS_TYPE_P (type))
- CLASSTYPE_GOT_SEMICOLON (type) = 1;
-}
-
-void
-note_list_got_semicolon (tree declspecs)
-{
- tree link;
-
- for (link = declspecs; link; link = TREE_CHAIN (link))
- {
- tree type = TREE_VALUE (link);
- if (type && TYPE_P (type))
- note_got_semicolon (type);
- }
- clear_anon_tags ();
-}
/* Parse a #pragma whose sole argument is a string constant.
@@ -644,7 +619,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED )
}
if (ifiles == 0)
{
- ifiles = (struct impl_files*) xmalloc (sizeof (struct impl_files));
+ ifiles = xmalloc (sizeof (struct impl_files));
ifiles->filename = main_filename;
ifiles->next = impl_file_chain;
impl_file_chain = ifiles;
@@ -662,30 +637,10 @@ handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED )
choose_personality_routine (lang_java);
}
-/* Return true if d is in a global scope. */
-
-static int
-is_global (tree d)
-{
- while (1)
- switch (TREE_CODE (d))
- {
- case ERROR_MARK:
- return 1;
-
- case OVERLOAD: d = OVL_FUNCTION (d); continue;
- case TREE_LIST: d = TREE_VALUE (d); continue;
- default:
- my_friendly_assert (DECL_P (d), 980629);
-
- return DECL_NAMESPACE_SCOPE_P (d);
- }
-}
-
/* Issue an error message indicating that the lookup of NAME (an
- IDENTIFIER_NODE) failed. */
+ IDENTIFIER_NODE) failed. Returns the ERROR_MARK_NODE. */
-void
+tree
unqualified_name_lookup_error (tree name)
{
if (IDENTIFIER_OPNAME_P (name))
@@ -714,195 +669,50 @@ unqualified_name_lookup_error (tree name)
SET_IDENTIFIER_NAMESPACE_VALUE (name, error_mark_node);
SET_IDENTIFIER_ERROR_LOCUS (name, current_function_decl);
}
-}
-
-tree
-do_identifier (register tree token, tree args)
-{
- register tree id;
-
- timevar_push (TV_NAME_LOOKUP);
- id = lookup_name (token, 0);
-
- /* Do Koenig lookup if appropriate (inside templates we build lookup
- expressions instead).
-
- [basic.lookup.koenig]: If the ordinary unqualified lookup of the name
- finds the declaration of a class member function, the associated
- namespaces and classes are not considered. */
-
- if (args && !current_template_parms && (!id || is_global (id)))
- id = lookup_arg_dependent (token, id, args);
-
- if (id == error_mark_node)
- {
- /* lookup_name quietly returns error_mark_node if we're parsing,
- as we don't want to complain about an identifier that ends up
- being used as a declarator. So we call it again to get the error
- message. */
- id = lookup_name (token, 0);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
- }
-
- if (!id || (TREE_CODE (id) == FUNCTION_DECL
- && DECL_ANTICIPATED (id)))
- {
- if (current_template_parms)
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP,
- build_min_nt (LOOKUP_EXPR, token));
- else if (IDENTIFIER_TYPENAME_P (token))
- /* A templated conversion operator might exist. */
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, token);
- else
- {
- unqualified_name_lookup_error (token);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
- }
- }
-
- id = check_for_out_of_scope_variable (id);
- /* TREE_USED is set in `hack_identifier'. */
- if (TREE_CODE (id) == CONST_DECL)
- {
- /* Check access. */
- if (IDENTIFIER_CLASS_VALUE (token) == id)
- perform_or_defer_access_check (TYPE_BINFO (DECL_CONTEXT (id)), id);
- if (!processing_template_decl || DECL_TEMPLATE_PARM_P (id))
- id = DECL_INITIAL (id);
- }
- else
- id = hack_identifier (id, token);
-
- /* We must look up dependent names when the template is
- instantiated, not while parsing it. For now, we don't
- distinguish between dependent and independent names. So, for
- example, we look up all overloaded functions at
- instantiation-time, even though in some cases we should just use
- the DECL we have here. We also use LOOKUP_EXPRs to find things
- like local variables, rather than creating TEMPLATE_DECLs for the
- local variables and then finding matching instantiations. */
- if (current_template_parms
- && (is_overloaded_fn (id)
- || (TREE_CODE (id) == VAR_DECL
- && CP_DECL_CONTEXT (id)
- && TREE_CODE (CP_DECL_CONTEXT (id)) == FUNCTION_DECL)
- || TREE_CODE (id) == PARM_DECL
- || TREE_CODE (id) == RESULT_DECL
- || TREE_CODE (id) == USING_DECL))
- id = build_min_nt (LOOKUP_EXPR, token);
-
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
+ return error_mark_node;
}
+/* Like unqualified_name_lookup_error, but NAME is an unqualified-id
+ used as a function. Returns an appropriate expression for
+ NAME. */
+
tree
-do_scoped_id (tree token, tree id)
+unqualified_fn_lookup_error (tree name)
{
- timevar_push (TV_NAME_LOOKUP);
- if (!id || (TREE_CODE (id) == FUNCTION_DECL
- && DECL_ANTICIPATED (id)))
- {
- if (processing_template_decl)
- {
- id = build_min_nt (LOOKUP_EXPR, token);
- LOOKUP_EXPR_GLOBAL (id) = 1;
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
- }
- if (IDENTIFIER_NAMESPACE_VALUE (token) != error_mark_node)
- error ("`::%D' undeclared (first use here)", token);
- id = error_mark_node;
- /* Prevent repeated error messages. */
- SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node);
- }
- else
- {
- if (TREE_CODE (id) == ADDR_EXPR)
- mark_used (TREE_OPERAND (id, 0));
- else if (TREE_CODE (id) != OVERLOAD)
- mark_used (id);
- }
- if (TREE_CODE (id) == CONST_DECL && ! processing_template_decl)
- {
- /* XXX CHS - should we set TREE_USED of the constant? */
- id = DECL_INITIAL (id);
- /* This is to prevent an enum whose value is 0
- from being considered a null pointer constant. */
- id = build1 (NOP_EXPR, TREE_TYPE (id), id);
- TREE_CONSTANT (id) = 1;
- }
-
if (processing_template_decl)
{
- if (is_overloaded_fn (id))
+ /* In a template, it is invalid to write "f()" or "f(3)" if no
+ declaration of "f" is available. Historically, G++ and most
+ other compilers accepted that usage since they deferred all name
+ lookup until instantiation time rather than doing unqualified
+ name lookup at template definition time; explain to the user what
+ is going wrong.
+
+ Note that we have the exact wording of the following message in
+ the manual (trouble.texi, node "Name lookup"), so they need to
+ be kept in synch. */
+ pedwarn ("there are no arguments to `%D' that depend on a template "
+ "parameter, so a declaration of `%D' must be available",
+ name, name);
+
+ if (!flag_permissive)
{
- id = build_min_nt (LOOKUP_EXPR, token);
- LOOKUP_EXPR_GLOBAL (id) = 1;
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
+ static bool hint;
+ if (!hint)
+ {
+ error ("(if you use `-fpermissive', G++ will accept your code, "
+ "but allowing the use of an undeclared name is "
+ "deprecated)");
+ hint = true;
+ }
}
- /* else just use the decl */
- }
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, convert_from_reference (id));
-}
-
-tree
-identifier_typedecl_value (tree node)
-{
- tree t, type;
- type = IDENTIFIER_TYPE_VALUE (node);
- if (type == NULL_TREE)
- return NULL_TREE;
-
- if (IDENTIFIER_BINDING (node))
- {
- t = IDENTIFIER_VALUE (node);
- if (t && TREE_CODE (t) == TYPE_DECL && TREE_TYPE (t) == type)
- return t;
- }
- if (IDENTIFIER_NAMESPACE_VALUE (node))
- {
- t = IDENTIFIER_NAMESPACE_VALUE (node);
- if (t && TREE_CODE (t) == TYPE_DECL && TREE_TYPE (t) == type)
- return t;
+ return name;
}
- /* Will this one ever happen? */
- if (TYPE_MAIN_DECL (type))
- return TYPE_MAIN_DECL (type);
-
- /* We used to do an internal error of 62 here, but instead we will
- handle the return of a null appropriately in the callers. */
- return NULL_TREE;
+ return unqualified_name_lookup_error (name);
}
-#ifdef GATHER_STATISTICS
-/* The original for tree_node_kind is in the toplevel tree.c; changes there
- need to be brought into here, unless this were actually put into a header
- instead. */
-/* Statistics-gathering stuff. */
-typedef enum
-{
- d_kind,
- t_kind,
- b_kind,
- s_kind,
- r_kind,
- e_kind,
- c_kind,
- id_kind,
- op_id_kind,
- perm_list_kind,
- temp_list_kind,
- vec_kind,
- x_kind,
- lang_decl,
- lang_type,
- all_kinds
-} tree_node_kind;
-
-extern int tree_node_counts[];
-extern int tree_node_sizes[];
-#endif
-
tree
build_lang_decl (enum tree_code code, tree name, tree type)
{
@@ -928,7 +738,7 @@ retrofit_lang_decl (tree t)
else
size = sizeof (struct lang_decl_flags);
- ld = (struct lang_decl *) ggc_alloc_cleared (size);
+ ld = ggc_alloc_cleared (size);
ld->decl_flags.can_be_full = CAN_HAVE_FULL_LANG_DECL_P (t) ? 1 : 0;
ld->decl_flags.u1sel = TREE_CODE (t) == NAMESPACE_DECL ? 1 : 0;
@@ -964,7 +774,7 @@ cxx_dup_lang_specific_decl (tree node)
size = sizeof (struct lang_decl_flags);
else
size = sizeof (struct lang_decl);
- ld = (struct lang_decl *) ggc_alloc (size);
+ ld = ggc_alloc (size);
memcpy (ld, DECL_LANG_SPECIFIC (node), size);
DECL_LANG_SPECIFIC (node) = ld;
@@ -1001,7 +811,7 @@ copy_lang_type (tree node)
size = sizeof (struct lang_type);
else
size = sizeof (struct lang_type_ptrmem);
- lt = (struct lang_type *) ggc_alloc (size);
+ lt = ggc_alloc (size);
memcpy (lt, TYPE_LANG_SPECIFIC (node), size);
TYPE_LANG_SPECIFIC (node) = lt;
@@ -1034,8 +844,7 @@ cxx_make_type (enum tree_code code)
{
struct lang_type *pi;
- pi = ((struct lang_type *)
- ggc_alloc_cleared (sizeof (struct lang_type)));
+ pi = ggc_alloc_cleared (sizeof (struct lang_type));
TYPE_LANG_SPECIFIC (t) = pi;
pi->u.c.h.is_lang_type_class = 1;
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 29fd523c727..ba7cf92c052 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1926,8 +1926,6 @@ write_expression (tree expr)
{
template_args = TREE_OPERAND (member, 1);
member = TREE_OPERAND (member, 0);
- if (TREE_CODE (member) == LOOKUP_EXPR)
- member = TREE_OPERAND (member, 0);
}
else
template_args = NULL_TREE;
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index e1ffaad3769..52770042bee 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -88,119 +88,6 @@ set_mangled_name_for_decl (tree decl)
}
-/* This function takes an identifier, ID, and attempts to figure out what
- it means. There are a number of possible scenarios, presented in increasing
- order of hair:
-
- 1) not in a class's scope
- 2) in class's scope, member name of the class's method
- 3) in class's scope, but not a member name of the class
- 4) in class's scope, member name of a class's variable
-
- NAME is $1 from the bison rule. It is an IDENTIFIER_NODE.
- VALUE is $$ from the bison rule. It is the value returned by lookup_name ($1)
-
- As a last ditch, try to look up the name as a label and return that
- address.
-
- Values which are declared as being of REFERENCE_TYPE are
- automatically dereferenced here (as a hack to make the
- compiler faster). */
-
-tree
-hack_identifier (tree value, tree name)
-{
- tree type;
-
- if (value == error_mark_node)
- return error_mark_node;
-
- type = TREE_TYPE (value);
- if (TREE_CODE (value) == FIELD_DECL)
- value = finish_non_static_data_member (value,
- /*qualifying_scope=*/NULL_TREE);
- else if ((TREE_CODE (value) == FUNCTION_DECL
- && DECL_FUNCTION_MEMBER_P (value))
- || (TREE_CODE (value) == OVERLOAD
- && DECL_FUNCTION_MEMBER_P (OVL_CURRENT (value))))
- {
- tree decl;
-
- if (TREE_CODE (value) == OVERLOAD)
- value = OVL_CURRENT (value);
-
- decl = maybe_dummy_object (DECL_CONTEXT (value), 0);
- value = finish_class_member_access_expr (decl, name);
- }
- else if (really_overloaded_fn (value))
- ;
- else if (TREE_CODE (value) == OVERLOAD)
- /* not really overloaded function */
- mark_used (OVL_FUNCTION (value));
- else if (TREE_CODE (value) == TREE_LIST)
- {
- /* Ambiguous reference to base members, possibly other cases?. */
- tree t = value;
- while (t && TREE_CODE (t) == TREE_LIST)
- {
- mark_used (TREE_VALUE (t));
- t = TREE_CHAIN (t);
- }
- }
- else if (TREE_CODE (value) == NAMESPACE_DECL)
- {
- error ("use of namespace `%D' as expression", value);
- return error_mark_node;
- }
- else if (DECL_CLASS_TEMPLATE_P (value))
- {
- error ("use of class template `%T' as expression", value);
- return error_mark_node;
- }
- else
- mark_used (value);
-
- if (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == PARM_DECL
- || TREE_CODE (value) == RESULT_DECL)
- {
- tree context = decl_function_context (value);
- if (context != NULL_TREE && context != current_function_decl
- && ! TREE_STATIC (value))
- {
- error ("use of %s from containing function",
- (TREE_CODE (value) == VAR_DECL
- ? "`auto' variable" : "parameter"));
- cp_error_at (" `%#D' declared here", value);
- value = error_mark_node;
- }
- }
-
- if (DECL_P (value) && DECL_NONLOCAL (value))
- {
- if (DECL_CLASS_SCOPE_P (value)
- && DECL_CONTEXT (value) != current_class_type)
- {
- tree path;
- path = currently_open_derived_class (DECL_CONTEXT (value));
- perform_or_defer_access_check (TYPE_BINFO (path), value);
- }
- }
- else if (TREE_CODE (value) == TREE_LIST
- && TREE_TYPE (value) == error_mark_node)
- {
- error ("\
-request for member `%D' is ambiguous in multiple inheritance lattice",
- name);
- print_candidates (value);
- return error_mark_node;
- }
-
- if (! processing_template_decl)
- value = convert_from_reference (value);
- return value;
-}
-
-
/* Return a this or result adjusting thunk to FUNCTION. THIS_ADJUSTING
indicates whether it is a this or result adjusting thunk.
FIXED_OFFSET and VIRTUAL_OFFSET indicate how to do the adjustment
@@ -436,7 +323,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
this translation unit. */
TREE_ADDRESSABLE (function) = 1;
mark_used (function);
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (function)) = 1;
+ mark_referenced (DECL_ASSEMBLER_NAME (function));
if (!emit_p)
return;
@@ -539,6 +426,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
tree x = copy_node (a);
TREE_CHAIN (x) = t;
DECL_CONTEXT (x) = thunk_fndecl;
+ SET_DECL_RTL (x, NULL_RTX);
t = x;
}
a = nreverse (t);
@@ -573,7 +461,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
/* Since we want to emit the thunk, we explicitly mark its name as
referenced. */
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (thunk_fndecl)) = 1;
+ mark_referenced (DECL_ASSEMBLER_NAME (thunk_fndecl));
/* But we don't want debugging information about it. */
DECL_IGNORED_P (thunk_fndecl) = 1;
@@ -581,7 +469,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
/* Re-enable access control. */
pop_deferring_access_checks ();
- expand_or_defer_fn (finish_function (0));
+ expand_body (finish_function (0));
}
pop_from_top_level ();
@@ -700,7 +588,7 @@ do_build_assign_ref (tree fndecl)
tree parm = TREE_CHAIN (DECL_ARGUMENTS (fndecl));
tree compound_stmt;
- compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/false);
parm = convert_from_reference (parm);
if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type)
@@ -718,7 +606,7 @@ do_build_assign_ref (tree fndecl)
int cvquals = cp_type_quals (TREE_TYPE (parm));
int i;
- /* Assign to each of thedirect base classes. */
+ /* Assign to each of the direct base classes. */
for (i = 0; i < CLASSTYPE_N_BASECLASSES (current_class_type); ++i)
{
tree binfo;
@@ -793,7 +681,7 @@ do_build_assign_ref (tree fndecl)
}
}
finish_return_stmt (current_class_ref);
- finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
+ finish_compound_stmt (compound_stmt);
}
void
@@ -857,8 +745,8 @@ synthesize_method (tree fndecl)
if (need_body)
{
tree compound_stmt;
- compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
- finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/false);
+ finish_compound_stmt (compound_stmt);
}
finish_function_body (stmt);
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 1a1a431c788..3a16b9c9578 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA. */
#include "cp-tree.h"
#include "name-lookup.h"
#include "timevar.h"
+#include "toplev.h"
/* 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
@@ -298,6 +299,93 @@ cxx_binding_free (cxx_binding *binding)
binding->previous = free_bindings;
free_bindings = binding;
}
+
+/* BINDING records an existing declaration for a namein the current scope.
+ But, DECL is another declaration for that same identifier in the
+ same scope. This is the `struct stat' hack whereby a non-typedef
+ class name or enum-name can be bound at the same level as some other
+ kind of entity.
+ 3.3.7/1
+
+ A class name (9.1) or enumeration name (7.2) can be hidden by the
+ name of an object, function, or enumerator declared in the same scope.
+ If a class or enumeration name and an object, function, or enumerator
+ are declared in the same scope (in any order) with the same name, the
+ class or enumeration name is hidden wherever the object, function, or
+ enumerator name is visible.
+
+ It's the responsibility of the caller to check that
+ inserting this name is valid here. Returns nonzero if the new binding
+ was successful. */
+
+bool
+supplement_binding (cxx_binding *binding, tree decl)
+{
+ tree bval = binding->value;
+ bool ok = true;
+
+ timevar_push (TV_NAME_LOOKUP);
+ 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. */
+ binding->value = decl;
+ else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval))
+ {
+ /* The old binding was a type name. It was placed in
+ BINDING_VALUE because it was thought, at the point it was
+ declared, to be the only entity with such a name. Move the
+ type name into the type slot; it is now hidden by the new
+ binding. */
+ binding->type = bval;
+ binding->value = decl;
+ binding->value_is_inherited = false;
+ }
+ else if (TREE_CODE (bval) == TYPE_DECL
+ && TREE_CODE (decl) == TYPE_DECL
+ && DECL_NAME (decl) == DECL_NAME (bval)
+ && (same_type_p (TREE_TYPE (decl), TREE_TYPE (bval))
+ /* If either type involves template parameters, we must
+ wait until instantiation. */
+ || uses_template_parms (TREE_TYPE (decl))
+ || uses_template_parms (TREE_TYPE (bval))))
+ /* We have two typedef-names, both naming the same type to have
+ the same name. This is OK because of:
+
+ [dcl.typedef]
+
+ In a given scope, a typedef specifier can be used to redefine
+ the name of any type declared in that scope to refer to the
+ type to which it already refers. */
+ ok = false;
+ /* There can be two block-scope declarations of the same variable,
+ so long as they are `extern' declarations. However, there cannot
+ be two declarations of the same static data member:
+
+ [class.mem]
+
+ A member shall not be declared twice in the
+ member-specification. */
+ else if (TREE_CODE (decl) == VAR_DECL && TREE_CODE (bval) == VAR_DECL
+ && DECL_EXTERNAL (decl) && DECL_EXTERNAL (bval)
+ && !DECL_CLASS_SCOPE_P (decl))
+ {
+ duplicate_decls (decl, binding->value);
+ ok = false;
+ }
+ else
+ {
+ error ("declaration of `%#D'", decl);
+ cp_error_at ("conflicts with previous declaration `%#D'",
+ binding->value);
+ ok = false;
+ }
+
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ok);
+}
/* Return (from the stack of) the BINDING, if any, establihsed at SCOPE. */
@@ -377,7 +465,12 @@ set_namespace_binding (tree name, tree scope, tree val)
if (scope == NULL_TREE)
scope = global_namespace;
b = binding_for_name (NAMESPACE_LEVEL (scope), name);
- BINDING_VALUE (b) = val;
+ if (!BINDING_VALUE (b)
+ || TREE_CODE (val) == OVERLOAD
+ || val == error_mark_node)
+ BINDING_VALUE (b) = val;
+ else
+ supplement_binding (b, val);
timevar_pop (TV_NAME_LOOKUP);
}
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index 943106e7462..6a0917eddc9 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -107,6 +107,7 @@ struct cxx_binding GTY(())
extern cxx_binding *cxx_binding_make (tree, tree);
extern void cxx_binding_free (cxx_binding *);
+extern bool supplement_binding (cxx_binding *, tree);
/* True if SCOPE designates the global scope binding contour. */
#define global_scope_p(SCOPE) \
diff --git a/gcc/cp/operators.def b/gcc/cp/operators.def
index b4de745a154..16e603d31bf 100644
--- a/gcc/cp/operators.def
+++ b/gcc/cp/operators.def
@@ -93,8 +93,10 @@ DEF_SIMPLE_OPERATOR ("!", TRUTH_NOT_EXPR, "nt", 1)
DEF_SIMPLE_OPERATOR ("++", PREINCREMENT_EXPR, "pp", 1)
DEF_SIMPLE_OPERATOR ("--", PREDECREMENT_EXPR, "mm", 1)
DEF_SIMPLE_OPERATOR ("sizeof", SIZEOF_EXPR, "sz", 1)
-/* This is an extension. */
+/* These are extensions. */
DEF_SIMPLE_OPERATOR ("alignof", ALIGNOF_EXPR, "v17alignof", 1)
+DEF_SIMPLE_OPERATOR ("__imag__", IMAGPART_EXPR, "v18__imag__", 1)
+DEF_SIMPLE_OPERATOR ("__real__", REALPART_EXPR, "v18__real__", 1)
/* The cast operator. */
DEF_SIMPLE_OPERATOR ("", TYPE_EXPR, "cv", 1)
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index c52970fd4b6..2b7df6c5244 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -49,17 +49,6 @@ optimize_function (tree fn)
{
dump_function (TDI_original, fn);
- /* While in this function, we may choose to go off and compile
- another function. For example, we might instantiate a function
- in the hopes of inlining it. Normally, that wouldn't trigger any
- actual RTL code-generation -- but it will if the template is
- actually needed. (For example, if it's address is taken, or if
- some other function already refers to the template.) If
- code-generation occurs, then garbage collection will occur, so we
- must protect ourselves, just as we do while building up the body
- of the function. */
- ++function_depth;
-
if (flag_inline_trees
/* We do not inline thunks, as (a) the backend tries to optimize
the call to the thunkee, (b) tree based inlining breaks that
@@ -68,13 +57,9 @@ optimize_function (tree fn)
&& !DECL_THUNK_P (fn))
{
optimize_inline_calls (fn);
-
dump_function (TDI_inlined, fn);
}
- /* Undo the call to ggc_push_context above. */
- --function_depth;
-
dump_function (TDI_optimized, fn);
}
@@ -135,7 +120,6 @@ bool
maybe_clone_body (tree fn)
{
tree clone;
- bool first = true;
/* We only clone constructors and destructors. */
if (!DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)
@@ -145,11 +129,16 @@ maybe_clone_body (tree fn)
/* Emit the DWARF1 abstract instance. */
(*debug_hooks->deferred_inline_function) (fn);
+ /* Our caller does not expect collection to happen, which it might if
+ we decide to compile the function to rtl now. Arrange for a new
+ gc context to be created if so. */
+ function_depth++;
+
/* We know that any clones immediately follow FN in the TYPE_METHODS
list. */
for (clone = TREE_CHAIN (fn);
clone && DECL_CLONED_FUNCTION_P (clone);
- clone = TREE_CHAIN (clone), first = false)
+ clone = TREE_CHAIN (clone))
{
tree parm;
tree clone_parm;
@@ -159,7 +148,6 @@ maybe_clone_body (tree fn)
/* Update CLONE's source position information to match FN's. */
DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
DECL_INLINE (clone) = DECL_INLINE (fn);
- DID_INLINE_FUNC (clone) = DID_INLINE_FUNC (fn);
DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
DECL_COMDAT (clone) = DECL_COMDAT (fn);
DECL_WEAK (clone) = DECL_WEAK (fn);
@@ -186,13 +174,8 @@ maybe_clone_body (tree fn)
clone_parm = TREE_CHAIN (clone_parm);
for (; parm;
parm = TREE_CHAIN (parm), clone_parm = TREE_CHAIN (clone_parm))
- {
- /* Update this parameter. */
- update_cloned_parm (parm, clone_parm);
- /* We should only give unused information for one clone. */
- if (!first)
- TREE_USED (clone_parm) = 1;
- }
+ /* Update this parameter. */
+ update_cloned_parm (parm, clone_parm);
/* Start processing the function. */
push_to_top_level ();
@@ -269,6 +252,8 @@ maybe_clone_body (tree fn)
pop_from_top_level ();
}
+ function_depth--;
+
/* We don't need to process the original function any further. */
return 1;
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 19f55f40a8e..4114aeaa24d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -68,19 +68,20 @@
typedef struct cp_token GTY (())
{
/* The kind of token. */
- enum cpp_ttype type;
- /* The value associated with this token, if any. */
- tree value;
+ enum cpp_ttype type : 8;
/* If this token is a keyword, this value indicates which keyword.
Otherwise, this value is RID_MAX. */
- enum rid keyword;
+ enum rid keyword : 8;
+ /* The value associated with this token, if any. */
+ tree value;
/* The location at which this token was found. */
location_t location;
} cp_token;
-/* The number of tokens in a single token block. */
+/* The number of tokens in a single token block.
+ Computed so that cp_token_block fits in a 512B allocation unit. */
-#define CP_TOKEN_BLOCK_NUM_TOKENS 32
+#define CP_TOKEN_BLOCK_NUM_TOKENS ((512 - 3*sizeof (char*))/sizeof (cp_token))
/* A group of tokens. These groups are chained together to store
large numbers of tokens. (For example, a token block is created
@@ -127,7 +128,7 @@ static void cp_token_cache_push_token
static cp_token_cache *
cp_token_cache_new ()
{
- return (cp_token_cache *) ggc_alloc_cleared (sizeof (cp_token_cache));
+ return ggc_alloc_cleared (sizeof (cp_token_cache));
}
/* Add *TOKEN to *CACHE. */
@@ -141,7 +142,7 @@ cp_token_cache_push_token (cp_token_cache *cache,
/* See if we need to allocate a new token block. */
if (!b || b->num_tokens == CP_TOKEN_BLOCK_NUM_TOKENS)
{
- b = ((cp_token_block *) ggc_alloc_cleared (sizeof (cp_token_block)));
+ b = ggc_alloc_cleared (sizeof (cp_token_block));
b->prev = cache->last;
if (cache->last)
{
@@ -302,14 +303,13 @@ cp_lexer_new_main (void)
which is a GC collection point. So we have to grab the first
token before allocating any memory. */
cp_lexer_get_preprocessor_token (NULL, &first_token);
- cpp_get_callbacks (parse_in)->valid_pch = NULL;
+ c_common_no_more_pch ();
/* Allocate the memory. */
- lexer = (cp_lexer *) ggc_alloc_cleared (sizeof (cp_lexer));
+ lexer = ggc_alloc_cleared (sizeof (cp_lexer));
/* Create the circular buffer. */
- lexer->buffer = ((cp_token *)
- ggc_calloc (CP_TOKEN_BUFFER_SIZE, sizeof (cp_token)));
+ lexer->buffer = ggc_calloc (CP_TOKEN_BUFFER_SIZE, sizeof (cp_token));
lexer->buffer_end = lexer->buffer + CP_TOKEN_BUFFER_SIZE;
/* There is one token in the buffer. */
@@ -345,13 +345,13 @@ cp_lexer_new_from_tokens (cp_token_cache *tokens)
ptrdiff_t num_tokens;
/* Allocate the memory. */
- lexer = (cp_lexer *) ggc_alloc_cleared (sizeof (cp_lexer));
+ lexer = ggc_alloc_cleared (sizeof (cp_lexer));
/* Create a new buffer, appropriately sized. */
num_tokens = 0;
for (block = tokens->first; block != NULL; block = block->next)
num_tokens += block->num_tokens;
- lexer->buffer = ((cp_token *) ggc_alloc (num_tokens * sizeof (cp_token)));
+ lexer->buffer = ggc_alloc (num_tokens * sizeof (cp_token));
lexer->buffer_end = lexer->buffer + num_tokens;
/* Install the tokens. */
@@ -521,9 +521,8 @@ cp_lexer_maybe_grow_buffer (cp_lexer* lexer)
/* Compute the current buffer size. */
buffer_length = lexer->buffer_end - lexer->buffer;
/* Allocate a buffer twice as big. */
- new_buffer = ((cp_token *)
- ggc_realloc (lexer->buffer,
- 2 * buffer_length * sizeof (cp_token)));
+ new_buffer = ggc_realloc (lexer->buffer,
+ 2 * buffer_length * sizeof (cp_token));
/* Because the buffer is circular, logically consecutive tokens
are not necessarily placed consecutively in memory.
@@ -1047,20 +1046,6 @@ typedef enum cp_parser_flags
CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES = 0x2
} cp_parser_flags;
-/* The different kinds of ids that we ecounter. */
-
-typedef enum cp_parser_id_kind
-{
- /* Not an id at all. */
- CP_PARSER_ID_KIND_NONE,
- /* An unqualified-id that is not a template-id. */
- CP_PARSER_ID_KIND_UNQUALIFIED,
- /* An unqualified template-id. */
- CP_PARSER_ID_KIND_TEMPLATE_ID,
- /* A qualified-id. */
- CP_PARSER_ID_KIND_QUALIFIED
-} cp_parser_id_kind;
-
/* The different kinds of declarators we want to parse. */
typedef enum cp_parser_declarator_kind
@@ -1078,9 +1063,9 @@ typedef enum cp_parser_declarator_kind
typedef struct cp_parser_token_tree_map_node
{
/* The token type. */
- enum cpp_ttype token_type;
+ enum cpp_ttype token_type : 8;
/* The corresponding tree code. */
- enum tree_code tree_type;
+ enum tree_code tree_type : 8;
} cp_parser_token_tree_map_node;
/* A complete map consists of several ordinary entries, followed by a
@@ -1144,11 +1129,10 @@ cp_parser_context_new (cp_parser_context* next)
/* Pull the first entry from the free list. */
context = cp_parser_context_free_list;
cp_parser_context_free_list = context->next;
- memset ((char *)context, 0, sizeof (*context));
+ memset (context, 0, sizeof (*context));
}
else
- context = ((cp_parser_context *)
- ggc_alloc_cleared (sizeof (cp_parser_context)));
+ context = ggc_alloc_cleared (sizeof (cp_parser_context));
/* No errors have occurred yet in this context. */
context->status = CP_PARSER_STATUS_KIND_NO_ERROR;
/* If this is not the bottomost context, copy information that we
@@ -1311,11 +1295,11 @@ static bool cp_parser_translation_unit
/* Expressions [gram.expr] */
static tree cp_parser_primary_expression
- (cp_parser *, cp_parser_id_kind *, tree *);
+ (cp_parser *, cp_id_kind *, tree *);
static tree cp_parser_id_expression
- (cp_parser *, bool, bool, bool *);
+ (cp_parser *, bool, bool, bool *, bool);
static tree cp_parser_unqualified_id
- (cp_parser *, bool, bool);
+ (cp_parser *, bool, bool, bool);
static tree cp_parser_nested_name_specifier_opt
(cp_parser *, bool, bool, bool);
static tree cp_parser_nested_name_specifier
@@ -1324,8 +1308,8 @@ static tree cp_parser_class_or_namespace_name
(cp_parser *, bool, bool, bool, bool);
static tree cp_parser_postfix_expression
(cp_parser *, bool);
-static tree cp_parser_expression_list
- (cp_parser *);
+static tree cp_parser_parenthesized_expression_list
+ (cp_parser *, bool, bool *);
static void cp_parser_pseudo_destructor_name
(cp_parser *, tree *, tree *);
static tree cp_parser_unary_expression
@@ -1370,8 +1354,6 @@ static tree cp_parser_logical_and_expression
(cp_parser *);
static tree cp_parser_logical_or_expression
(cp_parser *);
-static tree cp_parser_conditional_expression
- (cp_parser *);
static tree cp_parser_question_colon_clause
(cp_parser *, tree);
static tree cp_parser_assignment_expression
@@ -1386,15 +1368,15 @@ static tree cp_parser_constant_expression
/* Statements [gram.stmt.stmt] */
static void cp_parser_statement
- (cp_parser *);
+ (cp_parser *, bool);
static tree cp_parser_labeled_statement
- (cp_parser *);
+ (cp_parser *, bool);
static tree cp_parser_expression_statement
- (cp_parser *);
+ (cp_parser *, bool);
static tree cp_parser_compound_statement
- (cp_parser *);
+ (cp_parser *, bool);
static void cp_parser_statement_seq_opt
- (cp_parser *);
+ (cp_parser *, bool);
static tree cp_parser_selection_statement
(cp_parser *);
static tree cp_parser_condition
@@ -1424,15 +1406,15 @@ static void cp_parser_block_declaration
static void cp_parser_simple_declaration
(cp_parser *, bool);
static tree cp_parser_decl_specifier_seq
- (cp_parser *, cp_parser_flags, tree *, bool *);
+ (cp_parser *, cp_parser_flags, tree *, int *);
static tree cp_parser_storage_class_specifier_opt
(cp_parser *);
static tree cp_parser_function_specifier_opt
(cp_parser *);
static tree cp_parser_type_specifier
- (cp_parser *, cp_parser_flags, bool, bool, bool *, bool *);
+ (cp_parser *, cp_parser_flags, bool, bool, int *, bool *);
static tree cp_parser_simple_type_specifier
- (cp_parser *, cp_parser_flags);
+ (cp_parser *, cp_parser_flags, bool);
static tree cp_parser_type_name
(cp_parser *);
static tree cp_parser_elaborated_type_specifier
@@ -1465,11 +1447,11 @@ static void cp_parser_linkage_specification
/* Declarators [gram.dcl.decl] */
static tree cp_parser_init_declarator
- (cp_parser *, tree, tree, bool, bool, bool *);
+ (cp_parser *, tree, tree, bool, bool, int, bool *);
static tree cp_parser_declarator
- (cp_parser *, cp_parser_declarator_kind, bool *);
+ (cp_parser *, cp_parser_declarator_kind, int *);
static tree cp_parser_direct_declarator
- (cp_parser *, cp_parser_declarator_kind, bool *);
+ (cp_parser *, cp_parser_declarator_kind, int *);
static enum tree_code cp_parser_ptr_operator
(cp_parser *, tree *, tree *);
static tree cp_parser_cv_qualifier_seq_opt
@@ -1493,11 +1475,11 @@ static tree cp_parser_function_definition
static void cp_parser_function_body
(cp_parser *);
static tree cp_parser_initializer
- (cp_parser *, bool *);
+ (cp_parser *, bool *, bool *);
static tree cp_parser_initializer_clause
- (cp_parser *);
+ (cp_parser *, bool *);
static tree cp_parser_initializer_list
- (cp_parser *);
+ (cp_parser *, bool *);
static bool cp_parser_ctor_initializer_opt_and_function_body
(cp_parser *);
@@ -1693,16 +1675,14 @@ 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
(const char *);
-static tree cp_parser_non_constant_id_expression
- (tree);
static bool cp_parser_diagnose_invalid_type_name
(cp_parser *);
-static bool cp_parser_skip_to_closing_parenthesis
- (cp_parser *);
-static bool cp_parser_skip_to_closing_parenthesis_or_comma
- (cp_parser *);
+static int cp_parser_skip_to_closing_parenthesis
+ (cp_parser *, bool, bool);
static void cp_parser_skip_to_end_of_statement
(cp_parser *);
static void cp_parser_consume_semicolon_at_end_of_statement
@@ -1786,23 +1766,35 @@ cp_parser_check_type_definition (cp_parser* parser)
error ("%s", parser->type_definition_forbidden_message);
}
-/* Issue an eror message about the fact that THING appeared in a
- constant-expression. Returns ERROR_MARK_NODE. */
+/* This function is called when a declaration is parsed. If
+ DECLARATOR is a function declarator and DECLARES_CLASS_OR_ENUM
+ indicates that a type was defined in the decl-specifiers for DECL,
+ then an error is issued. */
-static tree
-cp_parser_non_constant_expression (const char *thing)
-{
- error ("%s cannot appear in a constant-expression", thing);
- return error_mark_node;
+static void
+cp_parser_check_for_definition_in_return_type (tree declarator,
+ int declares_class_or_enum)
+{
+ /* [dcl.fct] forbids type definitions in return types.
+ Unfortunately, it's not easy to know whether or not we are
+ processing a return type until after the fact. */
+ while (declarator
+ && (TREE_CODE (declarator) == INDIRECT_REF
+ || TREE_CODE (declarator) == ADDR_EXPR))
+ declarator = TREE_OPERAND (declarator, 0);
+ if (declarator
+ && TREE_CODE (declarator) == CALL_EXPR
+ && declares_class_or_enum & 2)
+ error ("new types may not be defined in a return type");
}
-/* Issue an eror message about the fact that DECL appeared in a
+/* Issue an eror message about the fact that THING appeared in a
constant-expression. Returns ERROR_MARK_NODE. */
static tree
-cp_parser_non_constant_id_expression (tree decl)
+cp_parser_non_constant_expression (const char *thing)
{
- error ("`%D' cannot appear in a constant-expression", decl);
+ error ("%s cannot appear in a constant-expression", thing);
return error_mark_node;
}
@@ -1880,57 +1872,60 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser)
}
/* Consume tokens up to, and including, the next non-nested closing `)'.
- Returns TRUE iff we found a closing `)'. */
+ Returns 1 iff we found a closing `)'. RECOVERING is true, if we
+ are doing error recovery. Returns -1 if OR_COMMA is true and we
+ found an unnested comma. */
-static bool
-cp_parser_skip_to_closing_parenthesis (cp_parser *parser)
+static int
+cp_parser_skip_to_closing_parenthesis (cp_parser *parser,
+ bool recovering, bool or_comma)
{
- unsigned nesting_depth = 0;
+ unsigned paren_depth = 0;
+ unsigned brace_depth = 0;
+ if (recovering && !or_comma && cp_parser_parsing_tentatively (parser)
+ && !cp_parser_committed_to_tentative_parse (parser))
+ return 0;
+
while (true)
{
cp_token *token;
-
+
/* If we've run out of tokens, then there is no closing `)'. */
if (cp_lexer_next_token_is (parser->lexer, CPP_EOF))
- return false;
- /* Consume the token. */
- token = cp_lexer_consume_token (parser->lexer);
- /* If it is an `(', we have entered another level of nesting. */
- if (token->type == CPP_OPEN_PAREN)
- ++nesting_depth;
- /* If it is a `)', then we might be done. */
- else if (token->type == CPP_CLOSE_PAREN && nesting_depth-- == 0)
- return true;
- }
-}
-
-/* Consume tokens until the next token is a `)', or a `,'. Returns
- TRUE if the next token is a `,'. */
+ return 0;
-static bool
-cp_parser_skip_to_closing_parenthesis_or_comma (cp_parser *parser)
-{
- unsigned nesting_depth = 0;
-
- while (true)
- {
- cp_token *token = cp_lexer_peek_token (parser->lexer);
+ if (recovering)
+ {
+ token = cp_lexer_peek_token (parser->lexer);
- /* If we've run out of tokens, then there is no closing `)'. */
- if (token->type == CPP_EOF)
- return false;
- /* If it is a `,' stop. */
- else if (token->type == CPP_COMMA && nesting_depth-- == 0)
- return true;
- /* If it is a `)', stop. */
- else if (token->type == CPP_CLOSE_PAREN && nesting_depth-- == 0)
- return false;
- /* If it is an `(', we have entered another level of nesting. */
- else if (token->type == CPP_OPEN_PAREN)
- ++nesting_depth;
+ /* 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)
+ {
+ if (!brace_depth--)
+ return 0;
+ }
+ if (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. */
+ if (token->type == CPP_OPEN_PAREN)
+ ++paren_depth;
+ /* If it is a `)', then we might be done. */
+ else if (token->type == CPP_CLOSE_PAREN && !paren_depth--)
+ return 1;
+ }
}
}
@@ -2094,7 +2089,7 @@ cp_parser_new (void)
cp_lexer_new_main might load a PCH file. */
lexer = cp_lexer_new_main ();
- parser = (cp_parser *) ggc_alloc_cleared (sizeof (cp_parser));
+ parser = ggc_alloc_cleared (sizeof (cp_parser));
parser->lexer = lexer;
parser->context = cp_parser_context_new (NULL);
@@ -2214,13 +2209,13 @@ cp_parser_translation_unit (cp_parser* parser)
static tree
cp_parser_primary_expression (cp_parser *parser,
- cp_parser_id_kind *idk,
+ cp_id_kind *idk,
tree *qualifying_class)
{
cp_token *token;
/* Assume the primary expression is not an id-expression. */
- *idk = CP_PARSER_ID_KIND_NONE;
+ *idk = CP_ID_KIND_NONE;
/* And that it cannot be used as pointer-to-member. */
*qualifying_class = NULL_TREE;
@@ -2274,9 +2269,9 @@ cp_parser_primary_expression (cp_parser *parser,
/* Start the statement-expression. */
expr = begin_stmt_expr ();
/* Parse the compound-statement. */
- cp_parser_compound_statement (parser);
+ cp_parser_compound_statement (parser, true);
/* Finish up. */
- expr = finish_stmt_expr (expr);
+ expr = finish_stmt_expr (expr, false);
}
else
{
@@ -2396,6 +2391,7 @@ cp_parser_primary_expression (cp_parser *parser,
{
tree id_expression;
tree decl;
+ const char *error_msg;
id_expression:
/* Parse the id-expression. */
@@ -2403,7 +2399,8 @@ cp_parser_primary_expression (cp_parser *parser,
= cp_parser_id_expression (parser,
/*template_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*template_p=*/NULL);
+ /*template_p=*/NULL,
+ /*declarator_p=*/false);
if (id_expression == error_mark_node)
return error_mark_node;
/* If we have a template-id, then no further lookup is
@@ -2423,11 +2420,6 @@ cp_parser_primary_expression (cp_parser *parser,
{
if (TYPE_P (TREE_OPERAND (decl, 0)))
*qualifying_class = TREE_OPERAND (decl, 0);
- /* 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 (parser->constant_expression_p)
- parser->non_constant_expression_p = true;
return decl;
}
/* Check to see if DECL is a local variable in a context
@@ -2456,270 +2448,16 @@ cp_parser_primary_expression (cp_parser *parser,
return error_mark_node;
}
}
-
- if (decl == error_mark_node)
- {
- /* Name lookup failed. */
- if (!parser->scope
- && processing_template_decl)
- {
- /* Unqualified name lookup failed while processing a
- template. */
- *idk = CP_PARSER_ID_KIND_UNQUALIFIED;
- /* If the next token is a parenthesis, assume that
- Koenig lookup will succeed when instantiating the
- template. */
- if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
- return build_min_nt (LOOKUP_EXPR, id_expression);
- /* If we're not doing Koenig lookup, issue an error. */
- error ("`%D' has not been declared", id_expression);
- return error_mark_node;
- }
- else if (parser->scope
- && (!TYPE_P (parser->scope)
- || !dependent_type_p (parser->scope)))
- {
- /* Qualified name lookup failed, and the
- qualifying name was not a dependent type. That
- is always an error. */
- if (TYPE_P (parser->scope)
- && !COMPLETE_TYPE_P (parser->scope))
- error ("incomplete type `%T' used in nested name "
- "specifier",
- parser->scope);
- else if (parser->scope != global_namespace)
- error ("`%D' is not a member of `%D'",
- id_expression, parser->scope);
- else
- error ("`::%D' has not been declared", id_expression);
- return error_mark_node;
- }
- else if (!parser->scope && !processing_template_decl)
- {
- /* It may be resolvable as a koenig lookup function
- call. */
- *idk = CP_PARSER_ID_KIND_UNQUALIFIED;
- return id_expression;
- }
- }
- /* If DECL is a variable that would be out of scope under
- ANSI/ISO rules, but in scope in the ARM, name lookup
- will succeed. Issue a diagnostic here. */
- else
- decl = check_for_out_of_scope_variable (decl);
-
- /* Remember that the name was used in the definition of
- the current class so that we can check later to see if
- the meaning would have been different after the class
- was entirely defined. */
- if (!parser->scope && decl != error_mark_node)
- maybe_note_name_used_in_class (id_expression, decl);
- }
-
- /* If we didn't find anything, or what we found was a type,
- then this wasn't really an id-expression. */
- if (TREE_CODE (decl) == TEMPLATE_DECL
- && !DECL_FUNCTION_TEMPLATE_P (decl))
- {
- cp_parser_error (parser, "missing template arguments");
- return error_mark_node;
- }
- else if (TREE_CODE (decl) == TYPE_DECL
- || TREE_CODE (decl) == NAMESPACE_DECL)
- {
- cp_parser_error (parser,
- "expected primary-expression");
- return error_mark_node;
- }
-
- /* 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)
- {
- *idk = CP_PARSER_ID_KIND_NONE;
- if (DECL_TEMPLATE_PARM_P (decl) || !processing_template_decl)
- return DECL_INITIAL (decl);
- return decl;
- }
- else
- {
- bool dependent_p;
-
- /* If the declaration was explicitly qualified indicate
- that. The semantics of `A::f(3)' are different than
- `f(3)' if `f' is virtual. */
- *idk = (parser->scope
- ? CP_PARSER_ID_KIND_QUALIFIED
- : (TREE_CODE (decl) == TEMPLATE_ID_EXPR
- ? CP_PARSER_ID_KIND_TEMPLATE_ID
- : CP_PARSER_ID_KIND_UNQUALIFIED));
-
-
- /* [temp.dep.expr]
-
- An id-expression is type-dependent if it contains an
- identifier that was declared with a dependent type.
-
- As an optimization, we could choose not to create a
- LOOKUP_EXPR for a name that resolved to a local
- variable in the template function that we are currently
- declaring; such a name cannot ever resolve to anything
- else. If we did that we would not have to look up
- these names at instantiation time.
-
- The standard is not very specific about an
- id-expression that names a set of overloaded functions.
- What if some of them have dependent types and some of
- them do not? Presumably, such a name should be treated
- as a dependent name. */
- /* Assume the name is not dependent. */
- dependent_p = false;
- if (!processing_template_decl)
- /* No names are dependent outside a template. */
- ;
- /* A template-id where the name of the template was not
- resolved is definitely dependent. */
- else if (TREE_CODE (decl) == TEMPLATE_ID_EXPR
- && (TREE_CODE (TREE_OPERAND (decl, 0))
- == IDENTIFIER_NODE))
- dependent_p = true;
- /* For anything except an overloaded function, just check
- its type. */
- else if (!is_overloaded_fn (decl))
- dependent_p
- = dependent_type_p (TREE_TYPE (decl));
- /* For a set of overloaded functions, check each of the
- functions. */
- else
- {
- tree fns = decl;
-
- if (BASELINK_P (fns))
- fns = BASELINK_FUNCTIONS (fns);
-
- /* For a template-id, check to see if the template
- arguments are dependent. */
- if (TREE_CODE (fns) == TEMPLATE_ID_EXPR)
- {
- tree args = TREE_OPERAND (fns, 1);
- dependent_p = any_dependent_template_arguments_p (args);
- /* The functions are those referred to by the
- template-id. */
- fns = TREE_OPERAND (fns, 0);
- }
-
- /* If there are no dependent template arguments, go
- through the overlaoded functions. */
- while (fns && !dependent_p)
- {
- tree fn = OVL_CURRENT (fns);
-
- /* Member functions of dependent classes are
- dependent. */
- if (TREE_CODE (fn) == FUNCTION_DECL
- && type_dependent_expression_p (fn))
- dependent_p = true;
- else if (TREE_CODE (fn) == TEMPLATE_DECL
- && dependent_template_p (fn))
- dependent_p = true;
-
- fns = OVL_NEXT (fns);
- }
- }
-
- /* If the name was dependent on a template parameter,
- we will resolve the name at instantiation time. */
- if (dependent_p)
- {
- /* Create a SCOPE_REF for qualified names, if the
- scope is dependent. */
- if (parser->scope)
- {
- if (TYPE_P (parser->scope))
- *qualifying_class = parser->scope;
- /* 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 (parser->constant_expression_p)
- parser->non_constant_expression_p = true;
- if (TYPE_P (parser->scope)
- && dependent_type_p (parser->scope))
- return build_nt (SCOPE_REF,
- parser->scope,
- id_expression);
- else
- return decl;
- }
- /* A TEMPLATE_ID already contains all the information
- we need. */
- if (TREE_CODE (id_expression) == TEMPLATE_ID_EXPR)
- return 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 (parser->constant_expression_p)
- parser->non_constant_expression_p = true;
- /* Create a LOOKUP_EXPR for other unqualified names. */
- return build_min_nt (LOOKUP_EXPR, id_expression);
- }
-
- /* Only certain kinds of names are allowed in constant
- expression. Enumerators have already been handled
- above. */
- if (parser->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. We also accept dependent
- initializers; they may turn out to be constant at
- instantiation-time. */
- else if (TREE_CODE (decl) == VAR_DECL
- && CP_TYPE_CONST_P (TREE_TYPE (decl))
- && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl))
- && DECL_INITIAL (decl)
- && (TREE_CONSTANT (DECL_INITIAL (decl))
- || type_dependent_expression_p (DECL_INITIAL
- (decl))
- || value_dependent_expression_p (DECL_INITIAL
- (decl))))
- ;
- else
- {
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_id_expression (decl);
- parser->non_constant_expression_p = true;
- }
- }
-
- if (parser->scope)
- {
- decl = (adjust_result_of_qualified_name_lookup
- (decl, parser->scope, current_class_type));
- if (TREE_CODE (decl) == FIELD_DECL || BASELINK_P (decl))
- *qualifying_class = parser->scope;
- else if (!processing_template_decl)
- decl = convert_from_reference (decl);
- }
- else
- /* Transform references to non-static data members into
- COMPONENT_REFs. */
- decl = hack_identifier (decl, id_expression);
-
- /* Resolve references to variables of anonymous unions
- into COMPONENT_REFs. */
- if (TREE_CODE (decl) == ALIAS_DECL)
- decl = DECL_INITIAL (decl);
}
-
- if (TREE_DEPRECATED (decl))
- warn_deprecated_use (decl);
-
+
+ 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,
+ &error_msg);
+ if (error_msg)
+ cp_parser_error (parser, error_msg);
return decl;
}
@@ -2759,13 +2497,17 @@ cp_parser_primary_expression (cp_parser *parser,
If *TEMPLATE_P is non-NULL, it is set to true iff the
`template' keyword is used to explicitly indicate that the entity
- named is a template. */
+ named is a template.
+
+ If DECLARATOR_P is true, the id-expression is appearing as part of
+ a declarator, rather than as part of an exprsesion. */
static tree
cp_parser_id_expression (cp_parser *parser,
bool template_keyword_p,
bool check_dependency_p,
- bool *template_p)
+ bool *template_p,
+ bool declarator_p)
{
bool global_scope_p;
bool nested_name_specifier_p;
@@ -2806,7 +2548,8 @@ cp_parser_id_expression (cp_parser *parser,
saved_qualifying_scope = parser->qualifying_scope;
/* Process the final unqualified-id. */
unqualified_id = cp_parser_unqualified_id (parser, *template_p,
- check_dependency_p);
+ check_dependency_p,
+ declarator_p);
/* Restore the SAVED_SCOPE for our caller. */
parser->scope = saved_scope;
parser->object_scope = saved_object_scope;
@@ -2861,7 +2604,8 @@ cp_parser_id_expression (cp_parser *parser,
}
else
return cp_parser_unqualified_id (parser, template_keyword_p,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ declarator_p);
}
/* Parse an unqualified-id.
@@ -2882,12 +2626,15 @@ cp_parser_id_expression (cp_parser *parser,
BIT_NOT_EXPR is an IDENTIFIER_NODE for the class-name. For the
other productions, see the documentation accompanying the
corresponding parsing functions. If CHECK_DEPENDENCY_P is false,
- names are looked up in uninstantiated templates. */
+ names are looked up in uninstantiated templates. If DECLARATOR_P
+ is true, the unqualified-id is appearing as part of a declarator,
+ rather than as part of an expression. */
static tree
cp_parser_unqualified_id (cp_parser* parser,
bool template_keyword_p,
- bool check_dependency_p)
+ bool check_dependency_p,
+ bool declarator_p)
{
cp_token *token;
@@ -3045,6 +2792,16 @@ cp_parser_unqualified_id (cp_parser* parser,
else if (type_decl == error_mark_node)
return error_mark_node;
+ /* [class.dtor]
+
+ A typedef-name that names a class shall not be used as the
+ identifier in the declarator for a destructor declaration. */
+ if (declarator_p
+ && !DECL_IMPLICIT_TYPEDEF_P (type_decl)
+ && !DECL_SELF_REFERENCE_P (type_decl))
+ error ("typedef-name `%D' used as destructor declarator",
+ type_decl);
+
return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
}
@@ -3335,6 +3092,7 @@ cp_parser_nested_name_specifier (cp_parser *parser,
if (!scope)
{
cp_parser_error (parser, "expected nested-name-specifier");
+ parser->scope = NULL_TREE;
return error_mark_node;
}
@@ -3451,7 +3209,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
{
cp_token *token;
enum rid keyword;
- cp_parser_id_kind idk = CP_PARSER_ID_KIND_NONE;
+ cp_id_kind idk = CP_ID_KIND_NONE;
tree postfix_expression = NULL_TREE;
/* Non-NULL only if the current postfix-expression can be used to
form a pointer-to-member. In that case, QUALIFYING_CLASS is the
@@ -3624,7 +3382,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
cp_parser_parse_tentatively (parser);
/* Look for the simple-type-specifier. */
type = cp_parser_simple_type_specifier (parser,
- CP_PARSER_FLAGS_NONE);
+ CP_PARSER_FLAGS_NONE,
+ /*identifier_p=*/false);
/* Parse the cast itself. */
if (!cp_parser_error_occurred (parser))
postfix_expression
@@ -3653,9 +3412,10 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
keep going. */
if (!cp_parser_error_occurred (parser))
{
+ bool non_constant_p;
/* Parse the initializer-list. */
initializer_list
- = cp_parser_initializer_list (parser);
+ = cp_parser_initializer_list (parser, &non_constant_p);
/* Allow a trailing `,'. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
cp_lexer_consume_token (parser->lexer);
@@ -3709,20 +3469,15 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
return postfix_expression;
}
- /* Remember that there was a reference to this entity. */
- if (DECL_P (postfix_expression))
- mark_used (postfix_expression);
-
/* Keep looping until the postfix-expression is complete. */
while (true)
{
- if (TREE_CODE (postfix_expression) == IDENTIFIER_NODE
+ if (idk == CP_ID_KIND_UNQUALIFIED
+ && TREE_CODE (postfix_expression) == IDENTIFIER_NODE
&& cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN))
- {
- /* It is not a Koenig lookup function call. */
- unqualified_name_lookup_error (postfix_expression);
- postfix_expression = error_mark_node;
- }
+ /* It is not a Koenig lookup function call. */
+ postfix_expression
+ = unqualified_name_lookup_error (postfix_expression);
/* Peek at the next token. */
token = cp_lexer_peek_token (parser->lexer);
@@ -3744,26 +3499,23 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* Build the ARRAY_REF. */
postfix_expression
= grok_array_decl (postfix_expression, index);
- idk = CP_PARSER_ID_KIND_NONE;
+ idk = CP_ID_KIND_NONE;
}
break;
case CPP_OPEN_PAREN:
/* postfix-expression ( expression-list [opt] ) */
{
- tree args;
+ bool koenig_p;
+ tree args = (cp_parser_parenthesized_expression_list
+ (parser, false, /*non_constant_p=*/NULL));
- /* Consume the `(' token. */
- cp_lexer_consume_token (parser->lexer);
- /* If the next token is not a `)', then there are some
- arguments. */
- if (cp_lexer_next_token_is_not (parser->lexer,
- CPP_CLOSE_PAREN))
- args = cp_parser_expression_list (parser);
- else
- args = NULL_TREE;
- /* Look for the closing `)'. */
- cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+ if (args == error_mark_node)
+ {
+ postfix_expression = error_mark_node;
+ break;
+ }
+
/* Function calls are not permitted in
constant-expressions. */
if (parser->constant_expression_p)
@@ -3773,59 +3525,23 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
parser->non_constant_expression_p = true;
}
- if (idk == CP_PARSER_ID_KIND_UNQUALIFIED
- && (is_overloaded_fn (postfix_expression)
- || DECL_P (postfix_expression)
- || TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
- && args)
+ koenig_p = false;
+ if (idk == CP_ID_KIND_UNQUALIFIED)
{
- tree identifier = NULL_TREE;
- tree functions = NULL_TREE;
-
- /* Find the name of the overloaded function. */
- if (TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
- identifier = postfix_expression;
- else if (is_overloaded_fn (postfix_expression))
- {
- functions = postfix_expression;
- identifier = DECL_NAME (get_first_fn (functions));
- }
- else if (DECL_P (postfix_expression))
- {
- functions = postfix_expression;
- identifier = DECL_NAME (postfix_expression);
- }
-
- /* A call to a namespace-scope function using an
- unqualified name.
-
- Do Koenig lookup -- unless any of the arguments are
- type-dependent. */
- if (!any_type_dependent_arguments_p (args))
+ if (args
+ && (is_overloaded_fn (postfix_expression)
+ || DECL_P (postfix_expression)
+ || TREE_CODE (postfix_expression) == IDENTIFIER_NODE))
{
+ koenig_p = true;
postfix_expression
- = lookup_arg_dependent (identifier, functions, args);
- if (!postfix_expression)
- {
- /* The unqualified name could not be resolved. */
- unqualified_name_lookup_error (identifier);
- postfix_expression = error_mark_node;
- break;
- }
+ = perform_koenig_lookup (postfix_expression, args);
}
- else
- postfix_expression = build_min_nt (LOOKUP_EXPR,
- identifier);
- }
- else if (idk == CP_PARSER_ID_KIND_UNQUALIFIED
- && TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
- {
- /* The unqualified name could not be resolved. */
- unqualified_name_lookup_error (postfix_expression);
- postfix_expression = error_mark_node;
- break;
+ else if (TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
+ postfix_expression
+ = unqualified_fn_lookup_error (postfix_expression);
}
-
+
if (TREE_CODE (postfix_expression) == COMPONENT_REF)
{
tree instance = TREE_OPERAND (postfix_expression, 0);
@@ -3835,6 +3551,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
&& (type_dependent_expression_p (instance)
|| (!BASELINK_P (fn)
&& TREE_CODE (fn) != FIELD_DECL)
+ || type_dependent_expression_p (fn)
|| any_type_dependent_arguments_p (args)))
{
postfix_expression
@@ -3845,7 +3562,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
postfix_expression
= (build_new_method_call
(instance, fn, args, NULL_TREE,
- (idk == CP_PARSER_ID_KIND_QUALIFIED
+ (idk == CP_ID_KIND_QUALIFIED
? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL)));
}
else if (TREE_CODE (postfix_expression) == OFFSET_REF
@@ -3853,20 +3570,22 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
|| TREE_CODE (postfix_expression) == DOTSTAR_EXPR)
postfix_expression = (build_offset_ref_call_from_tree
(postfix_expression, args));
- else if (idk == CP_PARSER_ID_KIND_QUALIFIED)
+ else if (idk == CP_ID_KIND_QUALIFIED)
/* A call to a static class member, or a namespace-scope
function. */
postfix_expression
= finish_call_expr (postfix_expression, args,
- /*disallow_virtual=*/true);
+ /*disallow_virtual=*/true,
+ koenig_p);
else
/* All other function calls. */
postfix_expression
= finish_call_expr (postfix_expression, args,
- /*disallow_virtual=*/false);
+ /*disallow_virtual=*/false,
+ koenig_p);
/* The POSTFIX_EXPRESSION is certainly no longer an id. */
- idk = CP_PARSER_ID_KIND_NONE;
+ idk = CP_ID_KIND_NONE;
}
break;
@@ -3893,7 +3612,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
parser->scope = NULL_TREE;
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
- idk = CP_PARSER_ID_KIND_NONE;
+ idk = CP_ID_KIND_NONE;
/* Enter the scope corresponding to the type of the object
given by the POSTFIX_EXPRESSION. */
if (!dependent_p
@@ -3908,17 +3627,6 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
it does not. Therefore, we have to manually obtain
the underlying type here. */
scope = non_reference (scope);
- /* If the SCOPE is an OFFSET_TYPE, then we grab the
- type of the field. We get an OFFSET_TYPE for
- something like:
-
- S::T.a ...
-
- Probably, we should not get an OFFSET_TYPE here;
- that transformation should be made only if `&S::T'
- is written. */
- if (TREE_CODE (scope) == OFFSET_TYPE)
- scope = TREE_TYPE (scope);
/* The type of the POSTFIX_EXPRESSION must be
complete. */
scope = complete_type_or_else (scope, NULL_TREE);
@@ -3945,7 +3653,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
name = cp_parser_id_expression (parser,
template_p,
/*check_dependency_p=*/true,
- /*template_p=*/NULL);
+ /*template_p=*/NULL,
+ /*declarator_p=*/false);
/* In general, build a SCOPE_REF if the member name is
qualified. However, if the name was not dependent
and has already been resolved; there is no need to
@@ -3961,7 +3670,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* But we do need to remember that there was an explicit
scope for virtual function calls. */
if (parser->scope)
- idk = CP_PARSER_ID_KIND_QUALIFIED;
+ idk = CP_ID_KIND_QUALIFIED;
if (name != error_mark_node
&& !BASELINK_P (name)
@@ -4011,7 +3720,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
postfix_expression
= finish_increment_expr (postfix_expression,
POSTINCREMENT_EXPR);
- idk = CP_PARSER_ID_KIND_NONE;
+ idk = CP_ID_KIND_NONE;
break;
case CPP_MINUS_MINUS:
@@ -4029,7 +3738,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
postfix_expression
= finish_increment_expr (postfix_expression,
POSTDECREMENT_EXPR);
- idk = CP_PARSER_ID_KIND_NONE;
+ idk = CP_ID_KIND_NONE;
break;
default:
@@ -4042,51 +3751,118 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
return error_mark_node;
}
-/* Parse an expression-list.
+/* Parse a parenthesized expression-list.
expression-list:
assignment-expression
expression-list, assignment-expression
+ attribute-list:
+ expression-list
+ identifier
+ identifier, expression-list
+
Returns a TREE_LIST. The TREE_VALUE of each node is a
representation of an assignment-expression. Note that a TREE_LIST
- is returned even if there is only a single expression in the list. */
+ is returned even if there is only a single expression in the list.
+ error_mark_node is returned if the ( and or ) are
+ missing. NULL_TREE is returned on no expressions. The parentheses
+ are eaten. IS_ATTRIBUTE_LIST is true if this is really an attribute
+ list being parsed. If NON_CONSTANT_P is non-NULL, *NON_CONSTANT_P
+ indicates whether or not all of the expressions in the list were
+ constant. */
static tree
-cp_parser_expression_list (cp_parser* parser)
+cp_parser_parenthesized_expression_list (cp_parser* parser,
+ bool is_attribute_list,
+ bool *non_constant_p)
{
tree expression_list = NULL_TREE;
+ tree identifier = NULL_TREE;
+ /* Assume all the expressions will be constant. */
+ if (non_constant_p)
+ *non_constant_p = false;
+
+ if (!cp_parser_require (parser, CPP_OPEN_PAREN, "`('"))
+ return error_mark_node;
+
/* Consume expressions until there are no more. */
- while (true)
- {
- tree expr;
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN))
+ while (true)
+ {
+ tree expr;
+
+ /* At the beginning of attribute lists, check to see if the
+ next token is an identifier. */
+ if (is_attribute_list
+ && cp_lexer_peek_token (parser->lexer)->type == CPP_NAME)
+ {
+ cp_token *token;
+
+ /* Consume the identifier. */
+ token = cp_lexer_consume_token (parser->lexer);
+ /* Save the identifier. */
+ identifier = token->value;
+ }
+ else
+ {
+ /* Parse the next assignment-expression. */
+ if (non_constant_p)
+ {
+ bool expr_non_constant_p;
+ expr = (cp_parser_constant_expression
+ (parser, /*allow_non_constant_p=*/true,
+ &expr_non_constant_p));
+ if (expr_non_constant_p)
+ *non_constant_p = true;
+ }
+ else
+ expr = cp_parser_assignment_expression (parser);
- /* Parse the next assignment-expression. */
- expr = cp_parser_assignment_expression (parser);
- /* Add it to the list. */
- expression_list = tree_cons (NULL_TREE, expr, expression_list);
+ /* Add it to the list. We add error_mark_node
+ expressions to the list, so that we can still tell if
+ the correct form for a parenthesized expression-list
+ is found. That gives better errors. */
+ expression_list = tree_cons (NULL_TREE, expr, expression_list);
- /* If the next token isn't a `,', then we are done. */
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
- {
- /* All uses of expression-list in the grammar are followed
- by a `)'. Therefore, if the next token is not a `)' an
- error will be issued, unless we are parsing tentatively.
- Skip ahead to see if there is another `,' before the `)';
- if so, we can go there and recover. */
- if (cp_parser_parsing_tentatively (parser)
- || cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN)
- || !cp_parser_skip_to_closing_parenthesis_or_comma (parser))
- break;
- }
+ if (expr == error_mark_node)
+ goto skip_comma;
+ }
- /* Otherwise, consume the `,' and keep going. */
- cp_lexer_consume_token (parser->lexer);
+ /* After the first item, attribute lists look the same as
+ expression lists. */
+ is_attribute_list = false;
+
+ get_comma:;
+ /* If the next token isn't a `,', then we are done. */
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
+ break;
+
+ /* Otherwise, consume the `,' and keep going. */
+ cp_lexer_consume_token (parser->lexer);
+ }
+
+ if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"))
+ {
+ int ending;
+
+ 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);
+ if (ending < 0)
+ goto get_comma;
+ if (!ending)
+ return error_mark_node;
}
/* We built up the list in reverse order so we must reverse it now. */
- return nreverse (expression_list);
+ expression_list = nreverse (expression_list);
+ if (identifier)
+ expression_list = tree_cons (NULL_TREE, identifier, expression_list);
+
+ return expression_list;
}
/* Parse a pseudo-destructor-name.
@@ -4193,32 +3969,21 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p)
switch (keyword)
{
case RID_ALIGNOF:
- {
- /* Consume the `alignof' token. */
- cp_lexer_consume_token (parser->lexer);
- /* Parse the operand. */
- return finish_alignof (cp_parser_sizeof_operand
- (parser, keyword));
- }
-
case RID_SIZEOF:
{
tree operand;
+ enum tree_code op;
- /* Consume the `sizeof' token. */
+ op = keyword == RID_ALIGNOF ? ALIGNOF_EXPR : SIZEOF_EXPR;
+ /* Consume the token. */
cp_lexer_consume_token (parser->lexer);
/* Parse the operand. */
operand = cp_parser_sizeof_operand (parser, keyword);
- /* If the type of the operand cannot be determined build a
- SIZEOF_EXPR. */
- if (TYPE_P (operand)
- ? dependent_type_p (operand)
- : type_dependent_expression_p (operand))
- return build_min (SIZEOF_EXPR, size_type_node, operand);
- /* Otherwise, compute the constant value. */
+ if (TYPE_P (operand))
+ return cxx_sizeof_or_alignof_type (operand, op, true);
else
- return finish_sizeof (operand);
+ return cxx_sizeof_or_alignof_expr (operand, op);
}
case RID_NEW:
@@ -4451,13 +4216,9 @@ cp_parser_new_placement (cp_parser* parser)
{
tree expression_list;
- /* Look for the opening `('. */
- if (!cp_parser_require (parser, CPP_OPEN_PAREN, "`('"))
- return error_mark_node;
/* Parse the expression-list. */
- expression_list = cp_parser_expression_list (parser);
- /* Look for the closing `)'. */
- cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+ expression_list = (cp_parser_parenthesized_expression_list
+ (parser, false, /*non_constant_p=*/NULL));
return expression_list;
}
@@ -4621,16 +4382,10 @@ cp_parser_new_initializer (cp_parser* parser)
{
tree expression_list;
- /* Look for the opening parenthesis. */
- cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
- /* If the next token is not a `)', then there is an
- expression-list. */
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN))
- expression_list = cp_parser_expression_list (parser);
- else
+ expression_list = (cp_parser_parenthesized_expression_list
+ (parser, false, /*non_constant_p=*/NULL));
+ if (!expression_list)
expression_list = void_zero_node;
- /* Look for the closing parenthesis. */
- cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
return expression_list;
}
@@ -4726,7 +4481,7 @@ 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)
+ = (cp_parser_skip_to_closing_parenthesis (parser, false, false)
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE));
/* Roll back the tokens we skipped. */
cp_lexer_rollback_tokens (parser->lexer);
@@ -5042,43 +4797,12 @@ cp_parser_logical_or_expression (cp_parser* parser)
cp_parser_logical_and_expression);
}
-/* Parse a conditional-expression.
-
- conditional-expression:
- logical-or-expression
- logical-or-expression ? expression : assignment-expression
-
- GNU Extensions:
-
- conditional-expression:
- logical-or-expression ? : assignment-expression
-
- Returns a representation of the expression. */
-
-static tree
-cp_parser_conditional_expression (cp_parser* parser)
-{
- tree logical_or_expr;
-
- /* Parse the logical-or-expression. */
- logical_or_expr = cp_parser_logical_or_expression (parser);
- /* If the next token is a `?', then we have a real conditional
- expression. */
- if (cp_lexer_next_token_is (parser->lexer, CPP_QUERY))
- return cp_parser_question_colon_clause (parser, logical_or_expr);
- /* Otherwise, the value is simply the logical-or-expression. */
- else
- return logical_or_expr;
-}
-
/* Parse the `? expression : assignment-expression' part of a
conditional-expression. The LOGICAL_OR_EXPR is the
logical-or-expression that started the conditional-expression.
Returns a representation of the entire conditional-expression.
- This routine exists only so that it can be shared between
- cp_parser_conditional_expression and
- cp_parser_assignment_expression.
+ This routine is used by cp_parser_assignment_expression.
? expression : assignment-expression
@@ -5358,8 +5082,16 @@ cp_parser_constant_expression (cp_parser* parser,
parser->constant_expression_p = true;
parser->allow_non_constant_expression_p = allow_non_constant_p;
parser->non_constant_expression_p = false;
- /* Parse the conditional-expression. */
- expression = cp_parser_conditional_expression (parser);
+ /* 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
+ ALLOW_NON_CONSTANT_P is false, we get better errors than we would
+ otherwise. In the case that ALLOW_NON_CONSTANT_P is true, it is
+ actually essential that we look for an assignment-expression.
+ For example, cp_parser_initializer_clauses uses this function to
+ determine whether a particular assignment-expression is in fact
+ 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
@@ -5386,7 +5118,7 @@ cp_parser_constant_expression (cp_parser* parser,
try-block */
static void
-cp_parser_statement (cp_parser* parser)
+cp_parser_statement (cp_parser* parser, bool in_statement_expr_p)
{
tree statement;
cp_token *token;
@@ -5408,7 +5140,8 @@ cp_parser_statement (cp_parser* parser)
{
case RID_CASE:
case RID_DEFAULT:
- statement = cp_parser_labeled_statement (parser);
+ statement = cp_parser_labeled_statement (parser,
+ in_statement_expr_p);
break;
case RID_IF:
@@ -5445,11 +5178,11 @@ cp_parser_statement (cp_parser* parser)
labeled-statement. */
token = cp_lexer_peek_nth_token (parser->lexer, 2);
if (token->type == CPP_COLON)
- statement = cp_parser_labeled_statement (parser);
+ statement = cp_parser_labeled_statement (parser, in_statement_expr_p);
}
/* Anything that starts with a `{' must be a compound-statement. */
else if (token->type == CPP_OPEN_BRACE)
- statement = cp_parser_compound_statement (parser);
+ statement = cp_parser_compound_statement (parser, false);
/* Everything else must be a declaration-statement or an
expression-statement. Try for the declaration-statement
@@ -5467,7 +5200,7 @@ cp_parser_statement (cp_parser* parser)
return;
}
/* Look for an expression-statement instead. */
- statement = cp_parser_expression_statement (parser);
+ statement = cp_parser_expression_statement (parser, in_statement_expr_p);
}
/* Set the line number for the statement. */
@@ -5486,7 +5219,7 @@ cp_parser_statement (cp_parser* parser)
an ordinary label, returns a LABEL_STMT. */
static tree
-cp_parser_labeled_statement (cp_parser* parser)
+cp_parser_labeled_statement (cp_parser* parser, bool in_statement_expr_p)
{
cp_token *token;
tree statement = NULL_TREE;
@@ -5533,7 +5266,7 @@ cp_parser_labeled_statement (cp_parser* parser)
/* Require the `:' token. */
cp_parser_require (parser, CPP_COLON, "`:'");
/* Parse the labeled statement. */
- cp_parser_statement (parser);
+ cp_parser_statement (parser, in_statement_expr_p);
/* Return the label, in the case of a `case' or `default' label. */
return statement;
@@ -5545,25 +5278,35 @@ cp_parser_labeled_statement (cp_parser* parser)
expression [opt] ;
Returns the new EXPR_STMT -- or NULL_TREE if the expression
- statement consists of nothing more than an `;'. */
+ statement consists of nothing more than an `;'. IN_STATEMENT_EXPR_P
+ indicates whether this expression-statement is part of an
+ expression statement. */
static tree
-cp_parser_expression_statement (cp_parser* parser)
+cp_parser_expression_statement (cp_parser* parser, bool in_statement_expr_p)
{
- tree statement;
+ tree statement = NULL_TREE;
- /* If the next token is not a `;', then there is an expression to parse. */
+ /* If the next token is a ';', then there is no expression
+ statement. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
- statement = finish_expr_stmt (cp_parser_expression (parser));
- /* Otherwise, we do not even bother to build an EXPR_STMT. */
- else
- {
- finish_stmt ();
- statement = NULL_TREE;
- }
+ statement = cp_parser_expression (parser);
+
/* Consume the final `;'. */
cp_parser_consume_semicolon_at_end_of_statement (parser);
+ if (in_statement_expr_p
+ && cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
+ {
+ /* This is the final expression statement of a statement
+ expression. */
+ statement = finish_stmt_expr_expr (statement);
+ }
+ else if (statement)
+ statement = finish_expr_stmt (statement);
+ else
+ finish_stmt ();
+
return statement;
}
@@ -5575,7 +5318,7 @@ cp_parser_expression_statement (cp_parser* parser)
Returns a COMPOUND_STMT representing the statement. */
static tree
-cp_parser_compound_statement (cp_parser *parser)
+cp_parser_compound_statement (cp_parser *parser, bool in_statement_expr_p)
{
tree compound_stmt;
@@ -5583,11 +5326,11 @@ cp_parser_compound_statement (cp_parser *parser)
if (!cp_parser_require (parser, CPP_OPEN_BRACE, "`{'"))
return error_mark_node;
/* Begin the compound-statement. */
- compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/false);
/* Parse an (optional) statement-seq. */
- cp_parser_statement_seq_opt (parser);
+ cp_parser_statement_seq_opt (parser, in_statement_expr_p);
/* Finish the compound-statement. */
- finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
+ finish_compound_stmt (compound_stmt);
/* Consume the `}'. */
cp_parser_require (parser, CPP_CLOSE_BRACE, "`}'");
@@ -5601,7 +5344,7 @@ cp_parser_compound_statement (cp_parser *parser)
statement-seq [opt] statement */
static void
-cp_parser_statement_seq_opt (cp_parser* parser)
+cp_parser_statement_seq_opt (cp_parser* parser, bool in_statement_expr_p)
{
/* Scan statements until there aren't any more. */
while (true)
@@ -5612,7 +5355,7 @@ cp_parser_statement_seq_opt (cp_parser* parser)
break;
/* Parse the statement. */
- cp_parser_statement (parser);
+ cp_parser_statement (parser, in_statement_expr_p);
}
}
@@ -5661,7 +5404,7 @@ 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);
+ cp_parser_skip_to_closing_parenthesis (parser, true, false);
if (keyword == RID_IF)
{
@@ -5942,7 +5685,7 @@ cp_parser_for_init_statement (cp_parser* parser)
return;
}
- cp_parser_expression_statement (parser);
+ cp_parser_expression_statement (parser, false);
}
/* Parse a jump-statement.
@@ -6065,15 +5808,15 @@ cp_parser_implicitly_scoped_statement (cp_parser* parser)
if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
{
/* Create a compound-statement. */
- statement = begin_compound_stmt (/*has_no_scope=*/0);
+ statement = begin_compound_stmt (/*has_no_scope=*/false);
/* Parse the dependent-statement. */
- cp_parser_statement (parser);
+ cp_parser_statement (parser, false);
/* Finish the dummy compound-statement. */
- finish_compound_stmt (/*has_no_scope=*/0, statement);
+ finish_compound_stmt (statement);
}
/* Otherwise, we simply parse the statement directly. */
else
- statement = cp_parser_compound_statement (parser);
+ statement = cp_parser_compound_statement (parser, false);
/* Return the statement. */
return statement;
@@ -6093,15 +5836,15 @@ cp_parser_already_scoped_statement (cp_parser* parser)
tree statement;
/* Create a compound-statement. */
- statement = begin_compound_stmt (/*has_no_scope=*/1);
+ statement = begin_compound_stmt (/*has_no_scope=*/true);
/* Parse the dependent-statement. */
- cp_parser_statement (parser);
+ cp_parser_statement (parser, false);
/* Finish the dummy compound-statement. */
- finish_compound_stmt (/*has_no_scope=*/1, statement);
+ finish_compound_stmt (statement);
}
/* Otherwise, we simply parse the statement directly. */
else
- cp_parser_statement (parser);
+ cp_parser_statement (parser, false);
}
/* Declarations [gram.dcl.dcl] */
@@ -6341,7 +6084,7 @@ cp_parser_simple_declaration (cp_parser* parser,
{
tree decl_specifiers;
tree attributes;
- bool declares_class_or_enum;
+ int declares_class_or_enum;
bool saw_declarator;
/* Defer access checks until we know what is being declared; the
@@ -6368,6 +6111,15 @@ cp_parser_simple_declaration (cp_parser* parser,
/* We no longer need to defer access checks. */
stop_deferring_access_checks ();
+ /* In a block scope, a valid declaration must always have a
+ decl-specifier-seq. By not trying to parse declarators, we can
+ resolve the declaration/expression ambiguity more quickly. */
+ if (!function_definition_allowed_p && !decl_specifiers)
+ {
+ cp_parser_error (parser, "expected declaration");
+ goto done;
+ }
+
/* If the next two tokens are both identifiers, the code is
erroneous. The usual cause of this situation is code like:
@@ -6380,7 +6132,7 @@ cp_parser_simple_declaration (cp_parser* parser,
looking at a declaration. */
cp_parser_commit_to_tentative_parse (parser);
/* Give up. */
- return;
+ goto done;
}
/* Keep going until we hit the `;' at the end of the simple
@@ -6391,22 +6143,21 @@ cp_parser_simple_declaration (cp_parser* parser,
{
cp_token *token;
bool function_definition_p;
+ tree decl;
saw_declarator = true;
/* Parse the init-declarator. */
- cp_parser_init_declarator (parser, decl_specifiers, attributes,
- function_definition_allowed_p,
- /*member_p=*/false,
- &function_definition_p);
+ decl = cp_parser_init_declarator (parser, decl_specifiers, attributes,
+ function_definition_allowed_p,
+ /*member_p=*/false,
+ declares_class_or_enum,
+ &function_definition_p);
/* If an error occurred while parsing tentatively, exit quickly.
(That usually happens when in the body of a function; each
statement is treated as a declaration-statement until proven
otherwise.) */
if (cp_parser_error_occurred (parser))
- {
- pop_deferring_access_checks ();
- return;
- }
+ goto done;
/* Handle function definitions specially. */
if (function_definition_p)
{
@@ -6439,8 +6190,7 @@ cp_parser_simple_declaration (cp_parser* parser,
cp_parser_error (parser, "expected `,' or `;'");
/* Skip tokens until we reach the end of the statement. */
cp_parser_skip_to_end_of_statement (parser);
- pop_deferring_access_checks ();
- return;
+ goto done;
}
/* After the first time around, a function-definition is not
allowed -- even if it was OK at first. For example:
@@ -6462,14 +6212,11 @@ cp_parser_simple_declaration (cp_parser* parser,
perform_deferred_access_checks ();
}
- pop_deferring_access_checks ();
-
/* Consume the `;'. */
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
- /* Mark all the classes that appeared in the decl-specifier-seq as
- having received a `;'. */
- note_list_got_semicolon (decl_specifiers);
+ done:
+ pop_deferring_access_checks ();
}
/* Parse a decl-specifier-seq.
@@ -6502,20 +6249,29 @@ cp_parser_simple_declaration (cp_parser* parser,
appears, and the entity that will be a friend is not going to be a
class, then *FRIEND_IS_NOT_CLASS_P will be set to TRUE. Note that
even if *FRIEND_IS_NOT_CLASS_P is FALSE, the entity to which
- friendship is granted might not be a class. */
+ friendship is granted might not be a class.
+
+ *DECLARES_CLASS_OR_ENUM is set to the bitwise or of the following
+ *flags:
+
+ 1: one of the decl-specifiers is an elaborated-type-specifier
+ 2: one of the decl-specifiers is an enum-specifier or a
+ class-specifier
+
+ */
static tree
cp_parser_decl_specifier_seq (cp_parser* parser,
cp_parser_flags flags,
tree* attributes,
- bool* declares_class_or_enum)
+ int* declares_class_or_enum)
{
tree decl_specs = NULL_TREE;
bool friend_p = false;
bool constructor_possible_p = !parser->in_declarator_p;
/* Assume no class or enumeration type is declared. */
- *declares_class_or_enum = false;
+ *declares_class_or_enum = 0;
/* Assume there are no attributes. */
*attributes = NULL_TREE;
@@ -6545,7 +6301,10 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
case RID_FRIEND:
/* decl-specifier:
friend */
- friend_p = true;
+ if (friend_p)
+ error ("duplicate `friend'");
+ else
+ friend_p = true;
/* The representation of the specifier is simply the
appropriate TREE_IDENTIFIER node. */
decl_spec = token->value;
@@ -6611,7 +6370,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
a type-specifier. */
if (!decl_spec && !constructor_p)
{
- bool decl_spec_declares_class_or_enum;
+ int decl_spec_declares_class_or_enum;
bool is_cv_qualifier;
decl_spec
@@ -7060,17 +6819,12 @@ cp_parser_mem_initializer (cp_parser* parser)
member = expand_member_init (mem_initializer_id);
if (member && !DECL_P (member))
in_base_initializer = 1;
-
- /* Look for the opening `('. */
- cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
- /* Parse the expression-list. */
- if (cp_lexer_next_token_is_not (parser->lexer,
- CPP_CLOSE_PAREN))
- expression_list = cp_parser_expression_list (parser);
- else
+
+ expression_list
+ = cp_parser_parenthesized_expression_list (parser, false,
+ /*non_constant_p=*/NULL);
+ if (!expression_list)
expression_list = void_type_node;
- /* Look for the closing `)'. */
- cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
in_base_initializer = 0;
@@ -7607,8 +7361,7 @@ cp_parser_type_parameter (cp_parser* parser)
/* Create the combined representation of the parameter and the
default argument. */
- parameter = build_tree_list (default_argument,
- parameter);
+ parameter = build_tree_list (default_argument, parameter);
}
break;
@@ -7654,7 +7407,8 @@ cp_parser_type_parameter (cp_parser* parser)
= cp_parser_id_expression (parser,
/*template_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*template_p=*/NULL);
+ /*template_p=*/NULL,
+ /*declarator_p=*/false);
/* Look up the name. */
default_argument
= cp_parser_lookup_name_simple (parser, default_argument);
@@ -7667,8 +7421,7 @@ cp_parser_type_parameter (cp_parser* parser)
/* Create the combined representation of the parameter and the
default argument. */
- parameter = build_tree_list (default_argument,
- parameter);
+ parameter = build_tree_list (default_argument, parameter);
}
break;
@@ -7976,32 +7729,51 @@ cp_parser_template_name (cp_parser* parser,
template-argument
template-argument-list , template-argument
- Returns a TREE_LIST representing the arguments, in the order they
- appeared. The TREE_VALUE of each node is a representation of the
- argument. */
+ Returns a TREE_VEC containing the arguments. */
static tree
cp_parser_template_argument_list (cp_parser* parser)
{
- tree arguments = NULL_TREE;
+ tree fixed_args[10];
+ unsigned n_args = 0;
+ unsigned alloced = 10;
+ tree *arg_ary = fixed_args;
+ tree vec;
- while (true)
+ do
{
tree argument;
+ if (n_args)
+ /* Consume the comma. */
+ cp_lexer_consume_token (parser->lexer);
+
/* Parse the template-argument. */
argument = cp_parser_template_argument (parser);
- /* Add it to the list. */
- arguments = tree_cons (NULL_TREE, argument, arguments);
- /* If it is not a `,', then there are no more arguments. */
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
- break;
- /* Otherwise, consume the ','. */
- cp_lexer_consume_token (parser->lexer);
+ if (n_args == alloced)
+ {
+ alloced *= 2;
+
+ if (arg_ary == fixed_args)
+ {
+ arg_ary = xmalloc (sizeof (tree) * alloced);
+ memcpy (arg_ary, fixed_args, sizeof (tree) * n_args);
+ }
+ else
+ arg_ary = xrealloc (arg_ary, sizeof (tree) * alloced);
+ }
+ arg_ary[n_args++] = argument;
}
+ while (cp_lexer_next_token_is (parser->lexer, CPP_COMMA));
+
+ vec = make_tree_vec (n_args);
- /* We built up the arguments in reverse order. */
- return nreverse (arguments);
+ while (n_args--)
+ TREE_VEC_ELT (vec, n_args) = arg_ary[n_args];
+
+ if (arg_ary != fixed_args)
+ free (arg_ary);
+ return vec;
}
/* Parse a template-argument.
@@ -8027,7 +7799,7 @@ cp_parser_template_argument (cp_parser* parser)
bool template_p;
bool address_p;
cp_token *token;
- cp_parser_id_kind idk;
+ cp_id_kind idk;
tree qualifying_class;
/* There's really no way to know what we're looking at, so we just
@@ -8055,7 +7827,8 @@ cp_parser_template_argument (cp_parser* parser)
argument = cp_parser_id_expression (parser,
/*template_keyword_p=*/false,
/*check_dependency_p=*/true,
- &template_p);
+ &template_p,
+ /*declarator_p=*/false);
/* 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))
@@ -8195,7 +7968,7 @@ cp_parser_template_argument (cp_parser* parser)
static void
cp_parser_explicit_instantiation (cp_parser* parser)
{
- bool declares_class_or_enum;
+ int declares_class_or_enum;
tree decl_specifiers;
tree attributes;
tree extension_specifier = NULL_TREE;
@@ -8247,6 +8020,8 @@ cp_parser_explicit_instantiation (cp_parser* parser)
declarator
= cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
/*ctor_dtor_or_conv_p=*/NULL);
+ cp_parser_check_for_definition_in_return_type (declarator,
+ declares_class_or_enum);
decl = grokdeclarator (declarator, decl_specifiers,
NORMAL, 0, NULL);
/* Turn access control back on for names used during
@@ -8337,8 +8112,9 @@ cp_parser_explicit_specialization (cp_parser* parser)
If DECLARES_CLASS_OR_ENUM is non-NULL, and the type-specifier is a
class-specifier, enum-specifier, or elaborated-type-specifier, then
- *DECLARES_CLASS_OR_ENUM is set to TRUE. Otherwise, it is set to
- FALSE.
+ *DECLARES_CLASS_OR_ENUM is set to a nonzero value. The value is 1
+ if a type is declared; 2 if it is defined. Otherwise, it is set to
+ zero.
If IS_CV_QUALIFIER is non-NULL, and the type-specifier is a
cv-qualifier, then IS_CV_QUALIFIER is set to TRUE. Otherwise, it
@@ -8349,7 +8125,7 @@ cp_parser_type_specifier (cp_parser* parser,
cp_parser_flags flags,
bool is_friend,
bool is_declaration,
- bool* declares_class_or_enum,
+ int* declares_class_or_enum,
bool* is_cv_qualifier)
{
tree type_spec = NULL_TREE;
@@ -8389,7 +8165,7 @@ cp_parser_type_specifier (cp_parser* parser,
if (cp_parser_parse_definitely (parser))
{
if (declares_class_or_enum)
- *declares_class_or_enum = true;
+ *declares_class_or_enum = 2;
return type_spec;
}
@@ -8403,7 +8179,7 @@ cp_parser_type_specifier (cp_parser* parser,
/* We're declaring a class or enum -- unless we're using
`typename'. */
if (declares_class_or_enum && keyword != RID_TYPENAME)
- *declares_class_or_enum = true;
+ *declares_class_or_enum = 1;
return type_spec;
case RID_CONST:
@@ -8429,7 +8205,8 @@ cp_parser_type_specifier (cp_parser* parser,
/* If we do not already have a type-specifier, assume we are looking
at a simple-type-specifier. */
- type_spec = cp_parser_simple_type_specifier (parser, flags);
+ type_spec = cp_parser_simple_type_specifier (parser, flags,
+ /*identifier_p=*/true);
/* If we didn't find a type-specifier, and a type-specifier was not
optional in this context, issue an error message. */
@@ -8466,11 +8243,13 @@ cp_parser_type_specifier (cp_parser* parser,
__typeof__ ( type-id )
For the various keywords, the value returned is simply the
- TREE_IDENTIFIER representing the keyword. For the first two
- productions, the value returned is the indicated TYPE_DECL. */
+ TREE_IDENTIFIER representing the keyword if IDENTIFIER_P is true.
+ For the first two productions, and if IDENTIFIER_P is false, the
+ value returned is the indicated TYPE_DECL. */
static tree
-cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags)
+cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags,
+ bool identifier_p)
{
tree type = NULL_TREE;
cp_token *token;
@@ -8482,18 +8261,38 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags)
switch (token->keyword)
{
case RID_CHAR:
+ type = char_type_node;
+ break;
case RID_WCHAR:
+ type = wchar_type_node;
+ break;
case RID_BOOL:
+ type = boolean_type_node;
+ break;
case RID_SHORT:
+ type = short_integer_type_node;
+ break;
case RID_INT:
+ type = integer_type_node;
+ break;
case RID_LONG:
+ type = long_integer_type_node;
+ break;
case RID_SIGNED:
+ type = integer_type_node;
+ break;
case RID_UNSIGNED:
+ type = unsigned_type_node;
+ break;
case RID_FLOAT:
+ type = float_type_node;
+ break;
case RID_DOUBLE:
+ type = double_type_node;
+ break;
case RID_VOID:
- /* Consume the token. */
- return cp_lexer_consume_token (parser->lexer)->value;
+ type = void_type_node;
+ break;
case RID_TYPEOF:
{
@@ -8514,6 +8313,16 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags)
break;
}
+ /* If the type-specifier was for a built-in type, we're done. */
+ if (type)
+ {
+ tree id;
+
+ /* Consume the token. */
+ id = cp_lexer_consume_token (parser->lexer)->value;
+ return identifier_p ? id : TYPE_NAME (type);
+ }
+
/* The type-specifier must be a user-defined type. */
if (!(flags & CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES))
{
@@ -8742,7 +8551,10 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
identifier = cp_parser_identifier (parser);
if (identifier == error_mark_node)
- return error_mark_node;
+ {
+ parser->scope = NULL_TREE;
+ return error_mark_node;
+ }
/* For a `typename', we needn't call xref_tag. */
if (tag_type == typename_type)
@@ -8791,13 +8603,12 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
error ("expected type-name");
return error_mark_node;
}
- else if (TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE
- && tag_type != enum_type)
- error ("`%T' referred to as `%s'", TREE_TYPE (decl),
- tag_type == record_type ? "struct" : "class");
- else if (TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE
- && tag_type == enum_type)
- error ("`%T' referred to as enum", TREE_TYPE (decl));
+
+ if (TREE_CODE (TREE_TYPE (decl)) != TYPENAME_TYPE)
+ check_elaborated_type_specifier
+ (tag_type, decl,
+ (parser->num_template_parameter_lists
+ || DECL_SELF_REFERENCE_P (decl)));
type = TREE_TYPE (decl);
}
@@ -8851,7 +8662,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
(is_friend
|| !is_declaration
|| cp_lexer_next_token_is_not (parser->lexer,
- CPP_SEMICOLON)));
+ CPP_SEMICOLON)),
+ parser->num_template_parameter_lists);
}
}
if (tag_type != enum_type)
@@ -9203,35 +9015,47 @@ cp_parser_using_declaration (cp_parser* parser)
/* Parse the unqualified-id. */
identifier = cp_parser_unqualified_id (parser,
/*template_keyword_p=*/false,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ /*declarator_p=*/true);
/* The function we call to handle a using-declaration is different
depending on what scope we are in. */
- scope = current_scope ();
- if (scope && TYPE_P (scope))
- {
- /* Create the USING_DECL. */
- decl = do_class_using_decl (build_nt (SCOPE_REF,
- parser->scope,
- identifier));
- /* Add it to the list of members in this class. */
- finish_member_declaration (decl);
- }
+ if (identifier == error_mark_node)
+ ;
+ else if (TREE_CODE (identifier) != IDENTIFIER_NODE
+ && TREE_CODE (identifier) != BIT_NOT_EXPR)
+ /* [namespace.udecl]
+
+ A using declaration shall not name a template-id. */
+ error ("a template-id may not appear in a using-declaration");
else
{
- decl = cp_parser_lookup_name_simple (parser, identifier);
- if (decl == error_mark_node)
+ scope = current_scope ();
+ if (scope && TYPE_P (scope))
{
- 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);
+ /* Create the USING_DECL. */
+ decl = do_class_using_decl (build_nt (SCOPE_REF,
+ parser->scope,
+ identifier));
+ /* Add it to the list of members in this class. */
+ finish_member_declaration (decl);
}
- else if (scope)
- do_local_using_decl (decl);
else
- do_toplevel_using_decl (decl);
+ {
+ 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);
+ }
+ else if (scope)
+ do_local_using_decl (decl);
+ else
+ do_toplevel_using_decl (decl);
+ }
}
/* Look for the final `;'. */
@@ -9389,7 +9213,7 @@ 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);
+ cp_parser_skip_to_closing_parenthesis (parser, true, false);
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
/* Create the ASM_STMT. */
@@ -9439,6 +9263,7 @@ cp_parser_init_declarator (cp_parser* parser,
tree prefix_attributes,
bool function_definition_allowed_p,
bool member_p,
+ int declares_class_or_enum,
bool* function_definition_p)
{
cp_token *token;
@@ -9450,7 +9275,8 @@ cp_parser_init_declarator (cp_parser* parser,
tree scope;
bool is_initialized;
bool is_parenthesized_init;
- bool ctor_dtor_or_conv_p;
+ bool is_non_constant_init;
+ int ctor_dtor_or_conv_p;
bool friend_p;
/* Assume that this is not the declarator for a function
@@ -9475,6 +9301,9 @@ cp_parser_init_declarator (cp_parser* parser,
if (declarator == error_mark_node)
return error_mark_node;
+ cp_parser_check_for_definition_in_return_type (declarator,
+ declares_class_or_enum);
+
/* Figure out what scope the entity declared by the DECLARATOR is
located in. `grokdeclarator' sometimes changes the scope, so
we compute it now. */
@@ -9536,7 +9365,7 @@ cp_parser_init_declarator (cp_parser* parser,
We explicitly postpone this check past the point where we handle
function-definitions because we tolerate function-definitions
that are missing their return types in some modes. */
- if (!decl_specifiers && !ctor_dtor_or_conv_p)
+ if (!decl_specifiers && ctor_dtor_or_conv_p <= 0)
{
cp_parser_error (parser,
"expected constructor, destructor, or type conversion");
@@ -9565,8 +9394,7 @@ cp_parser_init_declarator (cp_parser* parser,
friend_p = cp_parser_friend_p (decl_specifiers);
/* Check that the number of template-parameter-lists is OK. */
- if (!cp_parser_check_declarator_template_parameters (parser,
- declarator))
+ if (!cp_parser_check_declarator_template_parameters (parser, declarator))
return error_mark_node;
/* Enter the newly declared entry in the symbol table. If we're
@@ -9581,11 +9409,8 @@ cp_parser_init_declarator (cp_parser* parser,
decl_specifiers);
have_extern_spec = false;
}
- decl = start_decl (declarator,
- decl_specifiers,
- is_initialized,
- attributes,
- prefix_attributes);
+ decl = start_decl (declarator, decl_specifiers,
+ is_initialized, attributes, prefix_attributes);
}
/* Enter the SCOPE. That way unqualified names appearing in the
@@ -9619,11 +9444,14 @@ cp_parser_init_declarator (cp_parser* parser,
/* Parse the initializer. */
if (is_initialized)
- initializer = cp_parser_initializer (parser, &is_parenthesized_init);
+ initializer = cp_parser_initializer (parser,
+ &is_parenthesized_init,
+ &is_non_constant_init);
else
{
initializer = NULL_TREE;
is_parenthesized_init = false;
+ is_non_constant_init = true;
}
/* The old parser allows attributes to appear after a parenthesized
@@ -9665,6 +9493,12 @@ cp_parser_init_declarator (cp_parser* parser,
((is_parenthesized_init || !is_initialized)
? 0 : LOOKUP_ONLYCONVERTING));
+ /* Remember whether or not variables were initialized by
+ constant-expressions. */
+ if (decl && TREE_CODE (decl) == VAR_DECL
+ && is_initialized && !is_non_constant_init)
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = true;
+
return decl;
}
@@ -9708,10 +9542,12 @@ cp_parser_init_declarator (cp_parser* parser,
cv-qualifiers will be stored in the TREE_TYPE of the INDIRECT_REF
node.
- If CTOR_DTOR_OR_CONV_P is not NULL, *CTOR_DTOR_OR_CONV_P is set to
- true if this declarator represents a constructor, destructor, or
- type conversion operator. Otherwise, it is set to false.
-
+ If CTOR_DTOR_OR_CONV_P is not NULL, *CTOR_DTOR_OR_CONV_P is used to
+ detect constructor, destructor or conversion operators. It is set
+ to -1 if the declarator is a name, and +1 if it is a
+ function. Otherwise it is set to zero. Usually you just want to
+ test for >0, but internally the negative value is used.
+
(The reason for CTOR_DTOR_OR_CONV_P is that a declaration must have
a decl-specifier-seq unless it declares a constructor, destructor,
or conversion. It might seem that we could check this condition in
@@ -9723,7 +9559,7 @@ cp_parser_init_declarator (cp_parser* parser,
static tree
cp_parser_declarator (cp_parser* parser,
cp_parser_declarator_kind dcl_kind,
- bool* ctor_dtor_or_conv_p)
+ int* ctor_dtor_or_conv_p)
{
cp_token *token;
tree declarator;
@@ -9735,7 +9571,7 @@ cp_parser_declarator (cp_parser* parser,
/* Assume this is not a constructor, destructor, or type-conversion
operator. */
if (ctor_dtor_or_conv_p)
- *ctor_dtor_or_conv_p = false;
+ *ctor_dtor_or_conv_p = 0;
if (cp_parser_allow_gnu_extensions_p (parser))
attributes = cp_parser_attributes_opt (parser);
@@ -9780,8 +9616,7 @@ cp_parser_declarator (cp_parser* parser,
}
/* Everything else is a direct-declarator. */
else
- declarator = cp_parser_direct_declarator (parser,
- dcl_kind,
+ declarator = cp_parser_direct_declarator (parser, dcl_kind,
ctor_dtor_or_conv_p);
if (attributes && declarator != error_mark_node)
@@ -9829,7 +9664,7 @@ cp_parser_declarator (cp_parser* parser,
static tree
cp_parser_direct_declarator (cp_parser* parser,
cp_parser_declarator_kind dcl_kind,
- bool* ctor_dtor_or_conv_p)
+ int* ctor_dtor_or_conv_p)
{
cp_token *token;
tree declarator = NULL_TREE;
@@ -9885,6 +9720,7 @@ cp_parser_direct_declarator (cp_parser* parser,
if (!first || dcl_kind != CP_PARSER_DECLARATOR_NAMED)
{
tree params;
+ unsigned saved_num_template_parameter_lists;
cp_parser_parse_tentatively (parser);
@@ -9898,16 +9734,27 @@ cp_parser_direct_declarator (cp_parser* parser,
parser->in_declarator_p = true;
}
+ /* Inside the function parameter list, surrounding
+ template-parameter-lists do not apply. */
+ saved_num_template_parameter_lists
+ = parser->num_template_parameter_lists;
+ parser->num_template_parameter_lists = 0;
+
/* Parse the parameter-declaration-clause. */
params = cp_parser_parameter_declaration_clause (parser);
+ parser->num_template_parameter_lists
+ = saved_num_template_parameter_lists;
+
/* If all went well, parse the cv-qualifier-seq and the
exception-specification. */
if (cp_parser_parse_definitely (parser))
{
tree cv_qualifiers;
tree exception_specification;
-
+
+ if (ctor_dtor_or_conv_p)
+ *ctor_dtor_or_conv_p = *ctor_dtor_or_conv_p < 0;
first = false;
/* Consume the `)'. */
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
@@ -9964,6 +9811,9 @@ cp_parser_direct_declarator (cp_parser* parser,
/* Parse an array-declarator. */
tree bounds;
+ if (ctor_dtor_or_conv_p)
+ *ctor_dtor_or_conv_p = 0;
+
first = false;
parser->default_arg_ok_p = false;
parser->in_declarator_p = true;
@@ -10079,7 +9929,7 @@ cp_parser_direct_declarator (cp_parser* parser,
if (TREE_CODE (unqualified_name) == BIT_NOT_EXPR
|| IDENTIFIER_TYPENAME_P (unqualified_name)
|| constructor_name_p (unqualified_name, class_type))
- *ctor_dtor_or_conv_p = true;
+ *ctor_dtor_or_conv_p = -1;
}
handle_declarator:;
@@ -10314,7 +10164,8 @@ cp_parser_declarator_id (cp_parser* parser)
id_expression = cp_parser_id_expression (parser,
/*template_keyword_p=*/false,
/*check_dependency_p=*/false,
- /*template_p=*/NULL);
+ /*template_p=*/NULL,
+ /*declarator_p=*/true);
/* If the name was qualified, create a SCOPE_REF to represent
that. */
if (parser->scope)
@@ -10592,7 +10443,7 @@ static tree
cp_parser_parameter_declaration (cp_parser *parser,
bool template_parm_p)
{
- bool declares_class_or_enum;
+ int declares_class_or_enum;
bool greater_than_is_operator_p;
tree decl_specifiers;
tree attributes;
@@ -10781,9 +10632,13 @@ cp_parser_parameter_declaration (cp_parser *parser,
}
if (!parser->default_arg_ok_p)
{
- pedwarn ("default arguments are only permitted on functions");
- if (flag_pedantic_errors)
- default_argument = NULL_TREE;
+ if (!flag_pedantic_errors)
+ warning ("deprecated use of default argument for parameter of non-function");
+ else
+ {
+ error ("default arguments are only permitted for function parameters");
+ default_argument = NULL_TREE;
+ }
}
}
else
@@ -10823,7 +10678,7 @@ cp_parser_function_definition (cp_parser* parser, bool* friend_p)
tree declarator;
tree fn;
cp_token *token;
- bool declares_class_or_enum;
+ int declares_class_or_enum;
bool member_p;
/* The saved value of the PEDANTIC flag. */
int saved_pedantic;
@@ -10897,6 +10752,9 @@ cp_parser_function_definition (cp_parser* parser, bool* friend_p)
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
@@ -10982,7 +10840,7 @@ cp_parser_function_definition (cp_parser* parser, bool* friend_p)
static void
cp_parser_function_body (cp_parser *parser)
{
- cp_parser_compound_statement (parser);
+ cp_parser_compound_statement (parser, false);
}
/* Parse a ctor-initializer-opt followed by a function-body. Return
@@ -11017,10 +10875,13 @@ cp_parser_ctor_initializer_opt_and_function_body (cp_parser *parser)
*IS_PARENTHESIZED_INIT is set to TRUE if the `( expression-list )'
production is used, and zero otherwise. *IS_PARENTHESIZED_INIT is
- set to FALSE if there is no initializer present. */
+ set to FALSE if there is no initializer present. If there is an
+ initializer, and it is not a constant-expression, *NON_CONSTANT_P
+ is set to true; otherwise it is set to false. */
static tree
-cp_parser_initializer (cp_parser* parser, bool* is_parenthesized_init)
+cp_parser_initializer (cp_parser* parser, bool* is_parenthesized_init,
+ bool* non_constant_p)
{
cp_token *token;
tree init;
@@ -11031,24 +10892,19 @@ cp_parser_initializer (cp_parser* parser, bool* is_parenthesized_init)
/* Let our caller know whether or not this initializer was
parenthesized. */
*is_parenthesized_init = (token->type == CPP_OPEN_PAREN);
+ /* Assume that the initializer is constant. */
+ *non_constant_p = false;
if (token->type == CPP_EQ)
{
/* Consume the `='. */
cp_lexer_consume_token (parser->lexer);
/* Parse the initializer-clause. */
- init = cp_parser_initializer_clause (parser);
+ init = cp_parser_initializer_clause (parser, non_constant_p);
}
else if (token->type == CPP_OPEN_PAREN)
- {
- /* Consume the `('. */
- cp_lexer_consume_token (parser->lexer);
- /* Parse the expression-list. */
- init = cp_parser_expression_list (parser);
- /* Consume the `)' token. */
- if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"))
- cp_parser_skip_to_closing_parenthesis (parser);
- }
+ init = cp_parser_parenthesized_expression_list (parser, false,
+ non_constant_p);
else
{
/* Anything else is an error. */
@@ -11075,17 +10931,21 @@ cp_parser_initializer (cp_parser* parser, bool* is_parenthesized_init)
the elements of the initializer-list (or NULL_TREE, if the last
production is used). The TREE_TYPE for the CONSTRUCTOR will be
NULL_TREE. There is no way to detect whether or not the optional
- trailing `,' was provided. */
+ trailing `,' was provided. NON_CONSTANT_P is as for
+ cp_parser_initializer. */
static tree
-cp_parser_initializer_clause (cp_parser* parser)
+cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p)
{
tree initializer;
/* If it is not a `{', then we are looking at an
assignment-expression. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
- initializer = cp_parser_assignment_expression (parser);
+ initializer
+ = cp_parser_constant_expression (parser,
+ /*allow_non_constant_p=*/true,
+ non_constant_p);
else
{
/* Consume the `{' token. */
@@ -11101,12 +10961,11 @@ cp_parser_initializer_clause (cp_parser* parser)
{
/* Parse the initializer list. */
CONSTRUCTOR_ELTS (initializer)
- = cp_parser_initializer_list (parser);
+ = cp_parser_initializer_list (parser, non_constant_p);
/* A trailing `,' token is allowed. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
cp_lexer_consume_token (parser->lexer);
}
-
/* Now, there should be a trailing `}'. */
cp_parser_require (parser, CPP_CLOSE_BRACE, "`}'");
}
@@ -11128,20 +10987,25 @@ cp_parser_initializer_clause (cp_parser* parser)
Returns a TREE_LIST. The TREE_VALUE of each node is an expression
for the initializer. If the TREE_PURPOSE is non-NULL, it is the
- IDENTIFIER_NODE naming the field to initialize. */
+ IDENTIFIER_NODE naming the field to initialize. NON_CONSTANT_P is
+ as for cp_parser_initializer. */
static tree
-cp_parser_initializer_list (cp_parser* parser)
+cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
{
tree initializers = NULL_TREE;
+ /* Assume all of the expressions are constant. */
+ *non_constant_p = false;
+
/* Parse the rest of the list. */
while (true)
{
cp_token *token;
tree identifier;
tree initializer;
-
+ bool clause_non_constant_p;
+
/* If the next token is an identifier and the following one is a
colon, we are looking at the GNU designated-initializer
syntax. */
@@ -11158,8 +11022,11 @@ cp_parser_initializer_list (cp_parser* parser)
identifier = NULL_TREE;
/* Parse the initializer. */
- initializer = cp_parser_initializer_clause (parser);
-
+ initializer = cp_parser_initializer_clause (parser,
+ &clause_non_constant_p);
+ /* If any clause is non-constant, so is the entire initializer. */
+ if (clause_non_constant_p)
+ *non_constant_p = true;
/* Add it to the list. */
initializers = tree_cons (identifier, initializer, initializers);
@@ -11229,6 +11096,9 @@ cp_parser_class_name (cp_parser *parser,
/* PARSER->SCOPE can be cleared when parsing the template-arguments
to a template-id, so we save it here. */
scope = parser->scope;
+ if (scope == error_mark_node)
+ return error_mark_node;
+
/* Any name names a type if we're following the `typename' keyword
in a qualified name where the enclosing scope is type-dependent. */
typename_p = (typename_keyword_p && scope && TYPE_P (scope)
@@ -11376,11 +11246,16 @@ cp_parser_class_specifier (cp_parser* parser)
/* Look for attributes to apply to this class. */
if (cp_parser_allow_gnu_extensions_p (parser))
attributes = cp_parser_attributes_opt (parser);
- /* Finish the class definition. */
- type = finish_class_definition (type,
- attributes,
- has_trailing_semicolon,
- nested_name_specifier_p);
+ /* If we got any attributes in class_head, xref_tag will stick them in
+ TREE_TYPE of the type. Grab them now. */
+ if (type != error_mark_node)
+ {
+ attributes = chainon (TYPE_ATTRIBUTES (type), attributes);
+ TYPE_ATTRIBUTES (type) = NULL_TREE;
+ type = finish_struct (type, attributes);
+ }
+ if (nested_name_specifier_p)
+ pop_scope (CP_DECL_CONTEXT (TYPE_MAIN_DECL (type)));
/* If this class is not itself within the scope of another class,
then we need to parse the bodies of all of the queued function
definitions. Note that the queued functions defined in a class
@@ -11653,7 +11528,8 @@ cp_parser_class_head (cp_parser* parser,
/* If the class was unnamed, create a dummy name. */
if (!id)
id = make_anon_name ();
- type = xref_tag (class_key, id, attributes, /*globalize=*/0);
+ type = xref_tag (class_key, id, attributes, /*globalize=*/false,
+ parser->num_template_parameter_lists);
}
else
{
@@ -11693,21 +11569,31 @@ cp_parser_class_head (cp_parser* parser,
"enclose `%D'", type, scope, nested_name_specifier);
return NULL_TREE;
}
+ /* [dcl.meaning]
- maybe_process_partial_specialization (TREE_TYPE (type));
- class_type = current_class_type;
- type = TREE_TYPE (handle_class_head (class_key,
- nested_name_specifier,
- type,
- attributes));
- if (type != error_mark_node)
+ A declarator-id shall not be qualified exception of the
+ definition of a ... nested class outside of its class
+ ... [or] a the definition or explicit instantiation of a
+ class member of a namespace outside of its namespace. */
+ if (scope == CP_DECL_CONTEXT (type))
{
- if (!class_type && TYPE_CONTEXT (type))
- *nested_name_specifier_p = true;
- else if (class_type && !same_type_p (TYPE_CONTEXT (type),
- class_type))
- *nested_name_specifier_p = true;
+ pedwarn ("extra qualification ignored");
+ nested_name_specifier = NULL_TREE;
}
+
+ maybe_process_partial_specialization (TREE_TYPE (type));
+ class_type = current_class_type;
+ /* Enter the scope indicated by the nested-name-specifier. */
+ if (nested_name_specifier)
+ push_scope (nested_name_specifier);
+ /* Get the canonical version of this type. */
+ type = TYPE_MAIN_DECL (TREE_TYPE (type));
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ()
+ && !CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (type)))
+ type = push_template_decl (type);
+ type = TREE_TYPE (type);
+ if (nested_name_specifier)
+ *nested_name_specifier_p = true;
}
/* Indicate whether this class was declared as a `class' or as a
`struct'. */
@@ -11848,7 +11734,7 @@ cp_parser_member_declaration (cp_parser* parser)
tree decl_specifiers;
tree prefix_attributes;
tree decl;
- bool declares_class_or_enum;
+ int declares_class_or_enum;
bool friend_p;
cp_token *token;
int saved_pedantic;
@@ -11964,7 +11850,8 @@ cp_parser_member_declaration (cp_parser* parser)
error ("friend declaration does not name a class or "
"function");
else
- make_friend_class (current_class_type, type);
+ make_friend_class (current_class_type, type,
+ /*complain=*/true);
}
/* If there is no TYPE, an error message will already have
been issued. */
@@ -12045,7 +11932,7 @@ cp_parser_member_declaration (cp_parser* parser)
tree declarator;
tree initializer;
tree asm_specification;
- bool ctor_dtor_or_conv_p;
+ int ctor_dtor_or_conv_p;
/* Parse the declarator. */
declarator
@@ -12061,6 +11948,9 @@ cp_parser_member_declaration (cp_parser* parser)
break;
}
+ cp_parser_check_for_definition_in_return_type
+ (declarator, declares_class_or_enum);
+
/* Look for an asm-specification. */
asm_specification = cp_parser_asm_specification_opt (parser);
/* Look for attributes that apply to the declaration. */
@@ -12117,12 +12007,16 @@ cp_parser_member_declaration (cp_parser* parser)
(cp_lexer_peek_token (parser->lexer)))
decl = error_mark_node;
else
- /* Create the declaration. */
- decl = grokfield (declarator,
- decl_specifiers,
- initializer,
- asm_specification,
- attributes);
+ {
+ /* Create the declaration. */
+ decl = grokfield (declarator, decl_specifiers,
+ initializer, asm_specification,
+ attributes);
+ /* Any initialization must have been from a
+ constant-expression. */
+ if (decl && TREE_CODE (decl) == VAR_DECL && initializer)
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = 1;
+ }
}
/* Reset PREFIX_ATTRIBUTES. */
@@ -12518,7 +12412,7 @@ cp_parser_try_block (cp_parser* parser)
cp_parser_require_keyword (parser, RID_TRY, "`try'");
try_block = begin_try_block ();
- cp_parser_compound_statement (parser);
+ cp_parser_compound_statement (parser, false);
finish_try_block (try_block);
cp_parser_handler_seq (parser);
finish_handler_sequence (try_block);
@@ -12594,7 +12488,7 @@ cp_parser_handler (cp_parser* parser)
declaration = cp_parser_exception_declaration (parser);
finish_handler_parms (declaration, handler);
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
- cp_parser_compound_statement (parser);
+ cp_parser_compound_statement (parser, false);
finish_handler (handler);
}
@@ -12911,47 +12805,11 @@ cp_parser_attribute_list (cp_parser* parser)
if (token->type == CPP_OPEN_PAREN)
{
tree arguments;
- int arguments_allowed_p = 1;
-
- /* Consume the `('. */
- cp_lexer_consume_token (parser->lexer);
- /* Peek at the next token. */
- token = cp_lexer_peek_token (parser->lexer);
- /* Check to see if the next token is an identifier. */
- if (token->type == CPP_NAME)
- {
- /* Save the identifier. */
- identifier = token->value;
- /* Consume the identifier. */
- cp_lexer_consume_token (parser->lexer);
- /* Peek at the next token. */
- token = cp_lexer_peek_token (parser->lexer);
- /* If the next token is a `,', then there are some other
- expressions as well. */
- if (token->type == CPP_COMMA)
- /* Consume the comma. */
- cp_lexer_consume_token (parser->lexer);
- else
- arguments_allowed_p = 0;
- }
- else
- identifier = NULL_TREE;
-
- /* If there are arguments, parse them too. */
- if (arguments_allowed_p)
- arguments = cp_parser_expression_list (parser);
- else
- arguments = NULL_TREE;
-
- /* Combine the identifier and the arguments. */
- if (identifier)
- arguments = tree_cons (NULL_TREE, identifier, arguments);
+ arguments = (cp_parser_parenthesized_expression_list
+ (parser, true, /*non_constant_p=*/NULL));
/* Save the identifier and arguments away. */
TREE_VALUE (attribute) = arguments;
-
- /* Look for the closing `)'. */
- cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
}
/* Add this attribute to the list. */
@@ -13158,7 +13016,8 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
may be instantiated during name lookup. In that case,
errors may be issued. Even if we rollback the current
tentative parse, those errors are valid. */
- decl = lookup_qualified_name (parser->scope, name, is_type);
+ decl = lookup_qualified_name (parser->scope, name, is_type,
+ /*complain=*/true);
if (dependent_p)
pop_scope (parser->scope);
}
@@ -13587,6 +13446,7 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
&& !cp_parser_storage_class_specifier_opt (parser))
{
tree type;
+ unsigned saved_num_template_parameter_lists;
/* Names appearing in the type-specifier should be looked up
in the scope of the class. */
@@ -13607,6 +13467,13 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
}
push_scope (type);
}
+
+ /* Inside the constructor parameter list, surrounding
+ template-parameter-lists do not apply. */
+ saved_num_template_parameter_lists
+ = parser->num_template_parameter_lists;
+ parser->num_template_parameter_lists = 0;
+
/* Look for the type-specifier. */
cp_parser_type_specifier (parser,
CP_PARSER_FLAGS_NONE,
@@ -13614,6 +13481,10 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
/*is_declarator=*/true,
/*declares_class_or_enum=*/NULL,
/*is_cv_qualifier=*/NULL);
+
+ parser->num_template_parameter_lists
+ = saved_num_template_parameter_lists;
+
/* Leave the scope of the class. */
if (type)
pop_scope (type);
@@ -13788,7 +13659,8 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
if (member_p && !friend_p && decl)
decl = finish_member_template_decl (decl);
else if (friend_p && decl && TREE_CODE (decl) == TYPE_DECL)
- make_friend_class (current_class_type, TREE_TYPE (decl));
+ make_friend_class (current_class_type, TREE_TYPE (decl),
+ /*complain=*/true);
}
/* We are done with the current parameter list. */
--parser->num_template_parameter_lists;
@@ -13823,7 +13695,7 @@ cp_parser_single_declaration (cp_parser* parser,
bool member_p,
bool* friend_p)
{
- bool declares_class_or_enum;
+ int declares_class_or_enum;
tree decl = NULL_TREE;
tree decl_specifiers;
tree attributes;
@@ -13872,6 +13744,7 @@ cp_parser_single_declaration (cp_parser* parser,
attributes,
/*function_definition_allowed_p=*/false,
member_p,
+ declares_class_or_enum,
/*function_definition_p=*/NULL);
pop_deferring_access_checks ();
@@ -13914,17 +13787,9 @@ cp_parser_functional_cast (cp_parser* parser, tree type)
{
tree expression_list;
- /* Look for the opening `('. */
- if (!cp_parser_require (parser, CPP_OPEN_PAREN, "`('"))
- return error_mark_node;
- /* If the next token is not an `)', there are arguments to the
- cast. */
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN))
- expression_list = cp_parser_expression_list (parser);
- else
- expression_list = NULL_TREE;
- /* Look for the closing `)'. */
- cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+ expression_list
+ = cp_parser_parenthesized_expression_list (parser, false,
+ /*non_constant_p=*/NULL);
return build_functional_cast (type, expression_list);
}
@@ -14040,6 +13905,13 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
bool saved_local_variables_forbidden_p;
tree parameters;
+ /* While we're parsing the default args, we might (due to the
+ statement expression extension) encounter more classes. We want
+ to handle them right away, but we don't want them getting mixed
+ up with default args that are currently in the queue. */
+ parser->unparsed_functions_queues
+ = tree_cons (NULL_TREE, NULL_TREE, parser->unparsed_functions_queues);
+
for (parameters = TYPE_ARG_TYPES (TREE_TYPE (fn));
parameters;
parameters = TREE_CHAIN (parameters))
@@ -14073,6 +13945,10 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
parser->lexer = saved_lexer;
parser->local_variables_forbidden_p = saved_local_variables_forbidden_p;
}
+
+ /* Restore the queue. */
+ parser->unparsed_functions_queues
+ = TREE_CHAIN (parser->unparsed_functions_queues);
}
/* Parse the operand of `sizeof' (or a similar operator). Returns
@@ -14097,10 +13973,9 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
saved_message = parser->type_definition_forbidden_message;
/* And create the new one. */
parser->type_definition_forbidden_message
- = ((const char *)
- xmalloc (strlen (format)
- + strlen (IDENTIFIER_POINTER (ridpointers[keyword]))
- + 1 /* `\0' */));
+ = xmalloc (strlen (format)
+ + strlen (IDENTIFIER_POINTER (ridpointers[keyword]))
+ + 1 /* `\0' */);
sprintf ((char *) parser->type_definition_forbidden_message,
format, IDENTIFIER_POINTER (ridpointers[keyword]));
@@ -14194,7 +14069,8 @@ cp_parser_fold_non_dependent_expr (tree expr)
expr = tsubst_copy_and_build (expr,
/*args=*/NULL_TREE,
tf_error,
- /*in_decl=*/NULL_TREE);
+ /*in_decl=*/NULL_TREE,
+ /*function_p=*/false);
processing_template_decl = saved_processing_template_decl;
}
return expr;
@@ -14605,10 +14481,10 @@ static GTY (()) cp_parser *the_parser;
/* External interface. */
-/* Parse the entire translation unit. */
+/* Parse one entire translation unit. */
-int
-yyparse (void)
+void
+c_parse_file (void)
{
bool error_occurred;
@@ -14617,10 +14493,6 @@ yyparse (void)
? dk_no_deferred : dk_no_check);
error_occurred = cp_parser_translation_unit (the_parser);
the_parser = NULL;
-
- finish_file ();
-
- return error_occurred;
}
/* Clean up after parsing the entire translation unit. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4d650c5e23d..12baea14a33 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -88,20 +88,18 @@ static htab_t local_specializations;
#define GTB_IGNORE_TYPE 2 /* We don't need to try to unify the current
type with the desired type. */
-static void push_access_scope_real (tree, tree, tree);
static void push_access_scope (tree);
static void pop_access_scope (tree);
static int resolve_overloaded_unification (tree, tree, tree, tree,
unification_kind_t, int);
static int try_one_overload (tree, tree, tree, tree, tree,
- unification_kind_t, int);
+ unification_kind_t, int, bool);
static int unify (tree, tree, tree, tree, int);
static void add_pending_template (tree);
static void reopen_tinst_level (tree);
static tree classtype_mangled_name (tree);
static char* mangle_class_name_for_template (const char *, tree, tree);
static tree tsubst_initializer_list (tree, tree);
-static int list_eq (tree, tree);
static tree get_class_bindings (tree, tree, tree);
static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t, int);
static void tsubst_enum (tree, tree, tree);
@@ -112,8 +110,6 @@ static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*);
static int type_unification_real (tree, tree, tree, tree,
int, unification_kind_t, int, int);
static void note_template_header (int);
-static tree maybe_fold_nontype_arg (tree);
-static void maybe_fold_nontype_args (tree);
static tree convert_nontype_argument (tree, tree);
static tree convert_template_argument (tree, tree, tree,
tsubst_flags_t, int, tree);
@@ -126,7 +122,6 @@ static tree retrieve_specialization (tree, tree);
static tree retrieve_local_specialization (tree);
static tree register_specialization (tree, tree, tree);
static void register_local_specialization (tree, tree);
-static int unregister_specialization (tree, tree);
static tree reduce_template_parm_level (tree, tree, int);
static tree build_template_decl (tree, tree);
static int mark_template_parm (tree, void *);
@@ -134,10 +129,12 @@ static int template_parm_this_level_p (tree, void *);
static tree tsubst_friend_function (tree, tree);
static tree tsubst_friend_class (tree, tree);
static int can_complete_type_without_circularity (tree);
+static tree get_bindings (tree, tree, tree);
static tree get_bindings_real (tree, tree, tree, int, int, int);
static int template_decl_level (tree);
static int check_cv_quals_for_unify (int, tree, tree);
-static tree tsubst_template_arg_vector (tree, tree, tsubst_flags_t);
+static tree tsubst_template_arg (tree, tree, tsubst_flags_t, tree);
+static tree tsubst_template_args (tree, tree, tsubst_flags_t, tree);
static tree tsubst_template_parms (tree, tree, tsubst_flags_t);
static void regenerate_decl_from_template (tree, tree);
static tree most_specialized (tree, tree, tree);
@@ -173,49 +170,22 @@ static tree tsubst_copy (tree, tree, tsubst_flags_t, tree);
/* Make the current scope suitable for access checking when we are
processing T. T can be FUNCTION_DECL for instantiated function
- template, TEMPLATE_DECL for uninstantiated one, or VAR_DECL for
- static member variable (need by instantiate_decl). ARGS is the
- template argument for TEMPLATE_DECL. If CONTEXT is not NULL_TREE,
- this is used instead of the context of T. */
+ template, or VAR_DECL for static member variable (need by
+ instantiate_decl). */
static void
-push_access_scope_real (tree t, tree args, tree context)
+push_access_scope (tree t)
{
- if (TREE_CODE (t) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (t))
- {
- /* When we are processing specialization `foo<Outer>' for code like
-
- template <class U> typename U::Inner foo ();
- class Outer {
- struct Inner {};
- friend Outer::Inner foo<Outer> ();
- };
-
- `T' is a TEMPLATE_DECL, but `Outer' is only a friend of one of
- its specialization. We can get the FUNCTION_DECL with the right
- information because this specialization has already been
- registered by the friend declaration above. */
-
- if (DECL_FUNCTION_TEMPLATE_P (t) && args)
- {
- tree full_args = tsubst_template_arg_vector
- (DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t)), args, tf_none);
- tree spec = NULL_TREE;
- if (full_args != error_mark_node)
- spec = retrieve_specialization (t, full_args);
- if (spec)
- t = spec;
- }
- }
+ my_friendly_assert (TREE_CODE (t) == FUNCTION_DECL
+ || TREE_CODE (t) == VAR_DECL,
+ 0);
- if (!context)
- context = DECL_CONTEXT (t);
- if (context && TYPE_P (context))
- push_nested_class (context);
+ if (DECL_CLASS_SCOPE_P (t))
+ push_nested_class (DECL_CONTEXT (t));
else
push_to_top_level ();
- if (TREE_CODE (t) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (t))
+ if (TREE_CODE (t) == FUNCTION_DECL)
{
saved_access_scope = tree_cons
(NULL_TREE, current_function_decl, saved_access_scope);
@@ -223,21 +193,13 @@ push_access_scope_real (tree t, tree args, tree context)
}
}
-/* Like push_access_scope_real, but always uses DECL_CONTEXT. */
-
-static void
-push_access_scope (tree t)
-{
- push_access_scope_real (t, NULL_TREE, NULL_TREE);
-}
-
/* Restore the scope set up by push_access_scope. T is the node we
are processing. */
static void
pop_access_scope (tree t)
{
- if (TREE_CODE (t) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (t))
+ if (TREE_CODE (t) == FUNCTION_DECL)
{
current_function_decl = TREE_VALUE (saved_access_scope);
saved_access_scope = TREE_CHAIN (saved_access_scope);
@@ -876,9 +838,8 @@ retrieve_specialization (tree tmpl, tree args)
static tree
retrieve_local_specialization (tree tmpl)
{
- tree spec =
- (tree) htab_find_with_hash (local_specializations, tmpl,
- htab_hash_pointer (tmpl));
+ tree spec = htab_find_with_hash (local_specializations, tmpl,
+ htab_hash_pointer (tmpl));
return spec ? TREE_PURPOSE (spec) : NULL_TREE;
}
@@ -1023,11 +984,11 @@ register_specialization (tree spec, tree tmpl, tree args)
}
/* Unregister the specialization SPEC as a specialization of TMPL.
- Returns nonzero if the SPEC was listed as a specialization of
- TMPL. */
+ Replace it with NEW_SPEC, if NEW_SPEC is non-NULL. Returns true
+ if the SPEC was listed as a specialization of TMPL. */
-static int
-unregister_specialization (tree spec, tree tmpl)
+bool
+reregister_specialization (tree spec, tree tmpl, tree new_spec)
{
tree* s;
@@ -1036,7 +997,10 @@ unregister_specialization (tree spec, tree tmpl)
s = &TREE_CHAIN (*s))
if (TREE_VALUE (*s) == spec)
{
- *s = TREE_CHAIN (*s);
+ if (!new_spec)
+ *s = TREE_CHAIN (*s);
+ else
+ TREE_VALUE (*s) = new_spec;
return 1;
}
@@ -1418,9 +1382,9 @@ copy_default_args_to_explicit_spec (tree decl)
TREE_VALUE (in_charge),
new_spec_types);
- new_type = build_cplus_method_type (object_type,
- TREE_TYPE (old_type),
- new_spec_types);
+ new_type = build_method_type_directly (object_type,
+ TREE_TYPE (old_type),
+ new_spec_types);
}
else
new_type = build_function_type (TREE_TYPE (old_type),
@@ -1673,15 +1637,6 @@ check_explicit_specialization (tree declarator,
return decl;
}
- else if (TREE_CODE (TREE_OPERAND (declarator, 0)) == LOOKUP_EXPR)
- {
- /* A friend declaration. We can't do much, because we don't
- know what this resolves to, yet. */
- my_friendly_assert (is_friend != 0, 0);
- my_friendly_assert (!explicit_instantiation, 0);
- SET_DECL_IMPLICIT_INSTANTIATION (decl);
- return decl;
- }
else if (ctype != NULL_TREE
&& (TREE_CODE (TREE_OPERAND (declarator, 0)) ==
IDENTIFIER_NODE))
@@ -2451,11 +2406,11 @@ process_partial_specialization (tree decl)
{
/* We haven't yet initialized TPD2. Do so now. */
tpd2.arg_uses_template_parms
- = (int*) alloca (sizeof (int) * nargs);
+ = alloca (sizeof (int) * nargs);
/* The number of parameters here is the number in the
main template, which, as checked in the assertion
above, is NARGS. */
- tpd2.parms = (int*) alloca (sizeof (int) * nargs);
+ tpd2.parms = alloca (sizeof (int) * nargs);
tpd2.level =
TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (maintmpl));
}
@@ -2719,6 +2674,15 @@ push_template_decl_real (tree decl, int is_friend)
else if (TREE_CODE (decl) == TYPE_DECL
&& ANON_AGGRNAME_P (DECL_NAME (decl)))
error ("template class without a name");
+ else if (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_DESTRUCTOR_P (decl))
+ {
+ /* [temp.mem]
+
+ A destructor shall not be a member template. */
+ error ("destructor `%D' declared as member template", decl);
+ return error_mark_node;
+ }
else if ((DECL_IMPLICIT_TYPEDEF_P (decl)
&& CLASS_TYPE_P (TREE_TYPE (decl)))
|| (TREE_CODE (decl) == VAR_DECL && ctx && CLASS_TYPE_P (ctx))
@@ -2982,8 +2946,7 @@ redeclare_class_template (tree type, tree parms)
A template-parameter may not be given default arguments
by two different declarations in the same scope. */
error ("redefinition of default argument for `%#D'", parm);
- error ("%H original definition appeared here",
- &DECL_SOURCE_LOCATION (tmpl_parm));
+ error ("%J original definition appeared here", tmpl_parm);
return;
}
@@ -3047,14 +3010,12 @@ convert_nontype_argument (tree type, tree expr)
Check this first since if expr_type is the unknown_type_node
we would otherwise complain below. */
;
- else if (TYPE_PTRMEM_P (expr_type)
- || TYPE_PTRMEMFUNC_P (expr_type))
+ else if (TYPE_PTR_TO_MEMBER_P (expr_type))
{
if (TREE_CODE (expr) != PTRMEM_CST)
goto bad_argument;
}
else if (TYPE_PTR_P (expr_type)
- || TYPE_PTRMEM_P (expr_type)
|| TREE_CODE (expr_type) == ARRAY_TYPE
|| TREE_CODE (type) == REFERENCE_TYPE
/* If expr is the address of an overloaded function, we
@@ -3082,8 +3043,7 @@ convert_nontype_argument (tree type, tree expr)
else
error ("it must be the address of an object with external linkage");
}
- else if (TYPE_PTRMEM_P (expr_type)
- || TYPE_PTRMEMFUNC_P (expr_type))
+ else if (TYPE_PTR_TO_MEMBER_P (expr_type))
error ("it must be a pointer-to-member of the form `&X::Y'");
return NULL_TREE;
@@ -3100,6 +3060,9 @@ convert_nontype_argument (tree type, tree expr)
return NULL_TREE;
}
+ if (TREE_CODE (referent) == SCOPE_REF)
+ referent = TREE_OPERAND (referent, 1);
+
if (is_overloaded_fn (referent))
/* We'll check that it has external linkage later. */
;
@@ -3111,9 +3074,7 @@ convert_nontype_argument (tree type, tree expr)
return error_mark_node;
}
}
- else if (INTEGRAL_TYPE_P (expr_type)
- || TYPE_PTRMEM_P (expr_type)
- || TYPE_PTRMEMFUNC_P (expr_type))
+ else if (INTEGRAL_TYPE_P (expr_type) || TYPE_PTR_TO_MEMBER_P (expr_type))
{
if (! TREE_CONSTANT (expr))
{
@@ -3125,7 +3086,14 @@ convert_nontype_argument (tree type, tree expr)
}
else
{
- error ("object `%E' cannot be used as template argument", expr);
+ if (TYPE_P (expr))
+ error ("type '%T' cannot be used as a value for a non-type "
+ "template-parameter", expr);
+ else if (DECL_P (expr))
+ error ("invalid use of '%D' as a non-type template-argument", expr);
+ else
+ error ("invalid use of '%E' as a non-type template-argument", expr);
+
return NULL_TREE;
}
@@ -3151,31 +3119,32 @@ convert_nontype_argument (tree type, tree expr)
goto non_constant;
return expr;
-
+
+ case OFFSET_TYPE:
+ {
+ tree e;
+
+ /* For a non-type template-parameter of type pointer to data
+ member, qualification conversions (_conv.qual_) are
+ applied. */
+ e = perform_qualification_conversions (type, expr);
+ if (TREE_CODE (e) == NOP_EXPR)
+ /* The call to perform_qualification_conversions will
+ insert a NOP_EXPR over EXPR to do express conversion,
+ if necessary. But, that will confuse us if we use
+ this (converted) template parameter to instantiate
+ another template; then the thing will not look like a
+ valid template argument. So, just make a new
+ constant, of the appropriate type. */
+ e = make_ptrmem_cst (type, PTRMEM_CST_MEMBER (expr));
+ return e;
+ }
+
case POINTER_TYPE:
{
tree type_pointed_to = TREE_TYPE (type);
- if (TYPE_PTRMEM_P (type))
- {
- tree e;
-
- /* For a non-type template-parameter of type pointer to data
- member, qualification conversions (_conv.qual_) are
- applied. */
- e = perform_qualification_conversions (type, expr);
- if (TREE_CODE (e) == NOP_EXPR)
- /* The call to perform_qualification_conversions will
- insert a NOP_EXPR over EXPR to do express conversion,
- if necessary. But, that will confuse us if we use
- this (converted) template parameter to instantiate
- another template; then the thing will not look like a
- valid template argument. So, just make a new
- constant, of the appropriate type. */
- e = make_ptrmem_cst (type, PTRMEM_CST_MEMBER (expr));
- return e;
- }
- else if (TREE_CODE (type_pointed_to) == FUNCTION_TYPE)
+ if (TREE_CODE (type_pointed_to) == FUNCTION_TYPE)
{
/* For a non-type template-parameter of type pointer to
function, only the function-to-pointer conversion
@@ -3239,9 +3208,12 @@ convert_nontype_argument (tree type, tree expr)
tree type_referred_to = TREE_TYPE (type);
/* If this expression already has reference type, get the
- underling object. */
+ underlying object. */
if (TREE_CODE (expr_type) == REFERENCE_TYPE)
{
+ if (TREE_CODE (expr) == NOP_EXPR
+ && TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
+ STRIP_NOPS (expr);
my_friendly_assert (TREE_CODE (expr) == ADDR_EXPR, 20000604);
expr = TREE_OPERAND (expr, 0);
expr_type = TREE_TYPE (expr);
@@ -3295,7 +3267,7 @@ convert_nontype_argument (tree type, tree expr)
}
cxx_mark_addressable (expr);
- return build1 (ADDR_EXPR, type, expr);
+ return build_nop (type, build_address (expr));
}
break;
@@ -3409,9 +3381,8 @@ coerce_template_template_parms (tree parm_parms,
tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg);
- if (!coerce_template_template_parms (parmparm, argparm,
- complain, in_decl,
- outer_args))
+ if (!coerce_template_template_parms
+ (parmparm, argparm, complain, in_decl, outer_args))
return 0;
}
break;
@@ -3420,9 +3391,9 @@ coerce_template_template_parms (tree parm_parms,
/* The tsubst call is used to handle cases such as
template <class T, template <T> class TT> class D;
i.e. the parameter list of TT depends on earlier parameters. */
- if (!same_type_p (tsubst (TREE_TYPE (parm), outer_args,
- complain, in_decl),
- TREE_TYPE (arg)))
+ if (!same_type_p
+ (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl),
+ TREE_TYPE (arg)))
return 0;
break;
@@ -3455,8 +3426,7 @@ convert_template_argument (tree parm,
inner_args = INNERMOST_TEMPLATE_ARGS (args);
if (TREE_CODE (arg) == TREE_LIST
- && TREE_TYPE (arg) != NULL_TREE
- && TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE)
+ && TREE_CODE (TREE_VALUE (arg)) == OFFSET_REF)
{
/* The template argument was the name of some
member function. That's usually
@@ -3471,33 +3441,15 @@ convert_template_argument (tree parm,
requires_type = (TREE_CODE (parm) == TYPE_DECL
|| requires_tmpl_type);
- if (TREE_CODE (arg) != RECORD_TYPE)
- is_tmpl_type = ((TREE_CODE (arg) == TEMPLATE_DECL
- && TREE_CODE (DECL_TEMPLATE_RESULT (arg)) == TYPE_DECL)
- || TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
- || TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE);
- else if (CLASSTYPE_TEMPLATE_INFO (arg) && !CLASSTYPE_USE_TEMPLATE (arg)
- && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (arg)))
- {
- if (is_base_of_enclosing_class (arg, current_class_type))
- /* This is a template name used within the scope of the
- template. It could be the template, or it could be the
- instantiation. Choose whichever makes sense. */
- is_tmpl_type = requires_tmpl_type;
- else
- is_tmpl_type = 1;
- }
- else
- /* It is a non-template class, or a specialization of a template
- class, or a non-template member of a template class. */
- is_tmpl_type = 0;
+ is_tmpl_type = ((TREE_CODE (arg) == TEMPLATE_DECL
+ && TREE_CODE (DECL_TEMPLATE_RESULT (arg)) == TYPE_DECL)
+ || TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
+ || TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE);
if (is_tmpl_type
&& (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
|| TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE))
arg = TYPE_STUB_DECL (arg);
- else if (is_tmpl_type && TREE_CODE (arg) == RECORD_TYPE)
- arg = CLASSTYPE_TI_TEMPLATE (arg);
is_type = TYPE_P (arg) || is_tmpl_type;
@@ -3641,7 +3593,7 @@ coerce_template_parms (tree parms,
tree new_inner_args;
inner_args = INNERMOST_TEMPLATE_ARGS (args);
- nargs = NUM_TMPL_ARGS (inner_args);
+ nargs = inner_args ? NUM_TMPL_ARGS (inner_args) : 0;
nparms = TREE_VEC_LENGTH (parms);
if (nargs > nparms
@@ -3672,39 +3624,18 @@ coerce_template_parms (tree parms,
parm = TREE_VEC_ELT (parms, i);
/* Calculate the Ith argument. */
- if (inner_args && TREE_CODE (inner_args) == TREE_LIST)
- {
- arg = TREE_VALUE (inner_args);
- inner_args = TREE_CHAIN (inner_args);
- }
- else if (i < nargs)
+ if (i < nargs)
arg = TREE_VEC_ELT (inner_args, i);
- /* If no template argument was supplied, look for a default
- value. */
- else if (TREE_PURPOSE (parm) == NULL_TREE)
- {
- /* There was no default value. */
- my_friendly_assert (!require_all_arguments, 0);
- break;
- }
- else if (TREE_CODE (TREE_VALUE (parm)) == TYPE_DECL)
- arg = tsubst (TREE_PURPOSE (parm), new_args, complain, in_decl);
+ else if (require_all_arguments)
+ /* There must be a default arg in this case. */
+ arg = tsubst_template_arg (TREE_PURPOSE (parm), new_args,
+ complain, in_decl);
else
- arg = tsubst_expr (TREE_PURPOSE (parm), new_args, complain,
- in_decl);
-
- /* Now, convert the Ith argument, as necessary. */
- if (arg == NULL_TREE)
- /* We're out of arguments. */
- {
- my_friendly_assert (!require_all_arguments, 0);
- break;
- }
- else if (arg == error_mark_node)
- {
- error ("template argument %d is invalid", i + 1);
- arg = error_mark_node;
- }
+ break;
+
+ my_friendly_assert (arg, 20030727);
+ if (arg == error_mark_node)
+ error ("template argument %d is invalid", i + 1);
else
arg = convert_template_argument (TREE_VALUE (parm),
arg, new_args, complain, i,
@@ -3826,13 +3757,6 @@ mangle_class_name_for_template (const char* name, tree parms, tree arglist)
else
my_friendly_assert (TREE_CODE (parm) == PARM_DECL, 269);
- if (TREE_CODE (arg) == TREE_LIST)
- {
- /* New list cell was built because old chain link was in
- use. */
- my_friendly_assert (TREE_PURPOSE (arg) == NULL_TREE, 270);
- arg = TREE_VALUE (arg);
- }
/* No need to check arglist against parmlist here; we did that
in coerce_template_parms, called from lookup_template_class. */
cat (expr_as_string (arg, TFF_PLAIN_IDENTIFIER));
@@ -3928,7 +3852,9 @@ lookup_template_function (tree fns, tree arglist)
if (fns == error_mark_node || arglist == error_mark_node)
return error_mark_node;
- if (fns == NULL_TREE)
+ my_friendly_assert (!arglist || TREE_CODE (arglist) == TREE_VEC, 20030726);
+ if (fns == NULL_TREE
+ || TREE_CODE (fns) == FUNCTION_DECL)
{
error ("non-template used as template");
return error_mark_node;
@@ -3937,8 +3863,7 @@ lookup_template_function (tree fns, tree arglist)
my_friendly_assert (TREE_CODE (fns) == TEMPLATE_DECL
|| TREE_CODE (fns) == OVERLOAD
|| BASELINK_P (fns)
- || TREE_CODE (fns) == IDENTIFIER_NODE
- || TREE_CODE (fns) == LOOKUP_EXPR,
+ || TREE_CODE (fns) == IDENTIFIER_NODE,
20020730);
if (BASELINK_P (fns))
@@ -3979,9 +3904,6 @@ maybe_get_template_decl_from_type_decl (tree decl)
parameters, find the desired type.
D1 is the PTYPENAME terminal, and ARGLIST is the list of arguments.
- (Actually ARGLIST may be either a TREE_LIST or a TREE_VEC. It will
- be a TREE_LIST if called directly from the parser, and a TREE_VEC
- otherwise.)
IN_DECL, if non-NULL, is the template declaration we are trying to
instantiate.
@@ -4005,8 +3927,9 @@ lookup_template_class (tree d1,
{
tree template = NULL_TREE, parmlist;
tree t;
-
+
timevar_push (TV_NAME_LOOKUP);
+
if (TREE_CODE (d1) == IDENTIFIER_NODE)
{
if (IDENTIFIER_VALUE (d1)
@@ -4066,11 +3989,10 @@ lookup_template_class (tree d1,
}
if (TREE_CODE (template) != TEMPLATE_DECL
- /* If we're called from the parser, make sure it's a user visible
- template. */
- || ((!arglist || TREE_CODE (arglist) == TREE_LIST)
- && !DECL_TEMPLATE_PARM_P (template)
- && !PRIMARY_TEMPLATE_P (template)))
+ /* Make sure it's a user visible template, if it was named by
+ the user. */
+ || ((complain & tf_user) && !DECL_TEMPLATE_PARM_P (template)
+ && !PRIMARY_TEMPLATE_P (template)))
{
if (complain & tf_error)
{
@@ -4081,6 +4003,8 @@ lookup_template_class (tree d1,
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
+ complain &= ~tf_user;
+
if (DECL_TEMPLATE_TEMPLATE_PARM_P (template))
{
/* Create a new TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM node to store
@@ -4314,7 +4238,6 @@ lookup_template_class (tree d1,
t = make_aggr_type (TREE_CODE (template_type));
CLASSTYPE_DECLARED_CLASS (t)
= CLASSTYPE_DECLARED_CLASS (template_type);
- CLASSTYPE_GOT_SEMICOLON (t) = 1;
SET_CLASSTYPE_IMPLICIT_INSTANTIATION (t);
TYPE_FOR_JAVA (t) = TYPE_FOR_JAVA (template_type);
@@ -4611,7 +4534,6 @@ for_each_template_parm_r (tree* tp, int* walk_subtrees, void* d)
case ARROW_EXPR:
case DOTSTAR_EXPR:
case TYPEID_EXPR:
- case LOOKUP_EXPR:
case PSEUDO_DTOR_EXPR:
if (!fn)
return error_mark_node;
@@ -4944,8 +4866,9 @@ tsubst_friend_function (tree decl, tree args)
DECL_TEMPLATE_INFO (old_decl) = new_friend_template_info;
if (TREE_CODE (old_decl) != TEMPLATE_DECL)
- /* duplicate_decls will take care of this case. */
- ;
+ reregister_specialization (new_friend,
+ most_general_template (old_decl),
+ old_decl);
else
{
tree t;
@@ -5077,6 +5000,8 @@ tsubst_friend_class (tree friend_tmpl, tree args)
DECL_USE_TEMPLATE (tmpl) = 0;
DECL_TEMPLATE_INFO (tmpl) = NULL_TREE;
CLASSTYPE_USE_TEMPLATE (TREE_TYPE (tmpl)) = 0;
+ CLASSTYPE_TI_ARGS (TREE_TYPE (tmpl))
+ = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (TREE_TYPE (tmpl)));
/* Inject this template into the global scope. */
friend_type = TREE_TYPE (pushdecl_top_level (tmpl));
@@ -5105,7 +5030,8 @@ can_complete_type_without_circularity (tree type)
return 1;
else if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
return can_complete_type_without_circularity (TREE_TYPE (type));
- else if (CLASS_TYPE_P (type) && TYPE_BEING_DEFINED (TYPE_MAIN_VARIANT (type)))
+ else if (CLASS_TYPE_P (type)
+ && TYPE_BEING_DEFINED (TYPE_MAIN_VARIANT (type)))
return 0;
else
return 1;
@@ -5144,8 +5070,7 @@ instantiate_class_template (tree type)
for (t = DECL_TEMPLATE_SPECIALIZATIONS (template); t;
t = TREE_CHAIN (t))
{
- if (get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
- args))
+ if (get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t), args))
{
cp_error_at ("%s %+#T", str, TREE_TYPE (t));
str = " ";
@@ -5226,11 +5151,12 @@ instantiate_class_template (tree type)
SET_CLASSTYPE_INTERFACE_UNKNOWN (type);
}
+ /* Set the input location to the template definition. This is needed
+ if tsubsting causes an error. */
+ input_location = DECL_SOURCE_LOCATION (TYPE_NAME (pattern));
+
TYPE_HAS_CONSTRUCTOR (type) = TYPE_HAS_CONSTRUCTOR (pattern);
TYPE_HAS_DESTRUCTOR (type) = TYPE_HAS_DESTRUCTOR (pattern);
- TYPE_OVERLOADS_CALL_EXPR (type) = TYPE_OVERLOADS_CALL_EXPR (pattern);
- TYPE_OVERLOADS_ARRAY_REF (type) = TYPE_OVERLOADS_ARRAY_REF (pattern);
- TYPE_OVERLOADS_ARROW (type) = TYPE_OVERLOADS_ARROW (pattern);
TYPE_HAS_NEW_OPERATOR (type) = TYPE_HAS_NEW_OPERATOR (pattern);
TYPE_HAS_ARRAY_NEW_OPERATOR (type) = TYPE_HAS_ARRAY_NEW_OPERATOR (pattern);
TYPE_GETS_DELETE (type) = TYPE_GETS_DELETE (pattern);
@@ -5261,8 +5187,14 @@ instantiate_class_template (tree type)
tree base_list = NULL_TREE;
tree pbases = BINFO_BASETYPES (pbinfo);
tree paccesses = BINFO_BASEACCESSES (pbinfo);
+ tree context = TYPE_CONTEXT (type);
int i;
+ /* We must enter the scope containing the type, as that is where
+ the accessibility of types named in dependent bases are
+ looked up from. */
+ push_scope (context ? context : global_namespace);
+
/* Substitute into each of the bases to determine the actual
basetypes. */
for (i = 0; i < TREE_VEC_LENGTH (pbases); ++i)
@@ -5289,6 +5221,8 @@ instantiate_class_template (tree type)
/* Now call xref_basetypes to set up all the base-class
information. */
xref_basetypes (type, base_list);
+
+ pop_scope (context ? context : global_namespace);
}
/* Now that our base classes are set up, enter the scope of the
@@ -5296,10 +5230,11 @@ instantiate_class_template (tree type)
correctly. This is precisely analogous to what we do in
begin_class_definition when defining an ordinary non-template
class. */
- pushclass (type, true);
+ pushclass (type);
/* Now members are processed in the order of declaration. */
- for (member = CLASSTYPE_DECL_LIST (pattern); member; member = TREE_CHAIN (member))
+ for (member = CLASSTYPE_DECL_LIST (pattern);
+ member; member = TREE_CHAIN (member))
{
tree t = TREE_VALUE (member);
@@ -5320,12 +5255,14 @@ instantiate_class_template (tree type)
if (TYPE_LANG_SPECIFIC (tag) && CLASSTYPE_IS_TEMPLATE (tag))
/* Unfortunately, lookup_template_class sets
CLASSTYPE_IMPLICIT_INSTANTIATION for a partial
- instantiation (i.e., for the type of a member template
- class nested within a template class.) This behavior is
- required for maybe_process_partial_specialization to work
- correctly, but is not accurate in this case; the TAG is not
- an instantiation of anything. (The corresponding
- TEMPLATE_DECL is an instantiation, but the TYPE is not.) */
+ instantiation (i.e., for the type of a member
+ template class nested within a template class.)
+ This behavior is required for
+ maybe_process_partial_specialization to work
+ correctly, but is not accurate in this case;
+ the TAG is not an instantiation of anything.
+ (The corresponding TEMPLATE_DECL is an
+ instantiation, but the TYPE is not.) */
CLASSTYPE_USE_TEMPLATE (newtag) = 0;
/* Now, we call pushtag to put this NEWTAG into the scope of
@@ -5342,8 +5279,13 @@ instantiate_class_template (tree type)
|| DECL_FUNCTION_TEMPLATE_P (t))
{
/* Build new TYPE_METHODS. */
-
- tree r = tsubst (t, args, tf_error, NULL_TREE);
+ tree r;
+
+ if (TREE_CODE (t) == TEMPLATE_DECL)
+ processing_template_decl++;
+ r = tsubst (t, args, tf_error, NULL_TREE);
+ if (TREE_CODE (t) == TEMPLATE_DECL)
+ processing_template_decl--;
set_current_access_from_decl (r);
grok_special_member_properties (r);
finish_member_declaration (r);
@@ -5362,7 +5304,11 @@ instantiate_class_template (tree type)
restore these. */
input_location = DECL_SOURCE_LOCATION (t);
+ if (TREE_CODE (t) == TEMPLATE_DECL)
+ processing_template_decl++;
r = tsubst (t, args, tf_error | tf_warning, NULL_TREE);
+ if (TREE_CODE (t) == TEMPLATE_DECL)
+ processing_template_decl--;
if (TREE_CODE (r) == VAR_DECL)
{
tree init;
@@ -5373,9 +5319,8 @@ instantiate_class_template (tree type)
else
init = NULL_TREE;
- finish_static_data_member_decl (r, init,
- /*asmspec_tree=*/NULL_TREE,
- /*flags=*/0);
+ finish_static_data_member_decl
+ (r, init, /*asmspec_tree=*/NULL_TREE, /*flags=*/0);
if (DECL_INITIALIZED_IN_CLASS_P (r))
check_static_variable_definition (r, TREE_TYPE (r));
@@ -5448,14 +5393,16 @@ instantiate_class_template (tree type)
++processing_template_decl;
if (new_friend_type != error_mark_node)
- make_friend_class (type, new_friend_type);
+ make_friend_class (type, new_friend_type,
+ /*complain=*/false);
if (TREE_CODE (friend_type) == TEMPLATE_DECL)
--processing_template_decl;
}
else
/* Build new DECL_FRIENDLIST. */
- add_friend (type, tsubst_friend_function (t, args));
+ add_friend (type, tsubst_friend_function (t, args),
+ /*complain=*/false);
}
}
@@ -5468,7 +5415,6 @@ instantiate_class_template (tree type)
unreverse_member_declarations (type);
finish_struct_1 (type);
- CLASSTYPE_GOT_SEMICOLON (type) = 1;
/* Clear this now so repo_template_used is happy. */
TYPE_BEING_DEFINED (type) = 0;
@@ -5497,108 +5443,78 @@ instantiate_class_template (tree type)
return type;
}
-static int
-list_eq (tree t1, tree t2)
-{
- if (t1 == NULL_TREE)
- return t2 == NULL_TREE;
- if (t2 == NULL_TREE)
- return 0;
- /* Don't care if one declares its arg const and the other doesn't -- the
- main variant of the arg type is all that matters. */
- if (TYPE_MAIN_VARIANT (TREE_VALUE (t1))
- != TYPE_MAIN_VARIANT (TREE_VALUE (t2)))
- return 0;
- return list_eq (TREE_CHAIN (t1), TREE_CHAIN (t2));
-}
-
-/* If arg is a non-type template parameter that does not depend on template
- arguments, fold it like we weren't in the body of a template. */
-
static tree
-maybe_fold_nontype_arg (tree arg)
+tsubst_template_arg (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
- if (arg && !TYPE_P (arg) && !uses_template_parms (arg))
+ tree r;
+
+ if (!t)
+ r = t;
+ else if (TYPE_P (t))
+ r = tsubst (t, args, complain, in_decl);
+ else
{
- /* Sometimes, one of the args was an expression involving a
- template constant parameter, like N - 1. Now that we've
- tsubst'd, we might have something like 2 - 1. This will
- confuse lookup_template_class, so we do constant folding
- here. We have to unset processing_template_decl, to fool
- tsubst_copy_and_build() into building an actual tree. */
+ r = tsubst_expr (t, args, complain, in_decl);
- /* If the TREE_TYPE of ARG is not NULL_TREE, ARG is already
- as simple as it's going to get, and trying to reprocess
- the trees will break. */
- if (!TREE_TYPE (arg))
+ if (!uses_template_parms (r))
{
- int saved_processing_template_decl = processing_template_decl;
- processing_template_decl = 0;
- arg = tsubst_copy_and_build (arg,
- /*args=*/NULL_TREE,
- tf_error,
- /*in_decl=*/NULL_TREE);
- processing_template_decl = saved_processing_template_decl;
- }
+ /* Sometimes, one of the args was an expression involving a
+ template constant parameter, like N - 1. Now that we've
+ tsubst'd, we might have something like 2 - 1. This will
+ confuse lookup_template_class, so we do constant folding
+ here. We have to unset processing_template_decl, to fool
+ tsubst_copy_and_build() into building an actual tree. */
- arg = fold (arg);
- }
- return arg;
-}
-
-/* Apply maybe_fold_nontype_arg on a list or vector of args. */
-
-static void
-maybe_fold_nontype_args (tree targs)
-{
- if (!targs)
- /*OK*/;
- else if (TREE_CODE (targs) == TREE_LIST)
- {
- tree chain;
- for (chain = targs; chain; chain = TREE_CHAIN (chain))
- TREE_VALUE (chain) = maybe_fold_nontype_arg (TREE_VALUE (chain));
- }
- else
- {
- int i;
- for (i = 0; i < TREE_VEC_LENGTH (targs); ++i)
- TREE_VEC_ELT (targs, i)
- = maybe_fold_nontype_arg (TREE_VEC_ELT (targs, i));
+ /* If the TREE_TYPE of ARG is not NULL_TREE, ARG is already
+ as simple as it's going to get, and trying to reprocess
+ the trees will break. Once tsubst_expr et al DTRT for
+ non-dependent exprs, this code can go away, as the type
+ will always be set. */
+ if (!TREE_TYPE (r))
+ {
+ int saved_processing_template_decl = processing_template_decl;
+ processing_template_decl = 0;
+ r = tsubst_copy_and_build (r, /*args=*/NULL_TREE,
+ tf_error, /*in_decl=*/NULL_TREE,
+ /*function_p=*/false);
+ processing_template_decl = saved_processing_template_decl;
+ }
+ r = fold (r);
+ }
}
+ return r;
}
-/* Substitute ARGS into the vector of template arguments T. */
+/* Substitute ARGS into the vector or list of template arguments T. */
static tree
-tsubst_template_arg_vector (tree t, tree args, tsubst_flags_t complain)
+tsubst_template_args (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
- int len = TREE_VEC_LENGTH (t), need_new = 0, i;
- tree *elts = (tree *) alloca (len * sizeof (tree));
-
- memset ((char *) elts, 0, len * sizeof (tree));
+ int len = TREE_VEC_LENGTH (t);
+ int need_new = 0, i;
+ tree *elts = alloca (len * sizeof (tree));
for (i = 0; i < len; i++)
{
- if (TREE_VEC_ELT (t, i) != NULL_TREE
- && TREE_CODE (TREE_VEC_ELT (t, i)) == TREE_VEC)
- elts[i] = tsubst_template_arg_vector (TREE_VEC_ELT (t, i),
- args, complain);
+ tree orig_arg = TREE_VEC_ELT (t, i);
+ tree new_arg;
+
+ if (TREE_CODE (orig_arg) == TREE_VEC)
+ new_arg = tsubst_template_args (orig_arg, args, complain, in_decl);
else
- elts[i] = maybe_fold_nontype_arg
- (tsubst_expr (TREE_VEC_ELT (t, i), args, complain,
- NULL_TREE));
+ new_arg = tsubst_template_arg (orig_arg, args, complain, in_decl);
- if (elts[i] == error_mark_node)
+ if (new_arg == error_mark_node)
return error_mark_node;
- if (elts[i] != TREE_VEC_ELT (t, i))
+ elts[i] = new_arg;
+ if (new_arg != orig_arg)
need_new = 1;
}
if (!need_new)
return t;
-
+
t = make_tree_vec (len);
for (i = 0; i < len; i++)
TREE_VEC_ELT (t, i) = elts[i];
@@ -5635,10 +5551,10 @@ tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain)
tree parm_decl = TREE_VALUE (tuple);
parm_decl = tsubst (parm_decl, args, complain, NULL_TREE);
- default_value = tsubst_expr (default_value, args,
- complain, NULL_TREE);
- tuple = build_tree_list (maybe_fold_nontype_arg (default_value),
- parm_decl);
+ default_value = tsubst_template_arg (default_value, args,
+ complain, NULL_TREE);
+
+ tuple = build_tree_list (default_value, parm_decl);
TREE_VEC_ELT (new_vec, i) = tuple;
}
@@ -5684,12 +5600,10 @@ tsubst_aggr_type (tree t,
/* First, determine the context for the type we are looking
up. */
- if (TYPE_CONTEXT (t) != NULL_TREE)
- context = tsubst_aggr_type (TYPE_CONTEXT (t), args,
- complain,
+ context = TYPE_CONTEXT (t);
+ if (context)
+ context = tsubst_aggr_type (context, args, complain,
in_decl, /*entering_scope=*/1);
- else
- context = NULL_TREE;
/* Then, figure out what arguments are appropriate for the
type we are trying to find. For example, given:
@@ -5700,8 +5614,8 @@ tsubst_aggr_type (tree t,
and supposing that we are instantiating f<int, double>,
then our ARGS will be {int, double}, but, when looking up
S we only want {double}. */
- argvec = tsubst_template_arg_vector (TYPE_TI_ARGS (t), args,
- complain);
+ argvec = tsubst_template_args (TYPE_TI_ARGS (t), args,
+ complain, in_decl);
if (argvec == error_mark_node)
return error_mark_node;
@@ -5817,10 +5731,10 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
: DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t));
tree full_args;
- full_args = tsubst_template_arg_vector (tmpl_args, args,
- complain);
+ full_args = tsubst_template_args (tmpl_args, args,
+ complain, in_decl);
- /* tsubst_template_arg_vector doesn't copy the vector if
+ /* tsubst_template_args doesn't copy the vector if
nothing changed. But, *something* should have
changed. */
my_friendly_assert (full_args != tmpl_args, 0);
@@ -5867,6 +5781,8 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
else
{
tree new_decl = tsubst (decl, args, complain, in_decl);
+ if (new_decl == error_mark_node)
+ return error_mark_node;
DECL_TEMPLATE_RESULT (r) = new_decl;
DECL_TI_TEMPLATE (new_decl) = r;
@@ -5888,14 +5804,10 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
if (PRIMARY_TEMPLATE_P (t))
DECL_PRIMARY_TEMPLATE (r) = r;
- /* We don't partially instantiate partial specializations. */
- if (TREE_CODE (decl) == TYPE_DECL)
- break;
-
- /* Record this partial instantiation. */
- register_specialization (r, t,
- DECL_TI_ARGS (DECL_TEMPLATE_RESULT (r)));
-
+ if (TREE_CODE (decl) != TYPE_DECL)
+ /* Record this non-type partial instantiation. */
+ register_specialization (r, t,
+ DECL_TI_ARGS (DECL_TEMPLATE_RESULT (r)));
}
break;
@@ -5931,10 +5843,9 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
specialization, and the complete set of arguments used to
specialize R. */
gen_tmpl = most_general_template (DECL_TI_TEMPLATE (t));
- argvec
- = tsubst_template_arg_vector (DECL_TI_ARGS
- (DECL_TEMPLATE_RESULT (gen_tmpl)),
- args, complain);
+ argvec = tsubst_template_args (DECL_TI_ARGS
+ (DECL_TEMPLATE_RESULT (gen_tmpl)),
+ args, complain, in_decl);
/* Check to see if we already have this specialization. */
spec = retrieve_specialization (gen_tmpl, argvec);
@@ -5993,10 +5904,10 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
};
Here, the DECL_TI_TEMPLATE for the friend declaration
- will be a LOOKUP_EXPR or an IDENTIFIER_NODE. We are
- being called from tsubst_friend_function, and we want
- only to create a new decl (R) with appropriate types so
- that we can call determine_specialization. */
+ will be an IDENTIFIER_NODE. We are being called from
+ tsubst_friend_function, and we want only to create a
+ new decl (R) with appropriate types so that we can call
+ determine_specialization. */
gen_tmpl = NULL_TREE;
}
@@ -6007,8 +5918,7 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
else
member = 1;
ctx = tsubst_aggr_type (DECL_CONTEXT (t), args,
- complain, t,
- /*entering_scope=*/1);
+ complain, t, /*entering_scope=*/1);
}
else
{
@@ -6109,7 +6019,8 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
clone_function_decl (r, /*update_method_vec_p=*/0);
}
else if (IDENTIFIER_OPNAME_P (DECL_NAME (r)))
- grok_op_properties (r, DECL_FRIEND_P (r));
+ grok_op_properties (r, DECL_FRIEND_P (r),
+ (complain & tf_error) != 0);
}
break;
@@ -6122,11 +6033,14 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
TREE_TYPE (r) = type;
c_apply_type_quals_to_decl (cp_type_quals (type), r);
- if (TREE_CODE (DECL_INITIAL (r)) != TEMPLATE_PARM_INDEX)
- DECL_INITIAL (r) = TREE_TYPE (r);
- else
- DECL_INITIAL (r) = tsubst (DECL_INITIAL (r), args,
- complain, in_decl);
+ if (DECL_INITIAL (r))
+ {
+ if (TREE_CODE (DECL_INITIAL (r)) != TEMPLATE_PARM_INDEX)
+ DECL_INITIAL (r) = TREE_TYPE (r);
+ else
+ DECL_INITIAL (r) = tsubst (DECL_INITIAL (r), args,
+ complain, in_decl);
+ }
DECL_CONTEXT (r) = NULL_TREE;
@@ -6157,6 +6071,8 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
case USING_DECL:
{
r = copy_node (t);
+ /* It is not a dependent using decl any more. */
+ TREE_TYPE (r) = void_type_node;
DECL_INITIAL (r)
= tsubst_copy (DECL_INITIAL (t), args, complain, in_decl);
TREE_CHAIN (r) = NULL_TREE;
@@ -6221,7 +6137,13 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
r = copy_decl (t);
if (TREE_CODE (r) == VAR_DECL)
- type = complete_type (type);
+ {
+ type = complete_type (type);
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (r)
+ = DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (t);
+ }
+ else if (DECL_SELF_REFERENCE_P (t))
+ SET_DECL_SELF_REFERENCE_P (r);
TREE_TYPE (r) = type;
c_apply_type_quals_to_decl (cp_type_quals (type), r);
DECL_CONTEXT (r) = ctx;
@@ -6383,8 +6305,8 @@ tsubst_function_type (tree t,
return error_mark_node;
}
- fntype = build_cplus_method_type (r, return_type, TREE_CHAIN
- (arg_types));
+ fntype = build_method_type_directly (r, return_type,
+ TREE_CHAIN (arg_types));
}
fntype = cp_build_qualified_type_real (fntype, TYPE_QUALS (t), complain);
fntype = build_type_attribute_variant (fntype, TYPE_ATTRIBUTES (t));
@@ -6460,8 +6382,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
type = IDENTIFIER_TYPE_VALUE (t);
else
type = TREE_TYPE (t);
- if (type == unknown_type_node)
- abort ();
+
+ my_friendly_assert (type != unknown_type_node, 20030716);
if (type && TREE_CODE (t) != FUNCTION_DECL
&& TREE_CODE (t) != TYPENAME_TYPE
@@ -6507,12 +6429,9 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
tree max, omax = TREE_OPERAND (TYPE_MAX_VALUE (t), 0);
- max = tsubst_expr (omax, args, complain, in_decl);
- if (max == error_mark_node)
- return error_mark_node;
-
- /* See if we can reduce this expression to something simpler. */
- max = maybe_fold_nontype_arg (max);
+ /* The array dimension behaves like a non-type template arg,
+ in that we want to fold it as much as possible. */
+ max = tsubst_template_arg (omax, args, complain, in_decl);
if (!processing_template_decl)
max = decl_constant_value (max);
@@ -6756,7 +6675,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
}
/* Otherwise, a vector of template arguments. */
- return tsubst_template_arg_vector (t, args, complain);
+ return tsubst_template_args (t, args, complain, in_decl);
case POINTER_TYPE:
case REFERENCE_TYPE:
@@ -6841,21 +6760,28 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
}
my_friendly_assert (TREE_CODE (type) != METHOD_TYPE, 20011231);
if (TREE_CODE (type) == FUNCTION_TYPE)
- /* This is really a method type. The cv qualifiers of the
- this pointer should _not_ be determined by the cv
- qualifiers of the class type. They should be held
- somewhere in the FUNCTION_TYPE, but we don't do that at
- the moment. Consider
- typedef void (Func) () const;
-
- template <typename T1> void Foo (Func T1::*);
-
- */
- return build_cplus_method_type (TYPE_MAIN_VARIANT (r),
- TREE_TYPE (type),
- TYPE_ARG_TYPES (type));
+ {
+ /* This is really a method type. The cv qualifiers of the
+ this pointer should _not_ be determined by the cv
+ qualifiers of the class type. They should be held
+ somewhere in the FUNCTION_TYPE, but we don't do that at
+ the moment. Consider
+ typedef void (Func) () const;
+
+ template <typename T1> void Foo (Func T1::*);
+
+ */
+ tree method_type;
+
+ method_type = build_method_type_directly (TYPE_MAIN_VARIANT (r),
+ TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
+ return build_ptrmemfunc_type (build_pointer_type (method_type));
+ }
else
- return build_offset_type (r, type);
+ return cp_build_qualified_type_real (build_ptrmem_type (r, type),
+ TYPE_QUALS (t),
+ complain);
}
case FUNCTION_TYPE:
case METHOD_TYPE:
@@ -7104,8 +7030,9 @@ tsubst_baselink (tree baselink, tree object_type,
template_id_p = true;
template_args = TREE_OPERAND (fns, 1);
fns = TREE_OPERAND (fns, 0);
- template_args = tsubst_copy_and_build (template_args, args,
- complain, in_decl);
+ if (template_args)
+ template_args = tsubst_template_args (template_args, args,
+ complain, in_decl);
}
name = DECL_NAME (get_first_fn (fns));
baselink = lookup_fnfields (qualifying_scope, name, /*protect=*/1);
@@ -7140,17 +7067,15 @@ tsubst_qualified_id (tree qualified_id, tree args,
my_friendly_assert (TREE_CODE (qualified_id) == SCOPE_REF, 20030706);
- /* Look up the qualified name. */
- scope = TREE_OPERAND (qualified_id, 0);
- scope = tsubst (scope, args, complain, in_decl);
-
/* Figure out what name to look up. */
name = TREE_OPERAND (qualified_id, 1);
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
is_template = true;
- template_args = tsubst_copy_and_build (TREE_OPERAND (name, 1),
- args, complain, in_decl);
+ template_args = TREE_OPERAND (name, 1);
+ if (template_args)
+ template_args = tsubst_template_args (template_args, args,
+ complain, in_decl);
name = TREE_OPERAND (name, 0);
}
else
@@ -7159,24 +7084,52 @@ tsubst_qualified_id (tree qualified_id, tree args,
template_args = NULL_TREE;
}
- expr = tsubst_copy (name, args, complain, in_decl);
- if (!BASELINK_P (name))
+ /* Substitute into the qualifying scope. When there are no ARGS, we
+ are just trying to simplify a non-dependent expression. In that
+ case the qualifying scope may be dependent, and, in any case,
+ substituting will not help. */
+ scope = TREE_OPERAND (qualified_id, 0);
+ if (args)
{
- expr = lookup_qualified_name (scope, expr, /*is_type_p=*/0);
- if (DECL_P (expr))
- check_accessibility_of_qualified_id (expr,
- /*object_type=*/NULL_TREE,
- scope);
+ scope = tsubst (scope, args, complain, in_decl);
+ expr = tsubst_copy (name, args, complain, in_decl);
}
+ else
+ expr = name;
+ my_friendly_assert (!dependent_type_p (scope), 20030729);
+
+ if (!BASELINK_P (name) && !DECL_P (expr))
+ {
+ expr = lookup_qualified_name (scope, expr, /*is_type_p=*/0, false);
+ if (TREE_CODE (TREE_CODE (expr) == TEMPLATE_DECL
+ ? DECL_TEMPLATE_RESULT (expr) : expr) == TYPE_DECL)
+ {
+ if (complain & tf_error)
+ error ("`%E' names a type, but a non-type is expected",
+ qualified_id);
+ return error_mark_node;
+ }
+ }
+
+ if (DECL_P (expr))
+ check_accessibility_of_qualified_id (expr, /*object_type=*/NULL_TREE,
+ scope);
+
/* Remember that there was a reference to this entity. */
if (DECL_P (expr))
- mark_used (expr);
+ {
+ mark_used (expr);
+ if (!args && TREE_CODE (expr) == VAR_DECL)
+ expr = DECL_INITIAL (expr);
+ }
if (is_template)
- lookup_template_function (expr, template_args);
+ expr = lookup_template_function (expr, template_args);
- if (TYPE_P (scope))
+ if (expr == error_mark_node && complain & tf_error)
+ qualified_name_lookup_error (scope, TREE_OPERAND (qualified_id, 1));
+ else if (TYPE_P (scope))
{
expr = (adjust_result_of_qualified_name_lookup
(expr, scope, current_class_type));
@@ -7215,8 +7168,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (DECL_TEMPLATE_PARM_P (t))
return tsubst_copy (DECL_INITIAL (t), args, complain, in_decl);
- if (!DECL_CONTEXT (t))
- /* This is a global enumeration constant. */
+ /* There is no need to substitute into namespace-scope
+ enumerators. */
+ if (DECL_NAMESPACE_SCOPE_P (t))
return t;
/* Unfortunately, we cannot just call lookup_name here.
@@ -7300,25 +7254,6 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* Ordinary template template argument. */
return t;
- case LOOKUP_EXPR:
- {
- /* We must tsubst into a LOOKUP_EXPR in case the names to
- which it refers is a conversion operator; in that case the
- name will change. We avoid making unnecessary copies,
- however. */
-
- tree id = tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl);
-
- if (id != TREE_OPERAND (t, 0))
- {
- r = build_nt (LOOKUP_EXPR, id);
- LOOKUP_EXPR_GLOBAL (r) = LOOKUP_EXPR_GLOBAL (t);
- t = r;
- }
-
- return t;
- }
-
case CAST_EXPR:
case REINTERPRET_CAST_EXPR:
case CONST_CAST_EXPR:
@@ -7389,7 +7324,6 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case ROUND_DIV_EXPR:
case EXACT_DIV_EXPR:
case BIT_AND_EXPR:
- case BIT_ANDTC_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case TRUNC_MOD_EXPR:
@@ -7439,8 +7373,10 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (!processing_template_decl)
{
tree stmt_expr = begin_stmt_expr ();
- tsubst_expr (STMT_EXPR_STMT (t), args, complain, in_decl);
- return finish_stmt_expr (stmt_expr);
+
+ tsubst_expr (STMT_EXPR_STMT (t), args,
+ complain | tf_stmt_expr_cmpd, in_decl);
+ return finish_stmt_expr (stmt_expr, false);
}
return t;
@@ -7479,12 +7415,14 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case TEMPLATE_ID_EXPR:
{
/* Substituted template arguments */
- tree targs = tsubst_copy (TREE_OPERAND (t, 1), args, complain,
- in_decl);
+ tree fn = TREE_OPERAND (t, 0);
+ tree targs = TREE_OPERAND (t, 1);
- maybe_fold_nontype_args (targs);
- return lookup_template_function
- (tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl), targs);
+ fn = tsubst_copy (fn, args, complain, in_decl);
+ if (targs)
+ targs = tsubst_template_args (targs, args, complain, in_decl);
+
+ return lookup_template_function (fn, targs);
}
case TREE_LIST:
@@ -7565,7 +7503,10 @@ static tree
tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
tree stmt, tmp;
+ tsubst_flags_t stmt_expr
+ = complain & (tf_stmt_expr_cmpd | tf_stmt_expr_body);
+ complain ^= stmt_expr;
if (t == NULL_TREE || t == error_mark_node)
return t;
@@ -7573,7 +7514,8 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
return tsubst_copy (t, args, complain, in_decl);
if (!STATEMENT_CODE_P (TREE_CODE (t)))
- return tsubst_copy_and_build (t, args, complain, in_decl);
+ return tsubst_copy_and_build (t, args, complain, in_decl,
+ /*function_p=*/false);
switch (TREE_CODE (t))
{
@@ -7590,10 +7532,18 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
break;
case EXPR_STMT:
- prep_stmt (t);
- finish_expr_stmt (tsubst_expr (EXPR_STMT_EXPR (t),
- args, complain, in_decl));
- break;
+ {
+ tree r;
+
+ prep_stmt (t);
+
+ r = tsubst_expr (EXPR_STMT_EXPR (t), args, complain, in_decl);
+ if (stmt_expr & tf_stmt_expr_body && !TREE_CHAIN (t))
+ finish_stmt_expr_expr (r);
+ else
+ finish_expr_stmt (r);
+ break;
+ }
case USING_STMT:
prep_stmt (t);
@@ -7614,11 +7564,16 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
tree scope = DECL_INITIAL (decl);
tree name = DECL_NAME (decl);
+ tree decl;
scope = tsubst_expr (scope, args, complain, in_decl);
- do_local_using_decl (lookup_qualified_name (scope,
- name,
- /*is_type_p=*/0));
+ decl = lookup_qualified_name (scope, name,
+ /*is_type_p=*/false,
+ /*complain=*/false);
+ if (decl == error_mark_node)
+ qualified_name_lookup_error (scope, name);
+ else
+ do_local_using_decl (decl);
}
else
{
@@ -7642,7 +7597,8 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
else
{
maybe_push_decl (decl);
- if (DECL_PRETTY_FUNCTION_P (decl))
+ if (TREE_CODE (decl) == VAR_DECL
+ && DECL_PRETTY_FUNCTION_P (decl))
{
/* For __PRETTY_FUNCTION__ we have to adjust the
initializer. */
@@ -7740,12 +7696,14 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
else
stmt = begin_compound_stmt (COMPOUND_STMT_NO_SCOPE (t));
- tsubst_expr (COMPOUND_BODY (t), args, complain, in_decl);
+ tsubst_expr (COMPOUND_BODY (t), args,
+ complain | ((stmt_expr & tf_stmt_expr_cmpd) << 1),
+ in_decl);
if (COMPOUND_STMT_BODY_BLOCK (t))
finish_function_body (stmt);
else
- finish_compound_stmt (COMPOUND_STMT_NO_SCOPE (t), stmt);
+ finish_compound_stmt (stmt);
}
break;
@@ -7878,18 +7836,40 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
abort ();
}
- return tsubst_expr (TREE_CHAIN (t), args, complain, in_decl);
+ return tsubst_expr (TREE_CHAIN (t), args, complain | stmt_expr, in_decl);
+}
+
+/* T is a postfix-expression that is not being used in a function
+ call. Return the substituted version of T. */
+
+static tree
+tsubst_non_call_postfix_expression (tree t, tree args,
+ tsubst_flags_t complain,
+ tree in_decl)
+{
+ if (TREE_CODE (t) == SCOPE_REF)
+ t = tsubst_qualified_id (t, args, complain, in_decl,
+ /*done=*/false, /*address_p=*/false);
+ else
+ t = tsubst_copy_and_build (t, args, complain, in_decl,
+ /*function_p=*/false);
+
+ return t;
}
/* Like tsubst but deals with expressions and performs semantic
- analysis. */
+ analysis. FUNCTION_P is true if T is the "F" in "F (ARGS)". */
tree
tsubst_copy_and_build (tree t,
tree args,
tsubst_flags_t complain,
- tree in_decl)
+ tree in_decl,
+ bool function_p)
{
+#define RECUR(NODE) \
+ tsubst_copy_and_build (NODE, args, complain, in_decl, /*function_p=*/false)
+
tree op1;
if (t == NULL_TREE || t == error_mark_node)
@@ -7897,45 +7877,53 @@ tsubst_copy_and_build (tree t,
switch (TREE_CODE (t))
{
+ case USING_DECL:
+ t = DECL_NAME (t);
+ /* Fallthrough. */
case IDENTIFIER_NODE:
- if (IDENTIFIER_TYPENAME_P (t))
- {
- tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
- return do_identifier (mangle_conv_op_name_for_type (new_type),
- NULL_TREE);
- }
- else
- return do_identifier (t, NULL_TREE);
-
- case LOOKUP_EXPR:
{
- if (LOOKUP_EXPR_GLOBAL (t))
- {
- tree token
- = tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl);
- return do_scoped_id (token, IDENTIFIER_GLOBAL_VALUE (token));
- }
- else
+ tree decl;
+ cp_id_kind idk;
+ tree qualifying_class;
+ bool non_constant_expression_p;
+ const char *error_msg;
+
+ if (IDENTIFIER_TYPENAME_P (t))
{
- t = do_identifier
- (tsubst_copy
- (TREE_OPERAND (t, 0), args, complain, in_decl),
- NULL_TREE);
- if (TREE_CODE (t) == ALIAS_DECL)
- t = DECL_INITIAL (t);
- return t;
+ tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
+ t = mangle_conv_op_name_for_type (new_type);
}
+
+ /* Look up the name. */
+ decl = lookup_name (t, 0);
+
+ /* By convention, expressions use ERROR_MARK_NODE to indicate
+ failure, not NULL_TREE. */
+ if (decl == NULL_TREE)
+ decl = error_mark_node;
+
+ 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,
+ &error_msg);
+ if (error_msg)
+ error (error_msg);
+ if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE)
+ decl = unqualified_name_lookup_error (decl);
+ return decl;
}
case TEMPLATE_ID_EXPR:
{
tree object;
- tree template
- = tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain,
- in_decl);
- tree targs
- = tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain,
- in_decl);
+ tree template = RECUR (TREE_OPERAND (t, 0));
+ tree targs = TREE_OPERAND (t, 1);
+
+ if (targs)
+ targs = tsubst_template_args (targs, args, complain, in_decl);
if (TREE_CODE (template) == COMPONENT_REF)
{
@@ -7954,46 +7942,37 @@ tsubst_copy_and_build (tree t,
}
case INDIRECT_REF:
- return build_x_indirect_ref
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
- "unary *");
+ return build_x_indirect_ref (RECUR (TREE_OPERAND (t, 0)), "unary *");
case CAST_EXPR:
return build_functional_cast
(tsubst (TREE_TYPE (t), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl));
+ RECUR (TREE_OPERAND (t, 0)));
case REINTERPRET_CAST_EXPR:
return build_reinterpret_cast
(tsubst (TREE_TYPE (t), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl));
+ RECUR (TREE_OPERAND (t, 0)));
case CONST_CAST_EXPR:
return build_const_cast
(tsubst (TREE_TYPE (t), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl));
+ RECUR (TREE_OPERAND (t, 0)));
case DYNAMIC_CAST_EXPR:
return build_dynamic_cast
(tsubst (TREE_TYPE (t), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl));
+ RECUR (TREE_OPERAND (t, 0)));
case STATIC_CAST_EXPR:
return build_static_cast
(tsubst (TREE_TYPE (t), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl));
+ RECUR (TREE_OPERAND (t, 0)));
case POSTDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
- op1 = TREE_OPERAND (t, 0);
- if (TREE_CODE (op1) == SCOPE_REF)
- op1 = tsubst_qualified_id (TREE_OPERAND (t, 0),
- args, complain,
- in_decl,
- /*done=*/false,
- /*address_p=*/false);
- else
- op1 = tsubst_copy_and_build (op1, args, complain, in_decl);
+ op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
+ args, complain, in_decl);
return build_x_unary_op (TREE_CODE (t), op1);
case PREDECREMENT_EXPR:
@@ -8005,10 +7984,7 @@ tsubst_copy_and_build (tree t,
case CONVERT_EXPR: /* Unary + */
case REALPART_EXPR:
case IMAGPART_EXPR:
- return (build_x_unary_op
- (TREE_CODE (t),
- tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain,
- in_decl)));
+ return build_x_unary_op (TREE_CODE (t), RECUR (TREE_OPERAND (t, 0)));
case ADDR_EXPR:
op1 = TREE_OPERAND (t, 0);
@@ -8016,7 +7992,10 @@ tsubst_copy_and_build (tree t,
op1 = tsubst_qualified_id (op1, args, complain, in_decl,
/*done=*/true, /*address_p=*/true);
else
- op1 = tsubst_copy_and_build (op1, args, complain, in_decl);
+ op1 = tsubst_non_call_postfix_expression (op1, args, complain,
+ in_decl);
+ if (TREE_CODE (op1) == LABEL_DECL)
+ return finish_label_address_expr (DECL_NAME (op1));
return build_x_unary_op (ADDR_EXPR, op1);
case PLUS_EXPR:
@@ -8028,7 +8007,6 @@ tsubst_copy_and_build (tree t,
case ROUND_DIV_EXPR:
case EXACT_DIV_EXPR:
case BIT_AND_EXPR:
- case BIT_ANDTC_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case TRUNC_MOD_EXPR:
@@ -8050,15 +8028,11 @@ tsubst_copy_and_build (tree t,
case LT_EXPR:
case GT_EXPR:
case MEMBER_REF:
+ case DOTSTAR_EXPR:
return build_x_binary_op
(TREE_CODE (t),
- tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain, in_decl));
-
- case DOTSTAR_EXPR:
- return build_m_component_ref
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain, in_decl));
+ RECUR (TREE_OPERAND (t, 0)),
+ RECUR (TREE_OPERAND (t, 1)));
case SCOPE_REF:
return tsubst_qualified_id (t, args, complain, in_decl, /*done=*/true,
@@ -8068,24 +8042,14 @@ tsubst_copy_and_build (tree t,
if (tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl)
== NULL_TREE)
/* new-type-id */
- return build_nt
- (ARRAY_REF, NULL_TREE,
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain,
- in_decl));
+ return build_nt (ARRAY_REF, NULL_TREE, RECUR (TREE_OPERAND (t, 1)));
- op1 = TREE_OPERAND (t, 0);
- if (TREE_CODE (op1) == SCOPE_REF)
- op1 = tsubst_qualified_id (op1, args, complain, in_decl,
- /*done=*/false, /*address_p=*/false);
- else
- op1 = tsubst_copy_and_build (op1, args, complain, in_decl);
+ op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
+ args, complain, in_decl);
/* Remember that there was a reference to this entity. */
if (DECL_P (op1))
mark_used (op1);
- return grok_array_decl (op1,
- tsubst_copy_and_build (TREE_OPERAND (t, 1),
- args, complain,
- in_decl));
+ return grok_array_decl (op1, RECUR (TREE_OPERAND (t, 1)));
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
@@ -8101,27 +8065,23 @@ tsubst_copy_and_build (tree t,
else
{
++skip_evaluation;
- op1 = tsubst_copy_and_build (op1, args, complain, in_decl);
+ op1 = RECUR (op1);
--skip_evaluation;
}
- if (TREE_CODE (t) == SIZEOF_EXPR)
- return finish_sizeof (op1);
+ if (TYPE_P (op1))
+ return cxx_sizeof_or_alignof_type (op1, TREE_CODE (t), true);
else
- return finish_alignof (op1);
+ return cxx_sizeof_or_alignof_expr (op1, TREE_CODE (t));
case MODOP_EXPR:
return build_x_modify_expr
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
+ (RECUR (TREE_OPERAND (t, 0)),
TREE_CODE (TREE_OPERAND (t, 1)),
- tsubst_copy_and_build (TREE_OPERAND (t, 2), args, complain, in_decl));
+ RECUR (TREE_OPERAND (t, 2)));
case ARROW_EXPR:
- op1 = TREE_OPERAND (t, 0);
- if (TREE_CODE (op1) == SCOPE_REF)
- op1 = tsubst_qualified_id (op1, args, complain, in_decl,
- /*done=*/false, /*address_p=*/false);
- else
- op1 = tsubst_copy_and_build (op1, args, complain, in_decl);
+ op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
+ args, complain, in_decl);
/* Remember that there was a reference to this entity. */
if (DECL_P (op1))
mark_used (op1);
@@ -8129,38 +8089,33 @@ tsubst_copy_and_build (tree t,
case NEW_EXPR:
return build_new
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 2), args, complain, in_decl),
+ (RECUR (TREE_OPERAND (t, 0)),
+ RECUR (TREE_OPERAND (t, 1)),
+ RECUR (TREE_OPERAND (t, 2)),
NEW_EXPR_USE_GLOBAL (t));
case DELETE_EXPR:
return delete_sanity
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain, in_decl),
+ (RECUR (TREE_OPERAND (t, 0)),
+ RECUR (TREE_OPERAND (t, 1)),
DELETE_EXPR_USE_VEC (t),
DELETE_EXPR_USE_GLOBAL (t));
case COMPOUND_EXPR:
- return (build_x_compound_expr
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain,
- in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain,
- in_decl)));
+ return build_x_compound_expr (RECUR (TREE_OPERAND (t, 0)),
+ RECUR (TREE_OPERAND (t, 1)));
case CALL_EXPR:
{
tree function;
tree call_args;
- tree koenig_name;
bool qualified_p;
+ bool koenig_p;
function = TREE_OPERAND (t, 0);
- if (TREE_CODE (function) == LOOKUP_EXPR
- && !LOOKUP_EXPR_GLOBAL (function))
- koenig_name = TREE_OPERAND (function, 0);
- else
- koenig_name = NULL_TREE;
+ /* When we parsed the expression, we determined whether or
+ not Koenig lookup should be performed. */
+ koenig_p = KOENIG_LOOKUP_P (t);
if (TREE_CODE (function) == SCOPE_REF)
{
qualified_p = true;
@@ -8174,24 +8129,31 @@ tsubst_copy_and_build (tree t,
&& (TREE_CODE (TREE_OPERAND (function, 1))
== SCOPE_REF));
function = tsubst_copy_and_build (function, args, complain,
- in_decl);
- function = convert_from_reference (function);
+ in_decl,
+ !qualified_p);
+ if (BASELINK_P (function))
+ qualified_p = true;
+ }
+
+ call_args = RECUR (TREE_OPERAND (t, 1));
+
+ if (koenig_p
+ && (is_overloaded_fn (function)
+ || DECL_P (function)
+ || TREE_CODE (function) == IDENTIFIER_NODE))
+ function = perform_koenig_lookup (function, call_args);
+
+ if (TREE_CODE (function) == IDENTIFIER_NODE)
+ {
+ unqualified_name_lookup_error (function);
+ return error_mark_node;
}
/* Remember that there was a reference to this entity. */
if (DECL_P (function))
mark_used (function);
- call_args = tsubst_copy_and_build (TREE_OPERAND (t, 1), args,
- complain, in_decl);
-
- if (BASELINK_P (function))
- qualified_p = 1;
-
- if (call_args != NULL_TREE && koenig_name)
- function = lookup_arg_dependent (koenig_name,
- function,
- call_args);
+ function = convert_from_reference (function);
if (TREE_CODE (function) == OFFSET_REF)
return build_offset_ref_call_from_tree (function, call_args);
@@ -8202,20 +8164,21 @@ tsubst_copy_and_build (tree t,
call_args, NULL_TREE,
qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL));
return finish_call_expr (function, call_args,
- /*disallow_virtual=*/qualified_p);
+ /*disallow_virtual=*/qualified_p,
+ koenig_p);
}
case COND_EXPR:
return build_x_conditional_expr
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 2), args, complain, in_decl));
+ (RECUR (TREE_OPERAND (t, 0)),
+ RECUR (TREE_OPERAND (t, 1)),
+ RECUR (TREE_OPERAND (t, 2)));
case PSEUDO_DTOR_EXPR:
return finish_pseudo_destructor_expr
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 1), args, complain, in_decl),
- tsubst_copy_and_build (TREE_OPERAND (t, 2), args, complain, in_decl));
+ (RECUR (TREE_OPERAND (t, 0)),
+ RECUR (TREE_OPERAND (t, 1)),
+ RECUR (TREE_OPERAND (t, 2)));
case TREE_LIST:
{
@@ -8226,13 +8189,13 @@ tsubst_copy_and_build (tree t,
purpose = TREE_PURPOSE (t);
if (purpose)
- purpose = tsubst_copy_and_build (purpose, args, complain, in_decl);
+ purpose = RECUR (purpose);
value = TREE_VALUE (t);
if (value)
- value = tsubst_copy_and_build (value, args, complain, in_decl);
+ value = RECUR (value);
chain = TREE_CHAIN (t);
if (chain && chain != void_type_node)
- chain = tsubst_copy_and_build (chain, args, complain, in_decl);
+ chain = RECUR (chain);
if (purpose == TREE_PURPOSE (t)
&& value == TREE_VALUE (t)
&& chain == TREE_CHAIN (t))
@@ -8245,13 +8208,8 @@ tsubst_copy_and_build (tree t,
tree object;
tree member;
- object = TREE_OPERAND (t, 0);
- if (TREE_CODE (object) == SCOPE_REF)
- object = tsubst_qualified_id (object, args, complain, in_decl,
- /*done=*/false, /*address_p=*/false);
- else
- object = tsubst_copy_and_build (object, args, complain, in_decl);
-
+ object = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
+ args, complain, in_decl);
/* Remember that there was a reference to this entity. */
if (DECL_P (object))
mark_used (object);
@@ -8286,27 +8244,28 @@ tsubst_copy_and_build (tree t,
scope is. */
tmpl = TREE_OPERAND (TREE_OPERAND (member, 1), 0);
args = TREE_OPERAND (TREE_OPERAND (member, 1), 1);
- member = lookup_qualified_name (TREE_OPERAND (member, 0),
- tmpl,
- /*is_type=*/0);
+ member = lookup_qualified_name (TREE_OPERAND (member, 0), tmpl,
+ /*is_type_p=*/false,
+ /*complain=*/false);
if (BASELINK_P (member))
BASELINK_FUNCTIONS (member)
= build_nt (TEMPLATE_ID_EXPR, BASELINK_FUNCTIONS (member),
args);
else
{
- error ("`%D' is not a member of `%T'",
- tmpl, TREE_TYPE (object));
+ qualified_name_lookup_error (TREE_TYPE (object), tmpl);
return error_mark_node;
}
}
+ else if (TREE_CODE (member) == FIELD_DECL)
+ return finish_non_static_data_member (member, object, NULL_TREE);
return finish_class_member_access_expr (object, member);
}
case THROW_EXPR:
return build_throw
- (tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain, in_decl));
+ (RECUR (TREE_OPERAND (t, 0)));
case CONSTRUCTOR:
{
@@ -8332,9 +8291,8 @@ tsubst_copy_and_build (tree t,
tree value = TREE_VALUE (elts);
if (purpose && purpose_p)
- purpose
- = tsubst_copy_and_build (purpose, args, complain, in_decl);
- value = tsubst_copy_and_build (value, args, complain, in_decl);
+ purpose = RECUR (purpose);
+ value = RECUR (value);
r = tree_cons (purpose, value, r);
}
@@ -8348,10 +8306,7 @@ tsubst_copy_and_build (tree t,
case TYPEID_EXPR:
{
- tree operand_0
- = tsubst_copy_and_build (TREE_OPERAND (t, 0), args, complain,
- in_decl);
-
+ tree operand_0 = RECUR (TREE_OPERAND (t, 0));
if (TYPE_P (operand_0))
return get_typeid (operand_0);
return build_typeid (operand_0);
@@ -8371,14 +8326,15 @@ tsubst_copy_and_build (tree t,
return convert_from_reference (t);
case VA_ARG_EXPR:
- return build_x_va_arg
- (tsubst_copy_and_build
- (TREE_OPERAND (t, 0), args, complain, in_decl),
- tsubst_copy (TREE_TYPE (t), args, complain, in_decl));
+ return build_x_va_arg (RECUR (TREE_OPERAND (t, 0)),
+ tsubst_copy (TREE_TYPE (t), args, complain,
+ in_decl));
default:
return tsubst_copy (t, args, complain, in_decl);
}
+
+#undef RECUR
}
/* Verify that the instantiated ARGS are valid. For type arguments,
@@ -8497,18 +8453,23 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
complain))
return error_mark_node;
- /* Make sure that we can see identifiers, and compute access
- correctly. The desired FUNCTION_DECL for FNDECL may or may not be
- created earlier. Let push_access_scope_real figure that out. */
- push_access_scope_real
- (gen_tmpl, targ_ptr, tsubst (DECL_CONTEXT (gen_tmpl), targ_ptr,
- complain, gen_tmpl));
+ /* We are building a FUNCTION_DECL, during which the access of its
+ parameters and return types have to be checked. However this
+ FUNCTION_DECL which is the desired context for access checking
+ is not built yet. We solve this chicken-and-egg problem by
+ deferring all checks until we have the FUNCTION_DECL. */
+ push_deferring_access_checks (dk_deferred);
/* substitute template parameters */
fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl),
targ_ptr, complain, gen_tmpl);
- pop_access_scope (gen_tmpl);
+ /* Now we know the specialization, compute access previously
+ deferred. */
+ push_access_scope (fndecl);
+ perform_deferred_access_checks ();
+ pop_access_scope (fndecl);
+ pop_deferring_access_checks ();
/* The DECL_TI_TEMPLATE should always be the immediate parent
template, not the most general template. */
@@ -8605,6 +8566,7 @@ fn_type_unification (tree fn,
template results in an invalid type, type deduction fails. */
int i;
tree converted_args;
+ bool incomplete;
converted_args
= (coerce_template_parms (DECL_INNERMOST_TEMPLATE_PARMS (fn),
@@ -8613,12 +8575,22 @@ fn_type_unification (tree fn,
if (converted_args == error_mark_node)
return 1;
+ /* Substitute the explicit args into the function type. This is
+ necessary so that, for instance, explicitly declared function
+ arguments can match null pointed constants. If we were given
+ an incomplete set of explicit args, we must not do semantic
+ processing during substitution as we could create partial
+ instantiations. */
+ incomplete = NUM_TMPL_ARGS (explicit_targs) != NUM_TMPL_ARGS (targs);
+ processing_template_decl += incomplete;
fntype = tsubst (fntype, converted_args, tf_none, NULL_TREE);
+ processing_template_decl -= incomplete;
+
if (fntype == error_mark_node)
return 1;
/* Place the explicitly specified arguments in TARGS. */
- for (i = 0; i < TREE_VEC_LENGTH (targs); i++)
+ for (i = NUM_TMPL_ARGS (converted_args); i--;)
TREE_VEC_ELT (targs, i) = TREE_VEC_ELT (converted_args, i);
}
@@ -8795,9 +8767,7 @@ type_unification_real (tree tparms,
my_friendly_assert (TREE_CODE (tparms) == TREE_VEC, 289);
my_friendly_assert (xparms == NULL_TREE
|| TREE_CODE (xparms) == TREE_LIST, 290);
- /* ARGS could be NULL. */
- if (xargs)
- my_friendly_assert (TREE_CODE (xargs) == TREE_LIST, 291);
+ my_friendly_assert (!xargs || TREE_CODE (xargs) == TREE_LIST, 291);
my_friendly_assert (ntparms > 0, 292);
switch (strict)
@@ -8962,9 +8932,15 @@ resolve_overloaded_unification (tree tparms,
{
tree tempargs = copy_node (targs);
int good = 0;
+ bool addr_p;
if (TREE_CODE (arg) == ADDR_EXPR)
- arg = TREE_OPERAND (arg, 0);
+ {
+ arg = TREE_OPERAND (arg, 0);
+ addr_p = true;
+ }
+ else
+ addr_p = false;
if (TREE_CODE (arg) == COMPONENT_REF)
/* Handle `&x' where `x' is some static or non-static member
@@ -9000,10 +8976,8 @@ resolve_overloaded_unification (tree tparms,
if (subargs)
{
elem = tsubst (TREE_TYPE (fn), subargs, tf_none, NULL_TREE);
- if (TREE_CODE (elem) == METHOD_TYPE)
- elem = build_ptrmemfunc_type (build_pointer_type (elem));
- good += try_one_overload (tparms, targs, tempargs, parm, elem,
- strict, sub_strict);
+ good += try_one_overload (tparms, targs, tempargs, parm,
+ elem, strict, sub_strict, addr_p);
}
}
}
@@ -9011,14 +8985,9 @@ resolve_overloaded_unification (tree tparms,
|| TREE_CODE (arg) == FUNCTION_DECL)
{
for (; arg; arg = OVL_NEXT (arg))
- {
- tree type = TREE_TYPE (OVL_CURRENT (arg));
- if (TREE_CODE (type) == METHOD_TYPE)
- type = build_ptrmemfunc_type (build_pointer_type (type));
- good += try_one_overload (tparms, targs, tempargs, parm,
- type,
- strict, sub_strict);
- }
+ good += try_one_overload (tparms, targs, tempargs, parm,
+ TREE_TYPE (OVL_CURRENT (arg)),
+ strict, sub_strict, addr_p);
}
else
abort ();
@@ -9047,6 +9016,9 @@ resolve_overloaded_unification (tree tparms,
/* Subroutine of resolve_overloaded_unification; does deduction for a single
overload. Fills TARGS with any deduced arguments, or error_mark_node if
different overloads deduce different arguments for a given parm.
+ ADDR_P is true if the expression for which deduction is being
+ performed was of the form "& fn" rather than simply "fn".
+
Returns 1 on success. */
static int
@@ -9056,7 +9028,8 @@ try_one_overload (tree tparms,
tree parm,
tree arg,
unification_kind_t strict,
- int sub_strict)
+ int sub_strict,
+ bool addr_p)
{
int nargs;
tree tempargs;
@@ -9072,6 +9045,11 @@ try_one_overload (tree tparms,
if (uses_template_parms (arg))
return 1;
+ if (TREE_CODE (arg) == METHOD_TYPE)
+ arg = build_ptrmemfunc_type (build_pointer_type (arg));
+ else if (addr_p)
+ arg = build_pointer_type (arg);
+
sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg);
/* We don't copy orig_targs for this because if we have already deduced
@@ -9535,12 +9513,6 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
}
else
{
- /* If ARG is an offset type, we're trying to unify '*T' with
- 'U C::*', which is ill-formed. See the comment in the
- POINTER_TYPE case about this ugliness. */
- if (TREE_CODE (arg) == OFFSET_TYPE)
- return 1;
-
/* If PARM is `const T' and ARG is only `int', we don't have
a match unless we are allowing additional qualification.
If ARG is `const int' and PARM is just `T' that's OK;
@@ -9641,18 +9613,6 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
level of pointers. */
strict |= (strict_in & UNIFY_ALLOW_DERIVED);
- if (TREE_CODE (TREE_TYPE (parm)) == OFFSET_TYPE
- && TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE)
- {
- /* Avoid getting confused about cv-quals; don't recurse here.
- Pointers to members should really be just OFFSET_TYPE, not
- this two-level nonsense... */
-
- parm = TREE_TYPE (parm);
- arg = TREE_TYPE (arg);
- goto offset;
- }
-
return unify (tparms, targs, TREE_TYPE (parm),
TREE_TYPE (arg), strict);
}
@@ -9806,7 +9766,6 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
DEDUCE_EXACT, 0, -1);
case OFFSET_TYPE:
- offset:
if (TREE_CODE (arg) != OFFSET_TYPE)
return 1;
if (unify (tparms, targs, TYPE_OFFSET_BASETYPE (parm),
@@ -9946,6 +9905,10 @@ more_specialized (tree pat1, tree pat2, int deduce, int len)
tree targs;
int winner = 0;
+ /* If template argument deduction succeeds, we substitute the
+ resulting arguments into non-deduced contexts. While doing that,
+ we must be aware that we may encounter dependent types. */
+ ++processing_template_decl;
targs = get_bindings_real (pat1, DECL_TEMPLATE_RESULT (pat2),
NULL_TREE, 0, deduce, len);
if (targs)
@@ -9955,6 +9918,7 @@ more_specialized (tree pat1, tree pat2, int deduce, int len)
NULL_TREE, 0, deduce, len);
if (targs)
++winner;
+ --processing_template_decl;
return winner;
}
@@ -9963,21 +9927,24 @@ more_specialized (tree pat1, tree pat2, int deduce, int len)
1 if PAT1 is more specialized than PAT2 as described in [temp.class.order].
-1 if PAT2 is more specialized than PAT1.
- 0 if neither is more specialized. */
+ 0 if neither is more specialized.
+
+ FULL_ARGS is the full set of template arguments that triggers this
+ partial ordering. */
int
-more_specialized_class (tree pat1, tree pat2)
+more_specialized_class (tree pat1, tree pat2, tree full_args)
{
tree targs;
int winner = 0;
targs = get_class_bindings (TREE_VALUE (pat1), TREE_PURPOSE (pat1),
- TREE_PURPOSE (pat2));
+ add_outermost_template_args (full_args, TREE_PURPOSE (pat2)));
if (targs)
--winner;
targs = get_class_bindings (TREE_VALUE (pat2), TREE_PURPOSE (pat2),
- TREE_PURPOSE (pat1));
+ add_outermost_template_args (full_args, TREE_PURPOSE (pat1)));
if (targs)
++winner;
@@ -10050,7 +10017,7 @@ get_bindings_real (tree fn,
/* For most uses, we want to check the return type. */
-tree
+static tree
get_bindings (tree fn, tree decl, tree explicit_args)
{
return get_bindings_real (fn, decl, explicit_args, 1, DEDUCE_EXACT, -1);
@@ -10205,8 +10172,8 @@ most_general_template (tree decl)
/* Look for more and more general templates. */
while (DECL_TEMPLATE_INFO (decl))
{
- /* The DECL_TI_TEMPLATE can be a LOOKUP_EXPR or IDENTIFIER_NODE
- in some cases. (See cp-tree.h for details.) */
+ /* The DECL_TI_TEMPLATE can be an IDENTIFIER_NODE in some cases.
+ (See cp-tree.h for details.) */
if (TREE_CODE (DECL_TI_TEMPLATE (decl)) != TEMPLATE_DECL)
break;
@@ -10258,7 +10225,7 @@ most_specialized_class (tree tmpl, tree args)
t = TREE_CHAIN (t);
for (; t; t = TREE_CHAIN (t))
{
- fate = more_specialized_class (champ, t);
+ fate = more_specialized_class (champ, t, args);
if (fate == 1)
;
else
@@ -10275,7 +10242,7 @@ most_specialized_class (tree tmpl, tree args)
for (t = list; t && t != champ; t = TREE_CHAIN (t))
{
- fate = more_specialized_class (champ, t);
+ fate = more_specialized_class (champ, t, args);
if (fate != 1)
return error_mark_node;
}
@@ -10595,7 +10562,7 @@ regenerate_decl_from_template (tree decl, tree tmpl)
tree args;
tree code_pattern;
tree new_decl;
- int unregistered;
+ bool unregistered;
args = DECL_TI_ARGS (decl);
code_pattern = DECL_TEMPLATE_RESULT (tmpl);
@@ -10606,14 +10573,18 @@ regenerate_decl_from_template (tree decl, tree tmpl)
instantiation of a specialization, which it isn't: it's a full
instantiation. */
gen_tmpl = most_general_template (tmpl);
- push_access_scope_real (gen_tmpl, args, DECL_CONTEXT (decl));
- unregistered = unregister_specialization (decl, gen_tmpl);
+ unregistered = reregister_specialization (decl, gen_tmpl,
+ /*new_spec=*/NULL_TREE);
/* If the DECL was not unregistered then something peculiar is
happening: we created a specialization but did not call
register_specialization for it. */
my_friendly_assert (unregistered, 0);
+ /* Make sure that we can see identifiers, and compute access
+ correctly. */
+ push_access_scope (decl);
+
/* Do the substitution to get the new declaration. */
new_decl = tsubst (code_pattern, args, tf_error, NULL_TREE);
@@ -10775,10 +10746,14 @@ instantiate_decl (tree d, int defer_ok)
timevar_push (TV_PARSE);
- /* We may be in the middle of deferred access check. Disable
- it now. */
+ /* We may be in the middle of deferred access check. Disable it now. */
push_deferring_access_checks (dk_no_deferred);
+ /* Our caller does not expect collection to happen, which it might if
+ we decide to compile the function to rtl now. Arrange for a new
+ gc context to be created if so. */
+ function_depth++;
+
/* Set TD to the template whose DECL_TEMPLATE_RESULT is the pattern
for the instantiation. */
td = template_for_substitution (d);
@@ -11023,6 +10998,7 @@ out:
input_location = saved_loc;
pop_deferring_access_checks ();
pop_tinst_level ();
+ function_depth--;
timevar_pop (TV_PARSE);
@@ -11185,18 +11161,20 @@ tsubst_enum (tree tag, tree newtag, tree args)
for (e = TYPE_VALUES (tag); e; e = TREE_CHAIN (e))
{
tree value;
-
+ tree decl;
+
+ decl = TREE_VALUE (e);
/* Note that in a template enum, the TREE_VALUE is the
CONST_DECL, not the corresponding INTEGER_CST. */
- value = tsubst_expr (DECL_INITIAL (TREE_VALUE (e)),
+ value = tsubst_expr (DECL_INITIAL (decl),
args, tf_error | tf_warning,
NULL_TREE);
/* Give this enumeration constant the correct access. */
- set_current_access_from_decl (TREE_VALUE (e));
+ set_current_access_from_decl (decl);
/* Actually build the enumerator itself. */
- build_enumerator (TREE_PURPOSE (e), value, newtag);
+ build_enumerator (DECL_NAME (decl), value, newtag);
}
finish_enum (newtag);
@@ -11303,9 +11281,7 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return 0;
else if (POINTER_TYPE_P (type))
return 0;
- else if (TYPE_PTRMEM_P (type))
- return 0;
- else if (TYPE_PTRMEMFUNC_P (type))
+ else if (TYPE_PTR_TO_MEMBER_P (type))
return 0;
else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
return 0;
@@ -11342,7 +11318,7 @@ dependent_type_p_r (tree type)
dependent. */
type = TYPE_MAIN_VARIANT (type);
/* -- a compound type constructed from any dependent type. */
- if (TYPE_PTRMEM_P (type) || TYPE_PTRMEMFUNC_P (type))
+ if (TYPE_PTR_TO_MEMBER_P (type))
return (dependent_type_p (TYPE_PTRMEM_CLASS_TYPE (type))
|| dependent_type_p (TYPE_PTRMEM_POINTED_TO_TYPE
(type)));
@@ -11376,25 +11352,24 @@ dependent_type_p_r (tree type)
return true;
return dependent_type_p (TREE_TYPE (type));
}
+
/* -- a template-id in which either the template name is a template
- parameter or any of the template arguments is a dependent type or
- an expression that is type-dependent or value-dependent.
-
- This language seems somewhat confused; for example, it does not
- discuss template template arguments. Therefore, we use the
- definition for dependent template arguments in [temp.dep.temp]. */
- if (CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_INFO (type)
- && (dependent_template_id_p
- (CLASSTYPE_TI_TEMPLATE (type),
- CLASSTYPE_TI_ARGS (type))))
+ parameter ... */
+ if (TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
return true;
- else if (TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ /* ... or any of the template arguments is a dependent type or
+ an expression that is type-dependent or value-dependent. */
+ else if (CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_INFO (type)
+ && (any_dependent_template_arguments_p
+ (INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type)))))
return true;
+
/* All TYPEOF_TYPEs are dependent; if the argument of the `typeof'
expression is not type-dependent, then it should already been
have resolved. */
if (TREE_CODE (type) == TYPEOF_TYPE)
return true;
+
/* The standard does not specifically mention types that are local
to template functions or local classes, but they should be
considered dependent too. For example:
@@ -11447,6 +11422,40 @@ dependent_type_p (tree type)
return TYPE_DEPENDENT_P (type);
}
+/* Returns TRUE if EXPRESSION is dependent, according to CRITERION. */
+
+static bool
+dependent_scope_ref_p (tree expression, bool criterion (tree))
+{
+ tree scope;
+ tree name;
+
+ my_friendly_assert (TREE_CODE (expression) == SCOPE_REF, 20030714);
+
+ if (!TYPE_P (TREE_OPERAND (expression, 0)))
+ return true;
+
+ scope = TREE_OPERAND (expression, 0);
+ name = TREE_OPERAND (expression, 1);
+
+ /* [temp.dep.expr]
+
+ An id-expression is type-dependent if it contains a
+ nested-name-specifier that contains a class-name that names a
+ dependent type. */
+ /* The suggested resolution to Core Issue 2 implies that if the
+ qualifying type is the current class, then we must peek
+ inside it. */
+ if (DECL_P (name)
+ && currently_open_class (scope)
+ && !criterion (name))
+ return false;
+ if (dependent_type_p (scope))
+ return true;
+
+ return false;
+}
+
/* Returns TRUE if the EXPRESSION is value-dependent, in the sense of
[temp.dep.constexpr] */
@@ -11457,7 +11466,7 @@ value_dependent_expression_p (tree expression)
return false;
/* A name declared with a dependent type. */
- if (TREE_CODE (expression) == LOOKUP_EXPR
+ if (TREE_CODE (expression) == IDENTIFIER_NODE
|| (DECL_P (expression)
&& type_dependent_expression_p (expression)))
return true;
@@ -11510,6 +11519,8 @@ value_dependent_expression_p (tree expression)
return dependent_type_p (expression);
return type_dependent_expression_p (expression);
}
+ if (TREE_CODE (expression) == SCOPE_REF)
+ return dependent_scope_ref_p (expression, value_dependent_expression_p);
/* A constant expression is value-dependent if any subexpression is
value-dependent. */
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (expression))))
@@ -11555,6 +11566,13 @@ type_dependent_expression_p (tree expression)
if (!processing_template_decl)
return false;
+ if (expression == error_mark_node)
+ return false;
+
+ /* An unresolved name is always dependent. */
+ if (TREE_CODE (expression) == IDENTIFIER_NODE)
+ return true;
+
/* Some expression forms are never type-dependent. */
if (TREE_CODE (expression) == PSEUDO_DTOR_EXPR
|| TREE_CODE (expression) == SIZEOF_EXPR
@@ -11593,24 +11611,37 @@ type_dependent_expression_p (tree expression)
return dependent_type_p (type);
}
+ if (TREE_CODE (expression) == SCOPE_REF
+ && dependent_scope_ref_p (expression,
+ type_dependent_expression_p))
+ return true;
+
if (TREE_CODE (expression) == FUNCTION_DECL
&& DECL_LANG_SPECIFIC (expression)
&& DECL_TEMPLATE_INFO (expression)
- && (dependent_template_id_p
- (DECL_TI_TEMPLATE (expression),
- INNERMOST_TEMPLATE_ARGS (DECL_TI_ARGS (expression)))))
+ && (any_dependent_template_arguments_p
+ (INNERMOST_TEMPLATE_ARGS (DECL_TI_ARGS (expression)))))
return true;
if (TREE_TYPE (expression) == unknown_type_node)
{
if (TREE_CODE (expression) == ADDR_EXPR)
return type_dependent_expression_p (TREE_OPERAND (expression, 0));
+ if (TREE_CODE (expression) == COMPONENT_REF)
+ {
+ if (type_dependent_expression_p (TREE_OPERAND (expression, 0)))
+ return true;
+ expression = TREE_OPERAND (expression, 1);
+ if (TREE_CODE (expression) == IDENTIFIER_NODE)
+ return false;
+ }
+
if (TREE_CODE (expression) == BASELINK)
expression = BASELINK_FUNCTIONS (expression);
if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
{
- if (any_dependent_template_arguments_p (TREE_OPERAND (expression,
- 1)))
+ if (any_dependent_template_arguments_p
+ (TREE_OPERAND (expression, 1)))
return true;
expression = TREE_OPERAND (expression, 0);
}
@@ -11638,7 +11669,9 @@ any_type_dependent_arguments_p (tree args)
{
while (args)
{
- if (type_dependent_expression_p (TREE_VALUE (args)))
+ tree arg = TREE_VALUE (args);
+
+ if (type_dependent_expression_p (arg))
return true;
args = TREE_CHAIN (args);
}
@@ -11669,29 +11702,14 @@ dependent_template_arg_p (tree arg)
bool
any_dependent_template_arguments_p (tree args)
{
+ int i;
+
if (!args)
return false;
- my_friendly_assert (TREE_CODE (args) == TREE_LIST
- || TREE_CODE (args) == TREE_VEC,
- 20030707);
-
- if (TREE_CODE (args) == TREE_LIST)
- {
- while (args)
- {
- if (dependent_template_arg_p (TREE_VALUE (args)))
- return true;
- args = TREE_CHAIN (args);
- }
- }
- else
- {
- int i;
- for (i = 0; i < TREE_VEC_LENGTH (args); ++i)
- if (dependent_template_arg_p (TREE_VEC_ELT (args, i)))
- return true;
- }
+ for (i = 0; i < TREE_VEC_LENGTH (args); ++i)
+ if (dependent_template_arg_p (TREE_VEC_ELT (args, i)))
+ return true;
return false;
}
@@ -11787,8 +11805,7 @@ resolve_typename_type (tree type, bool only_current_p)
args = TREE_OPERAND (TYPENAME_TYPE_FULLNAME (type), 1);
/* Instantiate the template. */
type = lookup_template_class (tmpl, args, NULL_TREE, NULL_TREE,
- /*entering_scope=*/0,
- tf_error);
+ /*entering_scope=*/0, tf_error | tf_user);
}
else
type = error_mark_node;
@@ -11816,6 +11833,25 @@ build_non_dependent_expr (tree expr)
types. */
if (TREE_CODE (expr) == OVERLOAD)
return expr;
+ /* Preserve string constants; conversions from string constants to
+ "char *" are allowed, even though normally a "const char *"
+ cannot be used to initialize a "char *". */
+ if (TREE_CODE (expr) == STRING_CST)
+ return expr;
+
+ if (TREE_CODE (expr) == COND_EXPR)
+ return build (COND_EXPR,
+ TREE_TYPE (expr),
+ TREE_OPERAND (expr, 0),
+ build_non_dependent_expr (TREE_OPERAND (expr, 1)),
+ build_non_dependent_expr (TREE_OPERAND (expr, 2)));
+ if (TREE_CODE (expr) == COMPOUND_EXPR
+ && !COMPOUND_EXPR_OVERLOADED (expr))
+ return build (COMPOUND_EXPR,
+ TREE_TYPE (expr),
+ TREE_OPERAND (expr, 0),
+ build_non_dependent_expr (TREE_OPERAND (expr, 1)));
+
/* Otherwise, build a NON_DEPENDENT_EXPR.
REFERENCE_TYPEs are not stripped for expressions in templates
@@ -11830,7 +11866,7 @@ build_non_dependent_expr (tree expr)
the expression so that mangling (say) "f<g>" inside the body of
"f" works out correctly. Therefore, the REFERENCE_TYPE is
stripped here. */
- return build (NON_DEPENDENT_EXPR, non_reference (TREE_TYPE (expr)));
+ return build1 (NON_DEPENDENT_EXPR, non_reference (TREE_TYPE (expr)), expr);
}
/* ARGS is a TREE_LIST of expressions as arguments to a function call.
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index 356ed4530d7..6dbf0605a48 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -123,12 +123,6 @@ cxx_print_type (FILE *file, tree node, int indent)
fputs (" delete[]", file);
if (TYPE_HAS_ASSIGN_REF (node))
fputs (" this=(X&)", file);
- if (TYPE_OVERLOADS_CALL_EXPR (node))
- fputs (" op()", file);
- if (TYPE_OVERLOADS_ARRAY_REF (node))
- fputs (" op[]", file);
- if (TYPE_OVERLOADS_ARROW (node))
- fputs (" op->", file);
if (TYPE_USES_MULTIPLE_INHERITANCE (node))
fputs (" uses-multiple-inheritance", file);
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index b28fea6212a..c53238f5b52 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "assert.h"
#include "toplev.h"
+#include "convert.h"
/* C++ returns type information to the user in struct type_info
objects. We also use type information to implement dynamic_cast and
@@ -119,7 +120,7 @@ init_rtti_processing (void)
push_namespace (std_identifier);
type_info_type_node
= xref_tag (class_type, get_identifier ("type_info"),
- /*attributes=*/NULL_TREE, 1);
+ /*attributes=*/NULL_TREE, true, false);
pop_namespace ();
const_type_info_type = build_qualified_type (type_info_type_node,
TYPE_QUAL_CONST);
@@ -159,8 +160,8 @@ build_headof (tree exp)
type = build_qualified_type (ptr_type_node,
cp_type_quals (TREE_TYPE (exp)));
- return build (PLUS_EXPR, type, exp,
- cp_convert (ptrdiff_type_node, offset));
+ return build (PLUS_EXPR, type, exp,
+ convert_to_integer (ptrdiff_type_node, offset));
}
/* Get a bad_cast node for the program to throw...
@@ -331,8 +332,6 @@ get_tinfo_decl (tree type)
return error_mark_node;
}
- if (TREE_CODE (type) == OFFSET_TYPE)
- type = TREE_TYPE (type);
if (TREE_CODE (type) == METHOD_TYPE)
type = build_function_type (TREE_TYPE (type),
TREE_CHAIN (TYPE_ARG_TYPES (type)));
@@ -359,8 +358,9 @@ get_tinfo_decl (tree type)
TREE_READONLY (d) = 1;
TREE_STATIC (d) = 1;
DECL_EXTERNAL (d) = 1;
- SET_DECL_ASSEMBLER_NAME (d, name);
DECL_COMDAT (d) = 1;
+ TREE_PUBLIC (d) = 1;
+ SET_DECL_ASSEMBLER_NAME (d, name);
pushdecl_top_level_and_finish (d, NULL_TREE);
@@ -640,7 +640,7 @@ build_dynamic_cast_1 (tree type, tree expr)
tinfo_ptr = xref_tag (class_type,
get_identifier ("__class_type_info"),
/*attributes=*/NULL_TREE,
- 1);
+ true, false);
tinfo_ptr = build_pointer_type
(build_qualified_type
@@ -653,6 +653,7 @@ build_dynamic_cast_1 (tree type, tree expr)
(NULL_TREE, ptrdiff_type_node, void_list_node))));
tmp = build_function_type (ptr_type_node, tmp);
dcast_fn = build_library_fn_ptr (name, tmp);
+ DECL_IS_PURE (dcast_fn) = 1;
pop_nested_namespace (ns);
dynamic_cast_node = dcast_fn;
}
@@ -687,7 +688,12 @@ build_dynamic_cast (tree type, tree expr)
return error_mark_node;
if (processing_template_decl)
- return build_min (DYNAMIC_CAST_EXPR, type, expr);
+ {
+ expr = build_min (DYNAMIC_CAST_EXPR, type, expr);
+ TREE_SIDE_EFFECTS (expr) = 1;
+
+ return expr;
+ }
return convert_from_reference (build_dynamic_cast_1 (type, expr));
}
@@ -715,19 +721,17 @@ qualifier_flags (tree type)
static bool
target_incomplete_p (tree type)
{
- while (TREE_CODE (type) == POINTER_TYPE)
+ while (true)
if (TYPE_PTRMEM_P (type))
{
- if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
- return true;
- type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
+ if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
+ return true;
+ type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
}
- else
+ else if (TREE_CODE (type) == POINTER_TYPE)
type = TREE_TYPE (type);
- if (!COMPLETE_OR_VOID_TYPE_P (type))
- return true;
-
- return false;
+ else
+ return !COMPLETE_OR_VOID_TYPE_P (type);
}
/* Return a CONSTRUCTOR for the common part of the type_info objects. This
@@ -777,7 +781,7 @@ tinfo_base_init (tree desc, tree target)
push_nested_namespace (abi_node);
real_type = xref_tag (class_type, TINFO_REAL_NAME (desc),
- /*attributes=*/NULL_TREE, 1);
+ /*attributes=*/NULL_TREE, true, false);
pop_nested_namespace (abi_node);
if (!COMPLETE_TYPE_P (real_type))
@@ -999,12 +1003,10 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
my_friendly_assert (at_eof, 20021120);
switch (TREE_CODE (type))
{
+ case OFFSET_TYPE:
+ return ptm_initializer (var_desc, type, non_public_p);
case POINTER_TYPE:
- if (TYPE_PTRMEM_P (type))
- return ptm_initializer (var_desc, type, non_public_p);
- else
- return ptr_initializer (var_desc, type, non_public_p);
- break;
+ return ptr_initializer (var_desc, type, non_public_p);
case ENUMERAL_TYPE:
return generic_initializer (var_desc, type);
break;
@@ -1125,7 +1127,7 @@ create_pseudo_type_info (const char *real_name, int ident, ...)
va_start (ap, ident);
/* Generate the pseudo type name. */
- pseudo_name = (char *)alloca (strlen (real_name) + 30);
+ pseudo_name = alloca (strlen (real_name) + 30);
strcpy (pseudo_name, real_name);
strcat (pseudo_name, "_pseudo");
if (ident)
@@ -1164,8 +1166,10 @@ get_pseudo_ti_desc (tree type)
{
switch (TREE_CODE (type))
{
+ case OFFSET_TYPE:
+ return ptm_desc_type_node;
case POINTER_TYPE:
- return TYPE_PTRMEM_P (type) ? ptm_desc_type_node : ptr_desc_type_node;
+ return ptr_desc_type_node;
case ENUMERAL_TYPE:
return enum_desc_type_node;
case FUNCTION_TYPE:
@@ -1374,7 +1378,7 @@ emit_support_tinfos (void)
bltn_type = xref_tag (class_type,
get_identifier ("__fundamental_type_info"),
/*attributes=*/NULL_TREE,
- 1);
+ true, false);
pop_nested_namespace (abi_node);
if (!COMPLETE_TYPE_P (bltn_type))
return;
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 64e5707e1f0..3751c006d13 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -231,6 +231,28 @@ lookup_base_r (tree binfo, tree base, base_access access,
return found;
}
+/* Returns true if type BASE is accessible in T. (BASE is known to be
+ a base class of T.) */
+
+bool
+accessible_base_p (tree t, tree base)
+{
+ tree decl;
+
+ /* [class.access.base]
+
+ A base class is said to be accessible if an invented public
+ member of the base class is accessible. */
+ /* Rather than inventing a public member, we use the implicit
+ public typedef created in the scope of every class. */
+ decl = TYPE_FIELDS (base);
+ while (!DECL_SELF_REFERENCE_P (decl))
+ decl = TREE_CHAIN (decl);
+ while (ANON_AGGR_TYPE_P (t))
+ t = TYPE_CONTEXT (t);
+ return accessible_p (t, decl);
+}
+
/* Lookup BASE in the hierarchy dominated by T. Do access checking as
ACCESS specifies. Return the binfo we discover. If KIND_PTR is
non-NULL, fill with information about what kind of base we
@@ -287,41 +309,24 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
break;
default:
- if (access != ba_ignore
+ if ((access & ~ba_quiet) != ba_ignore
/* If BASE is incomplete, then BASE and TYPE are probably
the same, in which case BASE is accessible. If they
are not the same, then TYPE is invalid. In that case,
there's no need to issue another error here, and
there's no implicit typedef to use in the code that
follows, so we skip the check. */
- && COMPLETE_TYPE_P (base))
+ && COMPLETE_TYPE_P (base)
+ && !accessible_base_p (t, base))
{
- tree decl;
-
- /* [class.access.base]
-
- A base class is said to be accessible if an invented public
- member of the base class is accessible. */
- /* Rather than inventing a public member, we use the implicit
- public typedef created in the scope of every class. */
- decl = TYPE_FIELDS (base);
- while (TREE_CODE (decl) != TYPE_DECL
- || !DECL_ARTIFICIAL (decl)
- || DECL_NAME (decl) != constructor_name (base))
- decl = TREE_CHAIN (decl);
- while (ANON_AGGR_TYPE_P (t))
- t = TYPE_CONTEXT (t);
- if (!accessible_p (t, decl))
+ if (!(access & ba_quiet))
{
- if (!(access & ba_quiet))
- {
- error ("`%T' is an inaccessible base of `%T'", base, t);
- binfo = error_mark_node;
- }
- else
- binfo = NULL_TREE;
- bk = bk_inaccessible;
+ error ("`%T' is an inaccessible base of `%T'", base, t);
+ binfo = error_mark_node;
}
+ else
+ binfo = NULL_TREE;
+ bk = bk_inaccessible;
}
break;
}
@@ -434,8 +439,8 @@ lookup_field_1 (tree type, tree name, bool want_type)
&& DECL_LANG_SPECIFIC (TYPE_NAME (type))
&& DECL_SORTED_FIELDS (TYPE_NAME (type)))
{
- tree *fields = &TREE_VEC_ELT (DECL_SORTED_FIELDS (TYPE_NAME (type)), 0);
- int lo = 0, hi = TREE_VEC_LENGTH (DECL_SORTED_FIELDS (TYPE_NAME (type)));
+ tree *fields = &DECL_SORTED_FIELDS (TYPE_NAME (type))->elts[0];
+ int lo = 0, hi = DECL_SORTED_FIELDS (TYPE_NAME (type))->len;
int i;
while (lo < hi)
@@ -620,7 +625,7 @@ dfs_access_in_type (tree binfo, void *data)
if (context_for_name_lookup (decl) == type)
{
- /* If we have desceneded to the scope of DECL, just note the
+ /* If we have descended to the scope of DECL, just note the
appropriate access. */
if (TREE_PRIVATE (decl))
access = ak_private;
@@ -734,7 +739,7 @@ access_in_type (tree type, tree decl)
return BINFO_ACCESS (binfo);
}
-/* Called from dfs_accessible_p via dfs_walk. */
+/* Called from accessible_p via dfs_walk. */
static tree
dfs_accessible_queue_p (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
@@ -753,20 +758,17 @@ dfs_accessible_queue_p (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
return binfo;
}
-/* Called from dfs_accessible_p via dfs_walk. */
+/* Called from accessible_p via dfs_walk. */
static tree
-dfs_accessible_p (tree binfo, void *data)
+dfs_accessible_p (tree binfo, void *data ATTRIBUTE_UNUSED)
{
- int protected_ok = data != 0;
access_kind access;
BINFO_MARKED (binfo) = 1;
access = BINFO_ACCESS (binfo);
- if (access == ak_public || (access == ak_protected && protected_ok))
- return binfo;
- else if (access != ak_none
- && is_friend (BINFO_TYPE (binfo), current_scope ()))
+ if (access != ak_none
+ && is_friend (BINFO_TYPE (binfo), current_scope ()))
return binfo;
return NULL_TREE;
@@ -893,6 +895,7 @@ accessible_p (tree type, tree decl)
{
tree binfo;
tree t;
+ access_kind access;
/* Nonzero if it's OK to access DECL if it has protected
accessibility in TYPE. */
@@ -903,6 +906,13 @@ accessible_p (tree type, tree decl)
if (!TYPE_P (context_for_name_lookup (decl)))
return 1;
+ /* In a template declaration, we cannot be sure whether the
+ particular specialization that is instantiated will be a friend
+ or not. Therefore, all access checks are deferred until
+ instantiation. */
+ if (processing_template_decl)
+ return 1;
+
if (!TYPE_P (type))
{
binfo = type;
@@ -946,18 +956,22 @@ accessible_p (tree type, tree decl)
/* Compute the accessibility of DECL in the class hierarchy
dominated by type. */
- access_in_type (type, decl);
- /* Walk the hierarchy again, looking for a base class that allows
- access. */
- t = dfs_walk (binfo, dfs_accessible_p,
- dfs_accessible_queue_p,
- protected_ok ? &protected_ok : 0);
- /* Clear any mark bits. Note that we have to walk the whole tree
- here, since we have aborted the previous walk from some point
- deep in the tree. */
- dfs_walk (binfo, dfs_unmark, 0, 0);
-
- return t != NULL_TREE;
+ access = access_in_type (type, decl);
+ if (access == ak_public
+ || (access == ak_protected && protected_ok))
+ return 1;
+ else
+ {
+ /* Walk the hierarchy again, looking for a base class that allows
+ access. */
+ t = dfs_walk (binfo, dfs_accessible_p, dfs_accessible_queue_p, 0);
+ /* Clear any mark bits. Note that we have to walk the whole tree
+ here, since we have aborted the previous walk from some point
+ deep in the tree. */
+ dfs_walk (binfo, dfs_unmark, 0, 0);
+
+ return t != NULL_TREE;
+ }
}
struct lookup_field_info {
@@ -2111,6 +2125,20 @@ setup_class_bindings (tree name, int type_binding_p)
if (BASELINK_P (value_binding))
/* NAME is some overloaded functions. */
value_binding = BASELINK_FUNCTIONS (value_binding);
+ /* Two conversion operators that convert to the same type
+ may have different names. (See
+ mangle_conv_op_name_for_type.) To avoid recording the
+ same conversion operator declaration more than once we
+ must check to see that the same operator was not already
+ found under another name. */
+ if (IDENTIFIER_TYPENAME_P (name)
+ && is_overloaded_fn (value_binding))
+ {
+ tree fns;
+ for (fns = value_binding; fns; fns = OVL_NEXT (fns))
+ if (IDENTIFIER_CLASS_VALUE (DECL_NAME (OVL_CURRENT (fns))))
+ return;
+ }
pushdecl_class_level (value_binding);
}
}
@@ -2295,8 +2323,27 @@ add_conversions (tree binfo, void *data)
/* Make sure we don't already have this conversion. */
if (! IDENTIFIER_MARKED (name))
{
- *conversions = tree_cons (binfo, tmp, *conversions);
- IDENTIFIER_MARKED (name) = 1;
+ tree t;
+
+ /* Make sure that we do not already have a conversion
+ operator for this type. Merely checking the NAME is not
+ enough because two conversion operators to the same type
+ may not have the same NAME. */
+ for (t = *conversions; t; t = TREE_CHAIN (t))
+ {
+ tree fn;
+ for (fn = TREE_VALUE (t); fn; fn = OVL_NEXT (fn))
+ if (same_type_p (TREE_TYPE (name),
+ DECL_CONV_FN_TYPE (OVL_CURRENT (fn))))
+ break;
+ if (fn)
+ break;
+ }
+ if (!t)
+ {
+ *conversions = tree_cons (binfo, tmp, *conversions);
+ IDENTIFIER_MARKED (name) = 1;
+ }
}
}
return NULL_TREE;
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index db9e4d2791b..ef42579f349 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -59,9 +59,7 @@ static void genrtl_try_block (tree);
static void genrtl_eh_spec_block (tree);
static void genrtl_handler (tree);
static void cp_expand_stmt (tree);
-static void genrtl_start_function (tree);
-static void genrtl_finish_function (tree);
-static tree clear_decl_rtl (tree *, int *, void *);
+
/* Finish processing the COND, the SUBSTMT condition for STMT. */
@@ -155,7 +153,7 @@ void push_deferring_access_checks (deferring_kind deferring)
deferred_access_free_list = d->next;
}
else
- d = (deferred_access *) ggc_alloc (sizeof (deferred_access));
+ d = ggc_alloc (sizeof (deferred_access));
d->next = deferred_access_stack;
d->deferred_access_checks = NULL_TREE;
@@ -378,13 +376,17 @@ finish_goto_stmt (tree destination)
mark the used labels as used. */
if (TREE_CODE (destination) == LABEL_DECL)
TREE_USED (destination) = 1;
-
- if (TREE_CODE (destination) != LABEL_DECL)
- /* We don't inline calls to functions with computed gotos.
- Those functions are typically up to some funny business,
- and may be depending on the labels being at particular
- addresses, or some such. */
- DECL_UNINLINABLE (current_function_decl) = 1;
+ else
+ {
+ /* The DESTINATION is being used as an rvalue. */
+ if (!processing_template_decl)
+ destination = decay_conversion (destination);
+ /* We don't inline calls to functions with computed gotos.
+ Those functions are typically up to some funny business,
+ and may be depending on the labels being at particular
+ addresses, or some such. */
+ DECL_UNINLINABLE (current_function_decl) = 1;
+ }
check_goto (destination);
@@ -416,32 +418,19 @@ tree
finish_expr_stmt (tree expr)
{
tree r = NULL_TREE;
- tree expr_type = NULL_TREE;;
if (expr != NULL_TREE)
{
- if (!processing_template_decl
- && !(stmts_are_full_exprs_p ())
- && ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
- && lvalue_p (expr))
- || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
- expr = decay_conversion (expr);
-
- /* Remember the type of the expression. */
- expr_type = TREE_TYPE (expr);
-
- if (stmts_are_full_exprs_p ())
+ if (!processing_template_decl)
expr = convert_to_void (expr, "statement");
+ else if (!type_dependent_expression_p (expr))
+ convert_to_void (build_non_dependent_expr (expr), "statement");
r = add_stmt (build_stmt (EXPR_STMT, expr));
}
finish_stmt ();
- /* This was an expression-statement, so we save the type of the
- expression. */
- last_expr_type = expr_type;
-
return r;
}
@@ -971,6 +960,8 @@ finish_handler_parms (tree decl, tree handler)
type = expand_start_catch_block (decl);
HANDLER_TYPE (handler) = type;
+ if (type)
+ mark_used (eh_type_info (type));
}
/* Finish a handler, which may be given by HANDLER. The BLOCKs are
@@ -985,12 +976,12 @@ finish_handler (tree handler)
RECHAIN_STMTS (handler, HANDLER_BODY (handler));
}
-/* Begin a compound-statement. If HAS_NO_SCOPE is nonzero, the
+/* Begin a compound-statement. If HAS_NO_SCOPE is true, the
compound-statement does not define a scope. Returns a new
- COMPOUND_STMT if appropriate. */
+ COMPOUND_STMT. */
tree
-begin_compound_stmt (int has_no_scope)
+begin_compound_stmt (bool has_no_scope)
{
tree r;
int is_try = 0;
@@ -1018,20 +1009,18 @@ begin_compound_stmt (int has_no_scope)
return r;
}
-/* Finish a compound-statement, which may be given by COMPOUND_STMT.
- If HAS_NO_SCOPE is nonzero, the compound statement does not define
- a scope. */
+/* Finish a compound-statement, which is given by COMPOUND_STMT. */
tree
-finish_compound_stmt (int has_no_scope, tree compound_stmt)
+finish_compound_stmt (tree compound_stmt)
{
tree r;
tree t;
- if (!has_no_scope)
- r = do_poplevel ();
- else
+ if (COMPOUND_STMT_NO_SCOPE (compound_stmt))
r = NULL_TREE;
+ else
+ r = do_poplevel ();
RECHAIN_STMTS (compound_stmt, COMPOUND_BODY (compound_stmt));
@@ -1218,11 +1207,11 @@ finish_parenthesized_expr (tree expr)
preceded by `.' or `->'. */
tree
-finish_non_static_data_member (tree decl, tree qualifying_scope)
+finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
{
my_friendly_assert (TREE_CODE (decl) == FIELD_DECL, 20020909);
- if (current_class_ptr == NULL_TREE)
+ if (!object)
{
if (current_function_decl
&& DECL_STATIC_FUNCTION_P (current_function_decl))
@@ -1236,27 +1225,42 @@ finish_non_static_data_member (tree decl, tree qualifying_scope)
}
TREE_USED (current_class_ptr) = 1;
if (processing_template_decl)
- return build_min (COMPONENT_REF, TREE_TYPE (decl),
- current_class_ref, DECL_NAME (decl));
- else
{
- tree access_type = current_class_type;
- tree object = current_class_ref;
+ tree type = TREE_TYPE (decl);
- while (access_type
- && !DERIVED_FROM_P (context_for_name_lookup (decl), access_type))
+ if (TREE_CODE (type) == REFERENCE_TYPE)
+ type = TREE_TYPE (type);
+ else
+ {
+ /* Set the cv qualifiers */
+ int quals = cp_type_quals (TREE_TYPE (current_class_ref));
+
+ if (DECL_MUTABLE_P (decl))
+ quals &= ~TYPE_QUAL_CONST;
+
+ quals |= cp_type_quals (TREE_TYPE (decl));
+ type = cp_build_qualified_type (type, quals);
+ }
+
+ return build_min (COMPONENT_REF, type, object, decl);
+ }
+ else
+ {
+ tree access_type = TREE_TYPE (object);
+ tree lookup_context = context_for_name_lookup (decl);
+
+ while (!DERIVED_FROM_P (lookup_context, access_type))
{
access_type = TYPE_CONTEXT (access_type);
while (access_type && DECL_P (access_type))
access_type = DECL_CONTEXT (access_type);
- }
- if (!access_type)
- {
- cp_error_at ("object missing in reference to `%D'",
- decl);
- error ("from this location");
- return error_mark_node;
+ if (!access_type)
+ {
+ cp_error_at ("object missing in reference to `%D'", decl);
+ error ("from this location");
+ return error_mark_node;
+ }
}
perform_or_defer_access_check (TYPE_BINFO (access_type), decl);
@@ -1343,18 +1347,23 @@ tree
finish_qualified_id_expr (tree qualifying_class, tree expr, bool done,
bool address_p)
{
+ if (error_operand_p (expr))
+ return error_mark_node;
+
/* If EXPR occurs as the operand of '&', use special handling that
permits a pointer-to-member. */
if (address_p && done)
{
if (TREE_CODE (expr) == SCOPE_REF)
expr = TREE_OPERAND (expr, 1);
- expr = build_offset_ref (qualifying_class, expr);
+ expr = build_offset_ref (qualifying_class, expr,
+ /*address_p=*/true);
return expr;
}
if (TREE_CODE (expr) == FIELD_DECL)
- expr = finish_non_static_data_member (expr, qualifying_class);
+ expr = finish_non_static_data_member (expr, current_class_ref,
+ qualifying_class);
else if (BASELINK_P (expr) && !processing_template_decl)
{
tree fn;
@@ -1377,13 +1386,9 @@ finish_qualified_id_expr (tree qualifying_class, tree expr, bool done,
BASELINK_ACCESS_BINFO (expr),
/*preserve_reference=*/false));
else if (done)
- {
- /* The expression is a qualified name whose address is not
- being taken. */
- expr = build_offset_ref (qualifying_class, expr);
- if (TREE_CODE (expr) == OFFSET_REF)
- expr = resolve_offset_ref (expr);
- }
+ /* The expression is a qualified name whose address is not
+ being taken. */
+ expr = build_offset_ref (qualifying_class, expr, /*address_p=*/false);
}
return expr;
@@ -1401,63 +1406,102 @@ begin_stmt_expr (void)
if (! cfun && !last_tree)
begin_stmt_tree (&scope_chain->x_saved_tree);
+ last_expr_type = NULL_TREE;
+
keep_next_level (1);
- /* If we're building a statement tree, then the upcoming compound
- statement will be chained onto the tree structure, starting at
- last_tree. We return last_tree so that we can later unhook the
- compound statement. */
+
return last_tree;
}
-/* Used when beginning a statement-expression outside function scope.
- For example, when handling a file-scope initializer, we use this
- function. */
+/* Process the final expression of a statement expression. EXPR can be
+ NULL, if the final expression is empty. Build up a TARGET_EXPR so
+ that the result value can be safely returned to the enclosing
+ expression. */
tree
-begin_global_stmt_expr (void)
+finish_stmt_expr_expr (tree expr)
{
- if (! cfun && !last_tree)
- begin_stmt_tree (&scope_chain->x_saved_tree);
-
- keep_next_level (1);
-
- return last_tree ? last_tree : expand_start_stmt_expr(/*has_scope=*/1);
-}
+ tree result = NULL_TREE;
+ tree type = void_type_node;
-/* Finish the STMT_EXPR last begun with begin_global_stmt_expr. */
+ if (expr)
+ {
+ type = TREE_TYPE (expr);
+
+ if (!processing_template_decl && !VOID_TYPE_P (TREE_TYPE (expr)))
+ {
+ if (TREE_CODE (type) == ARRAY_TYPE
+ || TREE_CODE (type) == FUNCTION_TYPE)
+ expr = decay_conversion (expr);
+
+ expr = convert_from_reference (expr);
+ expr = require_complete_type (expr);
+
+ /* Build a TARGET_EXPR for this aggregate. finish_stmt_expr
+ will then pull it apart so the lifetime of the target is
+ within the scope of the expresson containing this statement
+ expression. */
+ if (TREE_CODE (expr) == TARGET_EXPR)
+ ;
+ else if (!IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_INIT_REF (type))
+ expr = build_target_expr_with_type (expr, type);
+ else
+ {
+ /* Copy construct. */
+ expr = build_special_member_call
+ (NULL_TREE, complete_ctor_identifier,
+ build_tree_list (NULL_TREE, expr),
+ TYPE_BINFO (type), LOOKUP_NORMAL);
+ expr = build_cplus_new (type, expr);
+ my_friendly_assert (TREE_CODE (expr) == TARGET_EXPR, 20030729);
+ }
+ }
-tree
-finish_global_stmt_expr (tree stmt_expr)
-{
- stmt_expr = expand_end_stmt_expr (stmt_expr);
+ if (expr != error_mark_node)
+ {
+ result = build_stmt (EXPR_STMT, expr);
+ add_stmt (result);
+ }
+ }
- if (! cfun
- && TREE_CHAIN (scope_chain->x_saved_tree) == NULL_TREE)
- finish_stmt_tree (&scope_chain->x_saved_tree);
+ finish_stmt ();
- return stmt_expr;
+ /* Remember the last expression so that finish_stmt_expr can pull it
+ apart. */
+ last_expr_type = result ? result : void_type_node;
+
+ return result;
}
-/* Finish a statement-expression. RTL_EXPR should be the value
- returned by the previous begin_stmt_expr; EXPR is the
- statement-expression. Returns an expression representing the
- statement-expression. */
+/* Finish a statement-expression. EXPR should be the value returned
+ by the previous begin_stmt_expr. Returns an expression
+ representing the statement-expression. */
tree
-finish_stmt_expr (tree rtl_expr)
+finish_stmt_expr (tree rtl_expr, bool has_no_scope)
{
tree result;
-
- /* If the last thing in the statement-expression was not an
- expression-statement, then it has type `void'. In a template, we
- cannot distinguish the case where the last expression-statement
- had a dependent type from the case where the last statement was
- not an expression-statement. Therefore, we (incorrectly) treat
- the STMT_EXPR as dependent in that case. */
- if (!last_expr_type && !processing_template_decl)
- last_expr_type = void_type_node;
- result = build_min (STMT_EXPR, last_expr_type, last_tree);
+ tree result_stmt = last_expr_type;
+ tree type;
+
+ if (!last_expr_type)
+ type = void_type_node;
+ else
+ {
+ if (result_stmt == void_type_node)
+ {
+ type = void_type_node;
+ result_stmt = NULL_TREE;
+ }
+ else
+ type = TREE_TYPE (EXPR_STMT_EXPR (result_stmt));
+ }
+
+ result = build_min (STMT_EXPR, type, last_tree);
TREE_SIDE_EFFECTS (result) = 1;
+ STMT_EXPR_NO_SCOPE (result) = has_no_scope;
+
+ last_expr_type = NULL_TREE;
/* Remove the compound statement from the tree structure; it is
now saved in the STMT_EXPR. */
@@ -1470,9 +1514,67 @@ finish_stmt_expr (tree rtl_expr)
&& TREE_CHAIN (scope_chain->x_saved_tree) == NULL_TREE)
finish_stmt_tree (&scope_chain->x_saved_tree);
+ if (processing_template_decl)
+ return result;
+
+ if (!VOID_TYPE_P (type))
+ {
+ /* Pull out the TARGET_EXPR that is the final expression. Put
+ the target's init_expr as the final expression and then put
+ the statement expression itself as the target's init
+ expr. Finally, return the target expression. */
+ tree last_expr = EXPR_STMT_EXPR (result_stmt);
+
+ my_friendly_assert (TREE_CODE (last_expr) == TARGET_EXPR, 20030729);
+ EXPR_STMT_EXPR (result_stmt) = TREE_OPERAND (last_expr, 1);
+ TREE_OPERAND (last_expr, 1) = result;
+ result = last_expr;
+ }
return result;
}
+/* Perform Koenig lookup. FN is the postfix-expression representing
+ the function (or functions) to call; ARGS are the arguments to the
+ call. Returns the functions to be considered by overload
+ resolution. */
+
+tree
+perform_koenig_lookup (tree fn, tree args)
+{
+ tree identifier = NULL_TREE;
+ tree functions = NULL_TREE;
+
+ /* Find the name of the overloaded function. */
+ if (TREE_CODE (fn) == IDENTIFIER_NODE)
+ identifier = fn;
+ else if (is_overloaded_fn (fn))
+ {
+ functions = fn;
+ identifier = DECL_NAME (get_first_fn (functions));
+ }
+ else if (DECL_P (fn))
+ {
+ functions = fn;
+ identifier = DECL_NAME (fn);
+ }
+
+ /* A call to a namespace-scope function using an unqualified name.
+
+ Do Koenig lookup -- unless any of the arguments are
+ type-dependent. */
+ if (!any_type_dependent_arguments_p (args))
+ {
+ fn = lookup_arg_dependent (identifier, functions, args);
+ if (!fn)
+ /* The unqualified name could not be resolved. */
+ fn = unqualified_fn_lookup_error (identifier);
+ }
+ else
+ fn = identifier;
+
+ return fn;
+}
+
/* Generate an expression for `FN (ARGS)'.
If DISALLOW_VIRTUAL is true, the call to FN will be not generated
@@ -1484,7 +1586,7 @@ finish_stmt_expr (tree rtl_expr)
Returns code for the call. */
tree
-finish_call_expr (tree fn, tree args, bool disallow_virtual)
+finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
{
tree result;
tree orig_fn;
@@ -1504,7 +1606,11 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual)
{
if (type_dependent_expression_p (fn)
|| any_type_dependent_arguments_p (args))
- return build_nt (CALL_EXPR, fn, args);
+ {
+ result = build_nt (CALL_EXPR, fn, args);
+ KOENIG_LOOKUP_P (result) = koenig_p;
+ return result;
+ }
if (!BASELINK_P (fn)
&& TREE_CODE (fn) != PSEUDO_DTOR_EXPR
&& TREE_TYPE (fn) != unknown_type_node)
@@ -1517,12 +1623,11 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual)
to refer to it. */
if (!BASELINK_P (fn) && is_overloaded_fn (fn))
{
- tree f;
+ tree f = fn;
- if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
- f = get_first_fn (TREE_OPERAND (fn, 0));
- else
- f = get_first_fn (fn);
+ if (TREE_CODE (f) == TEMPLATE_ID_EXPR)
+ f = TREE_OPERAND (f, 0);
+ f = get_first_fn (f);
if (DECL_FUNCTION_MEMBER_P (f))
{
tree type = currently_open_derived_class (DECL_CONTEXT (f));
@@ -1606,7 +1711,10 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual)
result = build_function_call (fn, args);
if (processing_template_decl)
- return build (CALL_EXPR, TREE_TYPE (result), orig_fn, orig_args);
+ {
+ result = build (CALL_EXPR, TREE_TYPE (result), orig_fn, orig_args);
+ KOENIG_LOOKUP_P (result) = koenig_p;
+ }
return result;
}
@@ -1775,7 +1883,7 @@ finish_fname (tree id)
decl = fname_decl (C_RID_CODE (id), id);
if (processing_template_decl)
- decl = build_min_nt (LOOKUP_EXPR, DECL_NAME (decl));
+ decl = DECL_NAME (decl);
return decl;
}
@@ -1930,7 +2038,7 @@ begin_class_definition (tree t)
pushtag (TYPE_IDENTIFIER (t), t, 0);
}
maybe_process_partial_specialization (t);
- pushclass (t, true);
+ pushclass (t);
TYPE_BEING_DEFINED (t) = 1;
TYPE_PACKED (t) = flag_pack_struct;
/* Reset the interface data, at the earliest possible
@@ -2004,7 +2112,8 @@ finish_member_declaration (tree decl)
/*friend_p=*/0);
}
/* Enter the DECL into the scope of the class. */
- else if (TREE_CODE (decl) == USING_DECL || pushdecl_class_level (decl))
+ else if ((TREE_CODE (decl) == USING_DECL && TREE_TYPE (decl))
+ || pushdecl_class_level (decl))
{
/* All TYPE_DECLs go at the end of TYPE_FIELDS. Ordinary fields
go at the beginning. The reason is that lookup_field_1
@@ -2037,41 +2146,6 @@ finish_member_declaration (tree decl)
}
}
-/* Finish a class definition T with the indicate ATTRIBUTES. If SEMI,
- the definition is immediately followed by a semicolon. Returns the
- type. */
-
-tree
-finish_class_definition (tree t, tree attributes, int semi, int pop_scope_p)
-{
- if (t == error_mark_node)
- return error_mark_node;
-
- /* finish_struct nukes this anyway; if finish_exception does too,
- then it can go. */
- if (semi)
- note_got_semicolon (t);
-
- /* If we got any attributes in class_head, xref_tag will stick them in
- TREE_TYPE of the type. Grab them now. */
- attributes = chainon (TYPE_ATTRIBUTES (t), attributes);
- TYPE_ATTRIBUTES (t) = NULL_TREE;
-
- if (TREE_CODE (t) == ENUMERAL_TYPE)
- ;
- else
- {
- t = finish_struct (t, attributes);
- if (semi)
- note_got_semicolon (t);
- }
-
- if (pop_scope_p)
- pop_scope (CP_DECL_CONTEXT (TYPE_MAIN_DECL (t)));
-
- return t;
-}
-
/* Finish processing the declaration of a member class template
TYPES whose template parameters are given by PARMS. */
@@ -2087,7 +2161,6 @@ finish_member_class_template (tree types)
if (IS_AGGR_TYPE_CODE (TREE_CODE (TREE_VALUE (t))))
maybe_process_partial_specialization (TREE_VALUE (t));
- note_list_got_semicolon (types);
grok_x_components (types);
if (TYPE_CONTEXT (TREE_VALUE (types)) != current_class_type)
/* The component was in fact a friend declaration. We avoid
@@ -2126,8 +2199,8 @@ finish_template_type (tree name, tree args, int entering_scope)
tree decl;
decl = lookup_template_class (name, args,
- NULL_TREE, NULL_TREE,
- entering_scope, /*complain=*/1);
+ NULL_TREE, NULL_TREE, entering_scope,
+ tf_error | tf_warning | tf_user);
if (decl != error_mark_node)
decl = TYPE_STUB_DECL (decl);
@@ -2191,6 +2264,383 @@ check_multiple_declarators (void)
error ("multiple declarators in template declaration");
}
+/* Issue a diagnostic that NAME cannot be found in SCOPE. */
+
+void
+qualified_name_lookup_error (tree scope, tree name)
+{
+ if (TYPE_P (scope))
+ {
+ if (!COMPLETE_TYPE_P (scope))
+ error ("incomplete type `%T' used in nested name specifier", scope);
+ else
+ error ("`%D' is not a member of `%T'", name, scope);
+ }
+ else if (scope != global_namespace)
+ error ("`%D' is not a member of `%D'", name, scope);
+ else
+ error ("`::%D' has not been declared", name);
+}
+
+/* ID_EXPRESSION is a representation of parsed, but unprocessed,
+ id-expression. (See cp_parser_id_expression for details.) SCOPE,
+ if non-NULL, is the type or namespace used to explicitly qualify
+ ID_EXPRESSION. DECL is the entity to which that name has been
+ resolved.
+
+ *CONSTANT_EXPRESSION_P is true if we are presently parsing a
+ constant-expression. In that case, *NON_CONSTANT_EXPRESSION_P will
+ be set to true if this expression isn't permitted in a
+ constant-expression, but it is otherwise not set by this function.
+ *ALLOW_NON_CONSTANT_EXPRESSION_P is true if we are parsing a
+ constant-expression, but a non-constant expression is also
+ permissible.
+
+ If an error occurs, and it is the kind of error that might cause
+ the parser to abort a tentative parse, *ERROR_MSG is filled in. It
+ is the caller's responsibility to issue the message. *ERROR_MSG
+ will be a string with static storage duration, so the caller need
+ not "free" it.
+
+ Return an expression for the entity, after issuing appropriate
+ diagnostics. This function is also responsible for transforming a
+ reference to a non-static member into a COMPONENT_REF that makes
+ the use of "this" explicit.
+
+ Upon return, *IDK will be filled in appropriately. */
+
+tree
+finish_id_expression (tree id_expression,
+ tree decl,
+ tree scope,
+ cp_id_kind *idk,
+ tree *qualifying_class,
+ bool constant_expression_p,
+ bool allow_non_constant_expression_p,
+ bool *non_constant_expression_p,
+ const char **error_msg)
+{
+ /* Initialize the output parameters. */
+ *idk = CP_ID_KIND_NONE;
+ *error_msg = NULL;
+
+ if (id_expression == error_mark_node)
+ return error_mark_node;
+ /* If we have a template-id, then no further lookup is
+ required. If the template-id was for a template-class, we
+ will sometimes have a TYPE_DECL at this point. */
+ else if (TREE_CODE (decl) == TEMPLATE_ID_EXPR
+ || TREE_CODE (decl) == TYPE_DECL)
+ ;
+ /* Look up the name. */
+ else
+ {
+ if (decl == error_mark_node)
+ {
+ /* Name lookup failed. */
+ if (scope && (!TYPE_P (scope) || !dependent_type_p (scope)))
+ {
+ /* Qualified name lookup failed, and the qualifying name
+ was not a dependent type. That is always an
+ error. */
+ qualified_name_lookup_error (scope, id_expression);
+ return error_mark_node;
+ }
+ else if (!scope)
+ {
+ /* It may be resolved via Koenig lookup. */
+ *idk = CP_ID_KIND_UNQUALIFIED;
+ return id_expression;
+ }
+ }
+ /* If DECL is a variable that would be out of scope under
+ ANSI/ISO rules, but in scope in the ARM, name lookup
+ will succeed. Issue a diagnostic here. */
+ else
+ decl = check_for_out_of_scope_variable (decl);
+
+ /* Remember that the name was used in the definition of
+ the current class so that we can check later to see if
+ the meaning would have been different after the class
+ was entirely defined. */
+ if (!scope && decl != error_mark_node)
+ maybe_note_name_used_in_class (id_expression, decl);
+ }
+
+ /* If we didn't find anything, or what we found was a type,
+ then this wasn't really an id-expression. */
+ if (TREE_CODE (decl) == TEMPLATE_DECL
+ && !DECL_FUNCTION_TEMPLATE_P (decl))
+ {
+ *error_msg = "missing template arguments";
+ return error_mark_node;
+ }
+ else if (TREE_CODE (decl) == TYPE_DECL
+ || TREE_CODE (decl) == NAMESPACE_DECL)
+ {
+ *error_msg = "expected primary-expression";
+ return error_mark_node;
+ }
+
+ /* 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)
+ {
+ *idk = CP_ID_KIND_NONE;
+ if (DECL_TEMPLATE_PARM_P (decl) || !processing_template_decl)
+ return DECL_INITIAL (decl);
+ return decl;
+ }
+ else
+ {
+ bool dependent_p;
+
+ /* If the declaration was explicitly qualified indicate
+ that. The semantics of `A::f(3)' are different than
+ `f(3)' if `f' is virtual. */
+ *idk = (scope
+ ? CP_ID_KIND_QUALIFIED
+ : (TREE_CODE (decl) == TEMPLATE_ID_EXPR
+ ? CP_ID_KIND_TEMPLATE_ID
+ : CP_ID_KIND_UNQUALIFIED));
+
+
+ /* [temp.dep.expr]
+
+ An id-expression is type-dependent if it contains an
+ identifier that was declared with a dependent type.
+
+ The standard is not very specific about an id-expression that
+ names a set of overloaded functions. What if some of them
+ have dependent types and some of them do not? Presumably,
+ such a name should be treated as a dependent name. */
+ /* Assume the name is not dependent. */
+ dependent_p = false;
+ if (!processing_template_decl)
+ /* No names are dependent outside a template. */
+ ;
+ /* A template-id where the name of the template was not resolved
+ is definitely dependent. */
+ else if (TREE_CODE (decl) == TEMPLATE_ID_EXPR
+ && (TREE_CODE (TREE_OPERAND (decl, 0))
+ == IDENTIFIER_NODE))
+ dependent_p = true;
+ /* For anything except an overloaded function, just check its
+ type. */
+ else if (!is_overloaded_fn (decl))
+ dependent_p
+ = dependent_type_p (TREE_TYPE (decl));
+ /* For a set of overloaded functions, check each of the
+ functions. */
+ else
+ {
+ tree fns = decl;
+
+ if (BASELINK_P (fns))
+ fns = BASELINK_FUNCTIONS (fns);
+
+ /* For a template-id, check to see if the template
+ arguments are dependent. */
+ if (TREE_CODE (fns) == TEMPLATE_ID_EXPR)
+ {
+ tree args = TREE_OPERAND (fns, 1);
+ dependent_p = any_dependent_template_arguments_p (args);
+ /* The functions are those referred to by the
+ template-id. */
+ fns = TREE_OPERAND (fns, 0);
+ }
+
+ /* If there are no dependent template arguments, go through
+ the overlaoded functions. */
+ while (fns && !dependent_p)
+ {
+ tree fn = OVL_CURRENT (fns);
+
+ /* Member functions of dependent classes are
+ dependent. */
+ if (TREE_CODE (fn) == FUNCTION_DECL
+ && type_dependent_expression_p (fn))
+ dependent_p = true;
+ else if (TREE_CODE (fn) == TEMPLATE_DECL
+ && dependent_template_p (fn))
+ dependent_p = true;
+
+ fns = OVL_NEXT (fns);
+ }
+ }
+
+ /* If the name was dependent on a template parameter, we will
+ resolve the name at instantiation time. */
+ if (dependent_p)
+ {
+ /* Create a SCOPE_REF for qualified names, if the scope is
+ dependent. */
+ if (scope)
+ {
+ if (TYPE_P (scope))
+ *qualifying_class = scope;
+ /* 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 (TYPE_P (scope) && dependent_type_p (scope))
+ return build_nt (SCOPE_REF, scope, id_expression);
+ else if (TYPE_P (scope) && DECL_P (decl))
+ return build (SCOPE_REF, TREE_TYPE (decl), scope,
+ id_expression);
+ else
+ return decl;
+ }
+ /* A TEMPLATE_ID already contains all the information we
+ need. */
+ if (TREE_CODE (id_expression) == TEMPLATE_ID_EXPR)
+ return 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;
+ *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)
+ {
+ /* 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))
+ ;
+ else
+ {
+ if (!allow_non_constant_expression_p)
+ {
+ error ("`%D' cannot appear in a constant-expression", decl);
+ return error_mark_node;
+ }
+ *non_constant_expression_p = true;
+ }
+ }
+
+ if (TREE_CODE (decl) == NAMESPACE_DECL)
+ {
+ error ("use of namespace `%D' as expression", decl);
+ return error_mark_node;
+ }
+ else if (DECL_CLASS_TEMPLATE_P (decl))
+ {
+ error ("use of class template `%T' as expression", decl);
+ return error_mark_node;
+ }
+ else if (TREE_CODE (decl) == TREE_LIST)
+ {
+ /* Ambiguous reference to base members. */
+ error ("request for member `%D' is ambiguous in "
+ "multiple inheritance lattice", id_expression);
+ print_candidates (decl);
+ return error_mark_node;
+ }
+
+ /* Mark variable-like entities as used. Functions are similarly
+ marked either below or after overload resolution. */
+ if (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == RESULT_DECL)
+ mark_used (decl);
+
+ if (scope)
+ {
+ decl = (adjust_result_of_qualified_name_lookup
+ (decl, scope, current_class_type));
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ mark_used (decl);
+
+ if (TREE_CODE (decl) == FIELD_DECL || BASELINK_P (decl))
+ *qualifying_class = scope;
+ else if (!processing_template_decl)
+ decl = convert_from_reference (decl);
+ else if (TYPE_P (scope))
+ decl = build (SCOPE_REF, TREE_TYPE (decl), scope, decl);
+ }
+ else if (TREE_CODE (decl) == FIELD_DECL)
+ decl = finish_non_static_data_member (decl, current_class_ref,
+ /*qualifying_scope=*/NULL_TREE);
+ else if (is_overloaded_fn (decl))
+ {
+ tree first_fn = OVL_CURRENT (decl);
+
+ if (TREE_CODE (first_fn) == TEMPLATE_DECL)
+ first_fn = DECL_TEMPLATE_RESULT (first_fn);
+
+ if (!really_overloaded_fn (decl))
+ mark_used (first_fn);
+
+ if (TREE_CODE (first_fn) == FUNCTION_DECL
+ && DECL_FUNCTION_MEMBER_P (first_fn))
+ {
+ /* A set of member functions. */
+ decl = maybe_dummy_object (DECL_CONTEXT (first_fn), 0);
+ return finish_class_member_access_expr (decl, id_expression);
+ }
+ }
+ else
+ {
+ if (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == RESULT_DECL)
+ {
+ tree context = decl_function_context (decl);
+
+ if (context != NULL_TREE && context != current_function_decl
+ && ! TREE_STATIC (decl))
+ {
+ error ("use of %s from containing function",
+ (TREE_CODE (decl) == VAR_DECL
+ ? "`auto' variable" : "parameter"));
+ cp_error_at (" `%#D' declared here", decl);
+ return error_mark_node;
+ }
+ }
+
+ if (DECL_P (decl) && DECL_NONLOCAL (decl)
+ && DECL_CLASS_SCOPE_P (decl)
+ && DECL_CONTEXT (decl) != current_class_type)
+ {
+ tree path;
+
+ path = currently_open_derived_class (DECL_CONTEXT (decl));
+ perform_or_defer_access_check (TYPE_BINFO (path), decl);
+ }
+
+ if (! processing_template_decl)
+ decl = convert_from_reference (decl);
+ }
+
+ /* Resolve references to variables of anonymous unions
+ into COMPONENT_REFs. */
+ if (TREE_CODE (decl) == ALIAS_DECL)
+ decl = DECL_INITIAL (decl);
+ }
+
+ if (TREE_DEPRECATED (decl))
+ warn_deprecated_use (decl);
+
+ return decl;
+}
+
/* Implement the __typeof keyword: Return the type of EXPR, suitable for
use as a type-specifier. */
@@ -2218,26 +2668,6 @@ finish_typeof (tree expr)
return type;
}
-/* Compute the value of the `sizeof' operator. */
-
-tree
-finish_sizeof (tree t)
-{
- return TYPE_P (t) ? cxx_sizeof (t) : expr_sizeof (t);
-}
-
-/* Implement the __alignof keyword: Return the minimum required
- alignment of T, measured in bytes. */
-
-tree
-finish_alignof (tree t)
-{
- if (processing_template_decl)
- return build_min (ALIGNOF_EXPR, size_type_node, t);
-
- return TYPE_P (t) ? cxx_alignof (t) : c_alignof_expr (t);
-}
-
/* Generate RTL for the statement T, and its substatements, and any
other statements at its nesting level. */
@@ -2272,37 +2702,46 @@ cp_expand_stmt (tree t)
static tree
simplify_aggr_init_exprs_r (tree* tp,
- int* walk_subtrees ATTRIBUTE_UNUSED ,
- void* data ATTRIBUTE_UNUSED )
+ int* walk_subtrees,
+ void* data ATTRIBUTE_UNUSED)
{
- tree aggr_init_expr;
- tree call_expr;
- tree fn;
- tree args;
- tree slot;
- tree type;
- enum style_t { ctor, arg, pcc } style;
-
- aggr_init_expr = *tp;
/* We don't need to walk into types; there's nothing in a type that
needs simplification. (And, furthermore, there are places we
actively don't want to go. For example, we don't want to wander
into the default arguments for a FUNCTION_DECL that appears in a
CALL_EXPR.) */
- if (TYPE_P (aggr_init_expr))
+ if (TYPE_P (*tp))
{
*walk_subtrees = 0;
return NULL_TREE;
}
/* Only AGGR_INIT_EXPRs are interesting. */
- else if (TREE_CODE (aggr_init_expr) != AGGR_INIT_EXPR)
+ else if (TREE_CODE (*tp) != AGGR_INIT_EXPR)
return NULL_TREE;
+ simplify_aggr_init_expr (tp);
+
+ /* Keep iterating. */
+ return NULL_TREE;
+}
+
+/* Replace the AGGR_INIT_EXPR at *TP with an equivalent CALL_EXPR. This
+ function is broken out from the above for the benefit of the tree-ssa
+ project. */
+
+void
+simplify_aggr_init_expr (tree *tp)
+{
+ tree aggr_init_expr = *tp;
+
/* Form an appropriate CALL_EXPR. */
- fn = TREE_OPERAND (aggr_init_expr, 0);
- args = TREE_OPERAND (aggr_init_expr, 1);
- slot = TREE_OPERAND (aggr_init_expr, 2);
- type = TREE_TYPE (aggr_init_expr);
+ tree fn = TREE_OPERAND (aggr_init_expr, 0);
+ tree args = TREE_OPERAND (aggr_init_expr, 1);
+ tree slot = TREE_OPERAND (aggr_init_expr, 2);
+ tree type = TREE_TYPE (aggr_init_expr);
+
+ tree call_expr;
+ enum style_t { ctor, arg, pcc } style;
if (AGGR_INIT_VIA_CTOR_P (aggr_init_expr))
style = ctor;
@@ -2321,21 +2760,31 @@ simplify_aggr_init_exprs_r (tree* tp,
{
/* Pass the address of the slot. If this is a constructor, we
replace the first argument; otherwise, we tack on a new one. */
+ tree addr;
+
if (style == ctor)
args = TREE_CHAIN (args);
cxx_mark_addressable (slot);
- args = tree_cons (NULL_TREE,
- build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (slot)),
- slot),
- args);
+ addr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (slot)), slot);
+ if (style == arg)
+ {
+ /* The return type might have different cv-quals from the slot. */
+ tree fntype = TREE_TYPE (TREE_TYPE (fn));
+#ifdef ENABLE_CHECKING
+ if (TREE_CODE (fntype) != FUNCTION_TYPE
+ && TREE_CODE (fntype) != METHOD_TYPE)
+ abort ();
+#endif
+ addr = convert (build_pointer_type (TREE_TYPE (fntype)), addr);
+ }
+
+ args = tree_cons (NULL_TREE, addr, args);
}
call_expr = build (CALL_EXPR,
TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))),
fn, args, NULL_TREE);
- TREE_SIDE_EFFECTS (call_expr) = 1;
if (style == arg)
/* Tell the backend that we've added our return slot to the argument
@@ -2360,9 +2809,6 @@ simplify_aggr_init_exprs_r (tree* tp,
/* Replace the AGGR_INIT_EXPR with the CALL_EXPR. */
TREE_CHAIN (call_expr) = TREE_CHAIN (aggr_init_expr);
*tp = call_expr;
-
- /* Keep iterating. */
- return NULL_TREE;
}
/* Emit all thunks to FN that should be emitted when FN is emitted. */
@@ -2399,12 +2845,8 @@ emit_associated_thunks (tree fn)
void
expand_body (tree fn)
{
- location_t saved_loc;
tree saved_function;
- if (flag_unit_at_a_time && !cgraph_global_info_ready)
- abort ();
-
/* Compute the appropriate object-file linkage for inline
functions. */
if (DECL_DECLARED_INLINE_P (fn))
@@ -2418,61 +2860,53 @@ expand_body (tree fn)
if (DECL_EXTERNAL (fn))
return;
- /* Save the current file name and line number. When we expand the
- body of the function, we'll set INPUT_LOCATION so that
- error-messages come out in the right places. */
- saved_loc = input_location;
+ /* ??? When is this needed? */
saved_function = current_function_decl;
- input_location = DECL_SOURCE_LOCATION (fn);
- current_function_decl = fn;
timevar_push (TV_INTEGRATION);
-
- /* Optimize the body of the function before expanding it. */
optimize_function (fn);
-
timevar_pop (TV_INTEGRATION);
- timevar_push (TV_EXPAND);
-
- genrtl_start_function (fn);
- current_function_is_thunk = DECL_THUNK_P (fn);
- /* Expand the body. */
- expand_stmt (DECL_SAVED_TREE (fn));
+ tree_rest_of_compilation (fn, function_depth > 1);
- /* Statements should always be full-expressions at the outermost set
- of curly braces for a function. */
- my_friendly_assert (stmts_are_full_exprs_p (), 19990831);
+ current_function_decl = saved_function;
- /* The outermost statement for a function contains the line number
- recorded when we finished processing the function. */
- input_line = STMT_LINENO (DECL_SAVED_TREE (fn));
+ extract_interface_info ();
- /* Generate code for the function. */
- genrtl_finish_function (fn);
+ /* Emit any thunks that should be emitted at the same time as FN. */
+ emit_associated_thunks (fn);
- /* 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 (fn) && 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 (fn) = NULL_TREE;
+ /* If this function is marked with the constructor attribute, add it
+ to the list of functions to be called along with constructors
+ from static duration objects. */
+ if (DECL_STATIC_CONSTRUCTOR (fn))
+ static_ctors = tree_cons (NULL_TREE, fn, static_ctors);
- /* And restore the current source position. */
- current_function_decl = saved_function;
- input_location = saved_loc;
- extract_interface_info ();
+ /* If this function is marked with the destructor attribute, add it
+ to the list of functions to be called along with destructors from
+ static duration objects. */
+ if (DECL_STATIC_DESTRUCTOR (fn))
+ static_dtors = tree_cons (NULL_TREE, fn, static_dtors);
- timevar_pop (TV_EXPAND);
+ if (DECL_CLONED_FUNCTION_P (fn))
+ {
+ /* If this is a clone, go through the other clones now and mark
+ their parameters used. We have to do that here, as we don't
+ know whether any particular clone will be expanded, and
+ therefore cannot pick one arbitrarily. */
+ tree probe;
+
+ for (probe = TREE_CHAIN (DECL_CLONED_FUNCTION (fn));
+ probe && DECL_CLONED_FUNCTION_P (probe);
+ probe = TREE_CHAIN (probe))
+ {
+ tree parms;
- /* Emit any thunks that should be emitted at the same time as FN. */
- emit_associated_thunks (fn);
+ for (parms = DECL_ARGUMENTS (probe);
+ parms; parms = TREE_CHAIN (parms))
+ TREE_USED (parms) = 1;
+ }
+ }
}
/* Generate RTL for FN. */
@@ -2518,62 +2952,16 @@ expand_or_defer_fn (tree fn)
if (flag_syntax_only)
return;
- if (flag_unit_at_a_time && cgraph_global_info_ready)
- abort ();
-
- if (flag_unit_at_a_time && !cgraph_global_info_ready)
- {
- if (at_eof)
- {
- /* Compute the appropriate object-file linkage for inline
- functions. */
- if (DECL_DECLARED_INLINE_P (fn))
- import_export_decl (fn);
- cgraph_finalize_function (fn, DECL_SAVED_TREE (fn));
- }
- else
- {
- if (!DECL_EXTERNAL (fn))
- {
- DECL_NOT_REALLY_EXTERN (fn) = 1;
- DECL_EXTERNAL (fn) = 1;
- }
- /* Remember this function. In finish_file we'll decide if
- we actually need to write this function out. */
- defer_fn (fn);
- /* Let the back-end know that this function exists. */
- (*debug_hooks->deferred_inline_function) (fn);
- }
- return;
- }
+ /* Compute the appropriate object-file linkage for inline functions. */
+ if (DECL_DECLARED_INLINE_P (fn))
+ import_export_decl (fn);
+ function_depth++;
- /* If possible, avoid generating RTL for this function. Instead,
- just record it as an inline function, and wait until end-of-file
- to decide whether to write it out or not. */
- if (/* We have to generate RTL if it's not an inline function. */
- (DECL_INLINE (fn) || DECL_COMDAT (fn))
- /* Or if we have to emit code for inline functions anyhow. */
- && !flag_keep_inline_functions
- /* Or if we actually have a reference to the function. */
- && !DECL_NEEDED_P (fn))
- {
- /* Set DECL_EXTERNAL so that assemble_external will be called as
- necessary. We'll clear it again in finish_file. */
- if (!DECL_EXTERNAL (fn))
- {
- DECL_NOT_REALLY_EXTERN (fn) = 1;
- DECL_EXTERNAL (fn) = 1;
- }
- /* Remember this function. In finish_file we'll decide if
- we actually need to write this function out. */
- defer_fn (fn);
- /* Let the back-end know that this function exists. */
- (*debug_hooks->deferred_inline_function) (fn);
- return;
- }
+ /* Expand or defer, at the whim of the compilation unit manager. */
+ cgraph_finalize_function (fn, function_depth > 1);
- expand_body (fn);
+ function_depth--;
}
/* Helper function for walk_tree, used by finish_function to override all
@@ -2601,197 +2989,12 @@ nullify_returns_r (tree* tp, int* walk_subtrees, void* data)
/* Start generating the RTL for FN. */
-static void
-genrtl_start_function (tree fn)
-{
- /* Tell everybody what function we're processing. */
- current_function_decl = fn;
- /* Get the RTL machinery going for this function. */
- init_function_start (fn);
- /* Let everybody know that we're expanding this function, not doing
- semantic analysis. */
- expanding_p = 1;
-
- /* Even though we're inside a function body, we still don't want to
- call expand_expr to calculate the size of a variable-sized array.
- We haven't necessarily assigned RTL to all variables yet, so it's
- not safe to try to expand expressions involving them. */
- immediate_size_expand = 0;
- cfun->x_dont_save_pending_sizes_p = 1;
-
- /* Let the user know we're compiling this function. */
- announce_function (fn);
-
- /* Initialize the per-function data. */
- my_friendly_assert (!DECL_PENDING_INLINE_P (fn), 20000911);
- if (DECL_SAVED_FUNCTION_DATA (fn))
- {
- /* If we already parsed this function, and we're just expanding it
- now, restore saved state. */
- *cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn);
-
- /* This function is being processed in whole-function mode; we
- already did semantic analysis. */
- cfun->x_whole_function_mode_p = 1;
-
- /* If we decided that we didn't want to inline this function,
- make sure the back-end knows that. */
- if (!current_function_cannot_inline)
- current_function_cannot_inline = cp_function_chain->cannot_inline;
-
- /* We don't need the saved data anymore. Unless this is an inline
- function; we need the named return value info for
- cp_copy_res_decl_for_inlining. */
- if (! DECL_INLINE (fn))
- DECL_SAVED_FUNCTION_DATA (fn) = NULL;
- }
-
- /* Keep track of how many functions we're presently expanding. */
- ++function_depth;
-
- /* Create a binding level for the parameters. */
- expand_function_start (fn, /*parms_have_cleanups=*/0);
- /* If this function is `main'. */
- if (DECL_MAIN_P (fn))
- expand_main_function ();
-
+void
+cxx_expand_function_start (void)
+{
/* Give our named return value the same RTL as our RESULT_DECL. */
if (current_function_return_value)
- COPY_DECL_RTL (DECL_RESULT (fn), current_function_return_value);
-}
-
-/* Finish generating the RTL for FN. */
-
-static void
-genrtl_finish_function (tree fn)
-{
- tree t;
-
-#if 0
- if (write_symbols != NO_DEBUG)
- {
- /* Keep this code around in case we later want to control debug info
- based on whether a type is "used". (jason 1999-11-11) */
-
- tree ttype = target_type (fntype);
- tree parmdecl;
-
- if (IS_AGGR_TYPE (ttype))
- /* Let debugger know it should output info for this type. */
- note_debug_info_needed (ttype);
-
- for (parmdecl = DECL_ARGUMENTS (fndecl); parmdecl; parmdecl = TREE_CHAIN (parmdecl))
- {
- ttype = target_type (TREE_TYPE (parmdecl));
- if (IS_AGGR_TYPE (ttype))
- /* Let debugger know it should output info for this type. */
- note_debug_info_needed (ttype);
- }
- }
-#endif
-
- /* Clean house because we will need to reorder insns here. */
- do_pending_stack_adjust ();
-
- /* If we have a named return value, we need to force a return so that
- the return register is USEd. */
- if (DECL_NAME (DECL_RESULT (fn)))
- emit_jump (return_label);
-
- /* We hard-wired immediate_size_expand to zero in start_function.
- Expand_function_end will decrement this variable. So, we set the
- variable to one here, so that after the decrement it will remain
- zero. */
- immediate_size_expand = 1;
-
- /* Generate rtl for function exit. */
- expand_function_end ();
-
- /* If this is a nested function (like a template instantiation that
- we're compiling in the midst of compiling something else), push a
- new GC context. That will keep local variables on the stack from
- being collected while we're doing the compilation of this
- function. */
- if (function_depth > 1)
- ggc_push_context ();
-
- /* There's no need to defer outputting this function any more; we
- know we want to output it. */
- DECL_DEFER_OUTPUT (fn) = 0;
-
- /* Run the optimizers and output the assembler code for this
- function. */
- rest_of_compilation (fn);
-
- /* Undo the call to ggc_push_context above. */
- if (function_depth > 1)
- ggc_pop_context ();
-
-#if 0
- /* Keep this code around in case we later want to control debug info
- based on whether a type is "used". (jason 1999-11-11) */
-
- if (ctype && TREE_ASM_WRITTEN (fn))
- note_debug_info_needed (ctype);
-#endif
-
- /* If this function is marked with the constructor attribute, add it
- to the list of functions to be called along with constructors
- from static duration objects. */
- if (DECL_STATIC_CONSTRUCTOR (fn))
- static_ctors = tree_cons (NULL_TREE, fn, static_ctors);
-
- /* If this function is marked with the destructor attribute, add it
- to the list of functions to be called along with destructors from
- static duration objects. */
- if (DECL_STATIC_DESTRUCTOR (fn))
- static_dtors = tree_cons (NULL_TREE, fn, static_dtors);
-
- --function_depth;
-
- /* In C++, we should never be saving RTL for the function. */
- my_friendly_assert (!DECL_SAVED_INSNS (fn), 20010903);
-
- /* 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 DECL_RTL for the LABEL_DECL. Walk the
- BLOCK-tree, clearing DECL_RTL for LABEL_DECLs and non-static
- local variables. */
- walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
- clear_decl_rtl,
- NULL);
-
- /* Clear out the RTL for the arguments. */
- for (t = DECL_ARGUMENTS (fn); t; t = TREE_CHAIN (t))
- {
- SET_DECL_RTL (t, NULL_RTX);
- DECL_INCOMING_RTL (t) = NULL_RTX;
- }
-
- if (!(flag_inline_trees && DECL_INLINE (fn)))
- /* DECL_INITIAL must remain nonzero so we know this was an
- actual function definition. */
- DECL_INITIAL (fn) = error_mark_node;
-
- /* Let the error reporting routines know that we're outside a
- function. For a nested function, this value is used in
- pop_cp_function_context and then reset via pop_function_context. */
- current_function_decl = NULL_TREE;
-}
-
-/* Clear out the DECL_RTL for the non-static variables in BLOCK and
- its sub-blocks. */
-
-static tree
-clear_decl_rtl (tree* tp,
- int* walk_subtrees ATTRIBUTE_UNUSED ,
- void* data ATTRIBUTE_UNUSED )
-{
- if (nonstatic_local_decl_p (*tp))
- SET_DECL_RTL (*tp, NULL_RTX);
-
- return NULL_TREE;
+ COPY_DECL_RTL (DECL_RESULT (cfun->decl), current_function_return_value);
}
/* Perform initialization related to this module. */
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 366ea3ab01a..0c729d6118c 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -41,7 +41,7 @@ static tree build_cplus_array_type_1 (tree, tree);
static int list_hash_eq (const void *, const void *);
static hashval_t list_hash_pieces (tree, tree, tree);
static hashval_t list_hash (const void *);
-static cp_lvalue_kind lvalue_p_1 (tree, int, int);
+static cp_lvalue_kind lvalue_p_1 (tree, int);
static tree no_linkage_helper (tree *, int *, void *);
static tree mark_local_for_remap_r (tree *, int *, void *);
static tree cp_unsave_r (tree *, int *, void *);
@@ -60,8 +60,7 @@ static tree handle_init_priority_attribute (tree *, tree, tree, int, bool *);
static cp_lvalue_kind
lvalue_p_1 (tree ref,
- int treat_class_rvalues_as_lvalues,
- int allow_cast_as_lvalue)
+ int treat_class_rvalues_as_lvalues)
{
cp_lvalue_kind op1_lvalue_kind = clk_none;
cp_lvalue_kind op2_lvalue_kind = clk_none;
@@ -85,26 +84,17 @@ lvalue_p_1 (tree ref,
case REALPART_EXPR:
case IMAGPART_EXPR:
return lvalue_p_1 (TREE_OPERAND (ref, 0),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
-
- case NOP_EXPR:
- if (allow_cast_as_lvalue)
- return lvalue_p_1 (TREE_OPERAND (ref, 0),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
- else
- return clk_none;
+ treat_class_rvalues_as_lvalues);
case COMPONENT_REF:
op1_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 0),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
- if (op1_lvalue_kind
- /* The "field" can be a FUNCTION_DECL or an OVERLOAD in some
- situations. */
- && TREE_CODE (TREE_OPERAND (ref, 1)) == FIELD_DECL
- && DECL_C_BIT_FIELD (TREE_OPERAND (ref, 1)))
+ treat_class_rvalues_as_lvalues);
+ if (!op1_lvalue_kind
+ /* The "field" can be a FUNCTION_DECL or an OVERLOAD in some
+ situations. */
+ || TREE_CODE (TREE_OPERAND (ref, 1)) != FIELD_DECL)
+ ;
+ else if (DECL_C_BIT_FIELD (TREE_OPERAND (ref, 1)))
{
/* Clear the ordinary bit. If this object was a class
rvalue we want to preserve that information. */
@@ -112,6 +102,9 @@ lvalue_p_1 (tree ref,
/* The lvalue is for a btifield. */
op1_lvalue_kind |= clk_bitfield;
}
+ else if (DECL_PACKED (TREE_OPERAND (ref, 1)))
+ op1_lvalue_kind |= clk_packed;
+
return op1_lvalue_kind;
case STRING_CST:
@@ -136,20 +129,16 @@ lvalue_p_1 (tree ref,
case MAX_EXPR:
case MIN_EXPR:
op1_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 0),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
+ treat_class_rvalues_as_lvalues);
op2_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 1),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
+ treat_class_rvalues_as_lvalues);
break;
case COND_EXPR:
op1_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 1),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
+ treat_class_rvalues_as_lvalues);
op2_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 2),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
+ treat_class_rvalues_as_lvalues);
break;
case MODIFY_EXPR:
@@ -157,8 +146,7 @@ lvalue_p_1 (tree ref,
case COMPOUND_EXPR:
return lvalue_p_1 (TREE_OPERAND (ref, 1),
- treat_class_rvalues_as_lvalues,
- allow_cast_as_lvalue);
+ treat_class_rvalues_as_lvalues);
case TARGET_EXPR:
return treat_class_rvalues_as_lvalues ? clk_class : clk_none;
@@ -201,27 +189,15 @@ lvalue_p_1 (tree ref,
return op1_lvalue_kind;
}
-/* If REF is an lvalue, returns the kind of lvalue that REF is.
- Otherwise, returns clk_none. Lvalues can be assigned, unless they
- have TREE_READONLY, or unless they are FUNCTION_DECLs. Lvalues can
- have their address taken, unless they have DECL_REGISTER. */
-
-cp_lvalue_kind
-real_lvalue_p (tree ref)
-{
- return lvalue_p_1 (ref, /*treat_class_rvalues_as_lvalues=*/ 0, /*cast*/ 1);
-}
-
/* Returns the kind of lvalue that REF is, in the sense of
[basic.lval]. This function should really be named lvalue_p; it
computes the C++ definition of lvalue. */
cp_lvalue_kind
-real_non_cast_lvalue_p (tree ref)
+real_lvalue_p (tree ref)
{
return lvalue_p_1 (ref,
- /*treat_class_rvalues_as_lvalues=*/0,
- /*allow_cast_as_lvalue=*/0);
+ /*treat_class_rvalues_as_lvalues=*/0);
}
/* This differs from real_lvalue_p in that class rvalues are
@@ -231,14 +207,7 @@ int
lvalue_p (tree ref)
{
return
- (lvalue_p_1 (ref, /*class rvalue ok*/ 1, /*cast*/ 1) != clk_none);
-}
-
-int
-non_cast_lvalue_p (tree ref)
-{
- return
- (lvalue_p_1 (ref, /*class rvalue ok*/ 1, /*cast*/ 0) != clk_none);
+ (lvalue_p_1 (ref, /*class rvalue ok*/ 1) != clk_none);
}
/* Return nonzero if REF is an lvalue valid for this language;
@@ -247,21 +216,12 @@ non_cast_lvalue_p (tree ref)
int
lvalue_or_else (tree ref, const char* string)
{
- int ret = lvalue_p_1 (ref, /* class rvalue ok */ 1, /* cast ok */ 1);
- int win = (ret != clk_none);
- if (! win)
- error ("non-lvalue in %s", string);
- return win;
-}
-
-int
-non_cast_lvalue_or_else (tree ref, const char* string)
-{
- int ret = lvalue_p_1 (ref, /* class rvalue ok */ 1, /* cast ok */ 0);
- int win = (ret != clk_none);
- if (! win)
- error ("non-lvalue in %s", string);
- return win;
+ if (!lvalue_p (ref))
+ {
+ error ("non-lvalue in %s", string);
+ return 0;
+ }
+ return 1;
}
/* Build a TARGET_EXPR, initializing the DECL with the VALUE. */
@@ -368,124 +328,7 @@ get_target_expr (tree init)
return build_target_expr_with_type (init, TREE_TYPE (init));
}
-/* Recursively perform a preorder search EXP for CALL_EXPRs, making
- copies where they are found. Returns a deep copy all nodes transitively
- containing CALL_EXPRs. */
-
-tree
-break_out_calls (tree exp)
-{
- register tree t1, t2 = NULL_TREE;
- register enum tree_code code;
- register int changed = 0;
- register int i;
-
- if (exp == NULL_TREE)
- return exp;
-
- code = TREE_CODE (exp);
-
- if (code == CALL_EXPR)
- return copy_node (exp);
-
- /* Don't try and defeat a save_expr, as it should only be done once. */
- if (code == SAVE_EXPR)
- return exp;
-
- switch (TREE_CODE_CLASS (code))
- {
- default:
- abort ();
-
- case 'c': /* a constant */
- case 't': /* a type node */
- case 'x': /* something random, like an identifier or an ERROR_MARK. */
- return exp;
-
- case 'd': /* A decl node */
- return exp;
-
- case 'b': /* A block node */
- {
- /* Don't know how to handle these correctly yet. Must do a
- break_out_calls on all DECL_INITIAL values for local variables,
- and also break_out_calls on all sub-blocks and sub-statements. */
- abort ();
- }
- return exp;
-
- case 'e': /* an expression */
- case 'r': /* a reference */
- case 's': /* an expression with side effects */
- for (i = TREE_CODE_LENGTH (code) - 1; i >= 0; i--)
- {
- t1 = break_out_calls (TREE_OPERAND (exp, i));
- if (t1 != TREE_OPERAND (exp, i))
- {
- exp = copy_node (exp);
- TREE_OPERAND (exp, i) = t1;
- }
- }
- return exp;
-
- case '<': /* a comparison expression */
- case '2': /* a binary arithmetic expression */
- t2 = break_out_calls (TREE_OPERAND (exp, 1));
- if (t2 != TREE_OPERAND (exp, 1))
- changed = 1;
- case '1': /* a unary arithmetic expression */
- t1 = break_out_calls (TREE_OPERAND (exp, 0));
- if (t1 != TREE_OPERAND (exp, 0))
- changed = 1;
- if (changed)
- {
- if (TREE_CODE_LENGTH (code) == 1)
- return build1 (code, TREE_TYPE (exp), t1);
- else
- return build (code, TREE_TYPE (exp), t1, t2);
- }
- return exp;
- }
-
-}
-/* Construct, lay out and return the type of methods belonging to class
- BASETYPE and whose arguments are described by ARGTYPES and whose values
- are described by RETTYPE. If each type exists already, reuse it. */
-
-tree
-build_cplus_method_type (tree basetype, tree rettype, tree argtypes)
-{
- register tree t;
- tree ptype;
- int hashcode;
-
- /* Make a node of the sort we want. */
- t = make_node (METHOD_TYPE);
-
- TYPE_METHOD_BASETYPE (t) = TYPE_MAIN_VARIANT (basetype);
- TREE_TYPE (t) = rettype;
- ptype = build_pointer_type (basetype);
-
- /* The actual arglist for this function includes a "hidden" argument
- which is "this". Put it into the list of argument types. */
- argtypes = tree_cons (NULL_TREE, ptype, argtypes);
- TYPE_ARG_TYPES (t) = argtypes;
- TREE_SIDE_EFFECTS (argtypes) = 1; /* Mark first argtype as "artificial". */
-
- /* If we already have such a type, use the old one and free this one.
- Note that it also frees up the above cons cell if found. */
- hashcode = TYPE_HASH (basetype) + TYPE_HASH (rettype) +
- type_hash_list (argtypes);
-
- t = type_hash_canon (hashcode, t);
-
- if (!COMPLETE_TYPE_P (t))
- layout_type (t);
-
- return t;
-}
-
static tree
build_cplus_array_type_1 (tree elt_type, tree index_type)
{
@@ -1068,13 +911,6 @@ build_overload (tree decl, tree chain)
return ovl_cons (decl, chain);
}
-int
-is_aggr_type_2 (tree t1, tree t2)
-{
- if (TREE_CODE (t1) != TREE_CODE (t2))
- return 0;
- return IS_AGGR_TYPE (t1) && IS_AGGR_TYPE (t2);
-}
#define PRINT_RING_SIZE 4
@@ -1429,11 +1265,8 @@ break_out_target_exprs (tree t)
return t;
}
-/* Obstack used for allocating nodes in template function and variable
- definitions. */
-
-/* Similar to `build_nt', except that we set TREE_COMPLEXITY to be the
- current line number. */
+/* Similar to `build_nt', but for template definitions of dependent
+ expressions */
tree
build_min_nt (enum tree_code code, ...)
@@ -1459,8 +1292,7 @@ build_min_nt (enum tree_code code, ...)
return t;
}
-/* Similar to `build', except we set TREE_COMPLEXITY to the current
- line-number. */
+/* Similar to `build', but for template definitions. */
tree
build_min (enum tree_code code, tree tt, ...)
@@ -1481,12 +1313,49 @@ build_min (enum tree_code code, tree tt, ...)
{
tree x = va_arg (p, tree);
TREE_OPERAND (t, i) = x;
+ if (x && TREE_SIDE_EFFECTS (x))
+ TREE_SIDE_EFFECTS (t) = 1;
}
va_end (p);
return t;
}
+/* Similar to `build', but for template definitions of non-dependent
+ expressions. NON_DEP is the non-dependent expression that has been
+ built. */
+
+tree
+build_min_non_dep (enum tree_code code, tree non_dep, ...)
+{
+ register tree t;
+ register int length;
+ register int i;
+ va_list p;
+
+ va_start (p, non_dep);
+
+ t = make_node (code);
+ length = TREE_CODE_LENGTH (code);
+ TREE_TYPE (t) = TREE_TYPE (non_dep);
+ TREE_COMPLEXITY (t) = input_line;
+ TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (non_dep);
+
+ for (i = 0; i < length; i++)
+ {
+ tree x = va_arg (p, tree);
+ TREE_OPERAND (t, i) = x;
+ }
+
+ if (code == COMPOUND_EXPR && TREE_CODE (non_dep) != COMPOUND_EXPR)
+ /* This should not be considered a COMPOUND_EXPR, because it
+ resolves to an overload. */
+ COMPOUND_EXPR_OVERLOADED (t) = 1;
+
+ va_end (p);
+ return t;
+}
+
/* Returns an INTEGER_CST (of type `int') corresponding to I.
Multiple calls with the same value of I may or may not yield the
same node; therefore, callers should never modify the node
@@ -1670,6 +1539,30 @@ cp_tree_equal (tree t1, tree t2)
&& same_type_p (TREE_TYPE (TEMPLATE_PARM_DECL (t1)),
TREE_TYPE (TEMPLATE_PARM_DECL (t2))));
+ case TEMPLATE_ID_EXPR:
+ {
+ unsigned ix;
+ tree vec1, vec2;
+
+ if (!cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)))
+ return false;
+ vec1 = TREE_OPERAND (t1, 1);
+ vec2 = TREE_OPERAND (t2, 1);
+
+ if (!vec1 || !vec2)
+ return !vec1 && !vec2;
+
+ if (TREE_VEC_LENGTH (vec1) != TREE_VEC_LENGTH (vec2))
+ return false;
+
+ for (ix = TREE_VEC_LENGTH (vec1); ix--;)
+ if (!cp_tree_equal (TREE_VEC_ELT (vec1, ix),
+ TREE_VEC_ELT (vec2, ix)))
+ return false;
+
+ return true;
+ }
+
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
{
@@ -1858,10 +1751,8 @@ pod_type_p (tree t)
return 1;
if (TYPE_PTR_P (t))
return 1; /* pointer to non-member */
- if (TYPE_PTRMEM_P (t))
- return 1; /* pointer to member object */
- if (TYPE_PTRMEMFUNC_P (t))
- return 1; /* pointer to member function */
+ if (TYPE_PTR_TO_MEMBER_P (t))
+ return 1; /* pointer to member */
if (! CLASS_TYPE_P (t))
return 0; /* other non-class type (reference or function) */
@@ -2134,7 +2025,9 @@ cp_cannot_inline_tree_fn (tree* fnp)
if (!DECL_INLINE (DECL_TEMPLATE_RESULT
(template_for_substitution (fn))))
return 1;
+
fn = *fnp = instantiate_decl (fn, /*defer_ok=*/0);
+
if (TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn)))
return 1;
}
@@ -2254,7 +2147,10 @@ cp_copy_res_decl_for_inlining (tree result,
/* We have a named return value; copy the name and source
position so we can get reasonable debugging information, and
register the return variable as its equivalent. */
- if (TREE_CODE (var) == VAR_DECL)
+ if (TREE_CODE (var) == VAR_DECL
+ /* But not if we're initializing a variable from the
+ enclosing function which already has its own name. */
+ && DECL_NAME (var) == NULL_TREE)
{
DECL_NAME (var) = DECL_NAME (nrv);
DECL_SOURCE_LOCATION (var) = DECL_SOURCE_LOCATION (nrv);
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 6d499d6c35f..32447b6807b 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -44,26 +44,22 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "diagnostic.h"
#include "target.h"
+#include "convert.h"
static tree convert_for_assignment (tree, tree, const char *, tree, int);
static tree cp_pointer_int_sum (enum tree_code, tree, tree);
static tree rationalize_conditional_expr (enum tree_code, tree);
-static int comp_target_parms (tree, tree);
static int comp_ptr_ttypes_real (tree, tree, int);
static int comp_ptr_ttypes_const (tree, tree);
-static int comp_ptr_ttypes_reinterpret (tree, tree);
static bool comp_except_types (tree, tree, bool);
static bool comp_array_types (tree, tree, bool);
static tree common_base_type (tree, tree);
static tree lookup_anon_field (tree, tree);
static tree pointer_diff (tree, tree, tree);
-static tree qualify_type_recursive (tree, tree);
static tree get_delta_difference (tree, tree, int);
-static int comp_cv_target_types (tree, tree, int);
static void casts_away_constness_r (tree *, tree *);
static bool casts_away_constness (tree, tree);
static void maybe_warn_about_returning_address_of_local (tree);
-static tree strip_all_pointer_quals (tree);
static tree lookup_destructor (tree, tree, tree);
/* Return the target type of TYPE, which means return T for:
@@ -77,7 +73,7 @@ target_type (tree type)
|| TREE_CODE (type) == ARRAY_TYPE
|| TREE_CODE (type) == FUNCTION_TYPE
|| TREE_CODE (type) == METHOD_TYPE
- || TREE_CODE (type) == OFFSET_TYPE)
+ || TYPE_PTRMEM_P (type))
type = TREE_TYPE (type);
return type;
}
@@ -169,56 +165,9 @@ type_unknown_p (tree exp)
{
return (TREE_CODE (exp) == OVERLOAD
|| TREE_CODE (exp) == TREE_LIST
- || TREE_TYPE (exp) == unknown_type_node
- /* Until we get the type of non type-dependent expressions
- correct, we can have non-type dependent expressions with
- no type. */
- || (TREE_TYPE (exp)
- && TREE_CODE (TREE_TYPE (exp)) == OFFSET_TYPE
- && TREE_TYPE (TREE_TYPE (exp)) == unknown_type_node));
+ || TREE_TYPE (exp) == unknown_type_node);
}
-/* Return a pointer or pointer to member type similar to T1, with a
- cv-qualification signature that is the union of the cv-qualification
- signatures of T1 and T2: [expr.rel], [expr.eq]. */
-
-static tree
-qualify_type_recursive (tree t1, tree t2)
-{
- if ((TYPE_PTR_P (t1) && TYPE_PTR_P (t2))
- || (TYPE_PTRMEM_P (t1) && TYPE_PTRMEM_P (t2)))
- {
- tree tt1;
- tree tt2;
- tree b1;
- int type_quals;
- tree tgt;
- tree attributes = (*targetm.merge_type_attributes) (t1, t2);
-
- if (TYPE_PTRMEM_P (t1))
- {
- b1 = TYPE_PTRMEM_CLASS_TYPE (t1);
- tt1 = TYPE_PTRMEM_POINTED_TO_TYPE (t1);
- tt2 = TYPE_PTRMEM_POINTED_TO_TYPE (t2);
- }
- else
- {
- b1 = NULL_TREE;
- tt1 = TREE_TYPE (t1);
- tt2 = TREE_TYPE (t2);
- }
-
- type_quals = (cp_type_quals (tt1) | cp_type_quals (tt2));
- tgt = qualify_type_recursive (tt1, tt2);
- tgt = cp_build_qualified_type (tgt, type_quals);
- if (b1)
- t1 = build_ptrmem_type (b1, tgt);
- else
- t1 = build_pointer_type (tgt);
- t1 = build_type_attribute_variant (t1, attributes);
- }
- return t1;
-}
/* Return the common type of two parameter lists.
We assume that comptypes has already been done and returned 1;
@@ -447,16 +396,85 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
}
}
+/* Subroutine of composite_pointer_type to implement the recursive
+ case. See that function for documentation fo the parameters. */
+
+static tree
+composite_pointer_type_r (tree t1, tree t2, const char* location)
+{
+ tree pointee1;
+ tree pointee2;
+ tree result_type;
+ tree attributes;
+
+ /* Determine the types pointed to by T1 and T2. */
+ if (TREE_CODE (t1) == POINTER_TYPE)
+ {
+ pointee1 = TREE_TYPE (t1);
+ pointee2 = TREE_TYPE (t2);
+ }
+ else
+ {
+ pointee1 = TYPE_PTRMEM_POINTED_TO_TYPE (t1);
+ pointee2 = TYPE_PTRMEM_POINTED_TO_TYPE (t2);
+ }
+
+ /* [expr.rel]
+
+ Otherwise, the composite pointer type is a pointer type
+ similar (_conv.qual_) to the type of one of the operands,
+ with a cv-qualification signature (_conv.qual_) that is the
+ union of the cv-qualification signatures of the operand
+ types. */
+ if (same_type_ignoring_top_level_qualifiers_p (pointee1, pointee2))
+ result_type = pointee1;
+ else if ((TREE_CODE (pointee1) == POINTER_TYPE
+ && TREE_CODE (pointee2) == POINTER_TYPE)
+ || (TYPE_PTR_TO_MEMBER_P (pointee1)
+ && TYPE_PTR_TO_MEMBER_P (pointee2)))
+ result_type = composite_pointer_type_r (pointee1, pointee2, location);
+ else
+ {
+ pedwarn ("%s between distinct pointer types `%T' and `%T' "
+ "lacks a cast",
+ location, t1, t2);
+ result_type = void_type_node;
+ }
+ result_type = cp_build_qualified_type (result_type,
+ (cp_type_quals (pointee1)
+ | cp_type_quals (pointee2)));
+ result_type = build_pointer_type (result_type);
+ /* If the original types were pointers to members, so is the
+ result. */
+ if (TYPE_PTR_TO_MEMBER_P (t1))
+ {
+ if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
+ TYPE_PTRMEM_CLASS_TYPE (t2)))
+ pedwarn ("%s between distinct pointer types `%T' and `%T' "
+ "lacks a cast",
+ location, t1, t2);
+ result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1),
+ result_type);
+ }
+
+ /* Merge the attributes. */
+ attributes = (*targetm.merge_type_attributes) (t1, t2);
+ return build_type_attribute_variant (result_type, attributes);
+}
+
/* Return the composite pointer type (see [expr.rel]) for T1 and T2.
ARG1 and ARG2 are the values with those types. The LOCATION is a
- string describing the current location, in case an error occurs. */
+ string describing the current location, in case an error occurs.
+
+ This routine also implements the computation of a common type for
+ pointers-to-members as per [expr.eq]. */
tree
composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
const char* location)
{
- tree result_type;
- tree attributes;
+ tree class1;
+ tree class2;
/* [expr.rel]
@@ -467,16 +485,6 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
if (null_ptr_cst_p (arg2))
return t1;
- /* Deal with pointer-to-member functions in the same way as we deal
- with pointers to functions. */
- if (TYPE_PTRMEMFUNC_P (t1))
- t1 = TYPE_PTRMEMFUNC_FN_TYPE (t1);
- if (TYPE_PTRMEMFUNC_P (t2))
- t2 = TYPE_PTRMEMFUNC_FN_TYPE (t2);
-
- /* Merge the attributes. */
- attributes = (*targetm.merge_type_attributes) (t1, t2);
-
/* We have:
[expr.rel]
@@ -487,45 +495,78 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
and cv2.
If either type is a pointer to void, make sure it is T1. */
- if (VOID_TYPE_P (TREE_TYPE (t2)))
+ if (TREE_CODE (t2) == POINTER_TYPE && VOID_TYPE_P (TREE_TYPE (t2)))
{
tree t;
t = t1;
t1 = t2;
t2 = t;
}
+
/* Now, if T1 is a pointer to void, merge the qualifiers. */
- if (VOID_TYPE_P (TREE_TYPE (t1)))
+ if (TREE_CODE (t1) == POINTER_TYPE && VOID_TYPE_P (TREE_TYPE (t1)))
{
+ tree attributes;
+ tree result_type;
+
if (pedantic && TYPE_PTRFN_P (t2))
pedwarn ("ISO C++ forbids %s between pointer of type `void *' and pointer-to-function", location);
- t1 = TREE_TYPE (t1);
- t2 = TREE_TYPE (t2);
- result_type = cp_build_qualified_type (void_type_node,
- (cp_type_quals (t1)
- | cp_type_quals (t2)));
+ result_type
+ = cp_build_qualified_type (void_type_node,
+ (cp_type_quals (TREE_TYPE (t1))
+ | cp_type_quals (TREE_TYPE (t2))));
result_type = build_pointer_type (result_type);
+ /* Merge the attributes. */
+ attributes = (*targetm.merge_type_attributes) (t1, t2);
+ return build_type_attribute_variant (result_type, attributes);
+ }
+
+ /* [expr.eq] permits the application of a pointer conversion to
+ bring the pointers to a common type. */
+ if (TREE_CODE (t1) == POINTER_TYPE && TREE_CODE (t2) == POINTER_TYPE
+ && CLASS_TYPE_P (TREE_TYPE (t1))
+ && CLASS_TYPE_P (TREE_TYPE (t2))
+ && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (t1),
+ TREE_TYPE (t2)))
+ {
+ class1 = TREE_TYPE (t1);
+ class2 = TREE_TYPE (t2);
+
+ if (DERIVED_FROM_P (class1, class2))
+ t2 = (build_pointer_type
+ (cp_build_qualified_type (class1, TYPE_QUALS (class2))));
+ else if (DERIVED_FROM_P (class2, class1))
+ t1 = (build_pointer_type
+ (cp_build_qualified_type (class2, TYPE_QUALS (class1))));
+ else
+ {
+ error ("%s between distinct pointer types `%T' and `%T' "
+ "lacks a cast", location, t1, t2);
+ return error_mark_node;
+ }
}
- else
+ /* [expr.eq] permits the application of a pointer-to-member
+ conversion to change the class type of one of the types. */
+ else if (TYPE_PTR_TO_MEMBER_P (t1)
+ && !same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
+ TYPE_PTRMEM_CLASS_TYPE (t2)))
{
- tree full1 = qualify_type_recursive (t1, t2);
- tree full2 = qualify_type_recursive (t2, t1);
-
- int val = comp_target_types (full1, full2, 1);
+ class1 = TYPE_PTRMEM_CLASS_TYPE (t1);
+ class2 = TYPE_PTRMEM_CLASS_TYPE (t2);
- if (val > 0)
- result_type = full1;
- else if (val < 0)
- result_type = full2;
+ if (DERIVED_FROM_P (class1, class2))
+ t1 = build_ptrmem_type (class2, TYPE_PTRMEM_POINTED_TO_TYPE (t1));
+ else if (DERIVED_FROM_P (class2, class1))
+ t2 = build_ptrmem_type (class1, TYPE_PTRMEM_POINTED_TO_TYPE (t2));
else
{
- pedwarn ("%s between distinct pointer types `%T' and `%T' lacks a cast",
- location, t1, t2);
- result_type = ptr_type_node;
+ error ("%s between distinct pointer-to-member types `%T' and `%T' "
+ "lacks a cast", location, t1, t2);
+ return error_mark_node;
}
}
- return build_type_attribute_variant (result_type, attributes);
+ return composite_pointer_type_r (t1, t2, location);
}
/* Return the merged type of two types.
@@ -557,8 +598,6 @@ merge_types (tree t1, tree t2)
/* Merge the attributes. */
attributes = (*targetm.merge_type_attributes) (t1, t2);
- /* Treat an enum type as the unsigned integer type of the same width. */
-
if (TYPE_PTRMEMFUNC_P (t1))
t1 = TYPE_PTRMEMFUNC_FN_TYPE (t1);
if (TYPE_PTRMEMFUNC_P (t2))
@@ -591,9 +630,14 @@ merge_types (tree t1, tree t2)
case OFFSET_TYPE:
{
- tree base = TYPE_OFFSET_BASETYPE (t1);
- tree target = merge_types (TREE_TYPE (t1), TREE_TYPE (t2));
- t1 = build_offset_type (base, target);
+ int quals;
+ tree pointee;
+ quals = cp_type_quals (t1);
+ pointee = merge_types (TYPE_PTRMEM_POINTED_TO_TYPE (t1),
+ TYPE_PTRMEM_POINTED_TO_TYPE (t2));
+ t1 = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1),
+ pointee);
+ t1 = cp_build_qualified_type (t1, quals);
break;
}
@@ -664,8 +708,8 @@ merge_types (tree t1, tree t2)
t2 = build_function_type (TREE_TYPE (t2),
TREE_CHAIN (TYPE_ARG_TYPES (t2)));
t3 = merge_types (t1, t2);
- t3 = build_cplus_method_type (basetype, TREE_TYPE (t3),
- TYPE_ARG_TYPES (t3));
+ t3 = build_method_type_directly (basetype, TREE_TYPE (t3),
+ TYPE_ARG_TYPES (t3));
t1 = build_exception_variant (t3, raises);
break;
}
@@ -706,7 +750,6 @@ common_type (tree t1, tree t2)
|| (TYPE_PTRMEMFUNC_P (t1) && TYPE_PTRMEMFUNC_P (t2)))
return composite_pointer_type (t1, t2, error_mark_node, error_mark_node,
"conversion");
-
else
abort ();
}
@@ -857,11 +900,8 @@ comptypes (tree t1, tree t2, int strict)
if (t1 == t2)
return true;
- /* This should never happen. */
- my_friendly_assert (t1 != error_mark_node, 307);
-
/* Suppress errors caused by previously reported errors */
- if (t2 == error_mark_node)
+ if (t1 == error_mark_node || t2 == error_mark_node)
return false;
my_friendly_assert (TYPE_P (t1) && TYPE_P (t2), 20030623);
@@ -995,206 +1035,6 @@ comptypes (tree t1, tree t2, int strict)
return false;
}
-/* Subroutine of comp_target-types. Make sure that the cv-quals change
- only in the same direction as the target type. */
-
-static int
-comp_cv_target_types (tree ttl, tree ttr, int nptrs)
-{
- int t;
-
- if (!at_least_as_qualified_p (ttl, ttr)
- && !at_least_as_qualified_p (ttr, ttl))
- /* The qualifications are incomparable. */
- return 0;
-
- if (TYPE_MAIN_VARIANT (ttl) == TYPE_MAIN_VARIANT (ttr))
- return more_qualified_p (ttr, ttl) ? -1 : 1;
-
- t = comp_target_types (ttl, ttr, nptrs);
- if ((t == 1 && at_least_as_qualified_p (ttl, ttr))
- || (t == -1 && at_least_as_qualified_p (ttr, ttl)))
- return t;
-
- return 0;
-}
-
-/* Return 1 or -1 if TTL and TTR are pointers to types that are equivalent,
- ignoring their qualifiers, 0 if not. Return 1 means that TTR can be
- converted to TTL. Return -1 means that TTL can be converted to TTR but
- not vice versa.
-
- NPTRS is the number of pointers we can strip off and keep cool.
- This is used to permit (for aggr A, aggr B) A, B* to convert to A*,
- but to not permit B** to convert to A**.
-
- This should go away. Callers should use can_convert or something
- similar instead. (jason 17 Apr 1997) */
-
-int
-comp_target_types (tree ttl, tree ttr, int nptrs)
-{
- ttl = TYPE_MAIN_VARIANT (ttl);
- ttr = TYPE_MAIN_VARIANT (ttr);
- if (same_type_p (ttl, ttr))
- return 1;
-
- if (TREE_CODE (ttr) != TREE_CODE (ttl))
- return 0;
-
- if ((TREE_CODE (ttr) == POINTER_TYPE
- || TREE_CODE (ttr) == REFERENCE_TYPE)
- /* If we get a pointer with nptrs == 0, we don't allow any tweaking
- of the type pointed to. This is necessary for reference init
- semantics. We won't get here from a previous call with nptrs == 1;
- for multi-level pointers we end up in comp_ptr_ttypes. */
- && nptrs > 0)
- {
- int is_ptr = TREE_CODE (ttr) == POINTER_TYPE;
-
- ttl = TREE_TYPE (ttl);
- ttr = TREE_TYPE (ttr);
-
- if (is_ptr)
- {
- if (TREE_CODE (ttl) == UNKNOWN_TYPE
- || TREE_CODE (ttr) == UNKNOWN_TYPE)
- return 1;
- else if (TREE_CODE (ttl) == VOID_TYPE
- && TREE_CODE (ttr) != FUNCTION_TYPE
- && TREE_CODE (ttr) != METHOD_TYPE
- && TREE_CODE (ttr) != OFFSET_TYPE)
- return 1;
- else if (TREE_CODE (ttr) == VOID_TYPE
- && TREE_CODE (ttl) != FUNCTION_TYPE
- && TREE_CODE (ttl) != METHOD_TYPE
- && TREE_CODE (ttl) != OFFSET_TYPE)
- return -1;
- else if (TREE_CODE (ttl) == POINTER_TYPE
- || TREE_CODE (ttl) == ARRAY_TYPE)
- {
- if (comp_ptr_ttypes (ttl, ttr))
- return 1;
- else if (comp_ptr_ttypes (ttr, ttl))
- return -1;
- return 0;
- }
- }
-
- /* Const and volatile mean something different for function types,
- so the usual checks are not appropriate. */
- if (TREE_CODE (ttl) == FUNCTION_TYPE || TREE_CODE (ttl) == METHOD_TYPE)
- return comp_target_types (ttl, ttr, nptrs - 1);
-
- return comp_cv_target_types (ttl, ttr, nptrs - 1);
- }
-
- my_friendly_assert (TREE_CODE (ttr) != ARRAY_TYPE, 20030617);
- if (TREE_CODE (ttr) == FUNCTION_TYPE || TREE_CODE (ttr) == METHOD_TYPE)
- {
- tree argsl, argsr;
- int saw_contra = 0;
-
- if (pedantic)
- {
- if (!same_type_p (TREE_TYPE (ttl), TREE_TYPE (ttr)))
- return 0;
- }
- else
- {
- switch (comp_target_types (TREE_TYPE (ttl), TREE_TYPE (ttr), -1))
- {
- case 0:
- return 0;
- case -1:
- saw_contra = 1;
- }
- }
-
- argsl = TYPE_ARG_TYPES (ttl);
- argsr = TYPE_ARG_TYPES (ttr);
-
- /* Compare 'this' here, not in comp_target_parms. */
- if (TREE_CODE (ttr) == METHOD_TYPE)
- {
- tree tl = TYPE_METHOD_BASETYPE (ttl);
- tree tr = TYPE_METHOD_BASETYPE (ttr);
-
- if (!same_or_base_type_p (tr, tl))
- {
- if (same_or_base_type_p (tl, tr))
- saw_contra = 1;
- else
- return 0;
- }
-
- argsl = TREE_CHAIN (argsl);
- argsr = TREE_CHAIN (argsr);
- }
-
- switch (comp_target_parms (argsl, argsr))
- {
- case 0:
- return 0;
- case -1:
- saw_contra = 1;
- }
-
- return saw_contra ? -1 : 1;
- }
- /* for C++ */
- else if (TREE_CODE (ttr) == OFFSET_TYPE)
- {
- int base;
-
- /* Contravariance: we can assign a pointer to base member to a pointer
- to derived member. Note difference from simple pointer case, where
- we can pass a pointer to derived to a pointer to base. */
- if (same_or_base_type_p (TYPE_OFFSET_BASETYPE (ttr),
- TYPE_OFFSET_BASETYPE (ttl)))
- base = 1;
- else if (same_or_base_type_p (TYPE_OFFSET_BASETYPE (ttl),
- TYPE_OFFSET_BASETYPE (ttr)))
- {
- tree tmp = ttl;
- ttl = ttr;
- ttr = tmp;
- base = -1;
- }
- else
- return 0;
-
- ttl = TREE_TYPE (ttl);
- ttr = TREE_TYPE (ttr);
-
- if (TREE_CODE (ttl) == POINTER_TYPE
- || TREE_CODE (ttl) == ARRAY_TYPE)
- {
- if (comp_ptr_ttypes (ttl, ttr))
- return base;
- return 0;
- }
- else
- {
- if (comp_cv_target_types (ttl, ttr, nptrs) == 1)
- return base;
- return 0;
- }
- }
- else if (IS_AGGR_TYPE (ttl))
- {
- if (nptrs < 0)
- return 0;
- if (same_or_base_type_p (ttl, ttr))
- return 1;
- if (same_or_base_type_p (ttr, ttl))
- return -1;
- return 0;
- }
-
- return 0;
-}
-
/* Returns 1 if TYPE1 is at least as qualified as TYPE2. */
bool
@@ -1327,97 +1167,33 @@ compparms (tree parms1, tree parms2)
they fail to match. */
if (!t1 || !t2)
return false;
- if (!same_type_p (TREE_VALUE (t2), TREE_VALUE (t1)))
+ if (!same_type_p (TREE_VALUE (t1), TREE_VALUE (t2)))
return false;
}
return true;
}
-/* This really wants return whether or not parameter type lists
- would make their owning functions assignment compatible or not.
-
- The return value is like for comp_target_types.
-
- This should go away, possibly with the exception of the empty parmlist
- conversion; there are no conversions between function types in C++.
- (jason 17 Apr 1997) */
-
-static int
-comp_target_parms (tree parms1, tree parms2)
-{
- register tree t1 = parms1, t2 = parms2;
- int warn_contravariance = 0;
-
- /* In C, an unspecified parmlist matches any specified parmlist
- whose argument types don't need default promotions. This is not
- true for C++, but let's do it anyway for unfixed headers. */
-
- if (t1 == 0 && t2 != 0)
- {
- pedwarn ("ISO C++ prohibits conversion from `%#T' to `(...)'",
- parms2);
- return self_promoting_args_p (t2);
- }
- if (t2 == 0)
- return self_promoting_args_p (t1);
-
- for (; t1 || t2; t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
- {
- tree p1, p2;
-
- /* If one parmlist is shorter than the other, they fail to match. */
- if (!t1 || !t2)
- return 0;
- p1 = TREE_VALUE (t1);
- p2 = TREE_VALUE (t2);
- if (same_type_p (p1, p2))
- continue;
-
- if (pedantic)
- return 0;
-
- if ((TREE_CODE (p1) == POINTER_TYPE && TREE_CODE (p2) == POINTER_TYPE)
- || (TREE_CODE (p1) == REFERENCE_TYPE
- && TREE_CODE (p2) == REFERENCE_TYPE))
- {
- /* The following is wrong for contravariance,
- but many programs depend on it. */
- if (TREE_TYPE (p1) == void_type_node)
- continue;
- if (TREE_TYPE (p2) == void_type_node)
- {
- warn_contravariance = 1;
- continue;
- }
- if (IS_AGGR_TYPE (TREE_TYPE (p1))
- && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (p1),
- TREE_TYPE (p2)))
- return 0;
- }
- /* Note backwards order due to contravariance. */
- if (comp_target_types (p2, p1, 1) <= 0)
- {
- if (comp_target_types (p1, p2, 1) > 0)
- {
- warn_contravariance = 1;
- continue;
- }
- return 0;
- }
- }
- return warn_contravariance ? -1 : 1;
-}
+/* Process a sizeof or alignof expression where the operand is a
+ type. */
+
tree
-cxx_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
+cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
{
enum tree_code type_code;
tree value;
const char *op_name;
my_friendly_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR, 20020720);
+ if (type == error_mark_node)
+ return error_mark_node;
+
if (processing_template_decl)
- return build_min (op, size_type_node, type);
+ {
+ value = build_min (op, size_type_node, type);
+ TREE_READONLY (value) = 1;
+ return value;
+ }
op_name = operator_name_info[(int) op].name;
@@ -1430,42 +1206,52 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
pedwarn ("invalid application of `%s' to a member function", op_name);
value = size_one_node;
}
- else if (type_code == OFFSET_TYPE)
- {
- if (complain)
- error ("invalid application of `%s' to non-static member", op_name);
- value = size_zero_node;
- }
else
value = c_sizeof_or_alignof_type (complete_type (type), op, complain);
return value;
}
+/* Process a sizeof or alignof expression where the operand is an
+ expression. */
+
tree
-expr_sizeof (tree e)
+cxx_sizeof_or_alignof_expr (tree e, enum tree_code op)
{
+ const char *op_name = operator_name_info[(int) op].name;
+
+ if (e == error_mark_node)
+ return error_mark_node;
+
if (processing_template_decl)
- return build_min (SIZEOF_EXPR, size_type_node, e);
-
+ {
+ e = build_min (op, size_type_node, e);
+ TREE_SIDE_EFFECTS (e) = 0;
+ TREE_READONLY (e) = 1;
+
+ return e;
+ }
+
if (TREE_CODE (e) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (e, 1)))
- error ("sizeof applied to a bit-field");
- if (is_overloaded_fn (e))
{
- pedwarn ("ISO C++ forbids applying `sizeof' to an expression of function type");
- return c_sizeof (char_type_node);
+ error ("invalid application of `%s' to a bit-field", op_name);
+ e = char_type_node;
+ }
+ else if (is_overloaded_fn (e))
+ {
+ pedwarn ("ISO C++ forbids applying `%s' to an expression of function type", op_name);
+ e = char_type_node;
}
else if (type_unknown_p (e))
{
cxx_incomplete_type_error (e, TREE_TYPE (e));
- return c_sizeof (char_type_node);
+ e = char_type_node;
}
-
- if (e == error_mark_node)
- return e;
-
- return cxx_sizeof (TREE_TYPE (e));
+ else
+ e = TREE_TYPE (e);
+
+ return cxx_sizeof_or_alignof_type (e, op, true);
}
@@ -1534,20 +1320,8 @@ decay_conversion (tree exp)
tree ptrtype;
if (TREE_CODE (exp) == INDIRECT_REF)
- {
- /* Stripping away the INDIRECT_REF is not the right
- thing to do for references... */
- tree inner = TREE_OPERAND (exp, 0);
- if (TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE)
- {
- inner = build1 (CONVERT_EXPR,
- build_pointer_type (TREE_TYPE
- (TREE_TYPE (inner))),
- inner);
- TREE_CONSTANT (inner) = TREE_CONSTANT (TREE_OPERAND (inner, 0));
- }
- return cp_convert (build_pointer_type (TREE_TYPE (type)), inner);
- }
+ return build_nop (build_pointer_type (TREE_TYPE (type)),
+ TREE_OPERAND (exp, 0));
if (TREE_CODE (exp) == COMPOUND_EXPR)
{
@@ -1805,7 +1579,10 @@ build_class_member_access_expr (tree object, tree member,
member_scope = TYPE_CONTEXT (member_scope);
if (!member_scope || !DERIVED_FROM_P (member_scope, object_type))
{
- error ("`%D' is not a member of `%T'", member, object_type);
+ if (TREE_CODE (member) == FIELD_DECL)
+ error ("invalid use of nonstatic data member '%E'", member);
+ else
+ error ("`%D' is not a member of `%T'", member, object_type);
return error_mark_node;
}
@@ -2156,8 +1933,8 @@ finish_class_member_access_expr (tree object, tree name)
expr = build_class_member_access_expr (object, member, access_path,
/*preserve_reference=*/false);
if (processing_template_decl && expr != error_mark_node)
- return build_min (COMPONENT_REF, TREE_TYPE (expr), orig_object,
- orig_name);
+ return build_min_non_dep (COMPONENT_REF, expr,
+ orig_object, orig_name);
return expr;
}
@@ -2214,7 +1991,7 @@ build_x_indirect_ref (tree expr, const char *errorstring)
rval = build_indirect_ref (expr, errorstring);
if (processing_template_decl && rval != error_mark_node)
- return build_min (INDIRECT_REF, TREE_TYPE (rval), orig_expr);
+ return build_min_non_dep (INDIRECT_REF, rval, orig_expr);
else
return rval;
}
@@ -2274,7 +2051,7 @@ build_indirect_ref (tree ptr, const char *errorstring)
}
/* `pointer' won't be an error_mark_node if we were given a
pointer to member, so it's cool to check for this here. */
- else if (TYPE_PTRMEM_P (type) || TYPE_PTRMEMFUNC_P (type))
+ else if (TYPE_PTR_TO_MEMBER_P (type))
error ("invalid use of `%s' on pointer to member", errorstring);
else if (pointer != error_mark_node)
{
@@ -2752,8 +2529,12 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags)
if (!COMPLETE_TYPE_P (complete_type (type)))
{
- error ("parameter type of called function is incomplete");
- parmval = val;
+ if (fndecl)
+ error ("parameter %P of `%D' has incomplete type `%T'",
+ i, fndecl, type);
+ else
+ error ("parameter %P has incomplete type `%T'", i, type);
+ parmval = error_mark_node;
}
else
{
@@ -2857,7 +2638,7 @@ build_x_binary_op (enum tree_code code, tree arg1, tree arg2)
expr = build_new_op (code, LOOKUP_NORMAL, arg1, arg2, NULL_TREE);
if (processing_template_decl && expr != error_mark_node)
- return build_min (code, TREE_TYPE (expr), orig_arg1, orig_arg2);
+ return build_min_non_dep (code, expr, orig_arg1, orig_arg2);
return expr;
}
@@ -3007,7 +2788,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
/* Subtraction of two similar pointers.
We must subtract them as integers, then divide by object size. */
if (code0 == POINTER_TYPE && code1 == POINTER_TYPE
- && comp_target_types (type0, type1, 1))
+ && same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (type0),
+ TREE_TYPE (type1)))
return pointer_diff (op0, op1, common_type (type0, type1));
/* Handle pointer minus int. Just like pointer plus int. */
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
@@ -3053,7 +2835,6 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
break;
case BIT_AND_EXPR:
- case BIT_ANDTC_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
@@ -3169,12 +2950,15 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
&& (code1 == INTEGER_TYPE || code1 == REAL_TYPE
|| code1 == COMPLEX_TYPE))
short_compare = 1;
- else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE)
+ else if ((code0 == POINTER_TYPE && code1 == POINTER_TYPE)
+ || (TYPE_PTRMEM_P (type0) && TYPE_PTRMEM_P (type1)))
result_type = composite_pointer_type (type0, type1, op0, op1,
"comparison");
- else if (code0 == POINTER_TYPE && null_ptr_cst_p (op1))
+ else if ((code0 == POINTER_TYPE || TYPE_PTRMEM_P (type0))
+ && null_ptr_cst_p (op1))
result_type = type0;
- else if (code1 == POINTER_TYPE && null_ptr_cst_p (op0))
+ else if ((code1 == POINTER_TYPE || TYPE_PTRMEM_P (type1))
+ && null_ptr_cst_p (op0))
result_type = type1;
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
@@ -3443,7 +3227,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
}
if ((short_compare || code == MIN_EXPR || code == MAX_EXPR)
- && warn_sign_compare)
+ && warn_sign_compare
+ /* Do not warn until the template is instantiated; we cannot
+ bound the ranges of the arguments until that point. */
+ && !processing_template_decl)
{
int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0));
int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1));
@@ -3650,8 +3437,6 @@ pointer_diff (register tree op0, register tree op1, register tree ptrtype)
pedwarn ("ISO C++ forbids using pointer to a function in subtraction");
if (TREE_CODE (target_type) == METHOD_TYPE)
pedwarn ("ISO C++ forbids using pointer to a method in subtraction");
- if (TREE_CODE (target_type) == OFFSET_TYPE)
- pedwarn ("ISO C++ forbids using pointer to a member in subtraction");
}
/* First do the subtraction as integers;
@@ -3665,12 +3450,9 @@ pointer_diff (register tree op0, register tree op1, register tree ptrtype)
if (!COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (op1))))
error ("invalid use of a pointer to an incomplete type in pointer arithmetic");
- op1 = ((TREE_CODE (target_type) == VOID_TYPE
- || TREE_CODE (target_type) == FUNCTION_TYPE
- || TREE_CODE (target_type) == METHOD_TYPE
- || TREE_CODE (target_type) == OFFSET_TYPE)
- ? integer_one_node
- : size_in_bytes (target_type));
+ op1 = (TYPE_PTROB_P (ptrtype)
+ ? size_in_bytes (target_type)
+ : integer_one_node);
/* Do the division. */
@@ -3756,7 +3538,8 @@ build_x_unary_op (enum tree_code code, tree xarg)
}
if (processing_template_decl && exp != error_mark_node)
- return build_min (code, TREE_TYPE (exp), orig_expr);
+ return build_min_non_dep (code, exp, orig_expr,
+ /*For {PRE,POST}{INC,DEC}REMENT_EXPR*/NULL_TREE);
return exp;
}
@@ -3799,9 +3582,7 @@ build_address (tree t)
if (error_operand_p (t) || !cxx_mark_addressable (t))
return error_mark_node;
- addr = build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (t)),
- t);
+ addr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (t)), t);
if (staticp (t))
TREE_CONSTANT (addr) = 1;
@@ -3901,7 +3682,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
break;
case TRUTH_NOT_EXPR:
- arg = cp_convert (boolean_type_node, arg);
+ arg = perform_implicit_conversion (boolean_type_node, arg);
val = invert_truthvalue (arg);
if (arg != error_mark_node)
return val;
@@ -3993,7 +3774,6 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
if (TREE_CODE (argtype) == POINTER_TYPE)
{
- enum tree_code tmp = TREE_CODE (TREE_TYPE (argtype));
tree type = complete_type (TREE_TYPE (argtype));
if (!COMPLETE_OR_VOID_TYPE_P (type))
@@ -4002,8 +3782,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
|| code == POSTINCREMENT_EXPR)
? "increment" : "decrement"), TREE_TYPE (argtype));
else if ((pedantic || warn_pointer_arith)
- && (tmp == FUNCTION_TYPE || tmp == METHOD_TYPE
- || tmp == VOID_TYPE || tmp == OFFSET_TYPE))
+ && !TYPE_PTROB_P (argtype))
pedwarn ("ISO C++ forbids %sing a pointer of type `%T'",
((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
@@ -4066,13 +3845,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
error ("invalid use of `--' on bool variable `%D'", arg);
return error_mark_node;
}
-#if 0
- /* This will only work if someone can convince Kenner to accept
- my patch to expand_increment. (jason) */
- val = build (code, TREE_TYPE (arg), arg, inc);
-#else
val = boolean_increment (code, arg);
-#endif
}
else
val = build (code, TREE_TYPE (arg), arg, inc);
@@ -4086,6 +3859,10 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
regardless of NOCONVERT. */
argtype = lvalue_type (arg);
+
+ if (TREE_CODE (arg) == OFFSET_REF)
+ goto offset_ref;
+
if (TREE_CODE (argtype) == REFERENCE_TYPE)
{
arg = build1
@@ -4177,9 +3954,10 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
" Say `&%T::%D'",
base, name);
}
- arg = build_offset_ref (base, name);
+ arg = build_offset_ref (base, name, /*address_p=*/true);
}
-
+
+ offset_ref:
if (type_unknown_p (arg))
return build1 (ADDR_EXPR, unknown_type_node, arg);
@@ -4215,7 +3993,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
is an error. */
else if (TREE_CODE (argtype) != FUNCTION_TYPE
&& TREE_CODE (argtype) != METHOD_TYPE
- && !non_cast_lvalue_or_else (arg, "unary `&'"))
+ && !lvalue_or_else (arg, "unary `&'"))
return error_mark_node;
if (argtype != error_mark_node)
@@ -4224,12 +4002,24 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
{
tree addr;
- if (TREE_CODE (arg) == COMPONENT_REF
- && TREE_CODE (TREE_OPERAND (arg, 1)) == BASELINK)
- arg = BASELINK_FUNCTIONS (TREE_OPERAND (arg, 1));
-
if (TREE_CODE (arg) != COMPONENT_REF)
addr = build_address (arg);
+ else if (TREE_CODE (TREE_OPERAND (arg, 1)) == BASELINK)
+ {
+ tree fn = BASELINK_FUNCTIONS (TREE_OPERAND (arg, 1));
+
+ /* We can only get here with a single static member
+ function. */
+ my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL
+ && DECL_STATIC_FUNCTION_P (fn),
+ 20030906);
+ mark_used (fn);
+ addr = build_address (fn);
+ if (TREE_SIDE_EFFECTS (TREE_OPERAND (arg, 0)))
+ /* Do not lose object's side effects. */
+ addr = build (COMPOUND_EXPR, TREE_TYPE (addr),
+ TREE_OPERAND (arg, 0), addr);
+ }
else if (DECL_C_BIT_FIELD (TREE_OPERAND (arg, 1)))
{
error ("attempt to take address of bit-field structure member `%D'",
@@ -4248,8 +4038,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
ba_check, NULL);
rval = build_base_path (PLUS_EXPR, rval, binfo, 1);
- rval = build1 (NOP_EXPR, argtype, rval);
- TREE_CONSTANT (rval) = TREE_CONSTANT (TREE_OPERAND (rval, 0));
+ rval = build_nop (argtype, rval);
addr = fold (build (PLUS_EXPR, argtype, rval,
cp_convert (argtype, byte_position (field))));
}
@@ -4332,11 +4121,8 @@ unary_complex_lvalue (enum tree_code code, tree arg)
if (TREE_CODE (TREE_TYPE (arg)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (arg)) == METHOD_TYPE
- || TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE)
+ || TREE_CODE (arg) == OFFSET_REF)
{
- /* The representation of something of type OFFSET_TYPE
- is really the representation of a pointer to it.
- Here give the representation its true type. */
tree t;
my_friendly_assert (TREE_CODE (arg) != SCOPE_REF, 313);
@@ -4503,13 +4289,31 @@ build_x_conditional_expr (tree ifexp, tree op1, tree op2)
expr = build_conditional_expr (ifexp, op1, op2);
if (processing_template_decl && expr != error_mark_node)
- return build_min (COND_EXPR, TREE_TYPE (expr),
- orig_ifexp, orig_op1, orig_op2);
+ return build_min_non_dep (COND_EXPR, expr,
+ orig_ifexp, orig_op1, orig_op2);
return expr;
}
-/* Handle overloading of the ',' operator when needed. Otherwise,
- this function just builds an expression list. */
+/* Given a list of expressions, return a compound expression
+ that performs them all and returns the value of the last of them. */
+
+tree build_x_compound_expr_from_list (tree list, const char *msg)
+{
+ tree expr = TREE_VALUE (list);
+
+ if (TREE_CHAIN (list))
+ {
+ if (msg)
+ pedwarn ("%s expression list treated as compound expression", msg);
+
+ for (list = TREE_CHAIN (list); list; list = TREE_CHAIN (list))
+ expr = build_x_compound_expr (expr, TREE_VALUE (list));
+ }
+
+ return expr;
+}
+
+/* Handle overloading of the ',' operator when needed. */
tree
build_x_compound_expr (tree op1, tree op2)
@@ -4529,78 +4333,52 @@ build_x_compound_expr (tree op1, tree op2)
result = build_new_op (COMPOUND_EXPR, LOOKUP_NORMAL, op1, op2, NULL_TREE);
if (!result)
- {
- if (! TREE_SIDE_EFFECTS (op1))
- {
- /* FIXME: This test should be in the implicit cast to void
- of the LHS. */
- /* the left-hand operand of a comma expression is like an expression
- statement: we should warn if it doesn't have any side-effects,
- unless it was explicitly cast to (void). */
- if (warn_unused_value
- && !(TREE_CODE (op1) == CONVERT_EXPR
- && VOID_TYPE_P (TREE_TYPE (op1))))
- warning("left-hand operand of comma expression has no effect");
- }
- result = build_compound_expr (tree_cons (NULL_TREE,
- op1,
- build_tree_list (NULL_TREE,
- op2)));
- }
+ result = build_compound_expr (op1, op2);
if (processing_template_decl && result != error_mark_node)
- return build_min (COMPOUND_EXPR, TREE_TYPE (result),
- orig_op1, orig_op2);
+ return build_min_non_dep (COMPOUND_EXPR, result, orig_op1, orig_op2);
+
return result;
}
-/* Given a list of expressions, return a compound expression
- that performs them all and returns the value of the last of them. */
+/* Build a compound expression. */
tree
-build_compound_expr (tree list)
+build_compound_expr (tree lhs, tree rhs)
{
- register tree rest;
- tree first;
-
- TREE_VALUE (list) = decl_constant_value (TREE_VALUE (list));
-
- if (TREE_CHAIN (list) == 0)
+ lhs = decl_constant_value (lhs);
+ lhs = convert_to_void (lhs, "left-hand operand of comma");
+
+ if (lhs == error_mark_node || rhs == error_mark_node)
+ return error_mark_node;
+
+ if (TREE_CODE (rhs) == TARGET_EXPR)
{
- /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
- Strip such NOP_EXPRs, since LIST is used in non-lvalue context. */
- if (TREE_CODE (list) == NOP_EXPR
- && TREE_TYPE (list) == TREE_TYPE (TREE_OPERAND (list, 0)))
- list = TREE_OPERAND (list, 0);
-
- return TREE_VALUE (list);
+ /* If the rhs is a TARGET_EXPR, then build the compound
+ expression inside the target_expr's initializer. This
+ helps the compiler to eliminate unncessary temporaries. */
+ tree init = TREE_OPERAND (rhs, 1);
+
+ init = build (COMPOUND_EXPR, TREE_TYPE (init), lhs, init);
+ TREE_OPERAND (rhs, 1) = init;
+
+ return rhs;
}
-
- first = TREE_VALUE (list);
- first = convert_to_void (first, "left-hand operand of comma");
- if (first == error_mark_node)
- return error_mark_node;
- rest = build_compound_expr (TREE_CHAIN (list));
- if (rest == error_mark_node)
- return error_mark_node;
-
- /* When pedantic, a compound expression cannot be a constant expression. */
- if (! TREE_SIDE_EFFECTS (first) && ! pedantic)
- return rest;
-
- return build (COMPOUND_EXPR, TREE_TYPE (rest), first, rest);
+ return build (COMPOUND_EXPR, TREE_TYPE (rhs), lhs, rhs);
}
/* Issue an error message if casting from SRC_TYPE to DEST_TYPE casts
- away constness. */
+ away constness. DESCRIPTION explains what operation is taking
+ place. */
static void
-check_for_casting_away_constness (tree src_type, tree dest_type)
+check_for_casting_away_constness (tree src_type, tree dest_type,
+ const char *description)
{
if (casts_away_constness (src_type, dest_type))
- error ("static_cast from type `%T' to type `%T' casts away constness",
- src_type, dest_type);
+ error ("%s from type `%T' to type `%T' casts away constness",
+ description, src_type, dest_type);
}
/* Return an expression representing static_cast<TYPE>(EXPR). */
@@ -4616,8 +4394,10 @@ build_static_cast (tree type, tree expr)
if (processing_template_decl)
{
- tree t = build_min (STATIC_CAST_EXPR, type, expr);
- return t;
+ expr = build_min (STATIC_CAST_EXPR, type, expr);
+ /* We don't know if it will or will not have side effects. */
+ TREE_SIDE_EFFECTS (expr) = 1;
+ return expr;
}
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
@@ -4651,19 +4431,20 @@ build_static_cast (tree type, tree expr)
if (TREE_CODE (type) == REFERENCE_TYPE
&& CLASS_TYPE_P (TREE_TYPE (type))
&& CLASS_TYPE_P (intype)
- && real_non_cast_lvalue_p (expr)
+ && real_lvalue_p (expr)
&& DERIVED_FROM_P (intype, TREE_TYPE (type))
&& can_convert (build_pointer_type (TYPE_MAIN_VARIANT (intype)),
build_pointer_type (TYPE_MAIN_VARIANT
(TREE_TYPE (type))))
&& at_least_as_qualified_p (TREE_TYPE (type), intype))
{
- /* At this point we have checked all of the conditions except
- that B is not a virtual base class of D. That will be
- checked by build_base_path. */
- tree base = lookup_base (TREE_TYPE (type), intype, ba_any, NULL);
+ /* There is a standard conversion from "D*" to "B*" even if "B"
+ is ambiguous or inaccessible. Therefore, we ask lookup_base
+ to check these conditions. */
+ tree base = lookup_base (TREE_TYPE (type), intype, ba_check, NULL);
- /* Convert from B* to D*. */
+ /* Convert from "B*" to "D*". This function will check that "B"
+ is not a virtual base of "D". */
expr = build_base_path (MINUS_EXPR, build_address (expr),
base, /*nonnull=*/false);
/* Convert the pointer to a reference -- but then remember that
@@ -4707,9 +4488,10 @@ build_static_cast (tree type, tree expr)
converted to an enumeration type. */
|| (INTEGRAL_OR_ENUMERATION_TYPE_P (type)
&& INTEGRAL_OR_ENUMERATION_TYPE_P (intype)))
- /* Really, build_c_cast should defer to this function rather
- than the other way around. */
- return build_c_cast (type, expr);
+ /* Really, build_c_cast should defer to this function rather
+ than the other way around. */
+ return build_c_cast (type, expr);
+
if (TYPE_PTR_P (type) && TYPE_PTR_P (intype)
&& CLASS_TYPE_P (TREE_TYPE (type))
&& CLASS_TYPE_P (TREE_TYPE (intype))
@@ -4720,11 +4502,12 @@ build_static_cast (tree type, tree expr)
{
tree base;
- check_for_casting_away_constness (intype, type);
- base = lookup_base (TREE_TYPE (type), TREE_TYPE (intype),
- ba_check | ba_quiet, NULL);
+ check_for_casting_away_constness (intype, type, "static_cast");
+ base = lookup_base (TREE_TYPE (type), TREE_TYPE (intype), ba_check,
+ NULL);
return build_base_path (MINUS_EXPR, expr, base, /*nonnull=*/false);
}
+
if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
|| (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
{
@@ -4752,15 +4535,18 @@ build_static_cast (tree type, tree expr)
}
if (can_convert (t1, t2))
{
- check_for_casting_away_constness (intype, type);
+ check_for_casting_away_constness (intype, type, "static_cast");
if (TYPE_PTRMEM_P (type))
{
+ tree delta;
+
if (TREE_CODE (expr) == PTRMEM_CST)
expr = cplus_expand_constant (expr);
- expr = cp_build_binary_op (PLUS_EXPR,
- cp_convert (ptrdiff_type_node, expr),
- get_delta_difference (c1, c2,
- /*force=*/1));
+ delta = get_delta_difference (c1, c2, /*force=*/1);
+ if (!integer_zerop (delta))
+ expr = cp_build_binary_op (PLUS_EXPR,
+ build_nop (ptrdiff_type_node, expr),
+ delta);
return build_nop (type, expr);
}
else
@@ -4779,7 +4565,7 @@ build_static_cast (tree type, tree expr)
&& VOID_TYPE_P (TREE_TYPE (intype))
&& TYPE_PTROB_P (type))
{
- check_for_casting_away_constness (intype, type);
+ check_for_casting_away_constness (intype, type, "static_cast");
return build_nop (type, expr);
}
@@ -4798,6 +4584,11 @@ build_reinterpret_cast (tree type, tree expr)
if (processing_template_decl)
{
tree t = build_min (REINTERPRET_CAST_EXPR, type, expr);
+
+ if (!TREE_SIDE_EFFECTS (t)
+ && type_dependent_expression_p (expr))
+ /* There might turn out to be side effects inside expr. */
+ TREE_SIDE_EFFECTS (t) = 1;
return t;
}
@@ -4850,10 +4641,7 @@ build_reinterpret_cast (tree type, tree expr)
else if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
|| (TYPE_PTROBV_P (type) && TYPE_PTROBV_P (intype)))
{
- if (! comp_ptr_ttypes_reinterpret (TREE_TYPE (type), TREE_TYPE (intype)))
- pedwarn ("reinterpret_cast from `%T' to `%T' casts away const (or volatile)",
- intype, type);
-
+ check_for_casting_away_constness (intype, type, "reinterpret_cast");
expr = decl_constant_value (expr);
return fold (build1 (NOP_EXPR, type, expr));
}
@@ -4885,6 +4673,11 @@ build_const_cast (tree type, tree expr)
if (processing_template_decl)
{
tree t = build_min (CONST_CAST_EXPR, type, expr);
+
+ if (!TREE_SIDE_EFFECTS (t)
+ && type_dependent_expression_p (expr))
+ /* There might turn out to be side effects inside expr. */
+ TREE_SIDE_EFFECTS (t) = 1;
return t;
}
@@ -4926,8 +4719,9 @@ build_const_cast (tree type, tree expr)
return convert_from_reference (expr);
}
}
- else if (TREE_CODE (type) == POINTER_TYPE
- && TREE_CODE (intype) == POINTER_TYPE
+ else if (((TREE_CODE (type) == POINTER_TYPE
+ && TREE_CODE (intype) == POINTER_TYPE)
+ || (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype)))
&& comp_ptr_ttypes_const (TREE_TYPE (type), TREE_TYPE (intype)))
return cp_convert (type, expr);
@@ -4953,6 +4747,8 @@ build_c_cast (tree type, tree expr)
{
tree t = build_min (CAST_EXPR, type,
tree_cons (NULL_TREE, value, NULL_TREE));
+ /* We don't know if it will or will not have side effects. */
+ TREE_SIDE_EFFECTS (t) = 1;
return t;
}
@@ -5042,11 +4838,11 @@ build_c_cast (tree type, tree expr)
otype, type);
if (TREE_CODE (type) == INTEGER_TYPE
- && TREE_CODE (otype) == POINTER_TYPE
+ && TYPE_PTR_P (otype)
&& TYPE_PRECISION (type) != TYPE_PRECISION (otype))
warning ("cast from pointer to integer of different size");
- if (TREE_CODE (type) == POINTER_TYPE
+ if (TYPE_PTR_P (type)
&& TREE_CODE (otype) == INTEGER_TYPE
&& TYPE_PRECISION (type) != TYPE_PRECISION (otype)
/* Don't warn about converting any constant. */
@@ -5399,44 +5195,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
if (newrhs == error_mark_node)
return error_mark_node;
- if (TREE_CODE (newrhs) == COND_EXPR)
- {
- tree lhs1;
- tree cond = TREE_OPERAND (newrhs, 0);
-
- if (TREE_SIDE_EFFECTS (lhs))
- cond = build_compound_expr (tree_cons
- (NULL_TREE, lhs,
- build_tree_list (NULL_TREE, cond)));
-
- /* Cannot have two identical lhs on this one tree (result) as preexpand
- calls will rip them out and fill in RTL for them, but when the
- rtl is generated, the calls will only be in the first side of the
- condition, not on both, or before the conditional jump! (mrs) */
- lhs1 = break_out_calls (lhs);
-
- if (lhs == lhs1)
- /* If there's no change, the COND_EXPR behaves like any other rhs. */
- result = build (modifycode == NOP_EXPR ? MODIFY_EXPR : INIT_EXPR,
- lhstype, lhs, newrhs);
- else
- {
- tree result_type = TREE_TYPE (newrhs);
- /* We have to convert each arm to the proper type because the
- types may have been munged by constant folding. */
- result
- = build (COND_EXPR, result_type, cond,
- build_modify_expr (lhs, modifycode,
- cp_convert (result_type,
- TREE_OPERAND (newrhs, 1))),
- build_modify_expr (lhs1, modifycode,
- cp_convert (result_type,
- TREE_OPERAND (newrhs, 2))));
- }
- }
- else
- result = build (modifycode == NOP_EXPR ? MODIFY_EXPR : INIT_EXPR,
- lhstype, lhs, newrhs);
+ result = build (modifycode == NOP_EXPR ? MODIFY_EXPR : INIT_EXPR,
+ lhstype, lhs, newrhs);
TREE_SIDE_EFFECTS (result) = 1;
@@ -5479,8 +5239,9 @@ build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
/* Get difference in deltas for different pointer to member function
- types. Return integer_zero_node, if FROM cannot be converted to a
- TO type. If FORCE is true, then allow reverse conversions as well.
+ types. Returns an integer constant of type PTRDIFF_TYPE_NODE. If
+ the conversion is invalid, the constant is zero. If FORCE is true,
+ then allow reverse conversions as well.
Note that the naming of FROM and TO is kind of backwards; the return
value is what we add to a TO in order to get a FROM. They are named
@@ -5490,7 +5251,6 @@ build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
static tree
get_delta_difference (tree from, tree to, int force)
{
- tree delta = integer_zero_node;
tree binfo;
tree virt_binfo;
base_kind kind;
@@ -5499,7 +5259,7 @@ get_delta_difference (tree from, tree to, int force)
if (kind == bk_inaccessible || kind == bk_ambig)
{
error (" in pointer to member function conversion");
- return delta;
+ goto error;
}
if (!binfo)
{
@@ -5507,44 +5267,38 @@ get_delta_difference (tree from, tree to, int force)
{
error_not_base_type (from, to);
error (" in pointer to member conversion");
- return delta;
+ goto error;
}
binfo = lookup_base (from, to, ba_check, &kind);
- if (binfo == 0)
- return delta;
+ if (!binfo)
+ goto error;
virt_binfo = binfo_from_vbase (binfo);
-
if (virt_binfo)
{
/* This is a reinterpret cast, we choose to do nothing. */
warning ("pointer to member cast via virtual base `%T'",
BINFO_TYPE (virt_binfo));
- return delta;
+ goto error;
}
- delta = BINFO_OFFSET (binfo);
- delta = cp_convert (ptrdiff_type_node, delta);
- delta = cp_build_binary_op (MINUS_EXPR,
- integer_zero_node,
- delta);
-
- return delta;
+ return convert_to_integer (ptrdiff_type_node,
+ size_diffop (size_zero_node,
+ BINFO_OFFSET (binfo)));
}
virt_binfo = binfo_from_vbase (binfo);
- if (virt_binfo)
- {
- /* This is a reinterpret cast, we choose to do nothing. */
- if (force)
- warning ("pointer to member cast via virtual base `%T'",
- BINFO_TYPE (virt_binfo));
- else
- error ("pointer to member conversion via virtual base `%T'",
- BINFO_TYPE (virt_binfo));
- return delta;
- }
- delta = BINFO_OFFSET (binfo);
+ if (!virt_binfo)
+ return convert_to_integer (ptrdiff_type_node, BINFO_OFFSET (binfo));
+
+ /* This is a reinterpret cast, we choose to do nothing. */
+ if (force)
+ warning ("pointer to member cast via virtual base `%T'",
+ BINFO_TYPE (virt_binfo));
+ else
+ error ("pointer to member conversion via virtual base `%T'",
+ BINFO_TYPE (virt_binfo));
- return cp_convert (ptrdiff_type_node, delta);
+ error:
+ return convert_to_integer(ptrdiff_type_node, integer_zero_node);
}
/* Return a constructor for the pointer-to-member-function TYPE using
@@ -5642,7 +5396,7 @@ build_ptrmemfunc (tree type, tree pfn, int force)
}
/* Just adjust the DELTA field. */
- delta = cp_convert (ptrdiff_type_node, delta);
+ my_friendly_assert (TREE_TYPE (delta) == ptrdiff_type_node, 20030727);
if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta)
n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node);
delta = cp_build_binary_op (PLUS_EXPR, delta, n);
@@ -5815,13 +5569,9 @@ static tree
convert_for_assignment (tree type, tree rhs,
const char *errtype, tree fndecl, int parmnum)
{
- register enum tree_code codel = TREE_CODE (type);
register tree rhstype;
register enum tree_code coder;
- if (codel == OFFSET_TYPE)
- abort ();
-
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
if (TREE_CODE (rhs) == NON_LVALUE_EXPR)
rhs = TREE_OPERAND (rhs, 0);
@@ -5829,6 +5579,11 @@ convert_for_assignment (tree type, tree rhs,
rhstype = TREE_TYPE (rhs);
coder = TREE_CODE (rhstype);
+ if (TREE_CODE (type) == VECTOR_TYPE && coder == VECTOR_TYPE
+ && ((*targetm.vector_opaque_p) (type)
+ || (*targetm.vector_opaque_p) (rhstype)))
+ return convert (type, rhs);
+
if (rhs == error_mark_node || rhstype == error_mark_node)
return error_mark_node;
if (TREE_CODE (rhs) == TREE_LIST && TREE_VALUE (rhs) == error_mark_node)
@@ -5957,7 +5712,8 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags,
if (fndecl)
savew = warningcount, savee = errorcount;
- rhs = initialize_reference (type, rhs, /*decl=*/NULL_TREE);
+ rhs = initialize_reference (type, rhs, /*decl=*/NULL_TREE,
+ /*cleanup=*/NULL);
if (fndecl)
{
if (warningcount > savew)
@@ -5999,7 +5755,7 @@ c_expand_asm_operands (tree string, tree outputs, tree inputs, tree clobbers,
int noutputs = list_length (outputs);
register int i;
/* o[I] is the place that output number I should be written. */
- register tree *o = (tree *) alloca (noutputs * sizeof (tree));
+ register tree *o = alloca (noutputs * sizeof (tree));
register tree tail;
/* Record the contents of OUTPUTS before it is modified. */
@@ -6156,7 +5912,7 @@ check_return_expr (tree retval)
that's supposed to return a value. */
if (!retval && fn_returns_value_p)
{
- pedwarn ("return-statement with no value, in function returning `%D'",
+ pedwarn ("return-statement with no value, in function returning '%T'",
valtype);
/* Clear this, so finish_function won't say that we reach the
end of a non-void function (which we don't, we gave a
@@ -6173,8 +5929,8 @@ check_return_expr (tree retval)
its side-effects. */
finish_expr_stmt (retval);
else
- pedwarn ("return-statement with a value, in function returning `%D'",
- retval);
+ pedwarn ("return-statement with a value, in function "
+ "returning 'void'");
current_function_returns_null = 1;
@@ -6296,7 +6052,7 @@ check_return_expr (tree retval)
static int
comp_ptr_ttypes_real (tree to, tree from, int constp)
{
- int to_more_cv_qualified = 0;
+ bool to_more_cv_qualified = false;
for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
{
@@ -6304,9 +6060,9 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
return 0;
if (TREE_CODE (from) == OFFSET_TYPE
- && same_type_p (TYPE_OFFSET_BASETYPE (from),
- TYPE_OFFSET_BASETYPE (to)))
- continue;
+ && !same_type_p (TYPE_OFFSET_BASETYPE (from),
+ TYPE_OFFSET_BASETYPE (to)))
+ return 0;
/* Const and volatile mean something different for function types,
so the usual checks are not appropriate. */
@@ -6319,15 +6075,14 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
{
if (constp == 0)
return 0;
- else
- ++to_more_cv_qualified;
+ to_more_cv_qualified = true;
}
if (constp > 0)
constp &= TYPE_READONLY (to);
}
- if (TREE_CODE (to) != POINTER_TYPE)
+ if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
return ((constp >= 0 || to_more_cv_qualified)
&& same_type_ignoring_top_level_qualifiers_p (to, from));
}
@@ -6399,40 +6154,6 @@ comp_ptr_ttypes_const (tree to, tree from)
}
}
-/* Like comp_ptr_ttypes, for reinterpret_cast. */
-
-static int
-comp_ptr_ttypes_reinterpret (tree to, tree from)
-{
- int constp = 1;
-
- for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
- {
- if (TREE_CODE (from) == OFFSET_TYPE)
- from = TREE_TYPE (from);
- if (TREE_CODE (to) == OFFSET_TYPE)
- to = TREE_TYPE (to);
-
- /* Const and volatile mean something different for function types,
- so the usual checks are not appropriate. */
- if (TREE_CODE (from) != FUNCTION_TYPE && TREE_CODE (from) != METHOD_TYPE
- && TREE_CODE (to) != FUNCTION_TYPE && TREE_CODE (to) != METHOD_TYPE)
- {
- if (!at_least_as_qualified_p (to, from))
- return 0;
-
- if (! constp
- && !at_least_as_qualified_p (from, to))
- return 0;
- constp &= TYPE_READONLY (to);
- }
-
- if (TREE_CODE (from) != POINTER_TYPE
- || TREE_CODE (to) != POINTER_TYPE)
- return 1;
- }
-}
-
/* Returns the type qualifiers for this type, including the qualifiers on the
elements for an array type. */
@@ -6472,9 +6193,9 @@ casts_away_constness_r (tree *t1, tree *t2)
pointer to member level is ignored when determining if a const
cv-qualifier has been cast away. */
if (TYPE_PTRMEM_P (*t1))
- *t1 = build_pointer_type (TREE_TYPE (TREE_TYPE (*t1)));
+ *t1 = build_pointer_type (TYPE_PTRMEM_POINTED_TO_TYPE (*t1));
if (TYPE_PTRMEM_P (*t2))
- *t2 = build_pointer_type (TREE_TYPE (TREE_TYPE (*t2)));
+ *t2 = build_pointer_type (TYPE_PTRMEM_POINTED_TO_TYPE (*t2));
/* [expr.const.cast]
@@ -6543,8 +6264,8 @@ casts_away_constness (tree t1, tree t2)
"pointer to T1" to the type "pointer to T2" casts away
constness. */
return casts_away_constness
- (build_pointer_type (TREE_TYPE (TREE_TYPE (t1))),
- build_pointer_type (TREE_TYPE (TREE_TYPE (t2))));
+ (build_pointer_type (TYPE_PTRMEM_POINTED_TO_TYPE (t1)),
+ build_pointer_type (TYPE_PTRMEM_POINTED_TO_TYPE (t2)));
/* Casting away constness is only something that makes sense for
pointer or reference types. */
@@ -6562,23 +6283,6 @@ casts_away_constness (tree t1, tree t2)
return false;
}
-/* Returns TYPE with its cv qualifiers removed
- TYPE is T cv* .. *cv where T is not a pointer type,
- returns T * .. *. (If T is an array type, then the cv qualifiers
- above are those of the array members.) */
-
-static tree
-strip_all_pointer_quals (tree type)
-{
- if (TREE_CODE (type) == POINTER_TYPE)
- return build_pointer_type (strip_all_pointer_quals (TREE_TYPE (type)));
- else if (TREE_CODE (type) == OFFSET_TYPE)
- return build_offset_type (TYPE_OFFSET_BASETYPE (type),
- strip_all_pointer_quals (TREE_TYPE (type)));
- else
- return TYPE_MAIN_VARIANT (type);
-}
-
/* If T is a REFERENCE_TYPE return the type to which T refers.
Otherwise, return T itself. */
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 6a14fecb4a9..28d876d0433 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -330,15 +330,8 @@ store_init_value (tree decl, tree init)
&& TREE_TYPE (init) != unknown_type_node)
{
if (TREE_CODE (decl) == RESULT_DECL)
- {
- if (TREE_CHAIN (init))
- {
- warning ("comma expression used to initialize return value");
- init = build_compound_expr (init);
- }
- else
- init = TREE_VALUE (init);
- }
+ init = build_x_compound_expr_from_list (init,
+ "return value initializer");
else if (TREE_CODE (init) == TREE_LIST
&& TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
{
@@ -346,17 +339,8 @@ store_init_value (tree decl, tree init)
return NULL_TREE;
}
else
- {
- /* We get here with code like `int a (2);' */
-
- if (TREE_CHAIN (init) != NULL_TREE)
- {
- pedwarn ("initializer list being treated as compound expression");
- init = build_compound_expr (init);
- }
- else
- init = TREE_VALUE (init);
- }
+ /* We get here with code like `int a (2);' */
+ init = build_x_compound_expr_from_list (init, "initializer");
}
/* End of special C++ code. */
@@ -506,7 +490,7 @@ digest_init (tree type, tree init, tree* tail)
if (code == INTEGER_TYPE || code == REAL_TYPE || code == POINTER_TYPE
|| code == ENUMERAL_TYPE || code == REFERENCE_TYPE
|| code == BOOLEAN_TYPE || code == COMPLEX_TYPE
- || TYPE_PTRMEMFUNC_P (type))
+ || TYPE_PTR_TO_MEMBER_P (type))
{
if (raw_constructor)
{
@@ -1039,9 +1023,12 @@ build_x_arrow (tree expr)
if (TREE_CODE (TREE_TYPE (last_rval)) == POINTER_TYPE)
{
if (processing_template_decl)
- return build_min (ARROW_EXPR,
- TREE_TYPE (TREE_TYPE (last_rval)),
- orig_expr);
+ {
+ expr = build_min_non_dep (ARROW_EXPR, last_rval, orig_expr);
+ /* It will be dereferenced. */
+ TREE_TYPE (expr) = TREE_TYPE (TREE_TYPE (last_rval));
+ return expr;
+ }
return build_indirect_ref (last_rval, NULL);
}
@@ -1070,8 +1057,7 @@ build_m_component_ref (tree datum, tree component)
return error_mark_node;
ptrmem_type = TREE_TYPE (component);
- if (!TYPE_PTRMEM_P (ptrmem_type)
- && !TYPE_PTRMEMFUNC_P (ptrmem_type))
+ if (!TYPE_PTR_TO_MEMBER_P (ptrmem_type))
{
error ("`%E' cannot be used as a member pointer, since it is of type `%T'",
component, ptrmem_type);
@@ -1107,10 +1093,12 @@ build_m_component_ref (tree datum, tree component)
type = cp_build_qualified_type (type,
(cp_type_quals (type)
| cp_type_quals (TREE_TYPE (datum))));
-
- datum = build_base_path (PLUS_EXPR, build_address (datum), binfo, 1);
- component = cp_convert (ptrdiff_type_node, component);
- datum = build (PLUS_EXPR, build_pointer_type (type), datum, component);
+ /* Build an expression for "object + offset" where offset is the
+ value stored in the pointer-to-data-member. */
+ datum = build (PLUS_EXPR, build_pointer_type (type),
+ build_base_path (PLUS_EXPR, build_address (datum),
+ binfo, 1),
+ build_nop (ptrdiff_type_node, component));
return build_indirect_ref (datum, 0);
}
else
@@ -1129,29 +1117,18 @@ build_functional_cast (tree exp, tree parms)
if (exp == error_mark_node || parms == error_mark_node)
return error_mark_node;
- if (TREE_CODE (exp) == IDENTIFIER_NODE)
- {
- if (IDENTIFIER_HAS_TYPE_VALUE (exp))
- /* Either an enum or an aggregate type. */
- type = IDENTIFIER_TYPE_VALUE (exp);
- else
- {
- type = lookup_name (exp, 1);
- if (!type || TREE_CODE (type) != TYPE_DECL)
- {
- error ("`%T' fails to be a typedef or built-in type", exp);
- return error_mark_node;
- }
- type = TREE_TYPE (type);
- }
- }
- else if (TREE_CODE (exp) == TYPE_DECL)
+ if (TREE_CODE (exp) == TYPE_DECL)
type = TREE_TYPE (exp);
else
type = exp;
if (processing_template_decl)
- return build_min (CAST_EXPR, type, parms);
+ {
+ tree t = build_min (CAST_EXPR, type, parms);
+ /* We don't know if it will or will not have side effects. */
+ TREE_SIDE_EFFECTS (t) = 1;
+ return t;
+ }
if (! IS_AGGR_TYPE (type))
{
@@ -1159,11 +1136,7 @@ build_functional_cast (tree exp, tree parms)
if (parms == NULL_TREE)
parms = integer_zero_node;
else
- {
- if (TREE_CHAIN (parms) != NULL_TREE)
- pedwarn ("initializer list being treated as compound expression");
- parms = build_compound_expr (parms);
- }
+ parms = build_x_compound_expr_from_list (parms, "functional cast");
return build_c_cast (type, parms);
}
@@ -1210,9 +1183,9 @@ build_functional_cast (tree exp, tree parms)
tree
add_exception_specifier (tree list, tree spec, int complain)
{
- int ok;
+ bool ok;
tree core = spec;
- int is_ptr;
+ bool is_ptr;
int diag_type = -1; /* none */
if (spec == error_mark_node)
@@ -1227,16 +1200,16 @@ add_exception_specifier (tree list, tree spec, int complain)
if (is_ptr || TREE_CODE (core) == REFERENCE_TYPE)
core = TREE_TYPE (core);
if (complain < 0)
- ok = 1;
+ ok = true;
else if (VOID_TYPE_P (core))
ok = is_ptr;
else if (TREE_CODE (core) == TEMPLATE_TYPE_PARM)
- ok = 1;
+ ok = true;
else if (processing_template_decl)
- ok = 1;
+ ok = true;
else
{
- ok = 1;
+ ok = true;
/* 15.4/1 says that types in an exception specifier must be complete,
but it seems more reasonable to only require this on definitions
and calls. So just give a pedwarn at this point; we will give an
diff --git a/gcc/cppcharset.c b/gcc/cppcharset.c
index 0e9805fd4d5..b38eea01ad6 100644
--- a/gcc/cppcharset.c
+++ b/gcc/cppcharset.c
@@ -20,8 +20,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "cppucnid.h"
@@ -67,12 +65,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
cpplib uses UTF-8 or UTF-EBCDIC for the source character set,
depending on whether the host is based on ASCII or EBCDIC (see
respectively Unicode section 2.3/ISO10646 Amendment 2, and Unicode
- Technical Report #16). It relies on the system library's iconv()
- primitive to do charset conversion (specified in SUSv2). If this
- primitive is not present, the source and execution character sets
- must be identical and are limited to the basic ASCII or EBCDIC
- range, and wide characters are implemented by padding narrow
- characters to the size of wchar_t. */
+ Technical Report #16). With limited exceptions, it relies on the
+ system library's iconv() primitive to do charset conversion
+ (specified in SUSv2). */
#if !HAVE_ICONV
/* Make certain that the uses of iconv(), iconv_open(), iconv_close()
@@ -80,7 +75,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
constant conditions, do not cause link errors. */
#define iconv_open(x, y) (errno = EINVAL, (iconv_t)-1)
#define iconv(a,b,c,d,e) (errno = EINVAL, (size_t)-1)
-#define iconv_close(x) 0
+#define iconv_close(x) (void)0
#define ICONV_CONST
#endif
@@ -92,8 +87,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#error "Unrecognized basic host character set"
#endif
-/* This structure is used for a resizable string buffer, mostly by
- convert_cset and cpp_interpret_string. */
+#ifndef EILSEQ
+#define EILSEQ EINVAL
+#endif
+
+/* This structure is used for a resizable string buffer throughout. */
struct strbuf
{
uchar *text;
@@ -103,146 +101,617 @@ struct strbuf
/* This is enough to hold any string that fits on a single 80-column
line, even if iconv quadruples its size (e.g. conversion from
- ASCII to UCS-4) rounded up to a power of two. */
+ ASCII to UTF-32) rounded up to a power of two. */
#define OUTBUF_BLOCK_SIZE 256
-/* Subroutine of cpp_init_iconv: initialize and return an iconv
- descriptor for conversion from FROM to TO. If iconv_open() fails,
- issue an error and return (iconv_t) -1. Silently return
- (iconv_t) -1 if FROM and TO are identical. */
-static iconv_t
-init_iconv_desc (cpp_reader *pfile, const char *to, const char *from)
+/* Conversions between UTF-8 and UTF-16/32 are implemented by custom
+ logic. This is because a depressing number of systems lack iconv,
+ or have have iconv libraries that do not do these conversions, so
+ we need a fallback implementation for them. To ensure the fallback
+ doesn't break due to neglect, it is used on all systems.
+
+ UTF-32 encoding is nice and simple: a four-byte binary number,
+ constrained to the range 00000000-7FFFFFFF to avoid questions of
+ signedness. We do have to cope with big- and little-endian
+ variants.
+
+ UTF-16 encoding uses two-byte binary numbers, again in big- and
+ little-endian variants, for all values in the 00000000-0000FFFF
+ range. Values in the 00010000-0010FFFF range are encoded as pairs
+ of two-byte numbers, called "surrogate pairs": given a number S in
+ this range, it is mapped to a pair (H, L) as follows:
+
+ H = (S - 0x10000) / 0x400 + 0xD800
+ L = (S - 0x10000) % 0x400 + 0xDC00
+
+ Two-byte values in the D800...DFFF range are ill-formed except as a
+ component of a surrogate pair. Even if the encoding within a
+ two-byte value is little-endian, the H member of the surrogate pair
+ comes first.
+
+ There is no way to encode values in the 00110000-7FFFFFFF range,
+ which is not currently a problem as there are no assigned code
+ points in that range; however, the author expects that it will
+ eventually become necessary to abandon UTF-16 due to this
+ limitation. Note also that, because of these pairs, UTF-16 does
+ not meet the requirements of the C standard for a wide character
+ encoding (see 3.7.3 and 6.4.4.4p11).
+
+ UTF-8 encoding looks like this:
+
+ value range encoded as
+ 00000000-0000007F 0xxxxxxx
+ 00000080-000007FF 110xxxxx 10xxxxxx
+ 00000800-0000FFFF 1110xxxx 10xxxxxx 10xxxxxx
+ 00010000-001FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ 00200000-03FFFFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ 04000000-7FFFFFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+
+ Values in the 0000D800 ... 0000DFFF range (surrogates) are invalid,
+ which means that three-byte sequences ED xx yy, with A0 <= xx <= BF,
+ never occur. Note also that any value that can be encoded by a
+ given row of the table can also be encoded by all successive rows,
+ but this is not done; only the shortest possible encoding for any
+ given value is valid. For instance, the character 07C0 could be
+ encoded as any of DF 80, E0 9F 80, F0 80 9F 80, F8 80 80 9F 80, or
+ FC 80 80 80 9F 80. Only the first is valid.
+
+ An implementation note: the transformation from UTF-16 to UTF-8, or
+ vice versa, is easiest done by using UTF-32 as an intermediary. */
+
+/* Internal primitives which go from an UTF-8 byte stream to native-endian
+ UTF-32 in a cppchar_t, or vice versa; this avoids an extra marshal/unmarshal
+ operation in several places below. */
+static inline int
+one_utf8_to_cppchar (const uchar **inbufp, size_t *inbytesleftp,
+ cppchar_t *cp)
{
- iconv_t dsc;
+ static const uchar masks[6] = { 0x7F, 0x1F, 0x0F, 0x07, 0x02, 0x01 };
+ static const uchar patns[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+
+ cppchar_t c;
+ const uchar *inbuf = *inbufp;
+ size_t nbytes, i;
+
+ if (*inbytesleftp < 1)
+ return EINVAL;
+
+ c = *inbuf;
+ if (c < 0x80)
+ {
+ *cp = c;
+ *inbytesleftp -= 1;
+ *inbufp += 1;
+ return 0;
+ }
+
+ /* The number of leading 1-bits in the first byte indicates how many
+ bytes follow. */
+ for (nbytes = 2; nbytes < 7; nbytes++)
+ if ((c & ~masks[nbytes-1]) == patns[nbytes-1])
+ goto found;
+ return EILSEQ;
+ found:
- if (!strcmp (to, from))
- return (iconv_t) -1;
+ if (*inbytesleftp < nbytes)
+ return EINVAL;
- dsc = iconv_open (to, from);
- if (dsc == (iconv_t) -1)
+ c = (c & masks[nbytes-1]);
+ inbuf++;
+ for (i = 1; i < nbytes; i++)
{
- if (errno == EINVAL)
- cpp_error (pfile, 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");
+ cppchar_t n = *inbuf++;
+ if ((n & 0xC0) != 0x80)
+ return EILSEQ;
+ c = ((c << 6) + (n & 0x3F));
}
- return dsc;
+
+ /* Make sure the shortest possible encoding was used. */
+ if (c <= 0x7F && nbytes > 1) return EILSEQ;
+ if (c <= 0x7FF && nbytes > 2) return EILSEQ;
+ if (c <= 0xFFFF && nbytes > 3) return EILSEQ;
+ if (c <= 0x1FFFFF && nbytes > 4) return EILSEQ;
+ if (c <= 0x3FFFFFF && nbytes > 5) return EILSEQ;
+
+ /* Make sure the character is valid. */
+ if (c > 0x7FFFFFFF || (c >= 0xD800 && c <= 0xDFFF)) return EILSEQ;
+
+ *cp = c;
+ *inbufp = inbuf;
+ *inbytesleftp -= nbytes;
+ return 0;
}
-/* If charset conversion is requested, initialize iconv(3) descriptors
- for conversion from the source character set to the execution
- character sets. If iconv is not present in the C library, and
- conversion is requested, issue an error. */
+static inline int
+one_cppchar_to_utf8 (cppchar_t c, uchar **outbufp, size_t *outbytesleftp)
+{
+ static const uchar masks[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+ static const uchar limits[6] = { 0x80, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE };
+ size_t nbytes;
+ uchar buf[6], *p = &buf[6];
+ uchar *outbuf = *outbufp;
-void
-cpp_init_iconv (cpp_reader *pfile)
+ nbytes = 1;
+ if (c < 0x80)
+ *--p = c;
+ else
+ {
+ do
+ {
+ *--p = ((c & 0x3F) | 0x80);
+ c >>= 6;
+ nbytes++;
+ }
+ while (c >= 0x3F || (c & limits[nbytes-1]));
+ *--p = (c | masks[nbytes-1]);
+ }
+
+ if (*outbytesleftp < nbytes)
+ return E2BIG;
+
+ while (p < &buf[6])
+ *outbuf++ = *p++;
+ *outbytesleftp -= nbytes;
+ *outbufp = outbuf;
+ return 0;
+}
+
+/* The following four functions transform one character between the two
+ encodings named in the function name. All have the signature
+ int (*)(iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp,
+ uchar **outbufp, size_t *outbytesleftp)
+
+ BIGEND must have the value 0 or 1, coerced to (iconv_t); it is
+ interpreted as a boolean indicating whether big-endian or
+ little-endian encoding is to be used for the member of the pair
+ that is not UTF-8.
+
+ INBUFP, INBYTESLEFTP, OUTBUFP, OUTBYTESLEFTP work exactly as they
+ do for iconv.
+
+ The return value is either 0 for success, or an errno value for
+ failure, which may be E2BIG (need more space), EILSEQ (ill-formed
+ input sequence), ir EINVAL (incomplete input sequence). */
+
+static inline int
+one_utf8_to_utf32 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp,
+ uchar **outbufp, size_t *outbytesleftp)
{
- const char *ncset = CPP_OPTION (pfile, narrow_charset);
- const char *wcset = CPP_OPTION (pfile, wide_charset);
- const char *default_wcset;
+ uchar *outbuf;
+ cppchar_t s;
+ int rval;
+
+ /* Check for space first, since we know exactly how much we need. */
+ if (*outbytesleftp < 4)
+ return E2BIG;
+
+ rval = one_utf8_to_cppchar (inbufp, inbytesleftp, &s);
+ if (rval)
+ return rval;
+
+ outbuf = *outbufp;
+ outbuf[bigend ? 3 : 0] = (s & 0x000000FF);
+ outbuf[bigend ? 2 : 1] = (s & 0x0000FF00) >> 8;
+ outbuf[bigend ? 1 : 2] = (s & 0x00FF0000) >> 16;
+ outbuf[bigend ? 0 : 3] = (s & 0xFF000000) >> 24;
+
+ *outbufp += 4;
+ *outbytesleftp -= 4;
+ return 0;
+}
- bool be = CPP_OPTION (pfile, bytes_big_endian);
+static inline int
+one_utf32_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp,
+ uchar **outbufp, size_t *outbytesleftp)
+{
+ cppchar_t s;
+ int rval;
+ const uchar *inbuf;
- if (CPP_OPTION (pfile, wchar_precision) >= 32)
- default_wcset = be ? "UCS-4BE" : "UCS-4LE";
- else if (CPP_OPTION (pfile, wchar_precision) >= 16)
- default_wcset = be ? "UCS-2BE" : "UCS-2LE";
- else
- /* This effectively means that wide strings are not supported,
- so don't do any conversion at all. */
- default_wcset = SOURCE_CHARSET;
+ if (*inbytesleftp < 4)
+ return EINVAL;
+
+ inbuf = *inbufp;
+
+ s = inbuf[bigend ? 0 : 3] << 24;
+ s += inbuf[bigend ? 1 : 2] << 16;
+ s += inbuf[bigend ? 2 : 1] << 8;
+ s += inbuf[bigend ? 3 : 0];
+
+ if (s >= 0x7FFFFFFF || (s >= 0xD800 && s <= 0xDFFF))
+ return EILSEQ;
+
+ rval = one_cppchar_to_utf8 (s, outbufp, outbytesleftp);
+ if (rval)
+ return rval;
+
+ *inbufp += 4;
+ *inbytesleftp -= 4;
+ return 0;
+}
+
+static inline int
+one_utf8_to_utf16 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp,
+ uchar **outbufp, size_t *outbytesleftp)
+{
+ int rval;
+ cppchar_t s;
+ const uchar *save_inbuf = *inbufp;
+ size_t save_inbytesleft = *inbytesleftp;
+ uchar *outbuf = *outbufp;
+
+ rval = one_utf8_to_cppchar (inbufp, inbytesleftp, &s);
+ if (rval)
+ return rval;
- if (!HAVE_ICONV)
+ if (s > 0x0010FFFF)
{
- if (ncset && strcmp (ncset, SOURCE_CHARSET))
- cpp_error (pfile, DL_ERROR, /* XXX should be DL_SORRY */
- "no iconv implementation, cannot convert to %s", ncset);
+ *inbufp = save_inbuf;
+ *inbytesleftp = save_inbytesleft;
+ return EILSEQ;
+ }
+
+ if (s < 0xFFFF)
+ {
+ if (*outbytesleftp < 2)
+ {
+ *inbufp = save_inbuf;
+ *inbytesleftp = save_inbytesleft;
+ return E2BIG;
+ }
+ outbuf[bigend ? 1 : 0] = (s & 0x00FF);
+ outbuf[bigend ? 0 : 1] = (s & 0xFF00) >> 8;
- if (wcset && strcmp (wcset, default_wcset))
- cpp_error (pfile, DL_ERROR, /* XXX should be DL_SORRY */
- "no iconv implementation, cannot convert to %s", wcset);
+ *outbufp += 2;
+ *outbytesleftp -= 2;
+ return 0;
}
else
{
- if (!ncset)
- ncset = SOURCE_CHARSET;
- if (!wcset)
- wcset = default_wcset;
+ cppchar_t hi, lo;
- pfile->narrow_cset_desc = init_iconv_desc (pfile, ncset, SOURCE_CHARSET);
- pfile->wide_cset_desc = init_iconv_desc (pfile, wcset, SOURCE_CHARSET);
+ if (*outbytesleftp < 4)
+ {
+ *inbufp = save_inbuf;
+ *inbytesleftp = save_inbytesleft;
+ return E2BIG;
+ }
+
+ hi = (s - 0x10000) / 0x400 + 0xD800;
+ lo = (s - 0x10000) % 0x400 + 0xDC00;
+
+ /* Even if we are little-endian, put the high surrogate first.
+ ??? Matches practice? */
+ outbuf[bigend ? 1 : 0] = (hi & 0x00FF);
+ outbuf[bigend ? 0 : 1] = (hi & 0xFF00) >> 8;
+ outbuf[bigend ? 3 : 2] = (lo & 0x00FF);
+ outbuf[bigend ? 2 : 3] = (lo & 0xFF00) >> 8;
+
+ *outbufp += 4;
+ *outbytesleftp -= 4;
+ return 0;
}
}
-void
-_cpp_destroy_iconv (cpp_reader *pfile)
+static inline int
+one_utf16_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp,
+ uchar **outbufp, size_t *outbytesleftp)
{
- if (HAVE_ICONV)
+ cppchar_t s;
+ const uchar *inbuf = *inbufp;
+ int rval;
+
+ if (*inbytesleftp < 2)
+ return EINVAL;
+ s = inbuf[bigend ? 0 : 1] << 8;
+ s += inbuf[bigend ? 1 : 0];
+
+ /* Low surrogate without immediately preceding high surrogate is invalid. */
+ if (s >= 0xDC00 && s <= 0xDFFF)
+ return EILSEQ;
+ /* High surrogate must have a following low surrogate. */
+ else if (s >= 0xD800 && s <= 0xDBFF)
{
- if (pfile->narrow_cset_desc != (iconv_t) -1)
- iconv_close (pfile->narrow_cset_desc);
- if (pfile->wide_cset_desc != (iconv_t) -1)
- iconv_close (pfile->wide_cset_desc);
+ cppchar_t hi = s, lo;
+ if (*inbytesleftp < 4)
+ return EINVAL;
+
+ lo = inbuf[bigend ? 2 : 3] << 8;
+ lo += inbuf[bigend ? 3 : 2];
+
+ if (lo < 0xDC00 || lo > 0xDFFF)
+ return EILSEQ;
+
+ s = (hi - 0xD800) * 0x400 + (lo - 0xDC00) + 0x10000;
+ }
+
+ rval = one_cppchar_to_utf8 (s, outbufp, outbytesleftp);
+ if (rval)
+ return rval;
+
+ /* Success - update the input pointers (one_cppchar_to_utf8 has done
+ the output pointers for us). */
+ if (s <= 0xFFFF)
+ {
+ *inbufp += 2;
+ *inbytesleftp -= 2;
+ }
+ else
+ {
+ *inbufp += 4;
+ *inbytesleftp -= 4;
+ }
+ return 0;
+}
+
+/* Helper routine for the next few functions. The 'const' on
+ one_conversion means that we promise not to modify what function is
+ pointed to, which lets the inliner see through it. */
+
+static inline bool
+conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *,
+ uchar **, size_t *),
+ iconv_t cd, const uchar *from, size_t flen, struct strbuf *to)
+{
+ const uchar *inbuf;
+ uchar *outbuf;
+ size_t inbytesleft, outbytesleft;
+ int rval;
+
+ inbuf = from;
+ inbytesleft = flen;
+ outbuf = to->text + to->len;
+ outbytesleft = to->asize - to->len;
+
+ for (;;)
+ {
+ do
+ rval = one_conversion (cd, &inbuf, &inbytesleft,
+ &outbuf, &outbytesleft);
+ while (inbytesleft && !rval);
+
+ if (__builtin_expect (inbytesleft == 0, 1))
+ {
+ to->len = to->asize - outbytesleft;
+ return true;
+ }
+ if (rval != E2BIG)
+ {
+ errno = rval;
+ return false;
+ }
+
+ outbytesleft += OUTBUF_BLOCK_SIZE;
+ to->asize += OUTBUF_BLOCK_SIZE;
+ to->text = xrealloc (to->text, to->asize);
+ outbuf = to->text + to->asize - outbytesleft;
}
}
+
+
+/* These functions convert entire strings between character sets.
+ They all have the signature
+
+ bool (*)(iconv_t cd, const uchar *from, size_t flen, struct strbuf *to);
+
+ The input string FROM is converted as specified by the function
+ name plus the iconv descriptor CD (which may be fake), and the
+ result appended to TO. On any error, false is returned, otherwise true. */
+
+/* These four use the custom conversion code above. */
+static bool
+convert_utf8_utf16 (iconv_t cd, const uchar *from, size_t flen,
+ struct strbuf *to)
+{
+ return conversion_loop (one_utf8_to_utf16, cd, from, flen, to);
+}
+
+static bool
+convert_utf8_utf32 (iconv_t cd, const uchar *from, size_t flen,
+ struct strbuf *to)
+{
+ return conversion_loop (one_utf8_to_utf32, cd, from, flen, to);
+}
-/* iconv(3) utility wrapper. Convert the string FROM, of length FLEN,
- according to the iconv descriptor CD. The result is appended to
- the string buffer TO. If DESC is (iconv_t)-1 or iconv is not
- available, the string is simply copied into TO.
+static bool
+convert_utf16_utf8 (iconv_t cd, const uchar *from, size_t flen,
+ struct strbuf *to)
+{
+ return conversion_loop (one_utf16_to_utf8, cd, from, flen, to);
+}
- Returns true on success, false on error. */
+static bool
+convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen,
+ struct strbuf *to)
+{
+ return conversion_loop (one_utf32_to_utf8, cd, from, flen, to);
+}
+/* Identity conversion, used when we have no alternative. */
static bool
-convert_cset (iconv_t cd, const uchar *from, size_t flen, struct strbuf *to)
+convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED,
+ const uchar *from, size_t flen, struct strbuf *to)
{
- if (!HAVE_ICONV || cd == (iconv_t)-1)
+ if (to->len + flen > to->asize)
{
- if (to->len + flen > to->asize)
+ to->asize = to->len + flen;
+ to->text = xrealloc (to->text, to->asize);
+ }
+ memcpy (to->text + to->len, from, flen);
+ to->len += flen;
+ return true;
+}
+
+/* And this one uses the system iconv primitive. It's a little
+ different, since iconv's interface is a little different. */
+#if HAVE_ICONV
+static bool
+convert_using_iconv (iconv_t cd, const uchar *from, size_t flen,
+ struct strbuf *to)
+{
+ ICONV_CONST char *inbuf;
+ char *outbuf;
+ size_t inbytesleft, outbytesleft;
+
+ /* Reset conversion descriptor and check that it is valid. */
+ if (iconv (cd, 0, 0, 0, 0) == (size_t)-1)
+ return false;
+
+ inbuf = (ICONV_CONST char *)from;
+ inbytesleft = flen;
+ outbuf = (char *)to->text + to->len;
+ outbytesleft = to->asize - to->len;
+
+ for (;;)
+ {
+ iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+ if (__builtin_expect (inbytesleft == 0, 1))
{
- to->asize = to->len + flen;
- to->text = xrealloc (to->text, to->asize);
+ to->len = to->asize - outbytesleft;
+ return true;
}
- memcpy (to->text + to->len, from, flen);
- to->len += flen;
- return true;
+ if (errno != E2BIG)
+ return false;
+
+ outbytesleft += OUTBUF_BLOCK_SIZE;
+ to->asize += OUTBUF_BLOCK_SIZE;
+ to->text = xrealloc (to->text, to->asize);
+ outbuf = (char *)to->text + to->asize - outbytesleft;
}
- else
+}
+#else
+#define convert_using_iconv 0 /* prevent undefined symbol error below */
+#endif
+
+/* Arrange for the above custom conversion logic to be used automatically
+ when conversion between a suitable pair of character sets is requested. */
+
+#define APPLY_CONVERSION(CONVERTER, FROM, FLEN, TO) \
+ CONVERTER.func (CONVERTER.cd, FROM, FLEN, TO)
+
+struct conversion
+{
+ const char *pair;
+ convert_f func;
+ iconv_t fake_cd;
+};
+static const struct conversion conversion_tab[] = {
+ { "UTF-8/UTF-32LE", convert_utf8_utf32, (iconv_t)0 },
+ { "UTF-8/UTF-32BE", convert_utf8_utf32, (iconv_t)1 },
+ { "UTF-8/UTF-16LE", convert_utf8_utf16, (iconv_t)0 },
+ { "UTF-8/UTF-16BE", convert_utf8_utf16, (iconv_t)1 },
+ { "UTF-32LE/UTF-8", convert_utf32_utf8, (iconv_t)0 },
+ { "UTF-32BE/UTF-8", convert_utf32_utf8, (iconv_t)1 },
+ { "UTF-16LE/UTF-8", convert_utf16_utf8, (iconv_t)0 },
+ { "UTF-16BE/UTF-8", convert_utf16_utf8, (iconv_t)1 },
+};
+
+/* Subroutine of cpp_init_iconv: initialize and return a
+ cset_converter structure for conversion from FROM to TO. If
+ iconv_open() fails, issue an error and return an identity
+ converter. Silently return an identity converter if FROM and TO
+ are identical. */
+static struct cset_converter
+init_iconv_desc (cpp_reader *pfile, const char *to, const char *from)
+{
+ struct cset_converter ret;
+ char *pair;
+ size_t i;
+
+ if (!strcasecmp (to, from))
{
- ICONV_CONST char *inbuf;
- char *outbuf;
- size_t inbytesleft, outbytesleft;
+ ret.func = convert_no_conversion;
+ ret.cd = (iconv_t) -1;
+ return ret;
+ }
- /* Reset conversion descriptor and check that it is valid. */
- if (iconv (cd, 0, 0, 0, 0) == (size_t)-1)
- return false;
+ pair = alloca(strlen(to) + strlen(from) + 2);
- inbuf = (ICONV_CONST char *)from;
- inbytesleft = flen;
- outbuf = (char *)to->text + to->len;
- outbytesleft = to->asize - to->len;
+ strcpy(pair, from);
+ strcat(pair, "/");
+ strcat(pair, to);
+ for (i = 0; i < ARRAY_SIZE (conversion_tab); i++)
+ if (!strcasecmp (pair, conversion_tab[i].pair))
+ {
+ ret.func = conversion_tab[i].func;
+ ret.cd = conversion_tab[i].fake_cd;
+ return ret;
+ }
- for (;;)
- {
- iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
- if (__builtin_expect (inbytesleft == 0, 1))
- {
- to->len = to->asize - outbytesleft;
- return true;
- }
- if (errno != E2BIG)
- return false;
+ /* No custom converter - try iconv. */
+ if (HAVE_ICONV)
+ {
+ ret.func = convert_using_iconv;
+ ret.cd = iconv_open (to, from);
- outbytesleft += OUTBUF_BLOCK_SIZE;
- to->asize += OUTBUF_BLOCK_SIZE;
- to->text = xrealloc (to->text, to->asize);
- outbuf = (char *)to->text + to->asize - outbytesleft;
+ if (ret.cd == (iconv_t) -1)
+ {
+ if (errno == EINVAL)
+ cpp_error (pfile, 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");
+
+ ret.func = convert_no_conversion;
}
}
+ else
+ {
+ cpp_error (pfile, DL_ERROR, /* XXX should be DL_SORRY */
+ "no iconv implementation, cannot convert from %s to %s",
+ from, to);
+ ret.func = convert_no_conversion;
+ ret.cd = (iconv_t) -1;
+ }
+ return ret;
+}
+
+/* If charset conversion is requested, initialize iconv(3) descriptors
+ for conversion from the source character set to the execution
+ character sets. If iconv is not present in the C library, and
+ conversion is requested, issue an error. */
+
+void
+cpp_init_iconv (cpp_reader *pfile)
+{
+ const char *ncset = CPP_OPTION (pfile, narrow_charset);
+ const char *wcset = CPP_OPTION (pfile, wide_charset);
+ const char *default_wcset;
+
+ bool be = CPP_OPTION (pfile, bytes_big_endian);
+
+ if (CPP_OPTION (pfile, wchar_precision) >= 32)
+ default_wcset = be ? "UTF-32BE" : "UTF-32LE";
+ else if (CPP_OPTION (pfile, wchar_precision) >= 16)
+ default_wcset = be ? "UTF-16BE" : "UTF-16LE";
+ else
+ /* This effectively means that wide strings are not supported,
+ so don't do any conversion at all. */
+ default_wcset = SOURCE_CHARSET;
+
+ if (!ncset)
+ ncset = SOURCE_CHARSET;
+ if (!wcset)
+ wcset = default_wcset;
+
+ pfile->narrow_cset_desc = init_iconv_desc (pfile, ncset, SOURCE_CHARSET);
+ pfile->wide_cset_desc = init_iconv_desc (pfile, wcset, SOURCE_CHARSET);
+}
+
+void
+_cpp_destroy_iconv (cpp_reader *pfile)
+{
+ if (HAVE_ICONV)
+ {
+ if (pfile->narrow_cset_desc.func == convert_using_iconv)
+ iconv_close (pfile->narrow_cset_desc.cd);
+ if (pfile->wide_cset_desc.func == convert_using_iconv)
+ iconv_close (pfile->wide_cset_desc.cd);
+ }
}
+
/* Utility routine that computes a mask of the form 0000...111... with
WIDTH 1-bits. */
static inline size_t
@@ -390,15 +859,6 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
"universal character %.*s is not valid at the start of an identifier",
(int) (str - base), base);
}
- /* We don't accept UCNs if iconv is not available or will not
- convert to the target wide character set. */
- else if (!HAVE_ICONV || pfile->wide_cset_desc == (iconv_t) -1)
- {
- /* XXX should be DL_SORRY */
- cpp_error (pfile, DL_ERROR,
- "universal character names are not supported in this configuration");
- }
-
if (result == 0)
result = 1;
@@ -408,58 +868,31 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
/* Convert an UCN, pointed to by FROM, to UTF-8 encoding, then translate
it to the execution character set and write the result into TBUF.
- An advanced pointer is returned. Issues all relevant diagnostics.
+ An advanced pointer is returned. Issues all relevant diagnostics. */
- UTF-8 encoding looks like this:
-
- value range encoded as
- 00000000-0000007F 0xxxxxxx
- 00000080-000007FF 110xxxxx 10xxxxxx
- 00000800-0000FFFF 1110xxxx 10xxxxxx 10xxxxxx
- 00010000-001FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
- 00200000-03FFFFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
- 04000000-7FFFFFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
-
- Values in the 0000D800 ... 0000DFFF range (surrogates) are invalid,
- which means that three-byte sequences ED xx yy, with A0 <= xx <= BF,
- never occur. Note also that any value that can be encoded by a
- given row of the table can also be encoded by all successive rows,
- but this is not done; only the shortest possible encoding for any
- given value is valid. For instance, the character 07C0 could be
- encoded as any of DF 80, E0 9F 80, F0 80 9F 80, F8 80 80 9F 80, or
- FC 80 80 80 9F 80. Only the first is valid. */
static const uchar *
convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit,
struct strbuf *tbuf, bool wide)
{
- int nbytes;
- uchar buf[6], *p = &buf[6];
- static const uchar masks[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
cppchar_t ucn;
-
- from++; /* skip u/U */
+ uchar buf[6];
+ uchar *bufp = buf;
+ size_t bytesleft = 6;
+ int rval;
+ struct cset_converter cvt
+ = wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc;
+
+ from++; /* skip u/U */
ucn = _cpp_valid_ucn (pfile, &from, limit, 0);
- if (!ucn)
- return from;
- nbytes = 1;
- if (ucn < 0x80)
- *--p = ucn;
- else
+ rval = one_cppchar_to_utf8 (ucn, &bufp, &bytesleft);
+ if (rval)
{
- do
- {
- *--p = ((ucn & 0x3F) | 0x80);
- ucn >>= 6;
- nbytes++;
- }
- while (ucn >= 0x3F || (ucn & masks[nbytes-1]));
- *--p = (ucn | masks[nbytes-1]);
+ errno = rval;
+ cpp_errno (pfile, DL_ERROR, "converting UCN to source character set");
}
-
- if (!convert_cset (wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc,
- p, nbytes, tbuf))
+ else if (!APPLY_CONVERSION (cvt, buf, 6 - bytesleft, tbuf))
cpp_errno (pfile, DL_ERROR, "converting UCN to execution character set");
return from;
@@ -615,6 +1048,8 @@ convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit,
#endif
uchar c;
+ struct cset_converter cvt
+ = wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc;
c = *from;
switch (c)
@@ -676,8 +1111,7 @@ convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit,
}
/* Now convert what we have to the execution character set. */
- if (!convert_cset (wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc,
- &c, 1, tbuf))
+ if (!APPLY_CONVERSION (cvt, &c, 1, tbuf))
cpp_errno (pfile, DL_ERROR,
"converting escape sequence to execution character set");
@@ -697,7 +1131,8 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
struct strbuf tbuf;
const uchar *p, *base, *limit;
size_t i;
- iconv_t cd = wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc;
+ struct cset_converter cvt
+ = wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc;
tbuf.asize = MAX (OUTBUF_BLOCK_SIZE, from->len);
tbuf.text = xmalloc (tbuf.asize);
@@ -719,7 +1154,7 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
{
/* We have a run of normal characters; these can be fed
directly to convert_cset. */
- if (!convert_cset (cd, base, p - base, &tbuf))
+ if (!APPLY_CONVERSION (cvt, base, p - base, &tbuf))
goto fail;
}
if (p == limit)
@@ -741,6 +1176,25 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
free (tbuf.text);
return false;
}
+
+/* Subroutine of do_line and do_linemarker. Convert escape sequences
+ in a string, but do not perform character set conversion. */
+bool
+_cpp_interpret_string_notranslate (cpp_reader *pfile, const cpp_string *in,
+ cpp_string *out)
+{
+ struct cset_converter save_narrow_cset_desc = pfile->narrow_cset_desc;
+ bool retval;
+
+ pfile->narrow_cset_desc.func = convert_no_conversion;
+ pfile->narrow_cset_desc.cd = (iconv_t) -1;
+
+ retval = cpp_interpret_string (pfile, in, 1, out, false);
+
+ pfile->narrow_cset_desc = save_narrow_cset_desc;
+ return retval;
+}
+
/* Subroutine of cpp_interpret_charconst which performs the conversion
to a number, for narrow strings. STR is the string structure returned
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index cb681f00f24..4926cb24ac5 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -25,40 +25,39 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
-static void print_location (cpp_reader *, unsigned int, unsigned int);
+static void print_location (cpp_reader *, fileline, unsigned int);
/* Print the logical file location (LINE, COL) in preparation for a
diagnostic. Outputs the #include chain if it has changed. A line
of zero suppresses the include stack, and outputs the program name
instead. */
static void
-print_location (cpp_reader *pfile, unsigned int line, unsigned int col)
+print_location (cpp_reader *pfile, fileline line, unsigned int col)
{
- if (!pfile->buffer || line == 0)
+ if (line == 0)
fprintf (stderr, "%s: ", progname);
else
{
const struct line_map *map;
+ unsigned int lin;
- map = lookup_line (&pfile->line_maps, line);
- print_containing_files (&pfile->line_maps, map);
+ map = linemap_lookup (&pfile->line_maps, line);
+ linemap_print_containing_files (&pfile->line_maps, map);
- line = SOURCE_LINE (map, line);
+ lin = SOURCE_LINE (map, line);
if (col == 0)
col = 1;
- if (line == 0)
+ if (lin == 0)
fprintf (stderr, "%s:", map->to_file);
else if (CPP_OPTION (pfile, show_column) == 0)
- fprintf (stderr, "%s:%u:", map->to_file, line);
+ fprintf (stderr, "%s:%u:", map->to_file, lin);
else
- fprintf (stderr, "%s:%u:%u:", map->to_file, line, col);
+ fprintf (stderr, "%s:%u:%u:", map->to_file, lin, col);
fputc (' ', stderr);
}
@@ -70,7 +69,7 @@ print_location (cpp_reader *pfile, unsigned int line, unsigned int col)
the correct place by default. Returns 0 if the error has been
suppressed. */
int
-_cpp_begin_message (cpp_reader *pfile, int code, unsigned int line,
+_cpp_begin_message (cpp_reader *pfile, int code, fileline line,
unsigned int column)
{
int level = DL_EXTRACT (code);
@@ -126,29 +125,25 @@ _cpp_begin_message (cpp_reader *pfile, int code, unsigned int line,
void
cpp_error (cpp_reader * pfile, int level, const char *msgid, ...)
{
- unsigned int line, column;
+ fileline line;
+ unsigned int column;
va_list ap;
va_start (ap, msgid);
- if (pfile->buffer)
+ if (CPP_OPTION (pfile, traditional))
{
- if (CPP_OPTION (pfile, traditional))
- {
- if (pfile->state.in_directive)
- line = pfile->directive_line;
- else
- line = pfile->line;
- column = 0;
- }
+ if (pfile->state.in_directive)
+ line = pfile->directive_line;
else
- {
- line = pfile->cur_token[-1].line;
- column = pfile->cur_token[-1].col;
- }
+ line = pfile->line;
+ column = 0;
}
else
- line = column = 0;
+ {
+ line = pfile->cur_token[-1].line;
+ column = pfile->cur_token[-1].col;
+ }
if (_cpp_begin_message (pfile, level, line, column))
v_message (msgid, ap);
@@ -159,7 +154,7 @@ cpp_error (cpp_reader * pfile, int level, const char *msgid, ...)
/* Print an error at a specific location. */
void
cpp_error_with_line (cpp_reader *pfile, int level,
- unsigned int line, unsigned int column,
+ fileline line, unsigned int column,
const char *msgid, ...)
{
va_list ap;
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 16082efd5e2..b4f1dcc8960 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -20,8 +20,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -489,7 +487,7 @@ parse_defined (cpp_reader *pfile)
if (node)
{
- if (pfile->context != initial_context)
+ if (pfile->context != initial_context && CPP_PEDANTIC (pfile))
cpp_error (pfile, DL_WARNING,
"this use of \"defined\" may not be portable");
@@ -968,8 +966,7 @@ _cpp_expand_op_stack (cpp_reader *pfile)
size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack);
size_t new_size = old_size * 2 + 20;
- pfile->op_stack = (struct op *) xrealloc (pfile->op_stack,
- new_size * sizeof (struct op));
+ pfile->op_stack = xrealloc (pfile->op_stack, new_size * sizeof (struct op));
pfile->op_limit = pfile->op_stack + new_size;
return pfile->op_stack + old_size;
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 019b0059318..a4edd5da33b 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -1,10 +1,11 @@
-/* Part of CPP library. (include file handling)
+/* Part of CPP library. File handling.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
Split out of cpplib.c, Zack Weinberg, Oct 1998
+ Reimplemented, Neil Booth, Jul 2003
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
@@ -22,428 +23,415 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include <dirent.h>
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
#include "mkdeps.h"
-#include "splay-tree.h"
-
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
-/* If errno is inspected immediately after a system call fails, it will be
- nonzero, and no error number will ever be zero. */
-#ifndef ENOENT
-# define ENOENT 0
-#endif
-#ifndef ENOTDIR
-# define ENOTDIR 0
-#endif
-
-/* This structure is used for the table of all includes. */
-struct include_file {
- const char *name; /* actual path name of file */
- const char *header_name; /* the original header found */
- const cpp_hashnode *cmacro; /* macro, if any, preventing reinclusion. */
- const struct cpp_path *foundhere;
- /* location in search path where file was
- found, for #include_next and sysp. */
- const unsigned char *buffer; /* pointer to cached file contents */
- struct stat st; /* copy of stat(2) data for file */
- int fd; /* fd open on file (short term storage only) */
- int err_no; /* errno obtained if opening a file failed */
- unsigned short include_count; /* number of times file has been read */
- unsigned char pch; /* 0: file not known to be a PCH.
- 1: file is a PCH
- (on return from find_include_file).
- 2: file is not and never will be a valid
- precompiled header.
- 3: file is always a valid precompiled
- header. */
-};
+#include "hashtab.h"
+#include <dirent.h>
/* Variable length record files on VMS will have a stat size that includes
record control characters that won't be included in the read size. */
#ifdef VMS
# define FAB_C_VAR 2 /* variable length records (see Starlet fabdef.h) */
-# define STAT_SIZE_TOO_BIG(ST) ((ST).st_fab_rfm == FAB_C_VAR)
+# define STAT_SIZE_RELIABLE(ST) ((ST).st_fab_rfm != FAB_C_VAR)
#else
-# define STAT_SIZE_TOO_BIG(ST) 0
+# define STAT_SIZE_RELIABLE(ST) true
#endif
-/* The cmacro works like this: If it's NULL, the file is to be
- included again. If it's NEVER_REREAD, the file is never to be
- included again. Otherwise it is a macro hashnode, and the file is
- to be included again if the macro is defined. */
-#define NEVER_REREAD ((const cpp_hashnode *) -1)
-#define DO_NOT_REREAD(inc) \
-((inc)->cmacro && ((inc)->cmacro == NEVER_REREAD \
- || (inc)->cmacro->type == NT_MACRO))
-#define NO_INCLUDE_PATH ((struct include_file *) -1)
-#define INCLUDE_PCH_P(F) (((F)->pch & 1) != 0)
-
-static struct file_name_map *read_name_map (cpp_reader *, const char *);
-static char *read_filename_string (int, FILE *);
-static char *remap_filename (cpp_reader *, char *, struct cpp_path *);
-static struct cpp_path *search_from (cpp_reader *, enum include_type);
-static struct include_file *find_include_file (cpp_reader *, const char *,
- int, enum include_type);
-static struct include_file *open_file (cpp_reader *, const char *);
-static struct include_file *validate_pch (cpp_reader *, const char *,
- const char *);
-static struct include_file *open_file_pch (cpp_reader *, const char *);
-static int read_include_file (cpp_reader *, struct include_file *);
-static bool stack_include_file (cpp_reader *, struct include_file *);
-static void purge_cache (struct include_file *);
-static void destroy_node (splay_tree_value);
-static int report_missing_guard (splay_tree_node, void *);
-static splay_tree_node find_or_create_entry (cpp_reader *, const char *);
-static void handle_missing_header (cpp_reader *, const char *, int);
-static int remove_component_p (const char *);
-
-/* Set up the splay tree we use to store information about all the
- file names seen in this compilation. We also have entries for each
- file we tried to open but failed; this saves system calls since we
- don't try to open it again in future.
-
- The key of each node is the file name, after processing by
- cpp_simplify_path. The path name may or may not be absolute.
- The path string has been malloced, as is automatically freed by
- registering free () as the splay tree key deletion function.
-
- A node's value is a pointer to a struct include_file, and is never
- NULL. */
-void
-_cpp_init_includes (cpp_reader *pfile)
-{
- pfile->all_include_files
- = splay_tree_new ((splay_tree_compare_fn) strcmp,
- (splay_tree_delete_key_fn) free,
- destroy_node);
-}
+#ifdef __DJGPP__
+ /* For DJGPP redirected input is opened in text mode. */
+# define set_stdin_to_binary_mode() \
+ if (! isatty (0)) setmode (0, O_BINARY)
+#else
+# define set_stdin_to_binary_mode() /* Nothing */
+#endif
-/* Tear down the splay tree. */
-void
-_cpp_cleanup_includes (cpp_reader *pfile)
-{
- splay_tree_delete (pfile->all_include_files);
-}
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
-/* Free a node. The path string is automatically freed. */
-static void
-destroy_node (splay_tree_value v)
+/* This structure represents a file searched for by CPP, whether it
+ exists or not. An instance may be pointed to by more than one
+ file_hash_entry; at present no reference count is kept. */
+typedef struct _cpp_file _cpp_file;
+struct _cpp_file
{
- struct include_file *f = (struct include_file *) v;
+ /* Filename as given to #include or command line switch. */
+ const char *name;
- if (f)
- {
- purge_cache (f);
- free (f);
- }
-}
+ /* The full path used to find the file. */
+ const char *path;
-/* Mark a file to not be reread (e.g. #import, read failure). */
-void
-_cpp_never_reread (struct include_file *file)
-{
- file->cmacro = NEVER_REREAD;
-}
+ /* The full path of the pch file. */
+ const char *pchname;
-/* Lookup a filename, which is simplified after making a copy, and
- create an entry if none exists. */
-static splay_tree_node
-find_or_create_entry (cpp_reader *pfile, const char *fname)
-{
- splay_tree_node node;
- struct include_file *file;
- char *name = xstrdup (fname);
- int saved_errno;
-
- cpp_simplify_path (name);
- saved_errno = errno;
- node = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) name);
- if (node)
- free (name);
- else
- {
- file = xcnew (struct include_file);
- file->name = name;
- file->header_name = name;
- file->err_no = saved_errno;
- node = splay_tree_insert (pfile->all_include_files,
- (splay_tree_key) file->name,
- (splay_tree_value) file);
- }
+ /* The file's path with the basename stripped. NULL if it hasn't
+ been calculated yet. */
+ const char *dir_name;
- return node;
-}
+ /* Chain through all files. */
+ struct _cpp_file *next_file;
-/* Enter a file name in the splay tree, for the sake of cpp_included. */
-void
-_cpp_fake_include (cpp_reader *pfile, const char *fname)
-{
- find_or_create_entry (pfile, fname);
-}
+ /* The contents of NAME after calling read_file(). */
+ const uchar *buffer;
-/* Given a file name, look it up in the cache; if there is no entry,
- create one with a non-NULL value (regardless of success in opening
- the file). If the file doesn't exist or is inaccessible, this
- entry is flagged so we don't attempt to open it again in the
- future. If the file isn't open, open it. The empty string is
- interpreted as stdin.
-
- Returns an include_file structure with an open file descriptor on
- success, or NULL on failure. */
-static struct include_file *
-open_file (cpp_reader *pfile, const char *filename)
-{
- splay_tree_node nd = find_or_create_entry (pfile, filename);
- struct include_file *file = (struct include_file *) nd->value;
+ /* The macro, if any, preventing re-inclusion. */
+ const cpp_hashnode *cmacro;
- if (file->err_no)
- {
- /* Ugh. handle_missing_header () needs errno to be set. */
- errno = file->err_no;
- return 0;
- }
+ /* The directory in the search path where FILE was found. Used for
+ #include_next and determining whether a header is a system
+ header. */
+ cpp_dir *dir;
+
+ /* As filled in by stat(2) for the file. */
+ struct stat st;
+
+ /* File descriptor. Invalid if -1, otherwise open. */
+ int fd;
- /* Don't reopen an idempotent file. */
- if (DO_NOT_REREAD (file))
- return file;
+ /* Zero if this file was successfully opened and stat()-ed,
+ otherwise errno obtained from failure. */
+ int err_no;
- /* Don't reopen one which is already loaded. */
- if (0 && file->buffer != NULL)
- return file;
+ /* Number of times the file has been stacked for preprocessing. */
+ unsigned short stack_count;
- /* We used to open files in nonblocking mode, but that caused more
- problems than it solved. Do take care not to acquire a
- controlling terminal by mistake (this can't happen on sane
- systems, but paranoia is a virtue).
+ /* If opened with #import or contains #pragma once. */
+ bool once_only;
- Use the three-argument form of open even though we aren't
- specifying O_CREAT, to defend against broken system headers.
+ /* If read() failed before. */
+ bool dont_read;
- O_BINARY tells some runtime libraries (notably DJGPP) not to do
- newline translation; we can handle DOS line breaks just fine
- ourselves.
+ /* If this file is the main file. */
+ bool main_file;
- Special case: the empty string is translated to stdin. */
+ /* If BUFFER above contains the true contents of the file. */
+ bool buffer_valid;
- if (filename[0] == '\0')
+ /* 0: file not known to be a PCH.
+ 1: file is a PCH (on return from find_include_file).
+ 2: file is not and never will be a valid precompiled header.
+ 3: file is always a valid precompiled header. */
+ uchar pch;
+};
+
+/* A singly-linked list for all searches for a given file name, with
+ its head pointed to by a slot in FILE_HASH. The file name is what
+ appeared between the quotes in a #include directive; it can be
+ determined implicitly from the hash table location or explicitly
+ from FILE->name.
+
+ FILE is a structure containing details about the file that was
+ found with that search, or details of how the search failed.
+
+ START_DIR is the starting location of the search in the include
+ chain. The current directories for "" includes are also hashed in
+ the hash table and therefore unique. Files that are looked up
+ without using a search path, such as absolute filenames and file
+ names from the command line share a special starting directory so
+ they don't cause cache hits with normal include-chain lookups.
+
+ If START_DIR is NULL then the entry is for a directory, not a file,
+ and the directory is in DIR. Since the starting point in a file
+ lookup chain is never NULL, this means that simple pointer
+ comparisons against START_DIR can be made to determine cache hits
+ in file lookups.
+
+ If a cache lookup fails because of e.g. an extra "./" in the path,
+ then nothing will break. It is just less efficient as CPP will
+ have to do more work re-preprocessing the file, and/or comparing
+ its contents against earlier once-only files.
+*/
+struct file_hash_entry
+{
+ struct file_hash_entry *next;
+ cpp_dir *start_dir;
+ union
+ {
+ _cpp_file *file;
+ cpp_dir *dir;
+ } u;
+};
+
+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 _cpp_file *find_file (cpp_reader *, const char *fname,
+ cpp_dir *start_dir, bool fake);
+static bool read_file_guts (cpp_reader *pfile, _cpp_file *file);
+static bool read_file (cpp_reader *pfile, _cpp_file *file);
+static bool stack_file (cpp_reader *, _cpp_file *file, bool import);
+static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import);
+static struct cpp_dir *search_path_head (cpp_reader *, const char *fname,
+ int angle_brackets, enum include_type);
+static const char *dir_name_of_file (_cpp_file *file);
+static void open_file_failed (cpp_reader *pfile, _cpp_file *file);
+static struct file_hash_entry *search_cache (struct file_hash_entry *head,
+ const cpp_dir *start_dir);
+static _cpp_file *make_cpp_file (cpp_reader *, cpp_dir *, const char *fname);
+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 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);
+static char *append_file_to_dir (const char *fname, cpp_dir *dir);
+static bool validate_pch (cpp_reader *, _cpp_file *file, const char *pchname);
+static bool include_pch_p (_cpp_file *file);
+
+/* Given a filename in FILE->PATH, with the empty string interpreted
+ as <stdin>, open it.
+
+ On success FILE contains an open file descriptor and stat
+ information for the file. On failure the file descriptor is -1 and
+ the appropriate errno is also stored in FILE. Returns TRUE iff
+ successful.
+
+ We used to open files in nonblocking mode, but that caused more
+ problems than it solved. Do take care not to acquire a controlling
+ terminal by mistake (this can't happen on sane systems, but
+ paranoia is a virtue).
+
+ Use the three-argument form of open even though we aren't
+ specifying O_CREAT, to defend against broken system headers.
+
+ O_BINARY tells some runtime libraries (notably DJGPP) not to do
+ newline translation; we can handle DOS line breaks just fine
+ ourselves. */
+static bool
+open_file (_cpp_file *file)
+{
+ if (file->path[0] == '\0')
{
file->fd = 0;
-#ifdef __DJGPP__
- /* For DJGPP redirected input is opened in text mode. Change it
- to binary mode. */
- if (! isatty (file->fd))
- setmode (file->fd, O_BINARY);
-#endif
+ set_stdin_to_binary_mode ();
}
else
- file->fd = open (file->name, O_RDONLY | O_NOCTTY | O_BINARY, 0666);
+ file->fd = open (file->path, O_RDONLY | O_NOCTTY | O_BINARY, 0666);
- if (file->fd != -1 && fstat (file->fd, &file->st) == 0)
+ if (file->fd != -1)
{
- if (!S_ISDIR (file->st.st_mode))
- return file;
+ if (fstat (file->fd, &file->st) == 0)
+ {
+ if (!S_ISDIR (file->st.st_mode))
+ {
+ file->err_no = 0;
+ return true;
+ }
+
+ /* Ignore a directory and continue the search. The file we're
+ looking for may be elsewhere in the search path. */
+ errno = ENOENT;
+ }
- /* If it's a directory, we return null and continue the search
- as the file we're looking for may appear elsewhere in the
- search path. */
- errno = ENOENT;
close (file->fd);
file->fd = -1;
}
+ else if (errno == ENOTDIR)
+ errno = ENOENT;
file->err_no = errno;
- return 0;
+
+ return false;
}
-static struct include_file *
-validate_pch (cpp_reader *pfile, const char *filename, const char *pchname)
+/* Temporary PCH intercept of opening a file. */
+static bool
+pch_open_file (cpp_reader *pfile, _cpp_file *file)
{
- struct include_file * file;
-
- file = open_file (pfile, pchname);
- if (file == NULL)
- return NULL;
- if ((file->pch & 2) == 0)
- file->pch = pfile->cb.valid_pch (pfile, pchname, file->fd);
- if (CPP_OPTION (pfile, print_include_names))
- {
- unsigned int i;
- for (i = 1; i < pfile->line_maps.depth; i++)
- putc ('.', stderr);
- fprintf (stderr, "%c %s\n", INCLUDE_PCH_P (file) ? '!' : 'x', pchname);
- }
- if (INCLUDE_PCH_P (file))
- {
- char *f = xstrdup (filename);
- cpp_simplify_path (f);
- file->header_name = f;
- return file;
- }
- close (file->fd);
- file->fd = -1;
- return NULL;
-}
+ static const char extension[] = ".gch";
+ const char *path = file->path;
+ size_t len, flen;
+ char *pchname;
+ struct stat st;
+ bool valid = false;
+
+ /* No PCH on <stdin> or if not requested. */
+ if (file->name[0] == '\0' || !pfile->cb.valid_pch)
+ return false;
+ flen = strlen (path);
+ len = flen + sizeof (extension);
+ pchname = xmalloc (len);
+ memcpy (pchname, path, flen);
+ memcpy (pchname + flen, extension, sizeof (extension));
-/* Like open_file, but also look for a precompiled header if (a) one exists
- and (b) it is valid. */
-static struct include_file *
-open_file_pch (cpp_reader *pfile, const char *filename)
-{
- if (filename[0] != '\0'
- && pfile->cb.valid_pch != NULL)
+ if (stat (pchname, &st) == 0)
{
- size_t namelen = strlen (filename);
- char *pchname = alloca (namelen + 5);
- struct include_file * file;
- splay_tree_node nd;
-
- memcpy (pchname, filename, namelen);
- memcpy (pchname + namelen, ".gch", 5);
-
- nd = find_or_create_entry (pfile, pchname);
- file = (struct include_file *) nd->value;
-
- if (file != NULL)
+ DIR *pchdir;
+ struct dirent *d;
+ size_t dlen, plen = len;
+
+ if (!S_ISDIR (st.st_mode))
+ valid = validate_pch (pfile, file, pchname);
+ else if ((pchdir = opendir (pchname)) != NULL)
{
- if (stat (file->name, &file->st) == 0 && S_ISDIR (file->st.st_mode))
+ pchname[plen - 1] = '/';
+ while ((d = readdir (pchdir)) != NULL)
{
- DIR * thedir;
- struct dirent *d;
- size_t subname_len = namelen + 64;
- char *subname = xmalloc (subname_len);
-
- thedir = opendir (pchname);
- if (thedir == NULL)
- return NULL;
- memcpy (subname, pchname, namelen + 4);
- subname[namelen+4] = '/';
- while ((d = readdir (thedir)) != NULL)
+ dlen = strlen (d->d_name) + 1;
+ if (dlen + plen > len)
{
- if (strlen (d->d_name) + namelen + 7 > subname_len)
- {
- subname_len = strlen (d->d_name) + namelen + 64;
- subname = xrealloc (subname, subname_len);
- }
- strcpy (subname + namelen + 5, d->d_name);
- file = validate_pch (pfile, filename, subname);
- if (file)
- break;
+ len += dlen + 64;
+ pchname = xrealloc (pchname, len);
}
- closedir (thedir);
- free (subname);
+ memcpy (pchname + plen, d->d_name, dlen);
+ valid = validate_pch (pfile, file, pchname);
+ if (valid)
+ break;
}
- else
- file = validate_pch (pfile, filename, pchname);
- if (file)
- return file;
+ closedir (pchdir);
}
}
- return open_file (pfile, filename);
+
+ if (valid)
+ file->pchname = pchname;
+ else
+ free (pchname);
+
+ return valid;
}
-/* Place the file referenced by INC into a new buffer on the buffer
- stack, unless there are errors, or the file is not re-included
- because of e.g. multiple-include guards. Returns true if a buffer
- is stacked. */
+/* 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. */
static bool
-stack_include_file (cpp_reader *pfile, struct include_file *inc)
+find_file_in_dir (cpp_reader *pfile, _cpp_file *file)
{
- cpp_buffer *fp;
- int sysp;
- const char *filename;
+ char *path;
- if (DO_NOT_REREAD (inc))
- return false;
+ if (CPP_OPTION (pfile, remap) && (path = remap_filename (pfile, file)))
+ ;
+ else
+ path = append_file_to_dir (file->name, file->dir);
- sysp = MAX ((pfile->map ? pfile->map->sysp : 0),
- (inc->foundhere ? inc->foundhere->sysp : 0));
+ file->path = path;
+ if (pch_open_file (pfile, file))
+ return true;
- /* Add the file to the dependencies on its first inclusion. */
- if (CPP_OPTION (pfile, deps.style) > !!sysp && !inc->include_count)
- {
- if (pfile->buffer || CPP_OPTION (pfile, deps.ignore_main_file) == 0)
- deps_add_dep (pfile->deps, inc->name);
- }
+ if (open_file (file))
+ return true;
- /* PCH files get dealt with immediately. */
- if (INCLUDE_PCH_P (inc))
+ if (file->err_no != ENOENT)
{
- pfile->cb.read_pch (pfile, inc->name, inc->fd, inc->header_name);
- close (inc->fd);
- inc->fd = -1;
- return false;
+ open_file_failed (pfile, file);
+ return true;
}
- /* Not in cache? */
- if (1 || ! inc->buffer)
+ free (path);
+ file->path = file->name;
+ return false;
+}
+
+/* Given a filename FNAME search for such a file in the include path
+ starting from START_DIR. If FNAME is the empty string it is
+ interpreted as STDIN if START_DIR is PFILE->no_seach_path.
+
+ If the file is not found in the file cache fall back to the O/S and
+ add the result to our cache.
+
+ If the file was not found in the filesystem, or there was an error
+ opening it, then ERR_NO is nonzero and FD is -1. If the file was
+ found, then ERR_NO is zero and FD could be -1 or an open file
+ descriptor. FD can be -1 if the file was found in the cache and
+ had previously been closed. To open it again pass the return value
+ to open_file().
+*/
+static _cpp_file *
+find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake)
+{
+ struct file_hash_entry *entry, **hash_slot;
+ _cpp_file *file;
+
+ /* Ensure we get no confusion between cached files and directories. */
+ if (start_dir == NULL)
+ cpp_error (pfile, DL_ICE, "NULL directory in find_file");
+
+ hash_slot = (struct file_hash_entry **)
+ htab_find_slot (pfile->file_hash, fname, INSERT);
+
+ /* First check the cache before we resort to memory allocation. */
+ entry = search_cache (*hash_slot, start_dir);
+ if (entry)
+ return entry->u.file;
+
+ file = make_cpp_file (pfile, start_dir, fname);
+
+ /* Try each path in the include chain. */
+ for (; !fake ;)
{
- if (read_include_file (pfile, inc))
+ if (find_file_in_dir (pfile, file))
+ break;
+
+ file->dir = file->dir->next;
+ if (file->dir == NULL)
{
- /* If an error occurs, do not try to read this file again. */
- _cpp_never_reread (inc);
- return false;
+ open_file_failed (pfile, file);
+ break;
}
- /* Mark a regular, zero-length file never-reread. We read it,
- NUL-terminate it, and stack it once, so preprocessing a main
- file of zero length does not raise an error. */
- if (S_ISREG (inc->st.st_mode) && inc->st.st_size == 0)
- _cpp_never_reread (inc);
- close (inc->fd);
- inc->fd = -1;
- }
- if (pfile->buffer)
- /* We don't want MI guard advice for the main file. */
- inc->include_count++;
+ /* Only check the cache for the starting location (done above)
+ and the quote and bracket chain heads because there are no
+ other possible starting points for searches. */
+ if (file->dir != pfile->bracket_include
+ && file->dir != pfile->quote_include)
+ continue;
- /* Push a buffer. */
- fp = cpp_push_buffer (pfile, inc->buffer, inc->st.st_size,
- /* from_stage3 */ CPP_OPTION (pfile, preprocessed), 0);
- fp->inc = inc;
+ entry = search_cache (*hash_slot, file->dir);
+ if (entry)
+ break;
+ }
- /* Initialize controlling macro state. */
- pfile->mi_valid = true;
- pfile->mi_cmacro = 0;
+ if (entry)
+ {
+ /* Cache for START_DIR too, sharing the _cpp_file structure. */
+ free ((char *) file->name);
+ free (file);
+ file = entry->u.file;
+ }
+ else
+ {
+ /* This is a new file; put it in the list. */
+ file->next_file = pfile->all_files;
+ pfile->all_files = file;
+ }
- /* Generate the call back. */
- filename = inc->name;
- if (*filename == '\0')
- filename = "<stdin>";
- _cpp_do_file_change (pfile, LC_ENTER, filename, 1, sysp);
+ /* Store this new result in the hash table. */
+ entry = new_file_hash_entry (pfile);
+ entry->next = *hash_slot;
+ entry->start_dir = start_dir;
+ entry->u.file = file;
+ *hash_slot = entry;
- return true;
+ return file;
}
-/* Read the file referenced by INC into the file cache.
-
- If fd points to a plain file, we might be able to mmap it; we can
- definitely allocate the buffer all at once. If fd is a pipe or
- terminal, we can't do either. If fd is something weird, like a
- block device, we don't want to read it at all.
+/* Read a file into FILE->buffer, returning true on success.
- Unfortunately, different systems use different st.st_mode values
- for pipes: some have S_ISFIFO, some S_ISSOCK, some are buggy and
- zero the entire struct stat except a couple fields. Hence we don't
- even try to figure out what something is, except for plain files
- and block devices.
+ If FILE->fd is something weird, like a block device, we don't want
+ to read it at all. Don't even try to figure out what something is,
+ except for plain files and block devices, since there is no
+ reliable portable way of doing this.
FIXME: Flush file cache and try again if we run out of memory. */
-static int
-read_include_file (cpp_reader *pfile, struct include_file *inc)
+static bool
+read_file_guts (cpp_reader *pfile, _cpp_file *file)
{
- ssize_t size, offset, count;
+ ssize_t size, total, count;
uchar *buf;
+ bool regular;
+
+ if (S_ISBLK (file->st.st_mode))
+ {
+ cpp_error (pfile, DL_ERROR, "%s is a block device", file->path);
+ return false;
+ }
- if (S_ISREG (inc->st.st_mode))
+ regular = S_ISREG (file->st.st_mode);
+ if (regular)
{
/* off_t might have a wider range than ssize_t - in other words,
the max size of a file might be bigger than the address
@@ -453,191 +441,443 @@ read_include_file (cpp_reader *pfile, struct include_file *inc)
SSIZE_MAX to be much smaller than the actual range of the
type. Use INTTYPE_MAXIMUM unconditionally to ensure this
does not bite us. */
- if (inc->st.st_size > INTTYPE_MAXIMUM (ssize_t))
+ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t))
{
- cpp_error (pfile, DL_ERROR, "%s is too large", inc->name);
- goto fail;
+ cpp_error (pfile, DL_ERROR, "%s is too large", file->path);
+ return false;
}
- size = inc->st.st_size;
- {
- buf = (uchar *) xmalloc (size + 1);
- offset = 0;
- while (offset < size)
- {
- count = read (inc->fd, buf + offset, size - offset);
- if (count < 0)
- goto perror_fail;
- if (count == 0)
- {
- if (!STAT_SIZE_TOO_BIG (inc->st))
- cpp_error (pfile, DL_WARNING,
- "%s is shorter than expected", inc->name);
- size = offset;
- buf = xrealloc (buf, size + 1);
- inc->st.st_size = size;
- break;
- }
- offset += count;
- }
- /* The lexer requires that the buffer be \n-terminated. */
- buf[size] = '\n';
- }
- }
- else if (S_ISBLK (inc->st.st_mode))
- {
- cpp_error (pfile, DL_ERROR, "%s is a block device", inc->name);
- goto fail;
+ size = file->st.st_size;
}
else
+ /* 8 kilobytes is a sensible starting size. It ought to be bigger
+ than the kernel pipe buffer, and it's definitely bigger than
+ the majority of C source files. */
+ size = 8 * 1024;
+
+ buf = xmalloc (size + 1);
+ total = 0;
+ while ((count = read (file->fd, buf + total, size - total)) > 0)
{
- /* 8 kilobytes is a sensible starting size. It ought to be
- bigger than the kernel pipe buffer, and it's definitely
- bigger than the majority of C source files. */
- size = 8 * 1024;
-
- buf = (uchar *) xmalloc (size + 1);
- offset = 0;
- while ((count = read (inc->fd, buf + offset, size - offset)) > 0)
+ total += count;
+
+ if (total == size)
{
- offset += count;
- if (offset == size)
- {
- size *= 2;
- buf = xrealloc (buf, size + 1);
- }
+ if (regular)
+ break;
+ size *= 2;
+ buf = xrealloc (buf, size + 1);
}
- if (count < 0)
- goto perror_fail;
-
- if (offset + 1 < size)
- buf = xrealloc (buf, offset + 1);
+ }
- /* The lexer requires that the buffer be \n-terminated. */
- buf[offset] = '\n';
- inc->st.st_size = offset;
+ if (count < 0)
+ {
+ cpp_errno (pfile, DL_ERROR, file->path);
+ return false;
}
- inc->buffer = buf;
- return 0;
+ if (regular && total != size && STAT_SIZE_RELIABLE (file->st))
+ cpp_error (pfile, DL_WARNING, "%s is shorter than expected", file->path);
+
+ /* Shrink buffer if we allocated substantially too much. */
+ if (total + 4096 < size)
+ buf = xrealloc (buf, total + 1);
- perror_fail:
- cpp_errno (pfile, DL_ERROR, inc->name);
- fail:
- return 1;
+ /* The lexer requires that the buffer be \n-terminated. */
+ buf[total] = '\n';
+
+ file->buffer = buf;
+ file->st.st_size = total;
+ file->buffer_valid = true;
+
+ return true;
}
-/* Drop INC's buffer from memory. */
-static void
-purge_cache (struct include_file *inc)
+/* Convenience wrapper around read_file_guts that opens the file if
+ necessary and closes the file descriptor after reading. FILE must
+ have been passed through find_file() at some stage. */
+static bool
+read_file (cpp_reader *pfile, _cpp_file *file)
{
- if (inc->buffer)
+ /* If we already have its contents in memory, succeed immediately. */
+ if (file->buffer_valid)
+ return true;
+
+ /* If an earlier read failed for some reason don't try again. */
+ if (file->dont_read || file->err_no)
+ return false;
+
+ if (file->fd == -1 && !open_file (file))
{
- free ((void *) inc->buffer);
- inc->buffer = NULL;
+ open_file_failed (pfile, file);
+ return false;
}
+
+ file->dont_read = !read_file_guts (pfile, file);
+ close (file->fd);
+ file->fd = -1;
+
+ return !file->dont_read;
}
-/* Return 1 if the file named by FNAME has been included before in
- any context, 0 otherwise. */
-int
-cpp_included (cpp_reader *pfile, const char *fname)
+/* Returns TRUE if FILE's contents have been successfully placed in
+ FILE->buffer and the file should be stacked, otherwise false. */
+static bool
+should_stack_file (cpp_reader *pfile, _cpp_file *file, bool import)
{
- struct cpp_path *path;
- char *name, *n;
- splay_tree_node nd;
+ _cpp_file *f;
- if (IS_ABSOLUTE_PATH (fname))
+ /* Skip once-only files. */
+ if (file->once_only)
+ return false;
+
+ /* We must mark the file once-only if #import now, before header
+ guard checks. Otherwise, undefining the header guard might
+ cause the file to be re-stacked. */
+ if (import)
{
- /* Just look it up. */
- nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
- return (nd && nd->value);
+ _cpp_mark_file_once_only (pfile, file);
+
+ /* Don't stack files that have been stacked before. */
+ if (file->stack_count)
+ return false;
}
- /* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
- for (path = pfile->quote_include; path; path = path->next)
+ /* Skip if the file had a header guard and the macro is defined.
+ PCH relies on this appearing before the PCH handler below. */
+ if (file->cmacro && file->cmacro->type == NT_MACRO)
+ return false;
+
+ /* Handle PCH files immediately; don't stack them. */
+ if (include_pch_p (file))
{
- memcpy (name, path->name, path->len);
- name[path->len] = '/';
- strcpy (&name[path->len + 1], fname);
- if (CPP_OPTION (pfile, remap))
- n = remap_filename (pfile, name, path);
- else
- n = name;
+ pfile->cb.read_pch (pfile, file->path, file->fd, file->pchname);
+ close (file->fd);
+ file->fd = -1;
+ return false;
+ }
- nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) n);
- if (nd && nd->value)
- return 1;
+ if (!read_file (pfile, file))
+ return false;
+
+ /* Now we've read the file's contents, we can stack it if there
+ are no once-only files. */
+ if (!pfile->seen_once_only)
+ return true;
+
+ /* We may have read the file under a different name. Look
+ for likely candidates and compare file contents to be sure. */
+ for (f = pfile->all_files; f; f = f->next_file)
+ {
+ if (f == file)
+ continue;
+
+ if ((import || f->once_only)
+ && f->err_no == 0
+ && f->st.st_mtime == file->st.st_mtime
+ && f->st.st_size == file->st.st_size
+ && read_file (pfile, f)
+ /* Size might have changed in read_file(). */
+ && f->st.st_size == file->st.st_size
+ && !memcmp (f->buffer, file->buffer, f->st.st_size))
+ break;
}
- return 0;
+
+ return f == NULL;
}
-/* Search for FNAME. Return 0 if there is no such file (or it's
- un-openable), in which case an error code will be in errno. If
- there is no include path to use it returns NO_INCLUDE_PATH,
- otherwise an include_file structure. If this request originates
- from a directive of TYPE #include_next, set INCLUDE_NEXT to true. */
-static struct include_file *
-find_include_file (cpp_reader *pfile, const char *fname, int angle_brackets,
- enum include_type type)
+/* Place the file referenced by FILE into a new buffer on the buffer
+ stack if possible. IMPORT is true if this stacking attempt is
+ because of a #import directive. Returns true if a buffer is
+ stacked. */
+static bool
+stack_file (cpp_reader *pfile, _cpp_file *file, bool import)
{
- struct cpp_path *path;
- struct include_file *file;
- char *name, *n;
+ cpp_buffer *buffer;
+ int sysp;
+
+ if (!should_stack_file (pfile, file, import))
+ return false;
+
+ sysp = MAX ((pfile->map ? pfile->map->sysp : 0),
+ (file->dir ? file->dir->sysp : 0));
- if (*fname == '\0')
+ /* Add the file to the dependencies on its first inclusion. */
+ if (CPP_OPTION (pfile, deps.style) > !!sysp && !file->stack_count)
{
- cpp_error (pfile, DL_ERROR, "empty file name");
- return NO_INCLUDE_PATH;
+ if (!file->main_file || !CPP_OPTION (pfile, deps.ignore_main_file))
+ deps_add_dep (pfile->deps, file->path);
}
+ /* Clear buffer_valid since _cpp_clean_line messes it up. */
+ file->buffer_valid = false;
+ file->stack_count++;
+
+ /* Stack the buffer. */
+ buffer = cpp_push_buffer (pfile, file->buffer, file->st.st_size,
+ CPP_OPTION (pfile, preprocessed),
+ ! pfile->buffer);
+ buffer->file = file;
+
+ /* Initialize controlling macro state. */
+ pfile->mi_valid = true;
+ pfile->mi_cmacro = 0;
+
+ /* Generate the call back. */
+ _cpp_do_file_change (pfile, LC_ENTER, file->path, 1, sysp);
+
+ return true;
+}
+
+/* Mark FILE to be included once only. */
+void
+_cpp_mark_file_once_only (cpp_reader *pfile, _cpp_file *file)
+{
+ pfile->seen_once_only = true;
+ file->once_only = true;
+}
+
+/* Return the directory from which searching for FNAME should start,
+ condiering the directive TYPE and ANGLE_BRACKETS. If there is
+ nothing left in the path, returns NULL. */
+static struct cpp_dir *
+search_path_head (cpp_reader *pfile, const char *fname, int angle_brackets,
+ enum include_type type)
+{
+ cpp_dir *dir;
+ _cpp_file *file;
+
if (IS_ABSOLUTE_PATH (fname))
- return open_file_pch (pfile, fname);
+ return &pfile->no_search_path;
+
+ file = pfile->buffer->file;
/* For #include_next, skip in the search path past the dir in which
the current file was found, but if it was found via an absolute
path use the normal search logic. */
- if (type == IT_INCLUDE_NEXT && pfile->buffer->inc->foundhere)
- path = pfile->buffer->inc->foundhere->next;
+ if (type == IT_INCLUDE_NEXT && file->dir)
+ dir = file->dir->next;
else if (angle_brackets)
- path = pfile->bracket_include;
+ dir = pfile->bracket_include;
+ else if (type == IT_CMDLINE)
+ /* -include and -imacros use the #include "" chain with the
+ preprocessor's cwd prepended. */
+ return make_cpp_dir (pfile, "./", false);
+ else if (pfile->quote_ignores_source_dir)
+ dir = pfile->quote_include;
else
- path = search_from (pfile, type);
+ return make_cpp_dir (pfile, dir_name_of_file (file), pfile->map->sysp);
+
+ if (dir == NULL)
+ cpp_error (pfile, DL_ERROR,
+ "no include path in which to search for %s", fname);
- if (path == NULL)
+ return dir;
+}
+
+/* Strip the basename from the file's path. It ends with a slash if
+ of nonzero length. Note that this procedure also works for
+ <stdin>, which is represented by the empty string. */
+static const char *
+dir_name_of_file (_cpp_file *file)
+{
+ if (!file->dir_name)
{
- cpp_error (pfile, DL_ERROR, "no include path in which to find %s",
- fname);
- return NO_INCLUDE_PATH;
+ size_t len = lbasename (file->path) - file->path;
+ char *dir_name = xmalloc (len + 1);
+
+ memcpy (dir_name, file->path, len);
+ dir_name[len] = '\0';
+ file->dir_name = dir_name;
}
- /* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
- for (; path; path = path->next)
+ return file->dir_name;
+}
+
+/* Push an input buffer with the contents of FNAME, the empty string
+ for standard input. Return true if a buffer was stacked. */
+bool
+_cpp_stack_file (cpp_reader *pfile, const char *fname)
+{
+ struct cpp_dir *dir = &pfile->no_search_path;
+
+ return stack_file (pfile, find_file (pfile, fname, dir, false), false);
+}
+
+/* Handles #include-family directives (distinguished by TYPE),
+ including HEADER, and the command line -imacros and -include.
+ Returns true if a buffer was stacked. */
+bool
+_cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets,
+ enum include_type type)
+{
+ struct cpp_dir *dir;
+
+ dir = search_path_head (pfile, fname, angle_brackets, type);
+ if (!dir)
+ return false;
+
+ return stack_file (pfile, find_file (pfile, fname, dir, false),
+ type == IT_IMPORT);
+}
+
+/* Could not open FILE. The complication is dependency output. */
+static void
+open_file_failed (cpp_reader *pfile, _cpp_file *file)
+{
+ int sysp = pfile->map ? pfile->map->sysp: 0;
+ bool print_dep = CPP_OPTION (pfile, deps.style) > !!sysp;
+
+ errno = file->err_no;
+ if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT)
+ deps_add_dep (pfile->deps, file->name);
+ else
{
- int len = path->len;
- memcpy (name, path->name, len);
- /* Don't turn / into // or // into ///; // may be a namespace
- escape. */
- if (name[len-1] == '/')
- len--;
- name[len] = '/';
- strcpy (&name[len + 1], fname);
- if (CPP_OPTION (pfile, remap))
- n = remap_filename (pfile, name, path);
+ /* 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);
else
- n = name;
-
- file = open_file_pch (pfile, n);
- if (file)
- {
- file->foundhere = path;
- return file;
- }
+ cpp_errno (pfile, DL_ERROR, file->path);
}
+}
- return 0;
+/* Search in the chain beginning at HEAD for a file whose search path
+ started at START_DIR != NULL. */
+static struct file_hash_entry *
+search_cache (struct file_hash_entry *head, const cpp_dir *start_dir)
+{
+ while (head && head->start_dir != start_dir)
+ head = head->next;
+
+ return head;
+}
+
+/* Allocate a new _cpp_file structure. */
+static _cpp_file *
+make_cpp_file (cpp_reader *pfile, cpp_dir *dir, const char *fname)
+{
+ _cpp_file *file;
+
+ file = xcalloc (1, sizeof (_cpp_file));
+ file->main_file = !pfile->buffer;
+ file->fd = -1;
+ file->dir = dir;
+ file->name = xstrdup (fname);
+
+ return file;
+}
+
+/* A hash of directory names. The directory names are the path names
+ of files which contain a #include "", the included file name is
+ appended to this directories.
+
+ To avoid duplicate entries we follow the convention that all
+ non-empty directory names should end in a '/'. DIR_NAME must be
+ stored in permanently allocated memory. */
+static cpp_dir *
+make_cpp_dir (cpp_reader *pfile, const char *dir_name, int sysp)
+{
+ struct file_hash_entry *entry, **hash_slot;
+ cpp_dir *dir;
+
+ hash_slot = (struct file_hash_entry **)
+ htab_find_slot (pfile->file_hash, dir_name, INSERT);
+
+ /* Have we already hashed this directory? */
+ for (entry = *hash_slot; entry; entry = entry->next)
+ if (entry->start_dir == NULL)
+ return entry->u.dir;
+
+ dir = xcalloc (1, sizeof (cpp_dir));
+ dir->next = pfile->quote_include;
+ dir->name = (char *) dir_name;
+ dir->len = strlen (dir_name);
+ dir->sysp = sysp;
+
+ /* Store this new result in the hash table. */
+ entry = new_file_hash_entry (pfile);
+ entry->next = *hash_slot;
+ entry->start_dir = NULL;
+ entry->u.dir = dir;
+ *hash_slot = entry;
+
+ return dir;
+}
+
+/* Create a new block of memory for file hash entries. */
+static void
+allocate_file_hash_entries (cpp_reader *pfile)
+{
+ pfile->file_hash_entries_used = 0;
+ pfile->file_hash_entries_allocated = 127;
+ pfile->file_hash_entries = xmalloc
+ (pfile->file_hash_entries_allocated * sizeof (struct file_hash_entry));
+}
+
+/* Return a new file hash entry. */
+static struct file_hash_entry *
+new_file_hash_entry (cpp_reader *pfile)
+{
+ if (pfile->file_hash_entries_used == pfile->file_hash_entries_allocated)
+ allocate_file_hash_entries (pfile);
+
+ return &pfile->file_hash_entries[pfile->file_hash_entries_used++];
+}
+
+/* Returns TRUE if a file FNAME has ever been successfully opened.
+ This routine is not intended to correctly handle filenames aliased
+ by links or redundant . or .. traversals etc. */
+bool
+cpp_included (cpp_reader *pfile, const char *fname)
+{
+ struct file_hash_entry *entry;
+
+ entry = htab_find (pfile->file_hash, fname);
+
+ while (entry && (entry->start_dir == NULL || entry->u.file->err_no))
+ entry = entry->next;
+
+ return entry != NULL;
+}
+
+/* Compare a string Q against a file hash entry P. */
+static int
+hash_string_eq (const void *p, const void *q)
+{
+ struct file_hash_entry *entry = (struct file_hash_entry *) p;
+ const char *fname = (const char *) q;
+ const char *hname;
+
+ if (entry->start_dir)
+ hname = entry->u.file->name;
+ else
+ hname = entry->u.dir->name;
+
+ return strcmp (hname, fname) == 0;
+}
+
+/* Initialize everything in this source file. */
+void
+_cpp_init_files (cpp_reader *pfile)
+{
+ pfile->file_hash = htab_create_alloc (127, htab_hash_string, hash_string_eq,
+ NULL, xcalloc, free);
+ allocate_file_hash_entries (pfile);
+}
+
+/* Finalize everything in this source file. */
+void
+_cpp_cleanup_files (cpp_reader *pfile)
+{
+ htab_delete (pfile->file_hash);
+}
+
+/* Enter a file name in the hash for the sake of cpp_included. */
+void
+_cpp_fake_include (cpp_reader *pfile, const char *fname)
+{
+ find_file (pfile, fname, pfile->buffer->file->dir, true);
}
/* Not everyone who wants to set system-header-ness on a buffer can
@@ -665,79 +905,44 @@ cpp_change_file (cpp_reader *pfile, enum lc_reason reason,
_cpp_do_file_change (pfile, reason, new_name, 1, 0);
}
-/* Report on all files that might benefit from a multiple include guard.
- Triggered by -H. */
-void
-_cpp_report_missing_guards (cpp_reader *pfile)
-{
- int banner = 0;
- splay_tree_foreach (pfile->all_include_files, report_missing_guard, &banner);
-}
-
-/* Callback function for splay_tree_foreach(). */
+/* Callback function for htab_traverse. */
static int
-report_missing_guard (splay_tree_node n, void *b)
+report_missing_guard (void **slot, void *b)
{
- struct include_file *f = (struct include_file *) n->value;
+ struct file_hash_entry *entry = (struct file_hash_entry *) *slot;
int *bannerp = (int *) b;
- if (f && f->cmacro == 0 && f->include_count == 1)
+ /* Skip directories. */
+ if (entry->start_dir != NULL)
{
- if (*bannerp == 0)
+ _cpp_file *file = entry->u.file;
+
+ /* We don't want MI guard advice for the main file. */
+ if (file->cmacro == NULL && file->stack_count == 1 && !file->main_file)
{
- fputs (_("Multiple include guards may be useful for:\n"), stderr);
- *bannerp = 1;
+ if (*bannerp == 0)
+ {
+ fputs (_("Multiple include guards may be useful for:\n"),
+ stderr);
+ *bannerp = 1;
+ }
+
+ fputs (entry->u.file->path, stderr);
+ putc ('\n', stderr);
}
- fputs (f->name, stderr);
- putc ('\n', stderr);
}
- return 0;
-}
-/* Create a dependency for file FNAME, or issue an error message as
- appropriate. ANGLE_BRACKETS is nonzero if the file was bracketed
- like <..>. */
-static void
-handle_missing_header (cpp_reader *pfile, const char *fname,
- int angle_brackets)
-{
- bool print_dep
- = CPP_OPTION (pfile, deps.style) > (angle_brackets || pfile->map->sysp);
-
- if (CPP_OPTION (pfile, deps.missing_files) && print_dep)
- deps_add_dep (pfile->deps, fname);
- /* If -M was specified, then don't count this as an error, because
- we can still produce correct output. Otherwise, we can't produce
- correct output, because there may be dependencies we need inside
- the missing file, and we don't know what directory this missing
- file exists in. */
- else
- cpp_errno (pfile, CPP_OPTION (pfile, deps.style) && ! print_dep
- ? DL_WARNING: DL_ERROR, fname);
+ return 0;
}
-/* Handles #include-family directives (distinguished by TYPE),
- including HEADER, and the command line -imacros and -include.
- Returns true if a buffer was stacked. */
-bool
-_cpp_execute_include (cpp_reader *pfile, const char *fname, int angle_brackets,
- enum include_type type)
+/* Report on all files that might benefit from a multiple include guard.
+ Triggered by -H. */
+void
+_cpp_report_missing_guards (cpp_reader *pfile)
{
- bool stacked = false;
- struct include_file *inc;
-
- inc = find_include_file (pfile, fname, angle_brackets, type);
- if (inc == 0)
- handle_missing_header (pfile, fname, angle_brackets);
- else if (inc != NO_INCLUDE_PATH)
- {
- stacked = stack_include_file (pfile, inc);
-
- if (type == IT_IMPORT)
- _cpp_never_reread (inc);
- }
+ int banner = 0;
- return stacked;
+ htab_traverse (pfile->file_hash, report_missing_guard, &banner);
}
/* Locate HEADER, and determine whether it is newer than the current
@@ -747,134 +952,96 @@ int
_cpp_compare_file_date (cpp_reader *pfile, const char *fname,
int angle_brackets)
{
- struct include_file *inc;
+ _cpp_file *file;
+ struct cpp_dir *dir;
- inc = find_include_file (pfile, fname, angle_brackets, IT_INCLUDE);
- if (inc == NULL || inc == NO_INCLUDE_PATH)
+ dir = search_path_head (pfile, fname, angle_brackets, IT_INCLUDE);
+ if (!dir)
return -1;
- if (inc->fd > 0)
- {
- close (inc->fd);
- inc->fd = -1;
- }
-
- return inc->st.st_mtime > pfile->buffer->inc->st.st_mtime;
-}
-
-
-/* Push an input buffer and load it up with the contents of FNAME. If
- FNAME is "", read standard input. Return true if a buffer was
- stacked. */
-bool
-_cpp_read_file (cpp_reader *pfile, const char *fname)
-{
- /* This uses open_file, because we don't allow a PCH to be used as
- the toplevel compilation (that would prevent re-compiling an
- existing PCH without deleting it first). */
- struct include_file *f = open_file (pfile, fname);
+ file = find_file (pfile, fname, dir, false);
+ if (file->err_no)
+ return -1;
- if (f == NULL)
+ if (file->fd != -1)
{
- cpp_errno (pfile, DL_ERROR, fname);
- return false;
+ close (file->fd);
+ file->fd = -1;
}
- return stack_include_file (pfile, f);
+ return file->st.st_mtime > pfile->buffer->file->st.st_mtime;
}
/* Pushes the given file onto the buffer stack. Returns nonzero if
successful. */
bool
-cpp_push_include (cpp_reader *pfile, const char *filename)
+cpp_push_include (cpp_reader *pfile, const char *fname)
{
/* Make the command line directive take up a line. */
pfile->line++;
- return _cpp_execute_include (pfile, filename, false, IT_CMDLINE);
+ return _cpp_stack_include (pfile, fname, false, IT_CMDLINE);
}
/* Do appropriate cleanup when a file INC's buffer is popped off the
input stack. */
void
-_cpp_pop_file_buffer (cpp_reader *pfile, struct include_file *inc)
+_cpp_pop_file_buffer (cpp_reader *pfile, _cpp_file *file)
{
/* Record the inclusion-preventing macro, which could be NULL
meaning no controlling macro. */
- if (pfile->mi_valid && inc->cmacro == NULL)
- inc->cmacro = pfile->mi_cmacro;
+ if (pfile->mi_valid && file->cmacro == NULL)
+ file->cmacro = pfile->mi_cmacro;
/* Invalidate control macros in the #including file. */
pfile->mi_valid = false;
- purge_cache (inc);
+ if (file->buffer)
+ {
+ free ((void *) file->buffer);
+ file->buffer = NULL;
+ }
}
-/* Returns the first place in the include chain to start searching for
- "" includes. This involves stripping away the basename of the
- current file, unless -I- was specified.
+/* Set the include chain for "" to QUOTE, for <> to BRACKET. If
+ QUOTE_IGNORES_SOURCE_DIR, then "" includes do not look in the
+ directory of the including file.
- If we're handling -include or -imacros, use the "" chain, but with
- the preprocessor's cwd prepended. */
-static struct cpp_path *
-search_from (cpp_reader *pfile, enum include_type type)
+ If BRACKET does not lie in the QUOTE chain, it is set to QUOTE. */
+void
+cpp_set_include_chains (cpp_reader *pfile, cpp_dir *quote, cpp_dir *bracket,
+ int quote_ignores_source_dir)
{
- cpp_buffer *buffer = pfile->buffer;
- unsigned int dlen;
-
- /* Command line uses the cwd, and does not cache the result. */
- if (type == IT_CMDLINE)
- goto use_cwd;
-
- /* Ignore the current file's directory? */
- if (pfile->quote_ignores_source_dir)
- return pfile->quote_include;
+ pfile->quote_include = quote;
+ pfile->bracket_include = quote;
+ pfile->quote_ignores_source_dir = quote_ignores_source_dir;
- if (! buffer->search_cached)
+ for (; quote; quote = quote->next)
{
- buffer->search_cached = 1;
-
- dlen = lbasename (buffer->inc->name) - buffer->inc->name;
-
- if (dlen)
- {
- /* We don't guarantee NAME is null-terminated. This saves
- allocating and freeing memory. Drop a trailing '/'. */
- buffer->dir.name = (char *) buffer->inc->name;
- if (dlen > 1)
- dlen--;
- }
- else
- {
- use_cwd:
- buffer->dir.name = (char *) ".";
- dlen = 1;
- }
-
- if (dlen > pfile->max_include_len)
- pfile->max_include_len = dlen;
-
- buffer->dir.len = dlen;
- buffer->dir.next = pfile->quote_include;
- buffer->dir.sysp = pfile->map->sysp;
+ quote->name_map = NULL;
+ quote->len = strlen (quote->name);
+ if (quote == bracket)
+ pfile->bracket_include = bracket;
}
-
- return &buffer->dir;
}
-/* The file_name_map structure holds a mapping of file names for a
- particular directory. This mapping is read from the file named
- FILE_NAME_MAP_FILE in that directory. Such a file can be used to
- map filenames on a file system with severe filename restrictions,
- such as DOS. The format of the file name map file is just a series
- of lines with two tokens on each line. The first token is the name
- to map, and the second token is the actual name to use. */
-struct file_name_map {
- struct file_name_map *map_next;
- char *map_from;
- char *map_to;
-};
-
-#define FILE_NAME_MAP_FILE "header.gcc"
+/* Append the file name to the directory to create the path, but don't
+ turn / into // or // into ///; // may be a namespace escape. */
+static char *
+append_file_to_dir (const char *fname, cpp_dir *dir)
+{
+ size_t dlen, flen;
+ char *path;
+
+ dlen = dir->len;
+ flen = strlen (fname);
+ path = xmalloc (dlen + 1 + flen + 1);
+ memcpy (path, dir->name, dlen);
+ if (dlen && path[dlen - 1] != '/')
+ path[dlen++] = '/';
+ memcpy (&path[dlen], fname, flen + 1);
+
+ return path;
+}
/* Read a space delimited string of unlimited length from a stdio
file F. */
@@ -905,41 +1072,25 @@ read_filename_string (int ch, FILE *f)
return alloc;
}
-/* This structure holds a linked list of file name maps, one per directory. */
-struct file_name_map_list {
- struct file_name_map_list *map_list_next;
- char *map_list_name;
- struct file_name_map *map_list_map;
-};
-
-/* Read the file name map file for DIRNAME. */
-static struct file_name_map *
-read_name_map (cpp_reader *pfile, const char *dirname)
+/* Read the file name map file for DIR. */
+static void
+read_name_map (cpp_dir *dir)
{
- struct file_name_map_list *map_list_ptr;
+ static const char FILE_NAME_MAP_FILE[] = "header.gcc";
char *name;
FILE *f;
-
- /* Check the cache of directories, and mappings in their remap file. */
- for (map_list_ptr = CPP_OPTION (pfile, map_list); map_list_ptr;
- map_list_ptr = map_list_ptr->map_list_next)
- if (! strcmp (map_list_ptr->map_list_name, dirname))
- return map_list_ptr->map_list_map;
-
- map_list_ptr = ((struct file_name_map_list *)
- xmalloc (sizeof (struct file_name_map_list)));
- map_list_ptr->map_list_name = xstrdup (dirname);
-
- /* The end of the list ends in NULL. */
- map_list_ptr->map_list_map = NULL;
-
- name = (char *) alloca (strlen (dirname) + strlen (FILE_NAME_MAP_FILE) + 2);
- strcpy (name, dirname);
- if (*dirname)
- strcat (name, "/");
- strcat (name, FILE_NAME_MAP_FILE);
+ size_t len, count = 0, room = 9;
+
+ len = dir->len;
+ name = alloca (len + sizeof (FILE_NAME_MAP_FILE) + 1);
+ memcpy (name, dir->name, len);
+ if (len && name[len - 1] != '/')
+ name[len++] = '/';
+ strcpy (name + len, FILE_NAME_MAP_FILE);
f = fopen (name, "r");
+ dir->name_map = xmalloc (room * sizeof (char *));
+
/* Silently return NULL if we cannot open. */
if (f)
{
@@ -947,270 +1098,118 @@ read_name_map (cpp_reader *pfile, const char *dirname)
while ((ch = getc (f)) != EOF)
{
- char *from, *to;
- struct file_name_map *ptr;
+ char *to;
if (is_space (ch))
continue;
- from = read_filename_string (ch, f);
+
+ if (count + 2 > room)
+ {
+ room += 8;
+ dir->name_map = xrealloc (dir->name_map, room * sizeof (char *));
+ }
+
+ dir->name_map[count] = read_filename_string (ch, f);
while ((ch = getc (f)) != EOF && is_hspace (ch))
;
- to = read_filename_string (ch, f);
- ptr = ((struct file_name_map *)
- xmalloc (sizeof (struct file_name_map)));
- ptr->map_from = from;
-
- /* Make the real filename absolute. */
+ to = read_filename_string (ch, f);
if (IS_ABSOLUTE_PATH (to))
- ptr->map_to = to;
+ dir->name_map[count + 1] = to;
else
{
- ptr->map_to = concat (dirname, "/", to, NULL);
+ dir->name_map[count + 1] = append_file_to_dir (to, dir);
free (to);
}
- ptr->map_next = map_list_ptr->map_list_map;
- map_list_ptr->map_list_map = ptr;
-
+ count += 2;
while ((ch = getc (f)) != '\n')
if (ch == EOF)
break;
}
+
fclose (f);
}
- /* Add this information to the cache. */
- map_list_ptr->map_list_next = CPP_OPTION (pfile, map_list);
- CPP_OPTION (pfile, map_list) = map_list_ptr;
-
- return map_list_ptr->map_list_map;
+ /* Terminate the list of maps. */
+ dir->name_map[count] = NULL;
}
-/* Remap an unsimplified path NAME based on the file_name_map (if any)
- for LOC. */
+/* Remap a FILE's name based on the file_name_map, if any, for
+ FILE->dir. If the file name has any directory separators,
+ recursively check those directories too. */
static char *
-remap_filename (cpp_reader *pfile, char *name, struct cpp_path *loc)
+remap_filename (cpp_reader *pfile, _cpp_file *file)
{
- struct file_name_map *map;
- const char *from, *p;
- char *dir;
+ const char *fname, *p;
+ char *new_dir;
+ cpp_dir *dir;
+ size_t index, len;
- if (! loc->name_map)
- {
- /* Get a null-terminated path. */
- char *dname = alloca (loc->len + 1);
- memcpy (dname, loc->name, loc->len);
- dname[loc->len] = '\0';
-
- loc->name_map = read_name_map (pfile, dname);
- if (! loc->name_map)
- return name;
- }
+ dir = file->dir;
+ fname = file->name;
- /* This works since NAME has not been simplified yet. */
- from = name + loc->len + 1;
-
- for (map = loc->name_map; map; map = map->map_next)
- if (!strcmp (map->map_from, from))
- return map->map_to;
-
- /* Try to find a mapping file for the particular directory we are
- looking in. Thus #include <sys/types.h> will look up sys/types.h
- in /usr/include/header.gcc and look up types.h in
- /usr/include/sys/header.gcc. */
- p = strrchr (name, '/');
- if (!p)
- return name;
-
- /* We know p != name as absolute paths don't call remap_filename. */
- if (p == name)
- cpp_error (pfile, DL_ICE, "absolute file name in remap_filename");
-
- dir = (char *) alloca (p - name + 1);
- memcpy (dir, name, p - name);
- dir[p - name] = '\0';
- from = p + 1;
-
- for (map = read_name_map (pfile, dir); map; map = map->map_next)
- if (! strcmp (map->map_from, from))
- return map->map_to;
+ for (;;)
+ {
+ if (!dir->name_map)
+ read_name_map (dir);
- return name;
-}
+ for (index = 0; dir->name_map[index]; index += 2)
+ if (!strcmp (dir->name_map[index], fname))
+ return xstrdup (dir->name_map[index + 1]);
-/* Set the include chain for "" to QUOTE, for <> to BRACKET. If
- QUOTE_IGNORES_SOURCE_DIR, then "" includes do not look in the
- directory of the including file.
+ p = strchr (fname, '/');
+ if (!p || p == fname)
+ return NULL;
- If BRACKET does not lie in the QUOTE chain, it is set to QUOTE. */
-void
-cpp_set_include_chains (cpp_reader *pfile, cpp_path *quote, cpp_path *bracket,
- int quote_ignores_source_dir)
-{
- pfile->quote_include = quote;
- pfile->bracket_include = quote;
- pfile->quote_ignores_source_dir = quote_ignores_source_dir;
- pfile->max_include_len = 0;
+ len = dir->len + (p - fname + 1);
+ new_dir = xmalloc (len + 1);
+ memcpy (new_dir, dir->name, dir->len);
+ memcpy (new_dir + dir->len, fname, p - fname + 1);
+ new_dir[len] = '\0';
- for (; quote; quote = quote->next)
- {
- quote->name_map = NULL;
- quote->len = strlen (quote->name);
- if (quote->len > pfile->max_include_len)
- pfile->max_include_len = quote->len;
- if (quote == bracket)
- pfile->bracket_include = bracket;
+ dir = make_cpp_dir (pfile, new_dir, dir->sysp);
+ fname = p + 1;
}
}
-/* Returns true if it is safe to remove the final component of path,
- when it is followed by a ".." component. We use lstat to avoid
- symlinks if we have it. If not, we can still catch errors with
- stat (). */
-static int
-remove_component_p (const char *path)
+/* Return true if FILE is usable by PCH. */
+static bool
+include_pch_p (_cpp_file *file)
{
- struct stat s;
- int result;
-
-#ifdef HAVE_LSTAT
- result = lstat (path, &s);
-#else
- result = stat (path, &s);
-#endif
-
- /* There's no guarantee that errno will be unchanged, even on
- success. Cygwin's lstat(), for example, will often set errno to
- ENOSYS. In case of success, reset errno to zero. */
- if (result == 0)
- errno = 0;
-
- return result == 0 && S_ISDIR (s.st_mode);
+ return file->pch & 1;
}
-/* Simplify a path name in place, deleting redundant components. This
- reduces OS overhead and guarantees that equivalent paths compare
- the same (modulo symlinks).
-
- Transforms made:
- foo/bar/../quux foo/quux
- foo/./bar foo/bar
- foo//bar foo/bar
- /../quux /quux
- //quux //quux (POSIX allows leading // as a namespace escape)
-
- Guarantees no trailing slashes. All transforms reduce the length
- of the string. Returns PATH. errno is 0 if no error occurred;
- nonzero if an error occurred when using stat () or lstat (). */
-void
-cpp_simplify_path (char *path ATTRIBUTE_UNUSED)
+/* Returns true if PCHNAME is a valid PCH file for FILE. */
+static bool
+validate_pch (cpp_reader *pfile, _cpp_file *file, const char *pchname)
{
-#ifndef VMS
- char *from, *to;
- char *base, *orig_base;
- int absolute = 0;
-
- errno = 0;
- /* Don't overflow the empty path by putting a '.' in it below. */
- if (*path == '\0')
- return;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Convert all backslashes to slashes. */
- for (from = path; *from; from++)
- if (*from == '\\') *from = '/';
-
- /* Skip over leading drive letter if present. */
- if (ISALPHA (path[0]) && path[1] == ':')
- from = to = &path[2];
- else
- from = to = path;
-#else
- from = to = path;
-#endif
+ const char *saved_path = file->path;
- /* Remove redundant leading /s. */
- if (*from == '/')
+ file->path = pchname;
+ if (open_file (file))
{
- absolute = 1;
- to++;
- from++;
- if (*from == '/')
+ if ((file->pch & 2) == 0)
+ file->pch = pfile->cb.valid_pch (pfile, pchname, file->fd);
+
+ if (!include_pch_p (file))
{
- if (*++from == '/')
- /* 3 or more initial /s are equivalent to 1 /. */
- while (*++from == '/');
- else
- /* On some hosts // differs from /; Posix allows this. */
- to++;
+ close (file->fd);
+ file->fd = -1;
}
- }
-
- base = orig_base = to;
- for (;;)
- {
- int move_base = 0;
-
- while (*from == '/')
- from++;
-
- if (*from == '\0')
- break;
- if (*from == '.')
+ if (CPP_OPTION (pfile, print_include_names))
{
- if (from[1] == '\0')
- break;
- if (from[1] == '/')
- {
- from += 2;
- continue;
- }
- else if (from[1] == '.' && (from[2] == '/' || from[2] == '\0'))
- {
- /* Don't simplify if there was no previous component. */
- if (absolute && orig_base == to)
- {
- from += 2;
- continue;
- }
- /* Don't simplify if the previous component was "../",
- or if an error has already occurred with (l)stat. */
- if (base != to && errno == 0)
- {
- /* We don't back up if it's a symlink. */
- *to = '\0';
- if (remove_component_p (path))
- {
- while (to > base && *to != '/')
- to--;
- from += 2;
- continue;
- }
- }
- move_base = 1;
- }
+ unsigned int i;
+ for (i = 1; i < pfile->line_maps.depth; i++)
+ putc ('.', stderr);
+ fprintf (stderr, "%c %s\n",
+ include_pch_p (file) ? '!' : 'x', pchname);
}
-
- /* Add the component separator. */
- if (to > orig_base)
- *to++ = '/';
-
- /* Copy this component until the trailing null or '/'. */
- while (*from != '\0' && *from != '/')
- *to++ = *from++;
-
- if (move_base)
- base = to;
}
+ else
+ file->pch = 2;
- /* Change the empty string to "." so that it is not treated as stdin.
- Null terminate. */
- if (to == path)
- *to++ = '.';
- *to = '\0';
-#else /* VMS */
- errno = 0;
-#endif /* !VMS */
+ file->path = saved_path;
+ return include_pch_p (file);
}
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 01cd0a41f26..1e07f41f7ac 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -25,8 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -39,8 +37,7 @@ alloc_node (hash_table *table)
{
cpp_hashnode *node;
- node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob,
- sizeof (cpp_hashnode));
+ node = obstack_alloc (&table->pfile->hash_ob, sizeof (cpp_hashnode));
memset (node, 0, sizeof (cpp_hashnode));
return node;
}
@@ -57,7 +54,10 @@ _cpp_init_hashtable (cpp_reader *pfile, hash_table *table)
pfile->our_hashtable = 1;
table = ht_create (13); /* 8K (=2^13) entries. */
table->alloc_node = (hashnode (*) (hash_table *)) alloc_node;
- gcc_obstack_init (&pfile->hash_ob);
+
+ _obstack_begin (&pfile->hash_ob, 0, 0,
+ (void *(*) (long)) xmalloc,
+ (void (*) (void *)) free);
}
table->pfile = pfile;
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index f4a7cfcde28..d0081557d70 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -35,6 +35,15 @@ typedef int iconv_t; /* dummy */
struct directive; /* Deliberately incomplete. */
struct pending_option;
struct op;
+struct strbuf;
+
+typedef bool (*convert_f) (iconv_t, const unsigned char *, size_t,
+ struct strbuf *);
+struct cset_converter
+{
+ convert_f func;
+ iconv_t cd;
+};
#ifndef HAVE_UCHAR
typedef unsigned char uchar;
@@ -91,7 +100,7 @@ struct cpp_macro
} exp;
/* Definition line number. */
- unsigned int line;
+ fileline line;
/* Number of tokens in expansion, or bytes for traditional macros. */
unsigned int count;
@@ -272,9 +281,9 @@ struct cpp_buffer
struct cpp_buffer *prev;
- /* Pointer into the include table; non-NULL if this is a file
- buffer. Used for include_next and to record control macros. */
- struct include_file *inc;
+ /* Pointer into the file table; non-NULL if this is a file buffer.
+ Used for include_next and to record control macros. */
+ struct _cpp_file *file;
/* Value of if_stack at start of this file.
Used to prohibit unmatched #endif (etc) in an include file. */
@@ -305,7 +314,7 @@ struct cpp_buffer
/* The directory of the this buffer's file. Its NAME member is not
allocated, so we don't need to worry about freeing it. */
- struct cpp_path dir;
+ struct cpp_dir dir;
/* Used for buffer overlays by cpptrad.c. */
const uchar *saved_cur, *saved_rlimit;
@@ -328,10 +337,10 @@ struct cpp_reader
/* Source line tracking. */
struct line_maps line_maps;
const struct line_map *map;
- unsigned int line;
+ fileline line;
/* The line of the '#' of the current directive. */
- unsigned int directive_line;
+ fileline directive_line;
/* Memory buffers. */
_cpp_buff *a_buff; /* Aligned permanent storage. */
@@ -346,8 +355,25 @@ struct cpp_reader
const struct directive *directive;
/* Search paths for include files. */
- struct cpp_path *quote_include; /* "" */
- struct cpp_path *bracket_include; /* <> */
+ struct cpp_dir *quote_include; /* "" */
+ struct cpp_dir *bracket_include; /* <> */
+ struct cpp_dir no_search_path; /* No path. */
+
+ /* Chain of all hashed _cpp_file instances. */
+ struct _cpp_file *all_files;
+
+ /* File and directory hash table. */
+ struct htab *file_hash;
+ struct file_hash_entry *file_hash_entries;
+ unsigned int file_hash_entries_allocated, file_hash_entries_used;
+
+ /* Nonzero means don't look for #include "foo" the source-file
+ directory. */
+ bool quote_ignores_source_dir;
+
+ /* Nonzero if any file has contained #pragma once or #import has
+ been used. */
+ bool seen_once_only;
/* Multiple include optimization. */
const cpp_hashnode *mi_cmacro;
@@ -369,21 +395,13 @@ struct cpp_reader
unsigned char *macro_buffer;
unsigned int macro_buffer_len;
- /* Iconv descriptor for converting from the source character set
- to the execution character set. (iconv_t)-1 for no conversion. */
- iconv_t narrow_cset_desc;
-
- /* Iconv descriptor for converting from the execution character set
- to the wide execution character set. (iconv_t)-1 for no conversion
- other than zero-extending each character to the width of wchar_t. */
- iconv_t wide_cset_desc;
-
- /* Tree of other included files. See cppfiles.c. */
- struct splay_tree_s *all_include_files;
+ /* Descriptor for converting from the source character set to the
+ execution character set. */
+ struct cset_converter narrow_cset_desc;
- /* Current maximum length of directory names in the search path
- for include files. (Altered as we get more of them.) */
- unsigned int max_include_len;
+ /* Descriptor for converting from the source character set to the
+ wide execution character set. */
+ struct cset_converter wide_cset_desc;
/* Date and time text. Calculated together if either is requested. */
const uchar *date;
@@ -424,12 +442,8 @@ struct cpp_reader
preprocessor. */
struct spec_nodes spec_nodes;
- /* Nonzero means don't look for #include "foo" the source-file
- directory. */
- unsigned char quote_ignores_source_dir;
-
/* Whether cpplib owns the hashtable. */
- unsigned char our_hashtable;
+ bool our_hashtable;
/* Traditional preprocessing output buffer (a logical line). */
struct
@@ -437,7 +451,7 @@ struct cpp_reader
uchar *base;
uchar *limit;
uchar *cur;
- unsigned int first_line;
+ fileline first_line;
} out;
/* Used to save the original line number during traditional
@@ -483,7 +497,7 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
#define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, warn_traditional)
/* In cpperror.c */
-extern int _cpp_begin_message (cpp_reader *, int, unsigned int, unsigned int);
+extern int _cpp_begin_message (cpp_reader *, int, fileline, unsigned int);
/* In cppmacro.c */
extern void _cpp_free_definition (cpp_hashnode *);
@@ -501,16 +515,16 @@ extern void _cpp_init_hashtable (cpp_reader *, hash_table *);
extern void _cpp_destroy_hashtable (cpp_reader *);
/* In cppfiles.c */
+extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *);
extern void _cpp_fake_include (cpp_reader *, const char *);
-extern void _cpp_never_reread (struct include_file *);
-extern bool _cpp_read_file (cpp_reader *, const char *);
-extern bool _cpp_execute_include (cpp_reader *, const char *, int,
- enum include_type);
+extern bool _cpp_stack_file (cpp_reader *, const char *);
+extern bool _cpp_stack_include (cpp_reader *, const char *, int,
+ enum include_type);
extern int _cpp_compare_file_date (cpp_reader *, const char *, int);
extern void _cpp_report_missing_guards (cpp_reader *);
-extern void _cpp_init_includes (cpp_reader *);
-extern void _cpp_cleanup_includes (cpp_reader *);
-extern void _cpp_pop_file_buffer (cpp_reader *, struct include_file *);
+extern void _cpp_init_files (cpp_reader *);
+extern void _cpp_cleanup_files (cpp_reader *);
+extern void _cpp_pop_file_buffer (cpp_reader *, struct _cpp_file *);
/* In cppexp.c */
extern bool _cpp_parse_expr (cpp_reader *);
@@ -544,7 +558,7 @@ extern void _cpp_do_file_change (cpp_reader *, enum lc_reason, const char *,
extern void _cpp_pop_buffer (cpp_reader *);
/* In cpptrad.c. */
-extern bool scan_out_logical_line (cpp_reader *, cpp_macro *);
+extern bool _cpp_scan_out_logical_line (cpp_reader *, cpp_macro *);
extern bool _cpp_read_logical_line_trad (cpp_reader *);
extern void _cpp_overlay_buffer (cpp_reader *pfile, const uchar *, size_t);
extern void _cpp_remove_overlay (cpp_reader *);
@@ -555,8 +569,11 @@ extern uchar *_cpp_copy_replacement_text (const cpp_macro *, uchar *);
extern size_t _cpp_replacement_text_len (const cpp_macro *);
/* In cppcharset.c. */
-cppchar_t _cpp_valid_ucn (cpp_reader *, const uchar **, const uchar *, int);
-void _cpp_destroy_iconv (cpp_reader *);
+extern cppchar_t _cpp_valid_ucn (cpp_reader *, const uchar **,
+ const uchar *, int);
+extern void _cpp_destroy_iconv (cpp_reader *);
+extern bool _cpp_interpret_string_notranslate (cpp_reader *, const cpp_string *,
+ cpp_string *);
/* Utility routines and macros. */
#define DSC(str) (const uchar *)str, sizeof str - 1
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index cc1faecf966..351ce187eac 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -21,8 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "mkdeps.h"
@@ -30,6 +28,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static void init_library (void);
static void mark_named_operators (cpp_reader *);
static void read_original_filename (cpp_reader *);
+static void read_original_directory (cpp_reader *);
static void post_options (cpp_reader *);
/* If we have designated initializers (GCC >2.7) these tables can be
@@ -132,10 +131,9 @@ cpp_create_reader (enum c_lang lang, hash_table *table)
/* Initialize this instance of the library if it hasn't been already. */
init_library ();
- pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader));
+ pfile = xcalloc (1, sizeof (cpp_reader));
cpp_set_lang (pfile, lang);
- CPP_OPTION (pfile, warn_import) = 1;
CPP_OPTION (pfile, warn_multichar) = 1;
CPP_OPTION (pfile, discard_comments) = 1;
CPP_OPTION (pfile, discard_comments_in_macro_exp) = 1;
@@ -163,9 +161,16 @@ cpp_create_reader (enum c_lang lang, hash_table *table)
CPP_OPTION (pfile, narrow_charset) = 0;
CPP_OPTION (pfile, wide_charset) = 0;
+ /* A fake empty "directory" used as the starting point for files
+ looked up without a search path. Name cannot be '/' because we
+ don't want to prepend anything at all to filenames using it. All
+ other entries are correct zero-initialized. */
+ pfile->no_search_path.name = (char *) "";
+
/* Initialize the line map. Start at logical line 1, so we can use
a line number of zero for special states. */
- init_line_maps (&pfile->line_maps);
+ linemap_init (&pfile->line_maps);
+ pfile->line = 1;
/* Initialize lexer state. */
pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments);
@@ -194,9 +199,11 @@ cpp_create_reader (enum c_lang lang, hash_table *table)
_cpp_expand_op_stack (pfile);
/* Initialize the buffer obstack. */
- gcc_obstack_init (&pfile->buffer_ob);
+ _obstack_begin (&pfile->buffer_ob, 0, 0,
+ (void *(*) (long)) xmalloc,
+ (void (*) (void *)) free);
- _cpp_init_includes (pfile);
+ _cpp_init_files (pfile);
_cpp_init_hashtable (pfile, table);
@@ -231,7 +238,7 @@ cpp_destroy (cpp_reader *pfile)
obstack_free (&pfile->buffer_ob, 0);
_cpp_destroy_hashtable (pfile);
- _cpp_cleanup_includes (pfile);
+ _cpp_cleanup_files (pfile);
_cpp_destroy_iconv (pfile);
_cpp_free_buff (pfile->a_buff);
@@ -252,7 +259,7 @@ cpp_destroy (cpp_reader *pfile)
free (context);
}
- free_line_maps (&pfile->line_maps);
+ linemap_free (&pfile->line_maps);
free (pfile);
}
@@ -428,11 +435,9 @@ cpp_add_dependency_target (cpp_reader *pfile, const char *target, int quote)
}
/* This is called after options have been parsed, and partially
- processed. Setup for processing input from the file named FNAME,
- or stdin if it is the empty string. Return the original filename
- on success (e.g. foo.i->foo.c), or NULL on failure. */
-const char *
-cpp_read_main_file (cpp_reader *pfile, const char *fname)
+ processed. */
+void
+cpp_post_options (cpp_reader *pfile)
{
sanity_checks (pfile);
@@ -441,7 +446,14 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
/* Mark named operators before handling command line macros. */
if (CPP_OPTION (pfile, cplusplus) && CPP_OPTION (pfile, operator_names))
mark_named_operators (pfile);
+}
+/* Setup for processing input from the file named FNAME,
+ or stdin if it is the empty string. Return the original filename
+ on success (e.g. foo.i->foo.c), or NULL on failure. */
+const char *
+cpp_read_main_file (cpp_reader *pfile, const char *fname)
+{
if (CPP_OPTION (pfile, deps.style) != DEPS_NONE)
{
if (!pfile->deps)
@@ -451,9 +463,7 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
deps_add_default_target (pfile->deps, fname);
}
- /* Open the main input file. */
- pfile->line = 1;
- if (!_cpp_read_file (pfile, fname))
+ if (!_cpp_stack_file (pfile, fname))
return NULL;
/* Set this here so the client can change the option if it wishes,
@@ -466,6 +476,24 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
if (CPP_OPTION (pfile, preprocessed))
read_original_filename (pfile);
+ if (CPP_OPTION (pfile, working_directory))
+ {
+ const char *name = pfile->map->to_file;
+ const char *dir = getpwd ();
+ char *dir_with_slashes = alloca (strlen (dir) + 3);
+
+ memcpy (dir_with_slashes, dir, strlen (dir));
+ memcpy (dir_with_slashes + strlen (dir), "//", 3);
+
+ if (pfile->cb.dir_change)
+ pfile->cb.dir_change (pfile, dir);
+ /* Emit file renames that will be recognized by
+ read_directory_filename, since dir_change doesn't output
+ anything. */
+ _cpp_do_file_change (pfile, LC_RENAME, dir_with_slashes, 1, 0);
+ _cpp_do_file_change (pfile, LC_RENAME, name, 1, 0);
+ }
+
return pfile->map->to_file;
}
@@ -490,6 +518,7 @@ read_original_filename (cpp_reader *pfile)
if (token1->type == CPP_NUMBER)
{
_cpp_handle_directive (pfile, token->flags & PREV_WHITE);
+ read_original_directory (pfile);
return;
}
}
@@ -498,6 +527,60 @@ read_original_filename (cpp_reader *pfile)
_cpp_backup_tokens (pfile, 1);
}
+/* For preprocessed files, if the tokens following the first filename
+ line is of the form # <line> "/path/name//", handle the
+ directive so we know the original current directory. */
+static void
+read_original_directory (cpp_reader *pfile)
+{
+ const cpp_token *hash, *token;
+
+ /* Lex ahead; if the first tokens are of the form # NUM, then
+ process the directive, otherwise back up. */
+ hash = _cpp_lex_direct (pfile);
+ if (hash->type != CPP_HASH)
+ {
+ _cpp_backup_tokens (pfile, 1);
+ return;
+ }
+
+ token = _cpp_lex_direct (pfile);
+
+ if (token->type != CPP_NUMBER)
+ {
+ _cpp_backup_tokens (pfile, 2);
+ return;
+ }
+
+ token = _cpp_lex_direct (pfile);
+
+ if (token->type != CPP_STRING
+ || ! (token->val.str.len >= 5
+ && token->val.str.text[token->val.str.len-2] == '/'
+ && token->val.str.text[token->val.str.len-3] == '/'))
+ {
+ _cpp_backup_tokens (pfile, 3);
+ return;
+ }
+
+ if (pfile->cb.dir_change)
+ {
+ char *debugdir = alloca (token->val.str.len - 3);
+
+ memcpy (debugdir, (const char *) token->val.str.text + 1,
+ token->val.str.len - 4);
+ debugdir[token->val.str.len - 4] = '\0';
+
+ pfile->cb.dir_change (pfile, debugdir);
+ }
+
+ /* We want to process the fake line changes as regular changes, to
+ get them output. */
+ _cpp_backup_tokens (pfile, 3);
+
+ CPP_OPTION (pfile, working_directory) = false;
+}
+
/* This is called at the end of preprocessing. It pops the last
buffer and writes dependency output, and returns the number of
errors.
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 463064546fd..f779dfb7bc2 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -21,8 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -90,8 +88,8 @@ add_line_note (cpp_buffer *buffer, const uchar *pos, unsigned int type)
if (buffer->notes_used == buffer->notes_cap)
{
buffer->notes_cap = buffer->notes_cap * 2 + 200;
- buffer->notes = (_cpp_line_note *)
- xrealloc (buffer->notes, buffer->notes_cap * sizeof (_cpp_line_note));
+ buffer->notes = xrealloc (buffer->notes,
+ buffer->notes_cap * sizeof (_cpp_line_note));
}
buffer->notes[buffer->notes_used].pos = pos;
@@ -246,9 +244,12 @@ _cpp_process_line_notes (cpp_reader *pfile, int in_comment)
note->type,
(int) _cpp_trigraph_map[note->type]);
else
- cpp_error_with_line (pfile, DL_WARNING, pfile->line, col,
- "trigraph ??%c ignored",
- note->type);
+ {
+ cpp_error_with_line
+ (pfile, DL_WARNING, pfile->line, col,
+ "trigraph ??%c ignored, use -trigraphs to enable",
+ note->type);
+ }
}
}
else
@@ -693,6 +694,9 @@ _cpp_get_fresh_line (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
+ if (buffer == NULL)
+ return false;
+
if (!buffer->need_line)
return true;
@@ -718,9 +722,6 @@ _cpp_get_fresh_line (cpp_reader *pfile)
"no newline at end of file");
}
- if (!buffer->prev)
- return false;
-
if (buffer->return_at_eof)
{
_cpp_pop_buffer (pfile);
@@ -761,7 +762,8 @@ _cpp_lex_direct (cpp_reader *pfile)
fresh_line:
result->flags = 0;
- if (pfile->buffer->need_line)
+ buffer = pfile->buffer;
+ if (buffer == NULL || buffer->need_line)
{
if (!_cpp_get_fresh_line (pfile))
{
@@ -783,8 +785,8 @@ _cpp_lex_direct (cpp_reader *pfile)
result->flags = BOL;
if (pfile->state.parsing_args == 2)
result->flags |= PREV_WHITE;
+ buffer = pfile->buffer;
}
- buffer = pfile->buffer;
update_tokens_line:
result->line = pfile->line;
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 2fac44e62fd..6a0f3e0d64b 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -21,9 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
#include "cpplib.h"
#include "cpphash.h"
#include "obstack.h"
@@ -109,6 +106,7 @@ static unsigned int read_flag (cpp_reader *, unsigned int);
static int strtoul_for_line (const uchar *, unsigned int, unsigned long *);
static void do_diagnostic (cpp_reader *, int, int);
static cpp_hashnode *lex_macro_node (cpp_reader *);
+static int undefine_macros (cpp_reader *, cpp_hashnode *, void *);
static void do_include_common (cpp_reader *, enum include_type);
static struct pragma_entry *lookup_pragma_entry (struct pragma_entry *,
const cpp_hashnode *);
@@ -279,7 +277,7 @@ prepare_directive_trad (cpp_reader *pfile)
|| pfile->directive == &dtable[T_ELIF]);
if (no_expand)
pfile->state.prevent_expansion++;
- scan_out_logical_line (pfile, NULL);
+ _cpp_scan_out_logical_line (pfile, NULL);
if (no_expand)
pfile->state.prevent_expansion--;
pfile->state.skipping = was_skipping;
@@ -443,7 +441,7 @@ run_directive (cpp_reader *pfile, int dir_no, const char *buf, size_t count)
/* from_stage3 */ true, 1);
/* Disgusting hack. */
if (dir_no == T_PRAGMA)
- pfile->buffer->inc = pfile->buffer->prev->inc;
+ pfile->buffer->file = pfile->buffer->prev->file;
start_directive (pfile);
/* This is a short-term fix to prevent a leading '#' being
@@ -456,7 +454,7 @@ run_directive (cpp_reader *pfile, int dir_no, const char *buf, size_t count)
pfile->directive->handler (pfile);
end_directive (pfile, 1);
if (dir_no == T_PRAGMA)
- pfile->buffer->inc = NULL;
+ pfile->buffer->file = NULL;
_cpp_pop_buffer (pfile);
}
@@ -540,6 +538,45 @@ do_undef (cpp_reader *pfile)
check_eol (pfile);
}
+/* Undefine a single macro/assertion/whatever. */
+
+static int
+undefine_macros (cpp_reader *pfile, cpp_hashnode *h,
+ void *data_p ATTRIBUTE_UNUSED)
+{
+ switch (h->type)
+ {
+ case NT_VOID:
+ break;
+
+ case NT_MACRO:
+ if (pfile->cb.undef)
+ (*pfile->cb.undef) (pfile, pfile->directive_line, h);
+
+ if (CPP_OPTION (pfile, warn_unused_macros))
+ _cpp_warn_if_unused_macro (pfile, h, NULL);
+
+ /* And fall through.... */
+ case NT_ASSERTION:
+ _cpp_free_definition (h);
+ break;
+
+ default:
+ abort ();
+ }
+ h->flags &= ~NODE_POISONED;
+ return 1;
+}
+
+/* Undefine all macros and assertions. */
+
+void
+cpp_undef_all (cpp_reader *pfile)
+{
+ cpp_forall_identifiers (pfile, undefine_macros, NULL);
+}
+
+
/* Helper routine used by parse_include. Reinterpret the current line
as an h-char-sequence (< ... >); we are looking at the first token
after the <. Returns a malloced filename. */
@@ -647,7 +684,7 @@ do_include_common (cpp_reader *pfile, enum include_type type)
pfile->cb.include (pfile, pfile->directive_line,
pfile->directive->name, fname, angle_brackets);
- _cpp_execute_include (pfile, fname, angle_brackets, type);
+ _cpp_stack_include (pfile, fname, angle_brackets, type);
}
free ((void *) fname);
@@ -662,13 +699,6 @@ do_include (cpp_reader *pfile)
static void
do_import (cpp_reader *pfile)
{
- if (CPP_OPTION (pfile, warn_import))
- {
- CPP_OPTION (pfile, warn_import) = 0;
- cpp_error (pfile, DL_WARNING,
- "#import is obsolete, use an #ifndef wrapper in the header file");
- }
-
do_include_common (pfile, IT_IMPORT);
}
@@ -733,21 +763,6 @@ strtoul_for_line (const uchar *str, unsigned int len, long unsigned int *nump)
return 0;
}
-/* Subroutine of do_line and do_linemarker. Convert escape sequences
- in a string, but do not perform character set conversion. */
-static bool
-interpret_string_notranslate (cpp_reader *pfile, const cpp_string *in,
- cpp_string *out)
-{
- iconv_t save_narrow_cset_desc = pfile->narrow_cset_desc;
- bool retval;
-
- pfile->narrow_cset_desc = (iconv_t) -1;
- retval = cpp_interpret_string (pfile, in, 1, out, false);
- pfile->narrow_cset_desc = save_narrow_cset_desc;
- return retval;
-}
-
/* Interpret #line command.
Note that the filename string (if any) is a true string constant
(escapes are interpreted), unlike in #line. */
@@ -780,7 +795,7 @@ do_line (cpp_reader *pfile)
if (token->type == CPP_STRING)
{
cpp_string s = { 0, 0 };
- if (interpret_string_notranslate (pfile, &token->val.str, &s))
+ if (_cpp_interpret_string_notranslate (pfile, &token->val.str, &s))
new_file = (const char *)s.text;
check_eol (pfile);
}
@@ -829,7 +844,7 @@ do_linemarker (cpp_reader *pfile)
if (token->type == CPP_STRING)
{
cpp_string s = { 0, 0 };
- if (interpret_string_notranslate (pfile, &token->val.str, &s))
+ if (_cpp_interpret_string_notranslate (pfile, &token->val.str, &s))
new_file = (const char *)s.text;
new_sysp = 0;
@@ -876,8 +891,8 @@ _cpp_do_file_change (cpp_reader *pfile, enum lc_reason reason,
const char *to_file, unsigned int file_line,
unsigned int sysp)
{
- pfile->map = add_line_map (&pfile->line_maps, reason, sysp,
- pfile->line, to_file, file_line);
+ pfile->map = linemap_add (&pfile->line_maps, reason, sysp,
+ pfile->line, to_file, file_line);
if (pfile->cb.file_change)
pfile->cb.file_change (pfile, pfile->map);
@@ -1125,14 +1140,6 @@ do_pragma (cpp_reader *pfile)
}
}
- /* FIXME. This is an awful kludge to get the front ends to update
- their notion of line number for diagnostic purposes. The line
- number should be passed to the handler and they should do it
- themselves. Stand-alone CPP must ignore us, otherwise it will
- prefix the directive with spaces, hence the 1. Ugh. */
- if (pfile->cb.line_change)
- pfile->cb.line_change (pfile, token, 1);
-
if (p)
p->u.handler (pfile);
else if (pfile->cb.def_pragma)
@@ -1148,15 +1155,11 @@ do_pragma (cpp_reader *pfile)
static void
do_pragma_once (cpp_reader *pfile)
{
- if (CPP_OPTION (pfile, warn_deprecated))
- cpp_error (pfile, DL_WARNING, "#pragma once is obsolete");
-
if (pfile->buffer->prev == NULL)
cpp_error (pfile, DL_WARNING, "#pragma once in main file");
- else
- _cpp_never_reread (pfile->buffer->inc);
check_eol (pfile);
+ _cpp_mark_file_once_only (pfile, pfile->buffer->file);
}
/* Handle #pragma GCC poison, to poison one or more identifiers so
@@ -1783,7 +1786,7 @@ cpp_define (cpp_reader *pfile, const char *str)
tack " 1" on the end. */
count = strlen (str);
- buf = (char *) alloca (count + 3);
+ buf = alloca (count + 3);
memcpy (buf, str, count);
p = strchr (str, '=');
@@ -1844,7 +1847,7 @@ handle_assertion (cpp_reader *pfile, const char *str, int type)
/* Copy the entire option so we can modify it. Change the first
"=" in the string to a '(', and tack a ')' on the end. */
- char *buf = (char *) alloca (count + 2);
+ char *buf = alloca (count + 2);
memcpy (buf, str, count);
if (p)
@@ -1922,7 +1925,7 @@ void
_cpp_pop_buffer (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
- struct include_file *inc = buffer->inc;
+ struct _cpp_file *inc = buffer->file;
struct if_stack *ifs;
/* Walk back up the conditional stack till we reach its level at
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index fb3cc78ec67..fdd9a4e3299 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -39,10 +39,9 @@ typedef struct cpp_string cpp_string;
typedef struct cpp_hashnode cpp_hashnode;
typedef struct cpp_macro cpp_macro;
typedef struct cpp_callbacks cpp_callbacks;
-typedef struct cpp_path cpp_path;
+typedef struct cpp_dir cpp_dir;
struct answer;
-struct file_name_map_list;
/* The first three groups, apart from '=', can appear in preprocessor
expressions (+= and -= are used to indicate unary + and - resp.).
@@ -175,7 +174,7 @@ struct cpp_string
occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts. */
struct cpp_token
{
- unsigned int line; /* Logical line of first char of token. */
+ fileline line; /* Logical line of first char of token. */
unsigned short col; /* Column of first char of token. */
ENUM_BITFIELD(cpp_ttype) type : CHAR_BIT; /* token type */
unsigned char flags; /* flags - see above */
@@ -191,18 +190,18 @@ struct cpp_token
/* A type wide enough to hold any multibyte source character.
cpplib's character constant interpreter requires an unsigned type.
- Also, a typedef for the signed equivalent. */
-#ifndef MAX_WCHAR_TYPE_SIZE
-# define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
-#endif
-#if CHAR_BIT * SIZEOF_INT >= MAX_WCHAR_TYPE_SIZE
+ Also, a typedef for the signed equivalent.
+ The width of this type is capped at 32 bits; there do exist targets
+ where wchar_t is 64 bits, but only in a non-default mode, and there
+ would be no meaningful interpretation for a wchar_t value greater
+ than 2^32 anyway -- the widest wide-character encoding around is
+ ISO 10646, which stops at 2^31. */
+#if CHAR_BIT * SIZEOF_INT >= 32
# define CPPCHAR_SIGNED_T int
+#elif CHAR_BIT * SIZEOF_LONG >= 32
+# define CPPCHAR_SIGNED_T long
#else
-# if CHAR_BIT * SIZEOF_LONG >= MAX_WCHAR_TYPE_SIZE || !HAVE_LONG_LONG
-# define CPPCHAR_SIGNED_T long
-# else
-# define CPPCHAR_SIGNED_T long long
-# endif
+# error "Cannot find a least-32-bit signed integer type"
#endif
typedef unsigned CPPCHAR_SIGNED_T cppchar_t;
typedef CPPCHAR_SIGNED_T cppchar_signed_t;
@@ -214,10 +213,6 @@ struct cpp_options
/* Characters between tab stops. */
unsigned int tabstop;
- /* Map between header names and file names, used only on DOS where
- file names are limited in length. */
- struct file_name_map_list *map_list;
-
/* The language we're preprocessing. */
enum c_lang lang;
@@ -272,9 +267,6 @@ struct cpp_options
/* Nonzero means warn if there are any trigraphs. */
unsigned char warn_trigraphs;
- /* Nonzero means warn if #import is used. */
- unsigned char warn_import;
-
/* Nonzero means warn about multicharacter charconsts. */
unsigned char warn_multichar;
@@ -378,6 +370,11 @@ struct cpp_options
/* Nonzero means __STDC__ should have the value 0 in system headers. */
unsigned char stdc_0_in_system_headers;
+
+ /* Nonzero means output a directory line marker right after the
+ initial file name line marker, and before a duplicate initial
+ line marker. */
+ bool working_directory;
};
/* Call backs to cpplib client. */
@@ -386,6 +383,7 @@ struct cpp_callbacks
/* Called when a new line of preprocessed output is started. */
void (*line_change) (cpp_reader *, const cpp_token *, int);
void (*file_change) (cpp_reader *, const struct line_map *);
+ void (*dir_change) (cpp_reader *, const char *);
void (*include) (cpp_reader *, unsigned int, const unsigned char *,
const char *, int);
void (*define) (cpp_reader *, unsigned int, cpp_hashnode *);
@@ -397,12 +395,12 @@ struct cpp_callbacks
};
/* Chain of directories to look for include files in. */
-struct cpp_path
+struct cpp_dir
{
/* NULL-terminated singly-linked list. */
- struct cpp_path *next;
+ struct cpp_dir *next;
- /* NAME need not be NUL-terminated once inside cpplib. */
+ /* NAME of the directory, NUL-terminated. */
char *name;
unsigned int len;
@@ -410,9 +408,9 @@ struct cpp_path
"C" guards for C++. */
unsigned char sysp;
- /* Mapping of file names for this directory for MS-DOS and
- related platforms. */
- struct file_name_map *name_map;
+ /* Mapping of file names for this directory for MS-DOS and related
+ platforms. A NULL-terminated array of (from, to) pairs. */
+ const char **name_map;
/* The C front end uses these to recognize duplicated
directories in the search path. */
@@ -516,7 +514,7 @@ extern void cpp_set_lang (cpp_reader *, enum c_lang);
extern void cpp_add_dependency_target (cpp_reader *, const char *, int);
/* Set the include paths. */
-extern void cpp_set_include_chains (cpp_reader *, cpp_path *, cpp_path *, int);
+extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int);
/* Call these to get pointers to the options and callback structures
for a given reader. These pointers are good until you call
@@ -538,6 +536,10 @@ extern const char *cpp_read_main_file (cpp_reader *, const char *);
/* Set up built-ins like __FILE__. */
extern void cpp_init_builtins (cpp_reader *, int);
+/* This is called after options have been parsed, and partially
+ processed. */
+extern void cpp_post_options (cpp_reader *);
+
/* Set up translation to the target character set. */
extern void cpp_init_iconv (cpp_reader *);
@@ -584,6 +586,9 @@ extern void cpp_assert (cpp_reader *, const char *);
extern void cpp_undef (cpp_reader *, const char *);
extern void cpp_unassert (cpp_reader *, const char *);
+/* Undefine all macros and assertions. */
+extern void cpp_undef_all (cpp_reader *);
+
extern cpp_buffer *cpp_push_buffer (cpp_reader *, const unsigned char *,
size_t, int, int);
extern int cpp_defined (cpp_reader *, const unsigned char *, int);
@@ -675,8 +680,8 @@ extern void cpp_errno (cpp_reader *, int, const char *msgid);
/* Same as cpp_error, except additionally specifies a position as a
(translation unit) physical line and physical column. If the line is
zero, then no location is printed. */
-extern void cpp_error_with_line (cpp_reader *, int, unsigned, unsigned, const char *msgid, ...)
- ATTRIBUTE_PRINTF_5;
+extern void cpp_error_with_line (cpp_reader *, int, fileline, unsigned,
+ const char *msgid, ...) ATTRIBUTE_PRINTF_5;
/* In cpplex.c */
extern int cpp_ideq (const cpp_token *, const char *);
@@ -708,9 +713,8 @@ extern unsigned char *cpp_quote_string (unsigned char *, const unsigned char *,
unsigned int);
/* In cppfiles.c */
-extern int cpp_included (cpp_reader *, const char *);
+extern bool cpp_included (cpp_reader *, const char *);
extern void cpp_make_system_header (cpp_reader *, int, int);
-extern void cpp_simplify_path (char *);
extern bool cpp_push_include (cpp_reader *, const char *);
extern void cpp_change_file (cpp_reader *, enum lc_reason, const char *);
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 2b9c9b5f89b..045d4e37185 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -25,8 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -82,7 +80,7 @@ _cpp_warn_if_unused_macro (cpp_reader *pfile, cpp_hashnode *node,
cpp_macro *macro = node->value.macro;
if (!macro->used
- && MAIN_FILE_P (lookup_line (&pfile->line_maps, macro->line)))
+ && MAIN_FILE_P (linemap_lookup (&pfile->line_maps, macro->line)))
cpp_error_with_line (pfile, DL_WARNING, macro->line, 0,
"macro \"%s\" is not used", NODE_NAME (node));
}
@@ -416,7 +414,7 @@ paste_tokens (cpp_reader *pfile, const cpp_token **plhs, const cpp_token *rhs)
lhs = *plhs;
len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1;
- buf = (unsigned char *) alloca (len);
+ buf = alloca (len);
end = cpp_spell_token (pfile, lhs, buf);
/* Avoid comment headers, since they are still processed in stage 3.
@@ -993,8 +991,7 @@ expand_arg (cpp_reader *pfile, macro_arg *arg)
/* Loop, reading in the arguments. */
capacity = 256;
- arg->expanded = (const cpp_token **)
- xmalloc (capacity * sizeof (cpp_token *));
+ arg->expanded = xmalloc (capacity * sizeof (cpp_token *));
push_ptoken_context (pfile, NULL, NULL, arg->first, arg->count + 1);
for (;;)
@@ -1004,8 +1001,8 @@ expand_arg (cpp_reader *pfile, macro_arg *arg)
if (arg->expanded_count + 1 >= capacity)
{
capacity *= 2;
- arg->expanded = (const cpp_token **)
- xrealloc (arg->expanded, capacity * sizeof (cpp_token *));
+ arg->expanded = xrealloc (arg->expanded,
+ capacity * sizeof (cpp_token *));
}
token = cpp_get_token (pfile);
@@ -1259,7 +1256,7 @@ _cpp_save_parameter (cpp_reader *pfile, cpp_macro *macro, cpp_hashnode *node)
len = macro->paramc * sizeof (union _cpp_hashnode_value);
if (len > pfile->macro_buffer_len)
{
- pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer = xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}
((union _cpp_hashnode_value *) pfile->macro_buffer)[macro->paramc - 1]
@@ -1650,7 +1647,7 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
if (len > pfile->macro_buffer_len)
{
- pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer = xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}
diff --git a/gcc/cpppch.c b/gcc/cpppch.c
index 6b60c57eaac..e1dc1d710ec 100644
--- a/gcc/cpppch.c
+++ b/gcc/cpppch.c
@@ -17,7 +17,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
@@ -510,7 +509,13 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
else if (cmp > 0)
++i;
else
- goto fail;
+ {
+ if (CPP_OPTION (r, warn_invalid_pch))
+ cpp_error (r, DL_WARNING_SYSHDR,
+ "%s: not used because `%s' is defined",
+ name, first);
+ goto fail;
+ }
}
free(nl.defs);
diff --git a/gcc/cppspec.c b/gcc/cppspec.c
index eb5205fa323..f53cff2a5c1 100644
--- a/gcc/cppspec.c
+++ b/gcc/cppspec.c
@@ -172,7 +172,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
return;
/* One more slot for a terminating null. */
- new_argv = (const char **) xmalloc ((new_argc + 1) * sizeof(char *));
+ new_argv = xmalloc ((new_argc + 1) * sizeof(char *));
new_argv[0] = argv[0];
j = 1;
diff --git a/gcc/cpptrad.c b/gcc/cpptrad.c
index 9b08e31138f..3c1bc2545c2 100644
--- a/gcc/cpptrad.c
+++ b/gcc/cpptrad.c
@@ -18,8 +18,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -109,8 +107,7 @@ check_output_buffer (cpp_reader *pfile, size_t n)
size_t size = pfile->out.cur - pfile->out.base;
size_t new_size = (size + n) * 3 / 2;
- pfile->out.base
- = (uchar *) xrealloc (pfile->out.base, new_size);
+ pfile->out.base = xrealloc (pfile->out.base, new_size);
pfile->out.limit = pfile->out.base + new_size;
pfile->out.cur = pfile->out.base + size;
}
@@ -302,10 +299,11 @@ _cpp_read_logical_line_trad (cpp_reader *pfile)
{
do
{
- if (pfile->buffer->need_line && !_cpp_get_fresh_line (pfile))
+ if ((pfile->buffer == NULL || pfile->buffer->need_line)
+ && !_cpp_get_fresh_line (pfile))
return false;
}
- while (!scan_out_logical_line (pfile, NULL) || pfile->state.skipping);
+ while (!_cpp_scan_out_logical_line (pfile, NULL) || pfile->state.skipping);
return true;
}
@@ -343,7 +341,7 @@ save_argument (struct fun_macro *macro, size_t offset)
MACRO, and we call save_replacement_text() every time we meet an
argument. */
bool
-scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
+_cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
{
bool result = true;
cpp_context *context;
@@ -982,7 +980,7 @@ _cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro)
if (* CUR (context) == '(')
{
/* Setting macro to NULL indicates an error occurred, and
- prevents unnecessary work in scan_out_logical_line. */
+ prevents unnecessary work in _cpp_scan_out_logical_line. */
if (!scan_parameters (pfile, macro))
macro = NULL;
else
@@ -1000,7 +998,7 @@ _cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro)
CPP_OPTION (pfile, discard_comments_in_macro_exp));
pfile->state.prevent_expansion++;
- scan_out_logical_line (pfile, macro);
+ _cpp_scan_out_logical_line (pfile, macro);
pfile->state.prevent_expansion--;
if (!macro)
diff --git a/gcc/cse.c b/gcc/cse.c
index 5e6c9e40b17..a4847a857b3 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -929,7 +929,7 @@ get_cse_reg_info (unsigned int regno)
cse_reg_info_free_list = p->next;
}
else
- p = (struct cse_reg_info *) xmalloc (sizeof (struct cse_reg_info));
+ p = xmalloc (sizeof (struct cse_reg_info));
/* Insert into hash table. */
p->hash_next = *hash_head;
@@ -967,7 +967,7 @@ new_basic_block (void)
/* Clear out hash table state for this pass. */
- memset ((char *) reg_hash, 0, sizeof reg_hash);
+ memset (reg_hash, 0, sizeof reg_hash);
if (cse_reg_info_used_list)
{
@@ -1540,7 +1540,7 @@ insert (rtx x, struct table_elt *classp, unsigned int hash, enum machine_mode mo
else
{
n_elements_made++;
- elt = (struct table_elt *) xmalloc (sizeof (struct table_elt));
+ elt = xmalloc (sizeof (struct table_elt));
}
elt->exp = x;
@@ -3783,10 +3783,11 @@ fold_rtx (rtx x, rtx insn)
|| code == LTGT || code == UNEQ || code == ORDERED
|| code == UNORDERED)
{
- if (must_swap || (const_arg0
- && (const_arg1 == 0
- || (GET_CODE (const_arg0) == CONST_INT
- && GET_CODE (const_arg1) != CONST_INT))))
+ if (must_swap
+ || swap_commutative_operands_p (const_arg0 ? const_arg0
+ : XEXP (x, 0),
+ const_arg1 ? const_arg1
+ : XEXP (x, 1)))
{
rtx tem = XEXP (x, 0);
@@ -4692,7 +4693,7 @@ cse_insn (rtx insn, rtx libcall_insn)
if (GET_CODE (x) == SET)
{
- sets = (struct set *) alloca (sizeof (struct set));
+ sets = alloca (sizeof (struct set));
sets[0].rtl = x;
/* Ignore SETs that are unconditional jumps.
@@ -4727,7 +4728,7 @@ cse_insn (rtx insn, rtx libcall_insn)
{
int lim = XVECLEN (x, 0);
- sets = (struct set *) alloca (lim * sizeof (struct set));
+ sets = alloca (lim * sizeof (struct set));
/* Find all regs explicitly clobbered in this insn,
and ensure they are not replaced with any other regs
@@ -6939,8 +6940,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file)
max_insn_uid = get_max_uid ();
- reg_eqv_table = (struct reg_eqv_elem *)
- xmalloc (nregs * sizeof (struct reg_eqv_elem));
+ reg_eqv_table = xmalloc (nregs * sizeof (struct reg_eqv_elem));
#ifdef LOAD_EXTEND_OP
@@ -6956,7 +6956,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file)
/* Find the largest uid. */
max_uid = get_max_uid ();
- uid_cuid = (int *) xcalloc (max_uid + 1, sizeof (int));
+ uid_cuid = xcalloc (max_uid + 1, sizeof (int));
/* Compute the mapping from uids to cuids.
CUIDs are numbers assigned to insns, like uids,
@@ -7075,9 +7075,7 @@ cse_basic_block (rtx from, rtx to, struct branch_path *next_branch,
/* This array is undefined before max_reg, so only allocate
the space actually needed and adjust the start. */
- qty_table
- = (struct qty_table_elem *) xmalloc ((max_qty - max_reg)
- * sizeof (struct qty_table_elem));
+ qty_table = xmalloc ((max_qty - max_reg) * sizeof (struct qty_table_elem));
qty_table -= max_reg;
new_basic_block ();
@@ -7386,6 +7384,16 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr)
count_reg_usage (XEXP (x, 1), counts, NULL_RTX, incr);
return;
+ case ASM_OPERANDS:
+ /* If the asm is volatile, then this insn cannot be deleted,
+ and so the inputs *must* be live. */
+ if (MEM_VOLATILE_P (x))
+ dest = NULL_RTX;
+ /* Iterate over just the inputs, not the constraints as well. */
+ for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
+ count_reg_usage (ASM_OPERANDS_INPUT (x, i), counts, dest, incr);
+ return;
+
case INSN_LIST:
abort ();
@@ -7536,7 +7544,7 @@ delete_trivially_dead_insns (rtx insns, int nreg)
timevar_push (TV_DELETE_TRIVIALLY_DEAD);
/* First count the number of times each register is used. */
- counts = (int *) xcalloc (nreg, sizeof (int));
+ counts = xcalloc (nreg, sizeof (int));
for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
count_reg_usage (insn, counts, NULL_RTX, 1);
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 91c63b66b0e..8cb325d61a5 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -147,7 +147,7 @@ new_elt_list (struct elt_list *next, cselib_val *elt)
if (el)
empty_elt_lists = el->next;
else
- el = (struct elt_list *) ggc_alloc (sizeof (struct elt_list));
+ el = ggc_alloc (sizeof (struct elt_list));
el->next = next;
el->elt = elt;
return el;
@@ -164,7 +164,7 @@ new_elt_loc_list (struct elt_loc_list *next, rtx loc)
if (el)
empty_elt_loc_lists = el->next;
else
- el = (struct elt_loc_list *) ggc_alloc (sizeof (struct elt_loc_list));
+ el = ggc_alloc (sizeof (struct elt_loc_list));
el->next = next;
el->loc = loc;
el->setting_insn = cselib_current_insn;
@@ -704,7 +704,7 @@ new_cselib_val (unsigned int value, enum machine_mode mode)
if (e)
empty_vals = e->u.next_free;
else
- e = (cselib_val *) ggc_alloc (sizeof (cselib_val));
+ e = ggc_alloc (sizeof (cselib_val));
if (value == 0)
abort ();
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 0fb46a924f3..e4c797894c0 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -459,7 +459,7 @@ dbxout_init (const char *input_file_name)
asmfile = asm_out_file;
typevec_len = 100;
- typevec = (struct typeinfo *) ggc_calloc (typevec_len, sizeof typevec[0]);
+ typevec = ggc_calloc (typevec_len, sizeof typevec[0]);
/* Convert Ltext into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated
@@ -469,7 +469,8 @@ dbxout_init (const char *input_file_name)
/* Put the current working directory in an N_SO symbol. */
if (use_gnu_debug_info_extensions)
{
- if (!cwd && (cwd = getpwd ()) && (!*cwd || cwd[strlen (cwd) - 1] != '/'))
+ if (!cwd && (cwd = get_src_pwd ())
+ && (!*cwd || cwd[strlen (cwd) - 1] != '/'))
cwd = concat (cwd, FILE_NAME_JOINER, NULL);
if (cwd)
{
@@ -513,7 +514,7 @@ dbxout_init (const char *input_file_name)
next_type_number = 1;
#ifdef DBX_USE_BINCL
- current_file = (struct dbx_file *) ggc_alloc (sizeof *current_file);
+ current_file = ggc_alloc (sizeof *current_file);
current_file->next = NULL;
current_file->file_number = 0;
current_file->next_type_number = 1;
@@ -534,9 +535,10 @@ dbxout_init (const char *input_file_name)
DBX_OUTPUT_STANDARD_TYPES (syms);
#endif
- /* Get all permanent types that have typedef names,
- and output them all, except for those already output. */
-
+ /* Get all permanent types that have typedef names, and output them
+ all, except for those already output. Some language front ends
+ put these declarations in the top-level scope; some do not. */
+ dbxout_typedefs ((*lang_hooks.decls.builtin_type_decls) ());
dbxout_typedefs (syms);
}
@@ -562,7 +564,7 @@ dbxout_typedefs (tree syms)
}
#ifdef DBX_USE_BINCL
-/* Emit BINCL stab using given name. */
+/* Emit BINCL stab using given name. */
static void
emit_bincl_stab (const char *name)
{
@@ -626,7 +628,7 @@ dbxout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED)
{
#ifdef DBX_USE_BINCL
- struct dbx_file *n = (struct dbx_file *) ggc_alloc (sizeof *n);
+ struct dbx_file *n = ggc_alloc (sizeof *n);
n->next = current_file;
n->next_type_number = 1;
@@ -1262,11 +1264,8 @@ dbxout_type (tree type, int full)
if (next_type_number == typevec_len)
{
typevec
- = (struct typeinfo *) ggc_realloc (typevec,
- (typevec_len * 2
- * sizeof typevec[0]));
- memset ((char *) (typevec + typevec_len), 0,
- typevec_len * sizeof typevec[0]);
+ = ggc_realloc (typevec, (typevec_len * 2 * sizeof typevec[0]));
+ memset (typevec + typevec_len, 0, typevec_len * sizeof typevec[0]);
typevec_len *= 2;
}
@@ -1756,9 +1755,7 @@ dbxout_type (tree type, int full)
* BITS_PER_UNIT);
putc (',', asmfile);
CHARS (1);
- print_wide_int (tree_low_cst (DECL_SIZE
- (TYPE_NAME
- (BINFO_TYPE (child))),
+ print_wide_int (tree_low_cst (TYPE_SIZE (BINFO_TYPE (child)),
0)
* BITS_PER_UNIT);
putc (';', asmfile);
diff --git a/gcc/defaults.h b/gcc/defaults.h
index b968ea645eb..60e29253510 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -66,7 +66,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef ASM_FORMAT_PRIVATE_NAME
# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
do { const char *const name_ = (NAME); \
- char *const output_ = (OUTPUT) = (char *) alloca (strlen (name_) + 32);\
+ char *const output_ = (OUTPUT) = alloca (strlen (name_) + 32);\
sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
} while (0)
#endif
diff --git a/gcc/df.c b/gcc/df.c
index ae1896aa9b6..ae99d8eb64f 100644
--- a/gcc/df.c
+++ b/gcc/df.c
@@ -316,8 +316,7 @@ df_insn_table_realloc (struct df *df, unsigned int size)
to enlarge it so often. */
size += df->insn_size / 4;
- df->insns = (struct insn_info *)
- xrealloc (df->insns, size * sizeof (struct insn_info));
+ df->insns = xrealloc (df->insns, size * sizeof (struct insn_info));
memset (df->insns + df->insn_size, 0,
(size - df->insn_size) * sizeof (struct insn_info));
@@ -344,8 +343,7 @@ df_reg_table_realloc (struct df *df, int size)
if (size < max_reg_num ())
size = max_reg_num ();
- df->regs = (struct reg_info *)
- xrealloc (df->regs, size * sizeof (struct reg_info));
+ df->regs = xrealloc (df->regs, size * sizeof (struct reg_info));
/* Zero the new entries. */
memset (df->regs + df->reg_size, 0,
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index c9bef1a7e4a..c29867a60b3 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -39,56 +39,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h"
#include "langhooks-def.h"
-#define output_text_length(BUFFER) (BUFFER)->line_length
-#define is_starting_newline(BUFFER) (output_text_length (BUFFER) == 0)
-#define line_wrap_cutoff(BUFFER) (BUFFER)->state.maximum_length
-#define prefix_was_emitted_for(BUFFER) (BUFFER)->state.emitted_prefix_p
-
-/* Format an integer given by va_arg (ARG, type-specifier T) where
- type-specifier is a precision modifier as indicated by PREC. F is
- a string used to construct the appropriate format-specifier. */
-#define output_integer_with_precision(BUFFER, ARG, PREC, T, F) \
- do \
- switch (PREC) \
- { \
- case 0: \
- output_formatted_scalar \
- (BUFFER, "%" F, va_arg (ARG, T)); \
- break; \
- \
- case 1: \
- output_formatted_scalar \
- (BUFFER, "%l" F, va_arg (ARG, long T)); \
- break; \
- \
- case 2: \
- output_formatted_scalar \
- (BUFFER, "%ll" F, va_arg (ARG, long long T)); \
- break; \
- \
- default: \
- break; \
- } \
- while (0)
-
/* Prototypes. */
-static void output_flush (output_buffer *);
-static void output_do_verbatim (output_buffer *, text_info *);
-static void output_buffer_to_stream (output_buffer *);
-static void output_format (output_buffer *, text_info *);
-static void output_indent (output_buffer *);
-
-static char *build_message_string (const char *, ...)
- ATTRIBUTE_PRINTF_1;
-static void format_with_decl (output_buffer *, text_info *, tree);
-static void diagnostic_for_decl (diagnostic_context *, diagnostic_info *,
- tree);
-static void set_real_maximum_length (output_buffer *);
-static void output_append_r (output_buffer *, const char *, int);
-static void wrap_text (output_buffer *, const char *, const char *);
-static void maybe_wrap_text (output_buffer *, const char *, const char *);
-static void output_clear_data (output_buffer *);
+static char *build_message_string (const char *, ...) ATTRIBUTE_PRINTF_1;
static void default_diagnostic_starter (diagnostic_context *,
diagnostic_info *);
@@ -116,482 +69,6 @@ with preprocessed source if appropriate.\n\
See %s for instructions.\n"
-/* Subroutine of output_set_maximum_length. Set up BUFFER's
- internal maximum characters per line. */
-static void
-set_real_maximum_length (output_buffer *buffer)
-{
- /* If we're told not to wrap lines then do the obvious thing. In case
- we'll emit prefix only once per diagnostic message, it is appropriate
- not to increase unnecessarily the line-length cut-off. */
- if (!output_is_line_wrapping (buffer)
- || output_prefixing_rule (buffer) == DIAGNOSTICS_SHOW_PREFIX_ONCE
- || output_prefixing_rule (buffer) == DIAGNOSTICS_SHOW_PREFIX_NEVER)
- line_wrap_cutoff (buffer) = output_line_cutoff (buffer);
- else
- {
- int prefix_length = buffer->state.prefix ?
- strlen (buffer->state.prefix) : 0;
- /* If the prefix is ridiculously too long, output at least
- 32 characters. */
- if (output_line_cutoff (buffer) - prefix_length < 32)
- line_wrap_cutoff (buffer) = output_line_cutoff (buffer) + 32;
- else
- line_wrap_cutoff (buffer) = output_line_cutoff (buffer);
- }
-}
-
-/* Sets the number of maximum characters per line BUFFER can output
- in line-wrapping mode. A LENGTH value 0 suppresses line-wrapping. */
-void
-output_set_maximum_length (output_buffer *buffer, int length)
-{
- output_line_cutoff (buffer) = length;
- set_real_maximum_length (buffer);
-}
-
-/* Sets BUFFER's PREFIX. */
-void
-output_set_prefix (output_buffer *buffer, const char *prefix)
-{
- buffer->state.prefix = prefix;
- set_real_maximum_length (buffer);
- prefix_was_emitted_for (buffer) = false;
- output_indentation (buffer) = 0;
-}
-
-/* Return a pointer to the last character emitted in the output
- BUFFER area. A NULL pointer means no character available. */
-const char *
-output_last_position (const output_buffer *buffer)
-{
- const char *p = NULL;
-
- if (obstack_base (&buffer->obstack) != obstack_next_free (&buffer->obstack))
- p = ((const char *) obstack_next_free (&buffer->obstack)) - 1;
- return p;
-}
-
-/* Free BUFFER's prefix, a previously malloc'd string. */
-void
-output_destroy_prefix (output_buffer *buffer)
-{
- if (buffer->state.prefix != NULL)
- {
- free ((char *) buffer->state.prefix);
- buffer->state.prefix = NULL;
- }
-}
-
-/* Zero out any text output so far in BUFFER. */
-void
-output_clear_message_text (output_buffer *buffer)
-{
- obstack_free (&buffer->obstack, obstack_base (&buffer->obstack));
- output_text_length (buffer) = 0;
-}
-
-/* Zero out any formatting data used so far by BUFFER. */
-static void
-output_clear_data (output_buffer *buffer)
-{
- prefix_was_emitted_for (buffer) = false;
- output_indentation (buffer) = 0;
-}
-
-/* Construct an output BUFFER with PREFIX and of MAXIMUM_LENGTH
- characters per line. */
-void
-init_output_buffer (output_buffer *buffer, const char *prefix,
- int maximum_length)
-{
- memset (buffer, 0, sizeof (output_buffer));
- obstack_init (&buffer->obstack);
- output_buffer_attached_stream (buffer) = stderr;
- output_line_cutoff (buffer) = maximum_length;
- output_prefixing_rule (buffer) = diagnostic_prefixing_rule (global_dc);
- output_set_prefix (buffer, prefix);
- output_text_length (buffer) = 0;
- output_clear_data (buffer);
-}
-
-/* Reinitialize BUFFER. */
-void
-output_clear (output_buffer *buffer)
-{
- output_clear_message_text (buffer);
- output_clear_data (buffer);
-}
-
-/* Finishes constructing a NULL-terminated character string representing
- the BUFFERed message. */
-const char *
-output_finalize_message (output_buffer *buffer)
-{
- obstack_1grow (&buffer->obstack, '\0');
- return output_message_text (buffer);
-}
-
-/* Return the amount of characters BUFFER can accept to
- make a full line. */
-int
-output_space_left (const output_buffer *buffer)
-{
- return line_wrap_cutoff (buffer) - output_text_length (buffer);
-}
-
-/* Write out BUFFER's prefix. */
-void
-output_emit_prefix (output_buffer *buffer)
-{
- if (buffer->state.prefix != NULL)
- {
- switch (output_prefixing_rule (buffer))
- {
- default:
- case DIAGNOSTICS_SHOW_PREFIX_NEVER:
- break;
-
- case DIAGNOSTICS_SHOW_PREFIX_ONCE:
- if (prefix_was_emitted_for (buffer))
- {
- output_indent (buffer);
- break;
- }
- output_indentation (buffer) += 3;
- /* Fall through. */
-
- case DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE:
- {
- int prefix_length = strlen (buffer->state.prefix);
- output_append_r (buffer, buffer->state.prefix, prefix_length);
- prefix_was_emitted_for (buffer) = true;
- }
- break;
- }
- }
-}
-
-/* Have BUFFER start a new line. */
-void
-output_add_newline (output_buffer *buffer)
-{
- obstack_1grow (&buffer->obstack, '\n');
- output_text_length (buffer) = 0;
-}
-
-/* Appends a character to BUFFER. */
-void
-output_add_character (output_buffer *buffer, int c)
-{
- if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
- output_add_newline (buffer);
- obstack_1grow (&buffer->obstack, c);
- ++output_text_length (buffer);
-}
-
-/* Adds a space to BUFFER. */
-void
-output_add_space (output_buffer *buffer)
-{
- if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
- {
- output_add_newline (buffer);
- return;
- }
- obstack_1grow (&buffer->obstack, ' ');
- ++output_text_length (buffer);
-}
-
-/* These functions format an INTEGER into BUFFER as suggested by their
- names. */
-void
-output_decimal (output_buffer *buffer, int i)
-{
- output_formatted_scalar (buffer, "%d", i);
-}
-
-void
-output_host_wide_integer (output_buffer *buffer, HOST_WIDE_INT i)
-{
- output_formatted_scalar (buffer, HOST_WIDE_INT_PRINT_DEC, i);
-}
-
-static inline void
-output_pointer (output_buffer *buffer, void *p)
-{
- output_formatted_scalar (buffer, HOST_PTR_PRINTF, p);
-}
-
-/* Append to BUFFER a string specified by its STARTING character
- and LENGTH. */
-static void
-output_append_r (output_buffer *buffer, const char *start, int length)
-{
- obstack_grow (&buffer->obstack, start, length);
- output_text_length (buffer) += length;
-}
-
-/* Append a string delimited by START and END to BUFFER. No wrapping is
- done. However, if beginning a new line then emit BUFFER->state.prefix
- and skip any leading whitespace if appropriate. The caller must ensure
- that it is safe to do so. */
-void
-output_append (output_buffer *buffer, const char *start, const char *end)
-{
- /* Emit prefix and skip whitespace if we're starting a new line. */
- if (is_starting_newline (buffer))
- {
- output_emit_prefix (buffer);
- if (output_is_line_wrapping (buffer))
- while (start != end && *start == ' ')
- ++start;
- }
- output_append_r (buffer, start, end - start);
-}
-
-/* Insert enough spaces into BUFFER to bring the column position to
- the current indentation level, assuming that a newline has just
- been written to the buffer. */
-static void
-output_indent (output_buffer *buffer)
-{
- int n = output_indentation (buffer);
- int i;
-
- for (i = 0; i < n; ++i)
- output_add_character (buffer, ' ');
-}
-
-/* Wrap a text delimited by START and END into BUFFER. */
-static void
-wrap_text (output_buffer *buffer, const char *start, const char *end)
-{
- bool is_wrapping = output_is_line_wrapping (buffer);
-
- while (start != end)
- {
- /* Dump anything bordered by whitespaces. */
- {
- const char *p = start;
- while (p != end && *p != ' ' && *p != '\n')
- ++p;
- if (is_wrapping && p - start >= output_space_left (buffer))
- output_add_newline (buffer);
- output_append (buffer, start, p);
- start = p;
- }
-
- if (start != end && *start == ' ')
- {
- output_add_space (buffer);
- ++start;
- }
- if (start != end && *start == '\n')
- {
- output_add_newline (buffer);
- ++start;
- }
- }
-}
-
-/* Same as wrap_text but wrap text only when in line-wrapping mode. */
-static void
-maybe_wrap_text (output_buffer *buffer, const char *start, const char *end)
-{
- if (output_is_line_wrapping (buffer))
- wrap_text (buffer, start, end);
- else
- output_append (buffer, start, end);
-}
-
-
-/* Append a STRING to BUFFER; the STRING might be line-wrapped if in
- appropriate mode. */
-void
-output_add_string (output_buffer *buffer, const char *str)
-{
- maybe_wrap_text (buffer, str, str + (str ? strlen (str) : 0));
-}
-
-/* Append an identifier ID to BUFFER. */
-void
-output_add_identifier (output_buffer *buffer, tree id)
-{
- output_append (buffer, IDENTIFIER_POINTER (id),
- IDENTIFIER_POINTER (id) + IDENTIFIER_LENGTH (id));
-}
-
-/* Flush the content of BUFFER onto the attached stream,
- and reinitialize. */
-
-static void
-output_buffer_to_stream (output_buffer *buffer)
-{
- const char *text = output_finalize_message (buffer);
- fputs (text, output_buffer_attached_stream (buffer));
- output_clear_message_text (buffer);
-}
-
-/* Format a message pointed to by TEXT. The following format specifiers are
- recognized as being language independent:
- %d, %i: (signed) integer in base ten.
- %u: unsigned integer in base ten.
- %o: unsigned integer in base eight.
- %x: unsigned integer in base sixteen.
- %ld, %li, %lo, %lu, %lx: long versions of the above.
- %lld, %lli, %llo, %llu, %llx: long long versions.
- %wd, %wi, %wo, %wu, %wx: HOST_WIDE_INT versions.
- %c: character.
- %s: string.
- %p: pointer.
- %m: strerror(text->err_no) - does not consume a value from args_ptr.
- %%: `%'.
- %*.s: a substring the length of which is specified by an integer.
- %H: location_t. */
-static void
-output_format (output_buffer *buffer, text_info *text)
-{
- for (; *text->format_spec; ++text->format_spec)
- {
- int precision = 0;
- bool wide = false;
-
- /* Ignore text. */
- {
- const char *p = text->format_spec;
- while (*p && *p != '%')
- ++p;
- wrap_text (buffer, text->format_spec, p);
- text->format_spec = p;
- }
-
- if (*text->format_spec == '\0')
- break;
-
- /* We got a '%'. Parse precision modifiers, if any. */
- switch (*++text->format_spec)
- {
- case 'w':
- wide = true;
- ++text->format_spec;
- break;
-
- case 'l':
- do
- ++precision;
- while (*++text->format_spec == 'l');
- break;
-
- default:
- break;
- }
- /* We don't support precision behond that of "long long". */
- if (precision > 2)
- abort();
-
- switch (*text->format_spec)
- {
- case 'c':
- output_add_character (buffer, va_arg (*text->args_ptr, int));
- break;
-
- case 'd':
- case 'i':
- if (wide)
- output_formatted_scalar
- (buffer, HOST_WIDE_INT_PRINT_DEC,
- va_arg (*text->args_ptr, HOST_WIDE_INT));
- else
- output_integer_with_precision
- (buffer, *text->args_ptr, precision, int, "d");
- break;
-
- case 'o':
- if (wide)
- output_formatted_scalar
- (buffer, "%" HOST_WIDE_INT_PRINT "o",
- va_arg (*text->args_ptr, unsigned HOST_WIDE_INT));
- else
- output_integer_with_precision
- (buffer, *text->args_ptr, precision, unsigned, "u");
- break;
-
- case 's':
- output_add_string (buffer, va_arg (*text->args_ptr, const char *));
- break;
-
- case 'p':
- output_pointer (buffer, va_arg (*text->args_ptr, void *));
- break;
-
- case 'u':
- if (wide)
- output_formatted_scalar
- (buffer, HOST_WIDE_INT_PRINT_UNSIGNED,
- va_arg (*text->args_ptr, unsigned HOST_WIDE_INT));
- else
- output_integer_with_precision
- (buffer, *text->args_ptr, precision, unsigned, "u");
- break;
-
- case 'x':
- if (wide)
- output_formatted_scalar
- (buffer, HOST_WIDE_INT_PRINT_HEX,
- va_arg (*text->args_ptr, unsigned HOST_WIDE_INT));
- else
- output_integer_with_precision
- (buffer, *text->args_ptr, precision, unsigned, "x");
- break;
-
- case 'm':
- output_add_string (buffer, xstrerror (text->err_no));
- break;
-
- case '%':
- output_add_character (buffer, '%');
- break;
-
- case 'H':
- {
- const location_t *locus = va_arg (*text->args_ptr, location_t *);
- output_add_string (buffer, "file '");
- output_add_string (buffer, locus->file);
- output_add_string (buffer, "', line ");
- output_decimal (buffer, locus->line);
- }
- break;
-
- case '.':
- {
- int n;
- const char *s;
- /* We handle no precision specifier but `%.*s'. */
- if (*++text->format_spec != '*')
- abort ();
- else if (*++text->format_spec != 's')
- abort ();
- n = va_arg (*text->args_ptr, int);
- s = va_arg (*text->args_ptr, const char *);
- output_append (buffer, s, s + n);
- }
- break;
-
- default:
- if (!buffer->format_decoder
- || !(*buffer->format_decoder) (buffer, text))
- {
- /* Hmmm. The front-end failed to install a format translator
- but called us with an unrecognized format. Or, maybe, the
- translated string just contains an invalid format, or
- has formats in the wrong order. Sorry. */
- abort ();
- }
- }
- }
-}
-
/* Return a malloc'd string containing MSG formatted a la printf. The
caller is responsible for freeing the memory. */
static char *
@@ -614,127 +91,31 @@ file_name_as_prefix (const char *f)
return build_message_string ("%s: ", f);
}
-/* Format a message into BUFFER a la printf. */
-void
-output_printf (struct output_buffer *buffer, const char *msgid, ...)
-{
- text_info text;
- va_list ap;
-
- va_start (ap, msgid);
- text.err_no = errno;
- text.args_ptr = &ap;
- text.format_spec = _(msgid);
- output_format (buffer, &text);
- va_end (ap);
-}
-
-/* Print a message relevant to the given DECL. */
-static void
-format_with_decl (output_buffer *buffer, text_info *text, tree decl)
-{
- const char *p;
-
- /* Do magic to get around lack of varargs support for insertion
- of arguments into existing list. We know that the decl is first;
- we ass_u_me that it will be printed with "%s". */
- for (p = text->format_spec; *p; ++p)
- {
- if (*p == '%')
- {
- if (*(p + 1) == '%')
- ++p;
- else if (*(p + 1) != 's')
- abort ();
- else
- break;
- }
- }
-
- /* Print the left-hand substring. */
- maybe_wrap_text (buffer, text->format_spec, p);
-
- if (*p == '%') /* Print the name. */
- {
- const char *const n = (DECL_NAME (decl)
- ? (*lang_hooks.decl_printable_name) (decl, 2)
- : _("((anonymous))"));
- output_add_string (buffer, n);
- while (*p)
- {
- ++p;
- if (ISALPHA (*(p - 1) & 0xFF))
- break;
- }
- }
-
- if (*p) /* Print the rest of the message. */
- {
- text->format_spec = p;
- output_format (buffer, text);
- }
-}
-
-/* Flush the content of BUFFER onto the attached stream. */
-static void
-output_flush (output_buffer *buffer)
-{
- output_buffer_to_stream (buffer);
- output_clear_data (buffer);
- fputc ('\n', output_buffer_attached_stream (buffer));
- fflush (output_buffer_attached_stream (buffer));
-}
-
-/* Helper subroutine of output_verbatim and verbatim. Do the appropriate
- settings needed by BUFFER for a verbatim formatting. */
-static void
-output_do_verbatim (output_buffer *buffer, text_info *text)
-{
- diagnostic_prefixing_rule_t rule = output_prefixing_rule (buffer);
- int line_cutoff = output_line_cutoff (buffer);
-
- /* Set verbatim mode. */
- output_prefixing_rule (buffer) = DIAGNOSTICS_SHOW_PREFIX_NEVER;
- output_line_cutoff (buffer) = 0;
- /* Do the actual formatting. */
- output_format (buffer, text);
- /* Restore previous settings. */
- output_prefixing_rule (buffer) = rule;
- output_line_cutoff (buffer) = line_cutoff;
-}
-
-/* Output MESSAGE verbatim into BUFFER. */
-void
-output_verbatim (output_buffer *buffer, const char *msgid, ...)
-{
- text_info text;
- va_list ap;
-
- va_start (ap, msgid);
- text.err_no = errno;
- text.args_ptr = &ap;
- text.format_spec = _(msgid);
- output_do_verbatim (buffer, &text);
- va_end (ap);
-}
/* Initialize the diagnostic message outputting machinery. */
void
diagnostic_initialize (diagnostic_context *context)
{
- memset (context, 0, sizeof *context);
- obstack_init (&context->buffer.obstack);
-
+ /* Allocate a basic pretty-printer. Clients will replace this a
+ much more elaborated pretty-printer if they wish. */
+ context->printer = xmalloc (sizeof (pretty_printer));
+ pp_construct (context->printer, NULL, 0);
/* By default, diagnostics are sent to stderr. */
- output_buffer_attached_stream (&context->buffer) = stderr;
-
+ context->printer->buffer->stream = stderr;
/* By default, we emit prefixes once per message. */
- diagnostic_prefixing_rule (context) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
+ context->printer->prefixing_rule = DIAGNOSTICS_SHOW_PREFIX_ONCE;
+ memset (context->diagnostic_count, 0, sizeof context->diagnostic_count);
+ context->warnings_are_errors_message = warnings_are_errors;
+ context->abort_on_error = false;
+ context->internal_error = NULL;
diagnostic_starter (context) = default_diagnostic_starter;
diagnostic_finalizer (context) = default_diagnostic_finalizer;
- context->warnings_are_errors_message = warnings_are_errors;
+ context->last_module = 0;
+ context->last_function = NULL;
+ context->lock = 0;
+ context->x_data = NULL;
}
/* Returns true if the next format specifier in TEXT is a format specifier
@@ -749,10 +130,17 @@ text_specifies_location (text_info *text, location_t *locus)
;
/* Extract the location information if any. */
- if (*p == '%' && *++p == 'H')
+ if (p[0] == '%' && p[1] == 'H')
{
*locus = *va_arg (*text->args_ptr, location_t *);
- text->format_spec = p + 1;
+ text->format_spec = p + 2;
+ return true;
+ }
+ else if (p[0] == '%' && p[1] == 'J')
+ {
+ tree t = va_arg (*text->args_ptr, tree);
+ *locus = DECL_SOURCE_LOCATION (t);
+ text->format_spec = p + 2;
return true;
}
@@ -797,13 +185,6 @@ diagnostic_build_prefix (diagnostic_info *diagnostic)
_(diagnostic_kind_text[diagnostic->kind]));
}
-void
-diagnostic_flush_buffer (diagnostic_context *context)
-{
- output_buffer_to_stream (&context->buffer);
- fflush (output_buffer_attached_stream (&context->buffer));
-}
-
/* Count a diagnostic. Return true if the message should be printed. */
static bool
diagnostic_count_diagnostic (diagnostic_context *context,
@@ -833,7 +214,7 @@ diagnostic_count_diagnostic (diagnostic_context *context,
if (context->internal_error)
(*context->internal_error) (diagnostic->message.format_spec,
diagnostic->message.args_ptr);
- /* fall through */
+ /* Fall through. */
case DK_FATAL: case DK_SORRY:
case DK_ANACHRONISM: case DK_NOTE:
@@ -852,12 +233,12 @@ diagnostic_count_diagnostic (diagnostic_context *context,
if (context->warnings_are_errors_message)
{
- output_verbatim (&context->buffer,
- "%s: warnings being treated as errors\n", progname);
+ pp_verbatim (context->printer,
+ "%s: warnings being treated as errors\n", progname);
context->warnings_are_errors_message = false;
}
- /* and fall through */
+ /* And fall through. */
case DK_ERROR:
++diagnostic_kind_count (context, DK_ERROR);
break;
@@ -905,57 +286,6 @@ diagnostic_action_after_output (diagnostic_context *context,
}
}
-/* Called when the start of a function definition is parsed,
- this function prints on stderr the name of the function. */
-void
-announce_function (tree decl)
-{
- if (!quiet_flag)
- {
- if (rtl_dump_and_exit)
- verbatim ("%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
- else
- verbatim (" %s", (*lang_hooks.decl_printable_name) (decl, 2));
- fflush (stderr);
- output_needs_newline (&global_dc->buffer) = true;
- diagnostic_set_last_function (global_dc);
- }
-}
-
-/* The default function to print out name of current function that caused
- an error. */
-void
-lhd_print_error_function (diagnostic_context *context, const char *file)
-{
- if (diagnostic_last_function_changed (context))
- {
- const char *old_prefix = output_prefix (&context->buffer);
- char *new_prefix = file ? build_message_string ("%s: ", file) : NULL;
-
- output_set_prefix (&context->buffer, new_prefix);
-
- if (current_function_decl == NULL)
- output_add_string (&context->buffer, _("At top level:"));
- else
- {
- if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
- output_printf
- (&context->buffer, "In member function `%s':",
- (*lang_hooks.decl_printable_name) (current_function_decl, 2));
- else
- output_printf
- (&context->buffer, "In function `%s':",
- (*lang_hooks.decl_printable_name) (current_function_decl, 2));
- }
- output_add_newline (&context->buffer);
-
- diagnostic_set_last_function (context);
- output_buffer_to_stream (&context->buffer);
- context->buffer.state.prefix = old_prefix;
- free ((char*) new_prefix);
- }
-}
-
/* Prints out, if necessary, the name of the current function
that caused an error. Called from all error and warning functions.
We ignore the FILE parameter, as it cannot be relied upon. */
@@ -972,25 +302,23 @@ diagnostic_report_current_module (diagnostic_context *context)
{
struct file_stack *p;
- if (output_needs_newline (&context->buffer))
+ if (pp_needs_newline (context->printer))
{
- output_add_newline (&context->buffer);
- output_needs_newline (&context->buffer) = false;
+ pp_newline (context->printer);
+ pp_needs_newline (context->printer) = false;
}
- if (input_file_stack && input_file_stack->next != 0
- && diagnostic_last_module_changed (context))
+ if (input_file_stack && diagnostic_last_module_changed (context))
{
- for (p = input_file_stack->next; p; p = p->next)
- if (p == input_file_stack->next)
- output_verbatim (&context->buffer,
- "In file included from %s:%d",
- p->location.file, p->location.line);
- else
- output_verbatim (&context->buffer,
- ",\n from %s:%d",
- p->location.file, p->location.line);
- output_verbatim (&context->buffer, ":\n");
+ p = input_file_stack;
+ pp_verbatim (context->printer,
+ "In file included from %s:%d",
+ p->location.file, p->location.line);
+ while ((p = p->next) != NULL)
+ pp_verbatim (context->printer,
+ ",\n from %s:%d",
+ p->location.file, p->location.line);
+ pp_verbatim (context->printer, ":\n");
diagnostic_set_last_module (context);
}
}
@@ -1000,14 +328,14 @@ default_diagnostic_starter (diagnostic_context *context,
diagnostic_info *diagnostic)
{
diagnostic_report_current_function (context);
- output_set_prefix (&context->buffer, diagnostic_build_prefix (diagnostic));
+ pp_set_prefix (context->printer, diagnostic_build_prefix (diagnostic));
}
static void
default_diagnostic_finalizer (diagnostic_context *context,
diagnostic_info *diagnostic __attribute__((unused)))
{
- output_destroy_prefix (&context->buffer);
+ pp_destroy_prefix (context->printer);
}
/* Report a diagnostic message (an error or a warning) as specified by
@@ -1020,37 +348,15 @@ void
diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic_info *diagnostic)
{
- if (context->lock++)
+ if (context->lock++ && diagnostic->kind < DK_SORRY)
error_recursion (context);
if (diagnostic_count_diagnostic (context, diagnostic))
{
(*diagnostic_starter (context)) (context, diagnostic);
- output_format (&context->buffer, &diagnostic->message);
+ pp_format_text (context->printer, &diagnostic->message);
(*diagnostic_finalizer (context)) (context, diagnostic);
- output_flush (&context->buffer);
- diagnostic_action_after_output (context, diagnostic);
- }
-
- context->lock--;
-}
-
-/* Report a diagnostic MESSAGE at the declaration DECL.
- MSG is a format string which uses %s to substitute the declaration
- name; subsequent substitutions are a la output_format. */
-static void
-diagnostic_for_decl (diagnostic_context *context,
- diagnostic_info *diagnostic, tree decl)
-{
- if (context->lock++)
- error_recursion (context);
-
- if (diagnostic_count_diagnostic (context, diagnostic))
- {
- (*diagnostic_starter (context)) (context, diagnostic);
- format_with_decl (&context->buffer, &diagnostic->message, decl);
- (*diagnostic_finalizer (context)) (context, diagnostic);
- output_flush (&context->buffer);
+ pp_flush (context->printer);
diagnostic_action_after_output (context, diagnostic);
}
@@ -1116,8 +422,8 @@ verbatim (const char *msgid, ...)
text.err_no = errno;
text.args_ptr = &ap;
text.format_spec = _(msgid);
- output_do_verbatim (&global_dc->buffer, &text);
- output_buffer_to_stream (&global_dc->buffer);
+ pp_format_verbatim (global_dc->printer, &text);
+ pp_flush (global_dc->printer);
va_end (ap);
}
@@ -1236,61 +542,6 @@ internal_error (const char *msgid, ...)
real_abort ();
}
-/* Variants of some of the above, which make reference to a particular
- DECL node. These are deprecated. */
-
-void
-warning_with_decl (tree decl, const char *msgid, ...)
-{
- diagnostic_info diagnostic;
- va_list ap;
-
- va_start (ap, msgid);
-
- /* Do not issue a warning about a decl which came from a system header,
- unless -Wsystem-headers. */
- if (DECL_IN_SYSTEM_HEADER (decl) && !warn_system_headers)
- return;
-
- diagnostic_set_info (&diagnostic, msgid, &ap,
- DECL_SOURCE_LOCATION (decl), DK_WARNING);
- diagnostic_for_decl (global_dc, &diagnostic, decl);
- va_end (ap);
-}
-
-void
-pedwarn_with_decl (tree decl, const char *msgid, ...)
-{
- diagnostic_info diagnostic;
- va_list ap;
-
- va_start (ap, msgid);
-
- /* Do not issue a warning about a decl which came from a system header,
- unless -Wsystem-headers. */
- if (DECL_IN_SYSTEM_HEADER (decl) && !warn_system_headers)
- return;
-
- diagnostic_set_info (&diagnostic, msgid, &ap,
- DECL_SOURCE_LOCATION (decl), pedantic_error_kind ());
- diagnostic_for_decl (global_dc, &diagnostic, decl);
-
- va_end (ap);
-}
-
-void
-error_with_decl (tree decl, const char *msgid, ...)
-{
- diagnostic_info diagnostic;
- va_list ap;
-
- va_start (ap, msgid);
- diagnostic_set_info (&diagnostic, msgid, &ap,
- DECL_SOURCE_LOCATION (decl), DK_ERROR);
- diagnostic_for_decl (global_dc, &diagnostic, decl);
- va_end (ap);
-}
-
/* Special case error functions. Most are implemented in terms of the
above, or should be. */
@@ -1306,44 +557,6 @@ fnotice (FILE *file, const char *msgid, ...)
va_end (ap);
}
-/* Warn about a use of an identifier which was marked deprecated. */
-void
-warn_deprecated_use (tree node)
-{
- if (node == 0 || !warn_deprecated_decl)
- return;
-
- if (DECL_P (node))
- warning ("`%s' is deprecated (declared at %s:%d)",
- IDENTIFIER_POINTER (DECL_NAME (node)),
- DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
- else if (TYPE_P (node))
- {
- const char *what = NULL;
- tree decl = TYPE_STUB_DECL (node);
-
- if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
- what = IDENTIFIER_POINTER (TYPE_NAME (node));
- else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (node)))
- what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
-
- if (what)
- {
- if (decl)
- warning ("`%s' is deprecated (declared at %s:%d)", what,
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
- else
- warning ("`%s' is deprecated", what);
- }
- else if (decl)
- warning ("type is deprecated (declared at %s:%d)",
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
- else
- warning ("type is deprecated");
- }
-}
-
/* Inform the user that an error occurred while trying to report some
other error. This indicates catastrophic internal inconsistencies,
so give up now. But do try to flush out the previous error.
@@ -1353,7 +566,7 @@ static void
error_recursion (diagnostic_context *context)
{
if (context->lock < 3)
- output_flush (&context->buffer);
+ pp_flush (context->printer);
fnotice (stderr,
"Internal compiler error: Error reporting routines re-entered.\n");
diff --git a/gcc/diagnostic.def b/gcc/diagnostic.def
index 83e5d9cae72..6820bb72e9f 100644
--- a/gcc/diagnostic.def
+++ b/gcc/diagnostic.def
@@ -1,7 +1,7 @@
DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error: ")
DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error: ")
-DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ")
DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "error: ")
+DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ")
DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ")
DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ")
DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ")
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index cd0cebaf1bd..cf331e0df5f 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -22,17 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_DIAGNOSTIC_H
#define GCC_DIAGNOSTIC_H
-#include "obstack.h"
-#include "input.h"
-
-/* The type of a text to be formatted according a format specification
- along with a list of things. */
-typedef struct
-{
- const char *format_spec;
- va_list *args_ptr;
- int err_no; /* for %m */
-} text_info;
+#include "pretty-print.h"
/* Constants used to discriminate diagnostics. */
typedef enum
@@ -56,118 +46,6 @@ typedef struct
#define pedantic_error_kind() (flag_pedantic_errors ? DK_ERROR : DK_WARNING)
-/* How often diagnostics are prefixed by their locations:
- o DIAGNOSTICS_SHOW_PREFIX_NEVER: never - not yet supported;
- o DIAGNOSTICS_SHOW_PREFIX_ONCE: emit only once;
- o DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE: emit each time a physical
- line is started. */
-typedef enum
-{
- DIAGNOSTICS_SHOW_PREFIX_ONCE = 0x0,
- DIAGNOSTICS_SHOW_PREFIX_NEVER = 0x1,
- DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE = 0x2
-} diagnostic_prefixing_rule_t;
-
-/* This data structure encapsulates an output_buffer's state. */
-typedef struct
-{
- /* The prefix for each new line. */
- const char *prefix;
-
- /* The real upper bound of number of characters per line, taking into
- account the case of a very very looong prefix. */
- int maximum_length;
-
- /* The ideal upper bound of number of characters per line, as suggested
- by front-end. */
- int ideal_maximum_length;
-
- /* Indentation count. */
- int indent_skip;
-
- /* Nonzero if current PREFIX was emitted at least once. */
- bool emitted_prefix_p;
-
- /* Nonzero means one should emit a newline before outputting anything. */
- bool need_newline_p;
-
- /* Current prefixing rule. */
- diagnostic_prefixing_rule_t prefixing_rule;
-} output_state;
-
-/* The type of a hook that formats client-specific data (trees mostly) into
- an output_buffer. A client-supplied formatter returns true if everything
- goes well. */
-typedef struct output_buffer output_buffer;
-typedef bool (*printer_fn) (output_buffer *, text_info *);
-
-/* The output buffer datatype. This is best seen as an abstract datatype
- whose fields should not be accessed directly by clients. */
-struct output_buffer
-{
- /* The current state of the buffer. */
- output_state state;
-
- /* Where to output formatted text. */
- FILE* stream;
-
- /* The obstack where the text is built up. */
- struct obstack obstack;
-
- /* The amount of characters output so far. */
- int line_length;
-
- /* This must be large enough to hold any printed integer or
- floating-point value. */
- char digit_buffer[128];
-
- /* If non-NULL, this function formats a TEXT into the BUFFER. When called,
- TEXT->format_spec points to a format code. FORMAT_DECODER should call
- output_add_string (and related functions) to add data to the BUFFER.
- FORMAT_DECODER can read arguments from *TEXT->args_pts using VA_ARG.
- If the BUFFER needs additional characters from the format string, it
- should advance the TEXT->format_spec as it goes. When FORMAT_DECODER
- returns, TEXT->format_spec should point to the last character processed.
- */
- printer_fn format_decoder;
-} ;
-
-#define output_prefix(BUFFER) (BUFFER)->state.prefix
-
-/* The stream attached to the output_buffer, where the formatted
- diagnostics will ultimately go. Works only on `output_buffer *'. */
-#define output_buffer_attached_stream(BUFFER) (BUFFER)->stream
-
-/* In line-wrapping mode, whether we should start a new line. */
-#define output_needs_newline(BUFFER) (BUFFER)->state.need_newline_p
-
-/* The amount of whitespace to be emitted when starting a new line. */
-#define output_indentation(BUFFER) (BUFFER)->state.indent_skip
-
-/* A pointer to the formatted diagnostic message. */
-#define output_message_text(BUFFER) \
- ((const char *) obstack_base (&(BUFFER)->obstack))
-
-/* Client supplied function used to decode formats. */
-#define output_format_decoder(BUFFER) (BUFFER)->format_decoder
-
-/* Prefixing rule used in formatting a diagnostic message. */
-#define output_prefixing_rule(BUFFER) (BUFFER)->state.prefixing_rule
-
-/* Maximum characters per line in automatic line wrapping mode.
- Zero means don't wrap lines. */
-#define output_line_cutoff(BUFFER) (BUFFER)->state.ideal_maximum_length
-
-/* True if BUFFER is in line-wrapping mode. */
-#define output_is_line_wrapping(BUFFER) (output_line_cutoff (BUFFER) > 0)
-
-#define output_formatted_scalar(BUFFER, FORMAT, SCALAR) \
- do \
- { \
- sprintf ((BUFFER)->digit_buffer, FORMAT, SCALAR); \
- output_add_string (BUFFER, (BUFFER)->digit_buffer); \
- } \
- while (0)
/* Forward declarations. */
typedef struct diagnostic_context diagnostic_context;
@@ -179,10 +57,8 @@ typedef diagnostic_starter_fn diagnostic_finalizer_fn;
the context of a diagnostic message. */
struct diagnostic_context
{
- /* Where most of the diagnostic formatting work is done. In Object
- Oriented terms, we'll say that diagnostic_context is a sub-class of
- output_buffer. */
- output_buffer buffer;
+ /* Where most of the diagnostic formatting work is done. */
+ pretty_printer *printer;
/* The number of times we have issued diagnostics. */
int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND];
@@ -233,15 +109,17 @@ struct diagnostic_context
/* Extension hook for client. */
#define diagnostic_auxiliary_data(DC) (DC)->x_data
-/* Same as output_format_decoder. Works on 'diagnostic_context *'. */
-#define diagnostic_format_decoder(DC) output_format_decoder (&(DC)->buffer)
+/* Same as pp_format_decoder. Works on 'diagnostic_context *'. */
+#define diagnostic_format_decoder(DC) ((DC)->printer->format_decoder)
/* Same as output_prefixing_rule. Works on 'diagnostic_context *'. */
-#define diagnostic_prefixing_rule(DC) output_prefixing_rule (&(DC)->buffer)
+#define diagnostic_prefixing_rule(DC) ((DC)->printer->prefixing_rule)
/* Maximum characters per line in automatic line wrapping mode.
Zero means don't wrap lines. */
-#define diagnostic_line_cutoff(DC) output_line_cutoff (&(DC)->buffer)
+#define diagnostic_line_cutoff(DC) ((DC)->printer->ideal_maximum_length)
+
+#define diagnostic_flush_buffer(DC) pp_base_flush ((DC)->printer)
/* True if the last function in which a diagnostic was reported is
different from the current one. */
@@ -294,7 +172,6 @@ extern diagnostic_context *global_dc;
extern void diagnostic_initialize (diagnostic_context *);
extern void diagnostic_report_current_module (diagnostic_context *);
extern void diagnostic_report_current_function (diagnostic_context *);
-extern void diagnostic_flush_buffer (diagnostic_context *);
extern void diagnostic_report_diagnostic (diagnostic_context *,
diagnostic_info *);
extern void diagnostic_set_info (diagnostic_info *, const char *, va_list *,
@@ -302,27 +179,6 @@ extern void diagnostic_set_info (diagnostic_info *, const char *, va_list *,
extern char *diagnostic_build_prefix (diagnostic_info *);
/* Pure text formatting support functions. */
-extern void init_output_buffer (output_buffer *, const char *, int);
-extern void output_clear (output_buffer *);
-extern const char *output_last_position (const output_buffer *);
-extern void output_set_prefix (output_buffer *, const char *);
-extern void output_destroy_prefix (output_buffer *);
-extern void output_set_maximum_length (output_buffer *, int);
-extern void output_emit_prefix (output_buffer *);
-extern void output_add_newline (output_buffer *);
-extern void output_add_space (output_buffer *);
-extern int output_space_left (const output_buffer *);
-extern void output_append (output_buffer *, const char *, const char *);
-extern void output_add_character (output_buffer *, int);
-extern void output_decimal (output_buffer *, int);
-extern void output_host_wide_integer (output_buffer *, HOST_WIDE_INT);
-extern void output_add_string (output_buffer *, const char *);
-extern void output_add_identifier (output_buffer *, tree);
-extern const char *output_finalize_message (output_buffer *);
-extern void output_clear_message_text (output_buffer *);
-extern void output_printf (output_buffer *, const char *, ...)
- ATTRIBUTE_PRINTF_2;
-extern void output_verbatim (output_buffer *, const char *, ...);
extern void verbatim (const char *, ...);
extern char *file_name_as_prefix (const char *);
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi
index 48e7e120cb0..29ccaec317d 100644
--- a/gcc/doc/c-tree.texi
+++ b/gcc/doc/c-tree.texi
@@ -124,7 +124,7 @@ functions described here. In particular, no guarantee is given that the
values are lvalues.
In general, the names of macros are all in uppercase, while the names of
-functions are entirely in lower case. There are rare exceptions to this
+functions are entirely in lowercase. There are rare exceptions to this
rule. You should assume that any macro or function whose name is made
up entirely of uppercase letters may evaluate its arguments more than
once. You may assume that a macro or function whose name is made up
@@ -555,11 +555,9 @@ This node is used to represent a type the knowledge of which is
insufficient for a sound processing.
@item OFFSET_TYPE
-This node is used to represent a data member; for example a
-pointer-to-data-member is represented by a @code{POINTER_TYPE} whose
-@code{TREE_TYPE} is an @code{OFFSET_TYPE}. For a data member @code{X::m}
-the @code{TYPE_OFFSET_BASETYPE} is @code{X} and the @code{TREE_TYPE} is
-the type of @code{m}.
+This node is used to represent a pointer-to-data member. For a data
+member @code{X::m} the @code{TYPE_OFFSET_BASETYPE} is @code{X} and the
+@code{TREE_TYPE} is the type of @code{m}.
@item TYPENAME_TYPE
Used to represent a construct of the form @code{typename T::A}. The
@@ -1722,6 +1720,7 @@ This macro returns the attributes on the type @var{type}.
@findex PTRMEM_CST_MEMBER
@tindex VAR_DECL
@tindex NEGATE_EXPR
+@tindex ABS_EXPR
@tindex BIT_NOT_EXPR
@tindex TRUTH_NOT_EXPR
@tindex ADDR_EXPR
@@ -1917,6 +1916,20 @@ determined by looking at the type of the expression.
The behavior of this operation on signed arithmetic overflow is
controlled by the @code{flag_wrapv} and @code{flag_trapv} variables.
+@item ABS_EXPR
+These nodes represent the absolute value of the single operand, for
+both integer and floating-point types. This is typically used to
+implement the @code{abs}, @code{labs} and @code{llabs} builtins for
+integer types, and the @code{fabs}, @code{fabsf} and @code{fabsl}
+builtins for floating point types. The type of abs operation can
+be determined by looking at the type of the expression.
+
+This node is not used for complex types. To represent the modulus
+or complex abs of a complex value, use the @code{BUILT_IN_CABS},
+@code{BUILT_IN_CABSF} or @code{BUILT_IN_CABSL} builtins, as used
+to implement the C99 @code{cabs}, @code{cabsf} and @code{cabsl}
+built-in functions.
+
@item BIT_NOT_EXPR
These nodes represent bitwise complement, and will always have integral
type. The only operand is the value to be complemented.
diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi
index 52580bcfed3..6d6377b4b0d 100644
--- a/gcc/doc/contrib.texi
+++ b/gcc/doc/contrib.texi
@@ -36,6 +36,10 @@ port.
Alasdair Baird for various bug fixes.
@item
+Peter Barada for his work to improve code generation for new
+ColdFire cores.
+
+@item
Gerald Baumgartner added the signature extension to the C++ front end.
@item
@@ -168,6 +172,10 @@ Alex Crain provided changes for the 3b1.
Ian Dall for major improvements to the NS32k port.
@item
+Paul Dale for his work to add uClinux platform support to the
+m68k backend.
+
+@item
Dario Dariol contributed the four varieties of sample programs
that print a copy of their source.
@@ -331,6 +339,10 @@ Steve Holmgren for MachTen patches.
Jan Hubicka for his x86 port improvements.
@item
+Bernardo Innocenti for his m68k work, including merging of
+ColdFire improvements and uClinux support.
+
+@item
Christian Iseli for various bug fixes.
@item
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index c043b88b9ee..2db1ee1ff11 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -852,7 +852,7 @@ requested with @code{@w{#include <@var{file}>}} in:
@example
/usr/local/include
-/usr/lib/gcc-lib/@var{target}/@var{version}/include
+@var{libdir}/gcc/@var{target}/@var{version}/include
/usr/@var{target}/include
/usr/include
@end example
@@ -1206,7 +1206,7 @@ if you had written
foo = (char *) malloc (1024);
@end example
-By convention, macro names are written in upper case. Programs are
+By convention, macro names are written in uppercase. Programs are
easier to read when it is possible to tell at a glance which names are
macros.
@@ -4133,7 +4133,9 @@ without notice.
cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
[@option{-I}@var{dir}@dots{}] [@option{-W}@var{warn}@dots{}]
[@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}]
- [@option{-MP}] [@option{-MQ} @var{target}@dots{}] [@option{-MT} @var{target}@dots{}]
+ [@option{-MP}] [@option{-MQ} @var{target}@dots{}]
+ [@option{-MT} @var{target}@dots{}]
+ [@option{-P}] [@option{-fno-working-directory}]
[@option{-x} @var{language}] [@option{-std=}@var{standard}]
@var{infile} @var{outfile}
diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 8096763e6ed..4988227213d 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -1,4 +1,4 @@
-@c Copyright (c) 1999, 2000, 2001, 2002
+@c Copyright (c) 1999, 2000, 2001, 2002, 2003
@c Free Software Foundation, Inc.
@c This is part of the CPP and GCC manuals.
@c For copying conditions, see the file gcc.texi.
@@ -513,6 +513,22 @@ corresponds to the width of @code{wchar_t}. As with
by the system's @code{iconv} library routine; however, you will have
problems with encodings that do not fit exactly in @code{wchar_t}.
+@item -fworking-directory
+@opindex fworking-directory
+@opindex fno-working-directory
+Enable generation of linemarkers in the preprocessor output that will
+let the compiler know the current working directory at the time of
+preprocessing. When this option is enabled, the preprocessor will
+emit, after the initial linemarker, a second linemarker with the
+current working directory followed by two slashes. GCC will use this
+directory, when it's present in the preprocessed input, as the
+directory emitted as the current working directory in some debugging
+information formats. This option is implicitly enabled if debugging
+information is enabled, but this can be inhibited with the negated
+form @option{-fno-working-directory}. If the @option{-P} flag is
+present in the command line, this option has no effect, since no
+@code{#line} directives are emitted whatsoever.
+
@item -fno-show-column
@opindex fno-show-column
Do not print column numbers in diagnostics. This may be necessary if
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index b8fefede871..ce3171388b4 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -424,7 +424,7 @@ extensions, accepted by GCC in C89 mode and in C++.
@menu
* Statement Exprs:: Putting statements and declarations inside expressions.
-* Local Labels:: Labels local to a statement-expression.
+* Local Labels:: Labels local to a block.
* Labels as Values:: Getting pointers to labels, and computed gotos.
* Nested Functions:: As in Algol and Pascal, lexical scoping of functions.
* Constructing Calls:: Dispatching a call to another function.
@@ -539,32 +539,46 @@ the initial value of a static variable.
If you don't know the type of the operand, you can still do this, but you
must use @code{typeof} (@pxref{Typeof}).
-Statement expressions are not supported fully in G++, and their fate
-there is unclear. (It is possible that they will become fully supported
-at some point, or that they will be deprecated, or that the bugs that
-are present will continue to exist indefinitely.) Presently, statement
-expressions do not work well as default arguments.
+In G++, the result value of a statement expression undergoes array and
+function pointer decay, and is returned by value to the enclosing
+expression. For instance, if @code{A} is a class, then
-In addition, there are semantic issues with statement-expressions in
-C++. If you try to use statement-expressions instead of inline
-functions in C++, you may be surprised at the way object destruction is
-handled. For example:
+@smallexample
+ A a;
-@example
-#define foo(a) (@{int b = (a); b + 3; @})
-@end example
+ (@{a;@}).Foo ()
+@end smallexample
@noindent
-does not work the same way as:
+will construct a temporary @code{A} object to hold the result of the
+statement expression, and that will be used to invoke @code{Foo}.
+Therefore the @code{this} pointer observed by @code{Foo} will not be the
+address of @code{a}.
+
+Any temporaries created within a statement within a statement expression
+will be destroyed at the statement's end. This makes statement
+expressions inside macros slightly different from function calls. In
+the latter case temporaries introduced during argument evaluation will
+be destroyed at the end of the statement that includes the function
+call. In the statement expression case they will be destroyed during
+the statement expression. For instance,
-@example
-inline int foo(int a) @{ int b = a; return b + 3; @}
-@end example
+@smallexample
+#define macro(a) (@{__typeof__(a) b = (a); b + 3; @})
+template<typename T> T function(T a) @{ T b = a; return b + 3; @}
+
+void foo ()
+@{
+ macro (X ());
+ function (X ());
+@}
+@end smallexample
@noindent
-In particular, if the expression passed into @code{foo} involves the
-creation of temporaries, the destructors for those temporaries will be
-run earlier in the case of the macro than in the case of the function.
+will have different places where temporaries are destroyed. For the
+@code{macro} case, the temporary @code{X} will be destroyed just after
+the initialization of @code{b}. In the @code{function} case that
+temporary will be destroyed when the function returns.
These considerations mean that it is probably a bad idea to use
statement-expressions of this form in header files that are designed to
@@ -577,10 +591,10 @@ bug.)
@cindex local labels
@cindex macros, local labels
-Each statement expression is a scope in which @dfn{local labels} can be
-declared. A local label is simply an identifier; you can jump to it
-with an ordinary @code{goto} statement, but only from within the
-statement expression it belongs to.
+GCC allows you to declare @dfn{local labels} in any nested block
+scope. A local label is just like an ordinary label, but you can
+only reference it (with a @code{goto} statement, or by taking its
+address) within the block in which it was declared.
A local label declaration looks like this:
@@ -595,21 +609,38 @@ or
__label__ @var{label1}, @var{label2}, /* @r{@dots{}} */;
@end example
-Local label declarations must come at the beginning of the statement
-expression, right after the @samp{(@{}, before any ordinary
-declarations.
+Local label declarations must come at the beginning of the block,
+before any ordinary declarations or statements.
The label declaration defines the label @emph{name}, but does not define
the label itself. You must do this in the usual way, with
@code{@var{label}:}, within the statements of the statement expression.
-The local label feature is useful because statement expressions are
-often used in macros. If the macro contains nested loops, a @code{goto}
-can be useful for breaking out of them. However, an ordinary label
-whose scope is the whole function cannot be used: if the macro can be
-expanded several times in one function, the label will be multiply
-defined in that function. A local label avoids this problem. For
-example:
+The local label feature is useful for complex macros. If a macro
+contains nested loops, a @code{goto} can be useful for breaking out of
+them. However, an ordinary label whose scope is the whole function
+cannot be used: if the macro can be expanded several times in one
+function, the label will be multiply defined in that function. A
+local label avoids this problem. For example:
+
+@example
+#define SEARCH(value, array, target) \
+do @{ \
+ __label__ found; \
+ typeof (target) _SEARCH_target = (target); \
+ typeof (*(array)) *_SEARCH_array = (array); \
+ int i, j; \
+ int value; \
+ for (i = 0; i < max; i++) \
+ for (j = 0; j < max; j++) \
+ if (_SEARCH_array[i][j] == _SEARCH_target) \
+ @{ (value) = i; goto found; @} \
+ (value) = -1; \
+ found:; \
+@} while (0)
+@end example
+
+This could also be written using a statement-expression:
@example
#define SEARCH(array, target) \
@@ -629,6 +660,9 @@ example:
@})
@end example
+Local label declarations also make the labels they declare visible to
+nested functions, if there are any. @xref{Nested Functions}, for details.
+
@node Labels as Values
@section Labels as Values
@cindex labels as values
@@ -1037,9 +1071,9 @@ 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.
-Standard C++ allows compound expressions and conditional expressions as
-lvalues, and permits casts to reference type, so use of this extension
-is deprecated for C++ code.
+Standard C++ allows compound expressions and conditional expressions
+as lvalues, and permits casts to reference type, so use of this
+extension is not supported for C++ code.
For example, a compound expression can be assigned, provided the last
expression in the sequence is an lvalue. These two expressions are
@@ -1946,9 +1980,9 @@ attributes are currently defined for functions on all targets:
@code{format}, @code{format_arg}, @code{no_instrument_function},
@code{section}, @code{constructor}, @code{destructor}, @code{used},
@code{unused}, @code{deprecated}, @code{weak}, @code{malloc},
-@code{alias}, and @code{nonnull}. Several other attributes are defined
-for functions on particular target systems. Other attributes, including
-@code{section} are supported for variables declarations
+@code{alias}, @code{warn_unused_result} and @code{nonnull}. Several other
+attributes are defined for functions on particular target systems. Other
+attributes, including @code{section} are supported for variables declarations
(@pxref{Variable Attributes}) and for types (@pxref{Type Attributes}).
You may also specify attributes with @samp{__} preceding and following
@@ -2248,8 +2282,7 @@ These attributes are not currently implemented for Objective-C@.
@item unused
This attribute, attached to a function, means that the function is meant
to be possibly unused. GCC will not produce a warning for this
-function. GNU C++ does not currently support this attribute as
-definitions without parameters are valid in C++.
+function.
@cindex @code{used} attribute.
@item used
@@ -2279,6 +2312,26 @@ results in a warning on line 3 but not line 2.
The @code{deprecated} attribute can also be used for variables and
types (@pxref{Variable Attributes}, @pxref{Type Attributes}.)
+@item warn_unused_result
+@cindex @code{warn_unused_result} attribute
+The @code{warn_unused_result} attribute causes a warning to be emitted
+if a caller of the function with this attribute does not use its
+return value. This is useful for functions where not checking
+the result is either a security problem or always a bug, such as
+@code{realloc}.
+
+@smallexample
+int fn () __attribute__ ((warn_unused_result));
+int foo ()
+@{
+ if (fn () < 0) return -1;
+ fn ();
+ return 0;
+@}
+@end smallexample
+
+results in warning on line 5.
+
@item weak
@cindex @code{weak} attribute
The @code{weak} attribute causes the declaration to be emitted as a weak
@@ -2292,7 +2345,7 @@ and linker.
@cindex @code{malloc} attribute
The @code{malloc} attribute is used to tell the compiler that a function
may be treated as if it were the malloc function. The compiler assumes
-that calls to malloc result in a pointers that cannot alias anything.
+that calls to malloc result in pointers that cannot alias anything.
This will often improve optimization.
@item alias ("@var{target}")
@@ -2344,7 +2397,7 @@ by another module.
Internal visibility is like hidden visibility, but with additional
processor specific semantics. Unless otherwise specified by the psABI,
gcc defines internal visibility to mean that the function is @emph{never}
-called from another module. Note that hidden symbols, while then cannot
+called from another module. Note that hidden symbols, while they cannot
be referenced directly by other modules, can be referenced indirectly via
function pointers. By indicating that a symbol cannot be called from
outside the module, gcc may for instance omit the load of a PIC register
@@ -2403,12 +2456,12 @@ attribute causes the compiler not to do this. These attributes override
both the @option{-mlongcall} switch and the @code{#pragma longcall}
setting.
-@xref{RS/6000 and PowerPC Options}, for more information on when long
-calls are and are not necessary.
+@xref{RS/6000 and PowerPC Options}, for more information on whether long
+calls are necessary.
@item long_call/short_call
@cindex indirect calls on ARM
-This attribute allows to specify how to call a particular function on
+This attribute specifies how a particular function is called on
ARM@. Both attributes override the @option{-mlong-calls} (@pxref{ARM Options})
command line switch and @code{#pragma long_calls} settings. The
@code{long_call} attribute causes the compiler to always call the
@@ -2438,9 +2491,9 @@ interrupt handler when this attribute is present.
Note, interrupt handlers for the H8/300, H8/300H and SH processors can
be specified via the @code{interrupt_handler} attribute.
-Note, on the AVR interrupts will be enabled inside the function.
+Note, on the AVR, interrupts will be enabled inside the function.
-Note, for the ARM you can specify the kind of interrupt to be handled by
+Note, for the ARM, you can specify the kind of interrupt to be handled by
adding an optional parameter to the interrupt attribute like this:
@smallexample
@@ -2495,22 +2548,24 @@ slightly under 32kbytes of data.
@item signal
@cindex signal handler functions on the AVR processors
Use this attribute on the AVR to indicate that the specified
-function is an signal handler. The compiler will generate function
-entry and exit sequences suitable for use in an signal handler when this
-attribute is present. Interrupts will be disabled inside function.
+function is a signal handler. The compiler will generate function
+entry and exit sequences suitable for use in a signal handler when this
+attribute is present. Interrupts will be disabled inside the function.
@item naked
@cindex function without a prologue/epilogue code
Use this attribute on the ARM, AVR, C4x and IP2K ports to indicate that the
-specified function do not need prologue/epilogue sequences generated by
+specified function does not need prologue/epilogue sequences generated by
the compiler. It is up to the programmer to provide these sequences.
@item model (@var{model-name})
@cindex function addressability on the M32R/D
-Use this attribute on the M32R/D to set the addressability of an object,
-and the code generated for a function.
-The identifier @var{model-name} is one of @code{small}, @code{medium},
-or @code{large}, representing each of the code models.
+@cindex variable addressability on the IA-64
+
+On the M32R/D, use this attribute to set the addressability of an
+object, and of the code generated for a function. The identifier
+@var{model-name} is one of @code{small}, @code{medium}, or
+@code{large}, representing each of the code models.
Small model objects live in the lower 16MB of memory (so that their
addresses can be loaded with the @code{ld24} instruction), and are
@@ -2525,6 +2580,14 @@ compiler will generate @code{seth/add3} instructions to load their addresses),
and may not be reachable with the @code{bl} instruction (the compiler will
generate the much slower @code{seth/add3/jl} instruction sequence).
+On IA-64, use this attribute to set the addressability of an object.
+At present, the only supported identifier for @var{model-name} is
+@code{small}, indicating addressability via ``small'' (22-bit)
+addresses (so that their addresses can be loaded with the @code{addl}
+instruction). Caveat: such addressing is by definition not position
+independent and hence this attribute must not be used for objects
+defined by shared libraries.
+
@item far
@cindex functions which handle memory bank switching
On 68HC11 and 68HC12 the @code{far} attribute causes the compiler to
@@ -2705,14 +2768,18 @@ with the list being a single string constant.
An @dfn{attribute specifier list} is a sequence of one or more attribute
specifiers, not separated by any other tokens.
-An attribute specifier list may appear after the colon following a
+In GNU C, an attribute specifier list may appear after the colon following a
label, other than a @code{case} or @code{default} label. The only
attribute it makes sense to use after a label is @code{unused}. This
feature is intended for code generated by programs which contains labels
that may be unused but which is compiled with @option{-Wall}. It would
not normally be appropriate to use in it human-written code, though it
could be useful in cases where the code that jumps to the label is
-contained within an @code{#ifdef} conditional.
+contained within an @code{#ifdef} conditional. GNU C++ does not permit
+such placement of attribute lists, as it is permissible for a
+declaration, which could begin with an attribute list, to be labelled in
+C++. Declarations cannot be labelled in C90 or C99, so the ambiguity
+does not arise there.
An attribute specifier list may appear as part of a @code{struct},
@code{union} or @code{enum} specifier. It may go either immediately
@@ -2981,7 +3048,7 @@ This is true on many RISC machines. On more traditional machine
designs, @code{__alignof__ (double)} is 4 or even 2.
Some machines never actually require alignment; they allow reference to any
-data type even at an odd addresses. For these machines, @code{__alignof__}
+data type even at an odd address. For these machines, @code{__alignof__}
reports the @emph{recommended} alignment of a type.
If the operand of @code{__alignof__} is an lvalue rather than a type,
@@ -3118,7 +3185,7 @@ variables that are expected to be removed in a future version of a
program. The warning also includes the location of the declaration
of the deprecated variable, to enable users to easily find further
information about why the variable is deprecated, or what they should
-do instead. Note that the warnings only occurs for uses:
+do instead. Note that the warning only occurs for uses:
@smallexample
extern int old_var __attribute__ ((deprecated));
@@ -3453,9 +3520,10 @@ in an @code{__attribute__} will still only provide you with 8 byte
alignment. See your linker documentation for further information.
@item packed
-This attribute, attached to an @code{enum}, @code{struct}, or
-@code{union} type definition, specified that the minimum required memory
-be used to represent the type.
+This attribute, attached to @code{struct} or @code{union} type
+definition, specifies that each member of the structure or union is
+placed to minimize the memory required. When attached to an @code{enum}
+definition, it indicates that the smallest integral type should be used.
@opindex fshort-enums
Specifying this attribute for @code{struct} and @code{union} types is
@@ -3464,9 +3532,29 @@ structure or union members. Specifying the @option{-fshort-enums}
flag on the line is equivalent to specifying the @code{packed}
attribute on all @code{enum} definitions.
-You may only specify this attribute after a closing curly brace on an
-@code{enum} definition, not in a @code{typedef} declaration, unless that
-declaration also contains the definition of the @code{enum}.
+In the following example @code{struct my_packed_struct}'s members are
+packed closely together, but the internal layout of its @code{s} member
+is not packed -- to do that, @code{struct my_unpacked_struct} would need to
+be packed too.
+
+@smallexample
+struct my_unpacked_struct
+ @{
+ char c;
+ int i;
+ @};
+
+struct my_packed_struct __attribute__ ((__packed__))
+ @{
+ char c;
+ int i;
+ struct my_unpacked_struct s;
+ @};
+@end smallexample
+
+You may only specify this attribute on the definition of a @code{enum},
+@code{struct} or @code{union}, not on a @code{typedef} which does not
+also define the enumerated type, structure or union.
@item transparent_union
This attribute, attached to a @code{union} type definition, indicates
@@ -3483,7 +3571,7 @@ the referenced type must be respected, just as with normal pointer
conversions.
Second, the argument is passed to the function using the calling
-conventions of first member of the transparent union, not the calling
+conventions of the first member of the transparent union, not the calling
conventions of the union itself. All members of the union must have the
same machine representation; this is necessary for this argument passing
to work properly.
@@ -3715,8 +3803,9 @@ The definition in the header file will cause most calls to the function
to be inlined. If any uses of the function remain, they will refer to
the single copy in the library.
-For future compatibility with when GCC implements ISO C99 semantics for
-inline functions, it is best to use @code{static inline} only. (The
+Since GCC eventually will implement ISO C99 semantics for
+inline functions, it is best to use @code{static inline} only
+to guarentee compatibility. (The
existing semantics will remain available when @option{-std=gnu89} is
specified, but eventually the default will be @option{-std=gnu99} and
that will implement the C99 semantics, though it does not do so yet.)
@@ -3788,7 +3877,7 @@ asm ("fsinx %[angle],%[output]"
@noindent
Note that the symbolic operand names have no relation whatsoever to
other C identifiers. You may use any name you like, even those of
-existing C symbols, but must ensure that no two operands within the same
+existing C symbols, but you must ensure that no two operands within the same
assembler construct use the same symbolic name.
Output operand expressions must be lvalues; the compiler can check this.
@@ -4656,49 +4745,156 @@ v4si f (v4si a, v4si b, v4si c)
@findex __builtin_islessequal
@findex __builtin_islessgreater
@findex __builtin_isunordered
+@findex _Exit
+@findex _exit
@findex abort
@findex abs
+@findex acos
+@findex acosf
+@findex acosh
+@findex acoshf
+@findex acoshl
+@findex acosl
@findex alloca
+@findex asin
+@findex asinf
+@findex asinh
+@findex asinhf
+@findex asinhl
+@findex asinl
@findex atan
@findex atan2
@findex atan2f
@findex atan2l
@findex atanf
+@findex atanh
+@findex atanhf
+@findex atanhl
@findex atanl
@findex bcmp
@findex bzero
@findex cabs
@findex cabsf
@findex cabsl
+@findex cacos
+@findex cacosf
+@findex cacosh
+@findex cacoshf
+@findex cacoshl
+@findex cacosl
@findex calloc
+@findex carg
+@findex cargf
+@findex cargl
+@findex casin
+@findex casinf
+@findex casinh
+@findex casinhf
+@findex casinhl
+@findex casinl
+@findex catan
+@findex catanf
+@findex catanh
+@findex catanhf
+@findex catanhl
+@findex catanl
+@findex cbrt
+@findex cbrtf
+@findex cbrtl
+@findex ccos
+@findex ccosf
+@findex ccosh
+@findex ccoshf
+@findex ccoshl
+@findex ccosl
@findex ceil
@findex ceilf
@findex ceill
+@findex cexp
+@findex cexpf
+@findex cexpl
@findex cimag
@findex cimagf
@findex cimagl
@findex conj
@findex conjf
@findex conjl
+@findex copysign
+@findex copysignf
+@findex copysignl
@findex cos
@findex cosf
+@findex cosh
+@findex coshf
+@findex coshl
@findex cosl
+@findex cpow
+@findex cpowf
+@findex cpowl
+@findex cproj
+@findex cprojf
+@findex cprojl
@findex creal
@findex crealf
@findex creall
+@findex csin
+@findex csinf
+@findex csinh
+@findex csinhf
+@findex csinhl
+@findex csinl
+@findex csqrt
+@findex csqrtf
+@findex csqrtl
+@findex ctan
+@findex ctanf
+@findex ctanh
+@findex ctanhf
+@findex ctanhl
+@findex ctanl
+@findex dcgettext
+@findex dgettext
+@findex drem
+@findex dremf
+@findex dreml
+@findex erf
+@findex erfc
+@findex erfcf
+@findex erfcl
+@findex erff
+@findex erfl
@findex exit
-@findex _exit
-@findex _Exit
@findex exp
+@findex exp10
+@findex exp10f
+@findex exp10l
+@findex exp2
+@findex exp2f
+@findex exp2l
@findex expf
@findex expl
+@findex expm1
+@findex expm1f
+@findex expm1l
@findex fabs
@findex fabsf
@findex fabsl
+@findex fdim
+@findex fdimf
+@findex fdiml
@findex ffs
@findex floor
@findex floorf
@findex floorl
+@findex fma
+@findex fmaf
+@findex fmal
+@findex fmax
+@findex fmaxf
+@findex fmaxl
+@findex fmin
+@findex fminf
+@findex fminl
@findex fmod
@findex fmodf
@findex fmodl
@@ -4706,35 +4902,126 @@ v4si f (v4si a, v4si b, v4si c)
@findex fprintf_unlocked
@findex fputs
@findex fputs_unlocked
+@findex frexp
+@findex frexpf
+@findex frexpl
+@findex fscanf
+@findex gamma
+@findex gammaf
+@findex gammal
+@findex gettext
+@findex hypot
+@findex hypotf
+@findex hypotl
+@findex ilogb
+@findex ilogbf
+@findex ilogbl
@findex imaxabs
@findex index
+@findex j0
+@findex j0f
+@findex j0l
+@findex j1
+@findex j1f
+@findex j1l
+@findex jn
+@findex jnf
+@findex jnl
@findex labs
+@findex ldexp
+@findex ldexpf
+@findex ldexpl
+@findex lgamma
+@findex lgammaf
+@findex lgammal
@findex llabs
+@findex llrint
+@findex llrintf
+@findex llrintl
+@findex llround
+@findex llroundf
+@findex llroundl
@findex log
+@findex log10
+@findex log10f
+@findex log10l
+@findex log1p
+@findex log1pf
+@findex log1pl
+@findex log2
+@findex log2f
+@findex log2l
+@findex logb
+@findex logbf
+@findex logbl
@findex logf
@findex logl
+@findex lrint
+@findex lrintf
+@findex lrintl
+@findex lround
+@findex lroundf
+@findex lroundl
@findex malloc
@findex memcmp
@findex memcpy
@findex mempcpy
@findex memset
+@findex modf
+@findex modff
+@findex modfl
@findex nearbyint
@findex nearbyintf
@findex nearbyintl
+@findex nextafter
+@findex nextafterf
+@findex nextafterl
+@findex nexttoward
+@findex nexttowardf
+@findex nexttowardl
@findex pow
+@findex pow10
+@findex pow10f
+@findex pow10l
@findex powf
@findex powl
@findex printf
@findex printf_unlocked
@findex putchar
@findex puts
+@findex remainder
+@findex remainderf
+@findex remainderl
+@findex remquo
+@findex remquof
+@findex remquol
@findex rindex
+@findex rint
+@findex rintf
+@findex rintl
@findex round
@findex roundf
@findex roundl
-@findex scanf
+@findex scalb
+@findex scalbf
+@findex scalbl
+@findex scalbln
+@findex scalblnf
+@findex scalblnf
+@findex scalbn
+@findex scalbnf
+@findex scanfnl
+@findex significand
+@findex significandf
+@findex significandl
@findex sin
+@findex sincos
+@findex sincosf
+@findex sincosl
@findex sinf
+@findex sinh
+@findex sinhf
+@findex sinhl
@findex sinl
@findex snprintf
@findex sprintf
@@ -4749,6 +5036,8 @@ v4si f (v4si a, v4si b, v4si c)
@findex strcpy
@findex strcspn
@findex strdup
+@findex strfmon
+@findex strftime
@findex strlen
@findex strncat
@findex strncmp
@@ -4759,15 +5048,32 @@ v4si f (v4si a, v4si b, v4si c)
@findex strstr
@findex tan
@findex tanf
+@findex tanh
+@findex tanhf
+@findex tanhl
@findex tanl
+@findex tgamma
+@findex tgammaf
+@findex tgammal
@findex trunc
@findex truncf
@findex truncl
+@findex vfprintf
+@findex vfscanf
@findex vprintf
@findex vscanf
@findex vsnprintf
@findex vsprintf
@findex vsscanf
+@findex y0
+@findex y0f
+@findex y0l
+@findex y1
+@findex y1f
+@findex y1l
+@findex yn
+@findex ynf
+@findex ynl
GCC provides a large number of built-in functions other than the ones
mentioned above. Some of these are for internal use in the processing
@@ -4789,51 +5095,97 @@ be emitted.
@opindex ansi
@opindex std
Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or
-@option{-std=c99}), the functions @code{alloca}, @code{bcmp},
-@code{bzero}, @code{_exit}, @code{ffs}, @code{fprintf_unlocked},
-@code{fputs_unlocked}, @code{index}, @code{mempcpy}, @code{printf_unlocked},
-@code{rindex}, @code{stpcpy} and @code{strdup}
+@option{-std=c99}), the functions
+@code{_exit}, @code{alloca}, @code{bcmp}, @code{bzero},
+@code{dcgettext}, @code{dgettext}, @code{dremf}, @code{dreml},
+@code{drem}, @code{exp10f}, @code{exp10l}, @code{exp10}, @code{ffsll},
+@code{ffsl}, @code{ffs}, @code{fprintf_unlocked}, @code{fputs_unlocked},
+@code{gammaf}, @code{gammal}, @code{gamma}, @code{gettext},
+@code{index}, @code{j0f}, @code{j0l}, @code{j0}, @code{j1f}, @code{j1l},
+@code{j1}, @code{jnf}, @code{jnl}, @code{jn}, @code{mempcpy},
+@code{pow10f}, @code{pow10l}, @code{pow10}, @code{printf_unlocked},
+@code{rindex}, @code{scalbf}, @code{scalbl}, @code{scalb},
+@code{significandf}, @code{significandl}, @code{significand},
+@code{sincosf}, @code{sincosl}, @code{sincos}, @code{stpcpy},
+@code{strdup}, @code{strfmon}, @code{y0f}, @code{y0l}, @code{y0},
+@code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, @code{ynl} and @code{yn}
may be handled as built-in functions.
All these functions have corresponding versions
prefixed with @code{__builtin_}, which may be used even in strict C89
mode.
The ISO C99 functions
-@code{cabs}, @code{cabsf}, @code{cabsl},
-@code{conj}, @code{conjf}, @code{conjl},
-@code{creal}, @code{crealf}, @code{creall},
-@code{cimag}, @code{cimagf}, @code{cimagl},
-@code{_Exit}, @code{imaxabs}, @code{llabs},
-@code{nearbyint}, @code{nearbyintf}, @code{nearbyintl},
-@code{round}, @code{roundf}, @code{roundl}, @code{snprintf},
-@code{trunc}, @code{truncf}, @code{truncl},
-@code{vscanf}, @code{vsnprintf} and @code{vsscanf}
+@code{_Exit}, @code{acoshf}, @code{acoshl}, @code{acosh}, @code{asinhf},
+@code{asinhl}, @code{asinh}, @code{atanhf}, @code{atanhl}, @code{atanh},
+@code{cabsf}, @code{cabsl}, @code{cabs}, @code{cacosf}, @code{cacoshf},
+@code{cacoshl}, @code{cacosh}, @code{cacosl}, @code{cacos},
+@code{cargf}, @code{cargl}, @code{carg}, @code{casinf}, @code{casinhf},
+@code{casinhl}, @code{casinh}, @code{casinl}, @code{casin},
+@code{catanf}, @code{catanhf}, @code{catanhl}, @code{catanh},
+@code{catanl}, @code{catan}, @code{cbrtf}, @code{cbrtl}, @code{cbrt},
+@code{ccosf}, @code{ccoshf}, @code{ccoshl}, @code{ccosh}, @code{ccosl},
+@code{ccos}, @code{cexpf}, @code{cexpl}, @code{cexp}, @code{cimagf},
+@code{cimagl}, @code{cimag},
+@code{conjf}, @code{conjl}, @code{conj}, @code{copysignf},
+@code{copysignl}, @code{copysign}, @code{cpowf}, @code{cpowl},
+@code{cpow}, @code{cprojf}, @code{cprojl}, @code{cproj}, @code{crealf},
+@code{creall}, @code{creal}, @code{csinf}, @code{csinhf}, @code{csinhl},
+@code{csinh}, @code{csinl}, @code{csin}, @code{csqrtf}, @code{csqrtl},
+@code{csqrt}, @code{ctanf}, @code{ctanhf}, @code{ctanhl}, @code{ctanh},
+@code{ctanl}, @code{ctan}, @code{erfcf}, @code{erfcl}, @code{erfc},
+@code{erff}, @code{erfl}, @code{erf}, @code{exp2f}, @code{exp2l},
+@code{exp2}, @code{expm1f}, @code{expm1l}, @code{expm1}, @code{fdimf},
+@code{fdiml}, @code{fdim}, @code{fmaf}, @code{fmal}, @code{fmaxf},
+@code{fmaxl}, @code{fmax}, @code{fma}, @code{fminf}, @code{fminl},
+@code{fmin}, @code{hypotf}, @code{hypotl}, @code{hypot}, @code{ilogbf},
+@code{ilogbl}, @code{ilogb}, @code{imaxabs}, @code{lgammaf},
+@code{lgammal}, @code{lgamma}, @code{llabs}, @code{llrintf},
+@code{llrintl}, @code{llrint}, @code{llroundf}, @code{llroundl},
+@code{llround}, @code{log1pf}, @code{log1pl}, @code{log1p},
+@code{log2f}, @code{log2l}, @code{log2}, @code{logbf}, @code{logbl},
+@code{logb}, @code{lrintf}, @code{lrintl}, @code{lrint}, @code{lroundf},
+@code{lroundl}, @code{lround}, @code{nearbyintf}, @code{nearbyintl},
+@code{nearbyint}, @code{nextafterf}, @code{nextafterl},
+@code{nextafter}, @code{nexttowardf}, @code{nexttowardl},
+@code{nexttoward}, @code{remainderf}, @code{remainderl},
+@code{remainder}, @code{remquof}, @code{remquol}, @code{remquo},
+@code{rintf}, @code{rintl}, @code{rint}, @code{roundf}, @code{roundl},
+@code{round}, @code{scalblnf}, @code{scalblnl}, @code{scalbln},
+@code{scalbnf}, @code{scalbnl}, @code{scalbn}, @code{snprintf},
+@code{tgammaf}, @code{tgammal}, @code{tgamma}, @code{truncf},
+@code{truncl}, @code{trunc}, @code{vfscanf}, @code{vscanf},
+@code{vsnprintf} and @code{vsscanf}
are handled as built-in functions
except in strict ISO C90 mode (@option{-ansi} or @option{-std=c89}).
-There are also built-in versions of the ISO C99 functions @code{atan2f},
+There are also built-in versions of the ISO C99 functions
+@code{acosf}, @code{acosl}, @code{asinf}, @code{asinl}, @code{atan2f},
@code{atan2l}, @code{atanf}, @code{atanl}, @code{ceilf}, @code{ceill},
-@code{cosf}, @code{cosl},
-@code{expf}, @code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf},
-@code{floorl}, @code{fmodf}, @code{fmodl},
-@code{logf}, @code{logl}, @code{powf}, @code{powl},
-@code{sinf}, @code{sinl}, @code{sqrtf}, @code{sqrtl},
-@code{tanf} and @code{tanl}
+@code{cosf}, @code{coshf}, @code{coshl}, @code{cosl}, @code{expf},
+@code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf}, @code{floorl},
+@code{fmodf}, @code{fmodl}, @code{frexpf}, @code{frexpl}, @code{ldexpf},
+@code{ldexpl}, @code{log10f}, @code{log10l}, @code{logf}, @code{logl},
+@code{modfl}, @code{modf}, @code{powf}, @code{powl}, @code{sinf},
+@code{sinhf}, @code{sinhl}, @code{sinl}, @code{sqrtf}, @code{sqrtl},
+@code{tanf}, @code{tanhf}, @code{tanhl} and @code{tanl}
that are recognized in any mode since ISO C90 reserves these names for
the purpose to which ISO C99 puts them. All these functions have
corresponding versions prefixed with @code{__builtin_}.
-The ISO C90 functions @code{abort}, @code{abs}, @code{atan}, @code{atan2},
-@code{calloc}, @code{ceil}, @code{cos}, @code{exit},
-@code{exp}, @code{fabs}, @code{floor}, @code{fmod},
-@code{fprintf}, @code{fputs}, @code{labs}, @code{log}, @code{malloc},
-@code{memcmp}, @code{memcpy}, @code{memset}, @code{pow}, @code{printf},
-@code{putchar}, @code{puts}, @code{scanf}, @code{sin}, @code{snprintf},
-@code{sprintf}, @code{sqrt}, @code{sscanf},
-@code{strcat}, @code{strchr}, @code{strcmp},
-@code{strcpy}, @code{strcspn}, @code{strlen}, @code{strncat}, @code{strncmp},
-@code{strncpy}, @code{strpbrk}, @code{strrchr}, @code{strspn}, @code{strstr},
-@code{tan}, @code{vprintf} and @code{vsprintf}
+The ISO C90 functions
+@code{abort}, @code{abs}, @code{acos}, @code{asin}, @code{atan2},
+@code{atan}, @code{calloc}, @code{ceil}, @code{cosh}, @code{cos},
+@code{exit}, @code{exp}, @code{fabs}, @code{floor}, @code{fmod},
+@code{fprintf}, @code{fputs}, @code{frexp}, @code{fscanf}, @code{labs},
+@code{ldexp}, @code{log10}, @code{log}, @code{malloc}, @code{memcmp},
+@code{memcpy}, @code{memset}, @code{modf}, @code{pow}, @code{printf},
+@code{putchar}, @code{puts}, @code{scanf}, @code{sinh}, @code{sin},
+@code{snprintf}, @code{sprintf}, @code{sqrt}, @code{sscanf},
+@code{strcat}, @code{strchr}, @code{strcmp}, @code{strcpy},
+@code{strcspn}, @code{strlen}, @code{strncat}, @code{strncmp},
+@code{strncpy}, @code{strpbrk}, @code{strrchr}, @code{strspn},
+@code{strstr}, @code{tanh}, @code{tan}, @code{vfprintf}, @code{vprintf}
+and @code{vsprintf}
are all recognized as built-in functions unless
@option{-fno-builtin} is specified (or @option{-fno-builtin-@var{function}}
is specified for an individual function). All of these functions have
@@ -7266,7 +7618,7 @@ Predefined Macros,cpp.info,The C Preprocessor}).
method denoted by a @samp{->*} or @samp{.*} expression.
* C++ Attributes:: Variable, function, and type attributes for C++ only.
* Java Exceptions:: Tweaking exception handling to work with Java.
-* Deprecated Features:: Things might disappear from g++.
+* Deprecated Features:: Things will disappear from g++.
* Backwards Compatibility:: Compatibilities with earlier definitions of C++.
@end menu
@@ -7939,10 +8291,12 @@ and is now removed from g++.
Floating and complex non-type template parameters have been deprecated,
and are now removed from g++.
-The implicit typename extension has been deprecated and will be removed
-from g++ at some point. In some cases g++ determines that a dependent
-type such as @code{TPL<T>::X} is a type without needing a
-@code{typename} keyword, contrary to the standard.
+The implicit typename extension has been deprecated and is now
+removed from g++.
+
+The use of default arguments in function pointers, function typedefs and
+and other places where they are not permitted by the standard is
+deprecated and will be removed from a future version of g++.
@node Backwards Compatibility
@section Backwards Compatibility
diff --git a/gcc/doc/fragments.texi b/gcc/doc/fragments.texi
index c9ebcf9145d..160ffed15b9 100644
--- a/gcc/doc/fragments.texi
+++ b/gcc/doc/fragments.texi
@@ -13,7 +13,8 @@ construct the file @file{Makefile} from the template file
fragments from the @file{config} directory. These are used to set
Makefile parameters that are not amenable to being calculated by
autoconf. The list of fragments to incorporate is set by
-@file{config.gcc}; @xref{System Config}.
+@file{config.gcc} (and occasionally @file{config.build}
+and @file{config.host}); @xref{System Config}.
Fragments are named either @file{t-@var{target}} or @file{x-@var{host}},
depending on whether they are relevant to configuring GCC to produce
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 5995e31cfc5..731a37a871f 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -176,7 +176,9 @@ Create long file names for included source files. For example, if the
header file @file{x.h} contains code, and was included in the file
@file{a.c}, then running @command{gcov} on the file @file{a.c} will produce
an output file called @file{a.c##x.h.gcov} instead of @file{x.h.gcov}.
-This can be useful if @file{x.h} is included in multiple source files.
+This can be useful if @file{x.h} is included in multiple source
+files. If you uses the @samp{-p} option, both the including and
+included file names will be complete path names.
@item -p
@itemx --preserve-paths
@@ -195,8 +197,8 @@ Output summaries for each function in addition to the file level summary.
@itemx --object-directory @var{directory}
@itemx --object-file @var{file}
Specify either the directory containing the gcov data files, or the
-object path name. The @file{.bb}, @file{.bbg}, and
-@file{.da} data files are searched for using this option. If a directory
+object path name. The @file{.gcno}, and
+@file{.gcda} data files are searched for using this option. If a directory
is specified, the data files are in that directory and named after the
source file name, without its extension. If a file is specified here,
the data files are named after that file, without its extension. If this
@@ -215,9 +217,13 @@ the source files. @command{gcov} produces files called
@file{@var{mangledname}.gcov} in the current directory. These contain
the coverage information of the source file they correspond to.
One @file{.gcov} file is produced for each source file containing code,
-which was compiled to produce the data files. The @file{.gcov} files
-contain the ':' separated fields along with program source code. The
-format is
+which was compiled to produce the data files. The @var{mangledname} part
+of the output file name is usually simply the source file name, but can
+be something more complicated if the @samp{-l} or @samp{-p} options are
+given. Refer to those options for details.
+
+The @file{.gcov} files contain the ':' separated fields along with
+program source code. The format is
@smallexample
@var{execution_count}:@var{line_number}:@var{source line text}
@@ -264,8 +270,8 @@ Here is a sample:
@smallexample
-: 0:Source:tmp.c
- -: 0:Graph:tmp.bbg
- -: 0:Data:tmp.da
+ -: 0:Graph:tmp.gcno
+ -: 0:Data:tmp.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:#include <stdio.h>
@@ -293,8 +299,8 @@ counts, and the output looks like this:
@smallexample
-: 0:Source:tmp.c
- -: 0:Graph:tmp.bbg
- -: 0:Data:tmp.da
+ -: 0:Graph:tmp.gcno
+ -: 0:Data:tmp.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:#include <stdio.h>
@@ -353,8 +359,8 @@ Here is a sample of a resulting @file{tmp.c.gcov} file:
@smallexample
-: 0:Source:tmp.c
- -: 0:Graph:tmp.bbg
- -: 0:Data:tmp.da
+ -: 0:Graph:tmp.gcno
+ -: 0:Data:tmp.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:#include <stdio.h>
@@ -464,18 +470,18 @@ many times the result was 1.
@command{gcov} uses two files for profiling. The names of these files
are derived from the original @emph{object} file by substituting the
-file suffix with either @file{.bbg}, or @file{.da}. All of these files
+file suffix with either @file{.gcno}, or @file{.gcda}. All of these files
are placed in the same directory as the object file, and contain data
stored in a platform-independent format.
-The @file{.bbg} files is generated when the source file is compiled with
+The @file{.gcno} file is generated when the source file is compiled with
the GCC @option{-ftest-coverage} option. It contains information to
reconstruct the basic block graphs and assign source line numbers to
blocks.
-The @file{.da} file is generated when a program containing object files
+The @file{.gcda} file is generated when a program containing object files
built with the GCC @option{-fprofile-arcs} option is executed. A
-separate @file{.da} file is created for each object file compiled with
+separate @file{.gcda} file is created for each object file compiled with
this option. It contains arc transition counts, and some summary
information.
diff --git a/gcc/doc/hostconfig.texi b/gcc/doc/hostconfig.texi
index 626a893c167..5c38313efd2 100644
--- a/gcc/doc/hostconfig.texi
+++ b/gcc/doc/hostconfig.texi
@@ -42,6 +42,39 @@ This host hook is used to set up handling for extra signals. The most
common thing to do in this hook is to detect stack overflow.
@end deftypefn
+@deftypefn {Host Hook} void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t @var{size})
+This host hook returns the address of some space in which a PCH may be
+loaded with @samp{HOST_HOOKS_PCH_LOAD_PCH}. The space will need to
+have @var{size} bytes. If insufficient space is available,
+@samp{NULL} may be returned; the PCH machinery will try to find a
+suitable address using a heuristic.
+
+The memory does not have to be available now. In fact, usually
+@samp{HOST_HOOKS_PCH_LOAD_PCH} will already have been called. The memory
+need only be available in future invocations of GCC.
+@end deftypefn
+
+@deftypefn {Host Hook} bool HOST_HOOKS_GT_PCH_USE_ADDRESS (size_t @var{size}, void * @var{address})
+This host hook is called when a PCH file is about to be loaded. If
+@var{address} is the address that would have been returned by
+@samp{HOST_HOOKS_PCH_MEMORY_ADDRESS}, and @var{size} is smaller than
+the maximum than @samp{HOST_HOOKS_PCH_MEMORY_ADDRESS} would have
+accepted, return true, otherwise return false.
+
+In addition, free any address space reserved that isn't needed to hold
+@var{size} bytes (whether or not true is returned). The PCH machinery will
+use @samp{mmap} with @samp{MAP_FIXED} to load the PCH if @samp{HAVE_MMAP_FILE},
+or will use @samp{fread} otherwise.
+
+If no PCH will be loaded, this hook may be called with @var{size}
+zero, in which case all reserved address space should be freed.
+
+Do not try to handle values of @var{address} that could not have been
+returned by this executable; just return false. Such values usually
+indicate an out-of-date PCH file (built by some other GCC executable),
+and such a PCH file won't work.
+@end deftypefn
+
@node Filesystem
@section Host Filesystem
@cindex configuration file
diff --git a/gcc/doc/include/texinfo.tex b/gcc/doc/include/texinfo.tex
index a8541dca605..e9293f3b9d5 100644
--- a/gcc/doc/include/texinfo.tex
+++ b/gcc/doc/include/texinfo.tex
@@ -3,10 +3,10 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2002-12-26.16}
+\def\texinfoversion{2003-05-04.08}
%
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@@ -34,12 +34,12 @@
% ftp://tug.org/tex/texinfo.tex
% (and all CTAN mirrors, see http://www.ctan.org),
% and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-%
+%
% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
-%
+%
% The texinfo.tex in any given Texinfo distribution could well be out
% of date, so if that's what you're using, please check.
-%
+%
% Send bug reports to bug-texinfo@gnu.org. Please include including a
% complete document in each bug report with which we can reproduce the
% problem. Patches are, of course, greatly appreciated.
@@ -56,8 +56,9 @@
% Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary.
%
-% It is possible to adapt texinfo.tex for other languages. You can get
-% the existing language-specific files from the full Texinfo distribution.
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
\message{Loading texinfo [version \texinfoversion]:}
@@ -70,11 +71,11 @@
\message{Basics,}
\chardef\other=12
-% We never want plain's outer \+ definition in Texinfo.
+% We never want plain's \outer definition of \+ in Texinfo.
% For @tex, we can use \tabalign.
\let\+ = \relax
-% Save some parts of plain tex whose names we will redefine.
+% Save some plain tex macros whose names we will redefine.
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexc=\c
@@ -87,10 +88,12 @@
\let\ptexgtr=>
\let\ptexhat=^
\let\ptexi=\i
+\let\ptexindent=\indent
\let\ptexlbrace=\{
\let\ptexless=<
\let\ptexplus=+
\let\ptexrbrace=\}
+\let\ptexslash=\/
\let\ptexstar=\*
\let\ptext=\t
@@ -140,6 +143,18 @@
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
+% In some macros, we cannot use the `\? notation---the left quote is
+% in some cases the escape char.
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dotChar = `\.
+\chardef\equalChar = `\=
+\chardef\exclamChar= `\!
+\chardef\questChar = `\?
+\chardef\semiChar = `\;
+\chardef\spaceChar = `\ %
+\chardef\underChar = `\_
+
% Ignore a token.
%
\def\gobble#1{}
@@ -151,8 +166,9 @@
% Hyphenation fixes.
\hyphenation{ap-pen-dix}
-\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{time-stamp}
\hyphenation{white-space}
% Margin to add to right of even pages, to left of odd pages.
@@ -189,7 +205,7 @@
% add check for \lastpenalty to plain's definitions. If the last thing
% we did was a \nobreak, we don't want to insert more space.
-%
+%
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
\removelastskip\penalty-50\smallskip\fi\fi}
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
@@ -290,7 +306,7 @@
\egroup % \vbox from first cropmarks clause
\fi
}% end of \shipout\vbox
- }% end of group with \turnoffactive
+ }% end of group with \normalturnoffactive
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
@@ -469,16 +485,19 @@
\let\{=\mylbrace
\let\}=\myrbrace
\begingroup
- % Definitions to produce actual \{ & \} command in an index.
- \catcode`\{ = 12 \catcode`\} = 12
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux file.
+ \catcode`\{ = \other \catcode`\} = \other
\catcode`\[ = 1 \catcode`\] = 2
- \catcode`\@ = 0 \catcode`\\ = 12
- @gdef@lbracecmd[\{]%
- @gdef@rbracecmd[\}]%
-@endgroup
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \c
\let\dotaccent = \.
\def\ringaccent#1{{\accent23 #1}}
@@ -487,7 +506,7 @@
\let\udotaccent = \d
% Other special characters: @questiondown @exclamdown
-% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\exclamdown{!`}
@@ -520,6 +539,9 @@
% @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces}
+% @/ allows a line break.
+\let\/=\allowbreak
+
% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }
@@ -542,6 +564,16 @@
% therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad.
%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
\def\group{\begingroup
\ifnum\catcode13=\active \else
\errhelp = \groupinvalidhelp
@@ -555,10 +587,22 @@
% above. But it's pretty close.
\def\Egroup{%
\egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \copy\groupbox
\endgroup % End the \group.
}%
%
- \vtop\bgroup
+ \setbox\groupbox = \vtop\bgroup
% We have to put a strut on the last line in case the @group is in
% the midst of an example, rather than completely enclosing it.
% Otherwise, the interline space between the last line of the group
@@ -683,8 +727,7 @@ where each line of input produces a line of output.}
\spacefactor=3000
}
-
-% @page forces the start of a new page
+% @page forces the start of a new page.
%
\def\page{\par\vfill\supereject}
@@ -733,10 +776,10 @@ where each line of input produces a line of output.}
% @inmargin{TEXT [, RIGHT-TEXT]}
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
% else use TEXT for both).
-%
+%
\def\inmargin#1{\parseinmargin #1,,\finish}
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
- \setbox0 = \hbox{\ignorespaces #2}%
+ \setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\def\lefttext{#1}% have both texts
\def\righttext{#2}%
@@ -756,30 +799,36 @@ where each line of input produces a line of output.}
% @include file insert text of that file as input.
% Allow normal characters that we make active in the argument (a file name).
\def\include{\begingroup
- \catcode`\\=12
- \catcode`~=12
- \catcode`^=12
- \catcode`_=12
- \catcode`|=12
- \catcode`<=12
- \catcode`>=12
- \catcode`+=12
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
\parsearg\includezzz}
% Restore active chars for included file.
\def\includezzz#1{\endgroup\begingroup
% Read the included file in a group so nested @include's work.
\def\thisfile{#1}%
+ \let\value=\expandablevalue
\input\thisfile
\endgroup}
\def\thisfile{}
-% @center line outputs that line, centered
-
-\def\center{\parsearg\centerzzz}
-\def\centerzzz #1{{\advance\hsize by -\leftskip
-\advance\hsize by -\rightskip
-\centerline{#1}}}
+% @center line
+% outputs that line, centered.
+%
+\def\center{\parsearg\docenter}
+\def\docenter#1{{%
+ \ifhmode \hfil\break \fi
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{\hfil \ignorespaces#1\unskip \hfil}%
+ \ifhmode \break \fi
+}}
% @sp n outputs n lines of vertical space
@@ -799,8 +848,9 @@ where each line of input produces a line of output.}
% @paragraphindent NCHARS
% We'll use ems for NCHARS, close enough.
-% We cannot implement @paragraphindent asis, though.
-%
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
\def\asisword{asis} % no translation, these are keywords
\def\noneword{none}
%
@@ -835,6 +885,53 @@ where each line of input produces a line of output.}
\fi
}
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indentat such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do. We
+% switch the definition of this back and forth according to WORD. By
+% default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\newdimen\currentparindent
+%
+\def\insertword{insert}
+%
+\def\firstparagraphindent{\parsearg\dofirstparagraphindent}
+\def\dofirstparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \global\let\indent=\ptexindent
+ \global\everypar = {}%
+ }%
+ \global\everypar = {%
+ \kern-\parindent
+ \global\let\indent=\ptexindent
+ \global\everypar = {}%
+ }%
+}%
+
+
% @asis just yields its argument. Used with @table, for example.
%
\def\asis#1{#1}
@@ -843,17 +940,17 @@ where each line of input produces a line of output.}
% We don't use $'s directly in the definition of \math because we need
% to set catcodes according to plain TeX first, to allow for subscripts,
% superscripts, special math chars, etc.
-%
+%
\let\implicitmath = $%$ font-lock fix
%
% One complication: _ usually means subscripts, but it could also mean
% an actual _ character, as in @math{@var{some_variable} + 1}. So make
% _ within @math be active (mathcode "8000), and distinguish by seeing
% if the current family is \slfam, which is what @var uses.
-%
-{\catcode95 = \active % 95 = _
+%
+{\catcode\underChar = \active
\gdef\mathunderscore{%
- \catcode95=\active
+ \catcode\underChar=\active
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
}}
%
@@ -861,7 +958,7 @@ where each line of input produces a line of output.}
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
% this is not advertised and we don't care. Texinfo does not
% otherwise define @\.
-%
+%
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
%
@@ -876,7 +973,7 @@ where each line of input produces a line of output.}
% Some active characters (such as <) are spaced differently in math.
% We have to reset their definitions in case the @math was an
% argument to a command which set the catcodes (such as @item or @section).
-%
+%
{
\catcode`^ = \active
\catcode`< = \active
@@ -1002,8 +1099,8 @@ where each line of input produces a line of output.}
\def\pdfmakeoutlines{{%
\openin 1 \jobname.toc
\ifeof 1\else\begingroup
- \closein 1
- % Thanh's hack / proper braces in bookmarks
+ \closein 1
+ % Thanh's hack / proper braces in bookmarks
\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
%
@@ -1032,7 +1129,7 @@ where each line of input produces a line of output.}
\let\unnumbsubsubsecentry = \subsubsecentry
%
% Make special characters normal for writing to the pdf file.
- %
+ %
\indexnofonts
\let\tt=\relax
\turnoffactive
@@ -1047,7 +1144,7 @@ where each line of input produces a line of output.}
\let\nextmakelinks=\makelinks
\ifnum\lnkcount>0,\fi
\picknum{#1}%
- \startlink attr{/Border [0 0 0]}
+ \startlink attr{/Border [0 0 0]}
goto name{\pdfmkpgn{\the\pgn}}%
\linkcolor #1%
\advance\lnkcount by 1%
@@ -1102,7 +1199,7 @@ where each line of input produces a line of output.}
\ifx\first0\adn0
\else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
\else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
- \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
\else
\ifnum0=\countA\else\makelink\fi
\ifx\first.\let\next=\done\else
@@ -1193,9 +1290,10 @@ where each line of input produces a line of output.}
\setfont\textrm\rmshape{10}{\mainmagstep}
\setfont\texttt\ttshape{10}{\mainmagstep}
\fi
-% Instead of cmb10, you many want to use cmbx10.
+% Instead of cmb10, you may want to use cmbx10.
% cmbx10 is a prettier font on its own, but cmb10
-% looks better when embedded in a line with cmr10.
+% looks better when embedded in a line with cmr10
+% (in Bob's opinion).
\setfont\textbf\bfshape{10}{\mainmagstep}
\setfont\textit\itshape{10}{\mainmagstep}
\setfont\textsl\slshape{10}{\mainmagstep}
@@ -1344,7 +1442,25 @@ where each line of input produces a line of output.}
\let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
\let\tenttsl=\smallerttsl
\resetmathfonts \setleading{9.5pt}}
-\let\smallexamplefonts = \smallerfonts
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \smallerfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+%
+% I wish we used A4 paper on this side of the Atlantic.
+%
+% --karl, 24jan03.
+
% Set up the default fonts, so we can use them for creating boxes.
%
@@ -1368,7 +1484,8 @@ where each line of input produces a line of output.}
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
+ \ptexslash\fi\fi\fi}
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
@@ -1388,6 +1505,17 @@ where each line of input produces a line of output.}
\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
\def\restorehyphenation{\hyphenchar\font = `- }
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\frenchspacing{%
+ \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+ \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+ }
+\catcode`@=\other
+
\def\t#1{%
{\tt \rawbackslash \frenchspacing #1}%
\null
@@ -1487,15 +1615,17 @@ where each line of input produces a line of output.}
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\arg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle option `\arg'}%
\fi\fi\fi
}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordcode{code}
-% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
-% the catcodes are wrong for parsearg to work.)
-\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+% Default is `distinct.'
+\kbdinputstyle distinct
\def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
@@ -1538,7 +1668,7 @@ where each line of input produces a line of output.}
% rms does not like angle brackets --karl, 17may97.
% So now @email is just like @uref, unless we are pdf.
-%
+%
%\def\email#1{\angleleft{\tt #1}\angleright}
\ifpdf
\def\email#1{\doemail#1,,\finish}
@@ -1583,6 +1713,16 @@ where each line of input produces a line of output.}
% @pounds{} is a sterling sign.
\def\pounds{{\it\$}}
+% @registeredsymbol - R in a circle. For now, only works in text size;
+% we'd have to redo the font mechanism to change the \scriptstyle and
+% \scriptscriptstyle font sizes to make it look right in headings.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}%
+ }$%
+}
+
\message{page headings,}
@@ -1995,23 +2135,21 @@ where each line of input produces a line of output.}
\itemizey {#1}{\Eitemize}
}
-\def\itemizey #1#2{%
-\aboveenvbreak %
-\itemmax=\itemindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \itemindent %
-\exdentamount=\itemindent
-\parindent = 0pt %
-\parskip = \smallskipamount %
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def#2{\endgraf\afterenvbreak\endgroup}%
-\def\itemcontents{#1}%
-\let\item=\itemizeitem}
-
-% Set sfcode to normal for the chars that usually have another value.
-% These are `.?!:;,'
-\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
- \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+\def\itemizey#1#2{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ \def#2{\endgraf\afterenvbreak\endgroup}%
+ \def\itemcontents{#1}%
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ \let\item=\itemizeitem
+}
% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
@@ -2234,8 +2372,8 @@ where each line of input produces a line of output.}
\let\go\pickupwholefraction
\else
\global\advance\colcount by 1
- \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
- % typically that is always in the input, anyway.
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
\expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
\fi
\fi
@@ -2250,18 +2388,18 @@ where each line of input produces a line of output.}
\go
}
-% This used to have \hskip1sp. But then the space in a template line is
-% not enough. That is bad. So let's go back to just & until we
-% encounter the problem it was intended to solve again.
-% --karl, nathan@acm.org, 20apr99.
-\def\tab{&}
-
% @multitable ... @end multitable definitions:
%
\def\multitable{\parsearg\dotable}
\def\dotable#1{\bgroup
\vskip\parskip
- \let\item\crcr
+ \let\item=\crcrwithfootnotes
+ % A \tab used to include \hskip1sp. But then the space in a template
+ % line is not enough. That is bad. So let's go back to just & until
+ % we encounter the problem it was intended to solve again. --karl,
+ % nathan@acm.org, 20apr99.
+ \let\tab=&%
+ \let\startfootins=\startsavedfootnote
\tolerance=9500
\hbadness=9500
\setmultitablespacing
@@ -2269,7 +2407,11 @@ where each line of input produces a line of output.}
\parindent=\multitableparindent
\overfullrule=0pt
\global\colcount=0
- \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ \def\Emultitable{%
+ \global\setpercentfalse
+ \crcrwithfootnotes\crcr
+ \egroup\egroup
+ }%
%
% To parse everything between @multitable and @item:
\setuptable#1 \endsetuptable
@@ -2358,6 +2500,25 @@ width0pt\relax} \fi
%% than skip between lines in the table.
\fi}
+% In case a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is
+% finished. Otherwise, the insertion is lost, it never migrates to the
+% main vertical list. --kasal, 22jan03.
+%
+\newbox\savedfootnotes
+%
+% \dotable \let's \startfootins to this, so that \dofootnote will call
+% it instead of starting the insertion right away.
+\def\startsavedfootnote{%
+ \global\setbox\savedfootnotes = \vbox\bgroup
+ \unvbox\savedfootnotes
+}
+\def\crcrwithfootnotes{%
+ \crcr
+ \ifvoid\savedfootnotes \else
+ \noalign{\insert\footins{\box\savedfootnotes}}%
+ \fi
+}
\message{conditionals,}
% Prevent errors for section commands.
@@ -2393,50 +2554,101 @@ width0pt\relax} \fi
% and so want to turn off most commands, in case they are used
% incorrectly.
%
+% We use \empty instead of \relax for the @def... commands, so that \end
+% doesn't throw an error. For instance:
+% @ignore
+% @deffn ...
+% @end deffn
+% @end ignore
+%
+% The @end deffn is going to get expanded, because we're trying to allow
+% nested conditionals. But we don't want to expand the actual @deffn,
+% since it might be syntactically correct and intended to be ignored.
+% Since \end checks for \relax, using \empty does not cause an error.
+%
\def\ignoremorecommands{%
\let\defcodeindex = \relax
- \let\defcv = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
+ \let\defcv = \empty
+ \let\defcvx = \empty
+ \let\Edefcv = \empty
+ \let\deffn = \empty
+ \let\deffnx = \empty
+ \let\Edeffn = \empty
\let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypeivar = \relax
- \let\deftypeop = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\everyheading = \relax
+ \let\defivar = \empty
+ \let\defivarx = \empty
+ \let\Edefivar = \empty
+ \let\defmac = \empty
+ \let\defmacx = \empty
+ \let\Edefmac = \empty
+ \let\defmethod = \empty
+ \let\defmethodx = \empty
+ \let\Edefmethod = \empty
+ \let\defop = \empty
+ \let\defopx = \empty
+ \let\Edefop = \empty
+ \let\defopt = \empty
+ \let\defoptx = \empty
+ \let\Edefopt = \empty
+ \let\defspec = \empty
+ \let\defspecx = \empty
+ \let\Edefspec = \empty
+ \let\deftp = \empty
+ \let\deftpx = \empty
+ \let\Edeftp = \empty
+ \let\deftypefn = \empty
+ \let\deftypefnx = \empty
+ \let\Edeftypefn = \empty
+ \let\deftypefun = \empty
+ \let\deftypefunx = \empty
+ \let\Edeftypefun = \empty
+ \let\deftypeivar = \empty
+ \let\deftypeivarx = \empty
+ \let\Edeftypeivar = \empty
+ \let\deftypemethod = \empty
+ \let\deftypemethodx = \empty
+ \let\Edeftypemethod = \empty
+ \let\deftypeop = \empty
+ \let\deftypeopx = \empty
+ \let\Edeftypeop = \empty
+ \let\deftypevar = \empty
+ \let\deftypevarx = \empty
+ \let\Edeftypevar = \empty
+ \let\deftypevr = \empty
+ \let\deftypevrx = \empty
+ \let\Edeftypevr = \empty
+ \let\defun = \empty
+ \let\defunx = \empty
+ \let\Edefun = \empty
+ \let\defvar = \empty
+ \let\defvarx = \empty
+ \let\Edefvar = \empty
+ \let\defvr = \empty
+ \let\defvrx = \empty
+ \let\Edefvr = \empty
+ \let\clear = \relax
+ \let\down = \relax
+ \let\evenfooting = \relax
\let\evenheading = \relax
- \let\oddheading = \relax
\let\everyfooting = \relax
- \let\evenfooting = \relax
- \let\oddfooting = \relax
+ \let\everyheading = \relax
\let\headings = \relax
\let\include = \relax
+ \let\item = \relax
\let\lowersections = \relax
- \let\down = \relax
+ \let\oddfooting = \relax
+ \let\oddheading = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
\let\raisesections = \relax
- \let\up = \relax
+ \let\ref = \relax
\let\set = \relax
- \let\clear = \relax
- \let\item = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\settitle = \relax
+ \let\up = \relax
+ \let\verbatiminclude = \relax
+ \let\xref = \relax
}
% Ignore @ignore, @ifhtml, @ifinfo, and the like.
@@ -2470,7 +2682,7 @@ width0pt\relax} \fi
\long\def\doignoretext##1@end #1{\enddoignore}%
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
+ \catcode\spaceChar = 10
%
% Ignore braces, too, so mismatched braces don't cause trouble.
\catcode`\{ = 9
@@ -2535,7 +2747,7 @@ width0pt\relax} \fi
% command, so that nested ignore constructs work. Thus, we put the
% text into a \vbox and then do nothing with the result. To minimize
% the chance of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook: make the current font be a dummy font.
+ % page 401 of the TeXbook.
%
\setbox0 = \vbox\bgroup
% Don't complain about control sequences we have declared \outer.
@@ -2556,8 +2768,8 @@ width0pt\relax} \fi
%
% Set the current font to be \nullfont, a TeX primitive, and define
% all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because not all sites
- % might have that installed. Therefore, math mode will still
+ % dummy.tfm, as suggested in the TeXbook, because some sites
+ % might not have that installed. Therefore, math mode will still
% produce output, but that should be an extremely small amount of
% stuff compared to the main input.
%
@@ -2631,7 +2843,7 @@ width0pt\relax} \fi
% we're called from @code, as @code{@value{foo-bar_}}. So \let any
% such active characters to their normal equivalents.
\gdef\value{\begingroup
- \catcode`\-=12 \catcode`\_=12
+ \catcode`\-=\other \catcode`\_=\other
\indexbreaks \let_\normalunderscore
\valuexxx}
}
@@ -2640,15 +2852,17 @@ width0pt\relax} \fi
% We have this subroutine so that we can handle at least some @value's
% properly in indexes (we \let\value to this in \indexdummies). Ones
% whose names contain - or _ still won't work, but we can't do anything
-% about that. The command has to be fully expandable, since the result
-% winds up in the index file. This means that if the variable's value
-% contains other Texinfo commands, it's almost certain it will fail
-% (although perhaps we could fix that with sufficient work to do a
-% one-level expansion on the result, instead of complete).
+% about that. The command has to be fully expandable (if the variable
+% is set), since the result winds up in the index file. This means that
+% if the variable's value contains other Texinfo commands, it's almost
+% certain it will fail (although perhaps we could fix that with
+% sufficient work to do a one-level expansion on the result, instead of
+% complete).
%
\def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
{[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
\else
\csname SET#1\endcsname
\fi
@@ -2657,13 +2871,14 @@ width0pt\relax} \fi
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
+\def\ifset{\parsearg\doifset}
+\def\doifset#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
+ \let\next=\ifsetfail
\else
- \expandafter\ifsetsucceed
+ \let\next=\ifsetsucceed
\fi
+ \next
}
\def\ifsetsucceed{\conditionalsucceed{ifset}}
\def\ifsetfail{\nestedignore{ifset}}
@@ -2672,13 +2887,14 @@ width0pt\relax} \fi
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
+\def\ifclear{\parsearg\doifclear}
+\def\doifclear#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
+ \let\next=\ifclearsucceed
\else
- \expandafter\ifclearfail
+ \let\next=\ifclearfail
\fi
+ \next
}
\def\ifclearsucceed{\conditionalsucceed{ifclear}}
\def\ifclearfail{\nestedignore{ifclear}}
@@ -2697,28 +2913,13 @@ width0pt\relax} \fi
\defineunmatchedend{ifnotinfo}
\defineunmatchedend{ifnotplaintext}
-% We can't just want to start a group at @iftex (etc.) and end it at
-% @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
- }%
- \temp
-}
-
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
+% True conditional. Since \set globally defines its variables, we can
+% just start and end a group (to keep the @end definition undefined at
+% the outer level).
%
-\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+\def\conditionalsucceed#1{\begingroup
+ \expandafter\def\csname E#1\endcsname{\endgroup}%
+}
% @defininfoenclose.
\let\definfoenclose=\comment
@@ -2769,10 +2970,10 @@ width0pt\relax} \fi
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
-%
+%
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
-%
+%
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
@@ -2811,104 +3012,166 @@ width0pt\relax} \fi
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-% Take care of texinfo commands likely to appear in an index entry.
-% (Must be a way to avoid doing expansion at all, and thus not have to
-% laboriously list every single command here.)
-%
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
\def\indexdummies{%
-\def\ { }%
-\def\@{@}% change to @@ when we switch to @ as escape char in aux files.
-% Need these in case \tex is in effect and \{ is a \delimiter again.
-% But can't use \lbracecmd and \rbracecmd because texindex assumes
-% braces and backslashes are used only as delimiters.
-\let\{ = \mylbrace
-\let\} = \myrbrace
-\def\_{{\realbackslash _}}%
-\normalturnoffactive
-%
-% Take care of the plain tex accent commands.
-\def\,##1{\realbackslash ,{##1}}%
-\def\"{\realbackslash "}%
-\def\`{\realbackslash `}%
-\def\'{\realbackslash '}%
-\def\^{\realbackslash ^}%
-\def\~{\realbackslash ~}%
-\def\={\realbackslash =}%
-\def\b{\realbackslash b}%
-\def\c{\realbackslash c}%
-\def\d{\realbackslash d}%
-\def\u{\realbackslash u}%
-\def\v{\realbackslash v}%
-\def\H{\realbackslash H}%
-\def\dotless##1{\realbackslash dotless {##1}}%
-% Take care of the plain tex special European modified letters.
-\def\AA{\realbackslash AA}%
-\def\AE{\realbackslash AE}%
-\def\L{\realbackslash L}%
-\def\OE{\realbackslash OE}%
-\def\O{\realbackslash O}%
-\def\aa{\realbackslash aa}%
-\def\ae{\realbackslash ae}%
-\def\l{\realbackslash l}%
-\def\oe{\realbackslash oe}%
-\def\o{\realbackslash o}%
-\def\ss{\realbackslash ss}%
-%
-% Although these internals commands shouldn't show up, sometimes they do.
-\def\bf{\realbackslash bf }%
-\def\gtr{\realbackslash gtr}%
-\def\hat{\realbackslash hat}%
-\def\less{\realbackslash less}%
-%\def\rm{\realbackslash rm }%
-\def\sf{\realbackslash sf}%
-\def\sl{\realbackslash sl }%
-\def\tclose##1{\realbackslash tclose {##1}}%
-\def\tt{\realbackslash tt}%
-%
-\def\b##1{\realbackslash b {##1}}%
-\def\i##1{\realbackslash i {##1}}%
-\def\sc##1{\realbackslash sc {##1}}%
-\def\t##1{\realbackslash t {##1}}%
-\def\r##1{\realbackslash r {##1}}%
-%
-\def\TeX{\realbackslash TeX}%
-\def\acronym##1{\realbackslash acronym {##1}}%
-\def\cite##1{\realbackslash cite {##1}}%
-\def\code##1{\realbackslash code {##1}}%
-\def\command##1{\realbackslash command {##1}}%
-\def\dfn##1{\realbackslash dfn {##1}}%
-\def\dots{\realbackslash dots }%
-\def\emph##1{\realbackslash emph {##1}}%
-\def\env##1{\realbackslash env {##1}}%
-\def\file##1{\realbackslash file {##1}}%
-\def\kbd##1{\realbackslash kbd {##1}}%
-\def\key##1{\realbackslash key {##1}}%
-\def\math##1{\realbackslash math {##1}}%
-\def\option##1{\realbackslash option {##1}}%
-\def\samp##1{\realbackslash samp {##1}}%
-\def\strong##1{\realbackslash strong {##1}}%
-\def\uref##1{\realbackslash uref {##1}}%
-\def\url##1{\realbackslash url {##1}}%
-\def\var##1{\realbackslash var {##1}}%
-\def\w{\realbackslash w }%
-%
-% These math commands don't seem likely to be used in index entries.
-\def\copyright{\realbackslash copyright}%
-\def\equiv{\realbackslash equiv}%
-\def\error{\realbackslash error}%
-\def\expansion{\realbackslash expansion}%
-\def\point{\realbackslash point}%
-\def\print{\realbackslash print}%
-\def\result{\realbackslash result}%
-%
-% Handle some cases of @value -- where the variable name does not
-% contain - or _, and the value does not contain any
-% (non-fully-expandable) commands.
-\let\value = \expandablevalue
-%
-\unsepspaces
-% Turn off macro expansion
-\turnoffmacros
+ \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+ \def\ {\realbackslash\space }%
+ % Need these in case \tex is in effect and \{ is a \delimiter again.
+ % But can't use \lbracecmd and \rbracecmd because texindex assumes
+ % braces and backslashes are used only as delimiters.
+ \let\{ = \mylbrace
+ \let\} = \myrbrace
+ %
+ % \definedummyword defines \#1 as \realbackslash #1\space, thus
+ % effectively preventing its expansion. This is used only for control
+ % words, not control letters, because the \space would be incorrect
+ % for control characters, but is needed to separate the control word
+ % from whatever follows.
+ %
+ % For control letters, we have \definedummyletter, which omits the
+ % space.
+ %
+ % These can be used both for control words that take an argument and
+ % those that do not. If it is followed by {arg} in the input, then
+ % that will dutifully get written to the index (or wherever).
+ %
+ \def\definedummyword##1{%
+ \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
+ }%
+ \def\definedummyletter##1{%
+ \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
+ }%
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% For the aux file, @ is the escape character. So we want to redefine
+% everything using @ instead of \realbackslash. When everything uses
+% @, this will be simpler.
+%
+\def\atdummies{%
+ \def\@{@@}%
+ \def\ {@ }%
+ \let\{ = \lbraceatcmd
+ \let\} = \rbraceatcmd
+ %
+ % (See comments in \indexdummies.)
+ \def\definedummyword##1{%
+ \expandafter\def\csname ##1\endcsname{@##1\space}%
+ }%
+ \def\definedummyletter##1{%
+ \expandafter\def\csname ##1\endcsname{@##1}%
+ }%
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% Called from \indexdummies and \atdummies. \definedummyword and
+% \definedummyletter must be defined first.
+%
+\def\commondummies{%
+ %
+ \normalturnoffactive
+ %
+ % Control letters and accents.
+ \definedummyletter{_}%
+ \definedummyletter{,}%
+ \definedummyletter{"}%
+ \definedummyletter{`}%
+ \definedummyletter{'}%
+ \definedummyletter{^}%
+ \definedummyletter{~}%
+ \definedummyletter{=}%
+ \definedummyword{u}%
+ \definedummyword{v}%
+ \definedummyword{H}%
+ \definedummyword{dotaccent}%
+ \definedummyword{ringaccent}%
+ \definedummyword{tieaccent}%
+ \definedummyword{ubaraccent}%
+ \definedummyword{udotaccent}%
+ \definedummyword{dotless}%
+ %
+ % Other non-English letters.
+ \definedummyword{AA}%
+ \definedummyword{AE}%
+ \definedummyword{L}%
+ \definedummyword{OE}%
+ \definedummyword{O}%
+ \definedummyword{aa}%
+ \definedummyword{ae}%
+ \definedummyword{l}%
+ \definedummyword{oe}%
+ \definedummyword{o}%
+ \definedummyword{ss}%
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword{bf}%
+ \definedummyword{gtr}%
+ \definedummyword{hat}%
+ \definedummyword{less}%
+ \definedummyword{sf}%
+ \definedummyword{sl}%
+ \definedummyword{tclose}%
+ \definedummyword{tt}%
+ %
+ % Texinfo font commands.
+ \definedummyword{b}%
+ \definedummyword{i}%
+ \definedummyword{r}%
+ \definedummyword{sc}%
+ \definedummyword{t}%
+ %
+ \definedummyword{TeX}%
+ \definedummyword{acronym}%
+ \definedummyword{cite}%
+ \definedummyword{code}%
+ \definedummyword{command}%
+ \definedummyword{dfn}%
+ \definedummyword{dots}%
+ \definedummyword{emph}%
+ \definedummyword{env}%
+ \definedummyword{file}%
+ \definedummyword{kbd}%
+ \definedummyword{key}%
+ \definedummyword{math}%
+ \definedummyword{option}%
+ \definedummyword{samp}%
+ \definedummyword{strong}%
+ \definedummyword{uref}%
+ \definedummyword{url}%
+ \definedummyword{var}%
+ \definedummyword{w}%
+ %
+ % Assorted special characters.
+ \definedummyword{bullet}%
+ \definedummyword{copyright}%
+ \definedummyword{dots}%
+ \definedummyword{enddots}%
+ \definedummyword{equiv}%
+ \definedummyword{error}%
+ \definedummyword{expansion}%
+ \definedummyword{minus}%
+ \definedummyword{pounds}%
+ \definedummyword{point}%
+ \definedummyword{print}%
+ \definedummyword{result}%
+ %
+ % Handle some cases of @value -- where the variable name does not
+ % contain - or _, and the value does not contain any
+ % (non-fully-expandable) commands.
+ \let\value = \expandablevalue
+ %
+ % Normal spaces, not active ones.
+ \unsepspaces
+ %
+ % No macro expansion.
+ \turnoffmacros
}
% If an index command is used in an @example environment, any spaces
@@ -2917,83 +3180,86 @@ width0pt\relax} \fi
{\obeyspaces
\gdef\unsepspaces{\obeyspaces\let =\space}}
-% \indexnofonts no-ops all font-change commands.
-% This is used when outputting the strings to sort the index by.
-\def\indexdummyfont#1{#1}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
\def\indexdummytex{TeX}
\def\indexdummydots{...}
-
+%
\def\indexnofonts{%
-\def\@{@}%
-% how to handle braces?
-\def\_{\normalunderscore}%
-%
-\let\,=\indexdummyfont
-\let\"=\indexdummyfont
-\let\`=\indexdummyfont
-\let\'=\indexdummyfont
-\let\^=\indexdummyfont
-\let\~=\indexdummyfont
-\let\==\indexdummyfont
-\let\b=\indexdummyfont
-\let\c=\indexdummyfont
-\let\d=\indexdummyfont
-\let\u=\indexdummyfont
-\let\v=\indexdummyfont
-\let\H=\indexdummyfont
-\let\dotless=\indexdummyfont
-% Take care of the plain tex special European modified letters.
-\def\AA{AA}%
-\def\AE{AE}%
-\def\L{L}%
-\def\OE{OE}%
-\def\O{O}%
-\def\aa{aa}%
-\def\ae{ae}%
-\def\l{l}%
-\def\oe{oe}%
-\def\o{o}%
-\def\ss{ss}%
-%
-% Don't no-op \tt, since it isn't a user-level command
-% and is used in the definitions of the active chars like <, >, |, etc.
-% Likewise with the other plain tex font commands.
-%\let\tt=\indexdummyfont
-%
-\let\b=\indexdummyfont
-\let\i=\indexdummyfont
-\let\r=\indexdummyfont
-\let\sc=\indexdummyfont
-\let\t=\indexdummyfont
-%
-\let\TeX=\indexdummytex
-\let\acronym=\indexdummyfont
-\let\cite=\indexdummyfont
-\let\code=\indexdummyfont
-\let\command=\indexdummyfont
-\let\dfn=\indexdummyfont
-\let\dots=\indexdummydots
-\let\emph=\indexdummyfont
-\let\env=\indexdummyfont
-\let\file=\indexdummyfont
-\let\kbd=\indexdummyfont
-\let\key=\indexdummyfont
-\let\math=\indexdummyfont
-\let\option=\indexdummyfont
-\let\samp=\indexdummyfont
-\let\strong=\indexdummyfont
-\let\uref=\indexdummyfont
-\let\url=\indexdummyfont
-\let\var=\indexdummyfont
-\let\w=\indexdummyfont
-}
-
-% To define \realbackslash, we must make \ not be an escape.
-% We must first make another character (@) an escape
-% so we do not become unable to do a definition.
-
-{\catcode`\@=0 \catcode`\\=\other
- @gdef@realbackslash{\}}
+ \def\ { }%
+ \def\@{@}%
+ % how to handle braces?
+ \def\_{\normalunderscore}%
+ %
+ \let\,=\asis
+ \let\"=\asis
+ \let\`=\asis
+ \let\'=\asis
+ \let\^=\asis
+ \let\~=\asis
+ \let\==\asis
+ \let\u=\asis
+ \let\v=\asis
+ \let\H=\asis
+ \let\dotaccent=\asis
+ \let\ringaccent=\asis
+ \let\tieaccent=\asis
+ \let\ubaraccent=\asis
+ \let\udotaccent=\asis
+ \let\dotless=\asis
+ %
+ % Other non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\o{o}%
+ \def\ss{ss}%
+ \def\exclamdown{!}%
+ \def\questiondown{?}%
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
+ % Texinfo font commands.
+ \let\b=\asis
+ \let\i=\asis
+ \let\r=\asis
+ \let\sc=\asis
+ \let\t=\asis
+ %
+ \let\TeX=\indexdummytex
+ \let\acronym=\asis
+ \let\cite=\asis
+ \let\code=\asis
+ \let\command=\asis
+ \let\dfn=\asis
+ \let\dots=\indexdummydots
+ \let\emph=\asis
+ \let\env=\asis
+ \let\file=\asis
+ \let\kbd=\asis
+ \let\key=\asis
+ \let\math=\asis
+ \let\option=\asis
+ \let\samp=\asis
+ \let\strong=\asis
+ \let\uref=\asis
+ \let\url=\asis
+ \let\var=\asis
+ \let\w=\asis
+}
\let\indexbackslash=0 %overridden during \printindex.
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
@@ -3025,28 +3291,24 @@ width0pt\relax} \fi
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
- \def\thirdarg{#3}%
- %
- % If third arg is present, precede it with space in sort key.
- \ifx\thirdarg\emptymacro
- \let\subentry = \empty
- \else
- \def\subentry{ #3}%
- \fi
- %
- % First process the index entry with all font commands turned
- % off to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
- %
- % Now the real index entry with the fonts.
+ % The main index entry text.
\toks0 = {#2}%
%
- % If the third (subentry) arg is present, add it to the index
- % line to write.
+ % If third arg is present, precede it with space in sort key.
+ \def\thirdarg{#3}%
\ifx\thirdarg\emptymacro \else
- \toks0 = \expandafter{\the\toks0{#3}}%
+ % If the third (subentry) arg is present, add it to the index
+ % line to write.
+ \toks0 = \expandafter{\the\toks0 \space #3}%
\fi
%
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
% Set up the complete index entry, with both the sort key and
% the original text, including any font commands. We write
% three arguments to \entry to the .?? file (four in the
@@ -3077,12 +3339,11 @@ width0pt\relax} \fi
\iflinks
\ifvmode
\skip0 = \lastskip
- \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
\fi
%
\temp % do the write
%
- %
\ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
\fi
}%
@@ -3132,6 +3393,7 @@ width0pt\relax} \fi
%
\smallfonts \rm
\tolerance = 9500
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
\indexbreaks
%
% See if the index file exists and is nonempty.
@@ -3375,7 +3637,7 @@ width0pt\relax} \fi
\wd0=\hsize \wd2=\hsize
\hbox to\pagewidth{\box0\hfil\box2}%
}
-%
+%
% All done with double columns.
\def\enddoublecolumns{%
\output = {%
@@ -3513,6 +3775,7 @@ width0pt\relax} \fi
\numberedsubsubseczzz{#2}
\fi
\fi
+\suppressfirstparagraphindent
}
% like \numhead, but chooses appendix heading levels
@@ -3532,6 +3795,7 @@ width0pt\relax} \fi
\appendixsubsubseczzz{#2}
\fi
\fi
+\suppressfirstparagraphindent
}
% like \numhead, but chooses numberless heading levels
@@ -3551,6 +3815,7 @@ width0pt\relax} \fi
\unnumberedsubsubseczzz{#2}
\fi
\fi
+\suppressfirstparagraphindent
}
% @chapter, @appendix, @unnumbered.
@@ -3558,22 +3823,19 @@ width0pt\relax} \fi
\outer\def\chapter{\parsearg\chapteryyy}
\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
\def\chapterzzz #1{%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
-\chapmacro {#1}{\the\chapno}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-% We don't substitute the actual chapter name into \thischapter
-% because we don't want its macros evaluated now.
-\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
- {\the\chapno}}}%
-\temp
-\donoderef
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
+ \secno=0 \subsecno=0 \subsubsecno=0
+ \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+ \chapmacro {#1}{\the\chapno}%
+ \gdef\thissection{#1}%
+ \gdef\thischaptername{#1}%
+ % We don't substitute the actual chapter name into \thischapter
+ % because we don't want its macros evaluated now.
+ \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+ \writetocentry{chap}{#1}{{\the\chapno}}
+ \donoderef
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
}
% we use \chapno to avoid indenting back
@@ -3584,21 +3846,18 @@ width0pt\relax} \fi
\outer\def\appendix{\parsearg\appendixyyy}
\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
\def\appendixzzz #1{%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1
-\message{\putwordAppendix\space \appendixletter}%
-\chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}%
- {\appendixletter}}}%
-\temp
-\appendixnoderef
-\global\let\section = \appendixsec
-\global\let\subsection = \appendixsubsec
-\global\let\subsubsection = \appendixsubsubsec
+ \secno=0 \subsecno=0 \subsubsecno=0
+ \global\advance \appendixno by 1
+ \message{\putwordAppendix\space \appendixletter}%
+ \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
+ \gdef\thissection{#1}%
+ \gdef\thischaptername{#1}%
+ \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+ \writetocentry{appendix}{#1}{{\appendixletter}}
+ \appendixnoderef
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
}
% @centerchap is like @unnumbered, but the heading is centered.
@@ -3611,150 +3870,121 @@ width0pt\relax} \fi
\outer\def\unnumbered{\parsearg\unnumberedyyy}
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
\def\unnumberedzzz #1{%
-\secno=0 \subsecno=0 \subsubsecno=0
-%
-% This used to be simply \message{#1}, but TeX fully expands the
-% argument to \message. Therefore, if #1 contained @-commands, TeX
-% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
-% expanded @cite (which turns out to cause errors because \cite is meant
-% to be executed, not expanded).
-%
-% Anyway, we don't want the fully-expanded definition of @cite to appear
-% as a result of the \message, we just want `@cite' itself. We use
-% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of <toks register>. (We also do this for
-% the toc entries.)
-\toks0 = {#1}\message{(\the\toks0)}%
-%
-\unnumbchapmacro {#1}%
-\gdef\thischapter{#1}\gdef\thissection{#1}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}{\the\chapno}}}%
-\temp
-\unnumbnoderef
-\global\let\section = \unnumberedsec
-\global\let\subsection = \unnumberedsubsec
-\global\let\subsubsection = \unnumberedsubsubsec
+ \secno=0 \subsecno=0 \subsubsecno=0
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}\message{(\the\toks0)}%
+ %
+ \unnumbchapmacro {#1}%
+ \gdef\thischapter{#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbchap}{#1}{{\the\chapno}}
+ \unnumbnoderef
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
}
% Sections.
\outer\def\numberedsec{\parsearg\secyyy}
\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
\def\seczzz #1{%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
- {\the\chapno}{\the\secno}}}%
-\temp
-\donoderef
-\nobreak
+ \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+ \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+ \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
+ \donoderef
+ \nobreak
}
\outer\def\appendixsection{\parsearg\appendixsecyyy}
\outer\def\appendixsec{\parsearg\appendixsecyyy}
\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
\def\appendixsectionzzz #1{%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
- {\appendixletter}{\the\secno}}}%
-\temp
-\appendixnoderef
-\nobreak
+ \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+ \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+ \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
+ \appendixnoderef
+ \nobreak
}
\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
\def\unnumberedseczzz #1{%
-\plainsecheading {#1}\gdef\thissection{#1}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry%
- {\the\toks0}{\the\chapno}{\the\secno}}}%
-\temp
-\unnumbnoderef
-\nobreak
+ \plainsecheading {#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
+ \unnumbnoderef
+ \nobreak
}
% Subsections.
\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
\def\numberedsubseczzz #1{%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
- {\the\chapno}{\the\secno}{\the\subsecno}}}%
-\temp
-\donoderef
-\nobreak
+ \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+ \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+ \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
+ \donoderef
+ \nobreak
}
\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
\def\appendixsubseczzz #1{%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
- {\appendixletter}{\the\secno}{\the\subsecno}}}%
-\temp
-\appendixnoderef
-\nobreak
+ \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+ \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+ \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
+ \appendixnoderef
+ \nobreak
}
\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
\def\unnumberedsubseczzz #1{%
-\plainsubsecheading {#1}\gdef\thissection{#1}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
- {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}%
-\temp
-\unnumbnoderef
-\nobreak
+ \plainsubsecheading {#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
+ \unnumbnoderef
+ \nobreak
}
% Subsubsections.
\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
\def\numberedsubsubseczzz #1{%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
-\temp
-\donoderef
-\nobreak
+ \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+ \subsubsecheading {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+ \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
+ \donoderef
+ \nobreak
}
\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
\def\appendixsubsubseczzz #1{%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
-\temp
-\appendixnoderef
-\nobreak
+ \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+ \subsubsecheading {#1}
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+ \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
+ \appendixnoderef
+ \nobreak
}
\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
\def\unnumberedsubsubseczzz #1{%
-\plainsubsubsecheading {#1}\gdef\thissection{#1}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
- {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
-\temp
-\unnumbnoderef
-\nobreak
+ \plainsubsubsecheading {#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
+ \unnumbnoderef
+ \nobreak
}
% These are variants which are not "outer", so they can appear in @ifinfo.
@@ -3795,16 +4025,16 @@ width0pt\relax} \fi
\def\majorheading{\parsearg\majorheadingzzz}
\def\majorheadingzzz #1{%
-{\advance\chapheadingskip by 10pt \chapbreak }%
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
\def\chapheading{\parsearg\chapheadingzzz}
\def\chapheadingzzz #1{\chapbreak %
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
+ {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
% @heading, @subheading, @subsubheading.
\def\heading{\parsearg\plainsecheading}
@@ -3952,7 +4182,7 @@ width0pt\relax} \fi
}%
% Add extra space after the heading -- either a line space or a
% paragraph space, whichever is more. (Some people like to set
- % \parskip to large values for some reason.)
+ % \parskip to large values for some reason.) Don't allow stretch, though.
\nobreak
\ifdim\parskip>\normalbaselineskip
\kern\parskip
@@ -3971,16 +4201,22 @@ width0pt\relax} \fi
% Called from @chapter, etc. We supply {\folio} at the end of the
% argument, which will end up as the last argument to the \...entry macro.
%
-% We open the .toc file here instead of at @setfilename or any other
-% fixed time so that @contents can be put in the document anywhere.
+% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
%
\newif\iftocfileopened
-\def\writetocentry#1{%
+\def\writetocentry#1#2#3{%
\iftocfileopened\else
\immediate\openout\tocfile = \jobname.toc
\global\tocfileopenedtrue
\fi
- \iflinks \write\tocfile{#1{\folio}}\fi
+ %
+ \iflinks
+ \toks0 = {#2}%
+ \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}%
+ \temp
+ \fi
%
% Tell \shipout to create a page destination if we're doing pdf, which
% will be the target of the links in the table of contents. We can't
@@ -4019,7 +4255,7 @@ width0pt\relax} \fi
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
%
% Roman numerals for page numbers.
- \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
}
@@ -4036,7 +4272,7 @@ width0pt\relax} \fi
\pdfmakeoutlines
\endgroup
\lastnegativepageno = \pageno
- \pageno = \savepageno
+ \global\pageno = \savepageno
}
% And just the chapters.
@@ -4068,7 +4304,7 @@ width0pt\relax} \fi
\contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
\lastnegativepageno = \pageno
- \pageno = \savepageno
+ \global\pageno = \savepageno
}
\let\shortcontents = \summarycontents
@@ -4192,7 +4428,7 @@ width0pt\relax} \fi
% @foo ... @end foo.
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-%
+%
% Since these characters are used in examples, it should be an even number of
% \tt widths. Each \tt character is 1en, so two makes it 1em.
%
@@ -4204,7 +4440,7 @@ width0pt\relax} \fi
% The @error{} command.
% Adapted from the TeXbook's \boxit.
-%
+%
\newbox\errorbox
%
{\tentt \global\dimen0 = 3em}% Width of the box.
@@ -4232,14 +4468,14 @@ width0pt\relax} \fi
\def\tex{\begingroup
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
- \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
\catcode `\%=14
- \catcode 43=12 % plus
- \catcode`\"=12
- \catcode`\==12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\==\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
\escapechar=`\\
%
\let\b=\ptexb
@@ -4251,9 +4487,11 @@ width0pt\relax} \fi
\let\equiv=\ptexequiv
\let\!=\ptexexclam
\let\i=\ptexi
+ \let\indent=\ptexindent
\let\{=\ptexlbrace
\let\+=\tabalign
\let\}=\ptexrbrace
+ \let\/=\ptexslash
\let\*=\ptexstar
\let\t=\ptext
%
@@ -4336,7 +4574,8 @@ width0pt\relax} \fi
%
\newskip\lskip\newskip\rskip
-\long\def\cartouche{%
+\def\cartouche{%
+\par % can't be in the midst of a paragraph.
\begingroup
\lskip=\leftskip \rskip=\rightskip
\leftskip=0pt\rightskip=0pt %we want these *outside*.
@@ -4421,27 +4660,16 @@ width0pt\relax} \fi
% @example: Same as @lisp.
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-% @small... is usually equivalent to the non-small (@smallbook
-% redefines). We must call \example (or whatever) last in the
-% definition, since it reads the return following the @example (or
-% whatever) command.
-%
-% This actually allows (for example) @end display inside an
-% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
-%
-\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
-\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
-\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-
-% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% @smallexample and @smalllisp: use smaller fonts.
% Originally contributed by Pavel@xerox.
-\def\smalllispx{\begingroup
+\def\smalllisp{\begingroup
\def\Esmalllisp{\nonfillfinish\endgroup}%
\def\Esmallexample{\nonfillfinish\endgroup}%
\smallexamplefonts
\lisp
}
+\let\smallexample = \smalllisp
+
% @display: same as @lisp except keep current font.
%
@@ -4451,9 +4679,9 @@ width0pt\relax} \fi
\gobble
}
%
-% @smalldisplay (when @smallbook): @display plus smaller fonts.
+% @smalldisplay: @display plus smaller fonts.
%
-\def\smalldisplayx{\begingroup
+\def\smalldisplay{\begingroup
\def\Esmalldisplay{\nonfillfinish\endgroup}%
\smallexamplefonts \rm
\display
@@ -4468,9 +4696,9 @@ width0pt\relax} \fi
\gobble
}
%
-% @smallformat (when @smallbook): @format plus smaller fonts.
+% @smallformat: @format plus smaller fonts.
%
-\def\smallformatx{\begingroup
+\def\smallformat{\begingroup
\def\Esmallformat{\nonfillfinish\endgroup}%
\smallexamplefonts \rm
\format
@@ -4513,7 +4741,7 @@ width0pt\relax} \fi
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
-% If we want to allow any <char> as delimiter,
+% If we want to allow any <char> as delimiter,
% we need the curly braces so that makeinfo sees the @verb command, eg:
% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
%
@@ -4591,8 +4819,8 @@ width0pt\relax} \fi
\everypar{\starttabbox}%
}
-% Do the @verb magic: verbatim text is quoted by unique
-% delimiter characters. Before first delimiter expect a
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
% right brace, after last delimiter expect closing brace:
%
% \def\doverb'{'<char>#1<char>'}'{#1}
@@ -4611,7 +4839,7 @@ width0pt\relax} \fi
%
% \def\doverbatim#1@end verbatim{#1}
%
-% For Texinfo it's a lot easier than for LaTeX,
+% For Texinfo it's a lot easier than for LaTeX,
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
% we need not redefine '\', '{' and '}'.
%
@@ -4646,14 +4874,14 @@ width0pt\relax} \fi
% Allow normal characters that we make active in the argument (a file name).
\def\verbatiminclude{%
\begingroup
- \catcode`\\=12
- \catcode`~=12
- \catcode`^=12
- \catcode`_=12
- \catcode`|=12
- \catcode`<=12
- \catcode`>=12
- \catcode`+=12
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
\parsearg\doverbatiminclude
}
\def\setupverbatiminclude{%
@@ -4667,22 +4895,25 @@ width0pt\relax} \fi
% Restore active chars for included file.
\endgroup
\begingroup
- \def\thisfile{#1}%
- \expandafter\expandafter\setupverbatiminclude\input\thisfile
- \endgroup\nonfillfinish\endgroup
+ \let\value=\expandablevalue
+ \def\thisfile{#1}%
+ \expandafter\expandafter\setupverbatiminclude\input\thisfile
+ \endgroup
+ \nonfillfinish
+ \endgroup
}
% @copying ... @end copying.
% Save the text away for @insertcopying later. Many commands won't be
% allowed in this context, but that's ok.
-%
+%
% We save the uninterpreted tokens, rather than creating a box.
% Saving the text in a box would be much easier, but then all the
% typesetting commands (@smallbook, font changes, etc.) have to be done
% beforehand -- and a) we want @copying to be done first in the source
% file; b) letting users define the frontmatter in as flexible order as
% possible is very desirable.
-%
+%
\def\copying{\begingroup
% Define a command to swallow text until we reach `@end copying'.
% \ is the escape char in this texinfo.tex file, so it is the
@@ -4705,15 +4936,15 @@ width0pt\relax} \fi
% end-of-line to be a \par, as would happen with the normal active
% definition of ^^M. On the third hand, two ^^M's in a row should still
% generate a \par.
-%
+%
% Our approach is to make ^^M insert a space and a penalty1 normally;
% then it can also check if \lastpenalty=1. If it does, then manually
% do \par.
-%
+%
% This messes up the normal definitions of @c[omment], so we redefine
% it. Similarly for @ignore. (These commands are used in the gcc
% manual for man page generation.)
-%
+%
% Seems pretty fragile, most line-oriented commands will presumably
% fail, but for the limited use of getting the copying text (which
% should be quite simple) inserted, we can hope it's ok.
@@ -4754,7 +4985,7 @@ width0pt\relax} \fi
\newcount\parencount
% We want ()&[] to print specially on the defun line.
-%
+%
\def\activeparens{%
\catcode`\(=\active \catcode`\)=\active
\catcode`\&=\active
@@ -4806,7 +5037,7 @@ width0pt\relax} \fi
% Active &'s sneak into the index arguments, so make sure it's defined.
{
- \catcode`& = 13
+ \catcode`& = \active
\global\let& = \ampnr
}
@@ -4857,14 +5088,17 @@ width0pt\relax} \fi
% #1 is the \E... control sequence to end the definition (which we define).
% #2 is the \...x control sequence (which our caller defines).
% #3 is the control sequence to process the header, such as \defunheader.
-%
+%
\def\parsebodycommon#1#2#3{%
\begingroup\inENV
% If there are two @def commands in a row, we'll have a \nobreak,
% which is there to keep the function description together with its
% header. But if there's nothing but headers, we want to allow a
- % break after all.
- \ifnum\lastpenalty=10000 \penalty0 \fi
+ % break after all. Check for penalty 10002 (inserted by
+ % \defargscommonending) instead of 10000, since the sectioning
+ % commands insert a \penalty10000, and we don't want to allow a break
+ % between a section heading and a defun.
+ \ifnum\lastpenalty=10002 \penalty0 \fi
\medbreak
%
% Define the \E... end token that this defining construct specifies
@@ -4877,7 +5111,7 @@ width0pt\relax} \fi
}
% Common part of the \...x definitions.
-%
+%
\def\defxbodycommon{%
% As with \parsebodycommon above, allow line break if we have multiple
% x headers in a row. It's not a great place, though.
@@ -4891,7 +5125,7 @@ width0pt\relax} \fi
\def\defparsebody#1#2#3{%
\parsebodycommon{#1}{#2}{#3}%
\def#2{\defxbodycommon \activeparens \spacesplit#3}%
- \catcode61=\active % 61 is `='
+ \catcode\equalChar=\active
\begingroup\obeylines\activeparens
\spacesplit#3%
}
@@ -4928,7 +5162,7 @@ width0pt\relax} \fi
% to account for this both in the \...x definition and in parsing the
% input at hand. Thus also need a control sequence (passed as #5) for
% the \E... definition to assign the category name to.
-%
+%
\def\deftypeopparsebody#1#2#3#4#5 #6 {%
\parsebodycommon{#1}{#2}{#3}%
\def#2##1 ##2 ##3 {\def#4{##1}%
@@ -4953,7 +5187,7 @@ width0pt\relax} \fi
\def\defvarparsebody #1#2#3{%
\parsebodycommon{#1}{#2}{#3}%
\def#2{\defxbodycommon \spacesplit#3}%
- \catcode61=\active %
+ \catcode\equalChar=\active
\begingroup\obeylines
\spacesplit#3%
}
@@ -5022,9 +5256,18 @@ width0pt\relax} \fi
% Define @defun.
-% First, define the processing that is wanted for arguments of \defun
-% Use this to expand the args and terminate the paragraph they make up
+% This is called to end the arguments processing for all the @def... commands.
+%
+\def\defargscommonending{%
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty 10002 % signal to \parsebodycommon.
+}
+% This expands the args and terminates the paragraph they comprise.
+%
\def\defunargs#1{\functionparens \sl
% Expand, preventing hyphenation at `-' chars.
% Note that groups don't affect changes in \hyphenchar.
@@ -5033,9 +5276,7 @@ width0pt\relax} \fi
#1%
{\tensl\hyphenchar\font=45}%
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
}
\def\deftypefunargs #1{%
@@ -5044,9 +5285,7 @@ width0pt\relax} \fi
% Use \boldbraxnoamp, not \functionparens, so that & is not special.
\boldbraxnoamp
\tclose{#1}% avoid \code because of side effects on active chars
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
}
% Do complete processing of one @defun or @defunx line already parsed.
@@ -5057,7 +5296,7 @@ width0pt\relax} \fi
\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defun == @deffn Function
@@ -5067,7 +5306,7 @@ width0pt\relax} \fi
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDeffunc}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @deftypefun int foobar (int @var{foo}, float @var{bar})
@@ -5081,7 +5320,7 @@ width0pt\relax} \fi
\doind {fn}{\code{#2}}% Make entry in function index
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
\deftypefunargs {#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
@@ -5102,7 +5341,7 @@ width0pt\relax} \fi
% at least some C++ text from working
\defname {\defheaderxcond#2\relax$.$#3}{#1}%
\deftypefunargs {#4}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defmac == @deffn Macro
@@ -5112,7 +5351,7 @@ width0pt\relax} \fi
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDefmac}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defspec == @deffn Special Form
@@ -5122,7 +5361,7 @@ width0pt\relax} \fi
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDefspec}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defop CATEGORY CLASS OPERATION ARG...
@@ -5131,9 +5370,11 @@ width0pt\relax} \fi
\defopparsebody\Edefop\defopx\defopheader\defoptype}
%
\def\defopheader#1#2#3{%
-\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
-\defunargs {#3}\endgroup %
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
+ \begingroup
+ \defname{#2}{\defoptype\ \putwordon\ #1}%
+ \defunargs{#3}%
+ \endgroup
}
% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
@@ -5200,9 +5441,11 @@ width0pt\relax} \fi
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
-\defvarargs {#3}\endgroup %
+ \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
+ \begingroup
+ \defname{#2}{\defcvtype\ \putwordof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
}
% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
@@ -5210,7 +5453,7 @@ width0pt\relax} \fi
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
%
\def\defivarheader#1#2#3{%
- \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
+ \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
\begingroup
\defname{#2}{\putwordInstanceVariableof\ #1}%
\defvarargs{#3}%
@@ -5222,8 +5465,8 @@ width0pt\relax} \fi
% This is actually simple: just print them in roman.
% This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1%
-\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak}
+ \defargscommonending
+}
% @defvr Counter foo-count
@@ -5259,8 +5502,7 @@ width0pt\relax} \fi
\def\deftypevarheader #1#2{%
\dovarind#2 \relax% Make entry in variables index
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
-\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
\endgroup}
\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
@@ -5270,8 +5512,7 @@ width0pt\relax} \fi
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
-\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
\endgroup}
% Now define @deftp
@@ -5288,7 +5529,7 @@ width0pt\relax} \fi
% These definitions are used if you use @defunx (etc.)
% anywhere other than immediately after a @defun or @defunx.
-%
+%
\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
@@ -5320,7 +5561,7 @@ width0pt\relax} \fi
\def\scanmacro#1{%
\begingroup \newlinechar`\^^M
% Undo catcode changes of \startcontents and \doprintindex
- \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+ \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
% Append \endinput to make sure that TeX does not see the ending newline.
\toks0={#1\endinput}%
\immediate\openout\macscribble=\jobname.tmp
@@ -5334,7 +5575,7 @@ width0pt\relax} \fi
\def\scanmacro#1{%
\begingroup \newlinechar`\^^M
% Undo catcode changes of \startcontents and \doprintindex
-\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+\catcode`\@=0 \catcode`\\=\other \escapechar=`\@
\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
\fi
@@ -5364,7 +5605,7 @@ width0pt\relax} \fi
}
% Trim a single trailing ^^M off a string.
-{\catcode`\^^M=12\catcode`\Q=3%
+{\catcode`\^^M=\other \catcode`\Q=3%
\gdef\eatcr #1{\eatcra #1Q^^MQ}%
\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
\gdef\eatcrb#1Q#2Q{#1}%
@@ -5379,29 +5620,29 @@ width0pt\relax} \fi
% body, and then making it the \newlinechar in \scanmacro.
\def\macrobodyctxt{%
- \catcode`\~=12
- \catcode`\^=12
- \catcode`\_=12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
- \catcode`\+=12
- \catcode`\{=12
- \catcode`\}=12
- \catcode`\@=12
- \catcode`\^^M=12
+ \catcode`\~=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\+=\other
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\@=\other
+ \catcode`\^^M=\other
\usembodybackslash}
\def\macroargctxt{%
- \catcode`\~=12
- \catcode`\^=12
- \catcode`\_=12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
- \catcode`\+=12
- \catcode`\@=12
- \catcode`\\=12}
+ \catcode`\~=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\+=\other
+ \catcode`\@=\other
+ \catcode`\\=\other}
% \mbodybackslash is the definition of \ in @macro bodies.
% It maps \foo\ => \csname macarg.foo\endcsname => #N
@@ -5442,32 +5683,33 @@ width0pt\relax} \fi
\else \expandafter\parsemacbody
\fi}
-\def\unmacro{\parsearg\unmacroxxx}
-\def\unmacroxxx#1{%
+\def\unmacro{\parsearg\dounmacro}
+\def\dounmacro#1{%
\if1\csname ismacro.#1\endcsname
\global\cslet{#1}{macsave.#1}%
\global\expandafter\let \csname ismacro.#1\endcsname=0%
- % Remove the macro name from \macrolist
+ % Remove the macro name from \macrolist:
\begingroup
- \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
- \def\do##1{%
- \def\tempb{##1}%
- \ifx\tempa\tempb
- % remove this
- \else
- \toks0 = \expandafter{\newmacrolist\do}%
- \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
- \fi}%
- \def\newmacrolist{}%
- % Execute macro list to define \newmacrolist
- \macrolist
- \global\let\macrolist\newmacrolist
+ \expandafter\let\csname#1\endcsname \relax
+ \let\do\unmacrodo
+ \xdef\macrolist{\macrolist}%
\endgroup
\else
\errmessage{Macro #1 not defined}%
\fi
}
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx#1\relax
+ % remove this
+ \else
+ \noexpand\do \noexpand #1%
+ \fi
+}
+
% This makes use of the obscure feature that if the last token of a
% <parameter list> is #, then the preceding argument is delimited by
% an opening brace, and that opening brace is not consumed.
@@ -5615,8 +5857,8 @@ width0pt\relax} \fi
% @node's job is to define \lastnode.
\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\def\nodezzz#1{\nodexxx #1,\finishnodeparse}
+\def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
\let\nwnode=\node
\let\lastnode=\relax
@@ -5650,15 +5892,23 @@ width0pt\relax} \fi
\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
-% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
-% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
-% to set \indexdummies so commands such as @code in a section title
-% aren't expanded. It would be nicer not to expand the titles in the
-% first place, but there's so many layers that that is hard to do.
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), namely NAME-title (the corresponding @chapter/etc. name),
+% NAME-pg (the page number), and NAME-snt (section number and type).
+% Called from \foonoderef.
+%
+% We have to set \indexdummies so commands such as @code in a section
+% title aren't expanded. It would be nicer not to expand the titles in
+% the first place, but there's so many layers that that is hard to do.
+%
+% Likewise, use \turnoffactive so that punctuation chars such as underscore
+% and backslash work in node names.
%
\def\setref#1#2{{%
- \indexdummies
+ \atdummies
\pdfmkdest{#1}%
+ %
+ \turnoffactive
\dosetq{#1-title}{Ytitle}%
\dosetq{#1-pg}{Ypagenumber}%
\dosetq{#1-snt}{#2}%
@@ -5710,7 +5960,7 @@ width0pt\relax} \fi
\ifpdf
\leavevmode
\getfilename{#4}%
- {\normalturnoffactive
+ {\turnoffactive \otherbackslash
\ifnum\filenamelength>0
\startlink attr{/Border [0 0 0]}%
goto file{\the\filename.pdf} name{#1}%
@@ -5730,82 +5980,94 @@ width0pt\relax} \fi
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
- {\normalturnoffactive
+ {\turnoffactive \otherbackslash
% Only output a following space if the -snt ref is nonempty; for
% @unnumbered and @anchor, it won't be.
\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
}%
- % [mynode],
- [\printednodename],\space
- % page 3
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ % output the `[mynode]' via a macro.
+ \xrefprintnodename\printednodename
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
\fi
\endlink
\endgroup}
-% \dosetq is the interface for calls from other macros
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since not square brackets don't work in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
-% Use \normalturnoffactive so that punctuation chars such as underscore
-% and backslash work in node names. (\turnoffactive doesn't do \.)
+% \dosetq is called from \setref to do the actual \write (\iflinks).
+%
\def\dosetq#1#2{%
{\let\folio=0%
- \normalturnoffactive
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
- \iflinks
- \next
- \fi
+ \iflinks \next \fi
}%
}
-% \internalsetq {foo}{page} expands into
-% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
-% When the aux file is read, ' is the escape character
-
-\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
-
-% Things to be expanded by \internalsetq
+% \internalsetq{foo}{page} expands into
+% CHARACTERS @xrdef{foo}{...expansion of \page...}
+\def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}}
+% Things to be expanded by \internalsetq.
+%
\def\Ypagenumber{\folio}
-
\def\Ytitle{\thissection}
-
\def\Ynothing{}
-
\def\Ysectionnumberandtype{%
-\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
-\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
\def\Yappendixletterandtype{%
-\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
-\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\gdef\xreftie{'tie}
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
% Use TeX 3.0's \inputlineno to get the line number, for better error
% messages, but if we're using an old version of TeX, don't do anything.
%
\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Non-3.0.
+ \let\linenumber = \empty % Pre-3.0.
\else
\def\linenumber{\the\inputlineno:\space}
\fi
% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% If its value is nonempty, SUFFIX is output afterward.
-
+%
\def\refx#1#2{%
- \expandafter\ifx\csname X#1\endcsname\relax
+ {%
+ \indexnofonts
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname X#1\endcsname
+ }%
+ \ifx\thisrefX\relax
% If not defined, say something at least.
\angleleft un\-de\-fined\angleright
\iflinks
@@ -5820,19 +6082,14 @@ width0pt\relax} \fi
\fi
\else
% It's defined, so just use it.
- \csname X#1\endcsname
+ \thisrefX
\fi
#2% Output the suffix in any case.
}
% This is the macro invoked by entries in the aux file.
%
-\def\xrdef#1{\begingroup
- % Reenable \ as an escape while reading the second argument.
- \catcode`\\ = 0
- \afterassignment\endgroup
- \expandafter\gdef\csname X#1\endcsname
-}
+\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
% Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup
@@ -5863,9 +6120,7 @@ width0pt\relax} \fi
\catcode`\^^]=\other
\catcode`\^^^=\other
\catcode`\^^_=\other
- \catcode`\@=\other
- \catcode`\^=\other
- % It was suggested to define this as 7, which would allow ^^e4 etc.
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
% in xref tags, i.e., node names. But since ^^e4 notation isn't
% supported in the main text, it doesn't seem desirable. Furthermore,
% that is not enough: for node names that actually contain a ^
@@ -5878,6 +6133,9 @@ width0pt\relax} \fi
% \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
% and then to call \auxhat in \setq.
%
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
\catcode`\~=\other
\catcode`\[=\other
\catcode`\]=\other
@@ -5889,7 +6147,9 @@ width0pt\relax} \fi
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
+ \catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
% Make the characters 128-255 be printing characters
{%
\count 1=128
@@ -5899,17 +6159,18 @@ width0pt\relax} \fi
\ifnum \count 1<256 \loop \fi
}%
}%
- % The aux file uses ' as the escape (for now).
+ %
% Turn off \ as an escape so we do not lose on
% entries which were dumped with control sequences in their names.
- % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+ % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
% Reference to such entries still does not work the way one would wish,
% but at least they do not bomb out when the aux file is read in.
+ \catcode`\\=\other
+ %
+ % @ is our escape character in .aux files.
\catcode`\{=1
\catcode`\}=2
- \catcode`\%=\other
- \catcode`\'=0
- \catcode`\\=\other
+ \catcode`\@=0
%
\openin 1 \jobname.aux
\ifeof 1 \else
@@ -5943,18 +6204,19 @@ width0pt\relax} \fi
%
% Auto-number footnotes. Otherwise like plain.
\gdef\footnote{%
+ \let\indent=\ptexindent
\global\advance\footnoteno by \@ne
\edef\thisfootno{$^{\the\footnoteno}$}%
%
% In case the footnote comes at the end of a sentence, preserve the
% extra spacing after we do the footnote number.
\let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
%
% Remove inadvertent blank space before typesetting the footnote number.
\unskip
\thisfootno\@sf
- \footnotezzz
+ \dofootnote
}%
% Don't bother with the trickery in plain.tex to not require the
@@ -5964,10 +6226,17 @@ width0pt\relax} \fi
% \parseargline fail inside footnotes because the tokens are fixed when
% the footnote is read. --karl, 16nov96.
%
-\long\gdef\footnotezzz{\insert\footins\bgroup
+% The start of the footnote looks usually like this:
+\gdef\startfootins{\insert\footins\bgroup}
+%
+% ... but this macro is redefined inside @multitable.
+%
+\gdef\dofootnote{%
+ \startfootins
% We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment.
% So reset some parameters.
+ \hsize=\pagewidth
\interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox
@@ -5997,12 +6266,6 @@ width0pt\relax} \fi
\footstrut
\futurelet\next\fo@t
}
-\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
- \else\let\next\f@t\fi \next}
-\def\f@@t{\bgroup\aftergroup\@foot\let\next}
-\def\f@t#1{#1\@foot}
-\def\@foot{\strut\par\egroup}
-
}%end \catcode `\@=11
% @| inserts a changebar to the left of the current line. It should
@@ -6049,8 +6312,8 @@ width0pt\relax} \fi
\openin 1 = epsf.tex
\ifeof 1 \else
\closein 1
- % Do not bother showing banner with post-v2.7 epsf.tex (available in
- % doc/epsf.tex until it shows up on ctan).
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
\def\epsfannounce{\toks0 = }%
\input epsf.tex
\fi
@@ -6089,7 +6352,7 @@ width0pt\relax} \fi
\nobreak\bigskip
% Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space
- % above and below.
+ % above and below.
\nobreak\vskip\parskip
\nobreak
\line\bgroup\hss
@@ -6177,7 +6440,7 @@ should work if nowhere else does.}
% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
% physical page width.
-%
+%
% We also call \setleading{\textleading}, so the caller should define
% \textleading. The caller should also set \parskip.
%
@@ -6211,15 +6474,6 @@ should work if nowhere else does.}
\setemergencystretch
}
-% Use `small' versions.
-%
-\def\smallenvironments{%
- \let\smalldisplay = \smalldisplayx
- \let\smallexample = \smalllispx
- \let\smallformat = \smallformatx
- \let\smalllisp = \smalllispx
-}
-
% @letterpaper (the default).
\def\letterpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
@@ -6247,7 +6501,6 @@ should work if nowhere else does.}
\hfuzz = 1pt
\contentsrightmargin = 0pt
\defbodyindent = .5cm
- \smallenvironments
}}
% Use @afourpaper to print on European A4 paper.
@@ -6255,7 +6508,7 @@ should work if nowhere else does.}
\parskip = 3pt plus 2pt minus 1pt
\textleading = 13.2pt
%
- % Double-side printing via postscript on Laserjet 4050
+ % Double-side printing via postscript on Laserjet 4050
% prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
% To change the settings for a different printer or situation, adjust
% \normaloffset until the front-side and back-side texts align. Then
@@ -6294,11 +6547,9 @@ should work if nowhere else does.}
\contentsrightmargin = 0pt
\defbodyindent = 2mm
\tableindent = 12mm
- %
- \smallenvironments
}}
-% A specific text layout, 24x15cm overall, intended for A4 paper.
+% A specific text layout, 24x15cm overall, intended for A4 paper.
\def\afourlatex{{\globaldefs = 1
\afourpaper
\internalpagesizes{237mm}{150mm}%
@@ -6406,7 +6657,7 @@ should work if nowhere else does.}
\catcode`\_=\active
\def_{\ifusingtt\normalunderscore\_}
% Subroutine for the previous macro.
-\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
\catcode`\|=\active
\def|{{\tt\char124}}
@@ -6420,8 +6671,6 @@ should work if nowhere else does.}
\def+{{\tt \char 43}}
\catcode`\$=\active
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
-%\catcode 27=\active
-%\def^^[{$\diamondsuit$}
% Set up an active definition for =, but don't enable it most of the time.
{\catcode`\==\active
@@ -6438,35 +6687,45 @@ should work if nowhere else does.}
\catcode`\@=0
-% \rawbackslashxx output one backslash character in current font
+% \rawbackslashxx outputs one backslash character in current font,
+% as in \char`\\.
\global\chardef\rawbackslashxx=`\\
-%{\catcode`\\=\other
-%@gdef@rawbackslashxx{\}}
-% \rawbackslash redefines \ as input to do \rawbackslashxx.
+% \rawbackslash defines an active \ to do \rawbackslashxx.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.
{\catcode`\\=\active
-@gdef@rawbackslash{@let\=@rawbackslashxx }}
+ @gdef@rawbackslash{@let\=@rawbackslashxx}
+ @gdef@otherbackslash{@let\=@realbackslash}
+}
+
+% \realbackslash is an actual character `\' with catcode other.
+{\catcode`\\=\other @gdef@realbackslash{\}}
% \normalbackslash outputs one backslash in fixed width font.
\def\normalbackslash{{\tt\rawbackslashxx}}
-% \catcode 17=0 % Define control-q
\catcode`\\=\active
% Used sometimes to turn off (effectively) the active characters
% even after parsing them.
-@def@turnoffactive{@let"=@normaldoublequote
-@let\=@realbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus
-@let$=@normaldollar}%$ font-lock fix
-
-% Same as @turnoffactive except for \.
+@def@turnoffactive{%
+ @let"=@normaldoublequote
+ @let\=@realbackslash
+ @let~=@normaltilde
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let<=@normalless
+ @let>=@normalgreater
+ @let+=@normalplus
+ @let$=@normaldollar %$ font-lock fix
+}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'. (Thus, \ is not expandable when this is in
+% effect.)
+%
@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
% Make _ and + \other characters, temporarily.
@@ -6495,7 +6754,7 @@ should work if nowhere else does.}
% Say @foo, not \foo, in error messages.
@escapechar = `@@
-% These look ok in all fonts, so just make them not special.
+% These look ok in all fonts, so just make them not special.
@catcode`@& = @other
@catcode`@# = @other
@catcode`@% = @other
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 620a19955e1..ab2efa4d739 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -268,6 +268,10 @@ requirements.
Necessary to uncompress GCC @command{tar} files when source code is
obtained via FTP mirror sites.
+@item GNU make version 3.79.1 (or later)
+
+You must have GNU make installed to build GCC.
+
@item GNU tar version 1.12 (or later)
Necessary (only on some platforms) to untar the source code. Many
@@ -540,8 +544,8 @@ beneath a user's home directory tree, some shells will not expand
@var{dirname} correctly if it contains the @samp{~} metacharacter; use
@env{$HOME} instead.
-These additional options control where certain parts of the distribution
-are installed. Normally you should not need to use these options.
+The following standard @command{autoconf} options are supported. Normally you
+should not need to use these options.
@table @code
@item --exec-prefix=@var{dirname}
Specify the toplevel installation directory for architecture-dependent
@@ -554,7 +558,11 @@ Specify the installation directory for the executables called by users
@item --libdir=@var{dirname}
Specify the installation directory for object code libraries and
-internal parts of GCC@. The default is @file{@var{exec-prefix}/lib}.
+internal data files of GCC@. The default is @file{@var{exec-prefix}/lib}.
+
+@item --libexecdir=@var{dirname}
+Specify the installation directory for internal executables of GCC@.
+ The default is @file{@var{exec-prefix}/libexec}.
@item --with-slibdir=@var{dirname}
Specify the installation directory for the shared libgcc library. The
@@ -734,7 +742,7 @@ The following systems are the only ones where it makes a difference
whether you use the GNU assembler. On any other system,
@option{--with-gnu-as} has no effect.
-@itemize bullet
+@itemize @bullet
@item @samp{hppa1.0-@var{any}-@var{any}}
@item @samp{hppa1.1-@var{any}-@var{any}}
@item @samp{i386-@var{any}-sysv}
@@ -759,13 +767,14 @@ than the one found by the standard rules to find an assembler, which
are:
@itemize @bullet
@item
-Check the
-@file{@var{exec_prefix}/lib/gcc-lib/@var{target}/@var{version}}
-directory, where @var{exec_prefix} defaults to @var{prefix} which
-defaults to @file{/usr/local} unless overridden by the
-@option{--prefix=@var{pathname}} switch described above. @var{target} is the
-target system triple, such as @samp{sparc-sun-solaris2.7}, and
-@var{version} denotes the GCC version, such as 3.0.
+Check the @file{@var{libexec}/gcc/@var{target}/@var{version}}
+directory, where @var{libexec} defaults to
+@file{@var{exec-prefix}/libexec} and @var{exec-prefix} defaults to
+@var{prefix} which defaults to @file{/usr/local} unless overridden by
+the @option{--prefix=@var{pathname}} switch described
+above. @var{target} is the target system triple, such as
+@samp{sparc-sun-solaris2.7}, and @var{version} denotes the GCC
+version, such as 3.0.
@item
Check operating system specific directories (e.g.@: @file{/usr/ccs/bin} on
Sun Solaris 2).
@@ -952,9 +961,9 @@ to do so.
@item --enable-version-specific-runtime-libs
Specify
that runtime libraries should be installed in the compiler specific
-subdirectory (@file{@var{libsubdir}}) rather than the usual places. In
-addition, @samp{libstdc++}'s include files will be installed in
-@file{@var{libsubdir}/include/g++} unless you overruled it by using
+subdirectory (@file{@var{libdir}/gcc}) rather than the usual places. In
+addition, @samp{libstdc++}'s include files will be installed into
+@file{@var{libdir}} unless you overruled it by using
@option{--with-gxx-include-dir=@var{dirname}}. Using this option is
particularly useful if you intend to use several versions of GCC in
parallel. This is currently supported by @samp{libf2c} and
@@ -1037,10 +1046,12 @@ compiler and may only work properly if you are building the compiler
with GCC@. This is on by default when building from CVS or snapshots,
but off for releases. More control over the checks may be had by
specifying @var{list}; the categories of checks available are
-@samp{misc}, @samp{tree}, @samp{gc}, @samp{rtl}, @samp{rtlflag} and
-@samp{gcac}. The
-default when @var{list} is not specified is @samp{misc,tree,gc,rtlflag}; the
-checks @samp{rtl} and @samp{gcac} are very expensive.
+@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
+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}
@@ -1116,6 +1127,14 @@ building a cross compiler, if @file{@var{prefix}/@var{target}/sys-include}
doesn't pre-exist. If @file{@var{prefix}/@var{target}/sys-include} does
pre-exist, the @var{dir} argument may be omitted. @command{fixincludes}
will be run on these files to make them compatible with GCC.
+
+@item --without-headers
+Tells GCC not use any target headers from a libc when building a cross
+compiler. When crossing to GNU/Linux, you need the headers so gcc
+can build the exception handling for libgcc.
+See @uref{http://www.objsw.com/CrossGCC/,,CrossGCC} for more information
+on this option.
+
@item --with-libs
@itemx --with-libs=``@var{dir1} @var{dir2} @dots{} @var{dirN}''
Deprecated in favor of @option{--with-sysroot}.
@@ -1437,8 +1456,8 @@ These are part of the full distribution, but if you downloaded the
separately.
Second, you must have the testing tools installed. This includes
-@uref{http://www.gnu.org/software/dejagnu/,,DejaGnu} 1.4.2 (or later),
-Tcl, and Expect; the DejaGnu site has links to these.
+@uref{http://www.gnu.org/software/dejagnu/,,DejaGnu} 1.4.1 or 1.4.3
+and later, Tcl, and Expect; the DejaGnu site has links to these.
If the directories where @command{runtest} and @command{expect} were
installed are not in the @env{PATH}, you may need to set the following
@@ -1495,12 +1514,82 @@ To get a list of the possible @file{*.exp} files, pipe the
output of @samp{make check} into a file and look at the
@samp{Running @dots{} .exp} lines.
+@section Passing options and running multiple testsuites
+
+You can pass multiple options to the testsuite using the
+@samp{--target_board} option of DejaGNU, either passed as part of
+@samp{RUNTESTFLAGS}, or directly to @command{runtest} if you prefer to
+work outside the makefiles. For example,
+
+@example
+ make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fno-strength-reduce"
+@end example
+
+will run the standard @command{g++} testsuites (``unix'' is the target name
+for a standard native testsuite situation), passing
+@samp{-O3 -fno-strength-reduce} to the compiler on every test, i.e.,
+slashes separate options.
+
+You can run the testsuites multiple times using combinations of options
+with a syntax similar to the brace expansion of popular shells:
+
+@example
+ @dots{}"--target_board=arm-sim@{-mhard-float,-msoft-float@}@{-O1,-O2,-O3,@}"
+@end example
+
+(Note the empty option caused by the trailing comma in the final group.)
+The following will run each testsuite eight times using the @samp{arm-sim}
+target, as if you had specified all possible combinations yourself:
+
+@example
+ --target_board=arm-sim/-mhard-float/-O1
+ --target_board=arm-sim/-mhard-float/-O2
+ --target_board=arm-sim/-mhard-float/-O3
+ --target_board=arm-sim/-mhard-float
+ --target_board=arm-sim/-msoft-float/-O1
+ --target_board=arm-sim/-msoft-float/-O2
+ --target_board=arm-sim/-msoft-float/-O3
+ --target_board=arm-sim/-msoft-float
+@end example
+
+They can be combined as many times as you wish, in arbitrary ways. This
+list:
+
+@example
+ @dots{}"--target_board=unix/-Wextra@{-O3,-fno-strength-reduce@}@{-fomit-frame-pointer,@}"
+@end example
+
+will generate four combinations, all involving @samp{-Wextra}.
+
+The disadvantage to this method is that the testsuites are run in serial,
+which is a waste on multiprocessor systems. For users with GNU Make and
+a shell which performs brace expansion, you can run the testsuites in
+parallel by having the shell perform the combinations and @command{make}
+do the parallel runs. Instead of using @samp{--target_board}, use a
+special makefile target:
+
+@example
+ make -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{option2}/@dots{}
+@end example
+
+For example,
+
+@example
+ make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
+@end example
+
+will run three concurrent ``make-gcc'' testsuites, eventually testing all
+ten combinations as described above. Note that this is currently only
+supported in the @file{gcc} subdirectory. (To see how this works, try
+typing @command{echo} before the example given here.)
+
+
+@section Additional testing for Java Class Libraries
+
The Java runtime tests can be executed via @samp{make check}
in the @file{@var{target}/libjava/testsuite} directory in
the build tree.
-@section Additional testing for Java Class Libraries
-
The @uref{http://sources.redhat.com/mauve/,,Mauve Project} provides
a suite of tests for the Java Class Libraries. This suite can be run
as part of libgcj testing by placing the Mauve tree within the libjava
@@ -1589,15 +1678,17 @@ We strongly recommend to install into a target directory where there is
no previous version of GCC present.
That step completes the installation of GCC; user level binaries can
-be found in @file{@var{prefix}/bin} where @var{prefix} is the value you
-specified with the @option{--prefix} to configure (or @file{/usr/local}
-by default). (If you specified @option{--bindir}, that directory will
-be used instead; otherwise, if you specified @option{--exec-prefix},
-@file{@var{exec-prefix}/bin} will be used.) Headers for the C++ and
-Java libraries are installed in @file{@var{prefix}/include}; libraries
-in @file{@var{libdir}} (normally @file{@var{prefix}/lib}); internal
-parts of the compiler in @file{@var{libdir}/gcc-lib}; documentation in
-info format in @file{@var{infodir}} (normally @file{@var{prefix}/info}).
+be found in @file{@var{prefix}/bin} where @var{prefix} is the value
+you specified with the @option{--prefix} to configure (or
+@file{/usr/local} by default). (If you specified @option{--bindir},
+that directory will be used instead; otherwise, if you specified
+@option{--exec-prefix}, @file{@var{exec-prefix}/bin} will be used.)
+Headers for the C++ and Java libraries are installed in
+@file{@var{prefix}/include}; libraries in @file{@var{libdir}}
+(normally @file{@var{prefix}/lib}); internal parts of the compiler in
+@file{@var{libdir}/gcc} and @file{@var{libexecdir}/gcc}; documentation
+in info format in @file{@var{infodir}} (normally
+@file{@var{prefix}/info}).
When installing cross-compilers, GCC's executables
are not only installed into @file{@var{bindir}}, that
@@ -1883,10 +1974,14 @@ GNU Compiler Collection on your machine.
@item
@uref{#ia64-*-linux,,ia64-*-linux}
@item
+@uref{#ia64-*-hpux*,,ia64-*-hpux*}
+@item
@uref{#*-ibm-aix*,,*-ibm-aix*}
@item
@uref{#ip2k-*-elf,,ip2k-*-elf}
@item
+@uref{#iq2000-*-elf,,iq2000-*-elf}
+@item
@uref{#m32r-*-elf,,m32r-*-elf}
@item
@uref{#m6811-elf,,m6811-elf}
@@ -2018,9 +2113,6 @@ As of GNU binutils 2.11.2, neither GNU @command{as} nor GNU @command{ld}
are supported on Tru64 UNIX, so you must not configure GCC with
@option{--with-gnu-as} or @option{--with-gnu-ld}.
-The @option{--enable-threads} options isn't supported yet. A patch is
-in preparation for a future release.
-
GCC writes a @samp{.verstamp} directive to the assembler output file
unless it is built as a cross-compiler. It gets the version to use from
the system header file @file{/usr/include/stamp.h}. If you install a
@@ -2256,7 +2348,7 @@ The version of binutils installed in @file{/usr/bin} is known to work unless
otherwise specified in any per-architecture notes. However, binutils
2.12.1 or greater is known to improve overall testsuite results.
-FreeBSD 1 is no longer supported.
+Support for FreeBSD 1 was discontinued in GCC 3.2.
For FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All
configuration support and files as shipped with GCC 2.95 are still in
@@ -2309,7 +2401,7 @@ longer a multiple of 2 bytes.
<hr />
@end html
@heading @anchor{hppa*-hp-hpux*}hppa*-hp-hpux*
-HP-UX version 9 or older is no longer supported.
+Support for HP-UX version 9 and older was discontinued in GCC 3.4.
We @emph{highly} recommend using gas/binutils 2.8 or newer on all hppa
platforms; you may encounter a variety of problems when using the HP
@@ -2504,7 +2596,8 @@ GNU systems. This configuration is being superseded.
@end html
@heading @anchor{ix86-*-linux*}i?86-*-linux*
-You will need binutils 2.9.1.0.15 or newer for exception handling to work.
+As of GCC 3.3, binutils 2.13.1 or later is required for this platform.
+See @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information.
If you receive Signal 11 errors when building on GNU/Linux, then it is
possible you have a hardware problem. Further information on this can be
@@ -2608,10 +2701,22 @@ more major ABI changes are expected.
@html
<hr />
+@end html
+@heading @anchor{ia64-*-hpux*}ia64-*-hpux*
+Building GCC on this target requires the GNU Assembler. The bundled HP
+assembler will not work. To prevent GCC from using the wrong assembler,
+the option @option{--with-gnu-as} may be necessary.
+
+The GCC libunwind library has not been ported to HPUX. This means that for
+GCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions}
+is required to build GCC. For GCC 3.3 and later, this is the default.
+
+@html
+<hr />
<!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
@end html
@heading @anchor{*-ibm-aix*}*-ibm-aix*
-AIX version 3 or older is no longer supported.
+Support for AIX version 3 and older was discontinued in GCC 3.4.
AIX Make frequently has problems with GCC makefiles. GNU Make 3.79.1 or
newer is recommended to build on this platform.
@@ -2730,6 +2835,13 @@ Use @samp{configure --target=ip2k-elf --enable-languages=c} to configure GCC@.
@html
<hr />
@end html
+@heading @anchor{iq2000-*-elf}iq2000-*-elf
+Vitesse IQ2000 processors. These are used in embedded
+applications. There are no standard Unix configurations.
+
+@html
+<hr />
+@end html
@heading @anchor{m32r-*-elf}m32r-*-elf
Renesas M32R processor.
This configuration is intended for embedded systems.
@@ -3079,8 +3191,17 @@ GCC you first have to install a pre-built compiler, see our
The Solaris 2 @command{/bin/sh} will often fail to configure
@file{libstdc++-v3}, @file{boehm-gc} or @file{libjava}. We therefore
-recommend to set @env{CONFIG_SHELL} to @command{/bin/ksh} in your
-environment.
+recommend to use the following sequence of commands to bootstrap and
+install GCC:
+
+@smallexample
+ % CONFIG_SHELL=/bin/ksh
+ % export CONFIG_SHELL
+@end smallexample
+
+and then proceed as described in @uref{build.html,,the build instructions},
+where we strongly recommend using GNU make and specifying an absolute path
+to invoke @var{srcdir}/configure.
Solaris 2 comes with a number of optional OS packages. Some of these
are needed to use GCC fully, namely @code{SUNWarc},
@@ -3099,6 +3220,10 @@ Trying to use the linker and other tools in
For example, the linker may hang indefinitely. The fix is to remove
@file{/usr/ucb} from your @env{PATH}.
+The build process works more smoothly with the legacy Sun tools so, if you
+have @file{/usr/xpg4/bin} in your @env{PATH}, we recommend that you place
+@file{/usr/bin} before @file{/usr/xpg4/bin} for the duration of the build.
+
All releases of GNU binutils prior to 2.11.2 have known bugs on this
platform. We recommend the use of GNU binutils 2.11.2 or the vendor
tools (Sun @command{as}, Sun @command{ld}).
@@ -3175,7 +3300,7 @@ back it out.
@item
Copy the original, unpatched Solaris 7
@command{/usr/ccs/bin/as} into
-@command{/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.1/as},
+@command{/usr/local/libexec/gcc/sparc-sun-solaris2.7/3.4/as},
adjusting the latter name to fit your local conventions and software
version numbers.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 79f57af8a7b..5bfef420cbc 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -183,7 +183,7 @@ in the following sections.
-fno-nonansi-builtins -fno-operator-names @gol
-fno-optional-diags -fpermissive @gol
-frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol
--fuse-cxa-atexit -fvtable-gc -fno-weak -nostdinc++ @gol
+-fuse-cxa-atexit -fno-weak -nostdinc++ @gol
-fno-default-inline -Wabi -Wctor-dtor-privacy @gol
-Wnon-virtual-dtor -Wreorder @gol
-Weffc++ -Wno-deprecated @gol
@@ -193,8 +193,14 @@ in the following sections.
@item Objective-C Language Options
@xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}.
-@gccoptlist{-fconstant-string-class=@var{class-name} @gol
--fgnu-runtime -fnext-runtime -gen-decls @gol
+@gccoptlist{
+-fconstant-string-class=@var{class-name} @gol
+-fgnu-runtime -fnext-runtime @gol
+-fno-nil-receivers @gol
+-fobjc-exceptions @gol
+-freplace-objc-classes @gol
+-fzero-link @gol
+-gen-decls @gol
-Wno-protocol -Wselector -Wundeclared-selector}
@item Language Independent Options
@@ -208,19 +214,18 @@ in the following sections.
-w -Wextra -Wall -Waggregate-return @gol
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
-Wconversion -Wno-deprecated-declarations @gol
--Wdisabled-optimization -Wno-div-by-zero -Werror @gol
+-Wdisabled-optimization -Wno-div-by-zero -Wendif-labels @gol
+-Werror -Werror-implicit-function-declaration @gol
-Wfloat-equal -Wformat -Wformat=2 @gol
--Wformat-nonliteral -Wformat-security @gol
--Wimplicit -Wimplicit-int @gol
--Wimplicit-function-declaration @gol
--Werror-implicit-function-declaration @gol
--Wimport -Winline -Winvalid-pch -Wno-endif-labels @gol
--Wno-invalid-offsetof @gol
+-Wno-format-extra-args -Wformat-nonliteral @gol
+-Wformat-security -Wno-format-y2k @gol
+-Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol
+-Wimport -Wno-import -Winit-self -Winline @gol
+-Wno-invalid-offsetof -Winvalid-pch @gol
-Wlarger-than-@var{len} -Wlong-long @gol
-Wmain -Wmissing-braces @gol
-Wmissing-format-attribute -Wmissing-noreturn @gol
--Wno-multichar -Wno-format-extra-args -Wno-format-y2k @gol
--Wno-import -Wnonnull -Wpacked -Wpadded @gol
+-Wno-multichar -Wnonnull -Wpacked -Wpadded @gol
-Wparentheses -Wpointer-arith -Wredundant-decls @gol
-Wreturn-type -Wsequence-point -Wshadow @gol
-Wsign-compare -Wstrict-aliasing @gol
@@ -232,8 +237,9 @@ in the following sections.
@item C-only Warning Options
@gccoptlist{-Wbad-function-cast -Wmissing-declarations @gol
--Wmissing-prototypes -Wnested-externs @gol
--Wstrict-prototypes -Wtraditional}
+-Wmissing-prototypes -Wnested-externs -Wold-style-definition @gol
+-Wstrict-prototypes -Wtraditional @gol
+-Wdeclaration-after-statement}
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@@ -279,7 +285,7 @@ in the following sections.
-freduce-all-givs -fregmove -frename-registers @gol
-freorder-blocks -freorder-functions @gol
-frerun-cse-after-loop -frerun-loop-opt @gol
--fschedule-insns -fschedule-insns2 @gol
+-frounding-math -fschedule-insns -fschedule-insns2 @gol
-fno-sched-interblock -fno-sched-spec -fsched-spec-load @gol
-fsched-spec-load-dangerous -fsched2-use-superblocks @gol
-fsched2-use-traces -fsignaling-nans @gol
@@ -300,7 +306,8 @@ in the following sections.
-include @var{file} -imacros @var{file} @gol
-iprefix @var{file} -iwithprefix @var{dir} @gol
-iwithprefixbefore @var{dir} -isystem @var{dir} @gol
--M -MM -MF -MG -MP -MQ -MT -nostdinc -P -remap @gol
+-M -MM -MF -MG -MP -MQ -MT -nostdinc @gol
+-P -fworking-directory -remap @gol
-trigraphs -undef -U@var{macro} -Wp,@var{option} @gol
-Xpreprocessor @var{option}}
@@ -350,7 +357,7 @@ in the following sections.
-mapp-regs -mbroken-saverestore -mcypress @gol
-mfaster-structs -mflat @gol
-mfpu -mhard-float -mhard-quad-float @gol
--mimpure-text -mlive-g0 -mno-app-regs @gol
+-mimpure-text -mlittle-endian -mlive-g0 -mno-app-regs @gol
-mno-faster-structs -mno-flat -mno-fpu @gol
-mno-impure-text -mno-stack-bias -mno-unaligned-doubles @gol
-msoft-float -msoft-quad-float -msparclite -mstack-bias @gol
@@ -386,6 +393,7 @@ in the following sections.
@emph{MN10300 Options}
@gccoptlist{-mmult-bug -mno-mult-bug @gol
-mam33 -mno-am33 @gol
+-mam33-2 -mno-am33-2 @gol
-mno-crt0 -mrelax}
@emph{M32R/D Options}
@@ -444,7 +452,7 @@ in the following sections.
-force_flat_namespace -headerpad_max_install_names @gol
-image_base -init -install_name -keep_private_externs @gol
-multi_module -multiply_defined -multiply_defined_unused @gol
--noall_load -nomultidefs -noprebind -noseglinkedit @gol
+-noall_load -nofixprebinding -nomultidefs -noprebind -noseglinkedit @gol
-pagezero_size -prebind -prebind_all_twolevel_modules @gol
-private_bundle -read_only_relocs -sectalign @gol
-sectobjectsymbols -whyload -seg1addr @gol
@@ -468,7 +476,7 @@ in the following sections.
-mgas -mgp32 -mgp64 -mhard-float -mint64 -mips1 @gol
-mips2 -mips3 -mips4 -mips32 -mips32r2 -mips64 @gol
-mlong64 -mlong32 -mlong-calls -mmemcpy @gol
--mmips-as -mmips-tfile -mno-abicalls @gol
+-mmips-as -mmips-tfile -mno-abicalls -mxgot @gol
-mno-embedded-data -mno-uninit-const-in-rodata @gol
-mno-embedded-pic -mno-long-calls @gol
-mno-memcpy -mno-mips-tfile -mno-rnames @gol
@@ -476,7 +484,8 @@ in the following sections.
-m4650 -msingle-float -mmad @gol
-EL -EB -G @var{num} -nocpp @gol
-mabi=32 -mabi=n32 -mabi=64 -mabi=eabi -mabi-fake-default @gol
--mfix7000 -mno-crt0 -mflush-func=@var{func} -mno-flush-func @gol
+-mfix7000 -mfix-sb1 -mno-fix-sb1 @gol
+-mno-crt0 -mflush-func=@var{func} -mno-flush-func @gol
-mbranch-likely -mno-branch-likely}
@emph{i386 and x86-64 Options}
@@ -567,6 +576,7 @@ in the following sections.
-mtda=@var{n} -msda=@var{n} -mzda=@var{n} @gol
-mapp-regs -mno-app-regs @gol
-mdisable-callt -mno-disable-callt @gol
+-mv850e1 @gol
-mv850e @gol
-mv850 -mbig-switch}
@@ -632,19 +642,7 @@ in the following sections.
@gccoptlist{-msim}
@emph{Xtensa Options}
-@gccoptlist{-mbig-endian -mlittle-endian @gol
--mdensity -mno-density @gol
--mconst16 -mno-const16 @gol
--mabs -mno-abs @gol
--maddx -mno-addx @gol
--mmac16 -mno-mac16 @gol
--mmul16 -mno-mul16 @gol
--mmul32 -mno-mul32 @gol
--mnsa -mno-nsa @gol
--mminmax -mno-minmax @gol
--msext -mno-sext @gol
--mbooleans -mno-booleans @gol
--mhard-float -msoft-float @gol
+@gccoptlist{-mconst16 -mno-const16 @gol
-mfused-madd -mno-fused-madd @gol
-mtext-section-literals -mno-text-section-literals @gol
-mtarget-align -mno-target-align @gol
@@ -709,10 +707,12 @@ in the following sections.
@section Options Controlling the Kind of Output
Compilation can involve up to four stages: preprocessing, compilation
-proper, assembly and linking, always in that order. The first three
-stages apply to an individual source file, and end by producing an
-object file; linking combines all the object files (those newly
-compiled, and those specified as input) into an executable file.
+proper, assembly and linking, always in that order. GCC is capable of
+preprocessing and compiling several files either into several
+assembler input files, or into one assembler input file; then each
+assembler input file produces an object file, and linking combines all
+the object files (those newly compiled, and those specified as input)
+into an executable file.
@cindex file name suffix
For any given input file, the file name suffix determines what kind of
@@ -884,9 +884,9 @@ Place output in file @var{file}. This applies regardless to whatever
sort of output is being produced, whether it be an executable file,
an object file, an assembler file or preprocessed C code.
-Since only one output file can be specified, it does not make sense to
-use @option{-o} when compiling more than one input file, unless you are
-producing an executable file as output.
+If you specify @option{-o} when compiling more than one input file, or
+you are producing an executable file as output, all the source files
+on the command line will be compiled at once.
If @option{-o} is not specified, the default is to put an executable file
in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
@@ -1413,10 +1413,9 @@ a name having multiple meanings within a class.
@item -fpermissive
@opindex fpermissive
-Downgrade messages about nonconformant code from errors to warnings. By
-default, G++ effectively sets @option{-pedantic-errors} without
-@option{-pedantic}; this option reverses that. This behavior and this
-option are superseded by @option{-pedantic}, which works as it does for GNU C@.
+Downgrade some diagnostics about nonconformant code from errors to
+warnings. Thus, using @option{-fpermissive} will allow some
+nonconforming code to compile.
@item -frepo
@opindex frepo
@@ -1453,17 +1452,6 @@ This option is required for fully standards-compliant handling of static
destructors, but will only work if your C library supports
@code{__cxa_atexit}.
-@item -fvtable-gc
-@opindex fvtable-gc
-Emit special relocations for vtables and virtual function references
-so that the linker can identify unused virtual functions and zero out
-vtable slots that refer to them. This is most useful with
-@option{-ffunction-sections} and @option{-Wl,--gc-sections}, in order to
-also discard the functions themselves.
-
-This optimization requires GNU as and GNU ld. Not all systems support
-this option. @option{-Wl,--gc-sections} is ignored without @option{-static}.
-
@item -fno-weak
@opindex fno-weak
Do not use weak symbol support, even if it is provided by the linker.
@@ -1591,14 +1579,14 @@ Instantiations of these templates may be mangled incorrectly.
@item -Wctor-dtor-privacy @r{(C++ only)}
@opindex Wctor-dtor-privacy
-Warn when a class seems unusable, because all the constructors or
-destructors in a class are private and the class has no friends or
+Warn when a class seems unusable because all the constructors or
+destructors in that class are private, and it has neither friends nor
public static member functions.
@item -Wnon-virtual-dtor @r{(C++ only)}
@opindex Wnon-virtual-dtor
-Warn when a class declares a non-virtual destructor that should probably
-be virtual, because it looks like the class will be used polymorphically.
+Warn when a class appears to be polymorphic, thereby requiring a virtual
+destructor, yet it declares a non-virtual one.
This warning is enabled by @option{-Wall}.
@item -Wreorder @r{(C++ only)}
@@ -1616,9 +1604,9 @@ struct A @{
@};
@end smallexample
-Here the compiler will warn that the member initializers for @samp{i}
-and @samp{j} will be rearranged to match the declaration order of the
-members. This warning is enabled by @option{-Wall}.
+The compiler will rearrange the member initializers for @samp{i}
+and @samp{j} to match the declaration order of the members, emitting
+a warning to that effect. This warning is enabled by @option{-Wall}.
@end table
The following @option{-W@dots{}} options are not affected by @option{-Wall}.
@@ -1648,8 +1636,8 @@ Item 23: Don't try to return a reference when you must return an object.
@end itemize
-and about violations of the following style guidelines from Scott Meyers'
-@cite{More Effective C++} book:
+Also warn about violations of the following style guidelines from
+Scott Meyers' @cite{More Effective C++} book:
@itemize @bullet
@item
@@ -1661,8 +1649,8 @@ Item 7: Never overload @code{&&}, @code{||}, or @code{,}.
@end itemize
-If you use this option, you should be aware that the standard library
-headers do not obey all of these guidelines; you can use @samp{grep -v}
+When selecting this option, be aware that the standard library
+headers do not obey all of these guidelines; use @samp{grep -v}
to filter out those warnings.
@item -Wno-deprecated @r{(C++ only)}
@@ -1672,7 +1660,7 @@ Do not warn about usage of deprecated features. @xref{Deprecated Features}.
@item -Wno-non-template-friend @r{(C++ only)}
@opindex Wno-non-template-friend
Disable warnings when non-templatized friend functions are declared
-within a template. With the advent of explicit template specification
+within a template. Since the advent of explicit template specification
support in G++, if the name of the friend is an unqualified-id (i.e.,
@samp{friend foo(int)}), the C++ language specification demands that the
friend declare or define an ordinary, nontemplate function. (Section
@@ -1680,7 +1668,7 @@ friend declare or define an ordinary, nontemplate function. (Section
could be interpreted as a particular specialization of a templatized
function. Because this non-conforming behavior is no longer the default
behavior for G++, @option{-Wnon-template-friend} allows the compiler to
-check existing code for potential trouble spots, and is on by default.
+check existing code for potential trouble spots and is on by default.
This new compiler behavior can be turned off with
@option{-Wno-non-template-friend} which keeps the conformant compiler code
but disables the helpful warning.
@@ -1690,7 +1678,7 @@ but disables the helpful warning.
Warn if an old-style (C-style) cast to a non-void type is used within
a C++ program. The new-style casts (@samp{static_cast},
@samp{reinterpret_cast}, and @samp{const_cast}) are less vulnerable to
-unintended effects, and much easier to grep for.
+unintended effects and much easier to search for.
@item -Woverloaded-virtual @r{(C++ only)}
@opindex Woverloaded-virtual
@@ -1710,7 +1698,7 @@ struct B: public A @{
@end smallexample
the @code{A} class version of @code{f} is hidden in @code{B}, and code
-like this:
+like:
@smallexample
B* b;
@@ -1727,7 +1715,7 @@ to a plain pointer.
@item -Wsign-promo @r{(C++ only)}
@opindex Wsign-promo
Warn when overload resolution chooses a promotion from unsigned or
-enumeral type to a signed type over a conversion to an unsigned type of
+enumeral type to a signed type, over a conversion to an unsigned type of
the same size. Previous versions of G++ would try to preserve
unsignedness, but the standard mandates the current behavior.
@@ -1761,8 +1749,11 @@ In this example, G++ will synthesize a default @samp{A& operator =
@cindex compiler options, Objective-C
@cindex Objective-C options, command line
@cindex options, Objective-C
+(NOTE: This manual does not describe the Objective-C language itself. See
+@w{@uref{http://gcc.gnu.org/readings.html}} for references.)
+
This section describes the command-line options that are only meaningful
-for Objective-C programs; but you can also use most of the GNU compiler
+for Objective-C programs, but you can also use most of the GNU compiler
options regardless of what language your program is in. For example,
you might compile a file @code{some_class.m} like this:
@@ -1771,7 +1762,7 @@ gcc -g -fgnu-runtime -O -c some_class.m
@end example
@noindent
-In this example, only @option{-fgnu-runtime} is an option meant only for
+In this example, @option{-fgnu-runtime} is an option meant only for
Objective-C programs; you can use the other options with any language
supported by GCC@.
@@ -1783,7 +1774,11 @@ programs:
@opindex fconstant-string-class
Use @var{class-name} as the name of the class to instantiate for each
literal string specified with the syntax @code{@@"@dots{}"}. The default
-class name is @code{NXConstantString}.
+class name is @code{NXConstantString} if the GNU runtime is being used, and
+@code{NSConstantString} if the NeXT runtime is being used (see below). The
+@option{-fconstant-cfstrings} option, if also present, will override the
+@option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
+to be laid out as constant CoreFoundation strings.
@item -fgnu-runtime
@opindex fgnu-runtime
@@ -1797,6 +1792,117 @@ for NeXT-based systems, including Darwin and Mac OS X@. The macro
@code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
used.
+@item -fno-nil-receivers
+@opindex -fno-nil-receivers
+Assume that all Objective-C message dispatches (e.g.,
+@code{[receiver message:arg]}) in this translation unit ensure that the receiver
+is not @code{nil}. This allows for more efficient entry points in the runtime to be
+used. Currently, this option is only available in conjunciton with
+the NeXT runtime on Mac OS X 10.3 and later.
+
+@item -fobjc-exceptions
+@opindex -fobjc-exceptions
+Enable syntactic support for structured exception handling in Objective-C,
+similar to what is offered by C++ and Java. Currently, this option is only
+available in conjunciton with the NeXT runtime on Mac OS X 10.3 and later.
+
+@smallexample
+ @@try @{
+ @dots{}
+ @@throw expr;
+ @dots{}
+ @}
+ @@catch (AnObjCClass *exc) @{
+ @dots{}
+ @@throw expr;
+ @dots{}
+ @@throw;
+ @dots{}
+ @}
+ @@catch (AnotherClass *exc) @{
+ @dots{}
+ @}
+ @@catch (id allOthers) @{
+ @dots{}
+ @}
+ @@finally @{
+ @dots{}
+ @@throw expr;
+ @dots{}
+ @}
+@end smallexample
+
+The @code{@@throw} statement may appear anywhere in an Objective-C or
+Objective-C++ program; when used inside of a @code{@@catch} block, the
+@code{@@throw} may appear without an argument (as shown above), in which case
+the object caught by the @code{@@catch} will be rethrown.
+
+Note that only (pointers to) Objective-C objects may be thrown and
+caught using this scheme. When an object is thrown, it will be caught
+by the nearest @code{@@catch} clause capable of handling objects of that type,
+analogously to how @code{catch} blocks work in C++ and Java. A
+@code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
+any and all Objective-C exceptions not caught by previous @code{@@catch}
+clauses (if any).
+
+The @code{@@finally} clause, if present, will be executed upon exit from the
+immediately preceding @code{@@try @dots{} @@catch} section. This will happen
+regardless of whether any exceptions are thrown, caught or rethrown
+inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
+of the @code{finally} clause in Java.
+
+There are several caveats to using the new exception mechanism:
+
+@itemize @bullet
+@item
+Although currently designed to be binary compatible with @code{NS_HANDLER}-style
+idioms provided by the @code{NSException} class, the new
+exceptions can only be used on Mac OS X 10.3 (Panther) and later
+systems, due to additional functionality needed in the (NeXT) Objective-C
+runtime.
+
+@item
+As mentioned above, the new exceptions do not support handling
+types other than Objective-C objects. Furthermore, when used from
+Objective-C++, the Objective-C exception model does not interoperate with C++
+exceptions at this time. This means you cannot @code{@@throw} an exception
+from Objective-C and @code{catch} it in C++, or vice versa
+(i.e., @code{throw @dots{} @@catch}).
+@end itemize
+
+The @option{-fobjc-exceptions} switch also enables the use of synchronization
+blocks for thread-safe execution:
+
+@smallexample
+ @@synchronized (ObjCClass *lock) @{
+ @dots{}
+ @}
+@end smallexample
+
+Unlike Java, Objective-C does not allow for entire methods to be marked
+@code{@@synchronized}. Note that throwing exceptions out of
+@code{@@synchronized} blocks is allowed, and will cause the guarding object
+to be unlocked properly.
+
+@item -freplace-objc-classes
+@opindex -freplace-objc-classes
+When compiling for the NeXT runtime, the compiler ordinarily replaces calls
+to @code{objc_getClass("@dots{}")} (when the name of the class is known at
+compile time) with static class references that get initialized at load time,
+which improves run-time performance. Specifying the
+@option{-freplace-objc-classes} flag suppresses this behavior and causes calls
+to @code{objc_getClass("@dots{}")} to be retained. This is useful in
+Fix-and-Continue debugging mode, since it allows for individual class
+implementations to be modified during program execution.
+
+@item -fzero-link
+@opindex -fzero-link
+Emit a special marker instructing @command{ld(1)} not to statically link in
+the resulting object file, and allow @command{dyld(1)} to load it in at
+run time instead. This is used in conjunction with the Zero Link debugging
+mode. Currently, this option is only available in conjunciton with
+the NeXT runtime on Mac OS X 10.3 and later.
+
@item -gen-decls
@opindex gen-decls
Dump interface declarations for all classes seen in the source file to a
@@ -1817,8 +1923,8 @@ and no warning is issued for them.
Warn if multiple methods of different types for the same selector are
found during compilation. The check is performed on the list of methods
in the final stage of compilation. Additionally, a check is performed
-that for each selector appearing in a @code{@@selector(@dots{})}
-expression, a corresponding method with that selector has been found
+for each selector appearing in a @code{@@selector(@dots{})}
+expression, and a corresponding method for that selector has been found
during compilation. Because these checks scan the method table only at
the end of compilation, these warnings are not produced if the final
stage of compilation is not reached, for example because an error is
@@ -1829,13 +1935,13 @@ being used.
@opindex Wundeclared-selector
Warn if a @code{@@selector(@dots{})} expression referring to an
undeclared selector is found. A selector is considered undeclared if no
-method with that name has been declared (explicitly, in an
-@code{@@interface} or @code{@@protocol} declaration, or implicitly, in
-an @code{@@implementation} section) before the
-@code{@@selector(@dots{})} expression. This option always performs its
-checks as soon as a @code{@@selector(@dots{})} expression is found
-(while @code{-Wselector} only performs its checks in the final stage of
-compilation), and so additionally enforces the coding style convention
+method with that name has been declared before the
+@code{@@selector(@dots{})} expression, either explicitly in an
+@code{@@interface} or @code{@@protocol} declaration, or implicitly in
+an @code{@@implementation} section. This option always performs its
+checks as soon as a @code{@@selector(@dots{})} expression is found,
+while @code{-Wselector} only performs its checks in the final stage of
+compilation. This also enforces the coding style convention
that methods and selectors must be declared before being used.
@c not documented because only avail via -Wp
@@ -2062,6 +2168,24 @@ requiring a non-null value by the @code{nonnull} function attribute.
@option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}. It
can be disabled with the @option{-Wno-nonnull} option.
+@item -Winit-self @r{(C, C++, and Objective-C only)}
+@opindex Winit-self
+Enable warning about uninitialized variables which are initalized with themselves.
+Note this option can only be used with the @option{-Wuninitialized} option and
+that only works with @option{-O}.
+
+For an example, the following code will not warn about i being uninitialized
+without this option:
+@smallexample
+@group
+int f()
+@{
+ int i = i;
+ return i;
+@}
+@end group
+@end smallexample
+
@item -Wimplicit-int
@opindex Wimplicit-int
Warn when a declaration does not specify a type.
@@ -2272,6 +2396,9 @@ because they require data flow information that is computed only
when optimizing. If you don't specify @option{-O}, you simply won't
get these warnings.
+If you want to warn about code which uses the uninitialized value of the
+variable in its own initializer, use the @option{-Winit-self} option.
+
These warnings occur only for variables that are candidates for
register allocation. Therefore, they do not occur for a variable that
is declared @code{volatile}, or whose address is taken, or whose size
@@ -2607,6 +2734,13 @@ because that feature is already a gcc extension and thus not relevant to
traditional C compatibility.
@end itemize
+@item -Wdeclaration-after-statement @r{(C only)}
+@opindex Wdeclaration-after-statement
+Warn when a declaration is found after a statement in a block. This
+construct, known from C++, was introduced with ISO C99 and is by default
+allowed in GCC@. It is not supported by ISO C90 and was not supported by
+GCC versions before GCC 3.0. @xref{Mixed Declarations}.
+
@item -Wundef
@opindex Wundef
Warn if an undefined identifier is evaluated in an @samp{#if} directive.
@@ -2698,6 +2832,11 @@ argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration which specifies the argument
types.)
+@item -Wold-style-definition @r{(C only)}
+@opindex Wold-style-definition
+Warn if an old-style function definition is used. A warning is given
+even if there is a previous prototype.
+
@item -Wmissing-prototypes @r{(C only)}
@opindex Wmissing-prototypes
Warn if a global function is defined without a previous prototype
@@ -3039,14 +3178,14 @@ Add code so that program flow @dfn{arcs} are instrumented. During
execution the program records how many times each branch and call is
executed and how many times it is taken or returns. When the compiled
program exits it saves this data to a file called
-@file{@var{auxname}.da} for each source file. The data may be used for
+@file{@var{auxname}.gcda} for each source file. The data may be used for
profile-directed optimizations (@option{-fbranch-probabilities}), or for
test coverage analysis (@option{-ftest-coverage}). Each object file's
@var{auxname} is generated from the name of the output file, if
explicitly specified and it is not the final executable, otherwise it is
the basename of the source file. In both cases any suffix is removed
-(e.g. @file{foo.da} for input file @file{dir/foo.c}, or
-@file{dir/foo.da} for output file specified as @option{-o dir/foo.o}).
+(e.g. @file{foo.gcda} for input file @file{dir/foo.c}, or
+@file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
@itemize
@@ -3076,7 +3215,7 @@ Control Optimization}).
@item
For test coverage analysis, use @command{gcov} to produce human readable
-information from the @file{.bbg} and @file{.da} files. Refer to the
+information from the @file{.gcno} and @file{.gcda} files. Refer to the
@command{gcov} documentation for further information.
@end itemize
@@ -3092,10 +3231,10 @@ block must be created to hold the instrumentation code.
@need 2000
@item -ftest-coverage
@opindex ftest-coverage
-Produce a graph file that the @command{gcov} code-coverage utility
+Produce a notes file that the @command{gcov} code-coverage utility
(@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
-show program coverage. Each source file's data file is called
-@file{@var{auxname}.bbg}. Refer to the @option{-fprofile-arcs} option
+show program coverage. Each source file's note file is called
+@file{@var{auxname}.gcno}. Refer to the @option{-fprofile-arcs} option
above for a description of @var{auxname} and instructions on how to
generate test coverage data. Coverage data will match the source files
more closely, if you do not optimize.
@@ -3471,6 +3610,14 @@ Turning on optimization flags makes the compiler attempt to improve
the performance and/or code size at the expense of compilation time
and possibly the ability to debug the program.
+The compiler performs optimisation based on the knowledge it has of
+the program. Using the @option{-funit-at-a-time} flag will allow the
+compiler to consider information gained from later functions in the
+file when compiling a function. Compiling multiple files at once to a
+single output file (and using @option{-funit-at-a-time}) will allow
+the compiler to use information gained from all of the files when
+compiling each of them.
+
Not all optimizations are controlled directly by a flag. Only
optimizations that have a flag are listed.
@@ -4230,8 +4377,8 @@ them to store all pertinent intermediate computations into variables.
@item -ffast-math
@opindex ffast-math
Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
-@option{-fno-trapping-math}, @option{-ffinite-math-only} and @*
-@option{-fno-signaling-nans}.
+@option{-fno-trapping-math}, @option{-ffinite-math-only},
+@option{-fno-rounding-math} and @option{-fno-signaling-nans}.
This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
@@ -4295,6 +4442,26 @@ math functions.
The default is @option{-ftrapping-math}.
+@item -frounding-math
+@opindex frounding-math
+Disable transformations and optimizations that assume default floating
+point rounding behavior. This is round-to-zero for all floating point
+to integer conversions, and round-to-nearest for all other arithmetic
+truncations. This option should be specified for programs that change
+the FP rounding mode dynamically, or that may be executed with a
+non-default rounding mode. This option disables constant folding of
+floating point expressions at compile-time (which may be affected by
+rounding mode) and arithmetic transformations that are unsafe in the
+presence of sign-dependent rounding modes.
+
+The default is @option{-fno-rounding-math}.
+
+This option is experimental and does not currently guarantee to
+disable all GCC optimizations that are affected by rounding mode.
+Future versions of gcc may provide finer control of this setting
+using C99's @code{FENV_ACCESS} pragma. This command line option
+will be used to specify the default state for @code{FENV_ACCESS}.
+
@item -fsignaling-nans
@opindex fsignaling-nans
Compile code assuming that IEEE signaling NaNs may generate user-visible
@@ -4331,7 +4498,7 @@ After running a program compiled with @option{-fprofile-arcs}
@option{-fbranch-probabilities}, to improve optimizations based on
the number of times each branch was taken. When the program
compiled with @option{-fprofile-arcs} exits it saves arc execution
-counts to a file called @file{@var{sourcename}.da} for each source
+counts to a file called @file{@var{sourcename}.gcda} for each source
file The information in this data file is very dependent on the
structure of the generated code, so you must use the same source code
and the same optimization options for both compilations.
@@ -4348,6 +4515,10 @@ exactly determine which path is taken more often.
If combined with @option{-fprofile-arcs}, it adds code so that some
data about values of expressions in the program is gathered.
+With @option{-fbranch-probabilities}, it reads back the data gathered
+from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
+notes to instructions for their later usage in optimizations.
+
@item -fnew-ra
@opindex fnew-ra
Use a graph coloring register allocator. Currently this option is meant
@@ -4362,8 +4533,9 @@ better job.
@item -funit-at-a-time
@opindex funit-at-a-time
-Parse the whole compilation unit before starting to produce code. This allows some
-extra optimizations to take place but consumes more memory.
+Parse the whole compilation unit before starting to produce code.
+This allows some extra optimizations to take place but consumes more
+memory.
@item -funroll-loops
@opindex funroll-loops
@@ -4535,7 +4707,7 @@ This number sets the maximum number of instructions (counted in gcc's
internal representation) in a single function that the tree inliner
will consider for inlining. This only affects functions declared
inline and methods implemented in a class declaration (C++).
-The default value is 100.
+The default value is 500.
@item max-inline-insns-auto
When you use @option{-finline-functions} (included in @option{-O3}),
@@ -4543,7 +4715,7 @@ a lot of functions that would otherwise not be considered for inlining
by the compiler will be investigated. To those functions, a different
(more restrictive) limit compared to functions declared inline can
be applied.
-The default value is 100.
+The default value is 150.
@item max-inline-insns
The tree inliner does decrease the allowable size for single functions
@@ -4561,6 +4733,7 @@ After exceeding the maximum number of inlined instructions by repeated
inlining, a linear function is used to decrease the allowable size
for single functions. The slope of that function is the negative
reciprocal of the number specified here.
+This parameter is ignored when @option{-funit-at-a-time} is used.
The default value is 32.
@item min-inline-insns
@@ -4568,8 +4741,27 @@ The repeated inlining is throttled more and more by the linear function
after exceeding the limit. To avoid too much throttling, a minimum for
this function is specified here to allow repeated inlining for very small
functions even when a lot of repeated inlining already has been done.
+This parameter is ignored when @option{-funit-at-a-time} is used.
The default value is 10.
+@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}.
+This parameter is usefull primarily to avoid extreme compilation time caused by non-linear
+algorithms used by the backend.
+This parameter is ignored when @option{-funit-at-a-time} is not used.
+The default value is 30000.
+
+@item large-function-growth
+Specifies maximal growth of large functtion caused by inlining in percents.
+This parameter is ignored when @option{-funit-at-a-time} is not used.
+The default value is 200.
+
+@item inline-unit-growth
+Specifies maximal overall growth of the compilation unit caused by inlining.
+This parameter is ignored when @option{-funit-at-a-time} is not used.
+The default value is 150.
+
@item max-inline-insns-rtl
For languages that use the RTL inliner (this happens at a later stage
than tree inlining), you can set the maximum allowable size (counted
@@ -4693,7 +4885,7 @@ collection to occur at every opportunity.
@itemx reorder-blocks-duplicate-feedback
Used by basic block reordering pass to decide whether to use unconditional
-branch or duplicate the code on it's destination. Code is duplicated when it's
+branch or duplicate the code on its destination. Code is duplicated when its
estimated size is smaller than this value multiplied by the estimated size of
unconditional jump in the hot spots of the program.
@@ -5044,7 +5236,7 @@ without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
For each subprogram to be run, the compiler driver first tries the
@option{-B} prefix, if any. If that name is not found, or if @option{-B}
was not specified, the driver tries two standard prefixes, which are
-@file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc-lib/}. If neither of
+@file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}. If neither of
those results in a file name that is found, the unmodified program
name is searched for using the directories specified in your
@env{PATH} environment variable.
@@ -5991,22 +6183,6 @@ this to work.
Generate output containing quad-word (long double) floating point
instructions.
-@item -mimpure-text
-@opindex mimpure-text
-@option{-mimpure-text}, used in addition to @option{-shared}, tells
-the compiler to not pass @option{-z text} to the linker when linking a
-shared object. Using this option, you can link position-dependent
-code into a shared object.
-
-@option{-mimpure-text} suppresses the ``relocations remain against
-allocatable but non-writable sections'' linker error message.
-However, the necessary relocations will trigger copy-on-write, and the
-shared object is not actually shared across processes. Instead of
-using @option{-mimpure-text}, you should compile all source code with
-@option{-fpic} or @option{-fPIC}.
-
-This option is only available on SunOS and Solaris.
-
@item -msoft-quad-float
@opindex msoft-quad-float
Generate output containing library calls for quad-word (long double)
@@ -6060,6 +6236,22 @@ ABI@. Thus, it's intended only for use on targets where the developer
acknowledges that their resulting code will not be directly in line with
the rules of the ABI@.
+@item -mimpure-text
+@opindex mimpure-text
+@option{-mimpure-text}, used in addition to @option{-shared}, tells
+the compiler to not pass @option{-z text} to the linker when linking a
+shared object. Using this option, you can link position-dependent
+code into a shared object.
+
+@option{-mimpure-text} suppresses the ``relocations remain against
+allocatable but non-writable sections'' linker error message.
+However, the necessary relocations will trigger copy-on-write, and the
+shared object is not actually shared across processes. Instead of
+using @option{-mimpure-text}, you should compile all source code with
+@option{-fpic} or @option{-fPIC}.
+
+This option is only available on SunOS and Solaris.
+
@item -mv8
@itemx -msparclite
@opindex mv8
@@ -6168,7 +6360,8 @@ on SPARC V9 processors in 64-bit environments.
@table @gcctabopt
@item -mlittle-endian
@opindex mlittle-endian
-Generate code for a processor running in little-endian mode.
+Generate code for a processor running in little-endian mode. It is only
+available for a few configurations and most notably not on Solaris.
@item -m32
@itemx -m64
@@ -7591,6 +7784,7 @@ output file being linked. See man ld(1) for more information.
@item -multiply_defined
@item -multiply_defined_unused
@item -noall_load
+@item -nofixprebinding
@item -nomultidefs
@item -noprebind
@item -noseglinkedit
@@ -7647,6 +7841,7 @@ output file being linked. See man ld(1) for more information.
@opindex multiply_defined
@opindex multiply_defined_unused
@opindex noall_load
+@opindex nofixprebinding
@opindex nomultidefs
@opindex noprebind
@opindex noseglinkedit
@@ -7759,10 +7954,12 @@ The processor names are:
@samp{4kc}, @samp{4kp}, @samp{5kc}, @samp{20kc},
@samp{m4k},
@samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
-@samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
+@samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000}, @samp{rm7000},
+@samp{rm9000},
@samp{orion},
@samp{sb1},
-@samp{vr4100}, @samp{vr4300}, and @samp{vr5000}.
+@samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4300},
+@samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
The special value @samp{from-abi} selects the
most compatible architecture for the selected ABI (that is,
@samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
@@ -8009,6 +8206,35 @@ Emit (or do not emit) the pseudo operations @samp{.abicalls},
@samp{.cpload}, and @samp{.cprestore} that some System V.4 ports use for
position independent code.
+@item -mxgot
+@itemx -mno-xgot
+@opindex mxgot
+@opindex mno-xgot
+Lift (or do not lift) the usual restrictions on the size of the global
+offset table.
+
+GCC normally uses a single instruction to load values from the GOT.
+While this is relatively efficient, it will only work if the GOT
+is smaller than about 64k. Anything larger will cause the linker
+to report an error such as:
+
+@cindex relocation truncated to fit (MIPS)
+@smallexample
+relocation truncated to fit: R_MIPS_GOT16 foobar
+@end smallexample
+
+If this happens, you should recompile your code with @option{-mxgot}.
+It should then work with very large GOTs, although it will also be
+less efficient, since it will take three instructions to fetch the
+value of a global symbol.
+
+Note that some linkers can create multiple GOTs. If you have such a
+linker, you should only need to use @option{-mxgot} when a single object
+file accesses more than 64k's worth of GOT entries. Very few do.
+
+These options have no effect unless GCC is generating position
+independent code.
+
@item -mlong-calls
@itemx -mno-long-calls
@opindex mlong-calls
@@ -8111,6 +8337,13 @@ Pass an option to gas which will cause nops to be inserted if
the read of the destination register of an mfhi or mflo instruction
occurs in the following two instructions.
+@item -mfix-sb1
+@itemx -mno-fix-sb1
+@opindex mfix-sb1
+Work around certain SB-1 CPU core errata.
+(This flag currently works around the SB-1 revision 2
+``F1'' and ``F2'' floating point errata.)
+
@item -no-crt0
@opindex no-crt0
Do not include the default crt0.
@@ -9539,11 +9772,11 @@ option is on by default if you optimize.
@itemx -mprolog-function
@opindex mno-prolog-function
@opindex mprolog-function
-Do not use (do use) external functions to save and restore registers at
-the prolog and epilog of a function. The external functions are slower,
-but use less code space if more than one function saves the same number
-of registers. The @option{-mprolog-function} option is on by default if
-you optimize.
+Do not use (do use) external functions to save and restore registers
+at the prologue and epilogue of a function. The external functions
+are slower, but use less code space if more than one function saves
+the same number of registers. The @option{-mprolog-function} option
+is on by default if you optimize.
@item -mspace
@opindex mspace
@@ -9586,14 +9819,20 @@ the compiler. This setting is the default.
@opindex mno-app-regs
This option will cause r2 and r5 to be treated as fixed registers.
+@item -mv850e1
+@opindex mv850e1
+Specify that the target processor is the V850E1. The preprocessor
+constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
+this option is used.
+
@item -mv850e
@opindex mv850e
Specify that the target processor is the V850E. The preprocessor
constant @samp{__v850e__} will be defined if this option is used.
-If neither @option{-mv850} nor @option{-mv850e} are defined
-then a default target processor will be chosen and the relevant
-@samp{__v850*__} preprocessor constant will be defined.
+If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
+are defined then a default target processor will be chosen and the
+relevant @samp{__v850*__} preprocessor constant will be defined.
The preprocessor constants @samp{__v850} and @samp{__v851__} are always
defined, regardless of which processor variant is the target.
@@ -9601,7 +9840,7 @@ defined, regardless of which processor variant is the target.
@item -mdisable-callt
@opindex mdisable-callt
This option will suppress generation of the CALLT instruction for the
-v850e flavors of the v850 architecture. The default is
+v850e and v850e1 flavors of the v850 architecture. The default is
@option{-mno-disable-callt} which allows the CALLT instruction to be used.
@end table
@@ -10739,26 +10978,9 @@ Select the processor type for which to generate code. Possible values are
@subsection Xtensa Options
@cindex Xtensa Options
-The Xtensa architecture is designed to support many different
-configurations. The compiler's default options can be set to match a
-particular Xtensa configuration by copying a configuration file into the
-GCC sources when building GCC@. The options below may be used to
-override the default options.
+These options are supported for Xtensa targets:
@table @gcctabopt
-@item -mbig-endian
-@itemx -mlittle-endian
-@opindex mbig-endian
-@opindex mlittle-endian
-Specify big-endian or little-endian byte ordering for the target Xtensa
-processor.
-
-@item -mdensity
-@itemx -mno-density
-@opindex mdensity
-@opindex mno-density
-Enable or disable use of the optional Xtensa code density instructions.
-
@item -mconst16
@itemx -mno-const16
@opindex mconst16
@@ -10770,95 +10992,6 @@ instructions are always used in place of the standard @code{L32R}
instructions. The use of @code{CONST16} is enabled by default only if
the @code{L32R} instruction is not available.
-@item -mabs
-@itemx -mno-abs
-@opindex mabs
-@opindex mno-abs
-Enable or disable use of the Xtensa @code{ABS} instruction for absolute
-value operations.
-
-@item -maddx
-@itemx -mno-addx
-@opindex maddx
-@opindex mno-addx
-Enable or disable use of the Xtensa @code{ADDX} and @code{SUBX}
-instructions.
-
-@item -mmac16
-@itemx -mno-mac16
-@opindex mmac16
-@opindex mno-mac16
-Enable or disable use of the Xtensa MAC16 option. When enabled, GCC
-will generate MAC16 instructions from standard C code, with the
-limitation that it will use neither the MR register file nor any
-instruction that operates on the MR registers. When this option is
-disabled, GCC will translate 16-bit multiply/accumulate operations to a
-combination of core instructions and library calls, depending on whether
-any other multiplier options are enabled.
-
-@item -mmul16
-@itemx -mno-mul16
-@opindex mmul16
-@opindex mno-mul16
-Enable or disable use of the 16-bit integer multiplier option. When
-enabled, the compiler will generate 16-bit multiply instructions for
-multiplications of 16 bits or smaller in standard C code. When this
-option is disabled, the compiler will either use 32-bit multiply or
-MAC16 instructions if they are available or generate library calls to
-perform the multiply operations using shifts and adds.
-
-@item -mmul32
-@itemx -mno-mul32
-@opindex mmul32
-@opindex mno-mul32
-Enable or disable use of the 32-bit integer multiplier option. When
-enabled, the compiler will generate 32-bit multiply instructions for
-multiplications of 32 bits or smaller in standard C code. When this
-option is disabled, the compiler will generate library calls to perform
-the multiply operations using either shifts and adds or 16-bit multiply
-instructions if they are available.
-
-@item -mnsa
-@itemx -mno-nsa
-@opindex mnsa
-@opindex mno-nsa
-Enable or disable use of the optional normalization shift amount
-(@code{NSA}) instructions to implement the built-in @code{ffs} function.
-
-@item -mminmax
-@itemx -mno-minmax
-@opindex mminmax
-@opindex mno-minmax
-Enable or disable use of the optional minimum and maximum value
-instructions.
-
-@item -msext
-@itemx -mno-sext
-@opindex msext
-@opindex mno-sext
-Enable or disable use of the optional sign extend (@code{SEXT})
-instruction.
-
-@item -mbooleans
-@itemx -mno-booleans
-@opindex mbooleans
-@opindex mno-booleans
-Enable or disable support for the boolean register file used by Xtensa
-coprocessors. This is not typically useful by itself but may be
-required for other options that make use of the boolean registers (e.g.,
-the floating-point option).
-
-@item -mhard-float
-@itemx -msoft-float
-@opindex mhard-float
-@opindex msoft-float
-Enable or disable use of the floating-point option. When enabled, GCC
-generates floating-point instructions for 32-bit @code{float}
-operations. When this option is disabled, GCC generates library calls
-to emulate 32-bit floating-point operations using integer instructions.
-Regardless of this option, 64-bit @code{double} operations are always
-emulated with calls to library functions.
-
@item -mfused-madd
@itemx -mno-fused-madd
@opindex mfused-madd
@@ -11395,7 +11528,7 @@ If GCC cannot find the subprogram using the specified prefix, it
tries looking in the usual places for the subprogram.
The default value of @env{GCC_EXEC_PREFIX} is
-@file{@var{prefix}/lib/gcc-lib/} where @var{prefix} is the value
+@file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
of @code{prefix} when you ran the @file{configure} script.
Other prefixes specified with @option{-B} take precedence over this prefix.
@@ -11405,7 +11538,7 @@ used for linking.
In addition, the prefix is used in an unusual way in finding the
directories to search for header files. For each of the standard
-directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
+directories whose name normally begins with @samp{/usr/local/lib/gcc}
(more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
replacing that beginning with the specified prefix to produce an
alternate directory name. Thus, with @option{-Bfoo/}, GCC will search
diff --git a/gcc/doc/makefile.texi b/gcc/doc/makefile.texi
index 1e64c5e6160..3ab98c08da7 100644
--- a/gcc/doc/makefile.texi
+++ b/gcc/doc/makefile.texi
@@ -68,21 +68,25 @@ Like @code{bootstrap}, except that the various stages are removed once
they're no longer needed. This saves disk space.
@item bubblestrap
-Once bootstrapped, this incrementally rebuilds each of the three stages,
-one at a time. It does this by ``bubbling'' the stages up from their
-subdirectories, rebuilding them, and copying them back to their
-subdirectories. This will allow you to, for example, quickly rebuild a
-bootstrapped compiler after changing the sources, without having to do a
-full bootstrap.
+This incrementally rebuilds each of the three stages, one at a time.
+It does this by ``bubbling'' the stages up from their subdirectories
+(if they had been built previously), rebuilding them, and copying them
+back to their subdirectories. This will allow you to, for example,
+continue a bootstrap after fixing a bug which causes the stage2 build
+to crash.
@item quickstrap
Rebuilds the most recently built stage. Since each stage requires
-special invocation, using this target means you don't have to keep track
-of which stage you're on or what invocation that stage needs.
+special invocation, using this target means you don't have to keep
+track of which stage you're on or what invocation that stage needs.
@item cleanstrap
Removed everything (@samp{make clean}) and rebuilds (@samp{make bootstrap}).
+@item restrap
+Like @code{cleanstrap}, except that the process starts from the first
+stage build, not from scratch.
+
@item stage@var{N} (@var{N} = 1@dots{}4)
For each stage, moves the appropriate files to the @file{stage@var{N}}
subdirectory.
@@ -99,4 +103,11 @@ Compares the results of stages 2 and 3. This ensures that the compiler
is running properly, since it should produce the same object files
regardless of how it itself was compiled.
+@item profiledbootstrap
+Builds a compiler with profiling feedback information. For more
+information, see
+@ref{Building,,Building with profile feedback,gccinstall,Installing GCC}.
+This is actually a target in the top-level directory, which then
+recurses into the @file{gcc} subdirectory multiple times.
+
@end table
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 7bbdda8e415..ce59a0fd5ed 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -1314,15 +1314,15 @@ The constraints are defined through these macros:
@table @code
@item REG_CLASS_FROM_LETTER
-Register class constraints (usually lower case).
+Register class constraints (usually lowercase).
@item CONST_OK_FOR_LETTER_P
Immediate constant constraints, for non-floating point constants of
-word size or smaller precision (usually upper case).
+word size or smaller precision (usually uppercase).
@item CONST_DOUBLE_OK_FOR_LETTER_P
Immediate constant constraints, for all floating point constants and for
-constants of greater than word size precision (usually upper case).
+constants of greater than word size precision (usually uppercase).
@item EXTRA_CONSTRAINT
Special cases of registers or memory. This macro is not required, and
@@ -2318,7 +2318,7 @@ pattern to accomplish a certain task.
@table @asis
@cindex @code{mov@var{m}} instruction pattern
@item @samp{mov@var{m}}
-Here @var{m} stands for a two-letter machine mode name, in lower case.
+Here @var{m} stands for a two-letter machine mode name, in lowercase.
This instruction pattern moves data with that machine mode from operand
1 to operand 0. For example, @samp{movsi} moves full-word data.
@@ -2799,7 +2799,7 @@ The use for multiple @code{clrstr@var{m}} is as for @code{movstr@var{m}}.
@cindex @code{cmpstr@var{m}} instruction pattern
@item @samp{cmpstr@var{m}}
-Block compare instruction, with five operands. Operand 0 is the output;
+String compare instruction, with five operands. Operand 0 is the output;
it has mode @var{m}. The remaining four operands are like the operands
of @samp{movstr@var{m}}. The two memory blocks specified are compared
byte by byte in lexicographic order starting at the beginning of each
@@ -2809,6 +2809,16 @@ that may access an invalid page or segment and cause a fault. The
effect of the instruction is to store a value in operand 0 whose sign
indicates the result of the comparison.
+@cindex @code{cmpmem@var{m}} instruction pattern
+@item @samp{cmpmem@var{m}}
+Block compare instruction, with five operands like the operands
+of @samp{cmpstr@var{m}}. The two memory blocks specified are compared
+byte by byte in lexicographic order starting at the beginning of each
+block. Unlike @samp{cmpstr@var{m}} the instruction can prefetch
+any bytes in the two memory blocks. The effect of the instruction is
+to store a value in operand 0 whose sign indicates the result of the
+comparison.
+
@cindex @code{strlen@var{m}} instruction pattern
@item @samp{strlen@var{m}}
Compute the length of a string, with three operands.
@@ -4800,7 +4810,7 @@ A @samp{#define} is written for the symbol @samp{HAVE_ATTR_@var{name}}.
@item
An enumeral class is defined for @samp{attr_@var{name}} with
elements of the form @samp{@var{upper-name}_@var{upper-value}} where
-the attribute name and value are first converted to upper case.
+the attribute name and value are first converted to uppercase.
@item
A function @samp{get_attr_@var{name}} is defined that is passed an insn and
diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi
index 57a065bdf17..ed32827238a 100644
--- a/gcc/doc/passes.texi
+++ b/gcc/doc/passes.texi
@@ -12,7 +12,10 @@
@cindex top level of compiler
The overall control structure of the compiler is in @file{toplev.c}. This
file is responsible for initialization, decoding arguments, opening and
-closing files, and sequencing the passes.
+closing files, and sequencing the passes. Routines for emitting
+diagnostic messages are defined in @file{diagnostic.c}. The files
+@file{pretty-print.h} and @file{pretty-print.c} provide basic support
+for language-independent pretty-printing.
@cindex parsing pass
The parsing pass is invoked only once, to parse the entire input. A
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index ca3c2de9700..94147dbfd99 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -99,7 +99,7 @@ null pointers are used instead.
@findex PUT_CODE
Expressions are classified by @dfn{expression codes} (also called RTX
codes). The expression code is a name defined in @file{rtl.def}, which is
-also (in upper case) a C enumeration constant. The possible expression
+also (in uppercase) a C enumeration constant. The possible expression
codes and their meanings are machine-independent. The code of an RTX can
be extracted with the macro @code{GET_CODE (@var{x})} and altered with
@code{PUT_CODE (@var{x}, @var{newcode})}.
@@ -118,8 +118,8 @@ Expressions are written as parentheses containing the name of the
expression type, its flags and machine mode if any, and then the operands
of the expression (separated by spaces).
-Expression code names in the @samp{md} file are written in lower case,
-but when they appear in C code they are written in upper case. In this
+Expression code names in the @samp{md} file are written in lowercase,
+but when they appear in C code they are written in uppercase. In this
manual, they are shown as follows: @code{const_int}.
@cindex (nil)
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 593ae1fcc3c..73ad706bc74 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -175,7 +175,8 @@ timestamp.
@menu
* Config Fragments:: Scripts used by @file{configure}.
-* System Config:: The @file{config.gcc} file.
+* System Config:: The @file{config.build}, @file{config.host}, and
+ @file{config.gcc} files.
* Configuration Files:: Files created by running @file{configure}.
@end menu
@@ -191,10 +192,14 @@ files, kept in the top level directory, are used. FIXME: when is the
the top level one) used?
@item The file @file{config.gcc} is used to handle configuration
-specific to the particular build, host or target machine. (In
-general, this should only be used for features that cannot reasonably
-be tested in Autoconf feature tests.) @xref{System Config, , The
-@file{config.gcc} File}, for details of the contents of this file.
+specific to the particular target machine. The file
+@file{config.build} is used to handle configuration specific to the
+particular build machine. The file @file{config.host} is used to handle
+configuration specific to the particular host machine. (In general,
+these should only be used for features that cannot reasonably be tested in
+Autoconf feature tests.)
+@xref{System Config, , The @file{config.build}, @file{config.host},
+and @file{config.gcc} Files}, for details of the contents of these files.
@item Each language subdirectory has a file
@file{@var{language}/config-lang.in} that is used for
@@ -206,9 +211,22 @@ creating the output of @file{configure}.
@end itemize
@node System Config
-@subsubsection The @file{config.gcc} File
+@subsubsection The @file{config.build}, @file{config.host}, and @file{config.gcc} Files
-FIXME: document the contents of this file, and what variables should
+The @file{config.build} file contains specific rules for particular systems
+which GCC is built on. This should be used as rarely as possible, as the
+behavior of the build system can always be detected by autoconf.
+
+The @file{config.host} file contains specific rules for particular systems
+which GCC will run on. This is rarely needed.
+
+The @file{config.gcc} file contains specific rules for particular systems
+which GCC will generate code for. This is usually needed.
+
+Each file has a list of the shell variables it sets, with descriptions, at the
+top of the file.
+
+FIXME: document the contents of these files, and what variables should
be set to control build, host and target configuration.
@include configfiles.texi
@@ -561,8 +579,7 @@ FIXME: what is this target for?
@item install-common
Install everything that is part of the front end, apart from the
compiler executables listed in @code{compilers} in
-@file{config-lang.in} that are installed in @file{@var{libsubdir}} by
-the main @file{Makefile}.
+@file{config-lang.in}.
@item install-info
Install info documentation for the front end, if it is present in the
source directory. (It may not be present if a suitable version of
@@ -601,12 +618,9 @@ Move to the stage directory files not included in @code{stagestuff} in
@item lang.opt
This file registers the set of switches that the front end accepts on
-the command line. The file format is documented in the file
-@file{c.opt}. These files are processed by the script @file{opts.sh}.
-@item lang-options.h
-This file provides entries for @code{documented_lang_options} in
-@file{toplev.c} describing command-line options the front end accepts
-for @option{--help} output.
+the command line, and their --help text. The file format is
+documented in the file @file{c.opt}. These files are processed by the
+script @file{opts.sh}.
@item lang-specs.h
This file provides entries for @code{default_compilers} in
@file{gcc.c} which override the default of giving an error that a
@@ -653,8 +667,8 @@ If defined to @samp{yes}, this front end is built in stage 1 of the
bootstrap. This is only relevant to front ends written in their own
languages.
@item compilers
-If defined, a space-separated list of compiler executables that should
-be installed in @file{@var{libsubdir}}. The names here will each end
+If defined, a space-separated list of compiler executables that will
+be run by the driver. The names here will each end
with @samp{\$(exeext)}.
@item stagestuff
If defined, a space-separated list of files that should be moved to
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 9fea987a04d..ef49a688033 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -439,12 +439,6 @@ a @option{-B} prefix into a @option{-L} linker option if the prefix
indicates an absolute file name.
@end defmac
-@defmac STANDARD_EXEC_PREFIX
-Define this macro as a C string constant if you wish to override the
-standard choice of @file{/usr/local/lib/gcc-lib/} as the default prefix to
-try when searching for the executable files of the compiler.
-@end defmac
-
@defmac MD_EXEC_PREFIX
If defined, this macro is an additional prefix to try after
@code{STANDARD_EXEC_PREFIX}. @code{MD_EXEC_PREFIX} is not searched
@@ -455,8 +449,10 @@ to the list of directories used to find the assembler in @file{configure.in}.
@defmac STANDARD_STARTFILE_PREFIX
Define this macro as a C string constant if you wish to override the
-standard choice of @file{/usr/local/lib/} as the default prefix to
+standard choice of @code{libdir} as the default prefix to
try when searching for startup files such as @file{crt0.o}.
+@code{STANDARD_STARTFILE_PREFIX} is not searched when the compiler
+is built as a cross compiler.
@end defmac
@defmac MD_STARTFILE_PREFIX
@@ -558,7 +554,7 @@ wrapped in @code{extern @samp{C}} when compiling C++. Mark the end of
the array with a null element.
The component name denotes what GNU package the include file is part of,
-if any, in all upper-case letters. For example, it might be @samp{GCC}
+if any, in all uppercase letters. For example, it might be @samp{GCC}
or @samp{BINUTILS}. If the package is part of a vendor-supplied
operating system, code the component name as @samp{0}.
@@ -1062,24 +1058,25 @@ sign-extend the result to 64 bits. On such machines, set
Do not define this macro if it would never modify @var{m}.
@end defmac
-@defmac PROMOTE_FUNCTION_ARGS
-Define this macro if the promotion described by @code{PROMOTE_MODE}
-should also be done for outgoing function arguments.
-@end defmac
+@deftypefn {Target Hook} bool TARGET_PROMOTE_FUNCTION_ARGS (tree @var{fntype})
+This target hook should return @code{true} if the promotion described by
+@code{PROMOTE_MODE} should also be done for outgoing function arguments.
+@end deftypefn
-@defmac PROMOTE_FUNCTION_RETURN
-Define this macro if the promotion described by @code{PROMOTE_MODE}
-should also be done for the return value of functions.
+@deftypefn {Target Hook} bool TARGET_PROMOTE_FUNCTION_RETURN (tree @var{fntype})
+This target hook should return @code{true} if the promotion described by
+@code{PROMOTE_MODE} should also be done for the return value of
+functions.
-If this macro is defined, @code{FUNCTION_VALUE} must perform the same
-promotions done by @code{PROMOTE_MODE}.
-@end defmac
+If this target hook returns @code{true}, @code{FUNCTION_VALUE} must
+perform the same promotions done by @code{PROMOTE_MODE}.
+@end deftypefn
@defmac PROMOTE_FOR_CALL_ONLY
Define this macro if the promotion described by @code{PROMOTE_MODE}
should @emph{only} be performed for outgoing function arguments or
-function return values, as specified by @code{PROMOTE_FUNCTION_ARGS}
-and @code{PROMOTE_FUNCTION_RETURN}, respectively.
+function return values, as specified by @code{TARGET_PROMOTE_FUNCTION_ARGS}
+and @code{TARGET_PROMOTE_FUNCTION_RETURN}, respectively.
@end defmac
@defmac PARM_BOUNDARY
@@ -2936,12 +2933,6 @@ want to support call frame debugging information like that provided by
DWARF 2.
@end defmac
-@defmac SMALL_STACK
-Define this macro if the stack size for the target is very small. This
-has the effect of disabling gcc's built-in @samp{alloca}, though
-@samp{__builtin_alloca} is not affected.
-@end defmac
-
@node Exception Handling
@subsection Exception Handling Support
@cindex exception handling
@@ -2999,6 +2990,13 @@ If you want to support call frame exception handling, you must
define either this macro or the @code{eh_return} instruction pattern.
@end defmac
+@defmac RETURN_ADDR_OFFSET
+If defined, an integer-valued C expression for which rtl will be generated
+to add it to the exception handler address before it is searched in the
+exception handling tables, and to subtract it again from the address before
+using it to return to the exception handler.
+@end defmac
+
@defmac ASM_PREFERRED_EH_DATA_FORMAT (@var{code}, @var{global})
This macro chooses the encoding of pointers embedded in the exception
handling sections. If at all possible, this should be defined such
@@ -3356,14 +3354,13 @@ The macros in this section control how arguments are passed
on the stack. See the following section for other macros that
control passing certain arguments in registers.
-@defmac PROMOTE_PROTOTYPES
-A C expression whose value is nonzero if an argument declared in
-a prototype as an integral type smaller than @code{int} should
-actually be passed as an @code{int}. In addition to avoiding
-errors in certain cases of mismatch, it also makes for better
-code on certain machines. If the macro is not defined in target
-header files, it defaults to 0.
-@end defmac
+@deftypefn {Target Hook} bool TARGET_PROMOTE_PROTOTYPES (tree @var{fntype})
+This target hook returns @code{true} if an argument declared in a
+prototype as an integral type smaller than @code{int} should actually be
+passed as an @code{int}. In addition to avoiding errors in certain
+cases of mismatch, it also makes for better code on certain machines.
+The default is to not promote prototypes.
+@end deftypefn
@defmac PUSH_ARGS
A C expression. If nonzero, push insns will be used to pass
@@ -3755,6 +3752,17 @@ controlled by @code{PARM_BOUNDARY}. If this macro is not defined, all such
arguments are padded down if @code{BYTES_BIG_ENDIAN} is true.
@end defmac
+@defmac BLOCK_REG_PADDING (@var{mode}, @var{type}, @var{first})
+Specify padding for the last element of a block move between registers and
+memory. @var{first} is nonzero if this is the only element. Defining this
+macro allows better control of register function parameters on big-endian
+machines, without using @code{PARALLEL} rtl. In particular,
+@code{MUST_PASS_IN_STACK} need not test padding and mode of types in
+registers, as there is no longer a "wrong" part of a register; For example,
+a three byte aggregate may be passed in the high part of a register if so
+required.
+@end defmac
+
@defmac FUNCTION_ARG_BOUNDARY (@var{mode}, @var{type})
If defined, a C expression that gives the alignment boundary, in bits,
of an argument with the specified mode and type. If it is not defined,
@@ -3811,7 +3819,7 @@ register where the return value is stored. The value can also be a
@code{parallel} RTX, if the return value is in multiple places. See
@code{FUNCTION_ARG} for an explanation of the @code{parallel} form.
-If @code{PROMOTE_FUNCTION_RETURN} is defined, you must apply the same
+If @code{TARGET_PROMOTE_FUNCTION_RETURN} is defined, you must apply the same
promotion rules specified in @code{PROMOTE_MODE} if @var{valtype} is a
scalar type.
@@ -3902,24 +3910,24 @@ is called the @dfn{structure value address}.
This section describes how to control returning structure values in
memory.
-@defmac RETURN_IN_MEMORY (@var{type})
-A C expression which can inhibit the returning of certain function
-values in registers, based on the type of value. A nonzero value says
-to return the function value in memory, just as large structures are
-always returned. Here @var{type} will be a C expression of type
-@code{tree}, representing the data type of the value.
+@deftypefn {Target Hook} bool RETURN_IN_MEMORY (tree @var{type}, tree @var{fntype})
+This target hook should return a nonzero value to say to return the
+function value in memory, just as large structures are always returned.
+Here @var{type} will be the data type of the value, and @var{fntype}
+will be the type of the function doing the returning, or @code{NULL} for
+libcalls.
Note that values of mode @code{BLKmode} must be explicitly handled
-by this macro. Also, the option @option{-fpcc-struct-return}
+by this function. Also, the option @option{-fpcc-struct-return}
takes effect regardless of this macro. On most systems, it is
-possible to leave the macro undefined; this causes a default
+possible to leave the hook undefined; this causes a default
definition to be used, whose value is the constant 1 for @code{BLKmode}
values, and 0 otherwise.
-Do not use this macro to indicate that structures and unions should always
+Do not use this hook to indicate that structures and unions should always
be returned in memory. You should instead use @code{DEFAULT_PCC_STRUCT_RETURN}
to indicate this.
-@end defmac
+@end deftypefn
@defmac DEFAULT_PCC_STRUCT_RETURN
Define this macro to be 1 if all structure and union return values must be
@@ -3931,36 +3939,23 @@ and union return values are decided by the @code{RETURN_IN_MEMORY} macro.
If not defined, this defaults to the value 1.
@end defmac
-@defmac STRUCT_VALUE_REGNUM
-If the structure value address is passed in a register, then
-@code{STRUCT_VALUE_REGNUM} should be the number of that register.
-@end defmac
-
-@defmac STRUCT_VALUE
-If the structure value address is not passed in a register, define
-@code{STRUCT_VALUE} as an expression returning an RTX for the place
-where the address is passed. If it returns 0, the address is passed as
-an ``invisible'' first argument.
-@end defmac
+@deftypefn {Target Hook} rtx TARGET_STRUCT_VALUE_RTX (tree @var{fndecl}, int @var{incoming})
+This target hook should return the location of the structure value
+address (normally a @code{mem} or @code{reg}), or 0 if the address is
+passed as an ``invisible'' first argument. Note that @var{fndecl} may
+be @code{NULL}, for libcalls.
-@defmac STRUCT_VALUE_INCOMING_REGNUM
On some architectures the place where the structure value address
is found by the called function is not the same place that the
caller put it. This can be due to register windows, or it could
be because the function prologue moves it to a different place.
+@var{incoming} is @code{true} when the location is needed in
+the context of the called function, and @code{false} in the context of
+the caller.
-If the incoming location of the structure value address is in a
-register, define this macro as the register number.
-@end defmac
-
-@defmac STRUCT_VALUE_INCOMING
-If the incoming location is not a register, then you should define
-@code{STRUCT_VALUE_INCOMING} as an expression for an RTX for where the
-called function should find the value. If it should find the value on
-the stack, define this to create a @code{mem} which refers to the frame
-pointer. A definition of 0 means that the address is passed as an
-``invisible'' first argument.
-@end defmac
+If @var{incoming} is @code{true} and the address is to be found on the
+stack, return a @code{mem} which refers to the frame pointer.
+@end deftypefn
@defmac PCC_STATIC_STRUCT_RETURN
Define this macro if the usual system convention on the target machine
@@ -4420,70 +4415,71 @@ interpret the values of @code{__builtin_classify_type}.
These machine description macros help implement varargs:
-@defmac EXPAND_BUILTIN_SAVEREGS ()
-If defined, is a C expression that produces the machine-specific code
-for a call to @code{__builtin_saveregs}. This code will be moved to the
-very beginning of the function, before any parameter access are made.
-The return value of this function should be an RTX that contains the
-value to use as the return of @code{__builtin_saveregs}.
-@end defmac
+@deftypefn {Target Hook} rtx TARGET_EXPAND_BUILTIN_SAVEREGS (void)
+If defined, this hook produces the machine-specific code for a call to
+@code{__builtin_saveregs}. This code will be moved to the very
+beginning of the function, before any parameter access are made. The
+return value of this function should be an RTX that contains the value
+to use as the return of @code{__builtin_saveregs}.
+@end deftypefn
-@defmac SETUP_INCOMING_VARARGS (@var{args_so_far}, @var{mode}, @var{type}, @var{pretend_args_size}, @var{second_time})
-This macro offers an alternative to using @code{__builtin_saveregs} and
-defining the macro @code{EXPAND_BUILTIN_SAVEREGS}. Use it to store the
-anonymous register arguments into the stack so that all the arguments
-appear to have been passed consecutively on the stack. Once this is
-done, you can use the standard implementation of varargs that works for
-machines that pass all their arguments on the stack.
+@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS (CUMULATIVE_ARGS *@var{args_so_far}, enum machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
+This target hook offers an alternative to using
+@code{__builtin_saveregs} and defining the hook
+@code{TARGET_EXPAND_BUILTIN_SAVEREGS}. Use it to store the anonymous
+register arguments into the stack so that all the arguments appear to
+have been passed consecutively on the stack. Once this is done, you can
+use the standard implementation of varargs that works for machines that
+pass all their arguments on the stack.
-The argument @var{args_so_far} is the @code{CUMULATIVE_ARGS} data
+The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data
structure, containing the values that are obtained after processing the
named arguments. The arguments @var{mode} and @var{type} describe the
last named argument---its machine mode and its data type as a tree node.
-The macro implementation should do two things: first, push onto the
-stack all the argument registers @emph{not} used for the named
-arguments, and second, store the size of the data thus pushed into the
-@code{int}-valued variable whose name is supplied as the argument
-@var{pretend_args_size}. The value that you store here will serve as
-additional offset for setting up the stack frame.
+The target hook should do two things: first, push onto the stack all the
+argument registers @emph{not} used for the named arguments, and second,
+store the size of the data thus pushed into the @code{int}-valued
+variable pointed to by @var{pretend_args_size}. The value that you
+store here will serve as additional offset for setting up the stack
+frame.
Because you must generate code to push the anonymous arguments at
compile time without knowing their data types,
-@code{SETUP_INCOMING_VARARGS} is only useful on machines that have just
-a single category of argument register and use it uniformly for all data
-types.
+@code{TARGET_SETUP_INCOMING_VARARGS} is only useful on machines that
+have just a single category of argument register and use it uniformly
+for all data types.
If the argument @var{second_time} is nonzero, it means that the
arguments of the function are being analyzed for the second time. This
happens for an inline function, which is not actually compiled until the
-end of the source file. The macro @code{SETUP_INCOMING_VARARGS} should
+end of the source file. The hook @code{TARGET_SETUP_INCOMING_VARARGS} should
not generate any instructions in this case.
-@end defmac
+@end deftypefn
-@defmac STRICT_ARGUMENT_NAMING
-Define this macro to be a nonzero value if the location where a function
+@deftypefn {Target Hook} bool TARGET_STRICT_ARGUMENT_NAMING (CUMULATIVE_ARGS *@var{ca})
+Define this hook to return @code{true} if the location where a function
argument is passed depends on whether or not it is a named argument.
-This macro controls how the @var{named} argument to @code{FUNCTION_ARG}
-is set for varargs and stdarg functions. If this macro returns a
-nonzero value, the @var{named} argument is always true for named
-arguments, and false for unnamed arguments. If it returns a value of
-zero, but @code{SETUP_INCOMING_VARARGS} is defined, then all arguments
-are treated as named. Otherwise, all named arguments except the last
-are treated as named.
+This hook controls how the @var{named} argument to @code{FUNCTION_ARG}
+is set for varargs and stdarg functions. If this hook returns
+@code{true}, the @var{named} argument is always true for named
+arguments, and false for unnamed arguments. If it returns @code{false},
+but @code{TARGET_PRETEND_OUTOGOING_VARARGS_NAMED} returns @code{true},
+then all arguments are treated as named. Otherwise, all named arguments
+except the last are treated as named.
-You need not define this macro if it always returns zero.
-@end defmac
+You need not define this hook if it always returns zero.
+@end deftypefn
-@defmac PRETEND_OUTGOING_VARARGS_NAMED
+@deftypefn {Target Hook} bool TARGET_PRETEND_OUTGOING_VARARGS_NAMED
If you need to conditionally change ABIs so that one works with
-@code{SETUP_INCOMING_VARARGS}, but the other works like neither
-@code{SETUP_INCOMING_VARARGS} nor @code{STRICT_ARGUMENT_NAMING} was
-defined, then define this macro to return nonzero if
-@code{SETUP_INCOMING_VARARGS} is used, zero otherwise.
-Otherwise, you should not define this macro.
-@end defmac
+@code{TARGET_SETUP_INCOMING_VARARGS}, but the other works like neither
+@code{TARGET_SETUP_INCOMING_VARARGS} nor @code{TARGET_STRICT_ARGUMENT_NAMING} was
+defined, then define this hook to return @code{true} if
+@code{SETUP_INCOMING_VARARGS} is used, @code{false} otherwise.
+Otherwise, you should not define this hook.
+@end deftypefn
@node Trampolines
@section Trampolines for Nested Functions
@@ -4762,15 +4758,6 @@ number of existing systems lacks support for these functions in the runtime so
they needs this macro to be redefined to 0.
@end defmac
-@defmac LIBGCC_NEEDS_DOUBLE
-Define this macro if @code{float} arguments cannot be passed to library
-routines (so they must be converted to @code{double}). This macro
-affects both how library calls are generated and how the library
-routines in @file{libgcc.a} accept their arguments. It is useful on
-machines where floating and fixed point arguments are passed
-differently, such as the i860.
-@end defmac
-
@defmac NEXT_OBJC_RUNTIME
Define this macro to generate code for Objective-C message sending using
the calling convention of the NeXT system. This calling convention
@@ -6622,6 +6609,22 @@ You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} and/or
@code{ASM_OUTPUT_SIZE_DIRECTIVE} in the definition of this macro.
@end defmac
+@defmac ASM_DECLARE_CONSTANT_NAME (@var{stream}, @var{name}, @var{exp}, @var{size})
+A C statement (sans semicolon) to output to the stdio stream
+@var{stream} any text necessary for declaring the name @var{name} of a
+constant which is being defined. This macro is responsible for
+outputting the label definition (perhaps using
+@code{ASM_OUTPUT_LABEL}). The argument @var{exp} is the
+value of the constant, and @var{size} is the size of the constant
+in bytes. @var{name} will be an internal label.
+
+If this macro is not defined, then the @var{name} is defined in the
+usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
+
+You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in the definition
+of this macro.
+@end defmac
+
@defmac ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for claiming a register @var{regno}
@@ -7320,7 +7323,7 @@ If defined this macro should expand to a series of @code{case}
statements which will be parsed inside the @code{switch} statement of
the @code{asm_fprintf} function. This allows targets to define extra
printf formats which may useful when generating their assembler
-statements. Note that upper case letters are reserved for future
+statements. Note that uppercase letters are reserved for future
generic extensions to asm_fprintf, and so are not available to target
specific code. The output file is given by the parameter @var{file}.
The varargs input pointer is @var{argptr} and the rest of the format
diff --git a/gcc/doc/trouble.texi b/gcc/doc/trouble.texi
index 90d012e0ecd..02fe03b96f5 100644
--- a/gcc/doc/trouble.texi
+++ b/gcc/doc/trouble.texi
@@ -1,5 +1,5 @@
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-@c 1999, 2000, 2001 Free Software Foundation, Inc.
+@c 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -941,9 +941,8 @@ the last line will call an overloaded @code{::foo(int)} if one was
provided, even if after the declaration of @code{struct A}.
This distinction between lookup of dependent and non-dependent names is
-called two-stage (or dependent) name lookup. G++ implements some
-features of it since version 3.4 and is moving towards full compliance
-with the standard.
+called two-stage (or dependent) name lookup. G++ implements it
+since version 3.4.
Two-stage name lookup sometimes leads to situations with behavior
different from non-template codes. The most common is probably this:
@@ -974,10 +973,47 @@ type @code{Derived<T>*}, so is obviously dependent), or using
@code{Base<T>::i}. Alternatively, @code{Base<T>::i} might be brought
into scope by a @code{using}-declaration.
-Note that some compilers get this wrong and accept above code without an
-error. However, this is spurious, since they just don't implement
-two-stage name lookup correctly. This includes G++ versions prior to
-3.4.
+Another, similar example involves calling member functions of a base
+class:
+
+@example
+ template <typename T> struct Base @{
+ int f();
+ @};
+
+ template <typename T> struct Derived : Base<T> @{
+ int g() @{ return f(); @};
+ @};
+@end example
+
+Again, the call to @code{f()} is not dependent on template arguments
+(there are no arguments that depend on the type @code{T}, and it is also
+not otherwise specified that the call should be in a dependent context).
+Thus a global declaration of such a function must be available, since
+the one in the base class is not visible until instantiation time. The
+compiler will consequently produce the following error message:
+
+@example
+ x.cc: In member function `int Derived<T>::g()':
+ x.cc:6: error: there are no arguments to `f' that depend on a template
+ parameter, so a declaration of `f' must be available
+ x.cc:6: error: (if you use `-fpermissive', G++ will accept your code, but
+ allowing the use of an undeclared name is deprecated)
+@end example
+
+To make the code valid either use @code{this->f()}, or
+@code{Base<T>::f()}. Using the @code{-fpermissive} flag will also let
+the compiler accept the code, by marking all function calls for which no
+declaration is visible at the time of definition of the template for
+later lookup at instantiation time, as if it were a dependent call.
+We do not recommend using @code{-fpermissive} to work around invalid
+code, and it will also only catch cases where functions in base classes
+are called, not where variables in base classes are used (as in the
+example above).
+
+Note that some compilers (including G++ versions prior to 3.4) get these
+examples wrong and accept above code without an error. Those compilers
+do not implement two-stage name lookup correctly.
@node Temporaries
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 5d5e5a6b55a..2ed014bacf9 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -530,28 +530,27 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
operation produced a 1 or 0. */
case CALL_EXPR:
/* Check for a built-in function. */
- if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR)
- {
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
- tree arglist = TREE_OPERAND (exp, 1);
-
- if (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN (fndecl)
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
- && arglist != NULL_TREE
- && TREE_CHAIN (arglist) != NULL_TREE)
- {
- rtx seq = expand_builtin_expect_jump (exp, if_false_label,
- if_true_label);
-
- if (seq != NULL_RTX)
- {
- emit_insn (seq);
- return;
- }
- }
- }
- /* fall through and generate the normal code. */
+ {
+ tree fndecl = get_callee_fndecl (exp);
+ tree arglist = TREE_OPERAND (exp, 1);
+
+ if (fndecl
+ && DECL_BUILT_IN (fndecl)
+ && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
+ && arglist != NULL_TREE
+ && TREE_CHAIN (arglist) != NULL_TREE)
+ {
+ rtx seq = expand_builtin_expect_jump (exp, if_false_label,
+ if_true_label);
+
+ if (seq != NULL_RTX)
+ {
+ emit_insn (seq);
+ return;
+ }
+ }
+ }
+ /* Fall through and generate the normal code. */
default:
normal:
diff --git a/gcc/dominance.c b/gcc/dominance.c
index a9411d40431..38182ef5318 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -133,10 +133,10 @@ void debug_dominance_info (dominance_info);
{ \
unsigned int i = 1; /* Catch content == i. */ \
if (! (content)) \
- (var) = (type *) xcalloc ((num), sizeof (type)); \
+ (var) = xcalloc ((num), sizeof (type)); \
else \
{ \
- (var) = (type *) xmalloc ((num) * sizeof (type)); \
+ (var) = xmalloc ((num) * sizeof (type)); \
for (i = 0; i < num; i++) \
(var)[i] = (content); \
} \
@@ -212,7 +212,7 @@ calc_dfs_tree_nonrec (struct dom_info *di, basic_block bb, enum cdi_direction re
/* Ending block. */
basic_block ex_block;
- stack = (edge *) xmalloc ((n_basic_blocks + 3) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 3) * sizeof (edge));
sp = 0;
/* Initialize our border blocks, and the first edge. */
@@ -545,7 +545,7 @@ calculate_dominance_info (enum cdi_direction reverse)
dominance_info info;
basic_block b;
- /* allocate structure for dominance information. */
+ /* 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");
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index cd1b91af8d8..5b5056cc9eb 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -224,6 +224,13 @@ dw2_asm_output_addr_rtx (int size, rtx addr,
va_end (ap);
}
+/* Output the first ORIG_LEN characters of STR as a string.
+ If ORIG_LEN is equal to -1, ignore this parameter and output
+ the entire STR instead.
+ If COMMENT is not NULL and comments in the debug information
+ have been requested by the user, append the given COMMENT
+ to the generated output. */
+
void
dw2_asm_output_nstring (const char *str, size_t orig_len,
const char *comment, ...)
@@ -757,7 +764,7 @@ dw2_output_indirect_constant_1 (splay_tree_node node,
sym = (const char *) node->key;
sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
if (USE_LINKONCE_INDIRECT)
- fprintf (asm_out_file, "\t.hidden DW.ref.%s\n", sym);
+ fprintf (asm_out_file, "\t.hidden %sDW.ref.%s\n", user_label_prefix, sym);
assemble_variable ((tree) node->value, 1, 1, 1);
assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7537dd1bdac..5fa730e1b55 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -443,18 +443,36 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
enum machine_mode mode = TYPE_MODE (char_type_node);
rtx addr = expand_expr (address, NULL_RTX, VOIDmode, 0);
rtx mem = gen_rtx_MEM (BLKmode, addr);
+ bool wrote_return_column = false;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (DWARF_FRAME_REGNUM (i) < DWARF_FRAME_REGISTERS)
{
HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
- HOST_WIDE_INT size = GET_MODE_SIZE (reg_raw_mode[i]);
+ enum machine_mode save_mode = reg_raw_mode[i];
+ HOST_WIDE_INT size;
+ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+ save_mode = choose_hard_reg_mode (i, 1, true);
+ if (DWARF_FRAME_REGNUM (i) == DWARF_FRAME_RETURN_COLUMN)
+ {
+ if (save_mode == VOIDmode)
+ continue;
+ wrote_return_column = true;
+ }
+ size = GET_MODE_SIZE (save_mode);
if (offset < 0)
continue;
emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
}
+ if (! wrote_return_column)
+ {
+ enum machine_mode save_mode = Pmode;
+ HOST_WIDE_INT offset = DWARF_FRAME_RETURN_COLUMN * GET_MODE_SIZE (mode);
+ HOST_WIDE_INT size = GET_MODE_SIZE (save_mode);
+ emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
+ }
}
/* Convert a DWARF call frame info. operation to its string name */
@@ -535,7 +553,7 @@ dwarf_cfi_name (unsigned int cfi_opc)
static inline dw_cfi_ref
new_cfi (void)
{
- dw_cfi_ref cfi = (dw_cfi_ref) ggc_alloc (sizeof (dw_cfi_node));
+ dw_cfi_ref cfi = ggc_alloc (sizeof (dw_cfi_node));
cfi->dw_cfi_next = NULL;
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0;
@@ -2230,8 +2248,7 @@ void
dwarf2out_frame_init (void)
{
/* Allocate the initial hunk of the fde_table. */
- fde_table = (dw_fde_ref) ggc_alloc_cleared (FDE_TABLE_INCREMENT
- * sizeof (dw_fde_node));
+ fde_table = ggc_alloc_cleared (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
fde_table_allocated = FDE_TABLE_INCREMENT;
fde_table_in_use = 0;
@@ -2701,8 +2718,7 @@ static inline dw_loc_descr_ref
new_loc_descr (enum dwarf_location_atom op, long unsigned int oprnd1,
long unsigned int oprnd2)
{
- dw_loc_descr_ref descr
- = (dw_loc_descr_ref) ggc_alloc_cleared (sizeof (dw_loc_descr_node));
+ dw_loc_descr_ref descr = ggc_alloc_cleared (sizeof (dw_loc_descr_node));
descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
@@ -4426,7 +4442,7 @@ AT_class (dw_attr_ref a)
static inline void
add_AT_flag (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int flag)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4449,7 +4465,7 @@ AT_flag (dw_attr_ref a)
static inline void
add_AT_int (dw_die_ref die, enum dwarf_attribute attr_kind, long int int_val)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4473,7 +4489,7 @@ static inline void
add_AT_unsigned (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int unsigned_val)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4497,7 +4513,7 @@ static inline void
add_AT_long_long (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int val_hi, long unsigned int val_low)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4513,7 +4529,7 @@ static inline void
add_AT_float (dw_die_ref die, enum dwarf_attribute attr_kind,
unsigned int length, long int *array)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4543,7 +4559,7 @@ debug_str_eq (const void *x1, const void *x2)
static inline void
add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
struct indirect_string_node *node;
void **slot;
@@ -4620,7 +4636,7 @@ AT_string_form (dw_attr_ref a)
static inline void
add_AT_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, dw_die_ref targ_die)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4662,7 +4678,7 @@ set_AT_ref_external (dw_attr_ref a, int i)
static inline void
add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int targ_fde)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4676,7 +4692,7 @@ add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int tar
static inline void
add_AT_loc (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_descr_ref loc)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4697,7 +4713,7 @@ AT_loc (dw_attr_ref a)
static inline void
add_AT_loc_list (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_list_ref loc_list)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4721,7 +4737,7 @@ AT_loc_list (dw_attr_ref a)
static inline void
add_AT_addr (dw_die_ref die, enum dwarf_attribute attr_kind, rtx addr)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4744,7 +4760,7 @@ AT_addr (dw_attr_ref a)
static inline void
add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind, const char *lbl_id)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4758,7 +4774,7 @@ add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind, const char *lbl_i
static inline void
add_AT_lbl_offset (dw_die_ref die, enum dwarf_attribute attr_kind, const char *label)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4772,7 +4788,7 @@ add_AT_lbl_offset (dw_die_ref die, enum dwarf_attribute attr_kind, const char *l
static inline void
add_AT_offset (dw_die_ref die, enum dwarf_attribute attr_kind, long unsigned int offset)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4787,7 +4803,7 @@ static void
add_AT_range_list (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int offset)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -5071,7 +5087,7 @@ splice_child_die (dw_die_ref parent, dw_die_ref child)
static inline dw_die_ref
new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t)
{
- dw_die_ref die = (dw_die_ref) ggc_alloc_cleared (sizeof (die_node));
+ dw_die_ref die = ggc_alloc_cleared (sizeof (die_node));
die->die_tag = tag_value;
@@ -5135,7 +5151,7 @@ equate_decl_number_to_die (tree decl, dw_die_ref decl_die)
decl_die_table = ggc_realloc (decl_die_table,
sizeof (dw_die_ref) * num_allocated);
- memset ((char *) &decl_die_table[decl_die_table_allocated], 0,
+ memset (&decl_die_table[decl_die_table_allocated], 0,
(num_allocated - decl_die_table_allocated) * sizeof (dw_die_ref));
decl_die_table_allocated = num_allocated;
}
@@ -5645,7 +5661,7 @@ compute_section_prefix (dw_die_ref unit_die)
{
const char *die_name = get_AT_string (unit_die, DW_AT_name);
const char *base = die_name ? lbasename (die_name) : "anonymous";
- char *name = (char *) alloca (strlen (base) + 64);
+ char *name = alloca (strlen (base) + 64);
char *p;
int i, mark;
unsigned char checksum[16];
@@ -6036,7 +6052,7 @@ build_abbrev_table (dw_die_ref die)
abbrev_die_table = ggc_realloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
- memset ((char *) &abbrev_die_table[abbrev_die_table_allocated], 0,
+ memset (&abbrev_die_table[abbrev_die_table_allocated], 0,
(n_alloc - abbrev_die_table_allocated) * sizeof (dw_die_ref));
abbrev_die_table_allocated = n_alloc;
}
@@ -6706,7 +6722,7 @@ output_comp_unit (dw_die_ref die, int output_if_empty)
oldsym = die->die_symbol;
if (oldsym)
{
- tmp = (char *) alloca (strlen (oldsym) + 24);
+ tmp = alloca (strlen (oldsym) + 24);
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp;
@@ -6753,9 +6769,8 @@ add_pubname (tree decl, dw_die_ref die)
{
pubname_table_allocated += PUBNAME_TABLE_INCREMENT;
pubname_table
- = (pubname_ref) ggc_realloc (pubname_table,
- (pubname_table_allocated
- * sizeof (pubname_entry)));
+ = ggc_realloc (pubname_table,
+ (pubname_table_allocated * sizeof (pubname_entry)));
memset (pubname_table + pubname_table_in_use, 0,
PUBNAME_TABLE_INCREMENT * sizeof (pubname_entry));
}
@@ -6914,9 +6929,9 @@ add_ranges (tree block)
if (in_use == ranges_table_allocated)
{
ranges_table_allocated += RANGES_TABLE_INCREMENT;
- ranges_table = (dw_ranges_ref)
- ggc_realloc (ranges_table, (ranges_table_allocated
- * sizeof (struct dw_ranges_struct)));
+ ranges_table
+ = ggc_realloc (ranges_table, (ranges_table_allocated
+ * sizeof (struct dw_ranges_struct)));
memset (ranges_table + ranges_table_in_use, 0,
RANGES_TABLE_INCREMENT * sizeof (struct dw_ranges_struct));
}
@@ -7066,10 +7081,8 @@ output_file_names (void)
}
/* Allocate the various arrays we need. */
- files = (struct file_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
- * sizeof (struct file_info));
- dirs = (struct dir_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
- * sizeof (struct dir_info));
+ files = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct file_info));
+ dirs = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct dir_info));
/* Sort the file names. */
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
@@ -7144,8 +7157,8 @@ output_file_names (void)
where we would have to check out every combination of every single
possible prefix. Instead we use a heuristic which provides nearly optimal
results in most cases and never is much off. */
- saved = (int *) alloca (ndirs * sizeof (int));
- savehere = (int *) alloca (ndirs * sizeof (int));
+ saved = alloca (ndirs * sizeof (int));
+ savehere = alloca (ndirs * sizeof (int));
memset (saved, '\0', ndirs * sizeof (saved[0]));
for (i = 0; i < ndirs; i++)
@@ -7202,7 +7215,7 @@ output_file_names (void)
/* We have to emit them in the order they appear in the file_table array
since the index is used in the debug info generation. To do this
efficiently we generate a back-mapping of the indices first. */
- backmap = (int *) alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (int));
+ backmap = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (int));
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
{
backmap[files[i].file_idx] = i;
@@ -8545,6 +8558,24 @@ loc_descriptor_from_tree (tree loc, int addressp)
return 0;
break;
+ case CONSTRUCTOR:
+ {
+ /* Get an RTL for this, if something has been emitted. */
+ rtx rtl = lookup_constant_def (loc);
+ enum machine_mode mode;
+
+ if (GET_CODE (rtl) != MEM)
+ return 0;
+ mode = GET_MODE (rtl);
+ rtl = XEXP (rtl, 0);
+
+ rtl = (*targetm.delegitimize_address) (rtl);
+
+ indirect_p = 1;
+ ret = mem_loc_descriptor (rtl, mode);
+ break;
+ }
+
case TRUTH_AND_EXPR:
case TRUTH_ANDIF_EXPR:
case BIT_AND_EXPR:
@@ -9074,7 +9105,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
unsigned length = GET_MODE_SIZE (mode) / 4;
- long *array = (long *) ggc_alloc (sizeof (long) * length);
+ long *array = ggc_alloc (sizeof (long) * length);
REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
@@ -9475,7 +9506,7 @@ add_name_attribute (dw_die_ref die, const char *name_string)
static void
add_comp_dir_attribute (dw_die_ref die)
{
- const char *wd = getpwd ();
+ const char *wd = get_src_pwd ();
if (wd != NULL)
add_AT_string (die, DW_AT_comp_dir, wd);
}
@@ -9655,7 +9686,7 @@ add_subscript_info (dw_die_ref type_die, tree type)
lower = TYPE_MIN_VALUE (domain);
upper = TYPE_MAX_VALUE (domain);
- /* define the index type. */
+ /* Define the index type. */
if (TREE_TYPE (domain))
{
/* ??? This is probably an Ada unnamed subrange type. Ignore the
@@ -10312,14 +10343,15 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
add_name_attribute (enum_die,
IDENTIFIER_POINTER (TREE_PURPOSE (link)));
- if (host_integerp (TREE_VALUE (link), 0))
+ if (host_integerp (TREE_VALUE (link),
+ TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (link)))))
{
if (tree_int_cst_sgn (TREE_VALUE (link)) < 0)
add_AT_int (enum_die, DW_AT_const_value,
tree_low_cst (TREE_VALUE (link), 0));
else
add_AT_unsigned (enum_die, DW_AT_const_value,
- tree_low_cst (TREE_VALUE (link), 0));
+ tree_low_cst (TREE_VALUE (link), 1));
}
}
}
@@ -10752,7 +10784,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
if (fn_arg_types != NULL)
{
- /* this is the prototyped case, check for ... */
+ /* This is the prototyped case, check for.... */
if (TREE_VALUE (tree_last (fn_arg_types)) != void_type_node)
gen_unspecified_parameters_die (decl, subr_die);
}
@@ -10958,16 +10990,20 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die, int depth)
static void
gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die, int depth)
{
+ tree decl = block_ultimate_origin (stmt);
+
+ /* Emit info for the abstract instance first, if we haven't yet. We
+ must emit this even if the block is abstract, otherwise when we
+ emit the block below (or elsewhere), we may end up trying to emit
+ a die whose origin die hasn't been emitted, and crashing. */
+ dwarf2out_abstract_function (decl);
+
if (! BLOCK_ABSTRACT (stmt))
{
dw_die_ref subr_die
= new_die (DW_TAG_inlined_subroutine, context_die, stmt);
- tree decl = block_ultimate_origin (stmt);
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- /* Emit info for the abstract instance first, if we haven't yet. */
- dwarf2out_abstract_function (decl);
-
add_abstract_origin_attribute (subr_die, decl);
ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL,
BLOCK_NUMBER (stmt));
@@ -12195,12 +12231,11 @@ dwarf2out_source_line (unsigned int line, const char *filename)
{
separate_line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
separate_line_info_table
- = (dw_separate_line_info_ref)
- ggc_realloc (separate_line_info_table,
+ = ggc_realloc (separate_line_info_table,
separate_line_info_table_allocated
* sizeof (dw_separate_line_info_entry));
- memset ((separate_line_info_table
- + separate_line_info_table_in_use),
+ memset (separate_line_info_table
+ + separate_line_info_table_in_use,
0,
(LINE_INFO_TABLE_INCREMENT
* sizeof (dw_separate_line_info_entry)));
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index caed4606643..dfd1f0b57e1 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -942,7 +942,7 @@ static void retry_incomplete_types (void);
#endif
/* Pseudo-ops for pushing the current section onto the section stack (and
- simultaneously changing to a new section) and for poping back to the
+ 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
@@ -2036,9 +2036,8 @@ output_reg_number (rtx rtl)
if (regno >= DWARF_FRAME_REGISTERS)
{
- warning_with_decl (dwarf_last_decl,
- "internal regno botch: `%s' has regno = %d\n",
- regno);
+ 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)));
@@ -3517,8 +3516,8 @@ dienum_push (void)
{
pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT;
pending_sibling_stack
- = (unsigned *) xrealloc (pending_sibling_stack,
- pending_siblings_allocated * sizeof(unsigned));
+ = xrealloc (pending_sibling_stack,
+ pending_siblings_allocated * sizeof(unsigned));
}
pending_siblings++;
@@ -4043,7 +4042,7 @@ output_compile_unit_die (void *arg)
stmt_list_attribute (LINE_BEGIN_LABEL);
{
- const char *wd = getpwd ();
+ const char *wd = get_src_pwd ();
if (wd)
comp_dir_attribute (wd);
}
@@ -4066,7 +4065,7 @@ output_string_type_die (void *arg)
sibling_attribute ();
equate_type_number_to_die_number (type);
member_attribute (TYPE_CONTEXT (type));
- /* this is a fixed length string */
+ /* This is a fixed length string. */
byte_size_attribute (type);
}
@@ -4406,8 +4405,8 @@ pend_type (tree type)
{
pending_types_allocated += PENDING_TYPES_INCREMENT;
pending_types_list
- = (tree *) xrealloc (pending_types_list,
- sizeof (tree) * pending_types_allocated);
+ = xrealloc (pending_types_list,
+ sizeof (tree) * pending_types_allocated);
}
pending_types_list[pending_types++] = type;
@@ -4533,8 +4532,8 @@ add_incomplete_type (tree type)
{
incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
incomplete_types_list
- = (tree *) xrealloc (incomplete_types_list,
- sizeof (tree) * incomplete_types_allocated);
+ = xrealloc (incomplete_types_list,
+ sizeof (tree) * incomplete_types_allocated);
}
incomplete_types_list[incomplete_types++] = type;
@@ -5226,13 +5225,13 @@ output_decl (tree decl, tree containing_scope)
if (fn_arg_types)
{
- /* this is the prototyped case, check for ... */
+ /* 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) */
+ /* This is unprototyped, check for undefined (just declaration). */
if (!DECL_INITIAL (decl))
output_die (output_unspecified_parameters_die, decl);
}
@@ -5851,8 +5850,7 @@ lookup_filename (const char *file_name)
{
ft_entries_allocated += FT_ENTRIES_INCREMENT;
filename_table
- = (filename_entry *)
- xrealloc (filename_table,
+ = xrealloc (filename_table,
ft_entries_allocated * sizeof (filename_entry));
}
@@ -6035,23 +6033,19 @@ dwarfout_init (const char *main_input_filename)
/* Allocate the initial hunk of the pending_sibling_stack. */
pending_sibling_stack
- = (unsigned *)
- xmalloc (PENDING_SIBLINGS_INCREMENT * sizeof (unsigned));
+ = 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
- = (filename_entry *)
- xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
+ 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
- = (tree *) xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
+ pending_types_list = xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
pending_types_allocated = PENDING_TYPES_INCREMENT;
pending_types = 0;
@@ -6119,7 +6113,7 @@ dwarfout_init (const char *main_input_filename)
ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SFNAMES_SECTION);
ASM_OUTPUT_LABEL (asm_out_file, SFNAMES_BEGIN_LABEL);
{
- const char *pwd = getpwd ();
+ const char *pwd = get_src_pwd ();
char *dirname;
if (!pwd)
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index cb05ea8daad..d5ff690cb3f 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -110,9 +110,14 @@ rtx const_true_rtx;
REAL_VALUE_TYPE dconst0;
REAL_VALUE_TYPE dconst1;
REAL_VALUE_TYPE dconst2;
+REAL_VALUE_TYPE dconst3;
+REAL_VALUE_TYPE dconst10;
REAL_VALUE_TYPE dconstm1;
REAL_VALUE_TYPE dconstm2;
REAL_VALUE_TYPE dconsthalf;
+REAL_VALUE_TYPE dconstthird;
+REAL_VALUE_TYPE dconstpi;
+REAL_VALUE_TYPE dconste;
/* All references to the following fixed hard registers go through
these unique rtl objects. On machines where the frame-pointer and
@@ -132,8 +137,6 @@ REAL_VALUE_TYPE dconsthalf;
In an inline procedure, the stack and frame pointer rtxs may not be
used for anything else. */
-rtx struct_value_rtx; /* (REG:Pmode STRUCT_VALUE_REGNUM) */
-rtx struct_value_incoming_rtx; /* (REG:Pmode STRUCT_VALUE_INCOMING_REGNUM) */
rtx static_chain_rtx; /* (REG:Pmode STATIC_CHAIN_REGNUM) */
rtx static_chain_incoming_rtx; /* (REG:Pmode STATIC_CHAIN_INCOMING_REGNUM) */
rtx pic_offset_table_rtx; /* (REG:Pmode PIC_OFFSET_TABLE_REGNUM) */
@@ -206,7 +209,7 @@ int split_branch_probability = -1;
static hashval_t
const_int_htab_hash (const void *x)
{
- return (hashval_t) INTVAL ((struct rtx_def *) x);
+ return (hashval_t) INTVAL ((rtx) x);
}
/* Returns nonzero if the value represented by X (which is really a
@@ -772,7 +775,7 @@ gen_rtvec (int n, ...)
if (n == 0)
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
- vector = (rtx *) alloca (n * sizeof (rtx));
+ vector = alloca (n * sizeof (rtx));
for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx);
@@ -845,8 +848,8 @@ gen_reg_rtx (enum machine_mode mode)
memset (new + old_size, 0, old_size);
f->emit->regno_pointer_align = (unsigned char *) new;
- new1 = (rtx *) ggc_realloc (f->emit->x_regno_reg_rtx,
- old_size * 2 * sizeof (rtx));
+ new1 = ggc_realloc (f->emit->x_regno_reg_rtx,
+ old_size * 2 * sizeof (rtx));
memset (new1 + old_size, 0, old_size * sizeof (rtx));
regno_reg_rtx = new1;
@@ -858,7 +861,7 @@ gen_reg_rtx (enum machine_mode mode)
return val;
}
-/* Generate an register with same attributes as REG,
+/* Generate a register with same attributes as REG,
but offsetted by OFFSET. */
rtx
@@ -4874,7 +4877,7 @@ start_sequence (void)
free_sequence_stack = tem->next;
}
else
- tem = (struct sequence_stack *) ggc_alloc (sizeof (struct sequence_stack));
+ tem = ggc_alloc (sizeof (struct sequence_stack));
tem->next = seq_stack;
tem->first = first_insn;
@@ -5205,7 +5208,7 @@ init_emit (void)
{
struct function *f = cfun;
- f->emit = (struct emit_status *) ggc_alloc (sizeof (struct emit_status));
+ f->emit = ggc_alloc (sizeof (struct emit_status));
first_insn = NULL;
last_insn = NULL;
seq_rtl_expr = NULL;
@@ -5222,11 +5225,11 @@ init_emit (void)
f->emit->regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101;
f->emit->regno_pointer_align
- = (unsigned char *) ggc_alloc_cleared (f->emit->regno_pointer_align_length
- * sizeof (unsigned char));
+ = ggc_alloc_cleared (f->emit->regno_pointer_align_length
+ * sizeof (unsigned char));
regno_reg_rtx
- = (rtx *) ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
+ = ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
@@ -5317,6 +5320,9 @@ init_emit_once (int line_numbers)
enum machine_mode mode;
enum machine_mode double_mode;
+ /* We need reg_raw_mode, so initialize the modes now. */
+ init_reg_modes_once ();
+
/* Initialize the CONST_INT, CONST_DOUBLE, and memory attribute hash
tables. */
const_int_htab = htab_create_ggc (37, const_int_htab_hash,
@@ -5413,13 +5419,24 @@ init_emit_once (int line_numbers)
REAL_VALUE_FROM_INT (dconst0, 0, 0, double_mode);
REAL_VALUE_FROM_INT (dconst1, 1, 0, double_mode);
REAL_VALUE_FROM_INT (dconst2, 2, 0, double_mode);
+ REAL_VALUE_FROM_INT (dconst3, 3, 0, double_mode);
+ REAL_VALUE_FROM_INT (dconst10, 10, 0, double_mode);
REAL_VALUE_FROM_INT (dconstm1, -1, -1, double_mode);
REAL_VALUE_FROM_INT (dconstm2, -2, -1, double_mode);
dconsthalf = dconst1;
dconsthalf.exp--;
- for (i = 0; i <= 2; i++)
+ real_arithmetic (&dconstthird, RDIV_EXPR, &dconst1, &dconst3);
+
+ /* Initialize mathematical constants for constant folding builtins.
+ These constants need to be given to at least 160 bits precision. */
+ real_from_string (&dconstpi,
+ "3.1415926535897932384626433832795028841971693993751058209749445923078");
+ real_from_string (&dconste,
+ "2.7182818284590452353602874713526624977572470936999595749669676277241");
+
+ for (i = 0; i < (int) ARRAY_SIZE (const_tiny_rtx); i++)
{
REAL_VALUE_TYPE *r =
(i == 0 ? &dconst0 : i == 1 ? &dconst1 : &dconst2);
@@ -5464,23 +5481,6 @@ init_emit_once (int line_numbers)
= gen_raw_REG (Pmode, RETURN_ADDRESS_POINTER_REGNUM);
#endif
-#ifdef STRUCT_VALUE
- struct_value_rtx = STRUCT_VALUE;
-#else
- struct_value_rtx = gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM);
-#endif
-
-#ifdef STRUCT_VALUE_INCOMING
- struct_value_incoming_rtx = STRUCT_VALUE_INCOMING;
-#else
-#ifdef STRUCT_VALUE_INCOMING_REGNUM
- struct_value_incoming_rtx
- = gen_rtx_REG (Pmode, STRUCT_VALUE_INCOMING_REGNUM);
-#else
- struct_value_incoming_rtx = struct_value_rtx;
-#endif
-#endif
-
#ifdef STATIC_CHAIN_REGNUM
static_chain_rtx = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
diff --git a/gcc/except.c b/gcc/except.c
index 63a35702b91..edbcda10cf4 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -73,6 +73,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm_p.h"
#include "target.h"
#include "langhooks.h"
+#include "cgraph.h"
/* Provide defaults for stuff that may not be defined when using
sjlj exceptions. */
@@ -458,8 +459,7 @@ init_eh (void)
void
init_eh_for_function (void)
{
- cfun->eh = (struct eh_status *)
- ggc_alloc_cleared (sizeof (struct eh_status));
+ cfun->eh = ggc_alloc_cleared (sizeof (struct eh_status));
}
/* Start an exception handling region. All instructions emitted
@@ -477,7 +477,7 @@ expand_eh_region_start (void)
return;
/* Insert a new blank region as a leaf in the tree. */
- new_region = (struct eh_region *) ggc_alloc_cleared (sizeof (*new_region));
+ new_region = ggc_alloc_cleared (sizeof (*new_region));
cur_region = cfun->eh->cur_region;
new_region->outer = cur_region;
if (cur_region)
@@ -1158,7 +1158,7 @@ add_ehl_entry (rtx label, struct eh_region *region)
LABEL_PRESERVE_P (label) = 1;
- entry = (struct ehl_map_entry *) ggc_alloc (sizeof (*entry));
+ entry = ggc_alloc (sizeof (*entry));
entry->label = label;
entry->region = region;
@@ -1237,8 +1237,7 @@ current_function_has_exception_handlers (void)
static struct eh_region *
duplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map)
{
- struct eh_region *n
- = (struct eh_region *) ggc_alloc_cleared (sizeof (struct eh_region));
+ struct eh_region *n = ggc_alloc_cleared (sizeof (struct eh_region));
n->region_number = o->region_number + cfun->eh->last_region_number;
n->type = o->type;
@@ -1493,7 +1492,7 @@ add_ttypes_entry (htab_t ttypes_hash, tree type)
{
/* Filter value is a 1 based table index. */
- n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n = xmalloc (sizeof (*n));
n->t = type;
n->filter = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + 1;
*slot = n;
@@ -1521,7 +1520,7 @@ add_ehspec_entry (htab_t ehspec_hash, htab_t ttypes_hash, tree list)
{
/* Filter value is a -1 based byte index into a uleb128 buffer. */
- n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n = xmalloc (sizeof (*n));
n->t = list;
n->filter = -(VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) + 1);
*slot = n;
@@ -2142,12 +2141,12 @@ sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info)
dispatch = copy_to_reg (mem);
mem = adjust_address (fc, word_mode, sjlj_fc_data_ofs);
- if (word_mode != Pmode)
+ if (word_mode != ptr_mode)
{
#ifdef POINTERS_EXTEND_UNSIGNED
- mem = convert_memory_address (Pmode, mem);
+ mem = convert_memory_address (ptr_mode, mem);
#else
- mem = convert_to_mode (Pmode, mem, 0);
+ mem = convert_to_mode (ptr_mode, mem, 0);
#endif
}
emit_move_insn (cfun->eh->exc_ptr, mem);
@@ -2187,8 +2186,8 @@ sjlj_build_landing_pads (void)
{
struct sjlj_lp_info *lp_info;
- lp_info = (struct sjlj_lp_info *) xcalloc (cfun->eh->last_region_number + 1,
- sizeof (struct sjlj_lp_info));
+ lp_info = xcalloc (cfun->eh->last_region_number + 1,
+ sizeof (struct sjlj_lp_info));
if (sjlj_find_directly_reachable_regions (lp_info))
{
@@ -2975,10 +2974,7 @@ expand_builtin_frob_return_addr (tree addr_tree)
{
rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, 0);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (addr) != Pmode)
- addr = convert_memory_address (Pmode, addr);
-#endif
+ addr = convert_memory_address (Pmode, addr);
#ifdef RETURN_ADDR_OFFSET
addr = force_reg (Pmode, addr);
@@ -2999,10 +2995,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
#ifdef EH_RETURN_STACKADJ_RTX
tmp = expand_expr (stackadj_tree, cfun->eh->ehr_stackadj, VOIDmode, 0);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (tmp) != Pmode)
- tmp = convert_memory_address (Pmode, tmp);
-#endif
+ tmp = convert_memory_address (Pmode, tmp);
if (!cfun->eh->ehr_stackadj)
cfun->eh->ehr_stackadj = copy_to_reg (tmp);
else if (tmp != cfun->eh->ehr_stackadj)
@@ -3010,10 +3003,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
#endif
tmp = expand_expr (handler_tree, cfun->eh->ehr_handler, VOIDmode, 0);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (tmp) != Pmode)
- tmp = convert_memory_address (Pmode, tmp);
-#endif
+ tmp = convert_memory_address (Pmode, tmp);
if (!cfun->eh->ehr_handler)
cfun->eh->ehr_handler = copy_to_reg (tmp);
else if (tmp != cfun->eh->ehr_handler)
@@ -3108,7 +3098,7 @@ add_action_record (htab_t ar_hash, int filter, int next)
if ((new = *slot) == NULL)
{
- new = (struct action_record *) xmalloc (sizeof (*new));
+ new = xmalloc (sizeof (*new));
new->offset = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
new->filter = filter;
new->next = next;
@@ -3239,8 +3229,7 @@ add_call_site (rtx landing_pad, int action)
if (used >= size)
{
size = (size ? size * 2 : 64);
- data = (struct call_site_record *)
- ggc_realloc (data, sizeof (*data) * size);
+ data = ggc_realloc (data, sizeof (*data) * size);
cfun->eh->call_site_data = data;
cfun->eh->call_site_data_size = size;
}
@@ -3707,11 +3696,28 @@ output_function_exception_table (void)
rtx value;
if (type == NULL_TREE)
- type = integer_zero_node;
+ value = const0_rtx;
else
- type = lookup_type_for_runtime (type);
+ {
+ struct cgraph_varpool_node *node;
+
+ type = lookup_type_for_runtime (type);
+ value = expand_expr (type, NULL_RTX, VOIDmode, EXPAND_INITIALIZER);
+
+ /* Let cgraph know that the rtti decl is used. Not all of the
+ paths below go through assemble_integer, which would take
+ care of this for us. */
+ if (TREE_CODE (type) == ADDR_EXPR)
+ {
+ type = TREE_OPERAND (type, 0);
+ node = cgraph_varpool_node (type);
+ if (node)
+ cgraph_varpool_mark_needed_node (node);
+ }
+ else if (TREE_CODE (type) != INTEGER_CST)
+ abort ();
+ }
- value = expand_expr (type, NULL_RTX, VOIDmode, EXPAND_INITIALIZER);
if (tt_format == DW_EH_PE_absptr || tt_format == DW_EH_PE_aligned)
assemble_integer (value, tt_format_size,
tt_format_size * BITS_PER_UNIT, 1);
diff --git a/gcc/explow.c b/gcc/explow.c
index e9ca57b7803..56f9a3ff04a 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -303,8 +303,6 @@ break_out_memory_refs (rtx x)
return x;
}
-#ifdef POINTERS_EXTEND_UNSIGNED
-
/* Given X, a memory address in ptr_mode, convert it to an address
in Pmode, or vice versa (TO_MODE says which way). We take advantage of
the fact that pointers are not allowed to overflow by commuting arithmetic
@@ -312,12 +310,22 @@ break_out_memory_refs (rtx x)
used. */
rtx
-convert_memory_address (enum machine_mode to_mode, rtx x)
+convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED,
+ rtx x)
{
- enum machine_mode from_mode = to_mode == ptr_mode ? Pmode : ptr_mode;
+#ifndef POINTERS_EXTEND_UNSIGNED
+ return x;
+#else /* defined(POINTERS_EXTEND_UNSIGNED) */
+ enum machine_mode from_mode;
rtx temp;
enum rtx_code code;
+ /* If X already has the right mode, just return it. */
+ if (GET_MODE (x) == to_mode)
+ return x;
+
+ from_mode = to_mode == ptr_mode ? Pmode : ptr_mode;
+
/* Here we handle some special cases. If none of them apply, fall through
to the default case. */
switch (GET_CODE (x))
@@ -381,8 +389,8 @@ convert_memory_address (enum machine_mode to_mode, rtx x)
return convert_modes (to_mode, from_mode,
x, POINTERS_EXTEND_UNSIGNED);
+#endif /* defined(POINTERS_EXTEND_UNSIGNED) */
}
-#endif
/* Given a memory address or facsimile X, construct a new address,
currently equivalent, that is stable: future stores won't change it.
@@ -434,10 +442,7 @@ memory_address (enum machine_mode mode, rtx x)
if (GET_CODE (x) == ADDRESSOF)
return x;
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (x) != Pmode)
- x = convert_memory_address (Pmode, x);
-#endif
+ x = convert_memory_address (Pmode, x);
/* By passing constant addresses thru registers
we get a chance to cse them. */
@@ -1419,11 +1424,7 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
stack_pointer_rtx,
plus_constant (size, first)));
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (addr) != ptr_mode)
- addr = convert_memory_address (ptr_mode, addr);
-#endif
-
+ addr = convert_memory_address (ptr_mode, addr);
emit_library_call (stack_check_libfunc, LCT_NORMAL, VOIDmode, 1, addr,
ptr_mode);
}
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 883eff5b52b..6acc8956e26 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2096,8 +2096,8 @@ synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
/* We'll be needing a couple extra algorithm structures now. */
- alg_in = (struct algorithm *)alloca (sizeof (struct algorithm));
- best_alg = (struct algorithm *)alloca (sizeof (struct algorithm));
+ alg_in = alloca (sizeof (struct algorithm));
+ best_alg = alloca (sizeof (struct algorithm));
/* If we have a group of zero bits at the low-order part of T, try
multiplying by the remaining bits and then doing a shift. */
@@ -2300,7 +2300,8 @@ synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
you should swap the two operands if OP0 would be constant. */
rtx
-expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target, int unsignedp)
+expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
+ int unsignedp)
{
rtx const_op1 = op1;
@@ -2514,6 +2515,28 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target, int unsignedp
}
}
+ if (GET_CODE (op0) == CONST_DOUBLE)
+ {
+ rtx temp = op0;
+ op0 = op1;
+ op1 = temp;
+ }
+
+ /* Expand x*2.0 as x+x. */
+ if (GET_CODE (op1) == CONST_DOUBLE
+ && GET_MODE_CLASS (mode) == MODE_FLOAT)
+ {
+ REAL_VALUE_TYPE d;
+ REAL_VALUE_FROM_CONST_DOUBLE (d, op1);
+
+ if (REAL_VALUES_EQUAL (d, dconst2))
+ {
+ op0 = force_reg (GET_MODE (op0), op0);
+ return expand_binop (mode, add_optab, op0, op0,
+ target, unsignedp, OPTAB_LIB_WIDEN);
+ }
+ }
+
/* This used to use umul_optab if unsigned, but for non-widening multiply
there is no difference between signed and unsigned. */
op0 = expand_binop (mode,
@@ -2605,7 +2628,7 @@ choose_multiplier (unsigned HOST_WIDE_INT d, int n, int precision,
abort ();
if (mhigh_hi > 1 || mlow_hi > 1)
abort ();
- /* assert that mlow < mhigh. */
+ /* Assert that mlow < mhigh. */
if (! (mlow_hi < mhigh_hi || (mlow_hi == mhigh_hi && mlow_lo < mhigh_lo)))
abort ();
@@ -3801,7 +3824,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
build_int_2 (pre_shift, 0), NULL_RTX, unsignedp);
quotient = expand_mult (compute_mode, t1,
gen_int_mode (ml, compute_mode),
- NULL_RTX, 0);
+ NULL_RTX, 1);
insn = get_last_insn ();
set_unique_reg_note (insn,
@@ -4092,12 +4115,10 @@ make_tree (tree type, rtx x)
t = make_node (RTL_EXPR);
TREE_TYPE (t) = type;
-#ifdef POINTERS_EXTEND_UNSIGNED
/* If TYPE is a POINTER_TYPE, X might be Pmode with TYPE_MODE being
ptr_mode. So convert. */
- if (POINTER_TYPE_P (type) && GET_MODE (x) != TYPE_MODE (type))
+ if (POINTER_TYPE_P (type))
x = convert_memory_address (TYPE_MODE (type), x);
-#endif
RTL_EXPR_RTL (t) = x;
/* There are no insns to be output
diff --git a/gcc/expr.c b/gcc/expr.c
index 6a300585716..633f4a75537 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -151,7 +151,6 @@ static tree clear_storage_libcall_fn (int);
static rtx compress_float_constant (rtx, rtx);
static rtx get_subtarget (rtx);
static int is_zeros_p (tree);
-static int mostly_zeros_p (tree);
static void store_constructor_field (rtx, unsigned HOST_WIDE_INT,
HOST_WIDE_INT, enum machine_mode,
tree, tree, int, int);
@@ -165,6 +164,8 @@ static unsigned HOST_WIDE_INT highest_pow2_factor_for_type (tree, tree);
static int is_aligning_offset (tree, tree);
static rtx expand_increment (tree, int, int);
+static void expand_operands (tree, tree, rtx, rtx*, rtx*,
+ enum expand_modifier);
static rtx do_store_flag (tree, rtx, enum machine_mode, int);
#ifdef PUSH_ROUNDING
static void emit_single_push_insn (enum machine_mode, rtx, tree);
@@ -234,6 +235,9 @@ enum insn_code movstr_optab[NUM_MACHINE_MODES];
/* This array records the insn_code of insns to perform block clears. */
enum insn_code clrstr_optab[NUM_MACHINE_MODES];
+/* Stack of EXPR_WITH_FILE_LOCATION nested expressions. */
+struct file_stack *expr_wfl_stack;
+
/* SLOW_UNALIGNED_ACCESS is nonzero if unaligned accesses are very slow. */
#ifndef SLOW_UNALIGNED_ACCESS
@@ -339,15 +343,7 @@ init_expr_once (void)
void
init_expr (void)
{
- cfun->expr = (struct expr_status *) ggc_alloc (sizeof (struct expr_status));
-
- pending_chain = 0;
- pending_stack_adjust = 0;
- stack_pointer_delta = 0;
- inhibit_defer_pop = 0;
- saveregs_value = 0;
- apply_args_value = 0;
- forced_labels = 0;
+ cfun->expr = ggc_alloc_cleared (sizeof (struct expr_status));
}
/* Small sanity check that the queue is empty at the end of a function. */
@@ -1420,6 +1416,15 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns
return gen_lowpart (mode, x);
}
+ /* Converting from integer constant into mode is always equivalent to an
+ subreg operation. */
+ if (VECTOR_MODE_P (mode) && GET_MODE (x) == VOIDmode)
+ {
+ if (GET_MODE_BITSIZE (mode) != GET_MODE_BITSIZE (oldmode))
+ abort ();
+ return simplify_gen_subreg (mode, x, oldmode, 0);
+ }
+
temp = gen_reg_rtx (mode);
convert_move (temp, x, unsignedp);
return temp;
@@ -1766,6 +1771,9 @@ emit_block_move (rtx x, rtx y, rtx size, enum block_op_methods method)
can be incorrect is coming from __builtin_memcpy. */
if (GET_CODE (size) == CONST_INT)
{
+ if (INTVAL (size) == 0)
+ return 0;
+
x = shallow_copy_rtx (x);
y = shallow_copy_rtx (y);
set_mem_size (x, size);
@@ -1949,10 +1957,8 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size)
dst_addr = copy_to_mode_reg (Pmode, XEXP (dst, 0));
src_addr = copy_to_mode_reg (Pmode, XEXP (src, 0));
-#ifdef POINTERS_EXTEND_UNSIGNED
dst_addr = convert_memory_address (ptr_mode, dst_addr);
src_addr = convert_memory_address (ptr_mode, src_addr);
-#endif
dst_tree = make_tree (ptr_type_node, dst_addr);
src_tree = make_tree (ptr_type_node, src_addr);
@@ -1995,7 +2001,6 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size)
call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
call_expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
call_expr, arg_list, NULL_TREE);
- TREE_SIDE_EFFECTS (call_expr) = 1;
retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
@@ -2221,7 +2226,7 @@ gen_group_rtx (rtx orig)
abort ();
length = XVECLEN (orig, 0);
- tmps = (rtx *) alloca (sizeof (rtx) * length);
+ tmps = alloca (sizeof (rtx) * length);
/* Skip a NULL entry in first slot. */
i = XEXP (XVECEXP (orig, 0, 0), 0) ? 0 : 1;
@@ -2240,18 +2245,13 @@ gen_group_rtx (rtx orig)
return gen_rtx_PARALLEL (GET_MODE (orig), gen_rtvec_v (length, tmps));
}
-/* Emit code to move a block SRC to a block DST, where DST is non-consecutive
- registers represented by a PARALLEL. SSIZE represents the total size of
- block SRC in bytes, or -1 if not known. */
-/* ??? If SSIZE % UNITS_PER_WORD != 0, we make the blatant assumption that
- the balance will be in what would be the low-order memory addresses, i.e.
- left justified for big endian, right justified for little endian. This
- happens to be true for the targets currently using this support. If this
- ever changes, a new target macro along the lines of FUNCTION_ARG_PADDING
- would be needed. */
+/* Emit code to move a block ORIG_SRC of type TYPE to a block DST,
+ where DST is non-consecutive registers represented by a PARALLEL.
+ SSIZE represents the total size of block ORIG_SRC in bytes, or -1
+ if not known. */
void
-emit_group_load (rtx dst, rtx orig_src, int ssize)
+emit_group_load (rtx dst, rtx orig_src, tree type ATTRIBUTE_UNUSED, int ssize)
{
rtx *tmps, src;
int start, i;
@@ -2266,7 +2266,7 @@ emit_group_load (rtx dst, rtx orig_src, int ssize)
else
start = 1;
- tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (dst, 0));
+ tmps = alloca (sizeof (rtx) * XVECLEN (dst, 0));
/* Process the pieces. */
for (i = start; i < XVECLEN (dst, 0); i++)
@@ -2279,7 +2279,17 @@ emit_group_load (rtx dst, rtx orig_src, int ssize)
/* Handle trailing fragments that run over the size of the struct. */
if (ssize >= 0 && bytepos + (HOST_WIDE_INT) bytelen > ssize)
{
- shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
+ /* Arrange to shift the fragment to where it belongs.
+ extract_bit_field loads to the lsb of the reg. */
+ if (
+#ifdef BLOCK_REG_PADDING
+ BLOCK_REG_PADDING (GET_MODE (orig_src), type, i == start)
+ == (BYTES_BIG_ENDIAN ? upward : downward)
+#else
+ BYTES_BIG_ENDIAN
+#endif
+ )
+ shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
bytelen = ssize - bytepos;
if (bytelen <= 0)
abort ();
@@ -2304,7 +2314,8 @@ emit_group_load (rtx dst, rtx orig_src, int ssize)
/* Optimize the access just a bit. */
if (GET_CODE (src) == MEM
- && MEM_ALIGN (src) >= GET_MODE_ALIGNMENT (mode)
+ && (! SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (src))
+ || MEM_ALIGN (src) >= GET_MODE_ALIGNMENT (mode))
&& bytepos * BITS_PER_UNIT % GET_MODE_ALIGNMENT (mode) == 0
&& bytelen == GET_MODE_SIZE (mode))
{
@@ -2360,7 +2371,7 @@ emit_group_load (rtx dst, rtx orig_src, int ssize)
bytepos * BITS_PER_UNIT, 1, NULL_RTX,
mode, mode, ssize);
- if (BYTES_BIG_ENDIAN && shift)
+ if (shift)
expand_binop (mode, ashl_optab, tmps[i], GEN_INT (shift),
tmps[i], 0, OPTAB_WIDEN);
}
@@ -2391,12 +2402,13 @@ emit_group_move (rtx dst, rtx src)
XEXP (XVECEXP (src, 0, i), 0));
}
-/* Emit code to move a block SRC to a block DST, where SRC is non-consecutive
- registers represented by a PARALLEL. SSIZE represents the total size of
- block DST, or -1 if not known. */
+/* Emit code to move a block SRC to a block ORIG_DST of type TYPE,
+ where SRC is non-consecutive registers represented by a PARALLEL.
+ SSIZE represents the total size of block ORIG_DST, or -1 if not
+ known. */
void
-emit_group_store (rtx orig_dst, rtx src, int ssize)
+emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
{
rtx *tmps, dst;
int start, i;
@@ -2411,7 +2423,7 @@ emit_group_store (rtx orig_dst, rtx src, int ssize)
else
start = 1;
- tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (src, 0));
+ tmps = alloca (sizeof (rtx) * XVECLEN (src, 0));
/* Copy the (probable) hard regs into pseudos. */
for (i = start; i < XVECLEN (src, 0); i++)
@@ -2440,8 +2452,8 @@ emit_group_store (rtx orig_dst, rtx src, int ssize)
the temporary. */
temp = assign_stack_temp (GET_MODE (dst), ssize, 0);
- emit_group_store (temp, src, ssize);
- emit_group_load (dst, temp, ssize);
+ emit_group_store (temp, src, type, ssize);
+ emit_group_load (dst, temp, type, ssize);
return;
}
else if (GET_CODE (dst) != MEM && GET_CODE (dst) != CONCAT)
@@ -2462,7 +2474,16 @@ emit_group_store (rtx orig_dst, rtx src, int ssize)
/* Handle trailing fragments that run over the size of the struct. */
if (ssize >= 0 && bytepos + (HOST_WIDE_INT) bytelen > ssize)
{
- if (BYTES_BIG_ENDIAN)
+ /* store_bit_field always takes its value from the lsb.
+ Move the fragment to the lsb if it's not already there. */
+ if (
+#ifdef BLOCK_REG_PADDING
+ BLOCK_REG_PADDING (GET_MODE (orig_dst), type, i == start)
+ == (BYTES_BIG_ENDIAN ? upward : downward)
+#else
+ BYTES_BIG_ENDIAN
+#endif
+ )
{
int shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
expand_binop (mode, ashr_optab, tmps[i], GEN_INT (shift),
@@ -2495,7 +2516,8 @@ emit_group_store (rtx orig_dst, rtx src, int ssize)
/* Optimize the access just a bit. */
if (GET_CODE (dest) == MEM
- && MEM_ALIGN (dest) >= GET_MODE_ALIGNMENT (mode)
+ && (! SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (dest))
+ || MEM_ALIGN (dest) >= GET_MODE_ALIGNMENT (mode))
&& bytepos * BITS_PER_UNIT % GET_MODE_ALIGNMENT (mode) == 0
&& bytelen == GET_MODE_SIZE (mode))
emit_move_insn (adjust_address (dest, mode, bytepos), tmps[i]);
@@ -2958,7 +2980,7 @@ clear_storage (rtx object, rtx size)
object = protect_from_queue (object, 1);
size = protect_from_queue (size, 0);
- if (GET_CODE (size) == CONST_INT && INTVAL (size) == 0)
+ if (size == const0_rtx)
;
else if (GET_CODE (size) == CONST_INT
&& CLEAR_BY_PIECES_P (INTVAL (size), align))
@@ -3092,7 +3114,6 @@ clear_storage_via_libcall (rtx object, rtx size)
call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
call_expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
call_expr, arg_list, NULL_TREE);
- TREE_SIDE_EFFECTS (call_expr) = 1;
retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
@@ -4076,7 +4097,7 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size,
/* Handle calls that pass values in multiple non-contiguous locations.
The Irix 6 ABI has examples of this. */
if (GET_CODE (reg) == PARALLEL)
- emit_group_load (reg, x, -1); /* ??? size? */
+ emit_group_load (reg, x, type, -1);
else
move_block_to_reg (REGNO (reg), x, partial, mode);
}
@@ -4111,16 +4132,10 @@ get_subtarget (rtx x)
If WANT_VALUE is nonzero, return an rtx for the value of TO.
(This may contain a QUEUED rtx;
if the value is constant, this rtx is a constant.)
- Otherwise, the returned value is NULL_RTX.
-
- SUGGEST_REG is no longer actually used.
- It used to mean, copy the value through a register
- and return that register, if that is possible.
- We now use WANT_VALUE to decide whether to do this. */
+ Otherwise, the returned value is NULL_RTX. */
rtx
-expand_assignment (tree to, tree from, int want_value,
- int suggest_reg ATTRIBUTE_UNUSED)
+expand_assignment (tree to, tree from, int want_value)
{
rtx to_rtx = 0;
rtx result;
@@ -4261,7 +4276,7 @@ expand_assignment (tree to, tree from, int want_value,
since it might be a promoted variable where the zero- or sign- extension
needs to be done. Handling this in the normal way is safe because no
computation is done before the call. */
- if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from)
+ if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from, from)
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST
&& ! ((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL)
&& GET_CODE (DECL_RTL (to)) == REG))
@@ -4276,16 +4291,14 @@ expand_assignment (tree to, tree from, int want_value,
/* Handle calls that return values in multiple non-contiguous locations.
The Irix 6 ABI has examples of this. */
if (GET_CODE (to_rtx) == PARALLEL)
- emit_group_load (to_rtx, value, int_size_in_bytes (TREE_TYPE (from)));
+ emit_group_load (to_rtx, value, TREE_TYPE (from),
+ int_size_in_bytes (TREE_TYPE (from)));
else if (GET_MODE (to_rtx) == BLKmode)
emit_block_move (to_rtx, value, expr_size (from), BLOCK_OP_NORMAL);
else
{
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (POINTER_TYPE_P (TREE_TYPE (to))
- && GET_MODE (to_rtx) != GET_MODE (value))
+ if (POINTER_TYPE_P (TREE_TYPE (to)))
value = convert_memory_address (GET_MODE (to_rtx), value);
-#endif
emit_move_insn (to_rtx, value);
}
preserve_temp_slots (to_rtx);
@@ -4310,7 +4323,8 @@ expand_assignment (tree to, tree from, int want_value,
temp = expand_expr (from, 0, GET_MODE (to_rtx), 0);
if (GET_CODE (to_rtx) == PARALLEL)
- emit_group_load (to_rtx, temp, int_size_in_bytes (TREE_TYPE (from)));
+ emit_group_load (to_rtx, temp, TREE_TYPE (from),
+ int_size_in_bytes (TREE_TYPE (from)));
else
emit_move_insn (to_rtx, temp);
@@ -4720,7 +4734,8 @@ store_expr (tree exp, rtx target, int want_value)
/* Handle calls that return values in multiple non-contiguous locations.
The Irix 6 ABI has examples of this. */
else if (GET_CODE (target) == PARALLEL)
- emit_group_load (target, temp, int_size_in_bytes (TREE_TYPE (exp)));
+ emit_group_load (target, temp, TREE_TYPE (exp),
+ int_size_in_bytes (TREE_TYPE (exp)));
else if (GET_MODE (temp) == BLKmode)
emit_block_move (target, temp, expr_size (exp),
(want_value & 2
@@ -4749,7 +4764,7 @@ store_expr (tree exp, rtx target, int want_value)
return target;
}
-/* Return 1 if EXP just contains zeros. */
+/* Return 1 if EXP just contains zeros. FIXME merge with initializer_zerop. */
static int
is_zeros_p (tree exp)
@@ -4798,7 +4813,7 @@ is_zeros_p (tree exp)
/* Return 1 if EXP contains mostly (3/4) zeros. */
-static int
+int
mostly_zeros_p (tree exp)
{
if (TREE_CODE (exp) == CONSTRUCTOR)
@@ -5371,7 +5386,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{
unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
- char *bit_buffer = (char *) alloca (nbits);
+ char *bit_buffer = alloca (nbits);
HOST_WIDE_INT word = 0;
unsigned int bit_pos = 0;
unsigned int ibit = 0;
@@ -6246,10 +6261,6 @@ safe_from_p (rtx x, tree exp, int top_p)
part of the expression. */
return safe_from_p (x, TREE_OPERAND (exp, 1), 0);
- case METHOD_CALL_EXPR:
- /* This takes an rtx argument, but shouldn't appear here. */
- abort ();
-
default:
break;
}
@@ -6381,7 +6392,7 @@ highest_pow2_factor (tree exp)
/* We can find the lowest bit that's a one. If the low
HOST_BITS_PER_WIDE_INT bits are zero, return BIGGEST_ALIGNMENT.
We need to handle this case since we can find it in a COND_EXPR,
- a MIN_EXPR, or a MAX_EXPR. If the constant overlows, we have an
+ a MIN_EXPR, or a MAX_EXPR. If the constant overflows, we have an
erroneous program, so return BIGGEST_ALIGNMENT to avoid any
later ICE. */
if (TREE_CONSTANT_OVERFLOW (exp))
@@ -6512,6 +6523,30 @@ find_placeholder (tree exp, tree *plist)
return 0;
}
+
+/* Subroutine of expand_expr. Expand the two operands of a binary
+ expression EXP0 and EXP1 placing the results in OP0 and OP1.
+ The value may be stored in TARGET if TARGET is nonzero. The
+ MODIFIER argument is as documented by expand_expr. */
+
+static void
+expand_operands (tree exp0, tree exp1, rtx target, rtx *op0, rtx *op1,
+ enum expand_modifier modifier)
+{
+ if (! safe_from_p (target, exp1, 1))
+ target = 0;
+ if (operand_equal_p (exp0, exp1, 0))
+ {
+ *op0 = expand_expr (exp0, target, VOIDmode, modifier);
+ *op1 = copy_rtx (*op0);
+ }
+ else
+ {
+ *op0 = expand_expr (exp0, target, VOIDmode, modifier);
+ *op1 = expand_expr (exp1, NULL_RTX, VOIDmode, modifier);
+ }
+}
+
/* expand_expr: generate code for computing expression EXP.
An rtx for the computed value is returned. The value is never null.
@@ -6556,7 +6591,8 @@ find_placeholder (tree exp, tree *plist)
emit_block_move will be flagged with BLOCK_OP_CALL_PARM. */
rtx
-expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier modifier)
+expand_expr (tree exp, rtx target, enum machine_mode tmode,
+ enum expand_modifier modifier)
{
rtx op0, op1, temp;
tree type = TREE_TYPE (exp);
@@ -6693,7 +6729,7 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
if (! cse_not_expected && mode != BLKmode && target
&& (GET_CODE (target) != REG || REGNO (target) < FIRST_PSEUDO_REGISTER)
&& ! (code == CONSTRUCTOR && GET_MODE_SIZE (mode) > UNITS_PER_WORD)
- && ! (code == CALL_EXPR && aggregate_value_p (exp)))
+ && ! (code == CALL_EXPR && aggregate_value_p (exp, exp)))
target = 0;
switch (code)
@@ -6721,7 +6757,7 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
case PARM_DECL:
if (!DECL_RTL_SET_P (exp))
{
- error_with_decl (exp, "prior parameter's size depends on `%s'");
+ error ("%Jprior parameter's size depends on '%D'", exp, exp);
return CONST0_RTX (mode);
}
@@ -6920,14 +6956,23 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
case EXPR_WITH_FILE_LOCATION:
{
rtx to_return;
- location_t saved_loc = input_location;
+ struct file_stack fs;
+
+ fs.location = input_location;
+ fs.next = expr_wfl_stack;
input_filename = EXPR_WFL_FILENAME (exp);
input_line = EXPR_WFL_LINENO (exp);
+ expr_wfl_stack = &fs;
if (EXPR_WFL_EMIT_LINE_NOTE (exp))
emit_line_note (input_location);
/* Possibly avoid switching back and forth here. */
- to_return = expand_expr (EXPR_WFL_NODE (exp), target, tmode, modifier);
- input_location = saved_loc;
+ to_return = expand_expr (EXPR_WFL_NODE (exp),
+ (ignore ? const0_rtx : target),
+ tmode, modifier);
+ if (expr_wfl_stack != &fs)
+ abort ();
+ input_location = fs.location;
+ expr_wfl_stack = fs.next;
return to_return;
}
@@ -7440,39 +7485,41 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
op0 = validize_mem (force_const_mem (mode, op0));
}
+ /* Otherwise, if this object not in memory and we either have an
+ offset or a BLKmode result, put it there. This case can't occur in
+ C, but can in Ada if we have unchecked conversion of an expression
+ from a scalar type to an array or record type or for an
+ ARRAY_RANGE_REF whose type is BLKmode. */
+ else if (GET_CODE (op0) != MEM
+ && (offset != 0
+ || (code == ARRAY_RANGE_REF && mode == BLKmode)))
+ {
+ /* If the operand is a SAVE_EXPR, we can deal with this by
+ forcing the SAVE_EXPR into memory. */
+ if (TREE_CODE (TREE_OPERAND (exp, 0)) == SAVE_EXPR)
+ {
+ put_var_into_stack (TREE_OPERAND (exp, 0),
+ /*rescan=*/true);
+ op0 = SAVE_EXPR_RTL (TREE_OPERAND (exp, 0));
+ }
+ else
+ {
+ tree nt
+ = build_qualified_type (TREE_TYPE (tem),
+ (TYPE_QUALS (TREE_TYPE (tem))
+ | TYPE_QUAL_CONST));
+ rtx memloc = assign_temp (nt, 1, 1, 1);
+
+ emit_move_insn (memloc, op0);
+ op0 = memloc;
+ }
+ }
+
if (offset != 0)
{
rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode,
EXPAND_SUM);
- /* If this object is in a register, put it into memory.
- This case can't occur in C, but can in Ada if we have
- unchecked conversion of an expression from a scalar type to
- an array or record type. */
- if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
- || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF)
- {
- /* If the operand is a SAVE_EXPR, we can deal with this by
- forcing the SAVE_EXPR into memory. */
- if (TREE_CODE (TREE_OPERAND (exp, 0)) == SAVE_EXPR)
- {
- put_var_into_stack (TREE_OPERAND (exp, 0),
- /*rescan=*/true);
- op0 = SAVE_EXPR_RTL (TREE_OPERAND (exp, 0));
- }
- else
- {
- tree nt
- = build_qualified_type (TREE_TYPE (tem),
- (TYPE_QUALS (TREE_TYPE (tem))
- | TYPE_QUAL_CONST));
- rtx memloc = assign_temp (nt, 1, 1, 1);
-
- emit_move_insn (memloc, op0);
- op0 = memloc;
- }
- }
-
if (GET_CODE (op0) != MEM)
abort ();
@@ -8096,11 +8143,11 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
{
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX,
VOIDmode, modifier);
- /* Don't go to both_summands if modifier
- says it's not right to return a PLUS. */
- if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
- goto binop2;
- goto both_summands;
+ /* Return a PLUS if modifier says it's OK. */
+ if (modifier == EXPAND_SUM
+ || modifier == EXPAND_INITIALIZER)
+ return simplify_gen_binary (PLUS, mode, op0, op1);
+ goto binop2;
}
/* Use immed_double_const to ensure that the constant is
truncated according to the mode of OP1, then sign extended
@@ -8127,12 +8174,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
if ((modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
|| mode != ptr_mode)
{
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- if (! operand_equal_p (TREE_OPERAND (exp, 0),
- TREE_OPERAND (exp, 1), 0))
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
- else
- op1 = op0;
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ subtarget, &op0, &op1, 0);
if (op0 == const0_rtx)
return op1;
if (op1 == const0_rtx)
@@ -8140,62 +8183,9 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
goto binop2;
}
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier);
- if (! operand_equal_p (TREE_OPERAND (exp, 0),
- TREE_OPERAND (exp, 1), 0))
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX,
- VOIDmode, modifier);
- else
- op1 = op0;
-
- /* We come here from MINUS_EXPR when the second operand is a
- constant. */
- both_summands:
- /* Make sure any term that's a sum with a constant comes last. */
- if (GET_CODE (op0) == PLUS
- && CONSTANT_P (XEXP (op0, 1)))
- {
- temp = op0;
- op0 = op1;
- op1 = temp;
- }
- /* If adding to a sum including a constant,
- associate it to put the constant outside. */
- if (GET_CODE (op1) == PLUS
- && CONSTANT_P (XEXP (op1, 1)))
- {
- rtx constant_term = const0_rtx;
-
- temp = simplify_binary_operation (PLUS, mode, XEXP (op1, 0), op0);
- if (temp != 0)
- op0 = temp;
- /* Ensure that MULT comes first if there is one. */
- else if (GET_CODE (op0) == MULT)
- op0 = gen_rtx_PLUS (mode, op0, XEXP (op1, 0));
- else
- op0 = gen_rtx_PLUS (mode, XEXP (op1, 0), op0);
-
- /* Let's also eliminate constants from op0 if possible. */
- op0 = eliminate_constant_term (op0, &constant_term);
-
- /* CONSTANT_TERM and XEXP (op1, 1) are known to be constant, so
- their sum should be a constant. Form it into OP1, since the
- result we want will then be OP0 + OP1. */
-
- temp = simplify_binary_operation (PLUS, mode, constant_term,
- XEXP (op1, 1));
- if (temp != 0)
- op1 = temp;
- else
- op1 = gen_rtx_PLUS (mode, constant_term, XEXP (op1, 1));
- }
-
- /* Put a constant term last and put a multiplication first. */
- if (CONSTANT_P (op0) || GET_CODE (op1) == MULT)
- temp = op1, op1 = op0, op0 = temp;
-
- temp = simplify_binary_operation (PLUS, mode, op0, op1);
- return temp ? temp : gen_rtx_PLUS (mode, op0, op1);
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ subtarget, &op0, &op1, modifier);
+ return simplify_gen_binary (PLUS, mode, op0, op1);
case MINUS_EXPR:
/* For initializers, we are allowed to return a MINUS of two
@@ -8207,10 +8197,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
&& really_constant_p (TREE_OPERAND (exp, 0))
&& really_constant_p (TREE_OPERAND (exp, 1)))
{
- rtx op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode,
- modifier);
- rtx op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode,
- modifier);
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ NULL_RTX, &op0, &op1, modifier);
/* If the last operand is a CONST_INT, use plus_constant of
the negated constant. Else make the MINUS. */
@@ -8232,17 +8220,14 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
|| mode != ptr_mode)
goto binop;
- if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1))
- subtarget = 0;
-
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, modifier);
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ subtarget, &op0, &op1, modifier);
/* Convert A - const to A + (-const). */
if (GET_CODE (op1) == CONST_INT)
{
op1 = negate_rtx (mode, op1);
- goto both_summands;
+ return simplify_gen_binary (PLUS, mode, op0, op1);
}
goto binop2;
@@ -8331,14 +8316,14 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
{
if (this_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
{
- op0 = expand_expr (TREE_OPERAND (TREE_OPERAND (exp, 0), 0),
- NULL_RTX, VOIDmode, 0);
if (TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST)
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX,
- VOIDmode, 0);
+ expand_operands (TREE_OPERAND (TREE_OPERAND (exp, 0), 0),
+ TREE_OPERAND (exp, 1),
+ NULL_RTX, &op0, &op1, 0);
else
- op1 = expand_expr (TREE_OPERAND (TREE_OPERAND (exp, 1), 0),
- NULL_RTX, VOIDmode, 0);
+ expand_operands (TREE_OPERAND (TREE_OPERAND (exp, 0), 0),
+ TREE_OPERAND (TREE_OPERAND (exp, 1), 0),
+ NULL_RTX, &op0, &op1, 0);
goto binop2;
}
else if (other_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing
@@ -8367,12 +8352,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
}
}
}
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- if (! operand_equal_p (TREE_OPERAND (exp, 0),
- TREE_OPERAND (exp, 1), 0))
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
- else
- op1 = op0;
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ subtarget, &op0, &op1, 0);
return expand_mult (mode, op0, op1, target, unsignedp);
case TRUNC_DIV_EXPR:
@@ -8380,15 +8361,13 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
case CEIL_DIV_EXPR:
case ROUND_DIV_EXPR:
case EXACT_DIV_EXPR:
- if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1))
- subtarget = 0;
if (modifier == EXPAND_STACK_PARM)
target = 0;
/* Possible optimization: compute the dividend with EXPAND_SUM
then if the divisor is constant can optimize the case
where some terms of the dividend have coeffs divisible by it. */
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ subtarget, &op0, &op1, 0);
return expand_divmod (0, code, mode, op0, op1, target, unsignedp);
case RDIV_EXPR:
@@ -8410,12 +8389,10 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
case FLOOR_MOD_EXPR:
case CEIL_MOD_EXPR:
case ROUND_MOD_EXPR:
- if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1))
- subtarget = 0;
if (modifier == EXPAND_STACK_PARM)
target = 0;
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ subtarget, &op0, &op1, 0);
return expand_divmod (1, code, mode, op0, op1, target, unsignedp);
case FIX_ROUND_EXPR:
@@ -8460,10 +8437,10 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
if (modifier == EXPAND_STACK_PARM)
target = 0;
- /* Handle complex values specially. */
+ /* ABS_EXPR is not valid for complex arguments. */
if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
- return expand_complex_abs (mode, op0, target, unsignedp);
+ abort ();
/* Unsigned abs is simply the operand. Testing here means we don't
risk generating incorrect code below. */
@@ -8484,8 +8461,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
|| (GET_CODE (target) == REG
&& REGNO (target) < FIRST_PSEUDO_REGISTER))
target = gen_reg_rtx (mode);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
- op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode, 0);
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ target, &op0, &op1, 0);
/* First try to do it with a special MIN or MAX instruction.
If that does not win, use a conditional jump to select the proper
@@ -8542,43 +8519,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
abort ();
return temp;
- case FFS_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- if (modifier == EXPAND_STACK_PARM)
- target = 0;
- temp = expand_unop (mode, ffs_optab, op0, target, 1);
- if (temp == 0)
- abort ();
- return temp;
-
- case CLZ_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- temp = expand_unop (mode, clz_optab, op0, target, 1);
- if (temp == 0)
- abort ();
- return temp;
-
- case CTZ_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- temp = expand_unop (mode, ctz_optab, op0, target, 1);
- if (temp == 0)
- abort ();
- return temp;
-
- case POPCOUNT_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- temp = expand_unop (mode, popcount_optab, op0, target, 1);
- if (temp == 0)
- abort ();
- return temp;
-
- case PARITY_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- temp = expand_unop (mode, parity_optab, op0, target, 1);
- if (temp == 0)
- abort ();
- return temp;
-
/* ??? Can optimize bitwise operations with one arg constant.
Can optimize (a bitwise1 n) bitwise2 (a bitwise3 b)
and (a bitwise1 b) bitwise2 b (etc)
@@ -9122,7 +9062,7 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
tree lhs = TREE_OPERAND (exp, 0);
tree rhs = TREE_OPERAND (exp, 1);
- temp = expand_assignment (lhs, rhs, ! ignore, original_target != 0);
+ temp = expand_assignment (lhs, rhs, ! ignore);
return temp;
}
@@ -9167,13 +9107,13 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
(TREE_CODE (rhs) == BIT_IOR_EXPR
? integer_one_node
: integer_zero_node)),
- 0, 0);
+ 0);
do_pending_stack_adjust ();
emit_label (label);
return const0_rtx;
}
- temp = expand_assignment (lhs, rhs, ! ignore, original_target != 0);
+ temp = expand_assignment (lhs, rhs, ! ignore);
return temp;
}
@@ -9266,7 +9206,7 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
/* Handle calls that pass values in multiple
non-contiguous locations. The Irix 6 ABI has examples
of this. */
- emit_group_store (memloc, op0,
+ emit_group_store (memloc, op0, inner_type,
int_size_in_bytes (inner_type));
else
emit_move_insn (memloc, op0);
@@ -9282,11 +9222,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
if (modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER)
{
op0 = XEXP (op0, 0);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (op0) == Pmode && GET_MODE (op0) != mode
- && mode == ptr_mode)
+ if (GET_MODE (op0) == Pmode && mode == ptr_mode)
op0 = convert_memory_address (ptr_mode, op0);
-#endif
return op0;
}
@@ -9347,11 +9284,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
&& ! REG_USERVAR_P (op0))
mark_reg_pointer (op0, TYPE_ALIGN (TREE_TYPE (type)));
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (op0) == Pmode && GET_MODE (op0) != mode
- && mode == ptr_mode)
+ if (GET_MODE (op0) == Pmode && mode == ptr_mode)
op0 = convert_memory_address (ptr_mode, op0);
-#endif
return op0;
@@ -9540,10 +9474,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
/* Here to do an ordinary binary operator, generating an instruction
from the optab already placed in `this_optab'. */
binop:
- if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1))
- subtarget = 0;
- op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
+ expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
+ subtarget, &op0, &op1, 0);
binop2:
if (modifier == EXPAND_STACK_PARM)
target = 0;
@@ -9776,7 +9708,7 @@ expand_increment (tree exp, int post, int ignore)
incremented = TREE_OPERAND (incremented, 0);
}
- temp = expand_assignment (incremented, newexp, ! post && ! ignore , 0);
+ temp = expand_assignment (incremented, newexp, ! post && ! ignore);
return post ? op0 : temp;
}
@@ -10042,8 +9974,7 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
|| ! safe_from_p (subtarget, arg1, 1))
subtarget = 0;
- op0 = expand_expr (arg0, subtarget, VOIDmode, 0);
- op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ expand_operands (arg0, arg1, subtarget, &op0, &op1, 0);
if (target == 0)
target = gen_reg_rtx (mode);
diff --git a/gcc/expr.h b/gcc/expr.h
index ddf8505fa87..e3138a11dbd 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -68,7 +68,6 @@ enum expand_modifier {EXPAND_NORMAL = 0, EXPAND_STACK_PARM = 2, EXPAND_SUM,
enum direction {none, upward, downward};
-#ifdef TREE_CODE /* Don't lose if tree.h not included. */
/* Structure to record the size of a sequence of arguments
as the sum of a tree-expression and a constant. This structure is
also used to store offsets from the stack, which might be negative,
@@ -96,8 +95,9 @@ struct locate_and_pad_arg_data
/* The amount that the stack pointer needs to be adjusted to
force alignment for the next argument. */
struct args_size alignment_pad;
+ /* Which way we should pad this arg. */
+ enum direction where_pad;
};
-#endif
/* Add the value of the tree INC to the `struct args_size' TO. */
@@ -142,8 +142,7 @@ do { \
usually pad upward, but pad short args downward on
big-endian machines. */
-#ifndef FUNCTION_ARG_PADDING
-#define FUNCTION_ARG_PADDING(MODE, TYPE) \
+#define DEFAULT_FUNCTION_ARG_PADDING(MODE, TYPE) \
(! BYTES_BIG_ENDIAN \
? upward \
: (((MODE) == BLKmode \
@@ -151,6 +150,10 @@ do { \
&& int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \
: GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \
? downward : upward))
+
+#ifndef FUNCTION_ARG_PADDING
+#define FUNCTION_ARG_PADDING(MODE, TYPE) \
+ DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE))
#endif
/* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let
@@ -169,35 +172,12 @@ do { \
tree split_complex_types (tree);
tree split_complex_values (tree);
-/* Provide a default value for STRICT_ARGUMENT_NAMING. */
-#ifndef STRICT_ARGUMENT_NAMING
-#define STRICT_ARGUMENT_NAMING 0
-#endif
-
-/* Provide a default value for PRETEND_OUTGOING_VARARGS_NAMED. */
-#ifdef SETUP_INCOMING_VARARGS
-#ifndef PRETEND_OUTGOING_VARARGS_NAMED
-#define PRETEND_OUTGOING_VARARGS_NAMED 1
-#endif
-#else
-/* It is an error to define PRETEND_OUTGOING_VARARGS_NAMED without
- defining SETUP_INCOMING_VARARGS. */
-#define PRETEND_OUTGOING_VARARGS_NAMED 0
-#endif
-
/* Nonzero if we do not know how to pass TYPE solely in registers. */
extern bool default_must_pass_in_stack (enum machine_mode, tree);
#ifndef MUST_PASS_IN_STACK
#define MUST_PASS_IN_STACK(MODE,TYPE) default_must_pass_in_stack(MODE, TYPE)
#endif
-/* Nonzero if type TYPE should be returned in memory.
- Most machines can use the following default definition. */
-
-#ifndef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) (TYPE_MODE (TYPE) == BLKmode)
-#endif
-
/* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save.
Normally move_insn, so Pmode stack pointer. */
@@ -340,11 +320,11 @@ extern rtx emit_store_flag_force (rtx, enum rtx_code, rtx, rtx,
/* Given an insn and condition, return a canonical description of
the test being made. */
-extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx);
+extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx, int);
/* Given a JUMP_INSN, return a canonical description of the test
being made. */
-extern rtx get_condition (rtx, rtx *);
+extern rtx get_condition (rtx, rtx *, int);
/* Generate a conditional trap instruction. */
extern rtx gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
@@ -427,7 +407,7 @@ extern rtx gen_group_rtx (rtx);
/* Load a BLKmode value into non-consecutive registers represented by a
PARALLEL. */
-extern void emit_group_load (rtx, rtx, int);
+extern void emit_group_load (rtx, rtx, tree, int);
/* Move a non-consecutive group of registers represented by a PARALLEL into
a non-consecutive group of registers represented by a PARALLEL. */
@@ -435,12 +415,10 @@ extern void emit_group_move (rtx, rtx);
/* Store a BLKmode value from non-consecutive registers represented by a
PARALLEL. */
-extern void emit_group_store (rtx, rtx, int);
+extern void emit_group_store (rtx, rtx, tree, int);
-#ifdef TREE_CODE
/* Copy BLKmode object from a set of registers. */
extern rtx copy_blkmode_from_reg (rtx, rtx, tree);
-#endif
/* Mark REG as holding a parameter for the next CALL_INSN. */
extern void use_reg (rtx *, rtx);
@@ -490,20 +468,18 @@ extern rtx emit_move_insn_1 (rtx, rtx);
and return an rtx to address the beginning of the block. */
extern rtx push_block (rtx, int, int);
-#ifdef TREE_CODE
/* Generate code to push something onto the stack, given its mode and type. */
extern void emit_push_insn (rtx, enum machine_mode, tree, rtx, unsigned int,
int, rtx, int, rtx, rtx, int, rtx);
/* Expand an assignment that stores the value of FROM into TO. */
-extern rtx expand_assignment (tree, tree, int, int);
+extern rtx expand_assignment (tree, tree, int);
/* Generate code for computing expression EXP,
and storing the value into TARGET.
If SUGGEST_REG is nonzero, copy the value through a register
and return that register, if that is possible. */
extern rtx store_expr (tree, rtx, int);
-#endif
/* Given an rtx that may include add and multiply operations,
generate them as insns and return a pseudo-reg containing the value.
@@ -535,7 +511,6 @@ extern void clear_pending_stack_adjust (void);
/* Pop any previously-pushed arguments that have not been popped yet. */
extern void do_pending_stack_adjust (void);
-#ifdef TREE_CODE
/* Return the tree node and offset if a given argument corresponds to
a string constant. */
extern tree string_constant (tree, tree *);
@@ -549,7 +524,6 @@ extern void jumpif (tree, rtx);
/* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if
the result is zero, or IF_TRUE_LABEL if the result is one. */
extern void do_jump (tree, rtx, rtx);
-#endif
/* Generate rtl to compare two rtx's, will call emit_cmp_insn. */
extern rtx compare_from_rtx (rtx, rtx, enum rtx_code, int, enum machine_mode,
@@ -566,7 +540,6 @@ extern int try_tablejump (tree, tree, tree, tree, rtx, rtx);
extern unsigned int case_values_threshold (void);
-#ifdef TREE_CODE
/* rtl.h and tree.h were included. */
/* Return an rtx for the size in bytes of the value of an expr. */
extern rtx expr_size (tree);
@@ -592,10 +565,13 @@ extern rtx prepare_call_address (rtx, tree, rtx *, int, int);
extern rtx expand_call (tree, rtx, int);
+#ifdef TREE_CODE
extern rtx expand_shift (enum tree_code, enum machine_mode, rtx, tree, rtx,
int);
extern rtx expand_divmod (int, enum tree_code, enum machine_mode, rtx, rtx,
rtx, int);
+#endif
+
extern void locate_and_pad_parm (enum machine_mode, tree, int, int, tree,
struct args_size *,
struct locate_and_pad_arg_data *);
@@ -608,7 +584,6 @@ extern rtx label_rtx (tree);
list of its containing function (i.e. it is treated as reachable even
if how is not obvious). */
extern rtx force_label_rtx (tree);
-#endif
/* Indicate how an input argument register was promoted. */
extern rtx promoted_input_arg (unsigned int, enum machine_mode *, int *);
@@ -691,7 +666,6 @@ extern rtx widen_memory_access (rtx, enum machine_mode, HOST_WIDE_INT);
valid address. */
extern rtx validize_mem (rtx);
-#ifdef TREE_CODE
/* Given REF, either a MEM or a REG, and T, either the type of X or
the expression corresponding to REF, set RTX_UNCHANGING_P if
appropriate. */
@@ -706,7 +680,6 @@ extern void set_mem_attributes (rtx, tree, int);
we alter MEM_OFFSET according to T then we should subtract BITPOS
expecting that it'll be added back in later. */
extern void set_mem_attributes_minus_bitpos (rtx, tree, int, HOST_WIDE_INT);
-#endif
/* Assemble the static constant template for function entry trampolines. */
extern rtx assemble_trampoline_template (void);
@@ -738,10 +711,8 @@ extern rtx force_reg (enum machine_mode, rtx);
/* Return given rtx, copied into a new temp reg if it was in memory. */
extern rtx force_not_mem (rtx);
-#ifdef TREE_CODE
/* Return mode and signedness to use when object is promoted. */
extern enum machine_mode promote_mode (tree, enum machine_mode, int *, int);
-#endif
/* Remove some bytes from the stack. An rtx says how many. */
extern void adjust_stack (rtx);
@@ -812,9 +783,7 @@ extern void do_jump_by_parts_equality_rtx (rtx, rtx, rtx);
extern void do_jump_by_parts_greater_rtx (enum machine_mode, int, rtx, rtx,
rtx, rtx);
-#ifdef TREE_CODE /* Don't lose if tree.h not included. */
extern void mark_seen_cases (tree, unsigned char *, HOST_WIDE_INT, int);
-#endif
extern int vector_mode_valid_p (enum machine_mode);
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 1d4787d91c9..8ab5c2c3ab4 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,61 @@
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * com.c, ste.c: Revert.
+
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and
+ change to const.
+
+2003-09-21 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * news.texi: Update with fixed PR's.
+
+2003-09-21 George Helffrich <bugzilla@w170.uklinux.net>
+
+ * g77.texi: Remove ancient part about debugging COMMON
+ and EQUIVALENCE not correctly.
+
+2003-09-18 Roger Sayle <roger@eyesopen.com>
+
+ * com.c (ffecom_overlap_): Remove FFS_EXPR case.
+ (ffecom_tree_canonize_ref_): Likewise.
+ (ffe_truthvalue_conversion): Likewise.
+
+2003-09-01 Josef Zlomek <zlomekj@suse.cz>
+
+ * com.c (ffecom_overlap_): Kill BIT_ANDTC_EXPR.
+ (ffecom_tree_canonize_ref_): Kill BIT_ANDTC_EXPR.
+
+Thu Jul 31 01:47:27 2003 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * com.c (ffecom_init_0): Use `dconsthalf'.
+
+Sat Jul 19 12:03:03 2003 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * com.c data.c expr.c fini.c g77spec.c global.c lab.c lex.c name.c
+ sta.c stc.c std.c storag.c stt.c stw.c symbol.c target.c type.c:
+ Remove unnecessary casts.
+
+Thu Jul 17 06:34:41 2003 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang-options.h: Remove.
+ * lang.opt: Document most options.
+
+2003-07-14 Geoffrey Keating <geoffk@apple.com>
+
+ * lang-specs.h (f77-cpp-input): Use -o to specify the CPP output file.
+
+2003-07-10 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * ffe.texi: Correctly use @var{srcdir}.
+
+2003-07-09 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR Fortran/11301
+ * com.c (ffecom_sym_transform_): finish_decl should have
+ the same last argument as start_decl.
+
2003-07-08 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* Make-lang.in (f/g77.dvi): Use PWD_COMMAND.
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 4d2860c4dcf..a5100d9bfa9 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -1573,7 +1573,6 @@ ffecom_overlap_ (tree dest_decl, tree dest_offset, tree dest_size,
case MIN_EXPR:
case MAX_EXPR:
case ABS_EXPR:
- case FFS_EXPR:
case LSHIFT_EXPR:
case RSHIFT_EXPR:
case LROTATE_EXPR:
@@ -1581,7 +1580,6 @@ ffecom_overlap_ (tree dest_decl, tree dest_offset, tree dest_size,
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case BIT_AND_EXPR:
- case BIT_ANDTC_EXPR:
case BIT_NOT_EXPR:
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
@@ -8074,7 +8072,7 @@ ffecom_sym_transform_ (ffesymbol s)
TREE_PUBLIC (t) = 1;
t = start_decl (t, ffe_is_globals ());
- finish_decl (t, NULL_TREE, TRUE);
+ finish_decl (t, NULL_TREE, ffe_is_globals ());
if ((g != NULL)
&& ((ffeglobal_type (g) == FFEGLOBAL_typeSUBR)
@@ -8883,7 +8881,6 @@ ffecom_tree_canonize_ref_ (tree *decl, tree *offset, tree *size, tree t)
case MIN_EXPR:
case MAX_EXPR:
case ABS_EXPR:
- case FFS_EXPR:
case LSHIFT_EXPR:
case RSHIFT_EXPR:
case LROTATE_EXPR:
@@ -8891,7 +8888,6 @@ ffecom_tree_canonize_ref_ (tree *decl, tree *offset, tree *size, tree t)
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case BIT_AND_EXPR:
- case BIT_ANDTC_EXPR:
case BIT_NOT_EXPR:
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
@@ -11818,13 +11814,8 @@ ffecom_init_0 (void)
ffecom_float_zero_ = build_real (float_type_node, dconst0);
ffecom_double_zero_ = build_real (double_type_node, dconst0);
- {
- REAL_VALUE_TYPE point_5;
-
- REAL_ARITHMETIC (point_5, RDIV_EXPR, dconst1, dconst2);
- ffecom_float_half_ = build_real (float_type_node, point_5);
- ffecom_double_half_ = build_real (double_type_node, point_5);
- }
+ ffecom_float_half_ = build_real (float_type_node, dconsthalf);
+ ffecom_double_half_ = build_real (double_type_node, dconsthalf);
/* Do "extern int xargc;". */
@@ -13787,8 +13778,7 @@ pop_f_function_context (void)
static void
push_f_function_context (void)
{
- struct f_function *p
- = (struct f_function *) xmalloc (sizeof (struct f_function));
+ struct f_function *p = xmalloc (sizeof (struct f_function));
push_function_context ();
@@ -14216,7 +14206,7 @@ static bool
ffe_init (void)
{
#ifdef IO_BUFFER_SIZE
- setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
+ setvbuf (finput, xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
#endif
ffecom_init_decl_processing ();
@@ -14809,7 +14799,6 @@ ffe_truthvalue_conversion (tree expr)
case NEGATE_EXPR:
case ABS_EXPR:
case FLOAT_EXPR:
- case FFS_EXPR:
/* These don't change whether an object is nonzero or zero. */
return ffe_truthvalue_conversion (TREE_OPERAND (expr, 0));
@@ -15226,7 +15215,7 @@ open_include_file (char *filename, struct file_name_list *searchptr)
}
else
{
- dir = (char *) xmalloc (p - filename + 1);
+ dir = xmalloc (p - filename + 1);
memcpy (dir, filename, p - filename);
dir[p - filename] = '\0';
from = p + 1;
@@ -15357,8 +15346,7 @@ read_name_map (const char *dirname)
if (! strcmp (map_list_ptr->map_list_name, dirname))
return map_list_ptr->map_list_map;
- map_list_ptr = ((struct file_name_map_list *)
- xmalloc (sizeof (struct file_name_map_list)));
+ map_list_ptr = xmalloc (sizeof (struct file_name_map_list));
map_list_ptr->map_list_name = xstrdup (dirname);
map_list_ptr->map_list_map = NULL;
@@ -15388,8 +15376,7 @@ read_name_map (const char *dirname)
;
to = read_filename_string (ch, f);
- ptr = ((struct file_name_map *)
- xmalloc (sizeof (struct file_name_map)));
+ ptr = xmalloc (sizeof (struct file_name_map));
ptr->map_from = from;
/* Make the real filename absolute. */
@@ -15429,7 +15416,7 @@ ffecom_file_ (const char *name)
early #line directives (when -g is in effect). */
fp = &instack[++indepth];
- memset ((char *) fp, 0, sizeof (FILE_BUF));
+ memset (fp, 0, sizeof (FILE_BUF));
if (name == NULL)
name = "";
fp->nominal_fname = fp->fname = name;
@@ -15454,8 +15441,8 @@ ffecom_decode_include_option (const char *dir)
ignore_srcdir = 1;
else
{
- struct file_name_list *dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ struct file_name_list *dirtmp
+ = xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->fname = dir;
dirtmp->got_name_map = 0;
@@ -15647,7 +15634,7 @@ ffecom_open_include_ (char *name, ffewhereLine l, ffewhereColumn c)
instack[indepth].column = ffewhere_column_use (c);
fp = &instack[indepth + 1];
- memset ((char *) fp, 0, sizeof (FILE_BUF));
+ memset (fp, 0, sizeof (FILE_BUF));
fp->nominal_fname = fp->fname = fname;
fp->dir = searchptr;
diff --git a/gcc/f/data.c b/gcc/f/data.c
index 39e7ff8956e..2040f0ab6dc 100644
--- a/gcc/f/data.c
+++ b/gcc/f/data.c
@@ -723,8 +723,8 @@ ffedata_convert_ (ffebld source, ffelexToken source_token,
if (max > ffedata_convert_cache_max_)
{
- cache = (ffedataConvertCache_) malloc_new_ks (malloc_pool_image (),
- "FFEDATA cache", max * sizeof (*cache));
+ cache = malloc_new_ks (malloc_pool_image (),
+ "FFEDATA cache", max * sizeof (*cache));
if (ffedata_convert_cache_max_ != 0)
{
memcpy (cache, ffedata_convert_cache_,
diff --git a/gcc/f/expr.c b/gcc/f/expr.c
index 0c22fb978ee..6aeddafe4c2 100644
--- a/gcc/f/expr.c
+++ b/gcc/f/expr.c
@@ -8488,8 +8488,7 @@ ffeexpr_expr_new_ (void)
{
ffeexprExpr_ e;
- e = (ffeexprExpr_) malloc_new_ks (ffe_pool_program_unit (), "FFEEXPR expr",
- sizeof (*e));
+ e = malloc_new_ks (ffe_pool_program_unit (), "FFEEXPR expr", sizeof (*e));
e->previous = NULL;
e->type = FFEEXPR_exprtypeUNKNOWN_;
e->token = NULL;
diff --git a/gcc/f/ffe.texi b/gcc/f/ffe.texi
index a580a6ad43c..fd5d3bf349a 100644
--- a/gcc/f/ffe.texi
+++ b/gcc/f/ffe.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1999 Free Software Foundation, Inc.
+@c Copyright (C) 1999, 2003 Free Software Foundation, Inc.
@c This is part of the G77 manual.
@c For copying conditions, see the file g77.texi.
@@ -37,22 +37,22 @@ need to take first.
The current directory layout includes the following:
@table @file
-@item @value{srcdir}/gcc/
+@item @var{srcdir}/gcc/
Non-g77 files in gcc
-@item @value{srcdir}/gcc/f/
+@item @var{srcdir}/gcc/f/
GNU Fortran front end sources
-@item @value{srcdir}/libf2c/
+@item @var{srcdir}/libf2c/
@code{libg2c} configuration and @code{g2c.h} file generation
-@item @value{srcdir}/libf2c/libF77/
+@item @var{srcdir}/libf2c/libF77/
General support and math portion of @code{libg2c}
-@item @value{srcdir}/libf2c/libI77/
+@item @var{srcdir}/libf2c/libI77/
I/O portion of @code{libg2c}
-@item @value{srcdir}/libf2c/libU77/
+@item @var{srcdir}/libf2c/libU77/
Additional interfaces to Unix @code{libc} for @code{libg2c}
@end table
diff --git a/gcc/f/fini.c b/gcc/f/fini.c
index 5eeec66b905..167837b461f 100644
--- a/gcc/f/fini.c
+++ b/gcc/f/fini.c
@@ -367,7 +367,7 @@ main (int argc, char **argv)
/* Make new name object to store name and its keyword. */
- newname = (name) xmalloc (sizeof (*newname));
+ newname = xmalloc (sizeof (*newname));
newname->namelen = strlen (buf);
newname->kwlen = strlen (kwname);
total_length = newname->kwlen + fixlengths;
diff --git a/gcc/f/g77.texi b/gcc/f/g77.texi
index 03f6a6a3afb..8eda9a9f457 100644
--- a/gcc/f/g77.texi
+++ b/gcc/f/g77.texi
@@ -6900,13 +6900,6 @@ without having to traverse C-like structures and unions, while @command{f2c}
is unlikely to ever offer this ability (due to limitations in the
C language).
-However, due to apparent bugs in the back end, @command{g77} currently doesn't
-take advantage of this facility at all---it doesn't emit any debugging
-information for @code{COMMON} and @code{EQUIVALENCE} areas,
-other than information
-on the array of @code{char} it creates (and, in the case
-of local @code{EQUIVALENCE}, names) for each such area.
-
Yet another example is arrays.
@command{g77} represents them to the debugger
using the same ``dimensionality'' as in the source code, while @command{f2c}
diff --git a/gcc/f/g77spec.c b/gcc/f/g77spec.c
index dc8347c88bb..b5404994c2d 100644
--- a/gcc/f/g77spec.c
+++ b/gcc/f/g77spec.c
@@ -219,7 +219,7 @@ append_arg (const char *arg)
int i;
newargsize = (g77_xargc << 2) + 20; /* This should handle all. */
- g77_newargv = (const char **) xmalloc (newargsize * sizeof (char *));
+ g77_newargv = xmalloc (newargsize * sizeof (char *));
/* Copy what has been done so far. */
for (i = 0; i < g77_newargc; ++i)
diff --git a/gcc/f/global.c b/gcc/f/global.c
index f6c23cdc768..8793f62c4a7 100644
--- a/gcc/f/global.c
+++ b/gcc/f/global.c
@@ -107,8 +107,7 @@ ffeglobal_new_ (ffename n)
assert (n != NULL);
- g = (ffeglobal) malloc_new_ks (malloc_pool_image (), "FFEGLOBAL",
- sizeof (*g));
+ g = malloc_new_ks (malloc_pool_image (), "FFEGLOBAL", sizeof (*g));
g->n = n;
g->hook = FFECOM_globalNULL;
g->tick = 0;
@@ -780,10 +779,9 @@ ffeglobal_proc_def_nargs (ffesymbol s, int n_args)
return;
}
- g->u.proc.arg_info
- = (ffeglobalArgInfo_) malloc_new_ks (malloc_pool_image (),
- "ffeglobalArgInfo_",
- n_args * sizeof (g->u.proc.arg_info[0]));
+ g->u.proc.arg_info = malloc_new_ks (malloc_pool_image (),
+ "ffeglobalArgInfo_",
+ n_args * sizeof (g->u.proc.arg_info[0]));
while (n_args-- > 0)
g->u.proc.arg_info[n_args].t = NULL;
}
@@ -1123,10 +1121,9 @@ ffeglobal_proc_ref_nargs (ffesymbol s, int n_args, ffelexToken t)
return TRUE;
}
- g->u.proc.arg_info
- = (ffeglobalArgInfo_) malloc_new_ks (malloc_pool_image (),
- "ffeglobalArgInfo_",
- n_args * sizeof (g->u.proc.arg_info[0]));
+ g->u.proc.arg_info = malloc_new_ks (malloc_pool_image (),
+ "ffeglobalArgInfo_",
+ n_args * sizeof (g->u.proc.arg_info[0]));
while (n_args-- > 0)
g->u.proc.arg_info[n_args].t = NULL;
diff --git a/gcc/f/lab.c b/gcc/f/lab.c
index 8691897c21c..1d278748b21 100644
--- a/gcc/f/lab.c
+++ b/gcc/f/lab.c
@@ -141,7 +141,7 @@ ffelab_new (ffelabValue v)
ffelab l;
++ffelab_num_news_;
- l = (ffelab) malloc_new_ks (ffe_pool_any_unit (), "FFELAB label", sizeof (*l));
+ l = malloc_new_ks (ffe_pool_any_unit (), "FFELAB label", sizeof (*l));
l->next = ffelab_list_;
l->hook = FFECOM_labelNULL;
l->value = v;
diff --git a/gcc/f/lang-specs.h b/gcc/f/lang-specs.h
index 3c8c8e15317..9ed51ef5a60 100644
--- a/gcc/f/lang-specs.h
+++ b/gcc/f/lang-specs.h
@@ -31,7 +31,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
{"@f77-cpp-input",
"cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
%{E|M|MM:%(cpp_debug_options)}\
- %{!M:%{!MM:%{!E: %|.f |\n\
+ %{!M:%{!MM:%{!E: -o %|.f |\n\
f771 %|.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}", 0},
{".r", "@ratfor", 0},
{"@ratfor",
diff --git a/gcc/f/lang.opt b/gcc/f/lang.opt
index d53a0f50039..d6a53b7dcd1 100644
--- a/gcc/f/lang.opt
+++ b/gcc/f/lang.opt
@@ -27,9 +27,11 @@ F77
I
F77 Joined
+Add a directory for INCLUDE searching
Wall
F77
+; Documented in C
Wcomment
F77
@@ -39,6 +41,7 @@ F77
Wglobals
F77
+Enable warnings about inter-procedural problems
Wimplicit
F77
@@ -48,93 +51,122 @@ F77
Wsurprising
F77
+Warn about constructs with surprising meanings
Wtrigraphs
F77
fautomatic
F77
+Do not treat local variables and COMMON blocks as if they were named in SAVE statements
fbackslash
F77
+Backslashes in character and hollerith constants are special (not C-style)
fbadu77-intrinsics-delete
F77 RejectNegative
+Delete libU77 intrinsics with bad interfaces
fbadu77-intrinsics-disable
F77 RejectNegative
+Disable libU77 intrinsics with bad interfaces
fbadu77-intrinsics-enable
F77 RejectNegative
+Enable libU77 intrinsics with bad interfaces
fbadu77-intrinsics-hide
F77 RejectNegative
+Hide libU77 intrinsics with bad interfaces
fcase-initcap
F77 RejectNegative
+Program written in strict mixed-case
fcase-lower
F77 RejectNegative
+Compile as if program written in lowercase
fcase-preserve
F77 RejectNegative
+Preserve case used in program
fcase-strict-lower
F77 RejectNegative
+Program written in lowercase
fcase-strict-upper
F77 RejectNegative
+Program written in uppercase
fcase-upper
F77 RejectNegative
+Compile as if program written in uppercase
fdebug-kludge
F77
+Emit special debugging information for COMMON and EQUIVALENCE (disabled)
fdollar-ok
F77
+Allow '$' in symbol names
femulate-complex
F77
+Have front end emulate COMPLEX arithmetic to avoid bugs
ff2c
F77
+f2c-compatible code can be generated
ff2c-intrinsics-delete
F77 RejectNegative
+Delete non-FORTRAN-77 intrinsics f2c supports
ff2c-intrinsics-disable
F77 RejectNegative
+Disable non-FORTRAN-77 intrinsics f2c supports
ff2c-intrinsics-enable
F77 RejectNegative
+Enable non-FORTRAN-77 intrinsics f2c supports
ff2c-intrinsics-hide
F77 RejectNegative
+Hide non-FORTRAN-77 intrinsics f2c supports
ff2c-library
F77
+Unsupported; generate libf2c-calling code
ff66
F77
+Program is written in typical FORTRAN 66 dialect
ff77
F77
+Program is written in typical Unix-f77 dialect
ff90
F77
+Program is written in Fortran-90-ish dialect
ff90-intrinsics-delete
F77 RejectNegative
+Delete non-FORTRAN-77 intrinsics F90 supports
ff90-intrinsics-disable
F77 RejectNegative
+Disable non-FORTRAN-77 intrinsics F90 supports
ff90-intrinsics-enable
F77 RejectNegative
+Enable non-FORTRAN-77 intrinsics F90 supports
ff90-intrinsics-hide
F77 RejectNegative
+Hide non-FORTRAN-77 intrinsics F90 supports
ff90-not-vxt
F77 RejectNegative
@@ -144,173 +176,227 @@ F77
ffixed-line-length-
F77 Joined
+ffixed-line-length-<number> Set the maximum line length to <number>
fflatten-arrays
F77
+Unsupported; affects code generation of arrays
ffortran-bounds-check
F77
+Generate code to check subscript and substring bounds
ffree-form
F77
+Program is written in Fortran-90-ish free form
fglobals
F77
+Enable fatal diagnostics about inter-procedural problems
fgnu-intrinsics-delete
F77 RejectNegative
+Delete non-FORTRAN-77 intrinsics g77 supports
fgnu-intrinsics-disable
F77 RejectNegative
+Disable non-FORTRAN 77 intrinsics F90 supports
fgnu-intrinsics-enable
F77 RejectNegative
+Enable non-FORTRAN 77 intrinsics F90 supports
fgnu-intrinsics-hide
F77 RejectNegative
+Hide non-FORTRAN 77 intrinsics F90 supports
finit-local-zero
F77
+Initialize local vars and arrays to zero
fintrin-case-any
F77 RejectNegative
+Intrinsics letters in arbitrary cases
fintrin-case-initcap
F77 RejectNegative
+Intrinsics spelled as e.g. SqRt
fintrin-case-lower
F77 RejectNegative
+Intrinsics in lowercase
fintrin-case-upper
F77 RejectNegative
+Intrinsics in uppercase
fmatch-case-any
F77 RejectNegative
+Language keyword letters in arbitrary cases
fmatch-case-initcap
F77 RejectNegative
+Language keywords spelled as e.g. IOStat
fmatch-case-lower
F77 RejectNegative
+Language keywords in lowercase
fmatch-case-upper
F77 RejectNegative
+Language keywords in uppercase
fmil-intrinsics-delete
F77 RejectNegative
+Delete MIL-STD 1753 intrinsics
fmil-intrinsics-disable
F77 RejectNegative
+Disable MIL-STD 1753 intrinsics
fmil-intrinsics-enable
F77 RejectNegative
+Enable MIL-STD 1753 intrinsics
fmil-intrinsics-hide
F77 RejectNegative
+Hide MIL-STD 1753 intrinsics
fonetrip
F77
+Take at least one trip through each iterative DO loop
fpedantic
F77
+Warn about use of (only a few for now) Fortran extensions
fpreprocessed
F77
fsecond-underscore
F77
+Allow appending a second underscore to externals
fsilent
F77
+Do not print names of program units as they are compiled
fsource-case-lower
F77 RejectNegative
+Internally convert most source to lowercase
fsource-case-preserve
F77 RejectNegative
+Internally preserve source case
fsource-case-upper
F77 RejectNegative
+Internally convert most source to uppercase
fsymbol-case-any
F77 RejectNegative
fsymbol-case-initcap
F77 RejectNegative
+Symbol names spelled in mixed case
fsymbol-case-lower
F77 RejectNegative
+Symbol names in lowercase
fsymbol-case-upper
F77 RejectNegative
+Symbol names in uppercase
ftypeless-boz
F77
+Make prefix-radix non-decimal constants be typeless
fugly
F77
+Allow all ugly features
fugly-args
F77
+Hollerith and typeless can be passed as arguments
fugly-assign
F77
+Allow ordinary copying of ASSIGN'ed vars
fugly-assumed
F77
+Dummy array dimensioned to (1) is assumed-size
fugly-comma
F77
+Trailing comma in procedure call denotes null argument
fugly-complex
F77
+Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z
fugly-init
F77
+Initialization via DATA and PARAMETER is not type-compatible
fugly-logint
F77
+Allow INTEGER and LOGICAL interchangeability
funderscoring
F77
+Append underscores to externals
funix-intrinsics-delete
F77 RejectNegative
+Delete libU77 intrinsics
funix-intrinsics-disable
F77 RejectNegative
+Disable libU77 intrinsics
funix-intrinsics-enable
F77 RejectNegative
+Enable libU77 intrinsics
funix-intrinsics-hide
F77 RejectNegative
+Hide libU77 intrinsics
fversion
F77 RejectNegative
+Print g77-specific version information and run internal tests
fvxt
F77
+Program is written in VXT (Digital-like) FORTRAN
fvxt-intrinsics-delete
F77 RejectNegative
+Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports
fvxt-intrinsics-disable
F77 RejectNegative
+Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports
fvxt-intrinsics-enable
F77 RejectNegative
+Enable non-FORTRAN-77 intrinsics VXT FORTRAN supports
fvxt-intrinsics-hide
F77 RejectNegative
+Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports
fvxt-not-f90
F77 RejectNegative
fxyzzy
F77
+Print internal debugging-related information
fzeros
F77
+Treat initial values of 0 like non-zero values
; This comment is to ensure we retain the blank line above.
diff --git a/gcc/f/lex.c b/gcc/f/lex.c
index 4d0429fe0e8..02f087283d5 100644
--- a/gcc/f/lex.c
+++ b/gcc/f/lex.c
@@ -694,7 +694,7 @@ ffelex_cfelex_ (ffelexToken *xtoken, FILE *finput, int c)
register unsigned bytes_used = (p - q);
buffer_length *= 2;
- q = (char *)xrealloc (q, buffer_length);
+ q = xrealloc (q, buffer_length);
p = &q[bytes_used];
r = &q[buffer_length];
}
@@ -754,7 +754,7 @@ ffelex_cfelex_ (ffelexToken *xtoken, FILE *finput, int c)
register unsigned bytes_used = (p - q);
buffer_length = bytes_used * 2;
- q = (char *)xrealloc (q, buffer_length);
+ q = xrealloc (q, buffer_length);
p = &q[bytes_used];
r = &q[buffer_length];
}
@@ -805,8 +805,7 @@ ffelex_file_pop_ (const char *filename)
static void
ffelex_file_push_ (int old_lineno, const char *filename)
{
- struct file_stack *p
- = (struct file_stack *) xmalloc (sizeof (struct file_stack));
+ struct file_stack *p = xmalloc (sizeof (struct file_stack));
input_file_stack->location.line = old_lineno;
p->next = input_file_stack;
@@ -923,7 +922,7 @@ ffelex_get_directive_line_ (char **text, FILE *finput)
if (buffer_length == 0)
{
- directive_buffer = (char *)xmalloc (128);
+ directive_buffer = xmalloc (128);
buffer_length = 128;
}
@@ -939,8 +938,7 @@ ffelex_get_directive_line_ (char **text, FILE *finput)
register unsigned bytes_used = (p - directive_buffer);
buffer_length *= 2;
- directive_buffer
- = (char *)xrealloc (directive_buffer, buffer_length);
+ directive_buffer = xrealloc (directive_buffer, buffer_length);
p = &directive_buffer[bytes_used];
buffer_limit = &directive_buffer[buffer_length];
}
@@ -1591,8 +1589,7 @@ ffelex_token_new_ (void)
++ffelex_total_tokens_;
- t = (ffelexToken) malloc_new_ks (malloc_pool_image (),
- "FFELEX token", sizeof (*t));
+ t = malloc_new_ks (malloc_pool_image (), "FFELEX token", sizeof (*t));
t->id_ = ffelex_token_nextid_++;
return t;
}
diff --git a/gcc/f/name.c b/gcc/f/name.c
index 360279b3151..26f713ef32b 100644
--- a/gcc/f/name.c
+++ b/gcc/f/name.c
@@ -105,7 +105,7 @@ ffename_find (ffenameSpace ns, ffelexToken t)
if (found)
return n;
- newn = (ffename) malloc_new_ks (ns->pool, "FFENAME name", sizeof (*n));
+ newn = malloc_new_ks (ns->pool, "FFENAME name", sizeof (*n));
newn->next = n;
newn->previous = n->previous;
n->previous = newn;
@@ -232,8 +232,7 @@ ffename_space_new (mallocPool pool)
{
ffenameSpace ns;
- ns = (ffenameSpace) malloc_new_ks (pool, "FFENAME space",
- sizeof (*ns));
+ ns = malloc_new_ks (pool, "FFENAME space", sizeof (*ns));
ns->first = (ffename) &ns->first;
ns->last = (ffename) &ns->first;
ns->pool = pool;
diff --git a/gcc/f/news.texi b/gcc/f/news.texi
index d77626bbc2d..28a3fac6516 100644
--- a/gcc/f/news.texi
+++ b/gcc/f/news.texi
@@ -11,7 +11,7 @@
@c in the standalone derivations of this file (e.g. NEWS).
@set copyrights-news 1995,1996,1997,1998,1999,2000,2001,2002,2003
-@set last-update-news 2003-05-18
+@set last-update-news 2003-09-21
@ifset DOC-NEWS
@include root.texi
@@ -160,6 +160,10 @@ Problem Reports fixed (in chronological order of submission):
@table @code
@item 8485
g77 doesn't accept INTEGER*8 constant in PARAMETER multiplication.
+@item 11918
+(libf2c) isatty does not call f_init.
+@item 12317
+Incorrect documentation for Fortran debugging features.
@end table
@item
Roger Sayle (@email{roger@@eyesopen.com}) fixed the remaining
diff --git a/gcc/f/sta.c b/gcc/f/sta.c
index 885f44c9912..4b26d8cecd8 100644
--- a/gcc/f/sta.c
+++ b/gcc/f/sta.c
@@ -247,9 +247,8 @@ ffesta_save_ (ffelexToken t)
if (saved_tokens == NULL)
{
saved_tokens
- = (ffelexToken *) malloc_new_ksr (malloc_pool_image (),
- "FFEST Saved Tokens",
- (max_saved_tokens = 8) * sizeof (ffelexToken));
+ = malloc_new_ksr (malloc_pool_image (), "FFEST Saved Tokens",
+ (max_saved_tokens = 8) * sizeof (ffelexToken));
/* Start off with 8. */
}
else if (num_saved_tokens >= max_saved_tokens)
@@ -258,10 +257,9 @@ ffesta_save_ (ffelexToken t)
max_saved_tokens <<= 1; /* Multiply by two. */
assert (max_saved_tokens > toknum);
saved_tokens
- = (ffelexToken *) malloc_resize_ksr (malloc_pool_image (),
- saved_tokens,
- max_saved_tokens * sizeof (ffelexToken),
- toknum * sizeof (ffelexToken));
+ = malloc_resize_ksr (malloc_pool_image (), saved_tokens,
+ max_saved_tokens * sizeof (ffelexToken),
+ toknum * sizeof (ffelexToken));
}
*(saved_tokens + num_saved_tokens++) = ffelex_token_use (t);
@@ -1319,10 +1317,8 @@ ffesta_init_0 (void)
ffestaPossible_ ptr;
int i;
- ptr = (ffestaPossible_) malloc_new_kp (malloc_pool_image (),
- "FFEST possibles",
- FFESTA_maxPOSSIBLES_
- * sizeof (*ptr));
+ ptr = malloc_new_kp (malloc_pool_image (), "FFEST possibles",
+ FFESTA_maxPOSSIBLES_ * sizeof (*ptr));
for (i = 0; i < FFESTA_maxPOSSIBLES_; ++i)
ffesta_possibles_[i] = ptr++;
diff --git a/gcc/f/stc.c b/gcc/f/stc.c
index f859fac89df..5f058135bbf 100644
--- a/gcc/f/stc.c
+++ b/gcc/f/stc.c
@@ -6748,7 +6748,7 @@ ffestc_R809 (ffelexToken construct_name, ffebld expr, ffelexToken expr_token)
/* Init block to manage CASE list. */
pool = malloc_pool_new ("Select", ffe_pool_any_unit (), 1024);
- s = (ffestwSelect) malloc_new_kp (pool, "Select", sizeof (*s));
+ s = malloc_new_kp (pool, "Select", sizeof (*s));
s->first_rel = (ffestwCase) &s->first_rel;
s->last_rel = (ffestwCase) &s->first_rel;
s->first_stmt = (ffestwCase) &s->first_rel;
diff --git a/gcc/f/std.c b/gcc/f/std.c
index 863214e9292..09f04198f0a 100644
--- a/gcc/f/std.c
+++ b/gcc/f/std.c
@@ -984,8 +984,8 @@ ffestd_subr_copy_easy_ (ffestpInquireIx max)
ffestpInquireStmt *stmt;
ffestpInquireIx ix;
- stmt = (ffestpInquireStmt *) malloc_new_kp (ffesta_output_pool,
- "FFESTD easy", sizeof (ffestpFile) * max);
+ stmt = malloc_new_kp (ffesta_output_pool, "FFESTD easy",
+ sizeof (ffestpFile) * max);
for (ix = 0; ix < max; ++ix)
{
@@ -2229,8 +2229,7 @@ ffestd_R909_item (ffebld expr, ffelexToken expr_token)
ffestd_check_item_ ();
- item = (ffestdExprItem_) malloc_new_kp (ffesta_output_pool,
- "ffestdExprItem_", sizeof (*item));
+ item = malloc_new_kp (ffesta_output_pool, "ffestdExprItem_", sizeof (*item));
item->next = NULL;
item->expr = expr;
@@ -2306,8 +2305,7 @@ ffestd_R910_item (ffebld expr, ffelexToken expr_token)
ffestd_check_item_ ();
- item = (ffestdExprItem_) malloc_new_kp (ffesta_output_pool,
- "ffestdExprItem_", sizeof (*item));
+ item = malloc_new_kp (ffesta_output_pool, "ffestdExprItem_", sizeof (*item));
item->next = NULL;
item->expr = expr;
@@ -2366,8 +2364,7 @@ ffestd_R911_item (ffebld expr, ffelexToken expr_token)
ffestd_check_item_ ();
- item = (ffestdExprItem_) malloc_new_kp (ffesta_output_pool,
- "ffestdExprItem_", sizeof (*item));
+ item = malloc_new_kp (ffesta_output_pool, "ffestdExprItem_", sizeof (*item));
item->next = NULL;
item->expr = expr;
@@ -2535,8 +2532,7 @@ ffestd_R923B_item (ffebld expr)
ffestd_check_item_ ();
- item = (ffestdExprItem_) malloc_new_kp (ffesta_output_pool,
- "ffestdExprItem_", sizeof (*item));
+ item = malloc_new_kp (ffesta_output_pool, "ffestdExprItem_", sizeof (*item));
item->next = NULL;
item->expr = expr;
diff --git a/gcc/f/storag.c b/gcc/f/storag.c
index db3382725f9..8e9cb247a08 100644
--- a/gcc/f/storag.c
+++ b/gcc/f/storag.c
@@ -416,8 +416,7 @@ ffestorag_new (ffestoragList sl)
{
ffestorag s;
- s = (ffestorag) malloc_new_kp (ffe_pool_program_unit (), "ffestorag",
- sizeof (*s));
+ s = malloc_new_kp (ffe_pool_program_unit (), "ffestorag", sizeof (*s));
s->next = (ffestorag) &sl->first;
s->previous = sl->last;
s->hook = FFECOM_storageNULL;
diff --git a/gcc/f/stt.c b/gcc/f/stt.c
index 455f4e1b621..e616d492289 100644
--- a/gcc/f/stt.c
+++ b/gcc/f/stt.c
@@ -79,8 +79,7 @@ ffestt_caselist_append (ffesttCaseList list, bool range, ffebld case1,
{
ffesttCaseList new;
- new = (ffesttCaseList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST case list", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST case list", sizeof (*new));
new->next = list->previous->next;
new->previous = list->previous;
new->next->previous = new;
@@ -103,9 +102,8 @@ ffestt_caselist_create (void)
{
ffesttCaseList new;
- new = (ffesttCaseList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST case list root",
- sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST case list root",
+ sizeof (*new));
new->next = new->previous = new;
new->t = NULL;
new->expr1 = NULL;
@@ -151,8 +149,7 @@ ffestt_dimlist_append (ffesttDimList list, ffebld lower, ffebld upper,
{
ffesttDimList new;
- new = (ffesttDimList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST dim list", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST dim list", sizeof (*new));
new->next = list->previous->next;
new->previous = list->previous;
new->next->previous = new;
@@ -400,8 +397,8 @@ ffestt_dimlist_create (void)
{
ffesttDimList new;
- new = (ffesttDimList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST dim list root", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST dim list root",
+ sizeof (*new));
new->next = new->previous = new;
new->t = NULL;
new->lower = NULL;
@@ -503,8 +500,7 @@ ffestt_exprlist_append (ffesttExprList list, ffebld expr, ffelexToken t)
{
ffesttExprList new;
- new = (ffesttExprList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST expr list", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST expr list", sizeof (*new));
new->next = list->previous->next;
new->previous = list->previous;
new->next->previous = new;
@@ -525,8 +521,8 @@ ffestt_exprlist_create (void)
{
ffesttExprList new;
- new = (ffesttExprList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST expr list root", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST expr list root",
+ sizeof (*new));
new->next = new->previous = new;
new->expr = NULL;
new->t = NULL;
@@ -592,8 +588,8 @@ ffestt_formatlist_append (ffesttFormatList list)
{
ffesttFormatList new;
- new = (ffesttFormatList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST format list", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST format list",
+ sizeof (*new));
new->next = list->previous->next;
new->previous = list->previous;
new->next->previous = new;
@@ -613,8 +609,8 @@ ffestt_formatlist_create (ffesttFormatList parent, ffelexToken t)
{
ffesttFormatList new;
- new = (ffesttFormatList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST format list root", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST format list root",
+ sizeof (*new));
new->next = new->previous = new;
new->type = FFESTP_formattypeNone;
new->t = t;
@@ -720,8 +716,7 @@ ffestt_implist_append (ffesttImpList list, ffelexToken first, ffelexToken last)
{
ffesttImpList new;
- new = (ffesttImpList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token list", sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST token list", sizeof (*new));
new->next = list->previous->next;
new->previous = list->previous;
new->next->previous = new;
@@ -742,9 +737,8 @@ ffestt_implist_create (void)
{
ffesttImpList new;
- new = (ffesttImpList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token list root",
- sizeof (*new));
+ new = malloc_new_kp (ffesta_scratch_pool, "FFEST token list root",
+ sizeof (*new));
new->next = new->previous = new;
new->first = NULL;
new->last = NULL;
@@ -807,8 +801,7 @@ ffestt_tokenlist_append (ffesttTokenList tl, ffelexToken t)
{
ffesttTokenItem ti;
- ti = (ffesttTokenItem) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token item", sizeof (*ti));
+ ti = malloc_new_kp (ffesta_scratch_pool, "FFEST token item", sizeof (*ti));
ti->next = (ffesttTokenItem) &tl->first;
ti->previous = tl->last;
ti->next->previous = ti;
@@ -829,8 +822,7 @@ ffestt_tokenlist_create (void)
{
ffesttTokenList tl;
- tl = (ffesttTokenList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token list", sizeof (*tl));
+ tl = malloc_new_kp (ffesta_scratch_pool, "FFEST token list", sizeof (*tl));
tl->first = tl->last = (ffesttTokenItem) &tl->first;
tl->count = 0;
return tl;
diff --git a/gcc/f/stw.c b/gcc/f/stw.c
index af68522d2e8..57658de3204 100644
--- a/gcc/f/stw.c
+++ b/gcc/f/stw.c
@@ -282,8 +282,8 @@ ffestw_init_0 (void)
{
ffestw b;
- ffestw_stack_top_ = b = (ffestw) malloc_new_kp (malloc_pool_image (),
- "FFESTW stack base", sizeof (*b));
+ ffestw_stack_top_ = b = malloc_new_kp (malloc_pool_image (),
+ "FFESTW stack base", sizeof (*b));
b->uses_ = 0; /* catch if anyone uses, kills, &c this
block. */
b->next_ = NULL;
@@ -324,7 +324,7 @@ ffestw_new (void)
{
ffestw b;
- b = (ffestw) malloc_new_kp (malloc_pool_image (), "FFESTW", sizeof (*b));
+ b = malloc_new_kp (malloc_pool_image (), "FFESTW", sizeof (*b));
b->uses_ = 1;
return b;
diff --git a/gcc/f/symbol.c b/gcc/f/symbol.c
index addacc8f144..c22697ff377 100644
--- a/gcc/f/symbol.c
+++ b/gcc/f/symbol.c
@@ -206,8 +206,7 @@ ffesymbol_new_ (ffename n)
assert (n != NULL);
- s = (ffesymbol) malloc_new_ks (FFESYMBOL_SPACE_POOL_, "FFESYMBOL",
- sizeof (*s));
+ s = malloc_new_ks (FFESYMBOL_SPACE_POOL_, "FFESYMBOL", sizeof (*s));
s->name = n;
s->other_space_name = NULL;
#if FFEGLOBAL_ENABLED
@@ -258,8 +257,8 @@ ffesymbol_new_ (ffename n)
return s;
}
- r = (ffesymbolRetract_) malloc_new_kp (ffesymbol_retract_pool_,
- "FFESYMBOL retract", sizeof (*r));
+ r = malloc_new_kp (ffesymbol_retract_pool_, "FFESYMBOL retract",
+ sizeof (*r));
r->next = NULL;
r->command = FFESYMBOL_retractcommandDELETE_;
r->live = s;
@@ -1104,13 +1103,13 @@ ffesymbol_signal_change (ffesymbol s)
if (!ffesymbol_retractable_ || s->have_old)
return;
- r = (ffesymbolRetract_) malloc_new_kp (ffesymbol_retract_pool_,
- "FFESYMBOL retract", sizeof (*r));
+ r = malloc_new_kp (ffesymbol_retract_pool_, "FFESYMBOL retract",
+ sizeof (*r));
r->next = NULL;
r->command = FFESYMBOL_retractcommandRETRACT_;
r->live = s;
- r->symbol = sym = (ffesymbol) malloc_new_ks (FFESYMBOL_SPACE_POOL_,
- "FFESYMBOL", sizeof (*sym));
+ r->symbol = sym = malloc_new_ks (FFESYMBOL_SPACE_POOL_,
+ "FFESYMBOL", sizeof (*sym));
*sym = *s; /* Make an exact copy of the symbol in case
we need it back. */
sym->info = ffeinfo_use (s->info);
diff --git a/gcc/f/target.c b/gcc/f/target.c
index 35eed17c55c..98760469831 100644
--- a/gcc/f/target.c
+++ b/gcc/f/target.c
@@ -2244,8 +2244,7 @@ ffetarget_real1 (ffetargetReal1 *value, ffelexToken integer,
#undef dotoktxt
if (sz > ARRAY_SIZE (ffetarget_string_))
- p = ptr = (char *) malloc_new_ks (malloc_pool_image (), "ffetarget_real1",
- sz);
+ p = ptr = malloc_new_ks (malloc_pool_image (), "ffetarget_real1", sz);
#define dotoktxt(x) if (x != NULL) \
{ \
@@ -2327,7 +2326,7 @@ ffetarget_real2 (ffetargetReal2 *value, ffelexToken integer,
#undef dotoktxt
if (sz > ARRAY_SIZE (ffetarget_string_))
- p = ptr = (char *) malloc_new_ks (malloc_pool_image (), "ffetarget_real1", sz);
+ p = ptr = malloc_new_ks (malloc_pool_image (), "ffetarget_real1", sz);
#define dotoktxt(x) if (x != NULL) \
{ \
diff --git a/gcc/f/type.c b/gcc/f/type.c
index 7625cbbaa0e..d25ab50f4c2 100644
--- a/gcc/f/type.c
+++ b/gcc/f/type.c
@@ -53,8 +53,7 @@ ffetype_new (void)
{
ffetype type;
- type = (ffetype) malloc_new_kp (malloc_pool_image (), "ffetype",
- sizeof (*type));
+ type = malloc_new_kp (malloc_pool_image (), "ffetype", sizeof (*type));
type->kinds_ = NULL;
type->stars_ = NULL;
type->alignment_ = 0;
@@ -74,9 +73,8 @@ ffetype_set_kind (ffetype base_type, int kind, ffetype type)
int i;
base_type->kinds_
- = (ffetype_indexes_) malloc_new_kp (malloc_pool_image (),
- "ffetype_indexes_[kinds]",
- sizeof (*(base_type->kinds_)));
+ = malloc_new_kp (malloc_pool_image (), "ffetype_indexes_[kinds]",
+ sizeof (*(base_type->kinds_)));
for (i = 0; ((size_t) i) < ARRAY_SIZE (base_type->kinds_->type_); ++i)
base_type->kinds_->type_[i] = NULL;
}
@@ -94,9 +92,8 @@ ffetype_set_star (ffetype base_type, int star, ffetype type)
int i;
base_type->stars_
- = (ffetype_indexes_) malloc_new_kp (malloc_pool_image (),
- "ffetype_indexes_[stars]",
- sizeof (*(base_type->stars_)));
+ = malloc_new_kp (malloc_pool_image (), "ffetype_indexes_[stars]",
+ sizeof (*(base_type->stars_)));
for (i = 0; ((size_t) i) < ARRAY_SIZE (base_type->stars_->type_); ++i)
base_type->stars_->type_[i] = NULL;
}
diff --git a/gcc/final.c b/gcc/final.c
index e3ded5db34a..6ee13a604f8 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -658,8 +658,8 @@ compute_alignments (void)
max_labelno = max_label_num ();
min_labelno = get_first_label_num ();
- label_align = (struct label_alignment *)
- xcalloc (max_labelno - min_labelno + 1, sizeof (struct label_alignment));
+ label_align = xcalloc (max_labelno - min_labelno + 1,
+ sizeof (struct label_alignment));
/* If not optimizing or optimizing for size, don't assign any alignments. */
if (! optimize || optimize_size)
@@ -766,7 +766,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
/* Compute maximum UID and allocate label_align / uid_shuid. */
max_uid = get_max_uid ();
- uid_shuid = (int *) xmalloc (max_uid * sizeof *uid_shuid);
+ uid_shuid = xmalloc (max_uid * sizeof *uid_shuid);
if (max_labelno != max_label_num ())
{
@@ -779,8 +779,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
n_labels = max_labelno - min_labelno + 1;
n_old_labels = old - min_labelno + 1;
- label_align = (struct label_alignment *) xrealloc
- (label_align, n_labels * sizeof (struct label_alignment));
+ label_align = xrealloc (label_align,
+ n_labels * sizeof (struct label_alignment));
/* Range of labels grows monotonically in the function. Abort here
means that the initialization of array got lost. */
@@ -875,20 +875,20 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
#ifdef HAVE_ATTR_length
/* Allocate the rest of the arrays. */
- insn_lengths = (int *) xmalloc (max_uid * sizeof (*insn_lengths));
+ insn_lengths = xmalloc (max_uid * sizeof (*insn_lengths));
insn_lengths_max_uid = max_uid;
/* Syntax errors can lead to labels being outside of the main insn stream.
Initialize insn_addresses, so that we get reproducible results. */
INSN_ADDRESSES_ALLOC (max_uid);
- varying_length = (char *) xcalloc (max_uid, sizeof (char));
+ varying_length = xcalloc (max_uid, sizeof (char));
/* Initialize uid_align. We scan instructions
from end to start, and keep in align_tab[n] the last seen insn
that does an alignment of at least n+1, i.e. the successor
in the alignment chain for an insn that does / has a known
alignment of n. */
- uid_align = (rtx *) xcalloc (max_uid, sizeof *uid_align);
+ uid_align = xcalloc (max_uid, sizeof *uid_align);
for (i = MAX_CODE_ALIGN; --i >= 0;)
align_tab[i] = NULL_RTX;
@@ -1349,8 +1349,9 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
}
#endif
- last_linenum = 0;
- last_filename = 0;
+ last_filename = locator_file (prologue_locator);
+ last_linenum = locator_line (prologue_locator);
+
high_block_linenum = high_function_linenum = last_linenum;
(*debug_hooks->begin_prologue) (last_linenum, last_filename);
@@ -1417,9 +1418,8 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
# define NO_PROFILE_COUNTERS 0
#endif
#if defined(ASM_OUTPUT_REG_PUSH)
-#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
-#endif
+ rtx svrtx = targetm.calls.struct_value_rtx (TREE_TYPE (current_function_decl), 1);
#if defined(STATIC_CHAIN_INCOMING_REGNUM) || defined(STATIC_CHAIN_REGNUM)
int cxt = current_function_needs_context;
#endif
@@ -1436,16 +1436,9 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
function_section (current_function_decl);
-#if defined(STRUCT_VALUE_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (sval)
- ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_INCOMING_REGNUM);
-#else
-#if defined(STRUCT_VALUE_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (sval)
- {
- ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_REGNUM);
- }
-#endif
+#if defined(ASM_OUTPUT_REG_PUSH)
+ if (sval && GET_CODE (svrtx) == REG)
+ ASM_OUTPUT_REG_PUSH (file, REGNO (svrtx));
#endif
#if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
@@ -1474,16 +1467,9 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
#endif
#endif
-#if defined(STRUCT_VALUE_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (sval)
- ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_INCOMING_REGNUM);
-#else
-#if defined(STRUCT_VALUE_REGNUM) && defined(ASM_OUTPUT_REG_PUSH)
- if (sval)
- {
- ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_REGNUM);
- }
-#endif
+#if defined(ASM_OUTPUT_REG_PUSH)
+ if (sval && GET_CODE (svrtx) == REG)
+ ASM_OUTPUT_REG_POP (file, REGNO (svrtx));
#endif
}
@@ -1565,11 +1551,11 @@ final (rtx first, FILE *file, int optimize, int prescan)
max_line = NOTE_LINE_NUMBER (insn);
}
- line_note_exists = (char *) xcalloc (max_line + 1, sizeof (char));
+ line_note_exists = xcalloc (max_line + 1, sizeof (char));
for (insn = first; insn; insn = NEXT_INSN (insn))
{
- if (INSN_UID (insn) > max_uid) /* find largest UID */
+ if (INSN_UID (insn) > max_uid) /* Find largest UID. */
max_uid = INSN_UID (insn);
if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
line_note_exists[NOTE_LINE_NUMBER (insn)] = 1;
@@ -2054,7 +2040,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
if (asm_noperands (body) >= 0)
{
unsigned int noperands = asm_noperands (body);
- rtx *ops = (rtx *) alloca (noperands * sizeof (rtx));
+ rtx *ops = alloca (noperands * sizeof (rtx));
const char *string;
/* There's no telling what that did to the condition codes. */
@@ -2485,9 +2471,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* Emit information for vtable gc. */
note = find_reg_note (insn, REG_VTABLE_REF, NULL_RTX);
- if (note)
- assemble_vtable_entry (XEXP (XEXP (note, 0), 0),
- INTVAL (XEXP (XEXP (note, 0), 1)));
current_output_insn = debug_insn = 0;
}
@@ -3864,8 +3847,8 @@ debug_queue_symbol (tree decl)
if (symbol_queue_index >= symbol_queue_size)
{
symbol_queue_size += 10;
- symbol_queue = (tree *) xrealloc (symbol_queue,
- symbol_queue_size * sizeof (tree));
+ symbol_queue = xrealloc (symbol_queue,
+ symbol_queue_size * sizeof (tree));
}
symbol_queue[symbol_queue_index++] = decl;
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 6f486dea216..0f5f8c0d423 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -80,8 +80,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h"
#include "c-incpath.h"
-static void v_fatal PARAMS ((const char *, va_list)) ATTRIBUTE_PRINTF (1,0) ATTRIBUTE_NORETURN;
-static void fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+static void v_fatal (const char *, va_list)
+ ATTRIBUTE_PRINTF (1,0) ATTRIBUTE_NORETURN;
+static void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
sstring buf;
@@ -187,23 +188,21 @@ struct symbol_list {
struct symbol_list symbol_table[SYMBOL_TABLE_SIZE];
int cur_symbol_table_size;
-static void add_symbols PARAMS ((symbol_flags, namelist));
-static struct fn_decl *lookup_std_proto PARAMS ((const char *, int));
-static void write_lbrac PARAMS ((void));
-static void recognized_macro PARAMS ((const char *));
-static void check_macro_names PARAMS ((cpp_reader *, namelist));
-static void read_scan_file PARAMS ((char *, int, char **));
-static void write_rbrac PARAMS ((void));
-static int inf_skip_spaces PARAMS ((int));
-static int inf_read_upto PARAMS ((sstring *, int));
-static int inf_scan_ident PARAMS ((sstring *, int));
-static int check_protection PARAMS ((int *, int *));
-static void cb_file_change PARAMS ((cpp_reader *, const struct line_map *));
+static void add_symbols (symbol_flags, namelist);
+static struct fn_decl *lookup_std_proto (const char *, int);
+static void write_lbrac (void);
+static void recognized_macro (const char *);
+static void check_macro_names (cpp_reader *, namelist);
+static void read_scan_file (char *, int, char **);
+static void write_rbrac (void);
+static int inf_skip_spaces (int);
+static int inf_read_upto (sstring *, int);
+static int inf_scan_ident (sstring *, int);
+static int check_protection (int *, int *);
+static void cb_file_change (cpp_reader *, const struct line_map *);
static void
-add_symbols (flags, names)
- symbol_flags flags;
- namelist names;
+add_symbols (symbol_flags flags, namelist names)
{
symbol_table[cur_symbol_table_size].flags = flags;
symbol_table[cur_symbol_table_size].names = names;
@@ -376,9 +375,7 @@ struct obstack scan_file_obstack;
/* NOTE: If you edit this, also edit gen-protos.c !! */
static struct fn_decl *
-lookup_std_proto (name, name_length)
- const char *name;
- int name_length;
+lookup_std_proto (const char *name, int name_length)
{
int i = hashstr (name, name_length) % HASH_SIZE;
int i0 = i;
@@ -409,7 +406,7 @@ int required_unseen_count = 0;
int required_other = 0;
static void
-write_lbrac ()
+write_lbrac (void)
{
if (partial_count)
{
@@ -438,8 +435,7 @@ struct partial_proto required_dummy_proto, seen_dummy_proto;
#define SEEN(FN) ((FN)->partial == &seen_dummy_proto)
static void
-recognized_macro (fname)
- const char *fname;
+recognized_macro (const char *fname)
{
/* The original include file defines fname as a macro. */
struct fn_decl *fn = lookup_std_proto (fname, strlen (fname));
@@ -488,8 +484,7 @@ recognized_macro (fname)
}
void
-recognized_extern (name)
- const cpp_token *name;
+recognized_extern (const cpp_token *name)
{
switch (special_file_handling)
{
@@ -509,11 +504,8 @@ recognized_extern (name)
'extern "C"' braces); or 'f' for other function declarations. */
void
-recognized_function (fname, line, kind, have_arg_list)
- const cpp_token *fname;
- unsigned int line;
- int kind; /* One of 'f' 'F' or 'I' */
- int have_arg_list;
+recognized_function (const cpp_token *fname, unsigned int line, int kind,
+ int have_arg_list)
{
struct partial_proto *partial;
int i;
@@ -552,8 +544,7 @@ recognized_function (fname, line, kind, have_arg_list)
/* We only have a partial function declaration,
so remember that we have to add a complete prototype. */
partial_count++;
- partial = (struct partial_proto *)
- obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
+ partial = obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
partial->line_seen = line;
partial->fn = fn;
fn->partial = partial;
@@ -570,9 +561,7 @@ recognized_function (fname, line, kind, have_arg_list)
call recognized_macro on it. */
static void
-check_macro_names (pfile, names)
- cpp_reader *pfile;
- namelist names;
+check_macro_names (cpp_reader *pfile, namelist names)
{
size_t len;
while (*names)
@@ -585,19 +574,15 @@ check_macro_names (pfile, names)
}
static void
-cb_file_change (pfile, map)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- const struct line_map *map;
+cb_file_change (cpp_reader *pfile ATTRIBUTE_UNUSED,
+ const struct line_map *map)
{
/* Just keep track of current file name. */
cur_file = map->to_file;
}
static void
-read_scan_file (in_fname, argc, argv)
- char *in_fname;
- int argc;
- char **argv;
+read_scan_file (char *in_fname, int argc, char **argv)
{
cpp_reader *scan_in;
cpp_callbacks *cb;
@@ -617,6 +602,7 @@ read_scan_file (in_fname, argc, argv)
options = cpp_get_options (scan_in);
options->inhibit_warnings = 1;
options->inhibit_errors = 1;
+ cpp_post_options (scan_in);
if (! cpp_read_main_file (scan_in, in_fname))
exit (FATAL_EXIT_CODE);
@@ -741,7 +727,7 @@ read_scan_file (in_fname, argc, argv)
}
static void
-write_rbrac ()
+write_rbrac (void)
{
struct fn_decl *fn;
const char *cptr;
@@ -881,8 +867,7 @@ write_rbrac ()
#define INF_UNGET(c) ((c)!=EOF && inf_ptr--)
static int
-inf_skip_spaces (c)
- int c;
+inf_skip_spaces (int c)
{
for (;;)
{
@@ -920,9 +905,7 @@ inf_skip_spaces (c)
/* Read into STR from inf_buffer upto DELIM. */
static int
-inf_read_upto (str, delim)
- sstring *str;
- int delim;
+inf_read_upto (sstring *str, int delim)
{
int ch;
for (;;)
@@ -938,9 +921,7 @@ inf_read_upto (str, delim)
}
static int
-inf_scan_ident (s, c)
- sstring *s;
- int c;
+inf_scan_ident (sstring *s, int c)
{
s->ptr = s->base;
if (ISIDST (c))
@@ -964,8 +945,7 @@ inf_scan_ident (s, c)
Otherwise return 0. */
static int
-check_protection (ifndef_line, endif_line)
- int *ifndef_line, *endif_line;
+check_protection (int *ifndef_line, int *endif_line)
{
int c;
int if_nesting = 1; /* Level of nesting of #if's */
@@ -1066,12 +1046,10 @@ check_protection (ifndef_line, endif_line)
return 1;
}
-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 inf_fd;
struct stat sbuf;
@@ -1191,7 +1169,7 @@ main (argc, argv)
exit (FATAL_EXIT_CODE);
}
inf_size = sbuf.st_size;
- inf_buffer = (char *) xmalloc (inf_size + 2);
+ inf_buffer = xmalloc (inf_size + 2);
inf_ptr = inf_buffer;
to_read = inf_size;
@@ -1314,9 +1292,7 @@ main (argc, argv)
static void
-v_fatal (str, ap)
- const char * str;
- va_list ap;
+v_fatal (const char *str, va_list ap)
{
fprintf (stderr, "%s: %s: ", progname, inc_filename);
vfprintf (stderr, str, ap);
diff --git a/gcc/fixinc/fixfixes.c b/gcc/fixinc/fixfixes.c
index b3c75ae1c1e..a8901ffdf0f 100644
--- a/gcc/fixinc/fixfixes.c
+++ b/gcc/fixinc/fixfixes.c
@@ -59,7 +59,7 @@ Boston, MA 02111-1307, USA. */
tSCC zNeedsArg[] = "fixincl error: `%s' needs %s argument (c_fix_arg[%d])\n";
-typedef void t_fix_proc PARAMS ((const char *, const char *, tFixDesc *));
+typedef void t_fix_proc (const char *, const char *, tFixDesc *) ;
typedef struct {
const char* fix_name;
t_fix_proc* fix_proc;
@@ -74,12 +74,10 @@ typedef struct {
_FT_( "gnu_type", gnu_type_fix )
-#define FIX_PROC_HEAD( fix ) \
-static void fix PARAMS ((const char *, const char *, tFixDesc *)); \
-static void fix ( filname, text, p_fixd ) \
- const char* filname ATTRIBUTE_UNUSED; \
- const char* text ATTRIBUTE_UNUSED; \
- tFixDesc* p_fixd ATTRIBUTE_UNUSED;
+#define FIX_PROC_HEAD( fix ) \
+static void fix (const char* filname ATTRIBUTE_UNUSED , \
+ const char* text ATTRIBUTE_UNUSED , \
+ tFixDesc* p_fixd ATTRIBUTE_UNUSED )
#ifdef NEED_PRINT_QUOTE
/*
@@ -89,9 +87,7 @@ static void fix ( filname, text, p_fixd ) \
* We are not doing a correctness syntax check here.
*/
static char*
-print_quote( q, text )
- char q;
- char* text;
+print_quote(char q, char* text )
{
fputc( q, stdout );
@@ -131,11 +127,8 @@ print_quote( q, text )
* this thing can be encountered countless times during a compile
* and not cause even a warning.
*/
-static const char *emit_gnu_type PARAMS ((const char *, regmatch_t *));
static const char*
-emit_gnu_type ( text, rm )
- const char* text;
- regmatch_t* rm;
+emit_gnu_type (const char* text, regmatch_t* rm )
{
char z_TYPE[ 64 ];
char z_type[ 64 ];
@@ -182,12 +175,8 @@ typedef __%s_TYPE__ %s_t;\n\
* '%' characters in other contexts and all other characters are
* copied out verbatim.
*/
-static void format_write PARAMS ((tCC *, tCC *, regmatch_t[]));
static void
-format_write (format, text, av)
- tCC* format;
- tCC* text;
- regmatch_t av[];
+format_write (tCC* format, tCC* text, regmatch_t av[] )
{
int c;
@@ -710,9 +699,7 @@ FIX_PROC_HEAD( gnu_type_fix )
*/
void
-apply_fix( p_fixd, filname )
- tFixDesc* p_fixd;
- tCC* filname;
+apply_fix( tFixDesc* p_fixd, tCC* filname )
{
#define _FT_(n,p) { n, p },
static fix_entry_t fix_table[] = { FIXUP_TABLE { NULL, NULL }};
@@ -748,9 +735,7 @@ tSCC z_reopen[] =
"FS error %d (%s) reopening %s as std%s\n";
int
-main( argc, argv )
- int argc;
- char** argv;
+main( int argc, char** argv )
{
tFixDesc* pFix;
char* pz_tmptmp;
@@ -783,7 +768,7 @@ main( argc, argv )
return EXIT_FAILURE;
}
- pz_tmptmp = (char*)xmalloc( strlen( argv[4] ) + 5 );
+ pz_tmptmp = xmalloc (strlen (argv[4]) + 5);
strcpy( pz_tmptmp, argv[4] );
/* Don't lose because "12345678" and "12345678X" map to the same
diff --git a/gcc/fixinc/fixinc.svr4 b/gcc/fixinc/fixinc.svr4
index 88972f01a13..759a08e58ab 100755
--- a/gcc/fixinc/fixinc.svr4
+++ b/gcc/fixinc/fixinc.svr4
@@ -167,28 +167,9 @@ while [ $# != 0 ]; do
chmod +w $2/$file
chmod a+r $2/$file
-# The following have been removed from the sed command below
-# because it is more useful to leave these things in.
-# The only reason to remove them was for -pedantic,
-# which isn't much of a reason. -- rms.
-# /^[ ]*#[ ]*ident/d
-
-# This code makes Solaris SCSI fail, because it changes the
-# alignment within some critical structures. See <sys/scsi/impl/commands.h>.
-# s/u_char\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
-# Disable these also, since they probably aren't safe either.
-# s/u_short\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
-# s/ushort\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
-# s/evcm_t\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
-# s/Pbyte\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*SEQSIZ\)/unsigned int\1/
-
# The change of u_char, etc, to u_int
# applies to bit fields.
sed -e '
- s%^\([ ]*#[ ]*else\)[ ]*/[^*].*%\1%
- s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1%
- s%^\([ ]*#[ ]*endif\)[ ]*/[^*].*%\1%
- s%^\([ ]*#[ ]*endif\)[ ]*[^/ ].*%\1%
s/#lint(on)/defined(lint)/g
s/#lint(off)/!defined(lint)/g
s/#machine(\([^)]*\))/defined(__\1__)/g
@@ -801,211 +782,17 @@ if [ \! -z "$file_to_fix" ]; then
fi
# Conditionalize all of <fs/rfs/rf_cache.h> on _KERNEL being defined.
-
-file=fs/rfs/rf_cache.h
-base=`basename $file`.$$
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- if grep _KERNEL $file_to_fix > /dev/null; then
- true
- else
- echo '#ifdef _KERNEL' > /tmp/$base
- cat $file_to_fix >> /tmp/$base
- echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- rm -f /tmp/$base
- fi
-fi
-
# Conditionalize all of <sys/erec.h> on _KERNEL being defined.
-
-file=sys/erec.h
-base=`basename $file`.$$
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- if grep _KERNEL $file_to_fix > /dev/null; then
- true
- else
- echo '#ifdef _KERNEL' > /tmp/$base
- cat $file_to_fix >> /tmp/$base
- echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- rm -f /tmp/$base
- fi
-fi
-
# Conditionalize all of <sys/err.h> on _KERNEL being defined.
-
-file=sys/err.h
-base=`basename $file`.$$
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- if grep _KERNEL $file_to_fix > /dev/null; then
- true
- else
- echo '#ifdef _KERNEL' > /tmp/$base
- cat $file_to_fix >> /tmp/$base
- echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- rm -f /tmp/$base
- fi
-fi
-
# Conditionalize all of <sys/char.h> on _KERNEL being defined.
-
-file=sys/char.h
-base=`basename $file`.$$
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- if grep _KERNEL $file_to_fix > /dev/null; then
- true
- else
- echo '#ifdef _KERNEL' > /tmp/$base
- cat $file_to_fix >> /tmp/$base
- echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- rm -f /tmp/$base
- fi
-fi
-
# Conditionalize all of <sys/getpages.h> on _KERNEL being defined.
-
-file=sys/getpages.h
-base=`basename $file`.$$
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- if grep _KERNEL $file_to_fix > /dev/null; then
- true
- else
- echo '#ifdef _KERNEL' > /tmp/$base
- cat $file_to_fix >> /tmp/$base
- echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- rm -f /tmp/$base
- fi
-fi
-
# Conditionalize all of <sys/map.h> on _KERNEL being defined.
-
-file=sys/map.h
-base=`basename $file`.$$
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- if grep _KERNEL $file_to_fix > /dev/null; then
- true
- else
- echo '#ifdef _KERNEL' > /tmp/$base
- cat $file_to_fix >> /tmp/$base
- echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- rm -f /tmp/$base
- fi
-fi
-
# Conditionalize all of <sys/cmn_err.h> on _KERNEL being defined.
-
-file=sys/cmn_err.h
-base=`basename $file`.$$
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
- fi
-fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- if grep _KERNEL $file_to_fix > /dev/null; then
- true
- else
- echo '#ifdef _KERNEL' > /tmp/$base
- cat $file_to_fix >> /tmp/$base
- echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
- rm -f /tmp/$base
- fi
-fi
-
# Conditionalize all of <sys/kdebugger.h> on _KERNEL being defined.
-file=sys/kdebugger.h
+for file in fs/rfs/rf_cache.h sys/erec.h sys/err.h sys/char.h \
+ sys/getpages.h sys/map.h sys/cmn_err.h sys/kdebugger.h ; do
+
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
@@ -1032,36 +819,7 @@ if [ \! -z "$file_to_fix" ]; then
fi
fi
-# Conditionalize some of <netinet/in.h> on _KERNEL being defined.
-# This has been taken out because it breaks on some versions of
-# DYNIX/ptx, and it does not seem to do much good on any system.
-# file=netinet/in.h
-# base=`basename $file`.$$
-# if [ -r ${LIB}/$file ]; then
-# file_to_fix=${LIB}/$file
-# else
-# if [ -r ${INPUT}/$file ]; then
-# file_to_fix=${INPUT}/$file
-# else
-# file_to_fix=""
-# fi
-# fi
-# if [ \! -z "$file_to_fix" ]; then
-# echo Checking $file_to_fix
-# if grep _KERNEL $file_to_fix > /dev/null; then
-# true
-# else
-# sed -e '/#ifdef INKERNEL/i\
-# #ifdef _KERNEL
-# ' \
-# -e '/#endif[ ]*\/\* INKERNEL \*\//a\
-# #endif /* _KERNEL */
-# ' \
-# $file_to_fix > ${LIB}/${file}.sed
-# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
-# echo Fixed $file_to_fix
-# fi
-# fi
+done
# Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__.
@@ -1094,32 +852,6 @@ if [ \! -z "$file_to_fix" ]; then
fi
fi
-# Commented out because tmcconne@sedona.intel.com says we don't clearly need it
-# and the text in types.h is not erroneous.
-## In sys/types.h, don't name the enum for booleans.
-#
-#file=sys/types.h
-#base=`basename $file`.$$
-#if [ -r ${LIB}/$file ]; then
-# file_to_fix=${LIB}/$file
-#else
-# if [ -r ${INPUT}/$file ]; then
-# file_to_fix=${INPUT}/$file
-# else
-# file_to_fix=""
-# fi
-#fi
-#if [ \! -z "$file_to_fix" ]; then
-# echo Checking $file_to_fix
-# if grep "enum boolean" $file_to_fix > /dev/null; then
-# sed -e 's/enum boolean/enum/' ${LIB}/$file > ${LIB}/${file}.sed
-# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
-# echo Fixed $file_to_fix
-# else
-# true
-# fi
-#fi
-
# Remove useless extern keyword from struct forward declarations in
# <sys/stream.h> and <sys/strsubr.h>
diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c
index 18a32fcfbec..5b92c3ce097 100644
--- a/gcc/fixinc/fixincl.c
+++ b/gcc/fixinc/fixincl.c
@@ -94,11 +94,11 @@ const char incl_quote_pat[] = "^[ \t]*#[ \t]*include[ \t]*\"[^/]";
tSCC z_fork_err[] = "Error %d (%s) starting filter process for %s\n";
regex_t incl_quote_re;
-static void do_version PARAMS((void)) ATTRIBUTE_NORETURN;
-char *load_file PARAMS((const char *));
-void run_compiles PARAMS((void));
-void initialize PARAMS((int argc,char** argv));
-void process PARAMS((void));
+static void do_version (void) ATTRIBUTE_NORETURN;
+char *load_file (const char *);
+void run_compiles (void);
+void initialize (int argc, char** argv);
+void process (void);
/* External Source Code */
@@ -108,11 +108,9 @@ void process PARAMS((void));
*
* MAIN ROUTINE
*/
-extern int main PARAMS ((int, char **));
+extern int main (int, char **);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char** argv)
{
char *file_name_buf;
@@ -191,7 +189,7 @@ Altering %5d of them\n";
static void
-do_version ()
+do_version (void)
{
static const char zFmt[] = "echo '%s'";
char zBuf[ 1024 ];
@@ -214,9 +212,7 @@ do_version ()
/* * * * * * * * * * * * */
void
-initialize ( argc, argv )
- int argc;
- char** argv;
+initialize ( int argc, char** argv )
{
static const char var_not_found[] =
#ifndef __STDC__
@@ -335,8 +331,7 @@ ENV_TABLE
result is the NUL terminated contents of the file. The file
is presumed to be an ASCII text file containing no NULs. */
char *
-load_file ( fname )
- const char* fname;
+load_file ( const char* fname )
{
struct stat stbf;
char* res;
@@ -389,10 +384,8 @@ load_file ( fname )
return res;
}
-static int machine_matches PARAMS ((tFixDesc *));
static int
-machine_matches( p_fixd )
- tFixDesc *p_fixd;
+machine_matches( tFixDesc* p_fixd )
{
# ifndef SEPARATE_FIX_PROC
tSCC case_fmt[] = "case %s in\n"; /* 9 bytes, plus string */
@@ -484,16 +477,15 @@ machine_matches( p_fixd )
run_compiles run all the regexp compiles for all the fixes once.
*/
void
-run_compiles ()
+run_compiles (void)
{
tFixDesc *p_fixd = fixDescList;
int fix_ct = FIX_COUNT;
- regex_t *p_re = (regex_t *) xmalloc (REGEX_COUNT * sizeof (regex_t));
+ regex_t *p_re = xcalloc (REGEX_COUNT, sizeof (regex_t));
/* Make sure compile_re does not stumble across invalid data */
- memset ( (void*)p_re, '\0', REGEX_COUNT * sizeof (regex_t) );
- memset ( (void*)&incl_quote_re, '\0', sizeof (regex_t) );
+ memset (&incl_quote_re, '\0', sizeof (regex_t));
compile_re (incl_quote_pat, &incl_quote_re, 1,
"quoted include", "run_compiles");
@@ -561,9 +553,8 @@ run_compiles ()
#endif
-static FILE *create_file PARAMS ((void));
static FILE *
-create_file ()
+create_file (void)
{
int fd;
FILE *pf;
@@ -626,11 +617,8 @@ create_file ()
Result: APPLY_FIX or SKIP_FIX, depending on the result of the
shell script we run. */
#ifndef SEPARATE_FIX_PROC
-static int test_test PARAMS ((tTestDesc *, char *));
static int
-test_test (p_test, pz_test_file)
- tTestDesc *p_test;
- char* pz_test_file;
+test_test (tTestDesc* p_test, char* pz_test_file)
{
tSCC cmd_fmt[] =
"file=%s\n\
@@ -682,11 +670,8 @@ fi";
The caller may choose to reverse meaning if the sense of the test
is inverted. */
-static int egrep_test PARAMS ((char *, tTestDesc *));
static int
-egrep_test (pz_data, p_test)
- char *pz_data;
- tTestDesc *p_test;
+egrep_test (char* pz_data, tTestDesc* p_test)
{
#ifdef DEBUG
if (p_test->p_test_regex == 0)
@@ -705,12 +690,10 @@ egrep_test (pz_data, p_test)
the file name. If we emit the name, our invoking shell will try
to copy a non-existing file into the destination directory. */
-static int quoted_file_exists PARAMS ((const char *, const char *, const char *));
static int
-quoted_file_exists (pz_src_path, pz_file_path, pz_file)
- const char *pz_src_path;
- const char *pz_file_path;
- const char *pz_file;
+quoted_file_exists (const char* pz_src_path,
+ const char* pz_file_path,
+ const char* pz_file)
{
char z[ MAXPATHLEN ];
char* pz;
@@ -757,12 +740,10 @@ quoted_file_exists (pz_src_path, pz_file_path, pz_file)
for interpretation by the invoking shell */
-static void extract_quoted_files PARAMS ((char *, const char *, regmatch_t *));
static void
-extract_quoted_files (pz_data, pz_fixed_file, p_re_match)
- char *pz_data;
- const char *pz_fixed_file;
- regmatch_t *p_re_match;
+extract_quoted_files (char* pz_data,
+ const char* pz_fixed_file,
+ regmatch_t* p_re_match)
{
char *pz_dir_end = strrchr (pz_fixed_file, '/');
char *pz_incl_quot = pz_data;
@@ -819,11 +800,8 @@ extract_quoted_files (pz_data, pz_fixed_file, p_re_match)
Somebody wrote a *_fix subroutine that we must call.
*/
#ifndef SEPARATE_FIX_PROC
-static int internal_fix PARAMS ((int, tFixDesc *));
static int
-internal_fix (read_fd, p_fixd)
- int read_fd;
- tFixDesc* p_fixd;
+internal_fix (int read_fd, tFixDesc* p_fixd)
{
int fd[2];
@@ -890,11 +868,10 @@ internal_fix (read_fd, p_fixd)
#ifdef SEPARATE_FIX_PROC
static void
-fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
- tFixDesc* p_fixd;
- tCC* pz_fix_file;
- tCC* pz_file_source;
- tCC* pz_temp_file;
+fix_with_system (tFixDesc* p_fixd,
+ tCC* pz_fix_file,
+ tCC* pz_file_source,
+ tCC* pz_temp_file)
{
char* pz_cmd;
char* pz_scan;
@@ -911,7 +888,7 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
+ strlen( pz_file_source )
+ strlen( pz_temp_file );
- pz_cmd = (char*)xmalloc( argsize );
+ pz_cmd = xmalloc (argsize);
strcpy( pz_cmd, pz_orig_dir );
pz_scan = pz_cmd + strlen( pz_orig_dir );
@@ -970,7 +947,7 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
}
/* Estimated buffer size we will need. */
- pz_scan = pz_cmd = (char*)xmalloc( argsize );
+ pz_scan = pz_cmd = xmalloc (argsize);
/* How much of it do we allot to the program name and its
arguments. */
parg_size = argsize - parg_size;
@@ -1010,7 +987,7 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
while (pz_scan == (char*)NULL)
{
size_t already_filled = pz_scan_save - pz_cmd;
- pz_cmd = (char*)xrealloc( pz_cmd, argsize += 100 );
+ pz_cmd = xrealloc (pz_cmd, argsize += 100);
pz_scan_save = pz_scan = pz_cmd + already_filled;
parg_size += 100;
pz_scan = make_raw_shell_str( pz_scan, pArg,
@@ -1040,12 +1017,8 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
for stdout. */
#else /* is *NOT* SEPARATE_FIX_PROC */
-static int start_fixer PARAMS ((int, tFixDesc *, char *));
static int
-start_fixer (read_fd, p_fixd, pz_fix_file)
- int read_fd;
- tFixDesc* p_fixd;
- char* pz_fix_file;
+start_fixer (int read_fd, tFixDesc* p_fixd, char* pz_fix_file)
{
tCC* pz_cmd_save;
char* pz_cmd;
@@ -1058,9 +1031,8 @@ start_fixer (read_fd, p_fixd, pz_fix_file)
else
{
tSCC z_cmd_fmt[] = "file='%s'\n%s";
- pz_cmd = (char*) xmalloc (strlen (p_fixd->patch_args[2])
- + sizeof( z_cmd_fmt )
- + strlen( pz_fix_file ));
+ pz_cmd = xmalloc (strlen (p_fixd->patch_args[2])
+ + sizeof (z_cmd_fmt) + strlen (pz_fix_file));
sprintf (pz_cmd, z_cmd_fmt, pz_fix_file, p_fixd->patch_args[2]);
pz_cmd_save = p_fixd->patch_args[2];
p_fixd->patch_args[2] = pz_cmd;
@@ -1115,10 +1087,8 @@ start_fixer (read_fd, p_fixd, pz_fix_file)
Input: the original text of the file and the file's name
Result: none. A new file may or may not be created. */
-static t_bool fix_applies PARAMS ((tFixDesc *));
static t_bool
-fix_applies (p_fixd)
- tFixDesc *p_fixd;
+fix_applies (tFixDesc* p_fixd)
{
const char *pz_fname = pz_curr_file;
const char *pz_scan = p_fixd->file_list;
@@ -1230,10 +1200,8 @@ fix_applies (p_fixd)
Write out a replacement file */
-static void write_replacement PARAMS ((tFixDesc *));
static void
-write_replacement (p_fixd)
- tFixDesc *p_fixd;
+write_replacement (tFixDesc* p_fixd)
{
const char* pz_text = p_fixd->patch_args[0];
@@ -1257,10 +1225,8 @@ write_replacement (p_fixd)
the matched text and then copy any remaining data from the
output of the filter chain.
*/
-static void test_for_changes PARAMS ((int));
static void
-test_for_changes (read_fd)
- int read_fd;
+test_for_changes (int read_fd)
{
FILE *in_fp = fdopen (read_fd, "r");
FILE *out_fp = (FILE *) NULL;
@@ -1331,7 +1297,7 @@ test_for_changes (read_fd)
Result: none. A new file may or may not be created. */
void
-process ()
+process (void)
{
tFixDesc *p_fixd = fixDescList;
int todo_ct = FIX_COUNT;
diff --git a/gcc/fixinc/fixincl.sh b/gcc/fixinc/fixincl.sh
index de56e615e63..80a77971818 100755
--- a/gcc/fixinc/fixincl.sh
+++ b/gcc/fixinc/fixincl.sh
@@ -2,7 +2,7 @@
#
# Install modified versions of 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.
+# directory that GCC will search.
#
# See README-fixinc for more information.
#
@@ -27,6 +27,8 @@
# Boston, MA 02111-1307, USA.
#
# # # # # # # # # # # # # # # # # # # # #
+
+# Usage: fixincl.sh output-dir input-dir
#
# Directory in which to store the results.
# Fail if no arg to specify a directory for the output.
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index b1a426d468e..bbc664b4ee8 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 Tuesday July 8, 2003 at 01:41:54 PM PDT
+ * It has been AutoGen-ed Friday August 29, 2003 at 01:36:38 PM EDT
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Jul 8 13:41:54 PDT 2003
+/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Aug 29 13:36:38 EDT 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 154 fixup descriptions.
+ * This file contains 158 fixup descriptions.
*
* See README for more information.
*
@@ -286,8 +286,9 @@ fix = {\n\
};\n\
#endif\n\n\n\
/*\n\
- * Completely replace <sys/byteorder.h>; with a file that implements gcc's\n\
- * optimized byteswapping.\n\
+ * Completely replace <sys/byteorder.h> with a file that implements gcc's\n\
+ * optimized byteswapping. (The original probably implemented some\n\
+ * incompatible optimized byteswapping.)\n\
*/\n\
fix = {\n\
hackname = AAB_svr4_replace_byteorder;\n\
@@ -298,6 +299,7 @@ fix = {\n\
mach = \"i[34567]86-*-solaris2.[0-4]\";\n\
mach = \"powerpcle-*-solaris2.[0-4]\";\n\
mach = \"sparc-*-solaris2.[0-4]\";\n\
+ mach = \"i[34567]86-sequent-ptx*\";\n\
files = sys/byteorder.h;\n\
replace = <<- _EndOfHeader_\n\
#ifndef _SYS_BYTEORDER_H\n\
@@ -859,6 +861,45 @@ static const char* apzAlpha_ParensPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Alpha_Pthread fix
+ */
+tSCC zAlpha_PthreadName[] =
+ "alpha_pthread";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAlpha_PthreadList[] =
+ "|pthread.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAlpha_PthreadMachs[] = {
+ "alpha*-dec-osf*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zAlpha_PthreadSelect0[] =
+ "(#[ \t]*if defined \\(_PTHREAD_ENV_DECC\\) || defined \\(_PTHREAD_ENV_EPCC\\))\n\
+(#[ \t]*define _PTHREAD_USE_PTDNAM_)";
+
+#define ALPHA_PTHREAD_TEST_CT 1
+static tTestDesc aAlpha_PthreadTests[] = {
+ { TT_EGREP, zAlpha_PthreadSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Alpha_Pthread
+ */
+static const char* apzAlpha_PthreadPatch[] = {
+ "format",
+ "%1 || defined (__PRAGMA_EXTERN_PREFIX)\n\
+%2",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Alpha_Sbrk fix
*/
tSCC zAlpha_SbrkName[] =
@@ -919,7 +960,7 @@ tSCC zAvoid_Bool_DefineSelect0[] =
* content bypass pattern - skip fix if pattern found
*/
tSCC zAvoid_Bool_DefineBypass0[] =
- "we must use the C\\+\\+ compiler's type";
+ "__cplusplus";
#define AVOID_BOOL_DEFINE_TEST_CT 2
static tTestDesc aAvoid_Bool_DefineTests[] = {
@@ -964,7 +1005,7 @@ tSCC zAvoid_Bool_TypeSelect0[] =
* content bypass pattern - skip fix if pattern found
*/
tSCC zAvoid_Bool_TypeBypass0[] =
- "we must use the C\\+\\+ compiler's type";
+ "__cplusplus";
#define AVOID_BOOL_TYPE_TEST_CT 2
static tTestDesc aAvoid_Bool_TypeTests[] = {
@@ -1007,7 +1048,7 @@ tSCC zAvoid_Wchar_T_TypeSelect0[] =
* content bypass pattern - skip fix if pattern found
*/
tSCC zAvoid_Wchar_T_TypeBypass0[] =
- "we must use the C\\+\\+ compiler's type";
+ "__cplusplus";
tSCC zAvoid_Wchar_T_TypeBypass1[] =
"_LINUX_NLS_H";
tSCC zAvoid_Wchar_T_TypeBypass2[] =
@@ -1231,7 +1272,7 @@ tSCC zBroken_CabsName[] =
* File name selection pattern
*/
tSCC zBroken_CabsList[] =
- "|math.h|";
+ "|math.h|architecture/ppc/math.h|architecture/i386/math.h|";
/*
* Machine/OS name selection pattern
*/
@@ -1253,7 +1294,7 @@ static tTestDesc aBroken_CabsTests[] = {
static const char* apzBroken_CabsPatch[] = {
"format",
"",
- "^extern[ \t]+double[ \t]+cabs\\((struct dbl_hypot|)\\);",
+ "^extern[ \t]+double[ \t]+cabs[ \t]*\\([^\\)]*\\);",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -2830,14 +2871,21 @@ tSCC zLimits_IfndefsList[] =
#define apzLimits_IfndefsMachs (const char**)NULL
/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zLimits_IfndefsSelect0[] =
+ "^[ \t]*#[ \t]*define[ \t]+((FLT|DBL)_(MIN|MAX|DIG))[ \t].*";
+
+/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zLimits_IfndefsBypass0[] =
"ifndef[ \t]+FLT_(MIN|MAX)";
-#define LIMITS_IFNDEFS_TEST_CT 1
+#define LIMITS_IFNDEFS_TEST_CT 2
static tTestDesc aLimits_IfndefsTests[] = {
- { TT_NEGREP, zLimits_IfndefsBypass0, (regex_t*)NULL }, };
+ { TT_NEGREP, zLimits_IfndefsBypass0, (regex_t*)NULL },
+ { TT_EGREP, zLimits_IfndefsSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Limits_Ifndefs
@@ -2847,7 +2895,6 @@ static const char* apzLimits_IfndefsPatch[] = {
"#ifndef %1\n\
%0\n\
#endif",
- "^[ \t]*#[ \t]*define[ \t]+((FLT|DBL)_(MIN|MAX|DIG))[ \t].*",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -3022,7 +3069,7 @@ tSCC zMath_ExceptionSelect0[] =
* content bypass pattern - skip fix if pattern found
*/
tSCC zMath_ExceptionBypass0[] =
- "We have a problem when using C\\+\\+";
+ "__cplusplus";
#define MATH_EXCEPTION_TEST_CT 2
static tTestDesc aMath_ExceptionTests[] = {
@@ -3962,7 +4009,7 @@ static const char* apzSolaris_Mutex_Init_2Patch[] = {
#else\n\
%1, {0}}%3\n\
#endif",
- "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+{.*),[ \t]*0}(|[ \t].*)$",
+ "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+\\{.*),[ \t]*0\\}(|[ \t].*)$",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -4238,6 +4285,7 @@ s@ __va_list)@ __gnuc_va_list)@\n\
s@typedef[ \t]\\(.*\\)[ \t]va_list[ \t]*;@typedef \\1 __not_va_list__;@\n\
s@typedef[ \t]*__va_list__@typedef __gnuc_va_list@\n\
s@GNUC_VA_LIST@GNUC_Va_LIST@\n\
+s@_VA_LIST_DEFINED@_Va_LIST_DEFINED@\n\
s@_NEED___VA_LIST@_NEED___Va_LIST@\n\
s@VA_LIST@DUMMY_VA_LIST@\n\
s@_Va_LIST@_VA_LIST@",
@@ -4431,17 +4479,20 @@ tSCC zStruct_SockaddrList[] =
* content selection pattern - do fix if pattern found
*/
tSCC zStruct_SockaddrSelect0[] =
- "^.*authdes_create.*struct sockaddr";
+ "^.*authdes_create.*struct sockaddr[^_]";
/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zStruct_SockaddrBypass0[] =
"<sys/socket.h>";
+tSCC zStruct_SockaddrBypass1[] =
+ "struct sockaddr;\n";
-#define STRUCT_SOCKADDR_TEST_CT 2
+#define STRUCT_SOCKADDR_TEST_CT 3
static tTestDesc aStruct_SockaddrTests[] = {
{ TT_NEGREP, zStruct_SockaddrBypass0, (regex_t*)NULL },
+ { TT_NEGREP, zStruct_SockaddrBypass1, (regex_t*)NULL },
{ TT_EGREP, zStruct_SockaddrSelect0, (regex_t*)NULL }, };
/*
@@ -4855,6 +4906,45 @@ static const char* apzSvr4_GetcwdPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Svr4_Krnl fix
+ */
+tSCC zSvr4_KrnlName[] =
+ "svr4_krnl";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSvr4_KrnlList[] =
+ "|fs/rfs/rf_cache.h|sys/erec.h|sys/err.h|sys/char.h|sys/getpages.h|sys/map.h|sys/cmn_err.h|sys/kdebugger.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzSvr4_KrnlMachs[] = {
+ "*-*-sysv4*",
+ "i?86-sequent-ptx*",
+ (const char*)NULL };
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zSvr4_KrnlBypass0[] =
+ "_KERNEL";
+
+#define SVR4_KRNL_TEST_CT 1
+static tTestDesc aSvr4_KrnlTests[] = {
+ { TT_NEGREP, zSvr4_KrnlBypass0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Svr4_Krnl
+ */
+static const char* apzSvr4_KrnlPatch[] = {
+ "wrap",
+ "#ifdef _KERNEL\n",
+ "#endif /* _KERNEL */\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Svr4_Profil fix
*/
tSCC zSvr4_ProfilName[] =
@@ -4890,6 +4980,85 @@ static const char* apzSvr4_ProfilPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Svr4_Sighandler_Type fix
+ */
+tSCC zSvr4_Sighandler_TypeName[] =
+ "svr4_sighandler_type";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSvr4_Sighandler_TypeList[] =
+ "|sys/signal.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzSvr4_Sighandler_TypeMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSvr4_Sighandler_TypeSelect0[] =
+ "void *\\(\\*\\)\\(\\)";
+
+#define SVR4_SIGHANDLER_TYPE_TEST_CT 1
+static tTestDesc aSvr4_Sighandler_TypeTests[] = {
+ { TT_EGREP, zSvr4_Sighandler_TypeSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Svr4_Sighandler_Type
+ */
+static const char* apzSvr4_Sighandler_TypePatch[] = {
+ "format",
+ "void (*)(int)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Svr4_Undeclared_Getrnge fix
+ */
+tSCC zSvr4_Undeclared_GetrngeName[] =
+ "svr4_undeclared_getrnge";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSvr4_Undeclared_GetrngeList[] =
+ "|regexp.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzSvr4_Undeclared_GetrngeMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSvr4_Undeclared_GetrngeSelect0[] =
+ "getrnge";
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zSvr4_Undeclared_GetrngeBypass0[] =
+ "static void getrnge";
+
+#define SVR4_UNDECLARED_GETRNGE_TEST_CT 2
+static tTestDesc aSvr4_Undeclared_GetrngeTests[] = {
+ { TT_NEGREP, zSvr4_Undeclared_GetrngeBypass0, (regex_t*)NULL },
+ { TT_EGREP, zSvr4_Undeclared_GetrngeSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Svr4_Undeclared_Getrnge
+ */
+static const char* apzSvr4_Undeclared_GetrngePatch[] = {
+ "format",
+ "%0\n\
+static int getrnge ();",
+ "^static int[ \t]+size;",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Sysv68_String fix
*/
tSCC zSysv68_StringName[] =
@@ -5493,11 +5662,11 @@ static tTestDesc aUndefine_NullTests[] = {
*/
static const char* apzUndefine_NullPatch[] = {
"format",
- "#ifndef NULL%2\n\
-#define NULL%1%2\n\
-#endif%2\n",
- "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n\
-]+)([\r]*)\n",
+ "#ifndef NULL\n\
+#define NULL%1\n\
+#endif\n",
+ "^#[ \t]*define[ \t]+NULL([^\r\n\
+]+)[\r]*\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -6100,9 +6269,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 171
+#define REGEX_COUNT 178
#define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT 154
+#define FIX_COUNT 158
/*
* Enumerate the fixes
@@ -6126,6 +6295,7 @@ typedef enum {
ALPHA_ASSERT_FIXIDX,
ALPHA_GETOPT_FIXIDX,
ALPHA_PARENS_FIXIDX,
+ ALPHA_PTHREAD_FIXIDX,
ALPHA_SBRK_FIXIDX,
AVOID_BOOL_DEFINE_FIXIDX,
AVOID_BOOL_TYPE_FIXIDX,
@@ -6229,7 +6399,10 @@ typedef enum {
SVR4__P_FIXIDX,
SVR4_DISABLE_OPT_FIXIDX,
SVR4_GETCWD_FIXIDX,
+ SVR4_KRNL_FIXIDX,
SVR4_PROFIL_FIXIDX,
+ SVR4_SIGHANDLER_TYPE_FIXIDX,
+ SVR4_UNDECLARED_GETRNGE_FIXIDX,
SYSV68_STRING_FIXIDX,
SYSZ_STDLIB_FOR_SUN_FIXIDX,
THREAD_KEYWORD_FIXIDX,
@@ -6355,6 +6528,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
ALPHA_PARENS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aAlpha_ParensTests, apzAlpha_ParensPatch, 0 },
+ { zAlpha_PthreadName, zAlpha_PthreadList,
+ apzAlpha_PthreadMachs,
+ ALPHA_PTHREAD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aAlpha_PthreadTests, apzAlpha_PthreadPatch, 0 },
+
{ zAlpha_SbrkName, zAlpha_SbrkList,
apzAlpha_SbrkMachs,
ALPHA_SBRK_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -6870,11 +7048,26 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SVR4_GETCWD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSvr4_GetcwdTests, apzSvr4_GetcwdPatch, 0 },
+ { zSvr4_KrnlName, zSvr4_KrnlList,
+ apzSvr4_KrnlMachs,
+ SVR4_KRNL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSvr4_KrnlTests, apzSvr4_KrnlPatch, 0 },
+
{ zSvr4_ProfilName, zSvr4_ProfilList,
apzSvr4_ProfilMachs,
SVR4_PROFIL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSvr4_ProfilTests, apzSvr4_ProfilPatch, 0 },
+ { zSvr4_Sighandler_TypeName, zSvr4_Sighandler_TypeList,
+ apzSvr4_Sighandler_TypeMachs,
+ SVR4_SIGHANDLER_TYPE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSvr4_Sighandler_TypeTests, apzSvr4_Sighandler_TypePatch, 0 },
+
+ { zSvr4_Undeclared_GetrngeName, zSvr4_Undeclared_GetrngeList,
+ apzSvr4_Undeclared_GetrngeMachs,
+ SVR4_UNDECLARED_GETRNGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSvr4_Undeclared_GetrngeTests, apzSvr4_Undeclared_GetrngePatch, 0 },
+
{ zSysv68_StringName, zSysv68_StringList,
apzSysv68_StringMachs,
SYSV68_STRING_TEST_CT, FD_MACH_ONLY,
diff --git a/gcc/fixinc/fixlib.c b/gcc/fixinc/fixlib.c
index 49edda776d1..99d04cc5531 100644
--- a/gcc/fixinc/fixlib.c
+++ b/gcc/fixinc/fixlib.c
@@ -32,8 +32,7 @@ Boston, MA 02111-1307, USA. */
is presumed to be an ASCII text file containing no NULs. */
char *
-load_file_data (fp)
- FILE* fp;
+load_file_data (FILE* fp)
{
char *pz_data = (char*)NULL;
int space_left = -1; /* allow for terminating NUL */
@@ -49,7 +48,7 @@ load_file_data (fp)
if (space_left < 1024)
{
space_left += 4096;
- pz_data = xrealloc ((void*)pz_data, space_left + space_used + 1 );
+ pz_data = xrealloc (pz_data, space_left + space_used + 1 );
}
size_read = fread (pz_data + space_used, 1, space_left, fp);
@@ -73,7 +72,7 @@ load_file_data (fp)
space_used += size_read;
} while (! feof (fp));
- pz_data = xrealloc ((void*)pz_data, space_used+1 );
+ pz_data = xrealloc (pz_data, space_used+1 );
pz_data[ space_used ] = NUL;
return pz_data;
@@ -81,9 +80,7 @@ load_file_data (fp)
#ifdef IS_CXX_HEADER_NEEDED
t_bool
-is_cxx_header (fname, text)
- tCC *fname;
- tCC *text;
+is_cxx_header (tCC* fname, tCC* text)
{
/* First, check to see if the file is in a C++ directory */
for (;;)
@@ -147,9 +144,7 @@ template[ \t]*<|\
* We are not doing a correctness syntax check here.
*/
tCC*
-skip_quote( q, text )
- char q;
- char* text;
+skip_quote(char q, char* text )
{
for (;;)
{
@@ -188,12 +183,7 @@ skip_quote( q, text )
REG_EXTENDED|REG_NEWLINE produces identical regex syntax/semantics
to egrep (verified from 4.4BSD Programmer's Reference Manual). */
void
-compile_re( pat, re, match, e1, e2 )
- tCC *pat;
- regex_t *re;
- int match;
- tCC *e1;
- tCC *e2;
+compile_re( tCC* pat, regex_t* re, int match, tCC* e1, tCC* e2 )
{
tSCC z_bad_comp[] = "fixincl ERROR: cannot compile %s regex for %s\n\
\texpr = `%s'\n\terror %s\n";
@@ -228,10 +218,7 @@ static regex_t mn_name_re;
static int mn_compiled = 0;
void
-mn_get_regexps( label_re, name_re, who )
- regex_t **label_re;
- regex_t **name_re;
- tCC *who;
+mn_get_regexps(regex_t** label_re, regex_t** name_re, tCC* who )
{
if (! mn_compiled)
{
@@ -248,10 +235,7 @@ mn_get_regexps( label_re, name_re, who )
#ifdef SEPARATE_FIX_PROC
char*
-make_raw_shell_str( pz_d, pz_s, smax )
- char* pz_d;
- tCC* pz_s;
- size_t smax;
+make_raw_shell_str( char* pz_d, tCC* pz_s, size_t smax )
{
tSCC zQ[] = "'\\''";
size_t dtaSize;
diff --git a/gcc/fixinc/fixlib.h b/gcc/fixinc/fixlib.h
index 6287a2b8e56..25e97d48ba1 100644
--- a/gcc/fixinc/fixlib.h
+++ b/gcc/fixinc/fixlib.h
@@ -199,31 +199,27 @@ extern int gnu_type_map_ct;
/*
* Exported procedures
*/
-char * load_file_data PARAMS(( FILE* fp ));
+char * load_file_data ( FILE* fp );
#ifdef IS_CXX_HEADER_NEEDED
-t_bool is_cxx_header PARAMS(( tCC* filename, tCC* filetext ));
+t_bool is_cxx_header ( tCC* filename, tCC* filetext );
#endif /* IS_CXX_HEADER_NEEDED */
#ifdef SKIP_QUOTE_NEEDED
-tCC* skip_quote PARAMS(( char q, char* text ));
+tCC* skip_quote ( char q, char* text );
#endif
-void compile_re PARAMS(( tCC* pat, regex_t* re, int match,
- tCC *e1, tCC *e2 ));
+void compile_re ( tCC* pat, regex_t* re, int match, tCC *e1, tCC *e2 );
-void apply_fix PARAMS(( tFixDesc* p_fixd, tCC* filname ));
+void apply_fix ( tFixDesc* p_fixd, tCC* filname );
apply_fix_p_t
- run_test PARAMS(( tCC* t_name, tCC* f_name, tCC* text ));
+ run_test ( tCC* t_name, tCC* f_name, tCC* text );
#ifdef SEPARATE_FIX_PROC
-char* make_raw_shell_str
- PARAMS(( char* pz_d, tCC* pz_s, size_t smax ));
+char* make_raw_shell_str ( char* pz_d, tCC* pz_s, size_t smax );
#endif
#ifdef MN_NAME_PAT
-void mn_get_regexps
- PARAMS(( regex_t** label_re, regex_t** name_re,
- tCC *who ));
+void mn_get_regexps ( regex_t** label_re, regex_t** name_re, tCC *who );
#endif
#endif /* ! GCC_FIXLIB_H */
diff --git a/gcc/fixinc/fixtests.c b/gcc/fixinc/fixtests.c
index 92bc10cc9d3..33ea65208f9 100644
--- a/gcc/fixinc/fixtests.c
+++ b/gcc/fixinc/fixtests.c
@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. */
ENV_TABLE
#undef _ENV_
-typedef apply_fix_p_t t_test_proc PARAMS(( tCC* file, tCC* text ));
+typedef apply_fix_p_t t_test_proc ( tCC* file, tCC* text );
typedef struct {
tCC* test_name;
@@ -62,12 +62,9 @@ typedef struct {
_FT_( "machine_name", machine_name_test ) \
_FT_( "stdc_0_in_system_headers", stdc_0_in_system_headers_test )
-#define TEST_FOR_FIX_PROC_HEAD( test ) \
-static apply_fix_p_t test PARAMS(( tCC* file, tCC* text )); \
-static apply_fix_p_t test ( fname, text ) \
- tCC* fname ATTRIBUTE_UNUSED; \
- tCC* text ATTRIBUTE_UNUSED;
-
+#define TEST_FOR_FIX_PROC_HEAD( test ) \
+static apply_fix_p_t test ( tCC* fname ATTRIBUTE_UNUSED, \
+ tCC* text ATTRIBUTE_UNUSED )
TEST_FOR_FIX_PROC_HEAD( machine_name_test )
{
@@ -139,10 +136,7 @@ TEST_FOR_FIX_PROC_HEAD( stdc_0_in_system_headers_test )
*/
apply_fix_p_t
-run_test( tname, fname, text )
- tCC* tname;
- tCC* fname;
- tCC* text;
+run_test( tCC* tname, tCC* fname, tCC* text )
{
#define _FT_(n,p) { n, p },
static test_entry_t test_table[] = { FIX_TEST_TABLE { NULL, NULL }};
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index f77c5411d14..edf28b5cf0e 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -221,8 +221,9 @@ fix = {
/*
- * Completely replace <sys/byteorder.h>; with a file that implements gcc's
- * optimized byteswapping.
+ * Completely replace <sys/byteorder.h> with a file that implements gcc's
+ * optimized byteswapping. (The original probably implemented some
+ * incompatible optimized byteswapping.)
*/
fix = {
hackname = AAB_svr4_replace_byteorder;
@@ -233,6 +234,7 @@ fix = {
mach = "i[34567]86-*-solaris2.[0-4]";
mach = "powerpcle-*-solaris2.[0-4]";
mach = "sparc-*-solaris2.[0-4]";
+ mach = "i[34567]86-sequent-ptx*";
files = sys/byteorder.h;
replace = <<- _EndOfHeader_
#ifndef _SYS_BYTEORDER_H
@@ -578,7 +580,27 @@ fix = {
/*
+ * Obey __PRAGMA_EXTERN_PREFIX for Tru64 UNIX <pthread.h>.
+ */
+fix = {
+ hackname = alpha_pthread;
+ files = pthread.h;
+ select = "(#[ \t]*if defined \\(_PTHREAD_ENV_DECC\\) || defined \\(_PTHREAD_ENV_EPCC\\))\n"
+ "(#[ \t]*define _PTHREAD_USE_PTDNAM_)";
+
+ mach = "alpha*-dec-osf*";
+ c_fix = format;
+ c_fix_arg = "%1 || defined (__PRAGMA_EXTERN_PREFIX)\n%2";
+
+ test_text = "# if defined (_PTHREAD_ENV_DECC) || defined (_PTHREAD_ENV_EPCC)\n"
+ "# define _PTHREAD_USE_PTDNAM_\n"
+ "# endif";
+};
+
+
+/*
* Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
+ * And OpenBSD.
*/
fix = {
hackname = alpha_sbrk;
@@ -603,7 +625,7 @@ fix = {
files = tinfo.h;
select = "#[ \t]*define[ \t]+bool[ \t]";
- bypass = "we must use the C\\+\\+ compiler's type";
+ bypass = "__cplusplus";
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
@@ -621,7 +643,7 @@ fix = {
files = tinfo.h;
select = "^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;";
- bypass = "we must use the C\\+\\+ compiler's type";
+ bypass = "__cplusplus";
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
@@ -643,7 +665,7 @@ fix = {
hackname = avoid_wchar_t_type;
select = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;";
- bypass = "we must use the C\\+\\+ compiler's type";
+ bypass = "__cplusplus";
bypass = "_LINUX_NLS_H";
bypass = "XFree86: xc/lib/X11/Xlib\\.h";
@@ -763,21 +785,25 @@ fix = {
* This conflicts with C99. Discovered on AIX.
* SunOS4 has its cabs() declaration followed by a comment which
* terminates on the following line.
+ * Darwin hides its broken cabs in architecture-specific subdirs.
*/
fix = {
hackname = broken_cabs;
- files = "math.h";
- select = '^extern[ \t]+double[ \t]+cabs';
+ files = "math.h";
+ files = "architecture/ppc/math.h";
+ files = "architecture/i386/math.h";
+ select = '^extern[ \t]+double[ \t]+cabs';
c_fix = format;
c_fix_arg = "";
- c_fix_arg = "^extern[ \t]+double[ \t]+cabs\\((struct dbl_hypot|)\\);";
+ c_fix_arg = "^extern[ \t]+double[ \t]+cabs[ \t]*\\([^\\)]*\\);";
test_text = "#ifdef __STDC__\n"
"extern double cabs(struct dbl_hypot);\n"
"#else\n"
"extern double cabs();\n"
"#endif\n"
+ "extern double cabs ( _Complex z );\n"
"extern double cabs(); /* This is a comment\n"
" and it ends here. */";
};
@@ -938,7 +964,12 @@ fix = {
/*
- * Fix these files to use the same types that we think they should.
+ * Fix these files to use the types we think they should for
+ * ptrdiff_t, size_t, and wchar_t.
+ *
+ * This defines the types in terms of macros predefined by our 'cpp'.
+ * This is supposedly necessary for glibc's handling of these types.
+ * It's probably not necessary for anyone else, but it doesn't hurt.
*/
fix = {
hackname = gnu_types;
@@ -1609,17 +1640,33 @@ fix = {
hackname = limits_ifndefs;
files = "sys/limits.h";
files = "limits.h";
+ select = "^[ \t]*#[ \t]*define[ \t]+"
+ "((FLT|DBL)_(MIN|MAX|DIG))[ \t].*";
bypass = "ifndef[ \t]+FLT_(MIN|MAX)";
c_fix = format;
c_fix_arg = "#ifndef %1\n%0\n#endif";
- c_fix_arg = "^[ \t]*#[ \t]*define[ \t]+"
- "((FLT|DBL)_(MIN|MAX|DIG))[ \t].*";
+ /* Second arg is select expression */
test_text = " #\tdefine\tDBL_DIG \t 0 /* somthin' */";
};
/*
+ * Apparently some SVR4 systems typedef longlong_t to long ?
+ */
+#ifdef SVR4
+fix = {
+ hackname = longlong_t;
+ select = "typedef[ \t]+(unsigned[ \t]+)?long[ \t]+(u_)?longlong_t";
+ c_fix = format;
+ c_fix_arg = "typedef %1long long %2longlong_t";
+ test_text = "typedef long longlong_t\n"
+ "typedef unsigned long u_longlong_t";
+};
+#endif
+
+
+/*
* Delete the '#define void int' line from curses.h on Lynx
*/
fix = {
@@ -1680,7 +1727,8 @@ fix = {
/*
- * Some math.h files define struct exception, which conflicts with
+ * Some math.h files define struct exception (it's in the System V
+ * Interface Definition), which conflicts with
* the class exception defined in the C++ file std/stdexcept.h. We
* redefine it to __math_exception. This is not a great fix, but I
* haven't been able to think of anything better.
@@ -1692,7 +1740,7 @@ fix = {
hackname = math_exception;
files = math.h;
select = "struct exception";
- bypass = 'We have a problem when using C\+\+';
+ bypass = '__cplusplus';
c_fix = wrap;
c_fix_arg = "#ifdef __cplusplus\n"
@@ -1968,6 +2016,30 @@ fix = {
/*
+ * On DYNIX/ptx, sys/mc_param.h has an embedded asm for the cpuid instruction
+ * on the P5. This is not used by anything else so we ifdef it out.
+ * Current GCC doesn't seem to complain about the asm, though.
+ */
+#ifdef PTX
+fix = {
+ hackname = ptx_sys_mc_param_h;
+ files = sys/mc_param.h;
+ sed = "/__asm/,/}/{"
+ "/__asm/i\\\n"
+ "#if !defined (__GNUC__) && !defined (__GNUG__)\n"
+ "/}/a\\\n"
+ "#endif\n"
+ "}";
+ test_text = "__asm\n"
+ "int _CPUID()\n"
+ "{\n"
+ " non-GNU assembly here\n"
+ "}";
+};
+#endif
+
+
+/*
* Fix return type of fread and fwrite on sysV68
*/
fix = {
@@ -2190,8 +2262,8 @@ fix = {
"#else\n"
"%1, {0}}%3\n"
"#endif";
- c_fix_arg = "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+{.*)"
- ",[ \t]*0}" "(|[ \t].*)$";
+ c_fix_arg = "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+\\{.*)"
+ ",[ \t]*0\\}" "(|[ \t].*)$";
test_text =
'#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
"#define PTHREAD_MUTEX_INITIALIZER\t{{{0},0}, {{{0}}}, 0}\n"
@@ -2274,25 +2346,6 @@ fix = {
/*
- * Add a `static' declaration of `getrnge' into <regexp.h>.
- *
- * Don't do this if there is already a `static void getrnge' declaration
- * present, since this would cause a redeclaration error. Solaris 2.x has
- * such a declaration.
- */
-#ifdef SVR4
-fix = {
- hackname = static_getrnge;
- files = regexp.h;
- bypass = "static void getrnge";
- sed = "/^static int[ \t]*size;/c\\\n"
- "static int size ;\\\n\\\n"
- "static int getrnge ();";
-};
-#endif
-
-
-/*
* a missing semi-colon at the end of the statsswtch structure definition.
*/
fix = {
@@ -2363,6 +2416,7 @@ fix = {
"@typedef \\1 __not_va_list__;@\n"
"s@typedef[ \t]*__va_list__@typedef __gnuc_va_list@\n"
"s@GNUC_VA_LIST@GNUC_Va_LIST@\n"
+ "s@_VA_LIST_DEFINED@_Va_LIST_DEFINED@\n"
"s@_NEED___VA_LIST@_NEED___Va_LIST@\n"
"s@VA_LIST@DUMMY_VA_LIST@\n"
"s@_Va_LIST@_VA_LIST@";
@@ -2470,12 +2524,16 @@ fix = {
/*
* IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr
* in prototype without previous definition.
+ *
+ * Don't fix OpenBSD, which uses struct sockaddr_in prototyping the same
+ * function, and does define it.
*/
fix = {
hackname = struct_sockaddr;
files = rpc/auth.h;
- select = "^.*authdes_create.*struct sockaddr";
+ select = "^.*authdes_create.*struct sockaddr[^_]";
bypass = "<sys/socket\.h>";
+ bypass = "struct sockaddr;\n";
c_fix = format;
c_fix_arg = "struct sockaddr;\n%0";
test_text = "extern AUTH* authdes_create( struct sockaddr* );";
@@ -2771,11 +2829,21 @@ fix = {
/*
- * set ifdef _KERNEL
+ * Wrap some files on System V r4 and DYNIX/ptx systems with
+ * #ifdef _KERNEL, presumably to prevent kernel headers from
+ * leaking into userspace. This may not be necessary at all,
+ * but it was in the old scripts, so it seems safest to keep it for now.
*/
-#ifdef SVR4
fix = {
- hackname = svr4_kernel;
+ /* Can't name this with _kernel, or the test case will hit the bypass! */
+ hackname = svr4_krnl;
+ /* Since I'm rather unsure about the validity of this, limit it
+ * to the specific systems it was operating on before. It should
+ * also be bypassed for i?86-*-sysv4.3uw2, by that rule, but I didn't
+ * see an easy way to do that. Hopefully it will be harmless
+ * in any case. -- Nathanael */
+ mach = '*-*-sysv4*';
+ mach = 'i?86-sequent-ptx*';
files = fs/rfs/rf_cache.h;
files = sys/erec.h;
files = sys/err.h;
@@ -2784,14 +2852,21 @@ fix = {
files = sys/map.h;
files = sys/cmn_err.h;
files = sys/kdebugger.h;
+
+ /* This bypass will match _KERNEL, __KERNEL, __KERNEL__, etc.
+ * It will also match SVR4_KERNEL_CHECK, which means that the
+ * testsuite case will always be bypassed. Which is fine with me. */
bypass = '_KERNEL';
- c_fix = wrap;
+ c_fix = wrap;
c_fix_arg = "#ifdef _KERNEL\n";
c_fix_arg = "#endif /* _KERNEL */\n";
+
+ /* There's no reasonable test for this given that we don't know exactly
+ * what problem inspired it in the first place. */
test_text = "";
};
-#endif
+
/*
* Delete any #defines of `__i386' which may be present in <ieeefp.h>. They
@@ -2855,6 +2930,34 @@ fix = {
/*
+ * Some SVR4 systems supposedly use these non-ANSI preprocessor directives.
+ */
+#ifdef SVR4
+fix = {
+ hackname = svr4_preproc_lint_on;
+ select = '#lint\(on\)';
+ c_fix = format;
+ c_fix_arg = 'defined(lint)';
+ test_text = "#if #lint(on)";
+};
+fix = {
+ hackname = svr4_preproc_lint_off;
+ select = '#lint\(off\)';
+ c_fix = format;
+ c_fix_arg = '!defined(lint)';
+ test_text = "#if #lint(off)";
+};
+fix = {
+ hackname = svr4_preproc_machine;
+ select = '#(machine|system|cpu)\(([^)]*)\)';
+ c_fix = format;
+ c_fix_arg = 'defined(__%1__)';
+ test_text = "#if #machine(i386) || #system(vax) || #cpu(sparc)";
+};
+#endif
+
+
+/*
* Fix broken decl of profil present on some svr4 systems.
*/
fix = {
@@ -2940,6 +3043,22 @@ fix = {
};
#endif
+
+/*
+ * Correct types for signal handler constants like SIG_DFL; they might be
+ * void (*) (), and should be void (*) (int). C++ doesn't like the
+ * old style.
+ */
+fix = {
+ hackname = svr4_sighandler_type;
+ files = sys/signal.h;
+ select = 'void *\(\*\)\(\)';
+ c_fix = format;
+ c_fix_arg = "void (*)(int)";
+ test_text = "#define SIG_DFL (void(*)())0\n"
+ "#define SIG_IGN (void (*)())0\n";
+};
+
/*
* Put storage class at start of decl, to avoid warning.
*/
@@ -2954,6 +3073,35 @@ fix = {
/*
+ * Some SysV r4 systems, including Sequent's DYNIX/ptx, use the local
+ * function 'getrnge' in <regexp.h> before they declare it. For these
+ * systems add a 'static int' declaration of 'getrnge' into <regexp.h>
+ * early on.
+ *
+ * 'getrnge' traditionally manipulates a file-scope global called 'size',
+ * so put the declaration right after the declaration of 'size'.
+ *
+ * Don't do this if there is already a `static void getrnge' declaration
+ * present, since this would cause a redeclaration error. Solaris 2.x has
+ * such a declaration.
+ */
+fix = {
+ hackname = svr4_undeclared_getrnge;
+ files = regexp.h;
+ select = "getrnge";
+ bypass = "static void getrnge";
+ c_fix = format;
+ c_fix_arg = "%0\n"
+ "static int getrnge ();";
+ c_fix_arg = "^static int[ \t]+size;";
+ test_text = "static int size;\n"
+ "/* stuff which calls getrnge() */\n"
+ "static getrnge()\n"
+ "{}";
+};
+
+
+/*
* Like svr4_mach_defines, but with newfangled syntax.
* Source lines are of #define __i386 #machine(i386). Delete them.
*/
@@ -3268,6 +3416,8 @@ fix = {
/*
* Fix multiple defines for NULL. Sometimes, we stumble into \r\n
* terminated lines, so accommodate these. Test both ways.
+ * Don't bother to reproduce the \r\n termination, as GCC has to
+ * recognize \n termination anyway.
*/
fix = {
hackname = undefine_null;
@@ -3275,10 +3425,11 @@ fix = {
bypass = "#[ \t]*(ifn|un)def[ \t]+NULL($|[ \t\r])";
c_fix = format;
- c_fix_arg = "#ifndef NULL%2\n#define NULL%1%2\n#endif%2\n";
- c_fix_arg = "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n]+)([\r]*)\n";
+ c_fix_arg = "#ifndef NULL\n#define NULL%1\n#endif\n";
+ c_fix_arg = "^#[ \t]*define[ \t]+NULL([^\r\n]+)[\r]*\n";
- test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
+ test_text = "#define NULL 0UL\r\n"
+ "#define NULL\t((void*)0)\n";
};
/*
@@ -3350,7 +3501,7 @@ fix = {
/*
- * AIX headers define NULL to be cast to a void pointer,
+ * AIX and Interix headers define NULL to be cast to a void pointer,
* which is illegal in ANSI C++.
*/
fix = {
diff --git a/gcc/fixinc/mkfixinc.sh b/gcc/fixinc/mkfixinc.sh
index 2b6a9b77a06..03d9b155c71 100755
--- a/gcc/fixinc/mkfixinc.sh
+++ b/gcc/fixinc/mkfixinc.sh
@@ -42,48 +42,28 @@ case $machine in
fixincludes=fixinc.svr4
;;
- i?86-*-interix* | \
- alpha-*-interix*)
- fixincludes=fixinc.interix
- ;;
-
- i?86-*-openbsd*)
- fixincludes=fixinc.wrap
- ;;
-
i?86-sequent-ptx* | i?86-sequent-sysv[34]*)
fixincludes=fixinc.ptx
;;
alpha*-dec-*vms* | \
- arm-semi-aout | \
- armel-semi-aout | \
arm-semi-aof | \
- armel-semi-aof | \
hppa1.1-*-osf* | \
- hppa1.0-*-osf* | \
hppa1.1-*-bsd* | \
- hppa1.0-*-bsd* | \
- hppa*-*-lites* | \
i370-*-openedition | \
i?86-moss-msdos* | \
i?86-*-moss* | \
- i?86-*-win32 | \
i?86-*-pe | \
i?86-*-cygwin* | \
i?86-*-mingw32* | \
i?86-*-uwin* | \
+ i?86-*-interix* | \
powerpc-*-eabiaix* | \
powerpc-*-eabisim* | \
powerpc-*-eabi* | \
powerpc-*-rtems* | \
powerpcle-*-eabisim* | \
- powerpcle-*-eabi* | \
- powerpcle-*-winnt* | \
- powerpcle-*-pe | \
- powerpcle-*-cygwin* | \
- thumb-*-coff* | \
- thumbel-*-coff* )
+ powerpcle-*-eabi* )
# Don't do any fixing.
#
fixincludes=
diff --git a/gcc/fixinc/procopen.c b/gcc/fixinc/procopen.c
index a8b5ca11075..6fdb24fec7e 100644
--- a/gcc/fixinc/procopen.c
+++ b/gcc/fixinc/procopen.c
@@ -62,10 +62,7 @@ STATIC const char* def_args[] =
* to store the child's process id.
*/
int
-chain_open (stdin_fd, pp_args, p_child)
- int stdin_fd;
- tCC **pp_args;
- pid_t *p_child;
+chain_open (int stdin_fd, tCC** pp_args, pid_t* p_child)
{
t_fd_pair stdout_pair;
pid_t ch_id;
@@ -182,9 +179,7 @@ chain_open (stdin_fd, pp_args, p_child)
* The return value is the process id of the created process.
*/
pid_t
-proc2_open (p_pair, pp_args)
- t_fd_pair *p_pair;
- tCC **pp_args;
+proc2_open (t_fd_pair* p_pair, tCC** pp_args)
{
pid_t ch_id;
@@ -209,9 +204,7 @@ proc2_open (p_pair, pp_args)
* "fdopen(3)"-ed into file pointers instead.
*/
pid_t
-proc2_fopen (pf_pair, pp_args)
- t_pf_pair *pf_pair;
- tCC **pp_args;
+proc2_fopen (t_pf_pair* pf_pair, tCC** pp_args)
{
t_fd_pair fd_pair;
pid_t ch_id = proc2_open (&fd_pair, pp_args);
diff --git a/gcc/fixinc/server.c b/gcc/fixinc/server.c
index 842a32181ef..902fda15072 100644
--- a/gcc/fixinc/server.c
+++ b/gcc/fixinc/server.c
@@ -73,10 +73,8 @@ tSCC* p_cur_dir = (char *) NULL;
* The read data are stored in a malloc-ed string that is truncated
* to size at the end. Input is assumed to be an ASCII string.
*/
-static char *load_data PARAMS ((FILE *));
static char *
-load_data (fp)
- FILE *fp;
+load_data (FILE* fp)
{
char *pz_text;
size_t text_size;
@@ -111,7 +109,7 @@ load_data (fp)
size_t off = (size_t) (pz_scan - pz_text);
text_size += 4096;
- pz_text = xrealloc ((void *) pz_text, text_size);
+ pz_text = xrealloc (pz_text, text_size);
pz_scan = pz_text + off;
}
}
@@ -126,7 +124,7 @@ load_data (fp)
while ((pz_scan > pz_text) && ISSPACE (pz_scan[-1]))
pz_scan--;
*pz_scan = NUL;
- return xrealloc ((void *) pz_text, strlen (pz_text) + 1);
+ return xrealloc (pz_text, strlen (pz_text) + 1);
}
@@ -137,7 +135,7 @@ load_data (fp)
* pipes to it and from it, finally NULL out the file pointers
*/
void
-close_server ()
+close_server (void)
{
if ( (server_id != NULLPROCESS)
&& (server_master_pid == getpid ()))
@@ -157,10 +155,8 @@ close_server ()
* to our server, and also that if the server dies, we do not
* die from a sigpipe problem.
*/
-static void sig_handler PARAMS ((int));
static void
-sig_handler (signo)
- int signo ATTRIBUTE_UNUSED;
+sig_handler (int signo ATTRIBUTE_UNUSED)
{
#ifdef DEBUG
/* FIXME: this is illegal to do in a signal handler. */
@@ -178,11 +174,11 @@ sig_handler (signo)
* Also establishes the current directory to give to the
* server process at the start of every server command.
*/
-static void server_setup PARAMS ((void));
static void
-server_setup ()
+server_setup (void)
{
static int atexit_done = 0;
+ char buff [MAXPATHLEN + 1];
if (atexit_done++ == 0)
atexit (close_server);
@@ -196,7 +192,8 @@ server_setup ()
fputs ("trap : 1\n", server_pair.pf_write);
fflush (server_pair.pf_write);
- p_cur_dir = getcwd ((char *) NULL, MAXPATHLEN + 1);
+ getcwd (buff, MAXPATHLEN + 1);
+ p_cur_dir = xstrdup (buff);
}
/*
@@ -211,9 +208,8 @@ server_setup ()
* override with $CONFIG_SHELL, so we do the same.
*/
-static const char *find_shell PARAMS ((void));
static const char *
-find_shell ()
+find_shell (void)
{
char * shell = getenv ("CONFIG_SHELL");
if (shell)
@@ -243,8 +239,7 @@ find_shell ()
* "ShElL-OuTpUt-HaS-bEeN-cOmPlEtEd"
*/
char *
-run_shell (pz_cmd)
- const char *pz_cmd;
+run_shell (const char* pz_cmd)
{
tSCC zNoServer[] = "Server not running, cannot run:\n%s\n\n";
t_bool retry = BOOL_TRUE;
diff --git a/gcc/fixinc/server.h b/gcc/fixinc/server.h
index 27c53d7a0b0..30de054e411 100644
--- a/gcc/fixinc/server.h
+++ b/gcc/fixinc/server.h
@@ -65,11 +65,10 @@ typedef struct
FILE *pf_write; /* parent write fp */
} t_pf_pair;
-char *run_shell PARAMS (( const char *pzCmd));
-pid_t proc2_fopen PARAMS (( t_pf_pair * p_pair, tCC ** pp_args));
-pid_t proc2_open PARAMS (( t_fd_pair * p_pair, tCC ** pp_args));
-int chain_open PARAMS (( int in_fd, tCC ** pp_args,
- pid_t * p_child));
-void close_server PARAMS (( void ));
+char* run_shell( const char* pzCmd );
+pid_t proc2_fopen( t_pf_pair* p_pair, tCC** pp_args );
+pid_t proc2_open( t_fd_pair* p_pair, tCC** pp_args );
+int chain_open( int in_fd, tCC** pp_args, pid_t* p_child );
+void close_server( void );
#endif /* ! GCC_SERVER_H */
diff --git a/gcc/fixinc/tests/base/math.h b/gcc/fixinc/tests/base/math.h
index cff0a5920d5..51fe6b57952 100644
--- a/gcc/fixinc/tests/base/math.h
+++ b/gcc/fixinc/tests/base/math.h
@@ -25,6 +25,7 @@ struct exception;
#else
#endif
+
/* This is a comment
and it ends here. */
#endif /* BROKEN_CABS_CHECK */
diff --git a/gcc/fixinc/tests/base/pthread.h b/gcc/fixinc/tests/base/pthread.h
index ec7ff351f45..95ad2d56c67 100644
--- a/gcc/fixinc/tests/base/pthread.h
+++ b/gcc/fixinc/tests/base/pthread.h
@@ -15,6 +15,13 @@
#endif /* AIX_PTHREAD_CHECK */
+#if defined( ALPHA_PTHREAD_CHECK )
+# if defined (_PTHREAD_ENV_DECC) || defined (_PTHREAD_ENV_EPCC) || defined (__PRAGMA_EXTERN_PREFIX)
+# define _PTHREAD_USE_PTDNAM_
+# endif
+#endif /* ALPHA_PTHREAD_CHECK */
+
+
#if defined( PTHREAD_PAGE_SIZE_CHECK )
extern int __page_size;
#endif /* PTHREAD_PAGE_SIZE_CHECK */
diff --git a/gcc/fixinc/tests/base/regexp.h b/gcc/fixinc/tests/base/regexp.h
new file mode 100644
index 00000000000..35ec0494274
--- /dev/null
+++ b/gcc/fixinc/tests/base/regexp.h
@@ -0,0 +1,18 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/regexp.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( SVR4_UNDECLARED_GETRNGE_CHECK )
+static int size;
+static int getrnge ();
+/* stuff which calls getrnge() */
+static getrnge()
+{}
+#endif /* SVR4_UNDECLARED_GETRNGE_CHECK */
diff --git a/gcc/fixinc/tests/base/string.h b/gcc/fixinc/tests/base/string.h
index f32c240ae34..d70f9e08a3a 100644
--- a/gcc/fixinc/tests/base/string.h
+++ b/gcc/fixinc/tests/base/string.h
@@ -8,6 +8,6 @@
original, manufacturer supplied header file. */
#ifndef _STRING_INCLUDED
-#define _STRING_INCLUDED
-#include <strings.h>
-#endif /* _STRING_INCLUDED */
+ #define _STRING_INCLUDED
+ #include <strings.h>
+#endif /* _STRING_INCLUDED */ \ No newline at end of file
diff --git a/gcc/fixinc/tests/base/sys/regset.h b/gcc/fixinc/tests/base/sys/regset.h
index adc31add5dd..6723427e89c 100644
--- a/gcc/fixinc/tests/base/sys/regset.h
+++ b/gcc/fixinc/tests/base/sys/regset.h
@@ -11,7 +11,7 @@
#if defined( SCO_REGSET_CHECK )
union u_fps {
- struct rsfpstate
+ struct rsfpstate
{
int whatever;
}
diff --git a/gcc/fixinc/tests/base/sys/signal.h b/gcc/fixinc/tests/base/sys/signal.h
index 9e4fdb85605..7a9ecb113cd 100644
--- a/gcc/fixinc/tests/base/sys/signal.h
+++ b/gcc/fixinc/tests/base/sys/signal.h
@@ -21,3 +21,10 @@ void (*signal(...))(...);
void (*signal())();
#endif
#endif /* SUN_SIGNAL_CHECK */
+
+
+#if defined( SVR4_SIGHANDLER_TYPE_CHECK )
+#define SIG_DFL (void (*)(int))0
+#define SIG_IGN (void (*)(int))0
+
+#endif /* SVR4_SIGHANDLER_TYPE_CHECK */
diff --git a/gcc/flags.h b/gcc/flags.h
index de7cc816bfb..823aaefb32d 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -55,7 +55,7 @@ extern enum debug_info_level debug_info_level;
/* Nonzero means use GNU-only extensions in the generated symbolic
debugging information. */
-extern int use_gnu_debug_info_extensions;
+extern bool use_gnu_debug_info_extensions;
/* Nonzero means emit debugging information only for symbols which are used. */
extern int flag_debug_only_used_symbols;
@@ -363,6 +363,11 @@ extern int flag_finite_math_only;
extern int flag_trapping_math;
+/* Nonzero means disable transformations that assume default floating
+ point rounding behavior. */
+
+extern int flag_rounding_math;
+
/* 0 means straightforward implementation of complex divide acceptable.
1 means wide ranges of inputs must work for complex divide.
2 means C99-like requirements for complex divide (not yet implemented). */
@@ -716,6 +721,6 @@ extern const char *flag_random_seed;
/* Like HONOR_NANS, but true if given mode supports sign-dependent rounding,
and the rounding mode is important. */
#define HONOR_SIGN_DEPENDENT_ROUNDING(MODE) \
- (MODE_HAS_SIGN_DEPENDENT_ROUNDING (MODE) && !flag_unsafe_math_optimizations)
+ (MODE_HAS_SIGN_DEPENDENT_ROUNDING (MODE) && flag_rounding_math)
#endif /* ! GCC_FLAGS_H */
diff --git a/gcc/flow.c b/gcc/flow.c
index 4fab7b357df..66c04eecfa6 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1082,7 +1082,7 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
/* Create a worklist. Allocate an extra slot for ENTRY_BLOCK, and one
because the `head == tail' style test for an empty queue doesn't
work with a full queue. */
- queue = (basic_block *) xmalloc ((n_basic_blocks + 2) * sizeof (*queue));
+ queue = xmalloc ((n_basic_blocks + 2) * sizeof (*queue));
qtail = queue;
qhead = qend = queue + n_basic_blocks + 2;
@@ -1850,7 +1850,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
pbi->flags = flags;
if (flags & (PROP_LOG_LINKS | PROP_AUTOINC))
- pbi->reg_next_use = (rtx *) xcalloc (max_reg_num (), sizeof (rtx));
+ pbi->reg_next_use = xcalloc (max_reg_num (), sizeof (rtx));
else
pbi->reg_next_use = NULL;
@@ -1932,7 +1932,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
struct reg_cond_life_info *rcli;
rtx cond;
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
cond = cond_false;
@@ -1974,13 +1974,6 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
rtx mem = SET_DEST (set);
rtx canon_mem = canon_rtx (mem);
- /* This optimization is performed by faking a store to the
- memory at the end of the block. This doesn't work for
- unchanging memories because multiple stores to unchanging
- memory is illegal and alias analysis doesn't consider it. */
- if (RTX_UNCHANGING_P (canon_mem))
- continue;
-
if (XEXP (canon_mem, 0) == frame_pointer_rtx
|| (GET_CODE (XEXP (canon_mem, 0)) == PLUS
&& XEXP (XEXP (canon_mem, 0), 0) == frame_pointer_rtx
@@ -2152,7 +2145,7 @@ insn_dead_p (struct propagate_block_info *pbi, rtx x, int call_ok,
rtx_equal_p does not check the alias set or flags, we also
must have the potential for them to conflict (anti_dependence). */
for (temp = pbi->mem_set_list; temp != 0; temp = XEXP (temp, 1))
- if (anti_dependence (r, XEXP (temp, 0)))
+ if (unchanging_anti_dependence (r, XEXP (temp, 0)))
{
rtx mem = XEXP (temp, 0);
@@ -2867,7 +2860,7 @@ mark_regno_cond_dead (struct propagate_block_info *pbi, int regno, rtx cond)
/* The register was unconditionally live previously.
Record the current condition as the condition under
which it is dead. */
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
rcli->condition = cond;
rcli->stores = cond;
rcli->orig_condition = const0_rtx;
@@ -3644,7 +3637,7 @@ mark_used_reg (struct propagate_block_info *pbi, rtx reg,
{
/* The register was not previously live at all. Record
the condition under which it is still dead. */
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
rcli->condition = not_reg_cond (cond);
rcli->stores = const0_rtx;
rcli->orig_condition = const0_rtx;
@@ -3730,7 +3723,7 @@ mark_used_regs (struct propagate_block_info *pbi, rtx x, rtx cond, rtx insn)
while (temp)
{
next = XEXP (temp, 1);
- if (anti_dependence (XEXP (temp, 0), x))
+ if (unchanging_anti_dependence (XEXP (temp, 0), x))
{
/* Splice temp out of the list. */
if (prev)
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e268055cb8e..24f6b02ec70 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -56,6 +56,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "hashtab.h"
#include "langhooks.h"
+#include "md5.h"
static void encode (HOST_WIDE_INT *, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
static void decode (HOST_WIDE_INT *, unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
@@ -107,6 +108,7 @@ static bool fold_real_zero_addition_p (tree, tree, int);
static tree fold_mathfn_compare (enum built_in_function, enum tree_code,
tree, tree, tree);
static tree fold_inf_compare (enum tree_code, tree, tree, tree);
+static bool tree_swap_operands_p (tree, tree);
/* The following constants represent a bit based encoding of GCC's
comparison operators. This encoding simplifies transformations
@@ -159,7 +161,8 @@ encode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
The integer is stored into *LOW and *HI as two `HOST_WIDE_INT' pieces. */
static void
-decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low, HOST_WIDE_INT *hi)
+decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low,
+ HOST_WIDE_INT *hi)
{
*low = words[0] + words[1] * BASE;
*hi = words[2] + words[3] * BASE;
@@ -192,7 +195,8 @@ force_fit_type (tree t, int overflow)
low = TREE_INT_CST_LOW (t);
high = TREE_INT_CST_HIGH (t);
- if (POINTER_TYPE_P (TREE_TYPE (t)))
+ if (POINTER_TYPE_P (TREE_TYPE (t))
+ || TREE_CODE (TREE_TYPE (t)) == OFFSET_TYPE)
prec = POINTER_SIZE;
else
prec = TYPE_PRECISION (TREE_TYPE (t));
@@ -252,8 +256,9 @@ force_fit_type (tree t, int overflow)
The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */
int
-add_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, unsigned HOST_WIDE_INT l2,
- HOST_WIDE_INT h2, unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
+add_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+ unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2,
+ unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
{
unsigned HOST_WIDE_INT l;
HOST_WIDE_INT h;
@@ -272,8 +277,8 @@ add_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, unsigned HOST_WIDE_INT
The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */
int
-neg_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, unsigned HOST_WIDE_INT *lv,
- HOST_WIDE_INT *hv)
+neg_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+ unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
{
if (l1 == 0)
{
@@ -296,8 +301,9 @@ neg_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, unsigned HOST_WIDE_INT
The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. */
int
-mul_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, unsigned HOST_WIDE_INT l2,
- HOST_WIDE_INT h2, unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
+mul_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+ unsigned HOST_WIDE_INT l2, HOST_WIDE_INT h2,
+ unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
{
HOST_WIDE_INT arg1[4];
HOST_WIDE_INT arg2[4];
@@ -310,7 +316,7 @@ mul_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, unsigned HOST_WIDE_INT
encode (arg1, l1, h1);
encode (arg2, l2, h2);
- memset ((char *) prod, 0, sizeof prod);
+ memset (prod, 0, sizeof prod);
for (i = 0; i < 4; i++)
{
@@ -353,9 +359,9 @@ mul_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, unsigned HOST_WIDE_INT
Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */
void
-lshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, HOST_WIDE_INT count,
- unsigned int prec, unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
- int arith)
+lshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+ HOST_WIDE_INT count, unsigned int prec,
+ unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, int arith)
{
unsigned HOST_WIDE_INT signmask;
@@ -417,8 +423,9 @@ lshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, HOST_WIDE_INT count,
Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */
void
-rshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, HOST_WIDE_INT count,
- unsigned int prec, unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
+rshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+ HOST_WIDE_INT count, unsigned int prec,
+ unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv,
int arith)
{
unsigned HOST_WIDE_INT signmask;
@@ -479,8 +486,9 @@ rshift_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, HOST_WIDE_INT count,
Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */
void
-lrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, HOST_WIDE_INT count,
- unsigned int prec, unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
+lrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+ HOST_WIDE_INT count, unsigned int prec,
+ unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
{
unsigned HOST_WIDE_INT s1l, s2l;
HOST_WIDE_INT s1h, s2h;
@@ -500,8 +508,9 @@ lrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, HOST_WIDE_INT count
Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */
void
-rrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, HOST_WIDE_INT count,
- unsigned int prec, unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
+rrotate_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
+ HOST_WIDE_INT count, unsigned int prec,
+ unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv)
{
unsigned HOST_WIDE_INT s1l, s2l;
HOST_WIDE_INT s1h, s2h;
@@ -530,7 +539,8 @@ div_and_round_double (enum tree_code code, int uns,
unsigned HOST_WIDE_INT lnum_orig, /* num == numerator == dividend */
HOST_WIDE_INT hnum_orig,
unsigned HOST_WIDE_INT lden_orig, /* den == denominator == divisor */
- HOST_WIDE_INT hden_orig, unsigned HOST_WIDE_INT *lquo,
+ HOST_WIDE_INT hden_orig,
+ unsigned HOST_WIDE_INT *lquo,
HOST_WIDE_INT *hquo, unsigned HOST_WIDE_INT *lrem,
HOST_WIDE_INT *hrem)
{
@@ -549,7 +559,7 @@ div_and_round_double (enum tree_code code, int uns,
if (hden == 0 && lden == 0)
overflow = 1, lden = 1;
- /* calculate quotient sign and convert operands to unsigned. */
+ /* Calculate quotient sign and convert operands to unsigned. */
if (!uns)
{
if (hnum < 0)
@@ -584,10 +594,10 @@ div_and_round_double (enum tree_code code, int uns,
goto finish_up;
}
- memset ((char *) quo, 0, sizeof quo);
+ memset (quo, 0, sizeof quo);
- memset ((char *) num, 0, sizeof num); /* to zero 9th element */
- memset ((char *) den, 0, sizeof den);
+ memset (num, 0, sizeof num); /* to zero 9th element */
+ memset (den, 0, sizeof den);
encode (num, lnum, hnum);
encode (den, lden, hden);
@@ -705,7 +715,7 @@ div_and_round_double (enum tree_code code, int uns,
decode (quo, lquo, hquo);
finish_up:
- /* if result is negative, make it so. */
+ /* If result is negative, make it so. */
if (quo_neg)
neg_double (*lquo, *hquo, lquo, hquo);
@@ -832,9 +842,24 @@ negate_expr_p (tree t)
case REAL_CST:
case NEGATE_EXPR:
- case MINUS_EXPR:
return true;
+ case MINUS_EXPR:
+ /* We can't turn -(A-B) into B-A when we honor signed zeros. */
+ return ! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations;
+
+ case MULT_EXPR:
+ if (TREE_UNSIGNED (TREE_TYPE (t)))
+ break;
+
+ /* Fall through. */
+
+ case RDIV_EXPR:
+ if (! HONOR_SIGN_DEPENDENT_ROUNDING (TYPE_MODE (TREE_TYPE (t))))
+ return negate_expr_p (TREE_OPERAND (t, 1))
+ || negate_expr_p (TREE_OPERAND (t, 0));
+ break;
+
default:
break;
}
@@ -859,13 +884,19 @@ negate_expr (tree t)
switch (TREE_CODE (t))
{
case INTEGER_CST:
- case REAL_CST:
if (! TREE_UNSIGNED (type)
&& 0 != (tem = fold (build1 (NEGATE_EXPR, type, t)))
&& ! TREE_OVERFLOW (tem))
return tem;
break;
+ case REAL_CST:
+ tem = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (t)));
+ /* Two's complement FP formats, such as c4x, may overflow. */
+ if (! TREE_OVERFLOW (tem))
+ return convert (type, tem);
+ break;
+
case NEGATE_EXPR:
return convert (type, TREE_OPERAND (t, 0));
@@ -878,6 +909,30 @@ negate_expr (tree t)
TREE_OPERAND (t, 0))));
break;
+ case MULT_EXPR:
+ if (TREE_UNSIGNED (TREE_TYPE (t)))
+ break;
+
+ /* Fall through. */
+
+ case RDIV_EXPR:
+ if (! HONOR_SIGN_DEPENDENT_ROUNDING (TYPE_MODE (TREE_TYPE (t))))
+ {
+ tem = TREE_OPERAND (t, 1);
+ if (negate_expr_p (tem))
+ return convert (type,
+ fold (build (TREE_CODE (t), TREE_TYPE (t),
+ TREE_OPERAND (t, 0),
+ negate_expr (tem))));
+ tem = TREE_OPERAND (t, 0);
+ if (negate_expr_p (tem))
+ return convert (type,
+ fold (build (TREE_CODE (t), TREE_TYPE (t),
+ negate_expr (tem),
+ TREE_OPERAND (t, 1))));
+ }
+ break;
+
default:
break;
}
@@ -906,7 +961,8 @@ negate_expr (tree t)
same type as IN, but they will have the same signedness and mode. */
static tree
-split_tree (tree in, enum tree_code code, tree *conp, tree *litp, tree *minus_litp, int negate_p)
+split_tree (tree in, enum tree_code code, tree *conp, tree *litp,
+ tree *minus_litp, int negate_p)
{
tree var = 0;
@@ -1053,10 +1109,6 @@ int_const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
low = int1l & int2l, hi = int1h & int2h;
break;
- case BIT_ANDTC_EXPR:
- low = int1l & ~int2l, hi = int1h & ~int2h;
- break;
-
case RSHIFT_EXPR:
int2l = -int2l;
case LSHIFT_EXPR:
@@ -1220,14 +1272,31 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
if (TREE_CODE (arg1) == REAL_CST)
{
+ enum machine_mode mode;
REAL_VALUE_TYPE d1;
REAL_VALUE_TYPE d2;
REAL_VALUE_TYPE value;
- tree t;
+ tree t, type;
d1 = TREE_REAL_CST (arg1);
d2 = TREE_REAL_CST (arg2);
+ type = TREE_TYPE (arg1);
+ mode = TYPE_MODE (type);
+
+ /* Don't perform operation if we honor signaling NaNs and
+ either operand is a NaN. */
+ if (HONOR_SNANS (mode)
+ && (REAL_VALUE_ISNAN (d1) || REAL_VALUE_ISNAN (d2)))
+ return NULL_TREE;
+
+ /* Don't perform operation if it would raise a division
+ by zero exception. */
+ if (code == RDIV_EXPR
+ && REAL_VALUES_EQUAL (d2, dconst0)
+ && (flag_trapping_math || ! MODE_HAS_INFINITIES (mode)))
+ return NULL_TREE;
+
/* If either operand is a NaN, just return it. Otherwise, set up
for floating-point trap; we return an overflow. */
if (REAL_VALUE_ISNAN (d1))
@@ -1237,9 +1306,7 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
REAL_ARITHMETIC (value, code, d1, d2);
- t = build_real (TREE_TYPE (arg1),
- real_value_truncate (TYPE_MODE (TREE_TYPE (arg1)),
- value));
+ t = build_real (type, real_value_truncate (mode, value));
TREE_OVERFLOW (t)
= (force_fit_type (t, 0)
@@ -1756,17 +1823,33 @@ truth_value_p (enum tree_code code)
|| code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
}
-/* Return nonzero if two operands are necessarily equal.
+/* Return nonzero if two operands (typically of the same tree node)
+ are necessarily equal. If either argument has side-effects this
+ function returns zero.
+
If ONLY_CONST is nonzero, only return nonzero for constants.
This function tests whether the operands are indistinguishable;
it does not test whether they are equal using C's == operation.
The distinction is important for IEEE floating point, because
(1) -0.0 and 0.0 are distinguishable, but -0.0==0.0, and
- (2) two NaNs may be indistinguishable, but NaN!=NaN. */
+ (2) two NaNs may be indistinguishable, but NaN!=NaN.
+
+ If ONLY_CONST is zero, a VAR_DECL is considered equal to itself
+ even though it may hold multiple values during a function.
+ This is because a GCC tree node guarantees that nothing else is
+ executed between the evaluation of its "operands" (which may often
+ be evaluated in arbitrary order). Hence if the operands themselves
+ don't side-effect, the VAR_DECLs, PARM_DECLs etc... must hold the
+ same value in each operand/subexpression. Hence a zero value for
+ ONLY_CONST assumes isochronic (or instantaneous) tree equivalence.
+ If comparing arbitrary expression trees, such as from different
+ statements, ONLY_CONST must usually be nonzero. */
int
operand_equal_p (tree arg0, tree arg1, int only_const)
{
+ tree fndecl;
+
/* If both types don't have the same signedness, then we can't consider
them equal. We must check this before the STRIP_NOPS calls
because they may change the signedness of the arguments. */
@@ -1937,13 +2020,9 @@ operand_equal_p (tree arg0, tree arg1, int only_const)
return 0;
/* Only consider const functions equivalent. */
- if (TREE_CODE (TREE_OPERAND (arg0, 0)) == ADDR_EXPR)
- {
- tree fndecl = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
- if (! (flags_from_decl_or_type (fndecl) & ECF_CONST))
- return 0;
- }
- else
+ fndecl = get_callee_fndecl (arg0);
+ if (fndecl == NULL_TREE
+ || ! (flags_from_decl_or_type (fndecl) & ECF_CONST))
return 0;
/* Now see if all the arguments are the same. operand_equal_p
@@ -2186,7 +2265,7 @@ eval_subst (tree arg, tree old0, tree new0, tree old1, tree new1)
default:
break;
}
- /* fall through - ??? */
+ /* Fall through - ??? */
case '<':
{
@@ -2416,7 +2495,8 @@ distribute_bit_expr (enum tree_code code, tree type, tree arg0, tree arg1)
starting at BITPOS. The field is unsigned if UNSIGNEDP is nonzero. */
static tree
-make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos, int unsignedp)
+make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos,
+ int unsignedp)
{
tree result = build (BIT_FIELD_REF, type, inner,
size_int (bitsize), bitsize_int (bitpos));
@@ -2447,7 +2527,8 @@ make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos, int unsigned
tree. Otherwise we return zero. */
static tree
-optimize_bit_field_compare (enum tree_code code, tree compare_type, tree lhs, tree rhs)
+optimize_bit_field_compare (enum tree_code code, tree compare_type,
+ tree lhs, tree rhs)
{
HOST_WIDE_INT lbitpos, lbitsize, rbitpos, rbitsize, nbitpos, nbitsize;
tree type = TREE_TYPE (lhs);
@@ -2621,8 +2702,9 @@ optimize_bit_field_compare (enum tree_code code, tree compare_type, tree lhs, tr
do anything with. */
static tree
-decode_field_reference (tree exp, HOST_WIDE_INT *pbitsize, HOST_WIDE_INT *pbitpos,
- enum machine_mode *pmode, int *punsignedp, int *pvolatilep,
+decode_field_reference (tree exp, HOST_WIDE_INT *pbitsize,
+ HOST_WIDE_INT *pbitpos, enum machine_mode *pmode,
+ int *punsignedp, int *pvolatilep,
tree *pmask, tree *pand_mask)
{
tree outer_type = 0;
@@ -2719,8 +2801,8 @@ all_ones_mask_p (tree mask, int size)
static tree
sign_bit_p (tree exp, tree val)
{
- unsigned HOST_WIDE_INT lo;
- HOST_WIDE_INT hi;
+ unsigned HOST_WIDE_INT mask_lo, lo;
+ HOST_WIDE_INT mask_hi, hi;
int width;
tree t;
@@ -2739,14 +2821,25 @@ sign_bit_p (tree exp, tree val)
{
hi = (unsigned HOST_WIDE_INT) 1 << (width - HOST_BITS_PER_WIDE_INT - 1);
lo = 0;
+
+ mask_hi = ((unsigned HOST_WIDE_INT) -1
+ >> (2 * HOST_BITS_PER_WIDE_INT - width));
+ mask_lo = -1;
}
else
{
hi = 0;
lo = (unsigned HOST_WIDE_INT) 1 << (width - 1);
+
+ mask_hi = 0;
+ mask_lo = ((unsigned HOST_WIDE_INT) -1
+ >> (HOST_BITS_PER_WIDE_INT - width));
}
- if (TREE_INT_CST_HIGH (val) == hi && TREE_INT_CST_LOW (val) == lo)
+ /* We mask off those bits beyond TREE_TYPE (exp) so that we can
+ treat VAL as if it were unsigned. */
+ if ((TREE_INT_CST_HIGH (val) & mask_hi) == hi
+ && (TREE_INT_CST_LOW (val) & mask_lo) == lo)
return exp;
/* Handle extension from a narrower type. */
@@ -2821,8 +2914,8 @@ simple_operand_p (tree exp)
type if both are specified. */
static tree
-range_binop (enum tree_code code, tree type, tree arg0, int upper0_p, tree arg1,
- int upper1_p)
+range_binop (enum tree_code code, tree type, tree arg0, int upper0_p,
+ tree arg1, int upper1_p)
{
tree tem;
int result;
@@ -3228,8 +3321,8 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high)
can, 0 if we can't. Set the output range into the specified parameters. */
static int
-merge_ranges (int *pin_p, tree *plow, tree *phigh, int in0_p, tree low0, tree high0,
- int in1_p, tree low1, tree high1)
+merge_ranges (int *pin_p, tree *plow, tree *phigh, int in0_p, tree low0,
+ tree high0, int in1_p, tree low1, tree high1)
{
int no_overlap;
int subset;
@@ -4397,7 +4490,8 @@ count_cond (tree expr, int lim)
original expression. */
static tree
-fold_binary_op_with_conditional_arg (enum tree_code code, tree type, tree cond, tree arg, int cond_first_p)
+fold_binary_op_with_conditional_arg (enum tree_code code, tree type,
+ tree cond, tree arg, int cond_first_p)
{
tree test, true_value, false_value;
tree lhs = NULL_TREE;
@@ -4575,7 +4669,8 @@ fold_real_zero_addition_p (tree type, tree addend, int negate)
can be made, and NULL_TREE otherwise. */
static tree
-fold_mathfn_compare (enum built_in_function fcode, enum tree_code code, tree type, tree arg0, tree arg1)
+fold_mathfn_compare (enum built_in_function fcode, enum tree_code code,
+ tree type, tree arg0, tree arg1)
{
REAL_VALUE_TYPE c;
@@ -4827,6 +4922,10 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
convert (stype, arg00),
convert (stype, integer_zero_node)));
}
+
+ /* At this point, we know that arg0 is not testing the sign bit. */
+ if (TYPE_PRECISION (type) - 1 == bitnum)
+ abort ();
/* Otherwise we have (A & C) != 0 where C is a single bit,
convert that into ((A >> C2) & 1). Where C2 = log2(C).
@@ -4848,13 +4947,11 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
/* If we are going to be able to omit the AND below, we must do our
operations as unsigned. If we must use the AND, we have a choice.
Normally unsigned is faster, but for some machines signed is. */
- ops_unsigned = (bitnum == TYPE_PRECISION (type) - 1 ? 1
#ifdef LOAD_EXTEND_OP
- : (LOAD_EXTEND_OP (operand_mode) == SIGN_EXTEND ? 0 : 1)
+ ops_unsigned = (LOAD_EXTEND_OP (operand_mode) == SIGN_EXTEND ? 0 : 1);
#else
- : 1
+ ops_unsigned = 1;
#endif
- );
signed_type = (*lang_hooks.types.type_for_mode) (operand_mode, 0);
unsigned_type = (*lang_hooks.types.type_for_mode) (operand_mode, 1);
@@ -4868,9 +4965,8 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
inner, integer_one_node);
/* Put the AND last so it can combine with more things. */
- if (bitnum != TYPE_PRECISION (type) - 1)
- inner = build (BIT_AND_EXPR, ops_unsigned ? unsigned_type : signed_type,
- inner, integer_one_node);
+ inner = build (BIT_AND_EXPR, ops_unsigned ? unsigned_type : signed_type,
+ inner, integer_one_node);
/* Make sure to return the proper type. */
if (TREE_TYPE (inner) != result_type)
@@ -4880,7 +4976,50 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
}
return NULL_TREE;
}
-
+
+/* Test whether it is preferable two swap two operands, ARG0 and
+ ARG1, for example because ARG0 is an integer constant and ARG1
+ isn't. */
+
+static bool
+tree_swap_operands_p (tree arg0, tree arg1)
+{
+ STRIP_SIGN_NOPS (arg0);
+ STRIP_SIGN_NOPS (arg1);
+
+ if (TREE_CODE (arg1) == INTEGER_CST)
+ return 0;
+ if (TREE_CODE (arg0) == INTEGER_CST)
+ return 1;
+
+ if (TREE_CODE (arg1) == REAL_CST)
+ return 0;
+ if (TREE_CODE (arg0) == REAL_CST)
+ return 1;
+
+ if (TREE_CODE (arg1) == COMPLEX_CST)
+ return 0;
+ if (TREE_CODE (arg0) == COMPLEX_CST)
+ return 1;
+
+ if (TREE_CONSTANT (arg1))
+ return 0;
+ if (TREE_CONSTANT (arg0))
+ return 1;
+
+ if (DECL_P (arg1))
+ return 0;
+ if (DECL_P (arg0))
+ return 1;
+
+ if (TREE_CODE (arg1) == SAVE_EXPR)
+ return 0;
+ if (TREE_CODE (arg0) == SAVE_EXPR)
+ return 1;
+
+ return 0;
+}
+
/* Perform constant folding and related simplification of EXPR.
The related simplifications include x*1 => x, x*0 => 0, etc.,
and application of the associative law.
@@ -4889,10 +5028,15 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
We cannot simplify through a CONVERT_EXPR, FIX_EXPR or FLOAT_EXPR,
but we can constant-fold them if they have constant operands. */
+#ifdef ENABLE_FOLD_CHECKING
+# define fold(x) fold_1 (x)
+static tree fold_1 (tree);
+static
+#endif
tree
fold (tree expr)
{
- tree t = expr;
+ tree t = expr, orig_t;
tree t1 = NULL_TREE;
tree tem;
tree type = TREE_TYPE (expr);
@@ -4916,6 +5060,7 @@ fold (tree expr)
#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)
{
@@ -4934,14 +5079,13 @@ fold (tree expr)
subop = arg0;
if (subop != 0 && TREE_CODE (subop) != INTEGER_CST
- && TREE_CODE (subop) != REAL_CST
- )
+ && TREE_CODE (subop) != REAL_CST)
/* Note that TREE_CONSTANT isn't enough:
static var addresses are constant but we can't
do arithmetic on them. */
wins = 0;
}
- else if (IS_EXPR_CODE_CLASS (kind) || kind == 'r')
+ else if (IS_EXPR_CODE_CLASS (kind))
{
int len = first_rtl_op (code);
int i;
@@ -4987,13 +5131,8 @@ fold (tree expr)
if ((code == PLUS_EXPR || code == MULT_EXPR || code == MIN_EXPR
|| code == MAX_EXPR || code == BIT_IOR_EXPR || code == BIT_XOR_EXPR
|| code == BIT_AND_EXPR)
- && (TREE_CODE (arg0) == INTEGER_CST || TREE_CODE (arg0) == REAL_CST))
- {
- tem = arg0; arg0 = arg1; arg1 = tem;
-
- tem = TREE_OPERAND (t, 0); TREE_OPERAND (t, 0) = TREE_OPERAND (t, 1);
- TREE_OPERAND (t, 1) = tem;
- }
+ && tree_swap_operands_p (arg0, arg1))
+ return fold (build (code, type, arg1, arg0));
/* Now WINS is set as described above,
ARG0 is the first operand of EXPR,
@@ -5241,6 +5380,8 @@ fold (tree expr)
/* Don't leave an assignment inside a conversion
unless assigning a bitfield. */
tree prev = TREE_OPERAND (t, 0);
+ if (t == orig_t)
+ t = copy_node (t);
TREE_OPERAND (t, 0) = TREE_OPERAND (prev, 1);
/* First do the assignment, then return converted constant. */
t = build (COMPOUND_EXPR, TREE_TYPE (t), prev, fold (t));
@@ -5293,7 +5434,12 @@ fold (tree expr)
if (!wins)
{
- TREE_CONSTANT (t) = TREE_CONSTANT (arg0);
+ if (TREE_CONSTANT (t) != TREE_CONSTANT (arg0))
+ {
+ if (t == orig_t)
+ t = copy_node (t);
+ TREE_CONSTANT (t) = TREE_CONSTANT (arg0);
+ }
return t;
}
return fold_convert (t, arg0);
@@ -5315,7 +5461,12 @@ fold (tree expr)
return t;
case RANGE_EXPR:
- TREE_CONSTANT (t) = wins;
+ if (TREE_CONSTANT (t) != wins)
+ {
+ if (t == orig_t)
+ t = copy_node (t);
+ TREE_CONSTANT (t) = wins;
+ }
return t;
case NEGATE_EXPR:
@@ -5373,7 +5524,7 @@ fold (tree expr)
{
tree fndecl, arg, arglist;
- fndecl = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
+ fndecl = get_callee_fndecl (arg0);
arg = TREE_VALUE (TREE_OPERAND (arg0, 1));
arg = fold (build1 (NEGATE_EXPR, type, arg));
arglist = build_tree_list (NULL_TREE, arg);
@@ -5596,14 +5747,73 @@ fold (tree expr)
same));
}
}
+ else
+ {
+ /* See if ARG1 is zero and X + ARG1 reduces to X. */
+ if (fold_real_zero_addition_p (TREE_TYPE (arg0), arg1, 0))
+ return non_lvalue (convert (type, arg0));
- /* See if ARG1 is zero and X + ARG1 reduces to X. */
- else if (fold_real_zero_addition_p (TREE_TYPE (arg0), arg1, 0))
- return non_lvalue (convert (type, arg0));
+ /* Likewise if the operands are reversed. */
+ if (fold_real_zero_addition_p (TREE_TYPE (arg1), arg0, 0))
+ return non_lvalue (convert (type, arg1));
- /* Likewise if the operands are reversed. */
- else if (fold_real_zero_addition_p (TREE_TYPE (arg1), arg0, 0))
- return non_lvalue (convert (type, arg1));
+ /* Convert x+x into x*2.0. */
+ if (operand_equal_p (arg0, arg1, 0)
+ && SCALAR_FLOAT_TYPE_P (type))
+ return fold (build (MULT_EXPR, type, arg0,
+ build_real (type, dconst2)));
+
+ /* Convert x*c+x into x*(c+1). */
+ if (flag_unsafe_math_optimizations
+ && TREE_CODE (arg0) == MULT_EXPR
+ && TREE_CODE (TREE_OPERAND (arg0, 1)) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (TREE_OPERAND (arg0, 1))
+ && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0))
+ {
+ REAL_VALUE_TYPE c;
+
+ c = TREE_REAL_CST (TREE_OPERAND (arg0, 1));
+ real_arithmetic (&c, PLUS_EXPR, &c, &dconst1);
+ return fold (build (MULT_EXPR, type, arg1,
+ build_real (type, c)));
+ }
+
+ /* Convert x+x*c into x*(c+1). */
+ if (flag_unsafe_math_optimizations
+ && TREE_CODE (arg1) == MULT_EXPR
+ && TREE_CODE (TREE_OPERAND (arg1, 1)) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (TREE_OPERAND (arg1, 1))
+ && operand_equal_p (TREE_OPERAND (arg1, 0), arg0, 0))
+ {
+ REAL_VALUE_TYPE c;
+
+ c = TREE_REAL_CST (TREE_OPERAND (arg1, 1));
+ real_arithmetic (&c, PLUS_EXPR, &c, &dconst1);
+ return fold (build (MULT_EXPR, type, arg0,
+ build_real (type, c)));
+ }
+
+ /* Convert x*c1+x*c2 into x*(c1+c2). */
+ if (flag_unsafe_math_optimizations
+ && TREE_CODE (arg0) == MULT_EXPR
+ && TREE_CODE (arg1) == MULT_EXPR
+ && TREE_CODE (TREE_OPERAND (arg0, 1)) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (TREE_OPERAND (arg0, 1))
+ && TREE_CODE (TREE_OPERAND (arg1, 1)) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (TREE_OPERAND (arg1, 1))
+ && operand_equal_p (TREE_OPERAND (arg0, 0),
+ TREE_OPERAND (arg1, 0), 0))
+ {
+ REAL_VALUE_TYPE c1, c2;
+
+ c1 = TREE_REAL_CST (TREE_OPERAND (arg0, 1));
+ c2 = TREE_REAL_CST (TREE_OPERAND (arg1, 1));
+ real_arithmetic (&c1, PLUS_EXPR, &c1, &c2);
+ return fold (build (MULT_EXPR, type,
+ TREE_OPERAND (arg0, 0),
+ build_real (type, c1)));
+ }
+ }
bit_rotate:
/* (A << C1) + (A >> C2) if A is unsigned and C1+C2 is the size of A
@@ -5679,13 +5889,11 @@ fold (tree expr)
associate:
/* In most languages, can't associate operations on floats through
parentheses. Rather than remember where the parentheses were, we
- don't associate floats at all. It shouldn't matter much. However,
- associating multiplications is only very slightly inaccurate, so do
- that if -funsafe-math-optimizations is specified. */
+ don't associate floats at all, unless the user has specified
+ -funsafe-math-optimizations. */
if (! wins
- && (! FLOAT_TYPE_P (type)
- || (flag_unsafe_math_optimizations && code == MULT_EXPR)))
+ && (! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations))
{
tree var0, con0, lit0, minus_lit0;
tree var1, con1, lit1, minus_lit1;
@@ -5722,7 +5930,9 @@ fold (tree expr)
example: ((X*2 + 4) - 8U)/2. */
if (minus_lit0 && lit0)
{
- if (tree_int_cst_lt (lit0, minus_lit0))
+ if (TREE_CODE (lit0) == INTEGER_CST
+ && TREE_CODE (minus_lit0) == INTEGER_CST
+ && tree_int_cst_lt (lit0, minus_lit0))
{
minus_lit0 = associate_trees (minus_lit0, lit0,
MINUS_EXPR, type);
@@ -5843,8 +6053,13 @@ fold (tree expr)
case MULT_EXPR:
/* (-A) * (-B) -> A * B */
- if (TREE_CODE (arg0) == NEGATE_EXPR && TREE_CODE (arg1) == NEGATE_EXPR)
- return fold (build (MULT_EXPR, type, TREE_OPERAND (arg0, 0),
+ if (TREE_CODE (arg0) == NEGATE_EXPR && negate_expr_p (arg1))
+ return fold (build (MULT_EXPR, type,
+ TREE_OPERAND (arg0, 0),
+ negate_expr (arg1)));
+ if (TREE_CODE (arg1) == NEGATE_EXPR && negate_expr_p (arg0))
+ return fold (build (MULT_EXPR, type,
+ negate_expr (arg0),
TREE_OPERAND (arg1, 0)));
if (! FLOAT_TYPE_P (type))
@@ -5891,13 +6106,17 @@ fold (tree expr)
&& real_minus_onep (arg1))
return fold (build1 (NEGATE_EXPR, type, arg0));
- /* x*2 is x+x */
- if (! wins && real_twop (arg1)
- && (*lang_hooks.decls.global_bindings_p) () == 0
- && ! CONTAINS_PLACEHOLDER_P (arg0))
+ /* Convert (C1/X)*C2 into (C1*C2)/X. */
+ if (flag_unsafe_math_optimizations
+ && TREE_CODE (arg0) == RDIV_EXPR
+ && TREE_CODE (arg1) == REAL_CST
+ && TREE_CODE (TREE_OPERAND (arg0, 0)) == REAL_CST)
{
- tree arg = save_expr (arg0);
- return fold (build (PLUS_EXPR, type, arg, arg));
+ tree tem = const_binop (MULT_EXPR, TREE_OPERAND (arg0, 0),
+ arg1, 0);
+ if (tem)
+ return fold (build (RDIV_EXPR, type, tem,
+ TREE_OPERAND (arg0, 1)));
}
if (flag_unsafe_math_optimizations)
@@ -5926,10 +6145,20 @@ fold (tree expr)
return build_function_call_expr (sqrtfn, arglist);
}
- /* Optimize exp(x)*exp(y) as exp(x+y). */
- if ((fcode0 == BUILT_IN_EXP && fcode1 == BUILT_IN_EXP)
- || (fcode0 == BUILT_IN_EXPF && fcode1 == BUILT_IN_EXPF)
- || (fcode0 == BUILT_IN_EXPL && fcode1 == BUILT_IN_EXPL))
+ /* Optimize expN(x)*expN(y) as expN(x+y). */
+ if (fcode0 == fcode1
+ && (fcode0 == BUILT_IN_EXP
+ || fcode0 == BUILT_IN_EXPF
+ || fcode0 == BUILT_IN_EXPL
+ || fcode0 == BUILT_IN_EXP2
+ || fcode0 == BUILT_IN_EXP2F
+ || fcode0 == BUILT_IN_EXP2L
+ || fcode0 == BUILT_IN_EXP10
+ || fcode0 == BUILT_IN_EXP10F
+ || fcode0 == BUILT_IN_EXP10L
+ || fcode0 == BUILT_IN_POW10
+ || fcode0 == BUILT_IN_POW10F
+ || fcode0 == BUILT_IN_POW10L))
{
tree expfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
tree arg = build (PLUS_EXPR, type,
@@ -6008,6 +6237,80 @@ fold (tree expr)
return build_function_call_expr (sinfn,
TREE_OPERAND (arg0, 1));
}
+
+ /* Optimize x*pow(x,c) as pow(x,c+1). */
+ if (fcode1 == BUILT_IN_POW
+ || fcode1 == BUILT_IN_POWF
+ || fcode1 == BUILT_IN_POWL)
+ {
+ tree arg10 = TREE_VALUE (TREE_OPERAND (arg1, 1));
+ tree arg11 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg1,
+ 1)));
+ if (TREE_CODE (arg11) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg11)
+ && operand_equal_p (arg0, arg10, 0))
+ {
+ tree powfn = TREE_OPERAND (TREE_OPERAND (arg1, 0), 0);
+ REAL_VALUE_TYPE c;
+ tree arg, arglist;
+
+ c = TREE_REAL_CST (arg11);
+ real_arithmetic (&c, PLUS_EXPR, &c, &dconst1);
+ arg = build_real (type, c);
+ arglist = build_tree_list (NULL_TREE, arg);
+ arglist = tree_cons (NULL_TREE, arg0, arglist);
+ return build_function_call_expr (powfn, arglist);
+ }
+ }
+
+ /* Optimize pow(x,c)*x as pow(x,c+1). */
+ if (fcode0 == BUILT_IN_POW
+ || fcode0 == BUILT_IN_POWF
+ || fcode0 == BUILT_IN_POWL)
+ {
+ tree arg00 = TREE_VALUE (TREE_OPERAND (arg0, 1));
+ tree arg01 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg0,
+ 1)));
+ if (TREE_CODE (arg01) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg01)
+ && operand_equal_p (arg1, arg00, 0))
+ {
+ tree powfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
+ REAL_VALUE_TYPE c;
+ tree arg, arglist;
+
+ c = TREE_REAL_CST (arg01);
+ real_arithmetic (&c, PLUS_EXPR, &c, &dconst1);
+ arg = build_real (type, c);
+ arglist = build_tree_list (NULL_TREE, arg);
+ arglist = tree_cons (NULL_TREE, arg1, arglist);
+ return build_function_call_expr (powfn, arglist);
+ }
+ }
+
+ /* Optimize x*x as pow(x,2.0), which is expanded as x*x. */
+ if (! optimize_size
+ && operand_equal_p (arg0, arg1, 0))
+ {
+ tree powfn;
+
+ if (type == double_type_node)
+ powfn = implicit_built_in_decls[BUILT_IN_POW];
+ else if (type == float_type_node)
+ powfn = implicit_built_in_decls[BUILT_IN_POWF];
+ else if (type == long_double_type_node)
+ powfn = implicit_built_in_decls[BUILT_IN_POWL];
+ else
+ powfn = NULL_TREE;
+
+ if (powfn)
+ {
+ tree arg = build_real (type, dconst2);
+ tree arglist = build_tree_list (NULL_TREE, arg);
+ arglist = tree_cons (NULL_TREE, arg0, arglist);
+ return build_function_call_expr (powfn, arglist);
+ }
+ }
}
}
goto associate;
@@ -6068,7 +6371,6 @@ fold (tree expr)
goto bit_rotate;
case BIT_AND_EXPR:
- bit_and:
if (integer_all_onesp (arg1))
return non_lvalue (convert (type, arg0));
if (integer_zerop (arg1))
@@ -6106,19 +6408,6 @@ fold (tree expr)
goto associate;
- case BIT_ANDTC_EXPR:
- if (integer_all_onesp (arg0))
- return non_lvalue (convert (type, arg1));
- if (integer_zerop (arg0))
- return omit_one_operand (type, arg0, arg1);
- if (TREE_CODE (arg1) == INTEGER_CST)
- {
- arg1 = fold (build1 (BIT_NOT_EXPR, type, arg1));
- code = BIT_AND_EXPR;
- goto bit_and;
- }
- goto binary;
-
case RDIV_EXPR:
/* Don't touch a floating-point divide by zero unless the mode
of the constant can represent infinity. */
@@ -6128,8 +6417,13 @@ fold (tree expr)
return t;
/* (-A) / (-B) -> A / B */
- if (TREE_CODE (arg0) == NEGATE_EXPR && TREE_CODE (arg1) == NEGATE_EXPR)
- return fold (build (RDIV_EXPR, type, TREE_OPERAND (arg0, 0),
+ if (TREE_CODE (arg0) == NEGATE_EXPR && negate_expr_p (arg1))
+ return fold (build (RDIV_EXPR, type,
+ TREE_OPERAND (arg0, 0),
+ negate_expr (arg1)));
+ if (TREE_CODE (arg1) == NEGATE_EXPR && negate_expr_p (arg0))
+ return fold (build (RDIV_EXPR, type,
+ negate_expr (arg0),
TREE_OPERAND (arg1, 0)));
/* In IEEE floating point, x/1 is not equivalent to x for snans. */
@@ -6137,6 +6431,11 @@ fold (tree expr)
&& real_onep (arg1))
return non_lvalue (convert (type, arg0));
+ /* In IEEE floating point, x/-1 is not equivalent to -x for snans. */
+ if (!HONOR_SNANS (TYPE_MODE (TREE_TYPE (arg0)))
+ && real_minus_onep (arg1))
+ return non_lvalue (convert (type, negate_expr (arg0)));
+
/* If ARG1 is a constant, we can convert this to a multiply by the
reciprocal. This does not have the same rounding properties,
so only do this if -funsafe-math-optimizations. We can actually
@@ -6149,7 +6448,7 @@ fold (tree expr)
arg1, 0)))
return fold (build (MULT_EXPR, type, arg0, tem));
/* Find the reciprocal if optimizing and the result is exact. */
- else if (optimize)
+ if (optimize)
{
REAL_VALUE_TYPE r;
r = TREE_REAL_CST (arg1);
@@ -6163,28 +6462,47 @@ fold (tree expr)
/* Convert A/B/C to A/(B*C). */
if (flag_unsafe_math_optimizations
&& TREE_CODE (arg0) == RDIV_EXPR)
- {
- return fold (build (RDIV_EXPR, type, TREE_OPERAND (arg0, 0),
- build (MULT_EXPR, type, TREE_OPERAND (arg0, 1),
- arg1)));
- }
+ return fold (build (RDIV_EXPR, type, TREE_OPERAND (arg0, 0),
+ fold (build (MULT_EXPR, type,
+ TREE_OPERAND (arg0, 1), arg1))));
+
/* Convert A/(B/C) to (A/B)*C. */
if (flag_unsafe_math_optimizations
&& TREE_CODE (arg1) == RDIV_EXPR)
+ return fold (build (MULT_EXPR, type,
+ fold (build (RDIV_EXPR, type, arg0,
+ TREE_OPERAND (arg1, 0))),
+ TREE_OPERAND (arg1, 1)));
+
+ /* Convert C1/(X*C2) into (C1/C2)/X. */
+ if (flag_unsafe_math_optimizations
+ && TREE_CODE (arg1) == MULT_EXPR
+ && TREE_CODE (arg0) == REAL_CST
+ && TREE_CODE (TREE_OPERAND (arg1, 1)) == REAL_CST)
{
- return fold (build (MULT_EXPR, type,
- build (RDIV_EXPR, type, arg0,
- TREE_OPERAND (arg1, 0)),
- TREE_OPERAND (arg1, 1)));
+ tree tem = const_binop (RDIV_EXPR, arg0,
+ TREE_OPERAND (arg1, 1), 0);
+ if (tem)
+ return fold (build (RDIV_EXPR, type, tem,
+ TREE_OPERAND (arg1, 0)));
}
if (flag_unsafe_math_optimizations)
{
enum built_in_function fcode = builtin_mathfn_code (arg1);
- /* Optimize x/exp(y) into x*exp(-y). */
+ /* Optimize x/expN(y) into x*expN(-y). */
if (fcode == BUILT_IN_EXP
|| fcode == BUILT_IN_EXPF
- || fcode == BUILT_IN_EXPL)
+ || fcode == BUILT_IN_EXPL
+ || fcode == BUILT_IN_EXP2
+ || fcode == BUILT_IN_EXP2F
+ || fcode == BUILT_IN_EXP2L
+ || fcode == BUILT_IN_EXP10
+ || fcode == BUILT_IN_EXP10F
+ || fcode == BUILT_IN_EXP10L
+ || fcode == BUILT_IN_POW10
+ || fcode == BUILT_IN_POW10F
+ || fcode == BUILT_IN_POW10L)
{
tree expfn = TREE_OPERAND (TREE_OPERAND (arg1, 0), 0);
tree arg = build1 (NEGATE_EXPR, type,
@@ -6265,6 +6583,30 @@ fold (tree expr)
tmp));
}
}
+
+ /* Optimize pow(x,c)/x as pow(x,c-1). */
+ if (fcode0 == BUILT_IN_POW
+ || fcode0 == BUILT_IN_POWF
+ || fcode0 == BUILT_IN_POWL)
+ {
+ tree arg00 = TREE_VALUE (TREE_OPERAND (arg0, 1));
+ tree arg01 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg0, 1)));
+ if (TREE_CODE (arg01) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg01)
+ && operand_equal_p (arg1, arg00, 0))
+ {
+ tree powfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
+ REAL_VALUE_TYPE c;
+ tree arg, arglist;
+
+ c = TREE_REAL_CST (arg01);
+ real_arithmetic (&c, MINUS_EXPR, &c, &dconst1);
+ arg = build_real (type, c);
+ arglist = build_tree_list (NULL_TREE, arg);
+ arglist = tree_cons (NULL_TREE, arg1, arglist);
+ return build_function_call_expr (powfn, arglist);
+ }
+ }
}
goto binary;
@@ -6338,16 +6680,10 @@ fold (tree expr)
RROTATE_EXPR by a new constant. */
if (code == LROTATE_EXPR && TREE_CODE (arg1) == INTEGER_CST)
{
- TREE_SET_CODE (t, RROTATE_EXPR);
- code = RROTATE_EXPR;
- TREE_OPERAND (t, 1) = arg1
- = const_binop
- (MINUS_EXPR,
- convert (TREE_TYPE (arg1),
- build_int_2 (GET_MODE_BITSIZE (TYPE_MODE (type)), 0)),
- arg1, 0);
- if (tree_int_cst_sgn (arg1) < 0)
- return t;
+ tree tem = build_int_2 (GET_MODE_BITSIZE (TYPE_MODE (type)), 0);
+ tem = convert (TREE_TYPE (arg1), tem);
+ tem = const_binop (MINUS_EXPR, tem, arg1, 0);
+ return fold (build (RROTATE_EXPR, type, arg0, tem));
}
/* If we have a rotate of a bit operation with the rotate count and
@@ -6355,7 +6691,6 @@ fold (tree expr)
permute the two operations. */
if (code == RROTATE_EXPR && TREE_CODE (arg1) == INTEGER_CST
&& (TREE_CODE (arg0) == BIT_AND_EXPR
- || TREE_CODE (arg0) == BIT_ANDTC_EXPR
|| TREE_CODE (arg0) == BIT_IOR_EXPR
|| TREE_CODE (arg0) == BIT_XOR_EXPR)
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
@@ -6545,18 +6880,8 @@ fold (tree expr)
case LE_EXPR:
case GE_EXPR:
/* If one arg is a real or integer constant, put it last. */
- if ((TREE_CODE (arg0) == INTEGER_CST
- && TREE_CODE (arg1) != INTEGER_CST)
- || (TREE_CODE (arg0) == REAL_CST
- && TREE_CODE (arg0) != REAL_CST))
- {
- TREE_OPERAND (t, 0) = arg1;
- TREE_OPERAND (t, 1) = arg0;
- arg0 = TREE_OPERAND (t, 0);
- arg1 = TREE_OPERAND (t, 1);
- code = swap_tree_comparison (code);
- TREE_SET_CODE (t, code);
- }
+ if (tree_swap_operands_p (arg0, arg1))
+ return fold (build (swap_tree_comparison (code), type, arg1, arg0));
if (FLOAT_TYPE_P (TREE_TYPE (arg0)))
{
@@ -6813,16 +7138,12 @@ fold (tree expr)
switch (code)
{
case GE_EXPR:
- code = GT_EXPR;
arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0);
- t = build (code, type, TREE_OPERAND (t, 0), arg1);
- break;
+ return fold (build (GT_EXPR, type, arg0, arg1));
case LT_EXPR:
- code = LE_EXPR;
arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0);
- t = build (code, type, TREE_OPERAND (t, 0), arg1);
- break;
+ return fold (build (LE_EXPR, type, arg0, arg1));
default:
break;
@@ -6865,20 +7186,17 @@ fold (tree expr)
convert (type, integer_zero_node),
arg0);
case GE_EXPR:
- code = EQ_EXPR;
- TREE_SET_CODE (t, EQ_EXPR);
- break;
+ return fold (build (EQ_EXPR, type, arg0, arg1));
+
case LE_EXPR:
return omit_one_operand (type,
convert (type, integer_one_node),
arg0);
case LT_EXPR:
- code = NE_EXPR;
- TREE_SET_CODE (t, NE_EXPR);
- break;
+ return fold (build (NE_EXPR, type, arg0, arg1));
/* The GE_EXPR and LT_EXPR cases above are not normally
- reached because of previous transformations. */
+ reached because of previous transformations. */
default:
break;
@@ -6888,15 +7206,11 @@ fold (tree expr)
switch (code)
{
case GT_EXPR:
- code = EQ_EXPR;
arg1 = const_binop (PLUS_EXPR, arg1, integer_one_node, 0);
- t = build (code, type, TREE_OPERAND (t, 0), arg1);
- break;
+ return fold (build (EQ_EXPR, type, arg0, arg1));
case LE_EXPR:
- code = NE_EXPR;
arg1 = const_binop (PLUS_EXPR, arg1, integer_one_node, 0);
- t = build (code, type, TREE_OPERAND (t, 0), arg1);
- break;
+ return fold (build (NE_EXPR, type, arg0, arg1));
default:
break;
}
@@ -6909,18 +7223,14 @@ fold (tree expr)
convert (type, integer_zero_node),
arg0);
case LE_EXPR:
- code = EQ_EXPR;
- TREE_SET_CODE (t, EQ_EXPR);
- break;
+ return fold (build (EQ_EXPR, type, arg0, arg1));
case GE_EXPR:
return omit_one_operand (type,
convert (type, integer_one_node),
arg0);
case GT_EXPR:
- code = NE_EXPR;
- TREE_SET_CODE (t, NE_EXPR);
- break;
+ return fold (build (NE_EXPR, type, arg0, arg1));
default:
break;
@@ -6930,15 +7240,11 @@ fold (tree expr)
switch (code)
{
case GE_EXPR:
- code = NE_EXPR;
arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0);
- t = build (code, type, TREE_OPERAND (t, 0), arg1);
- break;
+ return fold (build (NE_EXPR, type, arg0, arg1));
case LT_EXPR:
- code = EQ_EXPR;
arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0);
- t = build (code, type, TREE_OPERAND (t, 0), arg1);
- break;
+ return fold (build (EQ_EXPR, type, arg0, arg1));
default:
break;
}
@@ -7107,6 +7413,39 @@ fold (tree expr)
if (tem)
return tem;
+ /* If we have (A & C) == D where D & ~C != 0, convert this into 0.
+ Similarly for NE_EXPR. */
+ if ((code == EQ_EXPR || code == NE_EXPR)
+ && TREE_CODE (arg0) == BIT_AND_EXPR
+ && TREE_CODE (arg1) == INTEGER_CST
+ && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
+ {
+ tree dandnotc
+ = fold (build (BIT_AND_EXPR, TREE_TYPE (arg0),
+ arg1, build1 (BIT_NOT_EXPR,
+ TREE_TYPE (TREE_OPERAND (arg0, 1)),
+ TREE_OPERAND (arg0, 1))));
+ tree rslt = code == EQ_EXPR ? integer_zero_node : integer_one_node;
+ if (integer_nonzerop (dandnotc))
+ return omit_one_operand (type, rslt, arg0);
+ }
+
+ /* If we have (A | C) == D where C & ~D != 0, convert this into 0.
+ Similarly for NE_EXPR. */
+ if ((code == EQ_EXPR || code == NE_EXPR)
+ && TREE_CODE (arg0) == BIT_IOR_EXPR
+ && TREE_CODE (arg1) == INTEGER_CST
+ && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
+ {
+ tree candnotd
+ = fold (build (BIT_AND_EXPR, TREE_TYPE (arg0),
+ TREE_OPERAND (arg0, 1),
+ build1 (BIT_NOT_EXPR, TREE_TYPE (arg1), arg1)));
+ tree rslt = code == EQ_EXPR ? integer_zero_node : integer_one_node;
+ if (integer_nonzerop (candnotd))
+ return omit_one_operand (type, rslt, arg0);
+ }
+
/* If X is unsigned, convert X < (1 << Y) into X >> Y == 0
and similarly for >= into !=. */
if ((code == LT_EXPR || code == GE_EXPR)
@@ -7138,14 +7477,17 @@ fold (tree expr)
switch (code)
{
case EQ_EXPR:
+ if (! FLOAT_TYPE_P (TREE_TYPE (arg0))
+ || ! HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0))))
+ return constant_boolean_node (1, type);
+ break;
+
case GE_EXPR:
case LE_EXPR:
if (! FLOAT_TYPE_P (TREE_TYPE (arg0))
|| ! HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0))))
return constant_boolean_node (1, type);
- code = EQ_EXPR;
- TREE_SET_CODE (t, code);
- break;
+ return fold (build (EQ_EXPR, type, arg0, arg1));
case NE_EXPR:
/* For NE, we can only do this simplification if integer
@@ -7312,13 +7654,12 @@ fold (tree expr)
due to the return value of strlen being unsigned. */
if ((code == EQ_EXPR || code == NE_EXPR)
&& integer_zerop (arg1)
- && TREE_CODE (arg0) == CALL_EXPR
- && TREE_CODE (TREE_OPERAND (arg0, 0)) == ADDR_EXPR)
+ && TREE_CODE (arg0) == CALL_EXPR)
{
- tree fndecl = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
+ tree fndecl = get_callee_fndecl (arg0);
tree arglist;
- if (TREE_CODE (fndecl) == FUNCTION_DECL
+ if (fndecl
&& DECL_BUILT_IN (fndecl)
&& DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_MD
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_STRLEN
@@ -7427,34 +7768,6 @@ fold (tree expr)
else if (operand_equal_p (arg1, TREE_OPERAND (expr, 2), 0))
return pedantic_omit_one_operand (type, arg1, arg0);
- /* If the second operand is zero, invert the comparison and swap
- the second and third operands. Likewise if the second operand
- is constant and the third is not or if the third operand is
- equivalent to the first operand of the comparison. */
-
- if (integer_zerop (arg1)
- || (TREE_CONSTANT (arg1) && ! TREE_CONSTANT (TREE_OPERAND (t, 2)))
- || (TREE_CODE_CLASS (TREE_CODE (arg0)) == '<'
- && operand_equal_for_comparison_p (TREE_OPERAND (arg0, 0),
- TREE_OPERAND (t, 2),
- TREE_OPERAND (arg0, 1))))
- {
- /* See if this can be inverted. If it can't, possibly because
- it was a floating-point inequality comparison, don't do
- anything. */
- tem = invert_truthvalue (arg0);
-
- if (TREE_CODE (tem) != TRUTH_NOT_EXPR)
- {
- t = build (code, type, tem,
- TREE_OPERAND (t, 2), TREE_OPERAND (t, 1));
- arg0 = tem;
- /* arg1 should be the first argument of the new T. */
- arg1 = TREE_OPERAND (t, 1);
- STRIP_NOPS (arg1);
- }
- }
-
/* If we have A op B ? A : C, we may be able to convert this to a
simpler expression, depending on the operation and the values
of B and C. Signed zeros prevent all of these transformations,
@@ -7630,9 +7943,8 @@ fold (tree expr)
case EQ_EXPR:
/* We can replace A with C1 in this case. */
arg1 = convert (type, TREE_OPERAND (arg0, 1));
- t = build (code, type, TREE_OPERAND (t, 0), arg1,
- TREE_OPERAND (t, 2));
- break;
+ return fold (build (code, type, TREE_OPERAND (t, 0), arg1,
+ TREE_OPERAND (t, 2)));
case LT_EXPR:
/* If C1 is C2 + 1, this is min(A, C2). */
@@ -7682,11 +7994,7 @@ fold (tree expr)
/* If the second operand is simpler than the third, swap them
since that produces better jump optimization results. */
- if ((TREE_CONSTANT (arg1) || DECL_P (arg1)
- || TREE_CODE (arg1) == SAVE_EXPR)
- && ! (TREE_CONSTANT (TREE_OPERAND (t, 2))
- || DECL_P (TREE_OPERAND (t, 2))
- || TREE_CODE (TREE_OPERAND (t, 2)) == SAVE_EXPR))
+ if (tree_swap_operands_p (TREE_OPERAND (t, 1), TREE_OPERAND (t, 2)))
{
/* See if this can be inverted. If it can't, possibly because
it was a floating-point inequality comparison, don't do
@@ -7694,14 +8002,8 @@ fold (tree expr)
tem = invert_truthvalue (arg0);
if (TREE_CODE (tem) != TRUTH_NOT_EXPR)
- {
- t = build (code, type, tem,
- TREE_OPERAND (t, 2), TREE_OPERAND (t, 1));
- arg0 = tem;
- /* arg1 should be the first argument of the new T. */
- arg1 = TREE_OPERAND (t, 1);
- STRIP_NOPS (arg1);
- }
+ return fold (build (code, type, tem,
+ TREE_OPERAND (t, 2), TREE_OPERAND (t, 1)));
}
/* Convert A ? 1 : 0 to simply A. */
@@ -7861,6 +8163,224 @@ fold (tree expr)
} /* switch (code) */
}
+#ifdef ENABLE_FOLD_CHECKING
+#undef fold
+
+static void fold_checksum_tree (tree, struct md5_ctx *, htab_t);
+static void fold_check_failed (tree, tree);
+void print_fold_checksum (tree);
+
+/* When --enable-checking=fold, compute a digest of expr before
+ and after actual fold call to see if fold did not accidentally
+ change original expr. */
+
+tree
+fold (tree expr)
+{
+ tree ret;
+ struct md5_ctx ctx;
+ unsigned char checksum_before[16], checksum_after[16];
+ htab_t ht;
+
+ ht = htab_create (32, htab_hash_pointer, htab_eq_pointer, NULL);
+ md5_init_ctx (&ctx);
+ fold_checksum_tree (expr, &ctx, ht);
+ md5_finish_ctx (&ctx, checksum_before);
+ htab_empty (ht);
+
+ ret = fold_1 (expr);
+
+ md5_init_ctx (&ctx);
+ fold_checksum_tree (expr, &ctx, ht);
+ md5_finish_ctx (&ctx, checksum_after);
+ htab_delete (ht);
+
+ if (memcmp (checksum_before, checksum_after, 16))
+ fold_check_failed (expr, ret);
+
+ return ret;
+}
+
+void
+print_fold_checksum (tree expr)
+{
+ struct md5_ctx ctx;
+ unsigned char checksum[16], cnt;
+ htab_t ht;
+
+ ht = htab_create (32, htab_hash_pointer, htab_eq_pointer, NULL);
+ md5_init_ctx (&ctx);
+ fold_checksum_tree (expr, &ctx, ht);
+ md5_finish_ctx (&ctx, checksum);
+ htab_delete (ht);
+ for (cnt = 0; cnt < 16; ++cnt)
+ fprintf (stderr, "%02x", checksum[cnt]);
+ putc ('\n', stderr);
+}
+
+static void
+fold_check_failed (tree expr ATTRIBUTE_UNUSED, tree ret ATTRIBUTE_UNUSED)
+{
+ internal_error ("fold check: original tree changed by fold");
+}
+
+static void
+fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
+{
+ void **slot;
+ enum tree_code code;
+ char buf[sizeof (struct tree_decl)];
+ int i, len;
+
+ if (sizeof (struct tree_exp) + 5 * sizeof (tree)
+ > sizeof (struct tree_decl)
+ || sizeof (struct tree_type) > sizeof (struct tree_decl))
+ abort ();
+ if (expr == NULL)
+ return;
+ slot = htab_find_slot (ht, expr, INSERT);
+ if (*slot != NULL)
+ return;
+ *slot = expr;
+ code = TREE_CODE (expr);
+ if (code == SAVE_EXPR && SAVE_EXPR_NOPLACEHOLDER (expr))
+ {
+ /* Allow SAVE_EXPR_NOPLACEHOLDER flag to be modified. */
+ memcpy (buf, expr, tree_size (expr));
+ expr = (tree) buf;
+ SAVE_EXPR_NOPLACEHOLDER (expr) = 0;
+ }
+ else if (TREE_CODE_CLASS (code) == 'd' && DECL_ASSEMBLER_NAME_SET_P (expr))
+ {
+ /* Allow DECL_ASSEMBLER_NAME to be modified. */
+ memcpy (buf, expr, tree_size (expr));
+ expr = (tree) buf;
+ SET_DECL_ASSEMBLER_NAME (expr, NULL);
+ }
+ else if (TREE_CODE_CLASS (code) == 't'
+ && (TYPE_POINTER_TO (expr) || TYPE_REFERENCE_TO (expr)))
+ {
+ /* Allow TYPE_POINTER_TO and TYPE_REFERENCE_TO to be modified. */
+ memcpy (buf, expr, tree_size (expr));
+ expr = (tree) buf;
+ TYPE_POINTER_TO (expr) = NULL;
+ TYPE_REFERENCE_TO (expr) = NULL;
+ }
+ md5_process_bytes (expr, tree_size (expr), ctx);
+ fold_checksum_tree (TREE_TYPE (expr), ctx, ht);
+ if (TREE_CODE_CLASS (code) != 't' && TREE_CODE_CLASS (code) != 'd')
+ fold_checksum_tree (TREE_CHAIN (expr), ctx, ht);
+ len = TREE_CODE_LENGTH (code);
+ switch (TREE_CODE_CLASS (code))
+ {
+ case 'c':
+ switch (code)
+ {
+ case STRING_CST:
+ md5_process_bytes (TREE_STRING_POINTER (expr),
+ TREE_STRING_LENGTH (expr), ctx);
+ break;
+ case COMPLEX_CST:
+ fold_checksum_tree (TREE_REALPART (expr), ctx, ht);
+ fold_checksum_tree (TREE_IMAGPART (expr), ctx, ht);
+ break;
+ case VECTOR_CST:
+ fold_checksum_tree (TREE_VECTOR_CST_ELTS (expr), ctx, ht);
+ break;
+ default:
+ break;
+ }
+ break;
+ case 'x':
+ switch (code)
+ {
+ case TREE_LIST:
+ fold_checksum_tree (TREE_PURPOSE (expr), ctx, ht);
+ fold_checksum_tree (TREE_VALUE (expr), ctx, ht);
+ break;
+ case TREE_VEC:
+ for (i = 0; i < TREE_VEC_LENGTH (expr); ++i)
+ fold_checksum_tree (TREE_VEC_ELT (expr, i), ctx, ht);
+ break;
+ default:
+ break;
+ }
+ break;
+ case 'e':
+ switch (code)
+ {
+ case SAVE_EXPR: len = 2; break;
+ case GOTO_SUBROUTINE_EXPR: len = 0; break;
+ case RTL_EXPR: len = 0; break;
+ case WITH_CLEANUP_EXPR: len = 2; break;
+ default: break;
+ }
+ /* FALLTHROUGH */
+ case 'r':
+ case '<':
+ case '1':
+ case '2':
+ case 's':
+ for (i = 0; i < len; ++i)
+ fold_checksum_tree (TREE_OPERAND (expr, i), ctx, ht);
+ break;
+ case 'd':
+ fold_checksum_tree (DECL_SIZE (expr), ctx, ht);
+ fold_checksum_tree (DECL_SIZE_UNIT (expr), ctx, ht);
+ fold_checksum_tree (DECL_NAME (expr), ctx, ht);
+ fold_checksum_tree (DECL_CONTEXT (expr), ctx, ht);
+ fold_checksum_tree (DECL_ARGUMENTS (expr), ctx, ht);
+ fold_checksum_tree (DECL_RESULT_FLD (expr), ctx, ht);
+ fold_checksum_tree (DECL_INITIAL (expr), ctx, ht);
+ fold_checksum_tree (DECL_ABSTRACT_ORIGIN (expr), ctx, ht);
+ fold_checksum_tree (DECL_SECTION_NAME (expr), ctx, ht);
+ fold_checksum_tree (DECL_ATTRIBUTES (expr), ctx, ht);
+ fold_checksum_tree (DECL_VINDEX (expr), ctx, ht);
+ break;
+ case 't':
+ fold_checksum_tree (TYPE_VALUES (expr), ctx, ht);
+ fold_checksum_tree (TYPE_SIZE (expr), ctx, ht);
+ fold_checksum_tree (TYPE_SIZE_UNIT (expr), ctx, ht);
+ fold_checksum_tree (TYPE_ATTRIBUTES (expr), ctx, ht);
+ fold_checksum_tree (TYPE_NAME (expr), ctx, ht);
+ fold_checksum_tree (TYPE_MIN_VALUE (expr), ctx, ht);
+ fold_checksum_tree (TYPE_MAX_VALUE (expr), ctx, ht);
+ fold_checksum_tree (TYPE_MAIN_VARIANT (expr), ctx, ht);
+ fold_checksum_tree (TYPE_BINFO (expr), ctx, ht);
+ fold_checksum_tree (TYPE_CONTEXT (expr), ctx, ht);
+ break;
+ default:
+ break;
+ }
+}
+
+#endif
+
+/* Perform constant folding and related simplification of initializer
+ expression EXPR. This behaves identically to "fold" but ignores
+ potential run-time traps and exceptions that fold must preserve. */
+
+tree
+fold_initializer (tree expr)
+{
+ int saved_signaling_nans = flag_signaling_nans;
+ int saved_trapping_math = flag_trapping_math;
+ int saved_trapv = flag_trapv;
+ tree result;
+
+ flag_signaling_nans = 0;
+ flag_trapping_math = 0;
+ flag_trapv = 0;
+
+ result = fold (expr);
+
+ flag_signaling_nans = saved_signaling_nans;
+ flag_trapping_math = saved_trapping_math;
+ flag_trapv = saved_trapv;
+
+ return result;
+}
+
/* Determine if first argument is a multiple of second argument. Return 0 if
it is not, or we cannot easily determined it to be.
@@ -7974,18 +8494,8 @@ tree_expr_nonnegative_p (tree t)
switch (TREE_CODE (t))
{
case ABS_EXPR:
- case FFS_EXPR:
- case POPCOUNT_EXPR:
- case PARITY_EXPR:
return 1;
- case CLZ_EXPR:
- case CTZ_EXPR:
- /* These are undefined at zero. This is true even if
- C[LT]Z_DEFINED_VALUE_AT_ZERO is set, since what we're
- computing here is a user-visible property. */
- return 0;
-
case INTEGER_CST:
return tree_int_cst_sgn (t) >= 0;
@@ -8109,58 +8619,75 @@ tree_expr_nonnegative_p (tree t)
return rtl_expr_nonnegative_p (RTL_EXPR_RTL (t));
case CALL_EXPR:
- if (TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR)
- {
- tree fndecl = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
- tree arglist = TREE_OPERAND (t, 1);
- if (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN (fndecl)
- && DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_MD)
- switch (DECL_FUNCTION_CODE (fndecl))
- {
- case BUILT_IN_CABS:
- case BUILT_IN_CABSL:
- case BUILT_IN_CABSF:
- case BUILT_IN_EXP:
- case BUILT_IN_EXPF:
- case BUILT_IN_EXPL:
- case BUILT_IN_FABS:
- case BUILT_IN_FABSF:
- case BUILT_IN_FABSL:
- case BUILT_IN_SQRT:
- case BUILT_IN_SQRTF:
- case BUILT_IN_SQRTL:
- return 1;
-
- case BUILT_IN_ATAN:
- case BUILT_IN_ATANF:
- case BUILT_IN_ATANL:
- case BUILT_IN_CEIL:
- case BUILT_IN_CEILF:
- case BUILT_IN_CEILL:
- case BUILT_IN_FLOOR:
- case BUILT_IN_FLOORF:
- case BUILT_IN_FLOORL:
- case BUILT_IN_NEARBYINT:
- case BUILT_IN_NEARBYINTF:
- case BUILT_IN_NEARBYINTL:
- case BUILT_IN_ROUND:
- case BUILT_IN_ROUNDF:
- case BUILT_IN_ROUNDL:
- case BUILT_IN_TRUNC:
- case BUILT_IN_TRUNCF:
- case BUILT_IN_TRUNCL:
- return tree_expr_nonnegative_p (TREE_VALUE (arglist));
-
- case BUILT_IN_POW:
- case BUILT_IN_POWF:
- case BUILT_IN_POWL:
- return tree_expr_nonnegative_p (TREE_VALUE (arglist));
+ {
+ tree fndecl = get_callee_fndecl (t);
+ tree arglist = TREE_OPERAND (t, 1);
+ if (fndecl
+ && DECL_BUILT_IN (fndecl)
+ && DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_MD)
+ switch (DECL_FUNCTION_CODE (fndecl))
+ {
+ case BUILT_IN_CABS:
+ case BUILT_IN_CABSL:
+ case BUILT_IN_CABSF:
+ case BUILT_IN_EXP:
+ case BUILT_IN_EXPF:
+ case BUILT_IN_EXPL:
+ case BUILT_IN_EXP2:
+ case BUILT_IN_EXP2F:
+ case BUILT_IN_EXP2L:
+ case BUILT_IN_EXP10:
+ case BUILT_IN_EXP10F:
+ case BUILT_IN_EXP10L:
+ case BUILT_IN_FABS:
+ case BUILT_IN_FABSF:
+ case BUILT_IN_FABSL:
+ case BUILT_IN_FFS:
+ case BUILT_IN_FFSL:
+ case BUILT_IN_FFSLL:
+ case BUILT_IN_PARITY:
+ case BUILT_IN_PARITYL:
+ case BUILT_IN_PARITYLL:
+ case BUILT_IN_POPCOUNT:
+ case BUILT_IN_POPCOUNTL:
+ case BUILT_IN_POPCOUNTLL:
+ case BUILT_IN_POW10:
+ case BUILT_IN_POW10F:
+ case BUILT_IN_POW10L:
+ case BUILT_IN_SQRT:
+ case BUILT_IN_SQRTF:
+ case BUILT_IN_SQRTL:
+ return 1;
+
+ case BUILT_IN_ATAN:
+ case BUILT_IN_ATANF:
+ case BUILT_IN_ATANL:
+ case BUILT_IN_CEIL:
+ case BUILT_IN_CEILF:
+ case BUILT_IN_CEILL:
+ case BUILT_IN_FLOOR:
+ case BUILT_IN_FLOORF:
+ case BUILT_IN_FLOORL:
+ case BUILT_IN_NEARBYINT:
+ case BUILT_IN_NEARBYINTF:
+ case BUILT_IN_NEARBYINTL:
+ case BUILT_IN_ROUND:
+ case BUILT_IN_ROUNDF:
+ case BUILT_IN_ROUNDL:
+ case BUILT_IN_TRUNC:
+ case BUILT_IN_TRUNCF:
+ case BUILT_IN_TRUNCL:
+ return tree_expr_nonnegative_p (TREE_VALUE (arglist));
+
+ case BUILT_IN_POW:
+ case BUILT_IN_POWF:
+ case BUILT_IN_POWL:
+ return tree_expr_nonnegative_p (TREE_VALUE (arglist));
- default:
- break;
- }
- }
+ default:
+ break;
+ }
+ }
/* ... fall through ... */
diff --git a/gcc/fp-test.c b/gcc/fp-test.c
index c85bf21befa..cfd7f9c4bfc 100644
--- a/gcc/fp-test.c
+++ b/gcc/fp-test.c
@@ -1,5 +1,5 @@
/* fp-test.c - Check that all floating-point operations are available.
- Copyright (C) 1995, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2000, 2003 Free Software Foundation, Inc.
Contributed by Ronald F. Guilmette <rfg@monkeys.com>.
This file is part of GCC.
@@ -83,7 +83,7 @@ volatile double d1 = 1.0, d2 = 1.0, d3 = 1.0;
volatile long double D1 = 1.0, D2 = 1.0, D3 = 1.0;
int
-main ()
+main (void)
{
/* TYPE: float */
diff --git a/gcc/function.c b/gcc/function.c
index 742ad2f7340..baec4ab3048 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -62,6 +62,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm_p.h"
#include "integrate.h"
#include "langhooks.h"
+#include "target.h"
#ifndef TRAMPOLINE_ALIGNMENT
#define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
@@ -75,6 +76,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define STACK_ALIGNMENT_NEEDED 1
#endif
+#define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT)
+
/* 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
@@ -284,7 +287,7 @@ static hashval_t insns_for_mem_hash (const void *);
static int insns_for_mem_comp (const void *, const void *);
static int insns_for_mem_walk (rtx *, void *);
static void compute_insns_for_mem (rtx, rtx, htab_t);
-static void prepare_function_start (void);
+static void prepare_function_start (tree);
static void do_clobber_return_reg (rtx, void *);
static void do_use_return_reg (rtx, void *);
static void instantiate_virtual_regs_lossage (rtx);
@@ -692,7 +695,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep
if (best_p->size - rounded_size >= alignment)
{
- p = (struct temp_slot *) ggc_alloc (sizeof (struct temp_slot));
+ p = ggc_alloc (sizeof (struct temp_slot));
p->in_use = p->addr_taken = 0;
p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size;
@@ -723,7 +726,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep
{
HOST_WIDE_INT frame_offset_old = frame_offset;
- p = (struct temp_slot *) ggc_alloc (sizeof (struct temp_slot));
+ p = ggc_alloc (sizeof (struct temp_slot));
/* We are passing an explicit alignment request to assign_stack_local.
One side effect of that is assign_stack_local will not round SIZE
@@ -877,7 +880,7 @@ assign_temp (tree type_or_decl, int keep, int memory_required,
if (decl && size == -1
&& TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST)
{
- error_with_decl (decl, "size of variable `%s' is too large");
+ error ("%Jsize of variable '%D' is too large", decl, decl);
size = 1;
}
@@ -1477,8 +1480,7 @@ schedule_fixup_var_refs (struct function *function, rtx reg, tree type,
{
struct var_refs_queue *temp;
- temp
- = (struct var_refs_queue *) ggc_alloc (sizeof (struct var_refs_queue));
+ temp = ggc_alloc (sizeof (struct var_refs_queue));
temp->modified = reg;
temp->promoted_mode = promoted_mode;
temp->unsignedp = unsigned_p;
@@ -1553,7 +1555,7 @@ find_fixup_replacement (struct fixup_replacement **replacements, rtx x)
if (p == 0)
{
- p = (struct fixup_replacement *) xmalloc (sizeof (struct fixup_replacement));
+ p = xmalloc (sizeof (struct fixup_replacement));
p->old = x;
p->new = 0;
p->next = *replacements;
@@ -1627,7 +1629,7 @@ fixup_var_refs_insns_with_hash (htab_t ht, rtx var, enum machine_mode promoted_m
rtx insn_list;
tmp.key = var;
- ime = (struct insns_for_mem_entry *) htab_find (ht, &tmp);
+ ime = htab_find (ht, &tmp);
for (insn_list = ime->insns; insn_list != 0; insn_list = XEXP (insn_list, 1))
if (INSN_P (XEXP (insn_list, 0)))
fixup_var_refs_insn (XEXP (insn_list, 0), var, promoted_mode,
@@ -3295,7 +3297,7 @@ insns_for_mem_walk (rtx *r, void *data)
{
struct insns_for_mem_entry *ifme;
tmp.key = *r;
- ifme = (struct insns_for_mem_entry *) htab_find (ifmwi->ht, &tmp);
+ ifme = htab_find (ifmwi->ht, &tmp);
/* If we have not already recorded this INSN, do so now. Since
we process the INSNs in order, we know that if we have
@@ -4177,16 +4179,37 @@ get_first_nonparm_insn (void)
EXP may be a type node or an expression (whose type is tested). */
int
-aggregate_value_p (tree exp)
+aggregate_value_p (tree exp, tree fntype)
{
int i, regno, nregs;
rtx reg;
tree type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp);
+ if (fntype)
+ switch (TREE_CODE (fntype))
+ {
+ case CALL_EXPR:
+ fntype = get_callee_fndecl (fntype);
+ fntype = fntype ? TREE_TYPE (fntype) : 0;
+ break;
+ case FUNCTION_DECL:
+ fntype = TREE_TYPE (fntype);
+ break;
+ case FUNCTION_TYPE:
+ case METHOD_TYPE:
+ break;
+ case IDENTIFIER_NODE:
+ fntype = 0;
+ break;
+ default:
+ /* We don't expect other rtl types here. */
+ abort();
+ }
+
if (TREE_CODE (type) == VOID_TYPE)
return 0;
- if (RETURN_IN_MEMORY (type))
+ if (targetm.calls.return_in_memory (type, fntype))
return 1;
/* Types that are TREE_ADDRESSABLE must be constructed in memory,
and thus can't be returned in registers. */
@@ -4230,9 +4253,7 @@ assign_parms (tree fndecl)
/* This is a dummy PARM_DECL that we used for the function result if
the function returns a structure. */
tree function_result_decl = 0;
-#ifdef SETUP_INCOMING_VARARGS
int varargs_setup = 0;
-#endif
int reg_parm_stack_space = 0;
rtx conversion_insns = 0;
@@ -4265,9 +4286,9 @@ assign_parms (tree fndecl)
stack_args_size.var = 0;
/* If struct value address is treated as the first argument, make it so. */
- 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 (TREE_TYPE (fntype));
@@ -4281,7 +4302,7 @@ assign_parms (tree fndecl)
orig_fnargs = fnargs;
max_parm_reg = LAST_VIRTUAL_REGISTER + 1;
- parm_reg_stack_loc = (rtx *) ggc_alloc_cleared (max_parm_reg * sizeof (rtx));
+ parm_reg_stack_loc = ggc_alloc_cleared (max_parm_reg * sizeof (rtx));
if (SPLIT_COMPLEX_ARGS)
fnargs = split_complex_args (fnargs);
@@ -4319,6 +4340,7 @@ assign_parms (tree fndecl)
int last_named = 0, named_arg;
int in_regs;
int partial = 0;
+ int pretend_bytes = 0;
/* Set LAST_NAMED if this is last named arg before last
anonymous args. */
@@ -4336,7 +4358,7 @@ assign_parms (tree fndecl)
/* Set NAMED_ARG if this arg should be treated as a named arg. For
most machines, if this is a varargs/stdarg function, then we treat
the last named arg as if it were anonymous too. */
- named_arg = STRICT_ARGUMENT_NAMING ? 1 : ! last_named;
+ named_arg = targetm.calls.strict_argument_naming (&args_so_far) ? 1 : ! last_named;
if (TREE_TYPE (parm) == error_mark_node
/* This can happen after weird syntax errors
@@ -4401,11 +4423,12 @@ assign_parms (tree fndecl)
promoted_mode = passed_mode;
-#ifdef PROMOTE_FUNCTION_ARGS
- /* Compute the mode in which the arg is actually extended to. */
- unsignedp = TREE_UNSIGNED (passed_type);
- promoted_mode = promote_mode (passed_type, promoted_mode, &unsignedp, 1);
-#endif
+ if (targetm.calls.promote_function_args (TREE_TYPE (fndecl)))
+ {
+ /* Compute the mode in which the arg is actually extended to. */
+ unsignedp = TREE_UNSIGNED (passed_type);
+ promoted_mode = promote_mode (passed_type, promoted_mode, &unsignedp, 1);
+ }
/* Let machine desc say which reg (if any) the parm arrives in.
0 means it arrives on the stack. */
@@ -4420,7 +4443,6 @@ assign_parms (tree fndecl)
if (entry_parm == 0)
promoted_mode = passed_mode;
-#ifdef SETUP_INCOMING_VARARGS
/* If this is the last named parameter, do any required setup for
varargs or stdargs. We need to know about the case of this being an
addressable type, in which case we skip the registers it
@@ -4433,11 +4455,18 @@ assign_parms (tree fndecl)
Also, indicate when RTL generation is to be suppressed. */
if (last_named && !varargs_setup)
{
- SETUP_INCOMING_VARARGS (args_so_far, promoted_mode, passed_type,
- current_function_pretend_args_size, 0);
+ int varargs_pretend_bytes = 0;
+ targetm.calls.setup_incoming_varargs (&args_so_far, promoted_mode,
+ passed_type,
+ &varargs_pretend_bytes, 0);
varargs_setup = 1;
+
+ /* If the back-end has requested extra stack space, record how
+ much is needed. Do not change pretend_args_size otherwise
+ since it may be nonzero from an earlier partial argument. */
+ if (varargs_pretend_bytes > 0)
+ current_function_pretend_args_size = varargs_pretend_bytes;
}
-#endif
/* Determine parm's home in the stack,
in case it arrives in the stack or we should pretend it did.
@@ -4457,7 +4486,8 @@ assign_parms (tree fndecl)
#endif
if (!in_regs && !named_arg)
{
- int pretend_named = PRETEND_OUTGOING_VARARGS_NAMED;
+ int pretend_named =
+ targetm.calls.pretend_outgoing_varargs_named (&args_so_far);
if (pretend_named)
{
#ifdef FUNCTION_INCOMING_ARG
@@ -4479,8 +4509,43 @@ assign_parms (tree fndecl)
#ifdef FUNCTION_ARG_PARTIAL_NREGS
if (entry_parm)
- partial = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, promoted_mode,
- passed_type, named_arg);
+ {
+ partial = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, promoted_mode,
+ passed_type, named_arg);
+ if (partial
+#ifndef MAYBE_REG_PARM_STACK_SPACE
+ /* The caller might already have allocated stack space
+ for the register parameters. */
+ && reg_parm_stack_space == 0
+#endif
+ )
+ {
+ /* Part of this argument is passed in registers and part
+ is passed on the stack. Ask the prologue code to extend
+ the stack part so that we can recreate the full value.
+
+ PRETEND_BYTES is the size of the registers we need to store.
+ CURRENT_FUNCTION_PRETEND_ARGS_SIZE is the amount of extra
+ stack space that the prologue should allocate.
+
+ Internally, gcc assumes that the argument pointer is
+ aligned to STACK_BOUNDARY bits. This is used both for
+ alignment optimisations (see init_emit) and to locate
+ arguments that are aligned to more than PARM_BOUNDARY
+ bits. We must preserve this invariant by rounding
+ CURRENT_FUNCTION_PRETEND_ARGS_SIZE up to a stack
+ boundary. */
+ pretend_bytes = partial * UNITS_PER_WORD;
+ current_function_pretend_args_size
+ = CEIL_ROUND (pretend_bytes, STACK_BYTES);
+
+ /* If PRETEND_BYTES != CURRENT_FUNCTION_PRETEND_ARGS_SIZE,
+ insert the padding before the start of the first pretend
+ argument. */
+ stack_args_size.constant
+ = (current_function_pretend_args_size - pretend_bytes);
+ }
+ }
#endif
memset (&locate, 0, sizeof (locate));
@@ -4507,6 +4572,8 @@ assign_parms (tree fndecl)
offset_rtx));
set_mem_attributes (stack_parm, parm, 1);
+ if (entry_parm && MEM_ATTRS (stack_parm)->align < PARM_BOUNDARY)
+ set_mem_align (stack_parm, PARM_BOUNDARY);
/* Set also REG_ATTRS if parameter was passed in a register. */
if (entry_parm)
@@ -4523,21 +4590,11 @@ assign_parms (tree fndecl)
if (partial)
{
-#ifndef MAYBE_REG_PARM_STACK_SPACE
- /* When REG_PARM_STACK_SPACE is nonzero, stack space for
- split parameters was allocated by our caller, so we
- won't be pushing it in the prolog. */
- if (reg_parm_stack_space == 0)
-#endif
- current_function_pretend_args_size
- = (((partial * UNITS_PER_WORD) + (PARM_BOUNDARY / BITS_PER_UNIT) - 1)
- / (PARM_BOUNDARY / BITS_PER_UNIT)
- * (PARM_BOUNDARY / BITS_PER_UNIT));
-
/* Handle calls that pass values in multiple non-contiguous
locations. The Irix 6 ABI has examples of this. */
if (GET_CODE (entry_parm) == PARALLEL)
emit_group_store (validize_mem (stack_parm), entry_parm,
+ TREE_TYPE (parm),
int_size_in_bytes (TREE_TYPE (parm)));
else
@@ -4576,10 +4633,7 @@ assign_parms (tree fndecl)
#endif
)
{
- stack_args_size.constant += locate.size.constant;
- /* locate.size doesn't include the part in regs. */
- if (partial)
- stack_args_size.constant += current_function_pretend_args_size;
+ stack_args_size.constant += pretend_bytes + locate.size.constant;
if (locate.size.var)
ADD_PARM_SIZE (stack_args_size, locate.size.var);
}
@@ -4644,7 +4698,12 @@ assign_parms (tree fndecl)
Set DECL_RTL to that place. */
- if (nominal_mode == BLKmode || GET_CODE (entry_parm) == PARALLEL)
+ if (nominal_mode == BLKmode
+#ifdef BLOCK_REG_PADDING
+ || (locate.where_pad == (BYTES_BIG_ENDIAN ? upward : downward)
+ && GET_MODE_SIZE (promoted_mode) < UNITS_PER_WORD)
+#endif
+ || GET_CODE (entry_parm) == PARALLEL)
{
/* If a BLKmode arrives in registers, copy it to a stack slot.
Handle calls that pass values in multiple non-contiguous
@@ -4666,9 +4725,8 @@ assign_parms (tree fndecl)
if (stack_parm == 0)
{
- stack_parm
- = assign_stack_local (GET_MODE (entry_parm),
- size_stored, 0);
+ stack_parm = assign_stack_local (BLKmode, size_stored, 0);
+ PUT_MODE (stack_parm, GET_MODE (entry_parm));
set_mem_attributes (stack_parm, parm, 1);
}
@@ -4680,7 +4738,7 @@ assign_parms (tree fndecl)
/* Handle calls that pass values in multiple non-contiguous
locations. The Irix 6 ABI has examples of this. */
if (GET_CODE (entry_parm) == PARALLEL)
- emit_group_store (mem, entry_parm, size);
+ emit_group_store (mem, entry_parm, TREE_TYPE (parm), size);
else if (size == 0)
;
@@ -4692,7 +4750,13 @@ assign_parms (tree fndecl)
enum machine_mode mode
= mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
- if (mode != BLKmode)
+ if (mode != BLKmode
+#ifdef BLOCK_REG_PADDING
+ && (size == UNITS_PER_WORD
+ || (BLOCK_REG_PADDING (mode, TREE_TYPE (parm), 1)
+ != (BYTES_BIG_ENDIAN ? upward : downward)))
+#endif
+ )
{
rtx reg = gen_rtx_REG (mode, REGNO (entry_parm));
emit_move_insn (change_address (mem, mode, 0), reg);
@@ -4703,7 +4767,13 @@ assign_parms (tree fndecl)
to memory. Note that the previous test doesn't
handle all cases (e.g. SIZE == 3). */
else if (size != UNITS_PER_WORD
- && BYTES_BIG_ENDIAN)
+#ifdef BLOCK_REG_PADDING
+ && (BLOCK_REG_PADDING (mode, TREE_TYPE (parm), 1)
+ == downward)
+#else
+ && BYTES_BIG_ENDIAN
+#endif
+ )
{
rtx tem, x;
int by = (UNITS_PER_WORD - size) * BITS_PER_UNIT;
@@ -4812,7 +4882,7 @@ assign_parms (tree fndecl)
/* TREE_USED gets set erroneously during expand_assignment. */
save_tree_used = TREE_USED (parm);
expand_assignment (parm,
- make_tree (nominal_type, tempreg), 0, 0);
+ make_tree (nominal_type, tempreg), 0);
TREE_USED (parm) = save_tree_used;
conversion_insns = get_insns ();
did_conversion = 1;
@@ -4924,10 +4994,10 @@ assign_parms (tree fndecl)
but it's also rare and we need max_parm_reg to be
precisely correct. */
max_parm_reg = regno + 1;
- new = (rtx *) ggc_realloc (parm_reg_stack_loc,
- max_parm_reg * sizeof (rtx));
- memset ((char *) (new + old_max_parm_reg), 0,
- (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
+ 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;
}
@@ -5072,15 +5142,11 @@ assign_parms (tree fndecl)
}
}
- if (SPLIT_COMPLEX_ARGS)
+ if (SPLIT_COMPLEX_ARGS && fnargs != orig_fnargs)
{
- parm = orig_fnargs;
-
- for (; parm; parm = TREE_CHAIN (parm))
+ for (parm = orig_fnargs; parm; parm = TREE_CHAIN (parm))
{
- tree type = TREE_TYPE (parm);
-
- if (TREE_CODE (type) == COMPLEX_TYPE)
+ if (TREE_CODE (TREE_TYPE (parm)) == COMPLEX_TYPE)
{
SET_DECL_RTL (parm,
gen_rtx_CONCAT (DECL_MODE (parm),
@@ -5115,11 +5181,7 @@ assign_parms (tree fndecl)
rtx addr = DECL_RTL (function_result_decl);
rtx x;
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (addr) != Pmode)
- addr = convert_memory_address (Pmode, addr);
-#endif
-
+ addr = convert_memory_address (Pmode, addr);
x = gen_rtx_MEM (DECL_MODE (result), addr);
set_mem_attributes (x, result, 1);
SET_DECL_RTL (result, x);
@@ -5139,8 +5201,6 @@ assign_parms (tree fndecl)
#endif
#endif
-#define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT)
-
current_function_args_size
= ((current_function_args_size + STACK_BYTES - 1)
/ STACK_BYTES) * STACK_BYTES;
@@ -5205,30 +5265,49 @@ assign_parms (tree fndecl)
}
}
+/* If ARGS contains entries with complex types, split the entry into two
+ entries of the component type. Return a new list of substitutions are
+ needed, else the old list. */
+
static tree
split_complex_args (tree args)
{
tree p;
+ /* Before allocating memory, check for the common case of no complex. */
+ for (p = args; p; p = TREE_CHAIN (p))
+ if (TREE_CODE (TREE_TYPE (p)) == COMPLEX_TYPE)
+ goto found;
+ return args;
+
+ found:
args = copy_list (args);
for (p = args; p; p = TREE_CHAIN (p))
{
- tree complex_type = TREE_TYPE (p);
-
- if (TREE_CODE (complex_type) == COMPLEX_TYPE)
+ tree type = TREE_TYPE (p);
+ if (TREE_CODE (type) == COMPLEX_TYPE)
{
tree decl;
- tree subtype = TREE_TYPE (complex_type);
+ tree subtype = TREE_TYPE (type);
/* Rewrite the PARM_DECL's type with its component. */
TREE_TYPE (p) = subtype;
DECL_ARG_TYPE (p) = TREE_TYPE (DECL_ARG_TYPE (p));
+ DECL_MODE (p) = VOIDmode;
+ DECL_SIZE (p) = NULL;
+ DECL_SIZE_UNIT (p) = NULL;
+ layout_decl (p, 0);
+ /* Build a second synthetic decl. */
decl = build_decl (PARM_DECL, NULL_TREE, subtype);
DECL_ARG_TYPE (decl) = DECL_ARG_TYPE (p);
+ layout_decl (decl, 0);
+
+ /* Splice it in; skip the new decl. */
TREE_CHAIN (decl) = TREE_CHAIN (p);
TREE_CHAIN (p) = decl;
+ p = decl;
}
}
@@ -5241,8 +5320,6 @@ split_complex_args (tree args)
that REGNO is promoted from and whether the promotion was signed or
unsigned. */
-#ifdef PROMOTE_FUNCTION_ARGS
-
rtx
promoted_input_arg (unsigned int regno, enum machine_mode *pmode, int *punsignedp)
{
@@ -5270,7 +5347,6 @@ promoted_input_arg (unsigned int regno, enum machine_mode *pmode, int *punsigned
return 0;
}
-#endif
/* Compute the size and offset from the start of the stacked arguments for a
parm passed in mode PASSED_MODE and with type TYPE.
@@ -5352,6 +5428,7 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
= type ? size_in_bytes (type) : size_int (GET_MODE_SIZE (passed_mode));
where_pad = FUNCTION_ARG_PADDING (passed_mode, type);
boundary = FUNCTION_ARG_BOUNDARY (passed_mode, type);
+ locate->where_pad = where_pad;
#ifdef ARGS_GROW_DOWNWARD
locate->slot_offset.constant = -initial_offset_ptr->constant;
@@ -5528,19 +5605,19 @@ uninitialized_vars_warning (tree block)
with a nonzero DECL_INITIAL had an initializer, so do not
claim it is potentially uninitialized.
- We do not care about the actual value in DECL_INITIAL, so we do
- not worry that it may be a dangling pointer. */
- && DECL_INITIAL (decl) == NULL_TREE
+ When the DECL_INITIAL is NULL call the language hook to tell us
+ if we want to warn. */
+ && (DECL_INITIAL (decl) == NULL_TREE || lang_hooks.decl_uninit (decl))
&& regno_uninitialized (REGNO (DECL_RTL (decl))))
- warning_with_decl (decl,
- "`%s' might be used uninitialized in this function");
+ warning ("%J'%D' might be used uninitialized in this function",
+ decl, decl);
if (extra_warnings
&& TREE_CODE (decl) == VAR_DECL
&& DECL_RTL (decl) != 0
&& GET_CODE (DECL_RTL (decl)) == REG
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
- warning_with_decl (decl,
- "variable `%s' might be clobbered by `longjmp' or `vfork'");
+ warning ("%Jvariable '%D' might be clobbered by `longjmp' or `vfork'",
+ decl, decl);
}
for (sub = BLOCK_SUBBLOCKS (block); sub; sub = TREE_CHAIN (sub))
uninitialized_vars_warning (sub);
@@ -5558,8 +5635,8 @@ setjmp_args_warning (void)
if (DECL_RTL (decl) != 0
&& GET_CODE (DECL_RTL (decl)) == REG
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
- warning_with_decl (decl,
- "argument `%s' might be clobbered by `longjmp' or `vfork'");
+ warning ("%Jargument '%D' might be clobbered by `longjmp' or `vfork'",
+ decl, decl);
}
/* If this function call setjmp, put all vars into the stack
@@ -5849,7 +5926,7 @@ identify_blocks (void)
/* Fill the BLOCK_VECTOR with all of the BLOCKs in this function, in
depth-first order. */
block_vector = get_block_vector (block, &n_blocks);
- block_stack = (tree *) xmalloc (n_blocks * sizeof (tree));
+ block_stack = xmalloc (n_blocks * sizeof (tree));
last_block_vector = identify_blocks_1 (get_insns (),
block_vector + 1,
@@ -6153,7 +6230,7 @@ get_block_vector (tree block, int *n_blocks_p)
tree *block_vector;
*n_blocks_p = all_blocks (block, NULL);
- block_vector = (tree *) xmalloc (*n_blocks_p * sizeof (tree));
+ block_vector = xmalloc (*n_blocks_p * sizeof (tree));
all_blocks (block, block_vector);
return block_vector;
@@ -6211,103 +6288,77 @@ debug_find_var_in_block_tree (tree var, tree block)
return NULL_TREE;
}
-/* Allocate a function structure and reset its contents to the defaults. */
+/* Allocate a function structure for FNDECL and set its contents
+ to the defaults. */
-static void
-prepare_function_start (void)
+void
+allocate_struct_function (tree fndecl)
{
- cfun = (struct function *) ggc_alloc_cleared (sizeof (struct function));
+ tree result;
- init_stmt_for_function ();
- init_eh_for_function ();
-
- cse_not_expected = ! optimize;
-
- /* Caller save not needed yet. */
- caller_save_needed = 0;
-
- /* No stack slots have been made yet. */
- stack_slot_list = 0;
+ cfun = ggc_alloc_cleared (sizeof (struct function));
- current_function_has_nonlocal_label = 0;
- current_function_has_nonlocal_goto = 0;
-
- /* There is no stack slot for handling nonlocal gotos. */
- nonlocal_goto_handler_slots = 0;
- nonlocal_goto_stack_level = 0;
+ max_parm_reg = LAST_VIRTUAL_REGISTER + 1;
- /* No labels have been declared for nonlocal use. */
- nonlocal_labels = 0;
- nonlocal_goto_handler_labels = 0;
+ cfun->stack_alignment_needed = STACK_BOUNDARY;
+ cfun->preferred_stack_boundary = STACK_BOUNDARY;
- /* No function calls so far in this function. */
- function_call_count = 0;
+ current_function_funcdef_no = funcdef_no++;
- /* No parm regs have been allocated.
- (This is important for output_inline_function.) */
- max_parm_reg = LAST_VIRTUAL_REGISTER + 1;
+ cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL;
- /* Initialize the RTL mechanism. */
+ init_stmt_for_function ();
+ init_eh_for_function ();
init_emit ();
-
- /* Initialize the queue of pending postincrement and postdecrements,
- and some other info in expr.c. */
init_expr ();
-
- /* We haven't done register allocation yet. */
- reg_renumber = 0;
-
init_varasm_status (cfun);
- /* Clear out data used for inlining. */
- cfun->inlinable = 0;
- cfun->original_decl_initial = 0;
- cfun->original_arg_vector = 0;
+ (*lang_hooks.function.init) (cfun);
+ if (init_machine_status)
+ cfun->machine = (*init_machine_status) ();
- cfun->stack_alignment_needed = STACK_BOUNDARY;
- cfun->preferred_stack_boundary = STACK_BOUNDARY;
+ if (fndecl == NULL)
+ return;
- /* Set if a call to setjmp is seen. */
- current_function_calls_setjmp = 0;
+ DECL_SAVED_INSNS (fndecl) = cfun;
+ cfun->decl = fndecl;
- /* Set if a call to longjmp is seen. */
- current_function_calls_longjmp = 0;
+ current_function_name = (*lang_hooks.decl_printable_name) (fndecl, 2);
- current_function_calls_alloca = 0;
- current_function_calls_eh_return = 0;
- current_function_calls_constant_p = 0;
- current_function_contains_functions = 0;
- current_function_is_leaf = 0;
- current_function_nothrow = 0;
- current_function_sp_is_unchanging = 0;
- current_function_uses_only_leaf_regs = 0;
- current_function_has_computed_jump = 0;
- current_function_is_thunk = 0;
+ result = DECL_RESULT (fndecl);
+ if (aggregate_value_p (result, fndecl))
+ {
+#ifdef PCC_STATIC_STRUCT_RETURN
+ current_function_returns_pcc_struct = 1;
+#endif
+ current_function_returns_struct = 1;
+ }
- current_function_returns_pcc_struct = 0;
- current_function_returns_struct = 0;
- current_function_epilogue_delay_list = 0;
- current_function_uses_const_pool = 0;
- current_function_uses_pic_offset_table = 0;
- current_function_cannot_inline = 0;
+ current_function_returns_pointer = POINTER_TYPE_P (TREE_TYPE (result));
- /* We have not yet needed to make a label to jump to for tail-recursion. */
- tail_recursion_label = 0;
+ current_function_needs_context
+ = (decl_function_context (current_function_decl) != 0
+ && ! DECL_NO_STATIC_CHAIN (current_function_decl));
+}
- /* We haven't had a need to make a save area for ap yet. */
- arg_pointer_save_area = 0;
+/* Reset cfun, and other non-struct-function variables to defaults as
+ appropriate for emiiting rtl at the start of a function. */
- /* No stack slots allocated yet. */
- frame_offset = 0;
+static void
+prepare_function_start (tree fndecl)
+{
+ if (fndecl && DECL_SAVED_INSNS (fndecl))
+ cfun = DECL_SAVED_INSNS (fndecl);
+ else
+ allocate_struct_function (fndecl);
- /* No SAVE_EXPRs in this function yet. */
- save_expr_regs = 0;
+ cse_not_expected = ! optimize;
- /* No RTL_EXPRs in this function yet. */
- rtl_expr_chain = 0;
+ /* Caller save not needed yet. */
+ caller_save_needed = 0;
- /* Set up to allocate temporaries. */
- init_temp_slots ();
+ /* We haven't done register allocation yet. */
+ reg_renumber = 0;
/* Indicate that we need to distinguish between the return value of the
present function and the return value of a function being called. */
@@ -6321,27 +6372,6 @@ prepare_function_start (void)
/* Indicate we have no need of a frame pointer yet. */
frame_pointer_needed = 0;
-
- /* By default assume not stdarg. */
- current_function_stdarg = 0;
-
- /* We haven't made any trampolines for this function yet. */
- trampoline_list = 0;
-
- init_pending_stack_adjust ();
- inhibit_defer_pop = 0;
-
- current_function_outgoing_args_size = 0;
-
- current_function_funcdef_no = funcdef_no++;
-
- cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL;
-
- cfun->max_jumptable_ents = 0;
-
- (*lang_hooks.function.init) (cfun);
- if (init_machine_status)
- cfun->machine = (*init_machine_status) ();
}
/* Initialize the rtl expansion mechanism so that we can do simple things
@@ -6350,7 +6380,7 @@ prepare_function_start (void)
void
init_dummy_function_start (void)
{
- prepare_function_start ();
+ prepare_function_start (NULL);
}
/* Generate RTL for the start of the function SUBR (a FUNCTION_DECL tree node)
@@ -6360,16 +6390,7 @@ init_dummy_function_start (void)
void
init_function_start (tree subr)
{
- prepare_function_start ();
-
- current_function_name = (*lang_hooks.decl_printable_name) (subr, 2);
- cfun->decl = subr;
-
- /* Nonzero if this is a nested function that uses a static chain. */
-
- current_function_needs_context
- = (decl_function_context (current_function_decl) != 0
- && ! DECL_NO_STATIC_CHAIN (current_function_decl));
+ prepare_function_start (subr);
/* Within function body, compute a type's size as soon it is laid out. */
immediate_size_expand++;
@@ -6386,23 +6407,11 @@ init_function_start (tree subr)
Also, final expects a note to appear there. */
emit_note (NOTE_INSN_DELETED);
- /* Set flags used by final.c. */
- if (aggregate_value_p (DECL_RESULT (subr)))
- {
-#ifdef PCC_STATIC_STRUCT_RETURN
- current_function_returns_pcc_struct = 1;
-#endif
- current_function_returns_struct = 1;
- }
-
/* Warn if this value is an aggregate type,
regardless of which calling convention we are using for it. */
if (warn_aggregate_return
&& AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr))))
warning ("function returns an aggregate");
-
- current_function_returns_pointer
- = POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (subr)));
}
/* Make sure all values used by the optimization passes have sane
@@ -6548,7 +6557,7 @@ expand_function_start (tree subr, int parms_have_cleanups)
before any library calls that assign parms might generate. */
/* Decide whether to return the value in memory or in a register. */
- if (aggregate_value_p (DECL_RESULT (subr)))
+ if (aggregate_value_p (DECL_RESULT (subr), subr))
{
/* Returning something that won't go in a register. */
rtx value_address = 0;
@@ -6562,13 +6571,14 @@ expand_function_start (tree subr, int parms_have_cleanups)
else
#endif
{
+ rtx sv = targetm.calls.struct_value_rtx (TREE_TYPE (subr), 1);
/* Expect to be passed the address of a place to store the value.
If it is passed as an argument, assign_parms will take care of
it. */
- if (struct_value_incoming_rtx)
+ if (sv)
{
value_address = gen_reg_rtx (Pmode);
- emit_move_insn (value_address, struct_value_incoming_rtx);
+ emit_move_insn (value_address, sv);
}
}
if (value_address)
@@ -6884,7 +6894,7 @@ expand_function_end (void)
decl; decl = TREE_CHAIN (decl))
if (! TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
&& DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl))
- warning_with_decl (decl, "unused parameter `%s'");
+ warning ("%Junused parameter '%D'", decl, decl);
}
/* Delete handlers for nonlocal gotos if nothing uses them. */
@@ -7005,10 +7015,9 @@ expand_function_end (void)
{
int unsignedp = TREE_UNSIGNED (TREE_TYPE (decl_result));
-#ifdef PROMOTE_FUNCTION_RETURN
- promote_mode (TREE_TYPE (decl_result), GET_MODE (decl_rtl),
- &unsignedp, 1);
-#endif
+ if (targetm.calls.promote_function_return (TREE_TYPE (current_function_decl)))
+ promote_mode (TREE_TYPE (decl_result), GET_MODE (decl_rtl),
+ &unsignedp, 1);
convert_move (real_decl_rtl, decl_rtl, unsignedp);
}
@@ -7021,6 +7030,7 @@ expand_function_end (void)
emit_group_move (real_decl_rtl, decl_rtl);
else
emit_group_load (real_decl_rtl, decl_rtl,
+ TREE_TYPE (decl_result),
int_size_in_bytes (TREE_TYPE (decl_result)));
}
else
@@ -7053,12 +7063,9 @@ expand_function_end (void)
assignment and USE below when inlining this function. */
REG_FUNCTION_VALUE_P (outgoing) = 1;
-#ifdef POINTERS_EXTEND_UNSIGNED
/* The address may be ptr_mode and OUTGOING may be Pmode. */
- if (GET_MODE (outgoing) != GET_MODE (value_address))
- value_address = convert_memory_address (GET_MODE (outgoing),
- value_address);
-#endif
+ value_address = convert_memory_address (GET_MODE (outgoing),
+ value_address);
emit_move_insn (outgoing, value_address);
diff --git a/gcc/function.h b/gcc/function.h
index 4f5b51f8d9c..9c06d95a095 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -19,6 +19,9 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+#ifndef GCC_FUNCTION_H
+#define GCC_FUNCTION_H
+
struct var_refs_queue GTY(())
{
rtx modified;
@@ -389,6 +392,23 @@ struct function GTY(())
delay list for them is recorded here. */
rtx epilogue_delay_list;
+ /* How commonly executed the function is. Initialized during branch
+ probabilities pass. */
+ enum function_frequency {
+ /* This function most likely won't be executed at all.
+ (set only when profile feedback is available). */
+ FUNCTION_FREQUENCY_UNLIKELY_EXECUTED,
+ /* The default value. */
+ FUNCTION_FREQUENCY_NORMAL,
+ /* Optimize this function hard
+ (set only when profile feedback is available). */
+ FUNCTION_FREQUENCY_HOT
+ } function_frequency;
+
+ /* Maximal number of entities in the single jumptable. Used to estimate
+ final flowgraph size. */
+ int max_jumptable_ents;
+
/* Collected bit flags. */
/* Nonzero if function being compiled needs to be given an address
@@ -488,22 +508,12 @@ struct function GTY(())
/* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
unsigned int arg_pointer_save_area_init : 1;
- /* How commonly executed the function is. Initialized during branch
- probabilities pass. */
- enum function_frequency {
- /* This function most likely won't be executed at all.
- (set only when profile feedback is available). */
- FUNCTION_FREQUENCY_UNLIKELY_EXECUTED,
- /* The default value. */
- FUNCTION_FREQUENCY_NORMAL,
- /* Optimize this function hard
- (set only when profile feedback is available). */
- FUNCTION_FREQUENCY_HOT
- } function_frequency;
+ /* Flag for use by ther rtl inliner, to tell if the function has been
+ processed at least once. */
+ unsigned int rtl_inline_init : 1;
- /* Maximal number of entities in the single jumptable. Used to estimate
- final flowgraph size. */
- int max_jumptable_ents;
+ /* Nonzero if the rtl inliner has saved the function for inlining. */
+ unsigned int saved_for_inline : 1;
};
/* The function currently being compiled. */
@@ -621,3 +631,5 @@ extern void init_virtual_regs (struct emit_status *);
/* Called once, at initialization, to initialize function.c. */
extern void init_function_once (void);
+
+#endif /* GCC_FUNCTION_H */
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 0f59b27ba2d..31f3d43bbee 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -755,7 +755,7 @@ static const char *cpp_unique_options =
in turn cause preprocessor symbols to be defined specially. */
static const char *cpp_options =
"%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*}\
- %{O*} %{undef}";
+ %{g*} %{O*} %{undef}";
/* This contains cpp options which are not passed when the preprocessor
output will be used by another program. */
@@ -1107,8 +1107,7 @@ translate_options (int *argcp, const char *const **argvp)
int argc = *argcp;
const char *const *argv = *argvp;
int newvsize = (argc + 2) * 2 * sizeof (const char *);
- const char **newv =
- (const char **) xmalloc (newvsize);
+ const char **newv = xmalloc (newvsize);
int newindex = 0;
i = 0;
@@ -1138,7 +1137,7 @@ translate_options (int *argcp, const char *const **argvp)
}
newvsize += spaces * sizeof (const char *);
- newv = (const char **) xrealloc (newv, newvsize);
+ newv = xrealloc (newv, newvsize);
sp = target_option_translations[tott_idx].replacements;
np = xstrdup (sp);
@@ -1380,6 +1379,10 @@ static const char *just_machine_suffix = 0;
static const char *gcc_exec_prefix;
+/* Adjusted value of standard_libexec_prefix. */
+
+static const char *gcc_libexec_prefix;
+
/* Default prefixes to attach to command names. */
#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
@@ -1399,23 +1402,9 @@ static const char *gcc_exec_prefix;
#define MD_STARTFILE_PREFIX_1 ""
#endif
-/* Supply defaults for the standard prefixes. */
-
-#ifndef STANDARD_EXEC_PREFIX
-#define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-lib/"
-#endif
-#ifndef STANDARD_STARTFILE_PREFIX
-#define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
-#endif
-#ifndef TOOLDIR_BASE_PREFIX
-#define TOOLDIR_BASE_PREFIX "/usr/local/"
-#endif
-#ifndef STANDARD_BINDIR_PREFIX
-#define STANDARD_BINDIR_PREFIX "/usr/local/bin"
-#endif
-
static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
-static const char *const standard_exec_prefix_1 = "/usr/lib/gcc/";
+static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
+static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
static const char *md_exec_prefix = MD_EXEC_PREFIX;
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
@@ -1429,6 +1418,8 @@ static const char *tooldir_prefix;
static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+static const char *standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
+
/* Subdirectory to use for locating libraries. Set by
set_multilib_dir based on the compilation options. */
@@ -1574,8 +1565,8 @@ init_spec (void)
notice ("Using built-in specs.\n");
#ifdef EXTRA_SPECS
- extra_specs = (struct spec_list *)
- xcalloc (sizeof (struct spec_list), ARRAY_SIZE (extra_specs_1));
+ extra_specs = xcalloc (sizeof (struct spec_list),
+ ARRAY_SIZE (extra_specs_1));
for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--)
{
@@ -1733,7 +1724,7 @@ set_spec (const char *name, const char *spec)
if (!sl)
{
/* Not found - make it. */
- sl = (struct spec_list *) xmalloc (sizeof (struct spec_list));
+ sl = xmalloc (sizeof (struct spec_list));
sl->name = xstrdup (name);
sl->name_len = name_len;
sl->ptr_spec = &sl->ptr;
@@ -1805,7 +1796,7 @@ static void
alloc_args (void)
{
argbuf_length = 10;
- argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *));
+ argbuf = xmalloc (argbuf_length * sizeof (const char *));
}
/* Clear out the vector of arguments (after a command is executed). */
@@ -1827,9 +1818,7 @@ static void
store_arg (const char *arg, int delete_always, int delete_failure)
{
if (argbuf_index + 1 == argbuf_length)
- argbuf
- = (const char **) xrealloc (argbuf,
- (argbuf_length *= 2) * sizeof (const char *));
+ argbuf = xrealloc (argbuf, (argbuf_length *= 2) * sizeof (const char *));
argbuf[argbuf_index++] = arg;
argbuf[argbuf_index] = 0;
@@ -2119,9 +2108,8 @@ read_specs (const char *filename, int main_p)
{
/* Add this pair to the vector. */
compilers
- = ((struct compiler *)
- xrealloc (compilers,
- (n_compilers + 2) * sizeof (struct compiler)));
+ = xrealloc (compilers,
+ (n_compilers + 2) * sizeof (struct compiler));
compilers[n_compilers].suffix = suffix;
compilers[n_compilers].spec = spec;
@@ -2188,7 +2176,7 @@ record_temp_file (const char *filename, int always_delete, int fail_delete)
if (! strcmp (name, temp->name))
goto already1;
- temp = (struct temp_file *) xmalloc (sizeof (struct temp_file));
+ temp = xmalloc (sizeof (struct temp_file));
temp->next = always_delete_queue;
temp->name = name;
always_delete_queue = temp;
@@ -2203,7 +2191,7 @@ record_temp_file (const char *filename, int always_delete, int fail_delete)
if (! strcmp (name, temp->name))
goto already2;
- temp = (struct temp_file *) xmalloc (sizeof (struct temp_file));
+ temp = xmalloc (sizeof (struct temp_file));
temp->next = failure_delete_queue;
temp->name = name;
failure_delete_queue = temp;
@@ -2553,7 +2541,7 @@ add_prefix (struct path_prefix *pprefix, const char *prefix,
if (len > pprefix->max_len)
pprefix->max_len = len;
- pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
+ pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = prefix;
pl->require_machine_suffix = require_machine_suffix;
pl->used_flag_ptr = warn;
@@ -2622,7 +2610,7 @@ execute (void)
n_commands++;
/* Get storage for each command. */
- commands = (struct command *) alloca (n_commands * sizeof (struct command));
+ commands = alloca (n_commands * sizeof (struct command));
/* Split argbuf into its separate piped processes,
and record info about each one.
@@ -2891,6 +2879,11 @@ static struct infile *infiles;
int n_infiles;
+/* True if multiple input files are being compiled to a single
+ assembly file. */
+
+static bool combine_inputs;
+
/* This counts the number of libraries added by lang_specific_driver, so that
we can tell if there were any user supplied any files or libraries. */
@@ -3029,12 +3022,10 @@ add_preprocessor_option (const char *option, int len)
n_preprocessor_options++;
if (! preprocessor_options)
- preprocessor_options
- = (char **) xmalloc (n_preprocessor_options * sizeof (char *));
+ preprocessor_options = xmalloc (n_preprocessor_options * sizeof (char *));
else
- preprocessor_options
- = (char **) xrealloc (preprocessor_options,
- n_preprocessor_options * sizeof (char *));
+ preprocessor_options = xrealloc (preprocessor_options,
+ n_preprocessor_options * sizeof (char *));
preprocessor_options [n_preprocessor_options - 1] =
save_string (option, len);
@@ -3046,12 +3037,10 @@ add_assembler_option (const char *option, int len)
n_assembler_options++;
if (! assembler_options)
- assembler_options
- = (char **) xmalloc (n_assembler_options * sizeof (char *));
+ assembler_options = xmalloc (n_assembler_options * sizeof (char *));
else
- assembler_options
- = (char **) xrealloc (assembler_options,
- n_assembler_options * sizeof (char *));
+ assembler_options = xrealloc (assembler_options,
+ n_assembler_options * sizeof (char *));
assembler_options [n_assembler_options - 1] = save_string (option, len);
}
@@ -3062,12 +3051,10 @@ add_linker_option (const char *option, int len)
n_linker_options++;
if (! linker_options)
- linker_options
- = (char **) xmalloc (n_linker_options * sizeof (char *));
+ linker_options = xmalloc (n_linker_options * sizeof (char *));
else
- linker_options
- = (char **) xrealloc (linker_options,
- n_linker_options * sizeof (char *));
+ linker_options = xrealloc (linker_options,
+ n_linker_options * sizeof (char *));
linker_options [n_linker_options - 1] = save_string (option, len);
}
@@ -3168,34 +3155,43 @@ process_command (int argc, const char *const *argv)
/* Set up the default search paths. If there is no GCC_EXEC_PREFIX,
see if we can create it from the pathname specified in argv[0]. */
+ gcc_libexec_prefix = standard_libexec_prefix;
#ifndef VMS
/* FIXME: make_relative_prefix doesn't yet work for VMS. */
if (!gcc_exec_prefix)
{
gcc_exec_prefix = make_relative_prefix (argv[0], standard_bindir_prefix,
standard_exec_prefix);
+ gcc_libexec_prefix = make_relative_prefix (argv[0],
+ standard_bindir_prefix,
+ standard_libexec_prefix);
if (gcc_exec_prefix)
putenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL));
}
+ else
+ gcc_libexec_prefix = make_relative_prefix (gcc_exec_prefix,
+ standard_exec_prefix,
+ standard_libexec_prefix);
+#else
#endif
if (gcc_exec_prefix)
{
int len = strlen (gcc_exec_prefix);
- if (len > (int) sizeof ("/lib/gcc-lib/") - 1
+ if (len > (int) sizeof ("/lib/gcc/") - 1
&& (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1])))
{
- temp = gcc_exec_prefix + len - sizeof ("/lib/gcc-lib/") + 1;
+ temp = gcc_exec_prefix + len - sizeof ("/lib/gcc/") + 1;
if (IS_DIR_SEPARATOR (*temp)
&& strncmp (temp + 1, "lib", 3) == 0
&& IS_DIR_SEPARATOR (temp[4])
- && strncmp (temp + 5, "gcc-lib", 7) == 0)
- len -= sizeof ("/lib/gcc-lib/") - 1;
+ && strncmp (temp + 5, "gcc", 3) == 0)
+ len -= sizeof ("/lib/gcc/") - 1;
}
set_std_prefix (gcc_exec_prefix, len);
- add_prefix (&exec_prefixes, gcc_exec_prefix, "GCC",
+ add_prefix (&exec_prefixes, gcc_libexec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 0, NULL, 0);
add_prefix (&startfile_prefixes, gcc_exec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 0, NULL, 0);
@@ -3208,7 +3204,7 @@ process_command (int argc, const char *const *argv)
if (temp)
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
@@ -3243,7 +3239,7 @@ process_command (int argc, const char *const *argv)
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
@@ -3276,7 +3272,7 @@ process_command (int argc, const char *const *argv)
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
@@ -3479,8 +3475,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
}
else if (strcmp (argv[i], "-specs") == 0)
{
- struct user_specs *user = (struct user_specs *)
- xmalloc (sizeof (struct user_specs));
+ struct user_specs *user = xmalloc (sizeof (struct user_specs));
if (++i >= argc)
fatal ("argument to `-specs' is missing");
@@ -3494,8 +3489,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
}
else if (strncmp (argv[i], "-specs=", 7) == 0)
{
- struct user_specs *user = (struct user_specs *)
- xmalloc (sizeof (struct user_specs));
+ struct user_specs *user = xmalloc (sizeof (struct user_specs));
if (strlen (argv[i]) == 7)
fatal ("argument to `-specs=' is missing");
@@ -3668,9 +3662,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
for (j = 0; j < ARRAY_SIZE (modify_target); j++)
if (! strcmp (argv[i], modify_target[j].sw))
{
- char *new_name
- = (char *) xmalloc (strlen (modify_target[j].str)
- + strlen (spec_machine));
+ char *new_name = xmalloc (strlen (modify_target[j].str)
+ + strlen (spec_machine));
const char *p, *r;
char *q;
int made_addition = 0;
@@ -3715,8 +3708,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
}
}
- if (have_c && have_o && lang_n_infiles > 1)
- fatal ("cannot specify -o with -c or -S and multiple compilations");
+ combine_inputs = (have_c && have_o && lang_n_infiles > 1);
if ((save_temps_flag || report_times) && use_pipes)
{
@@ -3738,17 +3730,21 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
/* Use 2 as fourth arg meaning try just the machine as a suffix,
as well as trying the machine and the version. */
#ifndef OS2
- add_prefix (&exec_prefixes, standard_exec_prefix, "GCC",
+ add_prefix (&exec_prefixes, standard_libexec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 1, warn_std_ptr, 0);
+ add_prefix (&exec_prefixes, standard_libexec_prefix, "BINUTILS",
+ PREFIX_PRIORITY_LAST, 2, warn_std_ptr, 0);
add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 2, warn_std_ptr, 0);
add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
PREFIX_PRIORITY_LAST, 2, warn_std_ptr, 0);
+ add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
+ PREFIX_PRIORITY_LAST, 2, warn_std_ptr, 0);
#endif
add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 1, warn_std_ptr, 0);
- add_prefix (&startfile_prefixes, standard_exec_prefix_1, "BINUTILS",
+ add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
PREFIX_PRIORITY_LAST, 1, warn_std_ptr, 0);
tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
@@ -3814,9 +3810,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
/* Then create the space for the vectors and scan again. */
- switches = ((struct switchstr *)
- xmalloc ((n_switches + 1) * sizeof (struct switchstr)));
- infiles = (struct infile *) xmalloc ((n_infiles + 1) * sizeof (struct infile));
+ switches = xmalloc ((n_switches + 1) * sizeof (struct switchstr));
+ infiles = xmalloc ((n_infiles + 1) * sizeof (struct infile));
n_switches = 0;
n_infiles = 0;
last_language_n_infiles = -1;
@@ -3965,7 +3960,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (i + n_args >= argc)
fatal ("argument to `-%s' is missing", p);
switches[n_switches].args
- = (const char **) xmalloc ((n_args + 1) * sizeof(const char *));
+ = xmalloc ((n_args + 1) * sizeof(const char *));
while (j < n_args)
switches[n_switches].args[j++] = argv[++i];
/* Null-terminate the vector. */
@@ -3975,13 +3970,12 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
{
/* On some systems, ld cannot handle some options without
a space. So split the option from its argument. */
- char *part1 = (char *) xmalloc (2);
+ char *part1 = xmalloc (2);
part1[0] = c;
part1[1] = '\0';
switches[n_switches].part1 = part1;
- switches[n_switches].args
- = (const char **) xmalloc (2 * sizeof (const char *));
+ switches[n_switches].args = xmalloc (2 * sizeof (const char *));
switches[n_switches].args[0] = xstrdup (p+1);
switches[n_switches].args[1] = 0;
}
@@ -4449,7 +4443,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
struct prefix_list *pl = startfile_prefixes.plist;
size_t bufsize = 100;
- char *buffer = (char *) xmalloc (bufsize);
+ char *buffer = xmalloc (bufsize);
int idx;
for (; pl; pl = pl->next)
@@ -4477,7 +4471,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
>= bufsize)
bufsize = (strlen (pl->prefix)
+ strlen (machine_suffix)) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix);
strcat (buffer, machine_suffix);
if (is_directory (buffer, multilib_dir, 1))
@@ -4519,7 +4513,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
/* Remove slash from machine_suffix. */
if (strlen (machine_suffix) >= bufsize)
bufsize = strlen (machine_suffix) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, machine_suffix);
idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1]))
@@ -4540,7 +4534,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
/* Remove slash from pl->prefix. */
if (strlen (pl->prefix) >= bufsize)
bufsize = strlen (pl->prefix) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix);
idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1]))
@@ -4563,7 +4557,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
char *buf;
while (*p != 0 && *p != '\n')
p++;
- buf = (char *) alloca (p - q + 1);
+ buf = alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
error ("%s", buf);
@@ -4577,7 +4571,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
char *buf;
while (*p != 0 && *p != '\n')
p++;
- buf = (char *) alloca (p - q + 1);
+ buf = alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
notice ("%s\n", buf);
@@ -4659,8 +4653,8 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
else
{
saved_suffix
- = (char *) xmalloc (suffix_length
- + strlen (TARGET_OBJECT_SUFFIX));
+ = xmalloc (suffix_length
+ + strlen (TARGET_OBJECT_SUFFIX));
strncpy (saved_suffix, suffix, suffix_length);
strcpy (saved_suffix + suffix_length,
TARGET_OBJECT_SUFFIX);
@@ -4731,7 +4725,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
if (t == 0)
{
- t = (struct temp_name *) xmalloc (sizeof (struct temp_name));
+ t = xmalloc (sizeof (struct temp_name));
t->next = temp_names;
temp_names = t;
}
@@ -4760,8 +4754,16 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
break;
case 'i':
- obstack_grow (&obstack, input_filename, input_filename_length);
- arg_going = 1;
+ if (combine_inputs)
+ {
+ for (i = 0; (int) i < n_infiles; i++)
+ store_arg (infiles[i].name, 0, 0);
+ }
+ else
+ {
+ obstack_grow (&obstack, input_filename, input_filename_length);
+ arg_going = 1;
+ }
break;
case 'I':
@@ -5119,7 +5121,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
}
else
{
- char *x = (char *) alloca (strlen (name) * 2 + 1);
+ char *x = alloca (strlen (name) * 2 + 1);
char *buf = x;
const char *y = name;
int flag = 0;
@@ -5175,7 +5177,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
/* Backslash: treat next character as ordinary. */
c = *p++;
- /* fall through */
+ /* Fall through. */
default:
/* Ordinary character: put it into the current argument. */
obstack_1grow (&obstack, c);
@@ -5800,7 +5802,7 @@ is_directory (const char *path1, const char *path2, int linker)
{
int len1 = strlen (path1);
int len2 = strlen (path2);
- char *path = (char *) alloca (3 + len1 + len2);
+ char *path = alloca (3 + len1 + len2);
char *cp;
struct stat st;
@@ -6004,9 +6006,8 @@ main (int argc, const char *const *argv)
/* Initialize the vector of specs to just the default.
This means one element containing 0s, as a terminator. */
- compilers = (struct compiler *) xmalloc (sizeof default_compilers);
- memcpy ((char *) compilers, (char *) default_compilers,
- sizeof default_compilers);
+ compilers = xmalloc (sizeof default_compilers);
+ memcpy (compilers, default_compilers, sizeof default_compilers);
n_compilers = n_default_compilers;
/* Read specs from a file if there is one. */
@@ -6024,9 +6025,8 @@ main (int argc, const char *const *argv)
/* We need to check standard_exec_prefix/just_machine_suffix/specs
for any override of as, ld and libraries. */
- specs_file = (char *) alloca (strlen (standard_exec_prefix)
- + strlen (just_machine_suffix)
- + sizeof ("specs"));
+ specs_file = alloca (strlen (standard_exec_prefix)
+ + strlen (just_machine_suffix) + sizeof ("specs"));
strcpy (specs_file, standard_exec_prefix);
strcat (specs_file, just_machine_suffix);
@@ -6106,12 +6106,15 @@ main (int argc, const char *const *argv)
/* If standard_startfile_prefix is relative, base it on
standard_exec_prefix. This lets us move the installed tree
as a unit. If GCC_EXEC_PREFIX is defined, base
- standard_startfile_prefix on that as well. */
+ standard_startfile_prefix on that as well.
+
+ If the prefix is relative, only search it for native compilers;
+ otherwise we will search a directory containing host libraries. */
if (IS_ABSOLUTE_PATH (standard_startfile_prefix))
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 0, NULL, 1);
- else
+ else if (*cross_compile == '0')
{
if (gcc_exec_prefix)
add_prefix (&startfile_prefixes,
@@ -6285,13 +6288,34 @@ main (int argc, const char *const *argv)
i = n_infiles;
i += lang_specific_extra_outfiles;
- outfiles = (const char **) xcalloc (i, sizeof (char *));
+ outfiles = xcalloc (i, sizeof (char *));
/* Record which files were specified explicitly as link input. */
explicit_link_files = xcalloc (1, n_infiles);
- for (i = 0; (int) i < n_infiles; i++)
+ if (combine_inputs)
+ {
+ int lang_n_infiles = 0;
+ for (i = 0; (int) i < n_infiles; i++)
+ {
+ const char *name = infiles[i].name;
+ struct compiler *compiler
+ = lookup_compiler (name, strlen (name), infiles[i].language);
+ if (compiler == NULL)
+ error ("%s: linker input file unused because linking not done",
+ name);
+ else if (lang_n_infiles > 0 && compiler != input_file_compiler)
+ fatal ("cannot specify -o with -c or -S and multiple languages");
+ else
+ {
+ lang_n_infiles++;
+ input_file_compiler = compiler;
+ }
+ }
+ }
+
+ for (i = 0; (int) i < (combine_inputs ? 1 : n_infiles); i++)
{
int this_file_error = 0;
@@ -6306,9 +6330,10 @@ main (int argc, const char *const *argv)
/* Figure out which compiler from the file's suffix. */
- input_file_compiler
- = lookup_compiler (infiles[i].name, input_filename_length,
- infiles[i].language);
+ if (! combine_inputs)
+ input_file_compiler
+ = lookup_compiler (infiles[i].name, input_filename_length,
+ infiles[i].language);
if (input_file_compiler)
{
@@ -6717,8 +6742,7 @@ used_arg (const char *p, int len)
if (*q == ';')
cnt++;
- matches =
- (struct mswitchstr *) alloca ((sizeof (struct mswitchstr)) * cnt);
+ matches = alloca ((sizeof (struct mswitchstr)) * cnt);
i = 0;
q = multilib_matches;
while (*q != '\0')
@@ -6750,8 +6774,7 @@ used_arg (const char *p, int len)
xmalloc from calling fatal, and prevents us from re-executing this
block of code. */
mswitches
- = (struct mswitchstr *)
- xmalloc (sizeof (struct mswitchstr)
+ = xmalloc (sizeof (struct mswitchstr)
* (n_mdswitches + (n_switches ? n_switches : 1)));
for (i = 0; i < n_switches; i++)
{
@@ -6878,9 +6901,7 @@ set_multilib_dir (void)
{
int i = 0;
- mdswitches
- = (struct mdswitchstr *) xmalloc (sizeof (struct mdswitchstr)
- * n_mdswitches);
+ mdswitches = xmalloc (sizeof (struct mdswitchstr) * n_mdswitches);
for (start = multilib_defaults; *start != '\0'; start = end + 1)
{
while (*start == ' ' || *start == '\t')
diff --git a/gcc/gccbug.in b/gcc/gccbug.in
index 05ea8efe9c9..2fec32bef36 100755
--- a/gcc/gccbug.in
+++ b/gcc/gccbug.in
@@ -344,7 +344,11 @@ SEND-PR: support I need help with gcc.
host: @host@
build: @build@
target: @target@
+__EOF__
+ cat >> $file << \__EOF__
configured with: @gcc_config_arguments@
+__EOF__
+ cat >> $file << __EOF__
>Description:
$DESCRIPTION_C
>How-To-Repeat:
diff --git a/gcc/gccspec.c b/gcc/gccspec.c
index b893d659282..fce784b2ede 100644
--- a/gcc/gccspec.c
+++ b/gcc/gccspec.c
@@ -73,7 +73,7 @@ lang_specific_driver (int *in_argc ATTRIBUTE_UNUSED,
if (shared_libgcc)
{
/* Make sure to have room for the trailing NULL argument. */
- arglist = (const char **) xmalloc ((argc+2) * sizeof (char *));
+ arglist = xmalloc ((argc+2) * sizeof (char *));
i = 0;
do
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c
index f6902a119e8..e0115622ab7 100644
--- a/gcc/gcov-dump.c
+++ b/gcc/gcov-dump.c
@@ -117,16 +117,11 @@ print_usage (void)
static void
print_version (void)
{
- char v[4];
- unsigned version = GCOV_VERSION;
- unsigned ix;
-
- for (ix = 4; ix--; version >>= 8)
- v[ix] = version;
- printf ("gcov %.4s (GCC %s)\n", v, version_string);
- printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
- printf ("This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
+ printf ("gcov-dump (GCC) %s\n", version_string);
+ printf ("Copyright (C) 2003 Free Software Foundation, Inc.\n");
+ printf ("This is free software; see the source for copying conditions.\n"
+ "There is NO warranty; not even for MERCHANTABILITY or \n"
+ "FITNESS FOR A PARTICULAR PURPOSE.\n\n");
}
static void
@@ -158,6 +153,7 @@ dump_file (const char *filename)
unsigned version;
const char *type = NULL;
int endianness = 0;
+ char m[4], v[4];
if ((endianness = gcov_magic (magic, GCOV_DATA_MAGIC)))
type = "data";
@@ -170,16 +166,17 @@ dump_file (const char *filename)
return;
}
version = gcov_read_unsigned ();
+ GCOV_UNSIGNED2STRING (v, version);
+ GCOV_UNSIGNED2STRING (m, magic);
printf ("%s:%s:magic `%.4s':version `%.4s'%s\n", filename, type,
- (const char *)&magic, (const char *)&version,
- endianness < 0 ? " (swapped endianness)" : "");
+ m, v, endianness < 0 ? " (swapped endianness)" : "");
if (version != GCOV_VERSION)
{
- unsigned expected = GCOV_VERSION;
+ char e[4];
- printf ("%s:warning:current version is `%.4s'\n", filename,
- (const char *)expected);
+ GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
+ printf ("%s:warning:current version is `%.4s'\n", filename, e);
}
}
@@ -287,7 +284,7 @@ static void
tag_blocks (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
- unsigned n_blocks = length / 4;
+ unsigned n_blocks = GCOV_TAG_BLOCKS_NUM (length);
printf (" %u blocks", n_blocks);
@@ -312,7 +309,7 @@ static void
tag_arcs (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
- unsigned n_arcs = (length - 4) / 8;
+ unsigned n_arcs = GCOV_TAG_ARCS_NUM (length);
printf (" %u arcs", n_arcs);
if (flag_dump_contents)
@@ -386,7 +383,7 @@ tag_counters (const char *filename ATTRIBUTE_UNUSED,
unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
{
static const char *const counter_names[] = GCOV_COUNTER_NAMES;
- unsigned n_counts = length / 8;
+ unsigned n_counts = GCOV_TAG_COUNTER_NUM (length);
printf (" %s %u counts",
counter_names[GCOV_COUNTER_FOR_TAG (tag)], n_counts);
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index bce2d04e44a..820b1f61701 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -26,9 +26,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#if !IN_GCOV
static void gcov_write_block (unsigned);
-static gcov_unsigned_t *gcov_write_bytes (unsigned);
+static gcov_unsigned_t *gcov_write_words (unsigned);
#endif
-static const gcov_unsigned_t *gcov_read_bytes (unsigned);
+static const gcov_unsigned_t *gcov_read_words (unsigned);
#if !IN_LIBGCOV
static void gcov_allocate (unsigned);
#endif
@@ -77,7 +77,7 @@ gcov_open (const char *name, int mode)
abort ();
gcov_var.start = 0;
gcov_var.offset = gcov_var.length = 0;
- gcov_var.overread = -4u;
+ gcov_var.overread = -1u;
gcov_var.error = 0;
#if !IN_LIBGCOV
gcov_var.endian = 0;
@@ -164,7 +164,7 @@ gcov_allocate (unsigned length)
new_size *= 2;
gcov_var.alloc = new_size;
- gcov_var.buffer = xrealloc (gcov_var.buffer, new_size);
+ gcov_var.buffer = xrealloc (gcov_var.buffer, new_size << 2);
}
#endif
@@ -174,7 +174,7 @@ gcov_allocate (unsigned length)
static void
gcov_write_block (unsigned size)
{
- if (fwrite (gcov_var.buffer, size, 1, gcov_var.file) != 1)
+ if (fwrite (gcov_var.buffer, size << 2, 1, gcov_var.file) != 1)
gcov_var.error = 1;
gcov_var.start += size;
gcov_var.offset -= size;
@@ -184,28 +184,27 @@ gcov_write_block (unsigned size)
pointer to those bytes, or NULL on failure. */
static gcov_unsigned_t *
-gcov_write_bytes (unsigned bytes)
+gcov_write_words (unsigned words)
{
gcov_unsigned_t *result;
GCOV_CHECK_WRITING ();
- GCOV_CHECK (!(bytes & 3));
#if IN_LIBGCOV
if (gcov_var.offset >= GCOV_BLOCK_SIZE)
{
gcov_write_block (GCOV_BLOCK_SIZE);
if (gcov_var.offset)
{
- GCOV_CHECK (gcov_var.offset == 4);
+ GCOV_CHECK (gcov_var.offset == 1);
memcpy (gcov_var.buffer, gcov_var.buffer + GCOV_BLOCK_SIZE, 4);
}
}
#else
- if (gcov_var.offset + bytes > gcov_var.alloc)
- gcov_allocate (gcov_var.offset + bytes);
+ if (gcov_var.offset + words > gcov_var.alloc)
+ gcov_allocate (gcov_var.offset + words);
#endif
- result = (gcov_unsigned_t *)&gcov_var.buffer[gcov_var.offset];
- gcov_var.offset += bytes;
+ result = &gcov_var.buffer[gcov_var.offset];
+ gcov_var.offset += words;
return result;
}
@@ -216,7 +215,7 @@ gcov_write_bytes (unsigned bytes)
GCOV_LINKAGE void
gcov_write_unsigned (gcov_unsigned_t value)
{
- gcov_unsigned_t *buffer = gcov_write_bytes (4);
+ gcov_unsigned_t *buffer = gcov_write_words (1);
buffer[0] = value;
}
@@ -228,7 +227,7 @@ gcov_write_unsigned (gcov_unsigned_t value)
GCOV_LINKAGE void
gcov_write_counter (gcov_type value)
{
- gcov_unsigned_t *buffer = gcov_write_bytes (8);
+ gcov_unsigned_t *buffer = gcov_write_words (2);
buffer[0] = (gcov_unsigned_t) value;
if (sizeof (value) > sizeof (gcov_unsigned_t))
@@ -258,7 +257,7 @@ gcov_write_string (const char *string)
alloc = (length + 4) >> 2;
}
- buffer = gcov_write_bytes (4 + alloc * 4);
+ buffer = gcov_write_words (1 + alloc);
buffer[0] = alloc;
buffer[alloc] = 0;
@@ -274,7 +273,7 @@ GCOV_LINKAGE gcov_position_t
gcov_write_tag (gcov_unsigned_t tag)
{
gcov_position_t result = gcov_var.start + gcov_var.offset;
- gcov_unsigned_t *buffer = gcov_write_bytes (8);
+ gcov_unsigned_t *buffer = gcov_write_words (2);
buffer[0] = tag;
buffer[1] = 0;
@@ -295,10 +294,10 @@ gcov_write_length (gcov_position_t position)
gcov_unsigned_t *buffer;
GCOV_CHECK_WRITING ();
- GCOV_CHECK (position + 8 <= gcov_var.start + gcov_var.offset);
+ GCOV_CHECK (position + 2 <= gcov_var.start + gcov_var.offset);
GCOV_CHECK (position >= gcov_var.start);
offset = position - gcov_var.start;
- length = gcov_var.offset - offset - 8;
+ length = gcov_var.offset - offset - 2;
buffer = (gcov_unsigned_t *) &gcov_var.buffer[offset];
buffer[1] = length;
if (gcov_var.offset >= GCOV_BLOCK_SIZE)
@@ -312,7 +311,7 @@ gcov_write_length (gcov_position_t position)
GCOV_LINKAGE void
gcov_write_tag_length (gcov_unsigned_t tag, gcov_unsigned_t length)
{
- gcov_unsigned_t *buffer = gcov_write_bytes (8);
+ gcov_unsigned_t *buffer = gcov_write_words (2);
buffer[0] = tag;
buffer[1] = length;
@@ -346,20 +345,19 @@ gcov_write_summary (gcov_unsigned_t tag, const struct gcov_summary *summary)
NULL on failure (read past EOF). */
static const gcov_unsigned_t *
-gcov_read_bytes (unsigned bytes)
+gcov_read_words (unsigned words)
{
const gcov_unsigned_t *result;
unsigned excess = gcov_var.length - gcov_var.offset;
GCOV_CHECK_READING ();
- GCOV_CHECK (!(bytes & 3));
- if (excess < bytes)
+ if (excess < words)
{
gcov_var.start += gcov_var.offset;
#if IN_LIBGCOV
if (excess)
{
- GCOV_CHECK (excess == 4);
+ GCOV_CHECK (excess == 1);
memcpy (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, 4);
}
#else
@@ -368,25 +366,25 @@ gcov_read_bytes (unsigned bytes)
gcov_var.offset = 0;
gcov_var.length = excess;
#if IN_LIBGCOV
- GCOV_CHECK (!gcov_var.length || gcov_var.length == 4);
+ GCOV_CHECK (!gcov_var.length || gcov_var.length == 1);
excess = GCOV_BLOCK_SIZE;
#else
- if (gcov_var.length + bytes > gcov_var.alloc)
- gcov_allocate (gcov_var.length + bytes);
+ if (gcov_var.length + words > gcov_var.alloc)
+ gcov_allocate (gcov_var.length + words);
excess = gcov_var.alloc - gcov_var.length;
#endif
excess = fread (gcov_var.buffer + gcov_var.length,
- 1, excess, gcov_var.file);
+ 1, excess << 2, gcov_var.file) >> 2;
gcov_var.length += excess;
- if (gcov_var.length < bytes)
+ if (gcov_var.length < words)
{
- gcov_var.overread += bytes - gcov_var.length;
+ gcov_var.overread += words - gcov_var.length;
gcov_var.length = 0;
return 0;
}
}
- result = (gcov_unsigned_t *)&gcov_var.buffer[gcov_var.offset];
- gcov_var.offset += bytes;
+ result = &gcov_var.buffer[gcov_var.offset];
+ gcov_var.offset += words;
return result;
}
@@ -397,7 +395,7 @@ GCOV_LINKAGE gcov_unsigned_t
gcov_read_unsigned (void)
{
gcov_unsigned_t value;
- const gcov_unsigned_t *buffer = gcov_read_bytes (4);
+ const gcov_unsigned_t *buffer = gcov_read_words (1);
if (!buffer)
return 0;
@@ -412,7 +410,7 @@ GCOV_LINKAGE gcov_type
gcov_read_counter (void)
{
gcov_type value;
- const gcov_unsigned_t *buffer = gcov_read_bytes (8);
+ const gcov_unsigned_t *buffer = gcov_read_words (2);
if (!buffer)
return 0;
@@ -440,7 +438,7 @@ gcov_read_string (void)
if (!length)
return 0;
- return (const char *) gcov_read_bytes (length);
+ return (const char *) gcov_read_words (length);
}
#endif
@@ -475,8 +473,8 @@ gcov_sync (gcov_position_t base, gcov_unsigned_t length)
else
{
gcov_var.offset = gcov_var.length = 0;
- fseek (gcov_var.file, base, SEEK_SET);
- gcov_var.start = ftell (gcov_var.file);
+ fseek (gcov_var.file, base << 2, SEEK_SET);
+ gcov_var.start = ftell (gcov_var.file) >> 2;
}
}
#endif
@@ -491,8 +489,8 @@ gcov_seek (gcov_position_t base)
GCOV_CHECK_WRITING ();
if (gcov_var.offset)
gcov_write_block (gcov_var.offset);
- fseek (gcov_var.file, base, base ? SEEK_SET : SEEK_END);
- gcov_var.start = ftell (gcov_var.file);
+ fseek (gcov_var.file, base << 2, base ? SEEK_SET : SEEK_END);
+ gcov_var.start = ftell (gcov_var.file) >> 2;
}
#endif
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index 35c31b955fe..59b202bc0a4 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -41,8 +41,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
Numbers are recorded in the 32 bit unsigned binary form of the
endianness of the machine generating the file. 64 bit numbers are
stored as two 32 bit numbers, the low part first. Strings are
- stored as length rounded up to 4 followed by the string and then 1
- to 4 NUL bytes. Zero length and NULL strings are simply stored as
+ padded with 1 to 4 NUL bytes, to bring the length up to a multiple
+ of 4. The number of 4 bytes is stored, followed by the padded
+ string. Zero length and NULL strings are simply stored as
a length of zero (they have no trailing NUL or padding).
int32: byte3 byte2 byte1 byte0 | byte0 byte1 byte2 byte3
@@ -89,16 +90,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
Records are not nested, but there is a record hierarchy. Tag
numbers reflect this hierarchy. Tags are unique across note and
data files. Some record types have a varying amount of data. The
- LENGTH is usually used to determine how much data. The tag value
- is split into 4 8-bit fields, one for each of four possible levels.
- The most significant is allocated first. Unused levels are zero.
- Active levels are odd-valued, so that the LSB of the level is one.
- A sub-level incorporates the values of its superlevels. This
- formatting allows you to determine the tag hierarchy, without
- understanding the tags themselves, and is similar to the standard
- section numbering used in technical documents. Level values
- [1..3f] are used for common tags, values [41..9f] for the notes
- file and [a1..ff] for the data file.
+ LENGTH is the number of 4bytes that follow and is usually used to
+ determine how much data. The tag value is split into 4 8-bit
+ fields, one for each of four possible levels. The most significant
+ is allocated first. Unused levels are zero. Active levels are
+ odd-valued, so that the LSB of the level is one. A sub-level
+ incorporates the values of its superlevels. This formatting allows
+ you to determine the tag hierarchy, without understanding the tags
+ themselves, and is similar to the standard section numbering used
+ in technical documents. Level values [1..3f] are used for common
+ tags, values [41..9f] for the notes file and [a1..ff] for the data
+ file.
The basic block graph file contains the following records
note: unit function-graph*
@@ -252,35 +254,56 @@ typedef HOST_WIDEST_INT gcov_type;
*/
#include "gcov-iov.h"
+/* Convert a magic or version number to a 4 character string. */
+#define GCOV_UNSIGNED2STRING(ARRAY,VALUE) \
+ ((ARRAY)[0] = (char)((VALUE) >> 24), \
+ (ARRAY)[1] = (char)((VALUE) >> 16), \
+ (ARRAY)[2] = (char)((VALUE) >> 8), \
+ (ARRAY)[3] = (char)((VALUE) >> 0))
+
/* The record tags. Values [1..3f] are for tags which may be in either
file. Values [41..9f] for those in the note file and [a1..ff] for
the data file. */
#define GCOV_TAG_FUNCTION ((gcov_unsigned_t)0x01000000)
-#define GCOV_TAG_FUNCTION_LENGTH (2 * 4)
+#define GCOV_TAG_FUNCTION_LENGTH (2)
#define GCOV_TAG_BLOCKS ((gcov_unsigned_t)0x01410000)
-#define GCOV_TAG_BLOCKS_LENGTH(NUM) ((NUM) * 4)
+#define GCOV_TAG_BLOCKS_LENGTH(NUM) (NUM)
+#define GCOV_TAG_BLOCKS_NUM(LENGTH) (LENGTH)
#define GCOV_TAG_ARCS ((gcov_unsigned_t)0x01430000)
-#define GCOV_TAG_ARCS_LENGTH(NUM) (1 * 4 + (NUM) * (2 * 4))
+#define GCOV_TAG_ARCS_LENGTH(NUM) (1 + (NUM) * 2)
+#define GCOV_TAG_ARCS_NUM(LENGTH) (((LENGTH) - 1) / 2)
#define GCOV_TAG_LINES ((gcov_unsigned_t)0x01450000)
#define GCOV_TAG_COUNTER_BASE ((gcov_unsigned_t)0x01a10000)
-#define GCOV_TAG_COUNTER_LENGTH(NUM) ((NUM) * 8)
+#define GCOV_TAG_COUNTER_LENGTH(NUM) ((NUM) * 2)
+#define GCOV_TAG_COUNTER_NUM(LENGTH) ((LENGTH) / 2)
#define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000)
#define GCOV_TAG_PROGRAM_SUMMARY ((gcov_unsigned_t)0xa3000000)
#define GCOV_TAG_SUMMARY_LENGTH \
- (1 * 4 + GCOV_COUNTERS_SUMMABLE * (2 * 4 + 3 * 8))
+ (1 + GCOV_COUNTERS_SUMMABLE * (2 + 3 * 2))
/* Counters that are collected. */
#define GCOV_COUNTER_ARCS 0 /* Arc transitions. */
#define GCOV_COUNTERS_SUMMABLE 1 /* Counters which can be
summaried. */
+#define GCOV_FIRST_VALUE_COUNTER 1 /* The first of counters used for value
+ profiling. They must form a consecutive
+ interval and their order must match
+ the order of HIST_TYPEs in
+ value-prof.h. */
#define GCOV_COUNTER_V_INTERVAL 1 /* Histogram of value inside an interval. */
#define GCOV_COUNTER_V_POW2 2 /* Histogram of exact power2 logarithm
of a value. */
#define GCOV_COUNTER_V_SINGLE 3 /* The most common value of expression. */
#define GCOV_COUNTER_V_DELTA 4 /* The most common difference between
consecutive values of expression. */
+#define GCOV_LAST_VALUE_COUNTER 4 /* The last of counters used for value
+ profiling. */
#define GCOV_COUNTERS 5
+
+/* Number of counters used for value profiling. */
+#define GCOV_N_VALUE_COUNTERS \
+ (GCOV_LAST_VALUE_COUNTER - GCOV_FIRST_VALUE_COUNTER + 1)
/* A list of human readable names of the counters */
#define GCOV_COUNTER_NAMES {"arcs", "interval", "pow2", "single", "delta"}
@@ -407,8 +430,8 @@ extern void __gcov_merge_delta (gcov_type *, unsigned);
#if IN_LIBGCOV >= 0
-/* Optimum size read from or written to disk. */
-#define GCOV_BLOCK_SIZE (1 << 12)
+/* Optimum number of gcov_unsigned_t's read from or written to disk. */
+#define GCOV_BLOCK_SIZE (1 << 10)
GCOV_LINKAGE struct gcov_var
{
@@ -416,7 +439,7 @@ GCOV_LINKAGE struct gcov_var
gcov_position_t start; /* Position of first byte of block */
unsigned offset; /* Read/write position within the block. */
unsigned length; /* Read limit in the block. */
- unsigned overread; /* Number of bytes overread. */
+ unsigned overread; /* Number of words overread. */
int error; /* < 0 overflow, > 0 disk error. */
int mode; /* < 0 writing, > 0 reading */
#if IN_LIBGCOV
@@ -424,13 +447,13 @@ GCOV_LINKAGE struct gcov_var
fit within this buffer and we always can transfer GCOV_BLOCK_SIZE
to and from the disk. libgcov never backtracks and only writes 4
or 8 byte objects. */
- char buffer[GCOV_BLOCK_SIZE + 4] __attribute__ ((aligned (4)));
+ gcov_unsigned_t buffer[GCOV_BLOCK_SIZE + 1];
#else
int endian; /* Swap endianness. */
/* Holds a variable length block, as the compiler can write
strings and needs to backtrack. */
size_t alloc;
- char *buffer;
+ gcov_unsigned_t *buffer;
#endif
} gcov_var;
@@ -442,7 +465,7 @@ GCOV_LINKAGE struct gcov_var
functions, gcov_seek & gcov_error. When a file is to be rewritten
you use the functions for reading, then gcov_rewrite then the
functions for writing. Your file may become corrupted if you break
- these invariants. */
+ these invariants. */
#if IN_LIBGCOV
GCOV_LINKAGE int gcov_open (const char */*name*/);
#else
diff --git a/gcc/gcov.c b/gcc/gcov.c
index d42cff15b2c..d3037c775b8 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -82,6 +82,8 @@ typedef struct arc_info
/* transition counts. */
gcov_type count;
+ /* used in cycle search, so that we do not clobber original counts. */
+ gcov_type cs_count;
unsigned int count_valid : 1;
unsigned int on_tree : 1;
@@ -417,14 +419,12 @@ print_usage (int error_p)
static void
print_version (void)
{
- unsigned version = GCOV_VERSION;
-
- fnotice (stdout, "gcov %.4s (GCC %s)\n",
- (const char *)&version, version_string);
- fnotice (stdout, "Copyright (C) 2002 Free Software Foundation, Inc.\n");
+ fnotice (stdout, "gcov (GCC) %s\n", version_string);
+ fnotice (stdout, "Copyright (C) 2003 Free Software Foundation, Inc.\n");
fnotice (stdout,
- "This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
+ "This is free software; see the source for copying conditions.\n"
+ "There is NO warranty; not even for MERCHANTABILITY or \n"
+ "FITNESS FOR A PARTICULAR PURPOSE.\n\n");
exit (SUCCESS_EXIT_CODE);
}
@@ -522,7 +522,7 @@ process_file (const char *file_name)
for (fn = functions; fn; fn = fn->next)
solve_flow_graph (fn);
for (src = sources; src; src = src->next)
- src->lines = (line_t *) xcalloc (src->num_lines, sizeof (line_t));
+ src->lines = xcalloc (src->num_lines, sizeof (line_t));
for (fn = functions; fn; fn = fn->next)
{
coverage_t coverage;
@@ -684,7 +684,7 @@ find_source (const char *file_name)
if (!strcmp (file_name, src->name))
return src;
- src = (source_t *)xcalloc (1, sizeof (source_t));
+ src = xcalloc (1, sizeof (source_t));
src->name = xstrdup (file_name);
src->coverage.name = src->name;
src->index = sources ? sources->index + 1 : 1;
@@ -723,13 +723,10 @@ read_graph_file (void)
if (version != GCOV_VERSION)
{
char v[4], e[4];
- unsigned required = GCOV_VERSION;
- for (ix = 4; ix--; required >>= 8, version >>= 8)
- {
- v[ix] = version;
- e[ix] = required;
- }
+ GCOV_UNSIGNED2STRING (v, version);
+ GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
+
fnotice (stderr, "%s:version `%.4s', prefer `%.4s'\n",
bbg_file_name, v, e);
}
@@ -753,7 +750,7 @@ read_graph_file (void)
src = find_source (gcov_read_string ());
lineno = gcov_read_unsigned ();
- fn = (function_t *)xcalloc (1, sizeof (function_t));
+ fn = xcalloc (1, sizeof (function_t));
fn->name = function_name;
fn->ident = ident;
fn->checksum = checksum;
@@ -786,11 +783,10 @@ read_graph_file (void)
bbg_file_name, fn->name);
else
{
- unsigned ix, num_blocks = length / 4;
+ unsigned ix, num_blocks = GCOV_TAG_BLOCKS_NUM (length);
fn->num_blocks = num_blocks;
- fn->blocks
- = (block_t *)xcalloc (fn->num_blocks, sizeof (block_t));
+ fn->blocks = xcalloc (fn->num_blocks, sizeof (block_t));
for (ix = 0; ix != num_blocks; ix++)
fn->blocks[ix].flags = gcov_read_unsigned ();
}
@@ -798,7 +794,7 @@ read_graph_file (void)
else if (fn && tag == GCOV_TAG_ARCS)
{
unsigned src = gcov_read_unsigned ();
- unsigned num_dests = (length - 4) / 8;
+ unsigned num_dests = GCOV_TAG_ARCS_NUM (length);
if (src >= fn->num_blocks || fn->blocks[src].succ)
goto corrupt;
@@ -811,7 +807,7 @@ read_graph_file (void)
if (dest >= fn->num_blocks)
goto corrupt;
- arc = (arc_t *) xcalloc (1, sizeof (arc_t));
+ arc = xcalloc (1, sizeof (arc_t));
arc->dst = &fn->blocks[dest];
arc->src = &fn->blocks[src];
@@ -856,8 +852,7 @@ read_graph_file (void)
else if (fn && tag == GCOV_TAG_LINES)
{
unsigned blockno = gcov_read_unsigned ();
- unsigned *line_nos
- = (unsigned *)xcalloc ((length - 4) / 4, sizeof (unsigned));
+ unsigned *line_nos = xcalloc (length - 1, sizeof (unsigned));
if (blockno >= fn->num_blocks || fn->blocks[blockno].u.line.encoding)
goto corrupt;
@@ -991,10 +986,13 @@ read_count_file (void)
version = gcov_read_unsigned ();
if (version != GCOV_VERSION)
{
- unsigned desired = GCOV_VERSION;
+ char v[4], e[4];
+
+ GCOV_UNSIGNED2STRING (v, version);
+ GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
fnotice (stderr, "%s:version `%.4s', prefer version `%.4s'\n",
- da_file_name, (const char *)&version, (const char *)&desired);
+ da_file_name, v, e);
}
tag = gcov_read_unsigned ();
if (tag != bbg_stamp)
@@ -1045,12 +1043,11 @@ read_count_file (void)
}
else if (tag == GCOV_TAG_FOR_COUNTER (GCOV_COUNTER_ARCS) && fn)
{
- if (length != 8 * fn->num_counts)
+ if (length != GCOV_TAG_COUNTER_LENGTH (fn->num_counts))
goto mismatch;
if (!fn->counts)
- fn->counts
- = (gcov_type *)xcalloc (fn->num_counts, sizeof (gcov_type));
+ fn->counts = xcalloc (fn->num_counts, sizeof (gcov_type));
for (ix = 0; ix != fn->num_counts; ix++)
fn->counts[ix] += gcov_read_counter ();
@@ -1492,7 +1489,7 @@ static void
add_line_counts (coverage_t *coverage, function_t *fn)
{
unsigned ix;
- line_t *line = NULL; /* this is propagated from one iteration to the
+ line_t *line = NULL; /* This is propagated from one iteration to the
next. */
/* Scan each basic block. */
@@ -1627,6 +1624,10 @@ accumulate_line_counts (source_t *src)
if (flag_branches)
add_branch_counts (&src->coverage, arc);
}
+
+ /* Initialize the cs_count. */
+ for (arc = block->succ; arc; arc = arc->succ_next)
+ arc->cs_count = arc->count;
}
/* Find the loops. This uses the algorithm described in
@@ -1643,7 +1644,8 @@ accumulate_line_counts (source_t *src)
For each loop we find, locate the arc with the smallest
transition count, and add that to the cumulative
- count. Remove the arc from consideration. */
+ count. Decrease flow over the cycle and remove the arc
+ from consideration. */
for (block = line->u.blocks; block; block = block->chain)
{
block_t *head = block;
@@ -1669,25 +1671,33 @@ accumulate_line_counts (source_t *src)
if (dst == block)
{
/* Found a closing arc. */
- gcov_type cycle_count = arc->count;
+ gcov_type cycle_count = arc->cs_count;
arc_t *cycle_arc = arc;
arc_t *probe_arc;
/* Locate the smallest arc count of the loop. */
for (dst = head; (probe_arc = dst->u.cycle.arc);
dst = probe_arc->src)
- if (cycle_count > probe_arc->count)
+ if (cycle_count > probe_arc->cs_count)
{
- cycle_count = probe_arc->count;
+ cycle_count = probe_arc->cs_count;
cycle_arc = probe_arc;
}
count += cycle_count;
cycle_arc->cycle = 1;
+
+ /* Remove the flow from the cycle. */
+ arc->cs_count -= cycle_count;
+ for (dst = head; (probe_arc = dst->u.cycle.arc);
+ dst = probe_arc->src)
+ probe_arc->cs_count -= cycle_count;
+
/* Unwind to the cyclic arc. */
while (head != cycle_arc->src)
{
arc = head->u.cycle.arc;
+ head->u.cycle.arc = NULL;
head = arc->src;
}
/* Move on. */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 9d83f059039..f50c2d9a01e 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -165,7 +165,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "params.h"
#include "cselib.h"
-
+#include "intl.h"
#include "obstack.h"
/* Propagate flow information through back edges and thus enable PRE's
@@ -549,15 +549,17 @@ struct null_pointer_info
};
static void compute_can_copy (void);
-static char *gmalloc (unsigned int);
-static char *grealloc (char *, unsigned int);
-static char *gcse_alloc (unsigned long);
+static void *gmalloc (size_t) ATTRIBUTE_MALLOC;
+static void *gcalloc (size_t, size_t) ATTRIBUTE_MALLOC;
+static void *grealloc (void *, size_t);
+static void *gcse_alloc (unsigned long);
static void alloc_gcse_mem (rtx);
static void free_gcse_mem (void);
static void alloc_reg_set_mem (int);
static void free_reg_set_mem (void);
static int get_bitmap_width (int, int, int);
static void record_one_set (int, rtx);
+static void replace_one_set (int, rtx, rtx);
static void record_set_info (rtx, rtx, void *);
static void compute_sets (rtx);
static void hash_scan_insn (rtx, struct hash_table *, int);
@@ -682,15 +684,16 @@ static rtx extract_mentioned_regs (rtx);
static rtx extract_mentioned_regs_helper (rtx, rtx);
static void find_moveable_store (rtx, int *, int *);
static int compute_store_table (void);
-static bool load_kills_store (rtx, rtx);
-static bool find_loads (rtx, rtx);
-static bool store_killed_in_insn (rtx, rtx, rtx);
+static bool load_kills_store (rtx, rtx, int);
+static bool find_loads (rtx, rtx, int);
+static bool store_killed_in_insn (rtx, rtx, rtx, int);
static bool store_killed_after (rtx, rtx, rtx, basic_block, int *, rtx *);
static bool store_killed_before (rtx, rtx, rtx, basic_block, int *);
static void build_store_vectors (void);
static void insert_insn_start_bb (rtx, basic_block);
static int insert_store (struct ls_expr *, edge);
-static void replace_store_insn (rtx, rtx, basic_block);
+static void remove_reachable_equiv_notes (basic_block, struct ls_expr *);
+static void replace_store_insn (rtx, rtx, basic_block, struct ls_expr *);
static void delete_store (struct ls_expr *, basic_block);
static void free_store_memory (void);
static void store_motion (void);
@@ -702,7 +705,9 @@ static void local_cprop_find_used_regs (rtx *, void *);
static bool do_local_cprop (rtx, rtx, int, rtx*);
static bool adjust_libcall_notes (rtx, rtx, rtx, rtx*);
static void local_cprop_pass (int);
+static bool is_too_expensive (const char *);
+
/* Entry point for global common subexpression elimination.
F is the first instruction in the function. */
@@ -736,39 +741,10 @@ gcse_main (rtx f, FILE *file)
if (file)
dump_flow_info (file);
- /* Return if there's nothing to do. */
- if (n_basic_blocks <= 1)
+ /* Return if there's nothing to do, or it is too expensive. */
+ if (n_basic_blocks <= 1 || is_too_expensive (_("GCSE disabled")))
return 0;
-
- /* Trying to perform global optimizations on flow graphs which have
- a high connectivity will take a long time and is unlikely to be
- particularly useful.
-
- In normal circumstances a cfg should have about twice as many edges
- as blocks. But we do not want to punish small functions which have
- a couple switch statements. So we require a relatively large number
- of basic blocks and the ratio of edges to blocks to be high. */
- if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20)
- {
- if (warn_disabled_optimization)
- warning ("GCSE disabled: %d > 1000 basic blocks and %d >= 20 edges/basic block",
- n_basic_blocks, n_edges / n_basic_blocks);
- return 0;
- }
-
- /* If allocating memory for the cprop bitmap would take up too much
- storage it's better just to disable the optimization. */
- if ((n_basic_blocks
- * SBITMAP_SET_SIZE (max_gcse_regno)
- * sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY)
- {
- if (warn_disabled_optimization)
- warning ("GCSE disabled: %d basic blocks and %d registers",
- n_basic_blocks, max_gcse_regno);
-
- return 0;
- }
-
+
gcc_obstack_init (&gcse_obstack);
bytes_used = 0;
@@ -821,12 +797,8 @@ gcse_main (rtx f, FILE *file)
if (changed)
{
free_modify_mem_tables ();
- modify_mem_list
- = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- canon_modify_mem_list
- = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx));
- memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ modify_mem_list = gcalloc (last_basic_block, sizeof (rtx));
+ canon_modify_mem_list = gcalloc (last_basic_block, sizeof (rtx));
}
free_reg_set_mem ();
alloc_reg_set_mem (max_reg_num ());
@@ -954,30 +926,39 @@ can_copy_p (enum machine_mode mode)
/* Cover function to xmalloc to record bytes allocated. */
-static char *
-gmalloc (unsigned int size)
+static void *
+gmalloc (size_t size)
{
bytes_used += size;
return xmalloc (size);
}
+/* Cover function to xcalloc to record bytes allocated. */
+
+static void *
+gcalloc (size_t nelem, size_t elsize)
+{
+ bytes_used += nelem * elsize;
+ return xcalloc (nelem, elsize);
+}
+
/* Cover function to xrealloc.
We don't record the additional size since we don't know it.
It won't affect memory usage stats much anyway. */
-static char *
-grealloc (char *ptr, unsigned int size)
+static void *
+grealloc (void *ptr, size_t size)
{
return xrealloc (ptr, size);
}
/* Cover function to obstack_alloc. */
-static char *
+static void *
gcse_alloc (unsigned long size)
{
bytes_used += size;
- return (char *) obstack_alloc (&gcse_obstack, size);
+ return obstack_alloc (&gcse_obstack, size);
}
/* Allocate memory for the cuid mapping array,
@@ -988,7 +969,7 @@ gcse_alloc (unsigned long size)
static void
alloc_gcse_mem (rtx f)
{
- int i, n;
+ int i;
rtx insn;
/* Find the largest UID and create a mapping from UIDs to CUIDs.
@@ -996,9 +977,7 @@ alloc_gcse_mem (rtx f)
and only apply to real insns. */
max_uid = get_max_uid ();
- n = (max_uid + 1) * sizeof (int);
- uid_cuid = (int *) gmalloc (n);
- memset ((char *) uid_cuid, 0, n);
+ uid_cuid = gcalloc (max_uid + 1, sizeof (int));
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
@@ -1010,9 +989,7 @@ alloc_gcse_mem (rtx f)
/* Create a table mapping cuids to insns. */
max_cuid = i;
- n = (max_cuid + 1) * sizeof (rtx);
- cuid_insn = (rtx *) gmalloc (n);
- memset ((char *) cuid_insn, 0, n);
+ cuid_insn = gcalloc (max_cuid + 1, sizeof (rtx));
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
if (INSN_P (insn))
CUID_INSN (i++) = insn;
@@ -1021,14 +998,11 @@ alloc_gcse_mem (rtx f)
reg_set_bitmap = BITMAP_XMALLOC ();
/* Allocate vars to track sets of regs, memory per block. */
- reg_set_in_block = (sbitmap *) sbitmap_vector_alloc (last_basic_block,
- max_gcse_regno);
+ reg_set_in_block = sbitmap_vector_alloc (last_basic_block, max_gcse_regno);
/* Allocate array to keep a list of insns which modify memory in each
basic block. */
- modify_mem_list = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- canon_modify_mem_list = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx));
- memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ modify_mem_list = gcalloc (last_basic_block, sizeof (rtx));
+ canon_modify_mem_list = gcalloc (last_basic_block, sizeof (rtx));
modify_mem_list_set = BITMAP_XMALLOC ();
canon_modify_mem_list_set = BITMAP_XMALLOC ();
}
@@ -1191,12 +1165,8 @@ static struct obstack reg_set_obstack;
static void
alloc_reg_set_mem (int n_regs)
{
- unsigned int n;
-
reg_set_table_size = n_regs + REG_SET_TABLE_SLOP;
- n = reg_set_table_size * sizeof (struct reg_set *);
- reg_set_table = (struct reg_set **) gmalloc (n);
- memset ((char *) reg_set_table, 0, n);
+ reg_set_table = gcalloc (reg_set_table_size, sizeof (struct reg_set *));
gcc_obstack_init (&reg_set_obstack);
}
@@ -1208,6 +1178,24 @@ free_reg_set_mem (void)
obstack_free (&reg_set_obstack, NULL);
}
+/* An OLD_INSN that used to set REGNO was replaced by NEW_INSN.
+ Update the corresponding `reg_set_table' entry accordingly.
+ We assume that NEW_INSN is not already recorded in reg_set_table[regno]. */
+
+static void
+replace_one_set (int regno, rtx old_insn, rtx new_insn)
+{
+ struct reg_set *reg_info;
+ if (regno >= reg_set_table_size)
+ return;
+ for (reg_info = reg_set_table[regno]; reg_info; reg_info = reg_info->next)
+ if (reg_info->insn == old_insn)
+ {
+ reg_info->insn = new_insn;
+ break;
+ }
+}
+
/* Record REGNO in the reg_set table. */
static void
@@ -1221,16 +1209,14 @@ record_one_set (int regno, rtx insn)
{
int new_size = regno + REG_SET_TABLE_SLOP;
- reg_set_table
- = (struct reg_set **) grealloc ((char *) reg_set_table,
- new_size * sizeof (struct reg_set *));
- memset ((char *) (reg_set_table + reg_set_table_size), 0,
+ reg_set_table = grealloc (reg_set_table,
+ new_size * sizeof (struct reg_set *));
+ memset (reg_set_table + reg_set_table_size, 0,
(new_size - reg_set_table_size) * sizeof (struct reg_set *));
reg_set_table_size = new_size;
}
- new_reg_info = (struct reg_set *) obstack_alloc (&reg_set_obstack,
- sizeof (struct reg_set));
+ new_reg_info = obstack_alloc (&reg_set_obstack, sizeof (struct reg_set));
bytes_used += sizeof (struct reg_set);
new_reg_info->insn = insn;
new_reg_info->next = reg_set_table[regno];
@@ -1802,6 +1788,10 @@ expr_equiv_p (rtx x, rtx y)
due to it being set with the different alias set. */
if (MEM_ALIAS_SET (x) != MEM_ALIAS_SET (y))
return 0;
+
+ /* A volatile mem should not be considered equivalent to any other. */
+ if (MEM_VOLATILE_P (x) || MEM_VOLATILE_P (y))
+ return 0;
break;
/* For commutative operations, check both orders. */
@@ -1937,7 +1927,7 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
if (! found)
{
- cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr));
+ cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */
@@ -1976,7 +1966,7 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
else
{
/* First occurrence of this expression in this basic block. */
- antic_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ antic_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
if (cur_expr->antic_occr == NULL)
@@ -2011,7 +2001,7 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
else
{
/* First occurrence of this expression in this basic block. */
- avail_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ avail_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
@@ -2058,7 +2048,7 @@ insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
if (! found)
{
- cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr));
+ cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */
@@ -2097,7 +2087,7 @@ insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
else
{
/* First occurrence of this expression in this basic block. */
- cur_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ cur_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
@@ -2123,6 +2113,17 @@ gcse_constant_p (rtx x)
&& GET_CODE (XEXP (x, 1)) == CONST_INT)
return true;
+
+ /* Consider a COMPARE of the same registers is a constant
+ if they are not floating point registers. */
+ if (GET_CODE(x) == COMPARE
+ && GET_CODE (XEXP (x, 0)) == REG
+ && GET_CODE (XEXP (x, 1)) == REG
+ && REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 1))
+ && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0)))
+ && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 1))))
+ return true;
+
if (GET_CODE (x) == CONSTANT_P_RTX)
return false;
@@ -2275,9 +2276,8 @@ dump_hash_table (FILE *file, const char *name, struct hash_table *table)
unsigned int *hash_val;
struct expr *expr;
- flat_table
- = (struct expr **) xcalloc (table->n_elems, sizeof (struct expr *));
- hash_val = (unsigned int *) xmalloc (table->n_elems * sizeof (unsigned int));
+ flat_table = xcalloc (table->n_elems, sizeof (struct expr *));
+ hash_val = xmalloc (table->n_elems * sizeof (unsigned int));
for (i = 0; i < (int) table->size; i++)
for (expr = table->table[i]; expr != NULL; expr = expr->next_same_hash)
@@ -2448,8 +2448,7 @@ compute_hash_table_work (struct hash_table *table)
/* re-Cache any INSN_LIST nodes we have allocated. */
clear_modify_mem_tables ();
/* Some working arrays used to track first and last set in each block. */
- reg_avail_info = (struct reg_avail_info*)
- gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
+ reg_avail_info = gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
for (i = 0; i < max_gcse_regno; ++i)
reg_avail_info[i].last_bb = NULL;
@@ -2539,7 +2538,7 @@ alloc_hash_table (int n_insns, struct hash_table *table, int set_p)
??? Later take some measurements. */
table->size |= 1;
n = table->size * sizeof (struct expr *);
- table->table = (struct expr **) gmalloc (n);
+ table->table = gmalloc (n);
table->set_p = set_p;
}
@@ -2559,8 +2558,7 @@ compute_hash_table (struct hash_table *table)
{
/* Initialize count of number of entries in hash table. */
table->n_elems = 0;
- memset ((char *) table->table, 0,
- table->size * sizeof (struct expr *));
+ memset (table->table, 0, table->size * sizeof (struct expr *));
compute_hash_table_work (table);
}
@@ -2831,16 +2829,16 @@ mark_oprs_set (rtx insn)
static void
alloc_rd_mem (int n_blocks, int n_insns)
{
- rd_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_kill = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_kill, n_blocks);
- rd_gen = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_gen = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_gen, n_blocks);
- reaching_defs = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ reaching_defs = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (reaching_defs, n_blocks);
- rd_out = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_out = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_out, n_blocks);
}
@@ -2958,16 +2956,16 @@ compute_rd (void)
static void
alloc_avail_expr_mem (int n_blocks, int n_exprs)
{
- ae_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_kill = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_kill, n_blocks);
- ae_gen = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_gen = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_gen, n_blocks);
- ae_in = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_in = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_in, n_blocks);
- ae_out = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_out = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_out, n_blocks);
}
@@ -3164,7 +3162,7 @@ expr_reaches_here_p (struct occr *occr, struct expr *expr, basic_block bb,
int check_self_loop)
{
int rval;
- char *visited = (char *) xcalloc (last_basic_block, 1);
+ char *visited = xcalloc (last_basic_block, 1);
rval = expr_reaches_here_p_work (occr, expr, bb, check_self_loop, visited);
@@ -3845,6 +3843,11 @@ try_replace_reg (rtx from, rtx to, rtx insn)
validate_change (insn, &SET_SRC (set), src, 0);
}
+ /* If there is already a NOTE, update the expression in it with our
+ replacement. */
+ if (note != 0)
+ XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to);
+
if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
{
/* If above failed and this is a single set, try to simplify the source of
@@ -3856,17 +3859,15 @@ try_replace_reg (rtx from, rtx to, rtx insn)
&& validate_change (insn, &SET_SRC (set), src, 0))
success = 1;
- /* If we've failed to do replacement, have a single SET, and don't already
- have a note, add a REG_EQUAL note to not lose information. */
- if (!success && note == 0 && set != 0)
+ /* If we've failed to do replacement, have a single SET, don't already
+ have a note, and have no special SET, add a REG_EQUAL note to not
+ lose information. */
+ if (!success && note == 0 && set != 0
+ && GET_CODE (XEXP (set, 0)) != ZERO_EXTRACT
+ && GET_CODE (XEXP (set, 0)) != SIGN_EXTRACT)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
- /* If there is already a NOTE, update the expression in it with our
- replacement. */
- else if (note != 0)
- XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to);
-
/* REG_EQUAL may get simplified into register.
We don't allow that. Remove that note. This code ought
not to happen, because previous code ought to synthesize
@@ -4480,7 +4481,8 @@ fis_get_condition (rtx jump)
/* Use canonicalize_condition to do the dirty work of manipulating
MODE_CC values and COMPARE rtx codes. */
- tmp = canonicalize_condition (jump, cond, reverse, &earliest, NULL_RTX);
+ tmp = canonicalize_condition (jump, cond, reverse, &earliest, NULL_RTX,
+ false);
if (!tmp)
return NULL_RTX;
@@ -4498,7 +4500,8 @@ fis_get_condition (rtx jump)
tmp = XEXP (tmp, 0);
if (!REG_P (tmp) || GET_MODE_CLASS (GET_MODE (tmp)) != MODE_INT)
return NULL_RTX;
- tmp = canonicalize_condition (jump, cond, reverse, &earliest, tmp);
+ tmp = canonicalize_condition (jump, cond, reverse, &earliest, tmp,
+ false);
if (!tmp)
return NULL_RTX;
@@ -4526,7 +4529,7 @@ find_implicit_sets (void)
count = 0;
FOR_EACH_BB (bb)
- /* Check for more than one sucessor. */
+ /* Check for more than one successor. */
if (bb->succ && bb->succ->succ_next)
{
cond = fis_get_condition (bb->end);
@@ -4577,7 +4580,7 @@ one_cprop_pass (int pass, int cprop_jumps, int bypass_jumps)
local_cprop_pass (cprop_jumps);
/* Determine implicit sets. */
- implicit_sets = (rtx *) xcalloc (last_basic_block, sizeof (rtx));
+ implicit_sets = xcalloc (last_basic_block, sizeof (rtx));
find_implicit_sets ();
alloc_hash_table (max_cuid, &set_hash_table, 1);
@@ -5094,7 +5097,7 @@ static int
pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb)
{
int rval;
- char *visited = (char *) xcalloc (last_basic_block, 1);
+ char *visited = xcalloc (last_basic_block, 1);
rval = pre_expr_reaches_here_p_work (occr_bb, expr, bb, visited);
@@ -5350,7 +5353,14 @@ pre_edge_insert (struct edge_list *edge_list, struct expr **index_map)
return did_insert;
}
-/* Copy the result of INSN to REG. INDX is the expression number. */
+/* Copy the result of INSN to REG. INDX is the expression number.
+ Given "old_reg <- expr" (INSN), instead of adding after it
+ reaching_reg <- old_reg
+ it's better to do the following:
+ reaching_reg <- expr
+ old_reg <- reaching_reg
+ because this way copy propagation can discover additional PRE
+ opportunuties. */
static void
pre_insert_copy_insn (struct expr *expr, rtx insn)
@@ -5360,14 +5370,25 @@ pre_insert_copy_insn (struct expr *expr, rtx insn)
int indx = expr->bitmap_index;
rtx set = single_set (insn);
rtx new_insn;
+ rtx new_set;
+ rtx old_reg;
if (!set)
abort ();
- new_insn = emit_insn_after (gen_move_insn (reg, copy_rtx (SET_DEST (set))), insn);
+ old_reg = SET_DEST (set);
+ new_insn = emit_insn_after (gen_move_insn (old_reg,
+ reg),
+ insn);
+ new_set = single_set (new_insn);
+
+ if (!new_set)
+ abort();
+ SET_DEST (set) = reg;
/* Keep register set table up to date. */
- record_one_set (regno, new_insn);
+ replace_one_set (REGNO (old_reg), insn, new_insn);
+ record_one_set (regno, insn);
gcse_create_count++;
@@ -5563,7 +5584,7 @@ pre_gcse (void)
/* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */
- index_map = (struct expr **) xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
+ index_map = xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
@@ -5862,7 +5883,7 @@ delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin,
continue;
/* LAST_INSN is a conditional jump. Get its condition. */
- condition = get_condition (last_insn, &earliest);
+ condition = get_condition (last_insn, &earliest, false);
/* If we can't determine the condition then skip. */
if (! condition)
@@ -5941,28 +5962,17 @@ delete_null_pointer_checks (rtx f ATTRIBUTE_UNUSED)
basic_block bb;
int reg;
int regs_per_pass;
- int max_reg;
+ int max_reg = max_reg_num ();
struct null_pointer_info npi;
int something_changed = 0;
- /* If we have only a single block, then there's nothing to do. */
- if (n_basic_blocks <= 1)
- return 0;
-
- /* Trying to perform global optimizations on flow graphs which have
- a high connectivity will take a long time and is unlikely to be
- particularly useful.
-
- In normal circumstances a cfg should have about twice as many edges
- as blocks. But we do not want to punish small functions which have
- a couple switch statements. So we require a relatively large number
- of basic blocks and the ratio of edges to blocks to be high. */
- if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20)
+ /* If we have only a single block, or it is too expensive, give up. */
+ if (n_basic_blocks <= 1
+ || is_too_expensive (_ ("NULL pointer checks disabled")))
return 0;
/* We need four bitmaps, each with a bit for each register in each
basic block. */
- max_reg = max_reg_num ();
regs_per_pass = get_bitmap_width (4, last_basic_block, max_reg);
/* Allocate bitmaps to hold local and global properties. */
@@ -5974,7 +5984,7 @@ delete_null_pointer_checks (rtx f ATTRIBUTE_UNUSED)
/* Go through the basic blocks, seeing whether or not each block
ends with a conditional branch whose condition is a comparison
against zero. Record the register compared in BLOCK_REG. */
- block_reg = (unsigned int *) xcalloc (last_basic_block, sizeof (int));
+ block_reg = xcalloc (last_basic_block, sizeof (int));
FOR_EACH_BB (bb)
{
rtx last_insn = bb->end;
@@ -5987,7 +5997,7 @@ delete_null_pointer_checks (rtx f ATTRIBUTE_UNUSED)
continue;
/* LAST_INSN is a conditional jump. Get its condition. */
- condition = get_condition (last_insn, &earliest);
+ condition = get_condition (last_insn, &earliest, false);
/* If we were unable to get the condition, or it is not an equality
comparison against zero then there's nothing we can do. */
@@ -6206,7 +6216,7 @@ hoist_code (void)
/* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */
- index_map = (struct expr **) xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
+ index_map = xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
@@ -6419,7 +6429,7 @@ ldst_entry (rtx x)
if (!ptr)
{
- ptr = (struct ls_expr *) xmalloc (sizeof (struct ls_expr));
+ ptr = xmalloc (sizeof (struct ls_expr));
ptr->next = pre_ldst_mems;
ptr->expr = NULL;
@@ -6752,7 +6762,7 @@ trim_ld_motion_mems (void)
/* This routine will take an expression which we are replacing with
a reaching register, and update any stores that are needed if
that expression is in the ld_motion list. Stores are updated by
- copying their SRC to the reaching register, and then storeing
+ copying their SRC to the reaching register, and then storing
the reaching register into the store location. These keeps the
correct value in the reaching register for the loads. */
@@ -7065,7 +7075,7 @@ compute_store_table (void)
max_gcse_regno = max_reg_num ();
- reg_set_in_block = (sbitmap *) sbitmap_vector_alloc (last_basic_block,
+ reg_set_in_block = sbitmap_vector_alloc (last_basic_block,
max_gcse_regno);
sbitmap_vector_zero (reg_set_in_block, last_basic_block);
pre_ldst_mems = 0;
@@ -7186,21 +7196,27 @@ compute_store_table (void)
return ret;
}
-/* Check to see if the load X is aliased with STORE_PATTERN. */
+/* Check to see if the load X is aliased with STORE_PATTERN.
+ AFTER is true if we are checking the case when STORE_PATTERN occurs
+ after the X. */
static bool
-load_kills_store (rtx x, rtx store_pattern)
+load_kills_store (rtx x, rtx store_pattern, int after)
{
- if (true_dependence (x, GET_MODE (x), store_pattern, rtx_addr_varies_p))
- return true;
- return false;
+ if (after)
+ return anti_dependence (x, store_pattern);
+ else
+ return true_dependence (store_pattern, GET_MODE (store_pattern), x,
+ rtx_addr_varies_p);
}
/* Go through the entire insn X, looking for any loads which might alias
- STORE_PATTERN. Return true if found. */
+ STORE_PATTERN. Return true if found.
+ AFTER is true if we are checking the case when STORE_PATTERN occurs
+ after the insn X. */
static bool
-find_loads (rtx x, rtx store_pattern)
+find_loads (rtx x, rtx store_pattern, int after)
{
const char * fmt;
int i, j;
@@ -7214,7 +7230,7 @@ find_loads (rtx x, rtx store_pattern)
if (GET_CODE (x) == MEM)
{
- if (load_kills_store (x, store_pattern))
+ if (load_kills_store (x, store_pattern, after))
return true;
}
@@ -7224,21 +7240,22 @@ find_loads (rtx x, rtx store_pattern)
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0 && !ret; i--)
{
if (fmt[i] == 'e')
- ret |= find_loads (XEXP (x, i), store_pattern);
+ ret |= find_loads (XEXP (x, i), store_pattern, after);
else if (fmt[i] == 'E')
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- ret |= find_loads (XVECEXP (x, i, j), store_pattern);
+ ret |= find_loads (XVECEXP (x, i, j), store_pattern, after);
}
return ret;
}
/* Check if INSN kills the store pattern X (is aliased with it).
- Return true if it it does. */
+ AFTER is true if we are checking the case when store X occurs
+ after the insn. Return true if it it does. */
static bool
-store_killed_in_insn (rtx x, rtx x_regs, rtx insn)
+store_killed_in_insn (rtx x, rtx x_regs, rtx insn, int after)
{
- rtx reg, base;
+ rtx reg, base, note;
if (!INSN_P (insn))
return false;
@@ -7268,15 +7285,47 @@ store_killed_in_insn (rtx x, rtx x_regs, rtx insn)
if (GET_CODE (PATTERN (insn)) == SET)
{
rtx pat = PATTERN (insn);
+ rtx dest = SET_DEST (pat);
+
+ if (GET_CODE (dest) == SIGN_EXTRACT
+ || GET_CODE (dest) == ZERO_EXTRACT)
+ dest = XEXP (dest, 0);
+
/* Check for memory stores to aliased objects. */
- if (GET_CODE (SET_DEST (pat)) == MEM && !expr_equiv_p (SET_DEST (pat), x))
- /* pretend its a load and check for aliasing. */
- if (find_loads (SET_DEST (pat), x))
- return true;
- return find_loads (SET_SRC (pat), x);
+ if (GET_CODE (dest) == MEM
+ && !expr_equiv_p (dest, x))
+ {
+ if (after)
+ {
+ if (output_dependence (dest, x))
+ return true;
+ }
+ else
+ {
+ if (output_dependence (x, dest))
+ return true;
+ }
+ }
+ if (find_loads (SET_SRC (pat), x, after))
+ return true;
}
- else
- return find_loads (PATTERN (insn), x);
+ else if (find_loads (PATTERN (insn), x, after))
+ return true;
+
+ /* If this insn has a REG_EQUAL or REG_EQUIV note referencing a memory
+ location aliased with X, then this insn kills X. */
+ note = find_reg_equal_equiv_note (insn);
+ if (! note)
+ return false;
+ note = XEXP (note, 0);
+
+ /* However, if the note represents a must alias rather than a may
+ alias relationship, then it does not kill X. */
+ if (expr_equiv_p (note, x))
+ return false;
+
+ /* See if there are any aliased loads in the note. */
+ return find_loads (note, x, after);
}
/* Returns true if the expression X is loaded or clobbered on or after INSN
@@ -7300,7 +7349,7 @@ store_killed_after (rtx x, rtx x_regs, rtx insn, basic_block bb,
/* Scan from the end, so that fail_insn is determined correctly. */
for (act = last; act != PREV_INSN (insn); act = PREV_INSN (act))
- if (store_killed_in_insn (x, x_regs, act))
+ if (store_killed_in_insn (x, x_regs, act, false))
{
if (fail_insn)
*fail_insn = act;
@@ -7323,7 +7372,7 @@ store_killed_before (rtx x, rtx x_regs, rtx insn, basic_block bb,
return true;
for ( ; insn != PREV_INSN (first); insn = PREV_INSN (insn))
- if (store_killed_in_insn (x, x_regs, insn))
+ if (store_killed_in_insn (x, x_regs, insn, true))
return true;
return false;
@@ -7342,10 +7391,10 @@ build_store_vectors (void)
/* Build the gen_vector. This is any store in the table which is not killed
by aliasing later in its block. */
- ae_gen = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ ae_gen = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (ae_gen, last_basic_block);
- st_antloc = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ st_antloc = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (st_antloc, last_basic_block);
for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr))
@@ -7364,7 +7413,7 @@ build_store_vectors (void)
rtx r = gen_reg_rtx (GET_MODE (ptr->pattern));
if (gcse_file)
fprintf (gcse_file, "Removing redundant store:\n");
- replace_store_insn (r, XEXP (st, 0), bb);
+ replace_store_insn (r, XEXP (st, 0), bb, ptr);
continue;
}
SET_BIT (ae_gen[bb->index], ptr->index);
@@ -7378,10 +7427,10 @@ build_store_vectors (void)
}
}
- ae_kill = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ ae_kill = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (ae_kill, last_basic_block);
- transp = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ transp = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (transp, last_basic_block);
regs_set_in_block = xmalloc (sizeof (int) * max_gcse_regno);
@@ -7465,6 +7514,9 @@ insert_store (struct ls_expr * expr, edge e)
if (expr->reaching_reg == NULL_RTX)
return 0;
+ if (e->flags & EDGE_FAKE)
+ return 0;
+
reg = expr->reaching_reg;
insn = gen_move_insn (copy_rtx (expr->pattern), reg);
@@ -7473,13 +7525,14 @@ insert_store (struct ls_expr * expr, edge e)
edges so we don't try to insert it on the other edges. */
bb = e->dest;
for (tmp = e->dest->pred; tmp ; tmp = tmp->pred_next)
- {
- int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest);
- if (index == EDGE_INDEX_NO_EDGE)
- abort ();
- if (! TEST_BIT (pre_insert_map[index], expr->index))
- break;
- }
+ if (!(tmp->flags & EDGE_FAKE))
+ {
+ int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest);
+ if (index == EDGE_INDEX_NO_EDGE)
+ abort ();
+ if (! TEST_BIT (pre_insert_map[index], expr->index))
+ break;
+ }
/* If tmp is NULL, we found an insertion on every edge, blank the
insertion vector for these edges, and insert at the start of the BB. */
@@ -7515,13 +7568,87 @@ insert_store (struct ls_expr * expr, edge e)
return 1;
}
+/* Remove any REG_EQUAL or REG_EQUIV notes containing a reference to the
+ memory location in SMEXPR set in basic block BB.
+
+ This could be rather expensive. */
+
+static void
+remove_reachable_equiv_notes (basic_block bb, struct ls_expr *smexpr)
+{
+ edge *stack = xmalloc (sizeof (edge) * n_basic_blocks), act;
+ sbitmap visited = sbitmap_alloc (last_basic_block);
+ int stack_top = 0;
+ rtx last, insn, note;
+ rtx mem = smexpr->pattern;
+
+ sbitmap_zero (visited);
+ act = bb->succ;
+
+ while (1)
+ {
+ if (!act)
+ {
+ if (!stack_top)
+ {
+ free (stack);
+ sbitmap_free (visited);
+ return;
+ }
+ act = stack[--stack_top];
+ }
+ bb = act->dest;
+
+ if (bb == EXIT_BLOCK_PTR
+ || TEST_BIT (visited, bb->index)
+ || TEST_BIT (ae_kill[bb->index], smexpr->index))
+ {
+ act = act->succ_next;
+ continue;
+ }
+ SET_BIT (visited, bb->index);
+
+ if (TEST_BIT (st_antloc[bb->index], smexpr->index))
+ {
+ for (last = ANTIC_STORE_LIST (smexpr);
+ BLOCK_FOR_INSN (XEXP (last, 0)) != bb;
+ last = XEXP (last, 1))
+ continue;
+ last = XEXP (last, 0);
+ }
+ else
+ last = NEXT_INSN (bb->end);
+
+ for (insn = bb->head; insn != last; insn = NEXT_INSN (insn))
+ if (INSN_P (insn))
+ {
+ note = find_reg_equal_equiv_note (insn);
+ if (!note || !expr_equiv_p (XEXP (note, 0), mem))
+ continue;
+
+ if (gcse_file)
+ fprintf (gcse_file, "STORE_MOTION drop REG_EQUAL note at insn %d:\n",
+ INSN_UID (insn));
+ remove_note (insn, note);
+ }
+ act = act->succ_next;
+ if (bb->succ)
+ {
+ if (act)
+ stack[stack_top++] = act;
+ act = bb->succ;
+ }
+ }
+}
+
/* This routine will replace a store with a SET to a specified register. */
static void
-replace_store_insn (rtx reg, rtx del, basic_block bb)
+replace_store_insn (rtx reg, rtx del, basic_block bb, struct ls_expr *smexpr)
{
- rtx insn;
+ rtx insn, mem, note, set, ptr;
+ mem = smexpr->pattern;
insn = gen_move_insn (reg, SET_SRC (single_set (del)));
insn = emit_insn_after (insn, del);
@@ -7535,7 +7662,35 @@ replace_store_insn (rtx reg, rtx del, basic_block bb)
fprintf (gcse_file, "\n");
}
+ for (ptr = ANTIC_STORE_LIST (smexpr); ptr; ptr = XEXP (ptr, 1))
+ if (XEXP (ptr, 0) == del)
+ {
+ XEXP (ptr, 0) = insn;
+ break;
+ }
delete_insn (del);
+
+ /* 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))
+ if (INSN_P (insn))
+ {
+ set = single_set (insn);
+ if (!set)
+ continue;
+ if (expr_equiv_p (SET_DEST (set), mem))
+ return;
+ note = find_reg_equal_equiv_note (insn);
+ if (!note || !expr_equiv_p (XEXP (note, 0), mem))
+ continue;
+
+ if (gcse_file)
+ fprintf (gcse_file, "STORE_MOTION drop REG_EQUAL note at insn %d:\n",
+ INSN_UID (insn));
+ remove_note (insn, note);
+ }
+ remove_reachable_equiv_notes (bb, smexpr);
}
@@ -7559,7 +7714,7 @@ delete_store (struct ls_expr * expr, basic_block bb)
{
/* We know there is only one since we deleted redundant
ones during the available computation. */
- replace_store_insn (reg, del, bb);
+ replace_store_insn (reg, del, bb, expr);
break;
}
}
@@ -7622,6 +7777,7 @@ store_motion (void)
/* Now compute kill & transp vectors. */
build_store_vectors ();
add_noreturn_fake_exit_edges ();
+ connect_infinite_loops_to_exit ();
edge_list = pre_edge_rev_lcm (gcse_file, num_stores, transp, ae_gen,
st_antloc, ae_kill, &pre_insert_map,
@@ -7672,39 +7828,10 @@ bypass_jumps (FILE *file)
if (file)
dump_flow_info (file);
- /* Return if there's nothing to do. */
- if (n_basic_blocks <= 1)
+ /* 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;
- /* Trying to perform global optimizations on flow graphs which have
- a high connectivity will take a long time and is unlikely to be
- particularly useful.
-
- In normal circumstances a cfg should have about twice as many edges
- as blocks. But we do not want to punish small functions which have
- a couple switch statements. So we require a relatively large number
- of basic blocks and the ratio of edges to blocks to be high. */
- if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20)
- {
- if (warn_disabled_optimization)
- warning ("BYPASS disabled: %d > 1000 basic blocks and %d >= 20 edges/basic block",
- n_basic_blocks, n_edges / n_basic_blocks);
- return 0;
- }
-
- /* If allocating memory for the cprop bitmap would take up too much
- storage it's better just to disable the optimization. */
- if ((n_basic_blocks
- * SBITMAP_SET_SIZE (max_gcse_regno)
- * sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY)
- {
- if (warn_disabled_optimization)
- warning ("GCSE disabled: %d basic blocks and %d registers",
- n_basic_blocks, max_gcse_regno);
-
- return 0;
- }
-
gcc_obstack_init (&gcse_obstack);
bytes_used = 0;
@@ -7745,4 +7872,44 @@ bypass_jumps (FILE *file)
return changed;
}
+/* Return true if the graph is too expensive to optimize. PASS is the
+ optimization about to be performed. */
+
+static bool
+is_too_expensive (const char *pass)
+{
+ /* Trying to perform global optimizations on flow graphs which have
+ a high connectivity will take a long time and is unlikely to be
+ particularly useful.
+
+ In normal circumstances a cfg should have about twice as many
+ edges as blocks. But we do not want to punish small functions
+ which have a couple switch statements. Rather than simply
+ threshold the number of blocks, uses something with a more
+ graceful degradation. */
+ if (n_edges > 20000 + n_basic_blocks * 4)
+ {
+ if (warn_disabled_optimization)
+ warning ("%s: %d basic blocks and %d edges/basic block",
+ pass, n_basic_blocks, n_edges / n_basic_blocks);
+
+ return true;
+ }
+
+ /* If allocating memory for the cprop bitmap would take up too much
+ storage it's better just to disable the optimization. */
+ if ((n_basic_blocks
+ * SBITMAP_SET_SIZE (max_reg_num ())
+ * sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY)
+ {
+ if (warn_disabled_optimization)
+ warning ("%s: %d basic blocks and %d registers",
+ pass, n_basic_blocks, max_reg_num ());
+
+ return true;
+ }
+
+ return false;
+}
+
#include "gt-gcse.h"
diff --git a/gcc/genattr.c b/gcc/genattr.c
index 98cd08cee4d..49f368e53fc 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -268,8 +268,7 @@ main (int argc, char **argv)
if (unit == 0)
{
- unit = (struct function_unit *)
- xmalloc (sizeof (struct function_unit));
+ unit = xmalloc (sizeof (struct function_unit));
unit->name = xstrdup (name);
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 15a8afabc22..7024c01793b 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -183,8 +183,8 @@ struct attr_desc
unsigned unsigned_p : 1; /* Make the output function unsigned int. */
unsigned is_const : 1; /* Attribute value constant for each run. */
unsigned is_special : 1; /* Don't call `write_attr_set'. */
- unsigned func_units_p : 1; /* this is the function_units attribute */
- unsigned blockage_p : 1; /* this is the blockage range function */
+ unsigned func_units_p : 1; /* This is the function_units attribute. */
+ unsigned blockage_p : 1; /* This is the blockage range function. */
unsigned static_p : 1; /* Make the output function static. */
};
@@ -500,8 +500,7 @@ attr_hash_add_rtx (int hashcode, rtx rtl)
{
struct attr_hash *h;
- h = (struct attr_hash *) obstack_alloc (hash_obstack,
- sizeof (struct attr_hash));
+ h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
h->hashcode = hashcode;
h->u.rtl = rtl;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
@@ -515,8 +514,7 @@ attr_hash_add_string (int hashcode, char *str)
{
struct attr_hash *h;
- h = (struct attr_hash *) obstack_alloc (hash_obstack,
- sizeof (struct attr_hash));
+ h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
h->hashcode = -hashcode;
h->u.str = str;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
@@ -779,7 +777,7 @@ attr_string (const char *str, int len)
return h->u.str; /* <-- return if found. */
/* Not found; create a permanent copy and add it to the hash table. */
- new_str = (char *) obstack_alloc (hash_obstack, len + 1);
+ new_str = obstack_alloc (hash_obstack, len + 1);
memcpy (new_str, str, len);
new_str[len] = '\0';
attr_hash_add_string (hashcode, new_str);
@@ -1459,7 +1457,7 @@ get_attr_value (rtx value, struct attr_desc *attr, int insn_code)
|| insn_alternatives[av->first_insn->insn_code]))
return av;
- av = (struct attr_value *) oballoc (sizeof (struct attr_value));
+ av = oballoc (sizeof (struct attr_value));
av->value = value;
av->next = attr->first_value;
attr->first_value = av;
@@ -1875,13 +1873,10 @@ expand_units (void)
/* Create an array of ops for each unit. Add an extra unit for the
result_ready_cost function that has the ops of all other units. */
- unit_ops = (struct function_unit_op ***)
- xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
- unit_num = (struct function_unit **)
- xmalloc ((num_units + 1) * sizeof (struct function_unit *));
+ unit_ops = xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
+ unit_num = xmalloc ((num_units + 1) * sizeof (struct function_unit *));
- unit_num[num_units] = unit = (struct function_unit *)
- xmalloc (sizeof (struct function_unit));
+ unit_num[num_units] = unit = xmalloc (sizeof (struct function_unit));
unit->num = num_units;
unit->num_opclasses = 0;
@@ -1889,7 +1884,7 @@ expand_units (void)
{
unit_num[num_units]->num_opclasses += unit->num_opclasses;
unit_num[unit->num] = unit;
- unit_ops[unit->num] = op_array = (struct function_unit_op **)
+ unit_ops[unit->num] = op_array =
xmalloc (unit->num_opclasses * sizeof (struct function_unit_op *));
for (op = unit->ops; op; op = op->next)
@@ -1897,7 +1892,7 @@ expand_units (void)
}
/* Compose the array of ops for the extra unit. */
- unit_ops[num_units] = op_array = (struct function_unit_op **)
+ unit_ops[num_units] = op_array =
xmalloc (unit_num[num_units]->num_opclasses
* sizeof (struct function_unit_op *));
@@ -2253,7 +2248,7 @@ fill_attr (struct attr_desc *attr)
else
av = get_attr_value (value, attr, id->insn_code);
- ie = (struct insn_ent *) oballoc (sizeof (struct insn_ent));
+ ie = oballoc (sizeof (struct insn_ent));
ie->insn_code = id->insn_code;
ie->insn_index = id->insn_code;
insert_insn_ent (av, ie);
@@ -2379,7 +2374,7 @@ make_length_attrs (void)
no_address_fn[i],
address_fn[i]),
new_attr, ie->insn_code);
- new_ie = (struct insn_ent *) oballoc (sizeof (struct insn_ent));
+ new_ie = oballoc (sizeof (struct insn_ent));
new_ie->insn_code = ie->insn_code;
new_ie->insn_index = ie->insn_index;
insert_insn_ent (new_av, new_ie);
@@ -2458,7 +2453,7 @@ simplify_cond (rtx exp, int insn_code, int insn_index)
rtx defval = XEXP (exp, 1);
rtx new_defval = XEXP (exp, 1);
int len = XVECLEN (exp, 0);
- rtx *tests = (rtx *) xmalloc (len * sizeof (rtx));
+ rtx *tests = xmalloc (len * sizeof (rtx));
int allsame = 1;
rtx ret;
@@ -3398,17 +3393,13 @@ optimize_attrs (void)
return;
/* Make 2 extra elements, for "code" values -2 and -1. */
- insn_code_values
- = (struct attr_value_list **) xmalloc ((insn_code_number + 2)
- * sizeof (struct attr_value_list *));
- memset ((char *) insn_code_values, 0,
- (insn_code_number + 2) * sizeof (struct attr_value_list *));
+ insn_code_values = xcalloc ((insn_code_number + 2),
+ sizeof (struct attr_value_list *));
/* Offset the table address so we can index by -2 or -1. */
insn_code_values += 2;
- iv = ivbuf = ((struct attr_value_list *)
- xmalloc (num_insn_ents * sizeof (struct attr_value_list)));
+ iv = ivbuf = xmalloc (num_insn_ents * sizeof (struct attr_value_list));
for (i = 0; i < MAX_ATTRS_INDEX; i++)
for (attr = attrs[i]; attr; attr = attr->next)
@@ -3499,7 +3490,7 @@ simplify_by_exploding (rtx exp)
cover the domain of the attribute. This makes the expanded COND form
order independent. */
- space = (struct dimension *) xmalloc (ndim * sizeof (struct dimension));
+ space = xmalloc (ndim * sizeof (struct dimension));
total = 1;
for (ndim = 0; list; ndim++)
@@ -3554,8 +3545,8 @@ simplify_by_exploding (rtx exp)
for (i = 0; i < ndim; i++)
space[i].current_value = space[i].values;
- condtest = (rtx *) xmalloc (total * sizeof (rtx));
- condval = (rtx *) xmalloc (total * sizeof (rtx));
+ condtest = xmalloc (total * sizeof (rtx));
+ condval = xmalloc (total * sizeof (rtx));
/* Expand the tests and values by iterating over all values in the
attribute space. */
@@ -4052,7 +4043,7 @@ gen_attr (rtx exp, int lineno)
name_ptr = XSTR (exp, 1);
while ((p = next_comma_elt (&name_ptr)) != NULL)
{
- av = (struct attr_value *) oballoc (sizeof (struct attr_value));
+ av = oballoc (sizeof (struct attr_value));
av->value = attr_rtx (CONST_STRING, p);
av->next = attr->first_value;
attr->first_value = av;
@@ -4196,7 +4187,7 @@ gen_insn (rtx exp, int lineno)
{
struct insn_def *id;
- id = (struct insn_def *) oballoc (sizeof (struct insn_def));
+ id = oballoc (sizeof (struct insn_def));
id->next = defs;
defs = id;
id->def = exp;
@@ -4260,7 +4251,7 @@ gen_delay (rtx def, int lineno)
have_annul_false = 1;
}
- delay = (struct delay_desc *) oballoc (sizeof (struct delay_desc));
+ delay = oballoc (sizeof (struct delay_desc));
delay->def = def;
delay->num = ++num_delays;
delay->next = delays;
@@ -4307,7 +4298,7 @@ gen_unit (rtx def, int lineno)
if (unit == 0)
{
- unit = (struct function_unit *) oballoc (sizeof (struct function_unit));
+ unit = oballoc (sizeof (struct function_unit));
unit->name = name;
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
@@ -4322,7 +4313,7 @@ gen_unit (rtx def, int lineno)
}
/* Make a new operation class structure entry and initialize it. */
- op = (struct function_unit_op *) oballoc (sizeof (struct function_unit_op));
+ op = oballoc (sizeof (struct function_unit_op));
op->condexp = condexp;
op->num = unit->num_opclasses++;
op->ready = ready_cost;
@@ -5579,7 +5570,7 @@ find_attr (const char *name, int create)
if (! create)
return NULL;
- attr = (struct attr_desc *) oballoc (sizeof (struct attr_desc));
+ attr = oballoc (sizeof (struct attr_desc));
attr->name = attr_string (name, strlen (name));
attr->first_value = attr->default_val = NULL;
attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0;
@@ -5896,13 +5887,13 @@ from the machine description file `md'. */\n\n");
printf ("#define operands recog_data.operand\n\n");
/* Make `insn_alternatives'. */
- insn_alternatives = (int *) oballoc (insn_code_number * sizeof (int));
+ insn_alternatives = oballoc (insn_code_number * sizeof (int));
for (id = defs; id; id = id->next)
if (id->insn_code >= 0)
insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1;
/* Make `insn_n_alternatives'. */
- insn_n_alternatives = (int *) oballoc (insn_code_number * sizeof (int));
+ insn_n_alternatives = oballoc (insn_code_number * sizeof (int));
for (id = defs; id; id = id->next)
if (id->insn_code >= 0)
insn_n_alternatives[id->insn_code] = id->num_alternatives;
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index bafb2553cde..a5783e6f80d 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -1922,15 +1922,15 @@ gen_automaton (rtx def)
void
gen_automata_option (rtx def)
{
- if (strcmp ((char *) XSTR (def, 0), NO_MINIMIZATION_OPTION + 1) == 0)
+ if (strcmp (XSTR (def, 0), NO_MINIMIZATION_OPTION + 1) == 0)
no_minimization_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), TIME_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), TIME_OPTION + 1) == 0)
time_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), V_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), V_OPTION + 1) == 0)
v_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), W_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), W_OPTION + 1) == 0)
w_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), NDFA_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), NDFA_OPTION + 1) == 0)
ndfa_flag = 1;
else
fatal ("invalid option `%s' in automata_option", XSTR (def, 0));
@@ -8842,8 +8842,7 @@ output_get_cpu_unit_code_func (void)
LOW_VARIABLE_NAME, MIDDLE_VARIABLE_NAME, HIGH_VARIABLE_NAME);
fprintf (output_file, " static struct %s %s [] =\n {\n",
NAME_CODE_STRUCT_NAME, NAME_CODE_TABLE_NAME);
- units = (unit_decl_t *) xmalloc (sizeof (unit_decl_t)
- * description->units_num);
+ units = xmalloc (sizeof (unit_decl_t) * description->units_num);
memcpy (units, units_array, sizeof (unit_decl_t) * description->units_num);
qsort (units, description->units_num, sizeof (unit_decl_t), units_cmp);
for (i = 0; i < description->units_num; i++)
@@ -8927,7 +8926,7 @@ output_dfa_start_func (void)
fprintf (output_file,
"void\n%s (void)\n{\n %s = get_max_uid ();\n",
DFA_START_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
- fprintf (output_file, " %s = (int *) xmalloc (%s * sizeof (int));\n",
+ fprintf (output_file, " %s = xmalloc (%s * sizeof (int));\n",
DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
fprintf (output_file, " %s ();\n}\n\n", DFA_CLEAN_INSN_CACHE_FUNC_NAME);
}
diff --git a/gcc/genconditions.c b/gcc/genconditions.c
index 2d4cf8d2a61..32ac5aef475 100644
--- a/gcc/genconditions.c
+++ b/gcc/genconditions.c
@@ -57,7 +57,7 @@ add_condition (const char *expr)
if (expr[0] == 0)
return;
- test = (struct c_test *) xmalloc (sizeof (struct c_test));
+ test = xmalloc (sizeof (struct c_test));
test->expr = expr;
*(htab_find_slot (condition_table, test, INSERT)) = test;
diff --git a/gcc/genemit.c b/gcc/genemit.c
index ea787d24c00..8a821d67bc2 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -317,8 +317,7 @@ gen_insn (rtx insn, int lineno)
if (i != XVECLEN (insn, 1) - 1)
{
struct clobber_pat *p;
- struct clobber_ent *link
- = (struct clobber_ent *) xmalloc (sizeof (struct clobber_ent));
+ struct clobber_ent *link = xmalloc (sizeof (struct clobber_ent));
int j;
link->code_number = insn_code_number;
@@ -354,7 +353,7 @@ gen_insn (rtx insn, int lineno)
if (p == 0)
{
- p = (struct clobber_pat *) xmalloc (sizeof (struct clobber_pat));
+ p = xmalloc (sizeof (struct clobber_pat));
p->insns = 0;
p->pattern = insn;
diff --git a/gcc/genextract.c b/gcc/genextract.c
index ef53050fbca..d3365736510 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -129,7 +129,7 @@ gen_insn (rtx insn)
walk_rtx (XVECEXP (insn, 1, i), path);
}
- link = (struct code_ptr *) xmalloc (sizeof (struct code_ptr));
+ link = xmalloc (sizeof (struct code_ptr));
link->insn_code = insn_code_number;
/* See if we find something that already had this extraction method. */
@@ -164,7 +164,7 @@ gen_insn (rtx insn)
/* Otherwise, make a new extraction method. */
- p = (struct extraction *) xmalloc (sizeof (struct extraction));
+ p = xmalloc (sizeof (struct extraction));
p->op_count = op_count;
p->dup_count = dup_count;
p->next = extractions;
@@ -220,7 +220,7 @@ walk_rtx (rtx x, const char *path)
dupnums[dup_count] = XINT (x, 0);
dup_count++;
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -236,7 +236,7 @@ walk_rtx (rtx x, const char *path)
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -252,7 +252,7 @@ walk_rtx (rtx x, const char *path)
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -272,7 +272,7 @@ walk_rtx (rtx x, const char *path)
break;
}
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -412,8 +412,7 @@ from the machine description file `md'. */\n\n");
else if (GET_CODE (desc) == DEFINE_PEEPHOLE)
{
- struct code_ptr *link
- = (struct code_ptr *) xmalloc (sizeof (struct code_ptr));
+ struct code_ptr *link = xmalloc (sizeof (struct code_ptr));
link->insn_code = insn_code_number;
link->next = peepholes;
@@ -509,8 +508,7 @@ record_insn_name (int code, const char *name)
{
int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
- insn_name_ptr =
- (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
+ insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
index ad70ba82e63..bbdf9913be4 100644
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -194,6 +194,8 @@ ITYPE {IWORD}({WS}{IWORD})*
^"%{" { BEGIN(in_yacc_escape); }
+^"@@".* /* Used for c-parse.in C/ObjC demarcation. */
+
{WS} { update_lineno (yytext, yyleng); }
"const"/[^[:alnum:]_] /* don't care */
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 79e763cc7e1..67063ecb1c6 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -643,7 +643,6 @@ adjust_field_tree_exp (type_p t, options_p opt ATTRIBUTE_UNUSED)
{ "GOTO_SUBROUTINE_EXPR", 0, 2 },
{ "RTL_EXPR", 0, 2 },
{ "WITH_CLEANUP_EXPR", 2, 1 },
- { "METHOD_CALL_EXPR", 3, 1 }
};
if (t->kind != TYPE_ARRAY)
@@ -1481,12 +1480,13 @@ output_escaped_param (struct walk_type_data *d, const char *param,
/* Call D->PROCESS_FIELD for every field (or subfield) of D->VAL,
which is of type T. Write code to D->OF to constrain execution (at
the point that D->PROCESS_FIELD is called) to the appropriate
- cases. D->PREV_VAL lists the objects containing the current object,
- D->OPT is a list of options to apply, D->INDENT is the current
- indentation level, D->LINE is used to print error messages,
- D->BITMAP indicates which languages to print the structure for, and
- D->PARAM is the current parameter (from an enclosing param_is
- option). */
+ cases. Call D->PROCESS_FIELD on subobjects before calling it on
+ pointers to those objects. D->PREV_VAL lists the objects
+ containing the current object, D->OPT is a list of options to
+ apply, D->INDENT is the current indentation level, D->LINE is used
+ to print error messages, D->BITMAP indicates which languages to
+ print the structure for, and D->PARAM is the current parameter
+ (from an enclosing param_is option). */
static void
walk_type (type_p t, struct walk_type_data *d)
@@ -1623,7 +1623,6 @@ walk_type (type_p t, struct walk_type_data *d)
oprintf (d->of, "%*sif (%s != NULL) {\n", d->indent, "", d->val);
d->indent += 2;
oprintf (d->of, "%*ssize_t i%d;\n", d->indent, "", loopcounter);
- d->process_field(t, d);
oprintf (d->of, "%*sfor (i%d = 0; i%d < (size_t)(", d->indent, "",
loopcounter, loopcounter);
output_escaped_param (d, length, "length");
@@ -1639,6 +1638,7 @@ walk_type (type_p t, struct walk_type_data *d)
d->used_length = 0;
d->indent -= 2;
oprintf (d->of, "%*s}\n", d->indent, "");
+ d->process_field(t, d);
d->indent -= 2;
oprintf (d->of, "%*s}\n", d->indent, "");
}
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index e3810749ea3..74725fa57b3 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -782,7 +782,7 @@ validate_insn_operands (struct data *d)
static void
gen_insn (rtx insn, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
@@ -823,7 +823,7 @@ gen_insn (rtx insn, int lineno)
static void
gen_peephole (rtx peep, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
@@ -861,7 +861,7 @@ gen_peephole (rtx peep, int lineno)
static void
gen_expand (rtx insn, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
@@ -904,7 +904,7 @@ gen_expand (rtx insn, int lineno)
static void
gen_split (rtx split, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 9723126b274..76f37496107 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -316,10 +316,8 @@ extern void debug_decision_list
static struct decision *
new_decision (const char *position, struct decision_head *last)
{
- struct decision *new
- = (struct decision *) xmalloc (sizeof (struct decision));
+ struct decision *new = xcalloc (1, sizeof (struct decision));
- memset (new, 0, sizeof (*new));
new->success = *last;
new->position = xstrdup (position);
new->number = next_number++;
@@ -336,7 +334,7 @@ new_decision_test (enum decision_type type, struct decision_test ***pplace)
struct decision_test **place = *pplace;
struct decision_test *test;
- test = (struct decision_test *) xmalloc (sizeof (*test));
+ test = xmalloc (sizeof (*test));
test->next = *place;
test->type = type;
*place = test;
@@ -770,7 +768,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
if (depth > max_depth)
max_depth = depth;
- subpos = (char *) xmalloc (depth + 2);
+ subpos = xmalloc (depth + 2);
strcpy (subpos, position);
subpos[depth + 1] = 0;
@@ -2667,8 +2665,7 @@ record_insn_name (int code, const char *name)
{
int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
- insn_name_ptr =
- (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
+ insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index a255a7254d1..23f8e3f32cd 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -140,7 +140,7 @@ static void
queue_pattern (rtx pattern, struct queue_elem ***list_tail,
const char *filename, int lineno)
{
- struct queue_elem *e = (struct queue_elem *) xmalloc (sizeof (*e));
+ struct queue_elem *e = xmalloc (sizeof (*e));
e->data = pattern;
e->filename = filename;
e->lineno = lineno;
@@ -583,7 +583,7 @@ alter_predicate_for_insn (rtx pattern, int alt, int max_op, int lineno)
{
size_t c_len = strlen (c);
size_t len = alt * (c_len + 1);
- char *new_c = (char *) xmalloc (len);
+ char *new_c = xmalloc (len);
memcpy (new_c, c, c_len);
for (i = 1; i < alt; ++i)
@@ -876,8 +876,7 @@ init_md_reader_args (int argc, char **argv)
{
struct file_name_list *dirtmp;
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ dirtmp = xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
if (first_dir_md_include == 0)
first_dir_md_include = dirtmp;
@@ -1078,7 +1077,7 @@ maybe_eval_c_test (const char *expr)
return -1;
dummy.expr = expr;
- test = (const struct c_test *) htab_find (condition_table, &dummy);
+ test = htab_find (condition_table, &dummy);
if (!test)
abort ();
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index 3163c15f83b..5f0d11dd9ba 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -29,6 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "toplev.h"
#include "params.h"
+#include "hosthooks.h"
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
@@ -450,19 +451,24 @@ gt_pch_save (FILE *f)
mmi.size = ggc_pch_total_size (state.d);
- /* Try to arrange things so that no relocation is necessary,
- but don't try very hard. On most platforms, this will always work,
- and on the rest it's a lot of work to do better. */
+ /* Try to arrange things so that no relocation is necessary, but
+ don't try very hard. On most platforms, this will always work,
+ and on the rest it's a lot of work to do better.
+ (The extra work goes in HOST_HOOKS_GT_PCH_GET_ADDRESS and
+ HOST_HOOKS_GT_PCH_USE_ADDRESS.) */
+ mmi.preferred_base = host_hooks.gt_pch_get_address (mmi.size);
+
#if HAVE_MMAP_FILE
- mmi.preferred_base = mmap (NULL, mmi.size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE,
- fileno (state.f), 0);
- if (mmi.preferred_base == (void *) MAP_FAILED)
- mmi.preferred_base = NULL;
- else
- munmap (mmi.preferred_base, mmi.size);
-#else /* HAVE_MMAP_FILE */
- mmi.preferred_base = NULL;
+ if (mmi.preferred_base == NULL)
+ {
+ mmi.preferred_base = mmap (NULL, mmi.size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ fileno (state.f), 0);
+ if (mmi.preferred_base == (void *) MAP_FAILED)
+ mmi.preferred_base = NULL;
+ else
+ munmap (mmi.preferred_base, mmi.size);
+ }
#endif /* HAVE_MMAP_FILE */
ggc_pch_this_base (state.d, mmi.preferred_base);
@@ -539,6 +545,7 @@ gt_pch_restore (FILE *f)
size_t i;
struct mmap_info mmi;
void *addr;
+ bool needs_read;
/* Delete any deletable objects. This makes ggc_pch_read much
faster, as it can be sure that no GCable objects remain other
@@ -571,47 +578,75 @@ gt_pch_restore (FILE *f)
if (fread (&mmi, sizeof (mmi), 1, f) != 1)
fatal_error ("can't read PCH file: %m");
+ if (host_hooks.gt_pch_use_address (mmi.preferred_base, mmi.size))
+ {
#if HAVE_MMAP_FILE
- addr = mmap (mmi.preferred_base, mmi.size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE,
- fileno (f), mmi.offset);
+ void *mmap_result;
-#if HAVE_MINCORE
- if (addr != mmi.preferred_base)
- {
- size_t page_size = getpagesize();
- char one_byte;
-
- if (addr != (void *) MAP_FAILED)
- munmap (addr, mmi.size);
-
- /* We really want to be mapped at mmi.preferred_base
- so we're going to resort to MAP_FIXED. But before,
- make sure that we can do so without destroying a
- previously mapped area, by looping over all pages
- that would be affected by the fixed mapping. */
- errno = 0;
-
- for (i = 0; i < mmi.size; i+= page_size)
- if (mincore ((char *)mmi.preferred_base + i, page_size, (void *)&one_byte) == -1
- && errno == ENOMEM)
- continue; /* The page is not mapped. */
- else
- break;
-
- if (i >= mmi.size)
- addr = mmap (mmi.preferred_base, mmi.size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
- fileno (f), mmi.offset);
+ mmap_result = mmap (mmi.preferred_base, mmi.size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
+ fileno (f), mmi.offset);
+
+ /* The file might not be mmap-able. */
+ needs_read = mmap_result == (void *) MAP_FAILED;
+
+ /* Sanity check for broken MAP_FIXED. */
+ if (! needs_read && mmap_result != mmi.preferred_base)
+ abort ();
+#else
+ needs_read = true;
+#endif
+ addr = mmi.preferred_base;
}
+ else
+ {
+#if HAVE_MMAP_FILE
+ addr = mmap (mmi.preferred_base, mmi.size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ fileno (f), mmi.offset);
+
+#if HAVE_MINCORE
+ if (addr != mmi.preferred_base)
+ {
+ size_t page_size = getpagesize();
+ char one_byte;
+
+ if (addr != (void *) MAP_FAILED)
+ munmap (addr, mmi.size);
+
+ /* We really want to be mapped at mmi.preferred_base
+ so we're going to resort to MAP_FIXED. But before,
+ make sure that we can do so without destroying a
+ previously mapped area, by looping over all pages
+ that would be affected by the fixed mapping. */
+ errno = 0;
+
+ for (i = 0; i < mmi.size; i+= page_size)
+ if (mincore ((char *)mmi.preferred_base + i, page_size,
+ (void *)&one_byte) == -1
+ && errno == ENOMEM)
+ continue; /* The page is not mapped. */
+ else
+ break;
+
+ if (i >= mmi.size)
+ addr = mmap (mmi.preferred_base, mmi.size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
+ fileno (f), mmi.offset);
+ }
#endif /* HAVE_MINCORE */
+
+ needs_read = addr == (void *) MAP_FAILED;
#else /* HAVE_MMAP_FILE */
- addr = MAP_FAILED;
+ needs_read = true;
#endif /* HAVE_MMAP_FILE */
- if (addr == (void *) MAP_FAILED)
+ if (needs_read)
+ addr = xmalloc (mmi.size);
+ }
+
+ if (needs_read)
{
- addr = xmalloc (mmi.size);
if (fseek (f, mmi.offset, SEEK_SET) != 0
|| fread (&mmi, mmi.size, 1, f) != 1)
fatal_error ("can't read PCH file: %m");
@@ -704,7 +739,7 @@ ggc_min_heapsize_heuristic (void)
/* Adjust for rlimits. */
min_heap_kbytes = ggc_rlimit_bound (min_heap_kbytes);
- min_heap_kbytes /= 1024; /* convert to Kbytes. */
+ min_heap_kbytes /= 1024; /* Convert to Kbytes. */
/* The heuristic is RAM/8, with a lower bound of 4M and an upper
bound of 128M (when RAM >= 1GB). */
@@ -718,7 +753,7 @@ ggc_min_heapsize_heuristic (void)
void
init_ggc_heuristics (void)
{
-#ifndef ENABLE_GC_ALWAYS_COLLECT
+#if !defined ENABLE_GC_CHECKING && !defined ENABLE_GC_ALWAYS_COLLECT
set_param_value ("ggc-min-expand", ggc_min_expand_heuristic());
set_param_value ("ggc-min-heapsize", ggc_min_heapsize_heuristic());
#endif
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 5063ccd18ba..e8b3ddb8558 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -184,8 +184,8 @@ static const size_t extra_order_size_table[] = {
sizeof (struct tree_decl),
sizeof (struct tree_list),
TREE_EXP_SIZE (2),
- RTL_SIZE (2), /* REG, MEM, PLUS, etc. */
- RTL_SIZE (10), /* INSN, CALL_INSN, JUMP_INSN */
+ RTL_SIZE (2), /* MEM, PLUS, etc. */
+ RTL_SIZE (9), /* INSN, CALL_INSN, JUMP_INSN */
};
/* The total number of orders. */
@@ -400,6 +400,31 @@ static struct globals
better runtime data access pattern. */
unsigned long **save_in_use;
+#ifdef GATHER_STATISTICS
+ struct
+ {
+ /* Total memory allocated with ggc_alloc */
+ unsigned long long total_allocated;
+ /* 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.
+ These sizes are interesting because they are typical cache line
+ sizes. */
+
+ unsigned long long total_allocated_under32;
+ unsigned long long total_overhead_under32;
+
+ unsigned long long total_allocated_under64;
+ unsigned long long total_overhead_under64;
+
+ unsigned long long total_allocated_under128;
+ unsigned long long total_overhead_under128;
+
+ /* The overhead for each of the allocation orders. */
+ unsigned long long total_overhead_per_order[NUM_ORDERS];
+ } stats;
+#endif
} G;
/* The size in bytes required to maintain a bitmap for the objects
@@ -453,8 +478,7 @@ push_depth (unsigned int i)
if (G.depth_in_use >= G.depth_max)
{
G.depth_max *= 2;
- G.depth = (unsigned int *) xrealloc ((char *) G.depth,
- G.depth_max * sizeof (unsigned int));
+ G.depth = xrealloc (G.depth, G.depth_max * sizeof (unsigned int));
}
G.depth[G.depth_in_use++] = i;
}
@@ -467,10 +491,10 @@ push_by_depth (page_entry *p, unsigned long *s)
if (G.by_depth_in_use >= G.by_depth_max)
{
G.by_depth_max *= 2;
- G.by_depth = (page_entry **) xrealloc ((char *) G.by_depth,
- G.by_depth_max * sizeof (page_entry *));
- G.save_in_use = (unsigned long **) xrealloc ((char *) G.save_in_use,
- G.by_depth_max * sizeof (unsigned long *));
+ G.by_depth = xrealloc (G.by_depth,
+ G.by_depth_max * sizeof (page_entry *));
+ G.save_in_use = xrealloc (G.save_in_use,
+ G.by_depth_max * sizeof (unsigned long *));
}
G.by_depth[G.by_depth_in_use] = p;
G.save_in_use[G.by_depth_in_use++] = s;
@@ -562,7 +586,7 @@ set_page_table_entry (void *p, page_entry *entry)
goto found;
/* Not found -- allocate a new table. */
- table = (page_table) xcalloc (1, sizeof(*table));
+ table = xcalloc (1, sizeof(*table));
table->next = G.lookup;
table->high_bits = high_bits;
G.lookup = table;
@@ -575,7 +599,7 @@ found:
L2 = LOOKUP_L2 (p);
if (base[L1] == NULL)
- base[L1] = (page_entry **) xcalloc (PAGE_L2_SIZE, sizeof (page_entry *));
+ base[L1] = xcalloc (PAGE_L2_SIZE, sizeof (page_entry *));
base[L1][L2] = entry;
}
@@ -723,7 +747,7 @@ alloc_page (unsigned order)
memory order. */
for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--)
{
- e = (struct page_entry *) xcalloc (1, page_entry_size);
+ e = xcalloc (1, page_entry_size);
e->order = order;
e->bytes = G.pagesize;
e->page = page + (i << G.lg_pagesize);
@@ -795,7 +819,7 @@ alloc_page (unsigned order)
struct page_entry *e, *f = G.free_pages;
for (a = enda - G.pagesize; a != page; a -= G.pagesize)
{
- e = (struct page_entry *) xcalloc (1, page_entry_size);
+ e = xcalloc (1, page_entry_size);
e->order = order;
e->bytes = G.pagesize;
e->page = a;
@@ -809,7 +833,7 @@ alloc_page (unsigned order)
#endif
if (entry == NULL)
- entry = (struct page_entry *) xcalloc (1, page_entry_size);
+ entry = xcalloc (1, page_entry_size);
entry->bytes = entry_size;
entry->page = page;
@@ -1123,6 +1147,30 @@ ggc_alloc (size_t size)
information is used in deciding when to collect. */
G.allocated += OBJECT_SIZE (order);
+#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);
+
+ if (size <= 32){
+ G.stats.total_overhead_under32 += OBJECT_SIZE (order) - size;
+ G.stats.total_allocated_under32 += OBJECT_SIZE(order);
+ }
+
+ if (size <= 64){
+ G.stats.total_overhead_under64 += OBJECT_SIZE (order) - size;
+ G.stats.total_allocated_under64 += OBJECT_SIZE(order);
+ }
+
+ if (size <= 128){
+ G.stats.total_overhead_under128 += OBJECT_SIZE (order) - size;
+ G.stats.total_allocated_under128 += OBJECT_SIZE(order);
+ }
+
+ }
+#endif
+
if (GGC_DEBUG_LEVEL >= 3)
fprintf (G.debug_file,
"Allocating object, requested size=%lu, actual=%lu at %p on %p\n",
@@ -1278,7 +1326,7 @@ init_ggc (void)
}
/* We have a good page, might as well hold onto it... */
- e = (struct page_entry *) xcalloc (1, sizeof (struct page_entry));
+ e = xcalloc (1, sizeof (struct page_entry));
e->bytes = G.pagesize;
e->page = p;
e->next = G.free_pages;
@@ -1324,12 +1372,12 @@ init_ggc (void)
G.depth_in_use = 0;
G.depth_max = 10;
- G.depth = (unsigned int *) xmalloc (G.depth_max * sizeof (unsigned int));
+ G.depth = xmalloc (G.depth_max * sizeof (unsigned int));
G.by_depth_in_use = 0;
G.by_depth_max = INITIAL_PTE_COUNT;
- G.by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *));
- G.save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *));
+ G.by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
+ G.save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
}
/* Increment the `GC context'. Objects allocated in an outer context
@@ -1404,7 +1452,7 @@ ggc_pop_context (void)
G.context_depth_allocations &= omask - 1;
G.context_depth_collections &= omask - 1;
- /* The G.depth array is shortend so that the last index is the
+ /* The G.depth array is shortened so that the last index is the
context_depth of the top element of by_depth. */
if (depth+1 < G.depth_in_use)
e = G.depth[depth+1];
@@ -1761,7 +1809,7 @@ ggc_print_statistics (void)
/* Collect some information about the various sizes of
allocation. */
- fprintf (stderr, "\n%-5s %10s %10s %10s\n",
+ fprintf (stderr, "%-5s %10s %10s %10s\n",
"Size", "Allocated", "Used", "Overhead");
for (i = 0; i < NUM_ORDERS; ++i)
{
@@ -1799,6 +1847,33 @@ ggc_print_statistics (void)
SCALE (G.bytes_mapped), LABEL (G.bytes_mapped),
SCALE (G.allocated), LABEL(G.allocated),
SCALE (total_overhead), LABEL (total_overhead));
+
+#ifdef GATHER_STATISTICS
+ {
+ fprintf (stderr, "Total Overhead: %10lld\n",
+ G.stats.total_overhead);
+ fprintf (stderr, "Total Allocated: %10lld\n",
+ G.stats.total_allocated);
+
+ fprintf (stderr, "Total Overhead under 32B: %10lld\n",
+ G.stats.total_overhead_under32);
+ fprintf (stderr, "Total Allocated under 32B: %10lld\n",
+ G.stats.total_allocated_under32);
+ fprintf (stderr, "Total Overhead under 64B: %10lld\n",
+ G.stats.total_overhead_under64);
+ fprintf (stderr, "Total Allocated under 64B: %10lld\n",
+ G.stats.total_allocated_under64);
+ fprintf (stderr, "Total Overhead under 128B: %10lld\n",
+ G.stats.total_overhead_under128);
+ fprintf (stderr, "Total Allocated under 128B: %10lld\n",
+ 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]);
+ }
+#endif
}
struct ggc_pch_data
@@ -1941,8 +2016,8 @@ move_ptes_to_front (int count_old_page_tables, int count_new_page_tables)
page_entry **new_by_depth;
unsigned long **new_save_in_use;
- new_by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *));
- new_save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *));
+ new_by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
+ new_save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
memcpy (&new_by_depth[0],
&G.by_depth[count_old_page_tables],
diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c
index 488df3a95ab..eee33a568af 100644
--- a/gcc/ggc-simple.c
+++ b/gcc/ggc-simple.c
@@ -166,7 +166,7 @@ ggc_alloc (size_t size)
{
struct ggc_mem *x;
- x = (struct ggc_mem *) xmalloc (offsetof (struct ggc_mem, u) + size);
+ x = xmalloc (offsetof (struct ggc_mem, u) + size);
x->sub[0] = NULL;
x->sub[1] = NULL;
x->mark = 0;
diff --git a/gcc/ggc.h b/gcc/ggc.h
index b1391a80457..3a88e165479 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -19,6 +19,9 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+#ifndef GCC_GGC_H
+#define GCC_GGC_H
+
/* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with
an external gc library that might be linked in. */
@@ -197,14 +200,14 @@ extern void *ggc_realloc (void *, size_t);
extern void *ggc_calloc (size_t, size_t);
#define ggc_alloc_rtx(NSLOTS) \
- ((struct rtx_def *) ggc_alloc (sizeof (struct rtx_def) \
- + ((NSLOTS) - 1) * sizeof (rtunion)))
+ ((rtx) ggc_alloc (sizeof (struct rtx_def) \
+ + ((NSLOTS) - 1) * sizeof (rtunion)))
#define ggc_alloc_rtvec(NELT) \
- ((struct rtvec_def *) ggc_alloc (sizeof (struct rtvec_def) \
- + ((NELT) - 1) * sizeof (rtx)))
+ ((rtvec) ggc_alloc (sizeof (struct rtvec_def) \
+ + ((NELT) - 1) * sizeof (rtx)))
-#define ggc_alloc_tree(LENGTH) ((union tree_node *) ggc_alloc (LENGTH))
+#define ggc_alloc_tree(LENGTH) ((tree) ggc_alloc (LENGTH))
#define htab_create_ggc(SIZE, HASH, EQ, DEL) \
htab_create_alloc (SIZE, HASH, EQ, DEL, ggc_calloc, NULL)
@@ -259,3 +262,5 @@ extern void stringpool_statistics (void);
extern int ggc_min_expand_heuristic (void);
extern int ggc_min_heapsize_heuristic (void);
extern void init_ggc_heuristics (void);
+
+#endif
diff --git a/gcc/global.c b/gcc/global.c
index 0573eeb285f..c808e207406 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -398,14 +398,14 @@ global_alloc (FILE *file)
/* Establish mappings from register number to allocation number
and vice versa. In the process, count the allocnos. */
- reg_allocno = (int *) xmalloc (max_regno * sizeof (int));
+ reg_allocno = xmalloc (max_regno * sizeof (int));
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
reg_allocno[i] = -1;
/* Initialize the shared-hard-reg mapping
from the list of pairs that may share. */
- reg_may_share = (int *) xcalloc (max_regno, sizeof (int));
+ reg_may_share = xcalloc (max_regno, sizeof (int));
for (x = regs_may_share; x; x = XEXP (XEXP (x, 1), 1))
{
int r1 = REGNO (XEXP (x, 0));
@@ -436,7 +436,7 @@ global_alloc (FILE *file)
else
reg_allocno[i] = -1;
- allocno = (struct allocno *) xcalloc (max_allocno, sizeof (struct allocno));
+ allocno = xcalloc (max_allocno, sizeof (struct allocno));
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_allocno[i] >= 0)
@@ -454,9 +454,9 @@ global_alloc (FILE *file)
/* Calculate amount of usage of each hard reg by pseudos
allocated by local-alloc. This is to see if we want to
override it. */
- memset ((char *) local_reg_live_length, 0, sizeof local_reg_live_length);
- memset ((char *) local_reg_n_refs, 0, sizeof local_reg_n_refs);
- memset ((char *) local_reg_freq, 0, sizeof local_reg_freq);
+ memset (local_reg_live_length, 0, sizeof local_reg_live_length);
+ memset (local_reg_n_refs, 0, sizeof local_reg_n_refs);
+ memset (local_reg_freq, 0, sizeof local_reg_freq);
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_renumber[i] >= 0)
{
@@ -482,10 +482,9 @@ global_alloc (FILE *file)
/* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. Some examples were > 2Mb in size. */
- conflicts = (INT_TYPE *) xcalloc (max_allocno * allocno_row_words,
- sizeof (INT_TYPE));
+ conflicts = xcalloc (max_allocno * allocno_row_words, sizeof (INT_TYPE));
- allocnos_live = (INT_TYPE *) xmalloc (allocno_row_words * sizeof (INT_TYPE));
+ allocnos_live = xmalloc (allocno_row_words * sizeof (INT_TYPE));
/* If there is work to be done (at least one reg to allocate),
perform global conflict analysis and allocate the regs. */
@@ -522,7 +521,7 @@ global_alloc (FILE *file)
/* Determine the order to allocate the remaining pseudo registers. */
- allocno_order = (int *) xmalloc (max_allocno * sizeof (int));
+ allocno_order = xmalloc (max_allocno * sizeof (int));
for (i = 0; i < (size_t) max_allocno; i++)
allocno_order[i] = i;
@@ -633,13 +632,13 @@ global_conflicts (void)
int *block_start_allocnos;
/* Make a vector that mark_reg_{store,clobber} will store in. */
- regs_set = (rtx *) xmalloc (max_parallel * sizeof (rtx) * 2);
+ regs_set = xmalloc (max_parallel * sizeof (rtx) * 2);
- block_start_allocnos = (int *) xmalloc (max_allocno * sizeof (int));
+ block_start_allocnos = xmalloc (max_allocno * sizeof (int));
FOR_EACH_BB (b)
{
- memset ((char *) allocnos_live, 0, allocno_row_words * sizeof (INT_TYPE));
+ memset (allocnos_live, 0, allocno_row_words * sizeof (INT_TYPE));
/* Initialize table of registers currently live
to the state at the beginning of this basic block.
@@ -903,7 +902,7 @@ prune_preferences (void)
{
int i;
int num;
- int *allocno_to_order = (int *) xmalloc (max_allocno * sizeof (int));
+ int *allocno_to_order = xmalloc (max_allocno * sizeof (int));
/* Scan least most important to most important.
For each allocno, remove from preferences registers that cannot be used,
diff --git a/gcc/graph.c b/gcc/graph.c
index 45788a7c3a4..9ff50c18130 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -225,7 +225,7 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + suffixlen + extlen);
+ char *buf = alloca (namelen + suffixlen + extlen);
FILE *fp;
if (basic_block_info == NULL)
@@ -245,10 +245,9 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
- int *start = (int *) xmalloc (max_uid * sizeof (int));
- int *end = (int *) xmalloc (max_uid * sizeof (int));
- enum bb_state *in_bb_p = (enum bb_state *)
- xmalloc (max_uid * sizeof (enum bb_state));
+ int *start = xmalloc (max_uid * sizeof (int));
+ int *end = xmalloc (max_uid * sizeof (int));
+ enum bb_state *in_bb_p = xmalloc (max_uid * sizeof (enum bb_state));
basic_block bb;
int i;
@@ -390,7 +389,7 @@ clean_graph_dump_file (const char *base, const char *suffix)
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + extlen + suffixlen);
+ char *buf = alloca (namelen + extlen + suffixlen);
FILE *fp;
memcpy (buf, base, namelen);
@@ -422,7 +421,7 @@ finish_graph_dump_file (const char *base, const char *suffix)
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + suffixlen + extlen);
+ char *buf = alloca (namelen + suffixlen + extlen);
FILE *fp;
memcpy (buf, base, namelen);
diff --git a/gcc/gthr-posix.c b/gcc/gthr-posix.c
new file mode 100644
index 00000000000..56bbad28301
--- /dev/null
+++ b/gcc/gthr-posix.c
@@ -0,0 +1,207 @@
+/* POSIX threads dummy routines for systems without weak definitions. */
+/* Compile this one with gcc. */
+/* 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. */
+
+/* As a special exception, if you link this library with other files,
+ some of which are compiled with GCC, to produce an executable,
+ this library does not by itself cause the resulting executable
+ to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#include "tconfig.h"
+#include "tm.h"
+/* Define so we provide weak definitions of functions used by libobjc only. */
+#define _LIBOBJC_WEAK
+#include "gthr.h"
+
+int
+pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
+ void (*func) (void) ATTRIBUTE_UNUSED)
+{
+ return -1;
+}
+
+int
+pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
+ void (*dtor) (void *) ATTRIBUTE_UNUSED)
+{
+ return -1;
+}
+
+int
+pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+void *
+pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
+ const void *ptr ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
+ const pthread_attr_t *attr ATTRIBUTE_UNUSED,
+ void *(*start_routine) (void *) ATTRIBUTE_UNUSED,
+ void *arg ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
+ const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
+ pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+void
+pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
+{
+}
+
+int
+pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
+ const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+pthread_t
+pthread_self (void)
+{
+ return (pthread_t) 0;
+}
+
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+int
+sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+
+int
+sched_yield (void)
+{
+ return 0;
+}
+
+int
+pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
+ int detachstate ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+int
+pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
+ int *policy ATTRIBUTE_UNUSED,
+ struct sched_param *param ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
+ int policy ATTRIBUTE_UNUSED,
+ const struct sched_param *param ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index 02f70aa9b32..88234daae93 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -1,6 +1,7 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -34,6 +35,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define __GTHREADS 1
+/* Some implementations of <pthread.h> require this to be defined. */
+#ifndef _REENTRANT
+#define _REENTRANT 1
+#endif
+
#include <pthread.h>
#include <unistd.h>
@@ -57,7 +63,7 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_mutex_trylock
#pragma weak pthread_mutex_unlock
-#ifdef _LIBOBJC
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
/* Objective-C. */
#pragma weak pthread_cond_broadcast
#pragma weak pthread_cond_destroy
@@ -82,7 +88,7 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_getschedparam
#pragma weak pthread_setschedparam
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
-#endif /* _LIBOBJC */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
static inline int
__gthread_active_p (void)
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 397c251e039..2776ec12c7f 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -385,7 +385,7 @@ may_trap_exp (rtx x, int is_store)
moved speculatively, by examining it's patterns, returning:
TRAP_RISKY: store, or risky non-load insn (e.g. division by variable).
TRAP_FREE: non-load insn.
- IFREE: load from a globaly safe location.
+ IFREE: load from a globally safe location.
IRISKY: volatile load.
PFREE_CANDIDATE, PRISKY_CANDIDATE: load that need to be checked for
being either PFREE or PRISKY. */
@@ -658,9 +658,9 @@ get_unit_last_insn (int instance)
static void
clear_units (void)
{
- memset ((char *) unit_last_insn, 0, sizeof (unit_last_insn));
- memset ((char *) unit_tick, 0, sizeof (unit_tick));
- memset ((char *) unit_n_insns, 0, sizeof (unit_n_insns));
+ memset (unit_last_insn, 0, sizeof (unit_last_insn));
+ memset (unit_tick, 0, sizeof (unit_tick));
+ memset (unit_n_insns, 0, sizeof (unit_n_insns));
}
/* Return the issue-delay of an insn. The scheduler using only DFA
@@ -2130,7 +2130,7 @@ schedule_block (int b, int rgn_n_insns)
/* Allocate the ready list. */
ready.veclen = rgn_n_insns + 1 + issue_rate;
ready.first = ready.veclen - 1;
- ready.vec = (rtx *) xmalloc (ready.veclen * sizeof (rtx));
+ ready.vec = xmalloc (ready.veclen * sizeof (rtx));
ready.n_ready = 0;
if (targetm.sched.use_dfa_pipeline_interface
@@ -2138,13 +2138,11 @@ schedule_block (int b, int rgn_n_insns)
{
/* It is used for first cycle multipass scheduling. */
temp_state = alloca (dfa_state_size);
- ready_try = (char *) xmalloc ((rgn_n_insns + 1) * sizeof (char));
- memset (ready_try, 0, (rgn_n_insns + 1) * sizeof (char));
- choice_stack
- = (struct choice_entry *) xmalloc ((rgn_n_insns + 1)
- * sizeof (struct choice_entry));
+ ready_try = xcalloc ((rgn_n_insns + 1), sizeof (char));
+ choice_stack = xmalloc ((rgn_n_insns + 1)
+ * sizeof (struct choice_entry));
for (i = 0; i <= rgn_n_insns; i++)
- choice_stack[i].state = (state_t) xmalloc (dfa_state_size);
+ choice_stack[i].state = xmalloc (dfa_state_size);
}
(*current_sched_info->init_ready_list) (&ready);
@@ -2166,8 +2164,8 @@ schedule_block (int b, int rgn_n_insns)
else
max_insn_queue_index_macro_value = max_insn_queue_index;
- insn_queue = (rtx *) alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
- memset ((char *) insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
+ insn_queue = alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
+ memset (insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
last_clock_var = -1;
/* Start just before the beginning of time. */
@@ -2248,7 +2246,7 @@ schedule_block (int b, int rgn_n_insns)
if (ready.n_ready == 0 || !can_issue_more
|| !(*current_sched_info->schedule_more_p) ())
break;
- insn = choose_ready (&ready);
+ insn = ready_remove_first (&ready);
cost = actual_hazard (insn_unit (insn), insn, clock_var, 0);
}
else
@@ -2582,7 +2580,7 @@ sched_init (FILE *dump_file)
pseudos which do not cross calls. */
old_max_uid = get_max_uid () + 1;
- h_i_d = (struct haifa_insn_data *) xcalloc (old_max_uid, sizeof (*h_i_d));
+ h_i_d = xcalloc (old_max_uid, sizeof (*h_i_d));
for (i = 0; i < old_max_uid; i++)
h_i_d [i].cost = -1;
@@ -2632,7 +2630,7 @@ sched_init (FILE *dump_file)
{
rtx line;
- line_note_head = (rtx *) xcalloc (last_basic_block, sizeof (rtx));
+ line_note_head = xcalloc (last_basic_block, sizeof (rtx));
/* Save-line-note-head:
Determine the line-number at the start of each basic block.
diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h
index 53330cf28b7..a770180e386 100644
--- a/gcc/hard-reg-set.h
+++ b/gcc/hard-reg-set.h
@@ -1,5 +1,5 @@
/* Sets (bit vectors) of hard registers, and operations on them.
- Copyright (C) 1987, 1992, 1994, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1992, 1994, 2000, 2003 Free Software Foundation, Inc.
This file is part of GCC
@@ -418,7 +418,7 @@ extern HARD_REG_SET losing_caller_save_reg_set;
/* Indexed by hard register number, contains 1 for registers that are
fixed use -- i.e. in fixed_regs -- or a function value return register
- or STRUCT_VALUE_REGNUM or STATIC_CHAIN_REGNUM. These are the
+ or TARGET_STRUCT_VALUE_RTX or STATIC_CHAIN_REGNUM. These are the
registers that cannot hold quantities across calls even if we are
willing to save and restore them. */
diff --git a/gcc/hashtable.c b/gcc/hashtable.c
index 88b1a293456..58f19d055fc 100644
--- a/gcc/hashtable.c
+++ b/gcc/hashtable.c
@@ -21,8 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "hashtable.h"
/* The code below is a specialization of Vladimir Makarov's expandable
@@ -32,15 +30,16 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
existing entry with a potential new one. Also, the ability to
delete members from the table has been removed. */
-static unsigned int calc_hash (const unsigned char *, unsigned int);
+static unsigned int calc_hash (const unsigned char *, size_t);
static void ht_expand (hash_table *);
+static double approx_sqrt (double);
/* Calculate the hash of the string STR of length LEN. */
static unsigned int
-calc_hash (const unsigned char *str, unsigned int len)
+calc_hash (const unsigned char *str, size_t len)
{
- unsigned int n = len;
+ size_t n = len;
unsigned int r = 0;
#define HASHSTEP(r, c) ((r) * 67 + ((c) - 113));
@@ -59,14 +58,16 @@ ht_create (unsigned int order)
unsigned int nslots = 1 << order;
hash_table *table;
- table = (hash_table *) xmalloc (sizeof (hash_table));
- memset (table, 0, sizeof (hash_table));
+ table = xcalloc (1, sizeof (hash_table));
/* Strings need no alignment. */
- gcc_obstack_init (&table->stack);
+ _obstack_begin (&table->stack, 0, 0,
+ (void *(*) (long)) xmalloc,
+ (void (*) (void *)) free);
+
obstack_alignment_mask (&table->stack) = 0;
- table->entries = (hashnode *) xcalloc (nslots, sizeof (hashnode));
+ table->entries = xcalloc (nslots, sizeof (hashnode));
table->nslots = nslots;
return table;
}
@@ -90,7 +91,7 @@ ht_destroy (hash_table *table)
CPP_ALLOCED and the item is assumed to be at the top of the
obstack. */
hashnode
-ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
+ht_lookup (hash_table *table, const unsigned char *str, size_t len,
enum ht_lookup_option insert)
{
unsigned int hash = calc_hash (str, len);
@@ -101,21 +102,15 @@ ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
sizemask = table->nslots - 1;
index = hash & sizemask;
-
- /* hash2 must be odd, so we're guaranteed to visit every possible
- location in the table during rehashing. */
- hash2 = ((hash * 17) & sizemask) | 1;
table->searches++;
- for (;;)
+ node = table->entries[index];
+
+ if (node != NULL)
{
- node = table->entries[index];
-
- if (node == NULL)
- break;
-
- if (node->hash_value == hash && HT_LEN (node) == len
- && !memcmp (HT_STR (node), str, len))
+ if (node->hash_value == hash
+ && HT_LEN (node) == (unsigned int) len
+ && !memcmp (HT_STR (node), str, len))
{
if (insert == HT_ALLOCED)
/* The string we search for was placed at the end of the
@@ -124,8 +119,29 @@ ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
return node;
}
- index = (index + hash2) & sizemask;
- table->collisions++;
+ /* hash2 must be odd, so we're guaranteed to visit every possible
+ location in the table during rehashing. */
+ hash2 = ((hash * 17) & sizemask) | 1;
+
+ for (;;)
+ {
+ table->collisions++;
+ index = (index + hash2) & sizemask;
+ node = table->entries[index];
+ if (node == NULL)
+ break;
+
+ if (node->hash_value == hash
+ && HT_LEN (node) == (unsigned int) len
+ && !memcmp (HT_STR (node), str, len))
+ {
+ if (insert == HT_ALLOCED)
+ /* The string we search for was placed at the end of the
+ obstack. Release it. */
+ obstack_free (&table->stack, (void *) str);
+ return node;
+ }
+ }
}
if (insert == HT_NO_INSERT)
@@ -134,7 +150,7 @@ ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
node = (*table->alloc_node) (table);
table->entries[index] = node;
- HT_LEN (node) = len;
+ HT_LEN (node) = (unsigned int) len;
node->hash_value = hash;
if (insert == HT_ALLOC)
HT_STR (node) = obstack_copy0 (&table->stack, str, len);
@@ -157,7 +173,7 @@ ht_expand (hash_table *table)
unsigned int size, sizemask;
size = table->nslots * 2;
- nentries = (hashnode *) xcalloc (size, sizeof (hashnode));
+ nentries = xcalloc (size, sizeof (hashnode));
sizemask = size - 1;
p = table->entries;
@@ -168,19 +184,18 @@ ht_expand (hash_table *table)
unsigned int index, hash, hash2;
hash = (*p)->hash_value;
- hash2 = ((hash * 17) & sizemask) | 1;
index = hash & sizemask;
- for (;;)
+ if (nentries[index])
{
- if (! nentries[index])
+ hash2 = ((hash * 17) & sizemask) | 1;
+ do
{
- nentries[index] = *p;
- break;
+ index = (index + hash2) & sizemask;
}
-
- index = (index + hash2) & sizemask;
+ while (nentries[index]);
}
+ nentries[index] = *p;
}
while (++p < limit);
@@ -274,7 +289,7 @@ ht_dump_statistics (hash_table *table)
/* Return the approximate positive square root of a number N. This is for
statistical reports, not code generation. */
-double
+static double
approx_sqrt (double x)
{
double s, d;
diff --git a/gcc/hashtable.h b/gcc/hashtable.h
index 47ec1cccd3b..8efbf5c50e2 100644
--- a/gcc/hashtable.h
+++ b/gcc/hashtable.h
@@ -19,6 +19,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define GCC_HASHTABLE_H
#include "obstack.h"
+#define GTY(x) /* nothing */
/* This is what each hash table entry points to. It may be embedded
deeply within another object. */
@@ -66,7 +67,7 @@ extern hash_table *ht_create (unsigned int order);
extern void ht_destroy (hash_table *);
extern hashnode ht_lookup (hash_table *, const unsigned char *,
- unsigned int, enum ht_lookup_option);
+ size_t, enum ht_lookup_option);
/* For all nodes in TABLE, make a callback. The callback takes
TABLE->PFILE, the node, and a PTR, and the callback sequence stops
@@ -77,8 +78,4 @@ extern void ht_forall (hash_table *, ht_cb, const void *);
/* Dump allocation statistics to stderr. */
extern void ht_dump_statistics (hash_table *);
-/* Approximate positive square root of a host double. This is for
- statistical reports, not code generation. */
-extern double approx_sqrt (double);
-
#endif /* GCC_HASHTABLE_H */
diff --git a/gcc/hooks.c b/gcc/hooks.c
index c022eb38853..966945d9066 100644
--- a/gcc/hooks.c
+++ b/gcc/hooks.c
@@ -192,3 +192,18 @@ hook_rtx_rtx_null (rtx x ATTRIBUTE_UNUSED)
{
return 0;
}
+
+/* Generic hook that takes a size_t and returns NULL. */
+void *
+hook_voidp_size_t_null (size_t a ATTRIBUTE_UNUSED)
+{
+ return NULL;
+}
+
+/* Generic hook that takes a size_t and a pointer and returns false. */
+bool
+hook_bool_voidp_size_t_false (void * a ATTRIBUTE_UNUSED,
+ size_t b ATTRIBUTE_UNUSED)
+{
+ return false;
+}
diff --git a/gcc/hooks.h b/gcc/hooks.h
index 6fa0bbec3c3..a3465f122d0 100644
--- a/gcc/hooks.h
+++ b/gcc/hooks.h
@@ -55,5 +55,7 @@ bool hook_bool_tree_tree_false (tree, tree);
rtx hook_rtx_rtx_identity (rtx);
rtx hook_rtx_rtx_null (rtx);
+void * hook_voidp_size_t_null (size_t);
+bool hook_bool_voidp_size_t_false (void *, size_t);
#endif
diff --git a/gcc/hosthooks-def.h b/gcc/hosthooks-def.h
index 8a2b6b803cb..b1a41e72988 100644
--- a/gcc/hosthooks-def.h
+++ b/gcc/hosthooks-def.h
@@ -24,10 +24,14 @@ Boston, MA 02111-1307, USA. */
#include "hooks.h"
#define HOST_HOOKS_EXTRA_SIGNALS hook_void_void
+#define HOST_HOOKS_GT_PCH_GET_ADDRESS hook_voidp_size_t_null
+#define HOST_HOOKS_GT_PCH_USE_ADDRESS hook_bool_voidp_size_t_false
/* The structure is defined in hosthooks.h. */
#define HOST_HOOKS_INITIALIZER { \
- HOST_HOOKS_EXTRA_SIGNALS \
+ HOST_HOOKS_EXTRA_SIGNALS, \
+ HOST_HOOKS_GT_PCH_GET_ADDRESS, \
+ HOST_HOOKS_GT_PCH_USE_ADDRESS \
}
#endif /* GCC_HOST_HOOKS_DEF_H */
diff --git a/gcc/hosthooks.h b/gcc/hosthooks.h
index cf6382b9419..bbc28f69d4d 100644
--- a/gcc/hosthooks.h
+++ b/gcc/hosthooks.h
@@ -25,6 +25,9 @@ struct host_hooks
{
void (*extra_signals) (void);
+ void * (*gt_pch_get_address) (size_t);
+ bool (*gt_pch_use_address) (void *, size_t);
+
/* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
};
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 60723efa3b3..782960bac66 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -38,6 +38,8 @@
#include "optabs.h"
#include "toplev.h"
#include "tm_p.h"
+#include "cfgloop.h"
+#include "target.h"
#ifndef HAVE_conditional_execution
@@ -110,7 +112,36 @@ static int dead_or_predicable (basic_block, basic_block, basic_block,
basic_block, int);
static void noce_emit_move_insn (rtx, rtx);
static rtx block_has_only_trap (basic_block);
+static void mark_loop_exit_edges (void);
+/* Sets EDGE_LOOP_EXIT flag for all loop exits. */
+static void
+mark_loop_exit_edges ()
+{
+ struct loops loops;
+ basic_block bb;
+ edge e;
+
+ flow_loops_find (&loops, LOOP_TREE);
+
+ if (loops.num > 1)
+ {
+ FOR_EACH_BB (bb)
+ {
+ for (e = bb->succ; e; e = e->succ_next)
+ {
+ if (find_common_loop (bb->loop_father, e->dest->loop_father)
+ != bb->loop_father)
+ e->flags |= EDGE_LOOP_EXIT;
+ else
+ e->flags &= ~EDGE_LOOP_EXIT;
+ }
+ }
+ }
+
+ flow_loops_free (&loops);
+}
+
/* Count the number of non-jump active insns in BB. */
static int
@@ -1366,7 +1397,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
}
cond = canonicalize_condition (if_info->jump, cond, reverse,
- earliest, target);
+ earliest, target, false);
if (! cond || ! reg_mentioned_p (target, cond))
return NULL;
@@ -1640,7 +1671,8 @@ noce_get_condition (rtx jump, rtx *earliest)
/* Otherwise, fall back on canonicalize_condition to do the dirty
work of manipulating MODE_CC values and COMPARE rtx codes. */
- tmp = canonicalize_condition (jump, cond, reverse, earliest, NULL_RTX);
+ tmp = canonicalize_condition (jump, cond, reverse, earliest, NULL_RTX,
+ false);
if (!tmp)
return NULL_RTX;
@@ -1659,7 +1691,8 @@ noce_get_condition (rtx jump, rtx *earliest)
tmp = XEXP (tmp, 0);
if (!REG_P (tmp) || GET_MODE_CLASS (GET_MODE (tmp)) != MODE_INT)
return NULL_RTX;
- tmp = canonicalize_condition (jump, cond, reverse, earliest, tmp);
+ tmp = canonicalize_condition (jump, cond, reverse, earliest, tmp,
+ false);
if (!tmp)
return NULL_RTX;
@@ -2111,6 +2144,11 @@ find_if_header (basic_block test_bb, int pass)
|| (else_edge->flags & EDGE_COMPLEX))
return NULL;
+ /* Nor exit the loop. */
+ if ((then_edge->flags & EDGE_LOOP_EXIT)
+ || (else_edge->flags & EDGE_LOOP_EXIT))
+ return NULL;
+
/* The THEN edge is canonically the one that falls through. */
if (then_edge->flags & EDGE_FALLTHRU)
;
@@ -3077,6 +3115,9 @@ if_convert (int x_life_data_ok)
num_removed_blocks = 0;
life_data_ok = (x_life_data_ok != 0);
+ if (! (* targetm.cannot_modify_jumps_p) ())
+ mark_loop_exit_edges ();
+
/* Free up basic_block_for_insn so that we don't have to keep it
up to date, either here or in merge_blocks. */
free_basic_block_vars (1);
diff --git a/gcc/input.h b/gcc/input.h
index f422f74f98f..ff014f6d664 100644
--- a/gcc/input.h
+++ b/gcc/input.h
@@ -23,6 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define GCC_INPUT_H
/* The data structure used to record a location in a translation unit. */
+/* Long-term, we want to get rid of this and typedef fileline location_t. */
struct location_s GTY (())
{
/* The name of the source file involved. */
@@ -50,6 +51,9 @@ extern location_t input_location;
The line member is not accurate for the innermost file on the stack. */
extern struct file_stack *input_file_stack;
+/* Stack of EXPR_WITH_FILE_LOCATION nested expressions. */
+extern struct file_stack *expr_wfl_stack;
+
/* Incremented on each change to input_file_stack. */
extern int input_file_stack_tick;
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 6c5fdf4739a..21a738ea237 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -283,7 +283,7 @@ initialize_for_inline (tree fndecl)
tree parms;
/* Clear out PARMDECL_MAP. It was allocated in the caller's frame. */
- memset ((char *) parmdecl_map, 0, max_parm_reg * sizeof (tree));
+ memset (parmdecl_map, 0, max_parm_reg * sizeof (tree));
arg_vector = rtvec_alloc (list_length (DECL_ARGUMENTS (fndecl)));
for (parms = DECL_ARGUMENTS (fndecl), i = 0;
@@ -368,6 +368,8 @@ copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn)
else
{
copy = copy_node (decl);
+ /* The COPY is not abstract; it will be generated in TO_FN. */
+ DECL_ABSTRACT (copy) = 0;
(*lang_hooks.dup_lang_specific_decl) (copy);
/* TREE_ADDRESSABLE isn't used to indicate that a label's
@@ -440,7 +442,7 @@ save_for_inline (tree fndecl)
for the parms, prior to elimination of virtual registers.
These values are needed for substituting parms properly. */
if (! flag_no_inline)
- parmdecl_map = (tree *) xmalloc (max_parm_reg * sizeof (tree));
+ parmdecl_map = xmalloc (max_parm_reg * sizeof (tree));
/* Make and emit a return-label if we have not already done so. */
@@ -490,7 +492,7 @@ save_for_inline (tree fndecl)
}
cfun->original_decl_initial = DECL_INITIAL (fndecl);
cfun->no_debugging_symbols = (write_symbols == NO_DEBUG);
- DECL_SAVED_INSNS (fndecl) = cfun;
+ cfun->saved_for_inline = 1;
/* Clean up. */
if (! flag_no_inline)
@@ -722,8 +724,8 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
/* Expand the function arguments. Do this first so that any
new registers get created before we allocate the maps. */
- arg_vals = (rtx *) xmalloc (nargs * sizeof (rtx));
- arg_trees = (tree *) xmalloc (nargs * sizeof (tree));
+ arg_vals = xmalloc (nargs * sizeof (rtx));
+ arg_trees = xmalloc (nargs * sizeof (tree));
for (formal = DECL_ARGUMENTS (fndecl), actual = parms, i = 0;
formal;
@@ -818,22 +820,21 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
/* Allocate the structures we use to remap things. */
- map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
+ map = xcalloc (1, sizeof (struct inline_remap));
map->fndecl = fndecl;
VARRAY_TREE_INIT (map->block_map, 10, "block_map");
- map->reg_map = (rtx *) xcalloc (max_regno, sizeof (rtx));
+ map->reg_map = xcalloc (max_regno, sizeof (rtx));
/* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. */
- real_label_map
- = (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
+ real_label_map = xmalloc ((max_labelno) * sizeof (rtx));
map->label_map = real_label_map;
map->local_return_label = NULL_RTX;
inl_max_uid = (inl_f->emit->x_cur_insn_uid + 1);
- map->insn_map = (rtx *) xcalloc (inl_max_uid, sizeof (rtx));
+ map->insn_map = xcalloc (inl_max_uid, sizeof (rtx));
map->min_insnno = 0;
map->max_insnno = inl_max_uid;
@@ -1027,7 +1028,7 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
else
{
if (! structure_value_addr
- || ! aggregate_value_p (DECL_RESULT (fndecl)))
+ || ! aggregate_value_p (DECL_RESULT (fndecl), fndecl))
abort ();
/* Pass the function the address in which to return a structure
@@ -1183,8 +1184,8 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
/* Initialize label_map. get_label_from_map will actually make
the labels. */
- memset ((char *) &map->label_map[min_labelno], 0,
- (max_labelno - min_labelno) * sizeof (rtx));
+ memset (&map->label_map[min_labelno], 0,
+ (max_labelno - min_labelno) * sizeof (rtx));
/* Make copies of the decls of the symbols in the inline function, so that
the copies of the variables get declared in the current function. Set
@@ -1282,7 +1283,7 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
out of the temp register into a BLKmode memory object. */
if (target
&& TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == BLKmode
- && ! aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl))))
+ && ! aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl)), fndecl))
target = copy_blkmode_from_reg (0, target, TREE_TYPE (TREE_TYPE (fndecl)));
if (structure_value_addr)
@@ -2156,11 +2157,7 @@ copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs)
#endif
temp = XEXP (temp, 0);
-
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (temp) != GET_MODE (orig))
- temp = convert_memory_address (GET_MODE (orig), temp);
-#endif
+ temp = convert_memory_address (GET_MODE (orig), temp);
return temp;
}
else if (GET_CODE (constant) == LABEL_REF)
@@ -3049,20 +3046,19 @@ get_func_hard_reg_initial_val (struct function *fun, rtx reg)
if (ivs == 0)
{
- fun->hard_reg_initial_vals = (void *) ggc_alloc (sizeof (initial_value_struct));
+ fun->hard_reg_initial_vals = ggc_alloc (sizeof (initial_value_struct));
ivs = fun->hard_reg_initial_vals;
ivs->num_entries = 0;
ivs->max_entries = 5;
- ivs->entries = (initial_value_pair *) ggc_alloc (5 * sizeof (initial_value_pair));
+ ivs->entries = ggc_alloc (5 * sizeof (initial_value_pair));
}
if (ivs->num_entries >= ivs->max_entries)
{
ivs->max_entries += 5;
- ivs->entries =
- (initial_value_pair *) ggc_realloc (ivs->entries,
- ivs->max_entries
- * sizeof (initial_value_pair));
+ ivs->entries = ggc_realloc (ivs->entries,
+ ivs->max_entries
+ * sizeof (initial_value_pair));
}
ivs->entries[ivs->num_entries].hard_reg = reg;
diff --git a/gcc/integrate.h b/gcc/integrate.h
index f5fbaabba13..94bf2e738d4 100644
--- a/gcc/integrate.h
+++ b/gcc/integrate.h
@@ -40,7 +40,7 @@ struct inline_remap
copy_rtx_and_substitute. */
int integrating;
/* Definition of function be inlined. */
- union tree_node *fndecl;
+ tree fndecl;
/* Place to put insns needed at start of function. */
rtx insns_at_start;
/* Mapping from old BLOCKs to new BLOCKs. */
@@ -150,14 +150,12 @@ extern void allocate_initial_values (rtx *);
/* Copy a declaration when one function is substituted inline into
another. */
-extern union tree_node *copy_decl_for_inlining (union tree_node *,
- union tree_node *,
- union tree_node *);
+extern tree copy_decl_for_inlining (tree, tree, tree);
/* Check whether there's any attribute in a function declaration that
makes the function uninlinable. Returns false if it finds any,
true otherwise. */
-extern bool function_attribute_inlinable_p (union tree_node *);
+extern bool function_attribute_inlinable_p (tree);
extern void try_constants (rtx, struct inline_remap *);
diff --git a/gcc/intl.h b/gcc/intl.h
index 18f66490c59..80a945b45f8 100644
--- a/gcc/intl.h
+++ b/gcc/intl.h
@@ -48,7 +48,7 @@ extern size_t gcc_gettext_width (const char *);
#endif
#ifndef N_
-# define N_(msgid) (msgid)
+# define N_(msgid) msgid
#endif
#endif /* intl.h */
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index fba4f04110b..f0a863b2322 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,4 +1,199 @@
-Wed Jul 9 02:29:15 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * 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,
+ 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.
+
+2003-09-18 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (java_truthvalue_conversion): Remove FFS_EXPR case.
+ * check-init.c (check_init): Likewise.
+
+2003-09-18 Roger Sayle <roger@eyesopen.com>
+
+ * jcf-write.c (generate_bytecode_insns): Add support for fconst_2.
+
+2003-09-16 Andrew Haley <aph@redhat.com>
+
+ * jcf-write.c (generate_bytecode_insns): Add MIN_EXPR and MAX_EXPR.
+
+2003-09-17 Ranjit Mathew <rmathew@hotmail.com>
+
+ Fixes PR java/9577
+ * mangle.c (find_compression_record_match): Skip
+ over a "6JArray" (the array template mangled string)
+ IDENTIFIER_NODE.
+ (mangle_array_type): Correct minor typo.
+ (atms): Move definition to the beginning.
+
+2003-09-16 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * 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.
+
+2003-09-09 Richard Henderson <rth@redhat.com>
+
+ * parse.y (source_end_java_method): Update call to
+ cgraph_finalize_function.
+
+2003-09-03 Jeff Sturm <jsturm@one-point.com>
+
+ * decl.c (java_expand_body): New function.
+ * expr.c (build_class_init): Set DECL_IGNORED_P.
+ * java-tree.h (start_complete_expand_method,
+ java_expand_body): Declare.
+ * jcf-parse.c (cgraph.h): Include.
+ (java_parse_file): Handle flag_unit_at_a_time.
+ * lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING,
+ LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
+ (java_estimate_num_insns): Use walk_tree_without_duplicates.
+ (java_start_inlining): New function.
+ * parse.h (java_finish_classes): Declare.
+ * parse.y: Include cgraph.h.
+ (block): Don't special-case empty block production.
+ (craft_constructor): Set DECL_INLINE.
+ (source_end_java_method): Handle flag_unit_at_a_time.
+ Replace inline code with call to java_expand_body.
+ (start_complete_expand_method): Remove static modifier.
+ (java_expand_method_bodies): Patch function tree for
+ class initialization and/or synchronization as needed.
+ Don't begin RTL expansion yet.
+ (java_expand_classes): Check flag_unit_at_a_time before
+ calling finish_class.
+ (java_finish_classes): New function.
+ (java_complete_lhs): Ensure COMPOUND_EXPR has non-NULL type.
+ (patch_assignment): Set DECL_CONTEXT on temporary variable.
+ (emit_test_initialization): Set DECL_IGNORED_P.
+
+2003-09-03 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (enum builtin_type): Delete unused enumeration.
+ * Make-lang.in (java/builtins.o): Remove built-types.def dependency.
+
+2003-08-28 Tom Tromey <tromey@redhat.com>
+
+ * gcj.texi (Extensions): Document gcjlib URLs.
+
+2003-08-20 Tom Tromey <tromey@redhat.com>
+
+ * gcj.texi (Extensions): Added xref.
+ (libgcj Runtime Properties): Document
+ gnu.gcj.runtime.VMClassLoader.library_control.
+
+2003-08-13 Tom Tromey <tromey@redhat.com>
+
+ * gcj.texi (Invoking gij): Document -X and -?.
+
+2003-08-13 Mohan Embar <gnustuff@thisiscool.com>
+
+ * Make-lang.in: Added missing win32-host.o to JAVA_OBJS,
+ GCJH_OBJS, JCFDUMP_OBJS
+ * win32-host.c: Removed the unnecessary and broken dependency
+ on jcf.h
+
+2003-08-11 Tom Tromey <tromey@redhat.com>
+
+ * parse.y (java_check_regular_methods): Typo fixes. Call
+ check_interface_throws_clauses. Use
+ check_concrete_throws_clauses.
+ (check_interface_throws_clauses): New function.
+ (check_concrete_throws_clauses): New function.
+ (hack_is_accessible_p): New function.
+ (find_most_specific_methods_list): Added FIXME.
+ * typeck.c (lookup_do): Use `flags' argument to decide what to
+ do. Reimplemented.
+ (lookup_argument_method_generic): New function.
+ (lookup_argument_method2): Removed.
+ * jcf.h (ACC_INVISIBLE): New define.
+ * jcf-write.c (generate_classfile): Skip invisible methods.
+ * class.c (add_miranda_methods): New function.
+ (layout_class_methods): Use it.
+ (get_access_flags_from_decl): Use ACC_INVISIBLE.
+ * java-tree.h (METHOD_INVISIBLE): New define.
+ (lang_decl_func) [invisible]: New field.
+ (lookup_argument_method_generic): Declare.
+ (SEARCH_INTERFACE): New define.
+ (SEARCH_SUPER): Likewise.
+ (SEARCH_ONLY_INTERFACE): Likewise.
+ (SEARCH_VISIBLE): Likewise.
+ (lookup_argument_method2): Removed declaration.
+
+2003-08-05 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR java/11600:
+ * parse.y (java_complete_lhs): See whether we're calling a method
+ on an array.
+ (check_thrown_exceptions): Added `is_array_call' argument;
+ fixed `clone' checking; updated all callers.
+
+2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
+
+ * java-tree.h (DECL_ESTIMATED_INSNS): Remove (moved to tree.h).
+
+2003-08-03 Tom Tromey <tromey@redhat.com>
+
+ * java-tree.h (METHOD_TRANSIENT): Removed.
+ * decl.c (pushdecl): Removed some dead code.
+ * class.c (get_access_flags_from_decl): Can't have transient
+ method.
+ (add_method_1): Can't have a transient method.
+
+2003-07-28 Andreas Jaeger <aj@suse.de>
+
+ * jvspec.c: Convert to ISO C90 prototypes.
+
+2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (force_poplevels): Fix warning call.
+
+2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * expr.c (expand_java_field_op): Don't use xxx_with_decl
+ (expand_java_field_op): Likewise.
+ * class.c (layout_class_method): Likewise
+ (emit_register_classes): Likewise.
+ * decl.c (pushdecl): Likewise.
+ (poplevel): Likewise.
+ (force_poplevels): Likewise.
+ (give_name_to_locals): Likewise.
+ * check-init.c (check_for_initialization): Likewise.
+
+2003-07-24 Jason Merrill <jason@redhat.com>
+
+ * java-tree.h: Move boolean_type_node et al to the back end.
+
+2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * class.c java-tree.h jcf-write.c jvspec.c: Remove unnecessary
+ casts.
+
+2003-07-19 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang.opt: Don't show -MD_ and -MDD_.
+
+2003-07-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang-options.h: Remove.
+ * lang.opt: Add help text.
+
+2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * expr.c: Remove the last argument to expand_assignment().
+
+2003-07-09 Jan Hubicka <jh@suse.cz>
* java-tree.h (DECL_NUM_STMTS): Rename to...
(DECL_ESTIMATED_INSNS): ... this.
@@ -183,7 +378,7 @@ Wed Jul 9 02:29:15 CEST 2003 Jan Hubicka <jh@suse.cz>
* lang.c (java_init_options): Update.
-Thu Jun 5 18:33:40 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-05 Jan Hubicka <jh@suse.cz>
* Make-lang.in: Add support for stageprofile and stagefeedback
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index 28d86375e2f..cc53c90d9af 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -107,18 +107,18 @@ gt-java-builtins.h gtype-java.h gt-java-resource.h : s-gtype ; @true
# Executables built by this Makefile:
JAVA_OBJS = java/parse.o java/class.o java/decl.o java/expr.o \
java/constants.o java/lang.o java/typeck.o java/except.o java/verify.o \
- java/zextract.o java/jcf-io.o java/jcf-parse.o java/mangle.o \
+ java/zextract.o java/jcf-io.o java/win32-host.o java/jcf-parse.o java/mangle.o \
java/mangle_name.o java/builtins.o java/resource.o \
java/jcf-write.o java/buffer.o java/check-init.o java/jcf-depend.o \
java/jcf-path.o java/xref.o java/boehm.o java/java-tree-inline.o mkdeps.o
GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
- java/zextract.o version.o mkdeps.o errors.o ggc-none.o
+ java/win32-host.o java/zextract.o version.o mkdeps.o errors.o ggc-none.o
JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o
JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
- java/zextract.o errors.o version.o mkdeps.o ggc-none.o
+ java/win32-host.o java/zextract.o errors.o version.o mkdeps.o ggc-none.o
JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o
@@ -286,8 +286,7 @@ java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) coretypes.h \
$(TM_H) toplev.h
java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(JAVA_TREE_H) $(GGC_H) flags.h builtin-types.def langhooks.h \
- gt-java-builtins.h
+ $(JAVA_TREE_H) $(GGC_H) flags.h langhooks.h gt-java-builtins.h
java/check-init.o: java/check-init.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \
coretypes.h $(TM_H) toplev.h
java/class.o: java/class.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index 45e0b9e58c8..59cdea7b444 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -35,33 +35,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "langhooks.h"
#include "java-tree.h"
-enum builtin_type
-{
-#define DEF_PRIMITIVE_TYPE(NAME, VALUE) NAME,
-#define DEF_FUNCTION_TYPE_0(NAME, RETURN) NAME,
-#define DEF_FUNCTION_TYPE_1(NAME, RETURN, ARG1) NAME,
-#define DEF_FUNCTION_TYPE_2(NAME, RETURN, ARG1, ARG2) NAME,
-#define DEF_FUNCTION_TYPE_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
-#define DEF_FUNCTION_TYPE_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
-#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
-#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
-#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
-#define DEF_FUNCTION_TYPE_VAR_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
-#define DEF_POINTER_TYPE(NAME, TYPE) NAME,
-#include "builtin-types.def"
-#undef DEF_PRIMITIVE_TYPE
-#undef DEF_FUNCTION_TYPE_0
-#undef DEF_FUNCTION_TYPE_1
-#undef DEF_FUNCTION_TYPE_2
-#undef DEF_FUNCTION_TYPE_3
-#undef DEF_FUNCTION_TYPE_4
-#undef DEF_FUNCTION_TYPE_VAR_0
-#undef DEF_FUNCTION_TYPE_VAR_1
-#undef DEF_FUNCTION_TYPE_VAR_2
-#undef DEF_FUNCTION_TYPE_VAR_3
-#undef DEF_POINTER_TYPE
- BT_LAST
-};
static tree max_builtin (tree, tree);
static tree min_builtin (tree, tree);
diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c
index 82b14b57cfc..03af2faf1cf 100644
--- a/gcc/java/check-init.c
+++ b/gcc/java/check-init.c
@@ -792,7 +792,6 @@ check_init (tree exp, words before)
case FIX_FLOOR_EXPR:
case FIX_ROUND_EXPR:
case ABS_EXPR:
- case FFS_EXPR:
/* Avoid needless recursion. */
exp = TREE_OPERAND (exp, 0);
goto again;
@@ -977,7 +976,8 @@ check_for_initialization (tree body, tree mdecl)
if (index >= 0 && ! ASSIGNED_P (before, index))
{
if (! is_finit_method)
- error_with_decl (decl, "final field '%s' may not have been initialized");
+ error ("%Jfinal field '%D' may not have been initialized",
+ decl, decl);
}
else if (is_finit_method)
DECL_FIELD_FINAL_IUD (decl) = 1;
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 443cfc557d8..e3e6cc36e58 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -57,6 +57,7 @@ static tree get_dispatch_table (tree, tree);
static int supers_all_compiled (tree type);
static void add_interface_do (tree, tree, int);
static tree maybe_layout_super_class (tree, tree);
+static void add_miranda_methods (tree, tree);
static int assume_compiled (const char *);
static tree build_method_symbols_entry (tree);
@@ -148,8 +149,7 @@ add_assume_compiled (const char *ident, int excludep)
{
int len;
assume_compiled_node *parent;
- assume_compiled_node *node =
- xmalloc (sizeof (assume_compiled_node));
+ assume_compiled_node *node = xmalloc (sizeof (assume_compiled_node));
node->ident = xstrdup (ident);
node->excludep = excludep;
@@ -618,7 +618,6 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
METHOD_FINAL (fndecl) = DECL_INLINE (fndecl) = 1;
if (access_flags & ACC_SYNCHRONIZED) METHOD_SYNCHRONIZED (fndecl) = 1;
if (access_flags & ACC_ABSTRACT) METHOD_ABSTRACT (fndecl) = 1;
- if (access_flags & ACC_TRANSIENT) METHOD_TRANSIENT (fndecl) = 1;
if (access_flags & ACC_STRICT) METHOD_STRICTFP (fndecl) = 1;
return fndecl;
}
@@ -1034,10 +1033,10 @@ get_access_flags_from_decl (tree decl)
access_flags |= ACC_NATIVE;
if (METHOD_ABSTRACT (decl))
access_flags |= ACC_ABSTRACT;
- if (METHOD_TRANSIENT (decl))
- access_flags |= ACC_TRANSIENT;
if (METHOD_STRICTFP (decl))
access_flags |= ACC_STRICT;
+ if (METHOD_INVISIBLE (decl))
+ access_flags |= ACC_INVISIBLE;
return access_flags;
}
abort ();
@@ -1212,8 +1211,7 @@ get_dispatch_table (tree type, tree this_class_addr)
if (METHOD_ABSTRACT (method))
{
if (! abstract_p)
- warning_with_decl (method,
- "abstract method in non-abstract class");
+ warning ("%Jabstract method in non-abstract class", method);
if (TARGET_VTABLE_USES_DESCRIPTORS)
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
@@ -1751,14 +1749,14 @@ layout_class (tree this_class)
{
tree super_class = CLASSTYPE_SUPER (this_class);
tree field;
-
+
class_list = tree_cons (this_class, NULL_TREE, class_list);
if (CLASS_BEING_LAIDOUT (this_class))
{
char buffer [1024];
char *report;
tree current;
-
+
sprintf (buffer, " with `%s'",
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (this_class))));
obstack_grow (&temporary_obstack, buffer, strlen (buffer));
@@ -1812,8 +1810,9 @@ layout_class (tree this_class)
layout_type (this_class);
- /* Also recursively load/layout any superinterfaces, but only if class was
- loaded from bytecode. The source parser will take care of this itself. */
+ /* Also recursively load/layout any superinterfaces, but only if
+ class was loaded from bytecode. The source parser will take care
+ of this itself. */
if (!CLASS_FROM_SOURCE_P (this_class))
{
tree basetype_vec = TYPE_BINFO_BASETYPES (this_class);
@@ -1841,14 +1840,63 @@ layout_class (tree this_class)
}
}
- /* Convert the size back to an SI integer value */
- TYPE_SIZE_UNIT (this_class) =
+ /* Convert the size back to an SI integer value. */
+ TYPE_SIZE_UNIT (this_class) =
fold (convert (int_type_node, TYPE_SIZE_UNIT (this_class)));
CLASS_BEING_LAIDOUT (this_class) = 0;
class_list = TREE_CHAIN (class_list);
}
+static void
+add_miranda_methods (tree base_class, tree search_class)
+{
+ tree basetype_vec = TYPE_BINFO_BASETYPES (search_class);
+ int i, n = TREE_VEC_LENGTH (basetype_vec);
+ for (i = 1; i < n; ++i)
+ {
+ tree method_decl;
+ tree elt = TREE_VEC_ELT (basetype_vec, i);
+ if (elt == NULL_TREE)
+ break;
+ elt = BINFO_TYPE (elt);
+
+ /* Ensure that interface methods are seen in declared order. */
+ layout_class_methods (elt);
+
+ /* All base classes will have been laid out at this point, so the order
+ will be correct. This code must match similar layout code in the
+ runtime. */
+ for (method_decl = TYPE_METHODS (elt);
+ method_decl; method_decl = TREE_CHAIN (method_decl))
+ {
+ tree sig, override;
+
+ /* An interface can have <clinit>. */
+ if (ID_CLINIT_P (DECL_NAME (method_decl)))
+ continue;
+
+ sig = build_java_argument_signature (TREE_TYPE (method_decl));
+ override = lookup_argument_method (base_class,
+ DECL_NAME (method_decl), sig);
+ if (override == NULL_TREE)
+ {
+ /* Found a Miranda method. Add it. */
+ tree new_method;
+ sig = build_java_signature (TREE_TYPE (method_decl));
+ new_method
+ = add_method (base_class,
+ get_access_flags_from_decl (method_decl),
+ DECL_NAME (method_decl), sig);
+ METHOD_INVISIBLE (new_method) = 1;
+ }
+ }
+
+ /* Try superinterfaces. */
+ add_miranda_methods (base_class, elt);
+ }
+}
+
void
layout_class_methods (tree this_class)
{
@@ -1870,11 +1918,20 @@ layout_class_methods (tree this_class)
else
dtable_count = integer_zero_node;
+ if (CLASS_ABSTRACT (TYPE_NAME (this_class)))
+ {
+ /* An abstract class can have methods which are declared only in
+ an implemented interface. These are called "Miranda
+ methods". We make a dummy method entry for such methods
+ here. */
+ add_miranda_methods (this_class, this_class);
+ }
+
TYPE_METHODS (this_class) = nreverse (TYPE_METHODS (this_class));
for (method_decl = TYPE_METHODS (this_class);
method_decl; method_decl = TREE_CHAIN (method_decl))
- dtable_count = layout_class_method (this_class, super_class,
+ dtable_count = layout_class_method (this_class, super_class,
method_decl, dtable_count);
TYPE_NVIRTUALS (this_class) = dtable_count;
@@ -1928,8 +1985,8 @@ layout_class_method (tree this_class, tree super_class,
DECL_VINDEX (method_decl) = DECL_VINDEX (super_method);
if (DECL_VINDEX (method_decl) == NULL_TREE
&& !CLASS_FROM_SOURCE_P (this_class))
- error_with_decl (method_decl,
- "non-static method '%s' overrides static method");
+ error ("%Jnon-static method '%D' overrides static method",
+ method_decl, method_decl);
}
else if (! METHOD_FINAL (method_decl)
&& ! METHOD_PRIVATE (method_decl)
@@ -2157,7 +2214,7 @@ java_treetreehash_find (htab_t ht, tree t)
{
struct treetreehash_entry *e;
hashval_t hv = JAVA_TREEHASHHASH_H (t);
- e = (struct treetreehash_entry *) htab_find_with_hash (ht, t, hv);
+ e = htab_find_with_hash (ht, t, hv);
if (e == NULL)
return NULL;
else
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 2737463eca0..7ddf704efad 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1014,21 +1014,12 @@ pushdecl (tree x)
DECL_CONTEXT (x) = current_function_decl;
if (name)
{
- const char *file;
- int line;
-
t = lookup_name_current_level (name);
if (t != 0 && t == error_mark_node)
/* error_mark_node is 0 for a while during initialization! */
{
t = 0;
- error_with_decl (x, "`%s' used prior to declaration");
- }
-
- if (t != 0)
- {
- file = DECL_SOURCE_FILE (t);
- line = DECL_SOURCE_LINE (t);
+ error ("%J'%D' used prior to declaration", x, x);
}
/* If we're naming a hitherto-unnamed type, set its TYPE_NAME
@@ -1364,12 +1355,12 @@ poplevel (int keep, int reverse, int functionbody)
if (DECL_INITIAL (label) == 0)
{
- error_with_decl (label, "label `%s' used but not defined");
+ error ("%Jlabel '%D' used but not defined", label, label);
/* Avoid crashing later. */
define_label (input_location, DECL_NAME (label));
}
else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label))
- warning_with_decl (label, "label `%s' defined but not used");
+ warning ("%Jlabel '%D' defined but not used", label, label);
IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
/* Put the labels into the "variables" of the
@@ -1497,9 +1488,9 @@ force_poplevels (int start_pc)
while (current_binding_level->start_pc > start_pc)
{
if (pedantic && current_binding_level->start_pc > start_pc)
- warning_with_decl (current_function_decl,
- "In %s: overlapped variable and exception ranges at %d",
- current_binding_level->start_pc);
+ warning ("%JIn %D: overlapped variable and exception ranges at %d",
+ current_function_decl, current_function_decl,
+ current_binding_level->start_pc);
expand_end_bindings (getdecls (), 1, 0);
poplevel (1, 0, 0);
}
@@ -1584,8 +1575,8 @@ give_name_to_locals (JCF *jcf)
tree decl = build_decl (VAR_DECL, name, type);
if (end_pc > DECL_CODE_LENGTH (current_function_decl))
{
- warning_with_decl (decl,
- "bad PC range for debug info for local `%s'");
+ warning ("%Jbad PC range for debug info for local '%D'",
+ decl, decl);
end_pc = DECL_CODE_LENGTH (current_function_decl);
}
@@ -1817,6 +1808,59 @@ end_java_method (void)
current_function_decl = NULL_TREE;
}
+/* Expand a function's body. */
+
+void
+java_expand_body (tree fndecl)
+{
+ const char *saved_input_filename = input_filename;
+ int saved_lineno = input_line;
+
+ current_function_decl = fndecl;
+ input_filename = DECL_SOURCE_FILE (fndecl);
+ input_line = DECL_SOURCE_LINE (fndecl);
+
+ timevar_push (TV_EXPAND);
+
+ /* Prepare the function for tree completion. */
+ start_complete_expand_method (fndecl);
+
+ if (! flag_emit_class_files && ! flag_emit_xref)
+ {
+ /* Initialize the RTL code for the function. */
+ init_function_start (fndecl);
+
+ /* Set up parameters and prepare for return, for the function. */
+ expand_function_start (fndecl, 0);
+
+ /* Generate the RTL for this function. */
+ expand_expr_stmt_value (DECL_SAVED_TREE (fndecl), 0, 1);
+ }
+
+ /* Pop out of its parameters. */
+ pushdecl_force_head (DECL_ARGUMENTS (fndecl));
+ poplevel (1, 0, 1);
+ BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
+
+ if (! flag_emit_class_files && ! flag_emit_xref)
+ {
+ /* Generate RTL for function exit. */
+ input_line = DECL_FUNCTION_LAST_LINE (fndecl);
+ expand_function_end ();
+
+ /* Run the optimizers and output the assembler code
+ for this function. */
+ rest_of_compilation (fndecl);
+ }
+
+ timevar_pop (TV_EXPAND);
+
+ input_filename = saved_input_filename;
+ input_line = saved_lineno;
+
+ current_function_decl = NULL_TREE;
+}
+
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
static void
diff --git a/gcc/java/except.c b/gcc/java/except.c
index 9ad41a658ba..6aeff65ea25 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -324,10 +324,36 @@ prepare_eh_table_type (tree type)
else if (is_compiled_class (type))
exp = build_class_ref (type);
else
- exp = fold (build
- (PLUS_EXPR, ptr_type_node,
- build_utf8_ref (DECL_NAME (TYPE_NAME (type))),
- size_one_node));
+ {
+ tree ctype = make_node (RECORD_TYPE);
+ tree field = NULL_TREE;
+ tree cinit, 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))));
+ PUSH_FIELD (ctype, field, "dummy", ptr_type_node);
+ PUSH_FIELD (ctype, field, "utf8", utf8const_ptr_type);
+ FINISH_RECORD (ctype);
+ START_RECORD_CONSTRUCTOR (cinit, ctype);
+ PUSH_FIELD_VALUE (cinit, "dummy",
+ convert (ptr_type_node, integer_minus_one_node));
+ PUSH_FIELD_VALUE (cinit, "utf8", utf8_ref);
+ FINISH_RECORD_CONSTRUCTOR (cinit);
+ TREE_CONSTANT (cinit) = 1;
+ decl = build_decl (VAR_DECL, get_identifier (buf), ctype);
+ TREE_STATIC (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
+ TREE_READONLY (decl) = 1;
+ TREE_THIS_VOLATILE (decl) = 0;
+ DECL_INITIAL (decl) = cinit;
+ layout_decl (decl, 0);
+ pushdecl (decl);
+ rest_of_decl_compilation (decl, (char*) 0, global_bindings_p (), 0);
+ make_decl_rtl (decl, (char*) 0);
+ exp = build1 (ADDR_EXPR, build_pointer_type (ctype), decl);
+ }
return exp;
}
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 0e97e986122..803c2deff83 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -175,7 +175,6 @@ java_truthvalue_conversion (tree expr)
case NEGATE_EXPR:
case ABS_EXPR:
case FLOAT_EXPR:
- case FFS_EXPR:
/* These don't change whether an object is nonzero or zero. */
return java_truthvalue_conversion (TREE_OPERAND (expr, 0));
@@ -232,7 +231,7 @@ flush_quick_stack (void)
decl = find_stack_slot (stack_index, type);
if (decl != node)
- expand_assignment (decl, node, 0, 0);
+ expand_assignment (decl, node, 0);
stack_index += 1 + TYPE_IS_WIDE (type);
}
}
@@ -986,7 +985,7 @@ expand_java_arraystore (tree rhs_type_node)
expand_assignment (build_java_arrayaccess (array,
rhs_type_node,
index),
- rhs_node, 0, 0);
+ rhs_node, 0);
}
/* Expand the evaluation of ARRAY[INDEX]. build_java_check_indexed_type makes
@@ -1273,7 +1272,7 @@ expand_iinc (unsigned int local_var_index, int ival, int pc)
local_var = find_local_variable (local_var_index, int_type_node, pc);
constant_value = build_int_2 (ival, ival < 0 ? -1 : 0);
res = fold (build (PLUS_EXPR, int_type_node, local_var, constant_value));
- expand_assignment (local_var, res, 0, 0);
+ expand_assignment (local_var, res, 0);
}
@@ -1710,6 +1709,8 @@ build_class_init (tree clas, tree expr)
optimizing class initialization. */
if (!STATIC_CLASS_INIT_OPT_P ())
DECL_BIT_INDEX(*init_test_decl) = -1;
+ /* Don't emit any symbolic debugging info for this decl. */
+ DECL_IGNORED_P (*init_test_decl) = 1;
}
init = build (CALL_EXPR, void_type_node,
@@ -2334,23 +2335,24 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index)
if (FIELD_FINAL (field_decl))
{
if (DECL_CONTEXT (field_decl) != current_class)
- error_with_decl (field_decl,
- "assignment to final field `%s' not in field's class");
+ error ("%Jassignment to final field '%D' not in field's class",
+ field_decl, field_decl);
else if (FIELD_STATIC (field_decl))
{
if (!DECL_CLINIT_P (current_function_decl))
- warning_with_decl (field_decl,
- "assignment to final static field `%s' not in class initializer");
+ warning ("%Jassignment to final static field `%D' not in "
+ "class initializer", field_decl, field_decl);
}
else
{
tree cfndecl_name = DECL_NAME (current_function_decl);
if (! DECL_CONSTRUCTOR_P (current_function_decl)
&& !ID_FINIT_P (cfndecl_name))
- warning_with_decl (field_decl, "assignment to final field `%s' not in constructor");
+ warning ("%Jassignment to final field '%D' not in constructor",
+ field_decl, field_decl);
}
}
- expand_assignment (field_ref, new_value, 0, 0);
+ expand_assignment (field_ref, new_value, 0);
}
else
push_value (field_ref);
@@ -2461,7 +2463,7 @@ java_expand_expr (tree exp, rtx target, enum machine_mode tmode,
expand_decl (array_decl);
tmp = expand_assignment (array_decl,
build_new_array (element_type, length),
- 1, 0);
+ 1);
if (TREE_CONSTANT (init)
&& ilength >= 10 && JPRIMITIVE_TYPE_P (element_type))
{
@@ -2480,7 +2482,7 @@ java_expand_expr (tree exp, rtx target, enum machine_mode tmode,
expand_assignment (build (COMPONENT_REF, TREE_TYPE (data_fld),
build_java_indirect_ref (array_type,
array_decl, flag_check_references),
- data_fld), init, 0, 0);
+ data_fld), init, 0);
return tmp;
}
case BLOCK:
@@ -3091,7 +3093,7 @@ process_jvm_instruction (int PC, const unsigned char* byte_ops,
type = TREE_TYPE (value); \
decl = find_local_variable (var, type, oldpc); \
set_local_type (var, type ); \
- expand_assignment (decl, value, 0, 0); \
+ expand_assignment (decl, value, 0); \
}
#define STORE(OPERAND_TYPE, OPERAND_VALUE) \
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index fa739220357..374bdf8bcc9 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -543,7 +543,24 @@ all @samp{.}s will be transformed into @samp{-}s and that searching
for inner classes starts with their outermost outer class. If the class
cannot be found this way the system classloader tries to use
the @code{libgcj} bytecode interpreter to load the class from the standard
-classpath.
+classpath. This process can be controlled to some degree via the
+@code{gnu.gcj.runtime.VMClassLoader.library_control} property;
+@xref{libgcj Runtime Properties}.
+
+@item
+
+@code{libgcj} includes a special @samp{gcjlib} URL type. A URL of
+this form is like a @code{jar} URL, and looks like
+@samp{gcjlib:/path/to/shared/library.so!/path/to/resource}. An access
+to one of these URLs causes the shared library to be @code{dlopen()}d,
+and then the resource is looked for in that library. These URLs are
+most useful when used in conjunction with @code{java.net.URLClassLoader}.
+Note that, due to implementation limitations, currently any such URL
+can be accessed by only one class loader, and libraries are never
+unloaded. This means some care must be exercised to make sure that
+a @code{gcjlib} URL is not accessed by more than one class loader at once.
+In a future release this limitation will be lifted, and such
+libraries will be mapped privately.
@end itemize
@node Invoking gcjh
@@ -778,7 +795,8 @@ gij [@option{-jar}] [@option{OPTION}] @dots{} @var{CLASS} [@var{ARGS}@dots{}]
[@option{-cp} @var{path}] [@option{-classpath} @var{path}]
[@option{-D}@var{name}[=@var{value}]@dots{}]
[@option{-ms=}@var{number}] [@option{-mx=}@var{number}]
- [@option{--showversion}] [@option{--version}] [@option{--help}]
+ [@option{-X@var{argument}]
+ [@option{--showversion}] [@option{--version}] [@option{--help}][@option{-?}]
@c man end
@c man begin SEEALSO gij
gcc(1), gcj(1), gcjh(1), jv-scan(1), jcf-dump(1), gfdl(7),
@@ -838,11 +856,18 @@ This sets the initial heap size.
@item -mx=@var{number}
This sets the maximum heap size.
+@item -X
+@itemx -X@var{argument}
+Supplying @code{-X} by itself will cause @code{gij} to list all the
+supported @code{-X} options. Currently there are none. Unrecognized
+@code{-X} options are ignored, for compatibility with other runtimes.
+
@item -jar
This indicates that the name passed to @code{gij} should be interpreted
as the name of a jar file, not a class.
@item --help
+@itemx -?
Print help, then exit.
@item --showversion
@@ -2239,6 +2264,14 @@ Whether an external process (@command{addr2line} or @command{addr2name.awk})
should be used as fallback to convert the addresses to function names when
the runtime is unable to do it through @code{dladdr}.
+@item gnu.gcj.runtime.VMClassLoader.library_control
+This controls how shared libraries are automatically loaded by the
+built-in class loader. By default, or if this property is set to
+@samp{full}, a full search is done for each requested class. If this
+property is set to @samp{cache}, then any failed lookups are cached
+and not tried again. If this property is set to @samp{never}, then
+lookups are never done. For more information, @xref{Extensions}.
+
@end table
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 357f3493170..69eb73c3784 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -109,8 +109,7 @@ struct JCF;
LABEL_IS_SUBR_START (in LABEL_DECL)
CLASS_ABSTRACT (in TYPE_DECL)
FIELD_TRANSIENT (in FIELD_DECL)
- 6: METHOD_TRANSIENT (in FUNCTION_DECL)
- LABEL_CHANGED (in LABEL_DECL)
+ 6: LABEL_CHANGED (in LABEL_DECL)
CLASS_SUPER (in TYPE_DECL, ACC_SUPER flag)
FIELD_LOCAL_ALIAS (in FIELD_DECL)
7: DECL_CONSTRUCTOR_P (in FUNCTION_DECL).
@@ -287,8 +286,6 @@ enum java_tree_index
JTI_DECIMAL_INT_MAX_NODE,
JTI_DECIMAL_LONG_MAX_NODE,
- JTI_BOOLEAN_TYPE_NODE,
-
JTI_OBJECT_TYPE_NODE,
JTI_UNQUALIFIED_OBJECT_ID_NODE,
JTI_OBJECT_PTR_TYPE_NODE,
@@ -338,9 +335,6 @@ enum java_tree_index
JTI_RETURN_ADDRESS_TYPE_NODE,
- JTI_BOOLEAN_TRUE_NODE,
- JTI_BOOLEAN_FALSE_NODE,
-
JTI_LONG_ZERO_NODE,
JTI_FLOAT_ZERO_NODE,
JTI_DOUBLE_ZERO_NODE,
@@ -457,9 +451,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
#define decimal_long_max \
java_global_trees[JTI_DECIMAL_LONG_MAX_NODE]
-#define boolean_type_node \
- java_global_trees[JTI_BOOLEAN_TYPE_NODE]
-
#define object_type_node \
java_global_trees[JTI_OBJECT_TYPE_NODE]
#define unqualified_object_id_node \
@@ -556,12 +547,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
#define return_address_type_node \
java_global_trees[JTI_RETURN_ADDRESS_TYPE_NODE]
-/* Nodes for boolean constants TRUE and FALSE. */
-#define boolean_true_node \
- java_global_trees[JTI_BOOLEAN_TRUE_NODE]
-#define boolean_false_node \
- java_global_trees[JTI_BOOLEAN_FALSE_NODE]
-
/* Integer constants not declared in tree.h. */
#define long_zero_node \
java_global_trees[JTI_LONG_ZERO_NODE]
@@ -921,12 +906,6 @@ union lang_tree_node
/* The original WFL of a final variable. */
#define DECL_FIELD_FINAL_WFL(NODE) \
(DECL_LANG_SPECIFIC(NODE)->u.v.wfl)
-/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is
- the approximate number of instructions in this function. There is
- no need for this number to be exact; it is only used in various
- heuristics regarding optimization. */
-#define DECL_ESTIMATED_INSNS(NODE) \
- (FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
/* True if NODE is a local variable final. */
#define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE))
/* True if NODE is a final field. */
@@ -946,8 +925,7 @@ union lang_tree_node
if (DECL_LANG_SPECIFIC (T) == NULL) \
{ \
DECL_LANG_SPECIFIC ((T)) \
- = ((struct lang_decl *) \
- ggc_alloc_cleared (sizeof (struct lang_decl))); \
+ = ggc_alloc_cleared (sizeof (struct lang_decl)); \
DECL_LANG_SPECIFIC (T)->desc = LANG_DECL_VAR; \
}
@@ -999,6 +977,9 @@ struct lang_decl_func GTY(())
unsigned int fixed_ctor : 1;
unsigned int init_calls_this : 1;
unsigned int strictfp : 1;
+ unsigned int invisible : 1; /* Set for methods we generate
+ internally but which shouldn't be
+ written to the .class file. */
};
struct treetreehash_entry GTY(())
@@ -1050,9 +1031,8 @@ struct lang_decl GTY(())
#define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T) \
if (TYPE_LANG_SPECIFIC ((T)) == NULL) \
{ \
- TYPE_LANG_SPECIFIC ((T)) = \
- ((struct lang_type *) \
- ggc_alloc_cleared (sizeof (struct lang_type))); \
+ TYPE_LANG_SPECIFIC ((T)) \
+ = ggc_alloc_cleared (sizeof (struct lang_type)); \
}
#define TYPE_FINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->finit_stmt_list)
@@ -1094,6 +1074,12 @@ struct lang_type GTY(())
#define JCF_u4 unsigned long
#define JCF_u2 unsigned short
+/* Possible values to pass to lookup_argument_method_generic. */
+#define SEARCH_INTERFACE 1
+#define SEARCH_SUPER 2
+#define SEARCH_ONLY_INTERFACE 4
+#define SEARCH_VISIBLE 8
+
extern void java_parse_file (int);
extern bool java_mark_addressable (tree);
extern tree java_type_for_mode (enum machine_mode, int);
@@ -1107,7 +1093,7 @@ extern tree lookup_class (tree);
extern tree lookup_java_constructor (tree, tree);
extern tree lookup_java_method (tree, tree, tree);
extern tree lookup_argument_method (tree, tree, tree);
-extern tree lookup_argument_method2 (tree, tree, tree);
+extern tree lookup_argument_method_generic (tree, tree, tree, int);
extern int has_method (tree, tree);
extern tree promote_type (tree);
extern tree get_constant (struct JCF*, int);
@@ -1311,6 +1297,9 @@ extern void compile_resource_file (const char *, const char *);
extern void write_resource_constructor (void);
extern void init_resource_processing (void);
+extern void start_complete_expand_method (tree);
+extern void java_expand_body (tree);
+
#define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL)
@@ -1324,8 +1313,8 @@ extern void init_resource_processing (void);
#define METHOD_SYNCHRONIZED(DECL) DECL_LANG_FLAG_4 (DECL)
#define METHOD_NATIVE(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.native)
#define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL)
-#define METHOD_TRANSIENT(DECL) DECL_LANG_FLAG_6 (DECL)
#define METHOD_STRICTFP(DECL) (DECL_LANG_SPECIFIC (DECL)->u.f.strictfp)
+#define METHOD_INVISIBLE(DECL) (DECL_LANG_SPECIFIC (DECL)->u.f.invisible)
#define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE)
#define CLASS_FILE_P(NODE) TREE_LANG_FLAG_3 (NODE)
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 23939271061..f47dbe0897a 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -42,6 +42,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "debug.h"
#include "assert.h"
#include "tm_p.h"
+#include "cgraph.h"
#ifdef HAVE_LOCALE_H
#include <locale.h>
@@ -1119,6 +1120,13 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
java_expand_classes ();
if (!java_report_errors () && !flag_syntax_only)
{
+ if (flag_unit_at_a_time)
+ {
+ cgraph_finalize_compilation_unit ();
+ cgraph_optimize ();
+ java_finish_classes ();
+ }
+
emit_register_classes ();
if (flag_indirect_dispatch)
emit_offset_symbol_table ();
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index fcdd42447b4..82c77b1c831 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -386,8 +386,7 @@ static struct chunk *
alloc_chunk (struct chunk *last, unsigned char *data,
int size, struct obstack *work)
{
- struct chunk *chunk = (struct chunk *)
- obstack_alloc (work, sizeof(struct chunk));
+ struct chunk *chunk = obstack_alloc (work, sizeof(struct chunk));
if (data == NULL && size > 0)
data = obstack_alloc (work, size);
@@ -434,8 +433,8 @@ append_chunk_copy (unsigned char *data, int size, struct jcf_partial *state)
static struct jcf_block *
gen_jcf_label (struct jcf_partial *state)
{
- struct jcf_block *block = (struct jcf_block *)
- obstack_alloc (state->chunk_obstack, sizeof (struct jcf_block));
+ struct jcf_block *block
+ = obstack_alloc (state->chunk_obstack, sizeof (struct jcf_block));
block->next = NULL;
block->linenumber = -1;
block->pc = UNDEFINED_PC;
@@ -518,8 +517,8 @@ static struct jcf_handler *
alloc_handler (struct jcf_block *start_label, struct jcf_block *end_label,
struct jcf_partial *state)
{
- struct jcf_handler *handler = (struct jcf_handler *)
- obstack_alloc (state->chunk_obstack, sizeof (struct jcf_handler));
+ struct jcf_handler *handler
+ = obstack_alloc (state->chunk_obstack, sizeof (struct jcf_handler));
handler->start_label = start_label;
handler->end_label = end_label;
handler->handler_label = get_jcf_label_here (state);
@@ -576,8 +575,7 @@ localvar_alloc (tree decl, struct jcf_partial *state)
ptr = (struct localvar_info**) state->localvars.data + index;
state->localvars.ptr = (unsigned char *) (ptr + 1 + wide);
}
- info = (struct localvar_info *)
- obstack_alloc (state->chunk_obstack, sizeof (struct localvar_info));
+ info = obstack_alloc (state->chunk_obstack, sizeof (struct localvar_info));
ptr[0] = info;
if (wide)
ptr[1] = (struct localvar_info *)(~0);
@@ -1004,8 +1002,8 @@ static void
emit_reloc (HOST_WIDE_INT value, int kind,
struct jcf_block *target, struct jcf_partial *state)
{
- struct jcf_relocation *reloc = (struct jcf_relocation *)
- obstack_alloc (state->chunk_obstack, sizeof (struct jcf_relocation));
+ struct jcf_relocation *reloc
+ = obstack_alloc (state->chunk_obstack, sizeof (struct jcf_relocation));
struct jcf_block *block = state->last_block;
reloc->next = block->u.relocations;
block->u.relocations = reloc;
@@ -1464,8 +1462,9 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
OP1 (prec == 1 ? OPCODE_fconst_0 : OPCODE_dconst_0);
else if (real_onep (exp))
OP1 (prec == 1 ? OPCODE_fconst_1 : OPCODE_dconst_1);
- /* FIXME Should also use fconst_2 for 2.0f.
- Also, should use iconst_2/ldc followed by i2f/i2d
+ else if (prec == 1 && real_twop (exp))
+ OP1 (OPCODE_fconst_2);
+ /* ??? We could also use iconst_3/ldc followed by i2f/i2d
for other float/double when the value is a small integer. */
else
{
@@ -1582,8 +1581,8 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
case CASE_EXPR:
{
struct jcf_switch_state *sw_state = state->sw_state;
- struct jcf_relocation *reloc = (struct jcf_relocation *)
- obstack_alloc (state->chunk_obstack, sizeof (struct jcf_relocation));
+ struct jcf_relocation *reloc
+ = obstack_alloc (state->chunk_obstack, sizeof (struct jcf_relocation));
HOST_WIDE_INT case_value = TREE_INT_CST_LOW (TREE_OPERAND (exp, 0));
reloc->kind = 0;
reloc->label = get_jcf_label_here (state);
@@ -1663,8 +1662,8 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
HOST_WIDE_INT i;
unsigned HOST_WIDE_INT delta;
/* Copy the chain of relocs into a sorted array. */
- struct jcf_relocation **relocs = (struct jcf_relocation **)
- xmalloc (sw_state.num_cases * sizeof (struct jcf_relocation *));
+ struct jcf_relocation **relocs
+ = xmalloc (sw_state.num_cases * sizeof (struct jcf_relocation *));
/* The relocs arrays is a buffer with a gap.
The assumption is that cases will normally come in "runs". */
int gap_start = 0;
@@ -2415,6 +2414,23 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
case JAVA_EXC_OBJ_EXPR:
NOTE_PUSH (1); /* Pushed by exception system. */
break;
+ case MIN_EXPR:
+ case MAX_EXPR:
+ {
+ /* This copes with cases where fold() has created MIN or MAX
+ from a conditional expression. */
+ enum tree_code code = TREE_CODE (exp) == MIN_EXPR ? LT_EXPR : GT_EXPR;
+ tree op0 = TREE_OPERAND (exp, 0);
+ tree op1 = TREE_OPERAND (exp, 1);
+ tree x;
+ if (TREE_SIDE_EFFECTS (op0) || TREE_SIDE_EFFECTS (op1))
+ abort ();
+ x = build (COND_EXPR, TREE_TYPE (exp),
+ build (code, boolean_type_node, op0, op1),
+ op0, op1);
+ generate_bytecode_insns (x, target, state);
+ break;
+ }
case NEW_CLASS_EXPR:
{
tree class = TREE_TYPE (TREE_TYPE (exp));
@@ -2669,8 +2685,7 @@ perform_relocations (struct jcf_partial *state)
unsigned char *old_ptr = old_buffer + old_size;
if (new_size != old_size)
{
- chunk->data = (unsigned char *)
- obstack_alloc (state->chunk_obstack, new_size);
+ chunk->data = obstack_alloc (state->chunk_obstack, new_size);
chunk->size = new_size;
}
new_ptr = chunk->data + new_size;
@@ -2922,6 +2937,12 @@ generate_classfile (tree clas, struct jcf_partial *state)
tree type = TREE_TYPE (part);
tree save_function = current_function_decl;
int synthetic_p = 0;
+
+ /* Invisible Miranda methods shouldn't end up in the .class
+ file. */
+ if (METHOD_INVISIBLE (part))
+ continue;
+
current_function_decl = part;
ptr = append_chunk (NULL, 8, state);
i = get_access_flags (part); PUT2 (i);
diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h
index 970656732c0..5b97fec9525 100644
--- a/gcc/java/jcf.h
+++ b/gcc/java/jcf.h
@@ -230,6 +230,9 @@ typedef struct JCF GTY(()) {
#define ACC_INTERFACE 0x0200
#define ACC_ABSTRACT 0x0400
#define ACC_STRICT 0x0800
+/* "Invisible" refers to Miranda methods inserted into an abstract
+ #class. It is also used in the runtime. */
+#define ACC_INVISIBLE 0x1000
#define ACC_VISIBILITY (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED)
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index 710a344c746..575d9410b38 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -84,8 +84,7 @@ static const char jvgenmain_spec[] =
/* Return full path name of spec file if it is in DIR, or NULL if
not. */
static char *
-find_spec_file (dir)
- const char *dir;
+find_spec_file (const char *dir)
{
char *spec;
int x;
@@ -116,8 +115,7 @@ find_spec_file (dir)
/* Verify that NAME is a valid Java class name that might contain
`main'. Return 0 on failure. */
static int
-verify_class_name (name)
- const char *name;
+verify_class_name (const char *name)
{
/* FIXME: what encoding do we use for command-line arguments? For
now we assume plain ASCII, which of course is wrong. */
@@ -144,10 +142,8 @@ verify_class_name (name)
}
void
-lang_specific_driver (in_argc, in_argv, in_added_libraries)
- int *in_argc;
- const char *const **in_argv;
- int *in_added_libraries;
+lang_specific_driver (int *in_argc, const char *const **in_argv,
+ int *in_added_libraries)
{
int i, j;
@@ -319,7 +315,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
else if (argv[i][1] == 'O')
saw_O = 1;
else if ((argv[i][2] == '\0'
- && (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
+ && strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
|| strcmp (argv[i], "-Tdata") == 0
|| strcmp (argv[i], "-MT") == 0
|| strcmp (argv[i], "-MF") == 0)
@@ -337,7 +333,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
}
else if (library != 0
&& ((argv[i][2] == '\0'
- && (char *) strchr ("cSEM", argv[i][1]) != NULL)
+ && strchr ("cSEM", argv[i][1]) != NULL)
|| strcmp (argv[i], "-MM") == 0))
{
/* Don't specify libraries if we won't link, since that would
@@ -600,7 +596,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
}
int
-lang_specific_pre_link ()
+lang_specific_pre_link (void)
{
int err;
if (main_class_name == NULL)
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 1f9470627fa..5ade4c0844c 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -67,6 +67,7 @@ static bool java_dump_tree (void *, tree);
static void dump_compound_expr (dump_info_p, tree);
static bool java_decl_ok_for_sibcall (tree);
static int java_estimate_num_insns (tree);
+static int java_start_inlining (tree);
#ifndef TARGET_OBJECT_SUFFIX
# define TARGET_OBJECT_SUFFIX ".o"
@@ -253,12 +254,18 @@ struct language_function GTY(())
#undef LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS
#define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS java_estimate_num_insns
+#undef LANG_HOOKS_TREE_INLINING_START_INLINING
+#define LANG_HOOKS_TREE_INLINING_START_INLINING java_start_inlining
+
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN java_dump_tree
#undef LANG_HOOKS_DECL_OK_FOR_SIBCALL
#define LANG_HOOKS_DECL_OK_FOR_SIBCALL java_decl_ok_for_sibcall
+#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
+#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION java_expand_body
+
/* Each front end provides its own. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -1127,7 +1134,6 @@ java_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case ROUND_MOD_EXPR:
case RDIV_EXPR:
case CALL_EXPR:
- case METHOD_CALL_EXPR:
case NEW_ARRAY_EXPR:
case NEW_ANONYMOUS_ARRAY_EXPR:
@@ -1179,8 +1185,21 @@ static int
java_estimate_num_insns (tree decl)
{
int num = 0;
- walk_tree (&DECL_SAVED_TREE (decl), java_estimate_num_insns_1, &num, NULL);
+ walk_tree_without_duplicates (&DECL_SAVED_TREE (decl),
+ java_estimate_num_insns_1, &num);
return num;
}
+/* Start inlining fn. Called by the tree inliner via
+ lang_hooks.tree_inlining.cannot_inline_tree_fn. */
+
+static int
+java_start_inlining (tree fn)
+{
+ /* A java function's body doesn't have a BLOCK structure suitable
+ for debug output until it is expanded. Prevent inlining functions
+ that are not yet expanded. */
+ return TREE_ASM_WRITTEN (fn) ? 1 : 0;
+}
+
#include "gt-java-lang.h"
diff --git a/gcc/java/lang.opt b/gcc/java/lang.opt
index ed8d02ee151..987eb82e444 100644
--- a/gcc/java/lang.opt
+++ b/gcc/java/lang.opt
@@ -27,45 +27,59 @@ Java
I
Java Joined
+; Documented for C
M
Java
+; Documented for C
MD_
-Java
+Java Undocumented
+; Documented for C
MF
Java Separate
+; Documented for C
MM
Java
+; Documented for C
MMD_
-Java
+Java Undocumented
+; Documented for C
MP
Java
+; Documented for C
MT
Java Separate
+; Documented for C
Wall
Java
+; Documented for C
Wdeprecated
Java
+Warn if deprecated class, method, or field is used
Wextraneous-semicolon
Java
+Warn if deprecated empty statements are found
Wout-of-date
Java
+Warn if .class files are out of date
Wredundant-modifiers
Java
+Warn if modifiers are specified when not necessary
fCLASSPATH=
Java JoinedOrMissing RejectNegative
+--CLASSPATH Deprecated; use --classpath instead
fassert
Java
@@ -78,12 +92,14 @@ Java JoinedOrMissing
fbootclasspath=
Java JoinedOrMissing RejectNegative
+--bootclasspath=<path> Replace system path
fcheck-references
Java
fclasspath=
Java JoinedOrMissing RejectNegative
+--classpath=<path> Set class path
fcompile-resource=
Java Joined RejectNegative
@@ -99,6 +115,7 @@ Java
fencoding=
Java Joined RejectNegative
+--encoding=<encoding> Choose input encoding (defaults from your locale)
fextdirs=
Java Joined RejectNegative
@@ -108,27 +125,32 @@ Java
fforce-classes-archive-check
Java
+Always check for non gcj generated classes archives
fhash-synchronization
Java
findirect-dispatch
Java
+Use offset tables for virtual method calls
finline-functions
Java
fjni
Java
+Assume native functions are implemented using JNI
foptimize-static-class-initialization
Java
+Enable optimization of static class initialization code
foutput-class-dir=
Java Joined RejectNegative
fstore-check
Java
+Enable assignability checks for stores into object arrays
fuse-boehm-gc
Java
diff --git a/gcc/java/mangle.c b/gcc/java/mangle.c
index ca5997cba74..e545cbc1fac 100644
--- a/gcc/java/mangle.c
+++ b/gcc/java/mangle.c
@@ -67,6 +67,9 @@ struct obstack *mangle_obstack;
#define MANGLE_RAW_STRING(S) \
obstack_grow (mangle_obstack, (S), sizeof (S)-1)
+/* atms: array template mangled string. */
+static GTY(()) tree atms;
+
/* This is the mangling interface: a decl, a class field (.class) and
the vtable. */
@@ -233,7 +236,7 @@ mangle_type (tree type)
already seen, so they can be reused. For example, java.lang.Object
would generate three entries: two package names and a type. If
java.lang.String is presented next, the java.lang will be matched
- against the first two entries (and kept for compression as S_0), and
+ against the first two entries (and kept for compression as S0_), and
type String would be added to the table. See mangle_record_type.
COMPRESSION_NEXT is the index to the location of the next insertion
of an element. */
@@ -301,12 +304,16 @@ find_compression_record_match (tree type, tree *next_current)
i++;
break;
}
+ else if (atms && TREE_VEC_ELT (compression_table, j) == atms)
+ {
+ /* Skip over a "6JArray". */
+ }
else
{
/* We don't want to match an element that appears in the middle
of a package name, so skip forward to the next complete type name.
- IDENTIFIER_NODEs are partial package names while RECORD_TYPEs
- represent complete type names. */
+ IDENTIFIER_NODEs (except for a "6JArray") are partial package
+ names while RECORD_TYPEs represent complete type names. */
while (j < compression_next
&& TREE_CODE (TREE_VEC_ELT (compression_table, j)) ==
IDENTIFIER_NODE)
@@ -413,11 +420,9 @@ mangle_pointer_type (tree type)
/* Mangle an array type. Search for an easy solution first, then go
through the process of finding out whether the bare array type or even
- the template indicator where already used an compress appropriately.
+ the template indicator were already used and compressed appropriately.
It handles pointers. */
-/* atms: array template mangled string. */
-static GTY(()) tree atms;
static void
mangle_array_type (tree p_type)
{
@@ -436,7 +441,7 @@ mangle_array_type (tree p_type)
atms = get_identifier ("6JArray");
}
- /* Maybe we have what we're looking in the compression table. */
+ /* Maybe we have what we're looking for in the compression table. */
if ((match = find_compression_array_match (p_type)) >= 0)
{
emit_compression_string (match);
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index df1fa562844..023410842b2 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -941,6 +941,7 @@ ATTRIBUTE_NORETURN
#endif
;
extern void java_expand_classes (void);
+extern void java_finish_classes (void);
extern GTY(()) struct parser_ctxt *ctxp;
extern GTY(()) struct parser_ctxt *ctxp_for_generation;
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index cbb4297f962..a5064e18465 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -71,6 +71,7 @@ definitions and other extensions. */
#include "ggc.h"
#include "debug.h"
#include "tree-inline.h"
+#include "cgraph.h"
/* Local function prototypes */
static char *java_accstring_lookup (int);
@@ -141,7 +142,6 @@ static tree java_complete_tree (tree);
static tree maybe_generate_pre_expand_clinit (tree);
static int analyze_clinit_body (tree, tree);
static int maybe_yank_clinit (tree);
-static void start_complete_expand_method (tree);
static void java_complete_expand_method (tree);
static void java_expand_method_bodies (tree);
static int unresolved_type_p (tree, tree *);
@@ -220,10 +220,11 @@ static tree build_try_finally_statement (int, tree, tree);
static tree patch_try_statement (tree);
static tree patch_synchronized_statement (tree, tree);
static tree patch_throw_statement (tree, tree);
-static void check_thrown_exceptions (int, tree);
+static void check_thrown_exceptions (int, tree, tree);
static int check_thrown_exceptions_do (tree);
static void purge_unchecked_exceptions (tree);
static bool ctors_unchecked_throws_clause_p (tree);
+static void check_concrete_throws_clauses (tree, tree, tree, tree);
static void check_throws_clauses (tree, tree, tree);
static void finish_method_declaration (tree);
static tree build_super_invocation (tree);
@@ -244,7 +245,9 @@ static void start_artificial_method_body (tree);
static void end_artificial_method_body (tree);
static int check_method_redefinition (tree, tree);
static int check_method_types_complete (tree);
+static bool hack_is_accessible_p (tree, tree);
static void java_check_regular_methods (tree);
+static void check_interface_throws_clauses (tree, tree);
static void java_check_abstract_methods (tree);
static void unreachable_stmt_error (tree);
static tree find_expr_with_wfl (tree);
@@ -1349,14 +1352,8 @@ variable_initializers:
/* 19.11 Production from 14: Blocks and Statements */
block:
- OCB_TK CCB_TK
- {
- /* Store the location of the `}' when doing xrefs */
- if (current_function_decl && flag_emit_xref)
- DECL_END_SOURCE_LINE (current_function_decl) =
- EXPR_WFL_ADD_COL ($2.location, 1);
- $$ = empty_stmt_node;
- }
+ block_begin block_end
+ { $$ = $2; }
| block_begin block_statements block_end
{ $$ = $3; }
;
@@ -5402,6 +5399,7 @@ craft_constructor (tree class_decl, tree args)
/* Now, mark the artificial parameters. */
DECL_FUNCTION_NAP (decl) = artificial;
DECL_FUNCTION_SYNTHETIC_CTOR (decl) = DECL_CONSTRUCTOR_P (decl) = 1;
+ DECL_INLINE (decl) = 1;
return decl;
}
@@ -6244,11 +6242,35 @@ java_check_methods (tree class_decl)
CLASS_METHOD_CHECKED_P (TREE_TYPE (class_decl)) = 1;
}
+/* Like not_accessible_p, but doesn't refer to the current class at
+ all. */
+static bool
+hack_is_accessible_p (tree member, tree from_where)
+{
+ int flags = get_access_flags_from_decl (member);
+
+ if (from_where == DECL_CONTEXT (member)
+ || (flags & ACC_PUBLIC))
+ return true;
+
+ if ((flags & ACC_PROTECTED))
+ {
+ if (inherits_from_p (from_where, DECL_CONTEXT (member)))
+ return true;
+ }
+
+ if ((flags & ACC_PRIVATE))
+ return false;
+
+ /* Package private, or protected. */
+ return in_same_package (TYPE_NAME (from_where),
+ TYPE_NAME (DECL_CONTEXT (member)));
+}
+
/* Check all the methods of CLASS_DECL. Methods are first completed
then checked according to regular method existence rules. If no
constructor for CLASS_DECL were encountered, then build its
declaration. */
-
static void
java_check_regular_methods (tree class_decl)
{
@@ -6298,7 +6320,8 @@ java_check_regular_methods (tree class_decl)
}
sig = build_java_argument_signature (TREE_TYPE (method));
- found = lookup_argument_method2 (class, DECL_NAME (method), sig);
+ found = lookup_argument_method_generic (class, DECL_NAME (method), sig,
+ SEARCH_SUPER | SEARCH_INTERFACE);
/* Inner class can't declare static methods */
if (METHOD_STATIC (method) && !TOPLEVEL_CLASS_DECL_P (class_decl))
@@ -6357,7 +6380,7 @@ java_check_regular_methods (tree class_decl)
continue;
parse_error_context
(method_wfl,
- "%s methods can't be overriden. Method `%s' is %s in class `%s'",
+ "%s methods can't be overridden. Method `%s' is %s in class `%s'",
(METHOD_FINAL (found) ? "Final" : "Static"),
lang_printable_name (found, 0),
(METHOD_FINAL (found) ? "final" : "static"),
@@ -6371,7 +6394,7 @@ java_check_regular_methods (tree class_decl)
{
parse_error_context
(method_wfl,
- "Instance methods can't be overriden by a static method. Method `%s' is an instance method in class `%s'",
+ "Instance methods can't be overridden by a static method. Method `%s' is an instance method in class `%s'",
lang_printable_name (found, 0),
IDENTIFIER_POINTER
(DECL_NAME (TYPE_NAME (DECL_CONTEXT (found)))));
@@ -6380,7 +6403,7 @@ java_check_regular_methods (tree class_decl)
/* - Overriding/hiding public must be public
- Overriding/hiding protected must be protected or public
- - If the overriden or hidden method has default (package)
+ - If the overridden or hidden method has default (package)
access, then the overriding or hiding method must not be
private; otherwise, a compile-time error occurs. If
`found' belongs to an interface, things have been already
@@ -6402,13 +6425,20 @@ java_check_regular_methods (tree class_decl)
continue;
}
- /* Overriding methods must have compatible `throws' clauses on checked
- exceptions, if any */
- check_throws_clauses (method, method_wfl, found);
-
- /* Inheriting multiple methods with the same signature. FIXME */
+ /* Check this method against all the other implementations it
+ overrides. Here we only check the class hierarchy; the rest
+ of the checking is done later. If this method is just a
+ Miranda method, we can skip the check. */
+ if (! METHOD_INVISIBLE (method))
+ check_concrete_throws_clauses (class, method, DECL_NAME (method), sig);
}
+ /* The above throws clause check only looked at superclasses. Now
+ we must also make sure that all methods declared in interfaces
+ have compatible throws clauses. FIXME: there are more efficient
+ ways to organize this checking; we should implement one. */
+ check_interface_throws_clauses (class, class);
+
if (!TYPE_NVIRTUALS (class))
TYPE_METHODS (class) = nreverse (TYPE_METHODS (class));
@@ -6420,13 +6450,83 @@ java_check_regular_methods (tree class_decl)
abort ();
}
-/* Return a nonzero value if the `throws' clause of METHOD (if any)
- is incompatible with the `throws' clause of FOUND (if any). */
+/* Check to make sure that all the methods in all the interfaces
+ implemented by CLASS_DECL are compatible with the concrete
+ implementations available in CHECK_CLASS_DECL. */
+static void
+check_interface_throws_clauses (tree check_class_decl, tree class_decl)
+{
+ for (; class_decl != NULL_TREE; class_decl = CLASSTYPE_SUPER (class_decl))
+ {
+ tree bases = TYPE_BINFO_BASETYPES (class_decl);
+ int iface_len = TREE_VEC_LENGTH (bases) - 1;
+ int i;
+
+ for (i = iface_len; i > 0; --i)
+ {
+ tree interface = BINFO_TYPE (TREE_VEC_ELT (bases, i));
+ tree iface_method;
+
+ for (iface_method = TYPE_METHODS (interface);
+ iface_method != NULL_TREE;
+ iface_method = TREE_CHAIN (iface_method))
+ {
+ tree sig, method;
+
+ /* First look for a concrete method implemented or
+ inherited by this class. No need to search
+ interfaces here, since we're already looking through
+ all of them. */
+ sig = build_java_argument_signature (TREE_TYPE (iface_method));
+ method
+ = lookup_argument_method_generic (check_class_decl,
+ DECL_NAME (iface_method),
+ sig, SEARCH_VISIBLE);
+ /* If we don't find an implementation, that is ok. Any
+ potential errors from that are diagnosed elsewhere.
+ Also, multiple inheritance with conflicting throws
+ clauses is fine in the absence of a concrete
+ implementation. */
+ if (method != NULL_TREE && !METHOD_ABSTRACT (method))
+ {
+ tree method_wfl = DECL_FUNCTION_WFL (method);
+ check_throws_clauses (method, method_wfl, iface_method);
+ }
+ }
+
+ /* Now check superinterfaces. */
+ check_interface_throws_clauses (check_class_decl, interface);
+ }
+ }
+}
+
+/* Check throws clauses of a method against the clauses of all the
+ methods it overrides. We do this by searching up the class
+ hierarchy, examining all matching accessible methods. */
+static void
+check_concrete_throws_clauses (tree class, tree self_method,
+ tree name, tree signature)
+{
+ tree method = lookup_argument_method_generic (class, name, signature,
+ SEARCH_SUPER | SEARCH_VISIBLE);
+ while (method != NULL_TREE)
+ {
+ if (! METHOD_INVISIBLE (method) && hack_is_accessible_p (method, class))
+ check_throws_clauses (self_method, DECL_FUNCTION_WFL (self_method),
+ method);
+
+ method = lookup_argument_method_generic (DECL_CONTEXT (method),
+ name, signature,
+ SEARCH_SUPER | SEARCH_VISIBLE);
+ }
+}
+/* Generate an error if the `throws' clause of METHOD (if any) is
+ incompatible with the `throws' clause of FOUND (if any). */
static void
check_throws_clauses (tree method, tree method_wfl, tree found)
{
- tree mthrows, fthrows;
+ tree mthrows;
/* Can't check these things with class loaded from bytecode. FIXME */
if (!CLASS_FROM_SOURCE_P (DECL_CONTEXT (found)))
@@ -6435,28 +6535,31 @@ check_throws_clauses (tree method, tree method_wfl, tree found)
for (mthrows = DECL_FUNCTION_THROWS (method);
mthrows; mthrows = TREE_CHAIN (mthrows))
{
+ tree fthrows;
+
/* We don't verify unchecked expressions */
if (IS_UNCHECKED_EXCEPTION_P (TREE_VALUE (mthrows)))
continue;
/* Checked expression must be compatible */
for (fthrows = DECL_FUNCTION_THROWS (found);
fthrows; fthrows = TREE_CHAIN (fthrows))
- if (inherits_from_p (TREE_VALUE (mthrows), TREE_VALUE (fthrows)))
- break;
+ {
+ if (inherits_from_p (TREE_VALUE (mthrows), TREE_VALUE (fthrows)))
+ break;
+ }
if (!fthrows)
{
parse_error_context
- (method_wfl, "Invalid checked exception class `%s' in `throws' clause. The exception must be a subclass of an exception thrown by `%s' from class `%s'",
+ (method_wfl, "Invalid checked exception class `%s' in `throws' clause. The exception must be a subclass of an exception thrown by `%s' from class `%s'",
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows)))),
lang_printable_name (found, 0),
IDENTIFIER_POINTER
- (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found)))));
+ (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found)))));
}
}
}
/* Check abstract method of interface INTERFACE */
-
static void
java_check_abstract_methods (tree interface_decl)
{
@@ -6470,8 +6573,7 @@ java_check_abstract_methods (tree interface_decl)
if (check_method_redefinition (interface, method))
continue;
- /* 3- Overriding is OK as far as we preserve the return type and
- the thrown exceptions (FIXME) */
+ /* 3- Overriding is OK as far as we preserve the return type. */
found = lookup_java_interface_method2 (interface, method);
if (found)
{
@@ -7369,30 +7471,20 @@ source_end_java_method (void)
patched. Dump it to a file if the user requested it. */
dump_java_tree (TDI_original, fndecl);
- java_optimize_inline (fndecl);
-
- /* Generate function's code */
- if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl))
- && ! flag_emit_class_files
- && ! flag_emit_xref)
- expand_expr_stmt (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)));
-
- /* pop out of its parameters */
- pushdecl_force_head (DECL_ARGUMENTS (fndecl));
- poplevel (1, 0, 1);
- BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
-
- /* Generate rtl for function exit. */
- if (! flag_emit_class_files && ! flag_emit_xref)
+ /* In unit-at-a-time mode, don't expand the method yet. */
+ if (DECL_SAVED_TREE (fndecl) && flag_unit_at_a_time)
{
- input_line = DECL_FUNCTION_LAST_LINE (fndecl);
- expand_function_end ();
-
- /* Run the optimizers and output assembler code for this function. */
- rest_of_compilation (fndecl);
+ cgraph_finalize_function (fndecl, false);
+ current_function_decl = NULL_TREE;
+ java_parser_context_restore_global ();
+ return;
}
- current_function_decl = NULL_TREE;
+ java_optimize_inline (fndecl);
+
+ /* Expand the function's body. */
+ java_expand_body (fndecl);
+
java_parser_context_restore_global ();
}
@@ -7862,7 +7954,7 @@ maybe_yank_clinit (tree mdecl)
/* Install the argument from MDECL. Suitable to completion and
expansion of mdecl's body. */
-static void
+void
start_complete_expand_method (tree mdecl)
{
tree tem;
@@ -8005,15 +8097,26 @@ java_expand_method_bodies (tree class)
tree decl;
for (decl = TYPE_METHODS (class); decl; decl = TREE_CHAIN (decl))
{
- if (!DECL_FUNCTION_BODY (decl))
+ tree block;
+ tree body;
+
+ if (! DECL_FUNCTION_BODY (decl))
continue;
current_function_decl = decl;
- /* Save the function for inlining. */
- if (flag_inline_trees)
- DECL_SAVED_TREE (decl) =
- BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (decl));
+ block = BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (decl));
+
+ if (TREE_CODE (block) != BLOCK)
+ abort ();
+
+ /* Save the function body for inlining. */
+ DECL_SAVED_TREE (decl) = block;
+
+ body = BLOCK_EXPR_BODY (block);
+
+ if (TREE_TYPE (body) == NULL_TREE)
+ abort ();
/* It's time to assign the variable flagging static class
initialization based on which classes invoked static methods
@@ -8046,15 +8149,41 @@ java_expand_method_bodies (tree class)
}
}
- /* Prepare the function for RTL expansion */
- start_complete_expand_method (decl);
+ /* Prepend class initialization to static methods. */
+ if (METHOD_STATIC (decl) && ! METHOD_PRIVATE (decl)
+ && ! flag_emit_class_files
+ && ! DECL_CLINIT_P (decl)
+ && ! CLASS_INTERFACE (TYPE_NAME (class)))
+ {
+ tree init = build (CALL_EXPR, void_type_node,
+ build_address_of (soft_initclass_node),
+ build_tree_list (NULL_TREE,
+ build_class_ref (class)),
+ NULL_TREE);
+ TREE_SIDE_EFFECTS (init) = 1;
+ body = build (COMPOUND_EXPR, TREE_TYPE (body), init, body);
+ BLOCK_EXPR_BODY (block) = body;
+ }
+
+ /* Wrap synchronized method bodies in a monitorenter
+ plus monitorexit cleanup. */
+ if (METHOD_SYNCHRONIZED (decl) && ! flag_emit_class_files)
+ {
+ tree enter, exit, lock;
+ if (METHOD_STATIC (decl))
+ lock = build_class_ref (class);
+ else
+ lock = DECL_ARGUMENTS (decl);
+ BUILD_MONITOR_ENTER (enter, lock);
+ BUILD_MONITOR_EXIT (exit, lock);
- /* Expand function start, generate initialization flag
- assignment, and handle synchronized methods. */
- complete_start_java_method (decl);
+ body = build (COMPOUND_EXPR, void_type_node,
+ enter,
+ build (TRY_FINALLY_EXPR, void_type_node, body, exit));
+ BLOCK_EXPR_BODY (block) = body;
+ }
- /* Expand the rest of the function body and terminate
- expansion. */
+ /* Expand the the function body. */
source_end_java_method ();
}
}
@@ -9017,12 +9146,30 @@ java_expand_classes (void)
else if (! flag_syntax_only)
{
java_expand_method_bodies (current_class);
- finish_class ();
+ if (!flag_unit_at_a_time)
+ finish_class ();
}
}
}
}
+void
+java_finish_classes (void)
+{
+ static struct parser_ctxt *cur_ctxp = NULL;
+ for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
+ {
+ tree current;
+ ctxp = cur_ctxp;
+ for (current = ctxp->class_list; current; current = TREE_CHAIN (current))
+ {
+ current_class = TREE_TYPE (current);
+ outgoing_cpool = TYPE_CPOOL (current_class);
+ finish_class ();
+ }
+ }
+}
+
/* Wrap non WFL PRIMARY around a WFL and set EXPR_WFL_QUALIFICATION to
a tree list node containing RIGHT. Fore coming RIGHTs will be
chained to this hook. LOCATION contains the location of the
@@ -9454,7 +9601,13 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl,
if (location
&& !OUTER_FIELD_ACCESS_IDENTIFIER_P
(DECL_NAME (current_function_decl)))
- check_thrown_exceptions (location, ret_decl);
+ {
+ tree arguments = NULL_TREE;
+ if (TREE_CODE (qual_wfl) == CALL_EXPR
+ && TREE_OPERAND (qual_wfl, 1) != NULL_TREE)
+ arguments = TREE_VALUE (TREE_OPERAND (qual_wfl, 1));
+ check_thrown_exceptions (location, ret_decl, arguments);
+ }
/* If the previous call was static and this one is too,
build a compound expression to hold the two (because in
@@ -10094,7 +10247,7 @@ patch_method_invocation (tree patch, tree primary, tree where, int from_super,
tree this_arg = NULL_TREE;
int is_array_clone_call = 0;
- /* Should be overriden if everything goes well. Otherwise, if
+ /* Should be overridden if everything goes well. Otherwise, if
something fails, it should keep this value. It stop the
evaluation of a bogus assignment. See java_complete_tree,
MODIFY_EXPR: for the reasons why we sometimes want to keep on
@@ -11051,10 +11204,15 @@ find_most_specific_methods_list (tree list)
/* If we have several and they're all abstract, just pick the
closest one. */
- if (candidates > 0 && (candidates == abstract))
+ if (candidates > 0 && candidates == abstract)
{
+ /* FIXME: merge the throws clauses. There is no convenient way
+ to do this in gcj right now, since ideally we'd like to
+ introduce a new METHOD_DECL here, but that is really not
+ possible. */
new_list = nreverse (new_list);
TREE_CHAIN (new_list) = NULL_TREE;
+ return new_list;
}
/* We have several (we couldn't find a most specific), all but one
@@ -11541,6 +11699,8 @@ java_complete_lhs (tree node)
&& TREE_CODE (wfl_op2) != DEFAULT_EXPR)
unreachable_stmt_error (*ptr);
}
+ if (TREE_TYPE (*ptr) == NULL_TREE)
+ TREE_TYPE (*ptr) = void_type_node;
ptr = next;
}
*ptr = java_complete_tree (*ptr);
@@ -11897,13 +12057,20 @@ java_complete_lhs (tree node)
int in_this = CALL_THIS_CONSTRUCTOR_P (node);
int from_super = (EXPR_WFL_NODE (TREE_OPERAND (node, 0)) ==
super_identifier_node);
+ tree arguments;
node = patch_method_invocation (node, NULL_TREE, NULL_TREE,
from_super, 0, &decl);
if (node == error_mark_node)
return error_mark_node;
- check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl);
+ if (TREE_CODE (node) == CALL_EXPR
+ && TREE_OPERAND (node, 1) != NULL_TREE)
+ arguments = TREE_VALUE (TREE_OPERAND (node, 1));
+ else
+ arguments = NULL_TREE;
+ check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl,
+ arguments);
/* If we call this(...), register signature and positions */
if (in_this)
DECL_CONSTRUCTOR_CALLS (current_function_decl) =
@@ -12764,6 +12931,7 @@ patch_assignment (tree node, tree wfl_op1)
tree block = build (BLOCK, TREE_TYPE (new_rhs), NULL);
tree assignment
= build (MODIFY_EXPR, TREE_TYPE (new_rhs), tmp, fold (new_rhs));
+ DECL_CONTEXT (tmp) = current_function_decl;
BLOCK_VARS (block) = tmp;
BLOCK_EXPR_BODY (block)
= build (COMPOUND_EXPR, TREE_TYPE (new_rhs), assignment, tmp);
@@ -15621,22 +15789,28 @@ patch_throw_statement (tree node, tree wfl_op1)
}
/* Check that exception said to be thrown by method DECL can be
- effectively caught from where DECL is invoked. */
-
+ effectively caught from where DECL is invoked. THIS_EXPR is the
+ expression that computes `this' for the method call. */
static void
-check_thrown_exceptions (int location, tree decl)
+check_thrown_exceptions (int location, tree decl, tree this_expr)
{
tree throws;
- /* For all the unchecked exceptions thrown by DECL */
+ int is_array_call = 0;
+
+ if (this_expr != NULL_TREE
+ && TREE_CODE (TREE_TYPE (this_expr)) == POINTER_TYPE
+ && TYPE_ARRAY_P (TREE_TYPE (TREE_TYPE (this_expr))))
+ is_array_call = 1;
+
+ /* For all the unchecked exceptions thrown by DECL. */
for (throws = DECL_FUNCTION_THROWS (decl); throws;
throws = TREE_CHAIN (throws))
if (!check_thrown_exceptions_do (TREE_VALUE (throws)))
{
-#if 1
- /* Temporary hack to suppresses errors about cloning arrays. FIXME */
- if (DECL_NAME (decl) == get_identifier ("clone"))
+ /* Suppress errors about cloning arrays. */
+ if (is_array_call && DECL_NAME (decl) == get_identifier ("clone"))
continue;
-#endif
+
EXPR_WFL_LINECOL (wfl_operator) = location;
if (DECL_FINIT_P (current_function_decl))
parse_error_context
@@ -16090,6 +16264,8 @@ emit_test_initialization (void **entry_p, void *info)
LOCAL_CLASS_INITIALIZATION_FLAG (decl) = 1;
DECL_CONTEXT (decl) = current_function_decl;
DECL_INITIAL (decl) = boolean_true_node;
+ /* Don't emit any symbolic debugging info for this decl. */
+ DECL_IGNORED_P (decl) = 1;
/* The trick is to find the right context for it. */
block = BLOCK_SUBBLOCKS (GET_CURRENT_BLOCK (current_function_decl));
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 468de74cbb6..972cb8b3686 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -42,7 +42,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
static tree convert_ieee_real_to_integer (tree, tree);
static tree parse_signature_type (const unsigned char **,
const unsigned char *);
-static tree lookup_do (tree, tree, tree, tree, tree (*)(tree));
+static tree lookup_do (tree, int, tree, tree, tree (*)(tree));
static tree build_null_signature (tree);
tree * type_map;
@@ -687,124 +687,142 @@ set_java_signature (tree type, tree sig)
#endif
}
-/* Search in class SEARCHED_CLASS (and its superclasses) for a method
- matching METHOD_NAME and signature SIGNATURE. If SEARCHED_INTERFACE is
- not NULL_TREE then first search its superinterfaces for a similar match.
- Return the matched method DECL or NULL_TREE. SIGNATURE_BUILDER is
- used on method candidates to build their (sometimes partial)
- signature. */
-
+/* Search in SEARCHED_CLASS and its superclasses for a method matching
+ METHOD_NAME and signature METHOD_SIGNATURE. This function will
+ only search for methods declared in the class hierarchy; interfaces
+ will not be considered. Returns NULL_TREE if the method is not
+ found. */
tree
-lookup_argument_method (tree searched_class, tree method_name, tree method_signature)
+lookup_argument_method (tree searched_class, tree method_name,
+ tree method_signature)
{
- return lookup_do (searched_class, NULL_TREE, method_name, method_signature,
+ return lookup_do (searched_class, 0,
+ method_name, method_signature,
build_java_argument_signature);
}
-/* Search in class SEARCHED_CLASS (and its superclasses and
- implemented interfaces) for a method matching METHOD_NAME and
- argument signature METHOD_SIGNATURE. Return a FUNCTION_DECL on
- success, or NULL_TREE if none found. (Contrast lookup_java_method,
- which takes into account return type.) */
-
+/* Like lookup_argument_method, but lets the caller set any flags
+ desired. */
tree
-lookup_argument_method2 (tree searched_class, tree method_name, tree method_signature)
+lookup_argument_method_generic (tree searched_class, tree method_name,
+ tree method_signature, int flags)
{
- return lookup_do (CLASSTYPE_SUPER (searched_class), searched_class,
+ return lookup_do (searched_class, flags,
method_name, method_signature,
build_java_argument_signature);
}
+
/* Search in class SEARCHED_CLASS (and its superclasses) for a method
matching METHOD_NAME and signature METHOD_SIGNATURE. Return a
FUNCTION_DECL on success, or NULL_TREE if none found. (Contrast
- lookup_argument_method, which ignores return type.) If
+ lookup_argument_method, which ignores return type.) If
SEARCHED_CLASS is an interface, search it too. */
-
tree
-lookup_java_method (tree searched_class, tree method_name, tree method_signature)
+lookup_java_method (tree searched_class, tree method_name,
+ tree method_signature)
{
- tree searched_interface;
-
- /* If this class is an interface class, search its superinterfaces
- * first. A superinterface is not an interface's superclass: a super
- * interface is implemented by the interface. */
-
- searched_interface = (CLASS_INTERFACE (TYPE_NAME (searched_class)) ?
- searched_class : NULL_TREE);
- return lookup_do (searched_class, searched_interface, method_name,
+ return lookup_do (searched_class, SEARCH_INTERFACE, method_name,
method_signature, build_java_signature);
}
-/* Return true iff CLASS (or its ancestors) has a method METHOD_NAME. */
-
+/* Return true iff CLASS (or its ancestors) has a method METHOD_NAME.  */
int
has_method (tree class, tree method_name)
{
- return lookup_do (class, class, method_name,
- NULL_TREE, build_null_signature) != NULL_TREE;
+ return lookup_do (class, SEARCH_INTERFACE,
+ method_name, NULL_TREE,
+ build_null_signature) != NULL_TREE;
}
/* Search in class SEARCHED_CLASS (and its superclasses) for a method
- matching METHOD_NAME and signature SIGNATURE. Also search in
- SEARCHED_INTERFACE (and its superinterfaces) for a similar match.
+ matching METHOD_NAME and signature SIGNATURE. FLAGS control some
+ parameters of the search.
+
+ SEARCH_INTERFACE means also search interfaces and superinterfaces
+ of SEARCHED_CLASS.
+
+ SEARCH_SUPER means skip SEARCHED_CLASS and start with its
+ superclass.
+
+ SEARCH_ONLY_INTERFACE means don't search ordinary classes, but
+ instead only search interfaces and superinterfaces.
+
+ SEARCH_VISIBLE means skip methods for which METHOD_INVISIBLE is
+ set.
+
Return the matched method DECL or NULL_TREE. SIGNATURE_BUILDER is
used on method candidates to build their (sometimes partial)
signature. */
-
static tree
-lookup_do (tree searched_class, tree searched_interface, tree method_name,
+lookup_do (tree searched_class, int flags, tree method_name,
tree signature, tree (*signature_builder) (tree))
{
tree method;
-
- if (searched_interface)
- {
- int i;
- int interface_len =
- TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (searched_interface)) - 1;
-
- for (i = interface_len; i > 0; i--)
- {
- tree child =
- TREE_VEC_ELT (TYPE_BINFO_BASETYPES (searched_interface), i);
- tree iclass = BINFO_TYPE (child);
-
- /* If the superinterface hasn't been loaded yet, do so now. */
- if (CLASS_FROM_SOURCE_P (iclass))
- safe_layout_class (iclass);
- else if (!CLASS_LOADED_P (iclass))
- load_class (iclass, 1);
-
- for (method = TYPE_METHODS (iclass);
- method != NULL_TREE; method = TREE_CHAIN (method))
- {
- tree method_sig = (*signature_builder) (TREE_TYPE (method));
-
- if (DECL_NAME (method) == method_name && method_sig == signature)
- return method;
- }
-
- /* it could be defined in a supersuperinterface */
- if (CLASS_INTERFACE (TYPE_NAME (iclass)))
- {
- method = lookup_do (iclass, iclass, method_name,
- signature, signature_builder);
- if (method != NULL_TREE)
- return method;
- }
- }
- }
+ int first_time = 1;
+
+ /* If the incoming class is an interface, then we will only return
+ a method declared in an interface context. */
+ if (searched_class != NULL_TREE
+ && CLASS_INTERFACE (TYPE_NAME (searched_class)))
+ flags |= SEARCH_ONLY_INTERFACE;
while (searched_class != NULL_TREE)
{
- for (method = TYPE_METHODS (searched_class);
- method != NULL_TREE; method = TREE_CHAIN (method))
- {
- tree method_sig = (*signature_builder) (TREE_TYPE (method));
- if (DECL_NAME (method) == method_name && method_sig == signature)
- return method;
- }
+ /* First search this class. If we're only searching the
+ superclass, skip this. */
+ if (! ((flags & SEARCH_SUPER) && first_time))
+ {
+ for (method = TYPE_METHODS (searched_class);
+ method != NULL_TREE; method = TREE_CHAIN (method))
+ {
+ tree method_sig = (*signature_builder) (TREE_TYPE (method));
+ if (DECL_NAME (method) == method_name && method_sig == signature)
+ {
+ /* If the caller requires a visible method, then we
+ skip invisible methods here. */
+ if (! (flags & SEARCH_VISIBLE)
+ || ! METHOD_INVISIBLE (method))
+ return method;
+ }
+ }
+ }
+ first_time = 0;
+
+ /* Search interfaces, if required. */
+ if ((flags & SEARCH_INTERFACE))
+ {
+ int i;
+ int interface_len =
+ TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (searched_class)) - 1;
+
+ for (i = interface_len; i > 0; i--)
+ {
+ tree child =
+ TREE_VEC_ELT (TYPE_BINFO_BASETYPES (searched_class), i);
+ tree iclass = BINFO_TYPE (child);
+
+ /* If the superinterface hasn't been loaded yet, do so now. */
+ if (CLASS_FROM_SOURCE_P (iclass))
+ safe_layout_class (iclass);
+ else if (!CLASS_LOADED_P (iclass))
+ load_class (iclass, 1);
+
+ /* Note that we don't care about SEARCH_VISIBLE here,
+ since an interface can never have an invisible
+ method. */
+ method = lookup_do (iclass, SEARCH_INTERFACE,
+ method_name, signature, signature_builder);
+ if (method != NULL_TREE)
+ return method;
+ }
+ }
+
+ /* If we're only searching for interface methods, then we've
+ already searched all the superinterfaces. Our superclass is
+ Object, but we don't want to search that. */
+ if ((flags & SEARCH_ONLY_INTERFACE))
+ break;
searched_class = CLASSTYPE_SUPER (searched_class);
}
diff --git a/gcc/java/win32-host.c b/gcc/java/win32-host.c
index c1a9ec1d18a..b80da0786a0 100644
--- a/gcc/java/win32-host.c
+++ b/gcc/java/win32-host.c
@@ -29,8 +29,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
-#include "jcf.h"
-
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
diff --git a/gcc/jump.c b/gcc/jump.c
index 2c98ad61312..d2b53f8cf4b 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -386,7 +386,7 @@ duplicate_loop_exit_test (rtx loop_start)
/* We can do the replacement. Allocate reg_map if this is the
first replacement we found. */
if (reg_map == 0)
- reg_map = (rtx *) xcalloc (max_reg, sizeof (rtx));
+ reg_map = xcalloc (max_reg, sizeof (rtx));
REG_LOOP_TEST_P (reg) = 1;
@@ -2345,7 +2345,7 @@ rtx_renumbered_equal_p (rtx x, rtx y)
case 'u':
if (XEXP (x, i) != XEXP (y, i))
return 0;
- /* fall through. */
+ /* Fall through. */
case '0':
break;
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 12da91c5c45..f8ecc8bdcb7 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -46,7 +46,9 @@ extern void lhd_do_nothing_f (struct function *);
extern bool lhd_post_options (const char **);
extern HOST_WIDE_INT lhd_get_alias_set (tree);
extern tree lhd_return_tree (tree);
+extern tree lhd_return_null_tree_v (void);
extern tree lhd_return_null_tree (tree);
+extern tree lhd_do_nothing_iii_return_null_tree (int, int, int);
extern int lhd_safe_from_p (rtx, tree);
extern int lhd_staticp (tree);
extern int lhd_unsafe_for_reeval (tree);
@@ -61,8 +63,10 @@ extern bool lhd_can_use_bit_fields_p (void);
extern bool lhd_warn_unused_global_decl (tree);
extern void lhd_incomplete_type_error (tree, tree);
extern tree lhd_type_promotes_to (tree);
+extern void lhd_register_builtin_type (tree, const char *);
extern bool lhd_decl_ok_for_sibcall (tree);
extern tree lhd_expr_size (tree);
+extern bool lhd_decl_uninit (tree);
extern size_t lhd_tree_size (enum tree_code);
/* Declarations of default tree inlining hooks. */
@@ -79,8 +83,9 @@ 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 void lhd_initialize_diagnostics (struct diagnostic_context *);
+extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
-extern void write_global_declarations (void);
#define LANG_HOOKS_NAME "GNU unknown"
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
@@ -89,8 +94,8 @@ extern void write_global_declarations (void);
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack
#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
+#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS lhd_initialize_diagnostics
#define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0
-#define LANG_HOOKS_HANDLE_FILENAME hook_void_constcharptr
#define LANG_HOOKS_MISSING_ARGUMENT hook_bool_constcharptr_size_t_false
#define LANG_HOOKS_POST_OPTIONS lhd_post_options
#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
@@ -100,7 +105,6 @@ extern void write_global_declarations (void);
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
#define LANG_HOOKS_UNSAFE_FOR_REEVAL lhd_unsafe_for_reeval
#define LANG_HOOKS_STATICP lhd_staticp
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES lhd_do_nothing_t
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
#define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
#define LANG_HOOKS_MAYBE_BUILD_CLEANUP lhd_return_null_tree
@@ -116,6 +120,7 @@ extern void write_global_declarations (void);
#define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function
#define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name
#define LANG_HOOKS_EXPR_SIZE lhd_expr_size
+#define LANG_HOOKS_DECL_UNINIT lhd_decl_uninit
#define LANG_HOOKS_TREE_SIZE lhd_tree_size
#define LANG_HOOKS_FUNCTION_INIT lhd_do_nothing_f
@@ -123,6 +128,10 @@ extern void write_global_declarations (void);
#define LANG_HOOKS_FUNCTION_ENTER_NESTED lhd_do_nothing_f
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED lhd_do_nothing_f
+#define LANG_HOOKS_RTL_EXPAND_START lhd_do_nothing
+#define LANG_HOOKS_RTL_EXPAND_STMT (void (*) (tree)) abort
+#define LANG_HOOKS_RTL_EXPAND_END lhd_do_nothing
+
/* Attribute hooks. */
#define LANG_HOOKS_ATTRIBUTE_TABLE NULL
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE NULL
@@ -169,15 +178,15 @@ extern void write_global_declarations (void);
LANG_HOOKS_TREE_INLINING_END_INLINING, \
LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING, \
LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS \
-} \
+}
-#define LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION NULL
+#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR lhd_callgraph_analyze_expr
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION NULL
#define LANG_HOOKS_CALLGRAPH_INITIALIZER { \
- LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION, \
+ LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR, \
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, \
-} \
+}
#define LANG_HOOKS_FUNCTION_INITIALIZER { \
LANG_HOOKS_FUNCTION_INIT, \
@@ -186,6 +195,12 @@ extern void write_global_declarations (void);
LANG_HOOKS_FUNCTION_LEAVE_NESTED \
}
+#define LANG_HOOKS_RTL_EXPAND_INITIALIZER { \
+ LANG_HOOKS_RTL_EXPAND_START, \
+ LANG_HOOKS_RTL_EXPAND_STMT, \
+ LANG_HOOKS_RTL_EXPAND_END \
+}
+
/* Tree dump hooks. */
extern bool lhd_tree_dump_dump_tree (void *, tree);
extern int lhd_tree_dump_type_quals (tree);
@@ -203,6 +218,7 @@ extern int lhd_tree_dump_type_quals (tree);
#define LANG_HOOKS_MAKE_TYPE make_node
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error
#define LANG_HOOKS_TYPE_PROMOTES_TO lhd_type_promotes_to
+#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lhd_register_builtin_type
#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
LANG_HOOKS_MAKE_TYPE, \
@@ -212,6 +228,7 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_SIGNED_TYPE, \
LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, \
LANG_HOOKS_TYPE_PROMOTES_TO, \
+ LANG_HOOKS_REGISTER_BUILTIN_TYPE, \
LANG_HOOKS_INCOMPLETE_TYPE_ERROR \
}
@@ -223,6 +240,7 @@ extern int lhd_tree_dump_type_quals (tree);
#define LANG_HOOKS_SET_BLOCK set_block
#define LANG_HOOKS_PUSHDECL pushdecl
#define LANG_HOOKS_GETDECLS getdecls
+#define LANG_HOOKS_BUILTIN_TYPE_DECLS lhd_return_null_tree_v
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl
#define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE NULL
@@ -236,6 +254,7 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_SET_BLOCK, \
LANG_HOOKS_PUSHDECL, \
LANG_HOOKS_GETDECLS, \
+ LANG_HOOKS_BUILTIN_TYPE_DECLS, \
LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, \
LANG_HOOKS_WRITE_GLOBALS, \
LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE, \
@@ -248,8 +267,8 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_IDENTIFIER_SIZE, \
LANG_HOOKS_TREE_SIZE, \
LANG_HOOKS_INIT_OPTIONS, \
+ LANG_HOOKS_INITIALIZE_DIAGNOSTICS, \
LANG_HOOKS_HANDLE_OPTION, \
- LANG_HOOKS_HANDLE_FILENAME, \
LANG_HOOKS_MISSING_ARGUMENT, \
LANG_HOOKS_POST_OPTIONS, \
LANG_HOOKS_INIT, \
@@ -260,7 +279,6 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_EXPAND_CONSTANT, \
LANG_HOOKS_EXPAND_EXPR, \
LANG_HOOKS_TRUTHVALUE_CONVERSION, \
- LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES, \
LANG_HOOKS_SAFE_FROM_P, \
LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
LANG_HOOKS_UNSAFE_FOR_REEVAL, \
@@ -281,6 +299,7 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_DECL_PRINTABLE_NAME, \
LANG_HOOKS_PRINT_ERROR_FUNCTION, \
LANG_HOOKS_EXPR_SIZE, \
+ LANG_HOOKS_DECL_UNINIT, \
LANG_HOOKS_ATTRIBUTE_TABLE, \
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
@@ -289,7 +308,8 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_CALLGRAPH_INITIALIZER, \
LANG_HOOKS_TREE_DUMP_INITIALIZER, \
LANG_HOOKS_DECLS, \
- LANG_HOOKS_FOR_TYPES_INITIALIZER \
+ LANG_HOOKS_FOR_TYPES_INITIALIZER, \
+ LANG_HOOKS_RTL_EXPAND_INITIALIZER \
}
#endif /* GCC_LANG_HOOKS_DEF_H */
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 6b0c5bdba08..a1d60f9ff5e 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -32,6 +32,8 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "langhooks.h"
#include "langhooks-def.h"
+#include "ggc.h"
+#include "diagnostic.h"
/* Do nothing; in many cases the default hook. */
@@ -54,6 +56,16 @@ lhd_do_nothing_i (int i ATTRIBUTE_UNUSED)
{
}
+/* Do nothing (int, int, int). Return NULL_TREE. */
+
+tree
+lhd_do_nothing_iii_return_null_tree (int i ATTRIBUTE_UNUSED,
+ int j ATTRIBUTE_UNUSED,
+ int k ATTRIBUTE_UNUSED)
+{
+ return NULL_TREE;
+}
+
/* Do nothing (function). */
void
@@ -72,6 +84,14 @@ lhd_return_tree (tree t)
/* Do nothing (return NULL_TREE). */
tree
+lhd_return_null_tree_v (void)
+{
+ return NULL_TREE;
+}
+
+/* Do nothing (return NULL_TREE). */
+
+tree
lhd_return_null_tree (tree t ATTRIBUTE_UNUSED)
{
return NULL_TREE;
@@ -136,6 +156,11 @@ lhd_warn_unused_global_decl (tree decl)
return true;
}
+/* Number for making the label on the next
+ static variable internal to a function. */
+
+static GTY(()) int var_labelno;
+
/* Set the DECL_ASSEMBLER_NAME for DECL. */
void
lhd_set_decl_assembler_name (tree decl)
@@ -149,12 +174,28 @@ lhd_set_decl_assembler_name (tree decl)
&& (TREE_STATIC (decl)
|| DECL_EXTERNAL (decl)
|| TREE_PUBLIC (decl))))
- /* By default, assume the name to use in assembly code is the
- same as that used in the source language. (That's correct
- for C, and GCC used to set DECL_ASSEMBLER_NAME to the same
- value as DECL_NAME in build_decl, so this choice provides
- backwards compatibility with existing front-ends. */
- SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
+ {
+ /* By default, assume the name to use in assembly code is the
+ same as that used in the source language. (That's correct
+ for C, and GCC used to set DECL_ASSEMBLER_NAME to the same
+ value as DECL_NAME in build_decl, so this choice provides
+ backwards compatibility with existing front-ends.
+
+ Can't use just the variable's own name for a variable whose
+ scope is less than the whole compilation. Concatenate a
+ distinguishing number. */
+ if (!TREE_PUBLIC (decl) && DECL_CONTEXT (decl))
+ {
+ const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
+ char *label;
+
+ ASM_FORMAT_PRIVATE_NAME (label, name, var_labelno);
+ var_labelno++;
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
+ }
+ else
+ SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
+ }
else
/* Nobody should ever be asking for the DECL_ASSEMBLER_NAME of
these DECLs -- unless they're in language-dependent code, in
@@ -185,6 +226,13 @@ lhd_type_promotes_to (tree type ATTRIBUTE_UNUSED)
abort ();
}
+/* Registration of machine- or os-specific builtin types. */
+void
+lhd_register_builtin_type (tree type ATTRIBUTE_UNUSED,
+ const char* name ATTRIBUTE_UNUSED)
+{
+}
+
/* Invalid use of an incomplete type. */
void
lhd_incomplete_type_error (tree value ATTRIBUTE_UNUSED, tree type)
@@ -408,6 +456,14 @@ lhd_expr_size (tree exp)
else
return size_in_bytes (TREE_TYPE (exp));
}
+/* lang_hooks.decl_uninit: Find out if a variable is uninitialized based
+ on DECL_INITIAL. */
+
+bool
+lhd_decl_uninit (tree t ATTRIBUTE_UNUSED)
+{
+ return false;
+}
/* lang_hooks.tree_size: Determine the size of a tree with code C,
which is a language-specific tree code in category 'x'. The
@@ -439,7 +495,7 @@ write_global_declarations (void)
tree globals = (*lang_hooks.decls.getdecls) ();
int len = list_length (globals);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ tree *vec = xmalloc (sizeof (tree) * len);
int i;
tree decl;
@@ -456,3 +512,53 @@ write_global_declarations (void)
/* Clean up. */
free (vec);
}
+
+/* Called to perform language-specific initialization of CTX. */
+void
+lhd_initialize_diagnostics (struct diagnostic_context *ctx ATTRIBUTE_UNUSED)
+{
+}
+
+/* The default function to print out name of current function that caused
+ an error. */
+void
+lhd_print_error_function (diagnostic_context *context, const char *file)
+{
+ if (diagnostic_last_function_changed (context))
+ {
+ const char *old_prefix = context->printer->prefix;
+ char *new_prefix = file ? file_name_as_prefix (file) : NULL;
+
+ pp_set_prefix (context->printer, new_prefix);
+
+ if (current_function_decl == NULL)
+ pp_printf (context->printer, "At top level:");
+ else
+ {
+ if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
+ pp_printf
+ (context->printer, "In member function `%s':",
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2));
+ else
+ pp_printf
+ (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);
+ context->printer->prefix = old_prefix;
+ free ((char*) new_prefix);
+ }
+}
+
+tree
+lhd_callgraph_analyze_expr (tree *tp ATTRIBUTE_UNUSED,
+ int *walk_subtrees ATTRIBUTE_UNUSED,
+ tree decl ATTRIBUTE_UNUSED)
+{
+ return NULL;
+}
+
+#include "gt-langhooks.h"
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 0ab10e05cbc..4887f6dcd44 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -33,36 +33,32 @@ typedef void (*lang_print_tree_hook) (FILE *, tree, int indent);
struct lang_hooks_for_tree_inlining
{
- union tree_node *(*walk_subtrees) (union tree_node **, int *,
- union tree_node *(*)
- (union tree_node **, int *, void *),
- void *, void *);
- int (*cannot_inline_tree_fn) (union tree_node **);
- int (*disregard_inline_limits) (union tree_node *);
- union tree_node *(*add_pending_fn_decls) (void *, union tree_node *);
- int (*tree_chain_matters_p) (union tree_node *);
- int (*auto_var_in_fn_p) (union tree_node *, union tree_node *);
- union tree_node *(*copy_res_decl_for_inlining) (union tree_node *,
- union tree_node *,
- union tree_node *,
- void *, int *, tree);
- int (*anon_aggr_type_p) (union tree_node *);
- bool (*var_mod_type_p) (union tree_node *);
- int (*start_inlining) (union tree_node *);
- void (*end_inlining) (union tree_node *);
- union tree_node *(*convert_parm_for_inlining) (union tree_node *,
- union tree_node *,
- union tree_node *);
- int (*estimate_num_insns) (union tree_node *);
+ tree (*walk_subtrees) (tree *, int *,
+ tree (*) (tree *, int *, void *),
+ void *, void *);
+ int (*cannot_inline_tree_fn) (tree *);
+ int (*disregard_inline_limits) (tree);
+ tree (*add_pending_fn_decls) (void *, tree);
+ int (*tree_chain_matters_p) (tree);
+ int (*auto_var_in_fn_p) (tree, tree);
+ tree (*copy_res_decl_for_inlining) (tree, tree, tree,
+ void *, int *, tree);
+ int (*anon_aggr_type_p) (tree);
+ bool (*var_mod_type_p) (tree);
+ int (*start_inlining) (tree);
+ void (*end_inlining) (tree);
+ tree (*convert_parm_for_inlining) (tree, tree, tree);
+ int (*estimate_num_insns) (tree);
};
struct lang_hooks_for_callgraph
{
- /* Function passed as argument is needed and will be compiled.
- Lower the representation so the calls are explicit. */
- void (*lower_function) (union tree_node *);
+ /* The node passed is a language-specific tree node. If its contents
+ are relevant to use of other declarations, mark them. */
+ tree (*analyze_expr) (tree *, int *, tree);
+
/* Produce RTL for function passed as argument. */
- void (*expand_function) (union tree_node *);
+ void (*expand_function) (tree);
};
/* Lang hooks for management of language-specific data or status
@@ -82,6 +78,19 @@ struct lang_hooks_for_functions
void (*leave_nested) (struct function *);
};
+/* Lang hooks for rtl code generation. */
+struct lang_hooks_for_rtl_expansion
+{
+ /* Called after expand_function_start, but before expanding the body. */
+ void (*start) (void);
+
+ /* Called to expand each statement. */
+ void (*stmt) (tree);
+
+ /* Called after expanding the body but before expand_function_end. */
+ void (*end) (void);
+};
+
/* The following hooks are used by tree-dump.c. */
struct lang_hooks_for_tree_dump
@@ -128,6 +137,15 @@ struct lang_hooks_for_types
arguments. The default hook aborts. */
tree (*type_promotes_to) (tree);
+ /* Register TYPE as a builtin type with the indicated NAME. The
+ TYPE is placed in the outermost lexical scope. The semantics
+ should be analogous to:
+
+ typedef TYPE NAME;
+
+ in C. The default hook ignores the declaration. */
+ void (*register_builtin_type) (tree, const char *);
+
/* This routine is called in tree.c to print an error message for
invalid use of an incomplete type. VALUE is the expression that
was used (or 0 if that isn't known) and TYPE is the type that was
@@ -171,6 +189,9 @@ struct lang_hooks_for_decls
/* Returns the chain of decls so far in the current scope level. */
tree (*getdecls) (void);
+ /* Returns a chain of TYPE_DECLs for built-in types. */
+ tree (*builtin_type_decls) (void);
+
/* Returns true when we should warn for an unused global DECL.
We will already have checked that it has static binding. */
bool (*warn_unused_global) (tree);
@@ -207,6 +228,10 @@ struct lang_hooks
the language mask to filter the switch array with. */
unsigned int (*init_options) (unsigned int argc, const char **argv);
+ /* Callback used to perform language-specific initialization for the
+ global diagnostic context structure. */
+ void (*initialize_diagnostics) (struct diagnostic_context *);
+
/* Handle the switch CODE, which has real type enum opt_code from
options.h. If the switch takes an argument, it is passed in ARG
which points to permanent storage. The handler is responsible for
@@ -218,9 +243,6 @@ struct lang_hooks
valid and should not be treated as language-independent too. */
int (*handle_option) (size_t code, const char *arg, int value);
- /* Handle a filename on the command line. */
- void (*handle_filename) (const char *filename);
-
/* Return false to use the default complaint about a missing
argument, otherwise output a complaint and return true. */
bool (*missing_argument) (const char *opt, size_t code);
@@ -276,10 +298,6 @@ struct lang_hooks
error_mark_node). */
tree (*truthvalue_conversion) (tree);
- /* Possibly apply default attributes to a function (represented by
- a FUNCTION_DECL). */
- void (*insert_default_attributes) (tree);
-
/* Hook called by safe_from_p for language-specific tree codes. It is
up to the language front-end to install a hook if it has any such
codes that safe_from_p needs to know about. Since same_from_p will
@@ -369,6 +387,10 @@ struct lang_hooks
semantics in cases that it doesn't want to handle specially. */
tree (*expr_size) (tree);
+ /* Called from uninitialized_vars_warning to find out if a variable is
+ uninitialized based on DECL_INITIAL. */
+ bool (*decl_uninit) (tree);
+
/* Pointers to machine-independent attribute tables, for front ends
using attribs.c. If one is NULL, it is ignored. Respectively, a
table of attributes specific to the language, a table of
@@ -391,6 +413,8 @@ struct lang_hooks
struct lang_hooks_for_types types;
+ struct lang_hooks_for_rtl_expansion rtl_expand;
+
/* Whenever you add entries here, make sure you adjust langhooks-def.h
and langhooks.c accordingly. */
};
diff --git a/gcc/lcm.c b/gcc/lcm.c
index 87e013300c3..0e47507752d 100644
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -106,8 +106,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution, so make an optimistic initialization of
ANTIN. */
@@ -259,7 +258,7 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
/* Initialize a mapping from each edge to its index. */
for (i = 0; i < num_edges; i++)
@@ -480,8 +479,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution. */
sbitmap_vector_ones (avout, last_basic_block);
@@ -608,8 +606,7 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- tos = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
/* Initialize NEARER for each edge and build a mapping from an edge to
its index. */
@@ -717,8 +714,8 @@ pre_edge_rev_lcm (FILE *file ATTRIBUTE_UNUSED, int n_exprs, sbitmap *transp,
edge_list = create_edge_list ();
num_edges = NUM_EDGES (edge_list);
- st_antin = (sbitmap *) sbitmap_vector_alloc (last_basic_block, n_exprs);
- st_antout = (sbitmap *) sbitmap_vector_alloc (last_basic_block, n_exprs);
+ st_antin = sbitmap_vector_alloc (last_basic_block, n_exprs);
+ st_antout = sbitmap_vector_alloc (last_basic_block, n_exprs);
sbitmap_vector_zero (st_antin, last_basic_block);
sbitmap_vector_zero (st_antout, last_basic_block);
compute_antinout_edge (st_antloc, transp, st_antin, st_antout);
@@ -997,8 +994,7 @@ optimize_mode_switching (FILE *file)
entry_exit_extra = 2;
#endif
bb_info[n_entities]
- = (struct bb_info *) xcalloc (last_basic_block + entry_exit_extra,
- sizeof **bb_info);
+ = xcalloc (last_basic_block + entry_exit_extra, sizeof **bb_info);
entity_map[n_entities++] = e;
if (num_modes[e] > max_num_modes)
max_num_modes = num_modes[e];
diff --git a/gcc/libgcc-std.ver b/gcc/libgcc-std.ver
index eb477af0585..1caebc54cfa 100644
--- a/gcc/libgcc-std.ver
+++ b/gcc/libgcc-std.ver
@@ -185,7 +185,17 @@ GCC_3.3 {
_Unwind_SjLj_Resume_or_Rethrow
}
-%inherit GCC_3.4 GCC_3.3
+%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.2
GCC_3.4 {
# bit scanning and counting built-ins
__clzsi2
diff --git a/gcc/libgcov.c b/gcc/libgcov.c
index 826617f14b4..85068061283 100644
--- a/gcc/libgcov.c
+++ b/gcc/libgcov.c
@@ -94,13 +94,16 @@ static gcov_unsigned_t gcov_crc32;
static int
gcov_version (struct gcov_info *ptr, gcov_unsigned_t version)
{
- gcov_unsigned_t expected = GCOV_VERSION;
-
if (version != GCOV_VERSION)
{
+ char v[4], e[4];
+
+ GCOV_UNSIGNED2STRING (v, version);
+ GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
+
fprintf (stderr,
"profiling:%s:Version mismatch - expected %.4s got %.4s\n",
- ptr->filename, (const char *)&expected, (const char *)&version);
+ ptr->filename, e, v);
return 0;
}
return 1;
@@ -119,32 +122,32 @@ gcov_exit (void)
struct gcov_info *gi_ptr;
struct gcov_summary this_program;
struct gcov_summary all;
+ struct gcov_ctr_summary *cs_ptr;
+ const struct gcov_ctr_info *ci_ptr;
+ unsigned t_ix;
+ gcov_unsigned_t c_num;
memset (&all, 0, sizeof (all));
/* Find the totals for this execution. */
memset (&this_program, 0, sizeof (this_program));
for (gi_ptr = gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
{
- const struct gcov_ctr_info *ci_ptr;
- struct gcov_ctr_summary *cs_ptr;
- unsigned t_ix;
-
- for (t_ix = 0, ci_ptr = gi_ptr->counts, cs_ptr = this_program.ctrs;
- t_ix != GCOV_COUNTERS_SUMMABLE; t_ix++, cs_ptr++)
- if ((1 << t_ix) & gi_ptr->ctr_mask)
- {
- const gcov_type *c_ptr;
- gcov_unsigned_t c_num;
-
- cs_ptr->num += ci_ptr->num;
- for (c_num = ci_ptr->num, c_ptr = ci_ptr->values; c_num--; c_ptr++)
- {
- cs_ptr->sum_all += *c_ptr;
- if (cs_ptr->run_max < *c_ptr)
- cs_ptr->run_max = *c_ptr;
- }
- ci_ptr++;
- }
+ ci_ptr = gi_ptr->counts;
+ for (t_ix = 0; t_ix < GCOV_COUNTERS_SUMMABLE; t_ix++)
+ {
+ if (!((1 << t_ix) & gi_ptr->ctr_mask))
+ continue;
+
+ cs_ptr = &this_program.ctrs[t_ix];
+ cs_ptr->num += ci_ptr->num;
+ for (c_num = 0; c_num < ci_ptr->num; c_num++)
+ {
+ cs_ptr->sum_all += ci_ptr->values[c_num];
+ if (cs_ptr->run_max < ci_ptr->values[c_num])
+ cs_ptr->run_max = ci_ptr->values[c_num];
+ }
+ ci_ptr++;
+ }
}
/* Now merge each file. */
@@ -155,9 +158,7 @@ gcov_exit (void)
gcov_type *values[GCOV_COUNTERS];
const struct gcov_fn_info *fi_ptr;
unsigned fi_stride;
- unsigned c_ix, t_ix, f_ix;
- const struct gcov_ctr_info *ci_ptr;
- struct gcov_ctr_summary *cs_ptr;
+ unsigned c_ix, f_ix, n_counts;
struct gcov_ctr_summary *cs_obj, *cs_tobj, *cs_prg, *cs_tprg, *cs_all;
int error = 0;
gcov_unsigned_t tag, length;
@@ -167,24 +168,30 @@ gcov_exit (void)
memset (&object, 0, sizeof (object));
/* Totals for this object file. */
- for (t_ix = c_ix = 0,
- ci_ptr = gi_ptr->counts, cs_ptr = this_object.ctrs;
- t_ix != GCOV_COUNTERS_SUMMABLE; t_ix++, cs_ptr++)
+ ci_ptr = gi_ptr->counts;
+ for (t_ix = 0; t_ix < GCOV_COUNTERS_SUMMABLE; t_ix++)
+ {
+ if (!((1 << t_ix) & gi_ptr->ctr_mask))
+ continue;
+
+ cs_ptr = &this_program.ctrs[t_ix];
+ cs_ptr->num += ci_ptr->num;
+ for (c_num = 0; c_num < ci_ptr->num; c_num++)
+ {
+ cs_ptr->sum_all += ci_ptr->values[c_num];
+ if (cs_ptr->run_max < ci_ptr->values[c_num])
+ cs_ptr->run_max = ci_ptr->values[c_num];
+ }
+
+ ci_ptr++;
+ }
+
+ c_ix = 0;
+ for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
if ((1 << t_ix) & gi_ptr->ctr_mask)
{
- const gcov_type *c_ptr;
- gcov_unsigned_t c_num;
-
- cs_ptr->num += ci_ptr->num;
- values[c_ix] = ci_ptr->values;
- for (c_num = ci_ptr->num, c_ptr = ci_ptr->values; c_num--; c_ptr++)
- {
- cs_ptr->sum_all += *c_ptr;
- if (cs_ptr->run_max < *c_ptr)
- cs_ptr->run_max = *c_ptr;
- }
+ values[c_ix] = gi_ptr->counts[c_ix].values;
c_ix++;
- ci_ptr++;
}
/* Calculate the function_info stride. This depends on the
@@ -228,11 +235,10 @@ gcov_exit (void)
}
/* Merge execution counts for each function. */
- for (f_ix = gi_ptr->n_functions, fi_ptr = gi_ptr->functions;
- f_ix--;
- fi_ptr = (const struct gcov_fn_info *)
- ((const char *) fi_ptr + fi_stride))
+ for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
{
+ fi_ptr = (const struct gcov_fn_info *)
+ ((const char *) gi_ptr->functions + f_ix * fi_stride);
tag = gcov_read_unsigned ();
length = gcov_read_unsigned ();
@@ -249,25 +255,31 @@ gcov_exit (void)
goto read_fatal;
}
- for (c_ix = t_ix = 0; t_ix != GCOV_COUNTERS; t_ix++)
- if ((1 << t_ix) & gi_ptr->ctr_mask)
- {
- unsigned n_counts = fi_ptr->n_ctrs[c_ix];
- gcov_merge_fn merge = gi_ptr->counts[c_ix].merge;
+ c_ix = 0;
+ for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
+ {
+ gcov_merge_fn merge;
+
+ if (!((1 << t_ix) & gi_ptr->ctr_mask))
+ continue;
+
+ n_counts = fi_ptr->n_ctrs[c_ix];
+ merge = gi_ptr->counts[c_ix].merge;
- tag = gcov_read_unsigned ();
- length = gcov_read_unsigned ();
- if (tag != GCOV_TAG_FOR_COUNTER (t_ix)
- || length != GCOV_TAG_COUNTER_LENGTH (n_counts))
- goto read_mismatch;
- (*merge) (values[c_ix], n_counts);
- values[c_ix] += n_counts;
- c_ix++;
+ tag = gcov_read_unsigned ();
+ length = gcov_read_unsigned ();
+ if (tag != GCOV_TAG_FOR_COUNTER (t_ix)
+ || length != GCOV_TAG_COUNTER_LENGTH (n_counts))
+ goto read_mismatch;
+ (*merge) (values[c_ix], n_counts);
+ values[c_ix] += n_counts;
+ c_ix++;
}
if ((error = gcov_is_error ()))
goto read_error;
}
+ f_ix = ~0u;
/* Check program & object summary */
while (1)
{
@@ -307,13 +319,14 @@ gcov_exit (void)
/* Merge the summaries. */
f_ix = ~0u;
- for (t_ix = c_ix = 0,
- cs_obj = object.ctrs, cs_tobj = this_object.ctrs,
- cs_prg = program.ctrs, cs_tprg = this_program.ctrs,
- cs_all = all.ctrs;
- t_ix != GCOV_COUNTERS_SUMMABLE;
- t_ix++, cs_obj++, cs_tobj++, cs_prg++, cs_tprg++, cs_all++)
+ for (t_ix = 0; t_ix < GCOV_COUNTERS_SUMMABLE; t_ix++)
{
+ cs_obj = &object.ctrs[t_ix];
+ cs_tobj = &this_object.ctrs[t_ix];
+ cs_prg = &program.ctrs[t_ix];
+ cs_tprg = &program.ctrs[t_ix];
+ cs_all = &all.ctrs[t_ix];
+
if ((1 << t_ix) & gi_ptr->ctr_mask)
{
if (!cs_obj->runs++)
@@ -333,9 +346,6 @@ gcov_exit (void)
if (cs_prg->run_max < cs_tprg->run_max)
cs_prg->run_max = cs_tprg->run_max;
cs_prg->sum_max += cs_tprg->run_max;
-
- values[c_ix] = gi_ptr->counts[c_ix].values;
- c_ix++;
}
else if (cs_obj->num || cs_prg->num)
goto read_mismatch;
@@ -353,6 +363,14 @@ gcov_exit (void)
}
}
+ c_ix = 0;
+ for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
+ if ((1 << t_ix) & gi_ptr->ctr_mask)
+ {
+ values[c_ix] = gi_ptr->counts[c_ix].values;
+ c_ix++;
+ }
+
program.checksum = gcov_crc32;
/* Write out the data. */
@@ -360,29 +378,35 @@ gcov_exit (void)
gcov_write_unsigned (gi_ptr->stamp);
/* Write execution counts for each function. */
- for (f_ix = gi_ptr->n_functions, fi_ptr = gi_ptr->functions; f_ix--;
- fi_ptr = (const struct gcov_fn_info *)
- ((const char *) fi_ptr + fi_stride))
+ for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
{
+ fi_ptr = (const struct gcov_fn_info *)
+ ((const char *) gi_ptr->functions + f_ix * fi_stride);
+
/* Announce function. */
gcov_write_tag_length (GCOV_TAG_FUNCTION, GCOV_TAG_FUNCTION_LENGTH);
gcov_write_unsigned (fi_ptr->ident);
gcov_write_unsigned (fi_ptr->checksum);
- for (c_ix = t_ix = 0; t_ix != GCOV_COUNTERS; t_ix++)
- if ((1 << t_ix) & gi_ptr->ctr_mask)
- {
- unsigned n_counts = fi_ptr->n_ctrs[c_ix];
- gcov_type *c_ptr;
+ c_ix = 0;
+ for (t_ix = 0; t_ix < GCOV_COUNTERS; t_ix++)
+ {
+ gcov_type *c_ptr;
+
+ if (!((1 << t_ix) & gi_ptr->ctr_mask))
+ continue;
+
+ n_counts = fi_ptr->n_ctrs[c_ix];
- gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix),
- GCOV_TAG_COUNTER_LENGTH (n_counts));
- c_ptr = values[c_ix];
- while (n_counts--)
- gcov_write_counter (*c_ptr++);
- values[c_ix] = c_ptr;
- c_ix++;
- }
+ gcov_write_tag_length (GCOV_TAG_FOR_COUNTER (t_ix),
+ GCOV_TAG_COUNTER_LENGTH (n_counts));
+ c_ptr = values[c_ix];
+ while (n_counts--)
+ gcov_write_counter (*c_ptr++);
+
+ values[c_ix] = c_ptr;
+ c_ix++;
+ }
}
/* Object file summary. */
@@ -478,10 +502,12 @@ __gcov_merge_add (gcov_type *counters, unsigned n_counters)
#endif /* L_gcov_merge_add */
#ifdef L_gcov_merge_single
-/* The profile merging function for choosing the most common value. It is given
- an array COUNTERS of N_COUNTERS old counters and it reads the same number
- of counters from the gcov file. The counters are split into 3-tuples
- where the members of the tuple have meanings:
+/* The profile merging function for choosing the most common value.
+ It is given an array COUNTERS of N_COUNTERS old counters and it
+ reads the same number of counters from the gcov file. The counters
+ are split into 3-tuples where the members of the tuple have
+ meanings:
+
-- the stored candidate on the most common value of the measured entity
-- counter
-- total number of evaluations of the value */
@@ -491,9 +517,7 @@ __gcov_merge_single (gcov_type *counters, unsigned n_counters)
unsigned i, n_measures;
gcov_type value, counter, all;
- if (n_counters % 3)
- abort ();
-
+ GCOV_CHECK (!(n_counters % 3));
n_measures = n_counters / 3;
for (i = 0; i < n_measures; i++, counters += 3)
{
@@ -516,11 +540,12 @@ __gcov_merge_single (gcov_type *counters, unsigned n_counters)
#endif /* L_gcov_merge_single */
#ifdef L_gcov_merge_delta
-/* The profile merging function for choosing the most common difference between
- two consecutive evaluations of the value. It is given an array COUNTERS of
- N_COUNTERS old counters and it reads the same number of counters from the
- gcov file. The counters are split into 4-tuples where the members of the
- tuple have meanings:
+/* The profile merging function for choosing the most common
+ difference between two consecutive evaluations of the value. It is
+ given an array COUNTERS of N_COUNTERS old counters and it reads the
+ same number of counters from the gcov file. The counters are split
+ into 4-tuples where the members of the tuple have meanings:
+
-- the last value of the measured entity
-- the stored candidate on the most common difference
-- counter
@@ -531,9 +556,7 @@ __gcov_merge_delta (gcov_type *counters, unsigned n_counters)
unsigned i, n_measures;
gcov_type last, value, counter, all;
- if (n_counters % 4)
- abort ();
-
+ GCOV_CHECK (!(n_counters % 4));
n_measures = n_counters / 4;
for (i = 0; i < n_measures; i++, counters += 4)
{
diff --git a/gcc/line-map.c b/gcc/line-map.c
index 8bbe863693b..f04350d7806 100644
--- a/gcc/line-map.c
+++ b/gcc/line-map.c
@@ -22,8 +22,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "line-map.h"
#include "intl.h"
@@ -32,7 +30,7 @@ static void trace_include (const struct line_maps *, const struct line_map *);
/* Initialize a line map set. */
void
-init_line_maps (struct line_maps *set)
+linemap_init (struct line_maps *set)
{
set->maps = 0;
set->allocated = 0;
@@ -45,7 +43,7 @@ init_line_maps (struct line_maps *set)
/* Free a line map set. */
void
-free_line_maps (struct line_maps *set)
+linemap_free (struct line_maps *set)
{
if (set->maps)
{
@@ -63,16 +61,22 @@ free_line_maps (struct line_maps *set)
}
/* Add a mapping of logical source line to physical source file and
- line number. The text pointed to by TO_FILE must have a lifetime
- at least as long as the final call to lookup_line ().
+ line number.
+
+ The text pointed to by TO_FILE must have a lifetime
+ at least as long as the final call to lookup_line (). An empty
+ TO_FILE means standard input. If reason is LC_LEAVE, and
+ TO_FILE is NULL, then TO_FILE, TO_LINE and SYSP are given their
+ natural values considering the file we are returning to.
FROM_LINE should be monotonic increasing across calls to this
- function. */
+ function. A call to this function can relocate the previous set of
+ maps, so any stored line_map pointers should not be used. */
const struct line_map *
-add_line_map (struct line_maps *set, enum lc_reason reason,
- unsigned int sysp, unsigned int from_line,
- const char *to_file, unsigned int to_line)
+linemap_add (struct line_maps *set, enum lc_reason reason,
+ unsigned int sysp, unsigned int from_line,
+ const char *to_file, unsigned int to_line)
{
struct line_map *map;
@@ -82,12 +86,14 @@ add_line_map (struct line_maps *set, enum lc_reason reason,
if (set->used == set->allocated)
{
set->allocated = 2 * set->allocated + 256;
- set->maps = (struct line_map *)
- xrealloc (set->maps, set->allocated * sizeof (struct line_map));
+ set->maps = xrealloc (set->maps, set->allocated * sizeof (struct line_map));
}
map = &set->maps[set->used++];
+ if (to_file && *to_file == '\0')
+ to_file = "<stdin>";
+
/* If we don't keep our line maps consistent, we can easily
segfault. Don't rely on the client to do it for us. */
if (set->depth == 0)
@@ -99,9 +105,15 @@ add_line_map (struct line_maps *set, enum lc_reason reason,
if (MAIN_FILE_P (map - 1))
{
- set->depth--;
- set->used--;
- return NULL;
+ if (to_file == NULL)
+ {
+ set->depth--;
+ set->used--;
+ return NULL;
+ }
+ error = true;
+ reason = LC_RENAME;
+ from = map - 1;
}
else
{
@@ -154,7 +166,7 @@ add_line_map (struct line_maps *set, enum lc_reason reason,
the list is sorted and we can use a binary search. */
const struct line_map *
-lookup_line (struct line_maps *set, unsigned int line)
+linemap_lookup (struct line_maps *set, unsigned int line)
{
unsigned int md, mn = 0, mx = set->used;
@@ -178,7 +190,8 @@ lookup_line (struct line_maps *set, unsigned int line)
the most recently listed stack is the same as the current one. */
void
-print_containing_files (struct line_maps *set, const struct line_map *map)
+linemap_print_containing_files (struct line_maps *set,
+ const struct line_map *map)
{
if (MAIN_FILE_P (map) || set->last_listed == map->included_from)
return;
diff --git a/gcc/line-map.h b/gcc/line-map.h
index 8309f080242..b53f5e06be6 100644
--- a/gcc/line-map.h
+++ b/gcc/line-map.h
@@ -30,6 +30,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
(e.g. a #line directive in C). */
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;
+
/* 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
structure in the set. INCLUDED_FROM is an index into the set that
@@ -42,7 +47,7 @@ struct line_map
{
const char *to_file;
unsigned int to_line;
- unsigned int from_line;
+ fileline from_line;
int included_from;
ENUM_BITFIELD (lc_reason) reason : CHAR_BIT;
unsigned char sysp;
@@ -68,33 +73,36 @@ struct line_maps
};
/* Initialize a line map set. */
-extern void init_line_maps (struct line_maps *);
+extern void linemap_init (struct line_maps *);
/* Free a line map set. */
-extern void free_line_maps (struct line_maps *);
+extern void linemap_free (struct line_maps *);
/* Add a mapping of logical source line to physical source file and
- line number. The text pointed to by TO_FILE must have a lifetime
- at least as long as the line maps. If reason is LC_LEAVE, and
+ line number.
+
+ The text pointed to by TO_FILE must have a lifetime
+ at least as long as the final call to lookup_line (). An empty
+ TO_FILE means standard input. If reason is LC_LEAVE, and
TO_FILE is NULL, then TO_FILE, TO_LINE and SYSP are given their
natural values considering the file we are returning to.
FROM_LINE should be monotonic increasing across calls to this
function. A call to this function can relocate the previous set of
maps, so any stored line_map pointers should not be used. */
-extern const struct line_map *add_line_map
+extern const struct line_map *linemap_add
(struct line_maps *, enum lc_reason, unsigned int sysp,
- unsigned int from_line, const char *to_file, unsigned int to_line);
+ fileline from_line, const char *to_file, unsigned int to_line);
/* Given a logical line, returns the map from which the corresponding
(source file, line) pair can be deduced. */
-extern const struct line_map *lookup_line (struct line_maps *, unsigned int);
+extern const struct line_map *linemap_lookup (struct line_maps *, fileline);
/* Print the file names and line numbers of the #include commands
which led to the map MAP, if any, to stderr. Nothing is output if
the most recently listed stack is the same as the current one. */
-extern void print_containing_files (struct line_maps *,
- const struct line_map *);
+extern void linemap_print_containing_files (struct line_maps *,
+ const struct line_map *);
/* Converts a map and logical line to source line. */
#define SOURCE_LINE(MAP, LINE) ((LINE) + (MAP)->to_line - (MAP)->from_line)
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 3f240fafd1f..c5c2506e9ca 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -356,16 +356,15 @@ local_alloc (void)
See the declarations of these variables, above,
for what they mean. */
- qty = (struct qty *) xmalloc (max_qty * sizeof (struct qty));
- qty_phys_copy_sugg
- = (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET));
- qty_phys_num_copy_sugg = (short *) xmalloc (max_qty * sizeof (short));
- qty_phys_sugg = (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET));
- qty_phys_num_sugg = (short *) xmalloc (max_qty * sizeof (short));
+ qty = xmalloc (max_qty * sizeof (struct qty));
+ qty_phys_copy_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
+ qty_phys_num_copy_sugg = xmalloc (max_qty * sizeof (short));
+ qty_phys_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
+ qty_phys_num_sugg = xmalloc (max_qty * sizeof (short));
- reg_qty = (int *) xmalloc (max_regno * sizeof (int));
- reg_offset = (char *) xmalloc (max_regno * sizeof (char));
- reg_next_in_qty = (int *) xmalloc (max_regno * sizeof (int));
+ reg_qty = xmalloc (max_regno * sizeof (int));
+ reg_offset = xmalloc (max_regno * sizeof (char));
+ reg_next_in_qty = xmalloc (max_regno * sizeof (int));
/* Determine which pseudo-registers can be allocated by local-alloc.
In general, these are the registers used only in a single block and
@@ -409,7 +408,7 @@ local_alloc (void)
else
{
#define CLEAR(vector) \
- memset ((char *) (vector), 0, (sizeof (*(vector))) * next_qty);
+ memset ((vector), 0, (sizeof (*(vector))) * next_qty);
CLEAR (qty_phys_copy_sugg);
CLEAR (qty_phys_num_copy_sugg);
@@ -798,7 +797,7 @@ update_equiv_regs (void)
regset_head cleared_regs;
int clear_regnos = 0;
- reg_equiv = (struct equivalence *) xcalloc (max_regno, sizeof *reg_equiv);
+ reg_equiv = xcalloc (max_regno, sizeof *reg_equiv);
INIT_REG_SET (&cleared_regs);
init_alias_analysis ();
@@ -1218,8 +1217,7 @@ block_alloc (int b)
/* +2 to leave room for a post_mark_life at the last insn and for
the birth of a CLOBBER in the first insn. */
- regs_live_at = (HARD_REG_SET *) xcalloc ((2 * insn_count + 2),
- sizeof (HARD_REG_SET));
+ regs_live_at = xcalloc ((2 * insn_count + 2), sizeof (HARD_REG_SET));
/* Initialize table of hardware registers currently live. */
@@ -1475,7 +1473,7 @@ block_alloc (int b)
number of suggested registers they need so we allocate those with
the most restrictive needs first. */
- qty_order = (int *) xmalloc (next_qty * sizeof (int));
+ qty_order = xmalloc (next_qty * sizeof (int));
for (i = 0; i < next_qty; i++)
qty_order[i] = i;
@@ -1740,7 +1738,7 @@ qty_sugg_compare_1 (const void *q1p, const void *q2p)
Combining registers means marking them as having the same quantity
and adjusting the offsets within the quantity if either of
- them is a SUBREG).
+ them is a SUBREG.
We don't actually combine a hard reg with a pseudo; instead
we just record the hard reg as the suggestion for the pseudo's quantity.
@@ -1751,7 +1749,7 @@ qty_sugg_compare_1 (const void *q1p, const void *q2p)
there is no REG_DEAD note on INSN. This occurs during the processing
of REG_NO_CONFLICT blocks.
- MAY_SAVE_COPYCOPY is nonzero if this insn is simply copying USEDREG to
+ MAY_SAVE_COPY is nonzero if this insn is simply copying USEDREG to
SETREG or if the input and output must share a register.
In that case, we record a hard reg suggestion in QTY_PHYS_COPY_SUGG.
diff --git a/gcc/longlong.h b/gcc/longlong.h
index 318df96be54..2fb68e7c373 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -443,7 +443,42 @@ UDItype __umulsidi3 (USItype, USItype);
"dmi" ((USItype) (d)))
#else /* not mc68020 */
-#if !defined(__mcf5200__)
+#if defined(__mcoldfire__)
+#define umul_ppmm(xh, xl, a, b) \
+ __asm__ ("| Inlined umul_ppmm\n" \
+ " move%.l %2,%/d0\n" \
+ " move%.l %3,%/d1\n" \
+ " move%.l %/d0,%/d2\n" \
+ " swap %/d0\n" \
+ " move%.l %/d1,%/d3\n" \
+ " swap %/d1\n" \
+ " move%.w %/d2,%/d4\n" \
+ " mulu %/d3,%/d4\n" \
+ " mulu %/d1,%/d2\n" \
+ " mulu %/d0,%/d3\n" \
+ " mulu %/d0,%/d1\n" \
+ " move%.l %/d4,%/d0\n" \
+ " clr%.w %/d0\n" \
+ " swap %/d0\n" \
+ " add%.l %/d0,%/d2\n" \
+ " add%.l %/d3,%/d2\n" \
+ " jcc 1f\n" \
+ " add%.l %#65536,%/d1\n" \
+ "1: swap %/d2\n" \
+ " moveq %#0,%/d0\n" \
+ " move%.w %/d2,%/d0\n" \
+ " move%.w %/d4,%/d2\n" \
+ " move%.l %/d2,%1\n" \
+ " add%.l %/d1,%/d0\n" \
+ " move%.l %/d0,%0" \
+ : "=g" ((USItype) (xh)), \
+ "=g" ((USItype) (xl)) \
+ : "g" ((USItype) (a)), \
+ "g" ((USItype) (b)) \
+ : "d0", "d1", "d2", "d3", "d4")
+#define UMUL_TIME 100
+#define UDIV_TIME 400
+#else /* not ColdFire */
/* %/ inserts REGISTER_PREFIX, %# inserts IMMEDIATE_PREFIX. */
#define umul_ppmm(xh, xl, a, b) \
__asm__ ("| Inlined umul_ppmm\n" \
@@ -479,14 +514,16 @@ UDItype __umulsidi3 (USItype, USItype);
: "d0", "d1", "d2", "d3", "d4")
#define UMUL_TIME 100
#define UDIV_TIME 400
-#endif /* not mcf5200 */
+#endif /* not ColdFire */
#endif /* not mc68020 */
-/* The '020, '030, '040 and '060 have bitfield insns. */
-#if defined (__mc68020__) || defined(mc68020) \
- || defined(__mc68030__) || defined(mc68030) \
- || defined(__mc68040__) || defined(mc68040) \
- || defined(__mc68060__) || defined(mc68060)
+/* The '020, '030, '040 and '060 have bitfield insns.
+ cpu32 disguises as a 68020, but lacks them. */
+#if ( defined (__mc68020__) || defined(mc68020) \
+ || defined(__mc68030__) || defined(mc68030) \
+ || defined(__mc68040__) || defined(mc68040) \
+ || defined(__mc68060__) || defined(mc68060) ) \
+ && !defined(__mcpu32__)
#define count_leading_zeros(count, x) \
__asm__ ("bfffo %1{%b2:%b2},%0" \
: "=d" ((USItype) (count)) \
@@ -647,7 +684,7 @@ UDItype __umulsidi3 (USItype, USItype);
__asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
#define COUNT_LEADING_ZEROS_0 32
#if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
- || defined (__ppc__) || defined (PPC) || defined (__vxworks__)
+ || defined (__ppc__) || defined (PPC)
#define umul_ppmm(ph, pl, m0, m1) \
do { \
USItype __m0 = (m0), __m1 = (m1); \
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c
index b7c7f270385..c1971c6f4c0 100644
--- a/gcc/loop-unswitch.c
+++ b/gcc/loop-unswitch.c
@@ -141,7 +141,7 @@ may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop,
/* 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);
+ test = get_condition (bb->end, NULL, true);
if (!test)
return false;
@@ -248,7 +248,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop,
return;
}
- if (!(cond = get_condition (bbs[i]->end, &split_before)))
+ if (!(cond = get_condition (bbs[i]->end, &split_before, true)))
abort ();
rcond = reversed_condition (cond);
diff --git a/gcc/loop.c b/gcc/loop.c
index b3c55170927..9d41e071d1f 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -22,8 +22,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* This is the loop optimization pass of the compiler.
It finds invariant computations within loops and moves them
to the beginning of the loop. Then it identifies basic and
- general induction variables. Strength reduction is applied to the general
- induction variables, and induction variable elimination is applied to
+ general induction variables.
+
+ Basic induction variables (BIVs) are a pseudo registers which are set within
+ a loop only by incrementing or decrementing its value. General induction
+ variables (GIVs) are pseudo registers with a value which is a linear function
+ of a basic induction variable. BIVs are recognized by `basic_induction_var';
+ GIVs by `general_induction_var'.
+
+ Once induction variables are identified, strength reduction is applied to the
+ general induction variables, and induction variable elimination is applied to
the basic induction variables.
It also finds cases where
@@ -293,7 +301,7 @@ static void record_giv (const struct loop *, struct induction *, rtx, rtx,
rtx, rtx, rtx, rtx, int, enum g_types, int, int,
rtx *);
static void update_giv_derive (const struct loop *, rtx);
-static void check_ext_dependent_givs (struct iv_class *, struct loop_info *);
+static void check_ext_dependent_givs (const struct loop *, struct iv_class *);
static int basic_induction_var (const struct loop *, rtx, enum machine_mode,
rtx, rtx, rtx *, rtx *, rtx **);
static rtx simplify_giv_expr (const struct loop *, rtx, rtx *, int *);
@@ -460,13 +468,11 @@ loop_optimize (rtx f, FILE *dumpfile, int flags)
Leave some space for labels allocated by find_and_verify_loops. */
max_uid_for_loop = get_max_uid () + 1 + max_loop_num * 32;
- uid_luid = (int *) xcalloc (max_uid_for_loop, sizeof (int));
- uid_loop = (struct loop **) xcalloc (max_uid_for_loop,
- sizeof (struct loop *));
+ uid_luid = xcalloc (max_uid_for_loop, sizeof (int));
+ uid_loop = xcalloc (max_uid_for_loop, sizeof (struct loop *));
/* Allocate storage for array of loops. */
- loops->array = (struct loop *)
- xcalloc (loops->num, sizeof (struct loop));
+ loops->array = xcalloc (loops->num, sizeof (struct loop));
/* Find and process each loop.
First, find them, and record them in order of their beginnings. */
@@ -908,7 +914,7 @@ scan_loop (struct loop *loop, int flags)
continue;
}
- m = (struct movable *) xmalloc (sizeof (struct movable));
+ m = xmalloc (sizeof (struct movable));
m->next = 0;
m->insn = p;
m->set_src = src;
@@ -996,7 +1002,7 @@ scan_loop (struct loop *loop, int flags)
if (regs->array[regno].set_in_loop == 2)
{
struct movable *m;
- m = (struct movable *) xmalloc (sizeof (struct movable));
+ m = xmalloc (sizeof (struct movable));
m->next = 0;
m->insn = p;
m->set_dest = SET_DEST (set);
@@ -1440,7 +1446,7 @@ static void
combine_movables (struct loop_movables *movables, struct loop_regs *regs)
{
struct movable *m;
- char *matched_regs = (char *) xmalloc (regs->num);
+ char *matched_regs = xmalloc (regs->num);
enum machine_mode mode;
/* Regs that are set more than once are not allowed to match
@@ -1775,8 +1781,8 @@ move_movables (struct loop *loop, struct loop_movables *movables,
/* Map of pseudo-register replacements to handle combining
when we move several insns that load the same value
into different pseudo-registers. */
- rtx *reg_map = (rtx *) xcalloc (nregs, sizeof (rtx));
- char *already_moved = (char *) xcalloc (nregs, sizeof (char));
+ rtx *reg_map = xcalloc (nregs, sizeof (rtx));
+ char *already_moved = xcalloc (nregs, sizeof (char));
for (m = movables->head; m; m = m->next)
{
@@ -2120,8 +2126,8 @@ move_movables (struct loop *loop, struct loop_movables *movables,
}
else if (m->insert_temp)
{
- rtx *reg_map2 = (rtx *) xcalloc (REGNO (newreg),
- sizeof(rtx));
+ rtx *reg_map2 = xcalloc (REGNO (newreg),
+ sizeof(rtx));
reg_map2 [m->regno] = newreg;
i1 = loop_insn_hoist (loop, copy_rtx (PATTERN (p)));
@@ -2256,7 +2262,7 @@ move_movables (struct loop *loop, struct loop_movables *movables,
and prevent further processing of it. */
m1->done = 1;
- /* if library call, delete all insns. */
+ /* If library call, delete all insns. */
if ((temp = find_reg_note (m1->insn, REG_RETVAL,
NULL_RTX)))
delete_insn_chain (XEXP (temp, 0), m1->insn);
@@ -4225,14 +4231,6 @@ emit_prefetch_instructions (struct loop *loop)
return;
}
-/* A "basic induction variable" or biv is a pseudo reg that is set
- (within this loop) only by incrementing or decrementing it. */
-/* A "general induction variable" or giv is a pseudo reg whose
- value is a linear function of a biv. */
-
-/* Bivs are recognized by `basic_induction_var';
- Givs by `general_induction_var'. */
-
/* Communication with routines called via `note_stores'. */
static rtx note_insn;
@@ -5068,7 +5066,7 @@ strength_reduce (struct loop *loop, int flags)
addr_placeholder = gen_reg_rtx (Pmode);
ivs->n_regs = max_reg_before_loop;
- ivs->regs = (struct iv *) xcalloc (ivs->n_regs, sizeof (struct iv));
+ ivs->regs = xcalloc (ivs->n_regs, sizeof (struct iv));
/* Find all BIVs in loop. */
loop_bivs_find (loop);
@@ -5122,7 +5120,7 @@ strength_reduce (struct loop *loop, int flags)
Some givs might have been made from biv increments, so look at
ivs->reg_iv_type for a suitable size. */
reg_map_size = ivs->n_regs;
- reg_map = (rtx *) xcalloc (reg_map_size, sizeof (rtx));
+ reg_map = xcalloc (reg_map_size, sizeof (rtx));
/* Examine each iv class for feasibility of strength reduction/induction
variable elimination. */
@@ -5143,7 +5141,7 @@ strength_reduce (struct loop *loop, int flags)
/* Check each extension dependent giv in this class to see if its
root biv is safe from wrapping in the interior mode. */
- check_ext_dependent_givs (bl, loop_info);
+ check_ext_dependent_givs (loop, bl);
/* Combine all giv's for this iv_class. */
combine_givs (regs, bl);
@@ -5385,8 +5383,7 @@ check_insn_for_bivs (struct loop *loop, rtx p, int not_every_iteration,
/* It is a possible basic induction variable.
Create and initialize an induction structure for it. */
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
record_biv (loop, v, p, dest_reg, inc_val, mult_val, location,
not_every_iteration, maybe_multiple);
@@ -5449,8 +5446,7 @@ check_insn_for_givs (struct loop *loop, rtx p, int not_every_iteration,
&add_val, &mult_val, &ext_val,
&last_consec_insn))))
{
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
/* If this is a library call, increase benefit. */
if (find_reg_note (p, REG_RETVAL, NULL_RTX))
@@ -5567,8 +5563,7 @@ find_mem_givs (const struct loop *loop, rtx x, rtx insn,
GET_MODE (x)))
{
/* Found one; record it. */
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
record_giv (loop, v, insn, src_reg, addr_placeholder, mult_val,
add_val, ext_val, benefit, DEST_ADDR,
@@ -5641,7 +5636,7 @@ record_biv (struct loop *loop, struct induction *v, rtx insn, rtx dest_reg,
{
/* Create and initialize new iv_class. */
- bl = (struct iv_class *) xmalloc (sizeof (struct iv_class));
+ bl = xmalloc (sizeof (struct iv_class));
bl->regno = REGNO (dest_reg);
bl->biv = 0;
@@ -6197,7 +6192,7 @@ basic_induction_var (const struct loop *loop, rtx x, enum machine_mode mode,
{
enum rtx_code code;
rtx *argp, arg;
- rtx insn, set = 0;
+ rtx insn, set = 0, last, inc;
code = GET_CODE (x);
*location = NULL;
@@ -6225,7 +6220,26 @@ basic_induction_var (const struct loop *loop, rtx x, enum machine_mode mode,
if (loop_invariant_p (loop, arg) != 1)
return 0;
- *inc_val = convert_modes (GET_MODE (dest_reg), GET_MODE (x), arg, 0);
+ /* 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.
+ 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
+ instructions, emit these instructions before loop start and let
+ it be garbage collected if *inc_val is never used or saving the
+ *inc_val initialization sequence generated here and when *inc_val
+ is going to be actually used, emit it at some suitable place. */
+ last = get_last_insn ();
+ inc = convert_modes (GET_MODE (dest_reg), GET_MODE (x), arg, 0);
+ if (get_last_insn () != last)
+ {
+ delete_insns_since (last);
+ return 0;
+ }
+
+ *inc_val = inc;
*mult_val = const1_rtx;
*location = argp;
return 1;
@@ -6306,7 +6320,15 @@ basic_induction_var (const struct loop *loop, rtx x, enum machine_mode mode,
&& GET_MODE_CLASS (mode) != MODE_CC)
{
/* Possible bug here? Perhaps we don't know the mode of X. */
- *inc_val = convert_modes (GET_MODE (dest_reg), mode, x, 0);
+ last = get_last_insn ();
+ inc = convert_modes (GET_MODE (dest_reg), mode, x, 0);
+ if (get_last_insn () != last)
+ {
+ delete_insns_since (last);
+ return 0;
+ }
+
+ *inc_val = inc;
*mult_val = const0_rtx;
return 1;
}
@@ -6981,7 +7003,7 @@ consec_sets_giv (const struct loop *loop, int first_benefit, rtx p,
if (REG_IV_TYPE (ivs, REGNO (dest_reg)) != UNKNOWN_INDUCT)
return 0;
- v = (struct induction *) alloca (sizeof (struct induction));
+ v = alloca (sizeof (struct induction));
v->src_reg = src_reg;
v->mult_val = *mult_val;
v->add_val = *add_val;
@@ -7286,8 +7308,9 @@ combine_givs_p (struct induction *g1, struct induction *g2)
make the giv illegal. */
static void
-check_ext_dependent_givs (struct iv_class *bl, struct loop_info *loop_info)
+check_ext_dependent_givs (const struct loop *loop, struct iv_class *bl)
{
+ struct loop_info *loop_info = LOOP_INFO (loop);
int ze_ok = 0, se_ok = 0, info_ok = 0;
enum machine_mode biv_mode = GET_MODE (bl->biv->src_reg);
HOST_WIDE_INT start_val;
@@ -7298,9 +7321,6 @@ check_ext_dependent_givs (struct iv_class *bl, struct loop_info *loop_info)
/* Make sure the iteration data is available. We must have
constants in order to be certain of no overflow. */
- /* ??? An unknown iteration count with an increment of +-1
- combined with friendly exit tests of against an invariant
- value is also amenable to optimization. Not implemented. */
if (loop_info->n_iterations > 0
&& bl->initial_value
&& GET_CODE (bl->initial_value) == CONST_INT
@@ -7367,6 +7387,37 @@ check_ext_dependent_givs (struct iv_class *bl, struct loop_info *loop_info)
}
}
+ /* If we know the BIV is compared at run-time against an
+ invariant value, and the increment is +/- 1, we may also
+ be able to prove that the BIV cannot overflow. */
+ else if (bl->biv->src_reg == loop_info->iteration_var
+ && loop_info->comparison_value
+ && loop_invariant_p (loop, loop_info->comparison_value)
+ && (incr = biv_total_increment (bl))
+ && GET_CODE (incr) == CONST_INT)
+ {
+ /* If the increment is +1, and the exit test is a <,
+ the BIV cannot overflow. (For <=, we have the
+ problematic case that the comparison value might
+ be the maximum value of the range.) */
+ if (INTVAL (incr) == 1)
+ {
+ if (loop_info->comparison_code == LT)
+ se_ok = ze_ok = 1;
+ else if (loop_info->comparison_code == LTU)
+ ze_ok = 1;
+ }
+
+ /* Likewise for increment -1 and exit test >. */
+ if (INTVAL (incr) == -1)
+ {
+ if (loop_info->comparison_code == GT)
+ se_ok = ze_ok = 1;
+ else if (loop_info->comparison_code == GTU)
+ ze_ok = 1;
+ }
+ }
+
/* Invalidate givs that fail the tests. */
for (v = bl->giv; v; v = v->next_iv)
if (v->ext_dependent)
@@ -7388,8 +7439,9 @@ check_ext_dependent_givs (struct iv_class *bl, struct loop_info *loop_info)
signed or unsigned, so to safely truncate we must satisfy
both. The initial check here verifies the BIV itself;
once that is successful we may check its range wrt the
- derived GIV. */
- if (se_ok && ze_ok)
+ derived GIV. This works only if we were able to determine
+ constant start and end values above. */
+ if (se_ok && ze_ok && info_ok)
{
enum machine_mode outer_mode = GET_MODE (v->ext_dependent);
unsigned HOST_WIDE_INT max = GET_MODE_MASK (outer_mode) >> 1;
@@ -7507,15 +7559,14 @@ combine_givs (struct loop_regs *regs, struct iv_class *bl)
if (!g1->ignore)
giv_count++;
- giv_array
- = (struct induction **) alloca (giv_count * sizeof (struct induction *));
+ giv_array = alloca (giv_count * sizeof (struct induction *));
i = 0;
for (g1 = bl->giv; g1; g1 = g1->next_iv)
if (!g1->ignore)
giv_array[i++] = g1;
- stats = (struct combine_givs_stats *) xcalloc (giv_count, sizeof (*stats));
- can_combine = (rtx *) xcalloc (giv_count, giv_count * sizeof (rtx));
+ stats = xcalloc (giv_count, sizeof (*stats));
+ can_combine = xcalloc (giv_count, giv_count * sizeof (rtx));
for (i = 0; i < giv_count; i++)
{
@@ -7690,25 +7741,16 @@ loop_regs_update (const struct loop *loop ATTRIBUTE_UNUSED, rtx seq)
/* Update register info for alias analysis. */
- if (seq == NULL_RTX)
- return;
-
- if (INSN_P (seq))
+ insn = seq;
+ while (insn != NULL_RTX)
{
- insn = seq;
- while (insn != NULL_RTX)
- {
- rtx set = single_set (insn);
+ rtx set = single_set (insn);
- if (set && GET_CODE (SET_DEST (set)) == REG)
- record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
+ if (set && GET_CODE (SET_DEST (set)) == REG)
+ record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
- insn = NEXT_INSN (insn);
- }
+ insn = NEXT_INSN (insn);
}
- else if (GET_CODE (seq) == SET
- && GET_CODE (SET_DEST (seq)) == REG)
- record_base_value (REGNO (SET_DEST (seq)), SET_SRC (seq), 0);
}
@@ -7737,11 +7779,12 @@ loop_iv_add_mult_emit_before (const struct loop *loop, rtx b, rtx m, rtx a,
update_reg_last_use (b, before_insn);
update_reg_last_use (m, before_insn);
- loop_insn_emit_before (loop, before_bb, before_insn, seq);
-
/* It is possible that the expansion created lots of new registers.
- Iterate over the sequence we just created and record them all. */
+ Iterate over the sequence we just created and record them all. We
+ must do this before inserting the sequence. */
loop_regs_update (loop, seq);
+
+ loop_insn_emit_before (loop, before_bb, before_insn, seq);
}
@@ -7764,11 +7807,12 @@ loop_iv_add_mult_sink (const struct loop *loop, rtx b, rtx m, rtx a, rtx reg)
update_reg_last_use (b, loop->sink);
update_reg_last_use (m, loop->sink);
- loop_insn_sink (loop, seq);
-
/* It is possible that the expansion created lots of new registers.
- Iterate over the sequence we just created and record them all. */
+ Iterate over the sequence we just created and record them all. We
+ must do this before inserting the sequence. */
loop_regs_update (loop, seq);
+
+ loop_insn_sink (loop, seq);
}
@@ -7784,11 +7828,12 @@ loop_iv_add_mult_hoist (const struct loop *loop, rtx b, rtx m, rtx a, rtx reg)
/* Use copy_rtx to prevent unexpected sharing of these rtx. */
seq = gen_add_mult (copy_rtx (b), copy_rtx (m), copy_rtx (a), reg);
- loop_insn_hoist (loop, seq);
-
/* It is possible that the expansion created lots of new registers.
- Iterate over the sequence we just created and record them all. */
+ Iterate over the sequence we just created and record them all. We
+ must do this before inserting the sequence. */
loop_regs_update (loop, seq);
+
+ loop_insn_hoist (loop, seq);
}
@@ -7935,7 +7980,7 @@ check_dbra_loop (struct loop *loop, int insn_count)
/* Try to compute whether the compare/branch at the loop end is one or
two instructions. */
- get_condition (jump, &first_compare);
+ get_condition (jump, &first_compare, false);
if (first_compare == jump)
compare_and_branch = 1;
else if (first_compare == prev_nonnote_insn (jump))
@@ -7980,9 +8025,7 @@ check_dbra_loop (struct loop *loop, int insn_count)
In this case, add a reg_note REG_NONNEG, which allows the
m68k DBRA instruction to be used. */
- if (((GET_CODE (comparison) == GT
- && GET_CODE (XEXP (comparison, 1)) == CONST_INT
- && INTVAL (XEXP (comparison, 1)) == -1)
+ if (((GET_CODE (comparison) == GT && XEXP (comparison, 1) == constm1_rtx)
|| (GET_CODE (comparison) == NE && XEXP (comparison, 1) == const0_rtx))
&& GET_CODE (bl->biv->add_val) == CONST_INT
&& INTVAL (bl->biv->add_val) < 0)
@@ -8018,7 +8061,8 @@ check_dbra_loop (struct loop *loop, int insn_count)
before_comparison = get_condition_for_loop (loop, p);
if (before_comparison
&& XEXP (before_comparison, 0) == bl->biv->dest_reg
- && GET_CODE (before_comparison) == LT
+ && (GET_CODE (before_comparison) == LT
+ || GET_CODE (before_comparison) == LTU)
&& XEXP (before_comparison, 1) == const0_rtx
&& ! reg_set_between_p (bl->biv->dest_reg, p, loop_start)
&& INTVAL (bl->biv->add_val) == -1)
@@ -8189,7 +8233,8 @@ check_dbra_loop (struct loop *loop, int insn_count)
/* for constants, LE gets turned into LT */
&& (GET_CODE (comparison) == LT
|| (GET_CODE (comparison) == LE
- && no_use_except_counting)))
+ && no_use_except_counting)
+ || GET_CODE (comparison) == LTU))
{
HOST_WIDE_INT add_val, add_adjust, comparison_val = 0;
rtx initial_value, comparison_value;
@@ -9098,11 +9143,12 @@ update_reg_last_use (rtx x, rtx insn)
If WANT_REG is nonzero, we wish the condition to be relative to that
register, if possible. Therefore, do not canonicalize the condition
- further. */
+ further. If ALLOW_CC_MODE is nonzero, allow the condition returned
+ to be a compare to a CC mode register. */
rtx
canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest,
- rtx want_reg)
+ rtx want_reg, int allow_cc_mode)
{
enum rtx_code code;
rtx prev = insn;
@@ -9281,14 +9327,16 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest,
/* If OP0 is the result of a comparison, we weren't able to find what
was really being compared, so fail. */
- if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_CC)
+ if (!allow_cc_mode
+ && GET_MODE_CLASS (GET_MODE (op0)) == MODE_CC)
return 0;
/* Canonicalize any ordered comparison with integers involving equality
if we can do computations in the relevant mode and we do not
overflow. */
- if (GET_CODE (op1) == CONST_INT
+ if (GET_MODE_CLASS (GET_MODE (op0)) != MODE_CC
+ && GET_CODE (op1) == CONST_INT
&& GET_MODE (op0) != VOIDmode
&& GET_MODE_BITSIZE (GET_MODE (op0)) <= HOST_BITS_PER_WIDE_INT)
{
@@ -9343,10 +9391,13 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest,
If EARLIEST is nonzero, it is a pointer to a place where the earliest
insn used in locating the condition was found. If a replacement test
of the condition is desired, it should be placed in front of that
- insn and we will be sure that the inputs are still valid. */
+ insn and we will be sure that the inputs are still valid.
+
+ If ALLOW_CC_MODE is nonzero, allow the condition returned to be a
+ compare CC mode register. */
rtx
-get_condition (rtx jump, rtx *earliest)
+get_condition (rtx jump, rtx *earliest, int allow_cc_mode)
{
rtx cond;
int reverse;
@@ -9366,7 +9417,8 @@ get_condition (rtx jump, rtx *earliest)
= GET_CODE (XEXP (SET_SRC (set), 2)) == LABEL_REF
&& XEXP (XEXP (SET_SRC (set), 2), 0) == JUMP_LABEL (jump);
- return canonicalize_condition (jump, cond, reverse, earliest, NULL_RTX);
+ return canonicalize_condition (jump, cond, reverse, earliest, NULL_RTX,
+ allow_cc_mode);
}
/* Similar to above routine, except that we also put an invariant last
@@ -9375,7 +9427,7 @@ get_condition (rtx jump, rtx *earliest)
rtx
get_condition_for_loop (const struct loop *loop, rtx x)
{
- rtx comparison = get_condition (x, (rtx*) 0);
+ rtx comparison = get_condition (x, (rtx*) 0, false);
if (comparison == 0
|| ! loop_invariant_p (loop, XEXP (comparison, 0))
@@ -9460,9 +9512,8 @@ insert_loop_mem (rtx *mem, void *data ATTRIBUTE_UNUSED)
else
loop_info->mems_allocated = 32;
- loop_info->mems = (loop_mem_info *)
- xrealloc (loop_info->mems,
- loop_info->mems_allocated * sizeof (loop_mem_info));
+ loop_info->mems = xrealloc (loop_info->mems,
+ loop_info->mems_allocated * sizeof (loop_mem_info));
}
/* Actually insert the MEM. */
@@ -9513,8 +9564,7 @@ loop_regs_scan (const struct loop *loop, int extra_size)
{
regs->size = regs->num + extra_size;
- regs->array = (struct loop_reg *)
- xrealloc (regs->array, regs->size * sizeof (*regs->array));
+ regs->array = xrealloc (regs->array, regs->size * sizeof (*regs->array));
/* Zero the new elements. */
memset (regs->array + old_nregs, 0,
@@ -9529,7 +9579,7 @@ loop_regs_scan (const struct loop *loop, int extra_size)
regs->array[i].single_usage = NULL_RTX;
}
- last_set = (rtx *) xcalloc (regs->num, sizeof (rtx));
+ last_set = xcalloc (regs->num, sizeof (rtx));
/* Scan the loop, recording register usage. */
for (insn = loop->top ? loop->top : loop->start; insn != loop->end;
diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c
index 3a183758c40..e25c175ef54 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -884,7 +884,7 @@ print_symbol (SYMR *sym_ptr, int number, const char *strbase, AUXU *aux_base,
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ scope_ptr = xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
@@ -938,7 +938,7 @@ print_symbol (SYMR *sym_ptr, int number, const char *strbase, AUXU *aux_base,
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ scope_ptr = xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
@@ -1324,13 +1324,12 @@ read_tfile (void)
short magic;
off_t sym_hdr_offset = 0;
- (void) read_seek (&magic, sizeof (magic), (off_t) 0, "Magic number");
+ read_seek (&magic, sizeof (magic), 0, "Magic number");
if (!tfile)
{
/* Print out the global header, since this is not a T-file. */
- (void) read_seek (&global_hdr, sizeof (global_hdr), (off_t) 0,
- "Global file header");
+ read_seek (&global_hdr, sizeof (global_hdr), 0, "Global file header");
print_global_hdr (&global_hdr);
@@ -1343,70 +1342,45 @@ read_tfile (void)
sym_hdr_offset = global_hdr.f_symptr;
}
- (void) read_seek (&sym_hdr,
- sizeof (sym_hdr),
- sym_hdr_offset,
- "Symbolic header");
+ read_seek (&sym_hdr, sizeof (sym_hdr), sym_hdr_offset, "Symbolic header");
print_sym_hdr (&sym_hdr);
- lines = (LINER *) read_seek (NULL,
- sym_hdr.cbLine,
- sym_hdr.cbLineOffset,
- "Line numbers");
+ lines = read_seek (NULL, sym_hdr.cbLine, sym_hdr.cbLineOffset,
+ "Line numbers");
- dense_nums = (DNR *) read_seek (NULL,
- sym_hdr.idnMax * sizeof (DNR),
- sym_hdr.cbDnOffset,
- "Dense numbers");
+ dense_nums = read_seek (NULL, sym_hdr.idnMax * sizeof (DNR),
+ sym_hdr.cbDnOffset, "Dense numbers");
- proc_desc = (PDR *) read_seek (NULL,
- sym_hdr.ipdMax * sizeof (PDR),
- sym_hdr.cbPdOffset,
- "Procedure tables");
+ proc_desc = read_seek (NULL, sym_hdr.ipdMax * sizeof (PDR),
+ sym_hdr.cbPdOffset, "Procedure tables");
- l_symbols = (SYMR *) read_seek (NULL,
- sym_hdr.isymMax * sizeof (SYMR),
- sym_hdr.cbSymOffset,
- "Local symbols");
+ l_symbols = read_seek (NULL, sym_hdr.isymMax * sizeof (SYMR),
+ sym_hdr.cbSymOffset, "Local symbols");
- opt_symbols = (OPTR *) read_seek (NULL,
- sym_hdr.ioptMax * sizeof (OPTR),
- sym_hdr.cbOptOffset,
- "Optimization symbols");
+ opt_symbols = read_seek (NULL, sym_hdr.ioptMax * sizeof (OPTR),
+ sym_hdr.cbOptOffset, "Optimization symbols");
- aux_symbols = (AUXU *) read_seek (NULL,
- sym_hdr.iauxMax * sizeof (AUXU),
- sym_hdr.cbAuxOffset,
- "Auxiliary symbols");
+ aux_symbols = read_seek (NULL, sym_hdr.iauxMax * sizeof (AUXU),
+ sym_hdr.cbAuxOffset, "Auxiliary symbols");
if (sym_hdr.iauxMax > 0)
aux_used = xcalloc (sym_hdr.iauxMax, 1);
- l_strings = (char *) read_seek (NULL,
- sym_hdr.issMax,
- sym_hdr.cbSsOffset,
- "Local string table");
-
- e_strings = (char *) read_seek (NULL,
- sym_hdr.issExtMax,
- sym_hdr.cbSsExtOffset,
- "External string table");
-
- file_desc = (FDR *) read_seek (NULL,
- sym_hdr.ifdMax * sizeof (FDR),
- sym_hdr.cbFdOffset,
- "File tables");
-
- rfile_desc = (ulong *) read_seek (NULL,
- sym_hdr.crfd * sizeof (ulong),
- sym_hdr.cbRfdOffset,
- "Relative file tables");
-
- e_symbols = (EXTR *) read_seek (NULL,
- sym_hdr.iextMax * sizeof (EXTR),
- sym_hdr.cbExtOffset,
- "External symbols");
+ l_strings = read_seek (NULL, sym_hdr.issMax,
+ sym_hdr.cbSsOffset, "Local string table");
+
+ e_strings = read_seek (NULL, sym_hdr.issExtMax,
+ sym_hdr.cbSsExtOffset, "External string table");
+
+ file_desc = read_seek (NULL, sym_hdr.ifdMax * sizeof (FDR),
+ sym_hdr.cbFdOffset, "File tables");
+
+ rfile_desc = read_seek (NULL, sym_hdr.crfd * sizeof (ulong),
+ sym_hdr.cbRfdOffset, "Relative file tables");
+
+ e_symbols = read_seek (NULL, sym_hdr.iextMax * sizeof (EXTR),
+ sym_hdr.cbExtOffset, "External symbols");
}
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 79345e56469..314ed53fab7 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -1637,7 +1637,7 @@ add_varray_page (varray_t *vp)
#ifdef MALLOC_CHECK
if (vp->object_size > 1)
- new_links->datum = (page_t *) xcalloc (1, vp->object_size);
+ new_links->datum = xcalloc (1, vp->object_size);
else
#endif
new_links->datum = allocate_page ();
@@ -2353,7 +2353,7 @@ add_procedure (const char *func_start, /* 1st byte of func name */
STATIC void
initialize_init_file (void)
{
- memset ((void*) &init_file, 0, sizeof (init_file));
+ memset (&init_file, 0, sizeof (init_file));
init_file.fdr.lang = langC;
init_file.fdr.fMerge = 1;
@@ -3280,7 +3280,7 @@ parse_def (const char *name_start)
value,
indx);
- /* deal with struct, union, and enum tags. */
+ /* Deal with struct, union, and enum tags. */
if (symbol_type == st_Block)
{
/* Create or update the tag information. */
@@ -4257,7 +4257,7 @@ read_seek (Size_t size, /* # bytes to read */
#ifndef MALLOC_CHECK
ptr = allocate_multiple_pages ((size + PAGE_USIZE - 1) / PAGE_USIZE);
#else
- ptr = (page_t *) xcalloc (1, size);
+ ptr = xcalloc (1, size);
#endif
/* If we need to seek, and the distance is nearby, just do some reads,
@@ -4379,61 +4379,61 @@ copy_object (void)
file_offset = orig_file_header.f_symptr + sizeof (struct filehdr);
if (orig_sym_hdr.cbLine > 0) /* line numbers */
- orig_linenum = (char *) read_seek ((Size_t) orig_sym_hdr.cbLine,
+ orig_linenum = (char *) read_seek (orig_sym_hdr.cbLine,
orig_sym_hdr.cbLineOffset,
"Line numbers");
if (orig_sym_hdr.ipdMax > 0) /* procedure tables */
- orig_procs = (PDR *) read_seek ((Size_t) orig_sym_hdr.ipdMax * sizeof (PDR),
+ orig_procs = (PDR *) read_seek (orig_sym_hdr.ipdMax * sizeof (PDR),
orig_sym_hdr.cbPdOffset,
"Procedure tables");
if (orig_sym_hdr.isymMax > 0) /* local symbols */
- orig_local_syms = (SYMR *) read_seek ((Size_t) orig_sym_hdr.isymMax * sizeof (SYMR),
+ orig_local_syms = (SYMR *) read_seek (orig_sym_hdr.isymMax * sizeof (SYMR),
orig_sym_hdr.cbSymOffset,
"Local symbols");
if (orig_sym_hdr.iauxMax > 0) /* aux symbols */
- orig_aux_syms = (AUXU *) read_seek ((Size_t) orig_sym_hdr.iauxMax * sizeof (AUXU),
+ orig_aux_syms = (AUXU *) read_seek (orig_sym_hdr.iauxMax * sizeof (AUXU),
orig_sym_hdr.cbAuxOffset,
"Aux. symbols");
if (orig_sym_hdr.issMax > 0) /* local strings */
- orig_local_strs = (char *) read_seek ((Size_t) orig_sym_hdr.issMax,
+ orig_local_strs = (char *) read_seek (orig_sym_hdr.issMax,
orig_sym_hdr.cbSsOffset,
"Local strings");
if (orig_sym_hdr.issExtMax > 0) /* external strings */
- orig_ext_strs = (char *) read_seek ((Size_t) orig_sym_hdr.issExtMax,
+ orig_ext_strs = (char *) read_seek (orig_sym_hdr.issExtMax,
orig_sym_hdr.cbSsExtOffset,
"External strings");
if (orig_sym_hdr.ifdMax > 0) /* file tables */
- orig_files = (FDR *) read_seek ((Size_t) orig_sym_hdr.ifdMax * sizeof (FDR),
+ orig_files = (FDR *) read_seek (orig_sym_hdr.ifdMax * sizeof (FDR),
orig_sym_hdr.cbFdOffset,
"File tables");
if (orig_sym_hdr.crfd > 0) /* relative file descriptors */
- orig_rfds = (symint_t *) read_seek ((Size_t) orig_sym_hdr.crfd * sizeof (symint_t),
+ orig_rfds = (symint_t *) read_seek (orig_sym_hdr.crfd * sizeof (symint_t),
orig_sym_hdr.cbRfdOffset,
"Relative file descriptors");
if (orig_sym_hdr.issExtMax > 0) /* external symbols */
- orig_ext_syms = (EXTR *) read_seek ((Size_t) orig_sym_hdr.iextMax * sizeof (EXTR),
+ orig_ext_syms = (EXTR *) read_seek (orig_sym_hdr.iextMax * sizeof (EXTR),
orig_sym_hdr.cbExtOffset,
"External symbols");
if (orig_sym_hdr.idnMax > 0) /* dense numbers */
{
- orig_dense = (DNR *) read_seek ((Size_t) orig_sym_hdr.idnMax * sizeof (DNR),
+ orig_dense = (DNR *) read_seek (orig_sym_hdr.idnMax * sizeof (DNR),
orig_sym_hdr.cbDnOffset,
"Dense numbers");
- add_bytes (&dense_num, (char *) orig_dense, (Size_t) orig_sym_hdr.idnMax);
+ add_bytes (&dense_num, (char *) orig_dense, orig_sym_hdr.idnMax);
}
if (orig_sym_hdr.ioptMax > 0) /* opt symbols */
- orig_opt_syms = (OPTR *) read_seek ((Size_t) orig_sym_hdr.ioptMax * sizeof (OPTR),
+ orig_opt_syms = (OPTR *) read_seek (orig_sym_hdr.ioptMax * sizeof (OPTR),
orig_sym_hdr.cbOptOffset,
"Optimizer symbols");
@@ -4464,7 +4464,7 @@ copy_object (void)
(in case there are duplicate filenames, we collapse them into one
file section, the MIPS assembler may or may not collapse them). */
- remap_file_number = (int *) alloca (sizeof (int) * orig_sym_hdr.ifdMax);
+ remap_file_number = alloca (sizeof (int) * orig_sym_hdr.ifdMax);
for (fd = delete_ifd; fd < orig_sym_hdr.ifdMax; fd++)
{
@@ -4743,7 +4743,7 @@ main (int argc, char **argv)
else
rename_output = 1;
- /* fall through to 'i' case. */
+ /* Fall through to 'i' case. */
case 'i':
if (obj_in_name == (char *) 0)
@@ -4972,7 +4972,7 @@ out_of_bounds (symint_t indx, /* index that is out of bounds */
STATIC page_t *
allocate_cluster (Size_t npages)
{
- page_t *value = (page_t *) xcalloc (npages, PAGE_USIZE);
+ page_t *value = xcalloc (npages, PAGE_USIZE);
if (debug > 3)
fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, value);
@@ -5038,7 +5038,7 @@ allocate_multiple_pages (Size_t npages)
return allocate_cluster (npages);
#else /* MALLOC_CHECK */
- return (page_t *) xcalloc (npages, PAGE_SIZE);
+ return xcalloc (npages, PAGE_SIZE);
#endif /* MALLOC_CHECK */
}
@@ -5089,7 +5089,7 @@ allocate_page (void)
return cluster_ptr++;
#else /* MALLOC_CHECK */
- return (page_t *) xcalloc (1, PAGE_SIZE);
+ return xcalloc (1, PAGE_SIZE);
#endif /* MALLOC_CHECK */
}
@@ -5125,7 +5125,7 @@ allocate_scope (void)
}
#else
- ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ ptr = xmalloc (sizeof (scope_t));
#endif
@@ -5175,7 +5175,7 @@ allocate_vlinks (void)
alloc_counts[ (int) alloc_type_vlinks ].unallocated = unallocated;
#else
- ptr = (vlinks_t *) xmalloc (sizeof (vlinks_t));
+ ptr = xmalloc (sizeof (vlinks_t));
#endif
@@ -5208,7 +5208,7 @@ allocate_shash (void)
alloc_counts[ (int) alloc_type_shash ].unallocated = unallocated;
#else
- ptr = (shash_t *) xmalloc (sizeof (shash_t));
+ ptr = xmalloc (sizeof (shash_t));
#endif
@@ -5241,7 +5241,7 @@ allocate_thash (void)
alloc_counts[ (int) alloc_type_thash ].unallocated = unallocated;
#else
- ptr = (thash_t *) xmalloc (sizeof (thash_t));
+ ptr = xmalloc (sizeof (thash_t));
#endif
@@ -5281,7 +5281,7 @@ allocate_tag (void)
}
#else
- ptr = (tag_t *) xmalloc (sizeof (tag_t));
+ ptr = xmalloc (sizeof (tag_t));
#endif
@@ -5338,7 +5338,7 @@ allocate_forward (void)
}
#else
- ptr = (forward_t *) xmalloc (sizeof (forward_t));
+ ptr = xmalloc (sizeof (forward_t));
#endif
@@ -5395,7 +5395,7 @@ allocate_thead (void)
}
#else
- ptr = (thead_t *) xmalloc (sizeof (thead_t));
+ ptr = xmalloc (sizeof (thead_t));
#endif
diff --git a/gcc/mkdeps.c b/gcc/mkdeps.c
index 71aab3d9fc5..23af9d83f78 100644
--- a/gcc/mkdeps.c
+++ b/gcc/mkdeps.c
@@ -22,8 +22,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "mkdeps.h"
/* Keep this structure local to this file, so clients don't find it
@@ -112,7 +110,7 @@ munge (const char *filename)
struct deps *
deps_init (void)
{
- struct deps *d = (struct deps *) xmalloc (sizeof (struct deps));
+ struct deps *d = xmalloc (sizeof (struct deps));
/* Allocate space for the vectors only if we need it. */
@@ -157,7 +155,7 @@ deps_add_target (struct deps *d, const char *t, int quote)
if (d->ntargets == d->targets_size)
{
d->targets_size = d->targets_size * 2 + 4;
- d->targetv = (const char **) xrealloc (d->targetv,
+ d->targetv = xrealloc (d->targetv,
d->targets_size * sizeof (const char *));
}
@@ -187,7 +185,7 @@ deps_add_default_target (struct deps *d, const char *tgt)
# define TARGET_OBJECT_SUFFIX ".o"
#endif
const char *start = lbasename (tgt);
- char *o = (char *) alloca (strlen (start) + strlen (TARGET_OBJECT_SUFFIX) + 1);
+ char *o = alloca (strlen (start) + strlen (TARGET_OBJECT_SUFFIX) + 1);
char *suffix;
strcpy (o, start);
@@ -209,8 +207,7 @@ deps_add_dep (struct deps *d, const char *t)
if (d->ndeps == d->deps_size)
{
d->deps_size = d->deps_size * 2 + 8;
- d->depv = (const char **)
- xrealloc (d->depv, d->deps_size * sizeof (const char *));
+ d->depv = xrealloc (d->depv, d->deps_size * sizeof (const char *));
}
d->depv[d->ndeps++] = t;
}
@@ -317,7 +314,7 @@ deps_restore (struct deps *deps, FILE *fd, const char *self)
unsigned int i, count;
size_t num_to_read;
size_t buf_size = 512;
- char *buf = (char *) xmalloc (buf_size);
+ char *buf = xmalloc (buf_size);
/* Number of dependences. */
if (fread (&count, 1, sizeof (count), fd) != sizeof (count))
diff --git a/gcc/mkheaders.in b/gcc/mkheaders.in
index a97c49edf59..1e36ca4f408 100644
--- a/gcc/mkheaders.in
+++ b/gcc/mkheaders.in
@@ -64,18 +64,22 @@ local_prefix=@local_prefix@
exec_prefix=@exec_prefix@
# Directory in which to put the directories used by the compiler.
libdir=@libdir@
-# Directory in which the compiler finds executables, libraries, etc.
+libexecdir=@libexecdir@
+# Directory in which the compiler finds libraries, etc.
libsubdir=${libdir}/gcc-lib/${target_alias}/${version}
+# Directory in which the compiler finds executables
+libexecsubdir=${libexecdir}/gcc/${target_alias}/${version}
# Since gcc_tooldir does not exist at build-time, use -B${build_tooldir}/bin/
build_tooldir=${exec_prefix}/${target_alias}
# Directory to search for site-specific includes.
local_includedir=${local_prefix}/include
includedir=${prefix}/include
-itoolsdir=${libsubdir}/install-tools
+itoolsdir=${libexecsubdir}/install-tools
+itoolsdatadir=${libsubdir}/install-tools
incdir=${libsubdir}/include
-. ${itoolsdir}/mkheaders.conf
+. ${itoolsdatadir}/mkheaders.conf
cd ${itoolsdir}
rm -rf ${incdir}/*
@@ -88,11 +92,11 @@ if [ x${STMP_FIXINC} != x ] ; then
if [ -f ${incdir}/limits.h ]; then
mv ${incdir}/limits.h ${incdir}/syslimits.h
else
- cp gsyslimits.h ${incdir}/syslimits.h
+ cp ${itoolsdatadir}/gsyslimits.h ${incdir}/syslimits.h
fi
fi
-cp include/* ${incdir}
+cp ${itoolsdatadir}/include/* ${incdir}
if [ x${STMP_FIXPROTO} != x ] ; then
mkinstalldirs="${SHELL} ${itoolsdir}/mkinstalldirs"
diff --git a/gcc/mkinstalldirs b/gcc/mkinstalldirs
index 54c7c25afd2..d2d5f21b611 100644
--- a/gcc/mkinstalldirs
+++ b/gcc/mkinstalldirs
@@ -4,37 +4,108 @@
# Created: 1993-05-16
# Public domain
-# $Id: mkinstalldirs,v 1.1 1998/12/17 06:43:04 law 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
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
for file
do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
+ 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
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
+ mkdir "$pathcomp" || lasterr=$?
- 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=$?
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
- pathcomp="$pathcomp/"
- done
+ pathcomp="$pathcomp/"
+ done
done
exit $errstatus
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
# mkinstalldirs ends here
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index c2eea1a1391..ff29f752f15 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -352,14 +352,20 @@ EOF
done
fi
+ # Each of these .a files depends on stmp-dirs. It would seem that
+ # this dependency is redundant, since each of the object files
+ # itself depends on stmp-dirs. However, it is possible that there
+ # are in fact no object files. In that case, the stmp-dirs
+ # dependency is required; the directory containing the archive must
+ # exist before the archive itself can be created.
echo ""
- echo "${dir}/libgcc.a: $libgcc_a_objs"
+ echo "${dir}/libgcc.a: stmp-dirs $libgcc_a_objs"
echo " -rm -rf ${dir}/libgcc.a"
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_a_objs
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a
echo ""
- echo "${dir}/libgcov.a: $libgcov_a_objs"
+ echo "${dir}/libgcov.a: stmp-dirs $libgcov_a_objs"
echo " -rm -rf ${dir}/libgcov.a"
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcov.a $libgcov_a_objs
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcov.a
@@ -367,7 +373,7 @@ EOF
if [ "$SHLIB_LINK" ]; then
echo ""
- echo "${dir}/libgcc_eh.a: $libgcc_eh_objs"
+ echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_objs"
echo " -rm -rf ${dir}/libgcc_eh.a"
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objs
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a
diff --git a/gcc/mkmap-symver.awk b/gcc/mkmap-symver.awk
index e4bc58e1880..7953afcff80 100644
--- a/gcc/mkmap-symver.awk
+++ b/gcc/mkmap-symver.awk
@@ -95,22 +95,28 @@ function output(lib) {
if (inherit[lib])
output(inherit[lib]);
- printf("%s {\n", lib);
- sawglobal = 0;
+ empty=1
for (sym in ver)
if ((ver[sym] == lib) && (sym in def))
{
- if (!sawglobal)
+ if (empty)
{
+ printf("%s {\n", lib);
printf(" global:\n");
- sawglobal = 1;
+ empty = 0;
}
printf("\t%s;\n", sym);
if (dotsyms)
printf("\t.%s;\n", sym);
}
- if (inherit[lib])
+ if (empty)
+ {
+ for (l in libs)
+ if (inherit[l] == lib)
+ inherit[l] = inherit[lib];
+ }
+ else if (inherit[lib])
printf("} %s;\n", inherit[lib]);
else
printf ("\n local:\n\t*;\n};\n");
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index 8bc412578bf..c716e73c73f 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -86,8 +86,8 @@ $(parsedir)/objc/objc-parse.c : $(parsedir)/objc/objc-parse.y
$(parsedir)/objc/objc-parse.y: $(srcdir)/c-parse.in
echo '/*WARNING: This file is automatically generated!*/' >tmp-objc-prs.y
- sed -e "/^ifc$$/,/^end ifc$$/d" \
- -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
+ sed -e "/^@@ifc.*/,/^@@end_ifc.*/d" \
+ -e "/^@@ifobjc.*/d" -e "/^@@end_ifobjc.*/d" \
$(srcdir)/c-parse.in >>tmp-objc-prs.y
$(SHELL) $(srcdir)/move-if-change tmp-objc-prs.y $(parsedir)/objc/objc-parse.y
@@ -146,19 +146,13 @@ objc.maintainer-clean:
objc.stage1: stage1-start
-mv objc/*$(objext) stage1/objc
- -mv cc1obj$(exeext) stage1
objc.stage2: stage2-start
-mv objc/*$(objext) stage2/objc
- -mv cc1obj$(exeext) stage2
objc.stage3: stage3-start
-mv objc/*$(objext) stage3/objc
- -mv cc1obj$(exeext) stage3
objc.stage4: stage4-start
-mv objc/*$(objext) stage4/objc
- -mv cc1obj$(exeext) stage4
objc.stageprofile: stageprofile-start
-mv objc/*$(objext) stageprofile/objc
- -mv cc1obj$(exeext) stageprofile
objc.stagefeedback: stagefeedback-start
-mv objc/*$(objext) stagefeedback/objc
- -mv cc1obj$(exeext) stagefeedback
diff --git a/gcc/objc/config-lang.in b/gcc/objc/config-lang.in
index 705a76a6f69..91b86d8d573 100644
--- a/gcc/objc/config-lang.in
+++ b/gcc/objc/config-lang.in
@@ -30,7 +30,7 @@ language="objc"
compilers="cc1obj\$(exeext)"
-stagestuff=""
+stagestuff="cc1obj\$(exeext)"
target_libs=target-libobjc
diff --git a/gcc/objc/lang-specs.h b/gcc/objc/lang-specs.h
index 7c784204f86..39cbe5ca39c 100644
--- a/gcc/objc/lang-specs.h
+++ b/gcc/objc/lang-specs.h
@@ -39,8 +39,8 @@ Boston, MA 02111-1307, USA. */
"%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{gen-decls}\
%{!fsyntax-only:%(invoke_as)}}}}", 0},
{"@objective-c-header",
- "%{E|M|MM:%(trad_capable_cpp)\
- -lang-objc %(cpp_options) %(cpp_debug_options)}\
+ "%{E|M|MM:cc1obj -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}\
+ %(cpp_options) %(cpp_debug_options)}\
%{!E:%{!M:%{!MM:\
%{traditional|ftraditional|traditional-cpp:\
%eGNU Objective C no longer supports traditional compilation}\
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 3d78b099941..a0c72ebebf4 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -62,6 +62,8 @@ Boston, MA 02111-1307, USA. */
#include "diagnostic.h"
#include "cgraph.h"
+#define OBJC_VOID_AT_END build_tree_list (NULL_TREE, void_type_node)
+
/* This is the default way of generating a method name. */
/* I am not sure it is really correct.
Perhaps there's a danger that it will make name conflicts
@@ -89,19 +91,16 @@ Boston, MA 02111-1307, USA. */
#define OBJC_FORWARDING_MIN_OFFSET 0
#endif
-
/* Set up for use of obstacks. */
#include "obstack.h"
/* This obstack is used to accumulate the encoding of a data type. */
static struct obstack util_obstack;
-/* This points to the beginning of obstack contents,
- so we can free the whole contents. */
-char *util_firstobj;
-/* for encode_method_def */
-#include "rtl.h"
+/* This points to the beginning of obstack contents, so we can free
+ the whole contents. */
+char *util_firstobj;
/* The version identifies which language generation and runtime
the module (file) was compiled for, and is recorded in the
@@ -118,69 +117,74 @@ char *util_firstobj;
/* Used by compile_file. */
-static void init_objc PARAMS ((void));
-static void finish_objc PARAMS ((void));
+static void init_objc (void);
+static void finish_objc (void);
/* Code generation. */
-static void synth_module_prologue PARAMS ((void));
-static tree objc_build_constructor PARAMS ((tree, tree));
-static rtx build_module_descriptor PARAMS ((void));
-static tree init_module_descriptor PARAMS ((tree));
-static tree build_objc_method_call PARAMS ((int, tree, tree,
- tree, tree, tree));
-static void generate_strings PARAMS ((void));
-static tree get_proto_encoding PARAMS ((tree));
-static void build_selector_translation_table PARAMS ((void));
-
-static tree objc_add_static_instance PARAMS ((tree, tree));
-
-static tree build_ivar_template PARAMS ((void));
-static tree build_method_template PARAMS ((void));
-static tree build_private_template PARAMS ((tree));
-static void build_class_template PARAMS ((void));
-static void build_selector_template PARAMS ((void));
-static void build_category_template PARAMS ((void));
-static tree build_super_template PARAMS ((void));
-static tree build_category_initializer PARAMS ((tree, tree, tree,
- tree, tree, tree));
-static tree build_protocol_initializer PARAMS ((tree, tree, tree,
- tree, tree));
-
-static void synth_forward_declarations PARAMS ((void));
-static void generate_ivar_lists PARAMS ((void));
-static void generate_dispatch_tables PARAMS ((void));
-static void generate_shared_structures PARAMS ((void));
-static tree generate_protocol_list PARAMS ((tree));
-static void generate_forward_declaration_to_string_table PARAMS ((void));
-static void build_protocol_reference PARAMS ((tree));
-
-static tree build_keyword_selector PARAMS ((tree));
-static tree synth_id_with_class_suffix PARAMS ((const char *, tree));
-
-static void generate_static_references PARAMS ((void));
-static int check_methods_accessible PARAMS ((tree, tree,
- int));
-static void encode_aggregate_within PARAMS ((tree, int, int,
- int, int));
-static const char *objc_demangle PARAMS ((const char *));
-static void objc_expand_function_end PARAMS ((void));
+static void synth_module_prologue (void);
+static tree objc_build_constructor (tree, tree);
+static rtx build_module_descriptor (void);
+static tree init_module_descriptor (tree);
+static tree build_objc_method_call (int, tree, tree, tree, tree);
+static void generate_strings (void);
+static tree get_proto_encoding (tree);
+static void build_selector_translation_table (void);
+
+static tree objc_add_static_instance (tree, tree);
+
+static void build_objc_exception_stuff (void);
+static tree objc_declare_variable (enum rid, tree, tree, tree);
+static tree objc_enter_block (void);
+static tree objc_exit_block (void);
+static void objc_build_try_enter_fragment (void);
+static void objc_build_try_exit_fragment (void);
+static void objc_build_extract_fragment (void);
+static tree objc_build_extract_expr (void);
+
+static tree build_ivar_template (void);
+static tree build_method_template (void);
+static tree build_private_template (tree);
+static void build_class_template (void);
+static void build_selector_template (void);
+static void build_category_template (void);
+static tree lookup_method_in_hash_lists (tree);
+static void build_super_template (void);
+static tree build_category_initializer (tree, tree, tree, tree, tree, tree);
+static tree build_protocol_initializer (tree, tree, tree, tree, tree);
+static void synth_forward_declarations (void);
+static int ivar_list_length (tree);
+static tree get_class_ivars (tree, int);
+static void generate_ivar_lists (void);
+static void generate_dispatch_tables (void);
+static void generate_shared_structures (void);
+static tree generate_protocol_list (tree);
+static void generate_forward_declaration_to_string_table (void);
+static void build_protocol_reference (tree);
+
+static tree build_keyword_selector (tree);
+static tree synth_id_with_class_suffix (const char *, tree);
+
+static void generate_static_references (void);
+static int check_methods_accessible (tree, tree, int);
+static void encode_aggregate_within (tree, int, int, int, int);
+static const char *objc_demangle (const char *);
+static void objc_expand_function_end (void);
/* Hash tables to manage the global pool of method prototypes. */
hash *nst_method_hash_list = 0;
hash *cls_method_hash_list = 0;
-static size_t hash_func PARAMS ((tree));
-static void hash_init PARAMS ((void));
-static void hash_enter PARAMS ((hash *, tree));
-static hash hash_lookup PARAMS ((hash *, tree));
-static void hash_add_attr PARAMS ((hash, tree));
-static tree lookup_method PARAMS ((tree, tree));
-static tree lookup_instance_method_static PARAMS ((tree, tree));
-static tree lookup_class_method_static PARAMS ((tree, tree));
-static tree add_class PARAMS ((tree));
-static void add_category PARAMS ((tree, tree));
+static size_t hash_func (tree);
+static void hash_init (void);
+static void hash_enter (hash *, tree);
+static hash hash_lookup (hash *, tree);
+static void hash_add_attr (hash, tree);
+static tree lookup_method (tree, tree);
+static tree lookup_method_static (tree, tree, int);
+static tree add_class (tree);
+static void add_category (tree, tree);
enum string_section
{
@@ -189,113 +193,105 @@ enum string_section
meth_var_types /* method and variable type descriptors */
};
-static tree add_objc_string PARAMS ((tree,
- enum string_section));
-static tree get_objc_string_decl PARAMS ((tree,
- enum string_section));
-static tree build_objc_string_decl PARAMS ((enum string_section));
-static tree build_selector_reference_decl PARAMS ((void));
+static tree add_objc_string (tree, enum string_section);
+static tree get_objc_string_decl (tree, enum string_section);
+static tree build_objc_string_decl (enum string_section);
+static tree build_selector_reference_decl (void);
/* Protocol additions. */
-static tree add_protocol PARAMS ((tree));
-static tree lookup_protocol PARAMS ((tree));
-static void check_protocol_recursively PARAMS ((tree, tree));
-static tree lookup_and_install_protocols PARAMS ((tree));
+static tree add_protocol (tree);
+static tree lookup_protocol (tree);
+static void check_protocol_recursively (tree, tree);
+static tree lookup_and_install_protocols (tree);
/* Type encoding. */
-static void encode_type_qualifiers PARAMS ((tree));
-static void encode_pointer PARAMS ((tree, int, int));
-static void encode_array PARAMS ((tree, int, int));
-static void encode_aggregate PARAMS ((tree, int, int));
-static void encode_bitfield PARAMS ((int));
-static void encode_type PARAMS ((tree, int, int));
-static void encode_field_decl PARAMS ((tree, int, int));
-
-static void really_start_method PARAMS ((tree, tree));
-static int comp_method_with_proto PARAMS ((tree, tree));
-static int comp_proto_with_proto PARAMS ((tree, tree));
-static tree get_arg_type_list PARAMS ((tree, int, int));
-static tree objc_expr_last PARAMS ((tree));
+static void encode_type_qualifiers (tree);
+static void encode_pointer (tree, int, int);
+static void encode_array (tree, int, int);
+static void encode_aggregate (tree, int, int);
+static void encode_next_bitfield (int);
+static void encode_gnu_bitfield (int, tree, int);
+static void encode_type (tree, int, int);
+static void encode_field_decl (tree, int, int);
+
+static void really_start_method (tree, tree);
+static int comp_method_with_proto (tree, tree);
+static int objc_types_are_equivalent (tree, tree);
+static int comp_proto_with_proto (tree, tree);
+static tree get_arg_type_list (tree, int, int);
+static tree objc_expr_last (tree);
+static void synth_self_and_ucmd_args (void);
/* Utilities for debugging and error diagnostics. */
-static void warn_with_method PARAMS ((const char *, int, tree));
-static void error_with_ivar PARAMS ((const char *, tree, tree));
-static char *gen_method_decl PARAMS ((tree, char *));
-static char *gen_declaration PARAMS ((tree, char *));
-static void gen_declaration_1 PARAMS ((tree, char *));
-static char *gen_declarator PARAMS ((tree, char *,
- const char *));
-static int is_complex_decl PARAMS ((tree));
-static void adorn_decl PARAMS ((tree, char *));
-static void dump_interface PARAMS ((FILE *, tree));
+static void warn_with_method (const char *, int, tree);
+static void error_with_ivar (const char *, tree, tree);
+static char *gen_method_decl (tree, char *);
+static char *gen_declaration (tree, char *);
+static void gen_declaration_1 (tree, char *);
+static char *gen_declarator (tree, char *, const char *);
+static int is_complex_decl (tree);
+static void adorn_decl (tree, char *);
+static void dump_interface (FILE *, tree);
/* Everything else. */
-static tree define_decl PARAMS ((tree, tree));
-static tree lookup_method_in_protocol_list PARAMS ((tree, tree, int));
-static tree lookup_protocol_in_reflist PARAMS ((tree, tree));
-static tree create_builtin_decl PARAMS ((enum tree_code,
- tree, const char *));
-static void setup_string_decl PARAMS ((void));
-static void build_string_class_template PARAMS ((void));
-static tree my_build_string PARAMS ((int, const char *));
-static void build_objc_symtab_template PARAMS ((void));
-static tree init_def_list PARAMS ((tree));
-static tree init_objc_symtab PARAMS ((tree));
-static void forward_declare_categories PARAMS ((void));
-static void generate_objc_symtab_decl PARAMS ((void));
-static tree build_selector PARAMS ((tree));
-static tree build_typed_selector_reference PARAMS ((tree, tree));
-static tree build_selector_reference PARAMS ((tree));
-static tree build_class_reference_decl PARAMS ((void));
-static void add_class_reference PARAMS ((tree));
-static tree build_protocol_template PARAMS ((void));
-static tree build_descriptor_table_initializer PARAMS ((tree, tree));
-static tree build_method_prototype_list_template PARAMS ((tree, int));
-static tree build_method_prototype_template PARAMS ((void));
-static int forwarding_offset PARAMS ((tree));
-static tree encode_method_prototype PARAMS ((tree, tree));
-static tree generate_descriptor_table PARAMS ((tree, const char *,
- int, tree, tree));
-static void generate_method_descriptors PARAMS ((tree));
-static tree build_tmp_function_decl PARAMS ((void));
-static void hack_method_prototype PARAMS ((tree, tree));
-static void generate_protocol_references PARAMS ((tree));
-static void generate_protocols PARAMS ((void));
-static void check_ivars PARAMS ((tree, tree));
-static tree build_ivar_list_template PARAMS ((tree, int));
-static tree build_method_list_template PARAMS ((tree, int));
-static tree build_ivar_list_initializer PARAMS ((tree, tree));
-static tree generate_ivars_list PARAMS ((tree, const char *,
- int, tree));
-static tree build_dispatch_table_initializer PARAMS ((tree, tree));
-static tree generate_dispatch_table PARAMS ((tree, const char *,
- int, tree));
-static tree build_shared_structure_initializer PARAMS ((tree, tree, tree, tree,
- tree, int, tree, tree,
- tree));
-static void generate_category PARAMS ((tree));
-static int is_objc_type_qualifier PARAMS ((tree));
-static tree adjust_type_for_id_default PARAMS ((tree));
-static tree check_duplicates PARAMS ((hash));
-static tree receiver_is_class_object PARAMS ((tree));
-static int check_methods PARAMS ((tree, tree, int));
-static int conforms_to_protocol PARAMS ((tree, tree));
-static void check_protocol PARAMS ((tree, const char *,
- const char *));
-static void check_protocols PARAMS ((tree, const char *,
- const char *));
-static tree encode_method_def PARAMS ((tree));
-static void gen_declspecs PARAMS ((tree, char *, int));
-static void generate_classref_translation_entry PARAMS ((tree));
-static void handle_class_ref PARAMS ((tree));
-static void generate_struct_by_value_array PARAMS ((void))
+static tree define_decl (tree, tree);
+static tree lookup_method_in_protocol_list (tree, tree, int);
+static tree lookup_protocol_in_reflist (tree, tree);
+static tree create_builtin_decl (enum tree_code, tree, const char *);
+static void setup_string_decl (void);
+static int check_string_class_template (void);
+static tree my_build_string (int, const char *);
+static void build_objc_symtab_template (void);
+static tree init_def_list (tree);
+static tree init_objc_symtab (tree);
+static tree build_metadata_decl (const char *, tree);
+static void forward_declare_categories (void);
+static void generate_objc_symtab_decl (void);
+static tree build_selector (tree);
+static tree build_typed_selector_reference (tree, tree);
+static tree build_selector_reference (tree);
+static tree build_class_reference_decl (void);
+static void add_class_reference (tree);
+static tree build_protocol_template (void);
+static tree build_descriptor_table_initializer (tree, tree);
+static tree build_method_prototype_list_template (tree, int);
+static tree build_method_prototype_template (void);
+static tree objc_method_parm_type (tree);
+static int objc_encoded_type_size (tree);
+static tree encode_method_prototype (tree);
+static tree generate_descriptor_table (tree, const char *, int, tree, tree);
+static void generate_method_descriptors (tree);
+static void generate_protocol_references (tree);
+static void generate_protocols (void);
+static void check_ivars (tree, tree);
+static tree build_ivar_list_template (tree, int);
+static tree build_method_list_template (tree, int);
+static tree build_ivar_list_initializer (tree, tree);
+static tree generate_ivars_list (tree, const char *, int, tree);
+static tree build_dispatch_table_initializer (tree, tree);
+static tree generate_dispatch_table (tree, const char *, int, tree);
+static tree build_shared_structure_initializer (tree, tree, tree, tree,
+ tree, int, tree, tree, tree);
+static void generate_category (tree);
+static int is_objc_type_qualifier (tree);
+static tree adjust_type_for_id_default (tree);
+static tree check_duplicates (hash, int);
+static tree receiver_is_class_object (tree, int, int);
+static int check_methods (tree, tree, int);
+static int conforms_to_protocol (tree, tree);
+static void check_protocol (tree, const char *, const char *);
+static void check_protocols (tree, const char *, const char *);
+static void gen_declspecs (tree, char *, int);
+static void generate_classref_translation_entry (tree);
+static void handle_class_ref (tree);
+static void generate_struct_by_value_array (void)
ATTRIBUTE_NORETURN;
-static void encode_complete_bitfield PARAMS ((int, tree, int));
-static void mark_referenced_methods PARAMS ((void));
+static void mark_referenced_methods (void);
+static void generate_objc_image_info (void);
/*** Private Interface (data) ***/
@@ -324,7 +320,7 @@ static void mark_referenced_methods PARAMS ((void));
/* Note that the string object global name is only needed for the
NeXT runtime. */
-#define STRING_OBJECT_GLOBAL_NAME "_NSConstantStringClassReference"
+#define STRING_OBJECT_GLOBAL_FORMAT "_%sClassReference"
#define PROTOCOL_OBJECT_CLASS_NAME "Protocol"
@@ -332,19 +328,71 @@ static const char *TAG_GETCLASS;
static const char *TAG_GETMETACLASS;
static const char *TAG_MSGSEND;
static const char *TAG_MSGSENDSUPER;
+/* The NeXT Objective-C messenger may have two extra entry points, for use
+ when returning a structure. */
+static const char *TAG_MSGSEND_STRET;
+static const char *TAG_MSGSENDSUPER_STRET;
static const char *TAG_EXECCLASS;
static const char *default_constant_string_class_name;
+/* Runtime metadata flags. */
+#define CLS_FACTORY 0x0001L
+#define CLS_META 0x0002L
+
+#define OBJC_MODIFIER_STATIC 0x00000001
+#define OBJC_MODIFIER_FINAL 0x00000002
+#define OBJC_MODIFIER_PUBLIC 0x00000004
+#define OBJC_MODIFIER_PRIVATE 0x00000008
+#define OBJC_MODIFIER_PROTECTED 0x00000010
+#define OBJC_MODIFIER_NATIVE 0x00000020
+#define OBJC_MODIFIER_SYNCHRONIZED 0x00000040
+#define OBJC_MODIFIER_ABSTRACT 0x00000080
+#define OBJC_MODIFIER_VOLATILE 0x00000100
+#define OBJC_MODIFIER_TRANSIENT 0x00000200
+#define OBJC_MODIFIER_NONE_SPECIFIED 0x80000000
+
+#define TAG_MSGSEND_NONNIL "objc_msgSendNonNil"
+#define TAG_MSGSEND_NONNIL_STRET "objc_msgSendNonNil_stret"
+#define TAG_EXCEPTIONEXTRACT "objc_exception_extract"
+#define TAG_EXCEPTIONTRYENTER "objc_exception_try_enter"
+#define TAG_EXCEPTIONTRYEXIT "objc_exception_try_exit"
+#define TAG_EXCEPTIONMATCH "objc_exception_match"
+#define TAG_EXCEPTIONTHROW "objc_exception_throw"
+#define TAG_SYNCENTER "objc_sync_enter"
+#define TAG_SYNCEXIT "objc_sync_exit"
+#define TAG_SETJMP "_setjmp"
+#define TAG_RETURN_STRUCT "objc_return_struct"
+
+#define UTAG_EXCDATA "_objc_exception_data"
+#define UTAG_EXCDATA_VAR "_stackExceptionData"
+#define UTAG_CAUGHTEXC_VAR "_caughtException"
+#define UTAG_RETHROWEXC_VAR "_rethrowException"
+#define UTAG_EVALONCE_VAR "_eval_once"
+
+struct val_stack {
+ long val;
+ struct val_stack *next;
+};
+static struct val_stack *catch_count_stack, *exc_binding_stack;
+
+/* useful for debugging */
+static int if_nesting_count;
+static int blk_nesting_count;
+
+static void val_stack_push (struct val_stack **, long);
+static void val_stack_pop (struct val_stack **);
+
/* The OCTI_... enumeration itself is in objc/objc-act.h. */
tree objc_global_trees[OCTI_MAX];
-static void handle_impent PARAMS ((struct imp_entry *));
+static void handle_impent (struct imp_entry *);
struct imp_entry *imp_list = 0;
int imp_count = 0; /* `@implementation' */
int cat_count = 0; /* `@category' */
-static int method_slot = 0; /* Used by start_method_def, */
+/* Use to generate method labels. */
+static int method_slot = 0;
#define BUFSIZE 1024
@@ -374,7 +422,7 @@ static int generating_instance_variables = 0;
the transition point between the two possibilities. */
static void
-generate_struct_by_value_array ()
+generate_struct_by_value_array (void)
{
tree type;
tree field_decl, field_decl_chain;
@@ -405,12 +453,12 @@ generate_struct_by_value_array ()
chainon (field_decl_chain, field_decl);
}
finish_struct (type, field_decl_chain, NULL_TREE);
-
- aggregate_in_mem[i] = aggregate_value_p (type);
+
+ aggregate_in_mem[i] = aggregate_value_p (type, 0);
if (!aggregate_in_mem[i])
found = 1;
}
-
+
/* We found some structures that are returned in registers instead of memory
so output the necessary data. */
if (found)
@@ -419,21 +467,21 @@ generate_struct_by_value_array ()
if (!aggregate_in_mem[i])
break;
printf ("#define OBJC_MAX_STRUCT_BY_VALUE %d\n\n", i);
-
+
/* The first member of the structure is always 0 because we don't handle
structures with 0 members */
printf ("static int struct_forward_array[] = {\n 0");
-
+
for (j = 1; j <= i; j++)
printf (", %d", aggregate_in_mem[j]);
printf ("\n};\n");
}
-
+
exit (0);
}
bool
-objc_init ()
+objc_init (void)
{
if (c_objc_common_init () == false)
return false;
@@ -459,6 +507,8 @@ objc_init ()
TAG_GETMETACLASS = "objc_getMetaClass";
TAG_MSGSEND = "objc_msgSend";
TAG_MSGSENDSUPER = "objc_msgSendSuper";
+ TAG_MSGSEND_STRET = "objc_msgSend_stret";
+ TAG_MSGSENDSUPER_STRET = "objc_msgSendSuper_stret";
TAG_EXECCLASS = "__objc_execClass";
default_constant_string_class_name = "NSConstantString";
}
@@ -468,6 +518,8 @@ objc_init ()
TAG_GETMETACLASS = "objc_get_meta_class";
TAG_MSGSEND = "objc_msg_lookup";
TAG_MSGSENDSUPER = "objc_msg_lookup_super";
+ /* GNU runtime does not provide special functions to support
+ structure-returning methods. */
TAG_EXECCLASS = "__objc_exec_class";
default_constant_string_class_name = "NXConstantString";
flag_typed_selectors = 1;
@@ -484,7 +536,7 @@ objc_init ()
}
void
-finish_file ()
+finish_file (void)
{
mark_referenced_methods ();
c_objc_common_finish_file ();
@@ -499,32 +551,16 @@ finish_file ()
}
static tree
-define_decl (declarator, declspecs)
- tree declarator;
- tree declspecs;
+define_decl (tree declarator, tree declspecs)
{
tree decl = start_decl (declarator, declspecs, 0, NULL_TREE);
finish_decl (decl, NULL_TREE, NULL_TREE);
return decl;
}
-/* Return 1 if LHS and RHS are compatible types for assignment or
- various other operations. Return 0 if they are incompatible, and
- return -1 if we choose to not decide. When the operation is
- REFLEXIVE, check for compatibility in either direction.
-
- For statically typed objects, an assignment of the form `a' = `b'
- is permitted if:
-
- `a' is of type "id",
- `a' and `b' are the same class type, or
- `a' and `b' are of class types A and B such that B is a descendant of A. */
-
static tree
-lookup_method_in_protocol_list (rproto_list, sel_name, class_meth)
- tree rproto_list;
- tree sel_name;
- int class_meth;
+lookup_method_in_protocol_list (tree rproto_list, tree sel_name,
+ int class_meth)
{
tree rproto, p;
tree fnd = 0;
@@ -556,9 +592,7 @@ lookup_method_in_protocol_list (rproto_list, sel_name, class_meth)
}
static tree
-lookup_protocol_in_reflist (rproto_list, lproto)
- tree rproto_list;
- tree lproto;
+lookup_protocol_in_reflist (tree rproto_list, tree lproto)
{
tree rproto, p;
@@ -611,10 +645,7 @@ lookup_protocol_in_reflist (rproto_list, lproto)
*/
int
-objc_comptypes (lhs, rhs, reflexive)
- tree lhs;
- tree rhs;
- int reflexive;
+objc_comptypes (tree lhs, tree rhs, int reflexive)
{
/* New clause for protocols. */
@@ -638,20 +669,20 @@ objc_comptypes (lhs, rhs, reflexive)
if (rhs_is_proto)
{
rproto_list = TYPE_PROTOCOL_LIST (rhs);
-
+
if (!reflexive)
{
/* An assignment between objects of type 'id
<Protocol>'; make sure the protocol on the lhs is
supported by the object on the rhs. */
- for (lproto = lproto_list; lproto;
+ for (lproto = lproto_list; lproto;
lproto = TREE_CHAIN (lproto))
{
p = TREE_VALUE (lproto);
rproto = lookup_protocol_in_reflist (rproto_list, p);
if (!rproto)
- warning
+ warning
("object does not conform to the `%s' protocol",
IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
}
@@ -663,20 +694,20 @@ objc_comptypes (lhs, rhs, reflexive)
of type 'id <Protocol>'. Check that either the
protocol on the lhs is supported by the object on
the rhs, or viceversa. */
-
+
/* Check if the protocol on the lhs is supported by the
object on the rhs. */
- for (lproto = lproto_list; lproto;
+ for (lproto = lproto_list; lproto;
lproto = TREE_CHAIN (lproto))
{
p = TREE_VALUE (lproto);
rproto = lookup_protocol_in_reflist (rproto_list, p);
-
+
if (!rproto)
{
/* Check failed - check if the protocol on the rhs
is supported by the object on the lhs. */
- for (rproto = rproto_list; rproto;
+ for (rproto = rproto_list; rproto;
rproto = TREE_CHAIN (rproto))
{
p = TREE_VALUE (rproto);
@@ -698,7 +729,7 @@ objc_comptypes (lhs, rhs, reflexive)
/* <Protocol> = <class> * */
else if (TYPED_OBJECT (TREE_TYPE (rhs)))
{
- tree rname = TYPE_NAME (TREE_TYPE (rhs));
+ tree rname = OBJC_TYPE_NAME (TREE_TYPE (rhs));
tree rinter;
/* Make sure the protocol is supported by the object on
@@ -739,18 +770,18 @@ objc_comptypes (lhs, rhs, reflexive)
if (!rproto)
warning ("class `%s' does not implement the `%s' protocol",
- IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (rhs))),
+ IDENTIFIER_POINTER (OBJC_TYPE_NAME (TREE_TYPE (rhs))),
IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
}
return 1;
}
/* <Protocol> = id */
- else if (TYPE_NAME (TREE_TYPE (rhs)) == objc_object_id)
+ else if (OBJC_TYPE_NAME (TREE_TYPE (rhs)) == objc_object_id)
{
return 1;
}
/* <Protocol> = Class */
- else if (TYPE_NAME (TREE_TYPE (rhs)) == objc_class_id)
+ else if (OBJC_TYPE_NAME (TREE_TYPE (rhs)) == objc_class_id)
{
return 0;
}
@@ -764,13 +795,13 @@ objc_comptypes (lhs, rhs, reflexive)
{
if (reflexive)
{
- tree rname = TYPE_NAME (TREE_TYPE (lhs));
+ tree rname = OBJC_TYPE_NAME (TREE_TYPE (lhs));
tree rinter;
tree rproto, rproto_list = TYPE_PROTOCOL_LIST (rhs);
-
+
/* Make sure the protocol is supported by the object on
the lhs. */
- for (rproto = rproto_list; rproto;
+ for (rproto = rproto_list; rproto;
rproto = TREE_CHAIN (rproto))
{
tree p = TREE_VALUE (rproto);
@@ -790,9 +821,9 @@ objc_comptypes (lhs, rhs, reflexive)
lhs. */
if (!lproto)
{
- lproto_list = TYPE_PROTOCOL_LIST
+ lproto_list = TYPE_PROTOCOL_LIST
(TREE_TYPE (lhs));
- lproto = lookup_protocol_in_reflist
+ lproto = lookup_protocol_in_reflist
(lproto_list, p);
}
@@ -805,14 +836,14 @@ objc_comptypes (lhs, rhs, reflexive)
p);
cat = CLASS_CATEGORY_LIST (cat);
}
-
- rinter = lookup_interface (CLASS_SUPER_NAME
+
+ rinter = lookup_interface (CLASS_SUPER_NAME
(rinter));
}
-
+
if (!lproto)
warning ("class `%s' does not implement the `%s' protocol",
- IDENTIFIER_POINTER (TYPE_NAME
+ IDENTIFIER_POINTER (OBJC_TYPE_NAME
(TREE_TYPE (lhs))),
IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
}
@@ -822,12 +853,12 @@ objc_comptypes (lhs, rhs, reflexive)
return 0;
}
/* id = <Protocol> */
- else if (TYPE_NAME (TREE_TYPE (lhs)) == objc_object_id)
+ else if (OBJC_TYPE_NAME (TREE_TYPE (lhs)) == objc_object_id)
{
return 1;
}
/* Class = <Protocol> */
- else if (TYPE_NAME (TREE_TYPE (lhs)) == objc_class_id)
+ else if (OBJC_TYPE_NAME (TREE_TYPE (lhs)) == objc_class_id)
{
return 0;
}
@@ -856,28 +887,28 @@ objc_comptypes (lhs, rhs, reflexive)
}
/* `id' = `<class> *' `<class> *' = `id': always allow it.
- Please note that
+ Please note that
'Object *o = [[Object alloc] init]; falls
in the case <class> * = `id'.
*/
- if ((TYPE_NAME (lhs) == objc_object_id && TYPED_OBJECT (rhs))
- || (TYPE_NAME (rhs) == objc_object_id && TYPED_OBJECT (lhs)))
+ if ((OBJC_TYPE_NAME (lhs) == objc_object_id && TYPED_OBJECT (rhs))
+ || (OBJC_TYPE_NAME (rhs) == objc_object_id && TYPED_OBJECT (lhs)))
return 1;
/* `id' = `Class', `Class' = `id' */
- else if ((TYPE_NAME (lhs) == objc_object_id
- && TYPE_NAME (rhs) == objc_class_id)
- || (TYPE_NAME (lhs) == objc_class_id
- && TYPE_NAME (rhs) == objc_object_id))
+ else if ((OBJC_TYPE_NAME (lhs) == objc_object_id
+ && OBJC_TYPE_NAME (rhs) == objc_class_id)
+ || (OBJC_TYPE_NAME (lhs) == objc_class_id
+ && OBJC_TYPE_NAME (rhs) == objc_object_id))
return 1;
/* `<class> *' = `<class> *' */
else if (TYPED_OBJECT (lhs) && TYPED_OBJECT (rhs))
{
- tree lname = TYPE_NAME (lhs);
- tree rname = TYPE_NAME (rhs);
+ tree lname = OBJC_TYPE_NAME (lhs);
+ tree rname = OBJC_TYPE_NAME (rhs);
tree inter;
if (lname == rname)
@@ -904,26 +935,25 @@ objc_comptypes (lhs, rhs, reflexive)
return -1;
}
-/* Called from c-decl.c before all calls to rest_of_decl_compilation. */
+/* Called from finish_decl. */
void
-objc_check_decl (decl)
- tree decl;
+objc_check_decl (tree decl)
{
tree type = TREE_TYPE (decl);
- if (TREE_CODE (type) == RECORD_TYPE
- && TREE_STATIC_TEMPLATE (type)
+ if (TREE_CODE (type) != RECORD_TYPE)
+ return;
+ if (TYPE_NAME (type) && (type = is_class_name (TYPE_NAME (type)))
&& type != constant_string_type)
- error_with_decl (decl, "`%s' cannot be statically allocated");
+ error ("statically allocated instance of Objective-C class `%s'",
+ IDENTIFIER_POINTER (type));
}
/* Implement static typing. At this point, we know we have an interface. */
tree
-get_static_reference (interface, protocols)
- tree interface;
- tree protocols;
+get_static_reference (tree interface, tree protocols)
{
tree type = xref_tag (RECORD_TYPE, interface);
@@ -939,7 +969,7 @@ get_static_reference (interface, protocols)
/* Look up protocols and install in lang specific list. Note
that the protocol list can have a different lifetime than T! */
- TYPE_PROTOCOL_LIST (t) = lookup_and_install_protocols (protocols);
+ SET_TYPE_PROTOCOL_LIST (t, lookup_and_install_protocols (protocols));
/* This forces a new pointer type to be created later
(in build_pointer_type)...so that the new template
@@ -954,8 +984,7 @@ get_static_reference (interface, protocols)
}
tree
-get_object_reference (protocols)
- tree protocols;
+get_object_reference (tree protocols)
{
tree type_decl = lookup_name (objc_id_id);
tree type;
@@ -988,7 +1017,7 @@ get_object_reference (protocols)
TYPE_NEXT_VARIANT (m) = t;
/* Look up protocols...and install in lang specific list */
- TYPE_PROTOCOL_LIST (t) = lookup_and_install_protocols (protocols);
+ SET_TYPE_PROTOCOL_LIST (t, lookup_and_install_protocols (protocols));
/* This forces a new pointer type to be created later
(in build_pointer_type)...so that the new template
@@ -1005,10 +1034,8 @@ get_object_reference (protocols)
PROTO, the protocol to check, and LIST, a list of protocol it
conforms to. */
-static void
-check_protocol_recursively (proto, list)
- tree proto;
- tree list;
+static void
+check_protocol_recursively (tree proto, tree list)
{
tree p;
@@ -1021,19 +1048,20 @@ check_protocol_recursively (proto, list)
if (pp == proto)
fatal_error ("protocol `%s' has circular dependency",
- IDENTIFIER_POINTER (PROTOCOL_NAME (pp)));
+ IDENTIFIER_POINTER (PROTOCOL_NAME (pp)));
if (pp)
check_protocol_recursively (proto, PROTOCOL_LIST (pp));
}
}
+/* Look up PROTOCOLS, and return a list of those that are found.
+ If none are found, return NULL. */
+
static tree
-lookup_and_install_protocols (protocols)
- tree protocols;
+lookup_and_install_protocols (tree protocols)
{
tree proto;
- tree prev = NULL;
- tree return_value = protocols;
+ tree return_value = NULL_TREE;
for (proto = protocols; proto; proto = TREE_CHAIN (proto))
{
@@ -1041,20 +1069,11 @@ lookup_and_install_protocols (protocols)
tree p = lookup_protocol (ident);
if (!p)
- {
- error ("cannot find protocol declaration for `%s'",
- IDENTIFIER_POINTER (ident));
- if (prev)
- TREE_CHAIN (prev) = TREE_CHAIN (proto);
- else
- return_value = TREE_CHAIN (proto);
- }
+ error ("cannot find protocol declaration for `%s'",
+ IDENTIFIER_POINTER (ident));
else
- {
- /* Replace identifier with actual protocol node. */
- TREE_VALUE (proto) = p;
- prev = proto;
- }
+ return_value = chainon (return_value,
+ build_tree_list (NULL_TREE, p));
}
return return_value;
@@ -1065,10 +1084,7 @@ lookup_and_install_protocols (protocols)
TYPE is its data type. */
static tree
-create_builtin_decl (code, type, name)
- enum tree_code code;
- tree type;
- const char *name;
+create_builtin_decl (enum tree_code code, tree type, const char *name)
{
tree decl = build_decl (code, get_identifier (name), type);
@@ -1077,21 +1093,31 @@ create_builtin_decl (code, type, name)
TREE_STATIC (decl) = 1;
make_decl_rtl (decl, 0);
pushdecl (decl);
+ DECL_ARTIFICIAL (decl) = 1;
}
- DECL_ARTIFICIAL (decl) = 1;
return decl;
}
/* Find the decl for the constant string class. */
static void
-setup_string_decl ()
+setup_string_decl (void)
{
if (!string_class_decl)
{
if (!constant_string_global_id)
- constant_string_global_id = get_identifier (STRING_OBJECT_GLOBAL_NAME);
+ {
+ char *name;
+ size_t length;
+ /* %s in format will provide room for terminating null */
+ length = strlen (STRING_OBJECT_GLOBAL_FORMAT)
+ + strlen (constant_string_class_name);
+ name = xmalloc (length);
+ sprintf (name, STRING_OBJECT_GLOBAL_FORMAT,
+ constant_string_class_name);
+ constant_string_global_id = get_identifier (name);
+ }
string_class_decl = lookup_name (constant_string_global_id);
}
}
@@ -1101,17 +1127,16 @@ setup_string_decl ()
Model:
- type_spec--------->sc_spec
- (tree_list) (tree_list)
- | |
- | |
- identifier_node identifier_node */
+ type_spec--------->sc_spec
+ (tree_list) (tree_list)
+ | |
+ | |
+ identifier_node identifier_node */
static void
-synth_module_prologue ()
+synth_module_prologue (void)
{
tree temp_type;
- tree super_p;
/* Defined in `objc.h' */
objc_object_id = get_identifier (TAG_OBJECT);
@@ -1124,8 +1149,10 @@ synth_module_prologue ()
objc_class_id = get_identifier (TAG_CLASS);
objc_class_type = build_pointer_type (xref_tag (RECORD_TYPE, objc_class_id));
+ temp_type = get_identifier (PROTOCOL_OBJECT_CLASS_NAME);
+ objc_declare_class (tree_cons (NULL_TREE, temp_type, NULL_TREE));
protocol_type = build_pointer_type (xref_tag (RECORD_TYPE,
- get_identifier (PROTOCOL_OBJECT_CLASS_NAME)));
+ temp_type));
/* Declare type of selector-objects that represent an operation name. */
@@ -1137,7 +1164,8 @@ synth_module_prologue ()
/* Forward declare type, or else the prototype for msgSendSuper will
complain. */
- super_p = build_pointer_type (xref_tag (RECORD_TYPE,
+ /* `struct objc_super *' */
+ super_type = build_pointer_type (xref_tag (RECORD_TYPE,
get_identifier (TAG_SUPER)));
@@ -1162,14 +1190,21 @@ synth_module_prologue ()
pushdecl (umsg_decl);
}
else
- umsg_decl = builtin_function (TAG_MSGSEND, temp_type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ {
+ umsg_decl = builtin_function (TAG_MSGSEND,
+ temp_type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ /* id objc_msgSendNonNil (id, SEL, ...); */
+ umsg_nonnil_decl = builtin_function (TAG_MSGSEND_NONNIL,
+ temp_type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ }
/* id objc_msgSendSuper (struct objc_super *, SEL, ...); */
temp_type
= build_function_type (id_type,
- tree_cons (NULL_TREE, super_p,
+ tree_cons (NULL_TREE, super_type,
tree_cons (NULL_TREE, selector_type,
NULL_TREE)));
@@ -1177,13 +1212,68 @@ synth_module_prologue ()
temp_type, 0, NOT_BUILT_IN,
NULL, NULL_TREE);
+ /* The NeXT runtime defines the following additional entry points,
+ used for dispatching calls to methods returning structs:
+
+ #if defined(__cplusplus)
+ id objc_msgSend_stret(id self, SEL op, ...);
+ id objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...);
+ #else
+ void objc_msgSend_stret(void * stretAddr, id self, SEL op, ...);
+ void objc_msgSendSuper_stret(void * stretAddr, struct objc_super *super,
+ SEL op, ...);
+ #endif
+
+ struct objc_return_struct objc_msgSendNonNil_stret(id self, SEL op, ...);
+
+ These prototypes appear in <objc/objc-runtime.h>; however, they
+ CANNOT BE USED DIRECTLY. In order to call one of the ..._stret
+ functions, the function must first be cast to a signature that
+ corresponds to the actual ObjC method being invoked. This is
+ what is done by the build_objc_method_call() routine below. */
+
+ if (flag_next_runtime)
+ {
+ tree objc_return_struct_type
+ = xref_tag (RECORD_TYPE,
+ get_identifier (TAG_RETURN_STRUCT));
+
+ tree stret_temp_type
+ = build_function_type (id_type,
+ tree_cons (NULL_TREE, id_type,
+ tree_cons (NULL_TREE, selector_type,
+ NULL_TREE)));
+
+ umsg_stret_decl = builtin_function (TAG_MSGSEND_STRET,
+ stret_temp_type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ stret_temp_type
+ = build_function_type (objc_return_struct_type,
+ tree_cons (NULL_TREE, id_type,
+ tree_cons (NULL_TREE, selector_type,
+ NULL_TREE)));
+
+ umsg_nonnil_stret_decl = builtin_function (TAG_MSGSEND_NONNIL_STRET,
+ stret_temp_type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ stret_temp_type
+ = build_function_type (id_type,
+ tree_cons (NULL_TREE, super_type,
+ tree_cons (NULL_TREE, selector_type,
+ NULL_TREE)));
+
+ umsg_super_stret_decl = builtin_function (TAG_MSGSENDSUPER_STRET,
+ stret_temp_type, 0, NOT_BUILT_IN, 0,
+ NULL_TREE);
+ }
+
/* id objc_getClass (const char *); */
temp_type = build_function_type (id_type,
- tree_cons (NULL_TREE,
- const_string_type_node,
- tree_cons (NULL_TREE, void_type_node,
- NULL_TREE)));
+ tree_cons (NULL_TREE,
+ const_string_type_node,
+ OBJC_VOID_AT_END));
objc_get_class_decl
= builtin_function (TAG_GETCLASS, temp_type, 0, NOT_BUILT_IN,
@@ -1192,8 +1282,11 @@ synth_module_prologue ()
/* id objc_getMetaClass (const char *); */
objc_get_meta_class_decl
- = builtin_function (TAG_GETMETACLASS, temp_type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ = builtin_function (TAG_GETMETACLASS, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+
+ build_super_template ();
+ if (flag_next_runtime)
+ build_objc_exception_stuff ();
/* static SEL _OBJC_SELECTOR_TABLE[]; */
@@ -1233,76 +1326,104 @@ synth_module_prologue ()
constant_string_class_name = default_constant_string_class_name;
constant_string_id = get_identifier (constant_string_class_name);
- constant_string_type = xref_tag (RECORD_TYPE, constant_string_id);
+ objc_declare_class (tree_cons (NULL_TREE, constant_string_id, NULL_TREE));
+
+ /* Pre-build the following entities - for speed/convenience. */
+ self_id = get_identifier ("self");
+ ucmd_id = get_identifier ("_cmd");
+#ifndef OBJCPLUS
+ /* The C++ front-end does not appear to grok __attribute__((__unused__)). */
+ unused_list = build_tree_list (get_identifier ("__unused__"), NULL_TREE);
+#endif
}
-/* Predefine the following data type:
+/* Ensure that the ivar list for NSConstantString/NXConstantString
+ (or whatever was specified via `-fconstant-string-class')
+ contains fields at least as large as the following three, so that
+ the runtime can stomp on them with confidence:
- struct STRING_OBJECT_CLASS_NAME
+ struct STRING_OBJECT_CLASS_NAME
{
Object isa;
char *cString;
unsigned int length;
}; */
-static void
-build_string_class_template ()
+static int
+check_string_class_template (void)
{
- tree field_decl, field_decl_chain;
+ tree field_decl = TYPE_FIELDS (constant_string_type);
- field_decl = create_builtin_decl (FIELD_DECL, id_type, "isa");
- field_decl_chain = field_decl;
+#define AT_LEAST_AS_LARGE_AS(F, T) \
+ (F && TREE_CODE (F) == FIELD_DECL \
+ && (TREE_INT_CST_LOW (DECL_SIZE (F)) \
+ >= TREE_INT_CST_LOW (TYPE_SIZE (T))))
- field_decl = create_builtin_decl (FIELD_DECL,
- build_pointer_type (char_type_node),
- "cString");
- chainon (field_decl_chain, field_decl);
+ if (!AT_LEAST_AS_LARGE_AS (field_decl, ptr_type_node))
+ return 0;
- field_decl = create_builtin_decl (FIELD_DECL, unsigned_type_node, "length");
- chainon (field_decl_chain, field_decl);
+ field_decl = TREE_CHAIN (field_decl);
+ if (!AT_LEAST_AS_LARGE_AS (field_decl, ptr_type_node))
+ return 0;
- finish_struct (constant_string_type, field_decl_chain, NULL_TREE);
+ field_decl = TREE_CHAIN (field_decl);
+ return AT_LEAST_AS_LARGE_AS (field_decl, unsigned_type_node);
+
+#undef AT_LEAST_AS_LARGE_AS
}
+/* Avoid calling `check_string_class_template ()' more than once. */
+static GTY(()) int string_layout_checked;
+
/* Custom build_string which sets TREE_TYPE! */
static tree
-my_build_string (len, str)
- int len;
- const char *str;
+my_build_string (int len, const char *str)
{
return fix_string_type (build_string (len, str));
}
-/* Build a static instance of NXConstantString which points at the
- string constant STRING.
- We place the string object in the __string_objects section of the
- __OBJC segment. The Objective-C runtime will initialize the isa
- pointers of the string objects to point at the NXConstantString
- class object. */
+/* Given a chain of STRING_CST's, build a static instance of
+ NXConstantString which points at the concatenation of those
+ strings. We place the string object in the __string_objects
+ section of the __OBJC segment. The Objective-C runtime will
+ initialize the isa pointers of the string objects to point at the
+ NXConstantString class object. */
tree
-build_objc_string_object (string)
- tree string;
+build_objc_string_object (tree string)
{
- tree initlist, constructor;
+ tree initlist, constructor, constant_string_class;
int length;
- if (lookup_interface (constant_string_id) == NULL_TREE)
+ string = fix_string_type (string);
+
+ constant_string_class = lookup_interface (constant_string_id);
+ if (!constant_string_class
+ || !(constant_string_type
+ = CLASS_STATIC_TEMPLATE (constant_string_class)))
{
error ("cannot find interface declaration for `%s'",
IDENTIFIER_POINTER (constant_string_id));
return error_mark_node;
}
- add_class_reference (constant_string_id);
-
+ /* Call to 'combine_strings' has been moved above. */
+ TREE_SET_CODE (string, STRING_CST);
length = TREE_STRING_LENGTH (string) - 1;
- /* We could not properly create NXConstantString in synth_module_prologue,
- because that's called before debugging is initialized. Do it now. */
- if (TYPE_FIELDS (constant_string_type) == NULL_TREE)
- build_string_class_template ();
+ if (!string_layout_checked)
+ {
+ /* The NSConstantString/NXConstantString ivar layout is now
+ known. */
+ if (!check_string_class_template ())
+ {
+ error ("interface `%s' does not have valid constant string layout",
+ IDENTIFIER_POINTER (constant_string_id));
+ return error_mark_node;
+ }
+ add_class_reference (constant_string_id);
+ }
/* & ((NXConstantString) { NULL, string, length }) */
@@ -1345,9 +1466,9 @@ build_objc_string_object (string)
/* Declare a static instance of CLASS_DECL initialized by CONSTRUCTOR. */
static GTY(()) int num_static_inst;
+
static tree
-objc_add_static_instance (constructor, class_decl)
- tree constructor, class_decl;
+objc_add_static_instance (tree constructor, tree class_decl)
{
tree *chain, decl;
char buf[256];
@@ -1360,7 +1481,7 @@ objc_add_static_instance (constructor, class_decl)
if (!*chain)
{
*chain = tree_cons (NULL_TREE, class_decl, NULL_TREE);
- add_objc_string (TYPE_NAME (class_decl), class_names);
+ add_objc_string (OBJC_TYPE_NAME (class_decl), class_names);
}
sprintf (buf, "_OBJC_INSTANCE_%d", num_static_inst++);
@@ -1386,8 +1507,7 @@ objc_add_static_instance (constructor, class_decl)
with type TYPE and elements ELTS. */
static tree
-objc_build_constructor (type, elts)
- tree type, elts;
+objc_build_constructor (tree type, tree elts)
{
tree constructor, f, e;
@@ -1414,6 +1534,11 @@ objc_build_constructor (type, elts)
TREE_STATIC (constructor) = 1;
TREE_READONLY (constructor) = 1;
+#ifdef OBJCPLUS
+ /* zlaski 2001-Apr-02: mark this as a call to a constructor, as required by
+ build_unary_op (wasn't true in 2.7.2.1 days) */
+ TREE_HAS_CONSTRUCTOR (constructor) = 1;
+#endif
return constructor;
}
@@ -1431,9 +1556,9 @@ objc_build_constructor (type, elts)
}; */
static void
-build_objc_symtab_template ()
+build_objc_symtab_template (void)
{
- tree field_decl, field_decl_chain, index;
+ tree field_decl, field_decl_chain;
objc_symtab_template
= start_struct (RECORD_TYPE, get_identifier (UTAG_SYMTAB));
@@ -1466,18 +1591,20 @@ build_objc_symtab_template ()
"cat_def_cnt");
chainon (field_decl_chain, field_decl);
- /* void *defs[cls_def_cnt + cat_def_cnt]; */
-
- if (!flag_next_runtime)
- index = build_index_type (build_int_2 (imp_count + cat_count, 0));
- else
- index = build_index_type (build_int_2 (imp_count + cat_count - 1,
- imp_count == 0 && cat_count == 0
- ? -1 : 0));
- field_decl = create_builtin_decl (FIELD_DECL,
- build_array_type (ptr_type_node, index),
- "defs");
- chainon (field_decl_chain, field_decl);
+ if (imp_count || cat_count || !flag_next_runtime)
+ {
+ /* void *defs[imp_count + cat_count (+ 1)]; */
+ /* NB: The index is one less than the size of the array. */
+ int index = imp_count + cat_count
+ + (flag_next_runtime? -1: 0);
+ field_decl = create_builtin_decl
+ (FIELD_DECL,
+ build_array_type
+ (ptr_type_node,
+ build_index_type (build_int_2 (index, 0))),
+ "defs");
+ chainon (field_decl_chain, field_decl);
+ }
finish_struct (objc_symtab_template, field_decl_chain, NULL_TREE);
}
@@ -1486,8 +1613,7 @@ build_objc_symtab_template ()
This is a CONSTRUCTOR. */
static tree
-init_def_list (type)
- tree type;
+init_def_list (tree type)
{
tree expr, initlist = NULL_TREE;
struct imp_entry *impent;
@@ -1531,8 +1657,7 @@ init_def_list (type)
/* Construct the initial value for all of _objc_symtab. */
static tree
-init_objc_symtab (type)
- tree type;
+init_objc_symtab (tree type)
{
tree initlist;
@@ -1560,7 +1685,7 @@ init_objc_symtab (type)
/* cls_def = { ..., { &Foo, &Bar, ...}, ... } */
- if (imp_count || cat_count || static_instances_decl)
+ if (imp_count || cat_count || !flag_next_runtime)
{
tree field = TYPE_FIELDS (type);
@@ -1573,11 +1698,31 @@ init_objc_symtab (type)
return objc_build_constructor (type, nreverse (initlist));
}
+/* Generate forward declarations for metadata such as
+ 'OBJC_CLASS_...'. */
+
+static tree
+build_metadata_decl (const char *name, tree type)
+{
+ tree decl, decl_specs;
+ /* extern struct TYPE NAME_<name>; */
+ decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_EXTERN]);
+ decl_specs = tree_cons (NULL_TREE, type, decl_specs);
+ decl = define_decl (synth_id_with_class_suffix
+ (name,
+ objc_implementation_context),
+ decl_specs);
+ TREE_USED (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ TREE_PUBLIC (decl) = 0;
+ return decl;
+}
+
/* Push forward-declarations of all the categories so that
init_def_list can use them in a CONSTRUCTOR. */
static void
-forward_declare_categories ()
+forward_declare_categories (void)
{
struct imp_entry *impent;
tree sav = objc_implementation_context;
@@ -1588,19 +1733,19 @@ forward_declare_categories ()
{
/* Set an invisible arg to synth_id_with_class_suffix. */
objc_implementation_context = impent->imp_context;
- impent->class_decl
- = create_builtin_decl (VAR_DECL, objc_category_template,
- IDENTIFIER_POINTER (synth_id_with_class_suffix ("_OBJC_CATEGORY", objc_implementation_context)));
+ /* extern struct objc_category _OBJC_CATEGORY_<name>; */
+ impent->class_decl = build_metadata_decl ("_OBJC_CATEGORY",
+ objc_category_template);
}
}
objc_implementation_context = sav;
}
-/* Create the declaration of _OBJC_SYMBOLS, with type `strict _objc_symtab'
+/* Create the declaration of _OBJC_SYMBOLS, with type `struct _objc_symtab'
and initialized appropriately. */
static void
-generate_objc_symtab_decl ()
+generate_objc_symtab_decl (void)
{
tree sc_spec;
@@ -1631,8 +1776,7 @@ generate_objc_symtab_decl ()
}
static tree
-init_module_descriptor (type)
- tree type;
+init_module_descriptor (tree type)
{
tree initlist, expr;
@@ -1670,7 +1814,7 @@ init_module_descriptor (type)
struct objc_module { ... } _OBJC_MODULE = { ... }; */
static rtx
-build_module_descriptor ()
+build_module_descriptor (void)
{
tree decl_specs, field_decl, field_decl_chain;
@@ -1747,7 +1891,8 @@ build_module_descriptor ()
get_identifier (TAG_EXECCLASS),
build_function_type (void_type_node,
tree_cons (NULL_TREE, ptr_type_node,
- void_list_node_1)));
+ OBJC_VOID_AT_END)));
+
DECL_EXTERNAL (execclass_decl) = 1;
DECL_ARTIFICIAL (execclass_decl) = 1;
TREE_PUBLIC (execclass_decl) = 1;
@@ -1761,7 +1906,7 @@ build_module_descriptor ()
start_function (void_list_node_1,
build_nt (CALL_EXPR, init_function_name,
tree_cons (NULL_TREE, NULL_TREE,
- void_list_node_1),
+ OBJC_VOID_AT_END),
NULL_TREE),
NULL_TREE);
store_parm_decls ();
@@ -1782,7 +1927,7 @@ build_module_descriptor ()
c_expand_expr_stmt (decelerator);
- finish_function (0, 0);
+ finish_function ();
return XEXP (DECL_RTL (init_function_decl), 0);
}
@@ -1791,7 +1936,7 @@ build_module_descriptor ()
/* extern const char _OBJC_STRINGS[]; */
static void
-generate_forward_declaration_to_string_table ()
+generate_forward_declaration_to_string_table (void)
{
tree sc_spec, decl_specs, expr_decl;
@@ -1807,9 +1952,7 @@ generate_forward_declaration_to_string_table ()
/* Return the DECL of the string IDENT in the SECTION. */
static tree
-get_objc_string_decl (ident, section)
- tree ident;
- enum string_section section;
+get_objc_string_decl (tree ident, enum string_section section)
{
tree chain;
@@ -1834,7 +1977,7 @@ get_objc_string_decl (ident, section)
for the array built. */
static void
-generate_static_references ()
+generate_static_references (void)
{
tree decls = NULL_TREE, ident, decl_spec, expr_decl, expr = NULL_TREE;
tree class_name, class, decl, initlist;
@@ -1864,7 +2007,7 @@ generate_static_references ()
/* Output {class_name, ...}. */
class = TREE_VALUE (cl_chain);
- class_name = get_objc_string_decl (TYPE_NAME (class), class_names);
+ class_name = get_objc_string_decl (OBJC_TYPE_NAME (class), class_names);
initlist = build_tree_list (NULL_TREE,
build_unary_op (ADDR_EXPR, class_name, 1));
@@ -1910,7 +2053,7 @@ generate_static_references ()
/* Output all strings. */
static void
-generate_strings ()
+generate_strings (void)
{
tree sc_spec, decl_specs, expr_decl;
tree chain, string_expr;
@@ -1963,8 +2106,9 @@ generate_strings ()
}
static GTY(()) int selector_reference_idx;
+
static tree
-build_selector_reference_decl ()
+build_selector_reference_decl (void)
{
tree decl, ident;
char buf[256];
@@ -1975,9 +2119,8 @@ build_selector_reference_decl ()
decl = build_decl (VAR_DECL, ident, selector_type);
DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
+ TREE_PUBLIC (decl) = 0;
TREE_USED (decl) = 1;
- TREE_READONLY (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
DECL_CONTEXT (decl) = 0;
@@ -1990,8 +2133,7 @@ build_selector_reference_decl ()
/* Just a handy wrapper for add_objc_string. */
static tree
-build_selector (ident)
- tree ident;
+build_selector (tree ident)
{
tree expr = add_objc_string (ident, meth_var_names);
if (flag_typed_selectors)
@@ -2001,7 +2143,7 @@ build_selector (ident)
}
static void
-build_selector_translation_table ()
+build_selector_translation_table (void)
{
tree sc_spec, decl_specs;
tree chain, initlist = NULL_TREE;
@@ -2061,7 +2203,7 @@ build_selector_translation_table ()
if (flag_next_runtime)
finish_decl (decl, expr, NULL_TREE);
- else
+ else
{
if (flag_typed_selectors)
{
@@ -2073,7 +2215,7 @@ build_selector_translation_table ()
nreverse (eltlist));
}
initlist = tree_cons (NULL_TREE, expr, initlist);
-
+
}
}
@@ -2093,21 +2235,16 @@ build_selector_translation_table ()
}
static tree
-get_proto_encoding (proto)
- tree proto;
+get_proto_encoding (tree proto)
{
tree encoding;
if (proto)
{
- tree tmp_decl;
-
if (! METHOD_ENCODING (proto))
{
- tmp_decl = build_tmp_function_decl ();
- hack_method_prototype (proto, tmp_decl);
- encoding = encode_method_prototype (proto, tmp_decl);
- METHOD_ENCODING (proto) = encoding;
- }
+ encoding = encode_method_prototype (proto);
+ METHOD_ENCODING (proto) = encoding;
+ }
else
encoding = METHOD_ENCODING (proto);
@@ -2121,8 +2258,7 @@ get_proto_encoding (proto)
identifier_node that represent the selector. */
static tree
-build_typed_selector_reference (ident, prototype)
- tree ident, prototype;
+build_typed_selector_reference (tree ident, tree prototype)
{
tree *chain = &sel_ref_chain;
tree expr;
@@ -2148,8 +2284,7 @@ build_typed_selector_reference (ident, prototype)
}
static tree
-build_selector_reference (ident)
- tree ident;
+build_selector_reference (tree ident)
{
tree *chain = &sel_ref_chain;
tree expr;
@@ -2178,8 +2313,9 @@ build_selector_reference (ident)
}
static GTY(()) int class_reference_idx;
+
static tree
-build_class_reference_decl ()
+build_class_reference_decl (void)
{
tree decl, ident;
char buf[256];
@@ -2190,9 +2326,8 @@ build_class_reference_decl ()
decl = build_decl (VAR_DECL, ident, objc_class_type);
DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
+ TREE_PUBLIC (decl) = 0;
TREE_USED (decl) = 1;
- TREE_READONLY (decl) = 1;
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
@@ -2206,8 +2341,7 @@ build_class_reference_decl ()
it. */
static void
-add_class_reference (ident)
- tree ident;
+add_class_reference (tree ident)
{
tree chain;
@@ -2235,10 +2369,27 @@ add_class_reference (ident)
reference variable. */
tree
-get_class_reference (ident)
- tree ident;
+get_class_reference (tree ident)
{
- if (flag_next_runtime)
+ tree orig_ident;
+
+#ifdef OBJCPLUS
+ if (processing_template_decl)
+ /* Must wait until template instantiation time. */
+ return build_min_nt (CLASS_REFERENCE_EXPR, ident);
+ if (TREE_CODE (ident) == TYPE_DECL)
+ ident = DECL_NAME (ident);
+#endif
+ orig_ident = ident;
+
+ if (!(ident = is_class_name (ident)))
+ {
+ error ("`%s' is not an Objective-C class name or alias",
+ IDENTIFIER_POINTER (orig_ident));
+ return error_mark_node;
+ }
+
+ if (flag_next_runtime && !flag_zero_link)
{
tree *chain;
tree decl;
@@ -2275,9 +2426,7 @@ get_class_reference (ident)
to decls for the strings. */
static tree
-add_objc_string (ident, section)
- tree ident;
- enum string_section section;
+add_objc_string (tree ident, enum string_section section)
{
tree *chain, decl;
@@ -2310,8 +2459,7 @@ static GTY(()) int meth_var_names_idx;
static GTY(()) int meth_var_types_idx;
static tree
-build_objc_string_decl (section)
- enum string_section section;
+build_objc_string_decl (enum string_section section)
{
tree decl, ident;
char buf[256];
@@ -2327,13 +2475,12 @@ build_objc_string_decl (section)
decl = build_decl (VAR_DECL, ident, build_array_type (char_type_node, 0));
DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
+ TREE_PUBLIC (decl) = 0;
TREE_USED (decl) = 1;
- TREE_READONLY (decl) = 1;
TREE_CONSTANT (decl) = 1;
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
-
+
make_decl_rtl (decl, 0);
pushdecl_top_level (decl);
@@ -2342,39 +2489,51 @@ build_objc_string_decl (section)
void
-objc_declare_alias (alias_ident, class_ident)
- tree alias_ident;
- tree class_ident;
+objc_declare_alias (tree alias_ident, tree class_ident)
{
- if (is_class_name (class_ident) != class_ident)
+ tree underlying_class;
+
+#ifdef OBJCPLUS
+ if (current_namespace != global_namespace) {
+ error ("Objective-C declarations may only appear in global scope");
+ }
+#endif /* OBJCPLUS */
+
+ if (!(underlying_class = is_class_name (class_ident)))
warning ("cannot find class `%s'", IDENTIFIER_POINTER (class_ident));
else if (is_class_name (alias_ident))
warning ("class `%s' already exists", IDENTIFIER_POINTER (alias_ident));
else
- alias_chain = tree_cons (class_ident, alias_ident, alias_chain);
+ alias_chain = tree_cons (underlying_class, alias_ident, alias_chain);
}
void
-objc_declare_class (ident_list)
- tree ident_list;
+objc_declare_class (tree ident_list)
{
tree list;
+#ifdef OBJCPLUS
+ if (current_namespace != global_namespace) {
+ error ("Objective-C declarations may only appear in global scope");
+ }
+#endif /* OBJCPLUS */
for (list = ident_list; list; list = TREE_CHAIN (list))
{
tree ident = TREE_VALUE (list);
- tree decl;
- if ((decl = lookup_name (ident)))
+ if (! is_class_name (ident))
{
- error ("`%s' redeclared as different kind of symbol",
- IDENTIFIER_POINTER (ident));
- error_with_decl (decl, "previous declaration of `%s'");
- }
+ tree record = lookup_name (ident);
+
+ if (record && ! TREE_STATIC_TEMPLATE (record))
+ {
+ error ("`%s' redeclared as different kind of symbol",
+ IDENTIFIER_POINTER (ident));
+ error ("%Hprevious declaration of '%D'",
+ &DECL_SOURCE_LOCATION (record), record);
+ }
- if (! is_class_name (ident))
- {
- tree record = xref_tag (RECORD_TYPE, ident);
+ record = xref_tag (RECORD_TYPE, ident);
TREE_STATIC_TEMPLATE (record) = 1;
class_chain = tree_cons (NULL_TREE, ident, class_chain);
}
@@ -2382,11 +2541,25 @@ objc_declare_class (ident_list)
}
tree
-is_class_name (ident)
- tree ident;
+is_class_name (tree ident)
{
tree chain;
+ if (ident && TREE_CODE (ident) == IDENTIFIER_NODE
+ && identifier_global_value (ident))
+ ident = identifier_global_value (ident);
+ while (ident && TREE_CODE (ident) == TYPE_DECL && DECL_ORIGINAL_TYPE (ident))
+ ident = TYPE_NAME (DECL_ORIGINAL_TYPE (ident));
+
+#ifdef OBJCPLUS
+ if (ident && TREE_CODE (ident) == RECORD_TYPE)
+ ident = TYPE_NAME (ident);
+ if (ident && TREE_CODE (ident) == TYPE_DECL)
+ ident = DECL_NAME (ident);
+#endif
+ if (!ident || TREE_CODE (ident) != IDENTIFIER_NODE)
+ return NULL_TREE;
+
if (lookup_interface (ident))
return ident;
@@ -2405,48 +2578,94 @@ is_class_name (ident)
return 0;
}
+/* Check whether TYPE is either 'id', 'Class', or a pointer to an ObjC
+ class instance. This is needed by other parts of the compiler to
+ handle ObjC types gracefully. */
+
tree
-objc_is_id (ident)
- tree ident;
+objc_is_object_ptr (tree type)
{
- /* NB: This function may be called before the ObjC front-end
- has been initialized, in which case ID_TYPE will be NULL. */
- return (id_type && ident && TYPE_P (ident) && IS_ID (ident))
- ? id_type
- : NULL_TREE;
+ type = TYPE_MAIN_VARIANT (type);
+ if (!type || TREE_CODE (type) != POINTER_TYPE)
+ return 0;
+ /* NB: This function may be called before the ObjC front-end has
+ been initialized, in which case ID_TYPE will be NULL. */
+ if (id_type && type && TYPE_P (type)
+ && (IS_ID (type)
+ || TREE_TYPE (type) == TREE_TYPE (objc_class_type)))
+ return type;
+ return is_class_name (OBJC_TYPE_NAME (TREE_TYPE (type)));
}
tree
-lookup_interface (ident)
- tree ident;
+lookup_interface (tree ident)
{
tree chain;
+#ifdef OBJCPLUS
+ if (ident && TREE_CODE (ident) == TYPE_DECL)
+ ident = DECL_NAME (ident);
+#endif
for (chain = interface_chain; chain; chain = TREE_CHAIN (chain))
{
if (ident == CLASS_NAME (chain))
- return chain;
+ return chain;
}
return NULL_TREE;
}
+/* Implement @defs (<classname>) within struct bodies. */
+
+tree
+get_class_ivars_from_name (tree class_name)
+{
+ tree interface = lookup_interface (class_name);
+ tree field, fields = NULL_TREE;
+
+ if (interface)
+ {
+ tree raw_ivar = get_class_ivars (interface, 1);
+
+ /* Regenerate the FIELD_DECLs for the enclosing struct. */
+ for (; raw_ivar; raw_ivar = TREE_CHAIN (raw_ivar))
+ {
+ field = grokfield (TREE_PURPOSE (TREE_VALUE (raw_ivar)),
+ TREE_PURPOSE (raw_ivar),
+ TREE_VALUE (TREE_VALUE (raw_ivar)));
+#ifdef OBJCPLUS
+ finish_member_declaration (field);
+#else
+ fields = chainon (fields, field);
+#endif
+ }
+ }
+ else
+ error ("cannot find interface declaration for `%s'",
+ IDENTIFIER_POINTER (class_name));
+
+ return fields;
+}
+
/* Used by: build_private_template, continue_class,
and for @defs constructs. */
-tree
-get_class_ivars (interface)
- tree interface;
+static tree
+get_class_ivars (tree interface, int raw)
{
tree my_name, super_name, ivar_chain;
my_name = CLASS_NAME (interface);
super_name = CLASS_SUPER_NAME (interface);
- ivar_chain = CLASS_IVARS (interface);
-
- /* Save off a pristine copy of the leaf ivars (i.e, those not
- inherited from a super class). */
- if (!CLASS_OWN_IVARS (interface))
- CLASS_OWN_IVARS (interface) = copy_list (ivar_chain);
+ if (raw)
+ ivar_chain = CLASS_RAW_IVARS (interface);
+ else
+ {
+ ivar_chain = CLASS_IVARS (interface);
+ /* Save off a pristine copy of the leaf ivars (i.e, those not
+ inherited from a super class). */
+ if (!CLASS_OWN_IVARS (interface))
+ CLASS_OWN_IVARS (interface) = copy_list (ivar_chain);
+ }
while (super_name)
{
@@ -2470,7 +2689,7 @@ get_class_ivars (interface)
my_name = CLASS_NAME (interface);
super_name = CLASS_SUPER_NAME (interface);
- op1 = CLASS_OWN_IVARS (interface);
+ op1 = (raw ? CLASS_RAW_IVARS (interface) : CLASS_OWN_IVARS (interface));
if (op1)
{
tree head = copy_list (op1);
@@ -2481,17 +2700,698 @@ get_class_ivars (interface)
ivar_chain = head;
}
}
+
return ivar_chain;
}
+static tree
+objc_enter_block (void)
+{
+ tree block;
+
+#ifdef OBJCPLUS
+ block = begin_compound_stmt (0);
+#else
+ block = c_begin_compound_stmt ();
+ pushlevel (0);
+ clear_last_expr ();
+ add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
+#endif
+
+ objc_exception_block_stack = tree_cons (NULL_TREE, block,
+ objc_exception_block_stack);
+
+ blk_nesting_count++;
+ return block;
+}
+
+static tree
+objc_exit_block (void)
+{
+ tree block = TREE_VALUE (objc_exception_block_stack);
+#ifndef OBJCPLUS
+ tree scope_stmt, inner;
+#endif
+
+ objc_clear_super_receiver ();
+#ifdef OBJCPLUS
+ finish_compound_stmt (0, block);
+#else
+ scope_stmt = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
+ inner = poplevel (KEEP_MAYBE, 1, 0);
+
+ SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmt))
+ = SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmt))
+ = inner;
+ RECHAIN_STMTS (block, COMPOUND_BODY (block));
+#endif
+ last_expr_type = NULL_TREE;
+ objc_exception_block_stack = TREE_CHAIN (objc_exception_block_stack);
+
+ blk_nesting_count--;
+ return block;
+}
+
+static tree
+objc_declare_variable (enum rid scspec, tree name, tree type, tree init)
+{
+ tree decl;
+
+ type = tree_cons (NULL_TREE, type,
+ tree_cons (NULL_TREE, ridpointers[(int) scspec],
+ NULL_TREE));
+ TREE_STATIC (type) = 1;
+ decl = start_decl (name, type, (init != NULL_TREE), NULL_TREE);
+ finish_decl (decl, init, NULL_TREE);
+ /* This prevents `unused variable' warnings when compiling with -Wall. */
+ TREE_USED (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ return decl;
+}
+
+tree
+objc_build_throw_stmt (tree throw_expr)
+{
+ tree func_params;
+
+ if (!flag_objc_exceptions)
+ fatal_error ("Use `-fobjc-exceptions' to enable Objective-C exception syntax");
+
+ if (!throw_expr && objc_caught_exception)
+ throw_expr = TREE_VALUE (objc_caught_exception);
+
+ if (!throw_expr)
+ {
+ error ("`@throw;' (rethrow) used outside of a `@catch' block");
+ return error_mark_node;
+ }
+
+ func_params = tree_cons (NULL_TREE, throw_expr, NULL_TREE);
+
+ assemble_external (objc_exception_throw_decl);
+ return c_expand_expr_stmt (build_function_call (objc_exception_throw_decl,
+ func_params));
+}
+
+static void
+val_stack_push (struct val_stack **nc, long val)
+{
+ struct val_stack *new_elem = xmalloc (sizeof (struct val_stack));
+ new_elem->val = val;
+ new_elem->next = *nc;
+ *nc = new_elem;
+}
+
+static void
+val_stack_pop (struct val_stack **nc)
+{
+ struct val_stack *old_elem = *nc;
+ *nc = old_elem->next;
+ free (old_elem);
+}
+
+static void
+objc_build_try_enter_fragment (void)
+{
+ /* objc_exception_try_enter(&_stackExceptionData);
+ if (!_setjmp(&_stackExceptionData.buf)) { */
+
+ tree func_params, if_stmt, cond;
+
+ func_params
+ = tree_cons (NULL_TREE,
+ build_unary_op (ADDR_EXPR,
+ TREE_VALUE (objc_stack_exception_data),
+ 0),
+ NULL_TREE);
+
+ assemble_external (objc_exception_try_enter_decl);
+ c_expand_expr_stmt (build_function_call
+ (objc_exception_try_enter_decl, func_params));
+
+ if_stmt = c_begin_if_stmt ();
+ if_nesting_count++;
+ /* If <setjmp.h> has been included, the _setjmp prototype has
+ acquired a real, breathing type for its parameter. Cast our
+ argument to that type. */
+ func_params
+ = tree_cons (NULL_TREE,
+ build_c_cast (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl))
+ ? TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl)))
+ : ptr_type_node,
+ build_unary_op
+ (ADDR_EXPR,
+ build_component_ref (TREE_VALUE (objc_stack_exception_data),
+ get_identifier ("buf")), 0)),
+ NULL_TREE);
+ assemble_external (objc_setjmp_decl);
+ cond = build_unary_op (TRUTH_NOT_EXPR,
+ build_function_call (objc_setjmp_decl, func_params),
+ 0);
+ c_expand_start_cond (c_common_truthvalue_conversion (cond),
+ 0, if_stmt);
+ objc_enter_block ();
+}
+
+static tree
+objc_build_extract_expr (void)
+{
+ /* ... = objc_exception_extract(&_stackExceptionData); */
+
+ tree func_params
+ = tree_cons (NULL_TREE,
+ build_unary_op (ADDR_EXPR,
+ TREE_VALUE (objc_stack_exception_data), 0),
+ NULL_TREE);
+
+ assemble_external (objc_exception_extract_decl);
+ return build_function_call (objc_exception_extract_decl, func_params);
+}
+
+static void
+objc_build_try_exit_fragment (void)
+{
+ /* objc_exception_try_exit(&_stackExceptionData); */
+
+ tree func_params
+ = tree_cons (NULL_TREE,
+ build_unary_op (ADDR_EXPR,
+ TREE_VALUE (objc_stack_exception_data), 0),
+ NULL_TREE);
+
+ assemble_external (objc_exception_try_exit_decl);
+ c_expand_expr_stmt (build_function_call (objc_exception_try_exit_decl,
+ func_params));
+}
+
+static void
+objc_build_extract_fragment (void)
+{
+ /* } else {
+ _rethrowException = objc_exception_extract(&_stackExceptionData);
+ } */
+
+ objc_exit_block ();
+ c_finish_then ();
+
+ c_expand_start_else ();
+ objc_enter_block ();
+ c_expand_expr_stmt (build_modify_expr
+ (TREE_VALUE (objc_rethrow_exception),
+ NOP_EXPR,
+ objc_build_extract_expr ()));
+ objc_exit_block ();
+ c_finish_else ();
+ c_expand_end_cond ();
+ if_nesting_count--;
+}
+
+tree
+objc_build_try_prologue (void)
+{
+ /* { // new scope
+ struct _objc_exception_data _stackExceptionData;
+ volatile id _rethrowException = nil;
+ { // begin TRY-CATCH scope
+ objc_exception_try_enter(&_stackExceptionData);
+ if (!_setjmp(&_stackExceptionData.buf)) { */
+
+ tree try_catch_block;
+
+ if (!flag_objc_exceptions)
+ fatal_error ("Use `-fobjc-exceptions' to enable Objective-C exception syntax");
+
+ objc_mark_locals_volatile ((void *)(exc_binding_stack
+ ? exc_binding_stack->val
+ : 0));
+ objc_enter_block ();
+ objc_stack_exception_data
+ = tree_cons (NULL_TREE,
+ objc_declare_variable (RID_AUTO,
+ get_identifier (UTAG_EXCDATA_VAR),
+ xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_EXCDATA)),
+ NULL_TREE),
+ objc_stack_exception_data);
+ objc_rethrow_exception = tree_cons (NULL_TREE,
+ objc_declare_variable (RID_VOLATILE,
+ get_identifier (UTAG_RETHROWEXC_VAR),
+ id_type,
+ build_int_2 (0, 0)),
+ objc_rethrow_exception);
+
+ try_catch_block = objc_enter_block ();
+ val_stack_push (&exc_binding_stack, (long) get_current_scope ());
+ objc_build_try_enter_fragment ();
+
+ return try_catch_block;
+}
+
+void
+objc_build_try_epilogue (int also_catch_prologue)
+{
+ if (also_catch_prologue)
+ {
+ /* } else {
+ register id _caughtException = objc_exception_extract( &_stackExceptionData);
+ objc_exception_try_enter(&_stackExceptionData);
+ if(!_setjmp(&_stackExceptionData.buf)) {
+ if (0) { */
+
+ tree if_stmt;
+
+ objc_exit_block ();
+ c_finish_then ();
+
+ c_expand_start_else ();
+ objc_enter_block ();
+ objc_caught_exception
+ = tree_cons (NULL_TREE,
+ objc_declare_variable (RID_REGISTER,
+ get_identifier (UTAG_CAUGHTEXC_VAR),
+ id_type,
+ objc_build_extract_expr ()),
+ objc_caught_exception);
+ objc_build_try_enter_fragment ();
+ val_stack_push (&catch_count_stack, 1);
+ if_stmt = c_begin_if_stmt ();
+ if_nesting_count++;
+ c_expand_start_cond (c_common_truthvalue_conversion (boolean_false_node),
+ 0, if_stmt);
+ objc_enter_block ();
+
+ /* Start a new chain of @catch statements for this @try. */
+ objc_catch_type = tree_cons (objc_catch_type, NULL_TREE, NULL_TREE);
+ }
+ else
+ { /* !also_catch_prologue */
+
+ /* } else {
+ _rethrowException = objc_exception_extract( &_stackExceptionData);
+ }
+ } */
+ objc_build_extract_fragment ();
+ objc_exit_block ();
+ }
+}
+
+void
+objc_build_catch_stmt (tree catch_expr)
+{
+ /* } else if (objc_exception_match(objc_get_class("SomeClass"), _caughtException)) {
+ register SomeClass *e = _caughtException; */
+
+ tree if_stmt, cond, func_params, prev_catch, var_name, var_type;
+ int catch_id;
+
+#ifndef OBJCPLUS
+ /* Yet another C/C++ impedance mismatch. */
+ catch_expr = TREE_PURPOSE (catch_expr);
+#endif
+
+ var_name = TREE_VALUE (catch_expr);
+ var_type = TREE_VALUE (TREE_PURPOSE (catch_expr));
+ if (TREE_CODE (var_name) == INDIRECT_REF)
+ var_name = TREE_OPERAND (var_name, 0);
+ if (TREE_CODE (var_type) == TYPE_DECL
+ || TREE_CODE (var_type) == POINTER_TYPE)
+ var_type = TREE_TYPE (var_type);
+ catch_id = (var_type == TREE_TYPE (id_type));
+
+ if (!flag_objc_exceptions)
+ fatal_error ("Use `-fobjc-exceptions' to enable Objective-C exception syntax");
+
+ if (!(catch_id || TYPED_OBJECT (var_type)))
+ fatal_error ("`@catch' parameter is not a known Objective-C class type");
+
+ /* Examine previous @catch clauses for the current @try block for
+ superclasses of the 'var_type' class. */
+ for (prev_catch = objc_catch_type; TREE_VALUE (prev_catch);
+ prev_catch = TREE_CHAIN (prev_catch))
+ {
+ if (TREE_VALUE (prev_catch) == TREE_TYPE (id_type))
+ {
+ warning ("Exception already handled by preceding `@catch(id)'");
+ break;
+ }
+ else if (!catch_id
+ && objc_comptypes (TREE_VALUE (prev_catch), var_type, 0) == 1)
+ warning ("Exception of type `%s *' already handled by `@catch (%s *)'",
+ IDENTIFIER_POINTER (OBJC_TYPE_NAME (var_type)),
+ IDENTIFIER_POINTER (OBJC_TYPE_NAME (TREE_VALUE (prev_catch))));
+ }
+
+ objc_catch_type = tree_cons (NULL_TREE, var_type, objc_catch_type);
+
+ objc_exit_block ();
+ c_finish_then ();
+
+ c_expand_start_else ();
+ catch_count_stack->val++;
+ if_stmt = c_begin_if_stmt ();
+ if_nesting_count++;
+
+ if (catch_id)
+ cond = integer_one_node;
+ else
+ {
+ cond = get_class_reference (OBJC_TYPE_NAME (var_type));
+
+ func_params
+ = tree_cons (NULL_TREE, cond,
+ tree_cons (NULL_TREE,
+ TREE_VALUE (objc_caught_exception),
+ NULL_TREE));
+ assemble_external (objc_exception_match_decl);
+ cond = build_function_call (objc_exception_match_decl, func_params);
+ }
+
+ c_expand_start_cond (c_common_truthvalue_conversion (cond),
+ 0, if_stmt);
+ objc_enter_block ();
+ objc_declare_variable (RID_REGISTER, var_name,
+ build_pointer_type (var_type),
+ TREE_VALUE (objc_caught_exception));
+}
+
+void
+objc_build_catch_epilogue (void)
+{
+ /* } else {
+ _rethrowException = _caughtException;
+ objc_exception_try_exit(&_stackExceptionData);
+ }
+ } else {
+ _rethrowException = objc_exception_extract(&_stackExceptionData);
+ }
+ }
+ } // end TRY-CATCH scope
+ */
+
+ objc_exit_block ();
+ c_finish_then ();
+
+ c_expand_start_else ();
+ objc_enter_block ();
+ c_expand_expr_stmt
+ (build_modify_expr
+ (TREE_VALUE (objc_rethrow_exception),
+ NOP_EXPR,
+ TREE_VALUE (objc_caught_exception)));
+ objc_build_try_exit_fragment ();
+ objc_exit_block ();
+ while (catch_count_stack->val--)
+ {
+ c_finish_else (); /* close off all the nested ifs ! */
+ c_expand_end_cond ();
+ if_nesting_count--;
+ }
+ val_stack_pop (&catch_count_stack);
+ objc_caught_exception = TREE_CHAIN (objc_caught_exception);
+
+ objc_build_extract_fragment ();
+
+ objc_exit_block ();
+ c_finish_else ();
+ c_expand_end_cond ();
+ if_nesting_count--;
+ objc_exit_block ();
+
+ /* Return to enclosing chain of @catch statements (if any). */
+ while (TREE_VALUE (objc_catch_type))
+ objc_catch_type = TREE_CHAIN (objc_catch_type);
+ objc_catch_type = TREE_PURPOSE (objc_catch_type);
+}
+
+tree
+objc_build_finally_prologue ()
+{
+ /* { // begin FINALLY scope
+ if (!_rethrowException) {
+ objc_exception_try_exit(&_stackExceptionData);
+ } */
+
+ tree blk = objc_enter_block ();
+
+ tree if_stmt = c_begin_if_stmt ();
+ if_nesting_count++;
+
+ c_expand_start_cond (c_common_truthvalue_conversion
+ (build_unary_op
+ (TRUTH_NOT_EXPR,
+ TREE_VALUE (objc_rethrow_exception), 0)),
+ 0, if_stmt);
+ objc_enter_block ();
+ objc_build_try_exit_fragment ();
+ objc_exit_block ();
+ c_finish_then ();
+ c_expand_end_cond ();
+ if_nesting_count--;
+
+ return blk;
+}
+
+tree
+objc_build_finally_epilogue (void)
+{
+ /* if (_rethrowException) {
+ objc_exception_throw(_rethrowException);
+ }
+ } // end FINALLY scope
+ } */
+
+ tree if_stmt = c_begin_if_stmt ();
+ if_nesting_count++;
+
+ c_expand_start_cond
+ (c_common_truthvalue_conversion (TREE_VALUE (objc_rethrow_exception)),
+ 0, if_stmt);
+ objc_enter_block ();
+ objc_build_throw_stmt (TREE_VALUE (objc_rethrow_exception));
+ objc_exit_block ();
+ c_finish_then ();
+ c_expand_end_cond ();
+ if_nesting_count--;
+
+ objc_exit_block ();
+ objc_rethrow_exception = TREE_CHAIN (objc_rethrow_exception);
+ objc_stack_exception_data = TREE_CHAIN (objc_stack_exception_data);
+
+ val_stack_pop (&exc_binding_stack);
+ return objc_exit_block ();
+}
+
+tree
+objc_build_try_catch_finally_stmt (int has_catch, int has_finally)
+{
+ /* NB: The operative assumption here is that TRY_FINALLY_EXPR will
+ deal with all exits from 'try_catch_blk' and route them through
+ 'finally_blk'. */
+ tree outer_blk = objc_build_finally_epilogue ();
+ tree prec_stmt = TREE_CHAIN (TREE_CHAIN (COMPOUND_BODY (outer_blk)));
+ tree try_catch_blk = TREE_CHAIN (prec_stmt), try_catch_expr;
+ tree finally_blk = TREE_CHAIN (try_catch_blk), finally_expr;
+ tree succ_stmt = TREE_CHAIN (finally_blk);
+ tree try_finally_stmt, try_finally_expr;
+
+ if (!flag_objc_exceptions)
+ fatal_error ("Use `-fobjc-exceptions' to enable Objective-C exception syntax");
+
+ /* It is an error to have a @try block without a @catch and/or @finally
+ (even though sensible code can be generated nonetheless). */
+
+ if (!has_catch && !has_finally)
+ error ("`@try' without `@catch' or `@finally'");
+
+ /* We shall now do something truly disgusting. We shall remove the
+ 'try_catch_blk' and 'finally_blk' from the 'outer_blk' statement
+ chain, and replace them with a TRY_FINALLY_EXPR statement! If
+ this doesn't work, we will have to learn (from Per/gcj) how to
+ construct the 'outer_blk' lazily. */
+
+ TREE_CHAIN (try_catch_blk) = TREE_CHAIN (finally_blk) = NULL_TREE;
+ try_catch_expr = build1 (STMT_EXPR, void_type_node, try_catch_blk);
+ TREE_SIDE_EFFECTS (try_catch_expr) = 1;
+ finally_expr = build1 (STMT_EXPR, void_type_node, finally_blk);
+ TREE_SIDE_EFFECTS (finally_expr) = 1;
+ try_finally_expr = build (TRY_FINALLY_EXPR, void_type_node, try_catch_expr,
+ finally_expr);
+ TREE_SIDE_EFFECTS (try_finally_expr) = 1;
+ try_finally_stmt = build_stmt (EXPR_STMT, try_finally_expr);
+ TREE_CHAIN (prec_stmt) = try_finally_stmt;
+ TREE_CHAIN (try_finally_stmt) = succ_stmt;
+
+ return outer_blk; /* the whole enchilada */
+}
+
+void
+objc_build_synchronized_prologue (tree sync_expr)
+{
+ /* {
+ id _eval_once = <sync_expr>;
+ @try {
+ objc_sync_enter( _eval_once ); */
+
+ tree func_params;
+
+ if (!flag_objc_exceptions)
+ fatal_error ("Use `-fobjc-exceptions' to enable Objective-C exception syntax");
+
+ objc_enter_block ();
+ objc_eval_once
+ = tree_cons (NULL_TREE,
+ objc_declare_variable (RID_AUTO,
+ get_identifier (UTAG_EVALONCE_VAR),
+ id_type,
+ sync_expr),
+ objc_eval_once);
+ objc_build_try_prologue ();
+ objc_enter_block ();
+ func_params = tree_cons (NULL_TREE,
+ TREE_VALUE (objc_eval_once),
+ NULL_TREE);
+
+ assemble_external (objc_sync_enter_decl);
+ c_expand_expr_stmt (build_function_call
+ (objc_sync_enter_decl, func_params));
+}
+
+tree
+objc_build_synchronized_epilogue (void)
+{
+ /* }
+ @finally {
+ objc_sync_exit( _eval_once );
+ }
+ } */
+
+ tree func_params;
+
+ objc_exit_block ();
+ objc_build_try_epilogue (0);
+ objc_build_finally_prologue ();
+ func_params = tree_cons (NULL_TREE, TREE_VALUE (objc_eval_once),
+ NULL_TREE);
+
+ assemble_external (objc_sync_exit_decl);
+ c_expand_expr_stmt (build_function_call (objc_sync_exit_decl,
+ func_params));
+ objc_build_try_catch_finally_stmt (0, 1);
+
+ return objc_exit_block ();
+}
+
+/* Predefine the following data type:
+
+ struct _objc_exception_data
+ {
+ int buf[_JBLEN];
+ void *pointers[4];
+ }; */
+
+/* The following yuckiness should prevent users from having to #include
+ <setjmp.h> in their code... */
+
+#ifdef TARGET_POWERPC
+/* snarfed from /usr/include/ppc/setjmp.h */
+#define _JBLEN (26 + 36 + 129 + 1)
+#else
+/* snarfed from /usr/include/i386/{setjmp,signal}.h */
+#define _JBLEN 18
+#endif
+
+static void
+build_objc_exception_stuff (void)
+{
+ tree field_decl, field_decl_chain, index, temp_type;
+
+ /* Suppress outputting debug symbols, because
+ dbxout_init hasn't been called yet. */
+ enum debug_info_type save_write_symbols = write_symbols;
+ const struct gcc_debug_hooks *save_hooks = debug_hooks;
+
+ write_symbols = NO_DEBUG;
+ debug_hooks = &do_nothing_debug_hooks;
+ objc_exception_data_template
+ = start_struct (RECORD_TYPE, get_identifier (UTAG_EXCDATA));
+
+ /* int buf[_JBLEN]; */
+
+ index = build_index_type (build_int_2 (_JBLEN - 1, 0));
+ field_decl = create_builtin_decl (FIELD_DECL,
+ build_array_type (integer_type_node, index),
+ "buf");
+ field_decl_chain = field_decl;
+
+ /* void *pointers[4]; */
+
+ index = build_index_type (build_int_2 (4 - 1, 0));
+ field_decl = create_builtin_decl (FIELD_DECL,
+ build_array_type (ptr_type_node, index),
+ "pointers");
+ chainon (field_decl_chain, field_decl);
+
+ finish_struct (objc_exception_data_template, field_decl_chain, NULL_TREE);
+
+ /* int _setjmp(...); */
+ /* If the user includes <setjmp.h>, this shall be superceded by
+ 'int _setjmp(jmp_buf);' */
+ temp_type = build_function_type (integer_type_node, NULL_TREE);
+ objc_setjmp_decl
+ = builtin_function (TAG_SETJMP, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+
+ /* id objc_exception_extract(struct _objc_exception_data *); */
+ temp_type
+ = build_function_type (id_type,
+ tree_cons (NULL_TREE,
+ build_pointer_type (objc_exception_data_template),
+ OBJC_VOID_AT_END));
+ objc_exception_extract_decl
+ = builtin_function (TAG_EXCEPTIONEXTRACT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ /* void objc_exception_try_enter(struct _objc_exception_data *); */
+ /* void objc_exception_try_exit(struct _objc_exception_data *); */
+ temp_type
+ = build_function_type (void_type_node,
+ tree_cons (NULL_TREE,
+ build_pointer_type (objc_exception_data_template),
+ OBJC_VOID_AT_END));
+ objc_exception_try_enter_decl
+ = builtin_function (TAG_EXCEPTIONTRYENTER, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ objc_exception_try_exit_decl
+ = builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ /* void objc_exception_throw(id) __attribute__((noreturn)); */
+ /* void objc_sync_enter(id); */
+ /* void objc_sync_exit(id); */
+ temp_type = build_function_type (void_type_node,
+ tree_cons (NULL_TREE, id_type,
+ OBJC_VOID_AT_END));
+ objc_exception_throw_decl
+ = builtin_function (TAG_EXCEPTIONTHROW, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ DECL_ATTRIBUTES (objc_exception_throw_decl)
+ = tree_cons (get_identifier ("noreturn"), NULL_TREE, NULL_TREE);
+ objc_sync_enter_decl
+ = builtin_function (TAG_SYNCENTER, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ objc_sync_exit_decl
+ = builtin_function (TAG_SYNCEXIT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ /* int objc_exception_match(id, id); */
+ temp_type = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, id_type,
+ tree_cons (NULL_TREE, id_type,
+ OBJC_VOID_AT_END)));
+ objc_exception_match_decl
+ = builtin_function (TAG_EXCEPTIONMATCH, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+
+ write_symbols = save_write_symbols;
+ debug_hooks = save_hooks;
+}
+
/* struct <classname> {
struct objc_class *isa;
...
}; */
static tree
-build_private_template (class)
- tree class;
+build_private_template (tree class)
{
tree ivar_context;
@@ -2503,8 +3403,7 @@ build_private_template (class)
else
{
uprivate_record = start_struct (RECORD_TYPE, CLASS_NAME (class));
-
- ivar_context = get_class_ivars (class);
+ ivar_context = get_class_ivars (class, 0);
finish_struct (uprivate_record, ivar_context, NULL_TREE);
@@ -2533,7 +3432,7 @@ build_private_template (class)
}; */
static tree
-build_protocol_template ()
+build_protocol_template (void)
{
tree decl_specs, field_decl, field_decl_chain;
tree template;
@@ -2591,9 +3490,7 @@ build_protocol_template ()
}
static tree
-build_descriptor_table_initializer (type, entries)
- tree type;
- tree entries;
+build_descriptor_table_initializer (tree type, tree entries)
{
tree initlist = NULL_TREE;
@@ -2626,15 +3523,13 @@ build_descriptor_table_initializer (type, entries)
/* struct objc_method_prototype_list {
int count;
struct objc_method_prototype {
- SEL name;
- char *types;
+ SEL name;
+ char *types;
} list[1];
}; */
static tree
-build_method_prototype_list_template (list_type, size)
- tree list_type;
- int size;
+build_method_prototype_list_template (tree list_type, int size)
{
tree objc_ivar_list_record;
tree decl_specs, field_decl, field_decl_chain;
@@ -2664,7 +3559,7 @@ build_method_prototype_list_template (list_type, size)
}
static tree
-build_method_prototype_template ()
+build_method_prototype_template (void)
{
tree proto_record;
tree decl_specs, field_decl, field_decl_chain;
@@ -2690,118 +3585,97 @@ build_method_prototype_template ()
return proto_record;
}
-/* True if last call to forwarding_offset yielded a register offset. */
-static int offset_is_register;
+static tree
+objc_method_parm_type (tree type)
+{
+ type = groktypename (TREE_TYPE (type));
+ if (TREE_CODE (type) == TYPE_DECL)
+ type = TREE_TYPE (type);
+ return TYPE_MAIN_VARIANT (type);
+}
static int
-forwarding_offset (parm)
- tree parm;
+objc_encoded_type_size (tree type)
{
- int offset_in_bytes;
-
- if (GET_CODE (DECL_INCOMING_RTL (parm)) == MEM)
- {
- rtx addr = XEXP (DECL_INCOMING_RTL (parm), 0);
+ int sz = int_size_in_bytes (type);
- /* ??? Here we assume that the parm address is indexed
- off the frame pointer or arg pointer.
- If that is not true, we produce meaningless results,
- but do not crash. */
- if (GET_CODE (addr) == PLUS
- && GET_CODE (XEXP (addr, 1)) == CONST_INT)
- offset_in_bytes = INTVAL (XEXP (addr, 1));
- else
- offset_in_bytes = 0;
-
- offset_in_bytes += OBJC_FORWARDING_STACK_OFFSET;
- offset_is_register = 0;
- }
- else if (GET_CODE (DECL_INCOMING_RTL (parm)) == REG)
- {
- int regno = REGNO (DECL_INCOMING_RTL (parm));
- offset_in_bytes = apply_args_register_offset (regno);
- offset_is_register = 1;
- }
- else
- return 0;
-
- /* This is the case where the parm is passed as an int or double
- and it is converted to a char, short or float and stored back
- in the parmlist. In this case, describe the parm
- with the variable's declared type, and adjust the address
- if the least significant bytes (which we are using) are not
- the first ones. */
- if (BYTES_BIG_ENDIAN && TREE_TYPE (parm) != DECL_ARG_TYPE (parm))
- offset_in_bytes += (GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parm)))
- - GET_MODE_SIZE (GET_MODE (DECL_RTL (parm))));
-
- return offset_in_bytes;
+ /* Make all integer and enum types at least as large
+ as an int. */
+ if (sz > 0 && (TREE_CODE (type) == INTEGER_TYPE
+ || TREE_CODE (type) == BOOLEAN_TYPE
+ || TREE_CODE (type) == ENUMERAL_TYPE))
+ sz = MAX (sz, int_size_in_bytes (integer_type_node));
+ /* Treat arrays as pointers, since that's how they're
+ passed in. */
+ else if (TREE_CODE (type) == ARRAY_TYPE)
+ sz = int_size_in_bytes (ptr_type_node);
+ return sz;
}
static tree
-encode_method_prototype (method_decl, func_decl)
- tree method_decl;
- tree func_decl;
+encode_method_prototype (tree method_decl)
{
tree parms;
- int stack_size, i;
- tree user_args;
- HOST_WIDE_INT max_parm_end = 0;
+ int parm_offset, i;
char buf[40];
tree result;
/* ONEWAY and BYCOPY, for remote object are the only method qualifiers. */
encode_type_qualifiers (TREE_PURPOSE (TREE_TYPE (method_decl)));
- /* C type. */
- encode_type (TREE_TYPE (TREE_TYPE (func_decl)),
+ /* Encode return type. */
+ encode_type (objc_method_parm_type (method_decl),
obstack_object_size (&util_obstack),
OBJC_ENCODE_INLINE_DEFS);
/* Stack size. */
- for (parms = DECL_ARGUMENTS (func_decl); parms;
+ /* The first two arguments (self and _cmd) are pointers; account for
+ their size. */
+ i = int_size_in_bytes (ptr_type_node);
+ parm_offset = 2 * i;
+ for (parms = METHOD_SEL_ARGS (method_decl); parms;
parms = TREE_CHAIN (parms))
{
- HOST_WIDE_INT parm_end = (forwarding_offset (parms)
- + int_size_in_bytes (TREE_TYPE (parms)));
+ tree type = objc_method_parm_type (parms);
+ int sz = objc_encoded_type_size (type);
- if (!offset_is_register && max_parm_end < parm_end)
- max_parm_end = parm_end;
+ /* If a type size is not known, bail out. */
+ if (sz < 0)
+ {
+ error ("%Htype '%D' does not have a known size",
+ &DECL_SOURCE_LOCATION (type), type);
+ /* Pretend that the encoding succeeded; the compilation will
+ fail nevertheless. */
+ goto finish_encoding;
+ }
+ parm_offset += sz;
}
- stack_size = max_parm_end - OBJC_FORWARDING_MIN_OFFSET;
-
- sprintf (buf, "%d", stack_size);
+ sprintf (buf, "%d@0:%d", parm_offset, i);
obstack_grow (&util_obstack, buf, strlen (buf));
- user_args = METHOD_SEL_ARGS (method_decl);
-
/* Argument types. */
- for (parms = DECL_ARGUMENTS (func_decl), i = 0; parms;
- parms = TREE_CHAIN (parms), i++)
+ parm_offset = 2 * i;
+ for (parms = METHOD_SEL_ARGS (method_decl); parms;
+ parms = TREE_CHAIN (parms))
{
+ tree type = objc_method_parm_type (parms);
+
/* Process argument qualifiers for user supplied arguments. */
- if (i > 1)
- {
- encode_type_qualifiers (TREE_PURPOSE (TREE_TYPE (user_args)));
- user_args = TREE_CHAIN (user_args);
- }
+ encode_type_qualifiers (TREE_PURPOSE (TREE_TYPE (parms)));
/* Type. */
- encode_type (TREE_TYPE (parms),
- obstack_object_size (&util_obstack),
+ encode_type (type, obstack_object_size (&util_obstack),
OBJC_ENCODE_INLINE_DEFS);
/* Compute offset. */
- sprintf (buf, "%d", forwarding_offset (parms));
+ sprintf (buf, "%d", parm_offset);
+ parm_offset += objc_encoded_type_size (type);
- /* Indicate register. */
- if (offset_is_register)
- obstack_1grow (&util_obstack, '+');
-
obstack_grow (&util_obstack, buf, strlen (buf));
}
+ finish_encoding:
obstack_1grow (&util_obstack, '\0');
result = get_identifier (obstack_finish (&util_obstack));
obstack_free (&util_obstack, util_firstobj);
@@ -2809,12 +3683,8 @@ encode_method_prototype (method_decl, func_decl)
}
static tree
-generate_descriptor_table (type, name, size, list, proto)
- tree type;
- const char *name;
- int size;
- tree list;
- tree proto;
+generate_descriptor_table (tree type, const char *name, int size, tree list,
+ tree proto)
{
tree sc_spec, decl_specs, decl, initlist;
@@ -2835,8 +3705,7 @@ generate_descriptor_table (type, name, size, list, proto)
}
static void
-generate_method_descriptors (protocol)
- tree protocol;
+generate_method_descriptors (tree protocol)
{
tree initlist, chain, method_list_template;
tree cast, variable_length_type;
@@ -2859,7 +3728,7 @@ generate_method_descriptors (protocol)
= build_method_prototype_list_template (objc_method_prototype_template,
size);
- initlist
+ initlist
= build_descriptor_table_initializer (objc_method_prototype_template,
chain);
@@ -2894,108 +3763,8 @@ generate_method_descriptors (protocol)
UOBJC_INSTANCE_METHODS_decl = 0;
}
-/* Generate a temporary FUNCTION_DECL node to be used in
- hack_method_prototype below. */
-
-static GTY(()) int build_tmp_function_decl_xxx;
-static tree
-build_tmp_function_decl ()
-{
- tree decl_specs, expr_decl, parms;
- char buffer[80];
- tree tmp_decl;
-
- /* struct objc_object *objc_xxx (id, SEL, ...); */
- pushlevel (0);
- decl_specs = build_tree_list (NULL_TREE, objc_object_reference);
- push_parm_decl (build_tree_list
- (build_tree_list (decl_specs,
- build1 (INDIRECT_REF, NULL_TREE,
- NULL_TREE)),
- NULL_TREE));
-
- decl_specs = build_tree_list (NULL_TREE, xref_tag (RECORD_TYPE,
- get_identifier (TAG_SELECTOR)));
- expr_decl = build1 (INDIRECT_REF, NULL_TREE, NULL_TREE);
-
- push_parm_decl (build_tree_list (build_tree_list (decl_specs, expr_decl),
- NULL_TREE));
- parms = get_parm_info (0);
- poplevel (0, 0, 0);
-
- decl_specs = build_tree_list (NULL_TREE, objc_object_reference);
- sprintf (buffer, "__objc_tmp_%x", build_tmp_function_decl_xxx++);
- expr_decl = build_nt (CALL_EXPR, get_identifier (buffer), parms, NULL_TREE);
- expr_decl = build1 (INDIRECT_REF, NULL_TREE, expr_decl);
-
- tmp_decl = define_decl (expr_decl, decl_specs);
- DECL_SOURCE_LINE (tmp_decl) = 0;
-
- return tmp_decl;
-}
-
-/* Generate the prototypes for protocol methods. This is used to
- generate method encodings for these.
-
- NST_METHODS is the method to generate a _DECL node for TMP_DECL is
- a decl node to be used. This is also where the return value is
- given. */
-
-static void
-hack_method_prototype (nst_methods, tmp_decl)
- tree nst_methods;
- tree tmp_decl;
-{
- tree parms;
- tree parm;
-
- /* Hack to avoid problem with static typing of self arg. */
- TREE_SET_CODE (nst_methods, CLASS_METHOD_DECL);
- start_method_def (nst_methods);
- TREE_SET_CODE (nst_methods, INSTANCE_METHOD_DECL);
-
- if (METHOD_ADD_ARGS (nst_methods) == objc_ellipsis_node)
- parms = get_parm_info (0); /* we have a `, ...' */
- else
- parms = get_parm_info (1); /* place a `void_at_end' */
-
- poplevel (0, 0, 0); /* Must be called BEFORE start_function. */
-
- /* Usually called from store_parm_decls -> init_function_start. */
-
- DECL_ARGUMENTS (tmp_decl) = TREE_PURPOSE (parms);
-
- if (current_function_decl)
- abort ();
- current_function_decl = tmp_decl;
-
- {
- /* Code taken from start_function. */
- tree restype = TREE_TYPE (TREE_TYPE (tmp_decl));
- /* Promote the value to int before returning it. */
- if (TREE_CODE (restype) == INTEGER_TYPE
- && TYPE_PRECISION (restype) < TYPE_PRECISION (integer_type_node))
- restype = integer_type_node;
- DECL_RESULT (tmp_decl) = build_decl (RESULT_DECL, 0, restype);
- }
-
- for (parm = DECL_ARGUMENTS (tmp_decl); parm; parm = TREE_CHAIN (parm))
- DECL_CONTEXT (parm) = tmp_decl;
-
- init_function_start (tmp_decl);
-
- /* Typically called from expand_function_start for function definitions. */
- assign_parms (tmp_decl);
-
- /* install return type */
- TREE_TYPE (TREE_TYPE (tmp_decl)) = groktypename (TREE_TYPE (nst_methods));
-
- current_function_decl = NULL;
-}
-
static void
-generate_protocol_references (plist)
- tree plist;
+generate_protocol_references (tree plist)
{
tree lproto;
@@ -3027,10 +3796,10 @@ generate_protocol_references (plist)
@protocol() or from a class/category implementation). These
statically allocated objects can be referred to via the static
(that is, private to this module) symbols _OBJC_PROTOCOL_n.
-
+
The statically allocated Protocol objects that we generate here
need to be fixed up at runtime in order to be used: the 'isa'
- pointer of the objects need to be set up to point to the 'Protocol'
+ pointer of the objects need to be set up to point to the 'Protocol'
class, as known at runtime.
The NeXT runtime fixes up all protocols at program startup time,
@@ -3053,16 +3822,15 @@ generate_protocol_references (plist)
being referenced multiple times when compiled with the GNU runtime,
and end up being fixed up multiple times at runtime inizialization.
But that doesn't hurt, it's just a little inefficient. */
+
static void
-generate_protocols ()
+generate_protocols (void)
{
- tree p, tmp_decl, encoding;
+ tree p, encoding;
tree sc_spec, decl_specs, decl;
tree initlist, protocol_name_expr, refs_decl, refs_expr;
tree cast_type2;
- tmp_decl = build_tmp_function_decl ();
-
if (! objc_protocol_template)
objc_protocol_template = build_protocol_template ();
@@ -3087,8 +3855,7 @@ generate_protocols ()
{
if (! METHOD_ENCODING (nst_methods))
{
- hack_method_prototype (nst_methods, tmp_decl);
- encoding = encode_method_prototype (nst_methods, tmp_decl);
+ encoding = encode_method_prototype (nst_methods);
METHOD_ENCODING (nst_methods) = encoding;
}
nst_methods = TREE_CHAIN (nst_methods);
@@ -3098,8 +3865,7 @@ generate_protocols ()
{
if (! METHOD_ENCODING (cls_methods))
{
- hack_method_prototype (cls_methods, tmp_decl);
- encoding = encode_method_prototype (cls_methods, tmp_decl);
+ encoding = encode_method_prototype (cls_methods);
METHOD_ENCODING (cls_methods) = encoding;
}
@@ -3155,13 +3921,9 @@ generate_protocols ()
}
static tree
-build_protocol_initializer (type, protocol_name, protocol_list,
- instance_methods, class_methods)
- tree type;
- tree protocol_name;
- tree protocol_list;
- tree instance_methods;
- tree class_methods;
+build_protocol_initializer (tree type, tree protocol_name,
+ tree protocol_list, tree instance_methods,
+ tree class_methods)
{
tree initlist = NULL_TREE, expr;
tree cast_type;
@@ -3210,7 +3972,7 @@ build_protocol_initializer (type, protocol_name, protocol_list,
}; */
static void
-build_category_template ()
+build_category_template (void)
{
tree decl_specs, field_decl, field_decl_chain;
@@ -3271,12 +4033,12 @@ build_category_template ()
}; */
static void
-build_selector_template ()
+build_selector_template (void)
{
tree decl_specs, field_decl, field_decl_chain;
- objc_selector_template
+ objc_selector_template
= start_struct (RECORD_TYPE, get_identifier (UTAG_SELECTOR));
/* void *sel_id; */
@@ -3313,11 +4075,18 @@ build_selector_template ()
struct objc_class *sibling_class;
}
struct objc_protocol_list *protocols;
+ if (flag_next_runtime)
+ void *sel_id;
void *gc_object_type;
}; */
+/* NB: The 'sel_id' and 'gc_object_type' fields are not being used by
+ the NeXT/Apple runtime; still, the compiler must generate them to
+ maintain backward binary compatibility (and to allow for future
+ expansion). */
+
static void
-build_class_template ()
+build_class_template (void)
{
tree decl_specs, field_decl, field_decl_chain;
@@ -3426,7 +4195,7 @@ build_class_template ()
/* struct objc_protocol **protocol_list; */
- decl_specs = build_tree_list (NULL_TREE,
+ decl_specs = build_tree_list (NULL_TREE,
xref_tag (RECORD_TYPE,
get_identifier (UTAG_PROTOCOL)));
field_decl
@@ -3436,12 +4205,16 @@ build_class_template ()
field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
- /* void *sel_id; */
+ if (flag_next_runtime)
+ {
+ /* void *sel_id; */
- decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]);
- field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("sel_id"));
- field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
- chainon (field_decl_chain, field_decl);
+ decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]);
+ field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("sel_id"));
+ field_decl
+ = grokfield (field_decl, decl_specs, NULL_TREE);
+ chainon (field_decl_chain, field_decl);
+ }
/* void *gc_object_type; */
@@ -3456,28 +4229,17 @@ build_class_template ()
/* Generate appropriate forward declarations for an implementation. */
static void
-synth_forward_declarations ()
+synth_forward_declarations (void)
{
- tree sc_spec, decl_specs, an_id;
+ tree an_id;
- /* extern struct objc_class _OBJC_CLASS_<my_name>; */
+ /* static struct objc_class _OBJC_CLASS_<my_name>; */
+ UOBJC_CLASS_decl = build_metadata_decl ("_OBJC_CLASS",
+ objc_class_template);
- an_id = synth_id_with_class_suffix ("_OBJC_CLASS", objc_implementation_context);
-
- sc_spec = build_tree_list (NULL_TREE, ridpointers[(int) RID_EXTERN]);
- decl_specs = tree_cons (NULL_TREE, objc_class_template, sc_spec);
- UOBJC_CLASS_decl = define_decl (an_id, decl_specs);
- TREE_USED (UOBJC_CLASS_decl) = 1;
- DECL_ARTIFICIAL (UOBJC_CLASS_decl) = 1;
-
- /* extern struct objc_class _OBJC_METACLASS_<my_name>; */
-
- an_id = synth_id_with_class_suffix ("_OBJC_METACLASS",
- objc_implementation_context);
-
- UOBJC_METACLASS_decl = define_decl (an_id, decl_specs);
- TREE_USED (UOBJC_METACLASS_decl) = 1;
- DECL_ARTIFICIAL(UOBJC_METACLASS_decl) = 1;
+ /* static struct objc_class _OBJC_METACLASS_<my_name>; */
+ UOBJC_METACLASS_decl = build_metadata_decl ("_OBJC_METACLASS",
+ objc_class_template);
/* Pre-build the following entities - for speed/convenience. */
@@ -3487,10 +4249,7 @@ synth_forward_declarations ()
}
static void
-error_with_ivar (message, decl, rawdecl)
- const char *message;
- tree decl;
- tree rawdecl;
+error_with_ivar (const char *message, tree decl, tree rawdecl)
{
error ("%H%s `%s'", &DECL_SOURCE_LOCATION (decl),
message, gen_declaration (rawdecl, errbuf));
@@ -3498,9 +4257,7 @@ error_with_ivar (message, decl, rawdecl)
}
static void
-check_ivars (inter, imp)
- tree inter;
- tree imp;
+check_ivars (tree inter, tree imp)
{
tree intdecls = CLASS_IVARS (inter);
tree impdecls = CLASS_IVARS (imp);
@@ -3511,6 +4268,10 @@ check_ivars (inter, imp)
{
tree t1, t2;
+#ifdef OBJCPLUS
+ if (intdecls && TREE_CODE (intdecls) == TYPE_DECL)
+ intdecls = TREE_CHAIN (intdecls);
+#endif
if (intdecls == 0 && impdecls == 0)
break;
if (intdecls == 0 || impdecls == 0)
@@ -3521,7 +4282,9 @@ check_ivars (inter, imp)
t1 = TREE_TYPE (intdecls); t2 = TREE_TYPE (impdecls);
- if (!comptypes (t1, t2))
+ if (!comptypes (t1, t2, false)
+ || !tree_int_cst_equal (TREE_VALUE (TREE_VALUE (rawintdecls)),
+ TREE_VALUE (TREE_VALUE (rawimpdecls))))
{
if (DECL_NAME (intdecls) == DECL_NAME (impdecls))
{
@@ -3552,16 +4315,23 @@ check_ivars (inter, imp)
}
}
-/* Set super_type to the data type node for struct objc_super *,
- first defining struct objc_super itself.
+/* Set 'objc_super_template' to the data type node for 'struct _objc_super'.
This needs to be done just once per compilation. */
-static tree
-build_super_template ()
+static void
+build_super_template (void)
{
- tree record, decl_specs, field_decl, field_decl_chain;
+ tree decl_specs, field_decl, field_decl_chain;
+
+ /* Suppress outputting debug symbols, because
+ dbxout_init hasn't been called yet. */
+ enum debug_info_type save_write_symbols = write_symbols;
+ const struct gcc_debug_hooks *save_hooks = debug_hooks;
- record = start_struct (RECORD_TYPE, get_identifier (UTAG_SUPER));
+ write_symbols = NO_DEBUG;
+ debug_hooks = &do_nothing_debug_hooks;
+
+ objc_super_template = start_struct (RECORD_TYPE, get_identifier (UTAG_SUPER));
/* struct objc_object *self; */
@@ -3580,14 +4350,10 @@ build_super_template ()
field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
- finish_struct (record, field_decl_chain, NULL_TREE);
+ finish_struct (objc_super_template, field_decl_chain, NULL_TREE);
- /* `struct objc_super *' */
- super_type = groktypename (build_tree_list (build_tree_list (NULL_TREE,
- record),
- build1 (INDIRECT_REF,
- NULL_TREE, NULL_TREE)));
- return record;
+ write_symbols = save_write_symbols;
+ debug_hooks = save_hooks;
}
/* struct objc_ivar {
@@ -3597,7 +4363,7 @@ build_super_template ()
}; */
static tree
-build_ivar_template ()
+build_ivar_template (void)
{
tree objc_ivar_id, objc_ivar_record;
tree decl_specs, field_decl, field_decl_chain;
@@ -3640,9 +4406,7 @@ build_ivar_template ()
}; */
static tree
-build_ivar_list_template (list_type, size)
- tree list_type;
- int size;
+build_ivar_list_template (tree list_type, int size)
{
tree objc_ivar_list_record;
tree decl_specs, field_decl, field_decl_chain;
@@ -3678,9 +4442,7 @@ build_ivar_list_template (list_type, size)
}; */
static tree
-build_method_list_template (list_type, size)
- tree list_type;
- int size;
+build_method_list_template (tree list_type, int size)
{
tree objc_ivar_list_record;
tree decl_specs, field_decl, field_decl_chain;
@@ -3691,7 +4453,7 @@ build_method_list_template (list_type, size)
decl_specs
= build_tree_list
- (NULL_TREE,
+ (NULL_TREE,
xref_tag (RECORD_TYPE,
get_identifier (UTAG_METHOD_PROTOTYPE_LIST)));
field_decl
@@ -3722,9 +4484,7 @@ build_method_list_template (list_type, size)
}
static tree
-build_ivar_list_initializer (type, field_decl)
- tree type;
- tree field_decl;
+build_ivar_list_initializer (tree type, tree field_decl)
{
tree initlist = NULL_TREE;
@@ -3759,11 +4519,12 @@ build_ivar_list_initializer (type, field_decl)
/* Set offset. */
ivar = tree_cons (NULL_TREE, byte_position (field_decl), ivar);
- initlist = tree_cons (NULL_TREE,
+ initlist = tree_cons (NULL_TREE,
objc_build_constructor (type, nreverse (ivar)),
initlist);
-
- field_decl = TREE_CHAIN (field_decl);
+ do
+ field_decl = TREE_CHAIN (field_decl);
+ while (field_decl && TREE_CODE (field_decl) != FIELD_DECL);
}
while (field_decl);
@@ -3772,11 +4533,7 @@ build_ivar_list_initializer (type, field_decl)
}
static tree
-generate_ivars_list (type, name, size, list)
- tree type;
- const char *name;
- int size;
- tree list;
+generate_ivars_list (tree type, const char *name, int size, tree list)
{
tree sc_spec, decl_specs, decl, initlist;
@@ -3796,8 +4553,22 @@ generate_ivars_list (type, name, size, list)
return decl;
}
+/* Count only the fields occurring in T. */
+static int
+ivar_list_length (t)
+ tree t;
+{
+ int count = 0;
+
+ for (; t; t = TREE_CHAIN (t))
+ if (TREE_CODE (t) == FIELD_DECL)
+ ++count;
+
+ return count;
+}
+
static void
-generate_ivar_lists ()
+generate_ivar_lists (void)
{
tree initlist, ivar_list_template, chain;
tree cast, variable_length_type;
@@ -3821,7 +4592,7 @@ generate_ivar_lists ()
if (CLASS_SUPER_NAME (implementation_template) == NULL_TREE
&& (chain = TYPE_FIELDS (objc_class_template)))
{
- size = list_length (chain);
+ size = ivar_list_length (chain);
ivar_list_template = build_ivar_list_template (objc_ivar_template, size);
initlist = build_ivar_list_initializer (objc_ivar_template, chain);
@@ -3837,7 +4608,7 @@ generate_ivar_lists ()
chain = CLASS_IVARS (implementation_template);
if (chain)
{
- size = list_length (chain);
+ size = ivar_list_length (chain);
ivar_list_template = build_ivar_list_template (objc_ivar_template, size);
initlist = build_ivar_list_initializer (objc_ivar_template, chain);
@@ -3853,9 +4624,7 @@ generate_ivar_lists ()
}
static tree
-build_dispatch_table_initializer (type, entries)
- tree type;
- tree entries;
+build_dispatch_table_initializer (tree type, tree entries)
{
tree initlist = NULL_TREE;
@@ -3870,19 +4639,19 @@ build_dispatch_table_initializer (type, entries)
/* Generate the method encoding if we don't have one already. */
if (! METHOD_ENCODING (entries))
METHOD_ENCODING (entries) =
- encode_method_def (METHOD_DEFINITION (entries));
+ encode_method_prototype (entries);
elemlist = tree_cons (NULL_TREE,
add_objc_string (METHOD_ENCODING (entries),
meth_var_types),
elemlist);
- elemlist = tree_cons (NULL_TREE,
+ elemlist = tree_cons (NULL_TREE,
build_unary_op (ADDR_EXPR,
METHOD_DEFINITION (entries), 1),
elemlist);
- initlist = tree_cons (NULL_TREE,
+ initlist = tree_cons (NULL_TREE,
objc_build_constructor (type, nreverse (elemlist)),
initlist);
@@ -3898,12 +4667,12 @@ build_dispatch_table_initializer (type, entries)
inane warnings, the definition of the dispatch table entries were
changed from:
- struct objc_method { SEL _cmd; ...; id (*_imp)(); };
+ struct objc_method { SEL _cmd; ...; id (*_imp)(); };
to:
- struct objc_method { SEL _cmd; ...; void *_imp; }; */
+ struct objc_method { SEL _cmd; ...; void *_imp; }; */
static tree
-build_method_template ()
+build_method_template (void)
{
tree _SLT_record;
tree decl_specs, field_decl, field_decl_chain;
@@ -3940,11 +4709,7 @@ build_method_template ()
static tree
-generate_dispatch_table (type, name, size, list)
- tree type;
- const char *name;
- int size;
- tree list;
+generate_dispatch_table (tree type, const char *name, int size, tree list)
{
tree sc_spec, decl_specs, decl, initlist;
@@ -3966,7 +4731,7 @@ generate_dispatch_table (type, name, size, list)
}
static void
-mark_referenced_methods ()
+mark_referenced_methods (void)
{
struct imp_entry *impent;
tree chain;
@@ -3976,20 +4741,21 @@ mark_referenced_methods ()
chain = CLASS_CLS_METHODS (impent->imp_context);
while (chain)
{
- cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)), 1);
+ cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
chain = TREE_CHAIN (chain);
}
+
chain = CLASS_NST_METHODS (impent->imp_context);
while (chain)
{
- cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)), 1);
+ cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
chain = TREE_CHAIN (chain);
}
}
}
static void
-generate_dispatch_tables ()
+generate_dispatch_tables (void)
{
tree initlist, chain, method_list_template;
tree cast, variable_length_type;
@@ -4057,8 +4823,7 @@ generate_dispatch_tables ()
}
static tree
-generate_protocol_list (i_or_p)
- tree i_or_p;
+generate_protocol_list (tree i_or_p)
{
tree initlist, decl_specs, sc_spec;
tree refs_decl, expr_decl, lproto, e, plist;
@@ -4144,14 +4909,9 @@ generate_protocol_list (i_or_p)
}
static tree
-build_category_initializer (type, cat_name, class_name,
- instance_methods, class_methods, protocol_list)
- tree type;
- tree cat_name;
- tree class_name;
- tree instance_methods;
- tree class_methods;
- tree protocol_list;
+build_category_initializer (tree type, tree cat_name, tree class_name,
+ tree instance_methods, tree class_methods,
+ tree protocol_list)
{
tree initlist = NULL_TREE, expr;
@@ -4211,21 +4971,16 @@ build_category_initializer (type, cat_name, class_name,
struct objc_class *sibling_class;
}
struct objc_protocol_list *protocols;
+ if (flag_next_runtime)
+ void *sel_id;
void *gc_object_type;
}; */
static tree
-build_shared_structure_initializer (type, isa, super, name, size, status,
- dispatch_table, ivar_list, protocol_list)
- tree type;
- tree isa;
- tree super;
- tree name;
- tree size;
- int status;
- tree dispatch_table;
- tree ivar_list;
- tree protocol_list;
+build_shared_structure_initializer (tree type, tree isa, tree super,
+ tree name, tree size, int status,
+ tree dispatch_table, tree ivar_list,
+ tree protocol_list)
{
tree initlist = NULL_TREE, expr;
@@ -4299,6 +5054,10 @@ build_shared_structure_initializer (type, isa, super, name, size, status,
initlist = tree_cons (NULL_TREE, expr, initlist);
}
+ if (flag_next_runtime)
+ /* sel_id = NULL */
+ initlist = tree_cons (NULL_TREE, build_int_2 (0, 0), initlist);
+
/* gc_object_type = NULL */
initlist = tree_cons (NULL_TREE, build_int_2 (0, 0), initlist);
@@ -4308,8 +5067,7 @@ build_shared_structure_initializer (type, isa, super, name, size, status,
/* static struct objc_category _OBJC_CATEGORY_<name> = { ... }; */
static void
-generate_category (cat)
- tree cat;
+generate_category (tree cat)
{
tree sc_spec, decl_specs, decl;
tree initlist, cat_name_expr, class_name_expr;
@@ -4351,7 +5109,6 @@ generate_category (cat)
UOBJC_CLASS_METHODS_decl,
protocol_decl);
- TREE_USED (decl) = 1;
finish_decl (decl, initlist, NULL_TREE);
}
@@ -4359,7 +5116,7 @@ generate_category (cat)
static struct objc_class _OBJC_CLASS_Foo={ ... }; */
static void
-generate_shared_structures ()
+generate_shared_structures (void)
{
tree sc_spec, decl_specs, decl;
tree name_expr, super_expr, root_expr;
@@ -4462,9 +5219,7 @@ generate_shared_structures ()
}
static tree
-synth_id_with_class_suffix (preamble, ctxt)
- const char *preamble;
- tree ctxt;
+synth_id_with_class_suffix (const char *preamble, tree ctxt)
{
char *string;
if (TREE_CODE (ctxt) == CLASS_IMPLEMENTATION_TYPE
@@ -4499,13 +5254,12 @@ synth_id_with_class_suffix (preamble, ctxt)
}
else
abort ();
-
+
return get_identifier (string);
}
static int
-is_objc_type_qualifier (node)
- tree node;
+is_objc_type_qualifier (tree node)
{
return (TREE_CODE (node) == IDENTIFIER_NODE
&& (node == ridpointers [(int) RID_CONST]
@@ -4522,8 +5276,7 @@ is_objc_type_qualifier (node)
type of id (otherwise grokdeclarator will default to int). */
static tree
-adjust_type_for_id_default (type)
- tree type;
+adjust_type_for_id_default (tree type)
{
tree declspecs, chain;
@@ -4539,7 +5292,7 @@ adjust_type_for_id_default (type)
chain = TREE_CHAIN (chain))
{
if (TYPED_OBJECT (TREE_VALUE (chain))
- && !(TREE_VALUE (type)
+ && !(TREE_VALUE (type)
&& TREE_CODE (TREE_VALUE (type)) == INDIRECT_REF))
error ("can not use an object as parameter to a method\n");
if (!is_objc_type_qualifier (TREE_VALUE (chain)))
@@ -4552,28 +5305,25 @@ adjust_type_for_id_default (type)
}
/* Usage:
- keyworddecl:
- selector ':' '(' typename ')' identifier
-
+ keyworddecl:
+ selector ':' '(' typename ')' identifier
+
Purpose:
- Transform an Objective-C keyword argument into
- the C equivalent parameter declarator.
-
+ Transform an Objective-C keyword argument into
+ the C equivalent parameter declarator.
+
In: key_name, an "identifier_node" (optional).
- arg_type, a "tree_list" (optional).
- arg_name, an "identifier_node".
-
+ arg_type, a "tree_list" (optional).
+ arg_name, an "identifier_node".
+
Note: It would be really nice to strongly type the preceding
- arguments in the function prototype; however, then I
- could not use the "accessor" macros defined in "tree.h".
-
+ arguments in the function prototype; however, then I
+ could not use the "accessor" macros defined in "tree.h".
+
Out: an instance of "keyword_decl". */
tree
-build_keyword_decl (key_name, arg_type, arg_name)
- tree key_name;
- tree arg_type;
- tree arg_name;
+build_keyword_decl (tree key_name, tree arg_type, tree arg_name)
{
tree keyword_decl;
@@ -4592,8 +5342,7 @@ build_keyword_decl (key_name, arg_type, arg_name)
/* Given a chain of keyword_decl's, synthesize the full keyword selector. */
static tree
-build_keyword_selector (selector)
- tree selector;
+build_keyword_selector (tree selector)
{
int len = 0;
tree key_chain, key_name;
@@ -4625,7 +5374,13 @@ build_keyword_selector (selector)
if (TREE_CODE (selector) == KEYWORD_DECL)
key_name = KEYWORD_KEY_NAME (key_chain);
else if (TREE_CODE (selector) == TREE_LIST)
- key_name = TREE_PURPOSE (key_chain);
+ {
+ key_name = TREE_PURPOSE (key_chain);
+ /* The keyword decl chain will later be used as a function argument
+ chain. Unhook the selector itself so as to not confuse other
+ parts of the compiler. */
+ TREE_PURPOSE (key_chain) = NULL_TREE;
+ }
else
abort ();
@@ -4640,11 +5395,8 @@ build_keyword_selector (selector)
/* Used for declarations and definitions. */
tree
-build_method_decl (code, ret_type, selector, add_args)
- enum tree_code code;
- tree ret_type;
- tree selector;
- tree add_args;
+build_method_decl (enum tree_code code, tree ret_type, tree selector,
+ tree add_args)
{
tree method_decl;
@@ -4675,18 +5427,16 @@ build_method_decl (code, ret_type, selector, add_args)
#define METHOD_DEF 0
#define METHOD_REF 1
-/* Used by `build_objc_method_call' and `comp_method_types'. Return
+/* Used by `build_objc_method_call' and `comp_proto_with_proto'. Return
an argument list for method METH. CONTEXT is either METHOD_DEF or
METHOD_REF, saying whether we are trying to define a method or call
one. SUPERFLAG says this is for a send to super; this makes a
difference for the NeXT calling sequence in which the lookup and
- the method call are done together. */
+ the method call are done together. If METH is null, user-defined
+ arguments (i.e., beyond self and _cmd) shall be represented by `...'. */
static tree
-get_arg_type_list (meth, context, superflag)
- tree meth;
- int context;
- int superflag;
+get_arg_type_list (tree meth, int context, int superflag)
{
tree arglist, akey;
@@ -4701,6 +5451,11 @@ get_arg_type_list (meth, context, superflag)
/* Selector type - will eventually change to `int'. */
chainon (arglist, build_tree_list (NULL_TREE, selector_type));
+ /* No actual method prototype given -- assume that remaining arguments
+ are `...'. */
+ if (!meth)
+ return arglist;
+
/* Build a list of argument types. */
for (akey = METHOD_SEL_ARGS (meth); akey; akey = TREE_CHAIN (akey))
{
@@ -4720,14 +5475,13 @@ get_arg_type_list (meth, context, superflag)
}
else
/* finalize the arglist...simulate get_parm_info (1) */
- chainon (arglist, build_tree_list (NULL_TREE, void_type_node));
+ chainon (arglist, OBJC_VOID_AT_END);
return arglist;
}
static tree
-check_duplicates (hsh)
- hash hsh;
+check_duplicates (hash hsh, int methods)
{
tree meth = NULL_TREE;
@@ -4737,14 +5491,16 @@ check_duplicates (hsh)
if (hsh->list)
{
- /* We have two methods with the same name and different types. */
+ /* We have two or more methods with the same name but
+ different types. */
attr loop;
char type = (TREE_CODE (meth) == INSTANCE_METHOD_DECL) ? '-' : '+';
- warning ("multiple declarations for method `%s'",
+ warning ("multiple %s named `%c%s' found",
+ methods ? "methods" : "selectors", type,
IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
- warn_with_method ("using", type, meth);
+ warn_with_method (methods ? "using" : "found", type, meth);
for (loop = hsh->list; loop; loop = loop->next)
warn_with_method ("also found", type, loop->value);
}
@@ -4758,52 +5514,53 @@ check_duplicates (hsh)
used. */
static tree
-receiver_is_class_object (receiver)
- tree receiver;
+receiver_is_class_object (tree receiver, int self, int super)
{
tree chain, exp, arg;
- /* The receiver is 'self' in the context of a class method. */
+ /* The receiver is 'self' or 'super' in the context of a class method. */
if (objc_method_context
- && receiver == self_decl
- && TREE_CODE (objc_method_context) == CLASS_METHOD_DECL)
- {
- return CLASS_NAME (objc_implementation_context);
- }
-
+ && TREE_CODE (objc_method_context) == CLASS_METHOD_DECL
+ && (self || super))
+ return (super
+ ? CLASS_SUPER_NAME (implementation_template)
+ : CLASS_NAME (implementation_template));
+
if (flag_next_runtime)
{
/* The receiver is a variable created by
build_class_reference_decl. */
if (TREE_CODE (receiver) == VAR_DECL
- && TREE_TYPE (receiver) == objc_class_type)
- /* Look up the identifier. */
+ && TREE_TYPE (TREE_TYPE (receiver)) == TREE_TYPE (objc_class_type))
+ /* Look up the identifier. */
for (chain = cls_ref_chain; chain; chain = TREE_CHAIN (chain))
if (TREE_PURPOSE (chain) == receiver)
- return TREE_VALUE (chain);
- }
- else
- {
- /* The receiver is a function call that returns an id. Check if
- it is a call to objc_getClass, if so, pick up the class name. */
- if (TREE_CODE (receiver) == CALL_EXPR
- && (exp = TREE_OPERAND (receiver, 0))
- && TREE_CODE (exp) == ADDR_EXPR
- && (exp = TREE_OPERAND (exp, 0))
- && TREE_CODE (exp) == FUNCTION_DECL
- && exp == objc_get_class_decl
- /* We have a call to objc_getClass! */
- && (arg = TREE_OPERAND (receiver, 1))
- && TREE_CODE (arg) == TREE_LIST
- && (arg = TREE_VALUE (arg)))
- {
- STRIP_NOPS (arg);
- if (TREE_CODE (arg) == ADDR_EXPR
- && (arg = TREE_OPERAND (arg, 0))
- && TREE_CODE (arg) == STRING_CST)
- /* Finally, we have the class name. */
- return get_identifier (TREE_STRING_POINTER (arg));
- }
+ return TREE_VALUE (chain);
+ }
+
+ /* The receiver is a function call that returns an id. Check if
+ it is a call to objc_getClass, if so, pick up the class name. */
+ if (TREE_CODE (receiver) == CALL_EXPR
+ && (exp = TREE_OPERAND (receiver, 0))
+ && TREE_CODE (exp) == ADDR_EXPR
+ && (exp = TREE_OPERAND (exp, 0))
+ && TREE_CODE (exp) == FUNCTION_DECL
+ /* For some reason, we sometimes wind up with multiple FUNCTION_DECL
+ prototypes for objc_get_class(). Thankfuly, they seem to share the
+ same function type. */
+ && TREE_TYPE (exp) == TREE_TYPE (objc_get_class_decl)
+ && !strcmp (IDENTIFIER_POINTER (DECL_NAME (exp)), TAG_GETCLASS)
+ /* We have a call to objc_get_class/objc_getClass! */
+ && (arg = TREE_OPERAND (receiver, 1))
+ && TREE_CODE (arg) == TREE_LIST
+ && (arg = TREE_VALUE (arg)))
+ {
+ STRIP_NOPS (arg);
+ if (TREE_CODE (arg) == ADDR_EXPR
+ && (arg = TREE_OPERAND (arg, 0))
+ && TREE_CODE (arg) == STRING_CST)
+ /* Finally, we have the class name. */
+ return get_identifier (TREE_STRING_POINTER (arg));
}
return 0;
}
@@ -4815,7 +5572,7 @@ receiver_is_class_object (receiver)
static tree current_objc_message_selector = 0;
tree
-objc_message_selector ()
+objc_message_selector (void)
{
return current_objc_message_selector;
}
@@ -4828,8 +5585,7 @@ objc_message_selector ()
(*(<abstract_decl>(*)())_msgSuper)(receiver, selTransTbl[n], ...); */
tree
-build_message_expr (mess)
- tree mess;
+build_message_expr (tree mess)
{
tree receiver = TREE_PURPOSE (mess);
tree sel_name;
@@ -4872,223 +5628,186 @@ build_message_expr (mess)
method_params = args;
}
+#ifdef OBJCPLUS
+ if (processing_template_decl)
+ /* Must wait until template instantiation time. */
+ return build_min_nt (MESSAGE_SEND_EXPR, receiver, sel_name,
+ method_params);
+#endif
+
return finish_message_expr (receiver, sel_name, method_params);
}
+static tree
+lookup_method_in_hash_lists (tree sel_name)
+{
+ hash method_prototype = hash_lookup (nst_method_hash_list,
+ sel_name);
+
+ if (!method_prototype)
+ method_prototype = hash_lookup (cls_method_hash_list,
+ sel_name);
+
+ return check_duplicates (method_prototype, 1);
+}
+
/* The 'finish_message_expr' routine is called from within
'build_message_expr' for non-template functions. In the case of
C++ template functions, it is called from 'build_expr_from_tree'
(in decl2.c) after RECEIVER and METHOD_PARAMS have been expanded. */
-
+
tree
-finish_message_expr (receiver, sel_name, method_params)
- tree receiver, sel_name, method_params;
-{
- tree method_prototype = NULL_TREE, class_ident = NULL_TREE;
- tree selector, self_object, retval;
- int statically_typed = 0, statically_allocated = 0;
-
- /* Determine receiver type. */
- tree rtype = TREE_TYPE (receiver);
- int super = IS_SUPER (rtype);
-
- if (! super)
- {
- if (TREE_STATIC_TEMPLATE (rtype))
- statically_allocated = 1;
- else if (TREE_CODE (rtype) == POINTER_TYPE
- && TREE_STATIC_TEMPLATE (TREE_TYPE (rtype)))
- statically_typed = 1;
- else if ((flag_next_runtime
- || (IS_ID (rtype)))
- && (class_ident = receiver_is_class_object (receiver)))
- ;
- else if (! IS_ID (rtype)
- /* Allow any type that matches objc_class_type. */
- && ! comptypes (rtype, objc_class_type))
+finish_message_expr (tree receiver, tree sel_name, tree method_params)
+{
+ tree method_prototype = NULL_TREE, rprotos = NULL_TREE, rtype;
+ tree selector, retval, is_class;
+ int self, super, have_cast;
+
+ /* Extract the receiver of the message, as well as its type
+ (where the latter may take the form of a cast or be inferred
+ from the implementation context). */
+ rtype = receiver;
+ while (TREE_CODE (rtype) == COMPOUND_EXPR
+ || TREE_CODE (rtype) == MODIFY_EXPR
+ || TREE_CODE (rtype) == NOP_EXPR
+ || TREE_CODE (rtype) == COMPONENT_REF)
+ rtype = TREE_OPERAND (rtype, 0);
+ self = (rtype == self_decl);
+ super = (rtype == UOBJC_SUPER_decl);
+ rtype = TREE_TYPE (receiver);
+ have_cast = (TREE_CODE (receiver) == NOP_EXPR
+ || (TREE_CODE (receiver) == COMPOUND_EXPR
+ && !IS_SUPER (rtype)));
+
+ /* If the receiver is a class object, retrieve the corresponding
+ @interface, if one exists. */
+ is_class = receiver_is_class_object (receiver, self, super);
+
+ /* Now determine the receiver type (if an explicit cast has not been
+ provided). */
+ if (!have_cast)
+ {
+ if (is_class)
+ rtype = lookup_interface (is_class);
+ /* Handle `self' and `super'. */
+ else if (super)
{
- warning ("invalid receiver type `%s'",
- gen_declaration (rtype, errbuf));
+ if (!CLASS_SUPER_NAME (implementation_template))
+ {
+ error ("no super class declared in @interface for `%s'",
+ IDENTIFIER_POINTER (CLASS_NAME (implementation_template)));
+ return error_mark_node;
+ }
+ rtype = lookup_interface (CLASS_SUPER_NAME (implementation_template));
}
- if (statically_allocated)
- receiver = build_unary_op (ADDR_EXPR, receiver, 0);
-
- /* Don't evaluate the receiver twice. */
- receiver = save_expr (receiver);
- self_object = receiver;
+ else if (self)
+ rtype = lookup_interface (CLASS_NAME (implementation_template));
}
- else
- /* If sending to `super', use current self as the object. */
- self_object = self_decl;
-
- /* Determine operation return type. */
- if (super)
+ /* If receiver is of type `id' or `Class' (or if the @interface for a
+ class is not visible), we shall be satisfied with the existence of
+ any instance or class method. */
+ if (!rtype || IS_ID (rtype)
+ || TREE_TYPE (rtype) == TREE_TYPE (objc_class_type))
{
- tree iface;
-
- if (CLASS_SUPER_NAME (implementation_template))
+ if (!rtype)
+ rtype = xref_tag (RECORD_TYPE, is_class);
+ else if (IS_ID (rtype))
{
- iface
- = lookup_interface (CLASS_SUPER_NAME (implementation_template));
-
- if (TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL)
- method_prototype = lookup_instance_method_static (iface, sel_name);
- else
- method_prototype = lookup_class_method_static (iface, sel_name);
-
- if (iface && !method_prototype)
- warning ("`%s' does not respond to `%s'",
- IDENTIFIER_POINTER (CLASS_SUPER_NAME (implementation_template)),
- IDENTIFIER_POINTER (sel_name));
+ rprotos = TYPE_PROTOCOL_LIST (rtype);
+ rtype = NULL_TREE;
}
else
- {
- error ("no super class declared in interface for `%s'",
- IDENTIFIER_POINTER (CLASS_NAME (implementation_template)));
- return error_mark_node;
- }
+ is_class = TYPE_NAME (rtype) = get_identifier ("Class");
- }
- else if (statically_allocated)
- {
- tree ctype = TREE_TYPE (rtype);
- tree iface = lookup_interface (TYPE_NAME (rtype));
-
- if (iface)
- method_prototype = lookup_instance_method_static (iface, sel_name);
-
- if (! method_prototype && ctype && TYPE_PROTOCOL_LIST (ctype))
+ if (rprotos)
method_prototype
- = lookup_method_in_protocol_list (TYPE_PROTOCOL_LIST (ctype),
- sel_name, 0);
-
- if (!method_prototype)
- warning ("`%s' does not respond to `%s'",
- IDENTIFIER_POINTER (TYPE_NAME (rtype)),
- IDENTIFIER_POINTER (sel_name));
+ = lookup_method_in_protocol_list (rprotos, sel_name,
+ is_class != NULL_TREE);
+ if (!method_prototype && !rprotos)
+ method_prototype
+ = (is_class
+ ? check_duplicates (hash_lookup (cls_method_hash_list, sel_name), 1)
+ : lookup_method_in_hash_lists (sel_name));
}
- else if (statically_typed)
+ else
{
- tree ctype = TREE_TYPE (rtype);
-
- /* `self' is now statically_typed. All methods should be visible
- within the context of the implementation. */
- if (objc_implementation_context
- && CLASS_NAME (objc_implementation_context) == TYPE_NAME (ctype))
+ tree orig_rtype = rtype, saved_rtype;
+
+ if (TREE_CODE (rtype) == POINTER_TYPE)
+ rtype = TREE_TYPE (rtype);
+ /* Traverse typedef aliases */
+ while (TREE_CODE (rtype) == RECORD_TYPE && TYPE_NAME (rtype)
+ && TREE_CODE (TYPE_NAME (rtype)) == TYPE_DECL
+ && DECL_ORIGINAL_TYPE (TYPE_NAME (rtype)))
+ rtype = DECL_ORIGINAL_TYPE (TYPE_NAME (rtype));
+ saved_rtype = rtype;
+ if (TYPED_OBJECT (rtype))
{
- method_prototype
- = lookup_instance_method_static (implementation_template,
- sel_name);
-
- if (! method_prototype && TYPE_PROTOCOL_LIST (ctype))
- method_prototype
- = lookup_method_in_protocol_list (TYPE_PROTOCOL_LIST (ctype),
- sel_name, 0);
-
- if (! method_prototype
- && implementation_template != objc_implementation_context)
- /* The method is not published in the interface. Check
- locally. */
- method_prototype
- = lookup_method (CLASS_NST_METHODS (objc_implementation_context),
- sel_name);
- }
- else
- {
- tree iface;
-
- if ((iface = lookup_interface (TYPE_NAME (ctype))))
- method_prototype = lookup_instance_method_static (iface, sel_name);
-
- if (! method_prototype)
- {
- tree protocol_list = TYPE_PROTOCOL_LIST (ctype);
- if (protocol_list)
- method_prototype
- = lookup_method_in_protocol_list (protocol_list,
- sel_name, 0);
- }
+ rprotos = TYPE_PROTOCOL_LIST (rtype);
+ rtype = lookup_interface (OBJC_TYPE_NAME (rtype));
}
-
- if (!method_prototype)
- warning ("`%s' does not respond to `%s'",
- IDENTIFIER_POINTER (TYPE_NAME (ctype)),
- IDENTIFIER_POINTER (sel_name));
- }
- else if (class_ident)
- {
- if (objc_implementation_context
- && CLASS_NAME (objc_implementation_context) == class_ident)
+ /* If we could not find an @interface declaration, we must have
+ only seen a @class declaration; so, we cannot say anything
+ more intelligent about which methods the receiver will
+ understand. */
+ if (!rtype)
+ rtype = saved_rtype;
+ else if (TREE_CODE (rtype) == CLASS_INTERFACE_TYPE
+ || TREE_CODE (rtype) == CLASS_IMPLEMENTATION_TYPE)
{
+ /* We have a valid ObjC class name. Look up the method name
+ in the published @interface for the class (and its
+ superclasses). */
method_prototype
- = lookup_class_method_static (implementation_template, sel_name);
+ = lookup_method_static (rtype, sel_name, is_class != NULL_TREE);
- if (!method_prototype
- && implementation_template != objc_implementation_context)
- /* The method is not published in the interface. Check
- locally. */
+ /* If the method was not found in the @interface, it may still
+ exist locally as part of the @implementation. */
+ if (!method_prototype && objc_implementation_context
+ && CLASS_NAME (objc_implementation_context)
+ == OBJC_TYPE_NAME (rtype))
+ method_prototype
+ = lookup_method
+ ((is_class
+ ? CLASS_CLS_METHODS (objc_implementation_context)
+ : CLASS_NST_METHODS (objc_implementation_context)),
+ sel_name);
+
+ /* If we haven't found a candidate method by now, try looking for
+ it in the protocol list. */
+ if (!method_prototype && rprotos)
method_prototype
- = lookup_method (CLASS_CLS_METHODS (objc_implementation_context),
- sel_name);
+ = lookup_method_in_protocol_list (rprotos, sel_name,
+ is_class != NULL_TREE);
}
else
{
- tree iface;
-
- if ((iface = lookup_interface (class_ident)))
- method_prototype = lookup_class_method_static (iface, sel_name);
+ warning ("invalid receiver type `%s'",
+ gen_declaration (orig_rtype, errbuf));
+ rtype = rprotos = NULL_TREE;
}
+ }
- if (!method_prototype)
- {
- warning ("cannot find class (factory) method");
- warning ("return type for `%s' defaults to id",
- IDENTIFIER_POINTER (sel_name));
- }
- }
- else if (IS_PROTOCOL_QUALIFIED_ID (rtype))
+ if (!method_prototype)
{
- /* An anonymous object that has been qualified with a protocol. */
-
- tree protocol_list = TYPE_PROTOCOL_LIST (rtype);
-
- method_prototype = lookup_method_in_protocol_list (protocol_list,
- sel_name, 0);
-
- if (!method_prototype)
- {
- hash hsh;
-
- warning ("method `%s' not implemented by protocol",
- IDENTIFIER_POINTER (sel_name));
-
- /* Try and find the method signature in the global pools. */
-
- if (!(hsh = hash_lookup (nst_method_hash_list, sel_name)))
- hsh = hash_lookup (cls_method_hash_list, sel_name);
-
- if (!(method_prototype = check_duplicates (hsh)))
- warning ("return type defaults to id");
- }
- }
- else
- {
- hash hsh;
-
- /* We think we have an instance...loophole: extern id Object; */
- hsh = hash_lookup (nst_method_hash_list, sel_name);
-
- if (!hsh)
- /* For various loopholes */
- hsh = hash_lookup (cls_method_hash_list, sel_name);
+ static bool warn_missing_methods = false;
- method_prototype = check_duplicates (hsh);
- if (!method_prototype)
+ if (rtype)
+ warning ("`%s' may not respond to `%c%s'",
+ IDENTIFIER_POINTER (OBJC_TYPE_NAME (rtype)),
+ (is_class ? '+' : '-'),
+ IDENTIFIER_POINTER (sel_name));
+ if (rprotos)
+ warning ("`%c%s' not implemented by protocol(s)",
+ (is_class ? '+' : '-'),
+ IDENTIFIER_POINTER (sel_name));
+ if (!warn_missing_methods)
{
- warning ("cannot find method");
- warning ("return type for `%s' defaults to id",
- IDENTIFIER_POINTER (sel_name));
+ warning ("(Messages without a matching method signature");
+ warning ("will be assumed to return `id' and accept");
+ warning ("`...' as arguments.)");
+ warn_missing_methods = true;
}
}
@@ -5104,7 +5823,7 @@ finish_message_expr (receiver, sel_name, method_params)
selector = build_selector_reference (sel_name);
retval = build_objc_method_call (super, method_prototype,
- receiver, self_object,
+ receiver,
selector, method_params);
current_objc_message_selector = 0;
@@ -5120,75 +5839,69 @@ finish_message_expr (receiver, sel_name, method_params)
If SUPER_FLAG is nonzero, we look up the superclass's method. */
static tree
-build_objc_method_call (super_flag, method_prototype, lookup_object, object,
- selector, method_params)
- int super_flag;
- tree method_prototype, lookup_object, object, selector, method_params;
-{
- tree sender = (super_flag ? umsg_super_decl : umsg_decl);
- tree rcv_p = (super_flag
- ? build_pointer_type (xref_tag (RECORD_TYPE,
- get_identifier (TAG_SUPER)))
- : id_type);
+build_objc_method_call (int super_flag, tree method_prototype,
+ tree lookup_object, tree selector,
+ tree method_params)
+{
+ tree sender = (super_flag ? umsg_super_decl :
+ (!flag_next_runtime || flag_nil_receivers
+ ? umsg_decl
+ : umsg_nonnil_decl));
+ tree rcv_p = (super_flag ? super_type : id_type);
+
+ /* If a prototype for the method to be called exists, then cast
+ the sender's return type and arguments to match that of the method.
+ Otherwise, leave sender as is. */
+ tree ret_type
+ = (method_prototype
+ ? groktypename (TREE_TYPE (method_prototype))
+ : id_type);
+ tree sender_cast
+ = build_pointer_type
+ (build_function_type
+ (ret_type,
+ get_arg_type_list
+ (method_prototype, METHOD_REF, super_flag)));
+
+ lookup_object = build_c_cast (rcv_p, lookup_object);
if (flag_next_runtime)
{
- if (! method_prototype)
- {
- method_params = tree_cons (NULL_TREE, lookup_object,
- tree_cons (NULL_TREE, selector,
- method_params));
- assemble_external (sender);
- return build_function_call (sender, method_params);
- }
- else
- {
- /* This is a real kludge, but it is used only for the Next.
- Clobber the data type of SENDER temporarily to accept
- all the arguments for this operation, and to return
- whatever this operation returns. */
- tree arglist = NULL_TREE, retval, savarg, savret;
- tree ret_type = groktypename (TREE_TYPE (method_prototype));
-
- /* Save the proper contents of SENDER's data type. */
- savarg = TYPE_ARG_TYPES (TREE_TYPE (sender));
- savret = TREE_TYPE (TREE_TYPE (sender));
-
- /* Install this method's argument types. */
- arglist = get_arg_type_list (method_prototype, METHOD_REF,
- super_flag);
- TYPE_ARG_TYPES (TREE_TYPE (sender)) = arglist;
-
- /* Install this method's return type. */
- TREE_TYPE (TREE_TYPE (sender)) = ret_type;
-
- /* Call SENDER with all the parameters. This will do type
- checking using the arg types for this method. */
- method_params = tree_cons (NULL_TREE, lookup_object,
- tree_cons (NULL_TREE, selector,
- method_params));
- assemble_external (sender);
- retval = build_function_call (sender, method_params);
-
- /* Restore SENDER's return/argument types. */
- TYPE_ARG_TYPES (TREE_TYPE (sender)) = savarg;
- TREE_TYPE (TREE_TYPE (sender)) = savret;
- return retval;
- }
+#ifdef STRUCT_VALUE
+ /* If we are returning a struct in memory, and the address
+ of that memory location is passed as a hidden first
+ argument, then change which messenger entry point this
+ expr will call. NB: Note that sender_cast remains
+ unchanged (it already has a struct return type). */
+ if ((TREE_CODE (ret_type) == RECORD_TYPE
+ || TREE_CODE (ret_type) == UNION_TYPE)
+#if defined (DEFAULT_PCC_STRUCT_RETURN) && DEFAULT_PCC_STRUCT_RETURN == 0
+ && RETURN_IN_MEMORY (ret_type)
+#endif
+ && STRUCT_VALUE == 0)
+ sender = (super_flag ? umsg_super_stret_decl :
+ flag_nil_receivers ? umsg_stret_decl : umsg_nonnil_stret_decl);
+#endif
+ method_params = tree_cons (NULL_TREE, lookup_object,
+ tree_cons (NULL_TREE, selector,
+ method_params));
+ TREE_USED (sender) = 1;
+ assemble_external (sender);
+ /* We want to cast the sender, not convert it. */
+ return build_function_call (build_c_cast (sender_cast, sender),
+ method_params);
}
else
{
- /* This is the portable way.
- First call the lookup function to get a pointer to the method,
- then cast the pointer, then call it with the method arguments. */
- tree method;
-
- /* Avoid trouble since we may evaluate each of these twice. */
- object = save_expr (object);
- selector = save_expr (selector);
-
- lookup_object = build_c_cast (rcv_p, lookup_object);
+ /* This is the portable (GNU) way. */
+ tree method, object;
+ /* First, call the lookup function to get a pointer to the method,
+ then cast the pointer, then call it with the method arguments.
+ Use SAVE_EXPR to avoid evaluating the receiver twice. */
+ lookup_object = save_expr (lookup_object);
+ object = (super_flag ? self_decl : lookup_object);
+ TREE_USED (sender) = 1;
assemble_external (sender);
method
= build_function_call (sender,
@@ -5196,37 +5909,22 @@ build_objc_method_call (super_flag, method_prototype, lookup_object, object,
tree_cons (NULL_TREE, selector,
NULL_TREE)));
- /* If we have a method prototype, construct the data type this
- method needs, and cast what we got from SENDER into a pointer
- to that type. */
- if (method_prototype)
- {
- tree arglist = get_arg_type_list (method_prototype, METHOD_REF,
- super_flag);
- tree valtype = groktypename (TREE_TYPE (method_prototype));
- tree fake_function_type = build_function_type (valtype, arglist);
- TREE_TYPE (method) = build_pointer_type (fake_function_type);
- }
- else
- TREE_TYPE (method)
- = build_pointer_type (build_function_type (ptr_type_node, NULL_TREE));
-
/* Pass the object to the method. */
+ TREE_USED (method) = 1;
assemble_external (method);
- return build_function_call (method,
- tree_cons (NULL_TREE, object,
- tree_cons (NULL_TREE, selector,
- method_params)));
+ return build_function_call
+ (build_c_cast (sender_cast, method),
+ tree_cons (NULL_TREE, object,
+ tree_cons (NULL_TREE, selector, method_params)));
}
}
static void
-build_protocol_reference (p)
- tree p;
+build_protocol_reference (tree p)
{
tree decl, ident, ptype;
- /* extern struct objc_protocol _OBJC_PROTOCOL_<mumble>; */
+ /* static struct objc_protocol _OBJC_PROTOCOL_<mumble>; */
ident = synth_id_with_class_suffix ("_OBJC_PROTOCOL", p);
ptype
@@ -5240,7 +5938,7 @@ build_protocol_reference (p)
{
decl = build_decl (VAR_DECL, ident, ptype);
DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
+ TREE_PUBLIC (decl) = 0;
TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
@@ -5254,8 +5952,7 @@ build_protocol_reference (p)
/* This function is called by the parser when (and only when) a
@protocol() expression is found, in order to compile it. */
tree
-build_protocol_expr (protoname)
- tree protoname;
+build_protocol_expr (tree protoname)
{
tree expr;
tree p = lookup_protocol (protoname);
@@ -5292,10 +5989,10 @@ build_protocol_expr (protoname)
/* This type is a struct containing the fields of a Protocol
object. (Cfr. protocol_type instead is the type of a pointer
to such a struct). */
- tree protocol_struct_type = xref_tag
+ tree protocol_struct_type = xref_tag
(RECORD_TYPE, get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
tree *chain;
-
+
/* Look for the list of Protocol statically allocated instances
to fixup at runtime. Create a new list to hold Protocol
statically allocated instances, if the list is not found. At
@@ -5307,16 +6004,16 @@ build_protocol_expr (protoname)
if (!*chain)
{
*chain = tree_cons (NULL_TREE, protocol_struct_type, NULL_TREE);
- add_objc_string (TYPE_NAME (protocol_struct_type),
+ add_objc_string (OBJC_TYPE_NAME (protocol_struct_type),
class_names);
}
-
+
/* Add this statically allocated instance to the Protocol list. */
- TREE_PURPOSE (*chain) = tree_cons (NULL_TREE,
+ TREE_PURPOSE (*chain) = tree_cons (NULL_TREE,
PROTOCOL_FORWARD_DECL (p),
TREE_PURPOSE (*chain));
}
-
+
return expr;
}
@@ -5325,8 +6022,7 @@ build_protocol_expr (protoname)
is found, in order to compile it. It is only called by the parser
and only to compile a @selector(). */
tree
-build_selector_expr (selnamelist)
- tree selnamelist;
+build_selector_expr (tree selnamelist)
{
tree selname;
@@ -5350,20 +6046,20 @@ build_selector_expr (selnamelist)
/* First try with instance methods. */
hsh = hash_lookup (nst_method_hash_list, selname);
-
+
/* If not found, try with class methods. */
if (!hsh)
{
hsh = hash_lookup (cls_method_hash_list, selname);
}
-
+
/* If still not found, print out a warning. */
if (!hsh)
{
warning ("undeclared selector `%s'", IDENTIFIER_POINTER (selname));
}
}
-
+
if (flag_typed_selectors)
return build_typed_selector_reference (selname, 0);
@@ -5372,8 +6068,7 @@ build_selector_expr (selnamelist)
}
tree
-build_encode_expr (type)
- tree type;
+build_encode_expr (tree type)
{
tree result;
const char *string;
@@ -5390,8 +6085,7 @@ build_encode_expr (type)
}
tree
-build_ivar_reference (id)
- tree id;
+build_ivar_reference (tree id)
{
if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL)
{
@@ -5415,23 +6109,24 @@ build_ivar_reference (id)
/* Compute a hash value for a given method SEL_NAME. */
static size_t
-hash_func (sel_name)
- tree sel_name;
+hash_func (tree sel_name)
{
- const unsigned char *s
+ const unsigned char *s
= (const unsigned char *)IDENTIFIER_POINTER (sel_name);
size_t h = 0;
-
+
while (*s)
h = h * 67 + *s++ - 113;
- return h;
+ return h;
}
-
+
static void
-hash_init ()
+hash_init (void)
{
- nst_method_hash_list = (hash *) ggc_calloc (SIZEHASHTABLE, sizeof (hash));
- cls_method_hash_list = (hash *) ggc_calloc (SIZEHASHTABLE, sizeof (hash));
+ nst_method_hash_list
+ = (hash *) ggc_alloc_cleared (SIZEHASHTABLE * sizeof (hash));
+ cls_method_hash_list
+ = (hash *) ggc_alloc_cleared (SIZEHASHTABLE * sizeof (hash));
}
/* WARNING!!!! hash_enter is called with a method, and will peek
@@ -5440,9 +6135,7 @@ hash_init ()
entry's key (method) for comparison. */
static void
-hash_enter (hashlist, method)
- hash *hashlist;
- tree method;
+hash_enter (hash *hashlist, tree method)
{
hash obj;
int slot = hash_func (METHOD_SEL_NAME (method)) % SIZEHASHTABLE;
@@ -5456,9 +6149,7 @@ hash_enter (hashlist, method)
}
static hash
-hash_lookup (hashlist, sel_name)
- hash *hashlist;
- tree sel_name;
+hash_lookup (hash *hashlist, tree sel_name)
{
hash target;
@@ -5475,9 +6166,7 @@ hash_lookup (hashlist, sel_name)
}
static void
-hash_add_attr (entry, value)
- hash entry;
- tree value;
+hash_add_attr (hash entry, tree value)
{
attr obj;
@@ -5489,9 +6178,7 @@ hash_add_attr (entry, value)
}
static tree
-lookup_method (mchain, method)
- tree mchain;
- tree method;
+lookup_method (tree mchain, tree method)
{
tree key;
@@ -5511,204 +6198,114 @@ lookup_method (mchain, method)
}
static tree
-lookup_instance_method_static (interface, ident)
- tree interface;
- tree ident;
+lookup_method_static (tree interface, tree ident, int is_class)
{
+ tree meth = NULL_TREE, root_inter = NULL_TREE;
tree inter = interface;
- tree chain = CLASS_NST_METHODS (inter);
- tree meth = NULL_TREE;
- do
+ while (inter)
{
+ tree chain = is_class ? CLASS_CLS_METHODS (inter) : CLASS_NST_METHODS (inter);
+ tree category = inter;
+
+ /* First, look up the method in the class itself. */
if ((meth = lookup_method (chain, ident)))
return meth;
- if (CLASS_CATEGORY_LIST (inter))
+ /* Failing that, look for the method in each category of the class. */
+ while ((category = CLASS_CATEGORY_LIST (category)))
{
- tree category = CLASS_CATEGORY_LIST (inter);
- chain = CLASS_NST_METHODS (category);
-
- do
- {
- if ((meth = lookup_method (chain, ident)))
- return meth;
-
- /* Check for instance methods in protocols in categories. */
- if (CLASS_PROTOCOL_LIST (category))
- {
- if ((meth = (lookup_method_in_protocol_list
- (CLASS_PROTOCOL_LIST (category), ident, 0))))
- return meth;
- }
+ chain = is_class ? CLASS_CLS_METHODS (category) : CLASS_NST_METHODS (category);
- if ((category = CLASS_CATEGORY_LIST (category)))
- chain = CLASS_NST_METHODS (category);
- }
- while (category);
- }
-
- if (CLASS_PROTOCOL_LIST (inter))
- {
- if ((meth = (lookup_method_in_protocol_list
- (CLASS_PROTOCOL_LIST (inter), ident, 0))))
+ /* Check directly in each category. */
+ if ((meth = lookup_method (chain, ident)))
return meth;
- }
-
- if ((inter = lookup_interface (CLASS_SUPER_NAME (inter))))
- chain = CLASS_NST_METHODS (inter);
- }
- while (inter);
-
- return meth;
-}
-
-static tree
-lookup_class_method_static (interface, ident)
- tree interface;
- tree ident;
-{
- tree inter = interface;
- tree chain = CLASS_CLS_METHODS (inter);
- tree meth = NULL_TREE;
- tree root_inter = NULL_TREE;
- do
- {
- if ((meth = lookup_method (chain, ident)))
- return meth;
-
- if (CLASS_CATEGORY_LIST (inter))
- {
- tree category = CLASS_CATEGORY_LIST (inter);
- chain = CLASS_CLS_METHODS (category);
-
- do
+ /* Failing that, check in each category's protocols. */
+ if (CLASS_PROTOCOL_LIST (category))
{
- if ((meth = lookup_method (chain, ident)))
+ if ((meth = (lookup_method_in_protocol_list
+ (CLASS_PROTOCOL_LIST (category), ident, is_class))))
return meth;
-
- /* Check for class methods in protocols in categories. */
- if (CLASS_PROTOCOL_LIST (category))
- {
- if ((meth = (lookup_method_in_protocol_list
- (CLASS_PROTOCOL_LIST (category), ident, 1))))
- return meth;
- }
-
- if ((category = CLASS_CATEGORY_LIST (category)))
- chain = CLASS_CLS_METHODS (category);
}
- while (category);
}
- /* Check for class methods in protocols. */
+ /* If not found in categories, check in protocols of the main class. */
if (CLASS_PROTOCOL_LIST (inter))
{
if ((meth = (lookup_method_in_protocol_list
- (CLASS_PROTOCOL_LIST (inter), ident, 1))))
+ (CLASS_PROTOCOL_LIST (inter), ident, is_class))))
return meth;
}
+ /* Failing that, climb up the inheritance hierarchy. */
root_inter = inter;
- if ((inter = lookup_interface (CLASS_SUPER_NAME (inter))))
- chain = CLASS_CLS_METHODS (inter);
+ inter = lookup_interface (CLASS_SUPER_NAME (inter));
}
while (inter);
/* If no class (factory) method was found, check if an _instance_
method of the same name exists in the root class. This is what
- the Objective-C runtime will do. */
- return lookup_instance_method_static (root_inter, ident);
+ the Objective-C runtime will do. If an instance method was not
+ found, return 0. */
+ return is_class ? lookup_method_static (root_inter, ident, 0): NULL_TREE;
}
tree
-add_class_method (class, method)
- tree class;
- tree method;
+add_method (tree class, tree method, int is_class)
{
tree mth;
hash hsh;
- if (!(mth = lookup_method (CLASS_CLS_METHODS (class), method)))
+ if (!(mth = lookup_method (is_class ? CLASS_CLS_METHODS (class) : CLASS_NST_METHODS (class), method)))
{
/* put method on list in reverse order */
- TREE_CHAIN (method) = CLASS_CLS_METHODS (class);
- CLASS_CLS_METHODS (class) = method;
- }
- else
- {
- if (TREE_CODE (class) == CLASS_IMPLEMENTATION_TYPE)
- error ("duplicate definition of class method `%s'",
- IDENTIFIER_POINTER (METHOD_SEL_NAME (mth)));
+ if (is_class)
+ {
+ TREE_CHAIN (method) = CLASS_CLS_METHODS (class);
+ CLASS_CLS_METHODS (class) = method;
+ }
else
- {
- /* Check types; if different, complain. */
- if (!comp_proto_with_proto (method, mth))
- error ("duplicate declaration of class method `%s'",
- IDENTIFIER_POINTER (METHOD_SEL_NAME (mth)));
- }
- }
-
- if (!(hsh = hash_lookup (cls_method_hash_list, METHOD_SEL_NAME (method))))
- {
- /* Install on a global chain. */
- hash_enter (cls_method_hash_list, method);
- }
- else
- {
- /* Check types; if different, add to a list. */
- if (!comp_proto_with_proto (method, hsh->key))
- hash_add_attr (hsh, method);
- }
- return method;
-}
-
-tree
-add_instance_method (class, method)
- tree class;
- tree method;
-{
- tree mth;
- hash hsh;
-
- if (!(mth = lookup_method (CLASS_NST_METHODS (class), method)))
- {
- /* Put method on list in reverse order. */
- TREE_CHAIN (method) = CLASS_NST_METHODS (class);
- CLASS_NST_METHODS (class) = method;
+ {
+ TREE_CHAIN (method) = CLASS_NST_METHODS (class);
+ CLASS_NST_METHODS (class) = method;
+ }
}
else
{
- if (TREE_CODE (class) == CLASS_IMPLEMENTATION_TYPE)
- error ("duplicate definition of instance method `%s'",
- IDENTIFIER_POINTER (METHOD_SEL_NAME (mth)));
- else
- {
- /* Check types; if different, complain. */
- if (!comp_proto_with_proto (method, mth))
- error ("duplicate declaration of instance method `%s'",
- IDENTIFIER_POINTER (METHOD_SEL_NAME (mth)));
- }
+ /* When processing an @interface for a class or category, give hard errors on methods with
+ identical selectors but differing argument and/or return types. We do not do this for
+ @implementations, because C/C++ will do it for us (i.e., there will be
+ duplicate function definition errors). */
+ if ((TREE_CODE (class) == CLASS_INTERFACE_TYPE
+ || TREE_CODE (class) == CATEGORY_INTERFACE_TYPE)
+ && !comp_proto_with_proto (method, mth))
+ error ("duplicate declaration of method `%c%s'",
+ is_class ? '+' : '-', IDENTIFIER_POINTER (METHOD_SEL_NAME (mth)));
}
- if (!(hsh = hash_lookup (nst_method_hash_list, METHOD_SEL_NAME (method))))
+ if (!(hsh = hash_lookup (is_class
+ ? cls_method_hash_list
+ : nst_method_hash_list, METHOD_SEL_NAME (method))))
{
/* Install on a global chain. */
- hash_enter (nst_method_hash_list, method);
+ hash_enter (is_class ? cls_method_hash_list : nst_method_hash_list, method);
}
else
{
- /* Check types; if different, add to a list. */
- if (!comp_proto_with_proto (method, hsh->key))
- hash_add_attr (hsh, method);
+ /* Check types against those; if different, add to a list. */
+ attr loop;
+ int already_there = comp_proto_with_proto (method, hsh->key);
+ for (loop = hsh->list; !already_there && loop; loop = loop->next)
+ already_there |= comp_proto_with_proto (method, loop->value);
+ if (!already_there)
+ hash_add_attr (hsh, method);
}
return method;
}
static tree
-add_class (class)
- tree class;
+add_class (tree class)
{
/* Put interfaces on list in reverse order. */
TREE_CHAIN (class) = interface_chain;
@@ -5717,9 +6314,7 @@ add_class (class)
}
static void
-add_category (class, category)
- tree class;
- tree category;
+add_category (tree class, tree category)
{
/* Put categories on list in reverse order. */
tree cat = CLASS_CATEGORY_LIST (class);
@@ -5727,7 +6322,11 @@ add_category (class, category)
while (cat)
{
if (CLASS_SUPER_NAME (cat) == CLASS_SUPER_NAME (category))
+#ifdef OBJCPLUS
+ error ("duplicate interface declaration for category `%s(%s)'",
+#else
warning ("duplicate interface declaration for category `%s(%s)'",
+#endif
IDENTIFIER_POINTER (CLASS_NAME (class)),
IDENTIFIER_POINTER (CLASS_SUPER_NAME (category)));
cat = CLASS_CATEGORY_LIST (cat);
@@ -5743,23 +6342,64 @@ add_category (class, category)
PUBLIC is 1 for public, 0 for protected, and 2 for private. */
tree
-add_instance_variable (class, public, declarator, declspecs, width)
- tree class;
- int public;
- tree declarator;
- tree declspecs;
- tree width;
+add_instance_variable (tree class, int public, tree declarator,
+ tree declspecs, tree width)
{
- tree field_decl, raw_decl;
-
- raw_decl = build_tree_list (declspecs, declarator);
+ tree field_decl = grokfield (declarator, declspecs, width);
+ tree field_type = TREE_TYPE (field_decl);
+ const char *ivar_name = DECL_NAME (field_decl)
+ ? IDENTIFIER_POINTER (DECL_NAME (field_decl))
+ : "<unnamed>";
+ tree raw_decl;
- if (CLASS_RAW_IVARS (class))
- chainon (CLASS_RAW_IVARS (class), raw_decl);
- else
- CLASS_RAW_IVARS (class) = raw_decl;
+#ifdef OBJCPLUS
+ if (TREE_CODE (field_type) == REFERENCE_TYPE)
+ {
+ error ("illegal reference type specified for instance variable `%s'",
+ ivar_name);
+ /* Return class as is without adding this ivar. */
+ return class;
+ }
+#endif
- field_decl = grokfield (declarator, declspecs, width);
+ if (field_type == error_mark_node || !TYPE_SIZE (field_type)
+ || TYPE_SIZE (field_type) == error_mark_node
+ /* 'type[0]' is allowed, but 'type[]' is not! */
+#ifdef OBJCPLUS
+ || (TYPE_SIZE (field_type) == bitsize_zero_node
+ && !TREE_OPERAND (declarator, 1))
+#endif
+ )
+ {
+ error ("instance variable `%s' has unknown size", ivar_name);
+ /* Return class as is without adding this ivar. */
+ return class;
+ }
+
+#ifdef OBJCPLUS
+ /* zlaski 2001-Apr-24: C++ classes with non-trivial constructors and/or destructors
+ cannot be ivars; ditto for classes with vtables. */
+ if(IS_AGGR_TYPE (field_type) && (TYPE_NEEDS_CONSTRUCTING (field_type)
+ || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type) || TYPE_POLYMORPHIC_P (field_type)))
+ {
+ const char *type_name = IDENTIFIER_POINTER (OBJC_TYPE_NAME (field_type));
+ if(TYPE_POLYMORPHIC_P (field_type)) {
+ /* vtable pointers are Real Bad(tm), since Obj-C cannot initialize them */
+ error ("type `%s' has virtual member functions", type_name);
+ error ("illegal aggregate type `%s' specified for instance variable `%s'",
+ type_name, ivar_name);
+ /* Return class as is without adding this ivar. */
+ return class;
+ }
+ /* user-defined constructors and destructors are not known to Obj-C and
+ hence will not be called. This may or may not be a problem. */
+ if (TYPE_NEEDS_CONSTRUCTING (field_type))
+ warning ("type `%s' has a user-defined constructor", type_name);
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type))
+ warning ("type `%s' has a user-defined destructor", type_name);
+ warning ("C++ constructors and destructors will not be invoked for Objective-C fields");
+ }
+#endif
/* Overload the public attribute, it is not used for FIELD_DECLs. */
switch (public)
@@ -5784,18 +6424,14 @@ add_instance_variable (class, public, declarator, declspecs, width)
}
- if (CLASS_IVARS (class))
- chainon (CLASS_IVARS (class), field_decl);
- else
- CLASS_IVARS (class) = field_decl;
-
+ raw_decl = build_tree_list (declspecs, build_tree_list (declarator, width));
+ CLASS_RAW_IVARS (class) = chainon (CLASS_RAW_IVARS (class), raw_decl);
+ CLASS_IVARS (class) = chainon (CLASS_IVARS (class), field_decl);
return class;
}
tree
-is_ivar (decl_chain, ident)
- tree decl_chain;
- tree ident;
+is_ivar (tree decl_chain, tree ident)
{
for ( ; decl_chain; decl_chain = TREE_CHAIN (decl_chain))
if (DECL_NAME (decl_chain) == ident)
@@ -5806,8 +6442,7 @@ is_ivar (decl_chain, ident)
/* True if the ivar is private and we are not in its implementation. */
int
-is_private (decl)
- tree decl;
+is_private (tree decl)
{
if (TREE_PRIVATE (decl)
&& ! is_ivar (CLASS_IVARS (implementation_template), DECL_NAME (decl)))
@@ -5823,9 +6458,7 @@ is_private (decl)
/* We have an instance variable reference;, check to see if it is public. */
int
-is_public (expr, identifier)
- tree expr;
- tree identifier;
+is_public (tree expr, tree identifier)
{
tree basetype = TREE_TYPE (expr);
enum tree_code code = TREE_CODE (basetype);
@@ -5835,10 +6468,10 @@ is_public (expr, identifier)
{
if (TREE_STATIC_TEMPLATE (basetype))
{
- if (!lookup_interface (TYPE_NAME (basetype)))
+ if (!lookup_interface (OBJC_TYPE_NAME (basetype)))
{
error ("cannot find interface declaration for `%s'",
- IDENTIFIER_POINTER (TYPE_NAME (basetype)));
+ IDENTIFIER_POINTER (OBJC_TYPE_NAME (basetype)));
return 0;
}
@@ -5856,9 +6489,20 @@ is_public (expr, identifier)
|| (TREE_CODE (objc_implementation_context)
== CATEGORY_IMPLEMENTATION_TYPE))
&& (CLASS_NAME (objc_implementation_context)
- == TYPE_NAME (basetype))))
+ == OBJC_TYPE_NAME (basetype))))
return ! is_private (decl);
+ /* The 2.95.2 compiler sometimes allowed C functions to access
+ non-@public ivars. We will let this slide for now... */
+ if (!objc_method_context)
+ {
+ warning ("instance variable `%s' is %s; "
+ "this will be a hard error in the future",
+ IDENTIFIER_POINTER (identifier),
+ TREE_PRIVATE (decl) ? "@private" : "@protected");
+ return 1;
+ }
+
error ("instance variable `%s' is declared %s",
IDENTIFIER_POINTER (identifier),
TREE_PRIVATE (decl) ? "private" : "protected");
@@ -5879,10 +6523,7 @@ is_public (expr, identifier)
/* Make sure all entries in CHAIN are also in LIST. */
static int
-check_methods (chain, list, mtype)
- tree chain;
- tree list;
- int mtype;
+check_methods (tree chain, tree list, int mtype)
{
int first = 1;
@@ -5916,9 +6557,7 @@ check_methods (chain, list, mtype)
/* Check if CLASS, or its superclasses, explicitly conforms to PROTOCOL. */
static int
-conforms_to_protocol (class, protocol)
- tree class;
- tree protocol;
+conforms_to_protocol (tree class, tree protocol)
{
if (TREE_CODE (protocol) == PROTOCOL_INTERFACE_TYPE)
{
@@ -5940,14 +6579,11 @@ conforms_to_protocol (class, protocol)
return 1;
}
-/* Make sure all methods in CHAIN are accessible as MTYPE methods in
+/* Make sure all methods in CHAIN are accessible as MTYPE methods in
CONTEXT. This is one of two mechanisms to check protocol integrity. */
static int
-check_methods_accessible (chain, context, mtype)
- tree chain;
- tree context;
- int mtype;
+check_methods_accessible (tree chain, tree context, int mtype)
{
int first = 1;
tree list;
@@ -5964,17 +6600,17 @@ check_methods_accessible (chain, context, mtype)
list = CLASS_NST_METHODS (context);
if (lookup_method (list, chain))
- break;
+ break;
else if (TREE_CODE (context) == CLASS_IMPLEMENTATION_TYPE
|| TREE_CODE (context) == CLASS_INTERFACE_TYPE)
- context = (CLASS_SUPER_NAME (context)
+ context = (CLASS_SUPER_NAME (context)
? lookup_interface (CLASS_SUPER_NAME (context))
: NULL_TREE);
else if (TREE_CODE (context) == CATEGORY_IMPLEMENTATION_TYPE
|| TREE_CODE (context) == CATEGORY_INTERFACE_TYPE)
- context = (CLASS_NAME (context)
+ context = (CLASS_NAME (context)
? lookup_interface (CLASS_NAME (context))
: NULL_TREE);
else
@@ -6009,12 +6645,9 @@ check_methods_accessible (chain, context, mtype)
/* Check whether the current interface (accessible via
'objc_implementation_context') actually implements protocol P, along
with any protocols that P inherits. */
-
+
static void
-check_protocol (p, type, name)
- tree p;
- const char *type;
- const char *name;
+check_protocol (tree p, const char *type, const char *name)
{
if (TREE_CODE (p) == PROTOCOL_INTERFACE_TYPE)
{
@@ -6044,7 +6677,7 @@ check_protocol (p, type, name)
warning ("%s `%s' does not fully implement the `%s' protocol",
type, name, IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
}
-
+
/* Check protocols recursively. */
if (PROTOCOL_LIST (p))
{
@@ -6052,7 +6685,7 @@ check_protocol (p, type, name)
tree super_class =
lookup_interface (CLASS_SUPER_NAME (implementation_template));
- while (subs)
+ while (subs)
{
tree sub = TREE_VALUE (subs);
@@ -6064,16 +6697,13 @@ check_protocol (p, type, name)
}
}
}
-
+
/* Check whether the current interface (accessible via
'objc_implementation_context') actually implements the protocols listed
in PROTO_LIST. */
-
+
static void
-check_protocols (proto_list, type, name)
- tree proto_list;
- const char *type;
- const char *name;
+check_protocols (tree proto_list, const char *type, const char *name)
{
for ( ; proto_list; proto_list = TREE_CHAIN (proto_list))
{
@@ -6089,14 +6719,17 @@ check_protocols (proto_list, type, name)
CATEGORY_INTERFACE_TYPE, or CATEGORY_IMPLEMENTATION_TYPE. */
tree
-start_class (code, class_name, super_name, protocol_list)
- enum tree_code code;
- tree class_name;
- tree super_name;
- tree protocol_list;
+start_class (enum tree_code code, tree class_name, tree super_name,
+ tree protocol_list)
{
tree class, decl;
+#ifdef OBJCPLUS
+ if (current_namespace != global_namespace) {
+ error ("Objective-C declarations may only appear in global scope");
+ }
+#endif /* OBJCPLUS */
+
if (objc_implementation_context)
{
warning ("`@end' missing in implementation context");
@@ -6106,17 +6739,19 @@ start_class (code, class_name, super_name, protocol_list)
}
class = make_node (code);
- TYPE_BINFO (class) = make_tree_vec (BINFO_ELTS);
+ TYPE_BINFO (class) = make_tree_vec (CLASS_BINFO_ELTS);
CLASS_NAME (class) = class_name;
CLASS_SUPER_NAME (class) = super_name;
CLASS_CLS_METHODS (class) = NULL_TREE;
- if (! is_class_name (class_name) && (decl = lookup_name (class_name)))
+ if (! is_class_name (class_name)
+ && (decl = lookup_name (class_name)))
{
error ("`%s' redeclared as different kind of symbol",
IDENTIFIER_POINTER (class_name));
- error_with_decl (decl, "previous declaration of `%s'");
+ error ("%Hprevious declaration of '%D'",
+ &DECL_SOURCE_LOCATION (decl), decl);
}
if (code == CLASS_IMPLEMENTATION_TYPE)
@@ -6135,17 +6770,6 @@ start_class (code, class_name, super_name, protocol_list)
implemented_classes);
}
- /* Pre-build the following entities - for speed/convenience. */
- if (!self_id)
- self_id = get_identifier ("self");
- if (!ucmd_id)
- ucmd_id = get_identifier ("_cmd");
- if (!unused_list)
- unused_list
- = build_tree_list (get_identifier ("__unused__"), NULL_TREE);
- if (!objc_super_template)
- objc_super_template = build_super_template ();
-
/* Reset for multiple classes per file. */
method_slot = 0;
@@ -6176,7 +6800,7 @@ start_class (code, class_name, super_name, protocol_list)
else if (! super_name)
{
- CLASS_SUPER_NAME (objc_implementation_context)
+ CLASS_SUPER_NAME (objc_implementation_context)
= CLASS_SUPER_NAME (implementation_template);
}
}
@@ -6184,8 +6808,12 @@ start_class (code, class_name, super_name, protocol_list)
else if (code == CLASS_INTERFACE_TYPE)
{
if (lookup_interface (class_name))
- warning ("duplicate interface declaration for class `%s'",
- IDENTIFIER_POINTER (class_name));
+#ifdef OBJCPLUS
+ error ("duplicate interface declaration for class `%s'",
+#else
+ warning ("duplicate interface declaration for class `%s'",
+#endif
+ IDENTIFIER_POINTER (class_name));
else
add_class (class);
@@ -6218,17 +6846,6 @@ start_class (code, class_name, super_name, protocol_list)
else if (code == CATEGORY_IMPLEMENTATION_TYPE)
{
- /* Pre-build the following entities for speed/convenience. */
- if (!self_id)
- self_id = get_identifier ("self");
- if (!ucmd_id)
- ucmd_id = get_identifier ("_cmd");
- if (!unused_list)
- unused_list
- = build_tree_list (get_identifier ("__unused__"), NULL_TREE);
- if (!objc_super_template)
- objc_super_template = build_super_template ();
-
/* Reset for multiple classes per file. */
method_slot = 0;
@@ -6249,8 +6866,7 @@ start_class (code, class_name, super_name, protocol_list)
}
tree
-continue_class (class)
- tree class;
+continue_class (tree class)
{
if (TREE_CODE (class) == CLASS_IMPLEMENTATION_TYPE
|| TREE_CODE (class) == CATEGORY_IMPLEMENTATION_TYPE)
@@ -6292,11 +6908,10 @@ continue_class (class)
else if (TREE_CODE (class) == CLASS_INTERFACE_TYPE)
{
- tree record = xref_tag (RECORD_TYPE, CLASS_NAME (class));
-
- if (!TYPE_FIELDS (record))
+ if (!CLASS_STATIC_TEMPLATE (class))
{
- finish_struct (record, get_class_ivars (class), NULL_TREE);
+ tree record = start_struct (RECORD_TYPE, CLASS_NAME (class));
+ finish_struct (record, get_class_ivars (class, 0), NULL_TREE);
CLASS_STATIC_TEMPLATE (class) = record;
/* Mark this record as a class template for static typing. */
@@ -6313,8 +6928,7 @@ continue_class (class)
/* This is called once we see the "@end" in an interface/implementation. */
void
-finish_class (class)
- tree class;
+finish_class (tree class)
{
if (TREE_CODE (class) == CLASS_IMPLEMENTATION_TYPE)
{
@@ -6380,8 +6994,7 @@ finish_class (class)
}
static tree
-add_protocol (protocol)
- tree protocol;
+add_protocol (tree protocol)
{
/* Put protocol on list in reverse order. */
TREE_CHAIN (protocol) = protocol_chain;
@@ -6390,8 +7003,7 @@ add_protocol (protocol)
}
static tree
-lookup_protocol (ident)
- tree ident;
+lookup_protocol (tree ident)
{
tree chain;
@@ -6406,11 +7018,16 @@ lookup_protocol (ident)
they are already declared or defined, the function has no effect. */
void
-objc_declare_protocols (names)
- tree names;
+objc_declare_protocols (tree names)
{
tree list;
+#ifdef OBJCPLUS
+ if (current_namespace != global_namespace) {
+ error ("Objective-C declarations may only appear in global scope");
+ }
+#endif /* OBJCPLUS */
+
for (list = names; list; list = TREE_CHAIN (list))
{
tree name = TREE_VALUE (list);
@@ -6430,13 +7047,16 @@ objc_declare_protocols (names)
}
tree
-start_protocol (code, name, list)
- enum tree_code code;
- tree name;
- tree list;
+start_protocol (enum tree_code code, tree name, tree list)
{
tree protocol;
+#ifdef OBJCPLUS
+ if (current_namespace != global_namespace) {
+ error ("Objective-C declarations may only appear in global scope");
+ }
+#endif /* OBJCPLUS */
+
/* This is as good a place as any. Need to invoke
push_tag_toplevel. */
if (!objc_protocol_template)
@@ -6473,8 +7093,7 @@ start_protocol (code, name, list)
}
void
-finish_protocol (protocol)
- tree protocol ATTRIBUTE_UNUSED;
+finish_protocol (tree protocol ATTRIBUTE_UNUSED)
{
}
@@ -6483,8 +7102,7 @@ finish_protocol (protocol)
??? What is the FORMAT? Someone please document this! */
static void
-encode_type_qualifiers (declspecs)
- tree declspecs;
+encode_type_qualifiers (tree declspecs)
{
tree spec;
@@ -6510,19 +7128,16 @@ encode_type_qualifiers (declspecs)
/* Encode a pointer type. */
static void
-encode_pointer (type, curtype, format)
- tree type;
- int curtype;
- int format;
+encode_pointer (tree type, int curtype, int format)
{
tree pointer_to = TREE_TYPE (type);
if (TREE_CODE (pointer_to) == RECORD_TYPE)
{
- if (TYPE_NAME (pointer_to)
- && TREE_CODE (TYPE_NAME (pointer_to)) == IDENTIFIER_NODE)
+ if (OBJC_TYPE_NAME (pointer_to)
+ && TREE_CODE (OBJC_TYPE_NAME (pointer_to)) == IDENTIFIER_NODE)
{
- const char *name = IDENTIFIER_POINTER (TYPE_NAME (pointer_to));
+ const char *name = IDENTIFIER_POINTER (OBJC_TYPE_NAME (pointer_to));
if (strcmp (name, TAG_OBJECT) == 0) /* '@' */
{
@@ -6560,8 +7175,15 @@ encode_pointer (type, curtype, format)
else if (TREE_CODE (pointer_to) == INTEGER_TYPE
&& TYPE_MODE (pointer_to) == QImode)
{
- obstack_1grow (&util_obstack, '*');
- return;
+ tree pname = TREE_CODE (OBJC_TYPE_NAME (pointer_to)) == IDENTIFIER_NODE
+ ? OBJC_TYPE_NAME (pointer_to)
+ : DECL_NAME (OBJC_TYPE_NAME (pointer_to));
+
+ if (!flag_next_runtime || strcmp (IDENTIFIER_POINTER (pname), "BOOL"))
+ {
+ obstack_1grow (&util_obstack, '*');
+ return;
+ }
}
/* We have a type that does not get special treatment. */
@@ -6572,10 +7194,7 @@ encode_pointer (type, curtype, format)
}
static void
-encode_array (type, curtype, format)
- tree type;
- int curtype;
- int format;
+encode_array (tree type, int curtype, int format)
{
tree an_int_cst = TYPE_SIZE (type);
tree array_of = TREE_TYPE (type);
@@ -6599,131 +7218,75 @@ encode_array (type, curtype, format)
}
static void
-encode_aggregate_within (type, curtype, format, left, right)
- tree type;
- int curtype;
- int format;
- int left;
- int right;
-{
- /* The RECORD_TYPE may in fact be a typedef! For purposes
- of encoding, we need the real underlying enchilada. */
- if (TYPE_MAIN_VARIANT (type))
- type = TYPE_MAIN_VARIANT (type);
-
- if (obstack_object_size (&util_obstack) > 0
- && *(obstack_next_free (&util_obstack) - 1) == '^')
- {
- tree name = TYPE_NAME (type);
-
- /* we have a reference; this is a NeXT extension. */
-
- if (obstack_object_size (&util_obstack) - curtype == 1
- && format == OBJC_ENCODE_INLINE_DEFS)
- {
- /* Output format of struct for first level only. */
- tree fields = TYPE_FIELDS (type);
-
- if (name && TREE_CODE (name) == IDENTIFIER_NODE)
- {
- obstack_1grow (&util_obstack, left);
- obstack_grow (&util_obstack,
- IDENTIFIER_POINTER (name),
- strlen (IDENTIFIER_POINTER (name)));
- obstack_1grow (&util_obstack, '=');
- }
- else
- {
- obstack_1grow (&util_obstack, left);
- obstack_grow (&util_obstack, "?=", 2);
- }
-
- for ( ; fields; fields = TREE_CHAIN (fields))
- encode_field_decl (fields, curtype, format);
-
- obstack_1grow (&util_obstack, right);
- }
-
- else if (name && TREE_CODE (name) == IDENTIFIER_NODE)
- {
- obstack_1grow (&util_obstack, left);
- obstack_grow (&util_obstack,
- IDENTIFIER_POINTER (name),
- strlen (IDENTIFIER_POINTER (name)));
- obstack_1grow (&util_obstack, right);
- }
-
- else
- {
- /* We have an untagged structure or a typedef. */
- obstack_1grow (&util_obstack, left);
- obstack_1grow (&util_obstack, '?');
- obstack_1grow (&util_obstack, right);
- }
- }
-
+encode_aggregate_within (tree type, int curtype, int format, int left,
+ int right)
+{
+ tree name;
+ /* NB: aggregates that are pointed to have slightly different encoding
+ rules in that you never encode the names of instance variables. */
+ int pointed_to
+ = (obstack_object_size (&util_obstack) > 0
+ && *(obstack_next_free (&util_obstack) - 1) == '^');
+ int inline_contents
+ = ((format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
+ && (!pointed_to || obstack_object_size (&util_obstack) - curtype == 1));
+
+ /* Traverse struct aliases; it is important to get the
+ original struct and its tag name (if any). */
+ type = TYPE_MAIN_VARIANT (type);
+ name = OBJC_TYPE_NAME (type);
+ /* Open parenth/bracket. */
+ obstack_1grow (&util_obstack, left);
+
+ /* Encode the struct/union tag name, or '?' if a tag was
+ not provided. Typedef aliases do not qualify. */
+ if (name && TREE_CODE (name) == IDENTIFIER_NODE
+#ifdef OBJCPLUS
+ /* Did this struct have a tag? */
+ && !TYPE_WAS_ANONYMOUS (type)
+#endif
+ )
+ obstack_grow (&util_obstack,
+ IDENTIFIER_POINTER (name),
+ strlen (IDENTIFIER_POINTER (name)));
else
+ obstack_1grow (&util_obstack, '?');
+
+ /* Encode the types (and possibly names) of the inner fields,
+ if required. */
+ if (inline_contents)
{
- tree name = TYPE_NAME (type);
tree fields = TYPE_FIELDS (type);
- if (format == OBJC_ENCODE_INLINE_DEFS
- || generating_instance_variables)
+ obstack_1grow (&util_obstack, '=');
+ for (; fields; fields = TREE_CHAIN (fields))
{
- obstack_1grow (&util_obstack, left);
- if (name && TREE_CODE (name) == IDENTIFIER_NODE)
- obstack_grow (&util_obstack,
- IDENTIFIER_POINTER (name),
- strlen (IDENTIFIER_POINTER (name)));
- else
- obstack_1grow (&util_obstack, '?');
-
- obstack_1grow (&util_obstack, '=');
-
- for (; fields; fields = TREE_CHAIN (fields))
+#ifdef OBJCPLUS
+ /* C++ static members, and things that are not fields at all,
+ should not appear in the encoding. */
+ if (TREE_CODE (fields) != FIELD_DECL || TREE_STATIC (fields))
+ continue;
+#endif
+ if (generating_instance_variables && !pointed_to)
{
- if (generating_instance_variables)
- {
- tree fname = DECL_NAME (fields);
-
- obstack_1grow (&util_obstack, '"');
- if (fname && TREE_CODE (fname) == IDENTIFIER_NODE)
- {
- obstack_grow (&util_obstack,
- IDENTIFIER_POINTER (fname),
- strlen (IDENTIFIER_POINTER (fname)));
- }
-
- obstack_1grow (&util_obstack, '"');
- }
-
- encode_field_decl (fields, curtype, format);
+ tree fname = DECL_NAME (fields);
+
+ obstack_1grow (&util_obstack, '"');
+ if (fname && TREE_CODE (fname) == IDENTIFIER_NODE)
+ obstack_grow (&util_obstack,
+ IDENTIFIER_POINTER (fname),
+ strlen (IDENTIFIER_POINTER (fname)));
+ obstack_1grow (&util_obstack, '"');
}
-
- obstack_1grow (&util_obstack, right);
- }
-
- else
- {
- obstack_1grow (&util_obstack, left);
- if (name && TREE_CODE (name) == IDENTIFIER_NODE)
- obstack_grow (&util_obstack,
- IDENTIFIER_POINTER (name),
- strlen (IDENTIFIER_POINTER (name)));
- else
- /* We have an untagged structure or a typedef. */
- obstack_1grow (&util_obstack, '?');
-
- obstack_1grow (&util_obstack, right);
+ encode_field_decl (fields, curtype, format);
}
}
+ /* Close parenth/bracket. */
+ obstack_1grow (&util_obstack, right);
}
static void
-encode_aggregate (type, curtype, format)
- tree type;
- int curtype;
- int format;
+encode_aggregate (tree type, int curtype, int format)
{
enum tree_code code = TREE_CODE (type);
@@ -6731,12 +7294,12 @@ encode_aggregate (type, curtype, format)
{
case RECORD_TYPE:
{
- encode_aggregate_within(type, curtype, format, '{', '}');
+ encode_aggregate_within (type, curtype, format, '{', '}');
break;
}
case UNION_TYPE:
{
- encode_aggregate_within(type, curtype, format, '(', ')');
+ encode_aggregate_within (type, curtype, format, '(', ')');
break;
}
@@ -6749,19 +7312,11 @@ encode_aggregate (type, curtype, format)
}
}
-/* Support bitfields. The current version of Objective-C does not support
- them. The string will consist of one or more "b:n"'s where n is an
- integer describing the width of the bitfield. Currently, classes in
- the kit implement a method "-(char *)describeBitfieldStruct:" that
- simulates this. If they do not implement this method, the archiver
- assumes the bitfield is 16 bits wide (padded if necessary) and packed
- according to the GNU compiler. After looking at the "kit", it appears
- that all classes currently rely on this default behavior, rather than
- hand generating this string (which is tedious). */
+/* Encode a bitfield NeXT-style (i.e., without a bit offset or the underlying
+ field type. */
static void
-encode_bitfield (width)
- int width;
+encode_next_bitfield (int width)
{
char buffer[40];
sprintf (buffer, "b%d", width);
@@ -6771,10 +7326,7 @@ encode_bitfield (width)
/* FORMAT will be OBJC_ENCODE_INLINE_DEFS or OBJC_ENCODE_DONT_INLINE_DEFS. */
static void
-encode_type (type, curtype, format)
- tree type;
- int curtype;
- int format;
+encode_type (tree type, int curtype, int format)
{
enum tree_code code = TREE_CODE (type);
@@ -6833,6 +7385,9 @@ encode_type (type, curtype, format)
else if (code == VOID_TYPE)
obstack_1grow (&util_obstack, 'v');
+ else if (code == BOOLEAN_TYPE)
+ obstack_1grow (&util_obstack, 'B');
+
else if (code == ARRAY_TYPE)
encode_array (type, curtype, format);
@@ -6847,10 +7402,7 @@ encode_type (type, curtype, format)
}
static void
-encode_complete_bitfield (position, type, size)
- int position;
- tree type;
- int size;
+encode_gnu_bitfield (int position, tree type, int size)
{
enum tree_code code = TREE_CODE (type);
char buffer[40];
@@ -6906,39 +7458,37 @@ encode_complete_bitfield (position, type, size)
}
static void
-encode_field_decl (field_decl, curtype, format)
- tree field_decl;
- int curtype;
- int format;
+encode_field_decl (tree field_decl, int curtype, int format)
{
tree type;
+#ifdef OBJCPLUS
+ /* C++ static members, and things that are not fields at all,
+ should not appear in the encoding. */
+ if (TREE_CODE (field_decl) != FIELD_DECL || TREE_STATIC (field_decl))
+ return;
+#endif
+
type = TREE_TYPE (field_decl);
- /* If this field is obviously a bitfield, or is a bitfield that has been
- clobbered to look like a ordinary integer mode, go ahead and generate
- the bitfield typing information. */
- if (flag_next_runtime)
+ /* Generate the bitfield typing information, if needed. Note the difference
+ between GNU and NeXT runtimes. */
+ if (DECL_BIT_FIELD_TYPE (field_decl))
{
- if (DECL_BIT_FIELD_TYPE (field_decl))
- encode_bitfield (tree_low_cst (DECL_SIZE (field_decl), 1));
+ int size = tree_low_cst (DECL_SIZE (field_decl), 1);
+
+ if (flag_next_runtime)
+ encode_next_bitfield (size);
else
- encode_type (TREE_TYPE (field_decl), curtype, format);
+ encode_gnu_bitfield (int_bit_position (field_decl),
+ DECL_BIT_FIELD_TYPE (field_decl), size);
}
else
- {
- if (DECL_BIT_FIELD_TYPE (field_decl))
- encode_complete_bitfield (int_bit_position (field_decl),
- DECL_BIT_FIELD_TYPE (field_decl),
- tree_low_cst (DECL_SIZE (field_decl), 1));
- else
- encode_type (TREE_TYPE (field_decl), curtype, format);
- }
+ encode_type (TREE_TYPE (field_decl), curtype, format);
}
static tree
-objc_expr_last (complex_expr)
- tree complex_expr;
+objc_expr_last (tree complex_expr)
{
tree next;
@@ -6948,26 +7498,14 @@ objc_expr_last (complex_expr)
return complex_expr;
}
-
-/* Transform a method definition into a function definition as follows:
- - synthesize the first two arguments, "self" and "_cmd". */
-void
-start_method_def (method)
- tree method;
+static void
+synth_self_and_ucmd_args (void)
{
tree decl_specs;
- /* Required to implement _msgSuper. */
- objc_method_context = method;
- UOBJC_SUPER_decl = NULL_TREE;
-
- /* Must be called BEFORE start_function. */
- pushlevel (0);
-
- /* Generate prototype declarations for arguments..."new-style". */
-
- if (TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL)
+ if (objc_method_context
+ && TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL)
decl_specs = build_tree_list (NULL_TREE, uprivate_record);
else
/* Really a `struct objc_class *'. However, we allow people to
@@ -6986,6 +7524,23 @@ start_method_def (method)
(build_tree_list (decl_specs,
build1 (INDIRECT_REF, NULL_TREE, ucmd_id)),
unused_list));
+}
+
+/* Transform a method definition into a function definition as follows:
+ - synthesize the first two arguments, "self" and "_cmd". */
+
+void
+start_method_def (tree method)
+{
+ /* Required to implement _msgSuper. */
+ objc_method_context = method;
+ UOBJC_SUPER_decl = NULL_TREE;
+
+ /* Must be called BEFORE start_function. */
+ pushlevel (0);
+
+ /* Generate prototype declarations for arguments..."new-style". */
+ synth_self_and_ucmd_args ();
/* Generate argument declarations if a keyword_decl. */
if (METHOD_SEL_ARGS (method))
@@ -7006,8 +7561,10 @@ start_method_def (method)
(build_tree_list (arg_spec, arg_decl),
NULL_TREE));
+#ifndef OBJCPLUS
/* Unhook: restore the abstract declarator. */
TREE_OPERAND (last_expr, 0) = NULL_TREE;
+#endif
}
else
@@ -7038,10 +7595,7 @@ start_method_def (method)
}
static void
-warn_with_method (message, mtype, method)
- const char *message;
- int mtype;
- tree method;
+warn_with_method (const char *message, int mtype, tree method)
{
/* Add a readable method name to the warning. */
warning ("%H%s `%c%s'", &DECL_SOURCE_LOCATION (method),
@@ -7051,8 +7605,7 @@ warn_with_method (message, mtype, method)
/* Return 1 if METHOD is consistent with PROTO. */
static int
-comp_method_with_proto (method, proto)
- tree method, proto;
+comp_method_with_proto (tree method, tree proto)
{
/* Create a function template node at most once. */
if (!function1_template)
@@ -7064,30 +7617,61 @@ comp_method_with_proto (method, proto)
/* install return type */
TREE_TYPE (function1_template) = groktypename (TREE_TYPE (proto));
- return comptypes (TREE_TYPE (METHOD_DEFINITION (method)), function1_template);
+ return comptypes (TREE_TYPE (METHOD_DEFINITION (method)), function1_template,
+ false);
}
-/* Return 1 if PROTO1 is consistent with PROTO2. */
+/* Return 1 if TYPE1 is equivalent to TYPE2. */
static int
-comp_proto_with_proto (proto0, proto1)
- tree proto0, proto1;
+objc_types_are_equivalent (tree type1, tree type2)
{
- /* Create a couple of function_template nodes at most once. */
- if (!function1_template)
- function1_template = make_node (FUNCTION_TYPE);
- if (!function2_template)
- function2_template = make_node (FUNCTION_TYPE);
+ if (type1 == type2)
+ return 1;
+ if (TYPE_MAIN_VARIANT (type1) != TYPE_MAIN_VARIANT (type2))
+ return 0;
+ type1 = TYPE_PROTOCOL_LIST (type1);
+ type2 = TYPE_PROTOCOL_LIST (type2);
+ if (list_length (type1) == list_length (type2))
+ {
+ for (; type2; type2 = TREE_CHAIN (type2))
+ if (!lookup_protocol_in_reflist (type1, TREE_VALUE (type2)))
+ return 0;
+ return 1;
+ }
+ return 0;
+}
- /* Install argument types; normally set by build_function_type. */
- TYPE_ARG_TYPES (function1_template) = get_arg_type_list (proto0, METHOD_REF, 0);
- TYPE_ARG_TYPES (function2_template) = get_arg_type_list (proto1, METHOD_REF, 0);
+/* Return 1 if PROTO1 is equivalent to PROTO2. */
- /* Install return type. */
- TREE_TYPE (function1_template) = groktypename (TREE_TYPE (proto0));
- TREE_TYPE (function2_template) = groktypename (TREE_TYPE (proto1));
+static int
+comp_proto_with_proto (tree proto1, tree proto2)
+{
+ tree type1, type2;
- return comptypes (function1_template, function2_template);
+ /* The following test is needed in case there are hashing
+ collisions. */
+ if (METHOD_SEL_NAME (proto1) != METHOD_SEL_NAME (proto2))
+ return 0;
+
+ /* Compare return types. */
+ type1 = groktypename (TREE_TYPE (proto1));
+ type2 = groktypename (TREE_TYPE (proto2));
+
+ if (!objc_types_are_equivalent (type1, type2))
+ return 0;
+
+ /* Compare argument types. */
+ for (type1 = get_arg_type_list (proto1, METHOD_REF, 0),
+ type2 = get_arg_type_list (proto2, METHOD_REF, 0);
+ type1 && type2;
+ type1 = TREE_CHAIN (type1), type2 = TREE_CHAIN (type2))
+ {
+ if (!objc_types_are_equivalent (TREE_VALUE (type1), TREE_VALUE (type2)))
+ return 0;
+ }
+
+ return (!type1 && !type2);
}
/* - Generate an identifier for the function. the format is "_n_cls",
@@ -7097,8 +7681,7 @@ comp_proto_with_proto (proto0, proto1)
- If we have a prototype, check for type consistency. */
static void
-really_start_method (method, parmlist)
- tree method, parmlist;
+really_start_method (tree method, tree parmlist)
{
tree sc_spec, ret_spec, ret_decl, decl_specs;
tree method_decl, method_id;
@@ -7127,6 +7710,12 @@ really_start_method (method, parmlist)
method_id = get_identifier (buf);
+#ifdef OBJCPLUS
+ /* Objective-C methods cannot be overloaded, so we don't need
+ the type encoding appended. It looks bad anyway... */
+ push_lang_context (lang_name_c);
+#endif
+
method_decl = build_nt (CALL_EXPR, method_id, parmlist, NULL_TREE);
/* Check the declarator portion of the return type for the method. */
@@ -7157,20 +7746,32 @@ really_start_method (method, parmlist)
TREE_VALUE (TREE_TYPE (method)) = NULL_TREE;
}
+#ifdef OBJCPLUS
+ /* set self_decl from the first argument...this global is used by
+ * build_ivar_reference().build_indirect_ref().
+ */
+ self_decl = DECL_ARGUMENTS (current_function_decl);
+
+ /* snaroff (3/28/96): when compiling with -Wall, this suppresses
+ * the following: warning:unused parameter `struct objc_selector * _cmd'
+ */
+ TREE_USED (self_decl) = 1;
+ TREE_USED (TREE_CHAIN (self_decl)) = 1;
+ /* Ditto for the underlying (static) C function. */
+ TREE_USED (current_function_decl) = 1;
+ pop_lang_context ();
+#endif
+
METHOD_DEFINITION (method) = current_function_decl;
/* Check consistency...start_function, pushdecl, duplicate_decls. */
if (implementation_template != objc_implementation_context)
{
- tree proto;
-
- if (TREE_CODE (method) == INSTANCE_METHOD_DECL)
- proto = lookup_instance_method_static (implementation_template,
- METHOD_SEL_NAME (method));
- else
- proto = lookup_class_method_static (implementation_template,
- METHOD_SEL_NAME (method));
+ tree proto
+ = lookup_method_static (implementation_template,
+ METHOD_SEL_NAME (method),
+ TREE_CODE (method) == CLASS_METHOD_DECL);
if (proto && ! comp_method_with_proto (method, proto))
{
@@ -7184,11 +7785,11 @@ really_start_method (method, parmlist)
/* The following routine is always called...this "architecture" is to
accommodate "old-style" variable length selectors.
-
+
- a:a b:b // prototype ; id c; id d; // old-style. */
void
-continue_method_def ()
+continue_method_def (void)
{
tree parmlist;
@@ -7198,34 +7799,18 @@ continue_method_def ()
else
parmlist = get_parm_info (1); /* place a `void_at_end' */
+#ifndef OBJCPLUS
/* Set self_decl from the first argument...this global is used by
build_ivar_reference calling build_indirect_ref. */
self_decl = TREE_PURPOSE (parmlist);
+#endif /* !OBJCPLUS */
poplevel (0, 0, 0);
really_start_method (objc_method_context, parmlist);
store_parm_decls ();
}
-/* Called by the parser, from the `pushlevel' production. */
-
-void
-add_objc_decls ()
-{
- if (!UOBJC_SUPER_decl)
- {
- UOBJC_SUPER_decl = start_decl (get_identifier (UTAG_SUPER),
- build_tree_list (NULL_TREE,
- objc_super_template),
- 0, NULL_TREE);
-
- finish_decl (UOBJC_SUPER_decl, NULL_TREE, NULL_TREE);
-
- /* This prevents `unused variable' warnings when compiling with -Wall. */
- TREE_USED (UOBJC_SUPER_decl) = 1;
- DECL_ARTIFICIAL (UOBJC_SUPER_decl) = 1;
- }
-}
+static void *UOBJC_SUPER_scope = 0;
/* _n_Method (id self, SEL sel, ...)
{
@@ -7234,12 +7819,28 @@ add_objc_decls ()
} */
tree
-get_super_receiver ()
+get_super_receiver (void)
{
if (objc_method_context)
{
tree super_expr, super_expr_list;
+ if (!UOBJC_SUPER_decl)
+ {
+ UOBJC_SUPER_decl = start_decl (get_identifier (TAG_SUPER),
+ build_tree_list (NULL_TREE,
+ objc_super_template),
+ 0, NULL_TREE);
+
+ finish_decl (UOBJC_SUPER_decl, NULL_TREE, NULL_TREE);
+
+ /* This prevents `unused variable' warnings when compiling with -Wall. */
+ TREE_USED (UOBJC_SUPER_decl) = 1;
+ DECL_ARTIFICIAL (UOBJC_SUPER_decl) = 1;
+
+ UOBJC_SUPER_scope = get_current_scope ();
+ }
+
/* Set receiver to self. */
super_expr = build_component_ref (UOBJC_SUPER_decl, self_id);
super_expr = build_modify_expr (super_expr, NOP_EXPR, self_decl);
@@ -7275,17 +7876,18 @@ get_super_receiver ()
return error_mark_node;
}
- if (flag_next_runtime)
+ if (flag_next_runtime && !flag_zero_link)
{
super_class = get_class_reference (super_name);
if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL)
- /* Cast the super class to 'id', since the user may not have
- included <objc/objc-class.h>, leaving 'struct objc_class'
- an incomplete type. */
+ /* If we are in a class method, we must retrieve the
+ _metaclass_ for the current class, pointed at by
+ the class's "isa" pointer. The following assumes that
+ "isa" is the first ivar in a class (which it must be). */
super_class
- = build_component_ref (build_indirect_ref
- (build_c_cast (id_type, super_class), "->"),
- get_identifier ("isa"));
+ = build_indirect_ref
+ (build_c_cast (build_pointer_type (objc_class_type),
+ super_class), "unary *");
}
else
{
@@ -7302,8 +7904,10 @@ get_super_receiver ()
IDENTIFIER_POINTER (super_name))));
}
- TREE_TYPE (super_class) = TREE_TYPE (ucls_super_ref);
- super_expr = build_modify_expr (super_expr, NOP_EXPR, super_class);
+ super_expr
+ = build_modify_expr (super_expr, NOP_EXPR,
+ build_c_cast (TREE_TYPE (super_expr),
+ super_class));
}
chainon (super_expr_list, build_tree_list (NULL_TREE, super_expr));
@@ -7320,74 +7924,45 @@ get_super_receiver ()
}
}
-static tree
-encode_method_def (func_decl)
- tree func_decl;
-{
- tree parms;
- int stack_size;
- HOST_WIDE_INT max_parm_end = 0;
- char buffer[40];
- tree result;
-
- /* Return type. */
- encode_type (TREE_TYPE (TREE_TYPE (func_decl)),
- obstack_object_size (&util_obstack),
- OBJC_ENCODE_INLINE_DEFS);
-
- /* Stack size. */
- for (parms = DECL_ARGUMENTS (func_decl); parms;
- parms = TREE_CHAIN (parms))
- {
- HOST_WIDE_INT parm_end = (forwarding_offset (parms)
- + int_size_in_bytes (TREE_TYPE (parms)));
-
- if (! offset_is_register && parm_end > max_parm_end)
- max_parm_end = parm_end;
- }
-
- stack_size = max_parm_end - OBJC_FORWARDING_MIN_OFFSET;
-
- sprintf (buffer, "%d", stack_size);
- obstack_grow (&util_obstack, buffer, strlen (buffer));
-
- /* Argument types. */
- for (parms = DECL_ARGUMENTS (func_decl); parms;
- parms = TREE_CHAIN (parms))
- {
- /* Type. */
- encode_type (TREE_TYPE (parms),
- obstack_object_size (&util_obstack),
- OBJC_ENCODE_INLINE_DEFS);
-
- /* Compute offset. */
- sprintf (buffer, "%d", forwarding_offset (parms));
-
- /* Indicate register. */
- if (offset_is_register)
- obstack_1grow (&util_obstack, '+');
+/* When exiting a scope, sever links to a 'super' declaration (if any)
+ therein contained. */
- obstack_grow (&util_obstack, buffer, strlen (buffer));
- }
-
- /* Null terminate string. */
- obstack_1grow (&util_obstack, 0);
- result = get_identifier (obstack_finish (&util_obstack));
- obstack_free (&util_obstack, util_firstobj);
- return result;
+void
+objc_clear_super_receiver (void)
+{
+ if (objc_method_context
+ && UOBJC_SUPER_scope == get_current_scope ()) {
+ UOBJC_SUPER_decl = 0;
+ UOBJC_SUPER_scope = 0;
+ }
}
static void
-objc_expand_function_end ()
+objc_expand_function_end (void)
{
- METHOD_ENCODING (objc_method_context) = encode_method_def (current_function_decl);
+ /* This routine may also get called for C functions, including those
+ nested within ObjC methods. In such cases, method encoding is
+ meaningless. */
+ if (objc_method_context == NULL_TREE
+ || DECL_INITIAL (objc_method_context) != current_function_decl)
+ return;
+
+ METHOD_ENCODING (objc_method_context)
+ = encode_method_prototype (objc_method_context);
}
void
-finish_method_def ()
+finish_method_def (void)
{
lang_expand_function_end = objc_expand_function_end;
- finish_function (0, 1);
+ /* We cannot validly inline ObjC methods, at least not without a language
+ extension to declare that a method need not be dynamically
+ dispatched, so suppress all thoughts of doing so. */
+ DECL_INLINE (current_function_decl) = 0;
+ DECL_UNINLINABLE (current_function_decl) = 1;
+ current_function_cannot_inline = "methods cannot be inlined";
+
+ finish_function ();
lang_expand_function_end = NULL;
/* Required to implement _msgSuper. This must be done AFTER finish_function,
@@ -7397,8 +7972,7 @@ finish_method_def ()
#if 0
int
-lang_report_error_function (decl)
- tree decl;
+lang_report_error_function (tree decl)
{
if (objc_method_context)
{
@@ -7413,8 +7987,7 @@ lang_report_error_function (decl)
#endif
static int
-is_complex_decl (type)
- tree type;
+is_complex_decl (tree type)
{
return (TREE_CODE (type) == ARRAY_TYPE
|| TREE_CODE (type) == FUNCTION_TYPE
@@ -7427,9 +8000,7 @@ is_complex_decl (type)
static char tmpbuf[256];
static void
-adorn_decl (decl, str)
- tree decl;
- char *str;
+adorn_decl (tree decl, char *str)
{
enum tree_code code = TREE_CODE (decl);
@@ -7529,10 +8100,7 @@ adorn_decl (decl, str)
}
static char *
-gen_declarator (decl, buf, name)
- tree decl;
- char *buf;
- const char *name;
+gen_declarator (tree decl, char *buf, const char *name)
{
if (decl)
{
@@ -7621,10 +8189,7 @@ gen_declarator (decl, buf, name)
}
static void
-gen_declspecs (declspecs, buf, raw)
- tree declspecs;
- char *buf;
- int raw;
+gen_declspecs (tree declspecs, char *buf, int raw)
{
if (raw)
{
@@ -7639,13 +8204,13 @@ gen_declspecs (declspecs, buf, raw)
strcat (buf, IDENTIFIER_POINTER (aspec));
else if (TREE_CODE (aspec) == RECORD_TYPE)
{
- if (TYPE_NAME (aspec))
+ if (OBJC_TYPE_NAME (aspec))
{
tree protocol_list = TYPE_PROTOCOL_LIST (aspec);
if (! TREE_STATIC_TEMPLATE (aspec))
strcat (buf, "struct ");
- strcat (buf, IDENTIFIER_POINTER (TYPE_NAME (aspec)));
+ strcat (buf, IDENTIFIER_POINTER (OBJC_TYPE_NAME (aspec)));
/* NEW!!! */
if (protocol_list)
@@ -7672,11 +8237,11 @@ gen_declspecs (declspecs, buf, raw)
else if (TREE_CODE (aspec) == UNION_TYPE)
{
- if (TYPE_NAME (aspec))
+ if (OBJC_TYPE_NAME (aspec))
{
if (! TREE_STATIC_TEMPLATE (aspec))
strcat (buf, "union ");
- strcat (buf, IDENTIFIER_POINTER (TYPE_NAME (aspec)));
+ strcat (buf, IDENTIFIER_POINTER (OBJC_TYPE_NAME (aspec)));
}
else
strcat (buf, "untagged union");
@@ -7684,11 +8249,11 @@ gen_declspecs (declspecs, buf, raw)
else if (TREE_CODE (aspec) == ENUMERAL_TYPE)
{
- if (TYPE_NAME (aspec))
+ if (OBJC_TYPE_NAME (aspec))
{
if (! TREE_STATIC_TEMPLATE (aspec))
strcat (buf, "enum ");
- strcat (buf, IDENTIFIER_POINTER (TYPE_NAME (aspec)));
+ strcat (buf, IDENTIFIER_POINTER (OBJC_TYPE_NAME (aspec)));
}
else
strcat (buf, "untagged enum");
@@ -7778,14 +8343,14 @@ gen_declspecs (declspecs, buf, raw)
break;
case RECORD_TYPE:
- if (TYPE_NAME (declspecs)
- && TREE_CODE (TYPE_NAME (declspecs)) == IDENTIFIER_NODE)
+ if (OBJC_TYPE_NAME (declspecs)
+ && TREE_CODE (OBJC_TYPE_NAME (declspecs)) == IDENTIFIER_NODE)
{
tree protocol_list = TYPE_PROTOCOL_LIST (declspecs);
if (! TREE_STATIC_TEMPLATE (declspecs))
strcat (buf, "struct ");
- strcat (buf, IDENTIFIER_POINTER (TYPE_NAME (declspecs)));
+ strcat (buf, IDENTIFIER_POINTER (OBJC_TYPE_NAME (declspecs)));
if (protocol_list)
{
@@ -7812,11 +8377,11 @@ gen_declspecs (declspecs, buf, raw)
break;
case UNION_TYPE:
- if (TYPE_NAME (declspecs)
- && TREE_CODE (TYPE_NAME (declspecs)) == IDENTIFIER_NODE)
+ if (OBJC_TYPE_NAME (declspecs)
+ && TREE_CODE (OBJC_TYPE_NAME (declspecs)) == IDENTIFIER_NODE)
{
strcat (buf, "union ");
- strcat (buf, IDENTIFIER_POINTER (TYPE_NAME (declspecs)));
+ strcat (buf, IDENTIFIER_POINTER (OBJC_TYPE_NAME (declspecs)));
strcat (buf, " ");
}
@@ -7825,11 +8390,11 @@ gen_declspecs (declspecs, buf, raw)
break;
case ENUMERAL_TYPE:
- if (TYPE_NAME (declspecs)
- && TREE_CODE (TYPE_NAME (declspecs)) == IDENTIFIER_NODE)
+ if (OBJC_TYPE_NAME (declspecs)
+ && TREE_CODE (OBJC_TYPE_NAME (declspecs)) == IDENTIFIER_NODE)
{
strcat (buf, "enum ");
- strcat (buf, IDENTIFIER_POINTER (TYPE_NAME (declspecs)));
+ strcat (buf, IDENTIFIER_POINTER (OBJC_TYPE_NAME (declspecs)));
strcat (buf, " ");
}
@@ -7865,7 +8430,7 @@ gen_declspecs (declspecs, buf, raw)
}
}
break;
-
+
default:
break;
}
@@ -7876,9 +8441,7 @@ gen_declspecs (declspecs, buf, raw)
buffer, overwriting the buffer. */
static char *
-gen_declaration (atype_or_adecl, buf)
- tree atype_or_adecl;
- char *buf;
+gen_declaration (tree atype_or_adecl, char *buf)
{
buf[0] = '\0';
gen_declaration_1 (atype_or_adecl, buf);
@@ -7889,9 +8452,7 @@ gen_declaration (atype_or_adecl, buf)
given buffer. */
static void
-gen_declaration_1 (atype_or_adecl, buf)
- tree atype_or_adecl;
- char *buf;
+gen_declaration_1 (tree atype_or_adecl, char *buf)
{
char declbuf[256];
@@ -7899,9 +8460,17 @@ gen_declaration_1 (atype_or_adecl, buf)
{
tree declspecs; /* "identifier_node", "record_type" */
tree declarator; /* "array_ref", "indirect_ref", "call_expr"... */
+ tree width = NULL_TREE; /* for bitfields */
/* We have a "raw", abstract declarator (typename). */
declarator = TREE_VALUE (atype_or_adecl);
+ /* In the case of raw ivars, the declarator itself is a list,
+ and contains bitfield widths. */
+ if (declarator && TREE_CODE (declarator) == TREE_LIST)
+ {
+ width = TREE_VALUE (declarator);
+ declarator = TREE_PURPOSE (declarator);
+ }
declspecs = TREE_PURPOSE (atype_or_adecl);
gen_declspecs (declspecs, buf, 1);
@@ -7910,6 +8479,8 @@ gen_declaration_1 (atype_or_adecl, buf)
strcat (buf, " ");
strcat (buf, gen_declarator (declarator, declbuf, ""));
}
+ if (width)
+ sprintf (buf + strlen (buf), ": %lu", TREE_INT_CST_LOW (width));
}
else
@@ -7980,9 +8551,7 @@ gen_declaration_1 (atype_or_adecl, buf)
buffer (overwriting) and return a pointer to the buffer. */
static char *
-gen_method_decl (method, buf)
- tree method;
- char *buf;
+gen_method_decl (tree method, char *buf)
{
tree chain;
@@ -8049,9 +8618,7 @@ gen_method_decl (method, buf)
prints out an @interface declaration of all classes compiled in
this run); potentially useful for debugging the compiler too. */
static void
-dump_interface (fp, chain)
- FILE *fp;
- tree chain;
+dump_interface (FILE *fp, tree chain)
{
/* FIXME: A heap overflow here whenever a method (or ivar)
declaration is so long that it doesn't fit in the buffer. The
@@ -8065,13 +8632,13 @@ dump_interface (fp, chain)
fprintf (fp, "\n@interface %s", my_name);
- /* CLASS_SUPER_NAME is used to store the superclass name for
+ /* CLASS_SUPER_NAME is used to store the superclass name for
classes, and the category name for categories. */
if (CLASS_SUPER_NAME (chain))
{
const char *name = IDENTIFIER_POINTER (CLASS_SUPER_NAME (chain));
-
- if (TREE_CODE (chain) == CATEGORY_IMPLEMENTATION_TYPE
+
+ if (TREE_CODE (chain) == CATEGORY_IMPLEMENTATION_TYPE
|| TREE_CODE (chain) == CATEGORY_INTERFACE_TYPE)
{
fprintf (fp, " (%s)\n", name);
@@ -8114,8 +8681,7 @@ dump_interface (fp, chain)
/* Demangle function for Objective-C */
static const char *
-objc_demangle (mangled)
- const char *mangled;
+objc_demangle (const char *mangled)
{
char *demangled, *cp;
@@ -8170,15 +8736,13 @@ objc_demangle (mangled)
}
const char *
-objc_printable_name (decl, kind)
- tree decl;
- int kind ATTRIBUTE_UNUSED;
+objc_printable_name (tree decl, int kind ATTRIBUTE_UNUSED)
{
return objc_demangle (IDENTIFIER_POINTER (DECL_NAME (decl)));
}
static void
-init_objc ()
+init_objc (void)
{
gcc_obstack_init (&util_obstack);
util_firstobj = (char *) obstack_finish (&util_obstack);
@@ -8189,7 +8753,7 @@ init_objc ()
}
static void
-finish_objc ()
+finish_objc (void)
{
struct imp_entry *impent;
tree chain;
@@ -8225,7 +8789,7 @@ finish_objc ()
UOBJC_CLASS_decl = impent->class_decl;
UOBJC_METACLASS_decl = impent->meta_decl;
-
+
/* Dump the @interface of each class as we compile it, if the
-gen-decls option is in use. TODO: Dump the classes in the
order they were found, rather than in reverse order as we
@@ -8234,7 +8798,7 @@ finish_objc ()
{
dump_interface (gen_declaration_file, objc_implementation_context);
}
-
+
if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE)
{
/* all of the following reference the string pool... */
@@ -8257,6 +8821,9 @@ finish_objc ()
if (protocol_chain)
generate_protocols ();
+ if (flag_replace_objc_classes && imp_list)
+ generate_objc_image_info ();
+
if (objc_implementation_context || class_names_chain || objc_static_instances
|| meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
{
@@ -8294,36 +8861,12 @@ finish_objc ()
selector which has multiple methods. */
for (slot = 0; slot < SIZEHASHTABLE; slot++)
- for (hsh = cls_method_hash_list[slot]; hsh; hsh = hsh->next)
- if (hsh->list)
- {
- tree meth = hsh->key;
- char type = (TREE_CODE (meth) == INSTANCE_METHOD_DECL
- ? '-' : '+');
- attr loop;
-
- warning ("potential selector conflict for method `%s'",
- IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
- warn_with_method ("found", type, meth);
- for (loop = hsh->list; loop; loop = loop->next)
- warn_with_method ("found", type, loop->value);
- }
-
- for (slot = 0; slot < SIZEHASHTABLE; slot++)
- for (hsh = nst_method_hash_list[slot]; hsh; hsh = hsh->next)
- if (hsh->list)
- {
- tree meth = hsh->key;
- char type = (TREE_CODE (meth) == INSTANCE_METHOD_DECL
- ? '-' : '+');
- attr loop;
-
- warning ("potential selector conflict for method `%s'",
- IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
- warn_with_method ("found", type, meth);
- for (loop = hsh->list; loop; loop = loop->next)
- warn_with_method ("found", type, loop->value);
- }
+ {
+ for (hsh = cls_method_hash_list[slot]; hsh; hsh = hsh->next)
+ check_duplicates (hsh, 0);
+ for (hsh = nst_method_hash_list[slot]; hsh; hsh = hsh->next)
+ check_duplicates (hsh, 0);
+ }
}
warn_missing_braces = save_warn_missing_braces;
@@ -8332,8 +8875,7 @@ finish_objc ()
/* Subroutines of finish_objc. */
static void
-generate_classref_translation_entry (chain)
- tree chain;
+generate_classref_translation_entry (tree chain)
{
tree expr, name, decl_specs, decl, sc_spec;
tree type;
@@ -8359,8 +8901,7 @@ generate_classref_translation_entry (chain)
}
static void
-handle_class_ref (chain)
- tree chain;
+handle_class_ref (tree chain)
{
const char *name = IDENTIFIER_POINTER (TREE_VALUE (chain));
char *string = (char *) alloca (strlen (name) + 30);
@@ -8400,8 +8941,7 @@ handle_class_ref (chain)
}
static void
-handle_impent (impent)
- struct imp_entry *impent;
+handle_impent (struct imp_entry *impent)
{
char *string;
@@ -8462,10 +9002,41 @@ handle_impent (impent)
}
}
+/* The Fix-and-Countinue functionality available in Mac OS X 10.3 and
+ later requires that ObjC translation units participating in F&C be
+ specially marked. The following routine accomplishes this. */
+
+/* static int _OBJC_IMAGE_INFO[2] = { 0, 1 }; */
+
+static void
+generate_objc_image_info (void)
+{
+ tree sc_spec, decl, initlist;
+
+ sc_spec = build_tree_list (NULL_TREE, ridpointers[(int) RID_STATIC]);
+ decl
+ = start_decl (get_identifier ("_OBJC_IMAGE_INFO"),
+ tree_cons (NULL_TREE,
+ build_array_type
+ (integer_type_node,
+ build_index_type (build_int_2 (1, 0))),
+ sc_spec),
+ 1,
+ NULL_TREE);
+
+ initlist = build_tree_list (NULL_TREE, build_int_2 (0, 0));
+ initlist = tree_cons (NULL_TREE, build_int_2 (1, 0), initlist);
+ initlist = build_constructor (TREE_TYPE (decl), nreverse (initlist));
+
+ TREE_USED (decl) = DECL_IGNORED_P (decl) = DECL_ARTIFICIAL (decl) = 1;
+ TREE_CONSTANT (initlist) = TREE_STATIC (initlist) = 1;
+ finish_decl (decl, initlist, NULL_TREE);
+}
+
/* Look up ID as an instance variable. */
+
tree
-lookup_objc_ivar (id)
- tree id;
+lookup_objc_ivar (tree id)
{
tree decl;
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h
index c06c2b8c271..0dade33c091 100644
--- a/gcc/objc/objc-act.h
+++ b/gcc/objc/objc-act.h
@@ -24,57 +24,70 @@ Boston, MA 02111-1307, USA. */
/*** Public Interface (procedures) ***/
-bool objc_init PARAMS ((void));
-const char *objc_printable_name PARAMS ((tree, int));
+bool objc_init (void);
+const char *objc_printable_name (tree, int);
/* used by yyparse */
-void finish_file PARAMS ((void));
-tree start_class PARAMS ((enum tree_code, tree, tree, tree));
-tree continue_class PARAMS ((tree));
-void finish_class PARAMS ((tree));
-void start_method_def PARAMS ((tree));
-void continue_method_def PARAMS ((void));
-void finish_method_def PARAMS ((void));
-tree start_protocol PARAMS ((enum tree_code, tree, tree));
-void finish_protocol PARAMS ((tree));
-void add_objc_decls PARAMS ((void));
-
-tree is_ivar PARAMS ((tree, tree));
-int is_private PARAMS ((tree));
-int is_public PARAMS ((tree, tree));
-tree add_instance_variable PARAMS ((tree, int, tree, tree, tree));
-tree add_class_method PARAMS ((tree, tree));
-tree add_instance_method PARAMS ((tree, tree));
-tree get_super_receiver PARAMS ((void));
-tree get_class_ivars PARAMS ((tree));
-tree get_class_reference PARAMS ((tree));
-tree get_static_reference PARAMS ((tree, tree));
-tree get_object_reference PARAMS ((tree));
-tree build_message_expr PARAMS ((tree));
-tree finish_message_expr PARAMS ((tree, tree, tree));
-tree build_selector_expr PARAMS ((tree));
-tree build_ivar_reference PARAMS ((tree));
-tree build_keyword_decl PARAMS ((tree, tree, tree));
-tree build_method_decl PARAMS ((enum tree_code, tree, tree, tree));
-tree build_protocol_expr PARAMS ((tree));
-tree build_objc_string_object PARAMS ((tree));
-
-void objc_declare_alias PARAMS ((tree, tree));
-void objc_declare_class PARAMS ((tree));
-void objc_declare_protocols PARAMS ((tree));
+void finish_file (void);
+tree start_class (enum tree_code, tree, tree, tree);
+tree continue_class (tree);
+void finish_class (tree);
+void start_method_def (tree);
+void continue_method_def (void);
+void finish_method_def (void);
+tree start_protocol (enum tree_code, tree, tree);
+void finish_protocol (tree);
+
+tree objc_build_throw_stmt (tree);
+tree objc_build_try_catch_finally_stmt (int, int);
+void objc_build_synchronized_prologue (tree);
+tree objc_build_synchronized_epilogue (void);
+tree objc_build_try_prologue (void);
+void objc_build_try_epilogue (int);
+void objc_build_catch_stmt (tree);
+void objc_build_catch_epilogue (void);
+tree objc_build_finally_prologue (void);
+tree objc_build_finally_epilogue (void);
+
+tree is_ivar (tree, tree);
+int is_private (tree);
+int is_public (tree, tree);
+tree add_instance_variable (tree, int, tree, tree, tree);
+tree add_method (tree, tree, int);
+tree get_super_receiver (void);
+void objc_clear_super_receiver (void);
+tree get_class_ivars_from_name (tree);
+tree get_class_reference (tree);
+tree get_static_reference (tree, tree);
+tree get_object_reference (tree);
+tree build_message_expr (tree);
+tree finish_message_expr (tree, tree, tree);
+tree build_selector_expr (tree);
+tree build_ivar_reference (tree);
+tree build_keyword_decl (tree, tree, tree);
+tree build_method_decl (enum tree_code, tree, tree, tree);
+tree build_protocol_expr (tree);
+tree build_objc_string_object (tree);
+
+void objc_declare_alias (tree, tree);
+void objc_declare_class (tree);
+void objc_declare_protocols (tree);
/* the following routines are used to implement statically typed objects */
-int objc_comptypes PARAMS ((tree, tree, int));
-void objc_check_decl PARAMS ((tree));
+int objc_comptypes (tree, tree, int);
+void objc_check_decl (tree);
/* NeXT extensions */
-tree build_encode_expr PARAMS ((tree));
+tree build_encode_expr (tree);
/* Objective-C structures */
+#define CLASS_BINFO_ELTS 6
+#define PROTOCOL_BINFO_ELTS 2
+
/* KEYWORD_DECL */
#define KEYWORD_KEY_NAME(DECL) ((DECL)->decl.name)
#define KEYWORD_ARG_NAME(DECL) ((DECL)->decl.arguments)
@@ -90,7 +103,7 @@ tree build_encode_expr PARAMS ((tree));
CATEGORY_INTERFACE_TYPE, CATEGORY_IMPLEMENTATION_TYPE,
PROTOCOL_INTERFACE_TYPE */
#define CLASS_NAME(CLASS) ((CLASS)->type.name)
-#define CLASS_SUPER_NAME(CLASS) ((CLASS)->type.context)
+#define CLASS_SUPER_NAME(CLASS) (TYPE_CHECK (CLASS)->type.context)
#define CLASS_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 0)
#define CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 1)
#define CLASS_NST_METHODS(CLASS) ((CLASS)->type.minval)
@@ -105,22 +118,33 @@ tree build_encode_expr PARAMS ((tree));
#define PROTOCOL_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
#define PROTOCOL_FORWARD_DECL(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 1)
#define PROTOCOL_DEFINED(CLASS) TREE_USED (CLASS)
-#define TYPE_PROTOCOL_LIST(TYPE) ((TYPE)->type.context)
+/* We need to distinguish TYPE_PROTOCOL_LISTs from TYPE_CONTEXTs, both of which
+ are stored in the same accessor slot. */
+#define TYPE_PROTOCOL_LIST(TYPE) \
+ ((TYPE_CHECK (TYPE)->type.context \
+ && TREE_CODE ((TYPE)->type.context) == TREE_LIST) \
+ ? (TYPE)->type.context : NULL_TREE)
+#define SET_TYPE_PROTOCOL_LIST(TYPE, P) (TYPE_CHECK (TYPE)->type.context = (P))
/* Set by `continue_class' and checked by `is_public'. */
#define TREE_STATIC_TEMPLATE(record_type) (TREE_PUBLIC (record_type))
#define TYPED_OBJECT(type) \
(TREE_CODE (type) == RECORD_TYPE && TREE_STATIC_TEMPLATE (type))
+#define OBJC_TYPE_NAME(type) TYPE_NAME(type)
/* Define the Objective-C or Objective-C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum objc_tree_code {
-#ifdef OBJCPLUS
+#if defined (GCC_CP_TREE_H)
LAST_BASE_TREE_CODE = LAST_CPLUS_TREE_CODE,
-#else
+#else
+#if defined (GCC_C_TREE_H)
LAST_BASE_TREE_CODE = LAST_C_TREE_CODE,
+#else
+ #error You must include <c-tree.h> or <cp/cp-tree.h> before <objc/objc-act.h>
+#endif
#endif
#include "objc-tree.def"
LAST_OBJC_TREE_CODE
@@ -147,7 +171,7 @@ struct hashed_entry GTY(())
extern GTY ((length ("SIZEHASHTABLE"))) hash *nst_method_hash_list;
extern GTY ((length ("SIZEHASHTABLE"))) hash *cls_method_hash_list;
-#define SIZEHASHTABLE 257
+#define SIZEHASHTABLE 257
/* Objective-C/Objective-C++ @implementation list. */
@@ -178,6 +202,8 @@ enum objc_tree_index
OCTI_SELF_DECL,
OCTI_UMSG_DECL,
OCTI_UMSG_SUPER_DECL,
+ OCTI_UMSG_STRET_DECL,
+ OCTI_UMSG_SUPER_STRET_DECL,
OCTI_GET_CLASS_DECL,
OCTI_GET_MCLASS_DECL,
OCTI_SUPER_TYPE,
@@ -241,7 +267,25 @@ enum objc_tree_index
OCTI_CNST_STR_GLOB_ID,
OCTI_STRING_CLASS_DECL,
OCTI_SUPER_DECL,
-
+ OCTI_UMSG_NONNIL_DECL,
+ OCTI_UMSG_NONNIL_STRET_DECL,
+ OCTI_STORAGE_CLS,
+ OCTI_EXCEPTION_EXTRACT_DECL,
+ OCTI_EXCEPTION_TRY_ENTER_DECL,
+ OCTI_EXCEPTION_TRY_EXIT_DECL,
+ OCTI_EXCEPTION_MATCH_DECL,
+ OCTI_EXCEPTION_THROW_DECL,
+ OCTI_SYNC_ENTER_DECL,
+ OCTI_SYNC_EXIT_DECL,
+ OCTI_SETJMP_DECL,
+ OCTI_EXCDATA_TEMPL,
+ OCTI_STACK_EXCEPTION_DATA_DECL,
+ OCTI_LOCAL_EXCEPTION_DECL,
+ OCTI_RETHROW_EXCEPTION_DECL,
+ OCTI_EVAL_ONCE_DECL,
+ OCTI_EXCEPTION_BLK_STACK,
+ OCTI_CATCH_TYPE,
+
OCTI_MAX
};
@@ -263,6 +307,8 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
#define self_decl objc_global_trees[OCTI_SELF_DECL]
#define umsg_decl objc_global_trees[OCTI_UMSG_DECL]
#define umsg_super_decl objc_global_trees[OCTI_UMSG_SUPER_DECL]
+#define umsg_stret_decl objc_global_trees[OCTI_UMSG_STRET_DECL]
+#define umsg_super_stret_decl objc_global_trees[OCTI_UMSG_SUPER_STRET_DECL]
#define objc_get_class_decl objc_global_trees[OCTI_GET_CLASS_DECL]
#define objc_get_meta_class_decl \
objc_global_trees[OCTI_GET_MCLASS_DECL]
@@ -281,7 +327,7 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
#define IS_PROTOCOL_QUALIFIED_ID(TYPE) \
(IS_ID (TYPE) && TYPE_PROTOCOL_LIST (TYPE))
#define IS_SUPER(TYPE) \
- (super_type && TYPE_MAIN_VARIANT (TYPE) == TYPE_MAIN_VARIANT (super_type))
+ (TREE_CODE (TYPE) == POINTER_TYPE && TREE_TYPE (TYPE) == objc_super_template)
#define class_chain objc_global_trees[OCTI_CLS_CHAIN]
#define alias_chain objc_global_trees[OCTI_ALIAS_CHAIN]
@@ -335,6 +381,33 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
#define ucls_super_ref objc_global_trees[OCTI_UCLS_SUPER_REF]
#define uucls_super_ref objc_global_trees[OCTI_UUCLS_SUPER_REF]
+#define umsg_nonnil_decl objc_global_trees[OCTI_UMSG_NONNIL_DECL]
+#define umsg_nonnil_stret_decl objc_global_trees[OCTI_UMSG_NONNIL_STRET_DECL]
+#define objc_storage_class objc_global_trees[OCTI_STORAGE_CLS]
+#define objc_exception_extract_decl \
+ objc_global_trees[OCTI_EXCEPTION_EXTRACT_DECL]
+#define objc_exception_try_enter_decl \
+ objc_global_trees[OCTI_EXCEPTION_TRY_ENTER_DECL]
+#define objc_exception_try_exit_decl \
+ objc_global_trees[OCTI_EXCEPTION_TRY_EXIT_DECL]
+#define objc_exception_match_decl \
+ objc_global_trees[OCTI_EXCEPTION_MATCH_DECL]
+#define objc_exception_throw_decl \
+ objc_global_trees[OCTI_EXCEPTION_THROW_DECL]
+#define objc_sync_enter_decl objc_global_trees[OCTI_SYNC_ENTER_DECL]
+#define objc_sync_exit_decl objc_global_trees[OCTI_SYNC_EXIT_DECL]
+#define objc_exception_data_template \
+ objc_global_trees[OCTI_EXCDATA_TEMPL]
+#define objc_setjmp_decl objc_global_trees[OCTI_SETJMP_DECL]
+#define objc_stack_exception_data \
+ objc_global_trees[OCTI_STACK_EXCEPTION_DATA_DECL]
+#define objc_caught_exception objc_global_trees[OCTI_LOCAL_EXCEPTION_DECL]
+#define objc_rethrow_exception objc_global_trees[OCTI_RETHROW_EXCEPTION_DECL]
+#define objc_eval_once objc_global_trees[OCTI_EVAL_ONCE_DECL]
+#define objc_exception_block_stack \
+ objc_global_trees[OCTI_EXCEPTION_BLK_STACK]
+#define objc_catch_type objc_global_trees[OCTI_CATCH_TYPE]
+
#define objc_method_template objc_global_trees[OCTI_METH_TEMPL]
#define objc_ivar_template objc_global_trees[OCTI_IVAR_TEMPL]
#define objc_symtab_template objc_global_trees[OCTI_SYMTAB_TEMPL]
@@ -345,7 +418,7 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
objc_global_trees[OCTI_METH_PROTO_TEMPL]
#define function1_template objc_global_trees[OCTI_FUNCTION1_TEMPL]
#define function2_template objc_global_trees[OCTI_FUNCTION2_TEMPL]
-
+
#define objc_object_id objc_global_trees[OCTI_OBJ_ID]
#define objc_class_id objc_global_trees[OCTI_CLS_ID]
#define objc_id_id objc_global_trees[OCTI_ID_ID]
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index 19a1bacae4c..3f70122302c 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -61,14 +61,14 @@ enum c_language_kind c_language = clk_objc;
#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
#undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp
+#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
+#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME c_static_assembler_name
#undef LANG_HOOKS_NO_BODY_BLOCKS
#define LANG_HOOKS_NO_BODY_BLOCKS true
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
@@ -79,12 +79,17 @@ enum c_language_kind c_language = clk_objc;
#define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL c_warn_unused_global_decl
+#undef LANG_HOOKS_DECL_UNINIT
+#define LANG_HOOKS_DECL_UNINIT c_decl_uninit
#undef LANG_HOOKS_FUNCTION_ENTER_NESTED
#define LANG_HOOKS_FUNCTION_ENTER_NESTED c_push_function_context
#undef LANG_HOOKS_FUNCTION_LEAVE_NESTED
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context
+#undef LANG_HOOKS_RTL_EXPAND_STMT
+#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt
+
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
@@ -125,6 +130,9 @@ enum c_language_kind c_language = clk_objc;
#undef LANG_HOOKS_TYPE_PROMOTES_TO
#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to
+#undef LANG_HOOKS_WRITE_GLOBALS
+#define LANG_HOOKS_WRITE_GLOBALS c_write_global_declarations
+
/* Each front end provides its own hooks, for toplev.c. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
diff --git a/gcc/objc/objc-tree.def b/gcc/objc/objc-tree.def
index 2d0d3375a83..aa2e40feb0b 100644
--- a/gcc/objc/objc-tree.def
+++ b/gcc/objc/objc-tree.def
@@ -33,3 +33,7 @@ DEFTREECODE (PROTOCOL_INTERFACE_TYPE, "protocol_interface_type", 't', 0)
DEFTREECODE (KEYWORD_DECL, "keyword_decl", 'd', 0)
DEFTREECODE (INSTANCE_METHOD_DECL, "instance_method_decl", 'd', 0)
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0)
+
+/* Objective-C expressions. */
+DEFTREECODE (MESSAGE_SEND_EXPR, "message_send_expr", 'e', 3)
+DEFTREECODE (CLASS_REFERENCE_EXPR, "class_reference_expr", 'e', 1)
diff --git a/gcc/optabs.c b/gcc/optabs.c
index b4023e3eff4..e413d86d18e 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3175,7 +3175,7 @@ emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv)
next = NEXT_INSN (insn);
- /* Some ports (cris) create an libcall regions at their own. We must
+ /* Some ports (cris) create a libcall regions at their own. We must
avoid any potential nesting of LIBCALLs. */
if ((note = find_reg_note (insn, REG_LIBCALL, NULL)) != NULL)
remove_note (insn, note);
@@ -3342,7 +3342,7 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
rtx set = single_set (insn);
rtx note;
- /* Some ports (cris) create an libcall regions at their own. We must
+ /* Some ports (cris) create a libcall regions at their own. We must
avoid any potential nesting of LIBCALLs. */
if ((note = find_reg_note (insn, REG_LIBCALL, NULL)) != NULL)
remove_note (insn, note);
@@ -3579,6 +3579,40 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
if (size == 0)
abort ();
+#ifdef HAVE_cmpmemqi
+ if (HAVE_cmpmemqi
+ && GET_CODE (size) == CONST_INT
+ && INTVAL (size) < (1 << GET_MODE_BITSIZE (QImode)))
+ {
+ result_mode = insn_data[(int) CODE_FOR_cmpmemqi].operand[0].mode;
+ result = gen_reg_rtx (result_mode);
+ emit_insn (gen_cmpmemqi (result, x, y, size, opalign));
+ }
+ else
+#endif
+#ifdef HAVE_cmpmemhi
+ if (HAVE_cmpmemhi
+ && GET_CODE (size) == CONST_INT
+ && INTVAL (size) < (1 << GET_MODE_BITSIZE (HImode)))
+ {
+ result_mode = insn_data[(int) CODE_FOR_cmpmemhi].operand[0].mode;
+ result = gen_reg_rtx (result_mode);
+ emit_insn (gen_cmpmemhi (result, x, y, size, opalign));
+ }
+ else
+#endif
+#ifdef HAVE_cmpmemsi
+ if (HAVE_cmpmemsi)
+ {
+ result_mode = insn_data[(int) CODE_FOR_cmpmemsi].operand[0].mode;
+ result = gen_reg_rtx (result_mode);
+ size = protect_from_queue (size, 0);
+ emit_insn (gen_cmpmemsi (result, x, y,
+ convert_to_mode (SImode, size, 1),
+ opalign));
+ }
+ else
+#endif
#ifdef HAVE_cmpstrqi
if (HAVE_cmpstrqi
&& GET_CODE (size) == CONST_INT
@@ -3691,7 +3725,12 @@ prepare_operand (int icode, rtx x, int opnum, enum machine_mode mode,
if (! (*insn_data[icode].operand[opnum].predicate)
(x, insn_data[icode].operand[opnum].mode))
- x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
+ {
+ if (no_new_pseudos)
+ return NULL_RTX;
+ x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
+ }
+
return x;
}
@@ -4220,9 +4259,9 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
/* get_condition will prefer to generate LT and GT even if the old
comparison was against zero, so undo that canonicalization here since
comparisons against zero are cheaper. */
- if (code == LT && GET_CODE (op1) == CONST_INT && INTVAL (op1) == 1)
+ if (code == LT && op1 == const1_rtx)
code = LE, op1 = const0_rtx;
- else if (code == GT && GET_CODE (op1) == CONST_INT && INTVAL (op1) == -1)
+ else if (code == GT && op1 == constm1_rtx)
code = GE, op1 = const0_rtx;
if (cmode == VOIDmode)
@@ -4361,9 +4400,9 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
/* get_condition will prefer to generate LT and GT even if the old
comparison was against zero, so undo that canonicalization here since
comparisons against zero are cheaper. */
- if (code == LT && GET_CODE (op1) == CONST_INT && INTVAL (op1) == 1)
+ if (code == LT && op1 == const1_rtx)
code = LE, op1 = const0_rtx;
- else if (code == GT && GET_CODE (op1) == CONST_INT && INTVAL (op1) == -1)
+ else if (code == GT && op1 == constm1_rtx)
code = GE, op1 = const0_rtx;
if (cmode == VOIDmode)
@@ -5162,7 +5201,7 @@ static optab
new_optab (void)
{
int i;
- optab op = (optab) ggc_alloc (sizeof (struct optab));
+ optab op = ggc_alloc (sizeof (struct optab));
for (i = 0; i < NUM_MACHINE_MODES; i++)
{
op->handlers[i].insn_code = CODE_FOR_nothing;
@@ -5702,6 +5741,11 @@ gen_cond_trap (enum rtx_code code ATTRIBUTE_UNUSED, rtx op1,
start_sequence ();
op1 = prepare_operand (icode, op1, 0, mode, mode, 0);
op2 = prepare_operand (icode, op2, 1, mode, mode, 0);
+ if (!op1 || !op2)
+ {
+ end_sequence ();
+ return 0;
+ }
emit_insn (GEN_FCN (icode) (op1, op2));
PUT_CODE (trap_rtx, code);
diff --git a/gcc/opts.c b/gcc/opts.c
index f9951a6a3cc..c4c5b9fd414 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -128,6 +128,30 @@ bool warn_unused_value;
/* Hack for cooperation between set_Wunused and set_Wextra. */
static bool maybe_warn_unused_parameter;
+/* Type(s) of debugging information we are producing (if any). See
+ flags.h for the definitions of the different possible types of
+ debugging information. */
+enum debug_info_type write_symbols = NO_DEBUG;
+
+/* Level of debugging information we are producing. See flags.h for
+ the definitions of the different possible levels. */
+enum debug_info_level debug_info_level = DINFO_LEVEL_NONE;
+
+/* Nonzero means use GNU-only extensions in the generated symbolic
+ debugging information. Currently, this only has an effect when
+ write_symbols is set to DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */
+bool use_gnu_debug_info_extensions;
+
+/* Columns of --help display. */
+static unsigned int columns = 80;
+
+/* What to print when a switch has no documentation. */
+static const char undocumented_msg[] = N_("This switch lacks documentation");
+
+/* Input file names. */
+const char **in_fnames;
+unsigned num_in_fnames;
+
static size_t find_opt (const char *, int);
static int common_handle_option (size_t scode, const char *arg, int value);
static void handle_param (const char *);
@@ -137,8 +161,13 @@ static char *write_langs (unsigned int lang_mask);
static void complain_wrong_lang (const char *, const struct cl_option *,
unsigned int lang_mask);
static void handle_options (unsigned int, const char **, unsigned int);
-static void wrap_help (const char *help, const char *item, int item_width);
+static void wrap_help (const char *help, const char *item, unsigned int);
static void print_help (void);
+static void print_param_help (void);
+static void print_filtered_help (unsigned int flag);
+static unsigned int print_switch (const char *text, unsigned int indent);
+static void set_debug_level (enum debug_info_type type, int extended,
+ const char *arg);
/* Perform a binary search to find which option the command-line INPUT
matches. Returns its index in the option array, and N_OPTS
@@ -413,7 +442,7 @@ handle_options (unsigned int argc, const char **argv, unsigned int lang_mask)
if (opt[0] != '-' || opt[1] == '\0')
{
main_input_filename = opt;
- (*lang_hooks.handle_filename) (opt);
+ add_input_filename (opt);
n = 1;
continue;
}
@@ -428,6 +457,15 @@ handle_options (unsigned int argc, const char **argv, unsigned int lang_mask)
}
}
+/* Handle FILENAME from the command line. */
+void
+add_input_filename (const char *filename)
+{
+ num_in_fnames++;
+ in_fnames = xrealloc (in_fnames, num_in_fnames * sizeof (in_fnames[0]));
+ in_fnames[num_in_fnames - 1] = filename;
+}
+
/* Parse command line options and set default flag values. Do minimal
options processing. */
void
@@ -438,6 +476,8 @@ decode_options (unsigned int argc, const char **argv)
/* Perform language-specific options initialization. */
lang_mask = (*lang_hooks.init_options) (argc, argv);
+ lang_hooks.initialize_diagnostics (global_dc);
+
/* Scan to see what optimization level has been specified. That will
determine the default value of many flags. */
for (i = 1; i < argc; i++)
@@ -516,6 +556,7 @@ decode_options (unsigned int argc, const char **argv)
flag_delete_null_pointer_checks = 1;
flag_reorder_blocks = 1;
flag_reorder_functions = 1;
+ flag_unit_at_a_time = 1;
}
if (optimize >= 3)
@@ -523,7 +564,6 @@ decode_options (unsigned int argc, const char **argv)
flag_inline_functions = 1;
flag_rename_registers = 1;
flag_unswitch_loops = 1;
- flag_unit_at_a_time = 1;
}
if (optimize < 2 || optimize_size)
@@ -1062,7 +1102,7 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_fmessage_length_:
- output_set_maximum_length (&global_dc->buffer, value);
+ pp_set_line_maximum_length (global_dc->printer, value);
break;
case OPT_fmove_all_movables:
@@ -1180,8 +1220,12 @@ common_handle_option (size_t scode, const char *arg,
flag_rerun_loop_opt = value;
break;
+ case OPT_frounding_math:
+ flag_rounding_math = value;
+ break;
+
case OPT_fsched_interblock:
- flag_schedule_interblock= value;
+ flag_schedule_interblock = value;
break;
case OPT_fsched_spec:
@@ -1359,7 +1403,46 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_g:
- decode_g_option (arg);
+ set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, arg);
+ break;
+
+ case OPT_gcoff:
+ 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;
+
+ case OPT_ggdb:
+ set_debug_level (NO_DEBUG, 2, arg);
+ break;
+
+ case OPT_gstabs:
+ case OPT_gstabs_:
+ set_debug_level (DBX_DEBUG, code == OPT_gstabs_, arg);
+ break;
+
+ case OPT_gvms:
+ set_debug_level (VMS_DEBUG, false, arg);
+ break;
+
+ case OPT_gxcoff:
+ case OPT_gxcoff_:
+ set_debug_level (XCOFF_DEBUG, code == OPT_gxcoff_, arg);
break;
case OPT_m:
@@ -1468,7 +1551,10 @@ set_fast_math_flags (int set)
flag_finite_math_only = set;
flag_errno_math = !set;
if (set)
- flag_signaling_nans = 0;
+ {
+ flag_signaling_nans = 0;
+ flag_rounding_math = 0;
+ }
}
/* Return true iff flags are set as if -ffast-math. */
@@ -1481,23 +1567,180 @@ fast_math_flags_set_p (void)
&& !flag_errno_math);
}
+/* Handle a debug output -g switch. EXTENDED is true or false to support
+ extended output (2 is special and means "-ggdb" was given). */
+static void
+set_debug_level (enum debug_info_type type, int extended, const char *arg)
+{
+ static bool type_explicit;
+
+ use_gnu_debug_info_extensions = extended;
+
+ if (type == NO_DEBUG)
+ {
+ if (write_symbols == NO_DEBUG)
+ {
+ write_symbols = PREFERRED_DEBUGGING_TYPE;
+
+ if (extended == 2)
+ {
+#ifdef DWARF2_DEBUGGING_INFO
+ write_symbols = DWARF2_DEBUG;
+#elif defined DBX_DEBUGGING_INFO
+ write_symbols = DBX_DEBUG;
+#endif
+ }
+
+ if (write_symbols == NO_DEBUG)
+ warning ("target system does not support debug output");
+ }
+ }
+ else
+ {
+ /* Does it conflict with an already selected type? */
+ if (type_explicit && write_symbols != NO_DEBUG && type != write_symbols)
+ error ("debug format \"%s\" conflicts with prior selection",
+ debug_type_names[type]);
+ write_symbols = type;
+ type_explicit = true;
+ }
+
+ /* A debug flag without a level defaults to level 2. */
+ if (*arg == '\0')
+ {
+ if (!debug_info_level)
+ debug_info_level = 2;
+ }
+ else
+ {
+ debug_info_level = integral_argument (arg);
+ if (debug_info_level == (unsigned int) -1)
+ error ("unrecognised debug output level \"%s\"", arg);
+ else if (debug_info_level > 3)
+ error ("debug output level %s is too high", arg);
+ }
+}
+
/* Output --help text. */
static void
print_help (void)
{
- size_t i, len;
+ size_t i;
+ const char *p;
+
+ GET_ENVIRONMENT (p, "COLUMNS");
+ if (p)
+ {
+ int value = atoi (p);
+ if (value > 0)
+ columns = value;
+ }
- printf (_("\nThe following options are language-independent:\n"));
+ puts (_("The following options are language-independent:\n"));
+
+ print_filtered_help (CL_COMMON);
+ print_param_help ();
+
+ for (i = 0; lang_names[i]; i++)
+ {
+ printf (_("The %s front end recognizes the following options:\n\n"),
+ lang_names[i]);
+ print_filtered_help (1U << i);
+ }
+
+ display_target_options ();
+}
+
+/* Print the help for --param. */
+static void
+print_param_help (void)
+{
+ size_t i;
+
+ puts (_("The --param option recognizes the following as parameters:\n"));
+
+ for (i = 0; i < LAST_PARAM; i++)
+ {
+ const char *help = compiler_params[i].help;
+ const char *param = compiler_params[i].option;
+
+ if (help == NULL || *help == '\0')
+ help = undocumented_msg;
+
+ /* Get the translation. */
+ help = _(help);
+
+ wrap_help (help, param, strlen (param));
+ }
+
+ putchar ('\n');
+}
+
+/* Print help for a specific front-end, etc. */
+static void
+print_filtered_help (unsigned int flag)
+{
+ unsigned int i, len, filter, indent = 0;
+ bool duplicates = false;
+ const char *help, *opt, *tab;
+ static char *printed;
+
+ if (flag == CL_COMMON)
+ {
+ filter = flag;
+ if (!printed)
+ printed = xmalloc (cl_options_count);
+ memset (printed, 0, cl_options_count);
+ }
+ else
+ {
+ /* Don't print COMMON options twice. */
+ filter = flag | CL_COMMON;
+
+ for (i = 0; i < cl_options_count; i++)
+ {
+ if ((cl_options[i].flags & filter) != flag)
+ continue;
+
+ /* Skip help for internal switches. */
+ if (cl_options[i].flags & CL_UNDOCUMENTED)
+ continue;
+
+ /* Skip switches that have already been printed, mark them to be
+ listed later. */
+ if (printed[i])
+ {
+ duplicates = true;
+ indent = print_switch (cl_options[i].opt_text, indent);
+ }
+ }
+
+ if (duplicates)
+ {
+ putchar ('\n');
+ putchar ('\n');
+ }
+ }
for (i = 0; i < cl_options_count; i++)
{
- const char *help = cl_options[i].help;
- const char *opt, *tab;
+ if ((cl_options[i].flags & filter) != flag)
+ continue;
- /* During transition, ignore switches with no help. */
- if (!help)
+ /* Skip help for internal switches. */
+ if (cl_options[i].flags & CL_UNDOCUMENTED)
continue;
+ /* Skip switches that have already been printed. */
+ if (printed[i])
+ continue;
+
+ printed[i] = true;
+
+ help = cl_options[i].help;
+ if (!help)
+ help = undocumented_msg;
+
/* Get the translation. */
help = _(help);
@@ -1517,16 +1760,41 @@ print_help (void)
wrap_help (help, opt, len);
}
- puts ( "\n" );
- display_help ();
+ putchar ('\n');
+}
+
+/* Output ITEM, of length ITEM_WIDTH, in the left column, followed by
+ word-wrapped HELP in a second column. */
+static unsigned int
+print_switch (const char *text, unsigned int indent)
+{
+ unsigned int len = strlen (text) + 1; /* trailing comma */
+
+ if (indent)
+ {
+ putchar (',');
+ if (indent + len > columns)
+ {
+ putchar ('\n');
+ putchar (' ');
+ indent = 1;
+ }
+ }
+ else
+ putchar (' ');
+
+ putchar (' ');
+ fputs (text, stdout);
+
+ return indent + len + 1;
}
/* Output ITEM, of length ITEM_WIDTH, in the left column, followed by
word-wrapped HELP in a second column. */
static void
-wrap_help (const char *help, const char *item, int item_width)
+wrap_help (const char *help, const char *item, unsigned int item_width)
{
- const int columns = 80, col_width = 27;
+ unsigned int col_width = 27;
unsigned int remaining, room, len;
remaining = strlen (help);
@@ -1534,6 +1802,8 @@ wrap_help (const char *help, const char *item, int item_width)
do
{
room = columns - 3 - MAX (col_width, item_width);
+ if (room > columns)
+ room = 0;
len = remaining;
if (room < len)
@@ -1546,7 +1816,9 @@ wrap_help (const char *help, const char *item, int item_width)
break;
if (help[i] == ' ')
len = i;
- else if (help[i] == '-')
+ else if ((help[i] == '-' || help[i] == '/')
+ && help[i + 1] != ' '
+ && ISALPHA (help[i - 1]))
len = i + 1;
}
}
diff --git a/gcc/opts.h b/gcc/opts.h
index cffeeba98cc..eb7c868120b 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -22,6 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define GCC_OPTS_H
extern void decode_options (unsigned int argc, const char **argv);
+extern void add_input_filename (const char *filename);
struct cl_option
{
@@ -42,5 +43,14 @@ extern const char *const lang_names[];
#define CL_MISSING_OK (1 << 27) /* Missing argument OK (joined). */
#define CL_UINTEGER (1 << 28) /* Argument is an integer >=0. */
#define CL_COMMON (1 << 29) /* Language-independent. */
+#define CL_UNDOCUMENTED (1 << 30) /* Do not output with --help. */
+
+/* Input file names. */
+
+extern const char **in_fnames;
+
+/* The count of input filenames. */
+
+extern unsigned num_in_fnames;
#endif
diff --git a/gcc/opts.sh b/gcc/opts.sh
index 985cf9668c2..871c8554211 100644
--- a/gcc/opts.sh
+++ b/gcc/opts.sh
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# Usage: opts.sh outfile.c outfile.h file1.opt [file2.opt, ...]
+# Usage: opts.sh moveifchange srcdir outfile.c outfile.h file1.opt [ ...]
# Always operate in the C locale.
LANG=C
@@ -30,8 +30,11 @@ AWK=${AWK-awk}
SORT=sort # Could be /bin/sort or /usr/bin/sort
+MOVEIFCHANGE=$1; shift
C_FILE=$1; shift
H_FILE=$1; shift
+TMP_C_FILE=tmp-${C_FILE}
+TMP_H_FILE=tmp-${H_FILE}
${AWK} '
# Ignore comments and blank lines
@@ -39,7 +42,7 @@ ${AWK} '
# Note that RS="" falls foul of gawk 3.1.2 bugs
/^[^ \t]/ { record = $0
do { getline tmp;
- if (tmp != "" )
+ if (!(tmp ~ "^[ \t]*(;|$)"))
record = record "\034" tmp
} while (tmp != "")
print record
@@ -62,6 +65,7 @@ ${AWK} '
if (flags ~ " Separate ") result = result " | CL_SEPARATE"
if (flags ~ " RejectNegative ") result = result " | CL_REJECT_NEGATIVE"
if (flags ~ " UInteger ") result = result " | CL_UINTEGER"
+ if (flags ~ " Undocumented ") result = result " | CL_UNDOCUMENTED"
sub( "^0 \\| ", "", result )
return result
}
@@ -88,13 +92,14 @@ ${AWK} '
# Dump out an enumeration into a .h file, and an array of options into a
# C file. Combine the flags of duplicate options.
END {
- c_file = "'${C_FILE}'"
- h_file = "'${H_FILE}'"
+ c_file = "'${TMP_C_FILE}'"
+ h_file = "'${TMP_H_FILE}'"
+ realh_file = "'${H_FILE}'"
comma = ","
print "/* This file is auto-generated by opts.sh. */\n" > c_file
print "#include <intl.h>" >> c_file
- print "#include \"" h_file "\"" >> c_file
+ print "#include \"" realh_file "\"" >> c_file
print "#include \"opts.h\"\n" >> c_file
print "const char * const lang_names[] =\n{" >> c_file
@@ -163,3 +168,8 @@ ${AWK} '
print "};" >> c_file
}
'
+
+# Copy the newly generated files back to the correct names only if different.
+# This is to prevent a cascade of file rebuilds when not necessary.
+${MOVEIFCHANGE} ${TMP_H_FILE} ${H_FILE}
+${MOVEIFCHANGE} ${TMP_C_FILE} ${C_FILE}
diff --git a/gcc/output.h b/gcc/output.h
index ac24c4b36a6..a2b48e79dd0 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -422,10 +422,10 @@ extern FILE *rtl_dump_file;
#endif
/* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */
-extern struct rtx_def *current_insn_predicate;
+extern rtx current_insn_predicate;
/* Last insn processed by final_scan_insn. */
-extern struct rtx_def *current_output_insn;
+extern rtx current_output_insn;
/* Nonzero while outputting an `asm' with operands.
This means that inconsistencies are the user's fault, so don't abort.
@@ -473,25 +473,20 @@ extern unsigned int get_named_section_flags (const char *);
extern bool set_named_section_flags (const char *, unsigned int);
extern void named_section_flags (const char *, unsigned int);
extern bool named_section_first_declaration (const char *);
-
-union tree_node;
-extern unsigned int default_section_type_flags (union tree_node *,
- const char *, int);
-extern unsigned int default_section_type_flags_1 (union tree_node *,
- const char *, int, int);
+extern unsigned int default_section_type_flags (tree, const char *, int);
+extern unsigned int default_section_type_flags_1 (tree, const char *, int, int);
extern void default_no_named_section (const char *, unsigned int);
extern void default_elf_asm_named_section (const char *, unsigned int);
extern void default_coff_asm_named_section (const char *, unsigned int);
extern void default_pe_asm_named_section (const char *, unsigned int);
-extern void default_stabs_asm_out_destructor (struct rtx_def *, int);
-extern void default_named_section_asm_out_destructor (struct rtx_def *, int);
-extern void default_dtor_section_asm_out_destructor (struct rtx_def *, int);
-extern void default_stabs_asm_out_constructor (struct rtx_def *, int);
-extern void default_named_section_asm_out_constructor (struct rtx_def *,
- int);
-extern void default_ctor_section_asm_out_constructor (struct rtx_def *, int);
+extern void default_stabs_asm_out_destructor (rtx, int);
+extern void default_named_section_asm_out_destructor (rtx, int);
+extern void default_dtor_section_asm_out_destructor (rtx, int);
+extern void default_stabs_asm_out_constructor (rtx, int);
+extern void default_named_section_asm_out_constructor (rtx, int);
+extern void default_ctor_section_asm_out_constructor (rtx, int);
extern void default_select_section (tree, int, unsigned HOST_WIDE_INT);
extern void default_elf_select_section (tree, int, unsigned HOST_WIDE_INT);
@@ -513,10 +508,6 @@ extern void default_file_start (void);
extern void file_end_indicate_exec_stack (void);
extern bool default_valid_pointer_mode (enum machine_mode);
-/* Emit data for vtable gc for GNU binutils. */
-extern void assemble_vtable_entry (struct rtx_def *, HOST_WIDE_INT);
-extern void assemble_vtable_inherit (struct rtx_def *, struct rtx_def *);
-
extern int default_address_cost (rtx);
#endif /* ! GCC_OUTPUT_H */
diff --git a/gcc/params.c b/gcc/params.c
index 3ef0a7fdf5a..e109d3adb3f 100644
--- a/gcc/params.c
+++ b/gcc/params.c
@@ -43,10 +43,8 @@ void
add_params (const param_info params[], size_t n)
{
/* Allocate enough space for the new parameters. */
- compiler_params =
- ((param_info *)
- xrealloc (compiler_params,
- (num_compiler_params + n) * sizeof (param_info)));
+ compiler_params = xrealloc (compiler_params,
+ (num_compiler_params + n) * sizeof (param_info));
/* Copy them into the table. */
memcpy (compiler_params + num_compiler_params,
params,
diff --git a/gcc/params.def b/gcc/params.def
index 3f1d94b6bea..c5dfca864d5 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -51,7 +51,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
"max-inline-insns-single",
"The maximum number of instructions in a single function eligible for inlining",
- 100)
+ 500)
/* The single function inlining limit for functions that are
inlined by virtue of -finline-functions (-O3).
@@ -63,7 +63,7 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
"max-inline-insns-auto",
"The maximum number of instructions when automatically inlining",
- 100)
+ 150)
/* The repeated inlining limit. After this number of instructions
(in the internal gcc representation, not real machine instructions)
@@ -152,6 +152,19 @@ DEFPARAM(PARAM_MAX_PENDING_LIST_LENGTH,
"The maximum length of scheduling's pending operations list",
32)
+DEFPARAM(PARAM_LARGE_FUNCTION_INSNS,
+ "large-function-insns",
+ "The size of function body to be considered large",
+ 10000)
+DEFPARAM(PARAM_LARGE_FUNCTION_GROWTH,
+ "large-function-growth",
+ "Maximal growth due to inlining of large function (in percent)",
+ 100)
+DEFPARAM(PARAM_INLINE_UNIT_GROWTH,
+ "inline-unit-growth",
+ "how much can given compilation unit grow because of the inlining (in percent)",
+ 50)
+
/* The GCSE optimization will be disabled if it would require
significantly more memory than this value. */
DEFPARAM(PARAM_MAX_GCSE_MEMORY,
@@ -240,22 +253,22 @@ must be covered by trace formation. Used when profile feedback is not available"
75)
DEFPARAM(TRACER_MAX_CODE_GROWTH,
"tracer-max-code-growth",
- "Maximal code growth caused by tail duplication (in percents)",
+ "Maximal code growth caused by tail duplication (in percent)",
100)
DEFPARAM(TRACER_MIN_BRANCH_RATIO,
"tracer-min-branch-ratio",
"Stop reverse growth if the reverse probability of best edge is less \
-than this threshold (in percents)",
+than this threshold (in percent)",
10)
DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY_FEEDBACK,
"tracer-min-branch-probability-feedback",
"Stop forward growth if the probability of best edge is less than \
-this threshold (in percents). Used when profile feedback is available",
+this threshold (in percent). Used when profile feedback is available",
80)
DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY,
"tracer-min-branch-probability",
"Stop forward growth if the probability of best edge is less than \
-this threshold (in percents). Used when profile feedback is not available",
+this threshold (in percent). Used when profile feedback is not available",
50)
/* The maximum number of incoming edges to consider for crossjumping. */
@@ -267,7 +280,7 @@ DEFPARAM(PARAM_MAX_CROSSJUMP_EDGES,
/* The maximum length of path considered in cse. */
DEFPARAM(PARAM_MAX_CSE_PATH_LENGTH,
"max-cse-path-length",
- "The maximum length of path considered in cse.",
+ "The maximum length of path considered in cse",
10)
#ifdef ENABLE_GC_ALWAYS_COLLECT
@@ -281,12 +294,12 @@ DEFPARAM(PARAM_MAX_CSE_PATH_LENGTH,
DEFPARAM(GGC_MIN_EXPAND,
"ggc-min-expand",
"Minimum heap expansion to trigger garbage collection, as \
-a percentage of the total size of the heap.",
+a percentage of the total size of the heap",
GGC_MIN_EXPAND_DEFAULT)
DEFPARAM(GGC_MIN_HEAPSIZE,
"ggc-min-heapsize",
- "Minimum heap size before we start collecting garbage, in kilobytes.",
+ "Minimum heap size before we start collecting garbage, in kilobytes",
GGC_MIN_HEAPSIZE_DEFAULT)
#undef GGC_MIN_EXPAND_DEFAULT
diff --git a/gcc/po/exgettext b/gcc/po/exgettext
index 83e39239dcf..93f65c34370 100644
--- a/gcc/po/exgettext
+++ b/gcc/po/exgettext
@@ -58,6 +58,9 @@ kopt=$pwd/$T/keyword-options
emsg=$pwd/$T/emsgids.c
posr=$pwd/$T/po-sources
+# Extra files to scan
+extra_files=$pwd/options.c
+
# Locate files to scan, and generate the list. All .c, .h, and .def files
# in $srcdir are examined, likewise $srcdir/config and $srcdir/config/*
# (directories). Also, all subdirectories of $srcdir that contain a
@@ -75,11 +78,13 @@ echo "scanning for keywords and %e strings..." >&2
( cd $srcdir
lang_subdirs=`echo */config-lang.in | sed -e 's|config-lang\.in||g'`
- for dir in "" config/ config/*/ $lang_subdirs
- do for glob in '*.c' '*.h' '*.def'
- do eval echo $dir$glob
- done
- done | tr ' ' "$nl" | grep -v '\*' |
+ { for dir in "" config/ config/*/ $lang_subdirs
+ do for glob in '*.c' '*.h' '*.def'
+ do eval echo $dir$glob
+ done
+ done;
+ echo $extra_files;
+ } | tr ' ' "$nl" | grep -v '\*' |
$AWK -v excl=po/EXCLUDES -v posr=$posr -v kopt=$kopt -v emsg=$emsg '
function keyword_option(line) {
paren_index = index(line, "(")
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 9c459c5b463..2875dbdffd0 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -377,11 +377,11 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
if (! constrain_operands (1))
fatal_insn_not_found (insn);
- alternative_reject = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- alternative_nregs = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- alternative_order = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- memset ((char *) alternative_reject, 0, recog_data.n_alternatives * sizeof (int));
- memset ((char *) alternative_nregs, 0, recog_data.n_alternatives * sizeof (int));
+ alternative_reject = alloca (recog_data.n_alternatives * sizeof (int));
+ alternative_nregs = alloca (recog_data.n_alternatives * sizeof (int));
+ alternative_order = alloca (recog_data.n_alternatives * sizeof (int));
+ memset (alternative_reject, 0, recog_data.n_alternatives * sizeof (int));
+ memset (alternative_nregs, 0, recog_data.n_alternatives * sizeof (int));
/* For each operand, find out which regs are equivalent. */
for (i = 0; i < recog_data.n_operands; i++)
@@ -414,7 +414,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
int regno;
const char *p;
- op_alt_regno[i] = (int *) alloca (recog_data.n_alternatives * sizeof (int));
+ op_alt_regno[i] = alloca (recog_data.n_alternatives * sizeof (int));
for (j = 0; j < recog_data.n_alternatives; j++)
op_alt_regno[i][j] = -1;
@@ -659,7 +659,7 @@ reload_combine (void)
destination. */
min_labelno = get_first_label_num ();
n_labels = max_label_num () - min_labelno;
- label_live = (HARD_REG_SET *) xmalloc (n_labels * sizeof (HARD_REG_SET));
+ label_live = xmalloc (n_labels * sizeof (HARD_REG_SET));
CLEAR_HARD_REG_SET (ever_live_at_start);
FOR_EACH_BB_REVERSE (bb)
diff --git a/gcc/predict.c b/gcc/predict.c
index e42eed04f1e..243c814775d 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -522,7 +522,7 @@ estimate_probability (struct loops *loops_info)
}
}
- cond = get_condition (last_insn, &earliest);
+ cond = get_condition (last_insn, &earliest, false);
if (! cond)
continue;
@@ -678,7 +678,7 @@ expected_value_to_br_prob (void)
(lt r70, r71)
Could use cselib to try and reduce this further. */
cond = XEXP (SET_SRC (pc_set (insn)), 0);
- cond = canonicalize_condition (insn, cond, 0, NULL, ev_reg);
+ cond = canonicalize_condition (insn, cond, 0, NULL, ev_reg, false);
if (! cond || XEXP (cond, 0) != ev_reg
|| GET_CODE (XEXP (cond, 1)) != CONST_INT)
continue;
diff --git a/gcc/prefix.c b/gcc/prefix.c
index ef9d9b8da92..df556aaa30c 100644
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -155,12 +155,12 @@ lookup_key (char *key)
}
size = 32;
- dst = (char *) xmalloc (size);
+ dst = xmalloc (size);
res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
if (res == ERROR_MORE_DATA && type == REG_SZ)
{
- dst = (char *) xrealloc (dst, size);
+ dst = xrealloc (dst, size);
res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
}
@@ -197,7 +197,7 @@ translate_name (char *name)
keylen++)
;
- key = (char *) alloca (keylen + 1);
+ key = alloca (keylen + 1);
strncpy (key, &name[1], keylen);
key[keylen] = 0;
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
new file mode 100644
index 00000000000..43e440979c0
--- /dev/null
+++ b/gcc/pretty-print.c
@@ -0,0 +1,547 @@
+/* Various declarations for language-independent pretty-print subroutines.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "config.h"
+#undef FLOAT /* This is for hpux. They should change hpux. */
+#undef FFS /* Some systems define this in param.h. */
+#include "system.h"
+#include "coretypes.h"
+#include "pretty-print.h"
+
+#define obstack_chunk_alloc xmalloc
+#define obstack_chunk_free free
+
+/* A pointer to the formatted diagnostic message. */
+#define pp_formatted_text_data(PP) \
+ ((const char *) obstack_base (&pp_base (PP)->buffer->obstack))
+
+/* Format an integer given by va_arg (ARG, type-specifier T) where
+ type-specifier is a precision modifier as indicated by PREC. F is
+ a string used to construct the appropriate format-specifier. */
+#define pp_integer_with_precision(PP, ARG, PREC, T, F) \
+ do \
+ switch (PREC) \
+ { \
+ case 0: \
+ pp_scalar (PP, "%" F, va_arg (ARG, T)); \
+ break; \
+ \
+ case 1: \
+ pp_scalar (PP, "%l" F, va_arg (ARG, long T)); \
+ break; \
+ \
+ case 2: \
+ pp_scalar (PP, "%ll" F, va_arg (ARG, long long T)); \
+ break; \
+ \
+ default: \
+ break; \
+ } \
+ while (0)
+
+
+/* Subroutine of pp_set_maximum_length. Set up PRETTY-PRINTER's
+ internal maximum characters per line. */
+static void
+pp_set_real_maximum_length (pretty_printer *pp)
+{
+ /* If we're told not to wrap lines then do the obvious thing. In case
+ we'll emit prefix only once per message, it is appropriate
+ not to increase unnecessarily the line-length cut-off. */
+ if (!pp_is_wrapping_line (pp)
+ || pp_prefixing_rule (pp) == DIAGNOSTICS_SHOW_PREFIX_ONCE
+ || pp_prefixing_rule (pp) == DIAGNOSTICS_SHOW_PREFIX_NEVER)
+ pp->maximum_length = pp_line_cutoff (pp);
+ else
+ {
+ int prefix_length = pp->prefix ? strlen (pp->prefix) : 0;
+ /* If the prefix is ridiculously too long, output at least
+ 32 characters. */
+ if (pp_line_cutoff (pp) - prefix_length < 32)
+ pp->maximum_length = pp_line_cutoff (pp) + 32;
+ else
+ pp->maximum_length = pp_line_cutoff (pp);
+ }
+}
+
+/* Clear PRETTY-PRINTER's output state. */
+static inline void
+pp_clear_state (pretty_printer *pp)
+{
+ pp->emitted_prefix = false;
+ pp_indentation (pp) = 0;
+}
+
+/* Flush the formatted text of PRETTY-PRINTER onto the attached stream. */
+static inline void
+pp_write_text_to_stream (pretty_printer *pp)
+{
+ const char *text = pp_formatted_text (pp);
+ fputs (text, pp->buffer->stream);
+ pp_clear_output_area (pp);
+}
+
+/* Wrap a text delimited by START and END into PRETTY-PRINTER. */
+static void
+pp_wrap_text (pretty_printer *pp, const char *start, const char *end)
+{
+ bool wrapping_line = pp_is_wrapping_line (pp);
+
+ while (start != end)
+ {
+ /* Dump anything bordered by whitespaces. */
+ {
+ const char *p = start;
+ while (p != end && !ISBLANK (*p) && *p != '\n')
+ ++p;
+ if (wrapping_line
+ && p - start >= pp_remaining_character_count_for_line (pp))
+ pp_newline (pp);
+ pp_append_text (pp, start, p);
+ start = p;
+ }
+
+ if (start != end && ISBLANK (*start))
+ {
+ pp_space (pp);
+ ++start;
+ }
+ if (start != end && *start == '\n')
+ {
+ pp_newline (pp);
+ ++start;
+ }
+ }
+}
+
+/* Same as pp_wrap_text but wrap text only when in line-wrapping mode. */
+static inline void
+pp_maybe_wrap_text (pretty_printer *pp, const char *start, const char *end)
+{
+ if (pp_is_wrapping_line (pp))
+ pp_wrap_text (pp, start, end);
+ else
+ pp_append_text (pp, start, end);
+}
+
+/* Append to the output area of PRETTY-PRINTER a string specified by its
+ STARTing character and LENGTH. */
+static inline void
+pp_append_r (pretty_printer *pp, const char *start, int length)
+{
+ obstack_grow (&pp->buffer->obstack, start, length);
+ pp->buffer->line_length += length;
+}
+
+/* Insert enough spaces into the output area of PRETTY-PRINTER to bring
+ the column position to the current indentation level, assuming that a
+ newline has just been written to the buffer. */
+void
+pp_base_indent (pretty_printer *pp)
+{
+ int n = pp_indentation (pp);
+ int i;
+
+ for (i = 0; i < n; ++i)
+ pp_space (pp);
+}
+
+/* Format a message pointed to by TEXT. The following format specifiers are
+ recognized as being client independent:
+ %d, %i: (signed) integer in base ten.
+ %u: unsigned integer in base ten.
+ %o: unsigned integer in base eight.
+ %x: unsigned integer in base sixteen.
+ %ld, %li, %lo, %lu, %lx: long versions of the above.
+ %lld, %lli, %llo, %llu, %llx: long long versions.
+ %wd, %wi, %wo, %wu, %wx: HOST_WIDE_INT versions.
+ %c: character.
+ %s: string.
+ %p: pointer.
+ %m: strerror(text->err_no) - does not consume a value from args_ptr.
+ %%: `%'.
+ %*.s: a substring the length of which is specified by an integer.
+ %H: location_t. */
+void
+pp_base_format_text (pretty_printer *pp, text_info *text)
+{
+ for (; *text->format_spec; ++text->format_spec)
+ {
+ int precision = 0;
+ bool wide = false;
+
+ /* Ignore text. */
+ {
+ const char *p = text->format_spec;
+ while (*p && *p != '%')
+ ++p;
+ pp_wrap_text (pp, text->format_spec, p);
+ text->format_spec = p;
+ }
+
+ if (*text->format_spec == '\0')
+ break;
+
+ /* We got a '%'. Parse precision modifiers, if any. */
+ switch (*++text->format_spec)
+ {
+ case 'w':
+ wide = true;
+ ++text->format_spec;
+ break;
+
+ case 'l':
+ do
+ ++precision;
+ while (*++text->format_spec == 'l');
+ break;
+
+ default:
+ break;
+ }
+ /* We don't support precision beyond that of "long long". */
+ if (precision > 2)
+ abort();
+
+ switch (*text->format_spec)
+ {
+ case 'c':
+ pp_character (pp, va_arg (*text->args_ptr, int));
+ break;
+
+ case 'd':
+ case 'i':
+ if (wide)
+ pp_wide_integer (pp, va_arg (*text->args_ptr, HOST_WIDE_INT));
+ else
+ pp_integer_with_precision
+ (pp, *text->args_ptr, precision, int, "d");
+ break;
+
+ case 'o':
+ if (wide)
+ pp_scalar (pp, "%" HOST_WIDE_INT_PRINT "o",
+ va_arg (*text->args_ptr, unsigned HOST_WIDE_INT));
+ else
+ pp_integer_with_precision
+ (pp, *text->args_ptr, precision, unsigned, "u");
+ break;
+
+ case 's':
+ pp_string (pp, va_arg (*text->args_ptr, const char *));
+ break;
+
+ case 'p':
+ pp_pointer (pp, va_arg (*text->args_ptr, void *));
+ break;
+
+ case 'u':
+ if (wide)
+ pp_scalar (pp, HOST_WIDE_INT_PRINT_UNSIGNED,
+ va_arg (*text->args_ptr, unsigned HOST_WIDE_INT));
+ else
+ pp_integer_with_precision
+ (pp, *text->args_ptr, precision, unsigned, "u");
+ break;
+
+ case 'x':
+ if (wide)
+ pp_scalar (pp, HOST_WIDE_INT_PRINT_HEX,
+ va_arg (*text->args_ptr, unsigned HOST_WIDE_INT));
+ else
+ pp_integer_with_precision
+ (pp, *text->args_ptr, precision, unsigned, "x");
+ break;
+
+ case 'm':
+ pp_string (pp, xstrerror (text->err_no));
+ break;
+
+ case '%':
+ pp_character (pp, '%');
+ break;
+
+ case 'H':
+ {
+ const location_t *locus = va_arg (*text->args_ptr, location_t *);
+ pp_string (pp, "file '");
+ pp_string (pp, locus->file);
+ pp_string (pp, "', line ");
+ pp_decimal_int (pp, locus->line);
+ }
+ break;
+
+ case '.':
+ {
+ int n;
+ const char *s;
+ /* We handle no precision specifier but `%.*s'. */
+ if (*++text->format_spec != '*')
+ abort ();
+ else if (*++text->format_spec != 's')
+ abort ();
+ n = va_arg (*text->args_ptr, int);
+ s = va_arg (*text->args_ptr, const char *);
+ pp_append_text (pp, s, s + n);
+ }
+ break;
+
+ default:
+ if (!pp_format_decoder (pp) || !(*pp_format_decoder (pp)) (pp, text))
+ {
+ /* Hmmm. The client failed to install a format translator
+ but called us with an unrecognized format. Or, maybe, the
+ translated string just contains an invalid format, or
+ has formats in the wrong order. Sorry. */
+ abort ();
+ }
+ }
+ }
+}
+
+/* Helper subroutine of output_verbatim and verbatim. Do the appropriate
+ settings needed by BUFFER for a verbatim formatting. */
+void
+pp_base_format_verbatim (pretty_printer *pp, text_info *text)
+{
+ diagnostic_prefixing_rule_t rule = pp_prefixing_rule (pp);
+ int line_cutoff = pp_line_cutoff (pp);
+
+ /* Set verbatim mode. */
+ pp->prefixing_rule = DIAGNOSTICS_SHOW_PREFIX_NEVER;
+ pp_line_cutoff (pp) = 0;
+ /* Do the actual formatting. */
+ pp_format_text (pp, text);
+ /* Restore previous settings. */
+ pp_prefixing_rule (pp) = rule;
+ pp_line_cutoff (pp) = line_cutoff;
+}
+
+/* Flush the content of BUFFER onto the attached stream. */
+void
+pp_base_flush (pretty_printer *pp)
+{
+ pp_write_text_to_stream (pp);
+ pp_clear_state (pp);
+ fputc ('\n', pp->buffer->stream);
+ fflush (pp->buffer->stream);
+}
+
+/* Sets the number of maximum characters per line PRETTY-PRINTER can
+ output in line-wrapping mode. A LENGTH value 0 suppresses
+ line-wrapping. */
+void
+pp_base_set_line_maximum_length (pretty_printer *pp, int length)
+{
+ pp_line_cutoff (pp) = length;
+ pp_set_real_maximum_length (pp);
+}
+
+/* Clear PRETTY-PRINTER output area text info. */
+void
+pp_base_clear_output_area (pretty_printer *pp)
+{
+ obstack_free (&pp->buffer->obstack, obstack_base (&pp->buffer->obstack));
+ pp->buffer->line_length = 0;
+}
+
+/* Set PREFIX for PRETTY-PRINTER. */
+void
+pp_base_set_prefix (pretty_printer *pp, const char *prefix)
+{
+ pp->prefix = prefix;
+ pp_set_real_maximum_length (pp);
+ pp->emitted_prefix = false;
+ pp_indentation (pp) = 0;
+}
+
+/* Free PRETTY-PRINTER's prefix, a previously malloc()'d string. */
+void
+pp_base_destroy_prefix (pretty_printer *pp)
+{
+ if (pp->prefix != NULL)
+ {
+ free ((char *) pp->prefix);
+ pp->prefix = NULL;
+ }
+}
+
+/* Write out PRETTY-PRINTER's prefix. */
+void
+pp_base_emit_prefix (pretty_printer *pp)
+{
+ if (pp->prefix != NULL)
+ {
+ switch (pp_prefixing_rule (pp))
+ {
+ default:
+ case DIAGNOSTICS_SHOW_PREFIX_NEVER:
+ break;
+
+ case DIAGNOSTICS_SHOW_PREFIX_ONCE:
+ if (pp->emitted_prefix)
+ {
+ pp_base_indent (pp);
+ break;
+ }
+ pp_indentation (pp) += 3;
+ /* Fall through. */
+
+ case DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE:
+ {
+ int prefix_length = strlen (pp->prefix);
+ pp_append_r (pp, pp->prefix, prefix_length);
+ pp->emitted_prefix = true;
+ }
+ break;
+ }
+ }
+}
+
+/* Construct a PRETTY-PRINTER with PREFIX and of MAXIMUM_LENGTH
+ characters per line. */
+void
+pp_construct (pretty_printer *pp, const char *prefix, int maximum_length)
+{
+ memset (pp, 0, sizeof (pretty_printer));
+ pp->buffer = xcalloc (1, sizeof (output_buffer));
+ obstack_init (&pp->buffer->obstack);
+ pp->buffer->stream = stderr;
+ pp_line_cutoff (pp) = maximum_length;
+ pp_prefixing_rule (pp) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
+ pp_set_prefix (pp, prefix);
+}
+
+/* Append a string delimited by START and END to the output area of
+ PRETTY-PRINTER. No line wrapping is done. However, if beginning a
+ new line then emit PRETTY-PRINTER's prefix and skip any leading
+ whitespace if appropriate. The caller must ensure that it is
+ safe to do so. */
+void
+pp_base_append_text (pretty_printer *pp, const char *start, const char *end)
+{
+ /* Emit prefix and skip whitespace if we're starting a new line. */
+ if (pp->buffer->line_length == 0)
+ {
+ pp_emit_prefix (pp);
+ if (pp_is_wrapping_line (pp))
+ while (start != end && *start == ' ')
+ ++start;
+ }
+ pp_append_r (pp, start, end - start);
+}
+
+/* Finishes constructing a NULL-terminated character string representing
+ the PRETTY-PRINTED text. */
+const char *
+pp_base_formatted_text (pretty_printer *pp)
+{
+ obstack_1grow (&pp->buffer->obstack, '\0');
+ return pp_formatted_text_data (pp);
+}
+
+/* Return a pointer to the last character emitted in PRETTY-PRINTER's
+ output area. A NULL pointer means no character available. */
+const char *
+pp_base_last_position_in_text (const pretty_printer *pp)
+{
+ const char *p = NULL;
+ struct obstack *text = &pp->buffer->obstack;
+
+ if (obstack_base (text) != obstack_next_free (text))
+ p = ((const char *) obstack_next_free (text)) - 1;
+ return p;
+}
+
+/* Return the amount of characters PRETTY-PRINTER can accept to
+ make a full line. Meaningfull only in line-wrapping mode. */
+int
+pp_base_remaining_character_count_for_line (pretty_printer *pp)
+{
+ return pp->maximum_length - pp->buffer->line_length;
+}
+
+
+/* Format a message into BUFFER a la printf. */
+void
+pp_printf (pretty_printer *pp, const char *msg, ...)
+{
+ text_info text;
+ va_list ap;
+
+ va_start (ap, msg);
+ text.err_no = errno;
+ text.args_ptr = &ap;
+ text.format_spec = msg;
+ pp_format_text (pp, &text);
+ va_end (ap);
+}
+
+
+/* Output MESSAGE verbatim into BUFFER. */
+void
+pp_verbatim (pretty_printer *pp, const char *msg, ...)
+{
+ text_info text;
+ va_list ap;
+
+ va_start (ap, msg);
+ text.err_no = errno;
+ text.args_ptr = &ap;
+ text.format_spec = msg;
+ pp_format_verbatim (pp, &text);
+ va_end (ap);
+}
+
+
+
+/* Have PRETTY-PRINTER start a new line. */
+void
+pp_base_newline (pretty_printer *pp)
+{
+ obstack_1grow (&pp->buffer->obstack, '\n');
+ pp->buffer->line_length = 0;
+}
+
+/* Have PRETTY-PRINTER add a CHARACTER. */
+void
+pp_base_character (pretty_printer *pp, int c)
+{
+ if (pp_is_wrapping_line (pp)
+ && pp_remaining_character_count_for_line (pp) <= 0)
+ {
+ pp_newline (pp);
+ if (ISSPACE (c))
+ return;
+ }
+ obstack_1grow (&pp->buffer->obstack, c);
+ ++pp->buffer->line_length;
+}
+
+/* Append a STRING to the output area of PRETTY-PRINTER; the STRING may
+ be line-wrapped if in appropriate mode. */
+void
+pp_base_string (pretty_printer *pp, const char *str)
+{
+ pp_maybe_wrap_text (pp, str, str + (str ? strlen (str) : 0));
+}
+
+
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index 5efb9e73078..80affe83e6f 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -1,5 +1,5 @@
/* Various declarations for language-independent pretty-print subroutines.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -22,7 +22,47 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_PRETTY_PRINT_H
#define GCC_PRETTY_PRINT_H
-#include "diagnostic.h"
+#include "obstack.h"
+#include "input.h"
+
+/* The type of a text to be formatted according a format specification
+ along with a list of things. */
+typedef struct
+{
+ const char *format_spec;
+ va_list *args_ptr;
+ int err_no; /* for %m */
+} text_info;
+
+/* How often diagnostics are prefixed by their locations:
+ o DIAGNOSTICS_SHOW_PREFIX_NEVER: never - not yet supported;
+ o DIAGNOSTICS_SHOW_PREFIX_ONCE: emit only once;
+ o DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE: emit each time a physical
+ line is started. */
+typedef enum
+{
+ DIAGNOSTICS_SHOW_PREFIX_ONCE = 0x0,
+ DIAGNOSTICS_SHOW_PREFIX_NEVER = 0x1,
+ DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE = 0x2
+} diagnostic_prefixing_rule_t;
+
+/* The output buffer datatype. This is best seen as an abstract datatype
+ whose fields should not be accessed directly by clients. */
+typedef struct
+{
+ /* The obstack where the text is built up. */
+ struct obstack obstack;
+
+ /* Where to output formatted text. */
+ FILE *stream;
+
+ /* The amount of characters output so far. */
+ int line_length;
+
+ /* This must be large enough to hold any printed integer or
+ floating-point value. */
+ char digit_buffer[128];
+} output_buffer;
/* The type of pretty-printer flags passed to clients. */
typedef unsigned int pp_flags;
@@ -32,69 +72,190 @@ typedef enum
pp_none, pp_before, pp_after
} pp_padding;
+/* The type of a hook that formats client-specific data onto a pretty_pinter.
+ A client-supplied formatter returns true if everything goes well,
+ otherwise it returns false. */
+typedef struct pretty_print_info pretty_printer;
+typedef bool (*printer_fn) (pretty_printer *, text_info *);
+
+/* Client supplied function used to decode formats. */
+#define pp_format_decoder(PP) pp_base (PP)->format_decoder
+
+/* TRUE if a newline character needs to be added before further
+ formatting. */
+#define pp_needs_newline(PP) pp_base (PP)->need_newline
+
+/* Maximum characters per line in automatic line wrapping mode.
+ Zero means don't wrap lines. */
+#define pp_line_cutoff(PP) pp_base (PP)->ideal_maximum_length
+
+/* True if PRETTY-PTINTER is in line-wrapping mode. */
+#define pp_is_wrapping_line(PP) (pp_line_cutoff (PP) > 0)
+
+/* Prefixing rule used in formatting a diagnostic message. */
+#define pp_prefixing_rule(PP) pp_base (PP)->prefixing_rule
+
+/* The amount of whitespace to be emitted when starting a new line. */
+#define pp_indentation(PP) pp_base (PP)->indent_skip
+
+/* The data structure that contains the bare minimum required to do
+ proper pretty-printing. Clients may derived from this structure
+ and add additional fields they need. */
struct pretty_print_info
{
/* Where we print external representation of ENTITY. */
output_buffer *buffer;
- pp_flags flags;
+
+ /* The prefix for each new line. */
+ const char *prefix;
+
/* Where to put whitespace around the entity being formatted. */
pp_padding padding;
+
+ /* The real upper bound of number of characters per line, taking into
+ account the case of a very very looong prefix. */
+ int maximum_length;
+
+ /* The ideal upper bound of number of characters per line, as suggested
+ by front-end. */
+ int ideal_maximum_length;
+
+ /* Indentation count. */
+ int indent_skip;
+
+ /* Current prefixing rule. */
+ diagnostic_prefixing_rule_t prefixing_rule;
+
+ /* If non-NULL, this function formats a TEXT into the BUFFER. When called,
+ TEXT->format_spec points to a format code. FORMAT_DECODER should call
+ pp_string (and related functions) to add data to the BUFFER.
+ FORMAT_DECODER can read arguments from *TEXT->args_pts using VA_ARG.
+ If the BUFFER needs additional characters from the format string, it
+ should advance the TEXT->format_spec as it goes. When FORMAT_DECODER
+ returns, TEXT->format_spec should point to the last character processed.
+ */
+ printer_fn format_decoder;
+
+ /* Nonzero if current PREFIX was emitted at least once. */
+ bool emitted_prefix;
+
+ /* Nonzero means one should emit a newline before outputting anything. */
+ bool need_newline;
};
-#define pp_left_paren(PPI) output_add_character (pp_buffer (PPI), '(')
-#define pp_right_paren(PPI) output_add_character (pp_buffer (PPI), ')')
-#define pp_left_bracket(PPI) output_add_character (pp_buffer (PPI), '[')
-#define pp_right_bracket(PPI) output_add_character (pp_buffer (PPI), ']')
-#define pp_left_brace(PPI) output_add_character (pp_buffer (PPI), '{')
-#define pp_right_brace(PPI) output_add_character (pp_buffer (PPI), '}')
-#define pp_semicolon(PPI) output_add_character (pp_buffer (PPI), ';')
-#define pp_comma(PPI) output_add_string (pp_buffer (PPI), ", ")
-#define pp_dot(PPI) output_add_character (pp_buffer (PPI), '.')
-#define pp_colon(PPI) output_add_character (pp_buffer (PPI), ':')
-#define pp_colon_colon(PPI) output_add_string (pp_buffer (PPI), "::")
-#define pp_arrow(PPI) output_add_string (pp_buffer (PPI), "->")
-#define pp_equal(PPI) output_add_character (pp_buffer (PPI), '=')
-#define pp_question(PPI) output_add_character (pp_buffer (PPI), '?')
-#define pp_bar(PPI) output_add_character (pp_buffer (PPI), '|')
-#define pp_carret(PPI) output_add_character (pp_buffer (PPI), '^')
-#define pp_ampersand(PPI) output_add_character (pp_buffer (PPI), '&')
-#define pp_less(PPI) output_add_character (pp_buffer (PPI), '<')
-#define pp_greater(PPI) output_add_character (pp_buffer (PPI), '>')
-#define pp_plus(PPI) output_add_character (pp_buffer (PPI), '+')
-#define pp_minus(PPI) output_add_character (pp_buffer (PPI), '-')
-#define pp_star(PPI) output_add_character (pp_buffer (PPI), '*')
-#define pp_slash(PPI) output_add_character (pp_buffer (PPI), '/')
-#define pp_modulo(PPI) output_add_character (pp_buffer (PPI), '%')
-#define pp_exclamation(PPI) output_add_character (pp_buffer (PPI), '!')
-#define pp_complement(PPI) output_add_character (pp_buffer (PPI), '~')
-#define pp_quote(PPI) output_add_character (pp_buffer (PPI), '\'')
-#define pp_backquote(PPI) output_add_character (pp_buffer (PPI), '`')
-#define pp_doublequote(PPI) output_add_character (pp_buffer (PPI), '"')
-#define pp_newline(PPI) output_add_newline (pp_buffer (PPI))
-#define pp_character(PPI, C) output_add_character (pp_buffer (PPI), C)
-#define pp_whitespace(PPI) output_add_space (pp_buffer (PPI))
-#define pp_indentation(PPI) output_indentation (pp_buffer (PPI))
-#define pp_newline_and_indent(PPI, N) \
- do { \
- pp_indentation (PPI) += N; \
- pp_newline (PPI); \
+#define pp_set_line_maximum_length(PP, L) \
+ pp_base_set_line_maximum_length (pp_base (PP), L)
+#define pp_set_prefix(PP, P) pp_base_set_prefix (pp_base (PP), P)
+#define pp_destroy_prefix(PP) pp_base_destroy_prefix (pp_base (PP))
+#define pp_remaining_character_count_for_line(PP) \
+ pp_base_remaining_character_count_for_line (pp_base (PP))
+#define pp_clear_output_area(PP) \
+ pp_base_clear_output_area (pp_base (PP))
+#define pp_formatted_text(PP) pp_base_formatted_text (pp_base (PP))
+#define pp_last_position_in_text(PP) \
+ pp_base_last_position_in_text (pp_base (PP))
+#define pp_emit_prefix(PP) pp_base_emit_prefix (pp_base (PP))
+#define pp_append_text(PP, B, E) \
+ pp_base_append_text (pp_base (PP), B, E)
+#define pp_flush(PP) pp_base_flush (pp_base (PP))
+#define pp_format_text(PP, TI) pp_base_format_text (pp_base (PP), TI)
+#define pp_format_verbatim(PP, TI) \
+ pp_base_format_verbatim (pp_base (PP), TI)
+
+#define pp_character(PP, C) pp_base_character (pp_base (PP), C)
+#define pp_string(PP, S) pp_base_string (pp_base (PP), S)
+#define pp_newline(PP) pp_base_newline (pp_base (PP))
+
+#define pp_space(PP) pp_character (PP, ' ')
+#define pp_left_paren(PP) pp_character (PP, '(')
+#define pp_right_paren(PP) pp_character (PP, ')')
+#define pp_left_bracket(PP) pp_character (PP, '[')
+#define pp_right_bracket(PP) pp_character (PP, ']')
+#define pp_left_brace(PP) pp_character (PP, '{')
+#define pp_right_brace(PP) pp_character (PP, '}')
+#define pp_semicolon(PP) pp_character (PP, ';')
+#define pp_comma(PP) pp_string (PP, ", ")
+#define pp_dot(PP) pp_character (PP, '.')
+#define pp_colon(PP) pp_character (PP, ':')
+#define pp_colon_colon(PP) pp_string (PP, "::")
+#define pp_arrow(PP) pp_string (PP, "->")
+#define pp_equal(PP) pp_character (PP, '=')
+#define pp_question(PP) pp_character (PP, '?')
+#define pp_bar(PP) pp_character (PP, '|')
+#define pp_carret(PP) pp_character (PP, '^')
+#define pp_ampersand(PP) pp_character (PP, '&')
+#define pp_less(PP) pp_character (PP, '<')
+#define pp_greater(PP) pp_character (PP, '>')
+#define pp_plus(PP) pp_character (PP, '+')
+#define pp_minus(PP) pp_character (PP, '-')
+#define pp_star(PP) pp_character (PP, '*')
+#define pp_slash(PP) pp_character (PP, '/')
+#define pp_modulo(PP) pp_character (PP, '%')
+#define pp_exclamation(PP) pp_character (PP, '!')
+#define pp_complement(PP) pp_character (PP, '~')
+#define pp_quote(PP) pp_character (PP, '\'')
+#define pp_backquote(PP) pp_character (PP, '`')
+#define pp_doublequote(PP) pp_character (PP, '"')
+#define pp_newline_and_indent(PP, N) \
+ do { \
+ pp_indentation (PP) += N; \
+ pp_newline (PP); \
+ pp_base_indent (pp_base (PP)); \
+ pp_needs_newline (PP) = false; \
} while (0)
-#define pp_separate_with(PPI, C) \
- do { \
- pp_character (PPI, C); \
- pp_whitespace (PPI); \
+#define pp_maybe_newline_and_indent(PP, N) \
+ if (pp_needs_newline (PP)) pp_newline_and_indent (PP, N)
+#define pp_separate_with(PP, C) \
+ do { \
+ pp_character (PP, C); \
+ pp_space (PP); \
} while (0)
-#define pp_format_scalar(PPI, F, S) \
- output_formatted_scalar (pp_buffer (PPI), F, S)
-#define pp_wide_integer(PPI, I) \
- pp_format_scalar (PPI, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) I)
-#define pp_pointer(PPI, P) pp_format_scalar (PPI, "%p", p)
-
-#define pp_identifier(PPI, ID) output_add_string (pp_buffer (PPI), ID)
-#define pp_tree_identifier(PPI, T) pp_identifier(PPI, IDENTIFIER_POINTER (T))
-
-#define pp_unsupported_tree(PPI, T) \
- output_verbatim (pp_buffer(PPI), "#`%s' not supported by %s#",\
- tree_code_name[(int) TREE_CODE (T)], __FUNCTION__)
+#define pp_scalar(PP, FORMAT, SCALAR) \
+ do \
+ { \
+ sprintf (pp_buffer (PP)->digit_buffer, FORMAT, SCALAR); \
+ pp_string (PP, pp_buffer (PP)->digit_buffer); \
+ } \
+ while (0)
+#define pp_decimal_int(PP, I) pp_scalar (PP, "%d", I)
+#define pp_wide_integer(PP, I) \
+ pp_scalar (PP, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) I)
+#define pp_pointer(PP, P) pp_scalar (PP, "%p", P)
+
+#define pp_identifier(PP, ID) pp_string (PP, ID)
+#define pp_tree_identifier(PP, T) \
+ pp_append_text(PP, IDENTIFIER_POINTER (T), \
+ IDENTIFIER_POINTER (T) + IDENTIFIER_LENGTH (T))
+
+#define pp_unsupported_tree(PP, T) \
+ pp_verbatim (pp_base (PP), "#`%s' not supported by %s#", \
+ tree_code_name[(int) TREE_CODE (T)], __FUNCTION__)
+
+
+#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. */
+#define pp_base(PP) (PP)
+
+extern void pp_construct (pretty_printer *, const char *, int);
+extern void pp_base_set_line_maximum_length (pretty_printer *, int);
+extern void pp_base_set_prefix (pretty_printer *, const char *);
+extern void pp_base_destroy_prefix (pretty_printer *);
+extern int pp_base_remaining_character_count_for_line (pretty_printer *);
+extern void pp_base_clear_output_area (pretty_printer *);
+extern const char *pp_base_formatted_text (pretty_printer *);
+extern const char *pp_base_last_position_in_text (const pretty_printer *);
+extern void pp_base_emit_prefix (pretty_printer *);
+extern void pp_base_append_text (pretty_printer *, const char *, const char *);
+extern void pp_printf (pretty_printer *, const char *, ...) ATTRIBUTE_PRINTF_2;
+extern void pp_verbatim (pretty_printer *, const char *, ...);
+extern void pp_base_flush (pretty_printer *);
+extern void pp_base_format_text (pretty_printer *, text_info *);
+extern void pp_base_format_verbatim (pretty_printer *, text_info *);
+
+extern void pp_base_indent (pretty_printer *);
+extern void pp_base_newline (pretty_printer *);
+extern void pp_base_character (pretty_printer *, int);
+extern void pp_base_string (pretty_printer *, const char *);
#endif /* GCC_PRETTY_PRINT_H */
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index ebf1a70f8a4..3d6c01e01ee 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -49,7 +49,7 @@ static struct bucket **table;
void
debug_tree (tree node)
{
- table = (struct bucket **) xcalloc (HASH_SIZE, sizeof (struct bucket *));
+ table = xcalloc (HASH_SIZE, sizeof (struct bucket *));
print_node (stderr, "", node, 0);
free (table);
table = 0;
@@ -200,7 +200,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
}
/* Add this node to the table. */
- b = (struct bucket *) xmalloc (sizeof (struct bucket));
+ b = xmalloc (sizeof (struct bucket));
b->node = node;
b->next = table[hash];
table[hash] = b;
@@ -317,10 +317,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
if (TREE_CODE (node) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
fputs (" suppress-debug", file);
- if (TREE_CODE (node) == FUNCTION_DECL && DID_INLINE_FUNC (node))
- fputs (" autoinline", file);
- else if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
- fputs (" inline", file);
+ if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
+ fputs (DECL_DECLARED_INLINE_P (node) ? " inline" : " autoinline", file);
if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
fputs (" built-in", file);
if (TREE_CODE (node) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node))
@@ -599,7 +597,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
indent_to (file, indent + 4);
fprintf (file, "rtl %d ", i);
if (TREE_OPERAND (node, i))
- print_rtl (file, (struct rtx_def *) TREE_OPERAND (node, i));
+ print_rtl (file, (rtx) TREE_OPERAND (node, i));
else
fprintf (file, "(nil)");
fprintf (file, "\n");
diff --git a/gcc/profile.c b/gcc/profile.c
index dd23628c708..09949819064 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -117,6 +117,7 @@ static rtx gen_const_delta_profiler (struct histogram_value *, unsigned,
static unsigned instrument_edges (struct edge_list *);
static void instrument_values (unsigned, struct histogram_value *);
static void compute_branch_probabilities (void);
+static void compute_value_histograms (unsigned, struct histogram_value *);
static gcov_type * get_exec_counts (void);
static basic_block find_group (basic_block);
static void union_groups (basic_block, basic_block);
@@ -601,6 +602,63 @@ compute_branch_probabilities (void)
free_aux_for_blocks ();
}
+/* Load value histograms for N_VALUES values whose description is stored
+ in VALUES array from .da file. */
+static void
+compute_value_histograms (unsigned n_values, struct histogram_value *values)
+{
+ unsigned i, j, t, any;
+ unsigned n_histogram_counters[GCOV_N_VALUE_COUNTERS];
+ gcov_type *histogram_counts[GCOV_N_VALUE_COUNTERS];
+ gcov_type *act_count[GCOV_N_VALUE_COUNTERS];
+ gcov_type *aact_count;
+
+ for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
+ n_histogram_counters[t] = 0;
+
+ for (i = 0; i < n_values; i++)
+ n_histogram_counters[(int) (values[i].type)] += values[i].n_counters;
+
+ any = 0;
+ for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
+ {
+ if (!n_histogram_counters[t])
+ {
+ histogram_counts[t] = NULL;
+ continue;
+ }
+
+ histogram_counts[t] =
+ get_coverage_counts (COUNTER_FOR_HIST_TYPE (t),
+ n_histogram_counters[t], NULL);
+ if (histogram_counts[t])
+ any = 1;
+ act_count[t] = histogram_counts[t];
+ }
+ if (!any)
+ return;
+
+ for (i = 0; i < n_values; i++)
+ {
+ rtx hist_list = NULL_RTX;
+ t = (int) (values[i].type);
+
+ aact_count = act_count[t];
+ act_count[t] += values[i].n_counters;
+ for (j = values[i].n_counters; j > 0; j--)
+ hist_list = alloc_EXPR_LIST (0, GEN_INT (aact_count[j - 1]), hist_list);
+ hist_list = alloc_EXPR_LIST (0, copy_rtx (values[i].value), hist_list);
+ hist_list = alloc_EXPR_LIST (0, GEN_INT (values[i].type), hist_list);
+ REG_NOTES (values[i].insn) =
+ alloc_EXPR_LIST (REG_VALUE_PROFILE, hist_list,
+ REG_NOTES (values[i].insn));
+ }
+
+ for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
+ if (histogram_counts[t])
+ free (histogram_counts[t]);
+}
+
/* Instrument and/or analyze program behavior based on program flow graph.
In either case, this function builds a flow graph for the function being
compiled. The flow graph is stored in BB_GRAPH.
@@ -886,7 +944,11 @@ branch_prob (void)
}
if (flag_branch_probabilities)
- compute_branch_probabilities ();
+ {
+ compute_branch_probabilities ();
+ if (flag_profile_values)
+ compute_value_histograms (n_values, values);
+ }
/* For each edge not on the spanning tree, add counting code as rtl. */
if (profile_arc_flag
diff --git a/gcc/protoize.c b/gcc/protoize.c
index 2f86de7106c..0dd91e24219 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -71,44 +71,43 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define CPLUS_FILE_SUFFIX "C"
#endif
-static void usage PARAMS ((void)) ATTRIBUTE_NORETURN;
-static void aux_info_corrupted PARAMS ((void)) ATTRIBUTE_NORETURN;
-static void declare_source_confusing PARAMS ((const char *)) ATTRIBUTE_NORETURN;
-static const char *shortpath PARAMS ((const char *, const char *));
-extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
-static void notice PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
-static char *savestring PARAMS ((const char *, unsigned int));
-static char *dupnstr PARAMS ((const char *, size_t));
-static const char *substr PARAMS ((const char *, const char * const));
-static int safe_read PARAMS ((int, void *, int));
-static void safe_write PARAMS ((int, void *, int, const char *));
-static void save_pointers PARAMS ((void));
-static void restore_pointers PARAMS ((void));
-static int is_id_char PARAMS ((int));
-static int in_system_include_dir PARAMS ((const char *));
-static int directory_specified_p PARAMS ((const char *));
-static int file_excluded_p PARAMS ((const char *));
-static char *unexpand_if_needed PARAMS ((const char *));
-static char *abspath PARAMS ((const char *, const char *));
-static void check_aux_info PARAMS ((int));
-static const char *find_corresponding_lparen PARAMS ((const char *));
-static int referenced_file_is_newer PARAMS ((const char *, time_t));
-static void save_def_or_dec PARAMS ((const char *, int));
-static void munge_compile_params PARAMS ((const char *));
-static int gen_aux_info_file PARAMS ((const char *));
-static void process_aux_info_file PARAMS ((const char *, int, int));
-static int identify_lineno PARAMS ((const char *));
-static void check_source PARAMS ((int, const char *));
-static const char *seek_to_line PARAMS ((int));
-static const char *forward_to_next_token_char PARAMS ((const char *));
-static void output_bytes PARAMS ((const char *, size_t));
-static void output_string PARAMS ((const char *));
-static void output_up_to PARAMS ((const char *));
-static int other_variable_style_function PARAMS ((const char *));
-static const char *find_rightmost_formals_list PARAMS ((const char *));
-static void do_cleaning PARAMS ((char *, const char *));
-static const char *careful_find_l_paren PARAMS ((const char *));
-static void do_processing PARAMS ((void));
+static void usage (void) ATTRIBUTE_NORETURN;
+static void aux_info_corrupted (void) ATTRIBUTE_NORETURN;
+static void declare_source_confusing (const char *) ATTRIBUTE_NORETURN;
+static const char *shortpath (const char *, const char *);
+extern void fancy_abort (void) ATTRIBUTE_NORETURN;
+static void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
+static char *savestring (const char *, unsigned int);
+static char *dupnstr (const char *, size_t);
+static int safe_read (int, void *, int);
+static void safe_write (int, void *, int, const char *);
+static void save_pointers (void);
+static void restore_pointers (void);
+static int is_id_char (int);
+static int in_system_include_dir (const char *);
+static int directory_specified_p (const char *);
+static int file_excluded_p (const char *);
+static char *unexpand_if_needed (const char *);
+static char *abspath (const char *, const char *);
+static void check_aux_info (int);
+static const char *find_corresponding_lparen (const char *);
+static int referenced_file_is_newer (const char *, time_t);
+static void save_def_or_dec (const char *, int);
+static void munge_compile_params (const char *);
+static int gen_aux_info_file (const char *);
+static void process_aux_info_file (const char *, int, int);
+static int identify_lineno (const char *);
+static void check_source (int, const char *);
+static const char *seek_to_line (int);
+static const char *forward_to_next_token_char (const char *);
+static void output_bytes (const char *, size_t);
+static void output_string (const char *);
+static void output_up_to (const char *);
+static int other_variable_style_function (const char *);
+static const char *find_rightmost_formals_list (const char *);
+static void do_cleaning (char *, const char *);
+static const char *careful_find_l_paren (const char *);
+static void do_processing (void);
/* Look for these where the `const' qualifier is intentionally cast aside. */
#define NONCONST
@@ -196,8 +195,8 @@ struct string_list
struct string_list *next;
};
-static struct string_list *string_list_cons PARAMS ((const char *,
- struct string_list *));
+static struct string_list *string_list_cons (const char *,
+ struct string_list *);
/* List of directories in which files should be converted. */
@@ -242,29 +241,29 @@ typedef struct file_info_struct file_info;
typedef struct f_list_chain_item_struct f_list_chain_item;
#ifndef UNPROTOIZE
-static int is_syscalls_file PARAMS ((const file_info *));
-static void rename_c_file PARAMS ((const hash_table_entry *));
-static const def_dec_info *find_extern_def PARAMS ((const def_dec_info *,
- const def_dec_info *));
-static const def_dec_info *find_static_definition PARAMS ((const def_dec_info *));
-static void connect_defs_and_decs PARAMS ((const hash_table_entry *));
-static void add_local_decl PARAMS ((const def_dec_info *, const char *));
-static void add_global_decls PARAMS ((const file_info *, const char *));
+static int is_syscalls_file (const file_info *);
+static void rename_c_file (const hash_table_entry *);
+static const def_dec_info *find_extern_def (const def_dec_info *,
+ const def_dec_info *);
+static const def_dec_info *find_static_definition (const def_dec_info *);
+static void connect_defs_and_decs (const hash_table_entry *);
+static void add_local_decl (const def_dec_info *, const char *);
+static void add_global_decls (const file_info *, const char *);
#endif /* ! UNPROTOIZE */
-static int needs_to_be_converted PARAMS ((const file_info *));
-static void visit_each_hash_node PARAMS ((const hash_table_entry *,
- void (*)(const hash_table_entry *)));
-static hash_table_entry *add_symbol PARAMS ((hash_table_entry *, const char *));
-static hash_table_entry *lookup PARAMS ((hash_table_entry *, const char *));
-static void free_def_dec PARAMS ((def_dec_info *));
-static file_info *find_file PARAMS ((const char *, int));
-static void reverse_def_dec_list PARAMS ((const hash_table_entry *));
-static void edit_fn_declaration PARAMS ((const def_dec_info *, const char *));
-static int edit_formals_lists PARAMS ((const char *, unsigned int,
- const def_dec_info *));
-static void edit_fn_definition PARAMS ((const def_dec_info *, const char *));
-static void scan_for_missed_items PARAMS ((const file_info *));
-static void edit_file PARAMS ((const hash_table_entry *));
+static int needs_to_be_converted (const file_info *);
+static void visit_each_hash_node (const hash_table_entry *,
+ void (*)(const hash_table_entry *));
+static hash_table_entry *add_symbol (hash_table_entry *, const char *);
+static hash_table_entry *lookup (hash_table_entry *, const char *);
+static void free_def_dec (def_dec_info *);
+static file_info *find_file (const char *, int);
+static void reverse_def_dec_list (const hash_table_entry *);
+static void edit_fn_declaration (const def_dec_info *, const char *);
+static int edit_formals_lists (const char *, unsigned int,
+ const def_dec_info *);
+static void edit_fn_definition (const def_dec_info *, const char *);
+static void scan_for_missed_items (const file_info *);
+static void edit_file (const hash_table_entry *);
/* In the struct below, note that the "_info" field has two different uses
depending on the type of hash table we are in (i.e. either the filenames
@@ -519,11 +518,9 @@ notice (const char *msgid, ...)
/* Make a copy of a string INPUT with size SIZE. */
static char *
-savestring (input, size)
- const char *input;
- unsigned int size;
+savestring (const char *input, unsigned int size)
{
- char *output = (char *) xmalloc (size + 1);
+ char *output = xmalloc (size + 1);
strcpy (output, input);
return output;
}
@@ -532,7 +529,7 @@ savestring (input, size)
config.h can #define abort fancy_abort if you like that sort of thing. */
void
-fancy_abort ()
+fancy_abort (void)
{
notice ("%s: internal abort\n", pname);
exit (FATAL_EXIT_CODE);
@@ -542,49 +539,20 @@ fancy_abort ()
allocated area. */
static char *
-dupnstr (s, n)
- const char *s;
- size_t n;
+dupnstr (const char *s, size_t n)
{
- char *ret_val = (char *) xmalloc (n + 1);
+ char *ret_val = xmalloc (n + 1);
strncpy (ret_val, s, n);
ret_val[n] = '\0';
return ret_val;
}
-
-/* Return a pointer to the first occurrence of s2 within s1 or NULL if s2
- does not occur within s1. Assume neither s1 nor s2 are null pointers. */
-
-static const char *
-substr (s1, s2)
- const char *s1;
- const char *const s2;
-{
- for (; *s1 ; s1++)
- {
- const char *p1;
- const char *p2;
- int c;
-
- for (p1 = s1, p2 = s2; (c = *p2); p1++, p2++)
- if (*p1 != c)
- goto outer;
- return s1;
-outer:
- ;
- }
- return 0;
-}
/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME,
retrying if necessary. Return the actual number of bytes read. */
static int
-safe_read (desc, ptr, len)
- int desc;
- void *ptr;
- int len;
+safe_read (int desc, void *ptr, int len)
{
int left = len;
while (left > 0) {
@@ -610,11 +578,7 @@ safe_read (desc, ptr, len)
retrying if necessary, and treating any real error as fatal. */
static void
-safe_write (desc, ptr, len, out_fname)
- int desc;
- void *ptr;
- int len;
- const char *out_fname;
+safe_write (int desc, void *ptr, int len, const char *out_fname)
{
while (len > 0) {
int written = write (desc, ptr, len);
@@ -638,7 +602,7 @@ safe_write (desc, ptr, len, out_fname)
/* Get setup to recover in case the edit we are about to do goes awry. */
static void
-save_pointers ()
+save_pointers (void)
{
saved_clean_read_ptr = clean_read_ptr;
saved_repl_write_ptr = repl_write_ptr;
@@ -648,7 +612,7 @@ save_pointers ()
too confusing in the source code we are trying to edit. */
static void
-restore_pointers ()
+restore_pointers (void)
{
clean_read_ptr = saved_clean_read_ptr;
repl_write_ptr = saved_repl_write_ptr;
@@ -657,8 +621,7 @@ restore_pointers ()
/* Return true if the given character is a valid identifier character. */
static int
-is_id_char (ch)
- int ch;
+is_id_char (int ch)
{
return (ISIDNUM (ch) || (ch == '$'));
}
@@ -667,7 +630,7 @@ is_id_char (ch)
exit with nonzero status. */
static void
-usage ()
+usage (void)
{
#ifdef UNPROTOIZE
notice ("%s: usage '%s [ -VqfnkN ] [ -i <istring> ] [ filename ... ]'\n",
@@ -684,8 +647,7 @@ usage ()
include directories. */
static int
-in_system_include_dir (path)
- const char *path;
+in_system_include_dir (const char *path)
{
const struct default_include *p;
@@ -707,7 +669,7 @@ in_system_include_dir (path)
static int
file_could_be_converted (const char *path)
{
- char *const dir_name = (char *) alloca (strlen (path) + 1);
+ char *const dir_name = alloca (strlen (path) + 1);
if (access (path, R_OK))
return 0;
@@ -811,8 +773,7 @@ file_normally_convertible (const char *path)
file. Return false otherwise. */
static int
-is_syscalls_file (fi_p)
- const file_info *fi_p;
+is_syscalls_file (const file_info *fi_p)
{
char const *f = fi_p->hash_entry->symbol;
size_t fl = strlen (f), sysl = sizeof (syscalls_filename) - 1;
@@ -831,8 +792,7 @@ is_syscalls_file (fi_p)
by connect_defs_and_decs. */
static int
-needs_to_be_converted (file_p)
- const file_info *file_p;
+needs_to_be_converted (const file_info *file_p)
{
const def_dec_info *ddp;
@@ -870,8 +830,7 @@ needs_to_be_converted (file_p)
that should be converted. */
static int
-directory_specified_p (name)
- const char *name;
+directory_specified_p (const char *name)
{
struct string_list *p;
@@ -897,8 +856,7 @@ directory_specified_p (name)
/* Return 1 if the file named NAME should be excluded from conversion. */
static int
-file_excluded_p (name)
- const char *name;
+file_excluded_p (const char *name)
{
struct string_list *p;
int len = strlen (name);
@@ -915,12 +873,9 @@ file_excluded_p (name)
STRING is the new element value, and REST holds the remaining elements. */
static struct string_list *
-string_list_cons (string, rest)
- const char *string;
- struct string_list *rest;
+string_list_cons (const char *string, struct string_list *rest)
{
- struct string_list *temp
- = (struct string_list *) xmalloc (sizeof (struct string_list));
+ struct string_list *temp = xmalloc (sizeof (struct string_list));
temp->next = rest;
temp->name = string;
@@ -937,9 +892,8 @@ string_list_cons (string, rest)
argument. */
static void
-visit_each_hash_node (hash_tab_p, func)
- const hash_table_entry *hash_tab_p;
- void (*func) PARAMS ((const hash_table_entry *));
+visit_each_hash_node (const hash_table_entry *hash_tab_p,
+ void (*func) (const hash_table_entry *))
{
const hash_table_entry *primary;
@@ -960,9 +914,7 @@ visit_each_hash_node (hash_tab_p, func)
called. */
static hash_table_entry *
-add_symbol (p, s)
- hash_table_entry *p;
- const char *s;
+add_symbol (hash_table_entry *p, const char *s)
{
p->hash_next = NULL;
p->symbol = xstrdup (s);
@@ -977,9 +929,7 @@ add_symbol (p, s)
hash table entry for the given name. */
static hash_table_entry *
-lookup (hash_tab_p, search_symbol)
- hash_table_entry *hash_tab_p;
- const char *search_symbol;
+lookup (hash_table_entry *hash_tab_p, const char *search_symbol)
{
int hash_value = 0;
const char *search_symbol_char_p = search_symbol;
@@ -999,7 +949,7 @@ lookup (hash_tab_p, search_symbol)
if (!strcmp (p->symbol, search_symbol))
return p;
}
- p->hash_next = (hash_table_entry *) xmalloc (sizeof (hash_table_entry));
+ p->hash_next = xmalloc (sizeof (hash_table_entry));
p = p->hash_next;
return add_symbol (p, search_symbol);
}
@@ -1010,8 +960,7 @@ lookup (hash_tab_p, search_symbol)
stuff it pointed to. */
static void
-free_def_dec (p)
- def_dec_info *p;
+free_def_dec (def_dec_info *p)
{
free ((NONCONST void *) p->ansi_decl);
@@ -1037,8 +986,7 @@ free_def_dec (p)
return a pointer to the unexpanded copy. Otherwise return NULL. */
static char *
-unexpand_if_needed (aux_info_line)
- const char *aux_info_line;
+unexpand_if_needed (const char *aux_info_line)
{
static char *line_buf = 0;
static int line_buf_size = 0;
@@ -1050,7 +998,7 @@ unexpand_if_needed (aux_info_line)
if (line_buf == 0)
{
line_buf_size = 1024;
- line_buf = (char *) xmalloc (line_buf_size);
+ line_buf = xmalloc (line_buf_size);
}
copy_p = line_buf;
@@ -1073,7 +1021,7 @@ unexpand_if_needed (aux_info_line)
int offset = copy_p - line_buf;
line_buf_size *= 2;
line_buf_size += size;
- line_buf = (char *) xrealloc (line_buf, line_buf_size);
+ line_buf = xrealloc (line_buf, line_buf_size);
copy_p = line_buf + offset;
}
strcpy (copy_p, unexp_p->contracted);
@@ -1090,7 +1038,7 @@ unexpand_if_needed (aux_info_line)
{
int offset = copy_p - line_buf;
line_buf_size *= 2;
- line_buf = (char *) xrealloc (line_buf, line_buf_size);
+ line_buf = xrealloc (line_buf, line_buf_size);
copy_p = line_buf + offset;
}
*copy_p++ = *s++;
@@ -1100,7 +1048,7 @@ continue_outer: ;
{
int offset = copy_p - line_buf;
line_buf_size *= 2;
- line_buf = (char *) xrealloc (line_buf, line_buf_size);
+ line_buf = xrealloc (line_buf, line_buf_size);
copy_p = line_buf + offset;
}
*copy_p++ = '\n';
@@ -1120,14 +1068,11 @@ continue_outer: ;
NULL. */
static char *
-abspath (cwd, rel_filename)
- const char *cwd;
- const char *rel_filename;
+abspath (const char *cwd, const char *rel_filename)
{
/* Setup the current working directory as needed. */
const char *const cwd2 = (cwd) ? cwd : cwd_buffer;
- char *const abs_buffer
- = (char *) alloca (strlen (cwd2) + strlen (rel_filename) + 2);
+ char *const abs_buffer = alloca (strlen (cwd2) + strlen (rel_filename) + 2);
char *endp = abs_buffer;
char *outp, *inp;
@@ -1239,9 +1184,7 @@ abspath (cwd, rel_filename)
subpart of the original filename is actually a symbolic link. */
static const char *
-shortpath (cwd, filename)
- const char *cwd;
- const char *filename;
+shortpath (const char *cwd, const char *filename)
{
char *rel_buffer;
char *rel_buf_p;
@@ -1251,7 +1194,7 @@ shortpath (cwd, filename)
size_t filename_len = strlen (filename);
path_p = abspath (cwd, filename);
- rel_buf_p = rel_buffer = (char *) xmalloc (filename_len);
+ rel_buf_p = rel_buffer = xmalloc (filename_len);
while (*cwd_p && IS_SAME_PATH_CHAR (*cwd_p, *path_p))
{
@@ -1328,9 +1271,7 @@ shortpath (cwd, filename)
That is probably a bug in AIX, but might as well avoid the warning. */
static file_info *
-find_file (filename, do_not_stat)
- const char *filename;
- int do_not_stat;
+find_file (const char *filename, int do_not_stat)
{
hash_table_entry *hash_entry_p;
@@ -1340,7 +1281,7 @@ find_file (filename, do_not_stat)
else
{
struct stat stat_buf;
- file_info *file_p = (file_info *) xmalloc (sizeof (file_info));
+ file_info *file_p = xmalloc (sizeof (file_info));
/* If we cannot get status on any given source file, give a warning
and then just set its time of last modification to infinity. */
@@ -1371,7 +1312,7 @@ find_file (filename, do_not_stat)
messed up. */
static void
-aux_info_corrupted ()
+aux_info_corrupted (void)
{
notice ("\n%s: fatal error: aux info file corrupted at line %d\n",
pname, current_aux_info_lineno);
@@ -1382,8 +1323,7 @@ aux_info_corrupted ()
/* Check to see that a condition is true. This is kind of like an assert. */
static void
-check_aux_info (cond)
- int cond;
+check_aux_info (int cond)
{
if (! cond)
aux_info_corrupted ();
@@ -1394,8 +1334,7 @@ check_aux_info (cond)
return a pointer to it. */
static const char *
-find_corresponding_lparen (p)
- const char *p;
+find_corresponding_lparen (const char *p)
{
const char *q;
int paren_depth;
@@ -1421,9 +1360,7 @@ find_corresponding_lparen (p)
file was created. If so, return nonzero, else return zero. */
static int
-referenced_file_is_newer (l, aux_info_mtime)
- const char *l;
- time_t aux_info_mtime;
+referenced_file_is_newer (const char *l, time_t aux_info_mtime)
{
const char *p;
file_info *fi_p;
@@ -1442,7 +1379,7 @@ referenced_file_is_newer (l, aux_info_mtime)
#endif
)
p++;
- filename = (char *) alloca ((size_t) (p - filename_start) + 1);
+ filename = alloca ((size_t) (p - filename_start) + 1);
strncpy (filename, filename_start, (size_t) (p - filename_start));
filename[p-filename_start] = '\0';
}
@@ -1473,13 +1410,11 @@ referenced_file_is_newer (l, aux_info_mtime)
pertaining to this particular function name. */
static void
-save_def_or_dec (l, is_syscalls)
- const char *l;
- int is_syscalls;
+save_def_or_dec (const char *l, int is_syscalls)
{
const char *p;
const char *semicolon_p;
- def_dec_info *def_dec_p = (def_dec_info *) xmalloc (sizeof (def_dec_info));
+ def_dec_info *def_dec_p = xmalloc (sizeof (def_dec_info));
#ifndef UNPROTOIZE
def_dec_p->written = 0;
@@ -1504,7 +1439,7 @@ save_def_or_dec (l, is_syscalls)
#endif
)
p++;
- filename = (char *) alloca ((size_t) (p - filename_start) + 1);
+ filename = alloca ((size_t) (p - filename_start) + 1);
strncpy (filename, filename_start, (size_t) (p - filename_start));
filename[p-filename_start] = '\0';
@@ -1634,8 +1569,7 @@ save_def_or_dec (l, is_syscalls)
const char *left_paren_p = find_corresponding_lparen (p);
#ifndef UNPROTOIZE
{
- f_list_chain_item *cip
- = (f_list_chain_item *) xmalloc (sizeof (f_list_chain_item));
+ f_list_chain_item *cip = xmalloc (sizeof (f_list_chain_item));
cip->formals_list
= dupnstr (left_paren_p + 1, (size_t) (p - (left_paren_p+1)));
@@ -1677,7 +1611,7 @@ save_def_or_dec (l, is_syscalls)
/* p now points to the leftmost character of the function name. */
{
- char *fn_string = (char *) alloca (past_fn - p + 1);
+ char *fn_string = alloca (past_fn - p + 1);
strncpy (fn_string, p, (size_t) (past_fn - p));
fn_string[past_fn-p] = '\0';
@@ -1868,13 +1802,12 @@ save_def_or_dec (l, is_syscalls)
and adding '-aux-info AUXFILE -S -o /dev/null INFILE' at the end. */
static void
-munge_compile_params (params_list)
- const char *params_list;
+munge_compile_params (const char *params_list)
{
/* Build up the contents in a temporary vector
that is so big that to has to be big enough. */
const char **temp_params
- = (const char **) alloca ((strlen (params_list) + 8) * sizeof (char *));
+ = alloca ((strlen (params_list) + 8) * sizeof (char *));
int param_count = 0;
const char *param;
struct stat st;
@@ -1943,8 +1876,7 @@ munge_compile_params (params_list)
/* Make a copy of the compile_params in heap space. */
- compile_params
- = (const char **) xmalloc (sizeof (char *) * (param_count+1));
+ compile_params = xmalloc (sizeof (char *) * (param_count+1));
memcpy (compile_params, temp_params, sizeof (char *) * param_count);
}
@@ -1954,8 +1886,7 @@ munge_compile_params (params_list)
The result is a boolean indicating success. */
static int
-gen_aux_info_file (base_filename)
- const char *base_filename;
+gen_aux_info_file (const char *base_filename)
{
if (!input_file_name_index)
munge_compile_params ("");
@@ -2017,14 +1948,11 @@ gen_aux_info_file (base_filename)
Save all of the important stuff for later. */
static void
-process_aux_info_file (base_source_filename, keep_it, is_syscalls)
- const char *base_source_filename;
- int keep_it;
- int is_syscalls;
+process_aux_info_file (const char *base_source_filename, int keep_it,
+ int is_syscalls)
{
size_t base_len = strlen (base_source_filename);
- char * aux_info_filename
- = (char *) alloca (base_len + strlen (aux_info_suffix) + 1);
+ char * aux_info_filename = alloca (base_len + strlen (aux_info_suffix) + 1);
char *aux_info_base;
char *aux_info_limit;
char *aux_info_relocated_name;
@@ -2349,13 +2277,12 @@ start_over: ;
function implements the -C option. */
static void
-rename_c_file (hp)
- const hash_table_entry *hp;
+rename_c_file (const hash_table_entry *hp)
{
const char *filename = hp->symbol;
int last_char_index = strlen (filename) - 1;
- char *const new_filename = (char *) alloca (strlen (filename)
- + strlen (cplus_suffix) + 1);
+ char *const new_filename = alloca (strlen (filename)
+ + strlen (cplus_suffix) + 1);
/* Note that we don't care here if the given file was converted or not. It
is possible that the given file was *not* converted, simply because there
@@ -2392,8 +2319,7 @@ rename_c_file (hp)
order here. */
static void
-reverse_def_dec_list (hp)
- const hash_table_entry *hp;
+reverse_def_dec_list (const hash_table_entry *hp)
{
file_info *file_p = hp->fip;
def_dec_info *prev = NULL;
@@ -2434,9 +2360,7 @@ reverse_def_dec_list (hp)
contains all of the correct prototypes for system functions. */
static const def_dec_info *
-find_extern_def (head, user)
- const def_dec_info *head;
- const def_dec_info *user;
+find_extern_def (const def_dec_info *head, const def_dec_info *user)
{
const def_dec_info *dd_p;
const def_dec_info *extern_def_p = NULL;
@@ -2565,11 +2489,11 @@ find_extern_def (head, user)
{
/* Why copy this string into `needed' at all?
Why not just use user->ansi_decl without copying? */
- char *needed = (char *) alloca (strlen (user->ansi_decl) + 1);
+ char *needed = alloca (strlen (user->ansi_decl) + 1);
char *p;
strcpy (needed, user->ansi_decl);
- p = (NONCONST char *) substr (needed, user->hash_entry->symbol)
+ p = strstr (needed, user->hash_entry->symbol)
+ strlen (user->hash_entry->symbol) + 2;
/* Avoid having ??? in the string. */
*p++ = '?';
@@ -2597,8 +2521,7 @@ find_extern_def (head, user)
from the def_dec_info record pointer which is passed in. */
static const def_dec_info *
-find_static_definition (user)
- const def_dec_info *user;
+find_static_definition (const def_dec_info *user)
{
const def_dec_info *head = user->hash_entry->ddip;
const def_dec_info *dd_p;
@@ -2647,8 +2570,7 @@ find_static_definition (user)
more details. */
static void
-connect_defs_and_decs (hp)
- const hash_table_entry *hp;
+connect_defs_and_decs (const hash_table_entry *hp)
{
const def_dec_info *dd_p;
const def_dec_info *extern_def_p = NULL;
@@ -2772,8 +2694,7 @@ connect_defs_and_decs (hp)
original source line number that the given pointer points into. */
static int
-identify_lineno (clean_p)
- const char *clean_p;
+identify_lineno (const char *clean_p)
{
int line_num = 1;
const char *scan_p;
@@ -2787,8 +2708,7 @@ identify_lineno (clean_p)
/* Issue an error message and give up on doing this particular edit. */
static void
-declare_source_confusing (clean_p)
- const char *clean_p;
+declare_source_confusing (const char *clean_p)
{
if (!quiet_flag)
{
@@ -2808,9 +2728,7 @@ declare_source_confusing (clean_p)
converting this particular source file. */
static void
-check_source (cond, clean_p)
- int cond;
- const char *clean_p;
+check_source (int cond, const char *clean_p)
{
if (!cond)
declare_source_confusing (clean_p);
@@ -2832,8 +2750,7 @@ check_source (cond, clean_p)
of the in-core cleaned buffer again. */
static const char *
-seek_to_line (n)
- int n;
+seek_to_line (int n)
{
if (n < last_known_line_number)
abort ();
@@ -2852,8 +2769,7 @@ seek_to_line (n)
to the next non-whitespace character which follows it. */
static const char *
-forward_to_next_token_char (ptr)
- const char *ptr;
+forward_to_next_token_char (const char *ptr)
{
for (++ptr; ISSPACE ((const unsigned char)*ptr);
check_source (++ptr < clean_text_limit, 0))
@@ -2866,14 +2782,12 @@ forward_to_next_token_char (ptr)
buffer ultimately go through here. */
static void
-output_bytes (str, len)
- const char *str;
- size_t len;
+output_bytes (const char *str, size_t len)
{
if ((repl_write_ptr + 1) + len >= repl_text_limit)
{
size_t new_size = (repl_text_limit - repl_text_base) << 1;
- char *new_buf = (char *) xrealloc (repl_text_base, new_size);
+ char *new_buf = xrealloc (repl_text_base, new_size);
repl_write_ptr = new_buf + (repl_write_ptr - repl_text_base);
repl_text_base = new_buf;
@@ -2887,8 +2801,7 @@ output_bytes (str, len)
the current output buffer. */
static void
-output_string (str)
- const char *str;
+output_string (const char *str)
{
output_bytes (str, strlen (str));
}
@@ -2913,8 +2826,7 @@ output_string (str)
byte pointed to by the argument pointer `p'. */
static void
-output_up_to (p)
- const char *p;
+output_up_to (const char *p)
{
size_t copy_length = (size_t) (p - clean_read_ptr);
const char *copy_start = orig_text_base+(clean_read_ptr-clean_text_base)+1;
@@ -2933,15 +2845,14 @@ output_up_to (p)
otherwise. */
static int
-other_variable_style_function (ansi_header)
- const char *ansi_header;
+other_variable_style_function (const char *ansi_header)
{
#ifdef UNPROTOIZE
/* See if we have a stdarg function, or a function which has stdarg style
parameters or a stdarg style return type. */
- return substr (ansi_header, "...") != 0;
+ return strstr (ansi_header, "...") != 0;
#else /* !defined (UNPROTOIZE) */
@@ -2955,7 +2866,7 @@ other_variable_style_function (ansi_header)
{
const char *candidate;
- if ((candidate = substr (p, varargs_style_indicator)) == 0)
+ if ((candidate = strstr (p, varargs_style_indicator)) == 0)
return 0;
else
if (!is_id_char (candidate[-1]) && !is_id_char (candidate[len]))
@@ -2972,9 +2883,8 @@ other_variable_style_function (ansi_header)
below. */
static void
-edit_fn_declaration (def_dec_p, clean_text_p)
- const def_dec_info *def_dec_p;
- const char *volatile clean_text_p;
+edit_fn_declaration (const def_dec_info *def_dec_p,
+ const char *volatile clean_text_p)
{
const char *start_formals;
const char *end_formals;
@@ -3188,10 +3098,8 @@ edit_fn_declaration (def_dec_p, clean_text_p)
function doesn't match the one expected). */
static int
-edit_formals_lists (end_formals, f_list_count, def_dec_p)
- const char *end_formals;
- unsigned int f_list_count;
- const def_dec_info *def_dec_p;
+edit_formals_lists (const char *end_formals, unsigned int f_list_count,
+ const def_dec_info *def_dec_p)
{
const char *start_formals;
int depth;
@@ -3299,8 +3207,7 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p)
definition header. */
static const char *
-find_rightmost_formals_list (clean_text_p)
- const char *clean_text_p;
+find_rightmost_formals_list (const char *clean_text_p)
{
const char *end_formals;
@@ -3417,9 +3324,7 @@ find_rightmost_formals_list (clean_text_p)
parameter type checking. */
static void
-add_local_decl (def_dec_p, clean_text_p)
- const def_dec_info *def_dec_p;
- const char *clean_text_p;
+add_local_decl (const def_dec_info *def_dec_p, const char *clean_text_p)
{
const char *start_of_block;
const char *function_to_edit = def_dec_p->hash_entry->symbol;
@@ -3524,9 +3429,7 @@ add_local_decl (def_dec_p, clean_text_p)
and then insert the new explicit declaration at that point in the file. */
static void
-add_global_decls (file_p, clean_text_p)
- const file_info *file_p;
- const char *clean_text_p;
+add_global_decls (const file_info *file_p, const char *clean_text_p)
{
const def_dec_info *dd_p;
const char *scan_p;
@@ -3615,9 +3518,7 @@ add_global_decls (file_p, clean_text_p)
separate routine above. */
static void
-edit_fn_definition (def_dec_p, clean_text_p)
- const def_dec_info *def_dec_p;
- const char *clean_text_p;
+edit_fn_definition (const def_dec_info *def_dec_p, const char *clean_text_p)
{
const char *end_formals;
const char *function_to_edit = def_dec_p->hash_entry->symbol;
@@ -3759,9 +3660,7 @@ edit_fn_definition (def_dec_p, clean_text_p)
into whitespace. Also, whiteout string and character literals. */
static void
-do_cleaning (new_clean_text_base, new_clean_text_limit)
- char *new_clean_text_base;
- const char *new_clean_text_limit;
+do_cleaning (char *new_clean_text_base, const char *new_clean_text_limit)
{
char *scan_p;
int non_whitespace_since_newline = 0;
@@ -3865,8 +3764,7 @@ regular:
and return a pointer to it. */
static const char *
-careful_find_l_paren (p)
- const char *p;
+careful_find_l_paren (const char *p)
{
const char *q;
int paren_depth;
@@ -3904,8 +3802,7 @@ careful_find_l_paren (p)
I will probably try to do this in a later version though. */
static void
-scan_for_missed_items (file_p)
- const file_info *file_p;
+scan_for_missed_items (const file_info *file_p)
{
static const char *scan_p;
const char *limit = clean_text_limit - 3;
@@ -3962,7 +3859,7 @@ scan_for_missed_items (file_p)
goto not_missed;
{
- char *func_name = (char *) alloca (id_length + 1);
+ char *func_name = alloca (id_length + 1);
static const char * const stmt_keywords[]
= { "if", "else", "do", "while", "for", "switch", "case", "return", 0 };
const char * const *stmt_keyword;
@@ -4020,8 +3917,7 @@ scan_for_missed_items (file_p)
preprocessing directives make the editing a whole lot easier. */
static void
-edit_file (hp)
- const hash_table_entry *hp;
+edit_file (const hash_table_entry *hp)
{
struct stat stat_buf;
const file_info *file_p = hp->fip;
@@ -4086,12 +3982,12 @@ edit_file (hp)
/* Allocate a buffer to hold the original text. */
- orig_text_base = new_orig_text_base = (char *) xmalloc (orig_size + 2);
+ orig_text_base = new_orig_text_base = xmalloc (orig_size + 2);
orig_text_limit = new_orig_text_limit = new_orig_text_base + orig_size;
/* Allocate a buffer to hold the cleaned-up version of the original text. */
- clean_text_base = new_clean_text_base = (char *) xmalloc (orig_size + 2);
+ clean_text_base = new_clean_text_base = xmalloc (orig_size + 2);
clean_text_limit = new_clean_text_limit = new_clean_text_base + orig_size;
clean_read_ptr = clean_text_base - 1;
@@ -4101,7 +3997,7 @@ edit_file (hp)
buffer can be expanded later as needed. */
repl_size = orig_size + (orig_size >> 2) + 4096;
- repl_text_base = (char *) xmalloc (repl_size + 2);
+ repl_text_base = xmalloc (repl_size + 2);
repl_text_limit = repl_text_base + repl_size - 1;
repl_write_ptr = repl_text_base - 1;
@@ -4159,7 +4055,7 @@ edit_file (hp)
{
int clean_file;
size_t clean_size = orig_text_limit - orig_text_base;
- char *const clean_filename = (char *) alloca (strlen (convert_filename) + 6 + 1);
+ char *const clean_filename = alloca (strlen (convert_filename) + 6 + 1);
/* Open (and create) the clean file. */
@@ -4259,7 +4155,7 @@ edit_file (hp)
if (!nosave_flag)
{
char *new_filename
- = (char *) xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2);
+ = xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2);
strcpy (new_filename, convert_filename);
#ifdef __MSDOS__
@@ -4360,7 +4256,7 @@ edit_file (hp)
in the command line. */
static void
-do_processing ()
+do_processing (void)
{
const char * const *base_pp;
const char * const * const end_pps
@@ -4386,8 +4282,8 @@ do_processing ()
if (nondefault_syscalls_dir)
{
syscalls_absolute_filename
- = (char *) xmalloc (strlen (nondefault_syscalls_dir) + 1
- + sizeof (syscalls_filename));
+ = xmalloc (strlen (nondefault_syscalls_dir) + 1
+ + sizeof (syscalls_filename));
strcpy (syscalls_absolute_filename, nondefault_syscalls_dir);
}
else
@@ -4398,10 +4294,10 @@ do_processing ()
default_syscalls_dir = standard_exec_prefix;
}
syscalls_absolute_filename
- = (char *) xmalloc (strlen (default_syscalls_dir) + 0
- + strlen (target_machine) + 1
- + strlen (target_version) + 1
- + sizeof (syscalls_filename));
+ = xmalloc (strlen (default_syscalls_dir) + 0
+ + strlen (target_machine) + 1
+ + strlen (target_version) + 1
+ + sizeof (syscalls_filename));
strcpy (syscalls_absolute_filename, default_syscalls_dir);
strcat (syscalls_absolute_filename, target_machine);
strcat (syscalls_absolute_filename, "/");
@@ -4485,12 +4381,10 @@ static const struct option longopts[] =
{0, 0, 0, 0}
};
-extern int main PARAMS ((int, char **const));
+extern int main (int, char **const);
int
-main (argc, argv)
- int argc;
- char **const argv;
+main (int argc, char **const argv)
{
int longind;
int c;
@@ -4606,7 +4500,7 @@ main (argc, argv)
/* Now actually make a list of the base source filenames. */
base_source_filenames
- = (const char **) xmalloc ((n_base_source_files + 1) * sizeof (char *));
+ = xmalloc ((n_base_source_files + 1) * sizeof (char *));
n_base_source_files = 0;
for (; optind < argc; optind++)
{
diff --git a/gcc/ra-build.c b/gcc/ra-build.c
index e6f846aea59..896570ebf91 100644
--- a/gcc/ra-build.c
+++ b/gcc/ra-build.c
@@ -68,60 +68,59 @@
struct curr_use;
-static unsigned HOST_WIDE_INT rtx_to_undefined PARAMS ((rtx));
-static bitmap find_sub_conflicts PARAMS ((struct web_part *, unsigned int));
-static bitmap get_sub_conflicts PARAMS ((struct web_part *, unsigned int));
-static unsigned int undef_to_size_word PARAMS ((rtx, unsigned HOST_WIDE_INT *));
-static bitmap undef_to_bitmap PARAMS ((struct web_part *,
- unsigned HOST_WIDE_INT *));
-static struct web_part * find_web_part_1 PARAMS ((struct web_part *));
+static unsigned HOST_WIDE_INT rtx_to_undefined (rtx);
+static bitmap find_sub_conflicts (struct web_part *, unsigned int);
+static bitmap get_sub_conflicts (struct web_part *, unsigned int);
+static unsigned int undef_to_size_word (rtx, unsigned HOST_WIDE_INT *);
+static bitmap undef_to_bitmap (struct web_part *,
+ unsigned HOST_WIDE_INT *);
+static struct web_part * find_web_part_1 (struct web_part *);
static struct web_part * union_web_part_roots
- PARAMS ((struct web_part *, struct web_part *));
-static int defuse_overlap_p_1 PARAMS ((rtx, struct curr_use *));
-static int live_out_1 PARAMS ((struct df *, struct curr_use *, rtx));
-static int live_out PARAMS ((struct df *, struct curr_use *, rtx));
-static rtx live_in_edge PARAMS (( struct df *, struct curr_use *, edge));
-static void live_in PARAMS ((struct df *, struct curr_use *, rtx));
-static int copy_insn_p PARAMS ((rtx, rtx *, rtx *));
-static void remember_move PARAMS ((rtx));
-static void handle_asm_insn PARAMS ((struct df *, rtx));
-static void prune_hardregs_for_mode PARAMS ((HARD_REG_SET *,
- enum machine_mode));
-static void init_one_web_common PARAMS ((struct web *, rtx));
-static void init_one_web PARAMS ((struct web *, rtx));
-static void reinit_one_web PARAMS ((struct web *, rtx));
-static struct web * add_subweb PARAMS ((struct web *, rtx));
-static struct web * add_subweb_2 PARAMS ((struct web *, unsigned int));
-static void init_web_parts PARAMS ((struct df *));
-static void copy_conflict_list PARAMS ((struct web *));
-static void add_conflict_edge PARAMS ((struct web *, struct web *));
-static void build_inverse_webs PARAMS ((struct web *));
-static void copy_web PARAMS ((struct web *, struct web_link **));
-static void compare_and_free_webs PARAMS ((struct web_link **));
-static void init_webs_defs_uses PARAMS ((void));
-static unsigned int parts_to_webs_1 PARAMS ((struct df *, struct web_link **,
- struct df_link *));
-static void parts_to_webs PARAMS ((struct df *));
-static void reset_conflicts PARAMS ((void));
+ (struct web_part *, struct web_part *);
+static int defuse_overlap_p_1 (rtx, struct curr_use *);
+static int live_out_1 (struct df *, struct curr_use *, rtx);
+static int live_out (struct df *, struct curr_use *, rtx);
+static rtx live_in_edge ( struct df *, struct curr_use *, edge);
+static void live_in (struct df *, struct curr_use *, rtx);
+static int copy_insn_p (rtx, rtx *, rtx *);
+static void remember_move (rtx);
+static void handle_asm_insn (struct df *, rtx);
+static void prune_hardregs_for_mode (HARD_REG_SET *, enum machine_mode);
+static void init_one_web_common (struct web *, rtx);
+static void init_one_web (struct web *, rtx);
+static void reinit_one_web (struct web *, rtx);
+static struct web * add_subweb (struct web *, rtx);
+static struct web * add_subweb_2 (struct web *, unsigned int);
+static void init_web_parts (struct df *);
+static void copy_conflict_list (struct web *);
+static void add_conflict_edge (struct web *, struct web *);
+static void build_inverse_webs (struct web *);
+static void copy_web (struct web *, struct web_link **);
+static void compare_and_free_webs (struct web_link **);
+static void init_webs_defs_uses (void);
+static unsigned int parts_to_webs_1 (struct df *, struct web_link **,
+ struct df_link *);
+static void parts_to_webs (struct df *);
+static void reset_conflicts (void);
#if 0
-static void check_conflict_numbers PARAMS ((void));
+static void check_conflict_numbers (void)
#endif
-static void conflicts_between_webs PARAMS ((struct df *));
-static void remember_web_was_spilled PARAMS ((struct web *));
-static void detect_spill_temps PARAMS ((void));
-static int contains_pseudo PARAMS ((rtx));
-static int want_to_remat PARAMS ((rtx x));
-static void detect_remat_webs PARAMS ((void));
-static void determine_web_costs PARAMS ((void));
-static void detect_webs_set_in_cond_jump PARAMS ((void));
-static void make_webs PARAMS ((struct df *));
-static void moves_to_webs PARAMS ((struct df *));
-static void connect_rmw_web_parts PARAMS ((struct df *));
-static void update_regnos_mentioned PARAMS ((void));
-static void livethrough_conflicts_bb PARAMS ((basic_block));
-static void init_bb_info PARAMS ((void));
-static void free_bb_info PARAMS ((void));
-static void build_web_parts_and_conflicts PARAMS ((struct df *));
+static void conflicts_between_webs (struct df *);
+static void remember_web_was_spilled (struct web *);
+static void detect_spill_temps (void);
+static int contains_pseudo (rtx);
+static int want_to_remat (rtx x);
+static void detect_remat_webs (void);
+static void determine_web_costs (void);
+static void detect_webs_set_in_cond_jump (void);
+static void make_webs (struct df *);
+static void moves_to_webs (struct df *);
+static void connect_rmw_web_parts (struct df *);
+static void update_regnos_mentioned (void);
+static void livethrough_conflicts_bb (basic_block);
+static void init_bb_info (void);
+static void free_bb_info (void);
+static void build_web_parts_and_conflicts (struct df *);
/* A sbitmap of DF_REF_IDs of uses, which are live over an abnormal
@@ -181,8 +180,7 @@ struct ra_bb_info
as an integer. */
unsigned int
-rtx_to_bits (x)
- rtx x;
+rtx_to_bits (rtx x)
{
unsigned int len, beg;
len = GET_MODE_SIZE (GET_MODE (x));
@@ -193,8 +191,7 @@ rtx_to_bits (x)
/* X is a REG or SUBREG rtx. Return the bytes it touches as a bitmask. */
static unsigned HOST_WIDE_INT
-rtx_to_undefined (x)
- rtx x;
+rtx_to_undefined (rtx x)
{
unsigned int len, beg;
unsigned HOST_WIDE_INT ret;
@@ -225,10 +222,7 @@ int *number_seen;
not NULL. */
static int
-copy_insn_p (insn, source, target)
- rtx insn;
- rtx *source;
- rtx *target;
+copy_insn_p (rtx insn, rtx *source, rtx *target)
{
rtx d, s;
unsigned int d_regno, s_regno;
@@ -308,9 +302,7 @@ copy_insn_p (insn, source, target)
exist yet in WP. */
static bitmap
-find_sub_conflicts (wp, size_word)
- struct web_part *wp;
- unsigned int size_word;
+find_sub_conflicts (struct web_part *wp, unsigned int size_word)
{
struct tagged_conflict *cl;
cl = wp->sub_conflicts;
@@ -324,15 +316,12 @@ find_sub_conflicts (wp, size_word)
doesn't exist. I.e. this never returns NULL. */
static bitmap
-get_sub_conflicts (wp, size_word)
- struct web_part *wp;
- unsigned int size_word;
+get_sub_conflicts (struct web_part *wp, unsigned int size_word)
{
bitmap b = find_sub_conflicts (wp, size_word);
if (!b)
{
- struct tagged_conflict *cl =
- (struct tagged_conflict *) ra_alloc (sizeof *cl);
+ struct tagged_conflict *cl = ra_alloc (sizeof *cl);
cl->conflicts = BITMAP_XMALLOC ();
cl->size_word = size_word;
cl->next = wp->sub_conflicts;
@@ -383,9 +372,7 @@ static struct undef_table_s {
*/
static unsigned int
-undef_to_size_word (reg, undefined)
- rtx reg;
- unsigned HOST_WIDE_INT *undefined;
+undef_to_size_word (rtx reg, unsigned HOST_WIDE_INT *undefined)
{
/* When only the lower four bits are possibly set, we use
a fast lookup table. */
@@ -441,9 +428,7 @@ undef_to_size_word (reg, undefined)
covered by the part for that bitmap. */
static bitmap
-undef_to_bitmap (wp, undefined)
- struct web_part *wp;
- unsigned HOST_WIDE_INT *undefined;
+undef_to_bitmap (struct web_part *wp, unsigned HOST_WIDE_INT *undefined)
{
unsigned int size_word = undef_to_size_word (DF_REF_REAL_REG (wp->ref),
undefined);
@@ -454,8 +439,7 @@ undef_to_bitmap (wp, undefined)
it compresses the path. P may not be NULL. */
static struct web_part *
-find_web_part_1 (p)
- struct web_part *p;
+find_web_part_1 (struct web_part *p)
{
struct web_part *r = p;
struct web_part *p_next;
@@ -481,8 +465,7 @@ find_web_part_1 (p)
The root of the resulting (possibly larger) web part is returned. */
static struct web_part *
-union_web_part_roots (r1, r2)
- struct web_part *r1, *r2;
+union_web_part_roots (struct web_part *r1, struct web_part *r2)
{
if (r1 != r2)
{
@@ -553,8 +536,7 @@ union_web_part_roots (r1, r2)
/* Remember that we've handled a given move, so we don't reprocess it. */
static void
-remember_move (insn)
- rtx insn;
+remember_move (rtx insn)
{
if (!TEST_BIT (move_handled, INSN_UID (insn)))
{
@@ -583,10 +565,10 @@ remember_move (insn)
subwebs could be source and target of coalescing). */
if (GET_CODE (s) == REG && GET_CODE (d) == REG)
{
- struct move *m = (struct move *) ra_calloc (sizeof (struct move));
+ struct move *m = ra_calloc (sizeof (struct move));
struct move_list *ml;
m->insn = insn;
- ml = (struct move_list *) ra_alloc (sizeof (struct move_list));
+ ml = ra_alloc (sizeof (struct move_list));
ml->move = m;
ml->next = wl_moves;
wl_moves = ml;
@@ -630,9 +612,7 @@ struct curr_use {
otherwise a test is needed to track the already defined bytes. */
static int
-defuse_overlap_p_1 (def, use)
- rtx def;
- struct curr_use *use;
+defuse_overlap_p_1 (rtx def, struct curr_use *use)
{
int mode = 0;
if (def == use->x)
@@ -709,10 +689,7 @@ defuse_overlap_p_1 (def, use)
this insn. */
static int
-live_out_1 (df, use, insn)
- struct df *df ATTRIBUTE_UNUSED;
- struct curr_use *use;
- rtx insn;
+live_out_1 (struct df *df ATTRIBUTE_UNUSED, struct curr_use *use, rtx insn)
{
int defined = 0;
int uid = INSN_UID (insn);
@@ -864,10 +841,7 @@ live_out_1 (df, use, insn)
this insn). */
static inline int
-live_out (df, use, insn)
- struct df *df;
- struct curr_use *use;
- rtx insn;
+live_out (struct df *df, struct curr_use *use, rtx insn)
{
unsigned int uid = INSN_UID (insn);
if (visit_trace[uid].wp
@@ -895,10 +869,7 @@ live_out (df, use, insn)
which uses are live at the end of that basic block. */
static rtx
-live_in_edge (df, use, e)
- struct df *df;
- struct curr_use *use;
- edge e;
+live_in_edge (struct df *df, struct curr_use *use, edge e)
{
struct ra_bb_info *info_pred;
rtx next_insn;
@@ -944,10 +915,7 @@ live_in_edge (df, use, e)
def-use chains, and all defs during that chain are noted. */
static void
-live_in (df, use, insn)
- struct df *df;
- struct curr_use *use;
- rtx insn;
+live_in (struct df *df, struct curr_use *use, rtx insn)
{
unsigned int loc_vpass = visited_pass;
@@ -1007,7 +975,7 @@ live_in (df, use, insn)
pass. */
static void
-update_regnos_mentioned ()
+update_regnos_mentioned (void)
{
int last_uid = last_max_uid;
rtx insn;
@@ -1049,8 +1017,7 @@ update_regnos_mentioned ()
spanned_deaths members. */
static void
-livethrough_conflicts_bb (bb)
- basic_block bb;
+livethrough_conflicts_bb (basic_block bb)
{
struct ra_bb_info *info = (struct ra_bb_info *) bb->aux;
rtx insn;
@@ -1107,13 +1074,12 @@ livethrough_conflicts_bb (bb)
building live ranges. */
static void
-init_bb_info ()
+init_bb_info (void)
{
basic_block bb;
FOR_ALL_BB (bb)
{
- struct ra_bb_info *info =
- (struct ra_bb_info *) xcalloc (1, sizeof *info);
+ struct ra_bb_info *info = xcalloc (1, sizeof *info);
info->regnos_mentioned = BITMAP_XMALLOC ();
info->live_throughout = BITMAP_XMALLOC ();
info->old_aux = bb->aux;
@@ -1124,7 +1090,7 @@ init_bb_info ()
/* Free that per basic block info. */
static void
-free_bb_info ()
+free_bb_info (void)
{
basic_block bb;
FOR_ALL_BB (bb)
@@ -1142,16 +1108,14 @@ free_bb_info ()
their conflicts. */
static void
-build_web_parts_and_conflicts (df)
- struct df *df;
+build_web_parts_and_conflicts (struct df *df)
{
struct df_link *link;
struct curr_use use;
basic_block bb;
- number_seen = (int *) xcalloc (get_max_uid (), sizeof (int));
- visit_trace = (struct visit_trace *) xcalloc (get_max_uid (),
- sizeof (visit_trace[0]));
+ number_seen = xcalloc (get_max_uid (), sizeof (int));
+ visit_trace = xcalloc (get_max_uid (), sizeof (visit_trace[0]));
update_regnos_mentioned ();
/* Here's the main loop.
@@ -1201,8 +1165,7 @@ build_web_parts_and_conflicts (df)
read-mod-write instruction), so we must reconnect such webs. */
static void
-connect_rmw_web_parts (df)
- struct df *df;
+connect_rmw_web_parts (struct df *df)
{
unsigned int i;
@@ -1231,9 +1194,7 @@ connect_rmw_web_parts (df)
/* Deletes all hardregs from *S which are not allowed for MODE. */
static void
-prune_hardregs_for_mode (s, mode)
- HARD_REG_SET *s;
- enum machine_mode mode;
+prune_hardregs_for_mode (HARD_REG_SET *s, enum machine_mode mode)
{
AND_HARD_REG_SET (*s, hardregs_for_mode[(int) mode]);
}
@@ -1241,9 +1202,7 @@ prune_hardregs_for_mode (s, mode)
/* Initialize the members of a web, which are deducible from REG. */
static void
-init_one_web_common (web, reg)
- struct web *web;
- rtx reg;
+init_one_web_common (struct web *web, rtx reg)
{
if (GET_CODE (reg) != REG)
abort ();
@@ -1252,7 +1211,7 @@ init_one_web_common (web, reg)
web->orig_x = reg;
if (!web->dlink)
{
- web->dlink = (struct dlist *) ra_calloc (sizeof (struct dlist));
+ web->dlink = ra_calloc (sizeof (struct dlist));
DLIST_WEB (web->dlink) = web;
}
/* XXX
@@ -1320,9 +1279,7 @@ init_one_web_common (web, reg)
/* Initializes WEBs members from REG or zero them. */
static void
-init_one_web (web, reg)
- struct web *web;
- rtx reg;
+init_one_web (struct web *web, rtx reg)
{
memset (web, 0, sizeof (struct web));
init_one_web_common (web, reg);
@@ -1334,9 +1291,7 @@ init_one_web (web, reg)
members. */
static void
-reinit_one_web (web, reg)
- struct web *web;
- rtx reg;
+reinit_one_web (struct web *web, rtx reg)
{
web->old_color = web->color + 1;
init_one_web_common (web, reg);
@@ -1377,14 +1332,12 @@ reinit_one_web (web, reg)
becomes its super web). It must not exist already. */
static struct web *
-add_subweb (web, reg)
- struct web *web;
- rtx reg;
+add_subweb (struct web *web, rtx reg)
{
struct web *w;
if (GET_CODE (reg) != SUBREG)
abort ();
- w = (struct web *) xmalloc (sizeof (struct web));
+ w = xmalloc (sizeof (struct web));
/* Copy most content from parent-web. */
*w = *web;
/* And initialize the private stuff. */
@@ -1405,9 +1358,7 @@ add_subweb (web, reg)
In difference to add_subweb() this marks the new subweb as artificial. */
static struct web *
-add_subweb_2 (web, size_word)
- struct web *web;
- unsigned int size_word;
+add_subweb_2 (struct web *web, unsigned int size_word)
{
/* To get a correct mode for the to be produced subreg, we don't want to
simply do a mode_for_size() for the mode_class of the whole web.
@@ -1434,8 +1385,7 @@ add_subweb_2 (web, size_word)
/* Initialize all the web parts we are going to need. */
static void
-init_web_parts (df)
- struct df *df;
+init_web_parts (struct df *df)
{
int regno;
unsigned int no;
@@ -1509,8 +1459,7 @@ init_web_parts (df)
new conflicts, we copy it here to orig_conflict_list. */
static void
-copy_conflict_list (web)
- struct web *web;
+copy_conflict_list (struct web *web)
{
struct conflict_link *cl;
if (web->orig_conflict_list || web->have_orig_conflicts)
@@ -1519,7 +1468,7 @@ copy_conflict_list (web)
for (cl = web->conflict_list; cl; cl = cl->next)
{
struct conflict_link *ncl;
- ncl = (struct conflict_link *) ra_alloc (sizeof *ncl);
+ ncl = ra_alloc (sizeof *ncl);
ncl->t = cl->t;
ncl->sub = NULL;
ncl->next = web->orig_conflict_list;
@@ -1529,7 +1478,7 @@ copy_conflict_list (web)
struct sub_conflict *sl, *nsl;
for (sl = cl->sub; sl; sl = sl->next)
{
- nsl = (struct sub_conflict *) ra_alloc (sizeof *nsl);
+ nsl = ra_alloc (sizeof *nsl);
nsl->s = sl->s;
nsl->t = sl->t;
nsl->next = ncl->sub;
@@ -1549,8 +1498,7 @@ copy_conflict_list (web)
happen, if SUBREG webs are involved. */
static void
-add_conflict_edge (from, to)
- struct web *from, *to;
+add_conflict_edge (struct web *from, struct web *to)
{
if (from->type != PRECOLORED)
{
@@ -1571,7 +1519,7 @@ add_conflict_edge (from, to)
copy_conflict_list (pfrom);
if (!TEST_BIT (sup_igraph, (pfrom->id * num_webs + pto->id)))
{
- cl = (struct conflict_link *) ra_alloc (sizeof (*cl));
+ cl = ra_alloc (sizeof (*cl));
cl->t = pto;
cl->sub = NULL;
cl->next = pfrom->conflict_list;
@@ -1596,7 +1544,7 @@ add_conflict_edge (from, to)
means we are not interested in this subconflict. */
if (!may_delete || cl->sub != NULL)
{
- sl = (struct sub_conflict *) ra_alloc (sizeof (*sl));
+ sl = ra_alloc (sizeof (*sl));
sl->s = from;
sl->t = to;
sl->next = cl->sub;
@@ -1615,8 +1563,7 @@ add_conflict_edge (from, to)
already. */
void
-record_conflict (web1, web2)
- struct web *web1, *web2;
+record_conflict (struct web *web1, struct web *web2)
{
unsigned int id1 = web1->id, id2 = web2->id;
unsigned int index = igraph_index (id1, id2);
@@ -1668,8 +1615,7 @@ record_conflict (web1, web2)
possible to exactly specify (W-Wy) for all already existing subwebs Wy. */
static void
-build_inverse_webs (web)
- struct web *web;
+build_inverse_webs (struct web *web)
{
struct web *sweb = web->subreg_next;
unsigned HOST_WIDE_INT undef;
@@ -1694,12 +1640,10 @@ build_inverse_webs (web)
Used for consistency checking. */
static void
-copy_web (web, wl)
- struct web *web;
- struct web_link **wl;
+copy_web (struct web *web, struct web_link **wl)
{
- struct web *cweb = (struct web *) xmalloc (sizeof *cweb);
- struct web_link *link = (struct web_link *) ra_alloc (sizeof *link);
+ struct web *cweb = xmalloc (sizeof *cweb);
+ struct web_link *link = ra_alloc (sizeof *link);
link->next = *wl;
*wl = link;
link->web = cweb;
@@ -1710,8 +1654,7 @@ copy_web (web, wl)
with the global webs of the same ID. For consistency checking. */
static void
-compare_and_free_webs (link)
- struct web_link **link;
+compare_and_free_webs (struct web_link **link)
{
struct web_link *wl;
for (wl = *link; wl; wl = wl->next)
@@ -1760,7 +1703,7 @@ compare_and_free_webs (link)
/* Setup and fill uses[] and defs[] arrays of the webs. */
static void
-init_webs_defs_uses ()
+init_webs_defs_uses (void)
{
struct dlist *d;
for (d = WEBS(INITIAL); d; d = d->next)
@@ -1776,11 +1719,9 @@ init_webs_defs_uses ()
continue;
}
if (web->num_defs)
- web->defs = (struct ref **) xmalloc (web->num_defs *
- sizeof (web->defs[0]));
+ web->defs = xmalloc (web->num_defs * sizeof (web->defs[0]));
if (web->num_uses)
- web->uses = (struct ref **) xmalloc (web->num_uses *
- sizeof (web->uses[0]));
+ web->uses = xmalloc (web->num_uses * sizeof (web->uses[0]));
def_i = use_i = 0;
for (link = web->temp_refs; link; link = link->next)
{
@@ -1800,10 +1741,8 @@ init_webs_defs_uses ()
up use2web and def2web arrays. */
static unsigned int
-parts_to_webs_1 (df, copy_webs, all_refs)
- struct df *df;
- struct web_link **copy_webs;
- struct df_link *all_refs;
+parts_to_webs_1 (struct df *df, struct web_link **copy_webs,
+ struct df_link *all_refs)
{
unsigned int i;
unsigned int webnum;
@@ -1840,7 +1779,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
allocate a new one. */
if (ra_pass == 1)
{
- web = (struct web *) xmalloc (sizeof (struct web));
+ web = xmalloc (sizeof (struct web));
newid = last_num_webs++;
init_one_web (web, GET_CODE (reg) == SUBREG
? SUBREG_REG (reg) : reg);
@@ -1873,7 +1812,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
else
{
/* Else allocate a new one. */
- web = (struct web *) xmalloc (sizeof (struct web));
+ web = xmalloc (sizeof (struct web));
newid = last_num_webs++;
}
}
@@ -2021,8 +1960,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
other (i.e. without creating the conflict edges). */
static void
-parts_to_webs (df)
- struct df *df;
+parts_to_webs (struct df *df)
{
unsigned int i;
unsigned int webnum;
@@ -2032,8 +1970,7 @@ parts_to_webs (df)
num_subwebs = 0;
/* First build webs and ordinary subwebs. */
- all_refs = (struct df_link *) xcalloc (df->def_id + df->use_id,
- sizeof (all_refs[0]));
+ all_refs = xcalloc (df->def_id + df->use_id, sizeof (all_refs[0]));
webnum = parts_to_webs_1 (df, &copy_webs, all_refs);
/* Setup the webs for hardregs which are still missing (weren't
@@ -2041,7 +1978,7 @@ parts_to_webs (df)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (!hardreg2web[i])
{
- struct web *web = (struct web *) xmalloc (sizeof (struct web));
+ struct web *web = xmalloc (sizeof (struct web));
init_one_web (web, gen_rtx_REG (reg_raw_mode[i], i));
web->id = last_num_webs++;
hardreg2web[web->regno] = web;
@@ -2089,7 +2026,7 @@ parts_to_webs (df)
}
/* Now that everyone has an ID, we can setup the id2web array. */
- id2web = (struct web **) xcalloc (webnum, sizeof (id2web[0]));
+ id2web = xcalloc (webnum, sizeof (id2web[0]));
for (d = WEBS(INITIAL); d; d = d->next)
{
struct web *web = DLIST_WEB (d);
@@ -2121,7 +2058,7 @@ parts_to_webs (df)
conflicts. */
static void
-reset_conflicts ()
+reset_conflicts (void)
{
unsigned int i;
bitmap newwebs = BITMAP_XMALLOC ();
@@ -2203,7 +2140,7 @@ reset_conflicts ()
#if 0
static void
-check_conflict_numbers ()
+check_conflict_numbers (void)
{
unsigned int i;
for (i = 0; i < num_webs; i++)
@@ -2234,8 +2171,7 @@ check_conflict_numbers ()
in reality conflict get the same color. */
static void
-conflicts_between_webs (df)
- struct df *df;
+conflicts_between_webs (struct df *df)
{
unsigned int i;
#ifdef STACK_REGS
@@ -2243,7 +2179,7 @@ conflicts_between_webs (df)
#endif
bitmap ignore_defs = BITMAP_XMALLOC ();
unsigned int have_ignored;
- unsigned int *pass_cache = (unsigned int *) xcalloc (num_webs, sizeof (int));
+ unsigned int *pass_cache = xcalloc (num_webs, sizeof (int));
unsigned int pass = 0;
if (ra_pass > 1)
@@ -2333,8 +2269,7 @@ conflicts_between_webs (df)
accordingly. */
static void
-remember_web_was_spilled (web)
- struct web *web;
+remember_web_was_spilled (struct web *web)
{
int i;
unsigned int found_size = 0;
@@ -2414,7 +2349,7 @@ remember_web_was_spilled (web)
if it will be spillable in this pass. */
static void
-detect_spill_temps ()
+detect_spill_temps (void)
{
struct dlist *d;
bitmap already = BITMAP_XMALLOC ();
@@ -2435,7 +2370,7 @@ detect_spill_temps ()
continue;
/* A web with only defs and no uses can't be spilled. Nevertheless
- it must get a color, as it takes away an register from all webs
+ it must get a color, as it takes away a register from all webs
live at these defs. So we make it a short web. */
if (web->num_uses == 0)
web->spill_temp = 3;
@@ -2518,8 +2453,7 @@ detect_spill_temps ()
/* Returns nonzero if the rtx MEM refers somehow to a stack location. */
int
-memref_is_stack_slot (mem)
- rtx mem;
+memref_is_stack_slot (rtx mem)
{
rtx ad = XEXP (mem, 0);
rtx x;
@@ -2536,8 +2470,7 @@ memref_is_stack_slot (mem)
/* Returns nonzero, if rtx X somewhere contains any pseudo register. */
static int
-contains_pseudo (x)
- rtx x;
+contains_pseudo (rtx x)
{
const char *fmt;
int i;
@@ -2575,8 +2508,7 @@ contains_pseudo (x)
static GTY(()) rtx remat_test_insn;
static int
-want_to_remat (x)
- rtx x;
+want_to_remat (rtx x)
{
int num_clobbers = 0;
int icode;
@@ -2614,7 +2546,7 @@ want_to_remat (x)
and that value is simple enough, and want_to_remat() holds for it. */
static void
-detect_remat_webs ()
+detect_remat_webs (void)
{
struct dlist *d;
for (d = WEBS(INITIAL); d; d = d->next)
@@ -2681,7 +2613,7 @@ detect_remat_webs ()
/* Determine the spill costs of all webs. */
static void
-determine_web_costs ()
+determine_web_costs (void)
{
struct dlist *d;
for (d = WEBS(INITIAL); d; d = d->next)
@@ -2738,7 +2670,7 @@ determine_web_costs ()
which destroys the CFG. (Somewhen we want to deal with that XXX) */
static void
-detect_webs_set_in_cond_jump ()
+detect_webs_set_in_cond_jump (void)
{
basic_block bb;
FOR_EACH_BB (bb)
@@ -2761,8 +2693,7 @@ detect_webs_set_in_cond_jump ()
though. */
static void
-make_webs (df)
- struct df *df;
+make_webs (struct df *df)
{
/* First build all the webs itself. They are not related with
others yet. */
@@ -2780,8 +2711,7 @@ make_webs (df)
/* Distribute moves to the corresponding webs. */
static void
-moves_to_webs (df)
- struct df *df;
+moves_to_webs (struct df *df)
{
struct df_link *link;
struct move_list *ml;
@@ -2831,8 +2761,7 @@ moves_to_webs (df)
for (; test && test->move != m; test = test->next);
if (! test)
{
- newml = (struct move_list*)
- ra_alloc (sizeof (struct move_list));
+ newml = ra_alloc (sizeof (struct move_list));
newml->move = m;
newml->next = m->source_web->moves;
m->source_web->moves = newml;
@@ -2841,8 +2770,7 @@ moves_to_webs (df)
for (; test && test->move != m; test = test->next);
if (! test)
{
- newml = (struct move_list*)
- ra_alloc (sizeof (struct move_list));
+ newml = ra_alloc (sizeof (struct move_list));
newml->move = m;
newml->next = m->target_web->moves;
m->target_web->moves = newml;
@@ -2861,9 +2789,7 @@ moves_to_webs (df)
and constrain the allocator too much. */
static void
-handle_asm_insn (df, insn)
- struct df *df;
- rtx insn;
+handle_asm_insn (struct df *df, rtx insn)
{
const char *constraints[MAX_RECOG_OPERANDS];
enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
@@ -3035,8 +2961,7 @@ handle_asm_insn (df, insn)
and conflicts. */
void
-build_i_graph (df)
- struct df *df;
+build_i_graph (struct df *df)
{
rtx insn;
@@ -3069,8 +2994,7 @@ build_i_graph (df)
defs and uses. */
void
-ra_build_realloc (df)
- struct df *df;
+ra_build_realloc (struct df *df)
{
struct web_part *last_web_parts = web_parts;
struct web **last_def2web = def2web;
@@ -3079,10 +3003,8 @@ ra_build_realloc (df)
unsigned int i;
struct dlist *d;
move_handled = sbitmap_alloc (get_max_uid () );
- web_parts = (struct web_part *) xcalloc (df->def_id + df->use_id,
- sizeof web_parts[0]);
- def2web = (struct web **) xcalloc (df->def_id + df->use_id,
- sizeof def2web[0]);
+ web_parts = xcalloc (df->def_id + df->use_id, sizeof web_parts[0]);
+ def2web = xcalloc (df->def_id + df->use_id, sizeof def2web[0]);
use2web = &def2web[df->def_id];
live_over_abnormal = sbitmap_alloc (df->use_id);
sbitmap_zero (live_over_abnormal);
@@ -3172,14 +3094,12 @@ ra_build_realloc (df)
if (!last_max_uid)
{
/* Setup copy cache, for copy_insn_p (). */
- copy_cache = (struct copy_p_cache *)
- xcalloc (get_max_uid (), sizeof (copy_cache[0]));
+ copy_cache = xcalloc (get_max_uid (), sizeof (copy_cache[0]));
init_bb_info ();
}
else
{
- copy_cache = (struct copy_p_cache *)
- xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
+ copy_cache = xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
memset (&copy_cache[last_max_uid], 0,
(get_max_uid () - last_max_uid) * sizeof (copy_cache[0]));
}
@@ -3188,7 +3108,7 @@ ra_build_realloc (df)
/* Free up/clear some memory, only needed for one pass. */
void
-ra_build_free ()
+ra_build_free (void)
{
struct dlist *d;
unsigned int i;
@@ -3248,8 +3168,7 @@ ra_build_free ()
/* Free all memory for the interference graph structures. */
void
-ra_build_free_all (df)
- struct df *df;
+ra_build_free_all (struct df *df)
{
unsigned int i;
diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c
index 121cd1bbca1..f0d028118d7 100644
--- a/gcc/ra-colorize.c
+++ b/gcc/ra-colorize.c
@@ -47,54 +47,54 @@
Additionally there is a custom step to locally improve the overall
spill cost of the colored graph (recolor_spills). */
-static void push_list PARAMS ((struct dlist *, struct dlist **));
-static void push_list_end PARAMS ((struct dlist *, struct dlist **));
-static void free_dlist PARAMS ((struct dlist **));
-static void put_web_at_end PARAMS ((struct web *, enum node_type));
-static void put_move PARAMS ((struct move *, enum move_type));
-static void build_worklists PARAMS ((struct df *));
-static void enable_move PARAMS ((struct web *));
-static void decrement_degree PARAMS ((struct web *, int));
-static void simplify PARAMS ((void));
-static void remove_move_1 PARAMS ((struct web *, struct move *));
-static void remove_move PARAMS ((struct web *, struct move *));
-static void add_worklist PARAMS ((struct web *));
-static int ok PARAMS ((struct web *, struct web *));
-static int conservative PARAMS ((struct web *, struct web *));
-static inline unsigned int simplify_p PARAMS ((enum node_type));
-static void combine PARAMS ((struct web *, struct web *));
-static void coalesce PARAMS ((void));
-static void freeze_moves PARAMS ((struct web *));
-static void freeze PARAMS ((void));
-static void select_spill PARAMS ((void));
-static int color_usable_p PARAMS ((int, HARD_REG_SET, HARD_REG_SET,
- enum machine_mode));
-int get_free_reg PARAMS ((HARD_REG_SET, HARD_REG_SET, enum machine_mode));
-static int get_biased_reg PARAMS ((HARD_REG_SET, HARD_REG_SET, HARD_REG_SET,
- HARD_REG_SET, enum machine_mode));
-static int count_long_blocks PARAMS ((HARD_REG_SET, int));
-static char * hardregset_to_string PARAMS ((HARD_REG_SET));
-static void calculate_dont_begin PARAMS ((struct web *, HARD_REG_SET *));
-static void colorize_one_web PARAMS ((struct web *, int));
-static void assign_colors PARAMS ((void));
-static void try_recolor_web PARAMS ((struct web *));
-static void insert_coalesced_conflicts PARAMS ((void));
-static int comp_webs_maxcost PARAMS ((const void *, const void *));
-static void recolor_spills PARAMS ((void));
-static void check_colors PARAMS ((void));
-static void restore_conflicts_from_coalesce PARAMS ((struct web *));
-static void break_coalesced_spills PARAMS ((void));
-static void unalias_web PARAMS ((struct web *));
-static void break_aliases_to_web PARAMS ((struct web *));
-static void break_precolored_alias PARAMS ((struct web *));
-static void init_web_pairs PARAMS ((void));
-static void add_web_pair_cost PARAMS ((struct web *, struct web *,
- unsigned HOST_WIDE_INT, unsigned int));
-static int comp_web_pairs PARAMS ((const void *, const void *));
-static void sort_and_combine_web_pairs PARAMS ((int));
-static void aggressive_coalesce PARAMS ((void));
-static void extended_coalesce_2 PARAMS ((void));
-static void check_uncoalesced_moves PARAMS ((void));
+static void push_list (struct dlist *, struct dlist **);
+static void push_list_end (struct dlist *, struct dlist **);
+static void free_dlist (struct dlist **);
+static void put_web_at_end (struct web *, enum node_type);
+static void put_move (struct move *, enum move_type);
+static void build_worklists (struct df *);
+static void enable_move (struct web *);
+static void decrement_degree (struct web *, int);
+static void simplify (void);
+static void remove_move_1 (struct web *, struct move *);
+static void remove_move (struct web *, struct move *);
+static void add_worklist (struct web *);
+static int ok (struct web *, struct web *);
+static int conservative (struct web *, struct web *);
+static inline unsigned int simplify_p (enum node_type);
+static void combine (struct web *, struct web *);
+static void coalesce (void);
+static void freeze_moves (struct web *);
+static void freeze (void);
+static void select_spill (void);
+static int color_usable_p (int, HARD_REG_SET, HARD_REG_SET,
+ enum machine_mode);
+int get_free_reg (HARD_REG_SET, HARD_REG_SET, enum machine_mode);
+static int get_biased_reg (HARD_REG_SET, HARD_REG_SET, HARD_REG_SET,
+ HARD_REG_SET, enum machine_mode);
+static int count_long_blocks (HARD_REG_SET, int);
+static char * hardregset_to_string (HARD_REG_SET);
+static void calculate_dont_begin (struct web *, HARD_REG_SET *);
+static void colorize_one_web (struct web *, int);
+static void assign_colors (void);
+static void try_recolor_web (struct web *);
+static void insert_coalesced_conflicts (void);
+static int comp_webs_maxcost (const void *, const void *);
+static void recolor_spills (void);
+static void check_colors (void);
+static void restore_conflicts_from_coalesce (struct web *);
+static void break_coalesced_spills (void);
+static void unalias_web (struct web *);
+static void break_aliases_to_web (struct web *);
+static void break_precolored_alias (struct web *);
+static void init_web_pairs (void);
+static void add_web_pair_cost (struct web *, struct web *,
+ unsigned HOST_WIDE_INT, unsigned int);
+static int comp_web_pairs (const void *, const void *);
+static void sort_and_combine_web_pairs (int);
+static void aggressive_coalesce (void);
+static void extended_coalesce_2 (void);
+static void check_uncoalesced_moves (void);
static struct dlist *mv_worklist, *mv_coalesced, *mv_constrained;
static struct dlist *mv_frozen, *mv_active;
@@ -102,9 +102,7 @@ static struct dlist *mv_frozen, *mv_active;
/* Push a node onto the front of the list. */
static void
-push_list (x, list)
- struct dlist *x;
- struct dlist **list;
+push_list (struct dlist *x, struct dlist **list)
{
if (x->next || x->prev)
abort ();
@@ -115,9 +113,7 @@ push_list (x, list)
}
static void
-push_list_end (x, list)
- struct dlist *x;
- struct dlist **list;
+push_list_end (struct dlist *x, struct dlist **list)
{
if (x->prev || x->next)
abort ();
@@ -135,9 +131,7 @@ push_list_end (x, list)
/* Remove a node from the list. */
void
-remove_list (x, list)
- struct dlist *x;
- struct dlist **list;
+remove_list (struct dlist *x, struct dlist **list)
{
struct dlist *y = x->prev;
if (y)
@@ -153,8 +147,7 @@ remove_list (x, list)
/* Pop the front of the list. */
struct dlist *
-pop_list (list)
- struct dlist **list;
+pop_list (struct dlist **list)
{
struct dlist *r = *list;
if (r)
@@ -165,8 +158,7 @@ pop_list (list)
/* Free the given double linked list. */
static void
-free_dlist (list)
- struct dlist **list;
+free_dlist (struct dlist **list)
{
*list = NULL;
}
@@ -176,9 +168,7 @@ free_dlist (list)
Inline, because it's called with constant TYPE every time. */
inline void
-put_web (web, type)
- struct web *web;
- enum node_type type;
+put_web (struct web *web, enum node_type type)
{
switch (type)
{
@@ -216,7 +206,7 @@ put_web (web, type)
they are coalesced to. */
void
-reset_lists ()
+reset_lists (void)
{
struct dlist *d;
unsigned int i;
@@ -270,9 +260,7 @@ reset_lists ()
list. Additionally TYPE may not be SIMPLIFY. */
static void
-put_web_at_end (web, type)
- struct web *web;
- enum node_type type;
+put_web_at_end (struct web *web, enum node_type type)
{
if (type == PRECOLORED)
type = INITIAL;
@@ -286,8 +274,7 @@ put_web_at_end (web, type)
its current type). */
void
-remove_web_from_list (web)
- struct web *web;
+remove_web_from_list (struct web *web)
{
if (web->type == PRECOLORED)
remove_list (web->dlink, &WEBS(INITIAL));
@@ -298,9 +285,7 @@ remove_web_from_list (web)
/* Give MOVE the TYPE, and link it into the correct list. */
static inline void
-put_move (move, type)
- struct move *move;
- enum move_type type;
+put_move (struct move *move, enum move_type type)
{
switch (type)
{
@@ -328,8 +313,7 @@ put_move (move, type)
/* Build the worklists we are going to process. */
static void
-build_worklists (df)
- struct df *df ATTRIBUTE_UNUSED;
+build_worklists (struct df *df ATTRIBUTE_UNUSED)
{
struct dlist *d, *d_next;
struct move_list *ml;
@@ -348,7 +332,7 @@ build_worklists (df)
unsigned int i, num, max_num;
struct web **order2web;
max_num = num_webs - num_subwebs;
- order2web = (struct web **) xmalloc (max_num * sizeof (order2web[0]));
+ order2web = xmalloc (max_num * sizeof (order2web[0]));
for (i = 0, num = 0; i < max_num; i++)
if (id2web[i]->regno >= max_normal_pseudo)
order2web[num++] = id2web[i];
@@ -397,7 +381,7 @@ build_worklists (df)
if (ml->move)
{
struct move *m = ml->move;
- d = (struct dlist *) ra_calloc (sizeof (struct dlist));
+ d = ra_calloc (sizeof (struct dlist));
DLIST_MOVE (d) = m;
m->dlink = d;
put_move (m, WORKLIST);
@@ -407,8 +391,7 @@ build_worklists (df)
/* Enable the active moves, in which WEB takes part, to be processed. */
static void
-enable_move (web)
- struct web *web;
+enable_move (struct web *web)
{
struct move_list *ml;
for (ml = web->moves; ml; ml = ml->next)
@@ -424,9 +407,7 @@ enable_move (web)
now smaller than its freedom. */
static void
-decrement_degree (web, dec)
- struct web *web;
- int dec;
+decrement_degree (struct web *web, int dec)
{
int before = web->num_conflicts;
web->num_conflicts -= dec;
@@ -454,7 +435,7 @@ decrement_degree (web, dec)
/* Repeatedly simplify the nodes on the simplify worklists. */
static void
-simplify ()
+simplify (void)
{
struct dlist *d;
struct web *web;
@@ -493,9 +474,7 @@ simplify ()
/* Helper function to remove a move from the movelist of the web. */
static void
-remove_move_1 (web, move)
- struct web *web;
- struct move *move;
+remove_move_1 (struct web *web, struct move *move)
{
struct move_list *ml = web->moves;
if (!ml)
@@ -516,9 +495,7 @@ remove_move_1 (web, move)
not in the list anymore. */
static void
-remove_move (web, move)
- struct web *web;
- struct move *move;
+remove_move (struct web *web, struct move *move)
{
struct move_list *ml;
remove_move_1 (web, move);
@@ -530,8 +507,7 @@ remove_move (web, move)
/* Merge the moves for the two webs into the first web's movelist. */
void
-merge_moves (u, v)
- struct web *u, *v;
+merge_moves (struct web *u, struct web *v)
{
regset seen;
struct move_list *ml, *ml_next;
@@ -555,8 +531,7 @@ merge_moves (u, v)
/* Add a web to the simplify worklist, from the freeze worklist. */
static void
-add_worklist (web)
- struct web *web;
+add_worklist (struct web *web)
{
if (web->type != PRECOLORED && !web->moves
&& web->num_conflicts < NUM_REGS (web))
@@ -569,8 +544,7 @@ add_worklist (web)
/* Precolored node coalescing heuristic. */
static int
-ok (target, source)
- struct web *target, *source;
+ok (struct web *target, struct web *source)
{
struct conflict_link *wl;
int i;
@@ -661,8 +635,7 @@ ok (target, source)
/* Non-precolored node coalescing heuristic. */
static int
-conservative (target, source)
- struct web *target, *source;
+conservative (struct web *target, struct web *source)
{
unsigned int k;
unsigned int loop;
@@ -699,8 +672,7 @@ conservative (target, source)
was passed in. */
struct web *
-alias (web)
- struct web *web;
+alias (struct web *web)
{
while (web->type == COALESCED)
web = web->alias;
@@ -711,8 +683,7 @@ alias (web)
SIMPLIFY types. */
static inline unsigned int
-simplify_p (type)
- enum node_type type;
+simplify_p (enum node_type type)
{
return type == SIMPLIFY || type == SIMPLIFY_SPILL || type == SIMPLIFY_FAT;
}
@@ -720,8 +691,7 @@ simplify_p (type)
/* Actually combine two webs, that can be coalesced. */
static void
-combine (u, v)
- struct web *u, *v;
+combine (struct web *u, struct web *v)
{
int i;
struct conflict_link *wl;
@@ -850,7 +820,7 @@ combine (u, v)
This is used only for iterated coalescing. */
static void
-coalesce ()
+coalesce (void)
{
struct dlist *d = pop_list (&mv_worklist);
struct move *m = DLIST_MOVE (d);
@@ -896,8 +866,7 @@ coalesce ()
/* Freeze the moves associated with the web. Used for iterated coalescing. */
static void
-freeze_moves (web)
- struct web *web;
+freeze_moves (struct web *web)
{
struct move_list *ml, *ml_next;
for (ml = web->moves; ml; ml = ml_next)
@@ -928,7 +897,7 @@ freeze_moves (web)
coalescing). */
static void
-freeze ()
+freeze (void)
{
struct dlist *d = pop_list (&WEBS(FREEZE));
put_web (DLIST_WEB (d), SIMPLIFY);
@@ -938,17 +907,16 @@ freeze ()
/* The current spill heuristic. Returns a number for a WEB.
Webs with higher numbers are selected later. */
-static unsigned HOST_WIDE_INT (*spill_heuristic) PARAMS ((struct web *));
+static unsigned HOST_WIDE_INT (*spill_heuristic) (struct web *);
-static unsigned HOST_WIDE_INT default_spill_heuristic PARAMS ((struct web *));
+static unsigned HOST_WIDE_INT default_spill_heuristic (struct web *);
/* Our default heuristic is similar to spill_cost / num_conflicts.
Just scaled for integer arithmetic, and it favors coalesced webs,
and webs which span more insns with deaths. */
static unsigned HOST_WIDE_INT
-default_spill_heuristic (web)
- struct web *web;
+default_spill_heuristic (struct web *web)
{
unsigned HOST_WIDE_INT ret;
unsigned int divisor = 1;
@@ -970,7 +938,7 @@ default_spill_heuristic (web)
*actually* spill until we need to). */
static void
-select_spill ()
+select_spill (void)
{
unsigned HOST_WIDE_INT best = (unsigned HOST_WIDE_INT) -1;
struct dlist *bestd = NULL;
@@ -1016,10 +984,8 @@ select_spill ()
free colors, and MODE, returns nonzero of color C is still usable. */
static int
-color_usable_p (c, dont_begin_colors, free_colors, mode)
- int c;
- HARD_REG_SET dont_begin_colors, free_colors;
- enum machine_mode mode;
+color_usable_p (int c, HARD_REG_SET dont_begin_colors,
+ HARD_REG_SET free_colors, enum machine_mode mode)
{
if (!TEST_HARD_REG_BIT (dont_begin_colors, c)
&& TEST_HARD_REG_BIT (free_colors, c)
@@ -1048,9 +1014,8 @@ color_usable_p (c, dont_begin_colors, free_colors, mode)
block could be found. */
int
-get_free_reg (dont_begin_colors, free_colors, mode)
- HARD_REG_SET dont_begin_colors, free_colors;
- enum machine_mode mode;
+get_free_reg (HARD_REG_SET dont_begin_colors, HARD_REG_SET free_colors,
+ enum machine_mode mode)
{
int c;
int last_resort_reg = -1;
@@ -1099,9 +1064,9 @@ get_free_reg (dont_begin_colors, free_colors, mode)
only do the last two steps. */
static int
-get_biased_reg (dont_begin_colors, bias, prefer_colors, free_colors, mode)
- HARD_REG_SET dont_begin_colors, bias, prefer_colors, free_colors;
- enum machine_mode mode;
+get_biased_reg (HARD_REG_SET dont_begin_colors, HARD_REG_SET bias,
+ HARD_REG_SET prefer_colors, HARD_REG_SET free_colors,
+ enum machine_mode mode)
{
int c = -1;
HARD_REG_SET s;
@@ -1132,9 +1097,7 @@ get_biased_reg (dont_begin_colors, bias, prefer_colors, free_colors, mode)
in FREE_COLORS. */
static int
-count_long_blocks (free_colors, len)
- HARD_REG_SET free_colors;
- int len;
+count_long_blocks (HARD_REG_SET free_colors, int len)
{
int i, j;
int count = 0;
@@ -1158,8 +1121,7 @@ count_long_blocks (free_colors, len)
of hardreg sets. Note that this string is statically allocated. */
static char *
-hardregset_to_string (s)
- HARD_REG_SET s;
+hardregset_to_string (HARD_REG_SET s)
{
static char string[/*FIRST_PSEUDO_REGISTER + 30*/1024];
#if FIRST_PSEUDO_REGISTER <= HOST_BITS_PER_WIDE_INT
@@ -1190,9 +1152,7 @@ hardregset_to_string (s)
3 can't be used as begin color. */
static void
-calculate_dont_begin (web, result)
- struct web *web;
- HARD_REG_SET *result;
+calculate_dont_begin (struct web *web, HARD_REG_SET *result)
{
struct conflict_link *wl;
HARD_REG_SET dont_begin;
@@ -1279,9 +1239,7 @@ calculate_dont_begin (web, result)
register starved machines, so we try to avoid this. */
static void
-colorize_one_web (web, hard)
- struct web *web;
- int hard;
+colorize_one_web (struct web *web, int hard)
{
struct conflict_link *wl;
HARD_REG_SET colors, dont_begin;
@@ -1664,7 +1622,7 @@ colorize_one_web (web, hard)
colors of coalesced webs. */
static void
-assign_colors ()
+assign_colors (void)
{
struct dlist *d;
@@ -1693,8 +1651,7 @@ assign_colors ()
be aware, that currently this pass is quite slow. */
static void
-try_recolor_web (web)
- struct web *web;
+try_recolor_web (struct web *web)
{
struct conflict_link *wl;
unsigned HOST_WIDE_INT *cost_neighbors;
@@ -1702,11 +1659,10 @@ try_recolor_web (web)
int newcol, c;
HARD_REG_SET precolored_neighbors, spill_temps;
HARD_REG_SET possible_begin, wide_seen;
- cost_neighbors = (unsigned HOST_WIDE_INT *)
- xcalloc (FIRST_PSEUDO_REGISTER, sizeof (cost_neighbors[0]));
+ cost_neighbors = xcalloc (FIRST_PSEUDO_REGISTER, sizeof (cost_neighbors[0]));
/* For each hard-regs count the number of preceding hardregs, which
would overlap this color, if used in WEB's mode. */
- min_color = (unsigned int *) xcalloc (FIRST_PSEUDO_REGISTER, sizeof (int));
+ min_color = xcalloc (FIRST_PSEUDO_REGISTER, sizeof (int));
CLEAR_HARD_REG_SET (possible_begin);
for (c = 0; c < FIRST_PSEUDO_REGISTER; c++)
{
@@ -1805,7 +1761,7 @@ try_recolor_web (web)
remove_list (web->dlink, &WEBS(SPILLED));
put_web (web, COLORED);
web->color = newcol;
- old_colors = (int *) xcalloc (num_webs, sizeof (int));
+ old_colors = xcalloc (num_webs, sizeof (int));
for (wl = web->conflict_list; wl; wl = wl_next)
{
struct web *web2 = alias (wl->t);
@@ -1896,7 +1852,7 @@ try_recolor_web (web)
isn't used anymore, e.g. on a completely colored graph. */
static void
-insert_coalesced_conflicts ()
+insert_coalesced_conflicts (void)
{
struct dlist *d;
for (d = WEBS(COALESCED); 0 && d; d = d->next)
@@ -1950,8 +1906,7 @@ insert_coalesced_conflicts ()
largest cost first. */
static int
-comp_webs_maxcost (w1, w2)
- const void *w1, *w2;
+comp_webs_maxcost (const void *w1, const void *w2)
{
struct web *web1 = *(struct web **)w1;
struct web *web2 = *(struct web **)w2;
@@ -1967,12 +1922,12 @@ comp_webs_maxcost (w1, w2)
how this is done. This just calls it for each spilled web. */
static void
-recolor_spills ()
+recolor_spills (void)
{
unsigned int i, num;
struct web **order2web;
num = num_webs - num_subwebs;
- order2web = (struct web **) xmalloc (num * sizeof (order2web[0]));
+ order2web = xmalloc (num * sizeof (order2web[0]));
for (i = 0; i < num; i++)
{
order2web[i] = id2web[i];
@@ -2004,7 +1959,7 @@ recolor_spills ()
not being in usable regs. */
static void
-check_colors ()
+check_colors (void)
{
unsigned int i;
for (i = 0; i < num_webs - num_subwebs; i++)
@@ -2082,8 +2037,7 @@ check_colors ()
back onto SELECT stack. */
static void
-unalias_web (web)
- struct web *web;
+unalias_web (struct web *web)
{
web->alias = NULL;
web->is_coalesced = 0;
@@ -2111,8 +2065,7 @@ unalias_web (web)
Somewhen we'll change this to be more sane. */
static void
-break_aliases_to_web (web)
- struct web *web;
+break_aliases_to_web (struct web *web)
{
struct dlist *d, *d_next;
if (web->type != SPILLED)
@@ -2154,8 +2107,7 @@ break_aliases_to_web (web)
from initially coalescing both. */
static void
-break_precolored_alias (web)
- struct web *web;
+break_precolored_alias (struct web *web)
{
struct web *pre = web->alias;
struct conflict_link *wl;
@@ -2223,8 +2175,7 @@ break_precolored_alias (web)
and break up the coalescing. */
static void
-restore_conflicts_from_coalesce (web)
- struct web *web;
+restore_conflicts_from_coalesce (struct web *web)
{
struct conflict_link **pcl;
struct conflict_link *wl;
@@ -2330,7 +2281,7 @@ restore_conflicts_from_coalesce (web)
there are any spilled coalesce targets. */
static void
-break_coalesced_spills ()
+break_coalesced_spills (void)
{
int changed = 0;
while (1)
@@ -2398,7 +2349,7 @@ static unsigned int num_web_pairs;
/* Clear the hash table of web pairs. */
static void
-init_web_pairs ()
+init_web_pairs (void)
{
memset (web_pair_hash, 0, sizeof web_pair_hash);
num_web_pairs = 0;
@@ -2410,10 +2361,8 @@ init_web_pairs ()
already in, cumulate the costs and conflict number. */
static void
-add_web_pair_cost (web1, web2, cost, conflicts)
- struct web *web1, *web2;
- unsigned HOST_WIDE_INT cost;
- unsigned int conflicts;
+add_web_pair_cost (struct web *web1, struct web *web2,
+ unsigned HOST_WIDE_INT cost, unsigned int conflicts)
{
unsigned int hash;
struct web_pair *p;
@@ -2431,7 +2380,7 @@ add_web_pair_cost (web1, web2, cost, conflicts)
p->conflicts += conflicts;
return;
}
- p = (struct web_pair *) ra_alloc (sizeof *p);
+ p = ra_alloc (sizeof *p);
p->next_hash = web_pair_hash[hash];
p->next_list = web_pair_list;
p->smaller = web1;
@@ -2448,8 +2397,7 @@ add_web_pair_cost (web1, web2, cost, conflicts)
when the moves are removed) come first. */
static int
-comp_web_pairs (w1, w2)
- const void *w1, *w2;
+comp_web_pairs (const void *w1, const void *w2)
{
struct web_pair *p1 = *(struct web_pair **)w1;
struct web_pair *p2 = *(struct web_pair **)w2;
@@ -2469,15 +2417,14 @@ comp_web_pairs (w1, w2)
with the most savings. */
static void
-sort_and_combine_web_pairs (for_move)
- int for_move;
+sort_and_combine_web_pairs (int for_move)
{
unsigned int i;
struct web_pair **sorted;
struct web_pair *p;
if (!num_web_pairs)
return;
- sorted = (struct web_pair **) xmalloc (num_web_pairs * sizeof (sorted[0]));
+ sorted = xmalloc (num_web_pairs * sizeof (sorted[0]));
for (p = web_pair_list, i = 0; p; p = p->next_list)
sorted[i++] = p;
if (i != num_web_pairs)
@@ -2521,7 +2468,7 @@ sort_and_combine_web_pairs (for_move)
giving the most saving if coalesced. */
static void
-aggressive_coalesce ()
+aggressive_coalesce (void)
{
struct dlist *d;
struct move *m;
@@ -2580,7 +2527,7 @@ aggressive_coalesce ()
all insns, and for each insn, through all defs and uses. */
static void
-extended_coalesce_2 ()
+extended_coalesce_2 (void)
{
rtx insn;
struct ra_insn_info info;
@@ -2625,7 +2572,7 @@ extended_coalesce_2 ()
/* Check if we forgot to coalesce some moves. */
static void
-check_uncoalesced_moves ()
+check_uncoalesced_moves (void)
{
struct move_list *ml;
struct move *m;
@@ -2659,8 +2606,7 @@ check_uncoalesced_moves ()
produces a list of spilled, colored and coalesced nodes. */
void
-ra_colorize_graph (df)
- struct df *df;
+ra_colorize_graph (struct df *df)
{
if (rtl_dump_file)
dump_igraph (df);
@@ -2705,7 +2651,7 @@ ra_colorize_graph (df)
/* Initialize this module. */
-void ra_colorize_init ()
+void ra_colorize_init (void)
{
/* FIXME: Choose spill heuristic for platform if we have one */
spill_heuristic = default_spill_heuristic;
@@ -2715,7 +2661,7 @@ void ra_colorize_init ()
memory). */
void
-ra_colorize_free_all ()
+ra_colorize_free_all (void)
{
struct dlist *d;
while ((d = pop_list (&WEBS(FREE))) != NULL)
diff --git a/gcc/ra-debug.c b/gcc/ra-debug.c
index 7d59bac42e3..acddbe128cd 100644
--- a/gcc/ra-debug.c
+++ b/gcc/ra-debug.c
@@ -36,10 +36,10 @@
/* This file contains various dumping and debug functions for
the graph coloring register allocator. */
-static void ra_print_rtx_1op PARAMS ((FILE *, rtx));
-static void ra_print_rtx_2op PARAMS ((FILE *, rtx));
-static void ra_print_rtx_3op PARAMS ((FILE *, rtx));
-static void ra_print_rtx_object PARAMS ((FILE *, rtx));
+static void ra_print_rtx_1op (FILE *, rtx);
+static void ra_print_rtx_2op (FILE *, rtx);
+static void ra_print_rtx_3op (FILE *, rtx);
+static void ra_print_rtx_object (FILE *, rtx);
/* The hardregs as names, for debugging. */
static const char *const reg_class_names[] = REG_CLASS_NAMES;
@@ -70,9 +70,7 @@ ra_debug_msg (unsigned int level, const char *format, ...)
"op(Y)" to FILE. */
static void
-ra_print_rtx_1op (file, x)
- FILE *file;
- rtx x;
+ra_print_rtx_1op (FILE *file, rtx x)
{
enum rtx_code code = GET_CODE (x);
rtx op0 = XEXP (x, 0);
@@ -106,9 +104,7 @@ ra_print_rtx_1op (file, x)
to FILE. */
static void
-ra_print_rtx_2op (file, x)
- FILE *file;
- rtx x;
+ra_print_rtx_2op (FILE *file, rtx x)
{
int infix = 1;
const char *opname = "shitop";
@@ -171,9 +167,7 @@ ra_print_rtx_2op (file, x)
I.e. X is either an IF_THEN_ELSE, or a bitmap operation. */
static void
-ra_print_rtx_3op (file, x)
- FILE *file;
- rtx x;
+ra_print_rtx_3op (FILE *file, rtx x)
{
enum rtx_code code = GET_CODE (x);
rtx op0 = XEXP (x, 0);
@@ -208,9 +202,7 @@ ra_print_rtx_3op (file, x)
is a hardreg, whose name is NULL, or empty. */
static void
-ra_print_rtx_object (file, x)
- FILE *file;
- rtx x;
+ra_print_rtx_object (FILE *file, rtx x)
{
enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x);
@@ -344,10 +336,7 @@ ra_print_rtx_object (file, x)
the preceding and following insn. */
void
-ra_print_rtx (file, x, with_pn)
- FILE *file;
- rtx x;
- int with_pn;
+ra_print_rtx (FILE *file, rtx x, int with_pn)
{
enum rtx_code code;
char class;
@@ -517,10 +506,7 @@ ra_print_rtx (file, x, with_pn)
/* This only calls ra_print_rtx(), but emits a final newline. */
void
-ra_print_rtx_top (file, x, with_pn)
- FILE *file;
- rtx x;
- int with_pn;
+ra_print_rtx_top (FILE *file, rtx x, int with_pn)
{
ra_print_rtx (file, x, with_pn);
fprintf (file, "\n");
@@ -529,8 +515,7 @@ ra_print_rtx_top (file, x, with_pn)
/* Callable from gdb. This prints rtx X onto stderr. */
void
-ra_debug_rtx (x)
- rtx x;
+ra_debug_rtx (rtx x)
{
ra_print_rtx_top (stderr, x, 1);
}
@@ -539,8 +524,7 @@ ra_debug_rtx (x)
The first and last insn are emitted with UIDs of prev and next insns. */
void
-ra_debug_bbi (bbi)
- int bbi;
+ra_debug_bbi (int bbi)
{
basic_block bb = BASIC_BLOCK (bbi);
rtx insn;
@@ -557,9 +541,7 @@ ra_debug_bbi (bbi)
or emit a window of NUM insns around INSN, to stderr. */
void
-ra_debug_insns (insn, num)
- rtx insn;
- int num;
+ra_debug_insns (rtx insn, int num)
{
int i, count = (num == 0 ? 1 : num < 0 ? -num : num);
if (num < 0)
@@ -578,9 +560,7 @@ ra_debug_insns (insn, num)
some notes, if flag_ra_dump_notes is zero. */
void
-ra_print_rtl_with_bb (file, insn)
- FILE *file;
- rtx insn;
+ra_print_rtl_with_bb (FILE *file, rtx insn)
{
basic_block last_bb, bb;
unsigned int num = 0;
@@ -628,7 +608,7 @@ ra_print_rtl_with_bb (file, insn)
graph, and prints the findings. */
void
-dump_number_seen ()
+dump_number_seen (void)
{
#define N 17
int num[N];
@@ -654,8 +634,7 @@ dump_number_seen ()
/* Dump the interference graph, the move list and the webs. */
void
-dump_igraph (df)
- struct df *df ATTRIBUTE_UNUSED;
+dump_igraph (struct df *df ATTRIBUTE_UNUSED)
{
struct move_list *ml;
unsigned int def1, def2;
@@ -741,7 +720,7 @@ dump_igraph (df)
to my custom graph colorizer. */
void
-dump_igraph_machine ()
+dump_igraph_machine (void)
{
unsigned int i;
@@ -801,7 +780,7 @@ dump_igraph_machine ()
and emits information, if the resulting insns are strictly valid. */
void
-dump_constraints ()
+dump_constraints (void)
{
rtx insn;
int i;
@@ -854,9 +833,7 @@ dump_constraints ()
preceded by a custom message MSG, with debug level LEVEL. */
void
-dump_graph_cost (level, msg)
- unsigned int level;
- const char *msg;
+dump_graph_cost (unsigned int level, const char *msg)
{
unsigned int i;
unsigned HOST_WIDE_INT cost;
@@ -878,8 +855,7 @@ dump_graph_cost (level, msg)
/* Dump the color assignment per web, the coalesced and spilled webs. */
void
-dump_ra (df)
- struct df *df ATTRIBUTE_UNUSED;
+dump_ra (struct df *df ATTRIBUTE_UNUSED)
{
struct web *web;
struct dlist *d;
@@ -913,10 +889,7 @@ dump_ra (df)
(loads, stores and copies). */
void
-dump_static_insn_cost (file, message, prefix)
- FILE *file;
- const char *message;
- const char *prefix;
+dump_static_insn_cost (FILE *file, const char *message, const char *prefix)
{
struct cost
{
@@ -1001,9 +974,7 @@ dump_static_insn_cost (file, message, prefix)
hardregs in common. */
int
-web_conflicts_p (web1, web2)
- struct web *web1;
- struct web *web2;
+web_conflicts_p (struct web *web1, struct web *web2)
{
if (web1->type == PRECOLORED && web2->type == PRECOLORED)
return 0;
@@ -1020,8 +991,7 @@ web_conflicts_p (web1, web2)
/* Dump all uids of insns in which WEB is mentioned. */
void
-dump_web_insns (web)
- struct web *web;
+dump_web_insns (struct web *web)
{
unsigned int i;
@@ -1047,8 +1017,7 @@ dump_web_insns (web)
/* Dump conflicts for web WEB. */
void
-dump_web_conflicts (web)
- struct web *web;
+dump_web_conflicts (struct web *web)
{
int num = 0;
unsigned int def2;
@@ -1099,8 +1068,7 @@ dump_web_conflicts (web)
/* Output HARD_REG_SET to stderr. */
void
-debug_hard_reg_set (set)
- HARD_REG_SET set;
+debug_hard_reg_set (HARD_REG_SET set)
{
int i;
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
diff --git a/gcc/ra-rewrite.c b/gcc/ra-rewrite.c
index 21ff034f2ba..14360d894a0 100644
--- a/gcc/ra-rewrite.c
+++ b/gcc/ra-rewrite.c
@@ -44,33 +44,32 @@
struct rewrite_info;
struct rtx_list;
-static void spill_coalescing PARAMS ((sbitmap, sbitmap));
-static unsigned HOST_WIDE_INT spill_prop_savings PARAMS ((struct web *,
- sbitmap));
-static void spill_prop_insert PARAMS ((struct web *, sbitmap, sbitmap));
-static int spill_propagation PARAMS ((sbitmap, sbitmap, sbitmap));
-static void spill_coalprop PARAMS ((void));
-static void allocate_spill_web PARAMS ((struct web *));
-static void choose_spill_colors PARAMS ((void));
-static void rewrite_program PARAMS ((bitmap));
-static void remember_slot PARAMS ((struct rtx_list **, rtx));
-static int slots_overlap_p PARAMS ((rtx, rtx));
-static void delete_overlapping_slots PARAMS ((struct rtx_list **, rtx));
-static int slot_member_p PARAMS ((struct rtx_list *, rtx));
-static void insert_stores PARAMS ((bitmap));
-static int spill_same_color_p PARAMS ((struct web *, struct web *));
-static bool is_partly_live_1 PARAMS ((sbitmap, struct web *));
-static void update_spill_colors PARAMS ((HARD_REG_SET *, struct web *, int));
-static int spill_is_free PARAMS ((HARD_REG_SET *, struct web *));
-static void emit_loads PARAMS ((struct rewrite_info *, int, rtx));
-static void reloads_to_loads PARAMS ((struct rewrite_info *, struct ref **,
- unsigned int, struct web **));
-static void rewrite_program2 PARAMS ((bitmap));
-static void mark_refs_for_checking PARAMS ((struct web *, bitmap));
-static void detect_web_parts_to_rebuild PARAMS ((void));
-static void delete_useless_defs PARAMS ((void));
-static void detect_non_changed_webs PARAMS ((void));
-static void reset_changed_flag PARAMS ((void));
+static void spill_coalescing (sbitmap, sbitmap);
+static unsigned HOST_WIDE_INT spill_prop_savings (struct web *, sbitmap);
+static void spill_prop_insert (struct web *, sbitmap, sbitmap);
+static int spill_propagation (sbitmap, sbitmap, sbitmap);
+static void spill_coalprop (void);
+static void allocate_spill_web (struct web *);
+static void choose_spill_colors (void);
+static void rewrite_program (bitmap);
+static void remember_slot (struct rtx_list **, rtx);
+static int slots_overlap_p (rtx, rtx);
+static void delete_overlapping_slots (struct rtx_list **, rtx);
+static int slot_member_p (struct rtx_list *, rtx);
+static void insert_stores (bitmap);
+static int spill_same_color_p (struct web *, struct web *);
+static bool is_partly_live_1 (sbitmap, struct web *);
+static void update_spill_colors (HARD_REG_SET *, struct web *, int);
+static int spill_is_free (HARD_REG_SET *, struct web *);
+static void emit_loads (struct rewrite_info *, int, rtx);
+static void reloads_to_loads (struct rewrite_info *, struct ref **,
+ unsigned int, struct web **);
+static void rewrite_program2 (bitmap);
+static void mark_refs_for_checking (struct web *, bitmap);
+static void detect_web_parts_to_rebuild (void);
+static void delete_useless_defs (void);
+static void detect_non_changed_webs (void);
+static void reset_changed_flag (void);
/* For tracking some statistics, we count the number (and cost)
of deleted move insns. */
@@ -84,8 +83,7 @@ static unsigned HOST_WIDE_INT deleted_move_cost;
reduces memory shuffling. */
static void
-spill_coalescing (coalesce, spilled)
- sbitmap coalesce, spilled;
+spill_coalescing (sbitmap coalesce, sbitmap spilled)
{
struct move_list *ml;
struct move *m;
@@ -160,9 +158,7 @@ spill_coalescing (coalesce, spilled)
SPILLED, in terms of removed move insn cost. */
static unsigned HOST_WIDE_INT
-spill_prop_savings (web, spilled)
- struct web *web;
- sbitmap spilled;
+spill_prop_savings (struct web *web, sbitmap spilled)
{
unsigned HOST_WIDE_INT savings = 0;
struct move_list *ml;
@@ -196,9 +192,7 @@ spill_prop_savings (web, spilled)
to LIST and PROCESSED. */
static void
-spill_prop_insert (web, list, processed)
- struct web *web;
- sbitmap list, processed;
+spill_prop_insert (struct web *web, sbitmap list, sbitmap processed)
{
struct move_list *ml;
struct move *m;
@@ -232,8 +226,7 @@ spill_prop_insert (web, list, processed)
of all webs processed so far, so we don't do work twice. */
static int
-spill_propagation (to_prop, spilled, processed)
- sbitmap to_prop, spilled, processed;
+spill_propagation (sbitmap to_prop, sbitmap spilled, sbitmap processed)
{
int id;
int again = 0;
@@ -275,7 +268,7 @@ spill_propagation (to_prop, spilled, processed)
spill coalescing and spill propagation, until nothing changes. */
static void
-spill_coalprop ()
+spill_coalprop (void)
{
sbitmap spilled, processed, to_prop;
struct dlist *d;
@@ -311,8 +304,7 @@ spill_coalprop ()
MEM references. */
static void
-allocate_spill_web (web)
- struct web *web;
+allocate_spill_web (struct web *web)
{
int regno = web->regno;
rtx slot;
@@ -326,11 +318,10 @@ allocate_spill_web (web)
spilling. The heuristic isn't good in any way. */
static void
-choose_spill_colors ()
+choose_spill_colors (void)
{
struct dlist *d;
- unsigned HOST_WIDE_INT *costs = (unsigned HOST_WIDE_INT *)
- xmalloc (FIRST_PSEUDO_REGISTER * sizeof (costs[0]));
+ unsigned HOST_WIDE_INT *costs = xmalloc (FIRST_PSEUDO_REGISTER * sizeof (costs[0]));
for (d = WEBS(SPILLED); d; d = d->next)
{
struct web *web = DLIST_WEB (d);
@@ -398,8 +389,7 @@ static bitmap useless_defs;
deaths. */
static void
-rewrite_program (new_deaths)
- bitmap new_deaths;
+rewrite_program (bitmap new_deaths)
{
unsigned int i;
struct dlist *d;
@@ -539,13 +529,11 @@ struct rtx_list
/* Adds X to *LIST. */
static void
-remember_slot (list, x)
- struct rtx_list **list;
- rtx x;
+remember_slot (struct rtx_list **list, rtx x)
{
struct rtx_list *l;
/* PRE: X is not already in LIST. */
- l = (struct rtx_list *) ra_alloc (sizeof (*l));
+ l = ra_alloc (sizeof (*l));
l->next = *list;
l->x = x;
*list = l;
@@ -557,8 +545,7 @@ remember_slot (list, x)
(plus (basereg) (const_inst x)), otherwise they overlap. */
static int
-slots_overlap_p (s1, s2)
- rtx s1, s2;
+slots_overlap_p (rtx s1, rtx s2)
{
rtx base1, base2;
HOST_WIDE_INT ofs1 = 0, ofs2 = 0;
@@ -608,9 +595,7 @@ slots_overlap_p (s1, s2)
of slots_overlap_p(). */
static void
-delete_overlapping_slots (list, x)
- struct rtx_list **list;
- rtx x;
+delete_overlapping_slots (struct rtx_list **list, rtx x)
{
while (*list)
{
@@ -624,9 +609,7 @@ delete_overlapping_slots (list, x)
/* Returns nonzero, of X is member of LIST. */
static int
-slot_member_p (list, x)
- struct rtx_list *list;
- rtx x;
+slot_member_p (struct rtx_list *list, rtx x)
{
for (;list; list = list->next)
if (rtx_equal_p (list->x, x))
@@ -641,8 +624,7 @@ slot_member_p (list, x)
containing deaths. */
static void
-insert_stores (new_deaths)
- bitmap new_deaths;
+insert_stores (bitmap new_deaths)
{
rtx insn;
rtx last_slot = NULL_RTX;
@@ -751,8 +733,7 @@ insert_stores (new_deaths)
they are not the same width. */
static int
-spill_same_color_p (web1, web2)
- struct web *web1, *web2;
+spill_same_color_p (struct web *web1, struct web *web2)
{
int c1, size1, c2, size2;
if ((c1 = alias (web1)->color) < 0 || c1 == an_unusable_color)
@@ -773,9 +754,7 @@ spill_same_color_p (web1, web2)
subwebs (or WEB itself) is live. */
static bool
-is_partly_live_1 (live, web)
- sbitmap live;
- struct web *web;
+is_partly_live_1 (sbitmap live, struct web *web)
{
do
if (TEST_BIT (live, web->id))
@@ -794,10 +773,7 @@ is_partly_live_1 (live, web)
is nonzero), or remove them. */
static void
-update_spill_colors (in_use, web, add)
- HARD_REG_SET *in_use;
- struct web *web;
- int add;
+update_spill_colors (HARD_REG_SET *in_use, struct web *web, int add)
{
int c, size;
if ((c = alias (find_web_for_subweb (web))->color) < 0
@@ -826,9 +802,7 @@ update_spill_colors (in_use, web, add)
Generally, if WEB can't be left colorized return 1. */
static int
-spill_is_free (in_use, web)
- HARD_REG_SET *in_use;
- struct web *web;
+spill_is_free (HARD_REG_SET *in_use, struct web *web)
{
int c, size;
if ((c = alias (web)->color) < 0)
@@ -882,10 +856,7 @@ struct rewrite_info
loads. LAST_BLOCK_INSN is the last insn of the current basic block. */
static void
-emit_loads (ri, nl_first_reload, last_block_insn)
- struct rewrite_info *ri;
- int nl_first_reload;
- rtx last_block_insn;
+emit_loads (struct rewrite_info *ri, int nl_first_reload, rtx last_block_insn)
{
int j;
for (j = ri->nl_size; j;)
@@ -1019,11 +990,8 @@ emit_loads (ri, nl_first_reload, last_block_insn)
and whose colors isn't free anymore, on the needed_loads list. */
static void
-reloads_to_loads (ri, refs, num_refs, ref2web)
- struct rewrite_info *ri;
- struct ref **refs;
- unsigned int num_refs;
- struct web **ref2web;
+reloads_to_loads (struct rewrite_info *ri, struct ref **refs,
+ unsigned int num_refs, struct web **ref2web)
{
unsigned int n;
int num_reloads = ri->num_reloads;
@@ -1082,14 +1050,13 @@ reloads_to_loads (ri, refs, num_refs, ref2web)
containing deaths). */
static void
-rewrite_program2 (new_deaths)
- bitmap new_deaths;
+rewrite_program2 (bitmap new_deaths)
{
basic_block bb = NULL;
int nl_first_reload;
struct rewrite_info ri;
rtx insn;
- ri.needed_loads = (struct web **) xmalloc (num_webs * sizeof (struct web *));
+ ri.needed_loads = xmalloc (num_webs * sizeof (struct web *));
ri.need_reload = BITMAP_XMALLOC ();
ri.scratch = BITMAP_XMALLOC ();
ri.live = sbitmap_alloc (num_webs);
@@ -1446,9 +1413,7 @@ rewrite_program2 (new_deaths)
Also remember all IDs of its uses in USES_AS_BITMAP. */
static void
-mark_refs_for_checking (web, uses_as_bitmap)
- struct web *web;
- bitmap uses_as_bitmap;
+mark_refs_for_checking (struct web *web, bitmap uses_as_bitmap)
{
unsigned int i;
for (i = 0; i < web->num_uses; i++)
@@ -1474,7 +1439,7 @@ mark_refs_for_checking (web, uses_as_bitmap)
information, we will rebuild. */
static void
-detect_web_parts_to_rebuild ()
+detect_web_parts_to_rebuild (void)
{
bitmap uses_as_bitmap;
unsigned int i, pass;
@@ -1586,7 +1551,7 @@ static unsigned HOST_WIDE_INT deleted_def_cost;
which wasn't live. Try to delete all those insns. */
static void
-delete_useless_defs ()
+delete_useless_defs (void)
{
unsigned int i;
/* If the insn only sets the def without any sideeffect (besides
@@ -1614,7 +1579,7 @@ delete_useless_defs ()
in this pass). */
static void
-detect_non_changed_webs ()
+detect_non_changed_webs (void)
{
struct dlist *d, *d_next;
for (d = WEBS(SPILLED); d; d = d_next)
@@ -1640,7 +1605,7 @@ detect_non_changed_webs ()
/* Before spilling we clear the changed flags for all spilled webs. */
static void
-reset_changed_flag ()
+reset_changed_flag (void)
{
struct dlist *d;
for (d = WEBS(SPILLED); d; d = d->next)
@@ -1653,7 +1618,7 @@ reset_changed_flag ()
building the interference graph in the next pass. */
void
-actual_spill ()
+actual_spill (void)
{
int i;
bitmap new_deaths = BITMAP_XMALLOC ();
@@ -1750,7 +1715,7 @@ emit_colors (df)
}
ra_max_regno = max_regno = max_reg_num ();
allocate_reg_info (max_regno, FALSE, FALSE);
- ra_reg_renumber = (short *) xmalloc (max_regno * sizeof (short));
+ ra_reg_renumber = xmalloc (max_regno * sizeof (short));
for (si = 0; si < max_regno; si++)
ra_reg_renumber[si] = -1;
@@ -1841,7 +1806,7 @@ emit_colors (df)
/* Delete some coalesced moves from the insn stream. */
void
-delete_moves ()
+delete_moves (void)
{
struct move_list *ml;
struct web *s, *t;
@@ -1899,7 +1864,7 @@ delete_moves ()
that comes later) Bah. */
void
-remove_suspicious_death_notes ()
+remove_suspicious_death_notes (void)
{
rtx insn;
for (insn = get_insns(); insn; insn = NEXT_INSN (insn))
@@ -1928,8 +1893,7 @@ remove_suspicious_death_notes ()
is nonzero, also free ra_reg_renumber and reset ra_max_regno. */
void
-setup_renumber (free_it)
- int free_it;
+setup_renumber (int free_it)
{
int i;
max_regno = max_reg_num ();
@@ -1950,8 +1914,7 @@ setup_renumber (free_it)
and removed moves or useless defs. */
void
-dump_cost (level)
- unsigned int level;
+dump_cost (unsigned int level)
{
ra_debug_msg (level, "Instructions for spilling\n added:\n");
ra_debug_msg (level, " loads =%d cost=" HOST_WIDE_INT_PRINT_UNSIGNED "\n",
@@ -1970,7 +1933,7 @@ dump_cost (level)
/* Initialization of the rewrite phase. */
void
-ra_rewrite_init ()
+ra_rewrite_init (void)
{
emitted_spill_loads = 0;
emitted_spill_stores = 0;
diff --git a/gcc/ra.c b/gcc/ra.c
index 45f22ced3bb..01ce6dc067f 100644
--- a/gcc/ra.c
+++ b/gcc/ra.c
@@ -1,5 +1,5 @@
/* Graph coloring register allocator
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Matz <matz@suse.de>
and Daniel Berlin <dan@cgsoftware.com>.
@@ -85,16 +85,16 @@
*/
static struct obstack ra_obstack;
-static void create_insn_info PARAMS ((struct df *));
-static void free_insn_info PARAMS ((void));
-static void alloc_mem PARAMS ((struct df *));
-static void free_mem PARAMS ((struct df *));
-static void free_all_mem PARAMS ((struct df *df));
-static int one_pass PARAMS ((struct df *, int));
-static void check_df PARAMS ((struct df *));
-static void init_ra PARAMS ((void));
+static void create_insn_info (struct df *);
+static void free_insn_info (void);
+static void alloc_mem (struct df *);
+static void free_mem (struct df *);
+static void free_all_mem (struct df *df);
+static int one_pass (struct df *, int);
+static void check_df (struct df *);
+static void init_ra (void);
-void reg_alloc PARAMS ((void));
+void reg_alloc (void);
/* These global variables are "internal" to the register allocator.
They are all documented at their declarations in ra.h. */
@@ -165,8 +165,7 @@ int flag_ra_dump_notes = 0;
is done. Allocate an object of SIZE bytes. */
void *
-ra_alloc (size)
- size_t size;
+ra_alloc (size_t size)
{
return obstack_alloc (&ra_obstack, size);
}
@@ -174,8 +173,7 @@ ra_alloc (size)
/* Like ra_alloc(), but clear the returned memory. */
void *
-ra_calloc (size)
- size_t size;
+ra_calloc (size_t size)
{
void *p = obstack_alloc (&ra_obstack, size);
memset (p, 0, size);
@@ -185,8 +183,7 @@ ra_calloc (size)
/* Returns the number of hardregs in HARD_REG_SET RS. */
int
-hard_regs_count (rs)
- HARD_REG_SET rs;
+hard_regs_count (HARD_REG_SET rs)
{
int count = 0;
#ifdef HARD_REG_SET
@@ -220,8 +217,7 @@ hard_regs_count (rs)
be basically valid. */
rtx
-ra_emit_move_insn (x, y)
- rtx x, y;
+ra_emit_move_insn (rtx x, rtx y)
{
enum machine_mode mode = GET_MODE (x);
if (GET_MODE_CLASS (mode) == MODE_CC)
@@ -238,8 +234,7 @@ static struct ref **refs_for_insn_df;
all valid defs and uses in an insn. */
static void
-create_insn_info (df)
- struct df *df;
+create_insn_info (struct df *df)
{
rtx insn;
struct ref **act_refs;
@@ -288,7 +283,7 @@ create_insn_info (df)
/* Free the insn_df structures. */
static void
-free_insn_info ()
+free_insn_info (void)
{
free (refs_for_insn_df);
refs_for_insn_df = NULL;
@@ -302,9 +297,7 @@ free_insn_info ()
represented by WEB. Returns the matching subweb or NULL. */
struct web *
-find_subweb (web, reg)
- struct web *web;
- rtx reg;
+find_subweb (struct web *web, rtx reg)
{
struct web *w;
if (GET_CODE (reg) != SUBREG)
@@ -320,9 +313,7 @@ find_subweb (web, reg)
a collection of the needed size and offset (in bytes). */
struct web *
-find_subweb_2 (web, size_word)
- struct web *web;
- unsigned int size_word;
+find_subweb_2 (struct web *web, unsigned int size_word)
{
struct web *w = web;
if (size_word == GET_MODE_SIZE (GET_MODE (web->orig_x)))
@@ -340,8 +331,7 @@ find_subweb_2 (web, size_word)
/* Returns the superweb for SUBWEB. */
struct web *
-find_web_for_subweb_1 (subweb)
- struct web *subweb;
+find_web_for_subweb_1 (struct web *subweb)
{
while (subweb->parent_web)
subweb = subweb->parent_web;
@@ -352,8 +342,7 @@ find_web_for_subweb_1 (subweb)
Return 1 if they do. */
int
-hard_regs_intersect_p (a, b)
- HARD_REG_SET *a, *b;
+hard_regs_intersect_p (HARD_REG_SET *a, HARD_REG_SET *b)
{
HARD_REG_SET c;
COPY_HARD_REG_SET (c, *a);
@@ -368,15 +357,13 @@ lose:
register allocator. */
static void
-alloc_mem (df)
- struct df *df;
+alloc_mem (struct df *df)
{
int i;
ra_build_realloc (df);
if (!live_at_end)
{
- live_at_end = (bitmap *) xmalloc ((last_basic_block + 2)
- * sizeof (bitmap));
+ live_at_end = xmalloc ((last_basic_block + 2) * sizeof (bitmap));
for (i = 0; i < last_basic_block + 2; i++)
live_at_end[i] = BITMAP_XMALLOC ();
live_at_end += 2;
@@ -387,8 +374,7 @@ alloc_mem (df)
/* Free the memory which isn't necessary for the next pass. */
static void
-free_mem (df)
- struct df *df ATTRIBUTE_UNUSED;
+free_mem (struct df *df ATTRIBUTE_UNUSED)
{
free_insn_info ();
ra_build_free ();
@@ -398,8 +384,7 @@ free_mem (df)
it's done. */
static void
-free_all_mem (df)
- struct df *df;
+free_all_mem (struct df *df)
{
unsigned int i;
live_at_end -= 2;
@@ -419,9 +404,7 @@ static long ticks_rebuild;
was added, i.e. if the allocator needs to rerun. */
static int
-one_pass (df, rebuild)
- struct df *df;
- int rebuild;
+one_pass (struct df *df, int rebuild)
{
long ticks = clock ();
int something_spilled;
@@ -462,7 +445,7 @@ one_pass (df, rebuild)
/* Initialize various arrays for the register allocator. */
static void
-init_ra ()
+init_ra (void)
{
int i;
HARD_REG_SET rs;
@@ -593,8 +576,7 @@ init_ra ()
invariances we expect. */
static void
-check_df (df)
- struct df *df;
+check_df (struct df *df)
{
struct df_link *link;
rtx insn;
@@ -664,7 +646,7 @@ check_df (df)
/* Main register allocator entry point. */
void
-reg_alloc ()
+reg_alloc (void)
{
int changed;
FILE *ra_dump_file = rtl_dump_file;
@@ -907,7 +889,7 @@ reg_alloc ()
"after allocation/spilling, before reload", NULL);
/* Allocate the reg_equiv_memory_loc array for reload. */
- reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_memory_loc = xcalloc (max_regno, sizeof (rtx));
/* And possibly initialize it. */
allocate_initial_values (reg_equiv_memory_loc);
/* And one last regclass pass just before reload. */
diff --git a/gcc/ra.h b/gcc/ra.h
index dd3cb5108e8..53085e187d0 100644
--- a/gcc/ra.h
+++ b/gcc/ra.h
@@ -1,5 +1,5 @@
/* Graph coloring register allocator
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Matz <matz@suse.de>
and Daniel Berlin <dan@cgsoftware.com>.
@@ -569,63 +569,61 @@ extern int flag_ra_spill_every_use;
/* Nonzero to output all notes in the debug dumps. */
extern int flag_ra_dump_notes;
-extern inline void * ra_alloc PARAMS ((size_t));
-extern inline void * ra_calloc PARAMS ((size_t));
-extern int hard_regs_count PARAMS ((HARD_REG_SET));
-extern rtx ra_emit_move_insn PARAMS ((rtx, rtx));
-extern void ra_debug_msg PARAMS ((unsigned int,
- const char *, ...)) ATTRIBUTE_PRINTF_2;
-extern int hard_regs_intersect_p PARAMS ((HARD_REG_SET *, HARD_REG_SET *));
-extern unsigned int rtx_to_bits PARAMS ((rtx));
-extern struct web * find_subweb PARAMS ((struct web *, rtx));
-extern struct web * find_subweb_2 PARAMS ((struct web *, unsigned int));
-extern struct web * find_web_for_subweb_1 PARAMS ((struct web *));
+extern inline void * ra_alloc (size_t);
+extern inline void * ra_calloc (size_t);
+extern int hard_regs_count (HARD_REG_SET);
+extern rtx ra_emit_move_insn (rtx, rtx);
+extern void ra_debug_msg (unsigned int, const char *, ...) ATTRIBUTE_PRINTF_2;
+extern int hard_regs_intersect_p (HARD_REG_SET *, HARD_REG_SET *);
+extern unsigned int rtx_to_bits (rtx);
+extern struct web * find_subweb (struct web *, rtx);
+extern struct web * find_subweb_2 (struct web *, unsigned int);
+extern struct web * find_web_for_subweb_1 (struct web *);
#define find_web_for_subweb(w) (((w)->parent_web) \
? find_web_for_subweb_1 ((w)->parent_web) \
: (w))
-extern void ra_build_realloc PARAMS ((struct df *));
-extern void ra_build_free PARAMS ((void));
-extern void ra_build_free_all PARAMS ((struct df *));
-extern void ra_colorize_init PARAMS ((void));
-extern void ra_colorize_free_all PARAMS ((void));
-extern void ra_rewrite_init PARAMS ((void));
-
-extern void ra_print_rtx PARAMS ((FILE *, rtx, int));
-extern void ra_print_rtx_top PARAMS ((FILE *, rtx, int));
-extern void ra_debug_rtx PARAMS ((rtx));
-extern void ra_debug_insns PARAMS ((rtx, int));
-extern void ra_debug_bbi PARAMS ((int));
-extern void ra_print_rtl_with_bb PARAMS ((FILE *, rtx));
-extern void dump_igraph PARAMS ((struct df *));
-extern void dump_igraph_machine PARAMS ((void));
-extern void dump_constraints PARAMS ((void));
-extern void dump_cost PARAMS ((unsigned int));
-extern void dump_graph_cost PARAMS ((unsigned int, const char *));
-extern void dump_ra PARAMS ((struct df *));
-extern void dump_number_seen PARAMS ((void));
-extern void dump_static_insn_cost PARAMS ((FILE *, const char *,
- const char *));
-extern void dump_web_conflicts PARAMS ((struct web *));
-extern void dump_web_insns PARAMS ((struct web*));
-extern int web_conflicts_p PARAMS ((struct web *, struct web *));
-extern void debug_hard_reg_set PARAMS ((HARD_REG_SET));
-
-extern void remove_list PARAMS ((struct dlist *, struct dlist **));
-extern struct dlist * pop_list PARAMS ((struct dlist **));
-extern void record_conflict PARAMS ((struct web *, struct web *));
-extern int memref_is_stack_slot PARAMS ((rtx));
-extern void build_i_graph PARAMS ((struct df *));
-extern void put_web PARAMS ((struct web *, enum node_type));
-extern void remove_web_from_list PARAMS ((struct web *));
-extern void reset_lists PARAMS ((void));
-extern struct web * alias PARAMS ((struct web *));
-extern void merge_moves PARAMS ((struct web *, struct web *));
-extern void ra_colorize_graph PARAMS ((struct df *));
-
-extern void actual_spill PARAMS ((void));
-extern void emit_colors PARAMS ((struct df *));
-extern void delete_moves PARAMS ((void));
-extern void setup_renumber PARAMS ((int));
-extern void remove_suspicious_death_notes PARAMS ((void));
+extern void ra_build_realloc (struct df *);
+extern void ra_build_free (void);
+extern void ra_build_free_all (struct df *);
+extern void ra_colorize_init (void);
+extern void ra_colorize_free_all (void);
+extern void ra_rewrite_init (void);
+
+extern void ra_print_rtx (FILE *, rtx, int);
+extern void ra_print_rtx_top (FILE *, rtx, int);
+extern void ra_debug_rtx (rtx);
+extern void ra_debug_insns (rtx, int);
+extern void ra_debug_bbi (int);
+extern void ra_print_rtl_with_bb (FILE *, rtx);
+extern void dump_igraph (struct df *);
+extern void dump_igraph_machine (void);
+extern void dump_constraints (void);
+extern void dump_cost (unsigned int);
+extern void dump_graph_cost (unsigned int, const char *);
+extern void dump_ra (struct df *);
+extern void dump_number_seen (void);
+extern void dump_static_insn_cost (FILE *, const char *, const char *);
+extern void dump_web_conflicts (struct web *);
+extern void dump_web_insns (struct web*);
+extern int web_conflicts_p (struct web *, struct web *);
+extern void debug_hard_reg_set (HARD_REG_SET);
+
+extern void remove_list (struct dlist *, struct dlist **);
+extern struct dlist * pop_list (struct dlist **);
+extern void record_conflict (struct web *, struct web *);
+extern int memref_is_stack_slot (rtx);
+extern void build_i_graph (struct df *);
+extern void put_web (struct web *, enum node_type);
+extern void remove_web_from_list (struct web *);
+extern void reset_lists (void);
+extern struct web * alias (struct web *);
+extern void merge_moves (struct web *, struct web *);
+extern void ra_colorize_graph (struct df *);
+
+extern void actual_spill (void);
+extern void emit_colors (struct df *);
+extern void delete_moves (void);
+extern void setup_renumber (int);
+extern void remove_suspicious_death_notes (void);
diff --git a/gcc/real.c b/gcc/real.c
index 5180aec382a..827ac9dd449 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -2,7 +2,7 @@
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Stephen L. Moshier (moshier@world.std.com).
- Re-written by Richard Henderson <rth@redhat.com>
+ Re-written by Richard Henderson <rth@redhat.com>
This file is part of GCC.
@@ -31,7 +31,7 @@
#include "tm_p.h"
/* The floating point model used internally is not exactly IEEE 754
- compliant, and close to the description in the ISO C standard,
+ compliant, and close to the description in the ISO C99 standard,
section 5.2.4.2.2 Characteristics of floating types.
Specifically
@@ -49,21 +49,21 @@
significand is fractional. Normalized significands are in the
range [0.5, 1.0).
- A requirement of the model is that P be larger than than the
- largest supported target floating-point type by at least 2 bits.
- This gives us proper rounding when we truncate to the target type.
- In addition, E must be large enough to hold the smallest supported
- denormal number in a normalized form.
+ A requirement of the model is that P be larger than the largest
+ supported target floating-point type by at least 2 bits. This gives
+ us proper rounding when we truncate to the target type. In addition,
+ E must be large enough to hold the smallest supported denormal number
+ in a normalized form.
Both of these requirements are easily satisfied. The largest target
significand is 113 bits; we store at least 160. The smallest
denormal number fits in 17 exponent bits; we store 29.
Note that the decimal string conversion routines are sensitive to
- rounding error. Since the raw arithmetic routines do not themselves
+ rounding errors. Since the raw arithmetic routines do not themselves
have guard digits or rounding, the computation of 10**exp can
accumulate more than a few digits of error. The previous incarnation
- of real.c successfully used a 144 bit fraction; given the current
+ of real.c successfully used a 144-bit fraction; given the current
layout of REAL_VALUE_TYPE we're forced to expand to at least 160 bits.
Target floating point models that use base 16 instead of base 2
@@ -763,8 +763,8 @@ do_multiply (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *a,
continue;
}
+ memset (&u, 0, sizeof (u));
u.class = rvc_normal;
- u.sign = 0;
u.exp = exp;
for (k = j; k < SIGSZ * 2; k += 2)
@@ -3623,7 +3623,7 @@ const struct real_format mips_quad_format =
/* Descriptions of VAX floating point formats can be found beginning at
- http://www.openvms.compaq.com:8000/73final/4515/4515pro_013.html#f_floating_point_format
+ http://h71000.www7.hp.com/doc/73FINAL/4515/4515pro_013.html#f_floating_point_format
The thing to remember is that they're almost IEEE, except for word
order, exponent bias, and the lack of infinities, nans, and denormals.
@@ -3768,7 +3768,7 @@ decode_vax_d (const struct real_format *fmt ATTRIBUTE_UNUSED,
image0 &= 0xffffffff;
image1 &= 0xffffffff;
- exp = (image0 >> 7) & 0x7f;
+ exp = (image0 >> 7) & 0xff;
memset (r, 0, sizeof (*r));
diff --git a/gcc/real.h b/gcc/real.h
index 2b9a371f73e..4799204de56 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -322,18 +322,23 @@ extern void real_ldexp (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int);
/* **** End of software floating point emulator interface macros **** */
-/* Constant real values 0, 1, 2, -1, -2 and 0.5. */
+/* Constant real values 0, 1, 2, 3, 10, -1, -2, 0.5 and 1/3. */
extern REAL_VALUE_TYPE dconst0;
extern REAL_VALUE_TYPE dconst1;
extern REAL_VALUE_TYPE dconst2;
+extern REAL_VALUE_TYPE dconst3;
+extern REAL_VALUE_TYPE dconst10;
extern REAL_VALUE_TYPE dconstm1;
extern REAL_VALUE_TYPE dconstm2;
extern REAL_VALUE_TYPE dconsthalf;
+extern REAL_VALUE_TYPE dconstthird;
+extern REAL_VALUE_TYPE dconstpi;
+extern REAL_VALUE_TYPE dconste;
/* Function to return a real value (not a tree node)
from a given integer constant. */
-REAL_VALUE_TYPE real_value_from_int_cst (union tree_node *, union tree_node *);
+REAL_VALUE_TYPE real_value_from_int_cst (tree, tree);
/* Given a CONST_DOUBLE in FROM, store into TO the value it represents. */
#define REAL_VALUE_FROM_CONST_DOUBLE(to, from) \
diff --git a/gcc/recog.c b/gcc/recog.c
index a804669595b..02ae71d5d53 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -150,8 +150,8 @@ check_asm_operands (rtx x)
if (noperands == 0)
return 1;
- operands = (rtx *) alloca (noperands * sizeof (rtx));
- constraints = (const char **) alloca (noperands * sizeof (char *));
+ operands = alloca (noperands * sizeof (rtx));
+ constraints = alloca (noperands * sizeof (char *));
decode_asm_operands (x, operands, NULL, constraints, NULL);
@@ -226,9 +226,7 @@ validate_change (rtx object, rtx *loc, rtx new, int in_group)
else
changes_allocated *= 2;
- changes =
- (change_t*) xrealloc (changes,
- sizeof (change_t) * changes_allocated);
+ changes = xrealloc (changes, sizeof (change_t) * changes_allocated);
}
changes[num_changes].object = object;
@@ -335,7 +333,7 @@ apply_change_group (void)
{
rtx object = changes[i].object;
- /* if there is no object to test or if it is the same as the one we
+ /* If there is no object to test or if it is the same as the one we
already tested, ignore it. */
if (object == 0 || object == last_validated)
continue;
@@ -1951,7 +1949,7 @@ offsettable_address_p (int strictp, enum machine_mode mode, rtx y)
because the amount of the increment depends on the mode. */
int
-mode_dependent_address_p (rtx addr ATTRIBUTE_UNUSED /* Maybe used in GO_IF_MODE_DEPENDENT_ADDRESS. */)
+mode_dependent_address_p (rtx addr ATTRIBUTE_UNUSED /* Maybe used in GO_IF_MODE_DEPENDENT_ADDRESS. */)
{
GO_IF_MODE_DEPENDENT_ADDRESS (addr, win);
return 0;
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 299ba0e6501..f432cf1b54d 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -630,7 +630,7 @@ check_asm_stack_operands (rtx insn)
if (GET_CODE (body) == PARALLEL)
{
- clobber_reg = (rtx *) alloca (XVECLEN (body, 0) * sizeof (rtx));
+ clobber_reg = alloca (XVECLEN (body, 0) * sizeof (rtx));
for (i = 0; i < XVECLEN (body, 0); i++)
if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER)
@@ -802,7 +802,7 @@ stack_result (tree decl)
/* If the value is supposed to be returned in memory, then clearly
it is not returned in a stack register. */
- if (aggregate_value_p (DECL_RESULT (decl)))
+ if (aggregate_value_p (DECL_RESULT (decl), decl))
return 0;
result = DECL_RTL_IF_SET (DECL_RESULT (decl));
@@ -1946,9 +1946,9 @@ subst_asm_stack_regs (rtx insn, stack regstack)
for (i = 0, note = REG_NOTES (insn); note; note = XEXP (note, 1))
i++;
- note_reg = (rtx *) alloca (i * sizeof (rtx));
- note_loc = (rtx **) alloca (i * sizeof (rtx *));
- note_kind = (enum reg_note *) alloca (i * sizeof (enum reg_note));
+ note_reg = alloca (i * sizeof (rtx));
+ note_loc = alloca (i * sizeof (rtx *));
+ note_kind = alloca (i * sizeof (enum reg_note));
n_notes = 0;
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
@@ -1979,8 +1979,8 @@ subst_asm_stack_regs (rtx insn, stack regstack)
if (GET_CODE (body) == PARALLEL)
{
- clobber_reg = (rtx *) alloca (XVECLEN (body, 0) * sizeof (rtx));
- clobber_loc = (rtx **) alloca (XVECLEN (body, 0) * sizeof (rtx *));
+ clobber_reg = alloca (XVECLEN (body, 0) * sizeof (rtx));
+ clobber_loc = alloca (XVECLEN (body, 0) * sizeof (rtx *));
for (i = 0; i < XVECLEN (body, 0); i++)
if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER)
@@ -2638,11 +2638,12 @@ convert_regs_1 (FILE *file, basic_block block)
{
struct stack_def regstack;
block_info bi = BLOCK_INFO (block);
- int inserted, reg;
+ int deleted, inserted, reg;
rtx insn, next;
edge e, beste = NULL;
inserted = 0;
+ deleted = 0;
any_malformed_asm = false;
/* Find the edge we will copy stack from. It should be the most frequent
@@ -2715,6 +2716,7 @@ convert_regs_1 (FILE *file, basic_block block)
print_stack (file, &regstack);
}
subst_stack_regs (insn, &regstack);
+ deleted |= (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn));
}
}
while (next);
@@ -2754,8 +2756,23 @@ convert_regs_1 (FILE *file, basic_block block)
nan);
insn = emit_insn_after (set, insn);
subst_stack_regs (insn, &regstack);
+ deleted |= (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn));
}
}
+
+ /* Amongst the insns possibly deleted during the substitution process above,
+ might have been the only trapping insn in the block. We purge the now
+ possibly dead EH edges here to avoid an ICE from fixup_abnormal_edges,
+ called at the end of convert_regs. The order in which we process the
+ blocks ensures that we never delete an already processed edge.
+
+ ??? 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)
+ purge_dead_edges (block);
/* Something failed if the stack lives don't match. If we had malformed
asms, we zapped the instruction itself, but that didn't produce the
@@ -2800,7 +2817,11 @@ convert_regs_2 (FILE *file, basic_block block)
basic_block *stack, *sp;
int inserted;
- stack = (basic_block *) xmalloc (sizeof (*stack) * n_basic_blocks);
+ /* We process the blocks in a top-down manner, in a way such that one block
+ is only processed after all its predecessors. The number of predecessors
+ of every block has already been computed. */
+
+ stack = xmalloc (sizeof (*stack) * n_basic_blocks);
sp = stack;
*sp++ = block;
@@ -2811,9 +2832,13 @@ convert_regs_2 (FILE *file, basic_block block)
edge e;
block = *--sp;
- inserted |= convert_regs_1 (file, block);
- BLOCK_INFO (block)->done = 1;
+ /* Processing "block" is achieved by convert_regs_1, which may purge
+ some dead EH outgoing edge after the possible deletion of the
+ trapping insn inside the block. Since the number of predecessors of
+ "block"'s successors has been computed based on the initial edge set,
+ we check for the possiblity to process some of these successors
+ before such an edge deletion may happen. */
for (e = block->succ; e ; e = e->succ_next)
if (! (e->flags & EDGE_DFS_BACK))
{
@@ -2821,6 +2846,9 @@ convert_regs_2 (FILE *file, basic_block block)
if (!BLOCK_INFO (e->dest)->predecessors)
*sp++ = e->dest;
}
+
+ inserted |= convert_regs_1 (file, block);
+ BLOCK_INFO (block)->done = 1;
}
while (sp != stack);
diff --git a/gcc/regclass.c b/gcc/regclass.c
index c24dfd4c952..9c496b6afdc 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -46,7 +46,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "timevar.h"
static void init_reg_sets_1 (void);
-static void init_reg_modes (void);
static void init_reg_autoinc (void);
/* If we have auto-increment or auto-decrement and we can have secondary
@@ -311,7 +310,7 @@ init_reg_sets_1 (void)
/* Compute number of hard regs in each class. */
- memset ((char *) reg_class_size, 0, sizeof reg_class_size);
+ memset (reg_class_size, 0, sizeof reg_class_size);
for (i = 0; i < N_REG_CLASSES; i++)
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
@@ -340,7 +339,7 @@ init_reg_sets_1 (void)
continue;
subclass1:
- /* keep the largest subclass */ /* SPEE 900308 */
+ /* Keep the largest subclass. */ /* SPEE 900308 */
GO_IF_HARD_REG_SUBSET (reg_class_contents[k],
reg_class_contents[(int) reg_class_subunion[i][j]],
subclass2);
@@ -546,14 +545,14 @@ init_reg_sets_1 (void)
These values are used to record death information for individual registers
(as opposed to a multi-register mode). */
-static void
-init_reg_modes (void)
+void
+init_reg_modes_once (void)
{
int i;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
- reg_raw_mode[i] = choose_hard_reg_mode (i, 1);
+ reg_raw_mode[i] = choose_hard_reg_mode (i, 1, false);
/* If we couldn't find a valid mode, just use the previous mode.
??? One situation in which we need to do this is on the mips where
@@ -575,8 +574,6 @@ init_regs (void)
until after register usage was specified. */
init_reg_sets_1 ();
- init_reg_modes ();
-
init_reg_autoinc ();
}
@@ -653,11 +650,12 @@ memory_move_secondary_cost (enum machine_mode mode, enum reg_class class, int in
#endif
/* Return a machine mode that is legitimate for hard reg REGNO and large
- enough to save nregs. If we can't find one, return VOIDmode. */
+ enough to save nregs. If we can't find one, return VOIDmode.
+ If CALL_SAVED is true, only consider modes that are call saved. */
enum machine_mode
choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
- unsigned int nregs)
+ unsigned int nregs, bool call_saved)
{
unsigned int /* enum machine_mode */ m;
enum machine_mode found_mode = VOIDmode, mode;
@@ -670,7 +668,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
- && HARD_REGNO_MODE_OK (regno, mode))
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
@@ -680,7 +679,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
- && HARD_REGNO_MODE_OK (regno, mode))
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
@@ -690,7 +690,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
- && HARD_REGNO_MODE_OK (regno, mode))
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
@@ -700,7 +701,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
- && HARD_REGNO_MODE_OK (regno, mode))
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
@@ -711,7 +713,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
{
mode = (enum machine_mode) m;
if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
- && HARD_REGNO_MODE_OK (regno, mode))
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
return mode;
}
@@ -1196,11 +1199,11 @@ regclass (rtx f, int nregs, FILE *dump)
init_recog ();
- costs = (struct costs *) xmalloc (nregs * sizeof (struct costs));
+ costs = xmalloc (nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
- in_inc_dec = (char *) xmalloc (nregs);
+ in_inc_dec = xmalloc (nregs);
#endif /* FORBIDDEN_INC_DEC_CLASSES */
@@ -1217,7 +1220,7 @@ regclass (rtx f, int nregs, FILE *dump)
fprintf (dump, "\n\nPass %i\n\n",pass);
/* Zero out our accumulation of the cost of each class for each reg. */
- memset ((char *) costs, 0, nregs * sizeof (struct costs));
+ memset (costs, 0, nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
memset (in_inc_dec, 0, nregs);
@@ -1417,7 +1420,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
if (*p == 0)
{
if (GET_CODE (op) == REG && REGNO (op) >= FIRST_PSEUDO_REGISTER)
- memset ((char *) &this_op_costs[i], 0, sizeof this_op_costs[i]);
+ memset (&this_op_costs[i], 0, sizeof this_op_costs[i]);
continue;
}
@@ -2150,42 +2153,42 @@ allocate_reg_info (size_t num_regs, int new_p, int renumber_p)
{
size_t old_allocated = regno_allocated;
- regno_allocated = num_regs + (num_regs / 20); /* add some slop space */
+ regno_allocated = num_regs + (num_regs / 20); /* Add some slop space. */
size_renumber = regno_allocated * sizeof (short);
if (!reg_n_info)
{
VARRAY_REG_INIT (reg_n_info, regno_allocated, "reg_n_info");
- renumber = (short *) xmalloc (size_renumber);
- reg_pref_buffer = (struct reg_pref *) xmalloc (regno_allocated
- * sizeof (struct reg_pref));
+ renumber = xmalloc (size_renumber);
+ reg_pref_buffer = xmalloc (regno_allocated
+ * sizeof (struct reg_pref));
}
else
{
VARRAY_GROW (reg_n_info, regno_allocated);
- if (new_p) /* if we're zapping everything, no need to realloc */
+ if (new_p) /* If we're zapping everything, no need to realloc. */
{
free ((char *) renumber);
free ((char *) reg_pref);
- renumber = (short *) xmalloc (size_renumber);
- reg_pref_buffer = (struct reg_pref *) xmalloc (regno_allocated
- * sizeof (struct reg_pref));
+ renumber = xmalloc (size_renumber);
+ reg_pref_buffer = xmalloc (regno_allocated
+ * sizeof (struct reg_pref));
}
else
{
- renumber = (short *) xrealloc ((char *) renumber, size_renumber);
- reg_pref_buffer = (struct reg_pref *) xrealloc ((char *) reg_pref_buffer,
- regno_allocated
- * sizeof (struct reg_pref));
+ renumber = xrealloc (renumber, size_renumber);
+ reg_pref_buffer = xrealloc (reg_pref_buffer,
+ regno_allocated
+ * sizeof (struct reg_pref));
}
}
size_info = (regno_allocated - old_allocated) * sizeof (reg_info)
+ sizeof (struct reg_info_data) - sizeof (reg_info);
- reg_data = (struct reg_info_data *) xcalloc (size_info, 1);
+ reg_data = xcalloc (size_info, 1);
reg_data->min_index = old_allocated;
reg_data->max_index = regno_allocated - 1;
reg_data->next = reg_info_head;
@@ -2215,8 +2218,8 @@ allocate_reg_info (size_t num_regs, int new_p, int renumber_p)
if (!reg_data->used_p) /* page just allocated with calloc */
reg_data->used_p = 1; /* no need to zero */
else
- memset ((char *) &reg_data->data[local_min], 0,
- sizeof (reg_info) * (max - min_index - local_min + 1));
+ memset (&reg_data->data[local_min], 0,
+ sizeof (reg_info) * (max - min_index - local_min + 1));
for (i = min_index+local_min; i <= max; i++)
{
diff --git a/gcc/regmove.c b/gcc/regmove.c
index cfc45f4ee53..9205e1f88bd 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -1055,10 +1055,10 @@ regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file)
can suppress some optimizations in those zones. */
mark_flags_life_zones (discover_flags_reg ());
- regno_src_regno = (int *) xmalloc (sizeof *regno_src_regno * nregs);
+ regno_src_regno = xmalloc (sizeof *regno_src_regno * nregs);
for (i = nregs; --i >= 0; ) regno_src_regno[i] = -1;
- regmove_bb_head = (int *) xmalloc (sizeof (int) * (old_max_uid + 1));
+ 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;
@@ -2032,7 +2032,7 @@ fixup_match_1 (rtx insn, rtx set, rtx src, rtx src_subreg, rtx dst,
}
-/* return nonzero if X is stable and mentions no registers but for
+/* Return nonzero if X is stable and mentions no registers but for
mentioning SRC or mentioning / changing DST . If in doubt, presume
it is unstable.
The rationale is that we want to check if we can move an insn easily
@@ -2064,7 +2064,7 @@ stable_and_no_regs_but_for_p (rtx x, rtx src, rtx dst)
if (code == MEM
&& ! stable_and_no_regs_but_for_p (XEXP (x, 0), src, dst))
return 0;
- /* fall through */
+ /* Fall through. */
default:
return ! rtx_unstable_p (x);
}
@@ -2198,7 +2198,7 @@ record_one_stack_memref (rtx insn, rtx *mem, struct csa_memlist *next_memlist)
{
struct csa_memlist *ml;
- ml = (struct csa_memlist *) xmalloc (sizeof (*ml));
+ ml = xmalloc (sizeof (*ml));
if (XEXP (*mem, 0) == stack_pointer_rtx)
ml->sp_offset = 0;
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 719db5841b3..c1ff6255316 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -194,7 +194,7 @@ regrename_optimize (void)
memset (tick, 0, sizeof tick);
gcc_obstack_init (&rename_obstack);
- first_obj = (char *) obstack_alloc (&rename_obstack, 0);
+ first_obj = obstack_alloc (&rename_obstack, 0);
FOR_EACH_BB (bb)
{
@@ -395,8 +395,8 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class class,
{
if (type == OP_OUT)
{
- struct du_chain *this = (struct du_chain *)
- obstack_alloc (&rename_obstack, sizeof (struct du_chain));
+ struct du_chain *this
+ = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0;
this->next_chain = open_chains;
this->loc = loc;
@@ -450,8 +450,7 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class class,
be replaced with, terminate the chain. */
if (class != NO_REGS)
{
- this = (struct du_chain *)
- obstack_alloc (&rename_obstack, sizeof (struct du_chain));
+ this = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0;
this->next_chain = (*p)->next_chain;
this->loc = loc;
diff --git a/gcc/regs.h b/gcc/regs.h
index 2206fdcdeb7..b2aeb5fb02c 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -210,7 +210,7 @@ extern int caller_save_needed;
/* Select a register mode required for caller save of hard regno REGNO. */
#ifndef HARD_REGNO_CALLER_SAVE_MODE
#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
- choose_hard_reg_mode (REGNO, NREGS)
+ choose_hard_reg_mode (REGNO, NREGS, false)
#endif
/* Registers that get partially clobbered by a call in a given mode.
diff --git a/gcc/reload.c b/gcc/reload.c
index a12af45f2aa..dc088730e67 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -651,7 +651,7 @@ get_secondary_mem (rtx x ATTRIBUTE_UNUSED, enum machine_mode mode,
void
clear_secondary_mem (void)
{
- memset ((char *) secondary_memlocs, 0, sizeof secondary_memlocs);
+ memset (secondary_memlocs, 0, sizeof secondary_memlocs);
}
#endif /* SECONDARY_MEMORY_NEEDED */
@@ -2539,7 +2539,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
/* The eliminated forms of any secondary memory locations are per-insn, so
clear them out here. */
- memset ((char *) secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim);
+ memset (secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim);
#endif
/* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it
diff --git a/gcc/reload1.c b/gcc/reload1.c
index fadc6d30281..37cc4b28092 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -281,12 +281,6 @@ static char *reload_insn_firstobj;
examine. */
struct insn_chain *reload_insn_chain;
-#ifdef TREE_CODE
-extern tree current_function_decl;
-#else
-extern union tree_node *current_function_decl;
-#endif
-
/* List of all insns needing reloads. */
static struct insn_chain *insns_need_reload;
@@ -481,7 +475,7 @@ init_reload (void)
/* Initialize obstack for our rtl allocation. */
gcc_obstack_init (&reload_obstack);
- reload_startobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_startobj = obstack_alloc (&reload_obstack, 0);
INIT_REG_SET (&spilled_pseudos);
INIT_REG_SET (&pseudos_counted);
@@ -498,8 +492,7 @@ new_insn_chain (void)
if (unused_insn_chains == 0)
{
- c = (struct insn_chain *)
- obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
+ c = obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
INIT_REG_SET (&c->live_throughout);
INIT_REG_SET (&c->dead_or_set);
}
@@ -644,7 +637,7 @@ reload (rtx first, int global)
failure = 0;
- reload_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_firstobj = obstack_alloc (&reload_obstack, 0);
/* Make sure that the last insn in the chain
is not something that needs reloading. */
@@ -659,8 +652,8 @@ reload (rtx first, int global)
#endif
/* We don't have a stack slot for any spill reg yet. */
- memset ((char *) spill_stack_slot, 0, sizeof spill_stack_slot);
- memset ((char *) spill_stack_slot_width, 0, sizeof spill_stack_slot_width);
+ memset (spill_stack_slot, 0, sizeof spill_stack_slot);
+ memset (spill_stack_slot_width, 0, sizeof spill_stack_slot_width);
/* Initialize the save area information for caller-save, in case some
are needed. */
@@ -690,17 +683,15 @@ reload (rtx first, int global)
Record memory equivalents in reg_mem_equiv so they can
be substituted eventually by altering the REG-rtx's. */
- reg_equiv_constant = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_equiv_mem = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_equiv_init = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_equiv_address = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_max_ref_width = (unsigned int *) xcalloc (max_regno, sizeof (int));
- reg_old_renumber = (short *) xcalloc (max_regno, sizeof (short));
+ reg_equiv_constant = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_mem = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_init = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_address = xcalloc (max_regno, sizeof (rtx));
+ reg_max_ref_width = xcalloc (max_regno, sizeof (int));
+ reg_old_renumber = xcalloc (max_regno, sizeof (short));
memcpy (reg_old_renumber, reg_renumber, max_regno * sizeof (short));
- pseudo_forbidden_regs
- = (HARD_REG_SET *) xmalloc (max_regno * sizeof (HARD_REG_SET));
- pseudo_previous_regs
- = (HARD_REG_SET *) xcalloc (max_regno, sizeof (HARD_REG_SET));
+ pseudo_forbidden_regs = xmalloc (max_regno * sizeof (HARD_REG_SET));
+ pseudo_previous_regs = xcalloc (max_regno, sizeof (HARD_REG_SET));
CLEAR_HARD_REG_SET (bad_spill_regs_global);
@@ -825,9 +816,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
- = (int (*)[NUM_ELIMINABLE_REGS])
- xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int));
+ offsets_at = xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int));
/* Alter each pseudo-reg rtx to contain its hard reg number.
Assign stack slots to the pseudos that lack hard regs or equivalents.
@@ -959,7 +948,7 @@ reload (rtx first, int global)
{
save_call_clobbered_regs ();
/* That might have allocated new insn_chain structures. */
- reload_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_firstobj = obstack_alloc (&reload_obstack, 0);
}
calculate_needs_all_insns (global);
@@ -1387,11 +1376,10 @@ static void
copy_reloads (struct insn_chain *chain)
{
chain->n_reloads = n_reloads;
- chain->rld
- = (struct reload *) obstack_alloc (&reload_obstack,
- n_reloads * sizeof (struct reload));
+ chain->rld = obstack_alloc (&reload_obstack,
+ n_reloads * sizeof (struct reload));
memcpy (chain->rld, rld, n_reloads * sizeof (struct reload));
- reload_insn_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_insn_firstobj = obstack_alloc (&reload_obstack, 0);
}
/* Walk the chain of insns, and determine for each whether it needs reloads
@@ -1405,7 +1393,7 @@ calculate_needs_all_insns (int global)
something_needs_elimination = 0;
- reload_insn_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_insn_firstobj = obstack_alloc (&reload_obstack, 0);
for (chain = reload_insn_chain; chain != 0; chain = next)
{
rtx insn = chain->insn;
@@ -3448,8 +3436,7 @@ init_elim_table (void)
#endif
if (!reg_eliminate)
- reg_eliminate = (struct elim_table *)
- xcalloc (sizeof (struct elim_table), NUM_ELIMINABLE_REGS);
+ reg_eliminate = xcalloc (sizeof (struct elim_table), NUM_ELIMINABLE_REGS);
/* Does this function require a frame pointer? */
@@ -3595,7 +3582,7 @@ finish_spills (int global)
/* Retry global register allocation if possible. */
if (global)
{
- memset ((char *) pseudo_forbidden_regs, 0, max_regno * sizeof (HARD_REG_SET));
+ memset (pseudo_forbidden_regs, 0, max_regno * sizeof (HARD_REG_SET));
/* For every insn that needs reloads, set the registers used as spill
regs in pseudo_forbidden_regs for every pseudo live across the
insn. */
@@ -3765,10 +3752,10 @@ reload_as_needed (int live_known)
#endif
rtx x;
- memset ((char *) spill_reg_rtx, 0, sizeof spill_reg_rtx);
- memset ((char *) spill_reg_store, 0, sizeof spill_reg_store);
- reg_last_reload_reg = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_has_output_reload = (char *) xmalloc (max_regno);
+ memset (spill_reg_rtx, 0, sizeof spill_reg_rtx);
+ memset (spill_reg_store, 0, sizeof spill_reg_store);
+ reg_last_reload_reg = xcalloc (max_regno, sizeof (rtx));
+ reg_has_output_reload = xmalloc (max_regno);
CLEAR_HARD_REG_SET (reg_reloaded_valid);
set_initial_elim_offsets ();
@@ -5162,8 +5149,8 @@ choose_reload_regs_init (struct insn_chain *chain, rtx *save_reload_reg_rtx)
rld[i].reg_rtx = save_reload_reg_rtx[i];
memset (reload_inherited, 0, MAX_RELOADS);
- memset ((char *) reload_inheritance_insn, 0, MAX_RELOADS * sizeof (rtx));
- memset ((char *) reload_override_in, 0, MAX_RELOADS * sizeof (rtx));
+ memset (reload_inheritance_insn, 0, MAX_RELOADS * sizeof (rtx));
+ memset (reload_override_in, 0, MAX_RELOADS * sizeof (rtx));
CLEAR_HARD_REG_SET (reload_reg_used);
CLEAR_HARD_REG_SET (reload_reg_used_at_all);
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 9a7c05bc7f1..6a13fe0634b 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -235,6 +235,12 @@ stop_search_p (rtx insn, int labels_p)
if (insn == 0)
return 1;
+ /* If the insn can throw an exception that is caught within the function,
+ it may effectively perform a jump from the viewpoint of the function.
+ Therefore act like for a jump. */
+ if (can_throw_internal (insn))
+ return 1;
+
switch (GET_CODE (insn))
{
case NOTE:
@@ -3587,7 +3593,7 @@ dbr_schedule (rtx first, FILE *file)
epilogue_insn = insn;
}
- uid_to_ruid = (int *) xmalloc ((max_uid + 1) * sizeof (int));
+ uid_to_ruid = xmalloc ((max_uid + 1) * sizeof (int));
for (i = 0, insn = first; insn; i++, insn = NEXT_INSN (insn))
uid_to_ruid[INSN_UID (insn)] = i;
@@ -3595,7 +3601,7 @@ dbr_schedule (rtx first, FILE *file)
if (unfilled_firstobj == 0)
{
gcc_obstack_init (&unfilled_slots_obstack);
- unfilled_firstobj = (rtx *) obstack_alloc (&unfilled_slots_obstack, 0);
+ unfilled_firstobj = obstack_alloc (&unfilled_slots_obstack, 0);
}
for (insn = next_active_insn (first); insn; insn = next_active_insn (insn))
@@ -3629,8 +3635,8 @@ dbr_schedule (rtx first, FILE *file)
end_of_function_label = 0;
/* Initialize the statistics for this function. */
- memset ((char *) num_insns_needing_delays, 0, sizeof num_insns_needing_delays);
- memset ((char *) num_filled_delays, 0, sizeof num_filled_delays);
+ memset (num_insns_needing_delays, 0, sizeof num_insns_needing_delays);
+ memset (num_filled_delays, 0, sizeof num_filled_delays);
/* Now do the delay slot filling. Try everything twice in case earlier
changes make more slots fillable. */
@@ -3670,7 +3676,7 @@ dbr_schedule (rtx first, FILE *file)
obstack_free (&unfilled_slots_obstack, unfilled_firstobj);
/* It is not clear why the line below is needed, but it does seem to be. */
- unfilled_firstobj = (rtx *) obstack_alloc (&unfilled_slots_obstack, 0);
+ unfilled_firstobj = obstack_alloc (&unfilled_slots_obstack, 0);
if (file)
{
@@ -3703,8 +3709,8 @@ dbr_schedule (rtx first, FILE *file)
fprintf (file, "\n");
}
}
- memset ((char *) total_delay_slots, 0, sizeof total_delay_slots);
- memset ((char *) total_annul_slots, 0, sizeof total_annul_slots);
+ memset (total_delay_slots, 0, sizeof total_delay_slots);
+ memset (total_annul_slots, 0, sizeof total_annul_slots);
for (insn = first; insn; insn = NEXT_INSN (insn))
{
if (! INSN_DELETED_P (insn)
diff --git a/gcc/resource.c b/gcc/resource.c
index 4d4cc6be50f..2aab94c525d 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -947,7 +947,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
{
/* Allocate a place to put our results and chain it into the
hash table. */
- tinfo = (struct target_info *) xmalloc (sizeof (struct target_info));
+ tinfo = xmalloc (sizeof (struct target_info));
tinfo->uid = INSN_UID (target);
tinfo->block = b;
tinfo->next
@@ -1223,9 +1223,8 @@ init_resource_info (rtx epilogue_insn)
MARK_SRC_DEST_CALL);
/* Allocate and initialize the tables used by mark_target_live_regs. */
- target_hash_table = (struct target_info **)
- xcalloc (TARGET_HASH_PRIME, sizeof (struct target_info *));
- bb_ticks = (int *) xcalloc (last_basic_block, sizeof (int));
+ target_hash_table = xcalloc (TARGET_HASH_PRIME, sizeof (struct target_info *));
+ bb_ticks = xcalloc (last_basic_block, sizeof (int));
}
/* Free up the resources allocated to mark_target_live_regs (). This
diff --git a/gcc/rtl.c b/gcc/rtl.c
index a92ca4b502e..54b7476c738 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -228,7 +228,7 @@ const char * const reg_note_name[] =
"REG_RETVAL", "REG_LIBCALL", "REG_NONNEG",
"REG_NO_CONFLICT", "REG_UNUSED", "REG_CC_SETTER", "REG_CC_USER",
"REG_LABEL", "REG_DEP_ANTI", "REG_DEP_OUTPUT", "REG_BR_PROB",
- "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED",
+ "REG_VALUE_PROFILE", "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED",
"REG_FRAME_RELATED_EXPR", "REG_EH_CONTEXT", "REG_EH_REGION",
"REG_SAVE_NOTE", "REG_MAYBE_DEAD", "REG_NORETURN",
"REG_NON_LOCAL_GOTO", "REG_SETJMP", "REG_ALWAYS_RETURN",
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 54b6940e780..3f5bcef90df 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -631,10 +631,8 @@ DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", 'x')
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.
- 8-9: padding so that notes and insns are the same size, and thus
- allocated from the same page ordering. */
-DEF_RTL_EXPR(NOTE, "note", "iuuB0ni00", 'x')
+ 7: unique number if line number == note_insn_deleted_label. */
+DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", 'x')
/* ----------------------------------------------------------------------
Top level constituents of INSN, JUMP_INSN and CALL_INSN.
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 065e03ca807..fb1922a3b9d 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -684,6 +684,11 @@ enum reg_note
return. */
REG_BR_PROB,
+ /* REG_VALUE_PROFILE is attached when the profile is read in to an insn
+ before that the code to profile the value is inserted. It contains
+ the results of profiling. */
+ REG_VALUE_PROFILE,
+
/* Attached to a call insn; indicates that the call is malloc-like and
that the pointer returned cannot alias anything else. */
REG_NOALIAS,
@@ -1544,6 +1549,8 @@ extern rtx prev_cc0_setter (rtx);
extern tree choose_inner_scope (tree, tree);
extern int insn_line (rtx);
extern const char * insn_file (rtx);
+extern int locator_line (int);
+extern const char * locator_file (int);
extern int prologue_locator, epilogue_locator;
/* In jump.c */
@@ -1602,7 +1609,8 @@ extern rtx avoid_constant_pool_reference (rtx);
extern rtx gen_mem_addressof (rtx, tree, int);
/* In regclass.c */
-extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int);
+extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int,
+ bool);
/* In emit-rtl.c */
extern rtx set_unique_reg_note (rtx, enum reg_note, rtx);
@@ -1808,8 +1816,6 @@ extern GTY(()) rtx global_rtl[GR_MAX];
#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
extern GTY(()) rtx pic_offset_table_rtx;
-extern GTY(()) rtx struct_value_rtx;
-extern GTY(()) rtx struct_value_incoming_rtx;
extern GTY(()) rtx static_chain_rtx;
extern GTY(()) rtx static_chain_incoming_rtx;
extern GTY(()) rtx return_address_pointer_rtx;
@@ -1903,6 +1909,7 @@ extern rtx gen_lowpart_SUBREG (enum machine_mode, rtx);
#define INVALID_REGNUM (~(unsigned int) 0)
extern rtx output_constant_def (tree, int);
+extern rtx lookup_constant_def (tree);
/* Called from integrate.c when a deferred constant is inlined. */
extern void notice_rtl_inlining_of_deferred_constant (void);
@@ -2140,6 +2147,7 @@ extern void build_insn_chain (rtx);
extern int reg_classes_intersect_p (enum reg_class, enum reg_class);
extern int reg_class_subset_p (enum reg_class, enum reg_class);
extern void globalize_reg (int);
+extern void init_reg_modes_once (void);
extern void init_regs (void);
extern void init_fake_stack_mems (void);
extern void init_reg_sets (void);
@@ -2245,6 +2253,7 @@ extern int canon_true_dependence (rtx, enum machine_mode, rtx, rtx,
extern int read_dependence (rtx, rtx);
extern int anti_dependence (rtx, rtx);
extern int output_dependence (rtx, rtx);
+extern int unchanging_anti_dependence (rtx, rtx);
extern void mark_constant_function (void);
extern void init_alias_once (void);
extern void init_alias_analysis (void);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index a7d410267d6..6509f4f92bf 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2388,9 +2388,7 @@ may_trap_p (rtx x)
|| (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
&& flag_trapping_math))
return 1;
- /* This was const0_rtx, but by not using that,
- we can link this file into other programs. */
- if (GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) == 0)
+ if (XEXP (x, 1) == const0_rtx)
return 1;
break;
@@ -2795,26 +2793,25 @@ rtx_referenced_p (rtx x, rtx body)
return for_each_rtx (&body, rtx_referenced_p_1, x);
}
-/* If INSN is a jump to jumptable insn rturn true and store the label (which
- INSN jumps to) to *LABEL and the tablejump insn to *TABLE.
- LABEL and TABLE may be NULL. */
+/* If INSN is a tablejump return true and store the label (before jump table) to
+ *LABELP and the jump table to *TABLEP. LABELP and TABLEP may be NULL. */
bool
-tablejump_p (rtx insn, rtx *label, rtx *table)
+tablejump_p (rtx insn, rtx *labelp, rtx *tablep)
{
- rtx l, t;
+ rtx label, table;
- if (onlyjump_p (insn)
- && (l = JUMP_LABEL (insn)) != NULL_RTX
- && (t = NEXT_INSN (l)) != NULL_RTX
- && GET_CODE (t) == JUMP_INSN
- && (GET_CODE (PATTERN (t)) == ADDR_VEC
- || GET_CODE (PATTERN (t)) == ADDR_DIFF_VEC))
+ if (GET_CODE (insn) == JUMP_INSN
+ && (label = JUMP_LABEL (insn)) != NULL_RTX
+ && (table = next_active_insn (label)) != NULL_RTX
+ && GET_CODE (table) == JUMP_INSN
+ && (GET_CODE (PATTERN (table)) == ADDR_VEC
+ || GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC))
{
- if (label)
- *label = l;
- if (table)
- *table = t;
+ if (labelp)
+ *labelp = label;
+ if (tablep)
+ *tablep = table;
return true;
}
return false;
@@ -3312,7 +3309,7 @@ subreg_offset_representable_p (unsigned int xregno, enum machine_mode xmode,
#endif
/* The XMODE value can be seen as a vector of NREGS_XMODE
- values. The subreg must represent an lowpart of given field.
+ values. The subreg must represent a lowpart of given field.
Compute what field it is. */
offset -= subreg_lowpart_offset (ymode,
mode_for_size (GET_MODE_BITSIZE (xmode)
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index 508eca3eabe..3cec45de627 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -41,7 +41,7 @@ sbitmap_alloc (unsigned int n_elms)
bytes = size * sizeof (SBITMAP_ELT_TYPE);
amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE));
- bmap = (sbitmap) xmalloc (amt);
+ bmap = xmalloc (amt);
bmap->n_bits = n_elms;
bmap->size = size;
bmap->bytes = bytes;
@@ -64,7 +64,7 @@ sbitmap_resize (sbitmap bmap, unsigned int n_elms, int def)
{
amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE));
- bmap = (sbitmap) xrealloc (bmap, amt);
+ bmap = xrealloc (bmap, amt);
}
if (n_elms > bmap->n_bits)
@@ -130,7 +130,7 @@ sbitmap_vector_alloc (unsigned int n_vecs, unsigned int n_elms)
}
amt = vector_bytes + (n_vecs * elm_bytes);
- bitmap_vector = (sbitmap *) xmalloc (amt);
+ bitmap_vector = xmalloc (amt);
for (i = 0, offset = vector_bytes; i < n_vecs; i++, offset += elm_bytes)
{
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index cb85feaae38..477203caa22 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -625,6 +625,9 @@ sched_analyze_2 (struct deps *deps, rtx x, rtx insn)
case CC0:
/* User of CC0 depends on immediately preceding insn. */
set_sched_group_p (insn);
+ /* Don't move CC0 setter to another block (it can set up the
+ same flag for previous CC0 users which is safe). */
+ CANT_MOVE (prev_nonnote_insn (insn)) = 1;
return;
#endif
@@ -864,12 +867,14 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn, rtx loop_notes)
else
{
rtx pending, pending_mem;
- regset_head tmp;
- INIT_REG_SET (&tmp);
+ regset_head tmp_uses, tmp_sets;
+ INIT_REG_SET (&tmp_uses);
+ INIT_REG_SET (&tmp_sets);
- (*current_sched_info->compute_jump_reg_dependencies) (insn, &tmp);
+ (*current_sched_info->compute_jump_reg_dependencies)
+ (insn, &deps->reg_conditional_sets, &tmp_uses, &tmp_sets);
/* Make latency of jump equal to 0 by using anti-dependence. */
- EXECUTE_IF_SET_IN_REG_SET (&tmp, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (&tmp_uses, 0, i,
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->sets, REG_DEP_ANTI);
@@ -877,7 +882,10 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn, rtx loop_notes)
reg_last->uses_length++;
reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
});
- CLEAR_REG_SET (&tmp);
+ IOR_REG_SET (reg_pending_sets, &tmp_sets);
+
+ CLEAR_REG_SET (&tmp_uses);
+ CLEAR_REG_SET (&tmp_sets);
/* All memory writes and volatile reads must happen before the
jump. Non-volatile reads must happen before the jump iff
@@ -984,6 +992,7 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn, rtx loop_notes)
}
flush_pending_lists (deps, insn, true, true);
+ CLEAR_REG_SET (&deps->reg_conditional_sets);
reg_pending_barrier = NOT_A_BARRIER;
}
else
@@ -1015,6 +1024,7 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn, rtx loop_notes)
add_dependence_list (insn, reg_last->clobbers, REG_DEP_OUTPUT);
add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
reg_last->sets = alloc_INSN_LIST (insn, reg_last->sets);
+ SET_REGNO_REG_SET (&deps->reg_conditional_sets, i);
});
}
else
@@ -1063,6 +1073,7 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn, rtx loop_notes)
reg_last->sets = alloc_INSN_LIST (insn, reg_last->sets);
reg_last->uses_length = 0;
reg_last->clobbers_length = 0;
+ CLEAR_REGNO_REG_SET (&deps->reg_conditional_sets, i);
});
}
@@ -1382,9 +1393,9 @@ init_deps (struct deps *deps)
int max_reg = (reload_completed ? FIRST_PSEUDO_REGISTER : max_reg_num ());
deps->max_reg = max_reg;
- deps->reg_last = (struct deps_reg *)
- xcalloc (max_reg, sizeof (struct deps_reg));
+ deps->reg_last = xcalloc (max_reg, sizeof (struct deps_reg));
INIT_REG_SET (&deps->reg_last_in_use);
+ INIT_REG_SET (&deps->reg_conditional_sets);
deps->pending_read_insns = 0;
deps->pending_read_mems = 0;
@@ -1426,6 +1437,7 @@ free_deps (struct deps *deps)
free_INSN_LIST_list (&reg_last->clobbers);
});
CLEAR_REG_SET (&deps->reg_last_in_use);
+ CLEAR_REG_SET (&deps->reg_conditional_sets);
free (deps->reg_last);
}
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 0e316b51d66..dd9ec63e7b9 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -55,7 +55,7 @@ static int schedule_more_p (void);
static const char *ebb_print_insn (rtx, int);
static int rank (rtx, rtx);
static int contributes_to_priority (rtx, rtx);
-static void compute_jump_reg_dependencies (rtx, regset);
+static void compute_jump_reg_dependencies (rtx, regset, regset, regset);
static basic_block earliest_block_with_similiar_load (basic_block, rtx);
static void add_deps_for_risky_insns (rtx, rtx);
static basic_block schedule_ebb (rtx, rtx);
@@ -163,20 +163,29 @@ contributes_to_priority (rtx next ATTRIBUTE_UNUSED,
return 1;
}
-/* INSN is a JUMP_INSN. Store the set of registers that must be considered
- to be set by this jump in SET. */
+ /* INSN is a JUMP_INSN, COND_SET is the set of registers that are
+ conditionally set before INSN. Store the set of registers that
+ must be considered as used by this jump in USED and that of
+ registers that must be considered as set in SET. */
static void
-compute_jump_reg_dependencies (rtx insn, regset set)
+compute_jump_reg_dependencies (rtx insn, regset cond_set, regset used,
+ regset set)
{
basic_block b = BLOCK_FOR_INSN (insn);
edge e;
for (e = b->succ; e; e = e->succ_next)
- if ((e->flags & EDGE_FALLTHRU) == 0)
- {
- bitmap_operation (set, set, e->dest->global_live_at_start,
- BITMAP_IOR);
- }
+ if (e->flags & EDGE_FALLTHRU)
+ /* The jump may be a by-product of a branch that has been merged
+ in the main codepath after being conditionalized. Therefore
+ it may guard the fallthrough block from using a value that has
+ conditionally overwritten that of the main codepath. So we
+ consider that it restores the value of the main codepath. */
+ bitmap_operation (set, e->dest->global_live_at_start, cond_set,
+ BITMAP_AND);
+ else
+ bitmap_operation (used, used, e->dest->global_live_at_start,
+ BITMAP_IOR);
}
/* Used in schedule_insns to initialize current_sched_info for scheduling
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 0ab0d65aee4..8c3a4056342 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -112,6 +112,9 @@ struct deps
/* Element N is set for each register that has any nonzero element
in reg_last[N].{uses,sets,clobbers}. */
regset_head reg_last_in_use;
+
+ /* Element N is set for each register that is conditionally set. */
+ regset_head reg_conditional_sets;
};
/* This structure holds some state of the current scheduling pass, and
@@ -148,7 +151,7 @@ struct sched_info
/* Called when computing dependencies for a JUMP_INSN. This function
should store the set of registers that must be considered as set by
the jump in the regset. */
- void (*compute_jump_reg_dependencies) (rtx, regset);
+ void (*compute_jump_reg_dependencies) (rtx, regset, regset, regset);
/* The boundaries of the set of insns to be scheduled. */
rtx prev_head, next_tail;
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index cebb389dd5b..f3444ec8991 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -398,9 +398,9 @@ build_control_flow (struct edge_list *edge_list)
}
/* ??? We can kill these soon. */
- in_edges = (int *) xcalloc (last_basic_block, sizeof (int));
- out_edges = (int *) xcalloc (last_basic_block, sizeof (int));
- edge_table = (haifa_edge *) xcalloc (num_edges, sizeof (haifa_edge));
+ in_edges = xcalloc (last_basic_block, sizeof (int));
+ out_edges = xcalloc (last_basic_block, sizeof (int));
+ edge_table = xcalloc (num_edges, sizeof (haifa_edge));
nr_edges = 0;
for (i = 0; i < num_edges; i++)
@@ -618,7 +618,8 @@ find_rgns (struct edge_list *edge_list, dominance_info dom)
int *max_hdr, *dfs_nr, *stack, *degree;
char no_loops = 1;
int node, child, loop_head, i, head, tail;
- int count = 0, sp, idx = 0, current_edge = out_edges[0];
+ int count = 0, sp, idx = 0;
+ int current_edge = out_edges[ENTRY_BLOCK_PTR->succ->dest->index];
int num_bbs, num_insns, unreachable;
int too_large_failure;
basic_block bb;
@@ -650,9 +651,9 @@ find_rgns (struct edge_list *edge_list, dominance_info dom)
STACK, SP and DFS_NR are only used during the first traversal. */
/* Allocate and initialize variables for the first traversal. */
- max_hdr = (int *) xmalloc (last_basic_block * sizeof (int));
- dfs_nr = (int *) xcalloc (last_basic_block, sizeof (int));
- stack = (int *) xmalloc (nr_edges * sizeof (int));
+ max_hdr = xmalloc (last_basic_block * sizeof (int));
+ dfs_nr = xcalloc (last_basic_block, sizeof (int));
+ stack = xmalloc (nr_edges * sizeof (int));
inner = sbitmap_alloc (last_basic_block);
sbitmap_ones (inner);
@@ -796,7 +797,7 @@ find_rgns (struct edge_list *edge_list, dominance_info dom)
/* Second traversal:find reducible inner loops and topologically sort
block of each region. */
- queue = (int *) xmalloc (n_basic_blocks * sizeof (int));
+ queue = xmalloc (n_basic_blocks * sizeof (int));
/* Find blocks which are inner loop headers. We still have non-reducible
loops to consider at this point. */
@@ -1117,7 +1118,7 @@ compute_dom_prob_ps (int bb)
static void
split_edges (int bb_src, int bb_trg, edgelst *bl)
{
- sbitmap src = (edgeset) sbitmap_alloc (pot_split[bb_src]->n_bits);
+ sbitmap src = sbitmap_alloc (pot_split[bb_src]->n_bits);
sbitmap_copy (src, pot_split[bb_src]);
sbitmap_difference (src, src, pot_split[bb_trg]);
@@ -1181,7 +1182,7 @@ compute_trg_info (int trg)
add the TO block to the update block list. This list can end
up with a lot of duplicates. We need to weed them out to avoid
overrunning the end of the bblst_table. */
- update_blocks = (char *) alloca (last_basic_block);
+ update_blocks = alloca (last_basic_block);
memset (update_blocks, 0, last_basic_block);
update_idx = 0;
@@ -1701,7 +1702,7 @@ static int schedule_more_p (void);
static const char *rgn_print_insn (rtx, int);
static int rgn_rank (rtx, rtx);
static int contributes_to_priority (rtx, rtx);
-static void compute_jump_reg_dependencies (rtx, regset);
+static void compute_jump_reg_dependencies (rtx, regset, regset, regset);
/* Return nonzero if there are more insns that should be scheduled. */
@@ -1734,8 +1735,7 @@ init_ready_list (struct ready_list *ready)
/* Prepare current target block info. */
if (current_nr_blocks > 1)
{
- candidate_table = (candidate *) xmalloc (current_nr_blocks
- * sizeof (candidate));
+ candidate_table = xmalloc (current_nr_blocks * sizeof (candidate));
bblst_last = 0;
/* bblst_table holds split blocks and update blocks for each block after
@@ -1743,10 +1743,10 @@ init_ready_list (struct ready_list *ready)
the TO blocks of region edges, so there can be at most rgn_nr_edges
of them. */
bblst_size = (current_nr_blocks - target_bb) * rgn_nr_edges;
- bblst_table = (int *) xmalloc (bblst_size * sizeof (int));
+ bblst_table = xmalloc (bblst_size * sizeof (int));
bitlst_table_last = 0;
- bitlst_table = (int *) xmalloc (rgn_nr_edges * sizeof (int));
+ bitlst_table = xmalloc (rgn_nr_edges * sizeof (int));
compute_trg_info (target_bb);
}
@@ -1951,11 +1951,15 @@ contributes_to_priority (rtx next, rtx insn)
return BLOCK_NUM (next) == BLOCK_NUM (insn);
}
-/* INSN is a JUMP_INSN. Store the set of registers that must be considered
- to be set by this jump in SET. */
+/* INSN is a JUMP_INSN, COND_SET is the set of registers that are
+ conditionally set before INSN. Store the set of registers that
+ must be considered as used by this jump in USED and that of
+ registers that must be considered as set in SET. */
static void
compute_jump_reg_dependencies (rtx insn ATTRIBUTE_UNUSED,
+ regset cond_exec ATTRIBUTE_UNUSED,
+ regset used ATTRIBUTE_UNUSED,
regset set ATTRIBUTE_UNUSED)
{
/* Nothing to do here, since we postprocess jumps in
@@ -2384,7 +2388,7 @@ schedule_region (int rgn)
init_deps_global ();
/* Initializations for region data dependence analysis. */
- bb_deps = (struct deps *) xmalloc (sizeof (struct deps) * current_nr_blocks);
+ bb_deps = xmalloc (sizeof (struct deps) * current_nr_blocks);
for (bb = 0; bb < current_nr_blocks; bb++)
init_deps (bb_deps + bb);
@@ -2419,17 +2423,17 @@ schedule_region (int rgn)
{
int i;
- prob = (float *) xmalloc ((current_nr_blocks) * sizeof (float));
+ prob = xmalloc ((current_nr_blocks) * sizeof (float));
dom = sbitmap_vector_alloc (current_nr_blocks, current_nr_blocks);
sbitmap_vector_zero (dom, current_nr_blocks);
/* Edge to bit. */
rgn_nr_edges = 0;
- edge_to_bit = (int *) xmalloc (nr_edges * sizeof (int));
+ edge_to_bit = xmalloc (nr_edges * sizeof (int));
for (i = 1; i < nr_edges; i++)
if (CONTAINING_RGN (FROM_BLOCK (i)) == rgn)
EDGE_TO_BIT (i) = rgn_nr_edges++;
- rgn_edges = (int *) xmalloc (rgn_nr_edges * sizeof (int));
+ rgn_edges = xmalloc (rgn_nr_edges * sizeof (int));
rgn_nr_edges = 0;
for (i = 1; i < nr_edges; i++)
@@ -2560,10 +2564,10 @@ init_regions (void)
int rgn;
nr_regions = 0;
- rgn_table = (region *) xmalloc ((n_basic_blocks) * sizeof (region));
- rgn_bb_table = (int *) xmalloc ((n_basic_blocks) * sizeof (int));
- block_to_bb = (int *) xmalloc ((last_basic_block) * sizeof (int));
- containing_rgn = (int *) xmalloc ((last_basic_block) * sizeof (int));
+ rgn_table = xmalloc ((n_basic_blocks) * sizeof (region));
+ rgn_bb_table = xmalloc ((n_basic_blocks) * sizeof (int));
+ block_to_bb = xmalloc ((last_basic_block) * sizeof (int));
+ containing_rgn = xmalloc ((last_basic_block) * sizeof (int));
/* Compute regions for scheduling. */
if (reload_completed
@@ -2617,7 +2621,7 @@ init_regions (void)
if (CHECK_DEAD_NOTES)
{
blocks = sbitmap_alloc (last_basic_block);
- deaths_in_region = (int *) xmalloc (sizeof (int) * nr_regions);
+ deaths_in_region = xmalloc (sizeof (int) * nr_regions);
/* Remove all death notes from the subroutine. */
for (rgn = 0; rgn < nr_regions; rgn++)
{
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 91f25e79b88..55741d14c0b 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -134,7 +134,7 @@ get_visual_tbl_length (void)
}
/* Compute length of one field in line. */
- s = (char *) alloca (INSN_LEN + 6);
+ s = alloca (INSN_LEN + 6);
sprintf (s, " %33s", "uname");
n1 = strlen (s);
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 54dcc799f40..5d1a3d56c2b 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -1452,7 +1452,7 @@ sdbout_finish (const char *main_filename ATTRIBUTE_UNUSED)
{
tree decl = (*lang_hooks.decls.getdecls) ();
unsigned int len = list_length (decl);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ tree *vec = xmalloc (sizeof (tree) * len);
unsigned int i;
/* Process the decls in reverse order--earliest first. Put them
@@ -1645,7 +1645,7 @@ sdbout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED)
{
#ifdef MIPS_DEBUGGING_INFO
- struct sdb_file *n = (struct sdb_file *) xmalloc (sizeof *n);
+ struct sdb_file *n = xmalloc (sizeof *n);
n->next = current_file;
n->name = filename;
@@ -1675,7 +1675,7 @@ static void
sdbout_init (const char *input_file_name ATTRIBUTE_UNUSED)
{
#ifdef MIPS_DEBUGGING_INFO
- current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
+ current_file = xmalloc (sizeof *current_file);
current_file->next = NULL;
current_file->name = input_file_name;
#endif
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 27fe4f377b6..c338b665ca0 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -53,6 +53,9 @@ static rtx neg_const_int (enum machine_mode, rtx);
static int simplify_plus_minus_op_data_cmp (const void *, const void *);
static rtx simplify_plus_minus (enum rtx_code, enum machine_mode, rtx,
rtx, int);
+static bool associative_constant_p (rtx);
+static rtx simplify_associative_operation (enum rtx_code, enum machine_mode,
+ rtx, rtx);
/* Negate a CONST_INT rtx, truncating (because a conversion from a
maximally negative number can overflow). */
@@ -127,7 +130,7 @@ avoid_constant_pool_reference (rtx x)
addr = XEXP (x, 0);
- /* Call target hook to avoid the effects of -fpic etc... */
+ /* Call target hook to avoid the effects of -fpic etc.... */
addr = (*targetm.delegitimize_address) (addr);
if (GET_CODE (addr) == LO_SUM)
@@ -194,38 +197,62 @@ simplify_gen_relational (enum rtx_code code, enum machine_mode mode,
{
rtx tem;
- if ((tem = simplify_relational_operation (code, cmp_mode, op0, op1)) != 0)
- return tem;
+ if (cmp_mode == VOIDmode)
+ cmp_mode = GET_MODE (op0);
+ if (cmp_mode == VOIDmode)
+ cmp_mode = GET_MODE (op1);
+
+ if (cmp_mode != VOIDmode)
+ {
+ tem = simplify_relational_operation (code, cmp_mode, op0, op1);
+
+ if (tem)
+ {
+#ifdef FLOAT_STORE_FLAG_VALUE
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+ {
+ REAL_VALUE_TYPE val;
+ if (tem == const0_rtx)
+ return CONST0_RTX (mode);
+ if (tem != const_true_rtx)
+ abort ();
+ val = FLOAT_STORE_FLAG_VALUE (mode);
+ return CONST_DOUBLE_FROM_REAL_VALUE (val, mode);
+ }
+#endif
+ return tem;
+ }
+ }
/* For the following tests, ensure const0_rtx is op1. */
- if (op0 == const0_rtx && swap_commutative_operands_p (op0, op1))
+ if (swap_commutative_operands_p (op0, op1)
+ || (op0 == const0_rtx && op1 != const0_rtx))
tem = op0, op0 = op1, op1 = tem, code = swap_condition (code);
/* If op0 is a compare, extract the comparison arguments from it. */
if (GET_CODE (op0) == COMPARE && op1 == const0_rtx)
- op1 = XEXP (op0, 1), op0 = XEXP (op0, 0);
+ return simplify_gen_relational (code, mode, VOIDmode,
+ XEXP (op0, 0), XEXP (op0, 1));
/* If op0 is a comparison, extract the comparison arguments form it. */
- if (code == NE && op1 == const0_rtx
- && GET_RTX_CLASS (GET_CODE (op0)) == '<')
- return op0;
- else if (code == EQ && op1 == const0_rtx)
+ if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && op1 == const0_rtx)
{
- /* The following tests GET_RTX_CLASS (GET_CODE (op0)) == '<'. */
- enum rtx_code new = reversed_comparison_code (op0, NULL_RTX);
- if (new != UNKNOWN)
- {
- code = new;
- mode = cmp_mode;
- op1 = XEXP (op0, 1);
- op0 = XEXP (op0, 0);
+ if (code == NE)
+ {
+ if (GET_MODE (op0) == mode)
+ return op0;
+ return simplify_gen_relational (GET_CODE (op0), mode, VOIDmode,
+ XEXP (op0, 0), XEXP (op0, 1));
+ }
+ else if (code == EQ)
+ {
+ enum rtx_code new = reversed_comparison_code (op0, NULL_RTX);
+ if (new != UNKNOWN)
+ return simplify_gen_relational (new, mode, VOIDmode,
+ XEXP (op0, 0), XEXP (op0, 1));
}
}
- /* Put complex operands first and constants second. */
- if (swap_commutative_operands_p (op0, op1))
- tem = op0, op0 = op1, op1 = tem, code = swap_condition (code);
-
return gen_rtx_fmt_ee (code, mode, op0, op1);
}
@@ -269,15 +296,7 @@ simplify_replace_rtx (rtx x, rtx old, rtx new)
: GET_MODE (XEXP (x, 1)));
rtx op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
rtx op1 = simplify_replace_rtx (XEXP (x, 1), old, new);
-
- return
- simplify_gen_relational (code, mode,
- (op_mode != VOIDmode
- ? op_mode
- : GET_MODE (op0) != VOIDmode
- ? GET_MODE (op0)
- : GET_MODE (op1)),
- op0, op1);
+ return simplify_gen_relational (code, mode, op_mode, op0, op1);
}
case '3':
@@ -637,24 +656,23 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
case CLZ:
hv = 0;
- if (h1 == 0)
- lv = GET_MODE_BITSIZE (mode) - floor_log2 (l1) - 1;
- else
+ if (h1 != 0)
lv = GET_MODE_BITSIZE (mode) - floor_log2 (h1) - 1
- HOST_BITS_PER_WIDE_INT;
+ else if (l1 != 0)
+ lv = GET_MODE_BITSIZE (mode) - floor_log2 (l1) - 1;
+ else if (! CLZ_DEFINED_VALUE_AT_ZERO (mode, lv))
+ lv = GET_MODE_BITSIZE (mode);
break;
case CTZ:
hv = 0;
- if (l1 == 0)
- {
- if (h1 == 0)
- lv = GET_MODE_BITSIZE (mode);
- else
- lv = HOST_BITS_PER_WIDE_INT + exact_log2 (h1 & -h1);
- }
- else
+ if (l1 != 0)
lv = exact_log2 (l1 & -l1);
+ else if (h1 != 0)
+ lv = HOST_BITS_PER_WIDE_INT + exact_log2 (h1 & -h1);
+ else if (! CTZ_DEFINED_VALUE_AT_ZERO (mode, lv))
+ lv = GET_MODE_BITSIZE (mode);
break;
case POPCOUNT:
@@ -777,6 +795,8 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
else
{
enum rtx_code reversed;
+ rtx temp;
+
/* There are some simplifications we can do even if the operands
aren't constant. */
switch (code)
@@ -787,17 +807,120 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
return XEXP (op, 0);
/* (not (eq X Y)) == (ne X Y), etc. */
- if (mode == BImode && GET_RTX_CLASS (GET_CODE (op)) == '<'
+ if (GET_RTX_CLASS (GET_CODE (op)) == '<'
+ && (mode == BImode || STORE_FLAG_VALUE == -1)
&& ((reversed = reversed_comparison_code (op, NULL_RTX))
!= UNKNOWN))
- return gen_rtx_fmt_ee (reversed,
- op_mode, XEXP (op, 0), XEXP (op, 1));
+ return simplify_gen_relational (reversed, mode, VOIDmode,
+ XEXP (op, 0), XEXP (op, 1));
+
+ /* (not (plus X -1)) can become (neg X). */
+ if (GET_CODE (op) == PLUS
+ && XEXP (op, 1) == constm1_rtx)
+ return simplify_gen_unary (NEG, mode, XEXP (op, 0), mode);
+
+ /* Similarly, (not (neg X)) is (plus X -1). */
+ if (GET_CODE (op) == NEG)
+ return plus_constant (XEXP (op, 0), -1);
+
+ /* (not (xor X C)) for C constant is (xor X D) with D = ~C. */
+ if (GET_CODE (op) == XOR
+ && GET_CODE (XEXP (op, 1)) == CONST_INT
+ && (temp = simplify_unary_operation (NOT, mode,
+ XEXP (op, 1),
+ mode)) != 0)
+ return simplify_gen_binary (XOR, mode, XEXP (op, 0), temp);
+
+
+ /* (not (ashift 1 X)) is (rotate ~1 X). We used to do this for
+ operands other than 1, but that is not valid. We could do a
+ similar simplification for (not (lshiftrt C X)) where C is
+ just the sign bit, but this doesn't seem common enough to
+ bother with. */
+ if (GET_CODE (op) == ASHIFT
+ && XEXP (op, 0) == const1_rtx)
+ {
+ temp = simplify_gen_unary (NOT, mode, const1_rtx, mode);
+ return simplify_gen_binary (ROTATE, mode, temp, XEXP (op, 1));
+ }
+
+ /* If STORE_FLAG_VALUE is -1, (not (comparison X Y)) can be done
+ by reversing the comparison code if valid. */
+ if (STORE_FLAG_VALUE == -1
+ && GET_RTX_CLASS (GET_CODE (op)) == '<'
+ && (reversed = reversed_comparison_code (op, NULL_RTX))
+ != UNKNOWN)
+ return simplify_gen_relational (reversed, mode, VOIDmode,
+ XEXP (op, 0), XEXP (op, 1));
+
+ /* (not (ashiftrt foo C)) where C is the number of bits in FOO
+ minus 1 is (ge foo (const_int 0)) if STORE_FLAG_VALUE is -1,
+ so we can perform the above simplification. */
+
+ if (STORE_FLAG_VALUE == -1
+ && GET_CODE (op) == ASHIFTRT
+ && GET_CODE (XEXP (op, 1)) == CONST_INT
+ && INTVAL (XEXP (op, 1)) == GET_MODE_BITSIZE (mode) - 1)
+ return simplify_gen_relational (GE, mode, VOIDmode,
+ XEXP (op, 0), const0_rtx);
+
break;
case NEG:
/* (neg (neg X)) == X. */
if (GET_CODE (op) == NEG)
return XEXP (op, 0);
+
+ /* (neg (plus X 1)) can become (not X). */
+ if (GET_CODE (op) == PLUS
+ && XEXP (op, 1) == const1_rtx)
+ return simplify_gen_unary (NOT, mode, XEXP (op, 0), mode);
+
+ /* Similarly, (neg (not X)) is (plus X 1). */
+ if (GET_CODE (op) == NOT)
+ return plus_constant (XEXP (op, 0), 1);
+
+ /* (neg (minus X Y)) can become (minus Y X). This transformation
+ isn't safe for modes with signed zeros, since if X and Y are
+ both +0, (minus Y X) is the same as (minus X Y). If the
+ rounding mode is towards +infinity (or -infinity) then the two
+ expressions will be rounded differently. */
+ if (GET_CODE (op) == MINUS
+ && !HONOR_SIGNED_ZEROS (mode)
+ && !HONOR_SIGN_DEPENDENT_ROUNDING (mode))
+ return simplify_gen_binary (MINUS, mode, XEXP (op, 1),
+ XEXP (op, 0));
+
+ /* (neg (plus A B)) is canonicalized to (minus (neg A) B). */
+ if (GET_CODE (op) == PLUS
+ && !HONOR_SIGNED_ZEROS (mode)
+ && !HONOR_SIGN_DEPENDENT_ROUNDING (mode))
+ {
+ temp = simplify_gen_unary (NEG, mode, XEXP (op, 0), mode);
+ return simplify_gen_binary (MINUS, mode, temp, XEXP (op, 1));
+ }
+
+ /* (neg (mult A B)) becomes (mult (neg A) B).
+ This works even for floating-point values. */
+ if (GET_CODE (op) == MULT
+ && !HONOR_SIGN_DEPENDENT_ROUNDING (mode))
+ {
+ temp = simplify_gen_unary (NEG, mode, XEXP (op, 0), mode);
+ return simplify_gen_binary (MULT, mode, temp, XEXP (op, 1));
+ }
+
+ /* NEG commutes with ASHIFT since it is multiplication. Only do
+ this if we can then eliminate the NEG (e.g., if the operand
+ is a constant). */
+ if (GET_CODE (op) == ASHIFT)
+ {
+ temp = simplify_unary_operation (NEG, mode, XEXP (op, 0),
+ mode);
+ if (temp)
+ return simplify_gen_binary (ASHIFT, mode, temp,
+ XEXP (op, 1));
+ }
+
break;
case SIGN_EXTEND:
@@ -845,6 +968,72 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
}
}
+/* Subroutine of simplify_associative_operation. Return true if rtx OP
+ is a suitable integer or floating point immediate constant. */
+static bool
+associative_constant_p (rtx op)
+{
+ if (GET_CODE (op) == CONST_INT
+ || GET_CODE (op) == CONST_DOUBLE)
+ return true;
+ op = avoid_constant_pool_reference (op);
+ return GET_CODE (op) == CONST_INT
+ || GET_CODE (op) == CONST_DOUBLE;
+}
+
+/* Subroutine of simplify_binary_operation to simplify an associative
+ binary operation CODE with result mode MODE, operating on OP0 and OP1.
+ Return 0 if no simplification is possible. */
+static rtx
+simplify_associative_operation (enum rtx_code code, enum machine_mode mode,
+ rtx op0, rtx op1)
+{
+ rtx tem;
+
+ /* Simplify (x op c1) op c2 as x op (c1 op c2). */
+ if (GET_CODE (op0) == code
+ && associative_constant_p (op1)
+ && associative_constant_p (XEXP (op0, 1)))
+ {
+ tem = simplify_binary_operation (code, mode, XEXP (op0, 1), op1);
+ if (! tem)
+ return tem;
+ return simplify_gen_binary (code, mode, XEXP (op0, 0), tem);
+ }
+
+ /* Simplify (x op c1) op (y op c2) as (x op y) op (c1 op c2). */
+ if (GET_CODE (op0) == code
+ && GET_CODE (op1) == code
+ && associative_constant_p (XEXP (op0, 1))
+ && associative_constant_p (XEXP (op1, 1)))
+ {
+ rtx c = simplify_binary_operation (code, mode,
+ XEXP (op0, 1), XEXP (op1, 1));
+ if (! c)
+ return 0;
+ tem = simplify_gen_binary (code, mode, XEXP (op0, 0), XEXP (op1, 0));
+ return simplify_gen_binary (code, mode, tem, c);
+ }
+
+ /* Canonicalize (x op c) op y as (x op y) op c. */
+ if (GET_CODE (op0) == code
+ && associative_constant_p (XEXP (op0, 1)))
+ {
+ tem = simplify_gen_binary (code, mode, XEXP (op0, 0), op1);
+ return simplify_gen_binary (code, mode, tem, XEXP (op0, 1));
+ }
+
+ /* Canonicalize x op (y op c) as (x op y) op c. */
+ if (GET_CODE (op1) == code
+ && associative_constant_p (XEXP (op1, 1)))
+ {
+ tem = simplify_gen_binary (code, mode, op0, XEXP (op1, 0));
+ return simplify_gen_binary (code, mode, tem, XEXP (op1, 1));
+ }
+
+ return 0;
+}
+
/* Simplify a binary operation CODE with result mode MODE, operating on OP0
and OP1. Return 0 if no simplification is possible.
@@ -920,9 +1109,13 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
f0 = real_value_truncate (mode, f0);
f1 = real_value_truncate (mode, f1);
+ if (HONOR_SNANS (mode)
+ && (REAL_VALUE_ISNAN (f0) || REAL_VALUE_ISNAN (f1)))
+ return 0;
+
if (code == DIV
- && !MODE_HAS_INFINITIES (mode)
- && REAL_VALUES_EQUAL (f1, dconst0))
+ && REAL_VALUES_EQUAL (f1, dconst0)
+ && (flag_trapping_math || ! MODE_HAS_INFINITIES (mode)))
return 0;
REAL_ARITHMETIC (value, rtx_to_tree_code (code), f0, f1);
@@ -959,7 +1152,7 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
neg_double (l2, h2, &lv, &hv);
l2 = lv, h2 = hv;
- /* .. fall through ... */
+ /* Fall through.... */
case PLUS:
add_double (l1, h1, l2, h2, &lv, &hv);
@@ -1082,7 +1275,7 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
if (INTEGRAL_MODE_P (mode)
&& GET_CODE (op0) == NOT
&& trueop1 == const1_rtx)
- return gen_rtx_NEG (mode, XEXP (op0, 0));
+ return simplify_gen_unary (NEG, mode, XEXP (op0, 0), mode);
/* Handle both-operands-constant cases. We can only add
CONST_INTs to constants since the sum of relocatable symbols
@@ -1166,6 +1359,16 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
&& GET_CODE (XEXP (op1, 0)) == PLUS))
&& (tem = simplify_plus_minus (code, mode, op0, op1, 0)) != 0)
return tem;
+
+ /* Reassociate floating point addition only when the user
+ specifies unsafe math optimizations. */
+ if (FLOAT_MODE_P (mode)
+ && flag_unsafe_math_optimizations)
+ {
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
+ }
break;
case COMPARE:
@@ -1217,11 +1420,11 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
But if the mode has signed zeros, and does not round towards
-infinity, then 0 - 0 is 0, not -0. */
if (!HONOR_SIGNED_ZEROS (mode) && trueop0 == CONST0_RTX (mode))
- return gen_rtx_NEG (mode, op1);
+ return simplify_gen_unary (NEG, mode, op1, mode);
/* (-1 - a) is ~a. */
if (trueop0 == constm1_rtx)
- return gen_rtx_NOT (mode, op1);
+ return simplify_gen_unary (NOT, mode, op1, mode);
/* Subtracting 0 has no effect unless the mode has signed zeros
and supports rounding towards -infinity. In such a case,
@@ -1331,11 +1534,7 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
case MULT:
if (trueop1 == constm1_rtx)
- {
- tem = simplify_unary_operation (NEG, mode, op0, mode);
-
- return tem ? tem : gen_rtx_NEG (mode, op0);
- }
+ return simplify_gen_unary (NEG, mode, op0, mode);
/* Maybe simplify x * 0 to 0. The reduction is not valid if
x is NaN, since x * 0 is then also NaN. Nor is it valid
@@ -1363,7 +1562,7 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
&& (width <= HOST_BITS_PER_WIDE_INT
|| val != HOST_BITS_PER_WIDE_INT - 1)
&& ! rtx_equal_function_value_matters)
- return gen_rtx_ASHIFT (mode, op0, GEN_INT (val));
+ return simplify_gen_binary (ASHIFT, mode, op0, GEN_INT (val));
/* x*2 is x+x and x*(-1) is -x */
if (GET_CODE (trueop1) == CONST_DOUBLE
@@ -1374,10 +1573,20 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
REAL_VALUE_FROM_CONST_DOUBLE (d, trueop1);
if (REAL_VALUES_EQUAL (d, dconst2))
- return gen_rtx_PLUS (mode, op0, copy_rtx (op0));
+ return simplify_gen_binary (PLUS, mode, op0, copy_rtx (op0));
if (REAL_VALUES_EQUAL (d, dconstm1))
- return gen_rtx_NEG (mode, op0);
+ return simplify_gen_unary (NEG, mode, op0, mode);
+ }
+
+ /* Reassociate multiplication, but for floating point MULTs
+ only when the user specifies unsafe math optimizations. */
+ if (! FLOAT_MODE_P (mode)
+ || flag_unsafe_math_optimizations)
+ {
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
}
break;
@@ -1396,6 +1605,9 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
&& ! side_effects_p (op0)
&& GET_MODE_CLASS (mode) != MODE_CC)
return constm1_rtx;
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
break;
case XOR:
@@ -1404,10 +1616,13 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
if (GET_CODE (trueop1) == CONST_INT
&& ((INTVAL (trueop1) & GET_MODE_MASK (mode))
== GET_MODE_MASK (mode)))
- return gen_rtx_NOT (mode, op0);
+ return simplify_gen_unary (NOT, mode, op0, mode);
if (trueop0 == trueop1 && ! side_effects_p (op0)
&& GET_MODE_CLASS (mode) != MODE_CC)
return const0_rtx;
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
break;
case AND:
@@ -1426,6 +1641,9 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
&& ! side_effects_p (op0)
&& GET_MODE_CLASS (mode) != MODE_CC)
return const0_rtx;
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
break;
case UDIV:
@@ -1433,9 +1651,9 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
below). */
if (GET_CODE (trueop1) == CONST_INT
&& (arg1 = exact_log2 (INTVAL (trueop1))) > 0)
- return gen_rtx_LSHIFTRT (mode, op0, GEN_INT (arg1));
+ return simplify_gen_binary (LSHIFTRT, mode, op0, GEN_INT (arg1));
- /* ... fall through ... */
+ /* Fall through.... */
case DIV:
if (trueop1 == CONST1_RTX (mode))
@@ -1474,8 +1692,8 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
if (! REAL_VALUES_EQUAL (d, dconst0))
{
REAL_ARITHMETIC (d, rtx_to_tree_code (DIV), dconst1, d);
- return gen_rtx_MULT (mode, op0,
- CONST_DOUBLE_FROM_REAL_VALUE (d, mode));
+ tem = CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
+ return simplify_gen_binary (MULT, mode, op0, tem);
}
}
break;
@@ -1484,9 +1702,10 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
/* Handle modulus by power of two (mod with 1 handled below). */
if (GET_CODE (trueop1) == CONST_INT
&& exact_log2 (INTVAL (trueop1)) > 0)
- return gen_rtx_AND (mode, op0, GEN_INT (INTVAL (op1) - 1));
+ return simplify_gen_binary (AND, mode, op0,
+ GEN_INT (INTVAL (op1) - 1));
- /* ... fall through ... */
+ /* Fall through.... */
case MOD:
if ((trueop0 == const0_rtx || trueop1 == const1_rtx)
@@ -1503,7 +1722,7 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
&& ! side_effects_p (op1))
return op0;
- /* ... fall through ... */
+ /* Fall through.... */
case ASHIFT:
case LSHIFTRT:
@@ -1514,36 +1733,50 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
break;
case SMIN:
- if (width <= HOST_BITS_PER_WIDE_INT && GET_CODE (trueop1) == CONST_INT
+ if (width <= HOST_BITS_PER_WIDE_INT
+ && GET_CODE (trueop1) == CONST_INT
&& INTVAL (trueop1) == (HOST_WIDE_INT) 1 << (width -1)
&& ! side_effects_p (op0))
return op1;
- else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
+ if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
return op0;
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
break;
case SMAX:
- if (width <= HOST_BITS_PER_WIDE_INT && GET_CODE (trueop1) == CONST_INT
+ if (width <= HOST_BITS_PER_WIDE_INT
+ && GET_CODE (trueop1) == CONST_INT
&& ((unsigned HOST_WIDE_INT) INTVAL (trueop1)
== (unsigned HOST_WIDE_INT) GET_MODE_MASK (mode) >> 1)
&& ! side_effects_p (op0))
return op1;
- else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
+ if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
return op0;
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
break;
case UMIN:
if (trueop1 == const0_rtx && ! side_effects_p (op0))
return op1;
- else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
+ if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
return op0;
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
break;
case UMAX:
if (trueop1 == constm1_rtx && ! side_effects_p (op0))
return op1;
- else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
+ if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
return op0;
+ tem = simplify_associative_operation (code, mode, op0, op1);
+ if (tem)
+ return tem;
break;
case SS_PLUS:
@@ -1894,7 +2127,7 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
int first, negate, changed;
int i, j;
- memset ((char *) ops, 0, sizeof ops);
+ memset (ops, 0, sizeof ops);
/* Set up the two operands and then expand them until nothing has been
changed. If we run out of room in our array, give up; this should
@@ -2500,10 +2733,10 @@ simplify_ternary_operation (enum rtx_code code, enum machine_mode mode,
/* See if any simplifications were possible. */
if (temp == const0_rtx)
return op2;
- else if (temp == const1_rtx)
+ else if (temp == const_true_rtx)
return op1;
else if (temp)
- op0 = temp;
+ abort ();
/* Look for happy constants in op1 and op2. */
if (GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT)
@@ -2896,10 +3129,12 @@ simplify_subreg (enum machine_mode outermode, rtx op,
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& REGNO (op) != ARG_POINTER_REGNUM
#endif
- && REGNO (op) != STACK_POINTER_REGNUM)
+ && REGNO (op) != STACK_POINTER_REGNUM
+ && subreg_offset_representable_p (REGNO (op), innermode,
+ byte, outermode))
{
- int final_regno = subreg_hard_regno (gen_rtx_SUBREG (outermode, op, byte),
- 0);
+ rtx tem = gen_rtx_SUBREG (outermode, op, byte);
+ int final_regno = subreg_hard_regno (tem, 0);
/* ??? We do allow it if the current REG is not valid for
its mode. This is a kludge to work around how float/complex
@@ -3030,6 +3265,7 @@ simplify_rtx (rtx x)
{
enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x);
+ rtx temp;
switch (GET_RTX_CLASS (code))
{
@@ -3038,15 +3274,9 @@ simplify_rtx (rtx x)
XEXP (x, 0), GET_MODE (XEXP (x, 0)));
case 'c':
if (swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
- {
- rtx tem;
+ return simplify_gen_binary (code, mode, XEXP (x, 1), XEXP (x, 0));
- tem = XEXP (x, 0);
- XEXP (x, 0) = XEXP (x, 1);
- XEXP (x, 1) = tem;
- return simplify_binary_operation (code, mode,
- XEXP (x, 0), XEXP (x, 1));
- }
+ /* Fall through.... */
case '2':
return simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));
@@ -3058,12 +3288,24 @@ simplify_rtx (rtx x)
XEXP (x, 2));
case '<':
- return simplify_relational_operation (code,
+ temp = simplify_relational_operation (code,
((GET_MODE (XEXP (x, 0))
!= VOIDmode)
? GET_MODE (XEXP (x, 0))
: GET_MODE (XEXP (x, 1))),
XEXP (x, 0), XEXP (x, 1));
+#ifdef FLOAT_STORE_FLAG_VALUE
+ if (temp != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT)
+ {
+ if (temp == const0_rtx)
+ temp = CONST0_RTX (mode);
+ else
+ temp = CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE (mode),
+ mode);
+ }
+#endif
+ return temp;
+
case 'x':
if (code == SUBREG)
return simplify_gen_subreg (mode, SUBREG_REG (x),
@@ -3074,8 +3316,20 @@ simplify_rtx (rtx x)
if (CONSTANT_P (XEXP (x, 0)))
return const1_rtx;
}
- return NULL;
+ break;
+
+ case 'o':
+ if (code == LO_SUM)
+ {
+ /* Convert (lo_sum (high FOO) FOO) to FOO. */
+ if (GET_CODE (XEXP (x, 0)) == HIGH
+ && rtx_equal_p (XEXP (XEXP (x, 0), 0), XEXP (x, 1)))
+ return XEXP (x, 1);
+ }
+ break;
+
default:
- return NULL;
+ break;
}
+ return NULL;
}
diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c
index c093cc463e7..7ff305a9d3d 100644
--- a/gcc/ssa-ccp.c
+++ b/gcc/ssa-ccp.c
@@ -989,7 +989,7 @@ ssa_const_prop (void)
edges = create_edge_list ();
/* Initialize the values array with everything as undefined. */
- values = (value *) xmalloc (VARRAY_SIZE (ssa_definition) * sizeof (value));
+ values = xmalloc (VARRAY_SIZE (ssa_definition) * sizeof (value));
for (i = 0; i < VARRAY_SIZE (ssa_definition); i++)
{
if (i < FIRST_PSEUDO_REGISTER)
@@ -1008,7 +1008,7 @@ ssa_const_prop (void)
executable_edges = sbitmap_alloc (NUM_EDGES (edges));
sbitmap_zero (executable_edges);
- edge_info = (edge *) xmalloc (NUM_EDGES (edges) * sizeof (edge));
+ 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
diff --git a/gcc/ssa.c b/gcc/ssa.c
index 1e36290491c..c12cdbe7afb 100644
--- a/gcc/ssa.c
+++ b/gcc/ssa.c
@@ -253,8 +253,7 @@ ssa_rename_from_lookup (int reg)
ssa_rename_from_pair *answer;
srfp.reg = reg;
srfp.original = NULL_RTX;
- answer = (ssa_rename_from_pair *)
- htab_find_with_hash (ssa_rename_from_ht, (void *) &srfp, reg);
+ answer = htab_find_with_hash (ssa_rename_from_ht, (void *) &srfp, reg);
return (answer == 0 ? NULL_RTX : answer->original);
}
@@ -673,7 +672,7 @@ static void
create_delayed_rename (struct rename_context *c, rtx *reg_loc)
{
struct rename_set_data *r;
- r = (struct rename_set_data *) xmalloc (sizeof(*r));
+ r = xmalloc (sizeof(*r));
if (GET_CODE (*reg_loc) != REG
|| !CONVERT_REGISTER_TO_SSA_P (REGNO (*reg_loc)))
@@ -1064,10 +1063,10 @@ rename_registers (int nregs, dominance_info idom)
VARRAY_RTX_INIT (ssa_definition, nregs * 3, "ssa_definition");
ssa_rename_from_initialize ();
- ssa_rename_to_pseudo = (rtx *) alloca (nregs * sizeof(rtx));
- memset ((char *) ssa_rename_to_pseudo, 0, nregs * sizeof(rtx));
- memset ((char *) ssa_rename_to_hard, 0,
- FIRST_PSEUDO_REGISTER * NUM_MACHINE_MODES * sizeof (rtx));
+ 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);
@@ -1313,7 +1312,7 @@ eliminate_phi (edge e, partition reg_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 = (rtx *) alloca (n_nodes * sizeof(rtx));
+ 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);
@@ -1362,7 +1361,7 @@ eliminate_phi (edge e, partition reg_partition)
visited = sbitmap_alloc (n_nodes);
sbitmap_zero (visited);
- tstack = stack = (int *) alloca (n_nodes * sizeof (int));
+ tstack = stack = alloca (n_nodes * sizeof (int));
for (i = 0; i < n_nodes; ++i)
if (! TEST_BIT (visited, i))
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 334e751bcde..9d5553f2517 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -57,6 +57,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h"
#include "predict.h"
#include "optabs.h"
+#include "target.h"
/* Assume that case vectors are not pc-relative. */
#ifndef CASE_VECTOR_PC_RELATIVE
@@ -252,8 +253,7 @@ struct nesting GTY(())
/* Allocate and return a new `struct nesting'. */
-#define ALLOC_NESTING() \
- (struct nesting *) ggc_alloc (sizeof (struct nesting))
+#define ALLOC_NESTING() ggc_alloc (sizeof (struct nesting))
/* Pop the nesting stack element by element until we pop off
the element which is at the top of STACK.
@@ -434,25 +434,7 @@ using_eh_for_cleanups (void)
void
init_stmt_for_function (void)
{
- cfun->stmt = ((struct stmt_status *)ggc_alloc (sizeof (struct stmt_status)));
-
- /* We are not currently within any block, conditional, loop or case. */
- block_stack = 0;
- stack_block_stack = 0;
- loop_stack = 0;
- case_stack = 0;
- cond_stack = 0;
- nesting_stack = 0;
- nesting_depth = 0;
-
- current_block_start_count = 0;
-
- /* No gotos have been expanded yet. */
- goto_fixup_chain = 0;
-
- /* We are not processing a ({...}) grouping. */
- expr_stmts_for_value = 0;
- clear_last_expr ();
+ cfun->stmt = ggc_alloc_cleared (sizeof (struct stmt_status));
}
/* Record the current file and line. Called from emit_line_note. */
@@ -538,10 +520,7 @@ expand_computed_goto (tree exp)
{
rtx x = expand_expr (exp, NULL_RTX, VOIDmode, 0);
-#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (x) != Pmode)
- x = convert_memory_address (Pmode, x);
-#endif
+ x = convert_memory_address (Pmode, x);
emit_queue ();
@@ -588,7 +567,7 @@ expand_label (tree label)
if (stack_block_stack != 0)
{
- p = (struct label_chain *) ggc_alloc (sizeof (struct label_chain));
+ p = ggc_alloc (sizeof (struct label_chain));
p->next = stack_block_stack->data.block.label_chain;
stack_block_stack->data.block.label_chain = p;
p->label = label;
@@ -851,8 +830,7 @@ expand_fixup (tree tree_label, rtx rtl_label, rtx last_insn)
if (block != end_block)
{
/* Ok, a fixup is needed. Add a fixup to the list of such. */
- struct goto_fixup *fixup
- = (struct goto_fixup *) ggc_alloc (sizeof (struct goto_fixup));
+ struct goto_fixup *fixup = ggc_alloc (sizeof (struct goto_fixup));
/* In case an old stack level is restored, make sure that comes
after any pending stack adjust. */
/* ?? If the fixup isn't to come at the present position,
@@ -988,8 +966,8 @@ fixup_gotos (struct nesting *thisblock, rtx stack_level,
&& INSN_UID (first_insn) > INSN_UID (f->before_jump)
&& ! DECL_ERROR_ISSUED (f->target))
{
- error_with_decl (f->target,
- "label `%s' used before containing binding contour");
+ error ("%Jlabel '%D' used before containing binding contour",
+ f->target, f->target);
/* Prevent multiple errors for one label. */
DECL_ERROR_ISSUED (f->target) = 1;
}
@@ -1471,13 +1449,13 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
tree t;
int i;
/* Vector of RTX's of evaluated output operands. */
- rtx *output_rtx = (rtx *) alloca (noutputs * sizeof (rtx));
- int *inout_opnum = (int *) alloca (noutputs * sizeof (int));
- rtx *real_output_rtx = (rtx *) alloca (noutputs * sizeof (rtx));
+ rtx *output_rtx = alloca (noutputs * sizeof (rtx));
+ int *inout_opnum = alloca (noutputs * sizeof (int));
+ rtx *real_output_rtx = alloca (noutputs * sizeof (rtx));
enum machine_mode *inout_mode
- = (enum machine_mode *) alloca (noutputs * sizeof (enum machine_mode));
+ = alloca (noutputs * sizeof (enum machine_mode));
const char **constraints
- = (const char **) alloca ((noutputs + ninputs) * sizeof (const char *));
+ = alloca ((noutputs + ninputs) * sizeof (const char *));
int old_generating_concat_p = generating_concat_p;
/* An ASM with no outputs needs to be treated as volatile, for now. */
@@ -1994,13 +1972,14 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs)
{
char *buffer;
char *p;
+ const char *c;
tree t;
/* Substitute [<name>] in input constraint strings. There should be no
named operands in output constraints. */
for (t = inputs; t ; t = TREE_CHAIN (t))
{
- const char *c = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
+ c = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
if (strchr (c, '[') != NULL)
{
p = buffer = xstrdup (c);
@@ -2012,31 +1991,48 @@ resolve_asm_operand_names (tree string, tree outputs, tree inputs)
}
}
- if (strchr (TREE_STRING_POINTER (string), '[') == NULL)
- return string;
-
- /* Assume that we will not need extra space to perform the substitution.
- This because we get to remove '[' and ']', which means we cannot have
- a problem until we have more than 999 operands. */
-
- p = buffer = xstrdup (TREE_STRING_POINTER (string));
- while ((p = strchr (p, '%')) != NULL)
+ /* Now check for any needed substitutions in the template. */
+ c = TREE_STRING_POINTER (string);
+ while ((c = strchr (c, '%')) != NULL)
{
- if (p[1] == '[')
- p += 1;
- else if (ISALPHA (p[1]) && p[2] == '[')
- p += 2;
+ if (c[1] == '[')
+ break;
+ else if (ISALPHA (c[1]) && c[2] == '[')
+ break;
else
{
- p += 1;
+ c += 1;
continue;
}
-
- p = resolve_operand_name_1 (p, outputs, inputs);
}
- string = build_string (strlen (buffer), buffer);
- free (buffer);
+ if (c)
+ {
+ /* OK, we need to make a copy so we can perform the substitutions.
+ Assume that we will not need extra space--we get to remove '['
+ and ']', which means we cannot have a problem until we have more
+ than 999 operands. */
+ buffer = xstrdup (TREE_STRING_POINTER (string));
+ p = buffer + (c - TREE_STRING_POINTER (string));
+
+ while ((p = strchr (p, '%')) != NULL)
+ {
+ if (p[1] == '[')
+ p += 1;
+ else if (ISALPHA (p[1]) && p[2] == '[')
+ p += 2;
+ else
+ {
+ p += 1;
+ continue;
+ }
+
+ p = resolve_operand_name_1 (p, outputs, inputs);
+ }
+
+ string = build_string (strlen (buffer), buffer);
+ free (buffer);
+ }
return string;
}
@@ -2136,17 +2132,13 @@ expand_expr_stmt_value (tree exp, int want_value, int maybe_last)
except for last statement in ({...}) where they may be useful. */
if (! want_value
&& (expr_stmts_for_value == 0 || ! maybe_last)
- && exp != error_mark_node)
+ && exp != error_mark_node
+ && warn_unused_value)
{
- if (! TREE_SIDE_EFFECTS (exp))
- {
- if (warn_unused_value
- && !(TREE_CODE (exp) == CONVERT_EXPR
- && VOID_TYPE_P (TREE_TYPE (exp))))
- warning ("%Hstatement with no effect", &emit_locus);
- }
- else if (warn_unused_value)
+ if (TREE_SIDE_EFFECTS (exp))
warn_if_unused_value (exp);
+ else if (!VOID_TYPE_P (TREE_TYPE (exp)))
+ warning ("%Hstatement with no effect", &emit_locus);
}
/* If EXP is of function type and we are expanding statements for
@@ -2225,7 +2217,6 @@ warn_if_unused_value (tree exp)
case INIT_EXPR:
case TARGET_EXPR:
case CALL_EXPR:
- case METHOD_CALL_EXPR:
case RTL_EXPR:
case TRY_CATCH_EXPR:
case WITH_CLEANUP_EXPR:
@@ -2944,18 +2935,19 @@ expand_value_return (rtx val)
if (return_reg != val)
{
tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
-#ifdef PROMOTE_FUNCTION_RETURN
- int unsignedp = TREE_UNSIGNED (type);
- enum machine_mode old_mode
- = DECL_MODE (DECL_RESULT (current_function_decl));
- enum machine_mode mode
- = promote_mode (type, old_mode, &unsignedp, 1);
-
- if (mode != old_mode)
- val = convert_modes (mode, old_mode, val, unsignedp);
-#endif
+ if (targetm.calls.promote_function_return (TREE_TYPE (current_function_decl)))
+ {
+ int unsignedp = TREE_UNSIGNED (type);
+ enum machine_mode old_mode
+ = DECL_MODE (DECL_RESULT (current_function_decl));
+ enum machine_mode mode
+ = promote_mode (type, old_mode, &unsignedp, 1);
+
+ if (mode != old_mode)
+ val = convert_modes (mode, old_mode, val, unsignedp);
+ }
if (GET_CODE (return_reg) == PARALLEL)
- emit_group_load (return_reg, val, int_size_in_bytes (type));
+ emit_group_load (return_reg, val, type, int_size_in_bytes (type));
else
emit_move_insn (return_reg, val);
}
@@ -3083,7 +3075,7 @@ expand_return (tree retval)
int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
unsigned int bitsize
= MIN (TYPE_ALIGN (TREE_TYPE (retval_rhs)), BITS_PER_WORD);
- rtx *result_pseudos = (rtx *) alloca (sizeof (rtx) * n_regs);
+ rtx *result_pseudos = alloca (sizeof (rtx) * n_regs);
rtx result_reg, src = NULL_RTX, dst = NULL_RTX;
rtx result_val = expand_expr (retval_rhs, NULL_RTX, VOIDmode, 0);
enum machine_mode tmpmode, result_reg_mode;
@@ -3258,7 +3250,7 @@ tail_recursion_args (tree actuals, tree formals)
/* Compute all the actuals. */
- argvec = (rtx *) alloca (i * sizeof (rtx));
+ argvec = alloca (i * sizeof (rtx));
for (a = actuals, i = 0; a; a = TREE_CHAIN (a), i++)
argvec[i] = expand_expr (TREE_VALUE (a), NULL_RTX, VOIDmode, 0);
@@ -3639,7 +3631,7 @@ warn_about_unused_variables (tree vars)
&& ! TREE_USED (decl)
&& ! DECL_IN_SYSTEM_HEADER (decl)
&& DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl))
- warning_with_decl (decl, "unused variable `%s'");
+ warning ("%Junused variable '%D'", decl, decl);
}
/* Generate RTL code to terminate a binding contour.
@@ -3699,8 +3691,8 @@ expand_end_bindings (tree vars, int mark_ends, int dont_jump_in)
that must be an error, because gotos without fixups
come from outside all saved stack-levels. */
if (TREE_ADDRESSABLE (chain->label))
- error_with_decl (chain->label,
- "label `%s' used before containing binding contour");
+ error ("%Jlabel '%D' used before containing binding contour",
+ chain->label, chain->label);
}
}
@@ -3984,13 +3976,13 @@ expand_decl_init (tree decl)
if (code == INTEGER_TYPE || code == REAL_TYPE || code == ENUMERAL_TYPE
|| code == POINTER_TYPE || code == REFERENCE_TYPE)
expand_assignment (decl, convert (TREE_TYPE (decl), integer_zero_node),
- 0, 0);
+ 0);
emit_queue ();
}
else if (DECL_INITIAL (decl) && TREE_CODE (DECL_INITIAL (decl)) != TREE_LIST)
{
emit_line_note (DECL_SOURCE_LOCATION (decl));
- expand_assignment (decl, DECL_INITIAL (decl), 0, 0);
+ expand_assignment (decl, DECL_INITIAL (decl), 0);
emit_queue ();
}
@@ -4593,7 +4585,7 @@ add_case_node (tree low, tree high, tree label, tree *duplicate)
/* Add this label to the chain, and succeed. */
- r = (struct case_node *) ggc_alloc (sizeof (struct case_node));
+ r = ggc_alloc (sizeof (struct case_node));
r->low = low;
/* If the bounds are equal, turn this into the one-value case. */
@@ -5026,8 +5018,7 @@ check_for_full_enumeration_handling (tree type)
/* We deliberately use calloc here, not cmalloc, so that we can suppress
this optimization if we don't have enough memory rather than
aborting, as xmalloc would do. */
- && (cases_seen =
- (unsigned char *) really_call_calloc (bytes_needed, 1)) != NULL)
+ && (cases_seen = really_call_calloc (bytes_needed, 1)) != NULL)
{
HOST_WIDE_INT i;
tree v = TYPE_VALUES (type);
@@ -5427,7 +5418,8 @@ expand_end_case_type (tree orig_index, tree orig_type)
because we can optimize it. */
else if (count < case_values_threshold ()
- || compare_tree_int (range, 10 * count) > 0
+ || compare_tree_int (range,
+ (optimize_size ? 3 : 10) * count) > 0
/* RANGE may be signed, and really large ranges will show up
as negative numbers. */
|| compare_tree_int (range, 0) < 0
@@ -5541,8 +5533,8 @@ expand_end_case_type (tree orig_index, tree orig_type)
/* Get table of labels to jump to, in order of case index. */
ncases = tree_low_cst (range, 0) + 1;
- labelvec = (rtx *) alloca (ncases * sizeof (rtx));
- memset ((char *) labelvec, 0, ncases * sizeof (rtx));
+ labelvec = alloca (ncases * sizeof (rtx));
+ memset (labelvec, 0, ncases * sizeof (rtx));
for (n = thiscase->data.case_stmt.case_list; n; n = n->right)
{
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 403f8ab4ea5..728b70bf9c6 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -344,7 +344,8 @@ do_type_align (tree type, tree decl)
if (TYPE_ALIGN (type) > DECL_ALIGN (decl))
{
DECL_ALIGN (decl) = TYPE_ALIGN (type);
- DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (type);
+ if (TREE_CODE (decl) == FIELD_DECL)
+ DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (type);
}
}
@@ -515,10 +516,10 @@ layout_decl (tree decl, unsigned int known_align)
int size_as_int = TREE_INT_CST_LOW (size);
if (compare_tree_int (size, size_as_int) == 0)
- warning_with_decl (decl, "size of `%s' is %d bytes", size_as_int);
+ warning ("%Jsize of '%D' is %d bytes", decl, decl, size_as_int);
else
- warning_with_decl (decl, "size of `%s' is larger than %d bytes",
- larger_than_size);
+ warning ("%Jsize of '%D' is larger than %d bytes",
+ decl, decl, larger_than_size);
}
}
@@ -553,8 +554,7 @@ set_lang_adjust_rli (void (*f) (record_layout_info))
record_layout_info
start_record_layout (tree t)
{
- record_layout_info rli
- = (record_layout_info) xmalloc (sizeof (struct record_layout_info_s));
+ record_layout_info rli = xmalloc (sizeof (struct record_layout_info_s));
rli->t = t;
@@ -884,9 +884,11 @@ place_field (record_layout_info rli, tree field)
if (TYPE_ALIGN (type) > desired_align)
{
if (STRICT_ALIGNMENT)
- warning_with_decl (field, "packed attribute causes inefficient alignment for `%s'");
+ warning ("%Jpacked attribute causes inefficient alignment "
+ "for '%D'", field, field);
else
- warning_with_decl (field, "packed attribute is unnecessary for `%s'");
+ warning ("%Jpacked attribute is unnecessary for '%D'",
+ field, field);
}
}
else
@@ -901,7 +903,7 @@ place_field (record_layout_info rli, tree field)
Bump the cumulative size to multiple of field alignment. */
if (warn_padded)
- warning_with_decl (field, "padding struct to align `%s'");
+ warning ("%Jpadding struct to align '%D'", field, field);
/* If the alignment is still within offset_align, just align
the bit position. */
@@ -1089,6 +1091,7 @@ place_field (record_layout_info rli, tree field)
rli->prev_field = NULL;
}
+ rli->offset_align = tree_low_cst (TYPE_SIZE (type), 0);
normalize_rli (rli);
}
@@ -1310,8 +1313,6 @@ compute_record_mode (tree type)
BLKmode only because it isn't aligned. */
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
{
- unsigned HOST_WIDE_INT bitpos;
-
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -1323,19 +1324,6 @@ compute_record_mode (tree type)
|| ! host_integerp (DECL_SIZE (field), 1))
return;
- bitpos = int_bit_position (field);
-
- /* Must be BLKmode if any field crosses a word boundary,
- since extract_bit_field can't handle that in registers. */
- if (bitpos / BITS_PER_WORD
- != ((tree_low_cst (DECL_SIZE (field), 1) + bitpos - 1)
- / BITS_PER_WORD)
- /* But there is no problem if the field is entire words
- or bigger than a word. */
- && ! (tree_low_cst (DECL_SIZE (field), 1) % BITS_PER_WORD == 0
- || compare_tree_int (DECL_SIZE (field), BITS_PER_WORD) > 0))
- return;
-
/* If this field is the whole struct, remember its mode so
that, say, we can put a double in a class into a DF
register instead of forcing it to live in the stack. */
@@ -1957,7 +1945,8 @@ set_sizetype (tree type)
for the sizes in them. */
for (t = early_type_list; t != 0; t = TREE_CHAIN (t))
{
- if (TREE_CODE (TREE_VALUE (t)) != INTEGER_TYPE)
+ if (TREE_CODE (TREE_VALUE (t)) != INTEGER_TYPE
+ && TREE_CODE (TREE_VALUE (t)) != BOOLEAN_TYPE)
abort ();
TREE_TYPE (TYPE_SIZE (TREE_VALUE (t))) = bitsizetype;
@@ -1968,6 +1957,58 @@ set_sizetype (tree type)
sizetype_set = 1;
}
+/* TYPE is an integral type, i.e., an INTEGRAL_TYPE, ENUMERAL_TYPE,
+ BOOLEAN_TYPE, or CHAR_TYPE. Set TYPE_MIN_VALUE and TYPE_MAX_VALUE
+ for TYPE, based on the PRECISION and whether or not the TYPE
+ IS_UNSIGNED. PRECISION need not correspond to a width supported
+ natively by the hardware; for example, on a machine with 8-bit,
+ 16-bit, and 32-bit register modes, PRECISION might be 7, 23, or
+ 61. */
+
+void
+set_min_and_max_values_for_integral_type (tree type,
+ int precision,
+ bool is_unsigned)
+{
+ tree min_value;
+ tree max_value;
+
+ if (is_unsigned)
+ {
+ min_value = build_int_2 (0, 0);
+ max_value
+ = build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
+ ? -1 : ((HOST_WIDE_INT) 1 << precision) - 1,
+ precision - HOST_BITS_PER_WIDE_INT > 0
+ ? ((unsigned HOST_WIDE_INT) ~0
+ >> (HOST_BITS_PER_WIDE_INT
+ - (precision - HOST_BITS_PER_WIDE_INT)))
+ : 0);
+ }
+ else
+ {
+ min_value
+ = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
+ ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
+ (((HOST_WIDE_INT) (-1)
+ << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
+ ? precision - HOST_BITS_PER_WIDE_INT - 1
+ : 0))));
+ max_value
+ = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
+ ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
+ (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
+ ? (((HOST_WIDE_INT) 1
+ << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
+ : 0));
+ }
+
+ TREE_TYPE (min_value) = type;
+ TREE_TYPE (max_value) = type;
+ TYPE_MIN_VALUE (type) = min_value;
+ TYPE_MAX_VALUE (type) = max_value;
+}
+
/* Set the extreme values of TYPE based on its precision in bits,
then lay it out. Used when make_signed_type won't do
because the tree code is not INTEGER_TYPE.
@@ -1984,23 +2025,8 @@ fixup_signed_type (tree type)
if (precision > HOST_BITS_PER_WIDE_INT * 2)
precision = HOST_BITS_PER_WIDE_INT * 2;
- TYPE_MIN_VALUE (type)
- = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
- ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
- (((HOST_WIDE_INT) (-1)
- << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
- ? precision - HOST_BITS_PER_WIDE_INT - 1
- : 0))));
- TYPE_MAX_VALUE (type)
- = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
- ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
- (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
- ? (((HOST_WIDE_INT) 1
- << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
- : 0));
-
- TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
- TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
+ set_min_and_max_values_for_integral_type (type, precision,
+ /*is_unsigned=*/false);
/* Lay out the type: set its alignment, size, etc. */
layout_type (type);
@@ -2021,17 +2047,8 @@ fixup_unsigned_type (tree type)
if (precision > HOST_BITS_PER_WIDE_INT * 2)
precision = HOST_BITS_PER_WIDE_INT * 2;
- TYPE_MIN_VALUE (type) = build_int_2 (0, 0);
- TYPE_MAX_VALUE (type)
- = build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
- ? -1 : ((HOST_WIDE_INT) 1 << precision) - 1,
- precision - HOST_BITS_PER_WIDE_INT > 0
- ? ((unsigned HOST_WIDE_INT) ~0
- >> (HOST_BITS_PER_WIDE_INT
- - (precision - HOST_BITS_PER_WIDE_INT)))
- : 0);
- TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
- TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
+ set_min_and_max_values_for_integral_type (type, precision,
+ /*is_unsigned=*/true);
/* Lay out the type: set its alignment, size, etc. */
layout_type (type);
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index 01e54ac8270..0cf3be14f88 100644
--- a/gcc/stringpool.c
+++ b/gcc/stringpool.c
@@ -95,6 +95,8 @@ ggc_alloc_string (const char *contents, int length)
If an identifier with that name has previously been referred to,
the same node is returned this time. */
+#undef get_identifier
+
tree
get_identifier (const char *text)
{
@@ -110,7 +112,7 @@ get_identifier (const char *text)
known. */
tree
-get_identifier_with_length (const char *text, unsigned int length)
+get_identifier_with_length (const char *text, size_t length)
{
hashnode ht_node = ht_lookup (ident_hash,
(const unsigned char *) text,
diff --git a/gcc/stub-objc.c b/gcc/stub-objc.c
new file mode 100644
index 00000000000..4e7a1987a39
--- /dev/null
+++ b/gcc/stub-objc.c
@@ -0,0 +1,71 @@
+/* Stub functions for Objective-C and Objective-C++ routines
+ that are called from within the C and C++ front-ends,
+ respectively.
+ Copyright (C) 1991, 1995, 1997, 1998,
+ 1999, 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. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree.h"
+#include "c-common.h"
+
+tree
+lookup_interface (tree arg ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+tree
+is_class_name (tree arg ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+tree
+objc_is_object_ptr (tree arg ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+tree
+lookup_objc_ivar (tree arg ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+void
+objc_check_decl (tree decl ATTRIBUTE_UNUSED)
+{
+}
+
+int
+objc_comptypes (tree lhs ATTRIBUTE_UNUSED, tree rhs ATTRIBUTE_UNUSED,
+ int reflexive ATTRIBUTE_UNUSED)
+{
+ return -1;
+}
+
+tree
+objc_message_selector (void)
+{
+ return 0;
+}
+
diff --git a/gcc/system.h b/gcc/system.h
index 3a7e18038a7..aa71fbbfdb9 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -586,13 +586,14 @@ typedef char _Bool;
WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \
ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL \
ASM_OUTPUT_MI_THUNK CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS \
- ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_START ASM_FILE_END
+ ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_START ASM_FILE_END \
+ ASM_SIMPLIFY_DWARF_ADDR
/* 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
been used. */
#pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG CPP_PREDEFINES \
- ASM_OUTPUT_EH_REGION_END ASM_OUTPUT_LABELREF_AS_INT \
+ ASM_OUTPUT_EH_REGION_END ASM_OUTPUT_LABELREF_AS_INT SMALL_STACK \
DOESNT_NEED_UNWINDER EH_TABLE_LOOKUP OBJC_SELECTORS_WITHOUT_LABELS \
OMIT_EH_TABLE EASY_DIV_EXPR IMPLICIT_FIX_EXPR \
LONGJMP_RESTORE_FROM_STACK MAX_INT_TYPE_SIZE ASM_IDENTIFY_GCC \
@@ -609,11 +610,12 @@ typedef char _Bool;
DBX_LBRAC_FIRST DBX_OUTPUT_ENUM DBX_OUTPUT_SOURCE_FILENAME \
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
+ EXIT_BODY OBJECT_FORMAT_ROSE MULTIBYTE_CHARS MAP_CHARACTER \
+ LIBGCC_NEEDS_DOUBLE
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
- LANG_HOOKS_MARK_TREE
+ LANG_HOOKS_MARK_TREE LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
/* Libiberty macros that are no longer used in GCC. */
#undef ANSI_PROTOTYPES
diff --git a/gcc/target-def.h b/gcc/target-def.h
index e3c4df1d670..da6003eff5c 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -305,6 +305,30 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_MACHINE_DEPENDENT_REORG 0
+#define TARGET_PROMOTE_FUNCTION_ARGS default_promote_function_args
+#define TARGET_PROMOTE_FUNCTION_RETURN default_promote_function_return
+#define TARGET_PROMOTE_PROTOTYPES default_promote_prototypes
+
+#define TARGET_STRUCT_VALUE_RTX default_struct_value_rtx
+#define TARGET_RETURN_IN_MEMORY default_return_in_memory
+
+#define TARGET_EXPAND_BUILTIN_SAVEREGS default_expand_builtin_saveregs
+#define TARGET_SETUP_INCOMING_VARARGS default_setup_incoming_varargs
+#define TARGET_STRICT_ARGUMENT_NAMING default_strict_argument_naming
+#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED default_pretend_outgoing_varargs_named
+
+#define TARGET_CALLS { \
+ TARGET_PROMOTE_FUNCTION_ARGS, \
+ TARGET_PROMOTE_FUNCTION_RETURN, \
+ TARGET_PROMOTE_PROTOTYPES, \
+ TARGET_STRUCT_VALUE_RTX, \
+ TARGET_RETURN_IN_MEMORY, \
+ TARGET_EXPAND_BUILTIN_SAVEREGS, \
+ TARGET_SETUP_INCOMING_VARARGS, \
+ TARGET_STRICT_ARGUMENT_NAMING, \
+ TARGET_PRETEND_OUTGOING_VARARGS_NAMED, \
+ }
+
/* The whole shebang. */
#define TARGET_INITIALIZER \
{ \
@@ -345,6 +369,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_TERMINATE_DW2_EH_FRAME_INFO, \
TARGET_ASM_FILE_START_APP_OFF, \
TARGET_ASM_FILE_START_FILE_DIRECTIVE, \
+ TARGET_CALLS, \
}
#include "hooks.h"
+#include "targhooks.h"
diff --git a/gcc/target.h b/gcc/target.h
index 8acfb7ab26f..3a7ea78af38 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -386,6 +386,23 @@ struct gcc_target
/* True if output_file_directive should be called for main_input_filename
at the beginning of assembly output. */
bool file_start_file_directive;
+
+ /* Functions relating to calls - argument passing, returns, etc. */
+ struct calls {
+ bool (*promote_function_args) (tree fntype);
+ bool (*promote_function_return) (tree fntype);
+ bool (*promote_prototypes) (tree fntype);
+ rtx (*struct_value_rtx) (tree fndecl, int incoming);
+ bool (*return_in_memory) (tree type, tree fndecl);
+ rtx (*expand_builtin_saveregs) (void);
+ /* Returns pretend_argument_size. */
+ void (*setup_incoming_varargs) (CUMULATIVE_ARGS *ca, enum machine_mode mode,
+ tree type, int *pretend_arg_size, int second_time);
+ bool (*strict_argument_naming) (CUMULATIVE_ARGS *ca);
+ /* Returns true if we should use SETUP_INCOMING_VARARGS and/or
+ STRICT_ARGUMENT_NAMING. */
+ bool (*pretend_outgoing_varargs_named) (CUMULATIVE_ARGS *ca);
+ } calls;
};
extern struct gcc_target targetm;
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
new file mode 100644
index 00000000000..97d0642540b
--- /dev/null
+++ b/gcc/targhooks.c
@@ -0,0 +1,191 @@
+/* Default target hook functions.
+ 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. */
+
+/* The migration of target macros to target hooks works as follows:
+
+ 1. Create a target hook that uses the existing target macros to
+ implement the same functionality.
+
+ 2. Convert all the MI files to use the hook instead of the macro.
+
+ 3. Repeat for a majority of the remaining target macros. This will
+ take some time.
+
+ 4. Tell target maintainers to start migrating.
+
+ 5. Eventually convert the backends to override the hook instead of
+ defining the macros. This will take some time too.
+
+ 6. TBD when, poison the macros. Unmigrated targets will break at
+ this point.
+
+ Note that we expect steps 1-3 to be done by the people that
+ understand what the MI does with each macro, and step 5 to be done
+ by the target maintainers for their respective targets.
+
+ Note that steps 1 and 2 don't have to be done together, but no
+ target can override the new hook until step 2 is complete for it.
+
+ Once the macros are poisoned, we will revert to the old migration
+ rules - migrate the macro, callers, and targets all at once. This
+ comment can thus be removed at that point. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "machmode.h"
+#include "rtl.h"
+#include "tree.h"
+#include "expr.h"
+#include "toplev.h"
+#include "function.h"
+#include "target.h"
+#include "tm_p.h"
+#include "target-def.h"
+
+bool
+default_promote_function_args (fntype)
+ tree fntype ATTRIBUTE_UNUSED;
+{
+#ifdef PROMOTE_FUNCTION_ARGS
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool
+default_promote_function_return (fntype)
+ tree fntype ATTRIBUTE_UNUSED;
+{
+#ifdef PROMOTE_FUNCTION_RETURN
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool
+default_promote_prototypes (fntype)
+ tree fntype ATTRIBUTE_UNUSED;
+{
+ if (PROMOTE_PROTOTYPES)
+ return true;
+ else
+ return false;
+}
+
+rtx
+default_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED, int incoming)
+{
+ rtx rv = 0;
+ if (incoming)
+ {
+#ifdef STRUCT_VALUE_INCOMING
+ rv = STRUCT_VALUE_INCOMING;
+#else
+#ifdef STRUCT_VALUE_INCOMING_REGNUM
+ rv = gen_rtx_REG (Pmode, STRUCT_VALUE_INCOMING_REGNUM);
+#else
+#ifdef STRUCT_VALUE
+ rv = STRUCT_VALUE;
+#else
+#ifndef STRUCT_VALUE_REGNUM
+ abort();
+#else
+ rv = gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM);
+#endif
+#endif
+#endif
+#endif
+ }
+ else
+ {
+#ifdef STRUCT_VALUE
+ rv = STRUCT_VALUE;
+#else
+#ifndef STRUCT_VALUE_REGNUM
+ abort();
+#else
+ rv = gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM);
+#endif
+#endif
+ }
+ return rv;
+}
+
+bool
+default_return_in_memory (tree type,
+ tree fntype ATTRIBUTE_UNUSED)
+{
+#ifndef RETURN_IN_MEMORY
+ return (TYPE_MODE (type) == BLKmode);
+#else
+ return RETURN_IN_MEMORY (type);
+#endif
+}
+
+rtx
+default_expand_builtin_saveregs (void)
+{
+#ifdef EXPAND_BUILTIN_SAVEREGS
+ return EXPAND_BUILTIN_SAVEREGS ();
+#else
+ error ("__builtin_saveregs not supported by this target");
+ return const0_rtx;
+#endif
+}
+
+void
+default_setup_incoming_varargs (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED,
+ int *pretend_arg_size ATTRIBUTE_UNUSED,
+ int second_time ATTRIBUTE_UNUSED)
+{
+#ifdef SETUP_INCOMING_VARARGS
+ SETUP_INCOMING_VARARGS ((*ca), mode, type, (*pretend_arg_size), second_time);
+#endif
+}
+
+bool
+default_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
+{
+#ifdef STRICT_ARGUMENT_NAMING
+ return STRICT_ARGUMENT_NAMING;
+#else
+ return 0;
+#endif
+}
+
+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
+}
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
new file mode 100644
index 00000000000..335134b81b1
--- /dev/null
+++ b/gcc/targhooks.h
@@ -0,0 +1,31 @@
+/* Default target hook functions.
+ 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. */
+
+extern bool default_promote_function_args (tree);
+extern bool default_promote_function_return (tree);
+extern bool default_promote_prototypes (tree);
+
+extern rtx default_struct_value_rtx (tree, int);
+extern bool default_return_in_memory (tree, tree);
+
+extern rtx default_expand_builtin_saveregs (void);
+extern void default_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
+extern bool default_strict_argument_naming (CUMULATIVE_ARGS *);
+extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4dd76b7ace2..f76ae98db5f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,1163 @@
+2003-09-19 Ziemowit Laski <zlaski@apple.com>
+
+ PR objc/12262
+ * objc.dg/method-12.m: New test.
+ PR objc/12309
+ * objc.dg/missing-proto-3.m: New test.
+
+2003-09-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/12281
+ * gcc.c-torture/compile/20030921-1.c: New test.
+
+2003-09-22 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/opt/reg-stack2.C: New test.
+
+2003-09-21 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+ * g++.dg/eh/delayslot1.C: New test.
+
+2003-09-20 Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/format/gcc_diag-1.c: Add tests for %J.
+
+2003-09-20 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.c-torture/execute/20030920-1.c: New test case.
+
+2003-09-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * g++.dg/rtti/typeid3.C: Correct expected error message.
+
+2003-09-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/157
+ * g++.dg/parse/crash12.C: New test.
+
+2003-09-19 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/compat/mixed-struct-check.h: New.
+ * gcc.dg/compat/mixed-struct-defs.h: New.
+ * gcc.dg/compat/mixed-struct-init.h: New.
+ * gcc.dg/compat/struct-by-value-19_main.c: New.
+ * gcc.dg/compat/struct-by-value-19_x.c: New.
+ * gcc.dg/compat/struct-by-value-19_y.c: New.
+ * gcc.dg/compat/struct-by-value-20_main.c: New.
+ * gcc.dg/compat/struct-by-value-20_x.c: New.
+ * gcc.dg/compat/struct-by-value-20_y.c: New.
+ * gcc.dg/compat/struct-return-19_main.c: New.
+ * gcc.dg/compat/struct-return-19_x.c: New.
+ * gcc.dg/compat/struct-return-19_y.c: New.
+ * gcc.dg/compat/struct-return-20_main.c: New.
+ * gcc.dg/compat/struct-return-20_x.c: New.
+ * gcc.dg/compat/struct-return-20_y.c: New.
+
+2003-09-19 Andrew Pinski <pinskia@physics.uc.edu>
+ * g++.dg/init/array11.C: Change unsigned to __SIZE_TYPE__
+ so that it will not complain on LP64 targets.
+
+2003-09-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/495
+ * g++.dg/template/friend24.C: New test.
+
+2003-09-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12332
+ * g++.dg/template/memtmpl2.C: New test.
+
+2003-09-18 Mark Mitchell <mark@codesourcery.com>
+
+ PR target/11184
+ * gcc.dg/builtin-apply1.c: New test.
+
+2003-09-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9848
+ * g++.dg/warn/Wunused-4.C: New test.
+
+2003-09-18 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/12316
+ * g++.dg/other/gc2.C: New test.
+
+2003-09-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11991
+ * g++.dg/rtti/typeid3.C: New test.
+
+ PR c++/12266
+ * g++.dg/overload/template1.C: New test.
+
+2003-09-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/opt/cfg3.C: New test.
+
+2003-09-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/7939
+ * g++.dg/template/crash11.C: New test.
+
+2003-09-16 Jason Merrill <jason@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/attr-warn-unused-result.c: New test.
+
+2003-09-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12184
+ * g++.dg/expr/call2.C: New test.
+
+2003-09-15 Andreas Jaeger <aj@suse.de>
+
+ * gcc.dg/Wold-style-definition-1.c: New test.
+
+2003-09-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/3907
+ * g++.dg/parse/template12.C: New test.
+
+ * g++.dg/abi/bitfield11.C: New test.
+ * g++.dg/abi/bitfield12.C: Likewise.
+
+2003-09-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc.dg/cpp/separate-1.c: Adjust line of error. Test for correct
+ non-expansion of functional macro name without arguments at EOL.
+ * gcc.dg/cpp/spacing1.c: Revert 2003-08-04's change. Likewise.
+
+2003-09-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * gcc.c-torture/execute/20030914-[12].c: New tests.
+
+2003-09-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11788
+ * g++.dg/overload/addr1.C: New test.
+
+2003-09-10 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * gcc.dg/20030909-1.c: New test.
+
+2003-09-10 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/ultrasp10.c: New test.
+
+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.
+
+2003-09-08 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.dg/ia64-types1.c: New test.
+ * gcc.dg/ia64-types2.c: Likewise.
+
+2003-09-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/builtins-1.c: Add more _Complex tests.
+ * gcc.dg/torture/builtin-attr-1.c: Likewise.
+
+ * gcc.dg/builtins-1.c: Test existing _Complex functions.
+ * gcc.dg/torture/builtin-attr-1.c: Likewise.
+
+2003-09-08 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11786
+ * g++.dg/lookup/koenig2.C: New test.
+
+ PR c++/5296
+ * g++.dg/rtti/typeid2.C: New test.
+
+2003-09-08 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20030904-1.c: New test.
+
+2003-09-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/opt/longbranch2.C: New test.
+
+2003-09-07 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * g++.dg/template/crash10.C: Only compile it.
+
+2003-09-07 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR middle-end/11665
+ * gcc.c-torture/compile/20030907-1.c: New test.
+ * g++.dg/init/array11.C: New test.
+
+2003-09-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11852
+ * g++.dg/init/struct1.C: New test.
+
+2003-09-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12181
+ * g++.dg/expr/comma1.C: New test.
+
+2003-09-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11867
+ * g++.dg/expr/static_cast5.C: New test.
+
+2003-09-06 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/11507
+ * g++.dg/lookup/scoped7.C: New test.
+
+ PR c++/9574
+ * g++.dg/other/static1.C: New test.
+
+ PR c++/11490
+ * g++.dg/warn/template-1.C: New test.
+
+ 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.
+
+2003-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11794
+ * g++.dg/parse/using3.C: New test.
+
+2003-09-06 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/11409
+ * g++.dg/overload/builtin3.C: New test case.
+
+2003-09-06 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c/9862
+ * gcc.dg/20030906-1.c: New test.
+ * gcc.dg/20030906-2.c: Likewise.
+
+2003-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12167
+ * g++.dg/parse/defarg5.C: New test.
+
+ * g++.dg/template/non-type-template-argument-1.C: Tweak expected error.
+
+2003-09-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12163
+ * g++.dg/expr/static_cast4.C: New test.
+
+ PR c++/12146
+ * g++.dg/template/crash9.C: New test.
+
+2003-09-05 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * g++.old-deja/g++.ext/pretty2.C: Update for change
+ in __FUNCTION__.
+ * g++.old-deja/g++.ext/pretty3.C: Likewise.
+
+2003-09-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11922
+ * g++/dg/template/qualified-id1.C: New test.
+
+ PR c++/12037
+ * g++.dg/warn/noeffect4.C: New test.
+
+2003-09-04 Matt Austern <austern@apple.com>
+
+ * 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.
+ * g++.dg/ext/lvcast.C: Remove.
+
+2003-09-03 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/11700.
+ * gcc.c-torture/compile/20030903-1.c: New test case.
+
+2003-09-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12053
+ * g++.dg/abi/layout4.C: New test.
+
+2003-09-02 Scott Brumbaugh <scottb.lists@verizon.net>
+
+ PR c++/11553
+ * g++.dg/parse/friend3.C: New test.
+
+2003-09-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11847
+ * g++.dg/template/class1.C: New test.
+
+ PR c++/11808
+ * g++.dg/expr/call1.C: New test.
+
+2003-09-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12114
+ * g++.dg/init/ref9.C: New test.
+
+ PR c++/11972
+ * g++.dg/template/nested4.C: New test.
+
+2003-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12093
+ * g++.dg/template/non-dependent4.C: New test.
+
+ PR c++/11928
+ * g++.dg/inherit/conv1.C: New test.
+
+2003-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/6196
+ * g++.dg/ext/label1.C: New test.
+ * g++.dg/ext/label2.C: Likewise.
+
+2003-08-28 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/expr/cond3.C: New test.
+
+2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/builtins-1.c: Add new builtin cases.
+
+2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/builtins-1.c: Add new cases.
+ * gcc.dg/torture/builtin-attr-1.c: Likewise.
+
+2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/builtins-1.c: Add more math builtin tests.
+ * gcc.dg/torture/builtin-attr-1.c: New test.
+
+2003-08-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR optimization/5079
+ * g++.dg/opt/static3.C: New test.
+
+2003-08-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcc.misc-tests/gcov-10b.c: New test.
+
+2003-08-27 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/opt/ptrmem3.C: New test.
+
+ * g++.old-deja/g++.pt/overload8.C: Remove XFAIL.
+
+2003-08-27 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20030826-2.c: New test.
+
+2003-08-26 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/12002
+ * g77.f-torture/compile/12002.f: New test case.
+
+2003-08-26 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/20030826-1.c: New test case.
+
+2003-08-26 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * gcc.dg/noncompile/20030818-1.c: Expect second line of error.
+
+2003-08-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11871
+ * c++.dg/lookup/crash1.C: New test.
+
+ * c++.dg/warn/noeffect3.C: New test.
+
+2003-08-25 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/compat/vector-1_x.c: Compile with -w.
+ * gcc.dg/compat/vector-1_y.c: Ditto.
+ * gcc.dg/compat/vector-2_x.c: Ditto.
+ * gcc.dg/compat/vector-2_y.c: Ditto.
+
+2003-08-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gcc.dg/20030702-1.c: New test.
+
+2003-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8795
+ * g++.dg/ext/altivec-1.C: New test.
+
+2003-08-24 Richard Henderson <rth@redhat.com>
+
+ * g++.dg/eh/simd-2.C: Add -w for x86.
+
+2003-08-23 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20030815-1.c: New test.
+
+2003-08-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/3765
+ * g++.dg/parse/access6.C: New test.
+
+2003-08-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/641, c++/11876
+ * g++.dg/template/friend22.C: New test.
+ * g++.dg/template/friend23.C: Likewise.
+
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.misc-tests/linkage.exp: Treat all HP-UX platforms
+ identically.
+
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.old-deja/g++.ext/attrib5.C: XFAIL on hppa2*-hp-hpux11*.
+
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.dg/20020313-1.c: Add "-w" to dg-options.
+
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.misc-tests/linkage.exp: Add logic for ia64-hp-hpux*.
+
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/other/packed1.C: Add XFAIL marker for ia64-hp-hpux*.
+
+2003-08-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11919
+ * g++.dg/overload/prom1.C: New test.
+
+ PR c++/11551
+ * g++.dg/parse/dtor2.C: New test.
+
+ PR c++/10762
+ * g++.dg/parse/using2.C: New test.
+
+2003-08-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/11805
+ * gcc.c-torture/compile/20030821-1.c: New.
+
+2003-08-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11834
+ * g++.dg/template/deduce2.C: New test.
+
+2003-08-21 Josef Zlomek <zlomekj@suse.cz>
+
+ * gcc.c-torture/execute/20030821-1.c: New test.
+
+2003-08-20 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/11984
+ * gcc.dg/20030820-1.c: New test case.
+
+2003-08-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11945
+ * g++.dg/warn/noeffect2.C: New test.
+
+2003-08-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10926
+ * g++.dg/template/dtor2.C: New test.
+
+ PR c++/11684
+ * g++.dg/template/operator1.C: New test.
+ * g++.dg/parse/operator4.C: New test.
+
+ PR c++/11946.C
+ * g++.dg/expr/enum1.C: New test.
+ * gcc.dg/c99-bool-1.c: Remove bogus warning.
+
+ PR c++/11036.C
+ * g++.dg/parse/elab2.C: New test.
+ * g++.dg/parse/typedef4.C: Change error message.
+ * g++.old-deja/g++.robertl/eb133.C: Remove bogus error markers.
+ * g++.old-deja/g++.robertl/eb133a.C: Remove bogus error markers.
+ * g++.old-deja/g++.robertl/eb133b.C: Remove bogus error markers.
+
+2003-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.dg/pch/warn-1.c: New.
+ * gcc.dg/pch/warn-1.hs: New.
+
+ * lib/dg-pch.exp (dg-pch): Use 'return' not 'continue' to skip
+ not-tested file.
+
+2003-08-19 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * gcc.dg/uninit-E.c: Add forgotten dg-warning marker.
+
+2003-08-19 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * gcc.dg/uninit-D.c: New Test.
+ * gcc.dg/uninit-E.c: New Test.
+ * gcc.dg/uninit-F.c: New Test.
+ * gcc.dg/uninit-G.c: New Test.
+
+2003-08-19 Michael Ritzert <ritzert@t-online.de>
+
+ * g++.dg/README: Describe the pch directory.
+
+2003-08-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11174
+ * g++.dg/parse/access4.C: New test.
+ * g++.dg/parse/access5.C: Likewise.
+ * g++.old-deja/g++.jason/access17.C: Adjust error message.
+
+2003-08-18 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * gcc.dg/noncompile/20030818-1.c: New.
+
+2003-08-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11957
+ * g++.dg/warn/noeffect1.C: New test.
+
+ * g++.dg/template/scope2.C: New test.
+ * g++.dg/template/error2.C: Correct dg-error
+
+2003-08-18 Richard Sandiford <rsandifo@redhat.com>
+
+ * gcc.c-torture/compile/mipscop*.c: Turn into compile-only tests.
+
+2003-08-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR C++/11512
+ * g++.dg/template/warn1.C: New.
+
+2003-08-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/template/error2.C: New test.
+ * g++.dg/lookup/using7.C: Adjust errors
+ * g++.old-deja/g++.pt/crash36.C: Likewise.
+ * g++.old-deja/g++.pt/derived3.C: Likewise.
+
+2003-08-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.c-torture/execute/builtins/lib/strcat.c: New.
+ * gcc.c-torture/execute/builtins/string-9-lib.c: New.
+ * gcc.c-torture/execute/builtins/string-9.c: New, from
+ string-opt-9.c. Adjust for execute/builtins framework.
+ * gcc.c-torture/execute/string-opt-9.c: Delete.
+
+2003-08-12 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/init/new8.C: Use __SIZE_TYPE__ to get the type of size_t.
+
+ * g++.dg/parse/ret-type2.C: New test.
+
+ PR c++/11703
+ * g++.dg/init/new8.C: New test.
+
+ PR c++/10923
+ * g++.dg/parse/typedef5.C: New test.
+
+ PR c++/9512
+ * g++.dg/parse/qualified2.C: New test.
+ * g++.old-deja/g++.other/decl5.C: Mark one more instance of
+ invalid code.
+
+2003-08-11 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/conversion/ptrmem1.C: New test.
+
+2003-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/11693
+ * gcc.dg/20030811-1.c: New test.
+
+ PR target/11535
+ * gcc.c-torture/execute/20030811-1.c: New test.
+
+2003-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.c-torture/execute/string-opt-9.c: Add more strcat cases.
+
+2003-08-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11789.C
+ * g++.dg/inherit/multiple1.C: New test.
+
+2003-08-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcc.dg/spe1.c: New test.
+
+ PR c++/11670
+ * g++.dg/expr/cast2.C: New test.
+
+ PR c++/10530
+ * g++.dg/template/dependent-name2.C: New test.
+
+2003-08-08 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * g++.dg/parse/crash11.C: Put the dg options in comments.
+
+2003-08-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * lib/gcc-dg.exp: Update for diagnostic change.
+
+2003-08-07 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5767
+ * g++.dg/parse/crash11.C: New test.
+
+2003-08-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc.dg/cpp/spacing1.c: Update.
+
+2003-08-04 Janis Johnson <janis187@us.ibm.com>
+
+ PR target/11739
+ * gcc.misc-tests/i386-prefetch.exp: Use -march=i386 when specifying
+ a value for -mtune.
+
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/11771
+ * gcc.c-torture/compile/20030804-1.c: New test case.
+
+2003-08-04 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/20030804-1.c: New test case.
+
+2003-08-04 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc.dg/cpp/separate-1.c: New test.
+
+2003-08-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11704
+ * g++.dg/template/dependent-expr2.C: New test.
+
+ PR c++/11766
+ * g++.dg/expr/ptrmem1.C: New test.
+
+2003-08-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/9453
+ * g++.dg/template/friend15.C: New test.
+
+2003-08-03 Neil Booth <neil@daikokuya.co.uk>
+
+ * lib/dg-pch.exp: Work round PCH bug.
+
+2003-08-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/builtins-1.c: Add macro helpers. Add missing math
+ builtins. Move cases from builtins-4.c here.
+
+ * 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.
+
+2003-08-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9447
+ * g++.dg/template/using7.C: New test.
+
+2003-08-02 Neil Booth <neil@daikokuya.co.uk>
+
+ * import1.c, import2.c: New tests.
+
+2003-08-01 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/eh/crossjump1.C: New test.
+
+2003-08-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11697
+ * g++.dg/template/using6.C: New test.
+
+ PR c++/11744
+ * g++.dg/template/koenig2.C: New test.
+
+2003-08-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/7983
+ * g++.dg/parse/typedef4.C: New test.
+
+2003-08-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/8442, c++/8806
+ * g++.dg/template/elab1.C: New test.
+ * g++.dg/template/type2.C: Likewise.
+ * g++.dg/template/ttp3.C: Adjust expected error message.
+ * g++.old-deja/g++.law/visibility13.C: Likewise.
+ * g++.old-deja/g++.niklas/t135.C: Likewise.
+ * g++.old-deja/g++.pt/ttp41.C: Likewise.
+ * g++.old-deja/g++.pt/ttp43.C: Use qualified name for template
+ template argument.
+ * g++.old-deja/g++.pt/ttp44.C: Likewise.
+
+2003-08-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11295
+ * g++.dg/ext/stmtexpr1.C: New test.
+
+ * g++.dg/opt/tmp1.C: New test.
+
+ PR c++/11525
+ * g++.dg/parse/constant4.C: New test.
+
+ PR c++/9447
+ * g++.dg/template/using5.C: New test.
+
+2003-07-31 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/builtins-27.c: New test case.
+
+2003-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ * 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>
+
+ * g++.dg/template/explicit3.C: New.
+ * g++.dg/template/explicit4.C: New.
+ * g++.dg/template/explicit5.C: New.
+
+ PR c++/11347
+ * g++.dg/template/memtmpl1.C: New.
+
+2003-07-29 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/11565
+ * gcc.dg/i386-387-1.c (dg-options): Add -march=i386.
+ * gcc.dg/i386-387-5.c (dg-options): Likewise.
+
+2003-07-30 Jan Hubicka <jh@suse.cz>
+
+ * vtgc1.c: Kill.
+
+2003-07-29 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.dg/struct-in-proto-1.c: New test.
+
+2003-07-29 Neil Booth <neil@daikokuya.co.uk>
+
+ * gcc.dg/cpp/include2.c: Only expect one message.
+
+2003-07-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9447
+ * g++.dg/template/using1.C: New test.
+ * g++.dg/template/using2.C: New test.
+ * g++.dg/template/using3.C: New test.
+ * g++.dg/template/using4.C: New test.
+
+2003-07-29 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc.c-torture/execute/string-opt-9.c: strcmp returns int.
+ * gcc.c-torture/execute/string-opt-10.c: Likewise.
+
+2003-07-28 Jan Hubicka <jh@suse.cz>
+
+ PR c++/11530
+ * g++.dg/opt/call1.C: New test.
+
+2003-07-28 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/11667
+ * g++.dg/init/enum2.C: New test.
+ * g++.dg/template/overload1.C: Add "-w" option.
+
+2003-07-28 <hp@bitrange.com>
+
+ * gcc.dg/Wdeclaration-after-statement-1.c,
+ gcc.dg/Wdeclaration-after-statement-2.c: New tests.
+
+2003-07-28 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20030725-1.c: New test.
+
+2003-07-28 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc.dg/20030505.c: Only run for SPE.
+ Remove definition of opaque type.
+
+2003-07-27 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/template/ptrmem6.C: New test.
+
+2003-07-26 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.c-torture/compile/zero-strct-2.c: New test.
+
+2003-07-25 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.dg/intermod-1.c: New test.
+
+2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11617
+ * g++.dg/template/lookup2.C: New test.
+ * g++.dg/template/memclass1.C: Remove instantiated from error.
+ * g++.dg/other/error2.C: Tweak expected errors.
+
+ PR c++/11596
+ * g++.dg/template/defarg3.C: New test.
+
+ * g++.dg/ext/packed2.C: Pack member struct too. Explain why.
+
+2003-07-24 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/inherit/access5.C: New test.
+
+2003-07-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11513
+ * g++.dg/template/crash8.C: New test.
+
+2003-07-23 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c/10602
+ * gcc.dg/noncompile/incomplete-2.c: New test.
+
+2003-07-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11645
+ * g++.dg/inherit/access4.C: New test.
+
+ PR c++/11517
+ * g++.dg/expr/cond2.C: New test.
+
+ PR optimization/10679
+ * g++.dg/opt/inline4.C: New test.
+
+2003-07-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/parse/crash10: New test.
+
+2003-07-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/ext/flexary1.C: New test.
+
+2003-07-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10793
+ * g++.dg/template/crash9.C: New test.
+
+2003-07-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/3004
+ * g++.dg/parse/typedef3.C: New test.
+
+ PR c++/7906
+ * g++.dg/parse/operator2.C: New test.
+
+ PR c++/8895
+ * g++.dg/parse/def-tmpl-arg1.C: New test.
+
+ PR c++/9282
+ * g++.dg/parse/funptr1.C: New test.
+
+ PR c++/9452
+ * g++.dg/parse/ambig3.C: New test.
+
+ PR c++/9454
+ * g++.dg/parse/operator3.C: New test.
+
+ PR c++/9486
+ * g++.dg/parse/template10.C: New test.
+
+ PR c++/9488
+ * g++.dg/parse/template11.C: New test.
+
+ PR c++/10150
+ * g++.dg/parse/invalid-op1.C: New test.
+
+ PR c++/10247
+ * g++.dg/parse/condexpr1.C: New test.
+
+2003-07-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/ext/packed3.C: New test.
+ * g++.dg/ext/packed4.C: New test.
+
+ * gcc.dg/pack-test-3.c: New test.
+
+2003-07-21 Janis Johnson <janis187@us.ibm.com>
+
+ * lib/compat.exp: Handle dg-options per source file.
+ * g++.dg/compat/abi/bitfield1_x.C: Specify dg-options.
+ * g++.dg/compat/abi/bitfield1_y.C: Ditto.
+ * g++.dg/compat/abi/bitfield2_x.C: Ditto.
+ * g++.dg/compat/abi/bitfield2_y.C: Ditto.
+ * g++.dg/compat/abi/vbase8-10_x.C: Ditto.
+ * g++.dg/compat/abi/vbase8-10_y.C: Ditto.
+ * g++.dg/compat/abi/vbase8-21_x.C: Ditto.
+ * g++.dg/compat/abi/vbase8-21_y.C: Ditto.
+ * g++.dg/compat/abi/vbase8-22_x.C: Ditto.
+ * g++.dg/compat/abi/vbase8-22_y.C: Ditto.
+ * g++.dg/compat/abi/vbase8-4_x.C: Ditto.
+ * g++.dg/compat/abi/vbase8-4_y.C: Ditto.
+ * g++.dg/compat/break/bitfield7_x.C: Ditto.
+ * g++.dg/compat/break/bitfield7_y.C: Ditto.
+
+2003-07-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c/10320
+ * gcc.c-torture/execute/20030718-1.c: New test.
+
+2003-07-21 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11536
+ * gcc.dg/20030721-1.c: New test.
+
+2003-07-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11546
+ * g++.dg/template/lookup1.C: New test.
+
+2003-07-19 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.dg/noncompile/label-1.c: New comprehensive test case for
+ diagnostics of ill-formed constructs involving labels.
+ * gcc.dg/noncompile/label-lineno-1.c: Add error regexp for
+ the new 'previously defined here' message.
+
+2003-07-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/parse/non-dependent2.C: New test.
+
+2003-07-18 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * g++.dg/init/init-ref4.C: xfail on targets without
+ weak symbols.
+
+2003-07-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/11087
+ * gcc.c-torture/execute/20030717-1.c: New test.
+
+2003-07-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/opt/cfg1.C: New test.
+
+2003-07-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR optimization/11557
+ * gcc.dg/20030717-1.c: New test.
+
+2003-07-17 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/10476
+ * g++.dg/expr/crash-1.C: New test.
+
+ PR c++/11027
+ * g++.dg/template/init3.C: New test.
+
+ PR c++/8222
+ * g++.dg/template/non-dependent1.C: New test.
+
+ PR c++/11070
+ * g++.dg/template/non-dependent2.C: New test.
+
+ PR c++/11071
+ * g++.dg/template/non-dependent3.C: New test.
+
+ PR c++/9907
+ * g++.dg/template/sizeof5.C: New test.
+
+2003-07-17 Geoffrey Keating <geoffk@apple.com>
+
+ PR 11498
+ * gcc.c-torture/compile/mangle-1.c: New file.
+
+2003-07-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/7809
+ * g++.dg/parse/access3.C: New test.
+
+2003-07-17 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/11384
+ * g++.dg/init/init-ref4.C: New test.
+
+2003-07-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11547
+ * g++.dg/parse/constant3.C: New test.
+ * g++.dg/parse/crash7.C: Likewise.
+
+2003-07-16 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/11008
+ * gcc.dg/i386-pentium4-not-mull.c: New.
+
+2003-07-16 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * gcc.dg/asm-names.c (ymain): Make it weak.
+
+2003-07-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5421
+ * g++.dg/template/friend21.C: New test.
+
+2003-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/cleanup-8.c: New test.
+ * gcc.dg/cleanup-9.c: New test.
+
+2003-07-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * g++.dg/ext/dll-MI1.h: New file.
+ * g++.dg/ext/dllexport-MI1.C: New file.
+ * g++.dg/ext/dllimport-MI1.C: New file.
+
+2003-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/string-opt-8.c (main): Remove i370 and s390,
+ it does not have cmpstrsi patterns (just cmpmemsi).
+
+2003-07-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/11473
+ * g++.dg/debug/debug8.C: New test.
+
+2003-07-15 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10108
+ * g++.dg/template/crash7.C: New test.
+
+2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/10795
+ * gcc.c-torture/compile/20030708-1.c: New.
+
+2003-07-15 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.c-torture/execute/20030715-1.c: New test.
+
+2003-07-14 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.dg/pch/inline-3.c: New file.
+ * gcc.dg/pch/inline-3.hs: New file.
+ * gcc.dg/pch/inline-4.c: New file.
+ * gcc.dg/pch/inline-4.hs: New file.
+
+2003-07-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11509
+ * g++.dg/template/crash6.C: New test.
+
+ PR c++/7053
+ * g++.dg/template/friend20.C: New test.
+
+ PR c++/7019
+ * g++.dg/template/overload2.C: New test.
+
+2003-07-14 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR optimization/11440
+ * gcc.c-torture/execute/20030714-1.c: New test.
+
+2003-07-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11154
+ * g++.dg/template/partial2.C: New test.
+
+2003-07-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11503
+ * g++.dg/template/anon1.C: New test.
+
+ PR c++/11493
+ PR c++/11495
+ * g++.dg/parse/template9.C: Likewise.
+ * g++.dg/template/crash4.C: New test.
+ * g++.dg/template/koenig1.C: Likewise.
+ * g++.old-deja/g++.benjamin/tem03.C: Adjust error markers.
+ * g++.old-deja/g++.benjamin/tem06.C: Declare "x".
+ * g++.old-deja/g++.jason/overload33.C: Use this-> when calling
+ functions.
+ * g++.old-deja/g++.jason/template36.C: Likewise.
+ * g++.old-deja/g++.mike/p1989.C: Likewise.
+ * g++.old-deja/g++.pt/lookup2.C: Use -fpermissive when compiling.
+ * g++.old-deja/g++.pt/ttp20.C: Use this->.
+ * g++.old-deja/g++.pt/ttp21.C: Use this->.
+ * g++.old-deja/g++.pt/typename13.C: Use -fpermissive when
+ compiling.
+ * g++.old-deja/g++.pt/union2.C: Use this->.
+
+2003-07-11 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20030711-1.c: New test.
+
+2003-07-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11050
+ * g++.dg/parse/args1.C: New test.
+ * g++.pt/defarg8.C: Change expected errors.
+
+2003-07-11 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8164
+ * g++.dg/template/nontype2.C: New test.
+
+ PR c++/10558
+ * g++.dg/parse/template8.C: New test.
+
+ PR c++/8327
+ * g++.dg/template/scope1.C: New test.
+
+ * g++.dg/warn/Wsign-compare-1.C: New test.
+
+2003-07-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.dg/20021018-1.c: Disable if the sizeof (int) < 4.
+
+2003-07-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9411
+ * g++.dg/template/explicit2.C: New test.
+
+ PR c++/10032
+ * g++.dg/warn/pedantic1.C: New test.
+
+2003-07-10 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++ 9483
+ * g++.dg/other/field1.C: New test.
+
+2003-07-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR c/11449
+ * gcc.c-torture/compile/20030707-1.c: New.
+
+2003-07-10 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10849
+ * g++.dg/template/access12.C: New test.
+
2003-07-09 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/bprob/bprob.exp (prof_ext): Update.
@@ -64,7 +1224,7 @@
* g++.dg/opt/emptyunion.C: New testcase.
2003-07-07 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
- Eric Botcazou <ebotcazou@libertysurf.fr>
+ Eric Botcazou <ebotcazou@libertysurf.fr>
* g++.dg/opt/stack1.C: New test.
@@ -72,7 +1232,7 @@
* g++.old-deja/g++.jason/typeid1.C: Make it a compile test, not a
run test.
-
+
PR c++/11431
* g++.dg/expr/static_cast3.C: New test.
@@ -102,18 +1262,18 @@
2003-07-04 Danny Smith <dannysmith@users.sourceforge.net>
PR c++/5287, PR c++/7910, PR c++/11021
- * testsuite/g++.dg/ext/dllimport1.C: Add mingw32 as target. Add
+ * g++.dg/ext/dllimport1.C: Add mingw32 as target. Add
tests for warnings.
- * testsuite/g++.dg/ext/dllimport2.C: Add tests for warnings.
- * testsuite/g++.dg/ext/dllimport3.C: Likewise.
- * testsuite/g++.dg/ext/dllimport4.C: New file.
- * testsuite/g++.dg/ext/dllimport5.C: New file.
- * testsuite/g++.dg/ext/dllimport6.C: New file.
- * testsuite/g++.dg/ext/dllimport7.C: New file.
- * testsuite/g++.dg/ext/dllimport8.C: New file.
- * testsuite/g++.dg/ext/dllimport9.C: New file.
- * testsuite/g++.dg/ext/dllimport10.C: New file.
- * testsuite/g++.dg/ext/dllexport1.C: New file.
+ * g++.dg/ext/dllimport2.C: Add tests for warnings.
+ * g++.dg/ext/dllimport3.C: Likewise.
+ * g++.dg/ext/dllimport4.C: New file.
+ * g++.dg/ext/dllimport5.C: New file.
+ * g++.dg/ext/dllimport6.C: New file.
+ * g++.dg/ext/dllimport7.C: New file.
+ * g++.dg/ext/dllimport8.C: New file.
+ * g++.dg/ext/dllimport9.C: New file.
+ * g++.dg/ext/dllimport10.C: New file.
+ * g++.dg/ext/dllexport1.C: New file.
2003-07-03 Mark Mitchell <mark@codesourcery.com>
@@ -774,7 +1934,7 @@
* lib/gcc-dg.exp (dg-require-alias): Fix typo.
(dg-require-gc-sections): Likewise.
-Sun Jun 8 16:46:04 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-08 Jan Hubicka <jh@suse.cz>
* i386-cmov1.c: Fix regular expression.
* i386-cvt-1.c: Likewise.
diff --git a/gcc/testsuite/g++.dg/README b/gcc/testsuite/g++.dg/README
index 478568bf882..27f6a5a80cf 100644
--- a/gcc/testsuite/g++.dg/README
+++ b/gcc/testsuite/g++.dg/README
@@ -16,6 +16,7 @@ opt Tests for fixes of bugs with particular optimizations.
other Tests that don't quite fit anywhere else.
overload Tests for overload resolution and conversions.
parse Tests for parsing.
+pch Tests for precompiled headers.
rtti Tests for run-time type identification (typeid, dynamic_cast, etc.)
special Tests requiring individual processing.
template Tests for templates.
diff --git a/gcc/testsuite/g++.dg/abi/bitfield11.C b/gcc/testsuite/g++.dg/abi/bitfield11.C
new file mode 100644
index 00000000000..e78ea121d61
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/bitfield11.C
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-options "-w -fabi-version=0" }
+
+struct S {
+ char c : 1024;
+};
+
+S s;
+
+int main () {
+ s.c = 1;
+ if (*(char *)&s != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/abi/bitfield12.C b/gcc/testsuite/g++.dg/abi/bitfield12.C
new file mode 100644
index 00000000000..6cfda5d47df
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/bitfield12.C
@@ -0,0 +1,5 @@
+// { dg-options "-Wabi -fabi-version=1" }
+
+struct S { // { dg-warning "ABI" }
+ char c : 1024; // { dg-warning "width" }
+};
diff --git a/gcc/testsuite/g++.dg/abi/layout4.C b/gcc/testsuite/g++.dg/abi/layout4.C
new file mode 100644
index 00000000000..a1d27ee7f43
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/layout4.C
@@ -0,0 +1,18 @@
+// { dg-do run { target i?86-*-* } }
+// { dg-options "-fabi-version=1" }
+
+struct C4
+{
+ int b:30;
+ C4(){};
+};
+
+struct C1: virtual C4
+{
+ int i;
+};
+
+int main() {
+ if (sizeof (C1) != 12)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/compat/abi/bitfield1_x.C b/gcc/testsuite/g++.dg/compat/abi/bitfield1_x.C
index 1447655a33e..e081c4bc943 100644
--- a/gcc/testsuite/g++.dg/compat/abi/bitfield1_x.C
+++ b/gcc/testsuite/g++.dg/compat/abi/bitfield1_x.C
@@ -1,3 +1,5 @@
+// { dg-options "-ansi -pedantic-errors -funsigned-bitfields" }
+
#include "bitfield1.h"
extern void bitfield1_y (A& a);
diff --git a/gcc/testsuite/g++.dg/compat/abi/bitfield1_y.C b/gcc/testsuite/g++.dg/compat/abi/bitfield1_y.C
index 7ca5d4b3f51..10581dab0a4 100644
--- a/gcc/testsuite/g++.dg/compat/abi/bitfield1_y.C
+++ b/gcc/testsuite/g++.dg/compat/abi/bitfield1_y.C
@@ -1,3 +1,5 @@
+// { dg-options "-ansi -pedantic-errors -funsigned-bitfields" }
+
extern "C" void abort (void);
#include "bitfield1.h"
diff --git a/gcc/testsuite/g++.dg/compat/abi/bitfield2_x.C b/gcc/testsuite/g++.dg/compat/abi/bitfield2_x.C
index 1447655a33e..47b448dda26 100644
--- a/gcc/testsuite/g++.dg/compat/abi/bitfield2_x.C
+++ b/gcc/testsuite/g++.dg/compat/abi/bitfield2_x.C
@@ -1,3 +1,5 @@
+// { dg-options "-ansi -pedantic-errors -fsigned-bitfields" }
+
#include "bitfield1.h"
extern void bitfield1_y (A& a);
diff --git a/gcc/testsuite/g++.dg/compat/abi/bitfield2_y.C b/gcc/testsuite/g++.dg/compat/abi/bitfield2_y.C
index 6119544db16..55edab5cbfe 100644
--- a/gcc/testsuite/g++.dg/compat/abi/bitfield2_y.C
+++ b/gcc/testsuite/g++.dg/compat/abi/bitfield2_y.C
@@ -1,3 +1,5 @@
+// { dg-options "-ansi -pedantic-errors -fsigned-bitfields" }
+
extern "C" void abort (void);
#include "bitfield1.h"
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-10_x.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-10_x.C
index 18e78fcc59c..c56d080eb78 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-10_x.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-10_x.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
#include "vbase8-10.h"
extern void check_C0 (C0&, int);
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-10_y.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-10_y.C
index 1d6c8261668..5364ed6b778 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-10_y.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-10_y.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
extern "C" void abort (void);
#include "vbase8-10.h"
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-21_x.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-21_x.C
index 986fcfbe5e4..818eade0388 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-21_x.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-21_x.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
#include "vbase8-21.h"
extern void check_C0 (C0&, int);
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-21_y.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-21_y.C
index 0bd76246d4d..51261393515 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-21_y.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-21_y.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
extern "C" void abort (void);
#include "vbase8-21.h"
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-22_x.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-22_x.C
index 5d3eacf7c90..49f021adffa 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-22_x.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-22_x.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
#include "vbase8-22.h"
extern void check_C0 (C0&, int);
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-22_y.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-22_y.C
index 293ed100be4..49ab04a8788 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-22_y.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-22_y.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
extern "C" void abort (void);
#include "vbase8-22.h"
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-4_x.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-4_x.C
index 66b514c1b09..db60cc6ee0a 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-4_x.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-4_x.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
#include "vbase8-4.h"
extern void check_C0 (C0&, int);
diff --git a/gcc/testsuite/g++.dg/compat/abi/vbase8-4_y.C b/gcc/testsuite/g++.dg/compat/abi/vbase8-4_y.C
index 86dd40433d8..24d5046c90d 100644
--- a/gcc/testsuite/g++.dg/compat/abi/vbase8-4_y.C
+++ b/gcc/testsuite/g++.dg/compat/abi/vbase8-4_y.C
@@ -1,3 +1,5 @@
+// { dg-options -w }
+
extern "C" void abort (void);
#include "vbase8-4.h"
diff --git a/gcc/testsuite/g++.dg/compat/break/bitfield7_x.C b/gcc/testsuite/g++.dg/compat/break/bitfield7_x.C
index b42ea2e9ae3..9b2a622a5ea 100644
--- a/gcc/testsuite/g++.dg/compat/break/bitfield7_x.C
+++ b/gcc/testsuite/g++.dg/compat/break/bitfield7_x.C
@@ -1,3 +1,5 @@
+// { dg-options "-w" }
+
#include "bitfield7.h"
extern void bitfield7_y (U*);
diff --git a/gcc/testsuite/g++.dg/compat/break/bitfield7_y.C b/gcc/testsuite/g++.dg/compat/break/bitfield7_y.C
index 916d150d537..afa5446ae89 100644
--- a/gcc/testsuite/g++.dg/compat/break/bitfield7_y.C
+++ b/gcc/testsuite/g++.dg/compat/break/bitfield7_y.C
@@ -1,3 +1,5 @@
+// { dg-options "-w" }
+
extern "C" void abort (void);
#include "bitfield7.h"
diff --git a/gcc/testsuite/g++.dg/conversion/cond6.C b/gcc/testsuite/g++.dg/conversion/cond6.C
new file mode 100644
index 00000000000..8c05e1b143c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/conversion/cond6.C
@@ -0,0 +1,18 @@
+// PR c++/11283
+// Converting "a" to the type of "i" produces "int" rather than "const
+// int", which was causing build_conditional_expr to abort. But we don't
+// care about cv-quals on non-class rvalues.
+
+struct A
+{
+ operator int ();
+};
+
+extern A a;
+extern const int i;
+extern bool b;
+
+int f ()
+{
+ return b ? a : i;
+}
diff --git a/gcc/testsuite/g++.dg/conversion/ptrmem1.C b/gcc/testsuite/g++.dg/conversion/ptrmem1.C
new file mode 100644
index 00000000000..ed00ea3f715
--- /dev/null
+++ b/gcc/testsuite/g++.dg/conversion/ptrmem1.C
@@ -0,0 +1,13 @@
+struct S {};
+
+void f (int S::*const*);
+
+typedef int I;
+
+void f (I S::*const*);
+
+void g() {
+ int S::*const* p;
+
+ f(p);
+}
diff --git a/gcc/testsuite/g++.dg/debug/debug8.C b/gcc/testsuite/g++.dg/debug/debug8.C
new file mode 100644
index 00000000000..1f8a18ac8ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/debug8.C
@@ -0,0 +1,2 @@
+struct t{};
+struct g : public t{};
diff --git a/gcc/testsuite/g++.dg/eh/crossjump1.C b/gcc/testsuite/g++.dg/eh/crossjump1.C
new file mode 100644
index 00000000000..ccb0ffb2185
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/crossjump1.C
@@ -0,0 +1,31 @@
+// This testcase failed on s390, because cross-jumping merged 2 calls,
+// one with REG_EH_REGION note with no handlers (ie. termination)
+// and one without REG_EH_REGION note.
+// { dg-do run }
+// { dg-options "-O2" }
+
+#include <exception>
+#include <string>
+
+struct E : public std::exception
+{
+ std::string m;
+ E () : m ("test") { }
+ ~E () throw() { }
+};
+
+struct C : public E { };
+
+void foo ()
+{
+ throw C ();
+}
+
+int main ()
+{
+ try
+ {
+ foo ();
+ }
+ catch (...) { }
+}
diff --git a/gcc/testsuite/g++.dg/eh/delayslot1.C b/gcc/testsuite/g++.dg/eh/delayslot1.C
new file mode 100644
index 00000000000..ddc960e6d8b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/delayslot1.C
@@ -0,0 +1,47 @@
+// PR target/12301
+// Origin: Colin Hirsch <gcc@cohi.at>
+// Testcase by Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+// This used to fail on SPARC because the reorg pass moved an insn
+// across a function call that can throw internally, in order to put
+// it in a delay slot.
+
+// { dg-do run }
+// { dg-options "-O" }
+
+struct S{
+ char *c;
+ char data[100];
+ S () : c (data) {};
+ S (const S& s) {
+ c = data;
+ data[0] = s.c[0];
+ }
+};
+
+S real_cast ()
+{
+ throw 3;
+}
+
+S cast_helper(S& debug)
+{
+ try {
+ return real_cast();
+ }
+ catch (int e) {
+ throw debug;
+ }
+}
+
+int main()
+{
+ S tmp;
+
+ try {
+ cast_helper (tmp);
+ }
+ catch (S& e) {}
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/eh/simd-2.C b/gcc/testsuite/g++.dg/eh/simd-2.C
index e6f1f7b08a6..39f8dc80f23 100644
--- a/gcc/testsuite/g++.dg/eh/simd-2.C
+++ b/gcc/testsuite/g++.dg/eh/simd-2.C
@@ -1,6 +1,7 @@
// Test EH when V4SI SIMD registers are involved.
// Contributed by Aldy Hernandez (aldy@quesejoda.com).
// { dg-options "-O" }
+// { dg-options "-O -w" { target i?86-*-* } }
// { dg-do run }
typedef int __attribute__((mode(V4SI))) vecint;
diff --git a/gcc/testsuite/g++.dg/expr/call1.C b/gcc/testsuite/g++.dg/expr/call1.C
new file mode 100644
index 00000000000..42d18db563e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/call1.C
@@ -0,0 +1,16 @@
+namespace NS_1 {
+ struct A {};
+ struct foo {};
+}
+
+namespace NS_2 {
+ template <typename T> void foo(T);
+
+ template <typename T>
+ void bar() {
+ NS_1::A a;
+ NS_2::foo(a);
+ }
+
+ template void bar<int>();
+}
diff --git a/gcc/testsuite/g++.dg/expr/call2.C b/gcc/testsuite/g++.dg/expr/call2.C
new file mode 100644
index 00000000000..3b7398a8bf7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/call2.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Sep 2003 <nathan@codesourcery.com>
+// Origin: Wolfgang Bangerth <bangerth@dealii.org>
+// PR c++/12184. ICE
+
+class C;
+class D;
+bool mm(D);
+
+void g(C& f) {
+ mm(f); // { dg-error "parameter" "" }
+}
diff --git a/gcc/testsuite/g++.dg/expr/comma1.C b/gcc/testsuite/g++.dg/expr/comma1.C
new file mode 100644
index 00000000000..5424ce1a84e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/comma1.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+
+extern "C" void abort ();
+
+struct gtst
+{
+ unsigned char data[2];
+};
+
+static struct gtst s;
+
+int main(int argc, char *argv[])
+{
+ unsigned char * pc;
+ struct gtst * ps;
+ ps = &s;
+ pc = (ps->data[0]='A', ps->data);
+ if (&s.data[0] != pc)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/expr/cond2.C b/gcc/testsuite/g++.dg/expr/cond2.C
new file mode 100644
index 00000000000..d9c2e7031f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/cond2.C
@@ -0,0 +1,12 @@
+struct Term { };
+struct Boolean : Term {
+ explicit Boolean(bool);
+};
+struct IsZero : Term {
+ Term *eval();
+};
+Term*
+IsZero::eval()
+{
+ return true ? new Boolean(false) : this; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/expr/cond3.C b/gcc/testsuite/g++.dg/expr/cond3.C
new file mode 100644
index 00000000000..50a4d9a1300
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/cond3.C
@@ -0,0 +1,6 @@
+const int i = 7;
+const int j = 3;
+
+void f(bool b) {
+ &(b ? i : j);
+}
diff --git a/gcc/testsuite/g++.dg/expr/crash-1.C b/gcc/testsuite/g++.dg/expr/crash-1.C
new file mode 100644
index 00000000000..d8d689fd67b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/crash-1.C
@@ -0,0 +1,15 @@
+// C++ PR/10476
+// Origin: larsbj@gullik.net and bangerth@dealii.org
+
+
+struct X {
+ X();
+ X(const X& __str);
+};
+X const bar();
+void foo()
+{
+ X y;
+ (true ? y : bar());
+}
+
diff --git a/gcc/testsuite/g++.dg/expr/enum1.C b/gcc/testsuite/g++.dg/expr/enum1.C
new file mode 100644
index 00000000000..df2a823d551
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/enum1.C
@@ -0,0 +1,10 @@
+// { dg-do run }
+
+void abort();
+int main()
+{
+ enum { shelf = 4 } t = shelf;
+ if (!(t & shelf))
+ abort ();
+}
+
diff --git a/gcc/testsuite/g++.dg/expr/lval1.C b/gcc/testsuite/g++.dg/expr/lval1.C
new file mode 100644
index 00000000000..bed47d8e4ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/lval1.C
@@ -0,0 +1,7 @@
+// Contributed by Matt Austern <austern@apple.com>
+
+void f ()
+{
+ int n;
+ (char) n = 1; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/expr/ptrmem1.C b/gcc/testsuite/g++.dg/expr/ptrmem1.C
new file mode 100644
index 00000000000..146143a1e82
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/ptrmem1.C
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Aug 2003 <nathan@codesourcery.com>
+
+// PR 11766. ICE
+
+template<typename T>
+struct normal_iterator
+{
+ normal_iterator(const T& __i);
+};
+
+
+template<typename _Tp>
+struct vector
+{
+ void end() const { normal_iterator<const _Tp*> (this->pt); }
+ void size() const { end(); }
+ _Tp* pt;
+};
+
+
+
+struct MuonTag {
+ typedef void (MuonTag::*Selector)();
+};
+
+void foo()
+{
+ vector<MuonTag::Selector> _selectors;
+ _selectors.size();
+}
diff --git a/gcc/testsuite/g++.dg/expr/static_cast4.C b/gcc/testsuite/g++.dg/expr/static_cast4.C
new file mode 100644
index 00000000000..cea7f487393
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/static_cast4.C
@@ -0,0 +1,11 @@
+class C {
+public:
+ explicit C(int) {}
+};
+
+int main()
+{
+ int i = 0;
+ static_cast<C>(i);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/expr/static_cast5.C b/gcc/testsuite/g++.dg/expr/static_cast5.C
new file mode 100644
index 00000000000..1a51f151677
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/static_cast5.C
@@ -0,0 +1,17 @@
+void ambig()
+{
+ struct A {};
+ struct B : A {};
+ struct C : A {};
+ struct D : B, C {};
+
+ D d;
+ A* ap = static_cast<B*> (&d);
+ D* db = static_cast<D*> (ap); // { dg-error "" }
+
+ D& dr1 = static_cast<D&> (*ap); // { dg-error "" }
+
+ A& ar = static_cast<C&> (d);
+ D& dr = static_cast<D&> (ar); // { dg-error "" }
+}
+
diff --git a/gcc/testsuite/g++.dg/ext/altivec-1.C b/gcc/testsuite/g++.dg/ext/altivec-1.C
new file mode 100644
index 00000000000..b7e3af30009
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/altivec-1.C
@@ -0,0 +1,15 @@
+// { dg-do compile { target powerpc-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+int main()
+{
+ return 0;
+}
+
+class F32vec4 {
+public:
+ vector float val;
+ vector float operator++(void) { return val;}
+};
diff --git a/gcc/testsuite/g++.dg/ext/dll-MI1.h b/gcc/testsuite/g++.dg/ext/dll-MI1.h
new file mode 100644
index 00000000000..2f8b8366939
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dll-MI1.h
@@ -0,0 +1,39 @@
+// Class definitions for dllexport-MI1.C and dllimport-MI1.C
+
+#ifdef BUILDING_MI_DLL
+#define DLL_IMPEXP __attribute__ ((dllexport))
+#else
+#define DLL_IMPEXP __attribute__ ((dllimport))
+#endif
+
+
+#define D1_return 1
+#define D2_return 2
+
+class DLL_IMPEXP MBase
+{
+public:
+ virtual int vf() const = 0;
+ virtual ~MBase();
+};
+
+class DLL_IMPEXP D1 : virtual public MBase
+{
+public:
+ int vf() const;
+};
+
+class DLL_IMPEXP D2 : virtual public MBase
+{
+public:
+ D2 ();
+ D2 (D2 const&);
+ int vf() const;
+};
+
+class DLL_IMPEXP MI1 : public D1, public D2
+{
+public:
+ int vf() const;
+};
+
diff --git a/gcc/testsuite/g++.dg/ext/dllexport-MI1.C b/gcc/testsuite/g++.dg/ext/dllexport-MI1.C
new file mode 100644
index 00000000000..e640d3ba7ca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllexport-MI1.C
@@ -0,0 +1,51 @@
+// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
+// Test that non-virtual MI thunks are exported.
+
+
+// To build the dll and client app:
+// g++ -shared -o MI.dll dllexport-MI1.C
+// g++ -o MItest.exe dllimport-MI1.C -L. MI.dll
+
+#define BUILDING_MI_DLL
+#include "dll-MI1.h"
+
+MBase::~MBase(){}
+
+int D1::vf() const { return D1_return; }
+
+D2::D2() { }
+D2::D2 (D2 const&) { }
+int D2::vf() const { return D2_return; }
+
+int MI1::vf() const { return D1::vf();}
+
+// a dllexported object
+DLL_IMPEXP MI1 dllMI1;
+
+// use default copy ctor
+DLL_IMPEXP MI1 dllMI1Copy = dllMI1;
+
+// Scan for export of some methods that are undefined in dllimportMI1.C,
+
+// { dg-final { scan-assembler "-export:_ZNK2D12vfEv" } }
+// { dg-final { scan-assembler "-export:_ZNK2D22vfEv" } }
+// { dg-final { scan-assembler "-export:_ZNK3MI12vfEv" } }
+
+// and MI thunks,
+
+// { dg-final { scan-assembler "-export:_ZThn4_NK3MI12vfEv" } }
+// { dg-final { scan-assembler "-export:_ZTv0_n12_NK2D12vfEv" } }
+
+// and a vtable data variable.
+
+// { dg-final { scan-assembler "-export:_ZTV2D1,data" } }
+
+// an explicit copy ctor
+// { dg-final { scan-assembler "-export:_ZN2D2C2ERKS_" } }
+
+// but not implicit copy ctor generated by compiler
+// nor implicit dtor
+
+// { dg-final { scan-assembler-not "-export:_ZN2D1C2ERKS_" } }
+// { dg-final { scan-assembler-not "-export:_ZN2D1D2Ev" } }
+
diff --git a/gcc/testsuite/g++.dg/ext/dllimport-MI1.C b/gcc/testsuite/g++.dg/ext/dllimport-MI1.C
new file mode 100644
index 00000000000..4efdea4e58b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllimport-MI1.C
@@ -0,0 +1,53 @@
+// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
+// Test handling of MI thunks in dllimported classes.
+
+// To build the dll and client app:
+// g++ -shared -o MI.dll dllexport-MI1.C
+// g++ -o MItest.exe dllimport-MI1.C -L. MI.dll
+
+#include <stdlib.h>
+#include "dll-MI1.h"
+
+extern DLL_IMPEXP MI1 dllMI1;
+
+// This should use the implicit copy ctor for D1 (not imported)
+// and the explicit copy ctor for D2 (dll-imported).
+MI1 dllMI1LocalCopy = dllMI1;
+
+class MI2 : public D1, public D2
+{
+public:
+ int vf() const { return D2::vf();}
+};
+
+class MI3 : public MI1
+{
+};
+
+int main ()
+
+{
+ MI1 bar1;
+ MI2 bar2;
+ MI3 bar3;
+
+ if (dllMI1.vf() != D1_return)
+ abort();
+
+ if (dllMI1LocalCopy.vf() != D1_return)
+ abort();
+
+ if (bar1.vf() != D1_return)
+ abort();
+
+ if (bar2.vf() != (D2_return))
+ abort();
+
+ if (bar3.vf() != D1_return )
+ abort();
+}
+
+// Scan for import of explicit copy ctor for D2, but no import
+// of compiler generated copy ctor for D1.
+// { dg-final { scan-assembler "__imp___ZN2D2C2ERKS_" } }
+// { dg-final { scan-assembler-not "__imp___ZN2D1C2ERKS_" } }
diff --git a/gcc/testsuite/g++.dg/ext/flexary1.C b/gcc/testsuite/g++.dg/ext/flexary1.C
new file mode 100644
index 00000000000..4033e339da0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/flexary1.C
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
+
+// PR c++ 11614
+
+typedef int ary_t[];
+
+struct test
+{
+ ary_t *b;
+ int (*a)[]; // this is not a flexible array member
+};
+
+void test(void)
+{
+ struct test s;
+ int (*a)[] = 0;
+ ary_t *b = 0;
+
+ a = s.a;
+ a = s.b;
+
+ s.a = a;
+ s.b = a;
+
+ b = s.a;
+ b = s.b;
+
+ s.a = b;
+ s.b = b;
+}
diff --git a/gcc/testsuite/g++.dg/ext/fnname1.C b/gcc/testsuite/g++.dg/ext/fnname1.C
new file mode 100644
index 00000000000..521d5a7367f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/fnname1.C
@@ -0,0 +1,26 @@
+// Test whether __func__ works for namespace-scope C++ functions.
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Matt Austern <austern@apple.com>, 3 Aug 2003
+// { dg-do run }
+
+namespace xyzzy
+{
+ const char* ab6(double, void*)
+ {
+ return __func__;
+ }
+}
+
+int main()
+{
+ const char* s = xyzzy::ab6(2.3, (void*) 0);
+ bool ok = true;
+
+ ok = ok && s[0] == 'a';
+ ok = ok && s[1] == 'b';
+ ok = ok && s[2] == '6';
+ ok = ok && s[3] == '\0';
+
+ return ok ? 0 : 1;
+}
diff --git a/gcc/testsuite/g++.dg/ext/fnname2.C b/gcc/testsuite/g++.dg/ext/fnname2.C
new file mode 100644
index 00000000000..ea0c1826f45
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/fnname2.C
@@ -0,0 +1,31 @@
+// Test whether __func__ works for ordinary member functions.
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Matt Austern <austern@apple.com>, 3 Aug 2003
+// { dg-do run }
+
+struct y8a
+{
+ const char* zqjx(int, char);
+};
+
+const char* y8a::zqjx(int, char)
+{
+ return __func__;
+}
+
+
+int main()
+{
+ y8a tmp;
+ const char* s = tmp.zqjx(16, 'x');
+ bool ok = true;
+
+ ok = ok && s[0] == 'z';
+ ok = ok && s[1] == 'q';
+ ok = ok && s[2] == 'j';
+ ok = ok && s[3] == 'x';
+ ok = ok && s[4] == '\0';
+
+ return ok ? 0 : 1;
+}
diff --git a/gcc/testsuite/g++.dg/ext/fnname3.C b/gcc/testsuite/g++.dg/ext/fnname3.C
new file mode 100644
index 00000000000..c29170a9a39
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/fnname3.C
@@ -0,0 +1,65 @@
+// Test whether __func__ works for constructors and destructors.
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Matt Austern <austern@apple.com>, 3 Aug 2003
+// { dg-do run }
+
+struct uk9i
+{
+ uk9i();
+ ~uk9i();
+
+ static const char* fname;
+ static bool obj_exists;
+};
+
+uk9i::uk9i()
+{
+ obj_exists = true;
+ fname = __func__;
+}
+
+uk9i::~uk9i()
+{
+ obj_exists = false;
+ fname = __func__;
+}
+
+const char* uk9i::fname = 0;
+bool uk9i::obj_exists = false;
+
+int main()
+{
+ bool ok = true;
+
+ ok = ok && uk9i::fname == 0;
+ ok = ok && !uk9i::obj_exists;
+
+ {
+ uk9i tmp;
+ ok = ok && uk9i::obj_exists;
+ ok = ok && uk9i::fname != 0;
+ if (ok)
+ {
+ ok = ok && uk9i::fname[0] == 'u';
+ ok = ok && uk9i::fname[1] == 'k';
+ ok = ok && uk9i::fname[2] == '9';
+ ok = ok && uk9i::fname[3] == 'i';
+ ok = ok && uk9i::fname[4] == '\0';
+ }
+ }
+
+ ok = ok && !uk9i::obj_exists;
+ ok = ok && uk9i::fname != 0;
+ if (ok)
+ {
+ ok = ok && uk9i::fname[0] == '~';
+ ok = ok && uk9i::fname[1] == 'u';
+ ok = ok && uk9i::fname[2] == 'k';
+ ok = ok && uk9i::fname[3] == '9';
+ ok = ok && uk9i::fname[4] == 'i';
+ ok = ok && uk9i::fname[5] == '\0';
+ }
+
+ return ok ? 0 : 1;
+}
diff --git a/gcc/testsuite/g++.dg/ext/label1.C b/gcc/testsuite/g++.dg/ext/label1.C
new file mode 100644
index 00000000000..8c6684dce0e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/label1.C
@@ -0,0 +1,8 @@
+// { dg-options "" }
+
+int main(void) {
+ static const void* lbls[2][2] = {{&&lbl0, &&lbl0}, {&&lbl0, &&lbl0}};
+ goto *lbls[0];
+ lbl0:
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/ext/label2.C b/gcc/testsuite/g++.dg/ext/label2.C
new file mode 100644
index 00000000000..1b66f603fe4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/label2.C
@@ -0,0 +1,11 @@
+// { dg-options "" }
+
+template <typename T>
+void f() {
+ l:
+ void *p[] = { &&l };
+
+ goto *p;
+}
+
+template void f<int>();
diff --git a/gcc/testsuite/g++.dg/ext/lvcast.C b/gcc/testsuite/g++.dg/ext/lvcast.C
deleted file mode 100644
index efff04ec089..00000000000
--- a/gcc/testsuite/g++.dg/ext/lvcast.C
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (C) 2002 Free Software Foundation
-// Contributed by Matt Austern <austern@apple.com>
-
-// { dg-do compile }
-// { dg-options -fpermissive }
-
-void f ()
-{
- int n;
- (char) n = 1;
-}
diff --git a/gcc/testsuite/g++.dg/ext/packed2.C b/gcc/testsuite/g++.dg/ext/packed2.C
index 5effc3b1c1e..66f156bac7c 100644
--- a/gcc/testsuite/g++.dg/ext/packed2.C
+++ b/gcc/testsuite/g++.dg/ext/packed2.C
@@ -1,18 +1,23 @@
// PR c++/10091
+// Original synopsis
// Bug: We were dying because in general, B::a doesn't have enough
// alignment for us to take its address. But if the B is C::b, it does
// have enough alignment, and we should be able to determine that.
// This only failed on STRICT_ALIGNMENT targets (i.e. not i686)
+// July 2003
+// packing of non-pods is now only allowed if the non-pod is itself
+// packed. Also only such pods can be reference bound to non-consts
+
struct A {
int i;
A();
A(const A&);
A& operator=(const A&);
-};
+} __attribute__ ((packed));
struct B {
A a;
@@ -23,8 +28,8 @@ struct C {
int j;
};
-void f (const A&);
-void g (const C& c)
+void f (A&);
+void g (C& c)
{
f (c.b.a);
}
diff --git a/gcc/testsuite/g++.dg/ext/packed3.C b/gcc/testsuite/g++.dg/ext/packed3.C
new file mode 100644
index 00000000000..b6e891f337f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/packed3.C
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Jul 2003 <nathan@codesourcery.com>
+
+// Packed fields are unsuitable for direct reference binding.
+
+struct Unpacked { int i; };
+
+void Ref (int &p);
+void Ref (Unpacked &p);
+
+struct __attribute__ ((packed)) Packed
+{
+ char c;
+ int i;
+ Unpacked u;
+};
+
+void Foo (Packed &p)
+{
+ Ref (p.i); // { dg-error "cannot bind packed field" "" }
+ Ref (p.u.i); // { dg-error "cannot bind packed field" "" }
+ Ref (p.u); // { dg-error "cannot bind packed field" "" }
+}
diff --git a/gcc/testsuite/g++.dg/ext/packed4.C b/gcc/testsuite/g++.dg/ext/packed4.C
new file mode 100644
index 00000000000..c32a0fa6993
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/packed4.C
@@ -0,0 +1,80 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Jul 2003 <nathan@codesourcery.com>
+
+// Packed fields are unsuitable for direct reference binding.
+
+struct Unpacked { int i; };
+
+int ConstRef (int const &p, int const *ptr, int v)
+{
+ if (p != v)
+ return 1;
+ if (&p == ptr)
+ return 2;
+ return 0;
+}
+
+int ConstRef (Unpacked const &p, Unpacked const *ptr, int v)
+{
+ if (p.i != v)
+ return 1;
+ if (&p == ptr)
+ return 2;
+ return 0;
+}
+
+int Val (int p, int v)
+{
+ if (p != v)
+ return 1;
+ return 0;
+}
+int Val (Unpacked p, int v)
+{
+ if (p.i != v)
+ return 1;
+ return 0;
+}
+
+struct __attribute__ ((packed)) Packed
+{
+ char c;
+ int i;
+ Unpacked u;
+ char t;
+};
+
+int Foo (Packed &p, int i, int ui)
+{
+ int r;
+
+ if ((r = Val (p.i, i)))
+ return r;
+ if ((r = Val (p.u.i, ui)))
+ return r + 2;
+ if ((r = Val (p.u, ui)))
+ return r + 4;
+
+ if ((r = ConstRef (p.i, &p.i, i)))
+ return r + 6;
+ if ((r = ConstRef (p.u.i, &p.u.i, ui)))
+ return r + 8;
+ if ((r = ConstRef (p.u, &p.u, ui)))
+ return r + 10;
+
+ return 0;
+}
+
+int main ()
+{
+ Packed p;
+
+ p.c = 0x12;
+ p.i = 0x3456789a;
+ p.u.i = 0xbcdef00f;
+ p.t = 0xed;
+
+ return Foo (p, 0x3456789a, 0xbcdef00f);
+}
diff --git a/gcc/testsuite/g++.dg/ext/stmtexpr1.C b/gcc/testsuite/g++.dg/ext/stmtexpr1.C
new file mode 100644
index 00000000000..afdf6440317
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/stmtexpr1.C
@@ -0,0 +1,54 @@
+// { dg-do run }
+// { dg-options "" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Jul 2003 <nathan@codesourcery.com>
+
+// make statement expressions work properly
+
+extern "C" int printf (char const *, ...);
+extern "C" void abort ();
+
+static unsigned order[] =
+{
+ 1, 101, 2, 102,
+ 3, 4, 104, 103,
+ 5, 6, 105, 106,
+ 7, 107, 8, 408, 9, 109, 108,
+ 10, 11, 110, 411, 12, 112, 111,
+ 13, 113,
+ 14, 214, 114, 114,
+ 0
+};
+
+static unsigned point;
+
+static void Check (unsigned t, unsigned i, void const *ptr, char const *name)
+{
+ printf ("%d %d %p %s\n", t, i, ptr, name);
+
+ if (order[point++] != i + t)
+ abort ();
+}
+
+template <int I> struct A
+{
+ A () { Check (0, I, this, __PRETTY_FUNCTION__); }
+ ~A () { Check (100, I, this, __PRETTY_FUNCTION__); }
+ A (A const &) { Check (200, I, this, __PRETTY_FUNCTION__); }
+ A &operator= (A const &) { Check (300, I, this, __PRETTY_FUNCTION__); }
+ void Foo () const { Check (400, I, this, __PRETTY_FUNCTION__); }
+};
+
+int main ()
+{
+ ({A<1> (); A<2> (); ;});
+ ({A<3> (), A<4> (); ;});
+ ({A<5> (), A<6> ();});
+ ({A <7> (); A<8> (); }).Foo (), A<9> ();
+ ({A <10> (), A<11> (); }).Foo (), A<12> ();
+ ({A<13> a; a; ; });
+ ({A<14> a; a; });
+ Check (0, 0, 0, "end");
+}
+
diff --git a/gcc/testsuite/g++.dg/inherit/access4.C b/gcc/testsuite/g++.dg/inherit/access4.C
new file mode 100644
index 00000000000..33f991b666f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/access4.C
@@ -0,0 +1,8 @@
+struct Container { int Count(); };
+struct List : private Container {
+ using Container::Count;
+};
+struct INetContentTypeParameterList : private List { void Clear(); };
+void INetContentTypeParameterList::Clear() {
+ Count();//Calling non static but in a non-static method.
+}
diff --git a/gcc/testsuite/g++.dg/inherit/access5.C b/gcc/testsuite/g++.dg/inherit/access5.C
new file mode 100644
index 00000000000..715a4a3b29b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/access5.C
@@ -0,0 +1,4 @@
+struct S { ~S(); };
+struct T : virtual private S {};
+struct U : private T {};
+U u;
diff --git a/gcc/testsuite/g++.dg/inherit/conv1.C b/gcc/testsuite/g++.dg/inherit/conv1.C
new file mode 100644
index 00000000000..e16c489a235
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/conv1.C
@@ -0,0 +1,23 @@
+typedef struct _A A;
+typedef struct _A B;
+
+void some_function(B *b);
+
+class AClass {
+
+public:
+ operator A*() { return 0;}
+
+};
+
+class BClass :public AClass {
+
+public:
+ operator B*() { return 0;}
+
+};
+
+int main(int argc, char **argv) {
+ BClass b;
+ some_function(b);
+}
diff --git a/gcc/testsuite/g++.dg/inherit/multiple1.C b/gcc/testsuite/g++.dg/inherit/multiple1.C
new file mode 100644
index 00000000000..3eb9fe763a7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/multiple1.C
@@ -0,0 +1,20 @@
+// { dg-options "-w" }
+
+struct Base {
+ int b;
+
+ Base(int b) : b(b) { }
+};
+
+struct Derived : public Base {
+ Derived(int d) : Base(d) { }
+};
+
+struct Final : public Derived, public Base {
+ Final(int f) : Derived(f), Base(f-1) { }
+};
+
+int main()
+{
+ Final f(5);
+}
diff --git a/gcc/testsuite/g++.dg/init/array11.C b/gcc/testsuite/g++.dg/init/array11.C
new file mode 100644
index 00000000000..e52effe9ff7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/array11.C
@@ -0,0 +1,28 @@
+/* PR 11665
+ Orgin: jwhite@cse.unl.edu
+ The problem was in initializer_constant_valid_p,
+ "for a CONSTRUCTOR, only the last element
+ of the CONSTRUCTOR was being checked"
+ (from the email of the patch which fixed this).
+ This used to ICE because GCC thought gdt_table was a
+ constant value when it is not. */
+
+int x;
+
+typedef __SIZE_TYPE__ size_t;
+
+struct gdt
+{
+size_t a,b,c,d,e,f;
+};
+void f()
+{
+struct gdt gdt_table[2]=
+{
+ {
+ 0,
+ ( (((size_t)(&x))<<(24))&(-1<<(8)) ),
+ },
+};
+}
+
diff --git a/gcc/testsuite/g++.dg/init/enum2.C b/gcc/testsuite/g++.dg/init/enum2.C
new file mode 100644
index 00000000000..dea7dc17be0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/enum2.C
@@ -0,0 +1,9 @@
+#include <limits.h>
+enum test {
+ z = 0,
+ c = UINT_MAX + 1LL
+} x = z;
+
+int main() {
+ return x != z;
+}
diff --git a/gcc/testsuite/g++.dg/init/init-ref4.C b/gcc/testsuite/g++.dg/init/init-ref4.C
new file mode 100644
index 00000000000..26d2e97562c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/init-ref4.C
@@ -0,0 +1,22 @@
+// Origin: dgregor@gcc.gnu.org
+// PR c++/11384
+// foo<int>::_S_something was not being emitted.
+
+// { dg-do run { xfail *-*-aout *-*-coff *-*-hpux* *-*-hms } }
+// On targets that don't support weak symbols, we require an explicit
+
+template<typename T>
+ struct foo
+ {
+ static const T _S_something;
+ };
+
+template<typename T>
+ const T foo<T>::_S_something = T();
+
+int main()
+{
+ const int* p = &foo<int>::_S_something;
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/init/new8.C b/gcc/testsuite/g++.dg/init/new8.C
new file mode 100644
index 00000000000..1fefc366ba8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/new8.C
@@ -0,0 +1,17 @@
+typedef __SIZE_TYPE__ size_t;
+
+enum Refcount_Type {
+ NO_REFCOUNT
+};
+
+struct d0_Unknown_Object
+{
+ void* operator new (size_t, size_t, Refcount_Type type);
+ void operator delete (void*, size_t, Refcount_Type);
+ d0_Unknown_Object ();
+};
+
+void make ()
+{
+ new (10, NO_REFCOUNT) d0_Unknown_Object;
+}
diff --git a/gcc/testsuite/g++.dg/init/ref8.C b/gcc/testsuite/g++.dg/init/ref8.C
new file mode 100644
index 00000000000..406cc10401d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/ref8.C
@@ -0,0 +1,10 @@
+struct A {
+ A operator=(const A&);
+};
+
+A operator*(A, A);
+
+A& operator+=(A& a, const A& b)
+{
+ return a = a * b; // { dg-error "non-const reference" }
+}
diff --git a/gcc/testsuite/g++.dg/init/ref9.C b/gcc/testsuite/g++.dg/init/ref9.C
new file mode 100644
index 00000000000..127b7d8e1fd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/ref9.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+
+struct ex;
+struct basic {
+ int refcount;
+ ex eval() const;
+ basic() : refcount(0) {}
+};
+
+struct ex {
+ basic *bp;
+ ex() : bp(0) { }
+ ex(const basic &);
+ virtual ~ex();
+ void construct_from_basic(const basic &);
+};
+
+ex basic::eval() const {
+ throw 1;
+}
+
+inline ex::ex(const basic &b) { construct_from_basic (b); }
+inline ex::~ex() { if (--bp->refcount == 0) delete bp; }
+void ex::construct_from_basic(const basic &b) {
+ const ex & tmpex = b.eval();
+ bp = tmpex.bp;
+ bp->refcount++;
+}
+
+ex pow() { return basic(); }
+
+int main()
+{
+ try { pow (); } catch (int) {}
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/init/struct1.C b/gcc/testsuite/g++.dg/init/struct1.C
new file mode 100644
index 00000000000..4cabc99e0e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/struct1.C
@@ -0,0 +1,6 @@
+struct bug {
+ const char *name;
+ unsigned long type;
+};
+
+struct bug s = { 0, (unsigned long) &s | 1 };
diff --git a/gcc/testsuite/g++.dg/lookup/crash1.C b/gcc/testsuite/g++.dg/lookup/crash1.C
new file mode 100644
index 00000000000..cd90685c70d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/crash1.C
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Aug 2003 <nathan@codesourcery.com>
+// Origin pr 11871 Dirk Mueller <mueller@kde.org>
+
+// PR c++/11871 Regression
+
+namespace std
+{
+ class A
+ {
+ public:
+ enum result
+ {
+ ok
+ };
+ };
+
+ template<typename T> class B : public A
+ {
+ public:
+ typedef A::result result;
+ };
+}
+
+int main()
+{
+ for(float result = 1.0;;);
+}
+
diff --git a/gcc/testsuite/g++.dg/lookup/koenig2.C b/gcc/testsuite/g++.dg/lookup/koenig2.C
new file mode 100644
index 00000000000..04f95258999
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/koenig2.C
@@ -0,0 +1,15 @@
+struct S
+{
+ template <typename T> void operator() (T) {}
+};
+
+namespace N
+{
+ S s;
+ struct A {} a;
+}
+
+using N::s;
+
+void f () { s(N::a); }
+
diff --git a/gcc/testsuite/g++.dg/lookup/scoped7.C b/gcc/testsuite/g++.dg/lookup/scoped7.C
new file mode 100644
index 00000000000..a9d70d06e3b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/scoped7.C
@@ -0,0 +1,20 @@
+//PR c++/11507
+// Origin: kai-gcc-bugs@khms.westfalen.de and bangerth@dealii.org
+//The new parser used to fail on this.
+
+// { dg-do compile }
+
+namespace NS
+{
+ void foo(bool arg1);
+}
+
+namespace M {
+ namespace K {
+ bool Bc(bool x);
+ }
+
+ void bar() {
+ NS::foo (K::Bc(true)); // GCC could not find K or Bc.
+ }
+}
diff --git a/gcc/testsuite/g++.dg/lookup/struct1.C b/gcc/testsuite/g++.dg/lookup/struct1.C
index c8bc0561be0..dd8d54b85d8 100644
--- a/gcc/testsuite/g++.dg/lookup/struct1.C
+++ b/gcc/testsuite/g++.dg/lookup/struct1.C
@@ -3,10 +3,10 @@
struct A;
typedef struct A B; // { dg-error "previous declaration" }
-struct B; // { dg-error "conflicting types" }
+struct B; // { dg-error "conflicting declaration" }
typedef struct { int i; } C; // { dg-error "previous declaration" }
-struct C; // { dg-error "conflicting types" }
+struct C; // { dg-error "conflicting declaration" }
struct D;
typedef struct D D;
diff --git a/gcc/testsuite/g++.dg/lookup/using7.C b/gcc/testsuite/g++.dg/lookup/using7.C
index 5f187fef564..e62d3f310ac 100644
--- a/gcc/testsuite/g++.dg/lookup/using7.C
+++ b/gcc/testsuite/g++.dg/lookup/using7.C
@@ -4,7 +4,7 @@ template <typename T, bool=T::X> struct A
};
template <typename T> struct B : A<T>
-{
+{ // { dg-error "" }
using A<T>::i; // { dg-error "" }
};
diff --git a/gcc/testsuite/g++.dg/opt/call1.C b/gcc/testsuite/g++.dg/opt/call1.C
new file mode 100644
index 00000000000..642e0240849
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/call1.C
@@ -0,0 +1,21 @@
+// { dg-options "-O2" }
+
+void a (void (*f)())
+{
+ f();
+}
+
+struct RunState
+{
+ static void runcallback() { }
+ static void wait()
+ {
+ a (runcallback);
+ }
+};
+
+int main()
+{
+ RunState::wait();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/opt/cfg1.C b/gcc/testsuite/g++.dg/opt/cfg1.C
new file mode 100644
index 00000000000..dbc81fe9bd8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/cfg1.C
@@ -0,0 +1,36 @@
+// PR optimization/11083
+// Origin: <nick@ilm.com>
+// Reduced testcase by Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+// The compiler used to keep unreachable basic blocks after dead edges
+// had been purged, which fooled the LCM code of the GCSE pass.
+
+// { dg-do compile }
+// { dg-options "-O2 -fnon-call-exceptions" }
+
+extern void *memmove (void *, const void *, unsigned int) throw ();
+
+struct S {
+ int *q;
+
+ S(int *i) : q(i) {}
+};
+
+struct X {
+ int *p;
+
+ void foo(S first, S last) {
+ try { memmove(0, 0, last.q - first.q); }
+ catch(...) { throw; }
+ }
+
+ void bar (const X& x);
+};
+
+void X::bar (const X& x)
+{
+ const unsigned int xlen = S(x.p).q - S(x.p).q;
+
+ if (xlen > 0)
+ foo(S(x.p), S(x.p));
+}
diff --git a/gcc/testsuite/g++.dg/opt/cfg3.C b/gcc/testsuite/g++.dg/opt/cfg3.C
new file mode 100644
index 00000000000..123c2f5157b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/cfg3.C
@@ -0,0 +1,61 @@
+// PR optimization/11646
+// Origin: <nick@ilm.com>
+
+// This used to fail because the compiler inadvertently cleared
+// the EDGE_ABNORMAL flag on a EDGE_EH edge and didn't delete
+// unreachable blocks after CSE.
+
+// { dg-do compile }
+// { dg-options "-O -fgcse -fnon-call-exceptions" }
+
+struct C
+{
+ int i;
+};
+
+struct allocator
+{
+ ~allocator() throw() {}
+};
+
+struct _Vector_alloc_base
+{
+ _Vector_alloc_base(const allocator& __a) {}
+ allocator _M_data_allocator;
+ struct C *_M_start, *_M_end_of_storage;
+ void _M_deallocate(struct C* __p, unsigned int __n) {}
+};
+
+struct _Vector_base : _Vector_alloc_base
+{
+ _Vector_base(const allocator& __a) : _Vector_alloc_base(__a) { }
+ ~_Vector_base() { _M_deallocate(0, _M_end_of_storage - _M_start); }
+};
+
+struct vector : _Vector_base
+{
+ vector(const allocator& __a = allocator()) : _Vector_base(__a) {}
+ struct C& operator[](unsigned int __n) { return *_M_start; }
+};
+
+struct A
+{
+ float l() const;
+ A operator-(const A &) const;
+ const A& operator=(float) const;
+};
+
+struct B
+{
+ float d();
+};
+
+float f(const A& a, B& b)
+{
+ vector vc;
+ int index = vc[0].i;
+ A aa;
+ float d = (aa - a).l();
+ if (d > b.d()) aa = 0;
+ return b.d();
+}
diff --git a/gcc/testsuite/g++.dg/opt/inline4.C b/gcc/testsuite/g++.dg/opt/inline4.C
new file mode 100644
index 00000000000..2d3eb379648
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/inline4.C
@@ -0,0 +1,13 @@
+// { dg-options "-O2 -ftemplate-depth-20000 --param min-inline-insns=100 --param max-inline-insns=3" }
+
+template <int I>
+inline void g() { g<I-1>(); return; }
+
+template <>
+inline void g<0>() { int i; return; }
+
+void h() {
+ g<250>();
+}
+
+// { dg-final { scan-assembler-not "_Z1g" } }
diff --git a/gcc/testsuite/g++.dg/opt/longbranch2.C b/gcc/testsuite/g++.dg/opt/longbranch2.C
new file mode 100644
index 00000000000..b74ceddf085
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/longbranch2.C
@@ -0,0 +1,62 @@
+// PR target/11689
+// Originator: thor@math.tu-berlin.de
+
+// { dg-do compile }
+// { dg-options "-O3 -funroll-loops -mtune=k6 -fomit-frame-pointer" { target i?86-*-* } }
+
+// This used to fail to assemble because of an out-of-range 'loop' instructions.
+
+
+class JKeeper {
+public:
+ unsigned long a0;
+};
+
+class EBCOTLut : public JKeeper {
+ unsigned char a1[1<<8];
+ unsigned char a2[1<<8];
+ unsigned char a3[1<<8];
+ long a4[1<<9];
+public:
+ EBCOTLut(void);
+};
+
+EBCOTLut::EBCOTLut(void)
+{
+ unsigned char inter[36]; // intermediate lookup table;
+ unsigned long i;
+ for(i=0;i<36;i++) {
+ inter[i] = 0;
+ }
+ for(i=1;i<16;i++) {
+ a1[i | (1<<7)] = 8<<1;
+ a1[i | (1<<6)] = 8<<1;
+ }
+ for(i=0;i < ((1<<9)-1);i++) {
+ int ds = (i>>0) & 0x01; // significance of DOWN
+ int us = (i>>1) & 0x01; // significance of UP
+ int rs = (i>>2) & 0x01; // significance of RIGHT
+ int ls = (i>>3) & 0x01; // significance of LEFT
+ int dn = (i>>5) & 0x01; // sign of DOWN
+ int un = (i>>6) & 0x01; // sign of UP
+ int rn = (i>>7) & 0x01; // sign of RIGHT
+ int ln = (i>>8) & 0x01; // sign of LEFT
+ int h,v; // h and v as in the VM description
+
+ h = ls*(1-ln*2) + rs*(1-2*rn);
+ v = us*(1-un*2) + ds*(1-2*dn);
+ h = (h >= -1)?(h):(-1);
+ v = (v >= -1)?(v):(-1);
+ h = (h <= 1)?(h):(1);
+ v = (v <= 1)?(v):(1);
+ a2[i] = inter[((h+1)<<3) | (v+1)];
+ a3[i] = inter[((h+1)<<3) | (v+1)] & (unsigned char)(~1);
+ }
+ for(i=0;i< 1<<9; i++) {
+ a4[i] = 2*(i-(1<<(9-1)))*(i-(1<<(9-1))) -
+ ((i< (1<<(9-1)))?
+ (2*(i-(1<<(9-2)))*(i-(1<<(9-2)))):
+ (2*(i-(3<<(9-2)))*(i-(3<<(9-2)))));
+
+ }
+}
diff --git a/gcc/testsuite/g++.dg/opt/ptrmem3.C b/gcc/testsuite/g++.dg/opt/ptrmem3.C
new file mode 100644
index 00000000000..552a92c9c1a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/ptrmem3.C
@@ -0,0 +1,23 @@
+// { dg-options "-O1" }
+
+#include <stdio.h>
+struct A {
+ A(int arg) : ia(arg) {}
+ int x,y,z,ia;
+ int mf(int arg) { return arg + ia; }
+};
+int func(int A::*pdm, int (A::*pmf)(int)) // 2. regular function
+{
+ A oa(2);
+ return ((&oa)->*pdm) + (oa.*pmf)(2);
+}
+int main()
+{
+ int val;
+
+ int A::*pda = &A::ia;
+ int (A::*pmfa)(int) = &A::mf;
+ val = func( pda, pmfa );
+ if(val != 6)
+ printf("val=%d, expect 6 \n", val);
+}
diff --git a/gcc/testsuite/g++.dg/opt/reg-stack2.C b/gcc/testsuite/g++.dg/opt/reg-stack2.C
new file mode 100644
index 00000000000..08cd590b471
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/reg-stack2.C
@@ -0,0 +1,34 @@
+// PR target/9786
+// Origin: <nick@ilm.com>
+
+// This used to fail on x86 because the reg-stack pass deleted
+// an insn that could seemingly trap (but actually doesn't)
+// without updating the CFG.
+
+// { dg-do compile }
+// { dg-options "-O2 -fnon-call-exceptions" }
+
+struct D1 {
+ float l;
+ D1 GS() const {D1 d;float f=.299*l;d.l=f;return d;}
+ static D1 G() {return D1();}
+};
+
+struct D2 {
+ D1 g;
+ D2(const D1& gi) : g(gi) {}
+ D2 GS() const {return D2(g.GS());}
+};
+
+class A {
+ public:
+ virtual ~A() {}
+};
+
+class B : public A {
+ public:
+ B(const D2& mi);
+ D2 fm;
+};
+
+B::B(const D2 &mi) : fm(mi.GS()) {}
diff --git a/gcc/testsuite/g++.dg/opt/static3.C b/gcc/testsuite/g++.dg/opt/static3.C
new file mode 100644
index 00000000000..00c72651be3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/static3.C
@@ -0,0 +1,35 @@
+// { dg-do link }
+
+class Foo {
+public:
+ // No out-of-class definition is provided for these class members.
+ // That's technically a violation of the standard, but no diagnostic
+ // is required, and, as a QOI issue, we should optimize away all
+ // references.
+ static const int erf = 0;
+ static const int foo = 1;
+};
+
+int one()
+{
+ return Foo::foo;
+}
+
+int two()
+{
+ return Foo::foo + Foo::erf;
+}
+
+int three(int x)
+{
+ return x ? Foo::erf : Foo::foo;
+}
+
+int i;
+
+int main ()
+{
+ one ();
+ two ();
+ three (i);
+}
diff --git a/gcc/testsuite/g++.dg/opt/tmp1.C b/gcc/testsuite/g++.dg/opt/tmp1.C
new file mode 100644
index 00000000000..21665335e72
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/tmp1.C
@@ -0,0 +1,48 @@
+// { dg-do run }
+
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Jul 2003 <nathan@codesourcery.com>
+
+// compound exprs were causing additional temporaries.
+
+extern "C" int printf (char const *, ...);
+extern "C" void abort ();
+
+
+static unsigned order[] =
+{
+ 1, 2, 502, 102, 101,
+ 0
+};
+
+static unsigned point;
+
+static void Check (unsigned t, unsigned i, void const *ptr, char const *name)
+{
+ printf ("%d %d %p %s\n", t, i, ptr, name);
+
+ if (order[point++] != i + t)
+ abort ();
+
+}
+
+template <int I> struct A
+{
+ A () { Check (0, I, this, __PRETTY_FUNCTION__); }
+ ~A () { Check (100, I, this, __PRETTY_FUNCTION__); }
+ A (A const &) { Check (200, I, this, __PRETTY_FUNCTION__); }
+ A &operator= (A const &) { Check (300, I, this, __PRETTY_FUNCTION__); }
+ void Foo () const { Check (400, I, this, __PRETTY_FUNCTION__); }
+};
+
+template <int I> void Foo (A<I> a)
+{
+ Check (500, I, &a, __PRETTY_FUNCTION__);
+}
+
+int main ()
+{
+ Foo ((A<1> (), A<2> ()));
+ Check (0, 0, 0, "end");
+}
diff --git a/gcc/testsuite/g++.dg/opt/vtgc1.C b/gcc/testsuite/g++.dg/opt/vtgc1.C
deleted file mode 100644
index 511d45b36e7..00000000000
--- a/gcc/testsuite/g++.dg/opt/vtgc1.C
+++ /dev/null
@@ -1,136 +0,0 @@
-// { dg-do compile }
-// { dg-options "-fvtable-gc" }
-// Origin: Hans-Peter Nilsson <hp@bitrange.com>
-
-class Base0
-{
-public:
- Base0(); virtual ~Base0();
- virtual void f1();
- virtual void f2();
-private:
- int a_value;
-};
-
-class Base1 : public Base0
-{
-public:
- Base1(); virtual ~Base1();
- virtual void f1(), f2();
- virtual void f3();
-};
-
-class Base2 : public Base1
-{
-public:
- Base2(); virtual ~Base2();
- virtual void f1(), f2();
- virtual void f4();
-};
-
-class VbasedA : virtual public Base2
-{
-public:
- VbasedA(); virtual ~VbasedA();
- virtual void f1(), f2(), f3();
- virtual void f6();
-};
-
-class Side0
-{
-public:
- Side0(); virtual ~Side0();
- virtual void x1();
- virtual void xx();
-private:
- int ryan;
-};
-
-class Multisv0 : public Side0, virtual public Base2
-{
-public:
- Multisv0(); virtual ~Multisv0();
- virtual void f1(), f2();
- virtual void f3();
- virtual void f6();
- virtual void xx();
-};
-
-class Multivs1 : public Base2, virtual public Side0
-{
-public:
- Multivs1(); virtual ~Multivs1(); virtual void f1(); virtual void fx2();
- virtual void fx4(), fx5();
- virtual void f6();
- virtual void xx();
-};
-
-class Multiss2 : public Base2, public Side0
-{
-public:
- Multiss2(); virtual ~Multiss2(); virtual void f1(); virtual void fx2();
- virtual void fx4();
- virtual void f6();
- virtual void xx();
-};
-
-class Multivv3 : virtual public Base2, virtual public Side0
-{
-public:
- Multivv3(); virtual ~Multivv3(); virtual void f1(); virtual void fx2();
- virtual void fx4(), fx5();
- virtual void f6();
- virtual void xx();
-};
-
-Base0::Base0() {}
-Base0::~Base0() {}
-Base1::Base1() {}
-Base1::~Base1() {}
-Base2::Base2() {}
-Base2::~Base2() {}
-VbasedA::VbasedA() {}
-VbasedA::~VbasedA() {}
-Multisv0::Multisv0() {}
-Multisv0::~Multisv0() {}
-Multivs1::Multivs1() {}
-Multivs1::~Multivs1() {}
-Multiss2::Multiss2() {}
-Multiss2::~Multiss2() {}
-Multivv3::Multivv3() {}
-Multivv3::~Multivv3() {}
-Side0::Side0() {}
-Side0::~Side0() {}
-
-extern void x (VbasedA *);
-extern void x2 (Multisv0 *);
-extern void x3 (Multivs1 *);
-extern void x4 (Multiss2 *);
-extern void x5 (Multivv3 *);
-void y () { VbasedA ii; x(&ii);}
-void y2 () { Multisv0 ii; x2(&ii);}
-void y3 () { Multivs1 ii; x3(&ii);}
-void y4 () { Multiss2 ii; x4(&ii);}
-void y5 () { Multivv3 ii; x5(&ii);}
-void x (VbasedA *ii) { ii->f2();}
-void x2 (Multisv0 *ii) { ii->f2();}
-void x3 (Multivs1 *ii) { ii->f2();}
-void x4 (Multiss2 *ii) { ii->f2();}
-void x5 (Multivv3 *ii) { ii->f2();}
-
-// Use .* because of ia64's convention of marking symbols with "#", which
-// makes it through the c++filt.
-
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivv3.*0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivv3.*0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multiss2.*vtable for Base2" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multivs1.*vtable for Base2" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multivs1.*vtable for Base2" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Multisv0.*vtable for Side0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for Multisv0.*vtable for Side0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Side0.*0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for VbasedA.*0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*VTT for VbasedA.*0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base2.*vtable for Base1" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base1.*vtable for Base0" } }
-// { dg-final { scan-assembler-dem "\.vtable_inherit\[ \t\]*vtable for Base0.*0" } }
diff --git a/gcc/testsuite/g++.dg/other/crash-1.C b/gcc/testsuite/g++.dg/other/crash-1.C
new file mode 100644
index 00000000000..e9a2d79f422
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/crash-1.C
@@ -0,0 +1,3 @@
+
+void f() { return 0; } // { dg-error "return-statement" }
+
diff --git a/gcc/testsuite/g++.dg/other/error2.C b/gcc/testsuite/g++.dg/other/error2.C
index 344be234f3b..391115ddc6d 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 `class N::N'|non-function|primary-expression" "" }
+void N::operator>>(int, N::B) // { dg-error "`B' is not a member of|non-function|primary-expression" "" }
{ } // { dg-error "" "" }
diff --git a/gcc/testsuite/g++.dg/other/field1.C b/gcc/testsuite/g++.dg/other/field1.C
new file mode 100644
index 00000000000..3afe3d908de
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/field1.C
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 9 Jul 2003 <nathan@codesourcery.com>
+
+// PR c++ 9483. accepted fields with same name as class
+
+struct test
+{
+ char test; // { dg-error "with same name as class" "" }
+ test();
+};
+
+template <typename T> struct X
+{
+ char X; // { dg-error "with same name as class" "" }
+ X ();
+};
+
+template <> struct X<int> {
+ char X; // { dg-error "with same name as class" "" }
+ X();
+};
+
+X<float> i; // { dg-error "instantiated from" "" }
diff --git a/gcc/testsuite/g++.dg/other/gc2.C b/gcc/testsuite/g++.dg/other/gc2.C
new file mode 100644
index 00000000000..142229475cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/gc2.C
@@ -0,0 +1,38 @@
+// PR c++/12316
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+// { dg-do compile }
+// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
+
+inline void FOO() {}
+
+template<typename> struct A
+{
+ A() {}
+ ~A() throw() {}
+};
+
+template<typename> struct B
+{
+ static void foo();
+ static void bar() { foo(); }
+};
+
+struct C {};
+
+template<typename> struct D : C
+{
+ D() {}
+ ~D() { B<void>::bar(); }
+};
+
+template<typename> struct E : D<void>
+{
+ static void baz() {}
+ E(A<void>) { baz(); }
+};
+
+void BAR()
+{
+ new E<void>(A<void>());
+}
diff --git a/gcc/testsuite/g++.dg/other/opaque-1.C b/gcc/testsuite/g++.dg/other/opaque-1.C
new file mode 100644
index 00000000000..ad79bfa21b6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/opaque-1.C
@@ -0,0 +1,29 @@
+/* { dg-do run { target powerpc-*-eabispe* } } */
+
+#define __vector __attribute__((vector_size(8)))
+typedef float __vector __ev64_fs__;
+
+__ev64_fs__ f;
+__ev64_opaque__ o;
+
+int here = 0;
+
+void bar (__ev64_opaque__ x)
+{
+ here = 0;
+}
+
+void bar (__ev64_fs__ x)
+{
+ here = 888;
+}
+
+int main ()
+{
+ f = o;
+ o = f;
+ bar (f);
+ if (here != 888)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/other/opaque-2.C b/gcc/testsuite/g++.dg/other/opaque-2.C
new file mode 100644
index 00000000000..efe04e3df1b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/opaque-2.C
@@ -0,0 +1,18 @@
+/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-options "-mcpu=8540 -mabi=spe" } */
+
+#define __vector __attribute__((vector_size(8)))
+typedef float __vector __ev64_fs__;
+
+__ev64_fs__ f;
+__ev64_opaque__ o;
+
+extern void bar (__ev64_opaque__);
+
+int main ()
+{
+ f = o;
+ o = f;
+ bar (f);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/other/opaque-3.C b/gcc/testsuite/g++.dg/other/opaque-3.C
new file mode 100644
index 00000000000..18ed0bee536
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/opaque-3.C
@@ -0,0 +1,11 @@
+/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-options "-mcpu=8540 -mabi=spe" } */
+
+__ev64_opaque__ o;
+#define v __attribute__((vector_size(8)))
+v unsigned int *p;
+
+void m()
+{
+ o = __builtin_spe_evldd(p, 5);
+}
diff --git a/gcc/testsuite/g++.dg/other/packed1.C b/gcc/testsuite/g++.dg/other/packed1.C
index 3a348ed8289..c46c3730610 100644
--- a/gcc/testsuite/g++.dg/other/packed1.C
+++ b/gcc/testsuite/g++.dg/other/packed1.C
@@ -1,4 +1,4 @@
-// { dg-do run { xfail arm-*-* hppa*-*-* mips-*-* powerpc-*-* sh-*-* sparc*-*-* } }
+// { dg-do run { xfail arm-*-* hppa*-*-* mips-*-* powerpc-*-* sh-*-* sparc*-*-* ia64-hp-hpux* } }
// NMS:2003-04-21 this fails on strict aligned architectures again,
// the patch was reverted because it broke something more important.
diff --git a/gcc/testsuite/g++.dg/other/static1.C b/gcc/testsuite/g++.dg/other/static1.C
new file mode 100644
index 00000000000..09e17d4b5ba
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/static1.C
@@ -0,0 +1,17 @@
+// PR c++/9574
+// Origin: fche@redhat.com and bangerth@dealii.org
+// The new parser ICE on this test and then it could
+// not find z in bar::bar().
+
+// { dg-do compile }
+
+struct X {
+ void operator[](const int& __k);
+};
+struct foo {
+ static X x;
+};
+struct bar {
+ int z;
+ bar () { foo::x[z]; };
+};
diff --git a/gcc/testsuite/g++.dg/overload/VLA.C b/gcc/testsuite/g++.dg/overload/VLA.C
new file mode 100644
index 00000000000..850e19a0054
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/VLA.C
@@ -0,0 +1,16 @@
+//Origin: kengole@us.ibm.com
+
+//PR c++/2478
+// G++ was rejecting this as it could not convert `int (*)[]' to `int (*)[0]'.
+// Using the C99 VLA style arrays in a struct.
+
+// { dg-do compile }
+
+struct {
+ int (*p)[];
+} B;
+
+void foo() {
+ int (*p)[];
+ B.p=p; // { dg-bogus "cannot convert" }
+}
diff --git a/gcc/testsuite/g++.dg/overload/addr1.C b/gcc/testsuite/g++.dg/overload/addr1.C
new file mode 100644
index 00000000000..25856a20fc6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/addr1.C
@@ -0,0 +1,50 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Sep 2003 <nathan@codesourcery.com>
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+// PR c++/11788 we failed to instantiate a decl, and we lost some side
+// effects
+
+static int flag = 0;
+
+template <typename> struct A
+{
+ A &active () { flag++;}
+
+ static void foo() {}
+
+ static void bar () {}
+ static void bar (int) {}
+
+ int m;
+};
+
+void (*baz ()) ()
+{
+ A<int> a;
+ return &a.active ().foo;
+}
+
+void (*boz ()) ()
+{
+ A<int> a;
+ return &a.active ().bar;
+}
+
+int *buz ()
+{
+ A<int> a;
+
+ return &a.active ().m;
+}
+
+int main ()
+{
+ baz ();
+ boz ();
+ buz ();
+
+ return flag != 3;
+}
diff --git a/gcc/testsuite/g++.dg/overload/builtin3.C b/gcc/testsuite/g++.dg/overload/builtin3.C
new file mode 100644
index 00000000000..dcd9fd02e38
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/builtin3.C
@@ -0,0 +1,10 @@
+// PR c++/11409
+// { dg-do compile }
+
+namespace std {
+ double fabs (double);
+}
+using std::fabs;
+
+double (*p) (double) = &fabs; // { dg-bogus "is ambiguous" "" }
+
diff --git a/gcc/testsuite/g++.dg/overload/operator1.C b/gcc/testsuite/g++.dg/overload/operator1.C
new file mode 100644
index 00000000000..f4d1f53f14e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/operator1.C
@@ -0,0 +1,34 @@
+typedef struct _GdkDrawable GdkDrawable;
+typedef struct _GdkDrawable GdkBitmap;
+typedef struct _GdkDrawable GdkPixmap;
+
+class Drawable
+{
+public:
+ operator GdkDrawable* () const;
+};
+
+
+class Pixmap : public Drawable
+{
+public:
+ operator GdkPixmap* () const;
+
+};
+
+
+class Bitmap : public Pixmap
+{
+public:
+ operator GdkBitmap* () const;
+
+};
+
+class Event
+{
+};
+
+Bitmap::operator GdkBitmap* () const
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/overload/prom1.C b/gcc/testsuite/g++.dg/overload/prom1.C
new file mode 100644
index 00000000000..9eb387dc43a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/prom1.C
@@ -0,0 +1,9 @@
+void foo(signed char) {}
+typedef int bar;
+void foo(bar) {}
+
+int main (int, char **) {
+ char c;
+ foo(c);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/overload/template1.C b/gcc/testsuite/g++.dg/overload/template1.C
new file mode 100644
index 00000000000..5bfad8464f7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/template1.C
@@ -0,0 +1,12 @@
+template<typename T> T Foo (int) {T d;}
+
+void Baz (void (*)(int), int);
+
+int Foo ();
+int Baz (int (*)(), float);
+
+void Bar ()
+{
+ Baz (Foo, 1.0f);
+
+}
diff --git a/gcc/testsuite/g++.dg/parse/access3.C b/gcc/testsuite/g++.dg/parse/access3.C
new file mode 100644
index 00000000000..43303c95a94
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/access3.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: <bagnara@cs.unipr.it>
+
+// PR c++/7809: Befriending inaccessible name.
+
+class A {
+private:
+ void f(); // { dg-error "private" }
+};
+
+class B {
+ friend void A::f(); // { dg-error "context" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/access4.C b/gcc/testsuite/g++.dg/parse/access4.C
new file mode 100644
index 00000000000..d3870bd3497
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/access4.C
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: Mike Reed <mike.reed@amadron.com>
+
+// PR c++/11174: Access checking of pointer-to-member function
+
+class A {
+protected:
+ void foo() {} // { dg-error "protected" }
+public:
+ A();
+};
+
+class B : public A {
+ void bar() {
+ A a;
+ void (A::*pmf)() = &A::foo; // { dg-error "this context" }
+ (a.*pmf)();
+ }
+};
diff --git a/gcc/testsuite/g++.dg/parse/access5.C b/gcc/testsuite/g++.dg/parse/access5.C
new file mode 100644
index 00000000000..cd1789eedda
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/access5.C
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo <giovannibajo@libero.it>
+
+// PR c++/11174: Access checking on pointer to member data.
+
+struct A
+{
+protected:
+ int a; // { dg-error "protected" }
+};
+
+struct B : A
+{
+ void foo() {
+ (void)&A::a; // { dg-error "this context" }
+ }
+};
diff --git a/gcc/testsuite/g++.dg/parse/access6.C b/gcc/testsuite/g++.dg/parse/access6.C
new file mode 100644
index 00000000000..33d50905854
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/access6.C
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Origin: David Baron <dbaron@fas.harvard.edu>
+
+// PR c++/3765: Changing access from public to private by member
+// using declaration.
+
+class A
+{
+ public:
+ int foo() { return 1; } // { dg-error "inaccessible" }
+};
+
+class B : public A
+{
+ private:
+ using A::foo;
+};
+
+int main()
+{
+ B b;
+ return b.foo(); // { dg-error "this context" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/ambig3.C b/gcc/testsuite/g++.dg/parse/ambig3.C
new file mode 100644
index 00000000000..72ee960c95e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/ambig3.C
@@ -0,0 +1,12 @@
+// PR c++/9452
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+// { dg-do compile }
+
+template <int> struct A { static const int i = 1; };
+template <int> struct B {};
+
+template <typename> void foo(B<0>) {} // { dg-error "" }
+
+template <typename, int j> B<A<j>::i-1> foo(B<j>) { return B<0>(); } // { dg-error "" }
+
+void bar() { foo<int>(B<0>()); } // { dg-error "ambiguous" }
diff --git a/gcc/testsuite/g++.dg/parse/args1.C b/gcc/testsuite/g++.dg/parse/args1.C
new file mode 100644
index 00000000000..0eb6e64b634
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/args1.C
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 9 Jul 2003 <nathan@codesourcery.com>
+
+// PR c++ 11050. Accepted ill-formed
+
+
+void Foo (int)
+{
+ Foo(2 2); // { dg-error "expected" "" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/condexpr1.C b/gcc/testsuite/g++.dg/parse/condexpr1.C
new file mode 100644
index 00000000000..1ca7dbfa646
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/condexpr1.C
@@ -0,0 +1,13 @@
+// PR c++/10247
+// Origin: Lars Gullik Bjønes <larsbj@lyx.org>
+// { dg-do compile }
+
+struct A {};
+
+A const foo();
+
+void bar()
+{
+ A a = foo();
+ A b = true ? a : foo();
+}
diff --git a/gcc/testsuite/g++.dg/parse/constant3.C b/gcc/testsuite/g++.dg/parse/constant3.C
new file mode 100644
index 00000000000..c029e33ed58
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/constant3.C
@@ -0,0 +1,7 @@
+const int i = 1;
+const int j (2);
+const int k = { 3 };
+
+enum { a = i, b = j, c = k };
+
+
diff --git a/gcc/testsuite/g++.dg/parse/constant4.C b/gcc/testsuite/g++.dg/parse/constant4.C
new file mode 100644
index 00000000000..65c84d94a13
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/constant4.C
@@ -0,0 +1,40 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Jul 2003 <nathan@codesourcery.com>
+
+// PR c++/11525 incorrect error about non-constant initalizer
+
+template<typename> class X;
+template<unsigned> class Y {};
+
+
+template<typename T>
+void Foo ()
+{
+ static const unsigned I = X<T>::I;
+
+ Y<I> i;
+
+ static const unsigned J = X<T>::J;
+
+ Y<J> j; // { dg-error "non-constant" "" }
+}
+
+struct A
+{
+ operator unsigned () const;
+};
+
+template <typename> struct X
+{
+ enum {I};
+ static A const J;
+};
+
+void Baz ()
+{
+ Foo<int> (); // { dg-error "instantiated" "" }
+}
+
+
diff --git a/gcc/testsuite/g++.dg/parse/crash10.C b/gcc/testsuite/g++.dg/parse/crash10.C
new file mode 100644
index 00000000000..3278ecedad3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash10.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
+
+// PR c++ 10953. ICE
+
+// { dg-error "" "" { target *-*-* } 14 }
+
+class
+{
+ typename:: // { dg-error "" "" }
+; // { dg-error "" "" }
diff --git a/gcc/testsuite/g++.dg/parse/crash11.C b/gcc/testsuite/g++.dg/parse/crash11.C
new file mode 100644
index 00000000000..4893678d46f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash11.C
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Origin: priesnit@math.uni-goettingen.de
+
+// PR c++/5767: ICE parsing typename with invalid scope.
+
+template <template <typename> class TP>
+struct A
+{
+ template <typename T>
+ struct Template
+ {
+ typedef typename TP<T>::Type Type;
+ };
+};
+template <template <typename> class TP>
+struct B
+{
+ template <typename T>
+ struct Template
+ {
+ typedef typename A<A<TP>::Template>
+ ::template Template<T>::Type Type; // { dg-error "mismatch|class template|unqualified-id" }
+ };
+};
+template <typename T>
+struct C
+{
+ typedef void Type;
+};
+int main()
+{
+ typedef B<C>::Template<void>::Type Type; // { dg-error "init-declarator|;" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/crash12.C b/gcc/testsuite/g++.dg/parse/crash12.C
new file mode 100644
index 00000000000..cf947b27787
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash12.C
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Origin: Martin von Loewis <martin@v.loewis.de>
+
+// PR c++/157: Incorrect type/template decision in function parameter.
+
+template <class _Tp> class auto_ptr {};
+template <class _Tp>
+class counted_ptr
+{
+public:
+ counted_ptr(auto_ptr<_Tp>& __a); // { dg-error "candidate" }
+ auto_ptr<_Tp> auto_ptr();
+};
+
+template <class _Tp>
+inline counted_ptr<_Tp>::counted_ptr(class auto_ptr& __a) // { dg-error "required" }
+{ // { dg-error "no type|not match|template" }
+}
+
+template <class _Tp>
+inline class auto_ptr<_Tp> counted_ptr<_Tp>::auto_ptr()
+{
+}
diff --git a/gcc/testsuite/g++.dg/parse/crash7.C b/gcc/testsuite/g++.dg/parse/crash7.C
new file mode 100644
index 00000000000..86fa477266b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash7.C
@@ -0,0 +1,10 @@
+struct A
+{
+ int foo () const { return 0; }
+};
+
+template <typename> void bar (int x[], const A &a)
+{
+ const int i=a.foo();
+ x[i]=0;
+}
diff --git a/gcc/testsuite/g++.dg/parse/crash9.C b/gcc/testsuite/g++.dg/parse/crash9.C
new file mode 100644
index 00000000000..44ce57b1316
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash9.C
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
+
+// PR c++/10793: ICE in handling base class when the current class
+// contains error.
+
+template <typename> struct A {};
+template <typename> struct A<INVALID> : A<int> { }; // { dg-error "not declared|invalid" }
diff --git a/gcc/testsuite/g++.dg/parse/def-tmpl-arg1.C b/gcc/testsuite/g++.dg/parse/def-tmpl-arg1.C
new file mode 100644
index 00000000000..fd85b97c15a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/def-tmpl-arg1.C
@@ -0,0 +1,9 @@
+// PR c++/8895
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+// { dg-do compile }
+
+template <typename X, typename Y = B<X> > struct A // { dg-error "" }
+{
+ A();
+ A(const A&);
+}; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/parse/defarg5.C b/gcc/testsuite/g++.dg/parse/defarg5.C
new file mode 100644
index 00000000000..01a67ed5915
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/defarg5.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 2003 <nathan@codesourcery.com>
+// Origin:Wolfgang Bangerth bangerth@dealii.org
+
+// PR c++/12167 - infinite recursion
+
+class A {
+ void report(int d
+ // the default arg is what NAN etc can expand to, but
+ // with the floatiness removed.
+ = (__extension__ ((union { unsigned l; int d; })
+ { l: 0x7fc00000U }).d));
+};
diff --git a/gcc/testsuite/g++.dg/parse/dtor2.C b/gcc/testsuite/g++.dg/parse/dtor2.C
new file mode 100644
index 00000000000..60e132b4a9b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/dtor2.C
@@ -0,0 +1,4 @@
+struct A {
+ typedef A A2;
+ ~A2(); // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/elab2.C b/gcc/testsuite/g++.dg/parse/elab2.C
new file mode 100644
index 00000000000..69273a3fc31
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/elab2.C
@@ -0,0 +1,7 @@
+struct A {};
+
+struct B
+{
+ typedef A T;
+ friend struct T; // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/friend3.C b/gcc/testsuite/g++.dg/parse/friend3.C
new file mode 100644
index 00000000000..39322021efc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/friend3.C
@@ -0,0 +1,10 @@
+// { dg-do compile }
+//
+// PR 11553 catch duplicate friend specifiers
+
+struct S
+{
+ friend friend class C; // { dg-error "duplicate" }
+};
+
+
diff --git a/gcc/testsuite/g++.dg/parse/funptr1.C b/gcc/testsuite/g++.dg/parse/funptr1.C
new file mode 100644
index 00000000000..bf63c122e8b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/funptr1.C
@@ -0,0 +1,13 @@
+// PR c++/9282
+// Origin: Thomas Richter <thor@math.tu-berlin.de>
+// { dg-do compile }
+
+typedef void (*fptr)();
+
+struct A
+{
+ template<int> static void foo() {}
+ template<fptr f> static void bar() { (*f)(); }
+};
+
+fptr f = A::bar< A::foo<0> >;
diff --git a/gcc/testsuite/g++.dg/parse/invalid-op1.C b/gcc/testsuite/g++.dg/parse/invalid-op1.C
new file mode 100644
index 00000000000..37e480983f8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/invalid-op1.C
@@ -0,0 +1,13 @@
+// PR c++/10150
+// Origin: Tom Evans <te200@eng.cam.ac.uk>
+// { dg-do compile }
+
+template <int I> struct A
+{
+ template <int> struct B
+ {
+ enum { e = I * A<I-1>::B }; // { dg-error "" }
+ };
+};
+
+A<0>::B<0> a; // { dg-error "instantiated" }
diff --git a/gcc/testsuite/g++.dg/parse/non-dependent2.C b/gcc/testsuite/g++.dg/parse/non-dependent2.C
new file mode 100644
index 00000000000..ef75c17aef3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/non-dependent2.C
@@ -0,0 +1,37 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 16 Jul 2003 <nathan@codesourcery.com>
+
+// A non-dependent field_decl can bind at parse time.
+
+template <class T>
+struct Foo {
+ int j; // we never see this one.
+ int k; // { dg-error "" "" }
+
+};
+
+struct Baz
+{
+ int j;
+ int k; // { dg-error "" "" }
+
+};
+
+template <class T>
+struct Bar : public Foo<T>, Baz {
+
+ int baz () { return j; } // binds to Baz::j
+ int foo () { return this->k; } // { dg-error "request for member" "" }
+};
+
+int main()
+{
+ Bar<int> bar;
+
+ bar.baz ();
+ bar.foo (); // { dg-error "instantiated" "" }
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/parse/operator2.C b/gcc/testsuite/g++.dg/parse/operator2.C
new file mode 100644
index 00000000000..a9ebde0d4f5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/operator2.C
@@ -0,0 +1,15 @@
+// PR c++/7906
+// Origin: Marcel Loose <loose@astron.nl>
+// { dg-do compile }
+
+template <typename> struct A { typedef int X; };
+
+template <typename T> struct B
+{
+ typedef A<T> Y;
+ struct C { operator typename Y::X() const; };
+};
+
+template <typename T> B<T>::C::operator typename B<T>::Y::X() const { return 0; }
+
+B<int> b;
diff --git a/gcc/testsuite/g++.dg/parse/operator3.C b/gcc/testsuite/g++.dg/parse/operator3.C
new file mode 100644
index 00000000000..08f5c83f229
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/operator3.C
@@ -0,0 +1,11 @@
+// PR c++/9454
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+// { dg-do compile }
+
+template <int> struct A
+{
+ struct B { operator int (); };
+ struct C : B { operator int (); };
+};
+
+A<0> a;
diff --git a/gcc/testsuite/g++.dg/parse/operator4.C b/gcc/testsuite/g++.dg/parse/operator4.C
new file mode 100644
index 00000000000..9395ccdd1b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/operator4.C
@@ -0,0 +1 @@
+int operator *(int, ...); // { dg-error "class" }
diff --git a/gcc/testsuite/g++.dg/parse/qualified2.C b/gcc/testsuite/g++.dg/parse/qualified2.C
new file mode 100644
index 00000000000..c582613c953
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/qualified2.C
@@ -0,0 +1,4 @@
+namespace Glib {
+ template <typename> class Value {};
+ template <> class Glib::Value<int> {}; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/ret-type2.C b/gcc/testsuite/g++.dg/parse/ret-type2.C
new file mode 100644
index 00000000000..2e8fa36ec0c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/ret-type2.C
@@ -0,0 +1,5 @@
+struct S {} f(); // { dg-error "" }
+struct T {} *g(); // { dg-error "" }
+struct U {} h() {} // { dg-error "" }
+struct V {} *i() {} // { dg-error "" }
+struct W {} (*p) (); // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/parse/template10.C b/gcc/testsuite/g++.dg/parse/template10.C
new file mode 100644
index 00000000000..d5dec6ed111
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/template10.C
@@ -0,0 +1,15 @@
+// PR c++/9486
+// Origin: John Levon <levon@movementarian.org>
+// { dg-do compile }
+
+template <typename> struct A
+{
+ template <typename T> void foo(T);
+};
+
+template <typename T> void bar()
+{
+ A<void>().template foo<T>(0);
+}
+
+template void bar<int>();
diff --git a/gcc/testsuite/g++.dg/parse/template11.C b/gcc/testsuite/g++.dg/parse/template11.C
new file mode 100644
index 00000000000..e651a3bd076
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/template11.C
@@ -0,0 +1,15 @@
+// PR c++/9488
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+// { dg-do compile }
+
+struct A
+{
+ template <typename> void foo() {}
+};
+
+template <typename T> struct B
+{
+ void bar() { A().foo<T>(); }
+};
+
+template struct B<int>;
diff --git a/gcc/testsuite/g++.dg/parse/template12.C b/gcc/testsuite/g++.dg/parse/template12.C
new file mode 100644
index 00000000000..ba375bc437a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/template12.C
@@ -0,0 +1,10 @@
+template <int J>
+struct A {
+};
+
+struct B {
+ template <int I>
+ struct C : public A<I> {};
+
+ typedef double I;
+};
diff --git a/gcc/testsuite/g++.dg/parse/template8.C b/gcc/testsuite/g++.dg/parse/template8.C
new file mode 100644
index 00000000000..e4af7eea3a5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/template8.C
@@ -0,0 +1,16 @@
+namespace N
+{
+
+template <typename> struct A
+{
+ template <typename T> A(A<T>);
+};
+
+}
+
+void foo(N::A<int>);
+
+void bar()
+{
+ foo(N::A); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/template9.C b/gcc/testsuite/g++.dg/parse/template9.C
new file mode 100644
index 00000000000..90ce9fe61ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/template9.C
@@ -0,0 +1,5 @@
+template <typename T>
+void f() {
+ g(); // { dg-error "" }
+ h(3); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/typedef3.C b/gcc/testsuite/g++.dg/parse/typedef3.C
new file mode 100644
index 00000000000..380b7530542
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/typedef3.C
@@ -0,0 +1,7 @@
+// PR c++/3004
+// Origin: Travis J.I. Corcoran <tjic@permabit.com>
+// { dg-do compile }
+
+struct A { typedef A* Ptr; };
+
+struct A::Ptr; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/parse/typedef4.C b/gcc/testsuite/g++.dg/parse/typedef4.C
new file mode 100644
index 00000000000..03f709a184d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/typedef4.C
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+// Origin: Matt Austern <austern@apple.com>
+
+// PR c++/7983: ICE typedef to typename as friend.
+
+template<class T> class smart_ptr2 {
+ T* real_ptr;
+ public:
+ typedef typename T::subT td;
+ friend class td; // { dg-error "typedef" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/typedef5.C b/gcc/testsuite/g++.dg/parse/typedef5.C
new file mode 100644
index 00000000000..5f6b18ca395
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/typedef5.C
@@ -0,0 +1,6 @@
+namespace A
+{
+ typedef int T;
+}
+
+class A::T x; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/parse/using2.C b/gcc/testsuite/g++.dg/parse/using2.C
new file mode 100644
index 00000000000..bfdb09f8833
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/using2.C
@@ -0,0 +1,8 @@
+namespace N {
+ template <typename T>
+ struct foo {};
+}
+
+int main() {
+ using N::foo<double>; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/parse/using3.C b/gcc/testsuite/g++.dg/parse/using3.C
new file mode 100644
index 00000000000..c266b68eaf7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/using3.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Sep 2003 <nathan@codesourcery.com>
+// Origin: stefaandr@hotmail.com
+
+// PR c++/11794. Using decl in nested classes of a template class
+
+template <typename T> struct a
+{
+ struct a1: T
+ {
+ using T::aa;
+
+ a1() { aa = 5; }
+ };
+};
+struct b { int aa; };
+template <> struct a<int>::a1 { a1 () {} };
+
+a<b>::a1 a_b;
+a<int>::a1 a_i;
diff --git a/gcc/testsuite/g++.dg/rtti/typeid2.C b/gcc/testsuite/g++.dg/rtti/typeid2.C
new file mode 100644
index 00000000000..0dbcc598b9d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid2.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+
+#include <typeinfo>
+
+template <typename T> const char *print_type (const T &) {
+ return typeid(T).name();
+}
+
+/* no template */ void pp1 (int) {}
+template <typename X> void pp2 (X) {}
+
+int main () {
+ if (print_type (&pp1) != print_type (&pp2<int>))
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/rtti/typeid3.C b/gcc/testsuite/g++.dg/rtti/typeid3.C
new file mode 100644
index 00000000000..a07b399249c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid3.C
@@ -0,0 +1,11 @@
+#include <typeinfo>
+
+template <template <class> class T> struct A {
+ void error() {
+ typeid(T).name(); // { dg-error "missing" }
+ }
+};
+
+template <class T> struct B {};
+
+template void A<B>::error();
diff --git a/gcc/testsuite/g++.dg/template/access12.C b/gcc/testsuite/g++.dg/template/access12.C
new file mode 100644
index 00000000000..9185d51253e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/access12.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Origin: Giovanni Bajo <giovannibajo@libero.it>
+
+// PR c++/10849: Incorrect access checking on class template partial
+// specialization.
+
+class X {
+ private:
+ template <typename T> struct Y;
+};
+
+template <typename T> struct X::Y<T*> {};
diff --git a/gcc/testsuite/g++.dg/template/anon1.C b/gcc/testsuite/g++.dg/template/anon1.C
new file mode 100644
index 00000000000..ef73df6b39e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/anon1.C
@@ -0,0 +1,21 @@
+struct x {
+ int foo () {}
+};
+
+template <class T>
+struct vector {
+ T& bar () {}
+};
+
+template <class T>
+struct y {
+ typedef struct {
+ x t;
+ } s;
+
+ vector<s> array;
+
+ int foo ()
+ { return array.bar().t.foo(); }
+};
+int i = y<x>().foo ();
diff --git a/gcc/testsuite/g++.dg/template/call1.C b/gcc/testsuite/g++.dg/template/call1.C
new file mode 100644
index 00000000000..3b6e367af22
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/call1.C
@@ -0,0 +1,17 @@
+//Origin: harinath@cs.umn.edu
+//PR c++/10804
+// G++ was not emiting the function foo.
+
+// { dg-do run }
+
+
+template<class T>
+struct A
+{
+ A() { const void (*a)() = foo; }
+ static const void foo() {}
+};
+int main(int argc, char *argv[])
+{
+ A<int> a;
+}
diff --git a/gcc/testsuite/g++.dg/template/class1.C b/gcc/testsuite/g++.dg/template/class1.C
new file mode 100644
index 00000000000..96415fbc225
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/class1.C
@@ -0,0 +1,9 @@
+extern const int a;
+
+template <const int&> class X {};
+
+template <typename> struct Y {
+ X<a> x;
+};
+
+template struct Y<int>;
diff --git a/gcc/testsuite/g++.dg/template/crash10.C b/gcc/testsuite/g++.dg/template/crash10.C
new file mode 100644
index 00000000000..62647ca723a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash10.C
@@ -0,0 +1,27 @@
+//Origin: benko@sztaki.hu
+//PR c++/11432
+// The mainline ICE on this one between 2003-01-16 and 2003-07-29.
+
+// { dg-do compile }
+
+ extern "C" void abort();
+
+
+template <int A>
+struct a
+{
+ static int const value = A - 1;
+};
+
+
+template <int B>
+struct b
+{
+ static int foo()
+ {
+ return a<L>::value;
+ }
+
+
+ static int const L = a<B + 1>::value;
+};
diff --git a/gcc/testsuite/g++.dg/template/crash11.C b/gcc/testsuite/g++.dg/template/crash11.C
new file mode 100644
index 00000000000..3c69514e243
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash11.C
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+// Origin: kparz@iastate.edu
+
+// PR c++/7939: ICE for invalid function parameter after template
+// substitution.
+
+template <class T, class U> void foo(T, U) {}
+template <class T> void foo<T,void>(T, void) {} // { dg-error "incomplete|invalid|partial" }
diff --git a/gcc/testsuite/g++.dg/template/crash4.C b/gcc/testsuite/g++.dg/template/crash4.C
new file mode 100644
index 00000000000..72b2bb18b9f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash4.C
@@ -0,0 +1,12 @@
+namespace NS {
+ struct C {};
+ void foo();
+}
+
+template <class T> struct X {};
+
+template <class T> struct A {
+ A() { foo (X<T>()); }
+ void foo(X<T>);
+};
+template struct A<NS::C>;
diff --git a/gcc/testsuite/g++.dg/template/crash6.C b/gcc/testsuite/g++.dg/template/crash6.C
new file mode 100644
index 00000000000..776e01ebb6d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash6.C
@@ -0,0 +1,8 @@
+template <class> struct A { static const int n = 1; } ;
+template <int> struct B;
+
+template <class S>
+struct restype_order {
+ static const int s = A<S>::n;
+ typedef typename B<(s > 0)>::t t;
+};
diff --git a/gcc/testsuite/g++.dg/template/crash7.C b/gcc/testsuite/g++.dg/template/crash7.C
new file mode 100644
index 00000000000..5b17928f5bb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash7.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+// PR c++/10108: ICE in tsubst_decl for error due to non-existence
+// nested type.
+
+template <typename> struct A
+{ // { dg-error "candidates" }
+ template <typename> A(typename A::X) {} // { dg-error "no type" }
+};
+
+A<void> a; // { dg-error "instantiated|no match" }
diff --git a/gcc/testsuite/g++.dg/template/crash8.C b/gcc/testsuite/g++.dg/template/crash8.C
new file mode 100644
index 00000000000..a6f26b30679
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash8.C
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: David Robinson <drtr@dial.pipex.com>
+
+// PR c++/11513: ICE due to incorrect decision whether the tag is template.
+
+template <typename T>
+struct bar
+{
+ struct foo
+ {
+ int a;
+ };
+
+ template <typename U>
+ int wom(U c)
+ {
+ struct foo b;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/crash9.C b/gcc/testsuite/g++.dg/template/crash9.C
new file mode 100644
index 00000000000..7a568fe054a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash9.C
@@ -0,0 +1,12 @@
+struct A { };
+struct B { };
+
+A f(const B & b) {
+ return A();
+}
+
+template<>
+B f(const A & a) { // { dg-error "" }
+ return B();
+}
+
diff --git a/gcc/testsuite/g++.dg/template/deduce2.C b/gcc/testsuite/g++.dg/template/deduce2.C
new file mode 100644
index 00000000000..bcf77b30b78
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/deduce2.C
@@ -0,0 +1,30 @@
+template <typename T0> struct tuple {
+ typedef tuple<int> tail;
+};
+
+template <> struct tuple<int> {
+};
+
+template <typename L>
+struct length {
+ static const int i = length<typename tuple<L>::tail>::i;
+};
+
+template<>
+struct length<tuple<int> > {
+ static const int i = 1;
+};
+
+template <int> struct M {};
+
+template <typename A>
+M<length<tuple<A> >::i > foo (A*);
+
+template <typename A>
+M<length<tuple<A> >::i> foo (const A*);
+
+const int i1 = 3;
+
+void bar() {
+ foo (&i1);
+}
diff --git a/gcc/testsuite/g++.dg/template/defarg3.C b/gcc/testsuite/g++.dg/template/defarg3.C
new file mode 100644
index 00000000000..da91cb7b174
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/defarg3.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
+
+// PR c++ 11596
+
+template <int V, bool F = V < 1> struct A { enum { value }; };
+template <int V> struct B { enum { value = A<1>::value }; };
+int ary[!B<1>::value ? 1 : -1];
+
+template <int V, bool F = V < 1> struct A1 { enum { value = 1}; };
+template <int V> struct A1<V,false> { enum { value}; };
+template <int V> struct B1 { enum { value = A1<1>::value }; };
+
+int ary1[!B1<1>::value ? 1 : -1];
diff --git a/gcc/testsuite/g++.dg/template/dependent-expr2.C b/gcc/testsuite/g++.dg/template/dependent-expr2.C
new file mode 100644
index 00000000000..9c9d5f96673
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/dependent-expr2.C
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Aug 2003 <nathan@codesourcery.com>
+
+// PR 11704. ICE
+
+struct A
+{
+ int foo()
+ {
+ return 5;
+ }
+};
+
+template <class T> // If B is not template it works
+struct B
+{
+ bool bar(A& a)
+ {
+ return a.foo == 0; // { dg-error "insufficient context" "" }
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/dependent-name2.C b/gcc/testsuite/g++.dg/template/dependent-name2.C
new file mode 100644
index 00000000000..9e0cbcee189
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/dependent-name2.C
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Aug 2003 <nathan@codesourcery.com>
+
+// PR 10530. Thought a type was dependent.
+
+template <typename T>
+struct Foo {
+ struct Inner {
+ typedef int type;
+ };
+};
+
+template <typename A> struct Bar {
+ typedef typename Foo<int>::Inner::type type;
+};
+
diff --git a/gcc/testsuite/g++.dg/template/dtor2.C b/gcc/testsuite/g++.dg/template/dtor2.C
new file mode 100644
index 00000000000..04bea9cb640
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/dtor2.C
@@ -0,0 +1,10 @@
+struct Foo
+{
+ template <int i>
+ ~Foo() {} // { dg-error "" }
+};
+
+int main()
+{
+ Foo f;
+}
diff --git a/gcc/testsuite/g++.dg/template/elab1.C b/gcc/testsuite/g++.dg/template/elab1.C
new file mode 100644
index 00000000000..778150f06dc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/elab1.C
@@ -0,0 +1,13 @@
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+// { dg-do compile }
+
+// Elaborate type specifier of class template
+
+template <class T> class A {
+ class B;
+};
+
+template <class T> class A<T>::B {
+ friend class A;
+};
diff --git a/gcc/testsuite/g++.dg/template/error2.C b/gcc/testsuite/g++.dg/template/error2.C
new file mode 100644
index 00000000000..0f3e975cd4f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error2.C
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2003 <nathan@codesourcery.com>
+
+// instantiated from did not indicate the nested class
+
+template<class T> struct X
+{
+ T m; // { dg-error "" "" }
+};
+
+template<class T >
+struct Derived
+{
+ class Nested : public X<T>
+ { // { dg-error "instantiated" "" }
+ };
+
+ Nested m; // { dg-error "instantiated" "" }
+
+ void Foo ();
+};
+
+void Foo (Derived<void> &x)
+{
+ x.Foo (); // { dg-error "instantiated" "" }
+}
diff --git a/gcc/testsuite/g++.dg/template/explicit2.C b/gcc/testsuite/g++.dg/template/explicit2.C
new file mode 100644
index 00000000000..79941cd8ed5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/explicit2.C
@@ -0,0 +1,10 @@
+struct X {
+ template <class B> void foo(B);
+};
+
+template <class D>
+void bar() {
+ X().foo<D>(1);
+}
+
+template void bar<int> ();
diff --git a/gcc/testsuite/g++.dg/template/explicit3.C b/gcc/testsuite/g++.dg/template/explicit3.C
new file mode 100644
index 00000000000..49d0689a515
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/explicit3.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2003 <nathan@codesourcery.com>
+
+// Failed to spot specialization using a template-id expr
+
+template <int n> class A {};
+template <int m> class R {};
+
+template <int n, int x> struct Trait { enum {m = n}; };
+
+template <int n, int x> R<Trait<n,x>::m> f(A<x>);
+template <> R<Trait<1,1>::m> f<1>(A<1>) {return R<1>();}
+
+void Baz ()
+{
+ R<Trait<1,1>::m> (*ptr) (A<1>);
+
+ ptr = &f<1>;
+
+}
diff --git a/gcc/testsuite/g++.dg/template/explicit4.C b/gcc/testsuite/g++.dg/template/explicit4.C
new file mode 100644
index 00000000000..3953f8fc78d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/explicit4.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2003 <nathan@codesourcery.com>
+
+// Failed to spot specialization using a template-id expr
+
+template <typename n> class A {};
+template <int m> class R {};
+
+template <int n, int x> struct Trait { enum {m = n}; };
+
+template <typename n, typename x> R<Trait<1,1>::m> f(A<x>);
+template <> R<Trait<1,1>::m> f<int>(A<int>) {return R<1>();}
diff --git a/gcc/testsuite/g++.dg/template/explicit5.C b/gcc/testsuite/g++.dg/template/explicit5.C
new file mode 100644
index 00000000000..a0e31335454
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/explicit5.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2003 <nathan@codesourcery.com>
+
+// Failed to spot specialization using a template-id expr
+
+template <typename n> class A {};
+template <int m> class R {};
+
+template <typename n, typename x> struct Trait { enum {m = sizeof (n)}; };
+
+template <typename n, typename x> R<Trait<n,x>::m> f(A<x>);
+template <> R<Trait<char,char>::m> f<char>(A<char>) {return R<1>();}
diff --git a/gcc/testsuite/g++.dg/template/friend15.C b/gcc/testsuite/g++.dg/template/friend15.C
new file mode 100644
index 00000000000..4acbf2d1a56
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend15.C
@@ -0,0 +1,19 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+// PR c++/9453
+// Access checking when template friend is defined in class.
+
+template <typename> class X {
+ private:
+ struct Inner;
+
+ template <typename R>
+ friend typename X<R>::Inner * foo () { return 0; }
+};
+template class X<void>;
+
+struct U {
+ void bar () { foo<void> (); }
+};
diff --git a/gcc/testsuite/g++.dg/template/friend20.C b/gcc/testsuite/g++.dg/template/friend20.C
new file mode 100644
index 00000000000..496d52f5e7f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend20.C
@@ -0,0 +1,15 @@
+template <class T>
+struct A
+{
+ friend void bar(A<T> a) {}
+};
+
+void bar(A<int>);
+
+int main()
+{
+ A<int> a;
+
+ bar(a);
+}
+
diff --git a/gcc/testsuite/g++.dg/template/friend21.C b/gcc/testsuite/g++.dg/template/friend21.C
new file mode 100644
index 00000000000..854ed67d592
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend21.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: ajl13@bellatlantic.net
+
+// PR c++/5421: ICE for specialization of member function template
+// as friend.
+
+struct B {
+ template <class T> void b();
+};
+
+template <class T> class A {
+ friend void B::b<T>();
+};
+
+static A<int> a;
diff --git a/gcc/testsuite/g++.dg/template/friend22.C b/gcc/testsuite/g++.dg/template/friend22.C
new file mode 100644
index 00000000000..41a73bbb4ae
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend22.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Origin: Benoit Hudson <bh@techhouse.brown.edu>
+
+// PR c++/641: Duplicate friend diagnostics
+
+template <class T> class iterator { };
+template <class T> class item {
+ friend class iterator<T>;
+ friend class iterator<const T>;
+};
+
+class A { };
+
+item<const A> i;
diff --git a/gcc/testsuite/g++.dg/template/friend23.C b/gcc/testsuite/g++.dg/template/friend23.C
new file mode 100644
index 00000000000..96f8125b68a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend23.C
@@ -0,0 +1,38 @@
+// { dg-do compile }
+
+// Origin: Alexandre Tolmos <ktulu@free.fr>
+
+// PR c++/11876: Friend of its own class diagnostics
+
+template <typename T>
+class A
+{
+ friend class A<int>;
+ friend class A<float>;
+protected:
+ T _data;
+ inline A() : _data(0) {}
+ template <typename U>
+ inline A(const A<U>& r) : _data(r._data) {}
+};
+
+class B : public A<int>
+{
+public:
+ inline B() {}
+ inline B(const B& r) : A<int>(r) {}
+};
+
+class C : public A<float>
+{
+public:
+ inline C() {}
+ inline C(const B& r) : A<float>(r) {}
+};
+
+int main(int, char*[])
+{
+ B b1, b2(b1);
+ C c(b1);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/template/friend24.C b/gcc/testsuite/g++.dg/template/friend24.C
new file mode 100644
index 00000000000..5db4d31e721
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend24.C
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+// PR c++/495: Fail to locate primary class template that is
+// injected by friend declaration.
+
+template <int N> struct X
+{
+ template <int dim> friend struct Y;
+};
+
+X<2> x;
+
+template <int dim> struct Y
+{
+ void f (Y);
+ void g (Y);
+};
+
+template <int dim> void Y<dim>::f (Y)
+{
+}
+
+template <int dim> void Y<dim>::g (Y<dim>)
+{
+}
diff --git a/gcc/testsuite/g++.dg/template/init3.C b/gcc/testsuite/g++.dg/template/init3.C
new file mode 100644
index 00000000000..9799a206d28
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/init3.C
@@ -0,0 +1,11 @@
+// PR c++/11027
+
+template <class T>
+struct X {
+ typedef void (X::*pfun)();
+ static pfun p[];
+};
+
+template <class T>
+typename X<T>::pfun X<T>::p[] = {};
+
diff --git a/gcc/testsuite/g++.dg/template/koenig1.C b/gcc/testsuite/g++.dg/template/koenig1.C
new file mode 100644
index 00000000000..850d3882824
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/koenig1.C
@@ -0,0 +1,8 @@
+namespace NS {
+ struct C {};
+ void foo(C);
+}
+
+template <class T> void bar() { T t; foo (t); }
+
+template void bar<NS::C> ();
diff --git a/gcc/testsuite/g++.dg/template/koenig2.C b/gcc/testsuite/g++.dg/template/koenig2.C
new file mode 100644
index 00000000000..be072a4a0ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/koenig2.C
@@ -0,0 +1,25 @@
+namespace nsp_foo {
+
+ struct A {};
+
+ struct foo {};
+
+}
+
+namespace nsp_bar {
+
+ void foo(nsp_foo::A) {}
+
+ template <class T>
+ void bar(T t)
+ {
+ nsp_bar::foo(t); // line 16
+ }
+
+}
+
+int main()
+{
+ nsp_bar::bar(nsp_foo::A());
+}
+
diff --git a/gcc/testsuite/g++.dg/template/lookup1.C b/gcc/testsuite/g++.dg/template/lookup1.C
new file mode 100644
index 00000000000..0df77bac1c3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup1.C
@@ -0,0 +1,17 @@
+template <class T0>
+class A {
+public:
+ class B;
+};
+
+template <class T0>
+class A<T0>::B {
+public:
+ class C;
+};
+
+template <class T0>
+class A<T0>::B::C {
+public:
+ A<T0> &a;
+};
diff --git a/gcc/testsuite/g++.dg/template/lookup2.C b/gcc/testsuite/g++.dg/template/lookup2.C
new file mode 100644
index 00000000000..493b807aec9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup2.C
@@ -0,0 +1,18 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Mar 2003 <nathan@codesourcery.com>
+
+// PR 11617: Failed to diagnose missing function.
+
+struct B {};
+
+template <typename T> void Bar ()
+{
+ T::foo (); // { dg-error "is not a member of" "" }
+}
+
+void Foo ()
+{
+ Bar<B> (); // { dg-error "instantiated" "" }
+}
diff --git a/gcc/testsuite/g++.dg/template/memclass1.C b/gcc/testsuite/g++.dg/template/memclass1.C
index d4ce9695d2a..c49ed724d6f 100644
--- a/gcc/testsuite/g++.dg/template/memclass1.C
+++ b/gcc/testsuite/g++.dg/template/memclass1.C
@@ -15,4 +15,4 @@ template <typename T> struct C
typedef typename A<T>::template B<U> X; // { dg-error "declared|invalid" }
};
-C<void> c; // { dg-error "instantiated" }
+C<void> c;
diff --git a/gcc/testsuite/g++.dg/template/memtmpl1.C b/gcc/testsuite/g++.dg/template/memtmpl1.C
new file mode 100644
index 00000000000..260dbf8dc09
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memtmpl1.C
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Jul 2003 <nathan@codesourcery.com>
+
+// PR 11347. ICE in tsubst
+
+template <class T> struct T1 {
+ enum {N};
+};
+
+template<class T> struct T2 {
+ template <class S, bool Z = T1<S>::N + 1> struct B {};
+ struct C {};
+};
+
+T2<int> t;
+
+T2<int>::B<int> s;
+
diff --git a/gcc/testsuite/g++.dg/template/memtmpl2.C b/gcc/testsuite/g++.dg/template/memtmpl2.C
new file mode 100644
index 00000000000..0c9dad647d2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memtmpl2.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Sep 2003 <nathan@codesourcery.com>
+
+// PR c++/12332. ICE
+
+template <unsigned D> class TPL;
+
+template <typename T> struct X {
+ template <template <typename> class V>
+ V<TPL<V<int>::d> > operator () ();
+};
+
+void Foo (X<int> x) {}
diff --git a/gcc/testsuite/g++.dg/template/nested4.C b/gcc/testsuite/g++.dg/template/nested4.C
new file mode 100644
index 00000000000..6e5b99b46c2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/nested4.C
@@ -0,0 +1,10 @@
+template <typename T> struct A {
+ template<typename S> struct B { typedef A<S> X; };
+
+};
+
+template<typename> void f() {
+ typedef A<int>::B<double>::X X;
+}
+
+template void f<int> ();
diff --git a/gcc/testsuite/g++.dg/template/non-dependent1.C b/gcc/testsuite/g++.dg/template/non-dependent1.C
new file mode 100644
index 00000000000..3fe5c33d782
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/non-dependent1.C
@@ -0,0 +1,21 @@
+//PR c++/8222
+// Origin: giovannibajo@libero.it and setzersn@gmx.de
+
+// { dg-do run }
+
+struct Foo
+{
+ template <class>
+ void func() {}
+};
+template <class>
+void Bar(Foo* p)
+{
+ p->func<int>();
+}
+
+int main()
+{
+ Foo c;
+ Bar<int>(&c);
+}
diff --git a/gcc/testsuite/g++.dg/template/non-dependent2.C b/gcc/testsuite/g++.dg/template/non-dependent2.C
new file mode 100644
index 00000000000..3b073b47a2b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/non-dependent2.C
@@ -0,0 +1,16 @@
+//PR c++/11070
+// Used to ICE
+// Origin: bangerth@dealii.org and rwgk@yahoo.com
+
+template <bool b> struct X {
+ template <typename T>
+ static int* execute(int* x) { return x; }
+};
+
+template <typename T> void foo() {
+ static bool const same = true;
+ X<same>::execute<int> (0);
+}
+
+template void foo<int> ();
+
diff --git a/gcc/testsuite/g++.dg/template/non-dependent3.C b/gcc/testsuite/g++.dg/template/non-dependent3.C
new file mode 100644
index 00000000000..ce18bf243db
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/non-dependent3.C
@@ -0,0 +1,15 @@
+//PR c++/11071
+// Used to ICE
+// Origin: bangerth@dealii.org and rwgk@yahoo.com
+
+template <bool b> struct X {
+ template <typename T>
+ static int* execute(T* x) { return x; }
+};
+
+template <typename T> void foo() {
+ static bool const same = true;
+ X<same>::execute ((int*)0);
+}
+
+template void foo<int> ();
diff --git a/gcc/testsuite/g++.dg/template/non-dependent4.C b/gcc/testsuite/g++.dg/template/non-dependent4.C
new file mode 100644
index 00000000000..637aabae409
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/non-dependent4.C
@@ -0,0 +1,4 @@
+int temp(char *temp);
+
+template <int> int g() { return temp("Hi"); }
+int g1() { return temp("Hi"); }
diff --git a/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C b/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C
new file mode 100644
index 00000000000..273017635c3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C
@@ -0,0 +1,12 @@
+struct A { static const bool b=false; };
+
+struct B { typedef A X; };
+
+template <bool> struct C {};
+
+template <typename T> struct D
+{
+ C<T::X> c; // { dg-error "names a type" }
+};
+
+D<B> d; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/template/nontype2.C b/gcc/testsuite/g++.dg/template/nontype2.C
new file mode 100644
index 00000000000..fe7e71537b8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/nontype2.C
@@ -0,0 +1,11 @@
+template <bool> struct A {};
+
+template <bool> struct B
+{
+ void foo()
+ {
+ const int i=0;
+ typedef A< i<=1 > C;
+ typedef A< i<=2 > C;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/operator1.C b/gcc/testsuite/g++.dg/template/operator1.C
new file mode 100644
index 00000000000..402e607d1e4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/operator1.C
@@ -0,0 +1,49 @@
+class test
+{
+public:
+ float operator[]( int index )
+ {
+ return testFloat[index];
+ }
+private:
+ float testFloat[3];
+};
+
+template < class typeA > float
+operator*(
+ typeA a,
+ float b
+)
+{
+ return a[0] * b;
+}
+
+template < class typeB > float
+operator*(
+ float a,
+ typeB b
+)
+{
+ return a * b[0];
+}
+
+template < class typeA, class typeB > float
+operator*(
+ typeA a,
+ typeB b
+)
+{
+ return a[0] * b[0];
+}
+
+int main( void )
+{
+ test aTest;
+ float bTest;
+ float result;
+
+ result = aTest * bTest;
+ result = bTest * aTest;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/template/overload1.C b/gcc/testsuite/g++.dg/template/overload1.C
index 404fc2dfed5..2225fecf730 100644
--- a/gcc/testsuite/g++.dg/template/overload1.C
+++ b/gcc/testsuite/g++.dg/template/overload1.C
@@ -1,3 +1,4 @@
+// { dg-options "-w" }
// PR c++/9420
// Bug: We were instantiating B<int> during overload resolution for E<0.
// This is wrong; the contents of B<int> are not relevant, since we can't
diff --git a/gcc/testsuite/g++.dg/template/overload2.C b/gcc/testsuite/g++.dg/template/overload2.C
new file mode 100644
index 00000000000..253d055cdf6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/overload2.C
@@ -0,0 +1,15 @@
+template <class T, int (T::*)> struct foo;
+
+template <class T>
+int f(foo<T,&T::ob_type>*);
+
+template <class T>
+char* f(...);
+
+struct X { int ob_type; };
+struct Y { char* ob_type; };
+ int x = f<X>(0);
+char* y = f<Y>(0);
+char* z = f<int>(0);
+
+int main() { return 0; }
diff --git a/gcc/testsuite/g++.dg/template/partial2.C b/gcc/testsuite/g++.dg/template/partial2.C
new file mode 100644
index 00000000000..ebfdce27889
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial2.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: lorgon1@yahoo.com
+
+// PR c++/11154: Multi-level template argument in partial ordering of
+// class template
+
+template <class A> struct Outer {
+ template <class T, class U = void, class V = void> struct Foo {};
+ template <class T, class U> struct Foo<T,U,void> {};
+ template <class T> struct Foo<T,void,void> {};
+};
+
+Outer<int>::Foo<int,void,void> f;
diff --git a/gcc/testsuite/g++.dg/template/ptrmem6.C b/gcc/testsuite/g++.dg/template/ptrmem6.C
new file mode 100644
index 00000000000..0d7dec21981
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ptrmem6.C
@@ -0,0 +1,10 @@
+struct S {};
+
+void g(int S::**);
+
+template <typename T>
+void f (int T::* volatile *p) {
+ g(p); // { dg-error "" }
+}
+
+template void f(int S::* volatile *); // { dg-error "instantiated" }
diff --git a/gcc/testsuite/g++.dg/template/qualified-id1.C b/gcc/testsuite/g++.dg/template/qualified-id1.C
new file mode 100644
index 00000000000..bbe23c2743b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/qualified-id1.C
@@ -0,0 +1,26 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 Sep 2003 <nathan@codesourcery.com>
+// Origin Volker Reichelt reichelt@igpm.rwth-aachen.de
+
+// PR 11922
+
+struct A
+{
+ template <bool> struct B;
+ struct C;
+};
+
+template <> struct A::B<false> {};
+
+template <typename T> void foo()
+{
+ T::C (); // { dg-error "names a type" "" }
+ T::template B<false>(); // { dg-error "names a type" "" }
+}
+
+void bar()
+{
+ foo<A>(); // { dg-error "instantiated" "" }
+}
diff --git a/gcc/testsuite/g++.dg/template/scope1.C b/gcc/testsuite/g++.dg/template/scope1.C
new file mode 100644
index 00000000000..b017b0bdb9b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/scope1.C
@@ -0,0 +1,12 @@
+// PR 8327
+
+template <class T>
+class X
+{
+ static const int a = 5;
+
+ static T b[a];
+};
+
+template <class T> T X<T>::b[X::a];
+
diff --git a/gcc/testsuite/g++.dg/template/scope2.C b/gcc/testsuite/g++.dg/template/scope2.C
new file mode 100644
index 00000000000..79b520cbeab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/scope2.C
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Aug 2003 <nathan@codesourcery.com>
+
+// checked instantiated bases in wrong scope.
+
+class Helper {};
+
+template<class T> struct X { };
+
+template<class T> class Base
+{
+ protected:
+ typedef Helper H;
+};
+
+template<class T >
+struct Derived : Base<T>
+{
+ typedef Base<T> Parent;
+ typedef typename Parent::H H;
+
+ class Nested : public X<H> {};
+
+ Nested m;
+
+ void Foo ();
+};
+
+void Foo (Derived<char> &x)
+{
+ x.Foo ();
+}
diff --git a/gcc/testsuite/g++.dg/template/sizeof5.C b/gcc/testsuite/g++.dg/template/sizeof5.C
new file mode 100644
index 00000000000..4096fed5329
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sizeof5.C
@@ -0,0 +1,15 @@
+// PR c++/9907
+// Origin: nes@lrde.epita.fr
+// sizeof(foo()) was not considered constant.
+
+
+template <unsigned n> struct bar {};
+
+int foo();
+
+template <class T>
+void baz()
+{
+ bar<sizeof(foo())> b;
+}
+
diff --git a/gcc/testsuite/g++.dg/template/ttp3.C b/gcc/testsuite/g++.dg/template/ttp3.C
index 05bd44a172e..cc3128cfc95 100644
--- a/gcc/testsuite/g++.dg/template/ttp3.C
+++ b/gcc/testsuite/g++.dg/template/ttp3.C
@@ -14,13 +14,13 @@ class OUTER {
template <class T>
class List { };
- vector<class List> data; // { dg-error "type/value mismatch|expected a type|ISO C" "" }
+ vector<class List> data; // { dg-error "invalid|required|ISO C" "" }
};
template <class T>
-class List { }; // { dg-bogus "previous declaration" "" { xfail *-*-* } }
+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-bogus "`struct List' redeclared|type/value mismatch" "" { xfail *-*-* } }
+vector<class List > data; // { dg-error "invalid|required|expected" "" }
diff --git a/gcc/testsuite/g++.dg/template/type2.C b/gcc/testsuite/g++.dg/template/type2.C
new file mode 100644
index 00000000000..509c4820d6b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/type2.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// Origin: Juan Carlos Arevalo-Baeza <jcab@JCABs-Rumblings.com>
+
+// PR c++/8442
+// Type template parameter incorrectly treated as template template
+// parameter.
+
+template <typename T> struct A {};
+
+template <typename T> struct B
+{
+ template <typename U> struct C {};
+ template <typename U> A<C<U> > foo(U);
+};
+
+B<void> b;
diff --git a/gcc/testsuite/g++.dg/template/using1.C b/gcc/testsuite/g++.dg/template/using1.C
new file mode 100644
index 00000000000..e4d4a004e32
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using1.C
@@ -0,0 +1,42 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
+
+// PR 9447. Using decls in template classes.
+
+template <class T>
+struct Foo {
+ int i;
+};
+
+struct Baz
+{
+ int j;
+};
+
+template <class T>
+struct Bar : public Foo<T>, Baz {
+ using Foo<T>::i;
+ using Baz::j;
+
+ int foo () { return i; }
+ int baz () { return j; }
+};
+
+int main()
+{
+ Bar<int> bar;
+
+ bar.i = 1;
+ bar.j = 2;
+
+ if (bar.foo() != 1)
+ return 1;
+
+ if (bar.baz() != 2)
+ return 1;
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/template/using2.C b/gcc/testsuite/g++.dg/template/using2.C
new file mode 100644
index 00000000000..87cdbc18657
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using2.C
@@ -0,0 +1,30 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
+
+// PR 9447. Using decls in template classes.
+
+template <class T>
+struct Foo {
+ int i; // { dg-error "" "" }
+};
+
+struct Baz
+{
+ int i; // { dg-error "" "" }
+};
+
+template <class T>
+struct Bar : public Foo<T>, Baz {
+ using Foo<T>::i;
+ using Baz::i;
+
+ int foo () { return i; } // { dg-error "request for member" "" }
+};
+
+void foo (Bar<int> &bar)
+{
+ bar.foo(); // { dg-error "instantiated" "" }
+}
+
diff --git a/gcc/testsuite/g++.dg/template/using3.C b/gcc/testsuite/g++.dg/template/using3.C
new file mode 100644
index 00000000000..11f2899c592
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using3.C
@@ -0,0 +1,42 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
+
+// PR 9447. Using decls in template classes.
+
+template <class T>
+struct Foo {
+ int i (int) {return 1;}
+};
+
+struct Baz
+{
+ int k (int) {return 2;}
+};
+
+template <class T>
+struct Bar : public Foo<T> , Baz {
+ using Foo<T>::i;
+ using Baz::k;
+
+ int i (float) {return 3;}
+ int k (float) {return 3;}
+
+ int foo()
+ {
+ if (i (1) != 1)
+ return 1;
+ if (k (1) != 2)
+ return 2;
+
+ return 0;
+ }
+};
+
+int main()
+{
+ Bar<int> bar;
+
+ return bar.foo();
+}
diff --git a/gcc/testsuite/g++.dg/template/using4.C b/gcc/testsuite/g++.dg/template/using4.C
new file mode 100644
index 00000000000..8c46da464a1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using4.C
@@ -0,0 +1,39 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
+
+// PR 9447. Using decls in template classes.
+
+template <class T>
+struct Foo {
+ int k (float) {return 1;}
+};
+
+struct Baz
+{
+ int k (int) {return 2;}
+};
+
+template <class T>
+struct Bar : public Foo<T> , Baz {
+ using Foo<T>::k;
+ using Baz::k;
+
+ int foo()
+ {
+ if (k (1.0f) != 1)
+ return 1;
+ if (k (1) != 2)
+ return 2;
+
+ return 0;
+ }
+};
+
+int main()
+{
+ Bar<int> bar;
+
+ return bar.foo();
+}
diff --git a/gcc/testsuite/g++.dg/template/using5.C b/gcc/testsuite/g++.dg/template/using5.C
new file mode 100644
index 00000000000..096ddc0b7cd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using5.C
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Jul 2003 <nathan@codesourcery.com>
+
+// PR 9447. further test cases for dependent using decl
+
+template <typename T> struct Base;
+
+template <typename T> struct Derived : public Base<T> {
+ using Base<T>::i;
+
+ Derived() { i; }
+
+ int get_i() { return i.f(); }
+
+};
diff --git a/gcc/testsuite/g++.dg/template/using6.C b/gcc/testsuite/g++.dg/template/using6.C
new file mode 100644
index 00000000000..ee8d5be96ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using6.C
@@ -0,0 +1,14 @@
+namespace foo {
+ template<typename T>
+ struct A {};
+}
+
+namespace bar {
+ template<typename T>
+ struct A {};
+}
+
+namespace foo {
+ using bar::A; // { dg-error "" }
+}
+
diff --git a/gcc/testsuite/g++.dg/template/using7.C b/gcc/testsuite/g++.dg/template/using7.C
new file mode 100644
index 00000000000..390dfbaace9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using7.C
@@ -0,0 +1,21 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Aug 2003 <nathan@codesourcery.com>
+
+// PR 9447. Using decls in reopened template classes.
+
+template <typename> struct A { int i; };
+
+template <typename T> struct B : public A<T>
+{
+ using A<T>::i;
+ int foo() const;
+};
+
+struct C {};
+
+template <typename T> int B<T>::foo() const
+{
+ return i;
+}
diff --git a/gcc/testsuite/g++.dg/template/warn1.C b/gcc/testsuite/g++.dg/template/warn1.C
new file mode 100644
index 00000000000..827c65e24c5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/warn1.C
@@ -0,0 +1,36 @@
+// { dg-do compile }
+// { dg-options "-Wall" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Aug 2003 <nathan@codesourcery.com>
+
+// PR 11512. erroneous warnings
+
+template <class T> void Foo(T i)
+{
+ i++, i++;
+ i, i++; // { dg-warning "left-hand operand" "" }
+ i++, i; // { dg-warning "right-hand operand" "" }
+ for (;; --i, ++i)
+ ;
+}
+
+void Bar ()
+{
+ Foo (1); // { dg-error "instantiated" "" }
+}
+
+struct M {};
+
+struct C
+{
+ M m;
+ C () :m (M ()) {}
+};
+
+
+void Baz (int i)
+{
+ i ? i + 1 : i + 2; // { dg-error "operand of" "" }
+ i ? i++ : 0;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Winline-1.C b/gcc/testsuite/g++.dg/warn/Winline-1.C
index 2f8b39cfb4d..f9ee4658315 100644
--- a/gcc/testsuite/g++.dg/warn/Winline-1.C
+++ b/gcc/testsuite/g++.dg/warn/Winline-1.C
@@ -1,4 +1,4 @@
-// { dg-options "-Winline -O2" }
+// { dg-options "-Winline -O2 -fno-unit-at-a-time" }
static inline int foo(int x); // { dg-warning "" }
diff --git a/gcc/testsuite/g++.dg/warn/Wsign-compare-1.C b/gcc/testsuite/g++.dg/warn/Wsign-compare-1.C
new file mode 100644
index 00000000000..495bb992cdd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wsign-compare-1.C
@@ -0,0 +1,6 @@
+// { dg-options "-Wsign-compare" }
+
+extern unsigned u;
+
+template<class F>
+int f() { return u > 1; }
diff --git a/gcc/testsuite/g++.dg/warn/Wunused-4.C b/gcc/testsuite/g++.dg/warn/Wunused-4.C
new file mode 100644
index 00000000000..9018e92ef94
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wunused-4.C
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-Wunused-parameter" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Sep 2003 <nathan@codesourcery.com>
+// Origin: yotamm@mellanox.co.il
+
+
+// PR c++/9848. Missing warning
+
+struct C1 {
+ // Only use in-charge ctor
+ C1(int bi) {} // { dg-warning "unused parameter" "" }
+};
+struct C2 {
+ // Only use base ctor
+ C2(int bi) {} // { dg-warning "unused parameter" "" }
+};
+
+struct D : C2
+{
+ D (int) : C2 (1) {}
+};
+
+void show_compile_warning ()
+{
+ C1 c1 (1);
+
+ D d (1);
+}
diff --git a/gcc/testsuite/g++.dg/warn/noeffect2.C b/gcc/testsuite/g++.dg/warn/noeffect2.C
new file mode 100644
index 00000000000..7bd2925f542
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/noeffect2.C
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-options "-Wall" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Aug 2003 <nathan@codesourcery.com>
+// Origin PR 11945 gerald@pfeifer.com
+
+// PR 11945 inconsistent warnings
+
+extern "C" void FormatDisk();
+ template <class T>
+ struct C {
+ C(){ FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" }
+ };
+ template <class T>
+ void f() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" }
+void g() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" }
+
diff --git a/gcc/testsuite/g++.dg/warn/noeffect4.C b/gcc/testsuite/g++.dg/warn/noeffect4.C
new file mode 100644
index 00000000000..a4c46dafbcc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/noeffect4.C
@@ -0,0 +1,88 @@
+// { dg-do compile }
+// { dg-options "-Wall" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Sep 2003 <nathan@codesourcery.com>
+
+// PR 12037.
+
+struct X
+{
+ int operator+(int);
+ int operator-(int);
+ int operator*(int);
+ int operator/(int);
+ int operator%(int);
+ int operator>>(int);
+ int operator<<(int);
+ int operator&(int);
+ int operator|(int);
+ int operator^(int);
+ int operator&&(int);
+ int operator||(int);
+ int operator==(int);
+ int operator!=(int);
+ int operator<(int);
+ int operator<=(int);
+ int operator>(int);
+ int operator>=(int);
+ int operator*();
+ int operator!();
+ int operator~();
+ int operator++();
+ int operator--();
+ int operator++(int);
+ int operator--(int);
+ int operator()();
+ int operator,(int);
+ X *operator->();
+ operator int () const;
+ int m;
+ virtual ~X ();
+ X &Foo ();
+};
+struct Y : X
+{
+};
+
+template<int I> void Foo (X &x)
+{
+ x + I;
+ x - I;
+ x * I;
+ x / I;
+ x % I;
+ x >> I;
+ x << I;
+ x & I;
+ x | I;
+ x && I;
+ x || I;
+ x == I;
+ x != I;
+ x < I;
+ x <= I;
+ x > I;
+ x >= I;
+ *x;
+ !x;
+ ~x;
+ x++;
+ x--;
+ ++x;
+ --x;
+ x ();
+ x, I;
+ x->m;
+ static_cast<int> (x);
+ dynamic_cast<Y &> (x);
+ reinterpret_cast<int> (x.Foo ());
+ const_cast<X &> (x.Foo ());
+
+ reinterpret_cast<int *> (&x);// { dg-warning "no effect" "" }
+ const_cast<X &> (x); // { dg-warning "no effect" "" }
+ sizeof (x++); // { dg-warning "no effect" "" }
+ __alignof__ (x++); // { dg-warning "no effect" "" }
+}
+
+
diff --git a/gcc/testsuite/g++.dg/warn/pedantic1.C b/gcc/testsuite/g++.dg/warn/pedantic1.C
new file mode 100644
index 00000000000..2a4d05536c5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pedantic1.C
@@ -0,0 +1,11 @@
+// PR10032
+// { dg-options "-pedantic" }
+
+int main() {
+ goto label; // { dg-error "" }
+
+ int temp = 1; // { dg-error "" }
+
+ label: // { dg-error "" }
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/warn/template-1.C b/gcc/testsuite/g++.dg/warn/template-1.C
new file mode 100644
index 00000000000..04ea5ae323b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/template-1.C
@@ -0,0 +1,15 @@
+//Origin: bangerth@dealii.org
+//PR c++/11490
+//Since N is know at instantiation time, there
+// should be no warning about comparision between
+// unsinged and signed interegers.
+
+// { dg-do compile }
+// { dg-options "-W" }
+
+template <int N> bool f() {
+ unsigned int i=0;
+ return i!=N; // { dg-bogus "signed and unsigned" }
+}
+
+template bool f<2> ();
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
index 2fc599f73b8..73b99659e12 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
@@ -195,7 +195,7 @@ struct Xthirteen {
if (local_value > value) // { dg-error "" } .*
return local_value;
else
- return value; // { dg-error "" } .*
+ return value;
}
};
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem06.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem06.C
index b56425e2179..3233e0e964d 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/tem06.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem06.C
@@ -14,6 +14,8 @@ public:
friend void x (const T &) { }
};
+void x(const int &);
+
template<class T>
void blah (const T &) {
T y;
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
index 8a7480e3326..7a77d6154d3 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
@@ -1,4 +1,4 @@
-// { dg-do run { xfail alpha*-dec-osf* *-*-hms i?86-pc-cygwin *-*-coff } }
+// { dg-do run { xfail alpha*-dec-osf* *-*-hms i?86-pc-cygwin *-*-coff hppa2*-hp-hpux11* } }
// Test that attributes weak and alias coexist.
extern "C" {
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
index c309dc8d62d..26d4d71cdf6 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
@@ -40,7 +40,7 @@ X::~X ()
printf ("__FUNCTION__ %s\n", function);
printf ("__PRETTY_FUNCTION__ %s\n", pretty);
- if (strcmp (function, "X"))
+ if (strcmp (function, "~X"))
bad = true;
if (strcmp (pretty, "X::~X()"))
bad = true;
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty3.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty3.C
index d8ae3c8218a..6348ae1ee67 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/pretty3.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty3.C
@@ -33,7 +33,7 @@ template<> void f1<int> (int)
printf ("__FUNCTION__ %s\n", function);
printf ("__PRETTY_FUNCTION__ %s\n", pretty);
- if (strcmp (function, "f1"))
+ if (strcmp (function, "f1<int>"))
bad = true;
if (strcmp (pretty, "void f1(T) [with T = int]"))
bad = true;
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/access17.C b/gcc/testsuite/g++.old-deja/g++.jason/access17.C
index f7a7acb8d08..ec8949d77df 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/access17.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/access17.C
@@ -13,7 +13,7 @@ struct B: public A {
};
int A::* B::p = &A::i; // { dg-error "" }
-int (A::* B::fp)() = &A::f; // ERROR -
+int (A::* B::fp)() = &A::f; // { dg-error "" }
struct C {
static int A::*p;
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload33.C b/gcc/testsuite/g++.old-deja/g++.jason/overload33.C
index 19b4a2edeb7..2cc34c6b209 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/overload33.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/overload33.C
@@ -58,10 +58,10 @@ class SmartPtr : public ConstSmartPtr<T>
: ConstSmartPtr<T>(theItem) {}
T* item() const
- { return _item(); }
+ { return this->_item(); }
operator T*() const
- { return _item(); }
+ { return this->_item(); }
};
/* ------------------------------------------------------------ */
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template36.C b/gcc/testsuite/g++.old-deja/g++.jason/template36.C
index a8a9d163c30..23cdb00e6de 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/template36.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/template36.C
@@ -33,7 +33,7 @@ public:
int base::* g ();
int zowee() const
- { return bar(); }
+ { return this->bar(); }
};
template <class T>
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
index 4ea561bf02d..025b0b1ef54 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
@@ -65,7 +65,7 @@ void Array<Type>::init(const Type *array, int sz)
// --------------- Array_RC.h && Array_RC.cc ----------------
template <class Type>
-class Array_RC : public Array<Type> {// { dg-error "" } previous declaration.*
+class Array_RC : public Array<Type> {
public:
Array_RC(const Type *ar, int sz);
Type& operator[](int ix);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
index 30c7e518c4e..bbecdd8d8a4 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
@@ -195,8 +195,8 @@ template<class T>
Pix
List_DLS<T>::search(const T& item) const
{
- for (Pix x=first(); 0 != x; next(x)) {
- if (item == operator()(x)) // { dg-error "" } const subversion
+ for (Pix x=this->first(); 0 != x; this->next(x)) {
+ if (item == this->operator()(x)) // { dg-error "" } const subversion
return x;
}
return 0;
@@ -223,8 +223,8 @@ template<class T>
bool
List_DLSp<T>::contains(const T& item) const
{
- for (Pix x=first(); 0 != x; next(x)) {
- if (*item == *operator()(x))
+ for (Pix x=this->first(); 0 != x; this->next(x)) {
+ if (*item == *(this->operator()(x)))
return TRUE;
}
return FALSE;
diff --git a/gcc/testsuite/g++.old-deja/g++.niklas/t135.C b/gcc/testsuite/g++.old-deja/g++.niklas/t135.C
index 5e826f13248..566b0ca1ba3 100644
--- a/gcc/testsuite/g++.old-deja/g++.niklas/t135.C
+++ b/gcc/testsuite/g++.old-deja/g++.niklas/t135.C
@@ -1,7 +1,7 @@
-// { dg-do assemble }
+// { dg-do compile }
// GROUPS niklas pt friend
template <class T> class C1
-{ // { dg-error "" }
+{
public:
void diddle_C2 ();
};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash18.C b/gcc/testsuite/g++.old-deja/g++.other/crash18.C
deleted file mode 100644
index 2b6f1662157..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.other/crash18.C
+++ /dev/null
@@ -1,14 +0,0 @@
-// { dg-do assemble }
-// { dg-options "-fvtable-gc -S" }
-// Origin: Mark Mitchell <mitchell@codesourcery.com>
-
-struct S {
- virtual void f ();
-};
-
-S* s;
-
-void g ()
-{
- s->f ();
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl5.C b/gcc/testsuite/g++.old-deja/g++.other/decl5.C
index d761cbebaea..4aa1647548a 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/decl5.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl5.C
@@ -11,7 +11,7 @@ struct A {
int A::fn(); // { dg-warning "" } extra qualification
int A::m; // { dg-warning "" } extra qualification
struct e;
- struct A::e {int i;};
+ struct A::e {int i;}; // { dg-warning "" } extra qualification
struct A::expand { // { dg-warning "" } extra qualification
int m;
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash36.C b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
index 055df04a95f..146c0b13783 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
@@ -14,7 +14,7 @@ struct iterator {
template <class Iterator>
struct reverse_iterator : public
-iterator<typename iterator_traits<Iterator>::iterator_category> {
+iterator<typename iterator_traits<Iterator>::iterator_category> { // { dg-error "" } no type iterator_category
protected:
Iterator current;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C b/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
index 4748e3d20c7..f60fffa99a6 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
@@ -3,6 +3,9 @@
// Default arguments containing more than one non-nested explicit
// template argument leads to parse error
+// This might be ill formed. See DR 325 (which would like to make it
+// so)
+
template <class T> class foo1;
template <class T, class U> class foo2;
@@ -10,5 +13,5 @@ struct bar {
template <class T, class U>
bar(int i = foo1<T>::baz, // { dg-bogus "" "" { xfail *-*-* } } -
int j = int(foo2<T, U>::baz), // ok
- int k = foo2<T, U>::baz) {} // { dg-bogus "" "" { xfail *-*-* } } - before > -
+ int k = foo2<T, U>::baz) {} // this is the problematic one.
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/derived3.C b/gcc/testsuite/g++.old-deja/g++.pt/derived3.C
index 24d2c0d720a..806e0f5c99c 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/derived3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/derived3.C
@@ -1,14 +1,16 @@
-// { dg-do assemble }
+// { dg-do compile }
// by Paul Burchard <burchard@pobox.com>, Level Set Systems, Inc.
// Copyright (C) 1999, 2002 Free Software Foundation
template<class T>
class X {
- class Y : public T {};
- Y y; // { dg-error "" } invalid base type
+ class Y : public T
+ { // { dg-error "base type .* fails to be" "" }
+ };
+ Y y; // { dg-error "instantiated" "" }
};
int main() {
- X<int> x; // { dg-error "" } instantiated
+ X<int> x; // { dg-error "instantiated" "" }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lookup2.C b/gcc/testsuite/g++.old-deja/g++.pt/lookup2.C
index 73c2bbbf623..3d9f0605a18 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/lookup2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/lookup2.C
@@ -1,5 +1,5 @@
// { dg-do assemble }
-// { dg-options "" }
+// { dg-options "-fpermissive" }
class A
{
@@ -15,6 +15,6 @@ protected:
template <class T> class D : private B<T>
{
public:
- void f2() { f1(); };
+ void f2() { f1(); }; // { dg-warning "" }
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload8.C b/gcc/testsuite/g++.old-deja/g++.pt/overload8.C
index 4f0a1d0ad08..5c2d8bc026e 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/overload8.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/overload8.C
@@ -7,6 +7,6 @@ struct baz;
void operator*(baz&, double);
template <class T> inline T operator*(double s, const T &p)
- ; // { dg-bogus "" "" { xfail *-*-* } } - must have argument of class type -
+ ; // { dg-bogus "" "" } - must have argument of class type -
void m(baz& a) { a * .5; }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp20.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp20.C
index c9f7912de41..c54119efda2 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ttp20.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp20.C
@@ -18,7 +18,7 @@ template<template<class> class D,class E> class C : D<E>
template<template<class> class D,class E> int C<D,E>::g()
{
- return f();
+ return this->f();
}
int main()
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C
index c1a4fd0cf36..f0b41bf3f56 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C
@@ -18,13 +18,13 @@ template<template<class> class D,class E> class C : D<E>
template<template<class> class D,class E> int C<D,E>::g()
{
- return f();
+ return this->f();
}
class E : C<D,int>
{
public:
- int h() { return g(); }
+ int h() { return this->g(); }
};
int main()
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
index 18a3322721f..b260961e813 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
@@ -1,4 +1,4 @@
-// { dg-do run }
+// { dg-do compile }
template<template<class> class D,class E> class C
{
public:
@@ -13,8 +13,8 @@ template<class T> class D
template<class T> int D<T>::f()
{
- C<D,D> c;
- return c.g();
+ C<D,D> c; // { dg-error "" }
+ return c.g(); // { dg-error "" }
}
int main()
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp43.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp43.C
index d18a4ebe6f7..e1bc4cee652 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ttp43.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp43.C
@@ -20,11 +20,11 @@ struct Lit {
template < class T >
struct Id {
- Add < T, Id, Lit > operator+(const T& t) const {
- return Add < T, Id, Lit >(*this, Lit<T>(t));
+ Add < T, ::Id, Lit > operator+(const T& t) const {
+ return Add < T, ::Id, Lit >(*this, Lit<T>(t));
}
- Mul < T, Id, Lit > operator*(const T& t) const {
- return Mul < T, Id, Lit >(*this, Lit<T>(t));
+ Mul < T, ::Id, Lit > operator*(const T& t) const {
+ return Mul < T, ::Id, Lit >(*this, Lit<T>(t));
}
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp44.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp44.C
index f977fcb415d..08eb3077f02 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ttp44.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp44.C
@@ -9,8 +9,8 @@ public:
template < class T >
struct Id {
template < template < class > class E >
- Add < T, Id, E > operator+(const E<T>& e) const {
- return Add < T, Id, E >(*this, e);
+ Add < T, ::Id, E > operator+(const E<T>& e) const {
+ return Add < T, ::Id, E >(*this, e);
}
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename13.C b/gcc/testsuite/g++.old-deja/g++.pt/typename13.C
index b0d4b47f3b1..385834b959d 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/typename13.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/typename13.C
@@ -1,5 +1,5 @@
// { dg-do assemble }
-// { dg-options "" }
+// { dg-options "-fpermissive" }
template <class T>
struct B
@@ -18,7 +18,7 @@ struct D : public B<T>
template <class T>
void D<T>::f()
{
- I();
+ I(); // { dg-warning "" }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/union2.C b/gcc/testsuite/g++.old-deja/g++.pt/union2.C
index 9eb4a87d068..fdb038f20b0 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/union2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/union2.C
@@ -12,7 +12,7 @@ protected:
};
template<class T> struct vector : public vector_base<T> {
- vector () { def_basep (); }
+ vector () { this->def_basep (); }
};
vector<int> iv;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C
index b6002248d55..419a36efd4b 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C
@@ -3,15 +3,13 @@
// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
// Reported against EGCS snaps 98/06/28.
-// { dg-error "forward declaration" "" { target *-*-* } 0 }
-
using namespace std;
int main()
{
try {
}
- catch (bad_alloc) { // { dg-error "invalid use" }
+ catch (bad_alloc) { // { dg-error "" }
return 1;
}
return 0;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C
index f9265851d11..eb6c72d20a6 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C
@@ -3,8 +3,6 @@
// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
// Reported against EGCS snaps 98/06/28.
-// { dg-error "forward declaration" "" { target *-*-* } 0 }
-
int main()
{
try {
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C
index 82605146a19..9885031004b 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C
@@ -3,15 +3,13 @@
// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
// Reported against EGCS snaps 98/06/28.
-// { dg-error "forward declaration" "" { target *-*-* } 0 }
-
using namespace std;
int main()
{
try {
}
- catch (bad_alloc) { // { dg-error "invalid use" }
+ catch (bad_alloc) { // { dg-error "" }
return 1;
}
return 0;
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.f-torture/compile/12002.f b/gcc/testsuite/g77.f-torture/compile/12002.f
new file mode 100644
index 00000000000..cd661459f93
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/compile/12002.f
@@ -0,0 +1,5 @@
+C PR middle-end/12002
+ COMPLEX TE1
+ TE1=-2.
+ TE1=TE1+TE1
+ END
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030707-1.c b/gcc/testsuite/gcc.c-torture/compile/20030707-1.c
new file mode 100644
index 00000000000..8ce964512bf
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030707-1.c
@@ -0,0 +1,13 @@
+/* PR c/11449. */
+
+/* sign_bit_p() in fold-const.c failed to notice that (int) 0x80000000
+ was the sign bit of m. As a result, fold_single_bit_test()
+ returned ((unsigned int) m >> 31), and that was eventually passed
+ to invert_truthvalue(), which did not know how to handle
+ RROTATE_EXPR, causing an ICE. */
+
+int
+foo (int m)
+{
+ return !(m & ((int) 0x80000000));
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030708-1.c b/gcc/testsuite/gcc.c-torture/compile/20030708-1.c
new file mode 100644
index 00000000000..5a693d8f75c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030708-1.c
@@ -0,0 +1,13 @@
+/* PR 10795. */
+
+/* ix86_expand_carry_flag_compare() in i386.c swapped the comparison
+ operands without checking that the compare instruction, cmpl, would
+ accept the swapped operands. */
+
+extern const char a[];
+
+int
+foo (const char *p)
+{
+ return (p > a) ? 0 : 2;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030725-1.c b/gcc/testsuite/gcc.c-torture/compile/20030725-1.c
new file mode 100644
index 00000000000..26f2714010e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030725-1.c
@@ -0,0 +1,9 @@
+/* This testcase caused ICE on any 64-bit arch at -O2/-O3 due to
+ fold/extract_muldiv/convert destroying its argument. */
+int x, *y, z, *p;
+
+void
+foo (void)
+{
+ p = y + (8 * (x == 1 || x == 3) + z);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030804-1.c b/gcc/testsuite/gcc.c-torture/compile/20030804-1.c
new file mode 100644
index 00000000000..189fde3cee5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030804-1.c
@@ -0,0 +1,9 @@
+/* Extracted from PR middle-end/11771. */
+/* The following testcase used to ICE without -ffast-math from unbounded
+ recursion in fold. This was due to the logic in negate_expr_p not
+ matching that in negate_expr. */
+
+double f(double x) {
+ return -(1 - x) + (x ? -(1 - x) : 0);
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030821-1.c b/gcc/testsuite/gcc.c-torture/compile/20030821-1.c
new file mode 100644
index 00000000000..34700ae181f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030821-1.c
@@ -0,0 +1,24 @@
+/* PR target/11805. */
+
+/* Consider the following sequence.
+
+ (set (cc0)
+ (and:HI (reg:HI 0)
+ (const_int 1)))
+
+ (set (pc)
+ (if_then_else (le (cc0)
+ (const_int 0))
+ (label_ref 17)
+ (pc)))
+
+ On h8300, the first insn does not set the overflow flag, but the
+ second requires the overflow flag. As a result, when the final
+ wants to output the jump insn, it cannot find a test insn that
+ gives appropriate condition flags. */
+
+unsigned char
+foo (unsigned char a)
+{
+ return (a & 1) > 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030903-1.c b/gcc/testsuite/gcc.c-torture/compile/20030903-1.c
new file mode 100644
index 00000000000..fa4d30db6c0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030903-1.c
@@ -0,0 +1,33 @@
+/* Derived from PR optimization/11700. */
+/* The compiler used to ICE during reload for m68k targets. */
+
+void check_complex (__complex__ double, __complex__ double,
+ __complex__ double, __complex__ int);
+void check_float (double, double, double, int);
+extern double _Complex conj (double _Complex);
+extern double carg (double _Complex __z);
+
+static double minus_zero;
+
+void
+conj_test (void)
+{
+ check_complex (conj (({ __complex__ double __retval;
+ __real__ __retval = (0.0);
+ __imag__ __retval = (0.0);
+ __retval; })),
+ ({ __complex__ double __retval;
+ __real__ __retval = (0.0);
+ __imag__ __retval = (minus_zero);
+ __retval; }), 0, 0);
+}
+
+void
+carg_test (void)
+{
+ check_float (carg (({ __complex__ double __retval;
+ __real__ __retval = (2.0);
+ __imag__ __retval = (0);
+ __retval; })), 0, 0, 0);
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030904-1.c b/gcc/testsuite/gcc.c-torture/compile/20030904-1.c
new file mode 100644
index 00000000000..09fd015b115
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030904-1.c
@@ -0,0 +1,94 @@
+struct A
+{
+ long a1;
+ double *a2;
+};
+
+struct B
+{
+ void *b1;
+ double b2, b3;
+ struct
+ {
+ int d1;
+ double d2;
+ } b4;
+};
+
+struct C
+{
+ struct A *c1;
+ void *c2;
+};
+
+long fn1 (struct A *, double);
+void fn2 (void *, const char *);
+double fn3 (double);
+double fn4 (double);
+int fn5 (void *, double, double);
+
+int
+foo (struct B *x)
+{
+ struct C *e = x->b1;
+ struct A *f = e->c1;
+ long g, h, i;
+ double *j, k;
+ g = fn1 (f, 0.5 * (x->b2 + x->b3)), h = g + 1, i = f->a1;
+ j = f->a2, k = x->b4.d2;
+ fn2 (x, "something");
+ if (g <= 0)
+ {
+ double l = j[2] - j[1];
+ if (l > 0.0 && l <= 0.02)
+ k = (x->b4.d1 == 1
+ ? ((1.0 / l) < 25 ? 25 : (1.0 / l))
+ : fn3 ((1.0 / l) < 25 ? 25 : (1.0 / l)));
+ }
+ else
+ {
+ double m = j[h] - j[g], n = 0.0, l = 0.0;
+ if (g > 1)
+ n = j[g] - j[g - 1];
+ if (h < i)
+ l = j[h + 1] - j[h];
+ if (n > 0.02)
+ n = 0;
+ if (m > 0.02)
+ m = 0;
+ if (l > 0.02)
+ l = 0;
+ if (m < n)
+ {
+ double o = m;
+ m = n;
+ n = o;
+ }
+ if (l < n)
+ {
+ double o = l;
+ l = n;
+ n = o;
+ }
+ if (l < m)
+ {
+ double o = l;
+ l = m;
+ m = o;
+ }
+ if (n != 0.0)
+ k = (x->b4.d1 == 1
+ ? ((1 / m) < 25 ? 25 : (1 / m))
+ : fn3 ((1 / m) < 25 ? 25 : (1 / m)));
+ else if (m != 0.0)
+ k = (x->b4.d1 == 1
+ ? ((2 / (m + l)) < 25 ? 25 : (2 / (m + l)))
+ : fn3 ((2 / (m + l)) < 25 ? 25 : (2 / (m + l))));
+ else if (l != 0.0)
+ k = (x->b4.d1 == 1
+ ? ((1 / l) < 25 ? 25 : (1 / l))
+ : fn3 ((1 / l) < 25 ? 25 : (1 / l)));
+ }
+ fn5 (e->c2, 0.5 * (x->b2 + x->b3), (x->b4.d1 == 1 ? k : fn4 (k)));
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030907-1.c b/gcc/testsuite/gcc.c-torture/compile/20030907-1.c
new file mode 100644
index 00000000000..e362b910284
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030907-1.c
@@ -0,0 +1,25 @@
+/* PR 11665
+ Orgin: jwhite@cse.unl.edu
+ The problem was in initializer_constant_valid_p,
+ "for a CONSTRUCTOR, only the last element
+ of the CONSTRUCTOR was being checked"
+ (from the email of the patch which fixed this).
+ This used to ICE because GCC thought gdt_table was a
+ constant value when it is not. */
+
+int x;
+struct gdt
+{
+unsigned a,b,c,d,e,f;
+};
+void f()
+{
+struct gdt gdt_table[2]=
+{
+ {
+ 0,
+ ( (((unsigned)(&x))<<(24))&(-1<<(8)) ),
+ },
+};
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030921-1.c b/gcc/testsuite/gcc.c-torture/compile/20030921-1.c
new file mode 100644
index 00000000000..8199dc657f2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030921-1.c
@@ -0,0 +1,10 @@
+/* PR 12281 The darwin back-end was causing the function
+ f is not being emitted. TREE_SYMBOL_REFERENCED was being set
+ instead of calling mark_referenced. */
+
+
+static void f(void);
+void g(void (*x) (void)){x();}
+static inline void f(void){}
+void h(){g(f);}
+int main(){h();return 0;}
diff --git a/gcc/testsuite/gcc.c-torture/compile/mangle-1.c b/gcc/testsuite/gcc.c-torture/compile/mangle-1.c
new file mode 100644
index 00000000000..7abc934e75c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/mangle-1.c
@@ -0,0 +1,9 @@
+int foo(void)
+{
+ static int x asm ("x") = 3;
+ return x++;
+}
+
+int X2 asm ("x.0") = 4;
+int X3 asm ("_x.0") = 5;
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c
index 478b423e2d7..911aec2b40c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c
@@ -1,4 +1,4 @@
-/* { dg-do assemble {target *mips*-*-* } } */
+/* { dg-do compile { target mips*-*-* } } */
register unsigned int cp0count asm ("$c0r1");
diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c
index 0ba5610b623..1f911829325 100644
--- a/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c
@@ -1,4 +1,4 @@
-/* { dg-do assemble {target *mips*-*-* } } */
+/* { dg-do compile { target mips*-*-* } } */
register unsigned int c3r1 asm ("$c3r1");
diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c
index 3a4250cc358..014f33541dc 100644
--- a/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c
+++ b/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c
@@ -1,4 +1,4 @@
-/* { dg-do assemble {target *mips*-*-* } } */
+/* { dg-do compile { target mips*-*-* } } */
register unsigned int c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2");
diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c
index a30146224c1..da249daa6ae 100644
--- a/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c
+++ b/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c
@@ -1,4 +1,4 @@
-/* { dg-do assemble {target *mips*-*-* } } */
+/* { dg-do compile { target mips*-*-* } } */
register unsigned long c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2");
diff --git a/gcc/testsuite/gcc.c-torture/compile/zero-strct-2.c b/gcc/testsuite/gcc.c-torture/compile/zero-strct-2.c
new file mode 100644
index 00000000000..0f97f7d12b2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/zero-strct-2.c
@@ -0,0 +1,2 @@
+struct { } foo = { };
+void * bar(void) { return &foo; }
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030714-1.c b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
new file mode 100644
index 00000000000..719baede26f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
@@ -0,0 +1,193 @@
+/* derived from PR optimization/11440 */
+
+extern void abort (void);
+extern void exit (int);
+
+typedef _Bool bool;
+const bool false = 0;
+const bool true = 1;
+
+enum EPosition
+{
+ STATIC, RELATIVE, ABSOLUTE, FIXED
+};
+typedef enum EPosition EPosition;
+
+enum EFloat
+{
+ FNONE = 0, FLEFT, FRIGHT
+};
+typedef enum EFloat EFloat;
+
+struct RenderBox
+{
+ int unused[6];
+ short m_verticalPosition;
+
+ bool m_layouted : 1;
+ bool m_unused : 1;
+ bool m_minMaxKnown : 1;
+ bool m_floating : 1;
+
+ bool m_positioned : 1;
+ bool m_overhangingContents : 1;
+ bool m_relPositioned : 1;
+ bool m_paintSpecial : 1;
+
+ bool m_isAnonymous : 1;
+ bool m_recalcMinMax : 1;
+ bool m_isText : 1;
+ bool m_inline : 1;
+
+ bool m_replaced : 1;
+ bool m_mouseInside : 1;
+ bool m_hasFirstLine : 1;
+ bool m_isSelectionBorder : 1;
+
+ bool (*isTableCell) (struct RenderBox *this);
+};
+
+typedef struct RenderBox RenderBox;
+
+struct RenderStyle
+{
+ struct NonInheritedFlags
+ {
+ union
+ {
+ struct
+ {
+ unsigned int _display : 4;
+ unsigned int _bg_repeat : 2;
+ bool _bg_attachment : 1;
+ unsigned int _overflow : 4 ;
+ unsigned int _vertical_align : 4;
+ unsigned int _clear : 2;
+ EPosition _position : 2;
+ EFloat _floating : 2;
+ unsigned int _table_layout : 1;
+ bool _flowAroundFloats :1;
+
+ unsigned int _styleType : 3;
+ bool _hasHover : 1;
+ bool _hasActive : 1;
+ bool _clipSpecified : 1;
+ unsigned int _unicodeBidi : 2;
+ int _unused : 1;
+ } f;
+ int _niflags;
+ };
+ } noninherited_flags;
+};
+
+typedef struct RenderStyle RenderStyle;
+
+extern void RenderObject_setStyle(RenderBox *this, RenderStyle *_style);
+extern void removeFromSpecialObjects(RenderBox *this);
+
+
+
+void RenderBox_setStyle(RenderBox *thisin, RenderStyle *_style)
+{
+ RenderBox *this = thisin;
+ bool oldpos, tmp;
+ EPosition tmppo;
+
+ tmp = this->m_positioned;
+
+ oldpos = tmp;
+
+ RenderObject_setStyle(this, _style);
+
+ tmppo = _style->noninherited_flags.f._position;
+
+ switch(tmppo)
+ {
+ case ABSOLUTE:
+ case FIXED:
+ {
+ bool ltrue = true;
+ this->m_positioned = ltrue;
+ break;
+ }
+
+ default:
+ {
+ EFloat tmpf;
+ EPosition tmpp;
+ if (oldpos)
+ {
+ bool ltrue = true;
+ this->m_positioned = ltrue;
+ removeFromSpecialObjects(this);
+ }
+ {
+ bool lfalse = false;
+ this->m_positioned = lfalse;
+ }
+
+ tmpf = _style->noninherited_flags.f._floating;
+
+ if(!this->isTableCell (this) && !(tmpf == FNONE))
+ {
+ bool ltrue = true;
+ this->m_floating = ltrue;
+ }
+ else
+ {
+ tmpp = _style->noninherited_flags.f._position;
+ if (tmpp == RELATIVE)
+ {
+ bool ltrue = true;
+ this->m_relPositioned = ltrue;
+ }
+ }
+ }
+ }
+}
+
+
+
+
+RenderBox g_this;
+RenderStyle g__style;
+
+void RenderObject_setStyle(RenderBox *this, RenderStyle *_style)
+{
+ (void) this;
+ (void) _style;
+}
+
+void removeFromSpecialObjects(RenderBox *this)
+{
+ (void) this;
+}
+
+bool RenderBox_isTableCell (RenderBox *this)
+{
+ (void) this;
+ return false;
+}
+
+int main (void)
+{
+
+ g_this.m_relPositioned = false;
+ g_this.m_positioned = false;
+ g_this.m_floating = false;
+ g_this.isTableCell = RenderBox_isTableCell;
+
+ g__style.noninherited_flags.f._position = FIXED;
+ g__style.noninherited_flags.f._floating = FNONE;
+
+ RenderBox_setStyle (&g_this, &g__style);
+
+ if (g_this.m_positioned != true)
+ abort ();
+ if (g_this.m_relPositioned != false)
+ abort ();
+ if (g_this.m_floating != false)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030715-1.c b/gcc/testsuite/gcc.c-torture/execute/20030715-1.c
new file mode 100644
index 00000000000..a2a28ce962c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030715-1.c
@@ -0,0 +1,35 @@
+/* PR optimization/11320 */
+/* Origin: Andreas Schwab <schwab@suse.de> */
+
+/* Verify that the scheduler correctly computes the dependencies
+ in the presence of conditional instructions. */
+
+int strcmp (const char *, const char *);
+int ap_standalone;
+
+const char *ap_check_cmd_context (void *a, int b)
+{
+ return 0;
+}
+
+const char *server_type (void *a, void *b, char *arg)
+{
+ const char *err = ap_check_cmd_context (a, 0x01|0x02|0x04|0x08|0x10);
+ if (err)
+ return err;
+
+ if (!strcmp (arg, "inetd"))
+ ap_standalone = 0;
+ else if (!strcmp (arg, "standalone"))
+ ap_standalone = 1;
+ else
+ return "ServerType must be either 'inetd' or 'standalone'";
+
+ return 0;
+}
+
+int main ()
+{
+ server_type (0, 0, "standalone");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030717-1.c b/gcc/testsuite/gcc.c-torture/execute/20030717-1.c
new file mode 100644
index 00000000000..7e43e44be04
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030717-1.c
@@ -0,0 +1,69 @@
+/* PR target/11087
+ This testcase was miscompiled on ppc64, because basic_induction_var called
+ convert_modes, yet did not expect it to emit any new instructions.
+ Those were emitted at the end of the function and destroyed during life
+ analysis, while the program used uninitialized pseudos created by
+ convert_modes. */
+
+struct A
+{
+ unsigned short a1;
+ unsigned long a2;
+};
+
+struct B
+{
+ int b1, b2, b3, b4, b5;
+};
+
+struct C
+{
+ struct B c1[1];
+ int c2, c3;
+};
+
+static
+int foo (int x)
+{
+ return x < 0 ? -x : x;
+}
+
+int bar (struct C *x, struct A *y)
+{
+ int a = x->c3;
+ const int b = y->a1 >> 9;
+ const unsigned long c = y->a2;
+ int d = a;
+ unsigned long e, f;
+
+ f = foo (c - x->c1[d].b4);
+ do
+ {
+ if (d <= 0)
+ d = x->c2;
+ d--;
+
+ e = foo (c-x->c1[d].b4);
+ if (e < f)
+ a = d;
+ }
+ while (d != x->c3);
+ x->c1[a].b4 = c + b;
+ return a;
+}
+
+int
+main ()
+{
+ struct A a;
+ struct C b;
+ int c;
+
+ a.a1 = 512;
+ a.a2 = 4242;
+ __builtin_memset (&b, 0, sizeof (b));
+ b.c1[0].b3 = 424242;
+ b.c2 = 1;
+ c = bar (&b, &a);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030718-1.c b/gcc/testsuite/gcc.c-torture/execute/20030718-1.c
new file mode 100644
index 00000000000..2a113f95e19
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030718-1.c
@@ -0,0 +1,13 @@
+/* PR c/10320
+ The function temp was not being emitted in a prerelease of 3.4 20030406.
+ Contributed by pinskia@physics.uc.edu */
+
+static inline void temp();
+int main()
+{
+ temp();
+ return 0;
+}
+static void temp(){}
+
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030811-1.c b/gcc/testsuite/gcc.c-torture/execute/20030811-1.c
new file mode 100644
index 00000000000..2ac59c03af2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030811-1.c
@@ -0,0 +1,35 @@
+/* Origin: PR target/11535 from H. J. Lu <hjl@lucon.org> */
+
+void vararg (int i, ...)
+{
+ (void) i;
+}
+
+int i0[0], i1;
+
+void test1 (void)
+{
+ int a = (int) (long long) __builtin_return_address (0);
+ vararg (0, a);
+}
+
+void test2 (void)
+{
+ i0[0] = (int) (long long) __builtin_return_address (0);
+}
+
+void test3 (void)
+{
+ i1 = (int) (long long) __builtin_return_address (0);
+}
+
+void test4 (void)
+{
+ volatile long long a = (long long) __builtin_return_address (0);
+ i0[0] = (int) a;
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030821-1.c b/gcc/testsuite/gcc.c-torture/execute/20030821-1.c
new file mode 100644
index 00000000000..b82c2f2d75b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030821-1.c
@@ -0,0 +1,16 @@
+extern void abort (void);
+
+int
+foo (int x)
+{
+ if ((int) (x & 0x80ffffff) != (int) (0x8000fffe))
+ abort ();
+
+ return 0;
+}
+
+int
+main ()
+{
+ return foo (0x8000fffe);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030914-1.c b/gcc/testsuite/gcc.c-torture/execute/20030914-1.c
new file mode 100644
index 00000000000..ab1c1541df0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030914-1.c
@@ -0,0 +1,26 @@
+/* On IRIX 6, PB is passed partially in registers and partially on the
+ stack, with an odd number of words in the register part. Check that
+ the long double stack argument (PC) is still accessed properly. */
+
+struct s { int val[16]; };
+
+long double f (int pa, struct s pb, long double pc)
+{
+ int i;
+
+ for (i = 0; i < 16; i++)
+ pc += pb.val[i];
+ return pc;
+}
+
+int main ()
+{
+ struct s x;
+ int i;
+
+ for (i = 0; i < 16; i++)
+ x.val[i] = i + 1;
+ if (f (1, x, 10000.0L) != 10136.0L)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030914-2.c b/gcc/testsuite/gcc.c-torture/execute/20030914-2.c
new file mode 100644
index 00000000000..38a81982ff2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030914-2.c
@@ -0,0 +1,21 @@
+/* On IRIX 6, PA is passed partially in registers and partially on the
+ stack. We therefore have two potential uses of pretend_args_size:
+ one for the partial argument and one for the varargs save area.
+ Make sure that these uses don't conflict. */
+
+struct s { int i[18]; };
+
+int f (struct s pa, int pb, ...)
+{
+ return pb;
+}
+
+struct s gs;
+
+int main ()
+{
+ if (f (gs, 0x1234) != 0x1234)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030920-1.c b/gcc/testsuite/gcc.c-torture/execute/20030920-1.c
new file mode 100644
index 00000000000..2d22115c9fd
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030920-1.c
@@ -0,0 +1,15 @@
+extern void abort (void);
+
+int main()
+{
+ int hicount = 0;
+ unsigned char *c;
+ char *str = "\x7f\xff";
+ for (c = (unsigned char *)str; *c ; c++) {
+ if (!(((unsigned int)(*c)) < 0x80)) hicount++;
+ }
+ if (hicount != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c
new file mode 100644
index 00000000000..2cced80f5d7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/strcat.c
@@ -0,0 +1,19 @@
+extern int inside_main;
+extern void abort(void);
+
+char *
+strcat (char *dst, const char *src)
+{
+ char *p = dst;
+
+#ifdef __OPTIMIZE__
+ if (inside_main)
+ abort ();
+#endif
+
+ while (*p)
+ p++;
+ while ((*p++ = *src++))
+ ;
+ return dst;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/string-9-lib.c b/gcc/testsuite/gcc.c-torture/execute/builtins/string-9-lib.c
new file mode 100644
index 00000000000..0a0bbb8865a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/string-9-lib.c
@@ -0,0 +1 @@
+#include "lib/strcat.c"
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/string-9.c b/gcc/testsuite/gcc.c-torture/execute/builtins/string-9.c
new file mode 100644
index 00000000000..ba70c397724
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/string-9.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2000, 2003 Free Software Foundation.
+
+ Ensure all expected transformations of builtin strcat occur and
+ perform correctly.
+
+ Written by Kaveh R. Ghazi, 11/27/2000. */
+
+extern int inside_main;
+extern void abort (void);
+typedef __SIZE_TYPE__ size_t;
+extern char *strcat (char *, const char *);
+extern char *strcpy (char *, const char *);
+extern int strcmp (const char *, const char *);
+extern void *memset (void *, int, size_t);
+extern int memcmp (const void *, const void *, size_t);
+#define RESET_DST_WITH(FILLER) \
+ do { memset (dst, 'X', sizeof (dst)); strcpy (dst, (FILLER)); } while (0)
+
+void main_test (void)
+{
+ const char *const s1 = "hello world";
+ const char *const s2 = "";
+ char dst[64], *d2;
+
+ RESET_DST_WITH (s1);
+ if (strcat (dst, "") != dst || strcmp (dst, s1))
+ abort();
+ RESET_DST_WITH (s1);
+ if (strcat (dst, s2) != dst || strcmp (dst, s1))
+ abort();
+ RESET_DST_WITH (s1); d2 = dst;
+ if (strcat (++d2, s2) != dst+1 || d2 != dst+1 || strcmp (dst, s1))
+ abort();
+ RESET_DST_WITH (s1); d2 = dst;
+ if (strcat (++d2+5, s2) != dst+6 || d2 != dst+1 || strcmp (dst, s1))
+ abort();
+ RESET_DST_WITH (s1); d2 = dst;
+ if (strcat (++d2+5, s1+11) != dst+6 || d2 != dst+1 || strcmp (dst, s1))
+ abort();
+
+#ifndef __OPTIMIZE_SIZE__
+# if !defined __i386__ && !defined __x86_64__
+ /* The functions below might not be optimized into direct stores on all
+ arches. It depends on how many instructions would be generated and
+ what limits the architecture chooses in STORE_BY_PIECES_P. */
+ inside_main = 0;
+# endif
+
+ RESET_DST_WITH (s1);
+ if (strcat (dst, " 1111") != dst
+ || memcmp (dst, "hello world 1111\0XXX", 20))
+ abort();
+
+ RESET_DST_WITH (s1);
+ if (strcat (dst+5, " 2222") != dst+5
+ || memcmp (dst, "hello world 2222\0XXX", 20))
+ abort();
+
+ RESET_DST_WITH (s1); d2 = dst;
+ if (strcat (++d2+5, " 3333") != dst+6 || d2 != dst+1
+ || memcmp (dst, "hello world 3333\0XXX", 20))
+ abort();
+
+ RESET_DST_WITH (s1);
+ strcat (strcat (strcat (strcat (strcat (strcat (dst, ": this "), ""),
+ "is "), "a "), "test"), ".");
+ if (memcmp (dst, "hello world: this is a test.\0X", 30))
+ abort();
+
+ /* Set inside_main again. */
+ inside_main = 1;
+#endif
+
+ /* Test at least one instance of the __builtin_ style. We do this
+ to ensure that it works and that the prototype is correct. */
+ RESET_DST_WITH (s1);
+ if (__builtin_strcat (dst, "") != dst || strcmp (dst, s1))
+ abort();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c
index dc31dc5fb7d..b883dd61e01 100644
--- a/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c
+++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-10.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation.
+/* Copyright (C) 2000, 2003 Free Software Foundation.
Ensure all expected transformations of builtin strncat occur and
perform correctly.
@@ -9,7 +9,7 @@ extern void abort (void);
typedef __SIZE_TYPE__ size_t;
extern char *strncat (char *, const char *, size_t);
extern char *strcpy (char *, const char *);
-extern char *strcmp (const char *, const char *);
+extern int strcmp (const char *, const char *);
int x = 123;
int main ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c
index 251f8bd7c9d..434de33db9b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c
+++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c
@@ -65,7 +65,7 @@ int main ()
s2 = s1; s3 = s1+4;
if (strncmp (++s2, ++s3+2, 1) >= 0 || s2 != s1+1 || s3 != s1+5)
abort();
-#if !defined(__OPTIMIZE__) || defined(__i386__) || defined (__i370__) || defined (__s390__)
+#if !defined(__OPTIMIZE__) || defined(__i386__)
/* These tests work on platforms which support cmpstrsi. We test it
at -O0 on all platforms to ensure the strncmp logic is correct. */
s2 = s1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-9.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-9.c
deleted file mode 100644
index 0a3edbeb99e..00000000000
--- a/gcc/testsuite/gcc.c-torture/execute/string-opt-9.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (C) 2000 Free Software Foundation.
-
- Ensure all expected transformations of builtin strcat occur and
- perform correctly.
-
- Written by Kaveh R. Ghazi, 11/27/2000. */
-
-extern void abort (void);
-typedef __SIZE_TYPE__ size_t;
-extern char *strcat (char *, const char *);
-extern char *strcpy (char *, const char *);
-extern char *strcmp (const char *, const char *);
-
-int main ()
-{
- const char *const s1 = "hello world";
- const char *const s2 = "";
- char dst[64], *d2;
-
- strcpy (dst, s1);
- if (strcat (dst, "") != dst || strcmp (dst, s1))
- abort();
- strcpy (dst, s1);
- if (strcat (dst, s2) != dst || strcmp (dst, s1))
- abort();
- strcpy (dst, s1); d2 = dst;
- if (strcat (++d2, s2) != dst+1 || d2 != dst+1 || strcmp (dst, s1))
- abort();
- strcpy (dst, s1); d2 = dst;
- if (strcat (++d2+5, s2) != dst+6 || d2 != dst+1 || strcmp (dst, s1))
- abort();
- strcpy (dst, s1); d2 = dst;
- if (strcat (++d2+5, s1+11) != dst+6 || d2 != dst+1 || strcmp (dst, s1))
- abort();
-
- /* Test at least one instance of the __builtin_ style. We do this
- to ensure that it works and that the prototype is correct. */
- strcpy (dst, s1);
- if (__builtin_strcat (dst, "") != dst || strcmp (dst, s1))
- abort();
-
- return 0;
-}
-
-#ifdef __OPTIMIZE__
-/* When optimizing, all the above cases should be transformed into
- something else. So any remaining calls to the original function
- should abort. */
-__attribute__ ((noinline))
-static char *
-strcat (char *s1, const char *s2)
-{
- abort();
-}
-#endif
diff --git a/gcc/testsuite/gcc.dg/20020313-1.c b/gcc/testsuite/gcc.dg/20020313-1.c
index f0ae6d4bde4..c8c5d7135ab 100644
--- a/gcc/testsuite/gcc.dg/20020313-1.c
+++ b/gcc/testsuite/gcc.dg/20020313-1.c
@@ -4,7 +4,9 @@
to, and aborted. */
/* { dg-do compile { target ia64-*-* } } */
-/* { dg-options "-O2 -mconstant-gp" } */
+/* In ILP32 mode, we get warnings about large integer constants.
+ Those cause spurious FAILs. */
+/* { dg-options "-w -O2 -mconstant-gp" } */
typedef unsigned long __u64;
typedef unsigned int __u32;
diff --git a/gcc/testsuite/gcc.dg/20021018-1.c b/gcc/testsuite/gcc.dg/20021018-1.c
index 562aa88e62d..2fef73f623a 100644
--- a/gcc/testsuite/gcc.dg/20021018-1.c
+++ b/gcc/testsuite/gcc.dg/20021018-1.c
@@ -1,10 +1,10 @@
/* { dg-do run } */
/* { dg-options "-O2 -fpic" } */
-/* { dg-error "overflow" "16-bit target" { target xstormy16-*-* } 0 } */
extern void abort (void);
extern void exit (int);
+#if __INT_MAX__ >= 2147483647L
static const long foo [10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
long __attribute__((noinline))
@@ -20,3 +20,10 @@ main (void)
abort ();
exit (0);
}
+#else
+int
+main (void)
+{
+ exit (0);
+}
+#endif
diff --git a/gcc/testsuite/gcc.dg/20030505.c b/gcc/testsuite/gcc.dg/20030505.c
index 9c225bd6f3e..0df1c0335eb 100644
--- a/gcc/testsuite/gcc.dg/20030505.c
+++ b/gcc/testsuite/gcc.dg/20030505.c
@@ -1,10 +1,9 @@
-/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-do compile { target powerpc-*-eabispe* } } */
/* { dg-options "-W" } */
#define __vector __attribute__((vector_size(8)))
typedef float __vector __ev64_fs__;
-typedef int __vector __ev64_opaque__;
__ev64_opaque__ *p1;
__ev64_fs__ *p2;
diff --git a/gcc/testsuite/gcc.dg/20030702-1.c b/gcc/testsuite/gcc.dg/20030702-1.c
new file mode 100644
index 00000000000..70dad2eb8a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030702-1.c
@@ -0,0 +1,10 @@
+/* This tests whether REG_ALWAYS_RETURN notes are handled
+ correctly in combine. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic -fprofile-arcs" } */
+
+void test (void)
+{
+ fork ();
+}
+
diff --git a/gcc/testsuite/gcc.dg/20030711-1.c b/gcc/testsuite/gcc.dg/20030711-1.c
new file mode 100644
index 00000000000..25f515cbe50
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030711-1.c
@@ -0,0 +1,25 @@
+/* Test whether strncmp has not been "optimized" into memcmp
+ nor any code with memcmp semantics. */
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* } } */
+/* { dg-options "-O2" } */
+#include <sys/mman.h>
+#include <stdlib.h>
+
+void __attribute__((noinline)) test (const char *p)
+{
+ if (__builtin_strncmp (p, "abcdefghijklmnopq", 17) == 0)
+ abort ();
+}
+
+int main (void)
+{
+ char *p = mmap (NULL, 131072, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (p == MAP_FAILED)
+ return 0;
+ if (munmap (p + 65536, 65536) < 0)
+ return 0;
+ __builtin_memcpy (p + 65536 - 5, "abcd", 5);
+ test (p + 65536 - 5);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/20030717-1.c b/gcc/testsuite/gcc.dg/20030717-1.c
new file mode 100644
index 00000000000..6a7f6de6f44
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030717-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int zero (void)
+{
+ return 0;
+}
+
+int one (void)
+{
+ return 1;
+}
+
+int main (void)
+{
+ int i = 1;
+ int r = (i ? one : zero)();
+ if (r != 1)
+ abort();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20030721-1.c b/gcc/testsuite/gcc.dg/20030721-1.c
new file mode 100644
index 00000000000..5e8ed0b434a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030721-1.c
@@ -0,0 +1,41 @@
+/* { dg-options "-O2" } */
+/* PR optimization/11536 */
+/* Origin: samal@kam.mff.cuni.cz <samal@kam.mff.cuni.cz> */
+/* Testcase by Andrew Pinski <pinskia@physics.uc.edu> */
+
+/* Verify that the loop optimizer doesn't use moving targets
+ to calculate the number of iterations of a loop. */
+
+extern void abort(void);
+
+void foo(int) __attribute__((__noinline__));
+
+void foo(int i)
+{
+ abort();
+}
+
+int main()
+{
+ int i;
+ int first= 0;
+ int last= 0;
+
+ while (last<3) {
+ last = first;
+
+ while (first<=last) {
+ first++;
+
+ for (i=0;i<3;i++)
+ last++;
+
+ if (last>10)
+ return 0;
+ }
+
+ foo(first);
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/20030804-1.c b/gcc/testsuite/gcc.dg/20030804-1.c
new file mode 100644
index 00000000000..cbc66474a5e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030804-1.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of mathematical expressions doesn't
+ break anything.
+
+ Written by Roger Sayle, 3rd August 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+void test(double x)
+{
+ if (x+x != 2.0*x)
+ link_error ();
+ if (x+x != x*2.0)
+ link_error ();
+
+ if (x+x+x != 3.0*x)
+ link_error ();
+ if (x+x+x != x*3.0)
+ link_error ();
+
+ if ((x+x)+x != 3.0*x)
+ link_error ();
+ if ((x+x)+x != x*3.0)
+ link_error ();
+
+ if (x+(x+x) != 3.0*x)
+ link_error ();
+ if (x+(x+x) != x*3.0)
+ link_error ();
+
+ if (x+4.0*x != 5.0*x)
+ link_error ();
+ if (x+4.0*x != x*5.0)
+ link_error ();
+ if (x+x*4.0 != 5.0*x)
+ link_error ();
+ if (x+x*4.0 != x*5.0)
+ link_error ();
+ if (4.0*x+x != 5.0*x)
+ link_error ();
+ if (4.0*x+x != x*5.0)
+ link_error ();
+ if (x*4.0+x != 5.0*x)
+ link_error ();
+ if (x*4.0+x != x*5.0)
+ link_error ();
+
+ if (3.0*x + 5.0*x != 8.0*x)
+ link_error ();
+ if (3.0*x + 5.0*x != x*8.0)
+ link_error ();
+ if (x*3.0 + 5.0*x != 8.0*x)
+ link_error ();
+ if (x*3.0 + 5.0*x != x*8.0)
+ link_error ();
+ if (3.0*x + x*5.0 != 8.0*x)
+ link_error ();
+ if (3.0*x + x*5.0 != x*8.0)
+ link_error ();
+ if (x*3.0 + x*5.0 != 8.0*x)
+ link_error ();
+ if (x*3.0 + x*5.0 != x*8.0)
+ link_error ();
+}
+
+int main()
+{
+ test(2.0);
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20030811-1.c b/gcc/testsuite/gcc.dg/20030811-1.c
new file mode 100644
index 00000000000..55b24060ecb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030811-1.c
@@ -0,0 +1,59 @@
+/* Origin: PR target/11693 from Andreas Schwab <schwab@suse.de> */
+/* { dg-do compile { target ia64-*-linux* } } */
+/* { dg-options "-O2 -frename-registers" } */
+
+static inline unsigned long
+foo (void)
+{
+ unsigned long x;
+ __asm__ __volatile__ ("" : "=r" (x) :: "memory");
+ return x;
+}
+
+static inline void
+bar (unsigned long x, unsigned long y)
+{
+ __asm__ __volatile__ ("" :: "r"(x), "r"(y) : "memory");
+}
+
+static inline void
+baz (unsigned long x, unsigned long y, unsigned long z, unsigned long p,
+ unsigned long q)
+{
+ __asm__ __volatile__ ("" :: "r" (q << 2) : "memory");
+ __asm__ __volatile__ ("" :: "r" (z) : "memory");
+ if (x & 0x1)
+ __asm__ __volatile__ ("" :: "r" (y), "r" (p) : "memory");
+ if (x & 0x2)
+ __asm__ __volatile__ ("" :: "r" (y), "r" (p) : "memory");
+}
+
+static inline unsigned long
+ffz (unsigned long x)
+{
+ unsigned long r;
+ __asm__ ("" : "=r" (r) : "r" (x & (~x - 1)));
+ return r;
+}
+
+void die (const char *, ...) __attribute__ ((noreturn));
+
+void
+test (void *x)
+{
+ unsigned long a, c;
+
+ a = foo ();
+ bar (0xc000000000000000, 0x660);
+ bar (0xa00000000000c000, 0x539);
+ baz (2, 1, 0xa000000000008000,
+ ({ unsigned long b;
+ b = ({ unsigned long d; __asm__ ("" : "=r" (d) : "r" (x)); d; })
+ + 0x10000000000661;
+ b;
+ }),
+ 14);
+ c = ffz (0x1fffffffffffffff);
+ if (c < 51 || c > 61)
+ die ("die", c - 1);
+}
diff --git a/gcc/testsuite/gcc.dg/20030815-1.c b/gcc/testsuite/gcc.dg/20030815-1.c
new file mode 100644
index 00000000000..fe1e7b49a58
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030815-1.c
@@ -0,0 +1,26 @@
+/* Test completion of incomplete types.
+ There used to be a bug where some types from incomplete
+ list were accidentally lost. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef struct a A[1];
+typedef struct b B[1];
+typedef struct c C[1];
+typedef struct d D[1];
+typedef struct a E;
+typedef struct b F;
+typedef struct c G;
+typedef struct d H;
+struct a { int a; };
+struct c { int c; };
+struct d { int d; };
+struct b { int b; };
+int sa = sizeof (A);
+int sb = sizeof (B);
+int sc = sizeof (C);
+int sd = sizeof (D);
+int se = sizeof (E);
+int sf = sizeof (F);
+int sg = sizeof (G);
+int sh = sizeof (H);
diff --git a/gcc/testsuite/gcc.dg/20030820-1.c b/gcc/testsuite/gcc.dg/20030820-1.c
new file mode 100644
index 00000000000..f86fb3978f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030820-1.c
@@ -0,0 +1,13 @@
+/* PR middle-end/11984 */
+/* The following program used to ICE in fold because we didn't check
+ whether the constants we were reassociating were integer constants
+ before calling tree_int_cst_lt. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double f(double x)
+{
+ return 1.0 - x - 0.1;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20030826-1.c b/gcc/testsuite/gcc.dg/20030826-1.c
new file mode 100644
index 00000000000..b344ad2dcbc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030826-1.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of mathematical expressions doesn't
+ break anything.
+
+ Written by Roger Sayle, 24th August 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+void abort(void);
+
+double foo(double x)
+{
+ return 12.0/(x*3.0);
+}
+
+double bar(double x)
+{
+ return (3.0/x)*4.0;
+}
+
+int main()
+{
+ if (foo(2.0) != 2.0)
+ abort ();
+
+ if (bar(2.0) != 6.0)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20030826-2.c b/gcc/testsuite/gcc.dg/20030826-2.c
new file mode 100644
index 00000000000..f25887d47d2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030826-2.c
@@ -0,0 +1,64 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target i?86-*-* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct S
+{
+ int *a;
+ unsigned char *b, c;
+};
+
+int u, v, w;
+
+void
+foo (unsigned short x)
+{
+ u += x;
+}
+
+int
+bar (struct S **x, int *y)
+{
+ w += *y;
+ *y = w + 25;
+ return 0;
+}
+
+int
+baz (struct S **x)
+{
+ struct S *y = *x;
+ unsigned char *a = y->b;
+
+ foo (*a);
+
+ if (__builtin_expect (y->c != 0 || y->a == &v, 0))
+ return 1;
+
+ if (__builtin_expect (*a == 1, 0))
+ {
+ int a, b = bar (x, &a);
+
+ if (a)
+ return b;
+ }
+
+ return 0;
+}
+
+int
+main (void)
+{
+ struct S a, *b = &a;
+ unsigned char c;
+
+ __builtin_memset (b, 0, sizeof (a));
+ a.a = &v;
+ a.b = &c;
+ if (baz (&b) != 1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/20030906-1.c b/gcc/testsuite/gcc.dg/20030906-1.c
new file mode 100644
index 00000000000..57d80f044c3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030906-1.c
@@ -0,0 +1,21 @@
+/* Bug 9862 -- Spurious warnings with -finline-functions.
+ Copyright (C) 2003 Free Software Foundation Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -finline-functions -Wextra" } */
+
+extern int i;
+extern int foo (void);
+extern int bar (void);
+
+int foo (void)
+{
+ if( i ) return 0;
+ else return 1;
+} /* { dg-bogus "may return with or without a value" } */
+
+int bar (void)
+{
+ if( i ) return;
+ else return 1;
+} /* { dg-warning "may return with or without a value" } */
diff --git a/gcc/testsuite/gcc.dg/20030906-2.c b/gcc/testsuite/gcc.dg/20030906-2.c
new file mode 100644
index 00000000000..8f3d3781618
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030906-2.c
@@ -0,0 +1,21 @@
+/* Bug 9862 -- Spurious warnings with -finline-functions.
+ Copyright (C) 2003 Free Software Foundation Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -finline-functions -Wextra" } */
+
+extern int i;
+extern int foo (void);
+extern int bar (void);
+
+int foo (void)
+{
+ if( i ) return;
+ else return 1;
+} /* { dg-warning "may return with or without a value" } */
+
+int bar (void)
+{
+ if( i ) return 0;
+ else return 1;
+}
diff --git a/gcc/testsuite/gcc.dg/20030909-1.c b/gcc/testsuite/gcc.dg/20030909-1.c
new file mode 100644
index 00000000000..2a13270d0c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030909-1.c
@@ -0,0 +1,5 @@
+/* Verify that ands are combined. */
+/* { dg-do compile { target arm*-*-* strongarm*-*-* xscale*-*-* } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-not "#255.*#255" } } */
+int f(int a, int b) { return ((a & 0xff) + (b & 0xff)) & 0xff; }
diff --git a/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c b/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c
new file mode 100644
index 00000000000..0b573915ffe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c
@@ -0,0 +1,26 @@
+/* Test for -Wdeclaration-after-statement emitting warnings when no
+ standard-specifying option is given. See also c9?-mixdecl-*. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-Wdeclaration-after-statement" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i = 0;
+ if (i != 0)
+ abort ();
+ i++;
+ if (i != 1)
+ abort ();
+ int j = i; /* { dg-warning "warning" "declaration after statement" } */
+ if (j != 1)
+ abort ();
+ struct foo { int i0; } k = { 4 }; /* { dg-warning "warning" "declaration after statement" } */
+ if (k.i0 != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c b/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c
new file mode 100644
index 00000000000..5aa3e5d1388
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c
@@ -0,0 +1,26 @@
+/* Test for C99 mixed declarations and code giving warnings, not error with
+ -Wdeclaration-after-statement. See also c9?-mixdecl-*. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=c99 -pedantic-errors -Wdeclaration-after-statement" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i = 0;
+ if (i != 0)
+ abort ();
+ i++;
+ if (i != 1)
+ abort ();
+ int j = i; /* { dg-warning "warning" "declaration-after-statement" } */
+ if (j != 1)
+ abort ();
+ struct foo { int i0; } k = { 4 }; /* { dg-warning "warning" "declaration-after-statement" } */
+ if (k.i0 != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/Wold-style-definition-1.c b/gcc/testsuite/gcc.dg/Wold-style-definition-1.c
new file mode 100644
index 00000000000..d4fb8bd8da1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wold-style-definition-1.c
@@ -0,0 +1,24 @@
+/* Test for warning about old-style function definition. */
+
+/* Origin: Andreas Jaeger <aj@suse.de> */
+/* { dg-do compile } */
+/* { dg-options "-Wold-style-definition" } */
+
+void
+bar (a) int a; { } /* { dg-warning "old-style parameter declaration" } */
+
+void bar1 () {} /* { dg-warning "old-style parameter declaration" } */
+
+extern void bar2 (void);
+
+void bar2 () {} /* { dg-warning "old-style parameter declaration" } */
+
+extern void bar3 (int);
+
+void bar3 (a) {} /* { dg-warning "old-style parameter declaration" } */
+
+void bar4 (a) {} /* { dg-warning "old-style parameter declaration" } */
+
+void bar5 (int a) {}
+
+void bar6 (void) {}
diff --git a/gcc/testsuite/gcc.dg/asm-8.c b/gcc/testsuite/gcc.dg/asm-8.c
new file mode 100644
index 00000000000..a3f3962eb16
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asm-8.c
@@ -0,0 +1,9 @@
+/* PR inline-asm/11676 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void foo(void)
+{
+ long x = 0;
+ asm volatile ("" : "=r"(x) : "r"(x)); /* { dg-bogus "uninitialized" } */
+}
diff --git a/gcc/testsuite/gcc.dg/asm-names.c b/gcc/testsuite/gcc.dg/asm-names.c
index dbfa7925427..d2841a0f40c 100644
--- a/gcc/testsuite/gcc.dg/asm-names.c
+++ b/gcc/testsuite/gcc.dg/asm-names.c
@@ -23,5 +23,7 @@ extern int xmain (void) asm ("main");
int xmain (void) { return main(); }
/* In case built where the runtime calls __main. */
+/* But make it weak because some targets already define this function. */
+#pragma weak ymain
extern int ymain (void) asm ("___main");
int ymain (void) { return main(); }
diff --git a/gcc/testsuite/gcc.dg/attr-warn-unused-result.c b/gcc/testsuite/gcc.dg/attr-warn-unused-result.c
new file mode 100644
index 00000000000..0404ceceb60
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-warn-unused-result.c
@@ -0,0 +1,188 @@
+/* warn_unused_result attribute tests. */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+#define WUR __attribute__((warn_unused_result))
+#define WURAI __attribute__((warn_unused_result, always_inline)) inline
+typedef WUR int (*fnt) (void);
+
+typedef struct { long i; } A;
+typedef struct { long i; long j; } B;
+typedef struct { char big[1024]; fnt fn; } C;
+
+WUR int check1 (void);
+WUR void check2 (void); /* { dg-warning "attribute ignored" } */
+int foo WUR; /* { dg-warning "only applies" } */
+int bar (void);
+extern WURAI int check3 (void) { return bar (); }
+WUR A check4 (void);
+WUR B check5 (void);
+WUR C check6 (void);
+A bar7 (void);
+B bar8 (void);
+C bar9 (void);
+extern WURAI A check7 (void) { return bar7 (); }
+extern WURAI B check8 (void) { return bar8 (); }
+extern WURAI C check9 (void) { return bar9 (); }
+/* This is useful for checking whether return value of statement
+ expressions (returning int in this case) is used. */
+extern WURAI int check_int_result (int res) { return res; }
+#define GU(v) ({ int e = 0; (v) = bar (); if ((v) < 23) e = 14; e; })
+fnt fnptr;
+WUR int check10 (void);
+int baz (void);
+extern WURAI int check11 (void) { return baz (); }
+int k;
+
+void
+test (void)
+{
+ int i = 0, j;
+ const fnt pcheck1 = check1;
+ const fnt pcheck3 = check3;
+ A a;
+ B b;
+ C c;
+ if (check1 ())
+ return;
+ i += check1 ();
+ i += ({ check1 (); });
+ check1 (); /* { dg-warning "ignoring return value of" } */
+ (void) check1 (); /* { dg-warning "ignoring return value of" } */
+ check1 (), bar (); /* { dg-warning "ignoring return value of" } */
+ check2 ();
+ (void) check2 ();
+ check2 (), bar ();
+ if (check3 ())
+ return;
+ i += check3 ();
+ i += ({ check3 (); });
+ check3 (); /* { dg-warning "ignoring return value of" } */
+ (void) check3 (); /* { dg-warning "ignoring return value of" } */
+ check3 (), bar (); /* { dg-warning "ignoring return value of" } */
+ a = check4 ();
+ if (a.i)
+ return;
+ if (check4 ().i)
+ return;
+ if (({ check4 (); }).i)
+ return;
+ check4 (); /* { dg-warning "ignoring return value of" } */
+ (void) check4 (); /* { dg-warning "ignoring return value of" } */
+ check4 (), bar (); /* { dg-warning "ignoring return value of" } */
+ b = check5 ();
+ if (b.i + b.j)
+ return;
+ if (check5 ().j)
+ return;
+ if (({ check5 (); }).j)
+ return;
+ check5 (); /* { dg-warning "ignoring return value of" } */
+ (void) check5 (); /* { dg-warning "ignoring return value of" } */
+ check5 (), bar (); /* { dg-warning "ignoring return value of" } */
+ c = check6 ();
+ if (c.big[12] + c.big[29])
+ return;
+ if (check6 ().big[27])
+ return;
+ if (({ check6 (); }).big[0])
+ return;
+ check6 (); /* { dg-warning "ignoring return value of" } */
+ (void) check6 (); /* { dg-warning "ignoring return value of" } */
+ check6 (), bar (); /* { dg-warning "ignoring return value of" } */
+ a = check7 ();
+ if (a.i)
+ return;
+ if (check7 ().i)
+ return;
+ if (({ check7 (); }).i)
+ return;
+ check7 (); /* { dg-warning "ignoring return value of" } */
+ (void) check7 (); /* { dg-warning "ignoring return value of" } */
+ check7 (), bar (); /* { dg-warning "ignoring return value of" } */
+ b = check8 ();
+ if (b.i + b.j)
+ return;
+ if (check8 ().j)
+ return;
+ if (({ check8 (); }).j)
+ return;
+ check8 (); /* { dg-warning "ignoring return value of" } */
+ (void) check8 (); /* { dg-warning "ignoring return value of" } */
+ check8 (), bar (); /* { dg-warning "ignoring return value of" } */
+ c = check9 ();
+ if (c.big[12] + c.big[29])
+ return;
+ if (check9 ().big[27])
+ return;
+ if (({ check9 (); }).big[0])
+ return;
+ check9 (); /* { dg-warning "ignoring return value of" } */
+ (void) check9 (); /* { dg-warning "ignoring return value of" } */
+ check9 (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (check_int_result (GU (j)))
+ return;
+ i += check_int_result (GU (j));
+ i += ({ check_int_result (GU (j)); });
+ check_int_result (GU (j)); /* { dg-warning "ignoring return value of" } */
+ (void) check_int_result (GU (j)); /* { dg-warning "ignoring return value of" } */
+ check_int_result (GU (j)), bar (); /* { dg-warning "ignoring return value of" } */
+ if (fnptr ())
+ return;
+ i += fnptr ();
+ i += ({ fnptr (); });
+ fnptr (); /* { dg-warning "ignoring return value of" } */
+ (void) fnptr (); /* { dg-warning "ignoring return value of" } */
+ fnptr (), bar (); /* { dg-warning "ignoring return value of" } */
+ fnptr = check1;
+ if (fnptr ())
+ return;
+ i += fnptr ();
+ i += ({ fnptr (); });
+ fnptr (); /* { dg-warning "ignoring return value of" } */
+ (void) fnptr (); /* { dg-warning "ignoring return value of" } */
+ fnptr (), bar (); /* { dg-warning "ignoring return value of" } */
+ fnptr = check3;
+ if (fnptr ())
+ return;
+ i += fnptr ();
+ i += ({ fnptr (); });
+ fnptr (); /* { dg-warning "ignoring return value of" } */
+ (void) fnptr (); /* { dg-warning "ignoring return value of" } */
+ fnptr (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (bar9 ().fn ())
+ return;
+ i += bar9 ().fn ();
+ i += ({ bar9 ().fn (); });
+ bar9 ().fn (); /* { dg-warning "ignoring return value of" } */
+ (void) bar9 ().fn (); /* { dg-warning "ignoring return value of" } */
+ bar9 ().fn (), bar (); /* { dg-warning "ignoring return value of" } */
+ if ((k ? check1 : check10) ())
+ return;
+ i += (k ? check1 : check10) ();
+ i += ({ (k ? check1 : check10) (); });
+ (k ? check1 : check10) (); /* { dg-warning "ignoring return value of" } */
+ (void) (k ? check1 : check10) (); /* { dg-warning "ignoring return value of" } */
+ (k ? check1 : check10) (), bar (); /* { dg-warning "ignoring return value of" } */
+ if ((k ? check3 : check11) ())
+ return;
+ i += (k ? check3 : check11) ();
+ i += ({ (k ? check3 : check11) (); });
+ (k ? check3 : check11) (); /* { dg-warning "ignoring return value of" } */
+ (void) (k ? check3 : check11) (); /* { dg-warning "ignoring return value of" } */
+ (k ? check3 : check11) (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (pcheck1 ())
+ return;
+ i += pcheck1 ();
+ i += ({ pcheck1 (); });
+ pcheck1 (); /* { dg-warning "ignoring return value of" } */
+ (void) pcheck1 (); /* { dg-warning "ignoring return value of" } */
+ pcheck1 (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (pcheck3 ())
+ return;
+ i += pcheck3 ();
+ i += ({ pcheck3 (); });
+ pcheck3 (); /* { dg-warning "ignoring return value of" } */
+ (void) pcheck3 (); /* { dg-warning "ignoring return value of" } */
+ pcheck3 (), bar (); /* { dg-warning "ignoring return value of" } */
+}
diff --git a/gcc/testsuite/gcc.dg/builtin-apply1.c b/gcc/testsuite/gcc.dg/builtin-apply1.c
new file mode 100644
index 00000000000..38b384e7cca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-apply1.c
@@ -0,0 +1,9 @@
+/* PR 11184 */
+/* Origin: Dara Hazeghi <dhazeghi@yahoo.com> */
+
+void *
+objc_msg_sendv (char * arg_frame, void (*foo)())
+{
+ return __builtin_apply ( foo, arg_frame, 4);
+}
+
diff --git a/gcc/testsuite/gcc.dg/builtins-1.c b/gcc/testsuite/gcc.dg/builtins-1.c
index 33160ab32be..41bd8d5788c 100644
--- a/gcc/testsuite/gcc.dg/builtins-1.c
+++ b/gcc/testsuite/gcc.dg/builtins-1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation.
+/* Copyright (C) 2002, 2003 Free Software Foundation.
Verify that all the __builtin_ math functions are recognized
by the compiler.
@@ -6,29 +6,198 @@
Written by Roger Sayle, 11th July 2002. */
/* { dg-do compile } */
+/* { dg-options "" } */
/* { dg-final { scan-assembler-not "__builtin_" } } */
-double test1(double x) { return __builtin_sqrt(x); }
-double test2(double x) { return __builtin_cos(x); }
-double test3(double x) { return __builtin_sin(x); }
-double test4(double x) { return __builtin_exp(x); }
-double test5(double x) { return __builtin_log(x); }
-double test6(double x) { return __builtin_tan(x); }
-double test7(double x) { return __builtin_atan(x); }
-
-float test1f(float x) { return __builtin_sqrtf(x); }
-float test2f(float x) { return __builtin_cosf(x); }
-float test3f(float x) { return __builtin_sinf(x); }
-float test4f(float x) { return __builtin_expf(x); }
-float test5f(float x) { return __builtin_logf(x); }
-float test6f(float x) { return __builtin_tanf(x); }
-float test7f(float x) { return __builtin_atanf(x); }
-
-long double test1l(long double x) { return __builtin_sqrtl(x); }
-long double test2l(long double x) { return __builtin_cosl(x); }
-long double test3l(long double x) { return __builtin_sinl(x); }
-long double test4l(long double x) { return __builtin_expl(x); }
-long double test5l(long double x) { return __builtin_logl(x); }
-long double test6l(long double x) { return __builtin_tanl(x); }
-long double test7l(long double x) { return __builtin_atanl(x); }
+/* These helper macros ensure we also check the float and long double
+ cases. */
+/* Test FP functions taking void. */
+#define FPTEST0(FN) \
+double test_##FN(void) { return __builtin_##FN(); } \
+float test_##FN##f(void) { return __builtin_##FN##f(); } \
+long double test_##FN##l(void) { return __builtin_##FN##l(); }
+
+/* Test FP functions taking one FP argument. */
+#define FPTEST1(FN) \
+double test_##FN(double x) { return __builtin_##FN(x); } \
+float test_##FN##f(float x) { return __builtin_##FN##f(x); } \
+long double test_##FN##l(long double x) { return __builtin_##FN##l(x); }
+
+/* Test FP functions taking one argument of a supplied type. */
+#define FPTEST1ARG(FN, TYPE) \
+double test_##FN(TYPE x) { return __builtin_##FN(x); } \
+float test_##FN##f(TYPE x) { return __builtin_##FN##f(x); } \
+long double test_##FN##l(TYPE x) { return __builtin_##FN##l(x); }
+
+/* Test FP functions taking two arguments, the first argument is of a
+ supplied type. */
+#define FPTEST2ARG1(FN, TYPE) \
+double test_##FN(TYPE x, double y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(TYPE x, float y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(TYPE x, long double y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking two arguments, the second argument is of a
+ supplied type. */
+#define FPTEST2ARG2(FN, TYPE) \
+double test_##FN(double x, TYPE y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(float x, TYPE y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(long double x, TYPE y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking two arguments, the second argument is a
+ FP pointer. */
+#define FPTEST2FPP2(FN) \
+double test_##FN(double x, double *y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(float x, float *y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(long double x, long double *y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking one FP argument and a supplied return
+ type. */
+#define FPTEST1RET(FN, TYPE) \
+TYPE test_##FN(double x) { return __builtin_##FN(x); } \
+TYPE test_##FN##f(float x) { return __builtin_##FN##f(x); } \
+TYPE test_##FN##l(long double x) { return __builtin_##FN##l(x); }
+
+/* Test FP functions taking two FP arguments. */
+#define FPTEST2(FN) \
+double test_##FN(double x, double y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(float x, float y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(long double x, long double y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking three FP arguments. */
+#define FPTEST3(FN) \
+double test_##FN(double x, double y, double z) { return __builtin_##FN(x, y, z); } \
+float test_##FN##f(float x, float y, float z) { return __builtin_##FN##f(x, y, z); } \
+long double test_##FN##l(long double x, long double y, long double z) { return __builtin_##FN##l(x, y, z); }
+
+/* Test FP functions taking three arguments, two FP and the third is
+ of a supplied type. */
+#define FPTEST3ARG3(FN, TYPE) \
+double test_##FN(double x, double y, TYPE z) { return __builtin_##FN(x, y, z); } \
+float test_##FN##f(float x, float y, TYPE z) { return __builtin_##FN##f(x, y, z); } \
+long double test_##FN##l(long double x, long double y, TYPE z) { return __builtin_##FN##l(x, y, z); }
+
+/* Test FP functions taking three FP arguments. The second and third
+ are FP pointers. The return type is void. */
+#define FPTEST3FPP23VOID(FN) \
+double test_##FN(double x, double *y, double *z) { __builtin_##FN(x, y, z); return *y * *z; } \
+float test_##FN##f(float x, float *y, float *z) { __builtin_##FN##f(x, y, z); return *y * *z; } \
+long double test_##FN##l(long double x, long double *y, long double *z) { __builtin_##FN##l(x, y, z); return *y * *z; }
+
+/* Test Complex functions taking one Complex argument. */
+#define CPTEST1(FN) \
+_Complex double test_##FN(_Complex double x) { return __builtin_##FN(x); } \
+_Complex float test_##FN##f(_Complex float x) { return __builtin_##FN##f(x); } \
+_Complex long double test_##FN##l(_Complex long double x) { return __builtin_##FN##l(x); }
+
+/* Test Complex functions taking one Complex argument and returning an FP type. */
+#define CPTEST1RETFP(FN) \
+double test_##FN(_Complex double x) { return __builtin_##FN(x); } \
+float test_##FN##f(_Complex float x) { return __builtin_##FN##f(x); } \
+long double test_##FN##l(_Complex long double x) { return __builtin_##FN##l(x); }
+
+/* Test Complex functions taking two Complex arguments. */
+#define CPTEST2(FN) \
+_Complex double test_##FN(_Complex double x, _Complex double y) { return __builtin_##FN(x,y); } \
+_Complex float test_##FN##f(_Complex float x, _Complex float y) { return __builtin_##FN##f(x,y); } \
+_Complex long double test_##FN##l(_Complex long double x, _Complex long double y) { return __builtin_##FN##l(x,y); }
+
+
+/* Keep this list sorted alphabetically by function name. */
+FPTEST1 (acos)
+FPTEST1 (acosh)
+FPTEST1 (asin)
+FPTEST1 (asinh)
+FPTEST1 (atan)
+FPTEST2 (atan2)
+FPTEST1 (atanh)
+FPTEST1 (cbrt)
+FPTEST1 (ceil)
+FPTEST2 (copysign)
+FPTEST1 (cos)
+FPTEST1 (cosh)
+FPTEST2 (drem)
+FPTEST1 (erf)
+FPTEST1 (erfc)
+FPTEST1 (exp)
+FPTEST1 (exp10)
+FPTEST1 (exp2)
+FPTEST1 (expm1)
+FPTEST1 (fabs)
+FPTEST2 (fdim)
+FPTEST1 (floor)
+FPTEST3 (fma)
+FPTEST2 (fmax)
+FPTEST2 (fmin)
+FPTEST2 (fmod)
+FPTEST2ARG2 (frexp, int *)
+FPTEST1 (gamma)
+FPTEST0 (huge_val)
+FPTEST2 (hypot)
+FPTEST1 (ilogb)
+FPTEST0 (inf)
+FPTEST1 (j0)
+FPTEST1 (j1)
+FPTEST2ARG1 (jn, int)
+FPTEST2ARG2 (ldexp, int)
+FPTEST1 (lgamma)
+FPTEST1RET (llrint, long long)
+FPTEST1RET (llround, long long)
+FPTEST1 (log)
+FPTEST1 (log10)
+FPTEST1 (log1p)
+FPTEST1 (log2)
+FPTEST1 (logb)
+FPTEST1RET (lrint, long)
+FPTEST1RET (lround, long)
+FPTEST2FPP2 (modf)
+FPTEST1ARG (nan, char *)
+FPTEST1ARG (nans, char *)
+FPTEST1 (nearbyint)
+FPTEST2 (nextafter)
+FPTEST2 (nexttoward)
+FPTEST2 (pow)
+FPTEST1 (pow10)
+FPTEST2 (remainder)
+FPTEST3ARG3 (remquo, int *)
+FPTEST1 (rint)
+FPTEST1 (round)
+FPTEST2 (scalb)
+FPTEST2ARG2 (scalbln, int)
+FPTEST2ARG2 (scalbn, int)
+FPTEST1 (significand)
+FPTEST1 (sin)
+FPTEST3FPP23VOID (sincos)
+FPTEST1 (sinh)
+FPTEST1 (sqrt)
+FPTEST1 (tan)
+FPTEST1 (tanh)
+FPTEST1 (tgamma)
+FPTEST1 (trunc)
+FPTEST1 (y0)
+FPTEST1 (y1)
+FPTEST2ARG1 (yn, int)
+
+/* Keep this list sorted alphabetically by function name. */
+CPTEST1RETFP (cabs)
+CPTEST1 (cacos)
+CPTEST1 (cacosh)
+CPTEST1RETFP (carg)
+CPTEST1 (casin)
+CPTEST1 (casinh)
+CPTEST1 (catan)
+CPTEST1 (catanh)
+CPTEST1 (ccos)
+CPTEST1 (ccosh)
+CPTEST1 (cexp)
+CPTEST1RETFP (cimag)
+/*CPTEST1 (clog)*/
+CPTEST1 (conj)
+CPTEST2 (cpow)
+CPTEST1 (cproj)
+CPTEST1RETFP (creal)
+CPTEST1 (csin)
+CPTEST1 (csinh)
+CPTEST1 (csqrt)
+CPTEST1 (ctan)
+CPTEST1 (ctanh)
diff --git a/gcc/testsuite/gcc.dg/builtins-27.c b/gcc/testsuite/gcc.dg/builtins-27.c
new file mode 100644
index 00000000000..69d8f994481
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtins-27.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 29th July 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+extern double pow(double,double);
+
+void test(double x)
+{
+ if (pow(x,2.0) != x*x)
+ link_error ();
+
+ if (x*pow(x,2.0) != pow(x,3.0))
+ link_error ();
+
+ if (pow(x,2.0)*x != pow(x,3.0))
+ link_error ();
+
+ if (pow(x,3.0) != x*x*x)
+ link_error ();
+
+ if (pow(x,2.0)*x != x*x*x)
+ link_error ();
+
+ if (x*pow(x,2.0) != x*x*x)
+ link_error ();
+
+ if (pow(x,3.0)/x != pow(x,2.0))
+ link_error ();
+
+ if (pow(x,3.0)/x != x*x)
+ link_error ();
+}
+
+int main()
+{
+ test (2.0);
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/builtins-3.c b/gcc/testsuite/gcc.dg/builtins-3.c
deleted file mode 100644
index 4bab231a571..00000000000
--- a/gcc/testsuite/gcc.dg/builtins-3.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation.
-
- Verify that built-in math function constant folding of constant
- arguments is correctly performed by the compiler.
-
- Written by Roger Sayle, 16th August 2002. */
-
-/* { dg-do link } */
-/* { dg-options "-O2 -ffast-math" } */
-
-extern void link_error(void);
-
-int main()
-{
- if (sqrt (0.0) != 0.0)
- link_error ();
-
- if (sqrt (1.0) != 1.0)
- link_error ();
-
- if (exp (0.0) != 1.0)
- link_error ();
-
- if (log (1.0) != 0.0)
- link_error ();
-
- if (sin (0.0) != 0.0)
- link_error ();
-
- if (cos (0.0) != 1.0)
- link_error ();
-
- if (tan (0.0) != 0.0)
- link_error ();
-
- if (atan (0.0) != 0.0)
- link_error ();
-
-
- if (sqrtf (0.0f) != 0.0f)
- link_error ();
-
- if (sqrtf (1.0f) != 1.0f)
- link_error ();
-
- if (expf (0.0f) != 1.0f)
- link_error ();
-
- if (logf (1.0f) != 0.0f)
- link_error ();
-
- if (sinf (0.0f) != 0.0f)
- link_error ();
-
- if (cosf (0.0f) != 1.0f)
- link_error ();
-
- if (tanf (0.0f) != 0.0f)
- link_error ();
-
- if (atanf (0.0f) != 0.0f)
- link_error ();
-
- if (sqrtl (0.0l) != 0.0l)
- link_error ();
-
- if (sqrtl (1.0l) != 1.0l)
- link_error ();
-
- if (expl (0.0l) != 1.0l)
- link_error ();
-
- if (logl (1.0l) != 0.0l)
- link_error ();
-
- if (sinl (0.0l) != 0.0l)
- link_error ();
-
- if (cosl (0.0l) != 1.0l)
- link_error ();
-
- if (tanl (0.0l) != 0.0l)
- link_error ();
-
- if (atanl (0.0) != 0.0l)
- link_error ();
-
- return 0;
-}
-
diff --git a/gcc/testsuite/gcc.dg/builtins-4.c b/gcc/testsuite/gcc.dg/builtins-4.c
deleted file mode 100644
index 55e2c917c28..00000000000
--- a/gcc/testsuite/gcc.dg/builtins-4.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation.
-
- Verify that all the binary __builtin_ math functions are
- recognized by the compiler.
-
- Written by Roger Sayle, 6th February 2002. */
-
-/* { dg-do compile } */
-/* { dg-final { scan-assembler-not "__builtin_" } } */
-
-double test1(double x, double y) { return __builtin_pow(x,y); }
-double test2(double x, double y) { return __builtin_atan2(x,y); }
-double test3(double x, double y) { return __builtin_fmod(x,y); }
-
-float test1f(float x, float y) { return __builtin_powf(x,y); }
-float test2f(float x, float y) { return __builtin_atan2f(x,y); }
-float test3f(float x, float y) { return __builtin_fmodf(x,y); }
-
-long double test1l(long double x, long double y)
-{ return __builtin_powl(x,y); }
-long double test2l(long double x, long double y)
-{ return __builtin_atan2l(x,y); }
-long double test3l(long double x, long double y)
-{ return __builtin_fmodl(x,y); }
-
diff --git a/gcc/testsuite/gcc.dg/builtins-5.c b/gcc/testsuite/gcc.dg/builtins-5.c
deleted file mode 100644
index a056812446d..00000000000
--- a/gcc/testsuite/gcc.dg/builtins-5.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation.
-
- Verify that built-in math function constant folding of constant
- arguments is correctly performed by the by the compiler.
-
- Written by Roger Sayle, 20th February 2003. */
-
-/* { dg-do link } */
-/* { dg-options "-O2" } */
-
-extern void link_error(void);
-
-void test(double x)
-{
- if (pow (x, 0.0) != 1.0)
- link_error ();
- if (pow (1.0, x) != 1.0)
- link_error ();
-}
-
-void testf(float x)
-{
- if (powf (x, 0.0f) != 1.0f)
- link_error ();
- if (powf (1.0f, x) != 1.0f)
- link_error ();
-}
-
-void testl(long double x)
-{
- if (powl (x, 0.0l) != 1.0l)
- link_error ();
- if (powl (1.0l, x) != 1.0l)
- link_error ();
-}
-
-int main()
-{
- test (0.0);
- testf (0.0f);
- testl (0.0l);
-
- return 0;
-}
-
diff --git a/gcc/testsuite/gcc.dg/c99-bool-1.c b/gcc/testsuite/gcc.dg/c99-bool-1.c
index 1037eb55173..710219620b7 100644
--- a/gcc/testsuite/gcc.dg/c99-bool-1.c
+++ b/gcc/testsuite/gcc.dg/c99-bool-1.c
@@ -228,9 +228,7 @@ main (void)
abort ();
if ((u |= 2) != 1)
abort ();
- /* ??? A bit queer, since this gets optimized to ((u = (u != 3)) != 1)
- early in semantic analysis, which then yields the warning below. */
- if ((u ^= 3) != 1) /* { dg-warning "always true due to limited range" } */
+ if ((u ^= 3) != 1)
abort ();
/* Test comma expressions. */
u = 1;
diff --git a/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc/testsuite/gcc.dg/cleanup-8.c
new file mode 100644
index 00000000000..91e387ce799
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cleanup-8.c
@@ -0,0 +1,97 @@
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* } } */
+/* { dg-options "-fasynchronous-unwind-tables -fexceptions -O2" } */
+/* Verify that cleanups work with exception handling through signal
+ frames. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.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)
+{
+ 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 ()
+{
+ signal (SIGSEGV, fn4);
+ 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-9.c b/gcc/testsuite/gcc.dg/cleanup-9.c
new file mode 100644
index 00000000000..0c17f25f63d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cleanup-9.c
@@ -0,0 +1,101 @@
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* } } */
+/* { dg-options "-fasynchronous-unwind-tables -fexceptions -O2" } */
+/* Verify that cleanups work with exception handling through realtime
+ signal frames. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.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 ()
+{
+ struct sigaction s;
+ sigemptyset (&s.sa_mask);
+ s.sa_sigaction = fn4;
+ s.sa_flags = SA_ONESHOT | 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/mixed-struct-check.h b/gcc/testsuite/gcc.dg/compat/mixed-struct-check.h
new file mode 100644
index 00000000000..dae20507c2f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/mixed-struct-check.h
@@ -0,0 +1,28 @@
+/* Function definitions that are used by multiple tests. */
+
+void checkScd (Scd x, int i)
+{ if (x.c != (char)i || x.d != (double)i+1) DEBUG_CHECK }
+void checkScdc (Scdc x, int i)
+{ if (x.c != (char)i || x.d != (double)i+1 || x.b != (char)i+2) DEBUG_CHECK }
+void checkSd (Sd x, int i)
+{ if (x.d != (double)i) DEBUG_CHECK }
+void checkSdi (Sdi x, int i)
+{ if (x.d != (double)i || x.i != i+1) DEBUG_CHECK }
+void checkScsds (Scsds x, int i)
+{ if (x.c != (char)i || x.sd.d != (double)i+1) DEBUG_CHECK }
+void checkScsdsc (Scsdsc x, int i)
+{ if (x.c != (char)i || x.sd.d != (double)i+1 || x.b != (char)i+2) DEBUG_CHECK }
+void checkScsdis (Scsdis x, int i)
+{ if (x.c != (char)i || x.sdi.d != (double)i+1 || x.sdi.i != i+2) DEBUG_CHECK }
+void checkScsdisc (Scsdisc x, int i)
+{ if (x.c != (char)i || x.sdi.d != (double)i+1 || x.sdi.i != i+2
+ || x.b != (char)i+3) DEBUG_CHECK }
+void checkSsds (Ssds x, int i)
+{ if (x.sd.d != (double)i) DEBUG_CHECK }
+void checkSsdsc (Ssdsc x, int i)
+{ if (x.sd.d != (double)i || x.c != (char)i+1) DEBUG_CHECK }
+void checkScssdss (Scssdss x, int i)
+{ if (x.c != (char)i || x.ssds.sd.d != (double)i+1) DEBUG_CHECK }
+void checkScssdssc (Scssdssc x, int i)
+{ if (x.c != (char)i || x.ssds.sd.d != (double)i+1
+ || x.b != (char)i+2) DEBUG_CHECK }
diff --git a/gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h b/gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h
new file mode 100644
index 00000000000..6b8f4e721e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h
@@ -0,0 +1,14 @@
+/* Type definitions that are used by multiple tests. */
+
+typedef struct { char c; double d; } Scd;
+typedef struct { char c; double d; char b; } Scdc;
+typedef struct { double d; } Sd;
+typedef struct { double d; int i; } Sdi;
+typedef struct { char c; Sd sd; } Scsds;
+typedef struct { char c; Sd sd; char b; } Scsdsc;
+typedef struct { char c; Sdi sdi; } Scsdis;
+typedef struct { char c; Sdi sdi; char b; } Scsdisc;
+typedef struct { Sd sd; } Ssds;
+typedef struct { Sd sd; char c; } Ssdsc;
+typedef struct { char c; Ssds ssds; } Scssdss;
+typedef struct { char c; Ssds ssds; char b; } Scssdssc;
diff --git a/gcc/testsuite/gcc.dg/compat/mixed-struct-init.h b/gcc/testsuite/gcc.dg/compat/mixed-struct-init.h
new file mode 100644
index 00000000000..7a118cce1a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/mixed-struct-init.h
@@ -0,0 +1,26 @@
+/* Function definitions that are used by multiple tests. */
+
+void initScd (Scd *p, int i)
+{ p->c = (char)i; p->d = (double)i+1; }
+void initScdc (Scdc *p, int i)
+{ p->c = (char)i; p->d = (double)i+1; p->b = (char)i+2; }
+void initSd (Sd *p, int i)
+{ p->d = (double)i; }
+void initSdi (Sdi *p, int i)
+{ p->d = (double)i; p->i = i+1; }
+void initScsds (Scsds *p, int i)
+{ p->c = (char)i; p->sd.d = (double)i+1; }
+void initScsdsc (Scsdsc *p, int i)
+{ p->c = (char)i; p->sd.d = (double)i+1; p->b = (char)i+2; }
+void initScsdis (Scsdis *p, int i)
+{ p->c = (char)i; p->sdi.d = (double)i+1; p->sdi.i = i+2; }
+void initScsdisc (Scsdisc *p, int i)
+{ p->c = (char)i; p->sdi.d = (double)i+1; p->sdi.i = i+2; p->b = (char)i+3; }
+void initSsds (Ssds *p, int i)
+{ p->sd.d = (double)i; }
+void initSsdsc (Ssdsc *p, int i)
+{ p->sd.d = (double)i; p->c = (char)i+1; }
+void initScssdss (Scssdss *p, int i)
+{ p->c = (char)i; p->ssds.sd.d = (double)i+1; }
+void initScssdssc (Scssdssc *p, int i)
+{ p->c = (char)i; p->ssds.sd.d = (double)i+1; p->b = (char)i+2; }
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c
new file mode 100644
index 00000000000..b0eed4c3a2f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c
@@ -0,0 +1,17 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. Struct members are char, int, double,
+ and other structs containing these types. This test was written in
+ response to a layout change for such structs for powerpc64-linux,
+ but this test only checks similar structs that are not affected by
+ that break in compatibility. */
+
+extern void struct_by_value_19_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_19_x ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c
new file mode 100644
index 00000000000..4ccedfde30f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c
@@ -0,0 +1,178 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+#undef T
+
+void
+struct_by_value_19_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c
new file mode 100644
index 00000000000..8b0f1e8f70f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c
@@ -0,0 +1,105 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+/* Turn off checking for variable arguments with -DSKIPVA. */
+#ifdef SKIPVA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "mixed-struct-defs.h"
+
+extern void checkScd (Scd x, int i);
+extern void checkScdc (Scdc x, int i);
+extern void checkSd (Sd x, int i);
+extern void checkSdi (Sdi x, int i);
+extern void checkScsds (Scsds x, int i);
+extern void checkScsdsc (Scsdsc x, int i);
+extern void checkScsdis (Scsdis x, int i);
+extern void checkScsdisc (Scsdisc x, int i);
+extern void checkSsds (Ssds x, int i);
+extern void checkSsdsc (Ssdsc x, int i);
+extern void checkScssdss (Scssdss x, int i);
+extern void checkScssdssc (Scssdssc x, int i);
+
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, 1); \
+ check##TYPE ( g2s##TYPE, 2); \
+ check##TYPE ( g3s##TYPE, 3); \
+ check##TYPE ( g4s##TYPE, 4); \
+ check##TYPE ( g5s##TYPE, 5); \
+ check##TYPE ( g6s##TYPE, 6); \
+ check##TYPE ( g7s##TYPE, 7); \
+ check##TYPE ( g8s##TYPE, 8); \
+ check##TYPE ( g9s##TYPE, 9); \
+ check##TYPE ( g10s##TYPE, 10); \
+ check##TYPE ( g11s##TYPE, 11); \
+ check##TYPE ( g12s##TYPE, 12); \
+ check##TYPE ( g13s##TYPE, 13); \
+ check##TYPE ( g14s##TYPE, 14); \
+ check##TYPE ( g15s##TYPE, 15); \
+ check##TYPE ( g16s##TYPE, 16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, 1); \
+ check##TYPE (s2, 2); \
+ check##TYPE (s3, 3); \
+ check##TYPE (s4, 4); \
+ check##TYPE (s5, 5); \
+ check##TYPE (s6, 6); \
+ check##TYPE (s7, 7); \
+ check##TYPE (s8, 8); \
+ check##TYPE (s9, 9); \
+ check##TYPE (s10, 10); \
+ check##TYPE (s11, 11); \
+ check##TYPE (s12, 12); \
+ check##TYPE (s13, 13); \
+ check##TYPE (s14, 14); \
+ check##TYPE (s15, 15); \
+ check##TYPE (s16, 16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c
new file mode 100644
index 00000000000..64c8f27aebb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c
@@ -0,0 +1,16 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. Tested structs end with double.
+ This test was written in response to a layout change for such
+ structs for powerpc64-linux that breaks compatibility between
+ 3.3 and 3.4. */
+
+extern void struct_by_value_20_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_20_x ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c
new file mode 100644
index 00000000000..183e32dc476
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c
@@ -0,0 +1,166 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+#undef T
+
+void
+struct_by_value_20_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c
new file mode 100644
index 00000000000..6e02e7d0a00
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c
@@ -0,0 +1,99 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+/* Turn off checking for variable arguments with -DSKIPVA. */
+#ifdef SKIPVA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "mixed-struct-defs.h"
+
+extern void checkScd (Scd x, int i);
+extern void checkScdc (Scdc x, int i);
+extern void checkSd (Sd x, int i);
+extern void checkSdi (Sdi x, int i);
+extern void checkScsds (Scsds x, int i);
+extern void checkScsdsc (Scsdsc x, int i);
+extern void checkScsdis (Scsdis x, int i);
+extern void checkScsdisc (Scsdisc x, int i);
+extern void checkSsds (Ssds x, int i);
+extern void checkSsdsc (Ssdsc x, int i);
+extern void checkScssdss (Scssdss x, int i);
+extern void checkScssdssc (Scssdssc x, int i);
+
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, 1); \
+ check##TYPE ( g2s##TYPE, 2); \
+ check##TYPE ( g3s##TYPE, 3); \
+ check##TYPE ( g4s##TYPE, 4); \
+ check##TYPE ( g5s##TYPE, 5); \
+ check##TYPE ( g6s##TYPE, 6); \
+ check##TYPE ( g7s##TYPE, 7); \
+ check##TYPE ( g8s##TYPE, 8); \
+ check##TYPE ( g9s##TYPE, 9); \
+ check##TYPE ( g10s##TYPE, 10); \
+ check##TYPE ( g11s##TYPE, 11); \
+ check##TYPE ( g12s##TYPE, 12); \
+ check##TYPE ( g13s##TYPE, 13); \
+ check##TYPE ( g14s##TYPE, 14); \
+ check##TYPE ( g15s##TYPE, 15); \
+ check##TYPE ( g16s##TYPE, 16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, 1); \
+ check##TYPE (s2, 2); \
+ check##TYPE (s3, 3); \
+ check##TYPE (s4, 4); \
+ check##TYPE (s5, 5); \
+ check##TYPE (s6, 6); \
+ check##TYPE (s7, 7); \
+ check##TYPE (s8, 8); \
+ check##TYPE (s9, 9); \
+ check##TYPE (s10, 10); \
+ check##TYPE (s11, 11); \
+ check##TYPE (s12, 12); \
+ check##TYPE (s13, 13); \
+ check##TYPE (s14, 14); \
+ check##TYPE (s15, 15); \
+ check##TYPE (s16, 16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-19_main.c b/gcc/testsuite/gcc.dg/compat/struct-return-19_main.c
new file mode 100644
index 00000000000..65d8365ee13
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-19_main.c
@@ -0,0 +1,16 @@
+/* Test function return values. Struct members are char, int, double,
+ and other structs containing these types. This test was written in
+ response to a layout change for such structs for powerpc64-linux,
+ but this test only checks similar structs that are not affected by
+ that break in compatibility. */
+
+extern void struct_return_19_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_19_x ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-19_x.c b/gcc/testsuite/gcc.dg/compat/struct-return-19_x.c
new file mode 100644
index 00000000000..cb3e8a905c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-19_x.c
@@ -0,0 +1,123 @@
+#include "compat-common.h"
+
+/* Turn off checking for variable arguments with -DSKIPVA. */
+#ifdef SKIPVA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1); \
+ init##TYPE (&g02##TYPE, 2); \
+ init##TYPE (&g03##TYPE, 3); \
+ init##TYPE (&g04##TYPE, 4); \
+ init##TYPE (&g05##TYPE, 5); \
+ init##TYPE (&g06##TYPE, 6); \
+ init##TYPE (&g07##TYPE, 7); \
+ init##TYPE (&g08##TYPE, 8); \
+ init##TYPE (&g09##TYPE, 9); \
+ init##TYPE (&g10##TYPE, 10); \
+ init##TYPE (&g11##TYPE, 11); \
+ init##TYPE (&g12##TYPE, 12); \
+ init##TYPE (&g13##TYPE, 13); \
+ init##TYPE (&g14##TYPE, 14); \
+ init##TYPE (&g15##TYPE, 15); \
+ init##TYPE (&g16##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16); \
+ } \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+#undef T
+
+void
+struct_return_19_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-19_y.c b/gcc/testsuite/gcc.dg/compat/struct-return-19_y.c
new file mode 100644
index 00000000000..6bbbb62cf9a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-19_y.c
@@ -0,0 +1,70 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1); \
+ check##TYPE (g02##TYPE, 2); \
+ check##TYPE (g03##TYPE, 3); \
+ check##TYPE (g04##TYPE, 4); \
+ check##TYPE (g05##TYPE, 5); \
+ check##TYPE (g06##TYPE, 6); \
+ check##TYPE (g07##TYPE, 7); \
+ check##TYPE (g08##TYPE, 8); \
+ check##TYPE (g09##TYPE, 9); \
+ check##TYPE (g10##TYPE, 10); \
+ check##TYPE (g11##TYPE, 11); \
+ check##TYPE (g12##TYPE, 12); \
+ check##TYPE (g13##TYPE, 13); \
+ check##TYPE (g14##TYPE, 14); \
+ check##TYPE (g15##TYPE, 15); \
+ check##TYPE (g16##TYPE, 16); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-20_main.c b/gcc/testsuite/gcc.dg/compat/struct-return-20_main.c
new file mode 100644
index 00000000000..7f928ba82af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-20_main.c
@@ -0,0 +1,14 @@
+/* Test function return values. Tested structs end with double. This
+ was written in response to a layout change for such structs for
+ powerpc64-linux that breaks compatibility between 3.3 and 3.4. */
+
+extern void struct_return_20_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_20_x ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-20_x.c b/gcc/testsuite/gcc.dg/compat/struct-return-20_x.c
new file mode 100644
index 00000000000..685ef6f8b03
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-20_x.c
@@ -0,0 +1,111 @@
+#include "compat-common.h"
+
+/* Turn off checking for variable arguments with -DSKIPVA. */
+#ifdef SKIPVA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1); \
+ init##TYPE (&g02##TYPE, 2); \
+ init##TYPE (&g03##TYPE, 3); \
+ init##TYPE (&g04##TYPE, 4); \
+ init##TYPE (&g05##TYPE, 5); \
+ init##TYPE (&g06##TYPE, 6); \
+ init##TYPE (&g07##TYPE, 7); \
+ init##TYPE (&g08##TYPE, 8); \
+ init##TYPE (&g09##TYPE, 9); \
+ init##TYPE (&g10##TYPE, 10); \
+ init##TYPE (&g11##TYPE, 11); \
+ init##TYPE (&g12##TYPE, 12); \
+ init##TYPE (&g13##TYPE, 13); \
+ init##TYPE (&g14##TYPE, 14); \
+ init##TYPE (&g15##TYPE, 15); \
+ init##TYPE (&g16##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16); \
+ } \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+#undef T
+
+void
+struct_return_20_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-20_y.c b/gcc/testsuite/gcc.dg/compat/struct-return-20_y.c
new file mode 100644
index 00000000000..2c1c334263f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-20_y.c
@@ -0,0 +1,64 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1); \
+ check##TYPE (g02##TYPE, 2); \
+ check##TYPE (g03##TYPE, 3); \
+ check##TYPE (g04##TYPE, 4); \
+ check##TYPE (g05##TYPE, 5); \
+ check##TYPE (g06##TYPE, 6); \
+ check##TYPE (g07##TYPE, 7); \
+ check##TYPE (g08##TYPE, 8); \
+ check##TYPE (g09##TYPE, 9); \
+ check##TYPE (g10##TYPE, 10); \
+ check##TYPE (g11##TYPE, 11); \
+ check##TYPE (g12##TYPE, 12); \
+ check##TYPE (g13##TYPE, 13); \
+ check##TYPE (g14##TYPE, 14); \
+ check##TYPE (g15##TYPE, 15); \
+ check##TYPE (g16##TYPE, 16); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
diff --git a/gcc/testsuite/gcc.dg/compat/vector-1_x.c b/gcc/testsuite/gcc.dg/compat/vector-1_x.c
index b32a07581f9..c7e69731400 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-1_x.c
@@ -1,3 +1,5 @@
+/* { dg-options "-w" } */
+
#include "compat-common.h"
#include "vector-defs.h"
#include "vector-setup.h"
diff --git a/gcc/testsuite/gcc.dg/compat/vector-1_y.c b/gcc/testsuite/gcc.dg/compat/vector-1_y.c
index 5a8336f2004..1b8b6d7a49e 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-1_y.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-1_y.c
@@ -1,3 +1,5 @@
+/* { dg-options "-w" } */
+
#include "compat-common.h"
#include "vector-defs.h"
#include "vector-check.h"
diff --git a/gcc/testsuite/gcc.dg/compat/vector-2_x.c b/gcc/testsuite/gcc.dg/compat/vector-2_x.c
index 53fddedef48..492878aa750 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-2_x.c
@@ -1,3 +1,5 @@
+/* { dg-options "-w" } */
+
#include "compat-common.h"
#include "vector-defs.h"
#include "vector-setup.h"
diff --git a/gcc/testsuite/gcc.dg/compat/vector-2_y.c b/gcc/testsuite/gcc.dg/compat/vector-2_y.c
index a15964d526c..e100560a507 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-2_y.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-2_y.c
@@ -1,3 +1,5 @@
+/* { dg-options "-w" } */
+
#include "compat-common.h"
#include "vector-defs.h"
#include "vector-check.h"
diff --git a/gcc/testsuite/gcc.dg/cpp/import1.c b/gcc/testsuite/gcc.dg/cpp/import1.c
new file mode 100644
index 00000000000..d118d7fb051
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/import1.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+/* This tests that our eagerness to apply the multiple include guard
+ optimization to the #import doesn't stop us marking the file
+ once-only.
+
+ Neil Booth, 2 August 2003. */
+
+#include "import1.h"
+#import "import1.h"
+#undef IMPORT1_H
+#define BUG
+#include "import1.h"
diff --git a/gcc/testsuite/gcc.dg/cpp/import1.h b/gcc/testsuite/gcc.dg/cpp/import1.h
new file mode 100644
index 00000000000..936c525eb7f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/import1.h
@@ -0,0 +1,6 @@
+#ifndef IMPORT1_H
+#define IMPORT1_H
+#ifdef BUG
+#error Should not happen
+#endif
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/import2.c b/gcc/testsuite/gcc.dg/cpp/import2.c
new file mode 100644
index 00000000000..5c32523880e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/import2.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+/* This tests that the file is only included once
+ Neil Booth, 2 August 2003. */
+
+#include "import2.h"
+#import "import2.h"
+#include "import2.h"
diff --git a/gcc/testsuite/gcc.dg/cpp/import2.h b/gcc/testsuite/gcc.dg/cpp/import2.h
new file mode 100644
index 00000000000..c6a0fa5978a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/import2.h
@@ -0,0 +1,4 @@
+#ifdef BUG
+#error Should not happen!
+#endif
+#define BUG
diff --git a/gcc/testsuite/gcc.dg/cpp/include2.c b/gcc/testsuite/gcc.dg/cpp/include2.c
index efeeb94447a..60edfccb0cd 100644
--- a/gcc/testsuite/gcc.dg/cpp/include2.c
+++ b/gcc/testsuite/gcc.dg/cpp/include2.c
@@ -10,7 +10,7 @@
#include <silly\>> /* { dg-warning "extra tokens" "" } */
#include "silly\"" /* { dg-warning "extra tokens" "" } */
-/* These first 2 errors are No such file or directory. However, this
+/* These error is No such file or directory, just once. However, this
message is locale-dependent, so don't test for it. */
/* { dg-error "silly" "" { target *-*-* } 10 } */
-/* { dg-error "silly" "" { target *-*-* } 11 } */
+
diff --git a/gcc/testsuite/gcc.dg/cpp/separate-1.c b/gcc/testsuite/gcc.dg/cpp/separate-1.c
new file mode 100644
index 00000000000..a80e0014929
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/separate-1.c
@@ -0,0 +1,15 @@
+/* Copyright 2003 Free Software Foundation. */
+
+/* { dg-do compile } */
+/* { dg-options "-save-temps" } */
+
+/* Make sure we report errors in the right line, even if separate
+ preprocessing is used. */
+
+#define FOO()
+
+int FOO( /* { dg-error "(parse|syntax) error" "error on this line" } */
+ ), bar;
+
+int baz FOO /* { dg-error "(parse|syntax) error" "error on this line" } */
+; /* { dg-warning "no type or storage class" "warning on this line" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/spacing1.c b/gcc/testsuite/gcc.dg/cpp/spacing1.c
index 27249600b56..2d70f869d21 100644
--- a/gcc/testsuite/gcc.dg/cpp/spacing1.c
+++ b/gcc/testsuite/gcc.dg/cpp/spacing1.c
@@ -10,6 +10,15 @@
Neil Booth, 1 Dec 2000, 23 Sep 2001. */
+/* The actual location of the expansion of a multi-line macro
+ invocation is not defined: we might consider them to be in the same
+ line as the initial token of the invocation, or as the final token
+ of the invocation, or even anything in between. We choose to make
+ it the initial token, such that everything that is in a logical
+ line ends up in a single line after preprocessing.
+
+ Alexandre Oliva, Sept 13, 2003. */
+
#define str(x) #x
#define f(x) x
#define glue(x, y) x ## y
@@ -28,6 +37,8 @@
B Q B Q A Q A:
f
bar
+A
+bad
g "1 2" bam baz
*/
@@ -36,6 +47,8 @@ glue (EMPTY 4, 4) EMPTY;
A(Q) C(Q) D()Q D():
f
bar
+A
+bad
f (g) str
(
1
@@ -47,4 +60,6 @@ f (g) str
{ dg-final { scan-file spacing1.i "B Q B Q A Q A:" } }
{ dg-final { scan-file-not spacing1.i "f\[^\n\]*bar" } }
{ dg-final { scan-file spacing1.i "(^|\n)bar" } }
+ { dg-final { scan-file spacing1.i "(^|\n)A($|\n)" } }
+ { dg-final { scan-file spacing1.i "(^|\n)bad($|\n)" } }
{ dg-final { scan-file spacing1.i "g \"1 2\" bam baz" } } */
diff --git a/gcc/testsuite/gcc.dg/darwin-ld-6.c b/gcc/testsuite/gcc.dg/darwin-ld-6.c
new file mode 100644
index 00000000000..e3985ea5036
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/darwin-ld-6.c
@@ -0,0 +1,11 @@
+/* Test Darwin linker option -nofixprebinding. */
+/* Developed by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-options "-nofixprebinding" } */
+/* { dg-do link { target *-*-darwin* } } */
+
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
index 7cf18c1b15f..69e572e7385 100644
--- a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
@@ -60,6 +60,9 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
diag ("%H", loc);
cdiag ("%H", loc);
cxxdiag ("%H", loc);
+ diag ("%J", t1);
+ cdiag ("%J", t1);
+ cxxdiag ("%J", t1);
cdiag ("%D%F%T", t1, t1, t1);
cdiag ("%D%D%D%D", t1, t2, *t3, t4[5]);
@@ -83,12 +86,18 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
diag ("%H"); /* { dg-warning "format" "missing arg" } */
cdiag ("%H"); /* { dg-warning "format" "missing arg" } */
cxxdiag ("%H"); /* { dg-warning "format" "missing arg" } */
+ diag ("%J"); /* { dg-warning "format" "missing arg" } */
+ cdiag ("%J"); /* { dg-warning "format" "missing arg" } */
+ cxxdiag ("%J"); /* { dg-warning "format" "missing arg" } */
diag ("%H", i); /* { dg-warning "format" "wrong arg" } */
cdiag ("%H", i); /* { dg-warning "format" "wrong arg" } */
cxxdiag ("%H", i); /* { dg-warning "format" "wrong arg" } */
diag ("%H", p); /* { dg-warning "format" "wrong arg" } */
cdiag ("%H", p); /* { dg-warning "format" "wrong arg" } */
cxxdiag ("%H", p); /* { dg-warning "format" "wrong arg" } */
+ diag ("%J", loc); /* { dg-warning "format" "wrong arg" } */
+ cdiag ("%J", loc); /* { dg-warning "format" "wrong arg" } */
+ cxxdiag ("%J", loc); /* { dg-warning "format" "wrong arg" } */
diag ("%#H", loc); /* { dg-warning "format" "bogus modifier" } */
cdiag ("%#H", loc); /* { dg-warning "format" "bogus modifier" } */
cxxdiag ("%#H", loc); /* { dg-warning "format" "bogus modifier" } */
diff --git a/gcc/testsuite/gcc.dg/i386-387-1.c b/gcc/testsuite/gcc.dg/i386-387-1.c
index 79d25e2432e..74a76b63807 100644
--- a/gcc/testsuite/gcc.dg/i386-387-1.c
+++ b/gcc/testsuite/gcc.dg/i386-387-1.c
@@ -1,6 +1,6 @@
/* Verify that -mno-fancy-math-387 works. */
/* { dg-do compile { target "i?86-*-*" } } */
-/* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387" } */
+/* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387 -march=i386" } */
/* { dg-final { scan-assembler "call\t_?sin" } } */
/* { dg-final { scan-assembler "call\t_?cos" } } */
/* { dg-final { scan-assembler "call\t_?sqrt" } } */
diff --git a/gcc/testsuite/gcc.dg/i386-387-5.c b/gcc/testsuite/gcc.dg/i386-387-5.c
index 8ccc5c96701..2c86dd0869a 100644
--- a/gcc/testsuite/gcc.dg/i386-387-5.c
+++ b/gcc/testsuite/gcc.dg/i386-387-5.c
@@ -1,6 +1,6 @@
/* Verify that -mno-fancy-math-387 works. */
/* { dg-do compile { target "i?86-*-*" } } */
-/* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387" } */
+/* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387 -march=i386" } */
/* { dg-final { scan-assembler "call\t_?atan" } } */
double f1(double x) { return __builtin_atan(x); }
diff --git a/gcc/testsuite/gcc.dg/i386-asm-1.c b/gcc/testsuite/gcc.dg/i386-asm-1.c
new file mode 100644
index 00000000000..aae0de845b3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-asm-1.c
@@ -0,0 +1,24 @@
+/* PR inline-asm/11676 */
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2" } */
+
+static int bar(int x) __asm__("bar");
+static int __attribute__((regparm(1), noinline, used))
+bar(int x)
+{
+ if (x != 0)
+ abort ();
+}
+
+static int __attribute__((regparm(1), noinline))
+foo(int x)
+{
+ x = 0;
+ __asm__ __volatile__("call bar" : "=a"(x) : "a"(x));
+}
+
+int main()
+{
+ foo(1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c b/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c
new file mode 100644
index 00000000000..0780b050bdd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -march=pentium4" } */
+/* { dg-final { scan-assembler-not "imull" } } */
+
+/* Should be done not using imull. */
+int t(int x)
+{
+ return x*29;
+}
diff --git a/gcc/testsuite/gcc.dg/ia64-types1.c b/gcc/testsuite/gcc.dg/ia64-types1.c
new file mode 100644
index 00000000000..521588b47bd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ia64-types1.c
@@ -0,0 +1,41 @@
+/* { dg-do compile { target ia64*-hp-hpux* } } */
+
+/* Test that __fpreg is distinct from any other builtin type. */
+
+extern float fr1; /* { dg-error "" } */
+extern __fpreg fr1; /* { dg-error "" } */
+extern double fr2; /* { dg-error "" } */
+extern __fpreg fr2; /* { dg-error "" } */
+extern long double fr3; /* { dg-error "" } */
+extern __fpreg fr3; /* { dg-error "" } */
+extern __float80 fr4; /* { dg-error "" } */
+extern __fpreg fr4; /* { dg-error "" } */
+extern __float128 fr5; /* { dg-error "" } */
+extern __fpreg fr5; /* { dg-error "" } */
+
+/* Test that __float80 is distinct from any other builtin type. */
+
+extern float f801; /* { dg-error "" } */
+extern __float80 f801; /* { dg-error "" } */
+extern double f802; /* { dg-error "" } */
+extern __float80 f802; /* { dg-error "" } */
+extern long double f803; /* { dg-error "" } */
+extern __float80 f803; /* { dg-error "" } */
+extern __fpreg f804; /* { dg-error "" } */
+extern __float80 f804; /* { dg-error "" } */
+extern __float128 f805; /* { dg-error "" } */
+extern __float80 f805; /* { dg-error "" } */
+
+/* Test that __float128 is distinct from any other builtin type --
+ except "long double", for which it is a synonym. */
+
+extern float f1281; /* { dg-error "" } */
+extern __float128 f1281; /* { dg-error "" } */
+extern double f1282; /* { dg-error "" } */
+extern __float128 f1282; /* { dg-error "" } */
+extern long double f1283;
+extern __float128 f1283;
+extern __fpreg f1284; /* { dg-error "" } */
+extern __float128 f1284; /* { dg-error "" } */
+extern __float80 f1285; /* { dg-error "" } */
+extern __float128 f1285; /* { dg-error "" } */
diff --git a/gcc/testsuite/gcc.dg/ia64-types2.c b/gcc/testsuite/gcc.dg/ia64-types2.c
new file mode 100644
index 00000000000..30e4ddbf87c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ia64-types2.c
@@ -0,0 +1,20 @@
+/* { dg-do run { target ia64*-hp-hpux* } } */
+/* { dg-options } */
+
+/* Test that the sizes and alignments of the extra floating-point
+ types are correct. */
+
+int main () {
+ if (sizeof (__fpreg) != 16)
+ return 1;
+ if (__alignof__ (__fpreg) != 16)
+ return 2;
+
+ if (sizeof (__float80) != 16)
+ return 3;
+ if (__alignof__ (__float80) != 16)
+ return 4;
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/intermod-1.c b/gcc/testsuite/gcc.dg/intermod-1.c
new file mode 100644
index 00000000000..296adf976cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/intermod-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-final { scan-assembler-not {foo[1-9]\.} } } */
+
+/* Check that we don't get .0 suffixes on static variables when not using
+ intermodule analysis. */
+
+static int foo1;
+static int foo2 = 1;
+
+static void foo5(void) { }
+static void foo6(void);
+static void foo6(void) { }
+static void foo7(void);
+void foo7(void) { }
+
+void foo9(void)
+{
+ foo1 = 2;
+ foo2 = 3;
+ foo5();
+ foo6();
+ foo7();
+}
diff --git a/gcc/testsuite/gcc.dg/noncompile/20030818-1.c b/gcc/testsuite/gcc.dg/noncompile/20030818-1.c
new file mode 100644
index 00000000000..71b89ec6fa7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/20030818-1.c
@@ -0,0 +1,3 @@
+/* PR 11207. */
+
+char font8x8[256][8] = { [-1] = { 0 } }; /* { dg-error "array index|near init" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c b/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c
new file mode 100644
index 00000000000..19864b9b353
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c
@@ -0,0 +1,12 @@
+/* Origin: <steven@gcc.gnu.org>
+ Make sure we do not ICE when the type in the function
+ argument list is incomplete (Bug 10602). */
+/* { dg-options "-w" } */
+
+int g95_type_for_mode (enum machine_mode);
+
+int
+g95_type_for_mode (enum machine_mode mode)
+{ /* { dg-error "has incomplete type" } */
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/noncompile/label-1.c b/gcc/testsuite/gcc.dg/noncompile/label-1.c
new file mode 100644
index 00000000000..c646b48fb8d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/label-1.c
@@ -0,0 +1,175 @@
+/* Test various diagnostics of ill-formed constructs involving labels. */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+extern void dummy(void);
+
+/* labels must be defined */
+void a(void)
+{
+ goto l; /* { dg-error "used but not defined" "no label" } */
+}
+
+/* warnings for labels defined but not used, or declared but not defined */
+void b(void)
+{
+ __label__ l;
+ l: /* { dg-warning "defined but not used" "no goto 1" } */
+ m: /* { dg-warning "defined but not used" "no goto 2" } */
+ dummy();
+}
+
+void c(void)
+{
+ __label__ l; /* { dg-warning "declared but not defined" "only __label__" } */
+ dummy();
+}
+
+/* can't have two labels with the same name in the same function */
+void d(void)
+{
+ l: dummy(); /* { dg-error "previously defined" "prev def same scope" } */
+ l: dummy(); /* { dg-error "duplicate label" "dup label same scope" } */
+ goto l;
+}
+
+/* even at different scopes */
+void e(void)
+{
+ l: dummy(); /* { dg-error "previously defined" "prev def diff scope" } */
+ {
+ l: dummy(); /* { dg-error "duplicate label" "dup label diff scope" } */
+ }
+ goto l;
+}
+
+/* but, with __label__, you can */
+void f(void)
+{
+ l: dummy();
+ {
+ __label__ l;
+ l: dummy(); /* { dg-warning "defined but not used" "unused shadow 1" } */
+ };
+ goto l; /* this reaches the outer l */
+}
+
+/* a __label__ is not visible outside its scope */
+void g(void)
+{
+ dummy();
+ {
+ __label__ l;
+ l: dummy();
+ goto l;
+ }
+ goto l; /* { dg-error "used but not defined" "label ref out of scope" } */
+}
+
+/* __label__ can appear at top level of a function, too...
+ ... but doesn't provide a definition of the label */
+void h(void)
+{
+ __label__ l;
+ dummy ();
+
+ goto l; /* { dg-error "used but not defined" "used, only __label__" } */
+}
+
+/* A nested function may not goto a label outside itself */
+void i(void)
+{
+ auto void nest(void);
+
+ l: nest();
+
+ void nest(void)
+ {
+ goto l; /* { dg-error "used but not defined" "nest use outer label" } */
+ }
+
+ goto l; /* reaches the outer l */
+}
+
+/* which means that a nested function may have its own label with the
+ same name as the outer function */
+void j(void)
+{
+ auto void nest(void);
+
+ l: nest();
+
+ void nest(void)
+ {
+ l: dummy(); /* { dg-warning "defined but not used" "nest label same name" } */
+ }
+
+ goto l; /* reaches the outer l */
+}
+
+/* and, turnabout, an outer function may not goto a label in a nested
+ function */
+void k(void)
+{
+ void nest(void)
+ {
+ l: dummy(); /* { dg-warning "defined but not used" "outer use nest label" } */
+ }
+
+ goto l; /* { dg-error "used but not defined" "outer use nest label" } */
+ nest();
+}
+
+/* not even with __label__ */
+void l(void)
+{
+ void nest(void)
+ {
+ __label__ l;
+ l: dummy(); /* { dg-warning "defined but not used" "outer use nest __label__" } */
+ }
+
+ goto l; /* { dg-error "used but not defined" "outer use nest __label__" } */
+ nest();
+}
+
+
+/* but if the outer label is declared with __label__, then a nested
+ function can goto that label (accomplishing a longjmp) */
+void m(void)
+{
+ __label__ l;
+ void nest(void) { goto l; }
+ nest();
+ dummy();
+ l:;
+}
+
+/* and that means the nested function cannot have its own label with
+ the same name as an outer label declared with __label__ */
+
+void n(void)
+{
+ __label__ l; /* { dg-error "previously declared" "outer label decl" } */
+ void nest(void)
+ {
+ l: goto l; /* { dg-error "duplicate label" "inner label defn" } */
+ }
+
+ l:
+ nest();
+}
+
+/* unless the nested function uses __label__ too! */
+void o(void)
+{
+ __label__ l;
+ void nest(void)
+ {
+ __label__ l;
+ l: goto l;
+ }
+
+ l: goto l;
+ nest();
+}
diff --git a/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c b/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
index 28a2aeafca4..0c5599434f8 100644
--- a/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
@@ -4,7 +4,7 @@
void
foo(int i)
{
- my_label:
+ my_label: /* { dg-error "previously defined" "prev label" } */
i++;
diff --git a/gcc/testsuite/gcc.dg/pack-test-3.c b/gcc/testsuite/gcc.dg/pack-test-3.c
new file mode 100644
index 00000000000..8b0390378b3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pack-test-3.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell 15 Jul 2003 <nathan@codesourcery.com> */
+
+/* you should not be able to pack a typedef to a struct, only the
+ underlying struct can be packed. */
+
+/* ok */
+struct u1
+{
+ char field1;
+ short field2;
+ int field3;
+};
+
+/* ok */
+typedef struct p1 {
+ char field1;
+ short field2;
+ int field3;
+} __attribute__ ((packed)) p1_t1;
+
+/* ok */
+typedef struct __attribute__ ((packed)) p2 {
+ char field1;
+ short field2;
+ int field3;
+} p2_t1;
+
+int ary1[sizeof (struct p1) == sizeof (p1_t1) ? 1 : -1];
+int ary2[sizeof (struct p2) == sizeof (p2_t1) ? 1 : -1];
+int ary3[sizeof (struct p1) == sizeof (struct p2) ? 1 : -1];
+
+/* not ok */
+typedef struct u1 __attribute__ ((packed)) u1_t1; /* { dg-warning "attribute ignored" "" }*/
+typedef struct u1 u1_t2 __attribute__ ((packed)); /* { dg-warning "attribute ignored" "" }*/
+
+typedef struct p3 {
+ char field1;
+ short field2;
+ int field3;
+} p3_t1 __attribute__ ((packed)); /* { dg-warning "attribute ignored" "" }*/
+
diff --git a/gcc/testsuite/gcc.dg/pch/inline-3.c b/gcc/testsuite/gcc.dg/pch/inline-3.c
new file mode 100644
index 00000000000..fadaf0785e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/inline-3.c
@@ -0,0 +1,5 @@
+#include "inline-3.h"
+unsigned bar(double d)
+{
+ foo (d);
+}
diff --git a/gcc/testsuite/gcc.dg/pch/inline-3.hs b/gcc/testsuite/gcc.dg/pch/inline-3.hs
new file mode 100644
index 00000000000..ef2819ace7f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/inline-3.hs
@@ -0,0 +1,7 @@
+extern double rint(double);
+extern double fmod (double, double);
+static inline unsigned foo(double d) {
+ double a;
+ a = rint(d);
+ return (unsigned)(fmod(a, (double)0xFFFFFFFF) + ((d - a) * 0xFFFFFFFF));
+}
diff --git a/gcc/testsuite/gcc.dg/pch/inline-4.c b/gcc/testsuite/gcc.dg/pch/inline-4.c
new file mode 100644
index 00000000000..e4db473f3cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/inline-4.c
@@ -0,0 +1,5 @@
+#include "inline-4.h"
+int main(void) {
+ printf (getstring());
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pch/inline-4.hs b/gcc/testsuite/gcc.dg/pch/inline-4.hs
new file mode 100644
index 00000000000..31a5069ff8b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/inline-4.hs
@@ -0,0 +1,4 @@
+static inline char *getstring(void)
+{
+ return "hello";
+}
diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.c b/gcc/testsuite/gcc.dg/pch/warn-1.c
new file mode 100644
index 00000000000..779577dd8ae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/warn-1.c
@@ -0,0 +1,10 @@
+/* { dg-options "-I. -Winvalid-pch" } */
+
+#define DEFINED_VALUE 3
+
+#include "warn-1.h"/* { dg-error "not used because `DEFINED_VALUE' is defined|No such file" } */
+
+int main(void)
+{
+ return DEFINED_VALUE;
+}
diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.hs b/gcc/testsuite/gcc.dg/pch/warn-1.hs
new file mode 100644
index 00000000000..460963f56c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/warn-1.hs
@@ -0,0 +1,5 @@
+enum {
+ DEFINED_VALUE
+};
+
+
diff --git a/gcc/testsuite/gcc.dg/spe1.c b/gcc/testsuite/gcc.dg/spe1.c
new file mode 100644
index 00000000000..9ce56e08d54
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/spe1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-options "-mcpu=8540 -mabi=spe -O0" } */
+
+/* (Test with -O0 so we don't optimize any of them away). */
+
+
+typedef float __attribute__((vector_size(8))) __ev64_fs__;
+
+static __ev64_opaque__ Foo (void);
+
+void Bar ()
+{
+ __ev64_fs__ fs = Foo ();
+}
diff --git a/gcc/testsuite/gcc.dg/struct-in-proto-1.c b/gcc/testsuite/gcc.dg/struct-in-proto-1.c
new file mode 100644
index 00000000000..162ba914aa9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/struct-in-proto-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+int foo(struct S { int i; } s) {
+ return sizeof(struct S); /* { dg-bogus "incomplete type" "S visible here" } */
+}
+int bar(void) {
+ return sizeof(struct S); /* { dg-error "incomplete type" "not here" } */
+}
diff --git a/gcc/testsuite/gcc.dg/tls/opt-7.c b/gcc/testsuite/gcc.dg/tls/opt-7.c
new file mode 100644
index 00000000000..beb2c2622d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/opt-7.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fPIC" } */
+
+static __thread void *baz [4] __attribute__((tls_model ("initial-exec")));
+void foo (void)
+{
+ void **u = (void **) baz;
+
+ u[0] = 0;
+ u[1] = 0;
+}
+
+/* { dg-final { scan-assembler-not "\[48\]\\+baz" { target i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c b/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c
new file mode 100644
index 00000000000..304e92afa8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c
@@ -0,0 +1,375 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that the `const' function attribute is applied to various
+ builtins and that these functions are optimized away by the
+ compiler under the appropriate circumstances.
+
+ Written by Kaveh Ghazi, 2003-08-04. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+/* These are helper macros to test combinations of functions. We test
+ foo() != foo() with the same arguments, and expect the compiler to
+ optimize away these tests of const functions. */
+
+/* Just test the __builtin_ functions. */
+#define BUILTIN_TEST1(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+void test_builtin_##FN(TYPE x) \
+{ if (__builtin_##FN(x) != __builtin_##FN(x)) link_failure_builtin_##FN(); }
+
+/* Just test the __builtin_ functions. */
+#define BUILTIN_TEST2(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+void test_builtin_##FN(TYPE x, TYPE y) \
+{ if (__builtin_##FN(x,y) != __builtin_##FN(x,y)) link_failure_builtin_##FN(); }
+
+/* Also test the regular (non-__builtin_) function. */
+#define TEST1(FN, TYPE) \
+BUILTIN_TEST1(FN, TYPE) \
+extern void link_failure_##FN(void); \
+void test_##FN(TYPE x) { if (FN(x) != FN(x)) link_failure_##FN(); }
+
+/* Test the __builtin_ functions taking void arguments (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST0(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(void) \
+{ if (__builtin_##FN() != __builtin_##FN()) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(void) \
+{ if (__builtin_##FN##f() != __builtin_##FN##f()) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(void) \
+{ if (__builtin_##FN##l() != __builtin_##FN##l()) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one FP argument (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST1(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d) \
+{ if (__builtin_##FN(d) != __builtin_##FN(d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f) \
+{ if (__builtin_##FN##f(f) != __builtin_##FN##f(f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld) \
+{ if (__builtin_##FN##l(ld) != __builtin_##FN##l(ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one argument of supplied type
+ (with the "f" and "l" variants). */
+#define BUILTIN_FPTEST1ARG(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(TYPE x) \
+{ if (__builtin_##FN(x) != __builtin_##FN(x)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(TYPE x) \
+{ if (__builtin_##FN##f(x) != __builtin_##FN##f(x)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(TYPE x) \
+{ if (__builtin_##FN##l(x) != __builtin_##FN##l(x)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two FP arguments (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST2(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d1, double d2) \
+{ if (__builtin_##FN(d1,d2) != __builtin_##FN(d1,d2)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f1, float f2) \
+{ if (__builtin_##FN##f(f1,f2) != __builtin_##FN##f(f1,f2)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld1, long double ld2) \
+{ if (__builtin_##FN##l(ld1,ld2) != __builtin_##FN##l(ld1,ld2)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of a supplied type and the second one one is of FP type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(TYPE x, double d) \
+{ if (__builtin_##FN(x,d) != __builtin_##FN(x,d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(TYPE x, float f) \
+{ if (__builtin_##FN##f(x,f) != __builtin_##FN##f(x,f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(TYPE x, long double ld) \
+{ if (__builtin_##FN##l(x,ld) != __builtin_##FN##l(x,ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of FP type and the second one one is of a supplied type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG2(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d, TYPE x) \
+{ if (__builtin_##FN(d,x) != __builtin_##FN(d,x)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f, TYPE x) \
+{ if (__builtin_##FN##f(f,x) != __builtin_##FN##f(f,x)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld, TYPE x) \
+{ if (__builtin_##FN##l(ld,x) != __builtin_##FN##l(ld,x)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking three FP arguments (with the
+ "f" and "l" variants). */
+#define BUILTIN_FPTEST3(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d1, double d2, double d3) \
+{ if (__builtin_##FN(d1,d2,d3) != __builtin_##FN(d1,d2,d3)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f1, float f2, float f3) \
+{ if (__builtin_##FN##f(f1,f2,f3) != __builtin_##FN##f(f1,f2,f3)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld1, long double ld2, long double ld3) \
+{ if (__builtin_##FN##l(ld1,ld2,ld3) != __builtin_##FN##l(ld1,ld2,ld3)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one complex argument (with the
+ "f" and "l" variants). */
+#define BUILTIN_CPTEST1(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(_Complex double d) \
+{ if (__builtin_##FN(d) != __builtin_##FN(d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(_Complex float f) \
+{ if (__builtin_##FN##f(f) != __builtin_##FN##f(f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(_Complex long double ld) \
+{ if (__builtin_##FN##l(ld) != __builtin_##FN##l(ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two complex arguments (with
+ the "f" and "l" variants). */
+#define BUILTIN_CPTEST2(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(_Complex double d1, _Complex double d2) \
+{ if (__builtin_##FN(d1,d2) != __builtin_##FN(d1,d2)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(_Complex float f1, _Complex float f2) \
+{ if (__builtin_##FN##f(f1,f2) != __builtin_##FN##f(f1,f2)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(_Complex long double ld1, _Complex long double ld2) \
+{ if (__builtin_##FN##l(ld1,ld2) != __builtin_##FN##l(ld1,ld2)) link_failure_builtin_##FN##l(); }
+
+/* These macros additionally test the non-__builtin_ functions. */
+
+/* Test the functions taking one FP argument (with the "f" and "l"
+ variants). */
+#define FPTEST1(FN) \
+BUILTIN_FPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two FP arguments (with the "f" and "l"
+ variants). */
+#define FPTEST2(FN) \
+BUILTIN_FPTEST2(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(double d1, double d2) \
+{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
+void test_##FN##f(float f1, float f2) \
+{ if (FN##f(f1,f2) != FN##f(f1,f2)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld1, long double ld2) \
+{ if (FN##l(ld1,ld2) != FN##l(ld1,ld2)) link_failure_##FN##l(); }
+
+/* Test the functions taking two arguments, the first one is of a
+ supplied type and the second one one is of FP type (with the "f"
+ and "l" variants). */
+#define FPTEST2ARG1(FN, TYPE) \
+BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(TYPE x, double d) \
+{ if (FN(x,d) != FN(x,d)) link_failure_##FN(); } \
+void test_##FN##f(TYPE x, float f) \
+{ if (FN##f(x,f) != FN##f(x,f)) link_failure_##FN##f(); } \
+void test_##FN##l(TYPE x, long double ld) \
+{ if (FN##l(x,ld) != FN##l(x,ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two arguments, the first one is of FP
+ type and the second one one is of a supplied type (with the "f" and
+ "l" variants). */
+#define FPTEST2ARG2(FN, TYPE) \
+BUILTIN_FPTEST2ARG2(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(double d, TYPE x) \
+{ if (FN(d,x) != FN(d,x)) link_failure_##FN(); } \
+void test_##FN##f(float f, TYPE x) \
+{ if (FN##f(f,x) != FN##f(f,x)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld, TYPE x) \
+{ if (FN##l(ld,x) != FN##l(ld,x)) link_failure_##FN##l(); }
+
+/* Test the functions taking three FP arguments (with the "f" and "l"
+ variants). */
+#define FPTEST3(FN) \
+BUILTIN_FPTEST3(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(double d1, double d2, double d3) \
+{ if (FN(d1,d2,d3) != FN(d1,d2,d3)) link_failure_##FN(); } \
+void test_##FN##f(float f1, float f2, float f3) \
+{ if (FN##f(f1,f2,f3) != FN##f(f1,f2,f3)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld1, long double ld2, long double ld3) \
+{ if (FN##l(ld1,ld2,ld3) != FN##l(ld1,ld2,ld3)) link_failure_##FN##l(); }
+
+/* Test the functions taking one complex argument (with the "f" and
+ "l" variants). */
+#define CPTEST1(FN) \
+BUILTIN_CPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(_Complex double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two complex arguments (with the "f" and
+ "l" variants). */
+#define CPTEST2(FN) \
+BUILTIN_CPTEST2(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(_Complex double d1, _Complex double d2) \
+{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f1, _Complex float f2) \
+{ if (FN##f(f1,f2) != FN##f(f1,f2)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld1, _Complex long double ld2) \
+{ if (FN##l(ld1,ld2) != FN##l(ld1,ld2)) link_failure_##FN##l(); }
+
+
+/* Test the math builtins. */
+FPTEST1 (acos)
+FPTEST1 (acosh)
+FPTEST1 (asin)
+FPTEST1 (asinh)
+FPTEST1 (atan)
+FPTEST2 (atan2)
+FPTEST1 (atanh)
+FPTEST1 (cbrt)
+FPTEST1 (ceil)
+FPTEST2 (copysign)
+FPTEST1 (cos)
+FPTEST1 (cosh)
+FPTEST2 (drem)
+FPTEST1 (erf)
+FPTEST1 (erfc)
+FPTEST1 (exp)
+FPTEST1 (exp10)
+FPTEST1 (exp2)
+FPTEST1 (expm1)
+FPTEST1 (fabs)
+FPTEST2 (fdim)
+FPTEST1 (floor)
+FPTEST3 (fma)
+FPTEST2 (fmax)
+FPTEST2 (fmin)
+FPTEST2 (fmod)
+FPTEST1 (gamma)
+BUILTIN_FPTEST0 (huge_val)
+FPTEST2 (hypot)
+FPTEST1 (ilogb)
+BUILTIN_FPTEST0 (inf)
+FPTEST1 (j0)
+FPTEST1 (j1)
+FPTEST2ARG1 (jn, int)
+FPTEST2ARG2 (ldexp, int)
+FPTEST1 (lgamma)
+FPTEST1 (llrint)
+FPTEST1 (llround)
+FPTEST1 (log)
+FPTEST1 (log10)
+FPTEST1 (log1p)
+FPTEST1 (log2)
+FPTEST1 (logb)
+FPTEST1 (lrint)
+FPTEST1 (lround)
+BUILTIN_FPTEST1ARG (nan, char *)
+BUILTIN_FPTEST1ARG (nans, char *)
+FPTEST1 (nearbyint)
+FPTEST2 (nextafter)
+FPTEST2 (nexttoward)
+FPTEST2 (pow)
+FPTEST1 (pow10)
+FPTEST2 (remainder)
+FPTEST1 (rint)
+FPTEST1 (round)
+FPTEST2 (scalb)
+FPTEST2ARG2 (scalbln, int)
+FPTEST2ARG2 (scalbn, int)
+FPTEST1 (significand)
+FPTEST1 (sin)
+FPTEST1 (sinh)
+FPTEST1 (sqrt)
+FPTEST1 (tan)
+FPTEST1 (tanh)
+FPTEST1 (tgamma)
+FPTEST1 (trunc)
+FPTEST1 (y0)
+FPTEST1 (y1)
+FPTEST2ARG1 (yn, int)
+
+/* Test the complex math builtins. */
+/*CPTEST1 (cabs) See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00040.html */
+CPTEST1 (cacos)
+CPTEST1 (cacosh)
+CPTEST1 (carg)
+CPTEST1 (casin)
+CPTEST1 (casinh)
+CPTEST1 (catan)
+CPTEST1 (catanh)
+CPTEST1 (ccos)
+CPTEST1 (ccosh)
+CPTEST1 (cexp)
+CPTEST1 (cimag)
+/*CPTEST1 (clog)*/
+CPTEST1 (conj)
+CPTEST2 (cpow)
+CPTEST1 (cproj)
+CPTEST1 (creal)
+CPTEST1 (csin)
+CPTEST1 (csinh)
+CPTEST1 (csqrt)
+CPTEST1 (ctan)
+CPTEST1 (ctanh)
+
+/* Various other const builtins. */
+TEST1 (abs, int)
+BUILTIN_TEST1 (clz, int)
+BUILTIN_TEST1 (clzl, long)
+BUILTIN_TEST1 (clzll, long long)
+BUILTIN_TEST1 (ctz, int)
+BUILTIN_TEST1 (ctzl, long)
+BUILTIN_TEST1 (ctzll, long long)
+TEST1 (ffs, int)
+TEST1 (ffsl, long)
+TEST1 (ffsll, long long)
+TEST1 (imaxabs, int)
+TEST1 (labs, long)
+TEST1 (llabs, long long)
+BUILTIN_TEST1 (parity, int)
+BUILTIN_TEST1 (parityl, long)
+BUILTIN_TEST1 (parityll, long long)
+BUILTIN_TEST1 (popcount, int)
+BUILTIN_TEST1 (popcountl, long)
+BUILTIN_TEST1 (popcountll, long long)
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-explog-1.c b/gcc/testsuite/gcc.dg/torture/builtin-explog-1.c
new file mode 100644
index 00000000000..352f5b037b1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/builtin-explog-1.c
@@ -0,0 +1,185 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that built-in math function constant folding of log & exp is
+ correctly performed by the compiler.
+
+ Written by Kaveh Ghazi, 2003-09-05. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+/* Define "e" with as many bits as found in builtins.c:dconste. */
+#define M_E 2.7182818284590452353602874713526624977572470936999595749669676277241
+#define M_EF 2.7182818284590452353602874713526624977572470936999595749669676277241F
+#define M_EL 2.7182818284590452353602874713526624977572470936999595749669676277241L
+/* Precision for comparison tests. */
+#define PREC 0.0000001
+#define PRECF 0.0001F
+#define PRECL 0.0000000000001L
+#define PROTOTYPE(FN) extern double FN(double); extern float FN##f(float); \
+ extern long double FN##l(long double);
+#define PROTOTYPE2(FN) extern double FN(double, double); \
+ extern float FN##f(float, float); \
+ extern long double FN##l(long double, long double);
+
+PROTOTYPE(exp)
+PROTOTYPE(exp2)
+PROTOTYPE(exp10)
+PROTOTYPE(log)
+PROTOTYPE(log2)
+PROTOTYPE(log10)
+PROTOTYPE(pow10)
+PROTOTYPE(sqrt)
+PROTOTYPE(cbrt)
+PROTOTYPE2(pow)
+
+void test(double d1, double d2, float f1, float f2,
+ long double ld1, long double ld2)
+{
+#define LOG_1(LOG) \
+ extern void link_failure_##LOG##_1(void); \
+ if (LOG(1.0) != 0.0 || LOG##f(1.0F) != 0.0F || LOG##l(1.0L) != 0.0L) \
+ link_failure_##LOG##_1()
+
+ LOG_1(log);
+ LOG_1(log2);
+ LOG_1(log10);
+
+#define LOG_N(LOG, BASE) \
+ extern void link_failure_##LOG##_N(void); \
+ if (LOG(BASE) != 1.0 || LOG##f(BASE##F) != 1.0F || LOG##l(BASE##L) != 1.0L) \
+ link_failure_##LOG##_N()
+
+ LOG_N(log, M_E);
+ LOG_N(log2, 2.0);
+ LOG_N(log10, 10.0);
+
+#define LOGEXP_SAME(LOG, EXP) \
+ extern void link_failure_##LOG##_##EXP##_same(void); \
+ if (LOG(EXP(d1)) != d1 || LOG##f(EXP##f(f1)) != f1 \
+ || LOG##l(EXP##l(ld1)) != ld1) link_failure_##LOG##_##EXP##_same()
+
+ LOGEXP_SAME(log,exp);
+ LOGEXP_SAME(log2,exp2);
+ LOGEXP_SAME(log10,exp10);
+ LOGEXP_SAME(log10,pow10);
+
+#define LOGEXP(LOG, EXP, BASE) \
+ extern void link_failure_##LOG##_##EXP(void); \
+ if (LOG(EXP(d1)) != d1*LOG(BASE) || LOG##f(EXP##f(f1)) != f1*LOG##f(BASE##F) \
+ || LOG##l(EXP##l(ld1)) != ld1*LOG##l(BASE##L)) link_failure_##LOG##_##EXP()
+
+ LOGEXP(log,exp,M_E);
+ LOGEXP(log,exp2,2.0);
+ LOGEXP(log,exp10,10.0);
+ LOGEXP(log,pow10,10.0);
+ LOGEXP(log2,exp,M_E);
+ LOGEXP(log2,exp2,2.0);
+ LOGEXP(log2,exp10,10.0);
+ LOGEXP(log2,pow10,10.0);
+ LOGEXP(log10,exp,M_E);
+ LOGEXP(log10,exp2,2.0);
+ LOGEXP(log10,exp10,10.0);
+ LOGEXP(log10,pow10,10.0);
+
+#define LOG_SQRT(LOG) \
+ extern void link_failure_##LOG##_sqrt(void); \
+ if (LOG(sqrt(d1)) != 0.5*LOG(d1) || LOG##f(sqrtf(f1)) != 0.5F*LOG##f(f1) \
+ || LOG##l(sqrtl(ld1)) != 0.5L*LOG##l(ld1)) link_failure_##LOG##_sqrt()
+
+ LOG_SQRT(log);
+ LOG_SQRT(log2);
+ LOG_SQRT(log10);
+
+#define LOG_CBRT(LOG) \
+ extern void link_failure_##LOG##_cbrt(void); \
+ if (LOG(cbrt(d1)) != (1.0/3)*LOG(d1) \
+ || LOG##f(cbrtf(f1)) != (1.0F/3)*LOG##f(f1) \
+ || LOG##l(cbrtl(ld1)) != (1.0L/3)*LOG##l(ld1)) link_failure_##LOG##_cbrt()
+
+ LOG_CBRT(log);
+ LOG_CBRT(log2);
+ LOG_CBRT(log10);
+
+#define LOGPOW(LOG, POW) \
+ extern void link_failure_##LOG##_##POW(void); \
+ if (LOG(POW(d1,d2)) != d2*LOG(d1) || LOG##f(POW##f(f1,f2)) != f2*LOG##f(f1) \
+ || LOG##l(POW##l(ld1,ld2)) != ld2*LOG##l(ld1)) link_failure_##LOG##_##POW()
+
+ LOGPOW(log,pow);
+ LOGPOW(log2,pow);
+ LOGPOW(log10,pow);
+
+#define EXP_0(EXP) \
+ extern void link_failure_##EXP##_0(void); \
+ if (EXP(0.0) != 1.0 || EXP##f(0.0F) != 1.0F || EXP##l(0.0L) != 1.0L) \
+ link_failure_##EXP##_0()
+
+ EXP_0(exp);
+ EXP_0(exp2);
+ EXP_0(exp10);
+ EXP_0(pow10);
+
+#define EXP_N(EXP, BASE) \
+ extern void link_failure_##EXP##_N(void); \
+ if (EXP(1.0) != BASE || EXP##f(1.0F) != BASE##F || EXP##l(1.0L) != BASE##L) \
+ link_failure_##EXP##_N()
+
+ EXP_N(exp, M_E);
+ EXP_N(exp2, 2.0);
+ EXP_N(exp10, 10.0);
+ EXP_N(pow10, 10.0);
+
+#define EXP_INT(EXP, BASE) \
+ extern void link_failure_##EXP##_INT(void); \
+ if (EXP(5.0) < (BASE)*(BASE)*(BASE)*(BASE)*(BASE) - PREC \
+ || EXP(5.0) > (BASE)*(BASE)*(BASE)*(BASE)*(BASE) + PREC \
+ || EXP##f(5.0F) < (BASE##F)*(BASE##F)*(BASE##F)*(BASE##F)*(BASE##F) -PRECF \
+ || EXP##f(5.0F) > (BASE##F)*(BASE##F)*(BASE##F)*(BASE##F)*(BASE##F) +PRECF \
+ || EXP##l(5.0L) < (BASE##L)*(BASE##L)*(BASE##L)*(BASE##L)*(BASE##L) -PRECL \
+ || EXP##l(5.0L) > (BASE##L)*(BASE##L)*(BASE##L)*(BASE##L)*(BASE##L) +PRECL) \
+ link_failure_##EXP##_INT()
+
+ EXP_INT(exp, M_E);
+ EXP_INT(exp2, 2.0);
+ EXP_INT(exp10, 10.0);
+ EXP_INT(pow10, 10.0);
+
+#define EXPLOG_SAME(EXP, LOG) \
+ extern void link_failure_##EXP##_##LOG##_same(void); \
+ if (EXP(LOG(d1)) != d1 || EXP##f(LOG##f(f1)) != f1 \
+ || EXP##l(LOG##l(ld1)) != ld1) link_failure_##EXP##_##LOG##_same()
+
+ EXPLOG_SAME(exp, log);
+ EXPLOG_SAME(exp2, log2);
+ EXPLOG_SAME(exp10, log10);
+ EXPLOG_SAME(pow10, log10);
+
+#define EXPXEXP(EXP) \
+ extern void link_failure_##EXP##X##EXP(void); \
+ if (EXP(d1)*EXP(d2) != EXP(d1+d2) || EXP##f(f1)*EXP##f(f2) != EXP##f(f1+f2) \
+ || EXP##l(ld1)*EXP##l(ld2) != EXP##l(ld1+ld2)) link_failure_##EXP##X##EXP()
+
+ EXPXEXP(exp);
+ EXPXEXP(exp2);
+ EXPXEXP(exp10);
+ EXPXEXP(pow10);
+
+#define DIVEXP(EXP) \
+ extern void link_failure_div1_##EXP(void); \
+ if (d1/EXP(d2) != d1*EXP(-d2) || f1/EXP##f(f2) != f1*EXP##f(-f2) \
+ || ld1/EXP##l(ld2) != ld1*EXP##l(-ld2)) link_failure_div1_##EXP(); \
+ extern void link_failure_div2_##EXP(void); \
+ if (EXP(d1)/EXP(d2) != EXP(d1-d2) || EXP##f(f1)/EXP##f(f2) != EXP##f(f1-f2) \
+ || EXP##l(ld1)/EXP##l(ld2) != EXP##l(ld1-ld2)) link_failure_div2_##EXP()
+
+ DIVEXP(exp);
+ DIVEXP(exp2);
+ DIVEXP(exp10);
+ DIVEXP(pow10);
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-1.c b/gcc/testsuite/gcc.dg/torture/builtin-math-1.c
new file mode 100644
index 00000000000..47b91d7e25d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/builtin-math-1.c
@@ -0,0 +1,131 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the compiler.
+
+ Written by Roger Sayle, 16th August 2002. */
+
+/* { dg-do link } */
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(void);
+
+void test (float f, double d, long double ld)
+{
+ if (sqrt (0.0) != 0.0)
+ link_error ();
+
+ if (sqrt (1.0) != 1.0)
+ link_error ();
+
+ if (exp (0.0) != 1.0)
+ link_error ();
+
+ if (exp (1.0) <= 2.71 || exp (1.0) >= 2.72)
+ link_error ();
+
+ if (log (1.0) != 0.0)
+ link_error ();
+
+ if (sin (0.0) != 0.0)
+ link_error ();
+
+ if (cos (0.0) != 1.0)
+ link_error ();
+
+ if (tan (0.0) != 0.0)
+ link_error ();
+
+ if (atan (0.0) != 0.0)
+ link_error ();
+
+ if (4.0*atan (1.0) <= 3.14 || 4.0*atan (1.0) >= 3.15)
+ link_error ();
+
+ if (pow (d, 0.0) != 1.0)
+ link_error ();
+
+ if (pow (1.0, d) != 1.0)
+ link_error ();
+
+
+ if (sqrtf (0.0F) != 0.0F)
+ link_error ();
+
+ if (sqrtf (1.0F) != 1.0F)
+ link_error ();
+
+ if (expf (0.0F) != 1.0F)
+ link_error ();
+
+ if (expf (1.0F) <= 2.71F || expf (1.0F) >= 2.72F)
+ link_error ();
+
+ if (logf (1.0F) != 0.0F)
+ link_error ();
+
+ if (sinf (0.0F) != 0.0F)
+ link_error ();
+
+ if (cosf (0.0F) != 1.0F)
+ link_error ();
+
+ if (tanf (0.0F) != 0.0F)
+ link_error ();
+
+ if (atanf (0.0F) != 0.0F)
+ link_error ();
+
+ if (4.0F*atanf (1.0F) <= 3.14F || 4.0F*atanf (1.0F) >= 3.15F)
+ link_error ();
+
+ if (powf (f, 0.0F) != 1.0F)
+ link_error ();
+
+ if (powf (1.0F, f) != 1.0F)
+ link_error ();
+
+
+ if (sqrtl (0.0L) != 0.0L)
+ link_error ();
+
+ if (sqrtl (1.0L) != 1.0L)
+ link_error ();
+
+ if (expl (0.0L) != 1.0L)
+ link_error ();
+
+ if (expl (1.0L) <= 2.71L || expl (1.0L) >= 2.72L)
+ link_error ();
+
+ if (logl (1.0L) != 0.0L)
+ link_error ();
+
+ if (sinl (0.0L) != 0.0L)
+ link_error ();
+
+ if (cosl (0.0L) != 1.0L)
+ link_error ();
+
+ if (tanl (0.0L) != 0.0L)
+ link_error ();
+
+ if (atanl (0.0) != 0.0L)
+ link_error ();
+
+ if (4.0L*atanl (1.0L) <= 3.14L || 4.0L*atanl (1.0L) >= 3.15L)
+ link_error ();
+
+ if (powl (ld, 0.0L) != 1.0L)
+ link_error ();
+
+ if (powl (1.0L, ld) != 1.0L)
+ link_error ();
+}
+
+int main()
+{
+ test (3.0, 3.0F, 3.0L);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ultrasp10.c b/gcc/testsuite/gcc.dg/ultrasp10.c
new file mode 100644
index 00000000000..ffa3229fa4f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ultrasp10.c
@@ -0,0 +1,25 @@
+/* PR target/11965 */
+/* Originator: <jk@tools.de> */
+/* { dg-do run { target sparc*-*-* } } */
+/* { dg-options "-O -mcpu=ultrasparc" } */
+
+/* This used to fail on 32-bit Ultrasparc because GCC emitted
+ an invalid shift instruction. */
+
+
+static inline unsigned int shift(int n, unsigned int value)
+{
+ return value << n;
+}
+
+unsigned int val = 1;
+
+int main(void)
+{
+ int i;
+
+ for (i = 0; i < 4; i++)
+ val = shift(32, val);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-D.c b/gcc/testsuite/gcc.dg/uninit-D.c
new file mode 100644
index 00000000000..ea957e49e98
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-D.c
@@ -0,0 +1,9 @@
+/* Test we do not warn about initializing variable with self. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+int f()
+{
+ int i = i;
+ return i;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-E.c b/gcc/testsuite/gcc.dg/uninit-E.c
new file mode 100644
index 00000000000..eb356c3ee0d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-E.c
@@ -0,0 +1,9 @@
+/* Test we do warn about initializing variable with self when -Winit-self is supplied. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized -Winit-self" } */
+
+int f()
+{
+ int i = i; /* { dg-warning "i" "uninitialized variable warning" } */
+ return i;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-F.c b/gcc/testsuite/gcc.dg/uninit-F.c
new file mode 100644
index 00000000000..1dbb365e5b7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-F.c
@@ -0,0 +1,9 @@
+/* Test we do warn about initializing variable with self in the initialization. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+int f()
+{
+ int i = i + 1; /* { dg-warning "i" "uninitialized variable warning" } */
+ return i;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-G.c b/gcc/testsuite/gcc.dg/uninit-G.c
new file mode 100644
index 00000000000..08f5f532116
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-G.c
@@ -0,0 +1,9 @@
+/* Test we do not warn about initializing variable with address of self in the initialization. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+void *f()
+{
+ void *i = &i;
+ return i;
+}
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-10b.c b/gcc/testsuite/gcc.misc-tests/gcov-10b.c
new file mode 100644
index 00000000000..148d779fdb3
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-10b.c
@@ -0,0 +1,16 @@
+/* Test gcov block mode. */
+
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-do run { target native } } */
+
+int main ()
+{
+ unsigned ix, jx = 0;
+
+ ix = 10; goto test; loop: ; if (ix & 1) jx++; test: ; if (ix--) goto loop; /* count(11) */
+
+ return jx != 5;
+}
+
+/* { dg-final { run-gcov { -a gcov-10b.c } } } */
+
diff --git a/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp b/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp
index f452038929e..2290478902d 100644
--- a/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp
+++ b/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp
@@ -16,7 +16,9 @@
# Test that the correct data prefetch instructions (SSE or 3DNow! variant,
# or none) are used for various i386 cpu-type and instruction set
-# extension options for __builtin_prefetch.
+# extension options for __builtin_prefetch. When using -mtune, specify
+# the minimum supported architecture in case the compiler was configured
+# with a different default.
# Failure reports do not include the compile option that was used; that
# information can be seen in the compile line in the log file.
@@ -24,14 +26,14 @@
# Do not generate prefetch instructions for the following options.
set PREFETCH_NONE [list \
- { -mtune=i386 } \
- { -mtune=i486 } \
- { -mtune=i586 } \
- { -mtune=i686 } \
- { -mtune=pentium2 } \
- { -mtune=k6 } \
- { -mtune=k6-2 } \
- { -mtune=k6-3 } \
+ { -march=i386 -mtune=i386 } \
+ { -march=i386 -mtune=i486 } \
+ { -march=i386 -mtune=i586 } \
+ { -march=i386 -mtune=i686 } \
+ { -march=i386 -mtune=pentium2 } \
+ { -march=i386 -mtune=k6 } \
+ { -march=i386 -mtune=k6-2 } \
+ { -march=i386 -mtune=k6-3 } \
{ -march=i386 } \
{ -march=i486 } \
{ -march=i586 } \
@@ -44,10 +46,10 @@ set PREFETCH_NONE [list \
# instructions as nops.
set PREFETCH_SSE [list \
- { -mtune=pentium3 } \
- { -mtune=pentium4 } \
- { -mtune=athlon } \
- { -mtune=athlon-4 } \
+ { -march=i386 -mtune=pentium3 } \
+ { -march=i386 -mtune=pentium4 } \
+ { -march=i386 -mtune=athlon } \
+ { -march=i386 -mtune=athlon-4 } \
{ -march=pentium3 } \
{ -march=pentium4 } ]
diff --git a/gcc/testsuite/gcc.misc-tests/linkage.exp b/gcc/testsuite/gcc.misc-tests/linkage.exp
index 496c63c7a54..7aa99667566 100644
--- a/gcc/testsuite/gcc.misc-tests/linkage.exp
+++ b/gcc/testsuite/gcc.misc-tests/linkage.exp
@@ -53,6 +53,11 @@ if [isnative] then {
if [ string match "*32-bit*" $file_string ] {
set native_cflags "-m31"
}
+ } elseif [istarget "*-hp-hpux*"] {
+ set file_string [exec file "linkage-x.o"]
+ if [ string match "*ELF-64*" $file_string ] {
+ set native_cflags "+DD64"
+ }
}
catch { exec rm -f linkage-y.o }
diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp
index 67d60ecd80c..2926d0be680 100644
--- a/gcc/testsuite/lib/compat.exp
+++ b/gcc/testsuite/lib/compat.exp
@@ -49,18 +49,25 @@ if ![info exists COMPAT_OPTIONS] {
set option_list $COMPAT_OPTIONS
+load_lib dg.exp
+
#
# compat-obj -- compile to an object file
#
# SOURCE is the source file
# DEST is the object file
-# OPTIONS is the list of compiler options
+# 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
#
-proc compat-obj { source dest options optstr } {
+proc compat-obj { source dest optall optfile optstr } {
global testcase
global tool
+ # Set up the options for compiling this file.
+ set options ""
+ lappend options "additional_flags=$optfile $optall"
+
set comp_output [${tool}_target_compile "$source" "$dest" object $options]
${tool}_check_compile "$testcase $dest compile" $optstr $dest $comp_output
}
@@ -70,10 +77,11 @@ proc compat-obj { source dest options optstr } {
# TESTNAME is the mixture of object files to link
# OBJLIST is the list of object files to link
# DEST is the name of the executable
-# OPTIONS is a list of compiler and linker options to use
+# OPTALL is a list of compiler and linker options to use for all tests
+# OPTFILE is a list of compiler and linker options to use for this test
# OPTSTR is the list of options to list in messages
#
-proc compat-run { testname objlist dest options optstr } {
+proc compat-run { testname objlist dest optall optfile optstr } {
global testcase
global tool
@@ -86,6 +94,10 @@ proc compat-run { testname objlist dest options optstr } {
}
}
+ # Set up the options for linking this test.
+ set options ""
+ lappend options "additional_flags=$optfile $optall"
+
# Link the objects into an executable.
set comp_output [${tool}_target_compile "$objlist" $dest executable \
"$options"]
@@ -108,6 +120,48 @@ proc compat-run { testname objlist dest options optstr } {
}
#
+# compat-flags -- 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.
+#
+# This code is copied from proc dg-test in dg.exp from DejaGNU.
+#
+proc compat-get-options { src } {
+ # Define our own special function `unknown` so we catch spelling errors.
+ # But first rename the existing one so we can restore it afterwards.
+ catch {rename dg-save-unknown ""}
+ rename unknown dg-save-unknown
+ proc unknown { args } {
+ return -code error "unknown dg option: $args"
+ }
+
+ # dg-options sets a variable called dg-extra-tool-flags.
+ set dg-extra-tool-flags ""
+ set tmp [dg-get-options $src]
+ foreach op $tmp {
+ set cmd [lindex $op 0]
+ if ![string compare "dg-options" $cmd] {
+ set status [catch "$op" errmsg]
+ if { $status != 0 } {
+ perror "src: $errmsg for \"$op\"\n"
+ unresolved "$src: $errmsg for \"$op\""
+ return
+ }
+ } else {
+ # Ignore unrecognized dg- commands, but warn about them.
+ warning "compat.exp does not support $cmd"
+ }
+ }
+
+ # Restore normal error handling.
+ rename unknown ""
+ rename dg-save-unknown unknown
+
+ return ${dg-extra-tool-flags}
+}
+
+#
# compat-execute -- compile with compatible compilers
#
# SRC1 is the full pathname of the main file of the testcase.
@@ -123,27 +177,19 @@ proc compat-execute { src1 sid use_alt } {
global testcase
global gluefile
- # Use the dg-options mechanism to specify extra flags for this test.
- # FIXME: This does not handle other uses of dg-options, and it only
- # processes the first one.
- set extra_tool_flags ""
- set tmp [grep $src1 "{\[ \t\]\*dg-options.*\[ \t\]\+}"]
- if ![string match "" $tmp] {
- set tmp0 [lindex $tmp 0]
- # Extract the compiler options.
- regexp "dg-options\[ \t\]\+(.*)\[ \t\]\+\}" \
- $tmp0 all args
- # Sometime the options are in quotes, sometimes not.
- regsub -all "\"" $args "" args
- set extra_tool_flags $args
- }
-
# Set up the names of the other source files.
regsub "_main.*" $src1 "" base
regsub ".*/" $base "" base
regsub "_main" $src1 "_x" src2
regsub "_main" $src1 "_y" src3
+ # Use the dg-options mechanism to specify extra flags for this test.
+ # The extra flags in each file are used to compile that file, and the
+ # 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 extra_flags_3 [compat-get-options $src3]
+
# Define the names of the object files.
regsub "sid" "sid_main_tst.o" $sid obj1
regsub "sid" "sid_x_tst.o" $sid obj2_tst
@@ -180,11 +226,6 @@ proc compat-execute { src1 sid use_alt } {
}
verbose "Testing $testcase, $optstr" 1
- set tst_options ""
- set alt_options ""
- lappend tst_options "additional_flags=$extra_tool_flags $tst_option"
- lappend alt_options "additional_flags=$extra_tool_flags $alt_option"
-
# There's a unique name for each executable we generate, based on
# the set of options and how the pieces of the tests are compiled.
set execname1 "${execbase}-${count}1"
@@ -202,28 +243,29 @@ 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_options $optstr
- compat-obj "$src3" "$obj3_alt" $alt_options $optstr
+ compat-obj "$src2" "$obj2_alt" $alt_option $extra_flags_2 $optstr
+ compat-obj "$src3" "$obj3_alt" $alt_option $extra_flags_3 $optstr
}
# Compile pieces with the compiler under test.
compat-use-tst-compiler
- compat-obj "$src1" "$obj1" $tst_options $optstr
- compat-obj "$src2" "$obj2_tst" $tst_options $optstr
- compat-obj "$src3" "$obj3_tst" $tst_options $optstr
+ 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
# Link (using the compiler under test), run, and clean up tests.
compat-run "${obj2_tst}-${obj3_tst}" \
- "$obj1 $obj2_tst $obj3_tst" $execname1 $tst_options $optstr
+ "$obj1 $obj2_tst $obj3_tst" $execname1 \
+ $tst_option $extra_flags_1 $optstr
# If we've got an alternate compiler try some combinations.
if { $use_alt != 0 } then {
compat-run "${obj2_tst}-${obj3_alt}" "$obj1 $obj2_tst $obj3_alt" \
- $execname2 $tst_options $optstr
+ $execname2 $tst_option $extra_flags_1 $optstr
compat-run "${obj2_alt}-${obj3_tst}" "$obj1 $obj2_alt $obj3_tst" \
- $execname3 $tst_options $optstr
+ $execname3 $tst_option $extra_flags_1 $optstr
compat-run "${obj2_alt}-${obj3_alt}" "$obj1 $obj2_alt $obj3_alt" \
- $execname4 $tst_options $optstr
+ $execname4 $tst_option $extra_flags_1 $optstr
}
# Clean up object files.
diff --git a/gcc/testsuite/lib/dg-pch.exp b/gcc/testsuite/lib/dg-pch.exp
index ca7d8c3c9e3..5ab34ec7bef 100644
--- a/gcc/testsuite/lib/dg-pch.exp
+++ b/gcc/testsuite/lib/dg-pch.exp
@@ -21,7 +21,7 @@ proc dg-pch { subdir test options suffix } {
# If we're only testing specific files and this isn't one of them, skip it.
if ![runtest_file_p $runtests $test] {
- continue
+ return
}
set nshort "$subdir/[file tail $test]"
set bname "[file rootname [file tail $nshort]]"
@@ -39,7 +39,7 @@ proc dg-pch { subdir test options suffix } {
set dg-do-what-default precompile
catch { file delete "$bname$suffix" }
gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
- dg-test -keep-output "$bname$suffix" $flags ""
+ dg-test -keep-output "./$bname$suffix" $flags ""
# For the rest, the default is to compile to .s.
set dg-do-what-default compile
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 827062352f8..ee1d4d84a64 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -199,7 +199,7 @@ proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } {
set comp_output [$target_compile \
"$srcdir/$subdir/$trivial" "trivial.S" assembly \
"additional_flags=$type"]
- if { ! [string match "*: unknown or unsupported -g option*" \
+ if { ! [string match "*: target system does not support the * debug format*" \
$comp_output] } {
foreach level {1 "" 3} {
lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
index 9e7c445d3ce..1817c7022e8 100644
--- a/gcc/testsuite/lib/objc.exp
+++ b/gcc/testsuite/lib/objc.exp
@@ -168,13 +168,15 @@ proc objc_target_compile { source dest type options } {
set options [concat "additional_flags=$TOOL_OPTIONS" $options];
}
- # Point to the ObjC headers in libobjc.
- set objc_include_dir "${srcdir}/../../libobjc"
- lappend options "additional_flags=-I${objc_include_dir}"
+ # If we have built libobjc along with the compiler (which usually
+ # _is not_ the case on Mac OS X systems), point the test harness
+ # at it (and associated headers).
set objcpath "[get_multilibs]"
set libobjc_dir [lookfor_file ${objcpath} libobjc/.libs/libobjc.a]
if { $libobjc_dir != "" } {
+ set objc_include_dir "${srcdir}/../../libobjc"
+ lappend options "additional_flags=-I${objc_include_dir}"
set libobjc_dir [file dirname ${libobjc_dir}]
set objc_link_flags "-L${libobjc_dir}"
lappend options "additional_flags=${objc_link_flags}"
diff --git a/gcc/testsuite/objc.dg/anon-1.m b/gcc/testsuite/objc.dg/anon-1.m
new file mode 100644
index 00000000000..5f10f7d6026
--- /dev/null
+++ b/gcc/testsuite/objc.dg/anon-1.m
@@ -0,0 +1,14 @@
+/* Test for graceful handling of anonymous ivars. */
+/* { dg-do compile } */
+
+@interface Foo {
+ unsigned char : 1;
+ int e: 3;
+ signed: 2;
+ float f;
+}
+@end
+
+@implementation Foo
+@end
+
diff --git a/gcc/testsuite/objc.dg/bitfield-2.m b/gcc/testsuite/objc.dg/bitfield-2.m
index 0a401dd6afa..83b31748371 100644
--- a/gcc/testsuite/objc.dg/bitfield-2.m
+++ b/gcc/testsuite/objc.dg/bitfield-2.m
@@ -2,7 +2,7 @@
the NeXT runtime is used. */
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-options "-fnext-runtime -fsigned-char" } */
-/* { dg-do run } */
+/* { dg-do run { target *-*-darwin* } } */
struct objc_object { struct objc_class *class_pointer; } *id;
diff --git a/gcc/testsuite/objc.dg/bitfield-3.m b/gcc/testsuite/objc.dg/bitfield-3.m
new file mode 100644
index 00000000000..f427a3018ad
--- /dev/null
+++ b/gcc/testsuite/objc.dg/bitfield-3.m
@@ -0,0 +1,50 @@
+/* Check if the @defs() construct preserves the correct
+ layout of bitfields. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-lobjc -Wpadded" } */
+/* { dg-do run } */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+extern void abort(void);
+extern int strcmp(const char *str1, const char *str2);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+enum Enum { one, two, three, four };
+
+@interface Base: Object {
+ unsigned a: 2;
+ int b: 3;
+ enum Enum c: 4;
+ unsigned d: 5;
+} /* { dg-warning "padding struct size to alignment boundary" } */
+@end
+
+@interface Derived: Base {
+ signed e: 5;
+ int f: 4;
+ enum Enum g: 3;
+} /* { dg-warning "padding struct size to alignment boundary" } */
+@end
+
+/* Note that the semicolon after @defs(...) is optional. */
+
+typedef struct { @defs(Base) } Base_t; /* { dg-warning "padding struct size to alignment boundary" } */
+typedef struct { @defs(Derived); } Derived_t; /* { dg-warning "padding struct size to alignment boundary" } */
+
+int main(void)
+{
+ CHECK_IF(sizeof(Base_t) == sizeof(Base));
+ CHECK_IF(sizeof(Derived_t) == sizeof(Derived));
+
+#ifdef __NEXT_RUNTIME__
+ CHECK_IF(!strcmp(@encode(Base), "{Base=#b2b3b4b5}"));
+ CHECK_IF(!strcmp(@encode(Derived), "{Derived=#b2b3b4b5b5b4b3}"));
+
+ CHECK_IF(!strcmp(@encode(Base_t), "{?=#b2b3b4b5}"));
+ CHECK_IF(!strcmp(@encode(Derived_t), "{?=#b2b3b4b5b5b4b3}"));
+#endif /* __NEXT_RUNTIME__ */
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/bitfield-4.m b/gcc/testsuite/objc.dg/bitfield-4.m
new file mode 100644
index 00000000000..858bac2b003
--- /dev/null
+++ b/gcc/testsuite/objc.dg/bitfield-4.m
@@ -0,0 +1,29 @@
+/* Make sure that bitfield types are printed correctly, and that ivar redeclaration
+ (@interface vs. @implementation) checks take the bitfield width into account. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+@interface Base {
+ int i;
+}
+@end
+
+@interface WithBitfields: Base {
+ void *isa;
+ unsigned a: 3;
+ signed b: 4;
+ int c: 5;
+}
+@end
+
+@implementation WithBitfields {
+ char *isa; /* { dg-error "conflicting instance variable type .char \\*isa." } */
+ /* { dg-error "previous declaration of .void \\*isa." "" { target *-*-* } 12 } */
+ unsigned a: 5; /* { dg-error "conflicting instance variable type .unsigned a: 5." } */
+ /* { dg-error "previous declaration of .unsigned a: 3." "" { target *-*-* } 13 } */
+ signed b: 4; /* This one is fine. */
+ int c: 3; /* { dg-error "conflicting instance variable type .int c: 3." } */
+ /* { dg-error "previous declaration of .int c: 5." "" { target *-*-* } 15 } */
+}
+@end
+
diff --git a/gcc/testsuite/objc.dg/call-super-1.m b/gcc/testsuite/objc.dg/call-super-1.m
new file mode 100644
index 00000000000..19e0d4900dd
--- /dev/null
+++ b/gcc/testsuite/objc.dg/call-super-1.m
@@ -0,0 +1,76 @@
+/* Check if objc_super stack variables are created correctly (and
+ not clobbered by other values). */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-std=c99 -lobjc" } */
+/* { dg-do run } */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+extern void abort(void);
+
+#define CHECK_IF(expr) if(!(expr)) abort();
+
+typedef struct _Point {
+ float x;
+ float y;
+} Point;
+
+Point MakePoint ( float x , float y ) {
+ Point p;
+ p.x = x;
+ p.y = y;
+ return p;
+}
+
+@interface Base: Object
+- ( void ) translateOriginToPoint : ( Point ) translation ;
+@end
+
+@interface Derived : Base
+- ( void ) scrollToPoint : ( Point ) newOrigin ;
+- ( void ) translateOriginToPoint : ( Point ) translation ;
+@end
+
+int blort;
+float result;
+
+@implementation Base
+- ( void ) translateOriginToPoint : ( Point ) translation {
+ result = translation.x + translation.y;
+}
+@end
+
+@implementation Derived
+- ( void ) scrollToPoint : ( Point ) newOrigin {
+ float transDeltaX =newOrigin.x, transDeltaY =newOrigin.y ;
+ Point w;
+ if ( ! blort ) {
+ w.x = transDeltaX ; w.y = transDeltaY ;
+ [ super translateOriginToPoint : w ] ;
+ return;
+ }
+ [ super translateOriginToPoint : MakePoint ( transDeltaX , transDeltaY ) ] ;
+ return;
+}
+- (void) translateOriginToPoint : ( Point ) translation {
+ /* This should never be called. */
+ CHECK_IF(0);
+}
+@end
+
+int main(void) {
+ Derived *v = [Derived new];
+ float r0 = 1.5 + 1.5;
+ blort = 1;
+ [v scrollToPoint: MakePoint(1.5, 1.5)];
+ CHECK_IF(result == r0);
+ blort = 0;
+ [v scrollToPoint: MakePoint(1.5, 1.5)];
+ CHECK_IF(result == r0);
+ blort = 1;
+ [v scrollToPoint: MakePoint(1.5, 1.5)];
+ CHECK_IF(result == r0);
+ [v free];
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/call-super-2.m b/gcc/testsuite/objc.dg/call-super-2.m
new file mode 100644
index 00000000000..cd7db41bffe
--- /dev/null
+++ b/gcc/testsuite/objc.dg/call-super-2.m
@@ -0,0 +1,139 @@
+/* Check if casting 'self' or 'super' affects message lookup in the
+ correct way. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+#ifdef __NEXT_RUNTIME__
+#define OBJC_GETCLASS objc_getClass
+#else
+#define OBJC_GETCLASS objc_get_class
+#endif
+
+@protocol Func
++ (int) class_func0;
+- (int) instance_func0;
+@end
+
+@interface Derived: Object
++ (int) class_func1;
++ (int) class_func2;
++ (int) class_func3;
++ (int) class_func4;
++ (int) class_func5;
++ (int) class_func6;
++ (int) class_func7;
+- (int) instance_func1;
+- (int) instance_func2;
+- (int) instance_func3;
+- (int) instance_func4;
+- (int) instance_func5;
+- (int) instance_func6;
+- (int) instance_func7;
+@end
+
+@interface Derived (Categ)
++ (int) categ_class_func1;
++ (int) categ_class_func2;
+- (int) categ_instance_func1;
+- (int) categ_instance_func2;
+@end
+
+@implementation Derived
++ (int) class_func1
+{
+ int i = (int)[self class_func0]; /* { dg-warning ".Derived. may not respond to .\\+class_func0." } */
+ /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 47 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 47 } */
+ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 47 } */
+ return i + (int)[super class_func0]; /* { dg-warning ".Object. may not respond to .\\+class_func0." } */
+}
++ (int) class_func2
+{
+ int i = [(id <Func>)self class_func0];
+ return i + [(id <Func>)super class_func0];
+}
++ (int) class_func3
+{
+ return [(Object <Func> *)super class_func0];
+}
++ (int) class_func4
+{
+ return [(Derived <Func> *)super class_func0];
+}
++ (int) class_func5
+{
+ int i = (int)[Derived class_func0]; /* { dg-warning ".Derived. may not respond to .\\+class_func0." } */
+ return i + (int)[Object class_func0]; /* { dg-warning ".Object. may not respond to .\\+class_func0." } */
+}
++ (int) class_func6
+{
+ return (int)[OBJC_GETCLASS("Object") class_func1]; /* { dg-warning ".Object. may not respond to .\\+class_func1." } */
+}
++ (int) class_func7
+{
+ return [OBJC_GETCLASS("Derived") class_func1];
+}
+- (int) instance_func1
+{
+ int i = (int)[self instance_func0]; /* { dg-warning ".Derived. may not respond to .\\-instance_func0." } */
+ return i + (int)[super instance_func0]; /* { dg-warning ".Object. may not respond to .\\-instance_func0." } */
+}
+- (int) instance_func2
+{
+ return [(id <Func>)super instance_func0];
+}
+- (int) instance_func3
+{
+ return [(Object <Func> *)super instance_func0];
+}
+- (int) instance_func4
+{
+ return [(Derived <Func> *)super instance_func0];
+}
+- (int) instance_func5
+{
+ int i = (int)[Derived instance_func1]; /* { dg-warning ".Derived. may not respond to .\\+instance_func1." } */
+ return i + (int)[Object instance_func1]; /* { dg-warning ".Object. may not respond to .\\+instance_func1." } */
+}
+- (int) instance_func6
+{
+ return (int)[OBJC_GETCLASS("Object") class_func1]; /* { dg-warning ".Object. may not respond to .\\+class_func1." } */
+}
+- (int) instance_func7
+{
+ return [OBJC_GETCLASS("Derived") class_func1];
+}
+@end
+
+@implementation Derived (Categ)
++ (int) categ_class_func1
+{
+ int i = (int)[self class_func0]; /* { dg-warning ".Derived. may not respond to .\\+class_func0." } */
+ i += [self class_func1];
+ i += [self categ_class_func2];
+ i += (int)[self categ_instance_func1]; /* { dg-warning ".Derived. may not respond to .\\+categ_instance_func1." } */
+ return i + (int)[super class_func0]; /* { dg-warning ".Object. may not respond to .\\+class_func0." } */
+}
++ (int) categ_class_func2
+{
+ int i = [(id <Func>)self class_func0];
+ return i + [(id <Func>)super class_func0];
+}
+- (int) categ_instance_func1
+{
+ int i = (int)[self instance_func0]; /* { dg-warning ".Derived. may not respond to .\\-instance_func0." } */
+ i += [(Derived <Func> *)self categ_instance_func2];
+ i += (int)[(Object <Func> *)self categ_instance_func2]; /* { dg-warning ".Object. may not respond to .\\-categ_instance_func2." } */
+ /* { dg-warning ".\\-categ_instance_func2. not implemented by protocol" "" { target *-*-* } 129 } */
+ i += (int)[(id <Func>)self categ_instance_func2]; /* { dg-warning ".\\-categ_instance_func2. not implemented by protocol" } */
+ i += [(id)self categ_instance_func2];
+ return i + (int)[super instance_func0]; /* { dg-warning ".Object. may not respond to .\\-instance_func0." } */
+}
+- (int) categ_instance_func2
+{
+ return [(id <Func>)super instance_func0];
+}
+@end
diff --git a/gcc/testsuite/objc.dg/call-super-3.m b/gcc/testsuite/objc.dg/call-super-3.m
new file mode 100644
index 00000000000..05b6233ff5f
--- /dev/null
+++ b/gcc/testsuite/objc.dg/call-super-3.m
@@ -0,0 +1,54 @@
+/* Check if sending messages to super does not interfere with sending messages
+ to classes. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+/* { dg-options "-lobjc" } */
+
+#include <objc/Object.h>
+
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface Base: Object
++ (int) class_func1;
+- (int) instance_func1;
+@end
+
+@interface Derived: Base
++ (int) class_func1;
+@end
+
+@interface Derived (Categ)
+- (int) instance_func1;
+@end
+
+@implementation Base
++ (int) class_func1 { return 234; }
+- (int) instance_func1 { return 345; }
+@end
+
+@implementation Derived
++ (int) class_func1 {
+ int i = [super class_func1];
+ i += [Base class_func1];
+ return i;
+}
+@end
+
+@implementation Derived (Categ)
+- (int) instance_func1 {
+ int i = [super instance_func1];
+ i += [Base class_func1]; /* { dg-bogus "invalid receiver type" } */
+ return i;
+}
+@end
+
+int main(void) {
+ Base *base = [[Base alloc] init]; /* { dg-bogus "invalid receiver type" } */
+ Derived *derived = [[Derived alloc] init];
+ CHECK_IF([Base class_func1] == 234); /* { dg-bogus "invalid receiver type" } */
+ CHECK_IF([Derived class_func1] == 234 + 234);
+ CHECK_IF([base instance_func1] == 345);
+ CHECK_IF([derived instance_func1] == 234 + 345);
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/category-1.m b/gcc/testsuite/objc.dg/category-1.m
new file mode 100644
index 00000000000..1d29e374aea
--- /dev/null
+++ b/gcc/testsuite/objc.dg/category-1.m
@@ -0,0 +1,43 @@
+/* Test class methods inside categories. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-lobjc" } */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+
+#ifdef __NEXT_RUNTIME__
+#define SUPERCLASS superclass
+#else
+#define SUPERCLASS superClass
+#endif
+
+extern int strcmp(const char *s1, const char *s2);
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface MyObject: Object
++ (Class)whatever1;
+@end
+
+@implementation MyObject
++ (Class)whatever1 { return [super SUPERCLASS]; }
+@end
+
+@interface MyObject (ThisWontCompile)
++(Class)whatever2;
+@end
+
+@implementation MyObject (ThisWontCompile)
++(Class)whatever2 { return [super SUPERCLASS]; }
+@end
+
+int main (int argc, const char * argv[])
+{
+ Class w1 = [MyObject whatever1];
+ Class w2 = [MyObject whatever2];
+
+ CHECK_IF(!strcmp(w1->name, "Object"));
+ CHECK_IF(!strcmp(w2->name, "Object"));
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc.dg/class-2.m b/gcc/testsuite/objc.dg/class-2.m
index a4514f9290a..b98d117f54c 100644
--- a/gcc/testsuite/objc.dg/class-2.m
+++ b/gcc/testsuite/objc.dg/class-2.m
@@ -10,6 +10,5 @@
@interface class1 : supclass1
@end
-@implementation class1 : supclass2
-@end /* { dg-error "conflicting super class name" } */
-/* { dg-error "previous declaration" "" { target *-*-* } 14 } */
+@implementation class1 : supclass2 /* { dg-error "conflicting super class name" } */
+@end /* { dg-error "previous declaration" "" { target *-*-* } 13 } */
diff --git a/gcc/testsuite/objc.dg/comp-types-1.m b/gcc/testsuite/objc.dg/comp-types-1.m
index 74943860b2d..310b22634c0 100644
--- a/gcc/testsuite/objc.dg/comp-types-1.m
+++ b/gcc/testsuite/objc.dg/comp-types-1.m
@@ -41,7 +41,7 @@ int main()
MyProtocol), but not from an 'id' or from a 'MyOtherClass *'
(which implements MyProtocol). */
obj_p = obj; /* Ok */
- obj_p = obj_c; /* { dg-warning "does not implement" } */ /*FIXME: Duplicated*/
+ obj_p = obj_c; /* { dg-warning "does not implement" } */
obj_p = obj_cp; /* Ok */
obj_p = obj_C; /* { dg-warning "incompatible pointer type" } */
diff --git a/gcc/testsuite/objc.dg/comp-types-4.m b/gcc/testsuite/objc.dg/comp-types-4.m
index e07780485ee..f15390a38d3 100644
--- a/gcc/testsuite/objc.dg/comp-types-4.m
+++ b/gcc/testsuite/objc.dg/comp-types-4.m
@@ -3,6 +3,11 @@
/* { dg-do compile } */
#include <objc/objc.h>
+/* The NeXT runtime headers do not define NULL. */
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
@protocol MyProtocol
- (void) method;
@end
diff --git a/gcc/testsuite/objc.dg/const-str-1.m b/gcc/testsuite/objc.dg/const-str-1.m
index 145c1b31e84..e4cac2e57ec 100644
--- a/gcc/testsuite/objc.dg/const-str-1.m
+++ b/gcc/testsuite/objc.dg/const-str-1.m
@@ -2,12 +2,21 @@
/* { dg-do compile } */
/* { dg-options "-fgnu-runtime" } */
+#ifdef __cplusplus
+extern void baz(...);
+#endif
+
void foo()
{
baz(@"hiya"); /* { dg-error "annot find interface declaration" } */
}
@interface NXConstantString
+{
+ void *isa;
+ char *str;
+ int len;
+}
@end
void bar()
diff --git a/gcc/testsuite/objc.dg/const-str-3.m b/gcc/testsuite/objc.dg/const-str-3.m
new file mode 100644
index 00000000000..edc03ff62c7
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-str-3.m
@@ -0,0 +1,46 @@
+/* Test the -fconstant-string-class=Foo option under the NeXT
+ runtime. */
+/* Developed by Markus Hitter <mah@jump-ing.de>. */
+
+/* { dg-options "-fnext-runtime -fconstant-string-class=Foo -lobjc" } */
+/* { dg-do run { target *-*-darwin* } } */
+
+#include <stdio.h>
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+@interface Foo: Object {
+ char *cString;
+ unsigned int len;
+}
+- (char *)customString;
+@end
+
+struct objc_class _FooClassReference;
+
+@implementation Foo : Object
+- (char *)customString {
+ return cString;
+}
+@end
+
+int main () {
+ Foo *string = @"bla";
+ Foo *string2 = @"bla";
+
+ if(string != string2)
+ abort();
+ printf("Strings are being uniqued properly\n");
+
+ /* This memcpy has to be done before the first message is sent to a
+ constant string object. Can't be moved to +initialize since _that_
+ is already a message. */
+
+ memcpy(&_FooClassReference, objc_getClass("Foo"), sizeof(_FooClassReference));
+ if (strcmp ([string customString], "bla")) {
+ abort ();
+ }
+
+ printf([@"This is a working constant string object\n" customString]);
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/const-str-4.m b/gcc/testsuite/objc.dg/const-str-4.m
new file mode 100644
index 00000000000..c178bfc4a0c
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-str-4.m
@@ -0,0 +1,31 @@
+/* Ensure that the preprocessor handles ObjC string constants gracefully. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-options "-fnext-runtime -fconstant-string-class=MyString -lobjc" } */
+/* { dg-do run { target *-*-darwin* } } */
+
+extern void abort(void);
+
+@interface MyString
+{
+ void *isa;
+ char *str;
+ int len;
+}
+@end
+
+#define kMyStringMacro1 "My String"
+#define kMyStringMacro2 @"My String"
+
+void *_MyStringClassReference;
+
+@implementation MyString
+@end
+
+int main(void) {
+ MyString* aString1 = @kMyStringMacro1;
+ MyString* aString2 = kMyStringMacro2;
+ if(aString1 != aString2) {
+ abort();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/const-str-5.m b/gcc/testsuite/objc.dg/const-str-5.m
new file mode 100644
index 00000000000..186edcfceb2
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-str-5.m
@@ -0,0 +1,27 @@
+/* Positive test case for constant string layout. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-options "-fconstant-string-class=MyConstantString" } */
+/* { dg-do compile } */
+
+@interface MyBase {
+ const char *p;
+}
+@end
+
+@interface MyConstantString: MyBase {
+ union {
+ void *u;
+ unsigned char *c;
+ } _contents;
+ unsigned int _count;
+}
+@end
+
+/* The NeXT runtime initializes the 'isa' pointer of string constants at
+ compile time. */
+#ifdef __NEXT_RUNTIME__
+extern void *_MyConstantStringClassReference;
+#endif
+
+MyConstantString *str = @"Hello";
diff --git a/gcc/testsuite/objc.dg/const-str-6.m b/gcc/testsuite/objc.dg/const-str-6.m
new file mode 100644
index 00000000000..a7cbbf7141a
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-str-6.m
@@ -0,0 +1,27 @@
+/* Negative test case for constant string layout. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-options "-fconstant-string-class=MyConstantString" } */
+/* { dg-do compile } */
+
+@interface MyBase {
+ char p;
+}
+@end
+
+@interface MyConstantString: MyBase {
+ union {
+ void *u;
+ unsigned char *c;
+ } _contents;
+ char _count;
+}
+@end
+
+/* The NeXT runtime initializes the 'isa' pointer of string constants at
+ compile time. */
+#ifdef __NEXT_RUNTIME__
+extern void *_MyConstantStringClassReference;
+#endif
+
+MyConstantString *str = @"Hello"; /* { dg-error "interface .MyConstantString. does not have valid constant string layout" } */
diff --git a/gcc/testsuite/objc.dg/desig-init-1.m b/gcc/testsuite/objc.dg/desig-init-1.m
index 72fe8330960..44abe440d7b 100644
--- a/gcc/testsuite/objc.dg/desig-init-1.m
+++ b/gcc/testsuite/objc.dg/desig-init-1.m
@@ -22,7 +22,10 @@
0,
[Cls meth1],
[2 + 1] = 3,
- [2 * 2 ... 5] = [0 meth2], /* { dg-warning "invalid receiver type" } */
+ [2 * 2 ... 5] = (int)[0 meth2], /* { dg-warning "invalid receiver type" } */
+ /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 25 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 25 } */
+ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 25 } */
[2] [Cls meth2]
};
diff --git a/gcc/testsuite/objc.dg/encode-1.m b/gcc/testsuite/objc.dg/encode-1.m
new file mode 100644
index 00000000000..868c3254753
--- /dev/null
+++ b/gcc/testsuite/objc.dg/encode-1.m
@@ -0,0 +1,25 @@
+/* Test if the Objective-C @encode machinery distinguishes between
+ 'BOOL *' (which should be encoded as a pointer to BOOL) and 'char *' (which
+ should be encoded as '*'). This is somewhat tricky wrt the NeXT runtime,
+ where we have 'typedef char BOOL'. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-fnext-runtime -lobjc" } */
+/* { dg-do run } */
+
+#include <string.h>
+#include <stdlib.h>
+#include <objc/objc.h>
+
+int main(void) {
+ const char *BOOL_ptr = @encode(BOOL *);
+ const char *BOOL_ = @encode(BOOL);
+ const char *char_ptr = @encode(char *);
+
+ if(*BOOL_ptr != '^' || strcmp(BOOL_ptr + 1, BOOL_))
+ abort();
+
+ if(strcmp(char_ptr, "*"))
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/encode-2.m b/gcc/testsuite/objc.dg/encode-2.m
new file mode 100644
index 00000000000..ebfd8d3fa2d
--- /dev/null
+++ b/gcc/testsuite/objc.dg/encode-2.m
@@ -0,0 +1,97 @@
+/* Test Objective-C method encodings. */
+
+/* The _encoded_ parameter offsets for Objective-C methods are
+ computed inductively as follows:
+ - The first paramter (self) has offset 0;
+ - The k-th parameter (k > 1) has offset equal to the
+ sum of:
+ - the offset of the k-1-st paramter
+ - the int-promoted size of the k-1-st parameter.
+
+ Note that the encoded offsets need not correspond
+ to the actual placement of parameters (relative to 'self')
+ on the stack! Your target's ABI may have very different
+ opinions on the matter. */
+
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+#ifdef __NEXT_RUNTIME__
+#define METHOD Method
+#define OBJC_GETCLASS objc_getClass
+#define CLASS_GETINSTANCEMETHOD class_getInstanceMethod
+#else
+#include <objc/objc-api.h>
+#define METHOD Method_t
+#define OBJC_GETCLASS objc_get_class
+#define CLASS_GETINSTANCEMETHOD class_get_instance_method
+#endif
+
+extern int sscanf(const char *str, const char *format, ...);
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface Foo: Object
+typedef struct { float x, y; } XXPoint;
+typedef struct { float width, height; } XXSize;
+typedef struct _XXRect { XXPoint origin; XXSize size; } XXRect;
+-(id)setRect:(XXRect)r withInt:(int)i;
+-(void) char:(char)c float:(float)f double:(double)d long:(long)l;
+@end
+
+XXRect my_rect;
+unsigned offs1, offs2, offs3, offs4, offs5, offs6, offs7;
+
+@implementation Foo
+-(id)setRect:(XXRect)r withInt:(int)i {
+ unsigned offs = sizeof(self);
+ CHECK_IF(offs == offs3);
+ offs += sizeof(_cmd);
+ CHECK_IF(offs == offs4);
+ offs += sizeof(r);
+ CHECK_IF(offs == offs5);
+ offs += sizeof(i);
+ CHECK_IF(offs == offs1);
+ return nil;
+}
+-(void) char:(char)c float:(float)f double:(double)d long:(long)l {
+ unsigned offs = sizeof(self);
+ CHECK_IF(offs == offs3);
+ offs += sizeof(_cmd);
+ CHECK_IF(offs == offs4);
+ offs += sizeof((int)c);
+ CHECK_IF(offs == offs5);
+ offs += sizeof(f);
+ CHECK_IF(offs == offs6);
+ offs += sizeof(d);
+ CHECK_IF(offs == offs7);
+ offs += sizeof(l);
+ CHECK_IF(offs == offs1);
+}
+@end
+
+
+int main(void) {
+ Foo *foo = [[Foo alloc] init];
+ Class fooClass = OBJC_GETCLASS("Foo");
+ METHOD meth;
+
+ meth = CLASS_GETINSTANCEMETHOD(fooClass, @selector(setRect:withInt:));
+ offs2 = 9999;
+ sscanf(meth->method_types, "@%u@%u:%u{_XXRect={?=ff}{?=ff}}%ui%u", &offs1, &offs2, &offs3,
+ &offs4, &offs5);
+ CHECK_IF(!offs2);
+ [foo setRect:my_rect withInt:123];
+
+ meth = CLASS_GETINSTANCEMETHOD(fooClass, @selector(char:float:double:long:));
+ offs2 = 9999;
+ sscanf(meth->method_types, "v%u@%u:%uc%uf%ud%ul%u", &offs1, &offs2, &offs3,
+ &offs4, &offs5, &offs6, &offs7);
+ CHECK_IF(!offs2);
+ [foo char:'c' float:2.3 double:3.5 long:2345L];
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/encode-3.m b/gcc/testsuite/objc.dg/encode-3.m
new file mode 100644
index 00000000000..b30b956b157
--- /dev/null
+++ b/gcc/testsuite/objc.dg/encode-3.m
@@ -0,0 +1,66 @@
+/* Method encoding tests for stand-alone @protocol declarations. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+
+#include <objc/Protocol.h>
+#ifdef __cplusplus
+#define ProtoBool bool
+#else
+#define ProtoBool _Bool
+#endif
+
+#ifndef __NEXT_RUNTIME__
+#include <objc/objc-api.h>
+#endif
+
+extern int sscanf(const char *str, const char *format, ...);
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+enum Enum {
+ zero, one, two, three
+};
+typedef enum Enum Enum;
+typedef signed char ObjCBool; /* as used by the NeXT runtime */
+
+@protocol Proto
+union __XXAngle { unsigned int alpha, beta; };
+typedef struct { float x, y; union __XXAngle a; } XXPoint;
+typedef struct { double width, height; } XXSize;
+typedef struct _XXRect { XXPoint origin; XXSize size; struct _XXRect *next; } XXRect;
+- (void) char:(char)c float:(float)f double:(double)d unsigned:(unsigned)u short:(short)s long:(long)l;
+- (void *)setRect:(XXRect)r withBool:(ProtoBool)b withInt:(int)i;
++ (Enum *)getEnum:(XXPoint *)pt enum:(enum Enum)e bool:(ObjCBool)b;
++ (ProtoBool **)getBool:(ObjCBool **)b;
+@end
+
+Protocol *proto = @protocol(Proto);
+struct objc_method_description *meth;
+unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7;
+
+static void scan_initial(const char *pattern) {
+ totsize = offs0 = offs1 = offs2 = offs3 = offs4 = offs5 = offs6 = offs7 = (unsigned)-1;
+ sscanf(meth->types, pattern, &totsize, &offs0, &offs1, &offs2, &offs3,
+ &offs4, &offs5, &offs6, &offs7);
+ CHECK_IF(!offs0 && offs1 == sizeof(id) && offs2 == offs1 + sizeof(SEL) && totsize >= offs2);
+}
+
+int main(void) {
+ meth = [proto descriptionForInstanceMethod: @selector(char:float:double:unsigned:short:long:)];
+ scan_initial("v%u@%u:%uc%uf%ud%uI%us%ul%u");
+ CHECK_IF(offs3 == offs2 + sizeof(int) && offs4 == offs3 + sizeof(float));
+ CHECK_IF(offs5 == offs4 + sizeof(double) && offs6 == offs5 + sizeof(unsigned));
+ CHECK_IF(offs7 == offs6 + sizeof(int) && totsize == offs7 + sizeof(long));
+ meth = [proto descriptionForInstanceMethod: @selector(setRect:withBool:withInt:)];
+ scan_initial("^v%u@%u:%u{_XXRect={?=ff(__XXAngle=II)}{?=dd}^{_XXRect}}%uB%ui%u");
+ CHECK_IF(offs3 == offs2 + sizeof(XXRect) && offs4 == offs3 + sizeof(int));
+ CHECK_IF(totsize == offs4 + sizeof(int));
+ meth = [proto descriptionForClassMethod: @selector(getEnum:enum:bool:)];
+ scan_initial("^i%u@%u:%u^{?=ff(__XXAngle=II)}%ui%uc%u");
+ CHECK_IF(offs3 == offs2 + sizeof(XXPoint *) && offs4 == offs3 + sizeof(enum Enum));
+ CHECK_IF(totsize == offs4 + sizeof(int)); /* 'ObjCBool' is really 'char' */
+ meth = [proto descriptionForClassMethod: @selector(getBool:)];
+ scan_initial("^^B%u@%u:%u^*%u");
+ CHECK_IF(totsize == offs2 + sizeof(ObjCBool **));
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/encode-4.m b/gcc/testsuite/objc.dg/encode-4.m
new file mode 100644
index 00000000000..1f179e1dad5
--- /dev/null
+++ b/gcc/testsuite/objc.dg/encode-4.m
@@ -0,0 +1,73 @@
+/* Encoding tests for ObjC class layouts. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-lobjc" } */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#ifdef __NEXT_RUNTIME__
+#include <objc/objc-class.h>
+#define OBJC_GETCLASS objc_getClass
+#else
+#include <objc/objc-api.h>
+#define OBJC_GETCLASS objc_get_class
+#endif
+
+extern void abort(void);
+extern int strcmp(const char *s1, const char *s2);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@class Int1, Int2;
+struct Nested;
+
+struct Innermost {
+ unsigned char a, b;
+ struct Nested *encl;
+};
+
+struct Nested {
+ float a, b;
+ Int1 *next;
+ struct Innermost innermost;
+};
+
+@interface Int1: Object {
+ char a, b;
+ Int2 *int2;
+ struct Nested nested;
+}
+@end
+
+@interface Int2: Int1 {
+ struct Innermost *innermost;
+ Int1 *base;
+}
+@end
+
+@implementation Int1
+@end
+
+@implementation Int2
+@end
+
+struct objc_ivar *ivar;
+
+static void check_ivar(const char *name, const char *type) {
+ CHECK_IF(!strcmp(ivar->ivar_name, name));
+ CHECK_IF(!strcmp(ivar->ivar_type, type));
+ ivar++;
+}
+
+int main(void) {
+ ivar = ((Class)OBJC_GETCLASS("Int1"))->ivars->ivar_list;
+ check_ivar("a", "c");
+ check_ivar("b", "c");
+ check_ivar("int2", "@\"Int2\"");
+ check_ivar("nested",
+ "{Nested=\"a\"f\"b\"f\"next\"@\"Int1\"\"innermost\"{Innermost=\"a\"C\"b\"C\"encl\"^{Nested}}}");
+
+ ivar = ((Class)OBJC_GETCLASS("Int2"))->ivars->ivar_list;
+ check_ivar("innermost", "^{Innermost=CC^{Nested}}");
+ check_ivar("base", "@\"Int1\"");
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/func-ptr-1.m b/gcc/testsuite/objc.dg/func-ptr-1.m
new file mode 100644
index 00000000000..015d3ac292d
--- /dev/null
+++ b/gcc/testsuite/objc.dg/func-ptr-1.m
@@ -0,0 +1,48 @@
+/* Test for handling of function pointer ivars */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+
+extern int strcmp(const char *, const char *);
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+typedef float (*floatfunc)(float, float);
+
+@interface MyObject : Object
+{
+@public
+ int (*ivar)(int, int, int);
+ floatfunc ffunc;
+}
+- init;
+@end
+
+int foo(int a, int b, int c) {
+ return a + b + c;
+}
+
+float bar(float a, float b) {
+ return a * b;
+}
+
+@implementation MyObject
+- init {
+ [super init];
+ ivar = foo;
+ ffunc = bar;
+ return self;
+}
+@end
+
+int main ()
+{
+ MyObject *obj = [[MyObject alloc] init];
+ const char *enc = @encode(MyObject);
+
+ CHECK_IF(obj->ivar(4, 5, 6) == 15);
+ CHECK_IF(obj->ffunc(34.0, 45.0) == 34.0 * 45.0);
+ CHECK_IF(!strcmp(enc, "{MyObject=#^?^?}"));
+ return(0);
+}
+
diff --git a/gcc/testsuite/objc.dg/gnu-runtime-1.m b/gcc/testsuite/objc.dg/gnu-runtime-1.m
new file mode 100644
index 00000000000..dab921554f1
--- /dev/null
+++ b/gcc/testsuite/objc.dg/gnu-runtime-1.m
@@ -0,0 +1,19 @@
+/* Test that compiling for the GNU runtime works (regardless of
+ the system runtime used). */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-fgnu-runtime" } */
+
+#include <objc/Object.h>
+
+@interface FooBar: Object
+- (void)boo;
+@end
+
+int main ()
+{
+ id fooBarInst = [[FooBar alloc] init];
+ [fooBarInst boo];
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc.dg/headers.m b/gcc/testsuite/objc.dg/headers.m
index 5435a75deee..4c61e1e5524 100644
--- a/gcc/testsuite/objc.dg/headers.m
+++ b/gcc/testsuite/objc.dg/headers.m
@@ -3,14 +3,29 @@
// { dg-options "-Wall -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wshadow" }
// { dg-do compile }
+#ifdef __NEXT_RUNTIME__
+#include <Foundation/NSString.h>
+#else
#include <objc/NXConstStr.h>
+#endif
#include <objc/Object.h>
#include <objc/Protocol.h>
+#ifdef __NEXT_RUNTIME__
+#include <objc/objc-runtime.h>
+#else
#include <objc/encoding.h>
#include <objc/hash.h>
+#endif
+
#include <objc/objc-api.h>
+#ifndef __NEXT_RUNTIME__
#include <objc/objc-list.h>
+#endif
+
#include <objc/objc.h>
+
+#ifndef __NEXT_RUNTIME__
#include <objc/sarray.h>
#include <objc/thr.h>
#include <objc/typedstream.h>
+#endif
diff --git a/gcc/testsuite/objc.dg/image-info.m b/gcc/testsuite/objc.dg/image-info.m
new file mode 100644
index 00000000000..84e6ad8d0e2
--- /dev/null
+++ b/gcc/testsuite/objc.dg/image-info.m
@@ -0,0 +1,38 @@
+/* Check if the '-freplace-objc-classes' option causes the
+ __OBJC,__image_info section to be emitted. This is only
+ usable on MacOS X 10.3 and later. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-freplace-objc-classes" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+#ifndef __NEXT_RUNTIME__
+#error Feature not currently supported by the GNU runtime
+#endif
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+extern void abort(void);
+
+#define CHECK_IF(expr) if(!(expr)) abort();
+
+@interface Base: Object {
+@public
+ int a;
+ float b;
+ char c;
+}
+- init;
+@end
+
+@implementation Base
+- init {
+ [super init];
+ a = 123;
+ b = 1.23;
+ c = 'c';
+ return self;
+}
+@end
+
+/* { dg-final { scan-assembler "\n.data\n.section __OBJC, __image_info\n\t.align.*\nL_OBJC_IMAGE_INFO:\n\t.long\t0\n\t.long\t1\n.data\n.objc_module_info\n" } } */
diff --git a/gcc/testsuite/objc.dg/method-1.m b/gcc/testsuite/objc.dg/method-1.m
index 8b761c65a28..391ee629c70 100644
--- a/gcc/testsuite/objc.dg/method-1.m
+++ b/gcc/testsuite/objc.dg/method-1.m
@@ -3,12 +3,12 @@
@interface class1
- (int) meth1;
-- (void) meth1; /* { dg-error "duplicate declaration of instance method" } */
+- (void) meth1; /* { dg-error "duplicate declaration of method .\\-meth1." } */
@end
@interface class2
+ (void) meth1;
-+ (int) meth1; /* { dg-error "duplicate declaration of class method" } */
++ (int) meth1; /* { dg-error "duplicate declaration of method .\\+meth1." } */
@end
@interface class3
@@ -17,8 +17,7 @@
@implementation class3
- (int) meth1 { return 0; }
-- (int) meth1 { return 0; } /* { dg-error "duplicate definition of instance method" } */
-/* { dg-error "redefinition of" "" { target *-*-* } 20 } */
+- (int) meth1 { return 0; } /* { dg-error "redefinition of" } */
/* { dg-error "previously defined here" "" { target *-*-* } 19 } */
@end
@@ -28,7 +27,6 @@
@implementation class4
+ (void) meth1 {}
-+ (void) meth1 {} /* { dg-error "duplicate definition of class method" } */
-/* { dg-error "redefinition of" "" { target *-*-* } 31 } */
-/* { dg-error "previously defined here" "" { target *-*-* } 30 } */
++ (void) meth1 {} /* { dg-error "redefinition of" } */
+/* { dg-error "previously defined here" "" { target *-*-* } 29 } */
@end
diff --git a/gcc/testsuite/objc.dg/method-10.m b/gcc/testsuite/objc.dg/method-10.m
new file mode 100644
index 00000000000..5a2a1db3462
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-10.m
@@ -0,0 +1,32 @@
+/* When there is only one candidate method available, make sure the
+ compiler uses its argument/return types when constructing the
+ message sends (so that proper C/C++ argument conversions may
+ take place). */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+static double d = 4.5920234e2;
+
+@interface Foo : Object
+-(void) brokenType: (int)x floatingPoint: (double)y;
+@end
+
+
+@implementation Foo
+-(void) brokenType: (int)x floatingPoint: (double)y
+{
+ CHECK_IF(x == 459);
+ CHECK_IF(y == d);
+}
+@end
+
+int main(void)
+{
+ Foo *foo=[Foo new];
+ [foo brokenType: d floatingPoint: d];
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc.dg/method-11.m b/gcc/testsuite/objc.dg/method-11.m
new file mode 100644
index 00000000000..5921292c1ba
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-11.m
@@ -0,0 +1,33 @@
+/* Ensure that we indeed cannot obtain the value of a message send
+ if the chosen method signature returns 'void'. There used to
+ exist a cheesy hack that allowed it. While at it, check that
+ the first lexically occurring method signature gets picked
+ when sending messages to 'id'. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+
+@interface Object1
+- (void)initWithData:(Object1 *)data;
+@end
+
+@interface Object2
+- (id)initWithData:(Object1 *)data;
+@end
+
+@interface Object3
+- (id)initWithData:(Object2 *)data;
+@end
+
+void foo(void) {
+ id obj1, obj2 = 0;
+ obj2 = [obj1 initWithData: obj2];
+ /* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } 25 } */
+ /* { dg-warning "using .\\-\\(void\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 12 } */
+ /* { dg-warning "also found .\\-\\(id\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 16 } */
+ /* { dg-warning "also found .\\-\\(id\\)initWithData:\\(Object2 \\*\\)data." "" { target *-*-* } 20 } */
+
+ /* The following error is a consequence of picking the "wrong" method signature. */
+ /* { dg-error "void value not ignored as it ought to be" "" { target *-*-* } 25 } */
+}
diff --git a/gcc/testsuite/objc.dg/method-12.m b/gcc/testsuite/objc.dg/method-12.m
new file mode 100644
index 00000000000..d6e6ce58a4f
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-12.m
@@ -0,0 +1,25 @@
+/* Contributed by Igor Seleznev <selez@mail.ru>. */
+/* This used to be broken. */
+
+#include <objc/objc-api.h>
+
+@interface A
++ (A *)currentContext;
+@end
+
+@interface B
++ (B *)currentContext;
+@end
+
+int main()
+{
+ [A currentContext]; /* { dg-bogus "multiple declarations" } */
+ return 0;
+}
+
+@implementation A
++ (A *)currentContext { return nil; }
+@end
+@implementation B
++ (B *)currentContext { return nil; }
+@end
diff --git a/gcc/testsuite/objc.dg/method-2.m b/gcc/testsuite/objc.dg/method-2.m
index b4cd4da6376..8bf211f8700 100644
--- a/gcc/testsuite/objc.dg/method-2.m
+++ b/gcc/testsuite/objc.dg/method-2.m
@@ -22,10 +22,11 @@
[self rootInstanceMethod]; /* class is searched for an instance method */
[MyIntermediate rootInstanceMethod]; /* with the same name. */
- [self instanceMethod]; /* { dg-warning "cannot find class" } */
- /* { dg-warning "defaults to id" "" { target *-*-* } 25 } */
- [MyDerived instanceMethod]; /* { dg-warning "cannot find class" } */
- /* { dg-warning "defaults to id" "" { target *-*-* } 27 } */
+ [self instanceMethod]; /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
+ /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 25 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 25 } */
+ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 25 } */
+ [MyDerived instanceMethod]; /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
}
@end
diff --git a/gcc/testsuite/objc.dg/method-3.m b/gcc/testsuite/objc.dg/method-3.m
new file mode 100644
index 00000000000..65031b0aa5b
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-3.m
@@ -0,0 +1,45 @@
+/* Test for sending messages to aliased classes (and instances thereof). */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-lobjc" } */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface Int1: Object
++ (int) classMeth;
+- (int) instanceMeth;
+@end
+
+@interface Int2: Object
++ (int) classMeth;
+- (int) instanceMeth;
+@end
+
+@implementation Int1
++ (int) classMeth { return 345; }
+- (int) instanceMeth { return 697; }
+@end
+
+@implementation Int2
++ (int) classMeth { return 1345; }
+- (int) instanceMeth { return 1697; }
+@end
+
+typedef Int1 Int1Typedef;
+@compatibility_alias Int1Alias Int1Typedef;
+@compatibility_alias Int2Alias Int2;
+typedef Int2Alias Int2Typedef;
+
+int main(void) {
+ Int1Alias *int1alias = [[Int1Typedef alloc] init];
+ Int2Typedef *int2typedef = [[Int2Alias alloc] init];
+
+ CHECK_IF([Int1Typedef classMeth] == 345 && [Int2Alias classMeth] == 1345);
+ CHECK_IF([int1alias instanceMeth] == 697 && [int2typedef instanceMeth] == 1697);
+ CHECK_IF([(Int2Typedef *)int1alias instanceMeth] == 697);
+ CHECK_IF([(Int1Alias *)int2typedef instanceMeth] == 1697);
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/method-4.m b/gcc/testsuite/objc.dg/method-4.m
new file mode 100644
index 00000000000..c8d092df74d
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-4.m
@@ -0,0 +1,25 @@
+/* Check if class references (generated for the NeXT runtime) are appropriately
+ folded. This test is safe to run on all targets. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-fnext-runtime" } */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+typedef Object ObjectTypedef1;
+typedef ObjectTypedef1 ObjectTypedef2;
+@compatibility_alias ObjectAlias1 ObjectTypedef2;
+@compatibility_alias ObjectAlias2 ObjectAlias1;
+typedef ObjectAlias2 ObjectTypedef3;
+
+void foo(void) {
+ id obj = [Object new];
+ obj = [ObjectTypedef1 new];
+ obj = [ObjectTypedef2 new];
+ obj = [ObjectTypedef3 new];
+ obj = [ObjectAlias1 new];
+ obj = [ObjectAlias2 new];
+}
+
+/* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
+/* { dg-final { scan-assembler-not "_OBJC_CLASS_REFERENCES_1" } } */
diff --git a/gcc/testsuite/objc.dg/method-5.m b/gcc/testsuite/objc.dg/method-5.m
new file mode 100644
index 00000000000..e2332ea8bd7
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-5.m
@@ -0,0 +1,18 @@
+/* Check if sending messages to "underspecified" objects is handled gracefully. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+@class UnderSpecified;
+typedef struct NotAClass {
+ int a, b;
+} NotAClass;
+
+void foo(UnderSpecified *u, NotAClass *n) {
+ [n nonexistent_method]; /* { dg-warning "invalid receiver type" } */
+ /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 11 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 11 } */
+ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 11 } */
+ [NotAClass nonexistent_method]; /* { dg-error ".NotAClass. is not an Objective\\-C class name or alias" } */
+ [u nonexistent_method]; /* { dg-warning ".UnderSpecified. may not respond to .\\-nonexistent_method." } */
+ [UnderSpecified nonexistent_method]; /* { dg-warning ".UnderSpecified. may not respond to .\\+nonexistent_method." } */
+}
diff --git a/gcc/testsuite/objc.dg/method-6.m b/gcc/testsuite/objc.dg/method-6.m
new file mode 100644
index 00000000000..212958b55c7
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-6.m
@@ -0,0 +1,26 @@
+/* Check that sending messages to variables of type 'Class' does not involve instance methods. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+#include <objc/Protocol.h>
+
+@interface Base
+- (unsigned)port;
+- (id)starboard;
+@end
+
+@interface Derived: Base
+- (Object *)port;
++ (Protocol *)port;
+@end
+
+id foo(void) {
+ Class receiver;
+ id p = [receiver port]; /* there should be no warnings here! */
+ p = [receiver starboard]; /* { dg-warning ".Class. may not respond to .\\+starboard." } */
+ /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 20 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 20 } */
+ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 20 } */
+ p = [Class port]; /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */
+ return p;
+}
diff --git a/gcc/testsuite/objc.dg/method-7.m b/gcc/testsuite/objc.dg/method-7.m
new file mode 100644
index 00000000000..f84759c2169
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-7.m
@@ -0,0 +1,27 @@
+/* Check if finding multiple signatures for a method is handled gracefully. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@interface Class1
+- (void)setWindow:(Object *)wdw;
+@end
+
+@interface Class2
+- (void)setWindow:(Class1 *)window;
+@end
+
+id foo(void) {
+ Object *obj = [[Object alloc] init];
+ id obj2 = obj;
+ [obj setWindow:nil]; /* { dg-warning ".Object. may not respond to .\\-setWindow:." } */
+ /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 18 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 18 } */
+ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 18 } */
+ [obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWindow:. found" } */
+ /* { dg-warning "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw." "" { target *-*-* } 8 } */
+ /* { dg-warning "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 12 } */
+
+ return obj;
+}
diff --git a/gcc/testsuite/objc.dg/method-8.m b/gcc/testsuite/objc.dg/method-8.m
new file mode 100644
index 00000000000..4a13b7d6cbb
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-8.m
@@ -0,0 +1,14 @@
+/* Check if casting the receiver type causes method lookup to succeed. This was broken
+ in Objective-C++. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+@interface A
+@end
+
+@interface B: A
+- (void)f;
+@end
+
+void g(A *p) { [(B *)p f]; }
+
diff --git a/gcc/testsuite/objc.dg/method-9.m b/gcc/testsuite/objc.dg/method-9.m
new file mode 100644
index 00000000000..ba832840062
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-9.m
@@ -0,0 +1,43 @@
+/* Check if finding multiple signatures for a method is handled gracefully
+ when method lookup succeeds (see also method-7.m). */
+/* Contributed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@protocol MyObject
+- (id)initWithData:(Object *)data;
+@end
+
+@protocol SomeOther
+- (id)initWithData:(int)data;
+@end
+
+@protocol MyCoding
+- (id)initWithData:(id<MyObject, MyCoding>)data;
+@end
+
+@interface NTGridDataObject: Object <MyCoding>
+{
+ Object<MyCoding> *_data;
+}
++ (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data;
+@end
+
+@implementation NTGridDataObject
+- (id)initWithData:(id<MyObject, MyCoding>)data {
+ return data;
+}
++ (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data
+{
+ NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data];
+ /* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } 33 } */
+ /* { dg-warning "using .\\-\\(id\\)initWithData:\\(Object \\*\\)data." "" { target *-*-* } 9 } */
+ /* { dg-warning "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } 17 } */
+ /* { dg-warning "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } 13 } */
+
+ /* The following warning is a consequence of picking the "wrong" method signature. */
+ /* { dg-warning "passing arg 1 of .initWithData:. from incompatible pointer type" "" { target *-*-* } 33 } */
+ return result;
+}
+@end
diff --git a/gcc/testsuite/objc.dg/missing-proto-1.m b/gcc/testsuite/objc.dg/missing-proto-1.m
new file mode 100644
index 00000000000..7132ead4bef
--- /dev/null
+++ b/gcc/testsuite/objc.dg/missing-proto-1.m
@@ -0,0 +1,6 @@
+/* Test for graceful handling of missing protocol declarations. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+@interface Foo <Missing> /* { dg-error "cannot find protocol declaration for .Missing." } */
+@end
diff --git a/gcc/testsuite/objc.dg/missing-proto-2.m b/gcc/testsuite/objc.dg/missing-proto-2.m
new file mode 100644
index 00000000000..cb121b496e9
--- /dev/null
+++ b/gcc/testsuite/objc.dg/missing-proto-2.m
@@ -0,0 +1,5 @@
+/* Test for graceful handling of missing protocol declarations. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+void *protRef = @protocol(Missing); /* { dg-error "cannot find protocol declaration for .Missing." } */
diff --git a/gcc/testsuite/objc.dg/missing-proto-3.m b/gcc/testsuite/objc.dg/missing-proto-3.m
new file mode 100644
index 00000000000..6c610ce35c9
--- /dev/null
+++ b/gcc/testsuite/objc.dg/missing-proto-3.m
@@ -0,0 +1,26 @@
+/* Ensure that the compiler gracefully handles missing protocol declarations.
+ In addition to not crashing :-), the compiler should properly handle
+ valid protocol references, even when they're mixed with invalid ones. */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+
+@protocol DefinedProtocol
+- (id) missingMethod1;
+@end
+
+@interface MyClass <UndefinedProtocol, DefinedProtocol>
+/* { dg-error "cannot find protocol declaration for .UndefinedProtocol." "" { target *-*-* } 12 } */
+@end
+
+@implementation MyClass
++(Class)class
+{
+ return self;
+}
+@end
+
+/* { dg-warning "incomplete implementation of class .MyClass." "" { target *-*-* } 21 } */
+/* { dg-warning "method definition for .\\-missingMethod1. not found" "" { target *-*-* } 21 } */
+/* { dg-warning "class .MyClass. does not fully implement the .DefinedProtocol. protocol" "" { target *-*-* } 21 } */
+
diff --git a/gcc/testsuite/objc.dg/nested-func-1.m b/gcc/testsuite/objc.dg/nested-func-1.m
new file mode 100644
index 00000000000..7a182bd938e
--- /dev/null
+++ b/gcc/testsuite/objc.dg/nested-func-1.m
@@ -0,0 +1,37 @@
+/* Test basic nested C function functionality within ObjC
+ methods. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-lobjc" } */
+/* { dg-do run } */
+#include <stdio.h>
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+int bappy (int (*blargh) (int a, int b, int c))
+{
+ return blargh (4, 7, 2) + 3;
+}
+
+@interface Foo: Object
++ (int)foo;
+@end
+
+@implementation Foo
++ (int)foo
+{
+ int blargh (int a, int b, int c)
+ {
+ return a * b + c;
+ }
+ return bappy (blargh);
+}
+@end
+
+int main ()
+{
+ int f = [Foo foo];
+ if (f != 33)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/proto-hier-1.m b/gcc/testsuite/objc.dg/proto-hier-1.m
index 17ea72e8db1..154e6b62d73 100644
--- a/gcc/testsuite/objc.dg/proto-hier-1.m
+++ b/gcc/testsuite/objc.dg/proto-hier-1.m
@@ -48,7 +48,9 @@ int foo(void) {
id<Booing, Fooing> stupidVar;
[stupidVar boo];
[stupidVar foo];
- [stupidVar anotherMsg]; /* { dg-warning "not implemented by protocol" } */
- /* { dg-warning "return type defaults to id" "" { target *-*-* } 51 } */
+ [stupidVar anotherMsg]; /* { dg-warning ".\-anotherMsg. not implemented by protocol" } */
+ /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 51 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 51 } */
+ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 51 } */
return 0;
}
diff --git a/gcc/testsuite/objc.dg/proto-lossage-1.m b/gcc/testsuite/objc.dg/proto-lossage-1.m
index d312039262c..1186f8fd9ff 100644
--- a/gcc/testsuite/objc.dg/proto-lossage-1.m
+++ b/gcc/testsuite/objc.dg/proto-lossage-1.m
@@ -35,7 +35,12 @@ typedef struct objc_object { struct objc_class *class_pointer; } *id;
return (id <NSObject>)plate1; /* { dg-bogus "does not conform" } */
}
- (int) getValue {
- int i = [plate1 someValue]; /* { dg-warning "not implemented by protocol" } */
+ int i = [plate1 someValue]; /* { dg-warning ".\\-someValue. not implemented by protocol\\(s\\)" } */
+ /* { dg-warning "\\(Messages without a matching method signature" "" { target *-*-* } 38 } */
+ /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 38 } */
+ /* { dg-warning ".\.\.\.. as arguments\.\\)" "" { target *-*-* } 38 } */
+ /* { dg-warning "initialization makes integer from pointer without a cast" "" { target *-*-* } 38 } */
+
int j = [(id <NSObject>)plate1 someValue]; /* { dg-bogus "not implemented by protocol" } */
int k = [(id)plate1 someValue]; /* { dg-bogus "not implemented by protocol" } */
return i + j + k;
diff --git a/gcc/testsuite/objc.dg/proto-lossage-2.m b/gcc/testsuite/objc.dg/proto-lossage-2.m
new file mode 100644
index 00000000000..b3ab9681f62
--- /dev/null
+++ b/gcc/testsuite/objc.dg/proto-lossage-2.m
@@ -0,0 +1,20 @@
+/* Don't forget to look in protocols if a class (and its superclasses) do not
+ provide a suitable method. */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@protocol Zot
+-(void) zot;
+@end
+
+@interface Foo : Object <Zot>
+@end
+
+int foo()
+{
+ Foo *f=nil;
+ [f zot]; /* There should be no warnings here! */
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc.dg/proto-qual-1.m b/gcc/testsuite/objc.dg/proto-qual-1.m
new file mode 100644
index 00000000000..6ae12909380
--- /dev/null
+++ b/gcc/testsuite/objc.dg/proto-qual-1.m
@@ -0,0 +1,48 @@
+/* Check that protocol qualifiers are compiled and encoded properly. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-options "-lobjc" } */
+/* { dg-do run } */
+
+#include <objc/Protocol.h>
+#ifndef __NEXT_RUNTIME__
+#include <objc/objc-api.h>
+#endif
+
+extern int sscanf(const char *str, const char *format, ...);
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@protocol Retain
++ (oneway void)retainArgument:(out bycopy id)arg1 with:(in signed char **)arg2;
+- (bycopy) address:(byref inout id)location with:(out short unsigned **)arg2;
+@end
+
+@interface Foo <Retain>
++ (oneway void)retainArgument:(out bycopy id)arg with:(in signed char **)arg2;
+@end
+
+@implementation Foo
++ (oneway void)retainArgument:(out bycopy id)arg1 with:(in signed char **)arg2 { }
+- (bycopy) address:(byref inout id)location with:(out short unsigned **)arg2 { return nil; }
+@end
+
+Protocol *proto = @protocol(Retain);
+struct objc_method_description *meth;
+unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7;
+
+static void scan_initial(const char *pattern) {
+ totsize = offs0 = offs1 = offs2 = offs3 = offs4 = offs5 = offs6 = offs7 = (unsigned)-1;
+ sscanf(meth->types, pattern, &totsize, &offs0, &offs1, &offs2, &offs3,
+ &offs4, &offs5, &offs6, &offs7);
+ CHECK_IF(!offs0 && offs1 == sizeof(id) && offs2 == offs1 + sizeof(SEL) && totsize >= offs2);
+}
+
+int main(void) {
+ meth = [proto descriptionForInstanceMethod: @selector(address:with:)];
+ scan_initial("O@%u@%u:%uNR@%uo^^S%u");
+ CHECK_IF(offs3 == offs2 + sizeof(id) && totsize == offs3 + sizeof(unsigned));
+ meth = [proto descriptionForClassMethod: @selector(retainArgument:with:)];
+ scan_initial("Vv%u@%u:%uOo@%un^*%u");
+ CHECK_IF(offs3 == offs2 + sizeof(id) && totsize == offs3 + sizeof(char **));
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/sizeof-1.m b/gcc/testsuite/objc.dg/sizeof-1.m
new file mode 100644
index 00000000000..5d8def16afe
--- /dev/null
+++ b/gcc/testsuite/objc.dg/sizeof-1.m
@@ -0,0 +1,33 @@
+/* Check that the sizeof() operator works with ObjC classes and their aliases. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-lobjc" } */
+/* { dg-do run } */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort();
+
+@interface Foo: Object {
+ int a, b;
+ float c, d;
+}
+@end
+
+@implementation Foo
+@end
+
+typedef Object MyObject;
+typedef struct Foo Foo_type;
+
+@compatibility_alias AliasObject Object;
+
+int main(void) {
+ CHECK_IF(sizeof(Foo) > sizeof(Object) && sizeof(Object) > 0);
+ CHECK_IF(sizeof(Foo) == sizeof(Foo_type));
+ CHECK_IF(sizeof(Object) == sizeof(MyObject));
+ CHECK_IF(sizeof(Object) == sizeof(AliasObject));
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc.dg/special/unclaimed-category-1.h b/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
index 6c73d28fd17..52586f01521 100644
--- a/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
+++ b/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
@@ -2,6 +2,11 @@
#include <objc/objc.h>
#include <objc/Object.h>
+#ifdef __NEXT_RUNTIME__
+#define objc_get_class(C) objc_getClass(C)
+#define class_create_instance(C) class_createInstance(C, 0)
+#endif
+
/* Test loading unclaimed categories - categories of a class defined
separately from the class itself. */
diff --git a/gcc/testsuite/objc.dg/special/unclaimed-category-1.m b/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
index 3e521e91248..8b8af5ed307 100644
--- a/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
+++ b/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
@@ -21,6 +21,9 @@
{
return 4;
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
diff --git a/gcc/testsuite/objc.dg/static-1.m b/gcc/testsuite/objc.dg/static-1.m
new file mode 100644
index 00000000000..d6201585939
--- /dev/null
+++ b/gcc/testsuite/objc.dg/static-1.m
@@ -0,0 +1,33 @@
+/* Test out static (non-heap) allocations of ObjC class instances.
+ These should elicit errors. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+@interface Object {
+ struct objc_class *isa;
+}
+@end
+
+@compatibility_alias MyObject Object;
+
+@interface Foo: Object {
+ int a;
+ Object *b;
+ Object c; /* { dg-error "statically allocated instance of Objective-C class .Object." } */
+}
+@end
+
+@compatibility_alias MyFoo Foo;
+
+typedef Foo FooAlias1;
+typedef FooAlias1 FooAlias2;
+typedef Object ObjectAlias1;
+typedef struct Object ObjectAlias2;
+Object staticObject1; /* { dg-error "statically allocated instance of Objective-C class .Object." } */
+struct Object staticObject2; /* { dg-error "statically allocated instance of Objective-C class .Object." } */
+static ObjectAlias1 staticObject3; /* { dg-error "statically allocated instance of Objective-C class .Object." } */
+FooAlias1 staticFoo1; /* { dg-error "statically allocated instance of Objective-C class .Foo." } */
+extern FooAlias2 externFoo1; /* { dg-error "statically allocated instance of Objective-C class .Foo." } */
+static Foo staticFoo2; /* { dg-error "statically allocated instance of Objective-C class .Foo." } */
+MyObject staticMyObject1; /* { dg-error "statically allocated instance of Objective-C class .Object." } */
+MyFoo staticMyFoo1; /* { dg-error "statically allocated instance of Objective-C class .Foo." } */
diff --git a/gcc/testsuite/objc.dg/symtab-1.m b/gcc/testsuite/objc.dg/symtab-1.m
new file mode 100644
index 00000000000..44e7b5aab34
--- /dev/null
+++ b/gcc/testsuite/objc.dg/symtab-1.m
@@ -0,0 +1,24 @@
+/* Check if the objc_symtab descriptor is being laid out correctly. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-fnext-runtime" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+#include <objc/Object.h>
+
+@interface Base: Object
+- (void)setValues;
+@end
+
+@interface Derived: Base
+- (void)checkValues;
+@end
+
+@implementation Base
+-(void)setValues { }
+@end
+
+@implementation Derived
+-(void)checkValues { }
+@end
+
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived\n\t.long\tL_OBJC_CLASS_Base\n" } } */
diff --git a/gcc/testsuite/objc.dg/try-catch-1.m b/gcc/testsuite/objc.dg/try-catch-1.m
new file mode 100644
index 00000000000..e40fdf85994
--- /dev/null
+++ b/gcc/testsuite/objc.dg/try-catch-1.m
@@ -0,0 +1,44 @@
+/* Test if the compiler accepts @throw / @try..@catch..@finally
+ syntax. This will only be usable on MacOS X 10.3 and later. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-fobjc-exceptions" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+#include <objc/objc.h>
+#include <objc/objc-runtime.h>
+#include <objc/Object.h>
+#include <stdio.h>
+#include <setjmp.h>
+
+@interface Frob: Object
+@end
+
+@implementation Frob: Object
+@end
+
+static int exc_control = 0;
+
+int proc() {
+ if(exc_control) {
+ printf ("Throwing (%d)... ", exc_control);
+ @throw [Frob new];
+ }
+ return 1;
+}
+
+int foo()
+{
+ @try {
+ return proc();
+ }
+ @catch (Frob* ex) {
+ if(exc_control > 1) {
+ printf("Rethrowing (%d)... ", exc_control);
+ @throw;
+ }
+ return 0;
+ }
+ @finally {
+ printf("In @finally block (%d)... ", exc_control);
+ }
+}
diff --git a/gcc/testsuite/objc.dg/try-catch-2.m b/gcc/testsuite/objc.dg/try-catch-2.m
new file mode 100644
index 00000000000..fc314f3f128
--- /dev/null
+++ b/gcc/testsuite/objc.dg/try-catch-2.m
@@ -0,0 +1,85 @@
+/* Test out '@catch(id foo) {...}', which should catch
+ all uncaught exceptions. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-options "-fobjc-exceptions -lobjc" } */
+/* { dg-do run { target *-*-darwin[789]* } } */
+
+#include <objc/objc.h>
+#include <objc/objc-runtime.h>
+#include <objc/Object.h>
+#include <stdio.h>
+
+/* The following is not required in actual user code; we include it
+ here to check that the compiler generates an internal definition of
+ _setjmp that is consistent with what <setjmp.h> provides. */
+#include <setjmp.h>
+
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface Frob: Object
+@end
+
+@implementation Frob: Object
+@end
+
+static Frob* _connection = nil;
+
+//--------------------------------------------------------------------
+
+
+void test (Object* sendPort)
+{
+ int cleanupPorts = 1;
+ Frob* receivePort = nil;
+
+ @try {
+ printf ("receivePort = %p\n", receivePort);
+ printf ("sendPort = %p\n", sendPort);
+ printf ("cleanupPorts = %d\n", cleanupPorts);
+ printf ("---\n");
+
+ receivePort = (Frob *) -1;
+ _connection = (Frob *) -1;
+ printf ("receivePort = %p\n", receivePort);
+ printf ("sendPort = %p\n", sendPort);
+ printf ("cleanupPorts = %d\n", cleanupPorts);
+ printf ("---\n");
+
+ receivePort = nil;
+ sendPort = nil;
+ cleanupPorts = 0;
+
+ printf ("receivePort = %p\n", receivePort);
+ printf ("sendPort = %p\n", sendPort);
+ printf ("cleanupPorts = %d\n", cleanupPorts);
+ printf ("---\n");
+
+ @throw [Object new];
+ }
+ @catch(Frob *obj) {
+ printf ("Exception caught by incorrect handler!\n");
+ CHECK_IF(0);
+ }
+ @catch(id exc) {
+ printf ("Exception caught by correct handler.\n");
+ printf ("receivePort = %p (expected 0x0)\n", receivePort);
+ printf ("sendPort = %p (expected 0x0)\n", sendPort);
+ printf ("cleanupPorts = %d (expected 0)\n", cleanupPorts);
+ printf ("---");
+ CHECK_IF(!receivePort);
+ CHECK_IF(!sendPort);
+ CHECK_IF(!cleanupPorts);
+ }
+ @catch(Object *obj) { /* { dg-warning "Exception already handled by preceding .\\@catch\\(id\\)." } */
+ printf ("Exception caught by incorrect handler!\n");
+ CHECK_IF(0);
+ }
+}
+
+int main (void) {
+
+ test((Object *)-1);
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/try-catch-3.m b/gcc/testsuite/objc.dg/try-catch-3.m
new file mode 100644
index 00000000000..f49362fbf31
--- /dev/null
+++ b/gcc/testsuite/objc.dg/try-catch-3.m
@@ -0,0 +1,19 @@
+/* Test if caught exception objects are accessible inside the
+ @catch block. (Yes, I managed to break this.) */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fobjc-exceptions" } */
+
+#include <objc/Object.h>
+
+const char *foo(void)
+{
+ @try {
+ return "foo";
+ }
+ @catch (Object* theException) {
+ return [theException name];
+ }
+}
+
diff --git a/gcc/testsuite/objc.dg/try-catch-4.m b/gcc/testsuite/objc.dg/try-catch-4.m
new file mode 100644
index 00000000000..54aea233fed
--- /dev/null
+++ b/gcc/testsuite/objc.dg/try-catch-4.m
@@ -0,0 +1,26 @@
+/* Check that the compiler does not incorrectly complain about
+ exceptions being caught by previous @catch blocks. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-Wall -fobjc-exceptions" } */
+
+@interface Exception
+@end
+
+@interface FooException : Exception
+@end
+
+extern void foo();
+
+void test()
+{
+ @try {
+ foo();
+ }
+ @catch (FooException* fe) {
+ }
+ @catch (Exception* e) {
+ }
+}
+
diff --git a/gcc/testsuite/objc.dg/type-size-1.m b/gcc/testsuite/objc.dg/type-size-1.m
new file mode 100644
index 00000000000..f2fdae5c382
--- /dev/null
+++ b/gcc/testsuite/objc.dg/type-size-1.m
@@ -0,0 +1,17 @@
+/* Reject ivars with an unknown size. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+struct unknownStruct;
+
+@interface ArrayTest
+{
+ short unknownSize[unknownValue]; /* { dg-error ".unknownValue. (undeclared|was not declared)" } */
+ /* { dg-error "instance variable .unknownSize. has unknown size" "" { target *-*-* } 9 } */
+ struct unknownStruct unknownObj; /* { dg-error "field .unknownObj. has incomplete type" } */
+ /* { dg-error "instance variable .unknownObj. has unknown size" "" { target *-*-* } 11 } */
+ long knownSize[3]; /* ok */
+ char zeroSize[2 - 2]; /* ok (apparently) */
+ int missingSize[]; /* { dg-error "instance variable .missingSize. has unknown size" } */
+}
+@end
diff --git a/gcc/testsuite/objc.dg/type-size-2.m b/gcc/testsuite/objc.dg/type-size-2.m
new file mode 100644
index 00000000000..446de48345a
--- /dev/null
+++ b/gcc/testsuite/objc.dg/type-size-2.m
@@ -0,0 +1,58 @@
+/* Make sure that array arguments to methods are given the size of pointers. */
+/* As in the case of ivars, arrays without size (e.g., 'int []') are
+ encoded as pointers as well. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+
+#include <objc/objc.h>
+#ifdef __NEXT_RUNTIME__
+#include <objc/objc-runtime.h>
+#define OBJC_GETCLASS objc_getClass
+#define CLASS_GETINSTANCEMETHOD class_getInstanceMethod
+#else
+#include <objc/objc-api.h>
+#define OBJC_GETCLASS objc_get_class
+#define CLASS_GETINSTANCEMETHOD class_get_instance_method
+#endif
+
+extern int sscanf(const char *str, const char *format, ...);
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+enum Enum { one, two, three, four };
+
+@interface ArrayTest
+- (const char *)str:(signed char [])arg1 with:(unsigned char *)arg2 and:(enum Enum[4])en;
+- (int)meth1:(int [])arg1 with:(int [0])arg2 with:(int [2])arg3;
+@end
+
+@implementation ArrayTest
+- (int)meth1:(int [])arg1 with:(int [0])arg2 with:(int [2])arg3 { return 0; }
+- (const char *)str:(signed char [])arg1 with:(unsigned char *)arg2 and:(enum Enum[4])en { return "str"; }
+@end
+
+Class cls;
+struct objc_method *meth;
+unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7;
+
+static void scan_initial(const char *pattern) {
+ totsize = offs0 = offs1 = offs2 = offs3 = offs4 = offs5 = offs6 = offs7 = (unsigned)-1;
+ sscanf(meth->method_types, pattern, &totsize, &offs0, &offs1, &offs2, &offs3,
+ &offs4, &offs5, &offs6, &offs7);
+ CHECK_IF(!offs0 && offs1 == sizeof(id) && offs2 == offs1 + sizeof(SEL) && totsize >= offs2);
+}
+
+int main(void) {
+ cls = OBJC_GETCLASS("ArrayTest");
+
+ meth = CLASS_GETINSTANCEMETHOD(cls, @selector(str:with:and:));
+ scan_initial("r*%u@%u:%u*%u*%u[4i]%u");
+ CHECK_IF(offs3 == offs2 + sizeof(signed char *) && offs4 == offs3 + sizeof(unsigned char *));
+ CHECK_IF(totsize == offs4 + sizeof(enum Enum *));
+ meth = CLASS_GETINSTANCEMETHOD(cls, @selector(meth1:with:with:));
+ scan_initial("i%u@%u:%u^i%u[0i]%u[2i]%u");
+ CHECK_IF(offs3 == offs2 + sizeof(int *) && offs4 == offs3 + sizeof(int *));
+ CHECK_IF(totsize == offs4 + sizeof(int *));
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc.dg/zero-link-1.m b/gcc/testsuite/objc.dg/zero-link-1.m
new file mode 100644
index 00000000000..96fd0c290d3
--- /dev/null
+++ b/gcc/testsuite/objc.dg/zero-link-1.m
@@ -0,0 +1,28 @@
+/* Check if the '-fzero-link' flag correctly emits an objc_getClass() call. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-fnext-runtime -fzero-link" } */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort();
+
+@interface Base: Object
++ (int) getValue;
+@end
+
+@implementation Base
++ (int) getValue { return 1593; }
+@end
+
+int main(void) {
+ int val = [Base getValue];
+ CHECK_IF(val == 1593);
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "_OBJC_CLASS_REFERENCES_0" } } */
+/* { dg-final { scan-assembler "objc_getClass" } } */
+
diff --git a/gcc/testsuite/objc.dg/zero-link-2.m b/gcc/testsuite/objc.dg/zero-link-2.m
new file mode 100644
index 00000000000..92b4ab11b0c
--- /dev/null
+++ b/gcc/testsuite/objc.dg/zero-link-2.m
@@ -0,0 +1,28 @@
+/* Check if the '-fno-zero-link' flag correctly _omits_ an objc_getClass() call. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-fnext-runtime -fno-zero-link" } */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+extern void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort();
+
+@interface Base: Object
++ (int) getValue;
+@end
+
+@implementation Base
++ (int) getValue { return 1593; }
+@end
+
+int main(void) {
+ int val = [Base getValue];
+ CHECK_IF(val == 1593);
+ return 0;
+}
+
+/* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
+/* { dg-final { scan-assembler-not "objc_getClass" } } */
+
diff --git a/gcc/testsuite/objc/execute/IMP.m b/gcc/testsuite/objc/execute/IMP.m
index 979aebb0158..99f61933926 100644
--- a/gcc/testsuite/objc/execute/IMP.m
+++ b/gcc/testsuite/objc/execute/IMP.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Test getting and calling the IMP of a method */
@interface TestClass
diff --git a/gcc/testsuite/objc/execute/_cmd.m b/gcc/testsuite/objc/execute/_cmd.m
index 20203b51711..f2b05b6527b 100644
--- a/gcc/testsuite/objc/execute/_cmd.m
+++ b/gcc/testsuite/objc/execute/_cmd.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Test the hidden argument _cmd to method calls */
@interface TestClass
@@ -16,6 +18,9 @@
{
return sel_get_name (_cmd);
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
diff --git a/gcc/testsuite/objc/execute/bf-common.h b/gcc/testsuite/objc/execute/bf-common.h
index 123a45413d0..6cf7a0696b6 100644
--- a/gcc/testsuite/objc/execute/bf-common.h
+++ b/gcc/testsuite/objc/execute/bf-common.h
@@ -1,5 +1,7 @@
+#ifndef __NEXT_RUNTIME__
#include <objc/encoding.h>
-
+#endif
+#include "next_mapping.h"
void print_ivars (Class class)
{
@@ -59,7 +61,7 @@ int main ()
@defs (MyObject);
};
int size1, size2;
- Class class = [MyObject class];
+ Class class = objc_get_class ("MyObject");
printf ("type = %s\n", @encode (struct class_vars));
print_ivars (class);
diff --git a/gcc/testsuite/objc/execute/bycopy-3.m b/gcc/testsuite/objc/execute/bycopy-3.m
index 9c7c0acbadb..60acde52b59 100644
--- a/gcc/testsuite/objc/execute/bycopy-3.m
+++ b/gcc/testsuite/objc/execute/bycopy-3.m
@@ -12,7 +12,11 @@
#include <objc/objc.h>
#include <objc/Object.h>
#include <objc/Protocol.h>
+
+#ifndef __NEXT_RUNTIME__
#include <objc/encoding.h>
+#endif
+#include "next_mapping.h"
@protocol MyProtocol
+ (bycopy id<MyProtocol>) bycopyMethod;
diff --git a/gcc/testsuite/objc/execute/cascading-1.m b/gcc/testsuite/objc/execute/cascading-1.m
new file mode 100644
index 00000000000..67988a5db2a
--- /dev/null
+++ b/gcc/testsuite/objc/execute/cascading-1.m
@@ -0,0 +1,33 @@
+#include <objc/Object.h>
+
+@interface Foo : Object
++ foo;
++ bar;
+@end
+
+int foocalled = 0;
+int barcalled = 0;
+
+
+@implementation Foo
++ foo
+{
+ if (foocalled)
+ abort ();
+ foocalled = 1;
+ return self;
+}
++ bar
+{
+ if (barcalled)
+ abort ();
+ barcalled = 1;
+ return self;
+}
+@end
+
+int main(int argc,char **argv)
+{
+ [[Foo foo] bar];
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-1.m b/gcc/testsuite/objc/execute/class-1.m
index a28cfc3abb8..5fd9aa8e038 100644
--- a/gcc/testsuite/objc/execute/class-1.m
+++ b/gcc/testsuite/objc/execute/class-1.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a RootClass */
@interface RootClass
diff --git a/gcc/testsuite/objc/execute/class-10.m b/gcc/testsuite/objc/execute/class-10.m
index 3d9697c0d86..d984d62ac99 100644
--- a/gcc/testsuite/objc/execute/class-10.m
+++ b/gcc/testsuite/objc/execute/class-10.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods and a subclass overriding the superclass'
implementation, and using self to call another method of itself */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
diff --git a/gcc/testsuite/objc/execute/class-11.m b/gcc/testsuite/objc/execute/class-11.m
index 902db2b9a33..00c488bd1b9 100644
--- a/gcc/testsuite/objc/execute/class-11.m
+++ b/gcc/testsuite/objc/execute/class-11.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods and a subclass overriding the superclass'
implementation and using self to call another method of itself - in
@@ -14,6 +16,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
diff --git a/gcc/testsuite/objc/execute/class-12.m b/gcc/testsuite/objc/execute/class-12.m
index e65611df06b..fcab65b2d36 100644
--- a/gcc/testsuite/objc/execute/class-12.m
+++ b/gcc/testsuite/objc/execute/class-12.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with a class methods */
@interface RootClass
@@ -11,6 +13,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
static int class_variable = 0;
diff --git a/gcc/testsuite/objc/execute/class-13.m b/gcc/testsuite/objc/execute/class-13.m
index 0d87afd9508..98cf0ccd729 100644
--- a/gcc/testsuite/objc/execute/class-13.m
+++ b/gcc/testsuite/objc/execute/class-13.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with a class accessor
methods and a subclass overriding the superclass' implementation
but reusing it with super */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
static int class_variable = 0;
diff --git a/gcc/testsuite/objc/execute/class-14.m b/gcc/testsuite/objc/execute/class-14.m
index 2827031358c..7d02c36df7a 100644
--- a/gcc/testsuite/objc/execute/class-14.m
+++ b/gcc/testsuite/objc/execute/class-14.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with a class accessor
methods and a subclass overriding the superclass' implementation,
and using self to call another method of itself */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
static int class_variable = 0;
diff --git a/gcc/testsuite/objc/execute/class-2.m b/gcc/testsuite/objc/execute/class-2.m
index cb8b47fa1a3..350a583e9b5 100644
--- a/gcc/testsuite/objc/execute/class-2.m
+++ b/gcc/testsuite/objc/execute/class-2.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass */
@interface RootClass
diff --git a/gcc/testsuite/objc/execute/class-3.m b/gcc/testsuite/objc/execute/class-3.m
index dbe68bf9037..5ce83376c46 100644
--- a/gcc/testsuite/objc/execute/class-3.m
+++ b/gcc/testsuite/objc/execute/class-3.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a minimal subclass tree */
@interface RootClass
diff --git a/gcc/testsuite/objc/execute/class-4.m b/gcc/testsuite/objc/execute/class-4.m
index 0ae723c035b..34d414b1229 100644
--- a/gcc/testsuite/objc/execute/class-4.m
+++ b/gcc/testsuite/objc/execute/class-4.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods */
@@ -12,6 +14,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
diff --git a/gcc/testsuite/objc/execute/class-5.m b/gcc/testsuite/objc/execute/class-5.m
index 5d5297f6247..e2b750ac01d 100644
--- a/gcc/testsuite/objc/execute/class-5.m
+++ b/gcc/testsuite/objc/execute/class-5.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods and a subclass overriding the superclass'
implementation */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
diff --git a/gcc/testsuite/objc/execute/class-6.m b/gcc/testsuite/objc/execute/class-6.m
index f60912aa608..fb2d64b4314 100644
--- a/gcc/testsuite/objc/execute/class-6.m
+++ b/gcc/testsuite/objc/execute/class-6.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods and a subclass overriding the superclass'
implementation but reusing it with super */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
diff --git a/gcc/testsuite/objc/execute/class-7.m b/gcc/testsuite/objc/execute/class-7.m
index 9a2fe0cff41..3fddca77065 100644
--- a/gcc/testsuite/objc/execute/class-7.m
+++ b/gcc/testsuite/objc/execute/class-7.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods; accessor methods implemented in a separate
category */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
@@ -49,6 +54,13 @@ int main (void)
SubClass *object;
test_class_with_superclass ("SubClass", "RootClass");
+
+ /* The NeXT runtime's category implementation is lazy: categories are not attached
+ to classes until the class is initialized (at +initialize time). */
+#ifdef __NEXT_RUNTIME__
+ [SubClass initialize];
+#endif
+
test_that_class_has_instance_method ("SubClass", @selector (setState:));
test_that_class_has_instance_method ("SubClass", @selector (state));
diff --git a/gcc/testsuite/objc/execute/class-8.m b/gcc/testsuite/objc/execute/class-8.m
index fa111850213..806db03687c 100644
--- a/gcc/testsuite/objc/execute/class-8.m
+++ b/gcc/testsuite/objc/execute/class-8.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods and a subclass overriding the superclass'
implementation - in a category */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
diff --git a/gcc/testsuite/objc/execute/class-9.m b/gcc/testsuite/objc/execute/class-9.m
index bb405fbc982..d32362bdd57 100644
--- a/gcc/testsuite/objc/execute/class-9.m
+++ b/gcc/testsuite/objc/execute/class-9.m
@@ -2,6 +2,8 @@
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include "next_mapping.h"
+
/* Tests creating a root class and a subclass with an ivar and
accessor methods and a subclass overriding the superclass'
implementation but reusing it with super - in a category */
@@ -13,6 +15,9 @@
@end
@implementation RootClass
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface SubClass : RootClass
diff --git a/gcc/testsuite/objc/execute/class-tests-2.h b/gcc/testsuite/objc/execute/class-tests-2.h
index 6df91df2b6e..cc14abb4343 100644
--- a/gcc/testsuite/objc/execute/class-tests-2.h
+++ b/gcc/testsuite/objc/execute/class-tests-2.h
@@ -62,6 +62,6 @@ void test_accessor_method (TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD object,
abort ();
}
}
-#endif CLASS_WITH_ACCESSOR_METHOD
+#endif /* CLASS_WITH_ACCESSOR_METHOD */
diff --git a/gcc/testsuite/objc/execute/class_self-1.m b/gcc/testsuite/objc/execute/class_self-1.m
index 4d4251628ea..1690f8f6bbc 100644
--- a/gcc/testsuite/objc/execute/class_self-1.m
+++ b/gcc/testsuite/objc/execute/class_self-1.m
@@ -51,6 +51,9 @@ struct d
{
return 4;
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
diff --git a/gcc/testsuite/objc/execute/class_self-2.m b/gcc/testsuite/objc/execute/class_self-2.m
index e64fcf9fff4..7fa54906cce 100644
--- a/gcc/testsuite/objc/execute/class_self-2.m
+++ b/gcc/testsuite/objc/execute/class_self-2.m
@@ -32,6 +32,9 @@ struct d
return u;
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
/* The second class */
@@ -54,6 +57,9 @@ struct d
}
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
diff --git a/gcc/testsuite/objc/execute/function-message-1.m b/gcc/testsuite/objc/execute/function-message-1.m
new file mode 100644
index 00000000000..2c8c002d9e8
--- /dev/null
+++ b/gcc/testsuite/objc/execute/function-message-1.m
@@ -0,0 +1,33 @@
+#include <objc/Object.h>
+
+@interface Foo : Object
++ bar;
+@end
+
+int foocalled = 0;
+int barcalled = 0;
+
+
+id foo()
+{
+ if (foocalled)
+ abort ();
+ foocalled = 1;
+ return [Foo class];
+}
+
+@implementation Foo
++ bar
+{
+ if (barcalled)
+ abort ();
+ barcalled = 1;
+ return self;
+}
+@end
+
+int main(int argc,char **argv)
+{
+ [foo() bar];
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/many_args_method.m b/gcc/testsuite/objc/execute/many_args_method.m
index d811082cb86..6cc2e2535ed 100644
--- a/gcc/testsuite/objc/execute/many_args_method.m
+++ b/gcc/testsuite/objc/execute/many_args_method.m
@@ -30,6 +30,9 @@
{
return [self sumInteger: a withInteger: b withInteger: c];
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
diff --git a/gcc/testsuite/objc/execute/nested-3.m b/gcc/testsuite/objc/execute/nested-3.m
index 94271c4e4c0..5462fd5ef7a 100644
--- a/gcc/testsuite/objc/execute/nested-3.m
+++ b/gcc/testsuite/objc/execute/nested-3.m
@@ -22,6 +22,9 @@
return test ();
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
int main (void)
diff --git a/gcc/testsuite/objc/execute/next_mapping.h b/gcc/testsuite/objc/execute/next_mapping.h
new file mode 100644
index 00000000000..67c2ce34257
--- /dev/null
+++ b/gcc/testsuite/objc/execute/next_mapping.h
@@ -0,0 +1,851 @@
+/* This file "renames" various ObjC GNU runtime entry points
+ (and fakes the existence of several others)
+ if the NeXT runtime is being used. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+#ifdef __NEXT_RUNTIME__
+#include <objc/objc-class.h>
+#include <ctype.h>
+
+#define objc_get_class(C) objc_getClass(C)
+#define objc_get_meta_class(C) objc_getMetaClass(C)
+#define class_get_class_method(C, S) class_getClassMethod(C, S)
+#define class_get_instance_method(C, S) class_getInstanceMethod(C, S)
+#define method_get_imp(M) (((Method)M)->method_imp)
+#define sel_get_name(S) sel_getName(S)
+#define class_create_instance(C) class_createInstance(C, 0)
+#define class_get_class_name(C) object_getClassName(C)
+#define class_get_super_class(C) (((struct objc_class *)C)->super_class)
+#define object_get_super_class(O) class_get_super_class(*(struct objc_class **)O)
+#define objc_lookup_class(N) objc_lookUpClass(N)
+#define object_get_class(O) (*(struct objc_class **)O)
+#define class_is_class(C) (CLS_GETINFO((struct objc_class *)C, CLS_CLASS)? YES: NO)
+#define class_is_meta_class(C) (CLS_GETINFO((struct objc_class *)C, CLS_META)? YES: NO)
+#define object_is_class(O) class_is_meta_class(*(struct objc_class **)O)
+#define object_is_meta_class(O) (class_is_meta_class(O) && class_is_meta_class(*(struct objc_class **)O))
+
+/* You need either an empty +initialize method or an empty -forward:: method.
+ The NeXT runtime unconditionally sends +initialize to classes when they are
+ first used, and unconditionally tries to forward methods that the class
+ doesn't understand (including +initialize). If you have neither +initialize
+ nor -forward::, the runtime complains.
+
+ The simplest workaround is to add
+
+ + initialize { return self; }
+
+ to every root class @implementation. */
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* The following is necessary to "cover" the bf*.m test cases on NeXT. */
+
+#undef MAX
+#define MAX(X, Y) \
+ ({ typeof (X) __x = (X), __y = (Y); \
+ (__x > __y ? __x : __y); })
+
+#undef MIN
+#define MIN(X, Y) \
+ ({ typeof (X) __x = (X), __y = (Y); \
+ (__x < __y ? __x : __y); })
+
+#undef ROUND
+#define ROUND(V, A) \
+ ({ typeof (V) __v = (V); typeof (A) __a = (A); \
+ __a * ((__v+__a - 1)/__a); })
+
+#define BITS_PER_UNIT __CHAR_BIT__
+#define STRUCTURE_SIZE_BOUNDARY (BITS_PER_UNIT * sizeof (struct{char a;}))
+
+/* Not sure why the following are missing from NeXT objc headers... */
+
+#ifndef _C_LNG_LNG
+#define _C_LNG_LNG 'q'
+#endif
+#ifndef _C_ULNG_LNG
+#define _C_ULNG_LNG 'Q'
+#endif
+#ifndef _C_ATOM
+#define _C_ATOM '%'
+#endif
+#ifndef _C_BOOL
+#define _C_BOOL 'B'
+#endif
+
+#define _C_CONST 'r'
+#define _C_IN 'n'
+#define _C_INOUT 'N'
+#define _C_OUT 'o'
+#define _C_BYCOPY 'O'
+#define _C_BYREF 'R'
+#define _C_ONEWAY 'V'
+#define _C_GCINVISIBLE '!'
+
+#define _F_CONST 0x01
+#define _F_IN 0x01
+#define _F_OUT 0x02
+#define _F_INOUT 0x03
+#define _F_BYCOPY 0x04
+#define _F_BYREF 0x08
+#define _F_ONEWAY 0x10
+#define _F_GCINVISIBLE 0x20
+
+struct objc_struct_layout
+{
+ const char *original_type;
+ const char *type;
+ const char *prev_type;
+ unsigned int record_size;
+ unsigned int record_align;
+};
+
+typedef union {
+ char *arg_ptr;
+ char arg_regs[sizeof (char*)];
+} *arglist_t; /* argument frame */
+
+const char *objc_skip_typespec (const char *type);
+void objc_layout_structure_get_info (struct objc_struct_layout *layout,
+ unsigned int *offset, unsigned int *align, const char **type);
+void objc_layout_structure (const char *type,
+ struct objc_struct_layout *layout);
+BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout);
+void objc_layout_finish_structure (struct objc_struct_layout *layout,
+ unsigned int *size, unsigned int *align);
+
+/*
+ return the size of an object specified by type
+*/
+
+int
+objc_sizeof_type (const char *type)
+{
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ switch (*type) {
+ case _C_ID:
+ return sizeof (id);
+ break;
+
+ case _C_CLASS:
+ return sizeof (Class);
+ break;
+
+ case _C_SEL:
+ return sizeof (SEL);
+ break;
+
+ case _C_CHR:
+ return sizeof (char);
+ break;
+
+ case _C_UCHR:
+ return sizeof (unsigned char);
+ break;
+
+ case _C_SHT:
+ return sizeof (short);
+ break;
+
+ case _C_USHT:
+ return sizeof (unsigned short);
+ break;
+
+ case _C_INT:
+ return sizeof (int);
+ break;
+
+ case _C_UINT:
+ return sizeof (unsigned int);
+ break;
+
+ case _C_LNG:
+ return sizeof (long);
+ break;
+
+ case _C_ULNG:
+ return sizeof (unsigned long);
+ break;
+
+ case _C_LNG_LNG:
+ return sizeof (long long);
+ break;
+
+ case _C_ULNG_LNG:
+ return sizeof (unsigned long long);
+ break;
+
+ case _C_FLT:
+ return sizeof (float);
+ break;
+
+ case _C_DBL:
+ return sizeof (double);
+ break;
+
+ case _C_VOID:
+ return sizeof (void);
+ break;
+
+ case _C_PTR:
+ case _C_ATOM:
+ case _C_CHARPTR:
+ return sizeof (char *);
+ break;
+
+ case _C_ARY_B:
+ {
+ int len = atoi (type + 1);
+ while (isdigit ((unsigned char)*++type))
+ ;
+ return len * objc_aligned_size (type);
+ }
+ break;
+
+ case _C_BFLD:
+ {
+ /* The NeXT encoding of bitfields is _still_: b 'size' */
+ int size = atoi (type + 1);
+ /* Return an upper bound on byte size */
+ return (size + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
+ }
+
+ case _C_STRUCT_B:
+ {
+ struct objc_struct_layout layout;
+ unsigned int size;
+
+ objc_layout_structure (type, &layout);
+ while (objc_layout_structure_next_member (&layout))
+ /* do nothing */ ;
+ objc_layout_finish_structure (&layout, &size, NULL);
+
+ return size;
+ }
+
+ case _C_UNION_B:
+ {
+ int max_size = 0;
+ while (*type != _C_UNION_E && *type++ != '=')
+ /* do nothing */;
+ while (*type != _C_UNION_E)
+ {
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+ max_size = MAX (max_size, objc_sizeof_type (type));
+ type = objc_skip_typespec (type);
+ }
+ return max_size;
+ }
+ }
+ return 0; /* error */
+}
+
+
+/*
+ Return the alignment of an object specified by type
+*/
+
+int
+objc_alignof_type (const char *type)
+{
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+ switch (*type) {
+ case _C_ID:
+ return __alignof__ (id);
+ break;
+
+ case _C_CLASS:
+ return __alignof__ (Class);
+ break;
+
+ case _C_SEL:
+ return __alignof__ (SEL);
+ break;
+
+ case _C_CHR:
+ return __alignof__ (char);
+ break;
+
+ case _C_UCHR:
+ return __alignof__ (unsigned char);
+ break;
+
+ case _C_SHT:
+ return __alignof__ (short);
+ break;
+
+ case _C_USHT:
+ return __alignof__ (unsigned short);
+ break;
+
+ case _C_INT:
+ case _C_BFLD: /* This is for the NeXT only */
+ return __alignof__ (int);
+ break;
+
+ case _C_UINT:
+ return __alignof__ (unsigned int);
+ break;
+
+ case _C_LNG:
+ return __alignof__ (long);
+ break;
+
+ case _C_ULNG:
+ return __alignof__ (unsigned long);
+ break;
+
+ case _C_LNG_LNG:
+ return __alignof__ (long long);
+ break;
+
+ case _C_ULNG_LNG:
+ return __alignof__ (unsigned long long);
+ break;
+
+ case _C_FLT:
+ return __alignof__ (float);
+ break;
+
+ case _C_DBL:
+ return __alignof__ (double);
+ break;
+
+ case _C_PTR:
+ case _C_ATOM:
+ case _C_CHARPTR:
+ return __alignof__ (char *);
+ break;
+
+ case _C_ARY_B:
+ while (isdigit ((unsigned char)*++type))
+ /* do nothing */;
+ return objc_alignof_type (type);
+
+ case _C_STRUCT_B:
+ {
+ struct objc_struct_layout layout;
+ unsigned int align;
+
+ objc_layout_structure (type, &layout);
+ while (objc_layout_structure_next_member (&layout))
+ /* do nothing */;
+ objc_layout_finish_structure (&layout, NULL, &align);
+
+ return align;
+ }
+
+ case _C_UNION_B:
+ {
+ int maxalign = 0;
+ while (*type != _C_UNION_E && *type++ != '=')
+ /* do nothing */;
+ while (*type != _C_UNION_E)
+ {
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+ maxalign = MAX (maxalign, objc_alignof_type (type));
+ type = objc_skip_typespec (type);
+ }
+ return maxalign;
+ }
+ }
+ return 0; /* error */
+}
+
+/*
+ The aligned size if the size rounded up to the nearest alignment.
+*/
+
+int
+objc_aligned_size (const char *type)
+{
+ int size, align;
+
+ /* Skip the variable name */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ size = objc_sizeof_type (type);
+ align = objc_alignof_type (type);
+
+ return ROUND (size, align);
+}
+
+/*
+ The size rounded up to the nearest integral of the wordsize, taken
+ to be the size of a void *.
+*/
+
+int
+objc_promoted_size (const char *type)
+{
+ int size, wordsize;
+
+ /* Skip the variable name */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ size = objc_sizeof_type (type);
+ wordsize = sizeof (void *);
+
+ return ROUND (size, wordsize);
+}
+
+/*
+ Skip type qualifiers. These may eventually precede typespecs
+ occurring in method prototype encodings.
+*/
+
+inline const char *
+objc_skip_type_qualifiers (const char *type)
+{
+ while (*type == _C_CONST
+ || *type == _C_IN
+ || *type == _C_INOUT
+ || *type == _C_OUT
+ || *type == _C_BYCOPY
+ || *type == _C_BYREF
+ || *type == _C_ONEWAY
+ || *type == _C_GCINVISIBLE)
+ {
+ type += 1;
+ }
+ return type;
+}
+
+
+/*
+ Skip one typespec element. If the typespec is prepended by type
+ qualifiers, these are skipped as well.
+*/
+
+const char *
+objc_skip_typespec (const char *type)
+{
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ type = objc_skip_type_qualifiers (type);
+
+ switch (*type) {
+
+ case _C_ID:
+ /* An id may be annotated by the actual type if it is known
+ with the @"ClassName" syntax */
+
+ if (*++type != '"')
+ return type;
+ else
+ {
+ while (*++type != '"')
+ /* do nothing */;
+ return type + 1;
+ }
+
+ /* The following are one character type codes */
+ case _C_CLASS:
+ case _C_SEL:
+ case _C_CHR:
+ case _C_UCHR:
+ case _C_CHARPTR:
+ case _C_ATOM:
+ case _C_SHT:
+ case _C_USHT:
+ case _C_INT:
+ case _C_UINT:
+ case _C_LNG:
+ case _C_ULNG:
+ case _C_LNG_LNG:
+ case _C_ULNG_LNG:
+ case _C_FLT:
+ case _C_DBL:
+ case _C_VOID:
+ case _C_UNDEF:
+ return ++type;
+ break;
+
+ case _C_ARY_B:
+ /* skip digits, typespec and closing ']' */
+
+ while (isdigit ((unsigned char)*++type))
+ ;
+ type = objc_skip_typespec (type);
+ if (*type == _C_ARY_E)
+ return ++type;
+ else
+ break; /* error */
+
+ case _C_BFLD:
+ /* The NeXT encoding for bitfields is _still_: b 'size' */
+ while (isdigit ((unsigned char)*++type))
+ ; /* skip type and size */
+ return type;
+
+ case _C_STRUCT_B:
+ /* skip name, and elements until closing '}' */
+
+ while (*type != _C_STRUCT_E && *type++ != '=')
+ ;
+ while (*type != _C_STRUCT_E)
+ {
+ type = objc_skip_typespec (type);
+ }
+ return ++type;
+
+ case _C_UNION_B:
+ /* skip name, and elements until closing ')' */
+
+ while (*type != _C_UNION_E && *type++ != '=')
+ ;
+ while (*type != _C_UNION_E)
+ {
+ type = objc_skip_typespec (type);
+ }
+ return ++type;
+
+ case _C_PTR:
+ /* Just skip the following typespec */
+
+ return objc_skip_typespec (++type);
+ }
+ return 0; /* error */
+}
+
+/*
+ Skip an offset as part of a method encoding. This is prepended by a
+ '+' if the argument is passed in registers.
+*/
+inline const char *
+objc_skip_offset (const char *type)
+{
+ if (*type == '+')
+ type++;
+ while (isdigit ((unsigned char) *++type))
+ ;
+ return type;
+}
+
+/*
+ Skip an argument specification of a method encoding.
+*/
+const char *
+objc_skip_argspec (const char *type)
+{
+ type = objc_skip_typespec (type);
+ type = objc_skip_offset (type);
+ return type;
+}
+
+/*
+ Return the number of arguments that the method MTH expects.
+ Note that all methods need two implicit arguments `self' and
+ `_cmd'.
+*/
+int
+method_get_number_of_arguments (struct objc_method *mth)
+{
+ int i = 0;
+ const char *type = mth->method_types;
+ while (*type)
+ {
+ type = objc_skip_argspec (type);
+ i += 1;
+ }
+ return i - 1;
+}
+
+/*
+ Return the size of the argument block needed on the stack to invoke
+ the method MTH. This may be zero, if all arguments are passed in
+ registers.
+*/
+
+int
+method_get_sizeof_arguments (struct objc_method *mth)
+{
+ const char *type = objc_skip_typespec (mth->method_types);
+ return atoi (type);
+}
+
+/*
+ Return a pointer to the next argument of ARGFRAME. type points to
+ the last argument. Typical use of this look like:
+
+ {
+ char *datum, *type;
+ for (datum = method_get_first_argument (method, argframe, &type);
+ datum; datum = method_get_next_argument (argframe, &type))
+ {
+ unsigned flags = objc_get_type_qualifiers (type);
+ type = objc_skip_type_qualifiers (type);
+ if (*type != _C_PTR)
+ [portal encodeData: datum ofType: type];
+ else
+ {
+ if ((flags & _F_IN) == _F_IN)
+ [portal encodeData: *(char **) datum ofType: ++type];
+ }
+ }
+ }
+*/
+
+char *
+method_get_next_argument (arglist_t argframe, const char **type)
+{
+ const char *t = objc_skip_argspec (*type);
+
+ if (*t == '\0')
+ return 0;
+
+ *type = t;
+ t = objc_skip_typespec (t);
+
+ if (*t == '+')
+ return argframe->arg_regs + atoi (++t);
+ else
+ return argframe->arg_ptr + atoi (t);
+}
+
+/*
+ Return a pointer to the value of the first argument of the method
+ described in M with the given argumentframe ARGFRAME. The type
+ is returned in TYPE. type must be passed to successive calls of
+ method_get_next_argument.
+*/
+char *
+method_get_first_argument (struct objc_method *m,
+ arglist_t argframe,
+ const char **type)
+{
+ *type = m->method_types;
+ return method_get_next_argument (argframe, type);
+}
+
+/*
+ Return a pointer to the ARGth argument of the method
+ M from the frame ARGFRAME. The type of the argument
+ is returned in the value-result argument TYPE
+*/
+
+char *
+method_get_nth_argument (struct objc_method *m,
+ arglist_t argframe, int arg,
+ const char **type)
+{
+ const char *t = objc_skip_argspec (m->method_types);
+
+ if (arg > method_get_number_of_arguments (m))
+ return 0;
+
+ while (arg--)
+ t = objc_skip_argspec (t);
+
+ *type = t;
+ t = objc_skip_typespec (t);
+
+ if (*t == '+')
+ return argframe->arg_regs + atoi (++t);
+ else
+ return argframe->arg_ptr + atoi (t);
+}
+
+unsigned
+objc_get_type_qualifiers (const char *type)
+{
+ unsigned res = 0;
+ BOOL flag = YES;
+
+ while (flag)
+ switch (*type++)
+ {
+ case _C_CONST: res |= _F_CONST; break;
+ case _C_IN: res |= _F_IN; break;
+ case _C_INOUT: res |= _F_INOUT; break;
+ case _C_OUT: res |= _F_OUT; break;
+ case _C_BYCOPY: res |= _F_BYCOPY; break;
+ case _C_BYREF: res |= _F_BYREF; break;
+ case _C_ONEWAY: res |= _F_ONEWAY; break;
+ case _C_GCINVISIBLE: res |= _F_GCINVISIBLE; break;
+ default: flag = NO;
+ }
+
+ return res;
+}
+
+
+/* The following three functions can be used to determine how a
+ structure is laid out by the compiler. For example:
+
+ struct objc_struct_layout layout;
+ int i;
+
+ objc_layout_structure (type, &layout);
+ while (objc_layout_structure_next_member (&layout))
+ {
+ int position, align;
+ const char *type;
+
+ objc_layout_structure_get_info (&layout, &position, &align, &type);
+ printf ("element %d has offset %d, alignment %d\n",
+ i++, position, align);
+ }
+
+ These functions are used by objc_sizeof_type and objc_alignof_type
+ functions to compute the size and alignment of structures. The
+ previous method of computing the size and alignment of a structure
+ was not working on some architectures, particulary on AIX, and in
+ the presence of bitfields inside the structure. */
+void
+objc_layout_structure (const char *type,
+ struct objc_struct_layout *layout)
+{
+ const char *ntype;
+
+ layout->original_type = ++type;
+
+ /* Skip "<name>=" if any. Avoid embedded structures and unions. */
+ ntype = type;
+ while (*ntype != _C_STRUCT_E && *ntype != _C_STRUCT_B && *ntype != _C_UNION_B
+ && *ntype++ != '=')
+ /* do nothing */;
+
+ /* If there's a "<name>=", ntype - 1 points to '='; skip the the name */
+ if (*(ntype - 1) == '=')
+ type = ntype;
+
+ layout->type = type;
+ layout->prev_type = NULL;
+ layout->record_size = 0;
+ layout->record_align = MAX (BITS_PER_UNIT, STRUCTURE_SIZE_BOUNDARY);
+}
+
+
+BOOL
+objc_layout_structure_next_member (struct objc_struct_layout *layout)
+{
+ register int desired_align = 0;
+
+ /* The current type without the type qualifiers */
+ const char *type;
+
+ /* Add the size of the previous field to the size of the record. */
+ if (layout->prev_type)
+ {
+ type = objc_skip_type_qualifiers (layout->prev_type);
+
+ if (*type != _C_BFLD)
+ layout->record_size += objc_sizeof_type (type) * BITS_PER_UNIT;
+ else
+ layout->record_size += atoi (++type);
+ }
+
+ if (*layout->type == _C_STRUCT_E)
+ return NO;
+
+ /* Skip the variable name if any */
+ if (*layout->type == '"')
+ {
+ for (layout->type++; *layout->type++ != '"';)
+ /* do nothing */;
+ }
+
+ type = objc_skip_type_qualifiers (layout->type);
+
+ desired_align = objc_alignof_type (type) * BITS_PER_UNIT;
+
+ /* Record must have at least as much alignment as any field.
+ Otherwise, the alignment of the field within the record
+ is meaningless. */
+ layout->record_align = MAX (layout->record_align, desired_align);
+
+ if (*type == _C_BFLD)
+ {
+ int bfld_size = atoi (++type);
+ int int_align = __alignof__ (int) * BITS_PER_UNIT;
+ /* If this bitfield would traverse a word alignment boundary, push it out
+ to that boundary instead. */
+ if (layout->record_size % int_align
+ && (layout->record_size / int_align
+ < (layout->record_size + bfld_size - 1) / int_align))
+ layout->record_size = ROUND (layout->record_size, int_align);
+ }
+ else if (layout->record_size % desired_align != 0)
+ {
+ /* We need to skip space before this field.
+ Bump the cumulative size to multiple of field alignment. */
+ layout->record_size = ROUND (layout->record_size, desired_align);
+ }
+
+ /* Jump to the next field in record. */
+
+ layout->prev_type = layout->type;
+ layout->type = objc_skip_typespec (layout->type); /* skip component */
+
+ return YES;
+}
+
+
+void objc_layout_finish_structure (struct objc_struct_layout *layout,
+ unsigned int *size,
+ unsigned int *align)
+{
+ if (layout->type && *layout->type == _C_STRUCT_E)
+ {
+ /* Round the size up to be a multiple of the required alignment */
+ layout->record_size = ROUND (layout->record_size, layout->record_align);
+ layout->type = NULL;
+ }
+ if (size)
+ *size = layout->record_size / BITS_PER_UNIT;
+ if (align)
+ *align = layout->record_align / BITS_PER_UNIT;
+}
+
+
+void objc_layout_structure_get_info (struct objc_struct_layout *layout,
+ unsigned int *offset,
+ unsigned int *align,
+ const char **type)
+{
+ if (offset)
+ *offset = layout->record_size / BITS_PER_UNIT;
+ if (align)
+ *align = layout->record_align / BITS_PER_UNIT;
+ if (type)
+ *type = layout->prev_type;
+}
+
+#endif /* #ifdef __NEXT_RUNTIME__ */
diff --git a/gcc/testsuite/objc/execute/np-2.m b/gcc/testsuite/objc/execute/np-2.m
index 37cf6ddd436..85aa203ca5c 100644
--- a/gcc/testsuite/objc/execute/np-2.m
+++ b/gcc/testsuite/objc/execute/np-2.m
@@ -17,6 +17,9 @@
{
printf ("methodA\n");
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
int main (void)
diff --git a/gcc/testsuite/objc/execute/object_is_class.m b/gcc/testsuite/objc/execute/object_is_class.m
index a053434fb14..87deb986497 100644
--- a/gcc/testsuite/objc/execute/object_is_class.m
+++ b/gcc/testsuite/objc/execute/object_is_class.m
@@ -3,6 +3,8 @@
#include <objc/objc-api.h>
#include <objc/Object.h>
+#include "next_mapping.h"
+
/* This test demonstrate a failure in object_is_class which was fixed */
/* Create a class whose instance variables mirror the struct used for
diff --git a/gcc/testsuite/objc/execute/object_is_meta_class.m b/gcc/testsuite/objc/execute/object_is_meta_class.m
index 90cd3a962f0..aeb129ef4e5 100644
--- a/gcc/testsuite/objc/execute/object_is_meta_class.m
+++ b/gcc/testsuite/objc/execute/object_is_meta_class.m
@@ -3,6 +3,8 @@
#include <objc/objc-api.h>
#include <objc/Object.h>
+#include "next_mapping.h"
+
/* This test demonstrate a failure in object_is_meta_class which was fixed */
@interface EvilClass : Object
diff --git a/gcc/testsuite/objc/execute/redefining_self.m b/gcc/testsuite/objc/execute/redefining_self.m
index 93659dbac8d..ddb2eb2e3d0 100644
--- a/gcc/testsuite/objc/execute/redefining_self.m
+++ b/gcc/testsuite/objc/execute/redefining_self.m
@@ -17,6 +17,9 @@
return self;
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
diff --git a/gcc/testsuite/objc/execute/root_methods.m b/gcc/testsuite/objc/execute/root_methods.m
index 4f2c2fa0ee4..c18ceb07284 100644
--- a/gcc/testsuite/objc/execute/root_methods.m
+++ b/gcc/testsuite/objc/execute/root_methods.m
@@ -1,6 +1,8 @@
/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
#include <objc/objc.h>
+#include "next_mapping.h"
+
/* Test that instance methods of root classes are available as class
methods to other classes as well */
@@ -16,6 +18,9 @@
{
return self;
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
@interface NormalClass : RootClass
diff --git a/gcc/testsuite/objc/execute/static-1.m b/gcc/testsuite/objc/execute/static-1.m
index 761e7070271..a778b722c15 100644
--- a/gcc/testsuite/objc/execute/static-1.m
+++ b/gcc/testsuite/objc/execute/static-1.m
@@ -19,6 +19,9 @@ static int test = 1;
return test;
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
int main (void)
diff --git a/gcc/testsuite/objc/execute/static-2.m b/gcc/testsuite/objc/execute/static-2.m
index 52a03a8fbd4..4d7e7449bff 100644
--- a/gcc/testsuite/objc/execute/static-2.m
+++ b/gcc/testsuite/objc/execute/static-2.m
@@ -22,6 +22,9 @@ static int test (void)
return test ();
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
int main (void)
diff --git a/gcc/testsuite/objc/execute/string1.m b/gcc/testsuite/objc/execute/string1.m
index fff03c7cfa6..58a603c1f1f 100644
--- a/gcc/testsuite/objc/execute/string1.m
+++ b/gcc/testsuite/objc/execute/string1.m
@@ -2,7 +2,12 @@
#include <string.h>
#include <stdlib.h>
+
+#ifdef __NEXT_RUNTIME__
+#import <Foundation/NSString.h>
+#else
#include <objc/NXConstStr.h>
+#endif
int main(int argc, void **args)
{
diff --git a/gcc/testsuite/objc/execute/string2.m b/gcc/testsuite/objc/execute/string2.m
index 66462b3c96c..01fb85c1189 100644
--- a/gcc/testsuite/objc/execute/string2.m
+++ b/gcc/testsuite/objc/execute/string2.m
@@ -2,7 +2,12 @@
#include <string.h>
#include <stdlib.h>
+
+#ifdef __NEXT_RUNTIME__
+#import <Foundation/NSString.h>
+#else
#include <objc/NXConstStr.h>
+#endif
int main(int argc, void **args)
{
diff --git a/gcc/testsuite/objc/execute/string3.m b/gcc/testsuite/objc/execute/string3.m
index 21527dcbf15..a8d29696899 100644
--- a/gcc/testsuite/objc/execute/string3.m
+++ b/gcc/testsuite/objc/execute/string3.m
@@ -2,7 +2,12 @@
#include <string.h>
#include <stdlib.h>
+
+#ifdef __NEXT_RUNTIME__
+#import <Foundation/NSString.h>
+#else
#include <objc/NXConstStr.h>
+#endif
#define STRING "this is a string"
diff --git a/gcc/testsuite/objc/execute/string4.m b/gcc/testsuite/objc/execute/string4.m
index 54550d6f5e9..16025cbaed6 100644
--- a/gcc/testsuite/objc/execute/string4.m
+++ b/gcc/testsuite/objc/execute/string4.m
@@ -2,7 +2,12 @@
#include <string.h>
#include <stdlib.h>
+
+#ifdef __NEXT_RUNTIME__
+#import <Foundation/NSString.h>
+#else
#include <objc/NXConstStr.h>
+#endif
int main(int argc, void **args)
{
diff --git a/gcc/testsuite/objc/execute/va_method.m b/gcc/testsuite/objc/execute/va_method.m
index bcf43d272a2..51619b8d313 100644
--- a/gcc/testsuite/objc/execute/va_method.m
+++ b/gcc/testsuite/objc/execute/va_method.m
@@ -1,6 +1,7 @@
/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include <stdarg.h>
/* Test method with variable number of arguments */
@@ -31,6 +32,9 @@
return sum;
}
+#ifdef __NEXT_RUNTIME__
++ initialize { return self; }
+#endif
@end
int main (void)
diff --git a/gcc/timevar.c b/gcc/timevar.c
index 6fa1610cc5d..9746488c649 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -226,7 +226,7 @@ timevar_init (void)
timevar_enable = true;
/* Zero all elapsed times. */
- memset ((void *) timevars, 0, sizeof (timevars));
+ memset (timevars, 0, sizeof (timevars));
/* Initialize the names of timing variables. */
#define DEFTIMEVAR(identifier__, name__) \
@@ -286,8 +286,7 @@ timevar_push (timevar_id_t timevar)
unused_stack_instances = unused_stack_instances->next;
}
else
- context = (struct timevar_stack_def *)
- xmalloc (sizeof (struct timevar_stack_def));
+ context = xmalloc (sizeof (struct timevar_stack_def));
/* Fill it in and put it on the stack. */
context->timevar = tv;
diff --git a/gcc/tlink.c b/gcc/tlink.c
index d377c7592dc..6406615b5e3 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -192,7 +192,7 @@ struct file_stack_entry *file_stack;
static void
symbol_push (symbol *p)
{
- struct symbol_stack_entry *ep = (struct symbol_stack_entry *) obstack_alloc
+ struct symbol_stack_entry *ep = obstack_alloc
(&symbol_stack_obstack, sizeof (struct symbol_stack_entry));
ep->value = p;
ep->next = symbol_stack;
@@ -220,7 +220,7 @@ file_push (file *p)
if (p->tweaking)
return;
- ep = (struct file_stack_entry *) obstack_alloc
+ ep = obstack_alloc
(&file_stack_obstack, sizeof (struct file_stack_entry));
ep->value = p;
ep->next = file_stack;
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 731c95cba13..03485bc8aed 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -134,7 +134,7 @@ static void rest_of_handle_loop2 (tree, rtx);
static void rest_of_handle_jump_bypass (tree, rtx);
static void rest_of_handle_sibling_calls (rtx);
static void rest_of_handle_null_pointer (tree, rtx);
-static void rest_of_handle_addresof (tree, rtx);
+static void rest_of_handle_addressof (tree, rtx);
static void rest_of_handle_cfg (tree, rtx);
static void rest_of_handle_branch_prob (tree, rtx);
static void rest_of_handle_if_conversion (tree, rtx);
@@ -221,7 +221,7 @@ int target_flags_explicit;
/* Debug hooks - dependent upon command line options. */
-const struct gcc_debug_hooks *debug_hooks = &do_nothing_debug_hooks;
+const struct gcc_debug_hooks *debug_hooks;
/* Describes a dump file. */
@@ -355,21 +355,6 @@ enum graph_dump_types graph_dump_format;
const char *asm_file_name;
-/* Type(s) of debugging information we are producing (if any).
- See flags.h for the definitions of the different possible
- types of debugging information. */
-enum debug_info_type write_symbols = NO_DEBUG;
-
-/* Level of debugging information we are producing. See flags.h
- for the definitions of the different possible levels. */
-enum debug_info_level debug_info_level = DINFO_LEVEL_NONE;
-
-/* Nonzero means use GNU-only extensions in the generated symbolic
- debugging information. */
-/* Currently, this only has an effect when write_symbols is set to
- DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */
-int use_gnu_debug_info_extensions = 0;
-
/* Nonzero means do optimizations. -O.
Particular numeric values stand for particular amounts of optimization;
thus, -O2 stores 2 here. However, the optimizations beyond the basic
@@ -465,7 +450,7 @@ int mem_report = 0;
and to print them when we are done. */
int flag_detailed_statistics = 0;
-/* A random sequence of characters, unless overridden by user. */
+/* A random sequence of characters, unless overridden by user. */
const char *flag_random_seed;
/* A local time stamp derived from the time of compilation. It will be
@@ -648,6 +633,11 @@ int flag_finite_math_only = 0;
int flag_trapping_math = 1;
+/* Nonzero means disable transformations that assume default floating
+ point rounding behavior. */
+
+int flag_rounding_math = 0;
+
/* Nonzero means disable transformations observable by signaling NaNs.
This option implies that any operation on an IEEE signaling NaN can
generate a (user-visible) trap. */
@@ -984,52 +974,11 @@ int align_functions_log;
minimum function alignment. Zero means no alignment is forced. */
int force_align_functions_log;
-/* Table of supported debugging formats. */
-static const struct
-{
- const char *const arg;
- /* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
- constant expression, we use NO_DEBUG in its place. */
- const enum debug_info_type debug_type;
- const int use_extensions_p;
- const char *const description;
-} *da,
-debug_args[] =
-{
- { "", NO_DEBUG, DEFAULT_GDB_EXTENSIONS,
- N_("Generate debugging info in default format") },
- { "gdb", NO_DEBUG, 1, N_("Generate debugging info in default extended format") },
-#ifdef DBX_DEBUGGING_INFO
- { "stabs", DBX_DEBUG, 0, N_("Generate STABS format debug info") },
- { "stabs+", DBX_DEBUG, 1, N_("Generate extended STABS format debug info") },
-#endif
-#ifdef DWARF_DEBUGGING_INFO
- { "dwarf", DWARF_DEBUG, 0, N_("Generate DWARF-1 format debug info") },
- { "dwarf+", DWARF_DEBUG, 1,
- N_("Generate extended DWARF-1 format debug info") },
-#endif
-#ifdef DWARF2_DEBUGGING_INFO
- { "dwarf-2", DWARF2_DEBUG, 0, N_("Generate DWARF-2 debug info") },
-#endif
-#ifdef XCOFF_DEBUGGING_INFO
- { "xcoff", XCOFF_DEBUG, 0, N_("Generate XCOFF format debug info") },
- { "xcoff+", XCOFF_DEBUG, 1, N_("Generate extended XCOFF format debug info") },
-#endif
-#ifdef SDB_DEBUGGING_INFO
- { "coff", SDB_DEBUG, 0, N_("Generate COFF format debug info") },
-#endif
-#ifdef VMS_DEBUGGING_INFO
- { "vms", VMS_DEBUG, 0, N_("Generate VMS format debug info") },
-#endif
- { 0, 0, 0, 0 }
-};
-
typedef struct
{
const char *const string;
int *const variable;
const int on_value;
- const char *const description;
}
lang_independent_options;
@@ -1061,419 +1010,124 @@ static const param_info lang_independent_params[] = {
static const lang_independent_options f_options[] =
{
- {"eliminate-dwarf2-dups", &flag_eliminate_dwarf2_dups, 1,
- N_("Perform DWARF2 duplicate elimination") },
- {"eliminate-unused-debug-symbols", &flag_debug_only_used_symbols, 1,
- N_("Perform unused type elimination in debug info") },
- {"eliminate-unused-debug-types", &flag_eliminate_unused_debug_types, 1,
- N_("Perform unused type elimination in debug info") },
- {"float-store", &flag_float_store, 1,
- N_("Do not store floats in registers") },
- {"defer-pop", &flag_defer_pop, 1,
- N_("Defer popping functions args from stack until later") },
- {"omit-frame-pointer", &flag_omit_frame_pointer, 1,
- N_("When possible do not generate stack frames") },
- {"optimize-sibling-calls", &flag_optimize_sibling_calls, 1,
- N_("Optimize sibling and tail recursive calls") },
- {"tracer", &flag_tracer, 1,
- N_("Perform superblock formation via tail duplication") },
- {"unit-at-a-time", &flag_unit_at_a_time, 1,
- N_("Compile whole compilation unit at a time") },
- {"cse-follow-jumps", &flag_cse_follow_jumps, 1,
- N_("When running CSE, follow jumps to their targets") },
- {"cse-skip-blocks", &flag_cse_skip_blocks, 1,
- N_("When running CSE, follow conditional jumps") },
- {"expensive-optimizations", &flag_expensive_optimizations, 1,
- N_("Perform a number of minor, expensive optimizations") },
- {"thread-jumps", &flag_thread_jumps, 1,
- N_("Perform jump threading optimizations") },
- {"strength-reduce", &flag_strength_reduce, 1,
- N_("Perform strength reduction optimizations") },
- {"unroll-loops", &flag_unroll_loops, 1,
- N_("Perform loop unrolling when iteration count is known") },
- {"unroll-all-loops", &flag_unroll_all_loops, 1,
- N_("Perform loop unrolling for all loops") },
- {"old-unroll-loops", &flag_old_unroll_loops, 1,
- N_("Perform loop unrolling when iteration count is known") },
- {"old-unroll-all-loops", &flag_old_unroll_all_loops, 1,
- N_("Perform loop unrolling for all loops") },
- {"peel-loops", &flag_peel_loops, 1,
- N_("Perform loop peeling") },
- {"unswitch-loops", &flag_unswitch_loops, 1,
- N_("Perform loop unswitching") },
- {"prefetch-loop-arrays", &flag_prefetch_loop_arrays, 1,
- N_("Generate prefetch instructions, if available, for arrays in loops") },
- {"move-all-movables", &flag_move_all_movables, 1,
- N_("Force all loop invariant computations out of loops") },
- {"reduce-all-givs", &flag_reduce_all_givs, 1,
- N_("Strength reduce all loop general induction variables") },
- {"writable-strings", &flag_writable_strings, 1,
- N_("Store strings in writable data section") },
- {"peephole", &flag_no_peephole, 0,
- N_("Enable machine specific peephole optimizations") },
- {"force-mem", &flag_force_mem, 1,
- N_("Copy memory operands into registers before using") },
- {"force-addr", &flag_force_addr, 1,
- N_("Copy memory address constants into regs before using") },
- {"function-cse", &flag_no_function_cse, 0,
- N_("Allow function addresses to be held in registers") },
- {"inline-functions", &flag_inline_functions, 1,
- N_("Integrate simple functions into their callers") },
- {"keep-inline-functions", &flag_keep_inline_functions, 1,
- N_("Generate code for funcs even if they are fully inlined") },
- {"inline", &flag_no_inline, 0,
- N_("Pay attention to the 'inline' keyword") },
- {"keep-static-consts", &flag_keep_static_consts, 1,
- N_("Emit static const variables even if they are not used") },
- {"syntax-only", &flag_syntax_only, 1,
- N_("Check for syntax errors, then stop") },
- {"shared-data", &flag_shared_data, 1,
- N_("Mark data as shared rather than private") },
- {"caller-saves", &flag_caller_saves, 1,
- N_("Enable saving registers around function calls") },
- {"pcc-struct-return", &flag_pcc_struct_return, 1,
- N_("Return 'short' aggregates in memory, not registers") },
- {"reg-struct-return", &flag_pcc_struct_return, 0,
- N_("Return 'short' aggregates in registers") },
- {"delayed-branch", &flag_delayed_branch, 1,
- N_("Attempt to fill delay slots of branch instructions") },
- {"gcse", &flag_gcse, 1,
- N_("Perform the global common subexpression elimination") },
- {"gcse-lm", &flag_gcse_lm, 1,
- N_("Perform enhanced load motion during global subexpression elimination") },
- {"gcse-sm", &flag_gcse_sm, 1,
- N_("Perform store motion after global subexpression elimination") },
- {"branch-target-load-optimize", &flag_branch_target_load_optimize, 1,
- N_("Perform branch target load optimization before prologue / epilogue threading") },
- {"branch-target-load-optimize2", &flag_branch_target_load_optimize2, 1,
- N_("Perform branch target load optimization after prologue / epilogue threading") },
- {"loop-optimize", &flag_loop_optimize, 1,
- N_("Perform the loop optimizations") },
- {"crossjumping", &flag_crossjumping, 1,
- N_("Perform cross-jumping optimization") },
- {"if-conversion", &flag_if_conversion, 1,
- N_("Perform conversion of conditional jumps to branchless equivalents") },
- {"if-conversion2", &flag_if_conversion2, 1,
- N_("Perform conversion of conditional jumps to conditional execution") },
- {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
- N_("Run CSE pass after loop optimizations") },
- {"rerun-loop-opt", &flag_rerun_loop_opt, 1,
- N_("Run the loop optimizer twice") },
- {"delete-null-pointer-checks", &flag_delete_null_pointer_checks, 1,
- N_("Delete useless null pointer checks") },
- {"schedule-insns", &flag_schedule_insns, 1,
- N_("Reschedule instructions before register allocation") },
- {"schedule-insns2", &flag_schedule_insns_after_reload, 1,
- N_("Reschedule instructions after register allocation") },
- {"sched-interblock",&flag_schedule_interblock, 1,
- N_("Enable scheduling across basic blocks") },
- {"sched-spec",&flag_schedule_speculative, 1,
- N_("Allow speculative motion of non-loads") },
- {"sched-spec-load",&flag_schedule_speculative_load, 1,
- N_("Allow speculative motion of some loads") },
- {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1,
- N_("Allow speculative motion of more loads") },
- {"sched2-use-superblocks", &flag_sched2_use_superblocks, 1,
- N_("If scheduling post reload, do superblock scheduling") },
- {"sched2-use-traces", &flag_sched2_use_traces, 1,
- N_("If scheduling post reload, do trace scheduling") },
- {"branch-count-reg",&flag_branch_on_count_reg, 1,
- N_("Replace add,compare,branch with branch on count reg") },
- {"pic", &flag_pic, 1,
- N_("Generate position independent code, if possible") },
- {"PIC", &flag_pic, 2, ""},
- {"pie", &flag_pie, 1,
- N_("Generate position independent code for executables, if possible") },
- {"PIE", &flag_pie, 2, ""},
- {"exceptions", &flag_exceptions, 1,
- N_("Enable exception handling") },
- {"unwind-tables", &flag_unwind_tables, 1,
- N_("Just generate unwind tables for exception handling") },
- {"asynchronous-unwind-tables", &flag_asynchronous_unwind_tables, 1,
- N_("Generate unwind tables exact at each instruction boundary") },
- {"non-call-exceptions", &flag_non_call_exceptions, 1,
- N_("Support synchronous non-call exceptions") },
- {"profile-arcs", &profile_arc_flag, 1,
- N_("Insert arc based program profiling code") },
- {"test-coverage", &flag_test_coverage, 1,
- N_("Create data files needed by gcov") },
- {"branch-probabilities", &flag_branch_probabilities, 1,
- N_("Use profiling information for branch probabilities") },
- {"profile", &profile_flag, 1,
- N_("Enable basic program profiling code") },
- {"reorder-blocks", &flag_reorder_blocks, 1,
- N_("Reorder basic blocks to improve code placement") },
- {"reorder-functions", &flag_reorder_functions, 1,
- N_("Reorder functions to improve code placement") },
- {"rename-registers", &flag_rename_registers, 1,
- N_("Do the register renaming optimization pass") },
- {"cprop-registers", &flag_cprop_registers, 1,
- N_("Do the register copy-propagation optimization pass") },
- {"common", &flag_no_common, 0,
- N_("Do not put uninitialized globals in the common section") },
- {"inhibit-size-directive", &flag_inhibit_size_directive, 1,
- N_("Do not generate .size directives") },
- {"function-sections", &flag_function_sections, 1,
- N_("place each function into its own section") },
- {"data-sections", &flag_data_sections, 1,
- N_("place data items into their own section") },
- {"verbose-asm", &flag_verbose_asm, 1,
- N_("Add extra commentary to assembler output") },
- {"gnu-linker", &flag_gnu_linker, 1,
- N_("Output GNU ld formatted global initializers") },
- {"regmove", &flag_regmove, 1,
- N_("Enables a register move optimization") },
- {"optimize-register-move", &flag_regmove, 1,
- N_("Do the full regmove optimization pass") },
- {"pack-struct", &flag_pack_struct, 1,
- N_("Pack structure members together without holes") },
- {"stack-check", &flag_stack_check, 1,
- N_("Insert stack checking code into the program") },
- {"argument-alias", &flag_argument_noalias, 0,
- N_("Specify that arguments may alias each other & globals") },
- {"argument-noalias", &flag_argument_noalias, 1,
- N_("Assume arguments may alias globals but not each other") },
- {"argument-noalias-global", &flag_argument_noalias, 2,
- N_("Assume arguments do not alias each other or globals") },
- {"strict-aliasing", &flag_strict_aliasing, 1,
- N_("Assume strict aliasing rules apply") },
- {"align-loops", &align_loops, 0,
- N_("Align the start of loops") },
- {"align-jumps", &align_jumps, 0,
- N_("Align labels which are only reached by jumping") },
- {"align-labels", &align_labels, 0,
- N_("Align all labels") },
- {"align-functions", &align_functions, 0,
- N_("Align the start of functions") },
- {"merge-constants", &flag_merge_constants, 1,
- N_("Attempt to merge identical constants across compilation units") },
- {"merge-all-constants", &flag_merge_constants, 2,
- N_("Attempt to merge identical constants and constant variables") },
- {"dump-unnumbered", &flag_dump_unnumbered, 1,
- N_("Suppress output of instruction numbers and line number notes in debugging dumps") },
- {"instrument-functions", &flag_instrument_function_entry_exit, 1,
- N_("Instrument function entry/exit with profiling calls") },
- {"zero-initialized-in-bss", &flag_zero_initialized_in_bss, 1,
- N_("Put zero initialized data in the bss section") },
- {"ssa", &flag_ssa, 1,
- N_("Enable SSA optimizations") },
- {"ssa-ccp", &flag_ssa_ccp, 1,
- N_("Enable SSA conditional constant propagation") },
- {"ssa-dce", &flag_ssa_dce, 1,
- N_("Enable aggressive SSA dead code elimination") },
- {"leading-underscore", &flag_leading_underscore, 1,
- N_("External symbols have a leading underscore") },
- {"ident", &flag_no_ident, 0,
- N_("Process #ident directives") },
- { "peephole2", &flag_peephole2, 1,
- N_("Enables an rtl peephole pass run before sched2") },
- {"finite-math-only", &flag_finite_math_only, 1,
- N_("Assume no NaNs or +-Infs are generated") },
- { "guess-branch-probability", &flag_guess_branch_prob, 1,
- N_("Enables guessing of branch probabilities") },
- {"math-errno", &flag_errno_math, 1,
- N_("Set errno after built-in math functions") },
- {"trapping-math", &flag_trapping_math, 1,
- N_("Floating-point operations can trap") },
- {"unsafe-math-optimizations", &flag_unsafe_math_optimizations, 1,
- N_("Allow math optimizations that may violate IEEE or ANSI standards") },
- {"signaling-nans", &flag_signaling_nans, 1,
- N_("Disable optimizations observable by IEEE signaling NaNs") },
- {"bounds-check", &flag_bounds_check, 1,
- N_("Generate code to check bounds before indexing arrays") },
- {"single-precision-constant", &flag_single_precision_constant, 1,
- N_("Convert floating point constant to single precision constant") },
- {"time-report", &time_report, 1,
- N_("Report time taken by each compiler pass at end of run") },
- {"mem-report", &mem_report, 1,
- N_("Report on permanent memory allocation at end of run") },
- { "trapv", &flag_trapv, 1,
- N_("Trap for signed overflow in addition / subtraction / multiplication") },
- { "wrapv", &flag_wrapv, 1,
- N_("Assume signed arithmetic overflow wraps around") },
- { "new-ra", &flag_new_regalloc, 1,
- N_("Use graph coloring register allocation.") },
-};
-
-/* Table of language-specific options. */
-
-static const struct lang_opt
-{
- const char *const option;
- const char *const description;
-}
-documented_lang_options[] =
-{
- /* In order not to overload the --help output, the convention
- used here is to only describe those options which are not
- enabled by default. */
-
- { "-ansi",
- N_("Compile just for ISO C90") },
- { "-std= ",
- N_("Determine language standard") },
-
- { "-fsigned-bitfields", "" },
- { "-funsigned-bitfields",
- N_("Make bit-fields by unsigned by default") },
- { "-fno-signed-bitfields", "" },
- { "-fno-unsigned-bitfields","" },
- { "-fsigned-char",
- N_("Make 'char' be signed by default") },
- { "-funsigned-char",
- N_("Make 'char' be unsigned by default") },
- { "-fno-signed-char", "" },
- { "-fno-unsigned-char", "" },
-
- { "-fasm", "" },
- { "-fno-asm",
- N_("Do not recognize the 'asm' keyword") },
- { "-fbuiltin", "" },
- { "-fno-builtin",
- N_("Do not recognize any built in functions") },
- { "-fhosted",
- N_("Assume normal C execution environment") },
- { "-fno-hosted", "" },
- { "-ffreestanding",
- N_("Assume that standard libraries & main might not exist") },
- { "-fno-freestanding", "" },
- { "-fcond-mismatch",
- N_("Allow different types as args of ? operator") },
- { "-fno-cond-mismatch", "" },
- { "-fdollars-in-identifiers",
- N_("Allow the use of $ inside identifiers") },
- { "-fno-dollars-in-identifiers", "" },
- { "-fpreprocessed", "" },
- { "-fno-preprocessed", "" },
- { "-fshort-double",
- N_("Use the same size for double as for float") },
- { "-fno-short-double", "" },
- { "-fshort-enums",
- N_("Use the smallest fitting integer to hold enums") },
- { "-fno-short-enums", "" },
- { "-fshort-wchar",
- N_("Override the underlying type for wchar_t to `unsigned short'") },
- { "-fno-short-wchar", "" },
-
- { "-Wall",
- N_("Enable most warning messages") },
- { "-Wbad-function-cast",
- N_("Warn about casting functions to incompatible types") },
- { "-Wno-bad-function-cast", "" },
- { "-Wmissing-format-attribute",
- N_("Warn about functions which might be candidates for format attributes") },
- { "-Wno-missing-format-attribute", "" },
- { "-Wcast-qual",
- N_("Warn about casts which discard qualifiers") },
- { "-Wno-cast-qual", "" },
- { "-Wchar-subscripts",
- N_("Warn about subscripts whose type is 'char'") },
- { "-Wno-char-subscripts", "" },
- { "-Wcomment",
- N_("Warn if nested comments are detected") },
- { "-Wno-comment", "" },
- { "-Wcomments",
- N_("Warn if nested comments are detected") },
- { "-Wno-comments", "" },
- { "-Wconversion",
- N_("Warn about possibly confusing type conversions") },
- { "-Wno-conversion", "" },
- { "-Wdiv-by-zero", "" },
- { "-Wno-div-by-zero",
- N_("Do not warn about compile-time integer division by zero") },
- { "-Wfloat-equal",
- N_("Warn about testing equality of floating point numbers") },
- { "-Wno-float-equal", "" },
- { "-Wformat",
- N_("Warn about printf/scanf/strftime/strfmon format anomalies") },
- { "-Wno-format", "" },
- { "-Wformat-extra-args", "" },
- { "-Wno-format-extra-args",
- N_("Don't warn about too many arguments to format functions") },
- { "-Wformat-nonliteral",
- N_("Warn about non-string-literal format strings") },
- { "-Wno-format-nonliteral", "" },
- { "-Wformat-security",
- N_("Warn about possible security problems with format functions") },
- { "-Wno-format-security", "" },
- { "-Wformat-y2k", "" },
- { "-Wno-format-y2k",
- N_("Don't warn about strftime formats yielding 2 digit years") },
- { "-Wimplicit-function-declaration",
- N_("Warn about implicit function declarations") },
- { "-Wno-implicit-function-declaration", "" },
- { "-Werror-implicit-function-declaration", "" },
- { "-Wimplicit-int",
- N_("Warn when a declaration does not specify a type") },
- { "-Wno-implicit-int", "" },
- { "-Wimplicit", "" },
- { "-Wno-implicit", "" },
- { "-Wimport",
- N_("Warn about the use of the #import directive") },
- { "-Wno-import", "" },
- { "-Winvalid-pch",
- N_("Warn about PCH files that are found but not used") },
- { "-Wlong-long","" },
- { "-Wno-long-long",
- N_("Do not warn about using 'long long' when -pedantic") },
- { "-Wmain",
- N_("Warn about suspicious declarations of main") },
- { "-Wno-main", "" },
- { "-Wmissing-braces",
- N_("Warn about possibly missing braces around initializers") },
- { "-Wno-missing-braces", "" },
- { "-Wmissing-declarations",
- N_("Warn about global funcs without previous declarations") },
- { "-Wno-missing-declarations", "" },
- { "-Wmissing-prototypes",
- N_("Warn about global funcs without prototypes") },
- { "-Wno-missing-prototypes", "" },
- { "-Wmultichar",
- N_("Warn about use of multicharacter literals") },
- { "-Wno-multichar", "" },
- { "-Wnested-externs",
- N_("Warn about externs not at file scope level") },
- { "-Wno-nested-externs", "" },
- { "-Wparentheses",
- N_("Warn about possible missing parentheses") },
- { "-Wno-parentheses", "" },
- { "-Wpointer-arith",
- N_("Warn about function pointer arithmetic") },
- { "-Wno-pointer-arith", "" },
- { "-Wredundant-decls",
- N_("Warn about multiple declarations of the same object") },
- { "-Wno-redundant-decls", "" },
- { "-Wreturn-type",
- N_("Warn whenever a function's return-type defaults to int") },
- { "-Wno-return-type", "" },
- { "-Wsequence-point",
- N_("Warn about possible violations of sequence point rules") },
- { "-Wno-sequence-point", "" },
- { "-Wsign-compare",
- N_("Warn about signed/unsigned comparisons") },
- { "-Wno-sign-compare", "" },
- { "-Wstrict-prototypes",
- N_("Warn about non-prototyped function decls") },
- { "-Wno-strict-prototypes", "" },
- { "-Wtraditional",
- N_("Warn about constructs whose meanings change in ISO C") },
- { "-Wno-traditional", "" },
- { "-Wtrigraphs",
- N_("Warn when trigraphs are encountered") },
- { "-Wno-trigraphs", "" },
- { "-Wundef", "" },
- { "-Wno-undef", "" },
- { "-Wunknown-pragmas",
- N_("Warn about unrecognized pragmas") },
- { "-Wno-unknown-pragmas", "" },
- { "-Wwrite-strings",
- N_("Mark strings as 'const char *'") },
- { "-Wno-write-strings", "" },
-
-#define DEFINE_LANG_NAME(NAME) { NULL, NAME },
-
-#include "options_.h"
-
+ {"eliminate-dwarf2-dups", &flag_eliminate_dwarf2_dups, 1 },
+ {"eliminate-unused-debug-symbols", &flag_debug_only_used_symbols, 1 },
+ {"eliminate-unused-debug-types", &flag_eliminate_unused_debug_types, 1 },
+ {"float-store", &flag_float_store, 1 },
+ {"defer-pop", &flag_defer_pop, 1 },
+ {"omit-frame-pointer", &flag_omit_frame_pointer, 1 },
+ {"optimize-sibling-calls", &flag_optimize_sibling_calls, 1 },
+ {"tracer", &flag_tracer, 1 },
+ {"unit-at-a-time", &flag_unit_at_a_time, 1 },
+ {"cse-follow-jumps", &flag_cse_follow_jumps, 1 },
+ {"cse-skip-blocks", &flag_cse_skip_blocks, 1 },
+ {"expensive-optimizations", &flag_expensive_optimizations, 1 },
+ {"thread-jumps", &flag_thread_jumps, 1 },
+ {"strength-reduce", &flag_strength_reduce, 1 },
+ {"unroll-loops", &flag_unroll_loops, 1 },
+ {"unroll-all-loops", &flag_unroll_all_loops, 1 },
+ {"old-unroll-loops", &flag_old_unroll_loops, 1 },
+ {"old-unroll-all-loops", &flag_old_unroll_all_loops, 1 },
+ {"peel-loops", &flag_peel_loops, 1 },
+ {"unswitch-loops", &flag_unswitch_loops, 1 },
+ {"prefetch-loop-arrays", &flag_prefetch_loop_arrays, 1 },
+ {"move-all-movables", &flag_move_all_movables, 1 },
+ {"reduce-all-givs", &flag_reduce_all_givs, 1 },
+ {"writable-strings", &flag_writable_strings, 1 },
+ {"peephole", &flag_no_peephole, 0 },
+ {"force-mem", &flag_force_mem, 1 },
+ {"force-addr", &flag_force_addr, 1 },
+ {"function-cse", &flag_no_function_cse, 0 },
+ {"inline-functions", &flag_inline_functions, 1 },
+ {"keep-inline-functions", &flag_keep_inline_functions, 1 },
+ {"inline", &flag_no_inline, 0 },
+ {"keep-static-consts", &flag_keep_static_consts, 1 },
+ {"syntax-only", &flag_syntax_only, 1 },
+ {"shared-data", &flag_shared_data, 1 },
+ {"caller-saves", &flag_caller_saves, 1 },
+ {"pcc-struct-return", &flag_pcc_struct_return, 1 },
+ {"reg-struct-return", &flag_pcc_struct_return, 0 },
+ {"delayed-branch", &flag_delayed_branch, 1 },
+ {"gcse", &flag_gcse, 1 },
+ {"gcse-lm", &flag_gcse_lm, 1 },
+ {"gcse-sm", &flag_gcse_sm, 1 },
+ {"branch-target-load-optimize", &flag_branch_target_load_optimize, 1 },
+ {"branch-target-load-optimize2", &flag_branch_target_load_optimize2, 1 },
+ {"loop-optimize", &flag_loop_optimize, 1 },
+ {"crossjumping", &flag_crossjumping, 1 },
+ {"if-conversion", &flag_if_conversion, 1 },
+ {"if-conversion2", &flag_if_conversion2, 1 },
+ {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1 },
+ {"rerun-loop-opt", &flag_rerun_loop_opt, 1 },
+ {"delete-null-pointer-checks", &flag_delete_null_pointer_checks, 1 },
+ {"schedule-insns", &flag_schedule_insns, 1 },
+ {"schedule-insns2", &flag_schedule_insns_after_reload, 1 },
+ {"sched-interblock",&flag_schedule_interblock, 1 },
+ {"sched-spec",&flag_schedule_speculative, 1 },
+ {"sched-spec-load",&flag_schedule_speculative_load, 1 },
+ {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1 },
+ {"sched2-use-superblocks", &flag_sched2_use_superblocks, 1 },
+ {"sched2-use-traces", &flag_sched2_use_traces, 1 },
+ {"branch-count-reg",&flag_branch_on_count_reg, 1 },
+ {"pic", &flag_pic, 1 },
+ {"PIC", &flag_pic, 2 },
+ {"pie", &flag_pie, 1 },
+ {"PIE", &flag_pie, 2 },
+ {"exceptions", &flag_exceptions, 1 },
+ {"unwind-tables", &flag_unwind_tables, 1 },
+ {"asynchronous-unwind-tables", &flag_asynchronous_unwind_tables, 1 },
+ {"non-call-exceptions", &flag_non_call_exceptions, 1 },
+ {"profile-arcs", &profile_arc_flag, 1 },
+ {"test-coverage", &flag_test_coverage, 1 },
+ {"branch-probabilities", &flag_branch_probabilities, 1 },
+ {"profile", &profile_flag, 1 },
+ {"reorder-blocks", &flag_reorder_blocks, 1 },
+ {"reorder-functions", &flag_reorder_functions, 1 },
+ {"rename-registers", &flag_rename_registers, 1 },
+ {"cprop-registers", &flag_cprop_registers, 1 },
+ {"common", &flag_no_common, 0 },
+ {"inhibit-size-directive", &flag_inhibit_size_directive, 1 },
+ {"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 },
+ {"stack-check", &flag_stack_check, 1 },
+ {"argument-alias", &flag_argument_noalias, 0 },
+ {"argument-noalias", &flag_argument_noalias, 1 },
+ {"argument-noalias-global", &flag_argument_noalias, 2 },
+ {"strict-aliasing", &flag_strict_aliasing, 1 },
+ {"align-loops", &align_loops, 0 },
+ {"align-jumps", &align_jumps, 0 },
+ {"align-labels", &align_labels, 0 },
+ {"align-functions", &align_functions, 0 },
+ {"merge-constants", &flag_merge_constants, 1 },
+ {"merge-all-constants", &flag_merge_constants, 2 },
+ {"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 },
+ {"finite-math-only", &flag_finite_math_only, 1 },
+ { "guess-branch-probability", &flag_guess_branch_prob, 1 },
+ {"math-errno", &flag_errno_math, 1 },
+ {"trapping-math", &flag_trapping_math, 1 },
+ {"rounding-math", &flag_rounding_math, 1 },
+ {"unsafe-math-optimizations", &flag_unsafe_math_optimizations, 1 },
+ {"signaling-nans", &flag_signaling_nans, 1 },
+ {"bounds-check", &flag_bounds_check, 1 },
+ {"single-precision-constant", &flag_single_precision_constant, 1 },
+ {"time-report", &time_report, 1 },
+ {"mem-report", &mem_report, 1 },
+ { "trapv", &flag_trapv, 1 },
+ { "wrapv", &flag_wrapv, 1 },
+ { "new-ra", &flag_new_regalloc, 1 }
};
/* Here is a table, controlled by the tm.h file, listing each -m switch
@@ -1516,6 +1170,58 @@ FILE *aux_info_file;
FILE *rtl_dump_file = NULL;
FILE *cgraph_dump_file = NULL;
+/* The current working directory of a translation. It's generally the
+ directory from which compilation was initiated, but a preprocessed
+ file may specify the original directory in which it was
+ created. */
+
+static const char *src_pwd;
+
+/* Initialize src_pwd with the given string, and return true. If it
+ was already initialized, return false. As a special case, it may
+ be called with a NULL argument to test whether src_pwd has NOT been
+ initialized yet. */
+
+bool
+set_src_pwd (const char *pwd)
+{
+ if (src_pwd)
+ return false;
+
+ src_pwd = xstrdup (pwd);
+ return true;
+}
+
+/* Return the directory from which the translation unit was initiated,
+ in case set_src_pwd() was not called before to assign it a
+ different value. */
+
+const char *
+get_src_pwd (void)
+{
+ if (! src_pwd)
+ src_pwd = getpwd ();
+
+ return src_pwd;
+}
+
+/* Called when the start of a function definition is parsed,
+ this function prints on stderr the name of the function. */
+void
+announce_function (tree decl)
+{
+ if (!quiet_flag)
+ {
+ if (rtl_dump_and_exit)
+ verbatim ("%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
+ else
+ verbatim (" %s", (*lang_hooks.decl_printable_name) (decl, 2));
+ fflush (stderr);
+ pp_needs_newline (global_dc->printer) = true;
+ diagnostic_set_last_function (global_dc);
+ }
+}
+
/* Set up a default flag_random_seed and local_tick, unless the user
already specified one. */
@@ -1882,7 +1588,7 @@ wrapup_global_declarations (tree *vec, int len)
if (flag_unit_at_a_time
&& cgraph_varpool_node (decl)->finalized)
needed = 0;
- else if (flag_unit_at_a_time
+ else if ((flag_unit_at_a_time && !cgraph_global_info_ready)
&& (TREE_USED (decl)
|| TREE_USED (DECL_ASSEMBLER_NAME (decl))))
/* needed */;
@@ -1905,6 +1611,7 @@ wrapup_global_declarations (tree *vec, int len)
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_INITIAL (decl) != 0
&& DECL_SAVED_INSNS (decl) != 0
+ && DECL_SAVED_INSNS (decl)->saved_for_inline
&& (flag_keep_inline_functions
|| (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
@@ -1956,11 +1663,9 @@ check_global_declarations (tree *vec, int len)
&& ! TREE_PUBLIC (decl))
{
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
- pedwarn_with_decl (decl,
- "`%s' used but never defined");
+ pedwarn ("%J'%F' used but never defined", decl, decl);
else
- warning_with_decl (decl,
- "`%s' declared `static' but never defined");
+ warning ("%J'%F' declared `static' but never defined", decl, decl);
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1;
assemble_external (decl);
@@ -1981,7 +1686,7 @@ check_global_declarations (tree *vec, int len)
&& ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
/* Otherwise, ask the language. */
&& (*lang_hooks.decls.warn_unused_global) (decl))
- warning_with_decl (decl, "`%s' defined but not used");
+ warning ("%J'%D' defined but not used", decl, decl);
/* Avoid confusing the debug information machinery when there are
errors. */
@@ -1994,6 +1699,44 @@ check_global_declarations (tree *vec, int len)
}
}
+/* Warn about a use of an identifier which was marked deprecated. */
+void
+warn_deprecated_use (tree node)
+{
+ if (node == 0 || !warn_deprecated_decl)
+ return;
+
+ if (DECL_P (node))
+ warning ("`%s' is deprecated (declared at %s:%d)",
+ IDENTIFIER_POINTER (DECL_NAME (node)),
+ DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
+ else if (TYPE_P (node))
+ {
+ const char *what = NULL;
+ tree decl = TYPE_STUB_DECL (node);
+
+ if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
+ what = IDENTIFIER_POINTER (TYPE_NAME (node));
+ else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
+ && DECL_NAME (TYPE_NAME (node)))
+ what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
+
+ if (what)
+ {
+ if (decl)
+ warning ("`%s' is deprecated (declared at %s:%d)", what,
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ else
+ warning ("`%s' is deprecated", what);
+ }
+ else if (decl)
+ warning ("type is deprecated (declared at %s:%d)",
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ else
+ warning ("type is deprecated");
+ }
+}
+
/* Save the current INPUT_LOCATION on the top entry in the
INPUT_FILE_STACK. Push a new entry for FILE and LINE, and set the
INPUT_LOCATION accordingly. */
@@ -2003,7 +1746,7 @@ push_srcloc (const char *file, int line)
{
struct file_stack *fs;
- fs = (struct file_stack *) xmalloc (sizeof (struct file_stack));
+ fs = xmalloc (sizeof (struct file_stack));
fs->location = input_location;
fs->next = input_file_stack;
input_filename = file;
@@ -2159,7 +1902,7 @@ rest_of_decl_compilation (tree decl,
/* Don't output anything when a tentative file-scope definition
is seen. But at end of compilation, do output code for them. */
- if (at_end || !DECL_DEFER_OUTPUT (decl))
+ if ((at_end || !DECL_DEFER_OUTPUT (decl)) && !DECL_EXTERNAL (decl))
{
if (flag_unit_at_a_time && !cgraph_global_info_ready
&& TREE_CODE (decl) != FUNCTION_DECL && top_level)
@@ -2336,6 +2079,23 @@ rest_of_handle_delay_slots (tree decl, rtx insns)
static void
rest_of_handle_stack_regs (tree decl, rtx insns)
{
+#if defined (HAVE_ATTR_length)
+ /* If flow2 creates new instructions which need splitting
+ and scheduling after reload is not done, they might not be
+ splitten until final which doesn't allow splitting
+ if HAVE_ATTR_length. */
+#ifdef INSN_SCHEDULING
+ if (optimize && !flag_schedule_insns_after_reload)
+#else
+ if (optimize)
+#endif
+ {
+ timevar_push (TV_SHORTEN_BRANCH);
+ split_all_insns (1);
+ timevar_pop (TV_SHORTEN_BRANCH);
+ }
+#endif
+
timevar_push (TV_REG_STACK);
open_dump_file (DFI_stack, decl);
@@ -2432,7 +2192,7 @@ rest_of_handle_old_regalloc (tree decl, rtx insns, int *rebuild_notes)
allocate_reg_info (max_regno, FALSE, TRUE);
/* And the reg_equiv_memory_loc array. */
- reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_memory_loc = xcalloc (max_regno, sizeof (rtx));
allocate_initial_values (reg_equiv_memory_loc);
@@ -2702,13 +2462,13 @@ rest_of_handle_cfg (tree decl, rtx insns)
/* Purge addressofs. */
static void
-rest_of_handle_addresof (tree decl, rtx insns)
+rest_of_handle_addressof (tree decl, rtx insns)
{
open_dump_file (DFI_addressof, decl);
purge_addressof (insns);
- if (optimize)
- purge_all_dead_edges (0);
+ if (optimize && purge_all_dead_edges (0))
+ delete_unreachable_blocks ();
reg_scan (insns, max_reg_num (), 1);
close_dump_file (DFI_addressof, print_rtl, insns);
@@ -2780,8 +2540,9 @@ rest_of_handle_inlining (tree decl)
/* If we are reconsidering an inline function at the end of
compilation, skip the stuff for making it inline. */
- if (DECL_SAVED_INSNS (decl) != 0)
+ if (cfun->rtl_inline_init)
return 0;
+ cfun->rtl_inline_init = 1;
/* If this is nested inside an inlined external function, pretend
it was only declared. Since we cannot inline such functions,
@@ -2809,8 +2570,12 @@ rest_of_handle_inlining (tree decl)
timevar_pop (TV_INTEGRATION);
if (lose || ! optimize)
{
- if (warn_inline && DECL_INLINE (decl))
- warning_with_decl (decl, lose);
+ if (warn_inline && lose && DECL_INLINE (decl))
+ {
+ char *msg = concat ("%J", lose, NULL);
+ warning (msg, decl);
+ free (msg);
+ }
DECL_ABSTRACT_ORIGIN (decl) = 0;
/* Don't really compile an extern inline function.
If we can't make it inline, pretend
@@ -2821,16 +2586,8 @@ rest_of_handle_inlining (tree decl)
return true;
}
}
- else {
- /* ??? Note that we used to just make it look like if
- the "inline" keyword was specified when we decide
- to inline it (because of -finline-functions).
- garloff@suse.de, 2002-04-24: Add another flag to
- actually record this piece of information. */
- if (!DECL_INLINE (decl))
- DID_INLINE_FUNC (decl) = 1;
+ else
inlinable = DECL_INLINE (decl) = 1;
- }
}
insns = get_insns ();
@@ -2839,7 +2596,7 @@ rest_of_handle_inlining (tree decl)
if (open_dump_file (DFI_rtl, decl))
{
- if (DECL_SAVED_INSNS (decl))
+ if (DECL_SAVED_INSNS (decl) && DECL_SAVED_INSNS (decl)->saved_for_inline)
fprintf (rtl_dump_file, ";; (integrable)\n\n");
close_dump_file (DFI_rtl, print_rtl, insns);
}
@@ -3083,7 +2840,8 @@ rest_of_handle_cse (tree decl, rtx insns)
tem = cse_main (insns, max_reg_num (), 0, rtl_dump_file);
if (tem)
rebuild_jump_labels (insns);
- purge_all_dead_edges (0);
+ if (purge_all_dead_edges (0))
+ delete_unreachable_blocks ();
delete_trivially_dead_insns (insns, max_reg_num ());
@@ -3516,7 +3274,7 @@ rest_of_compilation (tree decl)
if (optimize > 0)
rest_of_handle_cse (decl, insns);
- rest_of_handle_addresof (decl, insns);
+ rest_of_handle_addressof (decl, insns);
ggc_collect ();
@@ -3870,9 +3628,6 @@ rest_of_compilation (tree decl)
if (! DECL_DEFER_OUTPUT (decl))
{
free_after_compilation (cfun);
-
- /* Clear integrate.c's pointer to the cfun structure we just
- destroyed. */
DECL_SAVED_INSNS (decl) = 0;
}
cfun = 0;
@@ -3882,95 +3637,6 @@ rest_of_compilation (tree decl)
timevar_pop (TV_REST_OF_COMPILATION);
}
-/* Display help for generic options. */
-void
-display_help (void)
-{
- int undoc;
- unsigned long i;
- const char *lang;
-
- for (i = ARRAY_SIZE (f_options); i--;)
- {
- const char *description = f_options[i].description;
-
- if (description != NULL && *description != 0)
- printf (" -f%-21s %s\n",
- f_options[i].string, _(description));
- }
-
- for (i = LAST_PARAM; i--;)
- {
- const char *description = compiler_params[i].help;
- const int length = 21 - strlen (compiler_params[i].option);
-
- if (description != NULL && *description != 0)
- printf (" --param %s=<value>%.*s%s\n",
- compiler_params[i].option,
- length > 0 ? length : 1, " ",
- _(description));
- }
-
- for (i = ARRAY_SIZE (debug_args); i--;)
- {
- if (debug_args[i].description != NULL)
- printf (" -g%-21s %s\n",
- debug_args[i].arg, _(debug_args[i].description));
- }
-
- undoc = 0;
- lang = "language";
-
- /* Display descriptions of language specific options.
- If there is no description, note that there is an undocumented option.
- If the description is empty, do not display anything. (This allows
- options to be deliberately undocumented, for whatever reason).
- If the option string is missing, then this is a marker, indicating
- that the description string is in fact the name of a language, whose
- language specific options are to follow. */
-
- if (ARRAY_SIZE (documented_lang_options) > 1)
- {
- printf (_("\nLanguage specific options:\n"));
-
- for (i = 0; i < ARRAY_SIZE (documented_lang_options); i++)
- {
- const char *description = documented_lang_options[i].description;
- const char *option = documented_lang_options[i].option;
-
- if (description == NULL)
- {
- undoc = 1;
-
- if (extra_warnings)
- printf (_(" %-23.23s [undocumented]\n"), option);
- }
- else if (*description == 0)
- continue;
- else if (option == NULL)
- {
- if (undoc)
- printf
- (_("\nThere are undocumented %s specific options as well.\n"),
- lang);
- undoc = 0;
-
- printf (_("\n Options for %s:\n"), description);
-
- lang = description;
- }
- else
- printf (" %-23.23s %s\n", option, _(description));
- }
- }
-
- if (undoc)
- printf (_("\nThere are undocumented %s specific options as well.\n"),
- lang);
-
- display_target_options ();
-}
-
/* Display help for target options. */
void
display_target_options (void)
@@ -4008,10 +3674,10 @@ display_target_options (void)
undoc = 1;
if (extra_warnings)
- printf (_(" -m%-23.23s [undocumented]\n"), option);
+ printf (_(" -m%-23s [undocumented]\n"), option);
}
else if (*description != 0)
- doc += printf (" -m%-23.23s %s\n", option, _(description));
+ doc += printf (" -m%-23s %s\n", option, _(description));
}
#ifdef TARGET_OPTIONS
@@ -4027,10 +3693,10 @@ display_target_options (void)
undoc = 1;
if (extra_warnings)
- printf (_(" -m%-23.23s [undocumented]\n"), option);
+ printf (_(" -m%-23s [undocumented]\n"), option);
}
else if (*description != 0)
- doc += printf (" -m%-23.23s %s\n", option, _(description));
+ doc += printf (" -m%-23s %s\n", option, _(description));
}
#endif
if (undoc)
@@ -4104,124 +3770,6 @@ const char *const debug_type_names[] =
"none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff", "vms"
};
-/* Parse a -g... command line switch. ARG is the value after the -g.
- It is safe to access 'ARG - 2' to generate the full switch name.
- Return the number of strings consumed. */
-
-void
-decode_g_option (const char *arg)
-{
- static unsigned level = 0;
- /* A lot of code assumes write_symbols == NO_DEBUG if the
- debugging level is 0 (thus -gstabs1 -gstabs0 would lose track
- of what debugging type has been selected). This records the
- selected type. It is an error to specify more than one
- debugging type. */
- static enum debug_info_type selected_debug_type = NO_DEBUG;
- /* Nonzero if debugging format has been explicitly set.
- -g and -ggdb don't explicitly set the debugging format so
- -gdwarf -g3 is equivalent to -gdwarf3. */
- static int type_explicitly_set_p = 0;
-
- /* The maximum admissible debug level value. */
- static const unsigned max_debug_level = 3;
-
- /* Look up ARG in the table. */
- for (da = debug_args; da->arg; da++)
- {
- const int da_len = strlen (da->arg);
-
- if (da_len == 0 || ! strncmp (arg, da->arg, da_len))
- {
- enum debug_info_type type = da->debug_type;
- const char *p = arg + da_len;
-
- if (*p && ! ISDIGIT (*p))
- continue;
-
- /* A debug flag without a level defaults to level 2.
- Note we do not want to call read_integral_parameter
- for that case since it will call atoi which
- will return zero.
-
- ??? We may want to generalize the interface to
- read_integral_parameter to better handle this case
- if this case shows up often. */
- if (*p)
- level = read_integral_parameter (p, 0, max_debug_level + 1);
- else
- level = (level == 0) ? 2 : level;
-
- if (da_len > 1 && *p && !strncmp (arg, "dwarf", da_len))
- {
- error ("use -gdwarf -g%d for DWARF v1, level %d",
- level, level);
- if (level == 2)
- error ("use -gdwarf-2 for DWARF v2");
- }
-
- if (level > max_debug_level)
- {
- warning ("\
-ignoring option `%s' due to invalid debug level specification",
- arg - 2);
- level = debug_info_level;
- }
-
- if (type == NO_DEBUG)
- {
- type = PREFERRED_DEBUGGING_TYPE;
-
- if (da_len > 1 && strncmp (arg, "gdb", da_len) == 0)
- {
-#ifdef DWARF2_DEBUGGING_INFO
- type = DWARF2_DEBUG;
-#else
-#ifdef DBX_DEBUGGING_INFO
- type = DBX_DEBUG;
-#endif
-#endif
- }
- }
-
- if (type == NO_DEBUG)
- warning ("`%s': unknown or unsupported -g option", arg - 2);
-
- /* Does it conflict with an already selected type? */
- if (type_explicitly_set_p
- /* -g/-ggdb don't conflict with anything. */
- && da->debug_type != NO_DEBUG
- && type != selected_debug_type)
- warning ("`%s' ignored, conflicts with `-g%s'",
- arg - 2, debug_type_names[(int) selected_debug_type]);
- else
- {
- /* If the format has already been set, -g/-ggdb
- only change the debug level. */
- if (type_explicitly_set_p && da->debug_type == NO_DEBUG)
- /* Don't change debugging type. */
- ;
- else
- {
- selected_debug_type = type;
- type_explicitly_set_p = da->debug_type != NO_DEBUG;
- }
-
- write_symbols = (level == 0
- ? NO_DEBUG
- : selected_debug_type);
- use_gnu_debug_info_extensions = da->use_extensions_p;
- debug_info_level = (enum debug_info_level) level;
- }
-
- break;
- }
- }
-
- if (! da->arg)
- warning ("`-g%s': unknown or unsupported -g option", arg);
-}
-
/* Decode -m switches. */
/* Decode the switch -mNAME. */
@@ -4423,7 +3971,7 @@ init_asm_output (const char *name)
if (asm_file_name == 0)
{
int len = strlen (dump_base_name);
- char *dumpname = (char *) xmalloc (len + 6);
+ char *dumpname = xmalloc (len + 6);
memcpy (dumpname, dump_base_name, len + 1);
strip_off_ending (dumpname, len);
strcat (dumpname, ".s");
@@ -4438,7 +3986,7 @@ init_asm_output (const char *name)
}
#ifdef IO_BUFFER_SIZE
- setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
+ setvbuf (asm_out_file, xmalloc (IO_BUFFER_SIZE),
_IOFBF, IO_BUFFER_SIZE);
#endif
@@ -4461,6 +4009,29 @@ init_asm_output (const char *name)
}
}
+/* Default tree printer. Handles declarations only. */
+static bool
+default_tree_printer (pretty_printer * pp, text_info *text)
+{
+ switch (*text->format_spec)
+ {
+ case 'D':
+ case 'F':
+ case 'T':
+ {
+ tree t = va_arg (*text->args_ptr, tree);
+ const char *n = DECL_NAME (t)
+ ? (*lang_hooks.decl_printable_name) (t, 2)
+ : "<anonymous>";
+ pp_string (pp, n);
+ }
+ return true;
+
+ default:
+ return false;
+ }
+}
+
/* Initialization of the front end environment, before command line
options are parsed. Signal handlers, internationalization etc.
ARGV0 is main's argv[0]. */
@@ -4480,6 +4051,13 @@ general_init (const char *argv0)
gcc_init_libintl ();
+ /* Initialize the diagnostics reporting machinery, so option parsing
+ can give warnings and errors. */
+ diagnostic_initialize (global_dc);
+ /* Set a default printer. Language specific initializations will
+ override it later. */
+ pp_format_decoder (global_dc->printer) = &default_tree_printer;
+
/* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages. */
#ifdef SIGSEGV
signal (SIGSEGV, crash_signal);
@@ -4503,10 +4081,6 @@ general_init (const char *argv0)
/* Other host-specific signal setup. */
(*host_hooks.extra_signals)();
- /* Initialize the diagnostics reporting machinery, so option parsing
- can give warnings and errors. */
- diagnostic_initialize (global_dc);
-
/* Initialize the garbage-collector, string pools and tree type hash
table. */
init_ggc ();
@@ -4645,32 +4219,42 @@ process_options (void)
profile_flag = 0;
}
+ /* A lot of code assumes write_symbols == NO_DEBUG if the debugging
+ level is 0. */
+ if (debug_info_level == DINFO_LEVEL_NONE)
+ write_symbols = NO_DEBUG;
+
/* Now we know write_symbols, set up the debug hooks based on it.
By default we do nothing for debug output. */
+ if (write_symbols == NO_DEBUG)
+ debug_hooks = &do_nothing_debug_hooks;
#if defined(DBX_DEBUGGING_INFO)
- if (write_symbols == DBX_DEBUG)
+ else if (write_symbols == DBX_DEBUG)
debug_hooks = &dbx_debug_hooks;
#endif
#if defined(XCOFF_DEBUGGING_INFO)
- if (write_symbols == XCOFF_DEBUG)
+ else if (write_symbols == XCOFF_DEBUG)
debug_hooks = &xcoff_debug_hooks;
#endif
#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG)
+ else if (write_symbols == SDB_DEBUG)
debug_hooks = &sdb_debug_hooks;
#endif
#ifdef DWARF_DEBUGGING_INFO
- if (write_symbols == DWARF_DEBUG)
+ else if (write_symbols == DWARF_DEBUG)
debug_hooks = &dwarf_debug_hooks;
#endif
#ifdef DWARF2_DEBUGGING_INFO
- if (write_symbols == DWARF2_DEBUG)
+ else if (write_symbols == DWARF2_DEBUG)
debug_hooks = &dwarf2_debug_hooks;
#endif
#ifdef VMS_DEBUGGING_INFO
- if (write_symbols == VMS_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG)
+ else if (write_symbols == VMS_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG)
debug_hooks = &vmsdbg_debug_hooks;
#endif
+ else
+ error ("target system does not support the \"%s\" debug format",
+ debug_type_names[write_symbols]);
/* If auxiliary info generation is desired, open the output file.
This goes in the same directory as the source file--unlike
@@ -4738,9 +4322,6 @@ process_options (void)
static void
backend_init (void)
{
- /* init_emit_once uses reg_raw_mode and therefore must be called
- after init_regs which initialized reg_raw_mode. */
- init_regs ();
init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
|| debug_info_level == DINFO_LEVEL_VERBOSE
#ifdef VMS_DEBUGGING_INFO
@@ -4749,6 +4330,8 @@ backend_init (void)
#endif
|| flag_test_coverage
|| warn_notreached);
+
+ init_regs ();
init_fake_stack_mems ();
init_alias_once ();
init_loop ();
@@ -4883,21 +4466,24 @@ do_compile (void)
if (!no_backend)
backend_init ();
- if (flag_unit_at_a_time)
- {
- open_dump_file (DFI_cgraph, NULL);
- cgraph_dump_file = rtl_dump_file;
- rtl_dump_file = NULL;
- }
/* Language-dependent initialization. Returns true on success. */
if (lang_dependent_init (main_input_filename))
- compile_file ();
-
- if (flag_unit_at_a_time)
{
- rtl_dump_file = cgraph_dump_file;
- cgraph_dump_file = NULL;
- close_dump_file (DFI_cgraph, NULL, NULL_RTX);
+ if (flag_unit_at_a_time)
+ {
+ open_dump_file (DFI_cgraph, NULL);
+ cgraph_dump_file = rtl_dump_file;
+ rtl_dump_file = NULL;
+ }
+
+ compile_file ();
+
+ if (flag_unit_at_a_time)
+ {
+ rtl_dump_file = cgraph_dump_file;
+ cgraph_dump_file = NULL;
+ close_dump_file (DFI_cgraph, NULL, NULL_RTX);
+ }
}
finalize ();
@@ -4909,7 +4495,6 @@ do_compile (void)
}
/* Entry point of cc1, cc1plus, jc1, f771, etc.
- Decode command args, then call compile_file.
Exit code is FATAL_EXIT_CODE if can't open files or if there were
any errors, or SUCCESS_EXIT_CODE if compilation succeeded.
diff --git a/gcc/toplev.h b/gcc/toplev.h
index e9c7e0dec55..ae05f4b22ec 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -26,19 +26,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define skip_leading_substring(whole, part) \
(strncmp (whole, part, strlen (part)) ? NULL : whole + strlen (part))
-extern int toplev_main (unsigned int, const char **);
-extern int read_integral_parameter (const char *, const char *,
- const int);
-extern void strip_off_ending (char *, int);
-extern const char *trim_filename (const char *);
-extern void _fatal_insn_not_found (struct rtx_def *,
- const char *, int,
- const char *)
+extern int toplev_main (unsigned int, const char **);
+extern int read_integral_parameter (const char *, const char *, const int);
+extern void strip_off_ending (char *, int);
+extern const char *trim_filename (const char *);
+extern void _fatal_insn_not_found (rtx, const char *, int, const char *)
ATTRIBUTE_NORETURN;
-extern void _fatal_insn (const char *,
- struct rtx_def *,
- const char *, int,
- const char *)
+extern void _fatal_insn (const char *, rtx, const char *, int, const char *)
ATTRIBUTE_NORETURN;
#define fatal_insn(msgid, insn) \
@@ -59,35 +53,26 @@ extern void _fatal_insn (const char *,
#else
#define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
-extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
+extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void warning (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
+extern void warning (const char *, ...);
+extern void error (const char *, ...);
+extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void pedwarn (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-
-extern void rest_of_decl_compilation (union tree_node *,
- const char *, int, int);
-extern void rest_of_type_compilation (union tree_node *, int);
-extern void rest_of_compilation (union tree_node *);
-
-extern void pedwarn_with_decl (union tree_node *,
- const char *, ...);
-extern void warning_with_decl (union tree_node *,
- const char *, ...);
-extern void error_with_decl (union tree_node *,
- const char *, ...);
-
-extern void announce_function (union tree_node *);
-
-extern void error_for_asm (struct rtx_def *,
- const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void warning_for_asm (struct rtx_def *,
- const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void warn_deprecated_use (union tree_node *);
+extern void pedwarn (const char *, ...);
+extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
+extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
+
+extern void rest_of_decl_compilation (tree, const char *, int, int);
+extern void rest_of_type_compilation (tree, int);
+extern void rest_of_compilation (tree);
+extern void tree_rest_of_compilation (tree, bool);
+
+extern void announce_function (tree);
+
+extern void error_for_asm (rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void warning_for_asm (rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void warn_deprecated_use (tree);
#ifdef BUFSIZ
extern void output_quoted_string (FILE *, const char *);
@@ -101,8 +86,9 @@ extern void fnotice (FILE *, const char *, ...)
ATTRIBUTE_PRINTF_2;
#endif
-extern int wrapup_global_declarations (union tree_node **, int);
-extern void check_global_declarations (union tree_node **, int);
+extern int wrapup_global_declarations (tree *, int);
+extern void check_global_declarations (tree *, int);
+extern void write_global_declarations (void);
/* A unique local time stamp, might be zero if none is available. */
extern unsigned local_tick;
@@ -138,7 +124,6 @@ extern int flag_ssa_dce;
extern int time_report;
extern int flag_new_regalloc;
-extern void display_help (void);
extern void display_target_options (void);
extern void print_version (FILE *, const char *);
extern void set_target_switch (const char *);
@@ -154,9 +139,6 @@ extern void set_fast_math_flags (int);
/* Handle -d switch. */
extern void decode_d_option (const char *);
-/* Handle -g switch. */
-extern void decode_g_option (const char *);
-
/* Return true iff flags are set as if -ffast-math. */
extern bool fast_math_flags_set_p (void);
@@ -170,4 +152,10 @@ extern bool fast_math_flags_set_p (void);
extern int exact_log2_wide (unsigned HOST_WIDE_INT);
extern int floor_log2_wide (unsigned HOST_WIDE_INT);
+/* Functions used to get and set GCC's notion of in what directory
+ compilation was started. */
+
+extern const char *get_src_pwd (void);
+extern bool set_src_pwd (const char *);
+
#endif /* ! GCC_TOPLEV_H */
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index c6e92e65c1f..c3696336c44 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -57,10 +57,10 @@ queue (dump_info_p di, tree t, int flags)
di->free_list = dq->next;
}
else
- dq = (dump_queue_p) xmalloc (sizeof (struct dump_queue));
+ dq = xmalloc (sizeof (struct dump_queue));
/* Create a new entry in the splay-tree. */
- dni = (dump_node_info_p) xmalloc (sizeof (struct dump_node_info));
+ dni = xmalloc (sizeof (struct dump_node_info));
dni->index = index;
dni->binfo_p = ((flags & DUMP_BINFO) != 0);
dq->node = splay_tree_insert (di->nodes, (splay_tree_key) t,
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 3e68983fe3f..e4e24b2b3b2 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -38,6 +38,8 @@ Boston, MA 02111-1307, USA. */
#include "splay-tree.h"
#include "langhooks.h"
#include "cgraph.h"
+#include "intl.h"
+
/* This should be eventually be generalized to other languages, but
this would require a shared function-as-trees infrastructure. */
@@ -106,6 +108,7 @@ typedef struct inline_data
htab_t tree_pruner;
/* Decl of function we are inlining into. */
tree decl;
+ tree current_decl;
} inline_data;
/* Prototypes. */
@@ -115,7 +118,8 @@ static tree copy_body_r (tree *, int *, void *);
static tree copy_body (inline_data *);
static tree expand_call_inline (tree *, int *, void *);
static void expand_calls_inline (tree *, inline_data *);
-static int inlinable_function_p (tree, inline_data *, int);
+static bool inlinable_function_p (tree);
+static int limits_allow_inlining (tree, inline_data *);
static tree remap_decl (tree, inline_data *);
#ifndef INLINER_FOR_JAVA
static tree initialize_inlined_parameters (inline_data *, tree, tree);
@@ -126,10 +130,6 @@ static tree initialize_inlined_parameters (inline_data *, tree, tree, tree);
static void remap_block (tree *, tree, inline_data *);
static tree add_stmt_to_compound (tree, tree, tree);
#endif /* INLINER_FOR_JAVA */
-static tree find_alloca_call_1 (tree *, int *, void *);
-static tree find_alloca_call (tree);
-static tree find_builtin_longjmp_call_1 (tree *, int *, void *);
-static tree find_builtin_longjmp_call (tree);
/* Remap DECL during the copying of the BLOCK tree for the function. */
@@ -872,192 +872,330 @@ declare_return_variable (struct inline_data *id, tree return_slot_addr,
/* Returns nonzero if a function can be inlined as a tree. */
-int
-tree_inlinable_function_p (tree fn, int nolimit)
+bool
+tree_inlinable_function_p (tree fn)
{
- return inlinable_function_p (fn, NULL, nolimit);
+ return inlinable_function_p (fn);
}
-/* If *TP is possibly call to alloca, return nonzero. */
-static tree
-find_alloca_call_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED)
-{
- if (alloca_call_p (*tp))
- return *tp;
- return NULL;
-}
+static const char *inline_forbidden_reason;
-/* Return subexpression representing possible alloca call, if any. */
static tree
-find_alloca_call (tree exp)
+inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *fnp)
{
- location_t saved_loc = input_location;
- tree ret = walk_tree_without_duplicates
- (&exp, find_alloca_call_1, NULL);
- input_location = saved_loc;
- return ret;
-}
+ tree node = *nodep;
+ tree fn = (tree) fnp;
+ tree t;
-static tree
-find_builtin_longjmp_call_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED)
-{
- tree exp = *tp, decl;
+ 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. */
+ if (alloca_call_p (node)
+ && !lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)))
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined because it uses "
+ "alloca (override using the always_inline attribute)");
+ return node;
+ }
+ t = get_callee_fndecl (node);
+ if (! t)
+ break;
+
+
+ /* We cannot inline functions that call setjmp. */
+ if (setjmp_call_p (t))
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined because it uses setjmp");
+ return node;
+ }
- if (TREE_CODE (exp) == CALL_EXPR
- && TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
- && (decl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0),
- TREE_CODE (decl) == FUNCTION_DECL)
- && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (decl) == BUILT_IN_LONGJMP)
- return decl;
+ 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:
+ {
+ 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;
+ }
+ break;
+
+#ifndef INLINER_FOR_JAVA
+ case DECL_STMT:
+ /* We cannot inline functions that contain other functions. */
+ if (TREE_CODE (TREE_OPERAND (node, 0)) == FUNCTION_DECL
+ && DECL_INITIAL (TREE_OPERAND (node, 0)))
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined "
+ "because it contains a nested function");
+ return node;
+ }
+ break;
+
+ case GOTO_STMT:
+ case GOTO_EXPR:
+ t = TREE_OPERAND (node, 0);
- return NULL;
+ /* We will not inline a function which uses computed goto. The
+ addresses of its local labels, which may be tucked into
+ global storage, are of course not constant across
+ instantiations, which causes unexpected behavior. */
+ if (TREE_CODE (t) != LABEL_DECL)
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined "
+ "because it contains a computed goto");
+ return node;
+ }
+
+ /* We cannot inline a nested function that jumps to a nonlocal
+ label. */
+ if (TREE_CODE (t) == LABEL_DECL && DECL_CONTEXT (t) != fn)
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined "
+ "because it contains a nonlocal goto");
+ return node;
+ }
+
+ break;
+
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ /* We cannot inline a function of the form
+
+ void F (int i) { struct S { int ar[i]; } s; }
+
+ Attempting to do so produces a catch-22.
+ If walk_tree examines the TYPE_FIELDS chain of RECORD_TYPE/
+ UNION_TYPE nodes, then it goes into infinite recursion on a
+ structure containing a pointer to its own type. If it doesn't,
+ then the type node for S doesn't get adjusted properly when
+ F is inlined, and we abort in find_function_data. */
+ for (t = TYPE_FIELDS (node); t; t = TREE_CHAIN (t))
+ if (variably_modified_type_p (TREE_TYPE (t)))
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined "
+ "because it uses variable sized variables");
+ return node;
+ }
+#endif
+ default:
+ break;
+ }
+
+ return NULL_TREE;
}
+/* Return subexpression representing possible alloca call, if any. */
static tree
-find_builtin_longjmp_call (tree exp)
+inline_forbidden_p (tree fndecl)
{
location_t saved_loc = input_location;
tree ret = walk_tree_without_duplicates
- (&exp, find_builtin_longjmp_call_1, NULL);
+ (&DECL_SAVED_TREE (fndecl), inline_forbidden_p_1, fndecl);
input_location = saved_loc;
return ret;
}
-/* Returns nonzero if FN is a function that can be inlined into the
- inlining context ID_. If ID_ is NULL, check whether the function
- can be inlined at all. */
+/* Returns nonzero if FN is a function that does not have any
+ fundamental inline blocking properties. */
-static int
-inlinable_function_p (tree fn, inline_data *id, int nolimit)
+static bool
+inlinable_function_p (tree fn)
{
- int inlinable;
- int currfn_insns = 0;
- int max_inline_insns_single = MAX_INLINE_INSNS_SINGLE;
+ bool inlinable = true;
/* If we've already decided this function shouldn't be inlined,
there's no need to check again. */
if (DECL_UNINLINABLE (fn))
- return 0;
+ return false;
/* See if there is any language-specific reason it cannot be
inlined. (It is important that this hook be called early because
- in C++ it may result in template instantiation.) */
+ in C++ it may result in template instantiation.)
+ If the function is not inlinable for language-specific reasons,
+ it is left up to the langhook to explain why. */
inlinable = !(*lang_hooks.tree_inlining.cannot_inline_tree_fn) (&fn);
- /* We may be here either because fn is declared inline or because
- we use -finline-functions. For the second case, we are more
- restrictive. */
- if (DID_INLINE_FUNC (fn))
- max_inline_insns_single = MAX_INLINE_INSNS_AUTO;
+ /* If we don't have the function body available, we can't inline it.
+ However, this should not be recorded since we also get here for
+ forward declared inline functions. Therefore, return at once. */
+ if (!DECL_SAVED_TREE (fn))
+ return false;
+
+ /* If we're not inlining at all, then we cannot inline this function. */
+ else if (!flag_inline_trees)
+ inlinable = false;
+
+ /* Only try to inline functions if DECL_INLINE is set. This should be
+ true for all functions declared `inline', and for all other functions
+ as well with -finline-functions.
+
+ Don't think of disregarding DECL_INLINE when flag_inline_trees == 2;
+ it's the front-end that must set DECL_INLINE in this case, because
+ dwarf2out loses if a function that does not have DECL_INLINE set is
+ inlined anyway. That is why we have both DECL_INLINE and
+ DECL_DECLARED_INLINE_P. */
+ /* FIXME: When flag_inline_trees dies, the check for flag_unit_at_a_time
+ here should be redundant. */
+ else if (!DECL_INLINE (fn) && !flag_unit_at_a_time)
+ inlinable = false;
- /* The number of instructions (estimated) of current function. */
- if (!nolimit && !DECL_ESTIMATED_INSNS (fn))
- DECL_ESTIMATED_INSNS (fn)
- = (*lang_hooks.tree_inlining.estimate_num_insns) (fn);
- currfn_insns = DECL_ESTIMATED_INSNS (fn);
-
- /* If we're not inlining things, then nothing is inlinable. */
- if (! flag_inline_trees)
- inlinable = 0;
- /* If we're not inlining all functions and the function was not
- declared `inline', we don't inline it. Don't think of
- disregarding DECL_INLINE when flag_inline_trees == 2; it's the
- front-end that must set DECL_INLINE in this case, because
- dwarf2out loses if a function is inlined that doesn't have
- DECL_INLINE set. */
- else if (! DECL_INLINE (fn) && !nolimit)
- inlinable = 0;
#ifdef INLINER_FOR_JAVA
/* Synchronized methods can't be inlined. This is a bug. */
else if (METHOD_SYNCHRONIZED (fn))
- inlinable = 0;
+ inlinable = false;
#endif /* INLINER_FOR_JAVA */
- /* We can't inline functions that are too big. Only allow a single
- function to be of MAX_INLINE_INSNS_SINGLE size. Make special
- allowance for extern inline functions, though. */
- else if (!nolimit
- && ! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
- && currfn_insns > max_inline_insns_single)
- inlinable = 0;
- /* 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. */
- else if (find_builtin_longjmp_call (DECL_SAVED_TREE (fn)))
- inlinable = 0;
- /* 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. */
- else if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL
- && find_alloca_call (DECL_SAVED_TREE (fn)))
- inlinable = 0;
- /* Squirrel away the result so that we don't have to check again. */
- DECL_UNINLINABLE (fn) = ! inlinable;
-
- /* In case we don't disregard the inlining limits and we basically
- can inline this function, investigate further. */
- if (! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
- && inlinable && !nolimit)
+ else if (inline_forbidden_p (fn))
{
- int sum_insns = (id ? id->inlined_insns : 0) + currfn_insns;
- /* In the extreme case that we have exceeded the recursive inlining
- limit by a huge factor (128), we just say no. Should not happen
- in real life. */
- if (sum_insns > MAX_INLINE_INSNS * 128)
- inlinable = 0;
- /* If we did not hit the extreme limit, we use a linear function
- with slope -1/MAX_INLINE_SLOPE to exceedingly decrease the
- allowable size. We always allow a size of MIN_INLINE_INSNS
- though. */
- else if ((sum_insns > MAX_INLINE_INSNS)
- && (currfn_insns > MIN_INLINE_INSNS))
- {
- int max_curr = MAX_INLINE_INSNS_SINGLE
- - (sum_insns - MAX_INLINE_INSNS) / MAX_INLINE_SLOPE;
- if (currfn_insns > max_curr)
- inlinable = 0;
- }
+ /* See if we should warn about uninlinable functions. Previously,
+ some of these warnings would be issued while trying to expand
+ the function inline, but that would cause multiple warnings
+ about functions that would for example call alloca. But since
+ this a property of the function, just one warning is enough.
+ As a bonus we can now give more details about the reason why a
+ function is not inlinable.
+ We only warn for functions declared `inline' by the user. */
+ bool do_warning = (warn_inline
+ && DECL_INLINE (fn)
+ && DECL_DECLARED_INLINE_P (fn)
+ && !DECL_IN_SYSTEM_HEADER (fn));
+
+ if (do_warning)
+ warning (inline_forbidden_reason, fn, fn);
+
+ inlinable = false;
}
- /* If we don't have the function body available, we can't inline
- it. */
- if (! DECL_SAVED_TREE (fn))
- inlinable = 0;
+ /* Squirrel away the result so that we don't have to check again. */
+ DECL_UNINLINABLE (fn) = !inlinable;
+
+ return inlinable;
+}
+
+/* We can't inline functions that are too big. Only allow a single
+ function to be of MAX_INLINE_INSNS_SINGLE size. Make special
+ allowance for extern inline functions, though.
+
+ Return nonzero if the function FN can be inlined into the inlining
+ context ID. */
- /* Check again, language hooks may have modified it. */
- if (! inlinable || DECL_UNINLINABLE (fn))
+static int
+limits_allow_inlining (tree fn, inline_data *id)
+{
+ int estimated_insns = 0;
+ size_t i;
+
+ /* Don't even bother if the function is not inlinable. */
+ if (!inlinable_function_p (fn))
return 0;
- /* Don't do recursive inlining, either. We don't record this in
- DECL_UNINLINABLE; we may be able to inline this function later. */
- if (id)
+ /* Investigate the size of the function. Return at once
+ if the function body size is too large. */
+ if (!(*lang_hooks.tree_inlining.disregard_inline_limits) (fn))
{
- size_t i;
+ int currfn_max_inline_insns;
+
+ /* If we haven't already done so, get an estimate of the number of
+ instructions that will be produces when expanding this function. */
+ if (!DECL_ESTIMATED_INSNS (fn))
+ DECL_ESTIMATED_INSNS (fn)
+ = (*lang_hooks.tree_inlining.estimate_num_insns) (fn);
+ estimated_insns = DECL_ESTIMATED_INSNS (fn);
+
+ /* We may be here either because fn is declared inline or because
+ we use -finline-functions. For the second case, we are more
+ restrictive.
+
+ FIXME: -finline-functions should imply -funit-at-a-time, it's
+ about equally expensive but unit-at-a-time produces
+ better code. */
+ currfn_max_inline_insns = DECL_DECLARED_INLINE_P (fn) ?
+ MAX_INLINE_INSNS_SINGLE : MAX_INLINE_INSNS_AUTO;
+
+ /* If the function is too big to be inlined, adieu. */
+ if (estimated_insns > currfn_max_inline_insns)
+ return 0;
+
+ /* We now know that we don't disregard the inlining limits and that
+ we basically should be able to inline this function.
+ We always allow inlining functions if we estimate that they are
+ smaller than MIN_INLINE_INSNS. Otherwise, investigate further. */
+ if (estimated_insns > MIN_INLINE_INSNS)
+ {
+ int sum_insns = (id ? id->inlined_insns : 0) + estimated_insns;
- for (i = 0; i < VARRAY_ACTIVE_SIZE (id->fns); ++i)
- if (VARRAY_TREE (id->fns, i) == fn)
- return 0;
+ /* In the extreme case that we have exceeded the recursive inlining
+ limit by a huge factor (128), we just say no.
- if (DECL_INLINED_FNS (fn))
- {
- int j;
- tree inlined_fns = DECL_INLINED_FNS (fn);
+ FIXME: Should not happen in real life, but people have reported
+ that it actually does!? */
+ if (sum_insns > MAX_INLINE_INSNS * 128)
+ return 0;
- for (j = 0; j < TREE_VEC_LENGTH (inlined_fns); ++j)
- if (TREE_VEC_ELT (inlined_fns, j) == VARRAY_TREE (id->fns, 0))
- return 0;
+ /* If we did not hit the extreme limit, we use a linear function
+ with slope -1/MAX_INLINE_SLOPE to exceedingly decrease the
+ allowable size. */
+ else if (sum_insns > MAX_INLINE_INSNS)
+ {
+ if (estimated_insns > currfn_max_inline_insns
+ - (sum_insns - MAX_INLINE_INSNS) / MAX_INLINE_SLOPE)
+ return 0;
+ }
}
}
- /* Return the result. */
- return inlinable;
+ /* Don't allow recursive inlining. */
+ for (i = 0; i < VARRAY_ACTIVE_SIZE (id->fns); ++i)
+ if (VARRAY_TREE (id->fns, i) == fn)
+ return 0;
+
+ if (DECL_INLINED_FNS (fn))
+ {
+ int j;
+ tree inlined_fns = DECL_INLINED_FNS (fn);
+
+ for (j = 0; j < TREE_VEC_LENGTH (inlined_fns); ++j)
+ if (TREE_VEC_ELT (inlined_fns, j) == VARRAY_TREE (id->fns, 0))
+ return 0;
+ }
+
+ /* Go ahead, this function can be inlined. */
+ return 1;
}
/* If *TP is a CALL_EXPR, replace it with its inline expansion. */
@@ -1145,6 +1283,10 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
if (!fn)
return NULL_TREE;
+ /* Turn forward declarations into real ones. */
+ if (flag_unit_at_a_time)
+ fn = cgraph_node (fn)->decl;
+
/* If fn is a declaration of a function in a nested scope that was
globally declared inline, we don't set its DECL_INITIAL.
However, we can't blindly follow DECL_ABSTRACT_ORIGIN because the
@@ -1159,14 +1301,14 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
/* Don't try to inline functions that are not well-suited to
inlining. */
- if ((!flag_unit_at_a_time || !DECL_SAVED_TREE (fn)
- || !cgraph_global_info (fn)->inline_once)
- && !inlinable_function_p (fn, id, 0))
+ if ((flag_unit_at_a_time
+ && (!DECL_SAVED_TREE (fn) || !cgraph_inline_p (id->current_decl, fn)))
+ || (!flag_unit_at_a_time && !limits_allow_inlining (fn, id)))
{
- if (warn_inline && DECL_INLINE (fn) && !DID_INLINE_FUNC (fn)
+ if (warn_inline && DECL_INLINE (fn) && DECL_DECLARED_INLINE_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn))
{
- warning_with_decl (fn, "inlining failed in call to `%s'");
+ warning ("%Jinlining failed in call to '%F'", fn, fn);
warning ("called from here");
}
return NULL_TREE;
@@ -1191,6 +1333,9 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
expr = build1 (STMT_EXPR, TREE_TYPE (TREE_TYPE (fn)), make_node (COMPOUND_STMT));
/* There is no scope associated with the statement-expression. */
STMT_EXPR_NO_SCOPE (expr) = 1;
+ if (lookup_attribute ("warn_unused_result",
+ TYPE_ATTRIBUTES (TREE_TYPE (fn))))
+ STMT_EXPR_WARN_UNUSED_RESULT (expr) = 1;
stmt = STMT_EXPR_STMT (expr);
#else /* INLINER_FOR_JAVA */
/* Build a block containing code to initialize the arguments, the
@@ -1403,7 +1548,12 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
}
/* Recurse into the body of the just inlined function. */
- expand_calls_inline (inlined_body, id);
+ {
+ tree old_decl = id->current_decl;
+ id->current_decl = fn;
+ expand_calls_inline (inlined_body, id);
+ id->current_decl = old_decl;
+ }
VARRAY_POP (id->fns);
/* If we've returned to the top level, clear out the record of how
@@ -1446,6 +1596,7 @@ optimize_inline_calls (tree fn)
memset (&id, 0, sizeof (id));
id.decl = fn;
+ id.current_decl = fn;
/* Don't allow recursion into FN. */
VARRAY_TREE_INIT (id.fns, 32, "fns");
VARRAY_PUSH_TREE (id.fns, fn);
@@ -1589,15 +1740,11 @@ walk_tree (tree *tp, walk_tree_fn func, void *data, void *htab_)
}
/* Handle common cases up front. */
- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
- || TREE_CODE_CLASS (code) == 'r'
- || TREE_CODE_CLASS (code) == 's')
+ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
#else /* INLINER_FOR_JAVA */
if (code != EXIT_BLOCK_EXPR
&& code != SAVE_EXPR
- && (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
- || TREE_CODE_CLASS (code) == 'r'
- || TREE_CODE_CLASS (code) == 's'))
+ && IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
#endif /* INLINER_FOR_JAVA */
{
int i, len;
@@ -1790,9 +1937,7 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
/* We make copies of most nodes. */
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
- || TREE_CODE_CLASS (code) == 'r'
|| TREE_CODE_CLASS (code) == 'c'
- || TREE_CODE_CLASS (code) == 's'
|| code == TREE_LIST
|| code == TREE_VEC
|| (*lang_hooks.tree_inlining.tree_chain_matters_p) (*tp))
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index 87eebac9803..febf9e7bc20 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */
/* Function prototypes. */
void optimize_inline_calls (tree);
-int tree_inlinable_function_p (tree, int);
+bool tree_inlinable_function_p (tree);
tree walk_tree (tree*, walk_tree_fn, void*, void*);
tree walk_tree_without_duplicates (tree*, walk_tree_fn, void*);
tree copy_tree_r (tree*, int*, void*);
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
new file mode 100644
index 00000000000..e6049cb2b29
--- /dev/null
+++ b/gcc/tree-optimize.c
@@ -0,0 +1,240 @@
+/* Control and data flow functions for trees.
+ Copyright 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. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "toplev.h"
+#include "tree.h"
+#include "tree-inline.h"
+#include "flags.h"
+#include "langhooks.h"
+#include "cgraph.h"
+#include "timevar.h"
+#include "tm.h"
+#include "function.h"
+#include "ggc.h"
+
+
+/* Called to move the SAVE_EXPRs for parameter declarations in a
+ nested function into the nested function. DATA is really the
+ nested FUNCTION_DECL. */
+
+static tree
+set_save_expr_context (tree *tp,
+ int *walk_subtrees,
+ void *data)
+{
+ if (TREE_CODE (*tp) == SAVE_EXPR && !SAVE_EXPR_CONTEXT (*tp))
+ SAVE_EXPR_CONTEXT (*tp) = (tree) data;
+ /* Do not walk back into the SAVE_EXPR_CONTEXT; that will cause
+ circularity. */
+ else if (DECL_P (*tp))
+ *walk_subtrees = 0;
+
+ return NULL;
+}
+
+/* Clear out the DECL_RTL for the non-static local variables in BLOCK and
+ its sub-blocks. DATA is the decl of the function being processed. */
+
+static tree
+clear_decl_rtl (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, void *data)
+{
+ bool nonstatic_p, local_p;
+ tree t = *tp;
+
+ switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ nonstatic_p = !TREE_STATIC (t) && !DECL_EXTERNAL (t);
+ local_p = DECL_CONTEXT (t) == data;
+ break;
+
+ case PARM_DECL:
+ case LABEL_DECL:
+ nonstatic_p = true;
+ local_p = DECL_CONTEXT (t) == data;
+ break;
+
+ case RESULT_DECL:
+ nonstatic_p = local_p = true;
+ break;
+
+ default:
+ nonstatic_p = local_p = false;
+ break;
+ }
+
+ if (nonstatic_p && local_p)
+ SET_DECL_RTL (t, NULL);
+
+ return NULL;
+}
+
+/* For functions-as-trees languages, this performs all optimization and
+ compilation for FNDECL. */
+
+void
+tree_rest_of_compilation (tree fndecl, bool nested_p)
+{
+ location_t saved_loc;
+
+ timevar_push (TV_EXPAND);
+
+ if (flag_unit_at_a_time && !cgraph_global_info_ready)
+ abort ();
+
+ /* Initialize the RTL code for the function. */
+ current_function_decl = fndecl;
+ saved_loc = input_location;
+ input_location = DECL_SOURCE_LOCATION (fndecl);
+ init_function_start (fndecl);
+
+ /* This function is being processed in whole-function mode. */
+ cfun->x_whole_function_mode_p = 1;
+
+ /* Even though we're inside a function body, we still don't want to
+ call expand_expr to calculate the size of a variable-sized array.
+ We haven't necessarily assigned RTL to all variables yet, so it's
+ not safe to try to expand expressions involving them. */
+ immediate_size_expand = 0;
+ cfun->x_dont_save_pending_sizes_p = 1;
+
+ /* If the function has a variably modified type, there may be
+ SAVE_EXPRs in the parameter types. Their context must be set to
+ refer to this function; they cannot be expanded in the containing
+ function. */
+ if (decl_function_context (fndecl)
+ && variably_modified_type_p (TREE_TYPE (fndecl)))
+ walk_tree (&TREE_TYPE (fndecl), set_save_expr_context, fndecl,
+ NULL);
+
+ /* Set up parameters and prepare for return, for the function. */
+ expand_function_start (fndecl, 0);
+
+ /* Allow language dialects to perform special processing. */
+ (*lang_hooks.rtl_expand.start) ();
+
+ /* If this function is `main', emit a call to `__main'
+ to run global initializers, etc. */
+ if (DECL_NAME (fndecl)
+ && MAIN_NAME_P (DECL_NAME (fndecl))
+ && DECL_FILE_SCOPE_P (fndecl))
+ expand_main_function ();
+
+ /* Generate the RTL for this function. */
+ (*lang_hooks.rtl_expand.stmt) (DECL_SAVED_TREE (fndecl));
+
+ /* We hard-wired immediate_size_expand to zero above.
+ expand_function_end will decrement this variable. So, we set the
+ variable to one here, so that after the decrement it will remain
+ zero. */
+ immediate_size_expand = 1;
+
+ /* Allow language dialects to perform special processing. */
+ (*lang_hooks.rtl_expand.end) ();
+
+ /* Generate rtl for function exit. */
+ expand_function_end ();
+
+ /* If this is a nested function, protect the local variables in the stack
+ above us from being collected while we're compiling this function. */
+ if (nested_p)
+ ggc_push_context ();
+
+ /* There's no need to defer outputting this function any more; we
+ know we want to output it. */
+ DECL_DEFER_OUTPUT (fndecl) = 0;
+
+ /* Run the optimizers and output the assembler code for this function. */
+ rest_of_compilation (fndecl);
+
+ /* Undo the GC context switch. */
+ if (nested_p)
+ ggc_pop_context ();
+
+ /* If requested, warn about function definitions where the function will
+ return a value (usually of some struct or union type) which itself will
+ take up a lot of stack space. */
+ if (warn_larger_than && !DECL_EXTERNAL (fndecl) && TREE_TYPE (fndecl))
+ {
+ tree ret_type = TREE_TYPE (TREE_TYPE (fndecl));
+
+ if (ret_type && TYPE_SIZE_UNIT (ret_type)
+ && TREE_CODE (TYPE_SIZE_UNIT (ret_type)) == INTEGER_CST
+ && 0 < compare_tree_int (TYPE_SIZE_UNIT (ret_type),
+ larger_than_size))
+ {
+ unsigned int size_as_int
+ = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
+
+ if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0)
+ warning ("%Jsize of return value of '%D' is %u bytes",
+ fndecl, fndecl, size_as_int);
+ else
+ warning ("%Jsize of return value of '%D' is larger than %wd bytes",
+ fndecl, fndecl, larger_than_size);
+ }
+ }
+
+ /* ??? 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
+ DECL_RTL for the LABEL_DECL. Walk the BLOCK-tree, clearing DECL_RTL for
+ LABEL_DECLs and non-static local variables. Note that we must check the
+ context of the variables, otherwise processing a nested function can kill
+ the rtl of a variable from an outer function. */
+ walk_tree_without_duplicates (&DECL_SAVED_TREE (fndecl),
+ clear_decl_rtl,
+ fndecl);
+
+ if (DECL_SAVED_INSNS (fndecl) == 0 && !nested_p && !flag_inline_trees)
+ {
+ /* Stop pointing to the local nodes about to be freed.
+ But DECL_INITIAL must remain nonzero so we know this
+ was an actual function definition.
+ For a nested function, this is done in c_pop_function_context.
+ If rest_of_compilation set this to 0, leave it 0. */
+ if (DECL_INITIAL (fndecl) != 0)
+ DECL_INITIAL (fndecl) = error_mark_node;
+
+ DECL_ARGUMENTS (fndecl) = 0;
+ }
+
+ input_location = saved_loc;
+
+ timevar_pop (TV_EXPAND);
+}
diff --git a/gcc/tree.c b/gcc/tree.c
index b61a70b262f..b82a6bf6965 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -51,28 +51,11 @@ extern int _obstack_allocated_p (struct obstack *h, void *obj);
#ifdef GATHER_STATISTICS
/* Statistics-gathering stuff. */
-typedef enum
-{
- d_kind,
- t_kind,
- b_kind,
- s_kind,
- r_kind,
- e_kind,
- c_kind,
- id_kind,
- perm_list_kind,
- temp_list_kind,
- vec_kind,
- x_kind,
- lang_decl,
- lang_type,
- all_kinds
-} tree_node_kind;
int tree_node_counts[(int) all_kinds];
int tree_node_sizes[(int) all_kinds];
+/* Keep in sync with tree.h:enum tree_node_kind. */
static const char * const tree_node_kind_names[] = {
"decls",
"types",
@@ -511,7 +494,7 @@ real_value_from_int_cst (tree type ATTRIBUTE_UNUSED, tree i)
/* Clear all bits of the real value type so that we can later do
bitwise comparisons to see if two values are the same. */
- memset ((char *) &d, 0, sizeof d);
+ memset (&d, 0, sizeof d);
if (! TREE_UNSIGNED (TREE_TYPE (i)))
REAL_VALUE_FROM_INT (d, TREE_INT_CST_LOW (i), TREE_INT_CST_HIGH (i),
@@ -1478,8 +1461,6 @@ first_rtl_op (enum tree_code code)
return 0;
case WITH_CLEANUP_EXPR:
return 2;
- case METHOD_CALL_EXPR:
- return 3;
default:
return TREE_CODE_LENGTH (code);
}
@@ -2397,6 +2378,17 @@ build (enum tree_code code, tree tt, ...)
va_end (p);
TREE_CONSTANT (t) = constant;
+
+ if (code == CALL_EXPR && !TREE_SIDE_EFFECTS (t))
+ {
+ /* 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)))
+ TREE_SIDE_EFFECTS (t) = 1;
+ }
+
return t;
}
@@ -2868,7 +2860,8 @@ get_qualified_type (tree type, int type_quals)
preserve the TYPE_NAME, since there is code that depends on this. */
for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
if (TYPE_QUALS (t) == type_quals && TYPE_NAME (t) == TYPE_NAME (type)
- && TYPE_CONTEXT (t) == TYPE_CONTEXT (type))
+ && TYPE_CONTEXT (t) == TYPE_CONTEXT (type)
+ && attribute_list_equal (TYPE_ATTRIBUTES (t), TYPE_ATTRIBUTES (type)))
return t;
return NULL_TREE;
@@ -3004,7 +2997,7 @@ type_hash_add (unsigned int hashcode, tree type)
struct type_hash *h;
void **loc;
- h = (struct type_hash *) ggc_alloc (sizeof (struct type_hash));
+ h = ggc_alloc (sizeof (struct type_hash));
h->hash = hashcode;
h->type = type;
loc = htab_find_slot_with_hash (type_hash_table, h, hashcode, INSERT);
@@ -3545,7 +3538,7 @@ iterative_hash_expr (tree t, hashval_t val)
else
abort ();
}
- else if (IS_EXPR_CODE_CLASS (class) || class == 'r')
+ else if (IS_EXPR_CODE_CLASS (class))
{
val = iterative_hash_object (code, val);
@@ -3842,7 +3835,7 @@ build_function_type (tree value_type, tree arg_types)
return t;
}
-/* Build a function type. The RETURN_TYPE is the type retured by the
+/* Build a function type. The RETURN_TYPE is the type returned by the
function. If additional arguments are provided, they are
additional argument types. The list of argument types must always
be terminated by NULL_TREE. */
@@ -3868,35 +3861,37 @@ build_function_type_list (tree return_type, ...)
return args;
}
-/* Construct, lay out and return the type of methods belonging to class
- BASETYPE and whose arguments and values are described by TYPE.
- If that type exists already, reuse it.
- TYPE must be a FUNCTION_TYPE node. */
+/* Build a METHOD_TYPE for a member of BASETYPE. The RETTYPE (a TYPE)
+ and ARGTYPES (a TREE_LIST) are the return type and arguments types
+ for the method. An implicit additional parameter (of type
+ pointer-to-BASETYPE) is added to the ARGTYPES. */
tree
-build_method_type (tree basetype, tree type)
+build_method_type_directly (tree basetype,
+ tree rettype,
+ tree argtypes)
{
tree t;
- unsigned int hashcode;
+ tree ptype;
+ int hashcode;
/* Make a node of the sort we want. */
t = make_node (METHOD_TYPE);
- if (TREE_CODE (type) != FUNCTION_TYPE)
- abort ();
-
TYPE_METHOD_BASETYPE (t) = TYPE_MAIN_VARIANT (basetype);
- TREE_TYPE (t) = TREE_TYPE (type);
+ TREE_TYPE (t) = rettype;
+ ptype = build_pointer_type (basetype);
/* The actual arglist for this function includes a "hidden" argument
which is "this". Put it into the list of argument types. */
+ argtypes = tree_cons (NULL_TREE, ptype, argtypes);
+ TYPE_ARG_TYPES (t) = argtypes;
- TYPE_ARG_TYPES (t)
- = tree_cons (NULL_TREE,
- build_pointer_type (basetype), TYPE_ARG_TYPES (type));
+ /* If we already have such a type, use the old one and free this one.
+ Note that it also frees up the above cons cell if found. */
+ hashcode = TYPE_HASH (basetype) + TYPE_HASH (rettype) +
+ type_hash_list (argtypes);
- /* If we already have such a type, use the old one and free this one. */
- hashcode = TYPE_HASH (basetype) + TYPE_HASH (type);
t = type_hash_canon (hashcode, t);
if (!COMPLETE_TYPE_P (t))
@@ -3905,6 +3900,22 @@ build_method_type (tree basetype, tree type)
return t;
}
+/* Construct, lay out and return the type of methods belonging to class
+ BASETYPE and whose arguments and values are described by TYPE.
+ If that type exists already, reuse it.
+ TYPE must be a FUNCTION_TYPE node. */
+
+tree
+build_method_type (tree basetype, tree type)
+{
+ if (TREE_CODE (type) != FUNCTION_TYPE)
+ abort ();
+
+ return build_method_type_directly (basetype,
+ TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
+}
+
/* Construct, lay out and return the type of offsets to a value
of type TYPE, within an object of type BASETYPE.
If a suitable offset type exists already, reuse it. */
@@ -4370,26 +4381,30 @@ decl_type_context (tree decl)
tree context = DECL_CONTEXT (decl);
while (context)
- {
- if (TREE_CODE (context) == NAMESPACE_DECL)
+ switch (TREE_CODE (context))
+ {
+ case NAMESPACE_DECL:
+ case TRANSLATION_UNIT_DECL:
return NULL_TREE;
- if (TREE_CODE (context) == RECORD_TYPE
- || TREE_CODE (context) == UNION_TYPE
- || TREE_CODE (context) == QUAL_UNION_TYPE)
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case QUAL_UNION_TYPE:
return context;
-
- if (TREE_CODE (context) == TYPE_DECL
- || TREE_CODE (context) == FUNCTION_DECL)
+
+ case TYPE_DECL:
+ case FUNCTION_DECL:
context = DECL_CONTEXT (context);
-
- else if (TREE_CODE (context) == BLOCK)
+ break;
+
+ case BLOCK:
context = BLOCK_SUPERCONTEXT (context);
-
- else
- /* Unhandled CONTEXT!? */
+ break;
+
+ default:
abort ();
- }
+ }
+
return NULL_TREE;
}
@@ -4442,19 +4457,19 @@ dump_tree_statistics (void)
fprintf (stderr, "\n??? tree nodes created\n\n");
#ifdef GATHER_STATISTICS
- fprintf (stderr, "Kind Nodes Bytes\n");
- fprintf (stderr, "-------------------------------------\n");
+ fprintf (stderr, "Kind Nodes Bytes\n");
+ fprintf (stderr, "---------------------------------------\n");
total_nodes = total_bytes = 0;
for (i = 0; i < (int) all_kinds; i++)
{
- fprintf (stderr, "%-20s %6d %9d\n", tree_node_kind_names[i],
+ fprintf (stderr, "%-20s %7d %10d\n", tree_node_kind_names[i],
tree_node_counts[i], tree_node_sizes[i]);
total_nodes += tree_node_counts[i];
total_bytes += tree_node_sizes[i];
}
- fprintf (stderr, "-------------------------------------\n");
- fprintf (stderr, "%-20s %6d %9d\n", "Total", total_nodes, total_bytes);
- fprintf (stderr, "-------------------------------------\n");
+ fprintf (stderr, "---------------------------------------\n");
+ fprintf (stderr, "%-20s %7d %10d\n", "Total", total_nodes, total_bytes);
+ fprintf (stderr, "---------------------------------------\n");
#else
fprintf (stderr, "(No per-node statistics)\n");
#endif
@@ -4532,7 +4547,7 @@ get_file_function_name_long (const char *type)
file = input_filename;
len = strlen (file);
- q = (char *) alloca (9 * 2 + len);
+ q = alloca (9 * 2 + len + 1);
memcpy (q, file, len + 1);
clean_symbol_name (q);
@@ -4542,8 +4557,7 @@ get_file_function_name_long (const char *type)
p = q;
}
- buf = (char *) alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p)
- + strlen (type));
+ buf = alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p) + strlen (type));
/* Set up the name of the file-level functions we may need.
Use a global object (which is already required to be unique over
@@ -4638,7 +4652,7 @@ get_set_constructor_bytes (tree init, unsigned char *buffer, int wd_size)
int bit_size = wd_size * set_word_size;
int bit_pos = 0;
unsigned char *bytep = buffer;
- char *bit_buffer = (char *) alloca (bit_size);
+ char *bit_buffer = alloca (bit_size);
tree non_const_bits = get_set_constructor_bits (init, bit_buffer, bit_size);
for (i = 0; i < wd_size; i++)
@@ -4770,6 +4784,16 @@ build_common_tree_nodes (int signed_char)
long_long_integer_type_node = make_signed_type (LONG_LONG_TYPE_SIZE);
long_long_unsigned_type_node = make_unsigned_type (LONG_LONG_TYPE_SIZE);
+ /* Define a boolean type. This type only represents boolean values but
+ may be larger than char depending on the value of BOOL_TYPE_SIZE.
+ Front ends which want to override this size (i.e. Java) can redefine
+ boolean_type_node before calling build_common_tree_nodes_2. */
+ boolean_type_node = make_unsigned_type (BOOL_TYPE_SIZE);
+ TREE_SET_CODE (boolean_type_node, BOOLEAN_TYPE);
+ TYPE_MAX_VALUE (boolean_type_node) = build_int_2 (1, 0);
+ TREE_TYPE (TYPE_MAX_VALUE (boolean_type_node)) = boolean_type_node;
+ TYPE_PRECISION (boolean_type_node) = 1;
+
intQI_type_node = make_signed_type (GET_MODE_BITSIZE (QImode));
intHI_type_node = make_signed_type (GET_MODE_BITSIZE (HImode));
intSI_type_node = make_signed_type (GET_MODE_BITSIZE (SImode));
@@ -4800,6 +4824,9 @@ build_common_tree_nodes_2 (int short_double)
bitsize_one_node = bitsize_int (1);
bitsize_unit_node = bitsize_int (BITS_PER_UNIT);
+ boolean_false_node = TYPE_MIN_VALUE (boolean_type_node);
+ boolean_true_node = TYPE_MAX_VALUE (boolean_type_node);
+
void_type_node = make_node (VOID_TYPE);
layout_type (void_type_node);
@@ -4831,6 +4858,11 @@ build_common_tree_nodes_2 (int short_double)
TYPE_PRECISION (long_double_type_node) = LONG_DOUBLE_TYPE_SIZE;
layout_type (long_double_type_node);
+ float_ptr_type_node = build_pointer_type (float_type_node);
+ double_ptr_type_node = build_pointer_type (double_type_node);
+ long_double_ptr_type_node = build_pointer_type (long_double_type_node);
+ integer_ptr_type_node = build_pointer_type (integer_type_node);
+
complex_integer_type_node = make_node (COMPLEX_TYPE);
TREE_TYPE (complex_integer_type_node) = integer_type_node;
layout_type (complex_integer_type_node);
@@ -4894,6 +4926,7 @@ build_common_tree_nodes_2 (int short_double)
V2DF_type_node = make_vector (V2DFmode, double_type_node, 0);
V16QI_type_node = make_vector (V16QImode, intQI_type_node, 0);
V1DI_type_node = make_vector (V1DImode, intDI_type_node, 0);
+ V4DF_type_node = make_vector (V4DFmode, double_type_node, 0);
}
/* Returns a vector tree node given a vector mode, the inner type, and
diff --git a/gcc/tree.def b/gcc/tree.def
index b71d31d0454..4b6d236dde6 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -274,20 +274,21 @@ DEFTREECODE (COMPLEX_CST, "complex_cst", 'c', 0)
/* Contents are in TREE_VECTOR_CST_ELTS field. */
DEFTREECODE (VECTOR_CST, "vector_cst", 'c', 0)
-/* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields. */
+/* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields. */
DEFTREECODE (STRING_CST, "string_cst", 'c', 0)
-/* Declarations. All references to names are represented as ..._DECL nodes.
- The decls in one binding context are chained through the TREE_CHAIN field.
- Each DECL has a DECL_NAME field which contains an IDENTIFIER_NODE.
- (Some decls, most often labels, may have zero as the DECL_NAME).
- DECL_CONTEXT points to the node representing the context in which
- this declaration has its scope. For FIELD_DECLs, this is the
- RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field
- is a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
- and CONST_DECL nodes, this points to either the FUNCTION_DECL for the
- containing function, the RECORD_TYPE or UNION_TYPE for the containing
- type, or NULL_TREE if the given decl has "file scope".
+/* Declarations. All references to names are represented as ..._DECL
+ nodes. The decls in one binding context are chained through the
+ TREE_CHAIN field. Each DECL has a DECL_NAME field which contains
+ an IDENTIFIER_NODE. (Some decls, most often labels, may have zero
+ as the DECL_NAME). DECL_CONTEXT points to the node representing
+ the context in which this declaration has its scope. For
+ FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
+ QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL,
+ PARM_DECL, FUNCTION_DECL, LABEL_DECL, and CONST_DECL nodes, this
+ points to either the FUNCTION_DECL for the containing function, the
+ RECORD_TYPE or UNION_TYPE for the containing type, or NULL_TREE or
+ a TRANSLATION_UNIT_DECL if the given decl has "file scope".
DECL_ABSTRACT_ORIGIN, if non-NULL, points to the original (abstract)
..._DECL node of which this decl is an (inlined or template expanded)
instance.
@@ -298,9 +299,9 @@ DEFTREECODE (STRING_CST, "string_cst", 'c', 0)
and DECL_MODE fields exist in decl nodes just as in type nodes.
They are unused in LABEL_DECL, TYPE_DECL and CONST_DECL nodes.
- DECL_OFFSET holds an integer number of bits offset for the location.
- DECL_VOFFSET holds an expression for a variable offset; it is
- to be multiplied by DECL_VOFFSET_UNIT (an integer).
+ DECL_FIELD_BIT_OFFSET holds an integer number of bits offset for
+ the location. DECL_VOFFSET holds an expression for a variable
+ offset; it is to be multiplied by DECL_VOFFSET_UNIT (an integer).
These fields are relevant only in FIELD_DECLs and PARM_DECLs.
DECL_INITIAL holds the value to initialize a variable to,
@@ -346,6 +347,10 @@ DEFTREECODE (FIELD_DECL, "field_decl", 'd', 0)
/* A namespace declaration. Namespaces appear in DECL_CONTEXT of other
_DECLs, providing a hierarchy of names. */
DEFTREECODE (NAMESPACE_DECL, "namespace_decl", 'd', 0)
+
+/* A translation unit. This is not technically a declaration, since it
+ can't be looked up, but it's close enough. */
+DEFTREECODE (TRANSLATION_UNIT_DECL, "translation_unit_decl", 'd', 0)
/* References to storage. */
@@ -469,11 +474,6 @@ DEFTREECODE (BIND_EXPR, "bind_expr", 'e', 3)
made out of a chain of TREE_LIST nodes. */
DEFTREECODE (CALL_EXPR, "call_expr", 'e', 2)
-/* Call a method. Operand 0 is the method, whose type is a METHOD_TYPE.
- Operand 1 is the expression for "self".
- Operand 2 is the list of explicit arguments. */
-DEFTREECODE (METHOD_CALL_EXPR, "method_call_expr", 'e', 4)
-
/* Specify a value to compute along with its corresponding cleanup.
Operand 0 argument is an expression whose value needs a cleanup.
Operand 1 is the cleanup expression for the object.
@@ -615,13 +615,6 @@ DEFTREECODE (MAX_EXPR, "max_expr", '2', 2)
operand of the ABS_EXPR must have the same type. */
DEFTREECODE (ABS_EXPR, "abs_expr", '1', 1)
-/* Bit scanning and counting. */
-DEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1)
-DEFTREECODE (CLZ_EXPR, "clz_expr", '1', 1)
-DEFTREECODE (CTZ_EXPR, "ctz_expr", '1', 1)
-DEFTREECODE (POPCOUNT_EXPR, "popcount_expr", '1', 1)
-DEFTREECODE (PARITY_EXPR, "parity_expr", '1', 1)
-
/* Shift operations for shift and rotate.
Shift means logical shift if done on an
unsigned type, arithmetic shift if done on a signed type.
@@ -638,7 +631,6 @@ DEFTREECODE (RROTATE_EXPR, "rrotate_expr", '2', 2)
DEFTREECODE (BIT_IOR_EXPR, "bit_ior_expr", '2', 2)
DEFTREECODE (BIT_XOR_EXPR, "bit_xor_expr", '2', 2)
DEFTREECODE (BIT_AND_EXPR, "bit_and_expr", '2', 2)
-DEFTREECODE (BIT_ANDTC_EXPR, "bit_andtc_expr", '2', 2)
DEFTREECODE (BIT_NOT_EXPR, "bit_not_expr", '1', 1)
/* ANDIF and ORIF allow the second operand not to be computed if the
diff --git a/gcc/tree.h b/gcc/tree.h
index abb3c608ebb..d742bc3d95b 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -57,7 +57,8 @@ extern const char tree_code_type[];
expression. */
#define IS_EXPR_CODE_CLASS(CLASS) \
- ((CLASS) == '<' || (CLASS) == '1' || (CLASS) == '2' || (CLASS) == 'e')
+ ((CLASS) == '<' || (CLASS) == '1' || (CLASS) == '2' || (CLASS) == 'e' \
+ || (CLASS) == 'r' || (CLASS) == 's')
/* Number of argument-words in each kind of tree-node. */
@@ -291,7 +292,7 @@ struct tree_common GTY(())
#define EXPR_CHECK(T) __extension__ \
({ const tree __t = (T); \
char const __c = TREE_CODE_CLASS (TREE_CODE (__t)); \
- if (!IS_EXPR_CODE_CLASS (__c) && __c != 'r' && __c != 's') \
+ if (!IS_EXPR_CODE_CLASS (__c)) \
tree_class_check_failed (__t, 'e', __FILE__, __LINE__, \
__FUNCTION__); \
__t; })
@@ -445,13 +446,21 @@ extern void tree_operand_check_failed (int, enum tree_code,
(TREE_CODE (TYPE) == INTEGER_TYPE || TREE_CODE (TYPE) == ENUMERAL_TYPE \
|| TREE_CODE (TYPE) == BOOLEAN_TYPE || TREE_CODE (TYPE) == CHAR_TYPE)
+/* Nonzero if TYPE represents a scalar floating-point type. */
+
+#define SCALAR_FLOAT_TYPE_P(TYPE) (TREE_CODE (TYPE) == REAL_TYPE)
+
+/* Nonzero if TYPE represents a complex floating-point type. */
+
+#define COMPLEX_FLOAT_TYPE_P(TYPE) \
+ (TREE_CODE (TYPE) == COMPLEX_TYPE \
+ && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
+
/* Nonzero if TYPE represents a floating-point type, including complex
floating-point types. */
#define FLOAT_TYPE_P(TYPE) \
- (TREE_CODE (TYPE) == REAL_TYPE \
- || (TREE_CODE (TYPE) == COMPLEX_TYPE \
- && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE))
+ (SCALAR_FLOAT_TYPE_P (TYPE) || COMPLEX_FLOAT_TYPE_P (TYPE))
/* Nonzero if TYPE represents an aggregate (multi-component) type. */
@@ -1253,12 +1262,13 @@ struct tree_type GTY(())
the name from decl_attributes to make_function_rtl and make_decl_rtl. */
#define DECL_SECTION_NAME(NODE) (DECL_CHECK (NODE)->decl.section_name)
-/* For FIELD_DECLs, this is the
- RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is
- a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
- and CONST_DECL nodes, this points to either the FUNCTION_DECL for the
- containing function, the RECORD_TYPE or UNION_TYPE for the containing
- type, or NULL_TREE if the given decl has "file scope". */
+/* For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
+ QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL,
+ PARM_DECL, FUNCTION_DECL, LABEL_DECL, and CONST_DECL nodes, this
+ points to either the FUNCTION_DECL for the containing function,
+ the RECORD_TYPE or UNION_TYPE for the containing type, or
+ NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
+ scope". */
#define DECL_CONTEXT(NODE) (DECL_CHECK (NODE)->decl.context)
#define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl.context)
/* In a DECL this is the field where attributes are stored. */
@@ -1287,6 +1297,7 @@ struct tree_type GTY(())
/* In PARM_DECL, holds the type as written (perhaps a function or array). */
#define DECL_ARG_TYPE_AS_WRITTEN(NODE) (PARM_DECL_CHECK (NODE)->decl.result)
/* For a FUNCTION_DECL, holds the tree of BINDINGs.
+ For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
For a VAR_DECL, holds the initial value.
For a PARM_DECL, not used--default
values for parameters are encoded in the type of the function,
@@ -1471,10 +1482,12 @@ struct tree_type GTY(())
where it is called. */
#define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inline_flag)
-/* Nonzero in a FUNCTION_DECL means this function has been found inlinable
- only by virtue of -finline-functions */
-#define DID_INLINE_FUNC(NODE) \
- (FUNCTION_DECL_CHECK (NODE)->decl.inlined_function_flag)
+/* Nonzero in a FUNCTION_DECL means that this function was declared inline,
+ such as via the `inline' keyword in C/C++. This flag controls the linkage
+ semantics of 'inline'; whether or not the function is inlined is
+ controlled by DECL_INLINE. */
+#define DECL_DECLARED_INLINE_P(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->decl.declared_inline_flag)
/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
#define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable)
@@ -1604,6 +1617,18 @@ struct tree_type GTY(())
#define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \
(DECL_POINTER_ALIAS_SET (NODE) != - 1)
+/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is
+ the approximate number of statements in this function. There is
+ no need for this number to be exact; it is only used in various
+ heuristics regarding optimization. */
+#define DECL_ESTIMATED_INSNS(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
+
+/* Nonzero for a decl which is at file scope. */
+#define DECL_FILE_SCOPE_P(EXP) \
+ (! DECL_CONTEXT (EXP) \
+ || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)
+
struct function;
struct tree_decl GTY(())
@@ -1644,7 +1669,7 @@ struct tree_decl GTY(())
unsigned user_align : 1;
unsigned uninlinable : 1;
unsigned thread_local_flag : 1;
- unsigned inlined_function_flag : 1;
+ unsigned declared_inline_flag : 1;
unsigned unused : 3;
/* three unused bits. */
@@ -1777,6 +1802,9 @@ enum tree_index
TI_BITSIZE_ONE,
TI_BITSIZE_UNIT,
+ TI_BOOLEAN_FALSE,
+ TI_BOOLEAN_TRUE,
+
TI_COMPLEX_INTEGER_TYPE,
TI_COMPLEX_FLOAT_TYPE,
TI_COMPLEX_DOUBLE_TYPE,
@@ -1786,12 +1814,18 @@ enum tree_index
TI_DOUBLE_TYPE,
TI_LONG_DOUBLE_TYPE,
+ TI_FLOAT_PTR_TYPE,
+ TI_DOUBLE_PTR_TYPE,
+ TI_LONG_DOUBLE_PTR_TYPE,
+ TI_INTEGER_PTR_TYPE,
+
TI_VOID_TYPE,
TI_PTR_TYPE,
TI_CONST_PTR_TYPE,
TI_SIZE_TYPE,
TI_PTRDIFF_TYPE,
TI_VA_LIST_TYPE,
+ TI_BOOLEAN_TYPE,
TI_VOID_LIST_NODE,
@@ -1820,6 +1854,7 @@ enum tree_index
TI_V2DI_TYPE,
TI_V1DI_TYPE,
TI_V16QI_TYPE,
+ TI_V4DF_TYPE,
TI_MAIN_IDENTIFIER,
@@ -1862,6 +1897,11 @@ extern GTY(()) tree global_trees[TI_MAX];
#define double_type_node global_trees[TI_DOUBLE_TYPE]
#define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE]
+#define float_ptr_type_node global_trees[TI_FLOAT_PTR_TYPE]
+#define double_ptr_type_node global_trees[TI_DOUBLE_PTR_TYPE]
+#define long_double_ptr_type_node global_trees[TI_LONG_DOUBLE_PTR_TYPE]
+#define integer_ptr_type_node global_trees[TI_INTEGER_PTR_TYPE]
+
#define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE]
#define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE]
#define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE]
@@ -1877,6 +1917,10 @@ extern GTY(()) tree global_trees[TI_MAX];
#define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
#define va_list_type_node global_trees[TI_VA_LIST_TYPE]
+#define boolean_type_node global_trees[TI_BOOLEAN_TYPE]
+#define boolean_false_node global_trees[TI_BOOLEAN_FALSE]
+#define boolean_true_node global_trees[TI_BOOLEAN_TRUE]
+
/* The node that should be placed at the end of a parameter list to
indicate that the function does not take a variable number of
arguments. The TREE_VALUE will be void_type_node and there will be
@@ -1910,6 +1954,7 @@ extern GTY(()) tree global_trees[TI_MAX];
#define V2DF_type_node global_trees[TI_V2DF_TYPE]
#define V16SF_type_node global_trees[TI_V16SF_TYPE]
#define V1DI_type_node global_trees[TI_V1DI_TYPE]
+#define V4DF_type_node global_trees[TI_V4DF_TYPE]
/* An enumeration of the standard C integer types. These must be
ordered so that shorter types appear before longer ones, and so
@@ -2029,10 +2074,18 @@ extern tree make_tree_vec (int);
extern tree get_identifier (const char *);
+#if GCC_VERSION >= 3000
+#define get_identifier(str) \
+ (__builtin_constant_p (str) \
+ ? get_identifier_with_length ((str), strlen (str)) \
+ : get_identifier (str))
+#endif
+
+
/* Identical to get_identifier, except that the length is assumed
known. */
-extern tree get_identifier_with_length (const char *, unsigned int);
+extern tree get_identifier_with_length (const char *, size_t);
/* If an identifier with the name TEXT (a null-terminated string) has
previously been referred to, return that node; otherwise return
@@ -2077,6 +2130,7 @@ extern tree build_index_2_type (tree, tree);
extern tree build_array_type (tree, tree);
extern tree build_function_type (tree, tree);
extern tree build_function_type_list (tree, ...);
+extern tree build_method_type_directly (tree, tree, tree);
extern tree build_method_type (tree, tree);
extern tree build_offset_type (tree, tree);
extern tree build_complex_type (tree);
@@ -2358,7 +2412,7 @@ enum size_type_kind
USIZETYPE, /* Unsigned representation of sizes in bytes. */
BITSIZETYPE, /* Normal representation of sizes in bits. */
SBITSIZETYPE, /* Signed representation of sizes in bits. */
- UBITSIZETYPE, /* Unsifgned representation of sizes in bits. */
+ UBITSIZETYPE, /* Unsigned representation of sizes in bits. */
TYPE_KIND_LAST};
extern GTY(()) tree sizetype_tab[(int) TYPE_KIND_LAST];
@@ -2433,6 +2487,11 @@ extern int fields_length (tree);
extern bool initializer_zerop (tree);
+/* Given an initializer INIT, return TRUE if INIT is at least 3/4 zeros.
+ Otherwise return FALSE. */
+
+extern int mostly_zeros_p (tree);
+
/* integer_zerop (tree x) is nonzero if X is an integer constant of value 0 */
extern int integer_zerop (tree);
@@ -2547,7 +2606,7 @@ extern tree substitute_in_expr (tree, tree, tree);
extern tree variable_size (tree);
-/* stabilize_reference (EXP) returns an reference equivalent to EXP
+/* stabilize_reference (EXP) returns a reference equivalent to EXP
but it can be used multiple times
and only evaluate the subexpressions once. */
@@ -2711,6 +2770,7 @@ extern void using_eh_for_cleanups (void);
subexpressions are not changed. */
extern tree fold (tree);
+extern tree fold_initializer (tree);
extern tree fold_single_bit_test (enum tree_code, tree, tree, tree);
extern int force_fit_type (tree, int);
@@ -2796,6 +2856,7 @@ extern void expand_main_function (void);
extern void init_dummy_function_start (void);
extern void expand_dummy_function_end (void);
extern void init_function_for_compilation (void);
+extern void allocate_struct_function (tree);
extern void init_function_start (tree);
extern void assign_parms (tree);
extern void put_var_into_stack (tree, int);
@@ -2810,7 +2871,7 @@ extern void pop_temp_slots (void);
extern void push_temp_slots (void);
extern void preserve_temp_slots (rtx);
extern void preserve_rtl_expr_temps (tree);
-extern int aggregate_value_p (tree);
+extern int aggregate_value_p (tree, tree);
extern void free_temps_for_rtl_expr (tree);
extern void instantiate_virtual_regs (tree, rtx);
extern void unshare_all_rtl (tree, rtx);
@@ -2896,6 +2957,7 @@ extern void output_inline_function (tree);
extern void set_decl_origin_self (tree);
/* In stor-layout.c */
+extern void set_min_and_max_values_for_integral_type (tree, int, bool);
extern void fixup_signed_type (tree);
extern void internal_reference_types (void);
@@ -2908,6 +2970,7 @@ 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);
/* In stmt.c */
extern void emit_nop (void);
@@ -3015,4 +3078,28 @@ extern void fancy_abort (const char *, int, const char *)
ATTRIBUTE_NORETURN;
#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
+/* Enum and arrays used for tree allocation stats.
+ Keep in sync with tree.c:tree_node_kind_names. */
+typedef enum
+{
+ d_kind,
+ t_kind,
+ b_kind,
+ s_kind,
+ r_kind,
+ e_kind,
+ c_kind,
+ id_kind,
+ perm_list_kind,
+ temp_list_kind,
+ vec_kind,
+ x_kind,
+ lang_decl,
+ lang_type,
+ all_kinds
+} tree_node_kind;
+
+extern int tree_node_counts[];
+extern int tree_node_sizes[];
+
#endif /* GCC_TREE_H */
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index 2569137a0e2..3221ba8002a 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,3 +1,58 @@
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * treetree.c: Revert.
+
+2003-09-21 Richard Henderson <rth@redhat.com>
+
+ * treetree.c: Update for DECL_SOURCE_LOCATION rename and
+ change to const.
+
+2003-07-28 Andreas Jaeger <aj@suse.de>
+
+ * treetree.c: Convert remaining K&R prototypes to ISO C90.
+ * tree1.c: Likewise.
+ * parse.y: Likewise.
+ * tree-convert.c: Likewise.
+
+2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * treetree.c: Remove unnecessary casts.
+
+2003-07-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang-options.h: Remove.
+ * lang.opt: Document some options. Remove --help.
+ * tree1.c (treelang_handle_option): Remove OPT__help case.
+
+2003-07-12 Andreas Jaeger <aj@suse.de>
+
+ * Make-lang.in (treelang/tree-convert.o): Depend on TM_H.
+
+2003-07-10 Neil Booth <neil@daikokuya.co.uk>
+
+ * Make-lang.in: Update.
+ * tree1.c: Don't include c-common.h.
+ (c_language): Remove.
+
+2003-07-10 Fergus Henderson <fjh@cs.mu.oz.au>
+ Steven Bosscher <steven@gcc.gnu.org>
+
+ * tree-convert.c: New file.
+ * treetree.c: Don't include c-tree.h. Include target.h.
+ (struct lang_identifier, union lang_tree_node, struct lang_type,
+ struct lang_function): New, minimal language-specific datastructs.
+ (tree_lang_truthvalue_conversion, tree_mark_addressable,
+ tree_lang_type_for_size, tree_lang_type_for_mode,
+ tree_lang_unsigned_type, tree_lang_signed_type,
+ tree_lang_signed_or_unsigned): New functions.
+ (LANG_HOOKS_*): Don't use C front end langhooks. Use new functions.
+ (pushlevel, poplevel, global_bindings_p, insert_block, set_block,
+ pushdecl, getdecls, kept_level_p, tree_push_type_decl,
+ tree_push_atomic_type_decl): New functions.
+ (struct resword, struct reswords): Remove.
+ * Make-lang.in: Update. Don't depend on C front end objects.
+ * config-lang.in: Likewise.
+
2003-07-07 Nathan Sidwell <nathan@codesourcery.com>
* treelang/treetree.c (tree_code_if_start, tree_code_if_else,
@@ -74,14 +129,14 @@
* treetree.c (c_lex): Add fake routine to satisfy RS6000 backend.
-Thu Jun 5 18:33:40 CEST 2003 Jan Hubicka <jh@suse.cz>
+2003-06-05 Jan Hubicka <jh@suse.cz>
* Make-lang.in: Add support for stageprofile and stagefeedback
2003-05-21 Nathan Sidwell <nathan@codesourcery.com>
* treetree.c (reswords): Remove __bounded__, __unbounded__.
-
+
2003-05-09 Tim Josling <tej@melbpc.org.au>
* Make-lang.in (TREE_BE_LIBS): Add C_TARGET_OBJS to object files
diff --git a/gcc/treelang/Make-lang.in b/gcc/treelang/Make-lang.in
index b6ce0fe72de..641f686dcf4 100644
--- a/gcc/treelang/Make-lang.in
+++ b/gcc/treelang/Make-lang.in
@@ -47,7 +47,9 @@ TREELANGSED = sed
TREELANGSEDFLAGS = -n
# back end compiler libraries etc
-TREE_BE_LIBS = $(C_TARGET_OBJS) $(BACKEND) $(LIBIBERTY) $(INTLLIBS) $(LIBS) $(LIBDEPS)
+TREE_BE_LIBS = $(BACKEND) $(LIBIBERTY) $(INTLIBS) $(LIBS) $(LIBDEPS)
+
+
GCC_EXTRAS = -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include
# ./xgcc is the just built compiler. See GCC_FOR_TARGET in the GCC Makefile.in.
@@ -56,10 +58,9 @@ GCC_EXTRAS = -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include
# GCC_FOR_TREELANG = ./xgcc $(GCC_EXTRAS)
-TREE_GENERATED = $(srcdir)/treelang/lex.c $(srcdir)/treelang/parse.c\
- $(srcdir)/treelang/parse.h $(srcdir)/treelang/parse.output $(srcdir)/treelang/TAGS
-
-TREE_SOURCE = ${srcdir}/treelang/parse.y ${srcdir}/treelang/lex.l ${srcdir}/treelang/tree1.c ${srcdir}/treelang/treelang.h ${srcdir}/treelang/treetree.c $(srcdir)/treelang/treetree.h ${srcdir}/treelang/opts.h
+TREE_GENERATED = $(srcdir)/treelang/lex.c $(srcdir)/treelang/parse.c \
+ $(srcdir)/treelang/parse.h $(srcdir)/treelang/parse.output \
+ $(srcdir)/treelang/TAGS
TREE_EXES = tree1$(exeext)
@@ -83,13 +84,13 @@ treelang.done: tree1$(exeext)
# no preprocessor
# core compiler
-tree1$(exeext): treelang/tree1.o treelang/treetree.o treelang/lex.o treelang/parse.o\
- $(TREE_BE_LIBS) c-convert.o c-typeck.o c-common.o c-cppbuiltin.o \
- c-decl.o attribs.o
+tree1$(exeext): treelang/tree1.o treelang/treetree.o treelang/tree-convert.o \
+ treelang/lex.o treelang/parse.o \
+ $(TREE_BE_LIBS) attribs.o
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
- treelang/tree1.o treelang/treetree.o treelang/lex.o treelang/parse.o \
- c-convert.o c-typeck.o c-common.o c-cppbuiltin.o c-decl.o attribs.o \
- $(TREE_BE_LIBS)
+ treelang/tree1.o treelang/treetree.o treelang/tree-convert.o \
+ treelang/lex.o treelang/parse.o \
+ $(TREE_BE_LIBS) attribs.o
#
# Compiling object files from source files.
@@ -98,14 +99,17 @@ tree1$(exeext): treelang/tree1.o treelang/treetree.o treelang/lex.o treelang/par
treelang/tree1.o: treelang/tree1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
flags.h toplev.h $(GGC_H) $(TREE_H) diagnostic.h treelang/treelang.h \
- input.h treelang/treetree.h options.h opts.h $(C_COMMON_H) \
+ input.h treelang/treetree.h options.h opts.h \
treelang/treetree.h gt-treelang-tree1.h gtype-treelang.h
treelang/treetree.o: treelang/treetree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(TREE_H) flags.h output.h $(C_TREE_H) $(RTL_H) $(GGC_H) toplev.h \
+ $(TM_H) $(TREE_H) flags.h output.h $(RTL_H) $(GGC_H) toplev.h \
varray.h $(LANGHOOKS_DEF_H) langhooks.h treelang/treelang.h input.h \
treelang/treetree.h treelang/parse.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: treelang/parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) diagnostic.h treelang/treelang.h input.h treelang/treetree.h
@@ -314,9 +318,6 @@ treelang.check.fix: force
-cp testsuite/treelang/*runpgm* t
-rm -f t/*nofilename
-treelang.wc: force
- wc ${TREE_SOURCE}
-
#
.PHONY: treelang.html
@@ -324,3 +325,5 @@ treelang.wc: force
treelang.html:
cd $(srcdir)/treelang && texi2html -I ../doc/include -verbose -menu -split_chapter -number treelang.texi
# mv treelang*.html $(srcdir)/treelang
+
+config.status: treelang/config-lang.in
diff --git a/gcc/treelang/config-lang.in b/gcc/treelang/config-lang.in
index 4f5a82e1668..f8a52f9787f 100644
--- a/gcc/treelang/config-lang.in
+++ b/gcc/treelang/config-lang.in
@@ -36,4 +36,4 @@ diff_excludes="-x lex.c -x parse.c -x parse.h"
headers=
build_by_default="no"
-gtfiles="\$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/treelang/tree1.c \$(srcdir)/treelang/treelang.h"
+gtfiles="\$(srcdir)/treelang/tree1.c \$(srcdir)/treelang/treetree.c \$(srcdir)/treelang/treelang.h"
diff --git a/gcc/treelang/lang.opt b/gcc/treelang/lang.opt
index a8fd70b068e..32b7150b0c9 100644
--- a/gcc/treelang/lang.opt
+++ b/gcc/treelang/lang.opt
@@ -25,14 +25,13 @@
Language
Treelang
--help
-Treelang
-
flexer-trace
Treelang
+Trace lexical analysis
fparser-trace
Treelang
+Trace the parsing process
v
Treelang
diff --git a/gcc/treelang/parse.y b/gcc/treelang/parse.y
index 5222a885dcf..f0f721d5545 100644
--- a/gcc/treelang/parse.y
+++ b/gcc/treelang/parse.y
@@ -59,9 +59,10 @@
/* My yylex routine used to intercept calls to flex generated code, to
record lex time. */
int yylex (void);
-static inline int my_yylex(void);
+static inline int my_yylex (void);
/* Call lex, but ensure time is charged to TV_LEX. */
-static inline int my_yylex ()
+static inline int
+my_yylex (void)
{
int res;
timevar_push (TV_LEX);
diff --git a/gcc/treelang/tree-convert.c b/gcc/treelang/tree-convert.c
new file mode 100644
index 00000000000..77741453f40
--- /dev/null
+++ b/gcc/treelang/tree-convert.c
@@ -0,0 +1,107 @@
+/* Language-level data type conversion for Treelang.
+ This is a very slightly modified copy of c-convert.c.
+ Copyright (C) 1987, 1988, 1991, 1998, 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. */
+
+
+/* This file contains the functions for converting C expressions
+ to different data types. The only entry point is `convert'.
+ Every language front end must have a `convert' function
+ but what kind of conversions it does will depend on the language. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "diagnostic.h"
+#include "tree.h"
+#include "flags.h"
+#include "convert.h"
+#include "toplev.h"
+#include "langhooks.h"
+
+/* Change of width--truncation and extension of integers or reals--
+ is represented with NOP_EXPR. Proper functioning of many things
+ assumes that no other conversions can be NOP_EXPRs.
+
+ Conversion between integer and pointer is represented with CONVERT_EXPR.
+ Converting integer to real uses FLOAT_EXPR
+ and real to integer uses FIX_TRUNC_EXPR.
+
+ Here is a list of all the functions that assume that widening and
+ narrowing is always done with a NOP_EXPR:
+ In convert.c, convert_to_integer.
+ In c-typeck.c, build_binary_op (boolean ops), and
+ c_common_truthvalue_conversion.
+ In expr.c: expand_expr, for operands of a MULT_EXPR.
+ In fold-const.c: fold.
+ In tree.c: get_narrower and get_unwidened. */
+
+/* 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. */
+
+tree
+convert (tree type, tree expr)
+{
+ tree e = expr;
+ enum tree_code code = TREE_CODE (type);
+
+ if (type == TREE_TYPE (expr)
+ || TREE_CODE (expr) == ERROR_MARK
+ || code == ERROR_MARK || TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
+ return expr;
+
+ if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
+ return fold (build1 (NOP_EXPR, type, expr));
+ if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
+ return error_mark_node;
+ if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)
+ {
+ error ("void value not ignored as it ought to be");
+ return error_mark_node;
+ }
+ if (code == VOID_TYPE)
+ return build1 (CONVERT_EXPR, type, e);
+ if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
+ return fold (convert_to_integer (type, e));
+ if (code == BOOLEAN_TYPE)
+ {
+ tree t = (*lang_hooks.truthvalue_conversion) (expr);
+ /* If it returns a NOP_EXPR, we must fold it here to avoid
+ infinite recursion between fold () and convert (). */
+ if (TREE_CODE (t) == NOP_EXPR)
+ return fold (build1 (NOP_EXPR, type, TREE_OPERAND (t, 0)));
+ else
+ return fold (build1 (NOP_EXPR, type, t));
+ }
+ if (code == POINTER_TYPE || code == REFERENCE_TYPE)
+ return fold (convert_to_pointer (type, e));
+ if (code == REAL_TYPE)
+ return fold (convert_to_real (type, e));
+ if (code == COMPLEX_TYPE)
+ return fold (convert_to_complex (type, e));
+ if (code == VECTOR_TYPE)
+ return fold (convert_to_vector (type, e));
+
+ error ("conversion to non-scalar type requested");
+ return error_mark_node;
+}
diff --git a/gcc/treelang/tree1.c b/gcc/treelang/tree1.c
index 54c41eeb6d9..3ee7c161944 100644
--- a/gcc/treelang/tree1.c
+++ b/gcc/treelang/tree1.c
@@ -46,9 +46,6 @@
#include "treetree.h"
#include "opts.h"
#include "options.h"
-#include "c-common.h"
-
-enum c_language_kind c_language = clk_c;
extern int yyparse (void);
@@ -111,17 +108,6 @@ treelang_handle_option (size_t scode, const char *arg ATTRIBUTE_UNUSED,
default:
abort();
- case OPT__help:
- if (!version_done)
- {
- fputs (language_string, stdout);
- fputs (version_string, stdout);
- fputs ("\n", stdout);
- version_done = 1;
- }
- fprintf (stdout, "Usage: tree1 [switches] -o output input\n");
- break;
-
case OPT_v:
if (!version_done)
{
@@ -152,7 +138,7 @@ treelang_handle_option (size_t scode, const char *arg ATTRIBUTE_UNUSED,
/* Language dependent parser setup. */
bool
-treelang_init ()
+treelang_init (void)
{
input_filename = main_input_filename;
input_line = 0;
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index c752a82f1c2..7697e3c49e5 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -63,13 +63,13 @@
#include "tree.h"
#include "flags.h"
#include "output.h"
-#include "c-tree.h"
#include "rtl.h"
#include "ggc.h"
#include "toplev.h"
#include "varray.h"
#include "langhooks-def.h"
#include "langhooks.h"
+#include "target.h"
#include "treelang.h"
#include "treetree.h"
@@ -78,31 +78,91 @@
extern int option_main;
extern char **file_names;
+/* Types expected by gcc's garbage collector.
+ These types exist to allow language front-ends to
+ add extra information in gcc's parse tree data structure.
+ But the treelang front end doesn't use them -- it has
+ its own parse tree data structure.
+ We define them here only to satisfy gcc's garbage collector. */
+
+/* Language-specific identifier information. */
+
+struct lang_identifier GTY(())
+{
+ struct tree_identifier common;
+};
+
+/* Language-specific tree node information. */
+
+union lang_tree_node
+ GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
+{
+ union tree_node GTY ((tag ("0"),
+ desc ("tree_node_structure (&%h)")))
+ generic;
+ struct lang_identifier GTY ((tag ("1"))) identifier;
+};
+
+/* Language-specific type information. */
+
+struct lang_type GTY(())
+{
+ char junk; /* dummy field to ensure struct is not empty */
+};
+
+/* Language-specific declaration information. */
+
+struct lang_decl GTY(())
+{
+ char junk; /* dummy field to ensure struct is not empty */
+};
+
+struct language_function GTY(())
+{
+ char junk; /* dummy field to ensure struct is not empty */
+};
+
+static tree tree_lang_truthvalue_conversion (tree expr);
+static bool tree_mark_addressable (tree exp);
+static tree tree_lang_type_for_size (unsigned precision, int unsignedp);
+static tree tree_lang_type_for_mode (enum machine_mode mode, int unsignedp);
+static tree tree_lang_unsigned_type (tree type_node);
+static tree tree_lang_signed_type (tree type_node);
+static tree tree_lang_signed_or_unsigned_type (int unsignedp, tree type);
+
+/* XXX these should be static */
+void pushlevel (int ignore);
+tree poplevel (int keep, int reverse, int functionbody);
+int global_bindings_p (void);
+void insert_block (tree block);
+void set_block (tree block);
+tree pushdecl (tree decl);
+tree getdecls (void);
+int kept_level_p (void);
+
+static void tree_push_type_decl (tree id, tree type_node);
+static void tree_push_atomic_type_decl (tree id, tree type_node);
+
/* The front end language hooks (addresses of code for this front
- end). Mostly just use the C routines. */
+ end). These are not really very language-dependent, i.e.
+ treelang, C, Mercury, etc. can all use almost the same definitions. */
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
-#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
+#define LANG_HOOKS_TRUTHVALUE_CONVERSION tree_lang_truthvalue_conversion
#undef LANG_HOOKS_MARK_ADDRESSABLE
-#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
+#define LANG_HOOKS_MARK_ADDRESSABLE tree_mark_addressable
#undef LANG_HOOKS_SIGNED_TYPE
-#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
+#define LANG_HOOKS_SIGNED_TYPE tree_lang_signed_type
#undef LANG_HOOKS_UNSIGNED_TYPE
-#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
+#define LANG_HOOKS_UNSIGNED_TYPE tree_lang_unsigned_type
#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
-#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE tree_lang_signed_or_unsigned_type
#undef LANG_HOOKS_TYPE_FOR_MODE
-#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
+#define LANG_HOOKS_TYPE_FOR_MODE tree_lang_type_for_mode
#undef LANG_HOOKS_TYPE_FOR_SIZE
-#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
+#define LANG_HOOKS_TYPE_FOR_SIZE tree_lang_type_for_size
#undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE treelang_parse_file
-#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
-#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
-#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
-#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
/* Hook routines and data unique to treelang. */
@@ -645,7 +705,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
with tree type TYPE and with operands1 OP1, OP2 (maybe), OP3 (maybe). */
tree
tree_code_get_expression (unsigned int exp_type,
- tree type, tree op1, tree op2, tree op3 ATTRIBUTE_UNUSED)
+ tree type, tree op1, tree op2,
+ tree op3 ATTRIBUTE_UNUSED)
{
tree ret1;
int operator;
@@ -805,483 +866,545 @@ tree_code_get_numeric_type (unsigned int size1, unsigned int sign1)
return ret1;
}
-/* Garbage Collection. */
-
-/* Callback to mark storage M as used always. */
-
-void
-tree_ggc_storage_always_used (void * m)
-{
- void **mm; /* Actually M is a pointer to a pointer to the memory. */
- mm = (void**)m;
-
- if (*mm)
- ggc_mark (*mm);
-}
-
-/* Following from c-lang.c. */
-
-/* Used by c-typeck.c (build_external_ref), but only for objc. */
+/* Get a stringpool entry for a string S of length L. This is needed
+ because the GTY routines don't mark strings, forcing you to put
+ them into stringpool, which is never freed. */
-tree
-lookup_objc_ivar (tree id ATTRIBUTE_UNUSED)
+const char*
+get_string (const char *s, size_t l)
{
- return 0;
+ tree t;
+ t = get_identifier_with_length (s, l);
+ return IDENTIFIER_POINTER(t);
}
+
+/* Save typing debug_tree all the time. Dump a tree T pretty and
+ concise. */
-/* Dummy routines called from c code. Save copying c-decl.c, c-common.c etc. */
-
-tree
-objc_is_id (tree arg ATTRIBUTE_UNUSED)
-{
- return 0;
-}
+void dt (tree t);
void
-check_function_format (int *status ATTRIBUTE_UNUSED,
- tree attrs ATTRIBUTE_UNUSED,
- tree params ATTRIBUTE_UNUSED)
+dt (tree t)
{
- return;
+ debug_tree (t);
}
-/* Tell the c code we are not objective C. */
+/* Routines Expected by gcc: */
-int
-objc_comptypes (tree lhs ATTRIBUTE_UNUSED,
- tree rhs ATTRIBUTE_UNUSED,
- int reflexive ATTRIBUTE_UNUSED)
-{
- return 0;
-}
+/* These are used to build types for various sizes. The code below
+ is a simplified version of that of GNAT. */
-/* Should not be called for treelang. Needed by RS6000 backend. */
+#ifndef MAX_BITS_PER_WORD
+#define MAX_BITS_PER_WORD BITS_PER_WORD
+#endif
-int c_lex (tree *value);
+/* This variable keeps a table for types for each precision so that we only
+ allocate each of them once. Signed and unsigned types are kept separate. */
+static GTY(()) tree signed_and_unsigned_types[MAX_BITS_PER_WORD + 1][2];
-int
-c_lex (tree *value ATTRIBUTE_UNUSED)
+/* XXX is this definition OK? */
+static tree
+tree_lang_truthvalue_conversion (tree expr)
{
- abort ();
+ return expr;
}
-/* Should not be called for treelang. */
+/* Mark EXP saying that we need to be able to take the
+ address of it; it should not be allocated in a register.
+ Value is 1 if successful.
+
+ This implementation was copied from c-decl.c. */
-tree
-build_stmt (enum tree_code code ATTRIBUTE_UNUSED, ...)
+static bool
+tree_mark_addressable (tree exp)
{
- abort ();
+ register tree x = exp;
+ while (1)
+ switch (TREE_CODE (x))
+ {
+ case COMPONENT_REF:
+ case ADDR_EXPR:
+ case ARRAY_REF:
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ x = TREE_OPERAND (x, 0);
+ break;
+
+ case CONSTRUCTOR:
+ TREE_ADDRESSABLE (x) = 1;
+ return 1;
+
+ case VAR_DECL:
+ case CONST_DECL:
+ case PARM_DECL:
+ case RESULT_DECL:
+ if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
+ && DECL_NONLOCAL (x))
+ {
+ if (TREE_PUBLIC (x))
+ {
+ error ("global register variable `%s' used in nested function",
+ IDENTIFIER_POINTER (DECL_NAME (x)));
+ return 0;
+ }
+ pedwarn ("register variable `%s' used in nested function",
+ IDENTIFIER_POINTER (DECL_NAME (x)));
+ }
+ else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
+ {
+ if (TREE_PUBLIC (x))
+ {
+ error ("address of global register variable `%s' requested",
+ IDENTIFIER_POINTER (DECL_NAME (x)));
+ return 0;
+ }
+
+ pedwarn ("address of register variable `%s' requested",
+ IDENTIFIER_POINTER (DECL_NAME (x)));
+ }
+ put_var_into_stack (x, /*rescan=*/ true);
+
+ /* drops in */
+ case FUNCTION_DECL:
+ TREE_ADDRESSABLE (x) = 1;
+
+ default:
+ return 1;
+ }
}
-
-/* Should not be called for treelang. */
-
-tree
-add_stmt (tree t ATTRIBUTE_UNUSED)
+
+/* 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. */
+
+static tree
+tree_lang_type_for_size (unsigned precision, int unsignedp)
{
- abort ();
-}
+ tree t;
-/* Should not be called for treelang. */
+ if (precision <= MAX_BITS_PER_WORD
+ && signed_and_unsigned_types[precision][unsignedp] != 0)
+ return signed_and_unsigned_types[precision][unsignedp];
-tree
-build_return_stmt (tree expr ATTRIBUTE_UNUSED)
-{
- abort ();
+ if (unsignedp)
+ t = signed_and_unsigned_types[precision][1]
+ = make_unsigned_type (precision);
+ else
+ t = signed_and_unsigned_types[precision][0]
+ = make_signed_type (precision);
+
+ return t;
}
-/* C warning, ignore. */
+/* Return a data type that has machine mode MODE. UNSIGNEDP selects
+ an unsigned type; otherwise a signed type is returned. */
-void
-pedwarn_c99 (const char *msgid ATTRIBUTE_UNUSED, ...)
+static tree
+tree_lang_type_for_mode (enum machine_mode mode, int unsignedp)
{
- return;
+ return tree_lang_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
}
-/* Should not be called for treelang. */
+/* Return the unsigned version of a TYPE_NODE, a scalar type. */
-tree
-build_case_label (tree low_value ATTRIBUTE_UNUSED,
- tree high_value ATTRIBUTE_UNUSED,
- tree label_decl ATTRIBUTE_UNUSED)
+static tree
+tree_lang_unsigned_type (tree type_node)
{
- abort ();
+ return tree_lang_type_for_size (TYPE_PRECISION (type_node), 1);
}
-/* Should not be called for treelang. */
+/* Return the signed version of a TYPE_NODE, a scalar type. */
-void
-emit_local_var (tree decl ATTRIBUTE_UNUSED)
+static tree
+tree_lang_signed_type (tree type_node)
{
- abort ();
+ return tree_lang_type_for_size (TYPE_PRECISION (type_node), 0);
}
-/* Should not be called for treelang. */
+/* Return a type the same as TYPE except unsigned or signed according to
+ UNSIGNEDP. */
-void
-expand_stmt (tree t ATTRIBUTE_UNUSED)
+static tree
+tree_lang_signed_or_unsigned_type (int unsignedp, tree type)
{
- abort ();
+ if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
+ return type;
+ else
+ return tree_lang_type_for_size (TYPE_PRECISION (type), unsignedp);
}
+
+/* These functions and variables deal with binding contours. We only
+ need these functions for the list of PARM_DECLs, but we leave the
+ functions more general; these are a simplified version of the
+ functions from GNAT. */
-/* Should not be called for treelang. */
+/* For each binding contour we allocate a binding_level structure which records
+ the entities defined or declared in that contour. Contours include:
-cpp_reader *
-cpp_create_reader (enum c_lang lang ATTRIBUTE_UNUSED,
- struct ht *table ATTRIBUTE_UNUSED)
-{
- abort ();
-}
+ the global one
+ one for each subprogram definition
+ one for each compound statement (declare block)
-/* Should not be called for treelang. */
+ Binding contours are used to create GCC tree BLOCK nodes. */
-void
-init_c_lex (void)
+struct binding_level
{
- abort ();
-}
+ /* A chain of ..._DECL nodes for all variables, constants, functions,
+ parameters and type declarations. These ..._DECL nodes are chained
+ through the TREE_CHAIN field. Note that these ..._DECL nodes are stored
+ in the reverse of the order supplied to be compatible with the
+ back-end. */
+ tree names;
+ /* For each level (except the global one), a chain of BLOCK nodes for all
+ the levels that were entered and exited one level down from this one. */
+ tree blocks;
+ /* The back end may need, for its own internal processing, to create a BLOCK
+ node. This field is set aside for this purpose. If this field is non-null
+ when the level is popped, i.e. when poplevel is invoked, we will use such
+ block instead of creating a new one from the 'names' field, that is the
+ ..._DECL nodes accumulated so far. Typically the routine 'pushlevel'
+ will be called before setting this field, so that if the front-end had
+ inserted ..._DECL nodes in the current block they will not be lost. */
+ tree block_created_by_back_end;
+ /* The binding level containing this one (the enclosing binding level). */
+ struct binding_level *level_chain;
+};
-/* Should not be called for treelang. */
+/* The binding level currently in effect. */
+static struct binding_level *current_binding_level = NULL;
-void init_pragma (void);
+/* The outermost binding level. This binding level is created when the
+ compiler is started and it will exist through the entire compilation. */
+static struct binding_level *global_binding_level;
-void
-init_pragma ()
-{
- abort ();
-}
-
-/* Should not be called for treelang. */
+/* Binding level structures are initialized by copying this one. */
+static struct binding_level clear_binding_level = {NULL, NULL, NULL, NULL};
+
+/* Return non-zero if we are currently in the global binding level. */
int
-cpp_finish (cpp_reader *pfile ATTRIBUTE_UNUSED, FILE *f ATTRIBUTE_UNUSED)
-{
- abort ();
-}
-
-/* Should not be called for treelang. */
-
-unsigned int
-cpp_errors (cpp_reader *pfile ATTRIBUTE_UNUSED)
+global_bindings_p (void)
{
- abort ();
+ return current_binding_level == global_binding_level ? -1 : 0;
}
-/* Dummy called by C. */
+/* Return 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). */
tree
-handle_format_attribute (tree *node ATTRIBUTE_UNUSED,
- tree name ATTRIBUTE_UNUSED,
- tree args ATTRIBUTE_UNUSED,
- int flags ATTRIBUTE_UNUSED,
- bool *no_add_attrs ATTRIBUTE_UNUSED)
+getdecls (void)
{
- return NULL_TREE;
+ return current_binding_level->names;
}
-/* Should not be called for treelang. */
+/* Nonzero if the current level needs to have a BLOCK made. */
-tree
-handle_format_arg_attribute (tree *node ATTRIBUTE_UNUSED,
- tree name ATTRIBUTE_UNUSED,
- tree args ATTRIBUTE_UNUSED,
- int flags ATTRIBUTE_UNUSED,
- bool *no_add_attrs ATTRIBUTE_UNUSED)
+int
+kept_level_p (void)
{
- abort ();
+ return (current_binding_level->names != 0);
}
-/* Should not be called for treelang. */
+/* Enter a new binding level. The input parameter is ignored, but has to be
+ specified for back-end compatibility. */
void
-cpp_assert (cpp_reader * cr ATTRIBUTE_UNUSED,
- const char *s ATTRIBUTE_UNUSED)
+pushlevel (int ignore ATTRIBUTE_UNUSED)
{
- abort ();
-}
+ struct binding_level *newlevel = xmalloc (sizeof (struct binding_level));
-/* Should not be called for treelang. */
+ *newlevel = clear_binding_level;
-void
-set_Wformat (int setting ATTRIBUTE_UNUSED)
-{
- abort ();
+ /* Add this level to the front of the chain (stack) of levels that are
+ active. */
+ newlevel->level_chain = current_binding_level;
+ current_binding_level = newlevel;
}
-/* Used for objective C. */
+/* Exit a binding level.
+ Pop the level off, and restore the state of the identifier-decl mappings
+ that were in effect when this level was entered.
-void
-objc_check_decl (tree decl ATTRIBUTE_UNUSED);
+ If KEEP is nonzero, this level had explicit declarations, so
+ and create a "block" (a BLOCK node) for the level
+ to record its declarations and subblocks for symbol table output.
-void
-objc_check_decl (tree decl ATTRIBUTE_UNUSED)
-{
- abort ();
-}
+ If FUNCTIONBODY is nonzero, this level is the body of a function,
+ so create a block as if KEEP were set and also clear out all
+ label names.
-/* Tell the c code we are not objective C. */
+ If REVERSE is nonzero, reverse the order of decls before putting
+ them into the BLOCK. */
tree
-objc_message_selector (void);
-
-tree
-objc_message_selector ()
+poplevel (int keep, int reverse, int functionbody)
{
- return 0;
-}
-
-/* Should not be called for treelang. */
-
-void
-gen_aux_info_record (tree fndecl ATTRIBUTE_UNUSED,
- int is_definition ATTRIBUTE_UNUSED,
- int is_implicit ATTRIBUTE_UNUSED,
- int is_prototyped ATTRIBUTE_UNUSED)
-{
- abort ();
-}
+ /* Points to a 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
+ routine. */
+ tree block_node = NULL_TREE;
+ tree decl_chain;
+ tree subblock_chain = current_binding_level->blocks;
+ tree subblock_node;
+ tree block_created_by_back_end;
+
+ /* Reverse the list of *_DECL nodes if desired. Note that the ..._DECL
+ nodes chained through the `names' field of current_binding_level are in
+ reverse order except for PARM_DECL node, which are explicitely stored in
+ the right order. */
+ decl_chain = (reverse) ? nreverse (current_binding_level->names)
+ : current_binding_level->names;
+
+ block_created_by_back_end = current_binding_level->block_created_by_back_end;
+ if (block_created_by_back_end != 0)
+ {
+ block_node = block_created_by_back_end;
+
+ /* Check if we are about to discard some information that was gathered
+ by the front-end. Nameley check if the back-end created a new block
+ without calling pushlevel first. To understand why things are lost
+ just look at the next case (i.e. no block created by back-end. */
+ if ((keep || functionbody) && (decl_chain || subblock_chain))
+ abort ();
+ }
-/* Should not be called for treelang, but it is. */
+ /* If there were any declarations in the current binding level, or if this
+ binding level is a function body, or if there are any nested blocks then
+ create a BLOCK node to record them for the life of this function. */
+ else if (keep || functionbody)
+ block_node = build_block (keep ? decl_chain : 0, 0, subblock_chain, 0, 0);
+
+ /* Record the BLOCK node just built as the subblock its enclosing scope. */
+ for (subblock_node = subblock_chain; subblock_node;
+ subblock_node = TREE_CHAIN (subblock_node))
+ BLOCK_SUPERCONTEXT (subblock_node) = block_node;
+
+ /* Clear out the meanings of the local variables of this level. */
+
+ for (subblock_node = decl_chain; subblock_node;
+ subblock_node = TREE_CHAIN (subblock_node))
+ if (DECL_NAME (subblock_node) != 0)
+ /* If the identifier was used or addressed via a local extern decl,
+ don't forget that fact. */
+ if (DECL_EXTERNAL (subblock_node))
+ {
+ if (TREE_USED (subblock_node))
+ TREE_USED (DECL_NAME (subblock_node)) = 1;
+ if (TREE_ADDRESSABLE (subblock_node))
+ TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (subblock_node)) = 1;
+ }
+
+ /* Pop the current level. */
+ current_binding_level = current_binding_level->level_chain;
+
+ if (functionbody)
+ {
+ /* This is the top level block of a function. The ..._DECL chain stored
+ in BLOCK_VARS are the function's parameters (PARM_DECL nodes). Don't
+ leave them in the BLOCK because they are found in the FUNCTION_DECL
+ instead. */
+ DECL_INITIAL (current_function_decl) = block_node;
+ BLOCK_VARS (block_node) = 0;
+ }
+ else if (block_node)
+ {
+ if (block_created_by_back_end == NULL)
+ current_binding_level->blocks
+ = chainon (current_binding_level->blocks, block_node);
+ }
-void
-c_parse_init ()
-{
- return;
+ /* If we did not make a block for the level just exited, any blocks made for
+ inner levels (since they cannot be recorded as subblocks in that level)
+ must be carried forward so they will later become subblocks of something
+ else. */
+ else if (subblock_chain)
+ current_binding_level->blocks
+ = chainon (current_binding_level->blocks, subblock_chain);
+ if (block_node)
+ TREE_USED (block_node) = 1;
+
+ return block_node;
}
-
-/* Should not be called for treelang. */
-
-void maybe_apply_pragma_weak (tree decl);
+
+/* 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. */
void
-maybe_apply_pragma_weak (tree decl ATTRIBUTE_UNUSED)
+insert_block (tree block)
{
- abort ();
+ TREE_USED (block) = 1;
+ current_binding_level->blocks
+ = chainon (current_binding_level->blocks, block);
}
-/* Should not be called for treelang. */
+/* Set the BLOCK node for the innermost scope
+ (the one we are currently in). */
void
-add_decl_stmt (tree decl ATTRIBUTE_UNUSED)
+set_block (tree block)
{
- abort ();
+ current_binding_level->block_created_by_back_end = block;
}
-/* Should not be called for treelang. */
-
-tree
-maybe_apply_renaming_pragma (tree decl, tree asmname);
-
-/* Should not be called for treelang. */
+/* Records a ..._DECL node DECL as belonging to the current lexical scope.
+ Returns the ..._DECL node. */
tree
-maybe_apply_renaming_pragma (tree decl ATTRIBUTE_UNUSED, tree asmname ATTRIBUTE_UNUSED)
+pushdecl (tree decl)
{
- abort ();
-}
+ /* External objects aren't nested, other objects may be. */
+
+ if ((DECL_EXTERNAL (decl)) || (decl==current_function_decl))
+ DECL_CONTEXT (decl) = 0;
+ else
+ DECL_CONTEXT (decl) = current_function_decl;
-/* Should not be called for treelang. */
+ /* Put the declaration on the list. The list of declarations is in reverse
+ order. The list will be reversed later if necessary. This needs to be
+ this way for compatibility with the back-end. */
-void
-begin_stmt_tree (tree *t ATTRIBUTE_UNUSED)
-{
- abort ();
-}
+ TREE_CHAIN (decl) = current_binding_level->names;
+ current_binding_level->names = decl;
-/* Should not be called for treelang. */
+ /* For the declartion of a type, set its name if it is not already set. */
-void
-finish_stmt_tree (tree *t ATTRIBUTE_UNUSED)
-{
- abort ();
-}
+ if (TREE_CODE (decl) == TYPE_DECL
+ && TYPE_NAME (TREE_TYPE (decl)) == 0)
+ TYPE_NAME (TREE_TYPE (decl)) = DECL_NAME (decl);
-/* Should not be called for treelang. */
-
-int
-defer_fn (tree fn ATTRIBUTE_UNUSED)
-{
- abort ();
+ return decl;
}
+
-/* Should not be called for treelang. */
-
-cpp_options
-*cpp_get_options (cpp_reader * cr ATTRIBUTE_UNUSED)
+static void
+tree_push_type_decl(tree id, tree type_node)
{
- abort ();
+ tree decl = build_decl (TYPE_DECL, id, type_node);
+ TYPE_NAME (type_node) = decl;
+ TYPE_STUB_DECL (type_node) = decl;
+ pushdecl (decl);
}
-/* Should not be called for treelang. */
+/* push_atomic_type_decl() ensures that the type's type is itself.
+ Needed for DBX. Must only be used for atomic types,
+ not for e.g. pointer or array types. */
-void
-cpp_define (cpp_reader * cr ATTRIBUTE_UNUSED, const char * c ATTRIBUTE_UNUSED)
+static void
+tree_push_atomic_type_decl(tree id, tree type_node)
{
- abort ();
+ TREE_TYPE (type_node) = type_node;
+ tree_push_type_decl (id, type_node);
}
-/* Should not be called for treelang. */
-
-cpp_callbacks *
-cpp_get_callbacks (cpp_reader * cr ATTRIBUTE_UNUSED)
-{
- abort ();
-}
+#define NULL_BINDING_LEVEL (struct binding_level *) NULL
/* Create the predefined scalar types of C,
and some nodes representing standard constants (0, 1, (void *) 0).
Initialize the global binding level.
Make definitions for built-in primitive functions. */
- /* `unsigned long' is the standard type for sizeof.
- Note that stddef.h uses `unsigned long',
- and this must agree, even if long and int are the same size. */
-
-/* The reserved keyword table. */
-struct resword
-{
- const char *word;
- ENUM_BITFIELD(rid) rid : 16;
- unsigned int disable : 16;
-};
-
-static const struct resword reswords[] =
-{
- { "_Bool", RID_BOOL, 0 },
- { "_Complex", RID_COMPLEX, 0 },
- { "__FUNCTION__", RID_FUNCTION_NAME, 0 },
- { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 },
- { "__alignof", RID_ALIGNOF, 0 },
- { "__alignof__", RID_ALIGNOF, 0 },
- { "__asm", RID_ASM, 0 },
- { "__asm__", RID_ASM, 0 },
- { "__attribute", RID_ATTRIBUTE, 0 },
- { "__attribute__", RID_ATTRIBUTE, 0 },
- { "__builtin_choose_expr", RID_CHOOSE_EXPR, 0 },
- { "__builtin_types_compatible_p", RID_TYPES_COMPATIBLE_P, 0 },
- { "__builtin_va_arg", RID_VA_ARG, 0 },
- { "__complex", RID_COMPLEX, 0 },
- { "__complex__", RID_COMPLEX, 0 },
- { "__const", RID_CONST, 0 },
- { "__const__", RID_CONST, 0 },
- { "__extension__", RID_EXTENSION, 0 },
- { "__func__", RID_C99_FUNCTION_NAME, 0 },
- { "__imag", RID_IMAGPART, 0 },
- { "__imag__", RID_IMAGPART, 0 },
- { "__inline", RID_INLINE, 0 },
- { "__inline__", RID_INLINE, 0 },
- { "__label__", RID_LABEL, 0 },
- { "__ptrbase", RID_PTRBASE, 0 },
- { "__ptrbase__", RID_PTRBASE, 0 },
- { "__ptrextent", RID_PTREXTENT, 0 },
- { "__ptrextent__", RID_PTREXTENT, 0 },
- { "__ptrvalue", RID_PTRVALUE, 0 },
- { "__ptrvalue__", RID_PTRVALUE, 0 },
- { "__real", RID_REALPART, 0 },
- { "__real__", RID_REALPART, 0 },
- { "__restrict", RID_RESTRICT, 0 },
- { "__restrict__", RID_RESTRICT, 0 },
- { "__signed", RID_SIGNED, 0 },
- { "__signed__", RID_SIGNED, 0 },
- { "__typeof", RID_TYPEOF, 0 },
- { "__typeof__", RID_TYPEOF, 0 },
- { "__volatile", RID_VOLATILE, 0 },
- { "__volatile__", RID_VOLATILE, 0 },
- { "asm", RID_ASM, 0 },
- { "auto", RID_AUTO, 0 },
- { "break", RID_BREAK, 0 },
- { "case", RID_CASE, 0 },
- { "char", RID_CHAR, 0 },
- { "const", RID_CONST, 0 },
- { "continue", RID_CONTINUE, 0 },
- { "default", RID_DEFAULT, 0 },
- { "do", RID_DO, 0 },
- { "double", RID_DOUBLE, 0 },
- { "else", RID_ELSE, 0 },
- { "enum", RID_ENUM, 0 },
- { "extern", RID_EXTERN, 0 },
- { "float", RID_FLOAT, 0 },
- { "for", RID_FOR, 0 },
- { "goto", RID_GOTO, 0 },
- { "if", RID_IF, 0 },
- { "inline", RID_INLINE, 0 },
- { "int", RID_INT, 0 },
- { "long", RID_LONG, 0 },
- { "register", RID_REGISTER, 0 },
- { "restrict", RID_RESTRICT, 0 },
- { "return", RID_RETURN, 0 },
- { "short", RID_SHORT, 0 },
- { "signed", RID_SIGNED, 0 },
- { "sizeof", RID_SIZEOF, 0 },
- { "static", RID_STATIC, 0 },
- { "struct", RID_STRUCT, 0 },
- { "switch", RID_SWITCH, 0 },
- { "typedef", RID_TYPEDEF, 0 },
- { "typeof", RID_TYPEOF, 0 },
- { "union", RID_UNION, 0 },
- { "unsigned", RID_UNSIGNED, 0 },
- { "void", RID_VOID, 0 },
- { "volatile", RID_VOLATILE, 0 },
- { "while", RID_WHILE, 0 },
-};
-#define N_reswords (sizeof reswords / sizeof (struct resword))
-
-/* Init enough to allow the C decl code to work, then clean up
- afterwards. */
-
void
-treelang_init_decl_processing ()
+treelang_init_decl_processing (void)
{
- unsigned int i;
- tree id;
-
- ridpointers = (tree *) ggc_calloc ((int) RID_MAX, sizeof (tree));
-
- for (i = 0; i < N_reswords; i++)
- {
- id = get_identifier (reswords[i].word);
- C_RID_CODE (id) = reswords[i].rid;
- C_IS_RESERVED_WORD (id) = 1;
- ridpointers [(int) reswords[i].rid] = id;
- }
-
- c_init_decl_processing ();
-
- /* ix86_return_pops_args takes the type of these so need to patch
- their own type as themselves. */
-
- for (i = 0; i < itk_none; i++)
- {
- if (integer_types[i])
- TREE_TYPE (integer_types [i]) = integer_types[i];
- }
-
- /* Probably these ones too. */
- TREE_TYPE (float_type_node) = float_type_node;
- TREE_TYPE (double_type_node) = double_type_node;
- TREE_TYPE (long_double_type_node) = long_double_type_node;
-
+ current_function_decl = NULL;
+ current_binding_level = NULL_BINDING_LEVEL;
+ pushlevel (0); /* make the binding_level structure for global names */
+ global_binding_level = current_binding_level;
+
+ build_common_tree_nodes (flag_signed_char);
+
+ /* set standard type names */
+
+ /* Define `int' and `char' first so that dbx will output them first. */
+
+ tree_push_atomic_type_decl (get_identifier ("int"), integer_type_node);
+ tree_push_atomic_type_decl (get_identifier ("char"), char_type_node);
+ tree_push_atomic_type_decl (get_identifier ("long int"),
+ long_integer_type_node);
+ tree_push_atomic_type_decl (get_identifier ("unsigned int"),
+ unsigned_type_node);
+ tree_push_atomic_type_decl (get_identifier ("long unsigned int"),
+ long_unsigned_type_node);
+ tree_push_atomic_type_decl (get_identifier ("long long int"),
+ long_long_integer_type_node);
+ tree_push_atomic_type_decl (get_identifier ("long long unsigned int"),
+ long_long_unsigned_type_node);
+ tree_push_atomic_type_decl (get_identifier ("short int"),
+ short_integer_type_node);
+ tree_push_atomic_type_decl (get_identifier ("short unsigned int"),
+ short_unsigned_type_node);
+ tree_push_atomic_type_decl (get_identifier ("signed char"),
+ signed_char_type_node);
+ tree_push_atomic_type_decl (get_identifier ("unsigned char"),
+ unsigned_char_type_node);
+ tree_push_atomic_type_decl (NULL_TREE, intQI_type_node);
+ tree_push_atomic_type_decl (NULL_TREE, intHI_type_node);
+ tree_push_atomic_type_decl (NULL_TREE, intSI_type_node);
+ tree_push_atomic_type_decl (NULL_TREE, intDI_type_node);
+#if HOST_BITS_PER_WIDE_INT >= 64
+ tree_push_atomic_type_decl (NULL_TREE, intTI_type_node);
+#endif
+ tree_push_atomic_type_decl (NULL_TREE, unsigned_intQI_type_node);
+ tree_push_atomic_type_decl (NULL_TREE, unsigned_intHI_type_node);
+ tree_push_atomic_type_decl (NULL_TREE, unsigned_intSI_type_node);
+ tree_push_atomic_type_decl (NULL_TREE, unsigned_intDI_type_node);
+#if HOST_BITS_PER_WIDE_INT >= 64
+ tree_push_atomic_type_decl (NULL_TREE, unsigned_intTI_type_node);
+#endif
+
+ size_type_node = make_unsigned_type (POINTER_SIZE);
+ tree_push_atomic_type_decl (get_identifier ("size_t"), size_type_node);
+ set_sizetype (size_type_node);
+
+ build_common_tree_nodes_2 (/* short_double= */ 0);
+
+ tree_push_atomic_type_decl (get_identifier ("float"), float_type_node);
+ tree_push_atomic_type_decl (get_identifier ("double"), double_type_node);
+ tree_push_atomic_type_decl (get_identifier ("long double"), long_double_type_node);
+ tree_push_atomic_type_decl (get_identifier ("void"), void_type_node);
+
+ /* Add any target-specific builtin functions. */
+ (*targetm.init_builtins) ();
+
+ pedantic_lvalues = pedantic;
}
-/* Save typing debug_tree all the time. Dump a tree T pretty and
- concise. */
+/* Return a definition for a builtin function named NAME and whose data type
+ is TYPE. TYPE should be a function type with argument types.
+ FUNCTION_CODE tells later passes how to compile calls to this function.
+ See tree.h for its possible values.
-void dt (tree t);
+ If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
+ the name to be called if we can't opencode the function. If
+ ATTRS is nonzero, use that for the function's attribute list.
-void
-dt (tree t)
-{
- debug_tree (t);
-}
-
-/* Get a stringpool entry for a string S of length L. This is needed
- because the GTY routines don't mark strings, forcing you to put
- them into stringpool, which is never freed. */
+ copied from gcc/c-decl.c
+*/
-const char*
-get_string (const char *s, size_t l)
+tree
+builtin_function (const char *name, tree type, int function_code,
+ enum built_in_class class, const char *library_name,
+ tree attrs)
{
- tree t;
- t = get_identifier_with_length (s, l);
- return IDENTIFIER_POINTER(t);
+ tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
+ DECL_EXTERNAL (decl) = 1;
+ TREE_PUBLIC (decl) = 1;
+ if (library_name)
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
+ make_decl_rtl (decl, NULL);
+ pushdecl (decl);
+ DECL_BUILT_IN_CLASS (decl) = class;
+ DECL_FUNCTION_CODE (decl) = function_code;
+
+ /* Possibly apply some default attributes to this built-in function. */
+ if (attrs)
+ decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
+ else
+ decl_attributes (&decl, NULL_TREE, 0);
+
+ return decl;
}
+#include "debug.h" /* for debug_hooks, needed by gt-treelang-treetree.h */
+#include "gt-treelang-treetree.h"
diff --git a/gcc/unroll.c b/gcc/unroll.c
index e557cb2c1e5..1c66b13fe78 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -671,14 +671,14 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
without initializing fields within the map structure.
To be safe, we use xcalloc to zero the memory. */
- map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
+ map = xcalloc (1, sizeof (struct inline_remap));
/* Allocate the label map. */
if (max_labelno > 0)
{
- map->label_map = (rtx *) xcalloc (max_labelno, sizeof (rtx));
- local_label = (char *) xcalloc (max_labelno, sizeof (char));
+ map->label_map = xcalloc (max_labelno, sizeof (rtx));
+ local_label = xcalloc (max_labelno, sizeof (char));
}
/* Search the loop and mark all local labels, i.e. the ones which have to
@@ -722,7 +722,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
/* Allocate space for the insn map. */
- map->insn_map = (rtx *) xmalloc (max_insnno * sizeof (rtx));
+ map->insn_map = xmalloc (max_insnno * sizeof (rtx));
/* Set this to zero, to indicate that we are doing loop unrolling,
not function inlining. */
@@ -748,11 +748,10 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
preconditioning code and find_splittable_regs will never be used
to access the splittable_regs[] and addr_combined_regs[] arrays. */
- splittable_regs = (rtx *) xcalloc (maxregnum, sizeof (rtx));
- splittable_regs_updates = (int *) xcalloc (maxregnum, sizeof (int));
- addr_combined_regs
- = (struct induction **) xcalloc (maxregnum, sizeof (struct induction *));
- local_regno = (char *) xcalloc (maxregnum, sizeof (char));
+ splittable_regs = xcalloc (maxregnum, sizeof (rtx));
+ splittable_regs_updates = xcalloc (maxregnum, sizeof (int));
+ addr_combined_regs = xcalloc (maxregnum, sizeof (struct induction *));
+ local_regno = xcalloc (maxregnum, sizeof (char));
/* Mark all local registers, i.e. the ones which are referenced only
inside the loop. */
@@ -854,7 +853,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
int less_p = (cc == LE || cc == LEU || cc == LT || cc == LTU);
int unsigned_p = (cc == LEU || cc == GEU || cc == LTU || cc == GTU);
- map->reg_map = (rtx *) xmalloc (maxregnum * sizeof (rtx));
+ map->reg_map = xmalloc (maxregnum * sizeof (rtx));
VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray, maxregnum,
"unroll_loop_precondition");
@@ -921,7 +920,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
/* Now emit a sequence of branches to jump to the proper precond
loop entry point. */
- labels = (rtx *) xmalloc (sizeof (rtx) * unroll_number);
+ labels = xmalloc (sizeof (rtx) * unroll_number);
for (i = 0; i < unroll_number; i++)
labels[i] = gen_label_rtx ();
@@ -1054,8 +1053,8 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
emit_label_after (labels[unroll_number - i],
PREV_INSN (loop_start));
- memset ((char *) map->insn_map, 0, max_insnno * sizeof (rtx));
- memset ((char *) &VARRAY_CONST_EQUIV (map->const_equiv_varray, 0),
+ memset (map->insn_map, 0, max_insnno * sizeof (rtx));
+ memset (&VARRAY_CONST_EQUIV (map->const_equiv_varray, 0),
0, (VARRAY_SIZE (map->const_equiv_varray)
* sizeof (struct const_equiv_data)));
map->const_age = 0;
@@ -1158,7 +1157,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
the constant maps also. */
maxregnum = max_reg_num ();
- map->reg_map = (rtx *) xmalloc (maxregnum * sizeof (rtx));
+ map->reg_map = xmalloc (maxregnum * sizeof (rtx));
init_reg_map (map, maxregnum);
@@ -1206,8 +1205,8 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
for (i = 0; i < unroll_number; i++)
{
- memset ((char *) map->insn_map, 0, max_insnno * sizeof (rtx));
- memset ((char *) &VARRAY_CONST_EQUIV (map->const_equiv_varray, 0), 0,
+ memset (map->insn_map, 0, max_insnno * sizeof (rtx));
+ memset (&VARRAY_CONST_EQUIV (map->const_equiv_varray, 0), 0,
VARRAY_SIZE (map->const_equiv_varray) * sizeof (struct const_equiv_data));
map->const_age = 0;
@@ -3619,7 +3618,7 @@ loop_iterations (struct loop *loop)
if (find_common_reg_term (temp, reg2))
initial_value = temp;
- else
+ else if (loop_invariant_p (loop, reg2))
{
/* Find what reg2 is equivalent to. Hopefully it will
either be reg1 or reg1 plus a constant. Let's ignore
diff --git a/gcc/unwind-c.c b/gcc/unwind-c.c
index fb2f720907b..c066a13070d 100644
--- a/gcc/unwind-c.c
+++ b/gcc/unwind-c.c
@@ -10,6 +10,15 @@ the 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 combined
+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
diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c
index cd979dc1d1e..26706d33705 100644
--- a/gcc/unwind-dw2-fde-darwin.c
+++ b/gcc/unwind-dw2-fde-darwin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -104,8 +104,23 @@ live_image_destructor (struct live_images *image)
{
if (image->object_info)
{
- /* Free any sorted arrays. */
- __deregister_frame_info_bases (image->fde);
+ struct km_object_info *the_obj_info;
+
+ the_obj_info =
+ _keymgr_get_and_lock_processwide_ptr (KEYMGR_GCC3_DW2_OBJ_LIST);
+ if (the_obj_info)
+ {
+ seen_objects = the_obj_info->seen_objects;
+ unseen_objects = the_obj_info->unseen_objects;
+
+ /* Free any sorted arrays. */
+ __deregister_frame_info_bases (image->fde);
+
+ the_obj_info->seen_objects = seen_objects;
+ the_obj_info->unseen_objects = unseen_objects;
+ }
+ _keymgr_set_and_unlock_processwide_ptr (KEYMGR_GCC3_DW2_OBJ_LIST,
+ the_obj_info);
free (image->object_info);
image->object_info = NULL;
@@ -166,20 +181,28 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
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)
{
- ob->next = unseen_objects;
- unseen_objects = ob;
-
+ struct object **p;
+
image->destructor = live_image_destructor;
image->object_info = ob;
image->examined_p |= (EXAMINED_IMAGE_MASK
| DESTRUCTOR_MAY_BE_CALLED_LIVE);
+
+ /* Insert the object into the classified list. */
+ for (p = &seen_objects; *p ; p = &(*p)->next)
+ if ((*p)->pc_begin < ob->pc_begin)
+ break;
+ ob->next = *p;
+ *p = ob;
}
- image->fde = real_fde;
-
- result = search_object (ob, pc);
+
if (result)
{
int encoding;
@@ -234,8 +257,8 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
{
the_obj_info->seen_objects = seen_objects;
the_obj_info->unseen_objects = unseen_objects;
- _keymgr_set_and_unlock_processwide_ptr (KEYMGR_GCC3_DW2_OBJ_LIST,
- the_obj_info);
}
+ _keymgr_set_and_unlock_processwide_ptr (KEYMGR_GCC3_DW2_OBJ_LIST,
+ the_obj_info);
return ret;
}
diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c
index 31fc1c47597..21d86b03bc1 100644
--- a/gcc/unwind-dw2-fde.c
+++ b/gcc/unwind-dw2-fde.c
@@ -115,7 +115,7 @@ __register_frame (void *begin)
if (*(uword *) begin == 0)
return;
- ob = (struct object *) malloc (sizeof (struct object));
+ ob = malloc (sizeof (struct object));
__register_frame_info (begin, ob);
}
@@ -153,7 +153,7 @@ __register_frame_info_table (void *begin, struct object *ob)
void
__register_frame_table (void *begin)
{
- struct object *ob = (struct object *) malloc (sizeof (struct object));
+ struct object *ob = malloc (sizeof (struct object));
__register_frame_info_table (begin, ob);
}
@@ -395,10 +395,10 @@ start_fde_sort (struct fde_accumulator *accu, size_t count)
return 0;
size = sizeof (struct fde_vector) + sizeof (fde *) * count;
- if ((accu->linear = (struct fde_vector *) malloc (size)))
+ if ((accu->linear = malloc (size)))
{
accu->linear->count = 0;
- if ((accu->erratic = (struct fde_vector *) malloc (size)))
+ if ((accu->erratic = malloc (size)))
accu->erratic->count = 0;
return 1;
}
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
index e61664b79e8..f94eaf99da9 100644
--- a/gcc/unwind-dw2.c
+++ b/gcc/unwind-dw2.c
@@ -9,6 +9,15 @@
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 combined
+ 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
@@ -54,6 +63,11 @@
#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
#endif
+/* A target can do some update context frobbing. */
+#ifndef MD_FROB_UPDATE_CONTEXT
+#define MD_FROB_UPDATE_CONTEXT(CTX, FS) do { } while (0)
+#endif
+
/* This is the register and unwind state for a particular frame. This
provides the information necessary to unwind up past a frame and return
to its caller. */
@@ -168,9 +182,27 @@ read_8s (const void *p) { const union unaligned *up = p; return up->s8; }
inline _Unwind_Word
_Unwind_GetGR (struct _Unwind_Context *context, int index)
{
+ int size;
+ void *ptr;
+
index = DWARF_REG_TO_UNWIND_COLUMN (index);
+ size = dwarf_reg_size_table[index];
+ ptr = context->reg[index];
+
/* This will segfault if the register hasn't been saved. */
- return * (_Unwind_Word *) context->reg[index];
+ if (size == sizeof(_Unwind_Ptr))
+ return * (_Unwind_Ptr *) ptr;
+
+ if (size == sizeof(_Unwind_Word))
+ return * (_Unwind_Word *) ptr;
+
+ abort ();
+}
+
+static inline void *
+_Unwind_GetPtr (struct _Unwind_Context *context, int index)
+{
+ return (void *)(_Unwind_Ptr) _Unwind_GetGR (context, index);
}
/* Get the value of the CFA as saved in CONTEXT. */
@@ -186,8 +218,19 @@ _Unwind_GetCFA (struct _Unwind_Context *context)
inline void
_Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
{
+ int size;
+ void *ptr;
+
index = DWARF_REG_TO_UNWIND_COLUMN (index);
- * (_Unwind_Word *) context->reg[index] = val;
+ size = dwarf_reg_size_table[index];
+ ptr = context->reg[index];
+
+ if (size == sizeof(_Unwind_Ptr))
+ * (_Unwind_Ptr *) ptr = val;
+ else if (size == sizeof(_Unwind_Word))
+ * (_Unwind_Word *) ptr = val;
+ else
+ abort ();
}
/* Get the pointer to a register INDEX as saved in CONTEXT. */
@@ -1072,6 +1115,23 @@ __frame_state_for (void *pc_target, struct frame_state *state_in)
return state_in;
}
+typedef union { _Unwind_Ptr ptr; _Unwind_Word word; } _Unwind_SpTmp;
+
+static inline void
+_Unwind_SetSpColumn (struct _Unwind_Context *context, void *cfa,
+ _Unwind_SpTmp *tmp_sp)
+{
+ int size = dwarf_reg_size_table[__builtin_dwarf_sp_column ()];
+
+ if (size == sizeof(_Unwind_Ptr))
+ tmp_sp->ptr = (_Unwind_Ptr) cfa;
+ else if (size == sizeof(_Unwind_Word))
+ tmp_sp->word = (_Unwind_Ptr) cfa;
+ else
+ abort ();
+ _Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), tmp_sp);
+}
+
static void
uw_update_context_1 (struct _Unwind_Context *context, _Unwind_FrameState *fs)
{
@@ -1095,13 +1155,10 @@ uw_update_context_1 (struct _Unwind_Context *context, _Unwind_FrameState *fs)
Always zap the saved stack pointer value for the next frame; carrying
the value over from one frame to another doesn't make sense. */
- _Unwind_Word tmp_sp;
+ _Unwind_SpTmp tmp_sp;
if (!_Unwind_GetGRPtr (&orig_context, __builtin_dwarf_sp_column ()))
- {
- tmp_sp = (_Unwind_Ptr) context->cfa;
- _Unwind_SetGRPtr (&orig_context, __builtin_dwarf_sp_column (), &tmp_sp);
- }
+ _Unwind_SetSpColumn (&orig_context, context->cfa, &tmp_sp);
_Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), NULL);
#endif
@@ -1109,7 +1166,7 @@ uw_update_context_1 (struct _Unwind_Context *context, _Unwind_FrameState *fs)
switch (fs->cfa_how)
{
case CFA_REG_OFFSET:
- cfa = (void *) (_Unwind_Ptr) _Unwind_GetGR (&orig_context, fs->cfa_reg);
+ cfa = _Unwind_GetPtr (&orig_context, fs->cfa_reg);
cfa += fs->cfa_offset;
break;
@@ -1160,6 +1217,8 @@ uw_update_context_1 (struct _Unwind_Context *context, _Unwind_FrameState *fs)
}
break;
}
+
+ MD_FROB_UPDATE_CONTEXT (context, fs);
}
/* CONTEXT describes the unwind state for a frame, and FS describes the FDE
@@ -1175,7 +1234,7 @@ uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
/* Compute the return address now, since the return address column
can change from frame to frame. */
context->ra = __builtin_extract_return_addr
- ((void *) (_Unwind_Ptr) _Unwind_GetGR (context, fs->retaddr_column));
+ (_Unwind_GetPtr (context, fs->retaddr_column));
}
/* Fill in CONTEXT for top-of-stack. The only valid registers at this
@@ -1192,13 +1251,19 @@ uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
} \
while (0)
+static inline void
+init_dwarf_reg_size_table (void)
+{
+ __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
+}
+
static void
uw_init_context_1 (struct _Unwind_Context *context,
void *outer_cfa, void *outer_ra)
{
void *ra = __builtin_extract_return_addr (__builtin_return_address (0));
_Unwind_FrameState fs;
- _Unwind_Word sp_slot;
+ _Unwind_SpTmp sp_slot;
memset (context, 0, sizeof (struct _Unwind_Context));
context->ra = ra;
@@ -1206,9 +1271,20 @@ uw_init_context_1 (struct _Unwind_Context *context,
if (uw_frame_state_for (context, &fs) != _URC_NO_REASON)
abort ();
+#if __GTHREADS
+ {
+ static __gthread_once_t once_regsizes = __GTHREAD_ONCE_INIT;
+ if (__gthread_once (&once_regsizes, init_dwarf_reg_size_table) != 0
+ || dwarf_reg_size_table[0] == 0)
+ init_dwarf_reg_size_table ();
+ }
+#else
+ if (dwarf_reg_size_table[0] == 0)
+ init_dwarf_reg_size_table ();
+#endif
+
/* Force the frame state to use the known cfa value. */
- sp_slot = (_Unwind_Ptr) outer_cfa;
- _Unwind_SetGRPtr (context, __builtin_dwarf_sp_column (), &sp_slot);
+ _Unwind_SetSpColumn (context, outer_cfa, &sp_slot);
fs.cfa_how = CFA_REG_OFFSET;
fs.cfa_reg = __builtin_dwarf_sp_column ();
fs.cfa_offset = 0;
@@ -1235,30 +1311,12 @@ uw_init_context_1 (struct _Unwind_Context *context,
} \
while (0)
-static inline void
-init_dwarf_reg_size_table (void)
-{
- __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
-}
-
static long
uw_install_context_1 (struct _Unwind_Context *current,
struct _Unwind_Context *target)
{
long i;
-#if __GTHREADS
- {
- static __gthread_once_t once_regsizes = __GTHREAD_ONCE_INIT;
- if (__gthread_once (&once_regsizes, init_dwarf_reg_size_table) != 0
- || dwarf_reg_size_table[0] == 0)
- init_dwarf_reg_size_table ();
- }
-#else
- if (dwarf_reg_size_table[0] == 0)
- init_dwarf_reg_size_table ();
-#endif
-
for (i = 0; i < DWARF_FRAME_REGISTERS; ++i)
{
void *c = current->reg[i];
@@ -1274,8 +1332,7 @@ uw_install_context_1 (struct _Unwind_Context *current,
/* If the last frame records a saved stack pointer, use it. */
if (_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
- target_cfa = (void *)(_Unwind_Ptr)
- _Unwind_GetGR (target, __builtin_dwarf_sp_column ());
+ target_cfa = _Unwind_GetPtr (target, __builtin_dwarf_sp_column ());
else
target_cfa = target->cfa;
diff --git a/gcc/unwind-pe.h b/gcc/unwind-pe.h
index bfa455c4f32..ec5d27f7e42 100644
--- a/gcc/unwind-pe.h
+++ b/gcc/unwind-pe.h
@@ -8,6 +8,15 @@
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 combined
+ 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
diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c
index 8d9766f5bc8..376135574e0 100644
--- a/gcc/unwind-sjlj.c
+++ b/gcc/unwind-sjlj.c
@@ -1,5 +1,5 @@
-/* DWARF2 exception handling and frame unwind runtime interface routines.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+/* SJLJ exception handling and frame unwind runtime interface routines.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@@ -9,6 +9,15 @@
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 combined
+ 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
diff --git a/gcc/unwind.h b/gcc/unwind.h
index a0d6ab3a14b..35c765ef4ac 100644
--- a/gcc/unwind.h
+++ b/gcc/unwind.h
@@ -210,6 +210,9 @@ _Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
abort ();
return 0;
}
+
+/* @@@ Retrieve the Backing Store Pointer of the given context. */
+extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
#else
extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
diff --git a/gcc/unwind.inc b/gcc/unwind.inc
index 0938d501f5f..683e94a121d 100644
--- a/gcc/unwind.inc
+++ b/gcc/unwind.inc
@@ -1,5 +1,5 @@
/* Exception handling and frame unwind runtime interface routines. -*- C -*-
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,15 @@
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 combined
+ 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
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index e843ddbe56b..5dca281b1df 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -40,9 +40,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
insn_values_to_profile function. This function is called from branch_prob
in profile.c and the requested values are instrumented by it in the first
compilation with -fprofile-arcs. The optimization may then read the
- gathered data in the second compilation with -fbranch-probabilities (the
- description of an exact way how to do it will be added here once the
- code responsible for reading of the data is merged). */
+ gathered data in the second compilation with -fbranch-probabilities.
+ The measured data is appended as REG_VALUE_PROFILE note to the instrumented
+ insn. The argument to the note consists of an EXPR_LIST where its
+ members have the following meaning (from the first to the last):
+
+ -- type of information gathered (HIST_TYPE*)
+ -- the expression that is profiled
+ -- list of counters starting from the first one. */
static void insn_values_to_profile (rtx, unsigned *, struct histogram_value **);
diff --git a/gcc/value-prof.h b/gcc/value-prof.h
index 74b754a25d6..233895e4a31 100644
--- a/gcc/value-prof.h
+++ b/gcc/value-prof.h
@@ -30,6 +30,10 @@ enum hist_type
difference between two evaluations of a value. */
};
+#define COUNTER_FOR_HIST_TYPE(TYPE) ((int) (TYPE) + GCOV_FIRST_VALUE_COUNTER)
+#define HIST_TYPE_FOR_COUNTER(COUNTER) \
+ ((enum hist_type) ((COUNTER) - GCOV_FIRST_VALUE_COUNTER))
+
/* The value to measure. */
struct histogram_value
{
diff --git a/gcc/varasm.c b/gcc/varasm.c
index aa1c3557de7..d0bdbc15bdc 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -114,11 +114,6 @@ struct varasm_status GTY(())
static GTY(()) int const_labelno;
-/* Number for making the label on the next
- static variable internal to a function. */
-
-static GTY(()) int var_labelno;
-
/* Carry information from ASM_DECLARE_OBJECT_NAME
to ASM_FINISH_DECLARE_OBJECT. */
@@ -377,7 +372,7 @@ set_named_section_flags (const char *section, unsigned int flags)
if (!entry)
{
- entry = (struct in_named_entry *) ggc_alloc (sizeof (*entry));
+ entry = ggc_alloc (sizeof (*entry));
*slot = entry;
entry->name = ggc_strdup (section);
entry->flags = flags;
@@ -437,7 +432,7 @@ named_section (tree decl, const char *name, int reloc)
{
flags = get_named_section_flags (name);
if ((flags & SECTION_OVERRIDE) == 0)
- error_with_decl (decl, "%s causes a section type conflict");
+ error ("%J%D causes a section type conflict", decl, decl);
}
named_section_flags (name, flags);
@@ -750,9 +745,7 @@ decode_reg_name (const char *asmspec)
void
make_decl_rtl (tree decl, const char *asmspec)
{
- int top_level = (DECL_CONTEXT (decl) == NULL_TREE);
const char *name = 0;
- const char *new_name = 0;
int reg_number;
rtx x;
@@ -792,8 +785,6 @@ make_decl_rtl (tree decl, const char *asmspec)
return;
}
- new_name = name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-
reg_number = decode_reg_name (asmspec);
if (reg_number == -2)
{
@@ -802,22 +793,24 @@ make_decl_rtl (tree decl, const char *asmspec)
char *starred = alloca (strlen (asmspec) + 2);
starred[0] = '*';
strcpy (starred + 1, asmspec);
- new_name = starred;
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred));
}
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+
if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
{
/* First detect errors in declaring global registers. */
if (reg_number == -1)
- error_with_decl (decl, "register name not specified for `%s'");
+ error ("%Jregister name not specified for '%D'", decl, decl);
else if (reg_number < 0)
- error_with_decl (decl, "invalid register name for `%s'");
+ error ("%Jinvalid register name for '%D'", decl, decl);
else if (TYPE_MODE (TREE_TYPE (decl)) == BLKmode)
- error_with_decl (decl,
- "data type of `%s' isn't suitable for a register");
+ error ("%Jdata type of '%D' isn't suitable for a register",
+ decl, decl);
else if (! HARD_REGNO_MODE_OK (reg_number, TYPE_MODE (TREE_TYPE (decl))))
- error_with_decl (decl,
- "register specified for `%s' isn't suitable for data type");
+ error ("%Jregister specified for '%D' isn't suitable for data type",
+ decl, decl);
/* Now handle properly declared static register variables. */
else
{
@@ -861,8 +854,7 @@ make_decl_rtl (tree decl, const char *asmspec)
Also handle vars declared register invalidly. */
if (reg_number >= 0 || reg_number == -3)
- error_with_decl (decl,
- "register name given for non-register variable `%s'");
+ error ("%Jregister name given for non-register variable '%D'", decl, decl);
/* Specifying a section attribute on a variable forces it into a
non-.bss section, and thus it cannot be common. */
@@ -876,28 +868,6 @@ make_decl_rtl (tree decl, const char *asmspec)
if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl))
DECL_COMMON (decl) = 0;
- /* Can't use just the variable's own name for a variable
- whose scope is less than the whole file, unless it's a member
- of a local class (which will already be unambiguous).
- Concatenate a distinguishing number. */
- if (!top_level && !TREE_PUBLIC (decl)
- && ! (DECL_CONTEXT (decl) && TYPE_P (DECL_CONTEXT (decl)))
- && asmspec == 0
- && name == IDENTIFIER_POINTER (DECL_NAME (decl)))
- {
- char *label;
-
- ASM_FORMAT_PRIVATE_NAME (label, name, var_labelno);
- var_labelno++;
- new_name = label;
- }
-
- if (name != new_name)
- {
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (new_name));
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- }
-
x = gen_rtx_SYMBOL_REF (Pmode, name);
SYMBOL_REF_WEAK (x) = DECL_WEAK (decl);
SYMBOL_REF_DECL (x) = decl;
@@ -1066,6 +1036,34 @@ default_ctor_section_asm_out_constructor (rtx symbol,
#define CONSTANT_POOL_BEFORE_FUNCTION 1
#endif
+/* DECL is an object (either VAR_DECL or FUNCTION_DECL) which is going
+ to be output to assembler.
+ Set first_global_object_name and weak_global_object_name as appropriate. */
+
+void
+notice_global_symbol (tree decl)
+{
+ if ((!first_global_object_name || !weak_global_object_name)
+ && TREE_PUBLIC (decl) && !DECL_COMMON (decl)
+ && (TREE_CODE (decl) == FUNCTION_DECL
+ || (TREE_CODE (decl) == VAR_DECL
+ && (DECL_INITIAL (decl) != 0
+ && DECL_INITIAL (decl) != error_mark_node))))
+ {
+ const char *p;
+ char *name;
+ rtx decl_rtl = DECL_RTL (decl);
+
+ p = (* targetm.strip_name_encoding) (XSTR (XEXP (decl_rtl, 0), 0));
+ name = xstrdup (p);
+
+ if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl))
+ first_global_object_name = name;
+ else
+ weak_global_object_name = name;
+ }
+}
+
/* Output assembler code for the constant pool of a function and associated
with defining the name of the function. DECL describes the function.
NAME is the function's name. For the constant pool, we use the current
@@ -1119,19 +1117,7 @@ assemble_start_function (tree decl, const char *fnname)
if (TREE_PUBLIC (decl))
{
- if (! first_global_object_name)
- {
- const char *p;
- char *name;
-
- p = (* targetm.strip_name_encoding) (fnname);
- name = xstrdup (p);
-
- if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl))
- first_global_object_name = name;
- else
- weak_global_object_name = name;
- }
+ notice_global_symbol (decl);
globalize_decl (decl);
@@ -1390,9 +1376,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (!dont_output_data && DECL_SIZE (decl) == 0)
{
- error ("%Hstorage size of `%s' isn't known",
- &DECL_SOURCE_LOCATION (decl),
- IDENTIFIER_POINTER (DECL_NAME (decl)));
+ error ("%Jstorage size of `%D' isn't known", decl, decl);
TREE_ASM_WRITTEN (decl) = 1;
return;
}
@@ -1420,25 +1404,13 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (! dont_output_data
&& ! host_integerp (DECL_SIZE_UNIT (decl), 1))
{
- error_with_decl (decl, "size of variable `%s' is too large");
+ error ("%Jsize of variable '%D' is too large", decl, decl);
return;
}
name = XSTR (XEXP (decl_rtl, 0), 0);
- if (TREE_PUBLIC (decl) && DECL_NAME (decl)
- && ! first_global_object_name
- && ! (DECL_COMMON (decl) && (DECL_INITIAL (decl) == 0
- || DECL_INITIAL (decl) == error_mark_node))
- && ! DECL_WEAK (decl)
- && ! DECL_ONE_ONLY (decl))
- {
- const char *p;
- char *xname;
-
- p = (* targetm.strip_name_encoding) (name);
- xname = xstrdup (p);
- first_global_object_name = xname;
- }
+ if (TREE_PUBLIC (decl) && DECL_NAME (decl))
+ notice_global_symbol (decl);
/* Compute the alignment of this data. */
@@ -1458,9 +1430,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
#endif
if (align > MAX_OFILE_ALIGNMENT)
{
- warning_with_decl (decl,
- "alignment of `%s' is greater than maximum object file alignment. Using %d",
- MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
+ warning ("%Jalignment of '%D' is greater than maximum object "
+ "file alignment. Using %d", decl, decl,
+ MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
align = MAX_OFILE_ALIGNMENT;
}
@@ -1526,8 +1498,8 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
#if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_DECL_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS)
if ((unsigned HOST_WIDE_INT) DECL_ALIGN (decl) / BITS_PER_UNIT > rounded)
- warning_with_decl
- (decl, "requested alignment for %s is greater than implemented alignment of %d",rounded);
+ warning ("%Jrequested alignment for '%D' is greater than "
+ "implemented alignment of %d", decl, decl, rounded);
#endif
/* If the target cannot output uninitialized but not common global data
@@ -1682,7 +1654,7 @@ mark_referenced (tree id)
{
node = cgraph_node_for_identifier (id);
if (node)
- cgraph_mark_needed_node (node, 1);
+ cgraph_mark_needed_node (node);
}
vnode = cgraph_varpool_node_for_identifier (id);
@@ -2157,7 +2129,7 @@ const_hash_1 (const tree exp)
char *tmp;
len = int_size_in_bytes (TREE_TYPE (exp));
- tmp = (char *) alloca (len);
+ tmp = alloca (len);
get_set_constructor_bytes (exp, (unsigned char *) tmp, len);
p = tmp;
break;
@@ -2287,8 +2259,8 @@ compare_constant (const tree t1, const tree t2)
if (int_size_in_bytes (TREE_TYPE (t1)) != len)
return 0;
- tmp1 = (unsigned char *) alloca (len);
- tmp2 = (unsigned char *) alloca (len);
+ tmp1 = alloca (len);
+ tmp2 = alloca (len);
if (get_set_constructor_bytes (t1, tmp1, len) != NULL_TREE)
return 0;
@@ -2571,6 +2543,7 @@ output_constant_def_contents (rtx symbol)
{
tree exp = SYMBOL_REF_DECL (symbol);
const char *label = XSTR (symbol, 0);
+ HOST_WIDE_INT size;
/* Make sure any other constants whose addresses appear in EXP
are assigned label numbers. */
@@ -2595,17 +2568,20 @@ output_constant_def_contents (rtx symbol)
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
}
- /* Output the label itself. */
+ size = int_size_in_bytes (TREE_TYPE (exp));
+ if (TREE_CODE (exp) == STRING_CST)
+ size = MAX (TREE_STRING_LENGTH (exp), size);
+
+ /* Do any machine/system dependent processing of the constant. */
+#ifdef ASM_DECLARE_CONSTANT_NAME
+ ASM_DECLARE_CONSTANT_NAME (asm_out_file, label, exp, size);
+#else
+ /* Standard thing is just output label for the constant. */
ASM_OUTPUT_LABEL (asm_out_file, label);
+#endif /* ASM_DECLARE_CONSTANT_NAME */
/* Output the value of EXP. */
- output_constant (exp,
- (TREE_CODE (exp) == STRING_CST
- ? MAX (TREE_STRING_LENGTH (exp),
- int_size_in_bytes (TREE_TYPE (exp)))
- : int_size_in_bytes (TREE_TYPE (exp))),
- align);
-
+ output_constant (exp, size, align);
}
/* A constant which was deferred in its original location has been
@@ -2616,6 +2592,21 @@ notice_rtl_inlining_of_deferred_constant (void)
{
n_deferred_constants++;
}
+
+/* Look up EXP in the table of constant descriptors. Return the rtl
+ if it has been emitted, else null. */
+
+rtx
+lookup_constant_def (tree exp)
+{
+ struct constant_descriptor_tree *desc;
+ struct constant_descriptor_tree key;
+
+ key.value = exp;
+ desc = htab_find (const_desc_htab, &key);
+
+ return (desc ? desc->rtl : NULL_RTX);
+}
/* Used in the hash tables to avoid outputting the same constant
twice. Unlike 'struct constant_descriptor_tree', RTX constants
@@ -2663,16 +2654,14 @@ void
init_varasm_status (struct function *f)
{
struct varasm_status *p;
- p = (struct varasm_status *) ggc_alloc (sizeof (struct varasm_status));
+ p = ggc_alloc (sizeof (struct varasm_status));
f->varasm = p;
p->x_const_rtx_hash_table
- = ((struct constant_descriptor_rtx **)
- ggc_alloc_cleared (MAX_RTX_HASH_TABLE
- * sizeof (struct constant_descriptor_rtx *)));
+ = ggc_alloc_cleared (MAX_RTX_HASH_TABLE
+ * sizeof (struct constant_descriptor_rtx *));
p->x_const_rtx_sym_hash_table
- = ((struct pool_constant **)
- ggc_alloc_cleared (MAX_RTX_HASH_TABLE
- * sizeof (struct pool_constant *)));
+ = ggc_alloc_cleared (MAX_RTX_HASH_TABLE
+ * sizeof (struct pool_constant *));
p->x_first_pool = p->x_last_pool = 0;
p->x_pool_offset = 0;
@@ -2925,7 +2914,7 @@ record_constant_rtx (enum machine_mode mode, rtx x)
{
struct constant_descriptor_rtx *ptr;
- ptr = (struct constant_descriptor_rtx *) ggc_alloc (sizeof (*ptr));
+ ptr = ggc_alloc (sizeof (*ptr));
decode_rtx_const (mode, x, &ptr->value);
return ptr;
@@ -2979,7 +2968,7 @@ force_const_mem (enum machine_mode mode, rtx x)
LABEL_PRESERVE_P (XEXP (x, 0)) = 1;
/* Allocate a pool constant descriptor, fill it in, and chain it in. */
- pool = (struct pool_constant *) ggc_alloc (sizeof (struct pool_constant));
+ pool = ggc_alloc (sizeof (struct pool_constant));
pool->desc = desc;
pool->constant = x;
pool->mode = mode;
@@ -3479,11 +3468,27 @@ initializer_constant_valid_p (tree value, tree endtype)
|| TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE)
&& TREE_CONSTANT (value)
&& CONSTRUCTOR_ELTS (value))
- return
- initializer_constant_valid_p (TREE_VALUE (CONSTRUCTOR_ELTS (value)),
- endtype);
+ {
+ tree elt;
+ bool absolute = true;
- return TREE_STATIC (value) ? null_pointer_node : 0;
+ for (elt = CONSTRUCTOR_ELTS (value); elt; elt = TREE_CHAIN (elt))
+ {
+ tree reloc;
+ value = TREE_VALUE (elt);
+ reloc = initializer_constant_valid_p (value, TREE_TYPE (value));
+ if (!reloc)
+ return NULL_TREE;
+ if (reloc != null_pointer_node)
+ absolute = false;
+ }
+ /* For a non-absolute relocation, there is no single
+ variable that can be "the variable that determines the
+ relocation." */
+ return absolute ? null_pointer_node : error_mark_node;
+ }
+
+ return TREE_STATIC (value) ? null_pointer_node : NULL_TREE;
case INTEGER_CST:
case VECTOR_CST:
@@ -3726,6 +3731,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
case ENUMERAL_TYPE:
case POINTER_TYPE:
case REFERENCE_TYPE:
+ case OFFSET_TYPE:
if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode,
EXPAND_INITIALIZER),
size, align, 0))
@@ -3796,7 +3802,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
thissize, align, 1);
else if (TREE_CODE (exp) == CONSTRUCTOR)
{
- unsigned char *buffer = (unsigned char *) alloca (thissize);
+ unsigned char *buffer = alloca (thissize);
if (get_set_constructor_bytes (exp, buffer, thissize))
abort ();
assemble_string ((char *) buffer, thissize);
@@ -4199,15 +4205,16 @@ merge_weak (tree newdecl, tree olddecl)
declare_weak because the NEWDECL and OLDDECL was not yet
been merged; therefore, TREE_ASM_WRITTEN was not set. */
if (TREE_ASM_WRITTEN (olddecl))
- error_with_decl (newdecl,
- "weak declaration of `%s' must precede definition");
+ error ("%Jweak declaration of '%D' must precede definition",
+ newdecl, newdecl);
/* If we've already generated rtl referencing OLDDECL, we may
have done so in a way that will not function properly with
a weak symbol. */
else if (TREE_USED (olddecl)
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl)))
- warning_with_decl (newdecl, "weak declaration of `%s' after first use results in unspecified behavior");
+ warning ("%Jweak declaration of '%D' after first use results "
+ "in unspecified behavior", newdecl, newdecl);
if (SUPPORTS_WEAK)
{
@@ -4240,16 +4247,16 @@ void
declare_weak (tree decl)
{
if (! TREE_PUBLIC (decl))
- error_with_decl (decl, "weak declaration of `%s' must be public");
+ error ("%Jweak declaration of '%D' must be public", decl, decl);
else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl))
- error_with_decl (decl, "weak declaration of `%s' must precede definition");
+ error ("%Jweak declaration of '%D' must precede definition", decl, decl);
else if (SUPPORTS_WEAK)
{
if (! DECL_WEAK (decl))
weak_decls = tree_cons (NULL, decl, weak_decls);
}
else
- warning_with_decl (decl, "weak declaration of `%s' not supported");
+ warning ("%Jweak declaration of '%D' not supported", decl, decl);
mark_weak (decl);
}
@@ -4673,30 +4680,6 @@ default_pe_asm_named_section (const char *name, unsigned int flags)
}
}
-/* Used for vtable gc in GNU binutils. Record that the pointer at OFFSET
- from SYMBOL is used in all classes derived from SYMBOL. */
-
-void
-assemble_vtable_entry (rtx symbol, HOST_WIDE_INT offset)
-{
- fputs ("\t.vtable_entry ", asm_out_file);
- output_addr_const (asm_out_file, symbol);
- fprintf (asm_out_file, ", " HOST_WIDE_INT_PRINT_DEC "\n", offset);
-}
-
-/* Used for vtable gc in GNU binutils. Record the class hierarchy by noting
- that the vtable symbol CHILD is derived from the vtable symbol PARENT. */
-
-void
-assemble_vtable_inherit (rtx child, rtx parent)
-{
- fputs ("\t.vtable_inherit ", asm_out_file);
- output_addr_const (asm_out_file, child);
- fputs (", ", asm_out_file);
- output_addr_const (asm_out_file, parent);
- fputc ('\n', asm_out_file);
-}
-
/* The lame default section selector. */
void
diff --git a/gcc/varray.c b/gcc/varray.c
index 9af706e2b7c..7901471bd79 100644
--- a/gcc/varray.c
+++ b/gcc/varray.c
@@ -68,9 +68,9 @@ varray_init (size_t num_elements, enum varray_data_enum element_kind,
size_t data_size = num_elements * element[element_kind].size;
varray_type ptr;
if (element[element_kind].uses_ggc)
- ptr = (varray_type) ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
+ ptr = ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
else
- ptr = (varray_type) xcalloc (VARRAY_HDR_SIZE + data_size, 1);
+ ptr = xcalloc (VARRAY_HDR_SIZE + data_size, 1);
ptr->num_elements = num_elements;
ptr->elements_used = 0;
@@ -93,9 +93,9 @@ varray_grow (varray_type va, size_t n)
size_t data_size = n * elem_size;
if (element[va->type].uses_ggc)
- va = (varray_type) ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
+ va = ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
else
- va = (varray_type) xrealloc ((char *) va, VARRAY_HDR_SIZE + data_size);
+ va = xrealloc (va, VARRAY_HDR_SIZE + data_size);
va->num_elements = n;
if (n > old_elements)
memset (&va->data.c[old_data_size], 0, data_size - old_data_size);
diff --git a/gcc/varray.h b/gcc/varray.h
index ef5c6eef032..7cb9ff09855 100644
--- a/gcc/varray.h
+++ b/gcc/varray.h
@@ -50,7 +50,7 @@ struct const_equiv_data GTY(()) {
pseudos that contain pointers into the replacement area allocated for
this inline instance. These pseudos are then marked as being equivalent
to the appropriate address and substituted if valid. */
- struct rtx_def *rtx;
+ rtx rtx;
/* Record the valid age for each entry. The entry is invalid if its
age is less than const_age. */
@@ -110,11 +110,11 @@ typedef union varray_data_tag GTY (()) {
tag ("VARRAY_DATA_GENERIC"))) generic[1];
char *GTY ((length ("%0.num_elements"),
tag ("VARRAY_DATA_CPTR"))) cptr[1];
- struct rtx_def *GTY ((length ("%0.num_elements"),
+ rtx GTY ((length ("%0.num_elements"),
tag ("VARRAY_DATA_RTX"))) rtx[1];
- struct rtvec_def *GTY ((length ("%0.num_elements"),
+ rtvec GTY ((length ("%0.num_elements"),
tag ("VARRAY_DATA_RTVEC"))) rtvec[1];
- union tree_node *GTY ((length ("%0.num_elements"),
+ tree GTY ((length ("%0.num_elements"),
tag ("VARRAY_DATA_TREE"))) tree[1];
struct bitmap_head_def *GTY ((length ("%0.num_elements"),
tag ("VARRAY_DATA_BITMAP"))) bitmap[1];
diff --git a/gcc/version.c b/gcc/version.c
index 634dcde2529..f64f5615480 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -1,4 +1,3 @@
-#include "ansidecl.h"
#include "version.h"
/* This is the string reported as the version number by all components
@@ -6,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 20030709 (experimental)";
+const char version_string[] = "3.4 20030922 (experimental)";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index ac148c2ce99..4f7f62d2e97 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -1362,8 +1362,8 @@ vmsdbgout_begin_function (tree decl)
if (func_table_in_use == func_table_allocated)
{
func_table_allocated += FUNC_TABLE_INCREMENT;
- func_table = (char **) xrealloc (func_table,
- func_table_allocated * sizeof (char *));
+ func_table = xrealloc (func_table,
+ func_table_allocated * sizeof (char *));
}
/* Add the new entry to the end of the function name table. */
@@ -1481,10 +1481,9 @@ lookup_filename (const char *file_name)
{
file_info_table_allocated += FILE_TABLE_INCREMENT;
- file_info_table
- = (dst_file_info_ref) xrealloc (file_info_table,
- (file_info_table_allocated
- * sizeof (dst_file_info_entry)));
+ file_info_table = xrealloc (file_info_table,
+ (file_info_table_allocated
+ * sizeof (dst_file_info_entry)));
}
/* Add the new entry to the end of the filename table. */
@@ -1521,10 +1520,9 @@ vmsdbgout_source_line (register unsigned line, register const char *filename)
if (line_info_table_in_use == line_info_table_allocated)
{
line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
- line_info_table
- = (dst_line_info_ref) xrealloc (line_info_table,
- (line_info_table_allocated
- * sizeof (dst_line_info_entry)));
+ line_info_table = xrealloc (line_info_table,
+ (line_info_table_allocated
+ * sizeof (dst_line_info_entry)));
}
/* Add the new entry at the end of the line_info_table. */
@@ -1574,21 +1572,19 @@ vmsdbgout_init (const char *main_input_filename)
/* Allocate the initial hunk of the file_info_table. */
file_info_table
- = (dst_file_info_ref) xcalloc (FILE_TABLE_INCREMENT,
- sizeof (dst_file_info_entry));
+ = xcalloc (FILE_TABLE_INCREMENT, sizeof (dst_file_info_entry));
file_info_table_allocated = FILE_TABLE_INCREMENT;
/* Skip the first entry - file numbers begin at 1 */
file_info_table_in_use = 1;
- func_table = (char **) xcalloc (FUNC_TABLE_INCREMENT, sizeof (char *));
+ func_table = xcalloc (FUNC_TABLE_INCREMENT, sizeof (char *));
func_table_allocated = FUNC_TABLE_INCREMENT;
func_table_in_use = 1;
/* Allocate the initial hunk of the line_info_table. */
line_info_table
- = (dst_line_info_ref) xcalloc (LINE_INFO_TABLE_INCREMENT,
- sizeof (dst_line_info_entry));
+ = xcalloc (LINE_INFO_TABLE_INCREMENT, sizeof (dst_line_info_entry));
line_info_table_allocated = LINE_INFO_TABLE_INCREMENT;
/* zero-th entry is allocated, but unused */
line_info_table_in_use = 1;
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index ee6e3ada34e..7c03ca5b096 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -400,7 +400,7 @@ xcoffout_declare_function (FILE *file, tree decl, const char *name)
{
if (name[i] == '[')
{
- char *n = (char *) alloca (i + 1);
+ char *n = alloca (i + 1);
strncpy (n, name, i);
n[i] = '\0';
name = n;
diff --git a/include/ChangeLog b/include/ChangeLog
index 49fb64dd635..db25adc849b 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,24 @@
+2003-09-22 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.h (struct floatformat): Add field "is_valid".
+
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.h (floatformat_to_double): Make input buffer constant.
+ (floatformat_from_double, floatformat_is_valid): Ditto.
+
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.h (struct floatformat): Make "exp_bias" signed.
+
+2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * floatformat.h (floatformat_is_valid): Add prototype.
+
+2003-07-09 Bob Wilson <bob.wilson@acm.org>
+
+ * xtensa-config.h: Undef all macros before defining them.
+
2003-07-06 H.J. Lu <hongjiu.lu@intel.com>
* demangle.h: Support C++.
diff --git a/include/floatformat.h b/include/floatformat.h
index 53ead3eee61..a8244ada5c7 100644
--- a/include/floatformat.h
+++ b/include/floatformat.h
@@ -1,5 +1,5 @@
/* IEEE floating point support declarations, for GDB, the GNU Debugger.
- Copyright 1991, 1994, 1995, 1997, 2000 Free Software Foundation, Inc.
+ Copyright 1991, 1994, 1995, 1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -61,8 +61,12 @@ struct floatformat
unsigned int exp_start;
unsigned int exp_len;
- /* Amount added to "true" exponent. 0x3fff for many IEEE extendeds. */
- unsigned int exp_bias;
+ /* Bias added to a "true" exponent to form the biased exponent. It
+ is intentionally signed as, otherwize, -exp_bias can turn into a
+ very large number (e.g., given the exp_bias of 0x3fff and a 64
+ bit long, the equation (long)(1 - exp_bias) evaluates to
+ 4294950914) instead of -16382). */
+ int exp_bias;
/* Exponent value which indicates NaN. This is the actual value stored in
the float, not adjusted by the exp_bias. This usually consists of all
one bits. */
@@ -76,6 +80,9 @@ struct floatformat
/* Internal name for debugging. */
const char *name;
+
+ /* Validator method. */
+ int (*is_valid) PARAMS ((const struct floatformat *fmt, const char *from));
};
/* floatformats for IEEE single and double, big and little endian. */
@@ -109,13 +116,18 @@ extern const struct floatformat floatformat_ia64_quad_little;
Store the double in *TO. */
extern void
-floatformat_to_double PARAMS ((const struct floatformat *, char *, double *));
+floatformat_to_double PARAMS ((const struct floatformat *, const char *, double *));
/* The converse: convert the double *FROM to FMT
and store where TO points. */
extern void
floatformat_from_double PARAMS ((const struct floatformat *,
- double *, char *));
+ const double *, char *));
+
+/* Return non-zero iff the data at FROM is a valid number in format FMT. */
+
+extern int
+floatformat_is_valid PARAMS ((const struct floatformat *fmt, const char *from));
#endif /* defined (FLOATFORMAT_H) */
diff --git a/include/xtensa-config.h b/include/xtensa-config.h
index f643489acee..4191c368575 100644
--- a/include/xtensa-config.h
+++ b/include/xtensa-config.h
@@ -24,45 +24,116 @@
Xtensa System Software Reference Manual for documentation of these
macros. */
+#undef XCHAL_HAVE_BE
#define XCHAL_HAVE_BE 1
+
+#undef XCHAL_HAVE_DENSITY
#define XCHAL_HAVE_DENSITY 1
+
+#undef XCHAL_HAVE_CONST16
#define XCHAL_HAVE_CONST16 0
+
+#undef XCHAL_HAVE_ABS
#define XCHAL_HAVE_ABS 1
+
+#undef XCHAL_HAVE_ADDX
#define XCHAL_HAVE_ADDX 1
+
+#undef XCHAL_HAVE_L32R
#define XCHAL_HAVE_L32R 1
+
+#undef XCHAL_HAVE_MAC16
#define XCHAL_HAVE_MAC16 0
+
+#undef XCHAL_HAVE_MUL16
#define XCHAL_HAVE_MUL16 0
+
+#undef XCHAL_HAVE_MUL32
#define XCHAL_HAVE_MUL32 0
+
+#undef XCHAL_HAVE_DIV32
#define XCHAL_HAVE_DIV32 0
+
+#undef XCHAL_HAVE_NSA
#define XCHAL_HAVE_NSA 1
+
+#undef XCHAL_HAVE_MINMAX
#define XCHAL_HAVE_MINMAX 0
+
+#undef XCHAL_HAVE_SEXT
#define XCHAL_HAVE_SEXT 0
+
+#undef XCHAL_HAVE_LOOPS
#define XCHAL_HAVE_LOOPS 1
+
+#undef XCHAL_HAVE_BOOLEANS
#define XCHAL_HAVE_BOOLEANS 0
+
+#undef XCHAL_HAVE_FP
#define XCHAL_HAVE_FP 0
+
+#undef XCHAL_HAVE_FP_DIV
#define XCHAL_HAVE_FP_DIV 0
+
+#undef XCHAL_HAVE_FP_RECIP
#define XCHAL_HAVE_FP_RECIP 0
+
+#undef XCHAL_HAVE_FP_SQRT
#define XCHAL_HAVE_FP_SQRT 0
+
+#undef XCHAL_HAVE_FP_RSQRT
#define XCHAL_HAVE_FP_RSQRT 0
+
+#undef XCHAL_HAVE_WINDOWED
#define XCHAL_HAVE_WINDOWED 1
+
+#undef XCHAL_ICACHE_SIZE
#define XCHAL_ICACHE_SIZE 8192
+
+#undef XCHAL_DCACHE_SIZE
#define XCHAL_DCACHE_SIZE 8192
+
+#undef XCHAL_ICACHE_LINESIZE
#define XCHAL_ICACHE_LINESIZE 16
+
+#undef XCHAL_DCACHE_LINESIZE
#define XCHAL_DCACHE_LINESIZE 16
+
+#undef XCHAL_ICACHE_LINEWIDTH
#define XCHAL_ICACHE_LINEWIDTH 4
+
+#undef XCHAL_DCACHE_LINEWIDTH
#define XCHAL_DCACHE_LINEWIDTH 4
+
+#undef XCHAL_DCACHE_IS_WRITEBACK
#define XCHAL_DCACHE_IS_WRITEBACK 0
+
+#undef XCHAL_HAVE_MMU
#define XCHAL_HAVE_MMU 1
+
+#undef XCHAL_MMU_MIN_PTE_PAGE_SIZE
#define XCHAL_MMU_MIN_PTE_PAGE_SIZE 12
+
+#undef XCHAL_HAVE_DEBUG
#define XCHAL_HAVE_DEBUG 1
+
+#undef XCHAL_NUM_IBREAK
#define XCHAL_NUM_IBREAK 2
+
+#undef XCHAL_NUM_DBREAK
#define XCHAL_NUM_DBREAK 2
+
+#undef XCHAL_DEBUGLEVEL
#define XCHAL_DEBUGLEVEL 4
-#define XCHAL_EXTRA_SA_SIZE 0
-#define XCHAL_EXTRA_SA_ALIGN 1
+
+#undef XCHAL_EXTRA_SA_SIZE
+#define XCHAL_EXTRA_SA_SIZE 0
+
+#undef XCHAL_EXTRA_SA_ALIGN
+#define XCHAL_EXTRA_SA_ALIGN 1
#endif /* !XTENSA_CONFIG_H */
diff --git a/install-sh b/install-sh
index 59bcde425aa..0ec27bcd488 100755
--- a/install-sh
+++ b/install-sh
@@ -1,19 +1,37 @@
#!/bin/sh
#
# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
#
-# Copyright 1991 by the Massachusetts Institute of Technology
+# 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.
#
-# 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, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
+# 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
@@ -56,7 +74,7 @@ dir_arg=""
while [ x"$1" != x ]; do
case $1 in
- -c) instcmd="$cpprog"
+ -c) instcmd=$cpprog
shift
continue;;
@@ -79,7 +97,7 @@ while [ x"$1" != x ]; do
shift
continue;;
- -s) stripcmd="$stripprog"
+ -s) stripcmd=$stripprog
shift
continue;;
@@ -106,128 +124,132 @@ done
if [ x"$src" = x ]
then
- echo "install: no input file specified"
+ echo "$0: no input file specified" >&2
exit 1
else
- true
+ :
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
-
- if [ -d $dst ]; then
+
+ if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
- instcmd=mkdir
+ 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
+# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
- if [ -f $src -o -d $src ]
+ if [ -f "$src" ] || [ -d "$src" ]
then
- true
+ :
else
- echo "install: $src does not exist"
+ echo "$0: $src does not exist" >&2
exit 1
fi
-
+
if [ x"$dst" = x ]
then
- echo "install: no destination specified"
+ echo "$0: no destination specified" >&2
exit 1
else
- true
+ :
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 ]
+ if [ -d "$dst" ]
then
- dst="$dst"/`basename $src`
+ dst=$dst/`basename "$src"`
else
- true
+ :
fi
fi
## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+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}}"
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
-oIFS="${IFS}"
+oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
+ pathcomp=$pathcomp$1
shift
- if [ ! -d "${pathcomp}" ] ;
+ if [ ! -d "$pathcomp" ] ;
then
- $mkdirprog "${pathcomp}"
+ $mkdirprog "$pathcomp"
else
- true
+ :
fi
- pathcomp="${pathcomp}/"
+ pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
- $doit $instcmd $dst &&
+ $doit $instcmd "$dst" &&
- 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
+ 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 ]
+ if [ x"$transformarg" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- dstfile=`basename $dst $transformbasename |
+ dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
- if [ x"$dstfile" = x ]
+ if [ x"$dstfile" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- true
+ :
fi
-# Make a temp file name in the proper directory.
+# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
+ dsttmp=$dstdir/#inst.$$#
+ rmtmp=$dstdir/#rm.$$#
-# Move or copy the file name to the temp name
+# Trap to clean up temp files at exit.
- $doit $instcmd $src $dsttmp &&
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
- trap "rm -f ${dsttmp}" 0 &&
+# 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
@@ -235,17 +257,38 @@ 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 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 &&
+ 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 $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
+# The final little trick to "correctly" pass the exit status to the exit trap.
-exit 0
+{
+ (exit 0); exit
+}
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog
index 17b58403cd2..78fc92cadd2 100644
--- a/libf2c/ChangeLog
+++ b/libf2c/ChangeLog
@@ -1,3 +1,14 @@
+2003-09-21 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR libf2c/11918
+ * fstat_.c: Call f_init().
+ * isatty_.c: Ditto.
+ * fnum_.c: Check file descriptor before handing it back.
+
+Tue Sep 9 15:22:57 2003 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
2003-07-04 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in: Replace PWD with PWD_COMMAND.
diff --git a/libf2c/configure b/libf2c/configure
index 8faafe614b7..d779679380e 100755
--- a/libf2c/configure
+++ b/libf2c/configure
@@ -2054,7 +2054,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
diff --git a/libf2c/libU77/fnum_.c b/libf2c/libU77/fnum_.c
index daf8f3dc080..27cadec287a 100644
--- a/libf2c/libU77/fnum_.c
+++ b/libf2c/libU77/fnum_.c
@@ -27,6 +27,10 @@ G77_fnum_0 (integer * lunit)
{
if (*lunit >= MXUNIT || *lunit < 0)
err (1, 101, "fnum");
+
+ if (f__units[*lunit].ufd == NULL)
+ err (1, 114, "fnum");
+
/* f__units is a table of descriptions for the unit numbers (defined
in io.h). Use file descriptor (ufd) and fileno rather than udev
field since udev is unix specific */
diff --git a/libf2c/libU77/fstat_.c b/libf2c/libU77/fstat_.c
index e978c6adb2e..7fd439c2a40 100644
--- a/libf2c/libU77/fstat_.c
+++ b/libf2c/libU77/fstat_.c
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#endif
#include "f2c.h"
+#include "fio.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -34,6 +35,7 @@ G77_fstat_0 (const integer * lunit, integer statb[13])
int err;
struct stat buf;
+ if (f__init != 1) f_init();
err = fstat (G77_fnum_0 (lunit), &buf);
statb[0] = buf.st_dev;
statb[1] = buf.st_ino;
diff --git a/libf2c/libU77/isatty_.c b/libf2c/libU77/isatty_.c
index fa2f56dafab..a781f757bc5 100644
--- a/libf2c/libU77/isatty_.c
+++ b/libf2c/libU77/isatty_.c
@@ -30,6 +30,7 @@ extern integer G77_fnum_0 (integer *);
logical
G77_isatty_0 (integer * lunit)
{
+ if (f__init != 1) f_init();
if (*lunit >= MXUNIT || *lunit < 0)
err (1, 101, "isatty");
/* f__units is a table of descriptions for the unit numbers (defined
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index e3b57b04642..d505dcc6b92 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,209 @@
+2003-09-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm,
+ strongarm, xscale. Cleanup whitespaces.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.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_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.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/problem1.c: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Likewise.
+ * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces.
+
+2003-09-18 David Edelsohn <edelsohn@gnu.org>
+
+ * src/powerpc/aix.S: Cleanup whitespaces.
+ * src/powerpc/aix_closure.S: Likewise.
+
+2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting.
+ * src/powerpc/darwin_closure.S: Likewise.
+ * src/powerpc/ffi_darwin.c: Likewise.
+
+2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
+ * src/powerpc/aix_closure.S: Remove the pointer to the outgoing
+ parameter stack.
+ * src/powerpc/darwin_closure.S: Likewise.
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
+ according to the Darwin/AIX ABI.
+ (ffi_prep_cif_machdep): Likewise.
+ (ffi_closure_helper_DARWIN): Likewise.
+ Remove the outgoing parameter stack logic. Simplify the evaluation
+ of the different CASE types.
+ (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
+ statement in the trampoline code.
+
+2003-09-18 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (ffi_prep_args): Take account into the alignement
+ for the register size.
+ (ffi_closure_helper_SYSV): Handle the structure return value
+ address correctly.
+ (ffi_closure_helper_SYSV): Return the appropriate type when
+ the registers are used for the structure return value.
+ * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
+ the 64-bit return value. Update copyright years.
+
+2003-09-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in
+ srcdir for ffi_mips.h.
+
+2003-09-12 Alan Modra <amodra@bigpond.net.au>
+
+ * src/prep_cif.c (initialize_aggregate): Include tail padding in
+ structure size.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct
+ placement of float result.
+ * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct
+ cast of "resp" for big-endian 64 bit machines.
+
+2003-09-11 Alan Modra <amodra@bigpond.net.au>
+
+ * src/types.c (double, longdouble): Merge identical SH and ARM
+ typedefs, and add POWERPC64.
+ * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for
+ struct split over gpr and rest.
+ (ffi_prep_cif_machdep): Correct intarg_count for structures.
+ * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets.
+
+2003-09-09 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct
+ passing correctly.
+
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.am: Remove build rules for ffitest.
+ * Makefile.in: Rebuilt.
+
+2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/java_raw_api.c: Include <stdlib.h> to fix compiler warning
+ about implicit declaration of abort().
+
+2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.am: Add dejagnu test framework. Fixes PR other/11411.
+ * Makefile.in: Rebuilt.
+ * configure.in: Add dejagnu test framework.
+ * configure: Rebuilt.
+
+ * testsuite/Makefile.am: New file.
+ * testsuite/Makefile.in: Built
+ * testsuite/lib/libffi-dg.exp: New file.
+ * testsuite/config/default.exp: Likewise.
+ * testsuite/libffi.call/call.exp: Likewise.
+ * testsuite/libffi.call/ffitest.h: Likewise.
+ * testsuite/libffi.call/closure_fn0.c: Likewise.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.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_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.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/float.c: Likewise.
+ * testsuite/libffi.call/float1.c: Likewise.
+ * testsuite/libffi.call/float2.c: Likewise.
+ * testsuite/libffi.call/many.c: Likewise.
+ * testsuite/libffi.call/many_win32.c: Likewise.
+ * testsuite/libffi.call/nested_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct1.c: Likewise.
+ * testsuite/libffi.call/pyobjc-tc.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+ * testsuite/libffi.call/promotion.c: Likewise.
+ * testsuite/libffi.call/return_ll.c: Likewise.
+ * testsuite/libffi.call/return_sc.c: Likewise.
+ * testsuite/libffi.call/return_uc.c: Likewise.
+ * testsuite/libffi.call/strlen.c: Likewise.
+ * testsuite/libffi.call/strlen_win32.c: Likewise.
+ * testsuite/libffi.call/struct1.c: Likewise.
+ * testsuite/libffi.call/struct2.c: Likewise.
+ * testsuite/libffi.call/struct3.c: Likewise.
+ * testsuite/libffi.call/struct4.c: Likewise.
+ * testsuite/libffi.call/struct5.c: Likewise.
+ * testsuite/libffi.call/struct6.c: Likewise.
+ * testsuite/libffi.call/struct7.c: Likewise.
+ * testsuite/libffi.call/struct8.c: Likewise.
+ * testsuite/libffi.call/struct9.c: Likewise.
+ * testsuite/libffi.special/special.exp: New file.
+ * testsuite/libffi.special/ffitestcxx.h: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Likewise.
+
+
+2003-08-13 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update
+ copyright years.
+
+2003-08-02 Alan Modra <amodra@bigpond.net.au>
+
+ * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc
+ structure passing.
+ (ffi_closure_helper_LINUX64): Likewise.
+ * src/powerpc/linux64.S: Remove code writing to parm save area.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return
+ address in lr from ffi_closure_helper_LINUX64 call to calculate
+ table address. Optimize function tail.
+
+2003-07-28 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/sparc/ffi.c: Handle all floating point registers.
+ * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410.
+
+2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README: Note that libffi is not part of GCC. Update the project
+ URL and status.
+
2003-06-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* src/powerpc/ppc_closure.S: Include ffi.h.
diff --git a/libffi/Makefile.am b/libffi/Makefile.am
index d015026f2f9..cb05ea6d1a4 100644
--- a/libffi/Makefile.am
+++ b/libffi/Makefile.am
@@ -2,7 +2,8 @@
AUTOMAKE_OPTIONS = cygnus
-SUBDIRS = include
+SUBDIRS = include testsuite
+
EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \
src/mips/n32.s src/mips/o32.S src/mips/o32.s \
@@ -52,6 +53,7 @@ AM_MAKEFLAGS = \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"SHELL=$(SHELL)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
@@ -81,11 +83,7 @@ MULTICLEAN = true
toolexeclib_LTLIBRARIES = libffi.la
noinst_LTLIBRARIES = libffi_convenience.la
-noinst_PROGRAMS = ffitest
-ffitest_OBJECTS = ffitest.lo
-ffitest_LDADD = libffi.la
-ffitest_LDFLAGS = -shared-libgcc
TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
@@ -178,7 +176,7 @@ libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH64)
libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH64)
endif
-AM_CFLAGS = -fexceptions
+AM_CFLAGS = -Wall -g -fexceptions
libffi_la_LDFLAGS = -release $(VERSION)
@@ -231,3 +229,7 @@ maintainer-clean-multi:
## ################################################################
+CLEANFILES = $(libffi_convenience_la_OBJECTS) \
+ $(libffi_la_OBJECTS) \
+ $(libffi_convenience_la_OBJECTS:.lo=.o) \
+ $(libffi_la_OBJECTS:.lo=.o)
diff --git a/libffi/Makefile.in b/libffi/Makefile.in
index 4e4e4616bcf..5ea0853501b 100644
--- a/libffi/Makefile.in
+++ b/libffi/Makefile.in
@@ -56,8 +56,13 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
AS = @AS@
CC = @CC@
CXX = @CXX@
@@ -85,7 +90,7 @@ toolexeclibdir = @toolexeclibdir@
AUTOMAKE_OPTIONS = cygnus
-SUBDIRS = include
+SUBDIRS = include testsuite
EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \
src/mips/n32.s src/mips/o32.S src/mips/o32.s \
@@ -130,6 +135,7 @@ AM_MAKEFLAGS = \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"SHELL=$(SHELL)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
@@ -160,12 +166,6 @@ MULTICLEAN = true
toolexeclib_LTLIBRARIES = libffi.la
noinst_LTLIBRARIES = libffi_convenience.la
-noinst_PROGRAMS = ffitest
-
-ffitest_OBJECTS = ffitest.lo
-ffitest_LDADD = libffi.la
-ffitest_LDFLAGS = -shared-libgcc
-
TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
@@ -222,13 +222,19 @@ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
@SH_TRUE@libffi_convenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
@SH64_TRUE@libffi_convenience_la_SOURCES = @SH64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH64)
-AM_CFLAGS = -fexceptions
+AM_CFLAGS = -Wall -g -fexceptions
libffi_la_LDFLAGS = -release $(VERSION)
INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
+
+CLEANFILES = $(libffi_convenience_la_OBJECTS) \
+ $(libffi_la_OBJECTS) \
+ $(libffi_convenience_la_OBJECTS:.lo=.o) \
+ $(libffi_la_OBJECTS:.lo=.o)
+
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs
+mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs
CONFIG_HEADER = fficonfig.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
@@ -240,36 +246,10 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libffi_convenience_la_LDFLAGS =
libffi_convenience_la_LIBADD =
-@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
@MIPS_GCC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
@MIPS_GCC_TRUE@src/mips/n32.lo
-@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
-@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
-@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_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
@X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@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 \
@@ -277,90 +257,112 @@ libffi_convenience_la_LIBADD =
@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
-@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_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
-@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
-@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
-@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
-@MIPS_SGI_TRUE@src/mips/n32.lo
+@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
@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
+@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
+@MIPS_SGI_TRUE@src/mips/n32.lo
+@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
+@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
+@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
+@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
+@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
@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_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
+@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
+@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
libffi_la_LIBADD =
+@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
+@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
-@SH64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
-@SH64_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh64/sysv.lo \
-@SH64_TRUE@src/sh64/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
+@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
+@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
+@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
+@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
@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
+@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
+@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
+@ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
+@ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \
+@ARM_TRUE@src/arm/ffi.lo
@POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
@POWERPC_TRUE@src/powerpc/ppc_closure.lo 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
@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_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
-@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
-@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
-@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
-@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
-@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
-@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
-@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
@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_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
-@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
-@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
-noinst_PROGRAMS = ffitest$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-
-ffitest_DEPENDENCIES = libffi.la
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)
@@ -373,7 +375,7 @@ fficonfig.h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = gnutar
GZIP_ENV = --best
SOURCES = $(libffi_convenience_la_SOURCES) $(libffi_la_SOURCES)
OBJECTS = $(libffi_convenience_la_OBJECTS) $(libffi_la_OBJECTS)
@@ -490,19 +492,6 @@ libffi_convenience.la: $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_
libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES)
$(LINK) -rpath $(toolexeclibdir) $(libffi_la_LDFLAGS) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS)
-mostlyclean-noinstPROGRAMS:
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-distclean-noinstPROGRAMS:
-
-maintainer-clean-noinstPROGRAMS:
-
-ffitest$(EXEEXT): $(ffitest_OBJECTS) $(ffitest_DEPENDENCIES)
- @rm -f ffitest$(EXEEXT)
- $(LINK) $(ffitest_LDFLAGS) $(ffitest_OBJECTS) $(ffitest_LDADD) $(LIBS)
-
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
@@ -633,7 +622,7 @@ distdir: $(DISTFILES)
$(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \
$(distdir)/src/m68k $(distdir)/src/mips \
$(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \
- $(distdir)/src/sparc $(distdir)/src/x86
+ $(distdir)/src/sh64 $(distdir)/src/sparc $(distdir)/src/x86
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
@@ -678,7 +667,7 @@ install-am: all-am
install: install-recursive
uninstall-am: uninstall-toolexeclibLTLIBRARIES
uninstall: uninstall-recursive
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) fficonfig.h
+all-am: Makefile $(LTLIBRARIES) fficonfig.h
all-redirect: all-recursive-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
@@ -690,6 +679,7 @@ installdirs-am:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
@@ -698,22 +688,21 @@ distclean-generic:
maintainer-clean-generic:
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLTLIBRARIES \
mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
- mostlyclean-libtool mostlyclean-noinstPROGRAMS \
- mostlyclean-tags mostlyclean-generic
+ mostlyclean-libtool mostlyclean-tags \
+ mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-hdr clean-noinstLTLIBRARIES \
clean-toolexeclibLTLIBRARIES clean-compile \
- clean-libtool clean-noinstPROGRAMS clean-tags \
- clean-generic mostlyclean-am
+ clean-libtool clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-hdr distclean-noinstLTLIBRARIES \
distclean-toolexeclibLTLIBRARIES distclean-compile \
- distclean-libtool distclean-noinstPROGRAMS \
- distclean-tags distclean-generic clean-am
+ distclean-libtool distclean-tags distclean-generic \
+ clean-am
-rm -f libtool
distclean: distclean-recursive
@@ -723,8 +712,8 @@ maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean-noinstLTLIBRARIES \
maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
- maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
- maintainer-clean-generic distclean-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."
@@ -739,9 +728,7 @@ clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool mostlyclean-noinstPROGRAMS \
-distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS install-data-recursive \
+clean-libtool maintainer-clean-libtool install-data-recursive \
uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
diff --git a/libffi/README b/libffi/README
index a00f23daf3a..21a7735bf74 100644
--- a/libffi/README
+++ b/libffi/README
@@ -1,9 +1,13 @@
-README for libffi-2.00
+This directory contains the libffi package, which is not part of GCC but
+shipped with GCC as convenience.
+
+Status
+======
libffi-2.00 has not been released yet! This is a development snapshot!
-libffi-1.20 was released on [SOME FUTURE DAY]. Check the libffi web
-page for updates: <URL:http://sourceware.cygnus.com/libffi/>.
+libffi-1.20 was released on October 5, 1998. Check the libffi web
+page for updates: <URL:http://sources.redhat.com/libffi/>.
What is libffi?
diff --git a/libffi/configure b/libffi/configure
index 8689a37be29..b22ac700092 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -662,13 +662,34 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:672: checking host system type" >&5
+echo "configure:693: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -688,6 +709,48 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:714: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:732: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+target_alias=${target_alias-$host_alias}
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
@@ -758,28 +821,10 @@ else
enable_fast_install=yes
fi
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:763: 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
-
# 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:783: checking for $ac_word" >&5
+echo "configure:828: 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
@@ -809,7 +854,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:813: checking for $ac_word" >&5
+echo "configure:858: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -860,7 +905,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:864: checking for $ac_word" >&5
+echo "configure:909: 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
@@ -892,7 +937,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:896: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:941: 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.
@@ -903,12 +948,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 907 "configure"
+#line 952 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:957: \"$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
@@ -934,12 +979,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:938: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:983: 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:943: checking whether we are using GNU C" >&5
+echo "configure:988: 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
@@ -948,7 +993,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:952: \"$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:997: \"$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
@@ -967,7 +1012,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:971: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1016: 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
@@ -1010,7 +1055,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:1014: checking for ld used by GCC" >&5
+echo "configure:1059: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1040,10 +1085,10 @@ echo "configure:1014: 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:1044: checking for GNU ld" >&5
+echo "configure:1089: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1047: checking for non-GNU ld" >&5
+echo "configure:1092: 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
@@ -1078,7 +1123,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:1082: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1127: 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
@@ -1095,7 +1140,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:1099: checking for $LD option to reload object files" >&5
+echo "configure:1144: 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
@@ -1107,7 +1152,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:1111: checking for BSD-compatible nm" >&5
+echo "configure:1156: 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
@@ -1145,7 +1190,7 @@ NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1149: checking whether ln -s works" >&5
+echo "configure:1194: 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
@@ -1166,7 +1211,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1170: checking how to recognise dependant libraries" >&5
+echo "configure:1215: 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
@@ -1339,13 +1384,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:1343: checking for object suffix" >&5
+echo "configure:1388: 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:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1365,7 +1410,7 @@ ac_objext=$ac_cv_objext
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1369: checking for executable suffix" >&5
+echo "configure:1414: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1375,7 +1420,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1408,7 +1453,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:1412: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1457: 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
@@ -1470,7 +1515,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:1474: checking for file" >&5
+echo "configure:1519: 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
@@ -1541,7 +1586,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:1545: checking for $ac_word" >&5
+echo "configure:1590: 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
@@ -1573,7 +1618,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:1577: checking for $ac_word" >&5
+echo "configure:1622: 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
@@ -1608,7 +1653,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:1612: checking for $ac_word" >&5
+echo "configure:1657: 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
@@ -1640,7 +1685,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:1644: checking for $ac_word" >&5
+echo "configure:1689: 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
@@ -1707,8 +1752,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 1711 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 1756 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1757: \"$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*)
@@ -1741,7 +1786,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:1790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -1757,14 +1802,14 @@ 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:1761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:1806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -1801,7 +1846,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:1805: checking whether the C compiler needs -belf" >&5
+echo "configure:1850: 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
@@ -1814,14 +1859,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 1818 "configure"
+#line 1863 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1870: \"$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
@@ -1949,7 +1994,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:1953: checking for a BSD compatible install" >&5
+echo "configure:1998: 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
@@ -2002,7 +2047,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:2006: checking whether build environment is sane" >&5
+echo "configure:2051: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -2059,7 +2104,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:2063: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2108: 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
@@ -2098,7 +2143,7 @@ fi
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:2102: checking for working aclocal" >&5
+echo "configure:2147: 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.
@@ -2111,7 +2156,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:2115: checking for working autoconf" >&5
+echo "configure:2160: 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.
@@ -2124,7 +2169,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:2128: checking for working automake" >&5
+echo "configure:2173: 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.
@@ -2137,7 +2182,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:2141: checking for working autoheader" >&5
+echo "configure:2186: 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.
@@ -2150,7 +2195,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:2154: checking for working makeinfo" >&5
+echo "configure:2199: 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.
@@ -2167,7 +2212,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2171: checking for executable suffix" >&5
+echo "configure:2216: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2177,7 +2222,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -2198,7 +2243,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:2202: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2247: 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"
@@ -2224,7 +2269,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:2228: checking for $ac_word" >&5
+echo "configure:2273: 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
@@ -2254,7 +2299,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:2258: checking for $ac_word" >&5
+echo "configure:2303: 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
@@ -2305,7 +2350,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:2309: checking for $ac_word" >&5
+echo "configure:2354: 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
@@ -2337,7 +2382,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2341: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2386: 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.
@@ -2348,12 +2393,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2352 "configure"
+#line 2397 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2402: \"$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
@@ -2379,12 +2424,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:2383: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2428: 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:2388: checking whether we are using GNU C" >&5
+echo "configure:2433: 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
@@ -2393,7 +2438,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2397: \"$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:2442: \"$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
@@ -2412,7 +2457,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:2416: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2461: 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
@@ -2443,12 +2488,24 @@ else
fi
fi
+
+
+
+if test -d $srcdir/testsuite; then
+ TESTSUBDIR_TRUE=
+ TESTSUBDIR_FALSE='#'
+else
+ TESTSUBDIR_TRUE='#'
+ TESTSUBDIR_FALSE=
+fi
+
+
TARGETDIR="unknown"
case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
@@ -2483,6 +2540,8 @@ sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
sh64-*-linux* | sh5*-*-linux*) TARGET=SH64; TARGETDIR=sh64;;
esac
+
+
if test $TARGETDIR = unknown; then
{ echo "configure: error: "libffi has not been ported to $host."" 1>&2; exit 1; }
fi
@@ -2632,6 +2691,7 @@ else
SH_FALSE=
fi
+
if test x$TARGET = xSH64; then
SH64_TRUE=
SH64_FALSE='#'
@@ -2645,7 +2705,7 @@ if test x$TARGET = xMIPS_LINUX; then
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2639: checking how to run the C preprocessor" >&5
+echo "configure:2709: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2660,13 +2720,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 2654 "configure"
+#line 2724 "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:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2730: \"$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
:
@@ -2677,13 +2737,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2671 "configure"
+#line 2741 "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:2677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2747: \"$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
:
@@ -2694,13 +2754,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2688 "configure"
+#line 2758 "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:2694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2764: \"$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
:
@@ -2725,12 +2785,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2719: checking for ANSI C header files" >&5
+echo "configure:2789: 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 2724 "configure"
+#line 2794 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2738,7 +2798,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2802: \"$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*
@@ -2755,7 +2815,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 2749 "configure"
+#line 2819 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2773,7 +2833,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 2767 "configure"
+#line 2837 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2794,7 +2854,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2788 "configure"
+#line 2858 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2805,7 +2865,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2831,12 +2891,12 @@ fi
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2825: checking for $ac_func" >&5
+echo "configure:2895: 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 2830 "configure"
+#line 2900 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2859,7 +2919,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2923: \"$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
@@ -2886,19 +2946,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:2880: checking for working alloca.h" >&5
+echo "configure:2950: 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 2885 "configure"
+#line 2955 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2962: \"$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
@@ -2919,12 +2979,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2913: checking for alloca" >&5
+echo "configure:2983: 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 2918 "configure"
+#line 2988 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2952,7 +3012,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3016: \"$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
@@ -2984,12 +3044,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2978: checking whether alloca needs Cray hooks" >&5
+echo "configure:3048: 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 2983 "configure"
+#line 3053 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3014,12 +3074,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:3008: checking for $ac_func" >&5
+echo "configure:3078: 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 3013 "configure"
+#line 3083 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3042,7 +3102,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3106: \"$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
@@ -3069,7 +3129,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3063: checking stack direction for C alloca" >&5
+echo "configure:3133: 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
@@ -3077,7 +3137,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3071 "configure"
+#line 3141 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3096,7 +3156,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3160: \"$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
@@ -3119,13 +3179,13 @@ fi
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3113: checking size of short" >&5
+echo "configure:3183: 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 3119 "configure"
+#line 3189 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3135,7 +3195,7 @@ int main() {
switch (0) case 0: case (sizeof (short) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_short=$ac_size
else
@@ -3158,13 +3218,13 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3152: checking size of int" >&5
+echo "configure:3222: 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 3158 "configure"
+#line 3228 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3174,7 +3234,7 @@ int main() {
switch (0) case 0: case (sizeof (int) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_int=$ac_size
else
@@ -3197,13 +3257,13 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3191: checking size of long" >&5
+echo "configure:3261: 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 3197 "configure"
+#line 3267 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3213,7 +3273,7 @@ int main() {
switch (0) case 0: case (sizeof (long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long=$ac_size
else
@@ -3236,13 +3296,13 @@ EOF
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:3230: checking size of long long" >&5
+echo "configure:3300: 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 3236 "configure"
+#line 3306 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3252,7 +3312,7 @@ int main() {
switch (0) case 0: case (sizeof (long long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long_long=$ac_size
else
@@ -3275,13 +3335,13 @@ EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
-echo "configure:3269: checking size of float" >&5
+echo "configure:3339: checking size of float" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 3275 "configure"
+#line 3345 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3291,7 +3351,7 @@ int main() {
switch (0) case 0: case (sizeof (float) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_float=$ac_size
else
@@ -3314,13 +3374,13 @@ EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:3308: checking size of double" >&5
+echo "configure:3378: 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 3314 "configure"
+#line 3384 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3330,7 +3390,7 @@ int main() {
switch (0) case 0: case (sizeof (double) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_double=$ac_size
else
@@ -3353,13 +3413,13 @@ EOF
echo $ac_n "checking size of long double""... $ac_c" 1>&6
-echo "configure:3347: checking size of long double" >&5
+echo "configure:3417: 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 3353 "configure"
+#line 3423 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3369,7 +3429,7 @@ int main() {
switch (0) case 0: case (sizeof (long double) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long_double=$ac_size
else
@@ -3393,13 +3453,13 @@ EOF
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:3387: checking size of void *" >&5
+echo "configure:3457: 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 3393 "configure"
+#line 3463 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3409,7 +3469,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -3432,14 +3492,14 @@ EOF
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3426: checking whether byte ordering is bigendian" >&5
+echo "configure:3496: 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 3433 "configure"
+#line 3503 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3450,11 +3510,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3514: \"$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 3448 "configure"
+#line 3518 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3465,7 +3525,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3485,7 +3545,7 @@ if test "$cross_compiling" = yes; then
echo $ac_n "cross-compiling... " 2>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3479 "configure"
+#line 3549 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3498,7 +3558,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3562: \"$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
@@ -3516,7 +3576,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:3510: checking to probe for byte ordering" >&5
+echo "configure:3580: checking to probe for byte ordering" >&5
cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -3570,7 +3630,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:3564: checking assembler and linker support unaligned pc related relocs" >&5
+echo "configure:3634: 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
@@ -3580,14 +3640,14 @@ else
CFLAGS="$CFLAGS -fpic"
LDFLAGS="$LDFLAGS -shared"
cat > conftest.$ac_ext <<EOF
-#line 3574 "configure"
+#line 3644 "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:3581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3651: \"$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
@@ -3610,7 +3670,7 @@ EOF
fi
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:3600: checking assembler .register pseudo-op support" >&5
+echo "configure:3674: 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
@@ -3618,14 +3678,14 @@ else
libffi_cv_as_register_pseudo_op=unknown
# Check if we have .register
cat > conftest.$ac_ext <<EOF
-#line 3608 "configure"
+#line 3682 "configure"
#include "confdefs.h"
asm (".register %g2, #scratch");
int main() {
; return 0; }
EOF
-if { (eval echo configure:3615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libffi_cv_as_register_pseudo_op=yes
else
@@ -3648,7 +3708,7 @@ EOF
fi
echo $ac_n "checking whether .eh_frame section should be read-only""... $ac_c" 1>&6
-echo "configure:3495: checking whether .eh_frame section should be read-only" >&5
+echo "configure:3712: 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
@@ -3851,7 +3911,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "include/Makefile include/ffi.h Makefile fficonfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "include/Makefile testsuite/Makefile include/ffi.h Makefile fficonfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -3889,6 +3949,11 @@ 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%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
@@ -3915,6 +3980,9 @@ 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%@TESTSUBDIR_TRUE@%$TESTSUBDIR_TRUE%g
+s%@TESTSUBDIR_FALSE@%$TESTSUBDIR_FALSE%g
+s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g
s%@MIPS_GCC_TRUE@%$MIPS_GCC_TRUE%g
s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g
s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g
@@ -3996,7 +4064,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"include/Makefile include/ffi.h Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"include/Makefile testsuite/Makefile include/ffi.h Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/libffi/configure.in b/libffi/configure.in
index 25b097391cd..aab8f097bf8 100644
--- a/libffi/configure.in
+++ b/libffi/configure.in
@@ -32,7 +32,8 @@ fi
AC_SUBST(libffi_basedir)
AC_CONFIG_AUX_DIR(${libffi_basedir}..)
-AC_CANONICAL_HOST
+AC_CANONICAL_SYSTEM
+target_alias=${target_alias-$host_alias}
AM_PROG_LIBTOOL
@@ -42,8 +43,13 @@ AC_EXEEXT
AM_MAINTAINER_MODE
AC_PROG_CC
+
AC_PROG_LIBTOOL
+dnl The -no-testsuite modules omit the test subdir.
+AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
+
+
TARGETDIR="unknown"
case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
@@ -78,6 +84,8 @@ sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
sh64-*-linux* | sh5*-*-linux*) TARGET=SH64; TARGETDIR=sh64;;
esac
+AC_SUBST(AM_RUNTESTFLAGS)
+
if test $TARGETDIR = unknown; then
AC_ERROR("libffi has not been ported to $host.")
fi
@@ -221,7 +229,7 @@ else
multilib_arg=
fi
-AC_OUTPUT(include/Makefile include/ffi.h Makefile,
+AC_OUTPUT(include/Makefile testsuite/Makefile include/ffi.h Makefile,
[
if test -n "$CONFIG_FILES"; then
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in
index b5d4e2de87b..d2cb67d8a8b 100644
--- a/libffi/include/Makefile.in
+++ b/libffi/include/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -57,8 +57,13 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
AS = @AS@
CC = @CC@
CXX = @CXX@
@@ -101,7 +106,7 @@ DIST_COMMON = Makefile.am Makefile.in ffi.h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = gnutar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
diff --git a/libffi/src/java_raw_api.c b/libffi/src/java_raw_api.c
index cb5dd67a78e..c3b3b8226d8 100644
--- a/libffi/src/java_raw_api.c
+++ b/libffi/src/java_raw_api.c
@@ -36,6 +36,7 @@
#include <ffi.h>
#include <ffi_common.h>
+#include <stdlib.h>
#if !defined(NO_JAVA_RAW_API) && !defined(FFI_NO_RAW_API)
diff --git a/libffi/src/powerpc/aix.S b/libffi/src/powerpc/aix.S
index 427733f5976..1346fb200c0 100644
--- a/libffi/src/powerpc/aix.S
+++ b/libffi/src/powerpc/aix.S
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
aix.S - Copyright (c) 2002 Free Software Foundation, Inc.
based on darwin.S by John Hornkvist
-
+
PowerPC Assembly glue.
Permission is hereby granted, free of charge, to any person obtaining
@@ -121,7 +121,7 @@ ffi_call_AIX:
mr r30,r6 /* rvalue, */
mr r29,r7 /* function address, */
mr r28,r8 /* our AP. */
-
+
/* Call ffi_prep_args. */
mr r4,r1
li r9,0
@@ -140,16 +140,16 @@ ffi_call_AIX:
mtctr r12
lwz r2,4(r29)
/* Load all those argument registers. */
- // We have set up a nice stack frame, just load it into registers.
- lwz r3, 20+(1*4)(r1)
- lwz r4, 20+(2*4)(r1)
- lwz r5, 20+(3*4)(r1)
- lwz r6, 20+(4*4)(r1)
- nop
+ // We have set up a nice stack frame, just load it into registers.
+ lwz r3, 20+(1*4)(r1)
+ lwz r4, 20+(2*4)(r1)
+ lwz r5, 20+(3*4)(r1)
+ lwz r6, 20+(4*4)(r1)
+ nop
lwz r7, 20+(5*4)(r1)
- lwz r8, 20+(6*4)(r1)
- lwz r9, 20+(7*4)(r1)
- lwz r10,20+(8*4)(r1)
+ lwz r8, 20+(6*4)(r1)
+ lwz r9, 20+(7*4)(r1)
+ lwz r10,20+(8*4)(r1)
L1:
/* Load all the FP registers. */
@@ -165,17 +165,17 @@ L1:
lfd f8,-16-(6*8)(r28)
nop
lfd f9,-16-(5*8)(r28)
- lfd f10,-16-(4*8)(r28)
+ lfd f10,-16-(4*8)(r28)
lfd f11,-16-(3*8)(r28)
lfd f12,-16-(2*8)(r28)
nop
lfd f13,-16-(1*8)(r28)
-L2:
+L2:
/* Make the call. */
bctrl
lwz r2,20(r1)
-
+
/* Now, deal with the return value. */
mtcrf 0x01,r31
diff --git a/libffi/src/powerpc/aix_closure.S b/libffi/src/powerpc/aix_closure.S
index d0d50ca56bd..8a26121ee59 100644
--- a/libffi/src/powerpc/aix_closure.S
+++ b/libffi/src/powerpc/aix_closure.S
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
aix_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc.
based on darwin_closure.S
-
+
PowerPC Assembly glue.
Permission is hereby granted, free of charge, to any person obtaining
@@ -102,19 +102,19 @@ ffi_closure_ASM:
mflr r0 /* extract return address */
stw r0, 8(r1) /* save the return address */
-
+
/* 24 Bytes (Linkage Area) */
/* 32 Bytes (params) */
- /* 104 Bytes (13*8 from FPR) */
- /* 8 Bytes (result)
+ /* 104 Bytes (13*8 from FPR) */
+ /* 8 Bytes (result) */
/* 168 Bytes */
-
+
stwu r1,-176(r1) /* skip over caller save area
keep stack aligned to 16 */
/* we want to build up an area for the parameters passed */
/* in registers (both floating point and integer) */
-
+
/* we store gpr 3 to gpr 10 (aligned to 4)
in the parents outgoing area */
stw r3, 200(r1)
@@ -144,20 +144,16 @@ ffi_closure_ASM:
/* set up registers for the routine that actually does the work */
/* get the context pointer from the trampoline */
mr r3,r11
-
+
/* now load up the pointer to the result storage */
addi r4,r1,160
-
+
/* now load up the pointer to the saved gpr registers */
addi r5,r1,200
/* now load up the pointer to the saved fpr registers */
addi r6,r1,56
- /* now load up the pointer to the outgoing parameter */
- /* stack in the previous frame */
- addi r7,r1,232
-
/* make the call */
bl .ffi_closure_helper_DARWIN
nop
@@ -203,18 +199,18 @@ L..46:
L..47:
lfs f1,0(r5)
b L..44
-
+
/* case long long */
L..48:
lwz r3,0(r5)
lwz r4,4(r5)
b L..44
-
+
/* case default / int32 / pointer */
L..50:
lwz r3,0(r5)
b L..44
-
+
/* case signed int8 */
L..55:
addi r5,r5,3
@@ -243,10 +239,9 @@ L..58:
/* case void / done */
L..44:
-
addi r1,r1,176 /* restore stack pointer */
lwz r0,8(r1) /* get return address */
mtlr r0 /* reset link register */
blr
-
+
/* END(ffi_closure_ASM) */
diff --git a/libffi/src/powerpc/darwin.S b/libffi/src/powerpc/darwin.S
index 108d2acff72..712252666fd 100644
--- a/libffi/src/powerpc/darwin.S
+++ b/libffi/src/powerpc/darwin.S
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
darwin.S - Copyright (c) 2000 John Hornkvist
-
+
PowerPC Assembly glue.
Permission is hereby granted, free of charge, to any person obtaining
@@ -23,7 +23,7 @@
OTHER DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
-#define LIBFFI_ASM
+#define LIBFFI_ASM
#include <ffi.h>
#define JUMPTARGET(name) name
#define L(x) x
@@ -37,59 +37,59 @@
.text
.align 2
_ffi_call_DARWIN:
-LFB0:
+LFB0:
mr r12,r8 /* We only need r12 until the call,
- so it doesn't have to be saved... */
-LFB1:
+ so it doesn't have to be saved... */
+LFB1:
/* Save the old stack pointer as AP. */
mr r8,r1
-LCFI0:
+LCFI0:
/* Allocate the stack space we need. */
- stwux r1,r1,r4
-
+ stwux r1,r1,r4
+
/* Save registers we use. */
mflr r9
- stw r28,-16(r8)
+ stw r28,-16(r8)
stw r29,-12(r8)
stw r30, -8(r8)
stw r31, -4(r8)
- stw r9, 8(r8)
+ stw r9, 8(r8)
stw r2, 20(r1)
-LCFI1:
+LCFI1:
/* Save arguments over call... */
mr r31,r5 /* flags, */
mr r30,r6 /* rvalue, */
mr r29,r7 /* function address, */
mr r28,r8 /* our AP. */
-LCFI2:
+LCFI2:
/* Call ffi_prep_args. */
mr r4,r1
li r9,0
-
+
mtctr r12 // r12 holds address of _ffi_prep_args
- bctrl
+ bctrl
lwz r2,20(r1)
- /* Now do the call. */
- /* Set up cr1 with bits 4-7 of the flags. */
+ /* Now do the call.
+ Set up cr1 with bits 4-7 of the flags. */
mtcrf 0x40,r31
/* Get the address to call into CTR. */
mtctr r29
- /* Load all those argument registers. */
- // We have set up a nice stack frame, just load it into registers.
- lwz r3, 20+(1*4)(r1)
- lwz r4, 20+(2*4)(r1)
- lwz r5, 20+(3*4)(r1)
- lwz r6, 20+(4*4)(r1)
- nop
+ /* Load all those argument registers.
+ We have set up a nice stack frame, just load it into registers. */
+ lwz r3, 20+(1*4)(r1)
+ lwz r4, 20+(2*4)(r1)
+ lwz r5, 20+(3*4)(r1)
+ lwz r6, 20+(4*4)(r1)
+ nop
lwz r7, 20+(5*4)(r1)
- lwz r8, 20+(6*4)(r1)
- lwz r9, 20+(7*4)(r1)
- lwz r10,20+(8*4)(r1)
-
+ lwz r8, 20+(6*4)(r1)
+ lwz r9, 20+(7*4)(r1)
+ lwz r10,20+(8*4)(r1)
+
L1:
/* Load all the FP registers. */
bf 6,L2 // 2f + 0x18
@@ -104,20 +104,20 @@ L1:
lfd f8,-16-(6*8)(r28)
nop
lfd f9,-16-(5*8)(r28)
- lfd f10,-16-(4*8)(r28)
+ lfd f10,-16-(4*8)(r28)
lfd f11,-16-(3*8)(r28)
lfd f12,-16-(2*8)(r28)
nop
lfd f13,-16-(1*8)(r28)
-L2:
- mr r12,r29 // Put the target address in r12 as specified.
+L2:
+ mr r12,r29 /* Put the target address in r12 as specified. */
mtctr r12
nop
nop
/* Make the call. */
bctrl
-
+
/* Now, deal with the return value. */
mtcrf 0x01,r31
@@ -147,7 +147,7 @@ L(fp_return_value):
L(float_return_value):
stfs f1,0(r30)
b L(done_return_value)
-LFE1:
+LFE1:
/* END(_ffi_call_DARWIN) */
/* Provide a null definition of _ffi_call_AIX. */
@@ -193,26 +193,25 @@ LASFDE1:
.set L$set$4,LCFI0-LFB1
.long L$set$4
.byte 0xd ; DW_CFA_def_cfa_register
- .byte 0x08 ; uleb128 0x08
+ .byte 0x08 ; uleb128 0x08
.byte 0x4 ; DW_CFA_advance_loc4
.set L$set$5,LCFI1-LCFI0
.long L$set$5
.byte 0x11 ; DW_CFA_offset_extended_sf
.byte 0x41 ; uleb128 0x41
.byte 0x7e ; sleb128 -2
- .byte 0x9f ; DW_CFA_offset, column 0x1f
- .byte 0x1 ; uleb128 0x1
+ .byte 0x9f ; DW_CFA_offset, column 0x1f
+ .byte 0x1 ; uleb128 0x1
.byte 0x9e ; DW_CFA_offset, column 0x1e
.byte 0x2 ; uleb128 0x2
- .byte 0x9d ; DW_CFA_offset, column 0x1d
- .byte 0x3 ; uleb128 0x3
- .byte 0x9c ; DW_CFA_offset, column 0x1c
+ .byte 0x9d ; DW_CFA_offset, column 0x1d
+ .byte 0x3 ; uleb128 0x3
+ .byte 0x9c ; DW_CFA_offset, column 0x1c
.byte 0x4 ; uleb128 0x4
- .byte 0x4 ; DW_CFA_advance_loc4
+ .byte 0x4 ; DW_CFA_advance_loc4
.set L$set$6,LCFI2-LCFI1
.long L$set$6
- .byte 0xd ; DW_CFA_def_cfa_register
- .byte 0x1c ; uleb128 0x1c
+ .byte 0xd ; DW_CFA_def_cfa_register
+ .byte 0x1c ; uleb128 0x1c
.align 2
LEFDE1:
-
diff --git a/libffi/src/powerpc/darwin_closure.S b/libffi/src/powerpc/darwin_closure.S
index 9f721de8a61..d8612a85445 100644
--- a/libffi/src/powerpc/darwin_closure.S
+++ b/libffi/src/powerpc/darwin_closure.S
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
- darwin_closure.S - Copyright (c) 2002 2003 Free Software Foundation,
+ darwin_closure.S - Copyright (c) 2002 2003 Free Software Foundation,
Inc. based on ppc_closure.S
-
+
PowerPC Assembly glue.
Permission is hereby granted, free of charge, to any person obtaining
@@ -29,40 +29,40 @@
.file "darwin_closure.S"
.text
- .align 2
+ .align 2
.globl _ffi_closure_ASM
-
+
.text
.align 2
_ffi_closure_ASM:
-LFB1:
+LFB1:
mflr r0 /* extract return address */
stw r0, 8(r1) /* save the return address */
-LCFI0:
+LCFI0:
/* 24 Bytes (Linkage Area)
32 Bytes (outgoing parameter area, always reserved)
- 104 Bytes (13*8 from FPR)
+ 104 Bytes (13*8 from FPR)
8 Bytes (result)
168 Bytes */
-
+
stwu r1,-176(r1) /* skip over caller save area
- keep stack aligned to 16 */
-LCFI1:
- /* we want to build up an area for the parameters passed
- in registers (both floating point and integer) */
-
- /* we store gpr 3 to gpr 10 (aligned to 4)
- in the parents outgoing area */
+ keep stack aligned to 16. */
+LCFI1:
+ /* We want to build up an area for the parameters passed
+ in registers. (both floating point and integer) */
+
+ /* We store gpr 3 to gpr 10 (aligned to 4)
+ in the parents outgoing area. */
stw r3, 200(r1)
stw r4, 204(r1)
- stw r5, 208(r1)
+ stw r5, 208(r1)
stw r6, 212(r1)
stw r7, 216(r1)
- stw r8, 220(r1)
+ stw r8, 220(r1)
stw r9, 224(r1)
stw r10, 228(r1)
- /* we save fpr 1 to fpr 13 (aligned to 8) */
+ /* We save fpr 1 to fpr 13. (aligned to 8) */
stfd f1, 56(r1)
stfd f2, 64(r1)
stfd f3, 72(r1)
@@ -71,50 +71,46 @@ LCFI1:
stfd f6, 96(r1)
stfd f7, 104(r1)
stfd f8, 112(r1)
- stfd f9, 120(r1)
- stfd f10, 128(r1)
- stfd f11, 136(r1)
- stfd f12, 144(r1)
- stfd f13, 152(r1)
-
- /* set up registers for the routine that actually does the work */
- /* get the context pointer from the trampoline */
+ stfd f9, 120(r1)
+ stfd f10, 128(r1)
+ stfd f11, 136(r1)
+ stfd f12, 144(r1)
+ stfd f13, 152(r1)
+
+ /* Set up registers for the routine that actually does the work
+ get the context pointer from the trampoline. */
mr r3,r11
-
- /* now load up the pointer to the result storage */
+
+ /* Now load up the pointer to the result storage. */
addi r4,r1,160
-
- /* now load up the pointer to the saved gpr registers */
+
+ /* Now load up the pointer to the saved gpr registers. */
addi r5,r1,200
- /* now load up the pointer to the saved fpr registers */
+ /* Now load up the pointer to the saved fpr registers. */
addi r6,r1,56
- /* now load up the pointer to the outgoing parameter
- stack in the previous frame */
- addi r7,r1,232
-
- /* make the call */
+ /* Make the call. */
bl Lffi_closure_helper_DARWIN$stub
-
- /* now r3 contains the return type */
- /* so use it to look up in a table */
- /* so we know how to deal with each type */
-
- /* look up the proper starting point in table */
- /* by using return type as offset */
- addi r5,r1,160 /* get pointer to results area */
- bl Lget_ret_type0_addr /* get pointer to Lret_type0 into LR */
- mflr r4 /* move to r4 */
- slwi r3,r3,4 /* now multiply return type by 16 */
- add r3,r3,r4 /* add contents of table to table address */
+
+ /* Now r3 contains the return type
+ so use it to look up in a table
+ so we know how to deal with each type. */
+
+ /* Look up the proper starting point in table
+ by using return type as offset. */
+ addi r5,r1,160 /* Get pointer to results area. */
+ bl Lget_ret_type0_addr /* Get pointer to Lret_type0 into LR. */
+ mflr r4 /* Move to r4. */
+ slwi r3,r3,4 /* Now multiply return type by 16. */
+ add r3,r3,r4 /* Add contents of table to table address. */
mtctr r3
- bctr /* jump to it */
+ bctr /* Jump to it. */
LFE1:
-/* Each of the ret_typeX code fragments has to be exactly 16 bytes long */
-/* (4 instructions). For cache effectiveness we align to a 16 byte boundary */
-/* first. */
-
+/* Each of the ret_typeX code fragments has to be exactly 16 bytes long
+ (4 instructions). For cache effectiveness we align to a 16 byte boundary
+ first. */
+
.align 4
nop
@@ -146,21 +142,21 @@ Lret_type2:
/* case FFI_TYPE_DOUBLE */
Lret_type3:
- lfd f1,0(r5)
+ lfd f1,0(r5)
b Lfinish
nop
nop
/* case FFI_TYPE_LONGDOUBLE */
Lret_type4:
- lfd f1,0(r5)
+ lfd f1,0(r5)
b Lfinish
nop
nop
/* case FFI_TYPE_UINT8 */
Lret_type5:
- lbz r3,3(r5)
+ lbz r3,3(r5)
b Lfinish
nop
nop
@@ -214,7 +210,7 @@ Lret_type12:
b Lfinish
nop
-/* case FFI_TYPE_STRUCT */
+/* case FFI_TYPE_STRUCT */
Lret_type13:
b Lfinish
nop
@@ -228,14 +224,14 @@ Lret_type14:
nop
nop
-/* case done */
-Lfinish:
- addi r1,r1,176 /* restore stack pointer */
- lwz r0,8(r1) /* get return address */
- mtlr r0 /* reset link register */
+/* case done */
+Lfinish:
+ addi r1,r1,176 /* Restore stack pointer. */
+ lwz r0,8(r1) /* Get return address. */
+ mtlr r0 /* Reset link register. */
blr
-
-/* END(ffi_closure_ASM) */
+
+/* END(ffi_closure_ASM) */
.data
.section __TEXT,__eh_frame
@@ -271,7 +267,7 @@ LASFDE1:
.set L$set$3,LCFI1-LCFI0
.long L$set$3
.byte 0xe ; DW_CFA_def_cfa_offset
- .byte 176,1 ; uleb128 176
+ .byte 176,1 ; uleb128 176
.byte 0x4 ; DW_CFA_advance_loc4
.set L$set$4,LCFI0-LFB1
.long L$set$4
@@ -285,19 +281,19 @@ LEFDE1:
LDFCM0:
.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
.align 2
-Lffi_closure_helper_DARWIN$stub:
- .indirect_symbol _ffi_closure_helper_DARWIN
- mflr r0
- bcl 20,31,LO$ffi_closure_helper_DARWIN
+Lffi_closure_helper_DARWIN$stub:
+ .indirect_symbol _ffi_closure_helper_DARWIN
+ mflr r0
+ bcl 20,31,LO$ffi_closure_helper_DARWIN
LO$ffi_closure_helper_DARWIN:
- mflr r11
+ mflr r11
addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)
- mtlr r0
- lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)(r11)
- mtctr r12
- bctr
+ mtlr r0
+ lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)(r11)
+ mtctr r12
+ bctr
.data
-.lazy_symbol_pointer
-L_ffi_closure_helper_DARWIN$lazy_ptr:
+.lazy_symbol_pointer
+L_ffi_closure_helper_DARWIN$lazy_ptr:
.indirect_symbol _ffi_closure_helper_DARWIN
.long dyld_stub_binding_helper
diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c
index 6f0e2a561af..9ad85ea7b86 100644
--- a/libffi/src/powerpc/ffi.c
+++ b/libffi/src/powerpc/ffi.c
@@ -288,7 +288,7 @@ enum { ASM_NEEDS_REGISTERS64 = 4 };
|--------------------------------------------| |
| TOC save area 8 | |
|--------------------------------------------| | stack |
- | Linker doubleword 8 | | gorws |
+ | Linker doubleword 8 | | grows |
|--------------------------------------------| | down V
| Compiler doubleword 8 | |
|--------------------------------------------| | lower addresses
@@ -376,23 +376,22 @@ void hidden ffi_prep_args64(extended_cif *ecif, unsigned long *const stack)
words = ((*ptr)->size + 7) / 8;
if (next_arg >= gpr_base && next_arg + words > gpr_end)
{
- unsigned int first = (char *) gpr_end - (char *) next_arg;
+ size_t first = (char *) gpr_end - (char *) next_arg;
memcpy((char *) next_arg, (char *) *p_argv, first);
memcpy((char *) rest, (char *) *p_argv + first,
(*ptr)->size - first);
- next_arg = rest + words * 8 - first;
+ next_arg = (unsigned long *) ((char *) rest + words * 8 - first);
}
else
{
- /* Structures with 1, 2 and 4 byte sizes are passed left-padded
- if they are in the first 8 arguments. */
- if (next_arg >= gpr_base
- && (*ptr)->size < 8
- && ((*ptr)->size & ~((*ptr)->size - 1)) == (*ptr)->size)
- memcpy((char *) next_arg + 8 - (*ptr)->size,
- (char *) *p_argv, (*ptr)->size);
- else
- memcpy((char *) next_arg, (char *) *p_argv, (*ptr)->size);
+ char *where = (char *) next_arg;
+
+ /* Structures with size less than eight bytes are passed
+ left-padded. */
+ if ((*ptr)->size < 8)
+ where += 8 - (*ptr)->size;
+
+ memcpy (where, (char *) *p_argv, (*ptr)->size);
next_arg += words;
if (next_arg == gpr_end)
next_arg = rest;
@@ -592,7 +591,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
#endif
- intarg_count += ((*ptr)->size + 7) & ~7;
+ intarg_count += ((*ptr)->size + 7) / 8;
break;
default:
@@ -854,8 +853,7 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
case FFI_TYPE_SINT32:
case FFI_TYPE_UINT32:
case FFI_TYPE_POINTER:
- case FFI_TYPE_STRUCT:
- /* there are 8 gpr registers used to pass values */
+ /* there are 8 gpr registers used to pass values */
if (ng < 8) {
avalue[i] = pgr;
ng++;
@@ -865,6 +863,19 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
pst++;
}
break;
+
+ case FFI_TYPE_STRUCT:
+ /* Structs are passed by reference. The address will appear in a
+ gpr if it is one of the first 8 arguments. */
+ if (ng < 8) {
+ avalue[i] = (void *) *pgr;
+ ng++;
+ pgr++;
+ } else {
+ avalue[i] = (void *) *pst;
+ pst++;
+ }
+ break;
case FFI_TYPE_SINT64:
case FFI_TYPE_UINT64:
@@ -1027,12 +1038,9 @@ ffi_closure_helper_LINUX64 (ffi_closure* closure, void * rvalue,
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
#endif
- /* Structures with 1, 2 and 4 byte sizes are passed left-padded
- if they are in the first 8 arguments. */
- if (ng < NUM_GPR_ARG_REGISTERS64
- && arg_types[i]->size < 8
- && ((arg_types[i]->size & ~(arg_types[i]->size - 1))
- == arg_types[i]->size))
+ /* Structures with size less than eight bytes are passed
+ left-padded. */
+ if (arg_types[i]->size < 8)
avalue[i] = (char *) pst + 8 - arg_types[i]->size;
else
avalue[i] = pst;
diff --git a/libffi/src/powerpc/ffi_darwin.c b/libffi/src/powerpc/ffi_darwin.c
index 3f705275c5f..73653cd43c6 100644
--- a/libffi/src/powerpc/ffi_darwin.c
+++ b/libffi/src/powerpc/ffi_darwin.c
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Foreign Function Interface
+
+ PowerPC Foreign Function Interface
Darwin ABI support (c) 2001 John Hornkvist
AIX ABI support (c) 2002 Free Software Foundation, Inc.
@@ -29,17 +29,17 @@
#include <ffi_common.h>
#include <stdlib.h>
-
+
extern void ffi_closure_ASM(void);
enum {
/* The assembly depends on these exact flags. */
- FLAG_RETURNS_NOTHING = 1 << (31-30), /* These go in cr7 */
+ FLAG_RETURNS_NOTHING = 1 << (31-30), /* These go in cr7 */
FLAG_RETURNS_FP = 1 << (31-29),
FLAG_RETURNS_64BITS = 1 << (31-28),
FLAG_ARG_NEEDS_COPY = 1 << (31- 7),
- FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
+ FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
FLAG_4_GPR_ARGUMENTS = 1 << (31- 5),
FLAG_RETVAL_REFERENCE = 1 << (31- 4)
};
@@ -58,7 +58,7 @@ enum { ASM_NEEDS_REGISTERS = 4 };
| Return address from ffi_call_DARWIN | higher addresses
|--------------------------------------------|
- | Previous backchain pointer 4 | stack pointer here
+ | Previous backchain pointer 4 | stack pointer here
|--------------------------------------------|<+ <<< on entry to
| Saved r28-r31 4*4 | | ffi_call_DARWIN
|--------------------------------------------| |
@@ -69,7 +69,7 @@ enum { ASM_NEEDS_REGISTERS = 4 };
| Reserved 2*4 | | grows |
|--------------------------------------------| | down V
| Space for callee's LR 4 | |
- |--------------------------------------------| | lower addresses
+ |--------------------------------------------| | lower addresses
| Saved CR 4 | |
|--------------------------------------------| | stack pointer here
| Current backchain pointer 4 |-/ during
@@ -81,8 +81,7 @@ enum { ASM_NEEDS_REGISTERS = 4 };
void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
/*@=exportheader@*/
{
- const unsigned bytes = ecif->cif->bytes;
- const unsigned flags = ecif->cif->flags;
+ const unsigned flags = ecif->cif->flags;
/* 'stacktop' points at the previous backchain pointer. */
unsigned *const stacktop = stack + (ecif->cif->bytes / sizeof(unsigned));
@@ -94,23 +93,25 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
/* 'next_arg' grows up as we put parameters in it. */
- unsigned *next_arg = stack + 6; // 6 reserved posistions.
+ unsigned *next_arg = stack + 6; /* 6 reserved posistions. */
- int i=ecif->cif->nargs;
+ int i = ecif->cif->nargs;
double double_tmp;
- float float_tmp;
void **p_argv = ecif->avalue;
unsigned gprvalue;
ffi_type** ptr = ecif->cif->arg_types;
+ char *dest_cpy;
+ unsigned size_al = 0;
/* Check that everything starts aligned properly. */
FFI_ASSERT(((unsigned)(char *)stack & 0xF) == 0);
FFI_ASSERT(((unsigned)(char *)stacktop & 0xF) == 0);
FFI_ASSERT((bytes & 0xF) == 0);
- /* Deal with return values that are actually pass-by-reference. */
- // Rule:
- // Return values are referenced by r3, so r4 is the first parameter.
+ /* Deal with return values that are actually pass-by-reference.
+ Rule:
+ Return values are referenced by r3, so r4 is the first parameter. */
+
if (flags & FLAG_RETVAL_REFERENCE)
*next_arg++ = (unsigned)(char *)ecif->rvalue;
@@ -127,28 +128,28 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
case FFI_TYPE_FLOAT:
double_tmp = *(float *)*p_argv;
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
- *(double *)next_arg = double_tmp;
+ *(double *)next_arg = double_tmp;
else
- *fpr_base++ = double_tmp;
- next_arg++;
+ *fpr_base++ = double_tmp;
+ next_arg++;
fparg_count++;
FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
break;
case FFI_TYPE_DOUBLE:
double_tmp = *(double *)*p_argv;
if (fparg_count >= NUM_FPR_ARG_REGISTERS)
- *(double *)next_arg = double_tmp;
+ *(double *)next_arg = double_tmp;
else
- *fpr_base++ = double_tmp;
- next_arg += 2;
+ *fpr_base++ = double_tmp;
+ next_arg += 2;
fparg_count++;
FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
break;
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
- *(long long *)next_arg = *(long long *)*p_argv;
- next_arg+=2;
+ *(long long *)next_arg = *(long long *)*p_argv;
+ next_arg+=2;
break;
case FFI_TYPE_UINT8:
gprvalue = *(unsigned char *)*p_argv;
@@ -163,18 +164,31 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
gprvalue = *(signed short *)*p_argv;
goto putgpr;
- case FFI_TYPE_STRUCT:
+ case FFI_TYPE_STRUCT:
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
+ case FFI_TYPE_LONGDOUBLE:
#endif
-
- memcpy((char*)next_arg, (char *)*p_argv, (*ptr)->size);
- next_arg+=(((((*ptr)->size) + 3) & ~0x3)/4);
- break;
-
+ dest_cpy = (char *) next_arg;
+
+ /* Structures that match the basic modes (QI 1 byte, HI 2 bytes,
+ SI 4 bytes) are aligned as if they were those modes.
+ Structures with 3 byte in size are padded upwards. */
+ size_al = (*ptr)->size;
+ /* If the first member of the struct is a double, then align
+ the struct to double-word.
+ Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */
+ if ((*ptr)->elements[0]->type == 3)
+ size_al = ALIGN((*ptr)->size, 8);
+ if (size_al < 3 && ecif->cif->abi == FFI_DARWIN)
+ dest_cpy += 4 - size_al;
+
+ memcpy((char *)dest_cpy, (char *)*p_argv, size_al);
+ next_arg += (size_al + 3) / 4;
+ break;
+
case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
+ case FFI_TYPE_UINT32:
case FFI_TYPE_SINT32:
case FFI_TYPE_POINTER:
gprvalue = *(unsigned *)*p_argv;
@@ -187,14 +201,13 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
}
/* Check that we didn't overrun the stack... */
- //FFI_ASSERT(copy_space >= (char *)next_arg);
//FFI_ASSERT(gpr_base <= stacktop - ASM_NEEDS_REGISTERS);
//FFI_ASSERT((unsigned *)fpr_base
// <= stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
//FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4);
}
-/* Perform machine dependent cif processing */
+/* Perform machine dependent cif processing. */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
{
/* All this is for the DARWIN ABI. */
@@ -203,12 +216,12 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
unsigned bytes;
int fparg_count = 0, intarg_count = 0;
unsigned flags = 0;
- unsigned struct_copy_size = 0;
+ unsigned size_al = 0;
/* All the machine-independent calculation of cif->bytes will be wrong.
Redo the calculation for DARWIN. */
- /* Space for the frame pointer, callee's LR, CR, etc, and for
+ /* Space for the frame pointer, callee's LR, CR, etc, and for
the asm's temp regs. */
bytes = (6 + ASM_NEEDS_REGISTERS) * sizeof(long);
@@ -281,7 +294,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
on the stack. If they go on the stack, they must
be 8-byte-aligned. */
if (intarg_count == NUM_GPR_ARG_REGISTERS-1
- || intarg_count >= NUM_GPR_ARG_REGISTERS && intarg_count%2 != 0)
+ || (intarg_count >= NUM_GPR_ARG_REGISTERS && intarg_count%2 != 0))
intarg_count++;
intarg_count += 2;
break;
@@ -290,7 +303,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
#endif
- intarg_count+=(((*ptr)->size + 3) & ~0x3)/4;
+ size_al = (*ptr)->size;
+ /* If the first member of the struct is a double, then align
+ the struct to double-word.
+ Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */
+ if ((*ptr)->elements[0]->type == 3)
+ size_al = ALIGN((*ptr)->size, 8);
+ intarg_count += (size_al + 3) / 4;
break;
default:
@@ -303,9 +322,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
if (fparg_count != 0)
flags |= FLAG_FP_ARGUMENTS;
- if (struct_copy_size != 0)
- flags |= FLAG_ARG_NEEDS_COPY;
-
+
/* Space for the FPR registers, if needed. */
if (fparg_count != 0)
bytes += NUM_FPR_ARG_REGISTERS * sizeof(double);
@@ -321,39 +338,39 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
cif->flags = flags;
cif->bytes = bytes;
-
+
return FFI_OK;
}
/*@-declundef@*/
/*@-exportheader@*/
-extern void ffi_call_AIX(/*@out@*/ extended_cif *,
- unsigned, unsigned,
- /*@out@*/ unsigned *,
+extern void ffi_call_AIX(/*@out@*/ extended_cif *,
+ unsigned, unsigned,
+ /*@out@*/ unsigned *,
void (*fn)(),
void (*fn2)());
-extern void ffi_call_DARWIN(/*@out@*/ extended_cif *,
- unsigned, unsigned,
- /*@out@*/ unsigned *,
+extern void ffi_call_DARWIN(/*@out@*/ extended_cif *,
+ unsigned, unsigned,
+ /*@out@*/ unsigned *,
void (*fn)(),
void (*fn2)());
/*@=declundef@*/
/*@=exportheader@*/
-void ffi_call(/*@dependent@*/ ffi_cif *cif,
- void (*fn)(),
- /*@out@*/ void *rvalue,
+void ffi_call(/*@dependent@*/ ffi_cif *cif,
+ void (*fn)(),
+ /*@out@*/ void *rvalue,
/*@dependent@*/ void **avalue)
{
extended_cif ecif;
ecif.cif = cif;
ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
- if ((rvalue == NULL) &&
+ /* If the return value is a struct and we don't have a return
+ value address then we need to make one. */
+
+ if ((rvalue == NULL) &&
(cif->rtype->type == FFI_TYPE_STRUCT))
{
/*@-sysunrecog@*/
@@ -362,18 +379,18 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif,
}
else
ecif.rvalue = rvalue;
-
- switch (cif->abi)
+
+ switch (cif->abi)
{
case FFI_AIX:
/*@-usedef@*/
- ffi_call_AIX(&ecif, -cif->bytes,
+ ffi_call_AIX(&ecif, -cif->bytes,
cif->flags, ecif.rvalue, fn, ffi_prep_args);
/*@=usedef@*/
break;
case FFI_DARWIN:
/*@-usedef@*/
- ffi_call_DARWIN(&ecif, -cif->bytes,
+ ffi_call_DARWIN(&ecif, -cif->bytes,
cif->flags, ecif.rvalue, fn, ffi_prep_args);
/*@=usedef@*/
break;
@@ -385,9 +402,9 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif,
static void flush_icache(char *);
static void flush_range(char *, int);
-
-/* The layout of a function descriptor. A C function pointer really */
-/* points to one of these. */
+
+/* The layout of a function descriptor. A C function pointer really
+ points to one of these. */
typedef struct aix_fd_struct {
void *code_pointer;
@@ -395,93 +412,93 @@ typedef struct aix_fd_struct {
} aix_fd;
/* here I'd like to add the stack frame layout we use in darwin_closure.S
- * and aix_clsoure.S
- *
-/* SP previous -> +---------------------------------------+ <--- child frame
- | back chain to caller 4 |
- +---------------------------------------+ 4
- | saved CR 4 |
- +---------------------------------------+ 8
- | saved LR 4 |
- +---------------------------------------+ 12
- | reserved for compilers 4 |
- +---------------------------------------+ 16
- | reserved for binders 4 |
- +---------------------------------------+ 20
- | saved TOC pointer 4 |
- +---------------------------------------+ 24
- | always reserved 8*4=32 (previous GPRs)|
- | according to the linkage convention |
- | from AIX |
- +---------------------------------------+ 56
- | our FPR area 13*8=104 |
- | f1 |
- | . |
- | f13 |
- +---------------------------------------+ 160
- | result area 8 |
- +---------------------------------------+ 168
- | alignement to the next multiple of 16 |
+ and aix_clsoure.S
+
+ SP previous -> +---------------------------------------+ <--- child frame
+ | back chain to caller 4 |
+ +---------------------------------------+ 4
+ | saved CR 4 |
+ +---------------------------------------+ 8
+ | saved LR 4 |
+ +---------------------------------------+ 12
+ | reserved for compilers 4 |
+ +---------------------------------------+ 16
+ | reserved for binders 4 |
+ +---------------------------------------+ 20
+ | saved TOC pointer 4 |
+ +---------------------------------------+ 24
+ | always reserved 8*4=32 (previous GPRs)|
+ | according to the linkage convention |
+ | from AIX |
+ +---------------------------------------+ 56
+ | our FPR area 13*8=104 |
+ | f1 |
+ | . |
+ | f13 |
+ +---------------------------------------+ 160
+ | result area 8 |
+ +---------------------------------------+ 168
+ | alignement to the next multiple of 16 |
SP current --> +---------------------------------------+ 176 <- parent frame
- | back chain to caller 4 |
- +---------------------------------------+ 180
- | saved CR 4 |
- +---------------------------------------+ 184
- | saved LR 4 |
- +---------------------------------------+ 188
- | reserved for compilers 4 |
- +---------------------------------------+ 192
- | reserved for binders 4 |
- +---------------------------------------+ 196
- | saved TOC pointer 4 |
- +---------------------------------------+ 200
- | always reserved 8*4=32 we store our |
- | GPRs here |
- | r3 |
- | . |
- | r10 |
- +---------------------------------------+ 232
- | PST area, overflow part |
- +---------------------------------------+ xxx
- | ???? |
- +---------------------------------------+ xxx
+ | back chain to caller 4 |
+ +---------------------------------------+ 180
+ | saved CR 4 |
+ +---------------------------------------+ 184
+ | saved LR 4 |
+ +---------------------------------------+ 188
+ | reserved for compilers 4 |
+ +---------------------------------------+ 192
+ | reserved for binders 4 |
+ +---------------------------------------+ 196
+ | saved TOC pointer 4 |
+ +---------------------------------------+ 200
+ | always reserved 8*4=32 we store our |
+ | GPRs here |
+ | r3 |
+ | . |
+ | r10 |
+ +---------------------------------------+ 232
+ | overflow part |
+ +---------------------------------------+ xxx
+ | ???? |
+ +---------------------------------------+ xxx
*/
ffi_status
-ffi_prep_closure (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data)
+ffi_prep_closure (ffi_closure* closure,
+ ffi_cif* cif,
+ void (*fun)(ffi_cif*, void*, void**, void*),
+ void *user_data)
{
unsigned int *tramp;
struct ffi_aix_trampoline_struct *tramp_aix;
aix_fd *fd;
-
+
switch (cif->abi)
- {
+ {
case FFI_DARWIN:
FFI_ASSERT (cif->abi == FFI_DARWIN);
tramp = (unsigned int *) &closure->tramp[0];
- tramp[0] = 0x7c0802a6; /* mflr r0 */
- tramp[1] = 0x4800000d; /* bl 10 <trampoline_initial+0x10> */
- tramp[4] = 0x7d6802a6; /* mflr r11 */
- tramp[5] = 0x818b0000; /* lwz r12,0(r11) /* function address */
- tramp[6] = 0x7c0803a6; /* mtlr r0 */
- tramp[7] = 0x7d8903a6; /* mtctr r12 */
- tramp[8] = 0x816b0004; /* lwz r11,4(r11) /* static chain */
- tramp[9] = 0x4e800420; /* bctr */
- *(void **) &tramp[2] = (void *)ffi_closure_ASM; /* function */
- *(void **) &tramp[3] = (void *)closure; /* context */
+ tramp[0] = 0x7c0802a6; /* mflr r0 */
+ tramp[1] = 0x429f000d; /* bcl- 20,4*cr7+so,0x10 */
+ tramp[4] = 0x7d6802a6; /* mflr r11 */
+ tramp[5] = 0x818b0000; /* lwz r12,0(r11) function address */
+ tramp[6] = 0x7c0803a6; /* mtlr r0 */
+ tramp[7] = 0x7d8903a6; /* mtctr r12 */
+ tramp[8] = 0x816b0004; /* lwz r11,4(r11) static chain */
+ tramp[9] = 0x4e800420; /* bctr */
+ tramp[2] = (unsigned long) ffi_closure_ASM; /* function */
+ tramp[3] = (unsigned long) closure; /* context */
closure->cif = cif;
closure->fun = fun;
closure->user_data = user_data;
- /* Flush the icache. Only necessary on Darwin */
+ /* Flush the icache. Only necessary on Darwin. */
flush_range(&closure->tramp[0],FFI_TRAMPOLINE_SIZE);
-
+
break;
case FFI_AIX:
@@ -511,12 +528,12 @@ flush_icache(char *addr)
{
#ifndef _AIX
__asm__ volatile (
- "dcbf 0,%0;"
- "sync;"
- "icbi 0,%0;"
- "sync;"
- "isync;"
- : : "r"(addr) : "memory");
+ "dcbf 0,%0;"
+ "sync;"
+ "icbi 0,%0;"
+ "sync;"
+ "isync;"
+ : : "r"(addr) : "memory");
#endif
}
@@ -530,34 +547,38 @@ flush_range(char * addr1, int size)
flush_icache(addr1+size-1);
}
-int ffi_closure_helper_DARWIN (ffi_closure*, void*, unsigned long*,
- unsigned long*, unsigned long*);
+typedef union
+{
+ float f;
+ double d;
+} ffi_dblfl;
+
+int ffi_closure_helper_DARWIN (ffi_closure*, void*,
+ unsigned long*, ffi_dblfl*);
/* Basically the trampoline invokes ffi_closure_ASM, and on
- * entry, r11 holds the address of the closure.
- * After storing the registers that could possibly contain
- * parameters to be passed into the stack frame and setting
- * up space for a return value, ffi_closure_ASM invokes the
- * following helper function to do most of the work
- */
-
-int
-ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
- unsigned long * pgr, unsigned long * pfr,
- unsigned long * pst)
+ entry, r11 holds the address of the closure.
+ After storing the registers that could possibly contain
+ parameters to be passed into the stack frame and setting
+ up space for a return value, ffi_closure_ASM invokes the
+ following helper function to do most of the work. */
+
+int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
+ unsigned long * pgr, ffi_dblfl * pfr)
{
- /* rvalue is the pointer to space for return value in closure assembly */
- /* pgr is the pointer to where r3-r10 are stored in ffi_closure_ASM */
- /* pfr is the pointer to where f1-f13 are stored in ffi_closure_ASM */
- /* pst is the pointer to outgoing parameter stack in original caller */
+ /* rvalue is the pointer to space for return value in closure assembly
+ pgr is the pointer to where r3-r10 are stored in ffi_closure_ASM
+ pfr is the pointer to where f1-f13 are stored in ffi_closure_ASM. */
+
void ** avalue;
ffi_type ** arg_types;
long i, avn;
- long nf; /* number of floating registers already used */
- long ng; /* number of general registers already used */
+ long nf; /* number of floating registers already used. */
+ long ng; /* number of general registers already used. */
ffi_cif * cif;
double temp;
+ unsigned size_al;
cif = closure->cif;
avalue = alloca(cif->nargs * sizeof(void *));
@@ -569,9 +590,9 @@ ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
returns the data directly to the caller. */
if (cif->rtype->type == FFI_TYPE_STRUCT)
{
- rvalue = (void *)pgr;
- ng++;
+ rvalue = (void *) *pgr;
pgr++;
+ ng++;
}
i = 0;
@@ -582,125 +603,93 @@ ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
while (i < avn)
{
switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- /* there are 8 gpr registers used to pass values */
- if (ng < 8) {
- avalue[i] = (((char *)pgr)+3);
- ng++;
- pgr++;
- } else {
- avalue[i] = (((char *)pst)+3);
- pst++;
- }
- break;
-
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- /* there are 8 gpr registers used to pass values */
- if (ng < 8) {
- avalue[i] = (((char *)pgr)+2);
- ng++;
- pgr++;
- } else {
- avalue[i] = (((char *)pst)+2);
- pst++;
- }
- break;
-
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_STRUCT:
- /* there are 8 gpr registers used to pass values */
- if (ng < 8) {
- avalue[i] = pgr;
- ng++;
- pgr++;
- } else {
- avalue[i] = pst;
- pst++;
- }
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- /* long long ints are passed in two gpr's if available or in
- * the pst, one place is a bit odd, when a long long passes
- * the boundary between gpr and pst area we have to increment
- * the pst by one.
- */
- if (ng < 7) {
- avalue[i] = pgr;
- ng+=2;
- pgr+=2;
- } else if (ng == 7) {
- avalue[i] = pgr;
- ng++;
- pgr++;
- pst++;
- } else {
- avalue[i] = pst;
- pst+=2;
- }
- break;
-
- case FFI_TYPE_FLOAT:
- /* a float value consumes a GPR
- *
- * there are 13 64bit floating point registers
- */
-
- if ((ng > 7) && (nf < 13)) {
- pst++;
- }
- if (nf < 13) {
- temp = *(double*)pfr;
- *(float*)pfr = (float)temp;
- avalue[i] = pfr;
- nf++;
- pfr+=2;
- ng++;
- pgr++;
-
- } else {
- avalue[i] = pst;
- nf++;
- pst++;
- }
- break;
-
- case FFI_TYPE_DOUBLE:
- /* a double value consumes two GPRs
- *
- * there are 13 64bit floating point registers
- */
-
- if ((ng == 7) && (nf < 13)) {
- pst++; /* if only one gpr is left the double steals it */
- } else if ((ng > 7) && (nf < 13)) {
- pst+=2; /* a double consumes two GPRs in Darwin/AIX */
- }
- if (nf < 13) {
- avalue[i] = pfr;
- nf++;
- pfr+=2;
- ng+=2;
- pgr+=2;
-
- } else {
- avalue[i] = pst;
- nf++;
- pst+=2;
- }
- break;
-
- default:
- FFI_ASSERT(0);
-
- }
+ {
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_UINT8:
+ avalue[i] = (char *) pgr + 3;
+ ng++;
+ pgr++;
+ break;
+
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_UINT16:
+ avalue[i] = (char *) pgr + 2;
+ ng++;
+ pgr++;
+ break;
+ case FFI_TYPE_SINT32:
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_POINTER:
+ avalue[i] = pgr;
+ ng++;
+ pgr++;
+ break;
+
+ case FFI_TYPE_STRUCT:
+ /* Structures that match the basic modes (QI 1 byte, HI 2 bytes,
+ SI 4 bytes) are aligned as if they were those modes. */
+ size_al = arg_types[i]->size;
+ /* If the first member of the struct is a double, then align
+ the struct to double-word.
+ Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */
+ if (arg_types[i]->elements[0]->type == 3)
+ size_al = ALIGN(arg_types[i]->size, 8);
+ if (size_al < 3 && cif->abi == FFI_DARWIN)
+ avalue[i] = (void*) pgr + 4 - size_al;
+ else
+ avalue[i] = (void*) pgr;
+ ng += (size_al + 3) / 4;
+ pgr += (size_al + 3) / 4;
+ break;
+
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_UINT64:
+ /* Long long ints are passed in two gpr's. */
+ avalue[i] = pgr;
+ ng += 2;
+ pgr += 2;
+ break;
+
+ case FFI_TYPE_FLOAT:
+ /* A float value consumes a GPR.
+ There are 13 64bit floating point registers. */
+ if (nf < NUM_FPR_ARG_REGISTERS)
+ {
+ temp = pfr->d;
+ pfr->f = (float)temp;
+ avalue[i] = pfr;
+ pfr++;
+ }
+ else
+ {
+ avalue[i] = pgr;
+ }
+ nf++;
+ ng++;
+ pgr++;
+ break;
+
+ case FFI_TYPE_DOUBLE:
+ /* A double value consumes two GPRs.
+ There are 13 64bit floating point registers. */
+ if (nf < NUM_FPR_ARG_REGISTERS)
+ {
+ avalue[i] = pfr;
+ pfr++;
+ }
+ else
+ {
+ avalue[i] = pgr;
+ }
+ nf++;
+ ng += 2;
+ pgr += 2;
+ break;
+
+ default:
+ FFI_ASSERT(0);
+ }
i++;
}
@@ -708,5 +697,4 @@ ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue,
/* Tell ffi_closure_ASM to perform return type promotions. */
return cif->rtype->type;
-
}
diff --git a/libffi/src/powerpc/linux64.S b/libffi/src/powerpc/linux64.S
index 28727cd01f8..22079807720 100644
--- a/libffi/src/powerpc/linux64.S
+++ b/libffi/src/powerpc/linux64.S
@@ -73,10 +73,10 @@ ffi_call_LINUX64:
ld %r5, -32-(6*8)(%r28)
ld %r6, -32-(5*8)(%r28)
bf- 5, 1f
- ld %r7, -32-(4*4)(%r28)
- ld %r8, -32-(3*4)(%r28)
- ld %r9, -32-(2*4)(%r28)
- ld %r10, -32-(1*4)(%r28)
+ ld %r7, -32-(4*8)(%r28)
+ ld %r8, -32-(3*8)(%r28)
+ ld %r9, -32-(2*8)(%r28)
+ ld %r10, -32-(1*8)(%r28)
1:
/* Load all the FP registers. */
@@ -95,17 +95,6 @@ ffi_call_LINUX64:
lfd %f12, -32-(10*8)(%r28)
lfd %f13, -32-(9*8)(%r28)
2:
- /* FIXME: Shouldn't gcc use %r3-%r10 in this case
- and not the parm save area? */
- std %r3, 48+(0*8)(%r1)
- std %r4, 48+(1*8)(%r1)
- std %r5, 48+(2*8)(%r1)
- std %r6, 48+(3*8)(%r1)
- std %r7, 48+(4*8)(%r1)
- std %r8, 48+(5*8)(%r1)
- std %r9, 48+(6*8)(%r1)
- std %r10, 48+(7*8)(%r1)
- /* end of FIXME. */
/* Make the call. */
bctrl
diff --git a/libffi/src/powerpc/linux64_closure.S b/libffi/src/powerpc/linux64_closure.S
index 1159c1e77a8..2d44d67c20f 100644
--- a/libffi/src/powerpc/linux64_closure.S
+++ b/libffi/src/powerpc/linux64_closure.S
@@ -64,6 +64,7 @@ ffi_closure_LINUX64:
# make the call
bl .ffi_closure_helper_LINUX64
+.Lret:
# now r3 contains the return type
# so use it to look up in a table
@@ -71,10 +72,10 @@ ffi_closure_LINUX64:
# look up the proper starting point in table
# by using return type as offset
- addi %r5, %r1, 112 # get pointer to results area
- bl .Lget_ret_type0_addr # get pointer to .Lret_type0 into LR
- mflr %r4 # move to r4
+ mflr %r4 # move address of .Lret to r4
sldi %r3, %r3, 4 # now multiply return type by 16
+ addi %r4, %r4, .Lret_type0 - .Lret
+ ld %r0, 224+16(%r1)
add %r3, %r3, %r4 # add contents of table to table address
mtctr %r3
bctr # jump to it
@@ -84,94 +85,84 @@ ffi_closure_LINUX64:
# first.
.align 4
- nop
- nop
- nop
-.Lget_ret_type0_addr:
- blrl
-
.Lret_type0:
# case FFI_TYPE_VOID
- b .Lfinish
- nop
- nop
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
nop
# case FFI_TYPE_INT
- lwa %r3, 4(%r5)
- b .Lfinish
- nop
- nop
+ lwa %r3, 112+4(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_FLOAT
- lfs %f1, 4(%r5)
- b .Lfinish
- nop
- nop
+ lfs %f1, 112+0(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_DOUBLE
- lfd %f1, 0(%r5)
- b .Lfinish
- nop
- nop
+ lfd %f1, 112+0(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_LONGDOUBLE
- lfd %f1, 0(%r5)
- b .Lfinish
- nop
- nop
+ lfd %f1, 112+0(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_UINT8
- lbz %r3, 7(%r5)
- b .Lfinish
- nop
- nop
+ lbz %r3, 112+7(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_SINT8
- lbz %r3, 7(%r5)
+ lbz %r3, 112+7(%r1)
extsb %r3,%r3
+ mtlr %r0
b .Lfinish
- nop
# case FFI_TYPE_UINT16
- lhz %r3, 6(%r5)
- b .Lfinish
- nop
- nop
+ lhz %r3, 112+6(%r1)
+ mtlr %r0
+.Lfinish:
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_SINT16
- lha %r3, 6(%r5)
- b .Lfinish
- nop
- nop
+ lha %r3, 112+6(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_UINT32
- lwz %r3, 4(%r5)
- b .Lfinish
- nop
- nop
+ lwz %r3, 112+4(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_SINT32
- lwa %r3, 4(%r5)
- b .Lfinish
- nop
- nop
+ lwa %r3, 112+4(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_UINT64
- ld %r3, 0(%r5)
- b .Lfinish
- nop
- nop
+ ld %r3, 112+0(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_SINT64
- ld %r3, 0(%r5)
- b .Lfinish
- nop
- nop
+ ld %r3, 112+0(%r1)
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
# case FFI_TYPE_STRUCT
- b .Lfinish
- nop
- nop
+ mtlr %r0
+ addi %r1, %r1, 224
+ blr
nop
# case FFI_TYPE_POINTER
- ld %r3, 0(%r5)
- b .Lfinish
- nop
- nop
-# esac
-.Lfinish:
- ld %r0, 224+16(%r1)
+ ld %r3, 112+0(%r1)
mtlr %r0
addi %r1, %r1, 224
blr
+# esac
.LFE1:
.long 0
.byte 0,12,0,1,128,0,0,0
diff --git a/libffi/src/prep_cif.c b/libffi/src/prep_cif.c
index d3c89c365e9..d60d98ee9f5 100644
--- a/libffi/src/prep_cif.c
+++ b/libffi/src/prep_cif.c
@@ -64,6 +64,15 @@ static ffi_status initialize_aggregate(/*@out@*/ ffi_type *arg)
ptr++;
}
+ /* Structure size includes tail padding. This is important for
+ structures that fit in one register on ABIs like the PowerPC64
+ Linux ABI that right justify small structs in a register.
+ It's also needed for nested structure layout, for example
+ struct A { long a; char b; }; struct B { struct A x; char y; };
+ should find y at an offset of 2*sizeof(long) and result in a
+ total size of 3*sizeof(long). */
+ arg->size = ALIGN (arg->size, arg->alignment);
+
if (arg->size == 0)
return FFI_BAD_TYPEDEF;
else
diff --git a/libffi/src/sh/ffi.c b/libffi/src/sh/ffi.c
index eb594460dd2..8aa96a1e14f 100644
--- a/libffi/src/sh/ffi.c
+++ b/libffi/src/sh/ffi.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2002 Kaz Kojima
+ ffi.c - Copyright (c) 2002, 2003 Kaz Kojima
SuperH Foreign Function Interface
@@ -220,7 +220,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
greg += n;
#endif
memcpy (argp, *p_argv, z);
- argp += z;
+ argp += n * sizeof (int);
}
}
@@ -315,7 +315,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
}
#endif
memcpy (argp, *p_argv, z);
- argp += z;
+ argp += n * sizeof (int);
}
}
@@ -507,7 +507,7 @@ ffi_prep_closure (ffi_closure* closure,
#ifdef __LITTLE_ENDIAN__
#define OFS_INT8 0
-#define OFS_INT16 2
+#define OFS_INT16 0
#else
#define OFS_INT8 3
#define OFS_INT16 2
@@ -533,10 +533,10 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
/* Copy the caller's structure return value address so that the closure
returns the data directly to the caller. */
- if (cif->rtype->type == FFI_TYPE_STRUCT)
+ if (cif->rtype->type == FFI_TYPE_STRUCT && STRUCT_VALUE_ADDRESS_WITH_ARG)
{
rvalue = *pgr++;
- ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0;
+ ireg = 1;
}
else
ireg = 0;
@@ -717,6 +717,6 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
(closure->fun) (cif, rvalue, avalue, closure->user_data);
- /* Tell ffi_closure_osf how to perform return type promotions. */
- return cif->rtype->type;
+ /* Tell ffi_closure_SYSV how to perform return type promotions. */
+ return return_type (cif->rtype);
}
diff --git a/libffi/src/sh/sysv.S b/libffi/src/sh/sysv.S
index 40c14e2d208..ab98a8af433 100644
--- a/libffi/src/sh/sysv.S
+++ b/libffi/src/sh/sysv.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2002 Kaz Kojima
+ sysv.S - Copyright (c) 2002, 2003 Kaz Kojima
SuperH Foreign Function Interface
@@ -505,21 +505,22 @@ ENTRY(ffi_closure_SYSV)
...
32 bytes (floating register parameters, SH-4 only)
16 bytes (register parameters)
- 4 bytes (result)
+ 8 bytes (result)
+ 4 bytes (pad)
4 bytes (5th arg)
<- new stack pointer
*/
.LCFI8:
#if defined(__SH4__)
- add #-56,r15
+ add #-64,r15
#else
- add #-24,r15
+ add #-32,r15
#endif
.LCFI9:
mov r15,r14
.LCFIA:
mov r14,r1
- add #24,r1
+ add #32,r1
mov.l r7,@-r1
mov.l r6,@-r1
mov.l r5,@-r1
@@ -528,7 +529,7 @@ ENTRY(ffi_closure_SYSV)
#if defined(__SH4__)
mov r14,r1
- add #56,r1
+ add #64,r1
#ifdef __LITTLE_ENDIAN__
fmov.s fr10,@-r1
fmov.s fr11,@-r1
@@ -552,14 +553,14 @@ ENTRY(ffi_closure_SYSV)
#endif
mov r14,r1
- add #4,r1
+ add #8,r1
mov r1,r5
mov r14,r1
#if defined(__SH4__)
- add #64,r1
+ add #72,r1
#else
- add #32,r1
+ add #40,r1
#endif
mov.l r1,@r14
@@ -574,7 +575,7 @@ ENTRY(ffi_closure_SYSV)
mov.w @r0,r0
mov r14,r2
braf r0
- add #4,r2
+ add #8,r2
0:
.align 2
L_helper:
@@ -664,9 +665,9 @@ L_case_uh:
L_case_v:
#if defined(__SH4__)
- add #56,r15
+ add #64,r15
#else
- add #24,r15
+ add #32,r15
#endif
lds.l @r15+,pr
rts
@@ -757,9 +758,9 @@ __FRAME_BEGIN__:
.4byte .LCFI9-.LCFI8
.byte 0xe /* DW_CFA_def_cfa_offset */
#if defined(__SH4__)
- .byte 8+56 /* uleb128 8+56 */
+ .byte 8+64 /* uleb128 8+64 */
#else
- .byte 8+24 /* uleb128 8+24 */
+ .byte 8+32 /* uleb128 8+32 */
#endif
.byte 0x91 /* DW_CFA_offset, column 0x11 */
.byte 0x2
diff --git a/libffi/src/sparc/ffi.c b/libffi/src/sparc/ffi.c
index 573fc84ee5a..3c71771f745 100644
--- a/libffi/src/sparc/ffi.c
+++ b/libffi/src/sparc/ffi.c
@@ -494,7 +494,7 @@ ffi_closure_sparc_inner(ffi_closure *closure,
argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG;
#ifdef SPARC64
- if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT
+ if (i < 16 && (arg_types[i]->type == FFI_TYPE_FLOAT
|| arg_types[i]->type == FFI_TYPE_DOUBLE
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|| arg_types[i]->type == FFI_TYPE_LONGDOUBLE
diff --git a/libffi/src/sparc/v9.S b/libffi/src/sparc/v9.S
index e2eeb439eed..20ce0f4b57f 100644
--- a/libffi/src/sparc/v9.S
+++ b/libffi/src/sparc/v9.S
@@ -126,9 +126,9 @@ dostruct:
.size ffi_call_V9,.ffi_call_V9_end-ffi_call_V9
-#define STACKFRAME 240 /* 16*8 register window +
+#define STACKFRAME 320 /* 16*8 register window +
6*8 args backing store +
- 8*8 locals */
+ 18*8 locals */
#define FP %fp+STACK_BIAS
/* ffi_closure_v9(...)
@@ -153,19 +153,29 @@ ffi_closure_v9:
stx %i5, [FP+128+40]
! Store possible floating point argument registers too.
- std %f0, [FP-48]
- std %f2, [FP-40]
- std %f4, [FP-32]
- std %f6, [FP-24]
- std %f8, [FP-16]
- std %f10, [FP-8]
+ std %f0, [FP-128]
+ std %f2, [FP-120]
+ std %f4, [FP-112]
+ std %f6, [FP-104]
+ std %f8, [FP-96]
+ std %f10, [FP-88]
+ std %f12, [FP-80]
+ std %f14, [FP-72]
+ std %f16, [FP-64]
+ std %f18, [FP-56]
+ std %f20, [FP-48]
+ std %f22, [FP-40]
+ std %f24, [FP-32]
+ std %f26, [FP-24]
+ std %f28, [FP-16]
+ std %f30, [FP-8]
! Call ffi_closure_sparc_inner to do the bulk of the work.
mov %g1, %o0
- add %fp, STACK_BIAS-64, %o1
+ add %fp, STACK_BIAS-144, %o1
add %fp, STACK_BIAS+128, %o2
call ffi_closure_sparc_inner
- add %fp, STACK_BIAS-48, %o3
+ add %fp, STACK_BIAS-128, %o3
! Load up the return value in the proper type.
cmp %o0, FFI_TYPE_VOID
@@ -173,33 +183,33 @@ ffi_closure_v9:
cmp %o0, FFI_TYPE_FLOAT
be,a,pn %icc, done1
- ld [FP-64], %f0
+ ld [FP-144], %f0
cmp %o0, FFI_TYPE_DOUBLE
be,a,pn %icc, done1
- ldd [FP-64], %f0
+ ldd [FP-144], %f0
cmp %o0, FFI_TYPE_LONGDOUBLE
be,a,pn %icc, longdouble1
- ldd [FP-64], %f0
+ ldd [FP-144], %f0
cmp %o0, FFI_TYPE_STRUCT
be,pn %icc, struct1
! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER
- ldx [FP-64], %i0
+ ldx [FP-144], %i0
done1:
ret
restore
struct1:
- ldx [FP-56], %i2
+ ldx [FP-136], %i2
ret
restore
longdouble1:
- ldd [FP-56], %f2
+ ldd [FP-136], %f2
ret
restore
.LLFE2:
diff --git a/libffi/src/types.c b/libffi/src/types.c
index ae52f11f78c..725df348c92 100644
--- a/libffi/src/types.c
+++ b/libffi/src/types.c
@@ -76,12 +76,7 @@ FFI_INTEGRAL_TYPEDEF(sint64, 8, 8, FFI_TYPE_SINT64);
FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
-#elif defined ARM
-
-FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
-FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
-
-#elif defined SH
+#elif defined ARM || defined SH || defined POWERPC64 || defined POWERPC_AIX || defined POWERPC_DARWIN
FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index f26593fc081..4b4cc2fca5a 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,65 @@
+2003-09-22 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.c (floatformat_i387_ext_is_valid): New function.
+ (floatformat_always_valid): New function.
+ (floatformat_i387_ext): Initialize new "is_valid" field to
+ "floatformat_i387_ext_is_valid".
+ (floatformat_ieee_single_little): Initialize "is_valid" field to
+ floatformat_always_valid.
+ (floatformat_ieee_double_big): Ditto.
+ (floatformat_ieee_double_little): Ditto.
+ (floatformat_ieee_double_little): Ditto.
+ (floatformat_ieee_double_littlebyte_bigword): Ditto.
+ (floatformat_i960_ext): Ditto.
+ (floatformat_m88110_ext): Ditto.
+ (floatformat_m88110_harris_ext): Ditto.
+ (floatformat_arm_ext_big): Ditto.
+ (floatformat_arm_ext_littlebyte_bigword): Ditto.
+ (floatformat_ia64_spill_big): Ditto.
+ (floatformat_ia64_spill_little): Ditto.
+ (floatformat_ia64_quad_big): Ditto.
+ (floatformat_ia64_quad_little): Ditto.
+ (floatformat_ia64_quad_little): Ditto.
+ (floatformat_is_valid): Call "is_valid".
+
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.c (get_field): Make "data" constant.
+ (floatformat_is_valid, floatformat_to_double): Make "from"
+ constant, fix casts.
+ (floatformat_from_double): Make "from" constant.
+
+2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * floatformat.c (floatformat_is_valid): New function.
+ (get_field, put_field): Correct comments.
+
+2003-09-06 Josef Zlomek <zlomekj@suse.cz>
+
+ * fibheap.c (fibheap_replace_key_data): Change type of OKEY to
+ FIBHEAPKEY_T.
+
+2003-09-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR bootstrap/12100
+ * aclocal.m4 (AC_LANG_FUNC_LINK_TRY): Define.
+ * configure: Rebuilt.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * aclocal.m4: Include acx.m4 and no-executables.m4.
+ (libiberty_AC_FUNC_STRNCMP): Use AC_LIBOBJ.
+ (LIB_AC_PROG_CC): Remove.
+ * configure.in: Update AC_PREREQ to 2.57. Use GCC_NO_EXECUTABLES.
+ Use AC_PROG_CC and set ac_libiberty_warn_cflags instead of using
+ LIB_AC_PROG_CC. Use AC_LIBOBJ. Call AC_ISC_POSIX later, only if
+ performing link tests.
+ * configure: Regenerated.
+
+2003-08-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * cp-demangle.c: Clarify what package(s) this is part of.
+
2003-07-05 Danny Smith <dannysmith@users.sourceforge.net>
* pex-win32.c (pexecute): Mark parameters this_pname and
diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index a3349f3b08f..f33e0c6218d 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -1,4 +1,6 @@
sinclude(../config/accross.m4)
+sinclude(../config/acx.m4)
+sinclude(../config/no-executables.m4)
dnl See whether strncmp reads past the end of its string parameters.
dnl On some versions of SunOS4 at least, strncmp reads a word at a time
@@ -71,7 +73,7 @@ main ()
ac_cv_func_strncmp_works=no)
rm -f core core.* *.core])
if test $ac_cv_func_strncmp_works = no ; then
- LIBOBJS="$LIBOBJS strncmp.o"
+ AC_LIBOBJ([strncmp])
fi
])
@@ -118,48 +120,6 @@ if test $libiberty_cv_decl_needed_$1 = yes; then
fi
])dnl
-# FIXME: We temporarily define our own version of AC_PROG_CC. This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable. This should really be fixed in autoconf
-# itself.
-
-AC_DEFUN(LIB_AC_PROG_CC,
-[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_PROVIDE([AC_PROG_CC])
-AC_CHECK_PROG(CC, gcc, gcc)
-if test -z "$CC"; then
- AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
- test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-fi
-
-AC_PROG_CC_GNU
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
-dnl Check whether -g works, even if CFLAGS is set, in case the package
-dnl plays around with CFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- ac_libiberty_warn_cflags=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-AC_SUBST(ac_libiberty_warn_cflags)
-])
-
# Work around a bug in autoheader. This can go away when we switch to
# autoconf >2.50. The use of define instead of AC_DEFUN is
# deliberate.
@@ -220,3 +180,52 @@ AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown])
])
+
+# AC_LANG_FUNC_LINK_TRY(C)(FUNCTION)
+# ----------------------------------
+# Don't include <ctype.h> because on OSF/1 3.0 it includes
+# <sys/types.h> which includes <sys/select.h> which contains a
+# prototype for select. Similarly for bzero.
+#
+# This test used to merely assign f=$1 in main(), but that was
+# optimized away by HP unbundled cc A.05.36 for ia64 under +O3,
+# presumably on the basis that there's no need to do that store if the
+# program is about to exit. Conversely, the AIX linker optimizes an
+# unused external declaration that initializes f=$1. So this test
+# program has both an external initialization of f, and a use of f in
+# main that affects the exit status.
+#
+m4_define([AC_LANG_FUNC_LINK_TRY(C)],
+[AC_LANG_PROGRAM(
+[/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $1 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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 $1 ();
+/* 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_$1) || defined (__stub___$1)
+choke me
+#else
+char (*f) () = $1;
+#endif
+#ifdef __cplusplus
+}
+#endif
+], [return f != $1;])])
+
diff --git a/libiberty/configure b/libiberty/configure
index 77d5170a877..98a641e8ab0 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1,40 +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
+}
+
+
+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
-# Defaults:
-ac_help=
+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
- --with-target-subdir=SUBDIR Configuring in a subdirectory for target"
-ac_help="$ac_help
- --with-build-subdir=SUBDIR Configuring in a subdirectory for build"
-ac_help="$ac_help
- --with-cross-host=HOST Configuring with a cross compiler"
-ac_help="$ac_help
- --with-newlib Configuring with newlib"
-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-install-libiberty Install headers for end users"
+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="xmalloc.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 libiberty_topdir MAINT NOTMAINT MAKEINFO BUILD_INFO PERL HAVE_PERL build build_cpu build_vendor build_os host host_cpu host_vendor host_os AR ac_ct_AR RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ac_libiberty_warn_cflags NO_MINUS_C_MINUS_O OUTPUT_OPTION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LIBOBJS CHECK target_header_dir pexecute INSTALL_DEST LTLIBOBJS'
+ac_subst_files='host_makefile_frag'
# 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
@@ -43,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'
@@ -60,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"
@@ -78,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- \
@@ -139,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 \
@@ -236,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 \
@@ -262,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 \
@@ -298,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)
@@ -308,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 \
@@ -319,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.
@@ -381,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=xmalloc.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=..
@@ -483,13 +726,442 @@ 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
+
+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
+
+ 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
+ --enable-install-libiberty Install headers for end users
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-target-subdir=SUBDIR Configuring in a subdirectory for target
+ --with-build-subdir=SUBDIR Configuring in a subdirectory for build
+ --with-cross-host=HOST Configuring with a cross compiler
+ --with-newlib Configuring with newlib
+
+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
@@ -500,39 +1172,103 @@ 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -542,30 +1278,30 @@ fi
# exported. We don't use libtool yet, but some day we might, so...
ORIGINAL_LD_FOR_MULTILIBS=$LD
+
# Check whether --with-target-subdir or --without-target-subdir was given.
if test "${with_target_subdir+set}" = set; then
withval="$with_target_subdir"
- :
-fi
+
+fi;
# Check whether --with-build-subdir or --without-build-subdir was given.
if test "${with_build_subdir+set}" = set; then
withval="$with_build_subdir"
- :
-fi
+
+fi;
# Check whether --with-cross-host or --without-cross-host was given.
if test "${with_cross_host+set}" = set; then
withval="$with_cross_host"
- :
-fi
+
+fi;
# Check whether --with-newlib or --without-newlib was given.
if test "${with_newlib+set}" = set; then
withval="$with_newlib"
- :
-fi
+fi;
if test "${srcdir}" = "."; then
if test -n "${with_build_subdir}"; then
@@ -594,29 +1330,35 @@ for ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; 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 $libiberty_topdir $srcdir/$libiberty_topdir" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" >&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.
-echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:610: 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"
maintainer_mode=$enableval
else
maintainer_mode=no
-fi
+fi;
-
-echo "$ac_t""$maintainer_mode" 1>&6
+echo "$as_me:$LINENO: result: $maintainer_mode" >&5
+echo "${ECHO_T}$maintainer_mode" >&6
if test "$maintainer_mode" = "yes"; then
MAINT=''
@@ -630,31 +1372,37 @@ fi
# rely on it - libiberty is built before texinfo.
# 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:635: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+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_MAKEINFO+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$MAKEINFO"; then
ac_cv_prog_MAKEINFO="$MAKEINFO" # 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_MAKEINFO="makeinfo"
- 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_MAKEINFO="makeinfo"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-MAKEINFO="$ac_cv_prog_MAKEINFO"
+MAKEINFO=$ac_cv_prog_MAKEINFO
if test -n "$MAKEINFO"; then
- echo "$ac_t""$MAKEINFO" 1>&6
+ echo "$as_me:$LINENO: result: $MAKEINFO" >&5
+echo "${ECHO_T}$MAKEINFO" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test "x$MAKEINFO" = "x"; then
@@ -666,8 +1414,10 @@ else
x*\ [1-3].* )
MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
BUILD_INFO=
- echo "configure: warning:
-*** Makeinfo is too old. Info documentation will not be built." 1>&2
+ { echo "$as_me:$LINENO: WARNING:
+*** Makeinfo is too old. Info documentation will not be built." >&5
+echo "$as_me: WARNING:
+*** Makeinfo is too old. Info documentation will not be built." >&2;}
;;
esac
fi
@@ -676,31 +1426,37 @@ fi
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:681: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_PERL'+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_PERL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$PERL"; then
ac_cv_prog_PERL="$PERL" # 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_PERL="perl"
- 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_PERL="perl"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-PERL="$ac_cv_prog_PERL"
+PERL=$ac_cv_prog_PERL
if test -n "$PERL"; then
- echo "$ac_t""$PERL" 1>&6
+ echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test x"$PERL" = x""; then
@@ -710,324 +1466,1195 @@ else
fi
-
# 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:721: checking host system type" >&5
+$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; }; }
-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 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; }; }
-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
+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; }; }
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:744: checking build system type" >&5
+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/'`
-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
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
-else
- ac_tool_prefix=
-fi
-# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:770: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR'+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_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
- 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_AR="${ac_tool_prefix}ar"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+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"
+AR=$ac_cv_prog_AR
if test -n "$AR"; then
- echo "$ac_t""$AR" 1>&6
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&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_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
+
+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
-# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:802: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+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_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
- 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"
+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"
+RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&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_RANLIB"; then
-if test -n "$ac_tool_prefix"; 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:834: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+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_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.
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+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
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+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 "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ RANLIB=$ac_ct_RANLIB
else
- RANLIB=":"
-fi
+ RANLIB="$ac_cv_prog_RANLIB"
fi
-# 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:871: 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:901: 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
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
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
+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
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:950: 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
+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
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:959: \"$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: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ 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
+
+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
- ac_cv_prog_gcc=no
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ 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
+# FIXME: Cleanup?
+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
+ gcc_no_link=no
+else
+ gcc_no_link=yes
+fi
+
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+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
+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
+ 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 "$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
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
- 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:975: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+fi
+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
- ac_cv_prog_cc_g=no
+ 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*
+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. */
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+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 "$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
+
+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
+ 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
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+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
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
CFLAGS="-O2"
+ else
+ CFLAGS=
fi
+fi
+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
- GCC=
- ac_libiberty_warn_cflags=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ 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
+
+
+if test x$GCC = xyes; then
+ ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
+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:1007: checking whether $CC and cc understand -c and -o together" >&5
+ echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6
else
- echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
-echo "configure:1010: checking whether cc understands -c and -o together" >&5
+ echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6
fi
-set dummy $CC; ac_cc="`echo $2 |
- sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
-if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+set dummy $CC; ac_cc=`echo $2 |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo 'foo(){}' > conftest.c
+ 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
# Make sure it works both with $CC and with simple cc.
# 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:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+if { (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); } &&
+ test -f 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 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:1028: \"$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:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { (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_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+ if { (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); } &&
+ test -f 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
# cc works too.
:
@@ -1044,12 +2671,15 @@ rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cat >>confdefs.h <<\_ACEOF
#define NO_MINUS_C_MINUS_O 1
-EOF
+_ACEOF
fi
@@ -1062,198 +2692,260 @@ fi
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1067: checking for POSIXized ISC" >&5
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
-then
- echo "$ac_t""yes" 1>&6
- ISC=yes # If later tests want to check for ISC.
- cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- 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
- echo "$ac_t""no" 1>&6
- ISC=
-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. */
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1088: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1093 "configure"
-#include "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
-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;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
+ ;
+ return 0;
}
-{ /* 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;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:1142: \"$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_const=yes
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
+
+ac_cv_c_const=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+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:1163: 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 1170 "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:1177: \"$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
-echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1203: 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 1210 "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:1221: \"$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 1225 "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:1236: \"$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
-else
- cat > conftest.$ac_ext <<EOF
-#line 1256 "configure"
-#include "confdefs.h"
+ echo $ac_n "cross-compiling... " 2>&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. */
main () {
/* Are we little or big endian? From Harbison&Steele. */
union
@@ -1264,26 +2956,36 @@ main () {
u.l = 1;
exit (u.c[sizeof (long) - 1] == 1);
}
-EOF
-if { (eval echo configure:1269: \"$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:1287: 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 };
@@ -1311,32 +3013,39 @@ 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
+ ac_config_headers="$ac_config_headers config.h:config.in"
@@ -1347,60 +3056,73 @@ 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:1356: 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'
@@ -1412,278 +3134,318 @@ host_makefile_frag=${frag}
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1417: checking how to run the C preprocessor" >&5
+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
-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"
+ 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.
- cat > conftest.$ac_ext <<EOF
-#line 1432 "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:1438: \"$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 1449 "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:1455: \"$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 1466 "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:1472: \"$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*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
else
- ac_cv_prog_CPP="$CPP"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-echo "$ac_t""$CPP" 1>&6
+rm -f conftest.err conftest.$ac_ext
-for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1500: 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 1505 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1510: \"$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"
+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*
+
+ done
+ ac_cv_prog_CPP=$CPP
+
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
-
+ CPP=$ac_cv_prog_CPP
else
- echo "$ac_t""no" 1>&6
+ ac_cv_prog_CPP=$CPP
fi
-done
-
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1537: 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 1542 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+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
-int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-; return 0; }
-EOF
-if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_sys_wait_h=yes
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_sys_wait_h=no
+ ac_cpp_err=yes
fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
-if test $ac_cv_header_sys_wait_h = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SYS_WAIT_H 1
-EOF
-
-fi
-
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1579: 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
+if test -z "$ac_cpp_err"; then
+ :
else
- cat > conftest.$ac_ext <<EOF
-#line 1584 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_time=yes
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_time=no
+ ac_cpp_err=yes
fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
- cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
+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
-
-echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
-echo "configure:1615: checking whether errno must be declared" >&5
-if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1620 "configure"
-#include "confdefs.h"
-#include <errno.h>
-int main() {
-int x = errno;
-; return 0; }
-EOF
-if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- libiberty_cv_declare_errno=no
+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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- libiberty_cv_declare_errno=yes
-fi
-rm -f conftest*
+ { { 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
-echo "$ac_t""$libiberty_cv_declare_errno" 1>&6
-if test $libiberty_cv_declare_errno = yes
-then cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_ERRNO 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
+
+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 $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1649: 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
+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 <<EOF
-#line 1654 "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>
#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:1662: \"$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 1679 "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*
@@ -1692,16 +3454,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 1697 "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*
@@ -1710,115 +3476,592 @@ 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 1718 "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:1729: \"$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
+
+# 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
-echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
-echo "configure:1753: checking for uintptr_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
+do
+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
- cat > conftest.$ac_ext <<EOF
-#line 1758 "configure"
-#include "confdefs.h"
+ 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 "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+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>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])uintptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_uintptr_t=yes
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_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_sys_wait_h=yes
else
- rm -rf conftest*
- ac_cv_type_uintptr_t=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_sys_wait_h=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+if test $ac_cv_header_sys_wait_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+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 <sys/time.h>
+#include <time.h>
+int
+main ()
+{
+if ((struct tm *) 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
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_time=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ac_cv_type_uintptr_t" 1>&6
-if test $ac_cv_type_uintptr_t = no; then
- cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking whether errno must be declared" >&5
+echo $ECHO_N "checking whether errno must be declared... $ECHO_C" >&6
+if test "${libiberty_cv_declare_errno+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 <errno.h>
+int
+main ()
+{
+int x = errno;
+ ;
+ 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
+ libiberty_cv_declare_errno=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+libiberty_cv_declare_errno=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $libiberty_cv_declare_errno" >&5
+echo "${ECHO_T}$libiberty_cv_declare_errno" >&6
+if test $libiberty_cv_declare_errno = yes
+then
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_ERRNO 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for uintptr_t" >&5
+echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6
+if test "${ac_cv_type_uintptr_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. */
+$ac_includes_default
+int
+main ()
+{
+if ((uintptr_t *) 0)
+ return 0;
+if (sizeof (uintptr_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_uintptr_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uintptr_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6
+if test $ac_cv_type_uintptr_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define uintptr_t unsigned long
-EOF
+_ACEOF
fi
# Given the above check, we always have uintptr_t or a fallback
# definition. So define HAVE_UINTPTR_T in case any imported code
# relies on it.
-cat >> confdefs.h <<\EOF
-#define HAVE_UINTPTR_T 1
-EOF
-
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1794: 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 1799 "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])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_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. */
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+ return 0;
+if (sizeof (pid_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_pid_t=yes
else
- rm -rf conftest*
- ac_cv_type_pid_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_pid_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
- cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define pid_t int
-EOF
+_ACEOF
fi
@@ -1884,7 +4127,70 @@ checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
- for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
memmove mempcpy memset putenv random rename rindex sigsetmask \
strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \
@@ -1894,70 +4200,108 @@ if test "x" = "y"; then
pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \
realpath canonicalize_file_name
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1899: 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 1904 "configure"
-#include "confdefs.h"
+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. */
-#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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_ERRLIST 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_NERR 1
-EOF
+_ACEOF
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_SIGLIST 1
-EOF
+_ACEOF
fi
@@ -1979,7 +4323,12 @@ if test -n "${with_target_subdir}"; then
# newlib provide and which ones we will be expected to provide.
if test "x${with_newlib}" = "xyes"; then
- LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
+ LIBOBJS="$LIBOBJS asprintf.$ac_objext"
+ LIBOBJS="$LIBOBJS basename.$ac_objext"
+ LIBOBJS="$LIBOBJS insque.$ac_objext"
+ LIBOBJS="$LIBOBJS random.$ac_objext"
+ LIBOBJS="$LIBOBJS strdup.$ac_objext"
+ LIBOBJS="$LIBOBJS vasprintf.$ac_objext"
for f in $funcs; do
case "$f" in
@@ -1987,9 +4336,9 @@ if test -n "${with_target_subdir}"; then
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define $n 1
-EOF
+_ACEOF
;;
esac
@@ -2015,17 +4364,16 @@ if test "${enable_install_libiberty+set}" = set; then
enable_install_libiberty=$enableval
else
enable_install_libiberty=no
-fi
-
+fi;
# Option parsed, now set things appropriately.
case x"$enable_install_libiberty" in
xyes|x)
target_header_dir=libiberty
;;
- xno)
+ xno)
target_header_dir=
;;
- *)
+ *)
# This could be sanity-checked in various ways...
target_header_dir="${enable_install_libiberty}"
;;
@@ -2062,8 +4410,16 @@ if test -z "${setobjs}"; then
# Handle VxWorks configuration specially, since on VxWorks the
# libraries are actually on the target board, not in the file
# system.
- LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
- LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
+ LIBOBJS="$LIBOBJS basename.$ac_objext"
+ LIBOBJS="$LIBOBJS getpagesize.$ac_objext"
+ LIBOBJS="$LIBOBJS insque.$ac_objext"
+ LIBOBJS="$LIBOBJS random.$ac_objext"
+ LIBOBJS="$LIBOBJS strcasecmp.$ac_objext"
+ LIBOBJS="$LIBOBJS strncasecmp.$ac_objext"
+ LIBOBJS="$LIBOBJS strdup.$ac_objext"
+ LIBOBJS="$LIBOBJS vfork.$ac_objext"
+ LIBOBJS="$LIBOBJS waitpid.$ac_objext"
+ LIBOBJS="$LIBOBJS vasprintf.$ac_objext"
for f in $funcs; do
case "$f" in
basename | getpagesize | insque | random | strcasecmp)
@@ -2072,9 +4428,9 @@ if test -z "${setobjs}"; then
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define $n 1
-EOF
+_ACEOF
;;
esac
@@ -2112,11 +4468,11 @@ if test -z "${setobjs}"; then
# missing.
# DJ - only if we're *building* cygwin, not just building *with* cygwin
-
+
if test -n "${with_target_subdir}"
then
funcs="`echo $funcs | sed -e 's/random//'`"
- LIBOBJS="$LIBOBJS random.o"
+ LIBOBJS="$LIBOBJS random.$ac_objext"
vars="`echo $vars | sed -e 's/sys_siglist//'`"
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
fi
@@ -2130,19 +4486,19 @@ if test -z "${setobjs}"; then
;;
*-*-uwin*)
- # Under some versions of uwin, vfork is notoriously buggy and the test
+ # Under some versions of uwin, vfork is notoriously buggy and the test
# can hang configure; on other versions, vfork exists just as a stub.
# FIXME: This should be removed once vfork in uwin's runtime is fixed.
ac_cv_func_vfork_works=no
# Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are
- # macros (actually, these are imported from a DLL, but the end effect
+ # macros (actually, these are imported from a DLL, but the end effect
# is the same), so the test below won't find them.
libiberty_cv_var_sys_nerr=yes
libiberty_cv_var_sys_errlist=yes
;;
*-*-*vms*)
- # Under VMS, vfork works very different than on Unix. The standard test
+ # Under VMS, vfork works very different than on Unix. The standard test
# won't work, and it isn't easily adaptable. It makes more sense to
# just force it.
ac_cv_func_vfork_works=yes
@@ -2152,205 +4508,354 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
- echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2157: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
+ echo "$as_me:$LINENO: checking for library containing strerror" >&5
+echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
+if test "${ac_cv_search_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_strerror=no
+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. */
-#line 2168 "configure"
-#include "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 strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ 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_strerror="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_strerror" = no; then
+ for ac_lib in cposix; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ 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. */
-main(){return(0);}
-EOF
-if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
+/* 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 strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ 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_strerror="-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
-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
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+echo "${ECHO_T}$ac_cv_search_strerror" >&6
+if test "$ac_cv_search_strerror" != no; then
+ test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
-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:2199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
- for ac_func in $funcs
+
+for ac_func in $funcs
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2206: 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 2211 "configure"
-#include "confdefs.h"
+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. */
-#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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
+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
+
+else
+ LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
fi
done
- echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2261: 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
+ echo "$as_me:$LINENO: checking whether alloca needs Cray hooks" >&5
+echo $ECHO_N "checking whether alloca needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2266 "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. */
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "webecray" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "webecray" >/dev/null 2>&1; then
ac_cv_os_cray=yes
else
- rm -rf conftest*
ac_cv_os_cray=no
fi
rm -f conftest*
fi
-
-echo "$ac_t""$ac_cv_os_cray" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&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:2291: 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 2296 "configure"
-#include "confdefs.h"
+ 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. */
-#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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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:2319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<EOF
+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 CRAY_STACKSEG_END $ac_func
-EOF
+_ACEOF
break
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2345: 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
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_stack_direction=0
else
- cat > conftest.$ac_ext <<EOF
-#line 2353 "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. */
find_stack_direction ()
{
static char *addr = 0;
@@ -2367,142 +4872,377 @@ main ()
{
exit (find_stack_direction() < 0);
}
-EOF
-if { (eval echo configure:2372: \"$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_stack_direction=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_c_stack_direction=-1
+ 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_stack_direction=-1
fi
-rm -fr conftest*
+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_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
-echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
-EOF
+_ACEOF
+
- ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2394: 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
+
+for ac_header in unistd.h vfork.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
- cat > conftest.$ac_ext <<EOF
-#line 2399 "configure"
-#include "confdefs.h"
-#include <vfork.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2404: \"$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"
+ 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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VFORK_H 1
-EOF
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-else
- echo "$ac_t""no" 1>&6
fi
-echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2429: 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:2435: 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 2440 "configure"
-#include "confdefs.h"
+done
+
+
+
+for ac_func in fork vfork
+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 vfork(); 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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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 vfork();
-
-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_vfork) || defined (__stub___vfork)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-vfork();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2463: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vfork=no"
-fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
+if test "x$ac_cv_func_fork" = xyes; then
+ echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+if test "${ac_cv_func_fork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_fork_works=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* By Ruediger Kuhlmann. */
+ #include <sys/types.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ /* Some systems only have a dummy stub for fork() */
+ int main ()
+ {
+ if (fork() < 0)
+ exit (1);
+ 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
+ ac_cv_func_fork_works=yes
+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_func_fork_works=no
+fi
+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_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
fi
-
ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+if test "${ac_cv_func_vfork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2485 "configure"
-#include "confdefs.h"
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_vfork_works=cross
+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. */
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#include <sys/wait.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
#endif
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
+#if HAVE_VFORK_H
+# include <vfork.h>
#endif
/* On some sparc systems, changes by the child to local and incoming
- argument registers are propagated back to the parent.
- The compiler is told about this with #include <vfork.h>,
- but some compilers (e.g. gcc -O) don't grok <vfork.h>.
- Test for this by using a static variable whose address
- is put into a register that is clobbered by the vfork. */
-static
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
#ifdef __cplusplus
sparc_address_test (int arg)
-#else
+# else
sparc_address_test (arg) int arg;
#endif
{
@@ -2520,25 +5260,27 @@ sparc_address_test (arg) int arg;
}
}
}
-main() {
+
+int
+main ()
+{
pid_t parent = getpid ();
pid_t child;
- sparc_address_test ();
+ sparc_address_test (0);
child = vfork ();
if (child == 0) {
- /* Here is another test for sparc vfork register problems.
- This test uses lots of local variables, at least
- as many local variables as main has allocated so far
- including compiler temporaries. 4 locals are enough for
- gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
- A buggy compiler should reuse the register of parent
- for one of the local variables, since it will think that
- parent can't possibly be used any more in this routine.
- Assigning to the local variable will thus munge parent
- in the parent process. */
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
pid_t
p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
@@ -2548,11 +5290,10 @@ main() {
|| p != p5 || p != p6 || p != p7)
_exit(1);
- /* On some systems (e.g. IRIX 3.3),
- vfork doesn't separate parent from child file descriptors.
- If the child closes a descriptor before it execs or exits,
- this munges the parent's descriptor as well.
- Test for this by closing stdout in the child. */
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
_exit(close(fileno(stdout)) != 0);
} else {
int status;
@@ -2575,279 +5316,470 @@ main() {
);
}
}
-EOF
-if { (eval echo configure:2580: \"$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_func_vfork_works=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_vfork_works=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_func_vfork_works=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
+echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=ac_cv_func_vfork
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
fi
-echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
-if test $ac_cv_func_vfork_works = no; then
- cat >> confdefs.h <<\EOF
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_VFORK 1
+_ACEOF
+
+else
+
+cat >>confdefs.h <<\_ACEOF
#define vfork fork
-EOF
+_ACEOF
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_FORK 1
+_ACEOF
fi
if test $ac_cv_func_vfork_works = no; then
- LIBOBJS="$LIBOBJS vfork.o"
+ LIBOBJS="$LIBOBJS vfork.$ac_objext"
fi
# We only need _doprnt if we might use it to implement v*printf.
if test $ac_cv_func_vprintf != yes \
|| test $ac_cv_func_vfprintf != yes \
|| test $ac_cv_func_vsprintf != yes; then
- for ac_func in _doprnt
+
+for ac_func in _doprnt
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2612: 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 2617 "configure"
-#include "confdefs.h"
+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. */
-#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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
+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
+
+else
+ LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
fi
done
else
- for ac_func in _doprnt
+
+for ac_func in _doprnt
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2670: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2675 "configure"
-#include "confdefs.h"
+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. */
-#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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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:2698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
for v in $vars; do
- echo $ac_n "checking for $v""... $ac_c" 1>&6
-echo "configure:2726: checking for $v" >&5
- if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2731 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for $v" >&5
+echo $ECHO_N "checking for $v... $ECHO_C" >&6
+ if eval "test \"\${libiberty_cv_var_$v+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. */
int *p;
-int main() {
+int
+main ()
+{
extern int $v []; p = $v;
-; return 0; }
-EOF
-if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "libiberty_cv_var_$v=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "libiberty_cv_var_$v=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "libiberty_cv_var_$v=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define $n 1
-EOF
+_ACEOF
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
done
# special check for _system_configuration because AIX <4.3.2 do not
# contain the `physmem' member.
- echo $ac_n "checking for external symbol _system_configuration""... $ac_c" 1>&6
-echo "configure:2765: checking for external symbol _system_configuration" >&5
- cat > conftest.$ac_ext <<EOF
-#line 2767 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5
+echo $ECHO_N "checking for external symbol _system_configuration... $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 <sys/systemcfg.h>
-int main() {
+int
+main ()
+{
double x = _system_configuration.physmem;
-; return 0; }
-EOF
-if { (eval echo configure:2774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
+ ;
+ 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
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE__SYSTEM_CONFIGURATION 1
-EOF
+_ACEOF
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+
- for ac_func in $checkfuncs
+for ac_func in $checkfuncs
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2792: 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 2797 "configure"
-#include "confdefs.h"
+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. */
-#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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
- echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:2845: checking whether canonicalize_file_name must be declared" >&5
-if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking whether canonicalize_file_name must be declared" >&5
+echo $ECHO_N "checking whether canonicalize_file_name must be declared... $ECHO_C" >&6
+if test "${libiberty_cv_decl_needed_canonicalize_file_name+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2850 "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 <stdio.h>
@@ -2864,27 +5796,43 @@ else
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-int main() {
+int
+main ()
+{
char *(*pfn) = (char *(*)) canonicalize_file_name
-; return 0; }
-EOF
-if { (eval echo configure:2872: \"$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
libiberty_cv_decl_needed_canonicalize_file_name=no
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- libiberty_cv_decl_needed_canonicalize_file_name=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+libiberty_cv_decl_needed_canonicalize_file_name=yes
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$libiberty_cv_decl_needed_canonicalize_file_name" 1>&6
+echo "$as_me:$LINENO: result: $libiberty_cv_decl_needed_canonicalize_file_name" >&5
+echo "${ECHO_T}$libiberty_cv_decl_needed_canonicalize_file_name" >&6
if test $libiberty_cv_decl_needed_canonicalize_file_name = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-EOF
+_ACEOF
fi
@@ -2900,112 +5848,264 @@ case "${host}" in
esac
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+if test x$gcc_no_link = xyes; then
+ if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+ ac_cv_func_mmap_fixed_mapped=no
+ fi
+fi
+if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+
+
+for ac_header in stdlib.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:2908: 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 2913 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2918: \"$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`
+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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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
+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_func in getpagesize
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2947: 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 2952 "configure"
-#include "confdefs.h"
+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. */
-#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. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# 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:2975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3000: 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
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_mmap_fixed_mapped=no
else
- cat > conftest.$ac_ext <<EOF
-#line 3008 "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. */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
/* Thanks to Mike Haertel and Jim Avera for this test.
Here is a matrix of mmap possibilities:
@@ -3019,47 +6119,34 @@ else
back from the file, nor mmap's back from the file at a different
address. (There have been systems where private was not correctly
implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
+ VM page cache was not coherent with the file system buffer cache
like early versions of FreeBSD and possibly contemporary NetBSD.)
For shared mappings, we should conversely verify that changes get
- propogated back to all the places they're supposed to be.
+ propagated back to all the places they're supposed to be.
Grep wants private fixed already mapped.
The main things grep needs to know about mmap are:
* does it exist and is it safe to write into the mmap'd area
* how to use it (BSD variants) */
-#include <sys/types.h>
+
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
#endif
/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-
+#if !HAVE_GETPAGESIZE
/* Assume that all systems that can run configure have sys/param.h. */
-# ifndef HAVE_SYS_PARAM_H
+# if !HAVE_SYS_PARAM_H
# define HAVE_SYS_PARAM_H 1
# endif
# ifdef _SC_PAGESIZE
# define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
-# ifdef HAVE_SYS_PARAM_H
+# if HAVE_SYS_PARAM_H
# include <sys/param.h>
# ifdef EXEC_PAGESIZE
# define getpagesize() EXEC_PAGESIZE
@@ -3086,111 +6173,114 @@ else
#endif /* no HAVE_GETPAGESIZE */
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
int
-main()
+main ()
{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize();
-
- /*
- * First, make a file with some known garbage in it.
- */
- data = malloc(pagesize);
- if (!data)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand();
- umask(0);
- fd = creat("conftestmmap", 0600);
- if (fd < 0)
- exit(1);
- if (write(fd, data, pagesize) != pagesize)
- exit(1);
- close(fd);
-
- /*
- * Next, try to mmap the file at a fixed address which
- * already has something else allocated at it. If we can,
- * also make sure that we see the same garbage.
- */
- fd = open("conftestmmap", O_RDWR);
- if (fd < 0)
- exit(1);
- data2 = malloc(2 * pagesize);
- if (!data2)
- exit(1);
- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit(1);
-
- /*
- * Finally, make sure that changes to the mapped area
- * do not percolate back to the file as seen by read().
- * (This is a bug on some variants of i386 svr4.0.)
- */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = malloc(pagesize);
- if (!data3)
- exit(1);
- if (read(fd, data3, pagesize) != pagesize)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit(1);
- close(fd);
- unlink("conftestmmap");
- exit(0);
-}
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
-EOF
-if { (eval echo configure:3161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+ pagesize = getpagesize ();
+
+ /* First, make a file with some known garbage in it. */
+ data = (char *) malloc (pagesize);
+ if (!data)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand ();
+ umask (0);
+ fd = creat ("conftest.mmap", 0600);
+ if (fd < 0)
+ exit (1);
+ if (write (fd, data, pagesize) != pagesize)
+ exit (1);
+ close (fd);
+
+ /* Next, try to mmap the file at a fixed address which already has
+ something else allocated at it. If we can, also make sure that
+ we see the same garbage. */
+ fd = open ("conftest.mmap", O_RDWR);
+ if (fd < 0)
+ exit (1);
+ data2 = (char *) malloc (2 * pagesize);
+ if (!data2)
+ exit (1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit (1);
+
+ /* Finally, make sure that changes to the mapped area do not
+ percolate back to the file as seen by read(). (This is a bug on
+ some variants of i386 svr4.0.) */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = (char *) malloc (pagesize);
+ if (!data3)
+ exit (1);
+ if (read (fd, data3, pagesize) != pagesize)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit (1);
+ close (fd);
+ 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
ac_cv_func_mmap_fixed_mapped=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_mmap_fixed_mapped=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_func_mmap_fixed_mapped=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
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
if test $ac_cv_func_mmap_fixed_mapped = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_MMAP 1
-EOF
+_ACEOF
fi
+rm -f conftest.mmap
+fi
-echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:3185: checking for working strncmp" >&5
-if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for working strncmp" >&5
+echo $ECHO_N "checking for working strncmp... $ECHO_C" >&6
+if test "${ac_cv_func_strncmp_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_strncmp_works=no
else
- cat > conftest.$ac_ext <<EOF
-#line 3193 "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. */
/* Test by Jim Wilson and Kaveh Ghazi.
Check whether strncmp reads past the end of its string parameters. */
@@ -3230,7 +6320,7 @@ main ()
dev_zero = open ("/dev/zero", O_RDONLY);
if (dev_zero < 0)
exit (1);
-
+
p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, dev_zero, 0);
if (p == (char *)-1)
@@ -3252,25 +6342,35 @@ main ()
exit (0);
}
-EOF
-if { (eval echo configure:3257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_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_func_strncmp_works=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_strncmp_works=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_func_strncmp_works=no
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core core.* *.core
fi
-
-echo "$ac_t""$ac_cv_func_strncmp_works" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_strncmp_works" >&5
+echo "${ECHO_T}$ac_cv_func_strncmp_works" >&6
if test $ac_cv_func_strncmp_works = no ; then
- LIBOBJS="$LIBOBJS strncmp.o"
+ LIBOBJS="$LIBOBJS strncmp.$ac_objext"
fi
@@ -3284,396 +6384,1167 @@ fi
# We need multilib support, but only if configuring for the target.
-trap '' 1 2 15
-cat > confcache <<\EOF
+ ac_config_files="$ac_config_files Makefile testsuite/Makefile"
+ ac_config_commands="$ac_config_commands default"
+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
+
+
+
+: ${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.
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+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
+
+
+# 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 testsuite/Makefile config.h:config.in" | 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
-# 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%@libiberty_topdir@%$libiberty_topdir%g
-s%@MAINT@%$MAINT%g
-s%@NOTMAINT@%$NOTMAINT%g
-s%@MAKEINFO@%$MAKEINFO%g
-s%@BUILD_INFO@%$BUILD_INFO%g
-s%@PERL@%$PERL%g
-s%@HAVE_PERL@%$HAVE_PERL%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%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
-s%@CC@%$CC%g
-s%@ac_libiberty_warn_cflags@%$ac_libiberty_warn_cflags%g
-s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
-s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-/@host_makefile_frag@/r $host_makefile_frag
-s%@host_makefile_frag@%%g
-s%@CPP@%$CPP%g
-s%@CHECK@%$CHECK%g
-s%@target_header_dir@%$target_header_dir%g
-s%@LIBOBJS@%$LIBOBJS%g
-s%@pexecute@%$pexecute%g
-s%@INSTALL_DEST@%$INSTALL_DEST%g
-CEOF
-EOF
+# 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
-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
+# 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
+ 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
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
+ 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 testsuite/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.
+#
+
+srcdir=${srcdir}
+host=${host}
+target=${target}
+with_target_subdir=${with_target_subdir}
+with_build_subdir=${with_build_subdir}
+with_multisubdir=${with_multisubdir}
+ac_configure_args="--enable-multilib ${ac_configure_args}"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
+libiberty_topdir=${libiberty_topdir}
+
+
+_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" ;;
+ "testsuite/Makefile" ) CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.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
- # 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,@libiberty_topdir@,$libiberty_topdir,;t t
+s,@MAINT@,$MAINT,;t t
+s,@NOTMAINT@,$NOTMAINT,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@BUILD_INFO@,$BUILD_INFO,;t t
+s,@PERL@,$PERL,;t t
+s,@HAVE_PERL@,$HAVE_PERL,;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,@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,@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,@ac_libiberty_warn_cflags@,$ac_libiberty_warn_cflags,;t t
+s,@NO_MINUS_C_MINUS_O@,$NO_MINUS_C_MINUS_O,;t t
+s,@OUTPUT_OPTION@,$OUTPUT_OPTION,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@CHECK@,$CHECK,;t t
+s,@target_header_dir@,$target_header_dir,;t t
+s,@pexecute@,$pexecute,;t t
+s,@INSTALL_DEST@,$INSTALL_DEST,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+/@host_makefile_frag@/r $host_makefile_frag
+s,@host_makefile_frag@,,;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; }; }; }
+
+ 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 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= ;;
+ 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:config.in"
-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"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
fi
-fi; done
+ 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; }; }; }
-EOF
-cat >> $CONFIG_STATUS <<EOF
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_build_subdir=${with_build_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
-libiberty_topdir=${libiberty_topdir}
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+#
+# 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
+ default ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
if test -n "$CONFIG_FILES"; then
if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
# FIXME: We shouldn't need to set ac_file
@@ -3681,10 +7552,37 @@ if test -n "$CONFIG_FILES"; then
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
. ${libiberty_topdir}/config-ml.in
fi
-fi
-exit 0
-EOF
+fi ;;
+ esac
+done
+_ACEOF
+
+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/libiberty/configure.in b/libiberty/configure.in
index 5dca13ed6f6..56e8a198321 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script
-AC_PREREQ(2.13)
+AC_PREREQ(2.57)
AC_INIT(xmalloc.c)
# This works around the fact that libtool configuration may change LD
@@ -99,7 +99,13 @@ dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
-LIB_AC_PROG_CC
+GCC_NO_EXECUTABLES
+AC_PROG_CC
+
+if test x$GCC = xyes; then
+ ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
+fi
+AC_SUBST(ac_libiberty_warn_cflags)
AC_PROG_CC_C_O
# autoconf is lame and doesn't give us any substitution variable for this.
@@ -111,7 +117,6 @@ fi
AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
-AC_ISC_POSIX
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN_CROSS
@@ -250,7 +255,12 @@ if test -n "${with_target_subdir}"; then
# newlib provide and which ones we will be expected to provide.
if test "x${with_newlib}" = "xyes"; then
- LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
+ AC_LIBOBJ([asprintf])
+ AC_LIBOBJ([basename])
+ AC_LIBOBJ([insque])
+ AC_LIBOBJ([random])
+ AC_LIBOBJ([strdup])
+ AC_LIBOBJ([vasprintf])
for f in $funcs; do
case "$f" in
@@ -318,8 +328,16 @@ if test -z "${setobjs}"; then
# Handle VxWorks configuration specially, since on VxWorks the
# libraries are actually on the target board, not in the file
# system.
- LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
- LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
+ AC_LIBOBJ([basename])
+ AC_LIBOBJ([getpagesize])
+ AC_LIBOBJ([insque])
+ AC_LIBOBJ([random])
+ AC_LIBOBJ([strcasecmp])
+ AC_LIBOBJ([strncasecmp])
+ AC_LIBOBJ([strdup])
+ AC_LIBOBJ([vfork])
+ AC_LIBOBJ([waitpid])
+ AC_LIBOBJ([vasprintf])
for f in $funcs; do
case "$f" in
basename | getpagesize | insque | random | strcasecmp)
@@ -366,7 +384,7 @@ if test -z "${setobjs}"; then
if test -n "${with_target_subdir}"
then
funcs="`echo $funcs | sed -e 's/random//'`"
- LIBOBJS="$LIBOBJS random.o"
+ AC_LIBOBJ([random])
vars="`echo $vars | sed -e 's/sys_siglist//'`"
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
fi
@@ -402,12 +420,12 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
- AC_PROG_CC_WORKS
+ AC_ISC_POSIX
AC_REPLACE_FUNCS($funcs)
libiberty_AC_FUNC_C_ALLOCA
AC_FUNC_VFORK
if test $ac_cv_func_vfork_works = no; then
- LIBOBJS="$LIBOBJS vfork.o"
+ AC_LIBOBJ([vfork])
fi
# We only need _doprnt if we might use it to implement v*printf.
if test $ac_cv_func_vprintf != yes \
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 5dcce5560ee..bd4882239fb 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2,9 +2,9 @@
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Alex Samuel <samuel@codesourcery.com>.
- This file is part of GNU CC.
+ This file is part of the libiberty library, which is part of GCC.
- This program is free software; you can redistribute it and/or modify
+ 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.
diff --git a/libiberty/fibheap.c b/libiberty/fibheap.c
index 36062d451a2..bcecf80251f 100644
--- a/libiberty/fibheap.c
+++ b/libiberty/fibheap.c
@@ -218,7 +218,7 @@ fibheap_replace_key_data (heap, node, key, data)
void *data;
{
void *odata;
- int okey;
+ fibheapkey_t okey;
fibnode_t y;
/* If we wanted to, we could actually do a real increase by redeleting and
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index d69024f7390..3589caad2d8 100644
--- a/libiberty/floatformat.c
+++ b/libiberty/floatformat.c
@@ -1,5 +1,5 @@
/* IEEE floating point support routines, for GDB, the GNU Debugger.
- Copyright (C) 1991, 1994, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1994, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -29,6 +29,22 @@ extern char *memcpy ();
extern char *memset ();
#endif
+static unsigned long get_field PARAMS ((const unsigned char *,
+ enum floatformat_byteorders,
+ unsigned int,
+ unsigned int,
+ unsigned int));
+static int floatformat_always_valid PARAMS ((const struct floatformat *fmt,
+ const char *from));
+
+static int
+floatformat_always_valid (fmt, from)
+ const struct floatformat *fmt;
+ const char *from;
+{
+ return 1;
+}
+
/* The odds that CHAR_BIT will be anything but 8 are low enough that I'm not
going to bother with trying to muck around with whether it is defined in
a system header, what we do if not, etc. */
@@ -39,25 +55,29 @@ const struct floatformat floatformat_ieee_single_big =
{
floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23,
floatformat_intbit_no,
- "floatformat_ieee_single_big"
+ "floatformat_ieee_single_big",
+ floatformat_always_valid
};
const struct floatformat floatformat_ieee_single_little =
{
floatformat_little, 32, 0, 1, 8, 127, 255, 9, 23,
floatformat_intbit_no,
- "floatformat_ieee_single_little"
+ "floatformat_ieee_single_little",
+ floatformat_always_valid
};
const struct floatformat floatformat_ieee_double_big =
{
floatformat_big, 64, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
- "floatformat_ieee_double_big"
+ "floatformat_ieee_double_big",
+ floatformat_always_valid
};
const struct floatformat floatformat_ieee_double_little =
{
floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
- "floatformat_ieee_double_little"
+ "floatformat_ieee_double_little",
+ floatformat_always_valid
};
/* floatformat for IEEE double, little endian byte order, with big endian word
@@ -67,34 +87,64 @@ const struct floatformat floatformat_ieee_double_littlebyte_bigword =
{
floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
- "floatformat_ieee_double_littlebyte_bigword"
+ "floatformat_ieee_double_littlebyte_bigword",
+ floatformat_always_valid
};
+static int floatformat_i387_ext_is_valid PARAMS ((const struct floatformat *fmt, const char *from));
+
+static int
+floatformat_i387_ext_is_valid (fmt, from)
+ const struct floatformat *fmt;
+ const char *from;
+{
+ /* In the i387 double-extended format, if the exponent is all ones,
+ then the integer bit must be set. If the exponent is neither 0
+ nor ~0, the intbit must also be set. Only if the exponent is
+ zero can it be zero, and then it must be zero. */
+ unsigned long exponent, int_bit;
+ const unsigned char *ufrom = (const unsigned char *) from;
+
+ exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
+ fmt->exp_start, fmt->exp_len);
+ int_bit = get_field (ufrom, fmt->byteorder, fmt->totalsize,
+ fmt->man_start, 1);
+
+ if ((exponent == 0) != (int_bit == 0))
+ return 0;
+ else
+ return 1;
+}
+
const struct floatformat floatformat_i387_ext =
{
floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
floatformat_intbit_yes,
- "floatformat_i387_ext"
+ "floatformat_i387_ext",
+ floatformat_i387_ext_is_valid
};
const struct floatformat floatformat_m68881_ext =
{
/* Note that the bits from 16 to 31 are unused. */
floatformat_big, 96, 0, 1, 15, 0x3fff, 0x7fff, 32, 64,
floatformat_intbit_yes,
- "floatformat_m68881_ext"
+ "floatformat_m68881_ext",
+ floatformat_always_valid
};
const struct floatformat floatformat_i960_ext =
{
/* Note that the bits from 0 to 15 are unused. */
floatformat_little, 96, 16, 17, 15, 0x3fff, 0x7fff, 32, 64,
floatformat_intbit_yes,
- "floatformat_i960_ext"
+ "floatformat_i960_ext",
+ floatformat_always_valid
};
const struct floatformat floatformat_m88110_ext =
{
floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
floatformat_intbit_yes,
- "floatformat_m88110_ext"
+ "floatformat_m88110_ext",
+ floatformat_always_valid
};
const struct floatformat floatformat_m88110_harris_ext =
{
@@ -102,58 +152,59 @@ const struct floatformat floatformat_m88110_harris_ext =
double, and the last 64 bits are wasted. */
floatformat_big,128, 0, 1, 11, 0x3ff, 0x7ff, 12, 52,
floatformat_intbit_no,
- "floatformat_m88110_ext_harris"
+ "floatformat_m88110_ext_harris",
+ floatformat_always_valid
};
const struct floatformat floatformat_arm_ext_big =
{
/* Bits 1 to 16 are unused. */
floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
floatformat_intbit_yes,
- "floatformat_arm_ext_big"
+ "floatformat_arm_ext_big",
+ floatformat_always_valid
};
const struct floatformat floatformat_arm_ext_littlebyte_bigword =
{
/* Bits 1 to 16 are unused. */
floatformat_littlebyte_bigword, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
floatformat_intbit_yes,
- "floatformat_arm_ext_littlebyte_bigword"
+ "floatformat_arm_ext_littlebyte_bigword",
+ floatformat_always_valid
};
const struct floatformat floatformat_ia64_spill_big =
{
floatformat_big, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64,
floatformat_intbit_yes,
- "floatformat_ia64_spill_big"
+ "floatformat_ia64_spill_big",
+ floatformat_always_valid
};
const struct floatformat floatformat_ia64_spill_little =
{
floatformat_little, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64,
floatformat_intbit_yes,
- "floatformat_ia64_spill_little"
+ "floatformat_ia64_spill_little",
+ floatformat_always_valid
};
const struct floatformat floatformat_ia64_quad_big =
{
floatformat_big, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
floatformat_intbit_no,
- "floatformat_ia64_quad_big"
+ "floatformat_ia64_quad_big",
+ floatformat_always_valid
};
const struct floatformat floatformat_ia64_quad_little =
{
floatformat_little, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
floatformat_intbit_no,
- "floatformat_ia64_quad_little"
+ "floatformat_ia64_quad_little",
+ floatformat_always_valid
};
-static unsigned long get_field PARAMS ((unsigned char *,
- enum floatformat_byteorders,
- unsigned int,
- unsigned int,
- unsigned int));
-
-/* Extract a field which starts at START and is LEN bytes long. DATA and
+/* Extract a field which starts at START and is LEN bits long. DATA and
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
static unsigned long
get_field (data, order, total_len, start, len)
- unsigned char *data;
+ const unsigned char *data;
enum floatformat_byteorders order;
unsigned int total_len;
unsigned int start;
@@ -207,10 +258,10 @@ get_field (data, order, total_len, start, len)
void
floatformat_to_double (fmt, from, to)
const struct floatformat *fmt;
- char *from;
+ const char *from;
double *to;
{
- unsigned char *ufrom = (unsigned char *)from;
+ const unsigned char *ufrom = (const unsigned char *)from;
double dto;
long exponent;
unsigned long mant;
@@ -273,7 +324,7 @@ static void put_field PARAMS ((unsigned char *, enum floatformat_byteorders,
unsigned int,
unsigned long));
-/* Set a field which starts at START and is LEN bytes long. DATA and
+/* Set a field which starts at START and is LEN bits long. DATA and
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
static void
put_field (data, order, total_len, start, len, stuff_to_put)
@@ -331,7 +382,7 @@ put_field (data, order, total_len, start, len, stuff_to_put)
void
floatformat_from_double (fmt, from, to)
const struct floatformat *fmt;
- double *from;
+ const double *from;
char *to;
{
double dfrom;
@@ -404,6 +455,16 @@ floatformat_from_double (fmt, from, to)
}
}
+/* Return non-zero iff the data at FROM is a valid number in format FMT. */
+
+int
+floatformat_is_valid (fmt, from)
+ const struct floatformat *fmt;
+ const char *from;
+{
+ return fmt->is_valid (fmt, from);
+}
+
#ifdef IEEE_DEBUG
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 265a4d16ac0..31d82a6f1cf 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,1613 @@
+2003-09-22 Anthony Green <green@redhat.com>
+
+ * configure.in (HAVE_USLEEP_DECL): Define for newlib build.
+ * configure: Rebuilt.
+
+2003-09-21 Ralph Loader <suckfish@ihug.co.nz>
+
+ PR java/12350:
+ * java/lang/StringBuffer.java (substring): Fix handling of shared flag.
+
+2003-09-22 Michael Koch <konqueror@gmx.de>
+
+ * jni.cc (_Jv_LookupJNIMethod): Remove workaround that should hide a
+ compiler warning but produces a different one now.
+
+2003-09-22 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetAddress.java:
+ Moves around some code, reformats and adds documentation.
+ No functional changes.
+
+2003-09-22 Michael Koch <konqueror@gmx.de>
+
+ * java/net/JarURLConnection.java
+ (JarURLConnection): Modifed code to match classpath more, fixed comment.
+ (getCertificates): Made it more error prone.
+ (getMainAttributes): Likewise.
+ (getAttributes): Implemented.
+ (getManifest): Reformatted code.
+
+2003-09-20 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/Component.java: Indentation cleanup from Classpath.
+
+2003-09-20 Dalibor Topic <robilad@kaffe.org>
+
+ * java/awt/BasicStroke.java (BasicStroke): Fixed illegal argument
+ checking to follow 1.4.2 spec.
+
+2003-08-11 Ingo Proetel <proetel@aicas.com>
+
+ * gnu/java/rmi/server/UnicastRef.java: make constructor public and check if serverobject
+ is compatible in case client and server are running in the same VM
+ (remerged from Classpath on 2003-09-20)
+
+2003-09-19 David Daney <ddaney@avtrex.com>
+
+ * java/lang/ref/Reference.java (clear): Set referent to null and
+ synchronize.
+
+2003-09-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/NIODatagramSocket.java,
+ gnu/java/nio/NIOSocket.java: New files.
+ * Makefile.am (ordinary_java_source_files):
+ Added gnu/java/nio/NIODatagramSocket.java and
+ gnu/java/nio/NIOSocket.java.
+ * Makefile.in: Regenerated.
+
+2003-09-19 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkDialogPeer.java (create()): Create a
+ top-level GTK window.
+ (getArgs): Add "title" property.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java (setResizable): Use
+ "allow_shrink" and "allow_grow" properties.
+ * java/awt/Dialog.java: Initialize resizable to true and change
+ comments accordingly. Initialize visible to false in
+ constructors.
+ * java/awt/Frame.java (dispose): Remove method.
+ * java/awt/Window.java (ownedWindows): New field.
+ (Window(Window,GraphicsConfiguration)): Add a weak reference to
+ owner's ownedWindows vector.
+ (finalize): Remove method.
+ (hide): Hide owned windows.
+ (dispose): Dispose of owned windows.
+ (getOwnedWindows): Implement.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: Remove
+ unused GtkArg code.
+ (set(String,boolean)): Clamp gboolean parameter to g_object_set
+ to TRUE or FALSE.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+ (create): Set window's size requisition.
+ (connectHooks): Fix indentation.
+ (setResizable): Remove function.
+ (static setBounds): Likewise.
+ (setBounds): Replace call to setBounds with GTK size requisition
+ and resize calls.
+
+2003-09-19 Mohan Embar <gnustuff@thisiscool.com>
+
+ * win32-threads.cc: (ensure_interrupt_event_initialized) New
+ function for lazy initialization of an auto-reset event.
+ (_Jv_CondWait) Added thread interrupt support.
+ (_Jv_ThreadInitData) Added initialization of interrupt support
+ members.
+ (_Jv_ThreadDestroyData) Added cleanup of interrupt support members.
+ (_Jv_ThreadStart) Removed unused code.
+ (_Jv_Win32GetInterruptEvent) New method for returning interrupt event
+ to an external caller.
+ (_Jv_ThreadInterrupt) Implemented.
+ * include/win32-threads.h: (_Jv_Thread_t) Added a Win32 auto-reset
+ event for interrupt support as well as a mutex which regulates
+ access to this.
+ (_Jv_Win32GetInterruptEvent) Declared new method for returning interrupt
+ event to an external caller.
+ * java/lang/natWin32Process.cc: (cleanup) Close handle to spawned
+ process.
+ (waitFor) Added interrupt support.
+
+2003-09-19 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java (getLocalAddress):
+ Renamed result variable to localAddr.
+ * java/net/MulticastSocket.java:
+ No need to import gnu.java.net.PlainDatagramSocketImpl.
+
+2003-09-18 Sascha Brawer <brawer@dandelis.ch>
+
+ * java/awt/Toolkit.java (getSystemEventQueue, getSystemEventQueueImpl):
+ Replace UTF-8 characters in Javadoc by XML/HTML escape sequence.
+
+2003-09-18 Tom Tromey <tromey@redhat.com>
+
+ * javax/naming/InitialContext.java: Reindented.
+
+2003-09-18 Dalibor Topic <robilad@kaffe.org>,
+ Helmer Kraemer <hkraemer@freenet.de>
+
+ * javax/naming/spi/NamingManager.java (getURLContext,
+ getObjectInstance, getStateToBind): Always use current thread's
+ context class loader when calling Class.forName.
+
+2003-09-18 Michael Koch <konqueror@gmx.de>
+
+ * java/util/Timer.java (finalize): Added "throws Throwable".
+
+2003-09-18 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (ch): Removed.
+ (receive): Use getChannel() instead of ch.
+ (send): Likewise.
+ (getChannel): Return null.
+ * java/net/ServerSocket.java
+ (ch): Removed.
+ (setChannel): Removed.
+ (implAccept): Use getChannel() instead of ch.
+ (close): Likewise.
+ (getChannel): Return null.
+ * java/net/Socket.java
+ (ch): Removed.
+ (connect): Use getChannel() instead of ch.
+ (setChannel): Removed.
+ (getChannel): Return null.
+
+2003-09-18 Mark Wielaard <mark@klomp.org>
+
+ Reported by Guilhem Lavaux and Julian Dolby
+ * java/io/ObjectStreamClass.java (getSerialPersistentFields): Get the
+ field "serialPersistentFields", not "getSerialPersistentFields".
+
+2003-09-18 Ingo Proetel <proetel@aicas.com>
+
+ * java/util/TimeZone.java: Initialize lazily.
+ * java/util/Locale.java (readManifest): Fix check for country.
+ * java/util/GregorianCalendar.java: Make use of ResourceBundle better
+ traceable
+ * java/util/Calendar.java: Make use of ResourceBundle better
+ traceable.
+
+2003-09-18 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/sql/Timestamp.java
+ (valueOf): Fixed confusion of java.sql.Date and java.util.Date
+
+2003-09-18 David P Grove <groved@us.ibm.com>
+
+ * java/io/LineNumberReader (read): Don't reset pos & limit when
+ markPos is 0.
+
+2003-09-18 Dalibor Topic <robilad@kaffe.org>
+
+ * gnu/java/rmi/rmic/Compile_gcj.java (COMPILER_ARGS): New private
+ constant.
+ (computeArguments): use computeTypicalArguments.
+
+ * gnu/java/rmi/rmic/Makefile.am (EXTRA_DIST): Add Compile_kjc.java,
+ Compile_jikes.java and RMICException.java.
+ * gnu/java/rmi/rmic/Compile_kjc.java: New file.
+ * gnu/java/rmi/rmic/Compile_jikes.java: Likewise.
+ * gnu/java/rmi/rmic/RMICException.java: Likewise.
+
+ * gnu/java/rmi/rmic/Compiler.java (getDestination): New method.
+
+ * gnu/java/rmi/rmic/CompilerProcess.java: Import java.io.InputStream.
+ (computeTypicalArguments): New method.
+ (compile): Print compiler output to System.out. Collect compiler
+ error output and use it in exception message.
+
+ * gnu/java/rmi/rmic/RMIC.java: Import java.util.Set.
+ (destination): Initialize to null.
+ (run): Replace file separator with '.' when processing class.
+ (processClass): Replace '.' with file separator when compiling
+ classes.
+ (findClass): Use SystemClassLoader to load class.
+ (generateStub): Use full class name for generated stub, that puts
+ it in right path. Replace '.' with file separator when generating
+ stub file name. Write just the stub class name without package
+ information as class name, and constructor name. Write only
+ interface names for interfaces extending java.rmi.Remote as
+ implemented.
+ (generateSkel): Use full class name for generated skel, that puts
+ it in right path. Replace '.' with file separator when generating
+ stub file name. Write just the stub class name without package
+ information as class name.
+
+2003-09-18 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am (rmi_java_source_files):
+ Added gnu/java/rmi/rmic/Compile_kjc.java,
+ gnu/java/rmi/rmic/Compile_jikes.java and
+ gnu/java/rmi/rmic/RMICException.java
+ * Makefile.in: Regenerated.
+
+2003-09-17 Graydon Hoare <graydon@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java,
+ gnu/java/awt/peer/gtk/GdkPixbufDecoder.java,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:
+ New files.
+
+2003-09-16 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/BufferedImage.java (setData): Support non-component
+ sample models.
+ (getData): Same.
+
+2003-09-10 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/geom/AffineTransform.java(transform): Fix airthmetic bugs.
+ * java/awt/geom/Arc2D.java: Approximate arc segments with cubics.
+
+2003-09-17 Mohan Embar <gnustuff@thisiscool.com>
+
+ * configure.in: Standardized help text case of
+ --enable-hash-synchronization
+ New configure switch --enable-libgcj-multifile and corresponding
+ automake conditional ONESTEP.
+ * configure: Rebuilt.
+ * Makefile.am: Use automake conditional ONESTEP to determine
+ whether classfiles should be compiled individually or all
+ at once.
+ * Makefile.in: Rebuilt.
+
+2003-09-16 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java (construct):
+ Remove method declaration.
+ (create()): Call native create.
+ (create(int)): New method.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c:
+ (create): Add window_id parameter. Call gtk_plug_new with
+ window_id parameter.
+ (construct): Remove method implementation.
+
+2003-09-16 Mohan Embar <gnustuff@thisiscool.com>
+
+ * Makefile.am: (MOSTLYCLEANFILES) Removed libtool objects.
+ (mostlyclean-local): New target patterned after clean-local
+ which recursively deletes all libtool objects using 'libtool rm'.
+ (clean-local): Slightly modified comment to alleviate monotony.
+ (distclean-local): New target patterned after clean-local
+ which recursively deletes all .d files.
+ * Makefile.in: Rebuilt.
+
+2003-09-11 Tom Tromey <tromey@redhat.com>
+
+ * java/net/URLStreamHandler.java (parseURL): If original file
+ ends with "/", so must canonical result.
+ * java/io/natFilePosix.cc (getCanonicalPath): Clean up snafus
+ with nul-termination and finding previous "/".
+
+2003-09-11 Michael Koch <konqueror@gmx.de>
+
+ * acconfig.h: Removed most items.
+ * configure.in: Added descriptions to AC_DEFINE macros that where in
+ acconfig.h before.
+ * include/config.h.in: Regenerated.
+
+2003-09-11 Sascha Brawer <brawer@dandelis.ch>
+
+ * java/awt/Toolkit.java (getSystemEventQueue): Call SecurityManager
+ if one is installed. Improve Javadoc.
+ (getSystemEventQueueImpl): Improve Javadoc.
+
+2003-09-11 Tom Tromey <tromey@redhat.com>
+
+ * java/io/natFilePosix.cc (getCanonicalPath): Handle case where
+ file does not exist.
+
+2003-09-10 Anthony Green <green@redhat.com>
+
+ * gnu/java/net/natPlainDatagramSocketImplWin32.cc (peekData):
+ Specify full name when referencing ::java::net::InetAddress.
+ * gnu/java/net/natPlainSocketImplWin32.cc (accept): Ditto.
+ Fix argument type.
+
+2003-09-10 Michael Koch <konqueror@gmx.de>
+
+ * acconfig.h (__NO_MATH_INLINES): Removed.
+ * configure.in: Removed check for g++ math inlining bug from 2000.
+ * configure.host: Removed -D__NO_MATH_INLINES in libgcj_cflags and
+ libgcj_cxxflags.
+ * configure: Regenerated.
+
+2003-09-10 David Daney <ddaney@avtrex.com>
+
+ * java/util/Arrays.java (equals(all variants)): Quit using
+ NullPointerException catching to detect null valued parameters.
+
+2003-09-10 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java,
+ java/net/MulticastSocket.java,
+ java/net/ServerSocket.java,
+ java/net/Socket.java:
+ Use gnu.java.net.Plain*SocketImpl instead of
+ java.net.PlainSocketImpl.
+ * java/net/PlainDatagramSocketImpl.java,
+ java/net/PlainSocketImpl.java,
+ java/net/SocketInputStream.java,
+ java/net/SocketOutputStream.java,
+ java/net/natPlainDatagramSocketImplNoNet.cc,
+ java/net/natPlainDatagramSocketImplPosix.cc,
+ java/net/natPlainDatagramSocketImplWin32.cc,
+ java/net/natPlainSocketImplNoNet.cc,
+ java/net/natPlainSocketImplPosix.cc,
+ java/net/natPlainSocketImplWin32.cc:
+ Removed.
+ * gnu/java/net/PlainDatagramSocketImpl.java,
+ gnu/java/net/PlainSocketImpl.java,
+ gnu/java/net/SocketInputStream.java,
+ gnu/java/net/SocketOutputStream.java,
+ gnu/java/net/natPlainDatagramSocketImplNoNet.cc,
+ gnu/java/net/natPlainDatagramSocketImplPosix.cc,
+ gnu/java/net/natPlainDatagramSocketImplWin32.cc,
+ gnu/java/net/natPlainSocketImplNoNet.cc,
+ gnu/java/net/natPlainSocketImplPosix.cc,
+ gnu/java/net/natPlainSocketImplWin32.cc:
+ New files (moved from java/net).
+ * configure.in: Create links for gnu/java/net/natPlain*SocketImpl.cc
+ instead of java/net/natPlain*SocketImpl.cc.
+ * configure: Regenerated.
+ * Makefile.am: Moved files from java/net to gnu/java/net.
+ * Makefile.in: Regenerated.
+
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2003-09-04 Tom Tromey <tromey@redhat.com>
+
+ * configure.host: Removed erroneous comment.
+
+ * gnu/java/awt/natEmbeddedWindow.cc (setWindowPeer): Removed
+ lvalue cast; use correct rvalue cast.
+
+2003-09-02 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkDialogPeer.java (create): Add width
+ and height arguments to GtkWindowPeer.create method call.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (create(int,int,int)): New method.
+ (create(int)): Add call to new create method.
+ (create()): Add width and height arguments to create method
+ call.
+ (GtkWindowPeer): Remove call to setBounds.
+ * java/awt/Frame.java (Frame(String)): Initialize visible field
+ to false.
+ (Frame(GraphicsConfiguration)): Likewise.
+ (Frame(String,GraphicsConfiguration)): Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (create):
+ Add width and height parameters. Call
+ gtk_window_set_default_size.
+ (connectHooks): Remove unused name variable.
+ (static setBounds): Call gtk_window_resize not
+ gtk_widget_set_usize.
+ (setBounds): Remove unused nchildren variable.
+
+2003-08-31 Ingo Proetel <proetel@aicas.com>
+
+ * java/util/logging/Logger.java: provide class and method information
+ * java/util/logging/LogManager.java: create handlers
+ * java/util/logging/SimpleFormatter.java: print souceClassName and
+ sourceMethodName
+
+2003-08-28 Mohan Embar <gnustuff@thisiscool.com>
+
+ * win32.cc: fixed tab, indentation and whitespace
+ inconsistencies
+ removed jvm.h include
+ added includes java/lang/UnsupportedOperationException.h,
+ java/io/IOException.h, java/net/SocketException.h
+ (WSAEventWrapper): class implementation
+ (_Jv_WinStrError): implemented both overloads
+ (_Jv_ThrowIOException): implemented both overloads
+ (_Jv_ThrowSocketException): implemented both overloads
+ (_Jv_select): implemented
+ * include/win32.h: fixed tab, indentation and whitespace
+ inconsistencies
+ wrapped <windows.h> include with #define WIN32_LEAN_AND_MEAN
+ added jvm.h include
+ (WSAEventWrapper): added class declaration
+ (_Jv_WinStrError): added both overload declarations
+ (_Jv_ThrowIOException): added both overload declarations
+ (_Jv_ThrowSocketException): added both overload declarations
+ removed ENOTCONN, ECONNRESET and ENOPROTOOPT defines
+ (_Jv_select): added declaration
+ (_Jv_socket): removed
+ (_Jv_connect): removed
+ (_Jv_close): removed
+ (_Jv_bind): removed
+ (_Jv_accept): removed
+ (_Jv_listen): removed
+ (_Jv_write): removed
+ (_Jv_read): removed
+ * java/io/natFileDescriptorWin32.cc: fixed tab, indentation and
+ whitespace inconsistencies
+ replaced <windows.h> #include with <platform.h>
+ removed jvm.h include
+ (testCanUseGetHandleInfo): new function which tests whether Win32
+ GetHandleInformation() call can be used with console buffer handles
+ (only supported on >=WinNT 5.0)
+ (winerr): removed (superseded by _Jv_WinStrError in include/win32.h)
+ (valid): rewrote implementation using GetHandleInformation()
+ (sync): changed exception throwing to use error string and exception
+ helper methods declared in include/win32.h
+ (open): likewise
+ (write): likewise
+ (setLength): likewise
+ (close): likewise
+ (seek): likewise
+ (getFilePointer): likewise
+ (read): likewise
+ * java/io/natFileWin32.cc: fixed tab, indentation and
+ whitespace inconsistencies
+ replaced <windows.h> #include with <platform.h>
+ removed jvm.h include
+ (_access): use JV_TEMP_UTF_STRING
+ (_stat): likewise
+ (performMkDir): use JV_TEMP_UTF_STRING
+ (performRenameTo): likewise
+ (performDelete): likewise
+ (performCreate): likewise
+ (performSetReadOnly): likewise
+ (performSetLastModified): likewise
+ * java/lang/natWin32Process.cc: fixed tab, indentation and
+ whitespace inconsistencies
+ replaced <windows.h> #include with <platform.h>
+ removed includes gcj/cni.h, jvm.h
+ (new_string): removed
+ (startProcess): use JV_TEMP_UTF_STRING,
+ changed exception throwing to use error string and exception
+ helper methods declared in include/win32.h
+ * java/net/natInetAddressWin32.cc: fixed tab, indentation and
+ whitespace inconsistencies
+ replaced <windows.h> #include with <platform.h>
+ removed jvm.h include
+ removed DISABLE_JAVA_NET conditional code
+ removed POSIX conditional code not relevant to Win32
+ (aton): use JV_TEMP_UTF_STRING
+ removed POSIX conditional code not relevant to Win32
+ (lookup): likewise
+ (getLocalHostName): likewise
+ * java/net/natNetworkInterfaceWin32.cc: fixed tab, indentation and
+ whitespace inconsistencies
+ removed unnecessary windows.h, winsock.h and gcj/cni.h includes
+ removed DISABLE_JAVA_NET conditional code
+ removed POSIX conditional code not relevant to Win32
+ (winsock2GetRealNetworkInterfaces): new function to compute network
+ interfaces via Winsock2 API
+ (determineGetRealNetworkInterfacesFN): new function for returning
+ a function pointer to the function used to compute network interfaces.
+ (getRealNetworkInterfaces): implemented
+ * java/net/natPlainDatagramSocketImplWin32.cc: fixed tab, indentation and
+ whitespace inconsistencies
+ removed gcj/cni.h include
+ removed DISABLE_JAVA_NET conditional code
+ removed POSIX conditional code not relevant to Win32
+ changed net POSIXisms to Win32isms
+ replaced _Jv socket-related calls with their real Win32 equivalents
+ changed exception throwing to use error string and exception
+ helper methods declared in include/win32.h
+ (peekData): implemented timeout support
+ (receive): likewise
+ * java/net/natPlainSocketImplWin32.cc: fixed tab, indentation and
+ whitespace inconsistencies
+ removed gcj/cni.h and gcj/javaprims.h includes
+ removed DISABLE_JAVA_NET conditional code
+ removed POSIX conditional code not relevant to Win32
+ changed net POSIXisms to Win32isms
+ replaced _Jv socket-related calls with their real Win32
+ equivalents
+ changed exception throwing to use error string and exception
+ helper methods declared in include/win32.h
+ (throwConnectException): helper function for connect()
+ (connect): implemented timeout support
+ (accept): likewise
+ (doRead): new helper function common to both read() method overloads,
+ includes timeout support
+ (read): implemented both overloads in terms of doRead()
+ (available): implemented using ioctlsocket()
+
+2003-08-28 Mohan Embar <gnustuff@thisiscool.com>
+
+ * java/net/natInetAddressWin32.cc,
+ java/net/natNetworkInterfaceWin32.cc,
+ java/net/natPlainDatagramSocketImplWin32.cc,
+ java/net/natPlainSocketImplWin32.cc:
+ Readded code enclosed in DISABLE_JAVA_NET defines
+ in preparation for MinGW cleanup / networking
+ patch
+
+2003-08-28 Mohan Embar <gnustuff@thisiscool.com>
+
+ * Makefile.am: Fixed problems with parallel makes.
+ (all_java_class_files): Readded definition.
+ (all_java_class_files): New target which depends on
+ libgcj-@gcc_version@.jar
+ * Makefile.in: Rebuilt
+
+2003-08-28 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (ordinary_java_source_files): Added new files.
+ * java/lang/Class.h (_Jv_sharedlib_register_hook): Declare as
+ friend.
+ * java/net/URLClassLoader.java (findClass): Don't use
+ findURLResource. Use loader's getClass method.
+ (URLLoader.getClass): New method.
+ (addURL): Handle `gcjlib' URLs.
+ (SoURLLoader): New class.
+ (SoResource): Likewise.
+ * gnu/gcj/protocol/gcjlib/Connection.java: New file.
+ * gnu/gcj/protocol/gcjlib/Handler.java: New file.
+ * include/jvm.h (struct _Jv_core_chain): Moved from natCore.cc.
+ (_Jv_RegisterCoreHook): Declare.
+ (_Jv_FindCore): Declare.
+ * gnu/gcj/runtime/SharedLibHelper.java: New file.
+ * gnu/gcj/runtime/natSharedLibLoader.cc (CoreHookFunc): New
+ typedef.
+ (core_hook): New function.
+ (struct SharedLibDummy) [saved_core]: New field.
+ (init): Set _Jv_RegisterCoreHook. Throw exception on failure.
+ (register_hook): Set protection domain and class loader on new
+ class.
+ (finalize): Free core chain.
+ * gnu/gcj/Core.java (Core): New constructor.
+ * gnu/gcj/runtime/SharedLibLoader.java: Rewrote to use
+ SharedLibHelper.
+ * gnu/gcj/natCore.cc (_Jv_RegisterResource): Indentation fixlet.
+ (_Jv_create_core): New function.
+ (create): Use it.
+ (default_register_resource): New function.
+ (_Jv_RegisterCoreHook): New global.
+ (_Jv_RegisterResource): Use it.
+ (core_chain_struct): Removed.
+ (_Jv_FindCore): New function.
+ (_Jv_FreeCoreChain): New function.
+
+2003-08-29 Michael Koch <konqueror@gmx.de>
+
+ * java/net/natInetAddressWin32.cc,
+ java/net/natNetworkInterfaceWin32.cc,
+ java/net/natPlainDatagramSocketImplWin32.cc,
+ java/net/natPlainSocketImplWin32.cc:
+ Removed code enclosed in DISABLE_JAVA_NET defines.
+
+2003-08-26 Mohan Embar <gnustuff@thisiscool.com>
+
+ * Makefile.am: (write_entries_to_file) New parameterized
+ function for writing entries to a file one line at a time.
+ (all_java_class_files): Removed definition.
+ (.java.class) Removed.target.
+ (libgcj-@gcc_version@.jar): Changed dependency to
+ $(all_java_source_files); added compilation step which compiles
+ all changed source files in one pass.
+ (libgcj.la) Refactored to use write_entries_to_file.
+ (lib-gnu-awt-xlib.la) Likewise.
+ (install-data-local) Likewise.
+ (write-entries-to-file-check) New target which tests write_entries_to_file.
+ (all-recursive): Changed dependency from $(all_java_class_files)
+ to libgcj-@gcc_version@.jar
+ * Makefile.in: Rebuilt.
+
+2003-08-26 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/StrictMath.java: Typo fix.
+ * java/lang/Math.java: Typo fix.
+
+2003-08-26 Stephen Crawley <crawley@dstc.edu.au>
+
+ * java/lang/ThreadGroup.java (removeThread): null the 'group' field
+ of the removed Thread.
+
+2003-08-26 Mark Wielaard <mark@klomp.org>
+
+ Reported by David Holmes <dholmes@dltech.com.au>.
+ * java/lang/InheritableThreadLocal.java (threadMap): Wrap inside
+ Collections.synchronizedMap.
+ * java/lang/ThreadLocal.java (valueMap): Likewise.
+
+2003-08-26 Mark Wielaard <mark@klomp.org>
+
+ * java/security/acl/Acl.java: Fix broken p tag.
+ * java/text/DateFormatSymbols.java: Correctly open and close li tags.
+ * javax/swing/border/LineBorder.java: Close img tag alt attributes.
+ * javax/swing/plaf/TreeUI.java: Likewise.
+ * javax/swing/plaf/basic/BasicTreeUI.java: Likewise.
+ * java/util/Properties.java: Use the word umlaut, not &auml; in api
+ documentation.
+ * java/util/PropertyResourceBundle.java: Likewise and add closing code
+ tag.
+
+2003-08-26 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am: Removed all GNU-make-specific FIXME comments.
+
+ * java/lang/ref/Reference.java (get): Indentation fix.
+ (clear): Comment fix.
+ (enqueue): Likewise.
+ (lock): Likewise.
+ (referent): Likewise.
+
+2003-08-26 Tom Tromey <tromey@redhat.com>
+
+ PR java/12058:
+ * java/lang/reflect/natArray.cc (set): Allow null as argument.
+
+ * java/lang/reflect/Proxy.java (ProxyData): `pack' now a String.
+ (ProxyData.getPackage): New method.
+ (ProxyData.getProxyData): Use package name, not Package.
+ (ClassFactory.ClassFactory): Updated.
+
+2003-08-25 Scott Gilbertson <scottg@mantatest.com>
+ * Makefile.am: added gnu/awt/xlib/XOffScreenImage.java.
+ * Makefile.in: re-generated.
+ * gnu/awt/j2d/IntegerGraphicsState.java
+ (ScreenCoupledImage): new interface.
+ (drawImage): detect ScreenCoupledImage instances.
+ * gnu/awt/xlib/XCanvasPeer.java (createImage) implemented.
+ * gnu/awt/xlib/XEventLoop.java
+ (createEvent): re-formatted, and rearranged to avoid null pointer.
+ * gnu/awt/xlib/XGraphics.java
+ (drawImage): added XOffScreenImage handling.
+ * gnu/awt/xlib/XOffScreenImage.java: new file.
+ * gnu/gcj/xlib/Drawable.java (getDepth): new native method.
+ * gnu/gcj/xlib/GC.java (copyArea): new native method.
+ * gnu/gcj/xlib/XAnyEvent.java
+ (TYPE_KEY_PRESS): new constant.
+ (TYPE_KEY_RELEASE): new constant.
+ (TYPE_MOTION_NOTIFY): new constant.
+ (TYPE_ENTER_NOTIFY): new constant.
+ (TYPE_LEAVE_NOTIFY): new constant.
+ (TYPE_FOCUS_IN): new constant.
+ (TYPE_FOCUS_OUT): new constant.
+ (TYPE_KEYMAP_NOTIFY): new constant.
+ (TYPE_GRAPHICS_EXPOSE): new constant.
+ (TYPE_NO_EXPOSE): new constant.
+ (TYPE_VISIBILITY_NOTIFY): new constant.
+ (TYPE_CREATE_NOTIFY): new constant.
+ (TYPE_DESTROY_NOTIFY): new constant.
+ (TYPE_MAP_REQUEST): new constant.
+ (TYPE_CONFIGURE_REQUEST): new constant.
+ (TYPE_GRAVITY_NOTIFY): new constant.
+ (TYPE_RESIZE_REQUEST): new constant.
+ (TYPE_CIRCULATE_NOTIFY): new constant.
+ (TYPE_CIRCULATE_REQUEST): new constant.
+ (TYPE_PROPERTY_NOTIFY): new constant.
+ (TYPE_SELECTION_CLEAR): new constant.
+ (TYPE_SELECTION_REQUEST): new constant.
+ (TYPE_SELECTION_NOTIFY): new constant.
+ (TYPE_COLORMAP_NOTIFY): new constant.
+ (TYPE_MAPPING_NOTIFY): new constant.
+ * gnu/gcj/xlib/natDrawable.cc (getDepth): new method.
+ * gnu/gcj/xlib/natGC.cc (copyArea): new method
+ * java/awt/Component.java (createImage): changed to use peer method.
+
+2003-08-22 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics.java (drawString): Pass font
+ name, not XLFD, to native drawString.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (drawString):
+ Replace XLFD-based implementation with Pango-based
+ implementation.
+
+2003-08-22 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Remove
+ GTK_WINDOW_DIALOG. Set GTK_WINDOW_POPUP to 1.
+
+2003-08-21 David Daney <ddaney@avtrex.com>
+
+ Fix for PR libgcj/12013:
+ * java/lang/ref/natReference.cc (finalize_referred_to_object):
+ Check `cleared' field.
+ * java/lang/ref/Reference.java (copy): Updated comments.
+ (cleared): New field.
+ (clear): Rewrote.
+
+2003-08-21 Scott Gilbertson <scottg@mantatest.com>
+ Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * Makefile.am (gtk_awt_peer_sources): Add
+ gnu/java/awt/peer/GLightweightPeer.java. Remove
+ gnu/java/awt/GLightweightPeer.java.
+ * gnu/java/awt/GLightweightPeer.java: Remove file.
+ * gnu/java/awt/peer/GLightweightPeer.java: New file.
+ * java/awt/Component.java (getToolkit): Add comment about
+ lightweight components.
+ * java/awt/Toolkit.java (createComponent): Return
+ gnu.java.awt.peer.GLightweightPeer.
+
+2003-08-21 Richard Earnshaw <rearnsha@arm.com>
+
+ * configure.in: Fix detection of gcj when building with newlib.
+ * configure: Regenerated.
+
+2003-08-20 Graydon Hoare <graydon@redhat.com>
+
+ * jni.cc: Replace "cheating" pointer-casting code with
+ extract_from_jvalue<> template.
+
+2003-08-20 Andrew Haley <aph@redhat.com>
+
+ * gnu/gcj/runtime/StackTrace.java (getClass): New method.
+ * gnu/gcj/runtime/natStackTrace.cc (getClass): New method.
+ (classAt): Break out class lookup function into getClass().
+ * exception.cc (PERSONALITY_FUNCTION): Use new encoding for exception
+ handlers when using -fno-assume-compiled.
+
+2003-08-20 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/9125:
+ * gnu/gcj/runtime/natVMClassLoader.cc (findClass): Find Runtime
+ object outside of loop. Respect lib_control setting.
+ * gnu/gcj/runtime/VMClassLoader.java (tried_libraries): New
+ field.
+ (lib_control): New field.
+ (LIB_FULL, LIB_CACHE, LIB_NEVER): New constants.
+ (VMClassLoader): Initialize new field.
+
+ * java/lang/ref/natReference.cc (finalize_referred_to_object):
+ Set `list->reference' to DELETED_REFERENCE when removing dead
+ object.
+ (find_slot): Added an assert.
+ (DELETED_REFERENCE): New define.
+ (add_to_hash): Check for DELETED_REFERENCE.
+ (remove_from_hash): Just return if found slot isn't ours.
+
+2003-08-19 Andrew Haley <aph@redhat.com>
+
+ * prims.cc (unblock_signal): New function.
+ (catch_segv): Use it.
+ (catch_fpe): Likewise.
+
+2003-08-19 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR libgcj/11575
+ * java/io/natFileDescriptorWin32.cc (open): Set create
+ flag to OPEN_AWAYS when READ & WRITE regardless of APPEND flag.
+ Honor EXCL when openning with WRITE flag.
+
+2003-08-19 Mohan Embar <gnustuff@thisiscool.com>
+
+ * include/jvm.h: New class _Jv_TempUTFString (helper class for
+ getting a temporary C string from a jstring)
+ New macro JV_TEMP_UTF_STRING, which leverages _Jv_TempUTFString
+ but uses a stack buffer if the string length is less than 256
+ bytes.
+
+2003-08-18 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/11951:
+ * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Returns
+ void. Throw VirtualMachineError if ffi fails. Initialize return
+ value. Added is_jni_call argument; only wrap exception if not a
+ JNI call. Use descriptive message if operation not supported.
+ (_Jv_GetTypesFromSignature): Use declaring class' loader to find
+ array class.
+ * include/jvm.h (_Jv_CallAnyMethodA): Updated declaration.
+ * jni.cc (_Jv_JNI_CallAnyMethodV): Updated for new form of
+ _Jv_CallAnyMethodA.
+ (_Jv_JNI_CallAnyMethodA): Likewise.
+ (_Jv_JNI_CallAnyVoidMethodV): Likewise.
+ (_Jv_JNI_CallAnyVoidMethodA): Likewise.
+
+2003-08-13 Tom Tromey <tromey@redhat.com>
+
+ * gij.cc (help): Document -? and -X.
+
+2003-08-12 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/Font.java:
+ Stub out more recent API.
+
+2003-08-12 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/Color.java (getAlpha):
+ Prevent sign-extended alpha values.
+
+2003-08-12 Tom Tromey <tromey@redhat.com>
+
+ * gij.cc (main): Handle -? and -X.
+
+2003-08-10 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/awt/Container.java
+ (getPreferredSize): Call preferredSize.
+ (preferredSize): Moved body of getPreferredSize here.
+ (getMinimumSize): Call minimumSize.
+ (minimumSize): Moved body of getMinimumSize here.
+
+2003-08-11 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/EventQueue.java (currentEvent, lastWhen): New fields.
+ (postEvent): Removed FIXME comment.
+ (isDispatchThread): Documented.
+ (getCurrentEvent): New method.
+ (dispatchEvent): Set currentEvent and lastWhen.
+ (getMostRecentEventTime): Rewrote.
+ (invokeLater): Documented.
+
+2003-08-10 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/io/PrintStream.java (print): Always flush if auto_flush is
+ set. Don't check for newline characters.
+ (write (int)): Implement without using a temporary array.
+ (write (byte[], int, int): Always flush if auto_flush is set. Don't
+ check for newline characters.
+ Fixes PR libgcj/11778.
+
+2003-08-08 Andrew Haley <aph@redhat.com>
+
+ * Makefile.am (AM_CXXFLAGS): Define BOOT_CLASS_PATH.
+ * Makefile.in: Rebuild.
+ * java/lang/natRuntime.cc (insertSystemProperties): Add
+ "sun.boot.class.path".
+
+2003-08-07 Andrew Haley <aph@redhat.com>
+
+ * java/io/PrintStream.java: Don't crash on a null string.
+
+2003-08-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Don't initialize GCINCS to boehm-gc/include.
+ * configure: Regenerate.
+
+2003-08-07 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/net/Socket.java (Socket (SocketImpl)): Don't allow null
+ SocketImpl. Update Javadoc.
+ (bind): Call close() not impl.close() in event of exception.
+ (connect): Likewise.
+ Remove superfluous null checks throughout.
+ * java/net/ServerSocket.java (ServerSocket (int, int, InetAddress)):
+ Don't create an extra socket. Fix for PR libgcj/10868.
+ (bind): Clean up exception handling.
+ Remove superfluous null checks throughout.
+
+2003-08-07 Jacob Gladish <gladish@spinnakernet.com>
+ Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/net/natPlainSocketImplPosix.cc (connect): Pass the FD as a
+ ready-to-write argument to _Jv_Select. Reset the socket back to
+ non-blocking state after connecting.
+ (accept): Pass the FD as a ready-to-write argument to _Jv_Select.
+ Throw SocketTimeoutException not InterruptedIOException.
+ (read): Throw SocketTimeoutException not InterruptedIOException.
+
+2003-08-07 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/lang/Thread.java (Thread): Check for null "name" from
+ start of private constructor, not after calling the private
+ constructor.
+
+2003-08-06 Tom Tromey <tromey@redhat.com>
+
+ * java/io/FilePermission.java (equals): Use correct index for
+ last character of path.
+
+2003-08-06 Alan Modra <amodra@bigpond.net.au>
+
+ * acinclude.m4 (LIBGCJ_CONFIGURE): Remove AC_CANONICAL_BUILD.
+ * configure.in: Compare with_cross_host to build_alias, not build.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2003-08-05 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/11779:
+ * java/lang/reflect/natField.cc (getAddr): Skip frames in Field
+ class.
+
+ * java/lang/reflect/Method.java: Updated status comment.
+ Imported javadoc from Classpath and re-ordered methods.
+ * java/lang/reflect/Constructor.java: Reindented. Updated
+ status comment. Imported javadoc from Classpath and re-ordered
+ methods.
+
+2003-08-05 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (postKeyEvent):
+ Add keyLocation parameter.
+ * java/awt/event/KeyEvent.java (getKeyText): Fix "NumPad-"
+ string.
+ (paramString): Generate keyChar string according to keyChar, not
+ keyCode.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (state_to_awt_mods): Handle ALT key.
+ (keyevent_state_to_awt_mods): New function.
+ (get_first_keyval_from_keymap): New function.
+ (keysym_to_awt_keycode): Get virtual key code from keymap.
+ Handle missing VK_ values.
+ (keysym_to_awt_keylocation): New function.
+ (keyevent_to_awt_keychar): New function.
+ (generates_key_typed_event): Handle non-text-component case.
+ Handle GDK_KP_Delete and GDK_KP_Enter.
+ (awt_event_handler): Call new functions to get postKeyEvent
+ parameters.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (gtkInit):
+ Update postKeyEvent method signature.
+ * jni/gtk-peer/gtkpeer.h: Add KEY_LOCATION defines. Add missing
+ VK_ defines.
+
+2003-08-05 Matthias Klose <doko@debian.org>
+
+ * aclocal.m4: check for libart-config binary
+ under the name libart2-config as well.
+ * configure: regenerated.
+
+2003-08-04 David P Grove <groved@us.ibm.com>
+
+ * java/text/DecimalFormat.java (format): avoid ArithmeticException
+ when groupingSize is 0.
+ (parse): Likewise.
+
+2003-08-04 Matthias Klose <doko@debian.org>
+
+ * libart.m4: check for libart-config binary
+ under the name libart2-config as well.
+ * configure, aclocal.m4: regenerated.
+
+2003-08-02 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/ByteBufferImpl.java
+ (getChar): Check remaining bytes, fixed comment about endianess.
+ (putChar): Likewise.
+ (getShort): Likewise.
+ (putShort): Likewise.
+ (getInt): Check remaining bytes, fixed conversion, fixed comment about
+ endianess.
+ (putInt): Likewise.
+ (getLong): Likewise.
+ (putLong): Likewise.
+ (getFloat): Likewise.
+ (putFloat): Likewise.
+ (getDouble): Likewise.
+ (putDouble): Likewise.
+ * java/nio/DirectByteBufferImpl.java
+ (getChar): Wrapped code, fixed comment about endianess.
+ (putchar): Likewise.
+ (getShort): Likewise.
+ (putShort): Likewise.
+ (getInt): Fixed conversion, fixed comment about endianess.
+ (putInt): Likewise.
+ (getLong): Likewise.
+ (putLong): Likewise.
+ (getFloat): Likewise.
+ (putFloat): Likewise.
+ (getDouble): Likewise.
+ (putDouble): Likewise.
+ * java/nio/MappedByteBufferImpl.java
+ (compact): Implemented.
+ (getChar): Implemented.
+ (putChar): Implemented.
+ (getDouble): Implemented.
+ (putdouble): Implemented.
+ (getFloat): Implemented.
+ (putFloat): Implemented.
+ (getInt): Implemented.
+ (putInt): Implemented.
+ (getLong): Implemented.
+ (putLong): Implemented.
+ (getShort): Implemented.
+ (putShort): Implemented.
+ * java/nio/channels/FileChannelImpl.java
+ (read): Set position where to access file.
+ (write): Likewise.
+ (transferTo): Flip buffer after read and before write.
+ (transferFrom): Likewise.
+
+2003-08-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/lang/ArrayHelper.java
+ (equalsArray): Reformated, added method documentation.
+
+2003-08-02 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URL.java
+ (URL): Added paragraph about the
+ gnu.java.net.nocache_protocol_handlers property.
+ (ph_cache): Renamed from handlers to match classpath's implementation.
+ Reordered it with factory and serialVersionUID member variables.
+ (cache_handlers): New member variable.
+ (static): New static initializer to initialize cache_handlers from
+ gnu.java.net.nocache_protocol_handlers property.
+ (URL): Use ph_cache instead of handlers, reformatted some code to
+ match classpath's implementation.
+
+2003-08-01 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/11241:
+ * java/util/WeakHashMap.java (WeakHashMap(int,float)): If
+ initialCapacity is 0, set it to 1.
+
+2003-08-01 Stephen Crawley <crawley@dstc.edu.au>
+
+ * java/net/SocketImpl.java (toString): Display the remote address
+ of an unconnected server socket as "0.0.0.0/0.0.0.0".
+
+2003-08-01 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/border/BevelBorder.java,
+ javax/swing/border/EtchedBorder.java,
+ javax/swing/border/LineBorder.java,
+ javax/swing/border/MatteBorder.java,
+ javax/swing/border/SoftBevelBorder.java,
+ javax/swing/plaf/BorderUIResource.java,
+ javax/swing/plaf/ComponentUI.java,
+ javax/swing/plaf/TreeUI.java,
+ javax/swing/plaf/basic/BasicBorders.java,
+ javax/swing/plaf/basic/BasicGraphicsUtils.java,
+ javax/swing/plaf/basic/BasicTreeUI.java:
+ Prepend "doc-files" to all paths to embedded Javadoc images, so
+ that the generated documentation contains the correct URL.
+
+2003-08-01 Tom Tromey <tromey@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in (tool_include_dir): Redefine to match gcc.
+
+2003-08-01 Jerry Quinn <jlquinn@optonline.net>
+ Mark Wielaard <mark@klomp.org>
+
+ * java/math/BigDecimal (divide): Correctly handle
+ ROUND_HALF_EVEN when amount is greater than 0.5.
+ Simplify and optimize code.
+
+2003-07-31 Tom Tromey <tromey@redhat.com>
+
+ More for PR libgcj/11737:
+ * java/io/ObjectInputStream.java (processResolution): Use
+ getMethod.
+ (getMethod): Make method accessible.
+ (getField): Make field accessible.
+ (setBooleanField): Don't call setAccessible here.
+ (setByteField, setCharField, setDoubleField, setFloatField,
+ setIntField, setLongField, setShortField, setObjectField):
+ Likewise.
+ (callReadMethod): Don't check whether method is null. Catch
+ NoSuchMethodException.
+ * java/io/ObjectOutputStream.java (callWriteMethod): Initialize
+ cause on thrown exceptions.
+
+2003-07-31 Stepan Koltsov <yozh@mx1.ru>
+
+ Fix for PR libgcj/11728:
+ * java/util/HashMap.java (readObject): Set size.
+
+2003-07-31 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/11737:
+ * java/io/ObjectOutputStream.java (getMethod): Make method
+ accessible.
+ (getField): Likewise.
+ (writeObject): Use getMethod.
+ Import PrivilegedAction and AccessController.
+ (callWriteMethod): Don't check whether m is null. Catch
+ NoSuchMethodException.
+
+ * java/awt/geom/Arc2D.java (getBounds2D): Implement.
+ (containsAngle): Likewise.
+ (getStartPoint): Rewrote.
+ (getEndPoint): Likewise.
+ (setAngleStart(Point2D)): Likewise.
+
+2003-07-31 Roger Sayle <roger@eyesopen.com>
+ Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Add new THREADCXXFLAGS variable.
+ Handle POSIX threads on alpha*-dec-osf*.
+ * configure: Regenerate.
+ * Makefile.am: Add THREADCXXFLAGS to AM_CXXFLAGS.
+ * Makefile.in: Regenerate.
+
+2003-07-08 Andrew Haley <aph@redhat.com>
+
+ * include/i386-signal.h (RESTORE): New.
+ (INIT_SEGV): Set restorer.
+ (INIT_FPE): Likewise.
+
+2003-07-29 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Call getName rather
+ than getXLFD.
+ * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java: Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+ (gtkSetFont): Scale size parameter by PANGO_SCALE.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c:
+ Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:
+ Likewise.
+
+2003-07-29 Tom Tromey <tromey@redhat.com>
+
+ * defineclass.cc (handleField): Throw exception if field name is
+ duplicated.
+ (handleMethod): Throw exception for duplicate method.
+
+2003-07-29 Tom Tromey <tromey@redhat.com>
+
+ * gnu/gcj/convert/natIconv.cc (write): Handle case where
+ output buffer is too small.
+
+2003-07-28 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natString.cc (init(gnu.gcj.runtime.StringBuffer)):
+ New method.
+ Include gnu/gcj/runtime/StringBuffer.h.
+ * java/lang/String.java (init(gnu.gcj.runtime.StringBuffer)): New
+ native method.
+ (String(gnu.gcj.runtime.StringBuffer)): Use it.
+
+2003-07-27 Anthony Green <green@redhat.com>
+
+ * configure.in: Fix newlib check.
+ * configure: Rebuilt.
+
+2003-07-27 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c:
+ Create vbox and layout for GtkPlug.
+
+2003-07-27 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Window.java
+ (Window): Removed now unused constructor. It became oboslete with the
+ new embedded window patch.
+
+2003-07-27 Thomas Fitzsimmons <fitzsim@redhat.com.h>
+ Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/EmbeddedWindow.java
+ (EmbeddedWindow): Extends Frame instead of Window.
+ (window_id): New member variable to store the native window handle.
+ (create): Removed.
+ (EmbeddedWindow): New constructor.
+ (addNotify): New method.
+ (getHandler): Likewise.
+ (setWindowPeer): New native method.
+ * gnu/java/awt/EmbeddedWindowSupport.java
+ (EmbeddedWindowSupport): Fixed documentation.
+ (createEmbeddedWindow): Return EmbeddedWindowPeer instead of
+ WindowPeer, give it an EmbeddedWindow instance instead of the raw
+ window data.
+ * gnu/java/awt/natEmbeddedWindow.cc
+ (create): Removed.
+ (setWindowPeer): New method.
+ * gnu/java/awt/peer/EmbeddedWindowPeer.java,
+ gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c:
+ New files
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (GtkToolkit): Implements EmbeddedWindowSupport.
+ (createEmbeddedWindow): New method.
+ * java/awt/Window.java
+ (Window): Removed.
+ * Makefile.am
+ (java_source_files): Added EmbeddedWindowPeer.java.
+ (gtk_awt_peer_sources): Added GtkEmbeddedWindowPeer.java.
+ (gtk_c_source_files): Added gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c.
+ * Makefile.in: Regenerated.
+
+2003-07-26 Ranjit Mathew <rmathew@hotmail.com>
+
+ * java/lang/Win32Process.java (ConcreteProcess): Surround
+ a command line element with quotes if it contains an
+ embedded space or tab.
+ * java/lang/natWin32Process.cc (startProcess): Do not
+ surround command line elements with quotes here.
+
+ * configure.host: Use -fcheck-references and
+ -fuse-divide-subroutine for MinGW until we fix
+ win32_exception_handler( ) in win32.cc w.r.t. Win32
+ Structured Exception Handling (SEH).
+
+ * win32.cc (_Jv_platform_initProperties): Use generic names
+ like "x86" for the "os.arch" property to be consistent with
+ what Sun's JDK produces. Use the wProcessorArchitecture
+ member of the Win32 SYSTEM_INFO structure, filled in a call
+ to GetSystemInfo( ), instead of dwProcessorType.
+
+2003-07-26 Mohan Embar <gnustuff@thisiscool.com>
+ Ranjit Mathew <rmathew@hotmail.com>
+
+ * Makefile.am: Use cross-compiling gcjh from the path for
+ a crossed-native build.
+ * Makefile.in: Rebuilt.
+ * configure.in: Include libltdl in non-newlib builds.
+ Moved determination of gcj used to build libraries to
+ its own section. Fixed cross-compilation issues for
+ non-newlib builds.
+ * configure: Rebuilt.
+
+2003-07-25 Tom Tromey <tromey@redhat.com>
+
+ * java/io/natFileDescriptorPosix.cc (write): Try again on EINTR.
+ (write): Likewise.
+ (read): Likewise.
+ (read): Likewise.
+
+2003-07-25 Mark Wielaard <mark@klomp.org>
+
+ * java/lang/natRuntime.cc (_load): Add library name to
+ UnsatisfiedLinkError when thrown.
+
+2003-07-25 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (awt_java_source_files): java/awt/GridBagLayoutInfo.java
+ added.
+ * Makefile.in: Likewise.
+
+2003-07-25 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/awt/Component.java
+ (getPreferredSize): Call preferredSize.
+ (preferredSize): Moved body of getPreferredSize here.
+ (getMinimumSize): Call minimumSize.
+ (minimumSize): Moved body of getMinimumSize here.
+ (prepareImage): Fall back on Toolkit.prepareImage if there is no peer
+ (checkImage(Image,ImageObserver)): Don't call getWidth/getHeight, but
+ pass -1
+ * java/awt/Container.java
+ (validate): Don't validate if there is no peer.
+ (update): Clear background before calling paint.
+ * java/awt/GridBagLayout.java
+ Completed the implementation and fixed several bugs.
+ * java/awt/MediaTracker.java
+ (MediaEntry.imageUpdate): Fixed typo. & instead of | was used to
+ combine flags.
+ * java/awt/Window.java
+ (Window): Don't call setVisible(false). Windows are invisible by
+ default and calling virtual methods from constructor causes
+ compatibility problems (e.g. subclasses may assume that the peer
+ already exists).
+
+2003-07-25 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/GridBagLayout.java:
+ Totally reworked and partly implemented.
+ * java/awt/GridBagLayoutInfo.java:
+ New file.
+
+2003-07-24 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (create):
+ Don't pack label in an event box.
+
+2003-07-24 Tom Tromey <tromey@redhat.com>
+
+ For PR libgcj/7482:
+ * verify.cc (ref_intersection): New class.
+ (type_val): Removed unresolved_reference_type,
+ uninitialized_unresolved_reference_type.
+ (is_assignable_from_slow): Rewrote.
+ (type::data): Removed.
+ (type::klass): New field.
+ (type::type): Added verifier argument.
+ (type::resolve): Removed.
+ (type::set_uninitialized): Updated for change to type_val.
+ (type::set_initialized): Likewise.
+ (type::isinitialized): Likewise.
+ (type::print): Likewise.
+ (construct_primitive_array_type): Likewise.
+ (type::compatible): Updated for change to type_val and to use
+ ref_intersection.
+ (type::isarray): Updated to use ref_intersection.
+ (type::isinterface): Likewise.
+ (type::element_type): Likewise.
+ (type::to_array): Likewise.
+ (type::verify_dimensions): Rewrote.
+ (type::merge): Likewise.
+ (check_class_constant): Updated for type constructor change.
+ (check_constant): Likewise.
+ (check_field_constant): Likewise.
+ (get_one_type): Likewise.
+ (initialize_stack): Likewise.
+ (verify_instructions_0): Likewise.
+ (verify_instructions_0) [op_invokeinterface]: Removed special
+ case.
+ (isect_list): New field.
+ (_Jv_BytecodeVerifier): Initialize it.
+ (~_Jv_BytecodeVerifier): Destroy ref_intersection objects.
+
+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.
+
+2003-07-23 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+ (connectHooks): New method.
+ (handleEvent): Remove.
+ * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+ (createHooks): Remove declaration.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (generates_key_typed_event): Change to handle only certain
+ keyvals.
+ (awt_event_handler): Add special handling for GtkTextView.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+ (textcomponent_commit_cb): New function.
+ (textcomponent_changed_cb): Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+ (connectHooks): Remove.
+
+2003-07-23 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natSystem.cc (arraycopy): Check for overflow.
+
+ * boehm.cc (_Jv_BuildGCDescr): Use `1ULL'.
+
+2003-07-22 Tom Tromey <tromey@redhat.com>
+
+ * boehm.cc (_Jv_BuildGCDescr): Wrote.
+ Include limits.h.
+
+2003-07-22 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/Window.java (getWarningString): Just return the
+ string.
+ (Window): Set warningString; check with security manager.
+
+2003-07-22 Scott Gilbertson <scottg@mantatest.com>
+
+ * gnu/awt/xlib/XGraphicsConfiguration.java
+ (FontMetricsCache): Made static.
+
+2003-07-22 Tom Tromey <tromey@redhat.com>
+
+ * java/net/URLEncoder.java (encode(String)): Use platform default
+ encoding.
+ (encode(String,String)): Convert to 2-digit upper-case hex
+ number.
+ (hex): New field.
+
+2003-07-21 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (create): Remove unused method implementation.
+ (connectHooks): Remove debug messages.
+
+2003-07-20 Anthony Green <green@redhat.com>
+
+ * gnu/awt/j2d/AbstractGraphicsState.java (clone): Handle
+ CloneNotSupportedException.
+ * gnu/gcj/xlib/WindowAttributes.java (clone): Ditto.
+ * gnu/gcj/xlib/WMSizeHints.java (clone): Ditto.
+ * gnu/gcj/xlib/GC.java (clone): Ditto.
+ * gnu/awt/xlib/XGraphics.java (clone): Ditto.
+ * gnu/awt/j2d/Graphics2DImpl.java (clone): Ditto.
+
+ * gnu/awt/xlib/XEventLoop.java (postNextEvent): Remove unreachable
+ handler.
+ * gnu/gcj/runtime/NameFinder.java (NameFinder): Ditto.
+
+2003-07-20 Steve Pribyl <steve@netfuel.com.>
+
+ * gnu/gcj/runtime/natSharedLibLoader.cc (init): `libname' now a
+ String. Put dlerror() message into exception.
+ Include UnsatisfiedLinkError.
+ * gnu/gcj/runtime/SharedLibLoader.java (init): `libname' now a
+ String. Now native.
+
+2003-07-20 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Runtime.java: Comment fix.
+ * java/lang/ClassLoader.java (isAncestorOf): New method.
+ (getParent): Uncommented security check. Use isAncestorOf.
+ * include/jvm.h (_Jv_CheckAccess): Declare.
+ * java/lang/reflect/natConstructor.cc (newInstance): Perform
+ access check.
+ Include IllegalAccessException.h, ArrayIndexOutOfBoundsException.h.
+ * java/lang/reflect/natArray.cc (newInstance): Pass caller's
+ class loader to _Jv_GetArrayClass.
+ Include ArrayIndexOutOfBoundsException.h.
+ * java/lang/reflect/Field.java: Update comment to reflect status.
+ (equals): Fixed indentation.
+ * java/lang/Class.h (Class): Declare memberAccessCheck, not
+ checkMemberAccess. Make _Jv_CheckAccess a friend.
+ * java/lang/Class.java (memberAccessCheck): New method from
+ Classpath.
+ (checkMemberAccess): Removed.
+ (getDeclaredMethod): Use memberAccessCheck.
+ (getField): Likewise.
+ (getMethod): Likewise.
+ * resolve.cc (_Jv_ResolvePoolEntry): Use _Jv_CheckAccess.
+ (_Jv_SearchMethodInClass): Likewise.
+ * prims.cc (_Jv_CheckAccess): New function.
+ * jni.cc (_Jv_JNI_FindClass): Use getClassLoaderInternal.
+ (_Jv_JNI_GetAnyFieldID): Likewise.
+ * java/lang/natClass.cc (forName): Use getClassLoaderInternal.
+ (getClassLoader): Added security check.
+ (getConstructor): Call memberAccessCheck.
+ (getDeclaredClasses): Likewise.
+ (getDeclaredField): Likewise.
+ (getDeclaredFields): Likewise.
+ (_getConstructors): Likewise.
+ (getDeclaredConstructor): Likewise.
+ (getDeclaredMethods): Likewise.
+ (getFields): Likewise.
+ (getMethods): Likewise.
+ (newInstance): Likewise.
+ (_Jv_MakeVTable): Put method name in exception.
+ * java/lang/reflect/natMethod.cc (getType): Use
+ getClassLoaderInternal.
+ (_Jv_GetTypesFromSignature): Likewise.
+ (invoke): Perform access check.
+ (_Jv_CallAnyMethodA): Removed old FIXME comments.
+ Include ArrayIndexOutOfBoundsException.h.
+ * java/lang/reflect/natField.cc (getType): Use
+ getClassLoaderInternal.
+ (_Jv_CheckFieldAccessibility): Removed.
+ (getAddr): Use _Jv_CheckAccess; find caller.
+ Include ArrayIndexOutOfBoundsException.h.
+
+2003-07-20 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URL.java
+ (URL): Fixed documentation to name an argument correcty, Reformatted
+ one method declaration.
+ (getURLStreamHandler): Added documentation from classpath.
+
+2003-07-19 Tom Tromey <tromey@redhat.com>
+
+ * mauve-libgcj: Don't run CollationElementIterator tests.
+
+2003-07-19 Jeroen Frijters <jeroen@sumatra.nl>
+
+ * java/net/URLClassLoader.java (addURL): Moved implementation to
+ private addURLImpl() to avoid calling addURL from the constructor.
+ (addURLImpl): Contains the code that was previously in addURL.
+ (addURLs): Call addURLImpl(), not addURL().
+
+2003-07-18 Graydon Hoare <graydon@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c:
+ Handle missing event cases, connect to "value-changed" signal.
+
+2003-07-18 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/geom/CubicCurve2D.java,
+ java/awt/geom/Line2D.java,
+ java/awt/geom/QuadCurve2D.java,
+ java/awt/geom/Rectangle2D.java:
+ Fix path some calculations, make path iterators follow
+ a consistent style.
+
+2003-07-18 Mark Wielaard <mark@klomp.org>
+
+ * java/util/logging/Handler.java (isLoggable): Check record level
+ smaller or equal.
+
+2003-07-17 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GtkToolkit.java:
+ Reworked imports.
+
+2003-07-14 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/rmi/server/UnicastServerRef.java:
+ New version from classpath.
+
+2003-07-14 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/image/MemoryImageSource.java,
+ java/beans/PropertyEditorManager.java,
+ javax/naming/CompoundName.java,
+ javax/naming/spi/NamingManager.java,
+ javax/swing/AbstractButton.java,
+ javax/swing/ButtonModel.java,
+ javax/swing/SwingUtilities.java,
+ javax/swing/UIManager.java,
+ javax/swing/colorchooser/DefaultColorSelectionModel.java,
+ javax/swing/event/AncestorEvent.java,
+ javax/swing/event/InternalFrameEvent.java,
+ java/util/zip/ZipFile.java:
+ New versions from classpath.
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/FileChannelImpl.java,
+ gnu/java/nio/natFileChannelImpl.cc: Removed.
+ * java/io/FileInputStream.java,
+ java/io/FileOutputStream.java,
+ java/io/RandomAccessFile.java,
+ java/nio/MappedByteBufferImpl.java:
+ Import java.nio.channels.FileChannelImpl instead of
+ gnu.java.nio.FileChannelImpl.
+ * java/nio/channels/FileChannelImpl.java,
+ java/nio/channels/natFileChannelImpl.cc:
+ New files.
+ * Makefile.am
+ (ordinary_java_source_files):
+ Removed gnu/java/nio/FileChannelImpl.java and added
+ java/nio/channels/FileChannelImpl.java.
+ (nat source_files):
+ Removed gnu/java/nio/natFileChannelImpl.cc and added
+ java/nio/channels/natFileChannelImpl.cc.
+ * Makefile.in: Regenerated.
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/basic/BasicBorders.java,
+ javax/swing/plaf/basic/BasicLabelUI.java,
+ javax/swing/plaf/basic/BasicLookAndFeel.java,
+ javax/swing/plaf/basic/BasicTabbedPaneUI.java,
+ javax/swing/plaf/basic/BasicTextUI.java,
+ javax/swing/plaf/metal/MetalLookAndFeel.java:
+ New versions from classpath.
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GdkFontMetrics.java
+ * gnu/java/awt/peer/gtk/GdkGraphics.java
+ * gnu/java/awt/peer/gtk/GtkButtonPeer.java
+ * gnu/java/awt/peer/gtk/GtkCanvasPeer.java
+ * gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
+ * gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
+ * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+ * gnu/java/awt/peer/gtk/GtkChoicePeer.java
+ * gnu/java/awt/peer/gtk/GtkClipboard.java
+ * gnu/java/awt/peer/gtk/GtkDialogPeer.java
+ * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+ * gnu/java/awt/peer/gtk/GtkFramePeer.java
+ * gnu/java/awt/peer/gtk/GtkGenericPeer.java
+ * gnu/java/awt/peer/gtk/GtkImage.java
+ * gnu/java/awt/peer/gtk/GtkImagePainter.java
+ * gnu/java/awt/peer/gtk/GtkLabelPeer.java
+ * gnu/java/awt/peer/gtk/GtkListPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
+ * gnu/java/awt/peer/gtk/GtkMenuPeer.java
+ * gnu/java/awt/peer/gtk/GtkOffScreenImage.java
+ * gnu/java/awt/peer/gtk/GtkPanelPeer.java
+ * gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
+ * gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
+ * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
+ * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
+ * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+ * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/locale/LocaleInformation_de.java
+ * gnu/java/locale/LocaleInformation_en.java
+ * gnu/java/locale/LocaleInformation_nl.java
+
+2003-07-13 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/EmbeddedWindow.java,
+ gnu/java/awt/EmbeddedWindowSupport.java,
+ gnu/java/awt/natEmbeddedWindow.cc:
+ New files.
+ * java/awt/Window.java
+ (Window): New constructor to support embedded windows.
+ * Makefile.am
+ (awt_java_source_files): Added gnu/java/awt/EmbeddedWindow.java and
+ gnu/java/awt/EmbeddedWindowSupport.java.
+ (nat_source_files): Added gnu/java/awt/natEmbeddedWindow.cc.
+ * Makefile.in: Regenerated.
+
+2003-07-11 Matt Kraai <kraii@alumni.cmu.edu>
+
+ * gnu/gcj/runtime/SharedLibLoader.java: Fix misspelling.
+ * gnu/gcj/runtime/natSharedLibLoader.cc: Likewise.
+ * java/awt/im/InputContext.java: Remove a redundant
+ partial line.
+
+2003-07-09 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (AM_MAKEFLAGS): Added CPPFLAGS.
+
2003-07-09 Mark Wielaard <mark@klomp.org>
* java/io/ObjectOutputStream.java (writeObject): break after
@@ -18,11 +1628,11 @@
2003-07-09 Michael Koch <konqueror@gmx.de>
- * libgcj.pc.in
- * Makefile.am
- * Makefile.in
- * configure
- * configure.in
+ * libgcj.pc.in: New file.
+ * Makefile.am: Install libgcj.pc in $libdir/pkgconfig.
+ * Makefile.in: Regenerated.
+ * configure: Regenrated.
+ * configure.in: Create libgcj.pc from libgcj.pc.in.
2003-07-08 Mark Wielaard <mark@klomp.org>
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index d67176aa005..c30ccb6f9cc 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -10,6 +10,15 @@ else
SUBDIRS = $(DIRLTDL) gcj include
endif
+# write_entries_to_file - writes each entry in a list
+# to the specified file. Each entry is written individually
+# to accomodate systems with severe command-line-length
+# limitations.
+# Parameters:
+# $(1): variable containing entries to iterate over
+# $(2): output file
+write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
+
## ################################################################
##
@@ -64,10 +73,11 @@ if NULL_TARGET
## In this case, gcj is found outside the build tree. However, zip is
## found in the build tree.
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
+GCJH = gcjh
else
ZIP = jar
+GCJH = $(target_alias)-gcjh
endif
-GCJH = gcjh
else # CANADIAN
GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
@@ -94,13 +104,14 @@ GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
## We need _GNU_SOURCE defined for some Linux builds. It doesn't hurt
## to always define it.
-AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
+AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions $(THREADCXXFLAGS) \
## Some systems don't allow `$' in identifiers by default, so we force it.
-fdollars-in-identifiers \
## Detect bugs in the verifier implementation, and maybe other places.
-Wswitch-enum \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
- -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\""
+ -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\"" \
+ -DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\""
if USING_GCC
AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
else
@@ -165,6 +176,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
@@ -205,6 +217,7 @@ gnu/java/awt/peer/gtk/GtkClipboard.java \
gnu/java/awt/peer/gtk/GtkComponentPeer.java \
gnu/java/awt/peer/gtk/GtkContainerPeer.java \
gnu/java/awt/peer/gtk/GtkDialogPeer.java \
+gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java \
gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
gnu/java/awt/peer/gtk/GtkFontPeer.java \
gnu/java/awt/peer/gtk/GtkFramePeer.java \
@@ -229,11 +242,9 @@ gnu/java/awt/peer/gtk/GtkTextFieldPeer.java \
gnu/java/awt/peer/gtk/GtkToolkit.java \
gnu/java/awt/peer/gtk/GtkWindowPeer.java
-## FIXME: GNU make.
gtk_c_headers = $(patsubst %.java,jniinclude/%.h,$(subst /,_,$(gtk_awt_peer_sources)))
$(gtk_c_headers): $(gtk_awt_peer_sources)
-## FIXME: GNU make.
@input=`echo $@ | sed -e 's,jniinclude/,,' -e 's,_,.,g' -e 's,.h$$,,'`; \
echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \
$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input
@@ -328,9 +339,33 @@ all_java_source_files = \
all_java_class_files = $(all_java_source_files:.java=.class)
+if ONESTEP
+
+# Compile all classfiles in one go.
+
+libgcj-@gcc_version@.jar: $(all_java_source_files)
+ -@rm -f libgcj-@gcc_version@.jar
+ @echo Compiling Java sourcefiles...
+ @: $(call write_entries_to_file,$?,libgcj.sourcelist)
+ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) @libgcj.sourcelist
+## Note that we explicitly want to include directory information.
+ find java gnu javax org -type d -o -type f -name '*.class' | \
+ sed -e '/\/\./d' -e '/\/xlib/d' | \
+ $(ZIP) cfM0E@ $@
+
+# This next rule seems backward, but reflects the fact
+# that 1) all classfiles are compiled in one go when the
+# libgcj jarfile is built and 2) anything which depends
+# on a particular .class file must wait until the jarfile
+# is built.
+$(all_java_class_files): libgcj-@gcc_version@.jar
+
+else # !ONESTEP
+
+# Compile each classfile individually.
+
.java.class:
- $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) \
- -d $(here) $<
+ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) $<
libgcj-@gcc_version@.jar: $(all_java_class_files)
-@rm -f libgcj-@gcc_version@.jar
@@ -339,13 +374,26 @@ libgcj-@gcc_version@.jar: $(all_java_class_files)
sed -e '/\/\./d' -e '/\/xlib/d' | \
$(ZIP) cfM0E@ $@
-MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) $(x_javao_files) $(x_nat_files) $(x_nat_headers)
+endif
+
+# Note: The libtool objects are removed by mostlyclean-local
+# because of command-line-length issues.
+MOSTLYCLEANFILES = $(nat_headers) $(x_nat_headers)
+
CLEANFILES = libgcj-@gcc_version@.jar
+mostlyclean-local:
+## Use libtool rm to remove each libtool object
+ find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
+
clean-local:
-## We just remove every .class file that was created.
+## Remove every .class file that was created.
find . -name '*.class' -print | xargs rm -f
+distclean-local:
+## Remove every .d file that was created.
+ find . -name '*.d' -print | xargs rm -f
+
# Just remove the objects from C++ sources, for testing the C++ compiler.
clean-nat:
rm -f $(nat_files) $(x_nat_files)
@@ -358,28 +406,27 @@ SUFFIXES = .class .java .h
.java.lo:
$(GCJCOMPILE) -o $@ $<
-## This is GNU make specific. For the .o files in subdirs, use a
-## special rule. The standard automake rule can't be overridden (this
-## is a bug in automake), and it also won't put the .o files into
-## subdirs. FIXME.
+## FIXME: For the .o files in subdirs, use a special rule. The
+## standard automake rule can't be overridden (this is a bug in
+## automake), and it also won't put the .o files into subdirs.
$(nat_files) $(x_nat_files): %.lo: %.cc
@echo '$(LTCXXCOMPILE) -MD -MT $@ -MF $(@:.lo=.pp) -c -o $@ $<'; \
$(LTCXXCOMPILE) -MD -MT $@ -MF $(@:.lo=.pp) -c -o $@ $<
@-mv $(@:.lo=.pp) $(@:.lo=.d)
-## FIXME: GNU make.
+## FIXME: see above
$(c_files): %.lo: %.c
$(LTCOMPILE) -c -o $@ $<
$(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h
-## FIXME: GNU make.
+## FIXME: see above
$(gtk_c_files): %.lo: %.c
$(LTCOMPILE) -c -Ijniinclude -I$(srcdir)/jni/classpath -I$(srcdir)/jni/gtk-peer $(GTK_CFLAGS) $(LIBART_CFLAGS) -o $@ $<
$(gtk_c_files): $(gtk_c_headers)
-## FIXME: GNU make.
+## FIXME: see above.
$(javao_files) $(x_javao_files) $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_xml_sax_la_OBJECTS): %.lo: %.java
$(GCJCOMPILE) -o $@ $<
@@ -389,13 +436,15 @@ $(gtk_awt_peer_sources:.java=.lo): %.lo: %.java
## Pass the list of object files to libtool in a temporary file to
## avoid tripping platform command line length limits.
libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES)
- @: $(shell echo Creating list of files to link...) $(shell rm -f libgcj.objectlist || :) $(shell touch libgcj.objectlist) $(foreach object,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),$(shell echo $(object) >> libgcj.objectlist))
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
$(libgcj_la_LINK) -objectlist libgcj.objectlist \
@GCLIBS@ @LIBFFI@ @ZLIBS@ \
-rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS)
lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
- @: $(shell echo Creating list of files to link...) $(shell rm -f lib_gnu_awt_xlib.objectlist || :) $(shell touch lib_gnu_awt_xlib.objectlist) $(foreach object,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),$(shell echo $(object) >> lib_gnu_awt_xlib.objectlist))
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
$(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
-rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
@@ -406,7 +455,6 @@ lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPEND
##
.class.h:
-## FIXME: GNU make specific.
$(GCJH) -classpath '' -bootclasspath $(top_builddir) $(basename $<)
## Header files used when compiling some of the nat* files.
@@ -513,7 +561,8 @@ install-data-local:
$(PRE_INSTALL)
## We use a GNU make trick here so that we don't go over the command
## length limit of some shells.
- @: $(shell echo Creating list of headers to install...) $(shell rm -f tmp-ilist || :) $(shell touch tmp-ilist) $(foreach hdr,$(nat_headers) $(extra_headers),$(shell echo $(hdr) >> tmp-ilist))
+ @echo Creating list of headers to install...
+ @: $(call write_entries_to_file,$(nat_headers) $(extra_headers),tmp-ilist)
@cat tmp-ilist | while read f; do \
d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
$(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \
@@ -569,6 +618,11 @@ class-check: libgcj-@gcc_version@.jar
:; else ok=1; fi; \
done; exit $$ok
+## This rule checks whether write_entries_to_file works properly.
+write-entries-to-file-check:
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
+
## ################################################################
##
@@ -751,10 +805,13 @@ gnu/awt/j2d/MappedRaster.java \
gnu/java/awt/BitMaskExtent.java \
gnu/java/awt/Buffers.java \
gnu/java/awt/ComponentDataBlitOp.java \
+gnu/java/awt/EmbeddedWindow.java \
+gnu/java/awt/EmbeddedWindowSupport.java \
gnu/java/awt/EventModifier.java \
-gnu/java/awt/GLightweightPeer.java \
gnu/java/awt/image/ImageDecoder.java \
gnu/java/awt/image/XBMDecoder.java \
+gnu/java/awt/peer/EmbeddedWindowPeer.java \
+gnu/java/awt/peer/GLightweightPeer.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
@@ -816,6 +873,7 @@ java/awt/Graphics2D.java \
java/awt/GraphicsConfiguration.java \
java/awt/GridBagConstraints.java \
java/awt/GridBagLayout.java \
+java/awt/GridBagLayoutInfo.java \
java/awt/GridLayout.java \
java/awt/IllegalComponentStateException.java \
java/awt/Image.java \
@@ -1522,9 +1580,12 @@ gnu/java/rmi/registry/RegistryImpl.java \
gnu/java/rmi/registry/RegistryImpl_Skel.java \
gnu/java/rmi/registry/RegistryImpl_Stub.java \
gnu/java/rmi/rmic/Compile_gcj.java \
+gnu/java/rmi/rmic/Compile_jikes.java \
+gnu/java/rmi/rmic/Compile_kjc.java \
gnu/java/rmi/rmic/Compiler.java \
gnu/java/rmi/rmic/CompilerProcess.java \
gnu/java/rmi/rmic/RMIC.java \
+gnu/java/rmi/rmic/RMICException.java \
gnu/java/rmi/rmic/TabbedWriter.java \
gnu/java/rmi/server/ConnectionRunnerPool.java \
gnu/java/rmi/server/ProtocolConstants.java \
@@ -1947,12 +2008,15 @@ gnu/gcj/protocol/http/Connection.java \
gnu/gcj/protocol/http/Handler.java \
gnu/gcj/protocol/jar/Connection.java \
gnu/gcj/protocol/jar/Handler.java \
+gnu/gcj/protocol/gcjlib/Connection.java \
+gnu/gcj/protocol/gcjlib/Handler.java \
gnu/gcj/runtime/FileDeleter.java \
gnu/gcj/runtime/FinalizerThread.java \
gnu/gcj/runtime/FirstThread.java \
gnu/gcj/runtime/JNIWeakRef.java \
gnu/gcj/runtime/MethodRef.java \
gnu/gcj/runtime/NameFinder.java \
+gnu/gcj/runtime/SharedLibHelper.java \
gnu/gcj/runtime/SharedLibLoader.java \
gnu/gcj/runtime/StackTrace.java \
gnu/gcj/runtime/StringBuffer.java \
@@ -2106,9 +2170,12 @@ 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/PlainDatagramSocketImpl.java \
+gnu/java/net/PlainSocketImpl.java \
gnu/java/nio/DatagramChannelImpl.java \
-gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FileLockImpl.java \
+gnu/java/nio/NIODatagramSocket.java \
+gnu/java/nio/NIOSocket.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
gnu/java/nio/SelectorImpl.java \
@@ -2203,8 +2270,6 @@ java/net/NetPermission.java \
java/net/NetworkInterface.java \
java/net/NoRouteToHostException.java \
java/net/PasswordAuthentication.java \
-java/net/PlainDatagramSocketImpl.java \
-java/net/PlainSocketImpl.java \
java/net/PortUnreachableException.java \
java/net/ProtocolException.java \
java/net/ServerSocket.java \
@@ -2268,6 +2333,7 @@ java/nio/channels/ClosedSelectorException.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileChannelImpl.java \
java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
@@ -2573,7 +2639,9 @@ gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natStackTrace.cc \
gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
-gnu/java/nio/natFileChannelImpl.cc \
+gnu/java/awt/natEmbeddedWindow.cc \
+gnu/java/net/natPlainDatagramSocketImpl.cc \
+gnu/java/net/natPlainSocketImpl.cc \
gnu/java/nio/natFileLockImpl.cc \
gnu/java/nio/natSelectorImpl.cc \
java/io/natFile.cc \
@@ -2602,9 +2670,8 @@ java/lang/reflect/natMethod.cc \
java/lang/reflect/natProxy.cc \
java/net/natNetworkInterface.cc \
java/net/natInetAddress.cc \
-java/net/natPlainDatagramSocketImpl.cc \
-java/net/natPlainSocketImpl.cc \
java/nio/natDirectByteBufferImpl.cc \
+java/nio/channels/natFileChannelImpl.cc \
java/text/natCollator.cc \
java/util/natResourceBundle.cc \
java/util/natTimeZone.cc \
@@ -2642,6 +2709,7 @@ gnu/awt/xlib/XFontMetrics.java \
gnu/awt/xlib/XFramePeer.java \
gnu/awt/xlib/XGraphics.java \
gnu/awt/xlib/XGraphicsConfiguration.java \
+gnu/awt/xlib/XOffScreenImage.java \
gnu/awt/xlib/XPanelPeer.java \
gnu/awt/xlib/XToolkit.java
@@ -2711,7 +2779,6 @@ texinfo: TexinfoDoclet.class
## Dependency tracking madness.
##
-## FIXME: depends on GNU make.
-include deps.mk
## This is an evil hack to work around an automake limitation. We
@@ -2721,7 +2788,7 @@ texinfo: TexinfoDoclet.class
## the C++ code whenever any .java file is touched.
## Also force all the class files to build first. This makes them build in
## the right order to improve performance.
-all-recursive: $(all_java_class_files) $(nat_headers) $(x_nat_headers)
+all-recursive: libgcj-@gcc_version@.jar $(nat_headers) $(x_nat_headers)
## ################################################################
@@ -2737,6 +2804,7 @@ AM_MAKEFLAGS = \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 6b6d21b274c..b4ff7aca48e 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -123,6 +123,7 @@ STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
SYS_ZLIBS = @SYS_ZLIBS@
+THREADCXXFLAGS = @THREADCXXFLAGS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
THREADLDFLAGS = @THREADLDFLAGS@
@@ -150,6 +151,15 @@ AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I .
@TESTSUBDIR_TRUE@SUBDIRS = @TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include
@TESTSUBDIR_FALSE@SUBDIRS = @TESTSUBDIR_FALSE@$(DIRLTDL) gcj include
+
+# write_entries_to_file - writes each entry in a list
+# to the specified file. Each entry is written individually
+# to accomodate systems with severe command-line-length
+# limitations.
+# Parameters:
+# $(1): variable containing entries to iterate over
+# $(2): output file
+write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
@XLIB_AWT_TRUE@cond_x_ltlibrary = @XLIB_AWT_TRUE@lib-gnu-awt-xlib.la
@XLIB_AWT_FALSE@cond_x_ltlibrary =
@XLIB_AWT_TRUE@xlib_includes = @XLIB_AWT_TRUE@-I../libstdc++-v3/include -I../libstdc++-v3/include/$(target_alias) -I$(srcdir)/../libstdc++-v3/libsupc++
@@ -176,7 +186,8 @@ bin_SCRIPTS = addr2name.awk
@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_FALSE@jar
@CANADIAN_FALSE@ZIP = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
-@CANADIAN_TRUE@GCJH = @CANADIAN_TRUE@gcjh
+@CANADIAN_TRUE@@NULL_TARGET_TRUE@GCJH = @CANADIAN_TRUE@@NULL_TARGET_TRUE@gcjh
+@CANADIAN_TRUE@@NULL_TARGET_FALSE@GCJH = @CANADIAN_TRUE@@NULL_TARGET_FALSE@$(target_alias)-gcjh
@CANADIAN_FALSE@GCJH = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
@@ -192,11 +203,12 @@ JAVAC = $(GCJ_WITH_FLAGS) -C
GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
-AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
+AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions $(THREADCXXFLAGS) \
-fdollars-in-identifiers \
-Wswitch-enum \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
- -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\""
+ -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\"" \
+ -DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\""
@USING_GCC_TRUE@AM_CFLAGS = @USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
@USING_GCC_FALSE@AM_CFLAGS = @USING_GCC_FALSE@@LIBGCJ_CFLAGS@
@@ -254,6 +266,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
@@ -294,6 +307,7 @@ gnu/java/awt/peer/gtk/GtkClipboard.java \
gnu/java/awt/peer/gtk/GtkComponentPeer.java \
gnu/java/awt/peer/gtk/GtkContainerPeer.java \
gnu/java/awt/peer/gtk/GtkDialogPeer.java \
+gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java \
gnu/java/awt/peer/gtk/GtkFileDialogPeer.java \
gnu/java/awt/peer/gtk/GtkFontPeer.java \
gnu/java/awt/peer/gtk/GtkFramePeer.java \
@@ -415,7 +429,10 @@ all_java_source_files = \
all_java_class_files = $(all_java_source_files:.java=.class)
-MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) $(x_javao_files) $(x_nat_files) $(x_nat_headers)
+# Note: The libtool objects are removed by mostlyclean-local
+# because of command-line-length issues.
+MOSTLYCLEANFILES = $(nat_headers) $(x_nat_headers)
+
CLEANFILES = libgcj-@gcc_version@.jar
SUFFIXES = .class .java .h
@@ -522,10 +539,13 @@ gnu/awt/j2d/MappedRaster.java \
gnu/java/awt/BitMaskExtent.java \
gnu/java/awt/Buffers.java \
gnu/java/awt/ComponentDataBlitOp.java \
+gnu/java/awt/EmbeddedWindow.java \
+gnu/java/awt/EmbeddedWindowSupport.java \
gnu/java/awt/EventModifier.java \
-gnu/java/awt/GLightweightPeer.java \
gnu/java/awt/image/ImageDecoder.java \
gnu/java/awt/image/XBMDecoder.java \
+gnu/java/awt/peer/EmbeddedWindowPeer.java \
+gnu/java/awt/peer/GLightweightPeer.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
@@ -587,6 +607,7 @@ java/awt/Graphics2D.java \
java/awt/GraphicsConfiguration.java \
java/awt/GridBagConstraints.java \
java/awt/GridBagLayout.java \
+java/awt/GridBagLayoutInfo.java \
java/awt/GridLayout.java \
java/awt/IllegalComponentStateException.java \
java/awt/Image.java \
@@ -1294,9 +1315,12 @@ gnu/java/rmi/registry/RegistryImpl.java \
gnu/java/rmi/registry/RegistryImpl_Skel.java \
gnu/java/rmi/registry/RegistryImpl_Stub.java \
gnu/java/rmi/rmic/Compile_gcj.java \
+gnu/java/rmi/rmic/Compile_jikes.java \
+gnu/java/rmi/rmic/Compile_kjc.java \
gnu/java/rmi/rmic/Compiler.java \
gnu/java/rmi/rmic/CompilerProcess.java \
gnu/java/rmi/rmic/RMIC.java \
+gnu/java/rmi/rmic/RMICException.java \
gnu/java/rmi/rmic/TabbedWriter.java \
gnu/java/rmi/server/ConnectionRunnerPool.java \
gnu/java/rmi/server/ProtocolConstants.java \
@@ -1711,12 +1735,15 @@ gnu/gcj/protocol/http/Connection.java \
gnu/gcj/protocol/http/Handler.java \
gnu/gcj/protocol/jar/Connection.java \
gnu/gcj/protocol/jar/Handler.java \
+gnu/gcj/protocol/gcjlib/Connection.java \
+gnu/gcj/protocol/gcjlib/Handler.java \
gnu/gcj/runtime/FileDeleter.java \
gnu/gcj/runtime/FinalizerThread.java \
gnu/gcj/runtime/FirstThread.java \
gnu/gcj/runtime/JNIWeakRef.java \
gnu/gcj/runtime/MethodRef.java \
gnu/gcj/runtime/NameFinder.java \
+gnu/gcj/runtime/SharedLibHelper.java \
gnu/gcj/runtime/SharedLibLoader.java \
gnu/gcj/runtime/StackTrace.java \
gnu/gcj/runtime/StringBuffer.java \
@@ -1870,9 +1897,12 @@ 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/PlainDatagramSocketImpl.java \
+gnu/java/net/PlainSocketImpl.java \
gnu/java/nio/DatagramChannelImpl.java \
-gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FileLockImpl.java \
+gnu/java/nio/NIODatagramSocket.java \
+gnu/java/nio/NIOSocket.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
gnu/java/nio/SelectorImpl.java \
@@ -1967,8 +1997,6 @@ java/net/NetPermission.java \
java/net/NetworkInterface.java \
java/net/NoRouteToHostException.java \
java/net/PasswordAuthentication.java \
-java/net/PlainDatagramSocketImpl.java \
-java/net/PlainSocketImpl.java \
java/net/PortUnreachableException.java \
java/net/ProtocolException.java \
java/net/ServerSocket.java \
@@ -2032,6 +2060,7 @@ java/nio/channels/ClosedSelectorException.java \
java/nio/channels/ConnectionPendingException.java \
java/nio/channels/DatagramChannel.java \
java/nio/channels/FileChannel.java \
+java/nio/channels/FileChannelImpl.java \
java/nio/channels/FileLock.java \
java/nio/channels/FileLockInterruptionException.java \
java/nio/channels/GatheringByteChannel.java \
@@ -2336,7 +2365,9 @@ gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natStackTrace.cc \
gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
-gnu/java/nio/natFileChannelImpl.cc \
+gnu/java/awt/natEmbeddedWindow.cc \
+gnu/java/net/natPlainDatagramSocketImpl.cc \
+gnu/java/net/natPlainSocketImpl.cc \
gnu/java/nio/natFileLockImpl.cc \
gnu/java/nio/natSelectorImpl.cc \
java/io/natFile.cc \
@@ -2365,9 +2396,8 @@ java/lang/reflect/natMethod.cc \
java/lang/reflect/natProxy.cc \
java/net/natNetworkInterface.cc \
java/net/natInetAddress.cc \
-java/net/natPlainDatagramSocketImpl.cc \
-java/net/natPlainSocketImpl.cc \
java/nio/natDirectByteBufferImpl.cc \
+java/nio/channels/natFileChannelImpl.cc \
java/text/natCollator.cc \
java/util/natResourceBundle.cc \
java/util/natTimeZone.cc \
@@ -2406,6 +2436,7 @@ gnu/awt/xlib/XFontMetrics.java \
gnu/awt/xlib/XFramePeer.java \
gnu/awt/xlib/XGraphics.java \
gnu/awt/xlib/XGraphicsConfiguration.java \
+gnu/awt/xlib/XOffScreenImage.java \
gnu/awt/xlib/XPanelPeer.java \
gnu/awt/xlib/XToolkit.java
@@ -2441,6 +2472,7 @@ AM_MAKEFLAGS = \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
@@ -2510,22 +2542,24 @@ gnu/gcj/io/shs.lo gnu/gcj/protocol/core/natCoreInputStream.lo \
gnu/gcj/runtime/natFinalizerThread.lo gnu/gcj/runtime/natFirstThread.lo \
gnu/gcj/runtime/natNameFinder.lo gnu/gcj/runtime/natSharedLibLoader.lo \
gnu/gcj/runtime/natStackTrace.lo gnu/gcj/runtime/natStringBuffer.lo \
-gnu/gcj/runtime/natVMClassLoader.lo gnu/java/nio/natFileChannelImpl.lo \
-gnu/java/nio/natFileLockImpl.lo gnu/java/nio/natSelectorImpl.lo \
-java/io/natFile.lo java/io/natFileDescriptor.lo \
-java/io/natObjectInputStream.lo java/io/natVMObjectStreamClass.lo \
-java/lang/natCharacter.lo java/lang/natClass.lo \
-java/lang/natClassLoader.lo java/lang/natConcreteProcess.lo \
-java/lang/natDouble.lo java/lang/natFloat.lo java/lang/natMath.lo \
-java/lang/natObject.lo java/lang/natRuntime.lo java/lang/natString.lo \
+gnu/gcj/runtime/natVMClassLoader.lo gnu/java/awt/natEmbeddedWindow.lo \
+gnu/java/net/natPlainDatagramSocketImpl.lo \
+gnu/java/net/natPlainSocketImpl.lo gnu/java/nio/natFileLockImpl.lo \
+gnu/java/nio/natSelectorImpl.lo java/io/natFile.lo \
+java/io/natFileDescriptor.lo java/io/natObjectInputStream.lo \
+java/io/natVMObjectStreamClass.lo java/lang/natCharacter.lo \
+java/lang/natClass.lo java/lang/natClassLoader.lo \
+java/lang/natConcreteProcess.lo java/lang/natDouble.lo \
+java/lang/natFloat.lo java/lang/natMath.lo java/lang/natObject.lo \
+java/lang/natRuntime.lo java/lang/natString.lo \
java/lang/natStringBuffer.lo java/lang/natSystem.lo \
java/lang/natThread.lo java/lang/natVMSecurityManager.lo \
java/lang/ref/natReference.lo java/lang/reflect/natArray.lo \
java/lang/reflect/natConstructor.lo java/lang/reflect/natField.lo \
java/lang/reflect/natMethod.lo java/lang/reflect/natProxy.lo \
java/net/natNetworkInterface.lo java/net/natInetAddress.lo \
-java/net/natPlainDatagramSocketImpl.lo java/net/natPlainSocketImpl.lo \
-java/nio/natDirectByteBufferImpl.lo java/text/natCollator.lo \
+java/nio/natDirectByteBufferImpl.lo \
+java/nio/channels/natFileChannelImpl.lo java/text/natCollator.lo \
java/util/natResourceBundle.lo java/util/natTimeZone.lo \
java/util/zip/natDeflater.lo java/util/zip/natInflater.lo
lib_org_xml_sax_la_LDFLAGS =
@@ -2584,6 +2618,7 @@ gnu/java/awt/peer/gtk/GtkClipboard.lo \
gnu/java/awt/peer/gtk/GtkComponentPeer.lo \
gnu/java/awt/peer/gtk/GtkContainerPeer.lo \
gnu/java/awt/peer/gtk/GtkDialogPeer.lo \
+gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.lo \
gnu/java/awt/peer/gtk/GtkFileDialogPeer.lo \
gnu/java/awt/peer/gtk/GtkFontPeer.lo \
gnu/java/awt/peer/gtk/GtkFramePeer.lo \
@@ -2616,6 +2651,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.lo \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo \
@@ -2674,13 +2710,14 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DATA = $(jar_DATA) $(pkgconfig_DATA) $(toolexecmainlib_DATA)
DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \
-THANKS acinclude.m4 aclocal.m4 configure configure.in \
-libgcj-test.spec.in libgcj.pc.in libgcj.spec.in
+THANKS acinclude.m4 aclocal.m4 config.guess config.sub configure \
+configure.in install-sh libgcj-test.spec.in libgcj.pc.in libgcj.spec.in \
+ltmain.sh missing mkinstalldirs
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 \
@@ -2696,10 +2733,11 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/awt/xlib/XFontMetrics.P .deps/gnu/awt/xlib/XFramePeer.P \
.deps/gnu/awt/xlib/XGraphics.P \
.deps/gnu/awt/xlib/XGraphicsConfiguration.P \
-.deps/gnu/awt/xlib/XPanelPeer.P .deps/gnu/awt/xlib/XToolkit.P \
-.deps/gnu/classpath/Configuration.P .deps/gnu/gcj/Core.P \
-.deps/gnu/gcj/RawData.P .deps/gnu/gcj/convert/BytesToUnicode.P \
-.deps/gnu/gcj/convert/Convert.P .deps/gnu/gcj/convert/IOConverter.P \
+.deps/gnu/awt/xlib/XOffScreenImage.P .deps/gnu/awt/xlib/XPanelPeer.P \
+.deps/gnu/awt/xlib/XToolkit.P .deps/gnu/classpath/Configuration.P \
+.deps/gnu/gcj/Core.P .deps/gnu/gcj/RawData.P \
+.deps/gnu/gcj/convert/BytesToUnicode.P .deps/gnu/gcj/convert/Convert.P \
+.deps/gnu/gcj/convert/IOConverter.P \
.deps/gnu/gcj/convert/Input_8859_1.P \
.deps/gnu/gcj/convert/Input_ASCII.P \
.deps/gnu/gcj/convert/Input_EUCJIS.P \
@@ -2729,6 +2767,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/gcj/protocol/core/natCoreInputStream.P \
.deps/gnu/gcj/protocol/file/Connection.P \
.deps/gnu/gcj/protocol/file/Handler.P \
+.deps/gnu/gcj/protocol/gcjlib/Connection.P \
+.deps/gnu/gcj/protocol/gcjlib/Handler.P \
.deps/gnu/gcj/protocol/http/Connection.P \
.deps/gnu/gcj/protocol/http/Handler.P \
.deps/gnu/gcj/protocol/jar/Connection.P \
@@ -2737,6 +2777,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/gcj/runtime/FinalizerThread.P \
.deps/gnu/gcj/runtime/FirstThread.P .deps/gnu/gcj/runtime/JNIWeakRef.P \
.deps/gnu/gcj/runtime/MethodRef.P .deps/gnu/gcj/runtime/NameFinder.P \
+.deps/gnu/gcj/runtime/SharedLibHelper.P \
.deps/gnu/gcj/runtime/SharedLibLoader.P \
.deps/gnu/gcj/runtime/StackTrace.P .deps/gnu/gcj/runtime/StringBuffer.P \
.deps/gnu/gcj/runtime/VMClassLoader.P \
@@ -2774,9 +2815,11 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/awt/EmbeddedWindow.P \
.deps/gnu/java/awt/EmbeddedWindowSupport.P \
.deps/gnu/java/awt/EventModifier.P \
-.deps/gnu/java/awt/GLightweightPeer.P \
.deps/gnu/java/awt/image/ImageDecoder.P \
.deps/gnu/java/awt/image/XBMDecoder.P \
+.deps/gnu/java/awt/natEmbeddedWindow.P \
+.deps/gnu/java/awt/peer/EmbeddedWindowPeer.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/GtkArg.P \
@@ -2791,6 +2834,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/awt/peer/gtk/GtkComponentPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkContainerPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkDialogPeer.P \
+.deps/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkFileDialogPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkFontPeer.P \
.deps/gnu/java/awt/peer/gtk/GtkFramePeer.P \
@@ -2974,8 +3018,13 @@ 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/nio/DatagramChannelImpl.P \
-.deps/gnu/java/nio/FileChannelImpl.P .deps/gnu/java/nio/FileLockImpl.P \
+.deps/gnu/java/math/MPN.P .deps/gnu/java/net/PlainDatagramSocketImpl.P \
+.deps/gnu/java/net/PlainSocketImpl.P \
+.deps/gnu/java/net/natPlainDatagramSocketImpl.P \
+.deps/gnu/java/net/natPlainSocketImpl.P \
+.deps/gnu/java/nio/DatagramChannelImpl.P \
+.deps/gnu/java/nio/FileLockImpl.P \
+.deps/gnu/java/nio/NIODatagramSocket.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/SelectorProviderImpl.P \
@@ -2989,9 +3038,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/nio/charset/UTF_16Decoder.P \
.deps/gnu/java/nio/charset/UTF_16Encoder.P \
.deps/gnu/java/nio/charset/UTF_16LE.P \
-.deps/gnu/java/nio/charset/UTF_8.P \
-.deps/gnu/java/nio/natFileChannelImpl.P \
-.deps/gnu/java/nio/natFileLockImpl.P \
+.deps/gnu/java/nio/charset/UTF_8.P .deps/gnu/java/nio/natFileLockImpl.P \
.deps/gnu/java/nio/natSelectorImpl.P \
.deps/gnu/java/rmi/RMIMarshalledObjectInputStream.P \
.deps/gnu/java/rmi/RMIMarshalledObjectOutputStream.P \
@@ -3001,9 +3048,12 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/rmi/registry/RegistryImpl_Skel.P \
.deps/gnu/java/rmi/registry/RegistryImpl_Stub.P \
.deps/gnu/java/rmi/rmic/Compile_gcj.P \
+.deps/gnu/java/rmi/rmic/Compile_jikes.P \
+.deps/gnu/java/rmi/rmic/Compile_kjc.P \
.deps/gnu/java/rmi/rmic/Compiler.P \
.deps/gnu/java/rmi/rmic/CompilerProcess.P \
-.deps/gnu/java/rmi/rmic/RMIC.P .deps/gnu/java/rmi/rmic/TabbedWriter.P \
+.deps/gnu/java/rmi/rmic/RMIC.P .deps/gnu/java/rmi/rmic/RMICException.P \
+.deps/gnu/java/rmi/rmic/TabbedWriter.P \
.deps/gnu/java/rmi/server/ConnectionRunnerPool.P \
.deps/gnu/java/rmi/server/ProtocolConstants.P \
.deps/gnu/java/rmi/server/RMIDefaultSocketFactory.P \
@@ -3091,7 +3141,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/awt/GraphicsConfiguration.P .deps/java/awt/GraphicsDevice.P \
.deps/java/awt/GraphicsEnvironment.P \
.deps/java/awt/GridBagConstraints.P .deps/java/awt/GridBagLayout.P \
-.deps/java/awt/GridLayout.P .deps/java/awt/HeadlessException.P \
+.deps/java/awt/GridBagLayoutInfo.P .deps/java/awt/GridLayout.P \
+.deps/java/awt/HeadlessException.P \
.deps/java/awt/IllegalComponentStateException.P .deps/java/awt/Image.P \
.deps/java/awt/ImageCapabilities.P .deps/java/awt/Insets.P \
.deps/java/awt/ItemSelectable.P .deps/java/awt/JobAttributes.P \
@@ -3476,8 +3527,6 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/net/NetPermission.P .deps/java/net/NetworkInterface.P \
.deps/java/net/NoRouteToHostException.P \
.deps/java/net/PasswordAuthentication.P \
-.deps/java/net/PlainDatagramSocketImpl.P \
-.deps/java/net/PlainSocketImpl.P \
.deps/java/net/PortUnreachableException.P \
.deps/java/net/ProtocolException.P .deps/java/net/ServerSocket.P \
.deps/java/net/Socket.P .deps/java/net/SocketAddress.P \
@@ -3493,9 +3542,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/net/UnknownHostException.P \
.deps/java/net/UnknownServiceException.P \
.deps/java/net/natInetAddress.P .deps/java/net/natNetworkInterface.P \
-.deps/java/net/natPlainDatagramSocketImpl.P \
-.deps/java/net/natPlainSocketImpl.P .deps/java/nio/Buffer.P \
-.deps/java/nio/BufferOverflowException.P \
+.deps/java/nio/Buffer.P .deps/java/nio/BufferOverflowException.P \
.deps/java/nio/BufferUnderflowException.P .deps/java/nio/ByteBuffer.P \
.deps/java/nio/ByteBufferImpl.P .deps/java/nio/ByteOrder.P \
.deps/java/nio/CharBuffer.P .deps/java/nio/CharBufferImpl.P \
@@ -3521,6 +3568,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/nio/channels/ConnectionPendingException.P \
.deps/java/nio/channels/DatagramChannel.P \
.deps/java/nio/channels/FileChannel.P \
+.deps/java/nio/channels/FileChannelImpl.P \
.deps/java/nio/channels/FileLock.P \
.deps/java/nio/channels/FileLockInterruptionException.P \
.deps/java/nio/channels/GatheringByteChannel.P \
@@ -3544,6 +3592,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/nio/channels/UnresolvedAddressException.P \
.deps/java/nio/channels/UnsupportedAddressTypeException.P \
.deps/java/nio/channels/WritableByteChannel.P \
+.deps/java/nio/channels/natFileChannelImpl.P \
.deps/java/nio/channels/spi/AbstractInterruptibleChannel.P \
.deps/java/nio/channels/spi/AbstractSelectableChannel.P \
.deps/java/nio/channels/spi/AbstractSelectionKey.P \
@@ -4218,6 +4267,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.P \
+.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.P \
@@ -4766,7 +4816,8 @@ maintainer-clean-generic:
mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-binPROGRAMS \
mostlyclean-noinstPROGRAMS mostlyclean-tags \
- mostlyclean-depend mostlyclean-generic
+ mostlyclean-depend mostlyclean-generic \
+ mostlyclean-local
mostlyclean: mostlyclean-recursive
@@ -4779,7 +4830,8 @@ clean: clean-recursive
distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \
distclean-libtool distclean-binPROGRAMS \
distclean-noinstPROGRAMS distclean-tags \
- distclean-depend distclean-generic clean-am
+ distclean-depend distclean-generic clean-am \
+ distclean-local
-rm -f libtool
distclean: distclean-recursive
@@ -4831,19 +4883,44 @@ $(gtk_c_headers): $(gtk_awt_peer_sources)
echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \
$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input
-.java.class:
- $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) \
- -d $(here) $<
+# Compile all classfiles in one go.
+
+@ONESTEP_TRUE@libgcj-@gcc_version@.jar: $(all_java_source_files)
+@ONESTEP_TRUE@ -@rm -f libgcj-@gcc_version@.jar
+@ONESTEP_TRUE@ @echo Compiling Java sourcefiles...
+@ONESTEP_TRUE@ @: $(call write_entries_to_file,$?,libgcj.sourcelist)
+@ONESTEP_TRUE@ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) @libgcj.sourcelist
+@ONESTEP_TRUE@ find java gnu javax org -type d -o -type f -name '*.class' | \
+@ONESTEP_TRUE@ sed -e '/\/\./d' -e '/\/xlib/d' | \
+@ONESTEP_TRUE@ $(ZIP) cfM0E@ $@
+
+# This next rule seems backward, but reflects the fact
+# that 1) all classfiles are compiled in one go when the
+# libgcj jarfile is built and 2) anything which depends
+# on a particular .class file must wait until the jarfile
+# is built.
+@ONESTEP_TRUE@$(all_java_class_files): libgcj-@gcc_version@.jar
+
+# Compile each classfile individually.
-libgcj-@gcc_version@.jar: $(all_java_class_files)
- -@rm -f libgcj-@gcc_version@.jar
- find java gnu javax org -type d -o -type f -name '*.class' | \
- sed -e '/\/\./d' -e '/\/xlib/d' | \
- $(ZIP) cfM0E@ $@
+@ONESTEP_FALSE@.java.class:
+@ONESTEP_FALSE@ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) $<
+
+@ONESTEP_FALSE@libgcj-@gcc_version@.jar: $(all_java_class_files)
+@ONESTEP_FALSE@ -@rm -f libgcj-@gcc_version@.jar
+@ONESTEP_FALSE@ find java gnu javax org -type d -o -type f -name '*.class' | \
+@ONESTEP_FALSE@ sed -e '/\/\./d' -e '/\/xlib/d' | \
+@ONESTEP_FALSE@ $(ZIP) cfM0E@ $@
+
+mostlyclean-local:
+ find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
clean-local:
find . -name '*.class' -print | xargs rm -f
+distclean-local:
+ find . -name '*.d' -print | xargs rm -f
+
# Just remove the objects from C++ sources, for testing the C++ compiler.
clean-nat:
rm -f $(nat_files) $(x_nat_files)
@@ -4876,13 +4953,15 @@ $(gtk_awt_peer_sources:.java=.lo): %.lo: %.java
$(GCJCOMPILE) -fjni -o $@ $<
libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES)
- @: $(shell echo Creating list of files to link...) $(shell rm -f libgcj.objectlist || :) $(shell touch libgcj.objectlist) $(foreach object,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),$(shell echo $(object) >> libgcj.objectlist))
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
$(libgcj_la_LINK) -objectlist libgcj.objectlist \
@GCLIBS@ @LIBFFI@ @ZLIBS@ \
-rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS)
lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
- @: $(shell echo Creating list of files to link...) $(shell rm -f lib_gnu_awt_xlib.objectlist || :) $(shell touch lib_gnu_awt_xlib.objectlist) $(foreach object,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),$(shell echo $(object) >> lib_gnu_awt_xlib.objectlist))
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
$(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
-rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
@@ -4973,7 +5052,8 @@ $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
install-data-local:
$(PRE_INSTALL)
- @: $(shell echo Creating list of headers to install...) $(shell rm -f tmp-ilist || :) $(shell touch tmp-ilist) $(foreach hdr,$(nat_headers) $(extra_headers),$(shell echo $(hdr) >> tmp-ilist))
+ @echo Creating list of headers to install...
+ @: $(call write_entries_to_file,$(nat_headers) $(extra_headers),tmp-ilist)
@cat tmp-ilist | while read f; do \
d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
$(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \
@@ -5009,6 +5089,10 @@ class-check: libgcj-@gcc_version@.jar
:; else ok=1; fi; \
done; exit $$ok
+write-entries-to-file-check:
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
+
# The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
# You can get it from ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/.
@@ -5093,7 +5177,7 @@ texinfo: TexinfoDoclet.class
-include deps.mk
-all-recursive: $(all_java_class_files) $(nat_headers) $(x_nat_headers)
+all-recursive: libgcj-@gcc_version@.jar $(nat_headers) $(x_nat_headers)
# Multilib support.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
diff --git a/libjava/acconfig.h b/libjava/acconfig.h
index 4a511d51f23..7055826b29b 100644
--- a/libjava/acconfig.h
+++ b/libjava/acconfig.h
@@ -1,168 +1,2 @@
-/* Name of this package. */
-#undef PACKAGE
-
-/* Version number of this package. */
-#undef VERSION
-
-/* Define this if you want runtime debugging enabled. */
-#undef DEBUG
-
-/* Define if using POSIX threads that have the mutexattr functions. */
-#undef HAVE_PTHREAD_MUTEXATTR_INIT
-
-/* Define this if you prefer size over speed for java.lang.Character. */
-#undef COMPACT_CHARACTER
-
-/* Define if you have memcpy. */
-#undef HAVE_MEMCPY
-
-/* Define if you have memmove. */
-#undef HAVE_MEMMOVE
-
-/* Define if you have strerror. */
-#undef HAVE_STRERROR
-
-/* Define if you have fsync. */
-#undef HAVE_FSYNC
-
-/* Define if you have sleep. */
-#undef HAVE_SLEEP
-
-/* Define if you have int32_t and uint32_t. */
-#undef HAVE_INT32_DEFINED
-
-/* Define if you have u_int32_t */
-#undef HAVE_BSD_INT32_DEFINED
-
-/* Define if you're running eCos. */
-#undef ECOS
-
-/* */
-#undef HAVE_LOCALTIME
-
-/* */
-#undef HAVE_MKTIME
-
-/* Define if using POSIX threads on Linux. */
-#undef LINUX_THREADS
-
-/* Define if you have the `gmtime_r' function. */
-#undef HAVE_GMTIME_R
-
-/* Define if you have the `localtime_r' function. */
-#undef HAVE_LOCALTIME_R
-
/* Define to `int' if `ssize_t' is not defined. */
#undef ssize_t
-
-/* Define to 1 if `in_addr_t' is defined in sys/types.h or
- netinet/in.h. */
-#undef HAVE_IN_ADDR_T
-
-/* Define if inet6 structures are defined in netinet/in.h. */
-#undef HAVE_INET6
-
-/* Define if struct ip_mreq is defined in netinet/in.h. */
-#undef HAVE_STRUCT_IP_MREQ
-
-/* Define if struct ipv6_mreq is defined in netinet/in.h. */
-#undef HAVE_STRUCT_IPV6_MREQ
-
-/* Define it socklen_t typedef is in sys/socket.h. */
-#undef HAVE_SOCKLEN_T
-
-/* Define if Boehm GC in use. */
-#undef HAVE_BOEHM_GC
-
-/* Define if gethostname is declared in <unistd.h>. */
-#undef HAVE_GETHOSTNAME_DECL
-
-/* Define if gethostbyname_r returns `int'. */
-#undef GETHOSTBYNAME_R_RETURNS_INT
-
-/* Define if gethostbyaddr_r returns `int'. */
-#undef GETHOSTBYADDR_R_RETURNS_INT
-
-/* Define if usleep is declared in <unistd.h>. */
-#undef HAVE_USLEEP_DECL
-
-/* Define if struct tm has tm_gmtoff field. */
-#undef STRUCT_TM_HAS_GMTOFF
-
-/* Define if global `timezone' exists. */
-#undef HAVE_TIMEZONE
-
-/* Define to version of GCJ in use. */
-#undef GCJVERSION
-
-/* Define if if the synchronization code should try to avoid pthread_self
- calls by caching thread IDs in a hashtable. */
-#undef SLOW_PTHREAD_SELF
-
-/* Define if you have the appropriate function. */
-#undef HAVE_ACCESS
-#undef HAVE_STAT
-#undef HAVE_MKDIR
-#undef HAVE_RENAME
-#undef HAVE_RMDIR
-#undef HAVE_UNLINK
-#undef HAVE_REALPATH
-#undef HAVE_READDIR_R
-#undef HAVE_GETHOSTBYNAME_R
-#undef HAVE_GETHOSTBYADDR_R
-#undef HAVE_FTRUNCATE
-
-/* Define if you want a bytecode interpreter. */
-#undef INTERPRETER
-
-/* Define if pthread_mutex_t has m_count member. */
-#undef PTHREAD_MUTEX_HAVE_M_COUNT
-
-/* Define if pthread_mutex_t has __m_count member. */
-#undef PTHREAD_MUTEX_HAVE___M_COUNT
-
-/* Define if java.net native functions should be stubbed out. */
-#undef DISABLE_JAVA_NET
-
-/* Define if we're to use libffi. */
-#undef USE_LIBFFI
-
-/* Define if system properties shouldn't be read from
- getenv("GCJ_PROPERTIES"). */
-#undef DISABLE_GETENV_PROPERTIES
-
-/* Define if we should ignore arguments to main(). */
-#undef DISABLE_MAIN_ARGS
-
-/* Define if using setjmp/longjmp exceptions. */
-#undef SJLJ_EXCEPTIONS
-
-/* Define if you have /proc/self/exe */
-#undef HAVE_PROC_SELF_EXE
-
-/* Define if you have dladdr() */
-#undef HAVE_DLADDR
-
-/* Define if tzname is missing. */
-#undef NO_TZNAME
-
-/* Define if getuid() and friends are missing. */
-#undef NO_GETUID
-
-/* Define if libltdl is in use. */
-#undef USE_LTDL
-
-/* Define if g++ has a bug preventing us from inlining math routines. */
-#undef __NO_MATH_INLINES
-
-/* Define if you have working iconv() function. */
-#undef HAVE_ICONV
-
-/* Define if you are using JVMPI. */
-#undef ENABLE_JVMPI
-
-/* Define if your platform has a working backtrace() function. */
-#undef HAVE_BACKTRACE
-
-/* Define if your platform has the global _timezone variable. */
-#undef HAVE_UNDERSCORE_TIMEZONE
diff --git a/libjava/acinclude.m4 b/libjava/acinclude.m4
index 4a836046fa7..e25b1aed1ad 100644
--- a/libjava/acinclude.m4
+++ b/libjava/acinclude.m4
@@ -106,12 +106,6 @@ version=0.0.7
dnl Still use "libjava" here to placate dejagnu.
AM_INIT_AUTOMAKE(libjava, $version)
-# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
-# run it explicitly here, it will be run implicitly before
-# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
-# be run before AC_CANONICAL_HOST.
-AC_CANONICAL_BUILD
-
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4
index ef532589313..29e3a1a2a97 100644
--- a/libjava/aclocal.m4
+++ b/libjava/aclocal.m4
@@ -118,12 +118,6 @@ version=0.0.7
dnl Still use "libjava" here to placate dejagnu.
AM_INIT_AUTOMAKE(libjava, $version)
-# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
-# run it explicitly here, it will be run implicitly before
-# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
-# be run before AC_CANONICAL_HOST.
-AC_CANONICAL_BUILD
-
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
@@ -878,7 +872,10 @@ AC_ARG_ENABLE(libarttest, [ --disable-libarttest Do not try to compile an
fi
fi
- AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ AC_PATH_PROG(LIBART_CONFIG, libart2-config, no)
+ if test "$LIBART_CONFIG" = "no" ; then
+ AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ fi
min_libart_version=ifelse([$1], ,0.2.5,$1)
AC_MSG_CHECKING(for LIBART - version >= $min_libart_version)
no_libart=""
diff --git a/libjava/boehm.cc b/libjava/boehm.cc
index 5006059dabd..95721c7fbeb 100644
--- a/libjava/boehm.cc
+++ b/libjava/boehm.cc
@@ -1,6 +1,6 @@
// boehm.cc - interface between libjava and Boehm GC.
-/* 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 libgcj.
@@ -11,6 +11,7 @@ details. */
#include <config.h>
#include <stdio.h>
+#include <limits.h>
#include <jvm.h>
#include <gcj/cni.h>
@@ -325,11 +326,48 @@ _Jv_MarkArray (void *addr, void *msp, void *msl, void * /*env*/)
// since another one could be registered first. But the compiler also
// knows this, so in that case everything else will break, too.
#define GCJ_DEFAULT_DESCR GC_MAKE_PROC(GC_GCJ_RESERVED_MARK_PROC_INDEX,0)
+
void *
-_Jv_BuildGCDescr(jclass)
+_Jv_BuildGCDescr(jclass self)
{
- /* FIXME: We should really look at the class and build the descriptor. */
- return (void *)(GCJ_DEFAULT_DESCR);
+ jlong desc = 0;
+
+ // Note: for now we only consider a bitmap mark descriptor. We
+ // could also handle the case where the first N fields of a type are
+ // references. However, this is not very likely to be used by many
+ // classes, and it is easier to compute things this way.
+
+ for (jclass klass = self; klass != NULL; klass = klass->getSuperclass())
+ {
+ jfieldID field = JvGetFirstInstanceField(klass);
+ int count = JvNumInstanceFields(klass);
+
+ for (int i = 0; i < count; ++i)
+ {
+ if (field->isRef())
+ {
+ unsigned int off = field->getOffset();
+ // If we run into a weird situation, we bail.
+ if (off % sizeof (void *) != 0)
+ return (void *) (GCJ_DEFAULT_DESCR);
+ off /= sizeof (void *);
+ // Bottom 2 bits are reserved.
+ off += 2;
+ // If we find a field outside the range of our bitmap,
+ // fall back to procedure marker.
+ if (off > CHAR_BIT * sizeof (void *))
+ return (void *) (GCJ_DEFAULT_DESCR);
+ desc |= 1ULL << off;
+ }
+
+ field = field->getNextField();
+ }
+ }
+
+ // For bitmap mark type, bottom bits are 01.
+ desc |= 1;
+ // Bogus warning avoidance (on many platforms).
+ return (void *) (unsigned long) desc;
}
// Allocate some space that is known to be pointer-free.
diff --git a/libjava/configure b/libjava/configure
index ff307d17db0..703370cf5b2 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -40,7 +40,10 @@ ac_help="$ac_help
don't set system properties from GCJ_PROPERTIES"
ac_help="$ac_help
--enable-hash-synchronization
- Use global hash table for monitor locks"
+ use global hash table for monitor locks"
+ac_help="$ac_help
+ --enable-libgcj-multifile
+ allow compilation of several files at once"
ac_help="$ac_help
--enable-libgcj-debug enable runtime debugging code"
ac_help="$ac_help
@@ -593,7 +596,7 @@ fi
ORIGINAL_LD_FOR_MULTILIBS=$LD
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:597: checking whether ln -s works" >&5
+echo "configure:600: 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
@@ -646,7 +649,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:650: checking for a BSD compatible install" >&5
+echo "configure:653: 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
@@ -699,7 +702,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:703: checking whether build environment is sane" >&5
+echo "configure:706: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -756,7 +759,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:760: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:763: 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
@@ -789,12 +792,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:793: checking for Cygwin environment" >&5
+echo "configure:796: 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 798 "configure"
+#line 801 "configure"
#include "confdefs.h"
int main() {
@@ -805,7 +808,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -822,19 +825,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:826: checking for mingw32 environment" >&5
+echo "configure:829: 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 831 "configure"
+#line 834 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -961,7 +964,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:965: checking host system type" >&5
+echo "configure:968: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -982,7 +985,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:986: checking target system type" >&5
+echo "configure:989: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1000,7 +1003,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:1004: checking build system type" >&5
+echo "configure:1007: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1029,7 +1032,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:1033: checking for $ac_word" >&5
+echo "configure:1036: 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
@@ -1059,7 +1062,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:1063: checking for $ac_word" >&5
+echo "configure:1066: 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
@@ -1110,7 +1113,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:1114: checking for $ac_word" >&5
+echo "configure:1117: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1143,7 +1146,7 @@ fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1147: checking whether we are using GNU C" >&5
+echo "configure:1150: 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
@@ -1152,7 +1155,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1156: \"$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:1159: \"$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
@@ -1171,7 +1174,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:1175: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1178: 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
@@ -1220,7 +1223,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:1224: checking for $ac_word" >&5
+echo "configure:1227: 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
@@ -1255,7 +1258,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:1259: checking whether we are using GNU C++" >&5
+echo "configure:1262: 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
@@ -1264,7 +1267,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1268: \"$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:1271: \"$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
@@ -1279,7 +1282,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:1283: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1286: 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
@@ -1328,7 +1331,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1332: checking for working aclocal" >&5
+echo "configure:1335: 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.
@@ -1341,7 +1344,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1345: checking for working autoconf" >&5
+echo "configure:1348: 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.
@@ -1354,7 +1357,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1358: checking for working automake" >&5
+echo "configure:1361: 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.
@@ -1367,7 +1370,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1371: checking for working autoheader" >&5
+echo "configure:1374: 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.
@@ -1380,7 +1383,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1384: checking for working makeinfo" >&5
+echo "configure:1387: 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.
@@ -1394,33 +1397,10 @@ fi
-# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
-# run it explicitly here, it will be run implicitly before
-# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
-# be run before AC_CANONICAL_HOST.
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1403: 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
-
-
# 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:1424: checking for $ac_word" >&5
+echo "configure:1404: 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
@@ -1452,7 +1432,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:1456: checking for $ac_word" >&5
+echo "configure:1436: 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
@@ -1484,7 +1464,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:1488: checking for $ac_word" >&5
+echo "configure:1468: 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
@@ -1516,7 +1496,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:1520: checking for $ac_word" >&5
+echo "configure:1500: 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
@@ -1561,7 +1541,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:1565: checking for a BSD compatible install" >&5
+echo "configure:1545: 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
@@ -1615,7 +1595,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:1619: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1599: 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"
@@ -1641,7 +1621,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1645: checking for executable suffix" >&5
+echo "configure:1625: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1651,7 +1631,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1695,8 +1675,8 @@ LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
-# Only use libltdl for native builds.
-if test -z "${with_cross_host}"; then
+# Only use libltdl for non-newlib builds.
+if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
case $enable_ltdl_convenience in
no) { echo "configure: error: this package needs a convenience libltdl" 1>&2; exit 1; } ;;
"") enable_ltdl_convenience=yes
@@ -1801,7 +1781,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:1805: checking for ld used by GCC" >&5
+echo "configure:1785: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1831,10 +1811,10 @@ echo "configure:1805: 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:1835: checking for GNU ld" >&5
+echo "configure:1815: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1838: checking for non-GNU ld" >&5
+echo "configure:1818: 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
@@ -1869,7 +1849,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:1873: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1853: 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
@@ -1886,7 +1866,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:1890: checking for $LD option to reload object files" >&5
+echo "configure:1870: 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
@@ -1898,7 +1878,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:1902: checking for BSD-compatible nm" >&5
+echo "configure:1882: 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
@@ -1936,7 +1916,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:1940: checking how to recognise dependant libraries" >&5
+echo "configure:1920: 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
@@ -2109,13 +2089,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:2113: checking for object suffix" >&5
+echo "configure:2093: 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:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -2139,7 +2119,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:2143: checking for ${ac_tool_prefix}file" >&5
+echo "configure:2123: 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
@@ -2201,7 +2181,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:2205: checking for file" >&5
+echo "configure:2185: 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
@@ -2272,7 +2252,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:2276: checking for $ac_word" >&5
+echo "configure:2256: 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
@@ -2304,7 +2284,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:2308: checking for $ac_word" >&5
+echo "configure:2288: 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
@@ -2339,7 +2319,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:2343: checking for $ac_word" >&5
+echo "configure:2323: 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
@@ -2371,7 +2351,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:2375: checking for $ac_word" >&5
+echo "configure:2355: 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
@@ -2438,8 +2418,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 2442 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2422 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2423: \"$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*)
@@ -2472,7 +2452,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2488,14 +2468,14 @@ 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:2492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -2532,7 +2512,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:2536: checking whether the C compiler needs -belf" >&5
+echo "configure:2516: 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
@@ -2545,14 +2525,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 2549 "configure"
+#line 2529 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2536: \"$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
@@ -2582,7 +2562,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:2586: checking how to run the C++ preprocessor" >&5
+echo "configure:2566: 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
@@ -2595,12 +2575,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 2599 "configure"
+#line 2579 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2584: \"$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
:
@@ -2791,6 +2771,29 @@ if test -z "$enable_hash_synchronization"; then
enable_hash_synchronization=$enable_hash_synchronization_default
fi
+# Do we allow intermodule optimizations (i.e. compiling many files at once)?
+# Check whether --enable-libgcj-multifile or --disable-libgcj-multifile was given.
+if test "${enable_libgcj_multifile+set}" = set; then
+ enableval="$enable_libgcj_multifile"
+ case "${enableval}" in
+ yes) enable_libgcj_multifile=yes ;;
+ no) enable_libgcj_multifile=no ;;
+ *) { echo "configure: error: bad value ${enableval} for --enable-libgcj-multifile" 1>&2; exit 1; } ;;
+esac
+else
+ enable_libgcj_multifile=no
+fi
+
+
+
+if test "$enable_libgcj_multifile" = yes; then
+ ONESTEP_TRUE=
+ ONESTEP_FALSE='#'
+else
+ ONESTEP_TRUE='#'
+ ONESTEP_FALSE=
+fi
+
if test "${slow_pthread_self}" = "yes"; then
cat >> confdefs.h <<\EOF
#define SLOW_PTHREAD_SELF 1
@@ -2836,7 +2839,7 @@ INTERPRETER="$libgcj_interpreter"
echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
-echo "configure:2840: checking for exception model to use" >&5
+echo "configure:2843: 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.
@@ -2851,7 +2854,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
-#line 2855 "configure"
+#line 2858 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -2862,7 +2865,7 @@ void foo()
EOF
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-S
-if { (eval echo configure:2866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2869: \"$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
@@ -2973,7 +2976,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:2977: checking whether 'ld' is at least 2.13" >&5
+echo "configure:2980: 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`
@@ -3019,7 +3022,7 @@ esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3023: checking how to run the C preprocessor" >&5
+echo "configure:3026: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -3034,13 +3037,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 3038 "configure"
+#line 3041 "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:3044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3047: \"$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
:
@@ -3051,13 +3054,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 3055 "configure"
+#line 3058 "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:3061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3064: \"$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
:
@@ -3068,13 +3071,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 3072 "configure"
+#line 3075 "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:3078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3081: \"$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
:
@@ -3099,7 +3102,7 @@ fi
echo "$ac_t""$CPP" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 3103 "configure"
+#line 3106 "configure"
#include "confdefs.h"
#include <stdint.h>
EOF
@@ -3114,7 +3117,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3118 "configure"
+#line 3121 "configure"
#include "confdefs.h"
#include <inttypes.h>
EOF
@@ -3129,7 +3132,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3133 "configure"
+#line 3136 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3144,7 +3147,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3148 "configure"
+#line 3151 "configure"
#include "confdefs.h"
#include <sys/config.h>
EOF
@@ -3161,7 +3164,7 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3165 "configure"
+#line 3168 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3176,7 +3179,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3180 "configure"
+#line 3183 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3205,6 +3208,9 @@ test -d java/net || mkdir java/net
+test -d gnu/java || mkdir gnu/java
+test -d gnu/java/net || mkdir gnu/java/net
+
case "${host}" in
@@ -3236,7 +3242,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:3240: checking for X" >&5
+echo "configure:3246: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -3298,12 +3304,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 3302 "configure"
+#line 3308 "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:3307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3313: \"$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*
@@ -3372,14 +3378,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 3376 "configure"
+#line 3382 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3389: \"$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.
@@ -3485,17 +3491,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:3489: checking whether -R must be followed by a space" >&5
+echo "configure:3495: 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 3492 "configure"
+#line 3498 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -3511,14 +3517,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 3515 "configure"
+#line 3521 "configure"
#include "confdefs.h"
int main() {
; 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:3528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -3550,7 +3556,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:3554: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:3560: 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
@@ -3558,7 +3564,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3562 "configure"
+#line 3568 "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
@@ -3569,7 +3575,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3579: \"$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
@@ -3591,7 +3597,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:3595: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:3601: 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
@@ -3599,7 +3605,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3603 "configure"
+#line 3609 "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
@@ -3610,7 +3616,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:3614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3620: \"$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
@@ -3639,12 +3645,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:3643: checking for gethostbyname" >&5
+echo "configure:3649: 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 3648 "configure"
+#line 3654 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -3667,7 +3673,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:3671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3677: \"$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
@@ -3688,7 +3694,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3692: checking for gethostbyname in -lnsl" >&5
+echo "configure:3698: 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
@@ -3696,7 +3702,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3700 "configure"
+#line 3706 "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
@@ -3707,7 +3713,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:3711: \"$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_lib_$ac_lib_var=yes"
else
@@ -3737,12 +3743,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:3741: checking for connect" >&5
+echo "configure:3747: 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 3746 "configure"
+#line 3752 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -3765,7 +3771,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3775: \"$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
@@ -3786,7 +3792,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3790: checking for connect in -lsocket" >&5
+echo "configure:3796: 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
@@ -3794,7 +3800,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3798 "configure"
+#line 3804 "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
@@ -3805,7 +3811,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:3809: \"$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_lib_$ac_lib_var=yes"
else
@@ -3829,12 +3835,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:3833: checking for remove" >&5
+echo "configure:3839: 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 3838 "configure"
+#line 3844 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -3857,7 +3863,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3867: \"$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
@@ -3878,7 +3884,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:3882: checking for remove in -lposix" >&5
+echo "configure:3888: 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
@@ -3886,7 +3892,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3890 "configure"
+#line 3896 "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
@@ -3897,7 +3903,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:3901: \"$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_lib_$ac_lib_var=yes"
else
@@ -3921,12 +3927,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:3925: checking for shmat" >&5
+echo "configure:3931: 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 3930 "configure"
+#line 3936 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -3949,7 +3955,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3959: \"$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
@@ -3970,7 +3976,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:3974: checking for shmat in -lipc" >&5
+echo "configure:3980: 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
@@ -3978,7 +3984,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3982 "configure"
+#line 3988 "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
@@ -3989,7 +3995,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:3993: \"$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_lib_$ac_lib_var=yes"
else
@@ -4022,7 +4028,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:4026: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4032: 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
@@ -4030,7 +4036,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4034 "configure"
+#line 4040 "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
@@ -4041,7 +4047,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:4045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4051: \"$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
@@ -4139,7 +4145,7 @@ fi
libsubdir=.libs
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:4143: checking for garbage collector to use" >&5
+echo "configure:4149: 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"
@@ -4160,11 +4166,10 @@ case "$GC" in
boehm)
echo "$ac_t""boehm" 1>&6
GCLIBS=../boehm-gc/libgcjgc_convenience.la
- GCINCS='-I$(top_srcdir)/../boehm-gc/include'
JC1GCSPEC='-fuse-boehm-gc'
GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs"
- GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
+ GCINCS="`cat ../boehm-gc/boehm-cflags`"
GCOBJS=boehm.lo
GCHDR=boehm-gc.h
cat >> confdefs.h <<\EOF
@@ -4192,7 +4197,7 @@ esac
echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
-echo "configure:4196: checking for thread model used by GCC" >&5
+echo "configure:4201: 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
@@ -4221,6 +4226,7 @@ EOF
;;
esac
+THREADCXXFLAGS=
THREADLDFLAGS=
THREADLIBS=
THREADINCS=
@@ -4255,6 +4261,12 @@ case "$THREADS" in
THREADLDFLAGS=-pthread
THREADSPEC=-lc_r
;;
+ alpha*-dec-osf*)
+ THREADCXXFLAGS=-pthread
+ # boehm-gc needs some functions from librt, so link that too.
+ THREADLIBS='-lpthread -lrt'
+ THREADSPEC='-lpthread -lrt'
+ ;;
*)
THREADLIBS=-lpthread
THREADSPEC=-lpthread
@@ -4302,6 +4314,7 @@ esac
+
if test -d sysdep; then true; else mkdir sysdep; fi
@@ -4338,7 +4351,7 @@ GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
gcc_version_trigger=${libgcj_basedir}/../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-lib/$(target_alias)/'${gcc_version}/include
+tool_include_dir='$(libdir)/gcc/$(target_alias)/'${gcc_version}/include
@@ -4373,6 +4386,10 @@ EOF
#define HAVE_LOCALTIME_R 1
EOF
+ cat >> confdefs.h <<\EOF
+#define HAVE_USLEEP_DECL 1
+EOF
+
cat >> confdefs.h <<\EOF
#define HAVE_PTHREAD_MUTEXATTR_INIT 1
EOF
@@ -4386,27 +4403,17 @@ EOF
#define NO_GETUID 1
EOF
-
- # If Canadian cross, then don't pick up tools from the build
- # directory.
- if test x"$build" != x"$with_cross_host" \
- && test x"$build" != x"$target"; then
- CANADIAN=yes
- GCC_UNWIND_INCLUDE=
- GCJ="${target_alias}-gcj"
- fi
- NATIVE=no
PLATFORMNET=NoNet
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:4405: checking for $ac_func" >&5
+echo "configure:4408: 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 4410 "configure"
+#line 4413 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4429,7 +4436,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4436: \"$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
@@ -4456,12 +4463,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:4460: checking for $ac_func" >&5
+echo "configure:4463: 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 4465 "configure"
+#line 4468 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4484,7 +4491,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4491: \"$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
@@ -4511,12 +4518,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:4515: checking for $ac_func" >&5
+echo "configure:4518: 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 4520 "configure"
+#line 4523 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4539,7 +4546,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4546: \"$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
@@ -4566,12 +4573,12 @@ done
for ac_func in nl_langinfo setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4570: checking for $ac_func" >&5
+echo "configure:4573: 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 4575 "configure"
+#line 4578 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4594,7 +4601,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4601: \"$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
@@ -4621,12 +4628,12 @@ done
for ac_func in inet_aton inet_addr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4625: checking for $ac_func" >&5
+echo "configure:4628: 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 4630 "configure"
+#line 4633 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4649,7 +4656,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4656: \"$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
@@ -4676,12 +4683,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:4680: checking for $ac_func" >&5
+echo "configure:4683: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4685 "configure"
+#line 4688 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4704,7 +4711,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4711: \"$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
@@ -4731,12 +4738,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:4735: checking for $ac_func" >&5
+echo "configure:4738: 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 4740 "configure"
+#line 4743 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4759,7 +4766,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4766: \"$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
@@ -4787,17 +4794,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4791: checking for $ac_hdr" >&5
+echo "configure:4794: 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 4796 "configure"
+#line 4799 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4804: \"$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*
@@ -4824,12 +4831,12 @@ fi
done
echo $ac_n "checking for backtrace""... $ac_c" 1>&6
-echo "configure:4828: checking for backtrace" >&5
+echo "configure:4831: 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 4833 "configure"
+#line 4836 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char backtrace(); below. */
@@ -4852,7 +4859,7 @@ backtrace();
; return 0; }
EOF
-if { (eval echo configure:4856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4859: \"$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
@@ -4896,7 +4903,7 @@ fi
echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6
-echo "configure:4900: checking for dladdr in -ldl" >&5
+echo "configure:4903: 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
@@ -4904,7 +4911,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4908 "configure"
+#line 4911 "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
@@ -4915,7 +4922,7 @@ int main() {
dladdr()
; return 0; }
EOF
-if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4922: \"$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
@@ -4945,7 +4952,7 @@ do
ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_file""... $ac_c" 1>&6
-echo "configure:4949: checking for $ac_file" >&5
+echo "configure:4952: 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
@@ -5003,7 +5010,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:5007: checking for iconv" >&5
+echo "configure:5010: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5011,7 +5018,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 5015 "configure"
+#line 5018 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5021,7 +5028,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -5033,7 +5040,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 5037 "configure"
+#line 5040 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5043,7 +5050,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5050: \"$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
@@ -5064,13 +5071,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:5068: checking for iconv declaration" >&5
+echo "configure:5071: 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 5074 "configure"
+#line 5077 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -5089,7 +5096,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -5118,19 +5125,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:5122: checking for LC_MESSAGES" >&5
+echo "configure:5125: 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 5127 "configure"
+#line 5130 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:5134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5137: \"$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
@@ -5151,12 +5158,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:5155: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5158: 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 5160 "configure"
+#line 5163 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -5164,7 +5171,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:5168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -5185,12 +5192,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:5189: checking for tm_zone in struct tm" >&5
+echo "configure:5192: 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 5194 "configure"
+#line 5197 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -5198,7 +5205,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:5202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -5218,12 +5225,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:5222: checking for tzname" >&5
+echo "configure:5225: 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 5227 "configure"
+#line 5230 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -5233,7 +5240,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:5237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -5258,12 +5265,12 @@ fi
for ac_func in gethostbyname_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5262: checking for $ac_func" >&5
+echo "configure:5265: 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 5267 "configure"
+#line 5270 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5286,7 +5293,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5293: \"$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
@@ -5313,7 +5320,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5317 "configure"
+#line 5320 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5333,7 +5340,7 @@ rm -f conftest*
*" -D_REENTRANT "*) ;;
*)
echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6
-echo "configure:5337: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
+echo "configure:5340: 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
@@ -5346,14 +5353,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 5350 "configure"
+#line 5353 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=no
else
@@ -5363,14 +5370,14 @@ else
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
cat > conftest.$ac_ext <<EOF
-#line 5367 "configure"
+#line 5370 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=yes
else
@@ -5405,12 +5412,12 @@ EOF
esac
echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6
-echo "configure:5409: checking for struct hostent_data" >&5
+echo "configure:5412: 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 5414 "configure"
+#line 5417 "configure"
#include "confdefs.h"
#if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -5421,7 +5428,7 @@ int main() {
struct hostent_data data;
; return 0; }
EOF
-if { (eval echo configure:5425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_struct_hostent_data=yes
else
@@ -5453,7 +5460,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 5457 "configure"
+#line 5460 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5464,12 +5471,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:5468: checking for $ac_func" >&5
+echo "configure:5471: 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 5473 "configure"
+#line 5476 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5492,7 +5499,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5499: \"$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
@@ -5519,7 +5526,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5523 "configure"
+#line 5526 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5546,12 +5553,12 @@ rm -f conftest*
for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5550: checking for $ac_func" >&5
+echo "configure:5553: 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 5555 "configure"
+#line 5558 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5574,7 +5581,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5581: \"$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
@@ -5598,7 +5605,7 @@ EOF
EOF
cat > conftest.$ac_ext <<EOF
-#line 5602 "configure"
+#line 5605 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -5622,12 +5629,12 @@ done
for ac_func in usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5626: checking for $ac_func" >&5
+echo "configure:5629: 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 5631 "configure"
+#line 5634 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5650,7 +5657,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5657: \"$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
@@ -5670,7 +5677,7 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
EOF
cat > conftest.$ac_ext <<EOF
-#line 5674 "configure"
+#line 5677 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -5701,12 +5708,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:5705: checking for $ac_func" >&5
+echo "configure:5708: 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 5710 "configure"
+#line 5713 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5729,7 +5736,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5736: \"$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
@@ -5759,12 +5766,12 @@ done
for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5763: checking for $ac_func" >&5
+echo "configure:5766: 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 5768 "configure"
+#line 5771 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5787,7 +5794,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5794: \"$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
@@ -5809,7 +5816,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:5813: checking for sched_yield in -lrt" >&5
+echo "configure:5816: 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
@@ -5817,7 +5824,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5821 "configure"
+#line 5824 "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
@@ -5828,7 +5835,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5832: \"$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_lib_$ac_lib_var=yes"
else
@@ -5854,7 +5861,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:5858: checking for sched_yield in -lposix4" >&5
+echo "configure:5861: 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
@@ -5862,7 +5869,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5866 "configure"
+#line 5869 "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
@@ -5873,7 +5880,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5880: \"$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
@@ -5909,7 +5916,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 5913 "configure"
+#line 5916 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5918,7 +5925,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE_M_COUNT 1
@@ -5930,7 +5937,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 5934 "configure"
+#line 5937 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5939,7 +5946,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE___M_COUNT 1
@@ -5959,12 +5966,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:5963: checking for $ac_func" >&5
+echo "configure:5966: 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 5968 "configure"
+#line 5971 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5987,7 +5994,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5994: \"$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
@@ -6018,12 +6025,12 @@ done
for ac_func in memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6022: checking for $ac_func" >&5
+echo "configure:6025: 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 6027 "configure"
+#line 6030 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6046,7 +6053,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6053: \"$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
@@ -6076,12 +6083,12 @@ done
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6080: checking for $ac_func" >&5
+echo "configure:6083: 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 6085 "configure"
+#line 6088 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6104,7 +6111,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6111: \"$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
@@ -6133,7 +6140,7 @@ done
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6137: checking for dlopen in -ldl" >&5
+echo "configure:6140: 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
@@ -6141,7 +6148,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6145 "configure"
+#line 6148 "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
@@ -6152,7 +6159,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:6156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6159: \"$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
@@ -6197,7 +6204,7 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:6201: checking for socket libraries" >&5
+echo "configure:6204: 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
@@ -6205,12 +6212,12 @@ else
gcj_checkBoth=0
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6209: checking for connect" >&5
+echo "configure:6212: 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 6214 "configure"
+#line 6217 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -6233,7 +6240,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:6237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6240: \"$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
@@ -6256,7 +6263,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:6260: checking for main in -lsocket" >&5
+echo "configure:6263: 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
@@ -6264,14 +6271,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6268 "configure"
+#line 6271 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6278: \"$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
@@ -6298,12 +6305,12 @@ fi
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:6302: checking for accept" >&5
+echo "configure:6305: 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 6307 "configure"
+#line 6310 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -6326,7 +6333,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:6330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6333: \"$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
@@ -6353,12 +6360,12 @@ fi
gcj_oldLibs=$LIBS
LIBS="$LIBS $gcj_cv_lib_sockets"
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6357: checking for gethostbyname" >&5
+echo "configure:6360: 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 6362 "configure"
+#line 6365 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -6381,7 +6388,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:6385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6388: \"$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
@@ -6399,7 +6406,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:6403: checking for main in -lnsl" >&5
+echo "configure:6406: 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
@@ -6407,14 +6414,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6411 "configure"
+#line 6414 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6421: \"$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
@@ -6446,7 +6453,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:6450: checking for deflate in -lz" >&5
+echo "configure:6453: 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
@@ -6454,7 +6461,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6458 "configure"
+#line 6461 "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
@@ -6465,7 +6472,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:6469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6472: \"$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
@@ -6514,7 +6521,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:6518: checking for $ac_word" >&5
+echo "configure:6521: 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
@@ -6562,7 +6569,7 @@ fi
min_gtk_version=2.0.0
echo $ac_n "checking for GTK+ - version >= $min_gtk_version""... $ac_c" 1>&6
-echo "configure:6566: checking for GTK+ - version >= $min_gtk_version" >&5
+echo "configure:6569: 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
@@ -6597,7 +6604,7 @@ echo "configure:6566: checking for GTK+ - version >= $min_gtk_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6601 "configure"
+#line 6604 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6672,7 +6679,7 @@ main ()
}
EOF
-if { (eval echo configure:6676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6706,7 +6713,7 @@ fi
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6710 "configure"
+#line 6713 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6716,7 +6723,7 @@ int main() {
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6723: \"$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"
@@ -6775,7 +6782,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:6779: checking for $ac_word" >&5
+echo "configure:6782: 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
@@ -6825,7 +6832,7 @@ fi
min_glib_version=2.0.0
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
-echo "configure:6829: checking for GLIB - version >= $min_glib_version" >&5
+echo "configure:6832: 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
@@ -6864,7 +6871,7 @@ echo "configure:6829: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6868 "configure"
+#line 6871 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6939,7 +6946,7 @@ main ()
}
EOF
-if { (eval echo configure:6943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6973,7 +6980,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6977 "configure"
+#line 6980 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -6983,7 +6990,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6990: \"$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"
@@ -7059,10 +7066,47 @@ fi
fi
fi
- # Extract the first word of "libart-config", so it can be a program name with args.
+ # 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:7069: 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
+ case "$LIBART_CONFIG" in
+ /*)
+ ac_cv_path_LIBART_CONFIG="$LIBART_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_LIBART_CONFIG="$LIBART_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ 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_path_LIBART_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_LIBART_CONFIG" && ac_cv_path_LIBART_CONFIG="no"
+ ;;
+esac
+fi
+LIBART_CONFIG="$ac_cv_path_LIBART_CONFIG"
+if test -n "$LIBART_CONFIG"; then
+ echo "$ac_t""$LIBART_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$LIBART_CONFIG" = "no" ; then
+ # 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:7066: checking for $ac_word" >&5
+echo "configure:7106: 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
@@ -7095,9 +7139,10 @@ else
echo "$ac_t""no" 1>&6
fi
+ fi
min_libart_version=2.1.0
echo $ac_n "checking for LIBART - version >= $min_libart_version""... $ac_c" 1>&6
-echo "configure:7101: checking for LIBART - version >= $min_libart_version" >&5
+echo "configure:7142: checking for LIBART - version >= $min_libart_version" >&5
no_libart=""
if test "$LIBART_CONFIG" = "no" ; then
no_libart=yes
@@ -7121,7 +7166,7 @@ echo "configure:7101: checking for LIBART - version >= $min_libart_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 7125 "configure"
+#line 7166 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7179,7 +7224,7 @@ int main ()
EOF
-if { (eval echo configure:7183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7213,7 +7258,7 @@ fi
CFLAGS="$CFLAGS $LIBART_CFLAGS"
LIBS="$LIBS $LIBART_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7217 "configure"
+#line 7258 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7223,7 +7268,7 @@ int main() {
return 0;
; return 0; }
EOF
-if { (eval echo configure:7227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7268: \"$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"
@@ -7262,7 +7307,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:7266: checking for main in -ldl" >&5
+echo "configure:7307: 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
@@ -7270,14 +7315,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7274 "configure"
+#line 7315 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:7281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7322: \"$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
@@ -7298,23 +7343,77 @@ else
fi
fi
+fi
- if test -z "${with_multisubdir}"; then
- builddotdot=.
- else
+if test -z "${with_multisubdir}"; then
+ builddotdot=.
+else
- builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
+ builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
- fi
- if test -x "${builddotdot}/../../gcc/gcj"; then
- dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
- GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
- else
+fi
+
+# Which gcj do we use?
+which_gcj=default
+built_gcc_dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
+if test -n "${with_cross_host}"; then
+ # We are being configured with a cross compiler. We can't
+ # use ac_exeext, because that is for the target platform.
+ NATIVE=no
+ cross_host_exeext=
+ case "${with_cross_host}" in
+ *mingw* | *cygwin*)
+ cross_host_exeext=.exe
+ ;;
+ esac
+ if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
+ if test x"$build_alias" = x"$with_cross_host"; then
+ # Ordinary cross (host!=target and host=build)
+ which_gcj=built
+ else
+ # Canadian cross (host!=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=cross
+ fi
+else
+ # We are being configured with a native or crossed-native compiler
+ if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ # True native build (host=target and host=build)
+ which_gcj=built
+ else
+ # Crossed-native build (host=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
+fi
+case "${which_gcj}" in
+ built)
+ GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
+ ;;
+ cross)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
+ CANADIAN=yes
+ NULL_TARGET=no
+ if test "x${with_newlib}" = "xyes"; then
+ # FIXME (comment): Why is this needed?
+ GCC_UNWIND_INCLUDE=
+ GCJ="${target_alias}-gcj"
+ else
+ GCJ="${target_alias}-gcj -B`${PWDCMD-pwd}`/"
+ fi
+ ;;
+ path)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
CANADIAN=yes
NULL_TARGET=yes
GCJ="gcj -B`${PWDCMD-pwd}`/"
- fi
-fi
+ ;;
+esac
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
@@ -7344,7 +7443,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:7348: checking for $ac_word" >&5
+echo "configure:7443: 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
@@ -7376,7 +7475,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:7380: checking for $ac_word" >&5
+echo "configure:7475: 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
@@ -7438,13 +7537,13 @@ exec 5>>./config.log
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:7442: checking size of void *" >&5
+echo "configure:7537: 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 7448 "configure"
+#line 7543 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -7454,7 +7553,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:7458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -7563,49 +7662,21 @@ cat >> confdefs.h <<EOF
EOF
-echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6
-echo "configure:7568: checking for g++ -ffloat-store bug" >&5
-save_CFLAGS="$CFLAGS"
-CFLAGS="-x c++ -O2 -ffloat-store"
-cat > conftest.$ac_ext <<EOF
-#line 7572 "configure"
-#include "confdefs.h"
-#include <math.h>
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:7579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
-#define __NO_MATH_INLINES 1
-EOF
-
- echo "$ac_t""yes" 1>&6
-fi
-rm -f conftest*
-CFLAGS="$save_CFLAGS"
-
for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h pwd.h sys/config.h stdint.h langinfo.h locale.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7599: checking for $ac_hdr" >&5
+echo "configure:7666: 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 7604 "configure"
+#line 7671 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7676: \"$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*
@@ -7635,17 +7706,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:7639: checking for $ac_hdr" >&5
+echo "configure:7706: 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 7644 "configure"
+#line 7711 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7716: \"$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*
@@ -7675,17 +7746,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:7679: checking for $ac_hdr" >&5
+echo "configure:7746: 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 7684 "configure"
+#line 7751 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7756: \"$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*
@@ -7721,12 +7792,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:7725: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:7792: 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 7730 "configure"
+#line 7797 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -7742,7 +7813,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:7746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -7764,12 +7835,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:7768: checking for ANSI C header files" >&5
+echo "configure:7835: 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 7773 "configure"
+#line 7840 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -7777,7 +7848,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7848: \"$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*
@@ -7794,7 +7865,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 7798 "configure"
+#line 7865 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -7812,7 +7883,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 7816 "configure"
+#line 7883 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -7833,7 +7904,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 7837 "configure"
+#line 7904 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -7844,7 +7915,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:7848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7868,12 +7939,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:7872: checking for ssize_t" >&5
+echo "configure:7939: 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 7877 "configure"
+#line 7944 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7902,9 +7973,9 @@ fi
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:7906: checking for in_addr_t" >&5
+echo "configure:7973: checking for in_addr_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 7908 "configure"
+#line 7975 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -7918,7 +7989,7 @@ int main() {
in_addr_t foo;
; return 0; }
EOF
-if { (eval echo configure:7922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IN_ADDR_T 1
@@ -7934,16 +8005,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7938: checking whether struct ip_mreq is in netinet/in.h" >&5
+echo "configure:8005: checking whether struct ip_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7940 "configure"
+#line 8007 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ip_mreq mreq;
; return 0; }
EOF
-if { (eval echo configure:7947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IP_MREQ 1
@@ -7959,16 +8030,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7963: checking whether struct ipv6_mreq is in netinet/in.h" >&5
+echo "configure:8030: checking whether struct ipv6_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7965 "configure"
+#line 8032 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ipv6_mreq mreq6;
; return 0; }
EOF
-if { (eval echo configure:7972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IPV6_MREQ 1
@@ -7984,16 +8055,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:7988: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:8055: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 7990 "configure"
+#line 8057 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct sockaddr_in6 addr6;
; return 0; }
EOF
-if { (eval echo configure:7997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_INET6 1
@@ -8009,9 +8080,9 @@ fi
rm -f conftest*
echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:8013: checking for socklen_t in sys/socket.h" >&5
+echo "configure:8080: checking for socklen_t in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 8015 "configure"
+#line 8082 "configure"
#include "confdefs.h"
#define _POSIX_PII_SOCKET
#include <sys/types.h>
@@ -8020,7 +8091,7 @@ int main() {
socklen_t x = 5;
; return 0; }
EOF
-if { (eval echo configure:8024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
@@ -8036,16 +8107,16 @@ fi
rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:8040: checking for tm_gmtoff in struct tm" >&5
+echo "configure:8107: checking for tm_gmtoff in struct tm" >&5
cat > conftest.$ac_ext <<EOF
-#line 8042 "configure"
+#line 8109 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm tim; tim.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:8049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define STRUCT_TM_HAS_GMTOFF 1
@@ -8058,16 +8129,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:8062: checking for global timezone variable" >&5
+echo "configure:8129: checking for global timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8064 "configure"
+#line 8131 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
void i(){long z2 = 2*timezone;}
; return 0; }
EOF
-if { (eval echo configure:8071: \"$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_TIMEZONE 1
@@ -8080,16 +8151,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:8084: checking for global _timezone variable" >&5
+echo "configure:8151: checking for global _timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8086 "configure"
+#line 8153 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
long z2 = _timezone;
; return 0; }
EOF
-if { (eval echo configure:8093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_UNDERSCORE_TIMEZONE 1
@@ -8111,19 +8182,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:8115: checking for working alloca.h" >&5
+echo "configure:8182: 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 8120 "configure"
+#line 8187 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:8127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8194: \"$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
@@ -8144,12 +8215,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8148: checking for alloca" >&5
+echo "configure:8215: 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 8153 "configure"
+#line 8220 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -8177,7 +8248,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:8181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8248: \"$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
@@ -8209,12 +8280,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8213: checking whether alloca needs Cray hooks" >&5
+echo "configure:8280: 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 8218 "configure"
+#line 8285 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -8239,12 +8310,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:8243: checking for $ac_func" >&5
+echo "configure:8310: 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 8248 "configure"
+#line 8315 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8267,7 +8338,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8338: \"$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
@@ -8294,7 +8365,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8298: checking stack direction for C alloca" >&5
+echo "configure:8365: 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
@@ -8302,7 +8373,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 8306 "configure"
+#line 8373 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -8321,7 +8392,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:8325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8392: \"$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
@@ -8346,17 +8417,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:8350: checking for $ac_hdr" >&5
+echo "configure:8417: 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 8355 "configure"
+#line 8422 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8427: \"$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*
@@ -8385,12 +8456,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8389: checking for $ac_func" >&5
+echo "configure:8456: 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 8394 "configure"
+#line 8461 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8413,7 +8484,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8484: \"$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
@@ -8438,7 +8509,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8442: checking for working mmap" >&5
+echo "configure:8509: 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
@@ -8446,7 +8517,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 8450 "configure"
+#line 8517 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -8586,7 +8657,7 @@ main()
}
EOF
-if { (eval echo configure:8590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8657: \"$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
@@ -8614,7 +8685,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:8618: checking for $ac_word" >&5
+echo "configure:8685: 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
@@ -8905,6 +8976,8 @@ s%@subdirs@%$subdirs%g
s%@COMPPATH@%$COMPPATH%g
s%@TESTSUBDIR_TRUE@%$TESTSUBDIR_TRUE%g
s%@TESTSUBDIR_FALSE@%$TESTSUBDIR_FALSE%g
+s%@ONESTEP_TRUE@%$ONESTEP_TRUE%g
+s%@ONESTEP_FALSE@%$ONESTEP_FALSE%g
s%@LIBGCJDEBUG@%$LIBGCJDEBUG%g
s%@INTERPRETER@%$INTERPRETER%g
s%@LIBFFI@%$LIBFFI%g
@@ -8937,6 +9010,7 @@ s%@THREADDEPS@%$THREADDEPS%g
s%@THREADOBJS@%$THREADOBJS%g
s%@THREADSPEC@%$THREADSPEC%g
s%@THREADLDFLAGS@%$THREADLDFLAGS%g
+s%@THREADCXXFLAGS@%$THREADCXXFLAGS%g
s%@HASH_SYNC_SPEC@%$HASH_SYNC_SPEC%g
s%@USING_GCC_TRUE@%$USING_GCC_TRUE%g
s%@USING_GCC_FALSE@%$USING_GCC_FALSE%g
@@ -9191,8 +9265,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 java/net/natPlainSocketImpl${PLATFORMNET}.cc 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 java/net/natPlainSocketImpl.cc 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 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"
EOF
cat >> $CONFIG_STATUS <<\EOF
diff --git a/libjava/configure.host b/libjava/configure.host
index 1e2183184e4..d6935c38e55 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -89,8 +89,8 @@ case "${host}" in
sysdeps_dir=i386
libgcj_flags="${libgcj_flags} -ffloat-store"
libgcj_interpreter=yes
- libgcj_cxxflags="-D__NO_MATH_INLINES"
- libgcj_cflags="-D__NO_MATH_INLINES"
+ libgcj_cxxflags=
+ libgcj_cflags=
DIVIDESPEC=-fno-use-divide-subroutine
enable_hash_synchronization_default=yes
slow_pthread_self=yes
@@ -99,8 +99,8 @@ case "${host}" in
CHECKREFSPEC="%{m32:-fcheck-references}"
sysdeps_dir=x86-64
libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer"
- libgcj_cxxflags="-D__NO_MATH_INLINES"
- libgcj_cflags="-D__NO_MATH_INLINES"
+ libgcj_cxxflags=
+ libgcj_cflags=
enable_hash_synchronization_default=yes
slow_pthread_self=yes
libgcj_interpreter=yes
@@ -113,7 +113,6 @@ case "${host}" in
IEEESPEC=-mieee
;;
powerpc64*-*)
- # libffi not ported.
with_libffi_default=yes
libgcj_interpreter=yes
libgcj_flags="${libgcj_flags} -mminimal-toc"
@@ -222,6 +221,13 @@ EOF
*-*-freebsd*)
slow_pthread_self=
;;
+ *-mingw*)
+ # FIXME: win32_exception_handler( ) in win32.cc does not do the
+ # right stuff yet w.r.t. SEH. Live with the following for now.
+ can_unwind_signal=no
+ CHECKREFSPEC=-fcheck-references
+ DIVIDESPEC=-fuse-divide-subroutine
+ ;;
*-cygwin*)
# The cygwin linker doesn't do 8-byte alignment by default, so
# disable hash synchronization for now.
diff --git a/libjava/configure.in b/libjava/configure.in
index af22dc6a45f..aaae5e69255 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -23,12 +23,12 @@ LIBGCJ_CONFIGURE(.)
AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
-# Only use libltdl for native builds.
-if test -z "${with_cross_host}"; then
+# Only use libltdl for non-newlib builds.
+if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
AC_LIBLTDL_CONVENIENCE
AC_LIBTOOL_DLOPEN
DIRLTDL=libltdl
- AC_DEFINE(USE_LTDL)
+ AC_DEFINE(USE_LTDL, 1, [Define if libltdl is in use.])
# Sigh. Libtool's macro doesn't do the right thing.
INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
# FIXME: this is a hack.
@@ -62,7 +62,8 @@ if test -z "$enable_getenv_properties"; then
enable_getenv_properties=${enable_getenv_properties_default-yes}
fi
if test "$enable_getenv_properties" = no; then
- AC_DEFINE(DISABLE_GETENV_PROPERTIES)
+ AC_DEFINE(DISABLE_GETENV_PROPERTIES, 1,
+ [Define if system properties shouldn't be read from getenv("GCJ_PROPERTIES").])
fi
dnl Whether we should use arguments to main()
@@ -70,7 +71,7 @@ if test -z "$enable_main_args"; then
enable_main_args=${enable_main_args_default-yes}
fi
if test "$enable_main_args" = no; then
- AC_DEFINE(DISABLE_MAIN_ARGS)
+ AC_DEFINE(DISABLE_MAIN_ARGS, 1, [Define if we should ignore arguments to main().])
fi
@@ -79,16 +80,28 @@ dnl Currently works only for Linux X86/ia64
dnl Typically faster and more space-efficient
AC_ARG_ENABLE(hash-synchronization,
[ --enable-hash-synchronization
- Use global hash table for monitor locks])
+ use global hash table for monitor locks])
if test -z "$enable_hash_synchronization"; then
enable_hash_synchronization=$enable_hash_synchronization_default
fi
+# Do we allow intermodule optimizations (i.e. compiling many files at once)?
+AC_ARG_ENABLE(libgcj-multifile,
+[ --enable-libgcj-multifile
+ allow compilation of several files at once],
+[case "${enableval}" in
+ yes) enable_libgcj_multifile=yes ;;
+ no) enable_libgcj_multifile=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-libgcj-multifile) ;;
+esac],[enable_libgcj_multifile=no])
+AM_CONDITIONAL(ONESTEP, test "$enable_libgcj_multifile" = yes)
+
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
- AC_DEFINE(SLOW_PTHREAD_SELF)
+ AC_DEFINE(SLOW_PTHREAD_SELF, 1,
+ [Define if if the synchronization code should try to avoid pthread_self calls by caching thread IDs in a hashtable.])
fi
@@ -98,7 +111,7 @@ AC_SUBST(LIBGCJDEBUG)
AC_ARG_ENABLE(libgcj-debug,
[ --enable-libgcj-debug enable runtime debugging code],
if test "$enable_libgcj_debug" = yes; then
- AC_DEFINE(DEBUG)
+ AC_DEFINE(DEBUG, 1, [Define this if you want runtime debugging enabled.])
LIBGCJDEBUG="true"
fi)
@@ -113,7 +126,7 @@ AC_ARG_ENABLE(interpreter,
fi)
if test "$libgcj_interpreter" = yes; then
- AC_DEFINE(INTERPRETER)
+ AC_DEFINE(INTERPRETER, 1, [Define if you want a bytecode interpreter.])
fi
INTERPRETER="$libgcj_interpreter"
AC_SUBST(INTERPRETER)
@@ -182,7 +195,7 @@ if test -z "$enable_java_net"; then
enable_java_net=${enable_java_net_default-yes}
fi
if test "$enable_java_net" = no; then
- AC_DEFINE(DISABLE_JAVA_NET)
+ AC_DEFINE(DISABLE_JAVA_NET, 1, [Define if java.net native functions should be stubbed out.])
fi
dnl See if the user wants to configure without libffi. Some
@@ -194,7 +207,7 @@ AC_ARG_WITH(libffi,
LIBFFI=
LIBFFIINCS=
if test "$with_libffi" != no; then
- AC_DEFINE(USE_LIBFFI)
+ AC_DEFINE(USE_LIBFFI, 1, [Define if we're to use libffi.])
LIBFFI=../libffi/libffi_convenience.la
LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'
fi
@@ -206,7 +219,7 @@ AC_ARG_ENABLE(jvmpi,
[ --disable-jvmpi disable JVMPI support])
if test "$enable_jvmpi" != no; then
- AC_DEFINE(ENABLE_JVMPI)
+ AC_DEFINE(ENABLE_JVMPI, 1, [Define if you are using JVMPI.])
fi
dnl If the target is an eCos system, use the appropriate eCos
@@ -240,7 +253,7 @@ case "$TARGET_ECOS" in
*)
PLATFORM=Ecos
PLATFORMNET=NoNet
- AC_DEFINE(ECOS)
+ AC_DEFINE(ECOS, 1, [Define if you're running eCos.])
PLATFORMOBJS=posix.lo
PLATFORMH=posix.h
;;
@@ -248,16 +261,22 @@ esac
AC_SUBST(PLATFORMOBJS)
AC_LINK_FILES(include/$PLATFORMH, include/platform.h)
-AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
-AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
-AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
-AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
+AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1,
+ [Define if you have int32_t and uint32_t.]))
+AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1,
+ [Define if you have int32_t and uint32_t.]))
+AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1,
+ [Define if you have u_int32_t]))
+AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1,
+ [Define if you have u_int32_t]))
dnl These may not be defined in a non-ANS conformant embedded system.
dnl FIXME: Should these case a runtime exception in that case?
-AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME))
-AC_EGREP_HEADER(localtime, time.h, AC_DEFINE(HAVE_LOCALTIME))
+AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME, 1,
+ [Define is you have 'mktime' in <time.h>]))
+AC_EGREP_HEADER(localtime, time.h, AC_DEFINE(HAVE_LOCALTIME, 1,
+ [Define is you have 'localtime' in <time.h>]))
dnl Create the subdirectory for natFileDescriptor.cc, or the attempt
dnl to create the link will fail.
@@ -272,13 +291,16 @@ test -d java/lang || mkdir java/lang
AC_LINK_FILES(java/lang/${PLATFORM}Process.java, java/lang/ConcreteProcess.java)
AC_LINK_FILES(java/lang/nat${PLATFORM}Process.cc, java/lang/natConcreteProcess.cc)
-dnl Likewise for natInetAddress.cc, natNetworkInterface.cc, natPlainSocketImpl.cc
-dnl and natPlainDatagramSocketImpl.cc
+dnl Likewise for natInetAddress.cc and natNetworkInterface.cc.
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)
-AC_LINK_FILES(java/net/natPlainSocketImpl${PLATFORMNET}.cc, java/net/natPlainSocketImpl.cc)
-AC_LINK_FILES(java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc, java/net/natPlainDatagramSocketImpl.cc)
+
+dnl Likewise for natPlainSocketImpl.cc and natPlainDatagramSocketImpl.ca.c
+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)
case "${host}" in
*mingw*)
@@ -375,17 +397,16 @@ case "$GC" in
boehm)
AC_MSG_RESULT(boehm)
GCLIBS=../boehm-gc/libgcjgc_convenience.la
- GCINCS='-I$(top_srcdir)/../boehm-gc/include'
JC1GCSPEC='-fuse-boehm-gc'
GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs"
dnl We also want to pick up some cpp flags required when including
dnl boehm-config.h. Yuck.
- GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
+ GCINCS="`cat ../boehm-gc/boehm-cflags`"
GCOBJS=boehm.lo
GCHDR=boehm-gc.h
dnl The POSIX thread support needs to know this.
- AC_DEFINE(HAVE_BOEHM_GC)
+ AC_DEFINE(HAVE_BOEHM_GC, 1, [Define if Boehm GC in use.])
;;
no)
AC_MSG_RESULT(none)
@@ -418,7 +439,7 @@ case "$THREADS" in
THREADS=posix
case "$host" in
*-*-linux*)
- AC_DEFINE(LINUX_THREADS)
+ AC_DEFINE(LINUX_THREADS, 1, [Define if using POSIX threads on Linux.])
;;
esac
;;
@@ -432,6 +453,7 @@ case "$THREADS" in
;;
esac
+THREADCXXFLAGS=
THREADLDFLAGS=
THREADLIBS=
THREADINCS=
@@ -466,6 +488,12 @@ changequote([,])
THREADLDFLAGS=-pthread
THREADSPEC=-lc_r
;;
+ alpha*-dec-osf*)
+ THREADCXXFLAGS=-pthread
+ # boehm-gc needs some functions from librt, so link that too.
+ THREADLIBS='-lpthread -lrt'
+ THREADSPEC='-lpthread -lrt'
+ ;;
*)
THREADLIBS=-lpthread
THREADSPEC=-lpthread
@@ -476,7 +504,7 @@ changequote([,])
# MIT pthreads doesn't seem to have the mutexattr functions.
# But for now we don't check for it. We just assume you aren't
# using MIT pthreads.
- AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
+ AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT, 1, [Define if using POSIX threads that have the mutexattr functions.])
# If we're using the Boehm GC, then we happen to know that it
# defines _REENTRANT, so we don't bother. Eww.
@@ -503,6 +531,7 @@ AC_SUBST(THREADDEPS)
AC_SUBST(THREADOBJS)
AC_SUBST(THREADSPEC)
AC_SUBST(THREADLDFLAGS)
+AC_SUBST(THREADCXXFLAGS)
if test -d sysdep; then true; else mkdir sysdep; fi
AC_LINK_FILES(sysdep/$sysdeps_dir/locks.h, sysdep/locks.h)
@@ -530,7 +559,7 @@ changequote(,)dnl
gcc_version_trigger=${libgcj_basedir}/../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-lib/$(target_alias)/'${gcc_version}/include
+tool_include_dir='$(libdir)/gcc/$(target_alias)/'${gcc_version}/include
changequote([,])dnl
AC_SUBST(tool_include_dir)
AC_SUBST(gcc_version)
@@ -542,29 +571,20 @@ if test "x${with_newlib}" = "xyes"; then
# We assume newlib. This lets us hard-code the functions we know
# we'll have.
- AC_DEFINE(HAVE_MEMMOVE)
- AC_DEFINE(HAVE_MEMCPY)
- AC_DEFINE(HAVE_STRERROR)
- AC_DEFINE(HAVE_TIME)
- AC_DEFINE(HAVE_GMTIME_R)
- AC_DEFINE(HAVE_LOCALTIME_R)
+ AC_DEFINE(HAVE_MEMMOVE, 1, [Define if you have memmove.])
+ AC_DEFINE(HAVE_MEMCPY, 1, [Define if you have memcpy.])
+ AC_DEFINE(HAVE_STRERROR, 1, [Define if you have strerror.])
+ AC_DEFINE(HAVE_TIME, 1, [Define if you have time.])
+ AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have the 'gmtime_r' function])
+ AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have the 'localtime_r' function.])
+ AC_DEFINE(HAVE_USLEEP_DECL, 1, [Define if usleep is declared in <unistd.h>.])
dnl This is only for POSIX threads.
- AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
+ AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT, 1, [Define if using POSIX threads that have the mutexattr functions.])
dnl We also assume we are using gcc, which provides alloca.
AC_DEFINE(HAVE_ALLOCA)
dnl Assume we do not have getuid and friends.
- AC_DEFINE(NO_GETUID)
-
- # If Canadian cross, then don't pick up tools from the build
- # directory.
- if test x"$build" != x"$with_cross_host" \
- && test x"$build" != x"$target"; then
- CANADIAN=yes
- GCC_UNWIND_INCLUDE=
- GCJ="${target_alias}-gcj"
- fi
- NATIVE=no
+ AC_DEFINE(NO_GETUID, 1, [Define if getuid() and friends are missing.])
PLATFORMNET=NoNet
else
AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep opendir)
@@ -581,27 +601,29 @@ else
# Has broken backtrace()
;;
*)
- AC_DEFINE(HAVE_BACKTRACE)
+ AC_DEFINE(HAVE_BACKTRACE, 1,
+ [Define if your platform has a working backtrace() function.])
;;
esac
], [
case "$host" in
*mingw*)
# Has backtrace() defined in libgcj itself
- AC_DEFINE(HAVE_BACKTRACE)
+ AC_DEFINE(HAVE_BACKTRACE, 1,
+ [Define if your platform has a working backtrace() function.])
;;
esac
])
AC_CHECK_LIB(dl, dladdr, [
- AC_DEFINE(HAVE_DLADDR)])
+ AC_DEFINE(HAVE_DLADDR, 1, [Define if you have dladdr()])])
if test x"$build" = x"$host"; then
AC_CHECK_FILES(/proc/self/exe, [
- AC_DEFINE(HAVE_PROC_SELF_EXE)])
+ AC_DEFINE(HAVE_PROC_SELF_EXE, 1, [Define if you have /proc/self/exe])])
else
case $host in
*-linux*)
- AC_DEFINE(HAVE_PROC_SELF_EXE)
+ AC_DEFINE(HAVE_PROC_SELF_EXE, 1, [Define if you have /proc/self/exe])
;;
esac
fi
@@ -611,12 +633,13 @@ else
AC_STRUCT_TIMEZONE
AC_CHECK_FUNCS(gethostbyname_r, [
- AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
+ [Define if you have the 'gethostbyname_r' function.])
# There are two different kinds of gethostbyname_r.
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
AC_EGREP_HEADER(int.*gethostbyname_r, netdb.h, [
- AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT)])
+ AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT, 1, [Define if gethostbyname_r returns 'int'.])])
case " $GCINCS " in
*" -D_REENTRANT "*) ;;
@@ -666,21 +689,26 @@ else
# linkage check is enough, yet C++ code requires proper prototypes.)
AC_EGREP_HEADER(gethostbyaddr_r, netdb.h, [
AC_CHECK_FUNCS(gethostbyaddr_r, [
- AC_DEFINE(HAVE_GETHOSTBYADDR_R)
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R, 1,
+ [Define if you have the 'gethostbyaddr_r' function.])
# There are two different kinds of gethostbyaddr_r.
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
AC_EGREP_HEADER(int.*gethostbyaddr_r, netdb.h, [
- AC_DEFINE(GETHOSTBYADDR_R_RETURNS_INT)])])])
+ AC_DEFINE(GETHOSTBYADDR_R_RETURNS_INT, 1,
+ [Define if gethostbyaddr_r returns 'int'.])])])])
AC_CHECK_FUNCS(gethostname, [
- AC_DEFINE(HAVE_GETHOSTNAME)
+ AC_DEFINE(HAVE_GETHOSTNAME, 1,
+ [Define if you have the 'gethostname' function.])
AC_EGREP_HEADER(gethostname, unistd.h, [
- AC_DEFINE(HAVE_GETHOSTNAME_DECL)])])
+ AC_DEFINE(HAVE_GETHOSTNAME_DECL, 1,
+ [Define if gethostname is declared in <unistd.h>.])])])
AC_CHECK_FUNCS(usleep, [
AC_EGREP_HEADER(usleep, unistd.h, [
- AC_DEFINE(HAVE_USLEEP_DECL)])])
+ AC_DEFINE(HAVE_USLEEP_DECL, 1,
+ [Define if usleep is declared in <unistd.h>.])])])
# Look for these functions in the thread library, but only bother
# if using POSIX threads.
@@ -708,10 +736,12 @@ else
# or __m_count. This is a nice hack for Linux.
AC_TRY_COMPILE([#include <pthread.h>], [
extern pthread_mutex_t *mutex; int q = mutex->m_count;
- ], AC_DEFINE(PTHREAD_MUTEX_HAVE_M_COUNT), [
+ ], AC_DEFINE(PTHREAD_MUTEX_HAVE_M_COUNT, 1,
+ [Define if pthread_mutex_t has m_count member.]), [
AC_TRY_COMPILE([#include <pthread.h>], [
extern pthread_mutex_t *mutex; int q = mutex->__m_count;
- ], AC_DEFINE(PTHREAD_MUTEX_HAVE___M_COUNT))])
+ ], AC_DEFINE(PTHREAD_MUTEX_HAVE___M_COUNT, 1,
+ [Define if pthread_mutex_t has __m_count member.]))])
fi
# We require a way to get the time.
@@ -801,23 +831,77 @@ else
if test "$GC" = boehm; then
AC_CHECK_LIB(dl, main, SYSTEMSPEC="$SYSTEMSPEC -ldl")
fi
+fi
- if test -z "${with_multisubdir}"; then
- builddotdot=.
- else
+if test -z "${with_multisubdir}"; then
+ builddotdot=.
+else
changequote(<<,>>)
- builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
+ builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
changequote([,])
- fi
- if test -x "${builddotdot}/../../gcc/gcj"; then
- dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
- GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
- else
+fi
+
+# Which gcj do we use?
+which_gcj=default
+built_gcc_dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
+if test -n "${with_cross_host}"; then
+ # We are being configured with a cross compiler. We can't
+ # use ac_exeext, because that is for the target platform.
+ NATIVE=no
+ cross_host_exeext=
+ case "${with_cross_host}" in
+ *mingw* | *cygwin*)
+ cross_host_exeext=.exe
+ ;;
+ esac
+ if test -x "${built_gcc_dir}/gcj${cross_host_exeext}"; then
+ if test x"$build_alias" = x"$with_cross_host"; then
+ # Ordinary cross (host!=target and host=build)
+ which_gcj=built
+ else
+ # Canadian cross (host!=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=cross
+ fi
+else
+ # We are being configured with a native or crossed-native compiler
+ if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ # True native build (host=target and host=build)
+ which_gcj=built
+ else
+ # Crossed-native build (host=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
+fi
+case "${which_gcj}" in
+ built)
+ GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
+ ;;
+ cross)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
+ CANADIAN=yes
+ NULL_TARGET=no
+ if test "x${with_newlib}" = "xyes"; then
+ # FIXME (comment): Why is this needed?
+ GCC_UNWIND_INCLUDE=
+ GCJ="${target_alias}-gcj"
+ else
+ GCJ="${target_alias}-gcj -B`${PWDCMD-pwd}`/"
+ fi
+ ;;
+ path)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
CANADIAN=yes
NULL_TARGET=yes
GCJ="gcj -B`${PWDCMD-pwd}`/"
- fi
-fi
+ ;;
+esac
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
@@ -901,16 +985,6 @@ GCJVERSION=$gcjversion
AC_SUBST(GCJVERSION)
AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version ID])
-dnl Work around a g++ bug. Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000.
-AC_MSG_CHECKING([for g++ -ffloat-store bug])
-save_CFLAGS="$CFLAGS"
-CFLAGS="-x c++ -O2 -ffloat-store"
-AC_TRY_COMPILE([#include <math.h>], ,
- [AC_MSG_RESULT(no)],
- [AC_DEFINE(__NO_MATH_INLINES)
- AC_MSG_RESULT(yes)])
-CFLAGS="$save_CFLAGS"
-
dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
dnl On that system, sys/ioctl.h will not include sys/filio.h unless
dnl BSD_COMP is defined; just including sys/filio.h is simpler.
@@ -935,25 +1009,29 @@ AC_TRY_COMPILE([#include <sys/types.h>
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif], [in_addr_t foo;],
- [AC_DEFINE([HAVE_IN_ADDR_T])
+ [AC_DEFINE(HAVE_IN_ADDR_T, 1,
+ [Define to 1 if 'in_addr_t' is defined in sys/types.h or netinet/in.h.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([whether struct ip_mreq is in netinet/in.h])
AC_TRY_COMPILE([#include <netinet/in.h>], [struct ip_mreq mreq;],
- [AC_DEFINE(HAVE_STRUCT_IP_MREQ)
+ [AC_DEFINE(HAVE_STRUCT_IP_MREQ, 1,
+ [Define if struct ip_mreq is defined in netinet/in.h.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([whether struct ipv6_mreq is in netinet/in.h])
AC_TRY_COMPILE([#include <netinet/in.h>], [struct ipv6_mreq mreq6;],
- [AC_DEFINE(HAVE_STRUCT_IPV6_MREQ)
+ [AC_DEFINE(HAVE_STRUCT_IPV6_MREQ, 1,
+ [Define if struct ipv6_mreq is defined in netinet/in.h.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
- [AC_DEFINE(HAVE_INET6)
+ [AC_DEFINE(HAVE_INET6, 1,
+ [Define if inet6 structures are defined in netinet/in.h.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
@@ -961,13 +1039,13 @@ AC_MSG_CHECKING([for socklen_t in sys/socket.h])
AC_TRY_COMPILE([#define _POSIX_PII_SOCKET
#include <sys/types.h>
#include <sys/socket.h>], [socklen_t x = 5;],
- [AC_DEFINE(HAVE_SOCKLEN_T)
+ [AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define it socklen_t typedef is in sys/socket.h.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([for tm_gmtoff in struct tm])
AC_TRY_COMPILE([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
- [AC_DEFINE(STRUCT_TM_HAS_GMTOFF)
+ [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_CHECKING([for global timezone variable])
@@ -976,13 +1054,14 @@ AC_TRY_COMPILE([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
dnl the header file will mention timezone if it exists.
dnl Don't find the win32 function timezone
AC_TRY_COMPILE([#include <time.h>], [void i(){long z2 = 2*timezone;}],
- [AC_DEFINE(HAVE_TIMEZONE)
+ [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_CHECKING([for global _timezone variable])
dnl FIXME: As above, don't want link check
AC_TRY_COMPILE([#include <time.h>], [long z2 = _timezone;],
- [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE)
+ [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
+ [Define if your platform has the global _timezone variable.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])])])
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc
index 001fa0131f0..4cd4f4f1936 100644
--- a/libjava/defineclass.cc
+++ b/libjava/defineclass.cc
@@ -75,7 +75,7 @@ struct _Jv_ClassReader {
// allways on. You always want this as far as I can see, but it also
// controls weither identifiers and type descriptors/signatures are
// verified as legal. This could be somewhat more expensive since it
- // will call Characher.isJavaIdentifier{Start,Part} for each character
+ // will call Character.isJavaIdentifier{Start,Part} for each character
// in any identifier (field name or method name) it comes by. Thus,
// it might be useful to turn off this verification for classes that
// come from a trusted source. However, for GCJ, trusted classes are
@@ -403,15 +403,15 @@ void _Jv_ClassReader::read_fields ()
int name_index = read2u ();
int descriptor_index = read2u ();
int attributes_count = read2u ();
-
+
check_tag (name_index, JV_CONSTANT_Utf8);
prepare_pool_entry (name_index, JV_CONSTANT_Utf8);
check_tag (descriptor_index, JV_CONSTANT_Utf8);
prepare_pool_entry (descriptor_index, JV_CONSTANT_Utf8);
-
+
handleField (i, access_flags, name_index, descriptor_index);
-
+
for (int j = 0; j < attributes_count; j++)
{
read_one_field_attribute (i);
@@ -1071,14 +1071,25 @@ void _Jv_ClassReader::handleField (int field_no,
field->nameIndex = name;
#endif
- if (verify)
- verify_identifier (field_name);
-
- // ignore flags we don't know about.
+ // Ignore flags we don't know about.
field->flags = flags & Modifier::ALL_FLAGS;
+ _Jv_Utf8Const* sig = pool_data[desc].utf8;
+
if (verify)
{
+ verify_identifier (field_name);
+
+ for (int i = 0; i < field_no; ++i)
+ {
+ if (_Jv_equalUtf8Consts (field_name, def->fields[i].name)
+ && _Jv_equalUtf8Consts (sig,
+ // We know the other fields are
+ // unresolved.
+ (_Jv_Utf8Const *) def->fields[i].type))
+ throw_class_format_error ("duplicate field name");
+ }
+
if (field->flags & (Modifier::SYNCHRONIZED
| Modifier::NATIVE
| Modifier::INTERFACE
@@ -1091,8 +1102,6 @@ void _Jv_ClassReader::handleField (int field_no,
throw_class_format_error ("erroneous field access flags");
}
- _Jv_Utf8Const* sig = pool_data[desc].utf8;
-
if (verify)
_Jv_VerifyFieldSignature (sig);
@@ -1233,6 +1242,14 @@ void _Jv_ClassReader::handleMethod
_Jv_VerifyMethodSignature (method->signature);
+ for (int i = 0; i < mth_index; ++i)
+ {
+ if (_Jv_equalUtf8Consts (method->name, def->methods[i].name)
+ && _Jv_equalUtf8Consts (method->signature,
+ def->methods[i].signature))
+ throw_class_format_error ("duplicate method");
+ }
+
if (method->accflags & (Modifier::VOLATILE
| Modifier::TRANSIENT
| Modifier::INTERFACE))
diff --git a/libjava/exception.cc b/libjava/exception.cc
index d983f98f8fa..9647d446d18 100644
--- a/libjava/exception.cc
+++ b/libjava/exception.cc
@@ -15,6 +15,9 @@ details. */
#include <java/lang/Class.h>
#include <java/lang/NullPointerException.h>
+#include <gnu/gcj/runtime/StackTrace.h>
+#include <gnu/gcj/runtime/MethodRef.h>
+#include <gnu/gcj/RawData.h>
#include <gcj/cni.h>
#include <jvm.h>
@@ -335,11 +338,21 @@ PERSONALITY_FUNCTION (int version,
jclass catch_type = get_ttype_entry (context, &info, ar_filter);
- // The catch_type is either a (java::lang::Class*) or
- // is one more than a (Utf8Const*).
- if ((size_t)catch_type & 1)
- catch_type = _Jv_FindClass ((Utf8Const*)((size_t)catch_type ^ 1), NULL);
-
+ typedef struct {
+ int __attribute__ ((mode (pointer))) dummy;
+ Utf8Const *utf8;
+ } utf8_hdr;
+ utf8_hdr *p = (utf8_hdr *)catch_type;
+ if (p->dummy == -1)
+ {
+ using namespace gnu::gcj::runtime;
+ java::lang::Class *klass
+ = StackTrace::getClass ((gnu::gcj::RawData *)ip);
+ java::lang::ClassLoader *loader
+ = klass ? klass->getClassLoaderInternal () : NULL;
+ catch_type = _Jv_FindClass (p->utf8, loader);
+ }
+
if (_Jv_IsInstanceOf (xh->value, catch_type))
{
handler_switch_value = ar_filter;
diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in
index fa140875acd..064b5227625 100644
--- a/libjava/gcj/Makefile.in
+++ b/libjava/gcj/Makefile.in
@@ -125,6 +125,7 @@ STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
SYS_ZLIBS = @SYS_ZLIBS@
+THREADCXXFLAGS = @THREADCXXFLAGS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
THREADLDFLAGS = @THREADLDFLAGS@
diff --git a/libjava/gij.cc b/libjava/gij.cc
index 293f3c30fd8..3b0683de03e 100644
--- a/libjava/gij.cc
+++ b/libjava/gij.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -31,7 +31,8 @@ help ()
printf (" --cp LIST set class path\n");
printf (" --classpath LIST set class path\n");
printf (" -DVAR=VAL define property VAR with value VAL\n");
- printf (" --help print this help, then exit\n");
+ printf (" -?, --help print this help, then exit\n");
+ printf (" -X print help on supported -X options, then exit\n");
printf (" --ms=NUMBER set initial heap size\n");
printf (" --mx=NUMBER set maximum heap size\n");
printf (" --showversion print version number, then keep going\n");
@@ -90,7 +91,7 @@ main (int argc, const char **argv)
if (arg[1] == '-')
++arg;
- if (! strcmp (arg, "-help"))
+ if (! strcmp (arg, "-help") || ! strcmp (arg, "-?"))
help ();
else if (! strcmp (arg, "-version"))
{
@@ -132,6 +133,15 @@ main (int argc, const char **argv)
// correct behavior.
_Jv_Jar_Class_Path = argv[++i];
}
+ else if (arg[1] == 'X')
+ {
+ if (arg[2] == '\0')
+ {
+ printf ("gij: currently no -X options are recognized\n");
+ exit (0);
+ }
+ /* Ignore other -X options. */
+ }
else
{
fprintf (stderr, "gij: unrecognized option -- `%s'\n", argv[i]);
diff --git a/libjava/gnu/awt/j2d/AbstractGraphicsState.java b/libjava/gnu/awt/j2d/AbstractGraphicsState.java
index 1c29bc202f6..038bc9c6c7d 100644
--- a/libjava/gnu/awt/j2d/AbstractGraphicsState.java
+++ b/libjava/gnu/awt/j2d/AbstractGraphicsState.java
@@ -128,6 +128,14 @@ public abstract class AbstractGraphicsState implements Cloneable
public Object clone ()
{
- return super.clone ();
+ try
+ {
+ return super.clone ();
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
}
diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java
index e5daa9dec6b..dd46e7fe410 100644
--- a/libjava/gnu/awt/j2d/Graphics2DImpl.java
+++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java
@@ -105,12 +105,20 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
public Object clone()
{
- Graphics2DImpl gfxCopy = (Graphics2DImpl) super.clone();
- AbstractGraphicsState stateCopy =
- (AbstractGraphicsState) state.clone();
- gfxCopy.setState(stateCopy);
-
- return gfxCopy;
+ try
+ {
+ Graphics2DImpl gfxCopy = (Graphics2DImpl) super.clone();
+ AbstractGraphicsState stateCopy =
+ (AbstractGraphicsState) state.clone();
+ gfxCopy.setState(stateCopy);
+
+ return gfxCopy;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
diff --git a/libjava/gnu/awt/j2d/IntegerGraphicsState.java b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
index 3befcb41707..4eb4c6182b1 100644
--- a/libjava/gnu/awt/j2d/IntegerGraphicsState.java
+++ b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
@@ -44,6 +44,19 @@ public class IntegerGraphicsState extends AbstractGraphicsState
DirectRasterGraphics directGfx;
Shape clip;
+ /** Interface for images which are coupled to a GraphicsConfiguration,
+ * as is typically the case for an off-screen buffer used in
+ * double-buffering. Any image which implements this interface is
+ * rendered directly by DirectRasterGraphics (i.e. by directGfx.drawImage)
+ */
+ public interface ScreenCoupledImage
+ {
+ /** Get the GraphicsConfiguration to which this image is coupled
+ * @return the GraphicsConfiguration
+ */
+ GraphicsConfiguration getGraphicsConfiguration ();
+ }
+
public IntegerGraphicsState(DirectRasterGraphics directGfx)
{
this.directGfx = directGfx;
@@ -245,66 +258,72 @@ public class IntegerGraphicsState extends AbstractGraphicsState
x += tx;
y += ty;
+ if (image instanceof ScreenCoupledImage)
+ {
+ GraphicsConfiguration config
+ = ((ScreenCoupledImage)image).getGraphicsConfiguration ();
+ if (config == frontend.config)
+ return directGfx.drawImage (image, x, y, observer);
+ }
if (image instanceof BufferedImage)
+ {
+ BufferedImage bImage = (BufferedImage) image;
+ // FIXME: eliminate? ScreenCoupledImage is probably more efficient
+ Object config = bImage.getProperty ("java.awt.GraphicsConfiguration");
+ if (config == frontend.config)
+ return directGfx.drawImage (image, x, y, observer);
+
+ int width = image.getWidth (null);
+ int height = image.getHeight (null);
+
+ Rectangle bounds = new Rectangle (x, y, width, height);
+
+ MappedRaster mr = directGfx.mapRaster (bounds);
+
+ // manipulate raster here...
+ ColorModel colorModel = mr.getColorModel ();
+ WritableRaster raster = mr.getRaster ();
+
+ int xEnd = x + width;
+ int yEnd = y + height;
+
+ // FIXME: Use the following code only as a fallback. It's SLOW!
+
+ Object rgbElem = null;
+ for (int yy=0; yy<height; yy++)
{
- BufferedImage bImage = (BufferedImage) image;
- Object config =
- bImage.getProperty("java.awt.GraphicsConfiguration");
-
- if (config == frontend.config)
- return directGfx.drawImage(image, x, y, observer);
-
- int width = image.getWidth(null);
- int height = image.getHeight(null);
-
- Rectangle bounds = new Rectangle(x, y, width, height);
-
- MappedRaster mr = directGfx.mapRaster(bounds);
-
- // manipulate raster here...
- ColorModel colorModel = mr.getColorModel();
- WritableRaster raster = mr.getRaster();
-
- int xEnd = x + width;
- int yEnd = y + height;
-
- // FIXME: Use the following code only as a fallback. It's SLOW!
-
- Object rgbElem = null;
- for (int yy=0; yy<height; yy++)
- {
- for (int xx=0; xx<width; xx++)
- {
- int srgb = bImage.getRGB(xx, yy);
- int sa = ((srgb >>> 24) & 0xff) + 1;
- int sr = ((srgb >>> 16) & 0xff) + 1;
- int sg = ((srgb >>> 8) & 0xff) + 1;
- int sb = (srgb & 0xff) + 1;
-
- rgbElem = raster.getDataElements(xx+x, yy+y, rgbElem);
- int drgb = colorModel.getRGB(rgbElem);
- int dr = ((drgb >>> 16) & 0xff) + 1;
- int dg = ((drgb >>> 8) & 0xff) + 1;
- int db = (drgb & 0xff) + 1;
- int da = 256 - sa;
-
- dr = ((sr*sa + dr*da) >>> 8) - 1;
- dg = ((sg*sa + dg*da) >>> 8) - 1;
- db = ((sb*sa + db*da) >>> 8) - 1;
-
- drgb = (dr<<16) | (dg<<8) | db;
-
- rgbElem = colorModel.getDataElements(drgb, rgbElem);
-
- raster.setDataElements(xx+x, yy+y, rgbElem);
- }
- }
- directGfx.unmapRaster(mr);
- return true;
-
+ for (int xx=0; xx<width; xx++)
+ {
+ int srgb = bImage.getRGB (xx, yy);
+ int sa = ((srgb >>> 24) & 0xff) + 1;
+ int sr = ((srgb >>> 16) & 0xff) + 1;
+ int sg = ((srgb >>> 8) & 0xff) + 1;
+ int sb = (srgb & 0xff) + 1;
+
+ rgbElem = raster.getDataElements (xx+x, yy+y, rgbElem);
+ int drgb = colorModel.getRGB (rgbElem);
+ int dr = ((drgb >>> 16) & 0xff) + 1;
+ int dg = ((drgb >>> 8) & 0xff) + 1;
+ int db = (drgb & 0xff) + 1;
+ int da = 256 - sa;
+
+ dr = ((sr*sa + dr*da) >>> 8) - 1;
+ dg = ((sg*sa + dg*da) >>> 8) - 1;
+ db = ((sb*sa + db*da) >>> 8) - 1;
+
+ drgb = (dr<<16) | (dg<<8) | db;
+
+ rgbElem = colorModel.getDataElements (drgb, rgbElem);
+
+ raster.setDataElements (xx+x, yy+y, rgbElem);
+ }
}
- throw new UnsupportedOperationException("drawing image " + image +
- "not implemented");
+ directGfx.unmapRaster (mr);
+ return true;
+
+ }
+ throw new UnsupportedOperationException ("drawing image " + image +
+ "not implemented");
}
diff --git a/libjava/gnu/awt/xlib/XCanvasPeer.java b/libjava/gnu/awt/xlib/XCanvasPeer.java
index 4c141a4c0d8..6ecf7bf3296 100644
--- a/libjava/gnu/awt/xlib/XCanvasPeer.java
+++ b/libjava/gnu/awt/xlib/XCanvasPeer.java
@@ -214,7 +214,7 @@ public class XCanvasPeer implements CanvasPeer
}
public Image createImage(int width, int height)
{
- throw new UnsupportedOperationException("FIXME, not implemented");
+ return new XOffScreenImage (config, window, width, height);
}
public void dispose()
{
diff --git a/libjava/gnu/awt/xlib/XEventLoop.java b/libjava/gnu/awt/xlib/XEventLoop.java
index 4d293208939..5f5026b0cdb 100644
--- a/libjava/gnu/awt/xlib/XEventLoop.java
+++ b/libjava/gnu/awt/xlib/XEventLoop.java
@@ -48,17 +48,8 @@ public class XEventLoop implements Runnable
void postNextEvent()
{
- try
- {
- AWTEvent evt = getNextEvent();
- queue.postEvent(evt);
-
- }
- catch (InterruptedException ie)
- {
- // FIXME: what now?
- System.err.println(ie);
- }
+ AWTEvent evt = getNextEvent();
+ queue.postEvent(evt);
}
/** get next event. Will block until events become available. */
@@ -127,57 +118,66 @@ public class XEventLoop implements Runnable
* AWT event.
*/
- AWTEvent createEvent()
+ AWTEvent createEvent ()
{
+ int type = anyEvent.getType ();
+ // Ignore some events without further processing
+ switch (type)
+ {
+ // ignore "no expose" events, which are generated whenever a pixmap
+ // is copied to copied to a window which is entirely unobscured
+ case XAnyEvent.TYPE_NO_EXPOSE:
+ case XAnyEvent.TYPE_UNMAP_NOTIFY: // ignore for now
+ case XAnyEvent.TYPE_MAP_NOTIFY: // ignore for now
+ case XAnyEvent.TYPE_REPARENT_NOTIFY: // ignore for now
+ return null;
+ default:
+ break; // continue processing events not in ignore list
+ }
/* avoid attempting to get client data before client data has
been set. */
Object peer;
synchronized (this)
- {
- peer = anyEvent.getWindow().getClientData();
- }
-
+ {
+ peer = anyEvent.getWindow ().getClientData ();
+ }
+
Component source = null;
-
+
// Try to identify source component
-
+
if (peer instanceof XCanvasPeer)
- {
- source = ((XCanvasPeer) peer).getComponent();
- }
-
+ {
+ source = ((XCanvasPeer) peer).getComponent ();
+ }
+
if (source == null)
- {
- String msg = "unable to locate source for event (" +
- anyEvent + ")";
- throw new RuntimeException(msg);
- }
-
+ {
+ String msg = "unable to locate source for event (" +
+ anyEvent + "): peer=" + peer;
+ throw new RuntimeException (msg);
+ }
+
/* if a mapping from anyEvent to AWTEvent is possible, construct a
new AWTEvent and return it. */
-
- int type = anyEvent.getType();
+
switch (type)
- {
+ {
case XAnyEvent.TYPE_EXPOSE:
- return createPaintEvent(source);
+ return createPaintEvent (source);
case XAnyEvent.TYPE_BUTTON_PRESS:
case XAnyEvent.TYPE_BUTTON_RELEASE:
- return createMouseEvent(type, source);
- case XAnyEvent.TYPE_UNMAP_NOTIFY:
- case XAnyEvent.TYPE_MAP_NOTIFY:
- case XAnyEvent.TYPE_REPARENT_NOTIFY:
- return null; // ignore for now
+ return createMouseEvent (type, source);
case XAnyEvent.TYPE_CONFIGURE_NOTIFY:
- configureNotify(peer);
- return null;
-
+ configureNotify (peer);
+ return null;
+
default:
- String msg = "Do no know how to handle event (" + anyEvent + ")";
- throw new RuntimeException(msg);
- }
+ String msg = "Do no know how to handle event (" + anyEvent + ")";
+ throw new RuntimeException (msg);
+ }
}
-
+
AWTEvent createPaintEvent(Component src)
{
XExposeEvent expose = new XExposeEvent(anyEvent);
diff --git a/libjava/gnu/awt/xlib/XGraphics.java b/libjava/gnu/awt/xlib/XGraphics.java
index 9f29fa5b94a..e27b0a18e8b 100644
--- a/libjava/gnu/awt/xlib/XGraphics.java
+++ b/libjava/gnu/awt/xlib/XGraphics.java
@@ -20,6 +20,7 @@ import gnu.gcj.xlib.XImage;
import gnu.gcj.xlib.Drawable;
import gnu.gcj.xlib.Window;
import gnu.gcj.xlib.Drawable;
+import gnu.gcj.xlib.Pixmap;
import gnu.gcj.xlib.Visual;
import gnu.awt.j2d.DirectRasterGraphics;
import gnu.awt.j2d.MappedRaster;
@@ -46,10 +47,18 @@ public class XGraphics implements Cloneable, DirectRasterGraphics
public Object clone()
{
- XGraphics gfxCopy = (XGraphics) super.clone();
- gfxCopy.context = context.create();
-
- return gfxCopy;
+ try
+ {
+ XGraphics gfxCopy = (XGraphics) super.clone();
+ gfxCopy.context = context.create();
+
+ return gfxCopy;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
public void dispose()
@@ -191,6 +200,16 @@ public class XGraphics implements Cloneable, DirectRasterGraphics
public boolean drawImage(Image img, int x, int y,
ImageObserver observer)
{
+ if (img instanceof XOffScreenImage)
+ {
+ // FIXME: have to enforce clip, or is it OK as-is?
+ XGraphicsConfiguration.XOffScreenImage offScreenImage
+ = ((XGraphicsConfiguration.XOffScreenImage)img);
+ Pixmap pixmap = offScreenImage.getPixmap ();
+ context.copyArea (pixmap, 0, 0, x, y,
+ offScreenImage.getWidth (), offScreenImage.getHeight ());
+ return true;
+ }
if (clipBounds == null)
return false; // ***FIXME***
diff --git a/libjava/gnu/awt/xlib/XGraphicsConfiguration.java b/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
index d867beed225..bdbf3e18a74 100644
--- a/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
+++ b/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
@@ -51,7 +51,7 @@ public class XGraphicsConfiguration extends GraphicsConfiguration
* XXX: lruOrder rolls over after a few billion operations, so it might
* on very rare occasions misinterpret which is the oldest entry
*/
- class FontMetricsCache
+ static class FontMetricsCache
{
private java.util.Hashtable displays = new java.util.Hashtable ();
diff --git a/libjava/gnu/awt/xlib/XOffScreenImage.java b/libjava/gnu/awt/xlib/XOffScreenImage.java
new file mode 100644
index 00000000000..71791c1be5f
--- /dev/null
+++ b/libjava/gnu/awt/xlib/XOffScreenImage.java
@@ -0,0 +1,175 @@
+/* Copyright (C) 2000, 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. */
+
+package gnu.awt.xlib;
+
+import java.awt.Image;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.util.Hashtable;
+import gnu.awt.j2d.DirectRasterGraphics;
+import gnu.awt.j2d.Graphics2DImpl;
+import gnu.awt.j2d.IntegerGraphicsState;
+import gnu.gcj.xlib.Drawable;
+import gnu.gcj.xlib.Pixmap;
+import gnu.gcj.xlib.Screen;
+import gnu.gcj.xlib.Visual;
+
+/** Image class for xlib off-screen buffers.
+ * The image is stored in a server-side pixmap for best performance.
+ * This class supports getGraphics, so you can draw on the pixmap, and is
+ * specially handled when doing drawImage, so that the image copy is done
+ * entirely in the X server.
+ * This class does not support rasterization, for which you'd need an XImage.
+ *
+ * @author scott gilbertson <scottg@mantatest.com> <sgilbertson@cogeco.ca>
+ */
+public class XOffScreenImage extends Image
+ implements IntegerGraphicsState.ScreenCoupledImage
+{
+ private Pixmap pixmap;
+ private XGraphicsConfiguration config;
+ private int width;
+ private int height;
+
+ /** Create a new XOffScreenImage
+ * @param config Graphics configuration, to compare against on-screen
+ * components and to create the appropriate Graphics
+ * @param drawable The drawable with which the image is compatible
+ * @param width The width of the image
+ * @param height The height of the image
+ */
+ XOffScreenImage (XGraphicsConfiguration config, Drawable drawable, int width, int height)
+ {
+ this.config = config;
+ this.width = width;
+ this.height = height;
+ pixmap = new Pixmap (drawable, width, height, drawable.getDepth ());
+ }
+
+ /** Get the pixmap which contains this image
+ * @return The pixmap
+ */
+ public Pixmap getPixmap ()
+ {
+ return pixmap;
+ }
+
+ /** Flushes (that is, destroys) any resources used for this image. This
+ * includes the actual image data.
+ */
+ public void flush ()
+ {
+ // FIXME: should dispose pixmap
+ pixmap = null;
+ }
+
+ /** Returns a graphics context object for drawing an off-screen object.
+ * This method is only valid for off-screen objects.
+ *
+ * @return a graphics context object for an off-screen object
+ * @see Graphics#createImage(int, int)
+ */
+ public Graphics getGraphics ()
+ {
+ DirectRasterGraphics gfxDevice = new XGraphics (pixmap, config);
+ IntegerGraphicsState igState = new IntegerGraphicsState (gfxDevice);
+ Graphics2DImpl gfx2d = new Graphics2DImpl (config);
+ gfx2d.setState (igState);
+ return gfx2d;
+ }
+
+ /** Returns the height of the image, or -1 if it is unknown. If the
+ * image height is unknown, the observer object will be notified when
+ * the value is known.
+ *
+ * @param observer the image observer for this object
+ * @return the height in pixels
+ * @see #getWidth(ImageObserver)
+ */
+ public int getHeight (ImageObserver observer)
+ {
+ return height;
+ }
+
+ /** Returns the height of the image, or -1 if it is unknown. If the
+ * image height is unknown, the observer object will be notified when
+ * the value is known.
+ *
+ * @return the height in pixels
+ * @see #getWidth()
+ */
+ public int getHeight ()
+ {
+ return height;
+ }
+
+ /** Returns the image producer object for this object. The producer is the
+ * object which generates pixels for this image.
+ *
+ * @return the image producer for this object
+ */
+ public ImageProducer getSource ()
+ {
+ throw new UnsupportedOperationException ("getSource not supported");
+ }
+
+ /** Returns the width of the image, or -1 if it is unknown. If the
+ * image width is unknown, the observer object will be notified when
+ * the value is known.
+ *
+ * @param observer the image observer for this object
+ * @return the width in pixels
+ * @see #getHeight(ImageObserver)
+ */
+ public int getWidth (ImageObserver observer)
+ {
+ return width;
+ }
+
+ /** Returns the width of the image, or -1 if it is unknown. If the
+ * image width is unknown, the observer object will be notified when
+ * the value is known.
+ *
+ * @return the width in pixels
+ * @see #getHeight()
+ */
+ public int getWidth ()
+ {
+ return width;
+ }
+
+ /** This method requests a named property for an object. The value of the
+ * property is returned. The value <code>UndefinedProperty</code> is
+ * returned if there is no property with the specified name. The value
+ * <code>null</code> is returned if the properties for the object are
+ * not yet known. In this case, the specified image observer is notified
+ * when the properties are known.
+ *
+ * @param name the requested property name
+ * @param observer the image observer for this object
+ * @return the named property, if available
+ * @see #UndefinedProperty
+ */
+ public Object getProperty (String name, ImageObserver observer)
+ {
+ return null;
+ }
+
+ /** Get the GraphicsConfiguration to which this image is coupled
+ * @return the GraphicsConfiguration
+ */
+ public GraphicsConfiguration getGraphicsConfiguration ()
+ {
+ return config;
+ }
+}
diff --git a/libjava/gnu/gcj/Core.java b/libjava/gnu/gcj/Core.java
index 15a7e5c1255..80d623c5655 100644
--- a/libjava/gnu/gcj/Core.java
+++ b/libjava/gnu/gcj/Core.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -14,5 +14,8 @@ public class Core
public RawData ptr;
public int length;
-}
+ Core ()
+ {
+ }
+}
diff --git a/libjava/gnu/gcj/convert/natIconv.cc b/libjava/gnu/gcj/convert/natIconv.cc
index 7b7ec64488e..d98e449677a 100644
--- a/libjava/gnu/gcj/convert/natIconv.cc
+++ b/libjava/gnu/gcj/convert/natIconv.cc
@@ -1,6 +1,6 @@
-// Input_iconv.java -- Java side of iconv() reader.
+// natIconv.cc -- Java side of iconv() reader.
-/* Copyright (C) 2000, 2001 Free Software Foundation
+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -201,25 +201,39 @@ gnu::gcj::convert::Output_iconv::write (jcharArray inbuffer,
inbuf = (char *) temp_buffer;
}
- // If the conversion fails on the very first character, then we
- // assume that the character can't be represented in the output
- // encoding. There's nothing useful we can do here, so we simply
- // omit that character. Note that we can't check `errno' because
- // glibc 2.1.3 doesn't set it correctly. We could check it if we
- // really needed to, but we'd have to disable support for 2.1.3.
size_t loop_old_in = old_in;
while (1)
{
size_t r = iconv_adapter (iconv, (iconv_t) handle,
&inbuf, &inavail,
&outbuf, &outavail);
- if (r == (size_t) -1 && inavail == loop_old_in)
+ if (r == (size_t) -1)
{
- inavail -= 2;
- if (inavail == 0)
- break;
- loop_old_in -= 2;
- inbuf += 2;
+ if (errno == EINVAL)
+ {
+ // Incomplete byte sequence at the end of the input
+ // buffer. This shouldn't be able to happen here.
+ break;
+ }
+ else if (errno == E2BIG)
+ {
+ // Output buffer is too small.
+ break;
+ }
+ else if (errno == EILSEQ || inavail == loop_old_in)
+ {
+ // Untranslatable sequence. Since glibc 2.1.3 doesn't
+ // properly set errno, we also assume that this is what
+ // is happening if no conversions took place. (This can
+ // be a bogus assumption if in fact the output buffer is
+ // too small.) We skip the first character and try
+ // again.
+ inavail -= 2;
+ if (inavail == 0)
+ break;
+ loop_old_in -= 2;
+ inbuf += 2;
+ }
}
else
break;
diff --git a/libjava/gnu/gcj/natCore.cc b/libjava/gnu/gcj/natCore.cc
index 75a7ad05ae1..91b02479fd8 100644
--- a/libjava/gnu/gcj/natCore.cc
+++ b/libjava/gnu/gcj/natCore.cc
@@ -1,6 +1,6 @@
// natCore -- C++ side of Core
-/* Copyright (C) 2001, 2002 Free Software Foundation
+/* Copyright (C) 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -21,40 +21,49 @@ details. */
#include <java/io/IOException.h>
#include <gnu/gcj/Core.h>
-typedef struct core_chain_struct
+// List of global core values.
+static _Jv_core_chain *root;
+
+static void
+default_register_resource (_Jv_core_chain *node)
{
- int name_length;
- const char *name;
- int data_length;
- const void *data;
-
- struct core_chain_struct *next;
-} core_chain;
+ node->next = root;
+ root = node;
+}
-static core_chain *root;
+// This is set only when a lock is held on java.lang.Class.
+// This function is called to handle a new core node.
+void (*_Jv_RegisterCoreHook) (_Jv_core_chain *) = default_register_resource;
-void _Jv_RegisterResource (void *vptr)
+void
+_Jv_RegisterResource (void *vptr)
{
- char *rptr = (char *)vptr;
+ char *rptr = (char *) vptr;
- // These are permanent data structures for now. This routine is
- // called from a static constructor, so we shouldn't depend on too
- // much existing infrastructure.
- core_chain *cc = (core_chain *) _Jv_Malloc (sizeof (core_chain));
+ _Jv_core_chain *cc = (_Jv_core_chain *) _Jv_Malloc (sizeof (_Jv_core_chain));
cc->name_length = ((int *)rptr)[0];
cc->data_length = ((int *)rptr)[1];
- cc->name = rptr + 2*sizeof(int);
+ cc->name = rptr + 2 * sizeof (int);
cc->data = cc->name + cc->name_length;
+ cc->next = NULL;
- // Add this new item to the chain...
- core_chain *old_root = root;
- cc->next = old_root;
- root = cc;
+ (*_Jv_RegisterCoreHook) (cc);
}
-gnu::gcj::Core *
-gnu::gcj::Core::create (jstring name)
+void
+_Jv_FreeCoreChain (_Jv_core_chain *chain)
+{
+ while (chain != NULL)
+ {
+ _Jv_core_chain *next = chain->next;
+ _Jv_Free (chain);
+ chain = next;
+ }
+}
+
+_Jv_core_chain *
+_Jv_FindCore (_Jv_core_chain *node, jstring name)
{
char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (name) + 1);
jsize total = JvGetStringUTFRegion (name, 0, name->length(), buf);
@@ -68,23 +77,38 @@ gnu::gcj::Core::create (jstring name)
--total;
}
- core_chain *node = root;
-
while (node)
{
if (total == node->name_length
&& strncmp (buf, node->name, total) == 0)
- {
- gnu::gcj::Core *core =
- (gnu::gcj::Core *) _Jv_AllocObject(&gnu::gcj::Core::class$,
- sizeof (gnu::gcj::Core));
- core->ptr = (gnu::gcj::RawData *) node->data;
- core->length = node->data_length;
- return core;
- }
- else
- node = node->next;
+ return node;
+ node = node->next;
+ }
+
+ return NULL;
+}
+
+gnu::gcj::Core *
+_Jv_create_core (_Jv_core_chain *node, jstring name)
+{
+ node = _Jv_FindCore (node, name);
+
+ gnu::gcj::Core *core = NULL;
+ if (node)
+ {
+ core = (gnu::gcj::Core *) _Jv_AllocObject(&gnu::gcj::Core::class$,
+ sizeof (gnu::gcj::Core));
+ core->ptr = (gnu::gcj::RawData *) node->data;
+ core->length = node->data_length;
}
+ return core;
+}
- throw new java::io::IOException (JvNewStringLatin1 ("can't open core"));
+gnu::gcj::Core *
+gnu::gcj::Core::create (jstring name)
+{
+ gnu::gcj::Core *core = _Jv_create_core (root, name);
+ if (core == NULL)
+ throw new java::io::IOException (JvNewStringLatin1 ("can't open core"));
+ return core;
}
diff --git a/libjava/gnu/gcj/protocol/core/Connection.java b/libjava/gnu/gcj/protocol/core/Connection.java
index 5bcbb8611c7..95d709630ac 100644
--- a/libjava/gnu/gcj/protocol/core/Connection.java
+++ b/libjava/gnu/gcj/protocol/core/Connection.java
@@ -1,6 +1,6 @@
// Connection.java - Implementation of URLConnection for core protocol.
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -55,7 +55,7 @@ class Connection extends URLConnection
if (! doInput)
throw new ProtocolException("Can't open InputStream if doInput is false");
- return new BufferedInputStream(new CoreInputStream (core));
+ return new CoreInputStream (core);
}
// Override default method in URLConnection.
diff --git a/libjava/gnu/gcj/runtime/NameFinder.java b/libjava/gnu/gcj/runtime/NameFinder.java
index 19820c1bd6b..0c358368390 100644
--- a/libjava/gnu/gcj/runtime/NameFinder.java
+++ b/libjava/gnu/gcj/runtime/NameFinder.java
@@ -154,18 +154,10 @@ public class NameFinder
if (addr2line != null)
{
- try
- {
- addr2lineIn = new BufferedReader
- (new InputStreamReader(addr2line.getInputStream()));
- addr2lineOut = new BufferedWriter
- (new OutputStreamWriter(addr2line.getOutputStream()));
- }
- catch (IOException ioe)
- {
- addr2line.destroy();
- addr2line = null;
- }
+ addr2lineIn = new BufferedReader
+ (new InputStreamReader(addr2line.getInputStream()));
+ addr2lineOut = new BufferedWriter
+ (new OutputStreamWriter(addr2line.getOutputStream()));
}
}
}
diff --git a/libjava/gnu/gcj/runtime/SharedLibHelper.java b/libjava/gnu/gcj/runtime/SharedLibHelper.java
new file mode 100644
index 00000000000..9e170a120be
--- /dev/null
+++ b/libjava/gnu/gcj/runtime/SharedLibHelper.java
@@ -0,0 +1,144 @@
+/* Copyright (C) 2001, 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. */
+
+package gnu.gcj.runtime;
+import java.lang.ref.WeakReference;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.HashMap;
+import java.security.*;
+import gnu.gcj.Core;
+
+public class SharedLibHelper
+{
+ /** Load a shared library, and associate a ClassLoader with it.
+ * @param libname named of shared library (passed to dlopen)
+ * @param parent the parent ClassLoader
+ * @parem flags passed to dlopen
+ */
+ SharedLibHelper(String libname, ClassLoader parent, CodeSource source,
+ int flags)
+ {
+ // FIXME: ask security manager first.
+ loader = parent;
+ baseName = libname;
+ domain = new ProtectionDomain(source,
+ Policy.getPolicy().getPermissions(source));
+ this.flags = flags;
+ }
+
+ public static SharedLibHelper findHelper (String libname)
+ {
+ synchronized (map)
+ {
+ WeakReference ref = (WeakReference) map.get(libname);
+ if (ref != null)
+ return (SharedLibHelper) ref.get();
+ return null;
+ }
+ }
+
+ public static SharedLibHelper findHelper (ClassLoader loader, String libname,
+ CodeSource source)
+ {
+ synchronized (map)
+ {
+ SharedLibHelper result;
+ WeakReference ref = (WeakReference) map.get(libname);
+ if (ref != null)
+ {
+ result = (SharedLibHelper) ref.get();
+ if (result != null)
+ {
+ if (result.loader != loader)
+ // FIXME
+ throw new UnknownError();
+ return result;
+ }
+ }
+
+ result = new SharedLibHelper(libname, loader, source, 0);
+ map.put(libname, new WeakReference(result));
+ return result;
+ }
+ }
+
+ public native void finalize ();
+
+ public Class findClass(String name)
+ {
+ ensureInit();
+ return (Class) classMap.get(name);
+ }
+
+ public URL findResource (String name)
+ {
+ ensureInit();
+ if (! hasResource(name))
+ return null;
+ try
+ {
+ return new URL("gcjlib", "", -1, baseName + "!/" + name);
+ }
+ catch (MalformedURLException _)
+ {
+ }
+ return null;
+ }
+
+ public native Core findCore (String name);
+
+ void ensureInit()
+ {
+ synchronized (classMap)
+ {
+ if (initialized)
+ return;
+ init();
+ initialized = true;
+ }
+ }
+
+ native boolean hasResource(String name);
+ native void init();
+
+ /** Called during dlopen's processing of the init section. */
+ void registerClass(String name, Class cls)
+ {
+ classMap.put(name, cls);
+ }
+
+ /** The handle returned by dlopen. */
+ gnu.gcj.RawData handler;
+
+ /** Holds a _Jv_core_chain for the loader. */
+ gnu.gcj.RawData core_chain;
+
+ /** Map classnames to Classes. */
+ HashMap classMap = new HashMap(20);
+
+ /** Class loader we're helping. */
+ ClassLoader loader;
+
+ /** Name of base file. */
+ String baseName;
+
+ /** Protection domain for loaded classes. */
+ ProtectionDomain domain;
+
+ /** Flags to pass to dlopen. FIXME: platform dependent.
+ 0 is always "sensible" (defined by us). */
+ int flags;
+
+ /** True if we've been initialized. */
+ boolean initialized = false;
+
+ /** Map shared library names to a helper object. This uses weak
+ references in the values so we don't prevent collection. */
+ static HashMap map = new HashMap ();
+}
diff --git a/libjava/gnu/gcj/runtime/SharedLibLoader.java b/libjava/gnu/gcj/runtime/SharedLibLoader.java
index ac2f72d4b64..1f80bbc8289 100644
--- a/libjava/gnu/gcj/runtime/SharedLibLoader.java
+++ b/libjava/gnu/gcj/runtime/SharedLibLoader.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -7,7 +7,12 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package gnu.gcj.runtime;
-import java.util.Hashtable;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.CodeSource;
+import java.util.Enumeration;
+import java.util.Vector;
/**
* A ClassLoader backed by a gcj-compiled shared library.
@@ -16,14 +21,6 @@ import java.util.Hashtable;
public class SharedLibLoader extends ClassLoader
{
- public native void finalize ();
-
- /** Called during dlopen's processing of the init section. */
- void registerClass(String name, Class cls)
- {
- classMap.put(name, cls);
- }
-
/** Load a shared library, and associate a ClassLoader with it.
* @param libname named of shared library (passed to dlopen)
* @param parent the parent ClassLoader
@@ -32,44 +29,51 @@ public class SharedLibLoader extends ClassLoader
public SharedLibLoader(String libname, ClassLoader parent, int flags)
{
super(parent);
- init(libname, flags);
+ URL url;
+ try
+ {
+ url = new URL("file", "", libname);
+ }
+ catch (MalformedURLException _)
+ {
+ url = null;
+ }
+ helper = SharedLibHelper.findHelper(this, libname,
+ new CodeSource(url, null));
}
-
/** Load a shared library, and asociate a ClassLoader with it.
* @param libname named of shared library (passed to dlopen)
*/
public SharedLibLoader(String libname)
{
- super(getSystemClassLoader());
- init(libname, 0);
+ this(libname, getSystemClassLoader(), 0);
}
- void init(String libname, int flags)
+ public Class findClass(String name)
+ throws ClassNotFoundException
{
- init(libname.getBytes(), flags);
+ Class cls = helper.findClass(name);
+ if (cls == null)
+ throw new ClassNotFoundException(name);
+ return cls;
}
- native void init(byte[] libname, int flags);
-
- public Class loadClass(String name)
- throws ClassNotFoundException
+ public URL findResource (String name)
{
- return super.loadClass(name);
+ return helper.findResource(name);
}
- public Class findClass(String name)
- throws ClassNotFoundException
+ public Enumeration findResources (String name) throws IOException
{
- Object cls = classMap.get(name);
- if (cls == null)
- throw new ClassNotFoundException(name);
- return (Class) cls;
+ URL url = findResource(name);
+ if (url == null)
+ return null;
+ Vector v = new Vector(1);
+ v.add(url);
+ return v.elements();
}
- /** The handle returned by dlopen. */
- gnu.gcj.RawData handler;
-
- /** Map classnames to Classes. */
- Hashtable classMap = new Hashtable(20);
+ /** The helper that does the work for us. */
+ SharedLibHelper helper;
}
diff --git a/libjava/gnu/gcj/runtime/StackTrace.java b/libjava/gnu/gcj/runtime/StackTrace.java
index 5faaa1495ae..684ee4fd997 100644
--- a/libjava/gnu/gcj/runtime/StackTrace.java
+++ b/libjava/gnu/gcj/runtime/StackTrace.java
@@ -139,6 +139,8 @@ public final class StackTrace
return len;
}
+ public static native Class getClass(RawData ip);
+
private static native void update();
private static MethodRef methodAtAddress(RawData addr)
{
diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java
index fd0c32c2c57..ca0f663c9cc 100644
--- a/libjava/gnu/gcj/runtime/VMClassLoader.java
+++ b/libjava/gnu/gcj/runtime/VMClassLoader.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -12,6 +12,7 @@ package gnu.gcj.runtime;
import java.io.*;
import java.util.StringTokenizer;
+import java.util.HashSet;
import java.net.URL;
public final class VMClassLoader extends java.net.URLClassLoader
@@ -19,6 +20,20 @@ public final class VMClassLoader extends java.net.URLClassLoader
private VMClassLoader ()
{
super (init());
+ String p
+ = System.getProperty ("gnu.gcj.runtime.VMClassLoader.library_control",
+ "");
+ if ("never".equals(p))
+ lib_control = LIB_NEVER;
+ else if ("cache".equals(p))
+ lib_control = LIB_CACHE;
+ else if ("full".equals(p))
+ {
+ // In case we ever want to change the default.
+ lib_control = LIB_FULL;
+ }
+ else
+ lib_control = LIB_FULL;
}
private static URL[] init()
@@ -67,6 +82,17 @@ public final class VMClassLoader extends java.net.URLClassLoader
protected native Class findClass(String name)
throws java.lang.ClassNotFoundException;
+ // This keeps track of shared libraries we've already tried to load.
+ private HashSet tried_libraries = new HashSet();
+
+ // Holds one of the LIB_* constants; used to determine how shared
+ // library loads are done.
+ private int lib_control;
+
// The only VMClassLoader that can exist.
- public static VMClassLoader instance = new VMClassLoader ();
+ public static VMClassLoader instance = new VMClassLoader();
+
+ private static final int LIB_FULL = 0;
+ private static final int LIB_CACHE = 1;
+ private static final int LIB_NEVER = 2;
}
diff --git a/libjava/gnu/gcj/runtime/natSharedLibLoader.cc b/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
index 233540917b3..46eef755a09 100644
--- a/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
+++ b/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
@@ -1,6 +1,6 @@
-// natSharedLibLoader.cc - Implementation of FirstThread native methods.
+// natSharedLibLoader.cc - Implementation of SharedLibHelper native methods.
-/* Copyright (C) 2001 Free Software Foundation
+/* Copyright (C) 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -11,65 +11,113 @@ details. */
#include <config.h>
#include <gcj/cni.h>
-#include <gnu/gcj/runtime/SharedLibLoader.h>
+#include <jvm.h>
+#include <gnu/gcj/runtime/SharedLibHelper.h>
#include <java/io/IOException.h>
#include <java/lang/UnsupportedOperationException.h>
+#include <java/lang/UnknownError.h>
#ifdef HAVE_DLOPEN
#include <dlfcn.h>
/* Only used during dlopen, while having a lock on Class.class. */
-static gnu::gcj::runtime::SharedLibLoader* curLoader;
+static java::lang::ClassLoader *curLoader;
+static gnu::gcj::runtime::SharedLibHelper *curHelper;
typedef void (*ClassHookFunc) (jclass);
+typedef void (*CoreHookFunc) (_Jv_core_chain *);
+
+void
+_Jv_sharedlib_register_hook (jclass cls)
+{
+ curHelper->registerClass(cls->getName(), cls);
+ cls->protectionDomain = curHelper->domain;
+ cls->loader = curLoader;
+}
static void
-::register_hook(jclass cls)
+core_hook (_Jv_core_chain *chain)
{
- curLoader->registerClass(cls->getName(), cls);
+ chain->next = (_Jv_core_chain *) curHelper->core_chain;
+ curHelper->core_chain = (gnu::gcj::RawData *) chain;
}
struct SharedLibDummy
{
ClassHookFunc saved;
+ CoreHookFunc saved_core;
SharedLibDummy()
{
saved = _Jv_RegisterClassHook;
+ saved_core = _Jv_RegisterCoreHook;
}
~SharedLibDummy()
{
_Jv_RegisterClassHook = saved;
+ _Jv_RegisterCoreHook = saved_core;
curLoader = NULL;
}
};
#endif
void
-gnu::gcj::runtime::SharedLibLoader::init(jbyteArray libname, jint flags)
+gnu::gcj::runtime::SharedLibHelper::init(void)
{
#ifdef HAVE_DLOPEN
- char *lname = (char*) elements(libname);
+ char *lname = (char *) __builtin_alloca (JvGetStringUTFLength (baseName)
+ + 1);
+ jsize total = JvGetStringUTFRegion (baseName, 0, baseName->length(), lname);
+ lname[total] = '\0';
+
if (flags==0)
- flags = RTLD_LAZY;
+ flags = RTLD_GLOBAL | RTLD_LAZY;
JvSynchronize dummy1(&java::lang::Class::class$);
SharedLibDummy dummy2;
- curLoader = this;
- _Jv_RegisterClassHook = ::register_hook;
+ curLoader = loader;
+ curHelper = this;
+ _Jv_RegisterClassHook = _Jv_sharedlib_register_hook;
+ _Jv_RegisterCoreHook = core_hook;
void *h = dlopen(lname, flags);
if (h == NULL)
{
const char *msg = dlerror();
+ throw new java::lang::UnknownError(JvNewStringLatin1(msg));
}
handler = (gnu::gcj::RawData*) h;
#else
- const char *msg = "ShareedLibLoader is not supported on this platform";
+ const char *msg
+ = "shared library class loading is not supported on this platform";
throw new java::lang::UnsupportedOperationException(JvNewStringLatin1(msg));
#endif
}
+jboolean
+gnu::gcj::runtime::SharedLibHelper::hasResource (jstring name)
+{
+#ifdef HAVE_DLOPEN
+ _Jv_core_chain *node = _Jv_FindCore ((_Jv_core_chain *) core_chain, name);
+ return node != NULL;
+#else
+ return false;
+#endif
+}
+
+gnu::gcj::Core *
+gnu::gcj::runtime::SharedLibHelper::findCore (jstring name)
+{
+#ifdef HAVE_DLOPEN
+ extern gnu::gcj::Core *_Jv_create_core (_Jv_core_chain *node, jstring name);
+ ensureInit();
+ return _Jv_create_core ((_Jv_core_chain *) core_chain, name);
+#else
+ return NULL;
+#endif
+}
+
void
-gnu::gcj::runtime::SharedLibLoader::finalize()
+gnu::gcj::runtime::SharedLibHelper::finalize()
{
+ _Jv_FreeCoreChain ((_Jv_core_chain *) core_chain);
#ifdef HAVE_DLOPEN
dlclose (handler);
#endif
diff --git a/libjava/gnu/gcj/runtime/natStackTrace.cc b/libjava/gnu/gcj/runtime/natStackTrace.cc
index d39cd00dbab..af8889beb52 100644
--- a/libjava/gnu/gcj/runtime/natStackTrace.cc
+++ b/libjava/gnu/gcj/runtime/natStackTrace.cc
@@ -124,6 +124,16 @@ gnu::gcj::runtime::StackTrace::getCompiledMethodRef (gnu::gcj::RawData *addr)
}
java::lang::Class *
+gnu::gcj::runtime::StackTrace::getClass (gnu::gcj::RawData *p)
+{
+ gnu::gcj::runtime::MethodRef *ref = getCompiledMethodRef (p);
+ if (ref)
+ return ref->klass;
+ else
+ return NULL;
+}
+
+java::lang::Class *
gnu::gcj::runtime::StackTrace::classAt (jint n)
{
_Jv_frame_info *frame = GET_FRAME (n);
@@ -137,12 +147,7 @@ gnu::gcj::runtime::StackTrace::classAt (jint n)
}
#endif // INTERPRETER
- gnu::gcj::runtime::MethodRef *ref
- = getCompiledMethodRef ((gnu::gcj::RawData *)frame->addr);
- if (ref)
- return ref->klass;
- else
- return NULL;
+ return getClass ((gnu::gcj::RawData *)frame->addr);
}
java::lang::String*
diff --git a/libjava/gnu/gcj/runtime/natVMClassLoader.cc b/libjava/gnu/gcj/runtime/natVMClassLoader.cc
index 33b63d6759a..42ac2a02107 100644
--- a/libjava/gnu/gcj/runtime/natVMClassLoader.cc
+++ b/libjava/gnu/gcj/runtime/natVMClassLoader.cc
@@ -1,6 +1,6 @@
// Native code for VMClassLoader
-/* Copyright (C) 2002 Free Software Foundation
+/* Copyright (C) 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -18,6 +18,7 @@ details. */
#include <java/lang/StringBuffer.h>
#include <java/net/URLClassLoader.h>
#include <java/lang/Runtime.h>
+#include <java/util/HashSet.h>
jclass
gnu::gcj::runtime::VMClassLoader::findClass (jstring name)
@@ -25,7 +26,7 @@ gnu::gcj::runtime::VMClassLoader::findClass (jstring name)
_Jv_Utf8Const *name_u = _Jv_makeUtf8Const (name);
jclass klass = _Jv_FindClassInCache (name_u, 0);
- if (! klass)
+ if (! klass && lib_control != LIB_NEVER)
{
// Turn `gnu.pkg.quux' into `lib-gnu-pkg-quux'. Then search for
// a module named (eg, on Linux) `lib-gnu-pkg-quux.so', followed
@@ -41,11 +42,20 @@ gnu::gcj::runtime::VMClassLoader::findClass (jstring name)
cn = name->substring (0, ci);
jstring so_base_name = (sb->append (cn)->toString ())->replace ('.', '-');
+ using namespace ::java::lang;
+ Runtime *rt = Runtime::getRuntime();
+
// Compare against `3' because that is the length of "lib".
while (! klass && so_base_name && so_base_name->length() > 3)
{
- using namespace ::java::lang;
- Runtime *rt = Runtime::getRuntime();
+ if (lib_control == LIB_CACHE)
+ {
+ // If we've already tried this name, we're done.
+ if (tried_libraries->contains(so_base_name))
+ break;
+ tried_libraries->add(so_base_name);
+ }
+
jboolean loaded = rt->loadLibraryInternal (so_base_name);
jint nd = so_base_name->lastIndexOf ('-');
diff --git a/libjava/gnu/gcj/xlib/Drawable.java b/libjava/gnu/gcj/xlib/Drawable.java
index 551aca84c18..fa12ba2b3fe 100644
--- a/libjava/gnu/gcj/xlib/Drawable.java
+++ b/libjava/gnu/gcj/xlib/Drawable.java
@@ -79,6 +79,8 @@ public class Drawable extends XID
public native Rectangle getBounds(Rectangle rv);
+ public native int getDepth ();
+
private static final String MSG_XGETSUBIMAGE_FAILED =
"XGetSubImage() failed.";
diff --git a/libjava/gnu/gcj/xlib/GC.java b/libjava/gnu/gcj/xlib/GC.java
index 021f53756fb..24cd3bd1f53 100644
--- a/libjava/gnu/gcj/xlib/GC.java
+++ b/libjava/gnu/gcj/xlib/GC.java
@@ -36,15 +36,23 @@ public class GC implements Cloneable
*/
public Object clone()
{
- GC gcClone = target.getGCFromCache ();
- if (gcClone==null)
- {
- gcClone = (GC) super.clone();
- gcClone.structure = null;
- }
- gcClone.initStructure(this);
- gcClone.updateClip();
- return gcClone;
+ try
+ {
+ GC gcClone = target.getGCFromCache ();
+ if (gcClone==null)
+ {
+ gcClone = (GC) super.clone();
+ gcClone.structure = null;
+ }
+ gcClone.initStructure(this);
+ gcClone.updateClip();
+ return gcClone;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
private native void initStructure(GC copyFrom);
@@ -130,6 +138,11 @@ public class GC implements Cloneable
int destX, int destY,
int width, int height);
+ public native void copyArea (Drawable source,
+ int srcX, int srcY,
+ int destX, int destY,
+ int width, int height);
+
public Drawable getDrawable()
{
return target;
diff --git a/libjava/gnu/gcj/xlib/WMSizeHints.java b/libjava/gnu/gcj/xlib/WMSizeHints.java
index 29344eee1eb..c0b198c58a7 100644
--- a/libjava/gnu/gcj/xlib/WMSizeHints.java
+++ b/libjava/gnu/gcj/xlib/WMSizeHints.java
@@ -27,12 +27,20 @@ public class WMSizeHints implements Cloneable
protected native void finalize();
public Object clone() {
- WMSizeHints hints = (WMSizeHints) super.clone();
- // In case of an exception before the stucture is copied.
- hints.structure = null;
-
- hints.init(this);
- return hints;
+ try
+ {
+ WMSizeHints hints = (WMSizeHints) super.clone();
+ // In case of an exception before the stucture is copied.
+ hints.structure = null;
+
+ hints.init(this);
+ return hints;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
public native void applyNormalHints(Window window);
diff --git a/libjava/gnu/gcj/xlib/WindowAttributes.java b/libjava/gnu/gcj/xlib/WindowAttributes.java
index 6efeaa5d434..23be37d6363 100644
--- a/libjava/gnu/gcj/xlib/WindowAttributes.java
+++ b/libjava/gnu/gcj/xlib/WindowAttributes.java
@@ -43,15 +43,23 @@ public class WindowAttributes
public Object clone()
{
- WindowAttributes attributes = (WindowAttributes) super.clone();
- // In case of an exception before the stucture is copied.
- attributes.in = null;
- attributes.out = null;
-
- // FIXME: do anything else?
+ try
+ {
+ WindowAttributes attributes = (WindowAttributes) super.clone();
+ // In case of an exception before the stucture is copied.
+ attributes.in = null;
+ attributes.out = null;
+
+ // FIXME: do anything else?
- attributes.init(this);
- return attributes;
+ attributes.init(this);
+ return attributes;
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ // This should never happen.
+ throw new InternalError ();
+ }
}
public native void setBackground(long pixel);
diff --git a/libjava/gnu/gcj/xlib/XAnyEvent.java b/libjava/gnu/gcj/xlib/XAnyEvent.java
index e7a4a02b987..df1ad782d79 100644
--- a/libjava/gnu/gcj/xlib/XAnyEvent.java
+++ b/libjava/gnu/gcj/xlib/XAnyEvent.java
@@ -19,14 +19,40 @@ import gnu.gcj.RawData;
public final class XAnyEvent
{
// Must match the definitions in X.h:
- public static final int TYPE_BUTTON_PRESS = 4,
- TYPE_BUTTON_RELEASE = 5,
- TYPE_EXPOSE = 12,
- TYPE_UNMAP_NOTIFY = 18,
- TYPE_MAP_NOTIFY = 19,
- TYPE_REPARENT_NOTIFY = 21,
- TYPE_CONFIGURE_NOTIFY = 22,
- TYPE_CLIENT_MESSAGE = 33;
+ public static final int
+ TYPE_KEY_PRESS = 2,
+ TYPE_KEY_RELEASE = 3,
+ TYPE_BUTTON_PRESS = 4,
+ TYPE_BUTTON_RELEASE = 5,
+ TYPE_MOTION_NOTIFY = 6,
+ TYPE_ENTER_NOTIFY = 7,
+ TYPE_LEAVE_NOTIFY = 8,
+ TYPE_FOCUS_IN = 9,
+ TYPE_FOCUS_OUT = 10,
+ TYPE_KEYMAP_NOTIFY = 11,
+ TYPE_EXPOSE = 12,
+ TYPE_GRAPHICS_EXPOSE = 13,
+ TYPE_NO_EXPOSE = 14,
+ TYPE_VISIBILITY_NOTIFY = 15,
+ TYPE_CREATE_NOTIFY = 16,
+ TYPE_DESTROY_NOTIFY = 17,
+ TYPE_UNMAP_NOTIFY = 18,
+ TYPE_MAP_NOTIFY = 19,
+ TYPE_MAP_REQUEST = 20,
+ TYPE_REPARENT_NOTIFY = 21,
+ TYPE_CONFIGURE_NOTIFY = 22,
+ TYPE_CONFIGURE_REQUEST = 23,
+ TYPE_GRAVITY_NOTIFY = 24,
+ TYPE_RESIZE_REQUEST = 25,
+ TYPE_CIRCULATE_NOTIFY = 26,
+ TYPE_CIRCULATE_REQUEST = 27,
+ TYPE_PROPERTY_NOTIFY = 28,
+ TYPE_SELECTION_CLEAR = 29,
+ TYPE_SELECTION_REQUEST = 30,
+ TYPE_SELECTION_NOTIFY = 31,
+ TYPE_COLORMAP_NOTIFY = 32,
+ TYPE_CLIENT_MESSAGE = 33,
+ TYPE_MAPPING_NOTIFY = 34;
// Must match the definitions in X.h:
public final static long MASK_SUBSTRUCTURE_NOTIFY = 1L<<19,
diff --git a/libjava/gnu/gcj/xlib/natDrawable.cc b/libjava/gnu/gcj/xlib/natDrawable.cc
index 6cca3b74901..87c9d3572b2 100644
--- a/libjava/gnu/gcj/xlib/natDrawable.cc
+++ b/libjava/gnu/gcj/xlib/natDrawable.cc
@@ -43,6 +43,26 @@ jboolean gnu::gcj::xlib::Drawable::copyIntoXImageImpl(XImage* image,
return true;
}
+jint gnu::gcj::xlib::Drawable::getDepth ()
+{
+ ::Display* dpy = (::Display*) (getDisplay ()->display);
+ ::Window root;
+ int x, y;
+ unsigned int w, h, bw, depth;
+
+ Status status = XGetGeometry (dpy, getXID(), &root,
+ &x, &y, &w, &h,
+ &bw, &depth);
+ switch (status)
+ {
+ case BadDrawable:
+ throw new XException (display, status);
+ default:
+ ; // All OK, NOP.
+ }
+ return (jint)depth;
+}
+
java::awt::Rectangle*
gnu::gcj::xlib::Drawable::getBounds(java::awt::Rectangle* rv)
{
diff --git a/libjava/gnu/gcj/xlib/natGC.cc b/libjava/gnu/gcj/xlib/natGC.cc
index fd9fca84564..17bcbe67b5a 100644
--- a/libjava/gnu/gcj/xlib/natGC.cc
+++ b/libjava/gnu/gcj/xlib/natGC.cc
@@ -237,3 +237,18 @@ void gnu::gcj::xlib::GC::updateClip()
ordering);
// no fast fail
}
+
+void gnu::gcj::xlib::GC::copyArea (gnu::gcj::xlib::Drawable * source,
+ jint srcX, jint srcY,
+ jint destX, jint destY,
+ jint width, jint height)
+{
+ Display* display = target->getDisplay ();
+ ::Display* dpy = (::Display*) (display->display);
+ ::Drawable drawableXID = target->getXID ();
+ ::GC gc = (::GC) structure;
+ ::Drawable srcXID = source->getXID ();
+
+ XCopyArea (dpy, srcXID, drawableXID, gc, srcX, srcY, width, height,
+ destX, destY);
+}
diff --git a/libjava/gnu/java/awt/EmbeddedWindow.java b/libjava/gnu/java/awt/EmbeddedWindow.java
new file mode 100644
index 00000000000..fc64e215162
--- /dev/null
+++ b/libjava/gnu/java/awt/EmbeddedWindow.java
@@ -0,0 +1,96 @@
+/* EmbeddedWindow.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.awt;
+
+import gnu.java.awt.peer.EmbeddedWindowPeer;
+import java.awt.Frame;
+import java.awt.Toolkit;
+
+/**
+ * Represents an AWT window that can be embedded into another
+ * application.
+ *
+ * @author Michael Koch <konqueror@gmx.de>
+ */
+public class EmbeddedWindow extends Frame
+{
+ private int window_id;
+
+ /**
+ * Creates an window to be embedded into another application.
+ *
+ * @param window_id The native handle to the screen area where the AWT window
+ * should be embedded.
+ */
+ public EmbeddedWindow (int window_id)
+ {
+ super();
+ this.window_id = window_id;
+ }
+
+ /**
+ * Creates the native peer for this embedded window.
+ */
+ public void addNotify()
+ {
+ Toolkit tk = getToolkit();
+
+ if (! (tk instanceof EmbeddedWindowSupport))
+ throw new UnsupportedOperationException
+ ("Embedded windows are not supported by the current peers: " + tk.getClass());
+
+ setWindowPeer (((EmbeddedWindowSupport) tk).createEmbeddedWindow (this));
+ super.addNotify();
+ }
+
+ // This method is only made native to circumvent the package-privateness of
+ // an AWT internal java.awt.Component.peer member variable.
+ native void setWindowPeer (EmbeddedWindowPeer peer);
+
+ /**
+ * Gets the native handle of the screen area where the window will
+ * be embedded.
+ *
+ * @return The native handle that was passed to the constructor.
+ */
+ public int getHandle()
+ {
+ return window_id;
+ }
+}
diff --git a/libjava/gnu/java/awt/EmbeddedWindowSupport.java b/libjava/gnu/java/awt/EmbeddedWindowSupport.java
new file mode 100644
index 00000000000..986095305f7
--- /dev/null
+++ b/libjava/gnu/java/awt/EmbeddedWindowSupport.java
@@ -0,0 +1,65 @@
+/* EmbeddedWindowSupport.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.awt;
+
+import gnu.java.awt.peer.EmbeddedWindowPeer;
+
+/**
+ * Declares a method for creating native embedded window peers.
+ *
+ * All classes inherited from java.awt.Toolkit that implement this
+ * interface are assumed to support the creation of embedded window
+ * peers. To create an embedded window, use
+ * gnu.java.awt.EmbeddedWindow.
+ *
+ * @see gnu.java.awt.EmbeddedWindow
+ * @see java.awt.Toolkit
+ *
+ * @author Michael Koch <konqueror@gmx.de>
+ */
+public interface EmbeddedWindowSupport
+{
+ /**
+ * Creates an embedded window peer, and associates it with an
+ * EmbeddedWindow object.
+ *
+ * @param w The embedded window with which to associate a peer.
+ */
+ public EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w);
+}
diff --git a/libjava/gnu/java/awt/natEmbeddedWindow.cc b/libjava/gnu/java/awt/natEmbeddedWindow.cc
new file mode 100644
index 00000000000..79cdd6797e0
--- /dev/null
+++ b/libjava/gnu/java/awt/natEmbeddedWindow.cc
@@ -0,0 +1,18 @@
+/* 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 <gnu/java/awt/EmbeddedWindow.h>
+#include <gnu/java/awt/peer/EmbeddedWindowPeer.h>
+#include <java/awt/peer/ComponentPeer.h>
+
+void
+gnu::java::awt::EmbeddedWindow::setWindowPeer (gnu::java::awt::peer::EmbeddedWindowPeer* w)
+{
+ if (!peer)
+ peer = reinterpret_cast< ::java::awt::peer::ComponentPeer *> (w);
+}
diff --git a/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java b/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java
new file mode 100644
index 00000000000..a1787684505
--- /dev/null
+++ b/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java
@@ -0,0 +1,46 @@
+/* EmbeddedWindowPeer.java -- Interface for window peers that may be
+ embedded into other applications
+ 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.awt.peer;
+
+import java.awt.peer.FramePeer;
+
+public interface EmbeddedWindowPeer extends FramePeer
+{
+}
diff --git a/libjava/gnu/java/awt/GLightweightPeer.java b/libjava/gnu/java/awt/peer/GLightweightPeer.java
index cb1aac544f3..5c0ea498e82 100644
--- a/libjava/gnu/java/awt/GLightweightPeer.java
+++ b/libjava/gnu/java/awt/peer/GLightweightPeer.java
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* GLightweightPeer.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -34,34 +35,109 @@ 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;
-
-import java.awt.*;
+package gnu.java.awt.peer;
+
+import java.awt.AWTEvent;
+import java.awt.AWTException;
+import java.awt.BufferCapabilities;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Toolkit;
import java.awt.event.PaintEvent;
-import java.awt.peer.*;
-import java.awt.image.*;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.image.VolatileImage;
+import java.awt.peer.ContainerPeer;
+import java.awt.peer.LightweightPeer;
+
+/*
+ * Another possible implementation strategy for lightweight peers is
+ * to make GLightweightPeer a placeholder class that implements
+ * LightweightPeer. Then the Component and Container classes could
+ * identify a peer as lightweight and handle it specially. The
+ * current approach is probably more clear but less efficient.
+ */
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * A stub class that implements the ComponentPeer and ContainerPeer
+ * interfaces using callbacks into the Component and Container
+ * classes. GLightweightPeer allows the Component and Container
+ * classes to treat lightweight and heavyweight peers in the same way.
+ *
+ * Lightweight components are painted directly onto their parent
+ * containers through an Image object provided by the toolkit.
*/
-public class GLightweightPeer implements LightweightPeer
+public class GLightweightPeer
+ implements LightweightPeer, ContainerPeer
{
- public static final GLightweightPeer INSTANCE = new GLightweightPeer();
+ private Component comp;
- public GLightweightPeer() {}
+ private Insets containerInsets;
- // -------- java.awt.peer.ComponentPeer implementation:
+ public GLightweightPeer(Component comp)
+ {
+ this.comp = comp;
+ }
+
+ // -------- java.awt.peer.ContainerPeer implementation:
+
+ public Insets insets()
+ {
+ return getInsets ();
+ }
+
+ public Insets getInsets()
+ {
+ if (containerInsets == null)
+ containerInsets = new Insets (0,0,0,0);
+ return containerInsets;
+ }
+
+ public void beginValidate()
+ {
+ }
+
+ public void endValidate()
+ {
+ }
+
+ public void beginLayout()
+ {
+ }
+ public void endLayout()
+ {
+ }
+
+ public boolean isPaintPending()
+ {
+ return false;
+ }
+
+ // -------- java.awt.peer.ComponentPeer implementation:
+
public int checkImage(Image img, int width, int height, ImageObserver o)
{
- return 0;
+ return comp.getToolkit().checkImage(img, width, height, o);
}
public Image createImage(ImageProducer prod)
{
- return null;
+ return comp.getToolkit().createImage(prod);
}
+ /* This method is not called. */
public Image createImage(int width, int height)
{
return null;
@@ -77,12 +153,14 @@ public class GLightweightPeer implements LightweightPeer
{
return null;
}
-
+
public FontMetrics getFontMetrics(Font f)
{
- return null;
+ return comp.getToolkit().getFontMetrics(f);
}
+ /* Returning null here tells the Component object that called us to
+ * use its parent's Graphics. */
public Graphics getGraphics()
{
return null;
@@ -90,19 +168,25 @@ public class GLightweightPeer implements LightweightPeer
public Point getLocationOnScreen()
{
- return null;
+ Point parentLocation = comp.getParent().getLocationOnScreen();
+ return new Point (parentLocation.x + comp.getX(),
+ parentLocation.y + comp.getY());
}
public Dimension getMinimumSize()
{
- return null;
+ return new Dimension(comp.getWidth(), comp.getHeight());
}
+ /* A lightweight component's preferred size is equivalent to its
+ * Component width and height values. */
public Dimension getPreferredSize()
{
- return null;
+ return new Dimension(comp.getWidth(), comp.getHeight());
}
+ /* Returning null here tells the Component object that called us to
+ * use its parent's Toolkit. */
public Toolkit getToolkit()
{
return null;
@@ -124,12 +208,12 @@ public class GLightweightPeer implements LightweightPeer
public Dimension minimumSize()
{
- return null;
+ return getMinimumSize();
}
public Dimension preferredSize()
{
- return null;
+ return getPreferredSize();
}
public void paint(Graphics graphics) {}
@@ -137,7 +221,7 @@ public class GLightweightPeer implements LightweightPeer
public boolean prepareImage(Image img, int width, int height,
ImageObserver o)
{
- return false;
+ return comp.getToolkit().prepareImage(img, width, height, o);
}
public void print(Graphics graphics) {}
@@ -146,13 +230,16 @@ public class GLightweightPeer implements LightweightPeer
public void requestFocus() {}
- public boolean requestFocus(java.awt.Component source, boolean bool1, boolean bool2, long x) { return false; }
+ public boolean requestFocus(Component source, boolean bool1, boolean bool2, long x)
+ {
+ return false;
+ }
public void reshape(int x, int y, int width, int height) {}
public void setBackground(Color color) {}
- public void setBounds(int x, int y, int width, int height) {}
+ public void setBounds(int x, int y, int width, int height) { }
public void setCursor(Cursor cursor) {}
@@ -170,12 +257,18 @@ public class GLightweightPeer implements LightweightPeer
public ColorModel getColorModel ()
{
- return null;
+ return comp.getColorModel ();
}
- public boolean isObscured() { return false; }
+ public boolean isObscured()
+ {
+ return false;
+ }
- public boolean canDetermineObscurity() { return false; }
+ public boolean canDetermineObscurity()
+ {
+ return false;
+ }
public void coalescePaintEvent(PaintEvent e) { }
@@ -186,14 +279,20 @@ public class GLightweightPeer implements LightweightPeer
return null;
}
- public boolean handlesWheelScrolling() { return false; }
+ public boolean handlesWheelScrolling()
+ {
+ return false;
+ }
- public void createBuffers(int x, java.awt.BufferCapabilities capabilities)
- throws java.awt.AWTException { }
+ public void createBuffers(int x, BufferCapabilities capabilities)
+ throws AWTException { }
- public java.awt.Image getBackBuffer() { return null; }
+ public Image getBackBuffer()
+ {
+ return null;
+ }
- public void flip(java.awt.BufferCapabilities.FlipContents contents) { }
+ public void flip(BufferCapabilities.FlipContents contents) { }
public void destroyBuffers() { }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
index 45690b06669..12982832df5 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
@@ -38,7 +38,8 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+import java.awt.Font;
+import java.awt.FontMetrics;
public class GdkFontMetrics extends FontMetrics
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
index 24ea252d4dc..9012da23cce 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
@@ -38,8 +38,15 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.image.*;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
public class GdkGraphics extends Graphics
@@ -208,8 +215,7 @@ public class GdkGraphics extends Graphics
native void drawString (String str, int x, int y, String fname, int size);
public void drawString (String str, int x, int y)
{
- drawString (str, x, y,
- ((GtkFontPeer)font.getPeer ()).getXLFD (), font.getSize ());
+ drawString (str, x, y, font.getName(), font.getSize());
}
public void drawString (AttributedCharacterIterator ci, int x, int y)
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
new file mode 100644
index 00000000000..11c0371bd08
--- /dev/null
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
@@ -0,0 +1,1146 @@
+/* GdkGraphics2D.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.awt.peer.gtk;
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.font.*;
+import java.awt.color.*;
+import java.awt.image.*;
+import java.awt.image.renderable.*;
+
+import java.text.AttributedCharacterIterator;
+import java.util.Map;
+import java.lang.Integer;
+import gnu.classpath.Configuration;
+
+public class GdkGraphics2D extends Graphics2D
+{
+
+ //////////////////////////////////////
+ ////// State Management Methods //////
+ //////////////////////////////////////
+
+ static
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("gtkpeer");
+ }
+ initStaticState ();
+ }
+ native static void initStaticState ();
+ private final int native_state = GtkGenericPeer.getUniqueInteger();
+
+ private Paint paint;
+ private Stroke stroke;
+ private Color fg;
+ private Color bg;
+ private Shape clip;
+ private AffineTransform transform;
+ private GtkComponentPeer component;
+ private GdkFont font;
+
+ native private int[] initState (GtkComponentPeer component);
+ native private void initState (int width, int height);
+ native private void copyState (GdkGraphics2D g);
+ native public void dispose ();
+
+ public void finalize ()
+ {
+ dispose();
+ }
+
+ public Graphics create ()
+ {
+ return new GdkGraphics2D (this);
+ }
+
+ public Graphics create (int x, int y, int width, int height)
+ {
+ return new GdkGraphics2D (width, height);
+ }
+
+ GdkGraphics2D (GdkGraphics2D g)
+ {
+ paint = g.paint;
+ stroke = g.stroke;
+
+ if (g.fg.getAlpha() != -1)
+ fg = new Color (g.fg.getRed (), g.fg.getGreen (),
+ g.fg.getBlue (), g.fg.getAlpha ());
+ else
+ fg = new Color (g.fg.getRGB ());
+
+ if (g.bg.getAlpha() != -1)
+ bg = new Color(g.bg.getRed (), g.bg.getGreen (),
+ g.bg.getBlue (), g.bg.getAlpha ());
+ else
+ bg = new Color (g.bg.getRGB ());
+
+ if (g.clip == null)
+ clip = null;
+ else
+ clip = new Rectangle (g.getClipBounds ());
+
+ if (g.transform == null)
+ transform = null;
+ else
+ transform = new AffineTransform (g.transform);
+
+ component = g.component;
+ copyState (g);
+
+ setColor (fg);
+ setClip (clip);
+ setTransform (transform);
+ }
+
+ GdkGraphics2D (int width, int height)
+ {
+ initState (width, height);
+ bg = Color.black;
+ fg = Color.black;
+ transform = new AffineTransform ();
+ }
+
+ 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 ();
+ }
+
+
+ ////////////////////////////////////
+ ////// Native Drawing Methods //////
+ ////////////////////////////////////
+
+ // GDK drawing methods
+ 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 setTexturePixels (int pixels[], int w, int h, int stride);
+ private native void setGradient (double x1, double y1,
+ double x2, double y2,
+ int r1, int g1, int b1, int a1,
+ int r2, int g2, int b2, int a2,
+ boolean cyclic);
+
+ // 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 cairoSetOperator (int cairoOperator);
+ private native void cairoSetRGBColor (double red, double green, double blue);
+ private native void cairoSetAlpha (double alpha);
+ private native void cairoSetFillRule (int cairoFillRule);
+ private native void cairoSetLineWidth (double width);
+ private native void cairoSetLineCap (int cairoLineCap);
+ 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);
+ 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);
+ private native void cairoRectangle (double x, double y,
+ double width, double height);
+ private native void cairoClosePath ();
+ private native void cairoStroke ();
+ private native void cairoFill ();
+ private native void cairoClip ();
+
+
+ /////////////////////////////////////////////
+ ////// General Drawing Support Methods //////
+ /////////////////////////////////////////////
+
+ double x;
+ double y;
+ private void setPos (double nx, double ny)
+ {
+ x = nx;
+ y = ny;
+ }
+
+ private void walkPath(PathIterator p)
+ {
+ double coords[] = new double[6];
+
+ cairoSetFillRule (p.getWindingRule ());
+ for ( ; ! p.isDone (); p.next())
+ {
+ int seg = p.currentSegment (coords);
+ switch(seg)
+ {
+
+ case PathIterator.SEG_MOVETO:
+ setPos(coords[0], coords[1]);
+ cairoMoveTo (coords[0], coords[1]);
+ break;
+
+ case PathIterator.SEG_LINETO:
+ setPos(coords[0], coords[1]);
+ cairoLineTo (coords[0], coords[1]);
+ break;
+
+ case PathIterator.SEG_QUADTO:
+
+ // splitting a quadratic bezier into a cubic:
+ // see: http://pfaedit.sourceforge.net/bezier.html
+
+ double x1 = x + (2.0/3.0) * (coords[0] - x);
+ double y1 = y + (2.0/3.0) * (coords[1] - y);
+
+ double x2 = x1 + (1.0/3.0) * (coords[2] - x);
+ double y2 = y1 + (1.0/3.0) * (coords[3] - y);
+
+ setPos(coords[2], coords[3]);
+ cairoCurveTo (x1, y1,
+ x2, y2,
+ coords[2], coords[3]);
+ break;
+
+ case PathIterator.SEG_CUBICTO:
+ setPos(coords[4], coords[5]);
+ cairoCurveTo (coords[0], coords[1],
+ coords[2], coords[3],
+ coords[4], coords[5]);
+ break;
+
+ case PathIterator.SEG_CLOSE:
+ cairoClosePath ();
+ break;
+ }
+ }
+ }
+
+
+ //////////////////////////////////////////////////
+ ////// Implementation of Graphics2D Methods //////
+ //////////////////////////////////////////////////
+
+ public void draw (Shape s)
+ {
+
+ if (stroke != null &&
+ !(stroke instanceof BasicStroke))
+ {
+ fill (stroke.createStrokedShape (s));
+ return;
+ }
+
+ cairoSave ();
+ cairoNewPath ();
+ if (s instanceof Rectangle2D)
+ {
+ Rectangle2D r = (Rectangle2D)s;
+ cairoRectangle (r.getX (), r.getY (), r.getWidth (), r.getHeight ());
+ }
+ else
+ walkPath (s.getPathIterator (null));
+ cairoStroke ();
+ cairoRestore ();
+ }
+
+ public void fill(Shape s)
+ {
+ cairoSave();
+ cairoNewPath ();
+ if (s instanceof Rectangle2D)
+ {
+ Rectangle2D r = (Rectangle2D)s;
+ cairoRectangle (r.getX (), r.getY (), r.getWidth (), r.getHeight ());
+ }
+ else
+ walkPath (s.getPathIterator (null));
+ cairoFill ();
+ cairoRestore ();
+ }
+
+ 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 ();
+ }
+
+ public Paint getPaint ()
+ {
+ return paint;
+ }
+
+ public AffineTransform getTransform ()
+ {
+ return transform;
+ }
+
+ public void setPaint (Paint p)
+ {
+ paint = p;
+ if (paint instanceof Color)
+ {
+ setColor ((Color) paint);
+ }
+ else if (paint instanceof TexturePaint)
+ {
+ TexturePaint tp = (TexturePaint) paint;
+ BufferedImage img = tp.getImage ();
+ int pixels[] = img.getRGB(0, 0, img.getWidth (),
+ img.getHeight (), null,
+ 0, img.getWidth ());
+ setTexturePixels (pixels, img.getWidth (),
+ img.getHeight (), img.getWidth ());
+ }
+ else if (paint instanceof GradientPaint)
+ {
+ GradientPaint gp = (GradientPaint) paint;
+ Point2D p1 = gp.getPoint1 ();
+ Point2D p2 = gp.getPoint2 ();
+ Color c1 = gp.getColor1 ();
+ Color c2 = gp.getColor2 ();
+ setGradient (p1.getX (), p1.getY (),
+ p2.getX (), p2.getY (),
+ c1.getRed (), c1.getGreen (),
+ c1.getBlue (), c1.getAlpha (),
+ c2.getRed (), c2.getGreen (),
+ c2.getBlue (), c2.getAlpha (),
+ gp.isCyclic ());
+ }
+ else
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void setTransform (AffineTransform tx)
+ {
+ transform = tx;
+ if (transform != null)
+ {
+ double m[] = new double[6];
+ transform.getMatrix (m);
+ cairoSetMatrix (m[0], m[1], m[2], m[3], m[4], m[5]);
+ }
+ }
+
+ public void transform (AffineTransform tx)
+ {
+ if (transform == null)
+ transform = new AffineTransform (tx);
+ else
+ transform.concatenate (tx);
+ setTransform (transform);
+ }
+
+ public void rotate(double theta)
+ {
+ if (transform != null)
+ transform.rotate (theta);
+ cairoRotate (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);
+ }
+
+ public void scale(double sx, double sy)
+ {
+ if (transform != null)
+ transform.scale (sx, sy);
+ cairoScale (sx, sy);
+ }
+
+ public void translate (double tx, double ty)
+ {
+ if (transform != null)
+ transform.translate (tx, ty);
+ cairoTranslate (tx, ty);
+ }
+
+ public void translate (int x, int y)
+ {
+ translate ((double) x, (double) y);
+ }
+
+ public Stroke getStroke()
+ {
+ return stroke;
+ }
+
+ public void setStroke (Stroke st)
+ {
+ stroke = st;
+ if (stroke instanceof BasicStroke)
+ {
+ BasicStroke bs = (BasicStroke) stroke;
+ cairoSetLineCap (bs.getEndCap());
+ cairoSetLineWidth (bs.getLineWidth());
+ cairoSetLineJoin (bs.getLineJoin());
+ cairoSetMiterLimit (bs.getMiterLimit());
+ float dashes[] = bs.getDashArray();
+ if (dashes != null)
+ {
+ double double_dashes[] = new double[dashes.length];
+ for (int i = 0; i < dashes.length; i++)
+ double_dashes[i] = dashes[i];
+ cairoSetDash (double_dashes, double_dashes.length,
+ (double) bs.getDashPhase ());
+ }
+ }
+ }
+
+
+ ////////////////////////////////////////////////
+ ////// Implementation of Graphics Methods //////
+ ////////////////////////////////////////////////
+
+ public void setPaintMode ()
+ {
+ setComposite (java.awt.AlphaComposite.Xor);
+ }
+
+ public void setXORMode (Color c)
+ {
+ setComposite (new BitwiseXorComposite (c));
+ }
+
+ public void setColor (Color c)
+ {
+ fg = c;
+ cairoSetRGBColor (fg.getRed() / 255.0,
+ fg.getGreen() / 255.0,
+ fg.getBlue() / 255.0);
+ cairoSetAlpha ((fg.getAlpha() & 255) / 255.0);
+ }
+
+ public Color getColor ()
+ {
+ return fg;
+ }
+
+ 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)));
+ }
+ }
+
+ public Shape getClip ()
+ {
+ return clip;
+ }
+
+ public Rectangle getClipBounds ()
+ {
+ if (clip == null)
+ return null;
+ else
+ return clip.getBounds ();
+ }
+
+ 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);
+ }
+
+ public void setClip (Shape s)
+ {
+ clip (s);
+ }
+
+ public void draw3DRect(int x, int y, int width,
+ int height, boolean raised)
+ {
+ Color std = fg;
+ Color light = std.brighter();
+ Color dark = std.darker();
+
+ if (!raised)
+ {
+ Color t = light;
+ light = dark;
+ dark = t;
+ }
+
+ double x1 = (double) x;
+ double x2 = (double) x + width;
+
+ double y1 = (double) y;
+ double y2 = (double) y + height;
+
+ cairoSave ();
+
+ cairoNewPath ();
+ setColor (light);
+ cairoMoveTo (x1, y1);
+ cairoLineTo (x2, y1);
+ cairoLineTo (x2, y2);
+ cairoStroke ();
+
+ cairoNewPath ();
+ setColor (dark);
+ cairoMoveTo (x1, y1);
+ cairoLineTo (x1, y2);
+ cairoLineTo (x2, y2);
+ cairoStroke ();
+
+ cairoRestore ();
+ setColor (std);
+
+ }
+
+ public void fill3DRect(int x, int y, int width,
+ int height, boolean raised)
+ {
+ double step = 1.0;
+ if (stroke != null && stroke instanceof BasicStroke)
+ {
+ BasicStroke bs = (BasicStroke) stroke;
+ step = bs.getLineWidth();
+ }
+
+ Color bright = fg.brighter ();
+ Color dark = fg.darker ();
+
+ draw3DRect (x, y, width, height, raised);
+
+ cairoSave ();
+ cairoTranslate (step/2.0, step/2.0);
+ cairoNewPath ();
+ cairoRectangle ((double) x, (double) y,
+ ((double) width) - step,
+ ((double) height) - step );
+ cairoClosePath ();
+ cairoFill ();
+ cairoRestore ();
+ }
+
+
+ public void drawRect (int x, int y, int width, int height)
+ {
+ draw(new Rectangle (x, y, width, height));
+ }
+
+ public void fillRect (int x, int y, int width, int height)
+ {
+ fill(new Rectangle (x, y, width, height));
+ }
+
+ public void clearRect (int x, int y, int width, int height)
+ {
+ cairoSave ();
+ cairoSetRGBColor (bg.getRed() / 255.0,
+ bg.getGreen() / 255.0,
+ bg.getBlue() / 255.0);
+ cairoSetAlpha (1.0);
+ cairoNewPath ();
+ cairoRectangle (x, y, width, height);
+ cairoClosePath ();
+ cairoFill ();
+ cairoRestore ();
+ }
+
+ public void setBackground(Color c)
+ {
+ bg = c;
+ }
+
+
+ public Color getBackground()
+ {
+ return bg;
+ }
+
+
+ private void doPolygon(int[] xPoints, int[] yPoints, int nPoints,
+ boolean close, boolean fill)
+ {
+ if (nPoints < 1)
+ return;
+ GeneralPath gp = new GeneralPath ();
+ gp.moveTo ((float)xPoints[0], (float)yPoints[0]);
+ for (int i = 1; i < nPoints; i++)
+ gp.lineTo ((float)xPoints[i], (float)yPoints[i]);
+
+ if (close)
+ gp.closePath ();
+
+ Shape sh = gp;
+ if (fill == false &&
+ stroke != null &&
+ !(stroke instanceof BasicStroke))
+ {
+ sh = stroke.createStrokedShape (gp);
+ fill = true;
+ }
+
+ if (fill)
+ fill (sh);
+ else
+ draw (sh);
+ }
+
+ public void drawLine (int x1, int y1, int x2, int y2)
+ {
+ int xp[] = new int[2];
+ int yp[] = new int[2];
+
+ xp[0] = x1;
+ xp[1] = x2;
+ yp[0] = y1;
+ yp[1] = y2;
+
+ doPolygon (xp, yp, 2, false, false);
+ }
+
+ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
+ {
+ doPolygon (xPoints, yPoints, nPoints, true, true);
+ }
+
+ public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
+ {
+ doPolygon (xPoints, yPoints, nPoints, true, false);
+ }
+
+ public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
+ {
+ doPolygon (xPoints, yPoints, nPoints, false, false);
+ }
+
+ private boolean drawRaster (ColorModel cm, Raster r)
+ {
+ if (r == null)
+ return false;
+
+ SampleModel sm = r.getSampleModel ();
+ DataBuffer db = r.getDataBuffer ();
+
+ if (db == null || sm == null)
+ return false;
+
+ if (cm == null)
+ cm = ColorModel.getRGBdefault ();
+
+ int pixels[] = null;
+
+ if (sm.getDataType () == DataBuffer.TYPE_INT &&
+ db instanceof DataBufferInt &&
+ db.getNumBanks () == 1)
+ {
+ // single bank, ARGB-ints buffer in sRGB space
+ DataBufferInt dbi = (DataBufferInt)db;
+ pixels = dbi.getData ();
+ }
+ else
+ pixels = r.getPixels (0, 0, r.getWidth (), r.getHeight (), pixels);
+
+ ColorSpace cs = cm.getColorSpace ();
+ if (cs != null &&
+ cs.getType () != ColorSpace.CS_sRGB)
+ {
+ int pixels2[] = new int[pixels.length];
+ for (int i = 0; i < pixels2.length; i++)
+ pixels2[i] = cm.getRGB (pixels[i]);
+ pixels = pixels2;
+ }
+
+ cairoSave ();
+ cairoTranslate (x, y);
+ drawPixels (pixels, r.getWidth (), r.getHeight (), r.getWidth ());
+ cairoRestore ();
+ return true;
+ }
+
+ public boolean drawImage (Image img, int x, int y,
+ ImageObserver observer)
+ {
+ if (img instanceof GtkOffScreenImage &&
+ img.getGraphics () instanceof GdkGraphics2D &&
+ (transform == null || transform.isIdentity ()))
+ {
+ // we are being asked to flush a double buffer from Gdk
+ GdkGraphics2D g2 = (GdkGraphics2D) img.getGraphics ();
+ gdkDrawDrawable (g2, x, y);
+ return true;
+ }
+ else
+ {
+ if (img instanceof BufferedImage)
+ {
+ // draw an image which has actually been loaded into memory fully
+ BufferedImage b = (BufferedImage) img;
+ return drawRaster (b.getColorModel (), b.getData ());
+ }
+ else
+ {
+ // begin progressive loading in a separate thread
+ new PainterThread (this, img);
+ return false;
+ }
+ }
+ }
+
+
+ ////////////////////////////////////////
+ ////// Supporting Private Classes //////
+ ////////////////////////////////////////
+
+ private class PainterThread implements Runnable, ImageConsumer
+ {
+
+ // this is a helper which is spun off when someone tries to do
+ // Graphics2D.drawImage on an image we cannot determine to be either
+ // one of our own offscreen images or a BufferedImage; that is, when
+ // someone wants to draw an image which is possibly still loading over
+ // a network or something. you run it in a separate thread and it
+ // writes through to the underlying Graphics2D as pixels becomg
+ // available.
+
+ GdkGraphics2D gr;
+ Image image;
+ ColorModel defaultModel;
+
+ public PainterThread (GdkGraphics2D g, Image im)
+ {
+ image = im;
+ this.gr = (GdkGraphics2D) g.create ();
+ new Thread (this).start ();
+ }
+
+ public void imageComplete (int status)
+ {
+ }
+
+ public void setColorModel (ColorModel model)
+ {
+ defaultModel = model;
+ }
+
+ public void setDimensions (int width, int height)
+ {
+ }
+
+ public void setHints (int hintflags)
+ {
+ }
+
+ public void setPixels (int x, int y, int w, int h, ColorModel model,
+ byte[] pixels, int off, int scansize)
+ {
+ }
+
+ 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);
+
+ if (model == null)
+ model = defaultModel;
+
+ int pixels2[];
+ if (model != null)
+ {
+ pixels2 = new int[pixels.length];
+ for (int yy = 0; yy < h; yy++)
+ for (int xx = 0; xx < w; xx++)
+ {
+ int i = yy * scansize + xx;
+ pixels2[i] = model.getRGB (pixels[i]);
+ }
+ }
+ else
+ pixels2 = pixels;
+
+ gr.drawPixels (pixels2, w, h, scansize);
+ gr.cairoRestore ();
+ }
+
+ public void setProperties (java.util.Hashtable props)
+ {
+ }
+
+ public void run ()
+ {
+ image.getSource ().startProduction (this);
+ gr.dispose ();
+ }
+ }
+
+
+ private class BitwiseXorComposite implements Composite
+ {
+ // this is a special class which does a bitwise XOR composite, for
+ // backwards compatibility sake. it does *not* implement the
+ // porter-duff XOR operator. the porter-duff XOR is unrelated to
+ // bitwise XOR; it just happens to have a similar name but it
+ // represents a desire to composite the exclusive or of overlapping
+ // subpixel regions. bitwise XOR is for drawing "highlights" such as
+ // cursors (in a cheap oldskool bitblit fashion) by inverting colors
+ // temporarily and then inverting them back.
+
+ Color xorColor;
+
+ class BitwiseXorCompositeContext implements CompositeContext
+ {
+ ColorModel srcColorModel;
+ ColorModel dstColorModel;
+
+ public BitwiseXorCompositeContext (ColorModel s,
+ ColorModel d)
+ {
+ srcColorModel = s;
+ dstColorModel = d;
+ }
+
+ public void dispose ()
+ {
+ }
+
+ public void compose (Raster src,
+ Raster dstIn,
+ WritableRaster dstOut)
+ {
+ Rectangle srcRect = src.getBounds ();
+ Rectangle dstInRect = dstIn.getBounds ();
+ Rectangle dstOutRect = dstOut.getBounds ();
+
+ int xp = xorColor.getRGB ();
+ int x = 0, y = 0;
+ int w = Math.min (Math.min (srcRect.width, dstOutRect.width), dstInRect.width);
+ int h = Math.min (Math.min (srcRect.height, dstOutRect.height), dstInRect.height);
+ Object srcPix = null, dstPix = null;
+
+ for (y = 0; y < h; y++)
+ for (x = 0; x < w; x++)
+ {
+ srcPix = src.getDataElements (x + srcRect.x, y + srcRect.y, srcPix);
+ dstPix = dstIn.getDataElements (x + dstInRect.x, y + dstInRect.y, dstPix);
+ int sp = srcColorModel.getRGB (srcPix);
+ int dp = dstColorModel.getRGB (dstPix);
+ int rp = sp ^ xp ^ dp;
+ dstOut.setDataElements (x + dstOutRect.x, y + dstOutRect.y,
+ dstColorModel.getDataElements (rp, null));
+ }
+ }
+ }
+
+ public BitwiseXorComposite (Color c)
+ {
+ xorColor = c;
+ }
+
+ public CompositeContext createContext (ColorModel srcColorModel,
+ ColorModel dstColorModel,
+ RenderingHints hints)
+ {
+ return new BitwiseXorCompositeContext (srcColorModel, dstColorModel);
+ }
+ }
+
+
+ ///////////////////////////////////////////////
+ ////// 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)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public GraphicsConfiguration getDeviceConfiguration()
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void setComposite(Composite comp)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void setRenderingHint(RenderingHints.Key hintKey,
+ Object hintValue)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public Object getRenderingHint(RenderingHints.Key hintKey)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void setRenderingHints(Map hints)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void addRenderingHints(Map hints)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public RenderingHints getRenderingHints()
+ {
+ 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 ();
+ }
+
+ public FontRenderContext getFontRenderContext ()
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void drawGlyphVector (GlyphVector g, float x, float y)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void copyArea (int x, int y, int width, int height, int dx, int dy)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void drawArc (int x, int y, int width, int height,
+ int startAngle, int arcAngle)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public boolean drawImage (Image img, int x, int y, Color bgcolor,
+ ImageObserver observer)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public boolean drawImage (Image img, int x, int y, int width, int height,
+ Color bgcolor, ImageObserver observer)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public boolean drawImage (Image img, int x, int y, int width, int height,
+ ImageObserver observer)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
+ int sx1, int sy1, int sx2, int sy2,
+ Color bgcolor, ImageObserver observer)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
+ int sx1, int sy1, int sx2, int sy2,
+ ImageObserver observer)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void drawOval(int x, int y, int width, int height)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void drawRoundRect(int x, int y, int width, int height,
+ int arcWidth, int arcHeight)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void drawString (String str, int x, int y)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void drawString (AttributedCharacterIterator ci, int x, int y)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ 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 ();
+ }
+
+ public void fillOval(int x, int y, int width, int height)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void fillRoundRect (int x, int y, int width, int height,
+ int arcWidth, int arcHeight)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public Font getFont ()
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public FontMetrics getFontMetrics ()
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public FontMetrics getFontMetrics (Font f)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public void setFont (Font f)
+ {
+ if (f instanceof GdkFont)
+ font = (GdkFont) f;
+ else
+ font = new GdkFont (f.getAttributes ());
+ }
+
+ public String toString()
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java b/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
new file mode 100644
index 00000000000..55f3338006e
--- /dev/null
+++ b/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
@@ -0,0 +1,217 @@
+/* GdkPixbufDecoder.java -- Image data decoding object
+ 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.awt.peer.gtk;
+
+import java.awt.image.*;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Vector;
+import java.util.Hashtable;
+import gnu.classpath.Configuration;
+
+public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
+{
+ static
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("gtkpeer");
+ }
+ initStaticState ();
+ }
+ native static void initStaticState ();
+ private final int native_state = GtkGenericPeer.getUniqueInteger ();
+
+ // the current set of ImageConsumers for this decoder
+ Vector curr;
+
+ // interface to GdkPixbuf
+ native void initState ();
+ native void pumpBytes (byte bytes[], int len);
+ native void finish ();
+
+ // gdk-pixbuf provids data in RGBA format
+ static final ColorModel cm = new DirectColorModel (32, 0xff000000,
+ 0x00ff0000,
+ 0x0000ff00,
+ 0x000000ff);
+ public GdkPixbufDecoder (String filename)
+ {
+ super (filename);
+ initState ();
+ }
+
+ public GdkPixbufDecoder (URL url)
+ {
+ super (url);
+ initState ();
+ }
+
+ // called back by native side
+ void areaPrepared (int width, int height)
+ {
+
+ if (curr == null)
+ return;
+
+ for (int i = 0; i < curr.size (); i++)
+ {
+ ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
+ ic.setDimensions (width, height);
+ ic.setColorModel (cm);
+ ic.setHints (ImageConsumer.RANDOMPIXELORDER);
+ }
+ }
+
+ // called back by native side
+ void areaUpdated (int x, int y, int width, int height,
+ int pixels[], int scansize)
+ {
+ if (curr == null)
+ return;
+
+ for (int i = 0; i < curr.size (); i++)
+ {
+ ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
+ ic.setPixels (x, y, width, height, cm, pixels, 0, scansize);
+ }
+ }
+
+ // called from an async image loader of one sort or another, this method
+ // repeatedly reads bytes from the input stream and passes them through a
+ // GdkPixbufLoader using the native method pumpBytes. pumpBytes in turn
+ // decodes the image data and calls back areaPrepared and areaUpdated on
+ // 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
+ {
+ curr = v;
+
+ byte bytes[] = new byte[4096];
+ int len = 0;
+ while ((len = is.read (bytes)) != -1)
+ pumpBytes (bytes, len);
+
+ for (int i = 0; i < curr.size (); i++)
+ {
+ ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
+ ic.imageComplete (ImageConsumer.STATICIMAGEDONE);
+ }
+
+ curr = null;
+ }
+
+ // remaining helper class and static method is a convenience for the Gtk
+ // peers, for loading a BufferedImage in off a disk file. one would think
+ // this ought to be fairly straightforward, but it does not appear
+ // anywhere else I can find.
+
+ private class BufferedImageBuilder implements ImageConsumer
+ {
+ BufferedImage bufferedImage;
+ ColorModel defaultModel;
+
+ public BufferedImage getBufferedImage()
+ {
+ return bufferedImage;
+ }
+
+ public void setDimensions(int width, int height)
+ {
+ bufferedImage = new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB);
+ }
+
+ public void setProperties(Hashtable props) {}
+
+ public void setColorModel(ColorModel model)
+ {
+ defaultModel = model;
+ }
+
+ public void setHints(int flags) {}
+
+ public void setPixels(int x, int y, int w, int h,
+ ColorModel model, byte[] pixels,
+ int offset, int scansize)
+ {
+ }
+
+ public void setPixels(int x, int y, int w, int h,
+ ColorModel model, int[] pixels,
+ int offset, int scansize)
+ {
+ if (bufferedImage != null)
+ {
+
+ if (model == null)
+ model = defaultModel;
+
+ int pixels2[];
+ if (model != null)
+ {
+ pixels2 = new int[pixels.length];
+ for (int yy = 0; yy < h; yy++)
+ for (int xx = 0; xx < w; xx++)
+ {
+ int i = yy * scansize + xx;
+ pixels2[i] = model.getRGB (pixels[i]);
+ }
+ }
+ else
+ pixels2 = pixels;
+
+ bufferedImage.setRGB (x, y, w, h, pixels2, offset, scansize);
+ }
+ }
+
+ public void imageComplete(int status) {}
+ }
+
+ public static BufferedImage createBufferedImage (String filename)
+ {
+ BufferedImageBuilder bb = new BufferedImageBuilder ();
+ GdkPixbufDecoder dec = new GdkPixbufDecoder (filename);
+ 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 a609f7ad818..830b9f08f8b 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
@@ -37,10 +37,14 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.AWTEvent;
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.Font;
import java.awt.event.MouseEvent;
import java.awt.event.KeyEvent;
-import java.awt.peer.*;
+import java.awt.peer.ButtonPeer;
public class GtkButtonPeer extends GtkComponentPeer
implements ButtonPeer
@@ -91,6 +95,6 @@ public class GtkButtonPeer extends GtkComponentPeer
public void setFont (Font f)
{
- gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ gtkSetFont(f.getName(), f.getSize());
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
index 59c28f9fd5f..d5378dc77de 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java
@@ -35,10 +35,15 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.AWTEvent;
+import java.awt.Canvas;
+import java.awt.Dimension;
+import java.awt.Graphics;
import java.awt.event.PaintEvent;
-import java.awt.peer.*;
+import java.awt.peer.CanvasPeer;
public class GtkCanvasPeer extends GtkComponentPeer implements CanvasPeer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
index 9903c310425..e387f1287d3 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java
@@ -37,9 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
+
+import java.awt.CheckboxGroup;
+import java.util.WeakHashMap;
// Note that there is no peer interface for a CheckboxGroup. We
// introduce our own in order to make it easier to keep a piece of
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
index 1bff7069602..adb7008ca3f 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
@@ -37,7 +37,8 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.CheckboxMenuItem;
import java.awt.peer.CheckboxMenuItemPeer;
import java.awt.peer.MenuItemPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
index 48f8804007d..67469c93176 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Checkbox;
+import java.awt.CheckboxGroup;
+import java.awt.Component;
+import java.awt.peer.CheckboxPeer;
public class GtkCheckboxPeer extends GtkComponentPeer
implements CheckboxPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
index afa90a56c3f..c4398e5041c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
@@ -37,9 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
-import java.awt.event.*;
+
+import java.awt.Choice;
+import java.awt.event.ItemEvent;
+import java.awt.peer.ChoicePeer;
public class GtkChoicePeer extends GtkComponentPeer
implements ChoicePeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
index d2587d970a1..86678f8ab1c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
@@ -35,15 +35,17 @@ 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.io.*;
-import java.net.*;
-import java.util.*;
-import java.awt.datatransfer.*;
-import java.awt.image.*;
-import java.awt.peer.*;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.ClipboardOwner;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
public class GtkClipboard extends Clipboard
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index 43ada95cf00..ac092c8f4d1 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -350,13 +350,13 @@ public class GtkComponentPeer extends GtkGenericPeer
new Rectangle (x, y, width, height)));
}
- protected void postKeyEvent (int id, long when, int mods,
- int keyCode, char keyChar)
+ protected void postKeyEvent (int id, long when, int mods,
+ int keyCode, char keyChar, int keyLocation)
{
- q.postEvent (new KeyEvent (awtComponent, id, when, mods,
- keyCode, keyChar));
+ q.postEvent (new KeyEvent (awtComponent, id, when, mods,
+ keyCode, keyChar, keyLocation));
}
-
+
protected void postFocusEvent (int id, boolean temporary)
{
q.postEvent (new FocusEvent (awtComponent, id, temporary));
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
index ba5d870f90b..8c0f5ee510f 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
@@ -53,7 +53,9 @@ public class GtkDialogPeer extends GtkWindowPeer
void create ()
{
- create (GTK_WINDOW_DIALOG);
+ create (GTK_WINDOW_TOPLEVEL,
+ awtComponent.getWidth(),
+ awtComponent.getHeight());
}
public void getArgs (Component component, GtkArgList args)
@@ -62,6 +64,7 @@ public class GtkDialogPeer extends GtkWindowPeer
Dialog dialog = (Dialog) component;
+ args.add ("title", dialog.getTitle ());
args.add ("modal", dialog.isModal ());
args.add ("allow_shrink", dialog.isResizable ());
args.add ("allow_grow", dialog.isResizable ());
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
new file mode 100644
index 00000000000..b9cdb66f9f2
--- /dev/null
+++ b/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
@@ -0,0 +1,59 @@
+/* GtkEmbeddedWindowPeer.java -- Implements EmbeddedWindowPeer using a
+ GtkPlug
+ 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.awt.peer.gtk;
+
+import gnu.java.awt.EmbeddedWindow;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
+
+public class GtkEmbeddedWindowPeer extends GtkFramePeer
+ implements EmbeddedWindowPeer
+{
+ native void create(int window_id);
+
+ void create ()
+ {
+ create (((EmbeddedWindow) awtComponent).getHandle());
+ }
+
+ public GtkEmbeddedWindowPeer (EmbeddedWindow w)
+ {
+ super (w);
+ }
+}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
index 3376787d2e5..64e73c68a86 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
@@ -37,9 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+
+import java.awt.FileDialog;
+import java.awt.Graphics;
+import java.awt.peer.FileDialogPeer;
import java.io.FilenameFilter;
-import java.awt.peer.*;
-import java.awt.*;
public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
index 6c6802d20ee..043c08276db 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
@@ -37,9 +37,16 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
-import java.awt.event.*;
+
+import java.awt.Component;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.MenuBar;
+import java.awt.Rectangle;
+import java.awt.event.PaintEvent;
+import java.awt.peer.FramePeer;
+import java.awt.peer.MenuBarPeer;
public class GtkFramePeer extends GtkWindowPeer
implements FramePeer
@@ -77,6 +84,7 @@ public class GtkFramePeer extends GtkWindowPeer
args.add ("allow_shrink", frame.isResizable ());
args.add ("allow_grow", frame.isResizable ());
}
+
public void setIconImage (Image image)
{
/* TODO: Waiting on Toolkit Image routines */
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
index 914b7a6cdeb..f7a7b2270ac 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.event.*;
+
+import java.awt.EventQueue;
+import java.awt.event.ActionEvent;
public class GtkGenericPeer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImage.java b/libjava/gnu/java/awt/peer/gtk/GtkImage.java
index f0c8bf410ef..6252a506f0d 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkImage.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkImage.java
@@ -38,9 +38,14 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.util.*;
-import java.awt.image.*;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageConsumer;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.util.Hashtable;
+import java.util.Vector;
public class GtkImage extends Image implements ImageConsumer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java b/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
index 3ea22cd25af..a5a8d095985 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java
@@ -35,11 +35,14 @@ 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.image.*;
-import java.util.*;
+import java.awt.Color;
+import java.awt.Rectangle;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageConsumer;
+import java.util.Hashtable;
public class GtkImagePainter implements Runnable, ImageConsumer
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
index 5cd3fb7b327..e70be2b4ef4 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
@@ -37,8 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
+
+import java.awt.Component;
+import java.awt.Label;
+import java.awt.peer.LabelPeer;
public class GtkLabelPeer extends GtkComponentPeer
implements LabelPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
index 6686457ba42..2ba183b09ea 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
@@ -37,8 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
+
+import java.awt.Dimension;
+import java.awt.List;
+import java.awt.peer.ListPeer;
public class GtkListPeer extends GtkComponentPeer
implements ListPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
index 6ceb8641481..40462818081 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
@@ -37,7 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.Menu;
+import java.awt.MenuBar;
import java.awt.peer.MenuBarPeer;
import java.awt.peer.MenuPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
index e04ce999324..eeef383ebd3 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
@@ -37,7 +37,7 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
import java.awt.peer.MenuComponentPeer;
public class GtkMenuComponentPeer extends GtkGenericPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
index 1428011133b..8a51d03d102 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
@@ -37,7 +37,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
import java.awt.peer.MenuItemPeer;
import java.awt.peer.MenuComponentPeer;
import java.awt.peer.MenuBarPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
index 51733a6f0b6..a5fcae720c3 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
@@ -37,7 +37,12 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
+
+import java.awt.Component;
+import java.awt.Menu;
+import java.awt.MenuContainer;
+import java.awt.MenuItem;
+import java.awt.MenuShortcut;
import java.awt.peer.MenuPeer;
import java.awt.peer.MenuItemPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java b/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
index 135fbf627c3..22086c5a08c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java
@@ -35,10 +35,13 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.image.*;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
public class GtkOffScreenImage extends Image
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
index 168e075b28b..cf7a9e1bade 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Panel;
+import java.awt.peer.PanelPeer;
public class GtkPanelPeer extends GtkContainerPeer
implements PanelPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
index e29d749c791..ed0b5219326 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
@@ -37,8 +37,12 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.ComponentPeer;
+
+import java.awt.Component;
+import java.awt.Event;
+import java.awt.MenuItem;
+import java.awt.Point;
+import java.awt.PopupMenu;
import java.awt.peer.PopupMenuPeer;
public class GtkPopupMenuPeer extends GtkMenuPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
index 9abde2ae44b..cd2c112c283 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Adjustable;
+import java.awt.ScrollPane;
+import java.awt.peer.ComponentPeer;
+import java.awt.peer.ScrollPanePeer;
public class GtkScrollPanePeer extends GtkContainerPeer
implements ScrollPanePeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
index 07aee679158..d13e34edfe8 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
@@ -37,9 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.*;
-import java.awt.peer.*;
+
+import java.awt.Adjustable;
+import java.awt.Scrollbar;
import java.awt.event.AdjustmentEvent;
+import java.awt.peer.ScrollbarPeer;
public class GtkScrollbarPeer extends GtkComponentPeer
implements ScrollbarPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
index ad83008cb8a..b8973fdca95 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
+
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.TextArea;
+import java.awt.peer.TextAreaPeer;
public class GtkTextAreaPeer extends GtkTextComponentPeer
implements TextAreaPeer
@@ -104,6 +107,6 @@ public class GtkTextAreaPeer extends GtkTextComponentPeer
public void setFont (Font f)
{
- gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ gtkSetFont(f.getName(), f.getSize());
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
index 102e43973a1..b3199d87c9a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
@@ -37,9 +37,14 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.*;
-import java.awt.*;
-import java.awt.event.*;
+
+import java.awt.AWTEvent;
+import java.awt.Component;
+import java.awt.Rectangle;
+import java.awt.TextComponent;
+import java.awt.event.KeyEvent;
+import java.awt.event.TextEvent;
+import java.awt.peer.TextComponentPeer;
public class GtkTextComponentPeer extends GtkComponentPeer
implements TextComponentPeer
@@ -50,7 +55,9 @@ public class GtkTextComponentPeer extends GtkComponentPeer
setText (tc.getText ());
}
-
+
+ public native void connectHooks ();
+
public native int getCaretPosition ();
public native void setCaretPosition (int pos);
public native int getSelectionStart ();
@@ -79,16 +86,4 @@ public class GtkTextComponentPeer extends GtkComponentPeer
{
q.postEvent (new TextEvent (awtComponent, TextEvent.TEXT_VALUE_CHANGED));
}
-
- public void handleEvent (AWTEvent e)
- {
- if (e.getID () == KeyEvent.KEY_TYPED
- && ((TextComponent)e.getSource()).isEditable())
- {
- KeyEvent ke = (KeyEvent)e;
-
- if (!ke.isConsumed())
- postTextEvent ();
- }
- }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
index 05112d16b8b..20f61aa81e0 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
@@ -37,9 +37,13 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+
+import java.awt.AWTEvent;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.TextField;
import java.awt.event.KeyEvent;
-import java.awt.peer.*;
-import java.awt.*;
+import java.awt.peer.TextFieldPeer;
public class GtkTextFieldPeer extends GtkTextComponentPeer
implements TextFieldPeer
@@ -48,7 +52,6 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
// native void create (ComponentPeer parent, String text);
native void create ();
- native void createHooks ();
native void gtkEntryGetSize (int cols, int dims[]);
@@ -101,7 +104,7 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
public void setFont (Font f)
{
- gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+ gtkSetFont(f.getName(), f.getSize());
}
public void handleEvent (AWTEvent e)
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
index ffdc910e8a2..9f669ac5281 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -39,18 +39,22 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
import java.awt.*;
-import java.awt.datatransfer.*;
+import java.awt.datatransfer.Clipboard;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.peer.DragSourceContextPeer;
import java.awt.im.InputMethodHighlight;
-import java.awt.image.*;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
import java.awt.peer.*;
-import java.net.*;
+import java.net.URL;
import java.util.Hashtable;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Properties;
-import gnu.java.awt.image.*;
+import gnu.java.awt.EmbeddedWindow;
+import gnu.java.awt.EmbeddedWindowSupport;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
import gnu.classpath.Configuration;
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer().
@@ -60,7 +64,8 @@ import gnu.classpath.Configuration;
this class. If getPeer() ever goes away, we can implement a hash table
that will keep up with every window's peer, but for now this is faster. */
-public class GtkToolkit extends java.awt.Toolkit
+public class GtkToolkit extends Toolkit
+ implements EmbeddedWindowSupport
{
GtkMainThread main;
Hashtable containers = new Hashtable();
@@ -298,6 +303,11 @@ public class GtkToolkit extends java.awt.Toolkit
return new GtkWindowPeer (w);
}
+ public EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w)
+ {
+ return new GtkEmbeddedWindowPeer (w);
+ }
+
protected FontPeer getFontPeer (String name, int style)
{
try {
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
index 21ec0201579..08b2bf67e90 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
@@ -47,14 +47,22 @@ public class GtkWindowPeer extends GtkContainerPeer
implements WindowPeer
{
static protected final int GTK_WINDOW_TOPLEVEL = 0;
- static protected final int GTK_WINDOW_DIALOG = 1;
- static protected final int GTK_WINDOW_POPUP = 2;
+ static protected final int GTK_WINDOW_POPUP = 1;
- native void create (int type);
+ native void create (int type, int width, int height);
+
+ void create (int type)
+ {
+ create (type,
+ awtComponent.getWidth(),
+ awtComponent.getHeight());
+ }
void create ()
{
- create (GTK_WINDOW_POPUP);
+ create (GTK_WINDOW_POPUP,
+ awtComponent.getWidth(),
+ awtComponent.getHeight());
}
native void connectHooks ();
@@ -62,9 +70,6 @@ public class GtkWindowPeer extends GtkContainerPeer
public GtkWindowPeer (Window window)
{
super (window);
-
- Dimension d = window.getSize ();
- setBounds (0, 0, d.width, d.height);
}
public void getArgs (Component component, GtkArgList args)
@@ -72,7 +77,7 @@ public class GtkWindowPeer extends GtkContainerPeer
args.add ("visible", component.isVisible ());
args.add ("sensitive", component.isEnabled ());
}
-
+
native public void toBack ();
native public void toFront ();
@@ -83,7 +88,11 @@ public class GtkWindowPeer extends GtkContainerPeer
set ("title", title);
}
- native public void setResizable (boolean r);
+ public void setResizable (boolean resizable)
+ {
+ set ("allow_shrink", resizable);
+ set ("allow_grow", resizable);
+ }
protected void postConfigureEvent (int x, int y, int width, int height,
int top, int left, int bottom, int right)
diff --git a/libjava/gnu/java/lang/ArrayHelper.java b/libjava/gnu/java/lang/ArrayHelper.java
index 0216caba167..aac7a545723 100644
--- a/libjava/gnu/java/lang/ArrayHelper.java
+++ b/libjava/gnu/java/lang/ArrayHelper.java
@@ -76,16 +76,22 @@ public class ArrayHelper
return -1;
}
- public static boolean equalsArray(Object[] a, Object[] b) {
- if(a.length == b.length) {
- for(int i=0;i<a.length;i++) {
- if(!a[i].equals(b[i])) {
- return false;
- }
- }
- return true;
- } else {
- return false;
- }
- }
+ /**
+ * Checks if two arrays are equal.
+ *
+ * @param array1 the first array
+ * @param array2 the second array
+ * @return true if both arrays are equal.
+ */
+ public static boolean equalsArray(Object[] array1, Object[] array2)
+ {
+ if (array1.length != array2.length)
+ return false;
+
+ for (int index = 0; index < array1.length; index++)
+ if (!array1 [index].equals (array2 [index]))
+ return false;
+
+ return true;
+ }
}
diff --git a/libjava/gnu/java/locale/LocaleInformation_de.java b/libjava/gnu/java/locale/LocaleInformation_de.java
index 09ba466d190..4254f7c3947 100644
--- a/libjava/gnu/java/locale/LocaleInformation_de.java
+++ b/libjava/gnu/java/locale/LocaleInformation_de.java
@@ -59,7 +59,7 @@ public class LocaleInformation_de extends ListResourceBundle
*/
private static final String collation_rules =
"<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" +
- "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y,z<Z" +
+ "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z" +
"&ae,\u00e4&Ae,\u00c4&oe,\u00f6&Oe,\u00d6&ue,\u00fc&Ue,\u00dc&ss,\u00df";
/**
diff --git a/libjava/gnu/java/locale/LocaleInformation_en.java b/libjava/gnu/java/locale/LocaleInformation_en.java
index ad327b0e54b..9fdf438d607 100644
--- a/libjava/gnu/java/locale/LocaleInformation_en.java
+++ b/libjava/gnu/java/locale/LocaleInformation_en.java
@@ -62,7 +62,7 @@ public class LocaleInformation_en extends ListResourceBundle
// and probably other things as well.
private static final String collation_rules =
"<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" +
- "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y,z<Z";
+ "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z";
/**
* This is the list of months, fully spelled out
diff --git a/libjava/gnu/java/locale/LocaleInformation_nl.java b/libjava/gnu/java/locale/LocaleInformation_nl.java
index e70f4ecd885..073f7c06364 100644
--- a/libjava/gnu/java/locale/LocaleInformation_nl.java
+++ b/libjava/gnu/java/locale/LocaleInformation_nl.java
@@ -62,7 +62,7 @@ public class LocaleInformation_nl extends ListResourceBundle
*/
private static final String collation_rules =
"<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" +
- "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y,z<Z";
+ "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z";
/**
* This is the list of months, fully spelled out
diff --git a/libjava/gnu/java/nio/NIODatagramSocket.java b/libjava/gnu/java/nio/NIODatagramSocket.java
new file mode 100644
index 00000000000..6c44c9dcb82
--- /dev/null
+++ b/libjava/gnu/java/nio/NIODatagramSocket.java
@@ -0,0 +1,71 @@
+/* NIODatagramSocket.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 gnu.java.net.PlainDatagramSocketImpl;
+import java.io.IOException;
+import java.net.DatagramSocket;
+import java.nio.channels.DatagramChannel;
+
+/**
+ * @author Michael Koch
+ */
+public final class NIODatagramSocket extends DatagramSocket
+{
+ private PlainDatagramSocketImpl impl;
+ private DatagramChannelImpl channel;
+
+ public NIODatagramSocket (PlainDatagramSocketImpl impl,
+ DatagramChannelImpl channel)
+ {
+ super (impl);
+ this.impl = impl;
+ this.channel = channel;
+ }
+
+ public final PlainDatagramSocketImpl getImpl()
+ {
+ return impl;
+ }
+
+ public final DatagramChannel getChannel()
+ {
+ return channel;
+ }
+}
diff --git a/libjava/gnu/java/nio/NIOSocket.java b/libjava/gnu/java/nio/NIOSocket.java
new file mode 100644
index 00000000000..bbdddccbdb0
--- /dev/null
+++ b/libjava/gnu/java/nio/NIOSocket.java
@@ -0,0 +1,76 @@
+/* NIOSocket.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 gnu.java.net.PlainSocketImpl;
+import java.io.IOException;
+import java.net.Socket;
+import java.nio.channels.SocketChannel;
+
+/**
+ * @author Michael Koch
+ */
+public final class NIOSocket extends Socket
+{
+ private PlainSocketImpl impl;
+ private SocketChannelImpl channel;
+
+ protected NIOSocket (PlainSocketImpl impl, SocketChannelImpl channel)
+ throws IOException
+ {
+ super (impl);
+ this.impl = impl;
+ this.channel = channel;
+ }
+
+ public final PlainSocketImpl getImpl()
+ {
+ return impl;
+ }
+
+ final void setChannel (SocketChannelImpl channel)
+ {
+ this.channel = channel;
+ }
+
+ public final SocketChannel getChannel()
+ {
+ return channel;
+ }
+}
diff --git a/libjava/gnu/java/rmi/rmic/Compile_gcj.java b/libjava/gnu/java/rmi/rmic/Compile_gcj.java
index 4a35b857cdd..ff7924e3d82 100644
--- a/libjava/gnu/java/rmi/rmic/Compile_gcj.java
+++ b/libjava/gnu/java/rmi/rmic/Compile_gcj.java
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2001 Free Software Foundation, Inc.
+ Copyright (c) 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,21 +40,16 @@ package gnu.java.rmi.rmic;
/** Subclass of Compiler that can be used to invoke gcj. */
public class Compile_gcj extends CompilerProcess
{
+ private static final String [] COMPILER_ARGS =
+ {
+ "gcj",
+ "-C"
+ };
+
public String[] computeArguments (String filename)
{
- int len = 3 + (dest == null ? 0 : 2);
- String[] result = new String[len];
- int i = 0;
-
- result[i++] = "gcj";
- result[i++] = "-C";
- if (dest != null)
- {
- result[i++] = "-d";
- result[i++] = dest;
- }
- result[i++] = filename;
-
- return result;
+ return computeTypicalArguments(COMPILER_ARGS,
+ getDestination(),
+ filename);
}
}
diff --git a/libjava/gnu/java/rmi/rmic/Compile_jikes.java b/libjava/gnu/java/rmi/rmic/Compile_jikes.java
new file mode 100644
index 00000000000..fd5534b2b01
--- /dev/null
+++ b/libjava/gnu/java/rmi/rmic/Compile_jikes.java
@@ -0,0 +1,56 @@
+/*
+ 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.rmic;
+
+/** Subclass of Compiler that can be used to invoke jikes. */
+public class Compile_jikes extends CompilerProcess
+{
+ /** Compiler arguments to invoke jikes */
+ private static final String [] COMPILER_ARGS =
+ {
+ "jikes"
+ };
+
+ /** Compute the command line for the process. */
+ public String[] computeArguments (String filename)
+ {
+ return computeTypicalArguments(COMPILER_ARGS,
+ getDestination(),
+ filename);
+ }
+}
diff --git a/libjava/gnu/java/rmi/rmic/Compile_kjc.java b/libjava/gnu/java/rmi/rmic/Compile_kjc.java
new file mode 100644
index 00000000000..cbb27bd7374
--- /dev/null
+++ b/libjava/gnu/java/rmi/rmic/Compile_kjc.java
@@ -0,0 +1,56 @@
+/*
+ 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.rmic;
+
+/** Subclass of Compiler that can be used to invoke kjc. */
+public class Compile_kjc extends CompilerProcess
+{
+ /** Compiler arguments to invoke kjc */
+ private static final String [] COMPILER_ARGS =
+ {
+ "kjc"
+ };
+
+ /** Compute the command line for the process. */
+ public String[] computeArguments (String filename)
+ {
+ return computeTypicalArguments(COMPILER_ARGS,
+ getDestination(),
+ filename);
+ }
+}
diff --git a/libjava/gnu/java/rmi/rmic/Compiler.java b/libjava/gnu/java/rmi/rmic/Compiler.java
index d8856d27b0c..9040c6d93c1 100644
--- a/libjava/gnu/java/rmi/rmic/Compiler.java
+++ b/libjava/gnu/java/rmi/rmic/Compiler.java
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2001 Free Software Foundation, Inc.
+ Copyright (c) 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,10 +37,12 @@ exception statement from your version. */
package gnu.java.rmi.rmic;
-/** A Compiler object can be used to compile a .java file into a
+/**
+ * A Compiler object can be used to compile a .java file into a
* .class file. This is an abstract class; the
* <code>getInstance()</code> method is used to obtain the actual
- * compiler object. */
+ * compiler object.
+ */
public abstract class Compiler
{
// Can't directly instantiate.
@@ -68,6 +70,12 @@ public abstract class Compiler
return null;
}
+ /** Get the directory where output files will be put. */
+ public String getDestination ()
+ {
+ return dest;
+ }
+
/** Set the directory where output files will be put. */
public void setDestination (String dest)
{
diff --git a/libjava/gnu/java/rmi/rmic/CompilerProcess.java b/libjava/gnu/java/rmi/rmic/CompilerProcess.java
index b3db08de43f..0de36b62b0e 100644
--- a/libjava/gnu/java/rmi/rmic/CompilerProcess.java
+++ b/libjava/gnu/java/rmi/rmic/CompilerProcess.java
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2001 Free Software Foundation, Inc.
+ Copyright (c) 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,19 +37,71 @@ exception statement from your version. */
package gnu.java.rmi.rmic;
-/** Subclass of Compiler that can be subclassed to invoke a process to
- * do its work. */
+import java.io.InputStream;
+
+/**
+ * Subclass of Compiler that can be subclassed to invoke a process to
+ * do its work.
+ */
public abstract class CompilerProcess extends Compiler
{
/** This is used to compute the command line for the process. */
public abstract String[] computeArguments (String filename);
+ /**
+ * This is used to compute the command line for the process.
+ * Most compilers typically arrange their arguments as in
+ * <compiler name and arguments> <optional destination> <filename>.
+ * This method builds an argument array out that. It should be used
+ * to define computeArguments for those compilers that follow the
+ * argument convention described above.
+ */
+ public static String[] computeTypicalArguments(String[] compilerArgs,
+ String destination, String filename)
+ {
+ /* length of compiler specific arguments */
+ final int len = compilerArgs.length;
+
+ /* length of returned array of arguments */
+ final int arglen = len + (destination == null ? 0 : 2) + 1;
+
+ /* Allocate String array for computed arguments. */
+ String [] args = new String[arglen];
+
+ /* Fill in compiler arguments. */
+ System.arraycopy(compilerArgs, 0, args, 0, len);
+
+ /* Fill in destination argument if necessary. */
+ if (destination != null)
+ {
+ args[len] = "-d";
+ args[len + 1] = destination;
+ }
+
+ /* Fill in filename */
+ args[arglen - 1] = filename;
+
+ return args;
+ }
+
public void compile (String name) throws Exception
{
String[] args = computeArguments (name);
Process p = Runtime.getRuntime ().exec (args);
- // FIXME: probably should collect compiler output here and then
- // put it into the exception message.
+
+ /* Print compiler output to System.out. */
+ InputStream procin = p.getInputStream();
+ for (int ch = procin.read(); ch != -1; ch = procin.read())
+ System.out.print((char) ch);
+
+ /* Collect compiler error output in a buffer.
+ * If compilation fails, it will be used for an error message.
+ */
+ StringBuffer stderr = new StringBuffer();
+ InputStream procerr = p.getErrorStream();
+ for (int ch = procerr.read(); ch != -1; ch = procerr.read())
+ stderr.append((char) ch);
+
int result;
while (true)
{
@@ -65,7 +117,8 @@ public abstract class CompilerProcess extends Compiler
if (result != 0)
{
// FIXME: wrong exception class.
- throw new Exception ("compiler exited with status: " + result);
+ throw new Exception ("compiler exited with status: " + result,
+ new RMICException(stderr.toString()));
}
}
}
diff --git a/libjava/gnu/java/rmi/rmic/RMIC.java b/libjava/gnu/java/rmi/rmic/RMIC.java
index ef4473247d6..82bb37ef07c 100644
--- a/libjava/gnu/java/rmi/rmic/RMIC.java
+++ b/libjava/gnu/java/rmi/rmic/RMIC.java
@@ -1,5 +1,5 @@
/*
- Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,10 +43,12 @@ import java.io.PrintWriter;
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.rmi.RemoteException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Arrays;
-import java.lang.Comparable;
+import java.util.Set;
+
import gnu.java.rmi.server.RMIHashes;
public class RMIC {
@@ -71,7 +73,9 @@ private String fullclassname;
private MethodRef[] remotemethods;
private String stubname;
private String skelname;
+private int errorCount = 0;
+private Class mRemoteInterface;
public RMIC(String[] a) {
args = a;
}
@@ -99,7 +103,7 @@ public boolean run() {
if (verbose) {
System.out.println("[Processing class " + args[i] + ".class]");
}
- processClass(args[i]);
+ processClass(args[i].replace(File.separatorChar, '.'));
}
catch (Exception e) {
exception = e;
@@ -110,27 +114,34 @@ public boolean run() {
}
private boolean processClass(String classname) throws Exception {
+ errorCount = 0;
analyzeClass(classname);
+ if(errorCount > 0) {
+ System.exit(1);
+ }
generateStub();
if (need11Stubs) {
generateSkel();
}
if (compile) {
- compile(stubname + ".java");
+ compile(stubname.replace('.', File.separatorChar) + ".java");
if (need11Stubs) {
- compile(skelname + ".java");
+ compile(skelname.replace('.', File.separatorChar) + ".java");
}
}
if (!keep) {
- (new File(stubname + ".java")).delete();
+ (new File(stubname.replace('.', File.separatorChar) + ".java")).delete();
if (need11Stubs) {
- (new File(skelname + ".java")).delete();
+ (new File(skelname.replace('.', File.separatorChar) + ".java")).delete();
}
}
return (true);
}
private void analyzeClass(String cname) throws Exception {
+ if(verbose){
+ System.out.println("[analyze class "+cname+"]");
+ }
int p = cname.lastIndexOf('.');
if (p != -1) {
classname = cname.substring(p+1);
@@ -140,27 +151,36 @@ private void analyzeClass(String cname) throws Exception {
}
fullclassname = cname;
+
HashSet rmeths = new HashSet();
findClass();
- for (Class cls = clazz; cls != null; cls = cls.getSuperclass()) {
- // Keep going down the inheritence tree until we hit the system
- if (cls.getName().startsWith("java.")) {
- break;
- }
-
- Method[] meths = cls.getDeclaredMethods();
- for (int i = 0; i < meths.length; i++) {
- // Only include public methods
- int mods = meths[i].getModifiers();
- if (Modifier.isPublic(mods) && !Modifier.isStatic(mods)) {
- // Should check exceptions here. - XXX
+
+ // get the remote interface
+ mRemoteInterface = getRemoteInterface(clazz);
+ if(mRemoteInterface == null)
+ return;
+ if(verbose){
+ System.out.println("[implements "+mRemoteInterface.getName()+"]");
+ }
- // Add this one in.
- rmeths.add(meths[i]);
+ // check if the methods of the remote interface declare RemoteExceptions
+ Method[] meths = mRemoteInterface.getDeclaredMethods();
+ for (int i = 0; i < meths.length; i++) {
+ Class[] exceptions = meths[i].getExceptionTypes();
+ int index = 0;
+ for(;index < exceptions.length; index++){
+ if(exceptions[index].equals(RemoteException.class)){
+ break;
}
}
+ if (index < exceptions.length) {
+ rmeths.add(meths[i]);
+ } else {
+ logError("Method "+meths[i]+" does not throw a java.rmi.RemoteException");
+ }
}
+
// Convert into a MethodRef array and sort them
remotemethods = new MethodRef[rmeths.size()];
int c = 0;
@@ -175,12 +195,15 @@ public Exception getException() {
}
private void findClass() throws ClassNotFoundException {
- clazz = Class.forName(fullclassname);
+ clazz = Class.forName(fullclassname, true, ClassLoader.getSystemClassLoader());
}
private void generateStub() throws IOException {
- stubname = classname + "_Stub";
- ctrl = new TabbedWriter(new FileWriter(stubname + ".java"));
+ stubname = fullclassname + "_Stub";
+ String stubclassname = classname + "_Stub";
+ ctrl = new TabbedWriter(new FileWriter((destination == null ? "" : destination + File.separator)
+ + stubname.replace('.', File.separatorChar)
+ + ".java"));
out = new PrintWriter(ctrl);
if (verbose) {
@@ -195,20 +218,32 @@ private void generateStub() throws IOException {
out.println();
}
- out.print("public final class " + stubname);
+ out.print("public final class " + stubclassname);
ctrl.indent();
out.println("extends java.rmi.server.RemoteStub");
// Output interfaces we implement
out.print("implements ");
- Class[] ifaces = clazz.getInterfaces();
- for (int i = 0; i < ifaces.length; i++) {
- out.print(ifaces[i].getName());
- if (i+1 < ifaces.length) {
+ /* Scan implemented interfaces, and only print remote interfaces. */
+ Class[] ifaces = clazz.getInterfaces();
+ Set remoteIfaces = new HashSet();
+ for (int i = 0; i < ifaces.length; i++) {
+ Class iface = ifaces[i];
+ if (java.rmi.Remote.class.isAssignableFrom(iface)) {
+ remoteIfaces.add(iface);
+ }
+ }
+ Iterator iter = remoteIfaces.iterator();
+ while (iter.hasNext()) {
+ /* Print remote interface. */
+ Class iface = (Class) iter.next();
+ out.print(iface.getName());
+
+ /* Print ", " if more remote interfaces follow. */
+ if (iter.hasNext()) {
out.print(", ");
}
}
-
ctrl.unindent();
out.print("{");
ctrl.indent();
@@ -278,7 +313,7 @@ private void generateStub() throws IOException {
for (int i = 0; i < remotemethods.length; i++) {
Method m = remotemethods[i].meth;
out.print("$method_" + m.getName() + "_" + i + " = ");
- out.print(fullclassname + ".class.getMethod(\"" + m.getName() + "\"");
+ out.print(mRemoteInterface.getName() + ".class.getMethod(\"" + m.getName() + "\"");
out.print(", new java.lang.Class[] {");
// Output signature
Class[] sig = m.getParameterTypes();
@@ -311,7 +346,7 @@ private void generateStub() throws IOException {
// Constructors
if (need11Stubs) {
- out.print("public " + stubname + "() {");
+ out.print("public " + stubclassname + "() {");
ctrl.indent();
out.print("super();");
ctrl.unindent();
@@ -319,7 +354,7 @@ private void generateStub() throws IOException {
}
if (need12Stubs) {
- out.print("public " + stubname + "(java.rmi.server.RemoteRef ref) {");
+ out.print("public " + stubclassname + "(java.rmi.server.RemoteRef ref) {");
ctrl.indent();
out.print("super(ref);");
ctrl.unindent();
@@ -600,8 +635,11 @@ private void generateStub() throws IOException {
}
private void generateSkel() throws IOException {
- skelname = classname + "_Skel";
- ctrl = new TabbedWriter(new FileWriter(skelname + ".java"));
+ skelname = fullclassname + "_Skel";
+ String skelclassname = classname + "_Skel";
+ ctrl = new TabbedWriter(new FileWriter((destination == null ? "" : destination + File.separator)
+ + skelname.replace('.', File.separatorChar)
+ + ".java"));
out = new PrintWriter(ctrl);
if (verbose) {
@@ -616,7 +654,7 @@ private void generateSkel() throws IOException {
out.println();
}
- out.print("public final class " + skelname);
+ out.print("public final class " + skelclassname);
ctrl.indent();
// Output interfaces we implement
@@ -961,6 +999,35 @@ private void parseOptions() {
}
}
+/**
+ * Looks for the java.rmi.Remote interface that that is implemented by theClazz.
+ * @param theClazz the class to look in
+ * @return the Remote interface of theClazz or null if theClazz does not implement a Remote interface
+ */
+private Class getRemoteInterface(Class theClazz)
+{
+ Class[] interfaces = theClazz.getInterfaces();
+ for (int i = 0; i < interfaces.length; i++)
+ {
+ if (java.rmi.Remote.class.isAssignableFrom(interfaces[i]))
+ {
+ return interfaces[i];
+ }
+ }
+ logError("Class "+ theClazz.getName()
+ + " is not a remote object. It does not implement an interface that is a java.rmi.Remote-interface.");
+ return null;
+}
+
+/**
+ * Prints an error to System.err and increases the error count.
+ * @param theError
+ */
+private void logError(String theError){
+ errorCount++;
+ System.err.println("error:"+theError);
+}
+
private static void error(String message) {
System.err.println("rmic: " + message);
System.err.println("Try `rmic --help' for more information.");
diff --git a/libjava/gnu/java/rmi/rmic/RMICException.java b/libjava/gnu/java/rmi/rmic/RMICException.java
new file mode 100644
index 00000000000..c048d9e0dbb
--- /dev/null
+++ b/libjava/gnu/java/rmi/rmic/RMICException.java
@@ -0,0 +1,66 @@
+/*
+ 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.rmic;
+
+/**
+ * Thrown by the underlying compiler used by RMIC when it fails to compile a file.
+ *
+ * @author Dalibor Topic <robilad@kaffe.org>
+ */
+
+public class RMICException extends Exception {
+ /**
+ * Create an exception with a message. The cause remains uninitialized.
+ *
+ * @param s the message string
+ * @see #initCause(Throwable)
+ */
+ public RMICException(String message) {
+ super(message);
+ }
+
+ /**
+ * Create an exception with a message and a cause.
+ *
+ * @param s the message string
+ * @param cause the cause of this exception
+ */
+ public RMICException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/libjava/gnu/java/rmi/server/UnicastRef.java b/libjava/gnu/java/rmi/server/UnicastRef.java
index 9ab020db6c3..aaec7a3b470 100644
--- a/libjava/gnu/java/rmi/server/UnicastRef.java
+++ b/libjava/gnu/java/rmi/server/UnicastRef.java
@@ -37,32 +37,24 @@ exception statement from your version. */
package gnu.java.rmi.server;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.rmi.Remote;
import java.rmi.RemoteException;
-import java.rmi.server.RemoteRef;
-import java.rmi.server.RMISocketFactory;
+import java.rmi.server.ObjID;
+import java.rmi.server.Operation;
import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.RemoteObject;
import java.rmi.server.RemoteCall;
-import java.rmi.server.UnicastRemoteObject;
-import java.rmi.server.Operation;
-import java.rmi.server.ObjID;
+import java.rmi.server.RemoteObject;
+import java.rmi.server.RemoteRef;
import java.rmi.server.UID;
-import java.lang.reflect.Method;
-import java.io.ObjectOutput;
-import java.io.ObjectInput;
-import java.io.IOException;
-import java.net.Socket;
-import java.net.InetAddress;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-
-import java.lang.reflect.InvocationTargetException;
public class UnicastRef
implements RemoteRef, ProtocolConstants {
@@ -73,8 +65,9 @@ UnicastConnectionManager manager;
/**
* Used by serialization, and let subclass capable of having default constructor
*/
-//private
-UnicastRef() {
+// must be public otherwise java.rmi.RemoteObject cannot instantiate this class
+// -- iP
+public UnicastRef() {
}
public UnicastRef(ObjID objid, String host, int port, RMIClientSocketFactory csf) {
@@ -90,7 +83,10 @@ public Object invoke(Remote obj, Method method, Object[] params, long opnum) thr
// Check if client and server are in the same VM, then local call can be used to
// replace remote call, but it's somewhat violating remote semantic.
Object svrobj = manager.serverobj;
- if(svrobj != null){
+
+ // Make sure that the server object is compatible. It could be loaded from a different
+ // classloader --iP
+ if(svrobj != null && method.getDeclaringClass().isInstance(svrobj)){
//local call
Object ret = null;
try{
diff --git a/libjava/gnu/java/rmi/server/UnicastServerRef.java b/libjava/gnu/java/rmi/server/UnicastServerRef.java
index a3a999f2e9f..e2f38ff5f8c 100644
--- a/libjava/gnu/java/rmi/server/UnicastServerRef.java
+++ b/libjava/gnu/java/rmi/server/UnicastServerRef.java
@@ -138,8 +138,9 @@ public boolean unexportObject(Remote obj, boolean force) {
private Object getHelperClass(Class cls, String type) {
try {
String classname = cls.getName();
- ClassLoader cl = cls.getClassLoader(); //DONT use "Class scls = Class.forName(classname + type);"
- Class scls = cl.loadClass(classname + type);
+ ClassLoader cl = cls.getClassLoader();
+ Class scls = cl == null ? Class.forName(classname + type)
+ : cl.loadClass(classname + type);
if (type.equals("_Stub")) {
try {
// JDK 1.2 stubs
@@ -225,7 +226,9 @@ public Object incomingMessageCall(UnicastConnection conn, int method, long hash)
* lets us know that.
*/
try {
- args[i] = in.readObject();
+ // need to handle primitive types
+ args[i] = ((RMIObjectInputStream)in).readValue(meth.getParameterTypes()[i]);
+
}
catch (Exception t) {
t.printStackTrace();
@@ -257,3 +260,5 @@ public Object incomingMessageCall(UnicastConnection conn, int method, long hash)
}
}
+
+
diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in
index 1a38831cb19..70902622733 100644
--- a/libjava/include/Makefile.in
+++ b/libjava/include/Makefile.in
@@ -125,6 +125,7 @@ STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
SYS_ZLIBS = @SYS_ZLIBS@
+THREADCXXFLAGS = @THREADCXXFLAGS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
THREADLDFLAGS = @THREADLDFLAGS@
diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in
index daf11ca1ad8..148fcad95ca 100644
--- a/libjava/include/config.h.in
+++ b/libjava/include/config.h.in
@@ -44,149 +44,9 @@
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
-/* Define this if you want runtime debugging enabled. */
-#undef DEBUG
-
-/* Define if using POSIX threads that have the mutexattr functions. */
-#undef HAVE_PTHREAD_MUTEXATTR_INIT
-
-/* Define if you have memcpy. */
-#undef HAVE_MEMCPY
-
-/* Define if you have memmove. */
-#undef HAVE_MEMMOVE
-
-/* Define if you have strerror. */
-#undef HAVE_STRERROR
-
-/* Define if you have int32_t and uint32_t. */
-#undef HAVE_INT32_DEFINED
-
-/* Define if you have u_int32_t */
-#undef HAVE_BSD_INT32_DEFINED
-
-/* Define if you're running eCos. */
-#undef ECOS
-
-/* */
-#undef HAVE_LOCALTIME
-
-/* */
-#undef HAVE_MKTIME
-
-/* Define if using POSIX threads on Linux. */
-#undef LINUX_THREADS
-
-/* Define if you have the `gmtime_r' function. */
-#undef HAVE_GMTIME_R
-
-/* Define if you have the `localtime_r' function. */
-#undef HAVE_LOCALTIME_R
-
/* Define to `int' if `ssize_t' is not defined. */
#undef ssize_t
-/* Define to 1 if `in_addr_t' is defined in sys/types.h or
- netinet/in.h. */
-#undef HAVE_IN_ADDR_T
-
-/* Define if inet6 structures are defined in netinet/in.h. */
-#undef HAVE_INET6
-
-/* Define if struct ip_mreq is defined in netinet/in.h. */
-#undef HAVE_STRUCT_IP_MREQ
-
-/* Define if struct ipv6_mreq is defined in netinet/in.h. */
-#undef HAVE_STRUCT_IPV6_MREQ
-
-/* Define it socklen_t typedef is in sys/socket.h. */
-#undef HAVE_SOCKLEN_T
-
-/* Define if Boehm GC in use. */
-#undef HAVE_BOEHM_GC
-
-/* Define if gethostname is declared in <unistd.h>. */
-#undef HAVE_GETHOSTNAME_DECL
-
-/* Define if gethostbyname_r returns `int'. */
-#undef GETHOSTBYNAME_R_RETURNS_INT
-
-/* Define if gethostbyaddr_r returns `int'. */
-#undef GETHOSTBYADDR_R_RETURNS_INT
-
-/* Define if usleep is declared in <unistd.h>. */
-#undef HAVE_USLEEP_DECL
-
-/* Define if struct tm has tm_gmtoff field. */
-#undef STRUCT_TM_HAS_GMTOFF
-
-/* Define if global `timezone' exists. */
-#undef HAVE_TIMEZONE
-
-/* Define if if the synchronization code should try to avoid pthread_self
- calls by caching thread IDs in a hashtable. */
-#undef SLOW_PTHREAD_SELF
-
-/* Define if you have the appropriate function. */
-#undef HAVE_ACCESS
-#undef HAVE_STAT
-#undef HAVE_MKDIR
-#undef HAVE_RENAME
-#undef HAVE_RMDIR
-#undef HAVE_UNLINK
-#undef HAVE_REALPATH
-#undef HAVE_READDIR_R
-#undef HAVE_GETHOSTBYNAME_R
-#undef HAVE_GETHOSTBYADDR_R
-#undef HAVE_FTRUNCATE
-
-/* Define if you want a bytecode interpreter. */
-#undef INTERPRETER
-
-/* Define if pthread_mutex_t has m_count member. */
-#undef PTHREAD_MUTEX_HAVE_M_COUNT
-
-/* Define if pthread_mutex_t has __m_count member. */
-#undef PTHREAD_MUTEX_HAVE___M_COUNT
-
-/* Define if java.net native functions should be stubbed out. */
-#undef DISABLE_JAVA_NET
-
-/* Define if we're to use libffi. */
-#undef USE_LIBFFI
-
-/* Define if system properties shouldn't be read from
- getenv("GCJ_PROPERTIES"). */
-#undef DISABLE_GETENV_PROPERTIES
-
-/* Define if we should ignore arguments to main(). */
-#undef DISABLE_MAIN_ARGS
-
-/* Define if you have /proc/self/exe */
-#undef HAVE_PROC_SELF_EXE
-
-
-/* Define if you have dladdr() */
-#undef HAVE_DLADDR
-
-/* Define if getuid() and friends are missing. */
-#undef NO_GETUID
-
-/* Define if libltdl is in use. */
-#undef USE_LTDL
-
-/* Define if g++ has a bug preventing us from inlining math routines. */
-#undef __NO_MATH_INLINES
-
-/* Define if you are using JVMPI. */
-#undef ENABLE_JVMPI
-
-/* Define if your platform has a working backtrace() function. */
-#undef HAVE_BACKTRACE
-
-/* Define if your platform has the global _timezone variable. */
-#undef HAVE_UNDERSCORE_TIMEZONE
-
/* Define if you have the access function. */
#undef HAVE_ACCESS
@@ -403,12 +263,69 @@
/* Version number of package */
#undef VERSION
+/* Define if libltdl is in use. */
+#undef USE_LTDL
+
+/* Define if system properties shouldn't be read from getenv(GCJ_PROPERTIES). */
+#undef DISABLE_GETENV_PROPERTIES
+
+/* Define if we should ignore arguments to main(). */
+#undef DISABLE_MAIN_ARGS
+
+/* Define if if the synchronization code should try to avoid pthread_self calls by caching thread IDs in a hashtable. */
+#undef SLOW_PTHREAD_SELF
+
+/* Define this if you want runtime debugging enabled. */
+#undef DEBUG
+
+/* Define if you want a bytecode interpreter. */
+#undef INTERPRETER
+
/* Define if the compiler is configured for setjmp/longjmp exceptions. */
#undef SJLJ_EXCEPTIONS
+/* Define if java.net native functions should be stubbed out. */
+#undef DISABLE_JAVA_NET
+
+/* Define if we're to use libffi. */
+#undef USE_LIBFFI
+
+/* Define if you are using JVMPI. */
+#undef ENABLE_JVMPI
+
/* Indicate that linker is not able to 8-byte align static data */
#undef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS
+/* Define if you're running eCos. */
+#undef ECOS
+
+/* Define if you have int32_t and uint32_t. */
+#undef HAVE_INT32_DEFINED
+
+/* Define if you have int32_t and uint32_t. */
+#undef HAVE_INT32_DEFINED
+
+/* Define if you have u_int32_t */
+#undef HAVE_BSD_INT32_DEFINED
+
+/* Define if you have u_int32_t */
+#undef HAVE_BSD_INT32_DEFINED
+
+/* Define is you have 'mktime' in <time.h> */
+#undef HAVE_MKTIME
+
+/* Define is you have 'localtime' in <time.h> */
+#undef HAVE_LOCALTIME
+
+/* Define if Boehm GC in use. */
+#undef HAVE_BOEHM_GC
+
+/* Define if using POSIX threads on Linux. */
+#undef LINUX_THREADS
+
+/* Define if using POSIX threads that have the mutexattr functions. */
+#undef HAVE_PTHREAD_MUTEXATTR_INIT
+
/* Required define if using POSIX threads */
#undef _REENTRANT
@@ -418,6 +335,45 @@
/* Define if hash synchronization is in use */
#undef JV_HASH_SYNCHRONIZATION
+/* Define if you have memmove. */
+#undef HAVE_MEMMOVE
+
+/* Define if you have memcpy. */
+#undef HAVE_MEMCPY
+
+/* Define if you have strerror. */
+#undef HAVE_STRERROR
+
+/* Define if you have time. */
+#undef HAVE_TIME
+
+/* Define if you have the 'gmtime_r' function */
+#undef HAVE_GMTIME_R
+
+/* Define if you have the 'localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* Define if using POSIX threads that have the mutexattr functions. */
+#undef HAVE_PTHREAD_MUTEXATTR_INIT
+
+/* Define if getuid() and friends are missing. */
+#undef NO_GETUID
+
+/* Define if your platform has a working backtrace() function. */
+#undef HAVE_BACKTRACE
+
+/* Define if your platform has a working backtrace() function. */
+#undef HAVE_BACKTRACE
+
+/* Define if you have dladdr() */
+#undef HAVE_DLADDR
+
+/* Define if you have /proc/self/exe */
+#undef HAVE_PROC_SELF_EXE
+
+/* Define if you have /proc/self/exe */
+#undef HAVE_PROC_SELF_EXE
+
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
@@ -427,12 +383,39 @@
/* Define if your <locale.h> file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
+/* Define if you have the 'gethostbyname_r' function. */
+#undef HAVE_GETHOSTBYNAME_R
+
+/* Define if gethostbyname_r returns 'int'. */
+#undef GETHOSTBYNAME_R_RETURNS_INT
+
/* Required define if using POSIX threads */
#undef _REENTRANT
/* Define if struct hostent_data is defined in netdb.h */
#undef HAVE_STRUCT_HOSTENT_DATA
+/* Define if you have the 'gethostbyaddr_r' function. */
+#undef HAVE_GETHOSTBYADDR_R
+
+/* Define if gethostbyaddr_r returns 'int'. */
+#undef GETHOSTBYADDR_R_RETURNS_INT
+
+/* Define if you have the 'gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define if gethostname is declared in <unistd.h>. */
+#undef HAVE_GETHOSTNAME_DECL
+
+/* Define if usleep is declared in <unistd.h>. */
+#undef HAVE_USLEEP_DECL
+
+/* Define if pthread_mutex_t has m_count member. */
+#undef PTHREAD_MUTEX_HAVE_M_COUNT
+
+/* Define if pthread_mutex_t has __m_count member. */
+#undef PTHREAD_MUTEX_HAVE___M_COUNT
+
/* Define if dlopen is available */
#undef HAVE_DLOPEN
@@ -448,3 +431,27 @@
/* Define if <inttypes.h> is available */
#undef JV_HAVE_INTTYPES_H
+/* Define to 1 if 'in_addr_t' is defined in sys/types.h or netinet/in.h. */
+#undef HAVE_IN_ADDR_T
+
+/* Define if struct ip_mreq is defined in netinet/in.h. */
+#undef HAVE_STRUCT_IP_MREQ
+
+/* Define if struct ipv6_mreq is defined in netinet/in.h. */
+#undef HAVE_STRUCT_IPV6_MREQ
+
+/* Define if inet6 structures are defined in netinet/in.h. */
+#undef HAVE_INET6
+
+/* Define it socklen_t typedef is in sys/socket.h. */
+#undef HAVE_SOCKLEN_T
+
+/* Define if struct tm has tm_gmtoff field. */
+#undef STRUCT_TM_HAS_GMTOFF
+
+/* Define if global 'timezone' exists. */
+#undef HAVE_TIMEZONE
+
+/* Define if your platform has the global _timezone variable. */
+#undef HAVE_UNDERSCORE_TIMEZONE
+
diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h
index 869a928332c..280b72e5586 100644
--- a/libjava/include/i386-signal.h
+++ b/libjava/include/i386-signal.h
@@ -108,26 +108,44 @@ struct old_i386_kernel_sigaction {
void (*sa_restorer) (void);
};
+#define RESTORE(name, syscall) RESTORE2 (name, syscall)
+# define RESTORE2(name, syscall) \
+asm \
+ ( \
+ ".text\n" \
+ ".byte 0 # Yes, this really is necessary\n" \
+ " .align 8\n" \
+ "__" #name ":\n" \
+ " popl %eax\n" \
+ " movl $" #syscall ", %eax\n" \
+ " int $0x80" \
+ );
+
+RESTORE (restore, __NR_sigreturn)
+static void restore (void) asm ("__restore");
+
#define INIT_SEGV \
do \
{ \
struct old_i386_kernel_sigaction kact; \
kact.k_sa_handler = catch_segv; \
kact.k_sa_mask = 0; \
- kact.k_sa_flags = 0; \
+ kact.k_sa_flags = 0x4000000; \
+ kact.sa_restorer = restore; \
syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \
} \
while (0)
-#define INIT_FPE \
-do \
- { \
- struct old_i386_kernel_sigaction kact; \
- kact.k_sa_handler = catch_fpe; \
- kact.k_sa_mask = 0; \
- kact.k_sa_flags = 0; \
- syscall (SYS_sigaction, SIGFPE, &kact, NULL); \
- } \
+#define INIT_FPE \
+do \
+ { \
+ struct old_i386_kernel_sigaction kact; \
+ kact.k_sa_handler = catch_fpe; \
+ kact.k_sa_mask = 0; \
+ kact.k_sa_flags = 0x4000000; \
+ kact.sa_restorer = restore; \
+ syscall (SYS_sigaction, SIGFPE, &kact, NULL); \
+ } \
while (0)
/* You might wonder why we use syscall(SYS_sigaction) in INIT_FPE
@@ -144,10 +162,7 @@ while (0)
* Also, there is at the present time no unwind info in the
* linuxthreads library's signal handlers and so we can't unwind
- * through them anyway.
-
- * Finally, the code that glibc uses to return from a signal handler
- * is subject to change. */
+ * through them anyway. */
#endif /* JAVA_SIGNAL_H */
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index 9395feb09c4..a114e550a15 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -1,6 +1,6 @@
// jvm.h - Header file for private implementation information. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -149,6 +149,79 @@ extern jboolean _Jv_equalUtf8Consts (_Jv_Utf8Const *, _Jv_Utf8Const *);
extern jboolean _Jv_equal (_Jv_Utf8Const *, jstring, jint);
extern jboolean _Jv_equaln (_Jv_Utf8Const *, jstring, jint);
+/* Helper class which converts a jstring to a temporary char*.
+ Uses the supplied buffer, if non-null. Otherwise, allocates
+ the buffer on the heap. Use the JV_TEMP_UTF_STRING macro,
+ which follows, to automatically allocate a stack buffer if
+ the string is small enough. */
+class _Jv_TempUTFString
+{
+public:
+ _Jv_TempUTFString(jstring jstr, char* buf=0);
+ ~_Jv_TempUTFString();
+
+// Accessors
+ operator const char*() const
+ {
+ return buf_;
+ }
+ const char* buf() const
+ {
+ return buf_;
+ }
+ char* buf()
+ {
+ return buf_;
+ }
+
+private:
+ char* buf_;
+ bool heapAllocated_;
+};
+
+inline _Jv_TempUTFString::_Jv_TempUTFString (jstring jstr, char* buf)
+ : buf_(0), heapAllocated_(false)
+{
+ if (!jstr) return;
+ jsize len = JvGetStringUTFLength (jstr);
+ if (buf)
+ buf_ = buf;
+ else
+ {
+ buf_ = (char*) _Jv_Malloc (len+1);
+ heapAllocated_ = true;
+ }
+
+ JvGetStringUTFRegion (jstr, 0, jstr->length(), buf_);
+ buf_[len] = '\0';
+}
+
+inline _Jv_TempUTFString::~_Jv_TempUTFString ()
+{
+ if (heapAllocated_)
+ _Jv_Free (buf_);
+}
+
+/* Macro which uses _Jv_TempUTFString. Allocates a stack-based
+ buffer if the string and its null terminator are <= 256
+ characters in length. Otherwise, a heap-based buffer is
+ used. The parameters to this macro are the variable name
+ which is an instance of _Jv_TempUTFString (above) and a
+ jstring.
+
+ Sample Usage:
+
+ jstring jstr = getAJString();
+ JV_TEMP_UTF_STRING(utfstr, jstr);
+ printf("The string is: %s\n", utfstr.buf());
+
+ */
+#define JV_TEMP_UTF_STRING(utfstr, jstr) \
+ jstring utfstr##thejstr = (jstr); \
+ jsize utfstr##_len = utfstr##thejstr ? JvGetStringUTFLength (utfstr##thejstr) + 1 : 0; \
+ char utfstr##_buf[utfstr##_len <= 256 ? utfstr##_len : 0]; \
+ _Jv_TempUTFString utfstr(utfstr##thejstr, sizeof(utfstr##_buf)==0 ? 0 : utfstr##_buf)
+
// FIXME: remove this define.
#define StringClass java::lang::String::class$
@@ -326,19 +399,23 @@ extern void _Jv_GetTypesFromSignature (jmethodID method,
JArray<jclass> **arg_types_out,
jclass *return_type_out);
+extern jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
+ jint flags);
+
extern jobject _Jv_CallAnyMethodA (jobject obj, jclass return_type,
jmethodID meth, jboolean is_constructor,
JArray<jclass> *parameter_types,
jobjectArray args);
union jvalue;
-extern jthrowable _Jv_CallAnyMethodA (jobject obj,
- jclass return_type,
- jmethodID meth,
- jboolean is_constructor,
- JArray<jclass> *parameter_types,
- jvalue *args,
- jvalue *result);
+extern void _Jv_CallAnyMethodA (jobject obj,
+ jclass return_type,
+ jmethodID meth,
+ jboolean is_constructor,
+ JArray<jclass> *parameter_types,
+ jvalue *args,
+ jvalue *result,
+ jboolean is_jni_call = true);
extern jobject _Jv_NewMultiArray (jclass, jint ndims, jint* dims)
__attribute__((__malloc__));
@@ -389,6 +466,22 @@ bool _Jv_VerifyClassName (_Jv_Utf8Const *name);
bool _Jv_VerifyIdentifier (_Jv_Utf8Const *);
bool _Jv_ClassNameSamePackage (_Jv_Utf8Const *name1, _Jv_Utf8Const *name2);
+struct _Jv_core_chain
+{
+ int name_length;
+ const char *name;
+ int data_length;
+ const void *data;
+
+ struct _Jv_core_chain *next;
+};
+
+// This is called when new core data is loaded.
+extern void (*_Jv_RegisterCoreHook) (_Jv_core_chain *);
+
+_Jv_core_chain *_Jv_FindCore (_Jv_core_chain *node, jstring name);
+void _Jv_FreeCoreChain (_Jv_core_chain *chain);
+
#ifdef ENABLE_JVMPI
#include "jvmpi.h"
diff --git a/libjava/include/win32-threads.h b/libjava/include/win32-threads.h
index 5e40ae24b87..ed5eb0047e0 100644
--- a/libjava/include/win32-threads.h
+++ b/libjava/include/win32-threads.h
@@ -50,6 +50,14 @@ typedef struct
{
int flags; // Flags are defined in implementation.
HANDLE handle; // Actual handle to the thread
+
+ // Protects access to the thread's interrupt_flag and
+ // interrupt_event variables within this module.
+ CRITICAL_SECTION interrupt_mutex;
+
+ // A Win32 auto-reset event for thread interruption
+ HANDLE interrupt_event;
+
java::lang::Thread *thread_obj;
} _Jv_Thread_t;
@@ -150,6 +158,24 @@ void _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data,
void _Jv_ThreadWait (void);
void _Jv_ThreadInterrupt (_Jv_Thread_t *data);
+//
+// Thread interruption support
+//
+
+// Gets the auto-reset event for the current thread which is
+// signalled by _Jv_ThreadInterrupt. The caller can wait on this
+// event in addition to other waitable objects.
+//
+// NOTE: After waiting on this event with WaitForMultipleObjects,
+// you should ALWAYS use the return value of WaitForMultipleObjects
+// to test whether this event was signalled and whether thread
+// interruption has occurred. You should do this instead of checking
+// the thread's interrupted_flag, because someone could have reset
+// this flag in the interval of time between the return of
+// WaitForMultipleObjects and the time you query interrupted_flag.
+// See java/lang/natWin32Process.cc (waitFor) for an example.
+HANDLE _Jv_Win32GetInterruptEvent (void);
+
// Remove defines from <windows.h> that conflict with various things in libgcj code
#undef TRUE
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index 320273aa4e5..6da0eafaa9a 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -11,11 +11,14 @@ details. */
#ifndef __JV_WIN32_H__
#define __JV_WIN32_H__
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
#undef STRICT
#include <ws2tcpip.h>
#include <gcj/cni.h>
+#include <jvm.h>
#include <java/util/Properties.h>
#include <io.h>
@@ -40,21 +43,58 @@ details. */
// with the JNICALL definition in jni.h
#define _Jv_platform_ffi_abi FFI_STDCALL
-#ifndef DISABLE_JAVA_NET
+/* Useful helper classes and methods. */
-// these errors cannot occur on Win32
-#define ENOTCONN 0
-#define ECONNRESET 0
+/* 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. */
+class WSAEventWrapper
+{
+public:
+ WSAEventWrapper(int fd, DWORD dwSelFlags);
+ ~WSAEventWrapper();
+
+ WSAEVENT getEventHandle()
+ {
+ return m_hEvent;
+ }
+
+private:
+ WSAEVENT m_hEvent;
+ int m_fd;
+ DWORD m_dwSelFlags;
+};
+
+// Error string text. The int argument is compatible
+// with both int WSAGetLastError() and DWORD GetLastError()
+// I tried avoiding having to pass the error explicitly, but
+// it didn't work this was invoked with say
+// throw new SomeException(_Jv_WinStrError()).
+extern jstring
+_Jv_WinStrError (LPCTSTR lpszPrologue, int nErrorCode);
+
+extern jstring
+_Jv_WinStrError (int nErrorCode);
-#ifndef ENOPROTOOPT
-#define ENOPROTOOPT 109
-#endif
+extern void
+_Jv_ThrowIOException (DWORD dwErrorCode);
-#endif // DISABLE_JAVA_NET
+extern void
+_Jv_ThrowIOException ();
+extern void
+_Jv_ThrowSocketException (DWORD dwErrorCode);
+
+extern void
+_Jv_ThrowSocketException ();
+
+// Platform implementation
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 *);
inline void
_Jv_platform_close_on_exec (jint)
@@ -77,58 +117,6 @@ _Jv_platform_usleep (unsigned long usecs)
}
#endif /* JV_HASH_SYNCHRONIZATION */
-#ifndef DISABLE_JAVA_NET
-
-static inline int
-_Jv_socket (int domain, int type, int protocol)
-{
- return ::socket (domain, type, protocol);
-}
-
-inline int
-_Jv_connect (jint fd, sockaddr *ptr, int len)
-{
- return ::connect (fd, ptr, len);
-}
-
-inline int
-_Jv_close (jint fd)
-{
- return ::closesocket (fd);
-}
-
-inline int
-_Jv_bind (int fd, struct sockaddr *addr, int addrlen)
-{
- return ::bind (fd, addr, addrlen);
-}
-
-inline int
-_Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
-{
- return ::accept (fd, addr, addrlen);
-}
-
-inline int
-_Jv_listen (int fd, int backlog)
-{
- return ::listen (fd, backlog);
-}
-
-inline int
-_Jv_write(int s, void *buf, int len)
-{
- return ::send (s, (char*) buf, len, 0);
-}
-
-inline int
-_Jv_read(int s, void *buf, int len)
-{
- return ::recv (s, (char*) buf, len, 0);
-}
-
-#endif /* DISABLE_JAVA_NET */
-
/* Store up to SIZE return address of the current program state in
ARRAY and return the exact number of values stored. */
extern int backtrace (void **__array, int __size);
diff --git a/libjava/java/awt/BasicStroke.java b/libjava/java/awt/BasicStroke.java
index 3d0a2e74506..2978c6401d7 100644
--- a/libjava/java/awt/BasicStroke.java
+++ b/libjava/java/awt/BasicStroke.java
@@ -67,7 +67,8 @@ public class BasicStroke implements Stroke
* @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
* @param miterlimit the limit to trim the miter join. The miterlimit must be
* greater than or equal to 1.0f.
- * @param dash The array representing the dashing pattern.
+ * @param dash The array representing the dashing pattern. There must be at
+ * least one non-zero entry.
* @param dash_phase is negative and dash is not null.
*
* @exception IllegalArgumentException If one input parameter doesn't meet
@@ -76,13 +77,40 @@ public class BasicStroke implements Stroke
public BasicStroke(float width, int cap, int join, float miterlimit,
float[] dash, float dashPhase)
{
- if (width < 0 ||
- miterlimit < 1.0f ||
- cap < CAP_BUTT ||
- cap > CAP_SQUARE ||
- join < JOIN_MITER ||
- join > JOIN_BEVEL)
- throw new IllegalArgumentException();
+ if (width < 0.0f )
+ throw new IllegalArgumentException("width " + width + " < 0");
+ else if (cap < CAP_BUTT || cap > CAP_SQUARE)
+ throw new IllegalArgumentException("cap " + cap + " out of range ["
+ + CAP_BUTT + ".." + CAP_SQUARE + "]");
+ else if (miterlimit < 1.0f && join == JOIN_MITER)
+ throw new IllegalArgumentException("miterlimit " + miterlimit
+ + " < 1.0f while join == JOIN_MITER");
+ else if (join < JOIN_MITER || join > JOIN_BEVEL)
+ throw new IllegalArgumentException("join " + join + " out of range ["
+ + JOIN_MITER + ".." + JOIN_BEVEL
+ + "]");
+ else if (dashPhase < 0.0f && dash != null)
+ throw new IllegalArgumentException("dashPhase " + dashPhase
+ + " < 0.0f while dash != null");
+ else if (dash != null)
+ if (dash.length == 0)
+ throw new IllegalArgumentException("dash.length is 0");
+ else
+ {
+ boolean allZero = true;
+
+ for ( int i = 0; i < dash.length; ++i)
+ {
+ if (dash[i] != 0.0f)
+ {
+ allZero = false;
+ break;
+ }
+ }
+
+ if (allZero)
+ throw new IllegalArgumentException("all dashes are 0.0f");
+ }
this.width = width;
this.cap = cap;
diff --git a/libjava/java/awt/Color.java b/libjava/java/awt/Color.java
index 761b738e448..e6eb03e8f0a 100644
--- a/libjava/java/awt/Color.java
+++ b/libjava/java/awt/Color.java
@@ -496,7 +496,7 @@ public class Color implements Paint, Serializable
public int getAlpha()
{
// Do not inline getRGB() to value, because of SystemColor.
- return (getRGB() & ALPHA_MASK) >> 24;
+ return (getRGB() & ALPHA_MASK) >>> 24;
}
/**
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
index cc723b480f2..d70ed50be1c 100644
--- a/libjava/java/awt/Component.java
+++ b/libjava/java/awt/Component.java
@@ -677,6 +677,7 @@ public abstract class Component
if (tk != null)
return tk;
}
+ // Get toolkit for lightweight component.
if (parent != null)
return parent.getToolkit();
return Toolkit.getDefaultToolkit();
@@ -1452,12 +1453,7 @@ public abstract class Component
*/
public Dimension getPreferredSize()
{
- if (prefSize == null)
- if (peer == null)
- return new Dimension(width, height);
- else
- prefSize = peer.getPreferredSize();
- return prefSize;
+ return preferredSize();
}
/**
@@ -1468,7 +1464,12 @@ public abstract class Component
*/
public Dimension preferredSize()
{
- return getPreferredSize();
+ if (prefSize == null)
+ if (peer == null)
+ return new Dimension(width, height);
+ else
+ prefSize = peer.getPreferredSize();
+ return prefSize;
}
/**
@@ -1480,10 +1481,7 @@ public abstract class Component
*/
public Dimension getMinimumSize()
{
- if (minSize == null)
- minSize = (peer != null ? peer.getMinimumSize()
- : new Dimension(width, height));
- return minSize;
+ return minimumSize();
}
/**
@@ -1494,7 +1492,10 @@ public abstract class Component
*/
public Dimension minimumSize()
{
- return getMinimumSize();
+ if (minSize == null)
+ minSize = (peer != null ? peer.getMinimumSize()
+ : new Dimension(width, height));
+ return minSize;
}
/**
@@ -1865,12 +1866,17 @@ public abstract class Component
* @param height the height of the image
* @return the requested image, or null if it is not supported
*/
- public Image createImage(int width, int height)
+ public Image createImage (int width, int height)
{
- if (GraphicsEnvironment.isHeadless())
- return null;
- GraphicsConfiguration config = getGraphicsConfiguration();
- return config == null ? null : config.createCompatibleImage(width, height);
+ Image returnValue = null;
+ if (!GraphicsEnvironment.isHeadless ())
+ {
+ if (isLightweight () && parent != null)
+ returnValue = parent.createImage (width, height);
+ else if (peer != null)
+ returnValue = peer.createImage (width, height);
+ }
+ return returnValue;
}
/**
@@ -1941,7 +1947,10 @@ public abstract class Component
public boolean prepareImage(Image image, int width, int height,
ImageObserver observer)
{
- return peer.prepareImage(image, width, height, observer);
+ if (peer != null)
+ return peer.prepareImage(image, width, height, observer);
+ else
+ return getToolkit().prepareImage(image, width, height, observer);
}
/**
@@ -1957,8 +1966,7 @@ public abstract class Component
*/
public int checkImage(Image image, ImageObserver observer)
{
- return checkImage(image, image.getWidth(observer),
- image.getHeight(observer), observer);
+ return checkImage(image, -1, -1, observer);
}
/**
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
index 72812cbc2aa..e96b13d4bb5 100644
--- a/libjava/java/awt/Container.java
+++ b/libjava/java/awt/Container.java
@@ -473,7 +473,7 @@ public class Container extends Component
{
synchronized (getTreeLock ())
{
- if (! isValid())
+ if (! isValid() && peer != null)
{
validateTree();
}
@@ -535,10 +535,7 @@ public class Container extends Component
*/
public Dimension getPreferredSize()
{
- if (layoutMgr != null)
- return layoutMgr.preferredLayoutSize(this);
- else
- return super.getPreferredSize();
+ return preferredSize();
}
/**
@@ -550,7 +547,10 @@ public class Container extends Component
*/
public Dimension preferredSize()
{
- return getPreferredSize();
+ if (layoutMgr != null)
+ return layoutMgr.preferredLayoutSize(this);
+ else
+ return super.preferredSize();
}
/**
@@ -560,10 +560,7 @@ public class Container extends Component
*/
public Dimension getMinimumSize()
{
- if (layoutMgr != null)
- return layoutMgr.minimumLayoutSize(this);
- else
- return super.getMinimumSize();
+ return minimumSize();
}
/**
@@ -575,7 +572,10 @@ public class Container extends Component
*/
public Dimension minimumSize()
{
- return getMinimumSize();
+ if (layoutMgr != null)
+ return layoutMgr.minimumLayoutSize(this);
+ else
+ return super.minimumSize();
}
/**
@@ -658,6 +658,7 @@ public class Container extends Component
*/
public void update(Graphics g)
{
+ g.clearRect(0, 0, width, height);
super.update(g);
}
diff --git a/libjava/java/awt/Dialog.java b/libjava/java/awt/Dialog.java
index aba409812aa..eee8361146a 100644
--- a/libjava/java/awt/Dialog.java
+++ b/libjava/java/awt/Dialog.java
@@ -70,7 +70,7 @@ private boolean modal;
/**
* @serial Indicates whether or not this dialog box is resizable.
*/
-private boolean resizable;
+private boolean resizable = true;
/**
* @serial The title string for this dialog box, which can be
@@ -91,7 +91,7 @@ private String title;
/**
* Initializes a new instance of <code>Dialog</code> with the specified
- * parent, that is not resizable and not modal, and which has no title.
+ * parent, that is resizable and not modal, and which has no title.
*
* @param parent The parent frame of this dialog box.
*
@@ -109,7 +109,7 @@ Dialog(Frame parent)
/**
* Initializes a new instance of <code>Dialog</code> with the specified
- * parent and modality, that is not resizable and which has no title.
+ * parent and modality, that is resizable and which has no title.
*
* @param parent The parent frame of this dialog box.
* @param modal <true> if this dialog box is modal, <code>false</code>
@@ -129,7 +129,7 @@ Dialog(Frame parent, boolean modal)
/**
* Initializes a new instance of <code>Dialog</code> with the specified
- * parent, that is not resizable and not modal, and which has the specified
+ * parent, that is resizable and not modal, and which has the specified
* title.
*
* @param parent The parent frame of this dialog box.
@@ -149,7 +149,7 @@ Dialog(Frame parent, String title)
/**
* Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, title, and modality, that is not resizable.
+ * parent, title, and modality, that is resizable.
*
* @param parent The parent frame of this dialog box.
* @param title The title string for this dialog box.
@@ -168,7 +168,7 @@ Dialog(Frame parent, String title, boolean modal)
/**
* Initializes a new instance of <code>Dialog</code> with the specified,
* parent, title, modality and <code>GraphicsConfiguration</code>,
- * that is not resizable.
+ * that is resizable.
*
* @param parent The parent frame of this dialog box.
* @param title The title string for this dialog box.
@@ -189,14 +189,14 @@ Dialog (Frame parent, String title, boolean modal, GraphicsConfiguration gc)
this.title = title;
this.modal = modal;
- resizable = false;
+ visible = false;
setLayout(new BorderLayout());
}
/**
* Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, that is not resizable.
+ * parent, that is resizable.
*
* @exception IllegalArgumentException If parent is null. This exception is
* always thrown when GraphicsEnvironment.isHeadless() returns true.
@@ -211,7 +211,7 @@ Dialog (Dialog owner)
/**
* Initializes a new instance of <code>Dialog</code> with the specified,
- * parent and title, that is not resizable.
+ * parent and title, that is resizable.
*
* @exception IllegalArgumentException If parent is null. This exception is
* always thrown when GraphicsEnvironment.isHeadless() returns true.
@@ -226,7 +226,7 @@ Dialog (Dialog owner, String title)
/**
* Initializes a new instance of <code>Dialog</code> with the specified,
- * parent, title and modality, that is not resizable.
+ * parent, title and modality, that is resizable.
*
* @exception IllegalArgumentException If parent is null. This exception is
* always thrown when GraphicsEnvironment.isHeadless() returns true.
@@ -242,7 +242,7 @@ Dialog (Dialog owner, String title, boolean modal)
/**
* Initializes a new instance of <code>Dialog</code> with the specified,
* parent, title, modality and <code>GraphicsConfiguration</code>,
- * that is not resizable.
+ * that is resizable.
*
* @exception IllegalArgumentException If parent is null, the
* GraphicsConfiguration is not a screen device or
@@ -255,10 +255,10 @@ Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc)
{
super (parent, parent.getGraphicsConfiguration ());
- this.modal = modal;
this.title = title;
- resizable = false;
-
+ this.modal = modal;
+ visible = false;
+
setLayout (new BorderLayout ());
}
diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java
index d6204cefd9a..45dc9713b6e 100644
--- a/libjava/java/awt/EventQueue.java
+++ b/libjava/java/awt/EventQueue.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,6 +37,8 @@ exception statement from your version. */
package java.awt;
+import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
import java.awt.event.InvocationEvent;
import java.lang.reflect.InvocationTargetException;
import java.util.EmptyStackException;
@@ -44,7 +46,7 @@ import java.util.EmptyStackException;
/* Written using on-line Java 2 Platform Standard Edition v1.3 API
* Specification, as well as "The Java Class Libraries", 2nd edition
* (Addison-Wesley, 1998).
- * Status: Believed complete, but untested. Check FIXME's.
+ * Status: Believed complete, but untested.
*/
/**
@@ -65,6 +67,8 @@ public class EventQueue
private EventQueue next;
private EventQueue prev;
+ private AWTEvent currentEvent;
+ private long lastWhen = System.currentTimeMillis();
private EventDispatchThread dispatchThread = new EventDispatchThread(this);
@@ -162,7 +166,6 @@ public class EventQueue
next.postEvent(evt);
return;
}
- // FIXME: Security checks?
/* Check for any events already on the queue with the same source
and ID. */
@@ -249,6 +252,10 @@ public class EventQueue
}
/**
+ * This arranges for runnable to have its run method called in the
+ * dispatch thread of the EventQueue. This will happen after all
+ * pending events are processed.
+ *
* @since 1.2
*/
public static void invokeLater(Runnable runnable)
@@ -261,6 +268,10 @@ public class EventQueue
eq.postEvent(ie);
}
+ /**
+ * Return true if the current thread is the AWT event dispatch
+ * thread.
+ */
public static boolean isDispatchThread()
{
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
@@ -268,6 +279,21 @@ public class EventQueue
}
/**
+ * Return the event currently being dispatched by the event
+ * dispatch thread. If the current thread is not the event
+ * dispatch thread, this method returns null.
+ *
+ * @since 1.4
+ */
+ public static AWTEvent getCurrentEvent()
+ {
+ EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ if (Thread.currentThread() != eq.dispatchThread)
+ return null;
+ return eq.currentEvent;
+ }
+
+ /**
* Allows a custom EventQueue implementation to replace this one.
* All pending events are transferred to the new queue. Calls to postEvent,
* getNextEvent, and peekEvent are forwarded to the pushed queue until it
@@ -332,6 +358,15 @@ public class EventQueue
*/
protected void dispatchEvent(AWTEvent evt)
{
+ currentEvent = evt;
+
+ if (evt instanceof InputEvent)
+ lastWhen = ((InputEvent) evt).getWhen();
+ else if (evt instanceof ActionEvent)
+ lastWhen = ((ActionEvent) evt).getWhen();
+ else if (evt instanceof InvocationEvent)
+ lastWhen = ((InvocationEvent) evt).getWhen();
+
if (evt instanceof ActiveEvent)
{
ActiveEvent active_evt = (ActiveEvent) evt;
@@ -373,7 +408,9 @@ public class EventQueue
*/
public static long getMostRecentEventTime()
{
- // XXX For now, this ONLY does the current time.
- return System.currentTimeMillis();
+ EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ if (Thread.currentThread() != eq.dispatchThread)
+ return System.currentTimeMillis();
+ return eq.lastWhen;
}
}
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index b887d8ea5ed..d1ff566e559 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -39,10 +39,20 @@ exception statement from your version. */
package java.awt;
import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
import java.awt.font.LineMetrics;
+import java.awt.font.TextAttribute;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
import java.awt.peer.FontPeer;
+import java.io.InputStream;
+import java.io.IOException;
import java.io.Serializable;
+import java.util.Locale;
+import java.util.Map;
import java.util.StringTokenizer;
+import java.text.CharacterIterator;
+import java.text.AttributedCharacterIterator;
/**
* This class represents a windowing system font.
@@ -72,9 +82,20 @@ public static final int BOLD = 1;
*/
public static final int ITALIC = 2;
+/**
+ * Constant indicating the baseline mode characteristic of Roman.
+ */
public static final int ROMAN_BASELINE = 0;
+
+/**
+ * Constant indicating the baseline mode characteristic of Chinese.
+ */
public static final int CENTER_BASELINE = 1;
-public static final int HANGING_BASELINE = 2;
+
+/**
+ * Constant indicating the baseline mode characteristic of Devanigri.
+ */
+public static final int HANGING_BASELINE = 2;
/**
@@ -294,6 +315,12 @@ Font(String name, int style, int size)
this.pointSize = size;
}
+public
+Font(Map attributes)
+{
+ throw new UnsupportedOperationException();
+}
+
/*************************************************************************/
/*
@@ -301,9 +328,15 @@ Font(String name, int style, int size)
*/
/**
- * Returns the name of the font.
+ * Returns the logical name of the font. A logical name describes a very
+ * general typographic style (such as Sans Serif). It is less specific
+ * than both a font family name (such as Helvetica) and a font face name
+ * (such as Helvetica Bold).
*
- * @return The name of the font.
+ * @return The logical name of the font.
+ *
+ * @see getFamily()
+ * @see getFontName()
*/
public String
getName()
@@ -385,9 +418,18 @@ isItalic()
/*************************************************************************/
/**
- * Returns the system specific font family name.
+ * Returns the family name of this font. A family name describes a
+ * typographic style (such as Helvetica or Palatino). It is more specific
+ * than a logical font name (such as Sans Serif) but less specific than a
+ * font face name (such as Helvetica Bold).
+ *
+ * @return A string containing the font family name.
+ *
+ * @since 1.2
*
- * @return The system specific font family name.
+ * @see getName()
+ * @see getFontName()
+ * @see GraphicsEnvironment.getAvailableFontFamilyNames()
*/
public String
getFamily()
@@ -396,12 +438,744 @@ getFamily()
return(name);
}
+/**
+ * Returns integer code representing the sum of style flags of this font, a
+ * combination of either {@link PLAIN}, {@link BOLD}, or {@link ITALIC}.
+ *
+ * @return code representing the style of this font.
+ *
+ * @see isPlain()
+ * @see isBold()
+ * @see isItalic()
+ */
public int
getStyle()
{
return style;
}
+/**
+ * Checks if specified character maps to a glyph in this font.
+ *
+ * @param c The character to check.
+ *
+ * @return Whether the character has a corresponding glyph in this font.
+ *
+ * @since 1.2
+ */
+public boolean
+canDisplay(char c)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Checks how much of a given string can be mapped to glyphs in
+ * this font.
+ *
+ * @param s The string to check.
+ *
+ * @return The index of the first character in <code>s</code> which cannot
+ * be converted to a glyph by this font, or <code>-1</code> if all
+ * characters can be mapped to glyphs.
+ *
+ * @since 1.2
+ */
+public int
+canDisplayUpTo(String s)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Checks how much of a given sequence of text can be mapped to glyphs in
+ * this font.
+ *
+ * @param text Array containing the text to check.
+ * @param start Position of first character to check in <code>text</code>.
+ * @param limit Position of last character to check in <code>text</code>.
+ *
+ * @return The index of the first character in the indicated range which
+ * cannot be converted to a glyph by this font, or <code>-1</code> if all
+ * characters can be mapped to glyphs.
+ *
+ * @since 1.2
+ *
+ * @throws IndexOutOfBoundsException if the range [start, limit] is
+ * invalid in <code>text</code>.
+ */
+public int
+canDisplayUpTo(char[] text, int start, int limit)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Checks how much of a given sequence of text can be mapped to glyphs in
+ * this font.
+ *
+ * @param i Iterator over the text to check.
+ * @param start Position of first character to check in <code>i</code>.
+ * @param limit Position of last character to check in <code>i</code>.
+ *
+ * @return The index of the first character in the indicated range which
+ * cannot be converted to a glyph by this font, or <code>-1</code> if all
+ * characters can be mapped to glyphs.
+ *
+ * @since 1.2
+ *
+ * @throws IndexOutOfBoundsException if the range [start, limit] is
+ * invalid in <code>i</code>.
+ */
+public int
+canDisplayUpTo(CharacterIterator i, int start, int limit)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Creates a new font with point size 1 and {@link PLAIN} style,
+ * reading font data from the provided input stream. The resulting font
+ * can have further fonts derived from it using its
+ * <code>deriveFont</code> method.
+ *
+ * @param fontFormat Integer code indicating the format the font data is
+ * in.Currently this can only be {@link TRUETYPE_FONT}.
+ * @param is {@link InputStream} from which font data will be read. This
+ * stream is not closed after font data is extracted.
+ *
+ * @return A new {@link Font} of the format indicated.
+ *
+ * @throws IllegalArgumentException if <code>fontType</code> is not
+ * recognized.
+ * @throws FontFormatException if data in InputStream is not of format
+ * indicated.
+ * @throws IOException if insufficient data is present on InputStream.
+ *
+ * @since 1.3
+ */
+public static Font
+createFont(int fontFormat, InputStream is)
+ throws FontFormatException, IOException
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Maps characters to glyphs in a one-to-one relationship, returning a new
+ * {@link GlyphVector} with a mapped glyph for each input character. This
+ * sort of mapping is often sufficient for some scripts such as Roman, but
+ * is inappropriate for scripts with special shaping or contextual layout
+ * requirements such as Arabic, Indic, Hebrew or Thai.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param str The string to convert to Glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, String str)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Maps characters to glyphs in a one-to-one relationship, returning a new
+ * {@link GlyphVector} with a mapped glyph for each input character. This
+ * sort of mapping is often sufficient for some scripts such as Roman, but
+ * is inappropriate for scripts with special shaping or contextual layout
+ * requirements such as Arabic, Indic, Hebrew or Thai.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param i Iterator over the text to convert to glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, CharacterIterator i)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Maps characters to glyphs in a one-to-one relationship, returning a new
+ * {@link GlyphVector} with a mapped glyph for each input character. This
+ * sort of mapping is often sufficient for some scripts such as Roman, but
+ * is inappropriate for scripts with special shaping or contextual layout
+ * requirements such as Arabic, Indic, Hebrew or Thai.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param chars Array of characters to convert to glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, char[] chars)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Extracts a sequence of glyphs from a font, returning a new {@link
+ * GlyphVector} with a mapped glyph for each input glyph code.
+ *
+ * @param ctx The rendering context used for precise glyph placement.
+ * @param chars Array of characters to convert to glyphs.
+ *
+ * @return A new {@link GlyphVector} containing glyphs mapped from str,
+ * through the font's cmap table.
+ *
+ * @see layoutGlyphVector()
+ *
+ * @specnote This method is documented to perform character-to-glyph
+ * conversions, in the Sun documentation, but its second parameter name is
+ * "glyphCodes" and it is not clear to me why it would exist if its
+ * purpose was to transport character codes inside integers. I assume it
+ * is mis-documented in the Sun documentation.
+ */
+public GlyphVector
+createGlyphVector(FontRenderContext ctx, int[] glyphCodes)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new size.
+ *
+ * @param size The size of the newly created font.
+ *
+ * @return A clone of the current font, with the specified size.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(float size)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new style.
+ *
+ * @param style The style of the newly created font.
+ *
+ * @return A clone of the current font, with the specified style.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(int style)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new style and subjected to a new affine transformation.
+ *
+ * @param style The style of the newly created font.
+ * @param a The transformation to apply.
+ *
+ * @return A clone of the current font, with the specified style and
+ * transform.
+ *
+ * @throws IllegalArgumentException If transformation is
+ * <code>null</code>.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(int style, AffineTransform a)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a new {@link Font} based on the current font, adjusted to a
+ * new set of attributes.
+ *
+ * @param attributes Attributes of the newly created font.
+ *
+ * @return A clone of the current font, with the specified attributes.
+ *
+ * @since 1.2
+ */
+public Font
+deriveFont(Map attributes)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a map of chracter attributes which this font currently has set.
+ *
+ * @return A map of chracter attributes which this font currently has set.
+ *
+ * @see getAvailableAttributes()
+ * @see java.text.AttributedCharacterIterator.Attribute
+ * @see java.awt.font.TextAttribute
+ */
+public Map
+getAttributes()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns an array of chracter attribute keys which this font understands.
+ *
+ * @return An array of chracter attribute keys which this font understands.
+ *
+ * @see getAttributes()
+ * @see java.text.AttributedCharacterIterator.Attribute
+ * @see java.awt.font.TextAttribute
+ */
+public AttributedCharacterIterator.Attribute[]
+getAvailableAttributes()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a baseline code (one of {@link ROMAN_BASELINE}, {@link
+ * CENTER_BASELINE} or {@link HANGING_BASELINE}) indicating which baseline
+ * this font will measure baseline offsets for, when presenting glyph
+ * metrics for a given character.
+ *
+ * Baseline offsets describe the position of a glyph relative to an
+ * invisible line drawn under, through the center of, or over a line of
+ * rendered text, respectively. Different scripts use different baseline
+ * modes, so clients should not assume all baseline offsets in a glyph
+ * vector are from a common baseline.
+ *
+ * @param c The character code to select a baseline mode for.
+ *
+ * @return The baseline mode which would be used in a glyph associated
+ * with the provided character.
+ *
+ * @since 1.2
+ *
+ * @see LineMetrics.getBaselineOffsets()
+ */
+public byte
+getBaselineFor(char c)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the family name of this font. A family name describes a
+ * typographic style (such as Helvetica or Palatino). It is more specific
+ * than a logical font name (such as Sans Serif) but less specific than a
+ * font face name (such as Helvetica Bold).
+ *
+ * @param lc The locale in which to describe the name of the font family.
+ *
+ * @return A string containing the font family name, localized for the
+ * provided locale.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFontName()
+ * @see GraphicsEnvironment.getAvailableFontFamilyNames()
+ * @see Locale
+ */
+public String
+getFamily(Locale lc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a font appropriate for the given attribute set.
+ *
+ * @param attributes The attributes required for the new font.
+ *
+ * @return A new Font with the given attributes.
+ *
+ * @since 1.2
+ *
+ * @see TextAttribure
+ */
+public static Font
+getFont(Map attributes)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the font face name of the font. A font face name describes a
+ * specific variant of a font family (such as Helvetica Bold). It is more
+ * specific than both a font family name (such as Helvetica) and a logical
+ * font name (such as Sans Serif).
+ *
+ * @return The font face name of the font.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFamily()
+ */
+public String
+getFontName()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the font face name of the font. A font face name describes a
+ * specific variant of a font family (such as Helvetica Bold). It is more
+ * specific than both a font family name (such as Helvetica) and a logical
+ * font name (such as Sans Serif).
+ *
+ * @param lc The locale in which to describe the name of the font face.
+ *
+ * @return A string containing the font face name, localized for the
+ * provided locale.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFamily()
+ */
+public String
+getFontName(Locale lc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the italic angle of this font, a measurement of its slant when
+ * style is {@link ITALIC}. The precise meaning is the inverse slope of a
+ * caret line which "best measures" the font's italic posture.
+ *
+ * @return The italic angle.
+ *
+ * @see TextAttribute.POSTURE
+ */
+public float
+getItalicAngle()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a {@link LineMetrics} object constructed with the specified
+ * text and {@link FontRenderContext}.
+ *
+ * @param text The string to calculate metrics from.
+ * @param begin Index of first character in <code>text</code> to measure.
+ * @param limit Index of last character in <code>text</code> to measure.
+ * @param rc Context for calculating precise glyph placement and hints.
+ *
+ * @return A new {@link LineMetrics} object.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>text</code>.
+ */
+public LineMetrics
+getLineMetrics(String text, int begin, int limit, FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a {@link LineMetrics} object constructed with the specified
+ * text and {@link FontRenderContext}.
+ *
+ * @param chars The string to calculate metrics from.
+ * @param begin Index of first character in <code>text</code> to measure.
+ * @param limit Index of last character in <code>text</code> to measure.
+ * @param rc Context for calculating precise glyph placement and hints.
+ *
+ * @return A new {@link LineMetrics} object.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>chars</code>.
+ */
+public LineMetrics
+getLineMetrics(char[] chars, int begin, int limit, FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a {@link LineMetrics} object constructed with the specified
+ * text and {@link FontRenderContext}.
+ *
+ * @param ci The string to calculate metrics from.
+ * @param begin Index of first character in <code>text</code> to measure.
+ * @param limit Index of last character in <code>text</code> to measure.
+ * @param rc Context for calculating precise glyph placement and hints.
+ *
+ * @return A new {@link LineMetrics} object.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>ci</code>.
+ */
+public LineMetrics
+getLineMetrics(CharacterIterator ci, int begin, int limit, FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the maximal bounding box of all the bounding boxes in this
+ * font, when the font's bounding boxes are evaluated in a given {@link
+ * FontRenderContext}
+ *
+ * @param rc Context in which to evaluate bounding boxes.
+ *
+ * @return The maximal bounding box.
+ */
+public Rectangle2D
+getMaxCharBounds(FontRenderContext rc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the glyph code this font uses to represent missing glyphs. This
+ * code will be present in glyph vectors when the font was unable to
+ * locate a glyph to represent a particular character code.
+ *
+ * @return The missing glyph code.
+ *
+ * @since 1.2
+ */
+public int
+getMissingGlyphCode()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the overall number of glyphs in this font. This number is one
+ * more than the greatest glyph code used in any glyph vectors this font
+ * produces. In other words, glyph codes are taken from the range
+ * <code>[ 0, getNumGlyphs() - 1 ]</code>.
+ *
+ * @return The number of glyphs in this font.
+ *
+ * @since 1.2
+ */
+public int
+getNumGlyphs()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the PostScript Name of this font.
+ *
+ * @return The PostScript Name of this font.
+ *
+ * @since 1.2
+ *
+ * @see getName()
+ * @see getFamily()
+ * @see getFontName()
+ */
+public String
+getPSName()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param str The string to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(String str, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param str The string to measure.
+ * @param begin Index of the first character in <code>str</code> to measure.
+ * @param limit Index of the last character in <code>str</code> to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>str</code>.
+ *
+ * @since 1.2
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(String str, int begin, int limit, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param ci The text to measure.
+ * @param begin Index of the first character in <code>ci</code> to measure.
+ * @param limit Index of the last character in <code>ci</code> to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>ci</code>.
+ *
+ * @since 1.2
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(CharacterIterator ci, int begin, int limit, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns the logical bounds of the specified string when rendered with this
+ * font in the specified {@link FontRenderContext}. This box will include the
+ * glyph origin, ascent, advance, height, and leading, but may not include all
+ * diacritics or accents. To get the complete visual bounding box of all the
+ * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
+ * {@link TextLayout}.
+ *
+ * @param chars The text to measure.
+ * @param begin Index of the first character in <code>ci</code> to measure.
+ * @param limit Index of the last character in <code>ci</code> to measure.
+ * @param frc The context in which to make the precise glyph measurements.
+ *
+ * @return A bounding box covering the logical bounds of the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>chars</code>.
+ *
+ * @since 1.2
+ *
+ * @see createGlyphVector()
+ */
+public Rectangle2D
+getStringBounds(char[] chars, int begin, int limit, FontRenderContext frc)
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Returns a copy of the affine transformation this font is currently
+ * subject to, if any.
+ *
+ * @return The current transformation.
+ */
+public AffineTransform
+getTransform()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Indicates whether this font's line metrics are uniform. A font may be
+ * composed of several "subfonts", each covering a different code range,
+ * and each with their own line metrics. A font with no subfonts, or
+ * subfonts with identical line metrics, is said to have "uniform" line
+ * metrics.
+ *
+ * @return Whether this font has uniform line metrics.
+ *
+ * @see LineMetrics
+ * @see getLineMetrics()
+ */
+public boolean
+hasUniformLineMetrics()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Indicates whether this font is subject to a non-identity affine
+ * transformation.
+ *
+ * @return <code>true</code> iff the font has a non-identity affine
+ * transformation applied to it.
+ */
+public boolean
+isTransformed()
+{
+ throw new UnsupportedOperationException ();
+}
+
+/**
+ * Produces a glyph vector representing a full layout fo the specified
+ * text in this font. Full layouts may include complex shaping and
+ * reordering operations, for scripts such as Arabic or Hindi.
+ *
+ * Bidirectional (bidi) layout is not performed in this method; text
+ * should have its bidi direction specified with one of the flags {@link
+ * LAYOUT_LEFT_TO_RIGHT} or {@link LAYOUT_RIGHT_TO_LEFT}.
+ *
+ * Some types of layout (notably Arabic glyph shaping) may examine context
+ * characters beyond the bounds of the indicated range, in order to select
+ * an appropriate shape. The flags {@link LAYOUT_NO_START_CONTEXT} and
+ * {@link LAYOUT_NO_LIMIT_CONTEXT} can be provided to prevent these extra
+ * context areas from being examined, for instance if they contain invalid
+ * characters.
+ *
+ * @param frc Context in which to perform the layout.
+ * @param chars Text to perform layout on.
+ * @param start Index of first character to perform layout on.
+ * @param limit Index of last character to perform layout on.
+ * @param flags Combination of flags controlling layout.
+ *
+ * @return A new {@link GlyphVector} representing the specified text.
+ *
+ * @throws IndexOutOfBoundsException if the range [begin, limit] is
+ * invalid in <code>chars</code>.
+ */
+public GlyphVector
+layoutGlyphVector(FontRenderContext frc, char[] chars, int start, int limit, int flags)
+{
+ throw new UnsupportedOperationException ();
+}
+
+
/*************************************************************************/
/**
diff --git a/libjava/java/awt/Frame.java b/libjava/java/awt/Frame.java
index 82fed1656ae..b6a34272449 100644
--- a/libjava/java/awt/Frame.java
+++ b/libjava/java/awt/Frame.java
@@ -237,12 +237,15 @@ Frame(String title)
{
super();
this.title = title;
+ // Top-level frames are initially invisible.
+ visible = false;
}
public
Frame(GraphicsConfiguration gc)
{
super(gc);
+ visible = false;
}
public
@@ -250,6 +253,7 @@ Frame(String title, GraphicsConfiguration gc)
{
super(gc);
setTitle(title);
+ visible = false;
}
/*************************************************************************/
@@ -434,25 +438,6 @@ addNotify()
/*************************************************************************/
/**
- * Destroys any resources associated with this frame. This includes
- * all components in the frame and all owned toplevel windows.
- */
-public void
-dispose()
-{
- Enumeration e = ownedWindows.elements();
- while(e.hasMoreElements())
- {
- Window w = (Window)e.nextElement();
- w.dispose();
- }
-
- super.dispose();
-}
-
-/*************************************************************************/
-
-/**
* Returns a debugging string describing this window.
*
* @return A debugging string describing this window.
@@ -468,8 +453,6 @@ getFrames()
{
//Frame[] array = new Frames[frames.size()];
//return frames.toArray(array);
-
- // see finalize() comment
String msg = "FIXME: can't be implemented without weak references";
throw new UnsupportedOperationException(msg);
}
diff --git a/libjava/java/awt/GridBagLayout.java b/libjava/java/awt/GridBagLayout.java
index dc2b3c9fd69..dd49a1cf905 100644
--- a/libjava/java/awt/GridBagLayout.java
+++ b/libjava/java/awt/GridBagLayout.java
@@ -1,5 +1,5 @@
/* GridBagLayout - Layout manager for components according to GridBagConstraints
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,64 +35,644 @@ 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;
import java.io.Serializable;
+import java.util.Hashtable;
/**
- * Stub implementation.
+ * @author Michael Koch <konqueror@gmx.de>
+ * @author Jeroen Frijters <jeroen@frijters.net>
*/
public class GridBagLayout
- implements Serializable, LayoutManager2
+ implements Serializable, LayoutManager2
{
- static final long serialVersionUID = 8838754796412211005L;
-
- public void addLayoutComponent(String name, Component component)
- {
- }
-
- public void removeLayoutComponent(Component component)
- {
- }
-
- public Dimension preferredLayoutSize(Container parent)
- {
- return null;
- }
-
- public Dimension minimumLayoutSize(Container parent)
- {
- return null;
- }
-
- public void layoutContainer(Container parent)
- {
- }
-
- public void addLayoutComponent(Component component, Object contraint)
- {
- }
-
- public Dimension maximumLayoutSize(Container target)
- {
- return null;
- }
-
- public float getLayoutAlignmentX(Container target)
- {
- return 0.0f;
- }
-
- public float getLayoutAlignmentY(Container target)
- {
- return 0.0f;
- }
-
- public void invalidateLayout(Container target)
- {
- }
-
- public void setConstraints(Component comp, GridBagConstraints constraints)
- {
- }
+ private static final long serialVersionUID = 8838754796412211005L;
+
+ protected static final int MINSIZE = 1;
+ protected static final int PREFERREDSIZE = 2;
+ protected static final int MAXGRIDSIZE = 512;
+
+ protected Hashtable comptable;
+ protected GridBagLayoutInfo layoutInfo;
+ protected GridBagConstraints defaultConstraints;
+
+ public double[] columnWeights;
+ public int[] columnWidths;
+ public double[] rowWeights;
+ public int[] rowHeights;
+
+ public GridBagLayout ()
+ {
+ this.comptable = new Hashtable();
+ this.defaultConstraints= new GridBagConstraints();
+ }
+
+ /**
+ * Helper method to calc the sum of a range of elements in an int array.
+ */
+ private int sumIntArray (int[] array, int upto)
+ {
+ int result = 0;
+
+ for (int i = 0; i < upto; i++)
+ result += array [i];
+
+ return result;
+ }
+
+ /**
+ * Helper method to calc the sum of all elements in an int array.
+ */
+ private int sumIntArray (int[] array)
+ {
+ return sumIntArray(array, array.length);
+ }
+
+ /**
+ * Helper method to calc the sum of all elements in an double array.
+ */
+ private double sumDoubleArray (double[] array)
+ {
+ double result = 0;
+
+ for (int i = 0; i < array.length; i++)
+ result += array [i];
+
+ return result;
+ }
+
+ public void addLayoutComponent (String name, Component component)
+ {
+ // do nothing here.
+ }
+
+ public void removeLayoutComponent (Component component)
+ {
+ // do nothing here
+ }
+
+ public void addLayoutComponent (Component component, Object constraints)
+ {
+ if (constraints == null)
+ return;
+
+ if (!(constraints instanceof GridBagConstraints))
+ throw new IllegalArgumentException();
+
+ setConstraints (component, (GridBagConstraints) constraints);
+ }
+
+ public Dimension preferredLayoutSize (Container parent)
+ {
+ if (parent == null)
+ return new Dimension (0, 0);
+
+ GridBagLayoutInfo li = getLayoutInfo (parent, PREFERREDSIZE);
+ return getMinSize (parent, li);
+ }
+
+ public Dimension minimumLayoutSize (Container parent)
+ {
+ if (parent == null)
+ return new Dimension (0, 0);
+
+ GridBagLayoutInfo li = getLayoutInfo (parent, MINSIZE);
+ return getMinSize (parent, li);
+ }
+
+ public Dimension maximumLayoutSize (Container target)
+ {
+ return new Dimension (Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+
+ public void layoutContainer (Container parent)
+ {
+ arrangeGrid (parent);
+ }
+
+ public float getLayoutAlignmentX (Container target)
+ {
+ return Component.CENTER_ALIGNMENT;
+ }
+
+ public float getLayoutAlignmentY (Container target)
+ {
+ return Component.CENTER_ALIGNMENT;
+ }
+
+ public void invalidateLayout (Container target)
+ {
+ this.layoutInfo = null;
+ }
+
+ public void setConstraints (Component component,
+ GridBagConstraints constraints)
+ {
+ GridBagConstraints clone = (GridBagConstraints) constraints.clone();
+
+ if (clone.gridx < 0)
+ clone.gridx = GridBagConstraints.RELATIVE;
+
+ if (clone.gridy < 0)
+ clone.gridy = GridBagConstraints.RELATIVE;
+
+ if (clone.gridwidth == 0)
+ clone.gridwidth = GridBagConstraints.REMAINDER;
+ else if (clone.gridwidth < 0
+ && clone.gridwidth != GridBagConstraints.REMAINDER
+ && clone.gridwidth != GridBagConstraints.RELATIVE)
+ clone.gridwidth = 1;
+
+ if (clone.gridheight == 0)
+ clone.gridheight = GridBagConstraints.REMAINDER;
+ else if (clone.gridheight < 0
+ && clone.gridheight != GridBagConstraints.REMAINDER
+ && clone.gridheight != GridBagConstraints.RELATIVE)
+ clone.gridheight = 1;
+
+ comptable.put (component, clone);
+ }
+
+ public GridBagConstraints getConstraints (Component component)
+ {
+ return (GridBagConstraints) (lookupConstraints (component).clone());
+ }
+
+ protected GridBagConstraints lookupConstraints (Component component)
+ {
+ GridBagConstraints result = (GridBagConstraints) comptable.get (component);
+
+ if (result == null)
+ {
+ setConstraints (component, defaultConstraints);
+ result = (GridBagConstraints) comptable.get (component);
+ }
+
+ return result;
+ }
+
+ /**
+ * @since 1.1
+ */
+ public Point getLayoutOrigin ()
+ {
+ if (layoutInfo == null)
+ return new Point (0, 0);
+
+ return new Point (layoutInfo.pos_x, layoutInfo.pos_y);
+ }
+
+ /**
+ * @since 1.1
+ */
+ public int[][] getLayoutDimensions ()
+ {
+ if (layoutInfo == null)
+ return new int [2][];
+
+ 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];
+ System.arraycopy (layoutInfo.rowHeights, 0, result [1], 0, layoutInfo.rows);
+ return result;
+ }
+
+ public double[][] getLayoutWeights ()
+ {
+ if (layoutInfo == null)
+ return new double [2][];
+
+ double[][] result = new double [2][];
+ result [0] = new double [layoutInfo.cols];
+ System.arraycopy (layoutInfo.colWeights, 0, result [0], 0, layoutInfo.cols);
+ result [1] = new double [layoutInfo.rows];
+ System.arraycopy (layoutInfo.rowWeights, 0, result [1], 0, layoutInfo.rows);
+ return result;
+ }
+
+ /**
+ * @since 1.1
+ */
+ public Point location (int x, int y)
+ {
+ if (layoutInfo == null)
+ return new Point (0, 0);
+
+ int col;
+ int row;
+ int pixel_x = layoutInfo.pos_x;
+ int pixel_y = layoutInfo.pos_y;
+
+ for (col = 0; col < layoutInfo.cols; col++)
+ {
+ int w = layoutInfo.colWidths [col];
+ if (x < pixel_x + w)
+ break;
+
+ pixel_x += w;
+ }
+
+ for (row = 0; row < layoutInfo.rows; row++)
+ {
+ int h = layoutInfo.rowHeights [row];
+ if (y < pixel_y + h)
+ break;
+
+ pixel_y += h;
+ }
+
+ return new Point (col, row);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected void AdjustForGravity (GridBagConstraints gbc, Rectangle rect)
+ {
+ adjustForGravity (gbc, rect);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected void ArrangeGrid (Container parent)
+ {
+ arrangeGrid (parent);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected GridBagLayoutInfo GetLayoutInfo (Container parent, int sizeflag)
+ {
+ return getLayoutInfo (parent, sizeflag);
+ }
+
+ /**
+ * Obsolete.
+ */
+ protected Dimension GetMinSize (Container parent, GridBagLayoutInfo info)
+ {
+ return getMinSize (parent, info);
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected Dimension getMinSize (Container parent, GridBagLayoutInfo info)
+ {
+ if (parent == null || info == null)
+ return new Dimension (0, 0);
+
+ Insets insets = parent.getInsets();
+ int width = sumIntArray (info.colWidths) + insets.left + insets.right;
+ int height = sumIntArray (info.rowHeights) + insets.top + insets.bottom;
+ return new Dimension (width, height);
+ }
+
+ private void calcCellSizes (int[] sizes, double[] weights, int range)
+ {
+ int diff = range - sumIntArray (sizes);
+
+ if (diff == 0)
+ return;
+
+ double weight = sumDoubleArray (weights);
+
+ for (int i = 0; i < sizes.length; i++)
+ {
+ sizes [i] += (int) (((double) diff) * weights [i] / weight );
+
+ if (sizes [i] < 0)
+ sizes [i] = 0;
+ }
+ }
+
+ private void dumpLayoutInfo (GridBagLayoutInfo info)
+ {
+ System.out.println ("GridBagLayoutInfo:");
+ System.out.println ("cols: " + info.cols + ", rows: " + info.rows);
+ System.out.print ("colWidths: ");
+ dumpArray(info.colWidths);
+ System.out.print ("rowHeights: ");
+ dumpArray(info.rowHeights);
+ System.out.print ("colWeights: ");
+ dumpArray(info.colWeights);
+ System.out.print ("rowWeights: ");
+ dumpArray(info.rowWeights);
+ }
+
+ private void dumpArray(int[] array)
+ {
+ String sep = "";
+ for(int i = 0; i < array.length; i++)
+ {
+ System.out.print(sep);
+ System.out.print(array[i]);
+ sep = ", ";
+ }
+ System.out.println();
+ }
+
+ private void dumpArray(double[] array)
+ {
+ String sep = "";
+ for(int i = 0; i < array.length; i++)
+ {
+ System.out.print(sep);
+ System.out.print(array[i]);
+ sep = ", ";
+ }
+ System.out.println();
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected void arrangeGrid (Container parent)
+ {
+ Component[] components = parent.getComponents();
+
+ if (components.length == 0)
+ return;
+
+ GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE);
+ if (info.cols == 0 && info.rows == 0)
+ return;
+ layoutInfo = info;
+
+ // DEBUG
+ //dumpLayoutInfo (layoutInfo);
+
+ for(int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ int cellx = sumIntArray(layoutInfo.colWidths, constraints.gridx);
+ int celly = sumIntArray(layoutInfo.rowHeights, constraints.gridy);
+ int cellw = sumIntArray(layoutInfo.colWidths,
+ constraints.gridx + constraints.gridwidth) - cellx;
+ int cellh = sumIntArray(layoutInfo.rowHeights,
+ constraints.gridy + constraints.gridheight) - celly;
+
+ Insets insets = constraints.insets;
+ if (insets != null)
+ {
+ cellx += insets.left;
+ celly += insets.top;
+ cellw -= insets.left + insets.right;
+ cellh -= insets.top + insets.bottom;
+ }
+
+ Dimension dim = component.preferredSize();
+
+ // Note: Documentation says that padding is added on both sides, but
+ // visual inspection shows that the Sun implementation only adds it
+ // once, so we do the same.
+ dim.width += constraints.ipadx;
+ dim.height += constraints.ipady;
+
+ switch(constraints.fill)
+ {
+ case GridBagConstraints.HORIZONTAL:
+ dim.width = cellw;
+ break;
+ case GridBagConstraints.VERTICAL:
+ dim.height = cellh;
+ break;
+ case GridBagConstraints.BOTH:
+ dim.width = cellw;
+ dim.height = cellh;
+ break;
+ }
+
+ int x;
+ int y;
+
+ switch(constraints.anchor)
+ {
+ case GridBagConstraints.NORTH:
+ x = cellx + (cellw - dim.width) / 2;
+ y = celly;
+ break;
+ case GridBagConstraints.SOUTH:
+ x = cellx + (cellw - dim.width) / 2;
+ y = celly + cellh - dim.height;
+ break;
+ case GridBagConstraints.WEST:
+ x = cellx;
+ y = celly + (cellh - dim.height) / 2;
+ break;
+ case GridBagConstraints.EAST:
+ x = cellx + cellw - dim.width;
+ y = celly + (cellh - dim.height) / 2;
+ break;
+ case GridBagConstraints.NORTHEAST:
+ x = cellx + cellw - dim.width;
+ y = celly;
+ break;
+ case GridBagConstraints.NORTHWEST:
+ x = cellx;
+ y = celly;
+ break;
+ case GridBagConstraints.SOUTHEAST:
+ x = cellx + cellw - dim.width;
+ y = celly + cellh - dim.height;
+ break;
+ case GridBagConstraints.SOUTHWEST:
+ x = cellx;
+ y = celly + cellh - dim.height;
+ break;
+ default:
+ x = cellx + (cellw - dim.width) / 2;
+ y = celly + (cellh - dim.height) / 2;
+ break;
+ }
+
+ component.setBounds(layoutInfo.pos_x + x, layoutInfo.pos_y + y, dim.width, dim.height);
+ }
+
+ // DEBUG
+ //dumpLayoutInfo (layoutInfo);
+
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected GridBagLayoutInfo getLayoutInfo (Container parent, int sizeflag)
+ {
+ if (sizeflag != MINSIZE && sizeflag != PREFERREDSIZE)
+ throw new IllegalArgumentException();
+
+ Dimension parentDim = parent.size();
+ Insets parentInsets = parent.insets();
+ parentDim.width -= parentInsets.left + parentInsets.right;
+ parentDim.height -= parentInsets.top + parentInsets.bottom;
+
+ int x = 0;
+ int y = 0;
+ int max_x = 0;
+ int max_y = 0;
+
+ // first we figure out how many rows/columns
+ Component[] components = parent.getComponents();
+ for (int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ if(constraints.gridx == GridBagConstraints.RELATIVE)
+ constraints.gridx = x;
+
+ if(constraints.gridy == GridBagConstraints.RELATIVE)
+ constraints.gridy = y;
+
+ max_x = Math.max(max_x,
+ constraints.gridx + Math.max(1, constraints.gridwidth));
+ max_y = Math.max(max_y,
+ constraints.gridy + Math.max(1, constraints.gridheight));
+
+ if(constraints.gridwidth == GridBagConstraints.REMAINDER)
+ {
+ x = 0;
+ y++;
+ }
+ else
+ {
+ x = constraints.gridx + Math.max(1, constraints.gridwidth);
+ y = constraints.gridy;
+ }
+ }
+
+ GridBagLayoutInfo info = new GridBagLayoutInfo(max_x, max_y);
+
+ for (x = 0; x <= max_x; x++)
+ {
+ if(columnWidths != null && columnWidths.length > x)
+ {
+ info.colWidths[x] = columnWidths[x];
+ }
+ if(columnWeights != null && columnWeights.length > x)
+ {
+ info.colWeights[x] = columnWeights[x];
+ }
+ for (int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ // first we fix up any REMAINDER cells
+ if(constraints.gridwidth == GridBagConstraints.REMAINDER)
+ {
+ constraints.gridwidth = max_x - constraints.gridx;
+ }
+ if(constraints.gridheight == GridBagConstraints.REMAINDER)
+ {
+ constraints.gridheight = max_y - constraints.gridy;
+ }
+
+ if(constraints.gridx + constraints.gridwidth - 1 == x)
+ {
+ int width = (sizeflag == PREFERREDSIZE) ?
+ component.preferredSize().width :
+ component.minimumSize().width;
+ if(constraints.insets != null)
+ {
+ width += constraints.insets.left + constraints.insets.right;
+ }
+ width += constraints.ipadx;
+ for(int w = 1; w < constraints.gridwidth; w++)
+ {
+ width -= info.colWidths[x - w];
+ }
+ info.colWidths[x] = Math.max(info.colWidths[x], width);
+ info.colWeights[x] =
+ Math.max(info.colWeights[x], constraints.weightx);
+ }
+ }
+ }
+
+ for (y = 0; y <= max_y; y++)
+ {
+ if(rowHeights != null && rowHeights.length > y)
+ {
+ info.rowHeights[y] = rowHeights[y];
+ }
+ if(rowWeights != null && rowWeights.length > y)
+ {
+ info.rowWeights[y] = rowWeights[y];
+ }
+ for (int i = 0; i < components.length; i++)
+ {
+ Component component = components [i];
+
+ // If component is not visible we dont have to care about it.
+ if (!component.isVisible())
+ continue;
+
+ GridBagConstraints constraints = lookupConstraints (component);
+
+ if(constraints.gridy + constraints.gridheight - 1 == y)
+ {
+ int height = (sizeflag == PREFERREDSIZE) ?
+ component.preferredSize().height :
+ component.minimumSize().height;
+ if(constraints.insets != null)
+ {
+ height += constraints.insets.top + constraints.insets.bottom;
+ }
+ height += constraints.ipady;
+ for(int h = 1; h < constraints.gridheight; h++)
+ {
+ height -= info.rowHeights[y - h];
+ }
+ info.rowHeights[y] = Math.max(info.rowHeights[y], height);
+ info.rowWeights[y] =
+ Math.max(info.rowWeights[y], constraints.weighty);
+ }
+ }
+ }
+
+ calcCellSizes (info.colWidths, info.colWeights, parentDim.width);
+ calcCellSizes (info.rowHeights, info.rowWeights, parentDim.height);
+
+ int totalWidth = sumIntArray(info.colWidths);
+ int totalHeight = sumIntArray(info.rowHeights);
+ info.pos_x = parentInsets.left + (parentDim.width - totalWidth) / 2;
+ info.pos_y = parentInsets.top + (parentDim.height - totalHeight) / 2;
+
+ // DEBUG
+ //dumpLayoutInfo (info);
+
+ return info;
+ }
+
+ /**
+ * @since 1.4
+ */
+ protected void adjustForGravity (GridBagConstraints gbc, Rectangle rect)
+ {
+ // FIXME
+ throw new Error ("Not implemented");
+ }
}
diff --git a/libjava/java/awt/GridBagLayoutInfo.java b/libjava/java/awt/GridBagLayoutInfo.java
new file mode 100644
index 00000000000..6bd7f6787a8
--- /dev/null
+++ b/libjava/java/awt/GridBagLayoutInfo.java
@@ -0,0 +1,70 @@
+/* GridBagLayoutInfo -
+ 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.awt;
+
+import java.io.Serializable;
+
+/**
+ * @author Michael Koch <konqueror@gmx.de>
+ */
+class GridBagLayoutInfo implements Serializable
+{
+ private static final long serialVersionUID = -4899416460737170217L;
+
+ int pos_x;
+ int pos_y;
+ int cols;
+ int rows;
+ int colWidths[];
+ int rowHeights[];
+ double colWeights[];
+ double rowWeights[];
+
+ GridBagLayoutInfo (int cols, int rows)
+ {
+ this.pos_x = 0;
+ this.pos_y = 0;
+ this.cols = cols;
+ this.rows = rows;
+ this.colWidths = new int [cols];
+ this.rowHeights = new int [rows];
+ this.colWeights = new double [cols];
+ this.rowWeights = new double [rows];
+ }
+}
diff --git a/libjava/java/awt/MediaTracker.java b/libjava/java/awt/MediaTracker.java
index a94d6507114..0f4e1c3aeda 100644
--- a/libjava/java/awt/MediaTracker.java
+++ b/libjava/java/awt/MediaTracker.java
@@ -76,9 +76,9 @@ public class MediaTracker implements java.io.Serializable
int width, int height)
{
if ((flags & ABORT) != 0)
- status = ABORTED & COMPLETE;
+ status = ABORTED | COMPLETE;
else if ((flags & ERROR) != 0)
- status = ERRORED & COMPLETE;
+ status = ERRORED | COMPLETE;
else if ((flags & ALLBITS) != 0)
status = COMPLETE;
else
diff --git a/libjava/java/awt/Toolkit.java b/libjava/java/awt/Toolkit.java
index 6fd1413895b..9be38e80a02 100644
--- a/libjava/java/awt/Toolkit.java
+++ b/libjava/java/awt/Toolkit.java
@@ -342,15 +342,13 @@ public abstract class Toolkit
* with its own native window. Instead, this method allows the component
* to draw on its parent window as a "lightweight" widget.
*
- * XXX: FIXME
- *
* @param target The <code>Component</code> to create the peer for.
*
* @return The peer for the specified <code>Component</code> object.
*/
protected LightweightPeer createComponent(Component target)
{
- return null;
+ return new gnu.java.awt.peer.GLightweightPeer (target);
}
/**
@@ -805,23 +803,58 @@ public abstract class Toolkit
return props.getProperty(key, def);
}
+
/**
- * Returns the event queue for the applet. Despite the word "System"
- * in the name of this method, there is no guarantee that the same queue
- * is shared system wide.
+ * Returns the event queue that is suitable for the calling context.
+ *
+ * <p>Despite the word &#x201c;System&#x201d; in the name of this
+ * method, a toolkit may provide different event queues for each
+ * applet. There is no guarantee that the same queue is shared
+ * system-wide.
+ *
+ * <p>The implementation first checks whether a
+ * SecurityManager has been installed. If so, its {@link
+ * java.lang.SecurityManager#checkAwtEventQueueAccess()} method gets
+ * called. The security manager will throw a SecurityException if it
+ * does not grant the permission to access the event queue.
+ *
+ * <p>Next, the call is delegated to {@link
+ * #getSystemEventQueueImpl()}.
+ *
+ * @return The event queue for this applet (or application).
*
- * @return The event queue for this applet (or application)
+ * @throws SecurityException if a security manager has been
+ * installed, and it does not grant the permission to access the
+ * event queue.
*/
public final EventQueue getSystemEventQueue()
{
+ SecurityManager sm;
+
+ sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkAwtEventQueueAccess();
+
return getSystemEventQueueImpl();
}
+
/**
- * // FIXME: What does this do?
+ * Returns the event queue that is suitable for the calling context.
+ *
+ * <p>Despite the word &#x201c;System&#x201d; in the name of this
+ * method, a toolkit may provide different event queues for each
+ * applet. There is no guarantee that the same queue is shared
+ * system-wide.
+ *
+ * <p>No security checks are performed, which is why this method
+ * may only be called by Toolkits.
+ *
+ * @see #getSystemEventQueue()
*/
protected abstract EventQueue getSystemEventQueueImpl();
+
/**
* @since 1.3
*/
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index 13ae133beee..9f102751230 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -43,9 +43,13 @@ import java.awt.event.WindowFocusListener;
import java.awt.event.WindowListener;
import java.awt.event.WindowStateListener;
import java.awt.peer.WindowPeer;
+import java.lang.ref.Reference;
+import java.lang.ref.WeakReference;
+import java.util.Iterator;
import java.util.EventListener;
import java.util.Locale;
import java.util.ResourceBundle;
+import java.util.Vector;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
@@ -69,6 +73,9 @@ public class Window extends Container implements Accessible
/** @since 1.4 */
private boolean focusableWindowState = true;
+ // A list of other top-level windows owned by this window.
+ private transient Vector ownedWindows = new Vector();
+
private transient WindowListener windowListener;
private transient WindowFocusListener windowFocusListener;
private transient WindowStateListener windowStateListener;
@@ -83,7 +90,6 @@ public class Window extends Container implements Accessible
*/
Window()
{
- setVisible(false);
setLayout(new BorderLayout());
}
@@ -140,14 +146,17 @@ public class Window extends Container implements Accessible
if (owner == null)
throw new IllegalArgumentException ("owner must not be null");
- this.parent = owner;
-
- // FIXME: add to owner's "owned window" list
- //owner.owned.add(this); // this should be a weak reference
-
- /* FIXME: Security check
- SecurityManager.checkTopLevelWindow(...)
- */
+ parent = owner;
+
+ synchronized (owner.ownedWindows)
+ {
+ owner.ownedWindows.add(new WeakReference(this));
+ }
+
+ // FIXME: make this text visible in the window.
+ SecurityManager s = System.getSecurityManager();
+ if (s != null && ! s.checkTopLevelWindow(this))
+ warningString = System.getProperty("awt.appletWarning");
if (gc != null
&& gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
@@ -171,18 +180,6 @@ public class Window extends Container implements Accessible
}
/**
- * Disposes of the input methods and context, and removes the WeakReference
- * which formerly pointed to this Window from the parent's owned Window list.
- *
- * @exception Throwable The Exception raised by this method.
- */
- protected void finalize() throws Throwable
- {
- // FIXME: remove from owner's "owned window" list (Weak References)
- super.finalize();
- }
-
- /**
* Creates the native peer for this window.
*/
public void addNotify()
@@ -227,7 +224,23 @@ public class Window extends Container implements Accessible
public void hide()
{
- // FIXME: call hide() on any "owned" children here.
+ synchronized (ownedWindows)
+ {
+ Iterator e = ownedWindows.iterator();
+ while(e.hasNext())
+ {
+ Window w = (Window)(((Reference) e.next()).get());
+ if (w != null)
+ w.hide();
+ else
+ // Remove null weak reference from ownedWindows.
+ // Unfortunately this can't be done in the Window's
+ // finalize method because there is no way to guarantee
+ // synchronous access to ownedWindows there.
+ e.remove();
+ }
+ }
+
super.hide();
}
@@ -239,15 +252,26 @@ public class Window extends Container implements Accessible
}
/**
- * Called to free any resource associated with this window.
+ * Destroys any resources associated with this window. This includes
+ * all components in the window and all owned top-level windows.
*/
public void dispose()
{
hide();
- Window[] list = getOwnedWindows();
- for (int i=0; i<list.length; i++)
- list[i].dispose();
+ synchronized (ownedWindows)
+ {
+ Iterator e = ownedWindows.iterator();
+ while(e.hasNext())
+ {
+ Window w = (Window)(((Reference) e.next()).get());
+ if (w != null)
+ w.dispose();
+ else
+ // Remove null weak reference from ownedWindows.
+ e.remove();
+ }
+ }
for (int i = 0; i < ncomponents; ++i)
component[i].removeNotify();
@@ -301,20 +325,7 @@ public class Window extends Container implements Accessible
*/
public final String getWarningString()
{
- boolean secure = true;
- /* boolean secure = SecurityManager.checkTopLevelWindow(...) */
-
- if (!secure)
- {
- if (warningString != null)
- return warningString;
- else
- {
- String warning = System.getProperty("awt.appletWarning");
- return warning;
- }
- }
- return null;
+ return warningString;
}
/**
@@ -353,9 +364,33 @@ public class Window extends Container implements Accessible
/** @since 1.2 */
public Window[] getOwnedWindows()
{
- // FIXME: return array containing all the windows this window currently
- // owns.
- return new Window[0];
+ Window [] trimmedList;
+ synchronized (ownedWindows)
+ {
+ // Windows with non-null weak references in ownedWindows.
+ Window [] validList = new Window [ownedWindows.size()];
+
+ Iterator e = ownedWindows.iterator();
+ int numValid = 0;
+ while (e.hasNext())
+ {
+ Window w = (Window)(((Reference) e.next()).get());
+ if (w != null)
+ validList[numValid++] = w;
+ else
+ // Remove null weak reference from ownedWindows.
+ e.remove();
+ }
+
+ if (numValid != validList.length)
+ {
+ trimmedList = new Window [numValid];
+ System.arraycopy (validList, 0, trimmedList, 0, numValid);
+ }
+ else
+ trimmedList = validList;
+ }
+ return trimmedList;
}
/**
diff --git a/libjava/java/awt/event/KeyEvent.java b/libjava/java/awt/event/KeyEvent.java
index f93bab1dc78..455d7ee5266 100644
--- a/libjava/java/awt/event/KeyEvent.java
+++ b/libjava/java/awt/event/KeyEvent.java
@@ -1503,7 +1503,7 @@ public class KeyEvent extends InputEvent
case VK_NUMPAD7:
case VK_NUMPAD8:
case VK_NUMPAD9:
- return "NumPad-" + (char) (keyCode - VK_NUMPAD0);
+ return "NumPad-" + (keyCode - VK_NUMPAD0);
case VK_F1:
case VK_F2:
case VK_F3:
@@ -1642,63 +1642,64 @@ public class KeyEvent extends InputEvent
}
/**
- * Returns a string identifying the event. This is formatted as the field
- * name of the id type, followed by the keyCode, then the keyChar (if
- * available), modifiers (if any), extModifiers (if any), and keyLocation.
- * The keyChar is available unless the keyCode is Backspace, Tab, Enter,
- * Escape, Numpad-[0-9], Delete, or a keyCode which is an action.
+ * Returns a string identifying the event. This is formatted as the
+ * field name of the id type, followed by the keyCode, then the
+ * keyChar, modifiers (if any), extModifiers (if any), and
+ * keyLocation.
*
* @return a string identifying the event
*/
public String paramString()
{
StringBuffer s = new StringBuffer();
+
switch (id)
{
case KEY_PRESSED:
- s.append("KEY_PRESSED,keyCode=");
+ s.append("KEY_PRESSED");
break;
case KEY_RELEASED:
- s.append("KEY_RELEASED,keyCode=");
+ s.append("KEY_RELEASED");
break;
case KEY_TYPED:
- s.append("KEY_TYPED,keyCode=");
+ s.append("KEY_TYPED");
break;
default:
- s.append("unknown type,keyCode=");
+ s.append("unknown type");
}
- s.append(keyCode);
- switch (keyCode)
+
+ s.append(",keyCode=").append(keyCode);
+
+ s.append(",keyText=").append(getKeyText(keyCode));
+
+ s.append(",keyChar=");
+ if (isActionKey()
+ || keyCode == VK_SHIFT
+ || keyCode == VK_CONTROL
+ || keyCode == VK_ALT)
+ s.append("Undefined keyChar");
+ else
{
- default:
- if (! isActionKey())
- {
- s.append(",keyChar='").append(keyChar).append('\'');
- break;
- }
- // Fallthrough.
- case VK_BACK_SPACE:
- case VK_TAB:
- case VK_ENTER:
- case VK_ESCAPE:
- case VK_NUMPAD0:
- case VK_NUMPAD1:
- case VK_NUMPAD2:
- case VK_NUMPAD3:
- case VK_NUMPAD4:
- case VK_NUMPAD5:
- case VK_NUMPAD6:
- case VK_NUMPAD7:
- case VK_NUMPAD8:
- case VK_NUMPAD9:
- case VK_DELETE:
- s.append(',').append(getKeyText(keyCode));
+ /* This output string must be selected by examining keyChar
+ * rather than keyCode, because key code information is not
+ * included in KEY_TYPED events.
+ */
+ if (keyChar == VK_BACK_SPACE
+ || keyChar == VK_TAB
+ || keyChar == VK_ENTER
+ || keyChar == VK_ESCAPE
+ || keyChar == VK_DELETE)
+ s.append(getKeyText(keyChar));
+ else
+ s.append("'").append(keyChar).append("'");
}
+
if ((modifiers & CONVERT_MASK) != 0)
s.append(",modifiers=").append(getModifiersExText(modifiers
& CONVERT_MASK));
if (modifiers != 0)
s.append(",extModifiers=").append(getModifiersExText(modifiers));
+
s.append(",keyLocation=KEY_LOCATION_");
switch (keyLocation)
{
@@ -1717,6 +1718,7 @@ public class KeyEvent extends InputEvent
case KEY_LOCATION_NUMPAD:
s.append("NUMPAD");
}
+
return s.toString();
}
diff --git a/libjava/java/awt/geom/AffineTransform.java b/libjava/java/awt/geom/AffineTransform.java
index 3c9486e6875..d479763be8c 100644
--- a/libjava/java/awt/geom/AffineTransform.java
+++ b/libjava/java/awt/geom/AffineTransform.java
@@ -1089,7 +1089,7 @@ public class AffineTransform implements Cloneable, Serializable
float x = srcPts[srcOff++];
float y = srcPts[srcOff++];
dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02);
- dstPts[dstOff++] = (float) (m10 * x + m10 * y + m12);
+ dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12);
}
}
@@ -1123,7 +1123,7 @@ public class AffineTransform implements Cloneable, Serializable
double x = srcPts[srcOff++];
double y = srcPts[srcOff++];
dstPts[dstOff++] = m00 * x + m01 * y + m02;
- dstPts[dstOff++] = m10 * x + m10 * y + m12;
+ dstPts[dstOff++] = m10 * x + m11 * y + m12;
}
}
@@ -1148,7 +1148,7 @@ public class AffineTransform implements Cloneable, Serializable
float x = srcPts[srcOff++];
float y = srcPts[srcOff++];
dstPts[dstOff++] = m00 * x + m01 * y + m02;
- dstPts[dstOff++] = m10 * x + m10 * y + m12;
+ dstPts[dstOff++] = m10 * x + m11 * y + m12;
}
}
@@ -1173,7 +1173,7 @@ public class AffineTransform implements Cloneable, Serializable
double x = srcPts[srcOff++];
double y = srcPts[srcOff++];
dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02);
- dstPts[dstOff++] = (float) (m10 * x + m10 * y + m12);
+ dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12);
}
}
diff --git a/libjava/java/awt/geom/Arc2D.java b/libjava/java/awt/geom/Arc2D.java
index d62fa676f89..2eb9650cf88 100644
--- a/libjava/java/awt/geom/Arc2D.java
+++ b/libjava/java/awt/geom/Arc2D.java
@@ -1,5 +1,5 @@
/* Arc2D.java -- represents an arc in 2-D space
- Copyright (C) 2002 Free Software Foundation
+ Copyright (C) 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -126,9 +126,11 @@ public abstract class Arc2D extends RectangularShape
*/
public Point2D getStartPoint()
{
- double angle = getAngleStart() * (-180 / Math.PI);
- double x = (Math.cos(angle) * getWidth() + getX()) / 2;
- double y = (Math.sin(angle) * getHeight() + getY()) / 2;
+ double angle = Math.toRadians(getAngleStart());
+ double rx = getWidth() / 2;
+ double ry = getHeight() / 2;
+ double x = getX() + rx + rx * Math.cos(angle);
+ double y = getY() + ry - ry * Math.sin(angle);
return new Point2D.Double(x, y);
}
@@ -139,9 +141,11 @@ public abstract class Arc2D extends RectangularShape
*/
public Point2D getEndPoint()
{
- double angle = (getAngleStart() + getAngleExtent()) * (-180 / Math.PI);
- double x = (Math.cos(angle) * getWidth() + getX()) / 2;
- double y = (Math.sin(angle) * getHeight() + getY()) / 2;
+ double angle = Math.toRadians(getAngleStart() + getAngleExtent());
+ double rx = getWidth() / 2;
+ double ry = getHeight() / 2;
+ double x = getX() + rx + rx * Math.cos(angle);
+ double y = getY() + ry - ry * Math.sin(angle);
return new Point2D.Double(x, y);
}
@@ -280,9 +284,10 @@ public abstract class Arc2D extends RectangularShape
*/
public void setAngleStart(Point2D p)
{
- double x = ((p.getX() * 2) - getX()) / getWidth();
- double y = ((p.getY() * 2) - getY()) / getHeight();
- setAngleStart(Math.atan2(y, x) * (-180 / Math.PI));
+ // Normalize.
+ double x = p.getX() - (getX() + getWidth() / 2);
+ double y = p.getY() - (getY() + getHeight() / 2);
+ setAngleStart(Math.toDegrees(Math.atan2(y, x)));
}
/**
@@ -303,12 +308,12 @@ public abstract class Arc2D extends RectangularShape
double my = getY();
double mw = getWidth();
double mh = getHeight();
- x1 = ((x1 * 2) - mx) / mw;
- y1 = ((y1 * 2) - my) / mh;
- x2 = ((x2 * 2) - mx) / mw;
- y2 = ((y2 * 2) - my) / mh;
- double start = Math.atan2(y1, x1) * (-180 / Math.PI);
- double extent = Math.atan2(y2, x2) * (-180 / Math.PI) - start;
+ x1 = x1 - (mx + mw / 2);
+ y1 = y1 - (my + mh / 2);
+ x2 = x2 - (mx + mw / 2);
+ y2 = y2 - (my + mh / 2);
+ double start = Math.toDegrees(Math.atan2(y1, x1));
+ double extent = Math.toDegrees(Math.atan2(y2, x2)) - start;
if (extent < 0)
extent += 360;
setAngleStart(start);
@@ -372,8 +377,31 @@ public abstract class Arc2D extends RectangularShape
double extent = getAngleExtent();
if (Math.abs(extent) >= 360)
return makeBounds(getX(), getY(), getWidth(), getHeight());
- // XXX Finish implementing.
- throw new Error("not implemented");
+
+ // Find the minimal bounding box. This determined by its extrema,
+ // which are the center, the endpoints of the arc, and any local
+ // maximum contained by the arc.
+ double rX = getWidth() / 2;
+ double rY = getHeight() / 2;
+ double centerX = getX() + rX;
+ double centerY = getY() + rY;
+
+ Point2D p1 = getStartPoint();
+ Rectangle2D result = makeBounds(p1.getX(), p1.getY(), 0, 0);
+ result.add(getEndPoint());
+
+ if (type == PIE)
+ result.add(centerX, centerY);
+ if (containsAngle(0))
+ result.add(centerX + rX, centerY);
+ if (containsAngle(90))
+ result.add(centerX, centerY - rY);
+ if (containsAngle(180))
+ result.add(centerX - rX, centerY);
+ if (containsAngle(270))
+ result.add(centerX, centerY + rY);
+
+ return result;
}
/**
@@ -390,16 +418,29 @@ public abstract class Arc2D extends RectangularShape
/**
* Tests if the given angle, in degrees, is included in the arc.
- *
- * XXX Does this normalize all angles to -180 - 180 first?
+ * All angles are normalized to be between 0 and 360 degrees.
*
* @param a the angle to test
* @return true if it is contained
*/
public boolean containsAngle(double a)
{
- // XXX Implement.
- throw new Error("not implemented");
+ double start = getAngleStart();
+ double end = start + getAngleExtent();
+
+ start %= 360;
+ if (start < 0)
+ start += 360;
+
+ end %= 360;
+ if (end < 0)
+ end += 360;
+
+ a %= 360;
+ if (a < 0)
+ a += 360;
+
+ return a >= start && a <= end;
}
/**
@@ -541,11 +582,11 @@ public abstract class Arc2D extends RectangularShape
limit = -1;
else if (e == 0)
limit = type;
- else if (e <= 90)
+ else if (e <= Math.PI / 2.0)
limit = type + 1;
- else if (e <= 180)
+ else if (e <= Math.PI)
limit = type + 2;
- else if (e <= 270)
+ else if (e <= 3.0 * (Math.PI / 2.0))
limit = type + 3;
else
limit = type + 4;
@@ -608,36 +649,11 @@ public abstract class Arc2D extends RectangularShape
*/
public int currentSegment(float[] coords)
{
- if (current > limit)
- throw new NoSuchElementException("arc iterator out of bounds");
- if (current == 0)
- {
- coords[0] = (float) (Math.cos(start) * w + x) / 2;
- coords[1] = (float) (Math.sin(start) * h + y) / 2;
- if (xform != null)
- xform.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (type != OPEN && current == limit)
- return SEG_CLOSE;
- if (type == PIE && current == limit - 1)
- {
- coords[0] = (float) (x + w / 2);
- coords[1] = (float) (y + h / 2);
- if (xform != null)
- xform.transform(coords, 0, coords, 0, 1);
- return SEG_LINETO;
- }
- // XXX Fill coords with 2 control points and next quarter point
- coords[0] = (float) 0;
- coords[1] = (float) 0;
- coords[2] = (float) 0;
- coords[3] = (float) 0;
- coords[4] = (float) 0;
- coords[5] = (float) 0;
- if (xform != null)
- xform.transform(coords, 0, coords, 0, 3);
- return SEG_CUBICTO;
+ double[] double_coords = new double[6];
+ int code = currentSegment (double_coords);
+ for (int i = 0; i < 6; ++i)
+ coords[i] = (float) double_coords[i];
+ return code;
}
/**
@@ -650,35 +666,99 @@ public abstract class Arc2D extends RectangularShape
*/
public int currentSegment(double[] coords)
{
+ double rx = w/2;
+ double ry = h/2;
+ double xmid = x + rx;
+ double ymid = y + ry;
+
if (current > limit)
throw new NoSuchElementException("arc iterator out of bounds");
+
if (current == 0)
{
- coords[0] = (Math.cos(start) * w + x) / 2;
- coords[1] = (Math.sin(start) * h + y) / 2;
+ coords[0] = xmid + rx * Math.cos(start);
+ coords[1] = ymid - ry * Math.sin(start);
if (xform != null)
xform.transform(coords, 0, coords, 0, 1);
return SEG_MOVETO;
}
+
if (type != OPEN && current == limit)
return SEG_CLOSE;
- if (type == PIE && current == limit - 1)
+
+ if ((current == limit - 1) &&
+ (type == PIE) || (type == CHORD))
{
- coords[0] = (float) (x + w / 2);
- coords[1] = (float) (y + h / 2);
+ if (type == PIE)
+ {
+ coords[0] = xmid;
+ coords[1] = ymid;
+ }
+ else if (type == CHORD)
+ {
+ coords[0] = xmid + rx * Math.cos(start);
+ coords[1] = ymid - ry * Math.sin(start);
+ }
if (xform != null)
xform.transform(coords, 0, coords, 0, 1);
return SEG_LINETO;
}
- // XXX Fill coords with 2 control points and next quarter point
- coords[0] = 0;
- coords[1] = 0;
- coords[2] = 0;
- coords[3] = 0;
- coords[4] = 0;
- coords[5] = 0;
+
+ // note that this produces a cubic approximation of the arc segment,
+ // not a true ellipsoid. there's no ellipsoid path segment code,
+ // unfortunately. the cubic approximation looks about right, though.
+
+ double kappa = (Math.sqrt(2.0) - 1.0) * (4.0 / 3.0);
+ double quad = (Math.PI / 2.0);
+
+ double curr_begin = start + (current - 1) * quad;
+ double curr_extent = Math.min((start + extent) - curr_begin, quad);
+ double portion_of_a_quadrant = curr_extent / quad;
+
+ double x0 = xmid + rx * Math.cos(curr_begin);
+ double y0 = ymid - ry * Math.sin(curr_begin);
+
+ double x1 = xmid + rx * Math.cos(curr_begin + curr_extent);
+ double y1 = ymid - ry * Math.sin(curr_begin + curr_extent);
+
+ AffineTransform trans = new AffineTransform ();
+ double [] cvec = new double[2];
+ double len = kappa * portion_of_a_quadrant;
+ double angle = curr_begin;
+
+ // in a hypothetical "first quadrant" setting, our first control
+ // vector would be sticking up, from [1,0] to [1,kappa].
+ //
+ // let us recall however that in java2d, y coords are upside down
+ // from what one would consider "normal" first quadrant rules, so we
+ // will *subtract* the y value of this control vector from our first
+ // point.
+
+ cvec[0] = 0;
+ cvec[1] = len;
+ trans.scale (rx, ry);
+ trans.rotate (angle);
+ trans.transform(cvec, 0, cvec, 0, 1);
+ coords[0] = x0 + cvec[0];
+ coords[1] = y0 - cvec[1];
+
+ // control vector #2 would, ideally, be sticking out and to the
+ // right, in a first quadrant arc segment. again, subtraction of y.
+
+ cvec[0] = 0;
+ cvec[1] = -len;
+ trans.rotate (curr_extent);
+ trans.transform(cvec, 0, cvec, 0, 1);
+ coords[2] = x1 + cvec[0];
+ coords[3] = y1 - cvec[1];
+
+ // end point
+ coords[4] = x1;
+ coords[5] = y1;
+
if (xform != null)
xform.transform(coords, 0, coords, 0, 3);
+
return SEG_CUBICTO;
}
} // class ArcIterator
diff --git a/libjava/java/awt/geom/CubicCurve2D.java b/libjava/java/awt/geom/CubicCurve2D.java
index 2d303c7f6a7..2bc0b358b19 100644
--- a/libjava/java/awt/geom/CubicCurve2D.java
+++ b/libjava/java/awt/geom/CubicCurve2D.java
@@ -204,7 +204,7 @@ public abstract class CubicCurve2D implements Shape, Cloneable
return new PathIterator()
{
/** Current coordinate. */
- private int current;
+ private int current = 0;
public int getWindingRule()
{
@@ -213,7 +213,7 @@ public abstract class CubicCurve2D implements Shape, Cloneable
public boolean isDone()
{
- return current < 2;
+ return current >= 2;
}
public void next()
@@ -223,52 +223,56 @@ public abstract class CubicCurve2D implements Shape, Cloneable
public int currentSegment(float[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = (float) getX1();
coords[1] = (float) getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = (float) getCtrlX1();
coords[1] = (float) getCtrlY1();
coords[2] = (float) getCtrlX2();
coords[3] = (float) getCtrlY2();
coords[4] = (float) getX2();
coords[5] = (float) getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 3);
- return SEG_CUBICTO;
+ result = SEG_CUBICTO;
+ break;
+ default:
+ throw new NoSuchElementException("cubic iterator out of bounds");
}
- throw new NoSuchElementException("cubic iterator out of bounds");
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 3);
+ return result;
}
public int currentSegment(double[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = getX1();
coords[1] = getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = getCtrlX1();
coords[1] = getCtrlY1();
coords[2] = getCtrlX2();
coords[3] = getCtrlY2();
coords[4] = getX2();
coords[5] = getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 3);
- return SEG_CUBICTO;
- }
- throw new NoSuchElementException("cubic iterator out of bounds");
+ result = SEG_CUBICTO;
+ break;
+ default:
+ throw new NoSuchElementException("cubic iterator out of bounds");
+ }
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 3);
+ return result;
}
};
}
diff --git a/libjava/java/awt/geom/Line2D.java b/libjava/java/awt/geom/Line2D.java
index d2dd65c4341..15b2ecae80c 100644
--- a/libjava/java/awt/geom/Line2D.java
+++ b/libjava/java/awt/geom/Line2D.java
@@ -668,7 +668,7 @@ public abstract class Line2D implements Shape, Cloneable
return new PathIterator()
{
/** Current coordinate. */
- private int current;
+ private int current = 0;
public int getWindingRule()
{
@@ -677,7 +677,7 @@ public abstract class Line2D implements Shape, Cloneable
public boolean isDone()
{
- return current < 2;
+ return current >= 2;
}
public void next()
diff --git a/libjava/java/awt/geom/QuadCurve2D.java b/libjava/java/awt/geom/QuadCurve2D.java
index 05748fc979d..6aed0590756 100644
--- a/libjava/java/awt/geom/QuadCurve2D.java
+++ b/libjava/java/awt/geom/QuadCurve2D.java
@@ -215,7 +215,7 @@ public abstract class QuadCurve2D implements Shape, Cloneable
return new PathIterator()
{
/** Current coordinate. */
- private int current;
+ private int current = 0;
public int getWindingRule()
{
@@ -224,7 +224,7 @@ public abstract class QuadCurve2D implements Shape, Cloneable
public boolean isDone()
{
- return current < 2;
+ return current >= 2;
}
public void next()
@@ -234,48 +234,52 @@ public abstract class QuadCurve2D implements Shape, Cloneable
public int currentSegment(float[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = (float) getX1();
coords[1] = (float) getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = (float) getCtrlX();
coords[1] = (float) getCtrlY();
coords[2] = (float) getX2();
coords[3] = (float) getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 2);
- return SEG_QUADTO;
+ result = SEG_QUADTO;
+ break;
+ default:
+ throw new NoSuchElementException("quad iterator out of bounds");
}
- throw new NoSuchElementException("quad iterator out of bounds");
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 2);
+ return result;
}
public int currentSegment(double[] coords)
{
- if (current == 0)
+ int result;
+ switch (current)
{
+ case 0:
coords[0] = getX1();
coords[1] = getY1();
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return SEG_MOVETO;
- }
- if (current == 1)
- {
+ result = SEG_MOVETO;
+ break;
+ case 1:
coords[0] = getCtrlX();
coords[1] = getCtrlY();
coords[2] = getX2();
coords[3] = getY2();
- if (at != null)
- at.transform(coords, 0, coords, 0, 2);
- return SEG_QUADTO;
+ result = SEG_QUADTO;
+ break;
+ default:
+ throw new NoSuchElementException("quad iterator out of bounds");
}
- throw new NoSuchElementException("quad iterator out of bounds");
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 2);
+ return result;
}
};
}
diff --git a/libjava/java/awt/geom/Rectangle2D.java b/libjava/java/awt/geom/Rectangle2D.java
index e0a278a575d..e63e1bad134 100644
--- a/libjava/java/awt/geom/Rectangle2D.java
+++ b/libjava/java/awt/geom/Rectangle2D.java
@@ -395,7 +395,7 @@ public abstract class Rectangle2D extends RectangularShape
return new PathIterator()
{
/** Current coordinate. */
- private int current = (maxx >= minx && maxy >= miny) ? 6 : 0;
+ private int current = (maxx <= minx && maxy <= miny) ? 6 : 0;
public int getWindingRule()
{
diff --git a/libjava/java/awt/im/InputContext.java b/libjava/java/awt/im/InputContext.java
index 6218847a079..ab483377d4f 100644
--- a/libjava/java/awt/im/InputContext.java
+++ b/libjava/java/awt/im/InputContext.java
@@ -1,5 +1,5 @@
/* InputContext.java -- provides the context for text input
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -339,7 +339,6 @@ public class InputContext
*
* @throws UnsupportedOperationException if there is no current input method,
* or the input method does not support reconversion
- * @throws UnsupportedOperationException if ther
* @since 1.3
*/
public void reconvert()
diff --git a/libjava/java/awt/image/BufferedImage.java b/libjava/java/awt/image/BufferedImage.java
index 1fd7b9bfcf5..8c6ead242a5 100644
--- a/libjava/java/awt/image/BufferedImage.java
+++ b/libjava/java/awt/image/BufferedImage.java
@@ -267,9 +267,16 @@ public class BufferedImage extends Image
raster.createWritableChild(x, y, w, h, x, y,
null // same bands
);
-
- // Refer to ComponentDataBlitOp for optimized data blitting:
- ComponentDataBlitOp.INSTANCE.filter(src, dest);
+ if (src.getSampleModel () instanceof ComponentSampleModel
+ && dest.getSampleModel () instanceof ComponentSampleModel)
+ // Refer to ComponentDataBlitOp for optimized data blitting:
+ ComponentDataBlitOp.INSTANCE.filter(src, dest);
+ else
+ {
+ // slower path
+ int samples[] = src.getPixels (x, y, w, h, (int [])null);
+ dest.setPixels (x, y, w, h, samples);
+ }
return dest;
}
@@ -540,9 +547,18 @@ public class BufferedImage extends Image
raster.createWritableChild(x, y, w, h, x, y,
null // same bands
);
-
- // Refer to ComponentDataBlitOp for optimized data blitting:
- ComponentDataBlitOp.INSTANCE.filter(src, dest);
+
+ if (src.getSampleModel () instanceof ComponentSampleModel
+ && dest.getSampleModel () instanceof ComponentSampleModel)
+
+ // Refer to ComponentDataBlitOp for optimized data blitting:
+ ComponentDataBlitOp.INSTANCE.filter(src, dest);
+ else
+ {
+ // slower path
+ int samples[] = src.getPixels (x, y, w, h, (int [])null);
+ dest.setPixels (x, y, w, h, samples);
+ }
}
public void setRGB(int x, int y, int argb)
diff --git a/libjava/java/awt/image/MemoryImageSource.java b/libjava/java/awt/image/MemoryImageSource.java
index 0e8d4620672..5006afe79e5 100644
--- a/libjava/java/awt/image/MemoryImageSource.java
+++ b/libjava/java/awt/image/MemoryImageSource.java
@@ -74,7 +74,7 @@ public class MemoryImageSource implements ImageProducer
this.props = props;
int max = (( scansize > width ) ? scansize : width );
pixelb = new byte[ max * height ];
- System.arraycopy( pix, 0, pixelb, 0, max );
+ System.arraycopy( pix, 0, pixelb, 0, max * height );
}
/**
Constructs an ImageProducer from memory
@@ -100,7 +100,7 @@ public class MemoryImageSource implements ImageProducer
this.props = props;
int max = (( scansize > width ) ? scansize : width );
pixeli = new int[ max * height ];
- System.arraycopy( pix, 0, pixeli, 0, max );
+ System.arraycopy( pix, 0, pixeli, 0, max * height );
}
/**
Constructs an ImageProducer from memory using the default RGB ColorModel
@@ -226,6 +226,7 @@ public class MemoryImageSource implements ImageProducer
if( props != null ) {
ic.setProperties( props );
}
+ ic.setDimensions(width, height);
if( pixeli != null ) {
ic.setPixels( 0, 0, width, height, cm, pixeli, offset, scansize );
} else {
diff --git a/libjava/java/beans/PropertyEditorManager.java b/libjava/java/beans/PropertyEditorManager.java
index cb03563d50e..aa0e1776dea 100644
--- a/libjava/java/beans/PropertyEditorManager.java
+++ b/libjava/java/beans/PropertyEditorManager.java
@@ -140,9 +140,13 @@ public class PropertyEditorManager
return (PropertyEditor)found.newInstance();
}
+ ClassLoader contextClassLoader
+ = Thread.currentThread().getContextClassLoader();
+
try
{
- found = Class.forName(editedClass.getName()+"Editor");
+ found = Class.forName(editedClass.getName()+"Editor", true,
+ contextClassLoader);
registerEditor(editedClass,found);
return (PropertyEditor)found.newInstance();
}
@@ -150,14 +154,18 @@ public class PropertyEditorManager
{
}
- String appendName = "." + ClassHelper.getTruncatedClassName(editedClass) + "Editor";
+ String appendName
+ = "."
+ + ClassHelper.getTruncatedClassName(editedClass)
+ + "Editor";
synchronized(editorSearchPath)
{
for(int i=0;i<editorSearchPath.length;i++)
{
try
{
- found = Class.forName(editorSearchPath[i] + appendName);
+ found = Class.forName(editorSearchPath[i] + appendName,
+ true, contextClassLoader);
registerEditor(editedClass,found);
return (PropertyEditor)found.newInstance();
}
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java
index e22a23a4326..4c599d11d1b 100644
--- a/libjava/java/io/FileInputStream.java
+++ b/libjava/java/io/FileInputStream.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
import java.nio.channels.FileChannel;
-import gnu.java.nio.FileChannelImpl;
+import java.nio.channels.FileChannelImpl;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
diff --git a/libjava/java/io/FileOutputStream.java b/libjava/java/io/FileOutputStream.java
index 12543506643..f0d34e3fe5a 100644
--- a/libjava/java/io/FileOutputStream.java
+++ b/libjava/java/io/FileOutputStream.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
import java.nio.channels.FileChannel;
-import gnu.java.nio.FileChannelImpl;
+import java.nio.channels.FileChannelImpl;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
diff --git a/libjava/java/io/FilePermission.java b/libjava/java/io/FilePermission.java
index a86c7c9ff99..7d3e0af1c6c 100644
--- a/libjava/java/io/FilePermission.java
+++ b/libjava/java/io/FilePermission.java
@@ -144,9 +144,10 @@ public final class FilePermission extends Permission implements Serializable
/* Compare names, taking into account if they refer to a
* directory and one has a separator and the other does not.
*/
- if(f1.charAt(f1.length()) == File.separatorChar)
+ if(f1.length() > 0 && f1.charAt(f1.length() - 1) == File.separatorChar)
{
- if(f2.charAt(f2.length()) == File.separatorChar)
+ if(f2.length() > 0
+ && f2.charAt(f2.length() - 1) == File.separatorChar)
{
if(!f2.equals(f1))
return false;
@@ -159,7 +160,8 @@ public final class FilePermission extends Permission implements Serializable
}
else
{
- if(f2.charAt(f2.length()) == File.separatorChar)
+ if(f2.length() > 0
+ && f2.charAt(f2.length() - 1) == File.separatorChar)
{
if(!f1.equals(f2.substring(0,f2.length()-1)))
return false;
diff --git a/libjava/java/io/LineNumberReader.java b/libjava/java/io/LineNumberReader.java
index 12bafe39675..9c4796d402f 100644
--- a/libjava/java/io/LineNumberReader.java
+++ b/libjava/java/io/LineNumberReader.java
@@ -227,7 +227,7 @@ public class LineNumberReader extends BufferedReader
{
if (markPos >= 0 && limit == buffer.length)
markPos = -1;
- if (markPos <= 0)
+ if (markPos < 0)
pos = limit = 0;
int count = in.read(buffer, limit, buffer.length - limit);
if (count <= 0)
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java
index ef79727c1e1..918626905a4 100644
--- a/libjava/java/io/ObjectInputStream.java
+++ b/libjava/java/io/ObjectInputStream.java
@@ -41,10 +41,13 @@ package java.io;
import java.lang.reflect.Array;
import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
+
import gnu.java.io.ObjectIdentityWrapper;
import gnu.java.lang.reflect.TypeSignature;
import java.lang.reflect.Field;
@@ -1075,9 +1078,7 @@ public class ObjectInputStream extends InputStream
try
{
Class classArgs[] = {};
- m = obj.getClass ().getDeclaredMethod ("readResolve", classArgs);
- // m can't be null by definition since an exception would
- // have been thrown so a check for null is not needed.
+ m = getMethod(obj.getClass(), "readResolve", classArgs);
obj = m.invoke (obj, new Object[] {});
}
catch (NoSuchMethodException ignore)
@@ -1416,13 +1417,31 @@ public class ObjectInputStream extends InputStream
private static Field getField (Class klass, String name)
throws java.lang.NoSuchFieldException
{
- return klass.getDeclaredField(name);
+ final Field f = klass.getDeclaredField(name);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ f.setAccessible(true);
+ return null;
+ }
+ });
+ return f;
}
private static Method getMethod (Class klass, String name, Class args[])
throws java.lang.NoSuchMethodException
{
- return klass.getDeclaredMethod(name, args);
+ final Method m = klass.getDeclaredMethod(name, args);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ m.setAccessible(true);
+ return null;
+ }
+ });
+ return m;
}
private void callReadMethod (Object obj, ObjectStreamClass osc) throws IOException
@@ -1432,11 +1451,13 @@ public class ObjectInputStream extends InputStream
{
Class classArgs[] = {ObjectInputStream.class};
Method m = getMethod (klass, "readObject", classArgs);
- if (m == null)
- return;
Object args[] = {this};
m.invoke (obj, args);
}
+ catch (NoSuchMethodException nsme)
+ {
+ // Nothing.
+ }
catch (InvocationTargetException x)
{
/* Rethrow if possible. */
@@ -1467,7 +1488,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setBoolean (obj, val);
}
catch (Exception _)
@@ -1481,7 +1501,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setByte (obj, val);
}
catch (Exception _)
@@ -1495,7 +1514,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setChar (obj, val);
}
catch (Exception _)
@@ -1509,7 +1527,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setDouble (obj, val);
}
catch (Exception _)
@@ -1523,7 +1540,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setFloat (obj, val);
}
catch (Exception _)
@@ -1537,7 +1553,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setInt (obj, val);
}
catch (Exception _)
@@ -1552,7 +1567,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setLong (obj, val);
}
catch (Exception _)
@@ -1567,7 +1581,6 @@ public class ObjectInputStream extends InputStream
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
f.setShort (obj, val);
}
catch (Exception _)
@@ -1576,13 +1589,12 @@ public class ObjectInputStream extends InputStream
}
- private void setObjectField (Object obj, Class klass, String field_name, String type_code,
- Object val)
+ private void setObjectField (Object obj, Class klass, String field_name,
+ String type_code, Object val)
{
try
{
Field f = getField (klass, field_name);
- f.setAccessible(true);
// FIXME: We should check the type_code here
f.set (obj, val);
}
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index 4014fcd3dc2..1437a4f6918 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -42,6 +42,8 @@ import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
import java.util.Hashtable;
import gnu.java.io.ObjectIdentityWrapper;
@@ -240,10 +242,11 @@ public class ObjectOutputStream extends OutputStream
try
{
Class classArgs[] = {};
- m = obj.getClass ().getDeclaredMethod ("writeReplace",
- classArgs);
- // m can't be null by definition since an exception would
- // have been thrown so a check for null is not needed.
+ m = getMethod(obj.getClass(), "writeReplace",
+ classArgs);
+ // 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[] {});
}
catch (NoSuchMethodException ignore)
@@ -993,7 +996,8 @@ public class ObjectOutputStream extends OutputStream
private void checkType (ObjectStreamField field, char type)
throws IllegalArgumentException
{
- if (TypeSignature.getEncodingOfClass (field.getType ()).charAt (0) != type)
+ if (TypeSignature.getEncodingOfClass (field.getType ()).charAt (0)
+ != type)
throw new IllegalArgumentException ();
}
};
@@ -1193,18 +1197,21 @@ public class ObjectOutputStream extends OutputStream
}
- private void callWriteMethod (Object obj, ObjectStreamClass osc) throws IOException
+ private void callWriteMethod (Object obj, ObjectStreamClass osc)
+ throws IOException
{
Class klass = osc.forClass();
try
{
Class classArgs[] = {ObjectOutputStream.class};
Method m = getMethod (klass, "writeObject", classArgs);
- if (m == null)
- return;
Object args[] = {this};
m.invoke (obj, args);
}
+ catch (NoSuchMethodException nsme)
+ {
+ // Nothing.
+ }
catch (InvocationTargetException x)
{
/* Rethrow if possible. */
@@ -1214,13 +1221,19 @@ public class ObjectOutputStream extends OutputStream
if (exception instanceof IOException)
throw (IOException) exception;
- throw new IOException ("Exception thrown from writeObject() on " +
- klass + ": " + exception.getClass().getName());
+ IOException ioe
+ = new IOException ("Exception thrown from writeObject() on " +
+ klass + ": " + exception.getClass().getName());
+ ioe.initCause(exception);
+ throw ioe;
}
catch (Exception x)
{
- throw new IOException ("Failure invoking writeObject() on " +
- klass + ": " + x.getClass().getName());
+ IOException ioe
+ = new IOException ("Failure invoking writeObject() on " +
+ klass + ": " + x.getClass().getName());
+ ioe.initCause(x);
+ throw ioe;
}
}
@@ -1239,7 +1252,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private byte getByteField (Object obj, Class klass, String field_name) throws IOException
+ private byte getByteField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1253,7 +1267,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private char getCharField (Object obj, Class klass, String field_name) throws IOException
+ private char getCharField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1297,7 +1312,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private int getIntField (Object obj, Class klass, String field_name) throws IOException
+ private int getIntField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1311,7 +1327,8 @@ public class ObjectOutputStream extends OutputStream
}
}
- private long getLongField (Object obj, Class klass, String field_name) throws IOException
+ private long getLongField (Object obj, Class klass, String field_name)
+ throws IOException
{
try
{
@@ -1359,13 +1376,31 @@ public class ObjectOutputStream extends OutputStream
private static Field getField (Class klass, String name)
throws java.lang.NoSuchFieldException
{
- return klass.getDeclaredField(name);
+ final Field f = klass.getDeclaredField(name);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ f.setAccessible(true);
+ return null;
+ }
+ });
+ return f;
}
private static Method getMethod (Class klass, String name, Class[] args)
throws java.lang.NoSuchMethodException
{
- return klass.getDeclaredMethod(name, args);
+ final Method m = klass.getDeclaredMethod(name, args);
+ AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ m.setAccessible(true);
+ return null;
+ }
+ });
+ return m;
}
// this value comes from 1.2 spec, but is used in 1.1 as well
diff --git a/libjava/java/io/ObjectStreamClass.java b/libjava/java/io/ObjectStreamClass.java
index ab233f166d0..12fb172f85b 100644
--- a/libjava/java/io/ObjectStreamClass.java
+++ b/libjava/java/io/ObjectStreamClass.java
@@ -621,7 +621,7 @@ public class ObjectStreamClass implements Serializable
{
// Use getDeclaredField rather than getField for the same reason
// as above in getDefinedSUID.
- Field f = clazz.getDeclaredField ("getSerialPersistentFields");
+ Field f = clazz.getDeclaredField ("serialPersistentFields");
f.setAccessible(true);
o = (ObjectStreamField[])f.get (null);
}
diff --git a/libjava/java/io/PrintStream.java b/libjava/java/io/PrintStream.java
index 94800150870..d2a211744e2 100644
--- a/libjava/java/io/PrintStream.java
+++ b/libjava/java/io/PrintStream.java
@@ -95,7 +95,9 @@ public class PrintStream extends FilterOutputStream
* This method intializes a new <code>PrintStream</code> object to write
* to the specified output sink. This constructor also allows "auto-flush"
* functionality to be specified where the stream will be flushed after
- * every line is terminated or newline character is written.
+ * every <code>print</code> or <code>println</code> call, when the
+ * <code>write</code> methods with array arguments are called, or when a
+ * single new-line character is written.
* <p>
*
* @param out The <code>OutputStream</code> to write to.
@@ -114,7 +116,9 @@ public class PrintStream extends FilterOutputStream
* This method intializes a new <code>PrintStream</code> object to write
* to the specified output sink. This constructor also allows "auto-flush"
* functionality to be specified where the stream will be flushed after
- * every line is terminated or newline character is written.
+ * every <code>print</code> or <code>println</code> call, when the
+ * <code>write</code> methods with array arguments are called, or when a
+ * single new-line character is written.
* <p>
*
* @param out The <code>OutputStream</code> to write to.
@@ -257,9 +261,7 @@ public class PrintStream extends FilterOutputStream
pw.print (str);
if (auto_flush)
- if ((str.indexOf ('\r') != -1)
- || (str.indexOf ('\n') != -1))
- flush ();
+ flush ();
}
/**
@@ -422,9 +424,21 @@ public class PrintStream extends FilterOutputStream
*/
public void write (int oneByte)
{
- byte[] data = new byte [1];
- data [0] = (byte) (oneByte & 0xff);
- write (data, 0, 1);
+ // We actually have to implement this method. Flush first so that
+ // things get written in the right order.
+ flush();
+
+ try
+ {
+ out.write (oneByte & 0xff);
+
+ if (auto_flush && (oneByte == '\n'))
+ flush ();
+ }
+ catch (IOException e)
+ {
+ setError ();
+ }
}
/**
@@ -446,19 +460,12 @@ public class PrintStream extends FilterOutputStream
out.write (buffer, offset, len);
if (auto_flush)
- for (int i = offset; i < len; i++)
- if ((buffer [i] == '\r')
- || (buffer [i] == '\n'))
- {
- flush ();
- break;
- }
+ flush ();
}
catch (IOException e)
{
setError ();
}
}
-
} // class PrintStream
diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java
index 08fedb0e095..de00f4d141c 100644
--- a/libjava/java/io/RandomAccessFile.java
+++ b/libjava/java/io/RandomAccessFile.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
import java.nio.channels.FileChannel;
-import gnu.java.nio.FileChannelImpl;
+import java.nio.channels.FileChannelImpl;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
diff --git a/libjava/java/io/natFileDescriptorPosix.cc b/libjava/java/io/natFileDescriptorPosix.cc
index 2ad2d9dce77..e43bb9d1135 100644
--- a/libjava/java/io/natFileDescriptorPosix.cc
+++ b/libjava/java/io/natFileDescriptorPosix.cc
@@ -150,7 +150,8 @@ java::io::FileDescriptor::write (jint b)
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
}
position++;
@@ -178,7 +179,8 @@ java::io::FileDescriptor::write (jbyteArray b, jint offset, jint len)
iioe->bytesTransferred = written;
throw iioe;
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
written += r;
@@ -282,20 +284,26 @@ jint
java::io::FileDescriptor::read (void)
{
jbyte b;
- int r = ::read (fd, &b, 1);
- if (r == 0)
- return -1;
- if (r == -1)
+ int r;
+ do
{
- if (java::lang::Thread::interrupted())
+ r = ::read (fd, &b, 1);
+ if (r == 0)
+ return -1;
+ if (r == -1)
{
- InterruptedIOException *iioe
- = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = r == -1 ? 0 : r;
- throw iioe;
+ if (java::lang::Thread::interrupted())
+ {
+ InterruptedIOException *iioe
+ = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
+ iioe->bytesTransferred = r == -1 ? 0 : r;
+ throw iioe;
+ }
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
+ while (r != 1);
position++;
return b & 0xFF;
}
@@ -314,20 +322,26 @@ java::io::FileDescriptor::read (jbyteArray buffer, jint offset, jint count)
return 0;
jbyte *bytes = elements (buffer) + offset;
- int r = ::read (fd, bytes, count);
- if (r == 0)
- return -1;
- if (r == -1)
- {
- if (java::lang::Thread::interrupted())
+ int r;
+ do
+ {
+ r = ::read (fd, bytes, count);
+ if (r == 0)
+ return -1;
+ if (r == -1)
{
- InterruptedIOException *iioe
- = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = r == -1 ? 0 : r;
- throw iioe;
+ if (java::lang::Thread::interrupted())
+ {
+ InterruptedIOException *iioe
+ = new InterruptedIOException (JvNewStringLatin1 (strerror (errno)));
+ iioe->bytesTransferred = r == -1 ? 0 : r;
+ throw iioe;
+ }
+ if (errno != EINTR)
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
}
+ while (r <= 0);
position += r;
return r;
}
diff --git a/libjava/java/io/natFileDescriptorWin32.cc b/libjava/java/io/natFileDescriptorWin32.cc
index 210eb73cbbb..1891bf78e42 100644
--- a/libjava/java/io/natFileDescriptorWin32.cc
+++ b/libjava/java/io/natFileDescriptorWin32.cc
@@ -13,15 +13,13 @@ details. */
// need to change to use the windows asynchronous IO functions
#include <config.h>
+#include <platform.h>
#include <stdio.h>
#include <string.h>
-#include <windows.h>
#undef STRICT
-#include <gcj/cni.h>
-#include <jvm.h>
#include <java/io/FileDescriptor.h>
#include <java/io/SyncFailedException.h>
#include <java/io/IOException.h>
@@ -33,6 +31,16 @@ details. */
#include <java/lang/Thread.h>
#include <java/io/FileNotFoundException.h>
+static bool testCanUseGetHandleInfo()
+{
+ /* Test to see whether GetHandleInformation can be used
+ for console input or screen buffers. This is better
+ a kludgy OS version check. */
+ DWORD dwFlags;
+ return GetHandleInformation (GetStdHandle (STD_INPUT_HANDLE),
+ &dwFlags) != 0;
+}
+
// FIXME: casting a FILE (pointer) to a jint will not work on Win64 --
// we should be using gnu.gcj.RawData's.
@@ -44,41 +52,32 @@ java::io::FileDescriptor::init(void)
err = new java::io::FileDescriptor((jint)(GetStdHandle (STD_ERROR_HANDLE)));
}
-static char *
-winerr (void)
-{
- static LPVOID last = NULL;
- LPVOID old = NULL;
-
- if (last)
- old = last;
-
- FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &last,
- 0,
- NULL);
-
- if (old)
- LocalFree (old);
-
- return (char *)last;
-}
-
jboolean
java::io::FileDescriptor::valid (void) {
- BY_HANDLE_FILE_INFORMATION info;
- return GetFileInformationByHandle ((HANDLE)fd, &info) != 0;
+ static bool bCanUseGetHandleInfo = testCanUseGetHandleInfo();
+ if (bCanUseGetHandleInfo)
+ {
+ /* As with UNIX, a "file" descriptor can be one of
+ a gazillion possible underlying things like a pipe
+ or socket, so we can't get too fancy here. */
+ DWORD dwFlags;
+ HANDLE h = (HANDLE) fd;
+ return GetHandleInformation (h, &dwFlags) != 0;
+ }
+ else
+ {
+ /* Can't use GetHandleInformation() for console handles on < WinNT 5. */
+ return true;
+ }
}
void
java::io::FileDescriptor::sync (void) {
if (! FlushFileBuffers ((HANDLE)fd))
- throw new SyncFailedException (JvNewStringLatin1 (winerr ()));
+ {
+ DWORD dwErrorCode = GetLastError ();
+ throw new SyncFailedException (_Jv_WinStrError (dwErrorCode));
+ }
}
jint
@@ -87,39 +86,41 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
HANDLE handle = NULL;
DWORD access = 0;
DWORD create = OPEN_EXISTING;
- char buf[MAX_PATH] = "";
-
- jsize total = JvGetStringUTFRegion(path, 0, path->length(), buf);
- buf[total] = '\0';
+
+ JV_TEMP_UTF_STRING(cpath, path)
JvAssert((jflags & READ) || (jflags & WRITE));
if ((jflags & READ) && (jflags & WRITE))
{
access = GENERIC_READ | GENERIC_WRITE;
- if (jflags & APPEND)
- create = OPEN_ALWAYS;
+ if (jflags & EXCL)
+ create = CREATE_NEW; // this will raise error if file exists.
else
- create = CREATE_ALWAYS;
+ create = OPEN_ALWAYS; // equivalent to O_CREAT
}
- else if(jflags & READ)
- access = GENERIC_READ;
- else
+ else if (jflags & READ)
{
+ access = GENERIC_READ;
+ create = OPEN_EXISTING; // ignore EXCL
+ }
+ else
+ {
access = GENERIC_WRITE;
- if (jflags & APPEND)
- create = OPEN_ALWAYS;
+ if (jflags & EXCL)
+ create = CREATE_NEW;
+ else if (jflags & APPEND)
+ create = OPEN_ALWAYS;
else
create = CREATE_ALWAYS;
}
- handle = CreateFile(buf, 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)
{
- char msg[MAX_PATH + 1000];
- sprintf (msg, "%s: %s", buf, winerr ());
- throw new FileNotFoundException (JvNewStringLatin1 (msg));
+ DWORD dwErrorCode = GetLastError ();
+ throw new FileNotFoundException (_Jv_WinStrError (cpath, dwErrorCode));
}
// For APPEND mode, move the file pointer to the end of the file.
@@ -127,7 +128,10 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
{
DWORD low = SetFilePointer (handle, 0, NULL, FILE_END);
if ((low == 0xffffffff) && (GetLastError () != NO_ERROR))
- throw new FileNotFoundException (JvNewStringLatin1 (winerr ()));
+ {
+ DWORD dwErrorCode = GetLastError ();
+ throw new FileNotFoundException (_Jv_WinStrError (cpath, dwErrorCode));
+ }
}
return (jint)handle;
}
@@ -144,13 +148,13 @@ java::io::FileDescriptor::write (jint b)
{
InterruptedIOException *iioe = new InterruptedIOException (JvNewStringLatin1 ("write interrupted"));
iioe->bytesTransferred = bytesWritten;
- throw iioe;
+ throw iioe;
}
if (bytesWritten != 1)
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
}
else
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
// FIXME: loop until bytesWritten == 1
}
@@ -170,11 +174,11 @@ java::io::FileDescriptor::write(jbyteArray b, jint offset, jint len)
{
InterruptedIOException *iioe = new InterruptedIOException (JvNewStringLatin1 ("write interrupted"));
iioe->bytesTransferred = bytesWritten;
- throw iioe;
+ throw iioe;
}
}
else
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
// FIXME: loop until bytesWritten == len
}
@@ -184,7 +188,7 @@ java::io::FileDescriptor::close (void)
HANDLE save = (HANDLE)fd;
fd = (jint)INVALID_HANDLE_VALUE;
if (! CloseHandle (save))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
}
void
@@ -196,46 +200,46 @@ java::io::FileDescriptor::setLength(jlong pos)
// Get the original file pointer.
if (SetFilePointer((HANDLE) fd, (LONG) 0, &liOrigFilePointer,
- FILE_CURRENT) != (BOOL) 0
+ FILE_CURRENT) != (BOOL) 0
&& (GetLastError() != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
// Get the length of the file.
if (SetFilePointer((HANDLE) fd, (LONG) 0, &liEndFilePointer,
- FILE_END) != (BOOL) 0
+ FILE_END) != (BOOL) 0
&& (GetLastError() != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
if ((jlong)liEndFilePointer == pos)
{
// Restore the file pointer.
if (liOrigFilePointer != liEndFilePointer)
- {
- if (SetFilePointer((HANDLE) fd, liOrigFilePointer, &liNewFilePointer,
- FILE_BEGIN) != (BOOL) 0
- && (GetLastError() != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
- }
+ {
+ if (SetFilePointer((HANDLE) fd, liOrigFilePointer, &liNewFilePointer,
+ FILE_BEGIN) != (BOOL) 0
+ && (GetLastError() != NO_ERROR))
+ _Jv_ThrowIOException ();
+ }
return;
}
// Seek to the new end of file.
if (SetFilePointer((HANDLE) fd, (LONG) pos, &liNewFilePointer,
- FILE_BEGIN) != (BOOL) 0
+ FILE_BEGIN) != (BOOL) 0
&& (GetLastError() != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
// Truncate the file at this point.
if (SetEndOfFile((HANDLE) fd) != (BOOL) 0 && (GetLastError() != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
if (liOrigFilePointer < liNewFilePointer)
{
// Restore the file pointer.
if (SetFilePointer((HANDLE) fd, liOrigFilePointer, &liNewFilePointer,
- FILE_BEGIN) != (BOOL) 0
- && (GetLastError() != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ FILE_BEGIN) != (BOOL) 0
+ && (GetLastError() != NO_ERROR))
+ _Jv_ThrowIOException ();
}
}
@@ -257,7 +261,7 @@ java::io::FileDescriptor::seek (jlong pos, jint whence, jboolean eof_trunc)
LONG high = pos >> 32;
DWORD low = SetFilePointer ((HANDLE)fd, (DWORD)(0xffffffff & pos), &high, whence == SET ? FILE_BEGIN : FILE_CURRENT);
if ((low == 0xffffffff) && (GetLastError () != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
return low;
}
@@ -267,7 +271,7 @@ java::io::FileDescriptor::getFilePointer(void)
LONG high = 0;
DWORD low = SetFilePointer ((HANDLE)fd, 0, &high, FILE_CURRENT);
if ((low == 0xffffffff) && (GetLastError() != NO_ERROR))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
return (((jlong)high) << 32L) | (jlong)low;
}
@@ -293,7 +297,7 @@ java::io::FileDescriptor::read(void)
if (GetLastError () == ERROR_BROKEN_PIPE)
return -1;
else
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
}
if (! read)
@@ -324,7 +328,7 @@ java::io::FileDescriptor::read(jbyteArray buffer, jint offset, jint count)
if (GetLastError () == ERROR_BROKEN_PIPE)
return -1;
else
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ _Jv_ThrowIOException ();
}
if (read == 0) return -1;
diff --git a/libjava/java/io/natFilePosix.cc b/libjava/java/io/natFilePosix.cc
index 4946cfccae8..580b5955ac0 100644
--- a/libjava/java/io/natFilePosix.cc
+++ b/libjava/java/io/natFilePosix.cc
@@ -118,7 +118,70 @@ java::io::File::getCanonicalPath (void)
#ifdef HAVE_REALPATH
if (realpath (buf, buf2) == NULL)
- throw new IOException (JvNewStringLatin1 (strerror (errno)));
+ {
+ // If realpath failed, we have to come up with a canonical path
+ // anyway. We do this with purely textual manipulation.
+ // FIXME: this isn't perfect. You can construct a case where
+ // we get a different answer from the JDK:
+ // mkdir -p /tmp/a/b/c
+ // ln -s /tmp/a/b /tmp/a/z
+ // ... getCanonicalPath("/tmp/a/z/c/nosuchfile")
+ // We will give /tmp/a/z/c/nosuchfile, while the JDK will
+ // give /tmp/a/b/c/nosuchfile.
+ int out_idx;
+ if (buf[0] != '/')
+ {
+ // Not absolute, so start with current directory.
+ if (getcwd (buf2, sizeof (buf2)) == NULL)
+ throw new IOException ();
+ out_idx = strlen (buf2);
+ }
+ else
+ {
+ buf2[0] = '/';
+ out_idx = 1;
+ }
+ int in_idx = 0;
+ while (buf[in_idx] != '\0')
+ {
+ // Skip '/'s.
+ while (buf[in_idx] == '/')
+ ++in_idx;
+ int elt_start = in_idx;
+ // Find next '/' or end of path.
+ while (buf[in_idx] != '\0' && buf[in_idx] != '/')
+ ++in_idx;
+ if (in_idx == elt_start)
+ {
+ // An empty component means we've reached the end.
+ break;
+ }
+ int len = in_idx - elt_start;
+ if (len == 1 && buf[in_idx] == '.')
+ continue;
+ if (len == 2 && buf[in_idx] == '.' && buf[in_idx + 1] == '.')
+ {
+ // Found ".." component, lop off last part from existing
+ // buffer.
+ --out_idx;
+ while (out_idx > 0 && buf2[out_idx] != '/')
+ --out_idx;
+ // Can't go up past "/".
+ if (out_idx == 0)
+ ++out_idx;
+ }
+ else
+ {
+ // Append a real path component to the output.
+ if (out_idx > 1)
+ buf2[out_idx++] = '/';
+ strncpy (&buf2[out_idx], &buf[elt_start], len);
+ out_idx += len;
+ }
+ }
+
+ buf2[out_idx] = '\0';
+ }
// FIXME: what encoding to assume for file names? This affects many
// calls.
diff --git a/libjava/java/io/natFileWin32.cc b/libjava/java/io/natFileWin32.cc
index 1e068329a32..cee6b00ae1f 100644
--- a/libjava/java/io/natFileWin32.cc
+++ b/libjava/java/io/natFileWin32.cc
@@ -9,15 +9,13 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
+#include <platform.h>
#include <stdio.h>
#include <string.h>
-#include <windows.h>
#undef STRICT
-#include <gcj/cni.h>
-#include <jvm.h>
#include <java/io/File.h>
#include <java/io/IOException.h>
#include <java/util/Vector.h>
@@ -42,12 +40,9 @@ details. */
jboolean
java::io::File::_access (jint query)
{
- jstring canon = getCanonicalPath();
- if (! canon)
+ JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ if (!canon)
return false;
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
- buf[total] = '\0';
JvAssert (query == READ || query == WRITE || query == EXISTS);
@@ -55,7 +50,7 @@ java::io::File::_access (jint query)
// If the file exists but cannot be read because of the secuirty attributes
// on an NTFS disk this wont work (it reports it can be read but cant)
// Could we use something from the security API?
- DWORD attributes = GetFileAttributes (buf);
+ DWORD attributes = GetFileAttributes (canon);
if ((query == EXISTS) || (query == READ))
return (attributes == 0xffffffff) ? false : true;
else
@@ -65,16 +60,13 @@ java::io::File::_access (jint query)
jboolean
java::io::File::_stat (jint query)
{
- jstring canon = getCanonicalPath();
- if (! canon)
+ JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ if (!canon)
return false;
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
- buf[total] = '\0';
JvAssert (query == DIRECTORY || query == ISFILE);
- DWORD attributes = GetFileAttributes (buf);
+ DWORD attributes = GetFileAttributes (canon);
if (attributes == 0xffffffff)
return false;
@@ -87,18 +79,15 @@ java::io::File::_stat (jint query)
jlong
java::io::File::attr (jint query)
{
- jstring canon = getCanonicalPath();
- if (! canon)
+ JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ if (!canon)
return false;
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
- buf[total] = '\0';
JvAssert (query == MODIFIED || query == LENGTH);
WIN32_FIND_DATA info;
HANDLE sHandle;
- if ( ( sHandle = FindFirstFile( buf, &info)) == INVALID_HANDLE_VALUE)
+ if ( ( sHandle = FindFirstFile( canon, &info)) == INVALID_HANDLE_VALUE)
return 0;
FindClose( sHandle);
@@ -119,13 +108,11 @@ java::io::File::attr (jint query)
jstring
java::io::File::getCanonicalPath (void)
{
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1);
- jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
- buf[total] = '\0';
+ JV_TEMP_UTF_STRING (cpath, path);
LPTSTR unused;
char buf2[MAX_PATH];
- if(!GetFullPathName(buf, MAX_PATH, buf2, &unused))
+ if(!GetFullPathName(cpath, MAX_PATH, buf2, &unused))
throw new IOException (JvNewStringLatin1 ("GetFullPathName failed"));
// FIXME: what encoding to assume for file names? This affects many
@@ -152,7 +139,7 @@ java::io::File::isAbsolute (void)
&& (path->charAt(0) < 'A' || path->charAt(0) > 'Z'))
return false;
return (path->charAt(1) == ':'
- && (path->charAt(2) == '/' || path->charAt(2) == '\\'));
+ && (path->charAt(2) == '/' || path->charAt(2) == '\\'));
}
void java::io::File::init_native ()
@@ -163,8 +150,8 @@ void java::io::File::init_native ()
jobjectArray
java::io::File::performList (java::io::FilenameFilter *filter,
- java::io::FileFilter *fileFilter,
- java::lang::Class *clazz)
+ java::io::FileFilter *fileFilter,
+ java::lang::Class *clazz)
{
jstring canon = getCanonicalPath();
if (! canon)
@@ -190,16 +177,16 @@ java::io::File::performList (java::io::FilenameFilter *filter,
jstring name = JvNewStringUTF (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));
@@ -217,53 +204,42 @@ java::io::File::performList (java::io::FilenameFilter *filter,
jboolean
java::io::File::performMkdir (void)
{
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1);
- jsize total = JvGetStringUTFRegion(path, 0, path->length(), buf);
- buf[total] = '\0';
-
- return (CreateDirectory(buf, NULL)) ? true : false;
+ JV_TEMP_UTF_STRING (cpath, path);
+ return (CreateDirectory(cpath, NULL)) ? true : false;
}
jboolean
java::io::File::performRenameTo (File *dest)
{
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1);
- jsize total = JvGetStringUTFRegion(path, 0, path->length(), buf);
- buf[total] = '\0';
- char *buf2 = (char *) __builtin_alloca (JvGetStringUTFLength (dest->path)
- + 1);
- total = JvGetStringUTFRegion(dest->path, 0, dest->path->length(), buf2);
- buf2[total] = '\0';
-
- return (MoveFile(buf, buf2)) ? true : false;
+ JV_TEMP_UTF_STRING (pathFrom, path);
+ JV_TEMP_UTF_STRING (pathTo, dest->path);
+ return (MoveFile(pathFrom, pathTo)) ? true : false;
}
jboolean
java::io::File::performDelete ()
{
- jstring canon = getCanonicalPath();
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
- jsize total = JvGetStringUTFRegion(canon, 0, canon->length(), buf);
- buf[total] = '\0';
+ JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ if (!canon)
+ return false;
- DWORD attributes = GetFileAttributes (buf);
+ DWORD attributes = GetFileAttributes (canon);
if (attributes == 0xffffffff)
return false;
if (attributes & FILE_ATTRIBUTE_DIRECTORY)
- return (RemoveDirectory (buf)) ? true : false;
+ return (RemoveDirectory (canon)) ? true : false;
else
- return (DeleteFile (buf)) ? true : false;
+ return (DeleteFile (canon)) ? true : false;
}
jboolean java::io::File::performCreate (void)
{
- jstring canon = getCanonicalPath ();
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length (), buf);
- buf[total] = '\0';
+ JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ if (!canon)
+ return false;
- HANDLE h = CreateFile (buf, 0, 0, NULL, CREATE_NEW,
+ HANDLE h = CreateFile (canon, 0, 0, NULL, CREATE_NEW,
FILE_ATTRIBUTE_NORMAL, NULL);
if (h != INVALID_HANDLE_VALUE)
{
@@ -281,15 +257,14 @@ jboolean java::io::File::performCreate (void)
jboolean java::io::File::performSetReadOnly ()
{
- jstring canon = getCanonicalPath ();
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length (), buf);
- buf[total] = '\0';
+ JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ if (!canon)
+ return false;
- DWORD attrs = GetFileAttributes (buf);
+ DWORD attrs = GetFileAttributes (canon);
if (attrs != INVALID_FILE_ATTRIBUTES)
{
- if (SetFileAttributes (buf, attrs | FILE_ATTRIBUTE_READONLY) != 0)
+ if (SetFileAttributes (canon, attrs | FILE_ATTRIBUTE_READONLY) != 0)
return true;
else
return false;
@@ -300,10 +275,9 @@ jboolean java::io::File::performSetReadOnly ()
jboolean java::io::File::performSetLastModified (jlong time)
{
- jstring canon = getCanonicalPath ();
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1);
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length (), buf);
- buf[total] = '\0';
+ JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ if (!canon)
+ return false;
FILETIME modTime;
long long mTime100ns = ((long long) time /* Ha! */
@@ -313,7 +287,7 @@ jboolean java::io::File::performSetLastModified (jlong time)
modTime.dwHighDateTime = (DWORD) (mTime100ns >> 32);
jboolean retVal = false;
- HANDLE h = CreateFile (buf, FILE_WRITE_ATTRIBUTES,
+ HANDLE h = CreateFile (canon, FILE_WRITE_ATTRIBUTES,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, NULL);
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h
index db05cb618a6..9bcff6fbb55 100644
--- a/libjava/java/lang/Class.h
+++ b/libjava/java/lang/Class.h
@@ -243,7 +243,7 @@ public:
private:
- void checkMemberAccess (jint flags);
+ void memberAccessCheck (jint flags);
void initializeClass (void);
@@ -328,6 +328,9 @@ private:
friend void _Jv_SetVTableEntries (jclass, _Jv_VTable *, jboolean *);
friend void _Jv_MakeVTable (jclass);
+ friend jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
+ jint flags);
+
// Return array class corresponding to element type KLASS, creating it if
// necessary.
inline friend jclass
@@ -366,6 +369,8 @@ private:
friend class gnu::gcj::runtime::StackTrace;
friend class java::io::VMObjectStreamClass;
+ friend void _Jv_sharedlib_register_hook (jclass klass);
+
// Chain for class pool.
jclass next;
// Name of class.
diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java
index 44f5b5ab529..bd776913fdd 100644
--- a/libjava/java/lang/Class.java
+++ b/libjava/java/lang/Class.java
@@ -72,14 +72,7 @@ public final class Class implements Serializable
public Method getDeclaredMethod (String methodName, Class[] parameterTypes)
throws NoSuchMethodException, SecurityException
{
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkMemberAccess(this, Member.DECLARED);
- Package p = getPackage();
- if (p != null)
- sm.checkPackageAccess(p.getName());
- }
+ memberAccessCheck(Member.DECLARED);
if ("<init>".equals(methodName) || "<clinit>".equals(methodName))
throw new NoSuchMethodException(methodName);
@@ -101,9 +94,7 @@ public final class Class implements Serializable
public Field getField (String fieldName)
throws NoSuchFieldException, SecurityException
{
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkMemberAccess (this, java.lang.reflect.Member.DECLARED);
+ memberAccessCheck (Member.PUBLIC);
Field fld = getField(fieldName, fieldName.hashCode());
if (fld == null)
throw new NoSuchFieldException(fieldName);
@@ -148,14 +139,7 @@ public final class Class implements Serializable
public Method getMethod (String methodName, Class[] parameterTypes)
throws NoSuchMethodException, SecurityException
{
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkMemberAccess(this, Member.PUBLIC);
- Package p = getPackage();
- if (p != null)
- sm.checkPackageAccess(p.getName());
- }
+ memberAccessCheck(Member.PUBLIC);
if ("<init>".equals(methodName) || "<clinit>".equals(methodName))
throw new NoSuchMethodException(methodName);
@@ -334,14 +318,6 @@ public final class Class implements Serializable
{
}
- // Do a security check.
- private void checkMemberAccess (int flags)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkMemberAccess(this, flags);
- }
-
// Initialize the class.
private native void initializeClass ();
@@ -361,4 +337,20 @@ public final class Class implements Serializable
return "";
return name.substring(0, lastInd);
}
+
+ /**
+ * Perform security checks common to all of the methods that
+ * get members of this Class.
+ */
+ private void memberAccessCheck(int which)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ {
+ sm.checkMemberAccess(this, which);
+ Package pkg = getPackage();
+ if (pkg != null)
+ sm.checkPackageAccess(pkg.getName());
+ }
+ }
}
diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java
index 5ae70cdba95..008a19e6603 100644
--- a/libjava/java/lang/ClassLoader.java
+++ b/libjava/java/lang/ClassLoader.java
@@ -162,12 +162,10 @@ public abstract class ClassLoader
SecurityManager sm = System.getSecurityManager();
if (sm != null)
{
- /* FIXME: security, getClassContext() not implemented.
Class c = VMSecurityManager.getClassContext()[1];
ClassLoader cl = c.getClassLoader();
- if (cl != null && cl != this)
+ if (cl != null && ! cl.isAncestorOf(this))
sm.checkPermission(new RuntimePermission("getClassLoader"));
- */
}
return parent;
}
@@ -996,4 +994,20 @@ public abstract class ClassLoader
packageAssertionStatus = new HashMap();
classAssertionStatus = new HashMap();
}
+
+ /**
+ * Return true if this loader is either the specified class loader
+ * or an ancestor thereof.
+ * @param loader the class loader to check
+ */
+ final boolean isAncestorOf(ClassLoader loader)
+ {
+ while (loader != null)
+ {
+ if (this == loader)
+ return true;
+ loader = loader.parent;
+ }
+ return false;
+ }
}
diff --git a/libjava/java/lang/InheritableThreadLocal.java b/libjava/java/lang/InheritableThreadLocal.java
index 31b64f54798..5dfbe9a6230 100644
--- a/libjava/java/lang/InheritableThreadLocal.java
+++ b/libjava/java/lang/InheritableThreadLocal.java
@@ -1,5 +1,5 @@
/* InheritableThreadLocal -- a ThreadLocal which inherits values across threads
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,9 +37,11 @@ exception statement from your version. */
package java.lang;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.ArrayList;
+import java.util.Map;
import java.util.WeakHashMap;
/**
@@ -67,7 +69,8 @@ public class InheritableThreadLocal extends ThreadLocal
* List can be collected, too. Maps to a list in case the user overrides
* equals.
*/
- private static final WeakHashMap threadMap = new WeakHashMap();
+ private static final Map threadMap
+ = Collections.synchronizedMap(new WeakHashMap());
/**
* Creates a new InheritableThreadLocal that has no values associated
@@ -77,7 +80,7 @@ public class InheritableThreadLocal extends ThreadLocal
{
Thread currentThread = Thread.currentThread();
// Note that we don't have to synchronize, as only this thread will
- // ever modify the returned heritage.
+ // ever modify the returned heritage and threadMap is a synchronizedMap.
List heritage = (List) threadMap.get(currentThread);
if (heritage == null)
{
@@ -114,7 +117,7 @@ public class InheritableThreadLocal extends ThreadLocal
// The currentThread is the parent of the new thread.
Thread parentThread = Thread.currentThread();
// Note that we don't have to synchronize, as only this thread will
- // ever modify the returned heritage.
+ // ever modify the returned heritage and threadMap is a synchronizedMap.
ArrayList heritage = (ArrayList) threadMap.get(parentThread);
if (heritage != null)
{
diff --git a/libjava/java/lang/Math.java b/libjava/java/lang/Math.java
index 0d0930e8bf6..cb5f70b1cfb 100644
--- a/libjava/java/lang/Math.java
+++ b/libjava/java/lang/Math.java
@@ -1,5 +1,5 @@
/* java.lang.Math -- common mathematical functions, native allowed
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -521,7 +521,7 @@ public final class Math
* double to <code>x / y</code> (ties go to the even n); for a zero
* remainder, the sign is that of <code>x</code>. If either argument is NaN,
* the first argument is infinite, or the second argument is zero, the result
- * is NaN; if x is finite but y is infinte, the result is x. This is
+ * is NaN; if x is finite but y is infinite, the result is x. This is
* accurate within the limits of doubles.
*
* @param x the dividend (the top half)
diff --git a/libjava/java/lang/Runtime.java b/libjava/java/lang/Runtime.java
index 932600b5f8f..5c6037ed8a7 100644
--- a/libjava/java/lang/Runtime.java
+++ b/libjava/java/lang/Runtime.java
@@ -1,5 +1,5 @@
/* Runtime.java -- access to the VM process
- Copyright (C) 1998, 2002 Free Software Foundation
+ Copyright (C) 1998, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -65,7 +65,7 @@ public class Runtime
/**
* The current security manager. This is located here instead of in
- * Runtime, to avoid security problems, as well as bootstrap issues.
+ * System, to avoid security problems, as well as bootstrap issues.
* Make sure to access it in a thread-safe manner; it is package visible
* to avoid overhead in java.lang.
*/
diff --git a/libjava/java/lang/StrictMath.java b/libjava/java/lang/StrictMath.java
index b47d89ca040..bacc291faa5 100644
--- a/libjava/java/lang/StrictMath.java
+++ b/libjava/java/lang/StrictMath.java
@@ -1,5 +1,5 @@
/* java.lang.StrictMath -- common mathematical functions, strict Java
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -1053,7 +1053,7 @@ public final strictfp class StrictMath
* double to <code>x / y</code> (ties go to the even n); for a zero
* remainder, the sign is that of <code>x</code>. If either argument is NaN,
* the first argument is infinite, or the second argument is zero, the result
- * is NaN; if x is finite but y is infinte, the result is x.
+ * is NaN; if x is finite but y is infinite, the result is x.
*
* @param x the dividend (the top half)
* @param y the divisor (the bottom half)
diff --git a/libjava/java/lang/String.java b/libjava/java/lang/String.java
index fe00b9100cc..6844405e34c 100644
--- a/libjava/java/lang/String.java
+++ b/libjava/java/lang/String.java
@@ -419,7 +419,7 @@ public final class String implements Serializable, Comparable, CharSequence
{
// No need to synchronize or mark the buffer, since we know it is
// only used once.
- init (buffer.value, 0, buffer.count, true);
+ init (buffer);
}
/**
@@ -1253,5 +1253,6 @@ public final class String implements Serializable, Comparable, CharSequence
private native void init(byte[] chars, int hibyte, int offset, int count);
private native void init(byte[] chars, int offset, int count, String enc)
throws UnsupportedEncodingException;
+ private native void init(gnu.gcj.runtime.StringBuffer buffer);
private static native void rehash();
}
diff --git a/libjava/java/lang/StringBuffer.java b/libjava/java/lang/StringBuffer.java
index fac7892524e..a7c2590f39a 100644
--- a/libjava/java/lang/StringBuffer.java
+++ b/libjava/java/lang/StringBuffer.java
@@ -564,8 +564,9 @@ public final class StringBuffer implements Serializable, CharSequence
throw new StringIndexOutOfBoundsException();
if (len == 0)
return "";
- // Share the char[] unless 3/4 empty.
- shared = (len << 2) >= value.length;
+ // Share unless substring is smaller than 1/4 of the buffer.
+ if ((len << 2) >= value.length)
+ shared = true;
// Package constructor avoids an array copy.
return new String(value, beginIndex, len, shared);
}
diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java
index 32f7d174580..64498b23ba4 100644
--- a/libjava/java/lang/Thread.java
+++ b/libjava/java/lang/Thread.java
@@ -614,11 +614,6 @@ public class Thread implements Runnable
public Thread (ThreadGroup g, Runnable r, String n)
{
this (currentThread (), g, r, n);
-
- // The Class Libraries book says ``threadName cannot be null''. I
- // take this to mean NullPointerException.
- if (n == null)
- throw new NullPointerException ();
}
/**
@@ -645,15 +640,15 @@ public class Thread implements Runnable
{
// Just ignore stackSize for now.
this (currentThread (), g, r, n);
+ }
+ private Thread (Thread current, ThreadGroup g, Runnable r, String n)
+ {
// The Class Libraries book says ``threadName cannot be null''. I
// take this to mean NullPointerException.
if (n == null)
throw new NullPointerException ();
- }
-
- private Thread (Thread current, ThreadGroup g, Runnable r, String n)
- {
+
if (g == null)
{
// If CURRENT is null, then we are bootstrapping the first thread.
diff --git a/libjava/java/lang/ThreadGroup.java b/libjava/java/lang/ThreadGroup.java
index 80f62b6a7a7..b79c136dffe 100644
--- a/libjava/java/lang/ThreadGroup.java
+++ b/libjava/java/lang/ThreadGroup.java
@@ -718,6 +718,7 @@ public class ThreadGroup
if (groups == null)
return;
threads.remove(t);
+ t.group = null;
// Daemon groups are automatically destroyed when all their threads die.
if (daemon_flag && groups.size() == 0 && threads.size() == 0)
{
diff --git a/libjava/java/lang/ThreadLocal.java b/libjava/java/lang/ThreadLocal.java
index b5877f51b6a..972565949a8 100644
--- a/libjava/java/lang/ThreadLocal.java
+++ b/libjava/java/lang/ThreadLocal.java
@@ -1,5 +1,5 @@
/* ThreadLocal -- a variable with a unique value per thread
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,6 +37,7 @@ exception statement from your version. */
package java.lang;
+import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
@@ -101,7 +102,7 @@ public class ThreadLocal
* <code>set(Thread, Object)</code> and <code>get(Thread)</code> methods
* access it. Package visible for use by InheritableThreadLocal.
*/
- final Map valueMap = new WeakHashMap();
+ final Map valueMap = Collections.synchronizedMap(new WeakHashMap());
/**
* Creates a ThreadLocal object without associating any value to it yet.
@@ -135,7 +136,7 @@ public class ThreadLocal
{
Thread currentThread = Thread.currentThread();
// Note that we don't have to synchronize, as only this thread will
- // ever modify the returned value.
+ // ever modify the returned value and valueMap is a synchronizedMap.
Object value = valueMap.get(currentThread);
if (value == null)
{
@@ -156,7 +157,7 @@ public class ThreadLocal
public void set(Object value)
{
// Note that we don't have to synchronize, as only this thread will
- // ever modify the returned value.
+ // ever modify the returned value and valueMap is a synchronizedMap.
valueMap.put(Thread.currentThread(), value == null ? NULL : value);
}
}
diff --git a/libjava/java/lang/Win32Process.java b/libjava/java/lang/Win32Process.java
index b1c7e027379..7a5872705b8 100644
--- a/libjava/java/lang/Win32Process.java
+++ b/libjava/java/lang/Win32Process.java
@@ -67,6 +67,14 @@ final class ConcreteProcess extends Process
File dir)
throws IOException
{
+ for (int i = 0; i < progarray.length; i++)
+ {
+ String s = progarray[i];
+
+ if ( (s.indexOf (' ') >= 0) || (s.indexOf ('\t') >= 0))
+ progarray[i] = "\"" + s + "\"";
+ }
+
startProcess (progarray, envp, dir);
}
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index 0db8228d63b..4b0858225df 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -101,7 +101,7 @@ java::lang::Class::forName (jstring className)
{
klass = t->classAt (i);
}
- loader = klass->getClassLoader();
+ loader = klass->getClassLoaderInternal();
}
catch (::java::lang::ArrayIndexOutOfBoundsException *e)
{
@@ -113,13 +113,31 @@ java::lang::Class::forName (jstring className)
java::lang::ClassLoader *
java::lang::Class::getClassLoader (void)
{
-#if 0
- // FIXME: the checks we need to do are more complex. See the spec.
- // Currently we can't implement them.
java::lang::SecurityManager *s = java::lang::System::getSecurityManager();
if (s != NULL)
- s->checkPermission (new RuntimePermission (JvNewStringLatin1 ("getClassLoader")));
-#endif
+ {
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ ClassLoader *caller_loader = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ caller_loader = caller->getClassLoaderInternal();
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
+ // If the caller has a non-null class loader, and that loader
+ // is not this class' loader or an ancestor thereof, then do a
+ // security check.
+ if (caller_loader != NULL && ! caller_loader->isAncestorOf(loader))
+ s->checkPermission (new RuntimePermission (JvNewStringLatin1 ("getClassLoader")));
+ }
// The spec requires us to return `null' for primitive classes. In
// other cases we have the option of returning `null' for classes
@@ -136,13 +154,14 @@ java::lang::Class::getClassLoader (void)
java::lang::reflect::Constructor *
java::lang::Class::getConstructor (JArray<jclass> *param_types)
{
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
+
jstring partial_sig = getSignature (param_types, true);
jint hash = partial_sig->hashCode ();
int i = isPrimitive () ? 0 : method_count;
while (--i >= 0)
{
- // FIXME: access checks.
if (_Jv_equalUtf8Consts (methods[i].name, init_name)
&& _Jv_equal (methods[i].signature, partial_sig, hash))
{
@@ -163,7 +182,7 @@ java::lang::Class::getConstructor (JArray<jclass> *param_types)
JArray<java::lang::reflect::Constructor *> *
java::lang::Class::_getConstructors (jboolean declared)
{
- // FIXME: this method needs access checks.
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
int numConstructors = 0;
int max = isPrimitive () ? 0 : method_count;
@@ -206,13 +225,14 @@ java::lang::Class::_getConstructors (jboolean declared)
java::lang::reflect::Constructor *
java::lang::Class::getDeclaredConstructor (JArray<jclass> *param_types)
{
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
+
jstring partial_sig = getSignature (param_types, true);
jint hash = partial_sig->hashCode ();
int i = isPrimitive () ? 0 : method_count;
while (--i >= 0)
{
- // FIXME: access checks.
if (_Jv_equalUtf8Consts (methods[i].name, init_name)
&& _Jv_equal (methods[i].signature, partial_sig, hash))
{
@@ -256,9 +276,7 @@ java::lang::Class::getField (jstring name, jint hash)
java::lang::reflect::Field *
java::lang::Class::getDeclaredField (jstring name)
{
- java::lang::SecurityManager *s = java::lang::System::getSecurityManager();
- if (s != NULL)
- s->checkMemberAccess (this, java::lang::reflect::Member::DECLARED);
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
int hash = name->hashCode();
for (int i = 0; i < field_count; i++)
{
@@ -277,9 +295,7 @@ java::lang::Class::getDeclaredField (jstring name)
JArray<java::lang::reflect::Field *> *
java::lang::Class::getDeclaredFields (void)
{
- java::lang::SecurityManager *s = java::lang::System::getSecurityManager();
- if (s != NULL)
- s->checkMemberAccess (this, java::lang::reflect::Member::DECLARED);
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
JArray<java::lang::reflect::Field *> *result
= (JArray<java::lang::reflect::Field *> *)
JvNewObjectArray (field_count, &java::lang::reflect::Field::class$, NULL);
@@ -361,6 +377,8 @@ java::lang::Class::_getDeclaredMethod (jstring name,
JArray<java::lang::reflect::Method *> *
java::lang::Class::getDeclaredMethods (void)
{
+ memberAccessCheck(java::lang::reflect::Member::DECLARED);
+
int numMethods = 0;
int max = isPrimitive () ? 0 : method_count;
int i;
@@ -424,7 +442,7 @@ java::lang::Class::getClasses (void)
JArray<jclass> *
java::lang::Class::getDeclaredClasses (void)
{
- checkMemberAccess (java::lang::reflect::Member::DECLARED);
+ memberAccessCheck (java::lang::reflect::Member::DECLARED);
// Until we have inner classes, it always makes sense to return an
// empty array.
JArray<jclass> *result
@@ -482,9 +500,7 @@ java::lang::Class::_getFields (JArray<java::lang::reflect::Field *> *result,
JArray<java::lang::reflect::Field *> *
java::lang::Class::getFields (void)
{
- // FIXME: security checking.
-
- using namespace java::lang::reflect;
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
int count = _getFields (NULL, 0);
@@ -518,7 +534,6 @@ java::lang::Class::_getMethod (jstring name, JArray<jclass> *param_types)
int i = klass->isPrimitive () ? 0 : klass->method_count;
while (--i >= 0)
{
- // FIXME: access checks.
if (_Jv_equalUtf8Consts (klass->methods[i].name, utf_name)
&& _Jv_equaln (klass->methods[i].signature, partial_sig, p_len)
&& (klass->methods[i].accflags
@@ -642,7 +657,7 @@ java::lang::Class::getMethods (void)
{
using namespace java::lang::reflect;
- // FIXME: security checks.
+ memberAccessCheck(Member::PUBLIC);
// This will overestimate the size we need.
jint count = _getMethods (NULL, 0);
@@ -696,12 +711,7 @@ java::lang::Class::isInstance (jobject obj)
jobject
java::lang::Class::newInstance (void)
{
- // FIXME: do accessibility checks here. There currently doesn't
- // seem to be any way to do these.
- // FIXME: we special-case one check here just to pass a Plum Hall
- // test. Once access checking is implemented, remove this.
- if (this == &java::lang::Class::class$)
- throw new java::lang::IllegalAccessException;
+ memberAccessCheck(java::lang::reflect::Member::PUBLIC);
if (isPrimitive ()
|| isInterface ()
@@ -1744,7 +1754,26 @@ _Jv_MakeVTable (jclass klass)
{
for (int i = 0; i < klass->vtable_method_count; ++i)
if (! flags[i])
- // FIXME: messsage.
- throw new java::lang::AbstractMethodError ();
+ {
+ using namespace java::lang;
+ while (klass != NULL)
+ {
+ for (int j = 0; j < klass->method_count; ++j)
+ {
+ if (klass->methods[i].index == i)
+ {
+ StringBuffer *buf = new StringBuffer ();
+ buf->append (_Jv_NewStringUtf8Const (klass->methods[i].name));
+ buf->append ((jchar) ' ');
+ buf->append (_Jv_NewStringUtf8Const (klass->methods[i].signature));
+ throw new AbstractMethodError (buf->toString ());
+ }
+ }
+ klass = klass->getSuperclass ();
+ }
+ // Couldn't find the name, which is weird.
+ // But we still must throw the error.
+ throw new AbstractMethodError ();
+ }
}
}
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index 69f78f64491..b86da32f8f3 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -217,7 +217,8 @@ java::lang::Runtime::_load (jstring path, jboolean do_search)
if (h == NULL)
{
const char *msg = lt_dlerror ();
- jstring str = path->concat (JvNewStringLatin1 (": "));
+ jstring str = JvNewStringLatin1 (lib_name);
+ str = str->concat (JvNewStringLatin1 (": "));
str = str->concat (JvNewStringLatin1 (msg));
throw new UnsatisfiedLinkError (str);
}
@@ -563,7 +564,7 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
if (_Jv_Jar_Class_Path)
newprops->put(JvNewStringLatin1 ("java.class.path"),
- JvNewStringLatin1 (_Jv_Jar_Class_Path));
+ JvNewStringLatin1 (_Jv_Jar_Class_Path));
else
{
// FIXME: find libgcj.zip and append its path?
@@ -585,6 +586,9 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
sb->toString ());
}
+ // The path to libgcj's boot classes
+ SET ("sun.boot.class.path", BOOT_CLASS_PATH);
+
// The name used to invoke this process (argv[0] in C).
SET ("gnu.gcj.progname", _Jv_GetSafeArg (0));
diff --git a/libjava/java/lang/natString.cc b/libjava/java/lang/natString.cc
index 98309cfe62e..6fd928478b5 100644
--- a/libjava/java/lang/natString.cc
+++ b/libjava/java/lang/natString.cc
@@ -28,6 +28,7 @@ details. */
#include <java/util/Locale.h>
#include <gnu/gcj/convert/UnicodeToBytes.h>
#include <gnu/gcj/convert/BytesToUnicode.h>
+#include <gnu/gcj/runtime/StringBuffer.h>
#include <jvm.h>
static void unintern (jobject);
@@ -525,6 +526,12 @@ java::lang::String::init (jbyteArray bytes, jint offset, jint count,
this->count = outpos;
}
+void
+java::lang::String::init (gnu::gcj::runtime::StringBuffer *buffer)
+{
+ init (buffer->value, 0, buffer->count, true);
+}
+
jboolean
java::lang::String::equals(jobject anObject)
{
diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc
index e2d42324386..4a08bb138bf 100644
--- a/libjava/java/lang/natSystem.cc
+++ b/libjava/java/lang/natSystem.cc
@@ -66,8 +66,10 @@ java::lang::System::arraycopy (jobject src, jint src_offset,
__JArray *src_a = (__JArray *) src;
__JArray *dst_a = (__JArray *) dst;
if (src_offset < 0 || dst_offset < 0 || count < 0
- || src_offset + count > src_a->length
- || dst_offset + count > dst_a->length)
+ || (unsigned jint) src_offset > (unsigned jint) src_a->length
+ || (unsigned jint) (src_offset + count) > (unsigned jint) src_a->length
+ || (unsigned jint) dst_offset > (unsigned jint) dst_a->length
+ || (unsigned jint) (dst_offset + count) > (unsigned jint) dst_a->length)
throw new ArrayIndexOutOfBoundsException;
// Do-nothing cases.
diff --git a/libjava/java/lang/natWin32Process.cc b/libjava/java/lang/natWin32Process.cc
index ff7ddb5f50a..49fa853a398 100644
--- a/libjava/java/lang/natWin32Process.cc
+++ b/libjava/java/lang/natWin32Process.cc
@@ -9,18 +9,11 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
-
-#include <stdio.h>
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include <platform.h>
// Conflicts with the definition in "java/lang/reflect/Modifier.h"
#undef STRICT
-#include <gcj/cni.h>
-#include <jvm.h>
-
#include <java/lang/ConcreteProcess.h>
#include <java/lang/IllegalThreadStateException.h>
#include <java/lang/InterruptedException.h>
@@ -53,6 +46,11 @@ java::lang::ConcreteProcess::cleanup (void)
errorStream->close ();
errorStream = NULL;
}
+ if (procHandle)
+ {
+ CloseHandle((HANDLE) procHandle);
+ procHandle = (jint) INVALID_HANDLE_VALUE;
+ }
}
void
@@ -99,8 +97,28 @@ java::lang::ConcreteProcess::waitFor (void)
{
DWORD exitStatus = 0UL;
- // FIXME: The wait should be interruptible.
- WaitForSingleObject ((HANDLE) procHandle, INFINITE);
+ // Set up our waitable objects array
+ // - 0: the handle to the process we just launched
+ // - 1: our thread's interrupt event
+ HANDLE arh[2];
+ arh[0] = (HANDLE) procHandle;
+ arh[1] = _Jv_Win32GetInterruptEvent ();
+ DWORD rval = WaitForMultipleObjects (2, arh, 0, INFINITE);
+
+ // Use the returned value from WaitForMultipleObjects
+ // instead of our thread's interrupt_flag to test for
+ // thread interruption. See the comment for
+ // _Jv_Win32GetInterruptEvent().
+ bool bInterrupted = rval == (WAIT_OBJECT_0 + 1);
+
+ if (bInterrupted)
+ {
+ // Querying this forces a reset our thread's interrupt flag.
+ Thread::interrupted();
+
+ cleanup ();
+ throw new InterruptedException ();
+ }
GetExitCodeProcess ((HANDLE) procHandle, &exitStatus);
exitCode = exitStatus;
@@ -111,16 +129,6 @@ java::lang::ConcreteProcess::waitFor (void)
return exitCode;
}
-static char *
-new_string (jstring string)
-{
- jsize s = _Jv_GetStringUTFLength (string);
- char *buf = (char *) _Jv_Malloc (s + 1);
- _Jv_GetStringUTFRegion (string, 0, s, buf);
- buf[s] = '\0';
- return buf;
-}
-
void
java::lang::ConcreteProcess::startProcess (jstringArray progarray,
jstringArray envp,
@@ -136,7 +144,7 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
int cmdLineLen = 0;
for (int i = 0; i < progarray->length; ++i)
- cmdLineLen += (_Jv_GetStringUTFLength (elts[i]) + 3);
+ cmdLineLen += (_Jv_GetStringUTFLength (elts[i]) + 1);
char *cmdLine = (char *) _Jv_Malloc (cmdLineLen + 1);
char *cmdLineCurPos = cmdLine;
@@ -145,11 +153,9 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
{
if (i > 0)
*cmdLineCurPos++ = ' ';
- *cmdLineCurPos++ = '\"';
jsize s = _Jv_GetStringUTFLength (elts[i]);
_Jv_GetStringUTFRegion (elts[i], 0, s, cmdLineCurPos);
cmdLineCurPos += s;
- *cmdLineCurPos++ = '\"';
}
*cmdLineCurPos = '\0';
@@ -179,9 +185,7 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
}
// Get the working directory path, if specified.
- char *wdir = NULL;
- if (dir != NULL)
- wdir = new_string (dir->getPath ());
+ JV_TEMP_UTF_STRING (wdir, dir ? dir->getPath () : 0);
errorStream = NULL;
inputStream = NULL;
@@ -206,29 +210,25 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
sAttrs.lpSecurityDescriptor = NULL;
- char tmpBuff[64];
if (CreatePipe (&cldStdInRd, &cldStdInWr, &sAttrs, 0) == 0)
{
- sprintf (tmpBuff,
- "Error creating stdin pipe (Win32 Error Code: %lu)",
- GetLastError ());
- throw new IOException (JvNewStringLatin1 (tmpBuff));
+ DWORD dwErrorCode = GetLastError ();
+ throw new IOException (_Jv_WinStrError ("Error creating stdin pipe",
+ dwErrorCode));
}
if (CreatePipe (&cldStdOutRd, &cldStdOutWr, &sAttrs, 0) == 0)
{
- sprintf (tmpBuff,
- "Error creating stdout pipe (Win32 Error Code: %lu)",
- GetLastError ());
- throw new IOException (JvNewStringLatin1 (tmpBuff));
+ DWORD dwErrorCode = GetLastError ();
+ throw new IOException (_Jv_WinStrError ("Error creating stdout pipe",
+ dwErrorCode));
}
if (CreatePipe (&cldStdErrRd, &cldStdErrWr, &sAttrs, 0) == 0)
{
- sprintf (tmpBuff,
- "Error creating stderr pipe (Win32 Error Code: %lu)",
- GetLastError ());
- throw new IOException (JvNewStringLatin1 (tmpBuff));
+ DWORD dwErrorCode = GetLastError ();
+ throw new IOException (_Jv_WinStrError ("Error creating stderr pipe",
+ dwErrorCode));
}
outputStream = new FileOutputStream
@@ -265,10 +265,9 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
&si,
&pi) == 0)
{
- sprintf (tmpBuff,
- "Error creating child process (Win32 Error Code: %lu)",
- GetLastError ());
- throw new IOException (JvNewStringLatin1 (tmpBuff));
+ DWORD dwErrorCode = GetLastError ();
+ throw new IOException (
+ _Jv_WinStrError ("Error creating child process", dwErrorCode));
}
procHandle = (jint ) pi.hProcess;
@@ -281,8 +280,6 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
_Jv_Free (cmdLine);
if (env != NULL)
_Jv_Free (env);
- if (wdir != NULL)
- _Jv_Free (wdir);
}
catch (java::lang::Throwable *thrown)
{
diff --git a/libjava/java/lang/ref/Reference.java b/libjava/java/lang/ref/Reference.java
index b02a4ed5775..a6385a81617 100644
--- a/libjava/java/lang/ref/Reference.java
+++ b/libjava/java/lang/ref/Reference.java
@@ -1,5 +1,5 @@
/* java.lang.ref.Reference
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package java.lang.ref;
/**
* This is the base class of all references. A reference allows
- * refering to an object without preventing the garbage collection to
+ * refering to an object without preventing the garbage collector to
* collect it. The only way to get the referred object is via the
* <code>get()</code>-method. This method will return
* <code>null</code> if the object was collected. <br>
@@ -52,11 +52,11 @@ package java.lang.ref;
* There are currently three types of references: soft reference,
* weak reference and phantom reference. <br>
*
- * Soft references will be cleared if the garbage collection is told
+ * Soft references will be cleared if the garbage collector is told
* to free some memory and there are no unreferenced or weakly referenced
* objects. It is useful for caches. <br>
*
- * Weak references will be cleared as soon as the garbage collection
+ * Weak references will be cleared as soon as the garbage collector
* determines that the refered object is only weakly reachable. They
* are useful as keys in hashtables (see <code>WeakHashtable</code>) as
* you get notified when nobody has the key anymore.
@@ -74,7 +74,7 @@ public abstract class Reference
{
/**
* The underlying object. This field is handled in a special way by
- * the garbage collection.
+ * the garbage collector.
* GCJ LOCAL:
* This is a RawData because it must be disguised from the GC.
* END GCJ LOCAL
@@ -83,15 +83,25 @@ public abstract class Reference
/**
* This is like REFERENT but is not scanned by the GC. We keep a
- * copy around so that we can see when clear() has been called.
+ * copy around so that we can clean up our internal data structure
+ * even after clear() is called.
* GCJ LOCAL:
- * This field doesn't exist in Classpath; we use it to detect
- * clearing.
+ * This field doesn't exist in Classpath.
* END GCJ LOCAL
*/
gnu.gcj.RawData copy;
/**
+ * Set to true if {@link #clear()} is called.
+ * GCJ LOCAL:
+ * This field doesn't exist in Classpath. It is used internally in
+ * natReference.cc, which enqueues the reference unless it is true
+ * (has been cleared).
+ * END GCJ LOCAL
+ */
+ boolean cleared = false;
+
+ /**
* The queue this reference is registered on. This is null, if this
* wasn't registered to any queue or reference was already enqueued.
*/
@@ -107,7 +117,7 @@ public abstract class Reference
Reference nextOnQueue;
/**
- * This lock should be taken by the garbage collection, before
+ * This lock should be taken by the garbage collector, before
* determining reachability. It will prevent the get()-method to
* return the reference so that reachability doesn't change.
*/
@@ -152,7 +162,7 @@ public abstract class Reference
*/
public Object get()
{
- synchronized(lock)
+ synchronized (lock)
{
return referent;
}
@@ -161,13 +171,17 @@ public abstract class Reference
/**
* Clears the reference, so that it doesn't refer to its object
* anymore. For soft and weak references this is called by the
- * garbage collection. For phantom references you should call
+ * garbage collector. For phantom references you should call
* this when enqueuing the reference.
*/
public void clear()
{
- referent = null;
- copy = null;
+ // Must synchronize so changes are visible in finalizer thread.
+ synchronized (lock)
+ {
+ referent = null;
+ cleared = true;
+ }
}
/**
@@ -181,7 +195,7 @@ public abstract class Reference
/**
* Enqueue an object on a reference queue. This is normally executed
- * by the garbage collection.
+ * by the garbage collector.
*/
public boolean enqueue()
{
diff --git a/libjava/java/lang/ref/natReference.cc b/libjava/java/lang/ref/natReference.cc
index 64262f900cb..551bd0809d1 100644
--- a/libjava/java/lang/ref/natReference.cc
+++ b/libjava/java/lang/ref/natReference.cc
@@ -1,6 +1,6 @@
// natReference.cc - Native code for References
-/* Copyright (C) 2001, 2002 Free Software Foundation
+/* Copyright (C) 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -67,6 +67,8 @@ static int hash_count = 0;
// Number of slots total in HASH. Must be power of 2.
static int hash_size = 0;
+#define DELETED_REFERENCE ((jobject) -1)
+
static object_list *
find_slot (jobject key)
{
@@ -89,7 +91,10 @@ find_slot (jobject key)
return &hash[deleted_index];
}
else if (ptr->weight == DELETED)
- deleted_index = index;
+ {
+ deleted_index = index;
+ JvAssert (ptr->reference == DELETED_REFERENCE);
+ }
index = (index + step) & (hash_size - 1);
JvAssert (index != start_index);
}
@@ -132,6 +137,11 @@ remove_from_hash (jobject obj)
java::lang::ref::Reference *ref
= reinterpret_cast<java::lang::ref::Reference *> (obj);
object_list *head = find_slot (ref->copy);
+
+ // We might have found a new slot. We can just ignore that here.
+ if (head->reference != ref->copy)
+ return;
+
object_list **link = &head->next;
head = head->next;
@@ -168,7 +178,7 @@ add_to_hash (java::lang::ref::Reference *the_reference)
// Use `copy' here because the `referent' field has been cleared.
jobject referent = the_reference->copy;
object_list *item = find_slot (referent);
- if (item->reference == NULL)
+ if (item->reference == NULL || item->reference == DELETED_REFERENCE)
{
// New item, so make an entry for the finalizer.
item->reference = referent;
@@ -217,6 +227,7 @@ finalize_referred_to_object (jobject obj)
// run, all the object's references have been processed, and the
// object is unreachable. There is, at long last, no way to
// resurrect it.
+ list->reference = DELETED_REFERENCE;
list->weight = DELETED;
--hash_count;
return;
@@ -247,9 +258,7 @@ finalize_referred_to_object (jobject obj)
{
java::lang::ref::Reference *ref
= reinterpret_cast<java::lang::ref::Reference *> (head->reference);
- // If the copy is already NULL then the user must have
- // called Reference.clear().
- if (ref->copy != NULL)
+ if (! ref->cleared)
ref->enqueue ();
object_list *next = head->next;
diff --git a/libjava/java/lang/reflect/Constructor.java b/libjava/java/lang/reflect/Constructor.java
index 4a30e2ae394..53db35a6975 100644
--- a/libjava/java/lang/reflect/Constructor.java
+++ b/libjava/java/lang/reflect/Constructor.java
@@ -1,6 +1,6 @@
// Constructor.java - Represents a constructor for a class.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -11,88 +11,196 @@ details. */
package java.lang.reflect;
/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date December 12, 1998
+ * The Constructor class represents a constructor of a class. It also allows
+ * dynamic creation of an object, via reflection. Invocation on Constructor
+ * objects knows how to do widening conversions, but throws
+ * {@link IllegalArgumentException} if a narrowing conversion would be
+ * necessary. You can query for information on this Constructor regardless
+ * of location, but construction access may be limited by Java language
+ * access controls. If you can't do it in the compiler, you can't normally
+ * do it here either.<p>
+ *
+ * <B>Note:</B> This class returns and accepts types as Classes, even
+ * primitive types; there are Class types defined that represent each
+ * different primitive type. They are <code>java.lang.Boolean.TYPE,
+ * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
+ * byte.class</code>, etc. These are not to be confused with the
+ * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
+ * real classes.<p>
+ *
+ * Also note that this is not a serializable class. It is entirely feasible
+ * to make it serializable using the Externalizable interface, but this is
+ * on Sun, not me.
+ *
+ * @author John Keiser
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey <tromey@redhat.com>
+ * @see Member
+ * @see Class
+ * @see java.lang.Class#getConstructor(Object[])
+ * @see java.lang.Class#getDeclaredConstructor(Object[])
+ * @see java.lang.Class#getConstructors()
+ * @see java.lang.Class#getDeclaredConstructors()
+ * @since 1.1
+ * @status updated to 1.4
*/
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Incomplete: needs a private constructor, and
- * newInstance() needs to be written.
- */
-
public final class Constructor extends AccessibleObject implements Member
{
- public boolean equals (Object obj)
- {
- if (! (obj instanceof Constructor))
- return false;
- Constructor c = (Constructor) obj;
- return declaringClass == c.declaringClass && offset == c.offset;
- }
+ /**
+ * This class is uninstantiable except from native code.
+ */
+ private Constructor ()
+ {
+ }
+ /**
+ * Gets the class that declared this constructor.
+ * @return the class that declared this member
+ */
public Class getDeclaringClass ()
- {
- return declaringClass;
- }
-
- public Class[] getExceptionTypes ()
- {
- if (exception_types == null)
- getType();
- return (Class[]) exception_types.clone();
- }
-
- public native int getModifiers ();
+ {
+ return declaringClass;
+ }
+ /**
+ * Gets the name of this constructor (the non-qualified name of the class
+ * it was declared in).
+ * @return the name of this constructor
+ */
public String getName ()
{
return declaringClass.getName();
}
+ /**
+ * Gets the modifiers this constructor uses. Use the <code>Modifier</code>
+ * class to interpret the values. A constructor can only have a subset of the
+ * following modifiers: public, private, protected.
+ *
+ * @return an integer representing the modifiers to this Member
+ * @see Modifier
+ */
+ public native int getModifiers ();
+
+ /**
+ * Get the parameter list for this constructor, in declaration order. If the
+ * constructor takes no parameters, returns a 0-length array (not null).
+ *
+ * @return a list of the types of the constructor's parameters
+ */
public Class[] getParameterTypes ()
- {
- if (parameter_types == null)
- getType ();
- return (Class[]) parameter_types.clone();
- }
+ {
+ if (parameter_types == null)
+ getType ();
+ return (Class[]) parameter_types.clone();
+ }
+ /**
+ * Get the exception types this constructor says it throws, in no particular
+ * order. If the constructor has no throws clause, returns a 0-length array
+ * (not null).
+ *
+ * @return a list of the types in the constructor's throws clause
+ */
+ public Class[] getExceptionTypes ()
+ {
+ if (exception_types == null)
+ getType();
+ return (Class[]) exception_types.clone();
+ }
+
+ /**
+ * Compare two objects to see if they are semantically equivalent.
+ * Two Constructors are semantically equivalent if they have the same
+ * declaring class and the same parameter list.
+ *
+ * @param o the object to compare to
+ * @return <code>true</code> if they are equal; <code>false</code> if not.
+ */
+ public boolean equals (Object obj)
+ {
+ if (! (obj instanceof Constructor))
+ return false;
+ Constructor c = (Constructor) obj;
+ return declaringClass == c.declaringClass && offset == c.offset;
+ }
+
+ /**
+ * Get the hash code for the Constructor.
+ *
+ * @return the hash code for the object
+ */
public int hashCode ()
- {
- // FIXME.
- return getName().hashCode() + declaringClass.getName().hashCode();
- }
+ {
+ // FIXME.
+ return getName().hashCode() + declaringClass.getName().hashCode();
+ }
- // Update cached values from method descriptor in class.
- private native void getType ();
+ /**
+ * Get a String representation of the Constructor. A Constructor's String
+ * representation is "&lt;modifier&gt; &lt;classname&gt;(&lt;paramtypes&gt;)
+ * throws &lt;exceptions&gt;", where everything after ')' is omitted if
+ * there are no exceptions.<br> Example:
+ * <code>public java.io.FileInputStream(java.lang.Runnable)
+ * throws java.io.FileNotFoundException</code>
+ *
+ * @return the String representation of the Constructor
+ */
+ public String toString ()
+ {
+ if (parameter_types == null)
+ getType ();
+ StringBuffer b = new StringBuffer ();
+ Modifier.toString(getModifiers(), b);
+ b.append(" ");
+ Method.appendClassName (b, declaringClass);
+ b.append("(");
+ for (int i = 0; i < parameter_types.length; ++i)
+ {
+ Method.appendClassName (b, parameter_types[i]);
+ if (i < parameter_types.length - 1)
+ b.append(",");
+ }
+ b.append(")");
+ return b.toString();
+ }
+ /**
+ * Create a new instance by invoking the constructor. Arguments are
+ * automatically unwrapped and widened, if needed.<p>
+ *
+ * If this class is abstract, you will get an
+ * <code>InstantiationException</code>. If the constructor takes 0
+ * arguments, you may use null or a 0-length array for <code>args</code>.<p>
+ *
+ * If this Constructor enforces access control, your runtime context is
+ * evaluated, and you may have an <code>IllegalAccessException</code> if
+ * you could not create this object in similar compiled code. If the class
+ * is uninitialized, you trigger class initialization, which may end in a
+ * <code>ExceptionInInitializerError</code>.<p>
+ *
+ * Then, the constructor is invoked. If it completes normally, the return
+ * value will be the new object. If it completes abruptly, the exception is
+ * wrapped in an <code>InvocationTargetException</code>.
+ *
+ * @param args the arguments to the constructor
+ * @return the newly created object
+ * @throws IllegalAccessException if the constructor could not normally be
+ * called by the Java code (i.e. it is not public)
+ * @throws IllegalArgumentException if the number of arguments is incorrect;
+ * or if the arguments types are wrong even with a widening
+ * conversion
+ * @throws InstantiationException if the class is abstract
+ * @throws InvocationTargetException if the constructor throws an exception
+ * @throws ExceptionInInitializerError if construction triggered class
+ * initialization, which then failed
+ */
public native Object newInstance (Object[] args)
throws InstantiationException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException;
+ IllegalArgumentException, InvocationTargetException;
- public String toString ()
- {
- if (parameter_types == null)
- getType ();
- StringBuffer b = new StringBuffer ();
- Modifier.toString(getModifiers(), b);
- b.append(" ");
- Method.appendClassName (b, declaringClass);
- b.append("(");
- for (int i = 0; i < parameter_types.length; ++i)
- {
- Method.appendClassName (b, parameter_types[i]);
- if (i < parameter_types.length - 1)
- b.append(",");
- }
- b.append(")");
- return b.toString();
- }
-
- // Can't create these.
- private Constructor ()
- {
- }
+ // Update cached values from method descriptor in class.
+ private native void getType ();
// Declaring class.
private Class declaringClass;
diff --git a/libjava/java/lang/reflect/Field.java b/libjava/java/lang/reflect/Field.java
index 6410a7f770d..b54a103d9bc 100644
--- a/libjava/java/lang/reflect/Field.java
+++ b/libjava/java/lang/reflect/Field.java
@@ -1,4 +1,4 @@
-/* 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.
@@ -12,15 +12,6 @@ package java.lang.reflect;
* @author Per Bothner <bothner@cygnus.com>
* @date September 1998; February 1999.
*/
-/* Status: Mostly implemented.
- * However, access checks are not implemented. See natField.cc for
- * _Jv_CheckFieldAccessibility as well as the missing getCaller.
- * Note that the idea is to have to compiler convert calls to
- * setXXX(...) and getXXX(...) to setXXX(CALLER, ...) and getXXX(CALLER, ...),
- * where CALLER is reference to the class that contains the calls to
- * setXXX or getXXX. This is easy for the compiler, and replaces
- * expensive stack and table searching with a constant.
- */
public final class Field extends AccessibleObject implements Member
{
@@ -39,12 +30,12 @@ public final class Field extends AccessibleObject implements Member
}
public boolean equals (Object fld)
- {
- if (! (fld instanceof Field))
- return false;
- Field f = (Field) fld;
- return declaringClass == f.declaringClass && offset == f.offset;
- }
+ {
+ if (! (fld instanceof Field))
+ return false;
+ Field f = (Field) fld;
+ return declaringClass == f.declaringClass && offset == f.offset;
+ }
public Class getDeclaringClass ()
{
@@ -62,11 +53,6 @@ public final class Field extends AccessibleObject implements Member
return (declaringClass.hashCode() ^ offset);
}
- // The idea is that the compiler will magically translate
- // fld.getShort(obj) to fld.getShort(THISCLASS, obj).
- // This makes checking assessiblity more efficient,
- // since we don't have to do any stack-walking.
-
public boolean getBoolean (Object obj)
throws IllegalArgumentException, IllegalAccessException
{
diff --git a/libjava/java/lang/reflect/Method.java b/libjava/java/lang/reflect/Method.java
index 7bd0a312511..3e0507fcaa1 100644
--- a/libjava/java/lang/reflect/Method.java
+++ b/libjava/java/lang/reflect/Method.java
@@ -1,6 +1,6 @@
// Method.java - Represent method of class or interface.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -13,43 +13,92 @@ package java.lang.reflect;
import gnu.gcj.RawData;
/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date December 12, 1998
+ * The Method class represents a member method of a class. It also allows
+ * dynamic invocation, via reflection. This works for both static and
+ * instance methods. Invocation on Method objects knows how to do
+ * widening conversions, but throws {@link IllegalArgumentException} if
+ * a narrowing conversion would be necessary. You can query for information
+ * on this Method regardless of location, but invocation access may be limited
+ * by Java language access controls. If you can't do it in the compiler, you
+ * can't normally do it here either.<p>
+ *
+ * <B>Note:</B> This class returns and accepts types as Classes, even
+ * primitive types; there are Class types defined that represent each
+ * different primitive type. They are <code>java.lang.Boolean.TYPE,
+ * java.lang.Byte.TYPE,</code>, also available as <code>boolean.class,
+ * byte.class</code>, etc. These are not to be confused with the
+ * classes <code>java.lang.Boolean, java.lang.Byte</code>, etc., which are
+ * real classes.<p>
+ *
+ * Also note that this is not a serializable class. It is entirely feasible
+ * to make it serializable using the Externalizable interface, but this is
+ * on Sun, not me.
+ *
+ * @author John Keiser
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey <tromey@redhat.com>
+ * @see Member
+ * @see Class
+ * @see java.lang.Class#getMethod(String,Object[])
+ * @see java.lang.Class#getDeclaredMethod(String,Object[])
+ * @see java.lang.Class#getMethods()
+ * @see java.lang.Class#getDeclaredMethods()
+ * @since 1.1
+ * @status updated to 1.4
*/
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Complete, but not correct: access checks aren't done.
- */
-
public final class Method extends AccessibleObject implements Member
{
- public boolean equals (Object obj)
+ /**
+ * This class is uninstantiable.
+ */
+ private Method ()
{
- if (! (obj instanceof Method))
- return false;
- Method m = (Method) obj;
- return declaringClass == m.declaringClass && offset == m.offset;
}
+ /**
+ * Gets the class that declared this method, or the class where this method
+ * is a non-inherited member.
+ * @return the class that declared this member
+ */
public Class getDeclaringClass ()
{
return declaringClass;
}
- public Class[] getExceptionTypes ()
- {
- if (exception_types == null)
- getType();
- return (Class[]) exception_types.clone();
- }
+ /**
+ * Gets the name of this method.
+ * @return the name of this method
+ */
+ public native String getName ();
+ /**
+ * Gets the modifiers this method uses. Use the <code>Modifier</code>
+ * class to interpret the values. A method can only have a subset of the
+ * following modifiers: public, private, protected, abstract, static,
+ * final, synchronized, native, and strictfp.
+ *
+ * @return an integer representing the modifiers to this Member
+ * @see Modifier
+ */
public native int getModifiers ();
- public native String getName ();
-
- private native void getType ();
+ /**
+ * Gets the return type of this method.
+ * @return the type of this method
+ */
+ public Class getReturnType ()
+ {
+ if (return_type == null)
+ getType();
+ return return_type;
+ }
+ /**
+ * Get the parameter list for this method, in declaration order. If the
+ * method takes no parameters, returns a 0-length array (not null).
+ *
+ * @return a list of the types of the method's parameters
+ */
public Class[] getParameterTypes ()
{
if (parameter_types == null)
@@ -57,43 +106,57 @@ public final class Method extends AccessibleObject implements Member
return (Class[]) parameter_types.clone();
}
- public Class getReturnType ()
+ /**
+ * Get the exception types this method says it throws, in no particular
+ * order. If the method has no throws clause, returns a 0-length array
+ * (not null).
+ *
+ * @return a list of the types in the method's throws clause
+ */
+ public Class[] getExceptionTypes ()
{
- if (return_type == null)
+ if (exception_types == null)
getType();
- return return_type;
+ return (Class[]) exception_types.clone();
}
- public int hashCode ()
+ /**
+ * Compare two objects to see if they are semantically equivalent.
+ * Two Methods are semantically equivalent if they have the same declaring
+ * class, name, and parameter list. This ignores different exception
+ * clauses or return types.
+ *
+ * @param o the object to compare to
+ * @return <code>true</code> if they are equal; <code>false</code> if not
+ */
+ public boolean equals (Object obj)
{
- // FIXME.
- return getName().hashCode() + declaringClass.getName().hashCode();
+ if (! (obj instanceof Method))
+ return false;
+ Method m = (Method) obj;
+ return declaringClass == m.declaringClass && offset == m.offset;
}
- public native Object invoke (Object obj, Object[] args)
- throws IllegalAccessException, IllegalArgumentException,
- InvocationTargetException;
-
- // Append a class name to a string buffer. We try to print the
- // fully-qualified name, the way that a Java programmer would expect
- // it to be written. Weirdly, Class has no appropriate method for
- // this.
- static void appendClassName (StringBuffer buf, Class k)
+ /**
+ * Get the hash code for the Method.
+ *
+ * @return the hash code for the object
+ */
+ public int hashCode ()
{
- if (k.isArray ())
- {
- appendClassName (buf, k.getComponentType ());
- buf.append ("[]");
- }
- else
- {
- // This is correct for primitive and reference types. Really
- // we'd like `Main$Inner' to be printed as `Main.Inner', I
- // think, but that is a pain.
- buf.append (k.getName ());
- }
+ // FIXME.
+ return getName().hashCode() + declaringClass.getName().hashCode();
}
+ /**
+ * Get a String representation of the Method. A Method's String
+ * representation is "&lt;modifiers&gt; &lt;returntype&gt;
+ * &lt;methodname&gt;(&lt;paramtypes&gt;) throws &lt;exceptions&gt;", where
+ * everything after ')' is omitted if there are no exceptions.<br> Example:
+ * <code>public static int run(java.lang.Runnable,int)</code>
+ *
+ * @return the String representation of the Method
+ */
public String toString ()
{
if (parameter_types == null)
@@ -128,8 +191,71 @@ public final class Method extends AccessibleObject implements Member
return b.toString();
}
- private Method ()
+ /**
+ * Invoke the method. Arguments are automatically unwrapped and widened,
+ * and the result is automatically wrapped, if needed.<p>
+ *
+ * If the method is static, <code>o</code> will be ignored. Otherwise,
+ * the method uses dynamic lookup as described in JLS 15.12.4.4. You cannot
+ * mimic the behavior of nonvirtual lookup (as in super.foo()). This means
+ * you will get a <code>NullPointerException</code> if <code>o</code> is
+ * null, and an <code>IllegalArgumentException</code> if it is incompatible
+ * with the declaring class of the method. If the method takes 0 arguments,
+ * you may use null or a 0-length array for <code>args</code>.<p>
+ *
+ * Next, if this Method enforces access control, your runtime context is
+ * evaluated, and you may have an <code>IllegalAccessException</code> if
+ * you could not acces this method in similar compiled code. If the method
+ * is static, and its class is uninitialized, you trigger class
+ * initialization, which may end in a
+ * <code>ExceptionInInitializerError</code>.<p>
+ *
+ * Finally, the method is invoked. If it completes normally, the return value
+ * will be null for a void method, a wrapped object for a primitive return
+ * method, or the actual return of an Object method. If it completes
+ * abruptly, the exception is wrapped in an
+ * <code>InvocationTargetException</code>.
+ *
+ * @param o the object to invoke the method on
+ * @param args the arguments to the method
+ * @return the return value of the method, wrapped in the appropriate
+ * wrapper if it is primitive
+ * @throws IllegalAccessException if the method could not normally be called
+ * by the Java code (i.e. it is not public)
+ * @throws IllegalArgumentException if the number of arguments is incorrect;
+ * if the arguments types are wrong even with a widening conversion;
+ * or if <code>o</code> is not an instance of the class or interface
+ * declaring this method
+ * @throws InvocationTargetException if the method throws an exception
+ * @throws NullPointerException if <code>o</code> is null and this field
+ * requires an instance
+ * @throws ExceptionInInitializerError if accessing a static method triggered
+ * class initialization, which then failed
+ */
+ public native Object invoke (Object obj, Object[] args)
+ throws IllegalAccessException, IllegalArgumentException,
+ InvocationTargetException;
+
+ private native void getType ();
+
+ // Append a class name to a string buffer. We try to print the
+ // fully-qualified name, the way that a Java programmer would expect
+ // it to be written. Weirdly, Class has no appropriate method for
+ // this.
+ static void appendClassName (StringBuffer buf, Class k)
{
+ if (k.isArray ())
+ {
+ appendClassName (buf, k.getComponentType ());
+ buf.append ("[]");
+ }
+ else
+ {
+ // This is correct for primitive and reference types. Really
+ // we'd like `Main$Inner' to be printed as `Main.Inner', I
+ // think, but that is a pain.
+ buf.append (k.getName ());
+ }
}
// Declaring class.
diff --git a/libjava/java/lang/reflect/Proxy.java b/libjava/java/lang/reflect/Proxy.java
index e327f44664b..1b38a483842 100644
--- a/libjava/java/lang/reflect/Proxy.java
+++ b/libjava/java/lang/reflect/Proxy.java
@@ -1,5 +1,5 @@
/* Proxy.java -- build a proxy class that implements reflected interfaces
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -733,7 +733,7 @@ public class Proxy implements Serializable
* The package this class is in. Possibly null, meaning the unnamed
* package.
*/
- Package pack;
+ String pack;
/**
* The interfaces this class implements. Non-null, but possibly empty.
@@ -777,6 +777,21 @@ public class Proxy implements Serializable
}
/**
+ * Return the name of a package given the name of a class.
+ * Returns null if no package. We use this in preference to
+ * using Class.getPackage() to avoid problems with ClassLoaders
+ * that don't set the package.
+ */
+ static String getPackage(Class k)
+ {
+ String name = k.getName();
+ int idx = name.lastIndexOf('.');
+ if (idx >= 0)
+ return name.substring(0, idx);
+ return null;
+ }
+
+ /**
* Verifies that the arguments are legal, and sets up remaining data
* This should only be called when a class must be generated, as
* it is expensive.
@@ -818,8 +833,8 @@ public class Proxy implements Serializable
if (! Modifier.isPublic(inter.getModifiers()))
if (in_package)
{
- Package p = inter.getPackage();
- if (data.pack != inter.getPackage())
+ String p = getPackage(inter);
+ if (! data.pack.equals(p))
throw new IllegalArgumentException("non-public interfaces "
+ "from different "
+ "packages");
@@ -827,7 +842,7 @@ public class Proxy implements Serializable
else
{
in_package = true;
- data.pack = inter.getPackage();
+ data.pack = getPackage(inter);
}
for (int j = i-1; j >= 0; j--)
if (data.interfaces[j] == inter)
@@ -954,7 +969,7 @@ public class Proxy implements Serializable
// access_flags
putU2(Modifier.SUPER | Modifier.FINAL | Modifier.PUBLIC);
// this_class
- qualName = ((data.pack == null ? "" : data.pack.getName() + '.')
+ qualName = ((data.pack == null ? "" : data.pack + '.')
+ "$Proxy" + data.id);
putU2(classInfo(TypeSignature.getEncodingOfClass(qualName, false)));
// super_class
diff --git a/libjava/java/lang/reflect/natArray.cc b/libjava/java/lang/reflect/natArray.cc
index 78751229eab..ce76b9c92d4 100644
--- a/libjava/java/lang/reflect/natArray.cc
+++ b/libjava/java/lang/reflect/natArray.cc
@@ -1,6 +1,6 @@
// natField.cc - Implementation of java.lang.reflect.Field native methods.
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -15,6 +15,7 @@ details. */
#include <jvm.h>
#include <gcj/cni.h>
#include <java/lang/reflect/Array.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <java/lang/IllegalArgumentException.h>
#include <java/lang/Byte.h>
#include <java/lang/Short.h>
@@ -38,8 +39,8 @@ java::lang::reflect::Array::newInstance (jclass componentType, jint length)
return _Jv_NewPrimArray (componentType, length);
}
else
+ // FIXME: class loader?
return JvNewObjectArray (length, componentType, NULL);
-
}
jobject
@@ -52,10 +53,26 @@ java::lang::reflect::Array::newInstance (jclass componentType,
jint* dims = elements (dimensions);
if (ndims == 1)
return newInstance (componentType, dims[0]);
+
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ ClassLoader *caller_loader = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ caller_loader = caller->getClassLoaderInternal();
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
jclass arrayType = componentType;
- for (int i = 0; i < ndims; i++) // FIXME 2nd arg should
- // be "current" loader
- arrayType = _Jv_GetArrayClass (arrayType, 0);
+ for (int i = 0; i < ndims; i++)
+ arrayType = _Jv_GetArrayClass (arrayType, caller_loader);
return _Jv_NewMultiArray (arrayType, ndims, dims);
}
@@ -343,9 +360,11 @@ java::lang::reflect::Array::setBoolean (jobject array,
void
java::lang::reflect::Array::set (jobject array, jint index,
- jobject value, jclass elType)
+ jobject value, jclass elType)
{
- if (! _Jv_IsInstanceOf (value, elType))
+ // We don't have to call getElementType here, or check INDEX,
+ // because it was already done in the Java wrapper.
+ if (value != NULL && ! _Jv_IsInstanceOf (value, elType))
throw new java::lang::IllegalArgumentException;
elements ((jobjectArray) array) [index] = value;
}
diff --git a/libjava/java/lang/reflect/natConstructor.cc b/libjava/java/lang/reflect/natConstructor.cc
index 7f90b1243e4..466c7544112 100644
--- a/libjava/java/lang/reflect/natConstructor.cc
+++ b/libjava/java/lang/reflect/natConstructor.cc
@@ -1,6 +1,6 @@
// natConstructor.cc - Native code for Constructor class.
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -13,6 +13,8 @@ details. */
#include <gcj/cni.h>
#include <jvm.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
+#include <java/lang/IllegalAccessException.h>
#include <java/lang/reflect/Constructor.h>
#include <java/lang/reflect/Method.h>
#include <java/lang/reflect/InvocationTargetException.h>
@@ -46,6 +48,24 @@ java::lang::reflect::Constructor::newInstance (jobjectArray args)
if (parameter_types == NULL)
getType ();
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
+ if (! isAccessible() && ! _Jv_CheckAccess(caller, declaringClass,
+ declaringClass->getModifiers()))
+ throw new java::lang::IllegalAccessException;
+
using namespace java::lang::reflect;
if (Modifier::isAbstract (declaringClass->getModifiers()))
throw new InstantiationException;
diff --git a/libjava/java/lang/reflect/natField.cc b/libjava/java/lang/reflect/natField.cc
index 93e27a280ce..b7f12f06e92 100644
--- a/libjava/java/lang/reflect/natField.cc
+++ b/libjava/java/lang/reflect/natField.cc
@@ -1,6 +1,6 @@
// natField.cc - Implementation of java.lang.reflect.Field native methods.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
@@ -15,6 +15,7 @@ details. */
#include <jvm.h>
#include <java/lang/reflect/Field.h>
#include <java/lang/reflect/Modifier.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <java/lang/IllegalArgumentException.h>
#include <java/lang/IllegalAccessException.h>
#include <java/lang/NullPointerException.h>
@@ -46,31 +47,37 @@ java::lang::reflect::Field::getType ()
{
jfieldID fld = _Jv_FromReflectedField (this);
JvSynchronize sync (declaringClass);
- _Jv_ResolveField (fld, declaringClass->getClassLoader ());
+ _Jv_ResolveField (fld, declaringClass->getClassLoaderInternal ());
return fld->type;
}
-static void
-_Jv_CheckFieldAccessibility (jfieldID /*fld*/, jclass /*caller*/)
-{
-#if 0
- if (caller == NULL)
- caller = getCaller();
-#endif
-#if 0
- _Jv_ushort flags = fld->getModifiers();
- check accesss;
-#endif
-}
-
static void*
getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
{
+ // FIXME: we know CALLER is NULL here. At one point we planned to
+ // have the compiler insert the caller as a hidden argument in some
+ // calls. However, we never implemented that, so we have to find
+ // the caller by hand instead.
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(7);
+ try
+ {
+ // We want to skip all the frames on the stack from this class.
+ for (int i = 1;
+ !caller || caller == &java::lang::reflect::Field::class$;
+ i++)
+ caller = t->classAt (i);
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
jfieldID fld = _Jv_FromReflectedField (field);
_Jv_ushort flags = fld->getModifiers();
- if (! (flags & java::lang::reflect::Modifier::PUBLIC)
- && ! field->isAccessible ())
- _Jv_CheckFieldAccessibility (fld, caller);
+ if (! field->isAccessible ()
+ && ! _Jv_CheckAccess (caller, field->getDeclaringClass(), flags))
+ throw new java::lang::IllegalAccessException;
+
if (flags & java::lang::reflect::Modifier::STATIC)
{
jclass fldClass = field->getDeclaringClass ();
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc
index c0f7077cc40..6330c4b4675 100644
--- a/libjava/java/lang/reflect/natMethod.cc
+++ b/libjava/java/lang/reflect/natMethod.cc
@@ -1,6 +1,6 @@
// natMethod.cc - Native code for Method class.
-/* 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 libgcj.
@@ -30,6 +30,8 @@ details. */
#include <java/lang/Double.h>
#include <java/lang/IllegalArgumentException.h>
#include <java/lang/NullPointerException.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
+#include <java/lang/VirtualMachineError.h>
#include <java/lang/Class.h>
#include <gcj/method.h>
#include <gnu/gcj/RawData.h>
@@ -142,19 +144,33 @@ java::lang::reflect::Method::invoke (jobject obj, jobjectArray args)
if (parameter_types == NULL)
getType ();
+ gnu::gcj::runtime::StackTrace *t
+ = new gnu::gcj::runtime::StackTrace(4);
+ Class *caller = NULL;
+ try
+ {
+ for (int i = 1; !caller; i++)
+ {
+ caller = t->classAt (i);
+ }
+ }
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
jmethodID meth = _Jv_FromReflectedMethod (this);
+ jclass klass;
if (! java::lang::reflect::Modifier::isStatic(meth->accflags))
{
- jclass k = obj ? obj->getClass() : NULL;
if (! obj)
throw new java::lang::NullPointerException;
- if (! declaringClass->isAssignableFrom(k))
+ klass = obj->getClass();
+ if (! declaringClass->isAssignableFrom(klass))
throw new java::lang::IllegalArgumentException;
- // FIXME: access checks.
// Find the possibly overloaded method based on the runtime type
// of the object.
- meth = _Jv_LookupDeclaredMethod (k, meth->name, meth->signature);
+ meth = _Jv_LookupDeclaredMethod (klass, meth->name, meth->signature);
}
else
{
@@ -162,8 +178,12 @@ java::lang::reflect::Method::invoke (jobject obj, jobjectArray args)
// here and not in _Jv_CallAnyMethodA because JNI initializes a
// class whenever a method lookup is done.
_Jv_InitClass (declaringClass);
+ klass = declaringClass;
}
+ if (! isAccessible() && ! _Jv_CheckAccess(caller, klass, meth->accflags))
+ throw new IllegalArgumentException;
+
return _Jv_CallAnyMethodA (obj, return_type, meth, false,
parameter_types, args);
}
@@ -207,7 +227,7 @@ java::lang::reflect::Method::getType ()
jclass *elts = elements (exception_types);
for (int i = 0; i < count; ++i)
elts[i] = _Jv_FindClass (method->throws[i],
- declaringClass->getClassLoader ());
+ declaringClass->getClassLoaderInternal ());
}
void
@@ -218,7 +238,7 @@ _Jv_GetTypesFromSignature (jmethodID method,
{
_Jv_Utf8Const* sig = method->signature;
- java::lang::ClassLoader *loader = declaringClass->getClassLoader();
+ java::lang::ClassLoader *loader = declaringClass->getClassLoaderInternal();
char *ptr = sig->data;
int numArgs = 0;
/* First just count the number of parameters. */
@@ -290,9 +310,8 @@ _Jv_GetTypesFromSignature (jmethodID method,
break;
}
- // FIXME: 2'nd argument should be "current loader"
while (--num_arrays >= 0)
- type = _Jv_GetArrayClass (type, 0);
+ type = _Jv_GetArrayClass (type, loader);
// ARGPTR can be NULL if we are processing the return value of a
// call from Constructor.
if (argPtr)
@@ -309,14 +328,15 @@ _Jv_GetTypesFromSignature (jmethodID method,
// to a `jvalue' (see jni.h); for a void method this should be NULL.
// This function returns an exception (if one was thrown), or NULL if
// the call went ok.
-jthrowable
+void
_Jv_CallAnyMethodA (jobject obj,
jclass return_type,
jmethodID meth,
jboolean is_constructor,
JArray<jclass> *parameter_types,
jvalue *args,
- jvalue *result)
+ jvalue *result,
+ jboolean is_jni_call)
{
#ifdef USE_LIBFFI
JvAssert (! is_constructor || ! obj);
@@ -344,19 +364,11 @@ _Jv_CallAnyMethodA (jobject obj,
jclass *paramelts = elements (parameter_types);
- // FIXME: at some point the compiler is going to add extra arguments
- // to some functions. In particular we are going to do this for
- // handling access checks in reflection. We must add these hidden
- // arguments here.
-
// Special case for the `this' argument of a constructor. Note that
// the JDK 1.2 docs specify that the new object must be allocated
// before argument conversions are done.
if (is_constructor)
- {
- // FIXME: must special-case String, arrays, maybe others here.
- obj = JvAllocObject (return_type);
- }
+ obj = JvAllocObject (return_type);
const int size_per_arg = sizeof(jvalue);
ffi_cif cif;
@@ -398,15 +410,11 @@ _Jv_CallAnyMethodA (jobject obj,
if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, param_count,
rtype, argtypes) != FFI_OK)
- {
- // FIXME: throw some kind of VirtualMachineError here.
- }
+ throw new java::lang::VirtualMachineError(JvNewStringLatin1("internal error: ffi_prep_cif failed"));
using namespace java::lang;
using namespace java::lang::reflect;
- Throwable *ex = NULL;
-
union
{
ffi_arg i;
@@ -416,17 +424,51 @@ _Jv_CallAnyMethodA (jobject obj,
jdouble d;
} ffi_result;
+ switch (rtype->type)
+ {
+ case FFI_TYPE_VOID:
+ break;
+ case FFI_TYPE_SINT8:
+ result->b = 0;
+ break;
+ case FFI_TYPE_SINT16:
+ result->s = 0;
+ break;
+ case FFI_TYPE_UINT16:
+ result->c = 0;
+ break;
+ case FFI_TYPE_SINT32:
+ result->i = 0;
+ break;
+ case FFI_TYPE_SINT64:
+ result->j = 0;
+ break;
+ case FFI_TYPE_FLOAT:
+ result->f = 0;
+ break;
+ case FFI_TYPE_DOUBLE:
+ result->d = 0;
+ break;
+ case FFI_TYPE_POINTER:
+ result->l = 0;
+ break;
+ default:
+ JvFail ("Unknown ffi_call return type");
+ break;
+ }
+
try
{
ffi_call (&cif, (void (*)()) meth->ncode, &ffi_result, values);
}
- catch (Throwable *ex2)
+ catch (Throwable *ex)
{
- // FIXME: this is wrong for JNI. But if we just return the
- // exception, then the non-JNI cases won't be able to
- // distinguish it from exceptions we might generate ourselves.
- // Sigh.
- ex = new InvocationTargetException (ex2);
+ // For JNI we just throw the real error. For reflection, we
+ // wrap the underlying method's exception in an
+ // InvocationTargetException.
+ if (! is_jni_call)
+ ex = new InvocationTargetException (ex);
+ throw ex;
}
// Since ffi_call returns integer values promoted to a word, use
@@ -470,11 +512,8 @@ _Jv_CallAnyMethodA (jobject obj,
break;
}
}
-
- return ex;
#else
- throw new java::lang::UnsupportedOperationException;
- return 0;
+ throw new java::lang::UnsupportedOperationException(JvNewStringLatin1("reflection not available in this build"));
#endif // USE_LIBFFI
}
@@ -488,8 +527,6 @@ _Jv_CallAnyMethodA (jobject obj,
JArray<jclass> *parameter_types,
jobjectArray args)
{
- // FIXME: access checks.
-
if (parameter_types->length == 0 && args == NULL)
{
// The JDK accepts this, so we do too.
@@ -553,16 +590,9 @@ _Jv_CallAnyMethodA (jobject obj,
}
jvalue ret_value;
- java::lang::Throwable *ex = _Jv_CallAnyMethodA (obj,
- return_type,
- meth,
- is_constructor,
- parameter_types,
- argvals,
- &ret_value);
-
- if (ex)
- throw ex;
+ _Jv_CallAnyMethodA (obj, return_type, meth, is_constructor,
+ parameter_types, argvals, &ret_value,
+ false);
jobject r;
#define VAL(Wrapper, Field) (new Wrapper (ret_value.Field))
diff --git a/libjava/java/math/BigDecimal.java b/libjava/java/math/BigDecimal.java
index fc99cf1f7d2..f9965add4c1 100644
--- a/libjava/java/math/BigDecimal.java
+++ b/libjava/java/math/BigDecimal.java
@@ -1,5 +1,5 @@
/* java.math.BigDecimal -- Arbitrary precision decimals.
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -273,7 +273,7 @@ public class BigDecimal extends Number implements Comparable
// Ensure that pow gets a non-negative value.
int valScale = val.scale;
BigInteger valIntVal = val.intVal;
- int power = newScale + 1 - (scale - val.scale);
+ int power = newScale - (scale - val.scale);
if (power < 0)
{
// Effectively increase the scale of val to avoid an
@@ -285,50 +285,53 @@ public class BigDecimal extends Number implements Comparable
BigInteger dividend = intVal.multiply (BigInteger.valueOf (10).pow (power));
BigInteger parts[] = dividend.divideAndRemainder (valIntVal);
-// System.out.println("int: " + parts[0]);
-// System.out.println("rem: " + parts[1]);
- int roundDigit = parts[0].mod (BigInteger.valueOf (10)).intValue ();
- BigInteger unrounded = parts[0].divide (BigInteger.valueOf (10));
-
- if (roundDigit == 0 && parts[1].signum () == 0) // no rounding necessary
+ BigInteger unrounded = parts[0];
+ if (parts[1].signum () == 0) // no remainder, no rounding necessary
return new BigDecimal (unrounded, newScale);
- int sign = unrounded.signum ();
+ if (roundingMode == ROUND_UNNECESSARY)
+ throw new ArithmeticException ("newScale is not large enough");
+
+ int sign = intVal.signum () * valIntVal.signum ();
- switch (roundingMode)
+ if (roundingMode == ROUND_CEILING)
+ roundingMode = (sign > 0) ? ROUND_UP : ROUND_DOWN;
+ else if (roundingMode == ROUND_FLOOR)
+ roundingMode = (sign < 0) ? ROUND_UP : ROUND_DOWN;
+ else
{
- case ROUND_UNNECESSARY:
- throw new ArithmeticException ("newScale is not large enough");
- case ROUND_CEILING:
- roundingMode = (sign == 1) ? ROUND_UP : ROUND_DOWN;
- break;
- case ROUND_FLOOR:
- roundingMode = (sign == 1) ? ROUND_DOWN : ROUND_UP;
- break;
- case ROUND_HALF_UP:
- roundingMode = (roundDigit >= 5) ? ROUND_UP : ROUND_DOWN;
- break;
- case ROUND_HALF_DOWN:
- roundingMode = (roundDigit > 5) ? ROUND_UP : ROUND_DOWN;
- break;
- case ROUND_HALF_EVEN:
- if (roundDigit < 5)
- roundingMode = ROUND_DOWN;
- else
+ // half is -1 if remainder*2 < positive intValue (*power), 0 if equal,
+ // 1 if >. This implies that the remainder to round is less than,
+ // equal to, or greater than half way to the next digit.
+ BigInteger posRemainder
+ = parts[1].signum () < 0 ? parts[1].negate() : parts[1];
+ valIntVal = valIntVal.signum () < 0 ? valIntVal.negate () : valIntVal;
+ int half = posRemainder.shiftLeft(1).compareTo(valIntVal);
+
+ switch(roundingMode)
{
- int rightmost =
- unrounded.mod (BigInteger.valueOf (10)).intValue ();
- if (rightmost % 2 == 1) // odd, then ROUND_HALF_UP
+ case ROUND_HALF_UP:
+ roundingMode = (half < 0) ? ROUND_DOWN : ROUND_UP;
+ break;
+ case ROUND_HALF_DOWN:
+ roundingMode = (half > 0) ? ROUND_UP : ROUND_DOWN;
+ break;
+ case ROUND_HALF_EVEN:
+ if (half < 0)
+ roundingMode = ROUND_DOWN;
+ else if (half > 0)
+ roundingMode = ROUND_UP;
+ else if (unrounded.testBit(0)) // odd, then ROUND_HALF_UP
roundingMode = ROUND_UP;
- else // even, then ROUND_HALF_DOWN
- roundingMode = (roundDigit > 5) ? ROUND_UP : ROUND_DOWN;
+ else // even, ROUND_HALF_DOWN
+ roundingMode = ROUND_DOWN;
+ break;
}
- break;
}
if (roundingMode == ROUND_UP)
- return new BigDecimal (unrounded.add (BigInteger.valueOf (1)), newScale);
+ unrounded = unrounded.add (BigInteger.valueOf (sign > 0 ? 1 : -1));
// roundingMode == ROUND_DOWN
return new BigDecimal (unrounded, newScale);
diff --git a/libjava/java/net/DatagramSocket.java b/libjava/java/net/DatagramSocket.java
index 57f3da70862..1d89d688401 100644
--- a/libjava/java/net/DatagramSocket.java
+++ b/libjava/java/net/DatagramSocket.java
@@ -35,8 +35,10 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
+import gnu.java.net.PlainDatagramSocketImpl;
import java.io.IOException;
import java.nio.channels.DatagramChannel;
import java.nio.channels.IllegalBlockingModeException;
@@ -73,12 +75,6 @@ public class DatagramSocket
DatagramSocketImpl impl;
/**
- * The unique DatagramChannel object associated with this datagram socket,
- * or null.
- */
- DatagramChannel ch;
-
- /**
* This is the address we are "connected" to
*/
private InetAddress remoteAddress;
@@ -266,38 +262,30 @@ public class DatagramSocket
*/
public InetAddress getLocalAddress()
{
- // FIXME: JCL p. 510 says this should call checkConnect. But what
- // string should be used as the hostname? Maybe this is just a side
- // effect of calling InetAddress.getLocalHost.
- //
- // And is getOption with SO_BINDADDR the right way to get the address?
- // Doesn't seem to be since this method doesn't throw a SocketException
- // and SO_BINADDR can throw one.
- //
- // Also see RETURNS section in JCL p. 510 about returning any local
- // addr "if the current execution context is not allowed to connect to
- // the network interface that is actually bound to this datagram socket."
- // How is that done? via InetAddress.getLocalHost? But that throws
- // an UnknownHostException and this method doesn't.
- //
- // if (s != null)
- // s.checkConnect("localhost", -1);
+ if (impl == null
+ || closed)
+ return null;
+
+ InetAddress localAddr;
+
try
{
- return (InetAddress)impl.getOption(SocketOptions.SO_BINDADDR);
- }
- catch (SocketException ex)
- {
- }
+ localAddr = (InetAddress) impl.getOption (SocketOptions.SO_BINDADDR);
- try
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ s.checkConnect (localAddr.getHostName(), -1);
+ }
+ catch (SecurityException e)
{
- return InetAddress.getLocalHost();
+ localAddr = InetAddress.ANY_IF;
}
- catch (UnknownHostException ex)
+ catch (SocketException e)
{
return null;
}
+
+ return localAddr;
}
/**
@@ -525,7 +513,8 @@ public class DatagramSocket
throw new IOException (
"Socket connected to a multicast address my not receive");
- if (ch != null && !ch.isBlocking ())
+ if (getChannel() != null
+ && !getChannel().isBlocking ())
throw new IllegalBlockingModeException ();
impl.receive(p);
@@ -574,7 +563,8 @@ public class DatagramSocket
// FIXME: if this is a subclass of MulticastSocket,
// use getTimeToLive for TTL val.
- if (ch != null && !ch.isBlocking ())
+ if (getChannel() != null
+ && !getChannel().isBlocking ())
throw new IllegalBlockingModeException ();
impl.send(p);
@@ -624,7 +614,7 @@ public class DatagramSocket
*/
public DatagramChannel getChannel()
{
- return ch;
+ return null;
}
/**
diff --git a/libjava/java/net/InetAddress.java b/libjava/java/net/InetAddress.java
index 8ef63668a55..6a841d08a2a 100644
--- a/libjava/java/net/InetAddress.java
+++ b/libjava/java/net/InetAddress.java
@@ -70,61 +70,63 @@ public class InetAddress implements Serializable
{
private static final long serialVersionUID = 3286316764910316507L;
- // The Serialized Form specifies that an int 'address' is saved/restored.
- // This class uses a byte array internally so we'll just do the conversion
- // at serialization time and leave the rest of the algorithm as is.
+ static final byte[] zeros = { 0, 0, 0, 0 };
+
+ /**
+ * Dummy InetAddress, used to bind socket to any (all) network interfaces.
+ */
+ static final InetAddress ANY_IF = new InetAddress (zeros, null);
+
+ private static final byte[] localhostAddress = { 127, 0, 0, 1 };
+
+ private static InetAddress localhost = null;
+
+ /**
+ * The Serialized Form specifies that an int 'address' is saved/restored.
+ * This class uses a byte array internally so we'll just do the conversion
+ * at serialization time and leave the rest of the algorithm as is.
+ */
private int address;
+
+ /**
+ * An array of octets representing an IP address.
+ */
transient byte[] addr;
+
+ /**
+ * The name of the host for this address.
+ */
String hostName;
- // The field 'family' seems to be the AF_ value.
- // FIXME: Much of the code in the other java.net classes does not make
- // use of this family field. A better implementation would be to make
- // use of getaddrinfo() and have other methods just check the family
- // field rather than examining the length of the address each time.
+ /**
+ * The field 'family' seems to be the AF_ value.
+ * FIXME: Much of the code in the other java.net classes does not make
+ * use of this family field. A better implementation would be to make
+ * use of getaddrinfo() and have other methods just check the family
+ * field rather than examining the length of the address each time.
+ */
int family;
/**
- * Needed for serialization
+ * Initializes this object's addr instance variable from the passed in
+ * int array. Note that this constructor is protected and is called
+ * only by static methods in this class.
+ *
+ * @param ipaddr The IP number of this address as an array of bytes
*/
- private void readResolve () throws ObjectStreamException
+ InetAddress (byte[] address)
{
- // FIXME: implement this
- }
-
- private void readObject (ObjectInputStream ois)
- throws IOException, ClassNotFoundException
- {
- ois.defaultReadObject ();
- addr = new byte [4];
- addr [3] = (byte) address;
-
- for (int i = 2; i >= 0; --i)
- addr [i] = (byte) (address >>= 8);
-
- // Ignore family from serialized data. Since the saved address is 32 bits
- // the deserialized object will have an IPv4 address i.e. AF_INET family.
- // FIXME: An alternative is to call the aton method on the deserialized
- // hostname to get a new address. The Serialized Form doc is silent
- // on how these fields are used.
- family = getFamily (addr);
- }
-
- private void writeObject (ObjectOutputStream oos) throws IOException
- {
- // Build a 32 bit address from the last 4 bytes of a 4 byte IPv4 address
- // or a 16 byte IPv6 address.
- int len = addr.length;
- int i = len - 4;
-
- for (; i < len; i++)
- address = address << 8 | (((int) addr [i]) & 0xFF);
-
- oos.defaultWriteObject ();
+ this (address, null);
}
- private static native int getFamily (byte[] address);
-
+ /**
+ * Initializes this object's addr instance variable from the passed in
+ * int array. Note that this constructor is protected and is called
+ * only by static methods in this class.
+ *
+ * @param ipaddr The IP number of this address as an array of bytes
+ * @param hostname The hostname of this IP address.
+ */
InetAddress (byte[] address, String hostname)
{
addr = address;
@@ -530,6 +532,8 @@ public class InetAddress implements Serializable
private static native InetAddress[] lookup (String hostname,
InetAddress addr, boolean all);
+ private static native int getFamily (byte[] address);
+
/**
* Determines the IP address of a host, given the host's name.
*
@@ -606,17 +610,8 @@ public class InetAddress implements Serializable
return lookup (hostname, null, true);
}
- static final byte[] zeros = { 0, 0, 0, 0 };
-
- /* dummy InetAddress, used to bind socket to any (all) network interfaces */
- static final InetAddress ANY_IF = new InetAddress (zeros, null);
-
- private static final byte[] localhostAddress = { 127, 0, 0, 1 };
-
private static native String getLocalHostname ();
- private static InetAddress localhost = null;
-
/**
* Returns the local host
*
@@ -681,4 +676,43 @@ public class InetAddress implements Serializable
if (localhost == null)
localhost = new InetAddress (localhostAddress, "localhost");
}
+
+ /**
+ * Needed for serialization
+ */
+ private void readResolve () throws ObjectStreamException
+ {
+ // FIXME: implement this
+ }
+
+ private void readObject (ObjectInputStream ois)
+ throws IOException, ClassNotFoundException
+ {
+ ois.defaultReadObject ();
+ addr = new byte [4];
+ addr [3] = (byte) address;
+
+ for (int i = 2; i >= 0; --i)
+ addr [i] = (byte) (address >>= 8);
+
+ // Ignore family from serialized data. Since the saved address is 32 bits
+ // the deserialized object will have an IPv4 address i.e. AF_INET family.
+ // FIXME: An alternative is to call the aton method on the deserialized
+ // hostname to get a new address. The Serialized Form doc is silent
+ // on how these fields are used.
+ family = getFamily (addr);
+ }
+
+ private void writeObject (ObjectOutputStream oos) throws IOException
+ {
+ // Build a 32 bit address from the last 4 bytes of a 4 byte IPv4 address
+ // or a 16 byte IPv6 address.
+ int len = addr.length;
+ int i = len - 4;
+
+ for (; i < len; i++)
+ address = address << 8 | (((int) addr [i]) & 0xFF);
+
+ oos.defaultWriteObject ();
+ }
}
diff --git a/libjava/java/net/JarURLConnection.java b/libjava/java/net/JarURLConnection.java
index b8e9de07c52..d90ea0cc376 100644
--- a/libjava/java/net/JarURLConnection.java
+++ b/libjava/java/net/JarURLConnection.java
@@ -103,21 +103,21 @@ public abstract class JarURLConnection extends URLConnection
*
* @specnote This constructor is protected since JDK 1.4
*/
- protected JarURLConnection(URL url)
+ protected JarURLConnection (URL url)
throws MalformedURLException
{
- super(url);
+ super (url);
String spec = url.getFile();
- int bang = spec.indexOf ("!/", 0);
+ int bang = spec.indexOf ("!/");
if (bang == -1)
throw new MalformedURLException (url + ": No `!/' in spec.");
- // Extact the url for the jar itself.
- jarFileURL = new URL(spec.substring (0, bang));
+ // Extract the url for the jar itself.
+ jarFileURL = new URL (spec.substring (0, bang));
// Get the name of the element, if any.
- element = (bang+2==spec.length() ? null : spec.substring (bang+2));
+ element = (spec.length() == (bang + 2) ? null : spec.substring (bang + 2));
}
/**
@@ -428,7 +428,9 @@ public abstract class JarURLConnection extends URLConnection
*/
public Certificate[] getCertificates () throws IOException
{
- return getJarEntry ().getCertificates ();
+ JarEntry entry = getJarEntry();
+
+ return entry != null ? entry.getCertificates() : null;
}
/**
@@ -441,7 +443,9 @@ public abstract class JarURLConnection extends URLConnection
*/
public Attributes getMainAttributes () throws IOException
{
- return getManifest ().getMainAttributes ();
+ Manifest manifest = getManifest();
+
+ return manifest != null ? manifest.getMainAttributes() : null;
}
/**
@@ -455,8 +459,9 @@ public abstract class JarURLConnection extends URLConnection
*/
public Attributes getAttributes () throws IOException
{
- // FIXME: implement this
- return null;
+ JarEntry entry = getJarEntry();
+
+ return entry != null ? entry.getAttributes() : null;
}
/**
@@ -469,8 +474,8 @@ public abstract class JarURLConnection extends URLConnection
*/
public Manifest getManifest () throws IOException
{
- JarFile file = getJarFile ();
+ JarFile file = getJarFile();
- return (file != null) ? file.getManifest() : null;
+ return file != null ? file.getManifest() : null;
}
}
diff --git a/libjava/java/net/PlainDatagramSocketImpl.java b/libjava/java/net/PlainDatagramSocketImpl.java
deleted file mode 100644
index 83fdb633d99..00000000000
--- a/libjava/java/net/PlainDatagramSocketImpl.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/* PlainDatagramSocketImpl.java -- Default DatagramSocket implementation
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-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.net;
-
-import java.io.IOException;
-import gnu.classpath.Configuration;
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This is the default socket implementation for datagram sockets.
- * It makes native calls to C routines that implement BSD style
- * SOCK_DGRAM sockets in the AF_INET family.
- *
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Warren Levy <warrenl@cygnus.com>
- */
-class PlainDatagramSocketImpl extends DatagramSocketImpl
-{
- // Static initializer to load native library
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("javanet");
- }
- }
-
- // These fields are mirrored for use in native code to avoid cpp conflicts
- // when the #defines in system header files are the same as the public fields.
- static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY,
- _Jv_SO_BINDADDR_ = SocketOptions.SO_BINDADDR,
- _Jv_SO_REUSEADDR_ = SocketOptions.SO_REUSEADDR,
- _Jv_SO_BROADCAST_ = SocketOptions.SO_BROADCAST,
- _Jv_SO_OOBINLINE_ = SocketOptions.SO_OOBINLINE,
- _Jv_IP_MULTICAST_IF_ = SocketOptions.IP_MULTICAST_IF,
- _Jv_IP_MULTICAST_IF2_ = SocketOptions.IP_MULTICAST_IF2,
- _Jv_IP_MULTICAST_LOOP_ = SocketOptions.IP_MULTICAST_LOOP,
- _Jv_IP_TOS_ = SocketOptions.IP_TOS,
- _Jv_SO_LINGER_ = SocketOptions.SO_LINGER,
- _Jv_SO_TIMEOUT_ = SocketOptions.SO_TIMEOUT,
- _Jv_SO_SNDBUF_ = SocketOptions.SO_SNDBUF,
- _Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF,
- _Jv_SO_KEEPALIVE_ = SocketOptions.SO_KEEPALIVE;
-
- /**
- * This is the actual underlying file descriptor
- */
- int fnum = -1;
-
- // FIXME: Is this necessary? Could it help w/ DatagramSocket.getLocalAddress?
- // InetAddress address;
-
- // localAddress cache
- InetAddress localAddress;
-
- // 'timeout' is set/read by setOption/getOption.
- int timeout = 0;
-
- /**
- * Default do nothing constructor
- */
- public PlainDatagramSocketImpl()
- {
- }
-
- /**
- * Binds this socket to a particular port and interface
- *
- * @param port The port to bind to
- * @param addr The address to bind to
- *
- * @exception SocketException If an error occurs
- */
- protected native void bind(int lport, InetAddress laddr)
- throws SocketException;
-
- protected native void connect (InetAddress i, int port)
- throws SocketException;
-
- protected native void disconnect ();
-
- /**
- * Creates a new datagram socket
- *
- * @exception SocketException If an error occurs
- */
- protected native void create() throws SocketException;
-
- protected native int peek(InetAddress i) throws IOException;
-
- protected native int peekData (DatagramPacket dp) throws IOException;
-
- /**
- * Sets the Time to Live value for the socket
- *
- * @param ttl The new TTL value
- *
- * @exception IOException If an error occurs
- */
- protected native void setTimeToLive(int ttl) throws IOException;
-
- /**
- * Gets the Time to Live value for the socket
- *
- * @return The TTL value
- *
- * @exception IOException If an error occurs
- */
- protected native int getTimeToLive() throws IOException;
-
- /**
- * Sends a packet of data to a remote host
- *
- * @param packet The packet to send
- *
- * @exception IOException If an error occurs
- */
- protected native void send(DatagramPacket p) throws IOException;
-
- /**
- * Receives a UDP packet from the network
- *
- * @param packet The packet to fill in with the data received
- *
- * @exception IOException IOException If an error occurs
- */
- protected native void receive(DatagramPacket p) throws IOException;
-
- /**
- * Sets the value of an option on the socket
- *
- * @param option_id The identifier of the option to set
- * @param val The value of the option to set
- *
- * @exception SocketException If an error occurs
- */
- public native void setOption(int optID, Object value) throws SocketException;
-
- /**
- * Retrieves the value of an option on the socket
- *
- * @param option_id The identifier of the option to retrieve
- *
- * @return The value of the option
- *
- * @exception SocketException If an error occurs
- */
- public native Object getOption(int optID) throws SocketException;
-
- private native void mcastGrp(InetAddress inetaddr, NetworkInterface netIf,
- boolean join) throws IOException;
-
- /**
- * Closes the socket
- */
- protected native void close();
-
- /**
- * Gets the Time to Live value for the socket
- *
- * @return The TTL value
- *
- * @exception IOException If an error occurs
- *
- * @deprecated 1.2
- */
- protected byte getTTL() throws IOException
- {
- return (byte) getTimeToLive();
- }
-
- /**
- * Sets the Time to Live value for the socket
- *
- * @param ttl The new TTL value
- *
- * @exception IOException If an error occurs
- *
- * @deprecated 1.2
- */
- protected void setTTL(byte ttl) throws IOException
- {
- setTimeToLive(((int) ttl) & 0xFF);
- }
-
- /**
- * Joins a multicast group
- *
- * @param addr The group to join
- *
- * @exception IOException If an error occurs
- */
- protected void join(InetAddress inetaddr) throws IOException
- {
- mcastGrp(inetaddr, null, true);
- }
-
- /**
- * Leaves a multicast group
- *
- * @param addr The group to leave
- *
- * @exception IOException If an error occurs
- */
- protected void leave(InetAddress inetaddr) throws IOException
- {
- mcastGrp(inetaddr, null, false);
- }
-
- protected void joinGroup (SocketAddress mcastaddr, NetworkInterface netIf)
- throws IOException
- {
- mcastGrp(((InetSocketAddress)mcastaddr).getAddress(), netIf, true);
- }
-
- protected void leaveGroup (SocketAddress mcastaddr, NetworkInterface netIf)
- throws IOException
- {
- mcastGrp(((InetSocketAddress)mcastaddr).getAddress(), netIf, false);
- }
-
- protected void finalize() throws Throwable
- {
- synchronized (this)
- {
- if (fnum != -1)
- close();
- }
- super.finalize();
- }
-}
diff --git a/libjava/java/net/PlainSocketImpl.java b/libjava/java/net/PlainSocketImpl.java
deleted file mode 100644
index ad0ce46c7ea..00000000000
--- a/libjava/java/net/PlainSocketImpl.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/* PlainSocketImpl.java -- Default socket implementation
- Copyright (C) 1998, 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. */
-
-
-package java.net;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import gnu.classpath.Configuration;
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * Unless the application installs its own SocketImplFactory, this is the
- * default socket implemetation that will be used. It simply uses a
- * combination of Java and native routines to implement standard BSD
- * style sockets of family AF_INET and types SOCK_STREAM and SOCK_DGRAM
- *
- * @author Per Bothner <bothner@cygnus.com>
- * @author Nic Ferrier <nferrier@tapsellferrier.co.uk>
- * @author Aaron M. Renn <arenn@urbanophile.com>
- */
-class PlainSocketImpl extends SocketImpl
-{
- // Static initializer to load native library.
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("javanet");
- }
- }
-
- // These fields are mirrored for use in native code to avoid cpp conflicts
- // when the #defines in system header files are the same as the public fields.
- static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY,
- _Jv_SO_BINDADDR_ = SocketOptions.SO_BINDADDR,
- _Jv_SO_REUSEADDR_ = SocketOptions.SO_REUSEADDR,
- _Jv_SO_BROADCAST_ = SocketOptions.SO_BROADCAST,
- _Jv_SO_OOBINLINE_ = SocketOptions.SO_OOBINLINE,
- _Jv_IP_MULTICAST_IF_ = SocketOptions.IP_MULTICAST_IF,
- _Jv_IP_MULTICAST_IF2_ = SocketOptions.IP_MULTICAST_IF2,
- _Jv_IP_MULTICAST_LOOP_ = SocketOptions.IP_MULTICAST_LOOP,
- _Jv_IP_TOS_ = SocketOptions.IP_TOS,
- _Jv_SO_LINGER_ = SocketOptions.SO_LINGER,
- _Jv_SO_TIMEOUT_ = SocketOptions.SO_TIMEOUT,
- _Jv_SO_SNDBUF_ = SocketOptions.SO_SNDBUF,
- _Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF,
- _Jv_SO_KEEPALIVE_ = SocketOptions.SO_KEEPALIVE;
-
- /**
- * The OS file handle representing the socket.
- * This is used for reads and writes to/from the socket and
- * to close it.
- *
- * When the socket is closed this is reset to -1.
- */
- int fnum = -1;
-
- // This value is set/read by setOption/getOption.
- int timeout = 0;
-
- // localAddress cache
- InetAddress localAddress;
-
- /**
- * A cached copy of the in stream for reading from the socket.
- */
- private InputStream in;
-
- /**
- * A cached copy of the out stream for writing to the socket.
- */
- private OutputStream out;
-
- /**
- * Default do nothing constructor
- */
- public PlainSocketImpl()
- {
- }
-
- protected void finalize() throws Throwable
- {
- synchronized (this)
- {
- if (fnum != -1)
- try
- {
- close();
- }
- catch (IOException ex)
- {
- // ignore
- }
- }
- super.finalize();
- }
-
- /**
- * Sets the specified option on a socket to the passed in object. For
- * options that take an integer argument, the passed in object is an
- * Integer. The option_id parameter is one of the defined constants in
- * this interface.
- *
- * @param option_id The identifier of the option
- * @param val The value to set the option to
- *
- * @exception SocketException If an error occurs
- */
- public native void setOption(int optID, Object value) throws SocketException;
-
- /**
- * Returns the current setting of the specified option. The Object returned
- * will be an Integer for options that have integer values. The option_id
- * is one of the defined constants in this interface.
- *
- * @param option_id The option identifier
- *
- * @return The current value of the option
- *
- * @exception SocketException If an error occurs
- */
- public native Object getOption(int optID) throws SocketException;
-
- public native void shutdownInput () throws IOException;
-
- public native void shutdownOutput () throws IOException;
-
- /**
- * Creates a new socket that is not bound to any local address/port and
- * is not connected to any remote address/port. This will be created as
- * a stream socket if the stream parameter is true, or a datagram socket
- * if the stream parameter is false.
- *
- * @param stream true for a stream socket, false for a datagram socket
- */
- protected native void create (boolean stream) throws IOException;
-
- /**
- * Connects to the remote hostname and port specified as arguments.
- *
- * @param hostname The remote hostname to connect to
- * @param port The remote port to connect to
- *
- * @exception IOException If an error occurs
- */
- protected void connect (String host, int port) throws IOException
- {
- connect (new InetSocketAddress (InetAddress.getByName(host), port), 0);
- }
-
- /**
- * Connects to the remote address and port specified as arguments.
- *
- * @param addr The remote address to connect to
- * @param port The remote port to connect to
- *
- * @exception IOException If an error occurs
- */
- protected void connect (InetAddress host, int port) throws IOException
- {
- connect (new InetSocketAddress (host, port), 0);
- }
-
- protected native void connect (SocketAddress addr, int timeout)
- throws IOException;
-
- /**
- * Binds to the specified port on the specified addr. Note that this addr
- * must represent a local IP address. **** How bind to INADDR_ANY? ****
- *
- * @param addr The address to bind to
- * @param port The port number to bind to
- *
- * @exception IOException If an error occurs
- */
- protected native void bind (InetAddress host, int port) throws IOException;
-
- /**
- * Starts listening for connections on a socket. The queuelen parameter
- * is how many pending connections will queue up waiting to be serviced
- * before being accept'ed. If the queue of pending requests exceeds this
- * number, additional connections will be refused.
- *
- * @param queuelen The length of the pending connection queue
- *
- * @exception IOException If an error occurs
- */
- protected native void listen (int backlog) throws IOException;
-
- private native void accept (PlainSocketImpl s) throws IOException;
-
- /**
- * Accepts a new connection on this socket and returns in in the
- * passed in SocketImpl.
- *
- * @param impl The SocketImpl object to accept this connection.
- */
- protected void accept (SocketImpl s) throws IOException
- {
- accept((PlainSocketImpl) s);
- }
-
- /**
- * Returns the number of bytes that the caller can read from this socket
- * without blocking.
- *
- * @return The number of readable bytes before blocking
- *
- * @exception IOException If an error occurs
- */
- protected native int available() throws IOException;
-
- /**
- * Closes the socket. This will cause any InputStream or OutputStream
- * objects for this Socket to be closed as well.
- * <p>
- * Note that if the SO_LINGER option is set on this socket, then the
- * operation could block.
- *
- * @exception IOException If an error occurs
- */
- protected native void close () throws IOException;
-
- protected native void sendUrgentData(int data)
- throws IOException;
-
- native int read() throws IOException;
-
- /**
- * Internal method used by SocketInputStream for reading data from
- * the connection. Reads up to len bytes of data into the buffer
- * buf starting at offset bytes into the buffer.
- *
- * @return The actual number of bytes read or -1 if end of stream.
- *
- * @exception IOException If an error occurs
- */
- native int read(byte[] buffer, int offset, int count)
- throws IOException;
-
- native void write(int c) throws IOException;
-
- /**
- * Internal method used by SocketOuputStream for writing data to
- * the connection. Writes up to len bytes of data from the buffer
- * buf starting at offset bytes into the buffer.
- *
- * @exception IOException If an error occurs
- */
- native void write(byte[] buffer, int offset, int count)
- throws IOException;
-
- /**
- * Returns an InputStream object for reading from this socket. This will
- * be an instance of SocketInputStream.
- *
- * @return An input stream attached to the socket.
- *
- * @exception IOException If an error occurs
- */
- protected synchronized InputStream getInputStream() throws IOException
- {
- if (in == null)
- in = new SocketInputStream();
-
- return in;
- }
-
- /**
- * Returns an OutputStream object for writing to this socket. This will
- * be an instance of SocketOutputStream.
- *
- * @return An output stream attached to the socket.
- *
- * @exception IOException If an error occurs
- */
- protected synchronized OutputStream getOutputStream() throws IOException
- {
- if (out == null)
- out = new SocketOutputStream();
-
- return out;
- }
-
- /**
- * A stream which reads from the socket implementation.
- *
- * @author Nic Ferrier <nferrier@tapsellferrier.co.uk>
- */
- class SocketInputStream
- extends InputStream
- {
- SocketInputStream()
- {
- }
-
- public final void close() throws IOException
- {
- PlainSocketImpl.this.close();
- }
-
- public final int available() throws IOException
- {
- return PlainSocketImpl.this.available();
- }
-
- public final int read() throws IOException
- {
- return PlainSocketImpl.this.read();
- }
-
- public final int read(byte[] buffer, int offset, int length)
- throws IOException
- {
- return PlainSocketImpl.this.read(buffer, offset, length);
- }
-
- public final int read(byte[] buffer)
- throws IOException
- {
- return PlainSocketImpl.this.read(buffer, 0, buffer.length);
- }
- }
-
- /** A stream which writes to the socket implementation.
- *
- * @author Nic Ferrier <nferrier@tapsellferrier.co.uk>
- */
- class SocketOutputStream
- extends OutputStream
- {
- public final void close() throws IOException
- {
- PlainSocketImpl.this.close();
- }
-
- public final void write(int c) throws IOException
- {
- PlainSocketImpl.this.write(c);
- }
-
- public final void write(byte[] buffer, int offset, int length)
- throws IOException
- {
- PlainSocketImpl.this.write(buffer, offset, length);
- }
-
- public final void write(byte[] buffer)
- throws IOException
- {
- PlainSocketImpl.this.write(buffer, 0, buffer.length);
- }
- }
-}
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java
index 699319e70b2..44281783dc8 100644
--- a/libjava/java/net/ServerSocket.java
+++ b/libjava/java/net/ServerSocket.java
@@ -1,5 +1,5 @@
/* ServerSocket.java -- Class for implementing server side sockets
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,8 +35,10 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
+import gnu.java.net.PlainSocketImpl;
import java.io.IOException;
import java.nio.channels.IllegalBlockingModeException;
import java.nio.channels.ServerSocketChannel;
@@ -71,12 +73,6 @@ public class ServerSocket
*/
private SocketImpl impl;
- /**
- * ServerSocketChannel of this ServerSocket. This channel only exists
- * when the socket is created by ServerSocketChannel.open().
- */
- private ServerSocketChannel ch;
-
private boolean closed = false;
/**
@@ -154,24 +150,10 @@ public class ServerSocket
{
this();
- if (impl == null)
- throw new IOException("Cannot initialize Socket implementation");
-
- // create socket
- impl.create(true);
-
// bind/listen socket
bind (new InetSocketAddress (bindAddr, port), backlog);
}
- /*
- * This method may only be used by java.nio.channels.ServerSocketChannel.open.
- */
- void setChannel (ServerSocketChannel ch)
- {
- this.ch = ch;
- }
-
/**
* Binds the server socket to a specified socket address
*
@@ -208,9 +190,6 @@ public class ServerSocket
if (closed)
throw new SocketException ("ServerSocket is closed");
- if (impl == null)
- throw new IOException ("Cannot initialize Socket implementation");
-
if (! (endpoint instanceof InetSocketAddress))
throw new IllegalArgumentException ("Address type not supported");
@@ -220,45 +199,24 @@ public class ServerSocket
if (s != null)
s.checkListen (tmp.getPort ());
- // bind to address/port
try
{
- impl.bind (tmp.getAddress (), tmp.getPort ());
- }
- catch (IOException exception)
- {
- impl.close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- impl.close();
- throw exception;
+ impl.bind (tmp.getAddress (), tmp.getPort ());
+ impl.listen(backlog);
}
- catch (Error error)
- {
- impl.close();
- throw error;
- }
-
- // listen on socket
- try
- {
- impl.listen(backlog);
- }
catch (IOException exception)
{
- impl.close();
+ close();
throw exception;
}
catch (RuntimeException exception)
{
- impl.close();
+ close();
throw exception;
}
catch (Error error)
{
- impl.close();
+ close();
throw error;
}
}
@@ -320,9 +278,6 @@ public class ServerSocket
*/
public Socket accept () throws IOException
{
- if (impl == null)
- throw new IOException ("Cannot initialize Socket implementation");
-
SecurityManager sm = System.getSecurityManager ();
if (sm != null)
sm.checkListen (impl.getLocalPort ());
@@ -349,7 +304,8 @@ public class ServerSocket
protected final void implAccept (Socket s)
throws IOException
{
- if (ch != null && !ch.isBlocking())
+ if (getChannel() != null
+ && !getChannel().isBlocking())
throw new IllegalBlockingModeException();
impl.accept(s.impl);
@@ -365,8 +321,8 @@ public class ServerSocket
if (impl != null)
impl.close ();
- if (ch != null)
- ch.close ();
+ if (getChannel() != null)
+ getChannel().close ();
closed = true;
}
@@ -382,7 +338,7 @@ public class ServerSocket
*/
public ServerSocketChannel getChannel()
{
- return ch;
+ return null;
}
/**
@@ -466,9 +422,6 @@ public class ServerSocket
public void setReuseAddress (boolean on)
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
}
@@ -482,9 +435,6 @@ public class ServerSocket
public boolean getReuseAddress()
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR);
if (!(reuseaddr instanceof Boolean))
@@ -508,9 +458,6 @@ public class ServerSocket
public void setReceiveBufferSize (int size)
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Not connected");
-
if (size <= 0)
throw new IllegalArgumentException ("SO_RCVBUF value must be > 0");
@@ -531,9 +478,6 @@ public class ServerSocket
public int getReceiveBufferSize ()
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Not connected");
-
Object buf = impl.getOption (SocketOptions.SO_RCVBUF);
if (!(buf instanceof Integer))
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
index ef88de5c151..a5397bf7a49 100644
--- a/libjava/java/net/Socket.java
+++ b/libjava/java/net/Socket.java
@@ -1,5 +1,5 @@
/* Socket.java -- Client socket implementation
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,8 +35,10 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
+import gnu.java.net.PlainSocketImpl;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -82,10 +84,8 @@ public class Socket
*/
SocketImpl impl;
- private boolean inputShutdown;
- private boolean outputShutdown;
-
- SocketChannel ch; // this field must have been set if created by SocketChannel
+ private boolean inputShutdown = false;
+ private boolean outputShutdown = false;
private boolean closed = false;
@@ -103,9 +103,6 @@ public class Socket
impl = factory.createSocketImpl();
else
impl = new PlainSocketImpl();
-
- inputShutdown = false;
- outputShutdown = false;
}
/**
@@ -115,9 +112,8 @@ public class Socket
* <p>
* Additionally, this socket will be created using the supplied
* implementation class instead the default class or one returned by a
- * factory. This value can be <code>null</code>, but if it is, all instance
- * methods in <code>Socket</code> should be overridden because most of them
- * rely on this value being populated.
+ * factory. If this value is <code>null</code>, the default Socket
+ * implementation is used.
*
* @param impl The <code>SocketImpl</code> to use for this
* <code>Socket</code>
@@ -128,9 +124,10 @@ public class Socket
*/
protected Socket (SocketImpl impl) throws SocketException
{
- this.impl = impl;
- this.inputShutdown = false;
- this.outputShutdown = false;
+ if (impl == null)
+ this.impl = new PlainSocketImpl();
+ else
+ this.impl = impl;
}
/**
@@ -282,12 +279,6 @@ public class Socket
{
this();
- if (raddr == null)
- throw new NullPointerException ();
-
- if (impl == null)
- throw new IOException("Cannot initialize Socket implementation");
-
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkConnect(raddr.getHostName(), rport);
@@ -305,15 +296,6 @@ public class Socket
// that default. JDK 1.2 doc infers not to do a bind.
}
- /*
- * This method may only be used by java.nio.channels.ServerSocketChannel.accept and
- * java.nio.channels.SocketChannel.open.
- */
- void setChannel (SocketChannel ch)
- {
- this.ch = ch;
- }
-
/**
* Binds the socket to the givent local address/port
*
@@ -351,17 +333,17 @@ public class Socket
}
catch (IOException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (RuntimeException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (Error error)
{
- impl.close ();
+ close ();
throw error;
}
}
@@ -408,7 +390,8 @@ public class Socket
if (! (endpoint instanceof InetSocketAddress))
throw new IllegalArgumentException ("Address type not supported");
- if (ch != null && !ch.isBlocking ())
+ if (getChannel() != null
+ && !getChannel().isBlocking ())
throw new IllegalBlockingModeException ();
if (!isBound ())
@@ -420,17 +403,17 @@ public class Socket
}
catch (IOException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (RuntimeException exception)
{
- impl.close ();
+ close ();
throw exception;
}
catch (Error error)
{
- impl.close ();
+ close ();
throw error;
}
}
@@ -443,10 +426,7 @@ public class Socket
*/
public InetAddress getInetAddress ()
{
- if (impl != null)
- return impl.getInetAddress();
-
- return null;
+ return impl.getInetAddress();
}
/**
@@ -459,9 +439,6 @@ public class Socket
*/
public InetAddress getLocalAddress ()
{
- if (impl == null)
- return null;
-
InetAddress addr = null;
try
{
@@ -586,9 +563,6 @@ public class Socket
*/
public void setTcpNoDelay (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
impl.setOption(SocketOptions.TCP_NODELAY, new Boolean(on));
}
@@ -606,9 +580,6 @@ public class Socket
*/
public boolean getTcpNoDelay() throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object on = impl.getOption(SocketOptions.TCP_NODELAY);
if (on instanceof Boolean)
@@ -636,9 +607,6 @@ public class Socket
*/
public void setSoLinger(boolean on, int linger) throws SocketException
{
- if (impl == null)
- throw new SocketException("No socket created");
-
if (on == true)
{
if (linger < 0)
@@ -673,9 +641,6 @@ public class Socket
*/
public int getSoLinger() throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object linger = impl.getOption(SocketOptions.SO_LINGER);
if (linger instanceof Integer)
return(((Integer)linger).intValue());
@@ -709,9 +674,6 @@ public class Socket
*/
public void setOOBInline (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
impl.setOption(SocketOptions.SO_OOBINLINE, new Boolean(on));
}
@@ -724,9 +686,6 @@ public class Socket
*/
public boolean getOOBInline () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_OOBINLINE);
if (buf instanceof Boolean)
@@ -754,9 +713,6 @@ public class Socket
*/
public synchronized void setSoTimeout (int timeout) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
if (timeout < 0)
throw new IllegalArgumentException("SO_TIMEOUT value must be >= 0");
@@ -782,9 +738,6 @@ public class Socket
*/
public synchronized int getSoTimeout () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT);
if (timeout instanceof Integer)
return(((Integer)timeout).intValue());
@@ -806,9 +759,6 @@ public class Socket
*/
public void setSendBufferSize (int size) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
if (size <= 0)
throw new IllegalArgumentException("SO_SNDBUF value must be > 0");
@@ -828,9 +778,6 @@ public class Socket
*/
public int getSendBufferSize () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_SNDBUF);
if (buf instanceof Integer)
@@ -853,9 +800,6 @@ public class Socket
*/
public void setReceiveBufferSize (int size) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
if (size <= 0)
throw new IllegalArgumentException("SO_RCVBUF value must be > 0");
@@ -875,9 +819,6 @@ public class Socket
*/
public int getReceiveBufferSize () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_RCVBUF);
if (buf instanceof Integer)
@@ -898,9 +839,6 @@ public class Socket
*/
public void setKeepAlive (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
impl.setOption(SocketOptions.SO_KEEPALIVE, new Boolean(on));
}
@@ -916,9 +854,6 @@ public class Socket
*/
public boolean getKeepAlive () throws SocketException
{
- if (impl == null)
- throw new SocketException("Not connected");
-
Object buf = impl.getOption(SocketOptions.SO_KEEPALIVE);
if (buf instanceof Boolean)
@@ -937,8 +872,8 @@ public class Socket
if (impl != null)
impl.close();
- if (ch != null)
- ch.close();
+ if (getChannel() != null)
+ getChannel().close();
closed = true;
}
@@ -1025,7 +960,7 @@ public class Socket
*/
public SocketChannel getChannel()
{
- return ch;
+ return null;
}
/**
@@ -1037,9 +972,6 @@ public class Socket
*/
public boolean getReuseAddress () throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR);
if (!(reuseaddr instanceof Boolean))
@@ -1057,9 +989,6 @@ public class Socket
*/
public void setReuseAddress (boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
}
@@ -1074,9 +1003,6 @@ public class Socket
*/
public int getTrafficClass () throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
Object obj = impl.getOption(SocketOptions.IP_TOS);
if (obj instanceof Integer)
@@ -1099,9 +1025,6 @@ public class Socket
*/
public void setTrafficClass (int tc) throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
-
if (tc < 0 || tc > 255)
throw new IllegalArgumentException();
diff --git a/libjava/java/net/SocketImpl.java b/libjava/java/net/SocketImpl.java
index 14101513e09..e43b49ed599 100644
--- a/libjava/java/net/SocketImpl.java
+++ b/libjava/java/net/SocketImpl.java
@@ -276,7 +276,8 @@ public abstract class SocketImpl implements SocketOptions
*/
public String toString()
{
- return "[addr=" + address
+ return "[addr=" + ((address == null) ? "0.0.0.0/0.0.0.0" :
+ address.toString())
+ ",port=" + port
+ ",localport=" + localport + "]";
}
diff --git a/libjava/java/net/SocketInputStream.java b/libjava/java/net/SocketInputStream.java
deleted file mode 100644
index f2d4d399218..00000000000
--- a/libjava/java/net/SocketInputStream.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/* SocketInputStream.java -- An InputStream for Sockets
- Copyright (C) 1998, 2000, 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 java.net;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * This class contains an implementation of <code>InputStream</code> for
- * sockets. It in an internal only class used by <code>PlainSocketImpl</code>.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-class SocketInputStream extends InputStream
-{
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * The PlainSocketImpl object this stream is associated with
- */
-private PlainSocketImpl impl;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Builds an instance of this class from a PlainSocketImpl object
- */
-protected
-SocketInputStream(PlainSocketImpl impl)
-{
- this.impl = impl;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the number of bytes available to be read before blocking
- */
-public int
-available() throws IOException
-{
- return(impl.available());
-}
-
-/*************************************************************************/
-
-/**
- * Determines if "mark" functionality is supported on this stream. For
- * sockets, this is always false. Note that the superclass default is
- * false, but it is overridden out of safety concerns and/or paranoia.
- */
-public boolean
-markSupported()
-{
- return(false);
-}
-
-/*************************************************************************/
-
-/**
- * Do nothing mark method since we don't support this functionality. Again,
- * overriding out of paranoia.
- *
- * @param readlimit In theory, the number of bytes we can read before the mark becomes invalid
- */
-public void
-mark(int readlimit)
-{
-}
-
-/*************************************************************************/
-
-/**
- * Since we don't support mark, this method always throws an exception
- *
- * @exception IOException Everytime since we don't support this functionality
- */
-public void
-reset() throws IOException
-{
- throw new IOException("Socket InputStreams do not support mark/reset");
-}
-
-/*************************************************************************/
-
-/**
- * This method not only closes the stream, it closes the underlying socket
- * (and thus any connection) and invalidates any other Input/Output streams
- * for the underlying impl object
- */
-public void
-close() throws IOException
-{
- impl.close();
-}
-
-/*************************************************************************/
-
-/**
- * Reads the next byte of data and returns it as an int.
- *
- * @return The byte read (as an int) or -1 if end of stream);
- *
- * @exception IOException If an error occurs.
- */
-public int
-read() throws IOException
-{
- byte buf[] = new byte[1];
-
- int bytes_read = read(buf, 0, buf.length);
-
- if (bytes_read != -1)
- return(buf[0] & 0xFF);
- else
- return(-1);
-}
-
-/*************************************************************************/
-
-/**
- * Reads up to buf.length bytes of data into the caller supplied buffer.
- *
- * @return The actual number of bytes read or -1 if end of stream
- *
- * @exception IOException If an error occurs.
- */
-public int
-read(byte[] buf) throws IOException
-{
- return(read(buf, 0, buf.length));
-}
-
-/*************************************************************************/
-
-/**
- * Reads up to len bytes of data into the caller supplied buffer starting
- * at offset bytes from the start of the buffer
- *
- * @return The number of bytes actually read or -1 if end of stream
- *
- * @exception IOException If an error occurs.
- */
-public int
-read(byte[] buf, int offset, int len) throws IOException
-{
- int bytes_read = impl.read(buf, offset, len);
- if (bytes_read == 0)
- return(-1);
-
- return(bytes_read);
-}
-
-} // class SocketInputStream
-
diff --git a/libjava/java/net/SocketOutputStream.java b/libjava/java/net/SocketOutputStream.java
deleted file mode 100644
index 7ce19ae0ef6..00000000000
--- a/libjava/java/net/SocketOutputStream.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/* SocketOutputStream.java -- OutputStream for PlainSocketImpl
- Copyright (C) 1998,2000 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.net;
-
-import java.io.OutputStream;
-import java.io.IOException;
-
-/**
- * This class is used internally by <code>PlainSocketImpl</code> to be the
- * <code>OutputStream</code> subclass returned by its
- * <code>getOutputStream method</code>. It expects only to be used in that
- * context.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-class SocketOutputStream extends OutputStream
-{
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * The PlainSocketImpl object this stream is associated with
- */
-private PlainSocketImpl impl;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Build an instance of this class from a PlainSocketImpl object
- */
-protected
-SocketOutputStream(PlainSocketImpl impl)
-{
- this.impl = impl;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * This method closes the stream and the underlying socket connection. This
- * action also effectively closes any other InputStream or OutputStream
- * object associated with the connection.
- *
- * @exception IOException If an error occurs
- */
-public void
-close() throws IOException
-{
- impl.close();
-}
-
-/*************************************************************************/
-
-/**
- * Hmmm, we don't seem to have a flush() method in Socket impl, so just
- * return for now, but this might need to be looked at later.
- *
- * @exception IOException Can't happen
- */
-public void
-flush() throws IOException
-{
- return;
-}
-
-/*************************************************************************/
-
-/**
- * Writes a byte (passed in as an int) to the given output stream
- *
- * @param b The byte to write
- *
- * @exception IOException If an error occurs
- */
-public void
-write(int b) throws IOException
-{
- byte buf[] = new byte[1];
-
- Integer i = new Integer(b);
- buf[0] = i.byteValue();
-
- write(buf, 0, buf.length);
-}
-
-/*************************************************************************/
-
-/**
- * Write an array of bytes to the output stream
- *
- * @param buf The array of bytes to write
- *
- * @exception IOException If an error occurs
- */
-public void
-write(byte[] buf) throws IOException
-{
- write(buf, 0, buf.length);
-}
-
-/*************************************************************************/
-
-/**
- * Writes len number of bytes from the array buf to the stream starting
- * at offset bytes into the buffer.
- *
- * @param buf The buffer
- * @param offset Offset into the buffer to start writing from
- * @param len The number of bytes to write
- */
-public void
-write(byte[] buf, int offset, int len) throws IOException
-{
- impl.write(buf, offset, len);
-}
-
-} // class SocketOutputStream
-
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 12c86914e30..2db8c4dd1cd 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -98,6 +98,14 @@ import java.util.StringTokenizer;
* <p>
* Please note that a protocol handler must be a subclass of
* URLStreamHandler.
+ * <p>
+ * Normally, this class caches protocol handlers. Once it finds a handler
+ * for a particular protocol, it never tries to look up a new handler
+ * again. However, if the system property
+ * gnu.java.net.nocache_protocol_handlers is set, then this
+ * caching behavior is disabled. This property is specific to this
+ * implementation. Sun's JDK may or may not do protocol caching, but it
+ * almost certainly does not examine this property.
*
* @author Aaron M. Renn <arenn@urbanophile.com>
* @author Warren Levy <warrenl@cygnus.com>
@@ -150,18 +158,32 @@ public final class URL implements Serializable
transient URLStreamHandler ph;
/**
+ * If an application installs its own protocol handler factory, this is
+ * where we keep track of it.
+ */
+ private static URLStreamHandlerFactory factory;
+
+ private static final long serialVersionUID = -7627629688361524110L;
+
+ /**
* This a table where we cache protocol handlers to avoid the overhead
* of looking them up each time.
*/
- private static Hashtable handlers = new Hashtable();
+ private static Hashtable ph_cache = new Hashtable();
/**
- * If an application installs its own protocol handler factory, this is
- * where we keep track of it.
+ * Whether or not to cache protocol handlers.
*/
- private static URLStreamHandlerFactory factory;
+ private static boolean cache_handlers;
- private static final long serialVersionUID = -7627629688361524110L;
+ static
+ {
+ String s = System.getProperty("gnu.java.net.nocache_protocol_handlers");
+ if (s == null)
+ cache_handlers = true;
+ else
+ cache_handlers = false;
+ }
/**
* Constructs a URL and loads a protocol handler for the values passed as
@@ -213,7 +235,7 @@ public final class URL implements Serializable
* @param port The port number to use, or -1 to use the protocol's default
* port
* @param file The "file" portion of the URL.
- * @param handler The protocol handler to use with this URL.
+ * @param ph The protocol handler to use with this URL.
*
* @exception MalformedURLException If no protocol handler can be loaded
* for the specified protocol.
@@ -222,8 +244,8 @@ public final class URL implements Serializable
*
* @since 1.2
*/
- public URL(String protocol, String host, int port, String file,
- URLStreamHandler ph)
+ public URL (String protocol, String host, int port, String file,
+ URLStreamHandler ph)
throws MalformedURLException
{
if (protocol == null)
@@ -320,7 +342,7 @@ public final class URL implements Serializable
*
* @param context The context in which to parse the specification
* @param spec The string to parse as an URL
- * @param handler The stream handler for the URL
+ * @param ph The stream handler for the URL
*
* @exception MalformedURLException If a protocol handler cannot be found
* or the URL cannot be parsed
@@ -718,18 +740,28 @@ public final class URL implements Serializable
return ph.toExternalForm(this);
}
+ /**
+ * This internal method is used in two different constructors to load
+ * a protocol handler for this URL.
+ *
+ * @param protocol The protocol to load a handler for
+ *
+ * @return A URLStreamHandler for this protocol, or null when not found.
+ */
private static synchronized URLStreamHandler
getURLStreamHandler (String protocol)
{
URLStreamHandler ph;
// See if a handler has been cached for this protocol.
- if ((ph = (URLStreamHandler) handlers.get(protocol)) != null)
+ if ((ph = (URLStreamHandler) ph_cache.get(protocol)) != null)
return ph;
// If a non-default factory has been set, use it to find the protocol.
if (factory != null)
- ph = factory.createURLStreamHandler(protocol);
+ {
+ ph = factory.createURLStreamHandler(protocol);
+ }
else if (protocol.equals ("core"))
{
ph = new gnu.gcj.protocol.core.Handler ();
@@ -780,9 +812,10 @@ public final class URL implements Serializable
}
// Update the hashtable with the new protocol handler.
- if (ph != null)
+ if (ph != null
+ && cache_handlers)
if (ph instanceof URLStreamHandler)
- handlers.put(protocol, ph);
+ ph_cache.put(protocol, ph);
else
ph = null;
diff --git a/libjava/java/net/URLClassLoader.java b/libjava/java/net/URLClassLoader.java
index 10b67352f04..e1c789ddd64 100644
--- a/libjava/java/net/URLClassLoader.java
+++ b/libjava/java/net/URLClassLoader.java
@@ -1,5 +1,5 @@
/* URLClassLoader.java -- ClassLoader that loads classes from one or more URLs
- 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.
@@ -59,6 +59,7 @@ import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
+import gnu.gcj.runtime.SharedLibHelper;
/**
* A secure class loader that can load classes and resources from
@@ -194,6 +195,17 @@ public class URLClassLoader extends SecureClassLoader
}
/**
+ * Returns a <code>Class</code> loaded by this
+ * <code>URLLoader</code>, or <code>null</code> when this loader
+ * either can't load the class or doesn't know how to load classes
+ * at all.
+ */
+ Class getClass(String className)
+ {
+ return null;
+ }
+
+ /**
* Returns a <code>Resource</code> loaded by this
* <code>URLLoader</code>, or <code>null</code> when no
* <code>Resource</code> with the given name exists.
@@ -282,7 +294,7 @@ public class URLClassLoader extends SecureClassLoader
{
super(classloader, baseURL);
- // cache url prefix for all resources in this jar url
+ // Cache url prefix for all resources in this jar url.
String external = baseURL.toExternalForm();
StringBuffer sb = new StringBuffer(external.length() + 6);
sb.append("jar:");
@@ -311,6 +323,9 @@ public class URLClassLoader extends SecureClassLoader
if (jarfile == null)
return null;
+ if (name.startsWith("/"))
+ name = name.substring(1);
+
JarEntry je = jarfile.getJarEntry(name);
if(je != null)
return new JarURLResource(this, name, je);
@@ -445,12 +460,12 @@ public class URLClassLoader extends SecureClassLoader
{
return stream;
}
-
+
public int getLength()
{
return length;
}
-
+
public URL getURL()
{
return url;
@@ -458,6 +473,63 @@ public class URLClassLoader extends SecureClassLoader
}
/**
+ * A <code>SoURLLoader</code> is a type of <code>URLLoader</code>
+ * that loads classes and resources from a shared library.
+ */
+ final static class SoURLLoader extends URLLoader
+ {
+ SharedLibHelper helper;
+
+ SoURLLoader(URLClassLoader classloader, URL url)
+ {
+ super(classloader, url);
+ helper = SharedLibHelper.findHelper(classloader, url.getFile(),
+ noCertCodeSource);
+ }
+
+ Class getClass(String className)
+ {
+ return helper.findClass(className);
+ }
+
+ Resource getResource(String name)
+ {
+ URL url = helper.findResource(name);
+ if (url == null)
+ return null;
+ return new SoResource(this, name, url);
+ }
+ }
+
+ final static class SoResource extends Resource
+ {
+ SoResource(SoURLLoader loader, String name, URL url)
+ {
+ super(loader, name);
+ this.url = url;
+ }
+
+ InputStream getInputStream() throws IOException
+ {
+ URLConnection conn = url.openConnection();
+ return conn.getInputStream();
+ }
+
+ public int getLength()
+ {
+ // FIXME we could find this by asking the core object.
+ return -1;
+ }
+
+ public URL getURL ()
+ {
+ return url;
+ }
+
+ final URL url;
+ }
+
+ /**
* A <code>FileURLLoader</code> is a type of <code>URLLoader</code>
* only loading from file url.
*/
@@ -641,7 +713,7 @@ public class URLClassLoader extends SecureClassLoader
// for cache initial size
synchronized(factoryCache)
{
- if(factory != null && factoryCache.get(factory) == null)
+ if (factory != null && factoryCache.get(factory) == null)
factoryCache.put(factory, new HashMap(5));
}
}
@@ -654,26 +726,34 @@ public class URLClassLoader extends SecureClassLoader
*/
protected void addURL(URL newUrl)
{
+ addURLImpl(newUrl);
+ }
+
+ private void addURLImpl(URL newUrl)
+ {
synchronized(urlloaders)
{
if (newUrl == null)
return; // Silently ignore...
- // check global cache to see if there're already url loader
- // for this url
+ // Check global cache to see if there're already url loader
+ // for this url.
URLLoader loader = (URLLoader)urlloaders.get(newUrl);
if (loader == null)
{
String file = newUrl.getFile();
+ String protocol = newUrl.getProtocol();
// Check that it is not a directory
- if (! (file.endsWith("/") || file.endsWith(File.separator)))
+ if ("gcjlib".equals(protocol))
+ loader = new SoURLLoader(this, newUrl);
+ else if (! (file.endsWith("/") || file.endsWith(File.separator)))
loader = new JarURLLoader(this, newUrl);
- else if ("file".equals(newUrl.getProtocol()))
+ else if ("file".equals(protocol))
loader = new FileURLLoader(this, newUrl);
else
loader = new RemoteURLLoader(this, newUrl);
- // cache it
+ // Cache it.
urlloaders.put(newUrl, loader);
}
@@ -690,7 +770,7 @@ public class URLClassLoader extends SecureClassLoader
{
for (int i = 0; i < newUrls.length; i++)
{
- addURL(newUrls[i]);
+ addURLImpl(newUrls[i]);
}
}
@@ -756,7 +836,20 @@ public class URLClassLoader extends SecureClassLoader
{
// Just try to find the resource by the (almost) same name
String resourceName = className.replace('.', '/') + ".class";
- Resource resource = findURLResource(resourceName);
+ int max = urls.size();
+ Resource resource = null;
+ for (int i = 0; i < max && resource == null; i++)
+ {
+ URLLoader loader = (URLLoader)urlinfos.elementAt(i);
+ if (loader == null)
+ continue;
+
+ Class k = loader.getClass(className);
+ if (k != null)
+ return k;
+
+ resource = loader.getResource(resourceName);
+ }
if (resource == null)
throw new ClassNotFoundException(className + " not found in " + urls);
@@ -899,12 +992,12 @@ public class URLClassLoader extends SecureClassLoader
URLStreamHandler handler;
synchronized (factoryCache)
{
- // check if there're handler for the same protocol in cache
+ // Check if there're handler for the same protocol in cache.
HashMap cache = (HashMap)factoryCache.get(factory);
handler = (URLStreamHandler)cache.get(protocol);
if(handler == null)
{
- // add it to cache
+ // Add it to cache.
handler = factory.createURLStreamHandler(protocol);
cache.put(protocol, handler);
}
@@ -963,23 +1056,23 @@ public class URLClassLoader extends SecureClassLoader
// First get the permissions that would normally be granted
PermissionCollection permissions = super.getPermissions(source);
- // Now add the any extra permissions depending on the URL location
+ // Now add any extra permissions depending on the URL location.
URL url = source.getLocation();
String protocol = url.getProtocol();
if (protocol.equals("file"))
{
String file = url.getFile();
- // If the file end in / it must be an directory
+ // If the file end in / it must be an directory.
if (file.endsWith("/") || file.endsWith(File.separator))
{
// Grant permission to read everything in that directory and
- // all subdirectories
+ // all subdirectories.
permissions.add(new FilePermission(file + "-", "read"));
}
else
{
- // It is a 'normal' file
- // Grant permission to access that file
+ // It is a 'normal' file.
+ // Grant permission to access that file.
permissions.add(new FilePermission(file, "read"));
}
}
diff --git a/libjava/java/net/URLEncoder.java b/libjava/java/net/URLEncoder.java
index f03b8a1d8f8..24d0d25b6d8 100644
--- a/libjava/java/net/URLEncoder.java
+++ b/libjava/java/net/URLEncoder.java
@@ -1,5 +1,5 @@
/* URLEncoder.java -- Class to convert strings to a properly encoded URL
- 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.
@@ -53,7 +53,8 @@ import java.io.UnsupportedEncodingException;
* US alphabet remain as is, the space character (' ') is replaced with
* '+' sign, and all other characters are converted to a "%XX" format
* where XX is the hexadecimal representation of that character in a
- * certain encoding (by default "UTF-8").
+ * certain encoding (by default, the platform encoding, though the
+ * standard is "UTF-8").
* <p>
* This method is very useful for encoding strings to be sent to CGI scripts
*
@@ -65,8 +66,9 @@ public class URLEncoder
{
/**
* This method translates the passed in string into x-www-form-urlencoded
- * format using the standard "UTF-8" character encoding to hex-encode the
- * unsafe characters.
+ * format using the default encoding. The standard encoding is
+ * "UTF-8", and the two-argument form of this method should be used
+ * instead.
*
* @param s The String to convert
*
@@ -78,11 +80,13 @@ public class URLEncoder
{
try
{
- return encode(s, "UTF-8");
+ // We default to 8859_1 for compatibility with the same
+ // default elsewhere in the library.
+ return encode(s, System.getProperty("file.encoding", "8859_1"));
}
catch (UnsupportedEncodingException uee)
{
- // Should never happen since UTF-8 should always be supported
+ // Should never happen since default should always be supported
return s;
}
}
@@ -139,7 +143,9 @@ public class URLEncoder
for (int j = 0; j < bytes.length; j++)
{
result.append('%');
- result.append(Integer.toHexString(((int) bytes[j]) & 0xFF));
+ int val = bytes[j];
+ result.append(hex.charAt((val & 0xf0) >> 4));
+ result.append(hex.charAt(val & 0x0f));
}
}
start = i;
@@ -166,4 +172,11 @@ public class URLEncoder
*/
private URLEncoder() { }
+ /**
+ * Used to convert to hex. We don't use Integer.toHexString, since
+ * it converts to lower case (and the Sun docs pretty clearly
+ * specify upper case here), and because it doesn't provide a
+ * leading 0.
+ */
+ private static final String hex = "0123456789ABCDEF";
} // class URLEncoder
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java
index 93a8ab27814..61b466cce6d 100644
--- a/libjava/java/net/URLStreamHandler.java
+++ b/libjava/java/net/URLStreamHandler.java
@@ -196,7 +196,11 @@ public abstract class URLStreamHandler
// need to canonicalise the file path.
try
{
+ boolean endsWithSlash = file.charAt(file.length() - 1) == '/';
file = new File (file).getCanonicalPath ();
+ if (endsWithSlash
+ && file.charAt(file.length() - 1) != '/')
+ file += '/';
}
catch (IOException e)
{
diff --git a/libjava/java/net/natInetAddressWin32.cc b/libjava/java/net/natInetAddressWin32.cc
index f6748fd5691..42c7d7db9e8 100644
--- a/libjava/java/net/natInetAddressWin32.cc
+++ b/libjava/java/net/natInetAddressWin32.cc
@@ -7,124 +7,26 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
+#include <platform.h>
-#ifdef WIN32
-
-#include <windows.h>
-#include <winsock.h>
#undef STRICT
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64
-#endif /* MAXHOSTNAMELEN */
-
-#else /* WIN32 */
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <errno.h>
-
-#include <sys/param.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#endif /* WIN32 */
-
-#include <gcj/cni.h>
-#include <jvm.h>
#include <java/net/InetAddress.h>
#include <java/net/UnknownHostException.h>
#include <java/lang/SecurityException.h>
-#if defined(HAVE_UNAME) && ! defined(HAVE_GETHOSTNAME)
-#include <sys/utsname.h>
-#endif
-
-#ifndef HAVE_GETHOSTNAME_DECL
-extern "C" int gethostname (char *name, int namelen);
-#endif
-
-#ifdef DISABLE_JAVA_NET
-
-jbyteArray
-java::net::InetAddress::aton (jstring)
-{
- return NULL;
-}
-
-jint
-java::net::InetAddress::getFamily (jbyteArray bytes)
-{
- return 0;
-}
-
-JArray<java::net::InetAddress*> *
-java::net::InetAddress::lookup (jstring, java::net::InetAddress *, jboolean)
-{
- return NULL;
-}
-
-jstring
-java::net::InetAddress::getLocalHostname ()
-{
- return NULL;
-}
-
-#else /* DISABLE_JAVA_NET */
-
jbyteArray
java::net::InetAddress::aton (jstring host)
{
- char *hostname;
- char buf[100];
- int len = JvGetStringUTFLength(host);
- if (len < 100)
- hostname = buf;
- else
- hostname = (char*) _Jv_AllocBytes (len+1);
- JvGetStringUTFRegion (host, 0, host->length(), hostname);
- buf[len] = '\0';
+ JV_TEMP_UTF_STRING (hostname, host);
char* bytes = NULL;
int blen = 0;
-#ifdef HAVE_INET_ATON
- struct in_addr laddr;
- if (inet_aton (hostname, &laddr))
+ unsigned long laddr = inet_addr (hostname);
+ if (laddr != INADDR_NONE)
{
bytes = (char*) &laddr;
blen = 4;
}
-#elif defined(HAVE_INET_ADDR)
-#if ! HAVE_IN_ADDR_T
- typedef jint in_addr_t;
-#endif
- in_addr_t laddr = inet_addr (hostname);
- if (laddr != (in_addr_t)(-1))
- {
- bytes = (char*) &laddr;
- blen = 4;
- }
-#endif
-#if defined (HAVE_INET_PTON) && defined (HAVE_INET6)
- char inet6_addr[16];
- if (len != 0 && inet_pton (AF_INET6, hostname, inet6_addr) > 0)
- {
- bytes = inet6_addr;
- blen = 16;
- }
-#endif
if (blen == 0)
return NULL;
jbyteArray result = JvNewByteArray (blen);
@@ -149,69 +51,17 @@ java::net::InetAddress::getFamily (jbyteArray bytes)
JArray<java::net::InetAddress*> *
java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
- jboolean all)
+ jboolean all)
{
struct hostent *hptr = NULL;
-#if defined (HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYADDR_R)
- struct hostent hent_r;
-#if HAVE_STRUCT_HOSTENT_DATA
- struct hostent_data fixed_buffer, *buffer_r = &fixed_buffer;
-#else
-#if defined (__GLIBC__)
- // FIXME: in glibc, gethostbyname_r returns NETDB_INTERNAL to herr and
- // ERANGE to errno if the buffer size is too small, rather than what is
- // expected here. We work around this by setting a bigger buffer size and
- // hoping that it is big enough.
- char fixed_buffer[1024];
-#else
- char fixed_buffer[200];
-#endif
- char *buffer_r = fixed_buffer;
- int size_r = sizeof (fixed_buffer);
-#endif
-#endif
-
if (host != NULL)
{
- char *hostname;
- char buf[100];
- int len = JvGetStringUTFLength(host);
- if (len < 100)
- hostname = buf;
- else
- hostname = (char*) _Jv_AllocBytes (len+1);
- JvGetStringUTFRegion (host, 0, host->length(), hostname);
- buf[len] = '\0';
-#ifdef HAVE_GETHOSTBYNAME_R
- while (true)
- {
- int ok;
-#if HAVE_STRUCT_HOSTENT_DATA
- ok = ! gethostbyname_r (hostname, &hent_r, buffer_r);
-#else
- int herr = 0;
-#ifdef GETHOSTBYNAME_R_RETURNS_INT
- ok = ! gethostbyname_r (hostname, &hent_r, buffer_r, size_r,
- &hptr, &herr);
-#else
- hptr = gethostbyname_r (hostname, &hent_r, buffer_r, size_r, &herr);
- ok = hptr != NULL;
-#endif /* GETHOSTNAME_R_RETURNS_INT */
- if (! ok && herr == ERANGE)
- {
- size_r *= 2;
- buffer_r = (char *) _Jv_AllocBytes (size_r);
- }
- else
-#endif /* HAVE_STRUCT_HOSTENT_DATA */
- break;
- }
-#else
+ JV_TEMP_UTF_STRING (hostname, host);
+
// FIXME: this is insufficient if some other piece of code calls
// this gethostbyname.
JvSynchronize sync (java::net::InetAddress::localhostAddress);
hptr = gethostbyname (hostname);
-#endif /* HAVE_GETHOSTBYNAME_R */
}
else
{
@@ -221,51 +71,24 @@ java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
int type;
char *val;
if (len == 4)
- {
- val = chars;
- type = iaddr->family = AF_INET;
- }
+ {
+ val = chars;
+ type = iaddr->family = AF_INET;
+ }
#ifdef HAVE_INET6
else if (len == 16)
- {
- val = (char *) &chars;
- type = iaddr->family = AF_INET6;
- }
+ {
+ val = (char *) &chars;
+ type = iaddr->family = AF_INET6;
+ }
#endif /* HAVE_INET6 */
else
- JvFail ("unrecognized size");
+ JvFail ("unrecognized size");
-#ifdef HAVE_GETHOSTBYADDR_R
- while (true)
- {
- int ok;
-#if HAVE_STRUCT_HOSTENT_DATA
- ok = ! gethostbyaddr_r (val, len, type, &hent_r, buffer_r);
-#else
- int herr = 0;
-#ifdef GETHOSTBYADDR_R_RETURNS_INT
- ok = ! gethostbyaddr_r (val, len, type, &hent_r,
- buffer_r, size_r, &hptr, &herr);
-#else
- hptr = gethostbyaddr_r (val, len, type, &hent_r,
- buffer_r, size_r, &herr);
- ok = hptr != NULL;
-#endif /* GETHOSTBYADDR_R_RETURNS_INT */
- if (! ok && herr == ERANGE)
- {
- size_r *= 2;
- buffer_r = (char *) _Jv_AllocBytes (size_r);
- }
- else
-#endif /* HAVE_STRUCT_HOSTENT_DATA */
- break;
- }
-#else /* HAVE_GETHOSTBYADDR_R */
// FIXME: this is insufficient if some other piece of code calls
// this gethostbyaddr.
JvSynchronize sync (java::net::InetAddress::localhostAddress);
hptr = gethostbyaddr (val, len, type);
-#endif /* HAVE_GETHOSTBYADDR_R */
}
if (hptr != NULL)
{
@@ -273,22 +96,23 @@ java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
host = JvNewStringUTF (hptr->h_name);
java::lang::SecurityException *ex = checkConnect (host);
if (ex != NULL)
- {
- if (iaddr == NULL || iaddr->addr == NULL)
- throw ex;
- hptr = NULL;
- }
+ {
+ if (iaddr == NULL || iaddr->addr == NULL)
+ throw ex;
+ hptr = NULL;
+ }
}
if (hptr == NULL)
{
if (iaddr != NULL && iaddr->addr != NULL)
- {
- iaddr->hostName = iaddr->getHostAddress();
- return NULL;
- }
+ {
+ iaddr->hostName = iaddr->getHostAddress();
+ return NULL;
+ }
else
- throw new java::net::UnknownHostException(host);
+ throw new java::net::UnknownHostException(host);
}
+
int count;
if (all)
{
@@ -298,6 +122,7 @@ java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
}
else
count = 1;
+
JArray<java::net::InetAddress*> *result;
java::net::InetAddress** iaddrs;
if (all)
@@ -314,42 +139,30 @@ java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
for (int i = 0; i < count; i++)
{
if (iaddrs[i] == NULL)
- iaddrs[i] = new java::net::InetAddress (NULL, NULL);
+ iaddrs[i] = new java::net::InetAddress (NULL, NULL);
if (iaddrs[i]->hostName == NULL)
iaddrs[i]->hostName = host;
if (iaddrs[i]->addr == NULL)
- {
- char *bytes = hptr->h_addr_list[i];
- iaddrs[i]->addr = JvNewByteArray (hptr->h_length);
- iaddrs[i]->family = getFamily (iaddrs[i]->addr);
- memcpy (elements (iaddrs[i]->addr), bytes, hptr->h_length);
- }
+ {
+ char *bytes = hptr->h_addr_list[i];
+ iaddrs[i]->addr = JvNewByteArray (hptr->h_length);
+ iaddrs[i]->family = getFamily (iaddrs[i]->addr);
+ memcpy (elements (iaddrs[i]->addr), bytes, hptr->h_length);
+ }
}
+
return result;
}
jstring
java::net::InetAddress::getLocalHostname ()
{
- char *chars;
-#ifdef HAVE_GETHOSTNAME
- char buffer[MAXHOSTNAMELEN];
- if (gethostname (buffer, MAXHOSTNAMELEN))
+ char buffer[400];
+ if (gethostname (buffer, sizeof(buffer)))
return NULL;
- chars = buffer;
-#elif HAVE_UNAME
- struct utsname stuff;
- if (uname (&stuff) != 0)
- return NULL;
- chars = stuff.nodename;
-#else
- return NULL;
-#endif
// It is admittedly non-optimal to convert the hostname to Unicode
// only to convert it back in getByName, but simplicity wins. Note
// that unless there is a SecurityManager, we only get called once
// anyway, thanks to the InetAddress.localhost cache.
- return JvNewStringUTF (chars);
+ return JvNewStringUTF (buffer);
}
-
-#endif /* DISABLE_JAVA_NET */
diff --git a/libjava/java/net/natNetworkInterfaceWin32.cc b/libjava/java/net/natNetworkInterfaceWin32.cc
index 47d68b5fd65..20c9a9b5967 100644
--- a/libjava/java/net/natNetworkInterfaceWin32.cc
+++ b/libjava/java/net/natNetworkInterfaceWin32.cc
@@ -9,134 +9,126 @@ details. */
#include <config.h>
#include <platform.h>
-#ifdef WIN32
-
-#include <windows.h>
-#include <winsock.h>
#undef STRICT
-#else /* WIN32 */
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include <sys/param.h>
-#include <sys/types.h>
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_SYS_IOCTL_H
-#define BSD_COMP /* Get FIONREAD on Solaris2. */
-#include <sys/ioctl.h>
-#endif
-#ifdef HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-#endif /* WIN32 */
-
-#include <gcj/cni.h>
-#include <jvm.h>
#include <java/net/NetworkInterface.h>
#include <java/net/Inet4Address.h>
#include <java/net/SocketException.h>
#include <java/util/Vector.h>
-#ifdef DISABLE_JAVA_NET
+/* As of this writing, NetworkInterface.java has
+ getName() == getDisplayName() and only one IP address
+ per interface. If this changes, we'll need to use
+ iphlpapi (not supported on Win95) to retrieve richer
+ adapter information via GetAdaptersInfo(). In this
+ module, we provide the necessary hooks to detect the
+ presence of iphlpapi and use it if necessary, but
+ comment things out for now to avoid compiler warnings. */
-::java::util::Vector*
-java::net::NetworkInterface::getRealNetworkInterfaces ()
-{
- ::java::util::Vector* ht = new ::java::util::Vector();
- return ht;
-}
+enum {MAX_INTERFACES = 50};
-#else /* DISABLE_JAVA_NET */
+typedef int
+(*PfnGetRealNetworkInterfaces) (jstring* pjstrName,
+ java::net::InetAddress** ppAddress);
-::java::util::Vector*
-java::net::NetworkInterface::getRealNetworkInterfaces ()
+static int
+winsock2GetRealNetworkInterfaces (jstring* pjstrName,
+ java::net::InetAddress** ppAddress)
{
-#ifdef WIN32
- throw new ::java::net::SocketException;
-#else
- int fd;
- int num_interfaces = 0;
- struct ifconf if_data;
- struct ifreq* if_record;
- ::java::util::Vector* ht = new ::java::util::Vector ();
-
- if_data.ifc_len = 0;
- if_data.ifc_buf = NULL;
-
- // Open a (random) socket to have a file descriptor for the ioctl calls.
- fd = _Jv_socket (PF_INET, SOCK_DGRAM, htons (IPPROTO_IP));
-
- if (fd < 0)
- throw new ::java::net::SocketException;
-
- // Get all interfaces. If not enough buffers are available try it
- // with a bigger buffer size.
- do
- {
- num_interfaces += 16;
-
- if_data.ifc_len = sizeof (struct ifreq) * num_interfaces;
- if_data.ifc_buf =
- (char*) _Jv_Realloc (if_data.ifc_buf, if_data.ifc_len);
-
- // Try to get all local interfaces.
- if (::ioctl (fd, SIOCGIFCONF, &if_data) < 0)
- throw new java::net::SocketException;
- }
- while (if_data.ifc_len >= (sizeof (struct ifreq) * num_interfaces));
-
+ // FIXME: Add IPv6 support.
+
+ INTERFACE_INFO arInterfaceInfo[MAX_INTERFACES];
+
+ // Open a (random) socket to have a file descriptor for the WSAIoctl call.
+ SOCKET skt = ::socket (AF_INET, SOCK_DGRAM, 0);
+ if (skt == INVALID_SOCKET)
+ _Jv_ThrowSocketException ();
+
+ DWORD dwOutBufSize;
+ int nRetCode = ::WSAIoctl (skt, SIO_GET_INTERFACE_LIST,
+ NULL, 0, &arInterfaceInfo, sizeof(arInterfaceInfo),
+ &dwOutBufSize, NULL, NULL);
+
+ if (nRetCode == SOCKET_ERROR)
+ {
+ DWORD dwLastErrorCode = WSAGetLastError ();
+ ::closesocket (skt);
+ _Jv_ThrowSocketException (dwLastErrorCode);
+ }
+
// Get addresses of all interfaces.
- if_record = if_data.ifc_req;
-
- for (int n = 0; n < if_data.ifc_len; n += sizeof (struct ifreq))
+ int nNbInterfaces = dwOutBufSize / sizeof(INTERFACE_INFO);
+ int nCurETHInterface = 0;
+ for (int i=0; i < nNbInterfaces; ++i)
{
- struct ifreq ifr;
-
- memset (&ifr, 0, sizeof (ifr));
- strcpy (ifr.ifr_name, if_record->ifr_name);
-
- // Try to get the IPv4-address of the local interface
- if (::ioctl (fd, SIOCGIFADDR, &ifr) < 0)
- throw new java::net::SocketException;
-
int len = 4;
- struct sockaddr_in sa = *((sockaddr_in*) &(ifr.ifr_addr));
-
jbyteArray baddr = JvNewByteArray (len);
- memcpy (elements (baddr), &(sa.sin_addr), len);
- jstring if_name = JvNewStringLatin1 (if_record->ifr_name);
- Inet4Address* address =
+ SOCKADDR_IN* pAddr = (SOCKADDR_IN*) &arInterfaceInfo[i].iiAddress;
+ memcpy (elements (baddr), &(pAddr->sin_addr), len);
+
+ // Concoct a name for this interface. Since we don't
+ // 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];
+ u_long lFlags = arInterfaceInfo[i].iiFlags;
+
+ if (lFlags & IFF_LOOPBACK)
+ strcpy (szName, "lo");
+ else
+ {
+ strcpy (szName, "eth");
+ wsprintf(szName+3, "%d", nCurETHInterface++);
+ }
+
+ jstring if_name = JvNewStringLatin1 (szName);
+ java::net::Inet4Address* address =
new java::net::Inet4Address (baddr, JvNewStringLatin1 (""));
- ht->add (new NetworkInterface (if_name, address));
- if_record++;
+ pjstrName[i] = if_name;
+ ppAddress[i] = address;
}
-#ifdef HAVE_INET6
- // FIXME: read /proc/net/if_inet6 (on Linux 2.4)
-#endif
-
- _Jv_Free (if_data.ifc_buf);
+ ::closesocket (skt);
- if (fd >= 0)
- _Jv_close (fd);
+ return nNbInterfaces;
+}
+
+/*
+static int
+iphlpapiGetRealNetworkInterfaces (jstring* pjstrName,
+ java::net::InetAddress** ppAddress)
+{
+ return 0;
+}
+*/
+
+static PfnGetRealNetworkInterfaces
+determineGetRealNetworkInterfacesFN ()
+{
+ /* FIXME: Try to dynamically load iphlpapi.dll and
+ detect the presence of GetAdaptersInfo() using
+ GetProcAddress(). If successful, return
+ iphlpapiGetRealNetworkInterfaces; if not,
+ return winsock2GetRealNetworkInterfaces */
+ return &winsock2GetRealNetworkInterfaces;
+}
+
+::java::util::Vector*
+java::net::NetworkInterface::getRealNetworkInterfaces ()
+{
+ static PfnGetRealNetworkInterfaces pfn =
+ determineGetRealNetworkInterfacesFN ();
+
+ jstring arIFName[MAX_INTERFACES];
+ InetAddress* arpInetAddress[MAX_INTERFACES];
+ ::java::util::Vector* ht = new ::java::util::Vector ();
+ int nNbInterfaces = (*pfn) (arIFName, arpInetAddress);
+ for (int i=0; i < nNbInterfaces; ++i)
+ {
+ ht->add (new java::net::NetworkInterface (arIFName[i],
+ arpInetAddress[i]));
+ }
+
return ht;
-#endif /* WIN32 */
}
-
-#endif // DISABLE_JAVA_NET //
diff --git a/libjava/java/net/natPlainDatagramSocketImplNoNet.cc b/libjava/java/net/natPlainDatagramSocketImplNoNet.cc
deleted file mode 100644
index a2a08d719c4..00000000000
--- a/libjava/java/net/natPlainDatagramSocketImplNoNet.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-/* 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 <java/io/IOException.h>
-#include <java/lang/Object.h>
-#include <java/net/BindException.h>
-#include <java/net/DatagramPacket.h>
-#include <java/net/InetAddress.h>
-#include <java/net/NetworkInterface.h>
-#include <java/net/PlainDatagramSocketImpl.h>
-#include <java/net/SocketException.h>
-
-void
-java::net::PlainDatagramSocketImpl::create ()
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.create: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::bind (jint, java::net::InetAddress *)
-{
- throw new BindException (
- JvNewStringLatin1 ("DatagramSocketImpl.bind: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::connect (java::net::InetAddress *, jint)
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.connect: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::disconnect ()
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.disconnect: unimplemented"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.peek: unimplemented"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::peekData(java::net::DatagramPacket *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.peekData: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::close ()
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.close: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::send (java::net::DatagramPacket *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.send: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::receive (java::net::DatagramPacket *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.receive: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setTimeToLive (jint)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.setTimeToLive: unimplemented"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::getTimeToLive ()
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.getTimeToLive: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *,
- java::net::NetworkInterface *,
- jboolean)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.mcastGrp: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setOption (jint, java::lang::Object *)
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.setOption: unimplemented"));
-}
-
-java::lang::Object *
-java::net::PlainDatagramSocketImpl::getOption (jint)
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.getOption: unimplemented"));
-}
diff --git a/libjava/java/net/natPlainDatagramSocketImplPosix.cc b/libjava/java/net/natPlainDatagramSocketImplPosix.cc
deleted file mode 100644
index 14f6fee2df0..00000000000
--- a/libjava/java/net/natPlainDatagramSocketImplPosix.cc
+++ /dev/null
@@ -1,750 +0,0 @@
-/* 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>
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#include <errno.h>
-#include <string.h>
-
-#if HAVE_BSTRING_H
-// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
-#include <bstring.h>
-#endif
-
-#include <gcj/cni.h>
-#include <java/io/IOException.h>
-#include <java/io/InterruptedIOException.h>
-#include <java/net/BindException.h>
-#include <java/net/SocketException.h>
-#include <java/net/PlainDatagramSocketImpl.h>
-#include <java/net/InetAddress.h>
-#include <java/net/NetworkInterface.h>
-#include <java/net/DatagramPacket.h>
-#include <java/net/PortUnreachableException.h>
-#include <java/lang/InternalError.h>
-#include <java/lang/Object.h>
-#include <java/lang/Boolean.h>
-#include <java/lang/Integer.h>
-
-union SockAddr
-{
- struct sockaddr_in address;
-#ifdef HAVE_INET6
- struct sockaddr_in6 address6;
-#endif
-};
-
-union McastReq
-{
-#if HAVE_STRUCT_IP_MREQ
- struct ip_mreq mreq;
-#endif
-#if HAVE_STRUCT_IPV6_MREQ
- struct ipv6_mreq mreq6;
-#endif
-};
-
-union InAddr
-{
- struct in_addr addr;
-#ifdef HAVE_INET6
- struct in6_addr addr6;
-#endif
-};
-
-
-// FIXME: routines here and/or in natPlainSocketImpl.cc could throw
-// NoRouteToHostException; also consider UnknownHostException, ConnectException.
-
-void
-java::net::PlainDatagramSocketImpl::create ()
-{
- int sock = _Jv_socket (AF_INET, SOCK_DGRAM, 0);
-
- if (sock < 0)
- {
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
- }
-
- _Jv_platform_close_on_exec (sock);
-
- // We use fnum in place of fd here. From leaving fd null we avoid
- // the double close problem in FileDescriptor.finalize.
- fnum = sock;
-}
-
-void
-java::net::PlainDatagramSocketImpl::bind (jint lport,
- java::net::InetAddress *host)
-{
- union SockAddr u;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- // FIXME: Use getaddrinfo() to get actual protocol instead of assuming ipv4.
- jbyteArray haddress = host->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
-
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
-
- if (host != NULL)
- memcpy (&u.address.sin_addr, bytes, len);
- else
- u.address.sin_addr.s_addr = htonl (INADDR_ANY);
-
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (lport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (lport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (_Jv_bind (fnum, ptr, len) == 0)
- {
- socklen_t addrlen = sizeof(u);
-
- if (lport != 0)
- localPort = lport;
- else if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0)
- localPort = ntohs (u.address.sin_port);
- else
- goto error;
-
- /* Allow broadcast by default. */
- int broadcast = 1;
- if (::setsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &broadcast,
- sizeof (broadcast)) != 0)
- goto error;
-
- return;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::BindException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::connect (java::net::InetAddress *, jint)
-{
- throw new ::java::lang::InternalError (JvNewStringLatin1 (
- "PlainDatagramSocketImpl::connect: not implemented yet"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::disconnect ()
-{
- throw new ::java::lang::InternalError (JvNewStringLatin1 (
- "PlainDatagramSocketImpl::disconnect: not implemented yet"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *i)
-{
- // FIXME: Deal with Multicast and if the socket is connected.
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- ssize_t retlen =
- ::recvfrom (fnum, (char *) NULL, 0, MSG_PEEK, (sockaddr*) &u,
- &addrlen);
- if (retlen < 0)
- goto error;
- // FIXME: Deal with Multicast addressing and if the socket is connected.
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- i->addr = raddr;
- return rport;
- error:
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-jint
-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());
- ssize_t retlen = 0;
-
- // Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::io::InterruptedIOException ();
- }
-
- retlen =
- ::recvfrom (fnum, (char *) dbytes, p->getLength(), MSG_PEEK, (sockaddr*) &u,
- &addrlen);
- if (retlen < 0)
- goto error;
- // FIXME: Deal with Multicast addressing and if the socket is connected.
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- p->setAddress (new InetAddress (raddr, NULL));
- p->setPort (rport);
- p->setLength ((jint) retlen);
- return rport;
-
- error:
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-// Close(shutdown) the socket.
-void
-java::net::PlainDatagramSocketImpl::close ()
-{
- // Avoid races from asynchronous finalization.
- JvSynchronize sync (this);
-
- // The method isn't declared to throw anything, so we disregard
- // the return value.
- _Jv_close (fnum);
- fnum = -1;
- timeout = 0;
-}
-
-void
-java::net::PlainDatagramSocketImpl::send (java::net::DatagramPacket *p)
-{
- // FIXME: Deal with Multicast and if the socket is connected.
- jint rport = p->getPort();
- union SockAddr u;
- jbyteArray haddress = p->getAddress()->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- jbyte *dbytes = elements (p->getData());
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
- memcpy (&u.address.sin_addr, bytes, len);
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (rport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (rport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (::sendto (fnum, (char *) dbytes, p->getLength(), 0, ptr, len) >= 0)
- return;
-
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-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());
- ssize_t retlen = 0;
-
- // Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::io::InterruptedIOException ();
- }
-
- retlen =
- ::recvfrom (fnum, (char *) dbytes, p->getLength(), 0, (sockaddr*) &u,
- &addrlen);
- if (retlen < 0)
- goto error;
- // FIXME: Deal with Multicast addressing and if the socket is connected.
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- p->setAddress (new InetAddress (raddr, NULL));
- p->setPort (rport);
- p->setLength ((jint) retlen);
- return;
-
- error:
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setTimeToLive (jint ttl)
-{
- // Assumes IPPROTO_IP rather than IPPROTO_IPV6 since socket created is IPv4.
- char val = (char) ttl;
- socklen_t val_len = sizeof(val);
-
- if (::setsockopt (fnum, IPPROTO_IP, IP_MULTICAST_TTL, &val, val_len) == 0)
- return;
-
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::getTimeToLive ()
-{
- // Assumes IPPROTO_IP rather than IPPROTO_IPV6 since socket created is IPv4.
- char val;
- socklen_t val_len = sizeof(val);
-
- if (::getsockopt (fnum, IPPROTO_IP, IP_MULTICAST_TTL, &val, &val_len) == 0)
- return ((int) val) & 0xFF;
-
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
- java::net::NetworkInterface *,
- jboolean join)
-{
- // FIXME: implement use of NetworkInterface
-
- union McastReq u;
- jbyteArray haddress = inetaddr->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- int level, opname;
- const char *ptr;
- if (0)
- ;
-#if HAVE_STRUCT_IP_MREQ
- else if (len == 4)
- {
- level = IPPROTO_IP;
- opname = join ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP;
- memcpy (&u.mreq.imr_multiaddr, bytes, len);
- // FIXME: If a non-default interface is set, use it; see Stevens p. 501.
- // Maybe not, see note in last paragraph at bottom of Stevens p. 497.
- u.mreq.imr_interface.s_addr = htonl (INADDR_ANY);
- len = sizeof (struct ip_mreq);
- ptr = (const char *) &u.mreq;
- }
-#endif
-#if HAVE_STRUCT_IPV6_MREQ
- else if (len == 16)
- {
- level = IPPROTO_IPV6;
-
- /* Prefer new RFC 2553 names. */
-#ifndef IPV6_JOIN_GROUP
-#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
-#endif
-#ifndef IPV6_LEAVE_GROUP
-#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
-#endif
-
- opname = join ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP;
- memcpy (&u.mreq6.ipv6mr_multiaddr, bytes, len);
- // FIXME: If a non-default interface is set, use it; see Stevens p. 501.
- // Maybe not, see note in last paragraph at bottom of Stevens p. 497.
- u.mreq6.ipv6mr_interface = 0;
- len = sizeof (struct ipv6_mreq);
- ptr = (const char *) &u.mreq6;
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (::setsockopt (fnum, level, opname, ptr, len) == 0)
- return;
-
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setOption (jint optID,
- java::lang::Object *value)
-{
- int val;
- socklen_t val_len = sizeof (val);
-
- if (fnum < 0)
- throw new java::net::SocketException (JvNewStringUTF ("Socket closed"));
-
- if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$))
- {
- java::lang::Boolean *boolobj =
- static_cast<java::lang::Boolean *> (value);
- val = boolobj->booleanValue() ? 1 : 0;
- }
- else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$))
- {
- java::lang::Integer *intobj =
- static_cast<java::lang::Integer *> (value);
- val = (int) intobj->intValue();
- }
- // Else assume value to be an InetAddress for use with IP_MULTICAST_IF.
-
- switch (optID)
- {
- case _Jv_TCP_NODELAY_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("TCP_NODELAY not valid for UDP"));
- return;
- case _Jv_SO_LINGER_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_LINGER not valid for UDP"));
- return;
- case _Jv_SO_KEEPALIVE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_KEEPALIVE not valid for UDP"));
- return;
-
- case _Jv_SO_BROADCAST_ :
- if (::setsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_OOBINLINE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_OOBINLINE: not valid for UDP"));
- break;
-
- case _Jv_SO_SNDBUF_ :
- case _Jv_SO_RCVBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::setsockopt (fnum, SOL_SOCKET, opt, (char *) &val, val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- return;
- case _Jv_SO_REUSEADDR_ :
-#if defined(SO_REUSEADDR)
- if (::setsockopt (fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &val,
- val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_REUSEADDR not supported"));
-#endif
- return;
- case _Jv_SO_BINDADDR_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_BINDADDR: read only option"));
- return;
- case _Jv_IP_MULTICAST_IF_ :
- union InAddr u;
- jbyteArray haddress;
- jbyte *bytes;
- int len;
- int level, opname;
- const char *ptr;
-
- haddress = ((java::net::InetAddress *) value)->addr;
- bytes = elements (haddress);
- len = haddress->length;
- if (len == 4)
- {
- level = IPPROTO_IP;
- opname = IP_MULTICAST_IF;
- memcpy (&u.addr, bytes, len);
- len = sizeof (struct in_addr);
- ptr = (const char *) &u.addr;
- }
-// Tru64 UNIX V5.0 has struct sockaddr_in6, but no IPV6_MULTICAST_IF
-#if defined (HAVE_INET6) && defined (IPV6_MULTICAST_IF)
- else if (len == 16)
- {
- level = IPPROTO_IPV6;
- opname = IPV6_MULTICAST_IF;
- memcpy (&u.addr6, bytes, len);
- len = sizeof (struct in6_addr);
- ptr = (const char *) &u.addr6;
- }
-#endif
- else
- throw
- new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (::setsockopt (fnum, level, opname, ptr, len) != 0)
- goto error;
- return;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF2: not yet implemented"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_LOOP: not yet implemented"));
- break;
-
- case _Jv_IP_TOS_ :
- if (::setsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- val_len) != 0)
- goto error;
- return;
-
- case _Jv_SO_TIMEOUT_ :
- timeout = val;
- return;
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
-
-java::lang::Object *
-java::net::PlainDatagramSocketImpl::getOption (jint optID)
-{
- int val;
- socklen_t val_len = sizeof(val);
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
-
- switch (optID)
- {
- case _Jv_TCP_NODELAY_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("TCP_NODELAY not valid for UDP"));
- break;
- case _Jv_SO_LINGER_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_LINGER not valid for UDP"));
- break;
- case _Jv_SO_KEEPALIVE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_KEEPALIVE not valid for UDP"));
- break;
-
- case _Jv_SO_BROADCAST_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean (val != 0);
-
- case _Jv_SO_OOBINLINE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_OOBINLINE not valid for UDP"));
- break;
-
- case _Jv_SO_RCVBUF_ :
- case _Jv_SO_SNDBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::getsockopt (fnum, SOL_SOCKET, opt, (char *) &val, &val_len) != 0)
- goto error;
- else
- return new java::lang::Integer (val);
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- break;
- case _Jv_SO_BINDADDR_:
- // cache the local address
- if (localAddress == NULL)
- {
- jbyteArray laddr;
- if (::getsockname (fnum, (sockaddr*) &u, &addrlen) != 0)
- goto error;
- if (u.address.sin_family == AF_INET)
- {
- laddr = JvNewByteArray (4);
- memcpy (elements (laddr), &u.address.sin_addr, 4);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- laddr = JvNewByteArray (16);
- memcpy (elements (laddr), &u.address6.sin6_addr, 16);
- }
-#endif
- else
- throw new java::net::SocketException (
- JvNewStringUTF ("invalid family"));
- localAddress = new java::net::InetAddress (laddr, NULL);
- }
- return localAddress;
- break;
- case _Jv_SO_REUSEADDR_ :
-#if defined(SO_REUSEADDR)
- if (::getsockopt (fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean (val != 0);
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_REUSEADDR not supported"));
-#endif
- break;
- case _Jv_IP_MULTICAST_IF_ :
-#ifdef HAVE_INET_NTOA
- struct in_addr inaddr;
- socklen_t inaddr_len;
- char *bytes;
-
- inaddr_len = sizeof(inaddr);
- if (::getsockopt (fnum, IPPROTO_IP, IP_MULTICAST_IF, (char *) &inaddr,
- &inaddr_len) != 0)
- goto error;
-
- bytes = inet_ntoa (inaddr);
-
- return java::net::InetAddress::getByName (JvNewStringLatin1 (bytes));
-#else
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF: not available - no inet_ntoa()"));
-#endif
- break;
- case _Jv_SO_TIMEOUT_ :
- return new java::lang::Integer (timeout);
- break;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF2: not yet implemented"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- if (::getsockopt (fnum, SOL_SOCKET, IP_MULTICAST_LOOP, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean (val != 0);
-
- case _Jv_IP_TOS_ :
- if (::getsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Integer (val);
-
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
diff --git a/libjava/java/net/natPlainDatagramSocketImplWin32.cc b/libjava/java/net/natPlainDatagramSocketImplWin32.cc
deleted file mode 100644
index d0d006d4b43..00000000000
--- a/libjava/java/net/natPlainDatagramSocketImplWin32.cc
+++ /dev/null
@@ -1,872 +0,0 @@
-/* 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>
-
-#ifdef WIN32
-
-#include <errno.h>
-#include <string.h>
-
-#else /* WIN32 */
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#include <errno.h>
-#include <string.h>
-
-#endif /* WIN32 */
-
-#if HAVE_BSTRING_H
-// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
-#include <bstring.h>
-#endif
-
-#include <gcj/cni.h>
-#include <java/io/IOException.h>
-#include <java/io/InterruptedIOException.h>
-#include <java/net/BindException.h>
-#include <java/net/SocketException.h>
-#include <java/net/PlainDatagramSocketImpl.h>
-#include <java/net/InetAddress.h>
-#include <java/net/NetworkInterface.h>
-#include <java/net/DatagramPacket.h>
-#include <java/net/PortUnreachableException.h>
-#include <java/lang/InternalError.h>
-#include <java/lang/Object.h>
-#include <java/lang/Boolean.h>
-#include <java/lang/Integer.h>
-
-#ifdef DISABLE_JAVA_NET
-
-void
-java::net::PlainDatagramSocketImpl::create ()
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.create: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::bind (jint, java::net::InetAddress *)
-{
- throw new BindException (
- JvNewStringLatin1 ("DatagramSocketImpl.bind: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::connect (java::net::InetAddress *, jint)
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.connect: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::disconnect ()
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.disconnect: unimplemented"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.peek: unimplemented"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::peekData(java::net::DatagramPacket *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.peekData: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::close ()
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.close: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::send (java::net::DatagramPacket *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.send: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::receive (java::net::DatagramPacket *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.receive: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setTimeToLive (jint)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.setTimeToLive: unimplemented"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::getTimeToLive ()
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.getTimeToLive: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *,
- java::net::NetworkInterface *,
- jboolean)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("DatagramSocketImpl.mcastGrp: unimplemented"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setOption (jint, java::lang::Object *)
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.setOption: unimplemented"));
-}
-
-java::lang::Object *
-java::net::PlainDatagramSocketImpl::getOption (jint)
-{
- throw new SocketException (
- JvNewStringLatin1 ("DatagramSocketImpl.getOption: unimplemented"));
-}
-
-#else /* DISABLE_JAVA_NET */
-
-
-union SockAddr
-{
- struct sockaddr_in address;
-#ifdef HAVE_INET6
- struct sockaddr_in6 address6;
-#endif
-};
-
-union McastReq
-{
-#if HAVE_STRUCT_IP_MREQ
- struct ip_mreq mreq;
-#endif
-#if HAVE_STRUCT_IPV6_MREQ
- struct ipv6_mreq mreq6;
-#endif
-};
-
-union InAddr
-{
- struct in_addr addr;
-#ifdef HAVE_INET6
- struct in6_addr addr6;
-#endif
-};
-
-
-// FIXME: routines here and/or in natPlainSocketImpl.cc could throw
-// NoRouteToHostException; also consider UnknownHostException, ConnectException.
-
-void
-java::net::PlainDatagramSocketImpl::create ()
-{
- int sock = _Jv_socket (AF_INET, SOCK_DGRAM, 0);
-
- if (sock < 0)
- {
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
- }
-
- _Jv_platform_close_on_exec (sock);
-
- // We use fnum in place of fd here. From leaving fd null we avoid
- // the double close problem in FileDescriptor.finalize.
- fnum = sock;
-}
-
-void
-java::net::PlainDatagramSocketImpl::bind (jint lport,
- java::net::InetAddress *host)
-{
- union SockAddr u;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- // FIXME: Use getaddrinfo() to get actual protocol instead of assuming ipv4.
- jbyteArray haddress = host->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
-
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
-
- if (host != NULL)
- memcpy (&u.address.sin_addr, bytes, len);
- else
- u.address.sin_addr.s_addr = htonl (INADDR_ANY);
-
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (lport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (lport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (_Jv_bind (fnum, ptr, len) == 0)
- {
- socklen_t addrlen = sizeof(u);
-
- if (lport != 0)
- localPort = lport;
- else if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0)
- localPort = ntohs (u.address.sin_port);
- else
- goto error;
-
- /* Allow broadcast by default. */
- int broadcast = 1;
- if (::setsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &broadcast,
- sizeof (broadcast)) != 0)
- goto error;
-
- return;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::BindException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::connect (java::net::InetAddress *, jint)
-{
- throw new ::java::lang::InternalError (JvNewStringLatin1 (
- "PlainDatagramSocketImpl::connect: not implemented yet"));
-}
-
-void
-java::net::PlainDatagramSocketImpl::disconnect ()
-{
- throw new ::java::lang::InternalError (JvNewStringLatin1 (
- "PlainDatagramSocketImpl::disconnect: not implemented yet"));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *i)
-{
- // FIXME: Deal with Multicast and if the socket is connected.
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- ssize_t retlen =
- ::recvfrom (fnum, (char *) NULL, 0, MSG_PEEK, (sockaddr*) &u,
- &addrlen);
- if (retlen < 0)
- goto error;
- // FIXME: Deal with Multicast addressing and if the socket is connected.
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- i->addr = raddr;
- return rport;
- error:
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-jint
-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());
- ssize_t retlen = 0;
-
-// FIXME: implement timeout support for Win32
-#ifndef WIN32
- // Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::io::InterruptedIOException ();
- }
-#endif /* WIN32 */
-
- retlen =
- ::recvfrom (fnum, (char *) dbytes, p->getLength(), MSG_PEEK, (sockaddr*) &u,
- &addrlen);
- if (retlen < 0)
- goto error;
- // FIXME: Deal with Multicast addressing and if the socket is connected.
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- p->setAddress (new InetAddress (raddr, NULL));
- p->setPort (rport);
- p->setLength ((jint) retlen);
- return rport;
-
- error:
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-// Close(shutdown) the socket.
-void
-java::net::PlainDatagramSocketImpl::close ()
-{
- // Avoid races from asynchronous finalization.
- JvSynchronize sync (this);
-
- // The method isn't declared to throw anything, so we disregard
- // the return value.
- _Jv_close (fnum);
- fnum = -1;
- timeout = 0;
-}
-
-void
-java::net::PlainDatagramSocketImpl::send (java::net::DatagramPacket *p)
-{
- // FIXME: Deal with Multicast and if the socket is connected.
- jint rport = p->getPort();
- union SockAddr u;
- jbyteArray haddress = p->getAddress()->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- jbyte *dbytes = elements (p->getData());
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
- memcpy (&u.address.sin_addr, bytes, len);
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (rport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (rport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (::sendto (fnum, (char *) dbytes, p->getLength(), 0, ptr, len) >= 0)
- return;
-
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-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());
- ssize_t retlen = 0;
-
-// FIXME: implement timeout support for Win32
-#ifndef WIN32
- // Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::io::InterruptedIOException ();
- }
-#endif /* WIN32 */
-
- retlen =
- ::recvfrom (fnum, (char *) dbytes, p->getLength(), 0, (sockaddr*) &u,
- &addrlen);
- if (retlen < 0)
- goto error;
- // FIXME: Deal with Multicast addressing and if the socket is connected.
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- p->setAddress (new InetAddress (raddr, NULL));
- p->setPort (rport);
- p->setLength ((jint) retlen);
- return;
-
- error:
- char* strerr = strerror (errno);
-
- if (errno == ECONNREFUSED)
- throw new PortUnreachableException (JvNewStringUTF (strerr));
-
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setTimeToLive (jint ttl)
-{
- // Assumes IPPROTO_IP rather than IPPROTO_IPV6 since socket created is IPv4.
- char val = (char) ttl;
- socklen_t val_len = sizeof(val);
-
- if (::setsockopt (fnum, IPPROTO_IP, IP_MULTICAST_TTL, &val, val_len) == 0)
- return;
-
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-jint
-java::net::PlainDatagramSocketImpl::getTimeToLive ()
-{
- // Assumes IPPROTO_IP rather than IPPROTO_IPV6 since socket created is IPv4.
- char val;
- socklen_t val_len = sizeof(val);
-
- if (::getsockopt (fnum, IPPROTO_IP, IP_MULTICAST_TTL, &val, &val_len) == 0)
- return ((int) val) & 0xFF;
-
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
- java::net::NetworkInterface *,
- jboolean join)
-{
- // FIXME: implement use of NetworkInterface
-
- union McastReq u;
- jbyteArray haddress = inetaddr->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- int level, opname;
- const char *ptr;
- if (0)
- ;
-#if HAVE_STRUCT_IP_MREQ
- else if (len == 4)
- {
- level = IPPROTO_IP;
- opname = join ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP;
- memcpy (&u.mreq.imr_multiaddr, bytes, len);
- // FIXME: If a non-default interface is set, use it; see Stevens p. 501.
- // Maybe not, see note in last paragraph at bottom of Stevens p. 497.
- u.mreq.imr_interface.s_addr = htonl (INADDR_ANY);
- len = sizeof (struct ip_mreq);
- ptr = (const char *) &u.mreq;
- }
-#endif
-#if HAVE_STRUCT_IPV6_MREQ
- else if (len == 16)
- {
- level = IPPROTO_IPV6;
-
- /* Prefer new RFC 2553 names. */
-#ifndef IPV6_JOIN_GROUP
-#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
-#endif
-#ifndef IPV6_LEAVE_GROUP
-#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
-#endif
-
- opname = join ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP;
- memcpy (&u.mreq6.ipv6mr_multiaddr, bytes, len);
- // FIXME: If a non-default interface is set, use it; see Stevens p. 501.
- // Maybe not, see note in last paragraph at bottom of Stevens p. 497.
- u.mreq6.ipv6mr_interface = 0;
- len = sizeof (struct ipv6_mreq);
- ptr = (const char *) &u.mreq6;
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (::setsockopt (fnum, level, opname, ptr, len) == 0)
- return;
-
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainDatagramSocketImpl::setOption (jint optID,
- java::lang::Object *value)
-{
- int val;
- socklen_t val_len = sizeof (val);
-
- if (fnum < 0)
- throw new java::net::SocketException (JvNewStringUTF ("Socket closed"));
-
- if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$))
- {
- java::lang::Boolean *boolobj =
- static_cast<java::lang::Boolean *> (value);
- val = boolobj->booleanValue() ? 1 : 0;
- }
- else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$))
- {
- java::lang::Integer *intobj =
- static_cast<java::lang::Integer *> (value);
- val = (int) intobj->intValue();
- }
- // Else assume value to be an InetAddress for use with IP_MULTICAST_IF.
-
- switch (optID)
- {
- case _Jv_TCP_NODELAY_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("TCP_NODELAY not valid for UDP"));
- return;
- case _Jv_SO_LINGER_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_LINGER not valid for UDP"));
- return;
- case _Jv_SO_KEEPALIVE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_KEEPALIVE not valid for UDP"));
- return;
-
- case _Jv_SO_BROADCAST_ :
- if (::setsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_OOBINLINE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_OOBINLINE: not valid for UDP"));
- break;
-
- case _Jv_SO_SNDBUF_ :
- case _Jv_SO_RCVBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::setsockopt (fnum, SOL_SOCKET, opt, (char *) &val, val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- return;
- case _Jv_SO_REUSEADDR_ :
-#if defined(SO_REUSEADDR)
- if (::setsockopt (fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &val,
- val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_REUSEADDR not supported"));
-#endif
- return;
- case _Jv_SO_BINDADDR_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_BINDADDR: read only option"));
- return;
- case _Jv_IP_MULTICAST_IF_ :
- union InAddr u;
- jbyteArray haddress;
- jbyte *bytes;
- int len;
- int level, opname;
- const char *ptr;
-
- haddress = ((java::net::InetAddress *) value)->addr;
- bytes = elements (haddress);
- len = haddress->length;
- if (len == 4)
- {
- level = IPPROTO_IP;
- opname = IP_MULTICAST_IF;
- memcpy (&u.addr, bytes, len);
- len = sizeof (struct in_addr);
- ptr = (const char *) &u.addr;
- }
-// Tru64 UNIX V5.0 has struct sockaddr_in6, but no IPV6_MULTICAST_IF
-#if defined (HAVE_INET6) && defined (IPV6_MULTICAST_IF)
- else if (len == 16)
- {
- level = IPPROTO_IPV6;
- opname = IPV6_MULTICAST_IF;
- memcpy (&u.addr6, bytes, len);
- len = sizeof (struct in6_addr);
- ptr = (const char *) &u.addr6;
- }
-#endif
- else
- throw
- new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (::setsockopt (fnum, level, opname, ptr, len) != 0)
- goto error;
- return;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF2: not yet implemented"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_LOOP: not yet implemented"));
- break;
-
- case _Jv_IP_TOS_ :
- if (::setsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- val_len) != 0)
- goto error;
- return;
-
- case _Jv_SO_TIMEOUT_ :
- timeout = val;
- return;
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
-
-java::lang::Object *
-java::net::PlainDatagramSocketImpl::getOption (jint optID)
-{
- int val;
- socklen_t val_len = sizeof(val);
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
-
- switch (optID)
- {
- case _Jv_TCP_NODELAY_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("TCP_NODELAY not valid for UDP"));
- break;
- case _Jv_SO_LINGER_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_LINGER not valid for UDP"));
- break;
- case _Jv_SO_KEEPALIVE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_KEEPALIVE not valid for UDP"));
- break;
-
- case _Jv_SO_BROADCAST_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean (val != 0);
-
- case _Jv_SO_OOBINLINE_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_OOBINLINE not valid for UDP"));
- break;
-
- case _Jv_SO_RCVBUF_ :
- case _Jv_SO_SNDBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::getsockopt (fnum, SOL_SOCKET, opt, (char *) &val, &val_len) != 0)
- goto error;
- else
- return new java::lang::Integer (val);
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- break;
- case _Jv_SO_BINDADDR_:
- // cache the local address
- if (localAddress == NULL)
- {
- jbyteArray laddr;
- if (::getsockname (fnum, (sockaddr*) &u, &addrlen) != 0)
- goto error;
- if (u.address.sin_family == AF_INET)
- {
- laddr = JvNewByteArray (4);
- memcpy (elements (laddr), &u.address.sin_addr, 4);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- laddr = JvNewByteArray (16);
- memcpy (elements (laddr), &u.address6.sin6_addr, 16);
- }
-#endif
- else
- throw new java::net::SocketException (
- JvNewStringUTF ("invalid family"));
- localAddress = new java::net::InetAddress (laddr, NULL);
- }
- return localAddress;
- break;
- case _Jv_SO_REUSEADDR_ :
-#if defined(SO_REUSEADDR)
- if (::getsockopt (fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean (val != 0);
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_REUSEADDR not supported"));
-#endif
- break;
- case _Jv_IP_MULTICAST_IF_ :
-#ifdef HAVE_INET_NTOA
- struct in_addr inaddr;
- socklen_t inaddr_len;
- char *bytes;
-
- inaddr_len = sizeof(inaddr);
- if (::getsockopt (fnum, IPPROTO_IP, IP_MULTICAST_IF, (char *) &inaddr,
- &inaddr_len) != 0)
- goto error;
-
- bytes = inet_ntoa (inaddr);
-
- return java::net::InetAddress::getByName (JvNewStringLatin1 (bytes));
-#else
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF: not available - no inet_ntoa()"));
-#endif
- break;
- case _Jv_SO_TIMEOUT_ :
- return new java::lang::Integer (timeout);
- break;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF2: not yet implemented"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- if (::getsockopt (fnum, SOL_SOCKET, IP_MULTICAST_LOOP, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean (val != 0);
-
- case _Jv_IP_TOS_ :
- if (::getsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Integer (val);
-
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
-
-#endif /* DISABLE_JAVA_NET */
diff --git a/libjava/java/net/natPlainSocketImplNoNet.cc b/libjava/java/net/natPlainSocketImplNoNet.cc
deleted file mode 100644
index e65438ef1d5..00000000000
--- a/libjava/java/net/natPlainSocketImplNoNet.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/* 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 <java/io/IOException.h>
-#include <java/net/BindException.h>
-#include <java/net/ConnectException.h>
-#include <java/net/PlainSocketImpl.h>
-#include <java/net/SocketException.h>
-
-void
-java::net::PlainSocketImpl::create (jboolean)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("SocketImpl.create: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::bind (java::net::InetAddress *, jint)
-{
- throw new BindException (
- JvNewStringLatin1 ("SocketImpl.bind: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::connect (java::net::SocketAddress *, jint)
-{
- throw new ConnectException (
- JvNewStringLatin1 ("SocketImpl.connect: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::listen (jint)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("SocketImpl.listen: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("SocketImpl.accept: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::setOption (jint, java::lang::Object *)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.setOption: unimplemented"));
-}
-
-java::lang::Object *
-java::net::PlainSocketImpl::getOption (jint)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.getOption: unimplemented"));
-}
-
-jint
-java::net::PlainSocketImpl::read(void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.read: unimplemented"));
-}
-
-jint
-java::net::PlainSocketImpl::read(jbyteArray buffer, jint offset, jint count)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.read: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::write(jint b)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.write: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::write(jbyteArray b, jint offset, jint len)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.write: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::sendUrgentData(jint data)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.sendUrgentData: unimplemented"));
-}
-
-jint
-java::net::PlainSocketImpl::available(void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.available: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::close(void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.close: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::shutdownInput (void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.shutdownInput: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::shutdownOutput (void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.shutdownOutput: unimplemented"));
-}
diff --git a/libjava/java/net/natPlainSocketImplPosix.cc b/libjava/java/net/natPlainSocketImplPosix.cc
deleted file mode 100644
index 65feac87324..00000000000
--- a/libjava/java/net/natPlainSocketImplPosix.cc
+++ /dev/null
@@ -1,856 +0,0 @@
-/* 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>
-
-#ifdef HAVE_SYS_IOCTL_H
-#define BSD_COMP /* Get FIONREAD on Solaris2. */
-#include <sys/ioctl.h>
-#endif
-
-// Pick up FIONREAD on Solaris 2.5.
-#ifdef HAVE_SYS_FILIO_H
-#include <sys/filio.h>
-#endif
-
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <errno.h>
-#include <string.h>
-
-#if HAVE_BSTRING_H
-// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
-#include <bstring.h>
-#endif
-
-#include <gcj/cni.h>
-#include <gcj/javaprims.h>
-#include <java/io/IOException.h>
-#include <java/io/InterruptedIOException.h>
-#include <java/net/BindException.h>
-#include <java/net/ConnectException.h>
-#include <java/net/PlainSocketImpl.h>
-#include <java/net/InetAddress.h>
-#include <java/net/InetSocketAddress.h>
-#include <java/net/SocketException.h>
-#include <java/net/SocketTimeoutException.h>
-#include <java/lang/InternalError.h>
-#include <java/lang/Object.h>
-#include <java/lang/Boolean.h>
-#include <java/lang/Class.h>
-#include <java/lang/Integer.h>
-#include <java/lang/Thread.h>
-#include <java/lang/NullPointerException.h>
-#include <java/lang/ArrayIndexOutOfBoundsException.h>
-#include <java/lang/IllegalArgumentException.h>
-
-union SockAddr
-{
- struct sockaddr_in address;
-#ifdef HAVE_INET6
- struct sockaddr_in6 address6;
-#endif
-};
-
-void
-java::net::PlainSocketImpl::create (jboolean stream)
-{
- int sock = _Jv_socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
-
- if (sock < 0)
- {
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
- }
-
- _Jv_platform_close_on_exec (sock);
-
- // We use fnum in place of fd here. From leaving fd null we avoid
- // the double close problem in FileDescriptor.finalize.
- fnum = sock;
-}
-
-void
-java::net::PlainSocketImpl::bind (java::net::InetAddress *host, jint lport)
-{
- union SockAddr u;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- jbyteArray haddress = host->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- int i = 1;
-
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
-
- if (host != NULL)
- memcpy (&u.address.sin_addr, bytes, len);
- else
- u.address.sin_addr.s_addr = htonl (INADDR_ANY);
-
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (lport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (lport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- // Enable SO_REUSEADDR, so that servers can reuse ports left in TIME_WAIT.
- ::setsockopt(fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof(i));
-
- if (_Jv_bind (fnum, ptr, len) == 0)
- {
- address = host;
- socklen_t addrlen = sizeof(u);
-
- if (lport != 0)
- localport = lport;
- else if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0)
- localport = ntohs (u.address.sin_port);
- else
- goto error;
-
- return;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::BindException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainSocketImpl::connect (java::net::SocketAddress *addr,
- jint timeout)
-{
- java::net::InetSocketAddress *tmp = (java::net::InetSocketAddress*) addr;
- java::net::InetAddress *host = tmp->getAddress();
- jint rport = tmp->getPort();
-
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- jbyteArray haddress = host->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
- memcpy (&u.address.sin_addr, bytes, len);
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (rport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (rport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- if (timeout > 0)
- {
- int flags = ::fcntl (fnum, F_GETFL);
- ::fcntl (fnum, F_SETFL, flags | O_NONBLOCK);
-
- if ((_Jv_connect (fnum, ptr, len) != 0) && (errno != EINPROGRESS))
- goto error;
-
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
-
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::net::SocketTimeoutException
- (JvNewStringUTF ("Connect timed out"));
- }
- else
- {
- if (_Jv_connect (fnum, ptr, len) != 0)
- goto error;
- }
-
- address = host;
- port = rport;
-
- // A bind may not have been done on this socket; if so, set localport now.
- if (localport == 0)
- {
- if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0)
- localport = ntohs (u.address.sin_port);
- else
- goto error;
- }
-
- return;
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::ConnectException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainSocketImpl::listen (jint backlog)
-{
- if (::listen (fnum, backlog) != 0)
- {
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
- }
-}
-
-void
-java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
-{
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- int new_socket = 0;
-
- // Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::io::InterruptedIOException (
- JvNewStringUTF("Accept timed out"));
- }
-
- new_socket = _Jv_accept (fnum, (sockaddr*) &u, &addrlen);
-
- if (new_socket < 0)
- goto error;
-
- _Jv_platform_close_on_exec (new_socket);
-
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- s->fnum = new_socket;
- s->localport = localport;
- s->address = new InetAddress (raddr, NULL);
- s->port = rport;
- return;
-
- error:
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-// Close(shutdown) the socket.
-void
-java::net::PlainSocketImpl::close()
-{
- // Avoid races from asynchronous finalization.
- JvSynchronize sync (this);
-
- // should we use shutdown here? how would that effect so_linger?
- int res = _Jv_close (fnum);
-
- if (res == -1)
- {
- // These three errors are not errors according to tests performed
- // on the reference implementation.
- if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- }
- // Safe place to reset the file pointer.
- fnum = -1;
- timeout = 0;
-}
-
-// Write a byte to the socket.
-void
-java::net::PlainSocketImpl::write(jint b)
-{
- jbyte d =(jbyte) b;
- int r = 0;
-
- while (r != 1)
- {
- r = _Jv_write (fnum, &d, 1);
- if (r == -1)
- {
- if (java::lang::Thread::interrupted())
- {
- java::io::InterruptedIOException *iioe
- = new java::io::InterruptedIOException
- (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = 0;
- throw iioe;
- }
- // Some errors should not cause exceptions.
- if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- break;
- }
- }
-}
-
-// Write some bytes to the socket.
-void
-java::net::PlainSocketImpl::write(jbyteArray b, jint offset, jint len)
-{
- if (! b)
- throw new java::lang::NullPointerException;
- if (offset < 0 || len < 0 || offset + len > JvGetArrayLength (b))
- throw new java::lang::ArrayIndexOutOfBoundsException;
-
- jbyte *bytes = elements (b) + offset;
- int written = 0;
-
- while (len > 0)
- {
- int r = _Jv_write (fnum, bytes, len);
-
- if (r == -1)
- {
- if (java::lang::Thread::interrupted())
- {
- java::io::InterruptedIOException *iioe
- = new java::io::InterruptedIOException
- (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = written;
- throw iioe;
- }
- // Some errors should not cause exceptions.
- if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- break;
- }
-
- written += r;
- len -= r;
- bytes += r;
- }
-}
-
-void
-java::net::PlainSocketImpl::sendUrgentData (jint)
-{
- throw new SocketException (JvNewStringLatin1 (
- "PlainSocketImpl: sending of urgent data not supported by this socket"));
-}
-
-// Read a single byte from the socket.
-jint
-java::net::PlainSocketImpl::read(void)
-{
- jbyte b;
-
- // Do timeouts via select.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- // Create the file descriptor set.
- fd_set read_fds;
- FD_ZERO (&read_fds);
- FD_SET (fnum,&read_fds);
- // Create the timeout struct based on our internal timeout value.
- struct timeval timeout_value;
- timeout_value.tv_sec = timeout / 1000;
- timeout_value.tv_usec = (timeout % 1000) * 1000;
- // Select on the fds.
- int sel_retval =
- _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value);
- // If select returns 0 we've waited without getting data...
- // that means we've timed out.
- if (sel_retval == 0)
- throw new java::io::InterruptedIOException
- (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.
- }
-
- int r = _Jv_read (fnum, &b, 1);
-
- if (r == 0)
- return -1;
-
- 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)
- {
- // Some errors cause us to return end of stream...
- if (errno == ENOTCONN)
- return -1;
-
- // Other errors need to be signalled.
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- }
-
- return b & 0xFF;
-}
-
-// Read count bytes into the buffer, starting at offset.
-jint
-java::net::PlainSocketImpl::read(jbyteArray buffer, jint offset, jint count)
-{
- if (! buffer)
- throw new java::lang::NullPointerException;
-
- jsize bsize = JvGetArrayLength (buffer);
-
- if (offset < 0 || count < 0 || offset + count > bsize)
- throw new java::lang::ArrayIndexOutOfBoundsException;
-
- jbyte *bytes = elements (buffer) + offset;
-
- // Do timeouts via select.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- // Create the file descriptor set.
- fd_set read_fds;
- FD_ZERO (&read_fds);
- FD_SET (fnum, &read_fds);
- // Create the timeout struct based on our internal timeout value.
- struct timeval timeout_value;
- timeout_value.tv_sec = timeout / 1000;
- timeout_value.tv_usec =(timeout % 1000) * 1000;
- // Select on the fds.
- int sel_retval =
- _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value);
- // We're only interested in the 0 return.
- // error returns still require us to try to read
- // the socket to see what happened.
- if (sel_retval == 0)
- {
- java::io::InterruptedIOException *iioe =
- new java::io::InterruptedIOException
- (JvNewStringUTF ("read interrupted"));
- iioe->bytesTransferred = 0;
- throw iioe;
- }
- }
-
- // Read the socket.
- int r = ::recv (fnum, (char *) bytes, count, 0);
-
- if (r == 0)
- return -1;
-
- 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)
- {
- // Some errors cause us to return end of stream...
- if (errno == ENOTCONN)
- return -1;
-
- // Other errors need to be signalled.
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- }
-
- return r;
-}
-
-// How many bytes are available?
-jint
-java::net::PlainSocketImpl::available(void)
-{
-#if defined(FIONREAD) || defined(HAVE_SELECT)
- long num = 0;
- int r = 0;
- bool num_set = false;
-
-#if defined(FIONREAD)
- r = ::ioctl (fnum, FIONREAD, &num);
-
- if (r == -1 && errno == ENOTTY)
- {
- // If the ioctl doesn't work, we don't care.
- r = 0;
- num = 0;
- }
- else
- num_set = true;
-#elif defined(HAVE_SELECT)
- if (fnum < 0)
- {
- errno = EBADF;
- r = -1;
- }
-#endif
-
- if (r == -1)
- {
- posix_error:
- throw new java::io::IOException(JvNewStringUTF(strerror(errno)));
- }
-
- // If we didn't get anything we can use select.
-
-#if defined(HAVE_SELECT)
- if (! num_set)
- if (! num_set && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rd;
- FD_ZERO (&rd);
- FD_SET (fnum, &rd);
- struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- r = _Jv_select (fnum + 1, &rd, NULL, NULL, &tv);
- if(r == -1)
- goto posix_error;
- num = r == 0 ? 0 : 1;
- }
-#endif /* HAVE_SELECT */
-
- return (jint) num;
-#else
- throw new java::io::IOException (JvNewStringUTF ("unimplemented"));
-#endif
-}
-
-void
-java::net::PlainSocketImpl::setOption (jint optID, java::lang::Object *value)
-{
- int val;
- socklen_t val_len = sizeof (val);
-
- if (fnum < 0)
- throw new java::net::SocketException (JvNewStringUTF ("Socket closed"));
-
- if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$))
- {
- java::lang::Boolean *boolobj =
- static_cast<java::lang::Boolean *> (value);
- if (boolobj->booleanValue())
- val = 1;
- else
- {
- if (optID == _Jv_SO_LINGER_)
- val = -1;
- else
- val = 0;
- }
- }
- else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$))
- {
- java::lang::Integer *intobj =
- static_cast<java::lang::Integer *> (value);
- val = (int) intobj->intValue();
- }
- else
- {
- throw new java::lang::IllegalArgumentException (
- JvNewStringLatin1 ("`value' must be Boolean or Integer"));
- }
-
- switch (optID)
- {
- case _Jv_TCP_NODELAY_ :
-#ifdef TCP_NODELAY
- if (::setsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val,
- val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("TCP_NODELAY not supported"));
-#endif /* TCP_NODELAY */
- return;
-
- case _Jv_SO_KEEPALIVE_ :
- if (::setsockopt (fnum, SOL_SOCKET, SO_KEEPALIVE, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_BROADCAST_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("SO_BROADCAST not valid for TCP"));
- break;
-
- case _Jv_SO_OOBINLINE_ :
- if (::setsockopt (fnum, SOL_SOCKET, SO_OOBINLINE, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_LINGER_ :
-#ifdef SO_LINGER
- struct linger l_val;
- l_val.l_onoff = (val != -1);
- l_val.l_linger = val;
-
- if (::setsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val,
- sizeof(l_val)) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_LINGER not supported"));
-#endif /* SO_LINGER */
- return;
-
- case _Jv_SO_SNDBUF_ :
- case _Jv_SO_RCVBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::setsockopt (fnum, SOL_SOCKET, opt, (char *) &val, val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- return;
-
- case _Jv_SO_BINDADDR_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_BINDADDR: read only option"));
- return;
-
- case _Jv_IP_MULTICAST_IF_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP"));
- return;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF2: not valid for TCP"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_LOOP: not valid for TCP"));
- break;
-
- case _Jv_IP_TOS_ :
- if (::setsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_REUSEADDR_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_REUSEADDR: not valid for TCP"));
- return;
-
- case _Jv_SO_TIMEOUT_ :
- timeout = val;
- return;
-
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
-
-java::lang::Object *
-java::net::PlainSocketImpl::getOption (jint optID)
-{
- int val;
- socklen_t val_len = sizeof(val);
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- struct linger l_val;
- socklen_t l_val_len = sizeof(l_val);
-
- switch (optID)
- {
-#ifdef TCP_NODELAY
- case _Jv_TCP_NODELAY_ :
- if (::getsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val,
- &val_len) != 0)
- goto error;
- else
- return new java::lang::Boolean (val != 0);
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("TCP_NODELAY not supported"));
-#endif
- break;
-
- case _Jv_SO_LINGER_ :
-#ifdef SO_LINGER
- if (::getsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val,
- &l_val_len) != 0)
- goto error;
-
- if (l_val.l_onoff)
- return new java::lang::Integer (l_val.l_linger);
- else
- return new java::lang::Boolean ((jboolean)false);
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("SO_LINGER not supported"));
-#endif
- break;
-
- case _Jv_SO_KEEPALIVE_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_KEEPALIVE, (char *) &val,
- &val_len) != 0)
- goto error;
- else
- return new java::lang::Boolean (val != 0);
-
- case _Jv_SO_BROADCAST_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean ((jboolean)val);
-
- case _Jv_SO_OOBINLINE_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_OOBINLINE, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean ((jboolean)val);
-
- case _Jv_SO_RCVBUF_ :
- case _Jv_SO_SNDBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::getsockopt (fnum, SOL_SOCKET, opt, (char *) &val, &val_len) != 0)
- goto error;
- else
- return new java::lang::Integer (val);
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- break;
- case _Jv_SO_BINDADDR_:
- // cache the local address
- if (localAddress == NULL)
- {
- jbyteArray laddr;
-
- if (::getsockname (fnum, (sockaddr*) &u, &addrlen) != 0)
- goto error;
-
- if (u.address.sin_family == AF_INET)
- {
- laddr = JvNewByteArray (4);
- memcpy (elements (laddr), &u.address.sin_addr, 4);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- laddr = JvNewByteArray (16);
- memcpy (elements (laddr), &u.address6.sin6_addr, 16);
- }
-#endif
- else
- throw new java::net::SocketException
- (JvNewStringUTF ("invalid family"));
- localAddress = new java::net::InetAddress (laddr, NULL);
- }
-
- return localAddress;
- break;
- case _Jv_IP_MULTICAST_IF_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP"));
- break;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("IP_MULTICAST_IF2: not valid for TCP"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("IP_MULTICAST_LOOP: not valid for TCP"));
- break;
-
- case _Jv_IP_TOS_ :
- if (::getsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Integer (val);
- break;
-
- case _Jv_SO_REUSEADDR_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("SO_REUSEADDR: not valid for TCP"));
- break;
-
- case _Jv_SO_TIMEOUT_ :
- return new java::lang::Integer (timeout);
- break;
-
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainSocketImpl::shutdownInput (void)
-{
- if (::shutdown (fnum, 0))
- throw new SocketException (JvNewStringUTF (strerror (errno)));
-}
-
-void
-java::net::PlainSocketImpl::shutdownOutput (void)
-{
- if (::shutdown (fnum, 1))
- throw new SocketException (JvNewStringUTF (strerror (errno)));
-}
diff --git a/libjava/java/net/natPlainSocketImplWin32.cc b/libjava/java/net/natPlainSocketImplWin32.cc
deleted file mode 100644
index 1485ea842f9..00000000000
--- a/libjava/java/net/natPlainSocketImplWin32.cc
+++ /dev/null
@@ -1,1019 +0,0 @@
-/* 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>
-
-#ifndef DISABLE_JAVA_NET
-
-#ifdef WIN32
-
-#include <windows.h>
-#include <winsock.h>
-#include <errno.h>
-#include <string.h>
-#undef STRICT
-#undef MAX_PRIORITY
-#undef MIN_PRIORITY
-#undef FIONREAD
-
-// These functions make the Win32 socket API look more POSIXy
-static inline int
-write(int s, void *buf, int len)
-{
- return send(s, (char*)buf, len, 0);
-}
-
-static inline int
-read(int s, void *buf, int len)
-{
- return recv(s, (char*)buf, len, 0);
-}
-
-// these errors cannot occur on Win32
-#else /* WIN32 */
-
-#ifdef HAVE_SYS_IOCTL_H
-#define BSD_COMP /* Get FIONREAD on Solaris2. */
-#include <sys/ioctl.h>
-#endif
-
-// Pick up FIONREAD on Solaris 2.5.
-#ifdef HAVE_SYS_FILIO_H
-#include <sys/filio.h>
-#endif
-
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <errno.h>
-#include <string.h>
-
-#endif /* WIN32 */
-#endif /* DISABLE_JAVA_NET */
-
-#if HAVE_BSTRING_H
-// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
-#include <bstring.h>
-#endif
-
-
-#include <gcj/cni.h>
-#include <gcj/javaprims.h>
-#include <java/io/IOException.h>
-#include <java/io/InterruptedIOException.h>
-#include <java/net/BindException.h>
-#include <java/net/ConnectException.h>
-#include <java/net/PlainSocketImpl.h>
-#include <java/net/InetAddress.h>
-#include <java/net/InetSocketAddress.h>
-#include <java/net/SocketException.h>
-#include <java/net/SocketTimeoutException.h>
-#include <java/lang/InternalError.h>
-#include <java/lang/Object.h>
-#include <java/lang/Boolean.h>
-#include <java/lang/Class.h>
-#include <java/lang/Integer.h>
-#include <java/lang/Thread.h>
-#include <java/lang/NullPointerException.h>
-#include <java/lang/ArrayIndexOutOfBoundsException.h>
-#include <java/lang/IllegalArgumentException.h>
-
-#ifdef DISABLE_JAVA_NET
-
-void
-java::net::PlainSocketImpl::create (jboolean)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("SocketImpl.create: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::bind (java::net::InetAddress *, jint)
-{
- throw new BindException (
- JvNewStringLatin1 ("SocketImpl.bind: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::connect (java::net::SocketAddress *, jint)
-{
- throw new ConnectException (
- JvNewStringLatin1 ("SocketImpl.connect: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::listen (jint)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("SocketImpl.listen: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *)
-{
- throw new java::io::IOException (
- JvNewStringLatin1 ("SocketImpl.accept: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::setOption (jint, java::lang::Object *)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.setOption: unimplemented"));
-}
-
-java::lang::Object *
-java::net::PlainSocketImpl::getOption (jint)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.getOption: unimplemented"));
-}
-
-jint
-java::net::PlainSocketImpl::read(void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.read: unimplemented"));
-}
-
-jint
-java::net::PlainSocketImpl::read(jbyteArray buffer, jint offset, jint count)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.read: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::write(jint b)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.write: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::write(jbyteArray b, jint offset, jint len)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.write: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::sendUrgentData(jint data)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.sendUrgentData: unimplemented"));
-}
-
-jint
-java::net::PlainSocketImpl::available(void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.available: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::close(void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.close: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::shutdownInput (void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.shutdownInput: unimplemented"));
-}
-
-void
-java::net::PlainSocketImpl::shutdownOutput (void)
-{
- throw new SocketException (
- JvNewStringLatin1 ("SocketImpl.shutdownOutput: unimplemented"));
-}
-
-#else /* DISABLE_JAVA_NET */
-
-union SockAddr
-{
- struct sockaddr_in address;
-#ifdef HAVE_INET6
- struct sockaddr_in6 address6;
-#endif
-};
-
-void
-java::net::PlainSocketImpl::create (jboolean stream)
-{
- int sock = _Jv_socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
-
- if (sock < 0)
- {
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
- }
-
- _Jv_platform_close_on_exec (sock);
-
- // We use fnum in place of fd here. From leaving fd null we avoid
- // the double close problem in FileDescriptor.finalize.
- fnum = sock;
-}
-
-void
-java::net::PlainSocketImpl::bind (java::net::InetAddress *host, jint lport)
-{
- union SockAddr u;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- jbyteArray haddress = host->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- int i = 1;
-
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
-
- if (host != NULL)
- memcpy (&u.address.sin_addr, bytes, len);
- else
- u.address.sin_addr.s_addr = htonl (INADDR_ANY);
-
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (lport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (lport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
- // Enable SO_REUSEADDR, so that servers can reuse ports left in TIME_WAIT.
- ::setsockopt(fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof(i));
-
- if (_Jv_bind (fnum, ptr, len) == 0)
- {
- address = host;
- socklen_t addrlen = sizeof(u);
-
- if (lport != 0)
- localport = lport;
- else if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0)
- localport = ntohs (u.address.sin_port);
- else
- goto error;
-
- return;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::BindException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainSocketImpl::connect (java::net::SocketAddress *addr,
- jint timeout)
-{
- java::net::InetSocketAddress *tmp = (java::net::InetSocketAddress*) addr;
- java::net::InetAddress *host = tmp->getAddress();
- jint rport = tmp->getPort();
-
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- jbyteArray haddress = host->addr;
- jbyte *bytes = elements (haddress);
- int len = haddress->length;
- struct sockaddr *ptr = (struct sockaddr *) &u.address;
- if (len == 4)
- {
- u.address.sin_family = AF_INET;
- memcpy (&u.address.sin_addr, bytes, len);
- len = sizeof (struct sockaddr_in);
- u.address.sin_port = htons (rport);
- }
-#ifdef HAVE_INET6
- else if (len == 16)
- {
- u.address6.sin6_family = AF_INET6;
- memcpy (&u.address6.sin6_addr, bytes, len);
- len = sizeof (struct sockaddr_in6);
- u.address6.sin6_port = htons (rport);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
-
-// FIXME: implement timeout support for Win32
-#ifndef WIN32
- if (timeout > 0)
- {
- int flags = ::fcntl (fnum, F_GETFL);
- ::fcntl (fnum, F_SETFL, flags | O_NONBLOCK);
-
- if ((_Jv_connect (fnum, ptr, len) != 0) && (errno != EINPROGRESS))
- goto error;
-
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
-
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::net::SocketTimeoutException
- (JvNewStringUTF ("Connect timed out"));
- }
- else
-#endif
- {
- if (_Jv_connect (fnum, ptr, len) != 0)
- goto error;
- }
-
- address = host;
- port = rport;
-
- // A bind may not have been done on this socket; if so, set localport now.
- if (localport == 0)
- {
- if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0)
- localport = ntohs (u.address.sin_port);
- else
- goto error;
- }
-
- return;
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::ConnectException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainSocketImpl::listen (jint backlog)
-{
- if (::listen (fnum, backlog) != 0)
- {
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
- }
-}
-
-void
-java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
-{
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- int new_socket = 0;
-
-// FIXME: implement timeout support for Win32
-#ifndef WIN32
- // Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rset;
- struct timeval tv;
- FD_ZERO(&rset);
- FD_SET(fnum, &rset);
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
- int retval;
- if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0)
- goto error;
- else if (retval == 0)
- throw new java::io::InterruptedIOException (
- JvNewStringUTF("Accept timed out"));
- }
-#endif /* WIN32 */
-
- new_socket = _Jv_accept (fnum, (sockaddr*) &u, &addrlen);
-
- if (new_socket < 0)
- goto error;
-
- _Jv_platform_close_on_exec (new_socket);
-
- jbyteArray raddr;
- jint rport;
- if (u.address.sin_family == AF_INET)
- {
- raddr = JvNewByteArray (4);
- memcpy (elements (raddr), &u.address.sin_addr, 4);
- rport = ntohs (u.address.sin_port);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- raddr = JvNewByteArray (16);
- memcpy (elements (raddr), &u.address6.sin6_addr, 16);
- rport = ntohs (u.address6.sin6_port);
- }
-#endif
- else
- throw new java::net::SocketException (JvNewStringUTF ("invalid family"));
-
- s->fnum = new_socket;
- s->localport = localport;
- s->address = new InetAddress (raddr, NULL);
- s->port = rport;
- return;
-
- error:
- char* strerr = strerror (errno);
- throw new java::io::IOException (JvNewStringUTF (strerr));
-}
-
-// Close(shutdown) the socket.
-void
-java::net::PlainSocketImpl::close()
-{
- // Avoid races from asynchronous finalization.
- JvSynchronize sync (this);
-
- // should we use shutdown here? how would that effect so_linger?
- int res = _Jv_close (fnum);
-
- if (res == -1)
- {
- // These three errors are not errors according to tests performed
- // on the reference implementation.
- if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- }
- // Safe place to reset the file pointer.
- fnum = -1;
- timeout = 0;
-}
-
-// Write a byte to the socket.
-void
-java::net::PlainSocketImpl::write(jint b)
-{
- jbyte d =(jbyte) b;
- int r = 0;
-
- while (r != 1)
- {
- r = _Jv_write (fnum, &d, 1);
- if (r == -1)
- {
- if (java::lang::Thread::interrupted())
- {
- java::io::InterruptedIOException *iioe
- = new java::io::InterruptedIOException
- (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = 0;
- throw iioe;
- }
- // Some errors should not cause exceptions.
- if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- break;
- }
- }
-}
-
-// Write some bytes to the socket.
-void
-java::net::PlainSocketImpl::write(jbyteArray b, jint offset, jint len)
-{
- if (! b)
- throw new java::lang::NullPointerException;
- if (offset < 0 || len < 0 || offset + len > JvGetArrayLength (b))
- throw new java::lang::ArrayIndexOutOfBoundsException;
-
- jbyte *bytes = elements (b) + offset;
- int written = 0;
-
- while (len > 0)
- {
- int r = _Jv_write (fnum, bytes, len);
-
- if (r == -1)
- {
- if (java::lang::Thread::interrupted())
- {
- java::io::InterruptedIOException *iioe
- = new java::io::InterruptedIOException
- (JvNewStringLatin1 (strerror (errno)));
- iioe->bytesTransferred = written;
- throw iioe;
- }
- // Some errors should not cause exceptions.
- if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF)
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- break;
- }
-
- written += r;
- len -= r;
- bytes += r;
- }
-}
-
-void
-java::net::PlainSocketImpl::sendUrgentData (jint)
-{
- throw new SocketException (JvNewStringLatin1 (
- "PlainSocketImpl: sending of urgent data not supported by this socket"));
-}
-
-// Read a single byte from the socket.
-jint
-java::net::PlainSocketImpl::read(void)
-{
- jbyte b;
-
-// FIXME: implement timeout support for Win32
-#ifndef WIN32
- // Do timeouts via select.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- // Create the file descriptor set.
- fd_set read_fds;
- FD_ZERO (&read_fds);
- FD_SET (fnum,&read_fds);
- // Create the timeout struct based on our internal timeout value.
- struct timeval timeout_value;
- timeout_value.tv_sec = timeout / 1000;
- timeout_value.tv_usec = (timeout % 1000) * 1000;
- // Select on the fds.
- int sel_retval =
- _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value);
- // If select returns 0 we've waited without getting data...
- // that means we've timed out.
- if (sel_retval == 0)
- throw new java::io::InterruptedIOException
- (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.
- }
-#endif /* WIN32 */
-
- int r = _Jv_read (fnum, &b, 1);
-
- if (r == 0)
- return -1;
-
- 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)
- {
- // Some errors cause us to return end of stream...
- if (errno == ENOTCONN)
- return -1;
-
- // Other errors need to be signalled.
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- }
-
- return b & 0xFF;
-}
-
-// Read count bytes into the buffer, starting at offset.
-jint
-java::net::PlainSocketImpl::read(jbyteArray buffer, jint offset, jint count)
-{
- if (! buffer)
- throw new java::lang::NullPointerException;
-
- jsize bsize = JvGetArrayLength (buffer);
-
- if (offset < 0 || count < 0 || offset + count > bsize)
- throw new java::lang::ArrayIndexOutOfBoundsException;
-
- jbyte *bytes = elements (buffer) + offset;
-
-// FIXME: implement timeout support for Win32
-#ifndef WIN32
- // Do timeouts via select.
- if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
- {
- // Create the file descriptor set.
- fd_set read_fds;
- FD_ZERO (&read_fds);
- FD_SET (fnum, &read_fds);
- // Create the timeout struct based on our internal timeout value.
- struct timeval timeout_value;
- timeout_value.tv_sec = timeout / 1000;
- timeout_value.tv_usec =(timeout % 1000) * 1000;
- // Select on the fds.
- int sel_retval =
- _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value);
- // We're only interested in the 0 return.
- // error returns still require us to try to read
- // the socket to see what happened.
- if (sel_retval == 0)
- {
- java::io::InterruptedIOException *iioe =
- new java::io::InterruptedIOException
- (JvNewStringUTF ("read interrupted"));
- iioe->bytesTransferred = 0;
- throw iioe;
- }
- }
-#endif
-
- // Read the socket.
- int r = ::recv (fnum, (char *) bytes, count, 0);
-
- if (r == 0)
- return -1;
-
- 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)
- {
- // Some errors cause us to return end of stream...
- if (errno == ENOTCONN)
- return -1;
-
- // Other errors need to be signalled.
- throw new java::io::IOException (JvNewStringUTF (strerror (errno)));
- }
-
- return r;
-}
-
-// How many bytes are available?
-jint
-java::net::PlainSocketImpl::available(void)
-{
-#if defined(FIONREAD) || defined(HAVE_SELECT)
- long num = 0;
- int r = 0;
- bool num_set = false;
-
-#if defined(FIONREAD)
- r = ::ioctl (fnum, FIONREAD, &num);
-
- if (r == -1 && errno == ENOTTY)
- {
- // If the ioctl doesn't work, we don't care.
- r = 0;
- num = 0;
- }
- else
- num_set = true;
-#elif defined(HAVE_SELECT)
- if (fnum < 0)
- {
- errno = EBADF;
- r = -1;
- }
-#endif
-
- if (r == -1)
- {
- posix_error:
- throw new java::io::IOException(JvNewStringUTF(strerror(errno)));
- }
-
- // If we didn't get anything we can use select.
-
-#if defined(HAVE_SELECT)
- if (! num_set)
- if (! num_set && fnum >= 0 && fnum < FD_SETSIZE)
- {
- fd_set rd;
- FD_ZERO (&rd);
- FD_SET (fnum, &rd);
- struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- r = _Jv_select (fnum + 1, &rd, NULL, NULL, &tv);
- if(r == -1)
- goto posix_error;
- num = r == 0 ? 0 : 1;
- }
-#endif /* HAVE_SELECT */
-
- return (jint) num;
-#else
- throw new java::io::IOException (JvNewStringUTF ("unimplemented"));
-#endif
-}
-
-void
-java::net::PlainSocketImpl::setOption (jint optID, java::lang::Object *value)
-{
- int val;
- socklen_t val_len = sizeof (val);
-
- if (fnum < 0)
- throw new java::net::SocketException (JvNewStringUTF ("Socket closed"));
-
- if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$))
- {
- java::lang::Boolean *boolobj =
- static_cast<java::lang::Boolean *> (value);
- if (boolobj->booleanValue())
- val = 1;
- else
- {
- if (optID == _Jv_SO_LINGER_)
- val = -1;
- else
- val = 0;
- }
- }
- else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$))
- {
- java::lang::Integer *intobj =
- static_cast<java::lang::Integer *> (value);
- val = (int) intobj->intValue();
- }
- else
- {
- throw new java::lang::IllegalArgumentException (
- JvNewStringLatin1 ("`value' must be Boolean or Integer"));
- }
-
- switch (optID)
- {
- case _Jv_TCP_NODELAY_ :
-#ifdef TCP_NODELAY
- if (::setsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val,
- val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("TCP_NODELAY not supported"));
-#endif /* TCP_NODELAY */
- return;
-
- case _Jv_SO_KEEPALIVE_ :
- if (::setsockopt (fnum, SOL_SOCKET, SO_KEEPALIVE, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_BROADCAST_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("SO_BROADCAST not valid for TCP"));
- break;
-
- case _Jv_SO_OOBINLINE_ :
- if (::setsockopt (fnum, SOL_SOCKET, SO_OOBINLINE, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_LINGER_ :
-#ifdef SO_LINGER
- struct linger l_val;
- l_val.l_onoff = (val != -1);
- l_val.l_linger = val;
-
- if (::setsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val,
- sizeof(l_val)) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_LINGER not supported"));
-#endif /* SO_LINGER */
- return;
-
- case _Jv_SO_SNDBUF_ :
- case _Jv_SO_RCVBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::setsockopt (fnum, SOL_SOCKET, opt, (char *) &val, val_len) != 0)
- goto error;
-#else
- throw new java::lang::InternalError (
- JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- return;
-
- case _Jv_SO_BINDADDR_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_BINDADDR: read only option"));
- return;
-
- case _Jv_IP_MULTICAST_IF_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP"));
- return;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_IF2: not valid for TCP"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("IP_MULTICAST_LOOP: not valid for TCP"));
- break;
-
- case _Jv_IP_TOS_ :
- if (::setsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- val_len) != 0)
- goto error;
- break;
-
- case _Jv_SO_REUSEADDR_ :
- throw new java::net::SocketException (
- JvNewStringUTF ("SO_REUSEADDR: not valid for TCP"));
- return;
-
- case _Jv_SO_TIMEOUT_ :
- timeout = val;
- return;
-
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
-
-java::lang::Object *
-java::net::PlainSocketImpl::getOption (jint optID)
-{
- int val;
- socklen_t val_len = sizeof(val);
- union SockAddr u;
- socklen_t addrlen = sizeof(u);
- struct linger l_val;
- socklen_t l_val_len = sizeof(l_val);
-
- switch (optID)
- {
-#ifdef TCP_NODELAY
- case _Jv_TCP_NODELAY_ :
- if (::getsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val,
- &val_len) != 0)
- goto error;
- else
- return new java::lang::Boolean (val != 0);
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("TCP_NODELAY not supported"));
-#endif
- break;
-
- case _Jv_SO_LINGER_ :
-#ifdef SO_LINGER
- if (::getsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val,
- &l_val_len) != 0)
- goto error;
-
- if (l_val.l_onoff)
- return new java::lang::Integer (l_val.l_linger);
- else
- return new java::lang::Boolean ((jboolean)false);
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("SO_LINGER not supported"));
-#endif
- break;
-
- case _Jv_SO_KEEPALIVE_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_KEEPALIVE, (char *) &val,
- &val_len) != 0)
- goto error;
- else
- return new java::lang::Boolean (val != 0);
-
- case _Jv_SO_BROADCAST_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean ((jboolean)val);
-
- case _Jv_SO_OOBINLINE_ :
- if (::getsockopt (fnum, SOL_SOCKET, SO_OOBINLINE, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Boolean ((jboolean)val);
-
- case _Jv_SO_RCVBUF_ :
- case _Jv_SO_SNDBUF_ :
-#if defined(SO_SNDBUF) && defined(SO_RCVBUF)
- int opt;
- optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF;
- if (::getsockopt (fnum, SOL_SOCKET, opt, (char *) &val, &val_len) != 0)
- goto error;
- else
- return new java::lang::Integer (val);
-#else
- throw new java::lang::InternalError
- (JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported"));
-#endif
- break;
- case _Jv_SO_BINDADDR_:
- // cache the local address
- if (localAddress == NULL)
- {
- jbyteArray laddr;
-
- if (::getsockname (fnum, (sockaddr*) &u, &addrlen) != 0)
- goto error;
-
- if (u.address.sin_family == AF_INET)
- {
- laddr = JvNewByteArray (4);
- memcpy (elements (laddr), &u.address.sin_addr, 4);
- }
-#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
- {
- laddr = JvNewByteArray (16);
- memcpy (elements (laddr), &u.address6.sin6_addr, 16);
- }
-#endif
- else
- throw new java::net::SocketException
- (JvNewStringUTF ("invalid family"));
- localAddress = new java::net::InetAddress (laddr, NULL);
- }
-
- return localAddress;
- break;
- case _Jv_IP_MULTICAST_IF_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP"));
- break;
-
- case _Jv_IP_MULTICAST_IF2_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("IP_MULTICAST_IF2: not valid for TCP"));
- break;
-
- case _Jv_IP_MULTICAST_LOOP_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("IP_MULTICAST_LOOP: not valid for TCP"));
- break;
-
- case _Jv_IP_TOS_ :
- if (::getsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val,
- &val_len) != 0)
- goto error;
- return new java::lang::Integer (val);
- break;
-
- case _Jv_SO_REUSEADDR_ :
- throw new java::net::SocketException
- (JvNewStringUTF ("SO_REUSEADDR: not valid for TCP"));
- break;
-
- case _Jv_SO_TIMEOUT_ :
- return new java::lang::Integer (timeout);
- break;
-
- default :
- errno = ENOPROTOOPT;
- }
-
- error:
- char* strerr = strerror (errno);
- throw new java::net::SocketException (JvNewStringUTF (strerr));
-}
-
-void
-java::net::PlainSocketImpl::shutdownInput (void)
-{
- if (::shutdown (fnum, 0))
- throw new SocketException (JvNewStringUTF (strerror (errno)));
-}
-
-void
-java::net::PlainSocketImpl::shutdownOutput (void)
-{
- if (::shutdown (fnum, 1))
- throw new SocketException (JvNewStringUTF (strerror (errno)));
-}
-
-#endif /* DISABLE_JAVA_NET */
diff --git a/libjava/java/nio/ByteBufferImpl.java b/libjava/java/nio/ByteBufferImpl.java
index 37db881fa4c..7ea3a3a0e6d 100644
--- a/libjava/java/nio/ByteBufferImpl.java
+++ b/libjava/java/nio/ByteBufferImpl.java
@@ -182,13 +182,20 @@ final class ByteBufferImpl extends ByteBuffer
final public char getChar ()
{
- // FIXME: this handles big endian only
- return (char) (((get () & 0xff) << 8) + (get () & 0xff));
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
+ return (char) (((get () & 0xff) << 8)
+ + (get () & 0xff));
}
final public ByteBuffer putChar (char value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -196,13 +203,18 @@ final class ByteBufferImpl extends ByteBuffer
final public char getChar (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (char) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
}
final public ByteBuffer putChar (int index, char value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -210,13 +222,19 @@ final class ByteBufferImpl extends ByteBuffer
final public short getShort ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (short) (((get () & 0xff) << 8) + (get () & 0xff));
}
final public ByteBuffer putShort (short value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -224,13 +242,19 @@ final class ByteBufferImpl extends ByteBuffer
final public short getShort (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (short) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
}
final public ByteBuffer putShort (int index, short value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 2)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -238,58 +262,76 @@ final class ByteBufferImpl extends ByteBuffer
final public int getInt ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (int) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putInt (int value)
{
- // FIXME: this handles big endian only
- put ((byte) ((((int) value) & 0xff000000) >> 24));
- put ((byte) ((((int) value) & 0x00ff0000) >> 16));
- put ((byte) ((((int) value) & 0x0000ff00) >> 8));
- put ((byte) (((int) value) & 0x000000ff));
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
+ put ((byte) ((value & 0xff000000) >> 24));
+ put ((byte) ((value & 0x00ff0000) >> 16));
+ put ((byte) ((value & 0x0000ff00) >> 8));
+ put ((byte) (value & 0x000000ff));
return this;
}
final public int getInt (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (int) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putInt (int index, int value)
{
- // FIXME: this handles big endian only
- put (index, (byte) ((((int) value) & 0xff000000) >> 24));
- put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
- put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
- put (index + 3, (byte) (((int) value) & 0x000000ff));
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
+ put (index, (byte) ((value & 0xff000000) >> 24));
+ put (index + 1, (byte) ((value & 0x00ff0000) >> 16));
+ put (index + 2, (byte) ((value & 0x0000ff00) >> 8));
+ put (index + 3, (byte) (value & 0x000000ff));
return this;
}
final public long getLong ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (long) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putLong (long value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((value & 0xff00000000000000L) >> 56));
put ((byte) ((value & 0x00ff000000000000L) >> 48));
put ((byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -303,20 +345,26 @@ final class ByteBufferImpl extends ByteBuffer
final public long getLong (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (long) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putLong (int index, long value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((value & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((value & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -330,16 +378,22 @@ final class ByteBufferImpl extends ByteBuffer
final public float getFloat ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (float) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putFloat (float value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff000000) >> 24));
put ((byte) ((((int) value) & 0x00ff0000) >> 16));
put ((byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -349,16 +403,22 @@ final class ByteBufferImpl extends ByteBuffer
final public float getFloat (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (float) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putFloat (int index, float value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 4)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff000000) >> 24));
put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -368,20 +428,26 @@ final class ByteBufferImpl extends ByteBuffer
final public double getDouble ()
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (double) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putDouble (double value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put ((byte) ((((long) value) & 0xff00000000000000L) >> 56));
put ((byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put ((byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
@@ -395,20 +461,26 @@ final class ByteBufferImpl extends ByteBuffer
final public double getDouble (int index)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferUnderflowException();
+
+ // FIXME: this handles little endian only
return (double) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putDouble (int index, double value)
{
- // FIXME: this handles big endian only
+ if (remaining() < 8)
+ throw new BufferOverflowException();
+
+ // FIXME: this handles little endian only
put (index, (byte) ((((long) value) & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
diff --git a/libjava/java/nio/DirectByteBufferImpl.java b/libjava/java/nio/DirectByteBufferImpl.java
index 352016372f7..cdeafef6dfd 100644
--- a/libjava/java/nio/DirectByteBufferImpl.java
+++ b/libjava/java/nio/DirectByteBufferImpl.java
@@ -181,13 +181,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public char getChar ()
{
- // FIXME: this handles big endian only
- return (char) (((get () & 0xff) << 8) + (get () & 0xff));
+ // FIXME: this handles little endian only
+ return (char) (((get () & 0xff) << 8)
+ + (get () & 0xff));
}
final public ByteBuffer putChar (char value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -195,13 +196,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public char getChar (int index)
{
- // FIXME: this handles big endian only
- return (char) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
+ // FIXME: this handles little endian only
+ return (char) (((get (index) & 0xff) << 8)
+ + (get (index + 1) & 0xff));
}
final public ByteBuffer putChar (int index, char value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -209,13 +211,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public short getShort ()
{
- // FIXME: this handles big endian only
- return (short) (((get () & 0xff) << 8) + (get () & 0xff));
+ // FIXME: this handles little endian only
+ return (short) (((get () & 0xff) << 8)
+ + (get () & 0xff));
}
final public ByteBuffer putShort (short value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff00) >> 8));
put ((byte) (((int) value) & 0x00ff));
return this;
@@ -223,13 +226,14 @@ class DirectByteBufferImpl extends ByteBuffer
final public short getShort (int index)
{
- // FIXME: this handles big endian only
- return (short) (((get (index) & 0xff) << 8) + (get (index + 1) & 0xff));
+ // FIXME: this handles little endian only
+ return (short) (((get (index) & 0xff) << 8)
+ + (get (index + 1) & 0xff));
}
final public ByteBuffer putShort (int index, short value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff00) >> 8));
put (index + 1, (byte) (((int) value) & 0x00ff));
return this;
@@ -237,16 +241,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public int getInt ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (int) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putInt (int value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff000000) >> 24));
put ((byte) ((((int) value) & 0x00ff0000) >> 16));
put ((byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -256,16 +260,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public int getInt (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (int) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putInt (int index, int value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff000000) >> 24));
put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -275,20 +279,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public long getLong ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (long) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putLong (long value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((value & 0xff00000000000000L) >> 56));
put ((byte) ((value & 0x00ff000000000000L) >> 48));
put ((byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -302,20 +306,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public long getLong (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (long) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putLong (int index, long value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((value & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((value & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((value & 0x0000ff0000000000L) >> 40));
@@ -329,16 +333,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public float getFloat ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (float) (((get () & 0xff) << 24)
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putFloat (float value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((int) value) & 0xff000000) >> 24));
put ((byte) ((((int) value) & 0x00ff0000) >> 16));
put ((byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -348,16 +352,16 @@ class DirectByteBufferImpl extends ByteBuffer
final public float getFloat (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (float) (((get (index) & 0xff) << 24)
- + (get (index + 1) & 0xff) << 16
- + (get (index + 2) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 16)
+ + ((get (index + 2) & 0xff) << 8)
+ (get (index + 3) & 0xff));
}
final public ByteBuffer putFloat (int index, float value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((int) value) & 0xff000000) >> 24));
put (index + 1, (byte) ((((int) value) & 0x00ff0000) >> 16));
put (index + 2, (byte) ((((int) value) & 0x0000ff00) >> 8));
@@ -367,20 +371,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public double getDouble ()
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (double) (((get () & 0xff) << 56)
- + (get () & 0xff) << 48
- + (get () & 0xff) << 40
- + (get () & 0xff) << 32
- + (get () & 0xff) << 24
- + (get () & 0xff) << 16
- + (get () & 0xff) << 8
+ + ((get () & 0xff) << 48)
+ + ((get () & 0xff) << 40)
+ + ((get () & 0xff) << 32)
+ + ((get () & 0xff) << 24)
+ + ((get () & 0xff) << 16)
+ + ((get () & 0xff) << 8)
+ (get () & 0xff));
}
final public ByteBuffer putDouble (double value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put ((byte) ((((long) value) & 0xff00000000000000L) >> 56));
put ((byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put ((byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
@@ -394,20 +398,20 @@ class DirectByteBufferImpl extends ByteBuffer
final public double getDouble (int index)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
return (double) (((get (index) & 0xff) << 56)
- + (get (index + 1) & 0xff) << 48
- + (get (index + 2) & 0xff) << 40
- + (get (index + 3) & 0xff) << 32
- + (get (index + 4) & 0xff) << 24
- + (get (index + 5) & 0xff) << 16
- + (get (index + 6) & 0xff) << 8
+ + ((get (index + 1) & 0xff) << 48)
+ + ((get (index + 2) & 0xff) << 40)
+ + ((get (index + 3) & 0xff) << 32)
+ + ((get (index + 4) & 0xff) << 24)
+ + ((get (index + 5) & 0xff) << 16)
+ + ((get (index + 6) & 0xff) << 8)
+ (get (index + 7) & 0xff));
}
final public ByteBuffer putDouble (int index, double value)
{
- // FIXME: this handles big endian only
+ // FIXME: this handles little endian only
put (index, (byte) ((((long) value) & 0xff00000000000000L) >> 56));
put (index + 1, (byte) ((((long) value) & 0x00ff000000000000L) >> 48));
put (index + 2, (byte) ((((long) value) & 0x0000ff0000000000L) >> 40));
diff --git a/libjava/java/nio/MappedByteBufferImpl.java b/libjava/java/nio/MappedByteBufferImpl.java
index 422794872b7..c5b460e4900 100644
--- a/libjava/java/nio/MappedByteBufferImpl.java
+++ b/libjava/java/nio/MappedByteBufferImpl.java
@@ -38,8 +38,8 @@ exception statement from your version. */
package java.nio;
-import gnu.java.nio.FileChannelImpl;
import java.io.IOException;
+import java.nio.channels.FileChannelImpl;
import gnu.gcj.RawData;
public class MappedByteBufferImpl extends MappedByteBuffer
@@ -102,7 +102,16 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer compact ()
{
- throw new Error ("Not implemented");
+ int copied = 0;
+
+ while (remaining () > 0)
+ {
+ put (copied, get ());
+ copied++;
+ }
+
+ position (copied);
+ return this;
}
public boolean isDirect ()
@@ -157,7 +166,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public char getChar ()
{
- throw new Error ("Not implemented");
+ char value = getChar (position());
+ position (position() + 2);
+ return value;
}
public char getChar (int index)
@@ -167,7 +178,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putChar (char value)
{
- throw new Error ("Not implemented");
+ putChar (position(), value);
+ position (position() + 2);
+ return this;
}
public ByteBuffer putChar (int index, char value)
@@ -177,7 +190,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public double getDouble ()
{
- throw new Error ("Not implemented");
+ double value = getDouble (position());
+ position (position() + 8);
+ return value;
}
public double getDouble (int index)
@@ -187,7 +202,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putDouble (double value)
{
- throw new Error ("Not implemented");
+ putDouble (position(), value);
+ position (position() + 8);
+ return this;
}
public ByteBuffer putDouble (int index, double value)
@@ -197,7 +214,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public float getFloat ()
{
- throw new Error ("Not implemented");
+ float value = getFloat (position ());
+ position (position() + 4);
+ return value;
}
public float getFloat (int index)
@@ -207,7 +226,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putFloat (float value)
{
- throw new Error ("Not implemented");
+ putFloat (position(), value);
+ position (position() + 4);
+ return this;
}
public ByteBuffer putFloat (int index, float value)
@@ -217,7 +238,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public int getInt ()
{
- throw new Error ("Not implemented");
+ int value = getInt (position());
+ position (position() + 8);
+ return value;
}
public int getInt (int index)
@@ -227,7 +250,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putInt (int value)
{
- throw new Error ("Not implemented");
+ putInt (position(), value);
+ position (position() + 4);
+ return this;
}
public ByteBuffer putInt (int index, int value)
@@ -237,7 +262,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public long getLong ()
{
- throw new Error ("Not implemented");
+ long value = getLong (position());
+ position (position() + 8);
+ return value;
}
public long getLong (int index)
@@ -247,7 +274,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putLong (long value)
{
- throw new Error ("Not implemented");
+ putLong (position(), value);
+ position (position() + 8);
+ return this;
}
public ByteBuffer putLong (int index, long value)
@@ -257,7 +286,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public short getShort ()
{
- throw new Error ("Not implemented");
+ short value = getShort (position());
+ position (position() + 2);
+ return value;
}
public short getShort (int index)
@@ -267,7 +298,9 @@ public class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer putShort (short value)
{
- throw new Error ("Not implemented");
+ putShort (position(), value);
+ position (position() + 2);
+ return this;
}
public ByteBuffer putShort (int index, short value)
diff --git a/libjava/java/nio/channels/FileChannelImpl.java b/libjava/java/nio/channels/FileChannelImpl.java
new file mode 100644
index 00000000000..85113a0287b
--- /dev/null
+++ b/libjava/java/nio/channels/FileChannelImpl.java
@@ -0,0 +1,396 @@
+/* FileChannelImpl.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.nio.channels;
+
+import java.io.EOFException;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.ByteBuffer;
+import java.nio.MappedByteBuffer;
+import java.nio.MappedByteBufferImpl;
+import gnu.gcj.RawData;
+
+/**
+ * This file is not user visible !
+ * But alas, Java does not have a concept of friendly packages
+ * so this class is public.
+ * Instances of this class are created by invoking getChannel
+ * Upon a Input/Output/RandomAccessFile object.
+ */
+
+public class FileChannelImpl extends FileChannel
+{
+ public RawData map_address;
+
+ int length;
+ FileDescriptor fd;
+ MappedByteBuffer buf;
+ Object file_obj; // just to keep it live...
+
+ public FileChannelImpl (FileDescriptor fd, boolean write, Object obj)
+ {
+ if (!(obj instanceof RandomAccessFile)
+ && !(obj instanceof FileInputStream)
+ && !(obj instanceof FileOutputStream))
+ throw new InternalError ();
+
+ this.fd = fd;
+ this.file_obj = obj;
+ }
+
+ public FileChannelImpl ()
+ {
+ this (new FileDescriptor (), true, null);
+ }
+
+ private native long implPosition ();
+ private native FileChannel implPosition (long newPosition);
+ private native FileChannel implTruncate (long size);
+
+ private native RawData nio_mmap_file (long pos, long size, int mode);
+ private native void nio_unmmap_file (RawData map_address, int size);
+ private native void nio_msync (RawData map_address, int length);
+
+ public native long size () throws IOException;
+
+ protected void implCloseChannel() throws IOException
+ {
+ if (map_address != null)
+ {
+ nio_unmmap_file (map_address, (int) length);
+ map_address = null;
+ }
+
+ if (file_obj instanceof RandomAccessFile)
+ {
+ RandomAccessFile o = (RandomAccessFile) file_obj;
+ o.close();
+ }
+ else if (file_obj instanceof FileInputStream)
+ {
+ FileInputStream o = (FileInputStream) file_obj;
+ o.close();
+ }
+ else if (file_obj instanceof FileOutputStream)
+ {
+ FileOutputStream o = (FileOutputStream) file_obj;
+ o.close();
+ }
+ }
+
+ public int read (ByteBuffer dst) throws IOException
+ {
+ // Check if file is mapped into memory.
+ if (buf != null)
+ {
+ // FIXME: implement this
+ throw new Error ("Accessing mapped buffers not implemented.");
+ }
+
+ // File not mapped, access it directly.
+ return implRead (dst);
+ }
+
+ public int read (ByteBuffer dst, long position)
+ throws IOException
+ {
+ if (position < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if (file_obj instanceof FileOutputStream)
+ throw new NonReadableChannelException ();
+
+ int result;
+ long oldPosition;
+
+ oldPosition = implPosition ();
+ position (position);
+ result = implRead (dst);
+ implPosition (oldPosition);
+
+ return result;
+ }
+
+ private int implRead (ByteBuffer dst) throws IOException
+ {
+ int result;
+ byte[] buffer = new byte [dst.remaining ()];
+
+ result = implRead (buffer, 0, buffer.length);
+ dst.put (buffer, 0, result);
+
+ return result;
+ }
+
+ private native int implRead (byte[] buffer, int offset, int length)
+ throws IOException;
+
+ public long read (ByteBuffer[] dsts, int offset, int length)
+ throws IOException
+ {
+ long result = 0;
+
+ for (int i = offset; i < offset + length; i++)
+ {
+ result += read (dsts [i]);
+ }
+
+ return result;
+ }
+
+ public int write (ByteBuffer src) throws IOException
+ {
+ // Check if file is mapped into memory.
+ if (buf != null)
+ {
+ // FIXME: implement this
+ throw new Error ("Accessing mapped buffers not implemented.");
+ }
+
+ // File not mapped, access it directly.
+ return implWrite (src);
+ }
+
+ public int write (ByteBuffer src, long position)
+ throws IOException
+ {
+ if (position < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if (file_obj instanceof FileInputStream)
+ throw new NonWritableChannelException ();
+
+ int result;
+ long oldPosition;
+
+ oldPosition = implPosition ();
+ position (position);
+ result = implWrite (src);
+ implPosition (oldPosition);
+
+ return result;
+ }
+
+ private int implWrite (ByteBuffer src) throws IOException
+ {
+ byte[] buffer = new byte [src.remaining ()];
+
+ src.get (buffer, 0, buffer.length);
+ return implWrite (buffer, 0, buffer.length);
+ }
+
+ private native int implWrite (byte[] buffer, int offset, int length)
+ throws IOException;
+
+ public long write(ByteBuffer[] srcs, int offset, int length)
+ throws IOException
+ {
+ long result = 0;
+
+ for (int i = offset;i < offset + length;i++)
+ {
+ result += write (srcs[i]);
+ }
+
+ return result;
+ }
+
+ public MappedByteBuffer map (FileChannel.MapMode mode, long position,
+ long size)
+ throws IOException
+ {
+ if ((mode != MapMode.READ_ONLY
+ && mode != MapMode.READ_WRITE
+ && mode != MapMode.PRIVATE)
+ || position < 0
+ || size < 0
+ || size > Integer.MAX_VALUE)
+ throw new IllegalArgumentException ();
+
+ // FIXME: Make this working.
+ int cmode = mode.m;
+ map_address = nio_mmap_file (position, size, cmode);
+ length = (int) size;
+ buf = new MappedByteBufferImpl (this);
+ return buf;
+ }
+
+ static MappedByteBuffer create_direct_mapped_buffer (RawData map_address,
+ long length)
+ throws IOException
+ {
+ FileChannelImpl ch = new FileChannelImpl ();
+ ch.map_address = map_address;
+ ch.length = (int) length;
+ ch.buf = new MappedByteBufferImpl (ch);
+ return ch.buf;
+ }
+
+ /**
+ * msync with the disk
+ */
+ public void force (boolean metaData) throws IOException
+ {
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME: What to do with metaData ?
+
+ nio_msync (map_address, length);
+ }
+
+ public long transferTo (long position, long count, WritableByteChannel target)
+ throws IOException
+ {
+ if (position < 0
+ || count < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if (file_obj instanceof FileOutputStream)
+ throw new NonReadableChannelException ();
+
+ // XXX: count needs to be casted from long to int. Dataloss ?
+ ByteBuffer buffer = ByteBuffer.allocate ((int) count);
+ read (buffer, position);
+ buffer.flip();
+ return target.write (buffer);
+ }
+
+ public long transferFrom (ReadableByteChannel src, long position, long count)
+ throws IOException
+ {
+ if (position < 0
+ || count < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if (file_obj instanceof FileInputStream)
+ throw new NonWritableChannelException ();
+
+ // XXX: count needs to be casted from long to int. Dataloss ?
+ ByteBuffer buffer = ByteBuffer.allocate ((int) count);
+ src.read (buffer);
+ buffer.flip();
+ return write (buffer, position);
+ }
+
+ public FileLock lock (long position, long size, boolean shared)
+ throws IOException
+ {
+ if (position < 0
+ || size < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if (shared &&
+ file_obj instanceof FileOutputStream)
+ throw new NonReadableChannelException ();
+
+ if (!shared &&
+ file_obj instanceof FileInputStream)
+ throw new NonWritableChannelException ();
+
+ throw new Error ("Not implemented");
+ }
+
+ public FileLock tryLock (long position, long size, boolean shared)
+ throws IOException
+ {
+ if (position < 0
+ || size < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ throw new Error ("Not implemented");
+ }
+
+ public long position ()
+ throws IOException
+ {
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ return implPosition ();
+ }
+
+ public FileChannel position (long newPosition)
+ throws IOException
+ {
+ if (newPosition < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ return implPosition (newPosition);
+ }
+
+ public FileChannel truncate (long size)
+ throws IOException
+ {
+ if (size < 0)
+ throw new IllegalArgumentException ();
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if (file_obj instanceof FileInputStream)
+ throw new NonWritableChannelException ();
+
+ return implTruncate (size);
+ }
+}
diff --git a/libjava/java/nio/channels/natFileChannelImpl.cc b/libjava/java/nio/channels/natFileChannelImpl.cc
new file mode 100644
index 00000000000..8dbbd141e60
--- /dev/null
+++ b/libjava/java/nio/channels/natFileChannelImpl.cc
@@ -0,0 +1,94 @@
+// natFileChannelImpl.cc
+
+/* Copyright (C) 2003 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#include <config.h>
+
+#include <jvm.h>
+
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include <gnu/gcj/RawData.h>
+#include <java/io/FileDescriptor.h>
+#include <java/io/IOException.h>
+#include <java/nio/ByteBuffer.h>
+#include <java/nio/channels/FileChannel.h>
+#include <java/nio/channels/FileChannelImpl.h>
+
+jlong
+java::nio::channels::FileChannelImpl::size ()
+{
+ return fd->getLength ();
+}
+
+jlong
+java::nio::channels::FileChannelImpl::implPosition ()
+{
+ return fd->getFilePointer ();
+}
+
+java::nio::channels::FileChannel*
+java::nio::channels::FileChannelImpl::implPosition (jlong newPosition)
+{
+ fd->seek (newPosition, ::java::io::FileDescriptor::SET, true);
+ return this;
+}
+
+jint
+java::nio::channels::FileChannelImpl::implRead (JArray<jbyte>* buffer,
+ jint offset, jint len)
+{
+ return fd->read (buffer, offset, len);
+}
+
+jint
+java::nio::channels::FileChannelImpl::implWrite (JArray<jbyte>* buffer,
+ jint offset, jint len)
+{
+ fd->write (buffer, offset, len);
+ return len;
+}
+
+java::nio::channels::FileChannel*
+java::nio::channels::FileChannelImpl::implTruncate (jlong size)
+{
+ fd->setLength (size);
+ return this;
+}
+
+gnu::gcj::RawData*
+java::nio::channels::FileChannelImpl::nio_mmap_file (jlong /*pos*/, jlong /*size*/,
+ jint /*mode*/)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("mmap not implemented"));
+}
+
+void
+java::nio::channels::FileChannelImpl::nio_unmmap_file (gnu::gcj::RawData* /*address*/,
+ jint /*size*/)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("munmap not implemented"));
+}
+
+void
+java::nio::channels::FileChannelImpl::nio_msync (gnu::gcj::RawData* /*map_address*/,
+ jint /*length*/)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("msync not implemented"));
+}
diff --git a/libjava/java/security/acl/Acl.java b/libjava/java/security/acl/Acl.java
index 4e776f50cc0..07d07ecd4a4 100644
--- a/libjava/java/security/acl/Acl.java
+++ b/libjava/java/security/acl/Acl.java
@@ -52,7 +52,7 @@ import java.util.Enumeration;
* <code>Principal</code> belongs have an ACL entry, the permissions for
* the individual <code>Principal</code> take precedence over the
* permissions of the <code>Group</code> if there is a conflict.
- * <p
+ * <p>
* Additionally, the ACL interface extends the <code>Owner</code> interface
* and so an ACL has owners. Actions which modify the ACL are restricted
* to owners.
diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java
index b5f0523dfd9..be0aa4dcd02 100644
--- a/libjava/java/sql/Timestamp.java
+++ b/libjava/java/sql/Timestamp.java
@@ -81,7 +81,7 @@ public class Timestamp extends java.util.Date
{
try
{
- Date d = (Date) parse_sdf.parseObject(str);
+ java.util.Date d = (java.util.Date)parse_sdf.parseObject(str);
if (d == null)
throw new IllegalArgumentException(str);
diff --git a/libjava/java/text/DateFormatSymbols.java b/libjava/java/text/DateFormatSymbols.java
index fcc00196825..e6cf9ea3cc8 100644
--- a/libjava/java/text/DateFormatSymbols.java
+++ b/libjava/java/text/DateFormatSymbols.java
@@ -1,5 +1,5 @@
/* ChoiceFormat.java -- Format over a range of 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.
@@ -156,24 +156,24 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable
* locale):
* <p>
* <ul>
- * <li>0 - era (G)
- * <li>1 - year (y)
- * <li>2 - month (M)
- * <li 3 - day of month (d)
- * <li>4 - hour out of 12, from 1-12 (h)
- * <li>5 - hour out of 24, from 0-23 (H)
- * <li>6 - minute (m)
- * <li>7 - second (s)
- * <li>8 - millisecond (S)
- * <li>9 - date of week (E)
- * <li>10 - date of year (D)
- * <li>11 - day of week in month, eg. "4th Thur in Nov" (F)
- * <li>12 - week in year (w)
- * <li>13 - week in month (W)
- * <li>14 - am/pm (a)
- * <li>15 - hour out of 24, from 1-24 (k)
- * <li>16 - hour out of 12, from 0-11 (K)
- * <li>17 - time zone (z)
+ * <li>0 - era (G)</li>
+ * <li>1 - year (y)</li>
+ * <li>2 - month (M)</li>
+ * <li>3 - day of month (d)</li>
+ * <li>4 - hour out of 12, from 1-12 (h)</li>
+ * <li>5 - hour out of 24, from 0-23 (H)</li>
+ * <li>6 - minute (m)</li>
+ * <li>7 - second (s)</li>
+ * <li>8 - millisecond (S)</li>
+ * <li>9 - date of week (E)</li>
+ * <li>10 - date of year (D)</li>
+ * <li>11 - day of week in month, eg. "4th Thur in Nov" (F)</li>
+ * <li>12 - week in year (w)</li>
+ * <li>13 - week in month (W)</li>
+ * <li>14 - am/pm (a)</li>
+ * <li>15 - hour out of 24, from 1-24 (k)</li>
+ * <li>16 - hour out of 12, from 0-11 (K)</li>
+ * <li>17 - time zone (z)</li>
* </ul>
*
* @return The format patter characters
@@ -295,24 +295,24 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable
* locale):
* <p>
* <ul>
- * <li>0 - era (G)
- * <li>1 - year (y)
- * <li>2 - month (M)
- * <li 3 - day of month (d)
- * <li>4 - hour out of 12, from 1-12 (h)
- * <li>5 - hour out of 24, from 0-23 (H)
- * <li>6 - minute (m)
- * <li>7 - second (s)
- * <li>8 - millisecond (S)
- * <li>9 - date of week (E)
- * <li>10 - date of year (D)
- * <li>11 - day of week in month, eg. "4th Thur in Nov" (F)
- * <li>12 - week in year (w)
- * <li>13 - week in month (W)
- * <li>14 - am/pm (a)
- * <li>15 - hour out of 24, from 1-24 (k)
- * <li>16 - hour out of 12, from 0-11 (K)
- * <li>17 - time zone (z)
+ * <li>0 - era (G)</li>
+ * <li>1 - year (y)</li>
+ * <li>2 - month (M)</li>
+ * <li>3 - day of month (d)</li>
+ * <li>4 - hour out of 12, from 1-12 (h)</li>
+ * <li>5 - hour out of 24, from 0-23 (H)</li>
+ * <li>6 - minute (m)</li>
+ * <li>7 - second (s)</li>
+ * <li>8 - millisecond (S)</li>
+ * <li>9 - date of week (E)</li>
+ * <li>10 - date of year (D)</li>
+ * <li>11 - day of week in month, eg. "4th Thur in Nov" (F)</li>
+ * <li>12 - week in year (w)</li>
+ * <li>13 - week in month (W)</li>
+ * <li>14 - am/pm (a)</li>
+ * <li>15 - hour out of 24, from 1-24 (k)</li>
+ * <li>16 - hour out of 12, from 0-11 (K)</li>
+ * <li>17 - time zone (z)</li>
* </ul>
*
* @param localPatternChars The new format patter characters
diff --git a/libjava/java/text/DecimalFormat.java b/libjava/java/text/DecimalFormat.java
index 7f946173fee..0cf2d8fff3b 100644
--- a/libjava/java/text/DecimalFormat.java
+++ b/libjava/java/text/DecimalFormat.java
@@ -474,7 +474,7 @@ public class DecimalFormat extends NumberFormat
intPart = Math.floor(intPart / 10);
// Append group separator if required.
- if (groupingUsed && count > 0 && count % groupingSize == 0)
+ if (groupingUsed && count > 0 && groupingSize != 0 && count % groupingSize == 0)
dest.insert(index, symbols.getGroupingSeparator());
dest.insert(index, (char) (symbols.getZeroDigit() + dig));
@@ -602,7 +602,7 @@ public class DecimalFormat extends NumberFormat
}
// Append group separator if required.
- if (groupingUsed && count > 0 && count % groupingSize == 0)
+ if (groupingUsed && count > 0 && groupingSize != 0 && count % groupingSize == 0)
dest.insert(index, symbols.getGroupingSeparator());
dest.insert(index, (char) (symbols.getZeroDigit() + dig));
@@ -748,7 +748,8 @@ public class DecimalFormat extends NumberFormat
// FIXME: what about grouping size?
if (groupingUsed && c == symbols.getGroupingSeparator())
{
- if (last_group != -1
+ if (last_group != -1
+ && groupingSize != 0
&& (index - last_group) % groupingSize != 0)
{
pos.setErrorIndex(index);
@@ -765,7 +766,8 @@ public class DecimalFormat extends NumberFormat
break;
else if (c == symbols.getDecimalSeparator())
{
- if (last_group != -1
+ if (last_group != -1
+ && groupingSize != 0
&& (index - last_group) % groupingSize != 0)
{
pos.setErrorIndex(index);
diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java
index 67523e1628d..b43c6cd86d4 100644
--- a/libjava/java/text/SimpleDateFormat.java
+++ b/libjava/java/text/SimpleDateFormat.java
@@ -430,11 +430,15 @@ public class SimpleDateFormat extends DateFormat
buffer.append(formatData.eras[calendar.get(Calendar.ERA)]);
break;
case YEAR_FIELD:
- temp = String.valueOf(calendar.get(Calendar.YEAR));
- if (p.size < 4)
- buffer.append(temp.substring(temp.length()-2));
+ // If we have two digits, then we truncate. Otherwise, we
+ // use the size of the pattern, and zero pad.
+ if (p.size == 2)
+ {
+ temp = String.valueOf(calendar.get(Calendar.YEAR));
+ buffer.append(temp.substring(temp.length() - 2));
+ }
else
- buffer.append(temp);
+ withLeadingZeros(calendar.get(Calendar.YEAR), p.size, buffer);
break;
case MONTH_FIELD:
if (p.size < 3)
diff --git a/libjava/java/util/Arrays.java b/libjava/java/util/Arrays.java
index 35e0e92ca59..080b4b9cbf9 100644
--- a/libjava/java/util/Arrays.java
+++ b/libjava/java/util/Arrays.java
@@ -1,5 +1,5 @@
/* Arrays.java -- Utility class with methods to operate on arrays
- 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.
@@ -398,23 +398,18 @@ public class Arrays
if (a1 == a2)
return true;
- try
+ if (null == a1 || null == a2)
+ return false;
+
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
- {
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
-
return false;
}
@@ -433,21 +428,17 @@ public class Arrays
if (a1 == a2)
return true;
- try
- {
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
+ if (null == a1 || null == a2)
+ return false;
+
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -467,21 +458,17 @@ public class Arrays
if (a1 == a2)
return true;
- try
+ if (null == a1 || null == a2)
+ return false;
+
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
- {
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -501,21 +488,17 @@ public class Arrays
if (a1 == a2)
return true;
- try
- {
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
+ if (null == a1 || null == a2)
+ return false;
+
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -535,21 +518,17 @@ public class Arrays
if (a1 == a2)
return true;
- try
- {
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
+ if (null == a1 || null == a2)
+ return false;
+
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -569,21 +548,17 @@ public class Arrays
if (a1 == a2)
return true;
- try
- {
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
+ if (null == a1 || null == a2)
+ return false;
+
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -603,22 +578,18 @@ public class Arrays
if (a1 == a2)
return true;
+ if (null == a1 || null == a2)
+ return false;
+
// Must use Float.compare to take into account NaN, +-0.
- try
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (Float.compare(a1[i], a2[i]) != 0)
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
- {
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (Float.compare(a1[i], a2[i]) != 0)
+ return false;
+ return true;
}
return false;
}
@@ -638,22 +609,18 @@ public class Arrays
if (a1 == a2)
return true;
+ if (null == a1 || null == a2)
+ return false;
+
// Must use Double.compare to take into account NaN, +-0.
- try
- {
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (Double.compare(a1[i], a2[i]) != 0)
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (Double.compare(a1[i], a2[i]) != 0)
+ return false;
+ return true;
}
return false;
}
@@ -674,21 +641,17 @@ public class Arrays
if (a1 == a2)
return true;
- try
- {
- // If they're the same length, test each element
- if (a1.length == a2.length)
- {
- int i = a1.length;
- while (--i >= 0)
- if (! AbstractCollection.equals(a1[i], a2[i]))
- return false;
- return true;
- }
- }
- catch (NullPointerException e)
+ if (null == a1 || null == a2)
+ return false;
+
+ // If they're the same length, test each element
+ if (a1.length == a2.length)
{
- // If one is null, we get a harmless NullPointerException
+ int i = a1.length;
+ while (--i >= 0)
+ if (! AbstractCollection.equals(a1[i], a2[i]))
+ return false;
+ return true;
}
return false;
}
diff --git a/libjava/java/util/Calendar.java b/libjava/java/util/Calendar.java
index 9a4e21f69de..271d1d163c6 100644
--- a/libjava/java/util/Calendar.java
+++ b/libjava/java/util/Calendar.java
@@ -361,11 +361,21 @@ public abstract class Calendar implements Serializable, Cloneable
static final long serialVersionUID = -1807547505821590642L;
/**
- * The name of the resource bundle.
+ * The name of the resource bundle. Used only by getBundle()
*/
private static final String bundleName = "gnu.java.locale.Calendar";
/**
+ * get resource bundle:
+ * The resources should be loaded via this method only. Iff an application
+ * uses this method, the resourcebundle is required.
+ */
+ private static ResourceBundle getBundle(Locale locale)
+ {
+ return ResourceBundle.getBundle(bundleName, locale);
+ }
+
+ /**
* Constructs a new Calendar with the default time zone and the default
* locale.
*/
@@ -385,7 +395,7 @@ public abstract class Calendar implements Serializable, Cloneable
this.zone = zone;
lenient = true;
- ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
+ ResourceBundle rb = getBundle(locale);
firstDayOfWeek = ((Integer) rb.getObject("firstDayOfWeek")).intValue();
minimalDaysInFirstWeek =
@@ -430,7 +440,7 @@ public abstract class Calendar implements Serializable, Cloneable
public static synchronized Calendar getInstance(TimeZone zone, Locale locale)
{
String calendarClassName = null;
- ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
+ ResourceBundle rb = getBundle(locale);
calendarClassName = rb.getString("calendarClass");
if (calendarClassName != null)
{
@@ -461,8 +471,7 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public static synchronized Locale[] getAvailableLocales()
{
- ResourceBundle rb = ResourceBundle.getBundle(bundleName,
- new Locale("", ""));
+ ResourceBundle rb = getBundle(new Locale("", ""));
return (Locale[]) rb.getObject("availableLocales");
}
diff --git a/libjava/java/util/GregorianCalendar.java b/libjava/java/util/GregorianCalendar.java
index b01d971edca..91f5890ef06 100644
--- a/libjava/java/util/GregorianCalendar.java
+++ b/libjava/java/util/GregorianCalendar.java
@@ -78,11 +78,21 @@ public class GregorianCalendar extends Calendar
static final long serialVersionUID = -8125100834729963327L;
/**
- * The name of the resource bundle.
+ * The name of the resource bundle. Used only by getBundle()
*/
private static final String bundleName = "gnu.java.locale.Calendar";
/**
+ * get resource bundle:
+ * The resources should be loaded via this method only. Iff an application
+ * uses this method, the resourcebundle is required. --Fridi.
+ */
+ private static ResourceBundle getBundle(Locale locale)
+ {
+ return ResourceBundle.getBundle(bundleName, locale);
+ }
+
+ /**
* Constructs a new GregorianCalender representing the current
* time, using the default time zone and the default locale.
*/
@@ -120,7 +130,7 @@ public class GregorianCalendar extends Calendar
public GregorianCalendar(TimeZone zone, Locale locale)
{
super(zone, locale);
- ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
+ ResourceBundle rb = getBundle(locale);
gregorianCutover = ((Date) rb.getObject("gregorianCutOver")).getTime();
setTimeInMillis(System.currentTimeMillis());
}
diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java
index 9faca0339d1..6b3466ca15d 100644
--- a/libjava/java/util/HashMap.java
+++ b/libjava/java/util/HashMap.java
@@ -1,6 +1,6 @@
/* HashMap.java -- a class providing a basic hashtable data structure,
mapping Object --> Object
- 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.
@@ -808,6 +808,7 @@ public class HashMap extends AbstractMap
// Read and use capacity, followed by key/value pairs.
buckets = new HashEntry[s.readInt()];
int len = s.readInt();
+ size = len;
while (len-- > 0)
{
Object key = s.readObject();
diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java
index 431824f0c35..06867fb020c 100644
--- a/libjava/java/util/Locale.java
+++ b/libjava/java/util/Locale.java
@@ -489,7 +489,7 @@ public final class Locale implements Serializable, Cloneable
+ "WS,YE,YT,YU,ZA,ZM,ZR,ZW")
.indexOf(country);
- if (index % 3 != 0 || language.length() != 2)
+ if (index % 3 != 0 || country.length() != 2)
throw new MissingResourceException
("Can't find ISO3 country for " + country,
"java.util.Locale", country);
diff --git a/libjava/java/util/Properties.java b/libjava/java/util/Properties.java
index 52ca144cb70..2f4428958d4 100644
--- a/libjava/java/util/Properties.java
+++ b/libjava/java/util/Properties.java
@@ -56,7 +56,7 @@ import java.io.OutputStreamWriter;
* here. This extends the example given in ListResourceBundle.
* Create a file MyResource_de.properties with the following contents
* and put it in the CLASSPATH. (The character
- * <code>\</code><code>u00e4</code> is the german &auml;)
+ * <code>\</code><code>u00e4</code> is the german umlaut)
*
*
<pre>s1=3
diff --git a/libjava/java/util/PropertyResourceBundle.java b/libjava/java/util/PropertyResourceBundle.java
index 7ebe2b1e6df..d873e134e62 100644
--- a/libjava/java/util/PropertyResourceBundle.java
+++ b/libjava/java/util/PropertyResourceBundle.java
@@ -61,8 +61,8 @@ import java.io.InputStream;
* An example of a properties file for the german language is given
* here. This extends the example given in ListResourceBundle.
* Create a file MyResource_de.properties with the following contents
- * and put it in the CLASSPATH. (The char <code>\u00e4<char> is the
- * german &auml;)
+ * and put it in the CLASSPATH. (The char <code>\u00e4</code> is the
+ * german umlaut)
*
*
<pre>
diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java
index 6d4493001f6..db9ff6b1051 100644
--- a/libjava/java/util/TimeZone.java
+++ b/libjava/java/util/TimeZone.java
@@ -80,695 +80,709 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
/**
* The default time zone, as returned by getDefault.
*/
- private static TimeZone defaultZone;
+ private static TimeZone defaultZone0;
+ /* initialize this static field lazily to overhead if
+ * it is not needed:
+ */
+ private static synchronized TimeZone defaultZone() {
+ /* Look up default timezone */
+ if (defaultZone0 == null)
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("javautil");
+ }
+ String tzid = System.getProperty("user.timezone");
+
+ if (tzid == null)
+ tzid = getDefaultTimeZoneId();
+
+ if (tzid == null)
+ tzid = "GMT";
+
+ defaultZone0 = getTimeZone(tzid);
+ }
+ return defaultZone0;
+ }
+
private static final long serialVersionUID = 3581463369166924961L;
/**
* Hashtable for timezones by ID.
*/
- private static final Hashtable timezones = new Hashtable();
-
- static
- {
- TimeZone tz;
- // Automatically generated by scripts/timezones.pl
- // XXX - Should we read this data from a file?
- tz = new SimpleTimeZone(-11000 * 3600, "MIT");
- timezones.put("MIT", tz);
- timezones.put("Pacific/Apia", tz);
- timezones.put("Pacific/Midway", tz);
- timezones.put("Pacific/Niue", tz);
- timezones.put("Pacific/Pago_Pago", tz);
- tz = new SimpleTimeZone
- (-10000 * 3600, "America/Adak",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("America/Adak", tz);
- tz = new SimpleTimeZone(-10000 * 3600, "HST");
- timezones.put("HST", tz);
- timezones.put("Pacific/Fakaofo", tz);
- timezones.put("Pacific/Honolulu", tz);
- timezones.put("Pacific/Johnston", tz);
- timezones.put("Pacific/Rarotonga", tz);
- timezones.put("Pacific/Tahiti", tz);
- tz = new SimpleTimeZone(-9500 * 3600, "Pacific/Marquesas");
- timezones.put("Pacific/Marquesas", tz);
- tz = new SimpleTimeZone
- (-9000 * 3600, "AST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("AST", tz);
- timezones.put("America/Anchorage", tz);
- timezones.put("America/Juneau", tz);
- timezones.put("America/Nome", tz);
- timezones.put("America/Yakutat", tz);
- tz = new SimpleTimeZone(-9000 * 3600, "Pacific/Gambier");
- timezones.put("Pacific/Gambier", tz);
- tz = new SimpleTimeZone
- (-8000 * 3600, "PST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("PST", tz);
- timezones.put("PST8PDT", tz);
- timezones.put("America/Dawson", tz);
- timezones.put("America/Los_Angeles", tz);
- timezones.put("America/Tijuana", tz);
- timezones.put("America/Vancouver", tz);
- timezones.put("America/Whitehorse", tz);
- timezones.put("US/Pacific-New", tz);
- tz = new SimpleTimeZone(-8000 * 3600, "Pacific/Pitcairn");
- timezones.put("Pacific/Pitcairn", tz);
- tz = new SimpleTimeZone
- (-7000 * 3600, "MST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("MST", tz);
- timezones.put("MST7MDT", tz);
- timezones.put("America/Boise", tz);
- timezones.put("America/Chihuahua", tz);
- timezones.put("America/Denver", tz);
- timezones.put("America/Edmonton", tz);
- timezones.put("America/Inuvik", tz);
- timezones.put("America/Mazatlan", tz);
- timezones.put("America/Shiprock", tz);
- timezones.put("America/Yellowknife", tz);
- tz = new SimpleTimeZone(-7000 * 3600, "MST7");
- timezones.put("MST7", tz);
- timezones.put("PNT", tz);
- timezones.put("America/Dawson_Creek", tz);
- timezones.put("America/Hermosillo", tz);
- timezones.put("America/Phoenix", tz);
- tz = new SimpleTimeZone
- (-6000 * 3600, "CST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("CST", tz);
- timezones.put("CST6CDT", tz);
- timezones.put("America/Cambridge_Bay", tz);
- timezones.put("America/Cancun", tz);
- timezones.put("America/Chicago", tz);
- timezones.put("America/Menominee", tz);
- timezones.put("America/Merida", tz);
- timezones.put("America/Mexico_City", tz);
- timezones.put("America/Monterrey", tz);
- timezones.put("America/Rainy_River", tz);
- timezones.put("America/Winnipeg", tz);
- tz = new SimpleTimeZone(-6000 * 3600, "America/Belize");
- timezones.put("America/Belize", tz);
- timezones.put("America/Costa_Rica", tz);
- timezones.put("America/El_Salvador", tz);
- timezones.put("America/Guatemala", tz);
- timezones.put("America/Managua", tz);
- timezones.put("America/Regina", tz);
- timezones.put("America/Swift_Current", tz);
- timezones.put("America/Tegucigalpa", tz);
- timezones.put("Pacific/Galapagos", tz);
- tz = new SimpleTimeZone
- (-6000 * 3600, "Pacific/Easter",
- Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
- Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
- timezones.put("Pacific/Easter", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "America/Grand_Turk",
- Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Grand_Turk", tz);
- timezones.put("America/Havana", tz);
- tz = new SimpleTimeZone(-5000 * 3600, "EST5");
- timezones.put("EST5", tz);
- timezones.put("IET", tz);
- timezones.put("America/Bogota", tz);
- timezones.put("America/Cayman", tz);
- timezones.put("America/Eirunepe", tz);
- timezones.put("America/Guayaquil", tz);
- timezones.put("America/Indiana/Indianapolis", tz);
- timezones.put("America/Indiana/Knox", tz);
- timezones.put("America/Indiana/Marengo", tz);
- timezones.put("America/Indiana/Vevay", tz);
- timezones.put("America/Indianapolis", tz);
- timezones.put("America/Iqaluit", tz);
- timezones.put("America/Jamaica", tz);
- timezones.put("America/Lima", tz);
- timezones.put("America/Panama", tz);
- timezones.put("America/Pangnirtung", tz);
- timezones.put("America/Port-au-Prince", tz);
- timezones.put("America/Porto_Acre", tz);
- timezones.put("America/Rankin_Inlet", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "EST",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("EST", tz);
- timezones.put("EST5EDT", tz);
- timezones.put("America/Detroit", tz);
- timezones.put("America/Kentucky/Louisville", tz);
- timezones.put("America/Kentucky/Monticello", tz);
- timezones.put("America/Louisville", tz);
- timezones.put("America/Montreal", tz);
- timezones.put("America/Nassau", tz);
- timezones.put("America/New_York", tz);
- timezones.put("America/Nipigon", tz);
- timezones.put("America/Thunder_Bay", tz);
- tz = new SimpleTimeZone(-4000 * 3600, "PRT");
- timezones.put("PRT", tz);
- timezones.put("America/Anguilla", tz);
- timezones.put("America/Antigua", tz);
- timezones.put("America/Aruba", tz);
- timezones.put("America/Barbados", tz);
- timezones.put("America/Boa_Vista", tz);
- timezones.put("America/Caracas", tz);
- timezones.put("America/Curacao", tz);
- timezones.put("America/Dominica", tz);
- timezones.put("America/Grenada", tz);
- timezones.put("America/Guadeloupe", tz);
- timezones.put("America/Guyana", tz);
- timezones.put("America/La_Paz", tz);
- timezones.put("America/Manaus", tz);
- timezones.put("America/Martinique", tz);
- timezones.put("America/Montserrat", tz);
- timezones.put("America/Port_of_Spain", tz);
- timezones.put("America/Porto_Velho", tz);
- timezones.put("America/Puerto_Rico", tz);
- timezones.put("America/Santo_Domingo", tz);
- timezones.put("America/St_Kitts", tz);
- timezones.put("America/St_Lucia", tz);
- timezones.put("America/St_Thomas", tz);
- timezones.put("America/St_Vincent", tz);
- timezones.put("America/Tortola", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Asuncion",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Asuncion", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Cuiaba",
- Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Cuiaba", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Goose_Bay",
- Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
- timezones.put("America/Goose_Bay", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Glace_Bay",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("America/Glace_Bay", tz);
- timezones.put("America/Halifax", tz);
- timezones.put("America/Thule", tz);
- timezones.put("Atlantic/Bermuda", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Santiago",
- Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
- Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Santiago", tz);
- timezones.put("Antarctica/Palmer", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "Atlantic/Stanley",
- Calendar.SEPTEMBER, 2, Calendar.SUNDAY, 0 * 3600,
- Calendar.APRIL, 16, -Calendar.SUNDAY, 0 * 3600);
- timezones.put("Atlantic/Stanley", tz);
- tz = new SimpleTimeZone
- (-3500 * 3600, "CNT",
- Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
- timezones.put("CNT", tz);
- timezones.put("America/St_Johns", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Araguaina",
- Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Araguaina", tz);
- timezones.put("America/Sao_Paulo", tz);
- tz = new SimpleTimeZone(-3000 * 3600, "AGT");
- timezones.put("AGT", tz);
- timezones.put("America/Belem", tz);
- timezones.put("America/Buenos_Aires", tz);
- timezones.put("America/Catamarca", tz);
- timezones.put("America/Cayenne", tz);
- timezones.put("America/Cordoba", tz);
- timezones.put("America/Fortaleza", tz);
- timezones.put("America/Jujuy", tz);
- timezones.put("America/Maceio", tz);
- timezones.put("America/Mendoza", tz);
- timezones.put("America/Montevideo", tz);
- timezones.put("America/Paramaribo", tz);
- timezones.put("America/Recife", tz);
- timezones.put("America/Rosario", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Godthab",
- Calendar.MARCH, 30, -Calendar.SATURDAY, 22000 * 3600,
- Calendar.OCTOBER, 30, -Calendar.SATURDAY, 22000 * 3600);
- timezones.put("America/Godthab", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Miquelon",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("America/Miquelon", tz);
- tz = new SimpleTimeZone(-2000 * 3600, "America/Noronha");
- timezones.put("America/Noronha", tz);
- timezones.put("Atlantic/South_Georgia", tz);
- tz = new SimpleTimeZone
- (-1000 * 3600, "America/Scoresbysund",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Scoresbysund", tz);
- timezones.put("Atlantic/Azores", tz);
- tz = new SimpleTimeZone(-1000 * 3600, "Atlantic/Cape_Verde");
- timezones.put("Atlantic/Cape_Verde", tz);
- timezones.put("Atlantic/Jan_Mayen", tz);
- tz = new SimpleTimeZone(0 * 3600, "GMT");
- timezones.put("GMT", tz);
- timezones.put("UTC", tz);
- timezones.put("Africa/Abidjan", tz);
- timezones.put("Africa/Accra", tz);
- timezones.put("Africa/Bamako", tz);
- timezones.put("Africa/Banjul", tz);
- timezones.put("Africa/Bissau", tz);
- timezones.put("Africa/Casablanca", tz);
- timezones.put("Africa/Conakry", tz);
- timezones.put("Africa/Dakar", tz);
- timezones.put("Africa/El_Aaiun", tz);
- timezones.put("Africa/Freetown", tz);
- timezones.put("Africa/Lome", tz);
- timezones.put("Africa/Monrovia", tz);
- timezones.put("Africa/Nouakchott", tz);
- timezones.put("Africa/Ouagadougou", tz);
- timezones.put("Africa/Sao_Tome", tz);
- timezones.put("Africa/Timbuktu", tz);
- timezones.put("Atlantic/Reykjavik", tz);
- timezones.put("Atlantic/St_Helena", tz);
- timezones.put("Europe/Belfast", tz);
- timezones.put("Europe/Dublin", tz);
- timezones.put("Europe/London", tz);
- tz = new SimpleTimeZone
- (0 * 3600, "WET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
- timezones.put("WET", tz);
- timezones.put("Atlantic/Canary", tz);
- timezones.put("Atlantic/Faeroe", tz);
- timezones.put("Atlantic/Madeira", tz);
- timezones.put("Europe/Lisbon", tz);
- tz = new SimpleTimeZone(1000 * 3600, "Africa/Algiers");
- timezones.put("Africa/Algiers", tz);
- timezones.put("Africa/Bangui", tz);
- timezones.put("Africa/Brazzaville", tz);
- timezones.put("Africa/Douala", tz);
- timezones.put("Africa/Kinshasa", tz);
- timezones.put("Africa/Lagos", tz);
- timezones.put("Africa/Libreville", tz);
- timezones.put("Africa/Luanda", tz);
- timezones.put("Africa/Malabo", tz);
- timezones.put("Africa/Ndjamena", tz);
- timezones.put("Africa/Niamey", tz);
- timezones.put("Africa/Porto-Novo", tz);
- timezones.put("Africa/Tunis", tz);
- tz = new SimpleTimeZone
- (1000 * 3600, "Africa/Windhoek",
- Calendar.SEPTEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Africa/Windhoek", tz);
- tz = new SimpleTimeZone
- (1000 * 3600, "CET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("CET", tz);
- timezones.put("ECT", tz);
- timezones.put("MET", tz);
- timezones.put("Africa/Ceuta", tz);
- timezones.put("Arctic/Longyearbyen", tz);
- timezones.put("Europe/Amsterdam", tz);
- timezones.put("Europe/Andorra", tz);
- timezones.put("Europe/Belgrade", tz);
- timezones.put("Europe/Berlin", tz);
- timezones.put("Europe/Bratislava", tz);
- timezones.put("Europe/Brussels", tz);
- timezones.put("Europe/Budapest", tz);
- timezones.put("Europe/Copenhagen", tz);
- timezones.put("Europe/Gibraltar", tz);
- timezones.put("Europe/Ljubljana", tz);
- timezones.put("Europe/Luxembourg", tz);
- timezones.put("Europe/Madrid", tz);
- timezones.put("Europe/Malta", tz);
- timezones.put("Europe/Monaco", tz);
- timezones.put("Europe/Oslo", tz);
- timezones.put("Europe/Paris", tz);
- timezones.put("Europe/Prague", tz);
- timezones.put("Europe/Rome", tz);
- timezones.put("Europe/San_Marino", tz);
- timezones.put("Europe/Sarajevo", tz);
- timezones.put("Europe/Skopje", tz);
- timezones.put("Europe/Stockholm", tz);
- timezones.put("Europe/Tirane", tz);
- timezones.put("Europe/Vaduz", tz);
- timezones.put("Europe/Vatican", tz);
- timezones.put("Europe/Vienna", tz);
- timezones.put("Europe/Warsaw", tz);
- timezones.put("Europe/Zagreb", tz);
- timezones.put("Europe/Zurich", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "ART",
- Calendar.APRIL, -1, Calendar.FRIDAY, 0 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 23000 * 3600);
- timezones.put("ART", tz);
- timezones.put("Africa/Cairo", tz);
- tz = new SimpleTimeZone(2000 * 3600, "CAT");
- timezones.put("CAT", tz);
- timezones.put("Africa/Blantyre", tz);
- timezones.put("Africa/Bujumbura", tz);
- timezones.put("Africa/Gaborone", tz);
- timezones.put("Africa/Harare", tz);
- timezones.put("Africa/Johannesburg", tz);
- timezones.put("Africa/Kigali", tz);
- timezones.put("Africa/Lubumbashi", tz);
- timezones.put("Africa/Lusaka", tz);
- timezones.put("Africa/Maputo", tz);
- timezones.put("Africa/Maseru", tz);
- timezones.put("Africa/Mbabane", tz);
- timezones.put("Africa/Tripoli", tz);
- timezones.put("Europe/Riga", tz);
- timezones.put("Europe/Tallinn", tz);
- timezones.put("Europe/Vilnius", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Amman",
- Calendar.MARCH, -1, Calendar.THURSDAY, 0 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 0 * 3600);
- timezones.put("Asia/Amman", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Beirut",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("Asia/Beirut", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Damascus",
- Calendar.APRIL, 1, 0, 0 * 3600,
- Calendar.OCTOBER, 1, 0, 0 * 3600);
- timezones.put("Asia/Damascus", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Gaza",
- Calendar.APRIL, 3, Calendar.FRIDAY, 0 * 3600,
- Calendar.OCTOBER, 3, Calendar.FRIDAY, 0 * 3600);
- timezones.put("Asia/Gaza", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Jerusalem",
- Calendar.APRIL, 1, 0, 1000 * 3600,
- Calendar.OCTOBER, 1, 0, 1000 * 3600);
- timezones.put("Asia/Jerusalem", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "EET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones.put("EET", tz);
- timezones.put("Asia/Istanbul", tz);
- timezones.put("Asia/Nicosia", tz);
- timezones.put("Europe/Athens", tz);
- timezones.put("Europe/Bucharest", tz);
- timezones.put("Europe/Chisinau", tz);
- timezones.put("Europe/Helsinki", tz);
- timezones.put("Europe/Istanbul", tz);
- timezones.put("Europe/Kiev", tz);
- timezones.put("Europe/Nicosia", tz);
- timezones.put("Europe/Simferopol", tz);
- timezones.put("Europe/Sofia", tz);
- timezones.put("Europe/Uzhgorod", tz);
- timezones.put("Europe/Zaporozhye", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Europe/Kaliningrad",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Europe/Kaliningrad", tz);
- timezones.put("Europe/Minsk", tz);
- tz = new SimpleTimeZone
- (3000 * 3600, "Asia/Baghdad",
- Calendar.APRIL, 1, 0, 3000 * 3600,
- Calendar.OCTOBER, 1, 0, 3000 * 3600);
- timezones.put("Asia/Baghdad", tz);
- tz = new SimpleTimeZone
- (3000 * 3600, "Europe/Moscow",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Europe/Moscow", tz);
- timezones.put("Europe/Tiraspol", tz);
- tz = new SimpleTimeZone(3000 * 3600, "EAT");
- timezones.put("EAT", tz);
- timezones.put("Africa/Addis_Ababa", tz);
- timezones.put("Africa/Asmera", tz);
- timezones.put("Africa/Dar_es_Salaam", tz);
- timezones.put("Africa/Djibouti", tz);
- timezones.put("Africa/Kampala", tz);
- timezones.put("Africa/Khartoum", tz);
- timezones.put("Africa/Mogadishu", tz);
- timezones.put("Africa/Nairobi", tz);
- timezones.put("Antarctica/Syowa", tz);
- timezones.put("Asia/Aden", tz);
- timezones.put("Asia/Bahrain", tz);
- timezones.put("Asia/Kuwait", tz);
- timezones.put("Asia/Qatar", tz);
- timezones.put("Asia/Riyadh", tz);
- timezones.put("Indian/Antananarivo", tz);
- timezones.put("Indian/Comoro", tz);
- timezones.put("Indian/Mayotte", tz);
- tz = new SimpleTimeZone(3500 * 3600, "Asia/Tehran");
- timezones.put("Asia/Tehran", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Baku",
- Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
- timezones.put("Asia/Baku", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Aqtau",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("Asia/Aqtau", tz);
- timezones.put("Asia/Tbilisi", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Yerevan",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Yerevan", tz);
- timezones.put("Europe/Samara", tz);
- tz = new SimpleTimeZone(4000 * 3600, "NET");
- timezones.put("NET", tz);
- timezones.put("Asia/Dubai", tz);
- timezones.put("Asia/Muscat", tz);
- timezones.put("Indian/Mahe", tz);
- timezones.put("Indian/Mauritius", tz);
- timezones.put("Indian/Reunion", tz);
- tz = new SimpleTimeZone(4500 * 3600, "Asia/Kabul");
- timezones.put("Asia/Kabul", tz);
- tz = new SimpleTimeZone
- (5000 * 3600, "Asia/Aqtobe",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("Asia/Aqtobe", tz);
- tz = new SimpleTimeZone
- (5000 * 3600, "Asia/Bishkek",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2500 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2500 * 3600);
- timezones.put("Asia/Bishkek", tz);
- tz = new SimpleTimeZone
- (5000 * 3600, "Asia/Yekaterinburg",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Yekaterinburg", tz);
- tz = new SimpleTimeZone(5000 * 3600, "PLT");
- timezones.put("PLT", tz);
- timezones.put("Asia/Ashgabat", tz);
- timezones.put("Asia/Dushanbe", tz);
- timezones.put("Asia/Karachi", tz);
- timezones.put("Asia/Samarkand", tz);
- timezones.put("Asia/Tashkent", tz);
- timezones.put("Indian/Chagos", tz);
- timezones.put("Indian/Kerguelen", tz);
- timezones.put("Indian/Maldives", tz);
- tz = new SimpleTimeZone(5500 * 3600, "IST");
- timezones.put("IST", tz);
- timezones.put("Asia/Calcutta", tz);
- tz = new SimpleTimeZone(5750 * 3600, "Asia/Katmandu");
- timezones.put("Asia/Katmandu", tz);
- tz = new SimpleTimeZone(6000 * 3600, "BST");
- timezones.put("BST", tz);
- timezones.put("Antarctica/Mawson", tz);
- timezones.put("Asia/Colombo", tz);
- timezones.put("Asia/Dhaka", tz);
- timezones.put("Asia/Thimphu", tz);
- tz = new SimpleTimeZone
- (6000 * 3600, "Asia/Almaty",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("Asia/Almaty", tz);
- tz = new SimpleTimeZone
- (6000 * 3600, "Asia/Novosibirsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Novosibirsk", tz);
- timezones.put("Asia/Omsk", tz);
- tz = new SimpleTimeZone(6500 * 3600, "Asia/Rangoon");
- timezones.put("Asia/Rangoon", tz);
- timezones.put("Indian/Cocos", tz);
- tz = new SimpleTimeZone(7000 * 3600, "VST");
- timezones.put("VST", tz);
- timezones.put("Antarctica/Davis", tz);
- timezones.put("Asia/Bangkok", tz);
- timezones.put("Asia/Hovd", tz);
- timezones.put("Asia/Jakarta", tz);
- timezones.put("Asia/Phnom_Penh", tz);
- timezones.put("Asia/Saigon", tz);
- timezones.put("Asia/Vientiane", tz);
- timezones.put("Indian/Christmas", tz);
- tz = new SimpleTimeZone
- (7000 * 3600, "Asia/Krasnoyarsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Krasnoyarsk", tz);
- tz = new SimpleTimeZone(8000 * 3600, "CTT");
- timezones.put("CTT", tz);
- timezones.put("Antarctica/Casey", tz);
- timezones.put("Asia/Brunei", tz);
- timezones.put("Asia/Chungking", tz);
- timezones.put("Asia/Harbin", tz);
- timezones.put("Asia/Hong_Kong", tz);
- timezones.put("Asia/Kashgar", tz);
- timezones.put("Asia/Kuala_Lumpur", tz);
- timezones.put("Asia/Kuching", tz);
- timezones.put("Asia/Macao", tz);
- timezones.put("Asia/Manila", tz);
- timezones.put("Asia/Shanghai", tz);
- timezones.put("Asia/Singapore", tz);
- timezones.put("Asia/Taipei", tz);
- timezones.put("Asia/Ujung_Pandang", tz);
- timezones.put("Asia/Ulaanbaatar", tz);
- timezones.put("Asia/Urumqi", tz);
- timezones.put("Australia/Perth", tz);
- tz = new SimpleTimeZone
- (8000 * 3600, "Asia/Irkutsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Irkutsk", tz);
- tz = new SimpleTimeZone(9000 * 3600, "JST");
- timezones.put("JST", tz);
- timezones.put("Asia/Dili", tz);
- timezones.put("Asia/Jayapura", tz);
- timezones.put("Asia/Pyongyang", tz);
- timezones.put("Asia/Seoul", tz);
- timezones.put("Asia/Tokyo", tz);
- timezones.put("Pacific/Palau", tz);
- tz = new SimpleTimeZone
- (9000 * 3600, "Asia/Yakutsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Yakutsk", tz);
- tz = new SimpleTimeZone
- (9500 * 3600, "Australia/Adelaide",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Australia/Adelaide", tz);
- timezones.put("Australia/Broken_Hill", tz);
- tz = new SimpleTimeZone(9500 * 3600, "ACT");
- timezones.put("ACT", tz);
- timezones.put("Australia/Darwin", tz);
- tz = new SimpleTimeZone(10000 * 3600, "Antarctica/DumontDUrville");
- timezones.put("Antarctica/DumontDUrville", tz);
- timezones.put("Australia/Brisbane", tz);
- timezones.put("Australia/Lindeman", tz);
- timezones.put("Pacific/Guam", tz);
- timezones.put("Pacific/Port_Moresby", tz);
- timezones.put("Pacific/Saipan", tz);
- timezones.put("Pacific/Truk", tz);
- timezones.put("Pacific/Yap", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "Asia/Vladivostok",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Vladivostok", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "Australia/Hobart",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Australia/Hobart", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "AET",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("AET", tz);
- timezones.put("Australia/Melbourne", tz);
- timezones.put("Australia/Sydney", tz);
- tz = new SimpleTimeZone
- (10500 * 3600, "Australia/Lord_Howe",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600, 500 * 3600);
- timezones.put("Australia/Lord_Howe", tz);
- tz = new SimpleTimeZone
- (11000 * 3600, "Asia/Magadan",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Magadan", tz);
- tz = new SimpleTimeZone(11000 * 3600, "SST");
- timezones.put("SST", tz);
- timezones.put("Pacific/Efate", tz);
- timezones.put("Pacific/Guadalcanal", tz);
- timezones.put("Pacific/Kosrae", tz);
- timezones.put("Pacific/Noumea", tz);
- timezones.put("Pacific/Ponape", tz);
- tz = new SimpleTimeZone(11500 * 3600, "Pacific/Norfolk");
- timezones.put("Pacific/Norfolk", tz);
- tz = new SimpleTimeZone
- (12000 * 3600, "NST",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, 3, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("NST", tz);
- timezones.put("Antarctica/McMurdo", tz);
- timezones.put("Antarctica/South_Pole", tz);
- timezones.put("Pacific/Auckland", tz);
- tz = new SimpleTimeZone
- (12000 * 3600, "Asia/Anadyr",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Anadyr", tz);
- timezones.put("Asia/Kamchatka", tz);
- tz = new SimpleTimeZone(12000 * 3600, "Pacific/Fiji");
- timezones.put("Pacific/Fiji", tz);
- timezones.put("Pacific/Funafuti", tz);
- timezones.put("Pacific/Kwajalein", tz);
- timezones.put("Pacific/Majuro", tz);
- timezones.put("Pacific/Nauru", tz);
- timezones.put("Pacific/Tarawa", tz);
- timezones.put("Pacific/Wake", tz);
- timezones.put("Pacific/Wallis", tz);
- tz = new SimpleTimeZone
- (12750 * 3600, "Pacific/Chatham",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2750 * 3600,
- Calendar.MARCH, 3, Calendar.SUNDAY, 2750 * 3600);
- timezones.put("Pacific/Chatham", tz);
- tz = new SimpleTimeZone(13000 * 3600, "Pacific/Enderbury");
- timezones.put("Pacific/Enderbury", tz);
- timezones.put("Pacific/Tongatapu", tz);
- tz = new SimpleTimeZone(14000 * 3600, "Pacific/Kiritimati");
- timezones.put("Pacific/Kiritimati", tz);
- }
-
-
- /* Look up default timezone */
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
+ private static Hashtable timezones0;
+ /* initialize this static field lazily to overhead if
+ * it is not needed:
+ */
+ private static synchronized Hashtable timezones() {
+ if (timezones0==null)
{
- System.loadLibrary("javautil");
- }
- String tzid = System.getProperty("user.timezone");
+ Hashtable timezones = new Hashtable();
+ timezones0 = timezones;
- if (tzid == null)
- tzid = getDefaultTimeZoneId();
-
- if (tzid == null)
- tzid = "GMT";
-
- defaultZone = getTimeZone(tzid);
+ TimeZone tz;
+ // Automatically generated by scripts/timezones.pl
+ // XXX - Should we read this data from a file?
+ tz = new SimpleTimeZone(-11000 * 3600, "MIT");
+ timezones0.put("MIT", tz);
+ timezones0.put("Pacific/Apia", tz);
+ timezones0.put("Pacific/Midway", tz);
+ timezones0.put("Pacific/Niue", tz);
+ timezones0.put("Pacific/Pago_Pago", tz);
+ tz = new SimpleTimeZone
+ (-10000 * 3600, "America/Adak",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Adak", tz);
+ tz = new SimpleTimeZone(-10000 * 3600, "HST");
+ timezones0.put("HST", tz);
+ timezones0.put("Pacific/Fakaofo", tz);
+ timezones0.put("Pacific/Honolulu", tz);
+ timezones0.put("Pacific/Johnston", tz);
+ timezones0.put("Pacific/Rarotonga", tz);
+ timezones0.put("Pacific/Tahiti", tz);
+ tz = new SimpleTimeZone(-9500 * 3600, "Pacific/Marquesas");
+ timezones0.put("Pacific/Marquesas", tz);
+ tz = new SimpleTimeZone
+ (-9000 * 3600, "AST",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("AST", tz);
+ timezones0.put("America/Anchorage", tz);
+ timezones0.put("America/Juneau", tz);
+ timezones0.put("America/Nome", tz);
+ timezones0.put("America/Yakutat", tz);
+ tz = new SimpleTimeZone(-9000 * 3600, "Pacific/Gambier");
+ timezones0.put("Pacific/Gambier", tz);
+ tz = new SimpleTimeZone
+ (-8000 * 3600, "PST",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("PST", tz);
+ timezones0.put("PST8PDT", tz);
+ timezones0.put("America/Dawson", tz);
+ timezones0.put("America/Los_Angeles", tz);
+ timezones0.put("America/Tijuana", tz);
+ timezones0.put("America/Vancouver", tz);
+ timezones0.put("America/Whitehorse", tz);
+ timezones0.put("US/Pacific-New", tz);
+ tz = new SimpleTimeZone(-8000 * 3600, "Pacific/Pitcairn");
+ timezones0.put("Pacific/Pitcairn", tz);
+ tz = new SimpleTimeZone
+ (-7000 * 3600, "MST",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("MST", tz);
+ timezones0.put("MST7MDT", tz);
+ timezones0.put("America/Boise", tz);
+ timezones0.put("America/Chihuahua", tz);
+ timezones0.put("America/Denver", tz);
+ timezones0.put("America/Edmonton", tz);
+ timezones0.put("America/Inuvik", tz);
+ timezones0.put("America/Mazatlan", tz);
+ timezones0.put("America/Shiprock", tz);
+ timezones0.put("America/Yellowknife", tz);
+ tz = new SimpleTimeZone(-7000 * 3600, "MST7");
+ timezones0.put("MST7", tz);
+ timezones0.put("PNT", tz);
+ timezones0.put("America/Dawson_Creek", tz);
+ timezones0.put("America/Hermosillo", tz);
+ timezones0.put("America/Phoenix", tz);
+ tz = new SimpleTimeZone
+ (-6000 * 3600, "CST",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("CST", tz);
+ timezones0.put("CST6CDT", tz);
+ timezones0.put("America/Cambridge_Bay", tz);
+ timezones0.put("America/Cancun", tz);
+ timezones0.put("America/Chicago", tz);
+ timezones0.put("America/Menominee", tz);
+ timezones0.put("America/Merida", tz);
+ timezones0.put("America/Mexico_City", tz);
+ timezones0.put("America/Monterrey", tz);
+ timezones0.put("America/Rainy_River", tz);
+ timezones0.put("America/Winnipeg", tz);
+ tz = new SimpleTimeZone(-6000 * 3600, "America/Belize");
+ timezones0.put("America/Belize", tz);
+ timezones0.put("America/Costa_Rica", tz);
+ timezones0.put("America/El_Salvador", tz);
+ timezones0.put("America/Guatemala", tz);
+ timezones0.put("America/Managua", tz);
+ timezones0.put("America/Regina", tz);
+ timezones0.put("America/Swift_Current", tz);
+ timezones0.put("America/Tegucigalpa", tz);
+ timezones0.put("Pacific/Galapagos", tz);
+ tz = new SimpleTimeZone
+ (-6000 * 3600, "Pacific/Easter",
+ Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
+ Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("Pacific/Easter", tz);
+ tz = new SimpleTimeZone
+ (-5000 * 3600, "America/Grand_Turk",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Grand_Turk", tz);
+ timezones0.put("America/Havana", tz);
+ tz = new SimpleTimeZone(-5000 * 3600, "EST5");
+ timezones0.put("EST5", tz);
+ timezones0.put("IET", tz);
+ timezones0.put("America/Bogota", tz);
+ timezones0.put("America/Cayman", tz);
+ timezones0.put("America/Eirunepe", tz);
+ timezones0.put("America/Guayaquil", tz);
+ timezones0.put("America/Indiana/Indianapolis", tz);
+ timezones0.put("America/Indiana/Knox", tz);
+ timezones0.put("America/Indiana/Marengo", tz);
+ timezones0.put("America/Indiana/Vevay", tz);
+ timezones0.put("America/Indianapolis", tz);
+ timezones0.put("America/Iqaluit", tz);
+ timezones0.put("America/Jamaica", tz);
+ timezones0.put("America/Lima", tz);
+ timezones0.put("America/Panama", tz);
+ timezones0.put("America/Pangnirtung", tz);
+ timezones0.put("America/Port-au-Prince", tz);
+ timezones0.put("America/Porto_Acre", tz);
+ timezones0.put("America/Rankin_Inlet", tz);
+ tz = new SimpleTimeZone
+ (-5000 * 3600, "EST",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("EST", tz);
+ timezones0.put("EST5EDT", tz);
+ timezones0.put("America/Detroit", tz);
+ timezones0.put("America/Kentucky/Louisville", tz);
+ timezones0.put("America/Kentucky/Monticello", tz);
+ timezones0.put("America/Louisville", tz);
+ timezones0.put("America/Montreal", tz);
+ timezones0.put("America/Nassau", tz);
+ timezones0.put("America/New_York", tz);
+ timezones0.put("America/Nipigon", tz);
+ timezones0.put("America/Thunder_Bay", tz);
+ tz = new SimpleTimeZone(-4000 * 3600, "PRT");
+ timezones0.put("PRT", tz);
+ timezones0.put("America/Anguilla", tz);
+ timezones0.put("America/Antigua", tz);
+ timezones0.put("America/Aruba", tz);
+ timezones0.put("America/Barbados", tz);
+ timezones0.put("America/Boa_Vista", tz);
+ timezones0.put("America/Caracas", tz);
+ timezones0.put("America/Curacao", tz);
+ timezones0.put("America/Dominica", tz);
+ timezones0.put("America/Grenada", tz);
+ timezones0.put("America/Guadeloupe", tz);
+ timezones0.put("America/Guyana", tz);
+ timezones0.put("America/La_Paz", tz);
+ timezones0.put("America/Manaus", tz);
+ timezones0.put("America/Martinique", tz);
+ timezones0.put("America/Montserrat", tz);
+ timezones0.put("America/Port_of_Spain", tz);
+ timezones0.put("America/Porto_Velho", tz);
+ timezones0.put("America/Puerto_Rico", tz);
+ timezones0.put("America/Santo_Domingo", tz);
+ timezones0.put("America/St_Kitts", tz);
+ timezones0.put("America/St_Lucia", tz);
+ timezones0.put("America/St_Thomas", tz);
+ timezones0.put("America/St_Vincent", tz);
+ timezones0.put("America/Tortola", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Asuncion",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Asuncion", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Cuiaba",
+ Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
+ Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Cuiaba", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Goose_Bay",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
+ timezones0.put("America/Goose_Bay", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Glace_Bay",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Glace_Bay", tz);
+ timezones0.put("America/Halifax", tz);
+ timezones0.put("America/Thule", tz);
+ timezones0.put("Atlantic/Bermuda", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Santiago",
+ Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
+ Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Santiago", tz);
+ timezones0.put("Antarctica/Palmer", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "Atlantic/Stanley",
+ Calendar.SEPTEMBER, 2, Calendar.SUNDAY, 0 * 3600,
+ Calendar.APRIL, 16, -Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("Atlantic/Stanley", tz);
+ tz = new SimpleTimeZone
+ (-3500 * 3600, "CNT",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
+ timezones0.put("CNT", tz);
+ timezones0.put("America/St_Johns", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Araguaina",
+ Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
+ Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Araguaina", tz);
+ timezones0.put("America/Sao_Paulo", tz);
+ tz = new SimpleTimeZone(-3000 * 3600, "AGT");
+ timezones0.put("AGT", tz);
+ timezones0.put("America/Belem", tz);
+ timezones0.put("America/Buenos_Aires", tz);
+ timezones0.put("America/Catamarca", tz);
+ timezones0.put("America/Cayenne", tz);
+ timezones0.put("America/Cordoba", tz);
+ timezones0.put("America/Fortaleza", tz);
+ timezones0.put("America/Jujuy", tz);
+ timezones0.put("America/Maceio", tz);
+ timezones0.put("America/Mendoza", tz);
+ timezones0.put("America/Montevideo", tz);
+ timezones0.put("America/Paramaribo", tz);
+ timezones0.put("America/Recife", tz);
+ timezones0.put("America/Rosario", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Godthab",
+ Calendar.MARCH, 30, -Calendar.SATURDAY, 22000 * 3600,
+ Calendar.OCTOBER, 30, -Calendar.SATURDAY, 22000 * 3600);
+ timezones0.put("America/Godthab", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Miquelon",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Miquelon", tz);
+ tz = new SimpleTimeZone(-2000 * 3600, "America/Noronha");
+ timezones0.put("America/Noronha", tz);
+ timezones0.put("Atlantic/South_Georgia", tz);
+ tz = new SimpleTimeZone
+ (-1000 * 3600, "America/Scoresbysund",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Scoresbysund", tz);
+ timezones0.put("Atlantic/Azores", tz);
+ tz = new SimpleTimeZone(-1000 * 3600, "Atlantic/Cape_Verde");
+ timezones0.put("Atlantic/Cape_Verde", tz);
+ timezones0.put("Atlantic/Jan_Mayen", tz);
+ tz = new SimpleTimeZone(0 * 3600, "GMT");
+ timezones0.put("GMT", tz);
+ timezones0.put("UTC", tz);
+ timezones0.put("Africa/Abidjan", tz);
+ timezones0.put("Africa/Accra", tz);
+ timezones0.put("Africa/Bamako", tz);
+ timezones0.put("Africa/Banjul", tz);
+ timezones0.put("Africa/Bissau", tz);
+ timezones0.put("Africa/Casablanca", tz);
+ timezones0.put("Africa/Conakry", tz);
+ timezones0.put("Africa/Dakar", tz);
+ timezones0.put("Africa/El_Aaiun", tz);
+ timezones0.put("Africa/Freetown", tz);
+ timezones0.put("Africa/Lome", tz);
+ timezones0.put("Africa/Monrovia", tz);
+ timezones0.put("Africa/Nouakchott", tz);
+ timezones0.put("Africa/Ouagadougou", tz);
+ timezones0.put("Africa/Sao_Tome", tz);
+ timezones0.put("Africa/Timbuktu", tz);
+ timezones0.put("Atlantic/Reykjavik", tz);
+ timezones0.put("Atlantic/St_Helena", tz);
+ timezones0.put("Europe/Belfast", tz);
+ timezones0.put("Europe/Dublin", tz);
+ timezones0.put("Europe/London", tz);
+ tz = new SimpleTimeZone
+ (0 * 3600, "WET",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
+ timezones0.put("WET", tz);
+ timezones0.put("Atlantic/Canary", tz);
+ timezones0.put("Atlantic/Faeroe", tz);
+ timezones0.put("Atlantic/Madeira", tz);
+ timezones0.put("Europe/Lisbon", tz);
+ tz = new SimpleTimeZone(1000 * 3600, "Africa/Algiers");
+ timezones0.put("Africa/Algiers", tz);
+ timezones0.put("Africa/Bangui", tz);
+ timezones0.put("Africa/Brazzaville", tz);
+ timezones0.put("Africa/Douala", tz);
+ timezones0.put("Africa/Kinshasa", tz);
+ timezones0.put("Africa/Lagos", tz);
+ timezones0.put("Africa/Libreville", tz);
+ timezones0.put("Africa/Luanda", tz);
+ timezones0.put("Africa/Malabo", tz);
+ timezones0.put("Africa/Ndjamena", tz);
+ timezones0.put("Africa/Niamey", tz);
+ timezones0.put("Africa/Porto-Novo", tz);
+ timezones0.put("Africa/Tunis", tz);
+ tz = new SimpleTimeZone
+ (1000 * 3600, "Africa/Windhoek",
+ Calendar.SEPTEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Africa/Windhoek", tz);
+ tz = new SimpleTimeZone
+ (1000 * 3600, "CET",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("CET", tz);
+ timezones0.put("ECT", tz);
+ timezones0.put("MET", tz);
+ timezones0.put("Africa/Ceuta", tz);
+ timezones0.put("Arctic/Longyearbyen", tz);
+ timezones0.put("Europe/Amsterdam", tz);
+ timezones0.put("Europe/Andorra", tz);
+ timezones0.put("Europe/Belgrade", tz);
+ timezones0.put("Europe/Berlin", tz);
+ timezones0.put("Europe/Bratislava", tz);
+ timezones0.put("Europe/Brussels", tz);
+ timezones0.put("Europe/Budapest", tz);
+ timezones0.put("Europe/Copenhagen", tz);
+ timezones0.put("Europe/Gibraltar", tz);
+ timezones0.put("Europe/Ljubljana", tz);
+ timezones0.put("Europe/Luxembourg", tz);
+ timezones0.put("Europe/Madrid", tz);
+ timezones0.put("Europe/Malta", tz);
+ timezones0.put("Europe/Monaco", tz);
+ timezones0.put("Europe/Oslo", tz);
+ timezones0.put("Europe/Paris", tz);
+ timezones0.put("Europe/Prague", tz);
+ timezones0.put("Europe/Rome", tz);
+ timezones0.put("Europe/San_Marino", tz);
+ timezones0.put("Europe/Sarajevo", tz);
+ timezones0.put("Europe/Skopje", tz);
+ timezones0.put("Europe/Stockholm", tz);
+ timezones0.put("Europe/Tirane", tz);
+ timezones0.put("Europe/Vaduz", tz);
+ timezones0.put("Europe/Vatican", tz);
+ timezones0.put("Europe/Vienna", tz);
+ timezones0.put("Europe/Warsaw", tz);
+ timezones0.put("Europe/Zagreb", tz);
+ timezones0.put("Europe/Zurich", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "ART",
+ Calendar.APRIL, -1, Calendar.FRIDAY, 0 * 3600,
+ Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 23000 * 3600);
+ timezones0.put("ART", tz);
+ timezones0.put("Africa/Cairo", tz);
+ tz = new SimpleTimeZone(2000 * 3600, "CAT");
+ timezones0.put("CAT", tz);
+ timezones0.put("Africa/Blantyre", tz);
+ timezones0.put("Africa/Bujumbura", tz);
+ timezones0.put("Africa/Gaborone", tz);
+ timezones0.put("Africa/Harare", tz);
+ timezones0.put("Africa/Johannesburg", tz);
+ timezones0.put("Africa/Kigali", tz);
+ timezones0.put("Africa/Lubumbashi", tz);
+ timezones0.put("Africa/Lusaka", tz);
+ timezones0.put("Africa/Maputo", tz);
+ timezones0.put("Africa/Maseru", tz);
+ timezones0.put("Africa/Mbabane", tz);
+ timezones0.put("Africa/Tripoli", tz);
+ timezones0.put("Europe/Riga", tz);
+ timezones0.put("Europe/Tallinn", tz);
+ timezones0.put("Europe/Vilnius", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Amman",
+ Calendar.MARCH, -1, Calendar.THURSDAY, 0 * 3600,
+ Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 0 * 3600);
+ timezones0.put("Asia/Amman", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Beirut",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("Asia/Beirut", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Damascus",
+ Calendar.APRIL, 1, 0, 0 * 3600,
+ Calendar.OCTOBER, 1, 0, 0 * 3600);
+ timezones0.put("Asia/Damascus", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Gaza",
+ Calendar.APRIL, 3, Calendar.FRIDAY, 0 * 3600,
+ Calendar.OCTOBER, 3, Calendar.FRIDAY, 0 * 3600);
+ timezones0.put("Asia/Gaza", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Jerusalem",
+ Calendar.APRIL, 1, 0, 1000 * 3600,
+ Calendar.OCTOBER, 1, 0, 1000 * 3600);
+ timezones0.put("Asia/Jerusalem", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "EET",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("EET", tz);
+ timezones0.put("Asia/Istanbul", tz);
+ timezones0.put("Asia/Nicosia", tz);
+ timezones0.put("Europe/Athens", tz);
+ timezones0.put("Europe/Bucharest", tz);
+ timezones0.put("Europe/Chisinau", tz);
+ timezones0.put("Europe/Helsinki", tz);
+ timezones0.put("Europe/Istanbul", tz);
+ timezones0.put("Europe/Kiev", tz);
+ timezones0.put("Europe/Nicosia", tz);
+ timezones0.put("Europe/Simferopol", tz);
+ timezones0.put("Europe/Sofia", tz);
+ timezones0.put("Europe/Uzhgorod", tz);
+ timezones0.put("Europe/Zaporozhye", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Europe/Kaliningrad",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Europe/Kaliningrad", tz);
+ timezones0.put("Europe/Minsk", tz);
+ tz = new SimpleTimeZone
+ (3000 * 3600, "Asia/Baghdad",
+ Calendar.APRIL, 1, 0, 3000 * 3600,
+ Calendar.OCTOBER, 1, 0, 3000 * 3600);
+ timezones0.put("Asia/Baghdad", tz);
+ tz = new SimpleTimeZone
+ (3000 * 3600, "Europe/Moscow",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Europe/Moscow", tz);
+ timezones0.put("Europe/Tiraspol", tz);
+ tz = new SimpleTimeZone(3000 * 3600, "EAT");
+ timezones0.put("EAT", tz);
+ timezones0.put("Africa/Addis_Ababa", tz);
+ timezones0.put("Africa/Asmera", tz);
+ timezones0.put("Africa/Dar_es_Salaam", tz);
+ timezones0.put("Africa/Djibouti", tz);
+ timezones0.put("Africa/Kampala", tz);
+ timezones0.put("Africa/Khartoum", tz);
+ timezones0.put("Africa/Mogadishu", tz);
+ timezones0.put("Africa/Nairobi", tz);
+ timezones0.put("Antarctica/Syowa", tz);
+ timezones0.put("Asia/Aden", tz);
+ timezones0.put("Asia/Bahrain", tz);
+ timezones0.put("Asia/Kuwait", tz);
+ timezones0.put("Asia/Qatar", tz);
+ timezones0.put("Asia/Riyadh", tz);
+ timezones0.put("Indian/Antananarivo", tz);
+ timezones0.put("Indian/Comoro", tz);
+ timezones0.put("Indian/Mayotte", tz);
+ tz = new SimpleTimeZone(3500 * 3600, "Asia/Tehran");
+ timezones0.put("Asia/Tehran", tz);
+ tz = new SimpleTimeZone
+ (4000 * 3600, "Asia/Baku",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
+ timezones0.put("Asia/Baku", tz);
+ tz = new SimpleTimeZone
+ (4000 * 3600, "Asia/Aqtau",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("Asia/Aqtau", tz);
+ timezones0.put("Asia/Tbilisi", tz);
+ tz = new SimpleTimeZone
+ (4000 * 3600, "Asia/Yerevan",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Yerevan", tz);
+ timezones0.put("Europe/Samara", tz);
+ tz = new SimpleTimeZone(4000 * 3600, "NET");
+ timezones0.put("NET", tz);
+ timezones0.put("Asia/Dubai", tz);
+ timezones0.put("Asia/Muscat", tz);
+ timezones0.put("Indian/Mahe", tz);
+ timezones0.put("Indian/Mauritius", tz);
+ timezones0.put("Indian/Reunion", tz);
+ tz = new SimpleTimeZone(4500 * 3600, "Asia/Kabul");
+ timezones0.put("Asia/Kabul", tz);
+ tz = new SimpleTimeZone
+ (5000 * 3600, "Asia/Aqtobe",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("Asia/Aqtobe", tz);
+ tz = new SimpleTimeZone
+ (5000 * 3600, "Asia/Bishkek",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2500 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2500 * 3600);
+ timezones0.put("Asia/Bishkek", tz);
+ tz = new SimpleTimeZone
+ (5000 * 3600, "Asia/Yekaterinburg",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Yekaterinburg", tz);
+ tz = new SimpleTimeZone(5000 * 3600, "PLT");
+ timezones0.put("PLT", tz);
+ timezones0.put("Asia/Ashgabat", tz);
+ timezones0.put("Asia/Dushanbe", tz);
+ timezones0.put("Asia/Karachi", tz);
+ timezones0.put("Asia/Samarkand", tz);
+ timezones0.put("Asia/Tashkent", tz);
+ timezones0.put("Indian/Chagos", tz);
+ timezones0.put("Indian/Kerguelen", tz);
+ timezones0.put("Indian/Maldives", tz);
+ tz = new SimpleTimeZone(5500 * 3600, "IST");
+ timezones0.put("IST", tz);
+ timezones0.put("Asia/Calcutta", tz);
+ tz = new SimpleTimeZone(5750 * 3600, "Asia/Katmandu");
+ timezones0.put("Asia/Katmandu", tz);
+ tz = new SimpleTimeZone(6000 * 3600, "BST");
+ timezones0.put("BST", tz);
+ timezones0.put("Antarctica/Mawson", tz);
+ timezones0.put("Asia/Colombo", tz);
+ timezones0.put("Asia/Dhaka", tz);
+ timezones0.put("Asia/Thimphu", tz);
+ tz = new SimpleTimeZone
+ (6000 * 3600, "Asia/Almaty",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("Asia/Almaty", tz);
+ tz = new SimpleTimeZone
+ (6000 * 3600, "Asia/Novosibirsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Novosibirsk", tz);
+ timezones0.put("Asia/Omsk", tz);
+ tz = new SimpleTimeZone(6500 * 3600, "Asia/Rangoon");
+ timezones0.put("Asia/Rangoon", tz);
+ timezones0.put("Indian/Cocos", tz);
+ tz = new SimpleTimeZone(7000 * 3600, "VST");
+ timezones0.put("VST", tz);
+ timezones0.put("Antarctica/Davis", tz);
+ timezones0.put("Asia/Bangkok", tz);
+ timezones0.put("Asia/Hovd", tz);
+ timezones0.put("Asia/Jakarta", tz);
+ timezones0.put("Asia/Phnom_Penh", tz);
+ timezones0.put("Asia/Saigon", tz);
+ timezones0.put("Asia/Vientiane", tz);
+ timezones0.put("Indian/Christmas", tz);
+ tz = new SimpleTimeZone
+ (7000 * 3600, "Asia/Krasnoyarsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Krasnoyarsk", tz);
+ tz = new SimpleTimeZone(8000 * 3600, "CTT");
+ timezones0.put("CTT", tz);
+ timezones0.put("Antarctica/Casey", tz);
+ timezones0.put("Asia/Brunei", tz);
+ timezones0.put("Asia/Chungking", tz);
+ timezones0.put("Asia/Harbin", tz);
+ timezones0.put("Asia/Hong_Kong", tz);
+ timezones0.put("Asia/Kashgar", tz);
+ timezones0.put("Asia/Kuala_Lumpur", tz);
+ timezones0.put("Asia/Kuching", tz);
+ timezones0.put("Asia/Macao", tz);
+ timezones0.put("Asia/Manila", tz);
+ timezones0.put("Asia/Shanghai", tz);
+ timezones0.put("Asia/Singapore", tz);
+ timezones0.put("Asia/Taipei", tz);
+ timezones0.put("Asia/Ujung_Pandang", tz);
+ timezones0.put("Asia/Ulaanbaatar", tz);
+ timezones0.put("Asia/Urumqi", tz);
+ timezones0.put("Australia/Perth", tz);
+ tz = new SimpleTimeZone
+ (8000 * 3600, "Asia/Irkutsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Irkutsk", tz);
+ tz = new SimpleTimeZone(9000 * 3600, "JST");
+ timezones0.put("JST", tz);
+ timezones0.put("Asia/Dili", tz);
+ timezones0.put("Asia/Jayapura", tz);
+ timezones0.put("Asia/Pyongyang", tz);
+ timezones0.put("Asia/Seoul", tz);
+ timezones0.put("Asia/Tokyo", tz);
+ timezones0.put("Pacific/Palau", tz);
+ tz = new SimpleTimeZone
+ (9000 * 3600, "Asia/Yakutsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Yakutsk", tz);
+ tz = new SimpleTimeZone
+ (9500 * 3600, "Australia/Adelaide",
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Australia/Adelaide", tz);
+ timezones0.put("Australia/Broken_Hill", tz);
+ tz = new SimpleTimeZone(9500 * 3600, "ACT");
+ timezones0.put("ACT", tz);
+ timezones0.put("Australia/Darwin", tz);
+ tz = new SimpleTimeZone(10000 * 3600, "Antarctica/DumontDUrville");
+ timezones0.put("Antarctica/DumontDUrville", tz);
+ timezones0.put("Australia/Brisbane", tz);
+ timezones0.put("Australia/Lindeman", tz);
+ timezones0.put("Pacific/Guam", tz);
+ timezones0.put("Pacific/Port_Moresby", tz);
+ timezones0.put("Pacific/Saipan", tz);
+ timezones0.put("Pacific/Truk", tz);
+ timezones0.put("Pacific/Yap", tz);
+ tz = new SimpleTimeZone
+ (10000 * 3600, "Asia/Vladivostok",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Vladivostok", tz);
+ tz = new SimpleTimeZone
+ (10000 * 3600, "Australia/Hobart",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Australia/Hobart", tz);
+ tz = new SimpleTimeZone
+ (10000 * 3600, "AET",
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("AET", tz);
+ timezones0.put("Australia/Melbourne", tz);
+ timezones0.put("Australia/Sydney", tz);
+ tz = new SimpleTimeZone
+ (10500 * 3600, "Australia/Lord_Howe",
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600, 500 * 3600);
+ timezones0.put("Australia/Lord_Howe", tz);
+ tz = new SimpleTimeZone
+ (11000 * 3600, "Asia/Magadan",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Magadan", tz);
+ tz = new SimpleTimeZone(11000 * 3600, "SST");
+ timezones0.put("SST", tz);
+ timezones0.put("Pacific/Efate", tz);
+ timezones0.put("Pacific/Guadalcanal", tz);
+ timezones0.put("Pacific/Kosrae", tz);
+ timezones0.put("Pacific/Noumea", tz);
+ timezones0.put("Pacific/Ponape", tz);
+ tz = new SimpleTimeZone(11500 * 3600, "Pacific/Norfolk");
+ timezones0.put("Pacific/Norfolk", tz);
+ tz = new SimpleTimeZone
+ (12000 * 3600, "NST",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, 3, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("NST", tz);
+ timezones0.put("Antarctica/McMurdo", tz);
+ timezones0.put("Antarctica/South_Pole", tz);
+ timezones0.put("Pacific/Auckland", tz);
+ tz = new SimpleTimeZone
+ (12000 * 3600, "Asia/Anadyr",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Asia/Anadyr", tz);
+ timezones0.put("Asia/Kamchatka", tz);
+ tz = new SimpleTimeZone(12000 * 3600, "Pacific/Fiji");
+ timezones0.put("Pacific/Fiji", tz);
+ timezones0.put("Pacific/Funafuti", tz);
+ timezones0.put("Pacific/Kwajalein", tz);
+ timezones0.put("Pacific/Majuro", tz);
+ timezones0.put("Pacific/Nauru", tz);
+ timezones0.put("Pacific/Tarawa", tz);
+ timezones0.put("Pacific/Wake", tz);
+ timezones0.put("Pacific/Wallis", tz);
+ tz = new SimpleTimeZone
+ (12750 * 3600, "Pacific/Chatham",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 2750 * 3600,
+ Calendar.MARCH, 3, Calendar.SUNDAY, 2750 * 3600);
+ timezones0.put("Pacific/Chatham", tz);
+ tz = new SimpleTimeZone(13000 * 3600, "Pacific/Enderbury");
+ timezones0.put("Pacific/Enderbury", tz);
+ timezones0.put("Pacific/Tongatapu", tz);
+ tz = new SimpleTimeZone(14000 * 3600, "Pacific/Kiritimati");
+ timezones0.put("Pacific/Kiritimati", tz);
+ }
+ return timezones0;
}
+
/* This method returns us a time zone id string which is in the
form <standard zone name><GMT offset><daylight time zone name>.
The GMT offset is in seconds, except where it is evenly divisible
@@ -986,7 +1000,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
public static TimeZone getTimeZone(String ID)
{
// First check timezones hash
- TimeZone tz = (TimeZone) timezones.get(ID);
+ TimeZone tz = (TimeZone) timezones().get(ID);
if (tz != null)
{
if (tz.getID().equals(ID))
@@ -999,7 +1013,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
// We also save the alias, so that we return the same
// object again if getTimeZone is called with the same
// alias.
- timezones.put(ID, tz);
+ timezones().put(ID, tz);
return tz;
}
@@ -1074,7 +1088,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
public static String[] getAvailableIDs(int rawOffset)
{
int count = 0;
- Iterator iter = timezones.entrySet().iterator();
+ Iterator iter = timezones().entrySet().iterator();
while (iter.hasNext())
{
// Don't iterate the values, since we want to count
@@ -1086,7 +1100,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
String[] ids = new String[count];
count = 0;
- iter = timezones.entrySet().iterator();
+ iter = timezones().entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
@@ -1103,7 +1117,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
public static String[] getAvailableIDs()
{
return (String[])
- timezones.keySet().toArray(new String[timezones.size()]);
+ timezones().keySet().toArray(new String[timezones().size()]);
}
/**
@@ -1114,12 +1128,12 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
*/
public static TimeZone getDefault()
{
- return defaultZone;
+ return defaultZone();
}
public static void setDefault(TimeZone zone)
{
- defaultZone = zone;
+ defaultZone0 = zone;
}
/**
diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java
index 38c4dc09f57..928cd9b5d50 100644
--- a/libjava/java/util/Timer.java
+++ b/libjava/java/util/Timer.java
@@ -601,7 +601,7 @@ public class Timer
* Tells the scheduler that the Timer task died
* so there will be no more new tasks scheduled.
*/
- protected void finalize()
+ protected void finalize() throws Throwable
{
queue.setNullOnEmpty(true);
}
diff --git a/libjava/java/util/WeakHashMap.java b/libjava/java/util/WeakHashMap.java
index 3431ac921e1..4cce821c5ff 100644
--- a/libjava/java/util/WeakHashMap.java
+++ b/libjava/java/util/WeakHashMap.java
@@ -1,6 +1,6 @@
/* WeakHashMap -- a hashtable that keeps only weak references
to its keys, allowing the virtual machine to reclaim them
- 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.
@@ -544,6 +544,8 @@ public class WeakHashMap extends AbstractMap implements Map
// Check loadFactor for NaN as well.
if (initialCapacity < 0 || ! (loadFactor > 0))
throw new IllegalArgumentException();
+ if (initialCapacity == 0)
+ initialCapacity = 1;
this.loadFactor = loadFactor;
threshold = (int) (initialCapacity * loadFactor);
theEntrySet = new WeakEntrySet();
diff --git a/libjava/java/util/logging/Handler.java b/libjava/java/util/logging/Handler.java
index 324532187d3..c0fb1cd653a 100644
--- a/libjava/java/util/logging/Handler.java
+++ b/libjava/java/util/logging/Handler.java
@@ -379,7 +379,7 @@ h.setFormatter(h.getFormatter());</pre>
*/
public boolean isLoggable(LogRecord record)
{
- if (record.getLevel().intValue() < level.intValue())
+ if (record.getLevel().intValue() <= level.intValue())
return false;
if (filter != null)
diff --git a/libjava/java/util/logging/LogManager.java b/libjava/java/util/logging/LogManager.java
index d6536e71d1c..83379bb4942 100644
--- a/libjava/java/util/logging/LogManager.java
+++ b/libjava/java/util/logging/LogManager.java
@@ -52,6 +52,7 @@ import java.util.Properties;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
+import java.util.StringTokenizer;
import java.lang.ref.WeakReference;
/**
@@ -167,6 +168,7 @@ public class LogManager
* the order in which classes are initialized.
*/
Logger.getLogger("global").setParent(rootLogger);
+ Logger.getLogger("global").setUseParentHandlers(true);
}
@@ -520,7 +522,7 @@ public class LogManager
public synchronized void readConfiguration(InputStream inputStream)
throws IOException, SecurityException
- {
+ {
Properties newProperties;
Enumeration keys;
@@ -532,12 +534,36 @@ public class LogManager
while (keys.hasMoreElements())
{
- String key = (String) keys.nextElement();
+ String key = ((String) keys.nextElement()).trim();
String value = newProperties.getProperty(key);
-
+
if (value == null)
continue;
-
+
+ value = value.trim();
+
+ if("handlers".equals(key))
+ {
+ StringTokenizer tokenizer = new StringTokenizer(value);
+ while(tokenizer.hasMoreTokens())
+ {
+ String handlerName = tokenizer.nextToken();
+ try
+ {
+ Class handlerClass = Class.forName(handlerName);
+ getLogger("").addHandler((Handler)handlerClass.newInstance());
+ }
+ catch (ClassCastException ex)
+ {
+ System.err.println("[LogManager] class " + handlerName + " is not subclass of java.util.logging.Handler");
+ }
+ catch (Exception ex)
+ {
+ //System.out.println("[LogManager.readConfiguration]"+ex);
+ }
+ }
+ }
+
if (key.endsWith(".level"))
{
String loggerName = key.substring(0, key.length() - 6);
@@ -550,6 +576,7 @@ public class LogManager
}
catch (Exception _)
{
+ //System.out.println("[LogManager.readConfiguration] "+_);
}
continue;
}
diff --git a/libjava/java/util/logging/Logger.java b/libjava/java/util/logging/Logger.java
index e142e201f70..3c194785c5f 100644
--- a/libjava/java/util/logging/Logger.java
+++ b/libjava/java/util/logging/Logger.java
@@ -589,9 +589,10 @@ public class Logger
String message,
Object param)
{
+ StackTraceElement caller = getCallerStackFrame();
logp(level,
- /* sourceClass*/ null,
- /* sourceMethod */ null,
+ caller.getClassName(),
+ caller.getMethodName(),
message,
param);
}
@@ -601,9 +602,10 @@ public class Logger
String message,
Object[] params)
{
+ StackTraceElement caller = getCallerStackFrame();
logp(level,
- /* sourceClass*/ null,
- /* sourceMethod */ null,
+ caller.getClassName(),
+ caller.getMethodName(),
message,
params);
}
@@ -613,9 +615,10 @@ public class Logger
String message,
Throwable thrown)
{
+ StackTraceElement caller = getCallerStackFrame();
logp(level,
- /* sourceClass*/ null,
- /* sourceMethod */ null,
+ caller.getClassName(),
+ caller.getMethodName(),
message,
thrown);
}
@@ -1164,4 +1167,23 @@ public class Logger
this.parent = parent;
}
+
+ /**
+ * Gets the StackTraceElement of the first class that is not this class.
+ * That should be the initial caller of a logging method.
+ * @return caller of the initial looging method
+ */
+ private StackTraceElement getCallerStackFrame()
+ {
+ Throwable t = new Throwable();
+ StackTraceElement[] stackTrace = t.getStackTrace();
+ int index = 0;
+ // skip to stackentries until this class
+ while(!stackTrace[index].getClassName().equals(getClass().getName())){index++;}
+ // skip the stackentries of this class
+ while(stackTrace[index].getClassName().equals(getClass().getName())){index++;}
+
+ return stackTrace[index];
+ }
+
}
diff --git a/libjava/java/util/logging/SimpleFormatter.java b/libjava/java/util/logging/SimpleFormatter.java
index 8a95638b7b8..aece9d40596 100644
--- a/libjava/java/util/logging/SimpleFormatter.java
+++ b/libjava/java/util/logging/SimpleFormatter.java
@@ -106,7 +106,9 @@ public class SimpleFormatter
buf.append(dateFormat.format(new Date(record.getMillis())));
buf.append(' ');
- buf.append(record.getLoggerName());
+ buf.append(record.getSourceClassName());
+ buf.append(' ');
+ buf.append(record.getSourceMethodName());
buf.append(lineSep);
buf.append(record.getLevel());
diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java
index 06238cea176..b6bc5414d08 100644
--- a/libjava/java/util/zip/ZipFile.java
+++ b/libjava/java/util/zip/ZipFile.java
@@ -308,7 +308,7 @@ public class ZipFile implements ZipConstants
*/
protected void finalize() throws IOException
{
- if (!closed) close();
+ if (!closed && raf != null) close();
}
/**
diff --git a/libjava/javax/naming/CompoundName.java b/libjava/javax/naming/CompoundName.java
index 20b6cc51cb3..20396398d10 100644
--- a/libjava/javax/naming/CompoundName.java
+++ b/libjava/javax/naming/CompoundName.java
@@ -142,13 +142,17 @@ public class CompoundName implements Name, Cloneable, Serializable
// Otherwise, fall through.
}
// Quotes are only special at the start of a component.
- else if (new_element.length () == 0 && special == beginQuote)
+ else if (new_element.length () == 0
+ && special == beginQuote
+ && beginQuote != null)
{
quote = endQuote;
i += special.length ();
continue;
}
- else if (new_element.length () == 0 && special == beginQuote2)
+ else if (new_element.length () == 0
+ && special == beginQuote2
+ && beginQuote2 != null)
{
quote = endQuote2;
i += special.length ();
diff --git a/libjava/javax/naming/InitialContext.java b/libjava/javax/naming/InitialContext.java
index 62837ab9ee5..715f30ad5cd 100644
--- a/libjava/javax/naming/InitialContext.java
+++ b/libjava/javax/naming/InitialContext.java
@@ -1,5 +1,5 @@
/* InitialContext.java --
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,170 +57,176 @@ public class InitialContext implements Context
public InitialContext (Hashtable environment)
throws NamingException
- {
- init (environment);
- }
+ {
+ init (environment);
+ }
protected InitialContext (boolean lazy)
throws NamingException
- {
- if (! lazy)
- init (null);
- }
+ {
+ if (! lazy)
+ init (null);
+ }
public InitialContext ()
throws NamingException
- {
- init (null);
- }
+ {
+ init (null);
+ }
/** @since 1.3 */
protected void init (Hashtable environment)
throws NamingException
- {
- // FIXME: Is this enough?
- final String[] properties = {
- Context.DNS_URL,
- Context.INITIAL_CONTEXT_FACTORY,
- Context.OBJECT_FACTORIES,
- Context.PROVIDER_URL,
- Context.STATE_FACTORIES,
- Context.URL_PKG_PREFIXES,
- };
+ {
+ // FIXME: Is this enough?
+ final String[] properties = {
+ Context.DNS_URL,
+ Context.INITIAL_CONTEXT_FACTORY,
+ Context.OBJECT_FACTORIES,
+ Context.PROVIDER_URL,
+ Context.STATE_FACTORIES,
+ Context.URL_PKG_PREFIXES,
+ };
- // Create myProps, cloning environment if needed.
- if (environment != null)
- myProps = (Hashtable) environment.clone ();
- else
- myProps = new Hashtable ();
+ // Create myProps, cloning environment if needed.
+ if (environment != null)
+ myProps = (Hashtable) environment.clone ();
+ else
+ myProps = new Hashtable ();
- Applet napplet = (Applet) myProps.get (Context.APPLET);
+ Applet napplet = (Applet) myProps.get (Context.APPLET);
- for (int i = properties.length - 1; i >= 0; i--)
- {
- Object o = myProps.get (properties[i]);
+ for (int i = properties.length - 1; i >= 0; i--)
+ {
+ Object o = myProps.get (properties[i]);
- if (o == null)
- {
- if (napplet != null)
- o = napplet.getParameter (properties[i]);
- if (o == null)
- o = System.getProperty (properties[i]);
- if (o != null)
- myProps.put (properties[i], o);
- }
- }
-
- try
- {
- Enumeration ep = Thread.currentThread().getContextClassLoader().getResources("jndi.naming");
- while (ep.hasMoreElements ())
- {
- URL url = (URL) ep.nextElement ();
- Properties p = new Properties ();
+ if (o == null)
+ {
+ if (napplet != null)
+ o = napplet.getParameter (properties[i]);
+ if (o == null)
+ o = System.getProperty (properties[i]);
+ if (o != null)
+ myProps.put (properties[i], o);
+ }
+ }
+
+ try
+ {
+ Enumeration ep = Thread.currentThread().getContextClassLoader().getResources("jndi.naming");
+ while (ep.hasMoreElements ())
+ {
+ URL url = (URL) ep.nextElement ();
+ Properties p = new Properties ();
- try {
- InputStream is = url.openStream ();
- p.load (is);
- is.close ();
- } catch (IOException e) {}
-
- merge (myProps, p);
- }
- }
- catch (IOException e) {}
-
- String home = System.getProperty("gnu.classpath.home.url");
- if (home != null)
- {
- String url = home + "/jndi.properties";
- Properties p = new Properties ();
+ try
+ {
+ InputStream is = url.openStream ();
+ p.load (is);
+ is.close ();
+ }
+ catch (IOException e)
+ {
+ }
+
+ merge (myProps, p);
+ }
+ }
+ catch (IOException e)
+ {
+ }
+
+ String home = System.getProperty("gnu.classpath.home.url");
+ if (home != null)
+ {
+ String url = home + "/jndi.properties";
+ Properties p = new Properties ();
- try
- {
- InputStream is = new URL(url).openStream();
- p.load (is);
- is.close ();
- }
- catch (IOException e)
- {
- // Ignore.
- }
-
- merge (myProps, p);
- }
- }
+ try
+ {
+ InputStream is = new URL(url).openStream();
+ p.load (is);
+ is.close ();
+ }
+ catch (IOException e)
+ {
+ // Ignore.
+ }
+
+ merge (myProps, p);
+ }
+ }
// FIXME: Is this enough?
private static final String[] colon_list =
- {
- Context.OBJECT_FACTORIES,
- Context.URL_PKG_PREFIXES,
- Context.STATE_FACTORIES
- };
+ {
+ Context.OBJECT_FACTORIES,
+ Context.URL_PKG_PREFIXES,
+ Context.STATE_FACTORIES
+ };
private static void merge (Hashtable h1, Hashtable h2)
- {
- Enumeration e2 = h2.keys();
+ {
+ Enumeration e2 = h2.keys();
- while (e2.hasMoreElements())
- {
- String key2 = (String) e2.nextElement();
- Object value1 = h1.get(key2);
- if (value1 == null)
- h1.put(key2, h2.get(key2));
- else if (key2.compareTo(colon_list[0]) == 0
- || key2.compareTo(colon_list[1]) == 0
- || key2.compareTo(colon_list[2]) == 0
- || key2.compareTo(colon_list[3]) == 0)
- {
- String value2 = (String) h2.get(key2);
- h1.put(key2, (String) value1 + ":" + value2);
- }
- }
- }
+ while (e2.hasMoreElements())
+ {
+ String key2 = (String) e2.nextElement();
+ Object value1 = h1.get(key2);
+ if (value1 == null)
+ h1.put(key2, h2.get(key2));
+ else if (key2.compareTo(colon_list[0]) == 0
+ || key2.compareTo(colon_list[1]) == 0
+ || key2.compareTo(colon_list[2]) == 0
+ || key2.compareTo(colon_list[3]) == 0)
+ {
+ String value2 = (String) h2.get(key2);
+ h1.put(key2, (String) value1 + ":" + value2);
+ }
+ }
+ }
protected Context getDefaultInitCtx () throws NamingException
- {
- if (! gotDefault)
- {
- defaultInitCtx = NamingManager.getInitialContext (myProps);
- gotDefault = true;
- }
- return defaultInitCtx;
- }
+ {
+ if (! gotDefault)
+ {
+ defaultInitCtx = NamingManager.getInitialContext (myProps);
+ gotDefault = true;
+ }
+ return defaultInitCtx;
+ }
protected Context getURLOrDefaultInitCtx (Name name)
- throws NamingException
- {
- if (name.size () > 0)
- return getURLOrDefaultInitCtx (name.get (0));
- else
- return getDefaultInitCtx ();
- }
+ throws NamingException
+ {
+ if (name.size () > 0)
+ return getURLOrDefaultInitCtx (name.get (0));
+ else
+ return getDefaultInitCtx ();
+ }
protected Context getURLOrDefaultInitCtx (String name)
- throws NamingException
- {
- String scheme = null;
-
- if (NamingManager.hasInitialContextFactoryBuilder())
- return getDefaultInitCtx();
- int colon = name.indexOf(':');
- int slash = name.indexOf('/');
- if (colon > 0 && (slash == -1 || colon < slash))
- scheme = name.substring(0, colon);
- if (scheme != null)
- {
- Context context =
- NamingManager.getURLContext(scheme, myProps);
- if (context != null)
- return context;
- }
-
+ throws NamingException
+ {
+ String scheme = null;
+
+ if (NamingManager.hasInitialContextFactoryBuilder())
return getDefaultInitCtx();
- }
+ int colon = name.indexOf(':');
+ int slash = name.indexOf('/');
+ if (colon > 0 && (slash == -1 || colon < slash))
+ scheme = name.substring(0, colon);
+ if (scheme != null)
+ {
+ Context context =
+ NamingManager.getURLContext(scheme, myProps);
+ if (context != null)
+ return context;
+ }
+
+ return getDefaultInitCtx();
+ }
public void bind (Name name, Object obj) throws NamingException
{
@@ -338,13 +344,13 @@ public class InitialContext implements Context
}
public String composeName (String name,
- String prefix) throws NamingException
+ String prefix) throws NamingException
{
return getURLOrDefaultInitCtx (name).composeName (name, prefix);
}
public Object addToEnvironment (String propName,
- Object propVal) throws NamingException
+ Object propVal) throws NamingException
{
return myProps.put (propName, propVal);
}
diff --git a/libjava/javax/naming/spi/NamingManager.java b/libjava/javax/naming/spi/NamingManager.java
index 6d02f9d2cba..65ce2d23c23 100644
--- a/libjava/javax/naming/spi/NamingManager.java
+++ b/libjava/javax/naming/spi/NamingManager.java
@@ -83,13 +83,17 @@ public class NamingManager
try
{
- icf = (InitialContextFactory) Class.forName (java_naming_factory_initial).newInstance ();
+ icf = (InitialContextFactory)Class.forName
+ (java_naming_factory_initial, true,
+ Thread.currentThread().getContextClassLoader())
+ .newInstance ();
}
catch (Exception exception)
{
NoInitialContextException e
- = new NoInitialContextException ("Can't load InitialContextFactory class: "
- + java_naming_factory_initial);
+ = new NoInitialContextException
+ ("Can't load InitialContextFactory class: "
+ + java_naming_factory_initial);
e.setRootCause(exception);
throw e;
}
@@ -125,7 +129,9 @@ public class NamingManager
String aTry = tokens.nextToken ();
try
{
- Class factoryClass = Class.forName (aTry + "." + scheme);
+ Class factoryClass = Class.forName (aTry + "." + scheme,
+ true,
+ Thread.currentThread().getContextClassLoader());
ObjectFactory factory =
(ObjectFactory) factoryClass.newInstance ();
Object obj = factory.getObjectInstance (refInfo, name,
@@ -227,7 +233,9 @@ public class NamingManager
if (fClass != null)
{
// Exceptions here are passed to the caller.
- Class k = Class.forName (fClass);
+ Class k = Class.forName (fClass,
+ true,
+ Thread.currentThread().getContextClassLoader());
factory = (ObjectFactory) k.newInstance ();
}
else
@@ -271,7 +279,9 @@ public class NamingManager
while (tokens.hasMoreTokens ())
{
String klassName = tokens.nextToken ();
- Class k = Class.forName (klassName);
+ Class k = Class.forName (klassName,
+ true,
+ Thread.currentThread().getContextClassLoader());
factory = (ObjectFactory) k.newInstance ();
Object obj = factory.getObjectInstance (refInfo, name,
nameCtx, environment);
@@ -337,7 +347,9 @@ public class NamingManager
String klassName = tokens.nextToken ();
try
{
- Class k = Class.forName (klassName);
+ Class k = Class.forName (klassName,
+ true,
+ Thread.currentThread().getContextClassLoader());
StateFactory factory = (StateFactory) k.newInstance ();
Object o = factory.getStateToBind (obj, name, nameCtx,
environment);
diff --git a/libjava/javax/swing/AbstractButton.java b/libjava/javax/swing/AbstractButton.java
index 951650dbdbd..d44d9775f3a 100644
--- a/libjava/javax/swing/AbstractButton.java
+++ b/libjava/javax/swing/AbstractButton.java
@@ -71,740 +71,731 @@ import javax.swing.text.AttributeSet;
public abstract class AbstractButton extends JComponent
implements ItemSelectable, SwingConstants
{
- Icon default_icon, pressed_button, disabled_button,
- selected_button, disabled_selected_button, current_icon;
- String text;
-
- int vert_align = CENTER;
- int hori_align = CENTER;
- int hori_text_pos = CENTER;
- int vert_text_pos = CENTER;
-
- boolean paint_border = true, paint_focus;
- Action action_taken;
- ButtonModel model;
- Insets margin;
-
-
- public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted";
-
- /**
- * AccessibleAbstractButton
- */
- protected abstract class AccessibleAbstractButton
- extends AccessibleJComponent
- implements AccessibleAction, AccessibleValue, AccessibleText {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor AccessibleAbstractButton
- * @param component TODO
- */
- protected AccessibleAbstractButton(AbstractButton component) {
- super(component);
- // TODO
- } // AccessibleAbstractButton()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getAccessibleStateSet
- * @returns AccessibleStateSet
- */
- public AccessibleStateSet getAccessibleStateSet() {
- return null; // TODO
- } // getAccessibleStateSet()
-
- /**
- * getAccessibleName
- * @returns String
- */
- public String getAccessibleName() {
- return null; // TODO
- } // getAccessibleName()
-
- /**
- * getAccessibleIcon
- * @returns AccessibleIcon[]
- */
- public AccessibleIcon[] getAccessibleIcon() {
- return null; // TODO
- } // getAccessibleIcon()
-
- /**
- * getAccessibleRelationSet
- * @returns AccessibleRelationSet
- */
- public AccessibleRelationSet getAccessibleRelationSet() {
- return null; // TODO
- } // getAccessibleRelationSet()
-
- /**
- * getAccessibleAction
- * @returns AccessibleAction
- */
- public AccessibleAction getAccessibleAction() {
- return null; // TODO
- } // getAccessibleAction()
-
- /**
- * getAccessibleValue
- * @returns AccessibleValue
- */
- public AccessibleValue getAccessibleValue() {
- return null; // TODO
- } // getAccessibleValue()
-
- /**
- * getAccessibleActionCount
- * @returns int
- */
- public int getAccessibleActionCount() {
- return 0; // TODO
- } // getAccessibleActionCount()
-
- /**
- * getAccessibleActionDescription
- * @param value0 TODO
- * @returns String
- */
- public String getAccessibleActionDescription(int value0) {
- return null; // TODO
- } // getAccessibleActionDescription()
-
- /**
- * doAccessibleAction
- * @param value0 TODO
- * @returns boolean
- */
- public boolean doAccessibleAction(int value0) {
- return false; // TODO
- } // doAccessibleAction()
-
- /**
- * getCurrentAccessibleValue
- * @returns Number
- */
- public Number getCurrentAccessibleValue() {
- return null; // TODO
- } // getCurrentAccessibleValue()
-
- /**
- * setCurrentAccessibleValue
- * @param value0 TODO
- * @returns boolean
- */
- public boolean setCurrentAccessibleValue(Number value0) {
- return false; // TODO
- } // setCurrentAccessibleValue()
-
- /**
- * getMinimumAccessibleValue
- * @returns Number
- */
- public Number getMinimumAccessibleValue() {
- return null; // TODO
- } // getMinimumAccessibleValue()
-
- /**
- * getMaximumAccessibleValue
- * @returns Number
- */
- public Number getMaximumAccessibleValue() {
- return null; // TODO
- } // getMaximumAccessibleValue()
-
- /**
- * getAccessibleText
- * @returns AccessibleText
- */
- public AccessibleText getAccessibleText() {
- return null; // TODO
- } // getAccessibleText()
-
- /**
- * getIndexAtPoint
- * @param value0 TODO
- * @returns int
- */
- public int getIndexAtPoint(Point value0) {
- return 0; // TODO
- } // getIndexAtPoint()
-
- /**
- * getCharacterBounds
- * @param value0 TODO
- * @returns Rectangle
- */
- public Rectangle getCharacterBounds(int value0) {
- return null; // TODO
- } // getCharacterBounds()
-
- /**
- * getCharCount
- * @returns int
- */
- public int getCharCount() {
- return 0; // TODO
- } // getCharCount()
-
- /**
- * getCaretPosition
- * @returns int
- */
- public int getCaretPosition() {
- return 0; // TODO
- } // getCaretPosition()
-
- /**
- * getAtIndex
- * @param value0 TODO
- * @param value1 TODO
- * @returns String
- */
- public String getAtIndex(int value0, int value1) {
- return null; // TODO
- } // getAtIndex()
-
- /**
- * getAfterIndex
- * @param value0 TODO
- * @param value1 TODO
- * @returns String
- */
- public String getAfterIndex(int value0, int value1) {
- return null; // TODO
- } // getAfterIndex()
-
- /**
- * getBeforeIndex
- * @param value0 TODO
- * @param value1 TODO
- * @returns String
- */
- public String getBeforeIndex(int value0, int value1) {
- return null; // TODO
- } // getBeforeIndex()
-
- /**
- * getCharacterAttribute
- * @param value0 TODO
- * @returns AttributeSet
- */
- public AttributeSet getCharacterAttribute(int value0) {
- return null; // TODO
- } // getCharacterAttribute()
-
- /**
- * getSelectionStart
- * @returns int
- */
- public int getSelectionStart() {
- return 0; // TODO
- } // getSelectionStart()
-
- /**
- * getSelectionEnd
- * @returns int
- */
- public int getSelectionEnd() {
- return 0; // TODO
- } // getSelectionEnd()
-
- /**
- * getSelectedText
- * @returns String
- */
- public String getSelectedText() {
- return null; // TODO
- } // getSelectedText()
-
- /**
- * getTextRectangle
- * @returns Rectangle
- */
- private Rectangle getTextRectangle() {
- return null; // TODO
- } // getTextRectangle()
-
-
- } // AccessibleAbstractButton
-
-
- static private class JFocusListener implements FocusListener
- {
- AbstractButton c;
-
- JFocusListener(AbstractButton c)
- {
- this.c = c;
- }
-
- public void focusLost(FocusEvent event)
- {
- c.getModel().setArmed(false);
-
- System.out.println("LOST FOCUS");
- if (c.isFocusPainted())
- {
- c.repaint();
- }
- }
- public void focusGained(FocusEvent event)
- {
- System.out.println("GAIN FOCUS");
- }
- }
-
-
- /**********************************************
- *
- *
- * Constructors
- *
- *
- ****************/
-
- AbstractButton()
- {
- this("",null);
- }
-
- AbstractButton(String text,
- Icon icon)
- {
- this.text = text;
- setIcon(icon);
-
- setAlignmentX(LEFT_ALIGNMENT);
- setAlignmentY(CENTER_ALIGNMENT);
-
- addFocusListener( new JFocusListener(this) );
-
- setModel(new DefaultButtonModel(this));
-
- updateUI(); // get a proper ui
- }
-
-
- /**********************************************
- *
- *
- * Actions etc
- *
- *
- ****************/
-
- public ButtonModel getModel()
- { return model; }
- public void setModel(ButtonModel newModel)
- { model = newModel; }
-
- public String getActionCommand()
- { return getModel().getActionCommand(); }
- public void setActionCommand(String aCommand)
- { getModel().setActionCommand(aCommand); }
-
- public void addActionListener(ActionListener l)
- { getModel().addActionListener(l); }
- public void removeActionListener(ActionListener l)
- { getModel().removeActionListener(l); }
-
- public void addChangeListener(ChangeListener l)
- { getModel().addChangeListener(l); }
- public void removeChangeListener(ChangeListener l)
- { getModel().removeChangeListener(l); }
-
- public void addItemListener(ItemListener l)
- { getModel().addItemListener(l); }
- public void removeItemListener(ItemListener l)
- { getModel().removeItemListener(l); }
-
- public int getHorizontalAlignment()
- { return hori_align; }
- public int getHorizontalTextPosition()
- { return hori_text_pos; }
- public int getVerticalAlignment()
- { return vert_align; }
- public int getVerticalTextPosition()
- { return vert_text_pos; }
-
-
- protected void fireItemStateChanged(ItemEvent event)
- { getModel().fireItemStateChanged(event); }
- protected void fireStateChanged(ChangeEvent event)
- { getModel().fireStateChanged(event); }
- protected void fireActionPerformed(ActionEvent event)
- { getModel().fireActionPerformed(event); }
-
- public void setVerticalAlignment(int alignment)
- { vert_align = alignment; }
- public void setHorizontalAlignment(int alignment)
- { hori_align = alignment; }
- public void setVerticalTextPosition(int textPosition)
- { vert_text_pos = textPosition; }
- public void setHorizontalTextPosition(int textPosition)
- { hori_text_pos = textPosition; }
-
- public int getMnemonic()
- { return getModel().getMnemonic(); }
- public void setMnemonic(char mne)
- { getModel().setMnemonic(mne); }
- public void setMnemonic(int mne)
- { getModel().setMnemonic(mne); }
-
- public void setRolloverEnabled(boolean b)
- { getModel().setRollover(b); }
- public boolean isRolloverEnabled()
- { return getModel().isRollover(); }
-
-
- public boolean isBorderPainted()
- { return paint_border; }
- public void setBorderPainted(boolean b)
- {
- if (b != paint_border)
- {
- paint_border = b;
- revalidate();
- repaint();
- }
- }
-
- public Action getAction()
- { return action_taken; }
- public void setAction(Action a)
- {
- action_taken = a;
- revalidate();
- repaint();
- }
-
- public void setSelected(boolean b)
- { getModel().setSelected(b); }
- public boolean isSelected()
- { return getModel().isSelected(); }
-
-
- public Icon getIcon()
- { return default_icon; }
- public void setIcon(Icon defaultIcon)
- {
- if (default_icon == defaultIcon)
- return;
-
- default_icon = defaultIcon;
- if (default_icon != null)
- {
- // XXX FIXME - icons do not know their parent
-// default_icon.setParent(this);
- }
- revalidate();
- repaint();
- }
-
- public String getText()
- { return text; }
- public void setLabel(String label)
- { setText(label); }
- public String getLabel()
- { return getText(); }
- public void setText(String text)
- {
- this.text = text;
- revalidate();
- repaint();
- }
-
-
- public Insets getMargin()
- { return margin; }
- public void setMargin(Insets m)
- {
- margin = m;
- revalidate();
- repaint();
- }
-
- public void setEnabled(boolean b)
- {
- super.setEnabled(b);
- getModel().setEnabled(b);
- repaint();
- }
-
- public Icon getPressedIcon()
- { return pressed_button; }
- public void setPressedIcon(Icon pressedIcon)
- {
- pressed_button = pressedIcon;
- revalidate();
- repaint();
- }
-
-
- public Icon getDisabledIcon()
- { return disabled_button; }
- public void setDisabledIcon(Icon disabledIcon)
- {
- disabled_button = disabledIcon;
- revalidate();
- repaint();
- }
-
- public boolean isFocusPainted()
- { return paint_focus; }
- public void setFocusPainted(boolean b)
- {
- boolean old = paint_focus;
- paint_focus = b;
-
- firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY,
- old,
- b);
- if (hasFocus())
- {
- revalidate();
- repaint();
- }
- }
-
- public boolean isFocusTraversable()
- {
- //Identifies whether or not this component can receive the focus.
- return true;
- }
-
-
- protected int checkHorizontalKey(int key, String exception)
- {
- // Verify that key is a legal value for the horizontalAlignment properties.
- return 0;
- }
- protected int checkVerticalKey(int key, String exception)
- {
- // Ensures that the key is a valid.
- return 0;
- }
- protected void configurePropertiesFromAction(Action a)
- {
- //Factory method which sets the ActionEvent source's properties according to values from the Action instance.
- }
-
- protected ActionListener createActionListener()
- {
- return new ActionListener()
- {
- public void actionPerformed(ActionEvent e) { }
- };
- }
-
- protected PropertyChangeListener createActionPropertyChangeListener(Action a)
- {
- //Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
- return null;
- }
- protected ChangeListener createChangeListener()
- {
- // Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation.
- return new ChangeListener()
- {
- public void stateChanged(ChangeEvent e) { }
- };
- }
-
- protected ItemListener createItemListener()
- {
- return new ItemListener()
- {
- public void itemStateChanged(ItemEvent e) { }
- };
- }
-
-
- public void doClick()
- {
- doClick(100);
- }
- public void doClick(int pressTime)
- {
- //Toolkit.tlkBeep ();
- //Programmatically perform a "click".
- }
-
-
- public Icon getDisabledSelectedIcon()
- {
- //Returns the icon used by the button when it's disabled and selected.
- return disabled_selected_button;
- }
-
-
- public Icon getRolloverIcon()
- {
- // Returns the rollover icon for the button.
- return null;
- }
-
- Icon getRolloverSelectedIcon()
- {
- // Returns the rollover selection icon for the button.
- return null;
- }
- Icon getSelectedIcon()
- {
- // Returns the selected icon for the button.
- return selected_button;
- }
-
-
- public Object[] getSelectedObjects()
- {
- //Returns an array (length 1) containing the label or null if the button is not selected.
- return null;
- }
-
-
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
- {
- //This is overridden to return false if the current Icon's Image is not equal to the passed in Image img.
- return current_icon == img;
- }
-
- public boolean isContentAreaFilled()
- {
- // Checks whether the "content area" of the button should be filled.
- return false;
- }
-
-
-
- protected void paintBorder(Graphics g)
- {
- // Paint the button's border if BorderPainted property is true.
- if (isBorderPainted())
- super.paintBorder(g);
- }
- protected String paramString()
- {
- // Returns a string representation of this AbstractButton.
- return "AbstractButton";
- }
-
-
- public void setContentAreaFilled(boolean b)
- {
- //Sets whether the button should paint the content area or leave it transparent.
- }
-
-
- public void setDisabledSelectedIcon(Icon disabledSelectedIcon)
- {
- // Sets the disabled selection icon for the button.
- }
-
- public void setRolloverIcon(Icon rolloverIcon)
- {
- // Sets the rollover icon for the button.
- }
- public void setRolloverSelectedIcon(Icon rolloverSelectedIcon)
- {
- // Sets the rollover selected icon for the button.
- }
-
-
- public void setSelectedIcon(Icon selectedIcon)
- {
- // Sets the selected icon for the button.
- }
-
-
- public void setUI(ButtonUI ui)
- { // Sets the L&F object that renders this component.
- super.setUI(ui);
- }
-
- public ButtonUI getUI()
- {
- //Returns the L&F object that renders this component.
- return (ButtonUI) ui;
- }
-
- public void updateUI()
- {
- /*
- // Notification from the UIFactory that the L&F has changed.
- if (getUI() == null)
- {
- setUI(getUI());
- }
- */
- }
-
- protected void processActionEvent(ActionEvent e)
- {
- System.out.println("PROCESS-ACTION-EVENT: " + e);
- }
-
-
- protected void processMouseEvent(MouseEvent e)
- {
- // System.out.println("PROCESS-MOUSE-EVENT: " + e + ", PRESSED-IN-MODEL="+getModel().isPressed());
-
- switch (e.getID())
- {
- case MouseEvent.MOUSE_MOVED:
- {
- break;
- }
- case MouseEvent.MOUSE_PRESSED:
- {
- if (! isEnabled())
- {
- System.out.println("button not enabled, ignoring press");
- }
- else
- {
- System.out.println("telling model:press: " + getModel());
- getModel().setPressed(true);
- repaint();
- }
- break;
- }
-
- case MouseEvent.MOUSE_RELEASED:
- {
- if (! isEnabled())
- {
- System.out.println("button not enabled, ignoring release");
- }
- else
- {
- int flags = 0;
-
- System.out.println(" XXX--> " + getActionCommand());
-
- fireActionPerformed(new ActionEvent(this,
- ActionEvent.ACTION_PERFORMED,
- getActionCommand(),
- flags));
-
- //System.out.println("telling model:release");
- getModel().setPressed(false);
- repaint();
- }
- break;
- }
- case MouseEvent.MOUSE_CLICKED:
- {
- break;
- }
- }
- }
+ Icon default_icon, pressed_button, disabled_button,
+ selected_button, disabled_selected_button, current_icon;
+ String text;
+
+ int vert_align = CENTER;
+ int hori_align = CENTER;
+ int hori_text_pos = CENTER;
+ int vert_text_pos = CENTER;
+
+ boolean paint_border = true, paint_focus;
+ Action action_taken;
+ ButtonModel model;
+ Insets margin;
+
+ public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted";
+
+ /**
+ * AccessibleAbstractButton
+ */
+ protected abstract class AccessibleAbstractButton
+ extends AccessibleJComponent
+ implements AccessibleAction, AccessibleValue, AccessibleText {
+
+ /**
+ * Constructor AccessibleAbstractButton
+ * @param component TODO
+ */
+ protected AccessibleAbstractButton(AbstractButton component) {
+ super(component);
+ // TODO
+ } // AccessibleAbstractButton()
+
+ /**
+ * getAccessibleStateSet
+ * @returns AccessibleStateSet
+ */
+ public AccessibleStateSet getAccessibleStateSet() {
+ return null; // TODO
+ } // getAccessibleStateSet()
+
+ /**
+ * getAccessibleName
+ * @returns String
+ */
+ public String getAccessibleName() {
+ return null; // TODO
+ } // getAccessibleName()
+
+ /**
+ * getAccessibleIcon
+ * @returns AccessibleIcon[]
+ */
+ public AccessibleIcon[] getAccessibleIcon() {
+ return null; // TODO
+ } // getAccessibleIcon()
+
+ /**
+ * getAccessibleRelationSet
+ * @returns AccessibleRelationSet
+ */
+ public AccessibleRelationSet getAccessibleRelationSet() {
+ return null; // TODO
+ } // getAccessibleRelationSet()
+
+ /**
+ * getAccessibleAction
+ * @returns AccessibleAction
+ */
+ public AccessibleAction getAccessibleAction() {
+ return null; // TODO
+ } // getAccessibleAction()
+
+ /**
+ * getAccessibleValue
+ * @returns AccessibleValue
+ */
+ public AccessibleValue getAccessibleValue() {
+ return null; // TODO
+ } // getAccessibleValue()
+
+ /**
+ * getAccessibleActionCount
+ * @returns int
+ */
+ public int getAccessibleActionCount() {
+ return 0; // TODO
+ } // getAccessibleActionCount()
+
+ /**
+ * getAccessibleActionDescription
+ * @param value0 TODO
+ * @returns String
+ */
+ public String getAccessibleActionDescription(int value0) {
+ return null; // TODO
+ } // getAccessibleActionDescription()
+
+ /**
+ * doAccessibleAction
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean doAccessibleAction(int value0) {
+ return false; // TODO
+ } // doAccessibleAction()
+
+ /**
+ * getCurrentAccessibleValue
+ * @returns Number
+ */
+ public Number getCurrentAccessibleValue() {
+ return null; // TODO
+ } // getCurrentAccessibleValue()
+
+ /**
+ * setCurrentAccessibleValue
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean setCurrentAccessibleValue(Number value0) {
+ return false; // TODO
+ } // setCurrentAccessibleValue()
+
+ /**
+ * getMinimumAccessibleValue
+ * @returns Number
+ */
+ public Number getMinimumAccessibleValue() {
+ return null; // TODO
+ } // getMinimumAccessibleValue()
+
+ /**
+ * getMaximumAccessibleValue
+ * @returns Number
+ */
+ public Number getMaximumAccessibleValue() {
+ return null; // TODO
+ } // getMaximumAccessibleValue()
+
+ /**
+ * getAccessibleText
+ * @returns AccessibleText
+ */
+ public AccessibleText getAccessibleText() {
+ return null; // TODO
+ } // getAccessibleText()
+
+ /**
+ * getIndexAtPoint
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getIndexAtPoint(Point value0) {
+ return 0; // TODO
+ } // getIndexAtPoint()
+
+ /**
+ * getCharacterBounds
+ * @param value0 TODO
+ * @returns Rectangle
+ */
+ public Rectangle getCharacterBounds(int value0) {
+ return null; // TODO
+ } // getCharacterBounds()
+
+ /**
+ * getCharCount
+ * @returns int
+ */
+ public int getCharCount() {
+ return 0; // TODO
+ } // getCharCount()
+
+ /**
+ * getCaretPosition
+ * @returns int
+ */
+ public int getCaretPosition() {
+ return 0; // TODO
+ } // getCaretPosition()
+
+ /**
+ * getAtIndex
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns String
+ */
+ public String getAtIndex(int value0, int value1) {
+ return null; // TODO
+ } // getAtIndex()
+
+ /**
+ * getAfterIndex
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns String
+ */
+ public String getAfterIndex(int value0, int value1) {
+ return null; // TODO
+ } // getAfterIndex()
+
+ /**
+ * getBeforeIndex
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns String
+ */
+ public String getBeforeIndex(int value0, int value1) {
+ return null; // TODO
+ } // getBeforeIndex()
+
+ /**
+ * getCharacterAttribute
+ * @param value0 TODO
+ * @returns AttributeSet
+ */
+ public AttributeSet getCharacterAttribute(int value0) {
+ return null; // TODO
+ } // getCharacterAttribute()
+
+ /**
+ * getSelectionStart
+ * @returns int
+ */
+ public int getSelectionStart() {
+ return 0; // TODO
+ } // getSelectionStart()
+
+ /**
+ * getSelectionEnd
+ * @returns int
+ */
+ public int getSelectionEnd() {
+ return 0; // TODO
+ } // getSelectionEnd()
+
+ /**
+ * getSelectedText
+ * @returns String
+ */
+ public String getSelectedText() {
+ return null; // TODO
+ } // getSelectedText()
+
+ /**
+ * getTextRectangle
+ * @returns Rectangle
+ */
+ private Rectangle getTextRectangle() {
+ return null; // TODO
+ } // getTextRectangle()
+
+
+ } // AccessibleAbstractButton
+
+
+ static private class JFocusListener implements FocusListener
+ {
+ AbstractButton c;
+
+ JFocusListener(AbstractButton c)
+ {
+ this.c = c;
+ }
+
+ public void focusLost(FocusEvent event)
+ {
+ c.getModel().setArmed(false);
+
+ System.out.println("LOST FOCUS");
+ if (c.isFocusPainted())
+ {
+ c.repaint();
+ }
+ }
+ public void focusGained(FocusEvent event)
+ {
+ System.out.println("GAIN FOCUS");
+ }
+ }
+
+ AbstractButton()
+ {
+ this("",null);
+ }
+
+ AbstractButton(String text,
+ Icon icon)
+ {
+ this.text = text;
+ setIcon(icon);
+
+ setAlignmentX(LEFT_ALIGNMENT);
+ setAlignmentY(CENTER_ALIGNMENT);
+
+ addFocusListener( new JFocusListener(this) );
+
+ setModel(new DefaultButtonModel(this));
+
+ updateUI(); // get a proper ui
+ }
+
+ public ButtonModel getModel()
+ { return model; }
+
+ public void setModel(ButtonModel newModel)
+ { model = newModel; }
+
+ public String getActionCommand()
+ { return getModel().getActionCommand(); }
+
+ public void setActionCommand(String aCommand)
+ { getModel().setActionCommand(aCommand); }
+
+ public void addActionListener(ActionListener l)
+ { getModel().addActionListener(l); }
+
+ public void removeActionListener(ActionListener l)
+ { getModel().removeActionListener(l); }
+
+ public void addChangeListener(ChangeListener l)
+ { getModel().addChangeListener(l); }
+
+ public void removeChangeListener(ChangeListener l)
+ { getModel().removeChangeListener(l); }
+
+ public void addItemListener(ItemListener l)
+ { getModel().addItemListener(l); }
+
+ public void removeItemListener(ItemListener l)
+ { getModel().removeItemListener(l); }
+
+ public int getHorizontalAlignment()
+ { return hori_align; }
+
+ public int getHorizontalTextPosition()
+ { return hori_text_pos; }
+
+ public int getVerticalAlignment()
+ { return vert_align; }
+
+ public int getVerticalTextPosition()
+ { return vert_text_pos; }
+
+ protected void fireItemStateChanged(ItemEvent event)
+ {
+ }
+
+ protected void fireStateChanged(ChangeEvent event)
+ {
+ }
+
+ protected void fireActionPerformed(ActionEvent event)
+ {
+ }
+
+ public void setVerticalAlignment(int alignment)
+ { vert_align = alignment; }
+
+ public void setHorizontalAlignment(int alignment)
+ { hori_align = alignment; }
+
+ public void setVerticalTextPosition(int textPosition)
+ { vert_text_pos = textPosition; }
+
+ public void setHorizontalTextPosition(int textPosition)
+ { hori_text_pos = textPosition; }
+
+ public int getMnemonic()
+ { return getModel().getMnemonic(); }
+
+ public void setMnemonic(char mne)
+ { getModel().setMnemonic(mne); }
+
+ public void setMnemonic(int mne)
+ { getModel().setMnemonic(mne); }
+
+ public void setRolloverEnabled(boolean b)
+ { getModel().setRollover(b); }
+
+ public boolean isRolloverEnabled()
+ { return getModel().isRollover(); }
+
+ public boolean isBorderPainted()
+ { return paint_border; }
+
+ public void setBorderPainted(boolean b)
+ {
+ if (b != paint_border)
+ {
+ paint_border = b;
+ revalidate();
+ repaint();
+ }
+ }
+
+ public Action getAction()
+ { return action_taken; }
+
+ public void setAction(Action a)
+ {
+ action_taken = a;
+ revalidate();
+ repaint();
+ }
+
+ public void setSelected(boolean b)
+ { getModel().setSelected(b); }
+
+ public boolean isSelected()
+ { return getModel().isSelected(); }
+
+ public Icon getIcon()
+ { return default_icon; }
+
+ public void setIcon(Icon defaultIcon)
+ {
+ if (default_icon == defaultIcon)
+ return;
+
+ default_icon = defaultIcon;
+ if (default_icon != null)
+ {
+ // XXX FIXME - icons do not know their parent
+ // default_icon.setParent(this);
+ }
+ revalidate();
+ repaint();
+ }
+
+ public String getText()
+ { return text; }
+
+ public void setLabel(String label)
+ { setText(label); }
+
+ public String getLabel()
+ { return getText(); }
+
+ public void setText(String text)
+ {
+ this.text = text;
+ revalidate();
+ repaint();
+ }
+
+ public Insets getMargin()
+ { return margin; }
+
+ public void setMargin(Insets m)
+ {
+ margin = m;
+ revalidate();
+ repaint();
+ }
+
+ public void setEnabled(boolean b)
+ {
+ super.setEnabled(b);
+ getModel().setEnabled(b);
+ repaint();
+ }
+
+ public Icon getPressedIcon()
+ { return pressed_button; }
+
+ public void setPressedIcon(Icon pressedIcon)
+ {
+ pressed_button = pressedIcon;
+ revalidate();
+ repaint();
+ }
+
+ public Icon getDisabledIcon()
+ { return disabled_button; }
+
+ public void setDisabledIcon(Icon disabledIcon)
+ {
+ disabled_button = disabledIcon;
+ revalidate();
+ repaint();
+ }
+
+ public boolean isFocusPainted()
+ { return paint_focus; }
+
+ public void setFocusPainted(boolean b)
+ {
+ boolean old = paint_focus;
+ paint_focus = b;
+
+ firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY,
+ old,
+ b);
+ if (hasFocus())
+ {
+ revalidate();
+ repaint();
+ }
+ }
+
+ public boolean isFocusTraversable()
+ {
+ //Identifies whether or not this component can receive the focus.
+ return true;
+ }
+
+
+ protected int checkHorizontalKey(int key, String exception)
+ {
+ // Verify that key is a legal value for the horizontalAlignment properties.
+ return 0;
+ }
+
+ protected int checkVerticalKey(int key, String exception)
+ {
+ // Ensures that the key is a valid.
+ return 0;
+ }
+
+ protected void configurePropertiesFromAction(Action a)
+ {
+ //Factory method which sets the ActionEvent source's properties according to values from the Action instance.
+ }
+
+ protected ActionListener createActionListener()
+ {
+ return new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e) { }
+ };
+ }
+
+ protected PropertyChangeListener createActionPropertyChangeListener(Action a)
+ {
+ //Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
+ return null;
+ }
+
+ protected ChangeListener createChangeListener()
+ {
+ // Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation.
+ return new ChangeListener()
+ {
+ public void stateChanged(ChangeEvent e) { }
+ };
+ }
+
+ protected ItemListener createItemListener()
+ {
+ return new ItemListener()
+ {
+ public void itemStateChanged(ItemEvent e) { }
+ };
+ }
+
+ public void doClick()
+ {
+ doClick(100);
+ }
+
+ public void doClick(int pressTime)
+ {
+ //Toolkit.tlkBeep ();
+ //Programmatically perform a "click".
+ }
+
+ public Icon getDisabledSelectedIcon()
+ {
+ //Returns the icon used by the button when it's disabled and selected.
+ return disabled_selected_button;
+ }
+
+ public Icon getRolloverIcon()
+ {
+ // Returns the rollover icon for the button.
+ return null;
+ }
+
+ Icon getRolloverSelectedIcon()
+ {
+ // Returns the rollover selection icon for the button.
+ return null;
+ }
+
+ Icon getSelectedIcon()
+ {
+ // Returns the selected icon for the button.
+ return selected_button;
+ }
+
+ public Object[] getSelectedObjects()
+ {
+ //Returns an array (length 1) containing the label or null if the button is not selected.
+ return null;
+ }
+
+ public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
+ {
+ //This is overridden to return false if the current Icon's Image is not equal to the passed in Image img.
+ return current_icon == img;
+ }
+
+ public boolean isContentAreaFilled()
+ {
+ // Checks whether the "content area" of the button should be filled.
+ return false;
+ }
+
+ protected void paintBorder(Graphics g)
+ {
+ // Paint the button's border if BorderPainted property is true.
+ if (isBorderPainted())
+ super.paintBorder(g);
+ }
+
+ protected String paramString()
+ {
+ // Returns a string representation of this AbstractButton.
+ return "AbstractButton";
+ }
+
+ public void setContentAreaFilled(boolean b)
+ {
+ //Sets whether the button should paint the content area or leave it transparent.
+ }
+
+ public void setDisabledSelectedIcon(Icon disabledSelectedIcon)
+ {
+ // Sets the disabled selection icon for the button.
+ }
+
+ public void setRolloverIcon(Icon rolloverIcon)
+ {
+ // Sets the rollover icon for the button.
+ }
+ public void setRolloverSelectedIcon(Icon rolloverSelectedIcon)
+ {
+ // Sets the rollover selected icon for the button.
+ }
+
+ public void setSelectedIcon(Icon selectedIcon)
+ {
+ // Sets the selected icon for the button.
+ }
+
+ public void setUI(ButtonUI ui)
+ { // Sets the L&F object that renders this component.
+ super.setUI(ui);
+ }
+
+ public ButtonUI getUI()
+ {
+ //Returns the L&F object that renders this component.
+ return (ButtonUI) ui;
+ }
+
+ public void updateUI()
+ {
+ /*
+ // Notification from the UIFactory that the L&F has changed.
+ if (getUI() == null)
+ {
+ setUI(getUI());
+ }
+ */
+ }
+
+ protected void processActionEvent(ActionEvent e)
+ {
+ System.out.println("PROCESS-ACTION-EVENT: " + e);
+ }
+
+ protected void processMouseEvent(MouseEvent e)
+ {
+ // System.out.println("PROCESS-MOUSE-EVENT: " + e + ", PRESSED-IN-MODEL="+getModel().isPressed());
+
+ switch (e.getID())
+ {
+ case MouseEvent.MOUSE_MOVED:
+ {
+ break;
+ }
+ case MouseEvent.MOUSE_PRESSED:
+ {
+ if (! isEnabled())
+ {
+ System.out.println("button not enabled, ignoring press");
+ }
+ else
+ {
+ System.out.println("telling model:press: " + getModel());
+ getModel().setPressed(true);
+ repaint();
+ }
+ break;
+ }
+
+ case MouseEvent.MOUSE_RELEASED:
+ {
+ if (! isEnabled())
+ {
+ System.out.println("button not enabled, ignoring release");
+ }
+ else
+ {
+ int flags = 0;
+
+ System.out.println(" XXX--> " + getActionCommand());
+
+ fireActionPerformed(new ActionEvent(this,
+ ActionEvent.ACTION_PERFORMED,
+ getActionCommand(),
+ flags));
+
+ //System.out.println("telling model:release");
+ getModel().setPressed(false);
+ repaint();
+ }
+ break;
+ }
+ case MouseEvent.MOUSE_CLICKED:
+ {
+ break;
+ }
+ }
+ }
}
diff --git a/libjava/javax/swing/ButtonModel.java b/libjava/javax/swing/ButtonModel.java
index 6d6aa7abbf2..ae0c721003b 100644
--- a/libjava/javax/swing/ButtonModel.java
+++ b/libjava/javax/swing/ButtonModel.java
@@ -76,12 +76,4 @@ public interface ButtonModel extends ItemSelectable
void setSelected(boolean b);
boolean isSelected();
-
-
- // there are not in the spec !!
-
-
- void fireItemStateChanged(ItemEvent event);
- void fireStateChanged(ChangeEvent event);
- void fireActionPerformed(ActionEvent event);
}
diff --git a/libjava/javax/swing/SwingUtilities.java b/libjava/javax/swing/SwingUtilities.java
index a123ad83438..a9113f0ff40 100644
--- a/libjava/javax/swing/SwingUtilities.java
+++ b/libjava/javax/swing/SwingUtilities.java
@@ -58,70 +58,71 @@ import javax.accessibility.AccessibleStateSet;
public class SwingUtilities implements SwingConstants
{
public static FontMetrics getFontMetrics (Font font)
-{
- return Toolkit.getDefaultToolkit().getFontMetrics(font);
- }
+ {
+ return Toolkit.getDefaultToolkit ().getFontMetrics (font);
+ }
public static JRootPane getRootPane (Component a)
- {
- if (a instanceof JRootPane)
- return (JRootPane) a;
+ {
+ if (a instanceof JRootPane)
+ return (JRootPane) a;
- a = a.getParent();
-
- if (a != null)
- {
- return getRootPane(a);
- }
+ a = a.getParent();
- return null;
- }
+ if (a != null)
+ {
+ return getRootPane(a);
+ }
+
+ return null;
+ }
public static void updateComponentTreeUI(JFrame comp)
- {
- }
+ {
+ }
public static String layoutCompoundLabel(JComponent c,
- FontMetrics fm,
- String text,
- Icon i,
- int vert_a,
- int hor_i,
- int vert_text_pos,
- int hor_text_pos,
- Rectangle vr,
- Rectangle ir,
- Rectangle tr,
- int gap)
- {
- // view rect 'vr' already ok,
- // we need to compute ir (icon rect) and tr (text-rect)
+ FontMetrics fm,
+ String text,
+ Icon i,
+ int vert_a,
+ int hor_i,
+ int vert_text_pos,
+ int hor_text_pos,
+ Rectangle vr,
+ Rectangle ir,
+ Rectangle tr,
+ int gap)
+ {
+ // view rect 'vr' already ok,
+ // we need to compute ir (icon rect) and tr (text-rect)
- int next_x = 0;//vr.x;
- int next_y = 0;//vr.y;
+ int next_x = 0;//vr.x;
+ int next_y = 0;//vr.y;
- ir.height = ir.width = ir.y = ir.x = 0;
+ ir.height = ir.width = ir.y = ir.x = 0;
- if (i != null)
- {
- ir.x = vr.x;
- ir.y = vr.y;
- ir.width = i.getIconWidth();
- ir.height = i.getIconWidth();
+ if (i != null)
+ {
+ ir.x = vr.x;
+ ir.y = vr.y;
+ ir.width = i.getIconWidth();
+ ir.height = i.getIconWidth();
- next_x += gap + i.getIconWidth();
- next_y += gap + i.getIconHeight();
- }
+ next_x += gap + i.getIconWidth();
+ next_y += gap + i.getIconHeight();
+ }
- tr.x = next_x;
- tr.y = vr.y + (vr.height/2);
+ tr.x = next_x;
+ tr.y = vr.y + (vr.height/2);
+
+ tr.width = fm.stringWidth(text);
+ tr.height = fm.getHeight() + fm.getAscent()/2;
- tr.width = fm.stringWidth(text);
- tr.height = fm.getHeight() + fm.getAscent()/2;
+ return text;
+ }
- return text;
- }
}
diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java
index 556e8fffdf7..7defebd2b09 100644
--- a/libjava/javax/swing/UIManager.java
+++ b/libjava/javax/swing/UIManager.java
@@ -50,131 +50,137 @@ import javax.swing.plaf.metal.MetalLookAndFeel;
public class UIManager implements Serializable
{
- static final long serialVersionUID = -5547433830339189365L;
-
- static class LookAndFeelInfo
- {
- String name, clazz;
+ public static class LookAndFeelInfo
+ {
+ String name, clazz;
- LookAndFeelInfo(String name,
- String clazz)
- {
- this.name = name;
- this.clazz = clazz;
- }
- String getName() { return name; }
- String getClassName() { return clazz; }
+ LookAndFeelInfo(String name,
+ String clazz)
+ {
+ this.name = name;
+ this.clazz = clazz;
}
-
- static LookAndFeelInfo [] installed = {
- new LookAndFeelInfo("Metal",
- "javax.swing.plaf.metal.MetalLookAndFeel")
- };
+ String getName() { return name; }
+ String getClassName() { return clazz; }
+ }
+ private static final long serialVersionUID = -5547433830339189365L;
+
+ static LookAndFeelInfo [] installed = {
+ new LookAndFeelInfo ("Metal", "javax.swing.plaf.metal.MetalLookAndFeel")
+ };
+
+ static LookAndFeel[] aux_installed;
+
+ static LookAndFeel look_and_feel = new MetalLookAndFeel();
- static LookAndFeel[] aux_installed;
-
- static LookAndFeel look_and_feel = new MetalLookAndFeel();
-
+ public UIManager()
+ {
+ // Do nothing here.
+ }
- UIManager()
- {
- }
+ public static void addPropertyChangeListener (PropertyChangeListener listener)
+ {
+ // FIXME
+ }
- public static void addPropertyChangeListener(PropertyChangeListener listener)
- {
- // Add a PropertyChangeListener to the listener list.
- }
+ public static void removePropertyChangeListener (PropertyChangeListener listener)
+ // Remove a PropertyChangeListener from the listener list.
+ {
+ // FIXME
+ }
- public static void addAuxiliaryLookAndFeel(LookAndFeel l)
- {
- // Add a LookAndFeel to the list of auxiliary look and feels.
- if (aux_installed == null)
- {
- aux_installed = new LookAndFeel[1];
- aux_installed[0] = l;
- return;
- }
+ /**
+ * @since 1.4
+ */
+ public static PropertyChangeListener[] getPropertyChangeListeners ()
+ {
+ // FIXME
+ throw new Error ("Not implemented");
+ }
+
+ public static void addAuxiliaryLookAndFeel (LookAndFeel l)
+ {
+ // Add a LookAndFeel to the list of auxiliary look and feels.
+ if (aux_installed == null)
+ {
+ aux_installed = new LookAndFeel[1];
+ aux_installed[0] = l;
+ return;
+ }
- LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
- System.arraycopy(aux_installed, 0,
- T, 0,
- aux_installed.length);
- aux_installed = T;
- aux_installed[aux_installed.length-1] = l;
- }
+ LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
+ System.arraycopy(aux_installed, 0, T, 0, aux_installed.length);
+ aux_installed = T;
+ aux_installed[aux_installed.length-1] = l;
+ }
- public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
- {
- if (aux_installed == null)
- return false;
-
- for (int i=0;i<aux_installed.length;i++)
- {
- if (aux_installed[i] == laf)
- {
- aux_installed[ i ] = aux_installed[aux_installed.length-1];
-
- LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
- System.arraycopy(aux_installed, 0,
- T, 0,
- aux_installed.length-1);
- aux_installed = T;
- return true;
- }
- }
- return false;
- }
-
- public static LookAndFeel[] getAuxiliaryLookAndFeels()
- { return aux_installed; }
+ public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
+ {
+ if (aux_installed == null)
+ return false;
+
+ for (int i=0;i<aux_installed.length;i++)
+ {
+ if (aux_installed[i] == laf)
+ {
+ aux_installed[ i ] = aux_installed[aux_installed.length-1];
+ LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
+ System.arraycopy (aux_installed, 0, T, 0, aux_installed.length-1);
+ aux_installed = T;
+ return true;
+ }
+ }
+ return false;
+ }
+ public static LookAndFeel[] getAuxiliaryLookAndFeels()
+ { return aux_installed; }
- public static Object get(Object key)
- { return getLookAndFeel().getDefaults().get(key); }
+ public static Object get(Object key)
+ { return getLookAndFeel().getDefaults().get(key); }
- /**
- * Returns a border from the defaults table.
- */
- public static Border getBorder(Object key)
- {
- return (Border) getLookAndFeel().getDefaults().get(key);
- }
+ /**
+ * Returns a border from the defaults table.
+ */
+ public static Border getBorder(Object key)
+ {
+ return (Border) getLookAndFeel().getDefaults().get(key);
+ }
- /**
- * Returns a drawing color from the defaults table.
- */
- public static Color getColor(Object key)
- {
- return (Color) getLookAndFeel().getDefaults().get(key);
- }
-
- /**
- * this string can be passed to Class.forName()
- */
- public static String getCrossPlatformLookAndFeelClassName()
- {
- return "javax.swing.plaf.metal.MetalLookAndFeel";
- }
+ /**
+ * Returns a drawing color from the defaults table.
+ */
+ public static Color getColor(Object key)
+ {
+ return (Color) getLookAndFeel().getDefaults().get(key);
+ }
- /**
- * Returns the default values for this look and feel.
- */
- static UIDefaults getDefaults()
- {
- return getLookAndFeel().getDefaults();
- }
+ /**
+ * this string can be passed to Class.forName()
+ */
+ public static String getCrossPlatformLookAndFeelClassName()
+ {
+ return "javax.swing.plaf.metal.MetalLookAndFeel";
+ }
- /**
- * Returns a dimension from the defaults table.
- */
- static Dimension getDimension(Object key)
- {
- System.out.println("UIManager.getDim");
- return new Dimension(200,100);
- }
+ /**
+ * Returns the default values for this look and feel.
+ */
+ static UIDefaults getDefaults()
+ {
+ return getLookAndFeel().getDefaults();
+ }
+ /**
+ * Returns a dimension from the defaults table.
+ */
+ static Dimension getDimension(Object key)
+ {
+ System.out.println("UIManager.getDim");
+ return new Dimension(200,100);
+ }
/**
* Retrieves a font from the defaults table of the current
@@ -189,34 +195,35 @@ public class UIManager implements Serializable
return (Font) getLookAndFeel().getDefaults().get(key);
}
- static Icon getIcon(Object key)
- // Returns an Icon from the defaults table.
- {
- return (Icon) getLookAndFeel().getDefaults().get(key);
- }
- static Insets getInsets(Object key)
- // Returns an Insets object from the defaults table.
- {
- return (Insets) getLookAndFeel().getDefaults().getInsets(key);
- }
+ static Icon getIcon(Object key)
+ // Returns an Icon from the defaults table.
+ {
+ return (Icon) getLookAndFeel().getDefaults().get(key);
+ }
+
+ static Insets getInsets(Object key)
+ // Returns an Insets object from the defaults table.
+ {
+ return (Insets) getLookAndFeel().getDefaults().getInsets(key);
+ }
- static LookAndFeelInfo[] getInstalledLookAndFeels()
- {
- return installed;
- }
+ static LookAndFeelInfo[] getInstalledLookAndFeels()
+ {
+ return installed;
+ }
- static int getInt(Object key)
- {
- Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
- if (x == null)
- return 0;
- return x.intValue();
- }
- static LookAndFeel getLookAndFeel()
- {
- return look_and_feel;
- }
+ static int getInt(Object key)
+ {
+ Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
+ if (x == null)
+ return 0;
+ return x.intValue();
+ }
+ static LookAndFeel getLookAndFeel()
+ {
+ return look_and_feel;
+ }
/**
* Returns the <code>UIDefaults</code> table of the currently active
@@ -227,73 +234,67 @@ public class UIManager implements Serializable
return getLookAndFeel().getDefaults();
}
+ static String getString(Object key)
+ // Returns a string from the defaults table.
+ {
+ return (String) getLookAndFeel().getDefaults().get(key);
+ }
+
+ 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();
+ }
- static String getString(Object key)
- // Returns a string from the defaults table.
- {
- return (String) getLookAndFeel().getDefaults().get(key);
- }
- 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();
- }
+ public static ComponentUI getUI(JComponent target)
+ // Returns the L&F object that renders the target component.
+ {
+ ComponentUI ui = getDefaults().getUI(target);
+ //System.out.println("GET-UI-> " + ui + ", for " + target);
+ return ui;
+ }
+ public static void installLookAndFeel(String name, String className)
+ // Creates a new look and feel and adds it to the current array.
+ {
+ }
- public static ComponentUI getUI(JComponent target)
- // Returns the L&F object that renders the target component.
- {
- ComponentUI ui = getDefaults().getUI(target);
- //System.out.println("GET-UI-> " + ui + ", for " + target);
- return ui;
- }
+ public static void installLookAndFeel(LookAndFeelInfo info)
+ // Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
+ {
+ }
+ public static Object put(Object key, Object value)
+ // Stores an object in the defaults table.
+ {
+ return getLookAndFeel().getDefaults().put(key,value);
+ }
- public static void installLookAndFeel(String name, String className)
- // Creates a new look and feel and adds it to the current array.
- {
- }
- public static void installLookAndFeel(LookAndFeelInfo info)
- // Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
- {
- }
- public static Object put(Object key, Object value)
- // Stores an object in the defaults table.
- {
- return getLookAndFeel().getDefaults().put(key,value);
- }
- public static void removePropertyChangeListener(PropertyChangeListener listener)
- // Remove a PropertyChangeListener from the listener list.
- {
- }
- public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
- // Replaces the current array of installed LookAndFeelInfos.
- {
- }
- public static void setLookAndFeel(LookAndFeel newLookAndFeel)
- {
- if (look_and_feel != null)
- look_and_feel.uninitialize();
+ public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
+ // Replaces the current array of installed LookAndFeelInfos.
+ {
+ }
+
+ public static void setLookAndFeel(LookAndFeel newLookAndFeel)
+ {
+ if (look_and_feel != null)
+ look_and_feel.uninitialize();
- // Set the current default look and feel using a LookAndFeel object.
- look_and_feel = newLookAndFeel;
- look_and_feel.initialize();
+ // Set the current default look and feel using a LookAndFeel object.
+ look_and_feel = newLookAndFeel;
+ look_and_feel.initialize();
- // revalidate();
- // repaint();
- }
-
- public static void setLookAndFeel(String className)
- throws ClassNotFoundException,
- InstantiationException,
- IllegalAccessException,
- UnsupportedLookAndFeelException
- {
- // Set the current default look and feel using a class name.
- Class c = Class.forName(className);
- LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception
- setLookAndFeel(a);
- }
-
+ //revalidate();
+ //repaint();
+ }
+ public static void setLookAndFeel (String className)
+ throws ClassNotFoundException, InstantiationException, IllegalAccessException,
+ UnsupportedLookAndFeelException
+ {
+ // Set the current default look and feel using a class name.
+ Class c = Class.forName(className);
+ LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception
+ setLookAndFeel(a);
+ }
}
diff --git a/libjava/javax/swing/border/BevelBorder.java b/libjava/javax/swing/border/BevelBorder.java
index 87bf04a0c61..dd5a52b0184 100644
--- a/libjava/javax/swing/border/BevelBorder.java
+++ b/libjava/javax/swing/border/BevelBorder.java
@@ -125,7 +125,7 @@ public class BevelBorder
* constructed by this method will automatically reflect a change
* to the component&#x2019;s background color.
*
- * <p><img src="BevelBorder-1.png" width="500" height="150"
+ * <p><img src="doc-files/BevelBorder-1.png" width="500" height="150"
* alt="[An illustration showing raised and lowered BevelBorders]" />
*
* @param bevelType the desired appearance of the border. The value
@@ -147,7 +147,7 @@ public class BevelBorder
* Constructs a BevelBorder given its appearance type and two colors
* for its highlight and shadow.
*
- * <p><img src="BevelBorder-2.png" width="500" height="150"
+ * <p><img src="doc-files/BevelBorder-2.png" width="500" height="150"
* alt="[An illustration showing BevelBorders that were constructed
* with this method]" />
*
@@ -188,7 +188,7 @@ public class BevelBorder
* Constructs a BevelBorder given its appearance type and all
* colors.
*
- * <p><img src="BevelBorder-3.png" width="500" height="150"
+ * <p><img src="doc-files/BevelBorder-3.png" width="500" height="150"
* alt="[An illustration showing BevelBorders that were constructed
* with this method]" />
*
diff --git a/libjava/javax/swing/border/EtchedBorder.java b/libjava/javax/swing/border/EtchedBorder.java
index bb16ae925b1..859e5f832fd 100644
--- a/libjava/javax/swing/border/EtchedBorder.java
+++ b/libjava/javax/swing/border/EtchedBorder.java
@@ -51,7 +51,7 @@ import java.awt.Insets;
* explicitly specify the border colors, or to let the colors derive
* from the background color of the enclosed Component.
*
- * <p><img src="EtchedBorder-1.png" width="500" height="200"
+ * <p><img src="doc-files/EtchedBorder-1.png" width="500" height="200"
* alt="[An illustration of the two EtchedBorder variants]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -119,7 +119,7 @@ public class EtchedBorder
* colors will be derived from the background color of the enclosed
* Component when the border gets painted.
*
- * <p><img src="EtchedBorder-1.png" width="500" height="200"
+ * <p><img src="doc-files/EtchedBorder-1.png" width="500" height="200"
* alt="[An illustration of the two EtchedBorder variants]" />
*
* @param etchType the desired appearance of the border. The value
@@ -165,7 +165,7 @@ public class EtchedBorder
* explicitly selecting the colors that will be used for
* highlight and shadow.
*
- * <p><img src="EtchedBorder-2.png" width="500" height="200"
+ * <p><img src="doc-files/EtchedBorder-2.png" width="500" height="200"
* alt="[An illustration that shows which pixels get painted
* in what color]" />
*
diff --git a/libjava/javax/swing/border/LineBorder.java b/libjava/javax/swing/border/LineBorder.java
index 3c85c29dfdb..2b8c8bae98e 100644
--- a/libjava/javax/swing/border/LineBorder.java
+++ b/libjava/javax/swing/border/LineBorder.java
@@ -128,8 +128,8 @@ public class LineBorder
* Constructs a LineBorder given its color, thickness, and whether
* it has rounded corners.
*
- * <p><img src="LineBorder-1.png" width="500" height="200"
- * alt="[An illustration of two LineBorders] />
+ * <p><img src="doc-files/LineBorder-1.png" width="500" height="200"
+ * alt="[An illustration of two LineBorders]" />
*
* <p>Note that the enlarged view in the right-hand picture shows
* that the implementation draws one more pixel than specified,
diff --git a/libjava/javax/swing/border/MatteBorder.java b/libjava/javax/swing/border/MatteBorder.java
index 1cc66f70a1f..e7b0f62e465 100644
--- a/libjava/javax/swing/border/MatteBorder.java
+++ b/libjava/javax/swing/border/MatteBorder.java
@@ -49,7 +49,7 @@ import javax.swing.Icon;
* A border that is filled with either a solid color or with repeated
* icon tiles.
*
- * <p><img src="MatteBorder-1.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-1.png" width="500" height="150"
* alt="[Two MatteBorders]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -88,7 +88,7 @@ public class MatteBorder
* Constructs a MatteBorder given the width on each side
* and a fill color.
*
- * <p><img src="MatteBorder-2.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-2.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param top the width of the border at its top edge.
@@ -112,7 +112,7 @@ public class MatteBorder
/**
* Constructs a MatteBorder given its insets and fill color.
*
- * <p><img src="MatteBorder-3.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-3.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param borderInsets an Insets object whose <code>top</code>,
@@ -134,7 +134,7 @@ public class MatteBorder
* Constructs a MatteBorder given the width on each side
* and an icon for tiling the border area.
*
- * <p><img src="MatteBorder-4.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-4.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param top the width of the border at its top edge.
@@ -159,7 +159,7 @@ public class MatteBorder
* Constructs a MatteBorder given its insets and an icon
* for tiling the border area.
*
- * <p><img src="MatteBorder-5.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-5.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param borderInsets an Insets object whose <code>top</code>,
@@ -183,7 +183,7 @@ public class MatteBorder
* at the left and right edge, the icon height for the top and
* bottom edge.
*
- * <p><img src="MatteBorder-6.png" width="500" height="150"
+ * <p><img src="doc-files/MatteBorder-6.png" width="500" height="150"
* alt="[A picture of a MatteBorder made by this constructor]" />
*
* @param tileIcon an icon for tiling the border area.
diff --git a/libjava/javax/swing/border/SoftBevelBorder.java b/libjava/javax/swing/border/SoftBevelBorder.java
index c08fb00d259..341954c3c9f 100644
--- a/libjava/javax/swing/border/SoftBevelBorder.java
+++ b/libjava/javax/swing/border/SoftBevelBorder.java
@@ -74,7 +74,7 @@ public class SoftBevelBorder
* constructed by this method will automatically reflect a change
* to the component&#x2019;s background color.
*
- * <p><img src="SoftBevelBorder-1.png" width="500" height="200"
+ * <p><img src="doc-files/SoftBevelBorder-1.png" width="500" height="200"
* alt="[An illustration showing raised and lowered SoftBevelBorders]" />
*
* @param bevelType the desired appearance of the border. The value
@@ -94,7 +94,7 @@ public class SoftBevelBorder
* Constructs a SoftBevelBorder given its appearance type and two
* colors for its highlight and shadow.
*
- * <p><img src="SoftBevelBorder-2.png" width="500" height="150"
+ * <p><img src="doc-files/SoftBevelBorder-2.png" width="500" height="150"
* alt="[An illustration showing SoftBevelBorders that were
* constructed with this method]" />
*
@@ -136,7 +136,7 @@ public class SoftBevelBorder
* Constructs a SoftBevelBorder given its appearance type and all
* colors.
*
- * <p><img src="SoftBevelBorder-3.png" width="500" height="150"
+ * <p><img src="doc-files/SoftBevelBorder-3.png" width="500" height="150"
* alt="[An illustration showing SoftBevelBorders that were
* constructed with this method]" />
*
diff --git a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java b/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
index 1aa51fd64c0..43df7edffb9 100644
--- a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
+++ b/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java
@@ -52,90 +52,90 @@ import javax.swing.event.EventListenerList;
public class DefaultColorSelectionModel
implements ColorSelectionModel, Serializable
{
- static final long serialVersionUID = 580150227676302096L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * changeEvent
- */
- protected transient ChangeEvent changeEvent;
-
- /**
- * listenerList
- */
- protected EventListenerList listenerList;
-
- /**
- * selectedColor
- */
- private Color selectedColor;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DefaultColorSelectionModel
- */
- public DefaultColorSelectionModel() {
- // TODO
- } // DefaultColorSelectionModel()
-
- /**
- * Constructor DefaultColorSelectionModel
- * @param color TODO
- */
- public DefaultColorSelectionModel(Color color) {
- // TODO
- } // DefaultColorSelectionModel()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getSelectedColor
- * @returns Color
- */
- public Color getSelectedColor() {
- return null; // TODO
- } // getSelectedColor()
-
- /**
- * setSelectedColor
- * @param color TODO
- */
- public void setSelectedColor(Color color) {
- // TODO
- } // setSelectedColor()
-
- /**
- * addChangeListener
- * @param listener TODO
- */
- public void addChangeListener(ChangeListener listener) {
- // TODO
- } // addChangeListener()
-
- /**
- * removeChangeListener
- * @param listener TODO
- */
- public void removeChangeListener(ChangeListener listener) {
- // TODO
- } // removeChangeListener()
-
- /**
- * fireStateChanged
- */
- protected void fireStateChanged() {
- // TODO
- } // fireStateChanged()
-
-
-} // DefaultColorSelectionModel
+ private static final long serialVersionUID = -8117143602864778804L;
+
+ private Color selectedColor;
+
+ protected transient ChangeEvent changeEvent = new ChangeEvent (this);
+ protected EventListenerList listenerList = new EventListenerList ();
+
+ /**
+ * Creates a new color selection model.
+ */
+ public DefaultColorSelectionModel()
+ {
+ this (Color.white);
+ }
+
+ /**
+ * Creates a new color selection model with a given selected color.
+ *
+ * @param color The selected color.
+ */
+ public DefaultColorSelectionModel (Color color)
+ {
+ super();
+ this.selectedColor = color;
+ }
+
+ /**
+ * Returns the selected color.
+ *
+ * @return The selected color.
+ */
+ public Color getSelectedColor()
+ {
+ return selectedColor;
+ }
+
+ /**
+ * @param color The color to set.
+ */
+ public void setSelectedColor (Color color)
+ {
+ this.selectedColor = color;
+ }
+
+ /**
+ * Adds a listener to this model.
+ *
+ * @param listener The listener to add.
+ */
+ public void addChangeListener (ChangeListener listener)
+ {
+ listenerList.add (ChangeListener.class, listener);
+ }
+
+ /**
+ * Removes a listener from this model.
+ *
+ * @param listener The listener to remove.
+ */
+ public void removeChangeListener (ChangeListener listener)
+ {
+ listenerList.remove (ChangeListener.class, listener);
+ }
+
+ /**
+ * Returns all currently added <code>ChangeListener</code> objects.
+ *
+ * @return Array of <code>ChangeListener</code> objects.
+ */
+ public ChangeListener[] getChangeListeners()
+ {
+ return (ChangeListener[]) listenerList.getListeners (ChangeListener.class);
+ }
+
+ /**
+ * Calls all the <code>stateChanged()</code> method of all added
+ * <code>ChangeListener</code> objects with <code>changeEvent</code>
+ * as argument.
+ */
+ protected void fireStateChanged()
+ {
+ ChangeListener[] listeners = getChangeListeners();
+
+ for (int i = 0; i < listeners.length; i++)
+ listeners [i].stateChanged (changeEvent);
+ }
+}
diff --git a/libjava/javax/swing/event/AncestorEvent.java b/libjava/javax/swing/event/AncestorEvent.java
index c6173932bb9..d62be28ba29 100644
--- a/libjava/javax/swing/event/AncestorEvent.java
+++ b/libjava/javax/swing/event/AncestorEvent.java
@@ -50,9 +50,9 @@ public class AncestorEvent extends AWTEvent
{
private static final long serialVersionUID = -8079801679695605002L;
- public static final int ANCESTOR_ADDED = 0;
- public static final int ANCESTOR_MOVED = 1;
+ public static final int ANCESTOR_ADDED = 1;
public static final int ANCESTOR_REMOVED = 2;
+ public static final int ANCESTOR_MOVED = 3;
private JComponent sourceComponent;
private Container ancestor;
diff --git a/libjava/javax/swing/event/InternalFrameEvent.java b/libjava/javax/swing/event/InternalFrameEvent.java
index 15d12f2efcf..863fd292f88 100644
--- a/libjava/javax/swing/event/InternalFrameEvent.java
+++ b/libjava/javax/swing/event/InternalFrameEvent.java
@@ -81,7 +81,7 @@ public class InternalFrameEvent extends AWTEvent
/**
* Internal frame iconified event
*/
- public static final int INTERNAL_FRAME_ICONIFIED = 2552;
+ public static final int INTERNAL_FRAME_ICONIFIED = 25552;
/**
* Internal frame last event
@@ -91,7 +91,7 @@ public class InternalFrameEvent extends AWTEvent
/**
* Internal frame opened event
*/
- public static final int INTERNAL_FRAME_OPENED = 25550;
+ public static final int INTERNAL_FRAME_OPENED = 25549;
/**
* Creates a <code>JInternalFrameEvent</code> object.
diff --git a/libjava/javax/swing/plaf/BorderUIResource.java b/libjava/javax/swing/plaf/BorderUIResource.java
index aebb1a03fe3..a3f0db026fd 100644
--- a/libjava/javax/swing/plaf/BorderUIResource.java
+++ b/libjava/javax/swing/plaf/BorderUIResource.java
@@ -277,7 +277,8 @@ public class BorderUIResource
* constructed by this method will automatically reflect a change
* to the component&#x2019;s background color.
*
- * <p><img src="../border/BevelBorder-1.png" width="500" height="150"
+ * <p><img src="../border/doc-files/BevelBorder-1.png"
+ * width="500" height="150"
* alt="[An illustration showing raised and lowered BevelBorders]" />
*
* @param bevelType the desired appearance of the border. The value
@@ -297,9 +298,9 @@ public class BorderUIResource
* Constructs a BevelBorderUIResource given its appearance type
* and two colors for its highlight and shadow.
*
- * <p><img src="../border/BevelBorder-2.png" width="500" height="150"
- * alt="[An illustration showing BevelBorders that were constructed
- * with this method]" />
+ * <p><img src="../border/doc-files/BevelBorder-2.png" width="500"
+ * height="150" alt="[An illustration showing BevelBorders that were
+ * constructed with this method]" />
*
* @param bevelType the desired appearance of the border. The value
* must be either {@link javax.swing.border.BevelBorder#RAISED}
@@ -337,9 +338,9 @@ public class BorderUIResource
* Constructs a BevelBorderUIResource given its appearance type
* and all its colors.
*
- * <p><img src="../border/BevelBorder-3.png" width="500" height="150"
- * alt="[An illustration showing BevelBorders that were constructed
- * with this method]" />
+ * <p><img src="../border/doc-files/BevelBorder-3.png" width="500"
+ * height="150" alt="[An illustration showing BevelBorders that
+ * were constructed with this method]" />
*
* @param bevelType the desired appearance of the border. The value
* must be either {@link javax.swing.border.BevelBorder#RAISED}
@@ -429,7 +430,8 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/EmptyBorder-1.png" width="290" height="200"
+ * <p><img src="../border/doc-files/EmptyBorder-1.png"
+ * width="290" height="200"
* alt="[An illustration of EmptyBorder]" />
*
* @author Brian Jones (cbj@gnu.org)
@@ -483,8 +485,9 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/EtchedBorder-1.png" width="500" height="200"
- * alt="[An illustration of the two EtchedBorder variants]" />
+ * <p><img src="../border/doc-files/EtchedBorder-1.png" width="500"
+ * height="200" alt="[An illustration of the two EtchedBorder
+ * variants]" />
*
* @author Brian Jones (cbj@gnu.org)
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -509,8 +512,9 @@ public class BorderUIResource
* appearance. The colors will be derived from the background
* color of the enclosed Component when the border gets painted.
*
- * <p><img src="../border/EtchedBorder-1.png" width="500" height="200"
- * alt="[An illustration of the two EtchedBorder variants]" />
+ * <p><img src="../border/doc-files/EtchedBorder-1.png"
+ * width="500" height="200" alt="[An illustration of the two
+ * EtchedBorder variants]" />
*
* @param etchType the desired appearance of the border. The value
* must be either {@link javax.swing.border.EtchedBorder#RAISED}
@@ -549,7 +553,7 @@ public class BorderUIResource
* appearance, explicitly selecting the colors that will be used
* for highlight and shadow.
*
- * <p><img src="../border/EtchedBorder-2.png" width="500"
+ * <p><img src="../border/doc-files/EtchedBorder-2.png" width="500"
* height="200" alt="[An illustration that shows which pixels get
* painted in what color]" />
*
@@ -583,8 +587,8 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/LineBorder-1.png" width="500" height="200"
- * alt="[An illustration of two LineBorders] />
+ * <p><img src="../border/doc-files/LineBorder-1.png" width="500"
+ * height="200" alt="[An illustration of two LineBorders] />
*
* @author Brian Jones (cbj@gnu.org)
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -638,8 +642,8 @@ public class BorderUIResource
* always install borders that implement <code>UIResource</code>,
* such as the borders provided by this class.
*
- * <p><img src="../border/MatteBorder-1.png" width="500" height="150"
- * alt="[An illustration of two MatteBorders] />
+ * <p><img src="../border/doc-files/MatteBorder-1.png" width="500"
+ * height="150" alt="[An illustration of two MatteBorders] />
*
* @author Brian Jones (cbj@gnu.org)
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -652,8 +656,9 @@ public class BorderUIResource
* Constructs a MatteBorderUIResource given the width on each side
* and a fill color.
*
- * <p><img src="../border/MatteBorder-2.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
+ * <p><img src="../border/doc-files/MatteBorder-2.png" width="500"
+ * height="150" alt="[A picture of a MatteBorder made by this
+ * constructor]" />
*
* @param top the width of the border at its top edge.
* @param left the width of the border at its left edge.
@@ -673,7 +678,7 @@ public class BorderUIResource
* Constructs a MatteBorderUIResource given the width on each side
* and an icon for tiling the border area.
*
- * <p><img src="../border/MatteBorder-4.png" width="500"
+ * <p><img src="../border/doc-files/MatteBorder-4.png" width="500"
* height="150" alt="[A picture of a MatteBorder made by this
* constructor]" />
*
@@ -697,10 +702,11 @@ public class BorderUIResource
* the left and right edge, the icon height for the top and bottom
* edge.
*
- * <p><img src="../border/MatteBorder-6.png" width="500" height="150"
- * alt="[A picture of a MatteBorder made by this constructor]" />
+ * <p><img src="../border/doc-files/MatteBorder-6.png" width="500"
+ * height="150" alt="[A picture of a MatteBorder made by this
+ * constructor]" />
*
- * @param tileIcon an icon for tiling the border area.
+ * @param tileIcon an icon for tiling the border area.
*/
public MatteBorderUIResource(Icon tileIcon)
{
diff --git a/libjava/javax/swing/plaf/ComponentUI.java b/libjava/javax/swing/plaf/ComponentUI.java
index 22c2f30fd7b..5147ebb9609 100644
--- a/libjava/javax/swing/plaf/ComponentUI.java
+++ b/libjava/javax/swing/plaf/ComponentUI.java
@@ -50,7 +50,7 @@ import javax.swing.JComponent;
* should not need to access this class; it is internal to Swing
* and the look-and-feel implementations.
*
- * <p><img src="ComponentUI-1.png" width="700" height="550"
+ * <p><img src="doc-files/ComponentUI-1.png" width="700" height="550"
* alt="[UML diagram illustrating the architecture for pluggable
* look and feels]" />
*
diff --git a/libjava/javax/swing/plaf/TreeUI.java b/libjava/javax/swing/plaf/TreeUI.java
index 59dca9d877f..55327e2a014 100644
--- a/libjava/javax/swing/plaf/TreeUI.java
+++ b/libjava/javax/swing/plaf/TreeUI.java
@@ -125,8 +125,8 @@ public abstract class TreeUI
/**
* Finds the path that is closest to the specified position.
*
- * <p><img src="TreeUI-1.png" width="300" height="250"
- * alt="[A screen shot of a JTree] />
+ * <p><img src="doc-files/TreeUI-1.png" width="300" height="250"
+ * alt="[A screen shot of a JTree]" />
*
* <p>As shown by the above illustration, the bounds of the
* closest path do not necessarily need to contain the passed
diff --git a/libjava/javax/swing/plaf/basic/BasicBorders.java b/libjava/javax/swing/plaf/basic/BasicBorders.java
index 8b8a8513fc3..7002d14332c 100644
--- a/libjava/javax/swing/plaf/basic/BasicBorders.java
+++ b/libjava/javax/swing/plaf/basic/BasicBorders.java
@@ -85,7 +85,7 @@ public class BasicBorders
* <code>&#x201c;Button.light&#x201d;</code>, and
* <code>&#x201c;Button.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.ButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
* height="170" alt="[A screen shot of the returned border]" />
*
* @return a {@link
@@ -135,7 +135,7 @@ public class BasicBorders
* <code>&#x201c;RadioButton.light&#x201d;</code>, and
* <code>&#x201c;RadioButton.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.RadioButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
* height="135" alt="[A screen shot of the returned border]" />
*
* @return a {@link
@@ -187,7 +187,7 @@ public class BasicBorders
* <code>&#x201c;ToggleButton.light&#x201d;</code>, and
* <code>&#x201c;ToggleButton.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.ToggleButtonBorder-1.png" width="270"
+ * <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png" width="270"
* height="135" alt="[A screen shot of the returned border]" />
*
* @return a {@link
@@ -238,7 +238,7 @@ public class BasicBorders
* using the keys <code>&#x201c;MenuBar.shadow&#x201d;</code> and
* <code>&#x201c;MenuBar.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
* height="140" alt="[A screen shot of a JMenuBar with this border]" />
*
* @return a {@link #MenuBarBorder}.
@@ -266,10 +266,10 @@ public class BasicBorders
* using the keys <code>&#x201c;SplitPane.darkShadow&#x201d;</code> and
* <code>&#x201c;SplitPane.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
- * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
*
* @return a {@link #SplitPaneBorder}.
@@ -299,8 +299,9 @@ public class BasicBorders
* <code>&#x201c;SplitPane.highlight&#x201d;</code>. The color of the
* other two edges is the background color of the divider.
*
- * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png" width="520"
- * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
+ * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
+ * width="520" height="200" alt=
+ * "[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
* @return an instance of <code>SplitPaneDividerBorder</code>, which is
* not a public API class of this package.
@@ -334,7 +335,7 @@ public class BasicBorders
* <code>&#x201c;TextField.light&#x201d;</code>, and
* <code>&#x201c;TextField.highlight&#x201d;</code>.
*
- * <p><img src="BasicBorders.FieldBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.FieldBorder-1.png" width="500"
* height="200" alt="[A screen shot of a border returned by
* this method]" />
*
@@ -364,7 +365,7 @@ public class BasicBorders
* feels better use different borders for their progress bars, or
* they will look really terrible.
*
- * <p><img src="BasicBorders-1.png" width="120" height="80"
+ * <p><img src="doc-files/BasicBorders-1.png" width="120" height="80"
* alt="[A screen shot of a border returned by this method]" />
*/
public static Border getProgressBarBorder()
@@ -380,7 +381,7 @@ public class BasicBorders
* Returns a border that is composed of a raised bevel border and a
* one-pixel thick line border.
*
- * <p><img src="BasicBorders-2.png" width="300" height="200"
+ * <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
* alt="[A screen shot of a border returned by this method]" />
*
* <p>The colors of the border are retrieved from the
@@ -440,7 +441,7 @@ public class BasicBorders
* A border whose appearance depends on the state of
* the enclosed button.
*
- * <p><img src="BasicBorders.ButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
* height="170" alt="[A screen shot of this border]" />
*
* @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
@@ -616,7 +617,7 @@ public class BasicBorders
* A border that makes its enclosed component appear as lowered
* into the surface. Typically used for text fields.
*
- * <p><img src="BasicBorders.FieldBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.FieldBorder-1.png" width="500"
* height="200" alt="[A screen shot of this border]" />
*
* @see javax.swing.plaf.basic.BasicGraphicsUtils#drawEtchedRect
@@ -784,7 +785,7 @@ public class BasicBorders
* component. If the enclosed component has no such method,
* this border will not occupy any space.
*
- * <p><img src="BasicBorders.MarginBorder-1.png" width="325"
+ * <p><img src="doc-files/BasicBorders.MarginBorder-1.png" width="325"
* height="200" alt="[An illustration that shows how MarginBorder
* determines its borders]" />
*
@@ -885,7 +886,7 @@ public class BasicBorders
/**
* A border for drawing a separator line below JMenuBar.
*
- * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
* height="140" alt="[A screen shot of a JMenuBar with this border]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -919,7 +920,7 @@ public class BasicBorders
* Constructs a new MenuBarBorder for drawing a JMenuBar in
* the Basic look and feel.
*
- * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * <p><img src="doc-files/BasicBorders.MenuBarBorder-1.png" width="500"
* height="140" alt="[A screen shot of a JMenuBar with this
* border]" />
*
@@ -1041,7 +1042,7 @@ public class BasicBorders
/**
* A border for drawing radio buttons in the Basic look and feel.
*
- * <p><img src="BasicBorders.RadioButtonBorder-1.png" width="300"
+ * <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
* height="135" alt="[A screen shot of this border]" />
*
* <p>Note about the screen shot: Normally, the
@@ -1285,10 +1286,10 @@ public class BasicBorders
* in the middle of the JSplitPane has its own border class, of which
* an instance can be obtained with {@link #getSplitPaneDividerBorder()}.
*
- * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
- * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
*
* <p>In contrast to the other borders of the Basic look and feel,
@@ -1300,7 +1301,7 @@ public class BasicBorders
* painted if the orientation of the enclosed JSplitPane is
* <code>JSplitPane.VERTICAL_SPLIT</code> (at least in versions
* 1.3.1 and 1.4.1). GNU Classpath does not replicate this bug. A
- * report has been filed with Sun (review ID 188773).
+ * report has been filed with Sun (bug ID 4885629).
*
* <p>Note that the bottom left pixel of the border has a different
* color depending on the orientation of the enclosed JSplitPane.
@@ -1381,10 +1382,10 @@ public class BasicBorders
/**
* Paints the border around a <code>JSplitPane</code>.
*
- * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
*
- * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * <p><img src="doc-files/BasicBorders.SplitPaneBorder-2.png" width="520"
* height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
*
* @param c the <code>JSplitPane</code> whose border is to be painted.
@@ -1535,7 +1536,7 @@ public class BasicBorders
/**
* A border for the divider inside a JSplitPane.
*
- * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png"
+ * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
* width="520" height="200" alt="[A screen shot of this border]" />
*
* @author Sascha Brawer (brawer@dandelis.ch)
@@ -1575,9 +1576,9 @@ public class BasicBorders
/**
* Paints the border around the divider of a <code>JSplitPane</code>.
*
- * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png" width="520"
- * height="200" alt="[A picture that shows which pixels get painted
- * in what color]" />
+ * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png"
+ * width="520" height="200" alt="[A picture that shows which pixels
+ * get painted in what color]" />
*
* @param c the <code>JSplitPane</code> whose divider&#x2019;s border
* is to be painted.
@@ -1687,8 +1688,8 @@ public class BasicBorders
/**
* A border for toggle buttons in the Basic look and feel.
*
- * <p><img src="BasicBorders.ToggleButtonBorder-1.png" width="270"
- * height="135" alt="[A screen shot of this border]" />
+ * <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png"
+ * width="270" height="135" alt="[A screen shot of this border]" />
*
* <p>The Sun implementation always seems to draw exactly
* the same border, irrespective of the state of the button.
diff --git a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
index a7b64111f53..d7b53d54f6c 100644
--- a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
@@ -78,7 +78,7 @@ public class BasicGraphicsUtils
* Draws a rectangle that appears etched into the surface, given
* four colors that are used for drawing.
*
- * <p><img src="BasicGraphicsUtils-1.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-1.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -166,7 +166,7 @@ public class BasicGraphicsUtils
* Draws a rectangle that appears etched into the surface, given
* two colors that are used for drawing.
*
- * <p><img src="BasicGraphicsUtils-2.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-2.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -224,7 +224,7 @@ public class BasicGraphicsUtils
* Draws a border that is suitable for buttons of the Basic look and
* feel.
*
- * <p><img src="BasicGraphicsUtils-3.png" width="500"
+ * <p><img src="doc-files/BasicGraphicsUtils-3.png" width="500"
* height="300" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -305,7 +305,7 @@ public class BasicGraphicsUtils
* Draws a rectangle that appears lowered into the surface, given
* four colors that are used for drawing.
*
- * <p><img src="BasicGraphicsUtils-4.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-4.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted in what color]" />
*
@@ -362,7 +362,7 @@ public class BasicGraphicsUtils
* drawn without underlining. Drawing is performed in the current
* color and font of <code>g</code>.
*
- * <p><img src="BasicGraphicsUtils-5.png" width="500"
+ * <p><img src="doc-files/BasicGraphicsUtils-5.png" width="500"
* height="100" alt="[An illustration showing how to use the
* method]" />
*
@@ -413,7 +413,7 @@ public class BasicGraphicsUtils
* at the specified index. Drawing is performed in the current color
* and font of <code>g</code>.
*
- * <p><img src="BasicGraphicsUtils-5.png" width="500"
+ * <p><img src="doc-files/BasicGraphicsUtils-5.png" width="500"
* height="100" alt="[An illustration showing how to use the
* method]" />
*
@@ -540,7 +540,7 @@ public class BasicGraphicsUtils
* those pixels is the current color of the Graphics <code>g</code>.
* Any other pixels are left unchanged.
*
- * <p><img src="BasicGraphicsUtils-7.png" width="360"
+ * <p><img src="doc-files/BasicGraphicsUtils-7.png" width="360"
* height="200" alt="[An illustration that shows which pixels
* get painted]" />
*
diff --git a/libjava/javax/swing/plaf/basic/BasicLabelUI.java b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
index 0adad4dafa5..51c694a7331 100644
--- a/libjava/javax/swing/plaf/basic/BasicLabelUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
@@ -38,22 +38,32 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import java.awt.*;
-
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.LabelUI;
public class BasicLabelUI extends LabelUI
+ implements PropertyChangeListener
{
int gap = 3;
-
Color foreground;
public static ComponentUI createUI(final JComponent c) {
return new BasicLabelUI();
}
-
+
public void installUI(final JComponent c) {
super.installUI(c);
@@ -182,20 +192,11 @@ public class BasicLabelUI extends LabelUI
g.drawLine(0,0,100,100);
- BasicGraphicsUtils.drawString(g,
- text,
- 0,
- 0,//textRect.x,
- 0);//textRect.y);
+ BasicGraphicsUtils.drawString(g, text, 0, 0 /*textRect.x*/, 0 /*textRect.y*/);
}
-}
-
-
-
-
-
-
-
-
-
+ public void propertyChange (PropertyChangeEvent event)
+ {
+ throw new Error ("Not implemented");
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
index c9e0c798e4e..ff73edbc871 100644
--- a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -64,7 +64,7 @@ import javax.swing.text.JTextComponent;
public abstract class BasicLookAndFeel extends LookAndFeel
implements Serializable
{
- static final long serialVersionUID = 5484702182266873258L;
+ static final long serialVersionUID = -6096995660290287879L;
/**
* Constructor BasicLookAndFeel
diff --git a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index a5c813d62f7..bbdcfb5500a 100644
--- a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -38,11 +38,18 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import javax.swing.*;
-import java.awt.*;
-import javax.swing.plaf.*;
-
-public class BasicTabbedPaneUI extends TabbedPaneUI
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import javax.swing.JComponent;
+import javax.swing.JTabbedPane;
+import javax.swing.SwingConstants;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.TabbedPaneUI;
+
+public class BasicTabbedPaneUI extends TabbedPaneUI
+ implements SwingConstants
{
public static ComponentUI createUI(final JComponent c)
{
diff --git a/libjava/javax/swing/plaf/basic/BasicTextUI.java b/libjava/javax/swing/plaf/basic/BasicTextUI.java
index 0930610a3a9..321889c5124 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextUI.java
@@ -38,12 +38,25 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import javax.swing.text.*;
-import javax.swing.plaf.*;
-import java.awt.*;
-import javax.swing.*;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.TextUI;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.DefaultEditorKit;
+import javax.swing.text.EditorKit;
+import javax.swing.text.Element;
+import javax.swing.text.JTextComponent;
+import javax.swing.text.Position;
+import javax.swing.text.View;
+import javax.swing.text.ViewFactory;
public class BasicTextUI extends TextUI
+ implements ViewFactory
{
int gap = 3;
View view = null; // was: new RootView();
@@ -167,9 +180,10 @@ public class BasicTextUI extends TextUI
{
return 0;
}
-}
-
-
-
-
+ public View create (Element elem)
+ {
+ // subclasses have to implement this to get this functionality
+ return null;
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
index d9af1010ba7..dac2f01601b 100644
--- a/libjava/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
@@ -132,8 +132,8 @@ public class BasicTreeUI
/**
* Finds the path that is closest to the specified position.
*
- * <p><img src="../TreeUI-1.png" width="300" height="250"
- * alt="[A screen shot of a JTree] />
+ * <p><img src="../doc-files/TreeUI-1.png" width="300" height="250"
+ * alt="[A screen shot of a JTree]" />
*
* <p>As shown by the above illustration, the bounds of the
* closest path do not necessarily need to contain the passed
diff --git a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
index 996fd4e4a3c..fccabd1d529 100644
--- a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -36,14 +36,14 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-package javax.swing.plaf.metal;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
+package javax.swing.plaf.metal;
+import javax.swing.UIDefaults;
+import javax.swing.plaf.basic.BasicDefaults;
+import javax.swing.plaf.basic.BasicLookAndFeel;
-public class MetalLookAndFeel extends LookAndFeel
+public class MetalLookAndFeel extends BasicLookAndFeel
{
public boolean isNativeLookAndFeel() { return true; }
public boolean isSupportedLookAndFeel() { return true; }
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 81ef0f7d36a..857ee4bc3dd 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -418,6 +418,18 @@ _Jv_JNI_PopSystemFrame (JNIEnv *env)
}
}
+template<typename T> T extract_from_jvalue(jvalue const & t);
+template<> jboolean extract_from_jvalue(jvalue const & jv) { return jv.z; }
+template<> jbyte extract_from_jvalue(jvalue const & jv) { return jv.b; }
+template<> jchar extract_from_jvalue(jvalue const & jv) { return jv.c; }
+template<> jshort extract_from_jvalue(jvalue const & jv) { return jv.s; }
+template<> jint extract_from_jvalue(jvalue const & jv) { return jv.i; }
+template<> jlong extract_from_jvalue(jvalue const & jv) { return jv.j; }
+template<> jfloat extract_from_jvalue(jvalue const & jv) { return jv.f; }
+template<> jdouble extract_from_jvalue(jvalue const & jv) { return jv.d; }
+template<> jobject extract_from_jvalue(jvalue const & jv) { return jv.l; }
+
+
// This function is used from other template functions. It wraps the
// return value appropriately; we specialize it so that object returns
// are turned into local references.
@@ -430,7 +442,7 @@ wrap_value (JNIEnv *, T value)
// This specialization is used for jobject, jclass, jstring, jarray,
// etc.
-template<typename T>
+template<typename R, typename T>
static T *
wrap_value (JNIEnv *env, T *value)
{
@@ -491,7 +503,7 @@ static jclass
java::lang::ClassLoader *loader = NULL;
if (env->klass != NULL)
- loader = env->klass->getClassLoader ();
+ loader = env->klass->getClassLoaderInternal ();
if (loader == NULL)
{
@@ -777,15 +789,11 @@ static T
return_type = klass;
jvalue result;
- jthrowable ex = _Jv_CallAnyMethodA (obj, return_type, id,
- style == constructor,
- arg_types, args, &result);
-
- if (ex != NULL)
- env->ex = ex;
+ _Jv_CallAnyMethodA (obj, return_type, id,
+ style == constructor,
+ arg_types, args, &result);
- // We cheat a little here. FIXME.
- return wrap_value (env, * (T *) &result);
+ return wrap_value (env, extract_from_jvalue<T>(result));
}
catch (jthrowable t)
{
@@ -847,15 +855,11 @@ static T
}
jvalue result;
- jthrowable ex = _Jv_CallAnyMethodA (obj, return_type, id,
- style == constructor,
- arg_types, arg_copy, &result);
+ _Jv_CallAnyMethodA (obj, return_type, id,
+ style == constructor,
+ arg_types, arg_copy, &result);
- if (ex != NULL)
- env->ex = ex;
-
- // We cheat a little here. FIXME.
- return wrap_value (env, * (T *) &result);
+ return wrap_value (env, extract_from_jvalue<T>(result));
}
catch (jthrowable t)
{
@@ -893,12 +897,9 @@ static void
if (style == constructor)
return_type = klass;
- jthrowable ex = _Jv_CallAnyMethodA (obj, return_type, id,
- style == constructor,
- arg_types, args, NULL);
-
- if (ex != NULL)
- env->ex = ex;
+ _Jv_CallAnyMethodA (obj, return_type, id,
+ style == constructor,
+ arg_types, args, NULL);
}
catch (jthrowable t)
{
@@ -947,12 +948,9 @@ static void
arg_copy[i].l = unwrap (args[i].l);
}
- jthrowable ex = _Jv_CallAnyMethodA (obj, return_type, id,
- style == constructor,
- arg_types, args, NULL);
-
- if (ex != NULL)
- env->ex = ex;
+ _Jv_CallAnyMethodA (obj, return_type, id,
+ style == constructor,
+ arg_types, args, NULL);
}
catch (jthrowable t)
{
@@ -1189,7 +1187,7 @@ static jfieldID
// FIXME: what if field_class == NULL?
- java::lang::ClassLoader *loader = clazz->getClassLoader ();
+ java::lang::ClassLoader *loader = clazz->getClassLoaderInternal ();
while (clazz != NULL)
{
// We acquire the class lock so that fields aren't resolved
@@ -2120,9 +2118,7 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
function = _Jv_FindSymbolInExecutable (buf + 1);
}
}
-#else /* WIN32 */
- args_size; /* Dummy statement to avoid unused parameter warning */
-#endif /* ! WIN32 */
+#endif /* WIN32 */
if (function == NULL)
{
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
index 2c574942b21..24b8f4e8c07 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
@@ -191,27 +191,40 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawString
jstring fname, jint size)
{
struct graphics *g;
- const char *cfname, *cstr;
- gchar *xlfd;
+ const char *cstr;
+ const char *font_name;
+ PangoFontDescription *font_desc;
+ PangoContext *context;
+ PangoLayout *layout;
g = (struct graphics *) NSA_GET_PTR (env, obj);
-
- cfname = (*env)->GetStringUTFChars (env, fname, NULL);
- xlfd = g_strdup_printf (cfname, (size * 10));
- (*env)->ReleaseStringUTFChars (env, fname, cfname);
cstr = (*env)->GetStringUTFChars (env, str, NULL);
+ font_name = (*env)->GetStringUTFChars (env, fname, NULL);
gdk_threads_enter ();
- gdk_draw_string (g->drawable, gdk_font_load (xlfd), g->gc,
- x + g->x_offset, y + g->y_offset, 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);
+
+ gdk_draw_layout (g->drawable, g->gc,
+ x + g->x_offset, y + g->y_offset, layout);
+
+ pango_font_description_free (font_desc);
+
gdk_threads_leave ();
+ (*env)->ReleaseStringUTFChars (env, fname, font_name);
(*env)->ReleaseStringUTFChars (env, str, cstr);
- g_free (xlfd);
}
-
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawLine
(JNIEnv *env, jobject obj, jint x, jint y, jint x2, jint y2)
{
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
new file mode 100644
index 00000000000..04eb2e5a524
--- /dev/null
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
@@ -0,0 +1,1069 @@
+/* gnu_java_awt_peer_gtk_GdkGraphics2d.c
+ 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 "gnu_java_awt_peer_gtk_GdkGraphics2D.h"
+#include <gdk/gdktypes.h>
+#include <gdk/gdkprivate.h>
+#include <gdk/gdkx.h>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk-pixbuf/gdk-pixdata.h>
+
+#include <cairo.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+struct state_table *native_graphics2d_state_table;
+
+#define NSA_G2D_INIT(env, clazz) \
+ native_graphics2d_state_table = init_state_table (env, clazz)
+
+#define NSA_GET_G2D_PTR(env, obj) \
+ get_state (env, obj, native_graphics2d_state_table)
+
+#define NSA_SET_G2D_PTR(env, obj, ptr) \
+ set_state (env, obj, native_graphics2d_state_table, (void *)ptr)
+
+#define NSA_DEL_G2D_PTR(env, obj) \
+ remove_state_slot (env, obj, native_graphics2d_state_table)
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initStaticState
+ (JNIEnv *env, jclass clazz)
+{
+ NSA_G2D_INIT (env, clazz);
+}
+
+/* these public final constants are part of the java2d public API, so we
+ write them explicitly here to save fetching them from the constant pool
+ all the time. */
+
+#ifndef min
+#define min(x,y) ((x) < (y) ? (x) : (y))
+#endif
+
+enum java_awt_alpha_composite_rule
+ {
+ java_awt_alpha_composite_CLEAR = 1,
+ java_awt_alpha_composite_SRC = 2,
+ java_awt_alpha_composite_SRC_OVER = 3,
+ java_awt_alpha_composite_DST_OVER = 4,
+ java_awt_alpha_composite_SRC_IN = 5,
+ java_awt_alpha_composite_DST_IN = 6,
+ java_awt_alpha_composite_SRC_OUT = 7,
+ java_awt_alpha_composite_DST_OUT = 8,
+ java_awt_alpha_composite_DST = 9,
+ java_awt_alpha_composite_SRC_ATOP = 10,
+ java_awt_alpha_composite_DST_ATOP = 11,
+ java_awt_alpha_composite_XOR = 12
+ };
+
+enum java_awt_basic_stroke_join_rule
+ {
+ java_awt_basic_stroke_JOIN_MITER = 0,
+ java_awt_basic_stroke_JOIN_ROUND = 1,
+ java_awt_basic_stroke_JOIN_BEVEL = 2
+ };
+
+enum java_awt_basic_stroke_cap_rule
+ {
+ java_awt_basic_stroke_CAP_BUTT = 0,
+ java_awt_basic_stroke_CAP_ROUND = 1,
+ java_awt_basic_stroke_CAP_SQUARE = 2
+ };
+
+enum java_awt_geom_path_iterator_winding_rule
+ {
+ java_awt_geom_path_iterator_WIND_EVEN_ODD = 0,
+ java_awt_geom_path_iterator_WIND_NON_ZERO = 1
+ };
+
+
+static void
+grab_current_drawable (GtkWidget *widget, GdkDrawable **draw, GdkWindow **win)
+{
+ g_assert (widget != NULL);
+ g_assert (draw != NULL);
+ g_assert (win != NULL);
+
+ if (GTK_IS_WINDOW (widget))
+ {
+ *win = find_gtk_layout (widget)->bin_window;
+ }
+ else if (GTK_IS_LAYOUT (widget))
+ {
+ *win = GTK_LAYOUT (widget)->bin_window;
+ }
+ else
+ {
+ *win = widget->window;
+ }
+
+ *draw = *win;
+ gdk_window_get_internal_paint_info (*win, draw, 0, 0);
+ g_object_ref (*draw);
+}
+
+
+static int
+x_server_has_render_extension (void)
+{
+ int ev = 0, err = 0;
+ return (int) XRenderQueryExtension (GDK_DISPLAY (), &ev, &err);
+}
+
+
+static void
+init_graphics2d_as_pixbuf (struct graphics2d *gr)
+{
+ gint width, height;
+ gint bits_per_sample = 8;
+ gint total_channels = 4;
+ gboolean has_alpha = TRUE;
+
+ g_assert (gr != NULL);
+ g_assert (gr->drawable != NULL);
+
+ if (gr->debug) printf ("initializing graphics2d as pixbuf\n");
+ gdk_drawable_get_size (gr->drawable, &width, &height);
+ gr->drawbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+ has_alpha, bits_per_sample,
+ width, height);
+ g_assert (gr->drawbuf != NULL);
+ g_assert (gdk_pixbuf_get_bits_per_sample (gr->drawbuf) == bits_per_sample);
+ g_assert (gdk_pixbuf_get_n_channels (gr->drawbuf) == total_channels);
+
+ gr->surface = cairo_surface_create_for_image (gdk_pixbuf_get_pixels (gr->drawbuf),
+ CAIRO_FORMAT_ARGB32,
+ gdk_pixbuf_get_width (gr->drawbuf),
+ gdk_pixbuf_get_height (gr->drawbuf),
+ gdk_pixbuf_get_rowstride (gr->drawbuf));
+ g_assert (gr->surface != NULL);
+ g_assert (gr->cr != NULL);
+ cairo_set_target_surface (gr->cr, gr->surface);
+}
+
+static void
+init_graphics2d_as_renderable (struct graphics2d *gr)
+{
+ Drawable draw;
+ Display * dpy;
+ Visual * vis;
+
+ g_assert (gr != NULL);
+ g_assert (gr->drawable != NULL);
+
+ gr->drawbuf = NULL;
+
+ if (gr->debug) printf ("initializing graphics2d as renderable\n");
+ draw = gdk_x11_drawable_get_xid (gr->drawable);
+
+ dpy = gdk_x11_drawable_get_xdisplay (gr->drawable);
+ g_assert (dpy != NULL);
+
+ vis = gdk_x11_visual_get_xvisual (gdk_drawable_get_visual (gr->drawable));
+ g_assert (vis != NULL);
+
+ gr->surface = cairo_surface_create_for_drawable (dpy, draw, vis,
+ CAIRO_FORMAT_ARGB32,
+ DefaultColormap (dpy, DefaultScreen (dpy)));
+ g_assert (gr->surface != NULL);
+ g_assert (gr->cr != NULL);
+ cairo_set_target_surface (gr->cr, gr->surface);
+}
+
+static void
+begin_drawing_operation (struct graphics2d * gr)
+{
+ gdk_threads_enter ();
+ if (gr->drawbuf)
+ {
+
+ gint drawable_width, drawable_height;
+ gint pixbuf_width, pixbuf_height;
+ gint width, height;
+
+ gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
+ pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
+ pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
+ width = min (drawable_width, pixbuf_width);
+ height = min (drawable_height, pixbuf_height);
+
+ gdk_pixbuf_get_from_drawable (gr->drawbuf, /* destination pixbuf */
+ gr->drawable,
+ NULL, /* colormap */
+ 0, 0, 0, 0,
+ width, height);
+
+ if (gr->debug) printf ("copied (%d, %d) pixels from GDK drawable to pixbuf\n",
+ width, height);
+ }
+}
+
+static void
+end_drawing_operation (struct graphics2d * gr)
+{
+ if (gr->drawbuf)
+ {
+ gint drawable_width, drawable_height;
+ gint pixbuf_width, pixbuf_height;
+ gint width, height;
+
+ gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
+ pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
+ pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
+ width = min (drawable_width, pixbuf_width);
+ height = min (drawable_height, pixbuf_height);
+
+ gdk_draw_pixbuf (gr->drawable, NULL, gr->drawbuf,
+ 0, 0, 0, 0,
+ width, height,
+ GDK_RGB_DITHER_NORMAL, 0, 0);
+
+ if (gr->debug) printf ("copied (%d, %d) pixels from pixbuf to GDK drawable\n",
+ width, height);
+ }
+ gdk_threads_leave ();
+}
+
+
+static void
+update_pattern_transform (struct graphics2d *gr)
+{
+ double a, b, c, d, tx, ty;
+ cairo_matrix_t *mat = NULL;
+
+ g_assert (gr != NULL);
+ if (gr->pattern == NULL)
+ return;
+
+ return;
+ /* temporarily disabled: ambiguous behavior */
+ /* cairo_get_matrix (gr->cr, &a, &b, &c, &d, &tx, &ty); */
+ mat = cairo_matrix_create ();
+ g_assert (mat != NULL);
+ cairo_matrix_set_affine (mat, a, b, c, d, tx, ty);
+ cairo_surface_set_matrix (gr->pattern, mat);
+ cairo_matrix_destroy (mat);
+}
+
+static void
+check_for_debug (struct graphics2d *gr)
+{
+ gr->debug = (gboolean)(getenv("DEBUGJ2D") != NULL);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_copyState
+ (JNIEnv *env, jobject obj, jobject old)
+{
+ struct graphics2d *g = NULL, *g_old = NULL;
+
+ g = (struct graphics2d *) malloc (sizeof (struct graphics2d));
+ g_assert (g != NULL);
+ memset (g, 0, sizeof(struct graphics2d));
+
+ g_old = (struct graphics2d *) NSA_GET_G2D_PTR (env, old);
+ g_assert (g_old != NULL);
+
+ g->drawable = g_old->drawable;
+ g->debug = g_old->debug;
+
+ gdk_threads_enter ();
+ g_object_ref (g->drawable);
+
+ g->cr = cairo_create();
+ g_assert (g->cr != NULL);
+
+ if (x_server_has_render_extension ())
+ init_graphics2d_as_renderable (g);
+ else
+ init_graphics2d_as_pixbuf (g);
+
+ cairo_surface_set_filter (g->surface, CAIRO_FILTER_BILINEAR);
+
+ gdk_threads_leave ();
+
+ NSA_SET_G2D_PTR (env, obj, g);
+}
+
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__II
+ (JNIEnv *env, jobject obj, jint width, jint height)
+{
+ struct graphics2d *gr;
+
+ gdk_threads_enter ();
+
+ gr = (struct graphics2d *) malloc (sizeof (struct graphics2d));
+ g_assert (gr != NULL);
+ memset (gr, 0, sizeof(struct graphics2d));
+
+ check_for_debug (gr);
+
+ if (gr->debug) printf ("constructing offscreen drawable of size (%d,%d)\n",
+ width, height);
+
+ gr->drawable = (GdkDrawable *) gdk_pixmap_new (NULL, width, height,
+ gdk_rgb_get_visual ()->depth);
+ g_assert (gr->drawable != NULL);
+
+ gr->cr = cairo_create();
+ g_assert (gr->cr != NULL);
+
+ if (x_server_has_render_extension ())
+ init_graphics2d_as_renderable (gr);
+ else
+ init_graphics2d_as_pixbuf (gr);
+
+ gdk_threads_leave ();
+ if (gr->debug) printf ("constructed offscreen drawable of size (%d,%d)\n",
+ width, height);
+ NSA_SET_G2D_PTR (env, obj, gr);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable
+ (JNIEnv *env, jobject self, jobject other, jint x, jint y)
+{
+ struct graphics2d *src = NULL, *dst = NULL;
+ gint s_height, s_width, d_height, d_width, height, width;
+ GdkGC *gc;
+
+ src = (struct graphics2d *)NSA_GET_G2D_PTR (env, other);
+ dst = (struct graphics2d *)NSA_GET_G2D_PTR (env, self);
+ g_assert (src != NULL);
+ g_assert (dst != NULL);
+
+ if (src->debug) printf ("copying from offscreen drawable\n");
+
+ gdk_threads_enter ();
+ gdk_drawable_get_size (src->drawable, &s_width, &s_height);
+ gdk_drawable_get_size (dst->drawable, &d_width, &d_height);
+ width = min (s_width, d_width);
+ height = min (s_width, d_height);
+
+ gc = gdk_gc_new (dst->drawable);
+ g_assert (gc != NULL);
+
+ gdk_draw_drawable(dst->drawable, gc, src->drawable,
+ 0, 0, x, y, width, height);
+
+ g_object_unref (gc);
+
+ if (src->debug) printf ("copied %d x %d pixels from offscreen drawable\n", width, height);
+ gdk_threads_leave ();
+}
+
+static jintArray
+current_colors_of_widget (GtkWidget *widget, JNIEnv *env)
+{
+ GdkColor color;
+ jintArray array;
+ jint *rgb;
+
+ g_assert (widget != NULL);
+ g_assert (env != NULL);
+
+ color = widget->style->fg[GTK_STATE_NORMAL];
+ array = (*env)->NewIntArray (env, 6);
+
+ rgb = (*env)->GetIntArrayElements (env, array, NULL);
+ rgb[0] = color.red >> 8;
+ rgb[1] = color.green >> 8;
+ rgb[2] = color.blue >> 8;
+
+ color = widget->style->bg[GTK_STATE_NORMAL];
+ rgb[3] = color.red >> 8;
+ rgb[4] = color.green >> 8;
+ rgb[5] = color.blue >> 8;
+
+ (*env)->ReleaseIntArrayElements (env, array, rgb, 0);
+
+ return array;
+}
+
+JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__Lgnu_java_awt_peer_gtk_GtkComponentPeer_2
+ (JNIEnv *env, jobject obj, jobject peer)
+{
+ struct graphics2d *gr = NULL;
+ GtkWidget *widget = NULL;
+ void *ptr = NULL;
+ jintArray color;
+
+ ptr = NSA_GET_PTR (env, peer);
+ g_assert (ptr != NULL);
+ gdk_threads_enter ();
+
+ gr = (struct graphics2d *) malloc (sizeof (struct graphics2d));
+ g_assert (gr != NULL);
+ memset (gr, 0, sizeof(struct graphics2d));
+
+ check_for_debug (gr);
+
+ gr->cr = cairo_create();
+ g_assert (gr->cr != NULL);
+
+ widget = GTK_WIDGET (ptr);
+ g_assert (widget != NULL);
+
+ grab_current_drawable (widget, &(gr->drawable), &(gr->win));
+ g_assert (gr->drawable != NULL);
+
+ if (x_server_has_render_extension ())
+ init_graphics2d_as_renderable (gr);
+ else
+ init_graphics2d_as_pixbuf (gr);
+
+ color = current_colors_of_widget (widget, env);
+
+ gdk_threads_leave ();
+ NSA_SET_G2D_PTR (env, obj, gr);
+ return color;
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_dispose
+ (JNIEnv *env, jobject obj)
+{
+ struct graphics2d *gr = NULL;
+
+ gr = (struct graphics2d *) NSA_DEL_G2D_PTR (env, obj);
+ if (gr == NULL)
+ return; /* dispose has been called more than once */
+
+ gdk_threads_enter ();
+
+ if (gr->surface)
+ cairo_surface_destroy (gr->surface);
+
+ cairo_destroy (gr->cr);
+
+ if (gr->drawbuf)
+ g_object_unref (gr->drawbuf);
+
+ g_object_unref (gr->drawable);
+ free (gr);
+
+ if (gr->pattern)
+ cairo_surface_destroy (gr->pattern);
+
+ if (gr->pattern_pixels)
+ free (gr->pattern_pixels);
+
+ if (gr->debug) printf ("disposed of graphics2d\n");
+
+ gdk_threads_leave ();
+}
+
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_setGradient
+ (JNIEnv *env, jobject obj,
+ jdouble x1, jdouble y1,
+ jdouble x2, jdouble y2,
+ jint r1, jint g1, jint b1, jint a1,
+ jint r2, jint g2, jint b2, jint a2,
+ jboolean cyclic)
+{
+ struct graphics2d *gr = NULL;
+ cairo_surface_t *surf = NULL;
+ cairo_matrix_t *mat = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+
+ if (gr->debug) printf ("setGradient (%f,%f) -> (%f,%f); (%d,%d,%d,%d) -> (%d,%d,%d,%d)\n",
+ x1, y1,
+ x2, y2,
+ r1, g1, b1, a1,
+ r2, g2, b2, a2);
+
+ cairo_save (gr->cr);
+
+ if (cyclic)
+ surf = cairo_surface_create_similar (gr->surface, CAIRO_FORMAT_ARGB32, 3, 2);
+ else
+ surf = cairo_surface_create_similar (gr->surface, CAIRO_FORMAT_ARGB32, 2, 2);
+ g_assert (surf != NULL);
+
+ cairo_set_target_surface (gr->cr, surf);
+
+ cairo_identity_matrix (gr->cr);
+
+ cairo_set_rgb_color (gr->cr, r1 / 255.0, g1 / 255.0, b1 / 255.0);
+ cairo_set_alpha (gr->cr, a1 / 255.0);
+ cairo_rectangle (gr->cr, 0, 0, 1, 2);
+ cairo_fill (gr->cr);
+
+ cairo_set_rgb_color (gr->cr, r2 / 255.0, g2 / 255.0, b2 / 255.0);
+ cairo_set_alpha (gr->cr, a2 / 255.0);
+ cairo_rectangle (gr->cr, 1, 0, 1, 2);
+ cairo_fill (gr->cr);
+
+ if (cyclic)
+ {
+ cairo_set_rgb_color (gr->cr, r1 / 255.0, g1 / 255.0, b1 / 255.0);
+ cairo_set_alpha (gr->cr, a1 / 255.0);
+ cairo_rectangle (gr->cr, 2, 0, 1, 2);
+ cairo_fill (gr->cr);
+ }
+
+ mat = cairo_matrix_create ();
+ g_assert (mat != NULL);
+
+ /*
+ consider the vector [x2 - x1, y2 - y1] = [p,q]
+
+ this is a line in space starting at an 'origin' x1, y1.
+
+ it can also be thought of as a "transformed" unit vector in either the
+ x or y directions. we have just *drawn* our gradient as a unit vector
+ (well, a 2-3x unit vector) in the x dimension. so what we want to know
+ is which transformation turns our existing unit vector into [p,q].
+
+ which means solving for M in
+
+ [p,q] = M[1,0]
+
+ [p,q] = |a b| [1,0]
+ |c d|
+
+ [p,q] = [a,c], with b = d = 0.
+
+ what does this mean? it means that our gradient is 1-dimensional; as
+ you move through the x axis of our 2 or 3 pixel gradient from logical
+ x positions 0 to 1, the transformation of your x coordinate under the
+ matrix M causes you to accumulate both x and y values in fill
+ space. the y value of a gradient coordinate is ignored, since the
+ gradient is one dimensional. which is correct.
+
+ unfortunately we want the opposite transformation, it seems, because of
+ the way cairo is going to use this transformation. I'm a bit confused by
+ that, but it seems to work right, so we take reciprocals of values and
+ negate offsets. oh well.
+
+ */
+
+ double a = (x2 - x1 == 0.) ? 0. : ((cyclic ? 3.0 : 2.0) / (x2 - x1));
+ double c = (y2 - y1 == 0.) ? 0. : (1. / (y2 - y1));
+ double dx = (x1 == 0.) ? 0. : 1. / x1;
+ double dy = (y1 == 0.) ? 0. : 1. / y1;
+
+ cairo_matrix_set_affine (mat,
+ a, 0.,
+ c, 0.,
+ dx, dy);
+
+ cairo_surface_set_matrix (surf, mat);
+ cairo_matrix_destroy (mat);
+ cairo_surface_set_filter (surf, CAIRO_FILTER_BILINEAR);
+
+ /* FIXME: repeating gradients (not to mention hold gradients) don't seem to work. */
+ /* cairo_surface_set_repeat (surf, cyclic ? 1 : 0); */
+
+ if (gr->pattern)
+ cairo_surface_destroy (gr->pattern);
+
+ if (gr->pattern_pixels)
+ {
+ free (gr->pattern_pixels);
+ gr->pattern_pixels = NULL;
+ }
+
+ gr->pattern = surf;
+
+ cairo_restore (gr->cr);
+ cairo_set_pattern (gr->cr, gr->pattern);
+
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_setTexturePixels
+ (JNIEnv *env, jobject obj, jintArray jarr, jint w, jint h, jint stride)
+{
+ struct graphics2d *gr = NULL;
+ jint *jpixels = NULL;
+
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+
+ if (gr->debug) printf ("setTexturePixels (%d pixels, %dx%d, stride: %d)\n",
+ (*env)->GetArrayLength (env, jarr), w, h, stride);
+
+ if (gr->pattern)
+ cairo_surface_destroy (gr->pattern);
+
+ if (gr->pattern_pixels)
+ free (gr->pattern_pixels);
+
+ gr->pattern = NULL;
+ gr->pattern_pixels = NULL;
+
+ gr->pattern_pixels = (char *) malloc (h * stride * 4);
+ g_assert (gr->pattern_pixels != NULL);
+
+ jpixels = (*env)->GetIntArrayElements (env, jarr, NULL);
+ g_assert (jpixels != NULL);
+ memcpy (gr->pattern_pixels, jpixels, h * stride * 4);
+ (*env)->ReleaseIntArrayElements (env, jarr, jpixels, 0);
+
+ gr->pattern = cairo_surface_create_for_image (gr->pattern_pixels,
+ CAIRO_FORMAT_ARGB32,
+ w, h, stride * 4);
+ g_assert (gr->pattern != NULL);
+ cairo_surface_set_repeat (gr->pattern, 1);
+ cairo_set_pattern (gr->cr, gr->pattern);
+
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_drawPixels
+ (JNIEnv *env, jobject obj, jintArray jarr, jint w, jint h, jint stride)
+{
+ struct graphics2d *gr = NULL;
+ jint *jpixels = 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);
+
+ jpixels = (*env)->GetIntArrayElements (env, jarr, NULL);
+ g_assert (jpixels != NULL);
+
+ begin_drawing_operation (gr);
+
+ {
+ cairo_surface_t *surf = cairo_surface_create_for_image ((char *)jpixels,
+ CAIRO_FORMAT_ARGB32,
+ w, h, stride * 4);
+ cairo_surface_set_filter (surf, CAIRO_FILTER_BILINEAR);
+ cairo_show_surface (gr->cr, surf, w, h);
+ cairo_surface_destroy (surf);
+ }
+
+ end_drawing_operation (gr);
+
+ (*env)->ReleaseIntArrayElements (env, jarr, jpixels, 0);
+
+}
+
+/* passthrough methods to cairo */
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSave
+ (JNIEnv *env, jobject obj)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_save\n");
+ cairo_save (gr->cr);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRestore
+ (JNIEnv *env, jobject obj)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_restore\n");
+ cairo_restore (gr->cr);
+ update_pattern_transform (gr);
+}
+
+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)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_matrix\n");
+
+ {
+ cairo_matrix_t * mat = cairo_matrix_create ();
+ cairo_matrix_set_affine (mat,
+ m00, m10,
+ m01, m11,
+ m02, m12);
+ cairo_set_matrix (gr->cr, mat);
+ cairo_matrix_destroy (mat);
+ }
+ update_pattern_transform (gr);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetOperator
+ (JNIEnv *env, jobject obj, jint op)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_operator %d\n", op);
+ switch ((enum java_awt_alpha_composite_rule) op)
+ {
+ case java_awt_alpha_composite_CLEAR:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_CLEAR);
+ break;
+
+ case java_awt_alpha_composite_SRC:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_SRC);
+ break;
+
+ case java_awt_alpha_composite_SRC_OVER:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_OVER);
+ break;
+
+ case java_awt_alpha_composite_DST_OVER:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_OVER_REVERSE);
+ break;
+
+ case java_awt_alpha_composite_SRC_IN:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_IN);
+ break;
+
+ case java_awt_alpha_composite_DST_IN:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_IN_REVERSE);
+ break;
+
+ case java_awt_alpha_composite_SRC_OUT:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_OUT);
+ break;
+
+ case java_awt_alpha_composite_DST_OUT:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_OUT_REVERSE);
+ break;
+
+ case java_awt_alpha_composite_DST:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_DST);
+ break;
+
+ case java_awt_alpha_composite_SRC_ATOP:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_ATOP);
+ break;
+
+ case java_awt_alpha_composite_DST_ATOP:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_ATOP_REVERSE);
+ break;
+
+ case java_awt_alpha_composite_XOR:
+ cairo_set_operator (gr->cr, CAIRO_OPERATOR_XOR);
+ break;
+ }
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetRGBColor
+ (JNIEnv *env, jobject obj, jdouble r, jdouble g, jdouble b)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+
+ /* this is a very weird fact: GDK Pixbufs and RENDER drawables consider
+ colors in opposite pixel order. I have no idea why. thus when you
+ draw to a PixBuf, you must exchange the R and B components of your
+ color. */
+
+ if (gr->debug) printf ("cairo_set_rgb_color (%f, %f, %f)\n", r, g, b);
+
+ if (gr->drawbuf)
+ cairo_set_rgb_color (gr->cr, b, g, r);
+ else
+ cairo_set_rgb_color (gr->cr, r, g, b);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetAlpha
+ (JNIEnv *env, jobject obj, jdouble a)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_alpha %f\n", a);
+ cairo_set_alpha (gr->cr, a);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetFillRule
+ (JNIEnv *env, jobject obj, jint rule)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ if (gr->debug) printf ("cairo_set_fill_rule %d\n", rule);
+ g_assert (gr != NULL);
+ switch ((enum java_awt_geom_path_iterator_winding_rule) rule)
+ {
+ case java_awt_geom_path_iterator_WIND_NON_ZERO:
+ cairo_set_fill_rule (gr->cr, CAIRO_FILL_RULE_WINDING);
+ break;
+ case java_awt_geom_path_iterator_WIND_EVEN_ODD:
+ cairo_set_fill_rule (gr->cr, CAIRO_FILL_RULE_EVEN_ODD);
+ break;
+ }
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetLineWidth
+ (JNIEnv *env, jobject obj, jdouble width)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_line_width %f\n", width);
+ cairo_set_line_width (gr->cr, width);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetLineCap
+ (JNIEnv *env, jobject obj, jint cap)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_line_cap %d\n", cap);
+ switch ((enum java_awt_basic_stroke_cap_rule) cap)
+ {
+ case java_awt_basic_stroke_CAP_BUTT:
+ cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_BUTT);
+ break;
+
+ case java_awt_basic_stroke_CAP_ROUND:
+ cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_ROUND);
+ break;
+
+ case java_awt_basic_stroke_CAP_SQUARE:
+ cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_SQUARE);
+ break;
+ }
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetLineJoin
+ (JNIEnv *env, jobject obj, jint join)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_line_join %d\n", join);
+ switch ((enum java_awt_basic_stroke_join_rule) join)
+ {
+ case java_awt_basic_stroke_JOIN_MITER:
+ cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_MITER);
+ break;
+
+ case java_awt_basic_stroke_JOIN_ROUND:
+ cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_ROUND);
+ break;
+
+ case java_awt_basic_stroke_JOIN_BEVEL:
+ cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_BEVEL);
+ break;
+ }
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetDash
+ (JNIEnv *env, jobject obj, jdoubleArray dashes, jint ndash, jdouble offset)
+{
+ struct graphics2d *gr = NULL;
+ jdouble *dasharr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_dash\n");
+ dasharr = (*env)->GetDoubleArrayElements (env, dashes, NULL);
+ g_assert (dasharr != NULL);
+ cairo_set_dash (gr->cr, dasharr, ndash, offset);
+ (*env)->ReleaseDoubleArrayElements (env, dashes, dasharr, 0);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetMiterLimit
+ (JNIEnv *env, jobject obj, jdouble miter)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_set_miter_limit %f\n", miter);
+ 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)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_new_path\n");
+ cairo_new_path (gr->cr);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoMoveTo
+ (JNIEnv *env, jobject obj, jdouble x, jdouble y)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_move_to (%f, %f)\n", x, y);
+ cairo_move_to (gr->cr, x, y);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoLineTo
+ (JNIEnv *env, jobject obj, jdouble x, jdouble y)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_line_to (%f, %f)\n", x, y);
+ cairo_line_to (gr->cr, x, y);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoCurveTo
+ (JNIEnv *env, jobject obj, jdouble x1, jdouble y1, jdouble x2, jdouble y2, jdouble x3, jdouble y3)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_curve_to (%f, %f), (%f, %f), (%f, %f)\n", x1, y1, x2, y2, x3, y3);
+ cairo_curve_to (gr->cr, x1, y1, x2, y2, x3, y3);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRelMoveTo
+ (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_rel_move_to (%f, %f)\n", dx, dy);
+ cairo_rel_move_to (gr->cr, dx, dy);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRelLineTo
+ (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_rel_line_to (%f, %f)\n", dx, dy);
+ cairo_rel_line_to (gr->cr, dx, dy);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRelCurveTo
+ (JNIEnv *env, jobject obj, jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2, jdouble dx3, jdouble dy3)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_rel_curve_to (%f, %f), (%f, %f), (%f, %f)\n", dx1, dy1, dx2, dy2, dx3, dy3);
+ cairo_rel_curve_to (gr->cr, dx1, dy1, dx2, dy2, dx3, dy3);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRectangle
+ (JNIEnv *env, jobject obj, jdouble x, jdouble y, jdouble width, jdouble height)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_rectangle (%f, %f) (%f, %f)\n", x, y, width, height);
+ cairo_rectangle (gr->cr, x, y, width, height);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClosePath
+ (JNIEnv *env, jobject obj)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_close_path\n");
+ cairo_close_path (gr->cr);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoStroke
+ (JNIEnv *env, jobject obj)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_stroke\n");
+ begin_drawing_operation (gr);
+ cairo_stroke (gr->cr);
+ end_drawing_operation (gr);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoFill
+ (JNIEnv *env, jobject obj)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_fill\n");
+ begin_drawing_operation (gr);
+ cairo_fill (gr->cr);
+ end_drawing_operation (gr);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClip
+ (JNIEnv *env, jobject obj)
+{
+ struct graphics2d *gr = NULL;
+ gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
+ g_assert (gr != NULL);
+ if (gr->debug) printf ("cairo_clip\n");
+ cairo_clip (gr->cr);
+}
+
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
new file mode 100644
index 00000000000..0d755721649
--- /dev/null
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
@@ -0,0 +1,236 @@
+/* gdkpixbufdecoder.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 <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk-pixbuf/gdk-pixbuf-loader.h>
+
+#include "gtkpeer.h"
+#include "gnu_java_awt_peer_gtk_GdkPixbufDecoder.h"
+
+struct state_table *native_pixbufdecoder_state_table;
+
+#define NSA_PB_INIT(env, clazz) \
+ native_pixbufdecoder_state_table = init_state_table (env, clazz)
+
+#define NSA_GET_PB_PTR(env, obj) \
+ get_state (env, obj, native_pixbufdecoder_state_table)
+
+#define NSA_SET_PB_PTR(env, obj, ptr) \
+ set_state (env, obj, native_pixbufdecoder_state_table, (void *)ptr)
+
+#define NSA_DEL_PB_PTR(env, obj) \
+ remove_state_slot (env, obj, native_pixbufdecoder_state_table)
+
+
+jmethodID areaPreparedID;
+jmethodID areaUpdatedID;
+
+static void
+area_prepared (GdkPixbufLoader *loader,
+ jobject *decoder)
+{
+ jint width, height;
+
+ GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+ if (pixbuf == NULL)
+ return;
+
+ width = gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf),
+
+ gdk_threads_leave ();
+
+ g_assert (decoder != NULL);
+
+ (*gdk_env)->CallVoidMethod (gdk_env,
+ *decoder,
+ areaPreparedID,
+ width, height);
+
+ gdk_threads_enter ();
+}
+
+static void
+area_updated (GdkPixbufLoader *loader,
+ gint x, gint y,
+ gint width, gint height,
+ jobject *decoder)
+{
+ jint stride_bytes, stride_pixels, n_channels, n_pixels;
+ int i, px;
+ jintArray jpixels;
+ jint *java_pixels;
+ guchar *gdk_pixels;
+
+ GdkPixbuf *pixbuf_no_alpha = NULL;
+ GdkPixbuf *pixbuf = NULL;
+
+ pixbuf_no_alpha = gdk_pixbuf_loader_get_pixbuf (loader);
+ if (pixbuf_no_alpha == NULL)
+ return;
+
+ pixbuf = gdk_pixbuf_add_alpha(pixbuf_no_alpha, FALSE, 0, 0, 0);
+ g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
+
+ stride_bytes = gdk_pixbuf_get_rowstride (pixbuf);
+ n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+ stride_pixels = stride_bytes / n_channels;
+ n_pixels = height * stride_pixels;
+ gdk_pixels = gdk_pixbuf_get_pixels (pixbuf);
+
+ jpixels = (*gdk_env)->NewIntArray (gdk_env, n_pixels);
+ java_pixels = (*gdk_env)->GetIntArrayElements (gdk_env, jpixels, NULL);
+
+ memcpy (java_pixels,
+ gdk_pixels + (y * stride_bytes),
+ (height * stride_bytes));
+
+ for (i = 0; i < n_pixels; ++i)
+ {
+ px = java_pixels[i];
+
+ /* move alpha around (GdkPixbufLoader results are AGBR not GBRA, in
+ the lsb sense) */
+ /* px = ((px >> 24) & 0xff) | ((px << 8) & 0xffffff00); */
+
+ /* it appears to require a full byte swap, now, not just a shift to
+ the A channel. why did this change? don't know. */
+ px = ((px >> 8) & 0x00ff00ff) | ((px << 8) & 0xff00ff00);
+ px = ((px >> 16) & 0x0000ffff) | ((px << 16) & 0xffff0000);
+
+ java_pixels[i] = px;
+ }
+
+ g_object_unref (pixbuf);
+
+ gdk_threads_leave ();
+
+ (*gdk_env)->ReleaseIntArrayElements (gdk_env, jpixels, java_pixels, 0);
+ (*gdk_env)->CallVoidMethod (gdk_env,
+ *decoder,
+ areaUpdatedID,
+ (jint) x, (jint) y,
+ (jint) width, (jint) height,
+ jpixels,
+ stride_pixels);
+ gdk_threads_enter ();
+}
+
+static void
+closed (GdkPixbufLoader *loader, jobject *decoder)
+{
+ gdk_threads_leave ();
+ (*gdk_env)->DeleteGlobalRef (gdk_env, *decoder);
+ free (decoder);
+ gdk_threads_enter ();
+}
+
+
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_initState
+ (JNIEnv *env, jobject obj)
+{
+ GdkPixbufLoader *loader = NULL;
+ jobject *decoder = NULL;
+
+ decoder = (jobject *) malloc (sizeof (jobject));
+ g_assert (decoder != NULL);
+ *decoder = (*env)->NewGlobalRef (env, obj);
+
+ gdk_threads_enter ();
+ loader = gdk_pixbuf_loader_new ();
+ g_assert (loader != NULL);
+ g_signal_connect (loader, "area-prepared", G_CALLBACK (area_prepared), decoder);
+ g_signal_connect (loader, "area-updated", G_CALLBACK (area_updated), decoder);
+ g_signal_connect (loader, "closed", G_CALLBACK (closed), decoder);
+ gdk_threads_leave ();
+
+ NSA_SET_PB_PTR (env, obj, loader);
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_initStaticState
+ (JNIEnv *env, jclass clazz)
+{
+ areaPreparedID = (*env)->GetMethodID (env, clazz,
+ "areaPrepared",
+ "(II)V");
+
+ areaUpdatedID = (*env)->GetMethodID (env, clazz,
+ "areaUpdated",
+ "(IIII[II)V");
+ NSA_PB_INIT (env, clazz);
+}
+
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_finish
+ (JNIEnv *env, jobject obj)
+{
+ GdkPixbufLoader *loader = NULL;
+
+ loader = (GdkPixbufLoader *)NSA_DEL_PB_PTR (env, obj);
+ if (loader == NULL)
+ return;
+
+ gdk_threads_enter ();
+ gdk_pixbuf_loader_close (loader, NULL);
+ g_object_unref (loader);
+ gdk_threads_leave ();
+}
+
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_pumpBytes
+ (JNIEnv *env, jobject obj, jbyteArray jarr, jint len)
+{
+ GdkPixbufLoader *loader = NULL;
+ jbyte *bytes = NULL;
+
+ if (len < 1)
+ return;
+
+ bytes = (*gdk_env)->GetByteArrayElements (gdk_env, jarr, NULL);
+ g_assert (bytes != NULL);
+ loader = (GdkPixbufLoader *)NSA_GET_PB_PTR (env, obj);
+ g_assert (loader != NULL);
+
+ gdk_threads_enter ();
+ gdk_pixbuf_loader_write (loader, bytes, len, NULL);
+ gdk_threads_leave ();
+
+ (*gdk_env)->ReleaseByteArrayElements (gdk_env, jarr, bytes, 0);
+}
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 e87a9c4d7f0..110b01974d9 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
@@ -42,11 +42,11 @@ exception statement from your version. */
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create
(JNIEnv *env, jobject obj)
{
- GtkButton *button;
+ GtkWidget *button;
gdk_threads_enter ();
button = gtk_button_new();
- gtk_widget_show (GTK_WIDGET(button));
+ gtk_widget_show (button);
gdk_threads_leave ();
NSA_SET_PTR (env, obj, button);
}
@@ -74,8 +74,10 @@ Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetFont
gdk_threads_enter();
font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
gtk_widget_modify_font (GTK_WIDGET(label), font_desc);
+
pango_font_description_free (font_desc);
gdk_threads_leave();
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 cc7cfb8fd30..6559c5baf70 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
@@ -43,7 +43,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create
(JNIEnv *env, jobject obj)
{
gpointer widget;
-
+
gdk_threads_enter ();
widget = gtk_type_new (gtk_drawing_area_get_type ());
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 6d3e06b0c4b..ed94b7d7539 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
@@ -494,16 +494,12 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_S
const char *name;
const char *value;
void *ptr;
- GtkArg arg;
ptr = NSA_GET_PTR (env, obj);
name = (*env)->GetStringUTFChars (env, jname, NULL);
value = (*env)->GetStringUTFChars (env, jvalue, NULL);
- arg.type = GTK_TYPE_STRING;
- arg.name = (char *) name;
- GTK_VALUE_STRING (arg) = (char *) value;
- gdk_threads_enter();
+ gdk_threads_enter();
g_object_set(ptr, name, value, NULL);
gdk_threads_leave();
@@ -512,20 +508,20 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_S
}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Z
- (JNIEnv *env, jobject obj, jstring jname, jboolean value)
+ (JNIEnv *env, jobject obj, jstring jname, jboolean jvalue)
{
const char *name;
+ gboolean value;
void *ptr;
- GtkArg arg;
ptr = NSA_GET_PTR (env, obj);
- name = (*env)->GetStringUTFChars (env, jname, NULL);
- arg.type = GTK_TYPE_BOOL;
- arg.name = (char *) name;
- GTK_VALUE_BOOL (arg) = value;
+ name = (*env)->GetStringUTFChars (env, jname, NULL);
+ /* Apparently a jboolean can have a value greater than 1. gboolean
+ variables may only contain the value TRUE or FALSE. */
+ value = jvalue ? TRUE : FALSE;
- gdk_threads_enter();
+ gdk_threads_enter();
g_object_set(ptr, name, value, NULL);
gdk_threads_leave();
@@ -537,15 +533,10 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_la
{
const char *name;
void *ptr;
- GtkArg arg;
ptr = NSA_GET_PTR (env, obj);
name = (*env)->GetStringUTFChars (env, jname, NULL);
- arg.type = GTK_TYPE_INT;
- arg.name = (char *) name;
- GTK_VALUE_INT (arg) = value;
-
gdk_threads_enter();
g_object_set(ptr, name, value, NULL);
gdk_threads_leave();
@@ -558,15 +549,10 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_la
{
const char *name;
void *ptr;
- GtkArg arg;
ptr = NSA_GET_PTR (env, obj);
name = (*env)->GetStringUTFChars (env, jname, NULL);
- arg.type = GTK_TYPE_FLOAT;
- arg.name = (char *) name;
- GTK_VALUE_FLOAT (arg) = value;
-
gdk_threads_enter();
g_object_set(ptr, name, value, NULL);
gdk_threads_leave();
@@ -580,7 +566,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_O
{
const char *name;
void *ptr1, *ptr2;
- GtkArg arg;
ptr1 = NSA_GET_PTR (env, obj1);
ptr2 = NSA_GET_PTR (env, obj2);
@@ -598,10 +583,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_O
return;
}
- arg.type = GTK_TYPE_OBJECT;
- arg.name = (char *) name;
- GTK_VALUE_OBJECT (arg) = GTK_OBJECT (ptr2);
-
gdk_threads_enter();
g_object_set(ptr1, name, ptr2, NULL);
gdk_threads_leave();
@@ -609,25 +590,6 @@ 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_create
- (JNIEnv *env, jobject obj, jstring jtypename)
-{
- const char *typename;
- gpointer widget;
-
- typename = (*env)->GetStringUTFChars (env, jtypename, NULL);
-
- gdk_threads_enter ();
- gtk_button_get_type ();
- widget = gtk_object_newv (gtk_type_from_name (typename),
- 0, NULL);
-/* widget = gtk_type_new (gtk_type_from_name (typename)); */
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, jtypename, typename);
- NSA_SET_PTR (env, obj, widget);
-}
-
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks
(JNIEnv *env, jobject obj)
{
@@ -637,15 +599,10 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks
gdk_threads_enter ();
gtk_widget_realize (GTK_WIDGET (ptr));
+
if(GTK_IS_BUTTON(ptr))
- {
- g_print("-- connecting a button --\n");
- connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window);
- }
+ connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window);
else
- {
- connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
- g_print("Connection object %p with window %p (but ptr is %p)\n", obj, GTK_WIDGET(ptr)->window, 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_GtkEmbeddedWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
new file mode 100644
index 00000000000..604193aa24e
--- /dev/null
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
@@ -0,0 +1,65 @@
+/* gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c -- Native
+ implementation of GtkEmbeddedWindowPeer
+ 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 "gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.h"
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create
+ (JNIEnv *env, jobject obj, jint window_id)
+{
+ GtkWidget *window;
+ GtkWidget *vbox, *layout;
+
+ gdk_threads_enter ();
+
+ window = gtk_plug_new (window_id);
+
+ vbox = gtk_vbox_new (0, 0);
+ layout = gtk_layout_new (NULL, NULL);
+ gtk_box_pack_end (GTK_BOX (vbox), layout, 1, 1, 0);
+ gtk_container_add (GTK_CONTAINER (window), vbox);
+
+ gtk_widget_show (layout);
+ gtk_widget_show (vbox);
+
+ gdk_threads_leave ();
+
+ NSA_SET_PTR (env, obj, window);
+}
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 3c400114e4b..cdcd72e187c 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
@@ -48,7 +48,8 @@ struct event_hook_info
{
jobject *peer_obj;
int nwindows;
- GdkWindow ***windows; /* array of pointers to (GdkWindow *) */
+ /* array of pointers to (GdkWindow *) */
+ GdkWindow ***windows;
};
static jint
@@ -68,68 +69,317 @@ button_to_awt_mods (int button)
}
static jint
-state_to_awt_mods (int mods)
+state_to_awt_mods (guint state)
{
jint result = 0;
- if (mods & (GDK_SHIFT_MASK | GDK_LOCK_MASK))
+ if (state & GDK_SHIFT_MASK)
result |= AWT_SHIFT_MASK;
- if (mods & GDK_CONTROL_MASK)
+ if (state & GDK_CONTROL_MASK)
result |= AWT_CTRL_MASK;
-
+ if (state & GDK_MOD1_MASK)
+ result |= AWT_ALT_MASK;
+
+ return result;
+}
+
+/* Modifier key events need special treatment. In Sun's peer
+ implementation, when a modifier key is pressed, the KEY_PRESSED
+ event has that modifier in its modifiers list. The corresponding
+ KEY_RELEASED event's modifier list does not contain the modifier.
+ For example, pressing and releasing the shift key will produce a
+ key press event with modifiers=Shift, and a key release event with
+ no modifiers. GDK's key events behave in the exact opposite way,
+ so this translation code is needed. */
+static jint
+keyevent_state_to_awt_mods (GdkEvent *event)
+{
+ jint result = 0;
+ guint state;
+
+ if (event->type == GDK_KEY_PRESS)
+ {
+ state = event->key.state;
+
+ if (event->key.keyval == GDK_Shift_L
+ || event->key.keyval == GDK_Shift_R)
+ result |= AWT_SHIFT_MASK;
+ else
+ {
+ if (state & GDK_SHIFT_MASK)
+ result |= AWT_SHIFT_MASK;
+ }
+
+ if (event->key.keyval == GDK_Control_L
+ || event->key.keyval == GDK_Control_R)
+ result |= AWT_CTRL_MASK;
+ else
+ {
+ if (state & GDK_CONTROL_MASK)
+ result |= AWT_CTRL_MASK;
+ }
+
+ if (event->key.keyval == GDK_Alt_L
+ || event->key.keyval == GDK_Alt_R)
+ result |= AWT_ALT_MASK;
+ else
+ {
+ if (state & GDK_MOD1_MASK)
+ result |= AWT_ALT_MASK;
+ }
+ }
+ else if (event->type == GDK_KEY_RELEASE)
+ {
+ state = event->key.state;
+
+ if (event->key.keyval != GDK_Shift_L
+ && event->key.keyval != GDK_Shift_R)
+ {
+ if (state & GDK_SHIFT_MASK)
+ result |= AWT_SHIFT_MASK;
+ }
+ if (event->key.keyval != GDK_Control_L
+ && event->key.keyval != GDK_Control_R)
+ {
+ if (state & GDK_CONTROL_MASK)
+ result |= AWT_CTRL_MASK;
+ }
+
+ if (event->key.keyval != GDK_Alt_L
+ && event->key.keyval != GDK_Alt_R)
+ {
+ if (state & GDK_MOD1_MASK)
+ result |= AWT_ALT_MASK;
+ }
+ }
+
return result;
}
+/* Get the first keyval in the keymap for this event's keycode. The
+ first keyval corresponds roughly to Java's notion of a virtual
+ key. Returns the uppercase version of the first keyval. */
+static guint
+get_first_keyval_from_keymap (GdkEvent *event)
+{
+ guint keyval;
+ guint *keyvals;
+ gint n_entries;
+
+ if (!gdk_keymap_get_entries_for_keycode (NULL,
+ event->key.hardware_keycode,
+ NULL,
+ &keyvals,
+ &n_entries))
+ {
+ g_warning ("No keyval found for hardware keycode %d\n",
+ event->key.hardware_keycode);
+ /* Try to recover by using the keyval in the event structure. */
+ keyvals = &(event->key.keyval);
+ }
+ keyval = keyvals[0];
+ g_free (keyvals);
+
+ return gdk_keyval_to_upper (keyval);
+}
+
#ifdef __GNUC__
__inline
#endif
static jint
-keysym_to_awt_keycode (guint keyval)
+keysym_to_awt_keycode (GdkEvent *event)
{
- guint vk;
+ guint ukeyval;
+ guint state;
- vk = gdk_keyval_to_upper (keyval);
+ ukeyval = get_first_keyval_from_keymap (event);
+ state = event->key.state;
- if (vk >= 0x41 && vk <= 0x5A) /* VK_A through VK_Z */
- return vk;
+ /* VK_A through VK_Z */
+ if (ukeyval >= GDK_A && ukeyval <= GDK_Z)
+ return ukeyval;
- if (vk >= 0x30 && vk <= 0x39) /* VK_0 through VK_9 */
- return vk;
+ /* VK_0 through VK_9 */
+ if (ukeyval >= GDK_0 && ukeyval <= GDK_9)
+ return ukeyval;
- switch (vk)
+ switch (ukeyval)
{
- case GDK_Alt_L:
- case GDK_Alt_R:
- return VK_ALT;
+ case GDK_Return:
+ case GDK_KP_Enter:
+ return VK_ENTER;
case GDK_BackSpace:
return VK_BACK_SPACE;
+ case GDK_Tab:
+ return VK_TAB;
case GDK_Cancel:
return VK_CANCEL;
- case GDK_Caps_Lock:
- return VK_CAPS_LOCK;
case GDK_Clear:
return VK_CLEAR;
- case GDK_bracketright:
- return VK_CLOSE_BRACKET;
- case GDK_comma:
- return VK_COMMA;
+ case GDK_Shift_L:
+ case GDK_Shift_R:
+ return VK_SHIFT;
case GDK_Control_L:
case GDK_Control_R:
return VK_CONTROL;
+ case GDK_Alt_L:
+ case GDK_Alt_R:
+ return VK_ALT;
+ case GDK_Pause:
+ return VK_PAUSE;
+ case GDK_Caps_Lock:
+ return VK_CAPS_LOCK;
+ case GDK_Escape:
+ return VK_ESCAPE;
+ case GDK_space:
+ return VK_SPACE;
+ case GDK_KP_Page_Up:
+ /* For keys on the numeric keypad, the JVM produces one of two
+ virtual keys, depending on the num lock state. */
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD9;
+ else
+ return VK_PAGE_UP;
+ case GDK_Page_Up:
+ return VK_PAGE_UP;
+ case GDK_KP_Page_Down:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD3;
+ else
+ return VK_PAGE_DOWN;
+ case GDK_Page_Down:
+ return VK_PAGE_DOWN;
+ case GDK_KP_End:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD1;
+ else
+ return VK_END;
+ case GDK_End:
+ return VK_END;
+ case GDK_KP_Home:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD7;
+ else
+ return VK_HOME;
+ case GDK_Home:
+ return VK_HOME;
+ case GDK_KP_Begin:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD5;
+ else
+ return VK_UNDEFINED;
+ case GDK_Left:
+ return VK_LEFT;
+ case GDK_Up:
+ return VK_UP;
+ case GDK_Right:
+ return VK_RIGHT;
+ case GDK_Down:
+ return VK_DOWN;
+ case GDK_comma:
+ return VK_COMMA;
+ case GDK_minus:
+ return VK_MINUS;
+ case GDK_period:
+ return VK_PERIOD;
+ case GDK_slash:
+ return VK_SLASH;
+ /*
+ return VK_0;
+ return VK_1;
+ return VK_2;
+ return VK_3;
+ return VK_4;
+ return VK_5;
+ return VK_6;
+ return VK_7;
+ return VK_8;
+ return VK_9;
+ */
+ case GDK_semicolon:
+ return VK_SEMICOLON;
+ case GDK_equal:
+ return VK_EQUALS;
+ /*
+ return VK_A;
+ return VK_B;
+ return VK_C;
+ return VK_D;
+ return VK_E;
+ return VK_F;
+ return VK_G;
+ return VK_H;
+ return VK_I;
+ return VK_J;
+ return VK_K;
+ return VK_L;
+ return VK_M;
+ return VK_N;
+ return VK_O;
+ return VK_P;
+ return VK_Q;
+ return VK_R;
+ return VK_S;
+ return VK_T;
+ return VK_U;
+ return VK_V;
+ return VK_W;
+ return VK_X;
+ return VK_Y;
+ return VK_Z;
+ */
+ case GDK_bracketleft:
+ return VK_OPEN_BRACKET;
+ case GDK_backslash:
+ return VK_BACK_SLASH;
+ case GDK_bracketright:
+ return VK_CLOSE_BRACKET;
+ case GDK_KP_0:
+ return VK_NUMPAD0;
+ case GDK_KP_1:
+ return VK_NUMPAD1;
+ case GDK_KP_2:
+ return VK_NUMPAD2;
+ case GDK_KP_3:
+ return VK_NUMPAD3;
+ case GDK_KP_4:
+ return VK_NUMPAD4;
+ case GDK_KP_5:
+ return VK_NUMPAD5;
+ case GDK_KP_6:
+ return VK_NUMPAD6;
+ case GDK_KP_7:
+ return VK_NUMPAD7;
+ case GDK_KP_8:
+ return VK_NUMPAD8;
+ case GDK_KP_9:
+ return VK_NUMPAD9;
+ case GDK_KP_Multiply:
+ return VK_MULTIPLY;
+ case GDK_KP_Add:
+ return VK_ADD;
+ /*
+ return VK_SEPARATER;
+ */
+ case GDK_KP_Separator:
+ return VK_SEPARATOR;
+ case GDK_KP_Subtract:
+ return VK_SUBTRACT;
case GDK_KP_Decimal:
return VK_DECIMAL;
- case GDK_Delete:
- return VK_DELETE;
case GDK_KP_Divide:
return VK_DIVIDE;
- case GDK_Down:
- return VK_DOWN;
- case GDK_End:
- return VK_END;
- case GDK_Return:
- return VK_ENTER;
- case GDK_Escape:
- return VK_ESCAPE;
+ case GDK_KP_Delete:
+ if (state & GDK_MOD2_MASK)
+ return VK_DECIMAL;
+ else
+ return VK_DELETE;
+ case GDK_Delete:
+ return VK_DELETE;
+ case GDK_Num_Lock:
+ return VK_NUM_LOCK;
+ case GDK_Scroll_Lock:
+ return VK_SCROLL_LOCK;
case GDK_F1:
return VK_F1;
case GDK_F2:
@@ -154,100 +404,410 @@ keysym_to_awt_keycode (guint keyval)
return VK_F11;
case GDK_F12:
return VK_F12;
- case GDK_Help:
- return VK_HELP;
- case GDK_Home:
- return VK_HOME;
+ case GDK_F13:
+ return VK_F13;
+ case GDK_F14:
+ return VK_F14;
+ case GDK_F15:
+ return VK_F15;
+ case GDK_F16:
+ return VK_F16;
+ case GDK_F17:
+ return VK_F17;
+ case GDK_F18:
+ return VK_F18;
+ case GDK_F19:
+ return VK_F19;
+ case GDK_F20:
+ return VK_F20;
+ case GDK_F21:
+ return VK_F21;
+ case GDK_F22:
+ return VK_F22;
+ case GDK_F23:
+ return VK_F23;
+ case GDK_F24:
+ return VK_F24;
+ case GDK_Print:
+ return VK_PRINTSCREEN;
+ case GDK_KP_Insert:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD0;
+ else
+ return VK_INSERT;
case GDK_Insert:
return VK_INSERT;
+ case GDK_Help:
+ return VK_HELP;
+ case GDK_Meta_L:
+ case GDK_Meta_R:
+ return VK_META;
+ case GDK_grave:
+ return VK_BACK_QUOTE;
+ case GDK_apostrophe:
+ return VK_QUOTE;
+ case GDK_KP_Up:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD8;
+ else
+ return VK_KP_UP;
+ case GDK_KP_Down:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD2;
+ else
+ return VK_KP_DOWN;
+ case GDK_KP_Left:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD4;
+ else
+ return VK_KP_LEFT;
+ case GDK_KP_Right:
+ if (state & GDK_MOD2_MASK)
+ return VK_NUMPAD6;
+ else
+ return VK_KP_RIGHT;
+ case GDK_dead_grave:
+ return VK_DEAD_GRAVE;
+ case GDK_dead_acute:
+ return VK_DEAD_ACUTE;
+ case GDK_dead_circumflex:
+ return VK_DEAD_CIRCUMFLEX;
+ case GDK_dead_tilde:
+ return VK_DEAD_TILDE;
+ case GDK_dead_macron:
+ return VK_DEAD_MACRON;
+ case GDK_dead_breve:
+ return VK_DEAD_BREVE;
+ case GDK_dead_abovedot:
+ return VK_DEAD_ABOVEDOT;
+ case GDK_dead_diaeresis:
+ return VK_DEAD_DIAERESIS;
+ case GDK_dead_abovering:
+ return VK_DEAD_ABOVERING;
+ case GDK_dead_doubleacute:
+ return VK_DEAD_DOUBLEACUTE;
+ case GDK_dead_caron:
+ return VK_DEAD_CARON;
+ case GDK_dead_cedilla:
+ return VK_DEAD_CEDILLA;
+ case GDK_dead_ogonek:
+ return VK_DEAD_OGONEK;
+ case GDK_dead_iota:
+ return VK_DEAD_IOTA;
+ case GDK_dead_voiced_sound:
+ return VK_DEAD_VOICED_SOUND;
+ case GDK_dead_semivoiced_sound:
+ return VK_DEAD_SEMIVOICED_SOUND;
+ case GDK_ampersand:
+ return VK_AMPERSAND;
+ case GDK_asterisk:
+ return VK_ASTERISK;
+ case GDK_quotedbl:
+ return VK_QUOTEDBL;
+ case GDK_less:
+ return VK_LESS;
+ case GDK_greater:
+ return VK_GREATER;
+ case GDK_braceleft:
+ return VK_BRACELEFT;
+ case GDK_braceright:
+ return VK_BRACERIGHT;
+ case GDK_at:
+ return VK_AT;
+ case GDK_colon:
+ return VK_COLON;
+ case GDK_asciicircum:
+ return VK_CIRCUMFLEX;
+ case GDK_dollar:
+ return VK_DOLLAR;
+ case GDK_EuroSign:
+ return VK_EURO_SIGN;
+ case GDK_exclam:
+ return VK_EXCLAMATION_MARK;
+ case GDK_exclamdown:
+ return VK_INVERTED_EXCLAMATION_MARK;
+ case GDK_parenleft:
+ return VK_LEFT_PARENTHESIS;
+ case GDK_numbersign:
+ return VK_NUMBER_SIGN;
+ case GDK_plus:
+ return VK_PLUS;
+ case GDK_parenright:
+ return VK_RIGHT_PARENTHESIS;
+ case GDK_underscore:
+ return VK_UNDERSCORE;
+ /*
+ return VK_FINAL;
+ return VK_CONVERT;
+ return VK_NONCONVERT;
+ return VK_ACCEPT;
+ */
+ case GDK_Mode_switch:
+ return VK_MODECHANGE;
+ /*
+ return VK_KANA;
+ */
case GDK_Kanji:
return VK_KANJI;
- case GDK_Left:
- return VK_LEFT;
+ /*
+ return VK_ALPHANUMERIC;
+ */
+ case GDK_Katakana:
+ return VK_KATAKANA;
+ case GDK_Hiragana:
+ return VK_HIRAGANA;
+ /*
+ return VK_FULL_WIDTH;
+ return VK_HALF_WIDTH;
+ return VK_ROMAN_CHARACTERS;
+ return VK_ALL_CANDIDATES;
+ */
+ case GDK_PreviousCandidate:
+ return VK_PREVIOUS_CANDIDATE;
+ case GDK_Codeinput:
+ return VK_CODE_INPUT;
+ /*
+ return VK_JAPANESE_KATAKANA;
+ return VK_JAPANESE_HIRAGANA;
+ return VK_JAPANESE_ROMAN;
+ */
+ case GDK_Kana_Lock:
+ return VK_KANA_LOCK;
+ /*
+ return VK_INPUT_METHOD_ON_OFF;
+ return VK_CUT;
+ return VK_COPY;
+ return VK_PASTE;
+ return VK_UNDO;
+ return VK_AGAIN;
+ return VK_FIND;
+ return VK_PROPS;
+ return VK_STOP;
+ return VK_COMPOSE;
+ return VK_ALT_GRAPH;
+ */
+ default:
+ return VK_UNDEFINED;
+ }
+}
+
+static jint
+keysym_to_awt_keylocation (GdkEvent *event)
+{
+ guint ukeyval;
+
+ ukeyval = get_first_keyval_from_keymap (event);
+
+ /* VK_A through VK_Z */
+ if (ukeyval >= GDK_A && ukeyval <= GDK_Z)
+ return AWT_KEY_LOCATION_STANDARD;
+
+ /* VK_0 through VK_9 */
+ if (ukeyval >= GDK_0 && ukeyval <= GDK_9)
+ return AWT_KEY_LOCATION_STANDARD;
+
+ switch (ukeyval)
+ {
+ case GDK_Shift_L:
+ case GDK_Control_L:
+ case GDK_Alt_L:
case GDK_Meta_L:
+ return AWT_KEY_LOCATION_LEFT;
+
+ case GDK_Shift_R:
+ case GDK_Control_R:
+ case GDK_Alt_R:
case GDK_Meta_R:
- return VK_META;
- case GDK_KP_Multiply:
- return VK_MULTIPLY;
- case GDK_Num_Lock:
- return VK_NUM_LOCK;
+ return AWT_KEY_LOCATION_RIGHT;
+
+ case GDK_Return:
+ case GDK_BackSpace:
+ case GDK_Tab:
+ case GDK_Cancel:
+ case GDK_Clear:
+ case GDK_Pause:
+ case GDK_Caps_Lock:
+ case GDK_Escape:
+ case GDK_space:
+ case GDK_Page_Up:
+ case GDK_Page_Down:
+ case GDK_End:
+ case GDK_Home:
+ case GDK_Left:
+ case GDK_Up:
+ case GDK_Right:
+ case GDK_Down:
+ case GDK_comma:
+ case GDK_minus:
+ case GDK_period:
+ case GDK_slash:
+ case GDK_semicolon:
+ case GDK_equal:
+ case GDK_bracketleft:
+ case GDK_backslash:
+ case GDK_bracketright:
+ case GDK_Delete:
+ case GDK_Scroll_Lock:
+ case GDK_F1:
+ case GDK_F2:
+ case GDK_F3:
+ case GDK_F4:
+ case GDK_F5:
+ case GDK_F6:
+ case GDK_F7:
+ case GDK_F8:
+ case GDK_F9:
+ case GDK_F10:
+ case GDK_F11:
+ case GDK_F12:
+ case GDK_F13:
+ case GDK_F14:
+ case GDK_F15:
+ case GDK_F16:
+ case GDK_F17:
+ case GDK_F18:
+ case GDK_F19:
+ case GDK_F20:
+ case GDK_F21:
+ case GDK_F22:
+ case GDK_F23:
+ case GDK_F24:
+ case GDK_Print:
+ case GDK_Insert:
+ case GDK_Help:
+ case GDK_grave:
+ case GDK_apostrophe:
+ case GDK_dead_grave:
+ case GDK_dead_acute:
+ case GDK_dead_circumflex:
+ case GDK_dead_tilde:
+ case GDK_dead_macron:
+ case GDK_dead_breve:
+ case GDK_dead_abovedot:
+ case GDK_dead_diaeresis:
+ case GDK_dead_abovering:
+ case GDK_dead_doubleacute:
+ case GDK_dead_caron:
+ case GDK_dead_cedilla:
+ case GDK_dead_ogonek:
+ case GDK_dead_iota:
+ case GDK_dead_voiced_sound:
+ case GDK_dead_semivoiced_sound:
+ case GDK_ampersand:
+ case GDK_asterisk:
+ case GDK_quotedbl:
+ case GDK_less:
+ case GDK_greater:
+ case GDK_braceleft:
+ case GDK_braceright:
+ case GDK_at:
+ case GDK_colon:
+ case GDK_asciicircum:
+ case GDK_dollar:
+ case GDK_EuroSign:
+ case GDK_exclam:
+ case GDK_exclamdown:
+ case GDK_parenleft:
+ case GDK_numbersign:
+ case GDK_plus:
+ case GDK_parenright:
+ case GDK_underscore:
+ case GDK_Mode_switch:
+ case GDK_Kanji:
+ case GDK_Katakana:
+ case GDK_Hiragana:
+ case GDK_PreviousCandidate:
+ case GDK_Codeinput:
+ case GDK_Kana_Lock:
+ return AWT_KEY_LOCATION_STANDARD;
+
+ case GDK_KP_Enter:
+ case GDK_KP_Page_Up:
+ case GDK_KP_Page_Down:
+ case GDK_KP_End:
+ case GDK_KP_Home:
+ case GDK_KP_Begin:
case GDK_KP_0:
- return VK_NUMPAD0;
case GDK_KP_1:
- return VK_NUMPAD1;
case GDK_KP_2:
- return VK_NUMPAD2;
case GDK_KP_3:
- return VK_NUMPAD3;
case GDK_KP_4:
- return VK_NUMPAD4;
case GDK_KP_5:
- return VK_NUMPAD5;
case GDK_KP_6:
- return VK_NUMPAD6;
case GDK_KP_7:
- return VK_NUMPAD7;
case GDK_KP_8:
- return VK_NUMPAD8;
case GDK_KP_9:
- return VK_NUMPAD9;
- case GDK_bracketleft:
- return VK_OPEN_BRACKET;
- case GDK_Page_Down:
- return VK_PAGE_DOWN;
- case GDK_Page_Up:
- return VK_PAGE_UP;
- case GDK_Pause:
- return VK_PAUSE;
- case GDK_period:
- return VK_PERIOD;
- case GDK_Print:
- return VK_PRINTSCREEN;
- case GDK_quoteright:
- return VK_QUOTE;
- case GDK_Right:
- return VK_RIGHT;
- case GDK_Scroll_Lock:
- return VK_SCROLL_LOCK;
- case GDK_semicolon:
- return VK_SEMICOLON;
+ case GDK_KP_Multiply:
+ case GDK_KP_Add:
case GDK_KP_Separator:
- return VK_SEPARATOR;
- case GDK_Shift_L:
- case GDK_Shift_R:
- return VK_SHIFT;
- case GDK_slash:
- return VK_SLASH;
- case GDK_space:
- return VK_SPACE;
case GDK_KP_Subtract:
- return VK_SUBTRACT;
- case GDK_Tab:
- return VK_TAB;
- case GDK_Up:
- return VK_UP;
+ case GDK_KP_Decimal:
+ case GDK_KP_Divide:
+ case GDK_KP_Delete:
+ case GDK_Num_Lock:
+ case GDK_KP_Insert:
+ case GDK_KP_Up:
+ case GDK_KP_Down:
+ case GDK_KP_Left:
+ case GDK_KP_Right:
+ return AWT_KEY_LOCATION_NUMPAD;
default:
- return VK_UNDEFINED;
+ return AWT_KEY_LOCATION_UNKNOWN;
}
}
+static jchar
+keyevent_to_awt_keychar (GdkEvent *event)
+{
+ if (event->key.length > 0)
+ {
+ /* Translate GDK carriage return to Java linefeed. */
+ if (event->key.string[0] == 13)
+ return VK_ENTER;
+ else
+ return event->key.string[0];
+ }
+ else
+ {
+ switch (event->key.keyval)
+ {
+ case GDK_BackSpace:
+ return VK_BACK_SPACE;
+ case GDK_Tab:
+ return VK_TAB;
+ case GDK_Delete:
+ case GDK_KP_Delete:
+ return VK_DELETE;
+ default:
+ return AWT_KEY_CHAR_UNDEFINED;
+ }
+ }
+}
+
+/* Checks if keyval triggers a KEY_TYPED event on the source widget.
+ This function identifies special keyvals that don't trigger
+ GtkIMContext "commit" signals, but that do trigger Java KEY_TYPED
+ events. */
static int
-generates_key_typed_event (guint keyval)
+generates_key_typed_event (GdkEvent *event, GtkWidget *source)
{
- guint vk;
+ guint keyval;
- vk = gdk_keyval_to_upper (keyval);
+ if (!GTK_IS_ENTRY (source)
+ && !GTK_IS_TEXT_VIEW (source))
+ return event->key.length ? 1 : 0;
- if ((vk >= 0x20 && vk <= 0x7e) /* Most printable keysyms on a
- standard US keyboard. */
- || (vk >= 0xFF9F && vk <= 0xFFB9) /* Numeric Keypad keysyms. */
- || vk == GDK_BackSpace
- || vk == GDK_Delete
- || vk == GDK_Return)
- return 1;
- else
- return 0;
+ keyval = event->key.keyval;
+
+ return (keyval == GDK_Escape
+ || keyval == GDK_BackSpace
+ || keyval == GDK_Delete
+ || keyval == GDK_KP_Delete
+ || keyval == GDK_Return
+ || keyval == GDK_KP_Enter
+ || (keyval == GDK_Tab
+ && GTK_IS_TEXT_VIEW(source))) ? 1 : 0;
}
void
@@ -465,19 +1025,30 @@ awt_event_handler (GdkEvent *event)
{
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)
+ && 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);
- gdk_property_get (window->focus_widget->window,
+
+ /* 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,
@@ -488,27 +1059,24 @@ awt_event_handler (GdkEvent *event)
NULL,
(guchar **)&obj_ptr);
- /* if (grab && GTK_WIDGET_HAS_DEFAULT (widget) ) */
- /* { */
(*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
postKeyEventID,
(jint) AWT_KEY_PRESSED,
(jlong) event->key.time,
- state_to_awt_mods (event->key.state),
- keysym_to_awt_keycode (event->key.keyval),
- (jchar) (event->key.length) ?
- event->key.string[0] :
- AWT_KEY_CHAR_UNDEFINED);
-
- if (event->key.length
- && generates_key_typed_event(event->key.keyval))
- (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr,
- postKeyEventID,
- (jint) AWT_KEY_TYPED,
- (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, *obj_ptr,
+ postKeyEventID,
+ (jint) AWT_KEY_TYPED,
+ (jlong) event->key.time,
state_to_awt_mods (event->key.state),
- VK_UNDEFINED,
- (jchar) event->key.string[0]);
+ VK_UNDEFINED,
+ keyevent_to_awt_keychar (event),
+ AWT_KEY_LOCATION_UNKNOWN);
}
}
break;
@@ -516,6 +1084,7 @@ awt_event_handler (GdkEvent *event)
{
GtkWidget *widget;
GtkWindow *window;
+ GdkWindow *obj_window;
gdk_window_get_user_data (event->any.window, (void **) &widget);
@@ -528,7 +1097,13 @@ awt_event_handler (GdkEvent *event)
&& window->focus_widget->window)
{
gtk_widget_activate (window->focus_widget);
- gdk_property_get (window->focus_widget->window,
+
+ 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,
@@ -543,11 +1118,10 @@ awt_event_handler (GdkEvent *event)
postKeyEventID,
(jint) AWT_KEY_RELEASED,
(jlong) event->key.time,
- state_to_awt_mods (event->key.state),
- keysym_to_awt_keycode (event->key.keyval),
- (jchar) (event->key.length) ?
- event->key.string[0] :
- AWT_KEY_CHAR_UNDEFINED);
+ keyevent_state_to_awt_mods (event),
+ keysym_to_awt_keycode (event),
+ keyevent_to_awt_keychar (event),
+ keysym_to_awt_keylocation (event));
}
}
break;
@@ -558,11 +1132,11 @@ awt_event_handler (GdkEvent *event)
AWT_FOCUS_GAINED : AWT_FOCUS_LOST,
JNI_FALSE);
break;
- default:
+ default:
}
g_free (obj_ptr);
- }
-
+ }
+
gtk_main_do_event (event);
}
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 9313a8a815b..7bddc330ddb 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
@@ -39,19 +39,17 @@ exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkLabelPeer.h"
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create
(JNIEnv *env, jobject obj)
{
GtkWidget *label;
- GtkContainer *ebox;
gdk_threads_enter ();
- ebox = GTK_CONTAINER (gtk_type_new (gtk_event_box_get_type ()));
- label = GTK_WIDGET (gtk_type_new (gtk_label_get_type ()));
- gtk_container_add (ebox, label);
- gtk_widget_show (label);
+
+ label = gtk_label_new (NULL);
+
gdk_threads_leave ();
- NSA_SET_PTR (env, obj, ebox);
+ NSA_SET_PTR (env, obj, label);
}
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 7c59f20a56e..f67845a794f 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
@@ -155,7 +155,7 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
postExposeEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
"postExposeEvent", "(IIII)V");
postKeyEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postKeyEvent", "(IJIIC)V");
+ "postKeyEvent", "(IJIICI)V");
postFocusEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
"postFocusEvent", "(IZ)V");
postAdjustmentEventID = (*env)->GetMethodID (env, gtkscrollbarpeer,
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 a246b372904..2bd3df8cf35 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
@@ -46,6 +46,17 @@ struct range_scrollbar
};
static void
+post_change_event (GtkRange *range,
+ struct range_scrollbar *rs)
+{
+ GtkAdjustment *adj;
+ adj = gtk_range_get_adjustment (range);
+ (*gdk_env)->CallVoidMethod (gdk_env, *(rs->scrollbar), postAdjustmentEventID,
+ AWT_ADJUSTMENT_TRACK, (jint) adj->value);
+
+}
+
+static void
post_adjustment_event (GtkRange *range, GtkScrollType scroll,
struct range_scrollbar *rs)
{
@@ -56,15 +67,23 @@ post_adjustment_event (GtkRange *range, GtkScrollType scroll,
switch (scroll)
{
+ case GTK_SCROLL_STEP_UP:
+ case GTK_SCROLL_STEP_RIGHT:
case GTK_SCROLL_STEP_FORWARD:
type = AWT_ADJUSTMENT_UNIT_INCREMENT;
break;
+ case GTK_SCROLL_STEP_DOWN:
+ case GTK_SCROLL_STEP_LEFT:
case GTK_SCROLL_STEP_BACKWARD:
type = AWT_ADJUSTMENT_UNIT_DECREMENT;
break;
+ case GTK_SCROLL_PAGE_UP:
+ case GTK_SCROLL_PAGE_RIGHT:
case GTK_SCROLL_PAGE_FORWARD:
type = AWT_ADJUSTMENT_BLOCK_INCREMENT;
break;
+ case GTK_SCROLL_PAGE_DOWN:
+ case GTK_SCROLL_PAGE_LEFT:
case GTK_SCROLL_PAGE_BACKWARD:
type = AWT_ADJUSTMENT_BLOCK_DECREMENT;
break;
@@ -118,9 +137,14 @@ Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectHooks
rs->scrollbar = (jobject *) malloc (sizeof (jobject));
*(rs->scrollbar) = (*env)->NewGlobalRef (env, obj);
gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)),
- "move_slider",
+ "move-slider",
GTK_SIGNAL_FUNC (post_adjustment_event), rs);
+ gtk_signal_connect (GTK_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 ();
}
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 103ddd22a9a..9a62c1a5a36 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
@@ -47,6 +47,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create
GtkWidget *text, *sw;
gdk_threads_enter ();
+
text = gtk_text_view_new ();
gtk_widget_show (text);
@@ -159,7 +160,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_replaceRange
(*env)->ReleaseStringUTFChars (env, contents, str);
}
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkSetFont
(JNIEnv *env, jobject obj, jstring jname, jint size)
{
@@ -169,19 +170,21 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkSetFont
PangoFontDescription *font_desc;
ptr = NSA_GET_PTR (env, obj);
+
text = GTK_WIDGET (TEXT_FROM_SW (ptr));
-
+
font_name = (*env)->GetStringUTFChars (env, jname, NULL);
gdk_threads_enter();
font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
gtk_widget_modify_font (GTK_WIDGET(text), font_desc);
+
pango_font_description_free (font_desc);
-
+
gdk_threads_leave();
(*env)->ReleaseStringUTFChars (env, jname, font_name);
-
}
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 de590352dd1..29689fb8c00 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
@@ -39,6 +39,62 @@ exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkTextComponentPeer.h"
+static void textcomponent_commit_cb (GtkIMContext *context,
+ const gchar *str,
+ jobject peer);
+
+static void textcomponent_changed_cb (GtkEditable *editable,
+ jobject peer);
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectHooks
+ (JNIEnv *env, jobject obj)
+{
+ void *ptr;
+ GtkTextView *text = NULL;
+ GtkTextBuffer *buf;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ gdk_threads_enter ();
+
+ if (GTK_IS_ENTRY(ptr))
+ {
+ g_signal_connect (GTK_ENTRY (ptr)->im_context, "commit",
+ G_CALLBACK (textcomponent_commit_cb), obj);
+
+ g_signal_connect (GTK_EDITABLE (ptr), "changed",
+ G_CALLBACK (textcomponent_changed_cb), obj);
+ }
+ else
+ {
+ if (GTK_IS_SCROLLED_WINDOW (ptr))
+ {
+ text = GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child);
+ }
+ else if (GTK_IS_TEXT_VIEW (ptr))
+ {
+ text = GTK_TEXT_VIEW (ptr);
+ }
+
+ if (text)
+ {
+ g_signal_connect (text->im_context, "commit",
+ G_CALLBACK (textcomponent_commit_cb), obj);
+
+ buf = gtk_text_view_get_buffer (text);
+ if (buf)
+ g_signal_connect (buf, "changed",
+ G_CALLBACK (textcomponent_changed_cb), obj);
+ }
+ }
+
+ gdk_threads_leave ();
+
+ /* Connect the superclass hooks. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks (env, obj);
+}
+
JNIEXPORT jint JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getCaretPosition
(JNIEnv *env, jobject obj)
@@ -371,18 +427,6 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
if (GTK_IS_EDITABLE (ptr))
{
gtk_entry_set_text (GTK_ENTRY (ptr), str);
-
- if (gdk_property_get (GTK_WIDGET(ptr)->window,
- gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (jobject),
- FALSE,
- NULL,
- NULL,
- NULL,
- (guchar **)&obj_ptr))
- (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postTextEventID);
}
else
{
@@ -406,3 +450,35 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText
(*env)->ReleaseStringUTFChars (env, contents, str);
}
+
+static void
+textcomponent_commit_cb (GtkIMContext *context,
+ const gchar *str,
+ jobject peer)
+{
+ /* str is a \0-terminated UTF-8 encoded character. */
+ gunichar2 *jc = g_utf8_to_utf16 (str, -1, NULL, NULL, NULL);
+
+ if (jc)
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postKeyEventID,
+ (jint) AWT_KEY_TYPED,
+ /* We don't have access to the event
+ that caused this commit signal to
+ be fired. So approximate the event
+ time... */
+ (jlong) gdk_event_get_time (NULL),
+ /* ... and assume no modifiers. */
+ 0,
+ VK_UNDEFINED,
+ (jchar) jc[0],
+ AWT_KEY_LOCATION_UNKNOWN);
+ g_free (jc);
+}
+
+static void
+textcomponent_changed_cb (GtkEditable *editable,
+ jobject peer)
+{
+ (*gdk_env)->CallVoidMethod (gdk_env, peer, postTextEventID);
+}
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 69b3e521abc..ee6132ddeea 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
@@ -52,23 +52,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create
NSA_SET_PTR (env, obj, widget);
}
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_connectHooks
- (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, 2,
- GTK_WIDGET (ptr)->window,
- GTK_ENTRY (ptr)->text_area);
- gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkEntryGetSize
(JNIEnv *env, jobject obj, jint cols, jintArray jdims)
{
@@ -116,7 +100,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_setEchoChar
gdk_threads_leave ();
}
-JNIEXPORT void JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont
(JNIEnv *env, jobject obj, jstring jname, jint size)
{
@@ -126,15 +110,17 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont
PangoFontDescription *font_desc;
ptr = NSA_GET_PTR (env, obj);
-
+
entry = GTK_WIDGET (ptr);
font_name = (*env)->GetStringUTFChars (env, jname, NULL);
gdk_threads_enter();
font_desc = pango_font_description_from_string (font_name);
- pango_font_description_set_size (font_desc, size);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
gtk_widget_modify_font (GTK_WIDGET(entry), font_desc);
+
pango_font_description_free (font_desc);
gdk_threads_leave();
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 9a8cc32efd8..982a5cb6052 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
@@ -42,22 +42,29 @@ exception statement from your version. */
#include <gdk/gdkprivate.h>
#include <gdk/gdkx.h>
-static void setBounds (GtkWidget *, jint, jint, jint, jint);
-
/*
* Make a new window (any type)
*/
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
- (JNIEnv *env, jobject obj, jint type)
+ (JNIEnv *env, jobject obj, jint type, jint width, jint height)
{
- gpointer window;
+ GtkWidget *window;
GtkWidget *vbox, *layout;
gdk_threads_enter ();
window = gtk_window_new (type);
+ gtk_window_set_default_size (GTK_WINDOW(window), width, height);
+
+ /* We must set this window's size requisition. Otherwise when a
+ resize is queued (when gtk_widget_queue_resize is called) the
+ window will snap to its default requisition of 0x0. If we omit
+ this call, Frames and Dialogs shrink to degenerate 1x1 windows
+ when their resizable property changes. */
+ gtk_widget_set_size_request (window, width, height);
+
vbox = gtk_vbox_new (0, 0);
layout = gtk_layout_new (NULL, NULL);
gtk_box_pack_end (GTK_BOX (vbox), layout, 1, 1, 0);
@@ -86,6 +93,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setVisible
gtk_widget_hide (GTK_WIDGET (ptr));
XFlush (GDK_DISPLAY ());
+
gdk_threads_leave ();
}
@@ -93,37 +101,36 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectHooks
(JNIEnv *env, jobject obj)
{
void *ptr;
- GtkVBox* vbox;
- GtkWidget *layout;
+ GtkWidget* vbox, *layout;
GList* children;
- char* name;
+
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
- children = gtk_container_get_children(GTK_CONTAINER(ptr));
- vbox = children->data;
- name = GTK_OBJECT_TYPE_NAME(vbox);
- if(!GTK_IS_VBOX(vbox))
- {
- printf("*** this is not a vbox\n");
- }
- children = gtk_container_get_children(GTK_CONTAINER(vbox));
- layout = children->data;
- name = GTK_OBJECT_TYPE_NAME(layout);
- if(!GTK_IS_LAYOUT(layout))
- {
+ children = gtk_container_get_children(GTK_CONTAINER(ptr));
+ vbox = children->data;
+
+ if(!GTK_IS_VBOX(vbox))
+ {
+ printf("*** this is not a vbox\n");
+ }
+ children = gtk_container_get_children(GTK_CONTAINER(vbox));
+ layout = children->data;
+
+ if(!GTK_IS_LAYOUT(layout))
+ {
printf("*** widget is not a layout ***");
- }
+ }
gtk_widget_realize (layout);
connect_awt_hook (env, obj, 1, GTK_LAYOUT (layout)->bin_window);
-
- gtk_widget_realize (ptr);
+
+ gtk_widget_realize (ptr);
connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
-
+
gdk_threads_leave ();
}
@@ -147,7 +154,6 @@ setup_window (JNIEnv *env, jobject obj, GtkWidget *window, jint width,
gtk_widget_show (vbox);
gtk_widget_realize (window);
-/* setBounds (window, x, y, width, height); */
connect_awt_hook (env, obj, 1, window->window);
set_visible (window, visible);
@@ -177,24 +183,6 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setTitle
}
/*
- * Set a window's resizing policy
- */
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setResizable
- (JNIEnv *env, jobject obj, jboolean resize)
-{
- void *ptr;
-
- ptr = NSA_GET_PTR (env, obj);
-
- gdk_threads_enter ();
- gtk_window_set_policy (GTK_WINDOW (ptr), resize, resize, 0);
- gdk_threads_leave ();
-}
-
-
-/*
* Lower the z-level of a window.
*/
@@ -230,20 +218,6 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_toFront (JNIEnv *env,
gdk_threads_leave ();
}
-static void
-setBounds (GtkWidget *widget, jint x, jint y, jint width, jint height)
-{
-/* gdk_window_get_root_origin (widget->window, &current_x, &current_y); */
-
-/* if (current_x != x || current_y != y) */
-/* { */
-/* gdk_window_set_hints (widget->window, x, y, 0, 0, 0, 0, GDK_HINT_POS); */
-/* gdk_window_move (widget->window, x, y); */
-/* } */
-
- gtk_widget_set_usize (widget, width, height);
-}
-
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBounds
(JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
{
@@ -255,7 +229,8 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBounds
gdk_threads_enter ();
widget = GTK_WIDGET (ptr);
- setBounds (widget, x, y, width, height);
+ gtk_widget_set_size_request (widget, width, height);
+ gtk_window_resize (GTK_WINDOW(widget), width, height);
gdk_threads_leave ();
}
@@ -314,8 +289,7 @@ gdk_window_get_root_geometry (GdkWindow *window,
gint *depth)
{
GdkWindow *private;
- unsigned int nchildren;
-
+
g_return_if_fail (window != NULL);
private = (GdkWindow*) window;
diff --git a/libjava/jni/gtk-peer/gtkpeer.h b/libjava/jni/gtk-peer/gtkpeer.h
index 1cfa6c472cd..2aa7109725a 100644
--- a/libjava/jni/gtk-peer/gtkpeer.h
+++ b/libjava/jni/gtk-peer/gtkpeer.h
@@ -142,77 +142,82 @@ struct graphics
#define AWT_KEY_PRESSED 401
#define AWT_KEY_RELEASED 402
-#define VK_UNDEFINED 0
#define AWT_KEY_CHAR_UNDEFINED 0
-#define VK_0 48
-#define VK_1 49
-#define VK_2 50
-#define VK_3 51
-#define VK_4 52
-#define VK_5 53
-#define VK_6 54
-#define VK_7 55
-#define VK_8 56
-#define VK_9 57
-#define VK_A 65
-#define VK_ACCEPT 30
-#define VK_ADD 107
-#define VK_ALT 18
-#define VK_B 66
-#define VK_BACK_QUOTE 192
-#define VK_BACK_SLASH 92
-#define VK_BACK_SPACE 8
-#define VK_C 67
+#define AWT_KEY_LOCATION_UNKNOWN 0
+#define AWT_KEY_LOCATION_STANDARD 1
+#define AWT_KEY_LOCATION_LEFT 2
+#define AWT_KEY_LOCATION_RIGHT 3
+#define AWT_KEY_LOCATION_NUMPAD 4
+
+/* Virtual Keys */
+/* This list should be kept in the same order as the VK_ field
+ declarations in KeyEvent.java. */
+#define VK_ENTER '\n'
+#define VK_BACK_SPACE '\b'
+#define VK_TAB '\t'
#define VK_CANCEL 3
-#define VK_CAPS_LOCK 20
-#define VK_CLEAR 12
-#define VK_CLOSE_BRACKET 93
-#define VK_COMMA 44
+#define VK_CLEAR 12
+#define VK_SHIFT 16
#define VK_CONTROL 17
-#define VK_CONVERT 28
-#define VK_D 68
-#define VK_DECIMAL 110
-#define VK_DELETE 127
-#define VK_DIVIDE 111
-#define VK_DOWN 40
-#define VK_E 69
-#define VK_END 35
-#define VK_ENTER 10
+#define VK_ALT 18
+#define VK_PAUSE 19
+#define VK_CAPS_LOCK 20
#define VK_ESCAPE 27
-#define VK_F 70
-#define VK_F1 112
-#define VK_F10 121
-#define VK_F11 122
-#define VK_F12 123
-#define VK_F2 113
-#define VK_F3 114
-#define VK_F4 115
-#define VK_F5 116
-#define VK_F6 117
-#define VK_F7 118
-#define VK_F8 119
-#define VK_F9 120
-#define VK_FINAL 24
-#define VK_G 71
-#define VK_H 72
-#define VK_HELP 156
+#define VK_SPACE ' '
+#define VK_PAGE_UP 33
+#define VK_PAGE_DOWN 34
+#define VK_END 35
#define VK_HOME 36
-#define VK_I 73
-#define VK_INSERT 155
-#define VK_J 74
-#define VK_K 75
-#define VK_KANA 21
-#define VK_KANJI 25
-#define VK_L 76
#define VK_LEFT 37
-#define VK_M 77
-#define VK_META 157
-#define VK_MODECHANGE 31
-#define VK_MULTIPLY 106
-#define VK_N 78
-#define VK_NONCONVERT 29
-#define VK_NUM_LOCK 144
+#define VK_UP 38
+#define VK_RIGHT 39
+#define VK_DOWN 40
+#define VK_COMMA ','
+#define VK_MINUS '-'
+#define VK_PERIOD '.'
+#define VK_SLASH '/'
+#define VK_0 '0'
+#define VK_1 '1'
+#define VK_2 '2'
+#define VK_3 '3'
+#define VK_4 '4'
+#define VK_5 '5'
+#define VK_6 '6'
+#define VK_7 '7'
+#define VK_8 '8'
+#define VK_9 '9'
+#define VK_SEMICOLON ';'
+#define VK_EQUALS '='
+#define VK_A 'A'
+#define VK_B 'B'
+#define VK_C 'C'
+#define VK_D 'D'
+#define VK_E 'E'
+#define VK_F 'F'
+#define VK_G 'G'
+#define VK_H 'H'
+#define VK_I 'I'
+#define VK_J 'J'
+#define VK_K 'K'
+#define VK_L 'L'
+#define VK_M 'M'
+#define VK_N 'N'
+#define VK_O 'O'
+#define VK_P 'P'
+#define VK_Q 'Q'
+#define VK_R 'R'
+#define VK_S 'S'
+#define VK_T 'T'
+#define VK_U 'U'
+#define VK_V 'V'
+#define VK_W 'W'
+#define VK_X 'X'
+#define VK_Y 'Y'
+#define VK_Z 'Z'
+#define VK_OPEN_BRACKET '['
+#define VK_BACK_SLASH '\\'
+#define VK_CLOSE_BRACKET ']'
#define VK_NUMPAD0 96
#define VK_NUMPAD1 97
#define VK_NUMPAD2 98
@@ -223,35 +228,117 @@ struct graphics
#define VK_NUMPAD7 103
#define VK_NUMPAD8 104
#define VK_NUMPAD9 105
-#define VK_O 79
-#define VK_OPEN_BRACKET 91
-#define VK_P 80
-#define VK_PAGE_DOWN 34
-#define VK_PAGE_UP 33
-#define VK_PAUSE 19
-#define VK_PERIOD 46
-#define VK_PRINTSCREEN 154
-#define VK_Q 81
-#define VK_QUOTE 222
-#define VK_R 82
-#define VK_RIGHT 39
-#define VK_S 83
-#define VK_SCROLL_LOCK 145
-#define VK_SEMICOLON 59
+#define VK_MULTIPLY 106
+#define VK_ADD 107
+#define VK_SEPARATER 108
#define VK_SEPARATOR 108
-#define VK_SHIFT 16
-#define VK_SLASH 47
-#define VK_SPACE 32
#define VK_SUBTRACT 109
-#define VK_T 84
-#define VK_TAB 9
-#define VK_U 85
-#define VK_UP 38
-#define VK_V 86
-#define VK_W 87
-#define VK_X 88
-#define VK_Y 89
-#define VK_Z 90
+#define VK_DECIMAL 110
+#define VK_DIVIDE 111
+#define VK_DELETE 127
+#define VK_NUM_LOCK 144
+#define VK_SCROLL_LOCK 145
+#define VK_F1 112
+#define VK_F2 113
+#define VK_F3 114
+#define VK_F4 115
+#define VK_F5 116
+#define VK_F6 117
+#define VK_F7 118
+#define VK_F8 119
+#define VK_F9 120
+#define VK_F10 121
+#define VK_F11 122
+#define VK_F12 123
+#define VK_F13 61440
+#define VK_F14 61441
+#define VK_F15 61442
+#define VK_F16 61443
+#define VK_F17 61444
+#define VK_F18 61445
+#define VK_F19 61446
+#define VK_F20 61447
+#define VK_F21 61448
+#define VK_F22 61449
+#define VK_F23 61450
+#define VK_F24 61451
+#define VK_PRINTSCREEN 154
+#define VK_INSERT 155
+#define VK_HELP 156
+#define VK_META 157
+#define VK_BACK_QUOTE 192
+#define VK_QUOTE 222
+#define VK_KP_UP 224
+#define VK_KP_DOWN 225
+#define VK_KP_LEFT 226
+#define VK_KP_RIGHT 227
+#define VK_DEAD_GRAVE 128
+#define VK_DEAD_ACUTE 129
+#define VK_DEAD_CIRCUMFLEX 130
+#define VK_DEAD_TILDE 131
+#define VK_DEAD_MACRON 132
+#define VK_DEAD_BREVE 133
+#define VK_DEAD_ABOVEDOT 134
+#define VK_DEAD_DIAERESIS 135
+#define VK_DEAD_ABOVERING 136
+#define VK_DEAD_DOUBLEACUTE 137
+#define VK_DEAD_CARON 138
+#define VK_DEAD_CEDILLA 139
+#define VK_DEAD_OGONEK 140
+#define VK_DEAD_IOTA 141
+#define VK_DEAD_VOICED_SOUND 142
+#define VK_DEAD_SEMIVOICED_SOUND 143
+#define VK_AMPERSAND 150
+#define VK_ASTERISK 151
+#define VK_QUOTEDBL 152
+#define VK_LESS 153
+#define VK_GREATER 160
+#define VK_BRACELEFT 161
+#define VK_BRACERIGHT 162
+#define VK_AT 512
+#define VK_COLON 513
+#define VK_CIRCUMFLEX 514
+#define VK_DOLLAR 515
+#define VK_EURO_SIGN 516
+#define VK_EXCLAMATION_MARK 517
+#define VK_INVERTED_EXCLAMATION_MARK 518
+#define VK_LEFT_PARENTHESIS 519
+#define VK_NUMBER_SIGN 520
+#define VK_PLUS 521
+#define VK_RIGHT_PARENTHESIS 522
+#define VK_UNDERSCORE 523
+#define VK_FINAL 24
+#define VK_CONVERT 28
+#define VK_NONCONVERT 29
+#define VK_ACCEPT 30
+#define VK_MODECHANGE 31
+#define VK_KANA 21
+#define VK_KANJI 25
+#define VK_ALPHANUMERIC 240
+#define VK_KATAKANA 241
+#define VK_HIRAGANA 242
+#define VK_FULL_WIDTH 243
+#define VK_HALF_WIDTH 244
+#define VK_ROMAN_CHARACTERS 245
+#define VK_ALL_CANDIDATES 256
+#define VK_PREVIOUS_CANDIDATE 257
+#define VK_CODE_INPUT 258
+#define VK_JAPANESE_KATAKANA 259
+#define VK_JAPANESE_HIRAGANA 260
+#define VK_JAPANESE_ROMAN 261
+#define VK_KANA_LOCK 262
+#define VK_INPUT_METHOD_ON_OFF 263
+#define VK_CUT 65489
+#define VK_COPY 65485
+#define VK_PASTE 65487
+#define VK_UNDO 65483
+#define VK_AGAIN 65481
+#define VK_FIND 65488
+#define VK_PROPS 65482
+#define VK_STOP 65480
+#define VK_COMPOSE 65312
+#define VK_ALT_GRAPH 65406
+#define VK_UNDEFINED 0
#define AWT_FOCUS_LOST 1004
#define AWT_FOCUS_GAINED 1005
diff --git a/libjava/libart.m4 b/libjava/libart.m4
index 9380a222de6..48d86651636 100644
--- a/libjava/libart.m4
+++ b/libjava/libart.m4
@@ -32,7 +32,10 @@ AC_ARG_ENABLE(libarttest, [ --disable-libarttest Do not try to compile an
fi
fi
- AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ AC_PATH_PROG(LIBART_CONFIG, libart2-config, no)
+ if test "$LIBART_CONFIG" = "no" ; then
+ AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
+ fi
min_libart_version=ifelse([$1], ,0.2.5,$1)
AC_MSG_CHECKING(for LIBART - version >= $min_libart_version)
no_libart=""
diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog
index e84f3c7591b..67edbdd80cb 100644
--- a/libjava/libltdl/ChangeLog
+++ b/libjava/libltdl/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Don't initialize GCINCS to boehm-gc/include.
+ * Regenerate.
+
2002-04-28 Mark Mitchell <mark@codesourcery.com>
* .cvsignore: Remove files that are present in CVS.
diff --git a/libjava/libltdl/configure b/libjava/libltdl/configure
index 9dc2aea355e..76d37e8b4ba 100755
--- a/libjava/libltdl/configure
+++ b/libjava/libltdl/configure
@@ -2497,8 +2497,7 @@ fi
GCINCS=
if test "$GC" = "boehm"; then
- GCINCS='-I$(top_srcdir)/../../boehm-gc/include'
- GCINCS="$GCINCS `cat ../../boehm-gc/boehm-cflags`"
+ GCINCS="`cat ../../boehm-gc/boehm-cflags`"
cat >> confdefs.h <<\EOF
#define HAVE_BOEHM_GC 1
EOF
@@ -2507,7 +2506,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2511: checking how to run the C preprocessor" >&5
+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=
@@ -2522,13 +2521,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 2526 "configure"
+#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:2532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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
:
@@ -2539,13 +2538,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2543 "configure"
+#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:2549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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
:
@@ -2556,13 +2555,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2560 "configure"
+#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:2566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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
:
@@ -2594,7 +2593,7 @@ rm -f conftest
# Check for command to grab the raw symbol name followed by C symbol from nm.
echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:2598: checking command to parse $NM output" >&5
+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
else
@@ -2657,11 +2656,11 @@ void nm_test_func(){}
int main(){nm_test_var='a';nm_test_func;return 0;}
EOF
- if { (eval echo configure:2661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ 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
- if { (eval echo configure:2665: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ if { (eval echo configure: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
# Try sorting and uniquifying the output.
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
@@ -2713,7 +2712,7 @@ EOF
ac_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ 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
@@ -2759,12 +2758,12 @@ fi
echo "$ac_t""$ac_result" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2763: checking for ANSI C header files" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 2768 "configure"
+#line 2767 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2772,7 +2771,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -2789,7 +2788,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 2793 "configure"
+#line 2792 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2807,7 +2806,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 2811 "configure"
+#line 2810 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2828,7 +2827,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2832 "configure"
+#line 2831 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2839,7 +2838,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
:
else
@@ -2889,7 +2888,7 @@ else
fi
echo $ac_n "checking which extension is used for shared libraries""... $ac_c" 1>&6
-echo "configure:2893: checking which extension is used for shared libraries" >&5
+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
@@ -2916,7 +2915,7 @@ EOF
fi
echo $ac_n "checking which variable specifies run-time library path""... $ac_c" 1>&6
-echo "configure:2920: checking which variable specifies run-time library path" >&5
+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
else
@@ -2932,7 +2931,7 @@ EOF
fi
echo $ac_n "checking for the default library search path""... $ac_c" 1>&6
-echo "configure:2936: checking for the default library search path" >&5
+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
else
@@ -2960,7 +2959,7 @@ EOF
fi
echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:2964: checking for objdir" >&5
+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
else
@@ -2987,7 +2986,7 @@ EOF
echo $ac_n "checking whether libtool supports -dlopen/-dlpreopen""... $ac_c" 1>&6
-echo "configure:2991: checking whether libtool supports -dlopen/-dlpreopen" >&5
+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
else
@@ -3009,7 +3008,7 @@ fi
LIBADD_DL=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3013: checking for dlopen in -ldl" >&5
+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
@@ -3017,7 +3016,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3021 "configure"
+#line 3020 "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
@@ -3028,7 +3027,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
@@ -3050,12 +3049,12 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:3054: checking for dlopen" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3059 "configure"
+#line 3058 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -3078,7 +3077,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:3082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
@@ -3099,7 +3098,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:3103: checking for dlopen in -lsvld" >&5
+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
@@ -3107,7 +3106,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsvld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3111 "configure"
+#line 3110 "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
@@ -3118,7 +3117,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
@@ -3147,12 +3146,12 @@ fi
fi
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:3151: checking for shl_load" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3156 "configure"
+#line 3155 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
@@ -3175,7 +3174,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo configure:3179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
@@ -3196,7 +3195,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:3200: checking for shl_load in -ldld" >&5
+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
@@ -3204,7 +3203,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3208 "configure"
+#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
@@ -3215,7 +3214,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -3243,7 +3242,7 @@ fi
fi
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:3247: checking for dld_link in -ldld" >&5
+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
@@ -3251,7 +3250,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3255 "configure"
+#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
@@ -3262,7 +3261,7 @@ int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -3293,12 +3292,12 @@ if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; the
for ac_func in dlerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3297: checking for $ac_func" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3302 "configure"
+#line 3301 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3321,7 +3320,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
@@ -3349,7 +3348,7 @@ done
fi
echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:3353: checking for _ prefix in compiled symbols" >&5
+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
else
@@ -3358,10 +3357,10 @@ cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
-if { (eval echo configure:3362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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:3365: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ if { (eval echo configure: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
@@ -3388,7 +3387,7 @@ if test x"$ac_cv_sys_symbol_underscore" = xyes; then
if test x"$ac_cv_func_dlopen" = xyes ||
test x"$ac_cv_lib_dl_dlopen" = xyes ; then
echo $ac_n "checking whether we have to add an underscore for dlsym""... $ac_c" 1>&6
-echo "configure:3392: checking whether we have to add an underscore for dlsym" >&5
+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
@@ -3397,7 +3396,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 3401 "configure"
+#line 3400 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -3444,7 +3443,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo configure:3448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -3476,17 +3475,17 @@ for ac_hdr in malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3480: checking for $ac_hdr" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3485 "configure"
+#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:3490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -3516,17 +3515,17 @@ for ac_hdr in string.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3520: checking for $ac_hdr" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3525 "configure"
+#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:3530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -3555,12 +3554,12 @@ done
for ac_func in strchr index
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3559: checking for $ac_func" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3564 "configure"
+#line 3563 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3583,7 +3582,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
@@ -3610,12 +3609,12 @@ done
for ac_func in strrchr rindex
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3614: checking for $ac_func" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3619 "configure"
+#line 3618 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3638,7 +3637,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
@@ -3665,12 +3664,12 @@ done
for ac_func in strcmp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3669: checking for $ac_func" >&5
+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
else
cat > conftest.$ac_ext <<EOF
-#line 3674 "configure"
+#line 3673 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3693,7 +3692,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
else
diff --git a/libjava/libltdl/configure.in b/libjava/libltdl/configure.in
index 9d96d9086fd..3c1fa37356f 100644
--- a/libjava/libltdl/configure.in
+++ b/libjava/libltdl/configure.in
@@ -47,8 +47,7 @@ changequote([,])
GCINCS=
if test "$GC" = "boehm"; then
- GCINCS='-I$(top_srcdir)/../../boehm-gc/include'
- GCINCS="$GCINCS `cat ../../boehm-gc/boehm-cflags`"
+ GCINCS="`cat ../../boehm-gc/boehm-cflags`"
AC_DEFINE(HAVE_BOEHM_GC)
fi
AC_SUBST(GCINCS)
diff --git a/libjava/mauve-libgcj b/libjava/mauve-libgcj
index a2ccd5f9785..53187b8d03d 100644
--- a/libjava/mauve-libgcj
+++ b/libjava/mauve-libgcj
@@ -25,3 +25,6 @@ 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/prims.cc b/libjava/prims.cc
index 8d9cc6d97d7..8208995460e 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -1,6 +1,6 @@
// prims.cc - Code for core of runtime environment.
-/* 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 libgcj.
@@ -122,11 +122,26 @@ void (*_Jv_JVMPI_Notify_THREAD_END) (JVMPI_Event *event);
#endif
+/* Unblock a signal. Unless we do this, the signal may only be sent
+ once. */
+static void
+unblock_signal (int signum)
+{
+#ifdef _POSIX_VERSION
+ sigset_t sigs;
+
+ sigemptyset (&sigs);
+ sigaddset (&sigs, signum);
+ sigprocmask (SIG_UNBLOCK, &sigs, NULL);
+#endif
+}
+
#ifdef HANDLE_SEGV
SIGNAL_HANDLER (catch_segv)
{
java::lang::NullPointerException *nullp
= new java::lang::NullPointerException;
+ unblock_signal (SIGSEGV);
MAKE_THROW_FRAME (nullp);
throw nullp;
}
@@ -137,6 +152,7 @@ SIGNAL_HANDLER (catch_fpe)
{
java::lang::ArithmeticException *arithexception
= new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero"));
+ unblock_signal (SIGFPE);
#ifdef HANDLE_DIVIDE_OVERFLOW
HANDLE_DIVIDE_OVERFLOW;
#else
@@ -1137,3 +1153,21 @@ _Jv_remJ (jlong dividend, jlong divisor)
return dividend % divisor;
}
+
+
+
+// Return true if SELF_KLASS can access a field or method in
+// OTHER_KLASS. The field or method's access flags are specified in
+// FLAGS.
+jboolean
+_Jv_CheckAccess (jclass self_klass, jclass other_klass, jint flags)
+{
+ using namespace java::lang::reflect;
+ return ((self_klass == other_klass)
+ || ((flags & Modifier::PUBLIC) != 0)
+ || (((flags & Modifier::PROTECTED) != 0)
+ && other_klass->isAssignableFrom (self_klass))
+ || (((flags & Modifier::PRIVATE) == 0)
+ && _Jv_ClassNameSamePackage (self_klass->name,
+ other_klass->name)));
+}
diff --git a/libjava/resolve.cc b/libjava/resolve.cc
index 7cf0b0a3f8e..d79affea9eb 100644
--- a/libjava/resolve.cc
+++ b/libjava/resolve.cc
@@ -166,15 +166,7 @@ _Jv_ResolvePoolEntry (jclass klass, int index)
if (! _Jv_equalUtf8Consts (field->name, field_name))
continue;
- // now, check field access.
-
- if ( (cls == klass)
- || ((field->flags & Modifier::PUBLIC) != 0)
- || (((field->flags & Modifier::PROTECTED) != 0)
- && cls->isAssignableFrom (klass))
- || (((field->flags & Modifier::PRIVATE) == 0)
- && _Jv_ClassNameSamePackage (cls->name,
- klass->name)))
+ if (_Jv_CheckAccess (klass, cls, field->flags))
{
/* resove the field using the class' own loader
if necessary */
@@ -347,20 +339,10 @@ _Jv_SearchMethodInClass (jclass cls, jclass klass,
method_signature)))
continue;
- if (cls == klass
- || ((method->accflags & Modifier::PUBLIC) != 0)
- || (((method->accflags & Modifier::PROTECTED) != 0)
- && cls->isAssignableFrom (klass))
- || (((method->accflags & Modifier::PRIVATE) == 0)
- && _Jv_ClassNameSamePackage (cls->name,
- klass->name)))
- {
- return method;
- }
+ if (_Jv_CheckAccess (klass, cls, method->accflags))
+ return method;
else
- {
- throw new java::lang::IllegalAccessError;
- }
+ throw new java::lang::IllegalAccessError;
}
return 0;
}
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index ac9493bd357..eccde2a1f9d 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,100 @@
+2003-09-21 Ralph Loader <suckfish@ihug.co.nz>
+
+ PR java/12350
+ * libjava.lang/PR12350.java: New file.
+ * libjava.lang/PR12350.out: New file.
+
+2003-09-17 Ranjit Mathew <rmathew@hotmail.com>
+
+ PR java/9577
+ * libjava.cni/PR9577.java: New file.
+ * libjava.cni/natPR9577.cc: New file.
+ * libjava.cni/PR9577.out: New file.
+
+2003-09-04 Jeff Sturm <jsturm@one-point.com>
+
+ * libjava.compile/compile.exp: Test with -O3 rather than -O.
+ * libjava.lang/lang.exp: Likewise.
+
+2003-09-04 Jeff Sturm <jsturm@one-point.com>
+
+ * lib/libjava.exp (libjava_arguments): Remove unneeded variables.
+ (test_libjava_from_source): Likewise.
+ (test_libjava_from_javac): Likewise.
+
+2003-08-23 Andreas Tobler <a.tobler@schweiz.ch>
+
+ PR libgcj/8823
+ * libjava.lang/pr8823.xfail: Removed.
+
+2003-08-19 Jeff Sturm <jsturm@one-point.com>
+
+ * lib/libjava.exp (libjava_arguments): Add $libjava to the list of
+ libraries.
+
+2003-08-18 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/11951:
+ * libjava.jni/pr11951.c: New file.
+ * libjava.jni/pr11951.out: New file.
+ * libjava.jni/pr11951.java: New file.
+
+2003-08-12 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jacks/jacks.xfail: Updated to account for new passes.
+ * libjava.compile/abstr.xfail: Now can compile from bytecode.
+ * libjava.compile/PR5641.xfail: Now can compile from bytecode.
+
+ * libjava.mauve/mauve.exp (test_mauve_sim): Don't find
+ DejaGNUTestHarness in gnu/testlet.
+ (test_mauve): Use correct object extension.
+
+2003-08-12 Tom Tromey <tromey@redhat.com>
+
+ * lib/libjava.exp (libjava_find_lib): Search for .so file first.
+ (libjava_arguments): Don't add libraries to link line explictly.
+
+2003-08-05 Tom Tromey <tromey@redhat.com>
+
+ For PR java/11600:
+ * libjava.compile/PR11600.xfail: New file.
+ * libjava.compile/PR11600.java: New file.
+
+2003-08-04 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jacks/jacks.exp (gcj_jacks_run): Just ignore errors
+ from jacks.
+
+2003-07-24 Tom Tromey <tromey@redhat.com>
+
+ For PR libgcj/7482:
+ * libjava.lang/PR7482.java: New file.
+ * libjava.lang/PR7482.out: New file.
+
+2003-07-20 Tom Tromey <tromey@redhat.com>
+
+ * libjava.mauve/mauve.exp (mauve_find_harness_files): New proc.
+ (test_mauve): Use it.
+ (test_mauve_sim): Likewise.
+
+2003-07-19 Tom Tromey <tromey@redhat.com>
+
+ * libjava.verify/verify.exp (gcj_verify_list_tests): Only change
+ directory if new directory exists.
+
+2003-07-13 Tom Tromey <tromey@redhat.com>
+
+ * libjava.verify/verify.exp: Fixed variable init.
+
+2003-07-10 Tom Tromey <tromey@redhat.com>
+
+ * libjava.verify/verify.exp: New file.
+ * libjava.verify/README.verify: New file.
+
+2003-07-09 Jeff Sturm <jsturm@one-point.com>
+
+ * libjava.lang/SyncTest.java (run): Cache .class value.
+
2003-06-08 Roger Sayle <roger@eyesopen.com>
* libjava.lang/MathBuiltin.java: New test case.
diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in
index 091051224b9..a45ec55ddb2 100644
--- a/libjava/testsuite/Makefile.in
+++ b/libjava/testsuite/Makefile.in
@@ -125,6 +125,7 @@ STRIP = @STRIP@
SYSDEP_SOURCES = @SYSDEP_SOURCES@
SYSTEMSPEC = @SYSTEMSPEC@
SYS_ZLIBS = @SYS_ZLIBS@
+THREADCXXFLAGS = @THREADCXXFLAGS@
THREADDEPS = @THREADDEPS@
THREADINCS = @THREADINCS@
THREADLDFLAGS = @THREADLDFLAGS@
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 972b7be64cc..42732f59e6c 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -200,6 +200,7 @@ proc libjava_init { args } {
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
lappend libjava_libgcc_s_path $gccdir
+ verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
set compiler ${gccdir}/xgcc
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
@@ -234,21 +235,24 @@ proc libjava_init { args } {
proc libjava_find_lib {dir name} {
global base_dir
set gp [get_multilibs]
- foreach sub {.libs _libs} {
- if {$gp != ""} {
- if {[file exists $gp/$dir/$sub/lib${name}.a]} then {
- # Just return the `-L' option. The library itself
- # will be picked up via the spec file.
- return "-L$gp/$dir/$sub"
+ foreach extension {so dll a} {
+ foreach sub {.libs _libs} {
+ if {$gp != ""} {
+ if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
+ # Just return the `-L' option. The library itself
+ # will be picked up via the spec file.
+ return "-L$gp/$dir/$sub"
+ }
+ }
+ # Just return the `-L' option. The library itself will be
+ # picked up via the spec file.
+ set lib [findfile \
+ $base_dir/../../$dir/$sub/lib${name}.${extension} \
+ "-L$base_dir/../../$dir/$sub" \
+ ""]
+ if {$lib != ""} {
+ return $lib
}
- }
- # Just return the `-L' option. The library itself will be
- # picked up via the spec file.
- set lib [findfile $base_dir/../../$dir/$sub/lib${name}.a \
- "-L$base_dir/../../$dir/$sub" \
- ""]
- if {$lib != ""} {
- return $lib
}
}
return ""
@@ -303,9 +307,6 @@ proc gcj_cleanup {args} {
proc libjava_arguments {{mode compile}} {
global base_dir
global LIBJAVA
- global LIBGC
- global LIBQTHREADS
- global LIBZ
global srcdir subdir objdir
global TOOL_OPTIONS
global GCJ_UNDER_TEST
@@ -322,39 +323,14 @@ proc libjava_arguments {{mode compile}} {
set libjava [libjava_find_lib libjava gcj]
}
- if [info exists LIBGC] {
- set libgc $LIBGC;
- } else {
- set libgc [libjava_find_lib boehm-gc gcjgc]
- }
-
- if [info exists LIBQTHREADS] {
- set libqthreads $LIBQTHREADS
- } else {
- set libqthreads [libjava_find_lib qthreads gcjcoop]
- }
-
- if [info exists LIBZ] {
- set libz $LIBZ
- } else {
- set libz [libjava_find_lib zlib zgcj]
- }
-
- # FIXME: there's no way to determine whether -lpthread is
- # required. We should get this info from configure, or it should
- # just be in the compiler driver.
-
verbose "using LIBJAVA = $libjava" 2
- verbose "using LIBGC = $libgc" 2
- verbose "using LIBQTHREADS = $libqthreads" 2
- verbose "using LIBZ = $libz" 2
set args ""
# Basically we want to build up a colon separated path list from
# the value of $libjava.
set lpath {}
- foreach dir [list $libjava $libgc $libz] {
+ foreach dir [list $libjava] {
foreach item [split $dir " "] {
switch -glob -- $item {
"-L*" {
@@ -365,6 +341,7 @@ proc libjava_arguments {{mode compile}} {
}
set lpath [concat $lpath $libjava_libgcc_s_path]
+ verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
set ld_library_path [join $lpath :]
# That's enough to make things work for the normal case.
@@ -384,13 +361,10 @@ proc libjava_arguments {{mode compile}} {
set env(CLASSPATH) ".:$srcdir/$subdir:$objdir:$libgcj_jar"
if {$mode == "link"} {
- global wrapper_file wrap_compile_flags;
- lappend args "additional_flags=$wrap_compile_flags";
- lappend args "libs=$wrapper_file";
- lappend args "libs=$libjava";
- lappend args "libs=$libgc";
- lappend args "libs=$libqthreads"
- lappend args "libs=$libz"
+ global wrapper_file wrap_compile_flags
+ lappend args "additional_flags=$wrap_compile_flags"
+ lappend args "libs=$wrapper_file"
+ lappend args "libs=$libjava"
lappend args debug
}
@@ -574,8 +548,6 @@ proc libjava_invoke {errname testName optName executable inpfile resultfile args
#
proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
global base_dir
- global LIBJAVA
- global LIBGC
global srcdir subdir objdir
global TOOL_OPTIONS
global GCJ_UNDER_TEST
@@ -681,8 +653,6 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
#
proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile exec_args } {
global base_dir
- global LIBJAVA
- global LIBGC
global srcdir subdir objdir
global TOOL_OPTIONS
global GCJ_UNDER_TEST
diff --git a/libjava/testsuite/libjava.cni/PR9577.java b/libjava/testsuite/libjava.cni/PR9577.java
new file mode 100644
index 00000000000..26973924333
--- /dev/null
+++ b/libjava/testsuite/libjava.cni/PR9577.java
@@ -0,0 +1,14 @@
+// Check if a method name is mangled properly in the presence
+// of an array parameter sharing a part of the type name
+// with a subsequent parameter.
+
+public class PR9577
+{
+ private native void sayHello (String[] s, Object o);
+
+ public static void main (String[] args)
+ {
+ PR9577 x = new PR9577( );
+ x.sayHello( null, null);
+ }
+}
diff --git a/libjava/testsuite/libjava.cni/PR9577.out b/libjava/testsuite/libjava.cni/PR9577.out
new file mode 100644
index 00000000000..10ddd6d257e
--- /dev/null
+++ b/libjava/testsuite/libjava.cni/PR9577.out
@@ -0,0 +1 @@
+Hello!
diff --git a/libjava/testsuite/libjava.cni/natPR9577.cc b/libjava/testsuite/libjava.cni/natPR9577.cc
new file mode 100644
index 00000000000..90fafeea311
--- /dev/null
+++ b/libjava/testsuite/libjava.cni/natPR9577.cc
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+#include "PR9577.h"
+
+void
+PR9577::sayHello (JArray< ::java::lang::String *> *x, ::java::lang::Object *y)
+ {
+ printf( "Hello!\n");
+ }
diff --git a/libjava/testsuite/libjava.compile/PR11600.java b/libjava/testsuite/libjava.compile/PR11600.java
new file mode 100644
index 00000000000..3cffa732c49
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/PR11600.java
@@ -0,0 +1,7 @@
+public class PR11600 implements Cloneable
+{
+ public Object clone ()
+ {
+ return super.clone ();
+ }
+}
diff --git a/libjava/testsuite/libjava.compile/PR11600.xfail b/libjava/testsuite/libjava.compile/PR11600.xfail
new file mode 100644
index 00000000000..e3b083b1fa5
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/PR11600.xfail
@@ -0,0 +1 @@
+shouldfail
diff --git a/libjava/testsuite/libjava.compile/PR5641.xfail b/libjava/testsuite/libjava.compile/PR5641.xfail
index b3630c99118..76540afa49b 100644
--- a/libjava/testsuite/libjava.compile/PR5641.xfail
+++ b/libjava/testsuite/libjava.compile/PR5641.xfail
@@ -1,2 +1 @@
no-link
-xfail-byte
diff --git a/libjava/testsuite/libjava.compile/abstr.xfail b/libjava/testsuite/libjava.compile/abstr.xfail
index b3630c99118..76540afa49b 100644
--- a/libjava/testsuite/libjava.compile/abstr.xfail
+++ b/libjava/testsuite/libjava.compile/abstr.xfail
@@ -1,2 +1 @@
no-link
-xfail-byte
diff --git a/libjava/testsuite/libjava.compile/compile.exp b/libjava/testsuite/libjava.compile/compile.exp
index 6b4038659cd..9eba0d4ad77 100644
--- a/libjava/testsuite/libjava.compile/compile.exp
+++ b/libjava/testsuite/libjava.compile/compile.exp
@@ -12,7 +12,7 @@ foreach x $srcfiles {
lappend args no-exec
test_libjava "" "$x" "" "" "" $args
- test_libjava "" "$x" "-O" "" "" $args
+ test_libjava "" "$x" "-O3" "" "" $args
}
# Local Variables:
diff --git a/libjava/testsuite/libjava.jacks/jacks.exp b/libjava/testsuite/libjava.jacks/jacks.exp
index d8611f5e438..8b2bd9b5b5a 100644
--- a/libjava/testsuite/libjava.jacks/jacks.exp
+++ b/libjava/testsuite/libjava.jacks/jacks.exp
@@ -89,14 +89,11 @@ proc gcj_jacks_run {} {
gcj_jacks_write gcj_setup
verbose "Running Jacks..."
- if {[catch {exec ./jacks gcj} msg]} {
- verbose "jacks invocation failure: $msg"
- fail "running jacks"
- } else {
- pass "running jacks"
+ # Just ignore error exits from the jacks program.
+ # It will always error exit for us, since don't completely pass.
+ catch {exec ./jacks gcj} msg
- gcj_jacks_parse logging/gcj.log
- }
+ gcj_jacks_parse logging/gcj.log
cd $here
}
diff --git a/libjava/testsuite/libjava.jacks/jacks.xfail b/libjava/testsuite/libjava.jacks/jacks.xfail
index df8d5b94dab..e5baf9f88ad 100644
--- a/libjava/testsuite/libjava.jacks/jacks.xfail
+++ b/libjava/testsuite/libjava.jacks/jacks.xfail
@@ -141,8 +141,6 @@
8.1.1.1-default-abstract-15
8.1.1.1-default-abstract-19
8.1.1.1-default-abstract-21
-8.1.1.1-default-abstract-22
-8.1.1.1-default-abstract-24
8.1.1.1-default-abstract-25
8.1.2-static-1
8.1.2-static-11
@@ -223,21 +221,15 @@
8.5-inheritance-3
8.5-inheritance-6
8.5.2-non-static-member-usage-2
-8.4.6-miranda-2
-8.4.6-miranda-3
-8.4.6-miranda-4
8.4.6-inheritance-1
8.4.6-inheritance-2
8.4.6.2-hiding-3
8.4.6.4-multiple-3
8.4.6.4-multiple-4
-8.4.6.4-multiple-5
8.4.6.4-multiple-7
8.4.6.4-multiple-8
8.4.6.4-abstract-1
8.4.6.4-abstract-2
-8.4.6.4-abstract-4
-8.4.6.4-abstract-9
8.4.6.4-abstract-10
8.4.6.1-override-3
8.4.6.3-modifier-8
@@ -252,11 +244,6 @@
8.4.6.3-default-12
8.4.6.3-default-14
8.4.6.3-signature-4
-8.4.6.3-signature-7
-8.4.6.3-signature-9
-8.4.6.3-signature-10
-8.4.6.3-signature-12
-8.4.6.3-signature-15
8.7-abrupt-1
8.7-complete-1
8.7-complete-3
@@ -613,10 +600,7 @@
9.2-implicit-4
9.2-implicit-6
9.2-implicit-7
-9.2-implicit-11
-9.2-implicit-12
9.2-implicit-15
-9.2-implicit-17
9.2-implicit-18
9.2-implicit-19
3.2-valid-1
diff --git a/libjava/testsuite/libjava.jni/pr11951.c b/libjava/testsuite/libjava.jni/pr11951.c
new file mode 100644
index 00000000000..4c8ab63f1da
--- /dev/null
+++ b/libjava/testsuite/libjava.jni/pr11951.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <pr11951.h>
+
+JNIEXPORT void JNICALL
+Java_pr11951_nmethod (JNIEnv *env, jclass myclass)
+{
+ jmethodID method;
+ jobject r;
+
+ method = (*env)->GetStaticMethodID (env, myclass, "dosomething",
+ "()Ljava/lang/Object;");
+ r = (*env)->CallStaticObjectMethod (env, myclass, method);
+ printf ("%d\n", r == NULL);
+
+ (*env)->ExceptionClear (env);
+}
diff --git a/libjava/testsuite/libjava.jni/pr11951.java b/libjava/testsuite/libjava.jni/pr11951.java
new file mode 100644
index 00000000000..68a9f0126a3
--- /dev/null
+++ b/libjava/testsuite/libjava.jni/pr11951.java
@@ -0,0 +1,14 @@
+public class pr11951
+{
+ public static Object dosomething()
+ {
+ throw new Error();
+ }
+
+ public static native void nmethod();
+
+ public static void main(String[] args)
+ {
+ nmethod();
+ }
+}
diff --git a/libjava/testsuite/libjava.jni/pr11951.out b/libjava/testsuite/libjava.jni/pr11951.out
new file mode 100644
index 00000000000..d00491fd7e5
--- /dev/null
+++ b/libjava/testsuite/libjava.jni/pr11951.out
@@ -0,0 +1 @@
+1
diff --git a/libjava/testsuite/libjava.lang/PR12350.java b/libjava/testsuite/libjava.lang/PR12350.java
new file mode 100644
index 00000000000..ded8856cf92
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR12350.java
@@ -0,0 +1,20 @@
+public class PR12350
+{
+ static public void main (String[] ignored) throws Throwable
+ {
+ StringBuffer b = new StringBuffer ("Good string. More than 16 chars.");
+
+ // Should cause sharing.
+ String s = b.toString();
+
+ // Take a char by char unshared copy of s.
+ String t = new String (s.toCharArray());
+
+ b.substring (0, 4); // BUG: Clears shared flag.
+ b.replace (0, 4, "Bad "); // Modifies shared data.
+
+ System.out.println (s);
+ assert s.equals (t);
+ }
+
+}
diff --git a/libjava/testsuite/libjava.lang/PR12350.out b/libjava/testsuite/libjava.lang/PR12350.out
new file mode 100644
index 00000000000..61dc0a6373f
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR12350.out
@@ -0,0 +1 @@
+Good string. More than 16 chars.
diff --git a/libjava/testsuite/libjava.lang/PR7482.java b/libjava/testsuite/libjava.lang/PR7482.java
new file mode 100644
index 00000000000..223fea66e36
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR7482.java
@@ -0,0 +1,35 @@
+public class PR7482
+{
+ private interface I { }
+ private static class B { }
+ private static class U extends B implements I { }
+ private static class V extends B implements I { }
+
+ static I field;
+
+ private static void g1(Object o)
+ {
+ I val;
+ if (o == null)
+ val = new U();
+ else
+ val = new V();
+ field = val;
+ }
+
+ private static I g2(Object o)
+ {
+ I val;
+ if (o == null)
+ val = new U();
+ else
+ val = new V();
+ return val;
+ }
+
+ public static void main(String[] args)
+ {
+ g1(null);
+ g2(null);
+ }
+}
diff --git a/libjava/testsuite/libjava.lang/PR7482.out b/libjava/testsuite/libjava.lang/PR7482.out
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR7482.out
diff --git a/libjava/testsuite/libjava.lang/SyncTest.java b/libjava/testsuite/libjava.lang/SyncTest.java
index 7cb6a56d397..85573f8a4b9 100644
--- a/libjava/testsuite/libjava.lang/SyncTest.java
+++ b/libjava/testsuite/libjava.lang/SyncTest.java
@@ -3,8 +3,11 @@ public class SyncTest implements Runnable {
static int counter;
public void run() {
+ // We cache the .class value; otherwise this code is
+ // slow enough that it will time out in some situations.
+ Object lock = SyncTest.class;
for (int n = 0; n < 1000000; n++)
- synchronized (SyncTest.class) {
+ synchronized (lock) {
counter++;
}
}
diff --git a/libjava/testsuite/libjava.lang/lang.exp b/libjava/testsuite/libjava.lang/lang.exp
index a4d15c52900..abc36d53b1e 100644
--- a/libjava/testsuite/libjava.lang/lang.exp
+++ b/libjava/testsuite/libjava.lang/lang.exp
@@ -27,7 +27,7 @@ foreach x $srcfiles {
verbose "inpfile is $inpfile"
test_libjava $options "${prefix}.java" "" $inpfile $resfile $args
- test_libjava $options "${prefix}.java" "-O" $inpfile $resfile $args
+ test_libjava $options "${prefix}.java" "-O3" $inpfile $resfile $args
}
# Local Variables:
diff --git a/libjava/testsuite/libjava.lang/pr8823.xfail b/libjava/testsuite/libjava.lang/pr8823.xfail
deleted file mode 100644
index 81d6df0a027..00000000000
--- a/libjava/testsuite/libjava.lang/pr8823.xfail
+++ /dev/null
@@ -1 +0,0 @@
-xfail-byte
diff --git a/libjava/testsuite/libjava.mauve/mauve.exp b/libjava/testsuite/libjava.mauve/mauve.exp
index dcd8a57fd1a..03bbed9fd9f 100644
--- a/libjava/testsuite/libjava.mauve/mauve.exp
+++ b/libjava/testsuite/libjava.mauve/mauve.exp
@@ -74,6 +74,16 @@ proc find_mauve_sources {} {
return 0
}
+# Find all the harness files and return a list of them, with no
+# suffix.
+proc mauve_find_harness_files {} {
+ set result {}
+ foreach file [glob -nocomplain -- *.class gnu/testlet/*.class] {
+ lappend result [file root $file]
+ }
+ return $result
+}
+
# Run all the Mauve tests. Return 1 on success, 0 on any failure. If
# the tests are skipped, that is treated like success.
proc test_mauve {} {
@@ -157,11 +167,17 @@ proc test_mauve {} {
set link_args [concat [libjava_arguments link] \
[list "additional_flags=--main=DejaGNUTestHarness"]]
+ if {[string match "*libtool*" $compile_args]} {
+ set objext lo
+ } else {
+ set objext o
+ }
+
set ok 1
set objlist {}
- foreach base {DejaGNUTestHarness gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException gnu/testlet/config} {
+ foreach base [mauve_find_harness_files] {
set file $base.class
- set obj $base.o
+ set obj $base.$objext
set x [libjava_prune_warnings \
[target_compile [pwd]/$file $obj object $compile_args]]
if {$x != ""} then {
@@ -184,7 +200,10 @@ proc test_mauve {} {
regsub -all -- / $class . class
set ok 1
+ set this_olist {}
foreach obj $uses($file) {
+ set obj [file rootname $obj].$objext
+ lappend this_olist $obj
if {! [file exists $obj]} then {
verbose "compiling $obj for test of $class"
# The .class file does contain a $, but we can quote it between "'"s.
@@ -206,7 +225,7 @@ proc test_mauve {} {
}
set x [libjava_prune_warnings \
- [libjava_tcompile [concat $uses($file) $objlist] \
+ [libjava_tcompile [concat $this_olist $objlist] \
$Executable executable $link_args]]
if {$x != ""} then {
set proc_ok 0
@@ -298,9 +317,7 @@ proc test_mauve_sim {} {
set ok 1
set objlist {}
- foreach base {gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness \
- gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException \
- gnu/testlet/config} {
+ foreach base [mauve_find_harness_files] {
set file $base.class
set obj $base.o
set x [libjava_prune_warnings \
@@ -317,8 +334,6 @@ proc test_mauve_sim {} {
return 0
}
- lappend objlist gnu/testlet/DejaGNUTestHarness.o
-
set proc_ok 1
set Executable DejaGNUTestHarness
foreach file $choices {
@@ -369,8 +384,8 @@ proc test_mauve_sim {} {
}
set x [libjava_prune_warnings \
- [target_compile gnu/testlet/DejaGNUTestHarness.class \
- gnu/testlet/DejaGNUTestHarness.o object $compile_args]]
+ [target_compile DejaGNUTestHarness.class \
+ DejaGNUTestHarness.o object $compile_args]]
if {$x != ""} then {
fail "Compile DejaGNUTestHarness.java"
set proc_ok 0
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 4a6ca458849..ba408aa98be 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1,4 +1,4 @@
-// defineclass.cc - defining a class from .class format.
+// verify.cc - verify bytecode
/* Copyright (C) 2001, 2002, 2003 Free Software Foundation
@@ -58,6 +58,7 @@ private:
struct subr_info;
struct subr_entry_info;
struct linked_utf8;
+ struct ref_intersection;
// The current PC.
int PC;
@@ -104,6 +105,9 @@ private:
// but without this our utf8 objects would be collected.
linked_utf8 *utf8_list;
+ // A linked list of all ref_intersection objects we allocate.
+ ref_intersection *isect_list;
+
struct linked_utf8
{
_Jv_Utf8Const *val;
@@ -189,9 +193,219 @@ private:
// Everything after `reference_type' must be a reference type.
reference_type,
null_type,
- unresolved_reference_type,
- uninitialized_reference_type,
- uninitialized_unresolved_reference_type
+ uninitialized_reference_type
+ };
+
+ // This represents a merged class type. Some verifiers (including
+ // earlier versions of this one) will compute the intersection of
+ // two class types when merging states. However, this loses
+ // critical information about interfaces implemented by the various
+ // classes. So instead we keep track of all the actual classes that
+ // have been merged.
+ struct ref_intersection
+ {
+ // Whether or not this type has been resolved.
+ bool is_resolved;
+
+ // Actual type data.
+ union
+ {
+ // For a resolved reference type, this is a pointer to the class.
+ jclass klass;
+ // For other reference types, this it the name of the class.
+ _Jv_Utf8Const *name;
+ } data;
+
+ // Link to the next reference in the intersection.
+ ref_intersection *ref_next;
+
+ // This is used to keep track of all the allocated
+ // ref_intersection objects, so we can free them.
+ // FIXME: we should allocate these in chunks.
+ ref_intersection *alloc_next;
+
+ ref_intersection (jclass klass, _Jv_BytecodeVerifier *verifier)
+ : ref_next (NULL)
+ {
+ is_resolved = true;
+ data.klass = klass;
+ alloc_next = verifier->isect_list;
+ verifier->isect_list = this;
+ }
+
+ ref_intersection (_Jv_Utf8Const *name, _Jv_BytecodeVerifier *verifier)
+ : ref_next (NULL)
+ {
+ is_resolved = false;
+ data.name = name;
+ alloc_next = verifier->isect_list;
+ verifier->isect_list = this;
+ }
+
+ ref_intersection (ref_intersection *dup, ref_intersection *tail,
+ _Jv_BytecodeVerifier *verifier)
+ : ref_next (tail)
+ {
+ is_resolved = dup->is_resolved;
+ data = dup->data;
+ alloc_next = verifier->isect_list;
+ verifier->isect_list = this;
+ }
+
+ bool equals (ref_intersection *other, _Jv_BytecodeVerifier *verifier)
+ {
+ if (! is_resolved && ! other->is_resolved
+ && _Jv_equalUtf8Consts (data.name, other->data.name))
+ return true;
+ if (! is_resolved)
+ resolve (verifier);
+ if (! other->is_resolved)
+ other->resolve (verifier);
+ return data.klass == other->data.klass;
+ }
+
+ // Merge THIS type into OTHER, returning the result. This will
+ // return OTHER if all the classes in THIS already appear in
+ // OTHER.
+ ref_intersection *merge (ref_intersection *other,
+ _Jv_BytecodeVerifier *verifier)
+ {
+ ref_intersection *tail = other;
+ for (ref_intersection *self = this; self != NULL; self = self->ref_next)
+ {
+ bool add = true;
+ for (ref_intersection *iter = other; iter != NULL;
+ iter = iter->ref_next)
+ {
+ if (iter->equals (self, verifier))
+ {
+ add = false;
+ break;
+ }
+ }
+
+ if (add)
+ tail = new ref_intersection (self, tail, verifier);
+ }
+ return tail;
+ }
+
+ void resolve (_Jv_BytecodeVerifier *verifier)
+ {
+ if (is_resolved)
+ return;
+
+ using namespace java::lang;
+ java::lang::ClassLoader *loader
+ = verifier->current_class->getClassLoaderInternal();
+ // We might see either kind of name. Sigh.
+ if (data.name->data[0] == 'L'
+ && data.name->data[data.name->length - 1] == ';')
+ data.klass = _Jv_FindClassFromSignature (data.name->data, loader);
+ else
+ data.klass = Class::forName (_Jv_NewStringUtf8Const (data.name),
+ false, loader);
+ is_resolved = true;
+ }
+
+ // See if an object of type OTHER can be assigned to an object of
+ // type *THIS. This might resolve classes in one chain or the
+ // other.
+ bool compatible (ref_intersection *other,
+ _Jv_BytecodeVerifier *verifier)
+ {
+ ref_intersection *self = this;
+
+ for (; self != NULL; self = self->ref_next)
+ {
+ ref_intersection *other_iter = other;
+
+ for (; other_iter != NULL; other_iter = other_iter->ref_next)
+ {
+ // Avoid resolving if possible.
+ if (! self->is_resolved
+ && ! other_iter->is_resolved
+ && _Jv_equalUtf8Consts (self->data.name,
+ other_iter->data.name))
+ continue;
+
+ if (! self->is_resolved)
+ self->resolve(verifier);
+ if (! other_iter->is_resolved)
+ other_iter->resolve(verifier);
+
+ if (! is_assignable_from_slow (self->data.klass,
+ other_iter->data.klass))
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ bool isarray ()
+ {
+ // assert (ref_next == NULL);
+ if (is_resolved)
+ return data.klass->isArray ();
+ else
+ return data.name->data[0] == '[';
+ }
+
+ bool isinterface (_Jv_BytecodeVerifier *verifier)
+ {
+ // assert (ref_next == NULL);
+ if (! is_resolved)
+ resolve (verifier);
+ return data.klass->isInterface ();
+ }
+
+ bool isabstract (_Jv_BytecodeVerifier *verifier)
+ {
+ // assert (ref_next == NULL);
+ if (! is_resolved)
+ resolve (verifier);
+ using namespace java::lang::reflect;
+ return Modifier::isAbstract (data.klass->getModifiers ());
+ }
+
+ jclass getclass (_Jv_BytecodeVerifier *verifier)
+ {
+ if (! is_resolved)
+ resolve (verifier);
+ return data.klass;
+ }
+
+ int count_dimensions ()
+ {
+ int ndims = 0;
+ if (is_resolved)
+ {
+ jclass k = data.klass;
+ while (k->isArray ())
+ {
+ k = k->getComponentType ();
+ ++ndims;
+ }
+ }
+ else
+ {
+ char *p = data.name->data;
+ while (*p++ == '[')
+ ++ndims;
+ }
+ return ndims;
+ }
+
+ void *operator new (size_t bytes)
+ {
+ return _Jv_Malloc (bytes);
+ }
+
+ void operator delete (void *mem)
+ {
+ _Jv_Free (mem);
+ }
};
// Return the type_val corresponding to a primitive signature
@@ -244,8 +458,21 @@ private:
// TARGET haven't been prepared.
static bool is_assignable_from_slow (jclass target, jclass source)
{
- // This will terminate when SOURCE==Object.
- while (true)
+ // First, strip arrays.
+ while (target->isArray ())
+ {
+ // If target is array, source must be as well.
+ if (! source->isArray ())
+ return false;
+ target = target->getComponentType ();
+ source = source->getComponentType ();
+ }
+
+ // Quick success.
+ if (target == &java::lang::Object::class$)
+ return true;
+
+ do
{
if (source == target)
return true;
@@ -253,49 +480,21 @@ private:
if (target->isPrimitive () || source->isPrimitive ())
return false;
- if (target->isArray ())
- {
- if (! source->isArray ())
- return false;
- target = target->getComponentType ();
- source = source->getComponentType ();
- }
- else if (target->isInterface ())
+ if (target->isInterface ())
{
for (int i = 0; i < source->interface_count; ++i)
{
// We use a recursive call because we also need to
// check superinterfaces.
if (is_assignable_from_slow (target, source->interfaces[i]))
- return true;
- }
- source = source->getSuperclass ();
- if (source == NULL)
- return false;
- }
- // We must do this check before we check to see if SOURCE is
- // an interface. This way we know that any interface is
- // assignable to an Object.
- else if (target == &java::lang::Object::class$)
- return true;
- else if (source->isInterface ())
- {
- for (int i = 0; i < target->interface_count; ++i)
- {
- // We use a recursive call because we also need to
- // check superinterfaces.
- if (is_assignable_from_slow (target->interfaces[i], source))
return true;
}
- target = target->getSuperclass ();
- if (target == NULL)
- return false;
}
- else if (source == &java::lang::Object::class$)
- return false;
- else
- source = source->getSuperclass ();
+ source = source->getSuperclass ();
}
+ while (source != NULL);
+
+ return false;
}
// This is used to keep track of which `jsr's correspond to a given
@@ -324,16 +523,12 @@ private:
// verifier.
struct type
{
- // The type.
+ // The type key.
type_val key;
- // Some associated data.
- union
- {
- // For a resolved reference type, this is a pointer to the class.
- jclass klass;
- // For other reference types, this it the name of the class.
- _Jv_Utf8Const *name;
- } data;
+
+ // For reference types, the representation of the type.
+ ref_intersection *klass;
+
// This is used when constructing a new object. It is the PC of the
// `new' instruction which created the object. We use the special
// value -2 to mean that this is uninitialized, and the special
@@ -348,7 +543,7 @@ private:
type ()
{
key = unsuitable_type;
- data.klass = NULL;
+ klass = NULL;
pc = UNINIT;
}
@@ -357,25 +552,26 @@ private:
type (type_val k)
{
key = k;
- data.klass = NULL;
- if (key == reference_type)
- data.klass = &java::lang::Object::class$;
+ // For reference_type, if KLASS==NULL then that means we are
+ // looking for a generic object of any kind, including an
+ // uninitialized reference.
+ klass = NULL;
pc = UNINIT;
}
// Make a new instance given a class.
- type (jclass klass)
+ type (jclass k, _Jv_BytecodeVerifier *verifier)
{
key = reference_type;
- data.klass = klass;
+ klass = new ref_intersection (k, verifier);
pc = UNINIT;
}
// Make a new instance given the name of a class.
- type (_Jv_Utf8Const *n)
+ type (_Jv_Utf8Const *n, _Jv_BytecodeVerifier *verifier)
{
- key = unresolved_reference_type;
- data.name = n;
+ key = reference_type;
+ klass = new ref_intersection (n, verifier);
pc = UNINIT;
}
@@ -383,7 +579,7 @@ private:
type (const type &t)
{
key = t.key;
- data = t.data;
+ klass = t.klass;
pc = t.pc;
}
@@ -402,7 +598,7 @@ private:
type& operator= (type_val k)
{
key = k;
- data.klass = NULL;
+ klass = NULL;
pc = UNINIT;
return *this;
}
@@ -410,7 +606,7 @@ private:
type& operator= (const type& t)
{
key = t.key;
- data = t.data;
+ klass = t.klass;
pc = t.pc;
return *this;
}
@@ -424,35 +620,11 @@ private:
return *this;
}
- // If *THIS is an unresolved reference type, resolve it.
- void resolve (_Jv_BytecodeVerifier *verifier)
- {
- if (key != unresolved_reference_type
- && key != uninitialized_unresolved_reference_type)
- return;
-
- using namespace java::lang;
- java::lang::ClassLoader *loader
- = verifier->current_class->getClassLoaderInternal();
- // We might see either kind of name. Sigh.
- if (data.name->data[0] == 'L'
- && data.name->data[data.name->length - 1] == ';')
- data.klass = _Jv_FindClassFromSignature (data.name->data, loader);
- else
- data.klass = Class::forName (_Jv_NewStringUtf8Const (data.name),
- false, loader);
- key = (key == unresolved_reference_type
- ? reference_type
- : uninitialized_reference_type);
- }
-
// Mark this type as the uninitialized result of `new'.
void set_uninitialized (int npc, _Jv_BytecodeVerifier *verifier)
{
if (key == reference_type)
key = uninitialized_reference_type;
- else if (key == unresolved_reference_type)
- key = uninitialized_unresolved_reference_type;
else
verifier->verify_fail ("internal error in type::uninitialized");
pc = npc;
@@ -461,13 +633,9 @@ private:
// Mark this type as now initialized.
void set_initialized (int npc)
{
- if (npc != UNINIT && pc == npc
- && (key == uninitialized_reference_type
- || key == uninitialized_unresolved_reference_type))
+ if (npc != UNINIT && pc == npc && key == uninitialized_reference_type)
{
- key = (key == uninitialized_reference_type
- ? reference_type
- : unresolved_reference_type);
+ key = reference_type;
pc = UNINIT;
}
}
@@ -488,14 +656,16 @@ private:
// The `null' type is convertible to any initialized reference
// type.
- if (key == null_type || k.key == null_type)
- return true;
+ if (key == null_type)
+ return k.key != uninitialized_reference_type;
+ if (k.key == null_type)
+ return key != uninitialized_reference_type;
- // Any reference type is convertible to Object. This is a special
- // case so we don't need to unnecessarily resolve a class.
- if (key == reference_type
- && data.klass == &java::lang::Object::class$)
+ // A special case for a generic reference.
+ if (klass == NULL)
return true;
+ if (k.klass == NULL)
+ verifier->verify_fail ("programmer error in type::compatible");
// An initialized type and an uninitialized type are not
// compatible.
@@ -511,16 +681,7 @@ private:
return false;
}
- // Two unresolved types are equal if their names are the same.
- if (! isresolved ()
- && ! k.isresolved ()
- && _Jv_equalUtf8Consts (data.name, k.data.name))
- return true;
-
- // We must resolve both types and check assignability.
- resolve (verifier);
- k.resolve (verifier);
- return is_assignable_from_slow (data.klass, k.data.klass);
+ return klass->compatible(k.klass, verifier);
}
bool isvoid () const
@@ -545,9 +706,7 @@ private:
// We treat null_type as not an array. This is ok based on the
// current uses of this method.
if (key == reference_type)
- return data.klass->isArray ();
- else if (key == unresolved_reference_type)
- return data.name->data[0] == '[';
+ return klass->isarray ();
return false;
}
@@ -558,33 +717,28 @@ private:
bool isinterface (_Jv_BytecodeVerifier *verifier)
{
- resolve (verifier);
if (key != reference_type)
return false;
- return data.klass->isInterface ();
+ return klass->isinterface (verifier);
}
bool isabstract (_Jv_BytecodeVerifier *verifier)
{
- resolve (verifier);
if (key != reference_type)
return false;
- using namespace java::lang::reflect;
- return Modifier::isAbstract (data.klass->getModifiers ());
+ return klass->isabstract (verifier);
}
// Return the element type of an array.
type element_type (_Jv_BytecodeVerifier *verifier)
{
- // FIXME: maybe should do string manipulation here.
- resolve (verifier);
if (key != reference_type)
verifier->verify_fail ("programmer error in type::element_type()", -1);
- jclass k = data.klass->getComponentType ();
+ jclass k = klass->getclass (verifier)->getComponentType ();
if (k->isPrimitive ())
return type (verifier->get_type_val_for_signature (k));
- return type (k);
+ return type (k, verifier);
}
// Return the array type corresponding to an initialized
@@ -592,16 +746,12 @@ private:
// types, but currently we don't need to.
type to_array (_Jv_BytecodeVerifier *verifier)
{
- // Resolving isn't ideal, because it might force us to load
- // another class, but it's easy. FIXME?
- if (key == unresolved_reference_type)
- resolve (verifier);
-
- if (key == reference_type)
- return type (_Jv_GetArrayClass (data.klass,
- data.klass->getClassLoaderInternal()));
- else
+ if (key != reference_type)
verifier->verify_fail ("internal error in type::to_array()");
+
+ jclass k = klass->getclass (verifier);
+ return type (_Jv_GetArrayClass (k, k->getClassLoaderInternal()),
+ verifier);
}
bool isreference () const
@@ -616,9 +766,7 @@ private:
bool isinitialized () const
{
- return (key == reference_type
- || key == null_type
- || key == unresolved_reference_type);
+ return key == reference_type || key == null_type;
}
bool isresolved () const
@@ -631,24 +779,10 @@ private:
void verify_dimensions (int ndims, _Jv_BytecodeVerifier *verifier)
{
// The way this is written, we don't need to check isarray().
- if (key == reference_type)
- {
- jclass k = data.klass;
- while (k->isArray () && ndims > 0)
- {
- k = k->getComponentType ();
- --ndims;
- }
- }
- else
- {
- // We know KEY == unresolved_reference_type.
- char *p = data.name->data;
- while (*p++ == '[' && ndims-- > 0)
- ;
- }
+ if (key != reference_type)
+ verifier->verify_fail ("internal error in verify_dimensions: not a reference type");
- if (ndims > 0)
+ if (klass->count_dimensions () < ndims)
verifier->verify_fail ("array type has fewer dimensions than required");
}
@@ -682,53 +816,12 @@ private:
verifier->verify_fail ("merging different uninitialized types");
}
- if (! isresolved ()
- && ! old_type.isresolved ()
- && _Jv_equalUtf8Consts (data.name, old_type.data.name))
+ ref_intersection *merged = old_type.klass->merge (klass,
+ verifier);
+ if (merged != klass)
{
- // Types are identical.
- }
- else
- {
- resolve (verifier);
- old_type.resolve (verifier);
-
- jclass k = data.klass;
- jclass oldk = old_type.data.klass;
-
- int arraycount = 0;
- while (k->isArray () && oldk->isArray ())
- {
- ++arraycount;
- k = k->getComponentType ();
- oldk = oldk->getComponentType ();
- }
-
- // Ordinarily this terminates when we hit Object...
- while (k != NULL)
- {
- if (is_assignable_from_slow (k, oldk))
- break;
- k = k->getSuperclass ();
- changed = true;
- }
- // ... but K could have been an interface, in which
- // case we'll end up here. We just convert this
- // into Object.
- if (k == NULL)
- k = &java::lang::Object::class$;
-
- if (changed)
- {
- while (arraycount > 0)
- {
- java::lang::ClassLoader *loader
- = verifier->current_class->getClassLoaderInternal();
- k = _Jv_GetArrayClass (k, loader);
- --arraycount;
- }
- data.klass = k;
- }
+ klass = merged;
+ changed = true;
}
}
}
@@ -782,9 +875,7 @@ private:
case unused_by_subroutine_type: c = '_'; break;
case reference_type: c = 'L'; break;
case null_type: c = '@'; break;
- case unresolved_reference_type: c = 'l'; break;
case uninitialized_reference_type: c = 'U'; break;
- case uninitialized_unresolved_reference_type: c = 'u'; break;
}
debug_print ("%c", c);
}
@@ -1624,9 +1715,7 @@ private:
case unused_by_subroutine_type:
case reference_type:
case null_type:
- case unresolved_reference_type:
case uninitialized_reference_type:
- case uninitialized_unresolved_reference_type:
default:
verify_fail ("unknown type in construct_primitive_array_type");
}
@@ -1997,9 +2086,9 @@ private:
check_pool_index (index);
_Jv_Constants *pool = &current_class->constants;
if (pool->tags[index] == JV_CONSTANT_ResolvedClass)
- return type (pool->data[index].clazz);
+ return type (pool->data[index].clazz, this);
else if (pool->tags[index] == JV_CONSTANT_Class)
- return type (pool->data[index].utf8);
+ return type (pool->data[index].utf8, this);
verify_fail ("expected class constant", start_PC);
}
@@ -2009,7 +2098,7 @@ private:
_Jv_Constants *pool = &current_class->constants;
if (pool->tags[index] == JV_CONSTANT_ResolvedString
|| pool->tags[index] == JV_CONSTANT_String)
- return type (&java::lang::String::class$);
+ return type (&java::lang::String::class$, this);
else if (pool->tags[index] == JV_CONSTANT_Integer)
return type (int_type);
else if (pool->tags[index] == JV_CONSTANT_Float)
@@ -2065,7 +2154,7 @@ private:
if (class_type)
*class_type = ct;
if (field_type->data[0] == '[' || field_type->data[0] == 'L')
- return type (field_type);
+ return type (field_type, this);
return get_type_val_for_signature (field_type->data[0]);
}
@@ -2099,7 +2188,7 @@ private:
++p;
++p;
_Jv_Utf8Const *name = make_utf8_const (start, p - start);
- return type (name);
+ return type (name, this);
}
// Casting to jchar here is ok since we are looking at an ASCII
@@ -2116,7 +2205,7 @@ private:
jclass k = construct_primitive_array_type (rt);
while (--arraycount > 0)
k = _Jv_GetArrayClass (k, NULL);
- return type (k);
+ return type (k, this);
}
void compute_argument_types (_Jv_Utf8Const *signature,
@@ -2160,7 +2249,7 @@ private:
using namespace java::lang::reflect;
if (! Modifier::isStatic (current_method->self->accflags))
{
- type kurr (current_class);
+ type kurr (current_class, this);
if (is_init)
{
kurr.set_uninitialized (type::SELF, this);
@@ -2287,7 +2376,7 @@ private:
{
if (PC >= exception[i].start_pc.i && PC < exception[i].end_pc.i)
{
- type handler (&java::lang::Throwable::class$);
+ type handler (&java::lang::Throwable::class$, this);
if (exception[i].handler_type.i != 0)
handler = check_class_constant (exception[i].handler_type.i);
push_exception_jump (handler, exception[i].handler_pc.i);
@@ -2959,33 +3048,13 @@ private:
{
// In this case the PC doesn't matter.
t.set_uninitialized (type::UNINIT, this);
+ // FIXME: check to make sure that the <init>
+ // call is to the right class.
+ // It must either be super or an exact class
+ // match.
}
type raw = pop_raw ();
- bool ok = false;
- if (! is_init && ! raw.isinitialized ())
- {
- // This is a failure.
- }
- else if (is_init && raw.isnull ())
- {
- // Another failure.
- }
- else if (t.compatible (raw, this))
- {
- ok = true;
- }
- else if (opcode == op_invokeinterface)
- {
- // This is a hack. We might have merged two
- // items and gotten `Object'. This can happen
- // because we don't keep track of where merges
- // come from. This is safe as long as the
- // interpreter checks interfaces at runtime.
- type obj (&java::lang::Object::class$);
- ok = raw.compatible (obj, this);
- }
-
- if (! ok)
+ if (! t.compatible (raw, this))
verify_fail ("incompatible type on stack");
if (is_init)
@@ -3017,7 +3086,8 @@ private:
if (atype < boolean_type || atype > long_type)
verify_fail ("type not primitive", start_PC);
pop_type (int_type);
- push_type (construct_primitive_array_type (type_val (atype)));
+ type t (construct_primitive_array_type (type_val (atype)), this);
+ push_type (t);
}
break;
case op_anewarray:
@@ -3033,7 +3103,7 @@ private:
}
break;
case op_athrow:
- pop_type (type (&java::lang::Throwable::class$));
+ pop_type (type (&java::lang::Throwable::class$, this));
invalidate_pc ();
break;
case op_checkcast:
@@ -3178,6 +3248,7 @@ public:
flags = NULL;
jsr_ptrs = NULL;
utf8_list = NULL;
+ isect_list = NULL;
entry_points = NULL;
}
@@ -3220,6 +3291,13 @@ public:
_Jv_Free (entry_points);
entry_points = next;
}
+
+ while (isect_list != NULL)
+ {
+ ref_intersection *next = isect_list->alloc_next;
+ delete isect_list;
+ isect_list = next;
+ }
}
};
diff --git a/libjava/win32-threads.cc b/libjava/win32-threads.cc
index 3a3999a8f2d..1f3d0c57b22 100644
--- a/libjava/win32-threads.cc
+++ b/libjava/win32-threads.cc
@@ -81,6 +81,16 @@ ensure_condvar_initialized(_Jv_ConditionVariable_t *cv)
}
}
+inline void
+ensure_interrupt_event_initialized(HANDLE& rhEvent)
+{
+ if (!rhEvent)
+ {
+ rhEvent = CreateEvent (NULL, 0, 0, NULL);
+ if (!rhEvent) JvFail("CreateEvent() failed");
+ }
+}
+
// Reimplementation of the general algorithm described at
// http://www.cs.wustl.edu/~schmidt/win32-cv-1.html (isomorphic to
// 3.2, not a cut-and-paste).
@@ -91,6 +101,21 @@ _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint na
if (mu->owner != GetCurrentThreadId ( ))
return _JV_NOT_OWNER;
+ _Jv_Thread_t *current = _Jv_ThreadCurrentData ();
+ java::lang::Thread *current_obj = _Jv_ThreadCurrent ();
+
+ // Now that we hold the interrupt mutex, check if this thread has been
+ // interrupted already.
+ EnterCriticalSection (&current->interrupt_mutex);
+ ensure_interrupt_event_initialized (current->interrupt_event);
+ jboolean interrupted = current_obj->interrupt_flag;
+ LeaveCriticalSection (&current->interrupt_mutex);
+
+ if (interrupted)
+ {
+ return _JV_INTERRUPTED;
+ }
+
EnterCriticalSection (&cv->count_mutex);
ensure_condvar_initialized (cv);
cv->blocked_count++;
@@ -103,7 +128,31 @@ _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint na
_Jv_MutexUnlock (mu);
- DWORD rval = WaitForMultipleObjects (2, &(cv->ev[0]), 0, time);
+ // Set up our array of three events:
+ // - the auto-reset event (for notify())
+ // - the manual-reset event (for notifyAll())
+ // - the interrupt event (for interrupt())
+ // We wait for any one of these to be signaled.
+ HANDLE arh[3];
+ arh[0] = cv->ev[0];
+ arh[1] = cv->ev[1];
+ arh[2] = current->interrupt_event;
+ DWORD rval = WaitForMultipleObjects (3, arh, 0, time);
+
+ EnterCriticalSection (&current->interrupt_mutex);
+
+ // If we were unblocked by the third event (our thread's interrupt
+ // event), set the thread's interrupt flag. I think this sanity
+ // check guards against someone resetting our interrupt flag
+ // in the time between when interrupt_mutex is released in
+ // _Jv_ThreadInterrupt and the interval of time between the
+ // WaitForMultipleObjects call we just made and our acquisition
+ // of interrupt_mutex.
+ if (rval == (WAIT_OBJECT_0 + 2))
+ current_obj->interrupt_flag = true;
+
+ interrupted = current_obj->interrupt_flag;
+ LeaveCriticalSection (&current->interrupt_mutex);
EnterCriticalSection(&cv->count_mutex);
cv->blocked_count--;
@@ -116,8 +165,8 @@ _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint na
ResetEvent (cv->ev[1]);
_Jv_MutexLock (mu);
-
- return 0;
+
+ return interrupted ? _JV_INTERRUPTED : 0;
}
void
@@ -197,6 +246,8 @@ _Jv_ThreadInitData (java::lang::Thread* obj)
_Jv_Thread_t *data = (_Jv_Thread_t*)_Jv_Malloc(sizeof(_Jv_Thread_t));
data->flags = 0;
data->thread_obj = obj;
+ data->interrupt_event = 0;
+ InitializeCriticalSection (&data->interrupt_mutex);
return data;
}
@@ -204,6 +255,9 @@ _Jv_ThreadInitData (java::lang::Thread* obj)
void
_Jv_ThreadDestroyData (_Jv_Thread_t *data)
{
+ DeleteCriticalSection (&data->interrupt_mutex);
+ if (data->interrupt_event)
+ CloseHandle(data->interrupt_event);
_Jv_Free(data);
}
@@ -308,11 +362,8 @@ _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data, _Jv_ThreadStart
else
data->flags |= FLAG_DAEMON;
- HANDLE h = GC_CreateThread(NULL, 0, really_start, info, 0, &id);
+ GC_CreateThread(NULL, 0, really_start, info, 0, &id);
_Jv_ThreadSetPriority(data, thread->getPriority());
-
- //if (!h)
- //JvThrow ();
}
void
@@ -326,9 +377,27 @@ _Jv_ThreadWait (void)
}
}
+//
+// Interrupt support
+//
+
+HANDLE
+_Jv_Win32GetInterruptEvent (void)
+{
+ _Jv_Thread_t *current = _Jv_ThreadCurrentData ();
+ EnterCriticalSection (&current->interrupt_mutex);
+ ensure_interrupt_event_initialized (current->interrupt_event);
+ HANDLE hEvent = current->interrupt_event;
+ LeaveCriticalSection (&current->interrupt_mutex);
+ return hEvent;
+}
+
void
_Jv_ThreadInterrupt (_Jv_Thread_t *data)
{
- MessageBox(NULL, "Unimplemented", "win32-threads.cc:_Jv_ThreadInterrupt", MB_OK);
- // FIXME:
+ EnterCriticalSection (&data->interrupt_mutex);
+ ensure_interrupt_event_initialized (data->interrupt_event);
+ data->thread_obj->interrupt_flag = true;
+ SetEvent (data->interrupt_event);
+ LeaveCriticalSection (&data->interrupt_mutex);
}
diff --git a/libjava/win32.cc b/libjava/win32.cc
index 6fc2de08760..abe768ae5bd 100644
--- a/libjava/win32.cc
+++ b/libjava/win32.cc
@@ -10,11 +10,13 @@ details. */
#include <config.h>
#include <platform.h>
-#include <jvm.h>
#include <sys/timeb.h>
#include <stdlib.h>
#include <java/lang/ArithmeticException.h>
+#include <java/lang/UnsupportedOperationException.h>
+#include <java/io/IOException.h>
+#include <java/net/SocketException.h>
#include <java/util/Properties.h>
static LONG CALLBACK
@@ -37,6 +39,102 @@ const char *_Jv_ThisExecutable (void)
return exec_name;
}
+// Helper classes and methods implementation
+
+// class WSAEventWrapper
+WSAEventWrapper::WSAEventWrapper (int fd, DWORD dwSelFlags):
+ m_hEvent(0),
+ m_fd(fd),
+ m_dwSelFlags(dwSelFlags)
+{
+ m_hEvent = WSACreateEvent ();
+ if (dwSelFlags)
+ WSAEventSelect(fd, m_hEvent, dwSelFlags);
+}
+
+WSAEventWrapper::~WSAEventWrapper ()
+{
+ if (m_dwSelFlags)
+ {
+ WSAEventSelect(m_fd, m_hEvent, 0);
+ if (m_dwSelFlags & (FD_ACCEPT | FD_CONNECT))
+ {
+ // Set the socket back to non-blocking mode.
+ // Ignore any error since we're in a destructor.
+ unsigned long lSockOpt = 0L;
+ // blocking mode
+ ::ioctlsocket (m_fd, FIONBIO, &lSockOpt);
+ }
+ }
+ WSACloseEvent (m_hEvent);
+}
+
+// Error string text.
+jstring
+_Jv_WinStrError (LPCTSTR lpszPrologue, int nErrorCode)
+{
+ LPTSTR lpMsgBuf = 0;
+
+ DWORD dwFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS;
+
+ FormatMessage (dwFlags,
+ NULL,
+ (DWORD) nErrorCode,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL);
+
+ jstring ret;
+ if (lpszPrologue)
+ {
+ LPTSTR lpszTemp =
+ (LPTSTR) _Jv_Malloc (strlen (lpszPrologue) +
+ strlen (lpMsgBuf) + 3);
+ strcpy (lpszTemp, lpszPrologue);
+ strcat (lpszTemp, ": ");
+ strcat (lpszTemp, lpMsgBuf);
+ ret = JvNewStringLatin1 (lpszTemp);
+ }
+ else
+ {
+ ret = JvNewStringLatin1 (lpMsgBuf);
+ }
+
+ LocalFree(lpMsgBuf);
+ return ret;
+}
+
+jstring
+_Jv_WinStrError (int nErrorCode)
+{
+ return _Jv_WinStrError (0, nErrorCode);
+}
+
+void _Jv_ThrowIOException (DWORD dwErrorCode)
+{
+ throw new java::io::IOException (_Jv_WinStrError (dwErrorCode));
+}
+
+void _Jv_ThrowIOException()
+{
+ DWORD dwErrorCode = WSAGetLastError ();
+ _Jv_ThrowIOException (dwErrorCode);
+}
+
+void _Jv_ThrowSocketException (DWORD dwErrorCode)
+{
+ throw new java::net::SocketException (_Jv_WinStrError (dwErrorCode));
+}
+
+void _Jv_ThrowSocketException()
+{
+ DWORD dwErrorCode = WSAGetLastError ();
+ _Jv_ThrowSocketException (dwErrorCode);
+}
+
// Platform-specific VM initialization.
void
_Jv_platform_initialize (void)
@@ -45,11 +143,11 @@ _Jv_platform_initialize (void)
WSADATA data;
if (WSAStartup (MAKEWORD (1, 1), &data))
MessageBox (NULL, "Error initialising winsock library.", "Error",
- MB_OK | MB_ICONEXCLAMATION);
-
+ MB_OK | MB_ICONEXCLAMATION);
+
// Install exception handler
SetUnhandledExceptionFilter (win32_exception_handler);
-
+
// Initialize our executable name
GetModuleFileName(NULL, exec_name, sizeof(exec_name));
}
@@ -96,14 +194,14 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
if (buffer != NULL)
{
if (GetCurrentDirectory (buflen, buffer))
- SET ("user.dir", buffer);
+ SET ("user.dir", buffer);
if (GetTempPath (buflen, buffer))
- SET ("java.io.tmpdir", buffer);
+ SET ("java.io.tmpdir", buffer);
_Jv_Free (buffer);
}
-
+
// Use GetUserName to set 'user.name'.
buflen = 257; // UNLEN + 1
buffer = (char *) _Jv_MallocUnchecked (buflen);
@@ -114,8 +212,8 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
_Jv_Free (buffer);
}
- // According to the api documentation for 'GetWindowsDirectory()', the
- // environmental variable HOMEPATH always specifies the user's home
+ // 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.
@@ -130,7 +228,7 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
if (winHome != NULL)
{
if (GetWindowsDirectory (winHome, MAX_PATH))
- SET ("user.home", winHome);
+ SET ("user.home", winHome);
_Jv_Free (winHome);
}
}
@@ -148,7 +246,7 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
if (buffer != NULL)
{
sprintf (buffer, "%d.%d", (int) osvi.dwMajorVersion,
- (int) osvi.dwMinorVersion);
+ (int) osvi.dwMinorVersion);
SET ("os.version", buffer);
_Jv_Free (buffer);
}
@@ -163,7 +261,7 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
SET ("os.name", "Windows Me");
else
- SET ("os.name", "Windows ??");
+ SET ("os.name", "Windows ??");
break;
case VER_PLATFORM_WIN32_NT:
@@ -186,23 +284,24 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
// Set the OS architecture.
SYSTEM_INFO si;
GetSystemInfo (&si);
- switch (si.dwProcessorType)
+ switch (si.wProcessorArchitecture)
{
- case PROCESSOR_INTEL_386:
- SET ("os.arch", "i386");
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ SET ("os.arch", "x86");
break;
- case PROCESSOR_INTEL_486:
- SET ("os.arch", "i486");
+ case PROCESSOR_ARCHITECTURE_MIPS:
+ SET ("os.arch", "mips");
break;
- case PROCESSOR_INTEL_PENTIUM:
- SET ("os.arch", "i586");
+ case PROCESSOR_ARCHITECTURE_ALPHA:
+ SET ("os.arch", "alpha");
break;
- case PROCESSOR_MIPS_R4000:
- SET ("os.arch", "MIPS4000");
+ case PROCESSOR_ARCHITECTURE_PPC:
+ SET ("os.arch", "ppc");
break;
- case PROCESSOR_ALPHA_21064:
- SET ("os.arch", "ALPHA");
+ case PROCESSOR_ARCHITECTURE_IA64:
+ SET ("os.arch", "ia64");
break;
+ case PROCESSOR_ARCHITECTURE_UNKNOWN:
default:
SET ("os.arch", "unknown");
break;
@@ -230,3 +329,16 @@ backtrace (void **__array, int __size)
}
return i;
}
+
+int
+_Jv_select (int n, fd_set *readfds, fd_set *writefds,
+ fd_set *exceptfds, struct timeval *timeout)
+{
+ 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;
+}
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 90ade6b5b78..b0d08efb156 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,22 @@
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2003-08-27 Alexander Malmberg <alexander@malmberg.org>
+
+ * Makefile.in, aclocal.m4: Update to $(libdir)/gcc/ instead of
+ (libdir)/gcc-lib/ when installing.
+ * configure: Regenerate.
+
+Thu Jul 10 10:27:43 2003 Nicola Pero <n.pero@mi.flashnet.it>
+
+ libobjc/9969
+ * sendmsg.c (get_imp): Fixed rare threading problem.
+ (__objc_responds_to): Similar fixes.
+ (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,
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
index 1d3f717bba9..aea1e2ce32b 100644
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -43,7 +43,7 @@ glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
top_builddir = .
libdir = $(exec_prefix)/lib
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
# Multilib support variables.
MULTISRCTOP =
diff --git a/libobjc/aclocal.m4 b/libobjc/aclocal.m4
index 83707ce099e..458b157cf02 100644
--- a/libobjc/aclocal.m4
+++ b/libobjc/aclocal.m4
@@ -196,7 +196,7 @@ if test $version_specific_libs = yes; then
# and header files if --enable-version-specific-runtime-libs option
# is selected.
changequote(,)dnl
- glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ glibcpp_toolexecdir='$(libdir)/gcc/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
changequote([,])dnl
fi
diff --git a/libobjc/configure b/libobjc/configure
index be0dde9d285..f2f013ad371 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -1255,7 +1255,7 @@ if test $version_specific_libs = yes; then
# Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option
# is selected.
- glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ glibcpp_toolexecdir='$(libdir)/gcc/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
fi
@@ -2062,7 +2062,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c
index 71e89667134..0214e77afcd 100644
--- a/libobjc/sendmsg.c
+++ b/libobjc/sendmsg.c
@@ -119,6 +119,14 @@ __inline__
IMP
get_imp (Class class, SEL sel)
{
+ /* In a vanilla implementation we would first check if the dispatch
+ table is installed. Here instead, to get more speed in the
+ standard case (that the dispatch table is installed) we first try
+ to get the imp using brute force. Only if that fails, we do what
+ we should have been doing from the very beginning, that is, check
+ if the dispatch table needs to be installed, install it if it's
+ not installed, and retrieve the imp from the table if it's
+ installed. */
void *res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
if (res == 0)
{
@@ -127,7 +135,16 @@ get_imp (Class class, SEL sel)
{
/* The dispatch table needs to be installed. */
objc_mutex_lock (__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (class);
+
+ /* Double-checked locking pattern: Check
+ __objc_uninstalled_dtable again in case another thread
+ installed the dtable while we were waiting for the lock
+ to be released. */
+ if (class->dtable == __objc_uninstalled_dtable)
+ {
+ __objc_install_dispatch_table_for_class (class);
+ }
+
objc_mutex_unlock (__objc_runtime_mutex);
/* Call ourselves with the installed dispatch table
and get the real method */
@@ -135,10 +152,22 @@ get_imp (Class class, SEL sel)
}
else
{
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Return the forwarding implementation. */
- res = __objc_get_forward_imp (sel);
+ /* The dispatch table has been installed. */
+
+ /* Get the method from the dispatch table (we try to get it
+ again in case another thread has installed the dtable just
+ after we invoked sarray_get_safe, but before we checked
+ class->dtable == __objc_uninstalled_dtable).
+ */
+ res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
+ if (res == 0)
+ {
+ /* The dispatch table has been installed, and the method
+ is not in the dispatch table. So the method just
+ doesn't exist for the class. Return the forwarding
+ implementation. */
+ res = __objc_get_forward_imp (sel);
+ }
}
}
return res;
@@ -157,7 +186,10 @@ __objc_responds_to (id object, SEL sel)
if (object->class_pointer->dtable == __objc_uninstalled_dtable)
{
objc_mutex_lock (__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (object->class_pointer);
+ if (object->class_pointer->dtable == __objc_uninstalled_dtable)
+ {
+ __objc_install_dispatch_table_for_class (object->class_pointer);
+ }
objc_mutex_unlock (__objc_runtime_mutex);
}
@@ -192,10 +224,19 @@ objc_msg_lookup (id receiver, SEL op)
}
else
{
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Attempt to forward the method. */
- result = __objc_get_forward_imp (op);
+ /* The dispatch table has been installed. Check again
+ if the method exists (just in case the dispatch table
+ has been installed by another thread after we did the
+ previous check that the method exists).
+ */
+ result = sarray_get_safe (receiver->class_pointer->dtable,
+ (sidx)op->sel_id);
+ if (result == 0)
+ {
+ /* If the method still just doesn't exist for the
+ class, attempt to forward the method. */
+ result = __objc_get_forward_imp (op);
+ }
}
}
return result;
@@ -239,13 +280,16 @@ __objc_init_dispatch_tables ()
static void
__objc_init_install_dtable (id receiver, SEL op __attribute__ ((__unused__)))
{
+ objc_mutex_lock (__objc_runtime_mutex);
+
/* This may happen, if the programmer has taken the address of a
method before the dtable was initialized... too bad for him! */
if (receiver->class_pointer->dtable != __objc_uninstalled_dtable)
- return;
-
- objc_mutex_lock (__objc_runtime_mutex);
-
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return;
+ }
+
if (CLS_ISCLASS (receiver->class_pointer))
{
/* receiver is an ordinary object */
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 190d2d78b4a..9caf65ac7e1 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,1034 @@
+2003-09-22 Petur Runolfsson <peturr02@ru.is>
+
+ * include/bits/istream.tcc (basic_istream::read,
+ basic_istream::readsome, basic_istream::putback,
+ basic_istream::unget, operator>>(basic_istream, CharT)):
+ Avoid redundant setstate(failbit) calls when sentry::operator bool()
+ returns false.
+
+2003-09-22 Carlo Wood <carlo@alinoe.com>
+
+ PR libstdc++/12365
+ * include/bits/demangle.h (qualifier(int, cv_qualifier_nt,
+ char const*, int, int)): Remove unused identifier
+ cv_qualifier for overloaded constructor.
+
+2003-09-18 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/11504
+ * acinclude.m4 (GLIBCXX_EXPORT_FLAGS): Add -Wcast-qual to
+ WARN_FLAGS, remove -Wno-format.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2003-09-18 Petur Runolfsson <peturr02@ru.is>
+
+ * config/io/basic_file_stdio.cc (sys_getc, sys_ungetc): Delete.
+ * config/io/basic_file_stdio.h: Same.
+ * include/std/std_fstream.h (__ctype_type): Delete.
+ * include/std/std_streambuf.h (__ctype_type, __state_type): Delete.
+
+2003-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/12239
+ * configure.host (abi_baseline_pair): Error out on solaris2
+ configurations without a minor version number.
+
+2003-09-13 Phil Edwards <phil@codesourcery.com>
+
+ * docs/doxygen/run_doxygen: Clear GENERATE_TAGFILE entirely
+ if man pages are on.
+ * docs/doxygen/user.cfg.in: And here.
+
+2003-09-10 Daniel Jacobowitz <drow@mvista.com>
+ Andreas Jaeger <aj@suse.de>
+
+ PR libstdc++/12189
+ * acinclude.m4 (GLIBCXX_CONFIGURE_TESTSUITE): Don't build
+ abi_check if cross compiling.
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+
+2003-09-10 Jeffrey D. Oldham <oldham@codesourcery.com>
+
+ * libsupc++/vec.cc (__cxa_vec_new2): If the allocator returns
+ NULL, return NULL. This reflects a C++ ABI change 2003 Sep 05.
+ (__cxa_vec_new3): Likewise.
+
+2003-09-10 Petur Runolfsson <peturr02@ru.is>
+
+ * include/bits/fstream.tcc (basic_filebuf::seekoff):
+ Use codecvt::length to handle variable-width stateless encodings
+ correctly.
+ * testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc: New test.
+ * testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc: New test.
+
+2003-09-10 Alan Modra <amodra@bigpond.net.au>
+
+ * config/io/basic_file_stdio.cc (_M_open_mode): Assign __p_mode
+ rather than or'ing.
+
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2003-09-09 David Edelsohn <edelsohn@gnu.org>
+
+ * src/ios.cc (ios_base::Init::Init): Remove unnecessary
+ qualifier from _S_synced_with_stdio.
+
+2003-09-09 Bernardo Innocenti <bernie@develer.com>
+
+ * include/c_std/std_cstdlib.h: Avoid using missing C library symbols.
+
+2003-09-04 Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/9028
+ * include/bits/fstream.tcc
+ (basic_filebuf::_M_destroy_internal_buffer): Destroy _M_ext_buf.
+ (basic_filebuf::basic_filebuf): Initialize _M_ext_buf,
+ _M_ext_buf_size, _M_ext_next and _M_ext_end.
+ (basic_filebuf::underflow): Handle variable-width stateless
+ encodings (codecvt::encoding() == 0), including UTF-8.
+ * include/std/std_fstream.h (basic_filebuf):
+ Declare _M_ext_buf, _M_ext_buf_size, _M_ext_next, _M_ext_end.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc: New test.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc: New test.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc: New test.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc: New test.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc: New test.
+ * testsuite/27_io/objects/wchar_t/12.cc: New test.
+ * testsuite/27_io/objects/wchar_t/13.cc: New test.
+
+2003-09-04 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/faq/index.html: Note that a namespace alias can't be
+ used when specialising templates in extension namespace.
+ * docs/html/faq/index.txt: Regenerate.
+
+2003-09-03 Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/12048
+ * include/ext/stdio_sync_filebuf.h
+ (stdio_sync_filebuf::_M_unget_buf): Declare it.
+ (stdio_sync_filebuf::stdio_sync_filebuf): Initialize _M_unget_buf.
+ (stdio_sync_filebuf::uflow): Store the returned character in
+ _M_unget_buf.
+ (stdio_sync_filebuf::pbackfail): If argument is eof(), pass
+ _M_unget_buf to syncungetc(). Set _M_unget_buf to eof().
+ (stdio_sync_filebuf<char>::xsgetn): Store last read character in
+ _M_unget_buf, if any, else eof().
+ (stdio_sync_filebuf<wchar_t>::xsgetn: Store last read character in
+ _M_unget_buf, if any, else eof().
+ * testsuite/27_io/objects/char/12048.cc: Rename to...
+ * testsuite/27_io/objects/char/12048-1.cc: ...this.
+ * testsuite/27_io/objects/char/12048-2.cc: New test.
+ * testsuite/27_io/objects/char/12048-3.cc: New test.
+ * testsuite/27_io/objects/char/12048-4.cc: New test.
+ * testsuite/27_io/objects/char/12048-5.cc: New test. XFAIL.
+ * testsuite/27_io/objects/wchar_t/12048-1.cc: New test.
+ * testsuite/27_io/objects/wchar_t/12048-2.cc: New test.
+ * testsuite/27_io/objects/wchar_t/12048-3.cc: New test.
+ * testsuite/27_io/objects/wchar_t/12048-4.cc: New test.
+ * testsuite/27_io/objects/wchar_t/12048-5.cc: New test. XFAIL.
+ * testsuite/ext/stdio_sync_filebuf_char.cc
+ (test02, test03, test04, test05): New tests.
+ * testsuite/ext/stdio_sync_filebuf_wchar_t.cc
+ (test02, test03, test04, test05): New tests.
+
+2003-09-03 Petur Runolfsson <peturr02@ru.is>
+
+ * docs/html/27_io/howto.html: setbuf(0, 0) has no effect on
+ stringbuf or strstreambuf. Fix typos.
+
+2003-09-02 Phil Edwards <phil@codesourcery.com>
+
+ * acinclude.m4 (GLIBCXX_ENABLE_HOSTED): #define _GLIBCXX_HOSTED
+ appropriately.
+ * config.h.in: Add _GLIBCXX_HOSTED.
+ * libsupc++/eh_term_handler.cc: Test it here; initialize
+ __terminate_handler to std::abort if freestanding.
+ * aclocal.m4, configure: Regenerated.
+ * docs/html/configopts.html: Document --disable-hosted-libstdcxx.
+
+2003-08-29 Nathan Myers <ncm@cantrip.org>
+
+ PR libstdc++/11990
+ * include/bits/locale_facets.tcc (__pad): delete dead code.
+
+2003-08-28 Alan Modra <amodra@bigpond.net.au>
+
+ * configure.ac: Test $with_cross_host against $build_alias, not $build.
+ * configure: Regenerate.
+
+2003-08-27 Petur Runolfsson <peturr02@ru.is>
+
+ * testsuite/27_io/objects/wchar_t/10.cc: Move wcout stuff...
+ * testsuite/27_io/objects/wchar_t/11.cc: ...here. New file.
+
+2003-08-27 Phil Edwards <pme@gcc.gnu.org>
+
+ * Makefile.am: Remove trailing whitespace. Remove needless
+ "foo = @foo@" assignments. Replace direct uses of @foo@ with $(foo).
+ * include/Makefile.am: Likewise.
+ * libmath/Makefile.am: Likewise.
+ * libsupc++/Makefile.am: Likewise.
+ * po/Makefile.am: Likewise.
+ * src/Makefile.am: Likewise.
+ * testsuite/Makefile.am: Likewise.
+
+ * Makefile.in, include/Makefile.in, libmath/Makefile.in,
+ libsupc++/Makefile.in, po/Makefile.in, src/Makefile.in,
+ testsuite/Makefile.in: Regenerated.
+
+2003-08-27 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4 (GLIBCXX_EXPORT_INCLUDES): Change quoting of
+ includedir.
+ * aclocal.m4, configure: Regenerate.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * acinclude.m4: Include no-executables.m4.
+ * configure.ac: Uncomment GCC_NO_EXECUTABLES.
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * acinclude.m4: Don't call AC_ISC_POSIX.
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+
+2003-08-27 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4 (GLIBCXX_CONDITIONAL): New macro. Wrap
+ AM_CONDITIONAL. Replace all calls to AM_CONDITIONAL with this one.
+ (GLIBCXX_ENABLE_HOSTED): New macro, sets new variable is_hosted,
+ used elsewhere in this file.
+ (GLIBCXX_EVALUATE_CONDITIONALS): New macro...
+ * configure.ac: ...called here to expand all conditionals.
+ * Makefile.am: Conditionalize SUBDIRS on GLIBCXX_HOSTED.
+ * include/Makefile.am: Remove redundant gxx_include_dir assignment.
+ (install-freestanding-headers): New target, a subset of
+ install-headers. Conditionalize install-data-local on GLIBCXX_HOSTED.
+
+ * aclocal.m4, configure, Makefile.in, include/Makefile.in,
+ libmath/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
+ src/Makefile.in, testsuite/Makefile.in: Regenerated.
+
+2003-08-26 Phil Edwards <pme@gcc.gnu.org>
+
+ * docs/doxygen/run_doxygen: Shell fixes. Remove hardcoded local
+ pathnames from generated tag file.
+
+2003-08-26 Phil Edwards <pme@gcc.gnu.org>
+
+ * Makefile.am: Add comment.
+ * acinclude.m4 (GLIBCXX_CONFIGURE): Set new glibcxx_SUBDIRS and
+ SUBDIRS variables.
+ * configure.ac: Use them both here, instead of hardcoded lists.
+
+ * fragment.am: Add STAMP varaible.
+ * include/Makefile.am: Cosmetic whitespace cleanup. Use $(LN_S)
+ instead of @LN_S@.
+ (stamp-*): Move file creation rule outside of 'if' branches to
+ ensure the stamp-* files are actually updated. Use $(STAMP).
+ * src/Makefile.am: Remove now-nonexistant variable.
+ * libsupc++/Makefile.am: Likewise. Snap the assignment chain
+ for -prefer-pic.
+ * po/Makefile.am: Include same fragment as all the others.
+
+ * aclocal.m4, configure, Makefile.in, include/Makefile.in,
+ libsupc++/Makefile.in, po/Makefile.in, src/Makefile.in: Regenerated.
+
+2003-08-26 Loren J. Rittle <ljrittle@acm.org>
+
+ * testsuite/data/cin_unget-1.txt: New.
+ * testsuite/27_io/objects/char/12048.cc: New.
+
+2003-08-25 Zack Weinberg <zack@codesourcery.com>
+
+ * config/os/hpux/os_defines.h: Unconditionally define
+ _GLIBCXX_GTHREAD_USE_WEAK to 0.
+
+2003-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ * crossconfig.m4 (*-darwin*): Add a large and boring stanza for
+ crosses to Darwin targets.
+ * configure: Regenerate.
+
+2003-08-19 Petur Runolfsson <peturr02@ru.is>
+
+ * include/ext/ropeimpl.h: #include <ostream> instead of <iostream>
+
+2003-08-17 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.ac: GCC_NO_EXECUTABLES was supposed to be commented
+ in the patch from 3 minutes ago. Boy, is my face red.
+ * configure: At least I remembered to regenerate this.
+
+2003-08-17 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4 (GLIBCXX_EXPORT_INCLUDES): Remove LIBMATH_INCLUDES
+ and LIBSUPCXX_INCLUDES. Re-purpose TOPLEVEL_INCLUDES to refer to
+ things from the top level.
+ * configure.ac (GLIBCXX_IS_NATIVE): Determine earlier and re-order.
+ Comment out the conditionals for CANADIAN and GLIBCXX_BUILD_LIBMATH
+ (currently unused). Strip the fake-VPATH shell fragment from
+ automake-generated rules, if present.
+ * linkage.m4: Add comment.
+
+ * fragment.am: New file, containing factored-out common settings.
+ (AM_CPPFLAGS): Absorb the deprecated INCLUDES variable contents.
+ * Makefile.am: Include fragment.am. Remove common variables.
+ * include/Makefile.am: Likewise.
+ * libmath/Makefile.am: Likewise.
+ * libsupc++/Makefile.am: Likewise.
+ * po/Makefile.am: Likewise. Print rules during check.
+ * src/Makefile.am: Likewise.
+ * testsuite/Makefile.am: Likewise.
+
+ * aclocal.m4, configure, Makefile.in, include/Makefile.in,
+ libmath/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
+ src/Makefile.in, testsuite/Makefile.in: Regenerate.
+
+2003-08-11 John Levon <levon@movementarian.org>
+
+ * docs/html/ext/howto/guide.html (GLIBCXX_FORCE_NEW): Update
+ remaining places for the name change from GLIBCPP_FORCE_NEW
+ to GLIBCXX_FORCE_NEW
+
+2003-08-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/basic_ios.h: Remove *_iter typedefs, change num*
+ typedefs to num_*.
+ * include/bits/basic_ios.tcc: Same.
+ * include/bits/istream.tcc: Same.
+ * include/bits/locale_facets.h: Same.
+ * include/bits/ostream.tcc: Same.
+ * include/std/std_istream.h: Same.
+ * include/std/std_ostream.h: Same.
+ * testsuite/26_numerics/complex_inserters_extractors.cc: Fix.
+
+ * include/ext/rope: Remove build warning.
+
+2003-08-11 Andreas Jaeger <aj@suse.de>
+
+ * include/Makefile.am (stamp-c_base): Add dependency on stamp-bits
+ to make SMP-safe.
+ * include/Makefile.in: Regenerated.
+
+2003-08-11 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4 (GLIBCXX_CONFIGURE): Unprecious CC and CFLAGS
+ when calling AC_PROG_CC.
+ * aclocal.m4, configure: Regenerate.
+
+2003-08-11 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4: Properly quote variable which will be expanded
+ inside makefiles. Use CXX instead of CC to extract compiler info.
+ * configure.ac (AC_INIT): Use the new 4-arg form to finally get the
+ correct form in PACKAGE.
+ * aclocal.m4, configure: Regenerate.
+
+2003-08-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/Makefile.am (check-abi): Change libstdc++-v3 to libstdc++.
+ (check-abi-verbose): Same.
+ * testsuite/testsuite_performance.h (report_performance): Same.
+
+2003-08-08 Loren J. Rittle <ljrittle@acm.org>
+
+ * testsuite/testsuite_performance.h (__FreeBSD__): Add fake mallinfo.
+
+2003-08-07 Doug Gregor <dgregor@apple.com>
+
+ * include/bits/char_traits.h (char_traits::not_eof): Match operand
+ types in ? :.
+
+2003-08-07 Bernardo Innocenti <bernie@develer.com>
+
+ PR libstdc++/11784
+ * libstdc++-v3/config/cpu/m68k/atomicity.h (__exchange_and_add):
+ Replace variants with new BSET-based version.
+
+2003-08-07 Carlo Wood <carlo@alinoe.com>
+
+ * include/bits/demangle.h: Do not use cctype functions that depend
+ on locale.
+
+2003-08-05 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in: Rename...
+ * configure.ac: ...to this.
+ * docs/html/17_intro/porting.texi: Update name.
+
+ * docs/html/17_intro/porting.html: Regenerate.
+ * config.h.in, Makefile.in, include/Makefile.in, libmath/Makefile.in,
+ libsupc++/Makefile.in, po/Makefile.in, src/Makefile.in,
+ testsuite/Makefile.in: Regenerate (picks up new dependancy).
+
+2003-08-05 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Put down the crack
+ pipe, open the window to let out the fumes, redo the option-handling
+ logic to properly execute the detection test.
+ * aclocal.m4, configure: Regenerate.
+
+2003-08-04 Phil Edwards <pme@gcc.gnu.org>
+
+ Convert to new autotools.
+ * acconfig.h: Update with correct names.
+ * configure.host (ATOMICITYH): Rename to atomicity_include_dir.
+ (qnx6.[12]*): 'q' comes before 's', not after 'w'.
+ * configure.in: Update. Split hardcoded cross-configury settings
+ out to...
+ * crossconfig.m4: ...here. New file. Contents untouched.
+ * acinclude.m4: Reorganize and rewrite as needed. Split large
+ chunks out to...
+ * linkage.m4: ...here. New file. Math and stdlib linkage tests.
+ Contents untouched.
+ * scripts/testsuite_flags.in: Update.
+
+ * Makefile.am: Remove unneeded AUTOMAKE_OPTIONS settings and other
+ variables (already generated by automake).
+ * include/Makefile.am: Ditto.
+ * libmath/Makefile.am: Ditto.
+ * libsupc++/Makefile.am: Ditto.
+ * po/Makefile.am: Ditto.
+ * src/Makefile.am: Ditto.
+
+ * aclocal.m4: Regenerate using new versions.
+ * config.h.in: Ditto.
+ * configure: Ditto.
+ * Makefile.in: Ditto.
+ * include/Makefile.in: Ditto.
+ * libmath/Makefile.in: Ditto.
+ * libsupc++/Makefile.in: Ditto.
+ * po/Makefile.in: Ditto.
+ * src/Makefile.in: Ditto.
+ * testsuite/Makefile.in: Ditto.
+
+2003-08-04 Phil Edwards <pme@gcc.gnu.org>
+
+ * po/libstdc++.pot: Re-extract/regenerate.
+
+2003-08-04 Phil Edwards <pme@gcc.gnu.org>
+
+ * testsuite/Makefile.am (DEJATOOL,EXPECT,RUNTEST,RUNTESTFLAGS):
+ Remove unneeded variable assignments. Leave them for automake.
+ * testsuite/lib/libstdc++-v3.exp: Rename...
+ * testsuite/lib/libstdc++.exp: ...to this. Adjust function names
+ accordingly.
+ * testsuite/libstdc++-v3.dg/dg.exp: Rename...
+ * testsuite/libstdc++-dg/normal.exp: ...to this. Adjust function
+ names accordingly.
+
+2003-08-04 Phil Edwards <pme@gcc.gnu.org>
+
+ * docs/doxygen/guide.html: run_doxygen uses bash.
+ * docs/doxygen/mainpage.html: We'll be shipping tag files.
+ * docs/doxygen/run_doxygen: Tweaks and improvements.
+ * docs/doxygen/user.cfg.in: Set GENERATE_TAGFILE.
+ * docs/html/install.html: Update autoconf/automake requirements.
+ * docs/html/test.html: Add section describing DejaGNU support.
+ * docs/html/17_intro/confdeps.dot: New file, generates...
+ * docs/html/17_intro/confdeps.png: ...this new file.
+ * docs/html/Makefile: Generated here.
+ * docs/html/17_intro/configury.html: New file.
+
+2003-07-31 Phil Edwards <pme@gcc.gnu.org>
+
+ * testsuite/lib/libstdc++-v3-dg.exp: Rename...
+ * testsuite/lib/libstdc++-v3.exp: ...to this.
+ * testsuite/libstdc++-v3.dg/dg.exp: No special case needed now.
+
+2003-07-31 Doug Gregor <dgregor@apple.com>
+
+ Add user specialization tests.
+ * testsuite/23_containers/deque/1.cc: New.
+ * testsuite/23_containers/list/1.cc: New.
+ * testsuite/23_containers/map/1.cc: New.
+ * testsuite/23_containers/multimap/1.cc: New.
+ * testsuite/23_containers/multiset/1.cc: New.
+ * testsuite/23_containers/set/1.cc: New.
+ * testsuite/23_containers/vector/1.cc: New.
+
+2003-07-31 Benjamin Kosnik <bkoz@redhat.com>
+
+ Reshuffle 23_containers testsuite.
+ * 23_containers/adaptors.cc, bitset_ctor.cc,bitset_members.cc,
+ bitset_shift.cc, deque_ctor.cc, deque_operators.cc,
+ list_capacity.cc, list_ctor.cc, list_modifiers.cc, list_operators.cc,
+ map_insert.cc, map_operators.cc, map_operators_neg.cc, multiset.cc,
+ set_operators_neg.cc, vector_bool.cc, vector_capacity.cc,
+ vector_ctor.cc, vector_element_access.cc, vector_modifiers.cc,
+ vector_resize.cc: Split into...
+ * 23_containers/bitset/cons/1.cc: New.
+ * 23_containers/bitset/cons/6282.cc: New.
+ * 23_containers/bitset/count/6124.cc: New.
+ * 23_containers/bitset/operations/1.cc: New.
+ * 23_containers/bitset/operations/2.cc: New.
+ * 23_containers/bitset/test/1.cc: New.
+ * 23_containers/bitset/to_ulong/1.cc: New.
+ * 23_containers/deque/cons/1.cc: New.
+ * 23_containers/deque/cons/2.cc: New.
+ * 23_containers/deque/operators/1.cc: New.
+ * 23_containers/list/capacity/1.cc: New.
+ * 23_containers/list/cons/1.cc: New.
+ * 23_containers/list/cons/2.cc: New.
+ * 23_containers/list/cons/3.cc: New.
+ * 23_containers/list/cons/4.cc: New.
+ * 23_containers/list/cons/5.cc: New.
+ * 23_containers/list/cons/6.cc: New.
+ * 23_containers/list/cons/7.cc: New.
+ * 23_containers/list/cons/8.cc: New.
+ * 23_containers/list/cons/9.cc: New.
+ * 23_containers/list/modifiers/1.cc: New.
+ * 23_containers/list/modifiers/2.cc: New.
+ * 23_containers/list/modifiers/3.cc: New.
+ * 23_containers/list/operators/1.cc: New.
+ * 23_containers/list/operators/2.cc: New.
+ * 23_containers/list/operators/3.cc: New.
+ * 23_containers/list/operators/4.cc: New.
+ * 23_containers/map/insert/1.cc: New.
+ * 23_containers/map/operators/1.cc: New.
+ * 23_containers/map/operators/1_neg.cc: New.
+ * 23_containers/multiset/insert/1.cc: New.
+ * 23_containers/priority_queue/members/7161.cc: New.
+ * 23_containers/queue/members/7157.cc: New.
+ * 23_containers/set/operators/1_neg.cc: New.
+ * 23_containers/stack/members/7158.cc: New.
+ * 23_containers/vector/bool/1.cc: New.
+ * 23_containers/vector/bool/6886.cc: New.
+ * 23_containers/vector/capacity/1.cc: New.
+ * 23_containers/vector/capacity/2.cc: New.
+ * 23_containers/vector/capacity/8230.cc: New.
+ * 23_containers/vector/cons/1.cc: New.
+ * 23_containers/vector/cons/2.cc: New.
+ * 23_containers/vector/cons/3.cc: New.
+ * 23_containers/vector/cons/4.cc: New.
+ * 23_containers/vector/cons/6513.cc: New.
+ * 23_containers/vector/element_access/1.cc: New.
+ * 23_containers/vector/modifiers/1.cc: New.
+ * 23_containers/vector/modifiers/2.cc: New.
+ * 23_containers/vector/resize/1.cc: New.
+
+2003-07-31 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * testsuite/thread/pthread1.cc: Add alpha*-*-osf* to dg-do run,
+ dg-options.
+ * testsuite/thread/pthread2.cc: Likewise.
+ * testsuite/thread/pthread3.cc: Likewise.
+ * testsuite/thread/pthread4.cc: Likewise.
+ * testsuite/thread/pthread5.cc: Likewise.
+ * testsuite/thread/pthread6.cc: Likewise.
+ * testsuite/thread/pthread7-rope.cc: Likewise.
+
+2003-07-30 Phil Edwards <pme@gcc.gnu.org>
+
+ * include/bits/c++config: Partial reversion (comment placement) of
+ previous patch.
+
+2003-07-30 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/c++config (_GLIBCXX_FULLY_COMPLIANT_HEADERS): Remove.
+ (_GLIBCXX_NO_TEMPLATE_EXPORT): To _GLIBCXX_EXPORT_TEMPLATE.
+ (_GLIBCXX_AT_AT): Remove.
+ (__USE_MALLOC): Remove.
+ * include/std/std_fstream.h: Modify.
+ * include/bits/basic_ios.h: Same.
+ * include/bits/valarray_array.h: Same.
+ * include/c_std/std_cmath.h: Same.
+ * include/c_std/cmath.tcc: Same.
+ * include/std/std_vector.h: Same.
+ * include/std/std_string.h: Same.
+ * include/std/std_stack.h: Same.
+ * include/std/std_queue.h: Same.
+ * include/std/std_list.h: Same.
+ * include/std/std_deque.h: Same.
+ * include/std/std_streambuf.h: Same.
+ * include/std/std_sstream.h: Same.
+ * include/std/std_ostream.h: Same.
+ * include/std/std_istream.h: Same.
+ * include/bits/valarray_array.tcc: Same, format.
+
+ * include/c/std_cctype.h: Fix include guards.
+ * include/c/std_cerrno.h: Same.
+ * include/c/std_cfloat.h: Same.
+ * include/c/std_climits.h: Same.
+ * include/c/std_clocale.h: Same.
+ * include/c/std_cmath.h: Same.
+ * include/c/std_csetjmp.h: Same.
+ * include/c/std_csignal.h: Same.
+ * include/c/std_cstdarg.h: Same.
+ * include/c/std_cstddef.h: Same.
+ * include/c/std_cstdio.h: Same.
+ * include/c/std_cstdlib.h: Same.
+ * include/c/std_cstring.h: Same.
+ * include/c/std_ctime.h: Same.
+ * include/c/std_cwchar.h: Same.
+ * include/c/std_cwctype.h: Same.
+ * include/c_std/cmath.tcc: Same.
+ * include/c_std/std_cmath.h: Same.
+
+2003-07-30 Gawain Bolton <gp.bolton@computer.org>
+
+ PR libstdc++/11504.
+ * include/bits/stl_tree.h: Replace C-style casts with C++-style
+ casts. Changes to avoid casting away constness. Eliminate
+ _Rb_tree_base_iterator class. Change _Rb_tree_iterator to use
+ initialization lists. Move out implementation of __black_count()
+ to...
+ * src/stl_tree.cc: ...here and rename _Rb_tree_black_count().
+ Rename_Rb_tree_base_iterator::_M_increment() to
+ _Rb_tree_increment and _Rb_tree_base_iterator::_M_decrement() to
+ _Rb_tree_decrement.
+ * config/linker-map.gnu: Add and change symbols here.
+
+2003-07-30 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/22_locale/howto.html: Use locale::classic() instead
+ of locale("C").
+
+2003-07-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/testsuite_hooks.h: Remove list include.
+ (func_callback): Define as unique type, not std::list.
+ Change DEBUG_ASSERT to _GLIBCXX_ASSERT.
+ * testsuite/libstdc++-v3.dg/dg.exp: Same.
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Same.
+ * testsuite/23_containers/bitset_ctor.cc:
+ * testsuite/17_intro/header_ciso646.cc: Remove DEBUG_ASSERT.
+ * testsuite/18_support/numeric_limits.cc: Same.
+ * testsuite/21_strings/basic_string/append/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/append/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/compare/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/compare/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/char/3.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/wchar_t/3.cc: Same.
+ * testsuite/21_strings/basic_string/find/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/find/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/find/char/3.cc: Same.
+ * testsuite/21_strings/basic_string/find/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/find/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/find/wchar_t/3.cc: Same.
+ * testsuite/21_strings/basic_string/insert/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/insert/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/insert/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/insert/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/inserters_extractors/char/1.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/4.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/5.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/6.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/7.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc:
+ * testsuite/21_strings/basic_string/operators/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/operators/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/operators/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/operators/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/replace/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/replace/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/char/3.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/wchar_t/3.cc: Same.
+ * testsuite/21_strings/basic_string/substr/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/substr/wchar_t/1.cc: Same.
+ * testsuite/23_containers/bitset_ctor.cc: Same.
+ * testsuite/23_containers/bitset_shift.cc: Same.
+ * testsuite/23_containers/vector_ctor.cc: Same.
+ * testsuite/23_containers/vector_element_access.cc: Same.
+ * testsuite/24_iterators/istreambuf_iterator.cc: Same.
+ * testsuite/24_iterators/iterator.cc: Same.
+ * testsuite/24_iterators/ostreambuf_iterator.cc: Same.
+ * testsuite/25_algorithms/lower_bound.cc: Same.
+ * testsuite/26_numerics/complex_inserters_extractors.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc: Same.
+ * testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc: Same.
+ * testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc:
+ Same.
+
+2003-07-28 Phil Edwards <pme@gcc.gnu.org>
+
+ * docs/doxygen/user.cfg.in, docs/html/abi.txt, docs/html/debug.html,
+ docs/html/test.html, docs/html/17_intro/headers_cc.txt,
+ docs/html/17_intro/howto.html, docs/html/ext/howto.html: Change
+ GLIBCPP to GLIBCXX (and explain as needed).
+
+2003-07-28 Phil Edwards <pme@gcc.gnu.org>
+
+ * README: Update.
+
+2003-07-28 Phil Edwards <pme@gcc.gnu.org>
+
+ * testsuite/22_locale/messages/members/char/1.cc,
+ testsuite/22_locale/messages/members/char/2.cc,
+ testsuite/22_locale/messages/members/char/3.cc,
+ testsuite/22_locale/messages_byname/1.cc: Update comment regarding
+ the origin of LOCALEDIR.
+ * testsuite/lib/libstdc++-v3.exp: New file.
+
+2003-07-25 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/char_traits.h: Update copyright, tweak.
+ * testsuite/ext/pod_char_traits.cc: Explicitly qualify namespace
+ std types.
+
+2003-07-24 Matt Austern <austern@apple.com>
+
+ * /include/bits/char_traits.h (class char_traits): Put all the
+ real work into the new class template __gnu_cxx::char_traits.
+ Gave generic definitions for member functions. Types are taken
+ from the new class template __gnu_cxx::_Char_types.
+ * testsuite/21_strings/char_traits/requirements/short/1.cc: New
+ file. Test of std::char_traits<short>, which serves as a test of
+ the char_traits primary template.
+
+2003-07-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/*: Change __gnu_cxx_test to __gnu_test.
+
+2003-07-24 Nathan Myers <ncm-nospam@cantrip.org>
+
+ * testsuite/23_containers/map_operators.cc: Conform to
+ container requirement as value must be Assignable.
+
+2003-07-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * acinclude.m4 (GLIBCXX_ENABLE_PCH): Rework test such that it
+ tests not only generation of pch files, but also their use.
+ * aclocal.m4, configure: Rebuilt.
+
+2003-07-23 Steve Ellcey <sje@cup.hp.com>
+
+ * config/cpu/hppa/atomicity.h: Change
+ _GLIBCXX_INST_GLIBCXX_ATOMICITY_LOCK to _GLIBCXX_INST_ATOMICITY_LOCK
+ to match misc-inst.cc
+
+2003-07-23 Steve Ellcey <sje@cup.hp.com>
+
+ * include/c_std/cmath.tcc: Use _GLIBCXX_ prefix on file guard.
+ * include/c_std/std_cctype.h: Ditto.
+ * include/c_std/std_cerrno.h: Ditto.
+ * include/c_std/std_cfloat.h: Ditto.
+ * include/c_std/std_climits.h: Ditto.
+ * include/c_std/std_clocale.h: Ditto.
+ * include/c_std/std_cmath.h: Ditto.
+ * include/c_std/std_csetjmp.h: Ditto.
+ * include/c_std/std_csignal.h: Ditto.
+ * include/c_std/std_cstdarg.h: Ditto.
+ * include/c_std/std_cstddef.h: Ditto.
+ * include/c_std/std_cstdio.h: Ditto.
+ * include/c_std/std_cstdlib.h: Ditto.
+ * include/c_std/std_cstring.h: Ditto.
+ * include/c_std/std_ctime.h: Ditto.
+ * include/c_std/std_cwchar.h: Ditto.
+ * include/c_std/std_cwctype.h: Ditto.
+ * include/std/std_algorithm.h: Ditto.
+ * include/std/std_bitset.h: Ditto.
+ * include/std/std_complex.h: Ditto.
+ * include/std/std_deque.h: Ditto.
+ * include/std/std_fstream.h: Ditto.
+ * include/std/std_functional.h: Ditto.
+ * include/std/std_iomanip.h: Ditto.
+ * include/std/std_ios.h: Ditto.
+ * include/std/std_iosfwd.h: Ditto.
+ * include/std/std_iostream.h: Ditto.
+ * include/std/std_istream.h: Ditto.
+ * include/std/std_iterator.h: Ditto.
+ * include/std/std_limits.h: Ditto.
+ * include/std/std_list.h: Ditto.
+ * include/std/std_locale.h: Ditto.
+ * include/std/std_map.h: Ditto.
+ * include/std/std_memory.h: Ditto.
+ * include/std/std_numeric.h: Ditto.
+ * include/std/std_ostream.h: Ditto.
+ * include/std/std_queue.h: Ditto.
+ * include/std/std_set.h: Ditto.
+ * include/std/std_sstream.h: Ditto.
+ * include/std/std_stack.h: Ditto.
+ * include/std/std_stdexcept.h: Ditto.
+ * include/std/std_streambuf.h: Ditto.
+ * include/std/std_string.h: Ditto.
+ * include/std/std_utility.h: Ditto.
+ * include/std/std_valarray.h: Ditto.
+ * include/std/std_vector.h: Ditto.
+
+2003-07-22 Doug Gregor <dgregor@apple.com>
+
+ * include/bits/basic_string.h (basic_string::insert): Deprecate
+ GNU extension.
+
+2003-07-21 Benjamin Kosnik <bkoz@redhat.com>
+
+ * scripts/testsuite_flags.in (--build-includes): Remove extraneous
+ paths for libio.
+ * testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc
+ (test03): Include typeinfo for bad_cast.
+ * testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc: Same.
+ * testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc: Same.
+ * testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc: Same.
+
+2003-07-21 Doug Gregor <dgregor@apple.com>
+
+ * include/bits/boost_concept_check.h:
+ (_EqualityComparableConcept::__constraints): Remove != from the
+ list of constraints; it is not listed in Table 28 of the C++98
+ standard.
+
+2003-07-18 Andreas Jaeger <aj@suse.de>
+
+ * config/abi/sparc-linux-gnu/baseline_symbols.txt: New file.
+ * config/abi/mips-linux-gnu/baseline_symbols.txt: New file.
+ * config/abi/hppa-linux-gnu/baseline_symbols.txt: New file.
+ * config/abi/x86_64-linux-gnu/baseline_symbols.txt: Regenerated.
+
+2003-07-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/linker-map.gnu: Add __moneypunct_cache, __timepunct_cache.
+ * config/locale/generic/messages_members.h: Tweaks.
+ * config/locale/generic/monetary_members.cc
+ (moneypunct::_M_initialize_moneypunct): Use cache.
+ (moneypunct::~moneypunct): Delete cache.
+ * config/locale/generic/time_members.cc:
+ (__timepunct::_M_initialize_timepunct): Use cache.
+ * config/locale/generic/time_members.h:
+ (__timepunct::~__timepunct): Delete cache.
+ (__timepunct::__timepunct): Set cache.
+ * config/locale/gnu/messages_members.h: Tweaks.
+ * config/locale/gnu/monetary_members.cc:
+ (moneypunct::_M_initialize_moneypunct): Use cache.
+ (moneypunct::~moneypunct): Delete cache.
+ * config/locale/gnu/time_members.cc:
+ (__timepunct::_M_initialize_timepunct): Use cache.
+ * config/locale/gnu/time_members.h:
+ (__timepunct::~__timepunct): Delete cache.
+ (__timepunct::__timepunct): Set cache.
+ * include/bits/locale_facets.h (__timepunct_cache): New.
+ (__moneypunct_cache): New.
+ * include/bits/locale_facets.tcc: Tweak.
+ * src/locale.cc (__timepunct::_S_timezones): Adjust for cache.
+ * src/locale-inst.cc: Instantiate caches.
+ * src/globals.cc: Add "C" caches.
+ * src/localename.cc: Use external "C" caches.
+
+2003-07-17 Phil Edwards <pme@gcc.gnu.org>
+
+ * docs/doxygen/guide.html: Fix typo.
+
+2003-07-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/ext/pod_char_traits.h: Add state template argument.
+
+2003-07-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/locale_facets.h (__num_base::_S_atoms_in): Add -+xX.
+ (num_get::_M_convert_int): To _M_insert_int.
+ (num_get::_M_convert_float): To _M_insert_float.
+ * include/bits/locale_facets.tcc (num_get::_M_extract_float):
+ Use caches for ctype, num_get.
+ (num_get::_M_extract_int): Same.
+ (num_get::get(bool)): Same.
+ (__verify_grouping): Use size_t.
+ * src/locale-inst.cc: Update.
+ * src/locale.cc: Adjust _S_atoms_in.
+
+2003-07-16 Phil Edwards <pme@gcc.gnu.org>
+
+ * docs/doxygen/mainpage.html: Move building/writing instructions...
+ * docs/doxygen/guide.html: ...to here. New file.
+
+2003-07-16 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/ext/howto.html: Update URL for SGI STL docs.
+ * docs/html/faq/index.html: Same.
+ * docs/html/faq/index.txt: Regenerate.
+
+2003-07-16 Paolo Carlini <pcarlini@unitus.it>
+
+ PR libstdc++/11528
+ * include/bits/locale_facets.tcc (money_get::do_get):
+ Strip only _leading_ zeros.
+ * testsuite/22_locale/money_get/get/char/11528.cc: Add.
+ * testsuite/22_locale/money_get/get/wchar_t/11528.cc: Add.
+
+2003-07-16 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * include/ext/hash_map (class hash_multimap): Remove extra
+ semicolons from __glibcxx_class_requires3 entries.
+ * include/ext/hash_set (class hash_set): Ditto.
+ (class hash_multiset): Ditto.
+
+2003-07-15 Petur Runolfsson <peturr02@ru.is>
+
+ * include/bits/char_traits.h (char_traits<wchar_t>::move):
+ Change last parameter from int_type to size_t.
+
+2003-07-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/stl_algo.h (includes, set_union, set_intersection,
+ set_difference, set_symmetric_difference, max_element, min_element,
+ next_permutation, prev_permutation, find_first_of, find_end):
+ Document.
+ * include/bits/stl_algobase.h (copy,copy_backward): Clarify overlap
+ restrictions in docs.
+ * include/bits/stl_heap.h (push_heap, pop_heap, make_heap, sort_heap):
+ Document.
+ * docs/doxygen/doxygroups.cc (setoperations): New group.
+
+2003-07-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/basic_string.h: Document public functions.
+ * docs/doxygen/TODO: Update c21 todo.
+
+2003-07-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/stl_list.h: Document more functions.
+ * docs/doxygen/TODO: Update c23 todo.
+
+2003-07-14 Paolo Carlini <pcarlini@unitus.it>
+
+ * config/locale/gnu/c_locale.h (__convert_from_v): One more
+ qualification.
+
+2003-07-14 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/stl_tempbuf.h: Qualify free with std::.
+ * src/locale.cc: Include <cstdlib>, qualify getenv.
+
+2003-07-14 Paolo Carlini <pcarlini@unitus.it>
+
+ * config/locale/gnu/c_locale.h (__convert_from_v): Include
+ <cstdio>. Qualify names.
+ * config/locale/generic/c_locale.h (__convert_from_v): Ditto.
+
+2003-07-14 Paolo Carlini <pcarlini@unitus.it>
+ Nathan C. Myers <ncm-nospam@cantrip.org>
+
+ PR libstdc++/11378
+ * include/std/std_fstream.h (xsputn): Declare only.
+ * include/bits/fstream.tcc (xsputn): Define, optimize for the
+ always_noconv() case: when __n is sufficiently large flush
+ the buffer and issue a direct write, if possible combining the
+ two with writev in __basic_file<>::xsputn_2.
+ * config/io/basic_file_stdio.h (__basic_file<>::xsputn_2):
+ New, declare.
+ * config/io/basic_file_stdio.cc (__basic_file<>::xsputn_2):
+ Define.
+ * acinclude.m4 (GLIBCXX_CHECK_WRITE): New macro, checking for
+ the availability of writev in <sys/uio.h>.
+ * configure.in: Call here.
+ * acconfig.h: Add undef for the corresponding symbol.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+ * testsuite/27_io/basic_filebuf/setbuf/char/3.cc: Tweak.
+
+ * include/std/std_fstream.h (sync): Constify a variable.
+
+2003-07-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix line numbers.
+ * testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
+
+2003-07-14 Gabriel Dos Reis <gcc@integrable-solutions.net>
+
+ * config/locale/gnu/c_locale.h (__convert_from_v): Include
+ <cstring> and <cstdlib>. Qualify names.
+
+2003-07-13 Mark Mitchell <mark@codesourcery.com>
+
+ * config/locale/generic/c_locale.h: Include <cstdlib> and
+ <cstring>.
+ * include/bits/boost_concept_check.h: Add this-> to unqualified
+ method calls.
+ * include/bits/deque.tcc: Likewise.
+ * include/bits/locale_facets.h : Likewise.
+ * include/bits/ostream.tcc: Likewise.
+ * include/bits/stl_algo.h: Likewise.
+ * include/bits/stl_bvector.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_tree.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/bits/vector.tcc: Likewise.
+ * include/ext/rope: Likewise.
+ * include/ext/ropeimpl.h: Likewise.
+ * include/ext/stdio_filebuf.h: Likewise.
+
+2003-07-11 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/basic_ios.h (copyfmt): Document.
+ * include/bits/ios_base.h (event, event_callback, register_callback,
+ xalloc, iword, pword): Document.
+ (imbue, ~ios_base): Update docs on callbacks.
+
+2003-07-11 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4 (GLIBCC_ENABLE_SYMVERS): Tweak comments. Add
+ warning messages if the environment cannot support symbol versioning.
+ (port_specific_symbol_file): It's plural, add an 's' on the end.
+ * configure.host: Likewise.
+ * src/Makefile.am: Likewise.
+ * config/linker-map.gnu: Remove one semicolon, heh.
+ * scripts/extract_symvers: Don't assume useful 'export' syntax.
+ Set LANG as well as LC_ALL for possibly-broken sort(1)s.
+ * aclocal.m4, configure, src/Makefile.in: Regenerated.
+
+2003-07-09 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/locale_facets.tcc: Use function object for
+ __use_cache instead of template function. Partially specialize for
+ __numpunct<_CharT>.
+ * include/bits/locale_classes.h: Update friend declaration for
+ __use_cache.
+ (_M_install_cache): No throw exception specs.
+ * src/locale.cc: Remove __use_cache specializations.
+ * include/ext/pod_char_traits.h (length): Tweak.
+ * include/bits/locale_facets.h (__numpunct_cache): Remove
+ char_type typedef.
+ * testsuite/testsuite_hooks.h (pod_unsigned_int): Remove.
+ (pod_long): Remove.
+ * testsuite/22_locale/numpunct/members/char/cache_1.cc: New.
+ * testsuite/22_locale/numpunct/members/char/cache_2.cc: New.
+ * testsuite/22_locale/numpunct/members/wchar_t/cache_1.cc: New.
+ * testsuite/22_locale/numpunct/members/wchar_t/cache_2.cc: New.
+ * testsuite/22_locale/numpunct/members/pod/1.cc: New.
+ * testsuite/22_locale/numpunct/members/pod/2.cc: New.
+
+2003-07-09 Jerry Quinn <jlquinn@optonline.net>
+
+ * src/ios.cc (_M_grow_words): Fix spelling.
+
+2003-07-09 Gawain Bolton <gp.bolton@computer.org>
+
+ * include/bits/stl_tree.h: Move larger member functions in
+ _Rb_tree_base_iterator and _Rb_tree_node to...
+ * src/stl_tree.cc: Here.
+ * src/Makefile.in: Add stl_tree.cc.
+ * src/Makefile.in: Regenerated.
+ * config/linker-map.gnu: Add symbols here.
+
2003-07-08 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/ext/pod_char_traits.cc: New.
@@ -5,7 +1036,7 @@
* include/Makefile.am (ext_headers): Add pod_char_traits.h.
* include/Makefile.in: Regenerate.
* docs/html/21_strings/howto.html: Update.
-
+
2003-07-08 Gawain Bolton <gp.bolton@computer.org>
* testsuite/performance/list_create_fill_sort.cc: New.
@@ -15,11 +1046,11 @@
* config/locale/generic/numeric_members.cc: Correct type info.
* config/locale/gnu/numeric_members.cc: Same.
* include/bits/locale_facets.h: Same.
-
+
* include/bits/char_traits.h: Correct spacing.
* src/locale.cc: Wrap to 80 col.
-
+
2003-07-07 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_complex.h: Partially revert last
@@ -104,7 +1135,7 @@
2003-07-05 Gawain Bolton <gp.bolton@computer.org>
* include/bits/stl_tree.h: _Rb_tree_rebalance(): Add local
- variable for grandparent and use const
+ variable for grandparent and use const
2003-07-05 David Billinghurst <David.Billinghurst@riotinto.com>
@@ -135,15 +1166,15 @@
* testsuite/Makefile.am: Same.
* testsuite/Makefile.in: Regenerate.
* po/Makefile.am: Same.
- * po/Makefile.in: Regenerate.
+ * po/Makefile.in: Regenerate.
* libsupc++/Makefile.am: Same.
- * libsupc++/Makefile.in: Regenerate.
+ * libsupc++/Makefile.in: Regenerate.
* libmath/Makefile.am: Same.
- * libmath/Makefile.in: Regenerate.
+ * libmath/Makefile.in: Regenerate.
* include/Makefile.am: Same.
- * include/Makefile.in: Regenerate.
+ * include/Makefile.in: Regenerate.
* src/Makefile.am: Same.
- * src/Makefile.in: Regenerate.
+ * src/Makefile.in: Regenerate.
* acconfig.h: Same.
* configure.host: Same.
* configure.in: Same.
@@ -155,7 +1186,7 @@
* include: Same, standardize include guards.
* config: Same.
* libsupc++: Same.
-
+
2003-07-04 Zack Weinberg <zack@codesourcery.com>
* testsuite/22_locale/collate/compare/wchar_t/2.cc
diff --git a/libstdc++-v3/Makefile.am b/libstdc++-v3/Makefile.am
index e509f81587a..040b8da7c9f 100644
--- a/libstdc++-v3/Makefile.am
+++ b/libstdc++-v3/Makefile.am
@@ -22,32 +22,32 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-AUTOMAKE_OPTIONS = 1.3 cygnus
-MAINT_CHARSET = latin1
+include $(top_srcdir)/fragment.am
-SUBDIRS = include libmath libsupc++ src po testsuite
-
-mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
-
-PWD_COMMAND = $${PWDCMD-pwd}
+if GLIBCXX_HOSTED
+ # Possibly libmath as well...
+ hosted_source = src po
+endif
+## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE.
+SUBDIRS = include libmath libsupc++ $(hosted_source) testsuite
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
- /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ ${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
--mode=user $${srcdir} $${builddir})
doxygen-maint:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
- /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ ${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
--mode=maint $${srcdir} $${builddir})
doxygen-man:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
- /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ ${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
--mode=man $${srcdir} $${builddir})
.PHONY: doxygen doxygen-maint doxygen-man
@@ -132,7 +132,7 @@ AM_MAKEFLAGS = \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
- "WERROR=$(WERROR)"
+ "WERROR=$(WERROR)"
# Subdir rules rely on $(FLAGS_TO_PASS)
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 420322d0513..b830f7418ce 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/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,62 +12,40 @@
# 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 = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
@@ -74,6 +54,7 @@ CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
@@ -82,40 +63,76 @@ CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FPOS_H = @FPOS_H@
FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-GLIBCXX_IS_CROSS_COMPILING = @GLIBCXX_IS_CROSS_COMPILING@
+GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
+GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
+GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
+GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBMATHOBJS = @LIBMATHOBJS@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
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@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
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@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
@@ -123,15 +140,28 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+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_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
check_msgfmt = @check_msgfmt@
+datadir = @datadir@
enable_shared = @enable_shared@
enable_static = @enable_static@
-glibcxx_CXX = @glibcxx_CXX@
+exec_prefix = @exec_prefix@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
-glibcxx_basedir = @glibcxx_basedir@
glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
@@ -140,18 +170,56 @@ glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
-ifGNUmake = @ifGNUmake@
+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@
libtool_VERSION = @libtool_VERSION@
+localstatedir = @localstatedir@
+mandir = @mandir@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
toplevel_srcdir = @toplevel_srcdir@
-AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
-SUBDIRS = include libmath libsupc++ src po testsuite
-
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
-
PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
+
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
+
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
+CONFIG_CXXFLAGS = \
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
+
+WARN_CXXFLAGS = \
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
+@GLIBCXX_HOSTED_TRUE@hosted_source = src po
+SUBDIRS = include libmath libsupc++ $(hosted_source) testsuite
# Multilib support.
MAKEOVERRIDES =
@@ -205,66 +273,83 @@ AM_MAKEFLAGS = \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
- "WERROR=$(WERROR)"
+ "WERROR=$(WERROR)"
# Subdir rules rely on $(FLAGS_TO_PASS)
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
+subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
-acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+CONFIG_CLEAN_FILES = scripts/check_survey scripts/testsuite_flags
+depcomp =
+am__depfiles_maybe =
+DIST_SOURCES =
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
+ ps-recursive install-info-recursive uninstall-info-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 \
+ ../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
+DIST_SUBDIRS = include libmath libsupc++ src po testsuite
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
-TAR = gtar
-GZIP_ENV = --best
-all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in 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)/fragment.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) $(top_srcdir)/acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ touch $(srcdir)/config.h.in
distclean-hdr:
- -rm -f config.h
+ -rm -f config.h stamp-h1
+scripts/check_survey: $(top_builddir)/config.status $(top_srcdir)/scripts/check_survey.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+scripts/testsuite_flags: $(top_builddir)/config.status $(top_srcdir)/scripts/testsuite_flags.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+ -rm -f *.lo
-maintainer-clean-hdr:
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -272,13 +357,8 @@ maintainer-clean-hdr:
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
-
-@SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
+$(RECURSIVE_TARGETS):
+ @set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -298,13 +378,18 @@ check-recursive installcheck-recursive info-recursive dvi-recursive:
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
+ @set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
- rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
- rev="$$subdir $$rev"; \
- test "$$subdir" != "." || dot_seen=yes; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
done; \
- test "$$dot_seen" = "no" && rev=". $$rev"; \
+ rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
@@ -320,179 +405,292 @@ tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ 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)
-
-mostlyclean-tags:
+ mkid -fID $$unique
+
+ctags: CTAGS
+CTAGS: ctags-recursive $(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)
-# 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 \
- && $(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)
+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)
- -rm -rf $(distdir)
+ $(am__remove_distdir)
mkdir $(distdir)
- -chmod 777 $(distdir)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ $(mkinstalldirs) $(distdir)/.. $(distdir)/scripts
+ @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 \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ 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 \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
- for subdir in $(SUBDIRS); do \
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" \
+ distdir=../$(distdir)/$$subdir \
+ distdir) \
|| exit 1; \
fi; \
done
-info-am:
-info: info-recursive
-dvi-am:
-dvi: dvi-recursive
-check-am:
+ -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
+ $(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) 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-recursive
-installcheck-am:
-installcheck: installcheck-recursive
-install-info-am:
-install-info: install-info-recursive
-all-recursive-am: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
-install-exec-am:
+install: install-recursive
install-exec: install-exec-recursive
-
-install-data-am:
install-data: install-data-recursive
+uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am:
-uninstall: uninstall-recursive
-all-am: Makefile config.h
-all-redirect: all-recursive-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs: installdirs-recursive
-installdirs-am:
-
+installcheck: installcheck-recursive
+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-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-recursive
-mostlyclean: mostlyclean-recursive
+clean-am: clean-generic clean-libtool mostlyclean-am
-clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags
-clean: clean-recursive
+dvi: dvi-recursive
-distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
- -rm -f libtool
+dvi-am:
-distclean: distclean-recursive
- -rm -f config.status
+info: info-recursive
-maintainer-clean-am: maintainer-clean-hdr 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:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -f config.status
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-install-data-recursive uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-info-am \
-install-info all-recursive-am install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf autom4te.cache
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+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
+
+
+@GLIBCXX_HOSTED_TRUE@ # Possibly libmath as well...
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
- /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ ${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
--mode=user $${srcdir} $${builddir})
doxygen-maint:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
- /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ ${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
--mode=maint $${srcdir} $${builddir})
doxygen-man:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`${PWD_COMMAND}`; \
- /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ ${SHELL} ${srcdir}/docs/doxygen/run_doxygen \
--mode=man $${srcdir} $${builddir})
.PHONY: doxygen doxygen-maint doxygen-man
@@ -524,7 +722,6 @@ maintainer-clean-multi:
# All the machinations with string instantiations messes up the
# automake-generated TAGS rule. Make a simple one here.
TAGS: tags-recursive $(LISP)
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libstdc++-v3/README b/libstdc++-v3/README
index b3e860ceaf1..6844909a1cf 100644
--- a/libstdc++-v3/README
+++ b/libstdc++-v3/README
@@ -82,7 +82,7 @@ Currently these are:
config/locale
config/os
-In addition, three subdirectories are convenience libraries:
+In addition, two subdirectories are convenience libraries:
libmath
Support routines needed for C++ math. Only needed if the
diff --git a/libstdc++-v3/acconfig.h b/libstdc++-v3/acconfig.h
index b856b6ba8d3..783f6d6db5e 100644
--- a/libstdc++-v3/acconfig.h
+++ b/libstdc++-v3/acconfig.h
@@ -35,13 +35,16 @@
#undef _GLIBCXX_CONCEPT_CHECKS
// Define if the atan2f function exists.
-#undef _GLIBCXX_HAVE_ATAN2F
+#undef HAVE_ATAN2F
// Define if the atan2l function exists.
-#undef _GLIBCXX_HAVE_ATAN2L
+#undef HAVE_ATAN2L
+
+// Define if the tanl function exists.
+#undef HAVE_TANL
// Define if the copysignf function exists.
-#undef _GLIBCXX_HAVE_COPYSIGNF
+#undef HAVE_COPYSIGNF
// Define to use symbol versioning in the shared library.
#undef _GLIBCXX_SYMVER
@@ -87,6 +90,9 @@
// Define if you have the expl function.
#undef HAVE_EXPL
+// Define if you have the hypot function.
+#undef HAVE_HYPOT
+
// Define if you have the hypotf function.
#undef HAVE_HYPOTF
@@ -144,6 +150,9 @@
// Define if S_IFREG is available in <sys/stat.h>.
#undef HAVE_S_IFREG
+// Define if writev is available in <sys/uio.h>.
+#undef HAVE_WRITEV
+
// Define if LC_MESSAGES is available in <locale.h>.
#undef HAVE_LC_MESSAGES
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 807dd64e40b..da0cc040a08 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1,243 +1,184 @@
+
+dnl
+dnl GLIBCXX_CONDITIONAL (NAME, SHELL-TEST)
+dnl
+dnl Exactly like AM_CONDITIONAL, but delays evaluation of the test until the
+dnl end of configure. This lets tested variables be reassigned, and the
+dnl conditional will depend on the final state of the variable. For a simple
+dnl example of why this is needed, see GLIBCXX_ENABLE_HOSTED.
+dnl
+m4_define([_m4_divert(glibcxx_diversion)], 8000)dnl
+AC_DEFUN(GLIBCXX_CONDITIONAL, [dnl
+ m4_divert_text([glibcxx_diversion],dnl
+ AM_CONDITIONAL([$1],[$2])
+ )dnl
+])dnl
+AC_DEFUN(GLIBCXX_EVALUATE_CONDITIONALS, [m4_undivert([glibcxx_diversion])])dnl
+
+
+dnl
+dnl Check to see what architecture and operating system we are compiling
+dnl for. Also, if architecture- or OS-specific flags are required for
+dnl compilation, pick them up here.
+dnl
+AC_DEFUN(GLIBCXX_CHECK_HOST, [
+ . $glibcxx_srcdir/configure.host
+ AC_MSG_NOTICE(CPU config directory is $cpu_include_dir)
+ AC_MSG_NOTICE(OS config directory is $os_include_dir)
+])
+
+
dnl
-dnl Initialize basic configure bits, set toplevel_srcdir for Makefiles.
+dnl Initialize basic configure bits.
+dnl
+dnl Substs:
+dnl multi_basedir
dnl
-dnl GLIBCXX_TOPREL_CONFIGURE
AC_DEFUN(GLIBCXX_TOPREL_CONFIGURE, [
- dnl Default to --enable-multilib (this is also passed by default
- dnl from the ubercommon-top-level configure)
- AC_ARG_ENABLE(multilib,
- [ --enable-multilib build hella library versions (default)],
- [case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
- esac], [multilib=yes])dnl
-
- # When building with srcdir == objdir, links to the source files will
- # be created in directories within the target_subdir. We have to
- # adjust toplevel_srcdir accordingly, so that configure finds
- # install-sh and other auxiliary files that live in the top-level
- # source directory.
- if test "${srcdir}" = "."; then
- if test -z "${with_target_subdir}"; then
- toprel=".."
- else
- if test "${with_target_subdir}" != "."; then
- toprel="${with_multisrctop}../.."
- else
- toprel="${with_multisrctop}.."
- fi
- fi
+ # Sets up multi_basedir, which is srcdir/.. plus the usual
+ # "multi_source_toprel_bottom_adjust" lunacy as needed.
+ AM_ENABLE_MULTILIB(, ..)
+
+ # The generated code is exactly the same, except that automake's looks in
+ # ".. $srcdir/.." and autoconf's looks in multi_basedir. Apparently other
+ # things are triggered on the presence of the two ...AUX_DIR[S], but I don't
+ # know what they are or what the other differences might be (and they keep
+ # changing anyhow).
+ #
+ # Looking in multi_basedir seems smarter, so actually execute that branch.
+ if false; then
+ # this is for automake
+ AC_CONFIG_AUX_DIR(..)
else
- toprel=".."
+ # this is for autoconf
+ AC_CONFIG_AUX_DIRS(${multi_basedir})
fi
- AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
- toplevel_srcdir=\${top_srcdir}/$toprel
- AC_SUBST(toplevel_srcdir)
+
+ dnl XXX Turn this on.
+ dnl AC_LANG_CPLUSPLUS
])
+
+dnl
+dnl Initialize the rest of the library configury. At this point we have
+dnl variables like $host.
dnl
-dnl Initialize the rest of the library configury.
+dnl Sets:
+dnl gcc_version (x.y.z format)
+dnl SUBDIRS
+dnl Substs:
+dnl glibcxx_builddir (absolute path)
+dnl glibcxx_srcdir (absolute path)
+dnl toplevel_srcdir (absolute path)
+dnl with_cross_host
+dnl with_newlib
+dnl with_target_subdir
+dnl plus
+dnl - the variables in GLIBCXX_CHECK_HOST / configure.host
+dnl - default settings for all AM_CONFITIONAL test variables
+dnl - lots of tools, like CC and CXX
dnl
-dnl GLIBCXX_CONFIGURE
AC_DEFUN(GLIBCXX_CONFIGURE, [
- # Export build and source directories.
+ # Keep these sync'd with the list in Makefile.am. The first provides an
+ # expandable list at autoconf time; the second provides an expandable list
+ # (i.e., shell variable) at configure time.
+ m4_define([glibcxx_SUBDIRS],[include libmath libsupc++ src po testsuite])
+ SUBDIRS='glibcxx_SUBDIRS'
+
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
glibcxx_builddir=`${PWDCMD-pwd}`
case $srcdir in
- [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
- *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+ [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
+ *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
esac
+ toplevel_srcdir=${glibcxx_srcdir}/..
AC_SUBST(glibcxx_builddir)
AC_SUBST(glibcxx_srcdir)
+ AC_SUBST(toplevel_srcdir)
- dnl This is here just to satisfy automake.
- ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
-
- AC_PROG_AWK
- # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
- # be 'cp -p' if linking isn't available. Uncomment the next line to
- # force a particular method.
- #ac_cv_prog_LN_S='cp -p'
- AC_PROG_LN_S
-
- # We use these options to decide which functions to include.
- AC_ARG_WITH(target-subdir,
- [ --with-target-subdir=SUBDIR
- configuring in a subdirectory])
- AC_ARG_WITH(cross-host,
- [ --with-cross-host=HOST configuring with a cross compiler])
-
- AC_ARG_WITH(newlib,
- [ --with-newlib Configuring with newlib])
-
- glibcxx_basedir=$srcdir/$toprel/$1/libstdc++-v3
- AC_SUBST(glibcxx_basedir)
-
- # Never versions of autoconf add an underscore to these functions.
- # Prevent future problems ...
- ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
- ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
- ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
- ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
-
- # AC_PROG_CC
- # FIXME: We temporarily define our own version of AC_PROG_CC. This is
- # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
- # are probably using a cross compiler, which will not be able to fully
- # link an executable. This is addressed in later versions of autoconf.
-
- AC_DEFUN(LIB_AC_PROG_CC,
- [AC_BEFORE([$0], [AC_PROG_CPP])dnl
- dnl Fool anybody using AC_PROG_CC.
- AC_PROVIDE([AC_PROG_CC])
- AC_CHECK_PROG(CC, gcc, gcc)
- if test -z "$CC"; then
- AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
- test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
- fi
-
- AC_PROG_CC_GNU
-
- if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- dnl Check whether -g works, even if CFLAGS is set, in case the package
- dnl plays around with CFLAGS (such as to build both debugging and
- dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
- else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
- fi
- ])
-
- LIB_AC_PROG_CC
-
- # Likewise for AC_PROG_CXX. We can't just call it directly because g++
- # will try to link in libstdc++.
- AC_DEFUN(LIB_AC_PROG_CXX,
- [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
- dnl Fool anybody using AC_PROG_CXX.
- AC_PROVIDE([AC_PROG_CXX])
- # Use glibcxx_CXX so that we do not cause CXX to be cached with the
- # flags that come in CXX while configuring libstdc++. They're different
- # from those used for all other target libraries. If CXX is set in
- # the environment, respect that here.
- glibcxx_CXX=$CXX
- AC_CHECK_PROGS(glibcxx_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
- AC_SUBST(glibcxx_CXX)
- CXX=$glibcxx_CXX
- test -z "$glibcxx_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
-
- AC_PROG_CXX_GNU
-
- if test $ac_cv_prog_gxx = yes; then
- GXX=yes
- dnl Check whether -g works, even if CXXFLAGS is set, in case the package
- dnl plays around with CXXFLAGS (such as to build both debugging and
- dnl normal versions of a library), tasteless as that idea is.
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- AC_PROG_CXX_G
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-O2"
- fi
- else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
- fi
- ])
-
- LIB_AC_PROG_CXX
+ # We use these options to decide which functions to include. They are
+ # set from the top level.
+ AC_ARG_WITH([target-subdir],
+ AC_HELP_STRING([--with-target-subdir=SUBDIR],
+ [configuring in a subdirectory]))
+
+ AC_ARG_WITH([cross-host],
+ AC_HELP_STRING([--with-cross-host=HOST],
+ [configuring with a cross compiler]))
+
+ AC_ARG_WITH([newlib],
+ AC_HELP_STRING([--with-newlib],
+ [assume newlib as a system C library]))
+
+ # We're almost certainly being configured before anything else which uses
+ # C++, so all of our AC_PROG_* discoveries will be cached. It's vital that
+ # we not cache the value of CXX that we "discover" here, because it's set
+ # to something unique for us and libjava. Other target libraries need to
+ # find CXX for themselves. We yank the rug out from under the normal AC_*
+ # process by sneakily renaming the cache variable. This also lets us debug
+ # the value of "our" CXX in postmortems.
+ #
+ # We must also force CXX to /not/ be a precious variable, otherwise the
+ # wrong (non-multilib-adjusted) value will be used in multilibs. This
+ # little trick also affects CPPFLAGS, CXXFLAGS, and LDFLAGS. And as a side
+ # effect, CXXFLAGS is no longer automagically subst'd, so we have to do
+ # that ourselves. Un-preciousing AC_PROG_CC also affects CC and CFLAGS.
+ #
+ # -fno-builtin must be present here so that a non-conflicting form of
+ # std::exit can be guessed by AC_PROG_CXX, and used in later tests.
+
+ m4_define([ac_cv_prog_CXX],[glibcxx_cv_prog_CXX])
+ m4_rename([_AC_ARG_VAR_PRECIOUS],[glibcxx_PRECIOUS])
+ m4_define([_AC_ARG_VAR_PRECIOUS],[])
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-builtin"
+ AC_PROG_CC
+ AC_PROG_CXX
+ CXXFLAGS="$save_CXXFLAGS"
+ m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+ AC_SUBST(CFLAGS)
+ AC_SUBST(CXXFLAGS)
# For directory versioning (e.g., headers) and other variables.
AC_MSG_CHECKING([for GCC version number])
- gcc_version=`$glibcxx_CXX -dumpversion`
+ gcc_version=`$CXX -dumpversion`
AC_MSG_RESULT($gcc_version)
- # For some reason, gettext needs this.
- AC_ISC_POSIX
+ # Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't
+ # available). Uncomment the next line to force a particular method.
+ AC_PROG_LN_S
+ #LN_S='cp -p'
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
- AC_PROG_INSTALL
AM_MAINTAINER_MODE
- # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
- # at least currently, we never actually build a program, so we never
- # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
- # fails, because we are probably configuring with a cross compiler
- # which can't create executables. So we include AC_EXEEXT to keep
- # automake happy, but we don't execute it, since we don't care about
- # the result.
- if false; then
- # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
- # to nothing, so nothing would remain between `then' and `fi' if it
- # were not for the `:' below.
- :
- AC_EXEEXT
- fi
-
- case [$]{glibcxx_basedir} in
- /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcxx_basedir} ;;
- *) glibcxx_flagbasedir='[$](top_builddir)/'[$]{glibcxx_basedir} ;;
- esac
-
- # Set up safe default values for all subsequent AM_CONDITIONAL tests.
+ # Set up safe default values for all subsequent AM_CONDITIONAL tests
+ # which are themselves conditionally expanded.
+ ## (Right now, this only matters for enable_wchar_t, but nothing prevents
+ ## other macros from doing the same. This should be automated.) -pme
need_libmath=no
enable_wchar_t=no
- #enable_debug=no
- #glibcxx_pch_comp=no
+ #enable_libstdcxx_debug=no
+ #enable_libstdcxx_pch=no
#enable_cheaders=c
#c_compatibility=no
#enable_abi_check=no
#enable_symvers=no
+ #enable_hosted_libstdcxx=yes
- # Find platform-specific directories containing configuration info. In
- # addition to possibly modifying the same flags, it also sets up symlinks.
+ # Find platform-specific directories containing configuration info.
+ # Also possibly modify flags used elsewhere, as needed by the platform.
GLIBCXX_CHECK_HOST
])
-dnl
-dnl Check to see if g++ can compile this library, and if so, if any version-
-dnl specific precautions need to be taken.
-dnl
-dnl GLIBCXX_CHECK_COMPILER_VERSION
-AC_DEFUN(GLIBCXX_CHECK_COMPILER_VERSION, [
-if test ! -f stamp-sanity-compiler; then
- AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE(, [
- #if __GNUC__ < 3
- not_ok
- #endif
- ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
- AC_LANG_RESTORE
- AC_MSG_RESULT($gpp_satisfactory)
- touch stamp-sanity-compiler
-fi
-])
+m4_include([linkage.m4])
+m4_include([../config/no-executables.m4])
dnl
@@ -245,14 +186,13 @@ dnl Tests for newer compiler features, or features that are present in newer
dnl compiler versions but not older compiler versions still in use, should
dnl be placed here.
dnl
-dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
-dnl new inlining code or the new system_header pragma will die on -Werror.
-dnl Leave it out by default and use maint-mode to use it.
+dnl Defines:
+dnl WERROR='-Werror' if requested and possible; g++'s that lack the
+dnl new inlining code or the new system_header pragma will die on -Werror.
+dnl Leave it out by default and use maint-mode to use it.
+dnl SECTION_FLAGS='-ffunction-sections -fdata-sections' if
+dnl compiler supports it and the user has not requested debug mode.
dnl
-dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
-dnl compiler supports it and the user has not requested debug mode.
-dnl
-dnl GLIBCXX_CHECK_COMPILER_FEATURES
AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
# All these tests are for C++; save the language and the compiler flags.
# The CXXFLAGS thing is suspicious, but based on similar bits previously
@@ -272,8 +212,7 @@ AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
# Check for -ffunction-sections -fdata-sections
AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
- AC_TRY_COMPILE(, [int foo;
- ], [ac_fdsections=yes], [ac_fdsections=no])
+ AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no])
if test "$ac_test_CXXFLAGS" = set; then
CXXFLAGS="$ac_save_CXXFLAGS"
else
@@ -296,13 +235,17 @@ dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
dnl the native linker is in use, all variables will be defined to something
dnl safe (like an empty string).
dnl
-dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
-dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
-dnl Define LD, with_gnu_ld, and (possibly) glibcxx_gnu_ld_version as
-dnl side-effects of testing. The last will be a single integer, e.g.,
-dnl version 1.23.45.0.67.89 will set glibcxx_gnu_ld_version to 12345.
+dnl Defines:
+dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible
+dnl OPT_LDFLAGS='-Wl,-O1' if possible
+dnl LD (as a side effect of testing)
+dnl Sets:
+dnl with_gnu_ld
+dnl glibcxx_gnu_ld_version (possibly)
+dnl
+dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
+dnl set glibcxx_gnu_ld_version to 12345. Zeros cause problems.
dnl
-dnl GLIBCXX_CHECK_LINKER_FEATURES
AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
# If we're not using GNU ld, then there's no point in even trying these
# tests. Check for that first. We should have already tested for gld
@@ -310,6 +253,7 @@ AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
AC_REQUIRE([AC_PROG_LD])
+ AC_REQUIRE([AC_PROG_AWK])
# The name set by libtool depends on the version of libtool. Shame on us
# for depending on an impl detail, but c'est la vie. Older versions used
@@ -346,12 +290,12 @@ AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
CFLAGS='-x c++ -Wl,--gc-sections'
# Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
AC_TRY_RUN([
int main(void)
@@ -384,533 +328,18 @@ AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
dnl
-dnl Check to see if the (math function) argument passed is
-dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with ONE parameter
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_1
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_1, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>
- #ifdef HAVE_IEEEFP_H
- #include <ieeefp.h>
- #endif
- ],
- [ $1(0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl 3) if not, see if 1) and 2) for argument prepended with '_'
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with ONE parameter
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, [
- GLIBCXX_CHECK_MATH_DECL_1($1)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- else
- GLIBCXX_CHECK_MATH_DECL_1(_$1)
- if test x$glibcxx_cv_func__$1_use = x"yes"; then
- AC_CHECK_FUNCS(_$1)
- fi
- fi
-])
-
-
-dnl
-dnl Like GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
-dnl of functions at once. It's an all-or-nothing check -- either
-dnl HAVE_XYZ is defined for each of the functions, or for none of them.
-dnl Doing it this way saves significant configure time.
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1, [
- AC_MSG_CHECKING([for $1 functions])
- AC_CACHE_VAL(glibcxx_cv_func_$2_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ `for x in $3; do echo "$x (0);"; done` ],
- [glibcxx_cv_func_$2_use=yes],
- [glibcxx_cv_func_$2_use=no])
- AC_LANG_RESTORE])
- AC_MSG_RESULT($glibcxx_cv_func_$2_use)
- if test x$glibcxx_cv_func_$2_use = x"yes"; then
- AC_CHECK_FUNCS($3)
- fi
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with TWO parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_2
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_2, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ $1(0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with TWO parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2, [
- GLIBCXX_CHECK_MATH_DECL_2($1)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- else
- GLIBCXX_CHECK_MATH_DECL_2(_$1)
- if test x$glibcxx_cv_func__$1_use = x"yes"; then
- AC_CHECK_FUNCS(_$1)
- fi
- fi
-])
-
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with THREE parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_3
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_3, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ $1(0, 0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with THREE parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3, [
- GLIBCXX_CHECK_MATH_DECL_3($1)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- else
- GLIBCXX_CHECK_MATH_DECL_3(_$1)
- if test x$glibcxx_cv_func__$1_use = x"yes"; then
- AC_CHECK_FUNCS(_$1)
- fi
- fi
-])
-
-
-dnl
-dnl Check to see if the (stdlib function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with TWO parameters
-dnl
-dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2
-AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <stdlib.h>],
- [ $1(0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- fi
-])
-
-
-dnl
-dnl Check to see if the (stdlib function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a function with THREE parameters
-dnl
-dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3
-AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <stdlib.h>],
- [ $1(0, 0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- fi
-])
-
-dnl
-dnl Because the builtins are picky picky picky about the arguments they take,
-dnl do an explict linkage tests here.
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with ONE parameter
-dnl
-dnl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
-AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ $1(0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_MSG_CHECKING([for $1 linkage])
- if test x${glibcxx_cv_func_$1_link+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_link, [
- AC_TRY_LINK([#include <math.h>],
- [ $1(0);],
- [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no])
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_link)
- if test x$glibcxx_cv_func_$1_link = x"yes"; then
- ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- AC_DEFINE_UNQUOTED(${ac_tr_func})
- fi
- fi
-])
-
-
-dnl
-dnl Check to see what builtin math functions are supported
-dnl
-dnl check for __builtin_abs
-dnl check for __builtin_fabsf
-dnl check for __builtin_fabs
-dnl check for __builtin_fabl
-dnl check for __builtin_labs
-dnl check for __builtin_sqrtf
-dnl check for __builtin_sqrtl
-dnl check for __builtin_sqrt
-dnl check for __builtin_sinf
-dnl check for __builtin_sin
-dnl check for __builtin_sinl
-dnl check for __builtin_cosf
-dnl check for __builtin_cos
-dnl check for __builtin_cosl
-dnl
-dnl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT, [
- dnl Test for builtin math functions.
- dnl These are made in gcc/c-common.c
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
-
- dnl There is, without a doubt, a more elegant way to have these
- dnl names exported so that they won't be stripped out of acconfig.h by
- dnl autoheader. I leave this as an exercise to somebody less frustrated
- dnl than I.... please email the libstdc++ list if you can figure out a
- dnl more elegant approach (see autoconf/acgen.m4 and specifically
- dnl AC_CHECK_FUNC for things to steal.)
- dummyvar=no
- if test x$dummyvar = x"yes"; then
- AC_DEFINE(HAVE___BUILTIN_ABS)
- AC_DEFINE(HAVE___BUILTIN_LABS)
- AC_DEFINE(HAVE___BUILTIN_COS)
- AC_DEFINE(HAVE___BUILTIN_COSF)
- AC_DEFINE(HAVE___BUILTIN_COSL)
- AC_DEFINE(HAVE___BUILTIN_FABS)
- AC_DEFINE(HAVE___BUILTIN_FABSF)
- AC_DEFINE(HAVE___BUILTIN_FABSL)
- AC_DEFINE(HAVE___BUILTIN_SIN)
- AC_DEFINE(HAVE___BUILTIN_SINF)
- AC_DEFINE(HAVE___BUILTIN_SINL)
- AC_DEFINE(HAVE___BUILTIN_SQRT)
- AC_DEFINE(HAVE___BUILTIN_SQRTF)
- AC_DEFINE(HAVE___BUILTIN_SQRTL)
- fi
-])
-
-dnl
-dnl Check to see what the underlying c library is like
-dnl These checks need to do two things:
-dnl 1) make sure the name is declared when using the c++ compiler
-dnl 2) make sure the name has "C" linkage
-dnl This might seem like overkill but experience has shown that it's not...
-dnl
-dnl Define HAVE_STRTOLD if "strtold" is declared and links
-dnl Define HAVE_STRTOF if "strtof" is declared and links
-dnl Define HAVE_DRAND48 if "drand48" is declared and links
-dnl
-dnl GLIBCXX_CHECK_STDLIB_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
-
- GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
- GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
- AC_CHECK_FUNCS(drand48)
-
- CXXFLAGS="$ac_save_CXXFLAGS"
-])
-
-dnl
-dnl Check to see what the underlying c library or math library is like.
-dnl These checks need to do two things:
-dnl 1) make sure the name is declared when using the c++ compiler
-dnl 2) make sure the name has "C" linkage
-dnl This might seem like overkill but experience has shown that it's not...
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is found.
-dnl
-dnl GLIBCXX_CHECK_MATH_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_MATH_SUPPORT, [
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
-
- dnl Check libm
- AC_CHECK_LIB(m, sin, libm="-lm")
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libm"
-
- dnl Check to see if certain C math functions exist.
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
-
- dnl Check to see if basic C math functions have float versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
- float_trig,
- acosf asinf atanf \
- cosf sinf tanf \
- coshf sinhf tanhf)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
- float_round,
- ceilf floorf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
-
- dnl Check to see if basic C math functions have long double versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
- long_double_trig,
- acosl asinl atanl \
- cosl sinl tanl \
- coshl sinhl tanhl)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
- long_double_round,
- ceill floorl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
-
- dnl Some runtimes have these functions with a preceding underscore. Please
- dnl keep this sync'd with the one above. And if you add any new symbol,
- dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
- dnl Check to see if certain C math functions exist.
-
- dnl Check to see if basic C math functions have float versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
- _float_trig,
- _acosf _asinf _atanf \
- _cosf _sinf _tanf \
- _coshf _sinhf _tanhf)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
- _float_round,
- _ceilf _floorf)
-
- dnl Check to see if basic C math functions have long double versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
- _long_double_trig,
- _acosl _asinl _atanl \
- _cosl _sinl _tanl \
- _coshl _sinhl _tanhl)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
- _long_double_round,
- _ceill _floorl)
-
- LIBS="$ac_save_LIBS"
- CXXFLAGS="$ac_save_CXXFLAGS"
-])
-
-
-dnl
-dnl Check to see if there is native support for complex
-dnl
-dnl Don't compile bits in math/* if native support exits.
-dnl
-dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
-dnl
-dnl GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT, [
- dnl Check for complex versions of math functions of platform. This will
- dnl always pass if libm is available, and fail if it isn't. If it is
- dnl available, we assume we'll need it later, so add it to LIBS.
- AC_CHECK_LIB(m, main)
- AC_REPLACE_MATHFUNCS(nan copysignf)
-
- dnl For __signbit to signbit conversions.
- AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
- AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
-
- dnl Compile the long double complex functions only if the function
- dnl provides the non-complex long double functions that are needed.
- dnl Currently this includes copysignl, which should be
- dnl cached from the GLIBCXX_CHECK_MATH_SUPPORT macro, above.
- if test x$ac_cv_func_copysignl = x"yes"; then
- AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
- fi
-
- if test -n "$LIBMATHOBJS"; then
- need_libmath=yes
- fi
- AC_SUBST(LIBMATHOBJS)
-])
-
-
-dnl Check to see what architecture and operating system we are compiling
-dnl for. Also, if architecture- or OS-specific flags are required for
-dnl compilation, pick them up here.
-dnl
-dnl GLIBCXX_CHECK_HOST
-AC_DEFUN(GLIBCXX_CHECK_HOST, [
- . [$]{glibcxx_basedir}/configure.host
- AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
- AC_MSG_RESULT(OS config directory is $os_include_dir)
-])
-
-
-dnl
-dnl Check to see if this target can enable the wchar_t parts of libstdc++.
+dnl Check to see if this target can enable the wchar_t parts.
dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
-dnl must have been previously checked.)
+dnl must have been previously checked.) By default, wide characters are
+dnl disabled.
dnl
-dnl Define _GLIBCXX_USE_WCHAR_T if all the bits are found
-dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
+dnl Defines:
+dnl HAVE_MBSTATE_T if mbstate_t is not in wchar.h
+dnl _GLIBCXX_USE_WCHAR_T if all the bits are found.
dnl
-dnl GLIBCXX_CHECK_WCHAR_T_SUPPORT
AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
- dnl Wide characters disabled by default.
-
- dnl Test wchar.h for mbstate_t, which is needed for char_traits and
- dnl others even if wchar_t support is not on.
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
AC_MSG_CHECKING([for mbstate_t])
AC_TRY_COMPILE([#include <wchar.h>],
[mbstate_t teststate;],
@@ -920,25 +349,25 @@ AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
AC_DEFINE(HAVE_MBSTATE_T)
fi
- dnl Sanity check for existence of ISO C99 headers for extended encoding.
+ # Sanity check for existence of ISO C99 headers for extended encoding.
AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
- dnl Only continue checking if the ISO C99 headers exist and support is on.
+ # Only continue checking if the ISO C99 headers exist and support is on.
if test x"$ac_has_wchar_h" = xyes &&
test x"$ac_has_wctype_h" = xyes &&
test x"$enable_c_mbchar" != xno; then
- dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
- dnl numeric_limits can instantiate type_traits<wchar_t>
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
AC_TRY_COMPILE([#include <wchar.h>],
[int i = WCHAR_MIN; int j = WCHAR_MAX;],
has_wchar_minmax=yes, has_wchar_minmax=no)
AC_MSG_RESULT($has_wchar_minmax)
- dnl Test wchar.h for WEOF, which is what we use to determine whether
- dnl to specialize for char_traits<wchar_t> or not.
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
AC_MSG_CHECKING([for WEOF])
AC_TRY_COMPILE([
#include <wchar.h>
@@ -947,284 +376,639 @@ AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
has_weof=yes, has_weof=no)
AC_MSG_RESULT($has_weof)
- dnl Tests for wide character functions used in char_traits<wchar_t>.
+ # Tests for wide character functions used in char_traits<wchar_t>.
ac_wfuncs=yes
- AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
- ac_wfuncs=no)
+ AC_CHECK_FUNCS([wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset],
+ [],[ac_wfuncs=no])
- dnl Checks for names injected into std:: by the c_std headers.
- AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
+ # Checks for names injected into std:: by the c_std headers.
+ AC_CHECK_FUNCS([btowc wctob fgetwc fgetws fputwc fputws fwide \
fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
- ac_wfuncs=no)
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr],
+ [],[ac_wfuncs=no])
AC_MSG_CHECKING([for ISO C99 wchar_t support])
if test x"$has_weof" = xyes &&
test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
+ test x"$ac_wfuncs" = xyes;
+ then
ac_isoC99_wchar_t=yes
else
ac_isoC99_wchar_t=no
fi
AC_MSG_RESULT($ac_isoC99_wchar_t)
- dnl Use iconv for wchar_t to char conversions. As such, check for
- dnl X/Open Portability Guide, version 2 features (XPG2).
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
- dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
ac_save_LIBS="$LIBS"
LIBS="$LIBS $libiconv"
- AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
- ac_XPG2funcs=yes, ac_XPG2funcs=no)
+ AC_CHECK_FUNCS([iconv_open iconv_close iconv nl_langinfo],
+ [ac_XPG2funcs=yes], [ac_XPG2funcs=no])
LIBS="$ac_save_LIBS"
AC_MSG_CHECKING([for XPG2 wchar_t support])
if test x"$ac_has_iconv_h" = xyes &&
test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
+ test x"$ac_XPG2funcs" = xyes;
+ then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
AC_MSG_RESULT($ac_XPG2_wchar_t)
- dnl At the moment, only enable wchar_t specializations if all the
- dnl above support is present.
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
AC_DEFINE(_GLIBCXX_USE_WCHAR_T)
enable_wchar_t=yes
fi
fi
AC_MSG_CHECKING([for enabled wchar_t specializations])
- AC_MSG_RESULT($enable_wchar_t)
+ AC_MSG_RESULT($enable_wchar_t)
])
dnl
-dnl Check to see if debugging libraries are to be built.
+dnl Check for headers for, and arguments to, the setrlimit() function.
+dnl Used only in testsuite_hooks.h. Called from GLIBCXX_CONFIGURE_TESTSUITE.
dnl
-dnl GLIBCXX_ENABLE_DEBUG
+dnl Defines:
+dnl _GLIBCXX_MEM_LIMITS if we can set artificial limits on memory
+dnl various HAVE_MEMLIMIT_* for individual limit names
dnl
-dnl --enable-libstdcxx-debug
-dnl builds a separate set of debugging libraries in addition to the
-dnl normal (shared, static) libstdc++ binaries.
+AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
+ AC_TRY_COMPILE(
+ [#include <unistd.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ],
+ [ int f = RLIMIT_$1 ; ],
+ [glibcxx_mresult=1], [glibcxx_mresult=0])
+ AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
+ [Only used in build directory testsuite_hooks.h.])
+])
+
+AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
+ setrlimit_have_headers=yes
+ AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
+ [],
+ [setrlimit_have_headers=no])
+ # If don't have the headers, then we can't run the tests now, and we
+ # won't be seeing any of these during testsuite compilation.
+ if test $setrlimit_have_headers = yes; then
+ # Can't do these in a loop, else the resulting syntax is wrong.
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
+
+ # Check for rlimit, setrlimit.
+ AC_CACHE_VAL(ac_setrlimit, [
+ AC_TRY_COMPILE(
+ [#include <unistd.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ],
+ [struct rlimit r;
+ setrlimit(0, &r);],
+ [ac_setrlimit=yes], [ac_setrlimit=no])
+ ])
+ fi
+
+ AC_MSG_CHECKING([for testsuite memory limit support])
+ if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
+ ac_mem_limits=yes
+ AC_DEFINE(_GLIBCXX_MEM_LIMITS)
+ else
+ ac_mem_limits=no
+ fi
+ AC_MSG_RESULT($ac_mem_limits)
+])
+
+
dnl
-dnl --disable-libstdcxx-debug
-dnl builds only one (non-debug) version of libstdc++.
+dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
+dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately.
dnl
-dnl --enable-libstdcxx-debug-flags=FLAGS
-dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
+AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
+ AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
+ AC_TRY_LINK(
+ [#include <sys/stat.h>],
+ [struct stat buffer;
+ fstat(0, &buffer);
+ S_ISREG(buffer.st_mode);],
+ [glibcxx_cv_S_ISREG=yes],
+ [glibcxx_cv_S_ISREG=no])
+ ])
+ AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
+ AC_TRY_LINK(
+ [#include <sys/stat.h>],
+ [struct stat buffer;
+ fstat(0, &buffer);
+ S_IFREG & buffer.st_mode;],
+ [glibcxx_cv_S_IFREG=yes],
+ [glibcxx_cv_S_IFREG=no])
+ ])
+ if test $glibcxx_cv_S_ISREG = yes; then
+ AC_DEFINE(HAVE_S_ISREG)
+ elif test $glibcxx_cv_S_IFREG = yes; then
+ AC_DEFINE(HAVE_S_IFREG)
+ fi
+])
+
+
dnl
-dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'.
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [dnl
-define([GLIBCXX_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(libstdcxx_debug,
-changequote(<<, >>)dnl
-<< --enable-libstdcxx-debug build extra debug library [default=>>GLIBCXX_ENABLE_DEBUG_DEFAULT],
-changequote([, ])dnl
-[case "${enableval}" in
- yes) enable_libstdcxx_debug=yes ;;
- no) enable_libstdcxx_debug=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
- esac],
-enable_libstdcxx_debug=GLIBCXX_ENABLE_DEBUG_DEFAULT)dnl
-AC_MSG_CHECKING([for additional debug build])
-AC_MSG_RESULT($enable_libstdcxx_debug)
-AM_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test "$enable_libstdcxx_debug" = yes)
+dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
+dnl
+AC_DEFUN(GLIBCXX_CHECK_POLL, [
+ AC_CACHE_VAL(glibcxx_cv_POLL, [
+ AC_TRY_COMPILE(
+ [#include <poll.h>],
+ [struct pollfd pfd[1];
+ pfd[0].events = POLLIN;
+ poll(pfd, 1, 0);],
+ [glibcxx_cv_POLL=yes],
+ [glibcxx_cv_POLL=no])
+ ])
+ if test $glibcxx_cv_POLL = yes; then
+ AC_DEFINE(HAVE_POLL)
+ fi
])
-dnl Check for explicit debug flags.
dnl
-dnl GLIBCXX_ENABLE_DEBUG_FLAGS
+dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
dnl
-dnl --enable-libstdcxx-debug-flags='-O1'
-dnl is a general method for passing flags to be used when
-dnl building debug libraries with --enable-debug.
+AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
+ AC_CACHE_VAL(glibcxx_cv_WRITEV, [
+ AC_TRY_COMPILE(
+ [#include <sys/uio.h>],
+ [struct iovec iov[2];
+ writev(0, iov, 0);],
+ [glibcxx_cv_WRITEV=yes],
+ [glibcxx_cv_WRITEV=no])
+ ])
+ if test $glibcxx_cv_WRITEV = yes; then
+ AC_DEFINE(HAVE_WRITEV)
+ fi
+])
+
+
dnl
-dnl --disable-libstdcxx-debug-flags does nothing.
-dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
-dnl If "default flags" is an empty string (or "none"), the effect is
-dnl the same as --disable or --enable=no.
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [dnl
-define([GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
-AC_ARG_ENABLE(libstdcxx_debug_flags,
-changequote(<<, >>)dnl
-<< --enable-libstdcxx-debug-flags=FLAGS pass compiler FLAGS when building
- debug library;
- [default=>>GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT],
-changequote([, ])dnl
-[case "${enableval}" in
- none) ;;
- -*) enable_libstdcxx_debug_flags="${enableval}" ;;
- *) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
- esac],
-enable_libstdcxx_debug_flags=GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
-
-dnl Option parsed, now set things appropriately
-case x"$enable_libstdcxx_debug" in
- xyes)
- case "$enable_libstdcxx_debug_flags" in
- none)
- DEBUG_FLAGS="-g3 -O0";;
- -*) #valid input
- DEBUG_FLAGS="${enableval}"
- esac
- ;;
- xno)
- DEBUG_FLAGS=""
- ;;
-esac
-AC_SUBST(DEBUG_FLAGS)
+dnl Does any necessary configuration of the testsuite directory. Generates
+dnl the testsuite_hooks.h header.
+dnl
+dnl GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE must be done before this.
+dnl
+dnl Sets:
+dnl enable_abi_check / GLIBCXX_TEST_ABI
+dnl Substs:
+dnl baseline_dir
+dnl
+AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
+ if $GLIBCXX_IS_NATIVE && test $is_hosted = yes; then
+ # Do checks for memory limit functions.
+ GLIBCXX_CHECK_SETRLIMIT
+
+ # Look for setenv, so that extended locale tests can be performed.
+ GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+
+ if test $enable_symvers = no; then
+ enable_abi_check=no
+ else
+ case "$host" in
+ *-*-cygwin*)
+ enable_abi_check=no ;;
+ *)
+ enable_abi_check=yes ;;
+ esac
+ fi
+ else
+ # Only build this as native, since automake does not understand
+ # CXX_FOR_BUILD.
+ enable_abi_check=no
+ fi
+
+ # Export file names for ABI checking.
+ baseline_dir="$glibcxx_srcdir/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
+ AC_SUBST(baseline_dir)
-AC_MSG_CHECKING([for debug build flags])
-AC_MSG_RESULT($DEBUG_FLAGS)
+ GLIBCXX_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test $enable_wchar_t = yes)
+ GLIBCXX_CONDITIONAL(GLIBCXX_TEST_ABI, test $enable_abi_check = yes)
])
dnl
-dnl Check for "unusual" flags to pass to the compiler while building.
+dnl Set up *_INCLUDES variables for all sundry Makefile.am's.
dnl
-dnl GLIBCXX_ENABLE_CXX_FLAGS
-dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
-dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
-dnl Somehow this same set of flags must be passed when [re]building
-dnl libgcc.
-dnl --disable-cxx-flags passes nothing.
-dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
-dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
-dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
-dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags)
-dnl If "default flags" is an empty string (or "none"), the effect is
-dnl the same as --disable or --enable=no.
-AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
-define([GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
-AC_MSG_CHECKING([for extra compiler flags for building])
-AC_ARG_ENABLE(cxx_flags,
-changequote(<<, >>)dnl
-<< --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
- [default=>>GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT],
-changequote([, ])dnl
-[case "x$enable_cxx_flags" in
- xyes)
- AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
- xno | xnone | x)
- enable_cxx_flags='' ;;
- *)
- enable_cxx_flags="$enableval" ;;
-esac],
-enable_cxx_flags=GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT)
-
-dnl Run through flags (either default or command-line) and set anything
-dnl extra (e.g., #defines) that must accompany particular g++ options.
-if test -n "$enable_cxx_flags"; then
- for f in $enable_cxx_flags; do
- case "$f" in
- -fhonor-std) ;;
- -*) ;;
- *) # and we're trying to pass /what/ exactly?
- AC_MSG_ERROR([compiler flags start with a -]) ;;
+dnl Substs:
+dnl GLIBCXX_INCLUDES
+dnl TOPLEVEL_INCLUDES
+dnl
+AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
+ # Used for every C++ compile we perform.
+ GLIBCXX_INCLUDES="\
+-I$glibcxx_builddir/include/$host_alias \
+-I$glibcxx_builddir/include \
+-I$glibcxx_srcdir/libsupc++"
+
+ # For Canadian crosses, pick this up too.
+ if test $CANADIAN = yes; then
+ GLIBCXX_INCLUDES="$GLIBCXX_INCLUDES -I\${includedir}"
+ fi
+
+ # Stuff in the actual top level. Currently only used by libsupc++ to
+ # get unwind* headers from the gcc dir.
+ #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
+ TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
+
+ # Now, export this to all the little Makefiles....
+ AC_SUBST(GLIBCXX_INCLUDES)
+ AC_SUBST(TOPLEVEL_INCLUDES)
+])
+
+
+dnl
+dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
+dnl (SECTION_FLAGS is done under CHECK_COMPILER_FEATURES.)
+dnl
+dnl Substs:
+dnl OPTIMIZE_CXXFLAGS
+dnl WARN_FLAGS
+dnl
+AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
+ # Optimization flags that are probably a good idea for thrill-seekers. Just
+ # uncomment the lines below and make, everything else is ready to go...
+ # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
+ OPTIMIZE_CXXFLAGS=
+ AC_SUBST(OPTIMIZE_CXXFLAGS)
+
+ WARN_FLAGS='-Wall -W -Wwrite-strings -Wcast-qual'
+ AC_SUBST(WARN_FLAGS)
+])
+
+
+dnl
+dnl All installation directory information is determined here.
+dnl
+dnl Substs:
+dnl gxx_install_dir
+dnl glibcxx_prefixdir
+dnl glibcxx_toolexecdir
+dnl glibcxx_toolexeclibdir
+dnl
+dnl Assumes cross_compiling bits already done, and with_cross_host in
+dnl particular.
+dnl
+AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
+ glibcxx_toolexecdir=no
+ glibcxx_toolexeclibdir=no
+ glibcxx_prefixdir=$prefix
+
+ AC_MSG_CHECKING([for gxx-include-dir])
+ AC_ARG_WITH([gxx-include-dir],
+ AC_HELP_STRING([--with-gxx-include-dir=DIR],
+ [installation directory for include files]),
+ [case "$withval" in
+ yes) AC_MSG_ERROR([Missing directory for --with-gxx-include-dir]) ;;
+ no) gxx_include_dir=no ;;
+ *) gxx_include_dir=$withval ;;
+ esac],
+ [gxx_include_dir=no])
+ AC_MSG_RESULT($gxx_include_dir)
+
+ AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+ AC_ARG_ENABLE([version-specific-runtime-libs],
+ AC_HELP_STRING([--enable-version-specific-runtime-libs],
+ [Specify that runtime libraries should be installed in a compiler-specific directory]),
+ [case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+ [version_specific_libs=no])
+ AC_MSG_RESULT($version_specific_libs)
+
+ # Default case for install directory for include files.
+ if test $version_specific_libs = no && test $gxx_include_dir = no; then
+ gxx_include_dir='${prefix}'/include/c++/${gcc_version}
+ fi
+
+ # Version-specific runtime libs processing.
+ if test $version_specific_libs = yes; then
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ if test x"$gxx_include_dir" = x"no"; then
+ gxx_include_dir='${libdir}/gcc-lib/${host_alias}/'$gcc_version/include/c++
+ fi
+ glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+ glibcxx_toolexeclibdir='${toolexecdir}/'$gcc_version'$(MULTISUBDIR)'
+ fi
+
+ # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ if test x"$glibcxx_toolexecdir" = x"no"; then
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
+ glibcxx_toolexeclibdir='${toolexecdir}/lib'
+ else
+ glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+ glibcxx_toolexeclibdir='${libdir}'
+ fi
+ multi_os_directory=`$CXX -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
esac
- done
-fi
-EXTRA_CXX_FLAGS="$enable_cxx_flags"
-AC_MSG_RESULT($EXTRA_CXX_FLAGS)
-AC_SUBST(EXTRA_CXX_FLAGS)
+ fi
+
+ AC_MSG_CHECKING([for install location])
+ AC_MSG_RESULT($gxx_include_dir)
+
+ AC_SUBST(glibcxx_prefixdir)
+ AC_SUBST(gxx_include_dir)
+ AC_SUBST(glibcxx_toolexecdir)
+ AC_SUBST(glibcxx_toolexeclibdir)
+])
+
+
+dnl
+dnl GLIBCXX_ENABLE
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
+dnl
+dnl See docs/html/17_intro/configury.html#enable for documentation.
+dnl
+m4_define([GLIBCXX_ENABLE],[dnl
+m4_define([_g_switch],[--enable-$1])dnl
+m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
+ AC_ARG_ENABLE($1,_g_help,
+ m4_bmatch([$5],
+ [^permit ],
+ [[
+ case "$enableval" in
+ m4_bpatsubst([$5],[permit ])) ;;
+ *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
+ dnl Idea for future: generate a URL pointing to
+ dnl "onlinedocs/configopts.html#whatever"
+ esac
+ ]],
+ [^$],
+ [[
+ case "$enableval" in
+ yes|no) ;;
+ *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
+ esac
+ ]],
+ [[$5]]),
+ [enable_]m4_bpatsubst([$1],-,_)[=][$2])
+m4_undefine([_g_switch])dnl
+m4_undefine([_g_help])dnl
+])
+
+
+dnl
+dnl Check for ISO/IEC 9899:1999 "C99" support.
+dnl
+dnl --enable-c99 defines _GLIBCXX_USE_C99
+dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
+dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
+dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_C99, [
+ GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support])
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ # Check for the existence of <math.h> functions used if C99 is enabled.
+ ac_c99_math=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <math.h>])
+ AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [islessgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isunordered(0.0,0.0);],, [ac_c99_math=no])
+ AC_MSG_RESULT($ac_c99_math)
+
+ # Check for the existence in <stdio.h> of vscanf, et. al.
+ ac_c99_stdio=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vfscanf(stderr, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vscanf("%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsnprintf(fmt, 0, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsscanf(fmt, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_MSG_RESULT($ac_c99_stdio)
+
+ # Check for the existence in <stdlib.h> of lldiv_t, et. al.
+ ac_c99_stdlib=yes;
+ AC_MSG_CHECKING([for lldiv_t declaration])
+ AC_CACHE_VAL(ac_c99_lldiv_t, [
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [ lldiv_t mydivt;],
+ [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
+ ])
+ AC_MSG_RESULT($ac_c99_lldiv_t)
+
+ AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
+ if test x"$ac_c99_lldiv_t" = x"no"; then
+ ac_c99_stdlib=no;
+ fi;
+ AC_MSG_RESULT($ac_c99_stdlib)
+
+ # Check for the existence of <wchar.h> functions used if C99 is enabled.
+ # XXX the wchar.h checks should be rolled into the general C99 bits.
+ ac_c99_wchar=yes;
+ AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_MSG_RESULT($ac_c99_wchar)
+
+ AC_MSG_CHECKING([for enabled ISO C99 support])
+ if test x"$ac_c99_math" = x"no" ||
+ test x"$ac_c99_stdio" = x"no" ||
+ test x"$ac_c99_stdlib" = x"no" ||
+ test x"$ac_c99_wchar" = x"no"; then
+ enable_c99=no;
+ fi;
+ AC_MSG_RESULT($enable_c99)
+
+ # Option parsed, now set things appropriately
+ if test x"$enable_c99" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99)
+ fi
+
+ AC_LANG_RESTORE
])
dnl
-dnl Check for which locale library to use: gnu or generic.
+dnl Check for what type of C headers to use.
+dnl
+dnl --enable-cheaders= [does stuff].
+dnl --disable-cheaders [does not do anything, really].
+dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
+dnl Where DEFAULT is either `c' or `c_std'.
dnl
-dnl GLIBCXX_ENABLE_CLOCALE
-dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
-dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
+AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [
+ GLIBCXX_ENABLE(cheaders,$1,[=KIND],
+ [construct "C" headers for g++], [permit c|c_std])
+ AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
+
+ C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders
+
+ AC_SUBST(C_INCLUDE_DIR)
+ GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C, test $enable_cheaders = c)
+ GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test $enable_cheaders = c_std)
+ GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test $c_compatibility = yes)
+])
+
+
+dnl
+dnl Check for which locale library to use. The choice is mapped to
+dnl a subdirectory of config/locale.
dnl
-dnl default is generic
+dnl Default is generic.
dnl
AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
- AC_MSG_CHECKING([for clocale to use])
- AC_ARG_ENABLE(clocale,
- [ --enable-clocale enable model for target locale package.
- --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
- ],
- if test x$enable_clocale = xno; then
- enable_clocale=no
- fi,
- enable_clocale=no)
+ AC_MSG_CHECKING([for C locale to use])
+ GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
+ [use MODEL for target locale package],
+ [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
+
+ # If they didn't use this option switch, or if they specified --enable
+ # with no specific model, we'll have to look for one. If they
+ # specified --disable (???), do likewise.
+ if test $enable_clocale = no || test $enable_clocale = yes; then
+ enable_clocale=auto
+ fi
+ # Either a known package, or "auto"
enable_clocale_flag=$enable_clocale
- dnl Probe for locale support if no specific model is specified.
- dnl Default to "generic"
- if test x$enable_clocale_flag = xno; then
+ # Probe for locale support if no specific model is specified.
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
case x${target_os} in
xlinux* | xgnu*)
- AC_EGREP_CPP([_GLIBCXX_ok], [
+ AC_EGREP_CPP([_GLIBCXX_ok], [
#include <features.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
_GLIBCXX_ok
#endif
], enable_clocale_flag=gnu, enable_clocale_flag=generic)
- # Test for bugs early in glibc-2.2.x series
- if test x$enable_clocale_flag = xgnu; then
- AC_TRY_RUN([
- #define _GNU_SOURCE 1
- #include <locale.h>
- #include <string.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- extern __typeof(newlocale) __newlocale;
- extern __typeof(duplocale) __duplocale;
- extern __typeof(strcoll_l) __strcoll_l;
- #endif
- int main()
- {
- const char __one[] = "Äuglein Augmen";
- const char __two[] = "Äuglein";
- int i;
- int j;
- __locale_t loc;
- __locale_t loc_dup;
- loc = __newlocale(1 << LC_ALL, "de_DE", 0);
- loc_dup = __duplocale(loc);
- i = __strcoll_l(__one, __two, loc);
- j = __strcoll_l(__one, __two, loc_dup);
- return 0;
- }
- ],
- [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
- [enable_clocale_flag=generic])
- fi
-
- # ... at some point put __strxfrm_l tests in as well.
+ # Test for bugs early in glibc-2.2.x series
+ if test x$enable_clocale_flag = xgnu; then
+ AC_TRY_RUN([
+ #define _GNU_SOURCE 1
+ #include <locale.h>
+ #include <string.h>
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ extern __typeof(newlocale) __newlocale;
+ extern __typeof(duplocale) __duplocale;
+ extern __typeof(strcoll_l) __strcoll_l;
+ #endif
+ int main()
+ {
+ const char __one[] = "Äuglein Augmen";
+ const char __two[] = "Äuglein";
+ int i;
+ int j;
+ __locale_t loc;
+ __locale_t loc_dup;
+ loc = __newlocale(1 << LC_ALL, "de_DE", 0);
+ loc_dup = __duplocale(loc);
+ i = __strcoll_l(__one, __two, loc);
+ j = __strcoll_l(__one, __two, loc_dup);
+ return 0;
+ }
+ ],
+ [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
+ [enable_clocale_flag=generic])
+ fi
+
+ # ... at some point put __strxfrm_l tests in as well.
;;
*)
- enable_clocale_flag=generic
- ;;
+ enable_clocale_flag=generic
+ ;;
esac
fi
- dnl Deal with gettext issues.
- AC_ARG_ENABLE(nls,
- [ --enable-nls use Native Language Support (default)],
- , enable_nls=yes)
+ # Deal with gettext issues. Default to not using it (=no) until we detect
+ # support for it later. Let the user turn it off via --e/d, but let that
+ # default to on for easier handling.
USE_NLS=no
+ AC_ARG_ENABLE(nls,
+ AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
+ [],
+ [enable_nls=yes])
- dnl Set configure bits for specified locale package
- case x${enable_clocale_flag} in
- xgeneric)
+ # Set configure bits for specified locale package
+ case ${enable_clocale_flag} in
+ generic)
AC_MSG_RESULT(generic)
CLOCALE_H=config/locale/generic/c_locale.h
@@ -1241,7 +1025,7 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
- xgnu)
+ gnu)
AC_MSG_RESULT(gnu)
# Declare intention to use gettext, and add support for specific
@@ -1252,7 +1036,7 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
# Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
- USE_NLS=yes
+ USE_NLS=yes
fi
# Export the build objects.
for ling in $ALL_LINGUAS; do \
@@ -1276,7 +1060,7 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
CTIME_CC=config/locale/gnu/time_members.cc
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;;
- xieee_1003.1-2001)
+ ieee_1003.1-2001)
AC_MSG_RESULT(IEEE 1003.1)
CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
@@ -1293,10 +1077,6 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
- *)
- echo "$enable_clocale is an unknown locale package" 1>&2
- exit 1
- ;;
esac
# This is where the testsuite looks for locale catalogs, using the
@@ -1331,38 +1111,41 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
dnl
-dnl Check for which I/O library to use: stdio, or something specific.
+dnl Check for whether the Boost-derived checks should be turned on.
dnl
-dnl GLIBCXX_ENABLE_CSTDIO
+dnl --enable-concept-checks turns them on.
+dnl --disable-concept-checks leaves them off.
+dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [
+ GLIBCXX_ENABLE(concept-checks,$1,,[use Boost-derived template checks])
+ if test $enable_concept_checks = yes; then
+ AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
+ fi
+])
+
+
+dnl
+dnl Check for which I/O library to use: stdio, or something specific.
dnl
-dnl default is stdio
+dnl Default is stdio.
dnl
AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
- AC_MSG_CHECKING([for cstdio to use])
- AC_ARG_ENABLE(cstdio,
- [ --enable-cstdio enable stdio for target io package.
- --enable-cstdio=LIB use LIB target-specific io package. [default=stdio]
- ],
- if test x$enable_cstdio = xno; then
- enable_cstdio=stdio
- fi,
- enable_cstdio=stdio)
-
- enable_cstdio_flag=$enable_cstdio
-
- dnl Check if a valid I/O package
- case x${enable_cstdio_flag} in
- xstdio | x | xno | xnone | xyes)
- # default
+ AC_MSG_CHECKING([for underlying I/O to use])
+ GLIBCXX_ENABLE(cstdio,stdio,[=PACKAGE],
+ [use target-specific I/O package], [permit stdio])
+
+ # Now that libio has been removed, you can have any color you want as long
+ # as it's black. This is one big no-op until other packages are added, but
+ # showing the framework never hurts.
+ case ${enable_cstdio} in
+ stdio)
CSTDIO_H=config/io/c_io_stdio.h
BASIC_FILE_H=config/io/basic_file_stdio.h
BASIC_FILE_CC=config/io/basic_file_stdio.cc
AC_MSG_RESULT(stdio)
;;
- *)
- echo "$enable_cstdio is an unknown io package" 1>&2
- exit 1
- ;;
esac
dnl Set directory for fpos.h
@@ -1376,176 +1159,169 @@ AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
dnl
-dnl Check to see if building and using a C++ precompiled header can be done.
-dnl
-dnl GLIBCXX_ENABLE_PCH
-dnl
-dnl --enable-libstdcxx-pch=yes
-dnl default, this shows intent to use stdc++.h.gch If it looks like it
-dnl may work, after some light-hearted attempts to puzzle out compiler
-dnl support, flip bits on in include/Makefile.am
+dnl Check for "unusual" flags to pass to the compiler while building.
dnl
-dnl --disable-libstdcxx-pch
-dnl turns off attempts to use or build stdc++.h.gch.
+dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
+dnl experimental flags such as -fpch, -fIMI, -Dfloat=char, etc.
+dnl --disable-cxx-flags passes nothing.
+dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
+dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
+dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
+dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags)
+dnl If "default flags" is an empty string, the effect is the same
+dnl as --disable or --enable=no.
dnl
-AC_DEFUN(GLIBCXX_ENABLE_PCH, [dnl
-define([GLIBCXX_ENABLE_PCH_DEFAULT], ifelse($1,,, $1))dnl
-AC_ARG_ENABLE(libstdcxx_pch,
-changequote(<<, >>)dnl
-<< --enable-libstdcxx-pch build pre-compiled libstdc++ includes [default=>>GLIBCXX_ENABLE_PCH_DEFAULT],
-changequote([, ])dnl
-[case "${enableval}" in
- yes) enable_libstdcxx_pch=yes ;;
- no) enable_libstdcxx_pch=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable PCH]) ;;
- esac],
-enable_libstdcxx_pch=GLIBCXX_ENABLE_PCH_DEFAULT)dnl
-
- if test x$enable_libstdcxx_pch = xyes; then
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
-
- AC_MSG_CHECKING([for compiler that seems to compile .gch files])
- if test x${pch_comp+set} != xset; then
- AC_CACHE_VAL(pch_comp, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>], ,
- [pch_comp=yes], [pch_comp=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT([$pch_comp])
-
- CXXFLAGS="$ac_save_CXXFLAGS"
+AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
+ AC_MSG_CHECKING([for extra compiler flags for building])
+ GLIBCXX_ENABLE(cxx-flags,$1,[=FLAGS],
+ [pass compiler FLAGS when building library],
+ [case "x$enable_cxx_flags" in
+ xno | x) enable_cxx_flags= ;;
+ x-*) ;;
+ *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
+ esac])
+
+ # Run through flags (either default or command-line) and set anything
+ # extra (e.g., #defines) that must accompany particular g++ options.
+ if test -n "$enable_cxx_flags"; then
+ for f in $enable_cxx_flags; do
+ case "$f" in
+ -fhonor-std) ;;
+ -*) ;;
+ *) # and we're trying to pass /what/ exactly?
+ AC_MSG_ERROR([compiler flags start with a -]) ;;
+ esac
+ done
fi
- if test x"$enable_libstdcxx_pch" = xyes && test x"$pch_comp" = xno; then
- enable_pch=no
- fi
+ EXTRA_CXX_FLAGS="$enable_cxx_flags"
+ AC_MSG_RESULT($EXTRA_CXX_FLAGS)
+ AC_SUBST(EXTRA_CXX_FLAGS)
+])
- AC_MSG_CHECKING([for enabled PCH])
- AC_MSG_RESULT([$enable_libstdcxx_pch])
- AM_CONDITIONAL(GLIBCXX_BUILD_PCH, test "$enable_libstdcxx_pch" = yes)
- if test "$enable_libstdcxx_pch" = yes; then
- glibcxx_PCHFLAGS="-include bits/stdc++.h"
- else
- glibcxx_PCHFLAGS=""
- fi
- AC_SUBST(glibcxx_PCHFLAGS)
+dnl
+dnl Check for wide character support. Has the same effect as the option
+dnl in gcc's configure, but in a form that autoconf can mess with.
+dnl
+dnl --enable-c-mbchar requests all the wchar_t stuff.
+dnl --disable-c-mbchar doesn't.
+dnl + Usage: GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [
+ GLIBCXX_ENABLE(c-mbchar,$1,,[enable multibyte (wide) characters])
+ # Option parsed, now other scripts can test enable_c_mbchar for yes/no.
])
+
dnl
-dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
-dnl We must stage the required headers so that they will be installed
-dnl with the library (unlike libgcc, the STL implementation is provided
-dnl solely within headers). Since we must not inject random user-space
-dnl macro names into user-provided C++ code, we first stage into <file>-in
-dnl and process to <file> with an output command. The reason for a two-
-dnl stage process here is to correctly handle $srcdir!=$objdir without
-dnl having to write complex code (the sed commands to clean the macro
-dnl namespace are complex and fragile enough as it is). We must also
-dnl add a relative path so that -I- is supported properly.
+dnl Check to see if debugging libraries are to be built.
dnl
-AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
- AC_MSG_CHECKING([for thread model used by GCC])
- target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
- AC_MSG_RESULT([$target_thread_file])
+dnl --enable-libstdcxx-debug
+dnl builds a separate set of debugging libraries in addition to the
+dnl normal (shared, static) libstdc++ binaries.
+dnl
+dnl --disable-libstdcxx-debug
+dnl builds only one (non-debug) version of libstdc++.
+dnl
+dnl --enable-libstdcxx-debug-flags=FLAGS
+dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
+dnl
+dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [
+ AC_MSG_CHECKING([for additional debug build])
+ GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library])
+ AC_MSG_RESULT($enable_libstdcxx_debug)
+ GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test $enable_libstdcxx_debug = yes)
+])
- if test $target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT)
- AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
- fi
- glibcxx_thread_h=gthr-$target_thread_file.h
- AC_SUBST(glibcxx_thread_h)
+dnl
+dnl Check for explicit debug flags.
+dnl
+dnl --enable-libstdcxx-debug-flags='-O1'
+dnl is a general method for passing flags to be used when
+dnl building debug libraries with --enable-debug.
+dnl
+dnl --disable-libstdcxx-debug-flags does nothing.
+dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
+dnl If "default flags" is an empty string, the effect is the same
+dnl as --disable or --enable=no.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [
+ GLIBCXX_ENABLE(libstdcxx-debug-flags,[$1],[=FLAGS],
+ [pass compiler FLAGS when building debug library],
+ [case "x$enable_libstdcxx_debug_flags" in
+ xno | x) enable_libstdcxx_debug_flags= ;;
+ x-*) ;;
+ *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
+ esac])
+
+ # Option parsed, now set things appropriately
+ DEBUG_FLAGS="$enable_libstdcxx_debug_flags"
+ AC_SUBST(DEBUG_FLAGS)
+
+ AC_MSG_NOTICE([Debug build flags set to $DEBUG_FLAGS])
])
dnl
-dnl Check for exception handling support. If an explicit enable/disable
-dnl sjlj exceptions is given, we don't have to detect. Otherwise the
-dnl target may or may not support call frame exceptions.
+dnl Check if the user only wants a freestanding library implementation.
dnl
-dnl GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
-dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
-dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
+dnl --disable-hosted-libstdcxx will turn off most of the library build,
+dnl installing only the headers required by [17.4.1.3] and the language
+dnl support library. More than that will be built (to keep the Makefiles
+dnl conveniently clean), but not installed.
dnl
-dnl Define _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it.
+dnl Sets:
+dnl is_hosted (yes/no)
dnl
-AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
- AC_MSG_CHECKING([for exception model to use])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_ARG_ENABLE(sjlj-exceptions,
- [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
- [:],
- [dnl Botheration. Now we've got to detect the exception model.
- dnl Link tests against libgcc.a are problematic since -- at least
- dnl as of this writing -- we've not been given proper -L bits for
- dnl single-tree newlib and libgloss.
- dnl
- dnl This is what AC_TRY_COMPILE would do if it didn't delete the
- dnl conftest files before we got a change to grep them first.
- cat > conftest.$ac_ext << EOF
-[#]line __oline__ "configure"
-struct S { ~S(); };
-void bar();
-void foo()
-{
- S s;
- bar();
-}
-EOF
- old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
- if AC_TRY_EVAL(ac_compile); then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
- fi
- CXXFLAGS="$old_CXXFLAGS"
- rm -f conftest*])
- if test x$enable_sjlj_exceptions = xyes; then
- AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
- [Define if the compiler is configured for setjmp/longjmp exceptions.])
- ac_exception_model_name=sjlj
- elif test x$enable_sjlj_exceptions = xno; then
- ac_exception_model_name="call frame"
- else
- AC_MSG_ERROR([unable to detect exception model])
- fi
- AC_LANG_RESTORE
- AC_MSG_RESULT($ac_exception_model_name)
+dnl Defines:
+dnl _GLIBCXX_HOSTED (always defined, either to 1 or 0)
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_HOSTED, [
+ AC_ARG_ENABLE([hosted-libstdcxx],
+ AC_HELP_STRING([--disable-hosted-libstdcxx],
+ [only build freestanding C++ runtime support]),,
+ [enable_hosted_libstdcxx=yes])
+ if test "$enable_hosted_libstdcxx" = no; then
+ AC_MSG_NOTICE([Only freestanding libraries will be built])
+ is_hosted=no
+ hosted_define=0
+ enable_abi_check=no
+ enable_libstdcxx_pch=no
+ else
+ is_hosted=yes
+ hosted_define=1
+ fi
+ GLIBCXX_CONDITIONAL(GLIBCXX_HOSTED, test $is_hosted = yes)
+ AC_DEFINE_UNQUOTED(_GLIBCXX_HOSTED, $hosted_define,
+ [Define to 1 if a full hosted library is built, or 0 if freestanding.])
])
dnl
-dnl Check for libunwind exception handling support. If enabled then
+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 libunwind instead of libgcc, and that libstdc++ has a dependency
dnl on libunwind as well as libgcc.
dnl
-dnl GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS
dnl --enable-libunwind-exceptions forces the use of libunwind.
dnl --disable-libunwind-exceptions assumes there is no libunwind.
dnl
-dnl Define _GLIBCXX_LIBUNWIND_EXCEPTIONS if requested.
+dnl Substs:
+dnl LIBUNWIND_FLAG
dnl
AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
AC_MSG_CHECKING([for use of libunwind])
- AC_ARG_ENABLE(libunwind-exceptions,
- [ --enable-libunwind-exceptions force use of libunwind for exceptions],
- use_libunwind_exceptions=$enableval,
- use_libunwind_exceptions=no)
+ GLIBCXX_ENABLE(libunwind-exceptions,no,,
+ [force use of libunwind for exceptions])
AC_MSG_RESULT($use_libunwind_exceptions)
- dnl Option parsed, now set things appropriately
- if test x"$use_libunwind_exceptions" = xyes; then
+ if test $enable_libunwind_exceptions = yes; then
LIBUNWIND_FLAG="-lunwind"
else
LIBUNWIND_FLAG=""
@@ -1553,167 +1329,20 @@ AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
AC_SUBST(LIBUNWIND_FLAG)
])
-dnl
-dnl Check for ISO/IEC 9899:1999 "C99" support.
-dnl
-dnl GLIBCXX_ENABLE_C99
-dnl --enable-c99 defines _GLIBCXX_USE_C99
-dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
-dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If omitted, it
-dnl defaults to `no'.
-dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
-dnl
-dnl GLIBCXX_ENABLE_C99
-AC_DEFUN(GLIBCXX_ENABLE_C99, [dnl
- define([GLIBCXX_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
-
- AC_ARG_ENABLE(c99,
- changequote(<<, >>)dnl
- <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCXX_ENABLE_C99_DEFAULT],
- changequote([, ])dnl
- [case "$enableval" in
- yes) enable_c99=yes ;;
- no) enable_c99=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
- esac],
- enable_c99=GLIBCXX_ENABLE_C99_DEFAULT)dnl
-
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
- # Check for the existence of <math.h> functions used if C99 is enabled.
- ac_c99_math=yes;
- AC_MSG_CHECKING([for ISO C99 support in <math.h>])
- AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [islessgreater(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [isunordered(0.0,0.0);],, [ac_c99_math=no])
- AC_MSG_RESULT($ac_c99_math)
-
- # Check for the existence in <stdio.h> of vscanf, et. al.
- ac_c99_stdio=yes;
- AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
- AC_TRY_COMPILE([#include <stdio.h>],
- [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vfscanf(stderr, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vscanf("%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsnprintf(fmt, 0, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsscanf(fmt, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_MSG_RESULT($ac_c99_stdio)
-
- # Check for the existence in <stdlib.h> of lldiv_t, et. al.
- ac_c99_stdlib=yes;
- AC_MSG_CHECKING([for lldiv_t declaration])
- AC_CACHE_VAL(ac_c99_lldiv_t, [
- AC_TRY_COMPILE([#include <stdlib.h>],
- [ lldiv_t mydivt;],
- [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
- ])
- AC_MSG_RESULT($ac_c99_lldiv_t)
-
- AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
- if test x"$ac_c99_lldiv_t" = x"no"; then
- ac_c99_stdlib=no;
- fi;
- AC_MSG_RESULT($ac_c99_stdlib)
-
- # Check for the existence of <wchar.h> functions used if C99 is enabled.
- # XXX the wchar.h checks should be rolled into the general C99 bits.
- ac_c99_wchar=yes;
- AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_MSG_RESULT($ac_c99_wchar)
-
- AC_MSG_CHECKING([for enabled ISO C99 support])
- if test x"$ac_c99_math" = x"no" ||
- test x"$ac_c99_stdio" = x"no" ||
- test x"$ac_c99_stdlib" = x"no" ||
- test x"$ac_c99_wchar" = x"no"; then
- enable_c99=no;
- fi;
- AC_MSG_RESULT($enable_c99)
-
- # Option parsed, now set things appropriately
- if test x"$enable_c99" = x"yes"; then
- AC_DEFINE(_GLIBCXX_USE_C99)
- fi
-
- AC_LANG_RESTORE
-])
-
dnl
dnl Check for template specializations for the 'long long' type extension.
dnl The result determines only whether 'long long' I/O is enabled; things
dnl like numeric_limits<> specializations are always available.
dnl
-dnl GLIBCXX_ENABLE_LONG_LONG
dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG
dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined
dnl + Usage: GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If omitted, it
-dnl defaults to `no'.
+dnl Where DEFAULT is either `yes' or `no'.
dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
dnl
-dnl GLIBCXX_ENABLE_LONG_LONG
-AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [dnl
- define([GLIBCXX_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
-
- AC_ARG_ENABLE(long-long,
- changequote(<<, >>)dnl
- <<--enable-long-long turns on 'long long' [default=>>GLIBCXX_ENABLE_LONG_LONG_DEFAULT],
- changequote([, ])dnl
- [case "$enableval" in
- yes) enable_long_long=yes ;;
- no) enable_long_long=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
- esac],
- enable_long_long=GLIBCXX_ENABLE_LONG_LONG_DEFAULT)dnl
+AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [
+ GLIBCXX_ENABLE(long-long,$1,,[enables I/O support for 'long long'])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -1726,7 +1355,7 @@ AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [dnl
[char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
# Option parsed, now set things appropriately
- if test x"$enable_long_long" = xyes; then
+ if test $enable_long_long = yes; then
AC_DEFINE(_GLIBCXX_USE_LONG_LONG)
fi
AC_MSG_RESULT($enable_long_long)
@@ -1736,479 +1365,125 @@ AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [dnl
dnl
-dnl Check for what type of C headers to use.
-dnl
-dnl GLIBCXX_ENABLE_CHEADERS
-dnl --enable-cheaders= [does stuff].
-dnl --disable-cheaders [does not do anything, really].
-dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
-dnl Where DEFAULT is either `c' or `c_std'.
-dnl If ommitted, it defaults to `c_std'.
-AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [dnl
-define([GLIBCXX_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
-AC_MSG_CHECKING([for c header strategy to use])
-AC_ARG_ENABLE(cheaders,
-changequote(<<, >>)dnl
-<< --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCXX_ENABLE_CHEADERS_DEFAULT],
-changequote([, ])
- [case "$enableval" in
- c)
- enable_cheaders=c
- ;;
- c_std)
- enable_cheaders=c_std
- ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
- ;;
- esac],
- enable_cheaders=GLIBCXX_ENABLE_CHEADERS_DEFAULT)
- AC_MSG_RESULT($enable_cheaders)
-
- dnl Option parsed, now set things appropriately
- case "$enable_cheaders" in
- c_std)
- C_INCLUDE_DIR='${glibcxx_srcdir}/include/c_std'
- ;;
- c)
- C_INCLUDE_DIR='${glibcxx_srcdir}/include/c'
- ;;
- esac
-
- AC_SUBST(C_INCLUDE_DIR)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_C, test "$enable_cheaders" = c)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
-])
-
-
-dnl
-dnl Check for wide character support. Has the same effect as the option
-dnl in gcc's configure, but in a form that autoconf can mess with.
-dnl
-dnl GLIBCXX_ENABLE_C_MBCHAR
-dnl --enable-c-mbchar requests all the wchar_t stuff.
-dnl --disable-c-mbchar doesn't.
-dnl + Usage: GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'.
-AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [dnl
-define([GLIBCXX_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(c-mbchar,
-changequote(<<, >>)dnl
-<< --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCXX_ENABLE_C_MBCHAR_DEFAULT],
-changequote([, ])dnl
-[case "$enableval" in
- yes) enable_c_mbchar=yes ;;
- no) enable_c_mbchar=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
- esac],
-enable_c_mbchar=GLIBCXX_ENABLE_C_MBCHAR_DEFAULT)dnl
-dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
-])
-
-
-dnl
-dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
-dnl
-dnl TOPLEVEL_INCLUDES
-dnl LIBMATH_INCLUDES
-dnl LIBSUPCXX_INCLUDES
-dnl
-dnl GLIBCXX_EXPORT_INCLUDES
-AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
- # Root level of the build directory include sources.
- GLIBCXX_INCLUDES="-I${glibcxx_builddir}/include/${target_alias} -I${glibcxx_builddir}/include"
-
- # Passed down for canadian crosses.
- if test x"$CANADIAN" = xyes; then
- TOPLEVEL_INCLUDES='-I$(includedir)'
- fi
-
- LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
-
- LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
-
- # Now, export this to all the little Makefiles....
- AC_SUBST(GLIBCXX_INCLUDES)
- AC_SUBST(TOPLEVEL_INCLUDES)
- AC_SUBST(LIBMATH_INCLUDES)
- AC_SUBST(LIBSUPCXX_INCLUDES)
-])
-
-
-dnl
-dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
-dnl
-AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
- # Optimization flags that are probably a good idea for thrill-seekers. Just
- # uncomment the lines below and make, everything else is ready to go...
- # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
- OPTIMIZE_CXXFLAGS=
- AC_SUBST(OPTIMIZE_CXXFLAGS)
-
- WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
- AC_SUBST(WARN_FLAGS)
-])
-
-dnl
-dnl GLIBCXX_EXPORT_INSTALL_INFO
-dnl calculates gxx_install_dir
-dnl exports glibcxx_toolexecdir
-dnl exports glibcxx_toolexeclibdir
-dnl exports glibcxx_prefixdir
+dnl Check to see if building and using a C++ precompiled header can be done.
dnl
-dnl Assumes cross_compiling bits already done, and with_cross_host in
-dnl particular
+dnl --enable-libstdcxx-pch=yes
+dnl default, this shows intent to use stdc++.h.gch If it looks like it
+dnl may work, after some light-hearted attempts to puzzle out compiler
+dnl support, flip bits on in include/Makefile.am
dnl
-dnl GLIBCXX_EXPORT_INSTALL_INFO
-AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
-# Assumes glibcxx_builddir, glibcxx_srcdir are alreay set up and
-# exported correctly in GLIBCXX_CONFIGURE.
-glibcxx_toolexecdir=no
-glibcxx_toolexeclibdir=no
-glibcxx_prefixdir=${prefix}
-
-# Process the option --with-gxx-include-dir=<path to include-files directory>
-AC_MSG_CHECKING([for --with-gxx-include-dir])
-AC_ARG_WITH(gxx-include-dir,
-[ --with-gxx-include-dir the installation directory for include files],
-[case "${withval}" in
- yes)
- AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
- gxx_include_dir=no
- ;;
- no)
- gxx_include_dir=no
- ;;
- *)
- gxx_include_dir=${withval}
- ;;
-esac], [gxx_include_dir=no])
-AC_MSG_RESULT($gxx_include_dir)
-
-# Process the option "--enable-version-specific-runtime-libs"
-AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
-AC_ARG_ENABLE(version-specific-runtime-libs,
-[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
-[case "$enableval" in
- yes) version_specific_libs=yes ;;
- no) version_specific_libs=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
- esac],
-version_specific_libs=no)dnl
-# Option set, now we can test it.
-AC_MSG_RESULT($version_specific_libs)
-
-# Default case for install directory for include files.
-if test $version_specific_libs = no && test $gxx_include_dir = no; then
- gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
-fi
-
-# Version-specific runtime libs processing.
-if test $version_specific_libs = yes; then
- # Need the gcc compiler version to know where to install libraries
- # and header files if --enable-version-specific-runtime-libs option
- # is selected.
- if test x"$gxx_include_dir" = x"no"; then
- gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
- fi
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
-fi
-
-# Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
-# Install a library built with a cross compiler in tooldir, not libdir.
-if test x"$glibcxx_toolexecdir" = x"no"; then
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- glibcxx_toolexecdir='$(exec_prefix)/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/lib'
- else
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- glibcxx_toolexeclibdir='$(libdir)'
- fi
- multi_os_directory=`$CC -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
- esac
-fi
-
-AC_MSG_CHECKING([for install location])
-AC_MSG_RESULT($gxx_include_dir)
-
-AC_SUBST(glibcxx_prefixdir)
-AC_SUBST(gxx_include_dir)
-AC_SUBST(glibcxx_toolexecdir)
-AC_SUBST(glibcxx_toolexeclibdir)
-])
-
-
-# Check for functions in math library.
-# Ulrich Drepper <drepper@cygnus.com>, 1998.
-#
-# This file can be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
-AC_DEFUN(AC_REPLACE_MATHFUNCS,
-[AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
-
-
-dnl This macro searches for a GNU version of make. If a match is found, the
-dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
-dnl set to "#". This is useful for including a special features in a Makefile,
-dnl which cannot be handled by other versions of make. The variable
-dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
-dnl the empty string otherwise.
-dnl
-dnl Here is an example of its use:
-dnl
-dnl Makefile.in might contain:
-dnl
-dnl # A failsafe way of putting a dependency rule into a makefile
-dnl $(DEPEND):
-dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
-dnl
-dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
-dnl @ifGNUmake@ include $(DEPEND)
-dnl @ifGNUmake@ endif
-dnl
-dnl Then configure.in would normally contain:
-dnl
-dnl CHECK_GNU_MAKE()
-dnl AC_OUTPUT(Makefile)
-dnl
-dnl Then perhaps to cause gnu make to override any other make, we could do
-dnl something like this (note that GNU make always looks for GNUmakefile first):
-dnl
-dnl if ! test x$_cv_gnu_make_command = x ; then
-dnl mv Makefile GNUmakefile
-dnl echo .DEFAULT: > Makefile ;
-dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
-dnl fi
-dnl
-dnl Then, if any (well almost any) other make is called, and GNU make also
-dnl exists, then the other make wraps the GNU make.
-dnl
-dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
-dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
-dnl
-dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
-dnl #### GLIBCXX_ to the macro name; adding the :-make fallback in the
-dnl #### conditional's subshell (" --version" is not a command), using a
-dnl #### different option to grep(1).
-dnl #### -pme
-dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
-dnl #### ${MAKE:-make}).
-dnl #### -msokolov
-AC_DEFUN(
- GLIBCXX_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
- _cv_gnu_make_command='' ;
-dnl Search all the common names for GNU make
- for a in "${MAKE-make}" make gmake gnumake ; do
- if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
- then
- _cv_gnu_make_command=$a ;
- break;
- fi
- done ;
- ) ;
-dnl If there was a GNU version, then set @ifGNUmake@ to the empty
-dnl string, '#' otherwise
- if test "x$_cv_gnu_make_command" != "x" ; then
- ifGNUmake='' ;
- else
- ifGNUmake='#' ;
- fi
- AC_SUBST(ifGNUmake)
-])
-
-
-dnl Check for headers for, and arguments to, the setrlimit() function.
-dnl Used only in testsuite_hooks.h.
-AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
- AC_TRY_COMPILE([#include <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
- ], [ int f = RLIMIT_$1 ; ],
- [glibcxx_mresult=1], [glibcxx_mresult=0])
- AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
- [Only used in build directory testsuite_hooks.h.])
-])
-AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
- setrlimit_have_headers=yes
- AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
- [],
- setrlimit_have_headers=no)
- # If don't have the headers, then we can't run the tests now, and we
- # won't be seeing any of these during testsuite compilation.
- if test $setrlimit_have_headers = yes; then
- # Can't do these in a loop, else the resulting syntax is wrong.
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
-
- # Check for rlimit, setrlimit.
- AC_CACHE_VAL(ac_setrlimit, [
- AC_TRY_COMPILE([#include <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
- ],
- [ struct rlimit r; setrlimit(0, &r);],
- [ac_setrlimit=yes], [ac_setrlimit=no])
- ])
- fi
-
- AC_MSG_CHECKING([for testsuite memory limit support])
- if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
- ac_mem_limits=yes
- AC_DEFINE(_GLIBCXX_MEM_LIMITS)
- else
- ac_mem_limits=no
- fi
- AC_MSG_RESULT($ac_mem_limits)
-])
-
-
+dnl --disable-libstdcxx-pch
+dnl turns off attempts to use or build stdc++.h.gch.
dnl
-dnl Does any necessary configuration of the testsuite directory. Generates
-dnl the testsuite_hooks.h header.
+dnl Substs:
+dnl glibcxx_PCHFLAGS
dnl
-dnl GLIBCXX_CONFIGURE_TESTSUITE [no args]
-AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
-
- if test x"$GLIBCXX_IS_CROSS_COMPILING" = xfalse; then
- # Do checks for memory limit functions.
- GLIBCXX_CHECK_SETRLIMIT
+AC_DEFUN(GLIBCXX_ENABLE_PCH, [
+ AC_MSG_CHECKING([for enabled PCH])
+ GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++ headers])
+ AC_MSG_RESULT([$enable_libstdcxx_pch])
- # Look for setenv, so that extended locale tests can be performed.
- GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ if test $enable_libstdcxx_pch = yes; then
+ AC_CACHE_CHECK([for compiler with PCH support],
+ [glibcxx_cv_prog_CXX_pch],
+ [ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ echo '#include <math.h>' > conftest.h
+ if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
+ -o conftest.h.gch 1>&5 2>&1 &&
+ echo '#error "pch failed"' > conftest.h &&
+ echo '#include "conftest.h"' > conftest.cc &&
+ $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ;
+ then
+ glibcxx_cv_prog_CXX_pch=yes
+ else
+ glibcxx_cv_prog_CXX_pch=no
+ fi
+ rm -f conftest*
+ CXXFLAGS=$ac_save_CXXFLAGS
+ AC_LANG_RESTORE
+ ])
+ enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch
fi
- # Export file names for ABI checking.
- baseline_dir="${glibcxx_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
- AC_SUBST(baseline_dir)
-
- # Determine if checking the ABI is desirable.
- if test x$enable_symvers = xno; then
- enable_abi_check=no
+ GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_PCH, test $enable_libstdcxx_pch = yes)
+ if test $enable_libstdcxx_pch = yes; then
+ glibcxx_PCHFLAGS="-include bits/stdc++.h"
else
- case "$host" in
- *-*-cygwin*)
- enable_abi_check=no ;;
- *)
- enable_abi_check=yes ;;
- esac
+ glibcxx_PCHFLAGS=""
fi
-
- AM_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
- AM_CONDITIONAL(GLIBCXX_TEST_ABI, test "$enable_abi_check" = yes)
+ AC_SUBST(glibcxx_PCHFLAGS)
])
-sinclude(../libtool.m4)
-dnl The lines below arrange for aclocal not to bring an installed
-dnl libtool.m4 into aclocal.m4, while still arranging for automake to
-dnl add a definition of LIBTOOL to Makefile.in.
-ifelse(,,,[AC_SUBST(LIBTOOL)
-AC_DEFUN([AM_PROG_LIBTOOL])
-AC_DEFUN([AC_LIBTOOL_DLOPEN])
-AC_DEFUN([AC_PROG_LD])
-])
-
dnl
-dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
+dnl Check for exception handling support. If an explicit enable/disable
+dnl sjlj exceptions is given, we don't have to detect. Otherwise the
+dnl target may or may not support call frame exceptions.
dnl
-
-AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
- AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
- AC_TRY_LINK([#include <sys/stat.h>],
- [struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
- [glibcxx_cv_S_ISREG=yes],
- [glibcxx_cv_S_ISREG=no])
- ])
- AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
- AC_TRY_LINK([#include <sys/stat.h>],
- [struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
- [glibcxx_cv_S_IFREG=yes],
- [glibcxx_cv_S_IFREG=no])
- ])
- if test x$glibcxx_cv_S_ISREG = xyes; then
- AC_DEFINE(HAVE_S_ISREG)
- elif test x$glibcxx_cv_S_IFREG = xyes; then
- AC_DEFINE(HAVE_S_IFREG)
- fi
-])
-
+dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
+dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
+dnl Neither one forces an attempt at detection.
dnl
-dnl Check whether poll is available in <poll.h>.
+dnl Defines:
+dnl _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
dnl
-
-AC_DEFUN(GLIBCXX_CHECK_POLL, [
- AC_CACHE_VAL(glibcxx_cv_POLL, [
- AC_TRY_COMPILE([#include <poll.h>],
- [struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
- [glibcxx_cv_POLL=yes],
- [glibcxx_cv_POLL=no])
- ])
- if test x$glibcxx_cv_POLL = xyes; then
- AC_DEFINE(HAVE_POLL)
- fi
-])
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-# Ulrich Drepper <drepper@cygnus.com>, 1995.
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-AC_DEFUN(AC_LC_MESSAGES, [
- AC_CHECK_HEADER(locale.h, [
- AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
- if test $ac_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES)
+AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
+ AC_MSG_CHECKING([for exception model to use])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ GLIBCXX_ENABLE(sjlj-exceptions,auto,,
+ [force use of builtin_setjmp for exceptions],
+ [permit yes|no|auto])
+
+ if test $enable_sjlj_exceptions = auto; then
+ # Botheration. Now we've got to detect the exception model. Link tests
+ # against libgcc.a are problematic since we've not been given proper -L
+ # bits for single-tree newlib and libgloss.
+ #
+ # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+struct S { ~S(); };
+void bar();
+void foo()
+{
+ S s;
+ bar();
+}
+EOF
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=-S
+ if AC_TRY_EVAL(ac_compile); then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
fi
- ])
-])
-
+ CXXFLAGS="$old_CXXFLAGS"
+ rm -f conftest*
+ fi
-dnl
-dnl Check for whether the Boost-derived checks should be turned on.
-dnl
-dnl GLIBCXX_ENABLE_CONCEPT_CHECKS
-dnl --enable-concept-checks turns them on.
-dnl --disable-concept-checks leaves them off.
-dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'.
-AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [dnl
-define([GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(concept-checks,
-changequote(<<, >>)dnl
-<< --enable-concept-checks use Boost-derived template checks [default=>>GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT],
-changequote([, ])dnl
-[case "$enableval" in
- yes) enable_concept_checks=yes ;;
- no) enable_concept_checks=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
- esac],
-enable_concept_checks=GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
-dnl Option parsed, now set things appropriately
-if test x"$enable_concept_checks" = xyes; then
- AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
-fi
+ # This is a tad weird, for hysterical raisins. We have to map enable/disable
+ # to two different models.
+ case $enable_sjlj_exceptions in
+ yes)
+ AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
+ [Define if the compiler is configured for setjmp/longjmp exceptions.])
+ ac_exception_model_name=sjlj
+ ;;
+ no)
+ ac_exception_model_name="call frame"
+ ;;
+ *)
+ AC_MSG_ERROR([unable to detect exception model])
+ ;;
+ esac
+ AC_LANG_RESTORE
+ AC_MSG_RESULT($ac_exception_model_name)
])
@@ -2216,36 +1491,28 @@ dnl
dnl Add version tags to symbols in shared library (or not), additionally
dnl marking other symbols as private/local (or not).
dnl
-dnl GLIBCXX_ENABLE_SYMVERS
dnl --enable-symvers=style adds a version script to the linker call when
dnl creating the shared library. The choice of version script is
dnl controlled by 'style'.
dnl --disable-symvers does not.
dnl + Usage: GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'. Passing `yes' tries to choose a default style
-dnl based on linker characteristics. Passing 'no' disables versioning.
-AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [dnl
-define([GLIBCXX_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(symvers,
-changequote(<<, >>)dnl
-<< --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCXX_ENABLE_SYMVERS_DEFAULT],
-changequote([, ])dnl
-[case "$enableval" in
- yes) enable_symvers=yes ;;
- no) enable_symvers=no ;;
- # other names here, just as sanity checks
- #gnu|sun|etcetera) enable_symvers=$enableval ;;
- gnu) enable_symvers=$enableval ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
- esac],
-enable_symvers=GLIBCXX_ENABLE_SYMVERS_DEFAULT)dnl
+dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to
+dnl choose a default style based on linker characteristics. Passing
+dnl 'no' disables versioning.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [
+
+GLIBCXX_ENABLE(symvers,$1,[=STYLE],
+ [enables symbol versioning of the shared library],
+ [permit yes|no|gnu])
# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
-if test x$enable_shared = xno ||
- test "x$LD" = x ||
- test x$glibcxx_gnu_ld_version = x; then
+AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
+# FIXME The following test is too strict, in theory.
+if test $enable_shared = no ||
+ test "x$LD" = x ||
+ test x$glibcxx_gnu_ld_version = x; then
enable_symvers=no
fi
@@ -2254,48 +1521,133 @@ if test $enable_symvers != no; then
AC_MSG_CHECKING([for shared libgcc])
ac_save_CFLAGS="$CFLAGS"
CFLAGS=' -lgcc_s'
- AC_TRY_LINK(, [return 0], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
+ AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
CFLAGS="$ac_save_CFLAGS"
AC_MSG_RESULT($glibcxx_shared_libgcc)
fi
-# For GNU ld, we need at least this version. It's 2.14 in the same format
-# as the tested-for version. See GLIBCXX_CHECK_LINKER_FEATURES for more.
+# For GNU ld, we need at least this version. The format is described in
+# GLIBCXX_CHECK_LINKER_FEATURES above.
glibcxx_min_gnu_ld_version=21400
+# XXXXXXXXXXX glibcxx_gnu_ld_version=21390
-# Check to see if unspecified "yes" value can win, given results
-# above.
-if test $enable_symvers = yes ; then
+# Check to see if unspecified "yes" value can win, given results above.
+# Change "yes" into either "no" or a style name.
+if test $enable_symvers = yes; then
if test $with_gnu_ld = yes &&
- test $glibcxx_shared_libgcc = yes ;
+ test $glibcxx_shared_libgcc = yes;
then
if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
enable_symvers=gnu
else
# The right tools, the right setup, but too old. Fallbacks?
- enable_symvers=no
+ AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
+ AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
+ AC_MSG_WARN(=== You would need to upgrade your binutils to version)
+ AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
+ if test $glibcxx_gnu_ld_version -ge 21200 ; then
+ # Globbing fix is present, proper block support is not.
+ dnl AC_MSG_WARN([=== Dude, you are soooo close. Maybe we can fake it.])
+ dnl enable_symvers=???
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ else
+ # 2.11 or older.
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ fi
fi
else
# just fail for now
+ AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
+ AC_MSG_WARN([=== either you are not using a supported linker, or you are])
+ AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
enable_symvers=no
fi
fi
-dnl Everything parsed; figure out what file to use.
+# Everything parsed; figure out what file to use.
case $enable_symvers in
no)
- SYMVER_MAP=config/linker-map.dummy
- ;;
+ SYMVER_MAP=config/linker-map.dummy
+ ;;
gnu)
- SYMVER_MAP=config/linker-map.gnu
- AC_DEFINE(_GLIBCXX_SYMVER)
- ;;
+ SYMVER_MAP=config/linker-map.gnu
+ AC_DEFINE(_GLIBCXX_SYMVER)
+ ;;
esac
AC_SUBST(SYMVER_MAP)
-AC_SUBST(port_specific_symbol_file)
-AM_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
-AC_MSG_CHECKING([versioning on shared library symbols])
-AC_MSG_RESULT($enable_symvers)
+AC_SUBST(port_specific_symbol_files)
+GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
+AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
+])
+
+
+dnl
+dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
+dnl We must stage the required headers so that they will be installed
+dnl with the library (unlike libgcc, the STL implementation is provided
+dnl solely within headers). Since we must not inject random user-space
+dnl macro names into user-provided C++ code, we first stage into <file>-in
+dnl and process to <file> with an output command. The reason for a two-
+dnl stage process here is to correctly handle $srcdir!=$objdir without
+dnl having to write complex code (the sed commands to clean the macro
+dnl namespace are complex and fragile enough as it is). We must also
+dnl add a relative path so that -I- is supported properly.
+dnl
+dnl Substs:
+dnl glibcxx_thread_h
+dnl
+dnl Defines:
+dnl HAVE_GTHR_DEFAULT
+dnl _GLIBCXX_SUPPORTS_WEAK
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
+ AC_MSG_CHECKING([for thread model used by GCC])
+ target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
+ AC_MSG_RESULT([$target_thread_file])
+
+ if test $target_thread_file != single; then
+ AC_DEFINE(HAVE_GTHR_DEFAULT)
+ AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
+ fi
+
+ glibcxx_thread_h=gthr-$target_thread_file.h
+ AC_SUBST(glibcxx_thread_h)
+])
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+AC_DEFUN(AC_LC_MESSAGES, [
+ AC_CHECK_HEADER(locale.h, [
+ AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
+ if test $ac_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES)
+ fi
+ ])
+])
+
+
+sinclude([../libtool.m4])
+dnl The lines below arrange for aclocal not to bring an installed
+dnl libtool.m4 into aclocal.m4, while still arranging for automake to
+dnl add a definition of LIBTOOL to Makefile.in.
+ifelse(,,,[AC_SUBST(LIBTOOL)
+AC_DEFUN([AM_PROG_LIBTOOL])
+AC_DEFUN([AC_LIBTOOL_DLOPEN])
+AC_DEFUN([AC_PROG_LD])
])
+dnl vim:et:ts=2:sw=2
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4
index c8572f24351..d1db26e08ff 100644
--- a/libstdc++-v3/aclocal.m4
+++ b/libstdc++-v3/aclocal.m4
@@ -1,255 +1,197 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+# 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.
+
+# 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.
-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.
dnl
-dnl Initialize basic configure bits, set toplevel_srcdir for Makefiles.
+dnl GLIBCXX_CONDITIONAL (NAME, SHELL-TEST)
+dnl
+dnl Exactly like AM_CONDITIONAL, but delays evaluation of the test until the
+dnl end of configure. This lets tested variables be reassigned, and the
+dnl conditional will depend on the final state of the variable. For a simple
+dnl example of why this is needed, see GLIBCXX_ENABLE_HOSTED.
+dnl
+m4_define([_m4_divert(glibcxx_diversion)], 8000)dnl
+AC_DEFUN(GLIBCXX_CONDITIONAL, [dnl
+ m4_divert_text([glibcxx_diversion],dnl
+ AM_CONDITIONAL([$1],[$2])
+ )dnl
+])dnl
+AC_DEFUN(GLIBCXX_EVALUATE_CONDITIONALS, [m4_undivert([glibcxx_diversion])])dnl
+
+
+dnl
+dnl Check to see what architecture and operating system we are compiling
+dnl for. Also, if architecture- or OS-specific flags are required for
+dnl compilation, pick them up here.
+dnl
+AC_DEFUN(GLIBCXX_CHECK_HOST, [
+ . $glibcxx_srcdir/configure.host
+ AC_MSG_NOTICE(CPU config directory is $cpu_include_dir)
+ AC_MSG_NOTICE(OS config directory is $os_include_dir)
+])
+
+
+dnl
+dnl Initialize basic configure bits.
+dnl
+dnl Substs:
+dnl multi_basedir
dnl
-dnl GLIBCXX_TOPREL_CONFIGURE
AC_DEFUN(GLIBCXX_TOPREL_CONFIGURE, [
- dnl Default to --enable-multilib (this is also passed by default
- dnl from the ubercommon-top-level configure)
- AC_ARG_ENABLE(multilib,
- [ --enable-multilib build hella library versions (default)],
- [case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
- esac], [multilib=yes])dnl
-
- # When building with srcdir == objdir, links to the source files will
- # be created in directories within the target_subdir. We have to
- # adjust toplevel_srcdir accordingly, so that configure finds
- # install-sh and other auxiliary files that live in the top-level
- # source directory.
- if test "${srcdir}" = "."; then
- if test -z "${with_target_subdir}"; then
- toprel=".."
- else
- if test "${with_target_subdir}" != "."; then
- toprel="${with_multisrctop}../.."
- else
- toprel="${with_multisrctop}.."
- fi
- fi
+ # Sets up multi_basedir, which is srcdir/.. plus the usual
+ # "multi_source_toprel_bottom_adjust" lunacy as needed.
+ AM_ENABLE_MULTILIB(, ..)
+
+ # The generated code is exactly the same, except that automake's looks in
+ # ".. $srcdir/.." and autoconf's looks in multi_basedir. Apparently other
+ # things are triggered on the presence of the two ...AUX_DIR[S], but I don't
+ # know what they are or what the other differences might be (and they keep
+ # changing anyhow).
+ #
+ # Looking in multi_basedir seems smarter, so actually execute that branch.
+ if false; then
+ # this is for automake
+ AC_CONFIG_AUX_DIR(..)
else
- toprel=".."
+ # this is for autoconf
+ AC_CONFIG_AUX_DIRS(${multi_basedir})
fi
- AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
- toplevel_srcdir=\${top_srcdir}/$toprel
- AC_SUBST(toplevel_srcdir)
+
+ dnl XXX Turn this on.
+ dnl AC_LANG_CPLUSPLUS
])
+
+dnl
+dnl Initialize the rest of the library configury. At this point we have
+dnl variables like $host.
dnl
-dnl Initialize the rest of the library configury.
+dnl Sets:
+dnl gcc_version (x.y.z format)
+dnl SUBDIRS
+dnl Substs:
+dnl glibcxx_builddir (absolute path)
+dnl glibcxx_srcdir (absolute path)
+dnl toplevel_srcdir (absolute path)
+dnl with_cross_host
+dnl with_newlib
+dnl with_target_subdir
+dnl plus
+dnl - the variables in GLIBCXX_CHECK_HOST / configure.host
+dnl - default settings for all AM_CONFITIONAL test variables
+dnl - lots of tools, like CC and CXX
dnl
-dnl GLIBCXX_CONFIGURE
AC_DEFUN(GLIBCXX_CONFIGURE, [
- # Export build and source directories.
+ # Keep these sync'd with the list in Makefile.am. The first provides an
+ # expandable list at autoconf time; the second provides an expandable list
+ # (i.e., shell variable) at configure time.
+ m4_define([glibcxx_SUBDIRS],[include libmath libsupc++ src po testsuite])
+ SUBDIRS='glibcxx_SUBDIRS'
+
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
glibcxx_builddir=`${PWDCMD-pwd}`
case $srcdir in
- [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
- *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+ [\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
+ *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
esac
+ toplevel_srcdir=${glibcxx_srcdir}/..
AC_SUBST(glibcxx_builddir)
AC_SUBST(glibcxx_srcdir)
+ AC_SUBST(toplevel_srcdir)
- dnl This is here just to satisfy automake.
- ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
-
- AC_PROG_AWK
- # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
- # be 'cp -p' if linking isn't available. Uncomment the next line to
- # force a particular method.
- #ac_cv_prog_LN_S='cp -p'
- AC_PROG_LN_S
-
- # We use these options to decide which functions to include.
- AC_ARG_WITH(target-subdir,
- [ --with-target-subdir=SUBDIR
- configuring in a subdirectory])
- AC_ARG_WITH(cross-host,
- [ --with-cross-host=HOST configuring with a cross compiler])
-
- AC_ARG_WITH(newlib,
- [ --with-newlib Configuring with newlib])
-
- glibcxx_basedir=$srcdir/$toprel/$1/libstdc++-v3
- AC_SUBST(glibcxx_basedir)
-
- # Never versions of autoconf add an underscore to these functions.
- # Prevent future problems ...
- ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
- ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
- ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
- ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
-
- # AC_PROG_CC
- # FIXME: We temporarily define our own version of AC_PROG_CC. This is
- # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
- # are probably using a cross compiler, which will not be able to fully
- # link an executable. This is addressed in later versions of autoconf.
-
- AC_DEFUN(LIB_AC_PROG_CC,
- [AC_BEFORE([$0], [AC_PROG_CPP])dnl
- dnl Fool anybody using AC_PROG_CC.
- AC_PROVIDE([AC_PROG_CC])
- AC_CHECK_PROG(CC, gcc, gcc)
- if test -z "$CC"; then
- AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
- test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
- fi
-
- AC_PROG_CC_GNU
-
- if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- dnl Check whether -g works, even if CFLAGS is set, in case the package
- dnl plays around with CFLAGS (such as to build both debugging and
- dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
- else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
- fi
- ])
-
- LIB_AC_PROG_CC
-
- # Likewise for AC_PROG_CXX. We can't just call it directly because g++
- # will try to link in libstdc++.
- AC_DEFUN(LIB_AC_PROG_CXX,
- [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
- dnl Fool anybody using AC_PROG_CXX.
- AC_PROVIDE([AC_PROG_CXX])
- # Use glibcxx_CXX so that we do not cause CXX to be cached with the
- # flags that come in CXX while configuring libstdc++. They're different
- # from those used for all other target libraries. If CXX is set in
- # the environment, respect that here.
- glibcxx_CXX=$CXX
- AC_CHECK_PROGS(glibcxx_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
- AC_SUBST(glibcxx_CXX)
- CXX=$glibcxx_CXX
- test -z "$glibcxx_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
-
- AC_PROG_CXX_GNU
-
- if test $ac_cv_prog_gxx = yes; then
- GXX=yes
- dnl Check whether -g works, even if CXXFLAGS is set, in case the package
- dnl plays around with CXXFLAGS (such as to build both debugging and
- dnl normal versions of a library), tasteless as that idea is.
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- AC_PROG_CXX_G
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-O2"
- fi
- else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
- fi
- ])
-
- LIB_AC_PROG_CXX
+ # We use these options to decide which functions to include. They are
+ # set from the top level.
+ AC_ARG_WITH([target-subdir],
+ AC_HELP_STRING([--with-target-subdir=SUBDIR],
+ [configuring in a subdirectory]))
+
+ AC_ARG_WITH([cross-host],
+ AC_HELP_STRING([--with-cross-host=HOST],
+ [configuring with a cross compiler]))
+
+ AC_ARG_WITH([newlib],
+ AC_HELP_STRING([--with-newlib],
+ [assume newlib as a system C library]))
+
+ # We're almost certainly being configured before anything else which uses
+ # C++, so all of our AC_PROG_* discoveries will be cached. It's vital that
+ # we not cache the value of CXX that we "discover" here, because it's set
+ # to something unique for us and libjava. Other target libraries need to
+ # find CXX for themselves. We yank the rug out from under the normal AC_*
+ # process by sneakily renaming the cache variable. This also lets us debug
+ # the value of "our" CXX in postmortems.
+ #
+ # We must also force CXX to /not/ be a precious variable, otherwise the
+ # wrong (non-multilib-adjusted) value will be used in multilibs. This
+ # little trick also affects CPPFLAGS, CXXFLAGS, and LDFLAGS. And as a side
+ # effect, CXXFLAGS is no longer automagically subst'd, so we have to do
+ # that ourselves. Un-preciousing AC_PROG_CC also affects CC and CFLAGS.
+ #
+ # -fno-builtin must be present here so that a non-conflicting form of
+ # std::exit can be guessed by AC_PROG_CXX, and used in later tests.
+
+ m4_define([ac_cv_prog_CXX],[glibcxx_cv_prog_CXX])
+ m4_rename([_AC_ARG_VAR_PRECIOUS],[glibcxx_PRECIOUS])
+ m4_define([_AC_ARG_VAR_PRECIOUS],[])
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-builtin"
+ AC_PROG_CC
+ AC_PROG_CXX
+ CXXFLAGS="$save_CXXFLAGS"
+ m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+ AC_SUBST(CFLAGS)
+ AC_SUBST(CXXFLAGS)
# For directory versioning (e.g., headers) and other variables.
AC_MSG_CHECKING([for GCC version number])
- gcc_version=`$glibcxx_CXX -dumpversion`
+ gcc_version=`$CXX -dumpversion`
AC_MSG_RESULT($gcc_version)
- # For some reason, gettext needs this.
- AC_ISC_POSIX
+ # Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't
+ # available). Uncomment the next line to force a particular method.
+ AC_PROG_LN_S
+ #LN_S='cp -p'
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
- AC_PROG_INSTALL
AM_MAINTAINER_MODE
- # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
- # at least currently, we never actually build a program, so we never
- # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
- # fails, because we are probably configuring with a cross compiler
- # which can't create executables. So we include AC_EXEEXT to keep
- # automake happy, but we don't execute it, since we don't care about
- # the result.
- if false; then
- # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
- # to nothing, so nothing would remain between `then' and `fi' if it
- # were not for the `:' below.
- :
- AC_EXEEXT
- fi
-
- case [$]{glibcxx_basedir} in
- /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcxx_basedir} ;;
- *) glibcxx_flagbasedir='[$](top_builddir)/'[$]{glibcxx_basedir} ;;
- esac
-
- # Set up safe default values for all subsequent AM_CONDITIONAL tests.
+ # Set up safe default values for all subsequent AM_CONDITIONAL tests
+ # which are themselves conditionally expanded.
+ ## (Right now, this only matters for enable_wchar_t, but nothing prevents
+ ## other macros from doing the same. This should be automated.) -pme
need_libmath=no
enable_wchar_t=no
- #enable_debug=no
- #glibcxx_pch_comp=no
+ #enable_libstdcxx_debug=no
+ #enable_libstdcxx_pch=no
#enable_cheaders=c
#c_compatibility=no
#enable_abi_check=no
#enable_symvers=no
+ #enable_hosted_libstdcxx=yes
- # Find platform-specific directories containing configuration info. In
- # addition to possibly modifying the same flags, it also sets up symlinks.
+ # Find platform-specific directories containing configuration info.
+ # Also possibly modify flags used elsewhere, as needed by the platform.
GLIBCXX_CHECK_HOST
])
-dnl
-dnl Check to see if g++ can compile this library, and if so, if any version-
-dnl specific precautions need to be taken.
-dnl
-dnl GLIBCXX_CHECK_COMPILER_VERSION
-AC_DEFUN(GLIBCXX_CHECK_COMPILER_VERSION, [
-if test ! -f stamp-sanity-compiler; then
- AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE(, [
- #if __GNUC__ < 3
- not_ok
- #endif
- ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
- AC_LANG_RESTORE
- AC_MSG_RESULT($gpp_satisfactory)
- touch stamp-sanity-compiler
-fi
-])
+m4_include([linkage.m4])
+m4_include([../config/no-executables.m4])
dnl
@@ -257,14 +199,13 @@ dnl Tests for newer compiler features, or features that are present in newer
dnl compiler versions but not older compiler versions still in use, should
dnl be placed here.
dnl
-dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
-dnl new inlining code or the new system_header pragma will die on -Werror.
-dnl Leave it out by default and use maint-mode to use it.
-dnl
-dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
-dnl compiler supports it and the user has not requested debug mode.
+dnl Defines:
+dnl WERROR='-Werror' if requested and possible; g++'s that lack the
+dnl new inlining code or the new system_header pragma will die on -Werror.
+dnl Leave it out by default and use maint-mode to use it.
+dnl SECTION_FLAGS='-ffunction-sections -fdata-sections' if
+dnl compiler supports it and the user has not requested debug mode.
dnl
-dnl GLIBCXX_CHECK_COMPILER_FEATURES
AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
# All these tests are for C++; save the language and the compiler flags.
# The CXXFLAGS thing is suspicious, but based on similar bits previously
@@ -284,8 +225,7 @@ AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
# Check for -ffunction-sections -fdata-sections
AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
- AC_TRY_COMPILE(, [int foo;
- ], [ac_fdsections=yes], [ac_fdsections=no])
+ AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no])
if test "$ac_test_CXXFLAGS" = set; then
CXXFLAGS="$ac_save_CXXFLAGS"
else
@@ -308,13 +248,17 @@ dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
dnl the native linker is in use, all variables will be defined to something
dnl safe (like an empty string).
dnl
-dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
-dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
-dnl Define LD, with_gnu_ld, and (possibly) glibcxx_gnu_ld_version as
-dnl side-effects of testing. The last will be a single integer, e.g.,
-dnl version 1.23.45.0.67.89 will set glibcxx_gnu_ld_version to 12345.
+dnl Defines:
+dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible
+dnl OPT_LDFLAGS='-Wl,-O1' if possible
+dnl LD (as a side effect of testing)
+dnl Sets:
+dnl with_gnu_ld
+dnl glibcxx_gnu_ld_version (possibly)
+dnl
+dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
+dnl set glibcxx_gnu_ld_version to 12345. Zeros cause problems.
dnl
-dnl GLIBCXX_CHECK_LINKER_FEATURES
AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
# If we're not using GNU ld, then there's no point in even trying these
# tests. Check for that first. We should have already tested for gld
@@ -322,6 +266,7 @@ AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
AC_REQUIRE([AC_PROG_LD])
+ AC_REQUIRE([AC_PROG_AWK])
# The name set by libtool depends on the version of libtool. Shame on us
# for depending on an impl detail, but c'est la vie. Older versions used
@@ -358,12 +303,12 @@ AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
CFLAGS='-x c++ -Wl,--gc-sections'
# Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
AC_TRY_RUN([
int main(void)
@@ -396,533 +341,18 @@ AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
dnl
-dnl Check to see if the (math function) argument passed is
-dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with ONE parameter
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_1
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_1, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>
- #ifdef HAVE_IEEEFP_H
- #include <ieeefp.h>
- #endif
- ],
- [ $1(0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl 3) if not, see if 1) and 2) for argument prepended with '_'
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with ONE parameter
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, [
- GLIBCXX_CHECK_MATH_DECL_1($1)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- else
- GLIBCXX_CHECK_MATH_DECL_1(_$1)
- if test x$glibcxx_cv_func__$1_use = x"yes"; then
- AC_CHECK_FUNCS(_$1)
- fi
- fi
-])
-
-
-dnl
-dnl Like GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
-dnl of functions at once. It's an all-or-nothing check -- either
-dnl HAVE_XYZ is defined for each of the functions, or for none of them.
-dnl Doing it this way saves significant configure time.
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1, [
- AC_MSG_CHECKING([for $1 functions])
- AC_CACHE_VAL(glibcxx_cv_func_$2_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ `for x in $3; do echo "$x (0);"; done` ],
- [glibcxx_cv_func_$2_use=yes],
- [glibcxx_cv_func_$2_use=no])
- AC_LANG_RESTORE])
- AC_MSG_RESULT($glibcxx_cv_func_$2_use)
- if test x$glibcxx_cv_func_$2_use = x"yes"; then
- AC_CHECK_FUNCS($3)
- fi
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with TWO parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_2
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_2, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ $1(0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with TWO parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2, [
- GLIBCXX_CHECK_MATH_DECL_2($1)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- else
- GLIBCXX_CHECK_MATH_DECL_2(_$1)
- if test x$glibcxx_cv_func__$1_use = x"yes"; then
- AC_CHECK_FUNCS(_$1)
- fi
- fi
-])
-
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with THREE parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_3
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_3, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ $1(0, 0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
-])
-
-dnl
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with THREE parameters
-dnl
-dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3
-AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3, [
- GLIBCXX_CHECK_MATH_DECL_3($1)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- else
- GLIBCXX_CHECK_MATH_DECL_3(_$1)
- if test x$glibcxx_cv_func__$1_use = x"yes"; then
- AC_CHECK_FUNCS(_$1)
- fi
- fi
-])
-
-
-dnl
-dnl Check to see if the (stdlib function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with TWO parameters
-dnl
-dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2
-AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <stdlib.h>],
- [ $1(0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- fi
-])
-
-
-dnl
-dnl Check to see if the (stdlib function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a function with THREE parameters
-dnl
-dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3
-AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <stdlib.h>],
- [ $1(0, 0, 0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- fi
-])
-
-dnl
-dnl Because the builtins are picky picky picky about the arguments they take,
-dnl do an explict linkage tests here.
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with ONE parameter
-dnl
-dnl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
-AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ $1(0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_MSG_CHECKING([for $1 linkage])
- if test x${glibcxx_cv_func_$1_link+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_link, [
- AC_TRY_LINK([#include <math.h>],
- [ $1(0);],
- [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no])
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_link)
- if test x$glibcxx_cv_func_$1_link = x"yes"; then
- ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- AC_DEFINE_UNQUOTED(${ac_tr_func})
- fi
- fi
-])
-
-
-dnl
-dnl Check to see what builtin math functions are supported
-dnl
-dnl check for __builtin_abs
-dnl check for __builtin_fabsf
-dnl check for __builtin_fabs
-dnl check for __builtin_fabl
-dnl check for __builtin_labs
-dnl check for __builtin_sqrtf
-dnl check for __builtin_sqrtl
-dnl check for __builtin_sqrt
-dnl check for __builtin_sinf
-dnl check for __builtin_sin
-dnl check for __builtin_sinl
-dnl check for __builtin_cosf
-dnl check for __builtin_cos
-dnl check for __builtin_cosl
-dnl
-dnl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT, [
- dnl Test for builtin math functions.
- dnl These are made in gcc/c-common.c
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
-
- dnl There is, without a doubt, a more elegant way to have these
- dnl names exported so that they won't be stripped out of acconfig.h by
- dnl autoheader. I leave this as an exercise to somebody less frustrated
- dnl than I.... please email the libstdc++ list if you can figure out a
- dnl more elegant approach (see autoconf/acgen.m4 and specifically
- dnl AC_CHECK_FUNC for things to steal.)
- dummyvar=no
- if test x$dummyvar = x"yes"; then
- AC_DEFINE(HAVE___BUILTIN_ABS)
- AC_DEFINE(HAVE___BUILTIN_LABS)
- AC_DEFINE(HAVE___BUILTIN_COS)
- AC_DEFINE(HAVE___BUILTIN_COSF)
- AC_DEFINE(HAVE___BUILTIN_COSL)
- AC_DEFINE(HAVE___BUILTIN_FABS)
- AC_DEFINE(HAVE___BUILTIN_FABSF)
- AC_DEFINE(HAVE___BUILTIN_FABSL)
- AC_DEFINE(HAVE___BUILTIN_SIN)
- AC_DEFINE(HAVE___BUILTIN_SINF)
- AC_DEFINE(HAVE___BUILTIN_SINL)
- AC_DEFINE(HAVE___BUILTIN_SQRT)
- AC_DEFINE(HAVE___BUILTIN_SQRTF)
- AC_DEFINE(HAVE___BUILTIN_SQRTL)
- fi
-])
-
-dnl
-dnl Check to see what the underlying c library is like
-dnl These checks need to do two things:
-dnl 1) make sure the name is declared when using the c++ compiler
-dnl 2) make sure the name has "C" linkage
-dnl This might seem like overkill but experience has shown that it's not...
-dnl
-dnl Define HAVE_STRTOLD if "strtold" is declared and links
-dnl Define HAVE_STRTOF if "strtof" is declared and links
-dnl Define HAVE_DRAND48 if "drand48" is declared and links
-dnl
-dnl GLIBCXX_CHECK_STDLIB_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
-
- GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
- GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
- AC_CHECK_FUNCS(drand48)
-
- CXXFLAGS="$ac_save_CXXFLAGS"
-])
-
-dnl
-dnl Check to see what the underlying c library or math library is like.
-dnl These checks need to do two things:
-dnl 1) make sure the name is declared when using the c++ compiler
-dnl 2) make sure the name has "C" linkage
-dnl This might seem like overkill but experience has shown that it's not...
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is found.
-dnl
-dnl GLIBCXX_CHECK_MATH_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_MATH_SUPPORT, [
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
-
- dnl Check libm
- AC_CHECK_LIB(m, sin, libm="-lm")
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libm"
-
- dnl Check to see if certain C math functions exist.
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
-
- dnl Check to see if basic C math functions have float versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
- float_trig,
- acosf asinf atanf \
- cosf sinf tanf \
- coshf sinhf tanhf)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
- float_round,
- ceilf floorf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
-
- dnl Check to see if basic C math functions have long double versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
- long_double_trig,
- acosl asinl atanl \
- cosl sinl tanl \
- coshl sinhl tanhl)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
- long_double_round,
- ceill floorl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
- GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
-
- dnl Some runtimes have these functions with a preceding underscore. Please
- dnl keep this sync'd with the one above. And if you add any new symbol,
- dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
- dnl Check to see if certain C math functions exist.
-
- dnl Check to see if basic C math functions have float versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
- _float_trig,
- _acosf _asinf _atanf \
- _cosf _sinf _tanf \
- _coshf _sinhf _tanhf)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
- _float_round,
- _ceilf _floorf)
-
- dnl Check to see if basic C math functions have long double versions.
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
- _long_double_trig,
- _acosl _asinl _atanl \
- _cosl _sinl _tanl \
- _coshl _sinhl _tanhl)
- GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
- _long_double_round,
- _ceill _floorl)
-
- LIBS="$ac_save_LIBS"
- CXXFLAGS="$ac_save_CXXFLAGS"
-])
-
-
-dnl
-dnl Check to see if there is native support for complex
-dnl
-dnl Don't compile bits in math/* if native support exits.
-dnl
-dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
-dnl
-dnl GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT, [
- dnl Check for complex versions of math functions of platform. This will
- dnl always pass if libm is available, and fail if it isn't. If it is
- dnl available, we assume we'll need it later, so add it to LIBS.
- AC_CHECK_LIB(m, main)
- AC_REPLACE_MATHFUNCS(nan copysignf)
-
- dnl For __signbit to signbit conversions.
- AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
- AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
-
- dnl Compile the long double complex functions only if the function
- dnl provides the non-complex long double functions that are needed.
- dnl Currently this includes copysignl, which should be
- dnl cached from the GLIBCXX_CHECK_MATH_SUPPORT macro, above.
- if test x$ac_cv_func_copysignl = x"yes"; then
- AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
- fi
-
- if test -n "$LIBMATHOBJS"; then
- need_libmath=yes
- fi
- AC_SUBST(LIBMATHOBJS)
-])
-
-
-dnl Check to see what architecture and operating system we are compiling
-dnl for. Also, if architecture- or OS-specific flags are required for
-dnl compilation, pick them up here.
-dnl
-dnl GLIBCXX_CHECK_HOST
-AC_DEFUN(GLIBCXX_CHECK_HOST, [
- . [$]{glibcxx_basedir}/configure.host
- AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
- AC_MSG_RESULT(OS config directory is $os_include_dir)
-])
-
-
-dnl
-dnl Check to see if this target can enable the wchar_t parts of libstdc++.
+dnl Check to see if this target can enable the wchar_t parts.
dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
-dnl must have been previously checked.)
+dnl must have been previously checked.) By default, wide characters are
+dnl disabled.
dnl
-dnl Define _GLIBCXX_USE_WCHAR_T if all the bits are found
-dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
+dnl Defines:
+dnl HAVE_MBSTATE_T if mbstate_t is not in wchar.h
+dnl _GLIBCXX_USE_WCHAR_T if all the bits are found.
dnl
-dnl GLIBCXX_CHECK_WCHAR_T_SUPPORT
AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
- dnl Wide characters disabled by default.
-
- dnl Test wchar.h for mbstate_t, which is needed for char_traits and
- dnl others even if wchar_t support is not on.
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
AC_MSG_CHECKING([for mbstate_t])
AC_TRY_COMPILE([#include <wchar.h>],
[mbstate_t teststate;],
@@ -932,25 +362,25 @@ AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
AC_DEFINE(HAVE_MBSTATE_T)
fi
- dnl Sanity check for existence of ISO C99 headers for extended encoding.
+ # Sanity check for existence of ISO C99 headers for extended encoding.
AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
- dnl Only continue checking if the ISO C99 headers exist and support is on.
+ # Only continue checking if the ISO C99 headers exist and support is on.
if test x"$ac_has_wchar_h" = xyes &&
test x"$ac_has_wctype_h" = xyes &&
test x"$enable_c_mbchar" != xno; then
- dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
- dnl numeric_limits can instantiate type_traits<wchar_t>
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
AC_TRY_COMPILE([#include <wchar.h>],
[int i = WCHAR_MIN; int j = WCHAR_MAX;],
has_wchar_minmax=yes, has_wchar_minmax=no)
AC_MSG_RESULT($has_wchar_minmax)
- dnl Test wchar.h for WEOF, which is what we use to determine whether
- dnl to specialize for char_traits<wchar_t> or not.
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
AC_MSG_CHECKING([for WEOF])
AC_TRY_COMPILE([
#include <wchar.h>
@@ -959,284 +389,639 @@ AC_DEFUN(GLIBCXX_CHECK_WCHAR_T_SUPPORT, [
has_weof=yes, has_weof=no)
AC_MSG_RESULT($has_weof)
- dnl Tests for wide character functions used in char_traits<wchar_t>.
+ # Tests for wide character functions used in char_traits<wchar_t>.
ac_wfuncs=yes
- AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
- ac_wfuncs=no)
+ AC_CHECK_FUNCS([wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset],
+ [],[ac_wfuncs=no])
- dnl Checks for names injected into std:: by the c_std headers.
- AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
+ # Checks for names injected into std:: by the c_std headers.
+ AC_CHECK_FUNCS([btowc wctob fgetwc fgetws fputwc fputws fwide \
fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
- ac_wfuncs=no)
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr],
+ [],[ac_wfuncs=no])
AC_MSG_CHECKING([for ISO C99 wchar_t support])
if test x"$has_weof" = xyes &&
test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
+ test x"$ac_wfuncs" = xyes;
+ then
ac_isoC99_wchar_t=yes
else
ac_isoC99_wchar_t=no
fi
AC_MSG_RESULT($ac_isoC99_wchar_t)
- dnl Use iconv for wchar_t to char conversions. As such, check for
- dnl X/Open Portability Guide, version 2 features (XPG2).
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
- dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
ac_save_LIBS="$LIBS"
LIBS="$LIBS $libiconv"
- AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
- ac_XPG2funcs=yes, ac_XPG2funcs=no)
+ AC_CHECK_FUNCS([iconv_open iconv_close iconv nl_langinfo],
+ [ac_XPG2funcs=yes], [ac_XPG2funcs=no])
LIBS="$ac_save_LIBS"
AC_MSG_CHECKING([for XPG2 wchar_t support])
if test x"$ac_has_iconv_h" = xyes &&
test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
+ test x"$ac_XPG2funcs" = xyes;
+ then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
AC_MSG_RESULT($ac_XPG2_wchar_t)
- dnl At the moment, only enable wchar_t specializations if all the
- dnl above support is present.
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
AC_DEFINE(_GLIBCXX_USE_WCHAR_T)
enable_wchar_t=yes
fi
fi
AC_MSG_CHECKING([for enabled wchar_t specializations])
- AC_MSG_RESULT($enable_wchar_t)
+ AC_MSG_RESULT($enable_wchar_t)
])
dnl
-dnl Check to see if debugging libraries are to be built.
+dnl Check for headers for, and arguments to, the setrlimit() function.
+dnl Used only in testsuite_hooks.h. Called from GLIBCXX_CONFIGURE_TESTSUITE.
dnl
-dnl GLIBCXX_ENABLE_DEBUG
+dnl Defines:
+dnl _GLIBCXX_MEM_LIMITS if we can set artificial limits on memory
+dnl various HAVE_MEMLIMIT_* for individual limit names
dnl
-dnl --enable-libstdcxx-debug
-dnl builds a separate set of debugging libraries in addition to the
-dnl normal (shared, static) libstdc++ binaries.
+AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
+ AC_TRY_COMPILE(
+ [#include <unistd.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ],
+ [ int f = RLIMIT_$1 ; ],
+ [glibcxx_mresult=1], [glibcxx_mresult=0])
+ AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
+ [Only used in build directory testsuite_hooks.h.])
+])
+
+AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
+ setrlimit_have_headers=yes
+ AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
+ [],
+ [setrlimit_have_headers=no])
+ # If don't have the headers, then we can't run the tests now, and we
+ # won't be seeing any of these during testsuite compilation.
+ if test $setrlimit_have_headers = yes; then
+ # Can't do these in a loop, else the resulting syntax is wrong.
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
+
+ # Check for rlimit, setrlimit.
+ AC_CACHE_VAL(ac_setrlimit, [
+ AC_TRY_COMPILE(
+ [#include <unistd.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ],
+ [struct rlimit r;
+ setrlimit(0, &r);],
+ [ac_setrlimit=yes], [ac_setrlimit=no])
+ ])
+ fi
+
+ AC_MSG_CHECKING([for testsuite memory limit support])
+ if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
+ ac_mem_limits=yes
+ AC_DEFINE(_GLIBCXX_MEM_LIMITS)
+ else
+ ac_mem_limits=no
+ fi
+ AC_MSG_RESULT($ac_mem_limits)
+])
+
+
dnl
-dnl --disable-libstdcxx-debug
-dnl builds only one (non-debug) version of libstdc++.
+dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
+dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately.
dnl
-dnl --enable-libstdcxx-debug-flags=FLAGS
-dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
+AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
+ AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
+ AC_TRY_LINK(
+ [#include <sys/stat.h>],
+ [struct stat buffer;
+ fstat(0, &buffer);
+ S_ISREG(buffer.st_mode);],
+ [glibcxx_cv_S_ISREG=yes],
+ [glibcxx_cv_S_ISREG=no])
+ ])
+ AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
+ AC_TRY_LINK(
+ [#include <sys/stat.h>],
+ [struct stat buffer;
+ fstat(0, &buffer);
+ S_IFREG & buffer.st_mode;],
+ [glibcxx_cv_S_IFREG=yes],
+ [glibcxx_cv_S_IFREG=no])
+ ])
+ if test $glibcxx_cv_S_ISREG = yes; then
+ AC_DEFINE(HAVE_S_ISREG)
+ elif test $glibcxx_cv_S_IFREG = yes; then
+ AC_DEFINE(HAVE_S_IFREG)
+ fi
+])
+
+
dnl
-dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'.
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [dnl
-define([GLIBCXX_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(libstdcxx_debug,
-changequote(<<, >>)dnl
-<< --enable-libstdcxx-debug build extra debug library [default=>>GLIBCXX_ENABLE_DEBUG_DEFAULT],
-changequote([, ])dnl
-[case "${enableval}" in
- yes) enable_libstdcxx_debug=yes ;;
- no) enable_libstdcxx_debug=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
- esac],
-enable_libstdcxx_debug=GLIBCXX_ENABLE_DEBUG_DEFAULT)dnl
-AC_MSG_CHECKING([for additional debug build])
-AC_MSG_RESULT($enable_libstdcxx_debug)
-AM_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test "$enable_libstdcxx_debug" = yes)
+dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
+dnl
+AC_DEFUN(GLIBCXX_CHECK_POLL, [
+ AC_CACHE_VAL(glibcxx_cv_POLL, [
+ AC_TRY_COMPILE(
+ [#include <poll.h>],
+ [struct pollfd pfd[1];
+ pfd[0].events = POLLIN;
+ poll(pfd, 1, 0);],
+ [glibcxx_cv_POLL=yes],
+ [glibcxx_cv_POLL=no])
+ ])
+ if test $glibcxx_cv_POLL = yes; then
+ AC_DEFINE(HAVE_POLL)
+ fi
])
-dnl Check for explicit debug flags.
dnl
-dnl GLIBCXX_ENABLE_DEBUG_FLAGS
+dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
dnl
-dnl --enable-libstdcxx-debug-flags='-O1'
-dnl is a general method for passing flags to be used when
-dnl building debug libraries with --enable-debug.
+AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
+ AC_CACHE_VAL(glibcxx_cv_WRITEV, [
+ AC_TRY_COMPILE(
+ [#include <sys/uio.h>],
+ [struct iovec iov[2];
+ writev(0, iov, 0);],
+ [glibcxx_cv_WRITEV=yes],
+ [glibcxx_cv_WRITEV=no])
+ ])
+ if test $glibcxx_cv_WRITEV = yes; then
+ AC_DEFINE(HAVE_WRITEV)
+ fi
+])
+
+
dnl
-dnl --disable-libstdcxx-debug-flags does nothing.
-dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
-dnl If "default flags" is an empty string (or "none"), the effect is
-dnl the same as --disable or --enable=no.
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [dnl
-define([GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
-AC_ARG_ENABLE(libstdcxx_debug_flags,
-changequote(<<, >>)dnl
-<< --enable-libstdcxx-debug-flags=FLAGS pass compiler FLAGS when building
- debug library;
- [default=>>GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT],
-changequote([, ])dnl
-[case "${enableval}" in
- none) ;;
- -*) enable_libstdcxx_debug_flags="${enableval}" ;;
- *) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
- esac],
-enable_libstdcxx_debug_flags=GLIBCXX_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
-
-dnl Option parsed, now set things appropriately
-case x"$enable_libstdcxx_debug" in
- xyes)
- case "$enable_libstdcxx_debug_flags" in
- none)
- DEBUG_FLAGS="-g3 -O0";;
- -*) #valid input
- DEBUG_FLAGS="${enableval}"
- esac
- ;;
- xno)
- DEBUG_FLAGS=""
- ;;
-esac
-AC_SUBST(DEBUG_FLAGS)
+dnl Does any necessary configuration of the testsuite directory. Generates
+dnl the testsuite_hooks.h header.
+dnl
+dnl GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE must be done before this.
+dnl
+dnl Sets:
+dnl enable_abi_check / GLIBCXX_TEST_ABI
+dnl Substs:
+dnl baseline_dir
+dnl
+AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
+ if $GLIBCXX_IS_NATIVE && test $is_hosted = yes; then
+ # Do checks for memory limit functions.
+ GLIBCXX_CHECK_SETRLIMIT
+
+ # Look for setenv, so that extended locale tests can be performed.
+ GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+
+ if test $enable_symvers = no; then
+ enable_abi_check=no
+ else
+ case "$host" in
+ *-*-cygwin*)
+ enable_abi_check=no ;;
+ *)
+ enable_abi_check=yes ;;
+ esac
+ fi
+ else
+ # Only build this as native, since automake does not understand
+ # CXX_FOR_BUILD.
+ enable_abi_check=no
+ fi
+
+ # Export file names for ABI checking.
+ baseline_dir="$glibcxx_srcdir/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
+ AC_SUBST(baseline_dir)
-AC_MSG_CHECKING([for debug build flags])
-AC_MSG_RESULT($DEBUG_FLAGS)
+ GLIBCXX_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test $enable_wchar_t = yes)
+ GLIBCXX_CONDITIONAL(GLIBCXX_TEST_ABI, test $enable_abi_check = yes)
])
dnl
-dnl Check for "unusual" flags to pass to the compiler while building.
+dnl Set up *_INCLUDES variables for all sundry Makefile.am's.
dnl
-dnl GLIBCXX_ENABLE_CXX_FLAGS
-dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
-dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
-dnl Somehow this same set of flags must be passed when [re]building
-dnl libgcc.
-dnl --disable-cxx-flags passes nothing.
-dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
-dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
-dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
-dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags)
-dnl If "default flags" is an empty string (or "none"), the effect is
-dnl the same as --disable or --enable=no.
-AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
-define([GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
-AC_MSG_CHECKING([for extra compiler flags for building])
-AC_ARG_ENABLE(cxx_flags,
-changequote(<<, >>)dnl
-<< --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
- [default=>>GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT],
-changequote([, ])dnl
-[case "x$enable_cxx_flags" in
- xyes)
- AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
- xno | xnone | x)
- enable_cxx_flags='' ;;
- *)
- enable_cxx_flags="$enableval" ;;
-esac],
-enable_cxx_flags=GLIBCXX_ENABLE_CXX_FLAGS_DEFAULT)
-
-dnl Run through flags (either default or command-line) and set anything
-dnl extra (e.g., #defines) that must accompany particular g++ options.
-if test -n "$enable_cxx_flags"; then
- for f in $enable_cxx_flags; do
- case "$f" in
- -fhonor-std) ;;
- -*) ;;
- *) # and we're trying to pass /what/ exactly?
- AC_MSG_ERROR([compiler flags start with a -]) ;;
+dnl Substs:
+dnl GLIBCXX_INCLUDES
+dnl TOPLEVEL_INCLUDES
+dnl
+AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
+ # Used for every C++ compile we perform.
+ GLIBCXX_INCLUDES="\
+-I$glibcxx_builddir/include/$host_alias \
+-I$glibcxx_builddir/include \
+-I$glibcxx_srcdir/libsupc++"
+
+ # For Canadian crosses, pick this up too.
+ if test $CANADIAN = yes; then
+ GLIBCXX_INCLUDES="$GLIBCXX_INCLUDES -I\${includedir}"
+ fi
+
+ # Stuff in the actual top level. Currently only used by libsupc++ to
+ # get unwind* headers from the gcc dir.
+ #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
+ TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
+
+ # Now, export this to all the little Makefiles....
+ AC_SUBST(GLIBCXX_INCLUDES)
+ AC_SUBST(TOPLEVEL_INCLUDES)
+])
+
+
+dnl
+dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
+dnl (SECTION_FLAGS is done under CHECK_COMPILER_FEATURES.)
+dnl
+dnl Substs:
+dnl OPTIMIZE_CXXFLAGS
+dnl WARN_FLAGS
+dnl
+AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
+ # Optimization flags that are probably a good idea for thrill-seekers. Just
+ # uncomment the lines below and make, everything else is ready to go...
+ # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
+ OPTIMIZE_CXXFLAGS=
+ AC_SUBST(OPTIMIZE_CXXFLAGS)
+
+ WARN_FLAGS='-Wall -W -Wwrite-strings -Wcast-qual'
+ AC_SUBST(WARN_FLAGS)
+])
+
+
+dnl
+dnl All installation directory information is determined here.
+dnl
+dnl Substs:
+dnl gxx_install_dir
+dnl glibcxx_prefixdir
+dnl glibcxx_toolexecdir
+dnl glibcxx_toolexeclibdir
+dnl
+dnl Assumes cross_compiling bits already done, and with_cross_host in
+dnl particular.
+dnl
+AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
+ glibcxx_toolexecdir=no
+ glibcxx_toolexeclibdir=no
+ glibcxx_prefixdir=$prefix
+
+ AC_MSG_CHECKING([for gxx-include-dir])
+ AC_ARG_WITH([gxx-include-dir],
+ AC_HELP_STRING([--with-gxx-include-dir=DIR],
+ [installation directory for include files]),
+ [case "$withval" in
+ yes) AC_MSG_ERROR([Missing directory for --with-gxx-include-dir]) ;;
+ no) gxx_include_dir=no ;;
+ *) gxx_include_dir=$withval ;;
+ esac],
+ [gxx_include_dir=no])
+ AC_MSG_RESULT($gxx_include_dir)
+
+ AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+ AC_ARG_ENABLE([version-specific-runtime-libs],
+ AC_HELP_STRING([--enable-version-specific-runtime-libs],
+ [Specify that runtime libraries should be installed in a compiler-specific directory]),
+ [case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+ [version_specific_libs=no])
+ AC_MSG_RESULT($version_specific_libs)
+
+ # Default case for install directory for include files.
+ if test $version_specific_libs = no && test $gxx_include_dir = no; then
+ gxx_include_dir='${prefix}'/include/c++/${gcc_version}
+ fi
+
+ # Version-specific runtime libs processing.
+ if test $version_specific_libs = yes; then
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ if test x"$gxx_include_dir" = x"no"; then
+ gxx_include_dir='${libdir}/gcc-lib/${host_alias}/'$gcc_version/include/c++
+ fi
+ glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+ glibcxx_toolexeclibdir='${toolexecdir}/'$gcc_version'$(MULTISUBDIR)'
+ fi
+
+ # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ if test x"$glibcxx_toolexecdir" = x"no"; then
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
+ glibcxx_toolexeclibdir='${toolexecdir}/lib'
+ else
+ glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+ glibcxx_toolexeclibdir='${libdir}'
+ fi
+ multi_os_directory=`$CXX -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
esac
- done
-fi
-EXTRA_CXX_FLAGS="$enable_cxx_flags"
-AC_MSG_RESULT($EXTRA_CXX_FLAGS)
-AC_SUBST(EXTRA_CXX_FLAGS)
+ fi
+
+ AC_MSG_CHECKING([for install location])
+ AC_MSG_RESULT($gxx_include_dir)
+
+ AC_SUBST(glibcxx_prefixdir)
+ AC_SUBST(gxx_include_dir)
+ AC_SUBST(glibcxx_toolexecdir)
+ AC_SUBST(glibcxx_toolexeclibdir)
])
dnl
-dnl Check for which locale library to use: gnu or generic.
+dnl GLIBCXX_ENABLE
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
+dnl
+dnl See docs/html/17_intro/configury.html#enable for documentation.
+dnl
+m4_define([GLIBCXX_ENABLE],[dnl
+m4_define([_g_switch],[--enable-$1])dnl
+m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
+ AC_ARG_ENABLE($1,_g_help,
+ m4_bmatch([$5],
+ [^permit ],
+ [[
+ case "$enableval" in
+ m4_bpatsubst([$5],[permit ])) ;;
+ *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
+ dnl Idea for future: generate a URL pointing to
+ dnl "onlinedocs/configopts.html#whatever"
+ esac
+ ]],
+ [^$],
+ [[
+ case "$enableval" in
+ yes|no) ;;
+ *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
+ esac
+ ]],
+ [[$5]]),
+ [enable_]m4_bpatsubst([$1],-,_)[=][$2])
+m4_undefine([_g_switch])dnl
+m4_undefine([_g_help])dnl
+])
+
+
dnl
-dnl GLIBCXX_ENABLE_CLOCALE
-dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
-dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
+dnl Check for ISO/IEC 9899:1999 "C99" support.
dnl
-dnl default is generic
+dnl --enable-c99 defines _GLIBCXX_USE_C99
+dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
+dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
+dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_C99, [
+ GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support])
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ # Check for the existence of <math.h> functions used if C99 is enabled.
+ ac_c99_math=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <math.h>])
+ AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [islessgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isunordered(0.0,0.0);],, [ac_c99_math=no])
+ AC_MSG_RESULT($ac_c99_math)
+
+ # Check for the existence in <stdio.h> of vscanf, et. al.
+ ac_c99_stdio=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vfscanf(stderr, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vscanf("%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsnprintf(fmt, 0, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsscanf(fmt, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_MSG_RESULT($ac_c99_stdio)
+
+ # Check for the existence in <stdlib.h> of lldiv_t, et. al.
+ ac_c99_stdlib=yes;
+ AC_MSG_CHECKING([for lldiv_t declaration])
+ AC_CACHE_VAL(ac_c99_lldiv_t, [
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [ lldiv_t mydivt;],
+ [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
+ ])
+ AC_MSG_RESULT($ac_c99_lldiv_t)
+
+ AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
+ if test x"$ac_c99_lldiv_t" = x"no"; then
+ ac_c99_stdlib=no;
+ fi;
+ AC_MSG_RESULT($ac_c99_stdlib)
+
+ # Check for the existence of <wchar.h> functions used if C99 is enabled.
+ # XXX the wchar.h checks should be rolled into the general C99 bits.
+ ac_c99_wchar=yes;
+ AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_MSG_RESULT($ac_c99_wchar)
+
+ AC_MSG_CHECKING([for enabled ISO C99 support])
+ if test x"$ac_c99_math" = x"no" ||
+ test x"$ac_c99_stdio" = x"no" ||
+ test x"$ac_c99_stdlib" = x"no" ||
+ test x"$ac_c99_wchar" = x"no"; then
+ enable_c99=no;
+ fi;
+ AC_MSG_RESULT($enable_c99)
+
+ # Option parsed, now set things appropriately
+ if test x"$enable_c99" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99)
+ fi
+
+ AC_LANG_RESTORE
+])
+
+
+dnl
+dnl Check for what type of C headers to use.
+dnl
+dnl --enable-cheaders= [does stuff].
+dnl --disable-cheaders [does not do anything, really].
+dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
+dnl Where DEFAULT is either `c' or `c_std'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [
+ GLIBCXX_ENABLE(cheaders,$1,[=KIND],
+ [construct "C" headers for g++], [permit c|c_std])
+ AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
+
+ C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders
+
+ AC_SUBST(C_INCLUDE_DIR)
+ GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C, test $enable_cheaders = c)
+ GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test $enable_cheaders = c_std)
+ GLIBCXX_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test $c_compatibility = yes)
+])
+
+
+dnl
+dnl Check for which locale library to use. The choice is mapped to
+dnl a subdirectory of config/locale.
+dnl
+dnl Default is generic.
dnl
AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
- AC_MSG_CHECKING([for clocale to use])
- AC_ARG_ENABLE(clocale,
- [ --enable-clocale enable model for target locale package.
- --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
- ],
- if test x$enable_clocale = xno; then
- enable_clocale=no
- fi,
- enable_clocale=no)
+ AC_MSG_CHECKING([for C locale to use])
+ GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
+ [use MODEL for target locale package],
+ [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
+
+ # If they didn't use this option switch, or if they specified --enable
+ # with no specific model, we'll have to look for one. If they
+ # specified --disable (???), do likewise.
+ if test $enable_clocale = no || test $enable_clocale = yes; then
+ enable_clocale=auto
+ fi
+ # Either a known package, or "auto"
enable_clocale_flag=$enable_clocale
- dnl Probe for locale support if no specific model is specified.
- dnl Default to "generic"
- if test x$enable_clocale_flag = xno; then
+ # Probe for locale support if no specific model is specified.
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
case x${target_os} in
xlinux* | xgnu*)
- AC_EGREP_CPP([_GLIBCXX_ok], [
+ AC_EGREP_CPP([_GLIBCXX_ok], [
#include <features.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
_GLIBCXX_ok
#endif
], enable_clocale_flag=gnu, enable_clocale_flag=generic)
- # Test for bugs early in glibc-2.2.x series
- if test x$enable_clocale_flag = xgnu; then
- AC_TRY_RUN([
- #define _GNU_SOURCE 1
- #include <locale.h>
- #include <string.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- extern __typeof(newlocale) __newlocale;
- extern __typeof(duplocale) __duplocale;
- extern __typeof(strcoll_l) __strcoll_l;
- #endif
- int main()
- {
- const char __one[] = "Äuglein Augmen";
- const char __two[] = "Äuglein";
- int i;
- int j;
- __locale_t loc;
- __locale_t loc_dup;
- loc = __newlocale(1 << LC_ALL, "de_DE", 0);
- loc_dup = __duplocale(loc);
- i = __strcoll_l(__one, __two, loc);
- j = __strcoll_l(__one, __two, loc_dup);
- return 0;
- }
- ],
- [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
- [enable_clocale_flag=generic])
- fi
-
- # ... at some point put __strxfrm_l tests in as well.
+ # Test for bugs early in glibc-2.2.x series
+ if test x$enable_clocale_flag = xgnu; then
+ AC_TRY_RUN([
+ #define _GNU_SOURCE 1
+ #include <locale.h>
+ #include <string.h>
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ extern __typeof(newlocale) __newlocale;
+ extern __typeof(duplocale) __duplocale;
+ extern __typeof(strcoll_l) __strcoll_l;
+ #endif
+ int main()
+ {
+ const char __one[] = "Äuglein Augmen";
+ const char __two[] = "Äuglein";
+ int i;
+ int j;
+ __locale_t loc;
+ __locale_t loc_dup;
+ loc = __newlocale(1 << LC_ALL, "de_DE", 0);
+ loc_dup = __duplocale(loc);
+ i = __strcoll_l(__one, __two, loc);
+ j = __strcoll_l(__one, __two, loc_dup);
+ return 0;
+ }
+ ],
+ [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
+ [enable_clocale_flag=generic])
+ fi
+
+ # ... at some point put __strxfrm_l tests in as well.
;;
*)
- enable_clocale_flag=generic
- ;;
+ enable_clocale_flag=generic
+ ;;
esac
fi
- dnl Deal with gettext issues.
- AC_ARG_ENABLE(nls,
- [ --enable-nls use Native Language Support (default)],
- , enable_nls=yes)
+ # Deal with gettext issues. Default to not using it (=no) until we detect
+ # support for it later. Let the user turn it off via --e/d, but let that
+ # default to on for easier handling.
USE_NLS=no
+ AC_ARG_ENABLE(nls,
+ AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
+ [],
+ [enable_nls=yes])
- dnl Set configure bits for specified locale package
- case x${enable_clocale_flag} in
- xgeneric)
+ # Set configure bits for specified locale package
+ case ${enable_clocale_flag} in
+ generic)
AC_MSG_RESULT(generic)
CLOCALE_H=config/locale/generic/c_locale.h
@@ -1253,7 +1038,7 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
- xgnu)
+ gnu)
AC_MSG_RESULT(gnu)
# Declare intention to use gettext, and add support for specific
@@ -1264,7 +1049,7 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
# Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
- USE_NLS=yes
+ USE_NLS=yes
fi
# Export the build objects.
for ling in $ALL_LINGUAS; do \
@@ -1288,7 +1073,7 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
CTIME_CC=config/locale/gnu/time_members.cc
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;;
- xieee_1003.1-2001)
+ ieee_1003.1-2001)
AC_MSG_RESULT(IEEE 1003.1)
CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
@@ -1305,10 +1090,6 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
- *)
- echo "$enable_clocale is an unknown locale package" 1>&2
- exit 1
- ;;
esac
# This is where the testsuite looks for locale catalogs, using the
@@ -1343,38 +1124,41 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
dnl
-dnl Check for which I/O library to use: stdio, or something specific.
+dnl Check for whether the Boost-derived checks should be turned on.
+dnl
+dnl --enable-concept-checks turns them on.
+dnl --disable-concept-checks leaves them off.
+dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
dnl
-dnl GLIBCXX_ENABLE_CSTDIO
+AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [
+ GLIBCXX_ENABLE(concept-checks,$1,,[use Boost-derived template checks])
+ if test $enable_concept_checks = yes; then
+ AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
+ fi
+])
+
+
+dnl
+dnl Check for which I/O library to use: stdio, or something specific.
dnl
-dnl default is stdio
+dnl Default is stdio.
dnl
AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
- AC_MSG_CHECKING([for cstdio to use])
- AC_ARG_ENABLE(cstdio,
- [ --enable-cstdio enable stdio for target io package.
- --enable-cstdio=LIB use LIB target-specific io package. [default=stdio]
- ],
- if test x$enable_cstdio = xno; then
- enable_cstdio=stdio
- fi,
- enable_cstdio=stdio)
-
- enable_cstdio_flag=$enable_cstdio
-
- dnl Check if a valid I/O package
- case x${enable_cstdio_flag} in
- xstdio | x | xno | xnone | xyes)
- # default
+ AC_MSG_CHECKING([for underlying I/O to use])
+ GLIBCXX_ENABLE(cstdio,stdio,[=PACKAGE],
+ [use target-specific I/O package], [permit stdio])
+
+ # Now that libio has been removed, you can have any color you want as long
+ # as it's black. This is one big no-op until other packages are added, but
+ # showing the framework never hurts.
+ case ${enable_cstdio} in
+ stdio)
CSTDIO_H=config/io/c_io_stdio.h
BASIC_FILE_H=config/io/basic_file_stdio.h
BASIC_FILE_CC=config/io/basic_file_stdio.cc
AC_MSG_RESULT(stdio)
;;
- *)
- echo "$enable_cstdio is an unknown io package" 1>&2
- exit 1
- ;;
esac
dnl Set directory for fpos.h
@@ -1388,176 +1172,169 @@ AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
dnl
-dnl Check to see if building and using a C++ precompiled header can be done.
-dnl
-dnl GLIBCXX_ENABLE_PCH
-dnl
-dnl --enable-libstdcxx-pch=yes
-dnl default, this shows intent to use stdc++.h.gch If it looks like it
-dnl may work, after some light-hearted attempts to puzzle out compiler
-dnl support, flip bits on in include/Makefile.am
+dnl Check for "unusual" flags to pass to the compiler while building.
dnl
-dnl --disable-libstdcxx-pch
-dnl turns off attempts to use or build stdc++.h.gch.
+dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
+dnl experimental flags such as -fpch, -fIMI, -Dfloat=char, etc.
+dnl --disable-cxx-flags passes nothing.
+dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
+dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
+dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
+dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags)
+dnl If "default flags" is an empty string, the effect is the same
+dnl as --disable or --enable=no.
dnl
-AC_DEFUN(GLIBCXX_ENABLE_PCH, [dnl
-define([GLIBCXX_ENABLE_PCH_DEFAULT], ifelse($1,,, $1))dnl
-AC_ARG_ENABLE(libstdcxx_pch,
-changequote(<<, >>)dnl
-<< --enable-libstdcxx-pch build pre-compiled libstdc++ includes [default=>>GLIBCXX_ENABLE_PCH_DEFAULT],
-changequote([, ])dnl
-[case "${enableval}" in
- yes) enable_libstdcxx_pch=yes ;;
- no) enable_libstdcxx_pch=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable PCH]) ;;
- esac],
-enable_libstdcxx_pch=GLIBCXX_ENABLE_PCH_DEFAULT)dnl
-
- if test x$enable_libstdcxx_pch = xyes; then
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
-
- AC_MSG_CHECKING([for compiler that seems to compile .gch files])
- if test x${pch_comp+set} != xset; then
- AC_CACHE_VAL(pch_comp, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>], ,
- [pch_comp=yes], [pch_comp=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT([$pch_comp])
-
- CXXFLAGS="$ac_save_CXXFLAGS"
+AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
+ AC_MSG_CHECKING([for extra compiler flags for building])
+ GLIBCXX_ENABLE(cxx-flags,$1,[=FLAGS],
+ [pass compiler FLAGS when building library],
+ [case "x$enable_cxx_flags" in
+ xno | x) enable_cxx_flags= ;;
+ x-*) ;;
+ *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
+ esac])
+
+ # Run through flags (either default or command-line) and set anything
+ # extra (e.g., #defines) that must accompany particular g++ options.
+ if test -n "$enable_cxx_flags"; then
+ for f in $enable_cxx_flags; do
+ case "$f" in
+ -fhonor-std) ;;
+ -*) ;;
+ *) # and we're trying to pass /what/ exactly?
+ AC_MSG_ERROR([compiler flags start with a -]) ;;
+ esac
+ done
fi
- if test x"$enable_libstdcxx_pch" = xyes && test x"$pch_comp" = xno; then
- enable_pch=no
- fi
+ EXTRA_CXX_FLAGS="$enable_cxx_flags"
+ AC_MSG_RESULT($EXTRA_CXX_FLAGS)
+ AC_SUBST(EXTRA_CXX_FLAGS)
+])
- AC_MSG_CHECKING([for enabled PCH])
- AC_MSG_RESULT([$enable_libstdcxx_pch])
- AM_CONDITIONAL(GLIBCXX_BUILD_PCH, test "$enable_libstdcxx_pch" = yes)
- if test "$enable_libstdcxx_pch" = yes; then
- glibcxx_PCHFLAGS="-include bits/stdc++.h"
- else
- glibcxx_PCHFLAGS=""
- fi
- AC_SUBST(glibcxx_PCHFLAGS)
+dnl
+dnl Check for wide character support. Has the same effect as the option
+dnl in gcc's configure, but in a form that autoconf can mess with.
+dnl
+dnl --enable-c-mbchar requests all the wchar_t stuff.
+dnl --disable-c-mbchar doesn't.
+dnl + Usage: GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [
+ GLIBCXX_ENABLE(c-mbchar,$1,,[enable multibyte (wide) characters])
+ # Option parsed, now other scripts can test enable_c_mbchar for yes/no.
])
+
dnl
-dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
-dnl We must stage the required headers so that they will be installed
-dnl with the library (unlike libgcc, the STL implementation is provided
-dnl solely within headers). Since we must not inject random user-space
-dnl macro names into user-provided C++ code, we first stage into <file>-in
-dnl and process to <file> with an output command. The reason for a two-
-dnl stage process here is to correctly handle $srcdir!=$objdir without
-dnl having to write complex code (the sed commands to clean the macro
-dnl namespace are complex and fragile enough as it is). We must also
-dnl add a relative path so that -I- is supported properly.
+dnl Check to see if debugging libraries are to be built.
dnl
-AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
- AC_MSG_CHECKING([for thread model used by GCC])
- target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
- AC_MSG_RESULT([$target_thread_file])
+dnl --enable-libstdcxx-debug
+dnl builds a separate set of debugging libraries in addition to the
+dnl normal (shared, static) libstdc++ binaries.
+dnl
+dnl --disable-libstdcxx-debug
+dnl builds only one (non-debug) version of libstdc++.
+dnl
+dnl --enable-libstdcxx-debug-flags=FLAGS
+dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
+dnl
+dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [
+ AC_MSG_CHECKING([for additional debug build])
+ GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library])
+ AC_MSG_RESULT($enable_libstdcxx_debug)
+ GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test $enable_libstdcxx_debug = yes)
+])
- if test $target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT)
- AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
- fi
- glibcxx_thread_h=gthr-$target_thread_file.h
- AC_SUBST(glibcxx_thread_h)
+dnl
+dnl Check for explicit debug flags.
+dnl
+dnl --enable-libstdcxx-debug-flags='-O1'
+dnl is a general method for passing flags to be used when
+dnl building debug libraries with --enable-debug.
+dnl
+dnl --disable-libstdcxx-debug-flags does nothing.
+dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
+dnl If "default flags" is an empty string, the effect is the same
+dnl as --disable or --enable=no.
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [
+ GLIBCXX_ENABLE(libstdcxx-debug-flags,[$1],[=FLAGS],
+ [pass compiler FLAGS when building debug library],
+ [case "x$enable_libstdcxx_debug_flags" in
+ xno | x) enable_libstdcxx_debug_flags= ;;
+ x-*) ;;
+ *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
+ esac])
+
+ # Option parsed, now set things appropriately
+ DEBUG_FLAGS="$enable_libstdcxx_debug_flags"
+ AC_SUBST(DEBUG_FLAGS)
+
+ AC_MSG_NOTICE([Debug build flags set to $DEBUG_FLAGS])
])
dnl
-dnl Check for exception handling support. If an explicit enable/disable
-dnl sjlj exceptions is given, we don't have to detect. Otherwise the
-dnl target may or may not support call frame exceptions.
+dnl Check if the user only wants a freestanding library implementation.
dnl
-dnl GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
-dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
-dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
+dnl --disable-hosted-libstdcxx will turn off most of the library build,
+dnl installing only the headers required by [17.4.1.3] and the language
+dnl support library. More than that will be built (to keep the Makefiles
+dnl conveniently clean), but not installed.
dnl
-dnl Define _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it.
+dnl Sets:
+dnl is_hosted (yes/no)
dnl
-AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
- AC_MSG_CHECKING([for exception model to use])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_ARG_ENABLE(sjlj-exceptions,
- [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
- [:],
- [dnl Botheration. Now we've got to detect the exception model.
- dnl Link tests against libgcc.a are problematic since -- at least
- dnl as of this writing -- we've not been given proper -L bits for
- dnl single-tree newlib and libgloss.
- dnl
- dnl This is what AC_TRY_COMPILE would do if it didn't delete the
- dnl conftest files before we got a change to grep them first.
- cat > conftest.$ac_ext << EOF
-[#]line __oline__ "configure"
-struct S { ~S(); };
-void bar();
-void foo()
-{
- S s;
- bar();
-}
-EOF
- old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
- if AC_TRY_EVAL(ac_compile); then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
- fi
- CXXFLAGS="$old_CXXFLAGS"
- rm -f conftest*])
- if test x$enable_sjlj_exceptions = xyes; then
- AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
- [Define if the compiler is configured for setjmp/longjmp exceptions.])
- ac_exception_model_name=sjlj
- elif test x$enable_sjlj_exceptions = xno; then
- ac_exception_model_name="call frame"
- else
- AC_MSG_ERROR([unable to detect exception model])
- fi
- AC_LANG_RESTORE
- AC_MSG_RESULT($ac_exception_model_name)
+dnl Defines:
+dnl _GLIBCXX_HOSTED (always defined, either to 1 or 0)
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_HOSTED, [
+ AC_ARG_ENABLE([hosted-libstdcxx],
+ AC_HELP_STRING([--disable-hosted-libstdcxx],
+ [only build freestanding C++ runtime support]),,
+ [enable_hosted_libstdcxx=yes])
+ if test "$enable_hosted_libstdcxx" = no; then
+ AC_MSG_NOTICE([Only freestanding libraries will be built])
+ is_hosted=no
+ hosted_define=0
+ enable_abi_check=no
+ enable_libstdcxx_pch=no
+ else
+ is_hosted=yes
+ hosted_define=1
+ fi
+ GLIBCXX_CONDITIONAL(GLIBCXX_HOSTED, test $is_hosted = yes)
+ AC_DEFINE_UNQUOTED(_GLIBCXX_HOSTED, $hosted_define,
+ [Define to 1 if a full hosted library is built, or 0 if freestanding.])
])
dnl
-dnl Check for libunwind exception handling support. If enabled then
+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 libunwind instead of libgcc, and that libstdc++ has a dependency
dnl on libunwind as well as libgcc.
dnl
-dnl GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS
dnl --enable-libunwind-exceptions forces the use of libunwind.
dnl --disable-libunwind-exceptions assumes there is no libunwind.
dnl
-dnl Define _GLIBCXX_LIBUNWIND_EXCEPTIONS if requested.
+dnl Substs:
+dnl LIBUNWIND_FLAG
dnl
AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
AC_MSG_CHECKING([for use of libunwind])
- AC_ARG_ENABLE(libunwind-exceptions,
- [ --enable-libunwind-exceptions force use of libunwind for exceptions],
- use_libunwind_exceptions=$enableval,
- use_libunwind_exceptions=no)
+ GLIBCXX_ENABLE(libunwind-exceptions,no,,
+ [force use of libunwind for exceptions])
AC_MSG_RESULT($use_libunwind_exceptions)
- dnl Option parsed, now set things appropriately
- if test x"$use_libunwind_exceptions" = xyes; then
+ if test $enable_libunwind_exceptions = yes; then
LIBUNWIND_FLAG="-lunwind"
else
LIBUNWIND_FLAG=""
@@ -1565,167 +1342,20 @@ AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
AC_SUBST(LIBUNWIND_FLAG)
])
-dnl
-dnl Check for ISO/IEC 9899:1999 "C99" support.
-dnl
-dnl GLIBCXX_ENABLE_C99
-dnl --enable-c99 defines _GLIBCXX_USE_C99
-dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
-dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If omitted, it
-dnl defaults to `no'.
-dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
-dnl
-dnl GLIBCXX_ENABLE_C99
-AC_DEFUN(GLIBCXX_ENABLE_C99, [dnl
- define([GLIBCXX_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
-
- AC_ARG_ENABLE(c99,
- changequote(<<, >>)dnl
- <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCXX_ENABLE_C99_DEFAULT],
- changequote([, ])dnl
- [case "$enableval" in
- yes) enable_c99=yes ;;
- no) enable_c99=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
- esac],
- enable_c99=GLIBCXX_ENABLE_C99_DEFAULT)dnl
-
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
- # Check for the existence of <math.h> functions used if C99 is enabled.
- ac_c99_math=yes;
- AC_MSG_CHECKING([for ISO C99 support in <math.h>])
- AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [islessgreater(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [isunordered(0.0,0.0);],, [ac_c99_math=no])
- AC_MSG_RESULT($ac_c99_math)
-
- # Check for the existence in <stdio.h> of vscanf, et. al.
- ac_c99_stdio=yes;
- AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
- AC_TRY_COMPILE([#include <stdio.h>],
- [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vfscanf(stderr, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vscanf("%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsnprintf(fmt, 0, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsscanf(fmt, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_MSG_RESULT($ac_c99_stdio)
-
- # Check for the existence in <stdlib.h> of lldiv_t, et. al.
- ac_c99_stdlib=yes;
- AC_MSG_CHECKING([for lldiv_t declaration])
- AC_CACHE_VAL(ac_c99_lldiv_t, [
- AC_TRY_COMPILE([#include <stdlib.h>],
- [ lldiv_t mydivt;],
- [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
- ])
- AC_MSG_RESULT($ac_c99_lldiv_t)
-
- AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
- if test x"$ac_c99_lldiv_t" = x"no"; then
- ac_c99_stdlib=no;
- fi;
- AC_MSG_RESULT($ac_c99_stdlib)
-
- # Check for the existence of <wchar.h> functions used if C99 is enabled.
- # XXX the wchar.h checks should be rolled into the general C99 bits.
- ac_c99_wchar=yes;
- AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_MSG_RESULT($ac_c99_wchar)
-
- AC_MSG_CHECKING([for enabled ISO C99 support])
- if test x"$ac_c99_math" = x"no" ||
- test x"$ac_c99_stdio" = x"no" ||
- test x"$ac_c99_stdlib" = x"no" ||
- test x"$ac_c99_wchar" = x"no"; then
- enable_c99=no;
- fi;
- AC_MSG_RESULT($enable_c99)
-
- # Option parsed, now set things appropriately
- if test x"$enable_c99" = x"yes"; then
- AC_DEFINE(_GLIBCXX_USE_C99)
- fi
-
- AC_LANG_RESTORE
-])
-
dnl
dnl Check for template specializations for the 'long long' type extension.
dnl The result determines only whether 'long long' I/O is enabled; things
dnl like numeric_limits<> specializations are always available.
dnl
-dnl GLIBCXX_ENABLE_LONG_LONG
dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG
dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined
dnl + Usage: GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If omitted, it
-dnl defaults to `no'.
+dnl Where DEFAULT is either `yes' or `no'.
dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
dnl
-dnl GLIBCXX_ENABLE_LONG_LONG
-AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [dnl
- define([GLIBCXX_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
-
- AC_ARG_ENABLE(long-long,
- changequote(<<, >>)dnl
- <<--enable-long-long turns on 'long long' [default=>>GLIBCXX_ENABLE_LONG_LONG_DEFAULT],
- changequote([, ])dnl
- [case "$enableval" in
- yes) enable_long_long=yes ;;
- no) enable_long_long=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
- esac],
- enable_long_long=GLIBCXX_ENABLE_LONG_LONG_DEFAULT)dnl
+AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [
+ GLIBCXX_ENABLE(long-long,$1,,[enables I/O support for 'long long'])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -1738,7 +1368,7 @@ AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [dnl
[char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
# Option parsed, now set things appropriately
- if test x"$enable_long_long" = xyes; then
+ if test $enable_long_long = yes; then
AC_DEFINE(_GLIBCXX_USE_LONG_LONG)
fi
AC_MSG_RESULT($enable_long_long)
@@ -1748,432 +1378,260 @@ AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [dnl
dnl
-dnl Check for what type of C headers to use.
-dnl
-dnl GLIBCXX_ENABLE_CHEADERS
-dnl --enable-cheaders= [does stuff].
-dnl --disable-cheaders [does not do anything, really].
-dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
-dnl Where DEFAULT is either `c' or `c_std'.
-dnl If ommitted, it defaults to `c_std'.
-AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [dnl
-define([GLIBCXX_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
-AC_MSG_CHECKING([for c header strategy to use])
-AC_ARG_ENABLE(cheaders,
-changequote(<<, >>)dnl
-<< --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCXX_ENABLE_CHEADERS_DEFAULT],
-changequote([, ])
- [case "$enableval" in
- c)
- enable_cheaders=c
- ;;
- c_std)
- enable_cheaders=c_std
- ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
- ;;
- esac],
- enable_cheaders=GLIBCXX_ENABLE_CHEADERS_DEFAULT)
- AC_MSG_RESULT($enable_cheaders)
-
- dnl Option parsed, now set things appropriately
- case "$enable_cheaders" in
- c_std)
- C_INCLUDE_DIR='${glibcxx_srcdir}/include/c_std'
- ;;
- c)
- C_INCLUDE_DIR='${glibcxx_srcdir}/include/c'
- ;;
- esac
-
- AC_SUBST(C_INCLUDE_DIR)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_C, test "$enable_cheaders" = c)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
-])
-
-
-dnl
-dnl Check for wide character support. Has the same effect as the option
-dnl in gcc's configure, but in a form that autoconf can mess with.
+dnl Check to see if building and using a C++ precompiled header can be done.
dnl
-dnl GLIBCXX_ENABLE_C_MBCHAR
-dnl --enable-c-mbchar requests all the wchar_t stuff.
-dnl --disable-c-mbchar doesn't.
-dnl + Usage: GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'.
-AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [dnl
-define([GLIBCXX_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(c-mbchar,
-changequote(<<, >>)dnl
-<< --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCXX_ENABLE_C_MBCHAR_DEFAULT],
-changequote([, ])dnl
-[case "$enableval" in
- yes) enable_c_mbchar=yes ;;
- no) enable_c_mbchar=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
- esac],
-enable_c_mbchar=GLIBCXX_ENABLE_C_MBCHAR_DEFAULT)dnl
-dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
-])
-
-
+dnl --enable-libstdcxx-pch=yes
+dnl default, this shows intent to use stdc++.h.gch If it looks like it
+dnl may work, after some light-hearted attempts to puzzle out compiler
+dnl support, flip bits on in include/Makefile.am
dnl
-dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
+dnl --disable-libstdcxx-pch
+dnl turns off attempts to use or build stdc++.h.gch.
dnl
-dnl TOPLEVEL_INCLUDES
-dnl LIBMATH_INCLUDES
-dnl LIBSUPCXX_INCLUDES
+dnl Substs:
+dnl glibcxx_PCHFLAGS
dnl
-dnl GLIBCXX_EXPORT_INCLUDES
-AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
- # Root level of the build directory include sources.
- GLIBCXX_INCLUDES="-I${glibcxx_builddir}/include/${target_alias} -I${glibcxx_builddir}/include"
+AC_DEFUN(GLIBCXX_ENABLE_PCH, [
+ AC_MSG_CHECKING([for enabled PCH])
+ GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++ headers])
+ AC_MSG_RESULT([$enable_libstdcxx_pch])
- # Passed down for canadian crosses.
- if test x"$CANADIAN" = xyes; then
- TOPLEVEL_INCLUDES='-I$(includedir)'
+ if test $enable_libstdcxx_pch = yes; then
+ AC_CACHE_CHECK([for compiler with PCH support],
+ [glibcxx_cv_prog_CXX_pch],
+ [ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ echo '#include <math.h>' > conftest.h
+ if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
+ -o conftest.h.gch 1>&5 2>&1 &&
+ echo '#error "pch failed"' > conftest.h &&
+ echo '#include "conftest.h"' > conftest.cc &&
+ $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ;
+ then
+ glibcxx_cv_prog_CXX_pch=yes
+ else
+ glibcxx_cv_prog_CXX_pch=no
+ fi
+ rm -f conftest*
+ CXXFLAGS=$ac_save_CXXFLAGS
+ AC_LANG_RESTORE
+ ])
+ enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch
fi
- LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
-
- LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
-
- # Now, export this to all the little Makefiles....
- AC_SUBST(GLIBCXX_INCLUDES)
- AC_SUBST(TOPLEVEL_INCLUDES)
- AC_SUBST(LIBMATH_INCLUDES)
- AC_SUBST(LIBSUPCXX_INCLUDES)
+ GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_PCH, test $enable_libstdcxx_pch = yes)
+ if test $enable_libstdcxx_pch = yes; then
+ glibcxx_PCHFLAGS="-include bits/stdc++.h"
+ else
+ glibcxx_PCHFLAGS=""
+ fi
+ AC_SUBST(glibcxx_PCHFLAGS)
])
dnl
-dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
+dnl Check for exception handling support. If an explicit enable/disable
+dnl sjlj exceptions is given, we don't have to detect. Otherwise the
+dnl target may or may not support call frame exceptions.
dnl
-AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
- # Optimization flags that are probably a good idea for thrill-seekers. Just
- # uncomment the lines below and make, everything else is ready to go...
- # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
- OPTIMIZE_CXXFLAGS=
- AC_SUBST(OPTIMIZE_CXXFLAGS)
+dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
+dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
+dnl Neither one forces an attempt at detection.
+dnl
+dnl Defines:
+dnl _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
+dnl
+AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
+ AC_MSG_CHECKING([for exception model to use])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ GLIBCXX_ENABLE(sjlj-exceptions,auto,,
+ [force use of builtin_setjmp for exceptions],
+ [permit yes|no|auto])
+
+ if test $enable_sjlj_exceptions = auto; then
+ # Botheration. Now we've got to detect the exception model. Link tests
+ # against libgcc.a are problematic since we've not been given proper -L
+ # bits for single-tree newlib and libgloss.
+ #
+ # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+struct S { ~S(); };
+void bar();
+void foo()
+{
+ S s;
+ bar();
+}
+EOF
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=-S
+ if AC_TRY_EVAL(ac_compile); then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
+ fi
+ CXXFLAGS="$old_CXXFLAGS"
+ rm -f conftest*
+ fi
- WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
- AC_SUBST(WARN_FLAGS)
+ # This is a tad weird, for hysterical raisins. We have to map enable/disable
+ # to two different models.
+ case $enable_sjlj_exceptions in
+ yes)
+ AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
+ [Define if the compiler is configured for setjmp/longjmp exceptions.])
+ ac_exception_model_name=sjlj
+ ;;
+ no)
+ ac_exception_model_name="call frame"
+ ;;
+ *)
+ AC_MSG_ERROR([unable to detect exception model])
+ ;;
+ esac
+ AC_LANG_RESTORE
+ AC_MSG_RESULT($ac_exception_model_name)
])
+
dnl
-dnl GLIBCXX_EXPORT_INSTALL_INFO
-dnl calculates gxx_install_dir
-dnl exports glibcxx_toolexecdir
-dnl exports glibcxx_toolexeclibdir
-dnl exports glibcxx_prefixdir
+dnl Add version tags to symbols in shared library (or not), additionally
+dnl marking other symbols as private/local (or not).
dnl
-dnl Assumes cross_compiling bits already done, and with_cross_host in
-dnl particular
+dnl --enable-symvers=style adds a version script to the linker call when
+dnl creating the shared library. The choice of version script is
+dnl controlled by 'style'.
+dnl --disable-symvers does not.
+dnl + Usage: GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
+dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to
+dnl choose a default style based on linker characteristics. Passing
+dnl 'no' disables versioning.
dnl
-dnl GLIBCXX_EXPORT_INSTALL_INFO
-AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
-# Assumes glibcxx_builddir, glibcxx_srcdir are alreay set up and
-# exported correctly in GLIBCXX_CONFIGURE.
-glibcxx_toolexecdir=no
-glibcxx_toolexeclibdir=no
-glibcxx_prefixdir=${prefix}
-
-# Process the option --with-gxx-include-dir=<path to include-files directory>
-AC_MSG_CHECKING([for --with-gxx-include-dir])
-AC_ARG_WITH(gxx-include-dir,
-[ --with-gxx-include-dir the installation directory for include files],
-[case "${withval}" in
- yes)
- AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
- gxx_include_dir=no
- ;;
- no)
- gxx_include_dir=no
- ;;
- *)
- gxx_include_dir=${withval}
- ;;
-esac], [gxx_include_dir=no])
-AC_MSG_RESULT($gxx_include_dir)
+AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [
-# Process the option "--enable-version-specific-runtime-libs"
-AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
-AC_ARG_ENABLE(version-specific-runtime-libs,
-[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
-[case "$enableval" in
- yes) version_specific_libs=yes ;;
- no) version_specific_libs=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
- esac],
-version_specific_libs=no)dnl
-# Option set, now we can test it.
-AC_MSG_RESULT($version_specific_libs)
-
-# Default case for install directory for include files.
-if test $version_specific_libs = no && test $gxx_include_dir = no; then
- gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
-fi
+GLIBCXX_ENABLE(symvers,$1,[=STYLE],
+ [enables symbol versioning of the shared library],
+ [permit yes|no|gnu])
-# Version-specific runtime libs processing.
-if test $version_specific_libs = yes; then
- # Need the gcc compiler version to know where to install libraries
- # and header files if --enable-version-specific-runtime-libs option
- # is selected.
- if test x"$gxx_include_dir" = x"no"; then
- gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
- fi
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
+# don't know enough about $LD to do tricks...
+AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
+# FIXME The following test is too strict, in theory.
+if test $enable_shared = no ||
+ test "x$LD" = x ||
+ test x$glibcxx_gnu_ld_version = x; then
+ enable_symvers=no
fi
-# Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
-# Install a library built with a cross compiler in tooldir, not libdir.
-if test x"$glibcxx_toolexecdir" = x"no"; then
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- glibcxx_toolexecdir='$(exec_prefix)/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/lib'
- else
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- glibcxx_toolexeclibdir='$(libdir)'
- fi
- multi_os_directory=`$CC -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
- esac
+# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
+if test $enable_symvers != no; then
+ AC_MSG_CHECKING([for shared libgcc])
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=' -lgcc_s'
+ AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
+ CFLAGS="$ac_save_CFLAGS"
+ AC_MSG_RESULT($glibcxx_shared_libgcc)
fi
-AC_MSG_CHECKING([for install location])
-AC_MSG_RESULT($gxx_include_dir)
-
-AC_SUBST(glibcxx_prefixdir)
-AC_SUBST(gxx_include_dir)
-AC_SUBST(glibcxx_toolexecdir)
-AC_SUBST(glibcxx_toolexeclibdir)
-])
-
-
-# Check for functions in math library.
-# Ulrich Drepper <drepper@cygnus.com>, 1998.
-#
-# This file can be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
+# For GNU ld, we need at least this version. The format is described in
+# GLIBCXX_CHECK_LINKER_FEATURES above.
+glibcxx_min_gnu_ld_version=21400
+# XXXXXXXXXXX glibcxx_gnu_ld_version=21390
-dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
-AC_DEFUN(AC_REPLACE_MATHFUNCS,
-[AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
-
-
-dnl This macro searches for a GNU version of make. If a match is found, the
-dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
-dnl set to "#". This is useful for including a special features in a Makefile,
-dnl which cannot be handled by other versions of make. The variable
-dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
-dnl the empty string otherwise.
-dnl
-dnl Here is an example of its use:
-dnl
-dnl Makefile.in might contain:
-dnl
-dnl # A failsafe way of putting a dependency rule into a makefile
-dnl $(DEPEND):
-dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
-dnl
-dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
-dnl @ifGNUmake@ include $(DEPEND)
-dnl @ifGNUmake@ endif
-dnl
-dnl Then configure.in would normally contain:
-dnl
-dnl CHECK_GNU_MAKE()
-dnl AC_OUTPUT(Makefile)
-dnl
-dnl Then perhaps to cause gnu make to override any other make, we could do
-dnl something like this (note that GNU make always looks for GNUmakefile first):
-dnl
-dnl if ! test x$_cv_gnu_make_command = x ; then
-dnl mv Makefile GNUmakefile
-dnl echo .DEFAULT: > Makefile ;
-dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
-dnl fi
-dnl
-dnl Then, if any (well almost any) other make is called, and GNU make also
-dnl exists, then the other make wraps the GNU make.
-dnl
-dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
-dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
-dnl
-dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
-dnl #### GLIBCXX_ to the macro name; adding the :-make fallback in the
-dnl #### conditional's subshell (" --version" is not a command), using a
-dnl #### different option to grep(1).
-dnl #### -pme
-dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
-dnl #### ${MAKE:-make}).
-dnl #### -msokolov
-AC_DEFUN(
- GLIBCXX_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
- _cv_gnu_make_command='' ;
-dnl Search all the common names for GNU make
- for a in "${MAKE-make}" make gmake gnumake ; do
- if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
- then
- _cv_gnu_make_command=$a ;
- break;
- fi
- done ;
- ) ;
-dnl If there was a GNU version, then set @ifGNUmake@ to the empty
-dnl string, '#' otherwise
- if test "x$_cv_gnu_make_command" != "x" ; then
- ifGNUmake='' ;
+# Check to see if unspecified "yes" value can win, given results above.
+# Change "yes" into either "no" or a style name.
+if test $enable_symvers = yes; then
+ if test $with_gnu_ld = yes &&
+ test $glibcxx_shared_libgcc = yes;
+ then
+ if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
+ enable_symvers=gnu
+ else
+ # The right tools, the right setup, but too old. Fallbacks?
+ AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
+ AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
+ AC_MSG_WARN(=== You would need to upgrade your binutils to version)
+ AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
+ if test $glibcxx_gnu_ld_version -ge 21200 ; then
+ # Globbing fix is present, proper block support is not.
+ dnl AC_MSG_WARN([=== Dude, you are soooo close. Maybe we can fake it.])
+ dnl enable_symvers=???
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ else
+ # 2.11 or older.
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ fi
+ fi
else
- ifGNUmake='#' ;
+ # just fail for now
+ AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
+ AC_MSG_WARN([=== either you are not using a supported linker, or you are])
+ AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
fi
- AC_SUBST(ifGNUmake)
-])
-
-
-dnl Check for headers for, and arguments to, the setrlimit() function.
-dnl Used only in testsuite_hooks.h.
-AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
- AC_TRY_COMPILE([#include <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
- ], [ int f = RLIMIT_$1 ; ],
- [glibcxx_mresult=1], [glibcxx_mresult=0])
- AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
- [Only used in build directory testsuite_hooks.h.])
-])
-AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
- setrlimit_have_headers=yes
- AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
- [],
- setrlimit_have_headers=no)
- # If don't have the headers, then we can't run the tests now, and we
- # won't be seeing any of these during testsuite compilation.
- if test $setrlimit_have_headers = yes; then
- # Can't do these in a loop, else the resulting syntax is wrong.
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
+fi
- # Check for rlimit, setrlimit.
- AC_CACHE_VAL(ac_setrlimit, [
- AC_TRY_COMPILE([#include <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
- ],
- [ struct rlimit r; setrlimit(0, &r);],
- [ac_setrlimit=yes], [ac_setrlimit=no])
- ])
- fi
+# Everything parsed; figure out what file to use.
+case $enable_symvers in
+ no)
+ SYMVER_MAP=config/linker-map.dummy
+ ;;
+ gnu)
+ SYMVER_MAP=config/linker-map.gnu
+ AC_DEFINE(_GLIBCXX_SYMVER)
+ ;;
+esac
- AC_MSG_CHECKING([for testsuite memory limit support])
- if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
- ac_mem_limits=yes
- AC_DEFINE(_GLIBCXX_MEM_LIMITS)
- else
- ac_mem_limits=no
- fi
- AC_MSG_RESULT($ac_mem_limits)
+AC_SUBST(SYMVER_MAP)
+AC_SUBST(port_specific_symbol_files)
+GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
+AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
])
dnl
-dnl Does any necessary configuration of the testsuite directory. Generates
-dnl the testsuite_hooks.h header.
+dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
+dnl We must stage the required headers so that they will be installed
+dnl with the library (unlike libgcc, the STL implementation is provided
+dnl solely within headers). Since we must not inject random user-space
+dnl macro names into user-provided C++ code, we first stage into <file>-in
+dnl and process to <file> with an output command. The reason for a two-
+dnl stage process here is to correctly handle $srcdir!=$objdir without
+dnl having to write complex code (the sed commands to clean the macro
+dnl namespace are complex and fragile enough as it is). We must also
+dnl add a relative path so that -I- is supported properly.
dnl
-dnl GLIBCXX_CONFIGURE_TESTSUITE [no args]
-AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
-
- if test x"$GLIBCXX_IS_CROSS_COMPILING" = xfalse; then
- # Do checks for memory limit functions.
- GLIBCXX_CHECK_SETRLIMIT
-
- # Look for setenv, so that extended locale tests can be performed.
- GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
- fi
-
- # Export file names for ABI checking.
- baseline_dir="${glibcxx_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
- AC_SUBST(baseline_dir)
-
- # Determine if checking the ABI is desirable.
- if test x$enable_symvers = xno; then
- enable_abi_check=no
- else
- case "$host" in
- *-*-cygwin*)
- enable_abi_check=no ;;
- *)
- enable_abi_check=yes ;;
- esac
- fi
-
- AM_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
- AM_CONDITIONAL(GLIBCXX_TEST_ABI, test "$enable_abi_check" = yes)
-])
-
-
-sinclude(../libtool.m4)
-dnl The lines below arrange for aclocal not to bring an installed
-dnl libtool.m4 into aclocal.m4, while still arranging for automake to
-dnl add a definition of LIBTOOL to Makefile.in.
-ifelse(,,,[AC_SUBST(LIBTOOL)
-AC_DEFUN([AM_PROG_LIBTOOL])
-AC_DEFUN([AC_LIBTOOL_DLOPEN])
-AC_DEFUN([AC_PROG_LD])
-])
-
+dnl Substs:
+dnl glibcxx_thread_h
dnl
-dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
+dnl Defines:
+dnl HAVE_GTHR_DEFAULT
+dnl _GLIBCXX_SUPPORTS_WEAK
dnl
+AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
+ AC_MSG_CHECKING([for thread model used by GCC])
+ target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
+ AC_MSG_RESULT([$target_thread_file])
-AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
- AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
- AC_TRY_LINK([#include <sys/stat.h>],
- [struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
- [glibcxx_cv_S_ISREG=yes],
- [glibcxx_cv_S_ISREG=no])
- ])
- AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
- AC_TRY_LINK([#include <sys/stat.h>],
- [struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
- [glibcxx_cv_S_IFREG=yes],
- [glibcxx_cv_S_IFREG=no])
- ])
- if test x$glibcxx_cv_S_ISREG = xyes; then
- AC_DEFINE(HAVE_S_ISREG)
- elif test x$glibcxx_cv_S_IFREG = xyes; then
- AC_DEFINE(HAVE_S_IFREG)
+ if test $target_thread_file != single; then
+ AC_DEFINE(HAVE_GTHR_DEFAULT)
+ AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
fi
-])
-
-dnl
-dnl Check whether poll is available in <poll.h>.
-dnl
-AC_DEFUN(GLIBCXX_CHECK_POLL, [
- AC_CACHE_VAL(glibcxx_cv_POLL, [
- AC_TRY_COMPILE([#include <poll.h>],
- [struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
- [glibcxx_cv_POLL=yes],
- [glibcxx_cv_POLL=no])
- ])
- if test x$glibcxx_cv_POLL = xyes; then
- AC_DEFINE(HAVE_POLL)
- fi
+ glibcxx_thread_h=gthr-$target_thread_file.h
+ AC_SUBST(glibcxx_thread_h)
])
+
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
@@ -2183,7 +1641,6 @@ AC_DEFUN(GLIBCXX_CHECK_POLL, [
# Please note that the actual code is *not* freely available.
# serial 1
-
AC_DEFUN(AC_LC_MESSAGES, [
AC_CHECK_HEADER(locale.h, [
AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
@@ -2196,153 +1653,151 @@ AC_DEFUN(AC_LC_MESSAGES, [
])
-dnl
-dnl Check for whether the Boost-derived checks should be turned on.
-dnl
-dnl GLIBCXX_ENABLE_CONCEPT_CHECKS
-dnl --enable-concept-checks turns them on.
-dnl --disable-concept-checks leaves them off.
-dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'.
-AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [dnl
-define([GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(concept-checks,
-changequote(<<, >>)dnl
-<< --enable-concept-checks use Boost-derived template checks [default=>>GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT],
-changequote([, ])dnl
-[case "$enableval" in
- yes) enable_concept_checks=yes ;;
- no) enable_concept_checks=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
- esac],
-enable_concept_checks=GLIBCXX_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
-dnl Option parsed, now set things appropriately
-if test x"$enable_concept_checks" = xyes; then
- AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
-fi
+sinclude([../libtool.m4])
+dnl The lines below arrange for aclocal not to bring an installed
+dnl libtool.m4 into aclocal.m4, while still arranging for automake to
+dnl add a definition of LIBTOOL to Makefile.in.
+ifelse(,,,[AC_SUBST(LIBTOOL)
+AC_DEFUN([AM_PROG_LIBTOOL])
+AC_DEFUN([AC_LIBTOOL_DLOPEN])
+AC_DEFUN([AC_PROG_LD])
])
+dnl vim:et:ts=2:sw=2
-dnl
-dnl Add version tags to symbols in shared library (or not), additionally
-dnl marking other symbols as private/local (or not).
-dnl
-dnl GLIBCXX_ENABLE_SYMVERS
-dnl --enable-symvers=style adds a version script to the linker call when
-dnl creating the shared library. The choice of version script is
-dnl controlled by 'style'.
-dnl --disable-symvers does not.
-dnl + Usage: GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
-dnl defaults to `no'. Passing `yes' tries to choose a default style
-dnl based on linker characteristics. Passing 'no' disables versioning.
-AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [dnl
-define([GLIBCXX_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
-AC_ARG_ENABLE(symvers,
-changequote(<<, >>)dnl
-<< --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCXX_ENABLE_SYMVERS_DEFAULT],
-changequote([, ])dnl
-[case "$enableval" in
- yes) enable_symvers=yes ;;
- no) enable_symvers=no ;;
- # other names here, just as sanity checks
- #gnu|sun|etcetera) enable_symvers=$enableval ;;
- gnu) enable_symvers=$enableval ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
- esac],
-enable_symvers=GLIBCXX_ENABLE_SYMVERS_DEFAULT)dnl
+# AM_CONDITIONAL -*- Autoconf -*-
-# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
-# don't know enough about $LD to do tricks...
-if test x$enable_shared = xno ||
- test "x$LD" = x ||
- test x$glibcxx_gnu_ld_version = x; then
- enable_symvers=no
-fi
+# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
-# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
-if test $enable_symvers != no; then
- AC_MSG_CHECKING([for shared libgcc])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=' -lgcc_s'
- AC_TRY_LINK(, [return 0], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
- CFLAGS="$ac_save_CFLAGS"
- AC_MSG_RESULT($glibcxx_shared_libgcc)
-fi
+# 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.
-# For GNU ld, we need at least this version. It's 2.14 in the same format
-# as the tested-for version. See GLIBCXX_CHECK_LINKER_FEATURES for more.
-glibcxx_min_gnu_ld_version=21400
+# 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.
-# Check to see if unspecified "yes" value can win, given results
-# above.
-if test $enable_symvers = yes ; then
- if test $with_gnu_ld = yes &&
- test $glibcxx_shared_libgcc = yes ;
- then
- if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
- enable_symvers=gnu
- else
- # The right tools, the right setup, but too old. Fallbacks?
- enable_symvers=no
- fi
- else
- # just fail for now
- enable_symvers=no
- fi
+# 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])])
-dnl Everything parsed; figure out what file to use.
-case $enable_symvers in
- no)
- SYMVER_MAP=config/linker-map.dummy
- ;;
- gnu)
- SYMVER_MAP=config/linker-map.gnu
- AC_DEFINE(_GLIBCXX_SYMVER)
- ;;
-esac
+# Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-AC_SUBST(SYMVER_MAP)
-AC_SUBST(port_specific_symbol_file)
-AM_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
-AC_MSG_CHECKING([versioning on shared library symbols])
-AC_MSG_RESULT($enable_symvers)
-])
+# 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.
-# isc-posix.m4 serial 2 (gettext-0.11.2)
-dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# 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 file is not needed with autoconf-2.53 and newer. Remove it in 2005.
+# serial 3
-# This test replaces the one in autoconf.
-# Currently this macro should have the same name as the autoconf macro
-# because gettext's gettext.m4 (distributed in the automake package)
-# still uses it. Otherwise, the use in gettext.m4 makes autoheader
-# give these diagnostics:
-# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
+# ---------------------------------------------------
+# Add --enable-multilib to configure.
+AC_DEFUN([AM_ENABLE_MULTILIB],
+[# Default to --enable-multilib
+AC_ARG_ENABLE(multilib,
+[ --enable-multilib build many library versions (default)],
+[case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
+ esac],
+ [multilib=yes])
-undefine([AC_ISC_POSIX])
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
-AC_DEFUN([AC_ISC_POSIX],
- [
- dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
- AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
- ]
-)
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../$2"
+ else
+ multi_basedir="$srcdir/$with_multisrctop$2"
+ fi
+else
+ multi_basedir="$srcdir/$2"
+fi
+AC_SUBST(multi_basedir)
+
+AC_OUTPUT_COMMANDS([
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" ]m4_default([$1],Makefile)[ "*)
+ ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
+ ;;
+esac],
+ [
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"])])dnl
# 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])
@@ -2352,59 +1807,139 @@ 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.
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-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])
+# Do all the work for Automake. -*- Autoconf -*-
-# 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.
+# 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.
-# serial 1
+# 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.
-dnl Usage:
-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+# 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])
-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([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-${am__api_version}, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $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.
@@ -2426,37 +1961,103 @@ AC_REQUIRE([AC_PROG_MAKE_SET])])
# ----------------------------
# 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.4"])
+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.4-p6])])
+ [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
@@ -2466,7 +2067,7 @@ if (
alias in your environment])
fi
- test "[$]2" = conftestfile
+ test "$[2]" = conftest.file
)
then
# Ok.
@@ -2475,45 +2076,521 @@ 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
+])
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 81e994dd597..0e6bb080c3b 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -1,7 +1,15 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+// acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
+// Defines libstdc++ version.
+#undef PACKAGE
+#undef VERSION
+
+// Needed for gettext.
+#undef ENABLE_NLS
+#undef HAVE_CATGETS
+#undef HAVE_GETTEXT
+#undef HAVE_STPCPY
// Define if GCC supports weak symbols.
#undef _GLIBCXX_SUPPORTS_WEAK
@@ -12,6 +20,12 @@
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
#undef _GLIBCXX_USE_C99
+// Include support for 'long double'.
+#undef _GLIBCXX_USE_LONG_DOUBLE
+
+// Include support for shadow headers, ie --enable-cshadow-headers.
+#undef _GLIBCXX_USE_SHADOW_HEADERS
+
// Define if code specialized for wchar_t should be used.
#undef _GLIBCXX_USE_WCHAR_T
@@ -21,6 +35,18 @@
// Define to use concept checking code from the boost libraries.
#undef _GLIBCXX_CONCEPT_CHECKS
+// Define if the atan2f function exists.
+#undef HAVE_ATAN2F
+
+// Define if the atan2l function exists.
+#undef HAVE_ATAN2L
+
+// Define if the tanl function exists.
+#undef HAVE_TANL
+
+// Define if the copysignf function exists.
+#undef HAVE_COPYSIGNF
+
// Define to use symbol versioning in the shared library.
#undef _GLIBCXX_SYMVER
@@ -65,6 +91,9 @@
// Define if you have the expl function.
#undef HAVE_EXPL
+// Define if you have the hypot function.
+#undef HAVE_HYPOT
+
// Define if you have the hypotf function.
#undef HAVE_HYPOTF
@@ -122,696 +151,738 @@
// Define if S_IFREG is available in <sys/stat.h>.
#undef HAVE_S_IFREG
+// Define if writev is available in <sys/uio.h>.
+#undef HAVE_WRITEV
+
// Define if LC_MESSAGES is available in <locale.h>.
#undef HAVE_LC_MESSAGES
-// Define if NLS translations are to be used.
-#undef _GLIBCXX_USE_NLS
-
-/* Define if you have the __signbit function. */
-#undef HAVE___SIGNBIT
-
-/* Define if you have the __signbitf function. */
-#undef HAVE___SIGNBITF
-
-/* Define if you have the __signbitl function. */
-#undef HAVE___SIGNBITL
-
-/* Define if you have the _acosf function. */
-#undef HAVE__ACOSF
-
-/* Define if you have the _acosl function. */
-#undef HAVE__ACOSL
-
-/* Define if you have the _asinf function. */
-#undef HAVE__ASINF
-
-/* Define if you have the _asinl function. */
-#undef HAVE__ASINL
-
-/* Define if you have the _atan2f function. */
-#undef HAVE__ATAN2F
-
-/* Define if you have the _atan2l function. */
-#undef HAVE__ATAN2L
-
-/* Define if you have the _atanf function. */
-#undef HAVE__ATANF
-
-/* Define if you have the _atanl function. */
-#undef HAVE__ATANL
-
-/* Define if you have the _ceilf function. */
-#undef HAVE__CEILF
-
-/* Define if you have the _ceill function. */
-#undef HAVE__CEILL
-
-/* Define if you have the _copysign function. */
-#undef HAVE__COPYSIGN
-
-/* Define if you have the _copysignl function. */
-#undef HAVE__COPYSIGNL
-
-/* Define if you have the _cosf function. */
-#undef HAVE__COSF
-
-/* Define if you have the _coshf function. */
-#undef HAVE__COSHF
-
-/* Define if you have the _coshl function. */
-#undef HAVE__COSHL
-
-/* Define if you have the _cosl function. */
-#undef HAVE__COSL
-
-/* Define if you have the _expf function. */
-#undef HAVE__EXPF
-
-/* Define if you have the _expl function. */
-#undef HAVE__EXPL
-
-/* Define if you have the _fabsf function. */
-#undef HAVE__FABSF
-
-/* Define if you have the _fabsl function. */
-#undef HAVE__FABSL
-
-/* Define if you have the _finite function. */
-#undef HAVE__FINITE
-
-/* Define if you have the _finitef function. */
-#undef HAVE__FINITEF
-
-/* Define if you have the _finitel function. */
-#undef HAVE__FINITEL
-
-/* Define if you have the _floorf function. */
-#undef HAVE__FLOORF
-
-/* Define if you have the _floorl function. */
-#undef HAVE__FLOORL
-
-/* Define if you have the _fmodf function. */
-#undef HAVE__FMODF
-
-/* Define if you have the _fmodl function. */
-#undef HAVE__FMODL
-
-/* Define if you have the _fpclass function. */
-#undef HAVE__FPCLASS
-
-/* Define if you have the _frexpf function. */
-#undef HAVE__FREXPF
-
-/* Define if you have the _frexpl function. */
-#undef HAVE__FREXPL
-
-/* Define if you have the _hypot function. */
-#undef HAVE__HYPOT
-
-/* Define if you have the _hypotf function. */
-#undef HAVE__HYPOTF
-
-/* Define if you have the _hypotl function. */
-#undef HAVE__HYPOTL
-
-/* Define if you have the _isinf function. */
-#undef HAVE__ISINF
-
-/* Define if you have the _isinff function. */
-#undef HAVE__ISINFF
-
-/* Define if you have the _isinfl function. */
-#undef HAVE__ISINFL
-
-/* Define if you have the _isnan function. */
-#undef HAVE__ISNAN
-
-/* Define if you have the _isnanf function. */
-#undef HAVE__ISNANF
-
-/* Define if you have the _isnanl function. */
-#undef HAVE__ISNANL
-
-/* Define if you have the _ldexpf function. */
-#undef HAVE__LDEXPF
-
-/* Define if you have the _ldexpl function. */
-#undef HAVE__LDEXPL
-
-/* Define if you have the _log10f function. */
-#undef HAVE__LOG10F
-
-/* Define if you have the _log10l function. */
-#undef HAVE__LOG10L
-
-/* Define if you have the _logf function. */
-#undef HAVE__LOGF
-
-/* Define if you have the _logl function. */
-#undef HAVE__LOGL
-
-/* Define if you have the _modff function. */
-#undef HAVE__MODFF
-
-/* Define if you have the _modfl function. */
-#undef HAVE__MODFL
-
-/* Define if you have the _powf function. */
-#undef HAVE__POWF
-
-/* Define if you have the _powl function. */
-#undef HAVE__POWL
-
-/* Define if you have the _qfpclass function. */
-#undef HAVE__QFPCLASS
-
-/* Define if you have the _sincos function. */
-#undef HAVE__SINCOS
-
-/* Define if you have the _sincosf function. */
-#undef HAVE__SINCOSF
-
-/* Define if you have the _sincosl function. */
-#undef HAVE__SINCOSL
-
-/* Define if you have the _sinf function. */
-#undef HAVE__SINF
-
-/* Define if you have the _sinhf function. */
-#undef HAVE__SINHF
-
-/* Define if you have the _sinhl function. */
-#undef HAVE__SINHL
-
-/* Define if you have the _sinl function. */
-#undef HAVE__SINL
-
-/* Define if you have the _sqrtf function. */
-#undef HAVE__SQRTF
-
-/* Define if you have the _sqrtl function. */
-#undef HAVE__SQRTL
-
-/* Define if you have the _tanf function. */
-#undef HAVE__TANF
+// Define if <float.h> exists.
+#undef HAVE_FLOAT_H
-/* Define if you have the _tanhf function. */
-#undef HAVE__TANHF
+// Define if modf is present in <math.h>
+#undef HAVE_MODF
-/* Define if you have the _tanhl function. */
-#undef HAVE__TANHL
+// Define if NLS translations are to be used.
+#undef _GLIBCXX_USE_NLS
-/* Define if you have the _tanl function. */
-#undef HAVE__TANL
-/* Define if you have the acosf function. */
+/* Define to 1 if you have the `acosf' function. */
#undef HAVE_ACOSF
-/* Define if you have the acosl function. */
+/* Define to 1 if you have the `acosl' function. */
#undef HAVE_ACOSL
-/* Define if you have the asinf function. */
+/* Define to 1 if you have the `asinf' function. */
#undef HAVE_ASINF
-/* Define if you have the asinl function. */
+/* Define to 1 if you have the `asinl' function. */
#undef HAVE_ASINL
-/* Define if you have the atan2f function. */
+/* Define to 1 if you have the `atan2f' function. */
#undef HAVE_ATAN2F
-/* Define if you have the atan2l function. */
+/* Define to 1 if you have the `atan2l' function. */
#undef HAVE_ATAN2L
-/* Define if you have the atanf function. */
+/* Define to 1 if you have the `atanf' function. */
#undef HAVE_ATANF
-/* Define if you have the atanl function. */
+/* Define to 1 if you have the `atanl' function. */
#undef HAVE_ATANL
-/* Define if you have the btowc function. */
+/* Define to 1 if you have the `btowc' function. */
#undef HAVE_BTOWC
-/* Define if you have the ceilf function. */
+/* Define to 1 if you have the `ceilf' function. */
#undef HAVE_CEILF
-/* Define if you have the ceill function. */
+/* Define to 1 if you have the `ceill' function. */
#undef HAVE_CEILL
-/* Define if you have the copysign function. */
+/* Define to 1 if you have the `copysign' function. */
#undef HAVE_COPYSIGN
-/* Define if you have the copysignf function. */
+/* Define to 1 if you have the `copysignf' function. */
#undef HAVE_COPYSIGNF
-/* Define if you have the copysignl function. */
+/* Define to 1 if you have the `copysignl' function. */
#undef HAVE_COPYSIGNL
-/* Define if you have the cosf function. */
+/* Define to 1 if you have the `cosf' function. */
#undef HAVE_COSF
-/* Define if you have the coshf function. */
+/* Define to 1 if you have the `coshf' function. */
#undef HAVE_COSHF
-/* Define if you have the coshl function. */
+/* Define to 1 if you have the `coshl' function. */
#undef HAVE_COSHL
-/* Define if you have the cosl function. */
+/* Define to 1 if you have the `cosl' function. */
#undef HAVE_COSL
-/* Define if you have the drand48 function. */
+/* Define to 1 if you have the `drand48' function. */
#undef HAVE_DRAND48
-/* Define if you have the expf function. */
+/* Define to 1 if you have the <endian.h> header file. */
+#undef HAVE_ENDIAN_H
+
+/* Define to 1 if you have the `expf' function. */
#undef HAVE_EXPF
-/* Define if you have the expl function. */
+/* Define to 1 if you have the `expl' function. */
#undef HAVE_EXPL
-/* Define if you have the fabsf function. */
+/* Define to 1 if you have the `fabsf' function. */
#undef HAVE_FABSF
-/* Define if you have the fabsl function. */
+/* Define to 1 if you have the `fabsl' function. */
#undef HAVE_FABSL
-/* Define if you have the fgetwc function. */
+/* Define to 1 if you have the `fgetwc' function. */
#undef HAVE_FGETWC
-/* Define if you have the fgetws function. */
+/* Define to 1 if you have the `fgetws' function. */
#undef HAVE_FGETWS
-/* Define if you have the finite function. */
+/* Define to 1 if you have the `finite' function. */
#undef HAVE_FINITE
-/* Define if you have the finitef function. */
+/* Define to 1 if you have the `finitef' function. */
#undef HAVE_FINITEF
-/* Define if you have the finitel function. */
+/* Define to 1 if you have the `finitel' function. */
#undef HAVE_FINITEL
-/* Define if you have the floorf function. */
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the `floorf' function. */
#undef HAVE_FLOORF
-/* Define if you have the floorl function. */
+/* Define to 1 if you have the `floorl' function. */
#undef HAVE_FLOORL
-/* Define if you have the fmodf function. */
+/* Define to 1 if you have the `fmodf' function. */
#undef HAVE_FMODF
-/* Define if you have the fmodl function. */
+/* Define to 1 if you have the `fmodl' function. */
#undef HAVE_FMODL
-/* Define if you have the fpclass function. */
+/* Define to 1 if you have the `fpclass' function. */
#undef HAVE_FPCLASS
-/* Define if you have the fputwc function. */
+/* Define to 1 if you have the `fputwc' function. */
#undef HAVE_FPUTWC
-/* Define if you have the fputws function. */
+/* Define to 1 if you have the `fputws' function. */
#undef HAVE_FPUTWS
-/* Define if you have the frexpf function. */
+/* Define to 1 if you have the <fp.h> header file. */
+#undef HAVE_FP_H
+
+/* Define to 1 if you have the `frexpf' function. */
#undef HAVE_FREXPF
-/* Define if you have the frexpl function. */
+/* Define to 1 if you have the `frexpl' function. */
#undef HAVE_FREXPL
-/* Define if you have the fwide function. */
+/* Define to 1 if you have the `fwide' function. */
#undef HAVE_FWIDE
-/* Define if you have the fwprintf function. */
+/* Define to 1 if you have the `fwprintf' function. */
#undef HAVE_FWPRINTF
-/* Define if you have the fwscanf function. */
+/* Define to 1 if you have the `fwscanf' function. */
#undef HAVE_FWSCANF
-/* Define if you have the getpagesize function. */
+/* Define to 1 if you have the <gconv.h> header file. */
+#undef HAVE_GCONV_H
+
+/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
-/* Define if you have the getwc function. */
+/* Define to 1 if you have the `getwc' function. */
#undef HAVE_GETWC
-/* Define if you have the getwchar function. */
+/* Define to 1 if you have the `getwchar' function. */
#undef HAVE_GETWCHAR
-/* Define if you have the hypot function. */
+/* Define to 1 if you have the `hypot' function. */
#undef HAVE_HYPOT
-/* Define if you have the hypotf function. */
+/* Define to 1 if you have the `hypotf' function. */
#undef HAVE_HYPOTF
-/* Define if you have the hypotl function. */
+/* Define to 1 if you have the `hypotl' function. */
#undef HAVE_HYPOTL
-/* Define if you have the iconv function. */
+/* Define to 1 if you have the `iconv' function. */
#undef HAVE_ICONV
-/* Define if you have the iconv_close function. */
+/* Define to 1 if you have the `iconv_close' function. */
#undef HAVE_ICONV_CLOSE
-/* Define if you have the iconv_open function. */
+/* Define to 1 if you have the `iconv_open' function. */
#undef HAVE_ICONV_OPEN
-/* Define if you have the isinf function. */
+/* Define to 1 if you have the <ieeefp.h> header file. */
+#undef HAVE_IEEEFP_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `isinf' function. */
#undef HAVE_ISINF
-/* Define if you have the isinff function. */
+/* Define to 1 if you have the `isinff' function. */
#undef HAVE_ISINFF
-/* Define if you have the isinfl function. */
+/* Define to 1 if you have the `isinfl' function. */
#undef HAVE_ISINFL
-/* Define if you have the isnan function. */
+/* Define to 1 if you have the `isnan' function. */
#undef HAVE_ISNAN
-/* Define if you have the isnanf function. */
+/* Define to 1 if you have the `isnanf' function. */
#undef HAVE_ISNANF
-/* Define if you have the isnanl function. */
+/* Define to 1 if you have the `isnanl' function. */
#undef HAVE_ISNANL
-/* Define if you have the ldexpf function. */
+/* Define to 1 if you have the `ldexpf' function. */
#undef HAVE_LDEXPF
-/* Define if you have the ldexpl function. */
+/* Define to 1 if you have the `ldexpl' function. */
#undef HAVE_LDEXPL
-/* Define if you have the log10f function. */
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the `log10f' function. */
#undef HAVE_LOG10F
-/* Define if you have the log10l function. */
+/* Define to 1 if you have the `log10l' function. */
#undef HAVE_LOG10L
-/* Define if you have the logf function. */
+/* Define to 1 if you have the `logf' function. */
#undef HAVE_LOGF
-/* Define if you have the logl function. */
+/* Define to 1 if you have the `logl' function. */
#undef HAVE_LOGL
-/* Define if you have the mbrlen function. */
+/* Define to 1 if you have the <machine/endian.h> header file. */
+#undef HAVE_MACHINE_ENDIAN_H
+
+/* Define to 1 if you have the <machine/param.h> header file. */
+#undef HAVE_MACHINE_PARAM_H
+
+/* Define to 1 if you have the `mbrlen' function. */
#undef HAVE_MBRLEN
-/* Define if you have the mbrtowc function. */
+/* Define to 1 if you have the `mbrtowc' function. */
#undef HAVE_MBRTOWC
-/* Define if you have the mbsinit function. */
+/* Define to 1 if you have the `mbsinit' function. */
#undef HAVE_MBSINIT
-/* Define if you have the mbsrtowcs function. */
+/* Define to 1 if you have the `mbsrtowcs' function. */
#undef HAVE_MBSRTOWCS
-/* Define if you have the modff function. */
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_AS
+
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_DATA
+
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_RSS
+
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_VMEM
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `modff' function. */
#undef HAVE_MODFF
-/* Define if you have the modfl function. */
+/* Define to 1 if you have the `modfl' function. */
#undef HAVE_MODFL
-/* Define if you have the nan function. */
+/* Define to 1 if you have the `nan' function. */
#undef HAVE_NAN
-/* Define if you have the nl_langinfo function. */
+/* Define to 1 if you have the <nan.h> header file. */
+#undef HAVE_NAN_H
+
+/* Define to 1 if you have the `nl_langinfo' function. */
#undef HAVE_NL_LANGINFO
-/* Define if you have the powf function. */
+/* Define to 1 if you have the `powf' function. */
#undef HAVE_POWF
-/* Define if you have the powl function. */
+/* Define to 1 if you have the `powl' function. */
#undef HAVE_POWL
-/* Define if you have the putwc function. */
+/* Define to 1 if you have the `putwc' function. */
#undef HAVE_PUTWC
-/* Define if you have the putwchar function. */
+/* Define to 1 if you have the `putwchar' function. */
#undef HAVE_PUTWCHAR
-/* Define if you have the qfpclass function. */
+/* Define to 1 if you have the `qfpclass' function. */
#undef HAVE_QFPCLASS
-/* Define if you have the setenv function. */
+/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
-/* Define if you have the sincos function. */
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `sincos' function. */
#undef HAVE_SINCOS
-/* Define if you have the sincosf function. */
+/* Define to 1 if you have the `sincosf' function. */
#undef HAVE_SINCOSF
-/* Define if you have the sincosl function. */
+/* Define to 1 if you have the `sincosl' function. */
#undef HAVE_SINCOSL
-/* Define if you have the sinf function. */
+/* Define to 1 if you have the `sinf' function. */
#undef HAVE_SINF
-/* Define if you have the sinhf function. */
+/* Define to 1 if you have the `sinhf' function. */
#undef HAVE_SINHF
-/* Define if you have the sinhl function. */
+/* Define to 1 if you have the `sinhl' function. */
#undef HAVE_SINHL
-/* Define if you have the sinl function. */
+/* Define to 1 if you have the `sinl' function. */
#undef HAVE_SINL
-/* Define if you have the sqrtf function. */
+/* Define to 1 if you have the `sqrtf' function. */
#undef HAVE_SQRTF
-/* Define if you have the sqrtl function. */
+/* Define to 1 if you have the `sqrtl' function. */
#undef HAVE_SQRTL
-/* Define if you have the strtof function. */
+/* 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 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 `strtof' function. */
#undef HAVE_STRTOF
-/* Define if you have the strtold function. */
+/* Define to 1 if you have the `strtold' function. */
#undef HAVE_STRTOLD
-/* Define if you have the swprintf function. */
+/* Define to 1 if you have the `swprintf' function. */
#undef HAVE_SWPRINTF
-/* Define if you have the swscanf function. */
+/* Define to 1 if you have the `swscanf' function. */
#undef HAVE_SWSCANF
-/* Define if you have the tanf function. */
+/* Define to 1 if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/isa_defs.h> header file. */
+#undef HAVE_SYS_ISA_DEFS_H
+
+/* Define to 1 if you have the <sys/machine.h> header file. */
+#undef HAVE_SYS_MACHINE_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_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/time.h> header file. */
+#undef HAVE_SYS_TIME_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 <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the `tanf' function. */
#undef HAVE_TANF
-/* Define if you have the tanhf function. */
+/* Define to 1 if you have the `tanhf' function. */
#undef HAVE_TANHF
-/* Define if you have the tanhl function. */
+/* Define to 1 if you have the `tanhl' function. */
#undef HAVE_TANHL
-/* Define if you have the tanl function. */
+/* Define to 1 if you have the `tanl' function. */
#undef HAVE_TANL
-/* Define if you have the ungetwc function. */
+/* Define to 1 if you have the `ungetwc' function. */
#undef HAVE_UNGETWC
-/* Define if you have the vfwprintf function. */
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vfwprintf' function. */
#undef HAVE_VFWPRINTF
-/* Define if you have the vfwscanf function. */
+/* Define to 1 if you have the `vfwscanf' function. */
#undef HAVE_VFWSCANF
-/* Define if you have the vswprintf function. */
+/* Define to 1 if you have the `vswprintf' function. */
#undef HAVE_VSWPRINTF
-/* Define if you have the vswscanf function. */
+/* Define to 1 if you have the `vswscanf' function. */
#undef HAVE_VSWSCANF
-/* Define if you have the vwprintf function. */
+/* Define to 1 if you have the `vwprintf' function. */
#undef HAVE_VWPRINTF
-/* Define if you have the vwscanf function. */
+/* Define to 1 if you have the `vwscanf' function. */
#undef HAVE_VWSCANF
-/* Define if you have the wcrtomb function. */
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if you have the `wcrtomb' function. */
#undef HAVE_WCRTOMB
-/* Define if you have the wcscat function. */
+/* Define to 1 if you have the `wcscat' function. */
#undef HAVE_WCSCAT
-/* Define if you have the wcschr function. */
+/* Define to 1 if you have the `wcschr' function. */
#undef HAVE_WCSCHR
-/* Define if you have the wcscmp function. */
+/* Define to 1 if you have the `wcscmp' function. */
#undef HAVE_WCSCMP
-/* Define if you have the wcscoll function. */
+/* Define to 1 if you have the `wcscoll' function. */
#undef HAVE_WCSCOLL
-/* Define if you have the wcscpy function. */
+/* Define to 1 if you have the `wcscpy' function. */
#undef HAVE_WCSCPY
-/* Define if you have the wcscspn function. */
+/* Define to 1 if you have the `wcscspn' function. */
#undef HAVE_WCSCSPN
-/* Define if you have the wcsftime function. */
+/* Define to 1 if you have the `wcsftime' function. */
#undef HAVE_WCSFTIME
-/* Define if you have the wcslen function. */
+/* Define to 1 if you have the `wcslen' function. */
#undef HAVE_WCSLEN
-/* Define if you have the wcsncat function. */
+/* Define to 1 if you have the `wcsncat' function. */
#undef HAVE_WCSNCAT
-/* Define if you have the wcsncmp function. */
+/* Define to 1 if you have the `wcsncmp' function. */
#undef HAVE_WCSNCMP
-/* Define if you have the wcsncpy function. */
+/* Define to 1 if you have the `wcsncpy' function. */
#undef HAVE_WCSNCPY
-/* Define if you have the wcspbrk function. */
+/* Define to 1 if you have the `wcspbrk' function. */
#undef HAVE_WCSPBRK
-/* Define if you have the wcsrchr function. */
+/* Define to 1 if you have the `wcsrchr' function. */
#undef HAVE_WCSRCHR
-/* Define if you have the wcsrtombs function. */
+/* Define to 1 if you have the `wcsrtombs' function. */
#undef HAVE_WCSRTOMBS
-/* Define if you have the wcsspn function. */
+/* Define to 1 if you have the `wcsspn' function. */
#undef HAVE_WCSSPN
-/* Define if you have the wcsstr function. */
+/* Define to 1 if you have the `wcsstr' function. */
#undef HAVE_WCSSTR
-/* Define if you have the wcstod function. */
+/* Define to 1 if you have the `wcstod' function. */
#undef HAVE_WCSTOD
-/* Define if you have the wcstof function. */
+/* Define to 1 if you have the `wcstof' function. */
#undef HAVE_WCSTOF
-/* Define if you have the wcstok function. */
+/* Define to 1 if you have the `wcstok' function. */
#undef HAVE_WCSTOK
-/* Define if you have the wcstol function. */
+/* Define to 1 if you have the `wcstol' function. */
#undef HAVE_WCSTOL
-/* Define if you have the wcstoul function. */
+/* Define to 1 if you have the `wcstoul' function. */
#undef HAVE_WCSTOUL
-/* Define if you have the wcsxfrm function. */
+/* Define to 1 if you have the `wcsxfrm' function. */
#undef HAVE_WCSXFRM
-/* Define if you have the wctob function. */
+/* Define to 1 if you have the `wctob' function. */
#undef HAVE_WCTOB
-/* Define if you have the wmemchr function. */
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Define to 1 if you have the `wmemchr' function. */
#undef HAVE_WMEMCHR
-/* Define if you have the wmemcmp function. */
+/* Define to 1 if you have the `wmemcmp' function. */
#undef HAVE_WMEMCMP
-/* Define if you have the wmemcpy function. */
+/* Define to 1 if you have the `wmemcpy' function. */
#undef HAVE_WMEMCPY
-/* Define if you have the wmemmove function. */
+/* Define to 1 if you have the `wmemmove' function. */
#undef HAVE_WMEMMOVE
-/* Define if you have the wmemset function. */
+/* Define to 1 if you have the `wmemset' function. */
#undef HAVE_WMEMSET
-/* Define if you have the wprintf function. */
+/* Define to 1 if you have the `wprintf' function. */
#undef HAVE_WPRINTF
-/* Define if you have the wscanf function. */
+/* Define to 1 if you have the `wscanf' function. */
#undef HAVE_WSCANF
-/* Define if you have the <endian.h> header file. */
-#undef HAVE_ENDIAN_H
+/* Define to 1 if you have the `_acosf' function. */
+#undef HAVE__ACOSF
-/* Define if you have the <float.h> header file. */
-#undef HAVE_FLOAT_H
+/* Define to 1 if you have the `_acosl' function. */
+#undef HAVE__ACOSL
-/* Define if you have the <fp.h> header file. */
-#undef HAVE_FP_H
+/* Define to 1 if you have the `_asinf' function. */
+#undef HAVE__ASINF
-/* Define if you have the <gconv.h> header file. */
-#undef HAVE_GCONV_H
+/* Define to 1 if you have the `_asinl' function. */
+#undef HAVE__ASINL
-/* Define if you have the <ieeefp.h> header file. */
-#undef HAVE_IEEEFP_H
+/* Define to 1 if you have the `_atan2f' function. */
+#undef HAVE__ATAN2F
-/* Define if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `_atan2l' function. */
+#undef HAVE__ATAN2L
-/* Define if you have the <libintl.h> header file. */
-#undef HAVE_LIBINTL_H
+/* Define to 1 if you have the `_atanf' function. */
+#undef HAVE__ATANF
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
+/* Define to 1 if you have the `_atanl' function. */
+#undef HAVE__ATANL
-/* Define if you have the <machine/endian.h> header file. */
-#undef HAVE_MACHINE_ENDIAN_H
+/* Define to 1 if you have the `_ceilf' function. */
+#undef HAVE__CEILF
-/* Define if you have the <machine/param.h> header file. */
-#undef HAVE_MACHINE_PARAM_H
+/* Define to 1 if you have the `_ceill' function. */
+#undef HAVE__CEILL
-/* Define if you have the <nan.h> header file. */
-#undef HAVE_NAN_H
+/* Define to 1 if you have the `_copysign' function. */
+#undef HAVE__COPYSIGN
-/* Define if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `_copysignl' function. */
+#undef HAVE__COPYSIGNL
-/* Define if you have the <sys/filio.h> header file. */
-#undef HAVE_SYS_FILIO_H
+/* Define to 1 if you have the `_cosf' function. */
+#undef HAVE__COSF
-/* Define if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
+/* Define to 1 if you have the `_coshf' function. */
+#undef HAVE__COSHF
-/* Define if you have the <sys/isa_defs.h> header file. */
-#undef HAVE_SYS_ISA_DEFS_H
+/* Define to 1 if you have the `_coshl' function. */
+#undef HAVE__COSHL
-/* Define if you have the <sys/machine.h> header file. */
-#undef HAVE_SYS_MACHINE_H
+/* Define to 1 if you have the `_cosl' function. */
+#undef HAVE__COSL
-/* Define if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
+/* Define to 1 if you have the `_expf' function. */
+#undef HAVE__EXPF
-/* Define if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
+/* Define to 1 if you have the `_expl' function. */
+#undef HAVE__EXPL
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
+/* Define to 1 if you have the `_fabsf' function. */
+#undef HAVE__FABSF
-/* Define if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
+/* Define to 1 if you have the `_fabsl' function. */
+#undef HAVE__FABSL
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `_finite' function. */
+#undef HAVE__FINITE
-/* Define if you have the <wchar.h> header file. */
-#undef HAVE_WCHAR_H
+/* Define to 1 if you have the `_finitef' function. */
+#undef HAVE__FINITEF
-/* Define if you have the <wctype.h> header file. */
-#undef HAVE_WCTYPE_H
+/* Define to 1 if you have the `_finitel' function. */
+#undef HAVE__FINITEL
-/* Define if you have the m library (-lm). */
-#undef HAVE_LIBM
+/* Define to 1 if you have the `_floorf' function. */
+#undef HAVE__FLOORF
-/* Name of package */
-#undef PACKAGE
+/* Define to 1 if you have the `_floorl' function. */
+#undef HAVE__FLOORL
-/* Version number of package */
-#undef VERSION
+/* Define to 1 if you have the `_fmodf' function. */
+#undef HAVE__FMODF
-/* Define if the compiler is configured for setjmp/longjmp exceptions. */
-#undef _GLIBCXX_SJLJ_EXCEPTIONS
+/* Define to 1 if you have the `_fmodl' function. */
+#undef HAVE__FMODL
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
+/* Define to 1 if you have the `_fpclass' function. */
+#undef HAVE__FPCLASS
-/* Only used in build directory testsuite_hooks.h. */
-#undef HAVE_MEMLIMIT_DATA
+/* Define to 1 if you have the `_frexpf' function. */
+#undef HAVE__FREXPF
-/* Only used in build directory testsuite_hooks.h. */
-#undef HAVE_MEMLIMIT_RSS
+/* Define to 1 if you have the `_frexpl' function. */
+#undef HAVE__FREXPL
-/* Only used in build directory testsuite_hooks.h. */
-#undef HAVE_MEMLIMIT_VMEM
+/* Define to 1 if you have the `_hypot' function. */
+#undef HAVE__HYPOT
-/* Only used in build directory testsuite_hooks.h. */
-#undef HAVE_MEMLIMIT_AS
+/* Define to 1 if you have the `_hypotf' function. */
+#undef HAVE__HYPOTF
+
+/* Define to 1 if you have the `_hypotl' function. */
+#undef HAVE__HYPOTL
+
+/* Define to 1 if you have the `_isinf' function. */
+#undef HAVE__ISINF
+
+/* Define to 1 if you have the `_isinff' function. */
+#undef HAVE__ISINFF
+
+/* Define to 1 if you have the `_isinfl' function. */
+#undef HAVE__ISINFL
+
+/* Define to 1 if you have the `_isnan' function. */
+#undef HAVE__ISNAN
+
+/* Define to 1 if you have the `_isnanf' function. */
+#undef HAVE__ISNANF
+
+/* Define to 1 if you have the `_isnanl' function. */
+#undef HAVE__ISNANL
+
+/* Define to 1 if you have the `_ldexpf' function. */
+#undef HAVE__LDEXPF
+
+/* Define to 1 if you have the `_ldexpl' function. */
+#undef HAVE__LDEXPL
+
+/* Define to 1 if you have the `_log10f' function. */
+#undef HAVE__LOG10F
+
+/* Define to 1 if you have the `_log10l' function. */
+#undef HAVE__LOG10L
+
+/* Define to 1 if you have the `_logf' function. */
+#undef HAVE__LOGF
+
+/* Define to 1 if you have the `_logl' function. */
+#undef HAVE__LOGL
+
+/* Define to 1 if you have the `_modff' function. */
+#undef HAVE__MODFF
+
+/* Define to 1 if you have the `_modfl' function. */
+#undef HAVE__MODFL
+
+/* Define to 1 if you have the `_powf' function. */
+#undef HAVE__POWF
+/* Define to 1 if you have the `_powl' function. */
+#undef HAVE__POWL
+
+/* Define to 1 if you have the `_qfpclass' function. */
+#undef HAVE__QFPCLASS
+
+/* Define to 1 if you have the `_sincos' function. */
+#undef HAVE__SINCOS
+
+/* Define to 1 if you have the `_sincosf' function. */
+#undef HAVE__SINCOSF
+
+/* Define to 1 if you have the `_sincosl' function. */
+#undef HAVE__SINCOSL
+
+/* Define to 1 if you have the `_sinf' function. */
+#undef HAVE__SINF
+
+/* Define to 1 if you have the `_sinhf' function. */
+#undef HAVE__SINHF
+
+/* Define to 1 if you have the `_sinhl' function. */
+#undef HAVE__SINHL
+
+/* Define to 1 if you have the `_sinl' function. */
+#undef HAVE__SINL
+
+/* Define to 1 if you have the `_sqrtf' function. */
+#undef HAVE__SQRTF
+
+/* Define to 1 if you have the `_sqrtl' function. */
+#undef HAVE__SQRTL
+
+/* Define to 1 if you have the `_tanf' function. */
+#undef HAVE__TANF
+
+/* Define to 1 if you have the `_tanhf' function. */
+#undef HAVE__TANHF
+
+/* Define to 1 if you have the `_tanhl' function. */
+#undef HAVE__TANHL
+
+/* Define to 1 if you have the `_tanl' function. */
+#undef HAVE__TANL
+
+/* Define to 1 if you have the `__signbit' function. */
+#undef HAVE___SIGNBIT
+
+/* Define to 1 if you have the `__signbitf' function. */
+#undef HAVE___SIGNBITF
+
+/* Define to 1 if you have the `__signbitl' function. */
+#undef HAVE___SIGNBITL
+
+/* 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 1 if a full hosted library is built, or 0 if freestanding. */
+#undef _GLIBCXX_HOSTED
+
+/* Define if the compiler is configured for setjmp/longjmp exceptions. */
+#undef _GLIBCXX_SJLJ_EXCEPTIONS
//
// Systems that have certain non-standard functions prefixed with an
// underscore, we'll handle those here. Must come after config.h.in.
diff --git a/libstdc++-v3/config/abi/x86_64-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/x86_64-linux-gnu/baseline_symbols.txt
index 15af15630db..299af6148a8 100644
--- a/libstdc++-v3/config/abi/x86_64-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/x86_64-linux-gnu/baseline_symbols.txt
@@ -355,11 +355,17 @@ FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_
FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRt@@GLIBCPP_3.2
FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE12_M_group_intERKSscRSt8ios_basePcS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE12_M_widen_intES3_RSt8ios_basecPci@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIlEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIlEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intImEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intImEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIxEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIxEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIyEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIyEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_group_floatERKSscPKcPcS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_widen_floatES3_RSt8ios_basecPci@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatIdEES3_S3_RSt8ios_baseccT_@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatIeEES3_S3_RSt8ios_baseccT_@@GLIBCPP_3.2
@@ -371,6 +377,7 @@ FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8io
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecm@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6_M_padEclRSt8ios_basePcPKcRi@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecPKv@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecb@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecd@@GLIBCPP_3.2
@@ -380,11 +387,17 @@ FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecy@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertES3_RSt8ios_basecPKci@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE12_M_group_intERKSswRSt8ios_basePwS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE12_M_widen_intES3_RSt8ios_basewPci@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIlEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIlEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intImEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intImEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIxEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIxEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIyEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIyEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_group_floatERKSswPKwPwS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_widen_floatES3_RSt8ios_basewPci@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE16_M_convert_floatIdEES3_S3_RSt8ios_basewcT_@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE16_M_convert_floatIeEES3_S3_RSt8ios_basewcT_@@GLIBCPP_3.2
@@ -396,6 +409,7 @@ FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE3putES3_RSt8io
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE3putES3_RSt8ios_basewm@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE3putES3_RSt8ios_basewx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE3putES3_RSt8ios_basewy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6_M_padEwlRSt8ios_basePwPKwRi@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewPKv@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewb@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewd@@GLIBCPP_3.2
@@ -933,6 +947,7 @@ FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
+FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4syncEv@@GLIBCPP_3.2
@@ -1462,6 +1477,7 @@ FUNC:_ZNSt19basic_ostringstreamIwSt11char_traitsIwESaIwEED0Ev@@GLIBCPP_3.2
FUNC:_ZNSt19basic_ostringstreamIwSt11char_traitsIwESaIwEED1Ev@@GLIBCPP_3.2
FUNC:_ZNSt19basic_ostringstreamIwSt11char_traitsIwESaIwEED2Ev@@GLIBCPP_3.2
FUNC:_ZNSt24__default_alloc_templateILb1ELi0EE10deallocateEPvm@@GLIBCPP_3.2
+FUNC:_ZNSt24__default_alloc_templateILb1ELi0EE10reallocateEPvmm@@GLIBCPP_3.2
FUNC:_ZNSt24__default_alloc_templateILb1ELi0EE11_S_round_upEm@@GLIBCPP_3.2
FUNC:_ZNSt24__default_alloc_templateILb1ELi0EE14_S_chunk_allocEmRi@@GLIBCPP_3.2
FUNC:_ZNSt24__default_alloc_templateILb1ELi0EE17_S_freelist_indexEm@@GLIBCPP_3.2
@@ -1531,16 +1547,12 @@ FUNC:_ZNSt6localeC2Ev@@GLIBCPP_3.2
FUNC:_ZNSt6localeD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt6localeD2Ev@@GLIBCPP_3.2
FUNC:_ZNSt6localeaSERKS_@@GLIBCPP_3.2
-FUNC:_ZNSt7codecvtIcc11__mbstate_tEC1EP15__locale_structm@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIcc11__mbstate_tEC1Em@@GLIBCPP_3.2
-FUNC:_ZNSt7codecvtIcc11__mbstate_tEC2EP15__locale_structm@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIcc11__mbstate_tEC2Em@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIcc11__mbstate_tED0Ev@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIcc11__mbstate_tED1Ev@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIcc11__mbstate_tED2Ev@@GLIBCPP_3.2
-FUNC:_ZNSt7codecvtIwc11__mbstate_tEC1EP15__locale_structm@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIwc11__mbstate_tEC1Em@@GLIBCPP_3.2
-FUNC:_ZNSt7codecvtIwc11__mbstate_tEC2EP15__locale_structm@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIwc11__mbstate_tEC2Em@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIwc11__mbstate_tED0Ev@@GLIBCPP_3.2
FUNC:_ZNSt7codecvtIwc11__mbstate_tED1Ev@@GLIBCPP_3.2
@@ -1860,8 +1872,10 @@ FUNC:_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_St8_SetfillIS3_E@@GL
FUNC:_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_c@@GLIBCPP_3.2
FUNC:_ZStlsIwSt11char_traitsIwESaIwEERSt13basic_ostreamIT_T0_ES7_RKSbIS4_S5_T1_E@@GLIBCPP_3.2
FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_@@GLIBCPP_3.2
+FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_@@GLIBCPP_3.2.1
FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ES3_RKS6_@@GLIBCPP_3.2
FUNC:_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_EPKS3_RKS6_@@GLIBCPP_3.2
+FUNC:_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ERKS6_S8_@@GLIBCPP_3.2.1
FUNC:_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ES3_RKS6_@@GLIBCPP_3.2
FUNC:_ZStrsISt11char_traitsIcEERSt13basic_istreamIcT_ES5_Pa@@GLIBCPP_3.2
FUNC:_ZStrsISt11char_traitsIcEERSt13basic_istreamIcT_ES5_Ph@@GLIBCPP_3.2
@@ -1984,6 +1998,9 @@ FUNC:__cxa_end_catch@@CXXABI_1.2
FUNC:__cxa_free_exception@@CXXABI_1.2
FUNC:__cxa_get_globals@@CXXABI_1.2
FUNC:__cxa_get_globals_fast@@CXXABI_1.2
+FUNC:__cxa_guard_abort@@CXXABI_1.2.1
+FUNC:__cxa_guard_acquire@@CXXABI_1.2.1
+FUNC:__cxa_guard_release@@CXXABI_1.2.1
FUNC:__cxa_pure_virtual@@CXXABI_1.2
FUNC:__cxa_rethrow@@CXXABI_1.2
FUNC:__cxa_throw@@CXXABI_1.2
@@ -2000,7 +2017,11 @@ FUNC:__cxa_vec_new@@CXXABI_1.2
FUNC:__dynamic_cast@@CXXABI_1.2
FUNC:__gxx_personality_v0@@CXXABI_1.2
OBJECT:0:CXXABI_1.2
+OBJECT:0:CXXABI_1.2.1
OBJECT:0:GLIBCPP_3.2
+OBJECT:0:GLIBCPP_3.2.1
+OBJECT:0:GLIBCPP_3.2.2
+OBJECT:0:GLIBCPP_3.2.3
OBJECT:104:_ZTVSt10moneypunctIcLb0EE@@GLIBCPP_3.2
OBJECT:104:_ZTVSt10moneypunctIcLb1EE@@GLIBCPP_3.2
OBJECT:104:_ZTVSt10moneypunctIwLb0EE@@GLIBCPP_3.2
@@ -2065,6 +2086,8 @@ OBJECT:16:_ZSt11money_get_c@@GLIBCPP_3.2
OBJECT:16:_ZSt11money_get_w@@GLIBCPP_3.2
OBJECT:16:_ZSt11money_put_c@@GLIBCPP_3.2
OBJECT:16:_ZSt11money_put_w@@GLIBCPP_3.2
+OBJECT:16:_ZSt9codecvt_c@@GLIBCPP_3.2
+OBJECT:16:_ZSt9codecvt_w@@GLIBCPP_3.2
OBJECT:16:_ZSt9num_get_c@@GLIBCPP_3.2
OBJECT:16:_ZSt9num_get_w@@GLIBCPP_3.2
OBJECT:16:_ZSt9num_put_c@@GLIBCPP_3.2
@@ -2371,8 +2394,6 @@ OBJECT:248:_ZSt8buf_cout@@GLIBCPP_3.2
OBJECT:24:_ZNSt6locale5_Impl13_S_id_collateE@@GLIBCPP_3.2
OBJECT:24:_ZNSt6locale5_Impl14_S_id_messagesE@@GLIBCPP_3.2
OBJECT:24:_ZSt7ctype_w@@GLIBCPP_3.2
-OBJECT:24:_ZSt9codecvt_c@@GLIBCPP_3.2
-OBJECT:24:_ZSt9codecvt_w@@GLIBCPP_3.2
OBJECT:24:_ZSt9collate_c@@GLIBCPP_3.2
OBJECT:24:_ZSt9collate_w@@GLIBCPP_3.2
OBJECT:24:_ZTIN10__cxxabiv116__enum_type_infoE@@GLIBCPP_3.2
@@ -2794,6 +2815,7 @@ OBJECT:4:_ZNSt21__numeric_limits_base14min_exponent10E@@GLIBCPP_3.2
OBJECT:4:_ZNSt21__numeric_limits_base5radixE@@GLIBCPP_3.2
OBJECT:4:_ZNSt21__numeric_limits_base6digitsE@@GLIBCPP_3.2
OBJECT:4:_ZNSt21__numeric_limits_base8digits10E@@GLIBCPP_3.2
+OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE12_S_force_newE@@GLIBCPP_3.2.2
OBJECT:4:_ZNSt6locale2id12_S_highwaterE@@GLIBCPP_3.2
OBJECT:4:_ZNSt6locale3allE@@GLIBCPP_3.2
OBJECT:4:_ZNSt6locale4noneE@@GLIBCPP_3.2
@@ -2991,6 +3013,8 @@ OBJECT:8:_ZNSbIwSt11char_traitsIwESaIwEE4_Rep11_S_max_sizeE@@GLIBCPP_3.2
OBJECT:8:_ZNSbIwSt11char_traitsIwESaIwEE4nposE@@GLIBCPP_3.2
OBJECT:8:_ZNSs4_Rep11_S_max_sizeE@@GLIBCPP_3.2
OBJECT:8:_ZNSs4nposE@@GLIBCPP_3.2
+OBJECT:8:_ZNSt10__num_base11_S_atoms_inE@@GLIBCPP_3.2.3
+OBJECT:8:_ZNSt10__num_base12_S_atoms_outE@@GLIBCPP_3.2.3
OBJECT:8:_ZNSt10moneypunctIcLb0EE2idE@@GLIBCPP_3.2
OBJECT:8:_ZNSt10moneypunctIcLb1EE2idE@@GLIBCPP_3.2
OBJECT:8:_ZNSt10moneypunctIwLb0EE2idE@@GLIBCPP_3.2
diff --git a/libstdc++-v3/config/cpu/hppa/atomicity.h b/libstdc++-v3/config/cpu/hppa/atomicity.h
index 7e527ef6c5f..a717ab555a4 100644
--- a/libstdc++-v3/config/cpu/hppa/atomicity.h
+++ b/libstdc++-v3/config/cpu/hppa/atomicity.h
@@ -34,9 +34,9 @@ __Atomicity_lock<__inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
/* Because of the lack of weak support when using the hpux
som linker, we explicitly instantiate the atomicity lock
- in src/misc-inst.cc when _GLIBCXX_INST_GLIBCXX_ATOMICITY_LOCK
+ in src/misc-inst.cc when _GLIBCXX_INST_ATOMICITY_LOCK
is defined. */
-#ifndef _GLIBCXX_INST_GLIBCXX_ATOMICITY_LOCK
+#ifndef _GLIBCXX_INST_ATOMICITY_LOCK
template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
#endif
diff --git a/libstdc++-v3/config/cpu/m68k/atomicity.h b/libstdc++-v3/config/cpu/m68k/atomicity.h
index 01c64dadc1c..d33bbef6dd9 100644
--- a/libstdc++-v3/config/cpu/m68k/atomicity.h
+++ b/libstdc++-v3/config/cpu/m68k/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: m68k version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -32,8 +32,9 @@
typedef int _Atomic_word;
-#if defined(__mc68020__) || defined(__mc68030__) \
- || defined(__mc68040__) || defined(__mc68060__)
+#if ( defined(__mc68020__) || defined(__mc68030__) \
+ || defined(__mc68040__) || defined(__mc68060__) ) \
+ && !defined(__mcpu32__)
// These variants support compare-and-swap.
static inline _Atomic_word
@@ -74,8 +75,7 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
return __result;
}
-#elif !defined(__mcf5200__) && !defined(__mcf5300__)
-// 68000, 68010, cpu32 and 5400 support test-and-set.
+#else
template <int __inst>
struct __Atomicity_lock
@@ -94,9 +94,26 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
_Atomic_word __result;
+// bset with no immediate addressing
+#if defined(__mcf5200__) || defined(__mcf5300__) || defined(__mcf5400__)
+ __asm__ __volatile__("1: bset.b #7,%0@\n\tjbne 1b"
+ : /* no outputs */
+ : "a"(&__Atomicity_lock<0>::_S_atomicity_lock)
+ : "cc", "memory");
+
+// bset with immediate addressing
+#elif defined(__mc68000__)
+ __asm__ __volatile__("1: bset.b #7,%0\n\tjbne 1b"
+ : "+m"(__Atomicity_lock<0>::_S_atomicity_lock)
+ : /* none */
+ : "cc");
+
+#else // 680x0, cpu32, 5400 support test-and-set.
__asm__ __volatile__("1: tas %0\n\tjbne 1b"
- : "=m"(__Atomicity_lock<0>::_S_atomicity_lock)
- : "m"(__Atomicity_lock<0>::_S_atomicity_lock));
+ : "+m"(__Atomicity_lock<0>::_S_atomicity_lock)
+ : /* none */
+ : "cc");
+#endif
__result = *__mem;
*__mem = __result + __val;
@@ -106,45 +123,7 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
return __result;
}
-#elif defined(__vxWorks__) || defined(__embedded__)
-// The best we can hope for is to disable interrupts, which we
-// can only do from supervisor mode.
-
-static inline _Atomic_word
-__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
-{
- _Atomic_word __result;
- short __level, __tmpsr;
- __asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
- : "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
-
- __result = *__mem;
- *__mem = __result + __val;
-
- __asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
-
- return __result;
-}
-
-#else
-// These variants do not support any atomic operations at all.
-
-#warning "__exchange_and_add is not atomic for this target"
-
-static inline _Atomic_word
-__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
-{
- _Atomic_word __result;
-
- __result = *__mem;
- *__mem = __result + __val;
-
- return __result;
-}
-
-#endif /* CAS / IRQ / TAS */
+#endif /* TAS / BSET */
static inline void
__attribute__ ((__unused__))
@@ -155,4 +134,4 @@ __atomic_add (volatile _Atomic_word* __mem, int __val)
(void) __exchange_and_add (__mem, __val);
}
-#endif /* atomicity.h */
+#endif /* !_GLIBCXX_ATOMICITY_H */
diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc
index 2c099d3a279..556bd9063fb 100644
--- a/libstdc++-v3/config/io/basic_file_stdio.cc
+++ b/libstdc++-v3/config/io/basic_file_stdio.cc
@@ -50,6 +50,10 @@
#include <poll.h>
#endif
+#ifdef _GLIBCXX_HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
#if defined(_GLIBCXX_HAVE_S_ISREG) || defined(_GLIBCXX_HAVE_S_IFREG)
# include <sys/stat.h>
# ifdef _GLIBCXX_HAVE_S_ISREG
@@ -83,33 +87,33 @@ namespace std
if (!__testi && __testo && !__testt && !__testa)
{
strcpy(__c_mode, "w");
- __p_mode = (O_WRONLY | O_CREAT);
+ __p_mode = O_WRONLY | O_CREAT;
}
if (!__testi && __testo && !__testt && __testa)
{
strcpy(__c_mode, "a");
- __p_mode |= O_WRONLY | O_CREAT | O_APPEND;
+ __p_mode = O_WRONLY | O_CREAT | O_APPEND;
}
if (!__testi && __testo && __testt && !__testa)
{
strcpy(__c_mode, "w");
- __p_mode |= O_WRONLY | O_CREAT | O_TRUNC;
+ __p_mode = O_WRONLY | O_CREAT | O_TRUNC;
}
if (__testi && !__testo && !__testt && !__testa)
{
strcpy(__c_mode, "r");
- __p_mode |= O_RDONLY;
+ __p_mode = O_RDONLY;
}
if (__testi && __testo && !__testt && !__testa)
{
strcpy(__c_mode, "r+");
- __p_mode |= O_RDWR | O_CREAT;
+ __p_mode = O_RDWR | O_CREAT;
}
if (__testi && __testo && __testt && !__testa)
{
strcpy(__c_mode, "w+");
- __p_mode |= O_RDWR | O_CREAT | O_TRUNC;
+ __p_mode = O_RDWR | O_CREAT | O_TRUNC;
}
if (__testb)
strcat(__c_mode, "b");
@@ -150,14 +154,6 @@ namespace std
}
return __ret;
}
-
- int
- __basic_file<char>::sys_getc()
- { return getc(_M_cfile); }
-
- int
- __basic_file<char>::sys_ungetc(int __c)
- { return ungetc(__c, _M_cfile); }
__basic_file<char>*
__basic_file<char>::open(const char* __name, ios_base::openmode __mode,
@@ -225,6 +221,40 @@ namespace std
return __ret;
}
+ streamsize
+ __basic_file<char>::xsputn_2(const char* __s1, streamsize __n1,
+ const char* __s2, streamsize __n2)
+ {
+ streamsize __ret = 0;
+#ifdef _GLIBCXX_HAVE_WRITEV
+ struct iovec __iov[2];
+ __iov[0].iov_base = const_cast<char*>(__s1);
+ __iov[0].iov_len = __n1;
+ __iov[1].iov_base = const_cast<char*>(__s2);
+ __iov[1].iov_len = __n2;
+
+ do
+ __ret = writev(this->fd(), __iov, 2);
+ while (__ret == -1L && errno == EINTR);
+#else
+ if (__n1)
+ do
+ __ret = write(this->fd(), __s1, __n1);
+ while (__ret == -1L && errno == EINTR);
+
+ if (__ret == __n1)
+ {
+ do
+ __ret = write(this->fd(), __s2, __n2);
+ while (__ret == -1L && errno == EINTR);
+
+ if (__ret != -1L)
+ __ret += __n1;
+ }
+#endif
+ return __ret;
+ }
+
streampos
__basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode /*__mode*/)
diff --git a/libstdc++-v3/config/io/basic_file_stdio.h b/libstdc++-v3/config/io/basic_file_stdio.h
index 7c0ffbf4837..2b1a9871c32 100644
--- a/libstdc++-v3/config/io/basic_file_stdio.h
+++ b/libstdc++-v3/config/io/basic_file_stdio.h
@@ -76,12 +76,6 @@ namespace std
__basic_file*
sys_open(int __fd, ios_base::openmode __mode, bool __del);
- int
- sys_getc();
-
- int
- sys_ungetc(int);
-
__basic_file*
close();
@@ -97,6 +91,10 @@ namespace std
xsputn(const char* __s, streamsize __n);
streamsize
+ xsputn_2(const char* __s1, streamsize __n1,
+ const char* __s2, streamsize __n2);
+
+ streamsize
xsgetn(char* __s, streamsize __n);
streampos
diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu
index 5cf3dd9c7e7..fa54dcf1a05 100644
--- a/libstdc++-v3/config/linker-map.gnu
+++ b/libstdc++-v3/config/linker-map.gnu
@@ -55,7 +55,9 @@ GLIBCXX_3.4 {
std::__num_base::_S_format_int*;
std::__num_base::_S_atoms_in;
std::__num_base::_S_atoms_out;
+ std::__moneypunct_cache*;
std::__numpunct_cache*;
+ std::__timepunct_cache*
};
# Names not in an 'extern' block are mangled names.
@@ -73,6 +75,15 @@ GLIBCXX_3.4 {
# bool has_facet
_ZSt9has_facet*;
+ # _Rb_tree
+ _ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base;
+ _ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base;
+ _ZSt18_Rb_tree_rebalancePSt18_Rb_tree_node_baseRS0_;
+ _ZSt20_Rb_tree_black_countPKSt18_Rb_tree_node_baseS1_;
+ _ZSt20_Rb_tree_rotate_leftPSt18_Rb_tree_node_baseRS0_;
+ _ZSt21_Rb_tree_rotate_rightPSt18_Rb_tree_node_baseRS0_;
+ _ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_;
+
# virtual table
_ZTVNSt8ios_base7failureE;
_ZTVNSt6locale5facetE;
diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
index 0819a5cbe9c..8e2072a75b3 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.h
+++ b/libstdc++-v3/config/locale/generic/c_locale.h
@@ -39,6 +39,9 @@
#pragma GCC system_header
#include <clocale>
+#include <cstdlib> // get std::malloc
+#include <cstring> // get std::strlen
+#include <cstdio> // get std::snprintf or std::sprintf
#define _GLIBCXX_NUM_CATEGORIES 0
@@ -57,26 +60,26 @@ namespace std
const char* __fmt,
_Tv __v, const __c_locale&, int __prec = -1)
{
- char* __old = setlocale(LC_ALL, NULL);
- char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
+ char* __old = std::setlocale(LC_ALL, NULL);
+ char* __sav = static_cast<char*>(std::malloc(std::strlen(__old) + 1));
if (__sav)
- strcpy(__sav, __old);
- setlocale(LC_ALL, "C");
+ std::strcpy(__sav, __old);
+ std::setlocale(LC_ALL, "C");
int __ret;
#ifdef _GLIBCXX_USE_C99
if (__prec >= 0)
- __ret = snprintf(__out, __size, __fmt, __prec, __v);
+ __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
else
- __ret = snprintf(__out, __size, __fmt, __v);
+ __ret = std::snprintf(__out, __size, __fmt, __v);
#else
if (__prec >= 0)
- __ret = sprintf(__out, __fmt, __prec, __v);
+ __ret = std::sprintf(__out, __fmt, __prec, __v);
else
- __ret = sprintf(__out, __fmt, __v);
+ __ret = std::sprintf(__out, __fmt, __v);
#endif
- setlocale(LC_ALL, __sav);
- free(__sav);
+ std::setlocale(LC_ALL, __sav);
+ std::free(__sav);
return __ret;
}
}
diff --git a/libstdc++-v3/config/locale/generic/messages_members.h b/libstdc++-v3/config/locale/generic/messages_members.h
index 9d48759353f..2d588049c4f 100644
--- a/libstdc++-v3/config/locale/generic/messages_members.h
+++ b/libstdc++-v3/config/locale/generic/messages_members.h
@@ -36,12 +36,12 @@
// Non-virtual member functions.
template<typename _CharT>
messages<_CharT>::messages(size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs)
{ _M_c_locale_messages = _S_c_locale; }
template<typename _CharT>
messages<_CharT>::messages(__c_locale, const char*, size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs)
{ _M_c_locale_messages = _S_c_locale; }
template<typename _CharT>
diff --git a/libstdc++-v3/config/locale/generic/monetary_members.cc b/libstdc++-v3/config/locale/generic/monetary_members.cc
index 1ee08444f5a..51bbe0b0c01 100644
--- a/libstdc++-v3/config/locale/generic/monetary_members.cc
+++ b/libstdc++-v3/config/locale/generic/monetary_members.cc
@@ -1,6 +1,6 @@
// std::moneypunct implementation details, generic version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -47,41 +47,47 @@ namespace std
void
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*)
{
- // "C" locale
- _M_decimal_point = '.';
- _M_thousands_sep = ',';
- _M_grouping = "";
- _M_curr_symbol = "";
- _M_positive_sign = "";
- _M_negative_sign = "";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ // "C" locale.
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<char>;
+
+ _M_data->_M_decimal_point = '.';
+ _M_data->_M_thousands_sep = ',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = "";
+ _M_data->_M_positive_sign = "";
+ _M_data->_M_negative_sign = "";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
void
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*)
{
- // "C" locale
- _M_decimal_point = '.';
- _M_thousands_sep = ',';
- _M_grouping = "";
- _M_curr_symbol = "";
- _M_positive_sign = "";
- _M_negative_sign = "";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ // "C" locale.
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<char>;
+
+ _M_data->_M_decimal_point = '.';
+ _M_data->_M_thousands_sep = ',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = "";
+ _M_data->_M_positive_sign = "";
+ _M_data->_M_negative_sign = "";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
moneypunct<char, true>::~moneypunct()
- { }
+ { delete _M_data; }
template<>
moneypunct<char, false>::~moneypunct()
- { }
+ { delete _M_data; }
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
@@ -90,15 +96,18 @@ namespace std
const char*)
{
// "C" locale
- _M_decimal_point = L'.';
- _M_thousands_sep = L',';
- _M_grouping = "";
- _M_curr_symbol = L"";
- _M_positive_sign = L"";
- _M_negative_sign = L"";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<wchar_t>;
+
+ _M_data->_M_decimal_point = L'.';
+ _M_data->_M_thousands_sep = L',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = L"";
+ _M_data->_M_positive_sign = L"";
+ _M_data->_M_negative_sign = L"";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
@@ -107,23 +116,26 @@ namespace std
const char*)
{
// "C" locale
- _M_decimal_point = L'.';
- _M_thousands_sep = L',';
- _M_grouping = "";
- _M_curr_symbol = L"";
- _M_positive_sign = L"";
- _M_negative_sign = L"";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<wchar_t>;
+
+ _M_data->_M_decimal_point = L'.';
+ _M_data->_M_thousands_sep = L',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = L"";
+ _M_data->_M_positive_sign = L"";
+ _M_data->_M_negative_sign = L"";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
moneypunct<wchar_t, true>::~moneypunct()
- { }
+ { delete _M_data; }
template<>
moneypunct<wchar_t, false>::~moneypunct()
- { }
+ { delete _M_data; }
#endif
}
diff --git a/libstdc++-v3/config/locale/generic/time_members.cc b/libstdc++-v3/config/locale/generic/time_members.cc
index f6913fe3294..3574a844b5a 100644
--- a/libstdc++-v3/config/locale/generic/time_members.cc
+++ b/libstdc++-v3/config/locale/generic/time_members.cc
@@ -1,6 +1,6 @@
// std::time_get, std::time_put implementation, generic version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -55,62 +55,65 @@ namespace std
void
__timepunct<char>::_M_initialize_timepunct(__c_locale)
{
- // "C" locale
- _M_date_format = "%m/%d/%y";
- _M_date_era_format = "%m/%d/%y";
- _M_time_format = "%H:%M:%S";
- _M_time_era_format = "%H:%M:%S";
- _M_date_time_format = "";
- _M_date_time_era_format = "";
- _M_am = "AM";
- _M_pm = "PM";
- _M_am_pm_format = "";
+ // "C" locale.
+ if (!_M_data)
+ _M_data = new __timepunct_cache<char>;
+
+ _M_data->_M_date_format = "%m/%d/%y";
+ _M_data->_M_date_era_format = "%m/%d/%y";
+ _M_data->_M_time_format = "%H:%M:%S";
+ _M_data->_M_time_era_format = "%H:%M:%S";
+ _M_data->_M_date_time_format = "";
+ _M_data->_M_date_time_era_format = "";
+ _M_data->_M_am = "AM";
+ _M_data->_M_pm = "PM";
+ _M_data->_M_am_pm_format = "";
// Day names, starting with "C"'s Sunday.
- _M_day1 = "Sunday";
- _M_day2 = "Monday";
- _M_day3 = "Tuesday";
- _M_day4 = "Wednesday";
- _M_day5 = "Thursday";
- _M_day6 = "Friday";
- _M_day7 = "Saturday";
+ _M_data->_M_day1 = "Sunday";
+ _M_data->_M_day2 = "Monday";
+ _M_data->_M_day3 = "Tuesday";
+ _M_data->_M_day4 = "Wednesday";
+ _M_data->_M_day5 = "Thursday";
+ _M_data->_M_day6 = "Friday";
+ _M_data->_M_day7 = "Saturday";
// Abbreviated day names, starting with "C"'s Sun.
- _M_day_a1 = "Sun";
- _M_day_a2 = "Mon";
- _M_day_a3 = "Tue";
- _M_day_a4 = "Wed";
- _M_day_a5 = "Thu";
- _M_day_a6 = "Fri";
- _M_day_a7 = "Sat";
+ _M_data->_M_aday1 = "Sun";
+ _M_data->_M_aday2 = "Mon";
+ _M_data->_M_aday3 = "Tue";
+ _M_data->_M_aday4 = "Wed";
+ _M_data->_M_aday5 = "Thu";
+ _M_data->_M_aday6 = "Fri";
+ _M_data->_M_aday7 = "Sat";
// Month names, starting with "C"'s January.
- _M_month01 = "January";
- _M_month02 = "February";
- _M_month03 = "March";
- _M_month04 = "April";
- _M_month05 = "May";
- _M_month06 = "June";
- _M_month07 = "July";
- _M_month08 = "August";
- _M_month09 = "September";
- _M_month10 = "October";
- _M_month11 = "November";
- _M_month12 = "December";
+ _M_data->_M_month01 = "January";
+ _M_data->_M_month02 = "February";
+ _M_data->_M_month03 = "March";
+ _M_data->_M_month04 = "April";
+ _M_data->_M_month05 = "May";
+ _M_data->_M_month06 = "June";
+ _M_data->_M_month07 = "July";
+ _M_data->_M_month08 = "August";
+ _M_data->_M_month09 = "September";
+ _M_data->_M_month10 = "October";
+ _M_data->_M_month11 = "November";
+ _M_data->_M_month12 = "December";
// Abbreviated month names, starting with "C"'s Jan.
- _M_month_a01 = "Jan";
- _M_month_a02 = "Feb";
- _M_month_a03 = "Mar";
- _M_month_a04 = "Apr";
- _M_month_a05 = "May";
- _M_month_a06 = "Jun";
- _M_month_a07 = "July";
- _M_month_a08 = "Aug";
- _M_month_a09 = "Sep";
- _M_month_a10 = "Oct";
- _M_month_a11 = "Nov";
- _M_month_a12 = "Dec";
+ _M_data->_M_amonth01 = "Jan";
+ _M_data->_M_amonth02 = "Feb";
+ _M_data->_M_amonth03 = "Mar";
+ _M_data->_M_amonth04 = "Apr";
+ _M_data->_M_amonth05 = "May";
+ _M_data->_M_amonth06 = "Jun";
+ _M_data->_M_amonth07 = "July";
+ _M_data->_M_amonth08 = "Aug";
+ _M_data->_M_amonth09 = "Sep";
+ _M_data->_M_amonth10 = "Oct";
+ _M_data->_M_amonth11 = "Nov";
+ _M_data->_M_amonth12 = "Dec";
}
#ifdef _GLIBCXX_USE_WCHAR_T
@@ -131,62 +134,65 @@ namespace std
void
__timepunct<wchar_t>::_M_initialize_timepunct(__c_locale)
{
- // "C" locale
- _M_date_format = L"%m/%d/%y";
- _M_date_era_format = L"%m/%d/%y";
- _M_time_format = L"%H:%M:%S";
- _M_time_era_format = L"%H:%M:%S";
- _M_date_time_format = L"";
- _M_date_time_era_format = L"";
- _M_am = L"AM";
- _M_pm = L"PM";
- _M_am_pm_format = L"";
+ // "C" locale.
+ if (!_M_data)
+ _M_data = new __timepunct_cache<wchar_t>;
+
+ _M_data->_M_date_format = L"%m/%d/%y";
+ _M_data->_M_date_era_format = L"%m/%d/%y";
+ _M_data->_M_time_format = L"%H:%M:%S";
+ _M_data->_M_time_era_format = L"%H:%M:%S";
+ _M_data->_M_date_time_format = L"";
+ _M_data->_M_date_time_era_format = L"";
+ _M_data->_M_am = L"AM";
+ _M_data->_M_pm = L"PM";
+ _M_data->_M_am_pm_format = L"";
// Day names, starting with "C"'s Sunday.
- _M_day1 = L"Sunday";
- _M_day2 = L"Monday";
- _M_day3 = L"Tuesday";
- _M_day4 = L"Wednesday";
- _M_day5 = L"Thursday";
- _M_day6 = L"Friday";
- _M_day7 = L"Saturday";
+ _M_data->_M_day1 = L"Sunday";
+ _M_data->_M_day2 = L"Monday";
+ _M_data->_M_day3 = L"Tuesday";
+ _M_data->_M_day4 = L"Wednesday";
+ _M_data->_M_day5 = L"Thursday";
+ _M_data->_M_day6 = L"Friday";
+ _M_data->_M_day7 = L"Saturday";
// Abbreviated day names, starting with "C"'s Sun.
- _M_day_a1 = L"Sun";
- _M_day_a2 = L"Mon";
- _M_day_a3 = L"Tue";
- _M_day_a4 = L"Wed";
- _M_day_a5 = L"Thu";
- _M_day_a6 = L"Fri";
- _M_day_a7 = L"Sat";
+ _M_data->_M_aday1 = L"Sun";
+ _M_data->_M_aday2 = L"Mon";
+ _M_data->_M_aday3 = L"Tue";
+ _M_data->_M_aday4 = L"Wed";
+ _M_data->_M_aday5 = L"Thu";
+ _M_data->_M_aday6 = L"Fri";
+ _M_data->_M_aday7 = L"Sat";
// Month names, starting with "C"'s January.
- _M_month01 = L"January";
- _M_month02 = L"February";
- _M_month03 = L"March";
- _M_month04 = L"April";
- _M_month05 = L"May";
- _M_month06 = L"June";
- _M_month07 = L"July";
- _M_month08 = L"August";
- _M_month09 = L"September";
- _M_month10 = L"October";
- _M_month11 = L"November";
- _M_month12 = L"December";
+ _M_data->_M_month01 = L"January";
+ _M_data->_M_month02 = L"February";
+ _M_data->_M_month03 = L"March";
+ _M_data->_M_month04 = L"April";
+ _M_data->_M_month05 = L"May";
+ _M_data->_M_month06 = L"June";
+ _M_data->_M_month07 = L"July";
+ _M_data->_M_month08 = L"August";
+ _M_data->_M_month09 = L"September";
+ _M_data->_M_month10 = L"October";
+ _M_data->_M_month11 = L"November";
+ _M_data->_M_month12 = L"December";
// Abbreviated month names, starting with "C"'s Jan.
- _M_month_a01 = L"Jan";
- _M_month_a02 = L"Feb";
- _M_month_a03 = L"Mar";
- _M_month_a04 = L"Apr";
- _M_month_a05 = L"May";
- _M_month_a06 = L"Jun";
- _M_month_a07 = L"July";
- _M_month_a08 = L"Aug";
- _M_month_a09 = L"Sep";
- _M_month_a10 = L"Oct";
- _M_month_a11 = L"Nov";
- _M_month_a12 = L"Dec";
+ _M_data->_M_amonth01 = L"Jan";
+ _M_data->_M_amonth02 = L"Feb";
+ _M_data->_M_amonth03 = L"Mar";
+ _M_data->_M_amonth04 = L"Apr";
+ _M_data->_M_amonth05 = L"May";
+ _M_data->_M_amonth06 = L"Jun";
+ _M_data->_M_amonth07 = L"July";
+ _M_data->_M_amonth08 = L"Aug";
+ _M_data->_M_amonth09 = L"Sep";
+ _M_data->_M_amonth10 = L"Oct";
+ _M_data->_M_amonth11 = L"Nov";
+ _M_data->_M_amonth12 = L"Dec";
}
#endif
}
diff --git a/libstdc++-v3/config/locale/generic/time_members.h b/libstdc++-v3/config/locale/generic/time_members.h
index 03c31d1797e..8db2cb53ed8 100644
--- a/libstdc++-v3/config/locale/generic/time_members.h
+++ b/libstdc++-v3/config/locale/generic/time_members.h
@@ -36,7 +36,15 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL)
+ {
+ _M_name_timepunct = _S_c_name;
+ _M_initialize_timepunct();
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+ : facet(__refs), _M_data(__cache)
{
_M_name_timepunct = _S_c_name;
_M_initialize_timepunct();
@@ -45,7 +53,7 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL)
{
_M_name_timepunct = new char[strlen(__s) + 1];
strcpy(_M_name_timepunct, __s);
@@ -57,5 +65,6 @@
{
if (_S_c_name != _M_name_timepunct)
delete [] _M_name_timepunct;
+ delete _M_data;
_S_destroy_c_locale(_M_c_locale_timepunct);
}
diff --git a/libstdc++-v3/config/locale/gnu/c_locale.h b/libstdc++-v3/config/locale/gnu/c_locale.h
index 6bc4c39577e..069074eb9fe 100644
--- a/libstdc++-v3/config/locale/gnu/c_locale.h
+++ b/libstdc++-v3/config/locale/gnu/c_locale.h
@@ -38,6 +38,9 @@
#pragma GCC system_header
+#include <cstring> // get std::strlen
+#include <cstdlib> // get std::malloc
+#include <cstdio> // get std::snprintf or std::sprintf
#include <clocale>
#include <langinfo.h> // For codecvt
#include <iconv.h> // For codecvt using iconv, iconv_t
@@ -72,31 +75,31 @@ namespace std
#else
_Tv __v, const __c_locale&, int __prec = -1)
{
- char* __old = setlocale(LC_ALL, NULL);
- char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
+ char* __old = std::setlocale(LC_ALL, NULL);
+ char* __sav = static_cast<char*>(std::malloc(std::strlen(__old) + 1));
if (__sav)
- strcpy(__sav, __old);
- setlocale(LC_ALL, "C");
+ std::strcpy(__sav, __old);
+ std::setlocale(LC_ALL, "C");
#endif
int __ret;
#ifdef _GLIBCXX_USE_C99
if (__prec >= 0)
- __ret = snprintf(__out, __size, __fmt, __prec, __v);
+ __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
else
- __ret = snprintf(__out, __size, __fmt, __v);
+ __ret = std::snprintf(__out, __size, __fmt, __v);
#else
if (__prec >= 0)
- __ret = sprintf(__out, __fmt, __prec, __v);
+ __ret = std::sprintf(__out, __fmt, __prec, __v);
else
- __ret = sprintf(__out, __fmt, __v);
+ __ret = std::sprintf(__out, __fmt, __v);
#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__gnu_cxx::__uselocale(__old);
#else
- setlocale(LC_ALL, __sav);
- free(__sav);
+ std::setlocale(LC_ALL, __sav);
+ std::free(__sav);
#endif
return __ret;
}
diff --git a/libstdc++-v3/config/locale/gnu/messages_members.h b/libstdc++-v3/config/locale/gnu/messages_members.h
index 8cab730acfa..48dcf32dd2e 100644
--- a/libstdc++-v3/config/locale/gnu/messages_members.h
+++ b/libstdc++-v3/config/locale/gnu/messages_members.h
@@ -36,7 +36,7 @@
// Non-virtual member functions.
template<typename _CharT>
messages<_CharT>::messages(size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs)
{
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
_M_name_messages = _S_c_name;
@@ -48,7 +48,7 @@
messages<_CharT>::messages(__c_locale __cloc,
const char* __s __attribute__ ((__unused__)),
size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs)
{
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
_M_name_messages = new char[strlen(__s) + 1];
diff --git a/libstdc++-v3/config/locale/gnu/monetary_members.cc b/libstdc++-v3/config/locale/gnu/monetary_members.cc
index 3ad7d34c17c..a22bdfe6f24 100644
--- a/libstdc++-v3/config/locale/gnu/monetary_members.cc
+++ b/libstdc++-v3/config/locale/gnu/monetary_members.cc
@@ -1,6 +1,6 @@
// std::moneypunct implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -220,43 +220,52 @@ namespace std
moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
const char*)
{
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<char>;
+
if (!__cloc)
{
// "C" locale
- _M_decimal_point = '.';
- _M_thousands_sep = ',';
- _M_grouping = "";
- _M_curr_symbol = "";
- _M_positive_sign = "";
- _M_negative_sign = "";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ _M_data->_M_decimal_point = '.';
+ _M_data->_M_thousands_sep = ',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = "";
+ _M_data->_M_positive_sign = "";
+ _M_data->_M_negative_sign = "";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
else
{
// Named locale.
- _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
- _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
- _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
- _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
+ __cloc));
+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
+ __cloc));
+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
if (!__nposn)
- _M_negative_sign = "()";
+ _M_data->_M_negative_sign = "()";
else
- _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
+ __cloc);
// _Intl == true
- _M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
- _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
+ __cloc));
char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
- _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
+ __pposn);
char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
- _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
+ __nposn);
}
}
@@ -265,53 +274,61 @@ namespace std
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
const char*)
{
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<char>;
+
if (!__cloc)
{
// "C" locale
- _M_decimal_point = '.';
- _M_thousands_sep = ',';
- _M_grouping = "";
- _M_curr_symbol = "";
- _M_positive_sign = "";
- _M_negative_sign = "";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ _M_data->_M_decimal_point = '.';
+ _M_data->_M_thousands_sep = ',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = "";
+ _M_data->_M_positive_sign = "";
+ _M_data->_M_negative_sign = "";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
else
{
// Named locale.
- _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
- _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
- _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
- _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
+ __cloc));
+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
+ __cloc));
+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
if (!__nposn)
- _M_negative_sign = "()";
+ _M_data->_M_negative_sign = "()";
else
- _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
+ __cloc);
// _Intl == false
- _M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
- _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
- _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
+ __pposn);
char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
- _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
+ __nposn);
}
}
template<>
moneypunct<char, true>::~moneypunct()
- { }
+ { delete _M_data; }
template<>
moneypunct<char, false>::~moneypunct()
- { }
+ { delete _M_data; }
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
@@ -323,18 +340,21 @@ namespace std
const char* __name)
#endif
{
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<wchar_t>;
+
if (!__cloc)
{
// "C" locale
- _M_decimal_point = L'.';
- _M_thousands_sep = L',';
- _M_grouping = "";
- _M_curr_symbol = L"";
- _M_positive_sign = L"";
- _M_negative_sign = L"";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ _M_data->_M_decimal_point = L'.';
+ _M_data->_M_thousands_sep = L',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = L"";
+ _M_data->_M_positive_sign = L"";
+ _M_data->_M_negative_sign = L"";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
else
{
@@ -349,11 +369,11 @@ namespace std
union __s_and_w { const char *__s; unsigned int __w; } __u;
__u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
- _M_decimal_point = static_cast<wchar_t>(__u.__w);
+ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
- _M_thousands_sep = static_cast<wchar_t>(__u.__w);
- _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
@@ -367,25 +387,25 @@ namespace std
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cpossign, __len, &__state);
- _M_positive_sign = __wcs;
+ _M_data->_M_positive_sign = __wcs;
}
else
- _M_positive_sign = L"";
+ _M_data->_M_positive_sign = L"";
char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
__len = strlen(__cnegsign);
if (!__nposn)
- _M_negative_sign = L"()";
+ _M_data->_M_negative_sign = L"()";
else if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
- _M_negative_sign = __wcs;
+ _M_data->_M_negative_sign = __wcs;
}
else
- _M_negative_sign = L"";
+ _M_data->_M_negative_sign = L"";
// _Intl == true.
__len = strlen(__ccurr);
@@ -395,19 +415,22 @@ namespace std
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__ccurr, __len, &__state);
- _M_curr_symbol = __wcs;
+ _M_data->_M_curr_symbol = __wcs;
}
else
- _M_curr_symbol = L"";
+ _M_data->_M_curr_symbol = L"";
- _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
+ __cloc));
char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
- _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
+ __pposn);
char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
- _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
+ __nposn);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
@@ -427,18 +450,21 @@ namespace std
const char* __name)
#endif
{
+ if (!_M_data)
+ _M_data = new __moneypunct_cache<wchar_t>;
+
if (!__cloc)
{
// "C" locale
- _M_decimal_point = L'.';
- _M_thousands_sep = L',';
- _M_grouping = "";
- _M_curr_symbol = L"";
- _M_positive_sign = L"";
- _M_negative_sign = L"";
- _M_frac_digits = 0;
- _M_pos_format = money_base::_S_default_pattern;
- _M_neg_format = money_base::_S_default_pattern;
+ _M_data->_M_decimal_point = L'.';
+ _M_data->_M_thousands_sep = L',';
+ _M_data->_M_grouping = "";
+ _M_data->_M_curr_symbol = L"";
+ _M_data->_M_positive_sign = L"";
+ _M_data->_M_negative_sign = L"";
+ _M_data->_M_frac_digits = 0;
+ _M_data->_M_pos_format = money_base::_S_default_pattern;
+ _M_data->_M_neg_format = money_base::_S_default_pattern;
}
else
{
@@ -453,11 +479,11 @@ namespace std
union __s_and_w { const char *__s; unsigned int __w; } __u;
__u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
- _M_decimal_point = static_cast<wchar_t>(__u.__w);
+ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
- _M_thousands_sep = static_cast<wchar_t>(__u.__w);
- _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
@@ -472,25 +498,25 @@ namespace std
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cpossign, __len, &__state);
- _M_positive_sign = __wcs;
+ _M_data->_M_positive_sign = __wcs;
}
else
- _M_positive_sign = L"";
+ _M_data->_M_positive_sign = L"";
char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
__len = strlen(__cnegsign);
if (!__nposn)
- _M_negative_sign = L"()";
+ _M_data->_M_negative_sign = L"()";
else if (__len)
{
++__len;
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
- _M_negative_sign = __wcs;
+ _M_data->_M_negative_sign = __wcs;
}
else
- _M_negative_sign = L"";
+ _M_data->_M_negative_sign = L"";
// _Intl == true.
__len = strlen(__ccurr);
@@ -500,19 +526,21 @@ namespace std
memset(&__state, 0, sizeof(mbstate_t));
wchar_t* __wcs = new wchar_t[__len];
mbsrtowcs(__wcs, &__ccurr, __len, &__state);
- _M_curr_symbol = __wcs;
+ _M_data->_M_curr_symbol = __wcs;
}
else
- _M_curr_symbol = L"";
+ _M_data->_M_curr_symbol = L"";
- _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
- _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
+ __pposn);
char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
- _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
+ __nposn);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
@@ -526,23 +554,27 @@ namespace std
template<>
moneypunct<wchar_t, true>::~moneypunct()
{
- if (wcslen(_M_positive_sign))
- delete [] _M_positive_sign;
- if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
- delete [] _M_negative_sign;
- if (wcslen(_M_curr_symbol))
- delete [] _M_curr_symbol;
+ if (wcslen(_M_data->_M_positive_sign))
+ delete [] _M_data->_M_positive_sign;
+ if (wcslen(_M_data->_M_negative_sign)
+ && (wcscmp(_M_data->_M_negative_sign, L"()") != 0))
+ delete [] _M_data->_M_negative_sign;
+ if (wcslen(_M_data->_M_curr_symbol))
+ delete [] _M_data->_M_curr_symbol;
+ delete _M_data;
}
template<>
moneypunct<wchar_t, false>::~moneypunct()
{
- if (wcslen(_M_positive_sign))
- delete [] _M_positive_sign;
- if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
- delete [] _M_negative_sign;
- if (wcslen(_M_curr_symbol))
- delete [] _M_curr_symbol;
+ if (wcslen(_M_data->_M_positive_sign))
+ delete [] _M_data->_M_positive_sign;
+ if (wcslen(_M_data->_M_negative_sign)
+ && (wcscmp(_M_data->_M_negative_sign, L"()") != 0))
+ delete [] _M_data->_M_negative_sign;
+ if (wcslen(_M_data->_M_curr_symbol))
+ delete [] _M_data->_M_curr_symbol;
+ delete _M_data;
}
#endif
}
diff --git a/libstdc++-v3/config/locale/gnu/time_members.cc b/libstdc++-v3/config/locale/gnu/time_members.cc
index 1dcdfd5c43e..e49b66b256f 100644
--- a/libstdc++-v3/config/locale/gnu/time_members.cc
+++ b/libstdc++-v3/config/locale/gnu/time_members.cc
@@ -1,6 +1,6 @@
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -60,126 +60,129 @@ namespace std
void
__timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
{
+ if (!_M_data)
+ _M_data = new __timepunct_cache<char>;
+
if (!__cloc)
{
// "C" locale
_M_c_locale_timepunct = _S_c_locale;
- _M_date_format = "%m/%d/%y";
- _M_date_era_format = "%m/%d/%y";
- _M_time_format = "%H:%M:%S";
- _M_time_era_format = "%H:%M:%S";
- _M_date_time_format = "";
- _M_date_time_era_format = "";
- _M_am = "AM";
- _M_pm = "PM";
- _M_am_pm_format = "";
+ _M_data->_M_date_format = "%m/%d/%y";
+ _M_data->_M_date_era_format = "%m/%d/%y";
+ _M_data->_M_time_format = "%H:%M:%S";
+ _M_data->_M_time_era_format = "%H:%M:%S";
+ _M_data->_M_date_time_format = "";
+ _M_data->_M_date_time_era_format = "";
+ _M_data->_M_am = "AM";
+ _M_data->_M_pm = "PM";
+ _M_data->_M_am_pm_format = "";
// Day names, starting with "C"'s Sunday.
- _M_day1 = "Sunday";
- _M_day2 = "Monday";
- _M_day3 = "Tuesday";
- _M_day4 = "Wednesday";
- _M_day5 = "Thursday";
- _M_day6 = "Friday";
- _M_day7 = "Saturday";
+ _M_data->_M_day1 = "Sunday";
+ _M_data->_M_day2 = "Monday";
+ _M_data->_M_day3 = "Tuesday";
+ _M_data->_M_day4 = "Wednesday";
+ _M_data->_M_day5 = "Thursday";
+ _M_data->_M_day6 = "Friday";
+ _M_data->_M_day7 = "Saturday";
// Abbreviated day names, starting with "C"'s Sun.
- _M_day_a1 = "Sun";
- _M_day_a2 = "Mon";
- _M_day_a3 = "Tue";
- _M_day_a4 = "Wed";
- _M_day_a5 = "Thu";
- _M_day_a6 = "Fri";
- _M_day_a7 = "Sat";
+ _M_data->_M_aday1 = "Sun";
+ _M_data->_M_aday2 = "Mon";
+ _M_data->_M_aday3 = "Tue";
+ _M_data->_M_aday4 = "Wed";
+ _M_data->_M_aday5 = "Thu";
+ _M_data->_M_aday6 = "Fri";
+ _M_data->_M_aday7 = "Sat";
// Month names, starting with "C"'s January.
- _M_month01 = "January";
- _M_month02 = "February";
- _M_month03 = "March";
- _M_month04 = "April";
- _M_month05 = "May";
- _M_month06 = "June";
- _M_month07 = "July";
- _M_month08 = "August";
- _M_month09 = "September";
- _M_month10 = "October";
- _M_month11 = "November";
- _M_month12 = "December";
+ _M_data->_M_month01 = "January";
+ _M_data->_M_month02 = "February";
+ _M_data->_M_month03 = "March";
+ _M_data->_M_month04 = "April";
+ _M_data->_M_month05 = "May";
+ _M_data->_M_month06 = "June";
+ _M_data->_M_month07 = "July";
+ _M_data->_M_month08 = "August";
+ _M_data->_M_month09 = "September";
+ _M_data->_M_month10 = "October";
+ _M_data->_M_month11 = "November";
+ _M_data->_M_month12 = "December";
// Abbreviated month names, starting with "C"'s Jan.
- _M_month_a01 = "Jan";
- _M_month_a02 = "Feb";
- _M_month_a03 = "Mar";
- _M_month_a04 = "Apr";
- _M_month_a05 = "May";
- _M_month_a06 = "Jun";
- _M_month_a07 = "July";
- _M_month_a08 = "Aug";
- _M_month_a09 = "Sep";
- _M_month_a10 = "Oct";
- _M_month_a11 = "Nov";
- _M_month_a12 = "Dec";
+ _M_data->_M_amonth01 = "Jan";
+ _M_data->_M_amonth02 = "Feb";
+ _M_data->_M_amonth03 = "Mar";
+ _M_data->_M_amonth04 = "Apr";
+ _M_data->_M_amonth05 = "May";
+ _M_data->_M_amonth06 = "Jun";
+ _M_data->_M_amonth07 = "July";
+ _M_data->_M_amonth08 = "Aug";
+ _M_data->_M_amonth09 = "Sep";
+ _M_data->_M_amonth10 = "Oct";
+ _M_data->_M_amonth11 = "Nov";
+ _M_data->_M_amonth12 = "Dec";
}
else
{
_M_c_locale_timepunct = _S_clone_c_locale(__cloc);
- _M_date_format = __nl_langinfo_l(D_FMT, __cloc);
- _M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
- _M_time_format = __nl_langinfo_l(T_FMT, __cloc);
- _M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
- _M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
- _M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
- _M_am = __nl_langinfo_l(AM_STR, __cloc);
- _M_pm = __nl_langinfo_l(PM_STR, __cloc);
- _M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
// Day names, starting with "C"'s Sunday.
- _M_day1 = __nl_langinfo_l(DAY_1, __cloc);
- _M_day2 = __nl_langinfo_l(DAY_2, __cloc);
- _M_day3 = __nl_langinfo_l(DAY_3, __cloc);
- _M_day4 = __nl_langinfo_l(DAY_4, __cloc);
- _M_day5 = __nl_langinfo_l(DAY_5, __cloc);
- _M_day6 = __nl_langinfo_l(DAY_6, __cloc);
- _M_day7 = __nl_langinfo_l(DAY_7, __cloc);
+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
// Abbreviated day names, starting with "C"'s Sun.
- _M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
- _M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
- _M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
- _M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
- _M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
- _M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
- _M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
// Month names, starting with "C"'s January.
- _M_month01 = __nl_langinfo_l(MON_1, __cloc);
- _M_month02 = __nl_langinfo_l(MON_2, __cloc);
- _M_month03 = __nl_langinfo_l(MON_3, __cloc);
- _M_month04 = __nl_langinfo_l(MON_4, __cloc);
- _M_month05 = __nl_langinfo_l(MON_5, __cloc);
- _M_month06 = __nl_langinfo_l(MON_6, __cloc);
- _M_month07 = __nl_langinfo_l(MON_7, __cloc);
- _M_month08 = __nl_langinfo_l(MON_8, __cloc);
- _M_month09 = __nl_langinfo_l(MON_9, __cloc);
- _M_month10 = __nl_langinfo_l(MON_10, __cloc);
- _M_month11 = __nl_langinfo_l(MON_11, __cloc);
- _M_month12 = __nl_langinfo_l(MON_12, __cloc);
+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
// Abbreviated month names, starting with "C"'s Jan.
- _M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
- _M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
- _M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
- _M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
- _M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
- _M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
- _M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
- _M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
- _M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
- _M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
- _M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
- _M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
}
}
@@ -205,126 +208,129 @@ namespace std
void
__timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
{
+ if (!_M_data)
+ _M_data = new __timepunct_cache<wchar_t>;
+
if (!__cloc)
{
// "C" locale
_M_c_locale_timepunct = _S_c_locale;
- _M_date_format = L"%m/%d/%y";
- _M_date_era_format = L"%m/%d/%y";
- _M_time_format = L"%H:%M:%S";
- _M_time_era_format = L"%H:%M:%S";
- _M_date_time_format = L"";
- _M_date_time_era_format = L"";
- _M_am = L"AM";
- _M_pm = L"PM";
- _M_am_pm_format = L"";
+ _M_data->_M_date_format = L"%m/%d/%y";
+ _M_data->_M_date_era_format = L"%m/%d/%y";
+ _M_data->_M_time_format = L"%H:%M:%S";
+ _M_data->_M_time_era_format = L"%H:%M:%S";
+ _M_data->_M_date_time_format = L"";
+ _M_data->_M_date_time_era_format = L"";
+ _M_data->_M_am = L"AM";
+ _M_data->_M_pm = L"PM";
+ _M_data->_M_am_pm_format = L"";
// Day names, starting with "C"'s Sunday.
- _M_day1 = L"Sunday";
- _M_day2 = L"Monday";
- _M_day3 = L"Tuesday";
- _M_day4 = L"Wednesday";
- _M_day5 = L"Thursday";
- _M_day6 = L"Friday";
- _M_day7 = L"Saturday";
+ _M_data->_M_day1 = L"Sunday";
+ _M_data->_M_day2 = L"Monday";
+ _M_data->_M_day3 = L"Tuesday";
+ _M_data->_M_day4 = L"Wednesday";
+ _M_data->_M_day5 = L"Thursday";
+ _M_data->_M_day6 = L"Friday";
+ _M_data->_M_day7 = L"Saturday";
// Abbreviated day names, starting with "C"'s Sun.
- _M_day_a1 = L"Sun";
- _M_day_a2 = L"Mon";
- _M_day_a3 = L"Tue";
- _M_day_a4 = L"Wed";
- _M_day_a5 = L"Thu";
- _M_day_a6 = L"Fri";
- _M_day_a7 = L"Sat";
+ _M_data->_M_aday1 = L"Sun";
+ _M_data->_M_aday2 = L"Mon";
+ _M_data->_M_aday3 = L"Tue";
+ _M_data->_M_aday4 = L"Wed";
+ _M_data->_M_aday5 = L"Thu";
+ _M_data->_M_aday6 = L"Fri";
+ _M_data->_M_aday7 = L"Sat";
// Month names, starting with "C"'s January.
- _M_month01 = L"January";
- _M_month02 = L"February";
- _M_month03 = L"March";
- _M_month04 = L"April";
- _M_month05 = L"May";
- _M_month06 = L"June";
- _M_month07 = L"July";
- _M_month08 = L"August";
- _M_month09 = L"September";
- _M_month10 = L"October";
- _M_month11 = L"November";
- _M_month12 = L"December";
+ _M_data->_M_month01 = L"January";
+ _M_data->_M_month02 = L"February";
+ _M_data->_M_month03 = L"March";
+ _M_data->_M_month04 = L"April";
+ _M_data->_M_month05 = L"May";
+ _M_data->_M_month06 = L"June";
+ _M_data->_M_month07 = L"July";
+ _M_data->_M_month08 = L"August";
+ _M_data->_M_month09 = L"September";
+ _M_data->_M_month10 = L"October";
+ _M_data->_M_month11 = L"November";
+ _M_data->_M_month12 = L"December";
// Abbreviated month names, starting with "C"'s Jan.
- _M_month_a01 = L"Jan";
- _M_month_a02 = L"Feb";
- _M_month_a03 = L"Mar";
- _M_month_a04 = L"Apr";
- _M_month_a05 = L"May";
- _M_month_a06 = L"Jun";
- _M_month_a07 = L"July";
- _M_month_a08 = L"Aug";
- _M_month_a09 = L"Sep";
- _M_month_a10 = L"Oct";
- _M_month_a11 = L"Nov";
- _M_month_a12 = L"Dec";
+ _M_data->_M_amonth01 = L"Jan";
+ _M_data->_M_amonth02 = L"Feb";
+ _M_data->_M_amonth03 = L"Mar";
+ _M_data->_M_amonth04 = L"Apr";
+ _M_data->_M_amonth05 = L"May";
+ _M_data->_M_amonth06 = L"Jun";
+ _M_data->_M_amonth07 = L"July";
+ _M_data->_M_amonth08 = L"Aug";
+ _M_data->_M_amonth09 = L"Sep";
+ _M_data->_M_amonth10 = L"Oct";
+ _M_data->_M_amonth11 = L"Nov";
+ _M_data->_M_amonth12 = L"Dec";
}
else
{
_M_c_locale_timepunct = _S_clone_c_locale(__cloc);
- _M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
- _M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
- _M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
- _M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
- _M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
- _M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
- _M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
- _M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
- _M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
+ _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
+ _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
+ _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
+ _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
+ _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
+ _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
+ _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
+ _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
+ _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
// Day names, starting with "C"'s Sunday.
- _M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
- _M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
- _M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
- _M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
- _M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
- _M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
- _M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
+ _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
+ _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
+ _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
+ _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
+ _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
+ _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
+ _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
// Abbreviated day names, starting with "C"'s Sun.
- _M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
- _M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
- _M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
- _M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
- _M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
- _M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
- _M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
+ _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
+ _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
+ _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
+ _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
+ _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
+ _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
+ _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
// Month names, starting with "C"'s January.
- _M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
- _M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
- _M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
- _M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
- _M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
- _M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
- _M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
- _M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
- _M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
- _M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
- _M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
- _M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
+ _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
+ _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
+ _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
+ _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
+ _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
+ _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
+ _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
+ _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
+ _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
+ _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
+ _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
+ _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
// Abbreviated month names, starting with "C"'s Jan.
- _M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
- _M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
- _M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
- _M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
- _M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
- _M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
- _M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
- _M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
- _M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
- _M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
- _M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
- _M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
+ _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
+ _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
+ _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
+ _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
+ _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
+ _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
+ _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
+ _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
+ _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
+ _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
+ _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
+ _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
}
}
#endif
diff --git a/libstdc++-v3/config/locale/gnu/time_members.h b/libstdc++-v3/config/locale/gnu/time_members.h
index 8ef7a07107c..6badaacbfa0 100644
--- a/libstdc++-v3/config/locale/gnu/time_members.h
+++ b/libstdc++-v3/config/locale/gnu/time_members.h
@@ -36,7 +36,17 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL)
+ {
+#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
+ _M_name_timepunct = _S_c_name;
+#endif
+ _M_initialize_timepunct();
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+ : facet(__refs), _M_data(__cache)
{
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
_M_name_timepunct = _S_c_name;
@@ -48,7 +58,7 @@
__timepunct<_CharT>::__timepunct(__c_locale __cloc,
const char* __s __attribute__ ((__unused__)),
size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL)
{
#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
_M_name_timepunct = new char[strlen(__s) + 1];
@@ -64,5 +74,6 @@
if (_S_c_name != _M_name_timepunct)
delete [] _M_name_timepunct;
#endif
+ delete _M_data;
_S_destroy_c_locale(_M_c_locale_timepunct);
}
diff --git a/libstdc++-v3/config/os/hpux/os_defines.h b/libstdc++-v3/config/os/hpux/os_defines.h
index ba0445a4cb6..b83516dd260 100644
--- a/libstdc++-v3/config/os/hpux/os_defines.h
+++ b/libstdc++-v3/config/os/hpux/os_defines.h
@@ -97,8 +97,9 @@ typedef long int __padding_type;
#define _GLIBCXX_INST_ATOMICITY_LOCK 1
#endif
-/* Don't use pragma weak in gthread headers. */
-#ifdef __hppa__
+/* Don't use pragma weak in gthread headers. HP-UX rejects programs
+ with unsatisfied external references even if all of those references
+ are weak; gthread relies on such unsatisfied references being resolved
+ to null pointers when weak symbol support is on. */
#define _GLIBCXX_GTHREAD_USE_WEAK 0
#endif
-#endif
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index a1b794b4991..87a258a5ad8 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -1,91 +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 for package-unused version-unused.
#
+# 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
-# Defaults:
-ac_help=
+# 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
+
+
+# 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-multilib build hella library versions (default)"
-ac_help="$ac_help
- --with-target-subdir=SUBDIR
- configuring in a subdirectory"
-ac_help="$ac_help
- --with-cross-host=HOST configuring with a cross compiler"
-ac_help="$ac_help
- --with-newlib Configuring with newlib"
-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-sjlj-exceptions force use of builtin_setjmp for exceptions"
-ac_help="$ac_help
- --enable-libunwind-exceptions force use of libunwind for exceptions"
-ac_help="$ac_help
- --enable-libstdcxx-pch build pre-compiled libstdc++ includes [default=yes]"
-ac_help="$ac_help
- --enable-cstdio enable stdio for target io package.
- --enable-cstdio=LIB use LIB target-specific io package. [default=stdio]
- "
-ac_help="$ac_help
- --enable-clocale enable model for target locale package.
- --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
- "
-ac_help="$ac_help
- --enable-nls use Native Language Support (default)"
-ac_help="$ac_help
- --enable-cheaders=MODEL construct "C" header files for g++ [default=c_std]"
-ac_help="$ac_help
- --enable-c-mbchar enable multibyte (wide) characters [default=yes]"
-ac_help="$ac_help
- --enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=yes]"
-ac_help="$ac_help
- --enable-long-long turns on 'long long' [default=yes]"
-ac_help="$ac_help
- --enable-concept-checks use Boost-derived template checks [default=no]"
-ac_help="$ac_help
- --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
- [default=]"
-ac_help="$ac_help
- --enable-libstdcxx-debug build extra debug library [default=no]"
-ac_help="$ac_help
- --enable-libstdcxx-debug-flags=FLAGS pass compiler FLAGS when building
- debug library;
- [default=none]"
-ac_help="$ac_help
- --enable-symvers=style enables symbol versioning of the shared library [default=yes]"
-ac_help="$ac_help
- --with-gxx-include-dir the installation directory for include files"
-ac_help="$ac_help
- --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory "
+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-unused'
+PACKAGE_TARNAME='libstdc++'
+PACKAGE_VERSION='version-unused'
+PACKAGE_STRING='package-unused version-unused'
+PACKAGE_BUGREPORT=''
+
+ac_unique_file="src/ios.cc"
+# 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 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 FPOS_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 FPOS_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.
+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
@@ -94,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'
@@ -111,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"
@@ -129,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- \
@@ -190,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 \
@@ -287,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 \
@@ -313,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 \
@@ -349,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)
@@ -359,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 \
@@ -370,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.
@@ -432,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
-# 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
+# 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
+
+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=src/ios.cc
# 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=..
@@ -534,13 +726,492 @@ 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; }
- fi
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(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_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+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 package-unused version-unused 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]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of package-unused version-unused:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-multilib build many library versions (default)
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --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)
+ --disable-hosted-libstdcxx
+ only build freestanding C++ runtime support
+ --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
+ [default=stdio]
+ --enable-clocale[=MODEL]
+ use MODEL for target locale package
+ [default=auto]
+ --enable-nls use Native Language Support (default)
+ --enable-cheaders=KIND construct "C" headers for g++
+ [default=$c_model]
+ --enable-c-mbchar enable multibyte (wide) characters
+ [default=yes]
+ --enable-c99 turns on ISO/IEC 9899:1999 support
+ [default=yes]
+ --enable-long-long enables I/O support for 'long long'
+ [default=yes]
+ --enable-concept-checks use Boost-derived template checks [default=no]
+ --enable-libstdcxx-debug-flags=FLAGS
+ pass compiler FLAGS when building debug library
+ [default="-g3 -O0"]
+ --enable-libstdcxx-debug
+ build extra debug library [default=no]
+ --enable-cxx-flags=FLAGS
+ pass compiler FLAGS when building library
+ [default=]
+ --enable-symvers=STYLE enables symbol versioning of the shared library
+ [default=yes]
+ --enable-version-specific-runtime-libs
+ Specify that runtime libraries should be installed
+ in a compiler-specific directory
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-target-subdir=SUBDIR
+ configuring in a subdirectory
+ --with-cross-host=HOST configuring with a cross compiler
+ --with-newlib assume newlib as a system C library
+ --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-gxx-include-dir=DIR
+ installation directory for include files
+
+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>
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+ 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
+package-unused configure version-unused
+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
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+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 package-unused $as_me version-unused, 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
@@ -551,87 +1222,175 @@ 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_headers="$ac_config_headers config.h"
+
+
# This works around the fact that libtool configuration may change LD
# for this particular configuration, but some shells, instead of
# keeping the changes in LD private, export them just because LD is
# exported. Only used at the end of this file.
-ORIGINAL_LD_FOR_MULTILIBS=$LD
-
-PACKAGE=libstdc++
+### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
# For libtool versioning info, format is CURRENT:REVISION:AGE
libtool_VERSION=6:0:0
+# Find the rest of the source tree framework.
- # Check whether --enable-multilib or --disable-multilib was given.
+ # Sets up multi_basedir, which is srcdir/.. plus the usual
+ # "multi_source_toprel_bottom_adjust" lunacy as needed.
+ # Default to --enable-multilib
+# Check whether --enable-multilib or --disable-multilib was given.
if test "${enable_multilib+set}" = set; then
enableval="$enable_multilib"
- case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;;
- esac
+ case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for multilib option" >&5
+echo "$as_me: error: bad value $enableval for multilib option" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
else
multilib=yes
-fi
+fi;
- # When building with srcdir == objdir, links to the source files will
- # be created in directories within the target_subdir. We have to
- # adjust toplevel_srcdir accordingly, so that configure finds
- # install-sh and other auxiliary files that live in the top-level
- # source directory.
- if test "${srcdir}" = "."; then
- if test -z "${with_target_subdir}"; then
- toprel=".."
- else
- if test "${with_target_subdir}" != "."; then
- toprel="${with_multisrctop}../.."
- else
- toprel="${with_multisrctop}.."
- fi
- fi
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
else
- toprel=".."
+ multi_basedir="$srcdir/$with_multisrctop.."
fi
- ac_aux_dir=
-for ac_dir in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel; do
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+ ac_config_commands="$ac_config_commands default-1"
+
+
+ # The generated code is exactly the same, except that automake's looks in
+ # ".. $srcdir/.." and autoconf's looks in multi_basedir. Apparently other
+ # things are triggered on the presence of the two ...AUX_DIR[S], but I don't
+ # know what they are or what the other differences might be (and they keep
+ # changing anyhow).
+ #
+ # Looking in multi_basedir seems smarter, so actually execute that branch.
+ if false; then
+ # this is for automake
+ 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"
@@ -640,24 +1399,57 @@ for ac_dir in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel; 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}/$toprel $srcdir/${srcdir}/$toprel" 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.
+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.
+
+ else
+ # this is for autoconf
+ ac_aux_dir=
+for ac_dir in ${multi_basedir}; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ 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 "$as_me:$LINENO: error: cannot find install-sh or install.sh in ${multi_basedir}" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in ${multi_basedir}" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+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.
+
+ fi
- toplevel_srcdir=\${top_srcdir}/$toprel
-
# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
#
# You will slowly go insane if you do not grok the following fact: when
# building v3 as part of the compiler, the top-level /target/ becomes the
-# library's /host/. `configure' then causes --target to default to --host,
+# library's /host/. configure then causes --target to default to --host,
# exactly like any other package using autoconf. Therefore, 'target' and
# 'host' will always be the same. This makes sense both for native and
# cross compilers, just think about it for a little while. :-)
@@ -665,777 +1457,2047 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# Also, if v3 is being configured as part of a cross compiler, the top-level
# configure script will pass the "real" host as $with_cross_host.
#
-# In AC 2.13 AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
+# Do not delete or change the following two lines. For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+# 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 target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+target_alias=${target_alias-$host_alias}
+
+# Handy for debugging:
+#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
+
+if test "$build" != "$host"; then
+ # We are being configured with some form of cross compiler.
+ GLIBCXX_IS_NATIVE=false
+
+else
+ GLIBCXX_IS_NATIVE=true
+fi
+
+# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
+# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
+# 1.x: minimum required version
+# no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
+# of other PACKAGE_* variables will, however, and there's nothing
+# we can do about that; they come from AC_INIT).
+# 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__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:
+# SysV /etc/install, /usr/sbin/install
+# 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 "$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 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
+ done
+ ;;
esac
+done
-# 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
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:698: checking host system type" >&5
+# 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}'
-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
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:719: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:737: 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
+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 > 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 conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
-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
+ # 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 "$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 "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { 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"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ 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
-# Runs configure.host, finds CC, CXX and assorted other critical bits.
-# Must run this before the GLIBCXX_ENABLE_* macros below.
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
+# 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
- ac_tool_prefix=
+ 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
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:769: checking for Cygwin environment" >&5
-if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
- cat > conftest.$ac_ext <<EOF
-#line 774 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-int main() {
+ test -n "$AWK" && break
+done
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_cygwin=yes
+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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_cygwin=no
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+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 conftest*
-rm -f conftest*
+rm -f conftest.make
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:802: checking for mingw32 environment" >&5
-if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
else
- cat > conftest.$ac_ext <<EOF
-#line 807 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
-int main() {
-return __MINGW32__;
-; return 0; }
-EOF
-if { (eval echo configure:814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_mingw32=yes
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_mingw32=no
+ am__leading_dot=_
fi
-rm -f conftest*
-rm -f conftest*
+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
-echo "$ac_t""$ac_cv_mingw32" 1>&6
-MINGW32=
-test "$ac_cv_mingw32" = yes && MINGW32=yes
+# 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
- # Export build and source directories.
- # These need to be absolute paths, yet at the same time need to
- # canonicalize only relative paths, because then amd will not unmount
- # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
- glibcxx_builddir=`${PWDCMD-pwd}`
- case $srcdir in
- \\/$* | ?:\\/*) glibcxx_srcdir=${srcdir} ;;
- *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
- esac
-
-
-
+# Define the identity of the package.
+ PACKAGE='libstdc++'
+ VERSION='version-unused'
- for ac_prog in mawk gawk nawk awk
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:850: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+# 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"}
+
+# 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
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AWK="$ac_prog"
- 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_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
-AWK="$ac_cv_prog_AWK"
-if test -n "$AWK"; then
- echo "$ac_t""$AWK" 1>&6
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ 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
-test -n "$AWK" && break
-done
-
- # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
- # be 'cp -p' if linking isn't available. Uncomment the next line to
- # force a particular method.
- #ac_cv_prog_LN_S='cp -p'
- echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:884: 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
+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
- rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- ac_cv_prog_LN_S="ln -s"
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
- ac_cv_prog_LN_S=ln
+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
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
- echo "$ac_t""yes" 1>&6
+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 "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ STRIP=$ac_ct_STRIP
+else
+ 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.
+
+
+
+
+# Runs configure.host, finds CC, CXX, and assorted other critical bits. Sets
+# up critical shell variables.
+
+ # Keep these sync'd with the list in Makefile.am. The first provides an
+ # expandable list at autoconf time; the second provides an expandable list
+ # (i.e., shell variable) at configure time.
+
+ SUBDIRS='include libmath libsupc++ src po testsuite'
+
+ # These need to be absolute paths, yet at the same time need to
+ # canonicalize only relative paths, because then amd will not unmount
+ # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+ glibcxx_builddir=`${PWDCMD-pwd}`
+ case $srcdir in
+ \\/$* | ?:\\/*) glibcxx_srcdir=${srcdir} ;;
+ *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+ esac
+ toplevel_srcdir=${glibcxx_srcdir}/..
+
+
+
- # We use these options to decide which functions to include.
- # Check whether --with-target-subdir or --without-target-subdir was given.
+ # We use these options to decide which functions to include. They are
+ # set from the top level.
+
+# Check whether --with-target-subdir or --without-target-subdir was given.
if test "${with_target_subdir+set}" = set; then
withval="$with_target_subdir"
- :
-fi
- # Check whether --with-cross-host or --without-cross-host was given.
+fi;
+
+
+# Check whether --with-cross-host or --without-cross-host was given.
if test "${with_cross_host+set}" = set; then
withval="$with_cross_host"
- :
-fi
+
+fi;
- # Check whether --with-newlib or --without-newlib was given.
+# Check whether --with-newlib or --without-newlib was given.
if test "${with_newlib+set}" = set; then
withval="$with_newlib"
- :
-fi
+
+fi;
+
+ # We're almost certainly being configured before anything else which uses
+ # C++, so all of our AC_PROG_* discoveries will be cached. It's vital that
+ # we not cache the value of CXX that we "discover" here, because it's set
+ # to something unique for us and libjava. Other target libraries need to
+ # find CXX for themselves. We yank the rug out from under the normal AC_*
+ # process by sneakily renaming the cache variable. This also lets us debug
+ # the value of "our" CXX in postmortems.
+ #
+ # We must also force CXX to /not/ be a precious variable, otherwise the
+ # wrong (non-multilib-adjusted) value will be used in multilibs. This
+ # little trick also affects CPPFLAGS, CXXFLAGS, and LDFLAGS. And as a side
+ # effect, CXXFLAGS is no longer automagically subst'd, so we have to do
+ # that ourselves. Un-preciousing AC_PROG_CC also affects CC and CFLAGS.
+ #
+ # -fno-builtin must be present here so that a non-conflicting form of
+ # std::exit can be guessed by AC_PROG_CXX, and used in later tests.
- glibcxx_basedir=$srcdir/$toprel/./libstdc++-v3
-
- # Never versions of autoconf add an underscore to these functions.
- # Prevent future problems ...
-
-
-
-
- # AC_PROG_CC
- # FIXME: We temporarily define our own version of AC_PROG_CC. This is
- # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
- # are probably using a cross compiler, which will not be able to fully
- # link an executable. This is addressed in later versions of autoconf.
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-builtin"
+ 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:948: 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
- if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:978: 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="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 "$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
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+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
+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
- echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1027: 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
+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
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1036: \"$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: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ 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
- ac_cv_prog_gcc=no
+ 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
+
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_t""$ac_cv_prog_gcc" 1>&6
+ test -n "$ac_ct_CC" && break
+done
- if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- 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:1051: 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
+ 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
+# FIXME: Cleanup?
+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
+ gcc_no_link=no
+else
+ gcc_no_link=yes
+fi
+
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+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
+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 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
+ 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
+ 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
- ac_cv_prog_cc_g=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 -f conftest*
+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
+fi
+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
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- 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
+
+ ;
+ 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 "$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
+
+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
+ 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
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+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
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ 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
- # Likewise for AC_PROG_CXX. We can't just call it directly because g++
- # will try to link in libstdc++.
-
+fi
-
- # Use glibcxx_CXX so that we do not cause CXX to be cached with the
- # flags that come in CXX while configuring libstdc++. They're different
- # from those used for all other target libraries. If CXX is set in
- # the environment, respect that here.
- glibcxx_CXX=$CXX
- for ac_prog in $CCC c++ g++ gcc CC cxx cc++
+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
-# 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:1094: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_glibcxx_CXX'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$glibcxx_CXX"; then
- ac_cv_prog_glibcxx_CXX="$glibcxx_CXX" # 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. */
+#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
- 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_glibcxx_CXX="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ 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
-glibcxx_CXX="$ac_cv_prog_glibcxx_CXX"
-if test -n "$glibcxx_CXX"; then
- echo "$ac_t""$glibcxx_CXX" 1>&6
+
else
- echo "$ac_t""no" 1>&6
+ 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
-test -n "$glibcxx_CXX" && break
+ 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 "${glibcxx_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ glibcxx_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
+ glibcxx_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
-test -n "$glibcxx_CXX" || glibcxx_CXX="gcc"
-
- CXX=$glibcxx_CXX
- test -z "$glibcxx_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
+fi
+fi
+CXX=$glibcxx_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
- echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1129: 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
+ 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
- cat > conftest.C <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gxx=yes
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
- ac_cv_prog_gxx=no
+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
-echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+ 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. */
- if test $ac_cv_prog_gxx = yes; then
- GXX=yes
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1153: 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
- echo 'void f(){}' > conftest.cc
-if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+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 "$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
- ac_cv_prog_cxx_g=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_prog_cxx_g=no
fi
-
-echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-O2"
- 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
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
+ CXXFLAGS="-g"
fi
-
-
- # For directory versioning (e.g., headers) and other variables.
- echo $ac_n "checking for GCC version number""... $ac_c" 1>&6
-echo "configure:1183: checking for GCC version number" >&5
- gcc_version=`$glibcxx_CXX -dumpversion`
- echo "$ac_t""$gcc_version" 1>&6
-
- # For some reason, gettext needs this.
-
- echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:1190: checking for strerror in -lcposix" >&5
-ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lcposix $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1198 "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 strerror();
-
-int main() {
-strerror()
-; return 0; }
-EOF
-if { (eval echo configure:1209: \"$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"
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ 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 ();' \
+ '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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ 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*
-LIBS="$ac_save_LIBS"
-
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lcposix"
+
+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
+
+ CXXFLAGS="$save_CXXFLAGS"
+
+
+
+
+ # For directory versioning (e.g., headers) and other variables.
+ echo "$as_me:$LINENO: checking for GCC version number" >&5
+echo $ECHO_N "checking for GCC version number... $ECHO_C" >&6
+ gcc_version=`$CXX -dumpversion`
+ echo "$as_me:$LINENO: result: $gcc_version" >&5
+echo "${ECHO_T}$gcc_version" >&6
+
+ # Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't
+ # available). Uncomment the next line to force a particular method.
+ 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
- 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
-
-
+ #LN_S='cp -p'
+ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1235: 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 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
- 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
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as"
+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"
+AS=$ac_cv_prog_AS
if test -n "$AS"; then
- echo "$ac_t""$AS" 1>&6
+ echo "$as_me:$LINENO: result: $AS" >&5
+echo "${ECHO_T}$AS" >&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_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
+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}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:1267: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR'+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_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
- 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_AR="${ac_tool_prefix}ar"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+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"
+AR=$ac_cv_prog_AR
if test -n "$AR"; then
- echo "$ac_t""$AR" 1>&6
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&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_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
+
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1299: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
- 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"
+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"
+RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&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_RANLIB"; then
-if test -n "$ac_tool_prefix"; 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1331: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+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_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.
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib-not-found-in-path-error"
-fi
+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="ranlib-not-found-in-path-error"
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
fi
-
+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
- RANLIB="ranlib-not-found-in-path-error"
-fi
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- # Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1375: 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
+ RANLIB=$ac_ct_RANLIB
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
+ RANLIB="$ac_cv_prog_RANLIB"
fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
- echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1429: 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=
@@ -1444,255 +3506,37 @@ else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-
- # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
- # at least currently, we never actually build a program, so we never
- # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
- # fails, because we are probably configuring with a cross compiler
- # which can't create executables. So we include AC_EXEEXT to keep
- # automake happy, but we don't execute it, since we don't care about
- # the result.
- if false; then
- # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
- # to nothing, so nothing would remain between `then' and `fi' if it
- # were not for the `:' below.
- :
-
-
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1467: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_exeext=.exe
-else
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_exeext=
- if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
- for file in conftest.*; do
- case $file in
- *.$ac_ext | *.c | *.o | *.obj) ;;
- *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- else
- { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
- fi
- rm -f conftest*
- test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
-fi
-fi
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
+ MAINT=$MAINTAINER_MODE_TRUE
- fi
- case ${glibcxx_basedir} in
- /* | A-Za-z:\\/*) libgcj_flagbasedir=${glibcxx_basedir} ;;
- *) glibcxx_flagbasedir='$(top_builddir)/'${glibcxx_basedir} ;;
- esac
- # Set up safe default values for all subsequent AM_CONDITIONAL tests.
+ # Set up safe default values for all subsequent AM_CONDITIONAL tests
+ # which are themselves conditionally expanded.
+ ## (Right now, this only matters for enable_wchar_t, but nothing prevents
+ ## other macros from doing the same. This should be automated.) -pme
need_libmath=no
enable_wchar_t=no
- #enable_debug=no
- #glibcxx_pch_comp=no
+ #enable_libstdcxx_debug=no
+ #enable_libstdcxx_pch=no
#enable_cheaders=c
#c_compatibility=no
#enable_abi_check=no
#enable_symvers=no
+ #enable_hosted_libstdcxx=yes
- # Find platform-specific directories containing configuration info. In
- # addition to possibly modifying the same flags, it also sets up symlinks.
-
- . ${glibcxx_basedir}/configure.host
- echo "$ac_t""CPU config directory is $cpu_include_dir" 1>&6
- echo "$ac_t""OS config directory is $os_include_dir" 1>&6
-
-
-
-am__api_version="1.4"
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:1525: checking whether build environment is sane" >&5
-# Just in case
-sleep 1
-echo timestamp > conftestfile
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
- fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" 1>&2; exit 1; }
- fi
-
- test "$2" = conftestfile
- )
-then
- # Ok.
- :
-else
- { echo "configure: error: newly created file is older than distributed files!
-Check your system clock" 1>&2; exit 1; }
-fi
-rm -f conftest*
-echo "$ac_t""yes" 1>&6
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $. echo might interpret backslashes.
- cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
-fi
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1582: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-PACKAGE=$PACKAGE
-
-VERSION=$gcc_version
-
-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
-cat >> confdefs.h <<EOF
-#define PACKAGE "$PACKAGE"
-EOF
-
-cat >> confdefs.h <<EOF
-#define VERSION "$VERSION"
-EOF
-
-
-
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6
-echo "configure:1628: checking for working aclocal-${am__api_version}" >&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-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
- ACLOCAL=aclocal-${am__api_version}
- echo "$ac_t""found" 1>&6
-else
- ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1641: checking for working autoconf" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
- AUTOCONF=autoconf
- echo "$ac_t""found" 1>&6
-else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6
-echo "configure:1654: checking for working automake-${am__api_version}" >&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-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
- AUTOMAKE=automake-${am__api_version}
- echo "$ac_t""found" 1>&6
-else
- AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1667: checking for working autoheader" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
- AUTOHEADER=autoheader
- echo "$ac_t""found" 1>&6
-else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1680: checking for working makeinfo" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
- MAKEINFO=makeinfo
- echo "$ac_t""found" 1>&6
-else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
-fi
-
-
+ # Find platform-specific directories containing configuration info.
+ # Also possibly modify flags used elsewhere, as needed by the platform.
+ . $glibcxx_srcdir/configure.host
+ { echo "$as_me:$LINENO: CPU config directory is $cpu_include_dir" >&5
+echo "$as_me: CPU config directory is $cpu_include_dir" >&6;}
+ { echo "$as_me:$LINENO: OS config directory is $os_include_dir" >&5
+echo "$as_me: OS config directory is $os_include_dir" >&6;}
+#AC_MSG_NOTICE([====== Starting libtool configuration])
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
@@ -1715,8 +3559,7 @@ no) enable_shared=no ;;
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"
@@ -1738,8 +3581,7 @@ no) enable_static=no ;;
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"
@@ -1761,7 +3603,7 @@ no) enable_fast_install=no ;;
esac
else
enable_fast_install=yes
-fi
+fi;
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
@@ -1769,13 +3611,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 "$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:1779: checking for ld used by GCC" >&5
+ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1804,14 +3645,14 @@ echo "configure:1779: 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:1809: 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:1812: 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 '$''{'lt_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-:}"
@@ -1837,15 +3678,19 @@ fi
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:1847: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
@@ -1854,27 +3699,27 @@ else
lt_cv_prog_gnu_ld=no
fi
fi
-
-echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+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_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1864: checking for $LD option to reload object files" >&5
-if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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"
-echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1876: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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.
@@ -1907,12 +3752,13 @@ fi
fi
NM="$lt_cv_path_NM"
-echo "$ac_t""$NM" 1>&6
+echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
-echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1914: checking how to recognise dependant libraries" >&5
-if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5
+echo $ECHO_N "checking how to recognise dependant 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_CMD'
lt_cv_file_magic_test_file=
@@ -2077,34 +3923,14 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
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
-echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:2087: 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:2093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- for ac_file in conftest.*; do
- case $ac_file in
- *.c) ;;
- *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
- esac
- done
-else
- { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-echo "$ac_t""$ac_cv_objext" 1>&6
-OBJEXT=$ac_cv_objext
-ac_objext=$ac_cv_objext
+
+
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
@@ -2112,10 +3938,10 @@ ac_objext=$ac_cv_objext
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:2117: 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
+ 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
/*)
@@ -2167,17 +3993,19 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- echo "$ac_t""$MAGIC_CMD" 1>&6
+ 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_CMD"; then
if test -n "$ac_tool_prefix"; then
- echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:2179: checking for file" >&5
-if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+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_CMD in
/*)
@@ -2229,9 +4057,11 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- echo "$ac_t""$MAGIC_CMD" 1>&6
+ 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
@@ -2243,138 +4073,164 @@ fi
;;
esac
-# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2250: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+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_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
- 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"
+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"
+RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&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_RANLIB"; then
-if test -n "$ac_tool_prefix"; 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2282: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+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_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.
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+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
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+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 "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ RANLIB=$ac_ct_RANLIB
else
- RANLIB=":"
-fi
+ RANLIB="$ac_cv_prog_RANLIB"
fi
-# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2317: 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 $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
- 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
- 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_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"
+STRIP=$ac_cv_prog_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
-
+fi
if test -z "$ac_cv_prog_STRIP"; then
-if test -n "$ac_tool_prefix"; 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2349: 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 $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 "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_STRIP="strip"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+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
-STRIP="$ac_cv_prog_STRIP"
-if test -n "$STRIP"; then
- echo "$ac_t""$STRIP" 1>&6
+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 "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ STRIP=$ac_ct_STRIP
else
- STRIP=":"
-fi
+ STRIP="$ac_cv_prog_STRIP"
fi
@@ -2385,25 +4241,24 @@ test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-libtool_flags="$libtool_flags --enable-dlopen"
+
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
enableval="$enable_libtool_lock"
- :
-fi
+fi;
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
# Check whether --with-pic or --without-pic was given.
if test "${with_pic+set}" = set; then
withval="$with_pic"
pic_mode="$withval"
else
pic_mode=default
-fi
-
+fi;
test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
@@ -2412,8 +4267,12 @@ 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 2416 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 4270 "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*)
@@ -2446,7 +4305,11 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2462,14 +4325,18 @@ 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:2466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -2505,47 +4372,69 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
# 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:2510: 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
+ 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
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
- cat > conftest.$ac_ext <<EOF
-#line 2523 "configure"
-#include "confdefs.h"
+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 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. */
-int main() {
+int
+main ()
+{
-; return 0; }
-EOF
-if { (eval echo configure:2530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- lt_cv_cc_needs_belf=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
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_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 "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+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"
@@ -2555,99 +4444,63 @@ 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:2560: 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
-else
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- CXXCPP="${CXX-g++} -E"
- cat > conftest.$ac_ext <<EOF
-#line 2573 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CXXCPP=/lib/cpp
-fi
-rm -f conftest*
- ac_cv_prog_CXXCPP="$CXXCPP"
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-fi
-fi
-CXXCPP="$ac_cv_prog_CXXCPP"
-echo "$ac_t""$CXXCPP" 1>&6
-
# Save cache, so that ltconfig can load it
-cat > confcache <<\EOF
+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
-
# Actually configure libtool. ac_aux_dir is where install-sh is found.
AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
@@ -2657,15 +4510,26 @@ 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: error: libtool configure failed" >&5
+echo "$as_me: error: libtool configure failed" >&2;}
+ { (exit 1); exit 1; }; }
# Reload cache, that may have been modified by ltconfig
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
@@ -2679,6 +4543,236 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# clobbered by the next message.
exec 5>>./config.log
+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
+ # 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
+ 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
+ :
+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
+
+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
+
LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
@@ -2693,7 +4787,9 @@ 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 \
-|| { echo "configure: error: libtool tag configuration failed" 1>&2; exit 1; }
+|| { { echo "$as_me:$LINENO: error: libtool tag configuration failed" >&5
+echo "$as_me: error: libtool tag configuration failed" >&2;}
+ { (exit 1); exit 1; }; }
CC="$lt_save_CC"
CFLAGS="$lt_save_CFLAGS"
@@ -2701,58 +4797,81 @@ CFLAGS="$lt_save_CFLAGS"
# clobbered by the next message.
exec 5>>./config.log
-
-
-
-
-# Check for support bits and g++ features that don't require linking.
-echo $ac_n "checking for GNU make""... $ac_c" 1>&6
-echo "configure:2715: checking for GNU make" >&5
-if eval "test \"`echo '$''{'_cv_gnu_make_command'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- _cv_gnu_make_command='' ;
- for a in "${MAKE-make}" make gmake gnumake ; do
- if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
- then
- _cv_gnu_make_command=$a ;
- break;
- fi
- done ;
-
-fi
-
-echo "$ac_t""$_cv_gnu_make_command" 1>&6 ;
- if test "x$_cv_gnu_make_command" != "x" ; then
- ifGNUmake='' ;
+
+
+
+#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
+
+# Possibly disable most of the library.
+## XXX Consider skipping unncessary tests altogether in this case, rather
+## than just ignoring the results. Faster /and/ more correct, win win.
+
+ # Check whether --enable-hosted-libstdcxx or --disable-hosted-libstdcxx was given.
+if test "${enable_hosted_libstdcxx+set}" = set; then
+ enableval="$enable_hosted_libstdcxx"
+
+else
+ enable_hosted_libstdcxx=yes
+fi;
+ if test "$enable_hosted_libstdcxx" = no; then
+ { echo "$as_me:$LINENO: Only freestanding libraries will be built" >&5
+echo "$as_me: Only freestanding libraries will be built" >&6;}
+ is_hosted=no
+ hosted_define=0
+ enable_abi_check=no
+ enable_libstdcxx_pch=no
else
- ifGNUmake='#' ;
+ is_hosted=yes
+ hosted_define=1
fi
-
-#GLIBCXX_CHECK_COMPILER_VERSION
- echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
-echo "configure:2741: 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.
+cat >>confdefs.h <<_ACEOF
+#define _GLIBCXX_HOSTED $hosted_define
+_ACEOF
+
+
+
+# Check for support bits and g++ features that don't require linking.
+
+ echo "$as_me:$LINENO: checking for exception model to use" >&5
+echo $ECHO_N "checking for exception model to use... $ECHO_C" >&6
+
+
+ ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
+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
- # Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
+ # Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
if test "${enable_sjlj_exceptions+set}" = set; then
enableval="$enable_sjlj_exceptions"
- :
+
+ case "$enableval" in
+ yes|no|auto) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable sjlj-exceptions" >&5
+echo "$as_me: error: Unknown argument to enable/disable sjlj-exceptions" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
- cat > conftest.$ac_ext << EOF
-#line 2756 "configure"
+ enable_sjlj_exceptions=auto
+fi;
+
+
+ if test $enable_sjlj_exceptions = auto; then
+ # Botheration. Now we've got to detect the exception model. Link tests
+ # against libgcc.a are problematic since we've not been given proper -L
+ # bits for single-tree newlib and libgloss.
+ #
+ # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
+ cat > conftest.$ac_ext << EOF
+#line 4874 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -2761,376 +4880,808 @@ void foo()
bar();
}
EOF
- old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
- if { (eval echo configure:2767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
- fi
- CXXFLAGS="$old_CXXFLAGS"
- rm -f conftest*
-fi
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=-S
+ 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 grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
+ fi
+ CXXFLAGS="$old_CXXFLAGS"
+ rm -f conftest*
+ fi
+
+ # This is a tad weird, for hysterical raisins. We have to map enable/disable
+ # to two different models.
+ case $enable_sjlj_exceptions in
+ yes)
- if test x$enable_sjlj_exceptions = xyes; then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_SJLJ_EXCEPTIONS 1
-EOF
+_ACEOF
- ac_exception_model_name=sjlj
- elif test x$enable_sjlj_exceptions = xno; then
- ac_exception_model_name="call frame"
- else
- { echo "configure: error: unable to detect exception model" 1>&2; exit 1; }
- fi
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ ac_exception_model_name=sjlj
+ ;;
+ no)
+ ac_exception_model_name="call frame"
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: unable to detect exception model" >&5
+echo "$as_me: error: unable to detect exception model" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+ 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
- echo "$ac_t""$ac_exception_model_name" 1>&6
+ echo "$as_me:$LINENO: result: $ac_exception_model_name" >&5
+echo "${ECHO_T}$ac_exception_model_name" >&6
- echo $ac_n "checking for use of libunwind""... $ac_c" 1>&6
-echo "configure:2800: checking for use of libunwind" >&5
- # Check whether --enable-libunwind-exceptions or --disable-libunwind-exceptions was given.
+ 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"
- use_libunwind_exceptions=$enableval
+
+ 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
- use_libunwind_exceptions=no
-fi
+ enable_libunwind_exceptions=no
+fi;
- echo "$ac_t""$use_libunwind_exceptions" 1>&6
- if test x"$use_libunwind_exceptions" = xyes; then
+ 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
-
-# Check whether --enable-libstdcxx_pch or --disable-libstdcxx_pch was given.
+
+
+ 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.
if test "${enable_libstdcxx_pch+set}" = set; then
enableval="$enable_libstdcxx_pch"
- case "${enableval}" in
- yes) enable_libstdcxx_pch=yes ;;
- no) enable_libstdcxx_pch=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable PCH" 1>&2; exit 1; } ;;
- esac
-else
- enable_libstdcxx_pch=yes
-fi
- if test x$enable_libstdcxx_pch = xyes; then
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable libstdcxx-pch must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable libstdcxx-pch must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
- echo $ac_n "checking for compiler that seems to compile .gch files""... $ac_c" 1>&6
-echo "configure:2835: checking for compiler that seems to compile .gch files" >&5
- if test x${pch_comp+set} != xset; then
- if eval "test \"`echo '$''{'pch_comp'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
+ enable_libstdcxx_pch=$is_hosted
+fi;
- cat > conftest.$ac_ext <<EOF
-#line 2850 "configure"
-#include "confdefs.h"
-#include <math.h>
-int main() {
+ echo "$as_me:$LINENO: result: $enable_libstdcxx_pch" >&5
+echo "${ECHO_T}$enable_libstdcxx_pch" >&6
-; return 0; }
-EOF
-if { (eval echo configure:2857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pch_comp=yes
+ if test $enable_libstdcxx_pch = yes; then
+ echo "$as_me:$LINENO: checking for compiler with PCH support" >&5
+echo $ECHO_N "checking for compiler with PCH support... $ECHO_C" >&6
+if test "${glibcxx_cv_prog_CXX_pch+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- pch_comp=no
-fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
-
-fi
- fi
- echo "$ac_t""$pch_comp" 1>&6
+ 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 '#include <math.h>' > conftest.h
+ if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
+ -o conftest.h.gch 1>&5 2>&1 &&
+ echo '#error "pch failed"' > conftest.h &&
+ echo '#include "conftest.h"' > conftest.cc &&
+ $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ;
+ then
+ glibcxx_cv_prog_CXX_pch=yes
+ else
+ glibcxx_cv_prog_CXX_pch=no
+ fi
+ rm -f conftest*
+ 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
- CXXFLAGS="$ac_save_CXXFLAGS"
- fi
- if test x"$enable_libstdcxx_pch" = xyes && test x"$pch_comp" = xno; then
- enable_pch=no
+fi
+echo "$as_me:$LINENO: result: $glibcxx_cv_prog_CXX_pch" >&5
+echo "${ECHO_T}$glibcxx_cv_prog_CXX_pch" >&6
+ enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch
fi
- echo $ac_n "checking for enabled PCH""... $ac_c" 1>&6
-echo "configure:2888: checking for enabled PCH" >&5
- echo "$ac_t""$enable_libstdcxx_pch" 1>&6
-
-
-if test "$enable_libstdcxx_pch" = yes; then
- GLIBCXX_BUILD_PCH_TRUE=
- GLIBCXX_BUILD_PCH_FALSE='#'
-else
- GLIBCXX_BUILD_PCH_TRUE='#'
- GLIBCXX_BUILD_PCH_FALSE=
-fi
- if test "$enable_libstdcxx_pch" = yes; then
- glibcxx_PCHFLAGS="-include bits/stdc++.h"
+ if test $enable_libstdcxx_pch = yes; then
+ glibcxx_PCHFLAGS="-include bits/stdc++.h"
else
- glibcxx_PCHFLAGS=""
+ glibcxx_PCHFLAGS=""
fi
-
-# Enable all the variable C++ runtime options.
+
+# Enable all the variable C++ runtime options.
# NB: C_MBCHAR must come early.
- echo $ac_n "checking for cstdio to use""... $ac_c" 1>&6
-echo "configure:2912: checking for cstdio to use" >&5
- # Check whether --enable-cstdio or --disable-cstdio was given.
+ echo "$as_me:$LINENO: checking for underlying I/O to use" >&5
+echo $ECHO_N "checking for underlying I/O to use... $ECHO_C" >&6
+ # Check whether --enable-cstdio or --disable-cstdio was given.
if test "${enable_cstdio+set}" = set; then
enableval="$enable_cstdio"
- if test x$enable_cstdio = xno; then
- enable_cstdio=stdio
- fi
+
+ case "$enableval" in
+ stdio) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable cstdio" >&5
+echo "$as_me: error: Unknown argument to enable/disable cstdio" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
enable_cstdio=stdio
-fi
+fi;
- enable_cstdio_flag=$enable_cstdio
-
- case x${enable_cstdio_flag} in
- xstdio | x | xno | xnone | xyes)
- # default
+ # Now that libio has been removed, you can have any color you want as long
+ # as it's black. This is one big no-op until other packages are added, but
+ # showing the framework never hurts.
+ case ${enable_cstdio} in
+ stdio)
CSTDIO_H=config/io/c_io_stdio.h
BASIC_FILE_H=config/io/basic_file_stdio.h
BASIC_FILE_CC=config/io/basic_file_stdio.cc
- echo "$ac_t""stdio" 1>&6
- ;;
- *)
- echo "$enable_cstdio is an unknown io package" 1>&2
- exit 1
+ echo "$as_me:$LINENO: result: stdio" >&5
+echo "${ECHO_T}stdio" >&6
;;
esac
FPOS_H=$fpos_include_dir
-
-
-
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2948: checking how to run the C preprocessor" >&5
+
+
+
+
+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
+ # 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
- # 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"
+ 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.
- cat > conftest.$ac_ext <<EOF
-#line 2963 "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:2969: \"$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
+ 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} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 2980 "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:2986: \"$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
+ 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 "$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 2997 "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:3003: \"$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:$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>
+
+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
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ ac_cv_header_stdc=no
fi
rm -f conftest*
+
fi
-rm -f conftest*
+
+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*
- ac_cv_prog_CPP="$CPP"
+
fi
- CPP="$ac_cv_prog_CPP"
+
+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
- ac_cv_prog_CPP="$CPP"
+ 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.* *.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
-echo "$ac_t""$CPP" 1>&6
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
- echo $ac_n "checking for clocale to use""... $ac_c" 1>&6
-echo "configure:3029: checking for clocale to use" >&5
- # Check whether --enable-clocale or --disable-clocale was given.
+
+
+
+
+
+
+
+
+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
+
+
+
+ echo "$as_me:$LINENO: checking for C locale to use" >&5
+echo $ECHO_N "checking for C locale to use... $ECHO_C" >&6
+ # Check whether --enable-clocale or --disable-clocale was given.
if test "${enable_clocale+set}" = set; then
enableval="$enable_clocale"
- if test x$enable_clocale = xno; then
- enable_clocale=no
- fi
+
+ case "$enableval" in
+ generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
+echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
- enable_clocale=no
-fi
+ enable_clocale=auto
+fi;
+ # If they didn't use this option switch, or if they specified --enable
+ # with no specific model, we'll have to look for one. If they
+ # specified --disable (???), do likewise.
+ if test $enable_clocale = no || test $enable_clocale = yes; then
+ enable_clocale=auto
+ fi
+
+ # Either a known package, or "auto"
enable_clocale_flag=$enable_clocale
- if test x$enable_clocale_flag = xno; then
+ # Probe for locale support if no specific model is specified.
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
case x${target_os} in
xlinux* | xgnu*)
- cat > conftest.$ac_ext <<EOF
-#line 3047 "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 <features.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
_GLIBCXX_ok
#endif
-
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "_GLIBCXX_ok" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "_GLIBCXX_ok" >/dev/null 2>&1; then
enable_clocale_flag=gnu
else
- rm -rf conftest*
enable_clocale_flag=generic
fi
rm -f conftest*
- # Test for bugs early in glibc-2.2.x series
- if test x$enable_clocale_flag = xgnu; then
- if test "$cross_compiling" = yes; then
+ # Test for bugs early in glibc-2.2.x series
+ if test x$enable_clocale_flag = xgnu; then
+ if test "$cross_compiling" = yes; then
enable_clocale_flag=generic
else
- cat > conftest.$ac_ext <<EOF
-#line 3073 "configure"
-#include "confdefs.h"
-
- #define _GNU_SOURCE 1
- #include <locale.h>
- #include <string.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- extern __typeof(newlocale) __newlocale;
- extern __typeof(duplocale) __duplocale;
- extern __typeof(strcoll_l) __strcoll_l;
- #endif
- int main()
- {
- const char __one[] = "Äuglein Augmen";
- const char __two[] = "Äuglein";
- int i;
- int j;
- __locale_t loc;
- __locale_t loc_dup;
- loc = __newlocale(1 << LC_ALL, "de_DE", 0);
- loc_dup = __duplocale(loc);
- i = __strcoll_l(__one, __two, loc);
- j = __strcoll_l(__one, __two, loc_dup);
- return 0;
- }
-
-EOF
-if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-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. */
+
+ #define _GNU_SOURCE 1
+ #include <locale.h>
+ #include <string.h>
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ extern __typeof(newlocale) __newlocale;
+ extern __typeof(duplocale) __duplocale;
+ extern __typeof(strcoll_l) __strcoll_l;
+ #endif
+ int main()
+ {
+ const char __one[] = "Äuglein Augmen";
+ const char __two[] = "Äuglein";
+ int i;
+ int j;
+ __locale_t loc;
+ __locale_t loc_dup;
+ loc = __newlocale(1 << LC_ALL, "de_DE", 0);
+ loc_dup = __duplocale(loc);
+ i = __strcoll_l(__one, __two, loc);
+ j = __strcoll_l(__one, __two, loc_dup);
+ return 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
enable_clocale_flag=gnu
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- enable_clocale_flag=generic
+ 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 )
+enable_clocale_flag=generic
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
-
- # ... at some point put __strxfrm_l tests in as well.
+ # ... at some point put __strxfrm_l tests in as well.
;;
*)
- enable_clocale_flag=generic
- ;;
+ enable_clocale_flag=generic
+ ;;
esac
fi
- # Check whether --enable-nls or --disable-nls was given.
+ # Deal with gettext issues. Default to not using it (=no) until we detect
+ # support for it later. Let the user turn it off via --e/d, but let that
+ # default to on for easier handling.
+ USE_NLS=no
+ # Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
- :
+
else
enable_nls=yes
-fi
-
- USE_NLS=no
+fi;
- case x${enable_clocale_flag} in
- xgeneric)
- echo "$ac_t""generic" 1>&6
+ # Set configure bits for specified locale package
+ case ${enable_clocale_flag} in
+ generic)
+ echo "$as_me:$LINENO: result: generic" >&5
+echo "${ECHO_T}generic" >&6
CLOCALE_H=config/locale/generic/c_locale.h
CLOCALE_CC=config/locale/generic/c_locale.cc
@@ -3146,8 +5697,9 @@ fi
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
- xgnu)
- echo "$ac_t""gnu" 1>&6
+ gnu)
+ echo "$as_me:$LINENO: result: gnu" >&5
+echo "${ECHO_T}gnu" >&6
# Declare intention to use gettext, and add support for specific
# languages.
@@ -3157,44 +5709,50 @@ fi
# Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3162: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_check_msgfmt'+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_check_msgfmt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$check_msgfmt"; then
ac_cv_prog_check_msgfmt="$check_msgfmt" # 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_check_msgfmt="yes"
- 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_check_msgfmt="yes"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
fi
fi
-check_msgfmt="$ac_cv_prog_check_msgfmt"
+check_msgfmt=$ac_cv_prog_check_msgfmt
if test -n "$check_msgfmt"; then
- echo "$ac_t""$check_msgfmt" 1>&6
+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
+echo "${ECHO_T}$check_msgfmt" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
- USE_NLS=yes
+ USE_NLS=yes
fi
# Export the build objects.
for ling in $ALL_LINGUAS; do \
glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
done
-
-
+
+
CLOCALE_H=config/locale/gnu/c_locale.h
CLOCALE_CC=config/locale/gnu/c_locale.cc
@@ -3210,8 +5768,9 @@ fi
CTIME_CC=config/locale/gnu/time_members.cc
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;;
- xieee_1003.1-2001)
- echo "$ac_t""IEEE 1003.1" 1>&6
+ ieee_1003.1-2001)
+ echo "$as_me:$LINENO: result: IEEE 1003.1" >&5
+echo "${ECHO_T}IEEE 1003.1" >&6
CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
@@ -3227,1084 +5786,1946 @@ fi
CTIME_CC=config/locale/generic/time_members.cc
CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
;;
- *)
- echo "$enable_clocale is an unknown locale package" 1>&2
- exit 1
- ;;
esac
# This is where the testsuite looks for locale catalogs, using the
# -DLOCALEDIR define during testsuite compilation.
glibcxx_localedir=${glibcxx_builddir}/po/share/locale
-
+
# A standalone libintl (e.g., GNU libintl) may be in use.
if test $USE_NLS = yes; then
- for ac_hdr in libintl.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3248: 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 3253 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3258: \"$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"
+
+for ac_header in libintl.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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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 `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
else
- echo "$ac_t""no" 1>&6
-USE_NLS=no
+ USE_NLS=no
fi
+
done
-
-echo $ac_n "checking for library containing gettext""... $ac_c" 1>&6
-echo "configure:3287: checking for library containing gettext" >&5
-if eval "test \"`echo '$''{'ac_cv_search_gettext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_func_search_save_LIBS="$LIBS"
-ac_cv_search_gettext="no"
-cat > conftest.$ac_ext <<EOF
-#line 3294 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for library containing gettext" >&5
+echo $ECHO_N "checking for library containing gettext... $ECHO_C" >&6
+if test "${ac_cv_search_gettext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_gettext=no
+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. */
+
/* 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 gettext();
-
-int main() {
-gettext()
-; return 0; }
-EOF
-if { (eval echo configure:3305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ builtin and then its argument prototype would still apply. */
+char gettext ();
+int
+main ()
+{
+gettext ();
+ ;
+ 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_gettext="none required"
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*
-test "$ac_cv_search_gettext" = "no" && for i in intl; do
-LIBS="-l$i $ac_func_search_save_LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3316 "configure"
-#include "confdefs.h"
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_gettext" = no; then
+ for ac_lib in intl; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ 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. */
+
/* 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 gettext();
-
-int main() {
-gettext()
-; return 0; }
-EOF
-if { (eval echo configure:3327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ac_cv_search_gettext="-l$i"
+ builtin and then its argument prototype would still apply. */
+char gettext ();
+int
+main ()
+{
+gettext ();
+ ;
+ 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_gettext="-l$ac_lib"
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*
-done
-LIBS="$ac_func_search_save_LIBS"
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
fi
-
-echo "$ac_t""$ac_cv_search_gettext" 1>&6
-if test "$ac_cv_search_gettext" != "no"; then
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_gettext" >&5
+echo "${ECHO_T}$ac_cv_search_gettext" >&6
+if test "$ac_cv_search_gettext" != no; then
test "$ac_cv_search_gettext" = "none required" || LIBS="$ac_cv_search_gettext $LIBS"
-
-else :
+
+else
USE_NLS=no
fi
+
fi
if test $USE_NLS = yes; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_NLS 1
-EOF
+_ACEOF
fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-echo $ac_n "checking for c header strategy to use""... $ac_c" 1>&6
-echo "configure:3371: checking for c header strategy to use" >&5
-# Check whether --enable-cheaders or --disable-cheaders was given.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-cheaders or --disable-cheaders was given.
if test "${enable_cheaders+set}" = set; then
enableval="$enable_cheaders"
-
- case "$enableval" in
- c)
- enable_cheaders=c
- ;;
- c_std)
- enable_cheaders=c_std
- ;;
- *) { echo "configure: error: Unknown argument to enable/disable "C" headers" 1>&2; exit 1; }
- ;;
- esac
+
+ case "$enableval" in
+ c|c_std) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable cheaders" >&5
+echo "$as_me: error: Unknown argument to enable/disable cheaders" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
- enable_cheaders=c_std
-fi
+ enable_cheaders=$c_model
+fi;
- echo "$ac_t""$enable_cheaders" 1>&6
+ { echo "$as_me:$LINENO: \"C\" header strategy set to $enable_cheaders" >&5
+echo "$as_me: \"C\" header strategy set to $enable_cheaders" >&6;}
- case "$enable_cheaders" in
- c_std)
- C_INCLUDE_DIR='${glibcxx_srcdir}/include/c_std'
- ;;
- c)
- C_INCLUDE_DIR='${glibcxx_srcdir}/include/c'
- ;;
- esac
+ C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders
-
-
-if test "$enable_cheaders" = c; then
- GLIBCXX_C_HEADERS_C_TRUE=
- GLIBCXX_C_HEADERS_C_FALSE='#'
-else
- GLIBCXX_C_HEADERS_C_TRUE='#'
- GLIBCXX_C_HEADERS_C_FALSE=
-fi
-
-if test "$enable_cheaders" = c_std; then
- GLIBCXX_C_HEADERS_C_STD_TRUE=
- GLIBCXX_C_HEADERS_C_STD_FALSE='#'
-else
- GLIBCXX_C_HEADERS_C_STD_TRUE='#'
- GLIBCXX_C_HEADERS_C_STD_FALSE=
-fi
-
-if test "$c_compatibility" = yes; then
- GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE=
- GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE='#'
-else
- GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE='#'
- GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE=
-fi
-# Check whether --enable-c-mbchar or --disable-c-mbchar was given.
+
+ # Check whether --enable-c-mbchar or --disable-c-mbchar was given.
if test "${enable_c_mbchar+set}" = set; then
enableval="$enable_c_mbchar"
- case "$enableval" in
- yes) enable_c_mbchar=yes ;;
- no) enable_c_mbchar=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable c-mbchar" 1>&2; exit 1; } ;;
- esac
+
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable c-mbchar must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable c-mbchar must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
enable_c_mbchar=yes
-fi
+fi;
+
+ # Option parsed, now other scripts can test enable_c_mbchar for yes/no.
+
-
- # Check whether --enable-c99 or --disable-c99 was given.
+
+ # Check whether --enable-c99 or --disable-c99 was given.
if test "${enable_c99+set}" = set; then
enableval="$enable_c99"
- case "$enableval" in
- yes) enable_c99=yes ;;
- no) enable_c99=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable C99" 1>&2; exit 1; } ;;
- esac
+
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable c99 must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable c99 must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
enable_c99=yes
-fi
+fi;
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+
+
+
+ ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
+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
# Check for the existence of <math.h> functions used if C99 is enabled.
ac_c99_math=yes;
- echo $ac_n "checking for ISO C99 support in <math.h>""... $ac_c" 1>&6
-echo "configure:3467: checking for ISO C99 support in <math.h>" >&5
- cat > conftest.$ac_ext <<EOF
-#line 3469 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for ISO C99 support in <math.h>" >&5
+echo $ECHO_N "checking for ISO C99 support in <math.h>... $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 <math.h>
-int main() {
+int
+main ()
+{
fpclassify(0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3486 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isfinite(0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3503 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isinf(0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3520 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isnan(0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3537 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isnormal(0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3554 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
signbit(0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3571 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isgreater(0.0,0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3588 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isgreaterequal(0.0,0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3605 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isless(0.0,0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3622 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
islessequal(0.0,0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3639 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
islessgreater(0.0,0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3656 "configure"
-#include "confdefs.h"
+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
isunordered(0.0,0.0);
-; return 0; }
-EOF
-if { (eval echo configure:3663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_math=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_math=no
fi
-rm -f conftest*
- echo "$ac_t""$ac_c99_math" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_c99_math" >&5
+echo "${ECHO_T}$ac_c99_math" >&6
# Check for the existence in <stdio.h> of vscanf, et. al.
ac_c99_stdio=yes;
- echo $ac_n "checking for ISO C99 support in <stdio.h>""... $ac_c" 1>&6
-echo "configure:3677: checking for ISO C99 support in <stdio.h>" >&5
- cat > conftest.$ac_ext <<EOF
-#line 3679 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for ISO C99 support in <stdio.h>" >&5
+echo $ECHO_N "checking for ISO C99 support in <stdio.h>... $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 <stdio.h>
-int main() {
+int
+main ()
+{
snprintf("12", 0, "%i");
-; return 0; }
-EOF
-if { (eval echo configure:3686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdio=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdio=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3696 "configure"
-#include "confdefs.h"
+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. */
#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vfscanf(stderr, "%i", args);}
-int main() {
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vfscanf(stderr, "%i", args);}
+int
+main ()
+{
-; return 0; }
-EOF
-if { (eval echo configure:3707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdio=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdio=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3717 "configure"
-#include "confdefs.h"
+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. */
#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vscanf("%i", args);}
-int main() {
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vscanf("%i", args);}
+int
+main ()
+{
-; return 0; }
-EOF
-if { (eval echo configure:3728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdio=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdio=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3738 "configure"
-#include "confdefs.h"
+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. */
#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsnprintf(fmt, 0, "%i", args);}
-int main() {
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsnprintf(fmt, 0, "%i", args);}
+int
+main ()
+{
-; return 0; }
-EOF
-if { (eval echo configure:3749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdio=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdio=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3759 "configure"
-#include "confdefs.h"
+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. */
#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsscanf(fmt, "%i", args);}
-int main() {
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsscanf(fmt, "%i", args);}
+int
+main ()
+{
-; return 0; }
-EOF
-if { (eval echo configure:3770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdio=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdio=no
fi
-rm -f conftest*
- echo "$ac_t""$ac_c99_stdio" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_c99_stdio" >&5
+echo "${ECHO_T}$ac_c99_stdio" >&6
# Check for the existence in <stdlib.h> of lldiv_t, et. al.
ac_c99_stdlib=yes;
- echo $ac_n "checking for lldiv_t declaration""... $ac_c" 1>&6
-echo "configure:3784: checking for lldiv_t declaration" >&5
- if eval "test \"`echo '$''{'ac_c99_lldiv_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3790 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for lldiv_t declaration" >&5
+echo $ECHO_N "checking for lldiv_t declaration... $ECHO_C" >&6
+ if test "${ac_c99_lldiv_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. */
#include <stdlib.h>
-int main() {
+int
+main ()
+{
lldiv_t mydivt;
-; return 0; }
-EOF
-if { (eval echo configure:3797: \"$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_c99_lldiv_t=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_lldiv_t=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_lldiv_t=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest.$ac_ext
+
fi
- echo "$ac_t""$ac_c99_lldiv_t" 1>&6
+ echo "$as_me:$LINENO: result: $ac_c99_lldiv_t" >&5
+echo "${ECHO_T}$ac_c99_lldiv_t" >&6
- echo $ac_n "checking for ISO C99 support in <stdlib.h>""... $ac_c" 1>&6
-echo "configure:3813: checking for ISO C99 support in <stdlib.h>" >&5
- cat > conftest.$ac_ext <<EOF
-#line 3815 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for ISO C99 support in <stdlib.h>" >&5
+echo $ECHO_N "checking for ISO C99 support in <stdlib.h>... $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 <stdlib.h>
-int main() {
+int
+main ()
+{
char* tmp; strtof("gnu", &tmp);
-; return 0; }
-EOF
-if { (eval echo configure:3822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdlib=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdlib=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3832 "configure"
-#include "confdefs.h"
+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. */
#include <stdlib.h>
-int main() {
+int
+main ()
+{
char* tmp; strtold("gnu", &tmp);
-; return 0; }
-EOF
-if { (eval echo configure:3839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdlib=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdlib=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3849 "configure"
-#include "confdefs.h"
+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. */
#include <stdlib.h>
-int main() {
+int
+main ()
+{
llabs(10);
-; return 0; }
-EOF
-if { (eval echo configure:3856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdlib=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdlib=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3866 "configure"
-#include "confdefs.h"
+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. */
#include <stdlib.h>
-int main() {
+int
+main ()
+{
lldiv(10,1);
-; return 0; }
-EOF
-if { (eval echo configure:3873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdlib=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdlib=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3883 "configure"
-#include "confdefs.h"
+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. */
#include <stdlib.h>
-int main() {
+int
+main ()
+{
atoll("10");
-; return 0; }
-EOF
-if { (eval echo configure:3890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdlib=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdlib=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3900 "configure"
-#include "confdefs.h"
+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. */
#include <stdlib.h>
-int main() {
+int
+main ()
+{
_Exit(0);
-; return 0; }
-EOF
-if { (eval echo configure:3907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_stdlib=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_stdlib=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test x"$ac_c99_lldiv_t" = x"no"; then
ac_c99_stdlib=no;
fi;
- echo "$ac_t""$ac_c99_stdlib" 1>&6
+ echo "$as_me:$LINENO: result: $ac_c99_stdlib" >&5
+echo "${ECHO_T}$ac_c99_stdlib" >&6
# Check for the existence of <wchar.h> functions used if C99 is enabled.
# XXX the wchar.h checks should be rolled into the general C99 bits.
ac_c99_wchar=yes;
- echo $ac_n "checking for additional ISO C99 support in <wchar.h>""... $ac_c" 1>&6
-echo "configure:3925: checking for additional ISO C99 support in <wchar.h>" >&5
- cat > conftest.$ac_ext <<EOF
-#line 3927 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for additional ISO C99 support in <wchar.h>" >&5
+echo $ECHO_N "checking for additional ISO C99 support in <wchar.h>... $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 <wchar.h>
-int main() {
+int
+main ()
+{
wcstold(L"10.0", NULL);
-; return 0; }
-EOF
-if { (eval echo configure:3934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_wchar=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_wchar=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3944 "configure"
-#include "confdefs.h"
+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. */
#include <wchar.h>
-int main() {
+int
+main ()
+{
wcstoll(L"10", NULL, 10);
-; return 0; }
-EOF
-if { (eval echo configure:3951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_wchar=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_wchar=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 3961 "configure"
-#include "confdefs.h"
+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. */
#include <wchar.h>
-int main() {
+int
+main ()
+{
wcstoull(L"10", NULL, 10);
-; return 0; }
-EOF
-if { (eval echo configure:3968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_c99_wchar=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_wchar=no
fi
-rm -f conftest*
- echo "$ac_t""$ac_c99_wchar" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_c99_wchar" >&5
+echo "${ECHO_T}$ac_c99_wchar" >&6
- echo $ac_n "checking for enabled ISO C99 support""... $ac_c" 1>&6
-echo "configure:3980: checking for enabled ISO C99 support" >&5
+ echo "$as_me:$LINENO: checking for enabled ISO C99 support" >&5
+echo $ECHO_N "checking for enabled ISO C99 support... $ECHO_C" >&6
if test x"$ac_c99_math" = x"no" ||
test x"$ac_c99_stdio" = x"no" ||
test x"$ac_c99_stdlib" = x"no" ||
test x"$ac_c99_wchar" = x"no"; then
enable_c99=no;
fi;
- echo "$ac_t""$enable_c99" 1>&6
+ echo "$as_me:$LINENO: result: $enable_c99" >&5
+echo "${ECHO_T}$enable_c99" >&6
# Option parsed, now set things appropriately
if test x"$enable_c99" = x"yes"; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_C99 1
-EOF
+_ACEOF
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_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
-
- # Check whether --enable-long-long or --disable-long-long was given.
+
+ # Check whether --enable-long-long or --disable-long-long was given.
if test "${enable_long_long+set}" = set; then
enableval="$enable_long_long"
- case "$enableval" in
- yes) enable_long_long=yes ;;
- no) enable_long_long=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable long long" 1>&2; exit 1; } ;;
- esac
+
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable long-long must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable long-long must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
enable_long_long=yes
-fi
+fi;
+
+
+
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
+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 $ac_n "checking for enabled long long I/O support""... $ac_c" 1>&6
-echo "configure:4028: checking for enabled long long I/O support" >&5
+ echo "$as_me:$LINENO: checking for enabled long long I/O support" >&5
+echo $ECHO_N "checking for enabled long long I/O support... $ECHO_C" >&6
# iostreams require strtoll, strtoull to compile
- cat > conftest.$ac_ext <<EOF
-#line 4031 "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>
-int main() {
+int
+main ()
+{
char* tmp; strtoll("gnu", &tmp, 10);
-; return 0; }
-EOF
-if { (eval echo configure:4038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- enable_long_long=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+enable_long_long=no
fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 4048 "configure"
-#include "confdefs.h"
+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. */
#include <stdlib.h>
-int main() {
+int
+main ()
+{
char* tmp; strtoull("gnu", &tmp, 10);
-; return 0; }
-EOF
-if { (eval echo configure:4055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- enable_long_long=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+enable_long_long=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
# Option parsed, now set things appropriately
- if test x"$enable_long_long" = xyes; then
- cat >> confdefs.h <<\EOF
+ if test $enable_long_long = yes; then
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_LONG_LONG 1
-EOF
+_ACEOF
fi
- echo "$ac_t""$enable_long_long" 1>&6
+ echo "$as_me:$LINENO: result: $enable_long_long" >&5
+echo "${ECHO_T}$enable_long_long" >&6
ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+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 thread model used by GCC""... $ac_c" 1>&6
-echo "configure:4084: checking for thread model used by GCC" >&5
- target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
- echo "$ac_t""$target_thread_file" 1>&6
+ echo "$as_me:$LINENO: checking for thread model used by GCC" >&5
+echo $ECHO_N "checking for thread model used by GCC... $ECHO_C" >&6
+ target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
+ echo "$as_me:$LINENO: result: $target_thread_file" >&5
+echo "${ECHO_T}$target_thread_file" >&6
if test $target_thread_file != single; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_GTHR_DEFAULT 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_SUPPORTS_WEAK __GXX_WEAK__
-EOF
+_ACEOF
fi
glibcxx_thread_h=gthr-$target_thread_file.h
-
-# Check whether --enable-concept-checks or --disable-concept-checks was given.
+
+
+ # Check whether --enable-concept-checks or --disable-concept-checks was given.
if test "${enable_concept_checks+set}" = set; then
enableval="$enable_concept_checks"
- case "$enableval" in
- yes) enable_concept_checks=yes ;;
- no) enable_concept_checks=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable concept checks" 1>&2; exit 1; } ;;
- esac
+
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable concept-checks must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable concept-checks must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
enable_concept_checks=no
-fi
-if test x"$enable_concept_checks" = xyes; then
- cat >> confdefs.h <<\EOF
+fi;
+
+ if test $enable_concept_checks = yes; then
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_CONCEPT_CHECKS 1
-EOF
+_ACEOF
-fi
+ fi
-echo $ac_n "checking for extra compiler flags for building""... $ac_c" 1>&6
-echo "configure:4121: checking for extra compiler flags for building" >&5
-# Check whether --enable-cxx_flags or --disable-cxx_flags was given.
-if test "${enable_cxx_flags+set}" = set; then
- enableval="$enable_cxx_flags"
- case "x$enable_cxx_flags" in
- xyes)
- { echo "configure: error: --enable-cxx-flags needs compiler flags as arguments" 1>&2; exit 1; } ;;
- xno | xnone | x)
- enable_cxx_flags='' ;;
- *)
- enable_cxx_flags="$enableval" ;;
-esac
+
+ # Check whether --enable-libstdcxx-debug-flags or --disable-libstdcxx-debug-flags was given.
+if test "${enable_libstdcxx_debug_flags+set}" = set; then
+ enableval="$enable_libstdcxx_debug_flags"
+ case "x$enable_libstdcxx_debug_flags" in
+ xno | x) enable_libstdcxx_debug_flags= ;;
+ x-*) ;;
+ *) { { echo "$as_me:$LINENO: error: --enable-libstdcxx-debug-flags needs compiler flags as arguments" >&5
+echo "$as_me: error: --enable-libstdcxx-debug-flags needs compiler flags as arguments" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
else
- enable_cxx_flags=
-fi
+ enable_libstdcxx_debug_flags="-g3 -O0"
+fi;
-if test -n "$enable_cxx_flags"; then
- for f in $enable_cxx_flags; do
- case "$f" in
- -fhonor-std) ;;
- -*) ;;
- *) # and we're trying to pass /what/ exactly?
- { echo "configure: error: compiler flags start with a -" 1>&2; exit 1; } ;;
- esac
- done
-fi
-EXTRA_CXX_FLAGS="$enable_cxx_flags"
-echo "$ac_t""$EXTRA_CXX_FLAGS" 1>&6
+ # Option parsed, now set things appropriately
+ DEBUG_FLAGS="$enable_libstdcxx_debug_flags"
+
+ { echo "$as_me:$LINENO: Debug build flags set to $DEBUG_FLAGS" >&5
+echo "$as_me: Debug build flags set to $DEBUG_FLAGS" >&6;}
-# Check whether --enable-libstdcxx_debug or --disable-libstdcxx_debug was given.
+
+ echo "$as_me:$LINENO: checking for additional debug build" >&5
+echo $ECHO_N "checking for additional debug build... $ECHO_C" >&6
+ # Check whether --enable-libstdcxx-debug or --disable-libstdcxx-debug was given.
if test "${enable_libstdcxx_debug+set}" = set; then
enableval="$enable_libstdcxx_debug"
- case "${enableval}" in
- yes) enable_libstdcxx_debug=yes ;;
- no) enable_libstdcxx_debug=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable extra debugging" 1>&2; exit 1; } ;;
- esac
+
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable libstdcxx-debug must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable libstdcxx-debug must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
enable_libstdcxx_debug=no
-fi
-echo $ac_n "checking for additional debug build""... $ac_c" 1>&6
-echo "configure:4164: checking for additional debug build" >&5
-echo "$ac_t""$enable_libstdcxx_debug" 1>&6
+fi;
+ echo "$as_me:$LINENO: result: $enable_libstdcxx_debug" >&5
+echo "${ECHO_T}$enable_libstdcxx_debug" >&6
-if test "$enable_libstdcxx_debug" = yes; then
- GLIBCXX_BUILD_DEBUG_TRUE=
- GLIBCXX_BUILD_DEBUG_FALSE='#'
-else
- GLIBCXX_BUILD_DEBUG_TRUE='#'
- GLIBCXX_BUILD_DEBUG_FALSE=
-fi
-# Check whether --enable-libstdcxx_debug_flags or --disable-libstdcxx_debug_flags was given.
-if test "${enable_libstdcxx_debug_flags+set}" = set; then
- enableval="$enable_libstdcxx_debug_flags"
- case "${enableval}" in
- none) ;;
- -*) enable_libstdcxx_debug_flags="${enableval}" ;;
- *) { echo "configure: error: Unknown argument to extra debugging flags" 1>&2; exit 1; } ;;
- esac
+ echo "$as_me:$LINENO: checking for extra compiler flags for building" >&5
+echo $ECHO_N "checking for extra compiler flags for building... $ECHO_C" >&6
+ # Check whether --enable-cxx-flags or --disable-cxx-flags was given.
+if test "${enable_cxx_flags+set}" = set; then
+ enableval="$enable_cxx_flags"
+ case "x$enable_cxx_flags" in
+ xno | x) enable_cxx_flags= ;;
+ x-*) ;;
+ *) { { echo "$as_me:$LINENO: error: --enable-cxx-flags needs compiler flags as arguments" >&5
+echo "$as_me: error: --enable-cxx-flags needs compiler flags as arguments" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
else
- enable_libstdcxx_debug_flags=none
-fi
-
-case x"$enable_libstdcxx_debug" in
- xyes)
- case "$enable_libstdcxx_debug_flags" in
- none)
- DEBUG_FLAGS="-g3 -O0";;
- -*) #valid input
- DEBUG_FLAGS="${enableval}"
- esac
- ;;
- xno)
- DEBUG_FLAGS=""
- ;;
-esac
+ enable_cxx_flags=
+fi;
+
+
+ # Run through flags (either default or command-line) and set anything
+ # extra (e.g., #defines) that must accompany particular g++ options.
+ if test -n "$enable_cxx_flags"; then
+ for f in $enable_cxx_flags; do
+ case "$f" in
+ -fhonor-std) ;;
+ -*) ;;
+ *) # and we're trying to pass /what/ exactly?
+ { { echo "$as_me:$LINENO: error: compiler flags start with a -" >&5
+echo "$as_me: error: compiler flags start with a -" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ done
+ fi
+ EXTRA_CXX_FLAGS="$enable_cxx_flags"
+ echo "$as_me:$LINENO: result: $EXTRA_CXX_FLAGS" >&5
+echo "${ECHO_T}$EXTRA_CXX_FLAGS" >&6
-echo $ac_n "checking for debug build flags""... $ac_c" 1>&6
-echo "configure:4204: checking for debug build flags" >&5
-echo "$ac_t""$DEBUG_FLAGS" 1>&6
# No surprises, no surprises...
-if test $ATOMICITYH = cpu/generic ; then
- echo "configure: warning: No native atomic operations are provided for this platform." 1>&2
+if test $atomicity_include_dir = cpu/generic ; then
+ { echo "$as_me:$LINENO: WARNING: No native atomic operations are provided for this platform." >&5
+echo "$as_me: WARNING: No native atomic operations are provided for this platform." >&2;}
if test $target_thread_file = single; then
- echo "configure: warning: They cannot be faked when thread support is disabled." 1>&2
- echo "configure: warning: Thread-safety of certain classes is not guaranteed." 1>&2
+ { echo "$as_me:$LINENO: WARNING: They cannot be faked when thread support is disabled." >&5
+echo "$as_me: WARNING: They cannot be faked when thread support is disabled." >&2;}
+ { echo "$as_me:$LINENO: WARNING: Thread-safety of certain classes is not guaranteed." >&5
+echo "$as_me: WARNING: Thread-safety of certain classes is not guaranteed." >&2;}
else
- echo "configure: warning: They will be faked using a mutex." 1>&2
- echo "configure: warning: Performance of certain classes will degrade as a result." 1>&2
+ { echo "$as_me:$LINENO: WARNING: They will be faked using a mutex." >&5
+echo "$as_me: WARNING: They will be faked using a mutex." >&2;}
+ { echo "$as_me:$LINENO: WARNING: Performance of certain classes will degrade as a result." >&5
+echo "$as_me: WARNING: Performance of certain classes will degrade as a result." >&2;}
fi
fi
-if test x"$build" != x"$host"; then
+if $GLIBCXX_IS_NATIVE; then
- # We are being configured with some form of cross compiler.
- GLIBCXX_IS_CROSS_COMPILING=true
+ # We can do more elaborate tests that assume a working linker.
+ CANADIAN=no
- # This lets us hard-code the functionality we know we'll have in the cross
- # target environment. "Let" is a sugar-coated word placed on an especially
- # dull and tedious hack, actually.
- #
- # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros
- # that involve linking, can't be used:
- # "cannot open sim-crt0.o"
- # "cannot open crt0.o"
- # etc. All this is because there currently exists no unified, consistent
- # way for top level CC information to be passed down to target directories:
- # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
- # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
- # crosses can be removed.
+ # Check for available headers.
- # If Canadian cross, then don't pick up tools from the build directory.
- # Used in GLIBCXX_EXPORT_INCLUDES (and nowhere else?).
- if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host" \
- && test x"$build" != x"$target"; then
- CANADIAN=yes
- else
- CANADIAN=no
- fi
- # Construct crosses by hand, eliminating bits that need ld...
- # GLIBCXX_CHECK_COMPILER_FEATURES
- # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
- # GLIBCXX_CHECK_MATH_SUPPORT
- case "${host}" in
- *-freebsd*)
- os_include_dir="os/bsd/freebsd"
- for ac_hdr in 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 sys/resource.h sys/stat.h \
- sys/time.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:4264: 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 4269 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4274: \"$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"
+
+
+
+
+
+
+
+
+
+
+for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
+ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
+ sys/types.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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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
+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
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
-
-
+
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # The CXXFLAGS thing is suspicious, but based on similar bits previously
+ # found in GLIBCXX_CONFIGURE.
+
+
+ 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_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+
+ # Check for maintainer-mode bits.
+ if test x"$USE_MAINTAINER_MODE" = xno; then
+ WERROR=''
+ else
+ WERROR='-Werror'
+ fi
+
+ # Check for -ffunction-sections -fdata-sections
+ echo "$as_me:$LINENO: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
+echo $ECHO_N "checking for g++ that supports -ffunction-sections -fdata-sections... $ECHO_C" >&6
+ CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
+ 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 ()
+{
+int foo;
+ ;
+ 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_fdsections=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_fdsections=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ else
+ # this is the suspicious part
+ CXXFLAGS=''
+ fi
+ if test x"$ac_fdsections" = x"yes"; then
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ fi
+ echo "$as_me:$LINENO: result: $ac_fdsections" >&5
+echo "${ECHO_T}$ac_fdsections" >&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
+
+
+
+
+
# If we're not using GNU ld, then there's no point in even trying these
# tests. Check for that first. We should have already tested for gld
# by now (in libtool), but require it now just to be safe...
test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
+
+
# The name set by libtool depends on the version of libtool. Shame on us
# for depending on an impl detail, but c'est la vie. Older versions used
@@ -4323,10 +7744,10 @@ done
# Start by getting the version number. I think the libtool test already
# does some of this, but throws away the result.
-
+
ldver=`$LD --version 2>/dev/null | head -1 | \
sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-
+
glibcxx_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -4341,20 +7762,24 @@ done
CFLAGS='-x c++ -Wl,--gc-sections'
# Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
- echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:4352: checking for ld that supports -Wl,--gc-sections" >&5
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
+ echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
+echo $ECHO_N "checking for ld that supports -Wl,--gc-sections... $ECHO_C" >&6
if test "$cross_compiling" = yes; then
ac_sectionLDflags=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 4357 "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. */
int main(void)
{
@@ -4362,20 +7787,30 @@ else
catch (...) { };
return 0;
}
-
-EOF
-if { (eval echo configure:4368: \"$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_sectionLDflags=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_sectionLDflags=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_sectionLDflags=no
fi
-rm -fr conftest*
+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"
else
@@ -4385,7 +7820,8 @@ fi
if test "$ac_sectionLDflags" = "yes"; then
SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
fi
- echo "$ac_t""$ac_sectionLDflags" 1>&6
+ echo "$as_me:$LINENO: result: $ac_sectionLDflags" >&5
+echo "${ECHO_T}$ac_sectionLDflags" >&6
fi
# Set linker optimization flags.
@@ -4393,6130 +7829,19803 @@ fi
OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi
-
-
-
- echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:4402: checking for main in -lm" >&5
-ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+
+
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
+
+ echo "$as_me:$LINENO: checking for sin in -lm" >&5
+echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_sin+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4410 "configure"
-#include "confdefs.h"
+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. */
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:4417: \"$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"
+/* 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 sin ();
+int
+main ()
+{
+sin ();
+ ;
+ 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_m_sin=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_sin=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_m_sin" >&5
+echo "${ECHO_T}$ac_cv_lib_m_sin" >&6
+if test $ac_cv_lib_m_sin = yes; then
+ libm="-lm"
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
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libm"
+
+
+
+ echo "$as_me:$LINENO: checking for isinf declaration" >&5
+echo $ECHO_N "checking for isinf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_isinf_use+set} != xset; then
+ if test "${glibcxx_cv_func_isinf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- LIBS="-lm $LIBS"
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ isinf(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
+ glibcxx_cv_func_isinf_use=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isinf_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
- for ac_func in nan copysignf
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isinf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isinf_use" >&6
+
+ if test x$glibcxx_cv_func_isinf_use = x"yes"; then
+
+for ac_func in isinf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4447: 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 4452 "configure"
-#include "confdefs.h"
+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. */
-#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:4475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _isinf declaration" >&5
+echo $ECHO_N "checking for _isinf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__isinf_use+set} != xset; then
+ if test "${glibcxx_cv_func__isinf_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _isinf(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
+ glibcxx_cv_func__isinf_use=yes
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isinf_use=no
fi
-done
+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__isinf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isinf_use" >&6
+
+ if test x$glibcxx_cv_func__isinf_use = x"yes"; then
- for ac_func in __signbit
+for ac_func in _isinf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4504: 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 4509 "configure"
-#include "confdefs.h"
+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. */
-#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:4532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for isnan declaration" >&5
+echo $ECHO_N "checking for isnan declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_isnan_use+set} != xset; then
+ if test "${glibcxx_cv_func_isnan_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ isnan(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
+ glibcxx_cv_func_isnan_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isnan_use=no
fi
-done
+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_isnan_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isnan_use" >&6
+
+ if test x$glibcxx_cv_func_isnan_use = x"yes"; then
- for ac_func in __signbitf
+for ac_func in isnan
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4560: 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 4565 "configure"
-#include "confdefs.h"
+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. */
-#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:4588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _isnan declaration" >&5
+echo $ECHO_N "checking for _isnan declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__isnan_use+set} != xset; then
+ if test "${glibcxx_cv_func__isnan_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _isnan(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
+ glibcxx_cv_func__isnan_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isnan_use=no
fi
-done
+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
- if test x$ac_cv_func_copysignl = x"yes"; then
- for ac_func in __signbitl
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isnan_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isnan_use" >&6
+
+ if test x$glibcxx_cv_func__isnan_use = x"yes"; then
+
+for ac_func in _isnan
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4618: 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 4623 "configure"
-#include "confdefs.h"
+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. */
-#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:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
-LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
fi
done
+ fi
fi
- if test -n "$LIBMATHOBJS"; then
- need_libmath=yes
- fi
-
-
-
- echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:4681: checking for mbstate_t" >&5
- cat > conftest.$ac_ext <<EOF
-#line 4683 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-mbstate_t teststate;
-; return 0; }
-EOF
-if { (eval echo configure:4690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- have_mbstate_t=yes
+
+ echo "$as_me:$LINENO: checking for finite declaration" >&5
+echo $ECHO_N "checking for finite declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_finite_use+set} != xset; then
+ if test "${glibcxx_cv_func_finite_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- have_mbstate_t=no
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ finite(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
+ glibcxx_cv_func_finite_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_finite_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
-rm -f conftest*
- echo "$ac_t""$have_mbstate_t" 1>&6
- if test x"$have_mbstate_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MBSTATE_T 1
-EOF
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_finite_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_finite_use" >&6
- for ac_hdr in wchar.h
+ if test x$glibcxx_cv_func_finite_use = x"yes"; then
+
+for ac_func in finite
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4712: 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
+ 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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _finite declaration" >&5
+echo $ECHO_N "checking for _finite declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__finite_use+set} != xset; then
+ if test "${glibcxx_cv_func__finite_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 4717 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4722: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _finite(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
+ glibcxx_cv_func__finite_use=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
+
+glibcxx_cv_func__finite_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wchar_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wchar_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__finite_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__finite_use" >&6
+
+ if test x$glibcxx_cv_func__finite_use = x"yes"; then
+
+for ac_func in _finite
+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
- for ac_hdr in wctype.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4753: 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
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for copysign declaration" >&5
+echo $ECHO_N "checking for copysign declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_copysign_use+set} != xset; then
+ if test "${glibcxx_cv_func_copysign_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 4758 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4763: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ copysign(0, 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
+ glibcxx_cv_func_copysign_use=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
+
+glibcxx_cv_func_copysign_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wctype_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wctype_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_copysign_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_copysign_use" >&6
+
+ if test x$glibcxx_cv_func_copysign_use = x"yes"; then
+
+for ac_func in copysign
+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
+ else
- if test x"$ac_has_wchar_h" = xyes &&
- test x"$ac_has_wctype_h" = xyes &&
- test x"$enable_c_mbchar" != xno; then
+ echo "$as_me:$LINENO: checking for _copysign declaration" >&5
+echo $ECHO_N "checking for _copysign declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__copysign_use+set} != xset; then
+ if test "${glibcxx_cv_func__copysign_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:4796: checking for WCHAR_MIN and WCHAR_MAX" >&5
- cat > conftest.$ac_ext <<EOF
-#line 4798 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-int i = WCHAR_MIN; int j = WCHAR_MAX;
-; return 0; }
-EOF
-if { (eval echo configure:4805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_wchar_minmax=yes
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _copysign(0, 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
+ glibcxx_cv_func__copysign_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_wchar_minmax=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__copysign_use=no
fi
-rm -f conftest*
- echo "$ac_t""$has_wchar_minmax" 1>&6
+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
- echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:4818: checking for WEOF" >&5
- cat > conftest.$ac_ext <<EOF
-#line 4820 "configure"
-#include "confdefs.h"
- #include <wchar.h>
- #include <stddef.h>
-int main() {
-wint_t i = WEOF;
-; return 0; }
-EOF
-if { (eval echo configure:4829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_weof=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_weof=no
fi
-rm -f conftest*
- echo "$ac_t""$has_weof" 1>&6
- ac_wfuncs=yes
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__copysign_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__copysign_use" >&6
+
+ if test x$glibcxx_cv_func__copysign_use = x"yes"; then
+
+for ac_func in _copysign
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4845: 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 4850 "configure"
-#include "confdefs.h"
+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. */
-#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:4873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for sincos declaration" >&5
+echo $ECHO_N "checking for sincos declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_sincos_use+set} != xset; then
+ if test "${glibcxx_cv_func_sincos_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 <math.h>
+int
+main ()
+{
+ sincos(0, 0, 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
+ glibcxx_cv_func_sincos_use=yes
else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sincos_use=no
fi
-done
+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
- for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
- fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
- vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
- mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
- wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sincos_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sincos_use" >&6
+
+ if test x$glibcxx_cv_func_sincos_use = x"yes"; then
+
+for ac_func in sincos
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4908: 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 4913 "configure"
-#include "confdefs.h"
+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. */
-#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:4936: \"$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 "$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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _sincos declaration" >&5
+echo $ECHO_N "checking for _sincos declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__sincos_use+set} != xset; then
+ if test "${glibcxx_cv_func__sincos_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _sincos(0, 0, 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
+ glibcxx_cv_func__sincos_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sincos_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sincos_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sincos_use" >&6
+
+ if test x$glibcxx_cv_func__sincos_use = x"yes"; then
+
+for ac_func in _sincos
+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
-
- echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:4964: checking for ISO C99 wchar_t support" >&5
- if test x"$has_weof" = xyes &&
- test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
- ac_isoC99_wchar_t=yes
- else
- ac_isoC99_wchar_t=no
fi
- echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
+ fi
- ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:4976: checking for iconv.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+
+ echo "$as_me:$LINENO: checking for fpclass declaration" >&5
+echo $ECHO_N "checking for fpclass declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_fpclass_use+set} != xset; then
+ if test "${glibcxx_cv_func_fpclass_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 4981 "configure"
-#include "confdefs.h"
-#include <iconv.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4986: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ fpclass(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
+ glibcxx_cv_func_fpclass_use=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
+
+glibcxx_cv_func_fpclass_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_iconv_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_iconv_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fpclass_use" >&6
+
+ if test x$glibcxx_cv_func_fpclass_use = x"yes"; then
+
+for ac_func in fpclass
+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
- ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:5010: checking for langinfo.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ else
+
+ echo "$as_me:$LINENO: checking for _fpclass declaration" >&5
+echo $ECHO_N "checking for _fpclass declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__fpclass_use+set} != xset; then
+ if test "${glibcxx_cv_func__fpclass_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5015 "configure"
-#include "confdefs.h"
-#include <langinfo.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5020: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _fpclass(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
+ glibcxx_cv_func__fpclass_use=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*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fpclass_use=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_langinfo_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_langinfo_h=no
+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__fpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fpclass_use" >&6
- echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:5044: checking for iconv in -liconv" >&5
-ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-liconv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5052 "configure"
-#include "confdefs.h"
+ if test x$glibcxx_cv_func__fpclass_use = x"yes"; then
+
+for ac_func in _fpclass
+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 iconv();
+ 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() {
-iconv()
-; return 0; }
-EOF
-if { (eval echo configure:5063: \"$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"
+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
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- libiconv="-liconv"
+done
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for qfpclass declaration" >&5
+echo $ECHO_N "checking for qfpclass declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_qfpclass_use+set} != xset; then
+ if test "${glibcxx_cv_func_qfpclass_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ qfpclass(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
+ glibcxx_cv_func_qfpclass_use=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_qfpclass_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
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libiconv"
- for ac_func in iconv_open iconv_close iconv nl_langinfo
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_qfpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_qfpclass_use" >&6
+
+ if test x$glibcxx_cv_func_qfpclass_use = x"yes"; then
+
+for ac_func in qfpclass
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5089: 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 5094 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+fi
+done
+
+ else
+
+ echo "$as_me:$LINENO: checking for _qfpclass declaration" >&5
+echo $ECHO_N "checking for _qfpclass declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__qfpclass_use+set} != xset; then
+ if test "${glibcxx_cv_func__qfpclass_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _qfpclass(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
+ glibcxx_cv_func__qfpclass_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-int main() {
+glibcxx_cv_func__qfpclass_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__qfpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__qfpclass_use" >&6
+
+ if test x$glibcxx_cv_func__qfpclass_use = x"yes"; then
+
+for ac_func in _qfpclass
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:5117: \"$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 "$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
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for hypot declaration" >&5
+echo $ECHO_N "checking for hypot declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_hypot_use+set} != xset; then
+ if test "${glibcxx_cv_func_hypot_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ hypot(0, 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
+ glibcxx_cv_func_hypot_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_hypot_use=no
fi
-rm -f conftest*
+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
-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
- \
- ac_XPG2funcs=yes
-else
- echo "$ac_t""no" 1>&6
-ac_XPG2funcs=no
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_hypot_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_hypot_use" >&6
+
+ if test x$glibcxx_cv_func_hypot_use = x"yes"; then
+
+for ac_func in hypot
+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
+ else
- LIBS="$ac_save_LIBS"
+ echo "$as_me:$LINENO: checking for _hypot declaration" >&5
+echo $ECHO_N "checking for _hypot declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__hypot_use+set} != xset; then
+ if test "${glibcxx_cv_func__hypot_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:5147: checking for XPG2 wchar_t support" >&5
- if test x"$ac_has_iconv_h" = xyes &&
- test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
- ac_XPG2_wchar_t=yes
- else
- ac_XPG2_wchar_t=no
- fi
- echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCXX_USE_WCHAR_T 1
-EOF
- enable_wchar_t=yes
- 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
+
+ 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 <math.h>
+int
+main ()
+{
+ _hypot(0, 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
+ glibcxx_cv_func__hypot_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__hypot_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 $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:5167: checking for enabled wchar_t specializations" >&5
- echo "$ac_t""$enable_wchar_t" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__hypot_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__hypot_use" >&6
- cat >> confdefs.h <<\EOF
-#define HAVE_LC_MESSAGES 1
-EOF
+ if test x$glibcxx_cv_func__hypot_use = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_DRAND48 1
-EOF
+for ac_func in _hypot
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_GETPAGESIZE 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_SETENV 1
-EOF
+fi
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_SIGSETJMP 1
-EOF
+ fi
+ fi
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGN 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGNF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITEF 1
-EOF
+ echo "$as_me:$LINENO: checking for float trig functions" >&5
+echo $ECHO_N "checking for float trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_float_trig_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITE 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FREXPF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_HYPOT 1
-EOF
+ 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 <math.h>
+int
+main ()
+{
+ `for x in acosf asinf atanf \
+ cosf sinf tanf \
+ coshf sinhf tanhf; do echo "$x (0);"; done`
+ ;
+ 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_float_trig_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >> confdefs.h <<\EOF
-#define HAVE_HYPOTF 1
-EOF
+glibcxx_cv_func_float_trig_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
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINF 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNAN 1
-EOF
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_float_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_float_trig_use" >&6
+ if test x$glibcxx_cv_func_float_trig_use = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_MMAP 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ACOSF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ASINF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ATAN2F 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ATANF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_CEILF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGN 1
-EOF
+for ac_func in acosf asinf atanf \
+ cosf sinf tanf \
+ coshf sinhf tanhf
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGNF 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_COSF 1
-EOF
+fi
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_COSHF 1
-EOF
+ fi
- cat >> confdefs.h <<\EOF
-#define HAVE_EXPF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FABSF 1
-EOF
+ echo "$as_me:$LINENO: checking for float round functions" >&5
+echo $ECHO_N "checking for float round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_float_round_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_FLOORF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FMODF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FREXPF 1
-EOF
+ 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 <math.h>
+int
+main ()
+{
+ `for x in ceilf floorf; do echo "$x (0);"; done`
+ ;
+ 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_float_round_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >> confdefs.h <<\EOF
-#define HAVE_LDEXPF 1
-EOF
+glibcxx_cv_func_float_round_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
- cat >> confdefs.h <<\EOF
-#define HAVE_LOG10F 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_LOGF 1
-EOF
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_float_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_float_round_use" >&6
+ if test x$glibcxx_cv_func_float_round_use = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MODFF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_POWF 1
-EOF
+for ac_func in ceilf floorf
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_SINF 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_SINHF 1
-EOF
+fi
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_SQRTF 1
-EOF
+ fi
- cat >> confdefs.h <<\EOF
-#define HAVE_TANF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_TANHF 1
-EOF
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITEL 1
-EOF
+ echo "$as_me:$LINENO: checking for expf declaration" >&5
+echo $ECHO_N "checking for expf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_expf_use+set} != xset; then
+ if test "${glibcxx_cv_func_expf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINFL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANL 1
-EOF
- fi
- ;;
- *-hpux*)
- os_include_dir="os/hpux"
- for ac_hdr in 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
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5354: 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 5359 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5364: \"$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"
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ expf(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
+ glibcxx_cv_func_expf_use=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
+
+glibcxx_cv_func_expf_use=no
fi
-rm -f conftest*
+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
-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
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_expf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_expf_use" >&6
+
+ if test x$glibcxx_cv_func_expf_use = x"yes"; then
+
+for ac_func in expf
+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
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
-
-
- # If we're not using GNU ld, then there's no point in even trying these
- # tests. Check for that first. We should have already tested for gld
- # by now (in libtool), but require it now just to be safe...
- test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
- test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
+ else
- # The name set by libtool depends on the version of libtool. Shame on us
- # for depending on an impl detail, but c'est la vie. Older versions used
- # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
- # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
- # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
- # set (hence we're using an older libtool), then set it.
- if test x${with_gnu_ld+set} != xset; then
- if test x${ac_cv_prog_gnu_ld+set} != xset; then
- # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
- with_gnu_ld=no
- else
- with_gnu_ld=$ac_cv_prog_gnu_ld
- fi
- fi
+ echo "$as_me:$LINENO: checking for _expf declaration" >&5
+echo $ECHO_N "checking for _expf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__expf_use+set} != xset; then
+ if test "${glibcxx_cv_func__expf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- # Start by getting the version number. I think the libtool test already
- # does some of this, but throws away the result.
-
- ldver=`$LD --version 2>/dev/null | head -1 | \
- sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-
- glibcxx_gnu_ld_version=`echo $ldver | \
- $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
- # Set --gc-sections.
- if test "$with_gnu_ld" = "notbroken"; then
- # GNU ld it is! Joy and bunny rabbits!
- # All these tests are for C++; save the language and the compiler flags.
- # Need to do this so that g++ won't try to link in libstdc++
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-x c++ -Wl,--gc-sections'
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
- # Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
- echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:5442: checking for ld that supports -Wl,--gc-sections" >&5
- if test "$cross_compiling" = yes; then
- ac_sectionLDflags=yes
+int
+main ()
+{
+ _expf(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
+ glibcxx_cv_func__expf_use=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 5447 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- int main(void)
- {
- try { throw 1; }
- catch (...) { };
- return 0;
- }
-
-EOF
-if { (eval echo configure:5458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_sectionLDflags=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_sectionLDflags=no
+glibcxx_cv_func__expf_use=no
fi
-rm -fr conftest*
+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
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
- fi
- if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
- fi
- echo "$ac_t""$ac_sectionLDflags" 1>&6
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__expf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__expf_use" >&6
- # Set linker optimization flags.
- if test x"$with_gnu_ld" = x"yes"; then
- OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ if test x$glibcxx_cv_func__expf_use = x"yes"; then
+
+for ac_func in _expf
+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
fi
-
-
-
- echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:5492: checking for main in -lm" >&5
-ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for isnanf declaration" >&5
+echo $ECHO_N "checking for isnanf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_isnanf_use+set} != xset; then
+ if test "${glibcxx_cv_func_isnanf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5500 "configure"
-#include "confdefs.h"
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:5507: \"$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"
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ isnanf(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
+ glibcxx_cv_func_isnanf_use=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
+glibcxx_cv_func_isnanf_use=no
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+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
- LIBS="-lm $LIBS"
-else
- echo "$ac_t""no" 1>&6
fi
- for ac_func in nan copysignf
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isnanf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isnanf_use" >&6
+
+ if test x$glibcxx_cv_func_isnanf_use = x"yes"; then
+
+for ac_func in isnanf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5537: 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 5542 "configure"
-#include "confdefs.h"
+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. */
-#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:5565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _isnanf declaration" >&5
+echo $ECHO_N "checking for _isnanf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__isnanf_use+set} != xset; then
+ if test "${glibcxx_cv_func__isnanf_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _isnanf(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
+ glibcxx_cv_func__isnanf_use=yes
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isnanf_use=no
fi
-done
+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
- for ac_func in __signbit
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isnanf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isnanf_use" >&6
+
+ if test x$glibcxx_cv_func__isnanf_use = x"yes"; then
+
+for ac_func in _isnanf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5594: 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 5599 "configure"
-#include "confdefs.h"
+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. */
-#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:5622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for isinff declaration" >&5
+echo $ECHO_N "checking for isinff declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_isinff_use+set} != xset; then
+ if test "${glibcxx_cv_func_isinff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ isinff(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
+ glibcxx_cv_func_isinff_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isinff_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
-done
- for ac_func in __signbitf
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isinff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isinff_use" >&6
+
+ if test x$glibcxx_cv_func_isinff_use = x"yes"; then
+
+for ac_func in isinff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5650: 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 5655 "configure"
-#include "confdefs.h"
+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. */
-#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:5678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _isinff declaration" >&5
+echo $ECHO_N "checking for _isinff declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__isinff_use+set} != xset; then
+ if test "${glibcxx_cv_func__isinff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _isinff(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
+ glibcxx_cv_func__isinff_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isinff_use=no
fi
-done
+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
- if test x$ac_cv_func_copysignl = x"yes"; then
- for ac_func in __signbitl
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isinff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isinff_use" >&6
+
+ if test x$glibcxx_cv_func__isinff_use = x"yes"; then
+
+for ac_func in _isinff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5708: 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 5713 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+fi
+done
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for atan2f declaration" >&5
+echo $ECHO_N "checking for atan2f declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_atan2f_use+set} != xset; then
+ if test "${glibcxx_cv_func_atan2f_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 <math.h>
+int
+main ()
+{
+ atan2f(0, 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
+ glibcxx_cv_func_atan2f_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_atan2f_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
-int main() {
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_atan2f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_atan2f_use" >&6
+
+ if test x$glibcxx_cv_func_atan2f_use = x"yes"; then
+
+for ac_func in atan2f
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:5736: \"$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 "$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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _atan2f declaration" >&5
+echo $ECHO_N "checking for _atan2f declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__atan2f_use+set} != xset; then
+ if test "${glibcxx_cv_func__atan2f_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _atan2f(0, 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
+ glibcxx_cv_func__atan2f_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__atan2f_use=no
fi
-rm -f conftest*
+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
-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
-LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__atan2f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__atan2f_use" >&6
+
+ if test x$glibcxx_cv_func__atan2f_use = x"yes"; then
+
+for ac_func in _atan2f
+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
fi
- if test -n "$LIBMATHOBJS"; then
- need_libmath=yes
- fi
-
-
-
- echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:5771: checking for mbstate_t" >&5
- cat > conftest.$ac_ext <<EOF
-#line 5773 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-mbstate_t teststate;
-; return 0; }
-EOF
-if { (eval echo configure:5780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- have_mbstate_t=yes
+
+ echo "$as_me:$LINENO: checking for fabsf declaration" >&5
+echo $ECHO_N "checking for fabsf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_fabsf_use+set} != xset; then
+ if test "${glibcxx_cv_func_fabsf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- have_mbstate_t=no
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ fabsf(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
+ glibcxx_cv_func_fabsf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fabsf_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
-rm -f conftest*
- echo "$ac_t""$have_mbstate_t" 1>&6
- if test x"$have_mbstate_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MBSTATE_T 1
-EOF
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fabsf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fabsf_use" >&6
- for ac_hdr in wchar.h
+ if test x$glibcxx_cv_func_fabsf_use = x"yes"; then
+
+for ac_func in fabsf
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5802: 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
+ 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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _fabsf declaration" >&5
+echo $ECHO_N "checking for _fabsf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__fabsf_use+set} != xset; then
+ if test "${glibcxx_cv_func__fabsf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5807 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5812: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _fabsf(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
+ glibcxx_cv_func__fabsf_use=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
+
+glibcxx_cv_func__fabsf_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wchar_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wchar_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fabsf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fabsf_use" >&6
+
+ if test x$glibcxx_cv_func__fabsf_use = x"yes"; then
+
+for ac_func in _fabsf
+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
- for ac_hdr in wctype.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5843: 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
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for fmodf declaration" >&5
+echo $ECHO_N "checking for fmodf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_fmodf_use+set} != xset; then
+ if test "${glibcxx_cv_func_fmodf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5848 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5853: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ fmodf(0, 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
+ glibcxx_cv_func_fmodf_use=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
+
+glibcxx_cv_func_fmodf_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wctype_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wctype_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fmodf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fmodf_use" >&6
+
+ if test x$glibcxx_cv_func_fmodf_use = x"yes"; then
+
+for ac_func in fmodf
+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
+ else
- if test x"$ac_has_wchar_h" = xyes &&
- test x"$ac_has_wctype_h" = xyes &&
- test x"$enable_c_mbchar" != xno; then
+ echo "$as_me:$LINENO: checking for _fmodf declaration" >&5
+echo $ECHO_N "checking for _fmodf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__fmodf_use+set} != xset; then
+ if test "${glibcxx_cv_func__fmodf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:5886: checking for WCHAR_MIN and WCHAR_MAX" >&5
- cat > conftest.$ac_ext <<EOF
-#line 5888 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-int i = WCHAR_MIN; int j = WCHAR_MAX;
-; return 0; }
-EOF
-if { (eval echo configure:5895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_wchar_minmax=yes
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _fmodf(0, 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
+ glibcxx_cv_func__fmodf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_wchar_minmax=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fmodf_use=no
fi
-rm -f conftest*
- echo "$ac_t""$has_wchar_minmax" 1>&6
+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
- echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:5908: checking for WEOF" >&5
- cat > conftest.$ac_ext <<EOF
-#line 5910 "configure"
-#include "confdefs.h"
- #include <wchar.h>
- #include <stddef.h>
-int main() {
-wint_t i = WEOF;
-; return 0; }
-EOF
-if { (eval echo configure:5919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_weof=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_weof=no
fi
-rm -f conftest*
- echo "$ac_t""$has_weof" 1>&6
- ac_wfuncs=yes
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fmodf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fmodf_use" >&6
+
+ if test x$glibcxx_cv_func__fmodf_use = x"yes"; then
+
+for ac_func in _fmodf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5935: 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 5940 "configure"
-#include "confdefs.h"
+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. */
-#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:5963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for frexpf declaration" >&5
+echo $ECHO_N "checking for frexpf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_frexpf_use+set} != xset; then
+ if test "${glibcxx_cv_func_frexpf_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 <math.h>
+int
+main ()
+{
+ frexpf(0, 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
+ glibcxx_cv_func_frexpf_use=yes
else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_frexpf_use=no
fi
-done
+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
- for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
- fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
- vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
- mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
- wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_frexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_frexpf_use" >&6
+
+ if test x$glibcxx_cv_func_frexpf_use = x"yes"; then
+
+for ac_func in frexpf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5998: 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 6003 "configure"
-#include "confdefs.h"
+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. */
-#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:6026: \"$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 "$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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _frexpf declaration" >&5
+echo $ECHO_N "checking for _frexpf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__frexpf_use+set} != xset; then
+ if test "${glibcxx_cv_func__frexpf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _frexpf(0, 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
+ glibcxx_cv_func__frexpf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__frexpf_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__frexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__frexpf_use" >&6
+
+ if test x$glibcxx_cv_func__frexpf_use = x"yes"; then
+
+for ac_func in _frexpf
+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
-
- echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:6054: checking for ISO C99 wchar_t support" >&5
- if test x"$has_weof" = xyes &&
- test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
- ac_isoC99_wchar_t=yes
- else
- ac_isoC99_wchar_t=no
fi
- echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
+ fi
- ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:6066: checking for iconv.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+
+ echo "$as_me:$LINENO: checking for hypotf declaration" >&5
+echo $ECHO_N "checking for hypotf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_hypotf_use+set} != xset; then
+ if test "${glibcxx_cv_func_hypotf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 6071 "configure"
-#include "confdefs.h"
-#include <iconv.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6076: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ hypotf(0, 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
+ glibcxx_cv_func_hypotf_use=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
+
+glibcxx_cv_func_hypotf_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_iconv_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_iconv_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_hypotf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_hypotf_use" >&6
+
+ if test x$glibcxx_cv_func_hypotf_use = x"yes"; then
+
+for ac_func in hypotf
+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
- ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:6100: checking for langinfo.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ else
+
+ echo "$as_me:$LINENO: checking for _hypotf declaration" >&5
+echo $ECHO_N "checking for _hypotf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__hypotf_use+set} != xset; then
+ if test "${glibcxx_cv_func__hypotf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 6105 "configure"
-#include "confdefs.h"
-#include <langinfo.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6110: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _hypotf(0, 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
+ glibcxx_cv_func__hypotf_use=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*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__hypotf_use=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_langinfo_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_langinfo_h=no
+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__hypotf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__hypotf_use" >&6
- echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:6134: checking for iconv in -liconv" >&5
-ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-liconv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6142 "configure"
-#include "confdefs.h"
+ if test x$glibcxx_cv_func__hypotf_use = x"yes"; then
+
+for ac_func in _hypotf
+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 iconv();
+ 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() {
-iconv()
-; return 0; }
-EOF
-if { (eval echo configure:6153: \"$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"
+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
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- libiconv="-liconv"
+done
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for ldexpf declaration" >&5
+echo $ECHO_N "checking for ldexpf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_ldexpf_use+set} != xset; then
+ if test "${glibcxx_cv_func_ldexpf_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 <math.h>
+int
+main ()
+{
+ ldexpf(0, 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
+ glibcxx_cv_func_ldexpf_use=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_ldexpf_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
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libiconv"
- for ac_func in iconv_open iconv_close iconv nl_langinfo
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_ldexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_ldexpf_use" >&6
+
+ if test x$glibcxx_cv_func_ldexpf_use = x"yes"; then
+
+for ac_func in ldexpf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6179: 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 6184 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+fi
+done
+
+ else
+
+ echo "$as_me:$LINENO: checking for _ldexpf declaration" >&5
+echo $ECHO_N "checking for _ldexpf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__ldexpf_use+set} != xset; then
+ if test "${glibcxx_cv_func__ldexpf_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 <math.h>
+int
+main ()
+{
+ _ldexpf(0, 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
+ glibcxx_cv_func__ldexpf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__ldexpf_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__ldexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__ldexpf_use" >&6
-int main() {
+ if test x$glibcxx_cv_func__ldexpf_use = x"yes"; then
+for ac_func in _ldexpf
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:6207: \"$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 "$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
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for logf declaration" >&5
+echo $ECHO_N "checking for logf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_logf_use+set} != xset; then
+ if test "${glibcxx_cv_func_logf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ logf(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
+ glibcxx_cv_func_logf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_logf_use=no
fi
-rm -f conftest*
+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
-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
- \
- ac_XPG2funcs=yes
-else
- echo "$ac_t""no" 1>&6
-ac_XPG2funcs=no
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_logf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_logf_use" >&6
+
+ if test x$glibcxx_cv_func_logf_use = x"yes"; then
+
+for ac_func in logf
+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
+ else
- LIBS="$ac_save_LIBS"
+ echo "$as_me:$LINENO: checking for _logf declaration" >&5
+echo $ECHO_N "checking for _logf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__logf_use+set} != xset; then
+ if test "${glibcxx_cv_func__logf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:6237: checking for XPG2 wchar_t support" >&5
- if test x"$ac_has_iconv_h" = xyes &&
- test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
- ac_XPG2_wchar_t=yes
- else
- ac_XPG2_wchar_t=no
- fi
- echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCXX_USE_WCHAR_T 1
-EOF
- enable_wchar_t=yes
- 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
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _logf(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
+ glibcxx_cv_func__logf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__logf_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 $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:6257: checking for enabled wchar_t specializations" >&5
- echo "$ac_t""$enable_wchar_t" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__logf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__logf_use" >&6
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGN 1
-EOF
+ if test x$glibcxx_cv_func__logf_use = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGNF 1
-EOF
+for ac_func in _logf
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_FREXPF 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_HYPOT 1
-EOF
+fi
+done
- case "$target" in
- *-hpux10*)
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITE 1
-EOF
+ fi
+ fi
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITEF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINFF 1
-EOF
+ echo "$as_me:$LINENO: checking for log10f declaration" >&5
+echo $ECHO_N "checking for log10f declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_log10f_use+set} != xset; then
+ if test "${glibcxx_cv_func_log10f_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNAN 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANF 1
-EOF
- ;;
- esac
- ;;
- *-linux*)
- os_include_dir="os/gnu-linux"
- for ac_hdr in 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
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6313: 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 6318 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6323: \"$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"
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ log10f(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
+ glibcxx_cv_func_log10f_use=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
+
+glibcxx_cv_func_log10f_use=no
fi
-rm -f conftest*
+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
-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
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_log10f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_log10f_use" >&6
+
+ if test x$glibcxx_cv_func_log10f_use = x"yes"; then
+
+for ac_func in log10f
+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
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
-
-
- # If we're not using GNU ld, then there's no point in even trying these
- # tests. Check for that first. We should have already tested for gld
- # by now (in libtool), but require it now just to be safe...
- test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
- test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
+ else
- # The name set by libtool depends on the version of libtool. Shame on us
- # for depending on an impl detail, but c'est la vie. Older versions used
- # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
- # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
- # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
- # set (hence we're using an older libtool), then set it.
- if test x${with_gnu_ld+set} != xset; then
- if test x${ac_cv_prog_gnu_ld+set} != xset; then
- # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
- with_gnu_ld=no
- else
- with_gnu_ld=$ac_cv_prog_gnu_ld
- fi
- fi
+ echo "$as_me:$LINENO: checking for _log10f declaration" >&5
+echo $ECHO_N "checking for _log10f declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__log10f_use+set} != xset; then
+ if test "${glibcxx_cv_func__log10f_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- # Start by getting the version number. I think the libtool test already
- # does some of this, but throws away the result.
-
- ldver=`$LD --version 2>/dev/null | head -1 | \
- sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-
- glibcxx_gnu_ld_version=`echo $ldver | \
- $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
- # Set --gc-sections.
- if test "$with_gnu_ld" = "notbroken"; then
- # GNU ld it is! Joy and bunny rabbits!
- # All these tests are for C++; save the language and the compiler flags.
- # Need to do this so that g++ won't try to link in libstdc++
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-x c++ -Wl,--gc-sections'
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
- # Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
- echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:6401: checking for ld that supports -Wl,--gc-sections" >&5
- if test "$cross_compiling" = yes; then
- ac_sectionLDflags=yes
+int
+main ()
+{
+ _log10f(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
+ glibcxx_cv_func__log10f_use=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 6406 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- int main(void)
- {
- try { throw 1; }
- catch (...) { };
- return 0;
- }
-
-EOF
-if { (eval echo configure:6417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_sectionLDflags=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_sectionLDflags=no
+glibcxx_cv_func__log10f_use=no
fi
-rm -fr conftest*
+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
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
- fi
- if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
- fi
- echo "$ac_t""$ac_sectionLDflags" 1>&6
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__log10f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__log10f_use" >&6
- # Set linker optimization flags.
- if test x"$with_gnu_ld" = x"yes"; then
- OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ if test x$glibcxx_cv_func__log10f_use = x"yes"; then
+
+for ac_func in _log10f
+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
fi
-
-
-
- echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:6451: checking for main in -lm" >&5
-ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for modff declaration" >&5
+echo $ECHO_N "checking for modff declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_modff_use+set} != xset; then
+ if test "${glibcxx_cv_func_modff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6459 "configure"
-#include "confdefs.h"
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:6466: \"$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"
+
+
+ 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 <math.h>
+int
+main ()
+{
+ modff(0, 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
+ glibcxx_cv_func_modff_use=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
+glibcxx_cv_func_modff_use=no
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+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
- LIBS="-lm $LIBS"
-else
- echo "$ac_t""no" 1>&6
fi
- for ac_func in nan copysignf
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_modff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_modff_use" >&6
+
+ if test x$glibcxx_cv_func_modff_use = x"yes"; then
+
+for ac_func in modff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6496: 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 6501 "configure"
-#include "confdefs.h"
+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. */
-#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:6524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _modff declaration" >&5
+echo $ECHO_N "checking for _modff declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__modff_use+set} != xset; then
+ if test "${glibcxx_cv_func__modff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _modff(0, 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
+ glibcxx_cv_func__modff_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__modff_use=no
fi
-done
+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__modff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__modff_use" >&6
+
+ if test x$glibcxx_cv_func__modff_use = x"yes"; then
- for ac_func in __signbit
+for ac_func in _modff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6553: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 6558 "configure"
-#include "confdefs.h"
+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. */
-#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:6581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for powf declaration" >&5
+echo $ECHO_N "checking for powf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_powf_use+set} != xset; then
+ if test "${glibcxx_cv_func_powf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ powf(0, 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
+ glibcxx_cv_func_powf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_powf_use=no
fi
-done
+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_powf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_powf_use" >&6
+
+ if test x$glibcxx_cv_func_powf_use = x"yes"; then
- for ac_func in __signbitf
+for ac_func in powf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6609: 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 6614 "configure"
-#include "confdefs.h"
+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. */
-#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:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _powf declaration" >&5
+echo $ECHO_N "checking for _powf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__powf_use+set} != xset; then
+ if test "${glibcxx_cv_func__powf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _powf(0, 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
+ glibcxx_cv_func__powf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__powf_use=no
fi
-done
+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
- if test x$ac_cv_func_copysignl = x"yes"; then
- for ac_func in __signbitl
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__powf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__powf_use" >&6
+
+ if test x$glibcxx_cv_func__powf_use = x"yes"; then
+
+for ac_func in _powf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6667: 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 6672 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+fi
+done
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for sqrtf declaration" >&5
+echo $ECHO_N "checking for sqrtf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_sqrtf_use+set} != xset; then
+ if test "${glibcxx_cv_func_sqrtf_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ sqrtf(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
+ glibcxx_cv_func_sqrtf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sqrtf_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
+
-int main() {
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sqrtf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sqrtf_use" >&6
+ if test x$glibcxx_cv_func_sqrtf_use = x"yes"; then
+
+for ac_func in sqrtf
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:6695: \"$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 "$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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _sqrtf declaration" >&5
+echo $ECHO_N "checking for _sqrtf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__sqrtf_use+set} != xset; then
+ if test "${glibcxx_cv_func__sqrtf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _sqrtf(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
+ glibcxx_cv_func__sqrtf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sqrtf_use=no
fi
-rm -f conftest*
+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
-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
-LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sqrtf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sqrtf_use" >&6
+
+ if test x$glibcxx_cv_func__sqrtf_use = x"yes"; then
+
+for ac_func in _sqrtf
+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
fi
- if test -n "$LIBMATHOBJS"; then
- need_libmath=yes
- fi
-
-
-
- echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:6730: checking for mbstate_t" >&5
- cat > conftest.$ac_ext <<EOF
-#line 6732 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-mbstate_t teststate;
-; return 0; }
-EOF
-if { (eval echo configure:6739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- have_mbstate_t=yes
+
+ echo "$as_me:$LINENO: checking for sincosf declaration" >&5
+echo $ECHO_N "checking for sincosf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_sincosf_use+set} != xset; then
+ if test "${glibcxx_cv_func_sincosf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- have_mbstate_t=no
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ sincosf(0, 0, 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
+ glibcxx_cv_func_sincosf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sincosf_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
-rm -f conftest*
- echo "$ac_t""$have_mbstate_t" 1>&6
- if test x"$have_mbstate_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MBSTATE_T 1
-EOF
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sincosf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sincosf_use" >&6
+
+ if test x$glibcxx_cv_func_sincosf_use = x"yes"; then
- for ac_hdr in wchar.h
+for ac_func in sincosf
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6761: 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
+ 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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _sincosf declaration" >&5
+echo $ECHO_N "checking for _sincosf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__sincosf_use+set} != xset; then
+ if test "${glibcxx_cv_func__sincosf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 6766 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6771: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _sincosf(0, 0, 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
+ glibcxx_cv_func__sincosf_use=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
+
+glibcxx_cv_func__sincosf_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wchar_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wchar_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sincosf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sincosf_use" >&6
+
+ if test x$glibcxx_cv_func__sincosf_use = x"yes"; then
+
+for ac_func in _sincosf
+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
- for ac_hdr in wctype.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6802: 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
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for finitef declaration" >&5
+echo $ECHO_N "checking for finitef declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_finitef_use+set} != xset; then
+ if test "${glibcxx_cv_func_finitef_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 6807 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6812: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ finitef(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
+ glibcxx_cv_func_finitef_use=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
+
+glibcxx_cv_func_finitef_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wctype_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wctype_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_finitef_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_finitef_use" >&6
+
+ if test x$glibcxx_cv_func_finitef_use = x"yes"; then
+
+for ac_func in finitef
+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
+ else
- if test x"$ac_has_wchar_h" = xyes &&
- test x"$ac_has_wctype_h" = xyes &&
- test x"$enable_c_mbchar" != xno; then
+ echo "$as_me:$LINENO: checking for _finitef declaration" >&5
+echo $ECHO_N "checking for _finitef declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__finitef_use+set} != xset; then
+ if test "${glibcxx_cv_func__finitef_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:6845: checking for WCHAR_MIN and WCHAR_MAX" >&5
- cat > conftest.$ac_ext <<EOF
-#line 6847 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-int i = WCHAR_MIN; int j = WCHAR_MAX;
-; return 0; }
-EOF
-if { (eval echo configure:6854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_wchar_minmax=yes
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _finitef(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
+ glibcxx_cv_func__finitef_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_wchar_minmax=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__finitef_use=no
fi
-rm -f conftest*
- echo "$ac_t""$has_wchar_minmax" 1>&6
+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
- echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:6867: checking for WEOF" >&5
- cat > conftest.$ac_ext <<EOF
-#line 6869 "configure"
-#include "confdefs.h"
- #include <wchar.h>
- #include <stddef.h>
-int main() {
-wint_t i = WEOF;
-; return 0; }
-EOF
-if { (eval echo configure:6878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_weof=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_weof=no
fi
-rm -f conftest*
- echo "$ac_t""$has_weof" 1>&6
- ac_wfuncs=yes
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__finitef_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__finitef_use" >&6
+
+ if test x$glibcxx_cv_func__finitef_use = x"yes"; then
+
+for ac_func in _finitef
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6894: 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 6899 "configure"
-#include "confdefs.h"
+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. */
-#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:6922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for long double trig functions" >&5
+echo $ECHO_N "checking for long double trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_long_double_trig_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ `for x in acosl asinl atanl \
+ cosl sinl tanl \
+ coshl sinhl tanhl; do echo "$x (0);"; done`
+ ;
+ 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_long_double_trig_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_long_double_trig_use=no
fi
-done
+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
- for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
- fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
- vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
- mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
- wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_long_double_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_long_double_trig_use" >&6
+ if test x$glibcxx_cv_func_long_double_trig_use = x"yes"; then
+
+
+
+
+
+
+
+
+
+for ac_func in acosl asinl atanl \
+ cosl sinl tanl \
+ coshl sinhl tanhl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6957: 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 6962 "configure"
-#include "confdefs.h"
+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. */
-#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:6985: \"$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 "$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
+
+
+ echo "$as_me:$LINENO: checking for long double round functions" >&5
+echo $ECHO_N "checking for long double round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_long_double_round_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ `for x in ceill floorl; do echo "$x (0);"; done`
+ ;
+ 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_long_double_round_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_long_double_round_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_long_double_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_long_double_round_use" >&6
+ if test x$glibcxx_cv_func_long_double_round_use = x"yes"; then
+
+
+for ac_func in ceill floorl
+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
- echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:7013: checking for ISO C99 wchar_t support" >&5
- if test x"$has_weof" = xyes &&
- test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
- ac_isoC99_wchar_t=yes
- else
- ac_isoC99_wchar_t=no
- fi
- echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
- ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:7025: checking for iconv.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for isnanl declaration" >&5
+echo $ECHO_N "checking for isnanl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_isnanl_use+set} != xset; then
+ if test "${glibcxx_cv_func_isnanl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 7030 "configure"
-#include "confdefs.h"
-#include <iconv.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7035: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ isnanl(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
+ glibcxx_cv_func_isnanl_use=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
+
+glibcxx_cv_func_isnanl_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_iconv_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_iconv_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isnanl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isnanl_use" >&6
+
+ if test x$glibcxx_cv_func_isnanl_use = x"yes"; then
+
+for ac_func in isnanl
+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
+
+ else
- ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:7059: checking for langinfo.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for _isnanl declaration" >&5
+echo $ECHO_N "checking for _isnanl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__isnanl_use+set} != xset; then
+ if test "${glibcxx_cv_func__isnanl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 7064 "configure"
-#include "confdefs.h"
-#include <langinfo.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7069: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _isnanl(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
+ glibcxx_cv_func__isnanl_use=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*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isnanl_use=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_langinfo_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_langinfo_h=no
+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__isnanl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isnanl_use" >&6
+
+ if test x$glibcxx_cv_func__isnanl_use = x"yes"; then
- echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:7093: checking for iconv in -liconv" >&5
-ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-liconv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7101 "configure"
-#include "confdefs.h"
+for ac_func in _isnanl
+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 iconv();
+ 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() {
-iconv()
-; return 0; }
-EOF
-if { (eval echo configure:7112: \"$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"
+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
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- libiconv="-liconv"
+done
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for isinfl declaration" >&5
+echo $ECHO_N "checking for isinfl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_isinfl_use+set} != xset; then
+ if test "${glibcxx_cv_func_isinfl_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ isinfl(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
+ glibcxx_cv_func_isinfl_use=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isinfl_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
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libiconv"
- for ac_func in iconv_open iconv_close iconv nl_langinfo
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isinfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isinfl_use" >&6
+
+ if test x$glibcxx_cv_func_isinfl_use = x"yes"; then
+
+for ac_func in isinfl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7138: 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 7143 "configure"
-#include "confdefs.h"
+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. */
-#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:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
- \
- ac_XPG2funcs=yes
+ else
+
+ echo "$as_me:$LINENO: checking for _isinfl declaration" >&5
+echo $ECHO_N "checking for _isinfl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__isinfl_use+set} != xset; then
+ if test "${glibcxx_cv_func__isinfl_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _isinfl(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
+ glibcxx_cv_func__isinfl_use=yes
else
- echo "$ac_t""no" 1>&6
-ac_XPG2funcs=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isinfl_use=no
fi
-done
+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
- LIBS="$ac_save_LIBS"
+fi
- echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:7196: checking for XPG2 wchar_t support" >&5
- if test x"$ac_has_iconv_h" = xyes &&
- test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
- ac_XPG2_wchar_t=yes
- else
- ac_XPG2_wchar_t=no
- fi
- echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isinfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isinfl_use" >&6
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCXX_USE_WCHAR_T 1
-EOF
+ if test x$glibcxx_cv_func__isinfl_use = x"yes"; then
+
+for ac_func in _isinfl
+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
- enable_wchar_t=yes
fi
fi
- echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:7216: checking for enabled wchar_t specializations" >&5
- echo "$ac_t""$enable_wchar_t" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGN 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGNF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITE 1
-EOF
+ echo "$as_me:$LINENO: checking for copysignl declaration" >&5
+echo $ECHO_N "checking for copysignl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_copysignl_use+set} != xset; then
+ if test "${glibcxx_cv_func_copysignl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITEF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FREXPF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_HYPOTF 1
-EOF
+ 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 <math.h>
+int
+main ()
+{
+ copysignl(0, 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
+ glibcxx_cv_func_copysignl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINF 1
-EOF
+glibcxx_cv_func_copysignl_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
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINFF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNAN 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANF 1
-EOF
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_copysignl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_copysignl_use" >&6
- cat >> confdefs.h <<\EOF
-#define HAVE_SINCOS 1
-EOF
+ if test x$glibcxx_cv_func_copysignl_use = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SINCOSF 1
-EOF
+for ac_func in copysignl
+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
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITEL 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_HYPOTL 1
-EOF
+fi
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINFL 1
-EOF
+ else
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANL 1
-EOF
+ echo "$as_me:$LINENO: checking for _copysignl declaration" >&5
+echo $ECHO_N "checking for _copysignl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__copysignl_use+set} != xset; then
+ if test "${glibcxx_cv_func__copysignl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- fi
- ;;
- *-mingw32*)
- os_include_dir="os/mingw32"
- for ac_hdr in sys/types.h locale.h float.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7292: 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 7297 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7302: \"$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"
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _copysignl(0, 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
+ glibcxx_cv_func__copysignl_use=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
+
+glibcxx_cv_func__copysignl_use=no
fi
-rm -f conftest*
+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
-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
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__copysignl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__copysignl_use" >&6
+
+ if test x$glibcxx_cv_func__copysignl_use = x"yes"; then
+
+for ac_func in _copysignl
+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
-
- # If we're not using GNU ld, then there's no point in even trying these
- # tests. Check for that first. We should have already tested for gld
- # by now (in libtool), but require it now just to be safe...
- test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
- test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
-
- # The name set by libtool depends on the version of libtool. Shame on us
- # for depending on an impl detail, but c'est la vie. Older versions used
- # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
- # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
- # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
- # set (hence we're using an older libtool), then set it.
- if test x${with_gnu_ld+set} != xset; then
- if test x${ac_cv_prog_gnu_ld+set} != xset; then
- # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
- with_gnu_ld=no
- else
- with_gnu_ld=$ac_cv_prog_gnu_ld
fi
fi
- # Start by getting the version number. I think the libtool test already
- # does some of this, but throws away the result.
-
- ldver=`$LD --version 2>/dev/null | head -1 | \
- sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-
- glibcxx_gnu_ld_version=`echo $ldver | \
- $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
-
- # Set --gc-sections.
- if test "$with_gnu_ld" = "notbroken"; then
- # GNU ld it is! Joy and bunny rabbits!
- # All these tests are for C++; save the language and the compiler flags.
- # Need to do this so that g++ won't try to link in libstdc++
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-x c++ -Wl,--gc-sections'
- # Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
- echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:7378: checking for ld that supports -Wl,--gc-sections" >&5
- if test "$cross_compiling" = yes; then
- ac_sectionLDflags=yes
+ echo "$as_me:$LINENO: checking for atan2l declaration" >&5
+echo $ECHO_N "checking for atan2l declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_atan2l_use+set} != xset; then
+ if test "${glibcxx_cv_func_atan2l_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 7383 "configure"
-#include "confdefs.h"
- int main(void)
- {
- try { throw 1; }
- catch (...) { };
- return 0;
- }
-
-EOF
-if { (eval echo configure:7394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_sectionLDflags=yes
+
+
+ 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 <math.h>
+int
+main ()
+{
+ atan2l(0, 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
+ glibcxx_cv_func_atan2l_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_sectionLDflags=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_atan2l_use=no
fi
-rm -fr conftest*
+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
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
- fi
- if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
- fi
- echo "$ac_t""$ac_sectionLDflags" 1>&6
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_atan2l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_atan2l_use" >&6
- # Set linker optimization flags.
- if test x"$with_gnu_ld" = x"yes"; then
- OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
- fi
+ if test x$glibcxx_cv_func_atan2l_use = x"yes"; then
+
+for ac_func in atan2l
+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
-
- echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:7428: checking for main in -lm" >&5
-ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+done
+
+ else
+
+ echo "$as_me:$LINENO: checking for _atan2l declaration" >&5
+echo $ECHO_N "checking for _atan2l declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__atan2l_use+set} != xset; then
+ if test "${glibcxx_cv_func__atan2l_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7436 "configure"
-#include "confdefs.h"
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:7443: \"$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"
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _atan2l(0, 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
+ glibcxx_cv_func__atan2l_use=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
+glibcxx_cv_func__atan2l_use=no
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+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
- LIBS="-lm $LIBS"
-else
- echo "$ac_t""no" 1>&6
fi
- for ac_func in nan copysignf
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__atan2l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__atan2l_use" >&6
+
+ if test x$glibcxx_cv_func__atan2l_use = x"yes"; then
+
+for ac_func in _atan2l
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7473: 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 7478 "configure"
-#include "confdefs.h"
+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. */
-#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:7501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for expl declaration" >&5
+echo $ECHO_N "checking for expl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_expl_use+set} != xset; then
+ if test "${glibcxx_cv_func_expl_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ expl(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
+ glibcxx_cv_func_expl_use=yes
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_expl_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
-done
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_expl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_expl_use" >&6
+
+ if test x$glibcxx_cv_func_expl_use = x"yes"; then
- for ac_func in __signbit
+for ac_func in expl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7530: 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 7535 "configure"
-#include "confdefs.h"
+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. */
-#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:7558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _expl declaration" >&5
+echo $ECHO_N "checking for _expl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__expl_use+set} != xset; then
+ if test "${glibcxx_cv_func__expl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _expl(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
+ glibcxx_cv_func__expl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__expl_use=no
fi
-done
+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__expl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__expl_use" >&6
+
+ if test x$glibcxx_cv_func__expl_use = x"yes"; then
- for ac_func in __signbitf
+for ac_func in _expl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7586: 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 7591 "configure"
-#include "confdefs.h"
+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. */
-#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:7614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for fabsl declaration" >&5
+echo $ECHO_N "checking for fabsl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_fabsl_use+set} != xset; then
+ if test "${glibcxx_cv_func_fabsl_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ fabsl(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
+ glibcxx_cv_func_fabsl_use=yes
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fabsl_use=no
fi
-done
+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
- if test x$ac_cv_func_copysignl = x"yes"; then
- for ac_func in __signbitl
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fabsl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fabsl_use" >&6
+
+ if test x$glibcxx_cv_func_fabsl_use = x"yes"; then
+
+for ac_func in fabsl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7644: 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 7649 "configure"
-#include "confdefs.h"
+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. */
-#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:7672: \"$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 "$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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _fabsl declaration" >&5
+echo $ECHO_N "checking for _fabsl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__fabsl_use+set} != xset; then
+ if test "${glibcxx_cv_func__fabsl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _fabsl(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
+ glibcxx_cv_func__fabsl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fabsl_use=no
fi
-rm -f conftest*
+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
-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
-LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fabsl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fabsl_use" >&6
+
+ if test x$glibcxx_cv_func__fabsl_use = x"yes"; then
+
+for ac_func in _fabsl
+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
fi
- if test -n "$LIBMATHOBJS"; then
- need_libmath=yes
- fi
-
-
-
- echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:7707: checking for mbstate_t" >&5
- cat > conftest.$ac_ext <<EOF
-#line 7709 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-mbstate_t teststate;
-; return 0; }
-EOF
-if { (eval echo configure:7716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- have_mbstate_t=yes
+
+ echo "$as_me:$LINENO: checking for fmodl declaration" >&5
+echo $ECHO_N "checking for fmodl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_fmodl_use+set} != xset; then
+ if test "${glibcxx_cv_func_fmodl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- have_mbstate_t=no
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ fmodl(0, 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
+ glibcxx_cv_func_fmodl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fmodl_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
-rm -f conftest*
- echo "$ac_t""$have_mbstate_t" 1>&6
- if test x"$have_mbstate_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MBSTATE_T 1
-EOF
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fmodl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fmodl_use" >&6
+
+ if test x$glibcxx_cv_func_fmodl_use = x"yes"; then
- for ac_hdr in wchar.h
+for ac_func in fmodl
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7738: 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
+ 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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _fmodl declaration" >&5
+echo $ECHO_N "checking for _fmodl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__fmodl_use+set} != xset; then
+ if test "${glibcxx_cv_func__fmodl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 7743 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7748: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _fmodl(0, 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
+ glibcxx_cv_func__fmodl_use=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
+
+glibcxx_cv_func__fmodl_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wchar_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wchar_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fmodl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fmodl_use" >&6
+
+ if test x$glibcxx_cv_func__fmodl_use = x"yes"; then
+
+for ac_func in _fmodl
+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
- for ac_hdr in wctype.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7779: 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
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for frexpl declaration" >&5
+echo $ECHO_N "checking for frexpl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_frexpl_use+set} != xset; then
+ if test "${glibcxx_cv_func_frexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 7784 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7789: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ frexpl(0, 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
+ glibcxx_cv_func_frexpl_use=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
+
+glibcxx_cv_func_frexpl_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wctype_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wctype_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_frexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_frexpl_use" >&6
+
+ if test x$glibcxx_cv_func_frexpl_use = x"yes"; then
+
+for ac_func in frexpl
+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
+ else
- if test x"$ac_has_wchar_h" = xyes &&
- test x"$ac_has_wctype_h" = xyes &&
- test x"$enable_c_mbchar" != xno; then
+ echo "$as_me:$LINENO: checking for _frexpl declaration" >&5
+echo $ECHO_N "checking for _frexpl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__frexpl_use+set} != xset; then
+ if test "${glibcxx_cv_func__frexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:7822: checking for WCHAR_MIN and WCHAR_MAX" >&5
- cat > conftest.$ac_ext <<EOF
-#line 7824 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-int i = WCHAR_MIN; int j = WCHAR_MAX;
-; return 0; }
-EOF
-if { (eval echo configure:7831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_wchar_minmax=yes
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _frexpl(0, 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
+ glibcxx_cv_func__frexpl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_wchar_minmax=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__frexpl_use=no
fi
-rm -f conftest*
- echo "$ac_t""$has_wchar_minmax" 1>&6
+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
- echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:7844: checking for WEOF" >&5
- cat > conftest.$ac_ext <<EOF
-#line 7846 "configure"
-#include "confdefs.h"
- #include <wchar.h>
- #include <stddef.h>
-int main() {
-wint_t i = WEOF;
-; return 0; }
-EOF
-if { (eval echo configure:7855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_weof=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_weof=no
fi
-rm -f conftest*
- echo "$ac_t""$has_weof" 1>&6
- ac_wfuncs=yes
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__frexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__frexpl_use" >&6
+
+ if test x$glibcxx_cv_func__frexpl_use = x"yes"; then
+
+for ac_func in _frexpl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7871: 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 7876 "configure"
-#include "confdefs.h"
+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. */
-#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:7899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for hypotl declaration" >&5
+echo $ECHO_N "checking for hypotl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_hypotl_use+set} != xset; then
+ if test "${glibcxx_cv_func_hypotl_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 <math.h>
+int
+main ()
+{
+ hypotl(0, 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
+ glibcxx_cv_func_hypotl_use=yes
else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_hypotl_use=no
fi
-done
+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
- for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
- fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
- vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
- mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
- wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_hypotl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_hypotl_use" >&6
+
+ if test x$glibcxx_cv_func_hypotl_use = x"yes"; then
+
+for ac_func in hypotl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7934: 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 7939 "configure"
-#include "confdefs.h"
+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. */
-#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:7962: \"$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 "$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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _hypotl declaration" >&5
+echo $ECHO_N "checking for _hypotl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__hypotl_use+set} != xset; then
+ if test "${glibcxx_cv_func__hypotl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _hypotl(0, 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
+ glibcxx_cv_func__hypotl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__hypotl_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__hypotl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__hypotl_use" >&6
+
+ if test x$glibcxx_cv_func__hypotl_use = x"yes"; then
+
+for ac_func in _hypotl
+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
-
- echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:7990: checking for ISO C99 wchar_t support" >&5
- if test x"$has_weof" = xyes &&
- test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
- ac_isoC99_wchar_t=yes
- else
- ac_isoC99_wchar_t=no
fi
- echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
+ fi
+
- ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:8002: checking for iconv.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for ldexpl declaration" >&5
+echo $ECHO_N "checking for ldexpl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_ldexpl_use+set} != xset; then
+ if test "${glibcxx_cv_func_ldexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8007 "configure"
-#include "confdefs.h"
-#include <iconv.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8012: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ ldexpl(0, 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
+ glibcxx_cv_func_ldexpl_use=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
+
+glibcxx_cv_func_ldexpl_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_iconv_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_iconv_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_ldexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_ldexpl_use" >&6
+
+ if test x$glibcxx_cv_func_ldexpl_use = x"yes"; then
+
+for ac_func in ldexpl
+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
+
+ else
- ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:8036: checking for langinfo.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for _ldexpl declaration" >&5
+echo $ECHO_N "checking for _ldexpl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__ldexpl_use+set} != xset; then
+ if test "${glibcxx_cv_func__ldexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8041 "configure"
-#include "confdefs.h"
-#include <langinfo.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8046: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _ldexpl(0, 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
+ glibcxx_cv_func__ldexpl_use=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*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__ldexpl_use=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_langinfo_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_langinfo_h=no
+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__ldexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__ldexpl_use" >&6
- echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:8070: checking for iconv in -liconv" >&5
-ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-liconv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8078 "configure"
-#include "confdefs.h"
+ if test x$glibcxx_cv_func__ldexpl_use = x"yes"; then
+
+for ac_func in _ldexpl
+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 iconv();
+ 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() {
-iconv()
-; return 0; }
-EOF
-if { (eval echo configure:8089: \"$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"
+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
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- libiconv="-liconv"
+done
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for logl declaration" >&5
+echo $ECHO_N "checking for logl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_logl_use+set} != xset; then
+ if test "${glibcxx_cv_func_logl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ logl(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
+ glibcxx_cv_func_logl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_logl_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
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libiconv"
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_logl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_logl_use" >&6
+
+ if test x$glibcxx_cv_func_logl_use = x"yes"; then
- for ac_func in iconv_open iconv_close iconv nl_langinfo
+for ac_func in logl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8115: 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 8120 "configure"
-#include "confdefs.h"
+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. */
-#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:8143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
- \
- ac_XPG2funcs=yes
+ else
+
+ echo "$as_me:$LINENO: checking for _logl declaration" >&5
+echo $ECHO_N "checking for _logl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__logl_use+set} != xset; then
+ if test "${glibcxx_cv_func__logl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-ac_XPG2funcs=no
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _logl(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
+ glibcxx_cv_func__logl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__logl_use=no
fi
-done
+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
- LIBS="$ac_save_LIBS"
+fi
- echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:8173: checking for XPG2 wchar_t support" >&5
- if test x"$ac_has_iconv_h" = xyes &&
- test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
- ac_XPG2_wchar_t=yes
- else
- ac_XPG2_wchar_t=no
- fi
- echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__logl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__logl_use" >&6
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCXX_USE_WCHAR_T 1
-EOF
+ if test x$glibcxx_cv_func__logl_use = x"yes"; then
+
+for ac_func in _logl
+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
- enable_wchar_t=yes
fi
fi
- echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:8193: checking for enabled wchar_t specializations" >&5
- echo "$ac_t""$enable_wchar_t" 1>&6
- ;;
- *-netbsd*)
- os_include_dir="os/bsd/netbsd"
- for ac_hdr in 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
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8205: 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 8210 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8215: \"$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"
+
+
+ echo "$as_me:$LINENO: checking for log10l declaration" >&5
+echo $ECHO_N "checking for log10l declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_log10l_use+set} != xset; then
+ if test "${glibcxx_cv_func_log10l_use+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*
- 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
-
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ log10l(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
+ glibcxx_cv_func_log10l_use=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_log10l_use=no
fi
-done
+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
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
-
-
- # If we're not using GNU ld, then there's no point in even trying these
- # tests. Check for that first. We should have already tested for gld
- # by now (in libtool), but require it now just to be safe...
- test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
- test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
- # The name set by libtool depends on the version of libtool. Shame on us
- # for depending on an impl detail, but c'est la vie. Older versions used
- # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
- # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
- # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
- # set (hence we're using an older libtool), then set it.
- if test x${with_gnu_ld+set} != xset; then
- if test x${ac_cv_prog_gnu_ld+set} != xset; then
- # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
- with_gnu_ld=no
- else
- with_gnu_ld=$ac_cv_prog_gnu_ld
- fi
+fi
+
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_log10l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_log10l_use" >&6
- # Start by getting the version number. I think the libtool test already
- # does some of this, but throws away the result.
-
- ldver=`$LD --version 2>/dev/null | head -1 | \
- sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-
- glibcxx_gnu_ld_version=`echo $ldver | \
- $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
+ if test x$glibcxx_cv_func_log10l_use = x"yes"; then
- # Set --gc-sections.
- if test "$with_gnu_ld" = "notbroken"; then
- # GNU ld it is! Joy and bunny rabbits!
+for ac_func in log10l
+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
- # All these tests are for C++; save the language and the compiler flags.
- # Need to do this so that g++ won't try to link in libstdc++
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-x c++ -Wl,--gc-sections'
+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
- # Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
- echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:8293: checking for ld that supports -Wl,--gc-sections" >&5
- if test "$cross_compiling" = yes; then
- ac_sectionLDflags=yes
+fi
+done
+
+ else
+
+ echo "$as_me:$LINENO: checking for _log10l declaration" >&5
+echo $ECHO_N "checking for _log10l declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__log10l_use+set} != xset; then
+ if test "${glibcxx_cv_func__log10l_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8298 "configure"
-#include "confdefs.h"
- int main(void)
- {
- try { throw 1; }
- catch (...) { };
- return 0;
- }
-
-EOF
-if { (eval echo configure:8309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_sectionLDflags=yes
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _log10l(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
+ glibcxx_cv_func__log10l_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_sectionLDflags=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__log10l_use=no
fi
-rm -fr conftest*
+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
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
- fi
- if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
- fi
- echo "$ac_t""$ac_sectionLDflags" 1>&6
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__log10l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__log10l_use" >&6
- # Set linker optimization flags.
- if test x"$with_gnu_ld" = x"yes"; then
- OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ if test x$glibcxx_cv_func__log10l_use = x"yes"; then
+
+for ac_func in _log10l
+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
fi
-
-
-
- echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:8343: checking for main in -lm" >&5
-ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for modfl declaration" >&5
+echo $ECHO_N "checking for modfl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_modfl_use+set} != xset; then
+ if test "${glibcxx_cv_func_modfl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8351 "configure"
-#include "confdefs.h"
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:8358: \"$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"
+
+
+ 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 <math.h>
+int
+main ()
+{
+ modfl(0, 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
+ glibcxx_cv_func_modfl_use=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
+glibcxx_cv_func_modfl_use=no
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+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
- LIBS="-lm $LIBS"
-else
- echo "$ac_t""no" 1>&6
fi
- for ac_func in nan copysignf
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_modfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_modfl_use" >&6
+
+ if test x$glibcxx_cv_func_modfl_use = x"yes"; then
+
+for ac_func in modfl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8388: 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 8393 "configure"
-#include "confdefs.h"
+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. */
-#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:8416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _modfl declaration" >&5
+echo $ECHO_N "checking for _modfl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__modfl_use+set} != xset; then
+ if test "${glibcxx_cv_func__modfl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _modfl(0, 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
+ glibcxx_cv_func__modfl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__modfl_use=no
fi
-done
+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
- for ac_func in __signbit
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__modfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__modfl_use" >&6
+
+ if test x$glibcxx_cv_func__modfl_use = x"yes"; then
+
+for ac_func in _modfl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8445: 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 8450 "configure"
-#include "confdefs.h"
+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. */
-#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:8473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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
-
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for powl declaration" >&5
+echo $ECHO_N "checking for powl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_powl_use+set} != xset; then
+ if test "${glibcxx_cv_func_powl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ powl(0, 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
+ glibcxx_cv_func_powl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_powl_use=no
fi
-done
+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
+
- for ac_func in __signbitf
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_powl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_powl_use" >&6
+
+ if test x$glibcxx_cv_func_powl_use = x"yes"; then
+
+for ac_func in powl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8501: 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 8506 "configure"
-#include "confdefs.h"
+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. */
-#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:8529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+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
-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 "$as_me:$LINENO: checking for _powl declaration" >&5
+echo $ECHO_N "checking for _powl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__powl_use+set} != xset; then
+ if test "${glibcxx_cv_func__powl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _powl(0, 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
+ glibcxx_cv_func__powl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__powl_use=no
fi
-done
+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
- if test x$ac_cv_func_copysignl = x"yes"; then
- for ac_func in __signbitl
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__powl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__powl_use" >&6
+
+ if test x$glibcxx_cv_func__powl_use = x"yes"; then
+
+for ac_func in _powl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8559: 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 8564 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for sqrtl declaration" >&5
+echo $ECHO_N "checking for sqrtl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_sqrtl_use+set} != xset; then
+ if test "${glibcxx_cv_func_sqrtl_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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ sqrtl(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
+ glibcxx_cv_func_sqrtl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sqrtl_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_sqrtl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sqrtl_use" >&6
+
+ if test x$glibcxx_cv_func_sqrtl_use = x"yes"; then
+
+for ac_func in sqrtl
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:8587: \"$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 "$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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _sqrtl declaration" >&5
+echo $ECHO_N "checking for _sqrtl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__sqrtl_use+set} != xset; then
+ if test "${glibcxx_cv_func__sqrtl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _sqrtl(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
+ glibcxx_cv_func__sqrtl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sqrtl_use=no
fi
-rm -f conftest*
+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
-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
-LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sqrtl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sqrtl_use" >&6
+
+ if test x$glibcxx_cv_func__sqrtl_use = x"yes"; then
+
+for ac_func in _sqrtl
+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
fi
- if test -n "$LIBMATHOBJS"; then
- need_libmath=yes
- fi
-
-
-
- echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:8622: checking for mbstate_t" >&5
- cat > conftest.$ac_ext <<EOF
-#line 8624 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-mbstate_t teststate;
-; return 0; }
-EOF
-if { (eval echo configure:8631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- have_mbstate_t=yes
+
+ echo "$as_me:$LINENO: checking for sincosl declaration" >&5
+echo $ECHO_N "checking for sincosl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_sincosl_use+set} != xset; then
+ if test "${glibcxx_cv_func_sincosl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- have_mbstate_t=no
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ sincosl(0, 0, 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
+ glibcxx_cv_func_sincosl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sincosl_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
-rm -f conftest*
- echo "$ac_t""$have_mbstate_t" 1>&6
- if test x"$have_mbstate_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MBSTATE_T 1
-EOF
fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sincosl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sincosl_use" >&6
- for ac_hdr in wchar.h
+ if test x$glibcxx_cv_func_sincosl_use = x"yes"; then
+
+for ac_func in sincosl
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8653: 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
+ 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
+
+ else
+
+ echo "$as_me:$LINENO: checking for _sincosl declaration" >&5
+echo $ECHO_N "checking for _sincosl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__sincosl_use+set} != xset; then
+ if test "${glibcxx_cv_func__sincosl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8658 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8663: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ _sincosl(0, 0, 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
+ glibcxx_cv_func__sincosl_use=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
+
+glibcxx_cv_func__sincosl_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wchar_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wchar_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sincosl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sincosl_use" >&6
+
+ if test x$glibcxx_cv_func__sincosl_use = x"yes"; then
+
+for ac_func in _sincosl
+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
- for ac_hdr in wctype.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8694: 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
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for finitel declaration" >&5
+echo $ECHO_N "checking for finitel declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_finitel_use+set} != xset; then
+ if test "${glibcxx_cv_func_finitel_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8699 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8704: \"$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"
+
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ finitel(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
+ glibcxx_cv_func_finitel_use=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
+
+glibcxx_cv_func_finitel_use=no
fi
-rm -f conftest*
+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
-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
- ac_has_wctype_h=yes
-else
- echo "$ac_t""no" 1>&6
-ac_has_wctype_h=no
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_finitel_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_finitel_use" >&6
+
+ if test x$glibcxx_cv_func_finitel_use = x"yes"; then
+
+for ac_func in finitel
+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
+ else
- if test x"$ac_has_wchar_h" = xyes &&
- test x"$ac_has_wctype_h" = xyes &&
- test x"$enable_c_mbchar" != xno; then
+ echo "$as_me:$LINENO: checking for _finitel declaration" >&5
+echo $ECHO_N "checking for _finitel declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func__finitel_use+set} != xset; then
+ if test "${glibcxx_cv_func__finitel_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:8737: checking for WCHAR_MIN and WCHAR_MAX" >&5
- cat > conftest.$ac_ext <<EOF
-#line 8739 "configure"
-#include "confdefs.h"
-#include <wchar.h>
-int main() {
-int i = WCHAR_MIN; int j = WCHAR_MAX;
-; return 0; }
-EOF
-if { (eval echo configure:8746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_wchar_minmax=yes
+
+
+ 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 <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
+int
+main ()
+{
+ _finitel(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
+ glibcxx_cv_func__finitel_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_wchar_minmax=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__finitel_use=no
fi
-rm -f conftest*
- echo "$ac_t""$has_wchar_minmax" 1>&6
+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
- echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:8759: checking for WEOF" >&5
- cat > conftest.$ac_ext <<EOF
-#line 8761 "configure"
-#include "confdefs.h"
- #include <wchar.h>
- #include <stddef.h>
-int main() {
-wint_t i = WEOF;
-; return 0; }
-EOF
-if { (eval echo configure:8770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- has_weof=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_weof=no
fi
-rm -f conftest*
- echo "$ac_t""$has_weof" 1>&6
- ac_wfuncs=yes
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__finitel_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__finitel_use" >&6
+
+ if test x$glibcxx_cv_func__finitel_use = x"yes"; then
+
+for ac_func in _finitel
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8786: 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 8791 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+fi
+done
+
+ fi
+ fi
+
+
+
+
+ echo "$as_me:$LINENO: checking for _float trig functions" >&5
+echo $ECHO_N "checking for _float trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__float_trig_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 <math.h>
+int
+main ()
+{
+ `for x in _acosf _asinf _atanf \
+ _cosf _sinf _tanf \
+ _coshf _sinhf _tanhf; do echo "$x (0);"; done`
+ ;
+ 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__float_trig_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__float_trig_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
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__float_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__float_trig_use" >&6
+ if test x$glibcxx_cv_func__float_trig_use = x"yes"; then
+
+
-int main() {
+
+
+
+
+
+for ac_func in _acosf _asinf _atanf \
+ _cosf _sinf _tanf \
+ _coshf _sinhf _tanhf
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:8814: \"$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 "$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
+
+
+ echo "$as_me:$LINENO: checking for _float round functions" >&5
+echo $ECHO_N "checking for _float round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__float_round_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ `for x in _ceilf _floorf; do echo "$x (0);"; done`
+ ;
+ 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__float_round_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__float_round_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__float_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__float_round_use" >&6
+ if test x$glibcxx_cv_func__float_round_use = x"yes"; then
+
+
+for ac_func in _ceilf _floorf
+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
- for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
- fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
- vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
- mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
- wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8849: 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
+
+
+ echo "$as_me:$LINENO: checking for _long double trig functions" >&5
+echo $ECHO_N "checking for _long double trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__long_double_trig_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8854 "configure"
-#include "confdefs.h"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ `for x in _acosl _asinl _atanl \
+ _cosl _sinl _tanl \
+ _coshl _sinhl _tanhl; do echo "$x (0);"; done`
+ ;
+ 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__long_double_trig_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__long_double_trig_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
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__long_double_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__long_double_trig_use" >&6
+ if test x$glibcxx_cv_func__long_double_trig_use = x"yes"; then
+
+
+
+
+
+
+
+
+
+for ac_func in _acosl _asinl _atanl \
+ _cosl _sinl _tanl \
+ _coshl _sinhl _tanhl
+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. */
-#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
-int main() {
+fi
+done
+
+ fi
+
+
+ echo "$as_me:$LINENO: checking for _long double round functions" >&5
+echo $ECHO_N "checking for _long double round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__long_double_round_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 <math.h>
+int
+main ()
+{
+ `for x in _ceill _floorl; do echo "$x (0);"; done`
+ ;
+ 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__long_double_round_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+glibcxx_cv_func__long_double_round_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
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__long_double_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__long_double_round_use" >&6
+ if test x$glibcxx_cv_func__long_double_round_use = x"yes"; then
+
+
+for ac_func in _ceill _floorl
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:8877: \"$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 "$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
+
+
+ LIBS="$ac_save_LIBS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
+
+
+
+ echo "$as_me:$LINENO: checking for __builtin_abs declaration" >&5
+echo $ECHO_N "checking for __builtin_abs declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_abs_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_abs_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_abs(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
+ glibcxx_cv_func___builtin_abs_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_abs_use=no
fi
-rm -f conftest*
+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
-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
-
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_use" >&6
+ if test x$glibcxx_cv_func___builtin_abs_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_abs linkage" >&5
+echo $ECHO_N "checking for __builtin_abs linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_abs_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_abs_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_abs(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
+ glibcxx_cv_func___builtin_abs_link=yes
else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_abs_link=no
fi
-done
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
- echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:8905: checking for ISO C99 wchar_t support" >&5
- if test x"$has_weof" = xyes &&
- test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
- ac_isoC99_wchar_t=yes
- else
- ac_isoC99_wchar_t=no
fi
- echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_link" >&6
+ if test x$glibcxx_cv_func___builtin_abs_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_abs | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
+ fi
- ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:8917: checking for iconv.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for __builtin_fabsf declaration" >&5
+echo $ECHO_N "checking for __builtin_fabsf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_fabsf_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_fabsf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8922 "configure"
-#include "confdefs.h"
-#include <iconv.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8927: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_fabsf(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
+ glibcxx_cv_func___builtin_fabsf_use=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
+
+glibcxx_cv_func___builtin_fabsf_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_iconv_h=yes
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_use" >&6
+ if test x$glibcxx_cv_func___builtin_fabsf_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_fabsf linkage" >&5
+echo $ECHO_N "checking for __builtin_fabsf linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_fabsf_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_fabsf_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_fabsf(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
+ glibcxx_cv_func___builtin_fabsf_link=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_iconv_h=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabsf_link=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_link" >&6
+ if test x$glibcxx_cv_func___builtin_fabsf_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_fabsf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
- ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:8951: checking for langinfo.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ fi
+ fi
+
+
+ echo "$as_me:$LINENO: checking for __builtin_fabs declaration" >&5
+echo $ECHO_N "checking for __builtin_fabs declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_fabs_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_fabs_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8956 "configure"
-#include "confdefs.h"
-#include <langinfo.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8961: \"$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"
+
+
+
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_fabs(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
+ glibcxx_cv_func___builtin_fabs_use=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
+
+glibcxx_cv_func___builtin_fabs_use=no
fi
-rm -f conftest*
+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
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_has_langinfo_h=yes
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_use" >&6
+ if test x$glibcxx_cv_func___builtin_fabs_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_fabs linkage" >&5
+echo $ECHO_N "checking for __builtin_fabs linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_fabs_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_fabs_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_fabs(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
+ glibcxx_cv_func___builtin_fabs_link=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_langinfo_h=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabs_link=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
- echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:8985: checking for iconv in -liconv" >&5
-ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_link" >&6
+ if test x$glibcxx_cv_func___builtin_fabs_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_fabs | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
+ fi
+
+
+ echo "$as_me:$LINENO: checking for __builtin_fabsl declaration" >&5
+echo $ECHO_N "checking for __builtin_fabsl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_fabsl_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_fabsl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-liconv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8993 "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 iconv();
-int main() {
-iconv()
-; return 0; }
-EOF
-if { (eval echo configure:9004: \"$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"
+
+
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_fabsl(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
+ glibcxx_cv_func___builtin_fabsl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabsl_use=no
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+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
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- libiconv="-liconv"
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_use" >&6
+ if test x$glibcxx_cv_func___builtin_fabsl_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_fabsl linkage" >&5
+echo $ECHO_N "checking for __builtin_fabsl linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_fabsl_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_fabsl_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_fabsl(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
+ glibcxx_cv_func___builtin_fabsl_link=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabsl_link=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libiconv"
+fi
- for ac_func in iconv_open iconv_close iconv nl_langinfo
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9030: 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
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_link" >&6
+ if test x$glibcxx_cv_func___builtin_fabsl_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_fabsl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
+ fi
+
+
+ echo "$as_me:$LINENO: checking for __builtin_labs declaration" >&5
+echo $ECHO_N "checking for __builtin_labs declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_labs_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_labs_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 9035 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-int main() {
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-; return 0; }
-EOF
-if { (eval echo configure:9058: \"$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"
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_labs(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
+ glibcxx_cv_func___builtin_labs_use=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
+
+glibcxx_cv_func___builtin_labs_use=no
fi
-rm -f conftest*
+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
-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
- \
- ac_XPG2funcs=yes
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_use" >&6
+ if test x$glibcxx_cv_func___builtin_labs_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_labs linkage" >&5
+echo $ECHO_N "checking for __builtin_labs linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_labs_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_labs_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_labs(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
+ glibcxx_cv_func___builtin_labs_link=yes
else
- echo "$ac_t""no" 1>&6
-ac_XPG2funcs=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_labs_link=no
fi
-done
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
- LIBS="$ac_save_LIBS"
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_link" >&6
+ if test x$glibcxx_cv_func___builtin_labs_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_labs | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
- echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:9088: checking for XPG2 wchar_t support" >&5
- if test x"$ac_has_iconv_h" = xyes &&
- test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
- ac_XPG2_wchar_t=yes
- else
- ac_XPG2_wchar_t=no
fi
- echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
+ fi
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCXX_USE_WCHAR_T 1
-EOF
- enable_wchar_t=yes
+
+ echo "$as_me:$LINENO: checking for __builtin_sqrtf declaration" >&5
+echo $ECHO_N "checking for __builtin_sqrtf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sqrtf_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sqrtf_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 <math.h>
+int
+main ()
+{
+ __builtin_sqrtf(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
+ glibcxx_cv_func___builtin_sqrtf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtf_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___builtin_sqrtf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_use" >&6
+ if test x$glibcxx_cv_func___builtin_sqrtf_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_sqrtf linkage" >&5
+echo $ECHO_N "checking for __builtin_sqrtf linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sqrtf_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sqrtf_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_sqrtf(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
+ glibcxx_cv_func___builtin_sqrtf_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtf_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_link" >&6
+ if test x$glibcxx_cv_func___builtin_sqrtf_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_sqrtf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
fi
fi
- echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:9108: checking for enabled wchar_t specializations" >&5
- echo "$ac_t""$enable_wchar_t" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGN 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGNF 1
-EOF
+ echo "$as_me:$LINENO: checking for __builtin_sqrt declaration" >&5
+echo $ECHO_N "checking for __builtin_sqrt declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sqrt_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sqrt_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITEF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITE 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FREXPF 1
-EOF
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_sqrt(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
+ glibcxx_cv_func___builtin_sqrt_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >> confdefs.h <<\EOF
-#define HAVE_HYPOTF 1
-EOF
+glibcxx_cv_func___builtin_sqrt_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
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINFF 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNAN 1
-EOF
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_use" >&6
+ if test x$glibcxx_cv_func___builtin_sqrt_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_sqrt linkage" >&5
+echo $ECHO_N "checking for __builtin_sqrt linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sqrt_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sqrt_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_sqrt(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
+ glibcxx_cv_func___builtin_sqrt_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANF 1
-EOF
+glibcxx_cv_func___builtin_sqrt_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_FINITEL 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_ISINFL 1
-EOF
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_link" >&6
+ if test x$glibcxx_cv_func___builtin_sqrt_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_sqrt | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANL 1
-EOF
+ fi
+ fi
- fi
- ;;
- *-qnx6.1* | *-qnx6.2*)
- os_include_dir="os/qnx/qnx6.1"
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
-
-
- # If we're not using GNU ld, then there's no point in even trying these
- # tests. Check for that first. We should have already tested for gld
- # by now (in libtool), but require it now just to be safe...
- test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
- test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
- # The name set by libtool depends on the version of libtool. Shame on us
- # for depending on an impl detail, but c'est la vie. Older versions used
- # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
- # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
- # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
- # set (hence we're using an older libtool), then set it.
- if test x${with_gnu_ld+set} != xset; then
- if test x${ac_cv_prog_gnu_ld+set} != xset; then
- # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
- with_gnu_ld=no
- else
- with_gnu_ld=$ac_cv_prog_gnu_ld
+ echo "$as_me:$LINENO: checking for __builtin_sqrtl declaration" >&5
+echo $ECHO_N "checking for __builtin_sqrtl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sqrtl_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sqrtl_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 <math.h>
+int
+main ()
+{
+ __builtin_sqrtl(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
+ glibcxx_cv_func___builtin_sqrtl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtl_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___builtin_sqrtl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_use" >&6
+ if test x$glibcxx_cv_func___builtin_sqrtl_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_sqrtl linkage" >&5
+echo $ECHO_N "checking for __builtin_sqrtl linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sqrtl_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sqrtl_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_sqrtl(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
+ glibcxx_cv_func___builtin_sqrtl_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtl_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_link" >&6
+ if test x$glibcxx_cv_func___builtin_sqrtl_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_sqrtl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
fi
fi
- # Start by getting the version number. I think the libtool test already
- # does some of this, but throws away the result.
-
- ldver=`$LD --version 2>/dev/null | head -1 | \
- sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-
- glibcxx_gnu_ld_version=`echo $ldver | \
- $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
- # Set --gc-sections.
- if test "$with_gnu_ld" = "notbroken"; then
- # GNU ld it is! Joy and bunny rabbits!
- # All these tests are for C++; save the language and the compiler flags.
- # Need to do this so that g++ won't try to link in libstdc++
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-x c++ -Wl,--gc-sections'
+ echo "$as_me:$LINENO: checking for __builtin_sinf declaration" >&5
+echo $ECHO_N "checking for __builtin_sinf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sinf_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sinf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- # Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
- echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:9220: checking for ld that supports -Wl,--gc-sections" >&5
- if test "$cross_compiling" = yes; then
- ac_sectionLDflags=yes
+
+
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_sinf(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
+ glibcxx_cv_func___builtin_sinf_use=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 9225 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- int main(void)
- {
- try { throw 1; }
- catch (...) { };
- return 0;
- }
-
-EOF
-if { (eval echo configure:9236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_sectionLDflags=yes
+glibcxx_cv_func___builtin_sinf_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___builtin_sinf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_use" >&6
+ if test x$glibcxx_cv_func___builtin_sinf_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_sinf linkage" >&5
+echo $ECHO_N "checking for __builtin_sinf linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sinf_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sinf_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_sinf(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
+ glibcxx_cv_func___builtin_sinf_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_sectionLDflags=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sinf_link=no
fi
-rm -fr conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
fi
- if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_link" >&6
+ if test x$glibcxx_cv_func___builtin_sinf_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_sinf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
fi
- echo "$ac_t""$ac_sectionLDflags" 1>&6
fi
- # Set linker optimization flags.
- if test x"$with_gnu_ld" = x"yes"; then
- OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+
+ echo "$as_me:$LINENO: checking for __builtin_sin declaration" >&5
+echo $ECHO_N "checking for __builtin_sin declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sin_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sin_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 <math.h>
+int
+main ()
+{
+ __builtin_sin(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
+ glibcxx_cv_func___builtin_sin_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sin_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___builtin_sin_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_use" >&6
+ if test x$glibcxx_cv_func___builtin_sin_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_sin linkage" >&5
+echo $ECHO_N "checking for __builtin_sin linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sin_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sin_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_sin(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
+ glibcxx_cv_func___builtin_sin_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sin_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_link" >&6
+ if test x$glibcxx_cv_func___builtin_sin_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_sin | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
fi
-
-
-
- echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:9270: checking for main in -lm" >&5
-ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for __builtin_sinl declaration" >&5
+echo $ECHO_N "checking for __builtin_sinl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sinl_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sinl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9278 "configure"
-#include "confdefs.h"
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:9285: \"$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"
+
+
+ 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 <math.h>
+int
+main ()
+{
+ __builtin_sinl(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
+ glibcxx_cv_func___builtin_sinl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sinl_use=no
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+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
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
- LIBS="-lm $LIBS"
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_use" >&6
+ if test x$glibcxx_cv_func___builtin_sinl_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_sinl linkage" >&5
+echo $ECHO_N "checking for __builtin_sinl linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_sinl_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_sinl_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_sinl(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
+ glibcxx_cv_func___builtin_sinl_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sinl_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_link" >&6
+ if test x$glibcxx_cv_func___builtin_sinl_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_sinl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for __builtin_cosf declaration" >&5
+echo $ECHO_N "checking for __builtin_cosf declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_cosf_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_cosf_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 <math.h>
+int
+main ()
+{
+ __builtin_cosf(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
+ glibcxx_cv_func___builtin_cosf_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+glibcxx_cv_func___builtin_cosf_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___builtin_cosf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_use" >&6
+ if test x$glibcxx_cv_func___builtin_cosf_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_cosf linkage" >&5
+echo $ECHO_N "checking for __builtin_cosf linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_cosf_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_cosf_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_cosf(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
+ glibcxx_cv_func___builtin_cosf_link=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cosf_link=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- for ac_func in nan copysignf
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9315: 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
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_link" >&6
+ if test x$glibcxx_cv_func___builtin_cosf_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_cosf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
+ fi
+
+
+ echo "$as_me:$LINENO: checking for __builtin_cos declaration" >&5
+echo $ECHO_N "checking for __builtin_cos declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_cos_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_cos_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 <math.h>
+int
+main ()
+{
+ __builtin_cos(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
+ glibcxx_cv_func___builtin_cos_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cos_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___builtin_cos_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_use" >&6
+ if test x$glibcxx_cv_func___builtin_cos_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_cos linkage" >&5
+echo $ECHO_N "checking for __builtin_cos linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_cos_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_cos_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_cos(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
+ glibcxx_cv_func___builtin_cos_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cos_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_link" >&6
+ if test x$glibcxx_cv_func___builtin_cos_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_cos | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
+ fi
+
+
+ echo "$as_me:$LINENO: checking for __builtin_cosl declaration" >&5
+echo $ECHO_N "checking for __builtin_cosl declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_cosl_use+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_cosl_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 <math.h>
+int
+main ()
+{
+ __builtin_cosl(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
+ glibcxx_cv_func___builtin_cosl_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cosl_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___builtin_cosl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_use" >&6
+ if test x$glibcxx_cv_func___builtin_cosl_use = x"yes"; then
+ echo "$as_me:$LINENO: checking for __builtin_cosl linkage" >&5
+echo $ECHO_N "checking for __builtin_cosl linkage... $ECHO_C" >&6
+ if test x${glibcxx_cv_func___builtin_cosl_link+set} != xset; then
+ if test "${glibcxx_cv_func___builtin_cosl_link+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. */
+#include <math.h>
+int
+main ()
+{
+ __builtin_cosl(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
+ glibcxx_cv_func___builtin_cosl_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cosl_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_link" >&6
+ if test x$glibcxx_cv_func___builtin_cosl_link = x"yes"; then
+ ac_tr_func=HAVE_`echo __builtin_cosl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >>confdefs.h <<_ACEOF
+#define ${ac_tr_func} 1
+_ACEOF
+
+ fi
+ fi
+
+
+ dummyvar=no
+ if test x$dummyvar = x"yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_ABS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_LABS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_COS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_COSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_COSL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_FABS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_FABSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_FABSL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_SIN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_SINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_SINL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_SQRT 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_SQRTF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE___BUILTIN_SQRTL 1
+_ACEOF
+
+ fi
+
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 9320 "configure"
-#include "confdefs.h"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+
+for ac_func in nan copysignf
+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. */
-#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:9343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
fi
done
- for ac_func in __signbit
+
+for ac_func in __signbit
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9372: 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 9377 "configure"
-#include "confdefs.h"
+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. */
-#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:9400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
fi
done
- for ac_func in __signbitf
+
+for ac_func in __signbitf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9428: 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 9433 "configure"
-#include "confdefs.h"
+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. */
-#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:9456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
fi
done
if test x$ac_cv_func_copysignl = x"yes"; then
- for ac_func in __signbitl
+
+for ac_func in __signbitl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9486: 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 9491 "configure"
-#include "confdefs.h"
+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. */
-#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:9514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
fi
done
fi
+ # XXX Review this. Nothing uses it.
if test -n "$LIBMATHOBJS"; then
need_libmath=yes
fi
-
-
-
- echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:9549: checking for mbstate_t" >&5
- cat > conftest.$ac_ext <<EOF
-#line 9551 "configure"
-#include "confdefs.h"
+
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
-int main() {
+int
+main ()
+{
mbstate_t teststate;
-; return 0; }
-EOF
-if { (eval echo configure:9558: \"$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
have_mbstate_t=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- have_mbstate_t=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+have_mbstate_t=no
fi
-rm -f conftest*
- echo "$ac_t""$have_mbstate_t" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
if test x"$have_mbstate_t" = xyes; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_MBSTATE_T 1
-EOF
+_ACEOF
fi
- for ac_hdr in wchar.h
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9580: 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 9585 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9590: \"$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"
+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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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 `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
ac_has_wchar_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_wchar_h=no
+ ac_has_wchar_h=no
fi
+
done
- for ac_hdr in wctype.h
+
+for ac_header in wctype.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9621: 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 9626 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9631: \"$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"
+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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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 `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
ac_has_wctype_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_wctype_h=no
+ ac_has_wctype_h=no
fi
+
done
- if test x"$ac_has_wchar_h" = xyes &&
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
test x"$ac_has_wctype_h" = xyes &&
test x"$enable_c_mbchar" != xno; then
- echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:9664: checking for WCHAR_MIN and WCHAR_MAX" >&5
- cat > conftest.$ac_ext <<EOF
-#line 9666 "configure"
-#include "confdefs.h"
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
-int main() {
+int
+main ()
+{
int i = WCHAR_MIN; int j = WCHAR_MAX;
-; return 0; }
-EOF
-if { (eval echo configure:9673: \"$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
has_wchar_minmax=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_wchar_minmax=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
fi
-rm -f conftest*
- echo "$ac_t""$has_wchar_minmax" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
- echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:9686: checking for WEOF" >&5
- cat > conftest.$ac_ext <<EOF
-#line 9688 "configure"
-#include "confdefs.h"
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
#include <stddef.h>
-int main() {
+int
+main ()
+{
wint_t i = WEOF;
-; return 0; }
-EOF
-if { (eval echo configure:9697: \"$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
has_weof=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_weof=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
fi
-rm -f conftest*
- echo "$ac_t""$has_weof" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
+
- ac_wfuncs=yes
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9713: 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 9718 "configure"
-#include "confdefs.h"
+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. */
-#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:9741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+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
+
+else
+ ac_wfuncs=no
fi
done
- for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9776: 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 9781 "configure"
-#include "confdefs.h"
+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. */
-#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:9804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+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
+
+else
+ ac_wfuncs=no
fi
done
- echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:9832: checking for ISO C99 wchar_t support" >&5
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
if test x"$has_weof" = xyes &&
test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
+ test x"$ac_wfuncs" = xyes;
+ then
ac_isoC99_wchar_t=yes
else
ac_isoC99_wchar_t=no
fi
- echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
-
- ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:9844: checking for iconv.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 9849 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9854: \"$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"
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+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*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cv_header_iconv_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_iconv_h = yes; then
ac_has_iconv_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_iconv_h=no
+ ac_has_iconv_h=no
fi
- ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:9878: checking for langinfo.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 9883 "configure"
-#include "confdefs.h"
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9888: \"$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"
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+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*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cv_header_langinfo_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_langinfo_h = yes; then
ac_has_langinfo_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_langinfo_h=no
+ ac_has_langinfo_h=no
fi
- echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:9912: checking for iconv in -liconv" >&5
-ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9920 "configure"
-#include "confdefs.h"
+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. */
+
/* 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 iconv();
-
-int main() {
-iconv()
-; return 0; }
-EOF
-if { (eval echo configure:9931: \"$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
+ builtin and then its argument prototype would still apply. */
+char iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
libiconv="-liconv"
-else
- echo "$ac_t""no" 1>&6
fi
ac_save_LIBS="$LIBS"
LIBS="$LIBS $libiconv"
- for ac_func in iconv_open iconv_close iconv nl_langinfo
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9957: 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 9962 "configure"
-#include "confdefs.h"
+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. */
-#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:9985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- \
- ac_XPG2funcs=yes
-else
- echo "$ac_t""no" 1>&6
-ac_XPG2funcs=no
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
fi
done
LIBS="$ac_save_LIBS"
- echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:10015: checking for XPG2 wchar_t support" >&5
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
if test x"$ac_has_iconv_h" = xyes &&
test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
+ test x"$ac_XPG2funcs" = xyes;
+ then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
- echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
-
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_WCHAR_T 1
-EOF
+_ACEOF
enable_wchar_t=yes
fi
fi
- echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:10035: checking for enabled wchar_t specializations" >&5
- echo "$ac_t""$enable_wchar_t" 1>&6
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
- cat >> confdefs.h <<\EOF
-#define HAVE_COSF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_COSL 1
-EOF
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
- cat >> confdefs.h <<\EOF
-#define HAVE_COSHF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_COSHL 1
-EOF
+ echo "$as_me:$LINENO: checking for strtold declaration" >&5
+echo $ECHO_N "checking for strtold declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_strtold_use+set} != xset; then
+ if test "${glibcxx_cv_func_strtold_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_LOGF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_LOGL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_LOG10F 1
-EOF
+ 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 ()
+{
+ strtold(0, 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
+ glibcxx_cv_func_strtold_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >> confdefs.h <<\EOF
-#define HAVE_LOG10L 1
-EOF
+glibcxx_cv_func_strtold_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
- cat >> confdefs.h <<\EOF
-#define HAVE_SINF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_SINL 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_SINHF 1
-EOF
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_strtold_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_strtold_use" >&6
+ if test x$glibcxx_cv_func_strtold_use = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SINHL 1
-EOF
+for ac_func in strtold
+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
- ;;
- *-solaris*)
- case "$target" in
- *-solaris2.5)
- os_include_dir="os/solaris/solaris2.5"
- ;;
- *-solaris2.6)
- os_include_dir="os/solaris/solaris2.6"
- ;;
- *-solaris2.7 | *-solaris2.8 | *-solaris2.9)
- os_include_dir="os/solaris/solaris2.7"
- ;;
- esac
- cat >> confdefs.h <<\EOF
-#define HAVE_STRTOF 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_STRTOLD 1
-EOF
+fi
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_MMAP 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGN 1
-EOF
+ fi
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNAN 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ISNANF 1
-EOF
+ echo "$as_me:$LINENO: checking for strtof declaration" >&5
+echo $ECHO_N "checking for strtof declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_strtof_use+set} != xset; then
+ if test "${glibcxx_cv_func_strtof_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >> confdefs.h <<\EOF
-#define HAVE_MODFF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_HYPOT 1
-EOF
- ;;
- *-windiss*)
- os_include_dir="os/windiss"
- cat >> confdefs.h <<\EOF
-#define HAVE_ACOSF 1
-EOF
+ 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 ()
+{
+ strtof(0, 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
+ glibcxx_cv_func_strtof_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >> confdefs.h <<\EOF
-#define HAVE_ASINF 1
-EOF
+glibcxx_cv_func_strtof_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
- cat >> confdefs.h <<\EOF
-#define HAVE_ATAN2F 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_ATANF 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_CEILF 1
-EOF
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_strtof_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_strtof_use" >&6
+ if test x$glibcxx_cv_func_strtof_use = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGN 1
-EOF
+for ac_func in strtof
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGNF 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_COSF 1
-EOF
+fi
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_COSHF 1
-EOF
+ fi
- cat >> confdefs.h <<\EOF
-#define HAVE_EXPF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_FABSF 1
-EOF
+for ac_func in drand48
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_FLOORF 1
-EOF
+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
- cat >> confdefs.h <<\EOF
-#define HAVE_FMODF 1
-EOF
+fi
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_FREXPF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_LDEXPF 1
-EOF
+ CXXFLAGS="$ac_save_CXXFLAGS"
- cat >> confdefs.h <<\EOF
-#define HAVE_LOG10F 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_LOGF 1
-EOF
+ # For showmanyc_helper().
- cat >> confdefs.h <<\EOF
-#define HAVE_MODFF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_POWF 1
-EOF
+for ac_header in sys/ioctl.h sys/filio.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
- cat >> confdefs.h <<\EOF
-#define HAVE_SINF 1
-EOF
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
- cat >> confdefs.h <<\EOF
-#define HAVE_SINHF 1
-EOF
+fi
- cat >> confdefs.h <<\EOF
-#define HAVE_SQRTF 1
-EOF
+done
- cat >> confdefs.h <<\EOF
-#define HAVE_TANF 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_TANHF 1
-EOF
+ if test "${glibcxx_cv_POLL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- ;;
- *)
- if test "x${with_newlib}" = "xyes"; then
- os_include_dir="os/newlib"
- cat >> confdefs.h <<\EOF
+ 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 <poll.h>
+int
+main ()
+{
+struct pollfd pfd[1];
+ pfd[0].events = POLLIN;
+ poll(pfd, 1, 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
+ glibcxx_cv_POLL=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_POLL=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ if test $glibcxx_cv_POLL = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_POLL 1
+_ACEOF
+
+ fi
+
+
+ if test "${glibcxx_cv_S_ISREG+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. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_ISREG(buffer.st_mode);
+ ;
+ 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
+ glibcxx_cv_S_ISREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_S_ISREG=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ if test "${glibcxx_cv_S_IFREG+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. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_IFREG & buffer.st_mode;
+ ;
+ 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
+ glibcxx_cv_S_IFREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_S_IFREG=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ if test $glibcxx_cv_S_ISREG = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_ISREG 1
+_ACEOF
+
+ elif test $glibcxx_cv_S_IFREG = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_IFREG 1
+_ACEOF
+
+ fi
+
+
+ # For xsputn_2().
+
+for ac_header in sys/uio.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
+
+
+ if test "${glibcxx_cv_WRITEV+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/uio.h>
+int
+main ()
+{
+struct iovec iov[2];
+ writev(0, iov, 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
+ glibcxx_cv_WRITEV=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_WRITEV=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ if test $glibcxx_cv_WRITEV = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_WRITEV 1
+_ACEOF
+
+ fi
+
+
+
+ if test "${ac_cv_header_locale_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for locale.h" >&5
+echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
+if test "${ac_cv_header_locale_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
+echo "${ECHO_T}$ac_cv_header_locale_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking locale.h usability" >&5
+echo $ECHO_N "checking locale.h 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 <locale.h>
+_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 locale.h presence" >&5
+echo $ECHO_N "checking locale.h 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 <locale.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
+ 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: locale.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: locale.h: 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: locale.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: locale.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: locale.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: locale.h: 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 locale.h" >&5
+echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
+if test "${ac_cv_header_locale_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_locale_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
+echo "${ECHO_T}$ac_cv_header_locale_h" >&6
+
+fi
+if test $ac_cv_header_locale_h = yes; then
+
+ echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
+if test "${ac_cv_val_LC_MESSAGES+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. */
+#include <locale.h>
+int
+main ()
+{
+return LC_MESSAGES
+ ;
+ 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_val_LC_MESSAGES=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_val_LC_MESSAGES" >&5
+echo "${ECHO_T}$ac_cv_val_LC_MESSAGES" >&6
+ if test $ac_cv_val_LC_MESSAGES = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LC_MESSAGES 1
+_ACEOF
+
+ fi
+
+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. */
+#include <setjmp.h>
+int
+main ()
+{
+sigjmp_buf env;
+ while (! sigsetjmp (env, 1))
+ siglongjmp (env, 1);
+
+ ;
+ 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
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIGSETJMP 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+ if test x$gcc_no_link = xyes; then
+ if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+ ac_cv_func_mmap_fixed_mapped=no
+ fi
+fi
+if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+
+
+for ac_header in stdlib.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_func in getpagesize
+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
+
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_mmap_fixed_mapped=no
+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
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the file system buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propagated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
+#endif
+
+/* This mess was copied from the GNU getpagesize.h. */
+#if !HAVE_GETPAGESIZE
+/* Assume that all systems that can run configure have sys/param.h. */
+# if !HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize ();
+
+ /* First, make a file with some known garbage in it. */
+ data = (char *) malloc (pagesize);
+ if (!data)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand ();
+ umask (0);
+ fd = creat ("conftest.mmap", 0600);
+ if (fd < 0)
+ exit (1);
+ if (write (fd, data, pagesize) != pagesize)
+ exit (1);
+ close (fd);
+
+ /* Next, try to mmap the file at a fixed address which already has
+ something else allocated at it. If we can, also make sure that
+ we see the same garbage. */
+ fd = open ("conftest.mmap", O_RDWR);
+ if (fd < 0)
+ exit (1);
+ data2 = (char *) malloc (2 * pagesize);
+ if (!data2)
+ exit (1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit (1);
+
+ /* Finally, make sure that changes to the mapped area do not
+ percolate back to the file as seen by read(). (This is a bug on
+ some variants of i386 svr4.0.) */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = (char *) malloc (pagesize);
+ if (!data3)
+ exit (1);
+ if (read (fd, data3, pagesize) != pagesize)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit (1);
+ close (fd);
+ 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
+ ac_cv_func_mmap_fixed_mapped=yes
+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_func_mmap_fixed_mapped=no
+fi
+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
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MMAP 1
+_ACEOF
+
+fi
+rm -f conftest.mmap
+
+fi
+
+else
+
+ # This lets us hard-code the functionality we know we'll have in the cross
+ # target environment. "Let" is a sugar-coated word placed on an especially
+ # dull and tedious hack, actually.
+ #
+ # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros
+ # that involve linking, can't be used:
+ # "cannot open sim-crt0.o"
+ # "cannot open crt0.o"
+ # etc. All this is because there currently exists no unified, consistent
+ # way for top level CC information to be passed down to target directories:
+ # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
+ # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
+ # crosses can be removed.
+
+ # If Canadian cross, then don't pick up tools from the build directory.
+ # Used only in GLIBCXX_EXPORT_INCLUDES.
+ if test -n "$with_cross_host" &&
+ test x"$build_alias" != x"$with_cross_host" &&
+ test x"$build" != x"$target";
+ then
+ CANADIAN=yes
+ else
+ CANADIAN=no
+ fi
+
+ # Construct crosses by hand, eliminating bits that need ld...
+ # GLIBCXX_CHECK_COMPILER_FEATURES
+ # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
+ # GLIBCXX_CHECK_MATH_SUPPORT
+
+ # First, test for "known" system libraries. We may be using newlib even
+ # on a hosted environment.
+ if test "x${with_newlib}" = "xyes"; then
+ os_include_dir="os/newlib"
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_HYPOT 1
-EOF
+_ACEOF
- # GLIBCXX_CHECK_STDLIB_SUPPORT
- cat >> confdefs.h <<\EOF
+ # GLIBCXX_CHECK_STDLIB_SUPPORT
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_STRTOF 1
-EOF
-
- cat >> confdefs.h <<\EOF
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_STRTOLD 1
-EOF
-
- # AC_FUNC_MMAP
- cat >> confdefs.h <<\EOF
+_ACEOF
+
+ # AC_FUNC_MMAP
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_MMAP 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_ACOSF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_ASINF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_ATAN2F 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_ATANF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_CEILF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_COPYSIGN 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_COPYSIGNF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_COSF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_COSHF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_EXPF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_FABSF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_FLOORF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_FMODF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_FREXPF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_LDEXPF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_LOG10F 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_LOGF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_MODFF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_POWF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_SINF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_SINHF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_SQRTF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_TANF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_TANHF 1
-EOF
-
- else
- { echo "configure: error: No support for this host/target combination." 1>&2; exit 1; }
- fi
- ;;
- esac
+_ACEOF
- # At some point, we should differentiate between architectures
- # like x86, which have long double versions, and alpha/powerpc/etc.,
- # which don't. For the time being, punt.
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ACOSL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_ASINL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_ATAN2L 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_ATANL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_CEILL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_COPYSIGNL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_COSL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_COSHL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_EXPL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_FABSL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_FLOORL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_FMODL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_FREXPL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HAVE_LDEXPL 1
-EOF
+ else
- cat >> confdefs.h <<\EOF
-#define HAVE_LOG10L 1
-EOF
+# Base decisions on target environment.
+case "${host}" in
+ *-darwin*)
+ # Darwin versions vary, but the linker should work in a cross environment,
+ # so we just check for all the features here.
+ # Check for available headers.
- cat >> confdefs.h <<\EOF
-#define HAVE_LOGL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_MODFL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_POWL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_SINCOSL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_SINL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_SINHL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_SQRTL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_TANL 1
-EOF
- cat >> confdefs.h <<\EOF
-#define HAVE_TANHL 1
-EOF
- fi
-else
- # We are being configured natively. We can do more elaborate tests
- # that include AC_TRY_COMPILE now, as the linker is assumed to be
- # working.
- GLIBCXX_IS_CROSS_COMPILING=false
- CANADIAN=no
- # Check for available headers.
- for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
- sys/types.h
+for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
+ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
+ sys/types.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10473: 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 10478 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10483: \"$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"
+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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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
+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
-
+
# All these tests are for C++; save the language and the compiler flags.
# The CXXFLAGS thing is suspicious, but based on similar bits previously
# found in GLIBCXX_CONFIGURE.
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+
+
+ ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
+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_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
@@ -10529,28 +27638,45 @@ cross_compiling=$ac_cv_prog_cxx_cross
fi
# Check for -ffunction-sections -fdata-sections
- echo $ac_n "checking for g++ that supports -ffunction-sections -fdata-sections""... $ac_c" 1>&6
-echo "configure:10534: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
+ echo "$as_me:$LINENO: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
+echo $ECHO_N "checking for g++ that supports -ffunction-sections -fdata-sections... $ECHO_C" >&6
CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
- cat > conftest.$ac_ext <<EOF
-#line 10537 "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. */
-int main() {
+int
+main ()
+{
int foo;
-
-; return 0; }
-EOF
-if { (eval echo configure:10545: \"$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_fdsections=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_fdsections=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_fdsections=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test "$ac_test_CXXFLAGS" = set; then
CXXFLAGS="$ac_save_CXXFLAGS"
else
@@ -10560,1886 +27686,2644 @@ rm -f conftest*
if test x"$ac_fdsections" = x"yes"; then
SECTION_FLAGS='-ffunction-sections -fdata-sections'
fi
- echo "$ac_t""$ac_fdsections" 1>&6
+ echo "$as_me:$LINENO: result: $ac_fdsections" >&5
+echo "${ECHO_T}$ac_fdsections" >&6
ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-
-
-
-
- # If we're not using GNU ld, then there's no point in even trying these
- # tests. Check for that first. We should have already tested for gld
- # by now (in libtool), but require it now just to be safe...
- test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
- test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-
-
- # The name set by libtool depends on the version of libtool. Shame on us
- # for depending on an impl detail, but c'est la vie. Older versions used
- # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
- # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
- # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
- # set (hence we're using an older libtool), then set it.
- if test x${with_gnu_ld+set} != xset; then
- if test x${ac_cv_prog_gnu_ld+set} != xset; then
- # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
- with_gnu_ld=no
- else
- with_gnu_ld=$ac_cv_prog_gnu_ld
- fi
- 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
- # Start by getting the version number. I think the libtool test already
- # does some of this, but throws away the result.
-
- ldver=`$LD --version 2>/dev/null | head -1 | \
- sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-
- glibcxx_gnu_ld_version=`echo $ldver | \
- $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
- # Set --gc-sections.
- if test "$with_gnu_ld" = "notbroken"; then
- # GNU ld it is! Joy and bunny rabbits!
- # All these tests are for C++; save the language and the compiler flags.
- # Need to do this so that g++ won't try to link in libstdc++
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-x c++ -Wl,--gc-sections'
-
- # Check for -Wl,--gc-sections
- # XXX This test is broken at the moment, as symbols required for
- # linking are now in libsupc++ (not built yet.....). In addition,
- # this test has cored on solaris in the past. In addition,
- # --gc-sections doesn't really work at the moment (keeps on discarding
- # used sections, first .eh_frame and now some of the glibc sections for
- # iconv). Bzzzzt. Thanks for playing, maybe next time.
- echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:10626: checking for ld that supports -Wl,--gc-sections" >&5
- if test "$cross_compiling" = yes; then
- ac_sectionLDflags=yes
-else
- cat > conftest.$ac_ext <<EOF
-#line 10631 "configure"
-#include "confdefs.h"
- int main(void)
- {
- try { throw 1; }
- catch (...) { };
- return 0;
- }
-
-EOF
-if { (eval echo configure:10642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_sectionLDflags=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_sectionLDflags=no
-fi
-rm -fr conftest*
-fi
+ # Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
- fi
- if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
- fi
- echo "$ac_t""$ac_sectionLDflags" 1>&6
- fi
-
- # Set linker optimization flags.
- if test x"$with_gnu_ld" = x"yes"; then
- OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
- fi
-
-
-
-
-
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
- echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:10680: checking for sin in -lm" >&5
-ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for sin in -lm" >&5
+echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_sin+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10688 "configure"
-#include "confdefs.h"
+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. */
+
/* 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 sin();
-
-int main() {
-sin()
-; return 0; }
-EOF
-if { (eval echo configure:10699: \"$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
+ builtin and then its argument prototype would still apply. */
+char sin ();
+int
+main ()
+{
+sin ();
+ ;
+ 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_m_sin=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_sin=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_m_sin" >&5
+echo "${ECHO_T}$ac_cv_lib_m_sin" >&6
+if test $ac_cv_lib_m_sin = yes; then
libm="-lm"
-else
- echo "$ac_t""no" 1>&6
fi
ac_save_LIBS="$LIBS"
LIBS="$LIBS $libm"
-
-
- echo $ac_n "checking for isinf declaration""... $ac_c" 1>&6
-echo "configure:10725: checking for isinf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for isinf declaration" >&5
+echo $ECHO_N "checking for isinf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_isinf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_isinf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_isinf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 10740 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
isinf(0);
-; return 0; }
-EOF
-if { (eval echo configure:10751: \"$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
glibcxx_cv_func_isinf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_isinf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isinf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_isinf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isinf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isinf_use" >&6
if test x$glibcxx_cv_func_isinf_use = x"yes"; then
- for ac_func in isinf
+
+for ac_func in isinf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10778: 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 10783 "configure"
-#include "confdefs.h"
+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. */
-#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:10806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _isinf declaration""... $ac_c" 1>&6
-echo "configure:10833: checking for _isinf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _isinf declaration" >&5
+echo $ECHO_N "checking for _isinf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__isinf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__isinf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__isinf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 10848 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_isinf(0);
-; return 0; }
-EOF
-if { (eval echo configure:10859: \"$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
glibcxx_cv_func__isinf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__isinf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isinf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__isinf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isinf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isinf_use" >&6
if test x$glibcxx_cv_func__isinf_use = x"yes"; then
- for ac_func in _isinf
+
+for ac_func in _isinf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10886: 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 10891 "configure"
-#include "confdefs.h"
+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. */
-#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:10914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for isnan declaration""... $ac_c" 1>&6
-echo "configure:10944: checking for isnan declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for isnan declaration" >&5
+echo $ECHO_N "checking for isnan declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_isnan_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_isnan_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_isnan_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 10959 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
isnan(0);
-; return 0; }
-EOF
-if { (eval echo configure:10970: \"$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
glibcxx_cv_func_isnan_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_isnan_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isnan_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_isnan_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isnan_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isnan_use" >&6
if test x$glibcxx_cv_func_isnan_use = x"yes"; then
- for ac_func in isnan
+
+for ac_func in isnan
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10997: 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 11002 "configure"
-#include "confdefs.h"
+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. */
-#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:11025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _isnan declaration""... $ac_c" 1>&6
-echo "configure:11052: checking for _isnan declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _isnan declaration" >&5
+echo $ECHO_N "checking for _isnan declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__isnan_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__isnan_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__isnan_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11067 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_isnan(0);
-; return 0; }
-EOF
-if { (eval echo configure:11078: \"$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
glibcxx_cv_func__isnan_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__isnan_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isnan_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__isnan_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isnan_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isnan_use" >&6
if test x$glibcxx_cv_func__isnan_use = x"yes"; then
- for ac_func in _isnan
+
+for ac_func in _isnan
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11105: 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 11110 "configure"
-#include "confdefs.h"
+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. */
-#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:11133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for finite declaration""... $ac_c" 1>&6
-echo "configure:11163: checking for finite declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for finite declaration" >&5
+echo $ECHO_N "checking for finite declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_finite_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_finite_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_finite_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11178 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
finite(0);
-; return 0; }
-EOF
-if { (eval echo configure:11189: \"$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
glibcxx_cv_func_finite_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_finite_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_finite_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_finite_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_finite_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_finite_use" >&6
if test x$glibcxx_cv_func_finite_use = x"yes"; then
- for ac_func in finite
+
+for ac_func in finite
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11216: 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 11221 "configure"
-#include "confdefs.h"
+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. */
-#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:11244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _finite declaration""... $ac_c" 1>&6
-echo "configure:11271: checking for _finite declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _finite declaration" >&5
+echo $ECHO_N "checking for _finite declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__finite_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__finite_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__finite_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11286 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_finite(0);
-; return 0; }
-EOF
-if { (eval echo configure:11297: \"$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
glibcxx_cv_func__finite_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__finite_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__finite_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__finite_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__finite_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__finite_use" >&6
if test x$glibcxx_cv_func__finite_use = x"yes"; then
- for ac_func in _finite
+
+for ac_func in _finite
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11324: 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 11329 "configure"
-#include "confdefs.h"
+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. */
-#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:11352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for copysign declaration""... $ac_c" 1>&6
-echo "configure:11382: checking for copysign declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for copysign declaration" >&5
+echo $ECHO_N "checking for copysign declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_copysign_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_copysign_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_copysign_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11397 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
copysign(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:11404: \"$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
glibcxx_cv_func_copysign_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_copysign_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_copysign_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_copysign_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_copysign_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_copysign_use" >&6
if test x$glibcxx_cv_func_copysign_use = x"yes"; then
- for ac_func in copysign
+
+for ac_func in copysign
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11431: 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 11436 "configure"
-#include "confdefs.h"
+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. */
-#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:11459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _copysign declaration""... $ac_c" 1>&6
-echo "configure:11486: checking for _copysign declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _copysign declaration" >&5
+echo $ECHO_N "checking for _copysign declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__copysign_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__copysign_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__copysign_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11501 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_copysign(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:11508: \"$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
glibcxx_cv_func__copysign_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__copysign_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__copysign_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__copysign_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__copysign_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__copysign_use" >&6
if test x$glibcxx_cv_func__copysign_use = x"yes"; then
- for ac_func in _copysign
+
+for ac_func in _copysign
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11535: 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 11540 "configure"
-#include "confdefs.h"
+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. */
-#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:11563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for sincos declaration""... $ac_c" 1>&6
-echo "configure:11593: checking for sincos declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for sincos declaration" >&5
+echo $ECHO_N "checking for sincos declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_sincos_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_sincos_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_sincos_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11608 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
sincos(0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:11615: \"$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
glibcxx_cv_func_sincos_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_sincos_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sincos_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_sincos_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sincos_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sincos_use" >&6
if test x$glibcxx_cv_func_sincos_use = x"yes"; then
- for ac_func in sincos
+
+for ac_func in sincos
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11642: 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 11647 "configure"
-#include "confdefs.h"
+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. */
-#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:11670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _sincos declaration""... $ac_c" 1>&6
-echo "configure:11697: checking for _sincos declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _sincos declaration" >&5
+echo $ECHO_N "checking for _sincos declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__sincos_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__sincos_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__sincos_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11712 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_sincos(0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:11719: \"$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
glibcxx_cv_func__sincos_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__sincos_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sincos_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__sincos_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sincos_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sincos_use" >&6
if test x$glibcxx_cv_func__sincos_use = x"yes"; then
- for ac_func in _sincos
+
+for ac_func in _sincos
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11746: 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 11751 "configure"
-#include "confdefs.h"
+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. */
-#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:11774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for fpclass declaration""... $ac_c" 1>&6
-echo "configure:11804: checking for fpclass declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for fpclass declaration" >&5
+echo $ECHO_N "checking for fpclass declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_fpclass_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_fpclass_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_fpclass_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11819 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
fpclass(0);
-; return 0; }
-EOF
-if { (eval echo configure:11830: \"$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
glibcxx_cv_func_fpclass_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_fpclass_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fpclass_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_fpclass_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fpclass_use" >&6
if test x$glibcxx_cv_func_fpclass_use = x"yes"; then
- for ac_func in fpclass
+
+for ac_func in fpclass
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11857: 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 11862 "configure"
-#include "confdefs.h"
+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. */
-#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:11885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _fpclass declaration""... $ac_c" 1>&6
-echo "configure:11912: checking for _fpclass declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _fpclass declaration" >&5
+echo $ECHO_N "checking for _fpclass declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__fpclass_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__fpclass_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__fpclass_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 11927 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_fpclass(0);
-; return 0; }
-EOF
-if { (eval echo configure:11938: \"$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
glibcxx_cv_func__fpclass_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__fpclass_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fpclass_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__fpclass_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fpclass_use" >&6
if test x$glibcxx_cv_func__fpclass_use = x"yes"; then
- for ac_func in _fpclass
+
+for ac_func in _fpclass
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11965: 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 11970 "configure"
-#include "confdefs.h"
+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. */
-#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:11993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for qfpclass declaration""... $ac_c" 1>&6
-echo "configure:12023: checking for qfpclass declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for qfpclass declaration" >&5
+echo $ECHO_N "checking for qfpclass declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_qfpclass_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_qfpclass_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_qfpclass_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12038 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
qfpclass(0);
-; return 0; }
-EOF
-if { (eval echo configure:12049: \"$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
glibcxx_cv_func_qfpclass_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_qfpclass_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_qfpclass_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_qfpclass_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_qfpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_qfpclass_use" >&6
if test x$glibcxx_cv_func_qfpclass_use = x"yes"; then
- for ac_func in qfpclass
+
+for ac_func in qfpclass
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12076: 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 12081 "configure"
-#include "confdefs.h"
+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. */
-#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:12104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _qfpclass declaration""... $ac_c" 1>&6
-echo "configure:12131: checking for _qfpclass declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _qfpclass declaration" >&5
+echo $ECHO_N "checking for _qfpclass declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__qfpclass_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__qfpclass_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__qfpclass_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12146 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_qfpclass(0);
-; return 0; }
-EOF
-if { (eval echo configure:12157: \"$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
glibcxx_cv_func__qfpclass_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__qfpclass_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__qfpclass_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__qfpclass_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__qfpclass_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__qfpclass_use" >&6
if test x$glibcxx_cv_func__qfpclass_use = x"yes"; then
- for ac_func in _qfpclass
+
+for ac_func in _qfpclass
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12184: 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 12189 "configure"
-#include "confdefs.h"
+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. */
-#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:12212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for hypot declaration""... $ac_c" 1>&6
-echo "configure:12242: checking for hypot declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for hypot declaration" >&5
+echo $ECHO_N "checking for hypot declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_hypot_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_hypot_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_hypot_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12257 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
hypot(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:12264: \"$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
glibcxx_cv_func_hypot_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_hypot_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_hypot_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_hypot_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_hypot_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_hypot_use" >&6
if test x$glibcxx_cv_func_hypot_use = x"yes"; then
- for ac_func in hypot
+
+for ac_func in hypot
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12291: 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 12296 "configure"
-#include "confdefs.h"
+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. */
-#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:12319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _hypot declaration""... $ac_c" 1>&6
-echo "configure:12346: checking for _hypot declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _hypot declaration" >&5
+echo $ECHO_N "checking for _hypot declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__hypot_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__hypot_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__hypot_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12361 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_hypot(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:12368: \"$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
glibcxx_cv_func__hypot_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__hypot_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__hypot_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__hypot_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__hypot_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__hypot_use" >&6
if test x$glibcxx_cv_func__hypot_use = x"yes"; then
- for ac_func in _hypot
+
+for ac_func in _hypot
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12395: 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 12400 "configure"
-#include "confdefs.h"
+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. */
-#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:12423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
@@ -12447,3646 +30331,5423 @@ done
fi
-
- echo $ac_n "checking for float trig functions""... $ac_c" 1>&6
-echo "configure:12453: checking for float trig functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func_float_trig_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for float trig functions" >&5
+echo $ECHO_N "checking for float trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_float_trig_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12467 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
`for x in acosf asinf atanf \
cosf sinf tanf \
- coshf sinhf tanhf; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:12476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ coshf sinhf tanhf; do echo "$x (0);"; done`
+ ;
+ 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_float_trig_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_float_trig_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_float_trig_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_float_trig_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_float_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_float_trig_use" >&6
if test x$glibcxx_cv_func_float_trig_use = x"yes"; then
- for ac_func in acosf asinf atanf \
+
+
+
+
+
+
+
+
+
+for ac_func in acosf asinf atanf \
cosf sinf tanf \
coshf sinhf tanhf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12502: 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 12507 "configure"
-#include "confdefs.h"
+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. */
-#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:12530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-
- echo $ac_n "checking for float round functions""... $ac_c" 1>&6
-echo "configure:12558: checking for float round functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func_float_round_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for float round functions" >&5
+echo $ECHO_N "checking for float round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_float_round_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12572 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
- `for x in ceilf floorf; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:12579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+int
+main ()
+{
+ `for x in ceilf floorf; do echo "$x (0);"; done`
+ ;
+ 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_float_round_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_float_round_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_float_round_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_float_round_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_float_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_float_round_use" >&6
if test x$glibcxx_cv_func_float_round_use = x"yes"; then
- for ac_func in ceilf floorf
+
+
+for ac_func in ceilf floorf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12603: 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 12608 "configure"
-#include "confdefs.h"
+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. */
-#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:12631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-
-
- echo $ac_n "checking for expf declaration""... $ac_c" 1>&6
-echo "configure:12660: checking for expf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for expf declaration" >&5
+echo $ECHO_N "checking for expf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_expf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_expf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_expf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12675 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
expf(0);
-; return 0; }
-EOF
-if { (eval echo configure:12686: \"$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
glibcxx_cv_func_expf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_expf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_expf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_expf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_expf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_expf_use" >&6
if test x$glibcxx_cv_func_expf_use = x"yes"; then
- for ac_func in expf
+
+for ac_func in expf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12713: 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 12718 "configure"
-#include "confdefs.h"
+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. */
-#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:12741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _expf declaration""... $ac_c" 1>&6
-echo "configure:12768: checking for _expf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _expf declaration" >&5
+echo $ECHO_N "checking for _expf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__expf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__expf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__expf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12783 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_expf(0);
-; return 0; }
-EOF
-if { (eval echo configure:12794: \"$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
glibcxx_cv_func__expf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__expf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__expf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__expf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__expf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__expf_use" >&6
if test x$glibcxx_cv_func__expf_use = x"yes"; then
- for ac_func in _expf
+
+for ac_func in _expf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12821: 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 12826 "configure"
-#include "confdefs.h"
+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. */
-#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:12849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for isnanf declaration""... $ac_c" 1>&6
-echo "configure:12879: checking for isnanf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for isnanf declaration" >&5
+echo $ECHO_N "checking for isnanf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_isnanf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_isnanf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_isnanf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 12894 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
isnanf(0);
-; return 0; }
-EOF
-if { (eval echo configure:12905: \"$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
glibcxx_cv_func_isnanf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_isnanf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isnanf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_isnanf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isnanf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isnanf_use" >&6
if test x$glibcxx_cv_func_isnanf_use = x"yes"; then
- for ac_func in isnanf
+
+for ac_func in isnanf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12932: 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 12937 "configure"
-#include "confdefs.h"
+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. */
-#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:12960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _isnanf declaration""... $ac_c" 1>&6
-echo "configure:12987: checking for _isnanf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _isnanf declaration" >&5
+echo $ECHO_N "checking for _isnanf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__isnanf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__isnanf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__isnanf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13002 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_isnanf(0);
-; return 0; }
-EOF
-if { (eval echo configure:13013: \"$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
glibcxx_cv_func__isnanf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__isnanf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isnanf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__isnanf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isnanf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isnanf_use" >&6
if test x$glibcxx_cv_func__isnanf_use = x"yes"; then
- for ac_func in _isnanf
+
+for ac_func in _isnanf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13040: 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 13045 "configure"
-#include "confdefs.h"
+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. */
-#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:13068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for isinff declaration""... $ac_c" 1>&6
-echo "configure:13098: checking for isinff declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for isinff declaration" >&5
+echo $ECHO_N "checking for isinff declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_isinff_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_isinff_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_isinff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13113 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
isinff(0);
-; return 0; }
-EOF
-if { (eval echo configure:13124: \"$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
glibcxx_cv_func_isinff_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_isinff_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isinff_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_isinff_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isinff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isinff_use" >&6
if test x$glibcxx_cv_func_isinff_use = x"yes"; then
- for ac_func in isinff
+
+for ac_func in isinff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13151: 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 13156 "configure"
-#include "confdefs.h"
+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. */
-#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:13179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _isinff declaration""... $ac_c" 1>&6
-echo "configure:13206: checking for _isinff declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _isinff declaration" >&5
+echo $ECHO_N "checking for _isinff declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__isinff_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__isinff_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__isinff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13221 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_isinff(0);
-; return 0; }
-EOF
-if { (eval echo configure:13232: \"$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
glibcxx_cv_func__isinff_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__isinff_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isinff_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__isinff_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isinff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isinff_use" >&6
if test x$glibcxx_cv_func__isinff_use = x"yes"; then
- for ac_func in _isinff
+
+for ac_func in _isinff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13259: 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 13264 "configure"
-#include "confdefs.h"
+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. */
-#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:13287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for atan2f declaration""... $ac_c" 1>&6
-echo "configure:13317: checking for atan2f declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for atan2f declaration" >&5
+echo $ECHO_N "checking for atan2f declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_atan2f_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_atan2f_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_atan2f_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13332 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
atan2f(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:13339: \"$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
glibcxx_cv_func_atan2f_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_atan2f_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_atan2f_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_atan2f_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_atan2f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_atan2f_use" >&6
if test x$glibcxx_cv_func_atan2f_use = x"yes"; then
- for ac_func in atan2f
+
+for ac_func in atan2f
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13366: 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 13371 "configure"
-#include "confdefs.h"
+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. */
-#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:13394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _atan2f declaration""... $ac_c" 1>&6
-echo "configure:13421: checking for _atan2f declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _atan2f declaration" >&5
+echo $ECHO_N "checking for _atan2f declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__atan2f_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__atan2f_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__atan2f_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13436 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_atan2f(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:13443: \"$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
glibcxx_cv_func__atan2f_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__atan2f_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__atan2f_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__atan2f_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__atan2f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__atan2f_use" >&6
if test x$glibcxx_cv_func__atan2f_use = x"yes"; then
- for ac_func in _atan2f
+
+for ac_func in _atan2f
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13470: 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 13475 "configure"
-#include "confdefs.h"
+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. */
-#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:13498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for fabsf declaration""... $ac_c" 1>&6
-echo "configure:13528: checking for fabsf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for fabsf declaration" >&5
+echo $ECHO_N "checking for fabsf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_fabsf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_fabsf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_fabsf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13543 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
fabsf(0);
-; return 0; }
-EOF
-if { (eval echo configure:13554: \"$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
glibcxx_cv_func_fabsf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_fabsf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fabsf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_fabsf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fabsf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fabsf_use" >&6
if test x$glibcxx_cv_func_fabsf_use = x"yes"; then
- for ac_func in fabsf
+
+for ac_func in fabsf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13581: 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 13586 "configure"
-#include "confdefs.h"
+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. */
-#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:13609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _fabsf declaration""... $ac_c" 1>&6
-echo "configure:13636: checking for _fabsf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _fabsf declaration" >&5
+echo $ECHO_N "checking for _fabsf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__fabsf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__fabsf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__fabsf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13651 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_fabsf(0);
-; return 0; }
-EOF
-if { (eval echo configure:13662: \"$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
glibcxx_cv_func__fabsf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__fabsf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fabsf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__fabsf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fabsf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fabsf_use" >&6
if test x$glibcxx_cv_func__fabsf_use = x"yes"; then
- for ac_func in _fabsf
+
+for ac_func in _fabsf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13689: 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 13694 "configure"
-#include "confdefs.h"
+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. */
-#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:13717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for fmodf declaration""... $ac_c" 1>&6
-echo "configure:13747: checking for fmodf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for fmodf declaration" >&5
+echo $ECHO_N "checking for fmodf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_fmodf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_fmodf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_fmodf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13762 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
fmodf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:13769: \"$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
glibcxx_cv_func_fmodf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_fmodf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fmodf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_fmodf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fmodf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fmodf_use" >&6
if test x$glibcxx_cv_func_fmodf_use = x"yes"; then
- for ac_func in fmodf
+
+for ac_func in fmodf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13796: 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 13801 "configure"
-#include "confdefs.h"
+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. */
-#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:13824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _fmodf declaration""... $ac_c" 1>&6
-echo "configure:13851: checking for _fmodf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _fmodf declaration" >&5
+echo $ECHO_N "checking for _fmodf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__fmodf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__fmodf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__fmodf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13866 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_fmodf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:13873: \"$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
glibcxx_cv_func__fmodf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__fmodf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fmodf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__fmodf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fmodf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fmodf_use" >&6
if test x$glibcxx_cv_func__fmodf_use = x"yes"; then
- for ac_func in _fmodf
+
+for ac_func in _fmodf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13900: 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 13905 "configure"
-#include "confdefs.h"
+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. */
-#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:13928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for frexpf declaration""... $ac_c" 1>&6
-echo "configure:13958: checking for frexpf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for frexpf declaration" >&5
+echo $ECHO_N "checking for frexpf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_frexpf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_frexpf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_frexpf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 13973 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
frexpf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:13980: \"$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
glibcxx_cv_func_frexpf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_frexpf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_frexpf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_frexpf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_frexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_frexpf_use" >&6
if test x$glibcxx_cv_func_frexpf_use = x"yes"; then
- for ac_func in frexpf
+
+for ac_func in frexpf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14007: 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 14012 "configure"
-#include "confdefs.h"
+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. */
-#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:14035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _frexpf declaration""... $ac_c" 1>&6
-echo "configure:14062: checking for _frexpf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _frexpf declaration" >&5
+echo $ECHO_N "checking for _frexpf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__frexpf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__frexpf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__frexpf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14077 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_frexpf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:14084: \"$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
glibcxx_cv_func__frexpf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__frexpf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__frexpf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__frexpf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__frexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__frexpf_use" >&6
if test x$glibcxx_cv_func__frexpf_use = x"yes"; then
- for ac_func in _frexpf
+
+for ac_func in _frexpf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14111: 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 14116 "configure"
-#include "confdefs.h"
+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. */
-#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:14139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for hypotf declaration""... $ac_c" 1>&6
-echo "configure:14169: checking for hypotf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for hypotf declaration" >&5
+echo $ECHO_N "checking for hypotf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_hypotf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_hypotf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_hypotf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14184 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
hypotf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:14191: \"$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
glibcxx_cv_func_hypotf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_hypotf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_hypotf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_hypotf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_hypotf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_hypotf_use" >&6
if test x$glibcxx_cv_func_hypotf_use = x"yes"; then
- for ac_func in hypotf
+
+for ac_func in hypotf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14218: 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 14223 "configure"
-#include "confdefs.h"
+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. */
-#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:14246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _hypotf declaration""... $ac_c" 1>&6
-echo "configure:14273: checking for _hypotf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _hypotf declaration" >&5
+echo $ECHO_N "checking for _hypotf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__hypotf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__hypotf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__hypotf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14288 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_hypotf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:14295: \"$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
glibcxx_cv_func__hypotf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__hypotf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__hypotf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__hypotf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__hypotf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__hypotf_use" >&6
if test x$glibcxx_cv_func__hypotf_use = x"yes"; then
- for ac_func in _hypotf
+
+for ac_func in _hypotf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14322: 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 14327 "configure"
-#include "confdefs.h"
+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. */
-#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:14350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for ldexpf declaration""... $ac_c" 1>&6
-echo "configure:14380: checking for ldexpf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for ldexpf declaration" >&5
+echo $ECHO_N "checking for ldexpf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_ldexpf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_ldexpf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_ldexpf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14395 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
ldexpf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:14402: \"$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
glibcxx_cv_func_ldexpf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_ldexpf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_ldexpf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_ldexpf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_ldexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_ldexpf_use" >&6
if test x$glibcxx_cv_func_ldexpf_use = x"yes"; then
- for ac_func in ldexpf
+
+for ac_func in ldexpf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14429: 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 14434 "configure"
-#include "confdefs.h"
+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. */
-#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:14457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _ldexpf declaration""... $ac_c" 1>&6
-echo "configure:14484: checking for _ldexpf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _ldexpf declaration" >&5
+echo $ECHO_N "checking for _ldexpf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__ldexpf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__ldexpf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__ldexpf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14499 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_ldexpf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:14506: \"$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
glibcxx_cv_func__ldexpf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__ldexpf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__ldexpf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__ldexpf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__ldexpf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__ldexpf_use" >&6
if test x$glibcxx_cv_func__ldexpf_use = x"yes"; then
- for ac_func in _ldexpf
+
+for ac_func in _ldexpf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14533: 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 14538 "configure"
-#include "confdefs.h"
+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. */
-#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:14561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for logf declaration""... $ac_c" 1>&6
-echo "configure:14591: checking for logf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for logf declaration" >&5
+echo $ECHO_N "checking for logf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_logf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_logf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_logf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14606 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
logf(0);
-; return 0; }
-EOF
-if { (eval echo configure:14617: \"$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
glibcxx_cv_func_logf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_logf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_logf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_logf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_logf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_logf_use" >&6
if test x$glibcxx_cv_func_logf_use = x"yes"; then
- for ac_func in logf
+
+for ac_func in logf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14644: 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 14649 "configure"
-#include "confdefs.h"
+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. */
-#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:14672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _logf declaration""... $ac_c" 1>&6
-echo "configure:14699: checking for _logf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _logf declaration" >&5
+echo $ECHO_N "checking for _logf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__logf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__logf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__logf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14714 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_logf(0);
-; return 0; }
-EOF
-if { (eval echo configure:14725: \"$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
glibcxx_cv_func__logf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__logf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__logf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__logf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__logf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__logf_use" >&6
if test x$glibcxx_cv_func__logf_use = x"yes"; then
- for ac_func in _logf
+
+for ac_func in _logf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14752: 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 14757 "configure"
-#include "confdefs.h"
+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. */
-#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:14780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for log10f declaration""... $ac_c" 1>&6
-echo "configure:14810: checking for log10f declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for log10f declaration" >&5
+echo $ECHO_N "checking for log10f declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_log10f_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_log10f_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_log10f_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14825 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
log10f(0);
-; return 0; }
-EOF
-if { (eval echo configure:14836: \"$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
glibcxx_cv_func_log10f_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_log10f_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_log10f_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_log10f_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_log10f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_log10f_use" >&6
if test x$glibcxx_cv_func_log10f_use = x"yes"; then
- for ac_func in log10f
+
+for ac_func in log10f
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14863: 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 14868 "configure"
-#include "confdefs.h"
+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. */
-#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:14891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _log10f declaration""... $ac_c" 1>&6
-echo "configure:14918: checking for _log10f declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _log10f declaration" >&5
+echo $ECHO_N "checking for _log10f declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__log10f_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__log10f_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__log10f_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 14933 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_log10f(0);
-; return 0; }
-EOF
-if { (eval echo configure:14944: \"$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
glibcxx_cv_func__log10f_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__log10f_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__log10f_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__log10f_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__log10f_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__log10f_use" >&6
if test x$glibcxx_cv_func__log10f_use = x"yes"; then
- for ac_func in _log10f
+
+for ac_func in _log10f
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14971: 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 14976 "configure"
-#include "confdefs.h"
+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. */
-#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:14999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for modff declaration""... $ac_c" 1>&6
-echo "configure:15029: checking for modff declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for modff declaration" >&5
+echo $ECHO_N "checking for modff declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_modff_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_modff_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_modff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15044 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
modff(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:15051: \"$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
glibcxx_cv_func_modff_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_modff_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_modff_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_modff_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_modff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_modff_use" >&6
if test x$glibcxx_cv_func_modff_use = x"yes"; then
- for ac_func in modff
+
+for ac_func in modff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15078: 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 15083 "configure"
-#include "confdefs.h"
+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. */
-#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:15106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _modff declaration""... $ac_c" 1>&6
-echo "configure:15133: checking for _modff declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _modff declaration" >&5
+echo $ECHO_N "checking for _modff declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__modff_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__modff_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__modff_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15148 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_modff(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:15155: \"$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
glibcxx_cv_func__modff_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__modff_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__modff_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__modff_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__modff_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__modff_use" >&6
if test x$glibcxx_cv_func__modff_use = x"yes"; then
- for ac_func in _modff
+
+for ac_func in _modff
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15182: 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 15187 "configure"
-#include "confdefs.h"
+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. */
-#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:15210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for powf declaration""... $ac_c" 1>&6
-echo "configure:15240: checking for powf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for powf declaration" >&5
+echo $ECHO_N "checking for powf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_powf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_powf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_powf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15255 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
powf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:15262: \"$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
glibcxx_cv_func_powf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_powf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_powf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_powf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_powf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_powf_use" >&6
if test x$glibcxx_cv_func_powf_use = x"yes"; then
- for ac_func in powf
+
+for ac_func in powf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15289: 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 15294 "configure"
-#include "confdefs.h"
+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. */
-#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:15317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _powf declaration""... $ac_c" 1>&6
-echo "configure:15344: checking for _powf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _powf declaration" >&5
+echo $ECHO_N "checking for _powf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__powf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__powf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__powf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15359 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_powf(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:15366: \"$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
glibcxx_cv_func__powf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__powf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__powf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__powf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__powf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__powf_use" >&6
if test x$glibcxx_cv_func__powf_use = x"yes"; then
- for ac_func in _powf
+
+for ac_func in _powf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15393: 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 15398 "configure"
-#include "confdefs.h"
+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. */
-#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:15421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for sqrtf declaration""... $ac_c" 1>&6
-echo "configure:15451: checking for sqrtf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for sqrtf declaration" >&5
+echo $ECHO_N "checking for sqrtf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_sqrtf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_sqrtf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_sqrtf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15466 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
sqrtf(0);
-; return 0; }
-EOF
-if { (eval echo configure:15477: \"$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
glibcxx_cv_func_sqrtf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_sqrtf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sqrtf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_sqrtf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sqrtf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sqrtf_use" >&6
if test x$glibcxx_cv_func_sqrtf_use = x"yes"; then
- for ac_func in sqrtf
+
+for ac_func in sqrtf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15504: 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 15509 "configure"
-#include "confdefs.h"
+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. */
-#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:15532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _sqrtf declaration""... $ac_c" 1>&6
-echo "configure:15559: checking for _sqrtf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _sqrtf declaration" >&5
+echo $ECHO_N "checking for _sqrtf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__sqrtf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__sqrtf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__sqrtf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15574 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_sqrtf(0);
-; return 0; }
-EOF
-if { (eval echo configure:15585: \"$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
glibcxx_cv_func__sqrtf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__sqrtf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sqrtf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__sqrtf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sqrtf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sqrtf_use" >&6
if test x$glibcxx_cv_func__sqrtf_use = x"yes"; then
- for ac_func in _sqrtf
+
+for ac_func in _sqrtf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15612: 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 15617 "configure"
-#include "confdefs.h"
+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. */
-#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:15640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for sincosf declaration""... $ac_c" 1>&6
-echo "configure:15670: checking for sincosf declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for sincosf declaration" >&5
+echo $ECHO_N "checking for sincosf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_sincosf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_sincosf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_sincosf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15685 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
sincosf(0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:15692: \"$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
glibcxx_cv_func_sincosf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_sincosf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sincosf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_sincosf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sincosf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sincosf_use" >&6
if test x$glibcxx_cv_func_sincosf_use = x"yes"; then
- for ac_func in sincosf
+
+for ac_func in sincosf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15719: 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 15724 "configure"
-#include "confdefs.h"
+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. */
-#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:15747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _sincosf declaration""... $ac_c" 1>&6
-echo "configure:15774: checking for _sincosf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _sincosf declaration" >&5
+echo $ECHO_N "checking for _sincosf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__sincosf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__sincosf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__sincosf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15789 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_sincosf(0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:15796: \"$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
glibcxx_cv_func__sincosf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__sincosf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sincosf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__sincosf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sincosf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sincosf_use" >&6
if test x$glibcxx_cv_func__sincosf_use = x"yes"; then
- for ac_func in _sincosf
+
+for ac_func in _sincosf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15823: 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 15828 "configure"
-#include "confdefs.h"
+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. */
-#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:15851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for finitef declaration""... $ac_c" 1>&6
-echo "configure:15881: checking for finitef declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for finitef declaration" >&5
+echo $ECHO_N "checking for finitef declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_finitef_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_finitef_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_finitef_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 15896 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
finitef(0);
-; return 0; }
-EOF
-if { (eval echo configure:15907: \"$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
glibcxx_cv_func_finitef_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_finitef_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_finitef_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_finitef_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_finitef_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_finitef_use" >&6
if test x$glibcxx_cv_func_finitef_use = x"yes"; then
- for ac_func in finitef
+
+for ac_func in finitef
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15934: 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 15939 "configure"
-#include "confdefs.h"
+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. */
-#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:15962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _finitef declaration""... $ac_c" 1>&6
-echo "configure:15989: checking for _finitef declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _finitef declaration" >&5
+echo $ECHO_N "checking for _finitef declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__finitef_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__finitef_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__finitef_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16004 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_finitef(0);
-; return 0; }
-EOF
-if { (eval echo configure:16015: \"$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
glibcxx_cv_func__finitef_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__finitef_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__finitef_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__finitef_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__finitef_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__finitef_use" >&6
if test x$glibcxx_cv_func__finitef_use = x"yes"; then
- for ac_func in _finitef
+
+for ac_func in _finitef
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16042: 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 16047 "configure"
-#include "confdefs.h"
+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. */
-#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:16070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
@@ -16094,3857 +35755,5738 @@ done
fi
-
- echo $ac_n "checking for long double trig functions""... $ac_c" 1>&6
-echo "configure:16100: checking for long double trig functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func_long_double_trig_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for long double trig functions" >&5
+echo $ECHO_N "checking for long double trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_long_double_trig_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16114 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
`for x in acosl asinl atanl \
cosl sinl tanl \
- coshl sinhl tanhl; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:16123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ coshl sinhl tanhl; do echo "$x (0);"; done`
+ ;
+ 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_long_double_trig_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_long_double_trig_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_long_double_trig_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_long_double_trig_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_long_double_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_long_double_trig_use" >&6
if test x$glibcxx_cv_func_long_double_trig_use = x"yes"; then
- for ac_func in acosl asinl atanl \
+
+
+
+
+
+
+
+
+
+for ac_func in acosl asinl atanl \
cosl sinl tanl \
coshl sinhl tanhl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16149: 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 16154 "configure"
-#include "confdefs.h"
+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. */
-#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:16177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-
- echo $ac_n "checking for long double round functions""... $ac_c" 1>&6
-echo "configure:16205: checking for long double round functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func_long_double_round_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for long double round functions" >&5
+echo $ECHO_N "checking for long double round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func_long_double_round_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16219 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
- `for x in ceill floorl; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:16226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+int
+main ()
+{
+ `for x in ceill floorl; do echo "$x (0);"; done`
+ ;
+ 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_long_double_round_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_long_double_round_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_long_double_round_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_long_double_round_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_long_double_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_long_double_round_use" >&6
if test x$glibcxx_cv_func_long_double_round_use = x"yes"; then
- for ac_func in ceill floorl
+
+
+for ac_func in ceill floorl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16250: 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 16255 "configure"
-#include "confdefs.h"
+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. */
-#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:16278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-
-
- echo $ac_n "checking for isnanl declaration""... $ac_c" 1>&6
-echo "configure:16307: checking for isnanl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for isnanl declaration" >&5
+echo $ECHO_N "checking for isnanl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_isnanl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_isnanl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_isnanl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16322 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
isnanl(0);
-; return 0; }
-EOF
-if { (eval echo configure:16333: \"$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
glibcxx_cv_func_isnanl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_isnanl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isnanl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_isnanl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isnanl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isnanl_use" >&6
if test x$glibcxx_cv_func_isnanl_use = x"yes"; then
- for ac_func in isnanl
+
+for ac_func in isnanl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16360: 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 16365 "configure"
-#include "confdefs.h"
+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. */
-#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:16388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _isnanl declaration""... $ac_c" 1>&6
-echo "configure:16415: checking for _isnanl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _isnanl declaration" >&5
+echo $ECHO_N "checking for _isnanl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__isnanl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__isnanl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__isnanl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16430 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_isnanl(0);
-; return 0; }
-EOF
-if { (eval echo configure:16441: \"$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
glibcxx_cv_func__isnanl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__isnanl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isnanl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__isnanl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isnanl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isnanl_use" >&6
if test x$glibcxx_cv_func__isnanl_use = x"yes"; then
- for ac_func in _isnanl
+
+for ac_func in _isnanl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16468: 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 16473 "configure"
-#include "confdefs.h"
+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. */
-#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:16496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for isinfl declaration""... $ac_c" 1>&6
-echo "configure:16526: checking for isinfl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for isinfl declaration" >&5
+echo $ECHO_N "checking for isinfl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_isinfl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_isinfl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_isinfl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16541 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
isinfl(0);
-; return 0; }
-EOF
-if { (eval echo configure:16552: \"$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
glibcxx_cv_func_isinfl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_isinfl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_isinfl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_isinfl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_isinfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_isinfl_use" >&6
if test x$glibcxx_cv_func_isinfl_use = x"yes"; then
- for ac_func in isinfl
+
+for ac_func in isinfl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16579: 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 16584 "configure"
-#include "confdefs.h"
+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. */
-#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:16607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _isinfl declaration""... $ac_c" 1>&6
-echo "configure:16634: checking for _isinfl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _isinfl declaration" >&5
+echo $ECHO_N "checking for _isinfl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__isinfl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__isinfl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__isinfl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16649 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_isinfl(0);
-; return 0; }
-EOF
-if { (eval echo configure:16660: \"$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
glibcxx_cv_func__isinfl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__isinfl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__isinfl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__isinfl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__isinfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__isinfl_use" >&6
if test x$glibcxx_cv_func__isinfl_use = x"yes"; then
- for ac_func in _isinfl
+
+for ac_func in _isinfl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16687: 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 16692 "configure"
-#include "confdefs.h"
+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. */
-#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:16715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for copysignl declaration""... $ac_c" 1>&6
-echo "configure:16745: checking for copysignl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for copysignl declaration" >&5
+echo $ECHO_N "checking for copysignl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_copysignl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_copysignl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_copysignl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16760 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
copysignl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:16767: \"$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
glibcxx_cv_func_copysignl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_copysignl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_copysignl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_copysignl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_copysignl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_copysignl_use" >&6
if test x$glibcxx_cv_func_copysignl_use = x"yes"; then
- for ac_func in copysignl
+
+for ac_func in copysignl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16794: 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 16799 "configure"
-#include "confdefs.h"
+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. */
-#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:16822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _copysignl declaration""... $ac_c" 1>&6
-echo "configure:16849: checking for _copysignl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _copysignl declaration" >&5
+echo $ECHO_N "checking for _copysignl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__copysignl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__copysignl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__copysignl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16864 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_copysignl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:16871: \"$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
glibcxx_cv_func__copysignl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__copysignl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__copysignl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__copysignl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__copysignl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__copysignl_use" >&6
if test x$glibcxx_cv_func__copysignl_use = x"yes"; then
- for ac_func in _copysignl
+
+for ac_func in _copysignl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16898: 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 16903 "configure"
-#include "confdefs.h"
+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. */
-#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:16926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for atan2l declaration""... $ac_c" 1>&6
-echo "configure:16956: checking for atan2l declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for atan2l declaration" >&5
+echo $ECHO_N "checking for atan2l declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_atan2l_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_atan2l_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_atan2l_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 16971 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
atan2l(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:16978: \"$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
glibcxx_cv_func_atan2l_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_atan2l_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_atan2l_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_atan2l_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_atan2l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_atan2l_use" >&6
if test x$glibcxx_cv_func_atan2l_use = x"yes"; then
- for ac_func in atan2l
+
+for ac_func in atan2l
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17005: 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 17010 "configure"
-#include "confdefs.h"
+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. */
-#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:17033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _atan2l declaration""... $ac_c" 1>&6
-echo "configure:17060: checking for _atan2l declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _atan2l declaration" >&5
+echo $ECHO_N "checking for _atan2l declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__atan2l_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__atan2l_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__atan2l_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17075 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_atan2l(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:17082: \"$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
glibcxx_cv_func__atan2l_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__atan2l_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__atan2l_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__atan2l_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__atan2l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__atan2l_use" >&6
if test x$glibcxx_cv_func__atan2l_use = x"yes"; then
- for ac_func in _atan2l
+
+for ac_func in _atan2l
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17109: 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 17114 "configure"
-#include "confdefs.h"
+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. */
-#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:17137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for expl declaration""... $ac_c" 1>&6
-echo "configure:17167: checking for expl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for expl declaration" >&5
+echo $ECHO_N "checking for expl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_expl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_expl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_expl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17182 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
expl(0);
-; return 0; }
-EOF
-if { (eval echo configure:17193: \"$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
glibcxx_cv_func_expl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_expl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_expl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_expl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_expl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_expl_use" >&6
if test x$glibcxx_cv_func_expl_use = x"yes"; then
- for ac_func in expl
+
+for ac_func in expl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17220: 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 17225 "configure"
-#include "confdefs.h"
+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. */
-#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:17248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _expl declaration""... $ac_c" 1>&6
-echo "configure:17275: checking for _expl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _expl declaration" >&5
+echo $ECHO_N "checking for _expl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__expl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__expl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__expl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17290 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_expl(0);
-; return 0; }
-EOF
-if { (eval echo configure:17301: \"$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
glibcxx_cv_func__expl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__expl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__expl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__expl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__expl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__expl_use" >&6
if test x$glibcxx_cv_func__expl_use = x"yes"; then
- for ac_func in _expl
+
+for ac_func in _expl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17328: 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 17333 "configure"
-#include "confdefs.h"
+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. */
-#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:17356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for fabsl declaration""... $ac_c" 1>&6
-echo "configure:17386: checking for fabsl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for fabsl declaration" >&5
+echo $ECHO_N "checking for fabsl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_fabsl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_fabsl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_fabsl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17401 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
fabsl(0);
-; return 0; }
-EOF
-if { (eval echo configure:17412: \"$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
glibcxx_cv_func_fabsl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_fabsl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fabsl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_fabsl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fabsl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fabsl_use" >&6
if test x$glibcxx_cv_func_fabsl_use = x"yes"; then
- for ac_func in fabsl
+
+for ac_func in fabsl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17439: 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 17444 "configure"
-#include "confdefs.h"
+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. */
-#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:17467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _fabsl declaration""... $ac_c" 1>&6
-echo "configure:17494: checking for _fabsl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _fabsl declaration" >&5
+echo $ECHO_N "checking for _fabsl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__fabsl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__fabsl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__fabsl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17509 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_fabsl(0);
-; return 0; }
-EOF
-if { (eval echo configure:17520: \"$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
glibcxx_cv_func__fabsl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__fabsl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fabsl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__fabsl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fabsl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fabsl_use" >&6
if test x$glibcxx_cv_func__fabsl_use = x"yes"; then
- for ac_func in _fabsl
+
+for ac_func in _fabsl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17547: 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 17552 "configure"
-#include "confdefs.h"
+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. */
-#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:17575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for fmodl declaration""... $ac_c" 1>&6
-echo "configure:17605: checking for fmodl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for fmodl declaration" >&5
+echo $ECHO_N "checking for fmodl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_fmodl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_fmodl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_fmodl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17620 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
fmodl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:17627: \"$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
glibcxx_cv_func_fmodl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_fmodl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_fmodl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_fmodl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_fmodl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_fmodl_use" >&6
if test x$glibcxx_cv_func_fmodl_use = x"yes"; then
- for ac_func in fmodl
+
+for ac_func in fmodl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17654: 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 17659 "configure"
-#include "confdefs.h"
+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. */
-#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:17682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _fmodl declaration""... $ac_c" 1>&6
-echo "configure:17709: checking for _fmodl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _fmodl declaration" >&5
+echo $ECHO_N "checking for _fmodl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__fmodl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__fmodl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__fmodl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17724 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_fmodl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:17731: \"$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
glibcxx_cv_func__fmodl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__fmodl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__fmodl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__fmodl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__fmodl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__fmodl_use" >&6
if test x$glibcxx_cv_func__fmodl_use = x"yes"; then
- for ac_func in _fmodl
+
+for ac_func in _fmodl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17758: 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 17763 "configure"
-#include "confdefs.h"
+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. */
-#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:17786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for frexpl declaration""... $ac_c" 1>&6
-echo "configure:17816: checking for frexpl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for frexpl declaration" >&5
+echo $ECHO_N "checking for frexpl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_frexpl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_frexpl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_frexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17831 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
frexpl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:17838: \"$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
glibcxx_cv_func_frexpl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_frexpl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_frexpl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_frexpl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_frexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_frexpl_use" >&6
if test x$glibcxx_cv_func_frexpl_use = x"yes"; then
- for ac_func in frexpl
+
+for ac_func in frexpl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17865: 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 17870 "configure"
-#include "confdefs.h"
+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. */
-#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:17893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _frexpl declaration""... $ac_c" 1>&6
-echo "configure:17920: checking for _frexpl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _frexpl declaration" >&5
+echo $ECHO_N "checking for _frexpl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__frexpl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__frexpl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__frexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 17935 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_frexpl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:17942: \"$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
glibcxx_cv_func__frexpl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__frexpl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__frexpl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__frexpl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__frexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__frexpl_use" >&6
if test x$glibcxx_cv_func__frexpl_use = x"yes"; then
- for ac_func in _frexpl
+
+for ac_func in _frexpl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:17969: 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 17974 "configure"
-#include "confdefs.h"
+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. */
-#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:17997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for hypotl declaration""... $ac_c" 1>&6
-echo "configure:18027: checking for hypotl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for hypotl declaration" >&5
+echo $ECHO_N "checking for hypotl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_hypotl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_hypotl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_hypotl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18042 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
hypotl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:18049: \"$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
glibcxx_cv_func_hypotl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_hypotl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_hypotl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_hypotl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_hypotl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_hypotl_use" >&6
if test x$glibcxx_cv_func_hypotl_use = x"yes"; then
- for ac_func in hypotl
+
+for ac_func in hypotl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18076: 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 18081 "configure"
-#include "confdefs.h"
+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. */
-#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:18104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _hypotl declaration""... $ac_c" 1>&6
-echo "configure:18131: checking for _hypotl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _hypotl declaration" >&5
+echo $ECHO_N "checking for _hypotl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__hypotl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__hypotl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__hypotl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18146 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_hypotl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:18153: \"$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
glibcxx_cv_func__hypotl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__hypotl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__hypotl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__hypotl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__hypotl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__hypotl_use" >&6
if test x$glibcxx_cv_func__hypotl_use = x"yes"; then
- for ac_func in _hypotl
+
+for ac_func in _hypotl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18180: 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 18185 "configure"
-#include "confdefs.h"
+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. */
-#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:18208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for ldexpl declaration""... $ac_c" 1>&6
-echo "configure:18238: checking for ldexpl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for ldexpl declaration" >&5
+echo $ECHO_N "checking for ldexpl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_ldexpl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_ldexpl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_ldexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18253 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
ldexpl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:18260: \"$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
glibcxx_cv_func_ldexpl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_ldexpl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_ldexpl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_ldexpl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_ldexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_ldexpl_use" >&6
if test x$glibcxx_cv_func_ldexpl_use = x"yes"; then
- for ac_func in ldexpl
+
+for ac_func in ldexpl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18287: 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 18292 "configure"
-#include "confdefs.h"
+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. */
-#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:18315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _ldexpl declaration""... $ac_c" 1>&6
-echo "configure:18342: checking for _ldexpl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _ldexpl declaration" >&5
+echo $ECHO_N "checking for _ldexpl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__ldexpl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__ldexpl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__ldexpl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18357 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_ldexpl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:18364: \"$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
glibcxx_cv_func__ldexpl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__ldexpl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__ldexpl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__ldexpl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__ldexpl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__ldexpl_use" >&6
if test x$glibcxx_cv_func__ldexpl_use = x"yes"; then
- for ac_func in _ldexpl
+
+for ac_func in _ldexpl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18391: 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 18396 "configure"
-#include "confdefs.h"
+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. */
-#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:18419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for logl declaration""... $ac_c" 1>&6
-echo "configure:18449: checking for logl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for logl declaration" >&5
+echo $ECHO_N "checking for logl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_logl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_logl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_logl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18464 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
logl(0);
-; return 0; }
-EOF
-if { (eval echo configure:18475: \"$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
glibcxx_cv_func_logl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_logl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_logl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_logl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_logl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_logl_use" >&6
if test x$glibcxx_cv_func_logl_use = x"yes"; then
- for ac_func in logl
+
+for ac_func in logl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18502: 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 18507 "configure"
-#include "confdefs.h"
+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. */
-#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:18530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _logl declaration""... $ac_c" 1>&6
-echo "configure:18557: checking for _logl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _logl declaration" >&5
+echo $ECHO_N "checking for _logl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__logl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__logl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__logl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18572 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_logl(0);
-; return 0; }
-EOF
-if { (eval echo configure:18583: \"$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
glibcxx_cv_func__logl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__logl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__logl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__logl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__logl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__logl_use" >&6
if test x$glibcxx_cv_func__logl_use = x"yes"; then
- for ac_func in _logl
+
+for ac_func in _logl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18610: 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 18615 "configure"
-#include "confdefs.h"
+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. */
-#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:18638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for log10l declaration""... $ac_c" 1>&6
-echo "configure:18668: checking for log10l declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for log10l declaration" >&5
+echo $ECHO_N "checking for log10l declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_log10l_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_log10l_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_log10l_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18683 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
log10l(0);
-; return 0; }
-EOF
-if { (eval echo configure:18694: \"$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
glibcxx_cv_func_log10l_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_log10l_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_log10l_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_log10l_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_log10l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_log10l_use" >&6
if test x$glibcxx_cv_func_log10l_use = x"yes"; then
- for ac_func in log10l
+
+for ac_func in log10l
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18721: 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 18726 "configure"
-#include "confdefs.h"
+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. */
-#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:18749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _log10l declaration""... $ac_c" 1>&6
-echo "configure:18776: checking for _log10l declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _log10l declaration" >&5
+echo $ECHO_N "checking for _log10l declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__log10l_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__log10l_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__log10l_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18791 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_log10l(0);
-; return 0; }
-EOF
-if { (eval echo configure:18802: \"$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
glibcxx_cv_func__log10l_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__log10l_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__log10l_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__log10l_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__log10l_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__log10l_use" >&6
if test x$glibcxx_cv_func__log10l_use = x"yes"; then
- for ac_func in _log10l
+
+for ac_func in _log10l
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18829: 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 18834 "configure"
-#include "confdefs.h"
+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. */
-#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:18857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for modfl declaration""... $ac_c" 1>&6
-echo "configure:18887: checking for modfl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for modfl declaration" >&5
+echo $ECHO_N "checking for modfl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_modfl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_modfl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_modfl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 18902 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
modfl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:18909: \"$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
glibcxx_cv_func_modfl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_modfl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_modfl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_modfl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_modfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_modfl_use" >&6
if test x$glibcxx_cv_func_modfl_use = x"yes"; then
- for ac_func in modfl
+
+for ac_func in modfl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18936: 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 18941 "configure"
-#include "confdefs.h"
+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. */
-#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:18964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _modfl declaration""... $ac_c" 1>&6
-echo "configure:18991: checking for _modfl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _modfl declaration" >&5
+echo $ECHO_N "checking for _modfl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__modfl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__modfl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__modfl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19006 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_modfl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:19013: \"$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
glibcxx_cv_func__modfl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__modfl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__modfl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__modfl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__modfl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__modfl_use" >&6
if test x$glibcxx_cv_func__modfl_use = x"yes"; then
- for ac_func in _modfl
+
+for ac_func in _modfl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19040: 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 19045 "configure"
-#include "confdefs.h"
+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. */
-#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:19068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for powl declaration""... $ac_c" 1>&6
-echo "configure:19098: checking for powl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for powl declaration" >&5
+echo $ECHO_N "checking for powl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_powl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_powl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_powl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19113 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
powl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:19120: \"$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
glibcxx_cv_func_powl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_powl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_powl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_powl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_powl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_powl_use" >&6
if test x$glibcxx_cv_func_powl_use = x"yes"; then
- for ac_func in powl
+
+for ac_func in powl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19147: 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 19152 "configure"
-#include "confdefs.h"
+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. */
-#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:19175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _powl declaration""... $ac_c" 1>&6
-echo "configure:19202: checking for _powl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _powl declaration" >&5
+echo $ECHO_N "checking for _powl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__powl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__powl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__powl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19217 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_powl(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:19224: \"$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
glibcxx_cv_func__powl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__powl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__powl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__powl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__powl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__powl_use" >&6
if test x$glibcxx_cv_func__powl_use = x"yes"; then
- for ac_func in _powl
+
+for ac_func in _powl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19251: 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 19256 "configure"
-#include "confdefs.h"
+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. */
-#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:19279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for sqrtl declaration""... $ac_c" 1>&6
-echo "configure:19309: checking for sqrtl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for sqrtl declaration" >&5
+echo $ECHO_N "checking for sqrtl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_sqrtl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_sqrtl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_sqrtl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19324 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
sqrtl(0);
-; return 0; }
-EOF
-if { (eval echo configure:19335: \"$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
glibcxx_cv_func_sqrtl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_sqrtl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sqrtl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_sqrtl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sqrtl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sqrtl_use" >&6
if test x$glibcxx_cv_func_sqrtl_use = x"yes"; then
- for ac_func in sqrtl
+
+for ac_func in sqrtl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19362: 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 19367 "configure"
-#include "confdefs.h"
+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. */
-#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:19390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _sqrtl declaration""... $ac_c" 1>&6
-echo "configure:19417: checking for _sqrtl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _sqrtl declaration" >&5
+echo $ECHO_N "checking for _sqrtl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__sqrtl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__sqrtl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__sqrtl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19432 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_sqrtl(0);
-; return 0; }
-EOF
-if { (eval echo configure:19443: \"$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
glibcxx_cv_func__sqrtl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__sqrtl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sqrtl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__sqrtl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sqrtl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sqrtl_use" >&6
if test x$glibcxx_cv_func__sqrtl_use = x"yes"; then
- for ac_func in _sqrtl
+
+for ac_func in _sqrtl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19470: 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 19475 "configure"
-#include "confdefs.h"
+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. */
-#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:19498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for sincosl declaration""... $ac_c" 1>&6
-echo "configure:19528: checking for sincosl declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for sincosl declaration" >&5
+echo $ECHO_N "checking for sincosl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_sincosl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_sincosl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_sincosl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19543 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
sincosl(0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:19550: \"$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
glibcxx_cv_func_sincosl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_sincosl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_sincosl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_sincosl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_sincosl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_sincosl_use" >&6
if test x$glibcxx_cv_func_sincosl_use = x"yes"; then
- for ac_func in sincosl
+
+for ac_func in sincosl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19577: 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 19582 "configure"
-#include "confdefs.h"
+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. */
-#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:19605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _sincosl declaration""... $ac_c" 1>&6
-echo "configure:19632: checking for _sincosl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _sincosl declaration" >&5
+echo $ECHO_N "checking for _sincosl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__sincosl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__sincosl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__sincosl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19647 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
_sincosl(0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:19654: \"$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
glibcxx_cv_func__sincosl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__sincosl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__sincosl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__sincosl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__sincosl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__sincosl_use" >&6
if test x$glibcxx_cv_func__sincosl_use = x"yes"; then
- for ac_func in _sincosl
+
+for ac_func in _sincosl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19681: 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 19686 "configure"
-#include "confdefs.h"
+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. */
-#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:19709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
fi
-
-
- echo $ac_n "checking for finitel declaration""... $ac_c" 1>&6
-echo "configure:19739: checking for finitel declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for finitel declaration" >&5
+echo $ECHO_N "checking for finitel declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_finitel_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_finitel_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_finitel_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19754 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
finitel(0);
-; return 0; }
-EOF
-if { (eval echo configure:19765: \"$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
glibcxx_cv_func_finitel_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_finitel_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_finitel_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_finitel_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_finitel_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_finitel_use" >&6
if test x$glibcxx_cv_func_finitel_use = x"yes"; then
- for ac_func in finitel
+
+for ac_func in finitel
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19792: 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 19797 "configure"
-#include "confdefs.h"
+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. */
-#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:19820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
else
-
- echo $ac_n "checking for _finitel declaration""... $ac_c" 1>&6
-echo "configure:19847: checking for _finitel declaration" >&5
+
+ echo "$as_me:$LINENO: checking for _finitel declaration" >&5
+echo $ECHO_N "checking for _finitel declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func__finitel_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func__finitel_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func__finitel_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19862 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-
-int main() {
+
+int
+main ()
+{
_finitel(0);
-; return 0; }
-EOF
-if { (eval echo configure:19873: \"$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
glibcxx_cv_func__finitel_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__finitel_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__finitel_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__finitel_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__finitel_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__finitel_use" >&6
if test x$glibcxx_cv_func__finitel_use = x"yes"; then
- for ac_func in _finitel
+
+for ac_func in _finitel
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:19900: 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 19905 "configure"
-#include "confdefs.h"
+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. */
-#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:19928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
@@ -19952,415 +41494,641 @@ done
fi
-
-
- echo $ac_n "checking for _float trig functions""... $ac_c" 1>&6
-echo "configure:19959: checking for _float trig functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func__float_trig_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+
+ echo "$as_me:$LINENO: checking for _float trig functions" >&5
+echo $ECHO_N "checking for _float trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__float_trig_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 19973 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
`for x in _acosf _asinf _atanf \
_cosf _sinf _tanf \
- _coshf _sinhf _tanhf; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:19982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ _coshf _sinhf _tanhf; do echo "$x (0);"; done`
+ ;
+ 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__float_trig_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__float_trig_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__float_trig_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__float_trig_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__float_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__float_trig_use" >&6
if test x$glibcxx_cv_func__float_trig_use = x"yes"; then
- for ac_func in _acosf _asinf _atanf \
+
+
+
+
+
+
+
+
+
+for ac_func in _acosf _asinf _atanf \
_cosf _sinf _tanf \
_coshf _sinhf _tanhf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:20008: 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 20013 "configure"
-#include "confdefs.h"
+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. */
-#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:20036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-
- echo $ac_n "checking for _float round functions""... $ac_c" 1>&6
-echo "configure:20064: checking for _float round functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func__float_round_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for _float round functions" >&5
+echo $ECHO_N "checking for _float round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__float_round_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20078 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
- `for x in _ceilf _floorf; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:20085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+int
+main ()
+{
+ `for x in _ceilf _floorf; do echo "$x (0);"; done`
+ ;
+ 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__float_round_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__float_round_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__float_round_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__float_round_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__float_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__float_round_use" >&6
if test x$glibcxx_cv_func__float_round_use = x"yes"; then
- for ac_func in _ceilf _floorf
+
+
+for ac_func in _ceilf _floorf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:20109: 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 20114 "configure"
-#include "confdefs.h"
+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. */
-#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:20137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-
- echo $ac_n "checking for _long double trig functions""... $ac_c" 1>&6
-echo "configure:20166: checking for _long double trig functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func__long_double_trig_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for _long double trig functions" >&5
+echo $ECHO_N "checking for _long double trig functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__long_double_trig_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20180 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
`for x in _acosl _asinl _atanl \
_cosl _sinl _tanl \
- _coshl _sinhl _tanhl; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:20189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ _coshl _sinhl _tanhl; do echo "$x (0);"; done`
+ ;
+ 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__long_double_trig_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__long_double_trig_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__long_double_trig_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__long_double_trig_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__long_double_trig_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__long_double_trig_use" >&6
if test x$glibcxx_cv_func__long_double_trig_use = x"yes"; then
- for ac_func in _acosl _asinl _atanl \
+
+
+
+
+
+
+
+
+
+for ac_func in _acosl _asinl _atanl \
_cosl _sinl _tanl \
_coshl _sinhl _tanhl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:20215: 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 20220 "configure"
-#include "confdefs.h"
+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. */
-#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:20243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-
- echo $ac_n "checking for _long double round functions""... $ac_c" 1>&6
-echo "configure:20271: checking for _long double round functions" >&5
- if eval "test \"`echo '$''{'glibcxx_cv_func__long_double_round_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ echo "$as_me:$LINENO: checking for _long double round functions" >&5
+echo $ECHO_N "checking for _long double round functions... $ECHO_C" >&6
+ if test "${glibcxx_cv_func__long_double_round_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20285 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
- `for x in _ceill _floorl; do echo "$x (0);"; done`
-; return 0; }
-EOF
-if { (eval echo configure:20292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+int
+main ()
+{
+ `for x in _ceill _floorl; do echo "$x (0);"; done`
+ ;
+ 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__long_double_round_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func__long_double_round_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func__long_double_round_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func__long_double_round_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func__long_double_round_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func__long_double_round_use" >&6
if test x$glibcxx_cv_func__long_double_round_use = x"yes"; then
- for ac_func in _ceill _floorl
+
+
+for ac_func in _ceill _floorl
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:20316: 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 20321 "configure"
-#include "confdefs.h"
+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. */
-#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:20344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
@@ -20370,1210 +42138,1798 @@ done
LIBS="$ac_save_LIBS"
CXXFLAGS="$ac_save_CXXFLAGS"
-
-
- echo $ac_n "checking for __builtin_abs declaration""... $ac_c" 1>&6
-echo "configure:20377: checking for __builtin_abs declaration" >&5
+
+
+ echo "$as_me:$LINENO: checking for __builtin_abs declaration" >&5
+echo $ECHO_N "checking for __builtin_abs declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_abs_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_abs_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_abs_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20392 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_abs(0);
-; return 0; }
-EOF
-if { (eval echo configure:20399: \"$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
glibcxx_cv_func___builtin_abs_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_abs_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_abs_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_abs_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_use" >&6
if test x$glibcxx_cv_func___builtin_abs_use = x"yes"; then
- echo $ac_n "checking for __builtin_abs linkage""... $ac_c" 1>&6
-echo "configure:20423: checking for __builtin_abs linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_abs linkage" >&5
+echo $ECHO_N "checking for __builtin_abs linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_abs_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_abs_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 20430 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_abs_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_abs(0);
-; return 0; }
-EOF
-if { (eval echo configure:20437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_abs_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_abs_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_abs_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_abs_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_link" >&6
if test x$glibcxx_cv_func___builtin_abs_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_abs | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_fabsf declaration""... $ac_c" 1>&6
-echo "configure:20463: checking for __builtin_fabsf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_fabsf declaration" >&5
+echo $ECHO_N "checking for __builtin_fabsf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_fabsf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_fabsf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_fabsf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20478 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_fabsf(0);
-; return 0; }
-EOF
-if { (eval echo configure:20485: \"$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
glibcxx_cv_func___builtin_fabsf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_fabsf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabsf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_fabsf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_use" >&6
if test x$glibcxx_cv_func___builtin_fabsf_use = x"yes"; then
- echo $ac_n "checking for __builtin_fabsf linkage""... $ac_c" 1>&6
-echo "configure:20509: checking for __builtin_fabsf linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_fabsf linkage" >&5
+echo $ECHO_N "checking for __builtin_fabsf linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_fabsf_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_fabsf_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 20516 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_fabsf_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_fabsf(0);
-; return 0; }
-EOF
-if { (eval echo configure:20523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_fabsf_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_fabsf_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabsf_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_fabsf_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_link" >&6
if test x$glibcxx_cv_func___builtin_fabsf_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_fabsf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_fabs declaration""... $ac_c" 1>&6
-echo "configure:20549: checking for __builtin_fabs declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_fabs declaration" >&5
+echo $ECHO_N "checking for __builtin_fabs declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_fabs_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_fabs_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_fabs_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20564 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_fabs(0);
-; return 0; }
-EOF
-if { (eval echo configure:20571: \"$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
glibcxx_cv_func___builtin_fabs_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_fabs_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabs_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_fabs_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_use" >&6
if test x$glibcxx_cv_func___builtin_fabs_use = x"yes"; then
- echo $ac_n "checking for __builtin_fabs linkage""... $ac_c" 1>&6
-echo "configure:20595: checking for __builtin_fabs linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_fabs linkage" >&5
+echo $ECHO_N "checking for __builtin_fabs linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_fabs_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_fabs_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 20602 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_fabs_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_fabs(0);
-; return 0; }
-EOF
-if { (eval echo configure:20609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_fabs_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_fabs_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabs_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_fabs_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_link" >&6
if test x$glibcxx_cv_func___builtin_fabs_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_fabs | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_fabsl declaration""... $ac_c" 1>&6
-echo "configure:20635: checking for __builtin_fabsl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_fabsl declaration" >&5
+echo $ECHO_N "checking for __builtin_fabsl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_fabsl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_fabsl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_fabsl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20650 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_fabsl(0);
-; return 0; }
-EOF
-if { (eval echo configure:20657: \"$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
glibcxx_cv_func___builtin_fabsl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_fabsl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabsl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_fabsl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_use" >&6
if test x$glibcxx_cv_func___builtin_fabsl_use = x"yes"; then
- echo $ac_n "checking for __builtin_fabsl linkage""... $ac_c" 1>&6
-echo "configure:20681: checking for __builtin_fabsl linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_fabsl linkage" >&5
+echo $ECHO_N "checking for __builtin_fabsl linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_fabsl_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_fabsl_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 20688 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_fabsl_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_fabsl(0);
-; return 0; }
-EOF
-if { (eval echo configure:20695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_fabsl_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_fabsl_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_fabsl_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_fabsl_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_link" >&6
if test x$glibcxx_cv_func___builtin_fabsl_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_fabsl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_labs declaration""... $ac_c" 1>&6
-echo "configure:20721: checking for __builtin_labs declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_labs declaration" >&5
+echo $ECHO_N "checking for __builtin_labs declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_labs_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_labs_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_labs_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20736 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_labs(0);
-; return 0; }
-EOF
-if { (eval echo configure:20743: \"$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
glibcxx_cv_func___builtin_labs_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_labs_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_labs_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_labs_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_use" >&6
if test x$glibcxx_cv_func___builtin_labs_use = x"yes"; then
- echo $ac_n "checking for __builtin_labs linkage""... $ac_c" 1>&6
-echo "configure:20767: checking for __builtin_labs linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_labs linkage" >&5
+echo $ECHO_N "checking for __builtin_labs linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_labs_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_labs_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 20774 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_labs_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_labs(0);
-; return 0; }
-EOF
-if { (eval echo configure:20781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_labs_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_labs_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_labs_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_labs_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_link" >&6
if test x$glibcxx_cv_func___builtin_labs_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_labs | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_sqrtf declaration""... $ac_c" 1>&6
-echo "configure:20808: checking for __builtin_sqrtf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_sqrtf declaration" >&5
+echo $ECHO_N "checking for __builtin_sqrtf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sqrtf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sqrtf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_sqrtf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20823 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_sqrtf(0);
-; return 0; }
-EOF
-if { (eval echo configure:20830: \"$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
glibcxx_cv_func___builtin_sqrtf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sqrtf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_sqrtf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_use" >&6
if test x$glibcxx_cv_func___builtin_sqrtf_use = x"yes"; then
- echo $ac_n "checking for __builtin_sqrtf linkage""... $ac_c" 1>&6
-echo "configure:20854: checking for __builtin_sqrtf linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_sqrtf linkage" >&5
+echo $ECHO_N "checking for __builtin_sqrtf linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sqrtf_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sqrtf_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 20861 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_sqrtf_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_sqrtf(0);
-; return 0; }
-EOF
-if { (eval echo configure:20868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_sqrtf_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sqrtf_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtf_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_sqrtf_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_link" >&6
if test x$glibcxx_cv_func___builtin_sqrtf_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_sqrtf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_sqrt declaration""... $ac_c" 1>&6
-echo "configure:20894: checking for __builtin_sqrt declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_sqrt declaration" >&5
+echo $ECHO_N "checking for __builtin_sqrt declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sqrt_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sqrt_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_sqrt_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20909 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_sqrt(0);
-; return 0; }
-EOF
-if { (eval echo configure:20916: \"$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
glibcxx_cv_func___builtin_sqrt_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sqrt_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrt_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_sqrt_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_use" >&6
if test x$glibcxx_cv_func___builtin_sqrt_use = x"yes"; then
- echo $ac_n "checking for __builtin_sqrt linkage""... $ac_c" 1>&6
-echo "configure:20940: checking for __builtin_sqrt linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_sqrt linkage" >&5
+echo $ECHO_N "checking for __builtin_sqrt linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sqrt_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sqrt_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 20947 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_sqrt_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_sqrt(0);
-; return 0; }
-EOF
-if { (eval echo configure:20954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_sqrt_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sqrt_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrt_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_sqrt_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_link" >&6
if test x$glibcxx_cv_func___builtin_sqrt_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_sqrt | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_sqrtl declaration""... $ac_c" 1>&6
-echo "configure:20980: checking for __builtin_sqrtl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_sqrtl declaration" >&5
+echo $ECHO_N "checking for __builtin_sqrtl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sqrtl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sqrtl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_sqrtl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 20995 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_sqrtl(0);
-; return 0; }
-EOF
-if { (eval echo configure:21002: \"$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
glibcxx_cv_func___builtin_sqrtl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sqrtl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_sqrtl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_use" >&6
if test x$glibcxx_cv_func___builtin_sqrtl_use = x"yes"; then
- echo $ac_n "checking for __builtin_sqrtl linkage""... $ac_c" 1>&6
-echo "configure:21026: checking for __builtin_sqrtl linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_sqrtl linkage" >&5
+echo $ECHO_N "checking for __builtin_sqrtl linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sqrtl_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sqrtl_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 21033 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_sqrtl_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_sqrtl(0);
-; return 0; }
-EOF
-if { (eval echo configure:21040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_sqrtl_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sqrtl_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sqrtl_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_sqrtl_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_link" >&6
if test x$glibcxx_cv_func___builtin_sqrtl_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_sqrtl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_sinf declaration""... $ac_c" 1>&6
-echo "configure:21067: checking for __builtin_sinf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_sinf declaration" >&5
+echo $ECHO_N "checking for __builtin_sinf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sinf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sinf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_sinf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 21082 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_sinf(0);
-; return 0; }
-EOF
-if { (eval echo configure:21089: \"$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
glibcxx_cv_func___builtin_sinf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sinf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sinf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_sinf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_use" >&6
if test x$glibcxx_cv_func___builtin_sinf_use = x"yes"; then
- echo $ac_n "checking for __builtin_sinf linkage""... $ac_c" 1>&6
-echo "configure:21113: checking for __builtin_sinf linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_sinf linkage" >&5
+echo $ECHO_N "checking for __builtin_sinf linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sinf_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sinf_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 21120 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_sinf_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_sinf(0);
-; return 0; }
-EOF
-if { (eval echo configure:21127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_sinf_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sinf_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sinf_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_sinf_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_link" >&6
if test x$glibcxx_cv_func___builtin_sinf_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_sinf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_sin declaration""... $ac_c" 1>&6
-echo "configure:21153: checking for __builtin_sin declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_sin declaration" >&5
+echo $ECHO_N "checking for __builtin_sin declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sin_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sin_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_sin_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 21168 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_sin(0);
-; return 0; }
-EOF
-if { (eval echo configure:21175: \"$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
glibcxx_cv_func___builtin_sin_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sin_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sin_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_sin_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_use" >&6
if test x$glibcxx_cv_func___builtin_sin_use = x"yes"; then
- echo $ac_n "checking for __builtin_sin linkage""... $ac_c" 1>&6
-echo "configure:21199: checking for __builtin_sin linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_sin linkage" >&5
+echo $ECHO_N "checking for __builtin_sin linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sin_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sin_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 21206 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_sin_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_sin(0);
-; return 0; }
-EOF
-if { (eval echo configure:21213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_sin_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sin_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sin_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_sin_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_link" >&6
if test x$glibcxx_cv_func___builtin_sin_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_sin | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_sinl declaration""... $ac_c" 1>&6
-echo "configure:21239: checking for __builtin_sinl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_sinl declaration" >&5
+echo $ECHO_N "checking for __builtin_sinl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sinl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sinl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_sinl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 21254 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_sinl(0);
-; return 0; }
-EOF
-if { (eval echo configure:21261: \"$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
glibcxx_cv_func___builtin_sinl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sinl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sinl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_sinl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_use" >&6
if test x$glibcxx_cv_func___builtin_sinl_use = x"yes"; then
- echo $ac_n "checking for __builtin_sinl linkage""... $ac_c" 1>&6
-echo "configure:21285: checking for __builtin_sinl linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_sinl linkage" >&5
+echo $ECHO_N "checking for __builtin_sinl linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_sinl_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_sinl_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 21292 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_sinl_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_sinl(0);
-; return 0; }
-EOF
-if { (eval echo configure:21299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_sinl_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_sinl_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_sinl_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_sinl_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_link" >&6
if test x$glibcxx_cv_func___builtin_sinl_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_sinl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_cosf declaration""... $ac_c" 1>&6
-echo "configure:21326: checking for __builtin_cosf declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_cosf declaration" >&5
+echo $ECHO_N "checking for __builtin_cosf declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_cosf_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_cosf_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_cosf_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 21341 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_cosf(0);
-; return 0; }
-EOF
-if { (eval echo configure:21348: \"$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
glibcxx_cv_func___builtin_cosf_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_cosf_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cosf_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_cosf_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_use" >&6
if test x$glibcxx_cv_func___builtin_cosf_use = x"yes"; then
- echo $ac_n "checking for __builtin_cosf linkage""... $ac_c" 1>&6
-echo "configure:21372: checking for __builtin_cosf linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_cosf linkage" >&5
+echo $ECHO_N "checking for __builtin_cosf linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_cosf_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_cosf_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 21379 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_cosf_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_cosf(0);
-; return 0; }
-EOF
-if { (eval echo configure:21386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_cosf_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_cosf_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cosf_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_cosf_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_link" >&6
if test x$glibcxx_cv_func___builtin_cosf_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_cosf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_cos declaration""... $ac_c" 1>&6
-echo "configure:21412: checking for __builtin_cos declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_cos declaration" >&5
+echo $ECHO_N "checking for __builtin_cos declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_cos_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_cos_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_cos_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 21427 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_cos(0);
-; return 0; }
-EOF
-if { (eval echo configure:21434: \"$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
glibcxx_cv_func___builtin_cos_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_cos_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cos_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_cos_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_use" >&6
if test x$glibcxx_cv_func___builtin_cos_use = x"yes"; then
- echo $ac_n "checking for __builtin_cos linkage""... $ac_c" 1>&6
-echo "configure:21458: checking for __builtin_cos linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_cos linkage" >&5
+echo $ECHO_N "checking for __builtin_cos linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_cos_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_cos_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 21465 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_cos_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_cos(0);
-; return 0; }
-EOF
-if { (eval echo configure:21472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_cos_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_cos_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cos_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_cos_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_link" >&6
if test x$glibcxx_cv_func___builtin_cos_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_cos | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
-
- echo $ac_n "checking for __builtin_cosl declaration""... $ac_c" 1>&6
-echo "configure:21498: checking for __builtin_cosl declaration" >&5
+
+ echo "$as_me:$LINENO: checking for __builtin_cosl declaration" >&5
+echo $ECHO_N "checking for __builtin_cosl declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_cosl_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_cosl_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func___builtin_cosl_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 21513 "configure"
-#include "confdefs.h"
+
+
+ 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 <math.h>
-int main() {
+int
+main ()
+{
__builtin_cosl(0);
-; return 0; }
-EOF
-if { (eval echo configure:21520: \"$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
glibcxx_cv_func___builtin_cosl_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_cosl_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cosl_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func___builtin_cosl_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_use" >&6
if test x$glibcxx_cv_func___builtin_cosl_use = x"yes"; then
- echo $ac_n "checking for __builtin_cosl linkage""... $ac_c" 1>&6
-echo "configure:21544: checking for __builtin_cosl linkage" >&5
+ echo "$as_me:$LINENO: checking for __builtin_cosl linkage" >&5
+echo $ECHO_N "checking for __builtin_cosl linkage... $ECHO_C" >&6
if test x${glibcxx_cv_func___builtin_cosl_link+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func___builtin_cosl_link'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 21551 "configure"
-#include "confdefs.h"
+ if test "${glibcxx_cv_func___builtin_cosl_link+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. */
#include <math.h>
-int main() {
+int
+main ()
+{
__builtin_cosl(0);
-; return 0; }
-EOF
-if { (eval echo configure:21558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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
glibcxx_cv_func___builtin_cosl_link=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func___builtin_cosl_link=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func___builtin_cosl_link=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
fi
- echo "$ac_t""$glibcxx_cv_func___builtin_cosl_link" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_link" >&5
+echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_link" >&6
if test x$glibcxx_cv_func___builtin_cosl_link = x"yes"; then
ac_tr_func=HAVE_`echo __builtin_cosl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define ${ac_tr_func} 1
-EOF
+_ACEOF
fi
fi
@@ -21581,2229 +43937,15366 @@ EOF
dummyvar=no
if test x$dummyvar = x"yes"; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_ABS 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_LABS 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_COS 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_COSF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_COSL 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_FABS 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_FABSF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_FABSL 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_SIN 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_SINF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_SINL 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_SQRT 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_SQRTF 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE___BUILTIN_SQRTL 1
-EOF
+_ACEOF
fi
-
- echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:21645: checking for main in -lm" >&5
-ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 21653 "configure"
-#include "confdefs.h"
+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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:21660: \"$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"
+
+
+for ac_func in nan copysignf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+done
- LIBS="-lm $LIBS"
-else
- echo "$ac_t""no" 1>&6
+
+for ac_func in __signbit
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
fi
+done
- for ac_func in nan copysignf
+
+for ac_func in __signbitf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21690: 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 21695 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+fi
+done
+
+ if test x$ac_cv_func_copysignl = x"yes"; then
+
+for ac_func in __signbitl
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:21718: \"$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 "$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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+fi
+done
+
+ fi
+
+ # XXX Review this. Nothing uses it.
+ if test -n "$LIBMATHOBJS"; then
+ need_libmath=yes
+ fi
+
+
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
+int
+main ()
+{
+mbstate_t teststate;
+ ;
+ 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
+ have_mbstate_t=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
+
+have_mbstate_t=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
+ if test x"$have_mbstate_t" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MBSTATE_T 1
+_ACEOF
+
+ fi
+
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.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
-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
-
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ ac_has_wchar_h=yes
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+ ac_has_wchar_h=no
fi
+
done
- for ac_func in __signbit
+for ac_header in wctype.h
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21747: 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_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
- cat > conftest.$ac_ext <<EOF
-#line 21752 "configure"
-#include "confdefs.h"
+ 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
+ ac_has_wctype_h=yes
+else
+ ac_has_wctype_h=no
+fi
+
+done
+
+
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
+ test x"$ac_has_wctype_h" = xyes &&
+ test x"$enable_c_mbchar" != xno; then
+
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
+int
+main ()
+{
+int i = WCHAR_MIN; int j = WCHAR_MAX;
+ ;
+ 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
+ has_wchar_minmax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
+
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
+ #include <stddef.h>
+int
+main ()
+{
+wint_t i = WEOF;
+ ;
+ 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
+ has_weof=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
+
+
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+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. */
-#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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
+
+
-int main() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:21775: \"$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 "$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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
+ if test x"$has_weof" = xyes &&
+ test x"$has_wchar_minmax" = xyes &&
+ test x"$ac_wfuncs" = xyes;
+ then
+ ac_isoC99_wchar_t=yes
+ else
+ ac_isoC99_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_header_iconv_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
+fi
+if test $ac_cv_header_iconv_h = yes; then
+ ac_has_iconv_h=yes
+else
+ ac_has_iconv_h=no
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
-
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_langinfo_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+ ac_has_langinfo_h=yes
+else
+ ac_has_langinfo_h=no
+fi
+
+
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv $LIBS"
+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. */
+
+/* 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 iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+ libiconv="-liconv"
+fi
+
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libiconv"
+
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
fi
done
- for ac_func in __signbitf
+
+ LIBS="$ac_save_LIBS"
+
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
+ if test x"$ac_has_iconv_h" = xyes &&
+ test x"$ac_has_langinfo_h" = xyes &&
+ test x"$ac_XPG2funcs" = xyes;
+ then
+ ac_XPG2_wchar_t=yes
+ else
+ ac_XPG2_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_WCHAR_T 1
+_ACEOF
+
+ enable_wchar_t=yes
+ fi
+ fi
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
+
+
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
+
+
+ echo "$as_me:$LINENO: checking for strtold declaration" >&5
+echo $ECHO_N "checking for strtold declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_strtold_use+set} != xset; then
+ if test "${glibcxx_cv_func_strtold_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 ()
+{
+ strtold(0, 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
+ glibcxx_cv_func_strtold_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_strtold_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_strtold_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_strtold_use" >&6
+ if test x$glibcxx_cv_func_strtold_use = x"yes"; then
+
+for ac_func in strtold
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21803: 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
+ 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
+
+
+ echo "$as_me:$LINENO: checking for strtof declaration" >&5
+echo $ECHO_N "checking for strtof declaration... $ECHO_C" >&6
+ if test x${glibcxx_cv_func_strtof_use+set} != xset; then
+ if test "${glibcxx_cv_func_strtof_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 21808 "configure"
-#include "confdefs.h"
+
+
+
+ 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 ()
+{
+ strtof(0, 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
+ glibcxx_cv_func_strtof_use=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_strtof_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_strtof_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_strtof_use" >&6
+ if test x$glibcxx_cv_func_strtof_use = x"yes"; then
+
+for ac_func in strtof
+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. */
-#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
+
+ fi
+
+
+for ac_func in drand48
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:21831: \"$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 "$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
+
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+
+
+ # For showmanyc_helper().
+
+
+for ac_header in sys/ioctl.h sys/filio.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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+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
-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
-
+fi
+
+done
+
+
+ if test "${glibcxx_cv_POLL+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 <poll.h>
+int
+main ()
+{
+struct pollfd pfd[1];
+ pfd[0].events = POLLIN;
+ poll(pfd, 1, 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
+ glibcxx_cv_POLL=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_POLL=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ if test $glibcxx_cv_POLL = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_POLL 1
+_ACEOF
+
+ fi
+
+
+ if test "${glibcxx_cv_S_ISREG+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. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_ISREG(buffer.st_mode);
+ ;
+ 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
+ glibcxx_cv_S_ISREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_S_ISREG=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ if test "${glibcxx_cv_S_IFREG+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. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_IFREG & buffer.st_mode;
+ ;
+ 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
+ glibcxx_cv_S_IFREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_S_IFREG=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+ if test $glibcxx_cv_S_ISREG = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_ISREG 1
+_ACEOF
+
+ elif test $glibcxx_cv_S_IFREG = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_IFREG 1
+_ACEOF
+
+ fi
+
+
+ # For xsputn_2().
+
+for ac_header in sys/uio.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
- echo "$ac_t""no" 1>&6
-LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+ 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
- if test x$ac_cv_func_copysignl = x"yes"; then
- for ac_func in __signbitl
+ if test "${glibcxx_cv_WRITEV+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/uio.h>
+int
+main ()
+{
+struct iovec iov[2];
+ writev(0, iov, 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
+ glibcxx_cv_WRITEV=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_WRITEV=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ if test $glibcxx_cv_WRITEV = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_WRITEV 1
+_ACEOF
+
+ fi
+
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LC_MESSAGES 1
+_ACEOF
+
+
+ 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 <setjmp.h>
+int
+main ()
+{
+sigjmp_buf env;
+ while (! sigsetjmp (env, 1))
+ siglongjmp (env, 1);
+
+ ;
+ 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
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIGSETJMP 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MMAP 1
+_ACEOF
+
+ ;;
+
+ *-freebsd*)
+ #os_include_dir="os/bsd/freebsd"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in 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 sys/resource.h sys/stat.h \
+ sys/time.h unistd.h
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21861: 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_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
- cat > conftest.$ac_ext <<EOF
-#line 21866 "configure"
-#include "confdefs.h"
+ 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
+
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+
+
+ # If we're not using GNU ld, then there's no point in even trying these
+ # tests. Check for that first. We should have already tested for gld
+ # by now (in libtool), but require it now just to be safe...
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+
+
+
+ # The name set by libtool depends on the version of libtool. Shame on us
+ # for depending on an impl detail, but c'est la vie. Older versions used
+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
+ # set (hence we're using an older libtool), then set it.
+ if test x${with_gnu_ld+set} != xset; then
+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
+ with_gnu_ld=no
+ else
+ with_gnu_ld=$ac_cv_prog_gnu_ld
+ fi
+ fi
+
+ # Start by getting the version number. I think the libtool test already
+ # does some of this, but throws away the result.
+
+ ldver=`$LD --version 2>/dev/null | head -1 | \
+ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+
+ glibcxx_gnu_ld_version=`echo $ldver | \
+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
+
+ # Set --gc-sections.
+ if test "$with_gnu_ld" = "notbroken"; then
+ # GNU ld it is! Joy and bunny rabbits!
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # Need to do this so that g++ won't try to link in libstdc++
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS='-x c++ -Wl,--gc-sections'
+
+ # Check for -Wl,--gc-sections
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
+ echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
+echo $ECHO_N "checking for ld that supports -Wl,--gc-sections... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ ac_sectionLDflags=yes
+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(void)
+ {
+ try { throw 1; }
+ catch (...) { };
+ return 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
+ ac_sectionLDflags=yes
+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_sectionLDflags=no
+fi
+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"
+ else
+ # this is the suspicious part
+ CFLAGS=''
+ fi
+ if test "$ac_sectionLDflags" = "yes"; then
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+ fi
+ echo "$as_me:$LINENO: result: $ac_sectionLDflags" >&5
+echo "${ECHO_T}$ac_sectionLDflags" >&6
+ fi
+
+ # Set linker optimization flags.
+ if test x"$with_gnu_ld" = x"yes"; then
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ fi
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+
+for ac_func in nan copysignf
+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. */
-#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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+fi
+done
-int main() {
+
+for ac_func in __signbit
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:21889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
fi
-rm -f conftest*
+done
+
+
+for ac_func in __signbitf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
fi
+done
-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
-LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+
+ if test x$ac_cv_func_copysignl = x"yes"; then
+
+for ac_func in __signbitl
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
fi
done
fi
+ # XXX Review this. Nothing uses it.
if test -n "$LIBMATHOBJS"; then
need_libmath=yes
fi
-
-
-
- echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:21924: checking for mbstate_t" >&5
- cat > conftest.$ac_ext <<EOF
-#line 21926 "configure"
-#include "confdefs.h"
+
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
-int main() {
+int
+main ()
+{
mbstate_t teststate;
-; return 0; }
-EOF
-if { (eval echo configure:21933: \"$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
have_mbstate_t=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- have_mbstate_t=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+have_mbstate_t=no
fi
-rm -f conftest*
- echo "$ac_t""$have_mbstate_t" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
if test x"$have_mbstate_t" = xyes; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_MBSTATE_T 1
-EOF
+_ACEOF
fi
- for ac_hdr in wchar.h
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21955: 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 21960 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21965: \"$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"
+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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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 `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
ac_has_wchar_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_wchar_h=no
+ ac_has_wchar_h=no
fi
+
done
- for ac_hdr in wctype.h
+
+for ac_header in wctype.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21996: 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 22001 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22006: \"$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"
+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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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 `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
ac_has_wctype_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_wctype_h=no
+ ac_has_wctype_h=no
fi
+
done
- if test x"$ac_has_wchar_h" = xyes &&
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
test x"$ac_has_wctype_h" = xyes &&
test x"$enable_c_mbchar" != xno; then
- echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:22039: checking for WCHAR_MIN and WCHAR_MAX" >&5
- cat > conftest.$ac_ext <<EOF
-#line 22041 "configure"
-#include "confdefs.h"
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
-int main() {
+int
+main ()
+{
int i = WCHAR_MIN; int j = WCHAR_MAX;
-; return 0; }
-EOF
-if { (eval echo configure:22048: \"$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
has_wchar_minmax=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_wchar_minmax=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
fi
-rm -f conftest*
- echo "$ac_t""$has_wchar_minmax" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
- echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:22061: checking for WEOF" >&5
- cat > conftest.$ac_ext <<EOF
-#line 22063 "configure"
-#include "confdefs.h"
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
#include <stddef.h>
-int main() {
+int
+main ()
+{
wint_t i = WEOF;
-; return 0; }
-EOF
-if { (eval echo configure:22072: \"$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
has_weof=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- has_weof=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
fi
-rm -f conftest*
- echo "$ac_t""$has_weof" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
- ac_wfuncs=yes
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:22088: 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 22093 "configure"
-#include "confdefs.h"
+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. */
-#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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-int main() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:22116: \"$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 "$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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
+ if test x"$has_weof" = xyes &&
+ test x"$has_wchar_minmax" = xyes &&
+ test x"$ac_wfuncs" = xyes;
+ then
+ ac_isoC99_wchar_t=yes
+ else
+ ac_isoC99_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_header_iconv_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
+fi
+if test $ac_cv_header_iconv_h = yes; then
+ ac_has_iconv_h=yes
+else
+ ac_has_iconv_h=no
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
-
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ ac_cv_header_langinfo_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+ ac_has_langinfo_h=yes
+else
+ ac_has_langinfo_h=no
+fi
+
+
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv $LIBS"
+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. */
+
+/* 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 iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+ libiconv="-liconv"
+fi
+
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libiconv"
+
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
fi
done
- for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
- fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
- vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
- mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
- wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
- wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+ LIBS="$ac_save_LIBS"
+
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
+ if test x"$ac_has_iconv_h" = xyes &&
+ test x"$ac_has_langinfo_h" = xyes &&
+ test x"$ac_XPG2funcs" = xyes;
+ then
+ ac_XPG2_wchar_t=yes
+ else
+ ac_XPG2_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_WCHAR_T 1
+_ACEOF
+
+ enable_wchar_t=yes
+ fi
+ fi
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LC_MESSAGES 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_DRAND48 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPAGESIZE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SETENV 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIGSETJMP 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGNF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITEF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HYPOT 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HYPOTF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNAN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANF 1
+_ACEOF
+
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MMAP 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ACOSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ASINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATAN2F 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATANF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_CEILF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGNF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSHF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_EXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FABSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FLOORF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FMODF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LDEXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOG10F 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOGF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MODFF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_POWF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINHF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQRTF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TANF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TANHF 1
+_ACEOF
+
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITEL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINFL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANL 1
+_ACEOF
+
+ fi
+ ;;
+ *-hpux*)
+ #os_include_dir="os/hpux"
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in 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
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:22151: 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_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
+
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+
+
+ # If we're not using GNU ld, then there's no point in even trying these
+ # tests. Check for that first. We should have already tested for gld
+ # by now (in libtool), but require it now just to be safe...
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+
+
+
+ # The name set by libtool depends on the version of libtool. Shame on us
+ # for depending on an impl detail, but c'est la vie. Older versions used
+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
+ # set (hence we're using an older libtool), then set it.
+ if test x${with_gnu_ld+set} != xset; then
+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
+ with_gnu_ld=no
+ else
+ with_gnu_ld=$ac_cv_prog_gnu_ld
+ fi
+ fi
+
+ # Start by getting the version number. I think the libtool test already
+ # does some of this, but throws away the result.
+
+ ldver=`$LD --version 2>/dev/null | head -1 | \
+ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+
+ glibcxx_gnu_ld_version=`echo $ldver | \
+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
+
+ # Set --gc-sections.
+ if test "$with_gnu_ld" = "notbroken"; then
+ # GNU ld it is! Joy and bunny rabbits!
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # Need to do this so that g++ won't try to link in libstdc++
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS='-x c++ -Wl,--gc-sections'
+
+ # Check for -Wl,--gc-sections
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
+ echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
+echo $ECHO_N "checking for ld that supports -Wl,--gc-sections... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ ac_sectionLDflags=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 22156 "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. */
+
+ int main(void)
+ {
+ try { throw 1; }
+ catch (...) { };
+ return 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
+ ac_sectionLDflags=yes
+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_sectionLDflags=no
+fi
+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"
+ else
+ # this is the suspicious part
+ CFLAGS=''
+ fi
+ if test "$ac_sectionLDflags" = "yes"; then
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+ fi
+ echo "$as_me:$LINENO: result: $ac_sectionLDflags" >&5
+echo "${ECHO_T}$ac_sectionLDflags" >&6
+ fi
+
+ # Set linker optimization flags.
+ if test x"$with_gnu_ld" = x"yes"; then
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ fi
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+
+for ac_func in nan copysignf
+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. */
-#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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+fi
+done
+
+
+for ac_func in __signbit
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:22179: \"$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 "$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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+fi
+done
+
+
+for ac_func in __signbitf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+fi
+done
+
+
+ if test x$ac_cv_func_copysignl = x"yes"; then
+
+for ac_func in __signbitl
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+fi
+done
+
+ fi
+
+ # XXX Review this. Nothing uses it.
+ if test -n "$LIBMATHOBJS"; then
+ need_libmath=yes
+ fi
+
+
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
+int
+main ()
+{
+mbstate_t teststate;
+ ;
+ 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
+ have_mbstate_t=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
+
+have_mbstate_t=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
+ if test x"$have_mbstate_t" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MBSTATE_T 1
+_ACEOF
+
+ fi
+
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.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
-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
-
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ ac_has_wchar_h=yes
+else
+ ac_has_wchar_h=no
+fi
+
+done
+
+
+for ac_header in wctype.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
+ ac_has_wctype_h=yes
else
- echo "$ac_t""no" 1>&6
-\
- ac_wfuncs=no
+ ac_has_wctype_h=no
fi
+
done
- echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:22207: checking for ISO C99 wchar_t support" >&5
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
+ test x"$ac_has_wctype_h" = xyes &&
+ test x"$enable_c_mbchar" != xno; then
+
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
+int
+main ()
+{
+int i = WCHAR_MIN; int j = WCHAR_MAX;
+ ;
+ 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
+ has_wchar_minmax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
+
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
+ #include <stddef.h>
+int
+main ()
+{
+wint_t i = WEOF;
+ ;
+ 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
+ has_weof=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
+
+
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
if test x"$has_weof" = xyes &&
test x"$has_wchar_minmax" = xyes &&
- test x"$ac_wfuncs" = xyes; then
+ test x"$ac_wfuncs" = xyes;
+ then
ac_isoC99_wchar_t=yes
else
ac_isoC99_wchar_t=no
fi
- echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
-
- ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:22219: checking for iconv.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 22224 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22229: \"$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"
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+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*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cv_header_iconv_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_iconv_h = yes; then
ac_has_iconv_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_iconv_h=no
+ ac_has_iconv_h=no
fi
- ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:22253: checking for langinfo.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 22258 "configure"
-#include "confdefs.h"
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22263: \"$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"
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+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*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cv_header_langinfo_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_langinfo_h = yes; then
ac_has_langinfo_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_has_langinfo_h=no
+ ac_has_langinfo_h=no
fi
- echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:22287: checking for iconv in -liconv" >&5
-ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 22295 "configure"
-#include "confdefs.h"
+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. */
+
/* 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 iconv();
+ builtin and then its argument prototype would still apply. */
+char iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+ libiconv="-liconv"
+fi
-int main() {
-iconv()
-; return 0; }
-EOF
-if { (eval echo configure:22306: \"$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"
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libiconv"
+
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
+fi
+done
+
+
+ LIBS="$ac_save_LIBS"
+
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
+ if test x"$ac_has_iconv_h" = xyes &&
+ test x"$ac_has_langinfo_h" = xyes &&
+ test x"$ac_XPG2funcs" = xyes;
+ then
+ ac_XPG2_wchar_t=yes
+ else
+ ac_XPG2_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_WCHAR_T 1
+_ACEOF
+
+ enable_wchar_t=yes
+ fi
+ fi
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGNF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HYPOT 1
+_ACEOF
+
+ case "$target" in
+ *-hpux10*)
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITEF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINFF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNAN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANF 1
+_ACEOF
+
+ ;;
+ esac
+ ;;
+ *-linux*)
+ #os_include_dir="os/gnu-linux"
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in 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
+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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- libiconv="-liconv"
+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
+
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+
+
+ # If we're not using GNU ld, then there's no point in even trying these
+ # tests. Check for that first. We should have already tested for gld
+ # by now (in libtool), but require it now just to be safe...
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+
+
+
+ # The name set by libtool depends on the version of libtool. Shame on us
+ # for depending on an impl detail, but c'est la vie. Older versions used
+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
+ # set (hence we're using an older libtool), then set it.
+ if test x${with_gnu_ld+set} != xset; then
+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
+ with_gnu_ld=no
+ else
+ with_gnu_ld=$ac_cv_prog_gnu_ld
+ fi
+ fi
+
+ # Start by getting the version number. I think the libtool test already
+ # does some of this, but throws away the result.
+
+ ldver=`$LD --version 2>/dev/null | head -1 | \
+ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+
+ glibcxx_gnu_ld_version=`echo $ldver | \
+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
+
+ # Set --gc-sections.
+ if test "$with_gnu_ld" = "notbroken"; then
+ # GNU ld it is! Joy and bunny rabbits!
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # Need to do this so that g++ won't try to link in libstdc++
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS='-x c++ -Wl,--gc-sections'
+
+ # Check for -Wl,--gc-sections
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
+ echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
+echo $ECHO_N "checking for ld that supports -Wl,--gc-sections... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ ac_sectionLDflags=yes
else
- echo "$ac_t""no" 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. */
+
+ int main(void)
+ {
+ try { throw 1; }
+ catch (...) { };
+ return 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
+ ac_sectionLDflags=yes
+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_sectionLDflags=no
+fi
+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"
+ else
+ # this is the suspicious part
+ CFLAGS=''
+ fi
+ if test "$ac_sectionLDflags" = "yes"; then
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+ fi
+ echo "$as_me:$LINENO: result: $ac_sectionLDflags" >&5
+echo "${ECHO_T}$ac_sectionLDflags" >&6
+ fi
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $libiconv"
+ # Set linker optimization flags.
+ if test x"$with_gnu_ld" = x"yes"; then
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ fi
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+
+for ac_func in nan copysignf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+fi
+done
+
+
+
+for ac_func in __signbit
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+fi
+done
+
+
+for ac_func in __signbitf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
+fi
+done
+
+
+ if test x$ac_cv_func_copysignl = x"yes"; then
+
+for ac_func in __signbitl
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+fi
+done
+
+ fi
+
+ # XXX Review this. Nothing uses it.
+ if test -n "$LIBMATHOBJS"; then
+ need_libmath=yes
+ fi
+
+
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
+int
+main ()
+{
+mbstate_t teststate;
+ ;
+ 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
+ have_mbstate_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+have_mbstate_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
+ if test x"$have_mbstate_t" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MBSTATE_T 1
+_ACEOF
+
+ fi
+
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.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
- for ac_func in iconv_open iconv_close iconv nl_langinfo
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ ac_has_wchar_h=yes
+else
+ ac_has_wchar_h=no
+fi
+
+done
+
+
+for ac_header in wctype.h
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:22332: 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_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
+ ac_has_wctype_h=yes
+else
+ ac_has_wctype_h=no
+fi
+
+done
+
+
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
+ test x"$ac_has_wctype_h" = xyes &&
+ test x"$enable_c_mbchar" != xno; then
+
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
+int
+main ()
+{
+int i = WCHAR_MIN; int j = WCHAR_MAX;
+ ;
+ 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
+ has_wchar_minmax=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 22337 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
+
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
+ #include <stddef.h>
+int
+main ()
+{
+wint_t i = WEOF;
+ ;
+ 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
+ has_weof=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
+
+
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+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. */
-#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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
-int main() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:22360: \"$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 "$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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
+ if test x"$has_weof" = xyes &&
+ test x"$has_wchar_minmax" = xyes &&
+ test x"$ac_wfuncs" = xyes;
+ then
+ ac_isoC99_wchar_t=yes
+ else
+ ac_isoC99_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_header_iconv_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
+fi
+if test $ac_cv_header_iconv_h = yes; then
+ ac_has_iconv_h=yes
+else
+ ac_has_iconv_h=no
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
- \
- ac_XPG2funcs=yes
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_langinfo_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+ ac_has_langinfo_h=yes
else
- echo "$ac_t""no" 1>&6
-ac_XPG2funcs=no
+ ac_has_langinfo_h=no
+fi
+
+
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv $LIBS"
+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. */
+
+/* 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 iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+ libiconv="-liconv"
+fi
+
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libiconv"
+
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
fi
done
LIBS="$ac_save_LIBS"
- echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:22390: checking for XPG2 wchar_t support" >&5
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
if test x"$ac_has_iconv_h" = xyes &&
test x"$ac_has_langinfo_h" = xyes &&
- test x"$ac_XPG2funcs" = xyes; then
+ test x"$ac_XPG2funcs" = xyes;
+ then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
- echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
-
- if test x"$ac_isoC99_wchar_t" = xyes &&
- test x"$ac_XPG2_wchar_t" = xyes; then
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_WCHAR_T 1
-EOF
+_ACEOF
enable_wchar_t=yes
fi
fi
- echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:22410: checking for enabled wchar_t specializations" >&5
- echo "$ac_t""$enable_wchar_t" 1>&6
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
-
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGN 1
+_ACEOF
-
- echo $ac_n "checking for strtold declaration""... $ac_c" 1>&6
-echo "configure:22420: checking for strtold declaration" >&5
- if test x${glibcxx_cv_func_strtold_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_strtold_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGNF 1
+_ACEOF
- cat > conftest.$ac_ext <<EOF
-#line 22435 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-int main() {
- strtold(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:22442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcxx_cv_func_strtold_use=yes
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITEF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HYPOTF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINFF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNAN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINCOS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINCOSF 1
+_ACEOF
+
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITEL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HYPOTL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINFL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANL 1
+_ACEOF
+
+ fi
+ ;;
+ *-mingw32*)
+ #os_include_dir="os/mingw32"
+
+
+
+for ac_header in sys/types.h locale.h float.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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_strtold_use=no
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+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
+
+
+ # If we're not using GNU ld, then there's no point in even trying these
+ # tests. Check for that first. We should have already tested for gld
+ # by now (in libtool), but require it now just to be safe...
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+
+
+
+ # The name set by libtool depends on the version of libtool. Shame on us
+ # for depending on an impl detail, but c'est la vie. Older versions used
+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
+ # set (hence we're using an older libtool), then set it.
+ if test x${with_gnu_ld+set} != xset; then
+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
+ with_gnu_ld=no
+ else
+ with_gnu_ld=$ac_cv_prog_gnu_ld
+ fi
fi
- echo "$ac_t""$glibcxx_cv_func_strtold_use" 1>&6
- if test x$glibcxx_cv_func_strtold_use = x"yes"; then
- for ac_func in strtold
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:22468: 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
+
+ # Start by getting the version number. I think the libtool test already
+ # does some of this, but throws away the result.
+
+ ldver=`$LD --version 2>/dev/null | head -1 | \
+ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+
+ glibcxx_gnu_ld_version=`echo $ldver | \
+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
+
+ # Set --gc-sections.
+ if test "$with_gnu_ld" = "notbroken"; then
+ # GNU ld it is! Joy and bunny rabbits!
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # Need to do this so that g++ won't try to link in libstdc++
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS='-x c++ -Wl,--gc-sections'
+
+ # Check for -Wl,--gc-sections
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
+ echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
+echo $ECHO_N "checking for ld that supports -Wl,--gc-sections... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ ac_sectionLDflags=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 22473 "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. */
+
+ int main(void)
+ {
+ try { throw 1; }
+ catch (...) { };
+ return 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
+ ac_sectionLDflags=yes
+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_sectionLDflags=no
+fi
+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"
+ else
+ # this is the suspicious part
+ CFLAGS=''
+ fi
+ if test "$ac_sectionLDflags" = "yes"; then
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+ fi
+ echo "$as_me:$LINENO: result: $ac_sectionLDflags" >&5
+echo "${ECHO_T}$ac_sectionLDflags" >&6
+ fi
+
+ # Set linker optimization flags.
+ if test x"$with_gnu_ld" = x"yes"; then
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ fi
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+
+for ac_func in nan copysignf
+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. */
-#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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+fi
+done
+
-int main() {
+for ac_func in __signbit
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:22496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
fi
-rm -f conftest*
+done
+
+
+for ac_func in __signbitf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
fi
+done
-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
+
+ if test x$ac_cv_func_copysignl = x"yes"; then
+
+for ac_func in __signbitl
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
fi
done
fi
-
- echo $ac_n "checking for strtof declaration""... $ac_c" 1>&6
-echo "configure:22524: checking for strtof declaration" >&5
- if test x${glibcxx_cv_func_strtof_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_strtof_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ # XXX Review this. Nothing uses it.
+ if test -n "$LIBMATHOBJS"; then
+ need_libmath=yes
+ fi
+
+
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
+int
+main ()
+{
+mbstate_t teststate;
+ ;
+ 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
+ have_mbstate_t=yes
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat > conftest.$ac_ext <<EOF
-#line 22539 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-int main() {
- strtof(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:22546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcxx_cv_func_strtof_use=yes
+have_mbstate_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
+ if test x"$have_mbstate_t" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MBSTATE_T 1
+_ACEOF
+
+ fi
+
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_strtof_use=no
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+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
+ ac_has_wchar_h=yes
+else
+ ac_has_wchar_h=no
fi
- fi
- echo "$ac_t""$glibcxx_cv_func_strtof_use" 1>&6
- if test x$glibcxx_cv_func_strtof_use = x"yes"; then
- for ac_func in strtof
+done
+
+
+for ac_header in wctype.h
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:22572: 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_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
+ ac_has_wctype_h=yes
+else
+ ac_has_wctype_h=no
+fi
+
+done
+
+
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
+ test x"$ac_has_wctype_h" = xyes &&
+ test x"$enable_c_mbchar" != xno; then
+
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
+int
+main ()
+{
+int i = WCHAR_MIN; int j = WCHAR_MAX;
+ ;
+ 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
+ has_wchar_minmax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
+
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
+ #include <stddef.h>
+int
+main ()
+{
+wint_t i = WEOF;
+ ;
+ 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
+ has_weof=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 22577 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
+
+
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+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. */
-#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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-int main() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:22600: \"$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 "$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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
+ if test x"$has_weof" = xyes &&
+ test x"$has_wchar_minmax" = xyes &&
+ test x"$ac_wfuncs" = xyes;
+ then
+ ac_isoC99_wchar_t=yes
+ else
+ ac_isoC99_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_header_iconv_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
+fi
+if test $ac_cv_header_iconv_h = yes; then
+ ac_has_iconv_h=yes
+else
+ ac_has_iconv_h=no
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
-
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ ac_cv_header_langinfo_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+ ac_has_langinfo_h=yes
+else
+ ac_has_langinfo_h=no
+fi
+
+
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv $LIBS"
+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. */
+
+/* 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 iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+ libiconv="-liconv"
+fi
+
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libiconv"
+
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
fi
done
+
+ LIBS="$ac_save_LIBS"
+
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
+ if test x"$ac_has_iconv_h" = xyes &&
+ test x"$ac_has_langinfo_h" = xyes &&
+ test x"$ac_XPG2funcs" = xyes;
+ then
+ ac_XPG2_wchar_t=yes
+ else
+ ac_XPG2_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_WCHAR_T 1
+_ACEOF
+
+ enable_wchar_t=yes
+ fi
fi
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
+
+ ;;
+ *-netbsd*)
+ #os_include_dir="os/bsd/netbsd"
+
+
+
+
+
- for ac_func in drand48
+
+
+
+
+
+
+for ac_header in 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
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:22629: 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_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
+
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+
+
+ # If we're not using GNU ld, then there's no point in even trying these
+ # tests. Check for that first. We should have already tested for gld
+ # by now (in libtool), but require it now just to be safe...
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+
+
+
+ # The name set by libtool depends on the version of libtool. Shame on us
+ # for depending on an impl detail, but c'est la vie. Older versions used
+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
+ # set (hence we're using an older libtool), then set it.
+ if test x${with_gnu_ld+set} != xset; then
+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
+ with_gnu_ld=no
+ else
+ with_gnu_ld=$ac_cv_prog_gnu_ld
+ fi
+ fi
+
+ # Start by getting the version number. I think the libtool test already
+ # does some of this, but throws away the result.
+
+ ldver=`$LD --version 2>/dev/null | head -1 | \
+ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+
+ glibcxx_gnu_ld_version=`echo $ldver | \
+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
+
+ # Set --gc-sections.
+ if test "$with_gnu_ld" = "notbroken"; then
+ # GNU ld it is! Joy and bunny rabbits!
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # Need to do this so that g++ won't try to link in libstdc++
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS='-x c++ -Wl,--gc-sections'
+
+ # Check for -Wl,--gc-sections
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
+ echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
+echo $ECHO_N "checking for ld that supports -Wl,--gc-sections... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ ac_sectionLDflags=yes
+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(void)
+ {
+ try { throw 1; }
+ catch (...) { };
+ return 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
+ ac_sectionLDflags=yes
+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_sectionLDflags=no
+fi
+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"
+ else
+ # this is the suspicious part
+ CFLAGS=''
+ fi
+ if test "$ac_sectionLDflags" = "yes"; then
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+ fi
+ echo "$as_me:$LINENO: result: $ac_sectionLDflags" >&5
+echo "${ECHO_T}$ac_sectionLDflags" >&6
+ fi
+
+ # Set linker optimization flags.
+ if test x"$with_gnu_ld" = x"yes"; then
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ fi
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 22634 "configure"
-#include "confdefs.h"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+
+for ac_func in nan copysignf
+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. */
-#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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
+fi
+done
-int main() {
+
+for ac_func in __signbit
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:22657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
fi
-rm -f conftest*
+done
+
+
+for ac_func in __signbitf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
fi
+done
-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
+
+ if test x$ac_cv_func_copysignl = x"yes"; then
+
+for ac_func in __signbitl
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
fi
done
+ fi
- CXXFLAGS="$ac_save_CXXFLAGS"
+ # XXX Review this. Nothing uses it.
+ if test -n "$LIBMATHOBJS"; then
+ need_libmath=yes
+ fi
- # For showmanyc_helper().
- for ac_hdr in sys/ioctl.h sys/filio.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:22690: 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 22695 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22700: \"$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"
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
+int
+main ()
+{
+mbstate_t teststate;
+ ;
+ 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
+ have_mbstate_t=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
+
+have_mbstate_t=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
+ if test x"$have_mbstate_t" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MBSTATE_T 1
+_ACEOF
+
+ fi
+
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.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
-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
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ ac_has_wchar_h=yes
else
- echo "$ac_t""no" 1>&6
+ ac_has_wchar_h=no
fi
+
done
-
- if eval "test \"`echo '$''{'glibcxx_cv_POLL'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+for ac_header in wctype.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
-
- cat > conftest.$ac_ext <<EOF
-#line 22732 "configure"
-#include "confdefs.h"
-#include <poll.h>
-int main() {
-struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0);
-; return 0; }
-EOF
-if { (eval echo configure:22739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcxx_cv_POLL=yes
+ 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
+ ac_has_wctype_h=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_POLL=no
+ ac_has_wctype_h=no
fi
-rm -f conftest*
-
+
+done
+
+
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
+ test x"$ac_has_wctype_h" = xyes &&
+ test x"$enable_c_mbchar" != xno; then
+
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
+int
+main ()
+{
+int i = WCHAR_MIN; int j = WCHAR_MAX;
+ ;
+ 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
+ has_wchar_minmax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
- if test x$glibcxx_cv_POLL = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_POLL 1
-EOF
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
+ #include <stddef.h>
+int
+main ()
+{
+wint_t i = WEOF;
+ ;
+ 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
+ has_weof=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
+
+
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+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
+
+else
+ ac_wfuncs=no
+fi
+done
- fi
-
- if eval "test \"`echo '$''{'glibcxx_cv_S_ISREG'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
+ if test x"$has_weof" = xyes &&
+ test x"$has_wchar_minmax" = xyes &&
+ test x"$ac_wfuncs" = xyes;
+ then
+ ac_isoC99_wchar_t=yes
+ else
+ ac_isoC99_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
- cat > conftest.$ac_ext <<EOF
-#line 22765 "configure"
-#include "confdefs.h"
-#include <sys/stat.h>
-int main() {
-struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode);
-; return 0; }
-EOF
-if { (eval echo configure:22772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- glibcxx_cv_S_ISREG=yes
+ ac_cv_header_iconv_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
+fi
+if test $ac_cv_header_iconv_h = yes; then
+ ac_has_iconv_h=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_S_ISREG=no
+ ac_has_iconv_h=no
fi
-rm -f conftest*
-
+
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_langinfo_h=$ac_header_preproc
fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
- if eval "test \"`echo '$''{'glibcxx_cv_S_IFREG'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+ ac_has_langinfo_h=yes
else
-
- cat > conftest.$ac_ext <<EOF
-#line 22790 "configure"
-#include "confdefs.h"
-#include <sys/stat.h>
-int main() {
-struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode;
-; return 0; }
-EOF
-if { (eval echo configure:22797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- glibcxx_cv_S_IFREG=yes
+ ac_has_langinfo_h=no
+fi
+
+
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_S_IFREG=no
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv $LIBS"
+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. */
+
+/* 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 iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+ libiconv="-liconv"
fi
-rm -f conftest*
-
+
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libiconv"
+
+
+
+
+
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
fi
+done
- if test x$glibcxx_cv_S_ISREG = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_S_ISREG 1
-EOF
- elif test x$glibcxx_cv_S_IFREG = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_S_IFREG 1
-EOF
+ LIBS="$ac_save_LIBS"
+
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
+ if test x"$ac_has_iconv_h" = xyes &&
+ test x"$ac_has_langinfo_h" = xyes &&
+ test x"$ac_XPG2funcs" = xyes;
+ then
+ ac_XPG2_wchar_t=yes
+ else
+ ac_XPG2_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_WCHAR_T 1
+_ACEOF
+
+ enable_wchar_t=yes
+ fi
+ fi
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGNF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITEF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HYPOTF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINFF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNAN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANF 1
+_ACEOF
+
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FINITEL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISINFL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANL 1
+_ACEOF
+ fi
+ ;;
+ *-qnx6.1* | *-qnx6.2*)
+ #os_include_dir="os/qnx/qnx6.1"
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+
+
+ # If we're not using GNU ld, then there's no point in even trying these
+ # tests. Check for that first. We should have already tested for gld
+ # by now (in libtool), but require it now just to be safe...
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
+
+
+
+ # The name set by libtool depends on the version of libtool. Shame on us
+ # for depending on an impl detail, but c'est la vie. Older versions used
+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
+ # set (hence we're using an older libtool), then set it.
+ if test x${with_gnu_ld+set} != xset; then
+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
+ with_gnu_ld=no
+ else
+ with_gnu_ld=$ac_cv_prog_gnu_ld
+ fi
fi
+ # Start by getting the version number. I think the libtool test already
+ # does some of this, but throws away the result.
+
+ ldver=`$LD --version 2>/dev/null | head -1 | \
+ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+
+ glibcxx_gnu_ld_version=`echo $ldver | \
+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
-
- ac_safe=`echo "locale.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for locale.h""... $ac_c" 1>&6
-echo "configure:22826: checking for locale.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ # Set --gc-sections.
+ if test "$with_gnu_ld" = "notbroken"; then
+ # GNU ld it is! Joy and bunny rabbits!
+
+ # All these tests are for C++; save the language and the compiler flags.
+ # Need to do this so that g++ won't try to link in libstdc++
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS='-x c++ -Wl,--gc-sections'
+
+ # Check for -Wl,--gc-sections
+ # XXX This test is broken at the moment, as symbols required for linking
+ # are now in libsupc++ (not built yet). In addition, this test has
+ # cored on solaris in the past. In addition, --gc-sections doesn't
+ # really work at the moment (keeps on discarding used sections, first
+ # .eh_frame and now some of the glibc sections for iconv).
+ # Bzzzzt. Thanks for playing, maybe next time.
+ echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
+echo $ECHO_N "checking for ld that supports -Wl,--gc-sections... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ ac_sectionLDflags=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 22831 "configure"
-#include "confdefs.h"
-#include <locale.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22836: \"$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. */
+
+ int main(void)
+ {
+ try { throw 1; }
+ catch (...) { };
+ return 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
+ ac_sectionLDflags=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: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_sectionLDflags=no
fi
-rm -f conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:22854: checking for LC_MESSAGES" >&5
-if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 22859 "configure"
-#include "confdefs.h"
-#include <locale.h>
-int main() {
-return LC_MESSAGES
-; return 0; }
-EOF
-if { (eval echo configure:22866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ac_cv_val_LC_MESSAGES=yes
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ # this is the suspicious part
+ CFLAGS=''
+ fi
+ if test "$ac_sectionLDflags" = "yes"; then
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
+ fi
+ echo "$as_me:$LINENO: result: $ac_sectionLDflags" >&5
+echo "${ECHO_T}$ac_sectionLDflags" >&6
+ fi
+
+ # Set linker optimization flags.
+ if test x"$with_gnu_ld" = x"yes"; then
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
+ fi
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_val_LC_MESSAGES=no
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+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
-rm -f 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. */
+
+
+int
+main ()
+{
+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
+ ac_cv_lib_m_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=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_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
fi
-echo "$ac_t""$ac_cv_val_LC_MESSAGES" 1>&6
- if test $ac_cv_val_LC_MESSAGES = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_LC_MESSAGES 1
-EOF
- fi
-
-else
- echo "$ac_t""no" 1>&6
+
+for ac_func in nan copysignf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
fi
+done
- cat > conftest.$ac_ext <<EOF
-#line 22893 "configure"
-#include "confdefs.h"
+for ac_func in __signbit
+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
- #include <setjmp.h>
-
-int main() {
-sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
-; return 0; }
-EOF
-if { (eval echo configure:22902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
-#define HAVE_SIGSETJMP 1
-EOF
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
+fi
+done
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+
+for ac_func in __signbitf
+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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
fi
-rm -f conftest*
+done
- for ac_hdr in unistd.h
+
+ if test x$ac_cv_func_copysignl = x"yes"; then
+
+for ac_func in __signbitl
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:22919: 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
+ 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
+
+else
+ LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
+fi
+done
+
+ fi
+
+ # XXX Review this. Nothing uses it.
+ if test -n "$LIBMATHOBJS"; then
+ need_libmath=yes
+ fi
+
+
+
+ # Test wchar.h for mbstate_t, which is needed for char_traits and
+ # others even if wchar_t support is not on.
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $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 <wchar.h>
+int
+main ()
+{
+mbstate_t teststate;
+ ;
+ 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
+ have_mbstate_t=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 22924 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22929: \"$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"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+have_mbstate_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_mbstate_t" >&5
+echo "${ECHO_T}$have_mbstate_t" >&6
+ if test x"$have_mbstate_t" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MBSTATE_T 1
+_ACEOF
+
+ fi
+
+ # Sanity check for existence of ISO C99 headers for extended encoding.
+
+for ac_header in wchar.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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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 `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ ac_has_wchar_h=yes
else
- echo "$ac_t""no" 1>&6
+ ac_has_wchar_h=no
fi
+
done
-for ac_func in getpagesize
+
+for ac_header in wctype.h
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:22958: 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_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
+ ac_has_wctype_h=yes
+else
+ ac_has_wctype_h=no
+fi
+
+done
+
+
+ # Only continue checking if the ISO C99 headers exist and support is on.
+ if test x"$ac_has_wchar_h" = xyes &&
+ test x"$ac_has_wctype_h" = xyes &&
+ test x"$enable_c_mbchar" != xno; then
+
+ # Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
+ # numeric_limits can instantiate type_traits<wchar_t>
+ echo "$as_me:$LINENO: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo $ECHO_N "checking for WCHAR_MIN and WCHAR_MAX... $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 <wchar.h>
+int
+main ()
+{
+int i = WCHAR_MIN; int j = WCHAR_MAX;
+ ;
+ 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
+ has_wchar_minmax=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 22963 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_wchar_minmax=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_wchar_minmax" >&5
+echo "${ECHO_T}$has_wchar_minmax" >&6
+
+ # Test wchar.h for WEOF, which is what we use to determine whether
+ # to specialize for char_traits<wchar_t> or not.
+ echo "$as_me:$LINENO: checking for WEOF" >&5
+echo $ECHO_N "checking for WEOF... $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 <wchar.h>
+ #include <stddef.h>
+int
+main ()
+{
+wint_t i = WEOF;
+ ;
+ 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
+ has_weof=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+has_weof=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $has_weof" >&5
+echo "${ECHO_T}$has_weof" >&6
+
+ # Tests for wide character functions used in char_traits<wchar_t>.
+ ac_wfuncs=yes
+
+
+
+
+
+
+for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
+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. */
-#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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ # Checks for names injected into std:: by the c_std headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-int main() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+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
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:22986: \"$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 "$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
+
+else
+ ac_wfuncs=no
+fi
+done
+
+
+ echo "$as_me:$LINENO: checking for ISO C99 wchar_t support" >&5
+echo $ECHO_N "checking for ISO C99 wchar_t support... $ECHO_C" >&6
+ if test x"$has_weof" = xyes &&
+ test x"$has_wchar_minmax" = xyes &&
+ test x"$ac_wfuncs" = xyes;
+ then
+ ac_isoC99_wchar_t=yes
+ else
+ ac_isoC99_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_isoC99_wchar_t" >&5
+echo "${ECHO_T}$ac_isoC99_wchar_t" >&6
+
+ # Use iconv for wchar_t to char conversions. As such, check for
+ # X/Open Portability Guide, version 2 features (XPG2).
+ if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking iconv.h usability" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.h>
+_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 iconv.h presence" >&5
+echo $ECHO_N "checking iconv.h 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 <iconv.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
+ 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: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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: iconv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iconv.h: 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 iconv.h" >&5
+echo $ECHO_N "checking for iconv.h... $ECHO_C" >&6
+if test "${ac_cv_header_iconv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_header_iconv_h=$ac_header_preproc
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
+echo "${ECHO_T}$ac_cv_header_iconv_h" >&6
+
+fi
+if test $ac_cv_header_iconv_h = yes; then
+ ac_has_iconv_h=yes
+else
+ ac_has_iconv_h=no
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
-
+
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
else
- echo "$ac_t""no" 1>&6
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.h>
+_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 langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h 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 <langinfo.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
+ 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: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: 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 langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_langinfo_h=$ac_header_preproc
fi
-done
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:23011: 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
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+ ac_has_langinfo_h=yes
else
- if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_fixed_mapped=no
+ ac_has_langinfo_h=no
+fi
+
+
+
+ # Check for existence of libiconv.a providing XPG2 wchar_t support.
+ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
+if test "${ac_cv_lib_iconv_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 23019 "configure"
-#include "confdefs.h"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liconv $LIBS"
+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. */
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propogated back to all the places they're supposed to be.
+/* 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 iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ 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_iconv_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iconv_iconv=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_iconv_iconv" >&5
+echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6
+if test $ac_cv_lib_iconv_iconv = yes; then
+ libiconv="-liconv"
+fi
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/mman.h>
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libiconv"
-/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
-/* Assume that all systems that can run configure have sys/param.h. */
-# ifndef HAVE_SYS_PARAM_H
-# define HAVE_SYS_PARAM_H 1
-# endif
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-#endif /* no HAVE_GETPAGESIZE */
+for ac_func in iconv_open iconv_close iconv nl_langinfo
+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
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
-int
-main()
-{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize();
-
- /*
- * First, make a file with some known garbage in it.
- */
- data = malloc(pagesize);
- if (!data)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand();
- umask(0);
- fd = creat("conftestmmap", 0600);
- if (fd < 0)
- exit(1);
- if (write(fd, data, pagesize) != pagesize)
- exit(1);
- close(fd);
-
- /*
- * Next, try to mmap the file at a fixed address which
- * already has something else allocated at it. If we can,
- * also make sure that we see the same garbage.
- */
- fd = open("conftestmmap", O_RDWR);
- if (fd < 0)
- exit(1);
- data2 = malloc(2 * pagesize);
- if (!data2)
- exit(1);
- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit(1);
-
- /*
- * Finally, make sure that changes to the mapped area
- * do not percolate back to the file as seen by read().
- * (This is a bug on some variants of i386 svr4.0.)
- */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = malloc(pagesize);
- if (!data3)
- exit(1);
- if (read(fd, data3, pagesize) != pagesize)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit(1);
- close(fd);
- unlink("conftestmmap");
- exit(0);
}
+#endif
-EOF
-if { (eval echo configure:23159: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -fr conftest*
+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
+ ac_XPG2funcs=yes
+else
+ ac_XPG2funcs=no
fi
+done
-fi
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
- cat >> confdefs.h <<\EOF
+ LIBS="$ac_save_LIBS"
+
+ echo "$as_me:$LINENO: checking for XPG2 wchar_t support" >&5
+echo $ECHO_N "checking for XPG2 wchar_t support... $ECHO_C" >&6
+ if test x"$ac_has_iconv_h" = xyes &&
+ test x"$ac_has_langinfo_h" = xyes &&
+ test x"$ac_XPG2funcs" = xyes;
+ then
+ ac_XPG2_wchar_t=yes
+ else
+ ac_XPG2_wchar_t=no
+ fi
+ echo "$as_me:$LINENO: result: $ac_XPG2_wchar_t" >&5
+echo "${ECHO_T}$ac_XPG2_wchar_t" >&6
+
+ # At the moment, only enable wchar_t specializations if all the
+ # above support is present.
+ if test x"$ac_isoC99_wchar_t" = xyes &&
+ test x"$ac_XPG2_wchar_t" = xyes;
+ then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_WCHAR_T 1
+_ACEOF
+
+ enable_wchar_t=yes
+ fi
+ fi
+ echo "$as_me:$LINENO: checking for enabled wchar_t specializations" >&5
+echo $ECHO_N "checking for enabled wchar_t specializations... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $enable_wchar_t" >&5
+echo "${ECHO_T}$enable_wchar_t" >&6
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSHF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSHL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOGF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOGL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOG10F 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOG10L 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINHF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINHL 1
+_ACEOF
+
+ ;;
+ *-solaris*)
+ #case "$target" in
+ # *-solaris2.5)
+ # os_include_dir="os/solaris/solaris2.5"
+ # ;;
+ # *-solaris2.6)
+ # os_include_dir="os/solaris/solaris2.6"
+ # ;;
+ # *-solaris2.7 | *-solaris2.8 | *-solaris2.9)
+ # os_include_dir="os/solaris/solaris2.7"
+ # ;;
+ #esac
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRTOF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRTOLD 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_MMAP 1
-EOF
+_ACEOF
-fi
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNAN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ISNANF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MODFF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HYPOT 1
+_ACEOF
+
+ ;;
+ *-windiss*)
+ #os_include_dir="os/windiss"
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ACOSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ASINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATAN2F 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATANF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_CEILF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGN 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGNF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSHF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_EXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FABSF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FLOORF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FMODF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LDEXPF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOG10F 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOGF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MODFF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_POWF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINHF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQRTF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TANF 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TANHF 1
+_ACEOF
+
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: No support for this host/target combination." >&5
+echo "$as_me: error: No support for this host/target combination." >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+
+ fi
+
+ # At some point, we should differentiate between architectures
+ # like x86, which have long double versions, and alpha/powerpc/etc.,
+ # which don't. For the time being, punt.
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ACOSL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ASINL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATAN2L 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_ATANL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_CEILL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COPYSIGNL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_COSHL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_EXPL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FABSL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FLOORL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FMODL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREXPL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LDEXPL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOG10L 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOGL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MODFL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_POWL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINCOSL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SINHL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQRTL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TANL 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TANHL 1
+_ACEOF
+
+ fi
fi
-# This depends on GLIBCXX_CHECK_LINKER_FEATURES, but without it assumes no.
-# Check whether --enable-symvers or --disable-symvers was given.
+# This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
+
+
+ # Check whether --enable-symvers or --disable-symvers was given.
if test "${enable_symvers+set}" = set; then
enableval="$enable_symvers"
- case "$enableval" in
- yes) enable_symvers=yes ;;
- no) enable_symvers=no ;;
- # other names here, just as sanity checks
- #gnu|sun|etcetera) enable_symvers=$enableval ;;
- gnu) enable_symvers=$enableval ;;
- *) { echo "configure: error: Unknown argument to enable/disable symvers" 1>&2; exit 1; } ;;
- esac
+
+ case "$enableval" in
+ yes|no|gnu) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable symvers" >&5
+echo "$as_me: error: Unknown argument to enable/disable symvers" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
else
enable_symvers=yes
-fi
+fi;
+
# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
-if test x$enable_shared = xno ||
- test "x$LD" = x ||
- test x$glibcxx_gnu_ld_version = x; then
+
+# FIXME The following test is too strict, in theory.
+if test $enable_shared = no ||
+ test "x$LD" = x ||
+ test x$glibcxx_gnu_ld_version = x; then
enable_symvers=no
fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
if test $enable_symvers != no; then
- echo $ac_n "checking for shared libgcc""... $ac_c" 1>&6
-echo "configure:23210: checking for shared libgcc" >&5
+ echo "$as_me:$LINENO: checking for shared libgcc" >&5
+echo $ECHO_N "checking for shared libgcc... $ECHO_C" >&6
ac_save_CFLAGS="$CFLAGS"
CFLAGS=' -lgcc_s'
- cat > conftest.$ac_ext <<EOF
-#line 23214 "configure"
-#include "confdefs.h"
+ 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. */
-int main() {
-return 0
-; return 0; }
-EOF
-if { (eval echo configure:23221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+int
+main ()
+{
+return 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
glibcxx_shared_libgcc=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_shared_libgcc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_shared_libgcc=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
CFLAGS="$ac_save_CFLAGS"
- echo "$ac_t""$glibcxx_shared_libgcc" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_shared_libgcc" >&5
+echo "${ECHO_T}$glibcxx_shared_libgcc" >&6
fi
-# For GNU ld, we need at least this version. It's 2.14 in the same format
-# as the tested-for version. See GLIBCXX_CHECK_LINKER_FEATURES for more.
+# For GNU ld, we need at least this version. The format is described in
+# GLIBCXX_CHECK_LINKER_FEATURES above.
glibcxx_min_gnu_ld_version=21400
+# XXXXXXXXXXX glibcxx_gnu_ld_version=21390
-# Check to see if unspecified "yes" value can win, given results
-# above.
-if test $enable_symvers = yes ; then
+# Check to see if unspecified "yes" value can win, given results above.
+# Change "yes" into either "no" or a style name.
+if test $enable_symvers = yes; then
if test $with_gnu_ld = yes &&
- test $glibcxx_shared_libgcc = yes ;
+ test $glibcxx_shared_libgcc = yes;
then
if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
enable_symvers=gnu
else
# The right tools, the right setup, but too old. Fallbacks?
- enable_symvers=no
+ { echo "$as_me:$LINENO: WARNING: === Linker version $glibcxx_gnu_ld_version is too old for" >&5
+echo "$as_me: WARNING: === Linker version $glibcxx_gnu_ld_version is too old for" >&2;}
+ { echo "$as_me:$LINENO: WARNING: === full symbol versioning support in this release of GCC." >&5
+echo "$as_me: WARNING: === full symbol versioning support in this release of GCC." >&2;}
+ { echo "$as_me:$LINENO: WARNING: === You would need to upgrade your binutils to version" >&5
+echo "$as_me: WARNING: === You would need to upgrade your binutils to version" >&2;}
+ { echo "$as_me:$LINENO: WARNING: === $glibcxx_min_gnu_ld_version or later and rebuild GCC." >&5
+echo "$as_me: WARNING: === $glibcxx_min_gnu_ld_version or later and rebuild GCC." >&2;}
+ if test $glibcxx_gnu_ld_version -ge 21200 ; then
+ # Globbing fix is present, proper block support is not.
+ { echo "$as_me:$LINENO: WARNING: === Symbol versioning will be disabled." >&5
+echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+ enable_symvers=no
+ else
+ # 2.11 or older.
+ { echo "$as_me:$LINENO: WARNING: === Symbol versioning will be disabled." >&5
+echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+ enable_symvers=no
+ fi
fi
else
# just fail for now
+ { echo "$as_me:$LINENO: WARNING: === You have requested some kind of symbol versioning, but" >&5
+echo "$as_me: WARNING: === You have requested some kind of symbol versioning, but" >&2;}
+ { echo "$as_me:$LINENO: WARNING: === either you are not using a supported linker, or you are" >&5
+echo "$as_me: WARNING: === either you are not using a supported linker, or you are" >&2;}
+ { echo "$as_me:$LINENO: WARNING: === not building a shared libgcc_s (which is required)." >&5
+echo "$as_me: WARNING: === not building a shared libgcc_s (which is required)." >&2;}
+ { echo "$as_me:$LINENO: WARNING: === Symbol versioning will be disabled." >&5
+echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
enable_symvers=no
fi
fi
+# Everything parsed; figure out what file to use.
case $enable_symvers in
no)
- SYMVER_MAP=config/linker-map.dummy
- ;;
+ SYMVER_MAP=config/linker-map.dummy
+ ;;
gnu)
- SYMVER_MAP=config/linker-map.gnu
- cat >> confdefs.h <<\EOF
+ SYMVER_MAP=config/linker-map.gnu
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_SYMVER 1
-EOF
+_ACEOF
- ;;
+ ;;
esac
+{ echo "$as_me:$LINENO: versioning on shared library symbols is $enable_symvers" >&5
+echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;}
-if test $enable_symvers != no; then
- GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE=
- GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE='#'
-else
- GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE='#'
- GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE=
-fi
-echo $ac_n "checking versioning on shared library symbols""... $ac_c" 1>&6
-echo "configure:23282: checking versioning on shared library symbols" >&5
-echo "$ac_t""$enable_symvers" 1>&6
-
-
-# This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_CROSS_COMPILING.
+# This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
- if test x"$GLIBCXX_IS_CROSS_COMPILING" = xfalse; then
+ if $GLIBCXX_IS_NATIVE && test $is_hosted = yes; then
# Do checks for memory limit functions.
-
+
setrlimit_have_headers=yes
- for ac_hdr in unistd.h sys/time.h sys/resource.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:23297: 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 23302 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:23307: \"$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"
+
+
+
+for ac_header in unistd.h sys/time.h sys/resource.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
- 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"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
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 `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
else
- echo "$ac_t""no" 1>&6
-setrlimit_have_headers=no
+ setrlimit_have_headers=no
fi
+
done
# If don't have the headers, then we can't run the tests now, and we
# won't be seeing any of these during testsuite compilation.
if test $setrlimit_have_headers = yes; then
# Can't do these in a loop, else the resulting syntax is wrong.
-
- cat > conftest.$ac_ext <<EOF
-#line 23340 "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 <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
-
-int main() {
- int f = RLIMIT_DATA ;
-; return 0; }
-EOF
-if { (eval echo configure:23350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
+int
+main ()
+{
+ int f = RLIMIT_DATA ;
+ ;
+ 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_mresult=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_mresult=0
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_mresult=0
fi
-rm -f conftest*
- cat >> confdefs.h <<EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+cat >>confdefs.h <<_ACEOF
#define HAVE_MEMLIMIT_DATA $glibcxx_mresult
-EOF
+_ACEOF
+
-
- cat > conftest.$ac_ext <<EOF
-#line 23367 "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 <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
-
-int main() {
- int f = RLIMIT_RSS ;
-; return 0; }
-EOF
-if { (eval echo configure:23377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
+int
+main ()
+{
+ int f = RLIMIT_RSS ;
+ ;
+ 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_mresult=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_mresult=0
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_mresult=0
fi
-rm -f conftest*
- cat >> confdefs.h <<EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+cat >>confdefs.h <<_ACEOF
#define HAVE_MEMLIMIT_RSS $glibcxx_mresult
-EOF
+_ACEOF
+
-
- cat > conftest.$ac_ext <<EOF
-#line 23394 "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 <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
-
-int main() {
- int f = RLIMIT_VMEM ;
-; return 0; }
-EOF
-if { (eval echo configure:23404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
+int
+main ()
+{
+ int f = RLIMIT_VMEM ;
+ ;
+ 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_mresult=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_mresult=0
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_mresult=0
fi
-rm -f conftest*
- cat >> confdefs.h <<EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+cat >>confdefs.h <<_ACEOF
#define HAVE_MEMLIMIT_VMEM $glibcxx_mresult
-EOF
+_ACEOF
-
- cat > conftest.$ac_ext <<EOF
-#line 23421 "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 <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
-
-int main() {
- int f = RLIMIT_AS ;
-; return 0; }
-EOF
-if { (eval echo configure:23431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
+int
+main ()
+{
+ int f = RLIMIT_AS ;
+ ;
+ 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_mresult=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_mresult=0
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_mresult=0
fi
-rm -f conftest*
- cat >> confdefs.h <<EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+cat >>confdefs.h <<_ACEOF
#define HAVE_MEMLIMIT_AS $glibcxx_mresult
-EOF
+_ACEOF
# Check for rlimit, setrlimit.
- if eval "test \"`echo '$''{'ac_setrlimit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${ac_setrlimit+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
- cat > conftest.$ac_ext <<EOF
-#line 23453 "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 <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
-
-int main() {
- struct rlimit r; setrlimit(0, &r);
-; return 0; }
-EOF
-if { (eval echo configure:23463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
+int
+main ()
+{
+struct rlimit r;
+ setrlimit(0, &r);
+ ;
+ 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_setrlimit=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_setrlimit=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_setrlimit=no
fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest.$ac_ext
+
fi
fi
- echo $ac_n "checking for testsuite memory limit support""... $ac_c" 1>&6
-echo "configure:23479: checking for testsuite memory limit support" >&5
+ echo "$as_me:$LINENO: checking for testsuite memory limit support" >&5
+echo $ECHO_N "checking for testsuite memory limit support... $ECHO_C" >&6
if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
ac_mem_limits=yes
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_MEM_LIMITS 1
-EOF
+_ACEOF
else
ac_mem_limits=no
fi
- echo "$ac_t""$ac_mem_limits" 1>&6
+ echo "$as_me:$LINENO: result: $ac_mem_limits" >&5
+echo "${ECHO_T}$ac_mem_limits" >&6
# Look for setenv, so that extended locale tests can be performed.
-
- echo $ac_n "checking for setenv declaration""... $ac_c" 1>&6
-echo "configure:23495: checking for setenv declaration" >&5
+
+ echo "$as_me:$LINENO: checking for setenv declaration" >&5
+echo $ECHO_N "checking for setenv declaration... $ECHO_C" >&6
if test x${glibcxx_cv_func_setenv_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcxx_cv_func_setenv_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${glibcxx_cv_func_setenv_use+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- cat > conftest.$ac_ext <<EOF
-#line 23510 "configure"
-#include "confdefs.h"
+
+
+ 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() {
+int
+main ()
+{
setenv(0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:23517: \"$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
glibcxx_cv_func_setenv_use=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcxx_cv_func_setenv_use=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_func_setenv_use=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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_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 "$ac_t""$glibcxx_cv_func_setenv_use" 1>&6
+ echo "$as_me:$LINENO: result: $glibcxx_cv_func_setenv_use" >&5
+echo "${ECHO_T}$glibcxx_cv_func_setenv_use" >&6
if test x$glibcxx_cv_func_setenv_use = x"yes"; then
- for ac_func in setenv
+
+for ac_func in setenv
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:23543: 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 23548 "configure"
-#include "confdefs.h"
+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. */
-#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:23571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
+
+ if test $enable_symvers = no; then
+ enable_abi_check=no
+ else
+ case "$host" in
+ *-*-cygwin*)
+ enable_abi_check=no ;;
+ *)
+ enable_abi_check=yes ;;
+ esac
+ fi
+ else
+ # Only build this as native, since automake does not understand
+ # CXX_FOR_BUILD.
+ enable_abi_check=no
fi
# Export file names for ABI checking.
- baseline_dir="${glibcxx_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
-
+ baseline_dir="$glibcxx_srcdir/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
- # Determine if checking the ABI is desirable.
- if test x$enable_symvers = xno; then
- enable_abi_check=no
- else
- case "$host" in
- *-*-cygwin*)
- enable_abi_check=no ;;
- *)
- enable_abi_check=yes ;;
- esac
- fi
-
-if test "$enable_wchar_t" = yes; then
- GLIBCXX_TEST_WCHAR_T_TRUE=
- GLIBCXX_TEST_WCHAR_T_FALSE='#'
-else
- GLIBCXX_TEST_WCHAR_T_TRUE='#'
- GLIBCXX_TEST_WCHAR_T_FALSE=
-fi
-
-if test "$enable_abi_check" = yes; then
- GLIBCXX_TEST_ABI_TRUE=
- GLIBCXX_TEST_ABI_FALSE='#'
-else
- GLIBCXX_TEST_ABI_TRUE='#'
- GLIBCXX_TEST_ABI_FALSE=
-fi
# Propagate the target-specific source directories through the build chain.
-# (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
+# (Nothing currently uses cpu_include_dir directly; only atomicity_include_dir
# uses it, and it only gets used in this file.)
-ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
+ATOMICITY_INC_SRCDIR=config/${atomicity_include_dir}
OS_INC_SRCDIR=config/${os_include_dir}
FPOS_INC_SRCDIR=config/${fpos_include_dir}
+# Determine cross-compile flags and AM_CONDITIONALs.
+#AC_SUBST(GLIBCXX_IS_NATIVE)
+#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
+# from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
+#AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test $need_libmath = yes)
+
+
+if test $is_hosted = yes; then
+ GLIBCXX_HOSTED_TRUE=
+ GLIBCXX_HOSTED_FALSE='#'
+else
+ GLIBCXX_HOSTED_TRUE='#'
+ GLIBCXX_HOSTED_FALSE=
+fi
+
+
+
+
+if test $enable_libstdcxx_pch = yes; then
+ GLIBCXX_BUILD_PCH_TRUE=
+ GLIBCXX_BUILD_PCH_FALSE='#'
+else
+ GLIBCXX_BUILD_PCH_TRUE='#'
+ GLIBCXX_BUILD_PCH_FALSE=
+fi
+
+
+
+
+if test $enable_cheaders = c; then
+ GLIBCXX_C_HEADERS_C_TRUE=
+ GLIBCXX_C_HEADERS_C_FALSE='#'
+else
+ GLIBCXX_C_HEADERS_C_TRUE='#'
+ GLIBCXX_C_HEADERS_C_FALSE=
+fi
+
+
+
+
+if test $enable_cheaders = c_std; then
+ GLIBCXX_C_HEADERS_C_STD_TRUE=
+ GLIBCXX_C_HEADERS_C_STD_FALSE='#'
+else
+ GLIBCXX_C_HEADERS_C_STD_TRUE='#'
+ GLIBCXX_C_HEADERS_C_STD_FALSE=
+fi
+
+
+
+
+if test $c_compatibility = yes; then
+ GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE=
+ GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE='#'
+else
+ GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE='#'
+ GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE=
+fi
+
+
+
+
+if test $enable_libstdcxx_debug = yes; then
+ GLIBCXX_BUILD_DEBUG_TRUE=
+ GLIBCXX_BUILD_DEBUG_FALSE='#'
+else
+ GLIBCXX_BUILD_DEBUG_TRUE='#'
+ GLIBCXX_BUILD_DEBUG_FALSE=
+fi
+
+
+
+
+if test $enable_symvers != no; then
+ GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE=
+ GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE='#'
+else
+ GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE='#'
+ GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE=
+fi
-# Determine cross-compile flags and all AM_CONDITIONALs.
-if test "$CANADIAN" = yes; then
- CANADIAN_TRUE=
- CANADIAN_FALSE='#'
+if test $enable_wchar_t = yes; then
+ GLIBCXX_TEST_WCHAR_T_TRUE=
+ GLIBCXX_TEST_WCHAR_T_FALSE='#'
else
- CANADIAN_TRUE='#'
- CANADIAN_FALSE=
+ GLIBCXX_TEST_WCHAR_T_TRUE='#'
+ GLIBCXX_TEST_WCHAR_T_FALSE=
fi
-if test "$need_libmath" = yes; then
- GLIBCXX_BUILD_LIBMATH_TRUE=
- GLIBCXX_BUILD_LIBMATH_FALSE='#'
+
+
+if test $enable_abi_check = yes; then
+ GLIBCXX_TEST_ABI_TRUE=
+ GLIBCXX_TEST_ABI_FALSE='#'
else
- GLIBCXX_BUILD_LIBMATH_TRUE='#'
- GLIBCXX_BUILD_LIBMATH_FALSE=
+ GLIBCXX_TEST_ABI_TRUE='#'
+ GLIBCXX_TEST_ABI_FALSE=
fi
-
-cat > confcache <<\EOF
+
+
+
+
+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
-
-if test "${multilib}" = "yes"; then
+if test ${multilib} = yes; then
multilib_arg="--enable-multilib"
else
multilib_arg=
fi
-# Export all the install information
+# Export all the install information.
+
+ glibcxx_toolexecdir=no
+ glibcxx_toolexeclibdir=no
+ glibcxx_prefixdir=$prefix
-# Assumes glibcxx_builddir, glibcxx_srcdir are alreay set up and
-# exported correctly in GLIBCXX_CONFIGURE.
-glibcxx_toolexecdir=no
-glibcxx_toolexeclibdir=no
-glibcxx_prefixdir=${prefix}
+ echo "$as_me:$LINENO: checking for gxx-include-dir" >&5
+echo $ECHO_N "checking for gxx-include-dir... $ECHO_C" >&6
-# Process the option --with-gxx-include-dir=<path to include-files directory>
-echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6
-echo "configure:23731: checking for --with-gxx-include-dir" >&5
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
if test "${with_gxx_include_dir+set}" = set; then
withval="$with_gxx_include_dir"
- case "${withval}" in
- yes)
- { echo "configure: error: Missing directory for --with-gxx-include-dir" 1>&2; exit 1; }
- gxx_include_dir=no
- ;;
- no)
- gxx_include_dir=no
- ;;
- *)
- gxx_include_dir=${withval}
- ;;
-esac
+ case "$withval" in
+ yes) { { echo "$as_me:$LINENO: error: Missing directory for --with-gxx-include-dir" >&5
+echo "$as_me: error: Missing directory for --with-gxx-include-dir" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ no) gxx_include_dir=no ;;
+ *) gxx_include_dir=$withval ;;
+ esac
else
gxx_include_dir=no
-fi
-
-echo "$ac_t""$gxx_include_dir" 1>&6
+fi;
+ echo "$as_me:$LINENO: result: $gxx_include_dir" >&5
+echo "${ECHO_T}$gxx_include_dir" >&6
-# Process the option "--enable-version-specific-runtime-libs"
-echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6
-echo "configure:23755: checking for --enable-version-specific-runtime-libs" >&5
-# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
+ echo "$as_me:$LINENO: checking for --enable-version-specific-runtime-libs" >&5
+echo $ECHO_N "checking for --enable-version-specific-runtime-libs... $ECHO_C" >&6
+ # Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
if test "${enable_version_specific_runtime_libs+set}" = set; then
enableval="$enable_version_specific_runtime_libs"
case "$enableval" in
- yes) version_specific_libs=yes ;;
- no) version_specific_libs=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable version-specific libs" 1>&2; exit 1; };;
- esac
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable version-specific libs" >&5
+echo "$as_me: error: Unknown argument to enable/disable version-specific libs" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
else
version_specific_libs=no
-fi
-# Option set, now we can test it.
-echo "$ac_t""$version_specific_libs" 1>&6
-
-# Default case for install directory for include files.
-if test $version_specific_libs = no && test $gxx_include_dir = no; then
- gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
-fi
-
-# Version-specific runtime libs processing.
-if test $version_specific_libs = yes; then
- # Need the gcc compiler version to know where to install libraries
- # and header files if --enable-version-specific-runtime-libs option
- # is selected.
- if test x"$gxx_include_dir" = x"no"; then
- gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
+fi;
+ echo "$as_me:$LINENO: result: $version_specific_libs" >&5
+echo "${ECHO_T}$version_specific_libs" >&6
+
+ # Default case for install directory for include files.
+ if test $version_specific_libs = no && test $gxx_include_dir = no; then
+ gxx_include_dir='${prefix}'/include/c++/${gcc_version}
+ fi
+
+ # Version-specific runtime libs processing.
+ if test $version_specific_libs = yes; then
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ if test x"$gxx_include_dir" = x"no"; then
+ gxx_include_dir='${libdir}/gcc-lib/${host_alias}/'$gcc_version/include/c++
+ fi
+ glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+ glibcxx_toolexeclibdir='${toolexecdir}/'$gcc_version'$(MULTISUBDIR)'
fi
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
-fi
-# Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
-# Install a library built with a cross compiler in tooldir, not libdir.
-if test x"$glibcxx_toolexecdir" = x"no"; then
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- glibcxx_toolexecdir='$(exec_prefix)/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/lib'
- else
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- glibcxx_toolexeclibdir='$(libdir)'
+ # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ if test x"$glibcxx_toolexecdir" = x"no"; then
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
+ glibcxx_toolexeclibdir='${toolexecdir}/lib'
+ else
+ glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+ glibcxx_toolexeclibdir='${libdir}'
+ fi
+ multi_os_directory=`$CXX -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
+ esac
fi
- multi_os_directory=`$CC -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
- esac
-fi
-echo $ac_n "checking for install location""... $ac_c" 1>&6
-echo "configure:23806: checking for install location" >&5
-echo "$ac_t""$gxx_include_dir" 1>&6
+ echo "$as_me:$LINENO: checking for install location" >&5
+echo $ECHO_N "checking for install location... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $gxx_include_dir" >&5
+echo "${ECHO_T}$gxx_include_dir" >&6
@@ -23813,591 +59306,1475 @@ echo "$ac_t""$gxx_include_dir" 1>&6
# Export all the include and flag information to Makefiles.
- # Root level of the build directory include sources.
- GLIBCXX_INCLUDES="-I${glibcxx_builddir}/include/${target_alias} -I${glibcxx_builddir}/include"
+ # Used for every C++ compile we perform.
+ GLIBCXX_INCLUDES="\
+-I$glibcxx_builddir/include/$host_alias \
+-I$glibcxx_builddir/include \
+-I$glibcxx_srcdir/libsupc++"
- # Passed down for canadian crosses.
- if test x"$CANADIAN" = xyes; then
- TOPLEVEL_INCLUDES='-I$(includedir)'
+ # For Canadian crosses, pick this up too.
+ if test $CANADIAN = yes; then
+ GLIBCXX_INCLUDES="$GLIBCXX_INCLUDES -I\${includedir}"
fi
- LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
-
- LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
+ # Stuff in the actual top level. Currently only used by libsupc++ to
+ # get unwind* headers from the gcc dir.
+ #TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include'
+ TOPLEVEL_INCLUDES='-I$(toplevel_srcdir)/gcc'
# Now, export this to all the little Makefiles....
-
-
-
-
+
+
# Optimization flags that are probably a good idea for thrill-seekers. Just
# uncomment the lines below and make, everything else is ready to go...
# OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
OPTIMIZE_CXXFLAGS=
-
- WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
-
+
+ WARN_FLAGS='-Wall -W -Wwrite-strings -Wcast-qual'
+
if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
- grep "enable shared" > /dev/null; then
+ grep "enable shared" > /dev/null;
+then
LIBSUPCXX_PICFLAGS=-prefer-pic
else
LIBSUPCXX_PICFLAGS=
fi
-# Generate the various Makefiles, include files, and scripts.
-# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am,
-# libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs
-# will end up installed in the correct place. To work around this not being
-# passed # down from config-ml.in -> top_srcdir/Makefile.am ->
-# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
-trap '' 1 2 15
-cat > confcache <<\EOF
+ ac_config_files="$ac_config_files Makefile include/Makefile libmath/Makefile libsupc++/Makefile src/Makefile po/Makefile testsuite/Makefile"
+
+ ac_config_files="$ac_config_files scripts/check_survey"
+
+ ac_config_files="$ac_config_files scripts/testsuite_flags"
+
+
+ ac_config_commands="$ac_config_commands default"
+
+
+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
+
+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 "${GLIBCXX_HOSTED_TRUE}" && test -z "${GLIBCXX_HOSTED_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_HOSTED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_HOSTED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_BUILD_PCH_TRUE}" && test -z "${GLIBCXX_BUILD_PCH_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_BUILD_PCH\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_BUILD_PCH\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_C_HEADERS_C_TRUE}" && test -z "${GLIBCXX_C_HEADERS_C_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_C_HEADERS_C\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_C_HEADERS_C\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_C_HEADERS_C_STD_TRUE}" && test -z "${GLIBCXX_C_HEADERS_C_STD_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_C_HEADERS_C_STD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_C_HEADERS_C_STD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE}" && test -z "${GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_C_HEADERS_COMPATIBILITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_C_HEADERS_COMPATIBILITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_BUILD_DEBUG_TRUE}" && test -z "${GLIBCXX_BUILD_DEBUG_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_BUILD_DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_BUILD_DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE}" && test -z "${GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_BUILD_VERSIONED_SHLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_BUILD_VERSIONED_SHLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_TEST_WCHAR_T_TRUE}" && test -z "${GLIBCXX_TEST_WCHAR_T_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_TEST_WCHAR_T\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_TEST_WCHAR_T\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GLIBCXX_TEST_ABI_TRUE}" && test -z "${GLIBCXX_TEST_ABI_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GLIBCXX_TEST_ABI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GLIBCXX_TEST_ABI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+: ${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.
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+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
+
+
+# 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 \
-include/Makefile src/Makefile \
-libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=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%@PACKAGE@%$PACKAGE%g
-s%@libtool_VERSION@%$libtool_VERSION%g
-s%@toplevel_srcdir@%$toplevel_srcdir%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%@target@%$target%g
-s%@target_alias@%$target_alias%g
-s%@target_cpu@%$target_cpu%g
-s%@target_vendor@%$target_vendor%g
-s%@target_os@%$target_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%@glibcxx_builddir@%$glibcxx_builddir%g
-s%@glibcxx_srcdir@%$glibcxx_srcdir%g
-s%@AWK@%$AWK%g
-s%@LN_S@%$LN_S%g
-s%@glibcxx_basedir@%$glibcxx_basedir%g
-s%@CC@%$CC%g
-s%@glibcxx_CXX@%$glibcxx_CXX%g
-s%@AS@%$AS%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
-s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
-s%@MAINT@%$MAINT%g
-s%@EXEEXT@%$EXEEXT%g
-s%@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%@OBJEXT@%$OBJEXT%g
-s%@STRIP@%$STRIP%g
-s%@LIBTOOL@%$LIBTOOL%g
-s%@CXXCPP@%$CXXCPP%g
-s%@enable_shared@%$enable_shared%g
-s%@enable_static@%$enable_static%g
-s%@ifGNUmake@%$ifGNUmake%g
-s%@LIBUNWIND_FLAG@%$LIBUNWIND_FLAG%g
-s%@GLIBCXX_BUILD_PCH_TRUE@%$GLIBCXX_BUILD_PCH_TRUE%g
-s%@GLIBCXX_BUILD_PCH_FALSE@%$GLIBCXX_BUILD_PCH_FALSE%g
-s%@glibcxx_PCHFLAGS@%$glibcxx_PCHFLAGS%g
-s%@CSTDIO_H@%$CSTDIO_H%g
-s%@FPOS_H@%$FPOS_H%g
-s%@BASIC_FILE_H@%$BASIC_FILE_H%g
-s%@BASIC_FILE_CC@%$BASIC_FILE_CC%g
-s%@CPP@%$CPP%g
-s%@check_msgfmt@%$check_msgfmt%g
-s%@glibcxx_MOFILES@%$glibcxx_MOFILES%g
-s%@glibcxx_POFILES@%$glibcxx_POFILES%g
-s%@glibcxx_localedir@%$glibcxx_localedir%g
-s%@USE_NLS@%$USE_NLS%g
-s%@CLOCALE_H@%$CLOCALE_H%g
-s%@CCODECVT_H@%$CCODECVT_H%g
-s%@CMESSAGES_H@%$CMESSAGES_H%g
-s%@CCODECVT_CC@%$CCODECVT_CC%g
-s%@CCOLLATE_CC@%$CCOLLATE_CC%g
-s%@CCTYPE_CC@%$CCTYPE_CC%g
-s%@CMESSAGES_CC@%$CMESSAGES_CC%g
-s%@CMONEY_CC@%$CMONEY_CC%g
-s%@CNUMERIC_CC@%$CNUMERIC_CC%g
-s%@CTIME_H@%$CTIME_H%g
-s%@CTIME_CC@%$CTIME_CC%g
-s%@CLOCALE_CC@%$CLOCALE_CC%g
-s%@CLOCALE_INTERNAL_H@%$CLOCALE_INTERNAL_H%g
-s%@C_INCLUDE_DIR@%$C_INCLUDE_DIR%g
-s%@GLIBCXX_C_HEADERS_C_TRUE@%$GLIBCXX_C_HEADERS_C_TRUE%g
-s%@GLIBCXX_C_HEADERS_C_FALSE@%$GLIBCXX_C_HEADERS_C_FALSE%g
-s%@GLIBCXX_C_HEADERS_C_STD_TRUE@%$GLIBCXX_C_HEADERS_C_STD_TRUE%g
-s%@GLIBCXX_C_HEADERS_C_STD_FALSE@%$GLIBCXX_C_HEADERS_C_STD_FALSE%g
-s%@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@%$GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE%g
-s%@GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@%$GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE%g
-s%@glibcxx_thread_h@%$glibcxx_thread_h%g
-s%@EXTRA_CXX_FLAGS@%$EXTRA_CXX_FLAGS%g
-s%@GLIBCXX_BUILD_DEBUG_TRUE@%$GLIBCXX_BUILD_DEBUG_TRUE%g
-s%@GLIBCXX_BUILD_DEBUG_FALSE@%$GLIBCXX_BUILD_DEBUG_FALSE%g
-s%@DEBUG_FLAGS@%$DEBUG_FLAGS%g
-s%@SECTION_FLAGS@%$SECTION_FLAGS%g
-s%@SECTION_LDFLAGS@%$SECTION_LDFLAGS%g
-s%@OPT_LDFLAGS@%$OPT_LDFLAGS%g
-s%@LIBMATHOBJS@%$LIBMATHOBJS%g
-s%@WERROR@%$WERROR%g
-s%@SYMVER_MAP@%$SYMVER_MAP%g
-s%@port_specific_symbol_file@%$port_specific_symbol_file%g
-s%@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@%$GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE%g
-s%@GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@%$GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE%g
-s%@baseline_dir@%$baseline_dir%g
-s%@GLIBCXX_TEST_WCHAR_T_TRUE@%$GLIBCXX_TEST_WCHAR_T_TRUE%g
-s%@GLIBCXX_TEST_WCHAR_T_FALSE@%$GLIBCXX_TEST_WCHAR_T_FALSE%g
-s%@GLIBCXX_TEST_ABI_TRUE@%$GLIBCXX_TEST_ABI_TRUE%g
-s%@GLIBCXX_TEST_ABI_FALSE@%$GLIBCXX_TEST_ABI_FALSE%g
-s%@ATOMICITY_INC_SRCDIR@%$ATOMICITY_INC_SRCDIR%g
-s%@FPOS_INC_SRCDIR@%$FPOS_INC_SRCDIR%g
-s%@OS_INC_SRCDIR@%$OS_INC_SRCDIR%g
-s%@GLIBCXX_IS_CROSS_COMPILING@%$GLIBCXX_IS_CROSS_COMPILING%g
-s%@CANADIAN_TRUE@%$CANADIAN_TRUE%g
-s%@CANADIAN_FALSE@%$CANADIAN_FALSE%g
-s%@GLIBCXX_BUILD_LIBMATH_TRUE@%$GLIBCXX_BUILD_LIBMATH_TRUE%g
-s%@GLIBCXX_BUILD_LIBMATH_FALSE@%$GLIBCXX_BUILD_LIBMATH_FALSE%g
-s%@glibcxx_prefixdir@%$glibcxx_prefixdir%g
-s%@gxx_include_dir@%$gxx_include_dir%g
-s%@glibcxx_toolexecdir@%$glibcxx_toolexecdir%g
-s%@glibcxx_toolexeclibdir@%$glibcxx_toolexeclibdir%g
-s%@GLIBCXX_INCLUDES@%$GLIBCXX_INCLUDES%g
-s%@TOPLEVEL_INCLUDES@%$TOPLEVEL_INCLUDES%g
-s%@LIBMATH_INCLUDES@%$LIBMATH_INCLUDES%g
-s%@LIBSUPCXX_INCLUDES@%$LIBSUPCXX_INCLUDES%g
-s%@OPTIMIZE_CXXFLAGS@%$OPTIMIZE_CXXFLAGS%g
-s%@WARN_FLAGS@%$WARN_FLAGS%g
-s%@LIBSUPCXX_PICFLAGS@%$LIBSUPCXX_PICFLAGS%g
-CEOF
-EOF
+# 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'`
+
-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
+# 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 package-unused $as_me version-unused, 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="\\
+package-unused config.status version-unused
+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 \
-include/Makefile src/Makefile \
-libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # 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.
+#
+
+
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+
+# Variables needed in config.status (file generation) which aren't already
+# passed by autoconf.
+SUBDIRS="$SUBDIRS"
+
+
+_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" ;;
+ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "libmath/Makefile" ) CONFIG_FILES="$CONFIG_FILES libmath/Makefile" ;;
+ "libsupc++/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsupc++/Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "po/Makefile" ) CONFIG_FILES="$CONFIG_FILES po/Makefile" ;;
+ "testsuite/Makefile" ) CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+ "scripts/check_survey" ) CONFIG_FILES="$CONFIG_FILES scripts/check_survey" ;;
+ "scripts/testsuite_flags" ) CONFIG_FILES="$CONFIG_FILES scripts/testsuite_flags" ;;
+ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "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,@libtool_VERSION@,$libtool_VERSION,;t t
+s,@multi_basedir@,$multi_basedir,;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,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;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,@glibcxx_builddir@,$glibcxx_builddir,;t t
+s,@glibcxx_srcdir@,$glibcxx_srcdir,;t t
+s,@toplevel_srcdir@,$toplevel_srcdir,;t t
+s,@CC@,$CC,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CXX@,$CXX,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@LN_S@,$LN_S,;t t
+s,@AS@,$AS,;t t
+s,@ac_ct_AS@,$ac_ct_AS,;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,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+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
+s,@CSTDIO_H@,$CSTDIO_H,;t t
+s,@FPOS_H@,$FPOS_H,;t t
+s,@BASIC_FILE_H@,$BASIC_FILE_H,;t t
+s,@BASIC_FILE_CC@,$BASIC_FILE_CC,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@check_msgfmt@,$check_msgfmt,;t t
+s,@glibcxx_MOFILES@,$glibcxx_MOFILES,;t t
+s,@glibcxx_POFILES@,$glibcxx_POFILES,;t t
+s,@glibcxx_localedir@,$glibcxx_localedir,;t t
+s,@USE_NLS@,$USE_NLS,;t t
+s,@CLOCALE_H@,$CLOCALE_H,;t t
+s,@CCODECVT_H@,$CCODECVT_H,;t t
+s,@CMESSAGES_H@,$CMESSAGES_H,;t t
+s,@CCODECVT_CC@,$CCODECVT_CC,;t t
+s,@CCOLLATE_CC@,$CCOLLATE_CC,;t t
+s,@CCTYPE_CC@,$CCTYPE_CC,;t t
+s,@CMESSAGES_CC@,$CMESSAGES_CC,;t t
+s,@CMONEY_CC@,$CMONEY_CC,;t t
+s,@CNUMERIC_CC@,$CNUMERIC_CC,;t t
+s,@CTIME_H@,$CTIME_H,;t t
+s,@CTIME_CC@,$CTIME_CC,;t t
+s,@CLOCALE_CC@,$CLOCALE_CC,;t t
+s,@CLOCALE_INTERNAL_H@,$CLOCALE_INTERNAL_H,;t t
+s,@C_INCLUDE_DIR@,$C_INCLUDE_DIR,;t t
+s,@GLIBCXX_C_HEADERS_C_TRUE@,$GLIBCXX_C_HEADERS_C_TRUE,;t t
+s,@GLIBCXX_C_HEADERS_C_FALSE@,$GLIBCXX_C_HEADERS_C_FALSE,;t t
+s,@GLIBCXX_C_HEADERS_C_STD_TRUE@,$GLIBCXX_C_HEADERS_C_STD_TRUE,;t t
+s,@GLIBCXX_C_HEADERS_C_STD_FALSE@,$GLIBCXX_C_HEADERS_C_STD_FALSE,;t t
+s,@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@,$GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE,;t t
+s,@GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@,$GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE,;t t
+s,@glibcxx_thread_h@,$glibcxx_thread_h,;t t
+s,@DEBUG_FLAGS@,$DEBUG_FLAGS,;t t
+s,@GLIBCXX_BUILD_DEBUG_TRUE@,$GLIBCXX_BUILD_DEBUG_TRUE,;t t
+s,@GLIBCXX_BUILD_DEBUG_FALSE@,$GLIBCXX_BUILD_DEBUG_FALSE,;t t
+s,@EXTRA_CXX_FLAGS@,$EXTRA_CXX_FLAGS,;t t
+s,@WERROR@,$WERROR,;t t
+s,@SECTION_FLAGS@,$SECTION_FLAGS,;t t
+s,@SECTION_LDFLAGS@,$SECTION_LDFLAGS,;t t
+s,@OPT_LDFLAGS@,$OPT_LDFLAGS,;t t
+s,@LIBMATHOBJS@,$LIBMATHOBJS,;t t
+s,@SYMVER_MAP@,$SYMVER_MAP,;t t
+s,@port_specific_symbol_files@,$port_specific_symbol_files,;t t
+s,@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@,$GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE,;t t
+s,@GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@,$GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE,;t t
+s,@baseline_dir@,$baseline_dir,;t t
+s,@GLIBCXX_TEST_WCHAR_T_TRUE@,$GLIBCXX_TEST_WCHAR_T_TRUE,;t t
+s,@GLIBCXX_TEST_WCHAR_T_FALSE@,$GLIBCXX_TEST_WCHAR_T_FALSE,;t t
+s,@GLIBCXX_TEST_ABI_TRUE@,$GLIBCXX_TEST_ABI_TRUE,;t t
+s,@GLIBCXX_TEST_ABI_FALSE@,$GLIBCXX_TEST_ABI_FALSE,;t t
+s,@ATOMICITY_INC_SRCDIR@,$ATOMICITY_INC_SRCDIR,;t t
+s,@FPOS_INC_SRCDIR@,$FPOS_INC_SRCDIR,;t t
+s,@OS_INC_SRCDIR@,$OS_INC_SRCDIR,;t t
+s,@glibcxx_prefixdir@,$glibcxx_prefixdir,;t t
+s,@gxx_include_dir@,$gxx_include_dir,;t t
+s,@glibcxx_toolexecdir@,$glibcxx_toolexecdir,;t t
+s,@glibcxx_toolexeclibdir@,$glibcxx_toolexeclibdir,;t t
+s,@GLIBCXX_INCLUDES@,$GLIBCXX_INCLUDES,;t t
+s,@TOPLEVEL_INCLUDES@,$TOPLEVEL_INCLUDES,;t t
+s,@OPTIMIZE_CXXFLAGS@,$OPTIMIZE_CXXFLAGS,;t t
+s,@WARN_FLAGS@,$WARN_FLAGS,;t t
+s,@LIBSUPCXX_PICFLAGS@,$LIBSUPCXX_PICFLAGS,;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" ;;
+ # 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; }; }; }
+
+ 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
- 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= ;;
+ 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
+
+ # Run the commands associated with the file.
+ case $ac_file in
+ scripts/check_survey ) chmod +x scripts/check_survey ;;
+ scripts/testsuite_flags ) chmod +x scripts/testsuite_flags ;;
esac
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
- 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*
+#
+# 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 :
-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
+while grep . conftest.undefs >/dev/null
+do
+ # 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"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
+ 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; }; }; }
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_build_subdir=${with_build_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-glibcxx_basedir=${glibcxx_basedir}
-CC="${CC}"
-CXX="${CXX}"
-ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+# 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
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
- if test -n "$CONFIG_FILES"; then
- if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
- LD="${ORIGINAL_LD_FOR_MULTILIBS}"
- # Ony modify Makefiles that are just being created.
- case " $CONFIG_FILES" in
- *" Makefile"*)
- ac_file=Makefile . ${glibcxx_basedir}/../config-ml.in
- ;;
- esac
- case $CONFIG_FILES in
- *src/Makefile*)
- grep '^MULTISUBDIR =' Makefile >> src/Makefile
- ;;
- esac
- case $CONFIG_FILES in
- *libsupc++/Makefile*)
- grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
- ;;
- esac
- case $CONFIG_FILES in
- *testsuite/Makefile*)
- grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
- ;;
- esac
- fi
+#
+# 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
+ default-1 )
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
+ default ) if test -n "$CONFIG_FILES"; then
+ # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
+ # that multilib installs will end up installed in the correct place.
+ # The testsuite needs it for multilib-aware ABI baseline files.
+ # To work around this not being passed down from config-ml.in ->
+ # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
+ # append it here. Only modify Makefiles that have just been created.
+ #
+ # Also, get rid of this simulated-VPATH thing that automake does.
+ cat > vpsed << \_EOF
+s!`test -f '$<' || echo '$(srcdir)/'`!!
+_EOF
+ for i in $SUBDIRS; do
+ case $CONFIG_FILES in
+ *${i}/Makefile*)
+ #echo "Adding MULTISUBDIR to $i/Makefile"
+ sed -f vpsed $i/Makefile > tmp
+ grep '^MULTISUBDIR =' Makefile >> tmp
+ mv tmp $i/Makefile
+ ;;
+ esac
+ done
+ rm vpsed
fi
- chmod +x scripts/check_survey
- chmod +x scripts/testsuite_flags
-exit 0
-EOF
+ (cd include && ${MAKE-make})
+ ;;
+ esac
+done
+_ACEOF
+
+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
-
-
-
-# Sanity checking & User-visible messages.
-# Checks down here, otherwise they get scrolled off before
-# the user will notice.
-
-# Trying to get more people to read documentation. Possibly remove
-# check and warn all the time. There is no "informational" AC_MSG_
-# macro, so these are going to be printed even when --quiet/--silent
-# is given.
-if test ! -f stamp-sanity-warned; then
- touch stamp-sanity-warned
- echo ""
- echo "Please make certain that you read the installation information here:"
- echo " faster => ${srcdir}/docs/html/install.html"
- echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
- echo ""
- echo "and the configuration information here:"
- echo " faster => ${srcdir}/docs/html/configopts.html"
- echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
- echo ""
- echo "before proceeding with ${_cv_gnu_make_command}."
- echo ""
+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/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
new file mode 100644
index 00000000000..9a612cf8d14
--- /dev/null
+++ b/libstdc++-v3/configure.ac
@@ -0,0 +1,345 @@
+# Process this file with autoconf to produce a configure script, like so:
+# aclocal && autoconf && autoheader && automake
+
+AC_PREREQ(2.57)
+AC_INIT(package-unused, version-unused,, libstdc++)
+AC_CONFIG_SRCDIR(src/ios.cc)
+AC_CONFIG_HEADER(config.h)
+
+# This works around the fact that libtool configuration may change LD
+# for this particular configuration, but some shells, instead of
+# keeping the changes in LD private, export them just because LD is
+# exported. Only used at the end of this file.
+### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
+
+# For libtool versioning info, format is CURRENT:REVISION:AGE
+libtool_VERSION=6:0:0
+AC_SUBST(libtool_VERSION)
+
+# Find the rest of the source tree framework.
+GLIBCXX_TOPREL_CONFIGURE
+
+# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
+#
+# You will slowly go insane if you do not grok the following fact: when
+# building v3 as part of the compiler, the top-level /target/ becomes the
+# library's /host/. configure then causes --target to default to --host,
+# exactly like any other package using autoconf. Therefore, 'target' and
+# 'host' will always be the same. This makes sense both for native and
+# cross compilers, just think about it for a little while. :-)
+#
+# Also, if v3 is being configured as part of a cross compiler, the top-level
+# configure script will pass the "real" host as $with_cross_host.
+#
+# Do not delete or change the following two lines. For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+AC_CANONICAL_SYSTEM
+target_alias=${target_alias-$host_alias}
+
+# Handy for debugging:
+#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
+
+if test "$build" != "$host"; then
+ # We are being configured with some form of cross compiler.
+ GLIBCXX_IS_NATIVE=false
+ GCC_NO_EXECUTABLES
+else
+ GLIBCXX_IS_NATIVE=true
+fi
+
+# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
+# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
+# 1.x: minimum required version
+# no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
+# of other PACKAGE_* variables will, however, and there's nothing
+# we can do about that; they come from AC_INIT).
+# 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])
+
+# Runs configure.host, finds CC, CXX, and assorted other critical bits. Sets
+# up critical shell variables.
+GLIBCXX_CONFIGURE
+
+#AC_MSG_NOTICE([====== Starting libtool configuration])
+AC_LIBTOOL_DLOPEN
+AM_PROG_LIBTOOL
+AC_SUBST(enable_shared)
+AC_SUBST(enable_static)
+#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
+
+# Possibly disable most of the library.
+## XXX Consider skipping unncessary tests altogether in this case, rather
+## than just ignoring the results. Faster /and/ more correct, win win.
+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.
+# NB: C_MBCHAR must come early.
+GLIBCXX_ENABLE_CSTDIO
+GLIBCXX_ENABLE_CLOCALE
+GLIBCXX_ENABLE_CHEADERS($c_model) dnl c_model from configure.host
+GLIBCXX_ENABLE_C_MBCHAR([yes])
+GLIBCXX_ENABLE_C99([yes])
+GLIBCXX_ENABLE_LONG_LONG([yes])
+GLIBCXX_ENABLE_THREADS
+GLIBCXX_ENABLE_CONCEPT_CHECKS([no])
+GLIBCXX_ENABLE_DEBUG_FLAGS(["-g3 -O0"])
+GLIBCXX_ENABLE_DEBUG([no])
+GLIBCXX_ENABLE_CXX_FLAGS
+
+# No surprises, no surprises...
+if test $atomicity_include_dir = cpu/generic ; then
+ AC_MSG_WARN([No native atomic operations are provided for this platform.])
+ if test $target_thread_file = single; then
+ AC_MSG_WARN([They cannot be faked when thread support is disabled.])
+ AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
+ else
+ AC_MSG_WARN([They will be faked using a mutex.])
+ AC_MSG_WARN([Performance of certain classes will degrade as a result.])
+ fi
+fi
+
+
+if $GLIBCXX_IS_NATIVE; then
+
+ # We can do more elaborate tests that assume a working linker.
+ CANADIAN=no
+
+ # Check for available headers.
+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
+ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
+ sys/types.h])
+
+ GLIBCXX_CHECK_COMPILER_FEATURES
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_MATH_SUPPORT
+ GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ GLIBCXX_CHECK_STDLIB_SUPPORT
+
+ # For showmanyc_helper().
+ AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
+ GLIBCXX_CHECK_POLL
+ GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
+
+ # For xsputn_2().
+ AC_CHECK_HEADERS(sys/uio.h)
+ GLIBCXX_CHECK_WRITEV
+
+ AC_LC_MESSAGES
+
+ AC_TRY_COMPILE(
+ [#include <setjmp.h>],
+ [sigjmp_buf env;
+ while (! sigsetjmp (env, 1))
+ siglongjmp (env, 1);
+ ],
+ [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
+
+ AC_FUNC_MMAP
+
+else
+
+ # This lets us hard-code the functionality we know we'll have in the cross
+ # target environment. "Let" is a sugar-coated word placed on an especially
+ # dull and tedious hack, actually.
+ #
+ # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros
+ # that involve linking, can't be used:
+ # "cannot open sim-crt0.o"
+ # "cannot open crt0.o"
+ # etc. All this is because there currently exists no unified, consistent
+ # way for top level CC information to be passed down to target directories:
+ # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
+ # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
+ # crosses can be removed.
+
+ # If Canadian cross, then don't pick up tools from the build directory.
+ # Used only in GLIBCXX_EXPORT_INCLUDES.
+ if test -n "$with_cross_host" &&
+ test x"$build_alias" != x"$with_cross_host" &&
+ test x"$build" != x"$target";
+ then
+ CANADIAN=yes
+ else
+ CANADIAN=no
+ fi
+
+ # Construct crosses by hand, eliminating bits that need ld...
+ # GLIBCXX_CHECK_COMPILER_FEATURES
+ # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
+ # GLIBCXX_CHECK_MATH_SUPPORT
+
+ # First, test for "known" system libraries. We may be using newlib even
+ # on a hosted environment.
+ if test "x${with_newlib}" = "xyes"; then
+ os_include_dir="os/newlib"
+ AC_DEFINE(HAVE_HYPOT)
+
+ # GLIBCXX_CHECK_STDLIB_SUPPORT
+ AC_DEFINE(HAVE_STRTOF)
+ AC_DEFINE(HAVE_STRTOLD)
+ # AC_FUNC_MMAP
+ AC_DEFINE(HAVE_MMAP)
+
+ AC_DEFINE(HAVE_ACOSF)
+ AC_DEFINE(HAVE_ASINF)
+ AC_DEFINE(HAVE_ATAN2F)
+ AC_DEFINE(HAVE_ATANF)
+ AC_DEFINE(HAVE_CEILF)
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_COPYSIGNF)
+ AC_DEFINE(HAVE_COSF)
+ AC_DEFINE(HAVE_COSHF)
+ AC_DEFINE(HAVE_EXPF)
+ AC_DEFINE(HAVE_FABSF)
+ AC_DEFINE(HAVE_FLOORF)
+ AC_DEFINE(HAVE_FMODF)
+ AC_DEFINE(HAVE_FREXPF)
+ AC_DEFINE(HAVE_LDEXPF)
+ AC_DEFINE(HAVE_LOG10F)
+ AC_DEFINE(HAVE_LOGF)
+ AC_DEFINE(HAVE_MODFF)
+ AC_DEFINE(HAVE_POWF)
+ AC_DEFINE(HAVE_SINF)
+ AC_DEFINE(HAVE_SINHF)
+ AC_DEFINE(HAVE_SQRTF)
+ AC_DEFINE(HAVE_TANF)
+ AC_DEFINE(HAVE_TANHF)
+ else
+ m4_include([crossconfig.m4])
+ fi
+
+ # At some point, we should differentiate between architectures
+ # like x86, which have long double versions, and alpha/powerpc/etc.,
+ # which don't. For the time being, punt.
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ AC_DEFINE(HAVE_ACOSL)
+ AC_DEFINE(HAVE_ASINL)
+ AC_DEFINE(HAVE_ATAN2L)
+ AC_DEFINE(HAVE_ATANL)
+ AC_DEFINE(HAVE_CEILL)
+ AC_DEFINE(HAVE_COPYSIGNL)
+ AC_DEFINE(HAVE_COSL)
+ AC_DEFINE(HAVE_COSHL)
+ AC_DEFINE(HAVE_EXPL)
+ AC_DEFINE(HAVE_FABSL)
+ AC_DEFINE(HAVE_FLOORL)
+ AC_DEFINE(HAVE_FMODL)
+ AC_DEFINE(HAVE_FREXPL)
+ AC_DEFINE(HAVE_LDEXPL)
+ AC_DEFINE(HAVE_LOG10L)
+ AC_DEFINE(HAVE_LOGL)
+ AC_DEFINE(HAVE_MODFL)
+ AC_DEFINE(HAVE_POWL)
+ AC_DEFINE(HAVE_SINCOSL)
+ AC_DEFINE(HAVE_SINL)
+ AC_DEFINE(HAVE_SINHL)
+ AC_DEFINE(HAVE_SQRTL)
+ AC_DEFINE(HAVE_TANL)
+ AC_DEFINE(HAVE_TANHL)
+ fi
+
+fi
+
+# This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
+GLIBCXX_ENABLE_SYMVERS([yes])
+
+# This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
+GLIBCXX_CONFIGURE_TESTSUITE
+
+# Propagate the target-specific source directories through the build chain.
+# (Nothing currently uses cpu_include_dir directly; only atomicity_include_dir
+# uses it, and it only gets used in this file.)
+ATOMICITY_INC_SRCDIR=config/${atomicity_include_dir}
+OS_INC_SRCDIR=config/${os_include_dir}
+FPOS_INC_SRCDIR=config/${fpos_include_dir}
+AC_SUBST(ATOMICITY_INC_SRCDIR)
+AC_SUBST(FPOS_INC_SRCDIR)
+AC_SUBST(OS_INC_SRCDIR)
+
+# Determine cross-compile flags and AM_CONDITIONALs.
+#AC_SUBST(GLIBCXX_IS_NATIVE)
+#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
+# from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
+#AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test $need_libmath = yes)
+GLIBCXX_EVALUATE_CONDITIONALS
+
+AC_CACHE_SAVE
+
+if test ${multilib} = yes; then
+ multilib_arg="--enable-multilib"
+else
+ multilib_arg=
+fi
+
+# Export all the install information.
+GLIBCXX_EXPORT_INSTALL_INFO
+
+# Export all the include and flag information to Makefiles.
+GLIBCXX_EXPORT_INCLUDES
+GLIBCXX_EXPORT_FLAGS
+
+if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
+ grep "enable shared" > /dev/null;
+then
+ LIBSUPCXX_PICFLAGS=-prefer-pic
+else
+ LIBSUPCXX_PICFLAGS=
+fi
+AC_SUBST(LIBSUPCXX_PICFLAGS)
+
+dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros,
+dnl which can all be called multiple times as needed, plus one (different)
+dnl AC_OUPUT macro. This one lists the files to be created:
+AC_CONFIG_FILES( \
+ Makefile \
+ AC_FOREACH([DIR], glibcxx_SUBDIRS, [DIR/Makefile ])
+ )
+AC_CONFIG_FILES([scripts/check_survey],[chmod +x scripts/check_survey])
+AC_CONFIG_FILES([scripts/testsuite_flags],[chmod +x scripts/testsuite_flags])
+
+dnl These commands are run at the end of config.status:
+AC_CONFIG_COMMANDS([default],
+[if test -n "$CONFIG_FILES"; then
+ # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
+ # that multilib installs will end up installed in the correct place.
+ # The testsuite needs it for multilib-aware ABI baseline files.
+ # To work around this not being passed down from config-ml.in ->
+ # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
+ # append it here. Only modify Makefiles that have just been created.
+ #
+ # Also, get rid of this simulated-VPATH thing that automake does.
+ cat > vpsed << \_EOF
+s!`test -f '$<' || echo '$(srcdir)/'`!!
+_EOF
+ for i in $SUBDIRS; do
+ case $CONFIG_FILES in
+ *${i}/Makefile*)
+ #echo "Adding MULTISUBDIR to $i/Makefile"
+ sed -f vpsed $i/Makefile > tmp
+ grep '^MULTISUBDIR =' Makefile >> tmp
+ mv tmp $i/Makefile
+ ;;
+ esac
+ done
+ rm vpsed
+ fi
+ (cd include && ${MAKE-make})
+],
+[
+# Variables needed in config.status (file generation) which aren't already
+# passed by autoconf.
+SUBDIRS="$SUBDIRS"
+])
+
+dnl And this actually makes things happen:
+AC_OUTPUT
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index 763324d9ae7..ccc6ef9d1ae 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -18,7 +18,7 @@
#
# cpu_include_dir CPU-specific directory, defaults to cpu/generic
# if cpu/host_cpu doesn't exist. This is
-# used to set ATOMICITYH.
+# used to set atomicity_include_dir.
#
# os_include_dir OS-specific directory, defaults to os/generic.
#
@@ -32,7 +32,7 @@
#
# fpos_include_dir directory for definition of fpos template
#
-# ATOMICITYH location of atomicity.h,
+# atomicity_include_dir location of atomicity.h,
# defaults to cpu_include_dir
#
# It possibly modifies the following variables:
@@ -41,10 +41,10 @@
# the form '-Wl,blah'
# (defaults to empty in acinclude.m4)
#
-# port_specific_symbol_file
+# port_specific_symbol_files
# whitespace-seperated list of files containing
-# additional symbols to export from the shared
-# library, when symbol versioning is in use
+# additional symbols to export from the shared
+# library, when symbol versioning is in use
#
#
# If the defaults will not work for your platform, you need only change the
@@ -109,7 +109,7 @@ esac
# default choices for those if they haven't been explicitly set
# already.
cpu_include_dir="cpu/${try_cpu}"
-ATOMICITYH=$cpu_include_dir
+atomicity_include_dir=$cpu_include_dir
abi_baseline_pair=${try_cpu}-${host_os}
@@ -125,14 +125,14 @@ case "${host_os}" in
# os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
# explicitly duplicate the directory for 4.[<3].
os_include_dir="os/aix"
- ATOMICITYH="os/aix"
+ atomicity_include_dir="os/aix"
OPT_LDFLAGS="-Wl,-G"
;;
aix4.*)
- ATOMICITYH="os/aix"
+ atomicity_include_dir="os/aix"
;;
aix*)
- ATOMICITYH="cpu/generic"
+ atomicity_include_dir="cpu/generic"
;;
bsd*)
# Plain BSD attempts to share FreeBSD files.
@@ -157,11 +157,11 @@ case "${host_os}" in
irix[1-6] | irix[1-5].* | irix6.[0-4]*)
# This is known to work on at least IRIX 5.2 and 6.3.
os_include_dir="os/irix/irix5.2"
- ATOMICITYH=$os_include_dir
+ atomicity_include_dir=$os_include_dir
;;
irix6.5*)
os_include_dir="os/irix/irix6.5"
- ATOMICITYH=$os_include_dir
+ atomicity_include_dir=$os_include_dir
;;
mingw32*)
os_include_dir="os/mingw32"
@@ -169,6 +169,16 @@ case "${host_os}" in
netbsd*)
os_include_dir="os/bsd/netbsd"
;;
+ qnx6.[12]*)
+ os_include_dir="os/qnx/qnx6.1"
+ c_model=c
+ ;;
+ solaris2)
+ # This too-vague configuration does not provide enough information
+ # to select a ctype include, and thus os_include_dir is a crap shoot.
+ echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
+ exit 1;
+ ;;
solaris2.5*)
os_include_dir="os/solaris/solaris2.5"
;;
@@ -181,10 +191,6 @@ case "${host_os}" in
windiss*)
os_include_dir="os/windiss"
;;
- qnx6.[12]*)
- os_include_dir="os/qnx/qnx6.1"
- c_model=c
- ;;
*)
os_include_dir="os/generic"
;;
@@ -195,7 +201,7 @@ esac
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
case "${host}" in
mips*-*-linux*)
- ATOMICITYH="cpu/mips"
+ atomicity_include_dir="cpu/mips"
;;
x86_64-*-linux*)
abi_baseline_pair="x86_64-linux-gnu"
diff --git a/libstdc++-v3/configure.in b/libstdc++-v3/configure.in
deleted file mode 100644
index 4d02007caad..00000000000
--- a/libstdc++-v3/configure.in
+++ /dev/null
@@ -1,602 +0,0 @@
-# Process this file with autoconf to produce a configure script, like so:
-# aclocal && autoconf && autoheader && automake
-
-AC_PREREQ(2.13)
-AC_INIT(src/ios.cc)
-
-# This works around the fact that libtool configuration may change LD
-# for this particular configuration, but some shells, instead of
-# keeping the changes in LD private, export them just because LD is
-# exported. Only used at the end of this file.
-ORIGINAL_LD_FOR_MULTILIBS=$LD
-
-PACKAGE=libstdc++
-AC_SUBST(PACKAGE)
-# For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:0:0
-AC_SUBST(libtool_VERSION)
-
-GLIBCXX_TOPREL_CONFIGURE
-
-# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
-#
-# You will slowly go insane if you do not grok the following fact: when
-# building v3 as part of the compiler, the top-level /target/ becomes the
-# library's /host/. `configure' then causes --target to default to --host,
-# exactly like any other package using autoconf. Therefore, 'target' and
-# 'host' will always be the same. This makes sense both for native and
-# cross compilers, just think about it for a little while. :-)
-#
-# Also, if v3 is being configured as part of a cross compiler, the top-level
-# configure script will pass the "real" host as $with_cross_host.
-#
-# In AC 2.13 AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
-AC_CANONICAL_SYSTEM
-
-# Runs configure.host, finds CC, CXX and assorted other critical bits.
-# Must run this before the GLIBCXX_ENABLE_* macros below.
-GLIBCXX_CONFIGURE(.)
-
-AM_INIT_AUTOMAKE($PACKAGE, $gcc_version)
-AM_CONFIG_HEADER(config.h)
-
-AC_LIBTOOL_DLOPEN
-AM_PROG_LIBTOOL
-AC_SUBST(enable_shared)
-AC_SUBST(enable_static)
-
-# Check for support bits and g++ features that don't require linking.
-GLIBCXX_CHECK_GNU_MAKE
-#GLIBCXX_CHECK_COMPILER_VERSION
-GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
-GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS
-GLIBCXX_ENABLE_PCH([yes])
-
-# Enable all the variable C++ runtime options.
-# NB: C_MBCHAR must come early.
-GLIBCXX_ENABLE_CSTDIO
-GLIBCXX_ENABLE_CLOCALE
-GLIBCXX_ENABLE_CHEADERS([$c_model])
-GLIBCXX_ENABLE_C_MBCHAR([yes])
-GLIBCXX_ENABLE_C99([yes])
-GLIBCXX_ENABLE_LONG_LONG([yes])
-GLIBCXX_ENABLE_THREADS
-GLIBCXX_ENABLE_CONCEPT_CHECKS
-GLIBCXX_ENABLE_CXX_FLAGS
-GLIBCXX_ENABLE_DEBUG([no])
-GLIBCXX_ENABLE_DEBUG_FLAGS([none])
-
-# No surprises, no surprises...
-if test $ATOMICITYH = cpu/generic ; then
- AC_MSG_WARN([No native atomic operations are provided for this platform.])
- if test $target_thread_file = single; then
- AC_MSG_WARN([They cannot be faked when thread support is disabled.])
- AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
- else
- AC_MSG_WARN([They will be faked using a mutex.])
- AC_MSG_WARN([Performance of certain classes will degrade as a result.])
- fi
-fi
-
-
-if test x"$build" != x"$host"; then
-
- # We are being configured with some form of cross compiler.
- GLIBCXX_IS_CROSS_COMPILING=true
-
- # This lets us hard-code the functionality we know we'll have in the cross
- # target environment. "Let" is a sugar-coated word placed on an especially
- # dull and tedious hack, actually.
- #
- # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros
- # that involve linking, can't be used:
- # "cannot open sim-crt0.o"
- # "cannot open crt0.o"
- # etc. All this is because there currently exists no unified, consistent
- # way for top level CC information to be passed down to target directories:
- # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
- # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
- # crosses can be removed.
-
- # If Canadian cross, then don't pick up tools from the build directory.
- # Used in GLIBCXX_EXPORT_INCLUDES (and nowhere else?).
- if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host" \
- && test x"$build" != x"$target"; then
- CANADIAN=yes
- else
- CANADIAN=no
- fi
-
- # Construct crosses by hand, eliminating bits that need ld...
- # GLIBCXX_CHECK_COMPILER_FEATURES
- # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
- # GLIBCXX_CHECK_MATH_SUPPORT
-
- case "${host}" in
- *-freebsd*)
- os_include_dir="os/bsd/freebsd"
- 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 sys/resource.h sys/stat.h \
- sys/time.h unistd.h])
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
- AC_SUBST(SECTION_FLAGS)
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCXX_CHECK_WCHAR_T_SUPPORT
- AC_DEFINE(HAVE_LC_MESSAGES)
- AC_DEFINE(HAVE_DRAND48)
- AC_DEFINE(HAVE_GETPAGESIZE)
- AC_DEFINE(HAVE_SETENV)
- AC_DEFINE(HAVE_SIGSETJMP)
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_COPYSIGNF)
- AC_DEFINE(HAVE_FINITEF)
- AC_DEFINE(HAVE_FINITE)
- AC_DEFINE(HAVE_FREXPF)
- AC_DEFINE(HAVE_HYPOT)
- AC_DEFINE(HAVE_HYPOTF)
- AC_DEFINE(HAVE_ISINF)
- AC_DEFINE(HAVE_ISNAN)
- AC_DEFINE(HAVE_ISNANF)
-
- AC_DEFINE(HAVE_MMAP)
- AC_DEFINE(HAVE_ACOSF)
- AC_DEFINE(HAVE_ASINF)
- AC_DEFINE(HAVE_ATAN2F)
- AC_DEFINE(HAVE_ATANF)
- AC_DEFINE(HAVE_CEILF)
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_COPYSIGNF)
- AC_DEFINE(HAVE_COSF)
- AC_DEFINE(HAVE_COSHF)
- AC_DEFINE(HAVE_EXPF)
- AC_DEFINE(HAVE_FABSF)
- AC_DEFINE(HAVE_FLOORF)
- AC_DEFINE(HAVE_FMODF)
- AC_DEFINE(HAVE_FREXPF)
- AC_DEFINE(HAVE_LDEXPF)
- AC_DEFINE(HAVE_LOG10F)
- AC_DEFINE(HAVE_LOGF)
- AC_DEFINE(HAVE_MODFF)
- AC_DEFINE(HAVE_POWF)
- AC_DEFINE(HAVE_SINF)
- AC_DEFINE(HAVE_SINHF)
- AC_DEFINE(HAVE_SQRTF)
- AC_DEFINE(HAVE_TANF)
- AC_DEFINE(HAVE_TANHF)
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- AC_DEFINE(HAVE_FINITEL)
- AC_DEFINE(HAVE_ISINFL)
- AC_DEFINE(HAVE_ISNANL)
- fi
- ;;
- *-hpux*)
- os_include_dir="os/hpux"
- 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])
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
- AC_SUBST(SECTION_FLAGS)
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCXX_CHECK_WCHAR_T_SUPPORT
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_COPYSIGNF)
- AC_DEFINE(HAVE_FREXPF)
- AC_DEFINE(HAVE_HYPOT)
- case "$target" in
- *-hpux10*)
- AC_DEFINE(HAVE_FINITE)
- AC_DEFINE(HAVE_FINITEF)
- AC_DEFINE(HAVE_ISINF)
- AC_DEFINE(HAVE_ISINFF)
- AC_DEFINE(HAVE_ISNAN)
- AC_DEFINE(HAVE_ISNANF)
- ;;
- esac
- ;;
- *-linux*)
- os_include_dir="os/gnu-linux"
- 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])
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
- AC_SUBST(SECTION_FLAGS)
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCXX_CHECK_WCHAR_T_SUPPORT
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_COPYSIGNF)
- AC_DEFINE(HAVE_FINITE)
- AC_DEFINE(HAVE_FINITEF)
- AC_DEFINE(HAVE_FREXPF)
- AC_DEFINE(HAVE_HYPOTF)
- AC_DEFINE(HAVE_ISINF)
- AC_DEFINE(HAVE_ISINFF)
- AC_DEFINE(HAVE_ISNAN)
- AC_DEFINE(HAVE_ISNANF)
- AC_DEFINE(HAVE_SINCOS)
- AC_DEFINE(HAVE_SINCOSF)
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- AC_DEFINE(HAVE_FINITEL)
- AC_DEFINE(HAVE_HYPOTL)
- AC_DEFINE(HAVE_ISINFL)
- AC_DEFINE(HAVE_ISNANL)
- fi
- ;;
- *-mingw32*)
- os_include_dir="os/mingw32"
- AC_CHECK_HEADERS([sys/types.h locale.h float.h])
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCXX_CHECK_WCHAR_T_SUPPORT
- ;;
- *-netbsd*)
- os_include_dir="os/bsd/netbsd"
- 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])
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
- AC_SUBST(SECTION_FLAGS)
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCXX_CHECK_WCHAR_T_SUPPORT
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_COPYSIGNF)
- AC_DEFINE(HAVE_FINITEF)
- AC_DEFINE(HAVE_FINITE)
- AC_DEFINE(HAVE_FREXPF)
- AC_DEFINE(HAVE_HYPOTF)
- AC_DEFINE(HAVE_ISINF)
- AC_DEFINE(HAVE_ISINFF)
- AC_DEFINE(HAVE_ISNAN)
- AC_DEFINE(HAVE_ISNANF)
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- AC_DEFINE(HAVE_FINITEL)
- AC_DEFINE(HAVE_ISINFL)
- AC_DEFINE(HAVE_ISNANL)
- fi
- ;;
- *-qnx6.1* | *-qnx6.2*)
- os_include_dir="os/qnx/qnx6.1"
- SECTION_FLAGS='-ffunction-sections -fdata-sections'
- AC_SUBST(SECTION_FLAGS)
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCXX_CHECK_WCHAR_T_SUPPORT
- AC_DEFINE(HAVE_COSF)
- AC_DEFINE(HAVE_COSL)
- AC_DEFINE(HAVE_COSHF)
- AC_DEFINE(HAVE_COSHL)
- AC_DEFINE(HAVE_LOGF)
- AC_DEFINE(HAVE_LOGL)
- AC_DEFINE(HAVE_LOG10F)
- AC_DEFINE(HAVE_LOG10L)
- AC_DEFINE(HAVE_SINF)
- AC_DEFINE(HAVE_SINL)
- AC_DEFINE(HAVE_SINHF)
- AC_DEFINE(HAVE_SINHL)
- ;;
- *-solaris*)
- case "$target" in
- *-solaris2.5)
- os_include_dir="os/solaris/solaris2.5"
- ;;
- *-solaris2.6)
- os_include_dir="os/solaris/solaris2.6"
- ;;
- *-solaris2.7 | *-solaris2.8 | *-solaris2.9)
- os_include_dir="os/solaris/solaris2.7"
- ;;
- esac
- AC_DEFINE(HAVE_STRTOF)
- AC_DEFINE(HAVE_STRTOLD)
- AC_DEFINE(HAVE_MMAP)
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_ISNAN)
- AC_DEFINE(HAVE_ISNANF)
- AC_DEFINE(HAVE_MODFF)
- AC_DEFINE(HAVE_HYPOT)
- ;;
- *-windiss*)
- os_include_dir="os/windiss"
- AC_DEFINE(HAVE_ACOSF)
- AC_DEFINE(HAVE_ASINF)
- AC_DEFINE(HAVE_ATAN2F)
- AC_DEFINE(HAVE_ATANF)
- AC_DEFINE(HAVE_CEILF)
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_COPYSIGNF)
- AC_DEFINE(HAVE_COSF)
- AC_DEFINE(HAVE_COSHF)
- AC_DEFINE(HAVE_EXPF)
- AC_DEFINE(HAVE_FABSF)
- AC_DEFINE(HAVE_FLOORF)
- AC_DEFINE(HAVE_FMODF)
- AC_DEFINE(HAVE_FREXPF)
- AC_DEFINE(HAVE_LDEXPF)
- AC_DEFINE(HAVE_LOG10F)
- AC_DEFINE(HAVE_LOGF)
- AC_DEFINE(HAVE_MODFF)
- AC_DEFINE(HAVE_POWF)
- AC_DEFINE(HAVE_SINF)
- AC_DEFINE(HAVE_SINHF)
- AC_DEFINE(HAVE_SQRTF)
- AC_DEFINE(HAVE_TANF)
- AC_DEFINE(HAVE_TANHF)
- ;;
- *)
- if test "x${with_newlib}" = "xyes"; then
- os_include_dir="os/newlib"
- AC_DEFINE(HAVE_HYPOT)
-
- # GLIBCXX_CHECK_STDLIB_SUPPORT
- AC_DEFINE(HAVE_STRTOF)
- AC_DEFINE(HAVE_STRTOLD)
- # AC_FUNC_MMAP
- AC_DEFINE(HAVE_MMAP)
-
- AC_DEFINE(HAVE_ACOSF)
- AC_DEFINE(HAVE_ASINF)
- AC_DEFINE(HAVE_ATAN2F)
- AC_DEFINE(HAVE_ATANF)
- AC_DEFINE(HAVE_CEILF)
- AC_DEFINE(HAVE_COPYSIGN)
- AC_DEFINE(HAVE_COPYSIGNF)
- AC_DEFINE(HAVE_COSF)
- AC_DEFINE(HAVE_COSHF)
- AC_DEFINE(HAVE_EXPF)
- AC_DEFINE(HAVE_FABSF)
- AC_DEFINE(HAVE_FLOORF)
- AC_DEFINE(HAVE_FMODF)
- AC_DEFINE(HAVE_FREXPF)
- AC_DEFINE(HAVE_LDEXPF)
- AC_DEFINE(HAVE_LOG10F)
- AC_DEFINE(HAVE_LOGF)
- AC_DEFINE(HAVE_MODFF)
- AC_DEFINE(HAVE_POWF)
- AC_DEFINE(HAVE_SINF)
- AC_DEFINE(HAVE_SINHF)
- AC_DEFINE(HAVE_SQRTF)
- AC_DEFINE(HAVE_TANF)
- AC_DEFINE(HAVE_TANHF)
- else
- AC_MSG_ERROR([No support for this host/target combination.])
- fi
- ;;
- esac
-
- # At some point, we should differentiate between architectures
- # like x86, which have long double versions, and alpha/powerpc/etc.,
- # which don't. For the time being, punt.
- if test x"long_double_math_on_this_cpu" = x"yes"; then
- AC_DEFINE(HAVE_ACOSL)
- AC_DEFINE(HAVE_ASINL)
- AC_DEFINE(HAVE_ATAN2L)
- AC_DEFINE(HAVE_ATANL)
- AC_DEFINE(HAVE_CEILL)
- AC_DEFINE(HAVE_COPYSIGNL)
- AC_DEFINE(HAVE_COSL)
- AC_DEFINE(HAVE_COSHL)
- AC_DEFINE(HAVE_EXPL)
- AC_DEFINE(HAVE_FABSL)
- AC_DEFINE(HAVE_FLOORL)
- AC_DEFINE(HAVE_FMODL)
- AC_DEFINE(HAVE_FREXPL)
- AC_DEFINE(HAVE_LDEXPL)
- AC_DEFINE(HAVE_LOG10L)
- AC_DEFINE(HAVE_LOGL)
- AC_DEFINE(HAVE_MODFL)
- AC_DEFINE(HAVE_POWL)
- AC_DEFINE(HAVE_SINCOSL)
- AC_DEFINE(HAVE_SINL)
- AC_DEFINE(HAVE_SINHL)
- AC_DEFINE(HAVE_SQRTL)
- AC_DEFINE(HAVE_TANL)
- AC_DEFINE(HAVE_TANHL)
- fi
-
-else
-
- # We are being configured natively. We can do more elaborate tests
- # that include AC_TRY_COMPILE now, as the linker is assumed to be
- # working.
- GLIBCXX_IS_CROSS_COMPILING=false
- CANADIAN=no
-
- # Check for available headers.
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
- sys/types.h])
-
- GLIBCXX_CHECK_COMPILER_FEATURES
- GLIBCXX_CHECK_LINKER_FEATURES
- GLIBCXX_CHECK_MATH_SUPPORT
- GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
- GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCXX_CHECK_WCHAR_T_SUPPORT
- GLIBCXX_CHECK_STDLIB_SUPPORT
-
- # For showmanyc_helper().
- AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
- GLIBCXX_CHECK_POLL
- GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
-
- AC_LC_MESSAGES
-
- AC_TRY_COMPILE([
- #include <setjmp.h>
- ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
- [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
- ])
-
- AC_FUNC_MMAP
-fi
-
-# This depends on GLIBCXX_CHECK_LINKER_FEATURES, but without it assumes no.
-GLIBCXX_ENABLE_SYMVERS([yes])
-
-# This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_CROSS_COMPILING.
-GLIBCXX_CONFIGURE_TESTSUITE
-
-# Propagate the target-specific source directories through the build chain.
-# (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
-# uses it, and it only gets used in this file.)
-ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
-OS_INC_SRCDIR=config/${os_include_dir}
-FPOS_INC_SRCDIR=config/${fpos_include_dir}
-AC_SUBST(ATOMICITY_INC_SRCDIR)
-AC_SUBST(FPOS_INC_SRCDIR)
-AC_SUBST(OS_INC_SRCDIR)
-
-
-# Determine cross-compile flags and all AM_CONDITIONALs.
-AC_SUBST(GLIBCXX_IS_CROSS_COMPILING)
-AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
-dnl from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
-AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test "$need_libmath" = yes)
-
-AC_CACHE_SAVE
-
-if test "${multilib}" = "yes"; then
- multilib_arg="--enable-multilib"
-else
- multilib_arg=
-fi
-
-# Export all the install information
-GLIBCXX_EXPORT_INSTALL_INFO
-
-# Export all the include and flag information to Makefiles.
-GLIBCXX_EXPORT_INCLUDES
-GLIBCXX_EXPORT_FLAGS
-
-if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
- grep "enable shared" > /dev/null; then
- LIBSUPCXX_PICFLAGS=-prefer-pic
-else
- LIBSUPCXX_PICFLAGS=
-fi
-AC_SUBST(LIBSUPCXX_PICFLAGS)
-
-# Generate the various Makefiles, include files, and scripts.
-# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am,
-# libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs
-# will end up installed in the correct place. To work around this not being
-# passed # down from config-ml.in -> top_srcdir/Makefile.am ->
-# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
-AC_OUTPUT(Makefile \
-include/Makefile src/Makefile \
-libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags,
-[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
- if test -n "$CONFIG_FILES"; then
- if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
- LD="${ORIGINAL_LD_FOR_MULTILIBS}"
- # Ony modify Makefiles that are just being created.
- case " $CONFIG_FILES" in
- *" Makefile"*)
- ac_file=Makefile . ${glibcxx_basedir}/../config-ml.in
- ;;
- esac
- case $CONFIG_FILES in
- *src/Makefile*)
- grep '^MULTISUBDIR =' Makefile >> src/Makefile
- ;;
- esac
- case $CONFIG_FILES in
- *libsupc++/Makefile*)
- grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
- ;;
- esac
- case $CONFIG_FILES in
- *testsuite/Makefile*)
- grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
- ;;
- esac
- fi
- fi
- chmod +x scripts/check_survey
- chmod +x scripts/testsuite_flags],
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_build_subdir=${with_build_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-glibcxx_basedir=${glibcxx_basedir}
-CC="${CC}"
-CXX="${CXX}"
-ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
-)
-dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
-dnl AC_CONFIG_FILES(Makefile \
-dnl include/Makefile src/Makefile \
-dnl libmath/Makefile libsupc++/Makefile \
-dnl po/Makefile testsuite/Makefile \
-dnl scripts/check_survey scripts/testsuite_flags)
-dnl AC_CONFIG_COMMANDS([default],
-dnl [if test -n "$CONFIG_FILES"; then
-dnl # Ony modify Makefiles that are just being created.
-dnl case " $CONFIG_FILES" in
-dnl *" Makefile"*)
-dnl ac_file=Makefile . ${glibcxx_basedir}/../config-ml.in
-dnl ;;
-dnl esac
-dnl case $CONFIG_FILES in
-dnl *src/Makefile*)
-dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
-dnl ;;
-dnl esac
-dnl case $CONFIG_FILES in
-dnl *libsupc++/Makefile*)
-dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
-dnl ;;
-dnl esac
-dnl case $CONFIG_FILES in
-dnl *testsuite/Makefile*)
-dnl grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
-dnl ;;
-dnl esac
-dnl fi
-dnl chmod +x scripts/check_survey
-dnl chmod +x scripts/testsuite_flags
-dnl ],
-dnl srcdir=${srcdir}
-dnl host=${host}
-dnl target=${target}
-dnl with_multisubdir=${with_multisubdir}
-dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
-dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-dnl glibcxx_basedir=${glibcxx_basedir}
-dnl CC="${CC}"
-dnl CXX="${CXX}"
-dnl )
-dnl AC_OUTPUT
-
-
-# Sanity checking & User-visible messages.
-# Checks down here, otherwise they get scrolled off before
-# the user will notice.
-
-# Trying to get more people to read documentation. Possibly remove
-# check and warn all the time. There is no "informational" AC_MSG_
-# macro, so these are going to be printed even when --quiet/--silent
-# is given.
-if test ! -f stamp-sanity-warned; then
- touch stamp-sanity-warned
- echo ""
- echo "Please make certain that you read the installation information here:"
- echo " faster => ${srcdir}/docs/html/install.html"
- echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
- echo ""
- echo "and the configuration information here:"
- echo " faster => ${srcdir}/docs/html/configopts.html"
- echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
- echo ""
- echo "before proceeding with ${_cv_gnu_make_command}."
- echo ""
-fi
diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
new file mode 100644
index 00000000000..cec7a6257b8
--- /dev/null
+++ b/libstdc++-v3/crossconfig.m4
@@ -0,0 +1,262 @@
+dnl
+dnl This file contains stuff.
+dnl
+
+# Base decisions on target environment.
+case "${host}" in
+ *-darwin*)
+ # Darwin versions vary, but the linker should work in a cross environment,
+ # so we just check for all the features here.
+ # Check for available headers.
+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
+ machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
+ sys/types.h])
+
+ GLIBCXX_CHECK_COMPILER_FEATURES
+ # Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
+ GLIBCXX_CHECK_MATH_SUPPORT
+ GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ GLIBCXX_CHECK_STDLIB_SUPPORT
+
+ # For showmanyc_helper().
+ AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
+ GLIBCXX_CHECK_POLL
+ GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
+
+ # For xsputn_2().
+ AC_CHECK_HEADERS(sys/uio.h)
+ GLIBCXX_CHECK_WRITEV
+
+ AC_DEFINE(HAVE_LC_MESSAGES)
+
+ AC_TRY_COMPILE(
+ [#include <setjmp.h>],
+ [sigjmp_buf env;
+ while (! sigsetjmp (env, 1))
+ siglongjmp (env, 1);
+ ],
+ [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
+
+ AC_DEFINE(HAVE_MMAP)
+ ;;
+
+ *-freebsd*)
+ #os_include_dir="os/bsd/freebsd"
+ 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 sys/resource.h sys/stat.h \
+ sys/time.h unistd.h])
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ AC_SUBST(SECTION_FLAGS)
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ AC_DEFINE(HAVE_LC_MESSAGES)
+ AC_DEFINE(HAVE_DRAND48)
+ AC_DEFINE(HAVE_GETPAGESIZE)
+ AC_DEFINE(HAVE_SETENV)
+ AC_DEFINE(HAVE_SIGSETJMP)
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_COPYSIGNF)
+ AC_DEFINE(HAVE_FINITEF)
+ AC_DEFINE(HAVE_FINITE)
+ AC_DEFINE(HAVE_FREXPF)
+ AC_DEFINE(HAVE_HYPOT)
+ AC_DEFINE(HAVE_HYPOTF)
+ AC_DEFINE(HAVE_ISINF)
+ AC_DEFINE(HAVE_ISNAN)
+ AC_DEFINE(HAVE_ISNANF)
+
+ AC_DEFINE(HAVE_MMAP)
+ AC_DEFINE(HAVE_ACOSF)
+ AC_DEFINE(HAVE_ASINF)
+ AC_DEFINE(HAVE_ATAN2F)
+ AC_DEFINE(HAVE_ATANF)
+ AC_DEFINE(HAVE_CEILF)
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_COPYSIGNF)
+ AC_DEFINE(HAVE_COSF)
+ AC_DEFINE(HAVE_COSHF)
+ AC_DEFINE(HAVE_EXPF)
+ AC_DEFINE(HAVE_FABSF)
+ AC_DEFINE(HAVE_FLOORF)
+ AC_DEFINE(HAVE_FMODF)
+ AC_DEFINE(HAVE_FREXPF)
+ AC_DEFINE(HAVE_LDEXPF)
+ AC_DEFINE(HAVE_LOG10F)
+ AC_DEFINE(HAVE_LOGF)
+ AC_DEFINE(HAVE_MODFF)
+ AC_DEFINE(HAVE_POWF)
+ AC_DEFINE(HAVE_SINF)
+ AC_DEFINE(HAVE_SINHF)
+ AC_DEFINE(HAVE_SQRTF)
+ AC_DEFINE(HAVE_TANF)
+ AC_DEFINE(HAVE_TANHF)
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ AC_DEFINE(HAVE_FINITEL)
+ AC_DEFINE(HAVE_ISINFL)
+ AC_DEFINE(HAVE_ISNANL)
+ fi
+ ;;
+ *-hpux*)
+ #os_include_dir="os/hpux"
+ 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])
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ AC_SUBST(SECTION_FLAGS)
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_COPYSIGNF)
+ AC_DEFINE(HAVE_FREXPF)
+ AC_DEFINE(HAVE_HYPOT)
+ case "$target" in
+ *-hpux10*)
+ AC_DEFINE(HAVE_FINITE)
+ AC_DEFINE(HAVE_FINITEF)
+ AC_DEFINE(HAVE_ISINF)
+ AC_DEFINE(HAVE_ISINFF)
+ AC_DEFINE(HAVE_ISNAN)
+ AC_DEFINE(HAVE_ISNANF)
+ ;;
+ esac
+ ;;
+ *-linux*)
+ #os_include_dir="os/gnu-linux"
+ 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])
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ AC_SUBST(SECTION_FLAGS)
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_COPYSIGNF)
+ AC_DEFINE(HAVE_FINITE)
+ AC_DEFINE(HAVE_FINITEF)
+ AC_DEFINE(HAVE_FREXPF)
+ AC_DEFINE(HAVE_HYPOTF)
+ AC_DEFINE(HAVE_ISINF)
+ AC_DEFINE(HAVE_ISINFF)
+ AC_DEFINE(HAVE_ISNAN)
+ AC_DEFINE(HAVE_ISNANF)
+ AC_DEFINE(HAVE_SINCOS)
+ AC_DEFINE(HAVE_SINCOSF)
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ AC_DEFINE(HAVE_FINITEL)
+ AC_DEFINE(HAVE_HYPOTL)
+ AC_DEFINE(HAVE_ISINFL)
+ AC_DEFINE(HAVE_ISNANL)
+ fi
+ ;;
+ *-mingw32*)
+ #os_include_dir="os/mingw32"
+ AC_CHECK_HEADERS([sys/types.h locale.h float.h])
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ ;;
+ *-netbsd*)
+ #os_include_dir="os/bsd/netbsd"
+ 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])
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ AC_SUBST(SECTION_FLAGS)
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_COPYSIGNF)
+ AC_DEFINE(HAVE_FINITEF)
+ AC_DEFINE(HAVE_FINITE)
+ AC_DEFINE(HAVE_FREXPF)
+ AC_DEFINE(HAVE_HYPOTF)
+ AC_DEFINE(HAVE_ISINF)
+ AC_DEFINE(HAVE_ISINFF)
+ AC_DEFINE(HAVE_ISNAN)
+ AC_DEFINE(HAVE_ISNANF)
+ if test x"long_double_math_on_this_cpu" = x"yes"; then
+ AC_DEFINE(HAVE_FINITEL)
+ AC_DEFINE(HAVE_ISINFL)
+ AC_DEFINE(HAVE_ISNANL)
+ fi
+ ;;
+ *-qnx6.1* | *-qnx6.2*)
+ #os_include_dir="os/qnx/qnx6.1"
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ AC_SUBST(SECTION_FLAGS)
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+ AC_DEFINE(HAVE_COSF)
+ AC_DEFINE(HAVE_COSL)
+ AC_DEFINE(HAVE_COSHF)
+ AC_DEFINE(HAVE_COSHL)
+ AC_DEFINE(HAVE_LOGF)
+ AC_DEFINE(HAVE_LOGL)
+ AC_DEFINE(HAVE_LOG10F)
+ AC_DEFINE(HAVE_LOG10L)
+ AC_DEFINE(HAVE_SINF)
+ AC_DEFINE(HAVE_SINL)
+ AC_DEFINE(HAVE_SINHF)
+ AC_DEFINE(HAVE_SINHL)
+ ;;
+ *-solaris*)
+ #case "$target" in
+ # *-solaris2.5)
+ # os_include_dir="os/solaris/solaris2.5"
+ # ;;
+ # *-solaris2.6)
+ # os_include_dir="os/solaris/solaris2.6"
+ # ;;
+ # *-solaris2.7 | *-solaris2.8 | *-solaris2.9)
+ # os_include_dir="os/solaris/solaris2.7"
+ # ;;
+ #esac
+ AC_DEFINE(HAVE_STRTOF)
+ AC_DEFINE(HAVE_STRTOLD)
+ AC_DEFINE(HAVE_MMAP)
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_ISNAN)
+ AC_DEFINE(HAVE_ISNANF)
+ AC_DEFINE(HAVE_MODFF)
+ AC_DEFINE(HAVE_HYPOT)
+ ;;
+ *-windiss*)
+ #os_include_dir="os/windiss"
+ AC_DEFINE(HAVE_ACOSF)
+ AC_DEFINE(HAVE_ASINF)
+ AC_DEFINE(HAVE_ATAN2F)
+ AC_DEFINE(HAVE_ATANF)
+ AC_DEFINE(HAVE_CEILF)
+ AC_DEFINE(HAVE_COPYSIGN)
+ AC_DEFINE(HAVE_COPYSIGNF)
+ AC_DEFINE(HAVE_COSF)
+ AC_DEFINE(HAVE_COSHF)
+ AC_DEFINE(HAVE_EXPF)
+ AC_DEFINE(HAVE_FABSF)
+ AC_DEFINE(HAVE_FLOORF)
+ AC_DEFINE(HAVE_FMODF)
+ AC_DEFINE(HAVE_FREXPF)
+ AC_DEFINE(HAVE_LDEXPF)
+ AC_DEFINE(HAVE_LOG10F)
+ AC_DEFINE(HAVE_LOGF)
+ AC_DEFINE(HAVE_MODFF)
+ AC_DEFINE(HAVE_POWF)
+ AC_DEFINE(HAVE_SINF)
+ AC_DEFINE(HAVE_SINHF)
+ AC_DEFINE(HAVE_SQRTF)
+ AC_DEFINE(HAVE_TANF)
+ AC_DEFINE(HAVE_TANHF)
+ ;;
+ *)
+ AC_MSG_ERROR([No support for this host/target combination.])
+ ;;
+esac
+
diff --git a/libstdc++-v3/docs/doxygen/TODO b/libstdc++-v3/docs/doxygen/TODO
index 3c895907780..b32b2b1a0fe 100644
--- a/libstdc++-v3/docs/doxygen/TODO
+++ b/libstdc++-v3/docs/doxygen/TODO
@@ -22,12 +22,10 @@ c17 FINISHED (Nothing in Clause 17 "exists" in terms of code.)
c18 FINISHED, Note A
c19 Note A
c20 Note A
-c21 Untouched (top-level class note for basic_string done),
- Note B
+c21 Public functions basic_string done, Note B
c22 Untouched; see docs/html/22_locale/*
c23 See doxygroups.cc and Note B. Notes on what invalidates
- iterators need to be added. std::list-specific memfns need
- to be filled out.
+ iterators need to be added.
c24 stl_iterator.h (__normal_iterator, other small TODO bits)
stream iterators
c25 stl_algo.h (lots of stuff)
diff --git a/libstdc++-v3/docs/doxygen/doxygroups.cc b/libstdc++-v3/docs/doxygen/doxygroups.cc
index ccf72049598..a1f3b2809a5 100644
--- a/libstdc++-v3/docs/doxygen/doxygroups.cc
+++ b/libstdc++-v3/docs/doxygen/doxygroups.cc
@@ -202,6 +202,14 @@ relation. Rather, it partitions the range.
*/
// // // // // // // // // // // // // // // // // // // // // // // //
+/** @addtogroup setoperations Set operation algorithms
+These algorithms are common set operations performed on sequences that are
+already sorted.
+
+The number of comparisons will be linear.
+*/
+
+// // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // //
/* * @addtogroup groupname description of group
diff --git a/libstdc++-v3/docs/doxygen/guide.html b/libstdc++-v3/docs/doxygen/guide.html
new file mode 100644
index 00000000000..814dc1debea
--- /dev/null
+++ b/libstdc++-v3/docs/doxygen/guide.html
@@ -0,0 +1,107 @@
+<!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Build and Writing Guide for libstdc++-v3 Doxygen</title>
+ <link href="style.css" rel="stylesheet" type="text/css">
+</head>
+
+<body bgcolor="#ffffff">
+
+<h1>libstdc++-v3 Source Documentation</h1>
+
+<p>This file is docs/doxygen/guide.html in the libstdc++-v3 source tree. It
+ is not included in the generated pages (no real point to doing that).
+</p>
+
+<ul>
+ <li><a href="#creating">Creating the pages</a></li>
+ <li><a href="#writing">Writing the markup</a></li>
+</ul>
+
+<hr />
+
+<a name="creating"><h2>Creating the pages</h2></a>
+<p>The Makefile rules <code>'make doxygen'</code>,
+ <code>'make doxygen-maint'</code>, and <code>'make doxygen-man'</code>
+ in the libstdc++-v3 build directory generate the user-level HTML docs, the
+ maintainer-level HTML docs, and the man pages, respectively. Prerequisite
+ tools are Bash 2.x,
+ <a href="http://www.doxygen.org/">
+ <!-- snagged from the generated page -->
+ <img src="doxygen.png" alt="Doxygen" align=center border=0 width=110 height=53>
+ </a>, a working version of <code>g++</code> somewhere in the PATH, and
+ the <a href="http://www.gnu.org/software/coreutils/">GNU coreutils</a>.
+ (g++ is used to build a program which manipulates man pages. GNU versions
+ of find, xargs, and possibly sed and grep are used, just because the GNU
+ versions make things very easy.)
+</p>
+
+<p>Careful observers will see that the Makefile rules simply call a script
+ from the source tree, <code>run_doxygen</code>, which does the actual work
+ of running Doxygen and then (most importantly) massaging the output files.
+ If for some reason you prefer to not go through the Makefile, you can call
+ this script directly. (Start by passing <code>'--help'</code>.)
+</p>
+
+<p>If you wish to tweak the Doxygen settings, do so by editing
+ <code>docs/doxygen/user.cfg.in</code>. Notes to v3-hackers are written in
+ triple-# comments.
+</p>
+
+<a name="writing"><h2>Writing the markup</h2></a>
+<p>In general, libstdc++-v3 files should be formatted according to the GNU
+ C++ Coding Standard rules found in the file
+ <a href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/C++STYLE">C++STYLE</a>.
+ Before any doxygen-specific formatting tweaks are made, please try to make
+ sure that the initial formatting is sound.
+</p>
+
+<p>Adding Doxygen markup to a file (informally called "doxygenating") is very
+ simple. The Doxygen manual can be found
+ <a href="http://www.stack.nl/~dimitri/doxygen/download.html#latestman">here</a>.
+ We try to use a very-recent version of Doxygen.
+</p>
+
+<h3>Doxygen style guide</h3>
+<p>[incomplete and constantly evolving]</p>
+
+<p>For classes, use deque/vector/list and std::pair as examples. For
+ functions, see their member functions, and the free functions in
+ <code>stl_algobase.h</code>. Member functions of other container-like
+ types should read similarly to these member functions.
+</p>
+
+<p>These points accompany the first list in section 3.1 of the Doxygen manual:
+</p>
+<ol>
+ <li>Use the Javadoc style...</li>
+ <li>...not the Qt style. The intermediate *'s are preferred.</li>
+ <li>Use the triple-slash style only for one-line comments (the "brief" mode).
+ Very recent versions of Doxygen permit full-mode comments in triple-slash
+ blocks, but the formatting still comes out wonky.</li>
+ <li>This is disgusting. Don't do this.</li>
+</ol>
+
+<p>Use the @-style of commands, not the !-style. Please be careful about
+ whitespace in your markup comments. Most of the time it doesn't matter;
+ doxygen absorbs most whitespace, and both HTML and *roff are agnostic about
+ whitespace. However, in &lt;pre&gt; blocks and @code/@endcode sections,
+ spacing can have "interesting" effects.
+</p>
+
+<p>Use either kind of grouping, as appropriate. <code>doxygroups.cc</code>
+ exists for this purpose. See <code>stl_iterator.h</code> for a good
+ example of the "other" kind of grouping.
+</p>
+
+<p>Please use markup tags like @p and @a when referring to things such as the
+ names of function parameters. Use @e for emphasis when necessary. Use @c
+ to refer to other standard names. (Examples of all these abound in the
+ present code.)
+</p>
+
+</body>
+</html>
diff --git a/libstdc++-v3/docs/doxygen/mainpage.html b/libstdc++-v3/docs/doxygen/mainpage.html
index e0998fc0320..2ff090230c8 100644
--- a/libstdc++-v3/docs/doxygen/mainpage.html
+++ b/libstdc++-v3/docs/doxygen/mainpage.html
@@ -42,47 +42,6 @@
additional notes and additional classes/functions/etc.
</p>
-<p>Here are quick links to the pages which we seem to use the most; a full
- index is at the bottom:
- <!-- Keep this in sync with below. -->
- <ul>
- <li><a href="annotated.html">Compound List</a>
- <li><a href="classes.html">Alphabetical List</a>
- <li><a href="namespaces.html">Namespace List</a>
- <li><a href="files.html">File List</a>
- <li><a href="modules.html">Modules</a>
- </ul>
-</p>
-
-<h2> Generating this file </h2>
-<p>These HTML pages are automatically generated, along with the man pages.
- The Makefile rules <code> 'make doxygen' </code> and
- <code> 'make doxygen-maint' </code> in the libstdc++-v3 build directory
- generates these pages using a tool called, appropriately enough, Doxygen.
- To learn more about Doxygen, take a look at
- <a href="http://www.doxygen.org/">
- <!-- snagged from the generated page -->
- <img src="doxygen.png" alt="the Doxygen homepage"
- align=center border=0 width=110 height=53>
- </a>
-</p>
-
-<p>The libstdc++-v3 configuration files needed to generate doxygen output
- are located:
- <ul><li><code>docs/doxygen/user.cfg.in</code>
- <li><code>docs/doxygen/run_doxygen</code>
- </ul>
-</p>
-
-<h2> libstdc++-v3 doxygen style guide </h2>
-<p>In general, libstdc++-v3 files should be formatted according to the
- GNU C++ Coding Standard rules found in the file <a
-href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/C++STYLE">C++STYLE</a>.
- Before any doxygen-specific formatting tweaks are made, please try to
- make sure that the initial formatting is sound.
-</p>
-
-<h2> Full page index </h2>
<p>Here are entry points to all the pages generated by Doxygen:
<ul>
<li><a href="index.html">Main Page</a>
@@ -99,14 +58,31 @@ href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/C++STYLE">C++STYLE</a>.
</ul>
</p>
+<p>If you are using Doxygen for your own projects, you can use
+ <a href="libstdc++.tag">a tag file for the appropriate version</a> and
+ an entry such as
+ <blockquote>
+ TAGFILES = "libstdc++.tag =
+ http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen"
+ </blockquote>
+ Be sure to adjust the URL for the right version. If you download a
+ local copy of the source documentation for faster viewing, you can use
+ the doxytag/installdox programs (part of Doxygen) to adjust the links
+ for you.
+</p>
-<h2> License, Copyright, and Other Lawyerly Verbosity </h2>
+<h2>Generating the documentation</h2>
+<p>These HTML pages are automatically generated, along with the man pages.
+ See <code>docs/doxygen/guide.html</code> in the source tree for how to
+ create (and write) the pages.
+
+<h2>License, Copyright, and Other Lawyerly Verbosity</h2>
<p>The libstdc++-v3 documentation is released under
<a href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/license.html">
these terms</a>.
</p>
-<p>Part of the generated documentation involved comments
- and notes from SGI, who says we gotta say this:
+<p>Part of the generated documentation involved comments and notes from
+ SGI, who says we gotta say this:
<blockquote>
Permission to use, copy, modify, distribute and sell this software and its
documentation for any purpose is hereby granted without fee, provided
@@ -126,4 +102,3 @@ href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/C++STYLE">C++STYLE</a>.
</body>
</html>
-
diff --git a/libstdc++-v3/docs/doxygen/run_doxygen b/libstdc++-v3/docs/doxygen/run_doxygen
index 76b51110dff..a04c7e7bfbf 100644
--- a/libstdc++-v3/docs/doxygen/run_doxygen
+++ b/libstdc++-v3/docs/doxygen/run_doxygen
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Runs doxygen and massages the output files.
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -10,12 +10,11 @@
# We can check now that the version of doxygen is >= this variable.
DOXYVER=1.2.15
-doxygen=
find_doxygen() {
- v_required=`echo $DOXYVER | \
+ local -r v_required=`echo $DOXYVER | \
awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'`
- testing_version=
+ local testing_version doxygen maybedoxy v_found
# thank you goat book
set `IFS=:; X="$PATH:/usr/local/bin:/bin:/usr/bin"; echo $X`
for dir
@@ -36,6 +35,10 @@ find_doxygen() {
echo run_doxygen error: Could not find Doxygen $DOXYVER in path. 1>&2
print_usage
fi
+ # We need to use other tools from the same package/version.
+ echo :: Using Doxygen tools from ${dir}.
+ PATH=$dir:$PATH
+ hash -r
}
print_usage() {
@@ -92,9 +95,10 @@ parse_options() {
mode=unset
srcdir=unset
outdir=unset
-do_html=no
-do_man=no
+do_html=false
+do_man=false
enabled_sections=
+generate_tagfile=
DATEtext=`date '+%Y-%m-%d'`
parse_options $*
@@ -107,15 +111,20 @@ if test $srcdir = unset || test $outdir = unset || test $mode = unset; then
fi
case x"$mode" in
- xuser) do_html=yes
- LEVELtext='User'
- ;;
- xmaint) do_html=yes
- enabled_sections=maint
- LEVELtext='Maintainer'
- ;;
- xman) do_man=yes
- ;;
+ xuser)
+ do_html=true
+ LEVELtext='User'
+ generate_tagfile="$outdir/html_$mode/libstdc++.tag"
+ ;;
+ xmaint)
+ do_html=true
+ enabled_sections=maint
+ LEVELtext='Maintainer'
+ generate_tagfile="$outdir/html_$mode/libstdc++.tag"
+ ;;
+ xman)
+ do_man=true
+ ;;
*)
echo run_doxygen error: $mode is an invalid mode 1>&2
exit 1 ;;
@@ -126,10 +135,10 @@ mkdir -p $outdir
chmod u+w $outdir
# work around a stupid doxygen bug
-test $do_man = yes && {
+if $do_man; then
mkdir -p $outdir/man/man3/ext
chmod -R u+w $outdir/man/man3/ext
-}
+fi
(
set -e
@@ -140,17 +149,23 @@ test $do_man = yes && {
-e "s=@enabled_sections@=${enabled_sections}=" \
-e "s=@do_html@=${do_html}=" \
-e "s=@do_man@=${do_man}=" \
+ -e "s=@generate_tagfile@=${generate_tagfile}=" \
${srcdir}/docs/doxygen/user.cfg.in > ${outdir}/${mode}.cfg
echo :: NOTE that this may take some time...
- echo $doxygen ${outdir}/${mode}.cfg
- $doxygen ${outdir}/${mode}.cfg
+ echo doxygen ${outdir}/${mode}.cfg
+ doxygen ${outdir}/${mode}.cfg
echo :: Finished, exit code was $?
)
ret=$?
test $ret -ne 0 && exit $ret
-test $do_html = yes && {
+if $do_html; then
cd ${outdir}/html_${mode}
+
+ #doxytag -t libstdc++.tag . > /dev/null 2>&1
+ sed -e '/<path>/d' libstdc++.tag > TEMP
+ mv TEMP libstdc++.tag
+
sed -e "s=@LEVEL@=${LEVELtext}=" \
-e "s=@DATE@=${DATEtext}=" \
${srcdir}/docs/doxygen/mainpage.html > index.html
@@ -173,14 +188,14 @@ test $do_html = yes && {
echo ::
echo :: HTML pages begin with
echo :: ${outdir}/html_${mode}/index.html
-}
+fi
# Mess with the man pages. We don't need documentation of the internal
# headers, since the man pages for those contain nothing useful anyhow. The
# man pages for doxygen modules need to be renamed (or deleted). And the
# generated #include lines need to be changed from the internal names to the
# standard ones (e.g., "#include <stl_tempbuf.h>" -> "#include <memory>").
-test $do_man = yes && {
+if $do_man; then
echo ::
echo :: Fixing up the man pages...
cd $outdir/man/man3
@@ -189,7 +204,7 @@ cd $outdir/man/man3
rm -rf ext
# File names with embedded spaces (EVIL!) need to be....? renamed or removed?
-find . -name "* *" -print0 | xargs -0 rm # requires GNU tools
+find . -name "* *" -print0 | xargs -0r rm # requires GNU tools
# can leave SGIextensions.3 alone, it's an okay name
mv s20_3_1_base.3 Intro_functors.3
@@ -281,7 +296,7 @@ done
echo ::
echo :: Man pages in ${outdir}/man
-}
+fi
# all done
echo ::
diff --git a/libstdc++-v3/docs/doxygen/user.cfg.in b/libstdc++-v3/docs/doxygen/user.cfg.in
index f661f925ff2..e606060b3c0 100644
--- a/libstdc++-v3/docs/doxygen/user.cfg.in
+++ b/libstdc++-v3/docs/doxygen/user.cfg.in
@@ -869,13 +869,13 @@ INCLUDE_FILE_PATTERNS =
### The class_requires macros are kludges because SKIP_FUNCTION_MACROS is
### completely broken, and the presence of the macros confuses the parser.
-PREDEFINED = _GLIBCPP_DEPRECATED \
- _GLIBCPP_USE_WCHAR_T \
- _GLIBCPP_USE_LONG_LONG \
- __glibcpp_class_requires="//" \
- __glibcpp_class_requires2="//" \
- __glibcpp_class_requires3="//" \
- __glibcpp_class_requires4="//"
+PREDEFINED = _GLIBCXX_DEPRECATED \
+ _GLIBCXX_USE_WCHAR_T \
+ _GLIBCXX_USE_LONG_LONG \
+ __glibcxx_class_requires="//" \
+ __glibcxx_class_requires2="//" \
+ __glibcxx_class_requires3="//" \
+ __glibcxx_class_requires4="//"
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
@@ -902,7 +902,7 @@ TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
-GENERATE_TAGFILE =
+GENERATE_TAGFILE = @generate_tagfile@
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
diff --git a/libstdc++-v3/docs/html/17_intro/confdeps.dot b/libstdc++-v3/docs/html/17_intro/confdeps.dot
new file mode 100644
index 00000000000..a62d28ce9dd
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/confdeps.dot
@@ -0,0 +1,14 @@
+# Blatantly ripped out of the graphviz examples and modified. -pme
+digraph v3conf {
+ size="6,6";
+ node [color=lightblue2, style=filled];
+ "aclocal.m4" -> "acinclude.m4";
+ "configure" -> "aclocal.m4";
+ "configure" -> "configure.ac";
+ "configure" -> "crossconfig.m4";
+ "configure" -> "linkage.m4";
+ "[*/]Makefile.in" -> "Makefile.am";
+ "[*/]Makefile.in" -> "configure.ac";
+ "config.h.in" -> "acconfig.h";
+ "config.h.in" -> "configure.ac";
+}
diff --git a/libstdc++-v3/docs/html/17_intro/confdeps.png b/libstdc++-v3/docs/html/17_intro/confdeps.png
new file mode 100644
index 00000000000..5075aa869b1
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/confdeps.png
Binary files differ
diff --git a/libstdc++-v3/docs/html/17_intro/configury.html b/libstdc++-v3/docs/html/17_intro/configury.html
new file mode 100644
index 00000000000..8b44ff381dc
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/configury.html
@@ -0,0 +1,285 @@
+<?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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
+ <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" />
+</head>
+<body>
+
+<h1><code>&gt; open configury door</code></h1>
+<h1><code>&gt; look</code></h1>
+
+<p class="larger"><code>You are in a maze of twisty passages, all
+different.</code></p>
+<p class="larger"><code>It is dark. You are likely to be eaten by a
+Canadian cross build.</code></p>
+
+
+<hr />
+<h2>Notes on libstdc++-v3 configury</h2>
+<blockquote>
+No problem is insoluble in all conceivable circumstances.<br />
+-- The Cosmic AC,
+<a href="http://people.inf.elte.hu/simi/szovegek/Asimov1.html">The
+Last Question</a>, by Isaac Asimov
+</blockquote>
+<ul>
+ <li><a href="#deps">what comes from where</a></li>
+ <li><a href="#breakout">storing information in non-AC files, like
+ configure.host</a></li>
+ <li><a href="#general">general config notes</a></li>
+ <li><a href="#aclayout">acinclude.m4 layout</a></li>
+ <li><a href="#enable"><code>--enable</code> howto</a></li>
+</ul>
+
+<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>
+
+<p>Regenerate using a command sequence like
+ <code>"aclocal-1.7 &amp;&amp; autoconf2.50 &amp;&amp; autoheader2.50
+ &amp;&amp; automake-1.7"</code> as needed. And/or configure with
+ --enable-maintainer-mode.
+</p>
+
+
+<hr />
+<h3><a name="breakout">storing information in non-AC files, like
+ configure.host</a></h3>
+<p>Until that glorious day when we can use AC_TRY_LINK with a cross-compiler,
+ we have to hardcode the results of what the tests would have shown if
+ they could be run. So we have an inflexible mess like crossconfig.m4.
+</p>
+
+<p>Wouldn't it be nice if we could store that information in files like
+ configure.host, which can be modified without needing to regenerate
+ anything, and can even be tweaked without really knowing how the configury
+ all works? Perhaps break the pieces of crossconfig.m4 out and place them in
+ their appropriate config/{cpu,os} directory.
+</p>
+
+<p>Alas, writing macros like "<code>AC_DEFINE(HAVE_A_NICE_DAY)</code>" can
+ only be done inside files which are passed through autoconf. Files which
+ are pure shell script can be source'd at configure time. Files which
+ contain autoconf macros must be processed with autoconf. We could still
+ try breaking the pieces out into "config/*/cross.m4" bits, for instance,
+ but then we would need arguments to aclocal/autoconf to properly find
+ them all when generating configure. I would discourage that.
+</p>
+
+
+<hr />
+<h3><a name="general">general config notes</a></h3>
+<p>Lots of stuff got thrown out because the new autotools kindly generate
+ the same (or better) shell code for us.
+</p>
+
+<p>Most comments should use {octothorpes, shibboleths, hash marks, pound
+ signs, whatevers} rather than "dnl". Nearly all comments in configure.ac
+ should. Comments inside macros written in ancilliary .m4 files should.
+ About the only comments which should <em>not</em> use #, but use dnl
+ instead, are comments <em>outside</em> our own macros in the ancilliary
+ files. The difference is that # comments show up in <code>configure</code>
+ (which is most helpful for debugging), while dnl'd lines just vanish.
+ Since the macros in ancilliary files generate code which appears in odd
+ places, their "outside" comments tend to not be useful while reading
+ <code>configure</code>.
+</p>
+
+<p>Do not use any <code>$target*</code> variables, such as
+ <code>$target_alias</code>. The single exception is in configure.ac,
+ for automake+dejagnu's sake.
+</p>
+
+<p>
+</p>
+
+<hr />
+<h3><a name="aclayout">acinclude.m4 layout</a></h3>
+<p>The nice thing about acinclude.m4/aclocal.m4 is that macros aren't actually
+ performed/called/expanded/whatever here, just loaded. So we can arrange
+ the contents however we like. As of this writing, acinclude.m4 is arranged
+ as follows:
+</p>
+<pre>
+ GLIBCXX_CHECK_HOST
+ GLIBCXX_TOPREL_CONFIGURE
+ GLIBCXX_CONFIGURE
+</pre>
+<p>All the major variable "discovery" is done here. CXX, multilibs, etc.
+</p>
+<pre>
+ fragments included from elsewhere
+</pre>
+<p>Right now, "fragments" == "the math/linkage bits".
+</p>
+<pre>
+ GLIBCXX_CHECK_COMPILER_FEATURES
+ GLIBCXX_CHECK_LINKER_FEATURES
+ GLIBCXX_CHECK_WCHAR_T_SUPPORT
+</pre>
+<p>Next come extra compiler/linker feature tests. Wide character support
+ was placed here because I couldn't think of another place for it. It will
+ probably get broken apart like the math tests, because we're still disabling
+ wchars on systems which could actually support them.
+</p>
+<pre>
+ GLIBCXX_CHECK_SETRLIMIT_ancilliary
+ GLIBCXX_CHECK_SETRLIMIT
+ GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
+ GLIBCXX_CHECK_POLL
+ GLIBCXX_CHECK_WRITEV
+
+ GLIBCXX_CONFIGURE_TESTSUITE
+</pre>
+<p>Feature tests which only get used in one place. Here, things used only in
+ the testsuite, plus a couple bits used in the guts of I/O.
+</p>
+<pre>
+ GLIBCXX_EXPORT_INCLUDES
+ GLIBCXX_EXPORT_FLAGS
+ GLIBCXX_EXPORT_INSTALL_INFO
+</pre>
+<p>Installation variables, multilibs, working with the rest of the compiler.
+ Many of the critical variables used in the makefiles are set here.
+</p>
+<pre>
+ GLIBGCC_ENABLE
+ GLIBCXX_ENABLE_C99
+ GLIBCXX_ENABLE_CHEADERS
+ GLIBCXX_ENABLE_CLOCALE
+ GLIBCXX_ENABLE_CONCEPT_CHECKS
+ GLIBCXX_ENABLE_CSTDIO
+ GLIBCXX_ENABLE_CXX_FLAGS
+ 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
+ GLIBCXX_ENABLE_SYMVERS
+ GLIBCXX_ENABLE_THREADS
+</pre>
+<p>All the features which can be controlled with enable/disable configure
+ options. Note how they're alphabetized now? Keep them like that. :-)
+</p>
+<pre>
+ AC_LC_MESSAGES
+ libtool bits
+</pre>
+<p>Things which we don't seem to use directly, but just has to be present
+ otherwise stuff magically goes wonky.
+</p>
+
+
+<hr />
+<h3><a name="enable"><code>--enable</code> howto</a></h3>
+<p>All the GLIBCXX_ENABLE_FOO macros use a common helper, GLIBCXX_ENABLE.
+ (You don't have to use it, but it's easy.) The helper does two things
+ for us:
+</p>
+
+<ol>
+ <li>Builds the call to the AC_ARG_ENABLE macro, with --help text properly
+ quoted and aligned. (Death to changequote!)</li>
+ <li>Checks the result against a list of allowed possibilities, and signals
+ a fatal error if there's no match. This means that the rest of the
+ GLIBCXX_ENABLE_FOO macro doesn't need to test for strange arguments,
+ nor do we need to protect against empty/whitespace strings with the
+ <code>"x$foo" = "xbar"</code> idiom.</li>
+</ol>
+
+<p>Doing these things correctly takes some extra autoconf/autom4te code,
+ which made our macros nearly illegible. So all the ugliness is factored
+ out into this one helper macro.
+</p>
+
+<p>Many of the macros take an argument, passed from when they are expanded
+ in configure.ac. The argument controls the default value of the
+ enable/disable switch. Previously, the arguments themselves had defaults.
+ Now they don't, because that's extra complexity with zero gain for us.
+</p>
+
+<p>There are three "overloaded signatures". When reading the descriptions
+ below, keep in mind that the brackets are autoconf's quotation characters,
+ and that they will be stripped. Examples of just about everything occur
+ in acinclude.m4, if you want to look.
+</p>
+
+<pre>
+ GLIBCXX_ENABLE (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
+ GLIBCXX_ENABLE (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
+ GLIBCXX_ENABLE (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
+</pre>
+
+<ul>
+ <li><p>FEATURE is the string that follows --enable. The results of the test
+ (such as it is) will be in the variable $enable_FEATURE, where FEATURE
+ has been squashed. Example: <code>[extra-foo]</code>, controlled by the
+ --enable-extra-foo option and stored in $enable_extra_foo.</p></li>
+ <li><p>DEFAULT is the value to store in $enable_FEATURE if the user does not
+ pass --enable/--disable. It should be one of the permitted values
+ passed later. Examples: <code>[yes]</code>, or <code>[bar]</code>, or
+ <code>[$1]</code> (which passes the argument given to the
+ GLIBCXX_ENABLE_FOO macro as the default).</p>
+ <p>For cases where we need to probe for particular models
+ of things, it is useful to have an undocumented "auto" value here (see
+ GLIBCXX_ENABLE_CLOCALE for an example).</p></li>
+ <li><p>HELP-ARG is any text to append to the option string itself in the
+ --help output. Examples: <code>[]</code> (i.e., an empty string,
+ which appends nothing),
+ <code>[=BAR]</code>, which produces
+ <code>--enable-extra-foo=BAR</code>, and
+ <code>[@&lt;:@=BAR@:&gt;@]</code>, which produces
+ <code>--enable-extra-foo[=BAR]</code>. See the difference? See what
+ it implies to the user?</p>
+ <p>If you're wondering what that line noise in the last example was,
+ that's how you embed autoconf special characters in output text.
+ They're called
+<a href="http://www.gnu.org/manual/autoconf/html_node/autoconf_95.html#SEC95"><em>quadrigraphs</em></a>
+ and you should use them whenever necessary.</p></li>
+ <li><p>HELP-STRING is what you think it is. Do not include the "default"
+ text like we used to do; it will be done for you by GLIBCXX_ENABLE.
+ By convention, these are not full English sentences.
+ Example: [turn on extra foo]</p></li>
+</ul>
+
+<p>With no other arguments, only the standard autoconf patterns are
+ allowed: "<code>--{enable,disable}-foo[={yes,no}]</code>" The
+ $enable_FEATURE variable is guaranteed to equal either "yes" or "no"
+ after the macro. If the user tries to pass something else, an
+ explanatory error message will be given, and configure will halt.
+</p>
+
+<p>The second signature takes a fifth argument,
+ "<code>[permit <em>a</em>|<em>b</em>|<em>c</em>|<em>...</em>]</code>"
+ This allows <em>a</em> or <em>b</em> or ... after the equals sign in the
+ option, and $enable_FEATURE is guaranteed to equal one of them after the
+ macro. Note that if you want to allow plain --enable/--disable with no
+ "=whatever", you must include "yes" and "no" in the list of permitted
+ values. Also note that whatever you passed as DEFAULT must be in the list.
+ If the user tries to pass something not on the list, a semi-explanatory
+ error message will be given, and configure will halt.
+ Example: <code>[permit generic|gnu|ieee_1003.1-2001|yes|no|auto]</code>
+</p>
+
+<p>The third signature takes a fifth argument. It is arbitrary shell code
+ to execute if the user actually passes the enable/disable option. (If
+ the user does not, the default is used. Duh.) No argument checking at
+ all is done in this signature. See GLIBCXX_ENABLE_CXX_FLAGS for an
+ example of handling, and an error message.
+</p>
+
+<hr />
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/17_intro/headers_cc.txt b/libstdc++-v3/docs/html/17_intro/headers_cc.txt
index eb930f1ff00..667f2fe235b 100644
--- a/libstdc++-v3/docs/html/17_intro/headers_cc.txt
+++ b/libstdc++-v3/docs/html/17_intro/headers_cc.txt
@@ -75,7 +75,7 @@
// "C" headers that might not work if wchar_t support is disabled.
#include <bits/c++config.h>
-#if _GLIBCPP_USE_WCHAR_T
+#if _GLIBCXX_USE_WCHAR_T
#include <cwchar>
#include <cwctype>
#endif
diff --git a/libstdc++-v3/docs/html/17_intro/howto.html b/libstdc++-v3/docs/html/17_intro/howto.html
index fc43d0f5892..d1fc584679d 100644
--- a/libstdc++-v3/docs/html/17_intro/howto.html
+++ b/libstdc++-v3/docs/html/17_intro/howto.html
@@ -291,7 +291,8 @@
<a href="../configopts.html">the configuration step</a>, with the
various --enable/--disable choices being translated to #define/#undef).
</p>
- <p>All library macros begin with <code>_GLIBCPP_</code>. The fact that
+ <p>All library macros begin with <code>_GLIBCPP_</code> in earlier
+ versions, and <code>_GLIBCXX_</code> in later versions. The fact that
these symbols start with a leading underscore should give you a clue
that (by default) they aren't meant to be changed by the user. :-)
</p>
@@ -310,9 +311,10 @@
The default state of the symbol is listed. &quot;Configurable&quot;
(or &quot;Not configurable&quot;) means that the symbol is initially
chosen (or not) based on --enable/--disable options at configure time.
+ For 3.1 through 3.3, the prefixes are <code>_GLIBCPP_</code>.
</p>
<dl>
- <dt><code>_GLIBCPP_DEPRECATED</code></dt>
+ <dt><code>_GLIBCXX_DEPRECATED</code></dt>
<dd>Undefined by default. Not configurable. Turning this on enables
older ARM-style iostreams code, and other anachronisms. This may be
useful in updating old C++ programs which no longer meet the
@@ -331,7 +333,7 @@
you might try undefining this macro.
</dd>
-->
- <dt><code>_GLIBCPP_CONCEPT_CHECKS</code></dt>
+ <dt><code>_GLIBCXX_CONCEPT_CHECKS</code></dt>
<dd>Undefined by default. Configurable. When defined, performs
compile-time checking on certain template instantiations to detect
violations of the requirements of the standard. This is described
diff --git a/libstdc++-v3/docs/html/17_intro/porting.html b/libstdc++-v3/docs/html/17_intro/porting.html
index fb4682c8c2c..b0275592d30 100644
--- a/libstdc++-v3/docs/html/17_intro/porting.html
+++ b/libstdc++-v3/docs/html/17_intro/porting.html
@@ -3,8 +3,7 @@
<title>Porting libstdc++-v3</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Porting libstdc++-v3">
-<meta name="generator" content="makeinfo 4.3">
-<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
+<meta name="generator" content="makeinfo 4.6">
<!--
Copyright &copy; 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -25,20 +24,29 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
<p>You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+--></style>
</head>
<body>
<h1 class="settitle">Porting libstdc++-v3</h1>
<div class="node">
<p><hr>
-Node:<a name="Top">Top</a>,
-Next:<a rel="next" accesskey="n" href="#Operating%20system">Operating system</a>,
-Up:<a rel="up" accesskey="u" href="#dir">(dir)</a>
+Node:&nbsp;<a name="Top">Top</a>,
+Next:&nbsp;<a rel="next" accesskey="n" href="#Operating%20system">Operating system</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<br>
</div>
<h2 class="unnumbered">Porting libstdc++-v3</h2>
- <p>This document explains how to port libstdc++-v3 (the GNU C++ library) to
+<p>This document explains how to port libstdc++-v3 (the GNU C++ library) to
a new target.
<p>In order to make the GNU C++ library (libstdc++-v3) work with a new
@@ -57,7 +65,7 @@ works. It is difficult to test the C++ compiler without a working
library, but you should at least try some minimal test cases.
<p>(Note that what we think of as a "target," the library refers to as
-a "host." The comment at the top of <code>configure.in</code> explains why.)
+a "host." The comment at the top of <code>configure.ac</code> explains why.)
<p>Here are the primary steps required to port the library:
@@ -73,16 +81,16 @@ a "host." The comment at the top of <code>configure.in</code> explains why.)
<div class="node">
<p><hr>
-Node:<a name="Operating%20system">Operating system</a>,
-Next:<a rel="next" accesskey="n" href="#CPU">CPU</a>,
-Previous:<a rel="previous" accesskey="p" href="#Top">Top</a>,
-Up:<a rel="up" accesskey="u" href="#Top">Top</a>
+Node:&nbsp;<a name="Operating%20system">Operating system</a>,
+Next:&nbsp;<a rel="next" accesskey="n" href="#CPU">CPU</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<h2 class="chapter">Operating system</h2>
- <p>If you are porting to a new operating system (as opposed to a new chip
+<p>If you are porting to a new operating system (as opposed to a new chip
using an existing operating system), you will need to create a new
directory in the <code>config/os</code> hierarchy. For example, the IRIX
configuration files are all in <code>config/os/irix</code>. There is no set
@@ -191,16 +199,16 @@ starting point.
<div class="node">
<p><hr>
-Node:<a name="CPU">CPU</a>,
-Next:<a rel="next" accesskey="n" href="#Character%20types">Character types</a>,
-Previous:<a rel="previous" accesskey="p" href="#Operating%20system">Operating system</a>,
-Up:<a rel="up" accesskey="u" href="#Top">Top</a>
+Node:&nbsp;<a name="CPU">CPU</a>,
+Next:&nbsp;<a rel="next" accesskey="n" href="#Character%20types">Character types</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Operating%20system">Operating system</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<h2 class="chapter">CPU</h2>
- <p>If you are porting to a new chip (as opposed to a new operating system
+<p>If you are porting to a new chip (as opposed to a new operating system
running on an existing chip), you will need to create a new directory in the
<code>config/cpu</code> hierarchy. Much like the <a href="#Operating%20system">Operating system</a> setup,
there are no strict rules on how to organize the CPU configuration
@@ -224,16 +232,16 @@ appropriate for your chip.
<div class="node">
<p><hr>
-Node:<a name="Character%20types">Character types</a>,
-Next:<a rel="next" accesskey="n" href="#Thread%20safety">Thread safety</a>,
-Previous:<a rel="previous" accesskey="p" href="#CPU">CPU</a>,
-Up:<a rel="up" accesskey="u" href="#Top">Top</a>
+Node:&nbsp;<a name="Character%20types">Character types</a>,
+Next:&nbsp;<a rel="next" accesskey="n" href="#Thread%20safety">Thread safety</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#CPU">CPU</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<h2 class="chapter">Character types</h2>
- <p>The library requires that you provide three header files to implement
+<p>The library requires that you provide three header files to implement
character classification, analogous to that provided by the C libraries
<code>&lt;ctype.h&gt;</code> header. You can model these on the files provided in
<code>config/os/generic</code>. However, these files will almost
@@ -421,16 +429,16 @@ from <code>__low</code> up until <code>__high</code> into the vector given by
<div class="node">
<p><hr>
-Node:<a name="Thread%20safety">Thread safety</a>,
-Next:<a rel="next" accesskey="n" href="#Numeric%20limits">Numeric limits</a>,
-Previous:<a rel="previous" accesskey="p" href="#Character%20types">Character types</a>,
-Up:<a rel="up" accesskey="u" href="#Top">Top</a>
+Node:&nbsp;<a name="Thread%20safety">Thread safety</a>,
+Next:&nbsp;<a rel="next" accesskey="n" href="#Numeric%20limits">Numeric limits</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Character%20types">Character types</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<h2 class="chapter">Thread safety</h2>
- <p>The C++ library string functionality requires a couple of atomic
+<p>The C++ library string functionality requires a couple of atomic
operations to provide thread-safety. If you don't take any special
action, the library will use stub versions of these functions that are
not thread-safe. They will work fine, unless your applications are
@@ -498,16 +506,16 @@ must be equivalent to those provided here, but using atomic operations:
<div class="node">
<p><hr>
-Node:<a name="Numeric%20limits">Numeric limits</a>,
-Next:<a rel="next" accesskey="n" href="#Libtool">Libtool</a>,
-Previous:<a rel="previous" accesskey="p" href="#Thread%20safety">Thread safety</a>,
-Up:<a rel="up" accesskey="u" href="#Top">Top</a>
+Node:&nbsp;<a name="Numeric%20limits">Numeric limits</a>,
+Next:&nbsp;<a rel="next" accesskey="n" href="#Libtool">Libtool</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Thread%20safety">Thread safety</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<h2 class="chapter">Numeric limits</h2>
- <p>The C++ library requires information about the fundamental data types,
+<p>The C++ library requires information about the fundamental data types,
such as the minimum and maximum representable values of each type.
You can define each of these values individually, but it is usually
easiest just to indicate how many bits are used in each of the data
@@ -523,16 +531,16 @@ your CPU configuration directory (see <a href="#CPU">CPU</a>).
<div class="node">
<p><hr>
-Node:<a name="Libtool">Libtool</a>,
-Next:<a rel="next" accesskey="n" href="#GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>,
-Previous:<a rel="previous" accesskey="p" href="#Numeric%20limits">Numeric limits</a>,
-Up:<a rel="up" accesskey="u" href="#Top">Top</a>
+Node:&nbsp;<a name="Libtool">Libtool</a>,
+Next:&nbsp;<a rel="next" accesskey="n" href="#GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Numeric%20limits">Numeric limits</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<h2 class="chapter">Libtool</h2>
- <p>The C++ library is compiled, archived and linked with libtool.
+<p>The C++ library is compiled, archived and linked with libtool.
Explaining the full workings of libtool is beyond the scope of this
document, but there are a few, particular bits that are necessary for
porting.
@@ -561,9 +569,9 @@ operating system.
<div class="node">
<p><hr>
-Node:<a name="GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>,
-Previous:<a rel="previous" accesskey="p" href="#Libtool">Libtool</a>,
-Up:<a rel="up" accesskey="u" href="#Top">Top</a>
+Node:&nbsp;<a name="GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Libtool">Libtool</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
@@ -947,7 +955,7 @@ as a draft) by the Free Software Foundation.
<h3 class="unnumberedsec">ADDENDUM: How to use this License for your documents</h3>
- <p>To use this License in a document you have written, include a copy of
+<p>To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
diff --git a/libstdc++-v3/docs/html/17_intro/porting.texi b/libstdc++-v3/docs/html/17_intro/porting.texi
index ed4042f932d..988c2c2203a 100644
--- a/libstdc++-v3/docs/html/17_intro/porting.texi
+++ b/libstdc++-v3/docs/html/17_intro/porting.texi
@@ -75,7 +75,7 @@ works. It is difficult to test the C++ compiler without a working
library, but you should at least try some minimal test cases.
(Note that what we think of as a ``target,'' the library refers to as
-a ``host.'' The comment at the top of @file{configure.in} explains why.)
+a ``host.'' The comment at the top of @file{configure.ac} explains why.)
Here are the primary steps required to port the library:
diff --git a/libstdc++-v3/docs/html/22_locale/howto.html b/libstdc++-v3/docs/html/22_locale/howto.html
index d6a340c9e54..0000c277d09 100644
--- a/libstdc++-v3/docs/html/22_locale/howto.html
+++ b/libstdc++-v3/docs/html/22_locale/howto.html
@@ -187,9 +187,8 @@
int main ()
{
std::string s("Some Kind Of Initial Input Goes Here");
- std::locale loc_c("C");
- ToUpper up(loc_c);
- ToLower down(loc_c);
+ ToUpper up(std::locale::classic());
+ ToLower down(std::locale::classic());
// Change everything into upper case.
std::transform(s.begin(), s.end(), s.begin(), up);
diff --git a/libstdc++-v3/docs/html/27_io/howto.html b/libstdc++-v3/docs/html/27_io/howto.html
index 4a0b6a927fb..35568c453ff 100644
--- a/libstdc++-v3/docs/html/27_io/howto.html
+++ b/libstdc++-v3/docs/html/27_io/howto.html
@@ -185,9 +185,10 @@
<code>setbuf()</code>-ish functions; the classes derived from
<code>streambuf</code> each define behavior that &quot;makes
sense&quot; for that class: an argument of (0,0) turns off buffering
- for <code>filebuf</code> but has undefined behavior for its sibling
- <code>stringbuf</code>, and specifying anything other than (0,0) has
- varying effects. Other user-defined class derived from streambuf can
+ for <code>filebuf</code> but does nothing at all for its siblings
+ <code>stringbuf</code> and <code>strstreambuf</code>, and specifying
+ anything other than (0,0) has varying effects.
+ User-defined classes derived from <code>streambuf</code> can
do whatever they want. (For <code>filebuf</code> and arguments for
<code>(p,s)</code> other than zeros, libstdc++ does what you'd expect:
the first <code>s</code> bytes of <code>p</code> are used as a buffer,
diff --git a/libstdc++-v3/docs/html/Makefile b/libstdc++-v3/docs/html/Makefile
index c252ca2631b..a0b335aaa2d 100644
--- a/libstdc++-v3/docs/html/Makefile
+++ b/libstdc++-v3/docs/html/Makefile
@@ -5,6 +5,7 @@ INC=../../../gcc/doc/include
all: documentation.html \
faq/index.txt \
+ 17_intro/confdeps.png \
17_intro/porting.html \
17_intro/porting-howto.html
@@ -34,4 +35,7 @@ faq/index.txt: faq/index.html
17_intro/porting-howto.html: 17_intro/porting-howto.xml
xltproc -o $@ /usr/share/xml/docbook/xsl-stylesheets-1.48-2/html/docbook.xsl $<
+17_intro/confdeps.png: 17_intro/confdeps.dot
+ dot -Tpng -o $@ $<
+
# vim:noet ts=4
diff --git a/libstdc++-v3/docs/html/abi.txt b/libstdc++-v3/docs/html/abi.txt
index 73cb46c9c09..430108885f9 100644
--- a/libstdc++-v3/docs/html/abi.txt
+++ b/libstdc++-v3/docs/html/abi.txt
@@ -108,8 +108,8 @@ I. What is an ABI? What's covered? What's not?
gcc-3.2.x: 102
- - Incremental bumping of a library pre-defined macro,
- __GLIBCPP__. This macro is defined as the date the library was
+ - Incremental bumping of a library pre-defined macro, __GLIBCPP__ or
+ __GLIBCXX__. This macro is defined as the date the library was
released, in compressed ISO date format, as an unsigned long.
This macro is defined in the file "c++config" in the
@@ -130,7 +130,7 @@ I. What is an ABI? What's covered? What's not?
- Incremental bumping of a library pre-defined macro,
_GLIBCPP_VERSION. This macro is defined as the released version of
the library, as a string literal. This is only implemented in
- gcc-3.1.0 releases and higher.
+ gcc-3.1.0 releases and higher, and changed to _GLIBCXX_VERSION in 3.4.
This macro is defined in the file "c++config" in the
"libstdc++-v3/include/bits" directory and is generated
@@ -200,7 +200,7 @@ I. What is an ABI? What's covered? What's not?
--enable-symvers.
In particular, libstdc++-v3/acinclude.m4 has a macro called
- GLIBCPP_ENABLE_SYMVERS that defaults to yes (or the argument passed
+ GLIBCXX_ENABLE_SYMVERS that defaults to yes (or the argument passed
in via --enable-symvers=foo). At that point, the macro attempts to
make sure that all the requirement for symbol versioning are in
place. For more information, please consult acinclude.m4.
diff --git a/libstdc++-v3/docs/html/configopts.html b/libstdc++-v3/docs/html/configopts.html
index 2f16b7a6b2c..2cfec4475c4 100644
--- a/libstdc++-v3/docs/html/configopts.html
+++ b/libstdc++-v3/docs/html/configopts.html
@@ -146,7 +146,7 @@ options</a></h1>
<dt><code>--enable-libstdcxx-debug </code></dt>
<dd><p>Build separate debug libraries in addition to what is normally built.
- By default, the debug libraries are compiled with
+ By default, the debug libraries are compiled with
<code> CXXFLAGS='-g3 -O0'</code>
, are installed in <code>${libdir}/debug</code>, and have the
same names and versioning information as the non-debug
@@ -273,6 +273,14 @@ options</a></h1>
testsuite.
</p>
</dd>
+
+ <dt><code>--disable-hosted-libstdcxx </code></dt>
+ <dd><p>By default, a complete <em>hosted</em> C++ library is built. The
+ C++ Standard also describes a <em>freestanding</em> environment,
+ in which only a minimal set of headers are provided. This option
+ builds such an environment.
+ </p>
+ </dd>
</dl>
<p>Return <a href="#top">to the top of the page</a> or
<a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
diff --git a/libstdc++-v3/docs/html/debug.html b/libstdc++-v3/docs/html/debug.html
index 0ca332c7346..dcd035ca04f 100644
--- a/libstdc++-v3/docs/html/debug.html
+++ b/libstdc++-v3/docs/html/debug.html
@@ -105,7 +105,7 @@
there are different kinds of allocation schemes that can be used by
<code> std::allocator </code>. For implementation details, see this
<a href="ext/howto.html#3"> document</a> and look specifically for
- <code>GLIBCPP_FORCE_NEW</code>.
+ <code>GLIBCXX_FORCE_NEW</code>.
</p>
<p>In a nutshell, the default allocator used by <code>
@@ -120,7 +120,7 @@
C++ tools: the first that can do this is valgrind 1.0.4, but later
versions should work at least as well. Second of all, use a
completely unoptimized build to avoid confusing valgrind. Third,
- use GLIBCPP_FORCE_NEW to keep extraneous pool allocation noise from
+ use GLIBCXX_FORCE_NEW to keep extraneous pool allocation noise from
cluttering debug information.
</p>
diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html
index 3289619625c..1c190a66613 100644
--- a/libstdc++-v3/docs/html/ext/howto.html
+++ b/libstdc++-v3/docs/html/ext/howto.html
@@ -79,12 +79,12 @@
</p>
<p>Each of the associative containers map, multimap, set, and multiset
have a counterpart which uses a
- <a href="http://www.sgi.com/Technology/STL/HashFunction.html">hashing
+ <a href="http://www.sgi.com/tech/stl/HashFunction.html">hashing
function</a> to do the arranging, instead of a strict weak ordering
function. The classes take as one of their template parameters a
function object that will return the hash value; by default, an
instantiation of
- <a href="http://www.sgi.com/Technology/STL/hash.html">hash</a>.
+ <a href="http://www.sgi.com/tech/stl/hash.html">hash</a>.
You should specialize this functor for your class, or define your own,
before trying to use one of the hashing classes.
</p>
@@ -285,20 +285,21 @@
SGI STL days. We have removed it in gcc 3.3. See next section
for the new way to get the same effect.
</p>
- <h3>Globally disabling memory caching:<code> GLIBCPP_FORCE_NEW</code></h3>
+ <h3>Globally disabling memory caching:<code> GLIBCXX_FORCE_NEW</code></h3>
<p>Starting with gcc 3.3, if you want to globally disable memory
caching within the library for the default allocator (i.e.
the one you get for all library objects when you do not specify
- which one to use), merely set GLIBCPP_FORCE_NEW (at this time,
+ which one to use), merely set GLIBCXX_FORCE_NEW (at this time,
with any value) into your environment before running the
program. You will obtain a similar effect without having to
recompile your entire program and the entire library (the new
operator in gcc is a light wrapper around malloc). If your
- program crashes with GLIBCPP_FORCE_NEW in the environment,
+ program crashes with GLIBCXX_FORCE_NEW in the environment,
it likely means that you linked against objects built against
the older library. Code to support this extension is fully
- compatible with 3.2 code if GLIBCPP_FORCE_NEW is not in the
- environment.
+ compatible with 3.2 code if GLIBCXX_FORCE_NEW is not in the
+ environment. Prior to GCC 3.4, this variable was spelt
+ GLIBCPP_FORCE_NEW.
</p>
<h3>Writing your own allocators</h3>
<p>Depending on your application (a specific program, a generic library,
@@ -414,7 +415,7 @@
<p>
If a DR is not listed here, we may simply not have gotten to it yet;
feel free to submit a patch. Search the include/bits and src
- directories for appearances of _GLIBCPP_RESOLVE_LIB_DEFECTS for
+ directories for appearances of _GLIBCXX_RESOLVE_LIB_DEFECTS for
examples of style. Note that we usually do not make changes to the code
until an issue has reached <a href="lwg-active.html#DR">DR</a> status.
</p>
diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html
index 336c93c54e8..056cfe37b9d 100644
--- a/libstdc++-v3/docs/html/faq/index.html
+++ b/libstdc++-v3/docs/html/faq/index.html
@@ -868,7 +868,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
<hr />
<h2><a name="5_3">5.3 What about the STL from SGI?</a></h2>
- <p>The <a href="http://www.sgi.com/Technology/STL/">STL from SGI</a>,
+ <p>The <a href="http://www.sgi.com/tech/stl/">STL from SGI</a>,
version 3.3, was the most recent merge of the STL codebase. The
code in libstdc++ contains many fixes and changes, and it is
very likely that the SGI code is no longer under active
@@ -924,6 +924,11 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
<p>This is a bit cleaner than defining typedefs for all the
instantiations you might need.
</p>
+ <p><strong>Note:</strong> 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.
+ </p>
<p>Extensions to the library have
<a href="../ext/howto.html">their own page</a>.
</p>
diff --git a/libstdc++-v3/docs/html/faq/index.txt b/libstdc++-v3/docs/html/faq/index.txt
index 257b27dfbf5..3c8bf0397c8 100644
--- a/libstdc++-v3/docs/html/faq/index.txt
+++ b/libstdc++-v3/docs/html/faq/index.txt
@@ -757,6 +757,10 @@ 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.
_________________________________________________________________
@@ -981,7 +985,7 @@ References
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/Technology/STL/
+ 100. http://www.sgi.com/tech/stl/
101. ../ext/howto.html
102. ../17_intro/howto.html#3
103. ../23_containers/howto.html#3
diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html
index 038291b8acc..6c983710b86 100644
--- a/libstdc++-v3/docs/html/install.html
+++ b/libstdc++-v3/docs/html/install.html
@@ -57,10 +57,10 @@
<p>In addition, if you plan to modify the makefiles or regenerate the
configure scripts you'll need recent versions of the GNU Autotools:
- autoconf (version 2.50 or later),
- automake (version 1.4 or later), <!-- special version? -->
- and libtool (multilanguage, version 1.4 or later), <!-- really? -->
- in order to rebuild the files.
+ autoconf (version 2.57 or later) and
+ automake (version 1.7.6 or later),
+ in order to rebuild the files. Libtool is built from special sources
+ in the GCC source tree.
These tools are all required to be installed in the same location
(most linux distributions install these tools by default, so no
worries as long as the versions are correct).
diff --git a/libstdc++-v3/docs/html/test.html b/libstdc++-v3/docs/html/test.html
index 4d2dc536dc3..8c570f3fa3b 100644
--- a/libstdc++-v3/docs/html/test.html
+++ b/libstdc++-v3/docs/html/test.html
@@ -35,6 +35,7 @@
<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="#future">Future</a></li>
+ <li><a href="#internals">DejaGNU internals</a></li>
</ul>
<hr />
@@ -79,13 +80,13 @@ thread Tests for threads.
<p>
Some directories don't have test files, but instead contain
- auxiliary information:
+ auxiliary information (<a href="#internals">more information</a>):
</p>
<pre>
config Files for the dejagnu test harness.
lib Files for the dejagnu test harness.
-libstdc++-v3.dg Files for the dejagnu test harness.
+libstdc++* Files for the dejagnu test harness.
data Sample text files for testing input and output.
</pre>
@@ -218,7 +219,7 @@ cat 27_io/objects/char/3_xin.in | a.out
Used to check correctness of symbol versioning, visibility of
exported symbols, and compatibility on symbols in the shared
library, for hosts that support this feature. More information
- can be found in the ABI documentation <a href="abi.txt"> here</a>
+ can be found in the ABI documentation <a href="abi.txt"> here</a>
</p>
</li>
<li>
@@ -260,7 +261,7 @@ cat 27_io/objects/char/3_xin.in | a.out
<li>time_counter</li>
<li>resource_counter</li>
<li>report_performance</li>
- </ul>
+ </ul>
<p></p>
</li>
<li>
@@ -451,7 +452,7 @@ Example 4: Testing for compilation errors on line 41
<em>testsuite_wchar_t </em>
<p> This file indicates that the host system can run the wchar_t
tests, and corresponds to the macro definition <code>
- _GLIBCPP_USE_WCHAR_T</code> in the file c++config.h.
+ _GLIBCXX_USE_WCHAR_T</code> in the file c++config.h.
</p>
</li>
</ul>
@@ -585,6 +586,45 @@ Currently plans for supported keywords include:
</dd>
</dl>
+<hr />
+<h2><a name="internals">DejaGNU internals</a></h2>
+
+<p>This is information for those looking at making changes to the testsuite
+structure, and/or needing to trace dejagnu's actions with --verbose. This
+will not be useful to people who are "merely" adding new tests to the existing
+structure.
+</p>
+
+<p>The first key point when working with dejagnu is the idea of a "tool".
+Files, directories, and functions are all implicitly used when they are
+named after the tool in use. Here, the tool will always be "libstdc++".
+</p>
+
+<p>The <code>lib</code> subdir contains support routines. The
+<code>lib/libstdc++.exp</code> file ("support library") is loaded
+automagically, and must explicitly load the others. For example, files can
+be copied from the core compiler's support directory into <code>lib</code>.
+</p>
+
+<p>Some routines in <code>lib/libstdc++.exp</code> are callbacks, some are
+our own. Callbacks must be prefixed with the name of the tool. To easily
+distinguish the others, by convention our own routines are named "v3-*".
+</p>
+
+<p>The next key point when working with dejagnu is "test files". Any
+directory whose name starts with the tool name will be searched for test files.
+(We have only one.) In those directories, any <code>.exp</code> file is
+considered a test file, and will be run in turn. Our main test file is called
+<code>normal.exp</code>; it runs all the tests in testsuite_files using the
+callbacks loaded from the support library.
+</p>
+
+<p>The <code>config</code> directory is searched for any particular "target
+board" information unique to this library. This is currently unused and sets
+only default variables.
+</p>
+
+
<!-- ####################################################### -->
<hr />
diff --git a/libstdc++-v3/fragment.am b/libstdc++-v3/fragment.am
new file mode 100644
index 00000000000..d0d03a28f7b
--- /dev/null
+++ b/libstdc++-v3/fragment.am
@@ -0,0 +1,26 @@
+
+## This is used in all Makefile.am's except for libmath's. Set defaults here.
+
+MAINT_CHARSET = latin1
+
+mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
+
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
+
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
+CONFIG_CXXFLAGS = \
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
+WARN_CXXFLAGS = \
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
+
+
+
+
+## vim:ft=automake
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 29b3077b812..3a8bf72ade9 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -21,19 +21,7 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-AUTOMAKE_OPTIONS = 1.3 cygnus
-MAINT_CHARSET = latin1
-
-mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
-
-# Cross compiler and multilib support.
-CXX = @glibcxx_CXX@
-glibcxx_srcdir=@glibcxx_srcdir@
-glibcxx_builddir=@glibcxx_builddir@
-
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-INCLUDES = -nostdinc++ $(GLIBCXX_INCLUDES) $(LIBSUPCXX_INCLUDES)
+include $(top_srcdir)/fragment.am
# Standard C++ includes.
std_srcdir = ${glibcxx_srcdir}/include/std
@@ -68,7 +56,7 @@ std_headers = \
${std_srcdir}/std_utility.h \
${std_srcdir}/std_valarray.h \
${std_srcdir}/std_vector.h
-# Renamed at build time.
+# Renamed at build time.
std_headers_rename = \
algorithm \
bitset \
@@ -233,11 +221,11 @@ ext_headers = \
${ext_srcdir}/ropeimpl.h \
${ext_srcdir}/slist \
${ext_srcdir}/hash_fun.h \
- ${ext_srcdir}/hashtable.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_srcdir = $(C_INCLUDE_DIR)
c_base_builddir = .
c_base_headers = \
${c_base_srcdir}/std_cassert.h \
@@ -257,7 +245,7 @@ c_base_headers = \
${c_base_srcdir}/std_cstring.h \
${c_base_srcdir}/std_ctime.h \
${c_base_srcdir}/std_cwchar.h \
- ${c_base_srcdir}/std_cwctype.h
+ ${c_base_srcdir}/std_cwctype.h
c_base_headers_rename = \
cassert \
cctype \
@@ -276,7 +264,7 @@ c_base_headers_rename = \
cstring \
ctime \
cwchar \
- cwctype
+ cwctype
# "C" compatibility headers.
c_compatibility_srcdir = ${glibcxx_srcdir}/include/c_compatibility
@@ -299,36 +287,36 @@ c_compatibility_headers = \
${c_compatibility_srcdir}/string.h \
${c_compatibility_srcdir}/time.h \
${c_compatibility_srcdir}/wchar.h \
- ${c_compatibility_srcdir}/wctype.h
+ ${c_compatibility_srcdir}/wctype.h
# Some of the different "C" header models need extra files.
# Some "C" header schemes require the "C" compatibility headers.
# For --enable-cheaders=c_std
if GLIBCXX_C_HEADERS_C_STD
-c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
+c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
else
-c_base_headers_extra =
+c_base_headers_extra =
endif
if GLIBCXX_C_HEADERS_COMPATIBILITY
c_compatibility_headers_extra = ${c_compatibility_headers}
else
-c_compatibility_headers_extra =
+c_compatibility_headers_extra =
endif
-host_srcdir = ${glibcxx_srcdir}/@OS_INC_SRCDIR@
+host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
host_builddir = ./${host_alias}/bits
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
${host_srcdir}/ctype_noninline.h \
${host_srcdir}/os_defines.h \
- ${glibcxx_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
- ${glibcxx_srcdir}/@FPOS_INC_SRCDIR@/fpos.h
+ ${glibcxx_srcdir}/$(ATOMICITY_INC_SRCDIR)/atomicity.h \
+ ${glibcxx_srcdir}/$(FPOS_INC_SRCDIR)/fpos.h
# Non-installed host_header files.
host_headers_noinst = \
- ${glibcxx_srcdir}/@CLOCALE_INTERNAL_H@
+ ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H)
# These host_headers_extra files are all built with ad hoc naming rules.
host_headers_extra = \
@@ -354,15 +342,15 @@ if GLIBCXX_BUILD_PCH
pch_build = ${pch_input}
pch_install = install-pch
else
-pch_build =
-pch_install =
+pch_build =
+pch_install =
endif
# 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-host
# List of all files that are created by explicit building, editing, or
# catenation.
@@ -372,7 +360,7 @@ allcreated = \
${pch_build}
# Here are the rules for building the headers
-all-local: ${allstamped} ${allcreated}
+all-local: ${allstamped} ${allcreated}
# This rule is slightly different, in that we must change the name of the
# local file from std_foo.h to foo.
@@ -383,34 +371,34 @@ stamp-std: ${std_headers}
if [ ! -f stamp-std ]; then \
(cd ${std_builddir} && for h in $?; do \
official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- @LN_S@ $$h ./$${official_name} || true ;\
+ $(LN_S) $$h ./$${official_name} || true ;\
done) ;\
- echo `date` > stamp-std ;\
- fi
+ fi ;\
+ $(STAMP) stamp-std
stamp-bits: ${bits_headers}
@if [ ! -d "${bits_builddir}" ]; then \
mkdir -p ${bits_builddir} ;\
fi ;\
if [ ! -f stamp-bits ]; then \
- (cd ${bits_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-bits ;\
- fi
+ (cd ${bits_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-bits
-stamp-c_base: ${c_base_headers} ${c_base_headers_extra}
+stamp-c_base: stamp-bits ${c_base_headers} ${c_base_headers_extra}
@if [ ! -d "${c_base_builddir}" ]; then \
mkdir -p ${c_base_builddir} ;\
fi ;\
if [ ! -f stamp-c_base ]; then \
(cd ${c_base_builddir} && for h in ${c_base_headers}; do \
official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- @LN_S@ $$h ./$${official_name} || true ;\
+ $(LN_S) $$h ./$${official_name} || true ;\
done) ;\
if [ ! -z "${c_base_headers_extra}" ]; then \
- (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra} . || true) ;\
+ (cd ${bits_builddir} && $(LN_S) ${c_base_headers_extra} . || true) ;\
fi ;\
- echo `date` > stamp-c_base ;\
- fi
+ fi ;\
+ $(STAMP) stamp-c_base
stamp-c_compatibility: ${c_compatibility_headers_extra}
@if [ ! -d "${c_compatibility_builddir}" ]; then \
@@ -418,53 +406,53 @@ stamp-c_compatibility: ${c_compatibility_headers_extra}
fi ;\
if [ ! -f stamp-c_compatibility ]; then \
if [ ! -z "${c_compatibility_headers_extra}" ]; then \
- (cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
+ (cd ${c_compatibility_builddir} && $(LN_S) $? . || true) ;\
fi ;\
- echo `date` > stamp-c_compatibility ;\
- fi
+ fi ;\
+ $(STAMP) stamp-c_compatibility
stamp-backward: ${backward_headers}
@if [ ! -d "${backward_builddir}" ]; then \
mkdir -p ${backward_builddir} ;\
fi ;\
if [ ! -f stamp-backward ]; then \
- (cd ${backward_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-backward ;\
- fi
+ (cd ${backward_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-backward
stamp-ext: ${ext_headers}
@if [ ! -d "${ext_builddir}" ]; then \
mkdir -p ${ext_builddir} ;\
fi ;\
if [ ! -f stamp-ext ]; then \
- (cd ${ext_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-ext ;\
- fi
+ (cd ${ext_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-ext
stamp-${host_alias}:
@if [ ! -d ${host_builddir} ]; then \
mkdir -p ${host_builddir} ;\
- echo `date` > stamp-${host_alias} ;\
- fi
+ fi ;\
+ $(STAMP) stamp-${host_alias}
# Host includes static.
# XXX Missing dependency info for {host_headers_extra}
stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias}
@if [ ! -f stamp-host ]; then \
(cd ${host_builddir} ;\
- @LN_S@ ${host_headers} . || true ;\
- @LN_S@ ${glibcxx_srcdir}/@BASIC_FILE_H@ basic_file.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CSTDIO_H@ c++io.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CTIME_H@ time_members.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\
- echo `date` > stamp-host ; \
- fi
+ $(LN_S) ${host_headers} . || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_H) c++locale.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H) . || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_H) messages_members.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CTIME_H) time_members.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_H) codecvt_specializations.h || true);\
+ fi ;\
+ $(STAMP) stamp-host
# Host includes dynamic.
-${host_builddir}/c++config.h: ${CONFIG_HEADER} \
+${host_builddir}/c++config.h: ${top_builddir}/config.h \
${glibcxx_srcdir}/include/bits/c++config \
stamp-${host_alias}
@cat ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
@@ -476,7 +464,6 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
echo "#endif // _CXXCONFIG_" >>$@
# Host includes for threads
-glibcxx_thread_h = @glibcxx_thread_h@
uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
${host_builddir}/gthr.h: ${toplevel_srcdir}/gcc/gthr.h stamp-${host_alias}
@@ -511,8 +498,8 @@ ${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
if [ ! -d "${pch_output_builddir}" ]; then \
mkdir -p ${pch_output_builddir}; \
fi; \
- $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
- $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g;
+ $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
+ $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g;
# For robustness sake (in light of junk files or in-source
# configuration), copy from the build or source tree to the install
@@ -522,10 +509,30 @@ ${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
# `$(mkinstalldirs)' instead of `mkdir -p'. In particular,
# host_headers_extra are taken out of the build tree staging area;
# the rest are taken from the original source tree.
-gxx_include_dir = @gxx_include_dir@
+if GLIBCXX_HOSTED
install-data-local: install-headers ${pch_install}
+else
+install-data-local: install-freestanding-headers
+endif
+
+# This is a subset of the full install-headers rule. We only need <cstddef>,
+# <limits>, <cstdlib>, <cstdarg>, <new>, <typeinfo>, <exception>, and any
+# files which they include (and which we provide). The last three headers
+# are installed by libsupc++, so only the first four and the sub-includes
+# are copied here.
+install-freestanding-headers:
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
+ for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
+ for file in cstddef cstdlib cstdarg; do \
+ $(INSTALL_DATA) ${c_base_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
+# The real deal.
install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${bits_builddir}
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 879bf1694f6..35c724e6a27 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/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,62 +12,40 @@
# 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 = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
@@ -74,6 +54,7 @@ CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
@@ -82,37 +63,76 @@ CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
+CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FPOS_H = @FPOS_H@
FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
-GLIBCXX_IS_CROSS_COMPILING = @GLIBCXX_IS_CROSS_COMPILING@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
+GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
+GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
+GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
+GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
+GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBMATHOBJS = @LIBMATHOBJS@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
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@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
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@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
@@ -120,37 +140,84 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+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_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
check_msgfmt = @check_msgfmt@
+datadir = @datadir@
enable_shared = @enable_shared@
enable_static = @enable_static@
-glibcxx_CXX = @glibcxx_CXX@
+exec_prefix = @exec_prefix@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
-glibcxx_basedir = @glibcxx_basedir@
+glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
+glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
-ifGNUmake = @ifGNUmake@
+gxx_include_dir = @gxx_include_dir@
+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@
libtool_VERSION = @libtool_VERSION@
-port_specific_symbol_file = @port_specific_symbol_file@
+localstatedir = @localstatedir@
+mandir = @mandir@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
toplevel_srcdir = @toplevel_srcdir@
-AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
-# Cross compiler and multilib support.
-CXX = @glibcxx_CXX@
-glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_builddir = @glibcxx_builddir@
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-INCLUDES = -nostdinc++ $(GLIBCXX_INCLUDES) $(LIBSUPCXX_INCLUDES)
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
+CONFIG_CXXFLAGS = \
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
+
+WARN_CXXFLAGS = \
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
# Standard C++ includes.
std_srcdir = ${glibcxx_srcdir}/include/std
@@ -186,7 +253,7 @@ std_headers = \
${std_srcdir}/std_valarray.h \
${std_srcdir}/std_vector.h
-# Renamed at build time.
+# Renamed at build time.
std_headers_rename = \
algorithm \
bitset \
@@ -354,11 +421,11 @@ ext_headers = \
${ext_srcdir}/ropeimpl.h \
${ext_srcdir}/slist \
${ext_srcdir}/hash_fun.h \
- ${ext_srcdir}/hashtable.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_srcdir = $(C_INCLUDE_DIR)
c_base_builddir = .
c_base_headers = \
${c_base_srcdir}/std_cassert.h \
@@ -378,7 +445,7 @@ c_base_headers = \
${c_base_srcdir}/std_cstring.h \
${c_base_srcdir}/std_ctime.h \
${c_base_srcdir}/std_cwchar.h \
- ${c_base_srcdir}/std_cwctype.h
+ ${c_base_srcdir}/std_cwctype.h
c_base_headers_rename = \
cassert \
@@ -398,7 +465,7 @@ c_base_headers_rename = \
cstring \
ctime \
cwchar \
- cwctype
+ cwctype
# "C" compatibility headers.
@@ -422,27 +489,32 @@ c_compatibility_headers = \
${c_compatibility_srcdir}/string.h \
${c_compatibility_srcdir}/time.h \
${c_compatibility_srcdir}/wchar.h \
- ${c_compatibility_srcdir}/wctype.h
+ ${c_compatibility_srcdir}/wctype.h
-@GLIBCXX_C_HEADERS_C_STD_TRUE@c_base_headers_extra = @GLIBCXX_C_HEADERS_C_STD_TRUE@${c_base_srcdir}/cmath.tcc
@GLIBCXX_C_HEADERS_C_STD_FALSE@c_base_headers_extra =
-@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@${c_compatibility_headers}
+
+# 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_COMPATIBILITY_FALSE@c_compatibility_headers_extra =
-host_srcdir = ${glibcxx_srcdir}/@OS_INC_SRCDIR@
+@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_headers}
+
+host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
host_builddir = ./${host_alias}/bits
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
${host_srcdir}/ctype_noninline.h \
${host_srcdir}/os_defines.h \
- ${glibcxx_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
- ${glibcxx_srcdir}/@FPOS_INC_SRCDIR@/fpos.h
+ ${glibcxx_srcdir}/$(ATOMICITY_INC_SRCDIR)/atomicity.h \
+ ${glibcxx_srcdir}/$(FPOS_INC_SRCDIR)/fpos.h
# Non-installed host_header files.
host_headers_noinst = \
- ${glibcxx_srcdir}/@CLOCALE_INTERNAL_H@
+ ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H)
# These host_headers_extra files are all built with ad hoc naming rules.
@@ -467,16 +539,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_TRUE@pch_build = @GLIBCXX_BUILD_PCH_TRUE@${pch_input}
+@GLIBCXX_BUILD_PCH_TRUE@pch_build = ${pch_input}
@GLIBCXX_BUILD_PCH_FALSE@pch_build =
-@GLIBCXX_BUILD_PCH_TRUE@pch_install = @GLIBCXX_BUILD_PCH_TRUE@install-pch
+@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-host
# List of all files that are created by explicit building, editing, or
@@ -488,86 +560,94 @@ allcreated = \
# Host includes for threads
-glibcxx_thread_h = @glibcxx_thread_h@
uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
-# For robustness sake (in light of junk files or in-source
-# configuration), copy from the build or source tree to the install
-# tree using only the human-maintained file lists and directory
-# components. Yes, with minor differences, this is sheer duplication
-# of the staging rules above using $(INSTALL_DATA) instead of LN_S and
-# `$(mkinstalldirs)' instead of `mkdir -p'. In particular,
-# host_headers_extra are taken out of the build tree staging area;
-# the rest are taken from the original source tree.
-gxx_include_dir = @gxx_include_dir@
-
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = ${pch_input} ${pch_output_builddir}/*
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-DIST_COMMON = Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+subdir = include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+DIST_SOURCES =
+DIST_COMMON = $(top_srcdir)/fragment.am Makefile.am Makefile.in
+all: all-am
-TAR = gtar
-GZIP_ENV = --best
-all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus include/Makefile
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/fragment.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+mostlyclean-libtool:
+ -rm -f *.lo
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
+ctags: CTAGS
+CTAGS:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-subdir = include
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ $(mkinstalldirs) $(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 \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ 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 \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am:
+check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
-install-exec-am:
-install-exec: install-exec-am
+all-am: Makefile all-local
-install-data-am: install-data-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
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: uninstall-am
-all-am: Makefile all-local
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-
+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:
@@ -575,39 +655,67 @@ clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-generic
+ @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-libtool mostlyclean-am
-clean-am: clean-generic mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-generic distclean-libtool
-distclean-am: distclean-generic clean-am
- -rm -f libtool
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
-.PHONY: tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-info-am install-info \
-install-exec-am install-exec install-data-local install-data-am \
-install-data install-am install uninstall-am uninstall all-local \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+ clean-libtool distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am info info-am install install-am install-data \
+ install-data-am install-data-local install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
# Here are the rules for building the headers
-all-local: ${allstamped} ${allcreated}
+all-local: ${allstamped} ${allcreated}
# This rule is slightly different, in that we must change the name of the
# local file from std_foo.h to foo.
@@ -618,34 +726,34 @@ stamp-std: ${std_headers}
if [ ! -f stamp-std ]; then \
(cd ${std_builddir} && for h in $?; do \
official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- @LN_S@ $$h ./$${official_name} || true ;\
+ $(LN_S) $$h ./$${official_name} || true ;\
done) ;\
- echo `date` > stamp-std ;\
- fi
+ fi ;\
+ $(STAMP) stamp-std
stamp-bits: ${bits_headers}
@if [ ! -d "${bits_builddir}" ]; then \
mkdir -p ${bits_builddir} ;\
fi ;\
if [ ! -f stamp-bits ]; then \
- (cd ${bits_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-bits ;\
- fi
+ (cd ${bits_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-bits
-stamp-c_base: ${c_base_headers} ${c_base_headers_extra}
+stamp-c_base: stamp-bits ${c_base_headers} ${c_base_headers_extra}
@if [ ! -d "${c_base_builddir}" ]; then \
mkdir -p ${c_base_builddir} ;\
fi ;\
if [ ! -f stamp-c_base ]; then \
(cd ${c_base_builddir} && for h in ${c_base_headers}; do \
official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- @LN_S@ $$h ./$${official_name} || true ;\
+ $(LN_S) $$h ./$${official_name} || true ;\
done) ;\
if [ ! -z "${c_base_headers_extra}" ]; then \
- (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra} . || true) ;\
+ (cd ${bits_builddir} && $(LN_S) ${c_base_headers_extra} . || true) ;\
fi ;\
- echo `date` > stamp-c_base ;\
- fi
+ fi ;\
+ $(STAMP) stamp-c_base
stamp-c_compatibility: ${c_compatibility_headers_extra}
@if [ ! -d "${c_compatibility_builddir}" ]; then \
@@ -653,53 +761,53 @@ stamp-c_compatibility: ${c_compatibility_headers_extra}
fi ;\
if [ ! -f stamp-c_compatibility ]; then \
if [ ! -z "${c_compatibility_headers_extra}" ]; then \
- (cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
+ (cd ${c_compatibility_builddir} && $(LN_S) $? . || true) ;\
fi ;\
- echo `date` > stamp-c_compatibility ;\
- fi
+ fi ;\
+ $(STAMP) stamp-c_compatibility
stamp-backward: ${backward_headers}
@if [ ! -d "${backward_builddir}" ]; then \
mkdir -p ${backward_builddir} ;\
fi ;\
if [ ! -f stamp-backward ]; then \
- (cd ${backward_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-backward ;\
- fi
+ (cd ${backward_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-backward
stamp-ext: ${ext_headers}
@if [ ! -d "${ext_builddir}" ]; then \
mkdir -p ${ext_builddir} ;\
fi ;\
if [ ! -f stamp-ext ]; then \
- (cd ${ext_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-ext ;\
- fi
+ (cd ${ext_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-ext
stamp-${host_alias}:
@if [ ! -d ${host_builddir} ]; then \
mkdir -p ${host_builddir} ;\
- echo `date` > stamp-${host_alias} ;\
- fi
+ fi ;\
+ $(STAMP) stamp-${host_alias}
# Host includes static.
# XXX Missing dependency info for {host_headers_extra}
stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias}
@if [ ! -f stamp-host ]; then \
(cd ${host_builddir} ;\
- @LN_S@ ${host_headers} . || true ;\
- @LN_S@ ${glibcxx_srcdir}/@BASIC_FILE_H@ basic_file.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CSTDIO_H@ c++io.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CTIME_H@ time_members.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\
- echo `date` > stamp-host ; \
- fi
+ $(LN_S) ${host_headers} . || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_H) c++locale.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H) . || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_H) messages_members.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CTIME_H) time_members.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_H) codecvt_specializations.h || true);\
+ fi ;\
+ $(STAMP) stamp-host
# Host includes dynamic.
-${host_builddir}/c++config.h: ${CONFIG_HEADER} \
+${host_builddir}/c++config.h: ${top_builddir}/config.h \
${glibcxx_srcdir}/include/bits/c++config \
stamp-${host_alias}
@cat ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
@@ -742,11 +850,38 @@ ${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
if [ ! -d "${pch_output_builddir}" ]; then \
mkdir -p ${pch_output_builddir}; \
fi; \
- $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
- $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g;
+ $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
+ $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g;
+
+# For robustness sake (in light of junk files or in-source
+# configuration), copy from the build or source tree to the install
+# tree using only the human-maintained file lists and directory
+# components. Yes, with minor differences, this is sheer duplication
+# of the staging rules above using $(INSTALL_DATA) instead of LN_S and
+# `$(mkinstalldirs)' instead of `mkdir -p'. In particular,
+# host_headers_extra are taken out of the build tree staging area;
+# the rest are taken from the original source tree.
+
+@GLIBCXX_HOSTED_TRUE@install-data-local: install-headers ${pch_install}
+@GLIBCXX_HOSTED_FALSE@install-data-local: install-freestanding-headers
-install-data-local: install-headers ${pch_install}
+# This is a subset of the full install-headers rule. We only need <cstddef>,
+# <limits>, <cstdlib>, <cstdarg>, <new>, <typeinfo>, <exception>, and any
+# files which they include (and which we provide). The last three headers
+# are installed by libsupc++, so only the first four and the sub-includes
+# are copied here.
+install-freestanding-headers:
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
+ for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
+ for file in cstddef cstdlib cstdarg; do \
+ $(INSTALL_DATA) ${c_base_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
+# The real deal.
install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${bits_builddir}
@@ -788,7 +923,6 @@ install-pch:
.PRECIOUS: $(std_headers_rename) $(c_base_headers_rename)
$(std_headers_rename): ; @:
$(c_base_headers_rename): ; @:
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h
index f2e468e6abf..7e5b6055ef6 100644
--- a/libstdc++-v3/include/bits/basic_ios.h
+++ b/libstdc++-v3/include/bits/basic_ios.h
@@ -76,10 +76,10 @@ namespace std
* @endif
*/
typedef ctype<_CharT> __ctype_type;
- typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
- typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
- typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
- typedef num_get<_CharT, __istreambuf_iter> __numget_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
//@}
// Data members:
@@ -92,9 +92,9 @@ namespace std
// Cached use_facet<ctype>, which is based on the current locale info.
const __ctype_type* _M_ctype;
// For ostream.
- const __numput_type* _M_num_put;
+ const __num_put_type* _M_num_put;
// For istream.
- const __numget_type* _M_num_get;
+ const __num_get_type* _M_num_get;
public:
//@{
@@ -319,7 +319,15 @@ namespace std
rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
/**
- * @doctodo
+ * @brief Copies fields of __rhs into this.
+ * @param __rhs The source values for the copies.
+ * @return Reference to this object.
+ *
+ * All fields of __rhs are copied into this object except that rdbuf()
+ * and rdstate() remain unchanged. All values in the pword and iword
+ * arrays are copied. Before copying, each callback is invoked with
+ * erase_event. After copying, each (new) callback is invoked with
+ * copyfmt_event. The final step is to copy exceptions().
*/
basic_ios&
copyfmt(const basic_ios& __rhs);
@@ -441,8 +449,7 @@ namespace std
};
} // namespace std
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
#include <bits/basic_ios.tcc>
#endif
diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc
index d0a8ff3cc43..9df5f4880e3 100644
--- a/libstdc++-v3/include/bits/basic_ios.tcc
+++ b/libstdc++-v3/include/bits/basic_ios.tcc
@@ -167,10 +167,10 @@ namespace std
{
if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
_M_ctype = &use_facet<__ctype_type>(__loc);
- if (__builtin_expect(has_facet<__numput_type>(__loc), true))
- _M_num_put = &use_facet<__numput_type>(__loc);
- if (__builtin_expect(has_facet<__numget_type>(__loc), true))
- _M_num_get = &use_facet<__numget_type>(__loc);
+ if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
+ _M_num_put = &use_facet<__num_put_type>(__loc);
+ if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
+ _M_num_get = &use_facet<__num_get_type>(__loc);
}
// Inhibit implicit instantiations for required instantiations,
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 8a9d5625030..44df752ae56 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -248,6 +248,8 @@ namespace std
// Data Members (public):
// NB: This is an unsigned type, and thus represents the maximum
// size that the allocator can hold.
+ /// @var
+ /// Value returned by various member functions when they fail.
static const size_type npos = static_cast<size_type>(-1);
private:
@@ -339,41 +341,109 @@ namespace std
// NB: We overload ctors in some cases instead of using default
// arguments, per 17.4.4.4 para. 2 item 2.
+ /**
+ * @brief Default constructor creates an empty string.
+ */
inline
basic_string();
+ /**
+ * @brief Construct an empty string using allocator a.
+ */
explicit
basic_string(const _Alloc& __a);
// NB: per LWG issue 42, semantics different from IS:
+ /**
+ * @brief Construct string with copy of value of @a str.
+ * @param str Source string.
+ */
basic_string(const basic_string& __str);
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param str Source string.
+ * @param pos Index of first character to copy from.
+ * @param n Number of characters to copy (default remainder).
+ */
basic_string(const basic_string& __str, size_type __pos,
size_type __n = npos);
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param str Source string.
+ * @param pos Index of first character to copy from.
+ * @param n Number of characters to copy.
+ * @param a Allocator to use.
+ */
basic_string(const basic_string& __str, size_type __pos,
size_type __n, const _Alloc& __a);
+ /**
+ * @brief Construct string as copy of a C substring.
+ * @param s Source C string.
+ * @param n Number of characters to copy.
+ * @param a Allocator to use (default is default allocator).
+ */
basic_string(const _CharT* __s, size_type __n,
const _Alloc& __a = _Alloc());
+ /**
+ * @brief Construct string as copy of a C string.
+ * @param s Source C string.
+ * @param a Allocator to use (default is default allocator).
+ */
basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
+ /**
+ * @brief Construct string as multiple characters.
+ * @param n Number of characters.
+ * @param c Character to use.
+ * @param a Allocator to use (default is default allocator).
+ */
basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
+ /**
+ * @brief Construct string as copy of a range.
+ * @param beg Start of range.
+ * @param end End of range.
+ * @param a Allocator to use (default is default allocator).
+ */
template<class _InputIterator>
basic_string(_InputIterator __beg, _InputIterator __end,
const _Alloc& __a = _Alloc());
+ /**
+ * @brief Destroy the string instance.
+ */
~basic_string()
{ _M_rep()->_M_dispose(this->get_allocator()); }
+ /**
+ * @brief Assign the value of @a str to this string.
+ * @param str Source string.
+ */
basic_string&
operator=(const basic_string& __str) { return this->assign(__str); }
+ /**
+ * @brief Copy contents of @a s into this string.
+ * @param s Source null-terminated string.
+ */
basic_string&
operator=(const _CharT* __s) { return this->assign(__s); }
+ /**
+ * @brief Set value to string of length 1.
+ * @param c Source character.
+ *
+ * Assigning to a character makes this string length 1 and
+ * (*this)[0] == @a c.
+ */
basic_string&
operator=(_CharT __c) { return this->assign(1, __c); }
// Iterators:
+ /**
+ * Returns a read/write iterator that points to the first character in
+ * the %string. Unshares the string.
+ */
iterator
begin()
{
@@ -381,10 +451,18 @@ namespace std
return iterator(_M_data());
}
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * character in the %string.
+ */
const_iterator
begin() const
{ return const_iterator(_M_data()); }
+ /**
+ * Returns a read/write iterator that points one past the last
+ * character in the %string. Unshares the string.
+ */
iterator
end()
{
@@ -392,60 +470,156 @@ namespace std
return iterator(_M_data() + this->size());
}
+ /**
+ * Returns a read-only (constant) iterator that points one past the
+ * last character in the %string.
+ */
const_iterator
end() const
{ return const_iterator(_M_data() + this->size()); }
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * character in the %string. Iteration is done in reverse element
+ * order. Unshares the string.
+ */
reverse_iterator
rbegin()
{ return reverse_iterator(this->end()); }
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last character in the %string. Iteration is done in
+ * reverse element order.
+ */
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(this->end()); }
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first character in the %string. Iteration is done in reverse
+ * element order. Unshares the string.
+ */
reverse_iterator
rend()
{ return reverse_iterator(this->begin()); }
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first character in the %string. Iteration
+ * is done in reverse element order.
+ */
const_reverse_iterator
rend() const
{ return const_reverse_iterator(this->begin()); }
public:
// Capacity:
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
size_type
size() const { return _M_rep()->_M_length; }
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
size_type
length() const { return _M_rep()->_M_length; }
+ /// Returns the size() of the largest possible %string.
size_type
max_size() const { return _Rep::_S_max_size; }
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param n Number of characters the %string should contain.
+ * @param c Character to fill any new elements.
+ *
+ * This function will %resize the %string to the specified
+ * number of characters. If the number is smaller than the
+ * %string's current size the %string is truncated, otherwise
+ * the %string is extended and new elements are set to @a c.
+ */
void
resize(size_type __n, _CharT __c);
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param n Number of characters the %string should contain.
+ *
+ * This function will resize the %string to the specified length. If
+ * the new size is smaller than the %string's current size the %string
+ * is truncated, otherwise the %string is extended and new characters
+ * are default-constructed. For basic types such as char, this means
+ * setting them to 0.
+ */
void
resize(size_type __n) { this->resize(__n, _CharT()); }
+ /**
+ * Returns the total number of characters that the %string can hold
+ * before needing to allocate more memory.
+ */
size_type
capacity() const { return _M_rep()->_M_capacity; }
+ /**
+ * @brief Attempt to preallocate enough memory for specified number of
+ * characters.
+ * @param n Number of characters required.
+ * @throw std::length_error If @a n exceeds @c max_size().
+ *
+ * This function attempts to reserve enough memory for the
+ * %string to hold the specified number of characters. If the
+ * number requested is more than max_size(), length_error is
+ * thrown.
+ *
+ * The advantage of this function is that if optimal code is a
+ * necessity and the user can determine the string length that will be
+ * required, the user can reserve the memory in %advance, and thus
+ * prevent a possible reallocation of memory and copying of %string
+ * data.
+ */
void
reserve(size_type __res_arg = 0);
+ /**
+ * Erases the string, making it empty.
+ */
void
clear() { _M_mutate(0, this->size(), 0); }
+ /**
+ * Returns true if the %string is empty. Equivalent to *this == "".
+ */
bool
empty() const { return this->size() == 0; }
// Element access:
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read-only (constant) reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
const_reference
operator[] (size_type __pos) const
{ return _M_data()[__pos]; }
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read/write reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().) Unshares the string.
+ */
reference
operator[](size_type __pos)
{
@@ -453,6 +627,16 @@ namespace std
return _M_data()[__pos];
}
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read-only (const) reference to the character.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is
+ * first checked that it is in the range of the string. The function
+ * throws out_of_range if the check fails.
+ */
const_reference
at(size_type __n) const
{
@@ -461,6 +645,17 @@ namespace std
return _M_data()[__n];
}
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read/write reference to the character.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is
+ * first checked that it is in the range of the string. The function
+ * throws out_of_range if the check fails. Success results in
+ * unsharing the string.
+ */
reference
at(size_type __n)
{
@@ -471,85 +666,300 @@ namespace std
}
// Modifiers:
+ /**
+ * @brief Append a string to this string.
+ * @param str The string to append.
+ * @return Reference to this string.
+ */
basic_string&
operator+=(const basic_string& __str) { return this->append(__str); }
+ /**
+ * @brief Append a C string.
+ * @param s The C string to append.
+ * @return Reference to this string.
+ */
basic_string&
operator+=(const _CharT* __s) { return this->append(__s); }
+ /**
+ * @brief Append a character.
+ * @param s The character to append.
+ * @return Reference to this string.
+ */
basic_string&
operator+=(_CharT __c) { return this->append(size_type(1), __c); }
+ /**
+ * @brief Append a string to this string.
+ * @param str The string to append.
+ * @return Reference to this string.
+ */
basic_string&
append(const basic_string& __str);
+ /**
+ * @brief Append a substring.
+ * @param str The string to append.
+ * @param pos Index of the first character of str to append.
+ * @param n The number of characters to append.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function appends @a n characters from @a str starting at @a pos
+ * to this string. If @a n is is larger than the number of available
+ * characters in @a str, the remainder of @a str is appended.
+ */
basic_string&
append(const basic_string& __str, size_type __pos, size_type __n);
+ /**
+ * @brief Append a C substring.
+ * @param s The C string to append.
+ * @param n The number of characters to append.
+ * @return Reference to this string.
+ */
basic_string&
append(const _CharT* __s, size_type __n);
+ /**
+ * @brief Append a C string.
+ * @param s The C string to append.
+ * @return Reference to this string.
+ */
basic_string&
append(const _CharT* __s)
{ return this->append(__s, traits_type::length(__s)); }
+ /**
+ * @brief Append multiple characters.
+ * @param n The number of characters to append.
+ * @param c The character to use.
+ * @return Reference to this string.
+ *
+ * Appends n copies of c to this string.
+ */
basic_string&
append(size_type __n, _CharT __c);
+ /**
+ * @brief Append a range of characters.
+ * @param first Iterator referencing the first character to append.
+ * @param last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Appends characters in the range [first,last) to this string.
+ */
template<class _InputIterator>
basic_string&
append(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_iend(), _M_iend(), __first, __last); }
+ /**
+ * @brief Append a single character.
+ * @param c Character to append.
+ */
void
push_back(_CharT __c)
{ this->replace(_M_iend(), _M_iend(), 1, __c); }
+ /**
+ * @brief Set value to contents of another string.
+ * @param str Source string to use.
+ * @return Reference to this string.
+ */
basic_string&
assign(const basic_string& __str);
+ /**
+ * @brief Set value to a substring of a string.
+ * @param str The string to use.
+ * @param pos Index of the first character of str.
+ * @param n Number of characters to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function sets this string to the substring of @a str consisting
+ * of @a n characters at @a pos. If @a n is is larger than the number
+ * of available characters in @a str, the remainder of @a str is used.
+ */
basic_string&
assign(const basic_string& __str, size_type __pos, size_type __n);
+ /**
+ * @brief Set value to a C substring.
+ * @param s The C string to use.
+ * @param n Number of characters to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the first @a n
+ * characters of @a s. If @a n is is larger than the number of
+ * available characters in @a s, the remainder of @a s is used.
+ */
basic_string&
assign(const _CharT* __s, size_type __n);
+ /**
+ * @brief Set value to contents of a C string.
+ * @param s The C string to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the value of @a s.
+ * The data is copied, so there is no dependence on @a s once the
+ * function returns.
+ */
basic_string&
assign(const _CharT* __s)
{ return this->assign(__s, traits_type::length(__s)); }
+ /**
+ * @brief Set value to multiple characters.
+ * @param n Length of the resulting string.
+ * @param c The character to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to @a n copies of
+ * character @a c.
+ */
basic_string&
assign(size_type __n, _CharT __c)
{ return this->replace(_M_ibegin(), _M_iend(), __n, __c); }
+ /**
+ * @brief Set value to a range of characters.
+ * @param first Iterator referencing the first character to append.
+ * @param last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Sets value of string to characters in the range [first,last).
+ */
template<class _InputIterator>
basic_string&
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+ /**
+ * @brief Insert multiple characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param n Number of characters to insert
+ * @param c The character to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts @a n copies of character @a c starting at the position
+ * referenced by iterator @a p. If adding characters causes the length
+ * to exceed max_size(), length_error is thrown. The value of the
+ * string doesn't change if an error is thrown.
+ */
void
insert(iterator __p, size_type __n, _CharT __c)
{ this->replace(__p, __p, __n, __c); }
+ /**
+ * @brief Insert a range of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param beg Start of range.
+ * @param end End of range.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts characters in range [beg,end). If adding characters causes
+ * the length to exceed max_size(), length_error is thrown. The value
+ * of the string doesn't change if an error is thrown.
+ */
template<class _InputIterator>
void insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
+ /**
+ * @brief Insert value of a string.
+ * @param pos1 Iterator referencing location in string to insert at.
+ * @param str The string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts value of @a str starting at @a pos1. If adding characters
+ * causes the length to exceed max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
basic_string&
insert(size_type __pos1, const basic_string& __str)
{ return this->insert(__pos1, __str, 0, __str.size()); }
+ /**
+ * @brief Insert a substring.
+ * @param pos1 Iterator referencing location in string to insert at.
+ * @param str The string to insert.
+ * @param pos2 Start of characters in str to insert.
+ * @param n Number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos1 > size() or
+ * @a pos2 > @a str.size().
+ *
+ * Starting at @a pos1, insert @a n character of @a str beginning with
+ * @a pos2. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a pos1 is beyond the end of
+ * this string or @a pos2 is beyond the end of @a str, out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
basic_string&
insert(size_type __pos1, const basic_string& __str,
size_type __pos2, size_type __n);
+ /**
+ * @brief Insert a C substring.
+ * @param pos Iterator referencing location in string to insert at.
+ * @param s The C string to insert.
+ * @param n The number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a n characters of @a s starting at @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos is beyond end(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
basic_string&
insert(size_type __pos, const _CharT* __s, size_type __n);
+ /**
+ * @brief Insert a C string.
+ * @param pos Iterator referencing location in string to insert at.
+ * @param s The C string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a n characters of @a s starting at @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos is beyond end(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
basic_string&
insert(size_type __pos, const _CharT* __s)
{ return this->insert(__pos, __s, traits_type::length(__s)); }
+ /**
+ * @brief Insert multiple characters.
+ * @param pos Index in string to insert at.
+ * @param n Number of characters to insert
+ * @param c The character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts @a n copies of character @a c starting at index @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos > length(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
basic_string&
insert(size_type __pos, size_type __n, _CharT __c)
{
@@ -557,8 +967,21 @@ namespace std
return *this;
}
+ /**
+ * @brief Insert one character.
+ * @param p Iterator referencing position in string to insert at.
+ * @param c The character to insert.
+ * @return Iterator referencing newly inserted char.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a p is beyond the end of this string.
+ *
+ * Inserts character @a c at position referenced by @a p. If adding
+ * character causes the length to exceed max_size(), length_error is
+ * thrown. If @a p is beyond end of string, out_of_range is thrown.
+ * The value of the string doesn't change if an error is thrown.
+ */
iterator
- insert(iterator __p, _CharT __c = _CharT())
+ insert(iterator __p, _CharT __c)
{
const size_type __pos = __p - _M_ibegin();
this->insert(_M_check(__pos), size_type(1), __c);
@@ -566,6 +989,39 @@ namespace std
return this->_M_ibegin() + __pos;
}
+#ifdef _GLIBCXX_DEPRECATED
+ /**
+ * @brief Insert one default-constructed character.
+ * @param p Iterator referencing position in string to insert at.
+ * @return Iterator referencing newly inserted char.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a p is beyond the end of this string.
+ *
+ * Inserts a default-constructed character at position
+ * referenced by @a p. If adding character causes the length
+ * to exceed max_size(), length_error is thrown. If @a p is
+ * beyond end of string, out_of_range is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ iterator
+ insert(iterator __p)
+ { return this->insert(__p, _CharT()); }
+#endif /* _GLIBCXX_DEPRECATED */
+
+ /**
+ * @brief Remove characters.
+ * @param pos Index of first character to remove (default 0).
+ * @param n Number of characters to remove (default remainder).
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Removes @a n characters from this string starting at @a pos. The
+ * length of the string is reduced by @a n. If there are < @a n
+ * characters to remove, the remainder of the string is truncated. If
+ * @a p is beyond end of string, out_of_range is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
basic_string&
erase(size_type __pos = 0, size_type __n = npos)
{
@@ -573,6 +1029,17 @@ namespace std
_M_data(), _M_data());
}
+ /**
+ * @brief Remove one character.
+ * @param position Iterator referencing the character to remove.
+ * @return iterator referencing same location after removal.
+ * @throw std::out_of_range If @a position is beyond the end of this
+ * string.
+ *
+ * Removes the character at @a position from this string. If @a
+ * position is beyond end of string, out_of_range is thrown. The value
+ * of the string doesn't change if an error is thrown.
+ */
iterator
erase(iterator __position)
{
@@ -582,6 +1049,18 @@ namespace std
return _M_ibegin() + __i;
}
+ /**
+ * @brief Remove a range of characters.
+ * @param first Iterator referencing the first character to remove.
+ * @param last Iterator referencing the end of the range.
+ * @return Iterator referencing location of first after removal.
+ * @throw std::out_of_range If @a first is beyond the end of this
+ * string.
+ *
+ * Removes the characters in the range [first,last) from this string.
+ * If @a first is beyond end of string, out_of_range is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
iterator
erase(iterator __first, iterator __last)
{
@@ -591,43 +1070,193 @@ namespace std
return _M_ibegin() + __i;
}
+ /**
+ * @brief Replace characters with value from another string.
+ * @param pos Index of first character to replace.
+ * @param n Number of characters to be replaced.
+ * @param str String to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos+n) from this string.
+ * In place, the value of @a str is inserted. If @a pos is beyond end
+ * of string, out_of_range is thrown. If the length of the result
+ * exceeds max_size(), length_error is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
basic_string&
replace(size_type __pos, size_type __n, const basic_string& __str)
{ return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+ /**
+ * @brief Replace characters with value from another string.
+ * @param pos1 Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param str String to insert.
+ * @param pos2 Index of first character of str to use.
+ * @param n2 Number of characters from str to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos1 > size() or @a pos2 >
+ * str.size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos1,pos1 + n) from this
+ * string. In place, the value of @a str is inserted. If @a pos is
+ * beyond end of string, out_of_range is thrown. If the length of the
+ * result exceeds max_size(), length_error is thrown. The value of the
+ * string doesn't change if an error is thrown.
+ */
basic_string&
replace(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2);
+ /**
+ * @brief Replace characters with value of a C substring.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param str C string to insert.
+ * @param n2 Number of characters from str to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos1 > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, the first @a n2 characters of @a str are inserted, or all
+ * of @a str if @a n2 is too large. If @a pos is beyond end of string,
+ * out_of_range is thrown. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2);
+ /**
+ * @brief Replace characters with value of a C string.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param str C string to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, the first @a n characters of @a str are inserted. If @a
+ * pos is beyond end of string, out_of_range is thrown. If the length
+ * of result exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s)
{ return this->replace(__pos, __n1, __s, traits_type::length(__s)); }
+ /**
+ * @brief Replace characters with multiple characters.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param n2 Number of characters to insert.
+ * @param c Character to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, @a n2 copies of @a c are inserted. If @a pos is beyond
+ * end of string, out_of_range is thrown. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
basic_string&
replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
{ return this->replace(_M_check(__pos), _M_fold(__pos, __n1), __n2, __c); }
+ /**
+ * @brief Replace range of characters with string.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param str String value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the value of
+ * @a str is inserted. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
basic_string&
replace(iterator __i1, iterator __i2, const basic_string& __str)
{ return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+ /**
+ * @brief Replace range of characters with C substring.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param s C string value to insert.
+ * @param n Number of characters from s to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the first @a
+ * n characters of @a s are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
basic_string&
replace(iterator __i1, iterator __i2,
const _CharT* __s, size_type __n)
{ return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n); }
+ /**
+ * @brief Replace range of characters with C string.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param s C string value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * characters of @a s are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
basic_string&
replace(iterator __i1, iterator __i2, const _CharT* __s)
{ return this->replace(__i1, __i2, __s, traits_type::length(__s)); }
+ /**
+ * @brief Replace range of characters with multiple characters
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param n Number of characters to insert.
+ * @param c Character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, @a n copies
+ * of @a c are inserted. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
basic_string&
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
{ return _M_replace_aux(__i1, __i2, __n, __c); }
+ /**
+ * @brief Replace range of characters with range.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param k1 Iterator referencing start of range to insert.
+ * @param k2 Iterator referencing end of range to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
template<class _InputIterator>
basic_string&
replace(iterator __i1, iterator __i2,
@@ -735,13 +1364,37 @@ namespace std
public:
+ /**
+ * @brief Copy substring into C string.
+ * @param s C string to copy value into.
+ * @param n Number of characters to copy.
+ * @param pos Index of first character to copy.
+ * @return Number of characters actually copied
+ * @throw std::out_of_range If pos > size().
+ *
+ * Copies up to @a n characters starting at @a pos into the C string @a
+ * s. If @a pos is greater than size(), out_of_range is thrown.
+ */
size_type
copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+ /**
+ * @brief Swap contents with another string.
+ * @param s String to swap with.
+ *
+ * Exchanges the contents of this string with that of @a s in constant
+ * time.
+ */
void
swap(basic_string& __s);
// String operations:
+ /**
+ * @brief Return const pointer to null-terminated contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
const _CharT*
c_str() const
{
@@ -751,99 +1404,371 @@ namespace std
return _M_data();
}
+ /**
+ * @brief Return const pointer to contents.
+ *
+ * This is a handle to internal data. It may not be null-terminated.
+ * Do not modify or dire things may happen.
+ */
const _CharT*
data() const { return _M_data(); }
+ /**
+ * @brief Return copy of allocator used to construct this string.
+ */
allocator_type
get_allocator() const { return _M_dataplus; }
+ /**
+ * @brief Find position of a C substring.
+ * @param s C string to locate.
+ * @param pos Index of character to search from.
+ * @param n Number of characters from @a s to search for.
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the first @a n characters
+ * in @a s within this string. If found, returns the index where it
+ * begins. If not found, returns npos.
+ */
size_type
find(const _CharT* __s, size_type __pos, size_type __n) const;
+ /**
+ * @brief Find position of a string.
+ * @param str String to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for value of @a str within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
size_type
find(const basic_string& __str, size_type __pos = 0) const
{ return this->find(__str.data(), __pos, __str.size()); }
+ /**
+ * @brief Find position of a C string.
+ * @param s C string to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the value of @a s within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
size_type
find(const _CharT* __s, size_type __pos = 0) const
{ return this->find(__s, __pos, traits_type::length(__s)); }
+ /**
+ * @brief Find position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
size_type
find(_CharT __c, size_type __pos = 0) const;
+ /**
+ * @brief Find last position of a string.
+ * @param str String to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for value of @a str within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
size_type
rfind(const basic_string& __str, size_type __pos = npos) const
{ return this->rfind(__str.data(), __pos, __str.size()); }
+ /**
+ * @brief Find last position of a C substring.
+ * @param s C string to locate.
+ * @param pos Index of character to search back from.
+ * @param n Number of characters from s to search for.
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for the first @a n
+ * characters in @a s within this string. If found, returns the index
+ * where it begins. If not found, returns npos.
+ */
size_type
rfind(const _CharT* __s, size_type __pos, size_type __n) const;
+ /**
+ * @brief Find last position of a C string.
+ * @param s C string to locate.
+ * @param pos Index of character to start search at (default 0).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for the value of @a s within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
size_type
rfind(const _CharT* __s, size_type __pos = npos) const
{ return this->rfind(__s, __pos, traits_type::length(__s)); }
+ /**
+ * @brief Find last position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search back from (default 0).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
size_type
rfind(_CharT __c, size_type __pos = npos) const;
+ /**
+ * @brief Find position of a character of string.
+ * @param str String containing characters to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the characters of
+ * @a str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
size_type
find_first_of(const basic_string& __str, size_type __pos = 0) const
{ return this->find_first_of(__str.data(), __pos, __str.size()); }
+ /**
+ * @brief Find position of a character of C substring.
+ * @param s String containing characters to locate.
+ * @param pos Index of character to search from (default 0).
+ * @param n Number of characters from s to search for.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the first @a n
+ * characters of @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
size_type
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
+ /**
+ * @brief Find position of a character of C string.
+ * @param s String containing characters to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the characters of
+ * @a s within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
size_type
find_first_of(const _CharT* __s, size_type __pos = 0) const
{ return this->find_first_of(__s, __pos, traits_type::length(__s)); }
+ /**
+ * @brief Find position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the character @a c within
+ * this string. If found, returns the index where it was found. If
+ * not found, returns npos.
+ *
+ * Note: equivalent to find(c, pos).
+ */
size_type
find_first_of(_CharT __c, size_type __pos = 0) const
{ return this->find(__c, __pos); }
+ /**
+ * @brief Find last position of a character of string.
+ * @param str String containing characters to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the characters of
+ * @a str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
size_type
find_last_of(const basic_string& __str, size_type __pos = npos) const
{ return this->find_last_of(__str.data(), __pos, __str.size()); }
+ /**
+ * @brief Find last position of a character of C substring.
+ * @param s C string containing characters to locate.
+ * @param pos Index of character to search back from (default end).
+ * @param n Number of characters from s to search for.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the first @a n
+ * characters of @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
size_type
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
+ /**
+ * @brief Find last position of a character of C string.
+ * @param s C string containing characters to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the characters of
+ * @a s within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
size_type
find_last_of(const _CharT* __s, size_type __pos = npos) const
{ return this->find_last_of(__s, __pos, traits_type::length(__s)); }
+ /**
+ * @brief Find last position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search back from (default 0).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ *
+ * Note: equivalent to rfind(c, pos).
+ */
size_type
find_last_of(_CharT __c, size_type __pos = npos) const
{ return this->rfind(__c, __pos); }
+ /**
+ * @brief Find position of a character not in string.
+ * @param str String containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in @a str within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
size_type
find_first_not_of(const basic_string& __str, size_type __pos = 0) const
{ return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+ /**
+ * @brief Find position of a character not in C substring.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @param n Number of characters from s to consider.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in the first @a n characters of @a s within this string. If found,
+ * returns the index where it was found. If not found, returns npos.
+ */
size_type
find_first_not_of(const _CharT* __s, size_type __pos,
size_type __n) const;
+ /**
+ * @brief Find position of a character not in C string.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in @a s within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
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)); }
+ /**
+ * @brief Find position of a different character.
+ * @param c Character to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character other than @a c
+ * within this string. If found, returns the index where it was found.
+ * If not found, returns npos.
+ */
size_type
find_first_not_of(_CharT __c, size_type __pos = 0) const;
+ /**
+ * @brief Find last position of a character not in string.
+ * @param str String containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in @a str within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
size_type
find_last_not_of(const basic_string& __str, size_type __pos = npos) const
{ return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+ /**
+ * @brief Find last position of a character not in C substring.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @param n Number of characters from s to consider.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in the first @a n characters of @a s within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
size_type
find_last_not_of(const _CharT* __s, size_type __pos,
size_type __n) const;
+ /**
+ * @brief Find position of a character not in C string.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
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)); }
+ /**
+ * @brief Find last position of a different character.
+ * @param c Character to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches backward for a character other than
+ * @a c within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
size_type
find_last_not_of(_CharT __c, size_type __pos = npos) const;
+ /**
+ * @brief Get a substring.
+ * @param pos Index of first character (default 0).
+ * @param n Number of characters in substring (default remainder).
+ * @return The new string.
+ * @throw std::out_of_range If pos > size().
+ *
+ * Construct and return a new string using the @a n characters starting
+ * at @a pos. If the string is too short, use the remainder of the
+ * characters. If @a pos is beyond the end of the string, out_of_range
+ * is thrown.
+ */
basic_string
substr(size_type __pos = 0, size_type __n = npos) const
{
@@ -852,6 +1777,17 @@ namespace std
return basic_string(*this, __pos, __n);
}
+ /**
+ * @brief Compare to a string.
+ * @param str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a str, 0 if
+ * their values are equivalent, or > 0 if this string is ordered after
+ * @a str. If the lengths of @a str and this string are different, the
+ * shorter one is ordered first. If they are the same, returns the
+ * result of traits::compare(data(),str.data(),size());
+ */
int
compare(const basic_string& __str) const
{
@@ -865,21 +1801,98 @@ namespace std
return __r;
}
+ /**
+ * @brief Compare substring to a string.
+ * @param pos Index of first character of substring.
+ * @param n Number of characters in substring.
+ * @param str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n characters starting
+ * at @a pos. Returns an integer < 0 if the substring is ordered
+ * before @a str, 0 if their values are equivalent, or > 0 if the
+ * substring is ordered after @a str. If the lengths @a of str and the
+ * substring are different, the shorter one is ordered first. If they
+ * are the same, returns the result of
+ * traits::compare(substring.data(),str.data(),size());
+ */
int
compare(size_type __pos, size_type __n, const basic_string& __str) const;
+ /**
+ * @brief Compare substring to a substring.
+ * @param pos1 Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param str String to compare against.
+ * @param pos2 Index of first character of substring of str.
+ * @param n2 Number of characters in substring of str.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos1. Form the substring of @a str from the @a n2 characters
+ * starting at @a pos2. Returns an integer < 0 if this substring is
+ * ordered before the substring of @a str, 0 if their values are
+ * equivalent, or > 0 if this substring is ordered after the substring
+ * of @a str. If the lengths of the substring of @a str and this
+ * substring are different, the shorter one is ordered first. If they
+ * are the same, returns the result of
+ * traits::compare(substring.data(),str.substr(pos2,n2).data(),size());
+ */
int
compare(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2) const;
+ /**
+ * @brief Compare to a C string.
+ * @param s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a s, 0 if
+ * their values are equivalent, or > 0 if this string is ordered after
+ * @a s. If the lengths of @a s and this string are different, the
+ * shorter one is ordered first. If they are the same, returns the
+ * result of traits::compare(data(),s,size());
+ */
int
compare(const _CharT* __s) const;
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 5 String::compare specification questionable
+ /**
+ * @brief Compare substring to a C string.
+ * @param pos Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos. Returns an integer < 0 if the substring is ordered
+ * before @a s, 0 if their values are equivalent, or > 0 if the
+ * substring is ordered after @a s. If the lengths of @a s and the
+ * substring are different, the shorter one is ordered first. If they
+ * are the same, returns the result of
+ * traits::compare(substring.data(),s,size());
+ */
int
compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+ /**
+ * @brief Compare substring against a C substring.
+ * @param pos1 Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param s C string to compare against.
+ * @param n2 Number of characters in substring of s.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos1. Form the substring of @a s from the first @a n
+ * characters of @a s. Returns an integer < 0 if this substring is
+ * ordered before the substring of @a s, 0 if their values are
+ * equivalent, or > 0 if this substring is ordered after the substring
+ * of @a s. If the lengths of this substring and @a n are different,
+ * the shorter one is ordered first. If they are the same, returns the
+ * result of traits::compare(substring.data(),s,size());
+ */
int
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const;
@@ -892,7 +1905,13 @@ namespace std
: _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
// operator+
- template<typename _CharT, typename _Traits, typename _Alloc>
+ /**
+ * @brief Concatenate two strings.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with value of @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
@@ -902,15 +1921,33 @@ namespace std
return __str;
}
+ /**
+ * @brief Concatenate C string and string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with value of @a lhs followed by @a rhs.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(const _CharT* __lhs,
const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+ /**
+ * @brief Concatenate character and string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+ /**
+ * @brief Concatenate string and C string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@@ -921,6 +1958,12 @@ namespace std
return __str;
}
+ /**
+ * @brief Concatenate string and character.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
@@ -933,18 +1976,36 @@ namespace std
}
// operator ==
+ /**
+ * @brief Test equivalence of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) == 0; }
+ /**
+ * @brief Test equivalence of C string and string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a rhs.compare(@a lhs) == 0. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) == 0; }
+ /**
+ * @brief Test equivalence of string and C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@@ -952,18 +2013,36 @@ namespace std
{ return __lhs.compare(__rhs) == 0; }
// operator !=
+ /**
+ * @brief Test difference of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) != 0; }
+ /**
+ * @brief Test difference of C string and string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a rhs.compare(@a lhs) != 0. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) != 0; }
+ /**
+ * @brief Test difference of string and C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@@ -971,18 +2050,36 @@ namespace std
{ return __lhs.compare(__rhs) != 0; }
// operator <
+ /**
+ * @brief Test if string precedes string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) < 0; }
+ /**
+ * @brief Test if string precedes C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) < 0; }
+ /**
+ * @brief Test if C string precedes string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const _CharT* __lhs,
@@ -990,18 +2087,36 @@ namespace std
{ return __rhs.compare(__lhs) > 0; }
// operator >
+ /**
+ * @brief Test if string follows string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) > 0; }
+ /**
+ * @brief Test if string follows C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) > 0; }
+ /**
+ * @brief Test if C string follows string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const _CharT* __lhs,
@@ -1009,18 +2124,36 @@ namespace std
{ return __rhs.compare(__lhs) < 0; }
// operator <=
+ /**
+ * @brief Test if string doesn't follow string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) <= 0; }
+ /**
+ * @brief Test if string doesn't follow C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) <= 0; }
+ /**
+ * @brief Test if C string doesn't follow string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const _CharT* __lhs,
@@ -1028,18 +2161,36 @@ namespace std
{ return __rhs.compare(__lhs) >= 0; }
// operator >=
+ /**
+ * @brief Test if string doesn't precede string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) >= 0; }
+ /**
+ * @brief Test if string doesn't precede C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) >= 0; }
+ /**
+ * @brief Test if C string doesn't precede string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const _CharT* __lhs,
@@ -1047,27 +2198,79 @@ namespace std
{ return __rhs.compare(__lhs) <= 0; }
+ /**
+ * @brief Swap contents of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ *
+ * Exchanges the contents of @a lhs and @a rhs in constant time.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline void
swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
+ /**
+ * @brief Read stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a is into @a str until whitespace is found, the
+ * end of the stream is encountered, or str.max_size() is reached. If
+ * is.width() is non-zero, that is the limit on the number of characters
+ * stored into @a str. Any previous contents of @a str are erased.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str);
+ /**
+ * @brief Write string to a stream.
+ * @param os Output stream.
+ * @param str String to write out.
+ * @return Reference to the output stream.
+ *
+ * Output characters of @a str into os following the same rules as for
+ * writing a C string.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os,
const basic_string<_CharT, _Traits, _Alloc>& __str);
+ /**
+ * @brief Read a line from stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @param delim Character marking end of line.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a is into @a str until @a delim is found, the
+ * end of the stream is encountered, or str.max_size() is reached. If
+ * is.width() is non-zero, that is the limit on the number of characters
+ * stored into @a str. Any previous contents of @a str are erased. If @a
+ * delim was encountered, it is extracted but not stored into @a str.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT,_Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
+ /**
+ * @brief Read a line from stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from is into @a str until '\n' is found, the end of
+ * the stream is encountered, or str.max_size() is reached. If is.width()
+ * is non-zero, that is the limit on the number of characters stored into
+ * @a str. Any previous contents of @a str are erased. If end of line was
+ * encountered, it is extracted but not stored into @a str.
+ */
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_istream<_CharT,_Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
diff --git a/libstdc++-v3/include/bits/boost_concept_check.h b/libstdc++-v3/include/bits/boost_concept_check.h
index b3ef7afe8f9..b8bce64b8c4 100644
--- a/libstdc++-v3/include/bits/boost_concept_check.h
+++ b/libstdc++-v3/include/bits/boost_concept_check.h
@@ -88,7 +88,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _IntegerConcept {
void __constraints() {
- __error_type_must_be_an_integer_type();
+ this->__error_type_must_be_an_integer_type();
}
};
template <> struct _IntegerConcept<short> { void __constraints() {} };
@@ -104,7 +104,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _SignedIntegerConcept {
void __constraints() {
- __error_type_must_be_a_signed_integer_type();
+ this->__error_type_must_be_a_signed_integer_type();
}
};
template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
@@ -115,7 +115,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _UnsignedIntegerConcept {
void __constraints() {
- __error_type_must_be_an_unsigned_integer_type();
+ this->__error_type_must_be_an_unsigned_integer_type();
}
};
template <> struct _UnsignedIntegerConcept<unsigned short>
@@ -213,7 +213,6 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
{
void __constraints() {
__aux_require_boolean_expr(__a == __b);
- __aux_require_boolean_expr(__a != __b);
}
_Tp __a, __b;
};
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index e2a0904e4ac..167ff50e24c 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -35,19 +35,11 @@
#include <bits/os_defines.h>
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCXX__ 20030709
+#define __GLIBCXX__ 20030922
-// This is necessary until GCC supports separate template compilation.
-#define _GLIBCXX_NO_TEMPLATE_EXPORT 1
-
-// This is a hack around not having either pre-compiled headers or
-// export compilation. If defined, the io, string, and valarray
-// headers will include all the necessary bits. If not defined, the
-// implementation optimizes the headers for the most commonly-used
-// types. For the io library, this means that larger, out-of-line
-// member functions are only declared, and definitions are not parsed
-// by the compiler, but instead instantiated into the library binary.
-#define _GLIBCXX_FULLY_COMPLIANT_HEADERS 1
+// Allow use of "export template." This is currently not a feature
+// that g++ supports.
+// #define _GLIBCXX_EXPORT_TEMPLATE 1
// Allow use of the GNU syntax extension, "extern template." This
// extension is fully documented in the g++ manual, but in a nutshell,
@@ -65,29 +57,7 @@
// Use corrected code from the committee library group's issues list.
#define _GLIBCXX_RESOLVE_LIB_DEFECTS 1
-// Hopefully temporary workaround to autoconf/m4 issue with quoting '@'.
-#define _GLIBCXX_AT_AT "@@"
-
-// In those parts of the standard C++ library that use a mutex instead
-// of a spin-lock, we now unconditionally use GCC's gthr.h mutex
-// abstraction layer. All support to directly map to various
-// threading models has been removed. Note: gthr.h may well map to
-// gthr-single.h which is a correct way to express no threads support
-// in gcc. Support for the undocumented _NOTHREADS has been removed.
-
-// Default to the typically high-speed, pool-based allocator (as
-// libstdc++-v2) instead of the malloc-based allocator (libstdc++-v3
-// snapshots). See libstdc++-v3/docs/html/17_intro/howto.html for
-// details on why you don't want to override this setting. Ensure
-// that threads are properly configured on your platform before
-// assigning blame to the STL container-memory allocator. After doing
-// so, please report any possible issues to libstdc++@gcc.gnu.org .
-// Do not define __USE_MALLOC on the command line. Enforce it here:
-#ifdef __USE_MALLOC
-# error __USE_MALLOC should never be defined. Read the release notes.
-#endif
-
-// The remainder of the prewritten config is mostly automatic; all the
+// The remainder of the prewritten config is automatic; all the
// user hooks are listed above.
// Create a boolean flag to be used to determine if --fast-math is set.
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index aa6d7f48a6d..ba0499f12da 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -1,6 +1,6 @@
// Character Traits for use by standard string and iostream -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -43,83 +43,199 @@
#pragma GCC system_header
#include <cstring> // For memmove, memset, memchr
+#include <bits/stl_algobase.h>// For copy, lexicographical_compare, fill_n
#include <bits/fpos.h> // For streampos
-namespace std
+namespace __gnu_cxx
{
- // 21.1
/**
- * @brief Basis for explicit traits specializations.
+ * @brief Mapping from character type to associated types.
+ *
*
- * @note For any given actual character type, this definition is
- * probably wrong.
+ * @note This is an implementation class for the generic version
+ * of char_traits. It defines int_type, off_type, pos_type, and
+ * state_type. By default these are unsigned long, streamoff,
+ * streampos, and mbstate_t. Users who need a different set of
+ * types, but who don't need to change the definitions of any function
+ * defined in char_traits, can specialize __gnu_cxx::_Char_types
+ * while leaving __gnu_cxx::char_traits alone. */
+ template <class _CharT>
+ struct _Char_types
+ {
+ typedef unsigned long int_type;
+ typedef std::streampos pos_type;
+ typedef std::streamoff off_type;
+ typedef std::mbstate_t state_type;
+ };
+
+
+ /**
+ * @brief Base class used to implement std::char_traits.
+ *
+ * @note For any given actual character type, this definition is
+ * probably wrong. (Most of the member functions are likely to be
+ * right, but the int_type and state_type typedefs, and the eof()
+ * member function, are likely to be wrong.) The reason this class
+ * exists is so users can specialize it. Classes in namespace std
+ * may not be specialized for fundamentl types, but classes in
+ * namespace __gnu_cxx may be.
*
* See http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/howto.html#5
* for advice on how to make use of this class for "unusual" character
- * types. Also, check out include/ext/pod_char_traits.h.
- */
- template<class _CharT>
+ * types. Also, check out include/ext/pod_char_traits.h. */
+ template<typename _CharT>
struct char_traits
{
- typedef _CharT char_type;
- typedef unsigned long int_type;
- typedef streampos pos_type;
- typedef streamoff off_type;
- typedef mbstate_t state_type;
+ typedef _CharT char_type;
+ typedef typename _Char_types<_CharT>::int_type int_type;
+ typedef typename _Char_types<_CharT>::pos_type pos_type;
+ typedef typename _Char_types<_CharT>::off_type off_type;
+ typedef typename _Char_types<_CharT>::state_type state_type;
static void
- assign(char_type& __c1, const char_type& __c2);
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
static bool
- eq(const char_type& __c1, const char_type& __c2);
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
static bool
- lt(const char_type& __c1, const char_type& __c2);
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
static int
- compare(const char_type* __s1, const char_type* __s2, size_t __n);
+ compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
- static size_t
+ static std::size_t
length(const char_type* __s);
static const char_type*
- find(const char_type* __s, size_t __n, const char_type& __a);
+ find(const char_type* __s, std::size_t __n, const char_type& __a);
static char_type*
- move(char_type* __s1, const char_type* __s2, size_t __n);
+ move(char_type* __s1, const char_type* __s2, std::size_t __n);
static char_type*
- copy(char_type* __s1, const char_type* __s2, size_t __n);
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n);
static char_type*
- assign(char_type* __s, size_t __n, char_type __a);
+ assign(char_type* __s, std::size_t __n, char_type __a);
static char_type
- to_char_type(const int_type& __c);
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
static int_type
- to_int_type(const char_type& __c);
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(__c); }
static bool
- eq_int_type(const int_type& __c1, const int_type& __c2);
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
static int_type
- eof();
+ eof()
+ { return static_cast<int_type>(EOF); }
static int_type
- not_eof(const int_type& __c);
+ not_eof(const int_type& __c)
+ { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
};
+ template<typename _CharT>
+ int
+ char_traits<_CharT>::
+ compare(const char_type* __s1, const char_type* __s2, std::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;
+ }
+
+ template<typename _CharT>
+ std::size_t
+ char_traits<_CharT>::
+ length(const char_type* __p)
+ {
+ std::size_t __i = 0;
+ while (!eq(__p[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ template<typename _CharT>
+ const typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ find(const char_type* __s, std::size_t __n, const char_type& __a)
+ {
+ for (std::size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ move(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ return static_cast<_CharT*>(std::memmove(__s1, __s2,
+ __n * sizeof(char_type)));
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ std::copy(__s2, __s2 + __n, __s1);
+ return __s1;
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ assign(char_type* __s, std::size_t __n, char_type __a)
+ {
+ std::fill_n(__s, __n, __a);
+ return __s;
+ }
+}
+
+namespace std
+{
+ // 21.1
+ /**
+ * @brief Basis for explicit traits specializations.
+ *
+ * @note For any given actual character type, this definition is
+ * probably wrong. Since this is just a thin wrapper around
+ * __gnu_cxx::char_traits, it is possible to achieve a more
+ * appropriate definition by specializing __gnu_cxx::char_traits.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/howto.html#5
+ * for advice on how to make use of this class for "unusual" character
+ * types. Also, check out include/ext/pod_char_traits.h.
+ */
+ template<class _CharT>
+ struct char_traits
+ : public __gnu_cxx::char_traits<_CharT>
+ { };
+
/// 21.1.3.1 char_traits specializations
template<>
struct char_traits<char>
{
- typedef char char_type;
- typedef int int_type;
- typedef streampos pos_type;
- typedef streamoff off_type;
- typedef mbstate_t state_type;
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+ typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
@@ -185,11 +301,11 @@ namespace std
template<>
struct char_traits<wchar_t>
{
- typedef wchar_t char_type;
- typedef wint_t int_type;
- typedef streamoff off_type;
- typedef wstreampos pos_type;
- typedef mbstate_t state_type;
+ typedef wchar_t char_type;
+ typedef wint_t int_type;
+ typedef streamoff off_type;
+ typedef wstreampos pos_type;
+ typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
@@ -216,7 +332,7 @@ namespace std
{ return wmemchr(__s, __a, __n); }
static char_type*
- move(char_type* __s1, const char_type* __s2, int_type __n)
+ move(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemmove(__s1, __s2, __n); }
static char_type*
diff --git a/libstdc++-v3/include/bits/demangle.h b/libstdc++-v3/include/bits/demangle.h
index d6fdcd58c3e..9b1ff0fdb66 100644
--- a/libstdc++-v3/include/bits/demangle.h
+++ b/libstdc++-v3/include/bits/demangle.h
@@ -31,10 +31,8 @@
#ifndef _DEMANGLER_H
#define _DEMANGLER_H 1
-#include <limits>
#include <vector>
#include <string>
-#include <cctype>
#ifndef _GLIBCXX_DEMANGLER_DEBUG
#define _GLIBCXX_DEMANGLER_CWDEBUG 0
@@ -150,7 +148,7 @@ namespace __gnu_cxx
{ }
qualifier(int start_pos,
- cv_qualifier_nt cv_qualifier,
+ cv_qualifier_nt,
char const* start,
int count,
int inside_substitution)
@@ -453,6 +451,14 @@ namespace __gnu_cxx
}
}
+ // We don't want to depend on locale (or include <cctype> for that matter).
+ // We also don't want to use "safe-ctype.h" because that headerfile is not
+ // available to the users.
+ inline bool isdigit(char c) { return c >= '0' && c <= '9'; }
+ inline bool islower(char c) { return c >= 'a' && c <= 'z'; }
+ inline bool isupper(char c) { return c >= 'A' && c <= 'Z'; }
+ 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>+]
@@ -468,7 +474,7 @@ namespace __gnu_cxx
output += '0';
eat_current();
}
- else if (!std::isdigit(c))
+ else if (!isdigit(c))
M_result = false;
else
{
@@ -476,7 +482,7 @@ namespace __gnu_cxx
{
output += c;
}
- while (std::isdigit((c = next())));
+ while (isdigit((c = next())));
}
return M_result;
}
@@ -699,7 +705,7 @@ namespace __gnu_cxx
default:
for(;; c = next())
{
- if (std::isdigit(c))
+ if (isdigit(c))
value = value * 36 + c - '0';
else if (isupper(c))
value = value * 36 + c - 'A' + 10;
@@ -782,7 +788,7 @@ namespace __gnu_cxx
char c;
if ((c = next()) != '_')
{
- while(std::isdigit(c))
+ while(isdigit(c))
{
value = value * 10 + c - '0';
c = next();
@@ -1903,7 +1909,7 @@ namespace __gnu_cxx
int length = current() - '0';
if (length < 1 || length > 9)
_GLIBCXX_DEMANGLER_FAILURE;
- while(std::isdigit(next()))
+ while(isdigit(next()))
length = 10 * length + current() - '0';
char const* ptr = &M_str[M_pos];
if (length > 11 && !strncmp(ptr, "_GLOBAL_", 8) && ptr[9] == 'N'
@@ -1932,7 +1938,7 @@ namespace __gnu_cxx
session<Allocator>::decode_unqualified_name(string_type& output)
{
_GLIBCXX_DEMANGLER_DOUT_ENTERING("decode_unqualified_name");
- if (std::isdigit(current()))
+ if (isdigit(current()))
{
if (!M_inside_template_args)
{
@@ -2187,7 +2193,7 @@ namespace __gnu_cxx
eat_current();
if (!decode_type(first))
_GLIBCXX_DEMANGLER_FAILURE;
- while(std::isdigit(current()))
+ while(isdigit(current()))
eat_current();
if (eat_current() != '_')
_GLIBCXX_DEMANGLER_FAILURE;
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index 8164df5f769..dedab6a3112 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -268,7 +268,7 @@ namespace std
_M_range_initialize(_InputIterator __first, _InputIterator __last,
input_iterator_tag)
{
- _M_initialize_map(0);
+ this->_M_initialize_map(0);
try
{
for ( ; __first != __last; ++__first)
@@ -289,7 +289,7 @@ namespace std
forward_iterator_tag)
{
size_type __n = std::distance(__first, __last);
- _M_initialize_map(__n);
+ this->_M_initialize_map(__n);
_Map_pointer __cur_node;
try
@@ -320,7 +320,7 @@ namespace std
{
value_type __t_copy = __t;
_M_reserve_map_at_back();
- *(this->_M_finish._M_node + 1) = _M_allocate_node();
+ *(this->_M_finish._M_node + 1) = this->_M_allocate_node();
try
{
std::_Construct(this->_M_finish._M_cur, __t_copy);
@@ -342,7 +342,7 @@ namespace std
{
value_type __t_copy = __t;
_M_reserve_map_at_front();
- *(this->_M_start._M_node - 1) = _M_allocate_node();
+ *(this->_M_start._M_node - 1) = this->_M_allocate_node();
try
{
this->_M_start._M_set_node(this->_M_start._M_node - 1);
@@ -631,7 +631,7 @@ namespace std
try
{
for (__i = 1; __i <= __new_nodes; ++__i)
- *(this->_M_start._M_node - __i) = _M_allocate_node();
+ *(this->_M_start._M_node - __i) = this->_M_allocate_node();
}
catch(...)
{
@@ -653,7 +653,7 @@ namespace std
try
{
for (__i = 1; __i <= __new_nodes; ++__i)
- *(this->_M_finish._M_node + __i) = _M_allocate_node();
+ *(this->_M_finish._M_node + __i) = this->_M_allocate_node();
}
catch(...)
{
@@ -692,7 +692,7 @@ namespace std
size_type __new_map_size =
this->_M_map_size + std::max(this->_M_map_size, __nodes_to_add) + 2;
- _Map_pointer __new_map = _M_allocate_map(__new_map_size);
+ _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
__new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
std::copy(this->_M_start._M_node,
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index c25d50142f4..31175559bb9 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -64,6 +64,11 @@ namespace std
this->_M_buf = NULL;
_M_buf_allocated = false;
}
+ delete [] _M_ext_buf;
+ _M_ext_buf = NULL;
+ _M_ext_buf_size = 0;
+ _M_ext_next = NULL;
+ _M_ext_end = NULL;
}
template<typename _CharT, typename _Traits>
@@ -73,7 +78,8 @@ namespace std
_M_state_beg(__state_type()), _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_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);
@@ -199,44 +205,92 @@ namespace std
// Get and convert input sequence.
const size_t __buflen = this->_M_buf_size > 1
? this->_M_buf_size - 1 : 1;
- streamsize __elen = 0;
+
+ // Will be set to true if ::read() returns 0 indicating EOF.
+ bool __got_eof = false;
+ // Number of internal characters produced.
streamsize __ilen = 0;
if (__check_facet(_M_codecvt).always_noconv())
{
- __elen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
+ __ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
__buflen);
- __ilen = __elen;
+ if (__ilen == 0)
+ __got_eof = true;
}
else
{
- // Worst-case number of external bytes.
- // XXX Not done encoding() == -1.
- const int __enc = _M_codecvt->encoding();
- const streamsize __blen = __enc > 0 ? __buflen * __enc : __buflen;
- char* __buf = static_cast<char*>(__builtin_alloca(__blen));
- __elen = _M_file.xsgetn(__buf, __blen);
-
- const char* __eend;
- char_type* __iend;
- codecvt_base::result __r;
- __r = _M_codecvt->in(_M_state_cur, __buf, __buf + __elen,
- __eend, this->eback(),
- this->eback() + __buflen, __iend);
- if (__r == codecvt_base::ok || __r == codecvt_base::partial)
- __ilen = __iend - this->eback();
- else if (__r == codecvt_base::noconv)
+ // Worst-case number of external bytes.
+ // 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)
+ __blen = __rlen = __buflen * __enc;
+ else
+ {
+ __blen = __buflen + _M_codecvt->max_length() - 1;
+ __rlen = __buflen;
+ }
+ const streamsize __remainder = _M_ext_end - _M_ext_next;
+ __rlen = __rlen > __remainder ? __rlen - __remainder : 0;
+
+ // Allocate buffer if necessary and move unconverted
+ // bytes to front.
+ if (_M_ext_buf_size < __blen)
{
- traits_type::copy(this->eback(),
- reinterpret_cast<char_type*>(__buf),
- __elen);
- __ilen = __elen;
+ char* __buf = new char[__blen];
+ if (__remainder > 0)
+ std::memcpy(__buf, _M_ext_next, __remainder);
+
+ delete [] _M_ext_buf;
+ _M_ext_buf = __buf;
+ _M_ext_buf_size = __blen;
}
- else
+ else if (__remainder > 0)
+ std::memmove(_M_ext_buf, _M_ext_next, __remainder);
+
+ _M_ext_next = _M_ext_buf;
+ _M_ext_end = _M_ext_buf + __remainder;
+
+ do
{
- // Unwind.
- __ilen = 0;
- _M_file.seekoff(-__elen, ios_base::cur, ios_base::in);
+ if (__rlen > 0)
+ {
+ // Sanity check!
+ // 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();
+ streamsize __elen = _M_file.xsgetn(_M_ext_end, __rlen);
+ if (__elen == 0)
+ __got_eof = true;
+ _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)
+ {
+ 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);
+ _M_ext_next = _M_ext_buf + __ilen;
+ }
+ else
+ {
+ __ilen = 0;
+ break;
+ }
+ __rlen = 1;
}
+ while (!__got_eof && __ilen == 0);
}
if (__ilen > 0)
@@ -245,7 +299,7 @@ namespace std
_M_reading = true;
__ret = traits_type::to_int_type(*this->gptr());
}
- else if (__elen == 0)
+ else if (__got_eof)
{
// If the actual end of file is reached, set 'uncommitted'
// mode, thus allowing an immediate write without an
@@ -438,6 +492,54 @@ namespace std
return __elen && __elen == __plen;
}
+ template<typename _CharT, typename _Traits>
+ streamsize
+ 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.
+ const bool __testout = this->_M_mode & ios_base::out;
+ if (__testout && !_M_reading
+ && __check_facet(_M_codecvt).always_noconv())
+ {
+ // Measurement would reveal the best choice.
+ const streamsize __chunk = 1ul << 10;
+ streamsize __bufavail = this->epptr() - this->pptr();
+
+ // Don't mistake 'uncommitted' mode buffered with unbuffered.
+ if (!_M_writing && this->_M_buf_size > 1)
+ __bufavail = this->_M_buf_size - 1;
+
+ const streamsize __limit = std::min(__chunk, __bufavail);
+ if (__n >= __limit)
+ {
+ 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);
+ if (__ret == __buffill + __n)
+ {
+ _M_set_buffer(0);
+ _M_writing = true;
+ }
+ if (__ret > __buffill)
+ __ret -= __buffill;
+ else
+ __ret = 0;
+ }
+ else
+ __ret = __streambuf_type::xsputn(__s, __n);
+ }
+ else
+ __ret = __streambuf_type::xsputn(__s, __n);
+
+ return __ret;
+ }
+
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::__streambuf_type*
basic_filebuf<_CharT, _Traits>::
@@ -491,7 +593,7 @@ namespace std
// Ditch any pback buffers to avoid confusion.
_M_destroy_pback();
- off_type __computed_off = __off;
+ off_type __computed_off = __off * __width;
if (this->pbase() < this->pptr())
{
// Part one: update the output sequence.
@@ -501,13 +603,26 @@ namespace std
_M_output_unshift();
}
else if (_M_reading && __way == ios_base::cur)
- __computed_off += this->gptr() - this->egptr();
+ {
+ if (_M_codecvt->always_noconv())
+ __computed_off += this->gptr() - this->egptr();
+ else
+ {
+ // Calculate offset from _M_ext_buf that corresponds
+ // to gptr().
+ const int __gptr_off =
+ _M_codecvt->length(_M_state_cur, _M_ext_buf, _M_ext_next,
+ this->gptr() - this->eback());
+ __computed_off += _M_ext_buf + __gptr_off - _M_ext_end;
+ }
+ }
// Returns pos_type(off_type(-1)) in case of failure.
- __ret = _M_file.seekoff(__computed_off * __width, __way, __mode);
+ __ret = _M_file.seekoff(__computed_off, __way, __mode);
_M_reading = false;
_M_writing = false;
+ _M_ext_next = _M_ext_end = _M_ext_buf;
_M_set_buffer(-1);
}
_M_last_overflowed = false;
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 3cc4ac1fd33..db8f9c92525 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -371,7 +371,10 @@ namespace std
// Callbacks;
/**
- * @doctodo
+ * @brief The set of events that may be passed to an event callback.
+ *
+ * erase_event is used during ~ios() and copyfmt(). imbue_event is used
+ * during imbue(). copyfmt_event is used during copyfmt().
*/
enum event
{
@@ -381,12 +384,26 @@ namespace std
};
/**
- * @doctodo
+ * @brief The type of an event callback function.
+ * @param event One of the members of the event enum.
+ * @param ios_base Reference to the ios_base object.
+ * @param int The integer provided when the callback was registered.
+ *
+ * Event callbacks are user defined functions that get called during
+ * several ios_base and basic_ios functions, specifically imbue(),
+ * copyfmt(), and ~ios().
*/
typedef void (*event_callback) (event, ios_base&, int);
/**
- * @doctodo
+ * @brief Add the callback __fn with parameter __index.
+ * @param __fn The function to add.
+ * @param __index The integer to pass to the function when invoked.
+ *
+ * Registers a function as an event callback with an integer parameter to
+ * be passed to the function when invoked. Multiple copies of the
+ * function are allowed. If there are multiple callbacks, they are
+ * invoked in the order they were registered.
*/
void
register_callback(event_callback __fn, int __index);
@@ -621,8 +638,8 @@ namespace std
* @param loc The new locale.
* @return The previous locale.
*
- * Sets the new locale for this stream, and
- * [XXX does something with callbacks].
+ * Sets the new locale for this stream, and then invokes each callback
+ * with imbue_event.
*/
locale
imbue(const locale& __loc);
@@ -650,13 +667,34 @@ namespace std
// [27.4.2.5] ios_base storage functions
/**
- * @doctodo
+ * @brief Access to unique indices.
+ * @return An integer different from all previous calls.
+ *
+ * This function returns a unique integer every time it is called. It
+ * can be used for any purpose, but is primarily intended to be a unique
+ * index for the iword and pword functions. The expectation is that an
+ * application calls xalloc in order to obtain an index in the iword and
+ * pword arrays that can be used without fear of conflict.
+ *
+ * The implementation maintains a static variable that is incremented and
+ * returned on each invocation. xalloc is guaranteed to return an index
+ * that is safe to use in the iword and pword arrays.
*/
static int
xalloc() throw();
/**
- * @doctodo
+ * @brief Access to integer array.
+ * @param __ix Index into the array.
+ * @return A reference to an integer associated with the index.
+ *
+ * The iword function provides access to an array of integers that can be
+ * used for any purpose. The array grows as required to hold the
+ * supplied index. All integers in the array are initialized to 0.
+ *
+ * The implementation reserves several indices. You should use xalloc to
+ * obtain an index that is safe to use. Also note that since the array
+ * can grow dynamically, it is not safe to hold onto the reference.
*/
inline long&
iword(int __ix)
@@ -667,7 +705,17 @@ namespace std
}
/**
- * @doctodo
+ * @brief Access to void pointer array.
+ * @param __ix Index into the array.
+ * @return A reference to a void* associated with the index.
+ *
+ * The pword function provides access to an array of pointers that can be
+ * used for any purpose. The array grows as required to hold the
+ * supplied index. All pointers in the array are initialized to 0.
+ *
+ * The implementation reserves several indices. You should use xalloc to
+ * obtain an index that is safe to use. Also note that since the array
+ * can grow dynamically, it is not safe to hold onto the reference.
*/
inline void*&
pword(int __ix)
@@ -679,8 +727,12 @@ namespace std
// Destructor
/**
- * Destroys local storage and
- * [XXX does something with callbacks].
+ * Invokes each callback with erase_event. Destroys local storage.
+ *
+ * Note that the ios_base object for the standard streams never gets
+ * destroyed. As a result, any callbacks registered with the standard
+ * streams will not get invoked with erase_event (unless copyfmt is
+ * used).
*/
virtual ~ios_base();
diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc
index 7f26f645ef5..e6677c523a4 100644
--- a/libstdc++-v3/include/bits/istream.tcc
+++ b/libstdc++-v3/include/bits/istream.tcc
@@ -56,10 +56,10 @@ namespace std
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sgetc();
- __check_facet(__in._M_ctype);
+ const __ctype_type& __ct = __check_facet(__in._M_ctype);
while (!traits_type::eq_int_type(__c, __eof)
- && __in._M_ctype->is(ctype_base::space,
- traits_type::to_char_type(__c)))
+ && __ct.is(ctype_base::space,
+ traits_type::to_char_type(__c)))
__c = __sb->snextc();
#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -117,7 +117,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -142,9 +143,10 @@ namespace std
{
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
long __l;
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __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);
#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
if (!(__err & ios_base::failbit)
@@ -179,7 +181,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -204,9 +207,10 @@ namespace std
{
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
long __l;
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __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);
#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
if (!(__err & ios_base::failbit)
@@ -241,7 +245,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -267,7 +272,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -293,7 +299,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -320,7 +327,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -346,7 +354,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -373,7 +382,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -399,7 +409,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -425,7 +436,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -451,7 +463,8 @@ namespace std
try
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- __check_facet(this->_M_num_get).get(*this, 0, *this, __err, __n);
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __n);
this->setstate(__err);
}
catch(...)
@@ -785,8 +798,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return *this;
}
@@ -821,8 +832,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return _M_gcount;
}
@@ -855,8 +864,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return *this;
}
@@ -889,8 +896,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return *this;
}
@@ -1001,8 +1006,6 @@ namespace std
__throw_exception_again;
}
}
- else
- __in.setstate(ios_base::failbit);
return __in;
}
@@ -1027,14 +1030,16 @@ namespace std
if (__num <= 0)
__num = numeric_limits<streamsize>::max();
- const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc());
+ 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 < __num - 1
&& !_Traits::eq_int_type(__c, __eof)
- && !__ctype.is(ctype_base::space, _Traits::to_char_type(__c)))
+ && !__ct.is(ctype_base::space,
+ _Traits::to_char_type(__c)))
{
*__s++ = _Traits::to_char_type(__c);
++__extracted;
@@ -1073,13 +1078,13 @@ namespace std
typedef typename __istream_type::__ctype_type __ctype_type;
typedef typename __istream_type::int_type __int_type;
- const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc());
+ 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 (!_Traits::eq_int_type(__c, __eof)
- && __ctype.is(ctype_base::space, _Traits::to_char_type(__c)))
+ && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
__c = __sb->snextc();
if (_Traits::eq_int_type(__c, __eof))
@@ -1110,14 +1115,14 @@ namespace std
__size_type __n;
__n = __w > 0 ? static_cast<__size_type>(__w) : __str.max_size();
- const __ctype_type& __ctype = use_facet<__ctype_type>(__in.getloc());
+ 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)
- && !__ctype.is(ctype_base::space, _Traits::to_char_type(__c)))
+ && !__ct.is(ctype_base::space, _Traits::to_char_type(__c)))
{
__str += _Traits::to_char_type(__c);
++__extracted;
@@ -1161,8 +1166,7 @@ namespace std
const __int_type __eof = _Traits::eof();
__testdelim = _Traits::eq_int_type(__c, __idelim);
- while (__extracted <= __n
- && !_Traits::eq_int_type(__c, __eof)
+ while (__extracted <= __n && !_Traits::eq_int_type(__c, __eof)
&& !__testdelim)
{
__str += _Traits::to_char_type(__c);
diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h
index 362e38f2767..b93cfb38142 100644
--- a/libstdc++-v3/include/bits/locale_classes.h
+++ b/libstdc++-v3/include/bits/locale_classes.h
@@ -73,8 +73,7 @@ namespace std
use_facet(const locale&);
template<typename _Cache>
- friend const _Cache&
- __use_cache(const locale& __loc);
+ friend struct __use_cache;
// Category values:
// NB: Order must match _S_facet_categories definition in locale.cc
@@ -298,8 +297,7 @@ namespace std
use_facet(const locale&);
template<typename _Cache>
- friend const _Cache&
- __use_cache(const locale& __loc);
+ friend struct __use_cache;
private:
// Data Members.
@@ -370,7 +368,7 @@ namespace std
{ _M_install_facet(&_Facet::id, __facet); }
void
- _M_install_cache(const facet* __cache, size_t __index)
+ _M_install_cache(const facet* __cache, size_t __index) throw()
{
__cache->_M_add_reference();
_M_caches[__index] = __cache;
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index 6b5a99d4ff0..234a0cf269e 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -225,7 +225,7 @@ namespace std
protected:
explicit
- __ctype_abstract_base(size_t __refs = 0): locale::facet(__refs) { }
+ __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
virtual
~__ctype_abstract_base() { }
@@ -557,15 +557,19 @@ namespace std
static const char* _S_atoms_out;
// String literal of acceptable (narrow) input, for num_get.
- // "0123456789eEabcdfABCDF"
+ // "-+xX0123456789eEabcdfABCDF"
static const char* _S_atoms_in;
enum
{
+ _S_iminus,
+ _S_iplus,
+ _S_ix,
+ _S_iX,
_S_izero,
_S_ie = _S_izero + 10,
_S_iE = _S_izero + 11,
- _S_iend = 21 + 1
+ _S_iend = 26
};
// num_put
@@ -577,34 +581,31 @@ namespace std
template<typename _CharT>
struct __numpunct_cache : public locale::facet
{
- // Types:
- typedef _CharT char_type;
-
const char* _M_grouping;
bool _M_use_grouping;
- const char_type* _M_truename;
- const char_type* _M_falsename;
- char_type _M_decimal_point;
- char_type _M_thousands_sep;
+ const _CharT* _M_truename;
+ const _CharT* _M_falsename;
+ _CharT _M_decimal_point;
+ _CharT _M_thousands_sep;
// A list of valid numeric literals for output: in the standard
// "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
- char_type _M_atoms_out[__num_base::_S_oend + 1];
+ _CharT _M_atoms_out[__num_base::_S_oend + 1];
- // A list of valid numeric literals for output: in the standard
- // "C" locale, this is "0123456789eEabcdfABCDF"
+ // A list of valid numeric literals for input: in the standard
+ // "C" locale, this is "-+xX0123456789eEabcdfABCDF"
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
- char_type _M_atoms_in[__num_base::_S_iend + 1];
+ _CharT _M_atoms_in[__num_base::_S_iend + 1];
bool _M_allocated;
- __numpunct_cache(size_t __refs = 0) : locale::facet(__refs),
+ __numpunct_cache(size_t __refs = 0) : facet(__refs),
_M_grouping(NULL), _M_use_grouping(false), _M_truename(NULL),
- _M_falsename(NULL), _M_decimal_point(char_type()),
- _M_thousands_sep(char_type()), _M_allocated(false)
+ _M_falsename(NULL), _M_decimal_point(_CharT()),
+ _M_thousands_sep(_CharT()), _M_allocated(false)
{ }
~__numpunct_cache();
@@ -691,7 +692,7 @@ namespace std
explicit
numpunct(__c_locale __cloc, size_t __refs = 0)
- : locale::facet(__refs), _M_data(NULL)
+ : facet(__refs), _M_data(NULL)
{ _M_initialize_numpunct(__cloc); }
char_type
@@ -776,14 +777,14 @@ namespace std
numpunct_byname(const char* __s, size_t __refs = 0)
: numpunct<_CharT>(__refs)
{
- _S_create_c_locale(_M_c_locale_numpunct, __s);
- _M_initialize_numpunct(_M_c_locale_numpunct);
+ this->_S_create_c_locale(_M_c_locale_numpunct, __s);
+ this->_M_initialize_numpunct(_M_c_locale_numpunct);
}
protected:
virtual
~numpunct_byname()
- { _S_destroy_c_locale(_M_c_locale_numpunct); }
+ { this->_S_destroy_c_locale(_M_c_locale_numpunct); }
};
template<typename _CharT, typename _InIter>
@@ -797,7 +798,7 @@ namespace std
static locale::id id;
explicit
- num_get(size_t __refs = 0) : locale::facet(__refs) { }
+ num_get(size_t __refs = 0) : facet(__refs) { }
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
@@ -916,22 +917,6 @@ namespace std
template<typename _CharT, typename _InIter>
locale::id num_get<_CharT, _InIter>::id;
-#if 0
- // Partial specialization for istreambuf_iterator, so can use traits_type.
- template<typename _CharT>
- class num_get<_CharT, istreambuf_iterator<_CharT> >;
-
- iter_type
- _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;
-
- virtual iter_type
- do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
-#endif
template<typename _CharT, typename _OutIter>
class num_put : public locale::facet, public __num_base
@@ -943,7 +928,7 @@ namespace std
static locale::id id;
explicit
- num_put(size_t __refs = 0) : locale::facet(__refs) { }
+ num_put(size_t __refs = 0) : facet(__refs) { }
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
@@ -986,8 +971,8 @@ namespace std
protected:
template<typename _ValueT>
iter_type
- _M_convert_float(iter_type, ios_base& __io, char_type __fill,
- char __mod, _ValueT __v) const;
+ _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+ char __mod, _ValueT __v) const;
void
_M_group_float(const string& __grouping, char_type __sep,
@@ -996,8 +981,8 @@ namespace std
template<typename _ValueT>
iter_type
- _M_convert_int(iter_type, ios_base& __io, char_type __fill,
- _ValueT __v) const;
+ _M_insert_int(iter_type, ios_base& __io, char_type __fill,
+ _ValueT __v) const;
void
_M_group_int(const string& __grouping, char_type __sep,
@@ -1060,12 +1045,12 @@ namespace std
explicit
collate(size_t __refs = 0)
- : locale::facet(__refs)
+ : facet(__refs)
{ _M_c_locale_collate = _S_c_locale; }
explicit
collate(__c_locale __cloc, size_t __refs = 0)
- : locale::facet(__refs)
+ : facet(__refs)
{ _M_c_locale_collate = _S_clone_c_locale(__cloc); }
int
@@ -1137,8 +1122,8 @@ namespace std
collate_byname(const char* __s, size_t __refs = 0)
: collate<_CharT>(__refs)
{
- _S_destroy_c_locale(this->_M_c_locale_collate);
- _S_create_c_locale(this->_M_c_locale_collate, __s);
+ this->_S_destroy_c_locale(this->_M_c_locale_collate);
+ this->_S_create_c_locale(this->_M_c_locale_collate, __s);
}
protected:
@@ -1154,21 +1139,11 @@ namespace std
};
template<typename _CharT>
- class __timepunct : public locale::facet
+ struct __timepunct_cache : public locale::facet
{
- public:
- // Types:
- typedef _CharT __char_type;
- typedef basic_string<_CharT> __string_type;
-
- static locale::id id;
-
// List of all known timezones, with GMT first.
static const _CharT* _S_timezones[14];
- protected:
- __c_locale _M_c_locale_timepunct;
- char* _M_name_timepunct;
const _CharT* _M_date_format;
const _CharT* _M_date_era_format;
const _CharT* _M_time_format;
@@ -1189,13 +1164,13 @@ namespace std
const _CharT* _M_day7;
// Abbreviated day names, starting with "C"'s Sun.
- const _CharT* _M_day_a1;
- const _CharT* _M_day_a2;
- const _CharT* _M_day_a3;
- const _CharT* _M_day_a4;
- const _CharT* _M_day_a5;
- const _CharT* _M_day_a6;
- const _CharT* _M_day_a7;
+ const _CharT* _M_aday1;
+ const _CharT* _M_aday2;
+ const _CharT* _M_aday3;
+ const _CharT* _M_aday4;
+ const _CharT* _M_aday5;
+ const _CharT* _M_aday6;
+ const _CharT* _M_aday7;
// Month names, starting with "C"'s January.
const _CharT* _M_month01;
@@ -1212,24 +1187,92 @@ namespace std
const _CharT* _M_month12;
// Abbreviated month names, starting with "C"'s Jan.
- const _CharT* _M_month_a01;
- const _CharT* _M_month_a02;
- const _CharT* _M_month_a03;
- const _CharT* _M_month_a04;
- const _CharT* _M_month_a05;
- const _CharT* _M_month_a06;
- const _CharT* _M_month_a07;
- const _CharT* _M_month_a08;
- const _CharT* _M_month_a09;
- const _CharT* _M_month_a10;
- const _CharT* _M_month_a11;
- const _CharT* _M_month_a12;
+ const _CharT* _M_amonth01;
+ const _CharT* _M_amonth02;
+ const _CharT* _M_amonth03;
+ const _CharT* _M_amonth04;
+ const _CharT* _M_amonth05;
+ const _CharT* _M_amonth06;
+ const _CharT* _M_amonth07;
+ const _CharT* _M_amonth08;
+ const _CharT* _M_amonth09;
+ const _CharT* _M_amonth10;
+ const _CharT* _M_amonth11;
+ const _CharT* _M_amonth12;
+
+ bool _M_allocated;
+
+ __timepunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_date_format(NULL), _M_date_era_format(NULL), _M_time_format(NULL),
+ _M_time_era_format(NULL), _M_date_time_format(NULL),
+ _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL),
+ _M_am_pm_format(NULL), _M_day1(NULL), _M_day2(NULL), _M_day3(NULL),
+ _M_day4(NULL), _M_day5(NULL), _M_day6(NULL), _M_day7(NULL),
+ _M_aday1(NULL), _M_aday2(NULL), _M_aday3(NULL), _M_aday4(NULL),
+ _M_aday5(NULL), _M_aday6(NULL), _M_aday7(NULL), _M_month01(NULL),
+ _M_month02(NULL), _M_month03(NULL), _M_month04(NULL), _M_month05(NULL),
+ _M_month06(NULL), _M_month07(NULL), _M_month08(NULL), _M_month09(NULL),
+ _M_month10(NULL), _M_month11(NULL), _M_month12(NULL), _M_amonth01(NULL),
+ _M_amonth02(NULL), _M_amonth03(NULL), _M_amonth04(NULL),
+ _M_amonth05(NULL), _M_amonth06(NULL), _M_amonth07(NULL),
+ _M_amonth08(NULL), _M_amonth09(NULL), _M_amonth10(NULL),
+ _M_amonth11(NULL), _M_amonth12(NULL), _M_allocated(false)
+ { }
+
+ ~__timepunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+ };
+
+ template<typename _CharT>
+ __timepunct_cache<_CharT>::~__timepunct_cache()
+ {
+ if (_M_allocated)
+ {
+ // XXX.
+ }
+ }
+
+ // Specializations.
+ template<>
+ const char*
+ __timepunct_cache<char>::_S_timezones[14];
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ const wchar_t*
+ __timepunct_cache<wchar_t>::_S_timezones[14];
+#endif
+
+ // Generic.
+ template<typename _CharT>
+ const _CharT* __timepunct_cache<_CharT>::_S_timezones[14];
+
+ template<typename _CharT>
+ class __timepunct : public locale::facet
+ {
+ public:
+ // Types:
+ typedef _CharT __char_type;
+ typedef basic_string<_CharT> __string_type;
+ typedef __timepunct_cache<_CharT> __cache_type;
+
+ protected:
+ __cache_type* _M_data;
+ __c_locale _M_c_locale_timepunct;
+ char* _M_name_timepunct;
public:
+ static locale::id id;
+
explicit
__timepunct(size_t __refs = 0);
explicit
+ __timepunct(__cache_type* __cache, size_t __refs = 0);
+
+ explicit
__timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0);
void
@@ -1240,89 +1283,89 @@ namespace std
_M_date_formats(const _CharT** __date) const
{
// Always have default first.
- __date[0] = _M_date_format;
- __date[1] = _M_date_era_format;
+ __date[0] = _M_data->_M_date_format;
+ __date[1] = _M_data->_M_date_era_format;
}
void
_M_time_formats(const _CharT** __time) const
{
// Always have default first.
- __time[0] = _M_time_format;
- __time[1] = _M_time_era_format;
+ __time[0] = _M_data->_M_time_format;
+ __time[1] = _M_data->_M_time_era_format;
}
void
_M_ampm(const _CharT** __ampm) const
{
- __ampm[0] = _M_am;
- __ampm[1] = _M_pm;
+ __ampm[0] = _M_data->_M_am;
+ __ampm[1] = _M_data->_M_pm;
}
void
_M_date_time_formats(const _CharT** __dt) const
{
// Always have default first.
- __dt[0] = _M_date_time_format;
- __dt[1] = _M_date_time_era_format;
+ __dt[0] = _M_data->_M_date_time_format;
+ __dt[1] = _M_data->_M_date_time_era_format;
}
void
_M_days(const _CharT** __days) const
{
- __days[0] = _M_day1;
- __days[1] = _M_day2;
- __days[2] = _M_day3;
- __days[3] = _M_day4;
- __days[4] = _M_day5;
- __days[5] = _M_day6;
- __days[6] = _M_day7;
+ __days[0] = _M_data->_M_day1;
+ __days[1] = _M_data->_M_day2;
+ __days[2] = _M_data->_M_day3;
+ __days[3] = _M_data->_M_day4;
+ __days[4] = _M_data->_M_day5;
+ __days[5] = _M_data->_M_day6;
+ __days[6] = _M_data->_M_day7;
}
void
_M_days_abbreviated(const _CharT** __days) const
{
- __days[0] = _M_day_a1;
- __days[1] = _M_day_a2;
- __days[2] = _M_day_a3;
- __days[3] = _M_day_a4;
- __days[4] = _M_day_a5;
- __days[5] = _M_day_a6;
- __days[6] = _M_day_a7;
+ __days[0] = _M_data->_M_aday1;
+ __days[1] = _M_data->_M_aday2;
+ __days[2] = _M_data->_M_aday3;
+ __days[3] = _M_data->_M_aday4;
+ __days[4] = _M_data->_M_aday5;
+ __days[5] = _M_data->_M_aday6;
+ __days[6] = _M_data->_M_aday7;
}
void
_M_months(const _CharT** __months) const
{
- __months[0] = _M_month01;
- __months[1] = _M_month02;
- __months[2] = _M_month03;
- __months[3] = _M_month04;
- __months[4] = _M_month05;
- __months[5] = _M_month06;
- __months[6] = _M_month07;
- __months[7] = _M_month08;
- __months[8] = _M_month09;
- __months[9] = _M_month10;
- __months[10] = _M_month11;
- __months[11] = _M_month12;
+ __months[0] = _M_data->_M_month01;
+ __months[1] = _M_data->_M_month02;
+ __months[2] = _M_data->_M_month03;
+ __months[3] = _M_data->_M_month04;
+ __months[4] = _M_data->_M_month05;
+ __months[5] = _M_data->_M_month06;
+ __months[6] = _M_data->_M_month07;
+ __months[7] = _M_data->_M_month08;
+ __months[8] = _M_data->_M_month09;
+ __months[9] = _M_data->_M_month10;
+ __months[10] = _M_data->_M_month11;
+ __months[11] = _M_data->_M_month12;
}
void
_M_months_abbreviated(const _CharT** __months) const
{
- __months[0] = _M_month_a01;
- __months[1] = _M_month_a02;
- __months[2] = _M_month_a03;
- __months[3] = _M_month_a04;
- __months[4] = _M_month_a05;
- __months[5] = _M_month_a06;
- __months[6] = _M_month_a07;
- __months[7] = _M_month_a08;
- __months[8] = _M_month_a09;
- __months[9] = _M_month_a10;
- __months[10] = _M_month_a11;
- __months[11] = _M_month_a12;
+ __months[0] = _M_data->_M_amonth01;
+ __months[1] = _M_data->_M_amonth02;
+ __months[2] = _M_data->_M_amonth03;
+ __months[3] = _M_data->_M_amonth04;
+ __months[4] = _M_data->_M_amonth05;
+ __months[5] = _M_data->_M_amonth06;
+ __months[6] = _M_data->_M_amonth07;
+ __months[7] = _M_data->_M_amonth08;
+ __months[8] = _M_data->_M_amonth09;
+ __months[9] = _M_data->_M_amonth10;
+ __months[10] = _M_data->_M_amonth11;
+ __months[11] = _M_data->_M_amonth12;
}
protected:
@@ -1339,10 +1382,6 @@ namespace std
// Specializations.
template<>
- const char*
- __timepunct<char>::_S_timezones[14];
-
- template<>
void
__timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);
@@ -1352,10 +1391,6 @@ namespace std
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
- const wchar_t*
- __timepunct<wchar_t>::_S_timezones[14];
-
- template<>
void
__timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);
@@ -1365,10 +1400,6 @@ namespace std
const tm*) const;
#endif
- // Generic.
- template<typename _CharT>
- const _CharT* __timepunct<_CharT>::_S_timezones[14];
-
// Include host and configuration specific timepunct functions.
#include <bits/time_members.h>
@@ -1385,7 +1416,7 @@ namespace std
explicit
time_get(size_t __refs = 0)
- : locale::facet (__refs) { }
+ : facet (__refs) { }
dateorder
date_order() const
@@ -1496,7 +1527,7 @@ namespace std
explicit
time_put(size_t __refs = 0)
- : locale::facet(__refs) { }
+ : facet(__refs) { }
iter_type
put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
@@ -1553,36 +1584,73 @@ namespace std
_S_construct_pattern(char __precedes, char __space, char __posn);
};
+ template<typename _CharT>
+ struct __moneypunct_cache : public locale::facet
+ {
+ const char* _M_grouping;
+ bool _M_use_grouping;
+ _CharT _M_decimal_point;
+ _CharT _M_thousands_sep;
+ const _CharT* _M_curr_symbol;
+ const _CharT* _M_positive_sign;
+ const _CharT* _M_negative_sign;
+ int _M_frac_digits;
+ money_base::pattern _M_pos_format;
+ money_base::pattern _M_neg_format;
+
+ bool _M_allocated;
+
+ __moneypunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_grouping(NULL), _M_use_grouping(false), _M_decimal_point(_CharT()),
+ _M_thousands_sep(_CharT()), _M_curr_symbol(NULL), _M_positive_sign(NULL),
+ _M_negative_sign(NULL), _M_frac_digits(0),
+ _M_pos_format(money_base::pattern()),
+ _M_neg_format(money_base::pattern()), _M_allocated(false)
+ { }
+
+ ~__moneypunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+ };
+
+ template<typename _CharT>
+ __moneypunct_cache<_CharT>::~__moneypunct_cache()
+ {
+ if (_M_allocated)
+ {
+ // XXX.
+ }
+ }
+
template<typename _CharT, bool _Intl>
class moneypunct : public locale::facet, public money_base
{
public:
// Types:
- typedef _CharT char_type;
+ typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
+ typedef __moneypunct_cache<_CharT> __cache_type;
+
+ private:
+ __cache_type* _M_data;
+ public:
static const bool intl = _Intl;
static locale::id id;
- private:
- const char* _M_grouping;
- char_type _M_decimal_point;
- char_type _M_thousands_sep;
- const char_type* _M_curr_symbol;
- const char_type* _M_positive_sign;
- const char_type* _M_negative_sign;
- int _M_frac_digits;
- pattern _M_pos_format;
- pattern _M_neg_format;
+ explicit
+ moneypunct(size_t __refs = 0) : facet(__refs), _M_data(NULL)
+ { _M_initialize_moneypunct(); }
- public:
explicit
- moneypunct(size_t __refs = 0) : locale::facet(__refs)
+ moneypunct(__cache_type* __cache, size_t __refs = 0)
+ : facet(__refs), _M_data(__cache)
{ _M_initialize_moneypunct(); }
explicit
moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL)
{ _M_initialize_moneypunct(__cloc, __s); }
char_type
@@ -1627,39 +1695,39 @@ namespace std
virtual char_type
do_decimal_point() const
- { return _M_decimal_point; }
+ { return _M_data->_M_decimal_point; }
virtual char_type
do_thousands_sep() const
- { return _M_thousands_sep; }
+ { return _M_data->_M_thousands_sep; }
virtual string
do_grouping() const
- { return _M_grouping; }
+ { return _M_data->_M_grouping; }
virtual string_type
do_curr_symbol() const
- { return _M_curr_symbol; }
+ { return _M_data->_M_curr_symbol; }
virtual string_type
do_positive_sign() const
- { return _M_positive_sign; }
+ { return _M_data->_M_positive_sign; }
virtual string_type
do_negative_sign() const
- { return _M_negative_sign; }
+ { return _M_data->_M_negative_sign; }
virtual int
do_frac_digits() const
- { return _M_frac_digits; }
+ { return _M_data->_M_frac_digits; }
virtual pattern
do_pos_format() const
- { return _M_pos_format; }
+ { return _M_data->_M_pos_format; }
virtual pattern
do_neg_format() const
- { return _M_neg_format; }
+ { return _M_data->_M_neg_format; }
// For use at construction time only.
void
@@ -1720,14 +1788,14 @@ namespace std
moneypunct_byname(const char* __s, size_t __refs = 0)
: moneypunct<_CharT, _Intl>(__refs)
{
- _S_create_c_locale(_M_c_locale_moneypunct, __s);
- _M_initialize_moneypunct(_M_c_locale_moneypunct);
+ this->_S_create_c_locale(_M_c_locale_moneypunct, __s);
+ this->_M_initialize_moneypunct(_M_c_locale_moneypunct);
}
protected:
virtual
~moneypunct_byname()
- { _S_destroy_c_locale(_M_c_locale_moneypunct); }
+ { this->_S_destroy_c_locale(_M_c_locale_moneypunct); }
};
template<typename _CharT, bool _Intl>
@@ -1745,7 +1813,7 @@ namespace std
static locale::id id;
explicit
- money_get(size_t __refs = 0) : locale::facet(__refs) { }
+ money_get(size_t __refs = 0) : facet(__refs) { }
iter_type
get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
@@ -1784,7 +1852,7 @@ namespace std
static locale::id id;
explicit
- money_put(size_t __refs = 0) : locale::facet(__refs) { }
+ money_put(size_t __refs = 0) : facet(__refs) { }
iter_type
put(iter_type __s, bool __intl, ios_base& __io,
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 97cec3f313d..e76ac84ea71 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -89,48 +89,67 @@ namespace std
// Routine to access a cache for the facet. If the cache didn't
// exist before, it gets constructed on the fly.
template<typename _Facet>
- const _Facet&
- __use_cache(const locale& __loc);
-
- template<>
- const __numpunct_cache<char>&
- __use_cache(const locale& __loc);
+ struct __use_cache
+ {
+ const _Facet*
+ operator() (const locale& __loc) const;
+ };
-#ifdef _GLIBCXX_USE_WCHAR_T
- template<>
- const __numpunct_cache<wchar_t>&
- __use_cache(const locale& __loc);
-#endif
+ template<typename _CharT>
+ struct __use_cache<__numpunct_cache<_CharT> >
+ {
+ const __numpunct_cache<_CharT>*
+ operator() (const locale& __loc) const
+ {
+ size_t __i = numpunct<_CharT>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<_CharT>* __tmp;
+ try
+ {
+ __tmp = new __numpunct_cache<_CharT>;
+ __tmp->_M_cache(__loc);
+ }
+ catch(...)
+ {
+ delete __tmp;
+ __throw_exception_again;
+ }
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
+ }
+ };
- // Stage 1: Determine a conversion specifier.
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
_M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
ios_base::iostate& __err, string& __xtrc) const
{
- typedef char_traits<_CharT> __traits_type;
- const locale __loc = __io.getloc();
- const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
- const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+ 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;
// First check for sign.
- const char_type __plus = __ctype.widen('+');
- const char_type __minus = __ctype.widen('-');
int __pos = 0;
char_type __c = *__beg;
- if ((__traits_type::eq(__c, __plus) || __traits_type::eq(__c, __minus))
+ bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
+ if ((__plus || __traits_type::eq(__c, __lit[_S_iminus]))
&& __beg != __end)
{
- __xtrc += __ctype.narrow(__c, char());
+ __xtrc += __plus ? _S_atoms_in[_S_iplus] : _S_atoms_in[_S_iminus];
++__pos;
__c = *(++__beg);
}
// Next, strip leading zeros.
- const char_type __zero = __ctype.widen(_S_atoms_in[_S_izero]);
bool __found_zero = false;
- while (__traits_type::eq(__c, __zero) && __beg != __end)
+ while (__traits_type::eq(__c, __lit[_S_izero]) && __beg != __end)
{
__c = *(++__beg);
__found_zero = true;
@@ -142,35 +161,29 @@ namespace std
}
// Only need acceptable digits for floating point numbers.
- const size_t __len = _S_iE - _S_izero + 1;
- char_type __watoms[__len];
- __ctype.widen(_S_atoms_in, _S_atoms_in + __len, __watoms);
bool __found_dec = false;
bool __found_sci = false;
- const char_type __dec = __np.decimal_point();
-
string __found_grouping;
- const string __grouping = __np.grouping();
- bool __check_grouping = __grouping.size();
+ const size_t __len = _S_iE - _S_izero + 1;
int __sep_pos = 0;
- const char_type __sep = __np.thousands_sep();
-
+ bool __e;
while (__beg != __end)
{
// Only look in digits.
- const char_type* __p = __traits_type::find(__watoms, 10, __c);
+ 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()))
{
// Try first for acceptable digit; record it if found.
++__pos;
- __xtrc += _S_atoms_in[__p - __watoms];
+ __xtrc += _S_atoms_in[__p - __lit];
++__sep_pos;
__c = *(++__beg);
}
- else if (__traits_type::eq(__c, __sep)
- && __check_grouping && !__found_dec)
+ else if (__traits_type::eq(__c, __lc->_M_thousands_sep)
+ && __lc->_M_use_grouping && !__found_dec)
{
// NB: Thousands separator at the beginning of a string
// is a no-no, as is two consecutive thousands separators.
@@ -186,7 +199,8 @@ namespace std
break;
}
}
- else if (__traits_type::eq(__c, __dec) && !__found_dec)
+ else if (__traits_type::eq(__c, __lc->_M_decimal_point)
+ && !__found_dec)
{
// According to the standard, if no grouping chars are seen,
// no grouping check is applied. Therefore __found_grouping
@@ -198,21 +212,22 @@ namespace std
__c = *(++__beg);
__found_dec = true;
}
- else if ((__traits_type::eq(__c, __watoms[_S_ie])
- || __traits_type::eq(__c, __watoms[_S_iE]))
+ else if ((__e = __traits_type::eq(__c, __lit[_S_ie])
+ || __traits_type::eq(__c, __lit[_S_iE]))
&& !__found_sci && __pos)
{
// Scientific notation.
++__pos;
- __xtrc += __ctype.narrow(__c, char());
+ __xtrc += __e ? _S_atoms_in[_S_ie] : _S_atoms_in[_S_iE];
__c = *(++__beg);
// Remove optional plus or minus sign, if they exist.
- if (__traits_type::eq(__c, __plus)
- || __traits_type::eq(__c, __minus))
+ bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
+ if (__plus || __traits_type::eq(__c, __lit[_S_iminus]))
{
++__pos;
- __xtrc += __ctype.narrow(__c, char());
+ __xtrc += __plus ? _S_atoms_in[_S_iplus]
+ : _S_atoms_in[_S_iminus];
__c = *(++__beg);
}
__found_sci = true;
@@ -224,33 +239,36 @@ namespace std
// Digit grouping is checked. If grouping and found_grouping don't
// match, then get very very upset, and set failbit.
- if (__check_grouping && __found_grouping.size())
+ if (__lc->_M_use_grouping && __found_grouping.size())
{
// Add the ending grouping if a decimal wasn't found.
if (!__found_dec)
__found_grouping += static_cast<char>(__sep_pos);
+
+ const string __grouping = __lc->_M_grouping;
if (!std::__verify_grouping(__grouping, __found_grouping))
__err |= ios_base::failbit;
}
- // Finish up
+ // Finish up.
__xtrc += char();
if (__beg == __end)
__err |= ios_base::eofbit;
return __beg;
}
- // Stage 1: Determine a conversion specifier.
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;
- const locale __loc = __io.getloc();
- const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
- const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+ 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.
ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield;
@@ -264,25 +282,20 @@ namespace std
// First check for sign.
int __pos = 0;
char_type __c = *__beg;
- const char_type __plus = __ctype.widen('+');
- const char_type __minus = __ctype.widen('-');
-
- if ((__traits_type::eq(__c, __plus) || __traits_type::eq(__c, __minus))
+ const bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
+ if ((__plus || __traits_type::eq(__c, __lit[_S_iminus]))
&& __beg != __end)
{
- __xtrc += __ctype.narrow(__c, char());
+ __xtrc += __plus ? _S_atoms_in[_S_iplus] : _S_atoms_in[_S_iminus];
++__pos;
__c = *(++__beg);
}
// Next, strip leading zeros and check required digits for base formats.
- const char_type __zero = __ctype.widen(_S_atoms_in[_S_izero]);
- const char_type __x = __ctype.widen('x');
- const char_type __X = __ctype.widen('X');
if (__base == 10)
{
bool __found_zero = false;
- while (__traits_type::eq(__c, __zero) && __beg != __end)
+ while (__traits_type::eq(__c, __lit[_S_izero]) && __beg != __end)
{
__c = *(++__beg);
__found_zero = true;
@@ -293,11 +306,11 @@ namespace std
++__pos;
if (__basefield == 0)
{
- if ((__traits_type::eq(__c, __x)
- || __traits_type::eq(__c, __X))
- && __beg != __end)
+ const bool __x = __traits_type::eq(__c, __lit[_S_ix]);
+ const bool __X = __traits_type::eq(__c, __lit[_S_iX]);
+ if ((__x || __X) && __beg != __end)
{
- __xtrc += __ctype.narrow(__c, char());
+ __xtrc += __x ? _S_atoms_in[_S_ix] : _S_atoms_in[_S_iX];
++__pos;
__c = *(++__beg);
__base = 16;
@@ -309,15 +322,17 @@ namespace std
}
else if (__base == 16)
{
- if (__traits_type::eq(__c, __zero) && __beg != __end)
+ if (__traits_type::eq(__c, __lit[_S_izero]) && __beg != __end)
{
__xtrc += _S_atoms_in[_S_izero];
++__pos;
__c = *(++__beg);
- if ((__traits_type::eq(__c, __x) || __traits_type::eq(__c, __X))
- && __beg != __end)
+
+ const bool __x = __traits_type::eq(__c, __lit[_S_ix]);
+ const bool __X = __traits_type::eq(__c, __lit[_S_iX]);
+ if ((__x || __X) && __beg != __end)
{
- __xtrc += __ctype.narrow(__c, char());
+ __xtrc += __x ? _S_atoms_in[_S_ix] : _S_atoms_in[_S_iX];
++__pos;
__c = *(++__beg);
}
@@ -333,27 +348,24 @@ namespace std
__len = __base;
// Extract.
- char_type __watoms[_S_iend];
- __ctype.widen(_S_atoms_in, _S_atoms_in + __len, __watoms);
string __found_grouping;
- const string __grouping = __np.grouping();
- bool __check_grouping = __grouping.size();
+ const char_type __sep = __lc->_M_thousands_sep;
int __sep_pos = 0;
- const char_type __sep = __np.thousands_sep();
while (__beg != __end)
{
- const char_type* __p = __traits_type::find(__watoms, __len, __c);
+ const char_type* __p = __traits_type::find(__lit + _S_izero,
+ __len, __c);
// 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 - __watoms];
+ __xtrc += _S_atoms_in[__p - __lit];
++__pos;
++__sep_pos;
__c = *(++__beg);
}
- else if (__traits_type::eq(__c, __sep) && __check_grouping)
+ 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.
@@ -376,10 +388,12 @@ namespace std
// Digit grouping is checked. If grouping and found_grouping don't
// match, then get very very upset, and set failbit.
- if (__check_grouping && __found_grouping.size())
+ 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;
}
@@ -399,9 +413,9 @@ namespace std
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, bool& __v) const
{
- // Parse bool values as unsigned long
if (!(__io.flags() & ios_base::boolalpha))
{
+ // Parse bool values as unsigned long.
// NB: We can't just call do_get(long) here, as it might
// refer to a derived class.
string __xtrc;
@@ -409,46 +423,47 @@ namespace std
__beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
unsigned long __ul;
- std::__convert_to_v(__xtrc.c_str(), __ul, __err, _S_c_locale, __base);
+ std::__convert_to_v(__xtrc.c_str(), __ul, __err,
+ _S_c_locale, __base);
if (!(__err & ios_base::failbit) && __ul <= 1)
__v = __ul;
else
__err |= ios_base::failbit;
}
-
- // Parse bool values as alphanumeric
else
{
+ // Parse bool values as alphanumeric.
typedef char_traits<_CharT> __traits_type;
- typedef basic_string<_CharT> __string_type;
-
- locale __loc = __io.getloc();
- const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
- const __string_type __true = __np.truename();
- const __string_type __false = __np.falsename();
- const char_type* __trues = __true.c_str();
- const char_type* __falses = __false.c_str();
- const size_t __truen = __true.size() - 1;
- const size_t __falsen = __false.size() - 1;
+ 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;
+ bool __testf = false;
+ bool __testt = false;
for (size_t __n = 0; __beg != __end; ++__n)
{
char_type __c = *__beg++;
- bool __testf = __n <= __falsen
- ? __traits_type::eq(__c, __falses[__n]) : false;
- bool __testt = __n <= __truen
- ? __traits_type::eq(__c, __trues[__n]) : false;
+
+ if (__n <= __fn)
+ __testf = __traits_type::eq(__c, __lc->_M_falsename[__n]);
+
+ if (__n <= __tn)
+ __testt = __traits_type::eq(__c, __lc->_M_truename[__n]);
+
if (!(__testf || __testt))
{
__err |= ios_base::failbit;
break;
}
- else if (__testf && __n == __falsen)
+ else if (__testf && __n == __fn)
{
__v = 0;
break;
}
- else if (__testt && __n == __truen)
+ else if (__testt && __n == __tn)
{
__v = 1;
break;
@@ -598,7 +613,7 @@ namespace std
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, void*& __v) const
{
- // Prepare for hex formatted input
+ // Prepare for hex formatted input.
typedef ios_base::fmtflags fmtflags;
fmtflags __fmt = __io.flags();
fmtflags __fmtmask = ~(ios_base::showpos | ios_base::basefield
@@ -609,7 +624,7 @@ namespace std
int __base;
__beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
- // Reset from hex formatted input
+ // Reset from hex formatted input.
__io.flags(__fmt);
unsigned long __ul;
@@ -640,7 +655,7 @@ namespace std
template<typename _CharT>
inline int
__int_to_char(_CharT* __out, const int __size, long __v,
- const _CharT* __lit, ios_base::fmtflags __flags)
+ const _CharT* __lit, ios_base::fmtflags __flags)
{
unsigned long __ul = static_cast<unsigned long>(__v);
bool __neg = false;
@@ -655,14 +670,14 @@ namespace std
template<typename _CharT>
inline int
__int_to_char(_CharT* __out, const int __size, unsigned long __v,
- const _CharT* __lit, ios_base::fmtflags __flags)
+ const _CharT* __lit, ios_base::fmtflags __flags)
{ return __int_to_char(__out, __size, __v, __lit, __flags, false); }
#ifdef _GLIBCXX_USE_LONG_LONG
template<typename _CharT>
inline int
__int_to_char(_CharT* __out, const int __size, long long __v,
- const _CharT* __lit, ios_base::fmtflags __flags)
+ const _CharT* __lit, ios_base::fmtflags __flags)
{
unsigned long long __ull = static_cast<unsigned long long>(__v);
bool __neg = false;
@@ -677,7 +692,7 @@ namespace std
template<typename _CharT>
inline int
__int_to_char(_CharT* __out, const int __size, unsigned long long __v,
- const _CharT* __lit, ios_base::fmtflags __flags)
+ const _CharT* __lit, ios_base::fmtflags __flags)
{ return __int_to_char(__out, __size, __v, __lit, __flags, false); }
#endif
@@ -770,10 +785,9 @@ namespace std
*(__new + 1) = *(__cs + 1);
}
_CharT* __p;
- __p = std::__add_grouping(__new + __off, __sep,
- __grouping.c_str(),
- __grouping.c_str() + __grouping.size(),
- __cs + __off, __cs + __len);
+ __p = std::__add_grouping(__new + __off, __sep, __grouping.c_str(),
+ __grouping.c_str() + __grouping.size(),
+ __cs + __off, __cs + __len);
__len = __p - __new;
}
@@ -781,13 +795,14 @@ namespace std
template<typename _ValueT>
_OutIter
num_put<_CharT, _OutIter>::
- _M_convert_int(_OutIter __s, ios_base& __io, _CharT __fill,
+ _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
_ValueT __v) const
{
- typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ __use_cache<__cache_type> __uc;
const locale& __loc = __io._M_getloc();
- const __cache_type& __lc = __use_cache<__cache_type>(__loc);
- const _CharT* __lit = __lc._M_atoms_out;
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_out;
// Long enough to hold hex, dec, and octal representations.
int __ilen = 4 * sizeof(_ValueT);
@@ -801,13 +816,13 @@ namespace std
// Add grouping, if necessary.
_CharT* __cs2;
- if (__lc._M_use_grouping)
+ 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));
- _M_group_int(__lc._M_grouping, __lc._M_thousands_sep, __io,
+ _M_group_int(__lc->_M_grouping, __lc->_M_thousands_sep, __io,
__cs2, __cs, __len);
__cs = __cs2;
}
@@ -840,8 +855,7 @@ namespace std
// Add grouping, if necessary.
_CharT* __p2;
int __declen = __p ? __p - __cs : __len;
- __p2 = std::__add_grouping(__new, __sep,
- __grouping.c_str(),
+ __p2 = std::__add_grouping(__new, __sep, __grouping.c_str(),
__grouping.c_str() + __grouping.size(),
__cs, __cs + __declen);
@@ -870,9 +884,14 @@ namespace std
template<typename _ValueT>
_OutIter
num_put<_CharT, _OutIter>::
- _M_convert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+ _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
_ValueT __v) const
{
+ 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);
+
// Note: digits10 is rounded down: add 1 to ensure the maximum
// available precision. Then, in general, one more 1 needs to
// be added since, when the %{g,G} conversion specifiers are
@@ -889,10 +908,6 @@ namespace std
else if (__prec < static_cast<streamsize>(0))
__prec = static_cast<streamsize>(6);
- typedef typename numpunct<_CharT>::__cache_type __cache_type;
- const locale& __loc = __io._M_getloc();
- const __cache_type& __lc = __use_cache<__cache_type>(__loc);
-
// [22.2.2.2.2] Stage 1, numeric conversion to character.
int __len;
// Long enough for the max format spec.
@@ -921,6 +936,7 @@ namespace std
const bool __fixed = __io.flags() & ios_base::fixed;
const int __max_exp = numeric_limits<_ValueT>::max_exponent10;
+ // The size of the output string is computed as follows.
// ios_base::fixed outputs may need up to __max_exp+1 chars
// for the integer part + up to __max_digits chars for the
// fractional part + 3 chars for sign, decimal point, '\0'. On
@@ -931,7 +947,8 @@ namespace std
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
_S_format_float(__io, __fbuf, __mod);
- __len = std::__convert_from_v(__cs, 0, __fbuf, __v, _S_c_locale, __prec);
+ __len = std::__convert_from_v(__cs, 0, __fbuf, __v,
+ _S_c_locale, __prec);
#endif
// [22.2.2.2.2] Stage 2, convert to char_type, using correct
@@ -944,20 +961,20 @@ namespace std
// Replace decimal point.
const _CharT __cdec = __ctype.widen('.');
- const _CharT __dec = __lc._M_decimal_point;
+ const _CharT __dec = __lc->_M_decimal_point;
const _CharT* __p;
if (__p = char_traits<_CharT>::find(__ws, __len, __cdec))
__ws[__p - __ws] = __dec;
// Add grouping, if necessary.
_CharT* __ws2;
- if (__lc._M_use_grouping)
+ 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));
- _M_group_float(__lc._M_grouping, __lc._M_thousands_sep, __p,
+ _M_group_float(__lc->_M_grouping, __lc->_M_thousands_sep, __p,
__ws2, __ws, __len);
__ws = __ws2;
}
@@ -987,34 +1004,33 @@ namespace std
if ((__flags & ios_base::boolalpha) == 0)
{
unsigned long __uv = __v;
- __s = _M_convert_int(__s, __io, __fill, __uv);
+ __s = _M_insert_int(__s, __io, __fill, __uv);
}
else
{
- typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ __use_cache<__cache_type> __uc;
const locale& __loc = __io._M_getloc();
- const __cache_type& __lc = __use_cache<__cache_type>(__loc);
+ const __cache_type* __lc = __uc(__loc);
- typedef basic_string<_CharT> __string_type;
- __string_type __name;
+ const _CharT* __name;
if (__v)
- __name = __lc._M_truename;
+ __name = __lc->_M_truename;
else
- __name = __lc._M_falsename;
+ __name = __lc->_M_falsename;
+ int __len = char_traits<_CharT>::length(__name);
- const _CharT* __cs = __name.c_str();
- int __len = __name.size();
- _CharT* __cs3;
+ _CharT* __cs;
streamsize __w = __io.width();
if (__w > static_cast<streamsize>(__len))
{
- __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
- _M_pad(__fill, __w, __io, __cs3, __cs, __len);
- __cs = __cs3;
+ _M_pad(__fill, __w, __io, __cs, __name, __len);
+ __name = __cs;
}
__io.width(0);
- __s = std::__write(__s, __cs, __len);
+ __s = std::__write(__s, __name, __len);
}
return __s;
}
@@ -1023,42 +1039,42 @@ namespace std
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
- { return _M_convert_int(__s, __io, __fill, __v); }
+ { return _M_insert_int(__s, __io, __fill, __v); }
template<typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
unsigned long __v) const
- { return _M_convert_int(__s, __io, __fill, __v); }
+ { return _M_insert_int(__s, __io, __fill, __v); }
#ifdef _GLIBCXX_USE_LONG_LONG
template<typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __b, char_type __fill, long long __v) const
- { return _M_convert_int(__s, __b, __fill, __v); }
+ { return _M_insert_int(__s, __b, __fill, __v); }
template<typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
unsigned long long __v) const
- { return _M_convert_int(__s, __io, __fill, __v); }
+ { return _M_insert_int(__s, __io, __fill, __v); }
#endif
template<typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
- { return _M_convert_float(__s, __io, __fill, char(), __v); }
+ { return _M_insert_float(__s, __io, __fill, char(), __v); }
template<typename _CharT, typename _OutIter>
_OutIter
num_put<_CharT, _OutIter>::
do_put(iter_type __s, ios_base& __io, char_type __fill,
long double __v) const
- { return _M_convert_float(__s, __io, __fill, 'L', __v); }
+ { return _M_insert_float(__s, __io, __fill, 'L', __v); }
template<typename _CharT, typename _OutIter>
_OutIter
@@ -1072,8 +1088,8 @@ namespace std
__io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase));
try
{
- __s = _M_convert_int(__s, __io, __fill,
- reinterpret_cast<unsigned long>(__v));
+ __s = _M_insert_int(__s, __io, __fill,
+ reinterpret_cast<unsigned long>(__v));
__io.flags(__flags);
}
catch (...)
@@ -1273,7 +1289,7 @@ namespace std
}
// Strip leading zeros.
- while (!__tmp_units.empty() && __tmp_units[0] == __ctype.widen('0'))
+ while (__tmp_units.size() > 1 && __tmp_units[0] == __ctype.widen('0'))
__tmp_units.erase(__tmp_units.begin());
if (__sign.size() && __sign == __neg_sign)
@@ -1339,7 +1355,8 @@ namespace std
// decimal digit, '\0'.
const int __cs_size = numeric_limits<long double>::max_exponent10 + 5;
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
- int __len = std::__convert_from_v(__cs, 0, "%.01Lf", __units, _S_c_locale);
+ int __len = std::__convert_from_v(__cs, 0, "%.01Lf", __units,
+ _S_c_locale);
#endif
_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __cs_size));
@@ -1684,7 +1701,7 @@ namespace std
{
int __tmp;
_M_extract_name(__beg, __end, __tmp,
- __timepunct<_CharT>::_S_timezones,
+ __timepunct_cache<_CharT>::_S_timezones,
14, __err);
// GMT requires special effort.
@@ -2199,7 +2216,7 @@ namespace std
// Pad after the sign, if there is one.
// Pad after 0[xX], if there is one.
// Who came up with these rules, anyway? Jeeze.
- locale __loc = __io.getloc();
+ const locale& __loc = __io._M_getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const _CharT __minus = __ctype.widen('-');
const _CharT __plus = __ctype.widen('+');
@@ -2221,7 +2238,7 @@ namespace std
}
else if (__testsign)
{
- _Traits::eq((__news[0] = __olds[0]), __plus) ? __plus : __minus;
+ __news[0] = __olds[0];
++__mod;
++__news;
__beg = __pads;
@@ -2244,8 +2261,7 @@ namespace std
__end = const_cast<_CharT*>(__olds);
}
_Traits::copy(__news, __beg, __beglen);
- _Traits::copy(__news + __beglen, __end,
- __newlen - __beglen - __mod);
+ _Traits::copy(__news + __beglen, __end, __newlen - __beglen - __mod);
}
template<typename _CharT>
@@ -2253,10 +2269,10 @@ namespace std
__verify_grouping(const basic_string<_CharT>& __grouping,
basic_string<_CharT>& __grouping_tmp)
{
- int __i = 0;
- int __j = 0;
- const int __len = __grouping.size();
- const int __n = __grouping_tmp.size();
+ size_t __i = 0;
+ size_t __j = 0;
+ const size_t __len = __grouping.size();
+ const size_t __n = __grouping_tmp.size();
bool __test = true;
// Parsed number groupings have to match the
@@ -2280,8 +2296,8 @@ namespace std
{
if (__last - __first > *__gbeg)
{
- __s = std::__add_grouping(__s, __sep,
- (__gbeg + 1 == __gend ? __gbeg : __gbeg + 1),
+ const bool __bump = __gbeg + 1 != __gend;
+ __s = std::__add_grouping(__s, __sep, __gbeg + __bump,
__gend, __first, __last - *__gbeg);
__first = __last - *__gbeg;
*__s++ = __sep;
diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc
index 942a305825c..401b58ff80f 100644
--- a/libstdc++-v3/include/bits/ostream.tcc
+++ b/libstdc++-v3/include/bits/ostream.tcc
@@ -160,9 +160,8 @@ namespace std
{
try
{
- __check_facet(this->_M_num_put);
- if (this->_M_num_put->put(*this, *this, this->fill(),
- __n).failed())
+ 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);
}
catch(...)
@@ -189,14 +188,14 @@ namespace std
bool __b = false;
char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- __check_facet(this->_M_num_put);
+ const __num_put_type& __np = __check_facet(this->_M_num_put);
if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
{
unsigned long __l = static_cast<unsigned long>(__n);
- __b = this->_M_num_put->put(*this, *this, __c, __l).failed();
+ __b = __np.put(*this, *this, __c, __l).failed();
}
else
- __b = this->_M_num_put->put(*this, *this, __c, __n).failed();
+ __b = __np.put(*this, *this, __c, __n).failed();
if (__b)
this->setstate(ios_base::badbit);
}
@@ -221,9 +220,8 @@ namespace std
{
try
{
- __check_facet(this->_M_num_put);
- if (this->_M_num_put->put(*this, *this, this->fill(),
- __n).failed())
+ 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);
}
catch(...)
@@ -251,15 +249,15 @@ namespace std
bool __b = false;
char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- __check_facet(this->_M_num_put);
+ const __num_put_type& __np = __check_facet(this->_M_num_put);
if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
{
unsigned long long __l;
__l = static_cast<unsigned long long>(__n);
- __b = this->_M_num_put->put(*this, *this, __c, __l).failed();
+ __b = __np.put(*this, *this, __c, __l).failed();
}
else
- __b = this->_M_num_put->put(*this, *this, __c, __n).failed();
+ __b = __np.put(*this, *this, __c, __n).failed();
if (__b)
this->setstate(ios_base::badbit);
}
@@ -284,9 +282,8 @@ namespace std
{
try
{
- __check_facet(this->_M_num_put);
- if (this->_M_num_put->put(*this, *this, this->fill(),
- __n).failed())
+ 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);
}
catch(...)
@@ -311,9 +308,8 @@ namespace std
{
try
{
- __check_facet(this->_M_num_put);
- if (this->_M_num_put->put(*this, *this, this->fill(),
- __n).failed())
+ 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);
}
catch(...)
@@ -337,9 +333,8 @@ namespace std
{
try
{
- __check_facet(this->_M_num_put);
- if (this->_M_num_put->put(*this, *this, this->fill(),
- __n).failed())
+ 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);
}
catch(...)
@@ -363,9 +358,8 @@ namespace std
{
try
{
- __check_facet(this->_M_num_put);
- if (this->_M_num_put->put(*this, *this, this->fill(),
- __n).failed())
+ 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);
}
catch(...)
@@ -387,7 +381,7 @@ namespace std
sentry __cerb(*this);
if (__cerb)
{
- int_type __put = rdbuf()->sputc(__c);
+ int_type __put = this->rdbuf()->sputc(__c);
if (traits_type::eq_int_type(__put, traits_type::eof()))
this->setstate(ios_base::badbit);
}
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index f4ba55346e3..7b3fa9d4232 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -946,7 +946,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
// "the type returned by a _Generator"
- __typeof__(gen())>)
+ __typeof__(__gen())>)
for ( ; __n > 0; --__n, ++__first)
*__first = __gen();
@@ -3593,6 +3593,22 @@ namespace std
// that their input ranges are sorted and the postcondition that their output
// ranges are sorted.
+ /**
+ * @brief Determines whether all elements of a sequence exists in a range.
+ * @param first1 Start of search range.
+ * @param last1 End of search range.
+ * @param first2 Start of sequence
+ * @param last2 End of sequence.
+ * @return True if each element in [first2,last2) is contained in order
+ * within [first1,last1). False otherwise.
+ * @ingroup setoperations
+ *
+ * This operation expects both [first1,last1) and [first2,last2) to be
+ * sorted. Searches for the presence of each element in [first2,last2)
+ * within [first1,last1). The iterators over each range only move forward,
+ * so this is a linear algorithm. If an element in [first2,last2) is not
+ * found before the search iterator reaches @a last2, false is returned.
+ */
template<typename _InputIterator1, typename _InputIterator2>
bool
includes(_InputIterator1 __first1, _InputIterator1 __last1,
@@ -3618,6 +3634,25 @@ namespace std
return __first2 == __last2;
}
+ /**
+ * @brief Determines whether all elements of a sequence exists in a range
+ * using comparison.
+ * @param first1 Start of search range.
+ * @param last1 End of search range.
+ * @param first2 Start of sequence
+ * @param last2 End of sequence.
+ * @param comp Comparison function to use.
+ * @return True if each element in [first2,last2) is contained in order
+ * within [first1,last1) according to comp. False otherwise.
+ * @ingroup setoperations
+ *
+ * This operation expects both [first1,last1) and [first2,last2) to be
+ * sorted. Searches for the presence of each element in [first2,last2)
+ * within [first1,last1), using comp to decide. The iterators over each
+ * range only move forward, so this is a linear algorithm. If an element
+ * in [first2,last2) is not found before the search iterator reaches @a
+ * last2, false is returned.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _Compare>
bool
includes(_InputIterator1 __first1, _InputIterator1 __last1,
@@ -3644,6 +3679,23 @@ namespace std
return __first2 == __last2;
}
+ /**
+ * @brief Return the union of two sorted ranges.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * each range in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other,
+ * that element is copied and the iterator advanced. If an element is
+ * contained in both ranges, the element from the first range is copied and
+ * both ranges advance. The output range may not overlap either input
+ * range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator>
_OutputIterator
set_union(_InputIterator1 __first1, _InputIterator1 __last1,
@@ -3680,6 +3732,24 @@ namespace std
return std::copy(__first2, __last2, std::copy(__first1, __last1, __result));
}
+ /**
+ * @brief Return the union of two sorted ranges using a comparison functor.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * each range in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other
+ * according to @a comp, that element is copied and the iterator advanced.
+ * If an equivalent element according to @a comp is contained in both
+ * ranges, the element from the first range is copied and both ranges
+ * advance. The output range may not overlap either input range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator,
typename _Compare>
_OutputIterator
@@ -3718,6 +3788,22 @@ namespace std
return std::copy(__first2, __last2, std::copy(__first1, __last1, __result));
}
+ /**
+ * @brief Return the intersection of two sorted ranges.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * both ranges in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other,
+ * that iterator advances. If an element is contained in both ranges, the
+ * element from the first range is copied and both ranges advance. The
+ * output range may not overlap either input range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator>
_OutputIterator
set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
@@ -3749,6 +3835,25 @@ namespace std
return __result;
}
+ /**
+ * @brief Return the intersection of two sorted ranges using comparison
+ * functor.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * both ranges in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other
+ * according to @a comp, that iterator advances. If an element is
+ * contained in both ranges according to @a comp, the element from the
+ * first range is copied and both ranges advance. The output range may not
+ * overlap either input range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator,
typename _Compare>
_OutputIterator
@@ -3782,6 +3887,24 @@ namespace std
return __result;
}
+ /**
+ * @brief Return the difference of two sorted ranges.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * the first range but not the second in order to the output range.
+ * Iterators increment for each range. When the current element of the
+ * first range is less than the second, that element is copied and the
+ * iterator advances. If the current element of the second range is less,
+ * the iterator advances, but no element is copied. If an element is
+ * contained in both ranges, no elements are copied and both ranges
+ * advance. The output range may not overlap either input range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator>
_OutputIterator
set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
@@ -3814,6 +3937,27 @@ namespace std
return std::copy(__first1, __last1, __result);
}
+ /**
+ * @brief Return the difference of two sorted ranges using comparison
+ * functor.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * the first range but not the second in order to the output range.
+ * Iterators increment for each range. When the current element of the
+ * first range is less than the second according to @a comp, that element
+ * is copied and the iterator advances. If the current element of the
+ * second range is less, no element is copied and the iterator advances.
+ * If an element is contained in both ranges according to @a comp, no
+ * elements are copied and both ranges advance. The output range may not
+ * overlap either input range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator,
typename _Compare>
_OutputIterator
@@ -3848,6 +3992,22 @@ namespace std
return std::copy(__first1, __last1, __result);
}
+ /**
+ * @brief Return the symmetric difference of two sorted ranges.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * one range but not the other in order to the output range. Iterators
+ * increment for each range. When the current element of one range is less
+ * than the other, that element is copied and the iterator advances. If an
+ * element is contained in both ranges, no elements are copied and both
+ * ranges advance. The output range may not overlap either input range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator>
_OutputIterator
set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
@@ -3883,6 +4043,25 @@ namespace std
return std::copy(__first2, __last2, std::copy(__first1, __last1, __result));
}
+ /**
+ * @brief Return the symmetric difference of two sorted ranges using
+ * comparison functor.
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup setoperations
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * one range but not the other in order to the output range. Iterators
+ * increment for each range. When the current element of one range is less
+ * than the other according to @a comp, that element is copied and the
+ * iterator advances. If an element is contained in both ranges according
+ * to @a comp, no elements are copied and both ranges advance. The output
+ * range may not overlap either input range.
+ */
template<typename _InputIterator1, typename _InputIterator2, typename _OutputIterator,
typename _Compare>
_OutputIterator
@@ -3924,6 +4103,12 @@ namespace std
// min_element and max_element, with and without an explicitly supplied
// comparison function.
+ /**
+ * @brief Return the maximum element in a range.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return Iterator referencing the first instance of the largest value.
+ */
template<typename _ForwardIterator>
_ForwardIterator
max_element(_ForwardIterator __first, _ForwardIterator __last)
@@ -3941,6 +4126,14 @@ namespace std
return __result;
}
+ /**
+ * @brief Return the maximum element in a range using comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return Iterator referencing the first instance of the largest value
+ * according to comp.
+ */
template<typename _ForwardIterator, typename _Compare>
_ForwardIterator
max_element(_ForwardIterator __first, _ForwardIterator __last,
@@ -3959,6 +4152,12 @@ namespace std
return __result;
}
+ /**
+ * @brief Return the minimum element in a range.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return Iterator referencing the first instance of the smallest value.
+ */
template<typename _ForwardIterator>
_ForwardIterator
min_element(_ForwardIterator __first, _ForwardIterator __last)
@@ -3976,6 +4175,14 @@ namespace std
return __result;
}
+ /**
+ * @brief Return the minimum element in a range using comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return Iterator referencing the first instance of the smallest value
+ * according to comp.
+ */
template<typename _ForwardIterator, typename _Compare>
_ForwardIterator
min_element(_ForwardIterator __first, _ForwardIterator __last,
@@ -3998,6 +4205,17 @@ namespace std
// next_permutation and prev_permutation, with and without an explicitly
// supplied comparison function.
+ /**
+ * @brief Permute range into the next "dictionary" ordering.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return False if wrapped to first permutation, true otherwise.
+ *
+ * Treats all permutations of the range as a set of "dictionary" sorted
+ * sequences. Permutes the current sequence into the next one of this set.
+ * Returns true if there are more sequences to generate. If the sequence
+ * is the largest of the set, the smallest is generated and false returned.
+ */
template<typename _BidirectionalIterator>
bool
next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
@@ -4034,6 +4252,20 @@ namespace std
}
}
+ /**
+ * @brief Permute range into the next "dictionary" ordering using
+ * comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp
+ * @return False if wrapped to first permutation, true otherwise.
+ *
+ * Treats all permutations of the range [first,last) as a set of
+ * "dictionary" sorted sequences ordered by @a comp. Permutes the current
+ * sequence into the next one of this set. Returns true if there are more
+ * sequences to generate. If the sequence is the largest of the set, the
+ * smallest is generated and false returned.
+ */
template<typename _BidirectionalIterator, typename _Compare>
bool
next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last,
@@ -4072,6 +4304,18 @@ namespace std
}
}
+ /**
+ * @brief Permute range into the previous "dictionary" ordering.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return False if wrapped to last permutation, true otherwise.
+ *
+ * Treats all permutations of the range as a set of "dictionary" sorted
+ * sequences. Permutes the current sequence into the previous one of this
+ * set. Returns true if there are more sequences to generate. If the
+ * sequence is the smallest of the set, the largest is generated and false
+ * returned.
+ */
template<typename _BidirectionalIterator>
bool
prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
@@ -4108,6 +4352,20 @@ namespace std
}
}
+ /**
+ * @brief Permute range into the previous "dictionary" ordering using
+ * comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp
+ * @return False if wrapped to last permutation, true otherwise.
+ *
+ * Treats all permutations of the range [first,last) as a set of
+ * "dictionary" sorted sequences ordered by @a comp. Permutes the current
+ * sequence into the previous one of this set. Returns true if there are
+ * more sequences to generate. If the sequence is the smallest of the set,
+ * the largest is generated and false returned.
+ */
template<typename _BidirectionalIterator, typename _Compare>
bool
prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last,
@@ -4148,6 +4406,20 @@ namespace std
// find_first_of, with and without an explicitly supplied comparison function.
+ /**
+ * @brief Find element from a set in a sequence.
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of match candidates.
+ * @param last2 End of match candidates.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1) such that @c *i == @p *(i2) such that i2 is an
+ * interator in [first2,last2), or @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for an element that is equal to
+ * some element in the range [first2,last2). If found, returns an iterator
+ * in the range [first1,last1), otherwise returns @p last1.
+ */
template<typename _InputIterator, typename _ForwardIterator>
_InputIterator
find_first_of(_InputIterator __first1, _InputIterator __last1,
@@ -4167,6 +4439,21 @@ namespace std
return __last1;
}
+ /**
+ * @brief Find element from a set in a sequence using a predicate.
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of match candidates.
+ * @param last2 End of match candidates.
+ * @param comp Predicate to use.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1) such that @c comp(*i, @p *(i2)) is true and i2 is an
+ * interator in [first2,last2), or @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for an element that is equal to
+ * some element in the range [first2,last2). If found, returns an iterator in
+ * the range [first1,last1), otherwise returns @p last1.
+ */
template<typename _InputIterator, typename _ForwardIterator, typename _BinaryPredicate>
_InputIterator
find_first_of(_InputIterator __first1, _InputIterator __last1,
@@ -4307,6 +4594,30 @@ namespace std
// Dispatching functions for find_end.
+ /**
+ * @brief Find last matching subsequence in a sequence.
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of sequence to match.
+ * @param last2 End of sequence to match.
+ * @return The last iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N)
+ * for each @c N in the range @p [0,last2-first2), or @p last1 if no
+ * such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) and
+ * returns an iterator to the first element of the sub-sequence, or
+ * @p last1 if the sub-sequence is not found. The sub-sequence will be the
+ * last such subsequence contained in [first,last1).
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
template<typename _ForwardIterator1, typename _ForwardIterator2>
inline _ForwardIterator1
find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
@@ -4324,6 +4635,32 @@ namespace std
std::__iterator_category(__first2));
}
+ /**
+ * @brief Find last matching subsequence in a sequence using a predicate.
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of sequence to match.
+ * @param last2 End of sequence to match.
+ * @param comp The predicate to use.
+ * @return The last iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c predicate(*(i+N), @p
+ * (first2+N)) is true for each @c N in the range @p [0,last2-first2), or
+ * @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) using
+ * comp as a predicate and returns an iterator to the first element of the
+ * sub-sequence, or @p last1 if the sub-sequence is not found. The
+ * sub-sequence will be the last such subsequence contained in
+ * [first,last1).
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
template<typename _ForwardIterator1, typename _ForwardIterator2,
typename _BinaryPredicate>
inline _ForwardIterator1
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 57faf234fd1..73b13591cdc 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -319,8 +319,11 @@ namespace std
* This inline function will boil down to a call to @c memmove whenever
* possible. Failing that, if random access iterators are passed, then the
* loop count will be known (and therefore a candidate for compiler
- * optimizations such as unrolling). If the input range and the output
- * range overlap, then the copy_backward function should be used instead.
+ * optimizations such as unrolling). Result may not be contained within
+ * [first,last); the copy_backward function should be used instead.
+ *
+ * Note that the end of the output range is permitted to be contained
+ * within [first,last).
*/
template<typename _InputIterator, typename _OutputIterator>
inline _OutputIterator
@@ -443,9 +446,9 @@ namespace std
/**
* @brief Copies the range [first,last) into result.
- * @param first An input iterator.
- * @param last An input iterator.
- * @param result An output iterator.
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @param result A bidirectional iterator.
* @return result - (first - last)
*
* The function has the same effect as copy, but starts at the end of the
@@ -454,6 +457,9 @@ namespace std
* possible. Failing that, if random access iterators are passed, then the
* loop count will be known (and therefore a candidate for compiler
* optimizations such as unrolling).
+ *
+ * Result may not be in the range [first,last). Use copy instead. Note
+ * that the start of the output range may overlap [first,last).
*/
template <typename _BI1, typename _BI2>
inline _BI2
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 755e581a005..15e0f57f166 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -373,7 +373,7 @@ template <typename _Alloc>
protected:
void _M_initialize(size_type __n) {
- _Bit_type * __q = _M_bit_alloc(__n);
+ _Bit_type * __q = this->_M_bit_alloc(__n);
this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0);
this->_M_finish = this->_M_start + difference_type(__n);
@@ -387,11 +387,11 @@ template <typename _Alloc>
else {
size_type __len = size()
? 2 * size() : static_cast<size_type>(_S_word_bit);
- _Bit_type * __q = _M_bit_alloc(__len);
+ _Bit_type * __q = this->_M_bit_alloc(__len);
iterator __i = std::copy(begin(), __position, iterator(__q, 0));
*__i++ = __x;
this->_M_finish = std::copy(__position, end(), __i);
- _M_deallocate();
+ this->_M_deallocate();
this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0);
}
@@ -439,11 +439,11 @@ template <typename _Alloc>
}
else {
size_type __len = size() + std::max(size(), __n);
- _Bit_type * __q = _M_bit_alloc(__len);
+ _Bit_type * __q = this->_M_bit_alloc(__len);
iterator __i = std::copy(begin(), __position, iterator(__q, 0));
__i = std::copy(__first, __last, __i);
this->_M_finish = std::copy(__position, end(), __i);
- _M_deallocate();
+ this->_M_deallocate();
this->_M_end_of_storage
= __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0);
@@ -539,7 +539,7 @@ template <typename _Alloc>
vector& operator=(const vector& __x) {
if (&__x == this) return *this;
if (__x.size() > capacity()) {
- _M_deallocate();
+ this->_M_deallocate();
_M_initialize(__x.size());
}
std::copy(__x.begin(), __x.end(), begin());
@@ -609,9 +609,9 @@ template <typename _Alloc>
if (__n > this->max_size())
__throw_length_error(__N("vector::reserve"));
if (this->capacity() < __n) {
- _Bit_type * __q = _M_bit_alloc(__n);
+ _Bit_type * __q = this->_M_bit_alloc(__n);
this->_M_finish = std::copy(begin(), end(), iterator(__q, 0));
- _M_deallocate();
+ this->_M_deallocate();
this->_M_start = iterator(__q, 0);
this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit;
}
@@ -682,11 +682,11 @@ template <typename _Alloc>
}
else {
size_type __len = size() + std::max(size(), __n);
- _Bit_type * __q = _M_bit_alloc(__len);
+ _Bit_type * __q = this->_M_bit_alloc(__len);
iterator __i = std::copy(begin(), __position, iterator(__q, 0));
std::fill_n(__i, __n, __x);
this->_M_finish = std::copy(__position, end(), __i + difference_type(__n));
- _M_deallocate();
+ this->_M_deallocate();
this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0);
}
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index e474ede80c0..b5733433bbc 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -532,7 +532,7 @@ namespace std
try
{
for (__cur = __nstart; __cur < __nfinish; ++__cur)
- *__cur = _M_allocate_node();
+ *__cur = this->_M_allocate_node();
}
catch(...)
{
diff --git a/libstdc++-v3/include/bits/stl_heap.h b/libstdc++-v3/include/bits/stl_heap.h
index ff829a06f25..697f2c6f7b7 100644
--- a/libstdc++-v3/include/bits/stl_heap.h
+++ b/libstdc++-v3/include/bits/stl_heap.h
@@ -79,6 +79,15 @@ namespace std
*(__first + __holeIndex) = __value;
}
+ /**
+ * @brief Push an element onto a heap.
+ * @param first Start of heap.
+ * @param last End of heap + element.
+ * @ingroup heap
+ *
+ * This operation pushes the element at last-1 onto the valid heap over the
+ * range [first,last-1). After completion, [first,last) is a valid heap.
+ */
template<typename _RandomAccessIterator>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
@@ -112,6 +121,17 @@ namespace std
*(__first + __holeIndex) = __value;
}
+ /**
+ * @brief Push an element onto a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap + element.
+ * @param comp Comparison functor.
+ * @ingroup heap
+ *
+ * This operation pushes the element at last-1 onto the valid heap over the
+ * range [first,last-1). After completion, [first,last) is a valid heap.
+ * Compare operations are performed using comp.
+ */
template<typename _RandomAccessIterator, typename _Compare>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
@@ -161,6 +181,15 @@ namespace std
std::__adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value);
}
+ /**
+ * @brief Pop an element off a heap.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap
+ *
+ * This operation pops the top of the heap. The elements first and last-1
+ * are swapped and [first,last-1) is made into a heap.
+ */
template<typename _RandomAccessIterator>
inline void
pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
@@ -208,6 +237,17 @@ namespace std
__value, __comp);
}
+ /**
+ * @brief Pop an element off a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap
+ *
+ * This operation pops the top of the heap. The elements first and last-1
+ * are swapped and [first,last-1) is made into a heap. Comparisons are
+ * made using comp.
+ */
template<typename _RandomAccessIterator, typename _Compare>
inline void
pop_heap(_RandomAccessIterator __first,
@@ -221,6 +261,14 @@ namespace std
std::__pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)), __comp);
}
+ /**
+ * @brief Construct a heap over a range.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap
+ *
+ * This operation makes the elements in [first,last) into a heap.
+ */
template<typename _RandomAccessIterator>
void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
@@ -246,6 +294,16 @@ namespace std
}
}
+ /**
+ * @brief Construct a heap over a range using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap
+ *
+ * This operation makes the elements in [first,last) into a heap.
+ * Comparisons are made using comp.
+ */
template<typename _RandomAccessIterator, typename _Compare>
inline void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
@@ -272,6 +330,14 @@ namespace std
}
}
+ /**
+ * @brief Sort a heap.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap
+ *
+ * This operation sorts the valid heap in the range [first,last).
+ */
template<typename _RandomAccessIterator>
void
sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
@@ -286,6 +352,16 @@ namespace std
std::pop_heap(__first, __last--);
}
+ /**
+ * @brief Sort a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap
+ *
+ * This operation sorts the valid heap in the range [first,last).
+ * Comparisons are made using comp.
+ */
template<typename _RandomAccessIterator, typename _Compare>
void
sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 6f5579e3770..4533aee0bed 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -406,7 +406,7 @@ namespace std
_Node*
_M_create_node(const value_type& __x)
{
- _Node* __p = _M_get_node();
+ _Node* __p = this->_M_get_node();
try {
std::_Construct(&__p->_M_data, __x);
}
@@ -427,7 +427,7 @@ namespace std
_Node*
_M_create_node()
{
- _Node* __p = _M_get_node();
+ _Node* __p = this->_M_get_node();
try {
std::_Construct(&__p->_M_data);
}
@@ -489,8 +489,9 @@ namespace std
* @param first An input iterator.
* @param last An input iterator.
*
- * Create a %list consisting of copies of the elements from [first,last).
- * This is linear in N (where N is distance(first,last)).
+ * 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
@@ -539,7 +540,7 @@ namespace std
* @param last An input iterator.
*
* This function fills a %list with copies of the elements in the
- * range [first,last).
+ * 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.
@@ -780,8 +781,9 @@ namespace std
* @param first An input iterator.
* @param last An input iterator.
*
- * This function will insert copies of the data in the range [first,last)
- * into the %list before the location specified by @a pos.
+ * 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.
@@ -822,7 +824,7 @@ namespace std
* @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 [first,last) and
+ * 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
@@ -863,7 +865,12 @@ namespace std
// [23.2.2.4] list operations
/**
- * @doctodo
+ * @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)
@@ -873,7 +880,13 @@ namespace std
}
/**
- * @doctodo
+ * @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)
@@ -885,8 +898,17 @@ namespace std
}
/**
- * @doctodo
- */
+ * @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)
{
@@ -895,58 +917,107 @@ namespace std
}
/**
- * @doctodo
+ * @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);
/**
- * @doctodo
+ * @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);
/**
- * @doctodo
+ * @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();
/**
- * @doctodo
+ * @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);
/**
- * @doctodo
+ * @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);
/**
- * @doctodo
+ * @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);
/**
- * @doctodo
+ * @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); }
/**
- * @doctodo
+ * @brief Sort the elements.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent elements
+ * remain in list order.
*/
void
sort();
/**
- * @doctodo
+ * @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
diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h
index 1fa5afcda17..0526c0d7706 100644
--- a/libstdc++-v3/include/bits/stl_tempbuf.h
+++ b/libstdc++-v3/include/bits/stl_tempbuf.h
@@ -125,7 +125,7 @@ public:
}
catch(...)
{
- free(_M_buffer);
+ std::free(_M_buffer);
_M_buffer = 0;
_M_len = 0;
__throw_exception_again;
@@ -134,7 +134,7 @@ public:
~_Temporary_buffer() {
std::_Destroy(_M_buffer, _M_buffer + _M_len);
- free(_M_buffer);
+ std::free(_M_buffer);
}
private:
diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index eb124de11e1..fd81a6755cd 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -95,6 +95,7 @@ namespace std
struct _Rb_tree_node_base
{
typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
_Rb_tree_color _M_color;
_Base_ptr _M_parent;
@@ -108,12 +109,26 @@ namespace std
return __x;
}
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+
static _Base_ptr
_S_maximum(_Base_ptr __x)
{
while (__x->_M_right != 0) __x = __x->_M_right;
return __x;
}
+
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
};
template<typename _Val>
@@ -123,64 +138,14 @@ namespace std
_Val _M_value_field;
};
- struct _Rb_tree_base_iterator
- {
- typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
- typedef bidirectional_iterator_tag iterator_category;
- typedef ptrdiff_t difference_type;
-
- _Base_ptr _M_node;
-
- void
- _M_increment()
- {
- if (_M_node->_M_right != 0)
- {
- _M_node = _M_node->_M_right;
- while (_M_node->_M_left != 0)
- _M_node = _M_node->_M_left;
- }
- else
- {
- _Base_ptr __y = _M_node->_M_parent;
- while (_M_node == __y->_M_right)
- {
- _M_node = __y;
- __y = __y->_M_parent;
- }
- if (_M_node->_M_right != __y)
- _M_node = __y;
- }
- }
+ _Rb_tree_node_base*
+ _Rb_tree_increment(_Rb_tree_node_base* __x);
- void
- _M_decrement()
- {
- if (_M_node->_M_color == _S_red
- && _M_node->_M_parent->_M_parent == _M_node)
- _M_node = _M_node->_M_right;
- else if (_M_node->_M_left != 0)
- {
- _Base_ptr __y = _M_node->_M_left;
- while (__y->_M_right != 0)
- __y = __y->_M_right;
- _M_node = __y;
- }
- else
- {
- _Base_ptr __y = _M_node->_M_parent;
- while (_M_node == __y->_M_left)
- {
- _M_node = __y;
- __y = __y->_M_parent;
- }
- _M_node = __y;
- }
- }
- };
+ _Rb_tree_node_base*
+ _Rb_tree_decrement(_Rb_tree_node_base* __x);
template<typename _Val, typename _Ref, typename _Ptr>
- struct _Rb_tree_iterator : public _Rb_tree_base_iterator
+ struct _Rb_tree_iterator
{
typedef _Val value_type;
typedef _Ref reference;
@@ -188,23 +153,36 @@ namespace std
typedef _Rb_tree_iterator<_Val, _Val&, _Val*> iterator;
typedef _Rb_tree_iterator<_Val, const _Val&, const _Val*>
const_iterator;
+ typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
typedef _Rb_tree_iterator<_Val, _Ref, _Ptr> _Self;
typedef _Rb_tree_node<_Val>* _Link_type;
+ typedef const _Rb_tree_node<_Val>* _Const_Link_type;
_Rb_tree_iterator() {}
- _Rb_tree_iterator(_Rb_tree_node_base* __x) { _M_node = __x; }
- _Rb_tree_iterator(const iterator& __it) { _M_node = __it._M_node; }
+
+ _Rb_tree_iterator(_Link_type __x)
+ : _M_node(__x) {}
+
+ _Rb_tree_iterator(_Const_Link_type __x)
+ : _M_node(const_cast<_Link_type>(__x)) {}
+
+ _Rb_tree_iterator(const iterator& __it)
+ : _M_node(__it._M_node) {}
reference
- operator*() const { return _Link_type(_M_node)->_M_value_field; }
+ operator*() const
+ { return static_cast<_Link_type>(_M_node)->_M_value_field; }
pointer
- operator->() const { return &(operator*()); }
+ operator->() const
+ { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
_Self&
operator++()
{
- _M_increment();
+ _M_node = _Rb_tree_increment(_M_node);
return *this;
}
@@ -212,20 +190,26 @@ namespace std
operator++(int)
{
_Self __tmp = *this;
- _M_increment();
+ _M_node = _Rb_tree_increment(_M_node);
return __tmp;
}
_Self&
- operator--() { _M_decrement(); return *this; }
+ operator--()
+ {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+ }
_Self
operator--(int)
{
_Self __tmp = *this;
- _M_decrement();
+ _M_node = _Rb_tree_decrement(_M_node);
return __tmp;
}
+
+ _Base_ptr _M_node;
};
template<typename _Val, typename _Ref, typename _Ptr>
@@ -264,255 +248,18 @@ namespace std
const _Rb_tree_iterator<_Val, const _Val&, const _Val*>& __y)
{ return __x._M_node != __y._M_node; }
- inline void
- _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root)
- {
- _Rb_tree_node_base* const __y = __x->_M_right;
- __x->_M_right = __y->_M_left;
- if (__y->_M_left !=0)
- __y->_M_left->_M_parent = __x;
- __y->_M_parent = __x->_M_parent;
-
- if (__x == __root)
- __root = __y;
- else if (__x == __x->_M_parent->_M_left)
- __x->_M_parent->_M_left = __y;
- else
- __x->_M_parent->_M_right = __y;
- __y->_M_left = __x;
- __x->_M_parent = __y;
- }
-
- inline void
- _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root)
- {
- _Rb_tree_node_base* const __y = __x->_M_left;
- __x->_M_left = __y->_M_right;
- if (__y->_M_right != 0)
- __y->_M_right->_M_parent = __x;
- __y->_M_parent = __x->_M_parent;
-
- if (__x == __root)
- __root = __y;
- else if (__x == __x->_M_parent->_M_right)
- __x->_M_parent->_M_right = __y;
- else
- __x->_M_parent->_M_left = __y;
- __y->_M_right = __x;
- __x->_M_parent = __y;
- }
+ void
+ _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root);
- inline void
- _Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
- {
- __x->_M_color = _S_red;
- while (__x != __root
- && __x->_M_parent->_M_color == _S_red)
- {
- _Rb_tree_node_base* const __xpp = __x->_M_parent->_M_parent;
+ void
+ _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root);
- if (__x->_M_parent == __xpp->_M_left)
- {
- _Rb_tree_node_base* const __y = __xpp->_M_right;
- if (__y && __y->_M_color == _S_red)
- {
- __x->_M_parent->_M_color = _S_black;
- __y->_M_color = _S_black;
- __xpp->_M_color = _S_red;
- __x = __xpp;
- }
- else
- {
- if (__x == __x->_M_parent->_M_right)
- {
- __x = __x->_M_parent;
- _Rb_tree_rotate_left(__x, __root);
- }
- __x->_M_parent->_M_color = _S_black;
- __xpp->_M_color = _S_red;
- _Rb_tree_rotate_right(__xpp, __root);
- }
- }
- else
- {
- _Rb_tree_node_base* const __y = __xpp->_M_left;
- if (__y && __y->_M_color == _S_red)
- {
- __x->_M_parent->_M_color = _S_black;
- __y->_M_color = _S_black;
- __xpp->_M_color = _S_red;
- __x = __xpp;
- }
- else
- {
- if (__x == __x->_M_parent->_M_left)
- {
- __x = __x->_M_parent;
- _Rb_tree_rotate_right(__x, __root);
- }
- __x->_M_parent->_M_color = _S_black;
- __xpp->_M_color = _S_red;
- _Rb_tree_rotate_left(__xpp, __root);
- }
- }
- }
- __root->_M_color = _S_black;
- }
+ void
+ _Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root);
- inline _Rb_tree_node_base*
+ _Rb_tree_node_base*
_Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
- _Rb_tree_node_base*& __root,
- _Rb_tree_node_base*& __leftmost,
- _Rb_tree_node_base*& __rightmost)
- {
- _Rb_tree_node_base* __y = __z;
- _Rb_tree_node_base* __x = 0;
- _Rb_tree_node_base* __x_parent = 0;
- if (__y->_M_left == 0) // __z has at most one non-null child. y == z.
- __x = __y->_M_right; // __x might be null.
- else
- if (__y->_M_right == 0) // __z has exactly one non-null child. y == z.
- __x = __y->_M_left; // __x is not null.
- else
- {
- // __z has two non-null children. Set __y to
- __y = __y->_M_right; // __z's successor. __x might be null.
- while (__y->_M_left != 0)
- __y = __y->_M_left;
- __x = __y->_M_right;
- }
- if (__y != __z)
- {
- // relink y in place of z. y is z's successor
- __z->_M_left->_M_parent = __y;
- __y->_M_left = __z->_M_left;
- if (__y != __z->_M_right)
- {
- __x_parent = __y->_M_parent;
- if (__x) __x->_M_parent = __y->_M_parent;
- __y->_M_parent->_M_left = __x; // __y must be a child of _M_left
- __y->_M_right = __z->_M_right;
- __z->_M_right->_M_parent = __y;
- }
- else
- __x_parent = __y;
- if (__root == __z)
- __root = __y;
- else if (__z->_M_parent->_M_left == __z)
- __z->_M_parent->_M_left = __y;
- else
- __z->_M_parent->_M_right = __y;
- __y->_M_parent = __z->_M_parent;
- std::swap(__y->_M_color, __z->_M_color);
- __y = __z;
- // __y now points to node to be actually deleted
- }
- else
- { // __y == __z
- __x_parent = __y->_M_parent;
- if (__x)
- __x->_M_parent = __y->_M_parent;
- if (__root == __z)
- __root = __x;
- else
- if (__z->_M_parent->_M_left == __z)
- __z->_M_parent->_M_left = __x;
- else
- __z->_M_parent->_M_right = __x;
- if (__leftmost == __z)
- if (__z->_M_right == 0) // __z->_M_left must be null also
- __leftmost = __z->_M_parent;
- // makes __leftmost == _M_header if __z == __root
- else
- __leftmost = _Rb_tree_node_base::_S_minimum(__x);
- if (__rightmost == __z)
- if (__z->_M_left == 0) // __z->_M_right must be null also
- __rightmost = __z->_M_parent;
- // makes __rightmost == _M_header if __z == __root
- else // __x == __z->_M_left
- __rightmost = _Rb_tree_node_base::_S_maximum(__x);
- }
- if (__y->_M_color != _S_red)
- {
- while (__x != __root && (__x == 0 || __x->_M_color == _S_black))
- if (__x == __x_parent->_M_left)
- {
- _Rb_tree_node_base* __w = __x_parent->_M_right;
- if (__w->_M_color == _S_red)
- {
- __w->_M_color = _S_black;
- __x_parent->_M_color = _S_red;
- _Rb_tree_rotate_left(__x_parent, __root);
- __w = __x_parent->_M_right;
- }
- if ((__w->_M_left == 0 ||
- __w->_M_left->_M_color == _S_black) &&
- (__w->_M_right == 0 ||
- __w->_M_right->_M_color == _S_black))
- {
- __w->_M_color = _S_red;
- __x = __x_parent;
- __x_parent = __x_parent->_M_parent;
- }
- else
- {
- if (__w->_M_right == 0
- || __w->_M_right->_M_color == _S_black)
- {
- __w->_M_left->_M_color = _S_black;
- __w->_M_color = _S_red;
- _Rb_tree_rotate_right(__w, __root);
- __w = __x_parent->_M_right;
- }
- __w->_M_color = __x_parent->_M_color;
- __x_parent->_M_color = _S_black;
- if (__w->_M_right)
- __w->_M_right->_M_color = _S_black;
- _Rb_tree_rotate_left(__x_parent, __root);
- break;
- }
- }
- else
- {
- // same as above, with _M_right <-> _M_left.
- _Rb_tree_node_base* __w = __x_parent->_M_left;
- if (__w->_M_color == _S_red)
- {
- __w->_M_color = _S_black;
- __x_parent->_M_color = _S_red;
- _Rb_tree_rotate_right(__x_parent, __root);
- __w = __x_parent->_M_left;
- }
- if ((__w->_M_right == 0 ||
- __w->_M_right->_M_color == _S_black) &&
- (__w->_M_left == 0 ||
- __w->_M_left->_M_color == _S_black))
- {
- __w->_M_color = _S_red;
- __x = __x_parent;
- __x_parent = __x_parent->_M_parent;
- }
- else
- {
- if (__w->_M_left == 0 || __w->_M_left->_M_color == _S_black)
- {
- __w->_M_right->_M_color = _S_black;
- __w->_M_color = _S_red;
- _Rb_tree_rotate_left(__w, __root);
- __w = __x_parent->_M_left;
- }
- __w->_M_color = __x_parent->_M_color;
- __x_parent->_M_color = _S_black;
- if (__w->_M_left)
- __w->_M_left->_M_color = _S_black;
- _Rb_tree_rotate_right(__x_parent, __root);
- break;
- }
- }
- if (__x) __x->_M_color = _S_black;
- }
- return __y;
- }
+ _Rb_tree_node_base& __header);
// Base class to encapsulate the differences between old SGI-style
// allocators and standard-conforming allocators. In order to avoid
@@ -590,6 +337,7 @@ namespace std
protected:
typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
typedef _Rb_tree_node<_Val> _Rb_tree_node;
public:
@@ -600,6 +348,7 @@ namespace std
typedef value_type& reference;
typedef const value_type& const_reference;
typedef _Rb_tree_node* _Link_type;
+ typedef const _Rb_tree_node* _Const_Link_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
@@ -614,7 +363,7 @@ namespace std
_Link_type
_M_create_node(const value_type& __x)
{
- _Link_type __tmp = _M_get_node();
+ _Link_type __tmp = this->_M_get_node();
try
{ std::_Construct(&__tmp->_M_value_field, __x); }
catch(...)
@@ -626,7 +375,7 @@ namespace std
}
_Link_type
- _M_clone_node(_Link_type __x)
+ _M_clone_node(_Const_Link_type __x)
{
_Link_type __tmp = _M_create_node(__x->_M_value_field);
__tmp->_M_color = __x->_M_color;
@@ -645,58 +394,75 @@ namespace std
size_type _M_node_count; // keeps track of size of tree
_Compare _M_key_compare;
- _Link_type&
- _M_root() const { return (_Link_type&) this->_M_header._M_parent; }
+ _Base_ptr&
+ _M_root() { return this->_M_header._M_parent; }
+
+ _Const_Base_ptr
+ _M_root() const { return this->_M_header._M_parent; }
- _Link_type&
- _M_leftmost() const { return (_Link_type&) this->_M_header._M_left; }
+ _Base_ptr&
+ _M_leftmost() { return this->_M_header._M_left; }
- _Link_type&
- _M_rightmost() const { return (_Link_type&) this->_M_header._M_right; }
+ _Const_Base_ptr
+ _M_leftmost() const { return this->_M_header._M_left; }
+
+ _Base_ptr&
+ _M_rightmost() { return this->_M_header._M_right; }
+
+ _Const_Base_ptr
+ _M_rightmost() const { return this->_M_header._M_right; }
_Link_type
- _M_end() const { return (_Link_type) &this->_M_header; }
-
- static _Link_type&
- _S_left(_Link_type __x) { return (_Link_type&)(__x->_M_left); }
+ _M_begin() { return static_cast<_Link_type>(this->_M_header._M_parent); }
- static _Link_type&
- _S_right(_Link_type __x) { return (_Link_type&)(__x->_M_right); }
+ _Const_Link_type
+ _M_begin() const { return static_cast<_Const_Link_type>(this->_M_header._M_parent); }
- static _Link_type&
- _S_parent(_Link_type __x) { return (_Link_type&)(__x->_M_parent); }
+ _Link_type
+ _M_end() { return static_cast<_Link_type>(&this->_M_header); }
+
+ _Const_Link_type
+ _M_end() const { return static_cast<_Const_Link_type>(&this->_M_header); }
- static reference
- _S_value(_Link_type __x) { return __x->_M_value_field; }
+ static const_reference
+ _S_value(_Const_Link_type __x) { return __x->_M_value_field; }
static const _Key&
- _S_key(_Link_type __x) { return _KeyOfValue()(_S_value(__x)); }
+ _S_key(_Const_Link_type __x) { return _KeyOfValue()(_S_value(__x)); }
+
+ static _Link_type
+ _S_left(_Base_ptr __x) { return static_cast<_Link_type>(__x->_M_left); }
- static _Link_type&
- _S_left(_Base_ptr __x) { return (_Link_type&)(__x->_M_left); }
+ static _Const_Link_type
+ _S_left(_Const_Base_ptr __x) { return static_cast<_Const_Link_type>(__x->_M_left); }
- static _Link_type&
- _S_right(_Base_ptr __x) { return (_Link_type&)(__x->_M_right); }
+ static _Link_type
+ _S_right(_Base_ptr __x) { return static_cast<_Link_type>(__x->_M_right); }
- static _Link_type&
- _S_parent(_Base_ptr __x) { return (_Link_type&)(__x->_M_parent); }
+ static _Const_Link_type
+ _S_right(_Const_Base_ptr __x) { return static_cast<_Const_Link_type>(__x->_M_right); }
- static reference
- _S_value(_Base_ptr __x) { return ((_Link_type)__x)->_M_value_field; }
+ static const_reference
+ _S_value(_Const_Base_ptr __x) { return static_cast<_Const_Link_type>(__x)->_M_value_field; }
static const _Key&
- _S_key(_Base_ptr __x) { return _KeyOfValue()(_S_value(_Link_type(__x)));}
+ _S_key(_Const_Base_ptr __x) { return _KeyOfValue()(_S_value(__x)); }
- static _Rb_tree_color&
- _S_color(_Base_ptr __x) { return __x->_M_color; }
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
- static _Link_type
- _S_minimum(_Link_type __x)
- { return (_Link_type) _Rb_tree_node_base::_S_minimum(__x); }
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
- static _Link_type
- _S_maximum(_Link_type __x)
- { return (_Link_type) _Rb_tree_node_base::_S_maximum(__x); }
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
+
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
public:
typedef _Rb_tree_iterator<value_type, reference, pointer> iterator;
@@ -711,7 +477,7 @@ namespace std
_M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
_Link_type
- _M_copy(_Link_type __x, _Link_type __p);
+ _M_copy(_Const_Link_type __x, _Link_type __p);
void
_M_erase(_Link_type __x);
@@ -738,8 +504,8 @@ namespace std
_M_empty_initialize();
else
{
- _S_color(&this->_M_header) = _S_red;
- _M_root() = _M_copy(__x._M_root(), _M_end());
+ this->_M_header._M_color = _S_red;
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
_M_leftmost() = _S_minimum(_M_root());
_M_rightmost() = _S_maximum(_M_root());
}
@@ -755,7 +521,7 @@ namespace std
void _M_empty_initialize()
{
// Used to distinguish header from __root, in iterator.operator++.
- _S_color(&this->_M_header) = _S_red;
+ this->_M_header._M_color = _S_red;
_M_root() = 0;
_M_leftmost() = _M_end();
_M_rightmost() = _M_end();
@@ -767,16 +533,16 @@ namespace std
key_comp() const { return _M_key_compare; }
iterator
- begin() { return _M_leftmost(); }
+ begin() { return static_cast<_Link_type>(this->_M_header._M_left); }
const_iterator
- begin() const { return _M_leftmost(); }
+ begin() const { return static_cast<_Const_Link_type>(this->_M_header._M_left); }
iterator
- end() { return &this->_M_header; }
+ end() { return static_cast<_Link_type>(&this->_M_header); }
const_iterator
- end() const { return const_cast<_Base_ptr>(&this->_M_header); }
+ end() const { return static_cast<_Const_Link_type>(&this->_M_header); }
reverse_iterator
rbegin() { return reverse_iterator(end()); }
@@ -840,7 +606,7 @@ namespace std
{
if (_M_node_count != 0)
{
- _M_erase(_M_root());
+ _M_erase(_M_begin());
_M_leftmost() = _M_end();
_M_root() = 0;
_M_rightmost() = _M_end();
@@ -956,7 +722,7 @@ namespace std
}
else
{
- _M_root() = _M_copy(__x._M_root(), _M_end());
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
_M_leftmost() = _S_minimum(_M_root());
_M_rightmost() = _S_maximum(_M_root());
_M_node_count = __x._M_node_count;
@@ -971,15 +737,15 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
_M_insert(_Base_ptr __x_, _Base_ptr __y_, const _Val& __v)
{
- _Link_type __x = (_Link_type) __x_;
- _Link_type __y = (_Link_type) __y_;
+ _Link_type __x = static_cast<_Link_type>(__x_);
+ _Link_type __y = static_cast<_Link_type>(__y_);
_Link_type __z;
if (__y == &this->_M_header || __x != 0 ||
_M_key_compare(_KeyOfValue()(__v), _S_key(__y)))
{
__z = _M_create_node(__v);
- _S_left(__y) = __z; // also makes _M_leftmost() = __z
+ __y->_M_left = __z; // also makes _M_leftmost() = __z
// when __y == &_M_header
if (__y == &this->_M_header)
{
@@ -992,14 +758,14 @@ namespace std
else
{
__z = _M_create_node(__v);
- _S_right(__y) = __z;
+ __y->_M_right = __z;
// Maintain _M_rightmost() pointing to max node.
if (__y == _M_rightmost())
_M_rightmost() = __z;
}
- _S_parent(__z) = __y;
- _S_left(__z) = 0;
- _S_right(__z) = 0;
+ __z->_M_parent = __y;
+ __z->_M_left = 0;
+ __z->_M_right = 0;
_Rb_tree_rebalance(__z, this->_M_header._M_parent);
++_M_node_count;
return iterator(__z);
@@ -1011,8 +777,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
insert_equal(const _Val& __v)
{
+ _Link_type __x = _M_begin();
_Link_type __y = _M_end();
- _Link_type __x = _M_root();
while (__x != 0)
{
__y = __x;
@@ -1074,8 +840,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
insert_unique(const _Val& __v)
{
+ _Link_type __x = _M_begin();
_Link_type __y = _M_end();
- _Link_type __x = _M_root();
bool __comp = true;
while (__x != 0)
{
@@ -1208,10 +974,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(iterator __position)
{
_Link_type __y =
- (_Link_type) _Rb_tree_rebalance_for_erase(__position._M_node,
- this->_M_header._M_parent,
- this->_M_header._M_left,
- this->_M_header._M_right);
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase(__position._M_node,
+ this->_M_header));
destroy_node(__y);
--_M_node_count;
}
@@ -1231,7 +995,7 @@ namespace std
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
_Rb_tree<_Key,_Val,_KoV,_Compare,_Alloc>::
- _M_copy(_Link_type __x, _Link_type __p)
+ _M_copy(_Const_Link_type __x, _Link_type __p)
{
// Structural copy. __x and __p must be non-null.
_Link_type __top = _M_clone_node(__x);
@@ -1305,8 +1069,8 @@ namespace std
typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k)
{
- _Link_type __y = _M_end(); // Last node which is not less than __k.
- _Link_type __x = _M_root(); // Current node.
+ _Link_type __x = _M_begin(); // Current node.
+ _Link_type __y = _M_end(); // Last node which is not less than __k.
while (__x != 0)
if (!_M_key_compare(_S_key(__x), __k))
@@ -1325,8 +1089,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
find(const _Key& __k) const
{
- _Link_type __y = _M_end(); // Last node which is not less than __k.
- _Link_type __x = _M_root(); // Current node.
+ _Const_Link_type __x = _M_begin(); // Current node.
+ _Const_Link_type __y = _M_end(); // Last node which is not less than __k.
while (__x != 0)
{
@@ -1357,8 +1121,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
lower_bound(const _Key& __k)
{
- _Link_type __y = _M_end(); // Last node which is not less than __k
- _Link_type __x = _M_root(); // Current node.
+ _Link_type __x = _M_begin(); // Current node.
+ _Link_type __y = _M_end(); // Last node which is not less than __k.
while (__x != 0)
if (!_M_key_compare(_S_key(__x), __k))
@@ -1375,8 +1139,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
lower_bound(const _Key& __k) const
{
- _Link_type __y = _M_end(); // Last node which is not less than __k.
- _Link_type __x = _M_root(); // Current node.
+ _Const_Link_type __x = _M_begin(); // Current node.
+ _Const_Link_type __y = _M_end(); // Last node which is not less than __k.
while (__x != 0)
if (!_M_key_compare(_S_key(__x), __k))
@@ -1393,8 +1157,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
upper_bound(const _Key& __k)
{
+ _Link_type __x = _M_begin(); // Current node.
_Link_type __y = _M_end(); // Last node which is greater than __k.
- _Link_type __x = _M_root(); // Current node.
while (__x != 0)
if (_M_key_compare(__k, _S_key(__x)))
@@ -1411,8 +1175,8 @@ namespace std
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
upper_bound(const _Key& __k) const
{
- _Link_type __y = _M_end(); // Last node which is greater than __k.
- _Link_type __x = _M_root(); // Current node.
+ _Const_Link_type __x = _M_begin(); // Current node.
+ _Const_Link_type __y = _M_end(); // Last node which is greater than __k.
while (__x != 0)
if (_M_key_compare(__k, _S_key(__x)))
@@ -1444,23 +1208,9 @@ namespace std
upper_bound(__k));
}
- inline int
- __black_count(_Rb_tree_node_base* __node, _Rb_tree_node_base* __root)
- {
- if (__node == 0)
- return 0;
- int __sum = 0;
- do
- {
- if (__node->_M_color == _S_black)
- ++__sum;
- if (__node == __root)
- break;
- __node = __node->_M_parent;
- }
- while (1);
- return __sum;
- }
+ unsigned int
+ _Rb_tree_black_count(const _Rb_tree_node_base* __node,
+ const _Rb_tree_node_base* __root);
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
@@ -1472,12 +1222,12 @@ namespace std
this->_M_header._M_left == &this->_M_header &&
this->_M_header._M_right == &this->_M_header;
- int __len = __black_count(_M_leftmost(), _M_root());
+ unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
for (const_iterator __it = begin(); __it != end(); ++__it)
{
- _Link_type __x = (_Link_type) __it._M_node;
- _Link_type __L = _S_left(__x);
- _Link_type __R = _S_right(__x);
+ _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
+ _Const_Link_type __L = _S_left(__x);
+ _Const_Link_type __R = _S_right(__x);
if (__x->_M_color == _S_red)
if ((__L && __L->_M_color == _S_red)
@@ -1489,7 +1239,7 @@ namespace std
if (__R && _M_key_compare(_S_key(__R), _S_key(__x)))
return false;
- if (!__L && !__R && __black_count(__x, _M_root()) != __len)
+ if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
return false;
}
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 43d28210a09..e911697210d 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -153,7 +153,7 @@ namespace std
_Vector_base(size_t __n, const allocator_type& __a)
: _Base(__a)
{
- this->_M_start = _M_allocate(__n);
+ this->_M_start = this->_M_allocate(__n);
this->_M_finish = this->_M_start;
this->_M_end_of_storage = this->_M_start + __n;
}
@@ -753,7 +753,7 @@ namespace std
_M_allocate_and_copy(size_type __n,
_ForwardIterator __first, _ForwardIterator __last)
{
- pointer __result = _M_allocate(__n);
+ pointer __result = this->_M_allocate(__n);
try
{
std::uninitialized_copy(__first, __last, __result);
@@ -807,7 +807,7 @@ namespace std
_ForwardIterator __last, forward_iterator_tag)
{
size_type __n = std::distance(__first, __last);
- this->_M_start = _M_allocate(__n);
+ this->_M_start = this->_M_allocate(__n);
this->_M_end_of_storage = this->_M_start + __n;
this->_M_finish = std::uninitialized_copy(__first, __last,
this->_M_start);
diff --git a/libstdc++-v3/include/bits/valarray_array.h b/libstdc++-v3/include/bits/valarray_array.h
index 3b14f1d3c1f..edaf2120eee 100644
--- a/libstdc++-v3/include/bits/valarray_array.h
+++ b/libstdc++-v3/include/bits/valarray_array.h
@@ -1,6 +1,7 @@
// The template and inlines for the -*- C++ -*- internal _Array helper class.
-// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 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
@@ -615,16 +616,10 @@ _Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \
_DEFINE_ARRAY_FUNCTION(>>, __shift_right)
#undef _DEFINE_VALARRAY_FUNCTION
+} // namespace std
-} // std::
-
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/valarray_array.tcc>
#endif
#endif /* _ARRAY_H */
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/libstdc++-v3/include/bits/valarray_array.tcc b/libstdc++-v3/include/bits/valarray_array.tcc
index acf21a0fcd2..289001cf792 100644
--- a/libstdc++-v3/include/bits/valarray_array.tcc
+++ b/libstdc++-v3/include/bits/valarray_array.tcc
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- internal _Array helper class.
-// Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 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,128 +34,138 @@
namespace std
{
-
-export template<typename _Tp>
-void
-__valarray_fill (_Array<_Tp> __a, size_t __n, _Array<bool> __m, const _Tp& __t)
-{
- _Tp* __p = __a._M_data;
- bool* __ok (__m._M_data);
- for (size_t __i=0; __i<__n; ++__i, ++__ok, ++__p) {
- while (! *__ok) {
- ++__ok;
- ++__p;
- }
- *__p = __t;
+ template<typename _Tp>
+ void
+ __valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m,
+ const _Tp& __t)
+ {
+ _Tp* __p = __a._M_data;
+ bool* __ok (__m._M_data);
+ for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p)
+ {
+ while (!*__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__p = __t;
+ }
}
-}
-
-export template<typename _Tp>
-void
-__valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b, size_t __n)
-{
- _Tp* __p (__a._M_data);
- bool* __ok (__m._M_data);
- for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++__ok, ++__p) {
- while (! *__ok) {
- ++__ok;
- ++__p;
- }
- *__q = *__p;
+
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b,
+ size_t __n)
+ {
+ _Tp* __p (__a._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __q = __b._M_data; __q < __b._M_data + __n;
+ ++__q, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__q = *__p;
+ }
}
-}
-export template<typename _Tp>
-void
-__valarray_copy (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, _Array<bool> __m)
-{
- _Tp* __q (__b._M_data);
- bool* __ok (__m._M_data);
- for (_Tp* __p=__a._M_data; __p<__a._M_data+__n; ++__p, ++__ok, ++__q) {
- while (! *__ok) {
- ++__ok;
- ++__q;
- }
- *__q = *__p;
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
+ _Array<bool> __m)
+ {
+ _Tp* __q (__b._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __p = __a._M_data; __p < __a._M_data+__n;
+ ++__p, ++__ok, ++__q)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__q;
+ }
+ *__q = *__p;
+ }
}
-}
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a)
-{
- _Tp* __p (__a._M_data);
- for (size_t __i=0; __i<__n; ++__i, ++__p) *__p = __e[__i];
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
- _Array<_Tp> __a, size_t __s)
-{
- _Tp* __p (__a._M_data);
- for (size_t __i=0; __i<__n; ++__i, __p+=__s) *__p = __e[__i];
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
- _Array<_Tp> __a, _Array<size_t> __i)
-{
- size_t* __j (__i._M_data);
- for (size_t __k=0; __k<__n; ++__k, ++__j) __a._M_data[*__j] = __e[__k];
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy (const _Expr<_Dom, _Tp>& __e, size_t __n,
- _Array<_Tp> __a, _Array<bool> __m)
-{
- bool* __ok (__m._M_data);
- _Tp* __p (__a._M_data);
- for (size_t __i=0; __i<__n; ++__i, ++__ok, ++__p) {
- while (! *__ok) {
- ++__ok;
- ++__p;
- }
- *__p = __e[__i];
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__p)
+ *__p = __e[__i];
}
-}
-
-export template<typename _Tp, class _Dom>
-void
-__valarray_copy_construct (const _Expr<_Dom, _Tp>& __e, size_t __n,
- _Array<_Tp> __a)
-{
- _Tp* __p (__a._M_data);
- for (size_t __i=0; __i<__n; ++__i, ++__p) new (__p) _Tp(__e[__i]);
-}
-
-
-export template<typename _Tp>
-void
-__valarray_copy_construct (_Array<_Tp> __a, _Array<bool> __m,
- _Array<_Tp> __b, size_t __n)
-{
- _Tp* __p (__a._M_data);
- bool* __ok (__m._M_data);
- for (_Tp* __q=__b._M_data; __q<__b._M_data+__n; ++__q, ++__ok, ++__p) {
- while (! *__ok) {
- ++__ok;
- ++__p;
- }
- new (__q) _Tp(*__p);
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, size_t __s)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, __p += __s)
+ *__p = __e[__i];
}
-}
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, _Array<size_t> __i)
+ {
+ size_t* __j (__i._M_data);
+ for (size_t __k = 0; __k < __n; ++__k, ++__j)
+ __a._M_data[*__j] = __e[__k];
+ }
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, _Array<bool> __m)
+ {
+ bool* __ok (__m._M_data);
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__p = __e[__i];
+ }
+ }
+
+
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy_construct(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__p)
+ new (__p) _Tp(__e[__i]);
+ }
-} // std::
+ template<typename _Tp>
+ void
+ __valarray_copy_construct(_Array<_Tp> __a, _Array<bool> __m,
+ _Array<_Tp> __b, size_t __n)
+ {
+ _Tp* __p (__a._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __q = __b._M_data; __q < __b._M_data+__n; ++__q, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ new (__q) _Tp(*__p);
+ }
+ }
+} // namespace std
#endif /* _VALARRAY_ARRAY_TCC */
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index 7e65c4d9c8d..181b3596243 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -241,7 +241,7 @@ namespace std
{
const size_type __old_size = size();
const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
- iterator __new_start(_M_allocate(__len));
+ iterator __new_start(this->_M_allocate(__len));
iterator __new_finish(__new_start);
try
{
@@ -349,7 +349,7 @@ namespace std
{
const size_type __old_size = size();
const size_type __len = __old_size + std::max(__old_size, __n);
- iterator __new_start(_M_allocate(__len));
+ iterator __new_start(this->_M_allocate(__len));
iterator __new_finish(__new_start);
try
{
@@ -426,7 +426,7 @@ namespace std
{
const size_type __old_size = size();
const size_type __len = __old_size + std::max(__old_size, __n);
- iterator __new_start(_M_allocate(__len));
+ iterator __new_start(this->_M_allocate(__len));
iterator __new_finish(__new_start);
try
{
diff --git a/libstdc++-v3/include/c/std_cctype.h b/libstdc++-v3/include/c/std_cctype.h
index 1271e072a69..c007db9a9bd 100644
--- a/libstdc++-v3/include/c/std_cctype.h
+++ b/libstdc++-v3/include/c/std_cctype.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: <ccytpe>
//
-#ifndef _CCTYPE
-#define _CCTYPE 1
+#ifndef _GLIBCXX_CCTYPE
+#define _GLIBCXX_CCTYPE 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cerrno.h b/libstdc++-v3/include/c/std_cerrno.h
index 21c2701fa18..84e0e534337 100644
--- a/libstdc++-v3/include/c/std_cerrno.h
+++ b/libstdc++-v3/include/c/std_cerrno.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -40,8 +40,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CERRNO
-#define _CERRNO 1
+#ifndef _GLIBCXX_CERRNO
+#define _GLIBCXX_CERRNO 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cfloat.h b/libstdc++-v3/include/c/std_cfloat.h
index bcdb5f7bc29..e9319d302ad 100644
--- a/libstdc++-v3/include/c/std_cfloat.h
+++ b/libstdc++-v3/include/c/std_cfloat.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-#ifndef _CFLOAT
-#define _CFLOAT 1
+#ifndef _GLIBCXX_CFLOAT
+#define _GLIBCXX_CFLOAT 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_climits.h b/libstdc++-v3/include/c/std_climits.h
index 659bed9caed..e1986f25a95 100644
--- a/libstdc++-v3/include/c/std_climits.h
+++ b/libstdc++-v3/include/c/std_climits.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-#ifndef _CLIMITS
-#define _CLIMITS 1
+#ifndef _GLIBCXX_CLIMITS
+#define _GLIBCXX_CLIMITS 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_clocale.h b/libstdc++-v3/include/c/std_clocale.h
index 6ac30a77fd7..6aa937baf71 100644
--- a/libstdc++-v3/include/c/std_clocale.h
+++ b/libstdc++-v3/include/c/std_clocale.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-#ifndef _CLOCALE
-#define _CLOCALE 1
+#ifndef _GLIBCXX_CLOCALE
+#define _GLIBCXX_CLOCALE 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cmath.h b/libstdc++-v3/include/c/std_cmath.h
index 9d5d7c916f6..07d15ec9953 100644
--- a/libstdc++-v3/include/c/std_cmath.h
+++ b/libstdc++-v3/include/c/std_cmath.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 26.5 C library
//
-#ifndef _CMATH
-#define _CMATH 1
+#ifndef _GLIBCXX_CMATH
+#define _GLIBCXX_CMATH 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_csetjmp.h b/libstdc++-v3/include/c/std_csetjmp.h
index ad80a28ccb7..022753f4656 100644
--- a/libstdc++-v3/include/c/std_csetjmp.h
+++ b/libstdc++-v3/include/c/std_csetjmp.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 20.4.6 C library
//
-#ifndef _CSETJMP
-#define _CSETJMP 1
+#ifndef _GLIBCXX_CSETJMP
+#define _GLIBCXX_CSETJMP 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_csignal.h b/libstdc++-v3/include/c/std_csignal.h
index 6f2790c5b31..6fa96071d92 100644
--- a/libstdc++-v3/include/c/std_csignal.h
+++ b/libstdc++-v3/include/c/std_csignal.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 20.4.6 C library
//
-#ifndef _CSIGNAL
-#define _CSIGNAL 1
+#ifndef _GLIBCXX_CSIGNAL
+#define _GLIBCXX_CSIGNAL 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cstdarg.h b/libstdc++-v3/include/c/std_cstdarg.h
index 5f66f906a72..0c236344ed8 100644
--- a/libstdc++-v3/include/c/std_cstdarg.h
+++ b/libstdc++-v3/include/c/std_cstdarg.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 20.4.6 C library
//
-#ifndef _CSTDARG
-#define _CSTDARG 1
+#ifndef _GLIBCXX_CSTDARG
+#define _GLIBCXX_CSTDARG 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cstddef.h b/libstdc++-v3/include/c/std_cstddef.h
index b88944e61b7..4178ecf37ee 100644
--- a/libstdc++-v3/include/c/std_cstddef.h
+++ b/libstdc++-v3/include/c/std_cstddef.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 18.1 Types
//
-#ifndef _CSTDDEF
-#define _CSTDDEF 1
+#ifndef _GLIBCXX_CSTDDEF
+#define _GLIBCXX_CSTDDEF 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cstdio.h b/libstdc++-v3/include/c/std_cstdio.h
index 0ef5787a7f5..fa04bc4518d 100644
--- a/libstdc++-v3/include/c/std_cstdio.h
+++ b/libstdc++-v3/include/c/std_cstdio.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 27.8.2 C Library files
//
-#ifndef _CSTDIO
-#define _CSTDIO 1
+#ifndef _GLIBCXX_CSTDIO
+#define _GLIBCXX_CSTDIO 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cstdlib.h b/libstdc++-v3/include/c/std_cstdlib.h
index 1c34b36b601..47e972fb93b 100644
--- a/libstdc++-v3/include/c/std_cstdlib.h
+++ b/libstdc++-v3/include/c/std_cstdlib.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 20.4.6 C library
//
-#ifndef _CSTDLIB
-#define _CSTDLIB 1
+#ifndef _GLIBCXX_CSTDLIB
+#define _GLIBCXX_CSTDLIB 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cstring.h b/libstdc++-v3/include/c/std_cstring.h
index e5c786d2973..72ee44f9255 100644
--- a/libstdc++-v3/include/c/std_cstring.h
+++ b/libstdc++-v3/include/c/std_cstring.h
@@ -31,8 +31,8 @@
// ISO C++ 14882: 20.4.6 C library
//
-#ifndef _CSTRING
-#define _CSTRING 1
+#ifndef _GLIBCXX_CSTRING
+#define _GLIBCXX_CSTRING 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_ctime.h b/libstdc++-v3/include/c/std_ctime.h
index 17d965afa90..197a1f8b864 100644
--- a/libstdc++-v3/include/c/std_ctime.h
+++ b/libstdc++-v3/include/c/std_ctime.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 20.5 Date and time
//
-#ifndef _CTIME
-#define _CTIME 1
+#ifndef _GLIBCXX_CTIME
+#define _GLIBCXX_CTIME 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cwchar.h b/libstdc++-v3/include/c/std_cwchar.h
index 61126d96392..5b3451933e7 100644
--- a/libstdc++-v3/include/c/std_cwchar.h
+++ b/libstdc++-v3/include/c/std_cwchar.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: 21.4
//
-#ifndef _CWCHAR
-#define _CWCHAR 1
+#ifndef _GLIBCXX_CWCHAR
+#define _GLIBCXX_CWCHAR 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c/std_cwctype.h b/libstdc++-v3/include/c/std_cwctype.h
index b94497bbe83..c01073a2e0a 100644
--- a/libstdc++-v3/include/c/std_cwctype.h
+++ b/libstdc++-v3/include/c/std_cwctype.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -31,8 +31,8 @@
// ISO C++ 14882: <cwctype>
//
-#ifndef _CWCTYPE
-#define _CWCTYPE 1
+#ifndef _GLIBCXX_CWCTYPE
+#define _GLIBCXX_CWCTYPE 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/cmath.tcc b/libstdc++-v3/include/c_std/cmath.tcc
index be7502d3c46..a7bdf227b11 100644
--- a/libstdc++-v3/include/c_std/cmath.tcc
+++ b/libstdc++-v3/include/c_std/cmath.tcc
@@ -1,6 +1,6 @@
// -*- C++ -*- C math library.
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 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
@@ -29,12 +29,12 @@
// This file was written by Gabriel Dos Reis <gdr@codesourcery.com>
-#ifndef _CMATH_TCC
-#define _CMATH_TCC 1
+#ifndef _GLIBCXX_CMATH_TCC
+#define _GLIBCXX_CMATH_TCC 1
namespace std
{
- export template<typename _Tp>
+ template<typename _Tp>
_Tp
__cmath_power(_Tp __x, unsigned int __n)
{
diff --git a/libstdc++-v3/include/c_std/std_cctype.h b/libstdc++-v3/include/c_std/std_cctype.h
index 8b903eaf76a..02978622d82 100644
--- a/libstdc++-v3/include/c_std/std_cctype.h
+++ b/libstdc++-v3/include/c_std/std_cctype.h
@@ -40,8 +40,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CCTYPE
-#define _CCTYPE 1
+#ifndef _GLIBCXX_CCTYPE
+#define _GLIBCXX_CCTYPE 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cerrno.h b/libstdc++-v3/include/c_std/std_cerrno.h
index b9a0743e79a..7915e14ba27 100644
--- a/libstdc++-v3/include/c_std/std_cerrno.h
+++ b/libstdc++-v3/include/c_std/std_cerrno.h
@@ -40,8 +40,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CERRNO
-#define _CERRNO 1
+#ifndef _GLIBCXX_CERRNO
+#define _GLIBCXX_CERRNO 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cfloat.h b/libstdc++-v3/include/c_std/std_cfloat.h
index ab7283e7802..4c5bb00f204 100644
--- a/libstdc++-v3/include/c_std/std_cfloat.h
+++ b/libstdc++-v3/include/c_std/std_cfloat.h
@@ -40,8 +40,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CFLOAT
-#define _CFLOAT 1
+#ifndef _GLIBCXX_CFLOAT
+#define _GLIBCXX_CFLOAT 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_climits.h b/libstdc++-v3/include/c_std/std_climits.h
index 7f2b0125f23..f4e1d8f77fa 100644
--- a/libstdc++-v3/include/c_std/std_climits.h
+++ b/libstdc++-v3/include/c_std/std_climits.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CLIMITS
-#define _CLIMITS 1
+#ifndef _GLIBCXX_CLIMITS
+#define _GLIBCXX_CLIMITS 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_clocale.h b/libstdc++-v3/include/c_std/std_clocale.h
index c6a882b6fe1..988b84924af 100644
--- a/libstdc++-v3/include/c_std/std_clocale.h
+++ b/libstdc++-v3/include/c_std/std_clocale.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CLOCALE
-#define _CLOCALE 1
+#ifndef _GLIBCXX_CLOCALE
+#define _GLIBCXX_CLOCALE 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cmath.h b/libstdc++-v3/include/c_std/std_cmath.h
index b34e172167c..7edf7581f55 100644
--- a/libstdc++-v3/include/c_std/std_cmath.h
+++ b/libstdc++-v3/include/c_std/std_cmath.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CMATH
-#define _CMATH 1
+#ifndef _GLIBCXX_CMATH
+#define _GLIBCXX_CMATH 1
#pragma GCC system_header
@@ -838,9 +838,8 @@ namespace std
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
#endif
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
-# include <bits/cmath.tcc>
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/cmath.tcc>
#endif
#endif
diff --git a/libstdc++-v3/include/c_std/std_csetjmp.h b/libstdc++-v3/include/c_std/std_csetjmp.h
index c5b9119e0b8..d5fe073f0fc 100644
--- a/libstdc++-v3/include/c_std/std_csetjmp.h
+++ b/libstdc++-v3/include/c_std/std_csetjmp.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CSETJMP
-#define _CSETJMP 1
+#ifndef _GLIBCXX_CSETJMP
+#define _GLIBCXX_CSETJMP 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_csignal.h b/libstdc++-v3/include/c_std/std_csignal.h
index 8be03f05f4c..5734cf6d29a 100644
--- a/libstdc++-v3/include/c_std/std_csignal.h
+++ b/libstdc++-v3/include/c_std/std_csignal.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CSIGNAL
-#define _CSIGNAL 1
+#ifndef _GLIBCXX_CSIGNAL
+#define _GLIBCXX_CSIGNAL 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cstdarg.h b/libstdc++-v3/include/c_std/std_cstdarg.h
index 52979dffa6c..ca362e4b412 100644
--- a/libstdc++-v3/include/c_std/std_cstdarg.h
+++ b/libstdc++-v3/include/c_std/std_cstdarg.h
@@ -40,8 +40,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CSTDARG
-#define _CSTDARG 1
+#ifndef _GLIBCXX_CSTDARG
+#define _GLIBCXX_CSTDARG 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cstddef.h b/libstdc++-v3/include/c_std/std_cstddef.h
index b7e56100196..a171c5a9765 100644
--- a/libstdc++-v3/include/c_std/std_cstddef.h
+++ b/libstdc++-v3/include/c_std/std_cstddef.h
@@ -40,8 +40,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CSTDDEF
-#define _CSTDDEF 1
+#ifndef _GLIBCXX_CSTDDEF
+#define _GLIBCXX_CSTDDEF 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cstdio.h b/libstdc++-v3/include/c_std/std_cstdio.h
index 732da5f9461..331dc15b0f7 100644
--- a/libstdc++-v3/include/c_std/std_cstdio.h
+++ b/libstdc++-v3/include/c_std/std_cstdio.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CSTDIO
-#define _CSTDIO 1
+#ifndef _GLIBCXX_CSTDIO
+#define _GLIBCXX_CSTDIO 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cstdlib.h b/libstdc++-v3/include/c_std/std_cstdlib.h
index 5cac120edfd..14b3b909086 100644
--- a/libstdc++-v3/include/c_std/std_cstdlib.h
+++ b/libstdc++-v3/include/c_std/std_cstdlib.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CSTDLIB
-#define _CSTDLIB 1
+#ifndef _GLIBCXX_CSTDLIB
+#define _GLIBCXX_CSTDLIB 1
#pragma GCC system_header
@@ -101,9 +101,11 @@ namespace std
using ::labs;
using ::ldiv;
using ::malloc;
+#ifdef _GLIBCXX_HAVE_MBSTATE_T
using ::mblen;
using ::mbstowcs;
using ::mbtowc;
+#endif // _GLIBCXX_HAVE_MBSTATE_T
using ::qsort;
using ::rand;
using ::realloc;
@@ -112,8 +114,10 @@ namespace std
using ::strtol;
using ::strtoul;
using ::system;
+#ifdef _GLIBCXX_USE_WCHAR_T
using ::wcstombs;
using ::wctomb;
+#endif // _GLIBCXX_USE_WCHAR_T
inline long
abs(long __i) { return labs(__i); }
diff --git a/libstdc++-v3/include/c_std/std_cstring.h b/libstdc++-v3/include/c_std/std_cstring.h
index 934e491def6..4436db69240 100644
--- a/libstdc++-v3/include/c_std/std_cstring.h
+++ b/libstdc++-v3/include/c_std/std_cstring.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CSTRING
-#define _CSTRING 1
+#ifndef _GLIBCXX_CSTRING
+#define _GLIBCXX_CSTRING 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_ctime.h b/libstdc++-v3/include/c_std/std_ctime.h
index b7ed90698a2..fe890dfd580 100644
--- a/libstdc++-v3/include/c_std/std_ctime.h
+++ b/libstdc++-v3/include/c_std/std_ctime.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CTIME
-#define _CTIME 1
+#ifndef _GLIBCXX_CTIME
+#define _GLIBCXX_CTIME 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cwchar.h b/libstdc++-v3/include/c_std/std_cwchar.h
index b9e0965ce8e..8a20a712862 100644
--- a/libstdc++-v3/include/c_std/std_cwchar.h
+++ b/libstdc++-v3/include/c_std/std_cwchar.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CWCHAR
-#define _CWCHAR 1
+#ifndef _GLIBCXX_CWCHAR
+#define _GLIBCXX_CWCHAR 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/c_std/std_cwctype.h b/libstdc++-v3/include/c_std/std_cwctype.h
index f7639ed3843..fbd2eabdbcd 100644
--- a/libstdc++-v3/include/c_std/std_cwctype.h
+++ b/libstdc++-v3/include/c_std/std_cwctype.h
@@ -41,8 +41,8 @@
* contained in the namespace @c std.
*/
-#ifndef _CWCTYPE
-#define _CWCTYPE 1
+#ifndef _GLIBCXX_CWCTYPE
+#define _GLIBCXX_CWCTYPE 1
#pragma GCC system_header
diff --git a/libstdc++-v3/include/ext/hash_map b/libstdc++-v3/include/ext/hash_map
index 0de6b8d61c2..363b27dd627 100644
--- a/libstdc++-v3/include/ext/hash_map
+++ b/libstdc++-v3/include/ext/hash_map
@@ -248,8 +248,8 @@ class hash_multimap
// concept requirements
__glibcxx_class_requires(_Key, _SGIAssignableConcept)
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
- __glibcxx_class_requires3(_HashFcn, size_t, _Key, _UnaryFunctionConcept);
- __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept);
+ __glibcxx_class_requires3(_HashFcn, size_t, _Key, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept)
private:
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
diff --git a/libstdc++-v3/include/ext/hash_set b/libstdc++-v3/include/ext/hash_set
index caf773fb9fc..0a0b738130a 100644
--- a/libstdc++-v3/include/ext/hash_set
+++ b/libstdc++-v3/include/ext/hash_set
@@ -94,8 +94,8 @@ class hash_set
{
// concept requirements
__glibcxx_class_requires(_Value, _SGIAssignableConcept)
- __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept);
- __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept);
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
@@ -250,8 +250,8 @@ class hash_multiset
{
// concept requirements
__glibcxx_class_requires(_Value, _SGIAssignableConcept)
- __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept);
- __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept);
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
diff --git a/libstdc++-v3/include/ext/pod_char_traits.h b/libstdc++-v3/include/ext/pod_char_traits.h
index 0de7a0fd1e6..04bc0ddb52b 100644
--- a/libstdc++-v3/include/ext/pod_char_traits.h
+++ b/libstdc++-v3/include/ext/pod_char_traits.h
@@ -37,11 +37,12 @@
namespace __gnu_cxx
{
- template<typename V, typename I>
+ 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;
};
@@ -59,19 +60,18 @@ namespace __gnu_cxx
namespace std
{
// Provide std::char_traits specialization.
- template<typename V, typename I>
- struct char_traits<__gnu_cxx::character<V, I> >
+ template<typename V, typename I, typename S>
+ struct char_traits<__gnu_cxx::character<V, I, S> >
{
- typedef __gnu_cxx::character<V, I> 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.
typedef typename char_type::int_type int_type;
-
+ typedef typename char_type::state_type state_type;
typedef streampos pos_type;
typedef streamoff off_type;
- typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
@@ -98,7 +98,7 @@ namespace std
length(const char_type* __s)
{
const char_type* __p = __s;
- while (*__p)
+ while (__p->value)
++__p;
return (__p - __s);
}
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index 9cb0d68b3ef..7bd66710e28 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -189,8 +189,7 @@ class sequence_buffer : public iterator<std::output_iterator_tag,void,void,void,
{
if (__len + _M_buf_count <= _Buf_sz) {
size_t __i = _M_buf_count;
- size_t __j = 0;
- for (; __j < __len; __i++, __j++) {
+ for (size_t __j = 0; __j < __len; __i++, __j++) {
_M_buffer[__i] = __s[__j];
}
_M_buf_count += __len;
@@ -606,9 +605,9 @@ struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> {
# ifndef __GC
~_Rope_RopeLeaf() {
if (_M_data != this->_M_c_string) {
- _M_free_c_string();
+ this->_M_free_c_string();
}
- __STL_FREE_STRING(_M_data, this->_M_size, get_allocator());
+ __STL_FREE_STRING(_M_data, this->_M_size, this->get_allocator());
}
# endif
};
@@ -632,9 +631,9 @@ struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> {
{}
# ifndef __GC
~_Rope_RopeConcatenation() {
- _M_free_c_string();
- _M_left->_M_unref_nonnil();
- _M_right->_M_unref_nonnil();
+ this->_M_free_c_string();
+ _M_left->_M_unref_nonnil();
+ _M_right->_M_unref_nonnil();
}
# endif
};
@@ -678,7 +677,7 @@ struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> {
}
# ifndef __GC
~_Rope_RopeFunction() {
- _M_free_c_string();
+ this->_M_free_c_string();
if (_M_delete_when_done) {
delete _M_fn;
}
@@ -979,33 +978,33 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
this->_M_buf_ptr = __next;
++this->_M_current_pos;
} else {
- _M_incr(1);
+ this->_M_incr(1);
}
return *this;
}
_Rope_const_iterator& operator+=(ptrdiff_t __n) {
if (__n >= 0) {
- _M_incr(__n);
+ this->_M_incr(__n);
} else {
- _M_decr(-__n);
+ this->_M_decr(-__n);
}
return *this;
}
_Rope_const_iterator& operator--() {
- _M_decr(1);
+ this->_M_decr(1);
return *this;
}
_Rope_const_iterator& operator-=(ptrdiff_t __n) {
if (__n >= 0) {
- _M_decr(__n);
+ this->_M_decr(__n);
} else {
- _M_incr(-__n);
+ this->_M_incr(-__n);
}
return *this;
}
_Rope_const_iterator operator++(int) {
size_t __old_pos = this->_M_current_pos;
- _M_incr(1);
+ this->_M_incr(1);
return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
// This makes a subsequent dereference expensive.
// Perhaps we should instead copy the iterator
@@ -1013,7 +1012,7 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
}
_Rope_const_iterator operator--(int) {
size_t __old_pos = this->_M_current_pos;
- _M_decr(1);
+ this->_M_decr(1);
return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
}
template<class _CharT2, class _Alloc2>
@@ -1112,37 +1111,37 @@ class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
}
}
_Rope_iterator& operator++() {
- _M_incr(1);
+ this->_M_incr(1);
return *this;
}
_Rope_iterator& operator+=(ptrdiff_t __n) {
if (__n >= 0) {
- _M_incr(__n);
+ this->_M_incr(__n);
} else {
- _M_decr(-__n);
+ this->_M_decr(-__n);
}
return *this;
}
_Rope_iterator& operator--() {
- _M_decr(1);
+ this->_M_decr(1);
return *this;
}
_Rope_iterator& operator-=(ptrdiff_t __n) {
if (__n >= 0) {
- _M_decr(__n);
+ this->_M_decr(__n);
} else {
- _M_incr(-__n);
+ this->_M_incr(-__n);
}
return *this;
}
_Rope_iterator operator++(int) {
size_t __old_pos = this->_M_current_pos;
- _M_incr(1);
+ this->_M_incr(1);
return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
}
_Rope_iterator operator--(int) {
size_t __old_pos = this->_M_current_pos;
- _M_decr(1);
+ this->_M_decr(1);
return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
}
reference operator[](ptrdiff_t __n) {
@@ -1650,7 +1649,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
{
_RopeRep* __old = this->_M_tree_ptr;
_RopeRep* __left =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, get_allocator());
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, this->get_allocator());
try {
this->_M_tree_ptr = _S_concat(__left, this->_M_tree_ptr);
_S_unref(__old);
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 104b640989c..6129084deb6 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -46,7 +46,7 @@
*/
#include <cstdio>
-#include <iostream>
+#include <ostream>
#include <bits/functexcept.h>
#include <ext/algorithm> // For copy_n and lexicographical_compare_3way
@@ -1455,7 +1455,7 @@ const _CharT* rope<_CharT,_Alloc>::c_str() const {
if (0 == __result)
{
size_t __s = size();
- __result = _Data_allocate(__s + 1);
+ __result = this->_Data_allocate(__s + 1);
_S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_c_string = __result;
@@ -1480,7 +1480,7 @@ const _CharT* rope<_CharT,_Alloc>::replace_with_c_str() {
_S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_unref_nonnil();
- this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s, get_allocator());
+ this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s, this->get_allocator());
return(__result);
}
diff --git a/libstdc++-v3/include/ext/stdio_filebuf.h b/libstdc++-v3/include/ext/stdio_filebuf.h
index 574a62b8160..8750f5801e3 100644
--- a/libstdc++-v3/include/ext/stdio_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_filebuf.h
@@ -126,10 +126,10 @@ namespace __gnu_cxx
{
this->_M_mode = __mode;
this->_M_buf_size = __size;
- _M_allocate_internal_buffer();
+ this->_M_allocate_internal_buffer();
this->_M_reading = false;
this->_M_writing = false;
- _M_set_buffer(-1);
+ this->_M_set_buffer(-1);
}
}
@@ -143,10 +143,10 @@ namespace __gnu_cxx
{
this->_M_mode = __mode;
this->_M_buf_size = __size;
- _M_allocate_internal_buffer();
+ this->_M_allocate_internal_buffer();
this->_M_reading = false;
this->_M_writing = false;
- _M_set_buffer(-1);
+ this->_M_set_buffer(-1);
}
}
} // namespace __gnu_cxx
diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
index 64ec2d97340..7697d86816e 100644
--- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
@@ -57,10 +57,7 @@ namespace __gnu_cxx
template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
class stdio_sync_filebuf : public std::basic_streambuf<_CharT, _Traits>
{
- private:
- std::__c_file* const _M_file;
-
- public:
+ public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
@@ -68,8 +65,19 @@ namespace __gnu_cxx
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
- stdio_sync_filebuf(std::__c_file* __f) : _M_file(__f) { }
+ stdio_sync_filebuf(std::__c_file* __f)
+ : _M_file(__f), _M_unget_buf(traits_type::eof())
+ { }
protected:
@@ -91,11 +99,33 @@ namespace __gnu_cxx
virtual int_type
uflow()
- { return this->syncgetc(); }
+ {
+ // Store the gotten character in case we need to unget it.
+ _M_unget_buf = this->syncgetc();
+ return _M_unget_buf;
+ }
virtual int_type
pbackfail(int_type __c = traits_type::eof())
- { return this->syncungetc(__c); }
+ {
+ int_type __ret;
+ const int_type __eof = traits_type::eof();
+
+ // Check if the unget or putback was requested
+ if (traits_type::eq_int_type(__c, __eof)) // unget
+ {
+ if (!traits_type::eq_int_type(_M_unget_buf, __eof))
+ __ret = this->syncungetc(_M_unget_buf);
+ else // buffer invalid, fail.
+ __ret = __eof;
+ }
+ else // putback
+ __ret = this->syncungetc(__c);
+
+ // The buffered character is no longer valid, discard it.
+ _M_unget_buf = __eof;
+ return __ret;
+ }
virtual std::streamsize
xsgetn(char_type* __s, std::streamsize __n);
@@ -179,7 +209,14 @@ namespace __gnu_cxx
template<>
inline std::streamsize
stdio_sync_filebuf<char>::xsgetn(char* __s, std::streamsize __n)
- { return std::fread(__s, 1, __n, _M_file); }
+ {
+ std::streamsize __ret = std::fread(__s, 1, __n, _M_file);
+ if (__ret > 0)
+ _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]);
+ else
+ _M_unget_buf = traits_type::eof();
+ return __ret;
+ }
template<>
inline std::streamsize
@@ -213,9 +250,14 @@ namespace __gnu_cxx
int_type __c = this->syncgetc();
if (traits_type::eq_int_type(__c, __eof))
break;
- *__s++ = __c;
+ __s[__ret] = traits_type::to_char_type(__c);
++__ret;
}
+
+ if (__ret > 0)
+ _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]);
+ else
+ _M_unget_buf = traits_type::eof();
return __ret;
}
diff --git a/libstdc++-v3/include/std/std_algorithm.h b/libstdc++-v3/include/std/std_algorithm.h
index c7837b4fdb5..1d81201bc7d 100644
--- a/libstdc++-v3/include/std/std_algorithm.h
+++ b/libstdc++-v3/include/std/std_algorithm.h
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _ALGORITHM
-#define _ALGORITHM 1
+#ifndef _GLIBCXX_ALGORITHM
+#define _GLIBCXX_ALGORITHM 1
#pragma GCC system_header
@@ -68,7 +68,7 @@
#include <bits/stl_uninitialized.h>
#include <bits/stl_algo.h>
-#endif /* _ALGORITHM */
+#endif /* _GLIBCXX_ALGORITHM */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/std/std_bitset.h b/libstdc++-v3/include/std/std_bitset.h
index 66ba2954020..ab4ca236bd7 100644
--- a/libstdc++-v3/include/std/std_bitset.h
+++ b/libstdc++-v3/include/std/std_bitset.h
@@ -45,8 +45,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _BITSET
-#define _BITSET 1
+#ifndef _GLIBCXX_BITSET
+#define _GLIBCXX_BITSET 1
#pragma GCC system_header
@@ -1212,4 +1212,4 @@ namespace std
#undef _GLIBCXX_BITSET_WORDS
#undef _GLIBCXX_BITSET_BITS_PER_WORD
-#endif /* _BITSET */
+#endif /* _GLIBCXX_BITSET */
diff --git a/libstdc++-v3/include/std/std_complex.h b/libstdc++-v3/include/std/std_complex.h
index 94c30a2cde6..4978d5a8f15 100644
--- a/libstdc++-v3/include/std/std_complex.h
+++ b/libstdc++-v3/include/std/std_complex.h
@@ -40,8 +40,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _COMPLEX
-#define _COMPLEX 1
+#ifndef _GLIBCXX_COMPLEX
+#define _GLIBCXX_COMPLEX 1
#pragma GCC system_header
@@ -1062,4 +1062,4 @@ namespace std
: _M_value(_ComplexT(__z._M_value)) { }
} // namespace std
-#endif /* _COMPLEX */
+#endif /* _GLIBCXX_COMPLEX */
diff --git a/libstdc++-v3/include/std/std_deque.h b/libstdc++-v3/include/std/std_deque.h
index 588c7c5576f..7200220975c 100644
--- a/libstdc++-v3/include/std/std_deque.h
+++ b/libstdc++-v3/include/std/std_deque.h
@@ -1,6 +1,6 @@
// <deque> -*- 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
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _DEQUE
-#define _DEQUE 1
+#ifndef _GLIBCXX_DEQUE
+#define _GLIBCXX_DEQUE 1
#pragma GCC system_header
@@ -70,9 +70,8 @@
#include <bits/stl_uninitialized.h>
#include <bits/stl_deque.h>
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# include <bits/deque.tcc>
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/deque.tcc>
#endif
-#endif /* _DEQUE */
-
+#endif /* _GLIBCXX_DEQUE */
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index 209be67bd57..406ff1e2921 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -37,8 +37,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _FSTREAM
-#define _FSTREAM 1
+#ifndef _GLIBCXX_FSTREAM
+#define _GLIBCXX_FSTREAM 1
#pragma GCC system_header
@@ -82,7 +82,6 @@ namespace std
typedef __basic_file<char> __file_type;
typedef typename traits_type::state_type __state_type;
typedef codecvt<char_type, char, __state_type> __codecvt_type;
- typedef ctype<char_type> __ctype_type;
//@}
friend class ios_base; // For sync_with_stdio.
@@ -179,6 +178,32 @@ namespace std
/**
* @if maint
+ * Buffer for external characters. Used for input when
+ * codecvt::always_noconv() == false. When valid, this corresponds
+ * to eback().
+ * @endif
+ */
+ char* _M_ext_buf;
+
+ /**
+ * @if maint
+ * Size of buffer held by _M_ext_buf.
+ * @endif
+ */
+ streamsize _M_ext_buf_size;
+
+ /**
+ * @if maint
+ * Pointers into the buffer held by _M_ext_buf that delimit a
+ * subsequence of bytes that have been read but not yet converted.
+ * When valid, _M_ext_next corresponds to egptr().
+ * @endif
+ */
+ const char* _M_ext_next;
+ char* _M_ext_end;
+
+ /**
+ * @if maint
* Initializes pback buffers, and moves normal buffers to safety.
* Assumptions:
* _M_in_cur has already been moved back
@@ -365,7 +390,7 @@ namespace std
// NB: _M_file.sync() will be called within.
if (this->pbase() < this->pptr())
{
- int_type __tmp = this->overflow();
+ const int_type __tmp = this->overflow();
if (traits_type::eq_int_type(__tmp, traits_type::eof()))
__ret = -1;
else
@@ -407,8 +432,7 @@ namespace std
// [documentation is inherited]
virtual streamsize
- xsputn(const char_type* __s, streamsize __n)
- { return __streambuf_type::xsputn(__s, __n); }
+ xsputn(const char_type* __s, streamsize __n);
/**
* @if maint
@@ -821,11 +845,8 @@ namespace std
};
} // namespace std
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
-#endif
-#ifdef _GLIBCXX_FULLY_COMPLIANT_HEADERS
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/fstream.tcc>
#endif
-#endif
+#endif /* _GLIBCXX_FSTREAM */
diff --git a/libstdc++-v3/include/std/std_functional.h b/libstdc++-v3/include/std/std_functional.h
index 0d438589922..0330eda8e14 100644
--- a/libstdc++-v3/include/std/std_functional.h
+++ b/libstdc++-v3/include/std/std_functional.h
@@ -46,15 +46,15 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _FUNCTIONAL
-#define _FUNCTIONAL 1
+#ifndef _GLIBCXX_FUNCTIONAL
+#define _GLIBCXX_FUNCTIONAL 1
#pragma GCC system_header
#include <bits/c++config.h>
#include <cstddef>
#include <bits/stl_function.h>
-#endif /* _FUNCTIONAL */
+#endif /* _GLIBCXX_FUNCTIONAL */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/std/std_iomanip.h b/libstdc++-v3/include/std/std_iomanip.h
index 3adb0dd2bf2..0d965c28bf9 100644
--- a/libstdc++-v3/include/std/std_iomanip.h
+++ b/libstdc++-v3/include/std/std_iomanip.h
@@ -37,8 +37,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _IOMANIP
-#define _IOMANIP 1
+#ifndef _GLIBCXX_IOMANIP
+#define _GLIBCXX_IOMANIP 1
#pragma GCC system_header
@@ -297,4 +297,4 @@ namespace std
#endif
} // namespace std
-#endif
+#endif /* _GLIBCXX_IOMANIP */
diff --git a/libstdc++-v3/include/std/std_ios.h b/libstdc++-v3/include/std/std_ios.h
index 76d10d759ae..596458f1ede 100644
--- a/libstdc++-v3/include/std/std_ios.h
+++ b/libstdc++-v3/include/std/std_ios.h
@@ -36,8 +36,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _IOS
-#define _IOS 1
+#ifndef _GLIBCXX_IOS
+#define _GLIBCXX_IOS 1
#pragma GCC system_header
@@ -50,5 +50,4 @@
#include <streambuf>
#include <bits/basic_ios.h>
-#endif /* _IOS */
-
+#endif /* _GLIBCXX_IOS */
diff --git a/libstdc++-v3/include/std/std_iosfwd.h b/libstdc++-v3/include/std/std_iosfwd.h
index a4877ef1677..0d275a77e27 100644
--- a/libstdc++-v3/include/std/std_iosfwd.h
+++ b/libstdc++-v3/include/std/std_iosfwd.h
@@ -37,8 +37,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _IOSFWD
-#define _IOSFWD 1
+#ifndef _GLIBCXX_IOSFWD
+#define _GLIBCXX_IOSFWD 1
#pragma GCC system_header
@@ -165,4 +165,4 @@ namespace std
/** @} */
} // namespace std
-#endif
+#endif /* _GLIBCXX_IOSFWD */
diff --git a/libstdc++-v3/include/std/std_iostream.h b/libstdc++-v3/include/std/std_iostream.h
index 4b025f7287c..f5049db4a91 100644
--- a/libstdc++-v3/include/std/std_iostream.h
+++ b/libstdc++-v3/include/std/std_iostream.h
@@ -36,8 +36,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _IOSTREAM
-#define _IOSTREAM 1
+#ifndef _GLIBCXX_IOSTREAM
+#define _GLIBCXX_IOSTREAM 1
#pragma GCC system_header
@@ -77,4 +77,4 @@ namespace std
static ios_base::Init __ioinit;
} // namespace std
-#endif
+#endif /* _GLIBCXX_IOSTREAM */
diff --git a/libstdc++-v3/include/std/std_istream.h b/libstdc++-v3/include/std/std_istream.h
index a8621f6c15f..ce4e61168ce 100644
--- a/libstdc++-v3/include/std/std_istream.h
+++ b/libstdc++-v3/include/std/std_istream.h
@@ -37,8 +37,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _ISTREAM
-#define _ISTREAM 1
+#ifndef _GLIBCXX_ISTREAM
+#define _GLIBCXX_ISTREAM 1
#pragma GCC system_header
@@ -70,8 +70,8 @@ namespace std
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
- typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
- typedef num_get<_CharT, __istreambuf_iter> __numget_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
typedef ctype<_CharT> __ctype_type;
template<typename _CharT2, typename _Traits2>
@@ -768,11 +768,8 @@ namespace std
ws(basic_istream<_CharT, _Traits>& __is);
} // namespace std
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
-#endif
-#ifdef _GLIBCXX_FULLY_COMPLIANT_HEADERS
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/istream.tcc>
#endif
-#endif /* _ISTREAM */
+#endif /* _GLIBCXX_ISTREAM */
diff --git a/libstdc++-v3/include/std/std_iterator.h b/libstdc++-v3/include/std/std_iterator.h
index 2936cda86ac..3da3e90a414 100644
--- a/libstdc++-v3/include/std/std_iterator.h
+++ b/libstdc++-v3/include/std/std_iterator.h
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _ITERATOR
-#define _ITERATOR 1
+#ifndef _GLIBCXX_ITERATOR
+#define _GLIBCXX_ITERATOR 1
#pragma GCC system_header
#include <bits/c++config.h>
@@ -72,7 +72,7 @@
#include <bits/stream_iterator.h>
#include <bits/streambuf_iterator.h>
-#endif /* _ITERATOR */
+#endif /* _GLIBCXX_ITERATOR */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/std/std_limits.h b/libstdc++-v3/include/std/std_limits.h
index efd55e417be..7f96647f95d 100644
--- a/libstdc++-v3/include/std/std_limits.h
+++ b/libstdc++-v3/include/std/std_limits.h
@@ -40,8 +40,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _NUMERIC_LIMITS
-#define _NUMERIC_LIMITS 1
+#ifndef _GLIBCXX_NUMERIC_LIMITS
+#define _GLIBCXX_NUMERIC_LIMITS 1
#pragma GCC system_header
@@ -1140,4 +1140,4 @@ namespace std
#undef __glibcxx_digits
#undef __glibcxx_digits10
-#endif // _NUMERIC_LIMITS
+#endif // _GLIBCXX_NUMERIC_LIMITS
diff --git a/libstdc++-v3/include/std/std_list.h b/libstdc++-v3/include/std/std_list.h
index 9a8e8a9a162..f882bf7e5ee 100644
--- a/libstdc++-v3/include/std/std_list.h
+++ b/libstdc++-v3/include/std/std_list.h
@@ -1,6 +1,6 @@
// <list> -*- 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
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _LIST
-#define _LIST 1
+#ifndef _GLIBCXX_LIST
+#define _GLIBCXX_LIST 1
#pragma GCC system_header
@@ -70,9 +70,9 @@
#include <bits/stl_uninitialized.h>
#include <bits/stl_list.h>
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# include <bits/list.tcc>
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/list.tcc>
#endif
-#endif /* _LIST */
+#endif /* _GLIBCXX_LIST */
diff --git a/libstdc++-v3/include/std/std_locale.h b/libstdc++-v3/include/std/std_locale.h
index 9c3a101159e..43417fbdddc 100644
--- a/libstdc++-v3/include/std/std_locale.h
+++ b/libstdc++-v3/include/std/std_locale.h
@@ -36,8 +36,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _LOCALE
-#define _LOCALE 1
+#ifndef _GLIBCXX_LOCALE
+#define _GLIBCXX_LOCALE 1
#pragma GCC system_header
@@ -46,4 +46,4 @@
#include <bits/locale_facets.h>
#include <bits/locale_facets.tcc>
-#endif
+#endif /* _GLIBCXX_LOCALE */
diff --git a/libstdc++-v3/include/std/std_map.h b/libstdc++-v3/include/std/std_map.h
index 7965394dc51..f4e0ca1aafc 100644
--- a/libstdc++-v3/include/std/std_map.h
+++ b/libstdc++-v3/include/std/std_map.h
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _MAP
-#define _MAP 1
+#ifndef _GLIBCXX_MAP
+#define _GLIBCXX_MAP 1
#pragma GCC system_header
@@ -67,7 +67,7 @@
#include <bits/stl_map.h>
#include <bits/stl_multimap.h>
-#endif /* _MAP */
+#endif /* _GLIBCXX_MAP */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/std/std_memory.h b/libstdc++-v3/include/std/std_memory.h
index 68076897ec6..3b7cefaefb0 100644
--- a/libstdc++-v3/include/std/std_memory.h
+++ b/libstdc++-v3/include/std/std_memory.h
@@ -46,8 +46,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _MEMORY
-#define _MEMORY 1
+#ifndef _GLIBCXX_MEMORY
+#define _GLIBCXX_MEMORY 1
#pragma GCC system_header
@@ -355,4 +355,4 @@ namespace std
};
} // namespace std
-#endif
+#endif /* _GLIBCXX_MEMORY */
diff --git a/libstdc++-v3/include/std/std_numeric.h b/libstdc++-v3/include/std/std_numeric.h
index c287f925a16..f46150872e9 100644
--- a/libstdc++-v3/include/std/std_numeric.h
+++ b/libstdc++-v3/include/std/std_numeric.h
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _NUMERIC
-#define _NUMERIC 1
+#ifndef _GLIBCXX_NUMERIC
+#define _GLIBCXX_NUMERIC 1
#pragma GCC system_header
#include <bits/c++config.h>
@@ -68,7 +68,7 @@
#include <bits/stl_function.h>
#include <bits/stl_numeric.h>
-#endif /* _NUMERIC */
+#endif /* _GLIBCXX_NUMERIC */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/std/std_ostream.h b/libstdc++-v3/include/std/std_ostream.h
index b20354dc520..27669549ce0 100644
--- a/libstdc++-v3/include/std/std_ostream.h
+++ b/libstdc++-v3/include/std/std_ostream.h
@@ -37,8 +37,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _OSTREAM
-#define _OSTREAM 1
+#ifndef _GLIBCXX_OSTREAM
+#define _GLIBCXX_OSTREAM 1
#pragma GCC system_header
@@ -69,8 +69,8 @@ namespace std
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_ostream<_CharT, _Traits> __ostream_type;
- typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
- typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
typedef ctype<_CharT> __ctype_type;
template<typename _CharT2, typename _Traits2>
@@ -541,11 +541,8 @@ namespace std
} // namespace std
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
-#endif
-#ifdef _GLIBCXX_FULLY_COMPLIANT_HEADERS
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/ostream.tcc>
#endif
-#endif /* _OSTREAM */
+#endif /* _GLIBCXX_OSTREAM */
diff --git a/libstdc++-v3/include/std/std_queue.h b/libstdc++-v3/include/std/std_queue.h
index cd6e5ec6dfe..e2e0b845e45 100644
--- a/libstdc++-v3/include/std/std_queue.h
+++ b/libstdc++-v3/include/std/std_queue.h
@@ -1,6 +1,6 @@
// <queue> -*- 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
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _QUEUE
-#define _QUEUE 1
+#ifndef _GLIBCXX_QUEUE
+#define _GLIBCXX_QUEUE 1
#pragma GCC system_header
#include <bits/c++config.h>
@@ -74,9 +74,9 @@
#include <bits/stl_function.h>
#include <bits/stl_queue.h>
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/deque.tcc>
# include <bits/vector.tcc>
#endif
-#endif /* _QUEUE */
+#endif /* _GLIBCXX_QUEUE */
diff --git a/libstdc++-v3/include/std/std_set.h b/libstdc++-v3/include/std/std_set.h
index d59af35b8c5..8dbed180ace 100644
--- a/libstdc++-v3/include/std/std_set.h
+++ b/libstdc++-v3/include/std/std_set.h
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _SET
-#define _SET 1
+#ifndef _GLIBCXX_SET
+#define _GLIBCXX_SET 1
#pragma GCC system_header
@@ -67,7 +67,7 @@
#include <bits/stl_set.h>
#include <bits/stl_multiset.h>
-#endif /* _SET */
+#endif /* _GLIBCXX_SET */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h
index dcdb7a713bf..c856eb03101 100644
--- a/libstdc++-v3/include/std/std_sstream.h
+++ b/libstdc++-v3/include/std/std_sstream.h
@@ -36,8 +36,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _SSTREAM
-#define _SSTREAM 1
+#ifndef _GLIBCXX_SSTREAM
+#define _GLIBCXX_SSTREAM 1
#pragma GCC system_header
@@ -641,11 +641,8 @@ namespace std
};
} // namespace std
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
-#endif
-#ifdef _GLIBCXX_FULLY_COMPLIANT_HEADERS
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/sstream.tcc>
#endif
-#endif
+#endif /* _GLIBCXX_SSTREAM */
diff --git a/libstdc++-v3/include/std/std_stack.h b/libstdc++-v3/include/std/std_stack.h
index 1da582ee957..80178528516 100644
--- a/libstdc++-v3/include/std/std_stack.h
+++ b/libstdc++-v3/include/std/std_stack.h
@@ -1,6 +1,6 @@
// <stack> -*- 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
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _STACK
-#define _STACK 1
+#ifndef _GLIBCXX_STACK
+#define _GLIBCXX_STACK 1
#pragma GCC system_header
@@ -70,8 +70,8 @@
#include <bits/stl_deque.h>
#include <bits/stl_stack.h>
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# include <bits/deque.tcc>
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/deque.tcc>
#endif
-#endif /* _STACK */
+#endif /* _GLIBCXX_STACK */
diff --git a/libstdc++-v3/include/std/std_stdexcept.h b/libstdc++-v3/include/std/std_stdexcept.h
index 38ff1ad219d..ebd97f50f88 100644
--- a/libstdc++-v3/include/std/std_stdexcept.h
+++ b/libstdc++-v3/include/std/std_stdexcept.h
@@ -36,8 +36,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _STDEXCEPT
-#define _STDEXCEPT 1
+#ifndef _GLIBCXX_STDEXCEPT
+#define _GLIBCXX_STDEXCEPT 1
#pragma GCC system_header
@@ -145,4 +145,4 @@ namespace std
};
} // namespace std
-#endif // _STDEXCEPT
+#endif /* _GLIBCXX_STDEXCEPT */
diff --git a/libstdc++-v3/include/std/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h
index 1946d50cd12..dc43db0bddf 100644
--- a/libstdc++-v3/include/std/std_streambuf.h
+++ b/libstdc++-v3/include/std/std_streambuf.h
@@ -37,8 +37,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _STREAMBUF
-#define _STREAMBUF 1
+#ifndef _CLIBXX_STREAMBUF
+#define _CLIBXX_STREAMBUF 1
#pragma GCC system_header
@@ -140,12 +140,10 @@ namespace std
//@{
/**
* @if maint
- * These are non-standard types.
+ * This is a non-standard type.
* @endif
*/
- typedef ctype<char_type> __ctype_type;
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
- typedef typename traits_type::state_type __state_type;
//@}
friend class basic_ios<char_type, traits_type>;
@@ -777,11 +775,8 @@ namespace std
};
} // namespace std
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# define export
-#endif
-#ifdef _GLIBCXX_FULLY_COMPLIANT_HEADERS
-#include <bits/streambuf.tcc>
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/streambuf.tcc>
#endif
-#endif
+#endif /* _GLIBCXX_STREAMBUF */
diff --git a/libstdc++-v3/include/std/std_string.h b/libstdc++-v3/include/std/std_string.h
index f365a32dc93..2b15658c768 100644
--- a/libstdc++-v3/include/std/std_string.h
+++ b/libstdc++-v3/include/std/std_string.h
@@ -1,6 +1,6 @@
// Components for manipulating sequences of characters -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -37,8 +37,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _STRING
-#define _STRING 1
+#ifndef _GLIBCXX_STRING
+#define _GLIBCXX_STRING 1
#pragma GCC system_header
@@ -52,10 +52,9 @@
#include <bits/stl_function.h> // For less
#include <bits/basic_string.h>
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <algorithm> // for find_if
# include <bits/basic_string.tcc>
#endif
-#endif /* _STRING */
-
+#endif /* _GLIBCXX_STRING */
diff --git a/libstdc++-v3/include/std/std_utility.h b/libstdc++-v3/include/std/std_utility.h
index a0d7bbe8d57..f5793425b22 100644
--- a/libstdc++-v3/include/std/std_utility.h
+++ b/libstdc++-v3/include/std/std_utility.h
@@ -58,15 +58,15 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _UTILITY
-#define _UTILITY 1
+#ifndef _GLIBCXX_UTILITY
+#define _GLIBCXX_UTILITY 1
#pragma GCC system_header
#include <bits/c++config.h>
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
-#endif /* _UTILITY */
+#endif /* _GLIBCXX_UTILITY */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/std/std_valarray.h b/libstdc++-v3/include/std/std_valarray.h
index 4656dc3b753..09367488c8b 100644
--- a/libstdc++-v3/include/std/std_valarray.h
+++ b/libstdc++-v3/include/std/std_valarray.h
@@ -35,8 +35,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _VALARRAY
-#define _VALARRAY 1
+#ifndef _GLIBCXX_VALARRAY
+#define _GLIBCXX_VALARRAY 1
#pragma GCC system_header
@@ -689,7 +689,7 @@ _DEFINE_BINARY_OPERATOR(>=, __greater_equal)
} // namespace std
-#endif // _VALARRAY
+#endif /* _GLIBCXX_VALARRAY */
// Local Variables:
// mode:c++
diff --git a/libstdc++-v3/include/std/std_vector.h b/libstdc++-v3/include/std/std_vector.h
index 336f7bf2ddb..02cf1229148 100644
--- a/libstdc++-v3/include/std/std_vector.h
+++ b/libstdc++-v3/include/std/std_vector.h
@@ -1,6 +1,6 @@
// <vector> -*- 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
@@ -58,8 +58,8 @@
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
*/
-#ifndef _VECTOR
-#define _VECTOR 1
+#ifndef _GLIBCXX_VECTOR
+#define _GLIBCXX_VECTOR 1
#pragma GCC system_header
@@ -71,9 +71,9 @@
#include <bits/stl_vector.h>
#include <bits/stl_bvector.h>
-#ifdef _GLIBCXX_NO_TEMPLATE_EXPORT
-# include <bits/vector.tcc>
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/vector.tcc>
#endif
-#endif /* _VECTOR */
+#endif /* _GLIBCXX_VECTOR */
diff --git a/libstdc++-v3/libmath/Makefile.am b/libstdc++-v3/libmath/Makefile.am
index 7a254011899..091b4a46bd3 100644
--- a/libstdc++-v3/libmath/Makefile.am
+++ b/libstdc++-v3/libmath/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for the math subdirectory of the GNU C++ Standard library.
##
-## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
## Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
@@ -22,23 +22,17 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-AUTOMAKE_OPTIONS = 1.3 cygnus
-
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
noinst_LTLIBRARIES = libmath.la
-libmath_la_LIBADD = @LIBMATHOBJS@
+libmath_la_LIBADD = $(LIBMATHOBJS)
libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
libmath_la_SOURCES = stubs.c
-# Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-
-INCLUDES = \
- $(TOPLEVEL_INCLUDES)
+AM_CPPFLAGS = $(CANADIAN_INCLUDES)
# Only compiling "C" sources in this directory.
LIBTOOL = @LIBTOOL@ --tag CC
diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in
index b2f688d990c..f9023ffb051 100644
--- a/libstdc++-v3/libmath/Makefile.in
+++ b/libstdc++-v3/libmath/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,62 +12,40 @@
# 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 = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
@@ -74,6 +54,7 @@ CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
@@ -82,54 +63,107 @@ CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FPOS_H = @FPOS_H@
FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-GLIBCXX_IS_CROSS_COMPILING = @GLIBCXX_IS_CROSS_COMPILING@
+GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
+GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
+GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
+GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBMATHOBJS = @LIBMATHOBJS@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
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@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
-OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
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@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+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_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
check_msgfmt = @check_msgfmt@
+datadir = @datadir@
enable_shared = @enable_shared@
enable_static = @enable_static@
-glibcxx_CXX = @glibcxx_CXX@
+exec_prefix = @exec_prefix@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
-glibcxx_basedir = @glibcxx_basedir@
glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
@@ -138,110 +172,104 @@ glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
-ifGNUmake = @ifGNUmake@
+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@
libtool_VERSION = @libtool_VERSION@
+localstatedir = @localstatedir@
+mandir = @mandir@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
toplevel_srcdir = @toplevel_srcdir@
-AUTOMAKE_OPTIONS = 1.3 cygnus
-
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
noinst_LTLIBRARIES = libmath.la
-libmath_la_LIBADD = @LIBMATHOBJS@
+libmath_la_LIBADD = $(LIBMATHOBJS)
libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
libmath_la_SOURCES = stubs.c
-# Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-
-INCLUDES = \
- $(TOPLEVEL_INCLUDES)
-
-
-# Only compiling "C" sources in this directory.
-LIBTOOL = @LIBTOOL@ --tag CC
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-libmath_la_LDFLAGS =
-libmath_la_OBJECTS = stubs.lo
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_CPPFLAGS = $(CANADIAN_INCLUDES)
+subdir = libmath
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+
+libmath_la_LDFLAGS =
+am_libmath_la_OBJECTS = stubs.lo
+libmath_la_OBJECTS = $(am_libmath_la_OBJECTS)
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+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 $@
-DIST_COMMON = Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = gtar
-GZIP_ENV = --best
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(libmath_la_SOURCES)
+DIST_COMMON = Makefile.am Makefile.in
SOURCES = $(libmath_la_SOURCES)
-OBJECTS = $(libmath_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) --cygnus libmath/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+all: all-am
-
-mostlyclean-noinstLTLIBRARIES:
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libmath/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
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
+libmath.la: $(libmath_la_OBJECTS) $(libmath_la_DEPENDENCIES)
+ $(LINK) $(libmath_la_LDFLAGS) $(libmath_la_OBJECTS) $(libmath_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
@@ -250,132 +278,180 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
-maintainer-clean-libtool:
+ETAGS = etags
+ETAGSFLAGS =
-libmath.la: $(libmath_la_OBJECTS) $(libmath_la_DEPENDENCIES)
- $(LINK) $(libmath_la_LDFLAGS) $(libmath_la_OBJECTS) $(libmath_la_LIBADD) $(LIBS)
+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) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(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) $(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)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$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) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ 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; }'`; \
+ 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)
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = libmath
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ @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 \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ 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 \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am:
+check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
-install-exec-am:
-install-exec: install-exec-am
+all-am: Makefile $(LTLIBRARIES)
-install-data-am:
+installdirs:
+install: install-am
+install-exec: install-exec-am
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: uninstall-am
-all-am: Makefile $(LTLIBRARIES)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-
+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-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-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
-clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \
- clean-tags clean-generic mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
-distclean-am: distclean-noinstLTLIBRARIES distclean-compile \
- distclean-libtool distclean-tags distclean-generic \
- clean-am
- -rm -f libtool
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: 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-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
-.PHONY: 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 tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-info-am \
-install-info install-exec-am install-exec install-data-am install-data \
-install-am install uninstall-am uninstall all-redirect all-am all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+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-info-am
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am 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-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index 344c50c8480..50727402c13 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -19,54 +19,20 @@
## 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.
-
-AUTOMAKE_OPTIONS = 1.3 cygnus
-MAINT_CHARSET = latin1
-
-mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
-
-# Cross compiler and multilib support.
-CC = @CC@
-CXX = @glibcxx_CXX@
-toolexecdir = @glibcxx_toolexecdir@
-toolexeclibdir = @glibcxx_toolexeclibdir@
+## Boston, MA 02111-1307, USA.
+include $(top_srcdir)/fragment.am
# Need this library to both be part of libstdc++.a, and installed
# separately too.
-# 1) separate libsupc++.la
+# 1) separate libsupc++.la
toolexeclib_LTLIBRARIES = libsupc++.la
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
noinst_LTLIBRARIES = libsupc++convenience.la
-# Compile flags that should be constant throughout the build, both for
-# SUBDIRS and for libstdc++-v3 in general.
-OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
-
-# These bits are all figured out from configure. Look in acinclude.m4
-# or configure.in to see how they are set. See GLIBCXX_EXPORT_FLAGS
-# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
-CONFIG_CXXFLAGS = \
- @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@
-
-# Warning flags to use.
-WARN_CXXFLAGS = \
- @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
-
-LIBSUPCXX_CXXFLAGS = @LIBSUPCXX_PICFLAGS@
-
-# Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-GCC_INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include
-
-INCLUDES = \
- $(GCC_INCLUDES) $(GLIBCXX_INCLUDES) $(LIBSUPCXX_INCLUDES)
-
headers = \
- exception new typeinfo cxxabi.h exception_defines.h
+ exception new typeinfo cxxabi.h exception_defines.h
sources = \
del_op.cc \
@@ -96,8 +62,8 @@ sources = \
vec.cc \
vterminate.cc
-libsupc___la_SOURCES = $(sources)
-libsupc__convenience_la_SOURCES = $(sources)
+libsupc___la_SOURCES = $(sources)
+libsupc__convenience_la_SOURCES = $(sources)
glibcxxinstalldir = $(gxx_include_dir)
glibcxxinstall_HEADERS = $(headers)
@@ -106,13 +72,13 @@ glibcxxinstall_HEADERS = $(headers)
# modified in a per-library or per-sub-library way. Need to manually
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
-# as the occasion call for it.
+# as the occasion call for it.
AM_CXXFLAGS = \
-fno-implicit-templates \
- $(LIBSUPCXX_CXXFLAGS) \
+ $(LIBSUPCXX_PICFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
- $(CONFIG_CXXFLAGS)
+ $(CONFIG_CXXFLAGS)
AM_MAKEFLAGS = \
"gxx_include_dir=$(gxx_include_dir)"
@@ -139,8 +105,8 @@ AM_MAKEFLAGS = \
# We have to put --tag disable-shared after --tag CXX lest things
# CXX undo the affect of disable-shared.
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
- --mode=compile $(CXX) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
+ --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
# 3) We'd have a problem when building the shared libstdc++ object if
# the rules automake generates would be used. We cannot allow g++ to
@@ -149,8 +115,8 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
# directory to configure libstdc++-v3 to use gcc as the C++
# compilation driver.
CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
- --mode=link $(CXX) \
- @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+ --mode=link $(CXX) \
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
# We have to have rules modified from the default to counteract SUN make
# prepending each of $(glibcxxinstall_HEADERS) with VPATH below.
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 0d7bcb1bd2b..2806ac2a798 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/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,69 +12,49 @@
# 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 = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
+CC = @CC@
CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
@@ -81,36 +63,76 @@ CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
+CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FPOS_H = @FPOS_H@
FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
-GLIBCXX_IS_CROSS_COMPILING = @GLIBCXX_IS_CROSS_COMPILING@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
+GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
+GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
+GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
+GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
+GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBMATHOBJS = @LIBMATHOBJS@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
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@
+OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
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@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
@@ -118,15 +140,28 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+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_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
check_msgfmt = @check_msgfmt@
+datadir = @datadir@
enable_shared = @enable_shared@
enable_static = @enable_static@
-glibcxx_CXX = @glibcxx_CXX@
+exec_prefix = @exec_prefix@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
-glibcxx_basedir = @glibcxx_basedir@
glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
@@ -135,57 +170,64 @@ glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
-ifGNUmake = @ifGNUmake@
+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@
libtool_VERSION = @libtool_VERSION@
+localstatedir = @localstatedir@
+mandir = @mandir@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
toplevel_srcdir = @toplevel_srcdir@
-AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
-# Cross compiler and multilib support.
-CC = @CC@
-CXX = @glibcxx_CXX@
-toolexecdir = @glibcxx_toolexecdir@
-toolexeclibdir = @glibcxx_toolexeclibdir@
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
-# Need this library to both be part of libstdc++.a, and installed
-# separately too.
-# 1) separate libsupc++.la
-toolexeclib_LTLIBRARIES = libsupc++.la
-# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
-noinst_LTLIBRARIES = libsupc++convenience.la
-
-# Compile flags that should be constant throughout the build, both for
-# SUBDIRS and for libstdc++-v3 in general.
-OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
-
-# These bits are all figured out from configure. Look in acinclude.m4
-# or configure.in to see how they are set. See GLIBCXX_EXPORT_FLAGS
-# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
- @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@
-
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
-# Warning flags to use.
WARN_CXXFLAGS = \
- @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
-LIBSUPCXX_CXXFLAGS = @LIBSUPCXX_PICFLAGS@
-
-# Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-GCC_INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include
-
-INCLUDES = \
- $(GCC_INCLUDES) $(GLIBCXX_INCLUDES) $(LIBSUPCXX_INCLUDES)
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
+# Need this library to both be part of libstdc++.a, and installed
+# separately too.
+# 1) separate libsupc++.la
+toolexeclib_LTLIBRARIES = libsupc++.la
+# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
+noinst_LTLIBRARIES = libsupc++convenience.la
headers = \
- exception new typeinfo cxxabi.h exception_defines.h
+ exception new typeinfo cxxabi.h exception_defines.h
sources = \
@@ -217,8 +259,8 @@ sources = \
vterminate.cc
-libsupc___la_SOURCES = $(sources)
-libsupc__convenience_la_SOURCES = $(sources)
+libsupc___la_SOURCES = $(sources)
+libsupc__convenience_la_SOURCES = $(sources)
glibcxxinstalldir = $(gxx_include_dir)
glibcxxinstall_HEADERS = $(headers)
@@ -227,13 +269,13 @@ glibcxxinstall_HEADERS = $(headers)
# modified in a per-library or per-sub-library way. Need to manually
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
-# as the occasion call for it.
+# as the occasion call for it.
AM_CXXFLAGS = \
-fno-implicit-templates \
- $(LIBSUPCXX_CXXFLAGS) \
+ $(LIBSUPCXX_PICFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
- $(CONFIG_CXXFLAGS)
+ $(CONFIG_CXXFLAGS)
AM_MAKEFLAGS = \
@@ -262,8 +304,8 @@ AM_MAKEFLAGS = \
# We have to put --tag disable-shared after --tag CXX lest things
# CXX undo the affect of disable-shared.
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
- --mode=compile $(CXX) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
+ --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
# 3) We'd have a problem when building the shared libstdc++ object if
@@ -273,127 +315,109 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
# directory to configure libstdc++-v3 to use gcc as the C++
# compilation driver.
CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
- --mode=link $(CXX) \
- @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
-
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
+ --mode=link $(CXX) \
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-libsupc__convenience_la_LDFLAGS =
-libsupc__convenience_la_LIBADD =
-libsupc__convenience_la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo \
-del_opvnt.lo eh_alloc.lo eh_aux_runtime.lo eh_catch.lo eh_exception.lo \
-eh_globals.lo eh_personality.lo eh_term_handler.lo eh_terminate.lo \
-eh_throw.lo eh_type.lo eh_unex_handler.lo guard.lo new_handler.lo \
-new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo pure.lo tinfo.lo \
-tinfo2.lo vec.lo vterminate.lo
-libsupc___la_LDFLAGS =
-libsupc___la_LIBADD =
-libsupc___la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo del_opvnt.lo \
-eh_alloc.lo eh_aux_runtime.lo eh_catch.lo eh_exception.lo eh_globals.lo \
-eh_personality.lo eh_term_handler.lo eh_terminate.lo eh_throw.lo \
-eh_type.lo eh_unex_handler.lo guard.lo new_handler.lo new_op.lo \
-new_opnt.lo new_opv.lo new_opvnt.lo pure.lo tinfo.lo tinfo2.lo vec.lo \
-vterminate.lo
-CXXFLAGS = @CXXFLAGS@
-CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+subdir = libsupc++
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
+
+libsupc___la_LDFLAGS =
+libsupc___la_LIBADD =
+am__objects_1 = del_op.lo del_opnt.lo del_opv.lo del_opvnt.lo \
+ eh_alloc.lo eh_aux_runtime.lo eh_catch.lo eh_exception.lo \
+ eh_globals.lo eh_personality.lo eh_term_handler.lo \
+ eh_terminate.lo eh_throw.lo eh_type.lo eh_unex_handler.lo \
+ guard.lo new_handler.lo new_op.lo new_opnt.lo new_opv.lo \
+ new_opvnt.lo pure.lo tinfo.lo tinfo2.lo vec.lo vterminate.lo
+am_libsupc___la_OBJECTS = $(am__objects_1)
+libsupc___la_OBJECTS = $(am_libsupc___la_OBJECTS)
+libsupc__convenience_la_LDFLAGS =
+libsupc__convenience_la_LIBADD =
+am_libsupc__convenience_la_OBJECTS = $(am__objects_1)
+libsupc__convenience_la_OBJECTS = $(am_libsupc__convenience_la_OBJECTS)
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
-HEADERS = $(glibcxxinstall_HEADERS)
-
-DIST_COMMON = Makefile.am Makefile.in
+DIST_SOURCES = $(libsupc___la_SOURCES) \
+ $(libsupc__convenience_la_SOURCES)
+HEADERS = $(glibcxxinstall_HEADERS)
+DIST_COMMON = $(glibcxxinstall_HEADERS) $(top_srcdir)/fragment.am \
+ Makefile.am Makefile.in
+SOURCES = $(libsupc___la_SOURCES) $(libsupc__convenience_la_SOURCES)
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+all: all-am
-TAR = gtar
-GZIP_ENV = --best
-SOURCES = $(libsupc__convenience_la_SOURCES) $(libsupc___la_SOURCES)
-OBJECTS = $(libsupc__convenience_la_OBJECTS) $(libsupc___la_OBJECTS)
-
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .cc .lo .o .obj .s
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus libsupc++/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-noinstLTLIBRARIES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/fragment.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libsupc++/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-
-distclean-noinstLTLIBRARIES:
-
-maintainer-clean-noinstLTLIBRARIES:
-
-mostlyclean-toolexeclibLTLIBRARIES:
-
-clean-toolexeclibLTLIBRARIES:
- -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
-
-distclean-toolexeclibLTLIBRARIES:
-
-maintainer-clean-toolexeclibLTLIBRARIES:
-
+ @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
+toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
@list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
- echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \
- $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(LIBTOOL) --mode=install $(toolexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(toolexeclibdir)/$$f"; \
+ $(LIBTOOL) --mode=install $(toolexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(toolexeclibdir)/$$f; \
else :; fi; \
done
uninstall-toolexeclibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
+ @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+ p="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p"; \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
done
-.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 $<
+clean-toolexeclibLTLIBRARIES:
+ -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
+ @list='$(toolexeclib_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
+libsupc++.la: $(libsupc___la_OBJECTS) $(libsupc___la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(toolexeclibdir) $(libsupc___la_LDFLAGS) $(libsupc___la_OBJECTS) $(libsupc___la_LIBADD) $(LIBS)
+libsupc++convenience.la: $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_la_DEPENDENCIES)
+ $(CXXLINK) $(libsupc__convenience_la_LDFLAGS) $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_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 $<
+.cc.o:
+ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.cc.obj:
+ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-.S.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.cc.lo:
+ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
mostlyclean-libtool:
-rm -f *.lo
@@ -402,151 +426,187 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+glibcxxinstallHEADERS_INSTALL = $(INSTALL_HEADER)
-maintainer-clean-libtool:
-
-libsupc++convenience.la: $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_la_DEPENDENCIES)
- $(CXXLINK) $(libsupc__convenience_la_LDFLAGS) $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_la_LIBADD) $(LIBS)
+ETAGS = etags
+ETAGSFLAGS =
-libsupc++.la: $(libsupc___la_OBJECTS) $(libsupc___la_DEPENDENCIES)
- $(CXXLINK) -rpath $(toolexeclibdir) $(libsupc___la_LDFLAGS) $(libsupc___la_OBJECTS) $(libsupc___la_LIBADD) $(LIBS)
-.cc.o:
- $(CXXCOMPILE) -c $<
-.cc.obj:
- $(CXXCOMPILE) -c `cygpath -w $<`
-.cc.lo:
- $(LTCXXCOMPILE) -c $<
+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) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(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) $(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)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$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) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ 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; }'`; \
+ 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)
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = libsupc++
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ $(mkinstalldirs) $(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 \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ 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 \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am:
+check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
-install-exec-am: install-toolexeclibLTLIBRARIES
-install-exec: install-exec-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-install-data-am: install-glibcxxinstallHEADERS
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) $(DESTDIR)$(glibcxxinstalldir)
+install: install-am
+install-exec: install-exec-am
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-toolexeclibLTLIBRARIES \
- uninstall-glibcxxinstallHEADERS
-uninstall: uninstall-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) \
- $(DESTDIR)$(glibcxxinstalldir)
-
+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-noinstLTLIBRARIES \
- mostlyclean-toolexeclibLTLIBRARIES 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-libtool clean-noinstLTLIBRARIES \
+ clean-toolexeclibLTLIBRARIES mostlyclean-am
-clean-am: clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES \
- clean-compile clean-libtool clean-tags clean-generic \
- mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
-distclean-am: distclean-noinstLTLIBRARIES \
- distclean-toolexeclibLTLIBRARIES distclean-compile \
- distclean-libtool distclean-tags distclean-generic \
- clean-am
- -rm -f libtool
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \
- maintainer-clean-toolexeclibLTLIBRARIES \
- 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-glibcxxinstallHEADERS
+
+install-exec-am: install-toolexeclibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
-.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \
-clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \
-mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
-clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
-uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool uninstall-glibcxxinstallHEADERS \
-install-glibcxxinstallHEADERS tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck install-info-am install-info \
-install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+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-glibcxxinstallHEADERS uninstall-info-am \
+ uninstall-toolexeclibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES \
+ clean-toolexeclibLTLIBRARIES ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am \
+ install-glibcxxinstallHEADERS install-info install-info-am \
+ install-man install-strip install-toolexeclibLTLIBRARIES \
+ 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-glibcxxinstallHEADERS \
+ uninstall-info-am uninstall-toolexeclibLTLIBRARIES
# We have to have rules modified from the default to counteract SUN make
@@ -567,7 +627,6 @@ uninstall-glibcxxinstallHEADERS:
q=`echo $$p | sed -e 's,.*/,,'`; \
rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \
done
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libstdc++-v3/libsupc++/eh_term_handler.cc b/libstdc++-v3/libsupc++/eh_term_handler.cc
index 15a2cbd92d6..f4f1193e71a 100644
--- a/libstdc++-v3/libsupc++/eh_term_handler.cc
+++ b/libstdc++-v3/libsupc++/eh_term_handler.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- std::terminate handler
-// Copyright (C) 2002 Free Software Foundation
+// Copyright (C) 2002, 2003 Free Software Foundation
//
// This file is part of GCC.
//
@@ -28,14 +28,24 @@
// the GNU General Public License.
#include "unwind-cxx.h"
+#include <bits/c++config.h>
-/* We default to the talkative, informative handler. This pulls in the
- demangler, the dyn-string utilities, and elements of the I/O library.
- For a low-memory environment, you can return to the earlier "silent death"
- handler by including <cstdlib>, initializg to "std::abort", and rebuilding
- the library. */
+/* We default to the talkative, informative handler in a normal hosted
+ library. This pulls in the demangler, the dyn-string utilities, and
+ elements of the I/O library. For a low-memory environment, you can return
+ to the earlier "silent death" handler by including <cstdlib>, initializing
+ to "std::abort", and rebuilding the library. In a freestanding mode, we
+ default to this latter approach. */
+
+#if ! _GLIBCXX_HOSTED
+# include <cstdlib>
+#endif
/* The current installed user handler. */
std::terminate_handler __cxxabiv1::__terminate_handler =
- __gnu_cxx::__verbose_terminate_handler;
+#if _GLIBCXX_HOSTED
+ __gnu_cxx::__verbose_terminate_handler;
+#else
+ std::abort;
+#endif
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index d60cccee8c7..e2c8f09df4b 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -1,6 +1,6 @@
// New abi Support -*- C++ -*-
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -83,7 +83,9 @@ namespace __cxxabiv1
{
std::size_t size = element_count * element_size + padding_size;
char *base = static_cast <char *> (alloc (size));
-
+ if (!base)
+ return base;
+
if (padding_size)
{
base += padding_size;
@@ -116,6 +118,8 @@ namespace __cxxabiv1
{
std::size_t size = element_count * element_size + padding_size;
char *base = static_cast<char *>(alloc (size));
+ if (!base)
+ return base;
if (padding_size)
{
diff --git a/libstdc++-v3/linkage.m4 b/libstdc++-v3/linkage.m4
new file mode 100644
index 00000000000..fc4e22924b9
--- /dev/null
+++ b/libstdc++-v3/linkage.m4
@@ -0,0 +1,522 @@
+dnl
+dnl This file contains stuff.
+dnl
+
+dnl
+dnl Check to see if the (math function) argument passed is
+dnl declared when using the c++ compiler
+dnl ASSUMES argument is a math function with ONE parameter
+dnl
+dnl GLIBCXX_CHECK_MATH_DECL_1
+AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_1, [
+ AC_MSG_CHECKING([for $1 declaration])
+ if test x${glibcxx_cv_func_$1_use+set} != xset; then
+ AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+ ],
+ [ $1(0);],
+ [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
+ AC_LANG_RESTORE
+ ])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_func_$1_use)
+])
+
+dnl
+dnl Check to see if the (math function) argument passed is
+dnl 1) declared when using the c++ compiler
+dnl 2) has "C" linkage
+dnl 3) if not, see if 1) and 2) for argument prepended with '_'
+dnl
+dnl Define HAVE_CARGF etc if "cargf" is declared and links
+dnl
+dnl argument 1 is name of function to check
+dnl
+dnl ASSUMES argument is a math function with ONE parameter
+dnl
+dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1
+AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, [
+ GLIBCXX_CHECK_MATH_DECL_1($1)
+ if test x$glibcxx_cv_func_$1_use = x"yes"; then
+ AC_CHECK_FUNCS($1)
+ else
+ GLIBCXX_CHECK_MATH_DECL_1(_$1)
+ if test x$glibcxx_cv_func__$1_use = x"yes"; then
+ AC_CHECK_FUNCS(_$1)
+ fi
+ fi
+])
+
+
+dnl
+dnl Like GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
+dnl of functions at once. It's an all-or-nothing check -- either
+dnl HAVE_XYZ is defined for each of the functions, or for none of them.
+dnl Doing it this way saves significant configure time.
+AC_DEFUN(GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1, [
+ AC_MSG_CHECKING([for $1 functions])
+ AC_CACHE_VAL(glibcxx_cv_func_$2_use, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <math.h>],
+ [ `for x in $3; do echo "$x (0);"; done` ],
+ [glibcxx_cv_func_$2_use=yes],
+ [glibcxx_cv_func_$2_use=no])
+ AC_LANG_RESTORE])
+ AC_MSG_RESULT($glibcxx_cv_func_$2_use)
+ if test x$glibcxx_cv_func_$2_use = x"yes"; then
+ AC_CHECK_FUNCS($3)
+ fi
+])
+
+dnl
+dnl Check to see if the (math function) argument passed is
+dnl declared when using the c++ compiler
+dnl ASSUMES argument is a math function with TWO parameters
+dnl
+dnl GLIBCXX_CHECK_MATH_DECL_2
+AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_2, [
+ AC_MSG_CHECKING([for $1 declaration])
+ if test x${glibcxx_cv_func_$1_use+set} != xset; then
+ AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <math.h>],
+ [ $1(0, 0);],
+ [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
+ AC_LANG_RESTORE
+ ])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_func_$1_use)
+])
+
+dnl
+dnl Check to see if the (math function) argument passed is
+dnl 1) declared when using the c++ compiler
+dnl 2) has "C" linkage
+dnl
+dnl Define HAVE_CARGF etc if "cargf" is declared and links
+dnl
+dnl argument 1 is name of function to check
+dnl
+dnl ASSUMES argument is a math function with TWO parameters
+dnl
+dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2
+AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2, [
+ GLIBCXX_CHECK_MATH_DECL_2($1)
+ if test x$glibcxx_cv_func_$1_use = x"yes"; then
+ AC_CHECK_FUNCS($1)
+ else
+ GLIBCXX_CHECK_MATH_DECL_2(_$1)
+ if test x$glibcxx_cv_func__$1_use = x"yes"; then
+ AC_CHECK_FUNCS(_$1)
+ fi
+ fi
+])
+
+
+dnl
+dnl Check to see if the (math function) argument passed is
+dnl declared when using the c++ compiler
+dnl ASSUMES argument is a math function with THREE parameters
+dnl
+dnl GLIBCXX_CHECK_MATH_DECL_3
+AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_3, [
+ AC_MSG_CHECKING([for $1 declaration])
+ if test x${glibcxx_cv_func_$1_use+set} != xset; then
+ AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <math.h>],
+ [ $1(0, 0, 0);],
+ [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
+ AC_LANG_RESTORE
+ ])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_func_$1_use)
+])
+
+dnl
+dnl Check to see if the (math function) argument passed is
+dnl 1) declared when using the c++ compiler
+dnl 2) has "C" linkage
+dnl
+dnl Define HAVE_CARGF etc if "cargf" is declared and links
+dnl
+dnl argument 1 is name of function to check
+dnl
+dnl ASSUMES argument is a math function with THREE parameters
+dnl
+dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3
+AC_DEFUN(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3, [
+ GLIBCXX_CHECK_MATH_DECL_3($1)
+ if test x$glibcxx_cv_func_$1_use = x"yes"; then
+ AC_CHECK_FUNCS($1)
+ else
+ GLIBCXX_CHECK_MATH_DECL_3(_$1)
+ if test x$glibcxx_cv_func__$1_use = x"yes"; then
+ AC_CHECK_FUNCS(_$1)
+ fi
+ fi
+])
+
+
+dnl
+dnl Check to see if the (stdlib function) argument passed is
+dnl 1) declared when using the c++ compiler
+dnl 2) has "C" linkage
+dnl
+dnl argument 1 is name of function to check
+dnl
+dnl ASSUMES argument is a math function with TWO parameters
+dnl
+dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2
+AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
+ AC_MSG_CHECKING([for $1 declaration])
+ if test x${glibcxx_cv_func_$1_use+set} != xset; then
+ AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [ $1(0, 0);],
+ [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
+ AC_LANG_RESTORE
+ ])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_func_$1_use)
+ if test x$glibcxx_cv_func_$1_use = x"yes"; then
+ AC_CHECK_FUNCS($1)
+ fi
+])
+
+
+dnl
+dnl Check to see if the (stdlib function) argument passed is
+dnl 1) declared when using the c++ compiler
+dnl 2) has "C" linkage
+dnl
+dnl argument 1 is name of function to check
+dnl
+dnl ASSUMES argument is a function with THREE parameters
+dnl
+dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3
+AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
+ AC_MSG_CHECKING([for $1 declaration])
+ if test x${glibcxx_cv_func_$1_use+set} != xset; then
+ AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [ $1(0, 0, 0);],
+ [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
+ AC_LANG_RESTORE
+ ])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_func_$1_use)
+ if test x$glibcxx_cv_func_$1_use = x"yes"; then
+ AC_CHECK_FUNCS($1)
+ fi
+])
+
+dnl
+dnl Because the builtins are picky picky picky about the arguments they take,
+dnl do an explict linkage tests here.
+dnl Check to see if the (math function) argument passed is
+dnl 1) declared when using the c++ compiler
+dnl 2) has "C" linkage
+dnl
+dnl Define HAVE_CARGF etc if "cargf" is declared and links
+dnl
+dnl argument 1 is name of function to check
+dnl
+dnl ASSUMES argument is a math function with ONE parameter
+dnl
+dnl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
+AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
+ AC_MSG_CHECKING([for $1 declaration])
+ if test x${glibcxx_cv_func_$1_use+set} != xset; then
+ AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <math.h>],
+ [ $1(0);],
+ [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
+ AC_LANG_RESTORE
+ ])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_func_$1_use)
+ if test x$glibcxx_cv_func_$1_use = x"yes"; then
+ AC_MSG_CHECKING([for $1 linkage])
+ if test x${glibcxx_cv_func_$1_link+set} != xset; then
+ AC_CACHE_VAL(glibcxx_cv_func_$1_link, [
+ AC_TRY_LINK([#include <math.h>],
+ [ $1(0);],
+ [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no])
+ ])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_func_$1_link)
+ if test x$glibcxx_cv_func_$1_link = x"yes"; then
+ ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED(${ac_tr_func})
+ fi
+ fi
+])
+
+
+dnl
+dnl Check to see what builtin math functions are supported
+dnl
+dnl check for __builtin_abs
+dnl check for __builtin_fabsf
+dnl check for __builtin_fabs
+dnl check for __builtin_fabl
+dnl check for __builtin_labs
+dnl check for __builtin_sqrtf
+dnl check for __builtin_sqrtl
+dnl check for __builtin_sqrt
+dnl check for __builtin_sinf
+dnl check for __builtin_sin
+dnl check for __builtin_sinl
+dnl check for __builtin_cosf
+dnl check for __builtin_cos
+dnl check for __builtin_cosl
+dnl
+dnl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
+AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT, [
+ dnl Test for builtin math functions.
+ dnl These are made in gcc/c-common.c
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
+
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
+
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
+
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
+ GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
+
+ dnl There is, without a doubt, a more elegant way to have these
+ dnl names exported so that they won't be stripped out of acconfig.h by
+ dnl autoheader. I leave this as an exercise to somebody less frustrated
+ dnl than I.... please email the libstdc++ list if you can figure out a
+ dnl more elegant approach (see autoconf/acgen.m4 and specifically
+ dnl AC_CHECK_FUNC for things to steal.)
+ dummyvar=no
+ if test x$dummyvar = x"yes"; then
+ AC_DEFINE(HAVE___BUILTIN_ABS)
+ AC_DEFINE(HAVE___BUILTIN_LABS)
+ AC_DEFINE(HAVE___BUILTIN_COS)
+ AC_DEFINE(HAVE___BUILTIN_COSF)
+ AC_DEFINE(HAVE___BUILTIN_COSL)
+ AC_DEFINE(HAVE___BUILTIN_FABS)
+ AC_DEFINE(HAVE___BUILTIN_FABSF)
+ AC_DEFINE(HAVE___BUILTIN_FABSL)
+ AC_DEFINE(HAVE___BUILTIN_SIN)
+ AC_DEFINE(HAVE___BUILTIN_SINF)
+ AC_DEFINE(HAVE___BUILTIN_SINL)
+ AC_DEFINE(HAVE___BUILTIN_SQRT)
+ AC_DEFINE(HAVE___BUILTIN_SQRTF)
+ AC_DEFINE(HAVE___BUILTIN_SQRTL)
+ fi
+])
+
+dnl
+dnl Check to see what the underlying c library is like
+dnl These checks need to do two things:
+dnl 1) make sure the name is declared when using the c++ compiler
+dnl 2) make sure the name has "C" linkage
+dnl This might seem like overkill but experience has shown that it's not...
+dnl
+dnl Define HAVE_STRTOLD if "strtold" is declared and links
+dnl Define HAVE_STRTOF if "strtof" is declared and links
+dnl Define HAVE_DRAND48 if "drand48" is declared and links
+dnl
+dnl GLIBCXX_CHECK_STDLIB_SUPPORT
+AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
+
+ GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
+ GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
+ AC_CHECK_FUNCS(drand48)
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+])
+
+dnl
+dnl Check to see what the underlying c library or math library is like.
+dnl These checks need to do two things:
+dnl 1) make sure the name is declared when using the c++ compiler
+dnl 2) make sure the name has "C" linkage
+dnl This might seem like overkill but experience has shown that it's not...
+dnl
+dnl Define HAVE_CARGF etc if "cargf" is found.
+dnl
+dnl GLIBCXX_CHECK_MATH_SUPPORT
+AC_DEFUN(GLIBCXX_CHECK_MATH_SUPPORT, [
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
+
+ dnl Check libm
+ AC_CHECK_LIB(m, sin, libm="-lm")
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $libm"
+
+ dnl Check to see if certain C math functions exist.
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
+
+ dnl Check to see if basic C math functions have float versions.
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
+ float_trig,
+ acosf asinf atanf \
+ cosf sinf tanf \
+ coshf sinhf tanhf)
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
+ float_round,
+ ceilf floorf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
+
+ dnl Check to see if basic C math functions have long double versions.
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
+ long_double_trig,
+ acosl asinl atanl \
+ cosl sinl tanl \
+ coshl sinhl tanhl)
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
+ long_double_round,
+ ceill floorl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
+ GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
+
+ dnl Some runtimes have these functions with a preceding underscore. Please
+ dnl keep this sync'd with the one above. And if you add any new symbol,
+ dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
+ dnl Check to see if certain C math functions exist.
+
+ dnl Check to see if basic C math functions have float versions.
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
+ _float_trig,
+ _acosf _asinf _atanf \
+ _cosf _sinf _tanf \
+ _coshf _sinhf _tanhf)
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
+ _float_round,
+ _ceilf _floorf)
+
+ dnl Check to see if basic C math functions have long double versions.
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
+ _long_double_trig,
+ _acosl _asinl _atanl \
+ _cosl _sinl _tanl \
+ _coshl _sinhl _tanhl)
+ GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
+ _long_double_round,
+ _ceill _floorl)
+
+ LIBS="$ac_save_LIBS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
+])
+
+
+dnl
+dnl Check to see if there is native support for complex
+dnl
+dnl Don't compile bits in math/* if native support exits.
+dnl
+dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
+dnl
+dnl GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+AC_DEFUN(GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT, [
+ dnl Check for complex versions of math functions of platform. This will
+ dnl always pass if libm is available, and fail if it isn't. If it is
+ dnl available, we assume we'll need it later, so add it to LIBS.
+ AC_CHECK_LIB(m, main)
+ AC_REPLACE_MATHFUNCS(nan copysignf)
+
+ dnl For __signbit to signbit conversions.
+ AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
+ AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
+
+ dnl Compile the long double complex functions only if the function
+ dnl provides the non-complex long double functions that are needed.
+ dnl Currently this includes copysignl, which should be
+ dnl cached from the GLIBCXX_CHECK_MATH_SUPPORT macro, above.
+ if test x$ac_cv_func_copysignl = x"yes"; then
+ AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
+ fi
+
+ # XXX Review this. Nothing uses it.
+ if test -n "$LIBMATHOBJS"; then
+ need_libmath=yes
+ fi
+ AC_SUBST(LIBMATHOBJS)
+])
+
+
+# Check for functions in math library.
+# Ulrich Drepper <drepper@cygnus.com>, 1998.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+#
+# serial 1
+#
+dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
+AC_DEFUN(AC_REPLACE_MATHFUNCS,
+[AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
+
+dnl vim:et:ts=2
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
index a0a73b43bdd..15685abf5a0 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for the po subdirectory of the GNU C++ Standard library.
##
-## Copyright (C) 2001 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2003 Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in.
@@ -21,55 +21,53 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-PACKAGE = @PACKAGE@
-glibcxx_srcdir = @glibcxx_srcdir@
+include $(top_srcdir)/fragment.am
# Location of installation directories.
-mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
locale_installdir = $(DESTDIR)$(datadir)/locale
-locale_builddir = @glibcxx_localedir@
+locale_builddir = $(glibcxx_localedir)
# Tell automake that foo.po makes foo.mo
SUFFIXES = .po .mo
-LOCALE_IN = @glibcxx_POFILES@
-LOCALE_OUT = @glibcxx_MOFILES@
+LOCALE_IN = $(glibcxx_POFILES)
+LOCALE_OUT = $(glibcxx_MOFILES)
MSGFMT = msgfmt
# Necessary files.
DISTFILES = \
Makefile.am Makefile.in string_literals.cc POTFILES.in $(PACKAGE).pot \
- $(LOCALE_IN)
+ $(LOCALE_IN)
.po.mo:
$(MSGFMT) -o $@ $<
-all-local: all-local-@USE_NLS@
-all-local-no:
-all-local-yes: $(LOCALE_OUT)
+all-local: all-local-$(USE_NLS)
+all-local-no:
+all-local-yes: $(LOCALE_OUT)
# 'make check' needs the catalogs constructed in build directory.
-check: check-@USE_NLS@
+check: check-$(USE_NLS)
check-no:
check-yes:
- $(mkinstalldirs) $(locale_builddir)
- @catalogs='$(LOCALE_OUT)'; \
+ $(mkinstalldirs) $(locale_builddir)
+ catalogs='$(LOCALE_OUT)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.mo$$//'`; \
install_dir=$(locale_builddir)/$$lang/LC_MESSAGES; \
$(mkinstalldirs) $$install_dir; \
$(INSTALL_DATA) $$cat $$install_dir/$(PACKAGE).mo; \
- done
+ done
-# Install rules here.
+# Install rules here.
# Wish install could just `cp -R ./share $(locale_installdir)` ...
-install-data-local: install-data-local-@USE_NLS@
+install-data-local: install-data-local-$(USE_NLS)
install-data-local-no:
install-data-local-yes: all-local-yes
- $(mkinstalldirs) $(locale_installdir)
- @catalogs='$(LOCALE_OUT)'; \
+ $(mkinstalldirs) $(locale_installdir)
+ catalogs='$(LOCALE_OUT)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.mo$$//'`; \
@@ -87,4 +85,4 @@ pot:
`grep -r -l '__N(".*")' .`
# Specify what gets cleaned up on a 'make clean'
-CLEANFILES = $(LOCALE_OUT)
+CLEANFILES = $(LOCALE_OUT)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 447a5ca59f7..7925f979c91 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/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,62 +12,40 @@
# 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 = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
@@ -74,6 +54,7 @@ CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
@@ -82,39 +63,76 @@ CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FPOS_H = @FPOS_H@
FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-GLIBCXX_IS_CROSS_COMPILING = @GLIBCXX_IS_CROSS_COMPILING@
+GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
+GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
+GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
+GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBMATHOBJS = @LIBMATHOBJS@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
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@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
+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@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
@@ -122,119 +140,189 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+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_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
check_msgfmt = @check_msgfmt@
+datadir = @datadir@
enable_shared = @enable_shared@
enable_static = @enable_static@
-glibcxx_CXX = @glibcxx_CXX@
+exec_prefix = @exec_prefix@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
-glibcxx_basedir = @glibcxx_basedir@
glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
+glibcxx_srcdir = @glibcxx_srcdir@
glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
-ifGNUmake = @ifGNUmake@
+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@
libtool_VERSION = @libtool_VERSION@
+localstatedir = @localstatedir@
+mandir = @mandir@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
toplevel_srcdir = @toplevel_srcdir@
-PACKAGE = @PACKAGE@
-glibcxx_srcdir = @glibcxx_srcdir@
+MAINT_CHARSET = latin1
-# Location of installation directories.
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
+
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
+
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
+CONFIG_CXXFLAGS = \
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
+
+WARN_CXXFLAGS = \
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
+
+# Location of installation directories.
locale_installdir = $(DESTDIR)$(datadir)/locale
-locale_builddir = @glibcxx_localedir@
+locale_builddir = $(glibcxx_localedir)
# Tell automake that foo.po makes foo.mo
SUFFIXES = .po .mo
-LOCALE_IN = @glibcxx_POFILES@
-LOCALE_OUT = @glibcxx_MOFILES@
+LOCALE_IN = $(glibcxx_POFILES)
+LOCALE_OUT = $(glibcxx_MOFILES)
MSGFMT = msgfmt
# Necessary files.
DISTFILES = \
Makefile.am Makefile.in string_literals.cc POTFILES.in $(PACKAGE).pot \
- $(LOCALE_IN)
+ $(LOCALE_IN)
# Specify what gets cleaned up on a 'make clean'
-CLEANFILES = $(LOCALE_OUT)
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = Makefile.am Makefile.in
-
+CLEANFILES = $(LOCALE_OUT)
+subdir = po
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+DIST_SOURCES =
+DIST_COMMON = $(top_srcdir)/fragment.am Makefile.am Makefile.in
+all: all-am
-TAR = gtar
-GZIP_ENV = --best
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .mo .po
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus po/Makefile
+.SUFFIXES: .po .mo
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/fragment.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign po/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+mostlyclean-libtool:
+ -rm -f *.lo
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+clean-libtool:
+ -rm -rf .libs _libs
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
tags: TAGS
TAGS:
+ctags: CTAGS
+CTAGS:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-subdir = po
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ $(mkinstalldirs) $(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 \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ 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 \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am:
+check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
-install-exec-am:
-install-exec: install-exec-am
+all-am: Makefile all-local
-install-data-am: install-data-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
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: uninstall-am
-all-am: Makefile all-local
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-
+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:
@@ -242,65 +330,93 @@ clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-generic
+ @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-libtool mostlyclean-am
-clean-am: clean-generic mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-generic distclean-libtool
-distclean-am: distclean-generic clean-am
- -rm -f libtool
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
-.PHONY: tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-info-am install-info \
-install-exec-am install-exec install-data-local install-data-am \
-install-data install-am install uninstall-am uninstall all-local \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+ clean-libtool distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am info info-am install install-am install-data \
+ install-data-am install-data-local install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
.po.mo:
$(MSGFMT) -o $@ $<
-all-local: all-local-@USE_NLS@
-all-local-no:
-all-local-yes: $(LOCALE_OUT)
+all-local: all-local-$(USE_NLS)
+all-local-no:
+all-local-yes: $(LOCALE_OUT)
# 'make check' needs the catalogs constructed in build directory.
-check: check-@USE_NLS@
+check: check-$(USE_NLS)
check-no:
check-yes:
- $(mkinstalldirs) $(locale_builddir)
- @catalogs='$(LOCALE_OUT)'; \
+ $(mkinstalldirs) $(locale_builddir)
+ catalogs='$(LOCALE_OUT)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.mo$$//'`; \
install_dir=$(locale_builddir)/$$lang/LC_MESSAGES; \
$(mkinstalldirs) $$install_dir; \
$(INSTALL_DATA) $$cat $$install_dir/$(PACKAGE).mo; \
- done
+ done
-# Install rules here.
+# Install rules here.
# Wish install could just `cp -R ./share $(locale_installdir)` ...
-install-data-local: install-data-local-@USE_NLS@
+install-data-local: install-data-local-$(USE_NLS)
install-data-local-no:
install-data-local-yes: all-local-yes
- $(mkinstalldirs) $(locale_installdir)
- @catalogs='$(LOCALE_OUT)'; \
+ $(mkinstalldirs) $(locale_installdir)
+ catalogs='$(LOCALE_OUT)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.mo$$//'`; \
@@ -316,7 +432,6 @@ pot:
xgettext --default-domain=$(PACKAGE) --add-comments --c++ --debug \
--join-existing -o po/$(PACKAGE).pot --keyword=__N \
`grep -r -l '__N(".*")' .`
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libstdc++-v3/po/libstdc++.pot b/libstdc++-v3/po/libstdc++.pot
index 1b936efa934..4f2bf635105 100644
--- a/libstdc++-v3/po/libstdc++.pot
+++ b/libstdc++-v3/po/libstdc++.pot
@@ -1,18 +1,19 @@
# Translations needed for GNU C++ library locale implementation.
# Copyright (C) 2001 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libstdc++-v3 package.
# Benjamin Kosnik <bkoz@redhat.com>, 2001.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: libstdc++ 3.1.0\n"
-"POT-Creation-Date: 2001-07-31 08:49-0700\n"
+"Project-Id-Version: libstdc++ 3.4.0\n"
+"POT-Creation-Date: 2003-04-23 15:19-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8-bit\n"
+"Content-Transfer-Encoding: 8bit\n"
#: string_literals.cc:23
msgid "please"
@@ -29,3 +30,27 @@ msgstr ""
#: string_literals.cc:28
msgid "false"
msgstr ""
+
+#: include/std/std_bitset.h:267 include/std/std_bitset.h:267
+msgid "bitset value is too large to fit in unsigned long"
+msgstr ""
+
+#: include/std/std_bitset.h:469 include/std/std_bitset.h:469
+msgid "bitset is zero-length"
+msgstr ""
+
+#: include/std/std_bitset.h:865 include/std/std_bitset.h:865
+msgid "bitset::set() argument too large"
+msgstr ""
+
+#: include/std/std_bitset.h:890 include/std/std_bitset.h:890
+msgid "bitset::reset() argument too large"
+msgstr ""
+
+#: include/std/std_bitset.h:914 include/std/std_bitset.h:914
+msgid "bitset::flip() argument too large"
+msgstr ""
+
+#: include/std/std_bitset.h:1017 include/std/std_bitset.h:1017
+msgid "bitset::test() argument too large"
+msgstr ""
diff --git a/libstdc++-v3/scripts/extract_symvers b/libstdc++-v3/scripts/extract_symvers
index e7b6645900b..c7798b7e506 100755
--- a/libstdc++-v3/scripts/extract_symvers
+++ b/libstdc++-v3/scripts/extract_symvers
@@ -1,6 +1,6 @@
#!/bin/sh
-# 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
@@ -45,7 +45,10 @@ if readelf --help | grep -- --wide > /dev/null; then
fi
# This avoids weird sorting problems later.
-export LC_ALL=C
+LC_ALL=C
+export LC_ALL
+LANG=C
+export LANG
tmp=extract.$$
diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in
index 8e8f93970ee..b260ce4ea0d 100755
--- a/libstdc++-v3/scripts/testsuite_flags.in
+++ b/libstdc++-v3/scripts/testsuite_flags.in
@@ -32,10 +32,8 @@ case ${query} in
echo ${INCLUDES}
;;
--build-includes)
- INCLUDES="-nostdinc++ @GLIBCXX_INCLUDES@
- -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio
- -I${SRC_DIR}/include/backward
- -I${SRC_DIR}/testsuite"
+ INCLUDES="-nostdinc++ @GLIBCXX_INCLUDES@ -I${SRC_DIR}/libsupc++
+ -I${SRC_DIR}/include/backward -I${SRC_DIR}/testsuite"
echo ${INCLUDES}
;;
--install-cxx)
@@ -44,7 +42,7 @@ case ${query} in
;;
--build-cxx)
PCHFLAGS="@glibcxx_PCHFLAGS@"
- CXX_build="@glibcxx_CXX@ ${PCHFLAGS}"
+ CXX_build="@CXX@ ${PCHFLAGS}"
CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
echo ${CXX}
;;
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 72f7cbdb50b..52bb3270c88 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -22,29 +22,20 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-AUTOMAKE_OPTIONS = 1.3 cygnus
-MAINT_CHARSET = latin1
-
-mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+include $(top_srcdir)/fragment.am
# Cross compiler support.
-CXX = @glibcxx_CXX@
-glibcxx_srcdir=@glibcxx_srcdir@
-glibcxx_builddir=@glibcxx_builddir@
-toolexecdir = @glibcxx_toolexecdir@
-toolexeclibdir = @glibcxx_toolexeclibdir@
toolexeclib_LTLIBRARIES = libstdc++.la
# Symbol versioning for shared libraries.
if GLIBCXX_BUILD_VERSIONED_SHLIB
-port_specific_symbol_file = @port_specific_symbol_file@
version_arg = -Wl,--version-script=libstdc++-symbol.ver
-libstdc++-symbol.ver: ${glibcxx_srcdir}/@SYMVER_MAP@
- cp ${glibcxx_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver
- if test "x${port_specific_symbol_file}" != x; then \
+libstdc++-symbol.ver: ${glibcxx_srcdir}/$(SYMVER_MAP)
+ cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
+ if test "x$(port_specific_symbol_files)" != x; then \
sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
- cat tmp.top $(port_specific_symbol_file) tmp.bottom > $@; \
+ cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
rm tmp.top tmp.bottom; \
fi
else
@@ -52,30 +43,6 @@ version_arg =
libstdc++-symbol.ver:
endif
-# Compile flags that should be constant throughout the build, both for
-# SUBDIRS and for libstdc++-v3 in general.
-OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
-
-# These bits are all figured out from configure. Look in acinclude.m4
-# or configure.in to see how they are set. See GLIBCXX_EXPORT_FLAGS
-CONFIG_CXXFLAGS = \
- @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@
-
-# Warning flags to use.
-WARN_CXXFLAGS = \
- @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
-
-# Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-
-INCLUDES = \
- -nostdinc++ \
- $(GLIBCXX_INCLUDES) \
- $(LIBSUPCXX_INCLUDES) $(LIBMATH_INCLUDES) \
- $(TOPLEVEL_INCLUDES)
# Source files linked in via configuration/make substitution for a
# particular host.
@@ -88,26 +55,26 @@ host_sources = \
numeric_members.cc \
time_members.cc
-codecvt_members.cc: ${glibcxx_srcdir}/@CCODECVT_CC@
- @LN_S@ ${glibcxx_srcdir}/@CCODECVT_CC@ . || true
+codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true
-collate_members.cc: ${glibcxx_srcdir}/@CCOLLATE_CC@
- @LN_S@ ${glibcxx_srcdir}/@CCOLLATE_CC@ . || true
+collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true
-ctype_members.cc: ${glibcxx_srcdir}/@CCTYPE_CC@
- @LN_S@ ${glibcxx_srcdir}/@CCTYPE_CC@ . || true
+ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
-messages_members.cc: ${glibcxx_srcdir}/@CMESSAGES_CC@
- @LN_S@ ${glibcxx_srcdir}/@CMESSAGES_CC@ . || true
+messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true
-monetary_members.cc: ${glibcxx_srcdir}/@CMONEY_CC@
- @LN_S@ ${glibcxx_srcdir}/@CMONEY_CC@ . || true
+monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true
-numeric_members.cc: ${glibcxx_srcdir}/@CNUMERIC_CC@
- @LN_S@ ${glibcxx_srcdir}/@CNUMERIC_CC@ . || true
+numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true
-time_members.cc: ${glibcxx_srcdir}/@CTIME_CC@
- @LN_S@ ${glibcxx_srcdir}/@CTIME_CC@ . || true
+time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true
# Source files linked in via configuration/make substitution for a
# particular host, but with ad hoc naming rules.
@@ -115,11 +82,11 @@ host_sources_extra = \
basic_file.cc \
c++locale.cc
-c++locale.cc: ${glibcxx_srcdir}/@CLOCALE_CC@
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_CC@ ./$@ || true
+c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true
-basic_file.cc: ${glibcxx_srcdir}/@BASIC_FILE_CC@
- @LN_S@ ${glibcxx_srcdir}/@BASIC_FILE_CC@ ./$@ || true
+basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true
# Sources present in the src directory.
sources = \
@@ -144,6 +111,7 @@ sources = \
ostream-inst.cc \
sstream-inst.cc \
stdexcept.cc \
+ stl_tree.cc \
streambuf-inst.cc \
string-inst.cc \
strstream.cc \
@@ -163,13 +131,13 @@ libstdc___la_LIBADD = \
libstdc___la_DEPENDENCIES = libstdc++-symbol.ver $(libstdc___la_LIBADD)
libstdc___la_LDFLAGS = \
- -version-info @libtool_VERSION@ ${version_arg} \
- -lm @LIBUNWIND_FLAG@
+ -version-info $(libtool_VERSION) ${version_arg} \
+ -lm $(LIBUNWIND_FLAG)
# Use special rules for the deprecated source files so that they find
# deprecated include files.
-GLIBCXX_INCLUDE_DIR=@glibcxx_builddir@/include
+GLIBCXX_INCLUDE_DIR=$(glibcxx_builddir)/include
strstream.lo: strstream.cc
$(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
strstream.o: strstream.cc
@@ -198,7 +166,6 @@ demangle.o: demangle.cc
# as the occasion calls for it.
AM_CXXFLAGS = \
-fno-implicit-templates \
- $(LIBSUPCXX_CXXFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
@@ -232,7 +199,7 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
# directory to configure libstdc++-v3 to use gcc as the C++
# compilation driver.
CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
- @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
# Added bits to build debug library.
@@ -261,9 +228,9 @@ stamp-debug:
echo `date` > stamp-debug;
build_debug: stamp-debug
- (cd ${debugdir} && $(MAKE) CXXFLAGS='@DEBUG_FLAGS@' all)
+ (cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' all)
# Install debug library here.
install_debug:
(cd ${debugdir} && $(MAKE) \
- toolexeclibdir=@glibcxx_toolexeclibdir@/debug install)
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 9062d7ccb10..efedd07bd34 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/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,61 +12,41 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-
-SHELL = @SHELL@
+@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_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 = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
+
+VPATH = $(top_srcdir)/src:$(top_srcdir)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
@@ -73,6 +55,7 @@ CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
@@ -81,136 +64,249 @@ CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
+CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FPOS_H = @FPOS_H@
FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
-GLIBCXX_IS_CROSS_COMPILING = @GLIBCXX_IS_CROSS_COMPILING@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
+GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
+GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
+GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
+GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
+GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBMATHOBJS = @LIBMATHOBJS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
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@
+OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
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@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+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_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
check_msgfmt = @check_msgfmt@
+datadir = @datadir@
enable_shared = @enable_shared@
enable_static = @enable_static@
-glibcxx_CXX = @glibcxx_CXX@
+exec_prefix = @exec_prefix@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
-glibcxx_basedir = @glibcxx_basedir@
+glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
+glibcxx_srcdir = @glibcxx_srcdir@
glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
-ifGNUmake = @ifGNUmake@
+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@
libtool_VERSION = @libtool_VERSION@
+localstatedir = @localstatedir@
+mandir = @mandir@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
toplevel_srcdir = @toplevel_srcdir@
-AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
-# Cross compiler support.
-CXX = @glibcxx_CXX@
-glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_builddir = @glibcxx_builddir@
-toolexecdir = @glibcxx_toolexecdir@
-toolexeclibdir = @glibcxx_toolexeclibdir@
-toolexeclib_LTLIBRARIES = libstdc++.la
-
-# Symbol versioning for shared libraries.
-@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@port_specific_symbol_file = @port_specific_symbol_file@
-@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@version_arg = -Wl,--version-script=libstdc++-symbol.ver
-@GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@version_arg =
-
-# Compile flags that should be constant throughout the build, both for
-# SUBDIRS and for libstdc++-v3 in general.
-OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
-
-# These bits are all figured out from configure. Look in acinclude.m4
-# or configure.in to see how they are set. See GLIBCXX_EXPORT_FLAGS
-CONFIG_CXXFLAGS = @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
+CONFIG_CXXFLAGS = \
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
-# Warning flags to use.
-WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
+WARN_CXXFLAGS = \
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
-# Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
-INCLUDES = -nostdinc++ $(GLIBCXX_INCLUDES) $(LIBSUPCXX_INCLUDES) $(LIBMATH_INCLUDES) $(TOPLEVEL_INCLUDES)
+# Cross compiler support.
+toolexeclib_LTLIBRARIES = libstdc++.la
+# Symbol versioning for shared libraries.
+@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@version_arg = -Wl,--version-script=libstdc++-symbol.ver
+@GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@version_arg =
# Source files linked in via configuration/make substitution for a
# particular host.
-host_sources = codecvt_members.cc collate_members.cc ctype_members.cc messages_members.cc monetary_members.cc numeric_members.cc time_members.cc
+host_sources = \
+ codecvt_members.cc \
+ collate_members.cc \
+ ctype_members.cc \
+ messages_members.cc \
+ monetary_members.cc \
+ numeric_members.cc \
+ time_members.cc
# Source files linked in via configuration/make substitution for a
# particular host, but with ad hoc naming rules.
-host_sources_extra = basic_file.cc c++locale.cc
+host_sources_extra = \
+ basic_file.cc \
+ c++locale.cc
# Sources present in the src directory.
-sources = allocator-inst.cc codecvt.cc complex_io.cc concept-inst.cc ctype.cc demangle.cc ext-inst.cc fstream-inst.cc functexcept.cc globals.cc io-inst.cc ios.cc istream-inst.cc limits.cc locale.cc locale-inst.cc localename.cc misc-inst.cc ostream-inst.cc sstream-inst.cc stdexcept.cc streambuf-inst.cc string-inst.cc strstream.cc valarray-inst.cc wstring-inst.cc ${host_sources} ${host_sources_extra}
+sources = \
+ allocator-inst.cc \
+ codecvt.cc \
+ complex_io.cc \
+ concept-inst.cc \
+ ctype.cc \
+ demangle.cc \
+ ext-inst.cc \
+ fstream-inst.cc \
+ functexcept.cc \
+ globals.cc \
+ io-inst.cc \
+ ios.cc \
+ istream-inst.cc \
+ limits.cc \
+ locale.cc \
+ locale-inst.cc \
+ localename.cc \
+ misc-inst.cc \
+ ostream-inst.cc \
+ sstream-inst.cc \
+ stdexcept.cc \
+ stl_tree.cc \
+ streambuf-inst.cc \
+ string-inst.cc \
+ strstream.cc \
+ valarray-inst.cc \
+ wstring-inst.cc \
+ ${host_sources} \
+ ${host_sources_extra}
-VPATH = $(top_srcdir)/src:$(top_srcdir)
-
libstdc___la_SOURCES = $(sources)
-libstdc___la_LIBADD = $(top_builddir)/libmath/libmath.la $(top_builddir)/libsupc++/libsupc++convenience.la
+libstdc___la_LIBADD = \
+ $(top_builddir)/libmath/libmath.la \
+ $(top_builddir)/libsupc++/libsupc++convenience.la
libstdc___la_DEPENDENCIES = libstdc++-symbol.ver $(libstdc___la_LIBADD)
-libstdc___la_LDFLAGS = -version-info @libtool_VERSION@ ${version_arg} -lm @LIBUNWIND_FLAG@
+libstdc___la_LDFLAGS = \
+ -version-info $(libtool_VERSION) ${version_arg} \
+ -lm $(LIBUNWIND_FLAG)
# Use special rules for the deprecated source files so that they find
# deprecated include files.
-GLIBCXX_INCLUDE_DIR = @glibcxx_builddir@/include
+GLIBCXX_INCLUDE_DIR = $(glibcxx_builddir)/include
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion calls for it.
-AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+AM_CXXFLAGS = \
+ -fno-implicit-templates \
+ $(WARN_CXXFLAGS) \
+ $(OPTIMIZE_CXXFLAGS) \
+ $(CONFIG_CXXFLAGS)
# libstdc++ libtool notes
@@ -231,7 +327,8 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS)
# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
# attempt to infer which configuration to use
-LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
# 3) We'd have a problem when building the shared libstdc++ object if
@@ -240,110 +337,96 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) $(
# course is problematic at this point. So, we get the top-level
# directory to configure libstdc++-v3 to use gcc as the C++
# compilation driver.
-CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
debugdir = debug
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-libstdc___la_OBJECTS = allocator-inst.lo codecvt.lo complex_io.lo \
-concept-inst.lo ctype.lo demangle.lo ext-inst.lo fstream-inst.lo \
-functexcept.lo globals.lo io-inst.lo ios.lo istream-inst.lo limits.lo \
-locale.lo locale-inst.lo localename.lo misc-inst.lo ostream-inst.lo \
-sstream-inst.lo stdexcept.lo streambuf-inst.lo string-inst.lo \
-strstream.lo valarray-inst.lo wstring-inst.lo codecvt_members.lo \
-collate_members.lo ctype_members.lo messages_members.lo \
-monetary_members.lo numeric_members.lo time_members.lo basic_file.lo \
-c++locale.lo
-CXXFLAGS = @CXXFLAGS@
-CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+subdir = src
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+
+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 = allocator-inst.lo codecvt.lo complex_io.lo \
+ concept-inst.lo ctype.lo demangle.lo ext-inst.lo \
+ fstream-inst.lo functexcept.lo globals.lo io-inst.lo ios.lo \
+ istream-inst.lo limits.lo locale.lo locale-inst.lo \
+ localename.lo misc-inst.lo ostream-inst.lo sstream-inst.lo \
+ stdexcept.lo stl_tree.lo streambuf-inst.lo string-inst.lo \
+ strstream.lo valarray-inst.lo wstring-inst.lo $(am__objects_1) \
+ $(am__objects_2)
+am_libstdc___la_OBJECTS = $(am__objects_3)
+libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
-DIST_COMMON = Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP_ENV = --best
+DIST_SOURCES = $(libstdc___la_SOURCES)
+DIST_COMMON = $(top_srcdir)/fragment.am Makefile.am Makefile.in
SOURCES = $(libstdc___la_SOURCES)
-OBJECTS = $(libstdc___la_OBJECTS)
-
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .S .c .cc .lo .o .obj .s
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus src/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-toolexeclibLTLIBRARIES:
-
-clean-toolexeclibLTLIBRARIES:
- -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
-
-distclean-toolexeclibLTLIBRARIES:
-maintainer-clean-toolexeclibLTLIBRARIES:
+all: all-am
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/fragment.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
@list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
- echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \
- $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(LIBTOOL) --mode=install $(toolexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(toolexeclibdir)/$$f"; \
+ $(LIBTOOL) --mode=install $(toolexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(toolexeclibdir)/$$f; \
else :; fi; \
done
uninstall-toolexeclibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
+ @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+ p="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p"; \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
done
-.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 $<
+clean-toolexeclibLTLIBRARIES:
+ -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
+ @list='$(toolexeclib_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
+libstdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(toolexeclibdir) $(libstdc___la_LDFLAGS) $(libstdc___la_OBJECTS) $(libstdc___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 $<
+.cc.o:
+ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.cc.obj:
+ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-.S.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.cc.lo:
+ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
mostlyclean-libtool:
-rm -f *.lo
@@ -352,178 +435,221 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
-maintainer-clean-libtool:
+ETAGS = etags
+ETAGSFLAGS =
-libstdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES)
- $(CXXLINK) -rpath $(toolexeclibdir) $(libstdc___la_LDFLAGS) $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD) $(LIBS)
-.cc.o:
- $(CXXCOMPILE) -c $<
-.cc.obj:
- $(CXXCOMPILE) -c `cygpath -w $<`
-.cc.lo:
- $(LTCXXCOMPILE) -c $<
+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) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(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) $(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)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
-mostlyclean-tags:
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ 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; }'`; \
+ 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:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-subdir = src
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ $(mkinstalldirs) $(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 \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ 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 \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am:
+check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
-install-exec-am: install-toolexeclibLTLIBRARIES
-install-exec: install-exec-am
+all-am: Makefile $(LTLIBRARIES) all-local
-install-data-am: install-data-local
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
+install: install-am
+install-exec: install-exec-am
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-toolexeclibLTLIBRARIES
-uninstall: uninstall-am
-all-am: Makefile $(LTLIBRARIES) all-local
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
-
+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-toolexeclibLTLIBRARIES 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-libtool clean-toolexeclibLTLIBRARIES \
+ mostlyclean-am
-clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \
- clean-tags clean-generic mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
-distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \
- distclean-libtool distclean-tags distclean-generic \
- clean-am
- -rm -f libtool
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \
- 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-data-local
+
+install-exec-am: install-toolexeclibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
-.PHONY: mostlyclean-toolexeclibLTLIBRARIES \
-distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \
-maintainer-clean-toolexeclibLTLIBRARIES \
-uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-info-am \
-install-info install-exec-am install-exec install-data-local \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-local all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
-
-@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver: ${glibcxx_srcdir}/@SYMVER_MAP@
-@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ cp ${glibcxx_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver
-@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ if test "x${port_specific_symbol_file}" != x; then \
+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-info-am uninstall-toolexeclibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
+ clean-generic clean-libtool clean-toolexeclibLTLIBRARIES ctags \
+ distclean distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am info info-am install \
+ install-am install-data install-data-am install-data-local \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-strip install-toolexeclibLTLIBRARIES \
+ 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-info-am \
+ uninstall-toolexeclibLTLIBRARIES
+
+@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver: ${glibcxx_srcdir}/$(SYMVER_MAP)
+@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
+@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ if test "x$(port_specific_symbol_files)" != x; then \
@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
-@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ cat tmp.top $(port_specific_symbol_file) tmp.bottom > $@; \
+@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ rm tmp.top tmp.bottom; \
@GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ fi
@GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@libstdc++-symbol.ver:
-codecvt_members.cc: ${glibcxx_srcdir}/@CCODECVT_CC@
- @LN_S@ ${glibcxx_srcdir}/@CCODECVT_CC@ . || true
+codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true
-collate_members.cc: ${glibcxx_srcdir}/@CCOLLATE_CC@
- @LN_S@ ${glibcxx_srcdir}/@CCOLLATE_CC@ . || true
+collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true
-ctype_members.cc: ${glibcxx_srcdir}/@CCTYPE_CC@
- @LN_S@ ${glibcxx_srcdir}/@CCTYPE_CC@ . || true
+ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
-messages_members.cc: ${glibcxx_srcdir}/@CMESSAGES_CC@
- @LN_S@ ${glibcxx_srcdir}/@CMESSAGES_CC@ . || true
+messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true
-monetary_members.cc: ${glibcxx_srcdir}/@CMONEY_CC@
- @LN_S@ ${glibcxx_srcdir}/@CMONEY_CC@ . || true
+monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true
-numeric_members.cc: ${glibcxx_srcdir}/@CNUMERIC_CC@
- @LN_S@ ${glibcxx_srcdir}/@CNUMERIC_CC@ . || true
+numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true
-time_members.cc: ${glibcxx_srcdir}/@CTIME_CC@
- @LN_S@ ${glibcxx_srcdir}/@CTIME_CC@ . || true
+time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true
-c++locale.cc: ${glibcxx_srcdir}/@CLOCALE_CC@
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_CC@ ./$@ || true
+c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true
-basic_file.cc: ${glibcxx_srcdir}/@BASIC_FILE_CC@
- @LN_S@ ${glibcxx_srcdir}/@BASIC_FILE_CC@ ./$@ || true
+basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
+ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true
strstream.lo: strstream.cc
$(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
strstream.o: strstream.cc
@@ -565,13 +691,12 @@ stamp-debug:
echo `date` > stamp-debug;
build_debug: stamp-debug
- (cd ${debugdir} && $(MAKE) CXXFLAGS='@DEBUG_FLAGS@' all)
+ (cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' all)
# Install debug library here.
install_debug:
(cd ${debugdir} && $(MAKE) \
- toolexeclibdir=@glibcxx_toolexeclibdir@/debug install)
-
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libstdc++-v3/src/globals.cc b/libstdc++-v3/src/globals.cc
index 5cfa621086e..e9e5814f6b5 100644
--- a/libstdc++-v3/src/globals.cc
+++ b/libstdc++-v3/src/globals.cc
@@ -157,8 +157,8 @@ namespace __gnu_cxx
typedef char fake_moneypunct_c[sizeof(moneypunct<char, true>)]
__attribute__ ((aligned(__alignof__(moneypunct<char, true>))));
- fake_moneypunct_c moneypunct_tc;
- fake_moneypunct_c moneypunct_fc;
+ fake_moneypunct_c moneypunct_ct;
+ fake_moneypunct_c moneypunct_cf;
typedef char fake_money_get_c[sizeof(money_get<char>)]
__attribute__ ((aligned(__alignof__(money_get<char>))));
@@ -211,8 +211,8 @@ namespace __gnu_cxx
typedef char fake_moneypunct_w[sizeof(moneypunct<wchar_t, true>)]
__attribute__ ((aligned(__alignof__(moneypunct<wchar_t, true>))));
- fake_moneypunct_w moneypunct_tw;
- fake_moneypunct_w moneypunct_fw;
+ fake_moneypunct_w moneypunct_wt;
+ fake_moneypunct_w moneypunct_wf;
typedef char fake_money_get_w[sizeof(money_get<wchar_t>)]
__attribute__ ((aligned(__alignof__(money_get<wchar_t>))));
@@ -239,15 +239,33 @@ namespace __gnu_cxx
fake_messages_w messages_w;
#endif
- // Storage for C locale caches
- typedef char fake_locale_cache_c[sizeof(std::__numpunct_cache<char>)]
+ // Storage for "C" locale caches.
+ typedef char fake_num_cache_c[sizeof(std::__numpunct_cache<char>)]
__attribute__ ((aligned(__alignof__(std::__numpunct_cache<char>))));
- fake_locale_cache_c numpunct_cache_c;
+ fake_num_cache_c numpunct_cache_c;
+
+ typedef char fake_money_cache_c[sizeof(std::__moneypunct_cache<char>)]
+ __attribute__ ((aligned(__alignof__(std::__moneypunct_cache<char>))));
+ fake_money_cache_c moneypunct_cache_ct;
+ fake_money_cache_c moneypunct_cache_cf;
+
+ typedef char fake_time_cache_c[sizeof(std::__timepunct_cache<char>)]
+ __attribute__ ((aligned(__alignof__(std::__timepunct_cache<char>))));
+ fake_time_cache_c timepunct_cache_c;
#ifdef _GLIBCXX_USE_WCHAR_T
- typedef char fake_locale_cache_w[sizeof(std::__numpunct_cache<wchar_t>)]
+ typedef char fake_num_cache_w[sizeof(std::__numpunct_cache<wchar_t>)]
__attribute__ ((aligned(__alignof__(std::__numpunct_cache<wchar_t>))));
- fake_locale_cache_w numpunct_cache_w;
+ fake_num_cache_w numpunct_cache_w;
+
+ typedef char fake_money_cache_w[sizeof(std::__moneypunct_cache<wchar_t>)]
+ __attribute__ ((aligned(__alignof__(std::__moneypunct_cache<wchar_t>))));
+ fake_money_cache_w moneypunct_cache_wt;
+ fake_money_cache_w moneypunct_cache_wf;
+
+ typedef char fake_time_cache_w[sizeof(std::__timepunct_cache<wchar_t>)]
+ __attribute__ ((aligned(__alignof__(std::__timepunct_cache<wchar_t>))));
+ fake_time_cache_w timepunct_cache_w;
#endif
// Globals for once-only runtime initialization of mutex objects. This
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index daecdd48236..9dd0ecb53d7 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -167,7 +167,7 @@ namespace std
if (_S_ios_base_init == 0)
{
// Standard streams default to synced with "C" operations.
- ios_base::Init::_S_synced_with_stdio = true;
+ _S_synced_with_stdio = true;
new (&buf_cout_sync) stdio_sync_filebuf<char>(stdout);
new (&buf_cin_sync) stdio_sync_filebuf<char>(stdin);
@@ -267,7 +267,7 @@ namespace std
{
_M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception)
- __throw_ios_failure("ios_base::_M_grow_words ix not valid");
+ __throw_ios_failure("ios_base::_M_grow_words is not valid");
return _M_word_zero;
}
}
diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc
index deeb35eeb98..2a12a932206 100644
--- a/libstdc++-v3/src/locale-inst.cc
+++ b/libstdc++-v3/src/locale-inst.cc
@@ -41,6 +41,7 @@ namespace std
// moneypunct, money_get, and money_put
template class moneypunct<char, false>;
template class moneypunct<char, true>;
+ template struct __moneypunct_cache<char>;
template class moneypunct_byname<char, false>;
template class moneypunct_byname<char, true>;
template class money_get<char, istreambuf_iterator<char> >;
@@ -49,6 +50,7 @@ namespace std
#ifdef _GLIBCXX_USE_WCHAR_T
template class moneypunct<wchar_t, false>;
template class moneypunct<wchar_t, true>;
+ template struct __moneypunct_cache<wchar_t>;
template class moneypunct_byname<wchar_t, false>;
template class moneypunct_byname<wchar_t, true>;
template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
@@ -64,40 +66,40 @@ namespace std
template
ostreambuf_iterator<char>
num_put<char, ostreambuf_iterator<char> >::
- _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
- long) const;
+ _M_insert_int(ostreambuf_iterator<char>, ios_base&, char,
+ long) const;
template
ostreambuf_iterator<char>
num_put<char, ostreambuf_iterator<char> >::
- _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
- unsigned long) const;
+ _M_insert_int(ostreambuf_iterator<char>, ios_base&, char,
+ unsigned long) const;
#ifdef _GLIBCXX_USE_LONG_LONG
template
ostreambuf_iterator<char>
num_put<char, ostreambuf_iterator<char> >::
- _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
- long long) const;
+ _M_insert_int(ostreambuf_iterator<char>, ios_base&, char,
+ long long) const;
template
ostreambuf_iterator<char>
num_put<char, ostreambuf_iterator<char> >::
- _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
- unsigned long long) const;
+ _M_insert_int(ostreambuf_iterator<char>, ios_base&, char,
+ unsigned long long) const;
#endif
template
ostreambuf_iterator<char>
num_put<char, ostreambuf_iterator<char> >::
- _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char,
- double) const;
+ _M_insert_float(ostreambuf_iterator<char>, ios_base&, char, char,
+ double) const;
template
ostreambuf_iterator<char>
num_put<char, ostreambuf_iterator<char> >::
- _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char,
- long double) const;
+ _M_insert_float(ostreambuf_iterator<char>, ios_base&, char, char,
+ long double) const;
#ifdef _GLIBCXX_USE_WCHAR_T
template class numpunct<wchar_t>;
@@ -109,44 +111,45 @@ namespace std
template
ostreambuf_iterator<wchar_t>
num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
- _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
- long) const;
+ _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
+ long) const;
template
ostreambuf_iterator<wchar_t>
num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
- _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
- unsigned long) const;
+ _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
+ unsigned long) const;
#ifdef _GLIBCXX_USE_LONG_LONG
template
ostreambuf_iterator<wchar_t>
num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
- _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
- long long) const;
+ _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
+ long long) const;
template
ostreambuf_iterator<wchar_t>
num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
- _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
- unsigned long long) const;
+ _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
+ unsigned long long) const;
#endif
template
ostreambuf_iterator<wchar_t>
num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
- _M_convert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char,
- double) const;
-
+ _M_insert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char,
+ double) const;
+
template
ostreambuf_iterator<wchar_t>
num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
- _M_convert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char,
- long double) const;
+ _M_insert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char,
+ long double) const;
#endif
// time_get and time_put
template class __timepunct<char>;
+ template struct __timepunct_cache<char>;
template class time_put<char, ostreambuf_iterator<char> >;
template class time_put_byname<char, ostreambuf_iterator<char> >;
template class time_get<char, istreambuf_iterator<char> >;
@@ -154,6 +157,7 @@ namespace std
#ifdef _GLIBCXX_USE_WCHAR_T
template class __timepunct<wchar_t>;
+ template struct __timepunct_cache<wchar_t>;
template class time_put<wchar_t, ostreambuf_iterator<wchar_t> >;
template class time_put_byname<wchar_t, ostreambuf_iterator<wchar_t> >;
template class time_get<wchar_t, istreambuf_iterator<wchar_t> >;
diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc
index 248fdf30293..d1de4db6c1a 100644
--- a/libstdc++-v3/src/locale.cc
+++ b/libstdc++-v3/src/locale.cc
@@ -28,6 +28,7 @@
#include <clocale>
#include <cstring>
+#include <cstdlib> // For getenv, free.
#include <cctype>
#include <cwctype> // For towupper, etc.
#include <locale>
@@ -183,7 +184,7 @@ namespace std
else
{
// Get it from the environment.
- char* __env = getenv("LC_ALL");
+ char* __env = std::getenv("LC_ALL");
// If LC_ALL is set we are done.
if (__env && std::strcmp(__env, "") != 0)
{
@@ -197,7 +198,7 @@ namespace std
{
char* __res;
// LANG may set a default different from "C".
- char* __env = getenv("LANG");
+ char* __env = std::getenv("LANG");
if (!__env || std::strcmp(__env, "") == 0
|| std::strcmp(__env, "C") == 0
|| std::strcmp(__env, "POSIX") == 0)
@@ -211,7 +212,7 @@ namespace std
if (std::strcmp(__res, "C") == 0)
for (; __i < _S_categories_size; ++__i)
{
- __env = getenv(_S_categories[__i]);
+ __env = std::getenv(_S_categories[__i]);
if (__env && std::strcmp(__env, "") != 0
&& std::strcmp(__env, "C") != 0
&& std::strcmp(__env, "POSIX") != 0)
@@ -220,7 +221,7 @@ namespace std
else
for (; __i < _S_categories_size; ++__i)
{
- __env = getenv(_S_categories[__i]);
+ __env = std::getenv(_S_categories[__i]);
if (__env && std::strcmp(__env, "") != 0
&& std::strcmp(__env, __res) != 0)
break;
@@ -245,7 +246,7 @@ namespace std
__i++;
for (; __i < _S_categories_size; ++__i)
{
- __env = getenv(_S_categories[__i]);
+ __env = std::getenv(_S_categories[__i]);
if (!__env || std::strcmp(__env, "") == 0)
{
__str += _S_categories[__i];
@@ -276,7 +277,7 @@ namespace std
(_M_impl = _S_classic)->_M_add_reference();
else
_M_impl = new _Impl(__res, 1);
- free(__res);
+ std::free(__res);
}
}
}
@@ -451,42 +452,10 @@ namespace std
locale::facet::
~facet() { }
- template<>
- const __numpunct_cache<char>&
- __use_cache(const locale& __loc)
- {
- size_t __i = numpunct<char>::id._M_id();
- const locale::facet** __caches = __loc._M_impl->_M_caches;
- if (!__caches[__i])
- {
- __numpunct_cache<char>* __tmp = new __numpunct_cache<char>;
- __tmp->_M_cache(__loc);
- __loc._M_impl->_M_install_cache(__tmp, __i);
- }
- return static_cast<const __numpunct_cache<char>&>(*__caches[__i]);
- }
-
-#ifdef _GLIBCXX_USE_WCHAR_T
- template<>
- const __numpunct_cache<wchar_t>&
- __use_cache(const locale& __loc)
- {
- size_t __i = numpunct<wchar_t>::id._M_id();
- const locale::facet** __caches = __loc._M_impl->_M_caches;
- if (!__caches[__i])
- {
- __numpunct_cache<wchar_t>* __tmp = new __numpunct_cache<wchar_t>;
- __tmp->_M_cache(__loc);
- __loc._M_impl->_M_install_cache(__tmp, __i);
- }
- return static_cast<const __numpunct_cache<wchar_t>&>(*__caches[__i]);
- }
-#endif
-
// Definitions for static const data members of time_base.
template<>
const char*
- __timepunct<char>::_S_timezones[14] =
+ __timepunct_cache<char>::_S_timezones[14] =
{
"GMT", "HST", "AKST", "PST", "MST", "CST", "EST", "AST", "NST", "CET",
"IST", "EET", "CST", "JST"
@@ -495,7 +464,7 @@ namespace std
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
const wchar_t*
- __timepunct<wchar_t>::_S_timezones[14] =
+ __timepunct_cache<wchar_t>::_S_timezones[14] =
{
L"GMT", L"HST", L"AKST", L"PST", L"MST", L"CST", L"EST", L"AST",
L"NST", L"CET", L"IST", L"EET", L"CST", L"JST"
@@ -506,7 +475,7 @@ namespace std
const money_base::pattern
money_base::_S_default_pattern = { {symbol, sign, none, value} };
- const char* __num_base::_S_atoms_in = "0123456789eEabcdfABCDF";
+ const char* __num_base::_S_atoms_in = "-+xX0123456789eEabcdfABCDF";
const char* __num_base::_S_atoms_out ="-+xX0123456789abcdef0123456789ABCDEF";
// _GLIBCXX_RESOLVE_LIB_DEFECTS
diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc
index 0a2ef129f4e..d428290b438 100644
--- a/libstdc++-v3/src/localename.cc
+++ b/libstdc++-v3/src/localename.cc
@@ -43,10 +43,10 @@ namespace __gnu_cxx
extern std::collate<char> collate_c;
extern numpunct<char> numpunct_c;
extern num_get<char> num_get_c;
- extern num_put<char> num_put_c;
- extern codecvt<char, char, mbstate_t> codecvt_c;
- extern moneypunct<char, false> moneypunct_fc;
- extern moneypunct<char, true> moneypunct_tc;
+ extern num_put<char> num_put_c;
+extern codecvt<char, char, mbstate_t> codecvt_c;
+ extern moneypunct<char, false> moneypunct_cf;
+ extern moneypunct<char, true> moneypunct_ct;
extern money_get<char> money_get_c;
extern money_put<char> money_put_c;
extern __timepunct<char> timepunct_c;
@@ -60,8 +60,8 @@ namespace __gnu_cxx
extern num_get<wchar_t> num_get_w;
extern num_put<wchar_t> num_put_w;
extern codecvt<wchar_t, char, mbstate_t> codecvt_w;
- extern moneypunct<wchar_t, false> moneypunct_fw;
- extern moneypunct<wchar_t, true> moneypunct_tw;
+ extern moneypunct<wchar_t, false> moneypunct_wf;
+ extern moneypunct<wchar_t, true> moneypunct_wt;
extern money_get<wchar_t> money_get_w;
extern money_put<wchar_t> money_put_w;
extern __timepunct<wchar_t> timepunct_w;
@@ -70,10 +70,17 @@ namespace __gnu_cxx
extern std::messages<wchar_t> messages_w;
#endif
+ // And the caches....
extern locale::facet* cache_vec[_GLIBCXX_NUM_FACETS];
- extern std::__numpunct_cache<char> numpunct_cache_c;
+ extern __numpunct_cache<char> numpunct_cache_c;
+ extern __moneypunct_cache<char> moneypunct_cache_cf;
+ extern __moneypunct_cache<char> moneypunct_cache_ct;
+ extern __timepunct_cache<char> timepunct_cache_c;
#ifdef _GLIBCXX_USE_WCHAR_T
- extern std::__numpunct_cache<wchar_t> numpunct_cache_w;
+ extern __numpunct_cache<wchar_t> numpunct_cache_w;
+ extern __moneypunct_cache<wchar_t> moneypunct_cache_wf;
+ extern __moneypunct_cache<wchar_t> moneypunct_cache_wt;
+ extern __timepunct_cache<wchar_t> timepunct_cache_w;
#endif
} // namespace __gnu_cxx
@@ -296,7 +303,6 @@ namespace std
_M_init_facet(new (&ctype_c) std::ctype<char>(0, false, 1));
_M_init_facet(new (&codecvt_c) codecvt<char, char, mbstate_t>(1));
- // Safe to cache this.
typedef __numpunct_cache<char> num_cache_c;
num_cache_c* __npc = new (&numpunct_cache_c) num_cache_c(2);
_M_init_facet(new (&numpunct_c) numpunct<char>(__npc, 1));
@@ -304,11 +310,20 @@ namespace std
_M_init_facet(new (&num_get_c) num_get<char>(1));
_M_init_facet(new (&num_put_c) num_put<char>(1));
_M_init_facet(new (&collate_c) std::collate<char>(1));
- _M_init_facet(new (&moneypunct_fc) moneypunct<char, false>(1));
- _M_init_facet(new (&moneypunct_tc) moneypunct<char, true>(1));
+
+ typedef __moneypunct_cache<char> money_cache_c;
+ money_cache_c* __mpcf = new (&moneypunct_cache_cf) money_cache_c(2);
+ _M_init_facet(new (&moneypunct_cf) moneypunct<char, false>(__mpcf, 1));
+ money_cache_c* __mpct = new (&moneypunct_cache_ct) money_cache_c(2);
+ _M_init_facet(new (&moneypunct_ct) moneypunct<char, true>(__mpct, 1));
+
_M_init_facet(new (&money_get_c) money_get<char>(1));
_M_init_facet(new (&money_put_c) money_put<char>(1));
- _M_init_facet(new (&timepunct_c) __timepunct<char>(1));
+
+ typedef __timepunct_cache<char> time_cache_c;
+ time_cache_c* __tpc = new (&timepunct_cache_c) time_cache_c(2);
+ _M_init_facet(new (&timepunct_c) __timepunct<char>(__tpc, 1));
+
_M_init_facet(new (&time_get_c) time_get<char>(1));
_M_init_facet(new (&time_put_c) time_put<char>(1));
_M_init_facet(new (&messages_c) std::messages<char>(1));
@@ -324,21 +339,36 @@ namespace std
_M_init_facet(new (&num_get_w) num_get<wchar_t>(1));
_M_init_facet(new (&num_put_w) num_put<wchar_t>(1));
_M_init_facet(new (&collate_w) std::collate<wchar_t>(1));
- _M_init_facet(new (&moneypunct_fw) moneypunct<wchar_t, false>(1));
- _M_init_facet(new (&moneypunct_tw) moneypunct<wchar_t, true>(1));
+
+ typedef __moneypunct_cache<wchar_t> money_cache_w;
+ money_cache_w* __mpwf = new (&moneypunct_cache_wf) money_cache_w(2);
+ _M_init_facet(new (&moneypunct_wf) moneypunct<wchar_t, false>(__mpwf, 1));
+ money_cache_w* __mpwt = new (&moneypunct_cache_wt) money_cache_w(2);
+ _M_init_facet(new (&moneypunct_wt) moneypunct<wchar_t, true>(__mpwt, 1));
+
_M_init_facet(new (&money_get_w) money_get<wchar_t>(1));
_M_init_facet(new (&money_put_w) money_put<wchar_t>(1));
- _M_init_facet(new (&timepunct_w) __timepunct<wchar_t>(1));
+
+ typedef __timepunct_cache<wchar_t> time_cache_w;
+ time_cache_w* __tpw = new (&timepunct_cache_w) time_cache_w(2);
+ _M_init_facet(new (&timepunct_w) __timepunct<wchar_t>(__tpw, 1));
+
_M_init_facet(new (&time_get_w) time_get<wchar_t>(1));
_M_init_facet(new (&time_put_w) time_put<wchar_t>(1));
_M_init_facet(new (&messages_w) std::messages<wchar_t>(1));
#endif
// This locale is safe to pre-cache, after all the facets have
- // been installed.
+ // been created and installed.
_M_caches[numpunct<char>::id._M_id()] = __npc;
+ _M_caches[moneypunct<char, false>::id._M_id()] = __mpcf;
+ _M_caches[moneypunct<char, true>::id._M_id()] = __mpct;
+ _M_caches[__timepunct<char>::id._M_id()] = __tpc;
#ifdef _GLIBCXX_USE_WCHAR_T
_M_caches[numpunct<wchar_t>::id._M_id()] = __npw;
+ _M_caches[moneypunct<wchar_t, false>::id._M_id()] = __mpwf;
+ _M_caches[moneypunct<wchar_t, true>::id._M_id()] = __mpwt;
+ _M_caches[__timepunct<wchar_t>::id._M_id()] = __tpw;
#endif
}
diff --git a/libstdc++-v3/src/stl_tree.cc b/libstdc++-v3/src/stl_tree.cc
new file mode 100644
index 00000000000..eac141f0f79
--- /dev/null
+++ b/libstdc++-v3/src/stl_tree.cc
@@ -0,0 +1,386 @@
+// RB tree utilities 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.
+
+/*
+ *
+ * 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.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ */
+
+#include <bits/stl_tree.h>
+
+namespace std
+{
+ _Rb_tree_node_base*
+ _Rb_tree_increment(_Rb_tree_node_base* __x)
+ {
+ if (__x->_M_right != 0)
+ {
+ __x = __x->_M_right;
+ while (__x->_M_left != 0)
+ __x = __x->_M_left;
+ }
+ else
+ {
+ _Rb_tree_node_base* __y = __x->_M_parent;
+ while (__x == __y->_M_right)
+ {
+ __x = __y;
+ __y = __y->_M_parent;
+ }
+ if (__x->_M_right != __y)
+ __x = __y;
+ }
+ return __x;
+ }
+
+ _Rb_tree_node_base*
+ _Rb_tree_decrement(_Rb_tree_node_base* __x)
+ {
+ if (__x->_M_color == _S_red
+ && __x->_M_parent->_M_parent == __x)
+ __x = __x->_M_right;
+ else if (__x->_M_left != 0)
+ {
+ _Rb_tree_node_base* __y = __x->_M_left;
+ while (__y->_M_right != 0)
+ __y = __y->_M_right;
+ __x = __y;
+ }
+ else
+ {
+ _Rb_tree_node_base* __y = __x->_M_parent;
+ while (__x == __y->_M_left)
+ {
+ __x = __y;
+ __y = __y->_M_parent;
+ }
+ __x = __y;
+ }
+ return __x;
+ }
+
+ void
+ _Rb_tree_rotate_left(_Rb_tree_node_base* const __x,
+ _Rb_tree_node_base*& __root)
+ {
+ _Rb_tree_node_base* const __y = __x->_M_right;
+
+ __x->_M_right = __y->_M_left;
+ if (__y->_M_left !=0)
+ __y->_M_left->_M_parent = __x;
+ __y->_M_parent = __x->_M_parent;
+
+ if (__x == __root)
+ __root = __y;
+ else if (__x == __x->_M_parent->_M_left)
+ __x->_M_parent->_M_left = __y;
+ else
+ __x->_M_parent->_M_right = __y;
+ __y->_M_left = __x;
+ __x->_M_parent = __y;
+ }
+
+ void
+ _Rb_tree_rotate_right(_Rb_tree_node_base* const __x,
+ _Rb_tree_node_base*& __root)
+ {
+ _Rb_tree_node_base* const __y = __x->_M_left;
+
+ __x->_M_left = __y->_M_right;
+ if (__y->_M_right != 0)
+ __y->_M_right->_M_parent = __x;
+ __y->_M_parent = __x->_M_parent;
+
+ if (__x == __root)
+ __root = __y;
+ else if (__x == __x->_M_parent->_M_right)
+ __x->_M_parent->_M_right = __y;
+ else
+ __x->_M_parent->_M_left = __y;
+ __y->_M_right = __x;
+ __x->_M_parent = __y;
+ }
+
+ void
+ _Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
+ {
+ __x->_M_color = _S_red;
+
+ while (__x != __root
+ && __x->_M_parent->_M_color == _S_red)
+ {
+ _Rb_tree_node_base* const __xpp = __x->_M_parent->_M_parent;
+
+ if (__x->_M_parent == __xpp->_M_left)
+ {
+ _Rb_tree_node_base* const __y = __xpp->_M_right;
+ if (__y && __y->_M_color == _S_red)
+ {
+ __x->_M_parent->_M_color = _S_black;
+ __y->_M_color = _S_black;
+ __xpp->_M_color = _S_red;
+ __x = __xpp;
+ }
+ else
+ {
+ if (__x == __x->_M_parent->_M_right)
+ {
+ __x = __x->_M_parent;
+ _Rb_tree_rotate_left(__x, __root);
+ }
+ __x->_M_parent->_M_color = _S_black;
+ __xpp->_M_color = _S_red;
+ _Rb_tree_rotate_right(__xpp, __root);
+ }
+ }
+ else
+ {
+ _Rb_tree_node_base* const __y = __xpp->_M_left;
+ if (__y && __y->_M_color == _S_red)
+ {
+ __x->_M_parent->_M_color = _S_black;
+ __y->_M_color = _S_black;
+ __xpp->_M_color = _S_red;
+ __x = __xpp;
+ }
+ else
+ {
+ if (__x == __x->_M_parent->_M_left)
+ {
+ __x = __x->_M_parent;
+ _Rb_tree_rotate_right(__x, __root);
+ }
+ __x->_M_parent->_M_color = _S_black;
+ __xpp->_M_color = _S_red;
+ _Rb_tree_rotate_left(__xpp, __root);
+ }
+ }
+ }
+ __root->_M_color = _S_black;
+ }
+
+ _Rb_tree_node_base*
+ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
+ _Rb_tree_node_base& __header)
+ {
+ _Rb_tree_node_base *& __root = __header._M_parent;
+ _Rb_tree_node_base *& __leftmost = __header._M_left;
+ _Rb_tree_node_base *& __rightmost = __header._M_right;
+ _Rb_tree_node_base* __y = __z;
+ _Rb_tree_node_base* __x = 0;
+ _Rb_tree_node_base* __x_parent = 0;
+
+ if (__y->_M_left == 0) // __z has at most one non-null child. y == z.
+ __x = __y->_M_right; // __x might be null.
+ else
+ if (__y->_M_right == 0) // __z has exactly one non-null child. y == z.
+ __x = __y->_M_left; // __x is not null.
+ else
+ {
+ // __z has two non-null children. Set __y to
+ __y = __y->_M_right; // __z's successor. __x might be null.
+ while (__y->_M_left != 0)
+ __y = __y->_M_left;
+ __x = __y->_M_right;
+ }
+ if (__y != __z)
+ {
+ // relink y in place of z. y is z's successor
+ __z->_M_left->_M_parent = __y;
+ __y->_M_left = __z->_M_left;
+ if (__y != __z->_M_right)
+ {
+ __x_parent = __y->_M_parent;
+ if (__x) __x->_M_parent = __y->_M_parent;
+ __y->_M_parent->_M_left = __x; // __y must be a child of _M_left
+ __y->_M_right = __z->_M_right;
+ __z->_M_right->_M_parent = __y;
+ }
+ else
+ __x_parent = __y;
+ if (__root == __z)
+ __root = __y;
+ else if (__z->_M_parent->_M_left == __z)
+ __z->_M_parent->_M_left = __y;
+ else
+ __z->_M_parent->_M_right = __y;
+ __y->_M_parent = __z->_M_parent;
+ std::swap(__y->_M_color, __z->_M_color);
+ __y = __z;
+ // __y now points to node to be actually deleted
+ }
+ else
+ { // __y == __z
+ __x_parent = __y->_M_parent;
+ if (__x)
+ __x->_M_parent = __y->_M_parent;
+ if (__root == __z)
+ __root = __x;
+ else
+ if (__z->_M_parent->_M_left == __z)
+ __z->_M_parent->_M_left = __x;
+ else
+ __z->_M_parent->_M_right = __x;
+ if (__leftmost == __z)
+ if (__z->_M_right == 0) // __z->_M_left must be null also
+ __leftmost = __z->_M_parent;
+ // makes __leftmost == _M_header if __z == __root
+ else
+ __leftmost = _Rb_tree_node_base::_S_minimum(__x);
+ if (__rightmost == __z)
+ if (__z->_M_left == 0) // __z->_M_right must be null also
+ __rightmost = __z->_M_parent;
+ // makes __rightmost == _M_header if __z == __root
+ else // __x == __z->_M_left
+ __rightmost = _Rb_tree_node_base::_S_maximum(__x);
+ }
+ if (__y->_M_color != _S_red)
+ {
+ while (__x != __root && (__x == 0 || __x->_M_color == _S_black))
+ if (__x == __x_parent->_M_left)
+ {
+ _Rb_tree_node_base* __w = __x_parent->_M_right;
+ if (__w->_M_color == _S_red)
+ {
+ __w->_M_color = _S_black;
+ __x_parent->_M_color = _S_red;
+ _Rb_tree_rotate_left(__x_parent, __root);
+ __w = __x_parent->_M_right;
+ }
+ if ((__w->_M_left == 0 ||
+ __w->_M_left->_M_color == _S_black) &&
+ (__w->_M_right == 0 ||
+ __w->_M_right->_M_color == _S_black))
+ {
+ __w->_M_color = _S_red;
+ __x = __x_parent;
+ __x_parent = __x_parent->_M_parent;
+ }
+ else
+ {
+ if (__w->_M_right == 0
+ || __w->_M_right->_M_color == _S_black)
+ {
+ __w->_M_left->_M_color = _S_black;
+ __w->_M_color = _S_red;
+ _Rb_tree_rotate_right(__w, __root);
+ __w = __x_parent->_M_right;
+ }
+ __w->_M_color = __x_parent->_M_color;
+ __x_parent->_M_color = _S_black;
+ if (__w->_M_right)
+ __w->_M_right->_M_color = _S_black;
+ _Rb_tree_rotate_left(__x_parent, __root);
+ break;
+ }
+ }
+ else
+ {
+ // same as above, with _M_right <-> _M_left.
+ _Rb_tree_node_base* __w = __x_parent->_M_left;
+ if (__w->_M_color == _S_red)
+ {
+ __w->_M_color = _S_black;
+ __x_parent->_M_color = _S_red;
+ _Rb_tree_rotate_right(__x_parent, __root);
+ __w = __x_parent->_M_left;
+ }
+ if ((__w->_M_right == 0 ||
+ __w->_M_right->_M_color == _S_black) &&
+ (__w->_M_left == 0 ||
+ __w->_M_left->_M_color == _S_black))
+ {
+ __w->_M_color = _S_red;
+ __x = __x_parent;
+ __x_parent = __x_parent->_M_parent;
+ }
+ else
+ {
+ if (__w->_M_left == 0 || __w->_M_left->_M_color == _S_black)
+ {
+ __w->_M_right->_M_color = _S_black;
+ __w->_M_color = _S_red;
+ _Rb_tree_rotate_left(__w, __root);
+ __w = __x_parent->_M_left;
+ }
+ __w->_M_color = __x_parent->_M_color;
+ __x_parent->_M_color = _S_black;
+ if (__w->_M_left)
+ __w->_M_left->_M_color = _S_black;
+ _Rb_tree_rotate_right(__x_parent, __root);
+ break;
+ }
+ }
+ if (__x) __x->_M_color = _S_black;
+ }
+ return __y;
+ }
+
+ unsigned int
+ _Rb_tree_black_count(const _Rb_tree_node_base* __node,
+ const _Rb_tree_node_base* __root)
+ {
+ if (__node == 0)
+ return 0;
+ unsigned int __sum = 0;
+ do
+ {
+ if (__node->_M_color == _S_black)
+ ++__sum;
+ if (__node == __root)
+ break;
+ __node = __node->_M_parent;
+ }
+ while (1);
+ return __sum;
+ }
+} // namespace std
diff --git a/libstdc++-v3/testsuite/17_intro/header_ciso646.cc b/libstdc++-v3/testsuite/17_intro/header_ciso646.cc
index 8513b0864ef..35b1ceef32d 100644
--- a/libstdc++-v3/testsuite/17_intro/header_ciso646.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_ciso646.cc
@@ -1,6 +1,6 @@
// 1999-05-20 bkoz
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 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
@@ -86,10 +86,6 @@ bool test01()
#endif
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
@@ -110,10 +106,6 @@ bool test02()
VERIFY( (arg1 && arg2) == (arg1 and arg2) );
VERIFY( (arg1 && int1) == (arg1 and int1) );
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits.cc b/libstdc++-v3/testsuite/18_support/numeric_limits.cc
index 1643625cb3e..63d9412c368 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits.cc
@@ -2,7 +2,7 @@
// 1999-08-23 bkoz
-// Copyright (C) 1999, 2001, 2002 Free Software Foundation
+// Copyright (C) 1999, 2001, 2002, 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
@@ -233,11 +233,6 @@ bool test01()
VERIFY( !obj.traps );
VERIFY( !obj.tinyness_before );
VERIFY( obj.round_style == std::round_toward_zero );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
@@ -281,11 +276,6 @@ bool test03()
VERIFY( std::numeric_limits<signed long long>::digits10 == 18 );
VERIFY( std::numeric_limits<unsigned long long>::digits10 == 19 );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
@@ -302,11 +292,6 @@ bool test04()
VERIFY( !std::numeric_limits<unsigned long>::is_iec559 );
VERIFY( !std::numeric_limits<long long>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned long long>::is_iec559 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc
index a7fc70e7a04..496a6e54309 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc
@@ -150,10 +150,6 @@ bool test01(void)
str05.append(str05.begin(), str05.begin() + str05.find('r'));
VERIFY( str05 == "point bolivar, texaspoint boliva" );
VERIFY( str05 != str01 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc
index d69d9b6bdfa..f6002f9af5d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc
@@ -150,10 +150,6 @@ bool test01(void)
str05.append(str05.begin(), str05.begin() + str05.find(L'r'));
VERIFY( str05 == L"point bolivar, texaspoint boliva" );
VERIFY( str05 != str01 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc
index 02b6b79037b..096f4f3957d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc
@@ -59,11 +59,7 @@ test_value(int result, want_value expected)
default:
pass = false; //should not get here
}
-
-#ifdef DEBUG_ASSERT
- assert(pass);
-#endif
-
+ VERIFY(pass);
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc
index 25f8abdab97..5d6151900b2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc
@@ -60,10 +60,7 @@ test_value(int result, want_value expected)
pass = false; //should not get here
}
-#ifdef DEBUG_ASSERT
- assert(pass);
-#endif
-
+ VERIFY(pass);
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc
index 3c92910f312..8f673c89dbf 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc
@@ -155,7 +155,7 @@ void test01(void)
int main()
{
- __gnu_cxx_test::set_memory_limits();
+ __gnu_test::set_memory_limits();
test01();
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc
index eeb3516d236..b1a5b6dd40a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc
@@ -155,7 +155,7 @@ void test01(void)
int main()
{
- __gnu_cxx_test::set_memory_limits();
+ __gnu_test::set_memory_limits();
test01();
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc
index 069aa278680..f594df72847 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc
@@ -80,10 +80,6 @@ bool test01(void)
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc
index fbfa0136b67..d2b5831ad6b 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc
@@ -102,9 +102,6 @@ bool test01(void)
VERIFY( str03[0] == 'x' );
// need to also test for const begin/const end
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc
index 426d0e39638..1c7ee5bbdf7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc
@@ -76,10 +76,6 @@ bool test02(void)
std::string str13 = str12;
*p2 = 'e';
VERIFY( str12 != str13 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc
index 00394cf36c8..3c39bc555cc 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc
@@ -80,10 +80,6 @@ bool test01(void)
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc
index 37aec1c93ce..e2455e635e7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc
@@ -102,9 +102,7 @@ bool test01(void)
VERIFY( str03[0] == L'x' );
// need to also test for const begin/const end
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
+ VERIFY(test);
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc
index b7710382ca8..0ef50cc8fb7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc
@@ -76,10 +76,6 @@ bool test02(void)
std::wstring str13 = str12;
*p2 = L'e';
VERIFY( str12 != str13 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc
index 561053cf666..0f2236cbe1a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc
@@ -84,10 +84,6 @@ bool test01(void)
VERIFY( csz01 == csz02 );
csz01 = str01.find('/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc
index abc35e27f1e..9c3e2f079a8 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc
@@ -83,10 +83,6 @@ bool test02(void)
csz01 = str01.find_first_of('z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc
index 02647cf6310..15d0ee2ef52 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc
@@ -83,10 +83,6 @@ bool test03(void)
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of('S');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- VERIFY(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc
index ecf3182d66f..6ed224b3b31 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc
@@ -84,10 +84,6 @@ bool test01(void)
VERIFY( csz01 == csz02 );
csz01 = str01.find(L'/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc
index 8ae592d4eb3..4635dac1267 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc
@@ -83,10 +83,6 @@ bool test02(void)
csz01 = str01.find_first_of(L'z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc
index 5d119ece9c2..c874229d853 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc
@@ -83,10 +83,6 @@ bool test03(void)
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of(L'S');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- VERIFY(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc
index a6052e2170b..919c8717b0a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc
@@ -180,16 +180,12 @@ int test01(void)
csz01 = str03.size();
str03.insert(str03.end(), str01.begin(), str01.end());
VERIFY( str03 == "baker beach, san franciscorodeo beach, marin" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
int main()
{
- __gnu_cxx_test::set_memory_limits();
+ __gnu_test::set_memory_limits();
test01();
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc
index 80b0cee58b7..d39bbe2d091 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc
@@ -73,10 +73,6 @@ int test02(void)
str01.insert(0, str01.c_str());
VERIFY( str01 == "Everything was beautiful, and nothing hurt"
"Everything was beautiful, and nothing hurt");
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc
index 96f71b0839e..f439df907d9 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc
@@ -180,16 +180,12 @@ int test01(void)
csz01 = str03.size();
str03.insert(str03.end(), str01.begin(), str01.end());
VERIFY( str03 == L"baker beach, san franciscorodeo beach, marin" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
int main()
{
- __gnu_cxx_test::set_memory_limits();
+ __gnu_test::set_memory_limits();
test01();
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc
index 04cc454e14b..8b1468b3338 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc
@@ -73,10 +73,6 @@ int test02(void)
str01.insert(0, str01.c_str());
VERIFY( str01 == L"Everything was beautiful, and nothing hurt"
L"Everything was beautiful, and nothing hurt");
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc
index 4b862322653..ba92251c6ad 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc
@@ -157,10 +157,6 @@ bool test01(void)
std::string hello_world;
std::cout << hello_world;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc
index 55eecc19a28..b53ca2764d2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc
@@ -54,10 +54,6 @@ void test04(int size)
VERIFY( oss.good() );
std::string str_tmp = oss.str();
VERIFY( str_tmp.size() == expected_size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc
index 8e24f5b55b7..416a1df4421 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc
@@ -75,10 +75,6 @@ void test05(int size)
}
VERIFY( count == 2 * size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc
index 5d426259752..195ef9dc2ff 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc
@@ -52,10 +52,6 @@ void test06(void)
size_type i06 = str02.capacity();
VERIFY( i05 == i03 );
VERIFY( i06 <= i04 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc
index 7e6116ec148..07e3ce63cac 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc
@@ -44,10 +44,6 @@ void test07(void)
VERIFY( i < 3 );
VERIFY( static_cast<bool>(iss.rdstate() & std::ios_base::failbit) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc
index 5297958c453..46718003d77 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc
@@ -157,10 +157,6 @@ bool test01(void)
std::wstring hello_world;
std::wcout << hello_world;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc
index f47d8da43aa..fd844438184 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc
@@ -54,10 +54,6 @@ void test04(int size)
VERIFY( oss.good() );
std::wstring str_tmp = oss.str();
VERIFY( str_tmp.size() == expected_size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc
index e9a701e8c52..6d5c69cc1a3 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc
@@ -75,10 +75,6 @@ void test05(int size)
}
VERIFY( count == 2 * size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc
index aedcdb26391..1fa1fb07ca3 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc
@@ -52,10 +52,6 @@ void test06(void)
size_type i06 = str02.capacity();
VERIFY( i05 == i03 );
VERIFY( i06 <= i04 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc
index 4028924674b..0a3775c0bc6 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc
@@ -44,10 +44,6 @@ void test07(void)
VERIFY( i < 3 );
VERIFY( static_cast<bool>(iss.rdstate() & std::ios_base::failbit) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc
index da8b30638ff..dec24cff731 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc
@@ -41,12 +41,6 @@ int test01(void)
// printf("2:%s\n", str1.c_str()); //str1 is gone
const char* p2 = str1.c_str();
return 0;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
- return test;
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc
index c41ac68ffe2..bc3351d02fb 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc
@@ -285,11 +285,6 @@ template<class charT, class traits, class Allocator>
str_4 = 'o' + str_4;
str_4 = 'c' + str_4;
VERIFY( str_4 == str_3 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc
index cd8f18bf663..1dec0cb6895 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc
@@ -41,12 +41,6 @@ int test01(void)
// wprintf("2:%s\n", str1.c_str()); //str1 is gone
const wchar_t* p2 = str1.c_str();
return 0;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
- return test;
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc
index 11e63f70e93..d92450d23ba 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc
@@ -285,11 +285,6 @@ template<class charT, class traits, class Allocator>
str_4 = L'o' + str_4;
str_4 = L'c' + str_4;
VERIFY( str_4 == str_3 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc
index 7145d4c7840..d4c632b7a42 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc
@@ -73,10 +73,6 @@ bool test01(void)
std::find(x.rbegin(), x.rend(), 'l').base(), ar,
ar + sizeof(ar) / sizeof(ar[0]));
VERIFY( x == "jeHelloo" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc
index fd0967a86fe..19ee154025f 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc
@@ -73,10 +73,6 @@ bool test01(void)
std::find(x.rbegin(), x.rend(), L'l').base(), ar,
ar + sizeof(ar) / sizeof(ar[0]));
VERIFY( x == L"jeHelloo" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc
index 5b9a4181b91..ddc791b6c4a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc
@@ -83,10 +83,6 @@ bool test01(void)
VERIFY( csz01 == csz02 );
csz01 = str01.rfind('/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc
index 30e40a98658..d186199a138 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc
@@ -41,10 +41,6 @@ bool test02()
VERIFY( pos == 1 );
pos = z.find_last_of('X');
VERIFY( pos == std::string::npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc
index aeb132b6a58..3517d4da169 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc
@@ -56,10 +56,6 @@ bool test03()
VERIFY( pos == 0 );
pos = z.find_last_not_of("Xa");
VERIFY( pos == 1 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc
index 9681bf4c8e4..bfb1f914c21 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc
@@ -83,10 +83,6 @@ bool test01(void)
VERIFY( csz01 == csz02 );
csz01 = str01.rfind(L'/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc
index 587b19b4a79..2f813b9b28b 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc
@@ -41,10 +41,6 @@ bool test02()
VERIFY( pos == 1 );
pos = z.find_last_of(L'X');
VERIFY( pos == std::wstring::npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc
index 1bfd1eb757b..a94da0d3e85 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc
@@ -56,10 +56,6 @@ bool test03()
VERIFY( pos == 0 );
pos = z.find_last_not_of(L"Xa");
VERIFY( pos == 1 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc
index be2a379c581..486892a62e0 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc
@@ -66,10 +66,6 @@ bool test01(void)
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc
index 843ebb6861a..1a4e4f63936 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc
@@ -66,10 +66,6 @@ bool test01(void)
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc
index d7e72d67f3a..1a933f8fd3b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc
@@ -33,7 +33,7 @@ void test02()
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc
index ad45e621434..9e98f53f88b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc
@@ -33,7 +33,7 @@ void test03()
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc
index fe72e341a53..0929676270f 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc
@@ -33,7 +33,7 @@ void test04()
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc
index c3eca4aeaa5..c103b2e41c5 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc
@@ -33,7 +33,7 @@ void test02()
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
bool test = true;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc
index 8297c260d69..9cc921c7bce 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc
@@ -33,7 +33,7 @@ void test03()
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
bool test = true;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/4.cc
index 2ffc351c873..68972e7ab32 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/4.cc
@@ -33,7 +33,7 @@ void test04()
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
bool test = true;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc
index a7a622f16a1..51739b6ae3b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc
@@ -88,7 +88,7 @@ void test02()
wmemset(i_ref, 0xdeadbeef, size + 1);
int_type* ito_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc
index 1279d3be1a3..118462d618b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc
@@ -102,7 +102,7 @@ void test03()
wmemset(i_ref, 0xdeadbeef, size + 1);
int_type* ito_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc
index a4ef7fe01c2..c08ee55efea 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc
@@ -110,7 +110,7 @@ void test04()
wmemset(i_ref, 0xdeadbeef, esize + 1);
int_type* ito_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc
index 799414bbbe5..7d14ab4cfb5 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc
@@ -60,7 +60,7 @@ void test07()
wmemset(i_ref, 0xdeadbeef, size + 1);
int_type* ito_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc
index 27a59c6aa53..296f2eb3171 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc
@@ -109,7 +109,7 @@ void test08()
wmemset(i_ref, 0xdeadbeef, esize + 1);
int_type* ito_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc
index f95a43626ef..7ba367b1327 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc
@@ -111,7 +111,7 @@ void test09()
int_type* ito = i_arr;
int_type* ito_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc
index 029e30f8fef..6f92b6ce093 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc
@@ -61,7 +61,7 @@ void test02()
"\xff";
int size = strlen(e_lit);
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc
index 41555def81e..8aec29d580b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc
@@ -61,7 +61,7 @@ void test03()
"\xff";
int size = strlen(e_lit);
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc
index f49e47dad87..0b7b87c2643 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc
@@ -100,7 +100,7 @@ void test04()
int esize = strlen(e_lit);
int isize = wcslen(i_lit);
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc
index 485bfe0278c..7d8ff4a1d80 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc
@@ -52,7 +52,7 @@ void test07()
const ext_type* efrom_next;
int size = strlen(e_lit);
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc
index efa390b42d8..c99c823fbe2 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc
@@ -31,7 +31,7 @@ void test02()
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc
index 50877849d2d..27f67a4f117 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc
@@ -31,7 +31,7 @@ void test03()
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc
index 2e2a62e6e32..8ab6828ddb5 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc
@@ -31,7 +31,7 @@ void test04()
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc
index bb172dbe351..ff413d5ac8a 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc
@@ -86,7 +86,7 @@ void test02()
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc
index 8d396f87863..b1fa9fa4f22 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc
@@ -100,7 +100,7 @@ void test03()
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc
index 1a28aa74cd3..4fd193e3055 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc
@@ -107,7 +107,7 @@ void test04()
memset(e_ref, 0xf0, esize + 1);
ext_type* eto_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc
index 7b5c120b7f2..3c069c8bb84 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc
@@ -58,7 +58,7 @@ void test03()
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc
index 5bd81df7a36..a6d107cacb6 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc
@@ -71,7 +71,7 @@ void test02()
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc
index 167e12375a8..7ca700764c3 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc
@@ -85,7 +85,7 @@ void test03()
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc
index 631b87399bb..234a4b63f46 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc
@@ -80,7 +80,7 @@ void test04()
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
+ locale loc = __gnu_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc
index fd4c90dadff..42469aea514 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc
index 892bac54534..b6f944949a3 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc
index e604b202b6f..6712832294c 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc
@@ -33,7 +33,7 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/1.cc
index b74157b84e3..c1825e2bbf2 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc
index 56a4083f6ee..8d813abde3d 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc
@@ -37,9 +37,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/3.cc
index 824f8e1dfa6..c4b87bad068 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/3.cc
@@ -33,7 +33,7 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc
index 1a36ca2d744..50c697d0f14 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
index 0a5f060e621..8dc885ac533 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc
index 5e8336885b5..6ef1bedbb08 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc
index 44c0eb77eb3..2347e0469b2 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc
@@ -36,9 +36,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc
index 1a36ca2d744..50c697d0f14 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
index 0a5f060e621..8dc885ac533 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc
index 4a38327d5eb..679a4b0c8fd 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc
@@ -32,9 +32,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc
index 21b90ff0e15..c82d97cfa85 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc
@@ -32,7 +32,7 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_env.cc
index 9f9d1aade91..ca0da1c2f2a 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test02);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc
index 2ef10fd5765..1231025372b 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test02);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc
index b0a68cf2c6e..4943ba0b7d5 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc
@@ -36,9 +36,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/3.cc
index 0a3f98113f9..583d747145a 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/3.cc
@@ -32,7 +32,7 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc
index fb4923958c8..fe7ed8dbfac 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test02);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc
index 11327b39582..fdbf3035a78 100644
--- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test02);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc b/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc
index eec1513af27..f650be796a0 100644
--- a/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc
@@ -32,7 +32,7 @@ void test01()
string str;
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
str = loc_de.name();
locale loc_byname(locale::classic(), new collate_byname<char>("de_DE"));
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
index 605e5f3dfdb..89be53dd3f0 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
@@ -67,7 +67,7 @@ void test02()
}
// "de_DE"
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
const ctype<char>& ctype_de = use_facet<ctype<char> >(loc_de);
for (int i = 0; i < max; ++i)
{
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
index 7ff278c1f87..c9eb1e0b2a4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
@@ -67,7 +67,7 @@ void test02()
}
// "de_DE"
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
const ctype<wchar_t>& ctype_de = use_facet<ctype<wchar_t> >(loc_de);
for (int i = 0; i < max; ++i)
{
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc
index 67d9b6ee153..ac3b436f590 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc
@@ -38,7 +38,7 @@ void test03()
using namespace std;
bool test = true;
- locale loc = __gnu_cxx_test::try_named_locale("se_NO.UTF-8");
+ locale loc = __gnu_test::try_named_locale("se_NO.UTF-8");
const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
const wchar_t* wstrlit = L"\x80";
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc
index e1ab3f76bbe..6f9dec45d3c 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc
@@ -38,7 +38,7 @@ void test02()
using namespace std;
bool test = true;
- locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
+ locale loc = __gnu_test::try_named_locale("en_US.ISO-8859-1");
const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
char c = 0xff;
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc
index 1d380d49fdb..d9b32b0a6cb 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc
@@ -38,7 +38,7 @@ void test03()
using namespace std;
bool test = true;
- locale loc = __gnu_cxx_test::try_named_locale("se_NO.UTF-8");
+ locale loc = __gnu_test::try_named_locale("se_NO.UTF-8");
const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
const char* strlit = "\xc2\x80";
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/facet/2.cc b/libstdc++-v3/testsuite/22_locale/facet/2.cc
index 379ed8975f0..844eb7b3d24 100644
--- a/libstdc++-v3/testsuite/22_locale/facet/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/facet/2.cc
@@ -83,7 +83,7 @@ void test02()
// 4: Named locale should destroy facets when it goes out of scope.
// Not quite sure how to test for this w/o valgrind at the moment.
{
- locale loc03 = __gnu_cxx_test::try_named_locale("es_MX");
+ locale loc03 = __gnu_test::try_named_locale("es_MX");
}
}
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/2.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/2.cc
index 15ea686141e..e49756f18fd 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/2.cc
@@ -170,7 +170,7 @@ void test01()
// 3
// explicit locale(const char* std_name)
- locale loc06 = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc06 = __gnu_test::try_named_locale("fr_FR");
VERIFY (loc06 != loc01);
VERIFY (loc06 != loc02);
VERIFY (loc06.name() == "fr_FR");
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc
index f6fc08adaf3..e450441816e 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc
@@ -33,7 +33,7 @@ void test03()
const char* LC_ALL_orig = getenv("LC_ALL");
if (!setenv("LC_ALL", "it_IT", 1))
{
- std::locale loc = __gnu_cxx_test::try_named_locale("");
+ std::locale loc = __gnu_test::try_named_locale("");
VERIFY( loc.name() == "it_IT" );
setenv("LC_ALL", LC_ALL_orig ? LC_ALL_orig : "", 1);
}
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
index c24f6a42a79..5492a0ce723 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
@@ -65,7 +65,7 @@ void test04()
// Check that a "POSIX" LC_ALL is equivalent to "C".
if (!setenv("LC_ALL", "POSIX", 1))
{
- locale loc = __gnu_cxx_test::try_named_locale("");
+ locale loc = __gnu_test::try_named_locale("");
VERIFY( loc.name() == "C" );
}
setenv("LC_ALL", "", 1);
@@ -73,7 +73,7 @@ void test04()
// Check that a "en_PH" LC_ALL is equivalent to "en_PH".
if (!setenv("LC_ALL", "en_PH", 1))
{
- locale loc = __gnu_cxx_test::try_named_locale("");
+ locale loc = __gnu_test::try_named_locale("");
VERIFY( loc.name() == "en_PH" );
}
setenv("LC_ALL", "", 1);
@@ -83,7 +83,7 @@ void test04()
{
if (!setenv("LC_ALL", "en_PH", 1))
{
- locale loc = __gnu_cxx_test::try_named_locale("");
+ locale loc = __gnu_test::try_named_locale("");
VERIFY( loc.name() == "en_PH" );
}
setenv("LC_ALL", "", 1);
@@ -112,7 +112,7 @@ void test04()
// Check the default set by LANG.
if (!setenv("LANG", "fr_FR", 1))
{
- locale loc = __gnu_cxx_test::try_named_locale("");
+ locale loc = __gnu_test::try_named_locale("");
VERIFY( loc.name() == "fr_FR" );
}
@@ -126,7 +126,7 @@ void test04()
// Setting a category in the "C" default.
if (!setenv("LC_COLLATE", "de_DE", 1))
{
- locale loc = __gnu_cxx_test::try_named_locale("");
+ locale loc = __gnu_test::try_named_locale("");
#if _GLIBCXX_NUM_CATEGORIES
VERIFY( loc.name() == "LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=C;"
@@ -142,7 +142,7 @@ void test04()
// Changing the LANG default while LC_COLLATE is set.
if (!setenv("LANG", "fr_FR", 1))
{
- locale loc = __gnu_cxx_test::try_named_locale("");
+ locale loc = __gnu_test::try_named_locale("");
#if _GLIBCXX_NUM_CATEGORIES
VERIFY( loc.name() == "LC_CTYPE=fr_FR;LC_NUMERIC=fr_FR;"
"LC_TIME=fr_FR;LC_COLLATE=de_DE;LC_MONETARY=fr_FR;"
@@ -160,7 +160,7 @@ void test04()
#if _GLIBCXX_NUM_CATEGORIES
if (!setenv("LC_IDENTIFICATION", "it_IT", 1))
{
- locale loc = __gnu_cxx_test::try_named_locale("");
+ locale loc = __gnu_test::try_named_locale("");
VERIFY( loc.name() == "LC_CTYPE=fr_FR;LC_NUMERIC=fr_FR;"
"LC_TIME=fr_FR;LC_COLLATE=de_DE;LC_MONETARY=fr_FR;"
"LC_MESSAGES=fr_FR;LC_PAPER=fr_FR;LC_NAME=fr_FR;"
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc
index ced0f59f6be..ffcd3ab943a 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc
@@ -35,7 +35,7 @@ test02()
// construct a locale object with the specialized facet.
locale loc_c = locale::classic();
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
locale loc_1(locale::classic(),
new numpunct_byname<char>("fr_FR"));
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/7222-env.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/7222-env.cc
index 126db7da1fa..8bd9c4ace2a 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/7222-env.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/7222-env.cc
@@ -30,8 +30,8 @@ void test02()
{
bool test = true;
- std::locale loc_1 = __gnu_cxx_test::try_named_locale("");
- std::locale loc_2 = __gnu_cxx_test::try_named_locale("");
+ std::locale loc_1 = __gnu_test::try_named_locale("");
+ std::locale loc_2 = __gnu_test::try_named_locale("");
VERIFY( loc_1 == loc_2 );
}
diff --git a/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc b/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc
index 7d5aec00771..81b06ee0ecd 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc
@@ -42,13 +42,13 @@ void test02()
// named locales work.
if (testph && testmx)
{
- const locale loc_ph = __gnu_cxx_test::try_named_locale(ph.c_str());
- const locale loc_mx = __gnu_cxx_test::try_named_locale(mx.c_str());
+ const locale loc_ph = __gnu_test::try_named_locale(ph.c_str());
+ const locale loc_mx = __gnu_test::try_named_locale(mx.c_str());
// Use setlocale between two calls to locale("")
- const locale loc_env_1 = __gnu_cxx_test::try_named_locale("");
+ const locale loc_env_1 = __gnu_test::try_named_locale("");
setlocale(LC_ALL, ph.c_str());
- const locale loc_env_2 = __gnu_cxx_test::try_named_locale("");
+ const locale loc_env_2 = __gnu_test::try_named_locale("");
VERIFY( loc_env_1 == loc_env_2 );
// Change global locale.
diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc
index 2956ec8ab9e..5b360b15a21 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc
@@ -30,14 +30,14 @@ void test01()
typedef std::messages<char>::string_type string_type;
bool test = true;
- // This is exported through RUNTESTFLAGS in testsuite/Makefile.am.
+ // This is defined through CXXFLAGS in scripts/testsuite_flags[.in].
const char* dir = LOCALEDIR;
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc
index eed7efaa262..389d3721a1b 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc
@@ -30,14 +30,14 @@ void test02()
typedef std::messages<char>::string_type string_type;
bool test = true;
- // This is exported through RUNTESTFLAGS in testsuite/Makefile.am.
+ // This is defined through CXXFLAGS in scripts/testsuite_flags[.in].
const char* dir = LOCALEDIR;
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc
index ad975115720..d4abacc99ed 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc
@@ -30,14 +30,14 @@ void test03()
typedef std::messages<char>::string_type string_type;
bool test = true;
- // This is exported through RUNTESTFLAGS in testsuite/Makefile.am.
+ // This is defined through CXXFLAGS in scripts/testsuite_flags[.in].
const char* dir = LOCALEDIR;
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc b/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc
index e915c9675cb..cc8860bef9d 100644
--- a/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc
@@ -31,11 +31,11 @@ void test01()
bool test = true;
string str;
- // This is exported through RUNTESTFLAGS in testsuite/Makefile.am.
+ // This is defined through CXXFLAGS in scripts/testsuite_flags[.in].
const char* dir = LOCALEDIR;
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
str = loc_de.name();
locale loc_byname(locale::classic(), new messages_byname<char>("de_DE"));
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 b35b448db2f..ed0d19e46ec 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
@@ -36,9 +36,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/23_containers/vector_bool.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/11528.cc
index 3deec4985d2..c4f00f7add9 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_bool.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/11528.cc
@@ -1,6 +1,4 @@
-// 2002-03-05 Stephen M. Webb <stephen.webb@bregmasoft.com>
-
-// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+// 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
@@ -18,45 +16,38 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 23.2.5 class vector<bool>
+// 22.2.6.1.1 money_get members
-#include <vector>
+#include <locale>
+#include <sstream>
#include <testsuite_hooks.h>
void test01()
{
- std::vector<bool>::iterator i;
- if (false)
- ++i;
-}
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
-// libstdc++/6886
-void test02()
-{
bool test = true;
- typedef std::vector<bool> bvec;
- int i, num = 0;
- bvec v;
-
- v.resize(66);
- for (i = 0 ; i < 66 ; ++i)
- v[i] = 0;
+ locale loc_us = __gnu_test::try_named_locale("en_US");
- v[1] = 1;
- v[33] = 1;
- v[49] = 1;
- v[65] = 1;
+ iterator_type end;
+ istringstream iss;
+ iss.imbue(loc_us);
- for (bvec::iterator j = v.begin() ; j != v.end() ; j++)
- if (bool(*j)) ++num;
+ const money_get<char>& mon_get = use_facet<money_get<char> >(iss.getloc());
- VERIFY( num == 4 );
+ iss.str("$.00 ");
+ iterator_type is_it(iss);
+ string extracted_amount;
+ ios_base::iostate err = ios_base::goodbit;
+ mon_get.get(is_it, end, false, iss, err, extracted_amount);
+ VERIFY( extracted_amount == "0" );
+ VERIFY( err == ios_base::goodbit );
}
int main()
{
test01();
- test02();
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc
index a0d4caef7a2..ddb2c3f5d6f 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc
@@ -36,9 +36,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc
index 80e47c940fd..91ca66fb64c 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc
@@ -36,9 +36,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc
index b62e2f44764..d3c8359b528 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc
@@ -36,9 +36,9 @@ void test04()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc
index b9872d9c7b0..97db30aba24 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc
@@ -56,7 +56,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc
index 996af345b58..ec63ba9b24b 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc
@@ -56,7 +56,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
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 8d1d532c9a1..a3965f79a6a 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
@@ -36,9 +36,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/23_containers/vector_resize.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/11528.cc
index 3cc6c57ed42..5c0036162fc 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_resize.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/11528.cc
@@ -1,7 +1,4 @@
-// 1999-05-07
-// bkoz
-
-// Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+// 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
@@ -19,35 +16,34 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 23.2.4.2 vector capacity
-
-// 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* } }
+// 22.2.6.1.1 money_get members
-#include <vector>
-#include <stdexcept>
+#include <locale>
+#include <sstream>
#include <testsuite_hooks.h>
void test01()
{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
bool test = true;
- std::vector<int> v;
- try
- {
- v.resize(v.max_size());
- v[v.max_size() - 1] = 2002;
- }
- catch (const std::bad_alloc& error)
- {
- test = true;
- }
- catch (...)
- {
- test = false;
- }
- VERIFY( test );
+
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+
+ iterator_type end;
+ wistringstream iss;
+ iss.imbue(loc_us);
+
+ const money_get<wchar_t>& mon_get = use_facet<money_get<wchar_t> >(iss.getloc());
+
+ iss.str(L"$.00 ");
+ iterator_type is_it(iss);
+ wstring extracted_amount;
+ ios_base::iostate err = ios_base::goodbit;
+ mon_get.get(is_it, end, false, iss, err, extracted_amount);
+ VERIFY( extracted_amount == L"0" );
+ VERIFY( err == ios_base::goodbit );
}
int main()
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc
index 38721ce9991..a3959df3218 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc
@@ -36,9 +36,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc
index da33d636035..2883e7a4d43 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc
@@ -36,9 +36,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc
index 91b05cb45e4..94c27aa7cf9 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc
@@ -36,9 +36,9 @@ void test04()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc
index b9872d9c7b0..97db30aba24 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc
@@ -56,7 +56,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc
index 996af345b58..ec63ba9b24b 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc
@@ -56,7 +56,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc
index 27d79dc4b07..12192f5bcab 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc
@@ -36,9 +36,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
index 69cfeb6ca55..044ea1174bc 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
@@ -36,9 +36,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc
index 49531ad0a38..ead1aff1b72 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc
@@ -36,9 +36,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc
index c04f700e5cd..2f7385fb155 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc
index 88f84572a91..105db813293 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc
index 19c04d68007..942589bb540 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc
@@ -36,9 +36,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc
index ad5834b1921..2f32240bd3f 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc
@@ -36,9 +36,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc
index 03c747ac842..de5f5db79d6 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc
@@ -36,9 +36,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc
index c04f700e5cd..2f7385fb155 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc
index 88f84572a91..105db813293 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc
index 13d680e14fb..833995ba35a 100644
--- a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc
@@ -34,7 +34,7 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
// cache the moneypunct facets
typedef moneypunct<char, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/2.cc
index 4394d83257a..d3bbc39da18 100644
--- a/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/2.cc
@@ -34,7 +34,7 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
// cache the moneypunct facets
typedef moneypunct<wchar_t, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc b/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc
index 70cbf38058d..ea0857a5736 100644
--- a/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc
@@ -32,7 +32,7 @@ void test01()
bool test = true;
string str;
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
str = loc_de.name();
locale loc_byname(locale::classic(), new moneypunct_byname<char>("de_DE"));
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc
index 6d4de201f24..190f9921aef 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc
index cb446c7e36a..8d0ce69e254 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc
index 41867ca9192..43e16c2d2c4 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc
@@ -33,9 +33,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc
index 0590d49b13e..e170931d060 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc
@@ -36,7 +36,7 @@ void test05()
istringstream iss;
// A locale that expects grouping
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc
index a6b94172035..52722d1acb8 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc
@@ -33,7 +33,7 @@ void test06()
double d = 0.0;
istringstream iss;
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc
index c04f700e5cd..2f7385fb155 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc
index 88f84572a91..105db813293 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/1.cc
index 784f83cb6fd..952651d883c 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/2.cc
index bbf2a98872a..6f52860f3bf 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc
index 65fcf84051a..3a775682a2b 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc
@@ -33,9 +33,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/5.cc
index 8443816a8d6..09f12be587b 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/5.cc
@@ -36,7 +36,7 @@ void test05()
wistringstream iss;
// A locale that expects grouping
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/6.cc
index 57490f3f0aa..e2aeb184b23 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/6.cc
@@ -33,7 +33,7 @@ void test06()
double d = 0.0;
wistringstream iss;
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc
index c04f700e5cd..2f7385fb155 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc
index 88f84572a91..105db813293 100644
--- a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc
@@ -48,7 +48,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc
index bffab3fefe6..cc1759129c6 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc
index 407dbff3a65..5f783320c5f 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc
index 080a2a47672..cae87474f29 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc
@@ -33,9 +33,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc
index 055f4c9f316..ce590ea57e8 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc
@@ -33,7 +33,7 @@ void test05()
bool test = true;
// A locale that expects grouping.
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
const string empty;
string result;
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc
index 2baa3a44950..0bcd332b1de 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc
@@ -44,7 +44,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc
index 63e7a470160..ab9a6a65927 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc
@@ -44,7 +44,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/1.cc
index a8a5da15e0f..379a1379d51 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/2.cc
index 8416c4c16c9..30faf63f649 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc
index 26750ac7a61..5115355969f 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc
@@ -33,9 +33,9 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/5.cc
index dd4799b85bd..ea9e39f231b 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/5.cc
@@ -33,7 +33,7 @@ void test05()
bool test = true;
// A locale that expects grouping.
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
const wstring empty;
wstring result;
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc
index 2baa3a44950..0bcd332b1de 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc
@@ -44,7 +44,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc
index 63e7a470160..ab9a6a65927 100644
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc
@@ -44,7 +44,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc
index 023c64f8d7c..b57ecb21fac 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc
@@ -31,9 +31,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc
index b6c8b2ddecc..0ff21db6dce 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc
@@ -31,9 +31,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_1.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_1.cc
new file mode 100644
index 00000000000..002b0c47e37
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_1.cc
@@ -0,0 +1,78 @@
+// 2003-07-06 Benjamin Kosnik <bkoz@redhat.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.
+
+#include <locale>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+class numpunct_checked : public std::numpunct<char>
+{
+ typedef std::numpunct<char> base;
+
+public:
+ explicit
+ numpunct_checked(std::size_t refs = 0): base(refs) { }
+
+ string_type
+ base_truename() const
+ { return base::do_truename(); }
+
+protected:
+ virtual string_type
+ do_truename() const
+ { return base::do_truename() + "st"; }
+};
+
+// Thwart locale caching strategies that incorrectly overwrite base
+// class data.
+void test01()
+{
+ using namespace std;
+
+ bool test = true;
+ const string basestr("true");
+ const string derivedstr("truest");
+
+ const locale loc(locale::classic(), new numpunct_checked);
+ stringbuf sbuf;
+ ostream os(&sbuf);
+ os.setf(ios_base::boolalpha);
+
+ // Pre-cache sanity check.
+ const numpunct<char>& np = use_facet<numpunct<char> >(loc);
+ VERIFY( np.truename() == derivedstr );
+
+ // Cache.
+ os.imbue(loc);
+ os << true;
+ VERIFY( sbuf.str() == derivedstr );
+
+ // Post-cache sanity check, make sure that base class is still fine.
+ VERIFY( np.truename() == derivedstr );
+ const numpunct_checked& npd = static_cast<const numpunct_checked&>(np);
+ VERIFY( npd.base_truename() == basestr );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_2.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_2.cc
new file mode 100644
index 00000000000..729e82a64bd
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_2.cc
@@ -0,0 +1,90 @@
+// 2003-07-06 Benjamin Kosnik <bkoz@redhat.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.
+
+#include <locale>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+class numpunct_checked : public std::numpunct<char>
+{
+ typedef std::numpunct<char> base;
+
+public:
+ explicit
+ numpunct_checked(std::size_t refs = 0): base(refs) { }
+
+ string_type
+ base_truename() const
+ { return base::do_truename(); }
+
+protected:
+ virtual string_type
+ do_truename() const
+ { return base::do_truename() + "st"; }
+};
+
+// Changing caches deletes old cache, adds new one.
+void test01()
+{
+ using namespace std;
+
+ bool test = true;
+ const string empty;
+ const string basestr("true");
+ const string derivedstr("truest");
+
+ const locale loc(locale::classic(), new numpunct_checked);
+ stringbuf sbuf;
+ ostream os(&sbuf);
+ os.setf(ios_base::boolalpha);
+
+ // Pre-cache sanity check.
+ const numpunct<char>& np = use_facet<numpunct<char> >(loc);
+ VERIFY( np.truename() == derivedstr );
+
+ // Cache.
+ os.imbue(loc);
+ os << true;
+ VERIFY( sbuf.str() == derivedstr );
+
+ // Re-cache.
+ sbuf.str(empty);
+ os.imbue(locale::classic());
+ os << true;
+ VERIFY( sbuf.str() == basestr );
+
+ // Cache new locale again.
+ sbuf.str(empty);
+ os.imbue(loc);
+ os << true;
+ VERIFY( sbuf.str() == derivedstr );
+
+ // Post-cache sanity check, make sure that base class is still fine.
+ VERIFY( np.truename() == derivedstr );
+ const numpunct_checked& npd = static_cast<const numpunct_checked&>(np);
+ VERIFY( npd.base_truename() == basestr );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/1.cc
index e3426fda43c..ef1c9f0af7d 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/1.cc
@@ -31,9 +31,9 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/2.cc
index 9b55ae95e33..fce8fa2c6d7 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/2.cc
@@ -31,9 +31,9 @@ void test02()
// basic construction
locale loc_c = locale::classic();
- locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_us = __gnu_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_1.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_1.cc
new file mode 100644
index 00000000000..0b41e963f50
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_1.cc
@@ -0,0 +1,78 @@
+// 2003-07-06 Benjamin Kosnik <bkoz@redhat.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.
+
+#include <locale>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+class numpunct_checked : public std::numpunct<wchar_t>
+{
+ typedef std::numpunct<wchar_t> base;
+
+public:
+ explicit
+ numpunct_checked(std::size_t refs = 0): base(refs) { }
+
+ string_type
+ base_truename() const
+ { return base::do_truename(); }
+
+protected:
+ virtual string_type
+ do_truename() const
+ { return base::do_truename() + L"st"; }
+};
+
+// Thwart locale caching strategies that incorrectly overwrite base
+// class data.
+void test01()
+{
+ using namespace std;
+
+ bool test = true;
+ const wstring basestr(L"true");
+ const wstring derivedstr(L"truest");
+
+ const locale loc(locale::classic(), new numpunct_checked);
+ wstringbuf sbuf;
+ wostream os(&sbuf);
+ os.setf(ios_base::boolalpha);
+
+ // Pre-cache sanity check.
+ const numpunct<wchar_t>& np = use_facet<numpunct<wchar_t> >(loc);
+ VERIFY( np.truename() == derivedstr );
+
+ // Cache.
+ os.imbue(loc);
+ os << true;
+ VERIFY( sbuf.str() == derivedstr );
+
+ // Post-cache sanity check, make sure that base class is still fine.
+ VERIFY( np.truename() == derivedstr );
+ const numpunct_checked& npd = static_cast<const numpunct_checked&>(np);
+ VERIFY( npd.base_truename() == basestr );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_2.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_2.cc
new file mode 100644
index 00000000000..9a3c4872e5c
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_2.cc
@@ -0,0 +1,90 @@
+// 2003-07-06 Benjamin Kosnik <bkoz@redhat.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.
+
+#include <locale>
+#include <sstream>
+#include <ostream>
+#include <testsuite_hooks.h>
+
+class numpunct_checked : public std::numpunct<wchar_t>
+{
+ typedef std::numpunct<wchar_t> base;
+
+public:
+ explicit
+ numpunct_checked(std::size_t refs = 0): base(refs) { }
+
+ string_type
+ base_truename() const
+ { return base::do_truename(); }
+
+protected:
+ virtual string_type
+ do_truename() const
+ { return base::do_truename() + L"st"; }
+};
+
+// Changing caches deletes old cache, adds new one.
+void test01()
+{
+ using namespace std;
+
+ bool test = true;
+ const wstring empty;
+ const wstring basestr(L"true");
+ const wstring derivedstr(L"truest");
+
+ const locale loc(locale::classic(), new numpunct_checked);
+ wstringbuf sbuf;
+ wostream os(&sbuf);
+ os.setf(ios_base::boolalpha);
+
+ // Pre-cache sanity check.
+ const numpunct<wchar_t>& np = use_facet<numpunct<wchar_t> >(loc);
+ VERIFY( np.truename() == derivedstr );
+
+ // Cache.
+ os.imbue(loc);
+ os << true;
+ VERIFY( sbuf.str() == derivedstr );
+
+ // Re-cache.
+ sbuf.str(empty);
+ os.imbue(locale::classic());
+ os << true;
+ VERIFY( sbuf.str() == basestr );
+
+ // Cache new locale again.
+ sbuf.str(empty);
+ os.imbue(loc);
+ os << true;
+ VERIFY( sbuf.str() == derivedstr );
+
+ // Post-cache sanity check, make sure that base class is still fine.
+ VERIFY( np.truename() == derivedstr );
+ const numpunct_checked& npd = static_cast<const numpunct_checked&>(np);
+ VERIFY( npd.base_truename() == basestr );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_env.cc
index 4f1d5e3f6a9..19e4210ff2c 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc
index 8d7871815db..292b8c738e4 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc b/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc
index 96a9691ac6d..a3fcaf268f4 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc
@@ -30,7 +30,7 @@ void test01()
bool test = true;
string str;
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
str = loc_de.name();
locale loc_byname(locale::classic(), new numpunct_byname<char>("de_DE"));
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc b/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc
index 6bebbbf0d4c..4e6c9d68e62 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc
@@ -29,7 +29,7 @@ void test02()
bool test = true;
- locale loc_it = __gnu_cxx_test::try_named_locale("it_IT");
+ locale loc_it = __gnu_test::try_named_locale("it_IT");
const numpunct<char>& nump_it = use_facet<numpunct<char> >(loc_it);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc
index 59128a61336..f4f0b88502c 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/1.cc
index b4a2fcf6984..c9c19dfc29a 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_env.cc
index b3d040edc7a..c6356dfa6c4 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_env.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_env("de_DE", "LANG", two);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc
index 17d4d5dcb82..3be97fb4ee7 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc
@@ -28,7 +28,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
run_tests_wrapped_locale("ja_JP.eucjp", two);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc
index a4782795f6e..7c54955a76e 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc
@@ -34,9 +34,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc
index 149b95276d5..63d2602272a 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc
@@ -34,9 +34,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
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 71a30d11b87..aedf8817d8c 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
@@ -34,9 +34,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc
index 33312396dac..aff0d1e74e7 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc
@@ -34,9 +34,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc
index 6ecbb0a0ddb..17f52a56385 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc
@@ -37,9 +37,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc
index 6535a66c4e9..f9d79a43440 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc
@@ -34,9 +34,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
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 7e82e5197c2..0b86d74f996 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
@@ -37,9 +37,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc
index edab4ba3f3c..63689eefca3 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc
@@ -34,9 +34,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc
index 89015346acf..1517fe2e138 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc
@@ -33,9 +33,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc
index ddb817f0913..9b307d7535c 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
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 a1fe3b3d2e7..00ee21e680a 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
@@ -33,9 +33,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc
index 0151fc64d33..a412cf01011 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc
@@ -33,9 +33,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc
index c530170d05a..ecbe8ecc2d8 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc
@@ -34,9 +34,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc
index 68a7d89ed1a..e423be62572 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc
@@ -34,9 +34,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
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 0c7d5b40f04..dca85d24fd2 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
@@ -34,9 +34,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc
index af2e3ecc6ec..1ca267440e7 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc
@@ -34,9 +34,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc
index 3f042d9ec42..294934099c1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc
index 61086ad6da8..e54f823b8f9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc
@@ -36,7 +36,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc
index 0f408fc1f12..d0aea858ae7 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc
@@ -34,9 +34,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_env.cc
index 206130ac140..bcc3e36e2d6 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test03);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc
index b805c3c43cf..3cfb7053f17 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test03);
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 e5c726a13b3..f8158957272 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
@@ -34,9 +34,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_env.cc
index 206130ac140..bcc3e36e2d6 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_env.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test03);
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc
index b805c3c43cf..3cfb7053f17 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc
@@ -32,7 +32,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test03);
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc
index d3acb9b824a..b547034f7a0 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc
@@ -40,9 +40,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc
index 4656efc16e4..eb844f16209 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc
@@ -40,9 +40,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc
index 3b768db4b12..522a899ef38 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc
@@ -40,9 +40,9 @@ void test03()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc
index d07fad6dc2d..8c9b1e0f492 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc
@@ -40,9 +40,9 @@ void test04()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc
index e1355b8ea47..9376987050e 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc
@@ -41,9 +41,9 @@ void test05()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc
index 5634d9f3bde..e0ea595f08d 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc
@@ -41,9 +41,9 @@ void test06()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc
index 91a5e9bf848..1f37a24a16f 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc
@@ -42,9 +42,9 @@ void test07()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc
index 7409ff9cbb4..b047ed96547 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc
@@ -41,9 +41,9 @@ void test08()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc
index bcf68e986ba..c887914ee63 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc
@@ -64,7 +64,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc
index 465af45016e..097e11a55bb 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc
@@ -64,7 +64,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc
index 874b62800c2..c6f36b732f0 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc
@@ -40,9 +40,9 @@ void test01()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
index b41e6a7feb5..67ce4a344d1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
@@ -40,9 +40,9 @@ void test02()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
index d3cf9dd9971..c0ecf6acef3 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
@@ -40,9 +40,9 @@ void test03()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc
index db04bcc0765..6206ff57734 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc
@@ -40,9 +40,9 @@ void test04()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc
index 9268127b1a5..b017d420549 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc
@@ -41,9 +41,9 @@ void test05()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc
index 90f7614f9d9..8bb5b237d66 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc
@@ -41,9 +41,9 @@ void test06()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
index c63147870df..354285e35ca 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
@@ -41,9 +41,9 @@ void test07()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc
index a7edf18c477..6367a8edd27 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc
@@ -41,9 +41,9 @@ void test08()
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_hk = __gnu_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc
index bcf68e986ba..c887914ee63 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc
@@ -64,7 +64,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc
index 465af45016e..097e11a55bb 100644
--- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc
@@ -64,7 +64,7 @@
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
func_callback two;
two.push_back(&test01);
two.push_back(&test02);
diff --git a/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc b/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
deleted file mode 100644
index 8dae3add5ea..00000000000
--- a/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-// 1999-06-08 bkoz
-
-// Copyright (C) 1999, 2000, 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.
-
-// 23.3.5.1 bitset constructors
-
-#include <string>
-#include <bitset>
-#include <stdexcept>
-#include <testsuite_hooks.h>
-
-bool test01(void)
-{
- bool test = true;
-
- // bitset()
- const size_t n1 = 5;
- std::bitset<n1> bit01;
- for (int i = 0; i < n1; ++i)
- VERIFY( !bit01.test(i) );
-
- // bitset(unsigned long)
- const size_t n2 = 32;
- unsigned long ul1 = 2;
- std::bitset<n2> bit02(ul1);
- VERIFY( !bit02.test(0) );
- VERIFY( bit02.test(1) );
- VERIFY( !bit02.test(2) );
-
- // template<_CharT, _Traits, _Alloc>
- // explicit bitset(const basic_string<_C,_T,_A>&, size_type pos, size_type n)
- std::string str01("stuff smith sessions");
- const size_t n3 = 128;
- try {
- std::bitset<n3> bit03(str01, 5);
- }
- catch(std::invalid_argument& fail) {
- VERIFY( true );
- }
- catch(...) {
- VERIFY( false );
- }
-
- std::string str02("010101000011");
- int sz = str02.size();
- try {
- std::bitset<n3> bit03(str02, 0);
- std::string str03;
- for (int i = 0; i < sz; ++i)
- str03 += (bit03.test(i) ? '1' : '0');
- std::reverse(str03.begin(), str03.end());
- VERIFY( str03 == str02 );
- }
- catch(std::invalid_argument& fail) {
- VERIFY( false );
- }
- catch(...) {
- VERIFY( false );
- }
-
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
- return test;
-}
-
-// boundary condition: a zero-sized set
-// libstdc++/6282
-bool test02(void)
-{
- using std::char_traits; using std::allocator;
- bool test = true;
-
- std::bitset<0> z1;
- VERIFY( z1.any() == false );
-
- std::bitset<0> z2(12345);
- VERIFY( z2.any() == false );
-
- std::bitset<0> z3(std::string("10101010101"));
- VERIFY( z3.any() == false );
-
- try {
- z1.set(0);
- VERIFY( false );
- }
- catch(std::out_of_range& fail) {
- VERIFY( true );
- }
- catch(...) {
- VERIFY( false );
- }
-
- VERIFY( z1.to_ulong() == 0 );
- VERIFY( ( z1.to_string<char,char_traits<char>,allocator<char> >().empty() ) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
- return test;
-}
-
-int main()
-{
- test01();
- test02();
-
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/bitset_members.cc b/libstdc++-v3/testsuite/23_containers/bitset_members.cc
deleted file mode 100644
index 82e3a487ea3..00000000000
--- a/libstdc++-v3/testsuite/23_containers/bitset_members.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// 2001-06-03 pme
-
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.3.5.2 bitset members
-
-#include <bitset>
-#include <stdexcept>
-#include <sstream>
-#include <testsuite_hooks.h>
-
-void
-test01(void)
-{
- bool test = true;
- const size_t n1 = 5;
-
- // the other 22 member functions should be in here too...
- try {
- std::bitset<n1> five_bits;
- bool unused = five_bits.test(n1); // should throw
- VERIFY( false );
- }
- catch(std::out_of_range& fail) {
- VERIFY( true );
- }
- catch(...) {
- VERIFY( false );
- }
- VERIFY( test );
-}
-
-// libstdc++/6124
-void test02()
-{
- std::bitset<1> bs;
- bs.count();
-}
-
-void test03()
-{
- bool test = true;
- std::bitset<5> b;
- std::stringstream ss ("101");
-
- ss.exceptions(std::ios_base::eofbit);
-
- try
- {
- ss >> b;
- }
- catch (std::exception&) {}
-
- VERIFY( b.to_ulong() == 5 );
-}
-
-int main()
-{
- test01();
- test02();
- test03();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/bitset_shift.cc b/libstdc++-v3/testsuite/23_containers/bitset_shift.cc
deleted file mode 100644
index 01fdd2fbc4b..00000000000
--- a/libstdc++-v3/testsuite/23_containers/bitset_shift.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-// 2000-01-15 Anders Widell <awl@hem.passagen.se>
-
-// Copyright (C) 2000 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-#include <string>
-#include <set>
-#include <bitset>
-
-#include <testsuite_hooks.h>
-
-static char original_bits[1024];
-static char left_shifted[1024];
-static char right_shifted[1024];
-
-char
-random_bit() {
- static long x = 1;
- return ((x = (3432L*x + 6789L) % 9973L) & 1) + '0';
-}
-
-void
-initialise(size_t size) {
- for (size_t i=0; i<size; i++)
- original_bits[i] = random_bit();
-
- original_bits[size] = '\0';
- left_shifted[size] = '\0';
- right_shifted[size] = '\0';
-}
-
-void
-shift_arrays(size_t shift_step, size_t size) {
- for (size_t i=shift_step; i<size; i++) {
- right_shifted[i] = original_bits[i-shift_step];
- left_shifted[size-i-1] = original_bits[size+shift_step-i-1];
- }
- for (size_t i=0; i<shift_step && i<size; i++) {
- right_shifted[i] = '0';
- left_shifted[size-i-1] = '0';
- }
-}
-
-template <size_t size>
- bool
- do_test() {
- bool test = true;
-
- std::bitset<size> shifted;
- std::bitset<size> correct;
-
- initialise(size);
-
- //std::bitset<size> original = std::string(original_bits);
- std::bitset<size> original = std::bitset<size> (std::string(original_bits));
-
- for (size_t shift_step=0; shift_step==0 || shift_step<size; shift_step++) {
- shift_arrays(shift_step, size);
-
- shifted = original;
- shifted <<= shift_step;
- //correct = std::string(left_shifted);
- correct = std::bitset<size> (std::string(left_shifted));
- VERIFY( shifted == correct );
-
- shifted = original;
- shifted >>= shift_step;
- //correct = std::string(right_shifted);
- correct = std::bitset<size> (std::string(right_shifted));
- VERIFY( shifted == correct );
- }
-
- return test;
- }
-
-bool
-test01() {
- bool test = true;
-
- VERIFY( do_test<32>() );
- VERIFY( do_test<48>() );
- VERIFY( do_test<64>() );
-
- VERIFY( do_test<511>() );
- VERIFY( do_test<513>() );
- VERIFY( do_test<997>() );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
- return test;
-}
-
-bool
-test02()
-{
- bool test = true;
-
- std::bitset<66> b;
- b <<= 400;
- VERIFY( b.count() == 0 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
- return test;
-}
-
-int
-main() {
- test01();
- test02();
-
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/deque_ctor.cc b/libstdc++-v3/testsuite/23_containers/deque_ctor.cc
deleted file mode 100644
index 50a813368bb..00000000000
--- a/libstdc++-v3/testsuite/23_containers/deque_ctor.cc
+++ /dev/null
@@ -1,539 +0,0 @@
-// 2001-12-27 pme
-//
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.1.1 deque constructors, copy, and assignment
-
-#include <deque>
-#include <iterator>
-#include <sstream>
-#include <testsuite_allocator.h>
-#include <testsuite_hooks.h>
-
-using __gnu_cxx_test::copy_tracker;
-using __gnu_cxx_test::allocation_tracker;
-using __gnu_cxx_test::tracker_alloc;
-using __gnu_cxx_test::copy_constructor;
-using __gnu_cxx_test::assignment_operator;
-using __gnu_cxx_test::counter;
-using __gnu_cxx_test::destructor;
-
-typedef std::deque<counter> gdeque;
-
-bool test = true;
-
-// see http://gcc.gnu.org/ml/libstdc++/2001-11/msg00139.html
-void
-test01()
-{
- assert_count (0);
- {
- gdeque d(10);
- assert_count (10);
- }
- assert_count (0);
-}
-
-
-// 23.2.1 required types
-//
-// A missing required type will cause a compile failure.
-//
-void
-requiredTypesCheck()
-{
- typedef int T;
- typedef std::deque<T> X;
-
- typedef X::reference reference;
- typedef X::const_reference const_reference;
- typedef X::iterator iterator;
- typedef X::const_iterator const_iterator;
- typedef X::size_type size_type;
- typedef X::difference_type difference_type;
- typedef X::value_type value_type;
- typedef X::allocator_type allocator_type;
- typedef X::pointer pointer;
- typedef X::const_pointer const_pointer;
- typedef X::reverse_iterator reverse_iterator;
- typedef X::const_reverse_iterator const_reverse_iterator;
-}
-
-
-// @fn defaultConstructorCheck
-// Explicitly checks the default deque constructor and destructor for both
-// trivial and non-trivial types. In addition, the size() and empty()
-// member functions are explicitly checked here since it should be their
-// first use. Checking those functions means checking the begin() and
-// end() and their const brethren functions as well.
-//
-// @verbatim
-// 23.2.1.1 default ctor/dtor
-// effects:
-// 23.2.1.1 constructs an empty deque using the specified allocator
-// postconditions:
-// 23.1 table 65 u.size() == 0
-// throws:
-// complexity:
-// 23.1 table 65 constant
-//
-// 23.2.1.2 bool empty() const
-// semantics:
-// 23.1 table 65 a.size() == 0
-// 23.1 (7) a.begin() == a.end()
-// throws:
-// complexity:
-// 23.1 table 65 constant
-//
-// 23.2.1.2 size_type size() const
-// semantics:
-// 23.1 table 65 a.end() - a.begin()
-// throws:
-// complexity:
-// 23.1 table 65(A) should be constant
-//
-// 23.2.1 iterator begin()
-// const_iterator begin() const
-// iterator end()
-// const_iterator end() const
-// throws:
-// 23.1 (10) pt. 4 does not throw
-// complexity:
-// 23.1 table 65 constant
-// @endverbatim
-void
-defaultConstructorCheckPOD()
-{
- // setup
- typedef int T;
- typedef std::deque<T> X;
-
- // run test
- X u;
-
- // assert postconditions
- VERIFY(u.empty());
- VERIFY(0 == u.size());
- VERIFY(u.begin() == u.end());
- VERIFY(0 == std::distance(u.begin(), u.end()));
-
- // teardown
-}
-
-
-void
-defaultConstructorCheck()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- copy_tracker::reset();
-
- // run test
- const X u;
-
- // assert postconditions
- VERIFY(u.empty());
- VERIFY(0 == u.size());
- VERIFY(u.begin() == u.end());
- VERIFY(0 == std::distance(u.begin(), u.end()));
-
- // teardown
-}
-
-
-// @fn copyConstructorCheck()
-// Explicitly checks the deque copy constructor. Continues verificaton of
-// ancillary member functions documented under defaultConstructorCheck().
-//
-// This check also tests the push_back() member function.
-//
-// @verbatim
-// 23.2.1 copy constructor
-// effects:
-// postconditions:
-// 22.1.1 table 65 a == X(a)
-// u == a
-// throws:
-// complexity:
-// 22.1.1 table 65 linear
-// @endverbatim
-void
-copyConstructorCheck()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- const int copyBaseSize = 17; // arbitrary
-
- X a;
- for (int i = 0; i < copyBaseSize; ++i)
- a.push_back(i);
- copy_tracker::reset();
-
- // assert preconditions
- VERIFY(!a.empty());
- VERIFY(copyBaseSize == a.size());
- VERIFY(a.begin() != a.end());
- VERIFY(copyBaseSize == std::distance(a.begin(), a.end()));
-
- // run test
- X u = a;
-
- // assert postconditions
- VERIFY(u == a);
- VERIFY(copyBaseSize == copy_constructor::count());
-
- // teardown
-}
-
-
-// @fn fillConstructorCheck()
-// This test explicitly verifies the basic fill constructor. Like the default
-// constructor, later tests depend on the fill constructor working correctly.
-// That means this explicit test should preceed the later tests so the error
-// message given on assertion failure can be more helpful n tracking the
-// problem.
-//
-// 23.2.1.1 fill constructor
-// complexity:
-// 23.2.1.1 linear in N
-void
-fillConstructorCheck()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- const X::size_type n(23);
- const X::value_type t(111);
-
- copy_tracker::reset();
-
- // run test
- X a(n, t);
-
- // assert postconditions
- VERIFY(n == a.size());
- VERIFY(n == copy_constructor::count());
-
- // teardown
-}
-
-
-// @fn fillConstructorCheck2()
-// Explicit check for fill constructors masqueraded as range constructors as
-// elucidated in clause 23.1.1 paragraph 9 of the standard.
-//
-// 23.1.1 (9) fill constructor looking like a range constructor
-void
-fillConstructorCheck2()
-{
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- const int f = 23;
- const int l = 111;
-
- copy_tracker::reset();
-
- X a(f, l);
-
- VERIFY(f == a.size());
- VERIFY(f == copy_constructor::count());
-}
-
-
-// @fn rangeConstructorCheckForwardIterator()
-// This test copies from one deque to another to force the copy
-// constructor for T to be used because the compiler will kindly
-// elide copies if the default constructor can be used with
-// type conversions. Trust me.
-//
-// 23.2.1.1 range constructor, forward iterators
-void
-rangeConstructorCheckForwardIterator()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- const X::size_type n(726);
- const X::value_type t(307);
- X source(n, t);
- X::iterator i = source.begin();
- X::iterator j = source.end();
- X::size_type rangeSize = std::distance(i, j);
-
- copy_tracker::reset();
-
- // test
- X a(i, j);
-
- // assert postconditions
- VERIFY(rangeSize == a.size());
- VERIFY(copy_constructor::count() <= rangeSize);
-}
-
-
-// @fn rangeConstructorCheckInputIterator()
-// An explicit check for range construction on an input iterator
-// range, which the standard expounds upon as having a different
-// complexity than forward iterators.
-//
-// 23.2.1.1 range constructor, input iterators
-void
-rangeConstructorCheckInputIterator()
-{
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- std::istringstream ibuf("1234567890123456789");
- const X::size_type rangeSize = ibuf.str().size();
- std::istream_iterator<char> i(ibuf);
- std::istream_iterator<char> j;
-
- copy_tracker::reset();
-
- X a(i, j);
-
- VERIFY(rangeSize == a.size());
- VERIFY(copy_constructor::count() <= (2 * rangeSize));
-}
-
-
-// 23.2.1 copy assignment
-void
-copyAssignmentCheck()
-{
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- const X::size_type n(18);
- const X::value_type t(1023);
- X a(n, t);
- X r;
-
- copy_tracker::reset();
-
- r = a;
-
- VERIFY(r == a);
- VERIFY(n == copy_constructor::count());
-}
-
-
-// 23.2.1.1 fill assignment
-//
-// The complexity check must check dtors+copyAssign and
-// copyCtor+copyAssign because that's the way the SGI implementation
-// works. Dunno if it's true standard compliant (which specifies fill
-// assignment in terms of erase and insert only), but it should work
-// as (most) users expect and is more efficient.
-void
-fillAssignmentCheck()
-{
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- const X::size_type starting_size(10);
- const X::value_type starting_value(66);
- const X::size_type n(23);
- const X::value_type t(111);
-
- X a(starting_size, starting_value);
- copy_tracker::reset();
-
- // preconditions
- VERIFY(starting_size == a.size());
-
- // test
- a.assign(n, t);
-
- // postconditions
- VERIFY(n == a.size());
- VERIFY(n == (copy_constructor::count() + assignment_operator::count()));
- VERIFY(starting_size == (destructor::count() + assignment_operator::count()));
-}
-
-
-// @verbatim
-// 23.2.1 range assignment
-// 23.2.1.1 deque constructors, copy, and assignment
-// effects:
-// Constructs a deque equal to the range [first, last), using the
-// specified allocator.
-//
-// template<typename InputIterator>
-// assign(InputIterator first, InputIterator last);
-//
-// is equivalent to
-//
-// erase(begin(), end());
-// insert(begin(), first, last);
-//
-// postconditions:
-// throws:
-// complexity:
-// forward iterators: N calls to the copy constructor, 0 reallocations
-// input iterators: 2N calls to the copy constructor, log(N) reallocations
-// @endverbatim
-void
-rangeAssignmentCheck()
-{
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- const X::size_type source_size(726);
- const X::value_type source_value(307);
- const X::size_type starting_size(10);
- const X::value_type starting_value(66);
-
- X source(source_size, source_value);
- X::iterator i = source.begin();
- X::iterator j = source.end();
- X::size_type rangeSize = std::distance(i, j);
-
- X a(starting_size, starting_value);
- VERIFY(starting_size == a.size());
-
- copy_tracker::reset();
-
- a.assign(i, j);
-
- VERIFY(source == a);
- VERIFY(rangeSize == (copy_constructor::count() + assignment_operator::count()));
- VERIFY(starting_size == (destructor::count() + assignment_operator::count()));
-}
-
-
-// 23.1 (10) range assignment
-// 23.2.1.3 with exception
-void
-rangeAssignmentCheckWithException()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- // test
- // What does "no effects" mean?
-}
-
-
-// 23.1.1 (9) fill assignment looking like a range assignment
-void
-fillAssignmentCheck2()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T> X;
-
- // test
- // What does "no effects" mean?
-}
-
-// Verify that the default deque constructor offers the basic exception
-// guarantee.
-void
-test_default_ctor_exception_safety()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T, tracker_alloc<T> > X;
-
- T::reset();
- copy_constructor::throw_on(3);
- allocation_tracker::resetCounts();
-
- // test
- try
- {
- X a(7);
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
-
- // assert postconditions
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
-}
-
-// Verify that the copy constructor offers the basic exception guarantee.
-void
-test_copy_ctor_exception_safety()
-{
- // setup
- typedef copy_tracker T;
- typedef std::deque<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(7);
- T::reset();
- copy_constructor::throw_on(3);
-
-
- // test
- try
- {
- X u(a);
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
- }
-
- // assert postconditions
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
-}
-
-
-int main()
-{
- // basic functionality and standard conformance checks
- requiredTypesCheck();
- defaultConstructorCheckPOD();
- defaultConstructorCheck();
- test_default_ctor_exception_safety();
- copyConstructorCheck();
- test_copy_ctor_exception_safety();
- fillConstructorCheck();
- fillConstructorCheck2();
- rangeConstructorCheckInputIterator();
- rangeConstructorCheckForwardIterator();
- copyAssignmentCheck();
- fillAssignmentCheck();
- fillAssignmentCheck2();
- rangeAssignmentCheck();
- rangeAssignmentCheckWithException();
-
- // specific bug fix checks
- test01();
-
- return !test;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/deque_operators.cc b/libstdc++-v3/testsuite/23_containers/deque_operators.cc
deleted file mode 100644
index 5463b47f1cb..00000000000
--- a/libstdc++-v3/testsuite/23_containers/deque_operators.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// 2002-05-18 Paolo Carlini <pcarlini@unitus.it>
-
-// Copyright (C) 2002 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.1 deque operators
-
-#include <deque>
-#include <testsuite_hooks.h>
-
-// libstdc++/6503
-void test01()
-{
- bool test = true;
-
- std::deque<int> d(2);
- typedef std::deque<int>::iterator iter;
- typedef std::deque<int>::const_iterator constiter;
-
- iter beg = d.begin();
- iter end = d.end();
- constiter constbeg = d.begin();
- constiter constend = d.end();
-
- VERIFY( beg == constbeg );
- VERIFY( constend == end );
-
- VERIFY( beg != constend );
- VERIFY( constbeg != end );
-
- VERIFY( beg < constend );
- VERIFY( constbeg < end );
-
- VERIFY( end > constbeg );
- VERIFY( constend > beg );
-
- VERIFY( end >= constend );
- VERIFY( constbeg >= beg );
-
- VERIFY( beg <= constbeg );
- VERIFY( constend <= end );
-}
-
-// libstdc++/7186
-void test02()
-{
- bool test = true;
-
- std::deque<int> d(2);
- typedef std::deque<int>::iterator iter;
- typedef std::deque<int>::const_iterator constiter;
-
- iter beg = d.begin();
- iter end = d.end();
- constiter constbeg = d.begin();
- constiter constend = d.end();
-
- VERIFY( beg - constbeg == 0 );
- VERIFY( constend - end == 0 );
-
- VERIFY( end - constbeg > 0 );
- VERIFY( constend - beg > 0 );
-}
-
-int main()
-{
- test01();
- test02();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/list_capacity.cc b/libstdc++-v3/testsuite/23_containers/list_capacity.cc
deleted file mode 100644
index 133fecd5423..00000000000
--- a/libstdc++-v3/testsuite/23_containers/list_capacity.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (C) 2001 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.2.2 list capacity [lib.list.capacity]
-
-#include <list>
-#include <testsuite_hooks.h>
-
-bool test = true;
-
-// This test verifies the following.
-//
-// 23.2.2 bool empty() const
-// 23.2.2 size_type size() const
-// 23.2.2 iterator begin()
-// 23.2.2 iterator end()
-// 23.2.2.3 void push_back(const T&)
-// 23.2.2 size_type max_size() const
-// 23.2.2.2 void resize(size_type s, T c = T())
-//
-void
-test01()
-{
- std::list<int> list0101;
- VERIFY(list0101.empty());
- VERIFY(list0101.size() == 0);
-
- list0101.push_back(1);
- VERIFY(!list0101.empty());
- VERIFY(list0101.size() == 1);
-
- list0101.resize(3, 2);
- VERIFY(!list0101.empty());
- VERIFY(list0101.size() == 3);
-
- std::list<int>::iterator i = list0101.begin();
- VERIFY(*i == 1); ++i;
- VERIFY(*i == 2); ++i;
- VERIFY(*i == 2); ++i;
- VERIFY(i == list0101.end());
-
- list0101.resize(0);
- VERIFY(list0101.empty());
- VERIFY(list0101.size() == 0);
-}
-
-int
-main(int argc, char* argv[])
-{
- test01();
-
- return !test;
-}
-
-// vi:set sw=2 ts=2:
diff --git a/libstdc++-v3/testsuite/23_containers/list_ctor.cc b/libstdc++-v3/testsuite/23_containers/list_ctor.cc
deleted file mode 100644
index e358e7a9fe4..00000000000
--- a/libstdc++-v3/testsuite/23_containers/list_ctor.cc
+++ /dev/null
@@ -1,332 +0,0 @@
-// Copyright (C) 2001 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.2.1 list constructors, copy, and assignment
-
-#include <list>
-#include <testsuite_hooks.h>
-
-bool test = true;
-
-// A nontrivial type.
-template<typename T>
- struct A { };
-
-// Another nontrivial type
-struct B { };
-
-// A nontrivial type convertible from an int
-struct C {
- C(int i) : i_(i) { }
- bool operator==(const C& rhs) { return i_ == rhs.i_; }
- int i_;
-};
-
-// Default constructor, basic properties
-//
-// This test verifies the following.
-// 23.2.2.1 explicit list(const a& = Allocator())
-// 23.1 (7) iterator behaviour of empty containers
-// 23.2.2 iterator begin()
-// 23.2.2 iterator end()
-// 23.2.2 size_type size() const
-// 23.2.2 existence of required typedefs
-//
-void
-test01()
-{
- std::list< A<B> > list0101;
- VERIFY(list0101.begin() == list0101.end());
- VERIFY(list0101.size() == 0);
-
- // check type definitions -- will fail compile if missing
- typedef std::list< A<B> >::reference reference;
- typedef std::list< A<B> >::const_reference const_reference;
- typedef std::list< A<B> >::iterator iterator;
- typedef std::list< A<B> >::const_iterator const_iterator;
- typedef std::list< A<B> >::size_type size_type;
- typedef std::list< A<B> >::difference_type difference_type;
- typedef std::list< A<B> >::value_type value_type;
- typedef std::list< A<B> >::allocator_type allocator_type;
- typedef std::list< A<B> >::pointer pointer;
- typedef std::list< A<B> >::const_pointer const_pointer;
- typedef std::list< A<B> >::reverse_iterator reverse_iterator;
- typedef std::list< A<B> >::const_reverse_iterator const_reverse_iterator;
-
- // allocator checks?
-}
-
-// Fill constructor
-//
-// This test verifies the following.
-// 23.2.2.1 explicit list(size_type n, const T& v = T(), const a& = Allocator())
-// 23.2.2 const_iterator begin() const
-// 23.2.2 const_iterator end() const
-// 23.2.2 size_type size() const
-//
-void
-test02()
-{
- const int LIST_SIZE = 5;
- const int INIT_VALUE = 7;
- int count;
- std::list<int>::const_iterator i;
-
- // nontrivial value_type
- std::list< A<B> > list0201(LIST_SIZE);
-
- // default value
- std::list<int> list0202(LIST_SIZE);
- for (i = list0202.begin(), count = 0;
- i != list0202.end();
- ++i, ++count)
- VERIFY(*i == 0);
- VERIFY(count == LIST_SIZE);
- VERIFY(list0202.size() == LIST_SIZE);
-
- // explicit value
- std::list<int> list0203(LIST_SIZE, INIT_VALUE);
- for (i = list0203.begin(), count = 0;
- i != list0203.end();
- ++i, ++count)
- VERIFY(*i == INIT_VALUE);
- VERIFY(count == LIST_SIZE);
- VERIFY(list0203.size() == LIST_SIZE);
-}
-
-// Fill constructor disguised as a range constructor
-void
-test02D()
-{
- const int LIST_SIZE = 5;
- const int INIT_VALUE = 7;
- int count = 0;
- std::list<C> list0204(LIST_SIZE, INIT_VALUE);
- std::list<C>::iterator i = list0204.begin();
- for (; i != list0204.end(); ++i, ++count)
- VERIFY(*i == INIT_VALUE);
- VERIFY(count == LIST_SIZE);
- VERIFY(list0204.size() == LIST_SIZE);
-}
-
-// Range constructor
-//
-// This test verifies the following.
-// 23.2.2.1 template list(InputIterator f, InputIterator l, const Allocator& a = Allocator())
-// 23.2.2 const_iterator begin() const
-// 23.2.2 const_iterator end() const
-// 23.2.2 size_type size() const
-//
-void
-test03()
-{
- const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
- const int N = sizeof(A) / sizeof(int);
- int count;
- std::list<int>::const_iterator i;
-
- // construct from a dissimilar range
- std::list<int> list0301(A, A + N);
- for (i = list0301.begin(), count = 0;
- i != list0301.end();
- ++i, ++count)
- VERIFY(*i == A[count]);
- VERIFY(count == N);
- VERIFY(list0301.size() == N);
-
- // construct from a similar range
- std::list<int> list0302(list0301.begin(), list0301.end());
- for (i = list0302.begin(), count = 0;
- i != list0302.end();
- ++i, ++count)
- VERIFY(*i == A[count]);
- VERIFY(count == N);
- VERIFY(list0302.size() == N);
-}
-
-// Copy constructor
-//
-// This test verifies the following.
-// 23.2.2.1 list(const list& x)
-// 23.2.2 reverse_iterator rbegin()
-// 23.2.2 reverse_iterator rend()
-// 23.2.2 size_type size() const
-//
-void
-test04()
-{
- const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
- const int N = sizeof(A) / sizeof(int);
- int count;
- std::list<int>::reverse_iterator i;
- std::list<int> list0401(A, A + N);
-
- std::list<int> list0402(list0401);
- for (i = list0401.rbegin(), count = N - 1;
- i != list0401.rend();
- ++i, --count)
- VERIFY(*i == A[count]);
- VERIFY(count == -1);
- VERIFY(list0401.size() == N);
-}
-
-// Range assign
-//
-// This test verifies the following.
-// 23.2.2.1 void assign(InputIterator f, InputIterator l)
-// 23.2.2 const_iterator begin() const
-// 23.2.2 const_iterator end() const
-// 23.2.2 size_type size() const
-//
-void
-test05()
-{
- const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
- const int B[] = {101, 102, 103, 104, 105};
- const int N = sizeof(A) / sizeof(int);
- const int M = sizeof(B) / sizeof(int);
- int count;
- std::list<int>::const_iterator i;
-
- std::list<int> list0501;
-
- // make it bigger
- list0501.assign(A, A + N);
- for (i = list0501.begin(), count = 0;
- i != list0501.end();
- ++i, ++count)
- VERIFY(*i == A[count]);
- VERIFY(count == N);
- VERIFY(list0501.size() == N);
-
- // make it smaller
- list0501.assign(B, B + M);
- for (i = list0501.begin(), count = 0;
- i != list0501.end();
- ++i, ++count)
- VERIFY(*i == B[count]);
- VERIFY(count == M);
- VERIFY(list0501.size() == M);
-}
-
-// Fill assign
-//
-// This test verifies the following.
-// 23.2.2.1 void assign(size_type n, const T& v)
-// 23.2.2 const_iterator begin() const
-// 23.2.2 const_iterator end() const
-// 23.2.2 size_type size() const
-//
-void
-test06()
-{
- const int BIG_LIST_SIZE = 11;
- const int BIG_INIT_VALUE = 7;
- const int SMALL_LIST_SIZE = 5;
- const int SMALL_INIT_VALUE = 17;
- int count;
- std::list<int>::const_iterator i;
-
- std::list<int> list0601;
- VERIFY(list0601.size() == 0);
-
- // make it bigger
- list0601.assign(BIG_LIST_SIZE, BIG_INIT_VALUE);
- for (i = list0601.begin(), count = 0;
- i != list0601.end();
- ++i, ++count)
- VERIFY(*i == BIG_INIT_VALUE);
- VERIFY(count == BIG_LIST_SIZE);
- VERIFY(list0601.size() == BIG_LIST_SIZE);
-
- // make it shrink
- list0601.assign(SMALL_LIST_SIZE, SMALL_INIT_VALUE);
- for (i = list0601.begin(), count = 0;
- i != list0601.end();
- ++i, ++count)
- VERIFY(*i == SMALL_INIT_VALUE);
- VERIFY(count == SMALL_LIST_SIZE);
- VERIFY(list0601.size() == SMALL_LIST_SIZE);
-}
-
-// Fill Assignment disguised as a Range Assignment
-void
-test06D()
-{
- const int LIST_SIZE = 5;
- const int INIT_VALUE = 7;
- int count = 0;
- std::list<C> list0604;
- VERIFY(list0604.size() == 0);
-
- list0604.assign(LIST_SIZE, INIT_VALUE);
- std::list<C>::iterator i = list0604.begin();
- for (; i != list0604.end(); ++i, ++count)
- VERIFY(*i == INIT_VALUE);
- VERIFY(count == LIST_SIZE);
- VERIFY(list0604.size() == LIST_SIZE);
-}
-
-// Assignment operator
-//
-// This test verifies the following.
-// 23.2.2 operator=(const list& x)
-// 23.2.2 iterator begin()
-// 23.2.2 iterator end()
-// 23.2.2 size_type size() const
-// 23.2.2 bool operator==(const list& x, const list& y)
-//
-void
-test07()
-{
- const int A[] = {701, 702, 703, 704, 705};
- const int N = sizeof(A) / sizeof(int);
- int count;
- std::list<int>::iterator i;
-
- std::list<int> list0701(A, A + N);
- VERIFY(list0701.size() == N);
-
- std::list<int> list0702;
- VERIFY(list0702.size() == 0);
-
- list0702 = list0701;
- VERIFY(list0702.size() == N);
- for (i = list0702.begin(), count = 0;
- i != list0702.end();
- ++i, ++count)
- VERIFY(*i == A[count]);
- VERIFY(count == N);
- VERIFY(list0702 == list0701);
-}
-
-int main()
-{
- test01();
- test02();
- test02D();
- test03();
- test04();
- test05();
- test06();
- test06D();
- test07();
-
- return !test;
-}
-// vi:set sw=2 ts=2:
diff --git a/libstdc++-v3/testsuite/23_containers/list_modifiers.cc b/libstdc++-v3/testsuite/23_containers/list_modifiers.cc
deleted file mode 100644
index 8cdc9f0e254..00000000000
--- a/libstdc++-v3/testsuite/23_containers/list_modifiers.cc
+++ /dev/null
@@ -1,273 +0,0 @@
-// 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.2.3 list modifiers [lib.list.modifiers]
-
-#include <list>
-#include <testsuite_hooks.h>
-
-typedef __gnu_cxx_test::copy_tracker T;
-
-bool test = true;
-
-
-// This test verifies the following.
-//
-// 23.2.2.3 void push_front(const T& x)
-// 23.2.2.3 void push_back(const T& x)
-// 23.2.2.3 (1) iterator and reference non-invalidation
-// 23.2.2.3 (1) exception effects
-// 23.2.2.3 (2) complexity requirements
-//
-// 23.2.2.3 void pop_front()
-// 23.2.2.3 void pop_back()
-// 23.2.2.3 (3) iterator and reference non-invalidation
-// 23.2.2.3 (5) complexity requirements
-//
-// 23.2.2 const_iterator begin() const
-// 23.2.2 iterator end()
-// 23.2.2 const_reverse_iterator rbegin() const
-// 23.2.2 _reference front()
-// 23.2.2 const_reference front() const
-// 23.2.2 reference back()
-// 23.2.2 const_reference back() const
-//
-void
-test01()
-{
- std::list<T> list0101;
- std::list<T>::const_iterator i;
- std::list<T>::const_reverse_iterator j;
- std::list<T>::iterator k;
- T::reset();
-
- list0101.push_back(T(1)); // list should be [1]
- VERIFY(list0101.size() == 1);
- VERIFY(T::copyCount() == 1);
-
- k = list0101.end();
- --k;
- VERIFY(k->id() == 1);
- VERIFY(k->id() == list0101.front().id());
- VERIFY(k->id() == list0101.back().id());
-
- list0101.push_front(T(2)); // list should be [2 1]
- VERIFY(list0101.size() == 2);
- VERIFY(T::copyCount() == 2);
- VERIFY(k->id() == 1);
-
- list0101.push_back(T(3)); // list should be [2 1 3]
- VERIFY(list0101.size() == 3);
- VERIFY(T::copyCount() == 3);
- VERIFY(k->id() == 1);
-
- try
- {
- list0101.push_back(T(4, true));
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- VERIFY(list0101.size() == 3);
- VERIFY(T::copyCount() == 4);
- }
-
- i = list0101.begin();
- VERIFY(i->id() == 2);
- VERIFY(i->id() == list0101.front().id());
-
- j = list0101.rbegin();
- VERIFY(j->id() == 3);
- VERIFY(j->id() == list0101.back().id());
-
- ++i;
- VERIFY(i->id() == 1);
-
- ++j;
- VERIFY(j->id() == 1);
-
- T::reset();
-
- list0101.pop_back(); // list should be [2 1]
- VERIFY(list0101.size() == 2);
- VERIFY(T::dtorCount() == 1);
- VERIFY(i->id() == 1);
- VERIFY(k->id() == 1);
-
- list0101.pop_front(); // list should be [1]
- VERIFY(list0101.size() == 1);
- VERIFY(T::dtorCount() == 2);
- VERIFY(i->id() == 1);
- VERIFY(k->id() == 1);
-}
-
-// general single insert/erase + swap
-void
-test02()
-{
- std::list<T> list0201;
- T::reset();
-
- list0201.insert(list0201.begin(), T(1)); // list should be [1]
- VERIFY(list0201.size() == 1);
- VERIFY(T::copyCount() == 1);
-
- list0201.insert(list0201.end(), T(2)); // list should be [1 2]
- VERIFY(list0201.size() == 2);
- VERIFY(T::copyCount() == 2);
-
- std::list<T>::iterator i = list0201.begin();
- std::list<T>::const_iterator j = i;
- VERIFY(i->id() == 1); ++i;
- VERIFY(i->id() == 2);
-
- list0201.insert(i, T(3)); // list should be [1 3 2]
- VERIFY(list0201.size() == 3);
- VERIFY(T::copyCount() == 3);
-
- std::list<T>::const_iterator k = i;
- VERIFY(i->id() == 2); --i;
- VERIFY(i->id() == 3); --i;
- VERIFY(i->id() == 1);
- VERIFY(j->id() == 1);
-
- ++i; // will point to '3'
- T::reset();
- list0201.erase(i); // should be [1 2]
- VERIFY(list0201.size() == 2);
- VERIFY(T::dtorCount() == 1);
- VERIFY(k->id() == 2);
- VERIFY(j->id() == 1);
-
- std::list<T> list0202;
- T::reset();
- VERIFY(list0202.size() == 0);
- VERIFY(T::copyCount() == 0);
- VERIFY(T::dtorCount() == 0);
-
- // member swap
- list0202.swap(list0201);
- VERIFY(list0201.size() == 0);
- VERIFY(list0202.size() == 2);
- VERIFY(T::copyCount() == 0);
- VERIFY(T::dtorCount() == 0);
-
- // specialized swap
- swap(list0201, list0202);
- VERIFY(list0201.size() == 2);
- VERIFY(list0202.size() == 0);
- VERIFY(T::copyCount() == 0);
- VERIFY(T::dtorCount() == 0);
-}
-
-// range and fill insert/erase + clear
-// missing: o fill insert disguised as a range insert in all its variants
-// o exception effects
-void
-test03()
-{
- std::list<T> list0301;
- T::reset();
-
- // fill insert at beginning of list / empty list
- list0301.insert(list0301.begin(), 3, T(11)); // should be [11 11 11]
- VERIFY(list0301.size() == 3);
- VERIFY(T::copyCount() == 3);
-
- // save iterators to verify post-insert validity
- std::list<T>::iterator b = list0301.begin();
- std::list<T>::iterator m = list0301.end(); --m;
- std::list<T>::iterator e = list0301.end();
-
- // fill insert at end of list
- T::reset();
- list0301.insert(list0301.end(), 3, T(13)); // should be [11 11 11 13 13 13]
- VERIFY(list0301.size() == 6);
- VERIFY(T::copyCount() == 3);
- VERIFY(b == list0301.begin() && b->id() == 11);
- VERIFY(e == list0301.end());
- VERIFY(m->id() == 11);
-
- // fill insert in the middle of list
- ++m;
- T::reset();
- list0301.insert(m, 3, T(12)); // should be [11 11 11 12 12 12 13 13 13]
- VERIFY(list0301.size() == 9);
- VERIFY(T::copyCount() == 3);
- VERIFY(b == list0301.begin() && b->id() == 11);
- VERIFY(e == list0301.end());
- VERIFY(m->id() == 13);
-
- // single erase
- T::reset();
- m = list0301.erase(m); // should be [11 11 11 12 12 12 13 13]
- VERIFY(list0301.size() == 8);
- VERIFY(T::dtorCount() == 1);
- VERIFY(b == list0301.begin() && b->id() == 11);
- VERIFY(e == list0301.end());
- VERIFY(m->id() == 13);
-
- // range erase
- T::reset();
- m = list0301.erase(list0301.begin(), m); // should be [13 13]
- VERIFY(list0301.size() == 2);
- VERIFY(T::dtorCount() == 6);
- VERIFY(m->id() == 13);
-
- // range fill at beginning
- const int A[] = {321, 322, 333};
- const int N = sizeof(A) / sizeof(int);
- T::reset();
- b = list0301.begin();
- list0301.insert(b, A, A + N); // should be [321 322 333 13 13]
- VERIFY(list0301.size() == 5);
- VERIFY(T::copyCount() == 3);
- VERIFY(m->id() == 13);
-
- // range fill at end
- T::reset();
- list0301.insert(e, A, A + N); // should be [321 322 333 13 13 321 322 333]
- VERIFY(list0301.size() == 8);
- VERIFY(T::copyCount() == 3);
- VERIFY(e == list0301.end());
- VERIFY(m->id() == 13);
-
- // range fill in middle
- T::reset();
- list0301.insert(m, A, A + N);
- VERIFY(list0301.size() == 11);
- VERIFY(T::copyCount() == 3);
- VERIFY(e == list0301.end());
- VERIFY(m->id() == 13);
-
- T::reset();
- list0301.clear();
- VERIFY(list0301.size() == 0);
- VERIFY(T::dtorCount() == 11);
- VERIFY(e == list0301.end());
-}
-
-int main()
-{
- test01();
- test02();
- test03();
-
- return !test;
-}
-// vi:set sw=2 ts=2:
diff --git a/libstdc++-v3/testsuite/23_containers/list_operators.cc b/libstdc++-v3/testsuite/23_containers/list_operators.cc
deleted file mode 100644
index 69a59943e1e..00000000000
--- a/libstdc++-v3/testsuite/23_containers/list_operators.cc
+++ /dev/null
@@ -1,211 +0,0 @@
-// Copyright (C) 2001 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.2.4 list operations [lib.list.ops]
-
-#include <list>
-#include <testsuite_hooks.h>
-
-bool test = true;
-
-// splice(p, x) + remove + reverse
-void
-test01()
-{
- const int K = 417;
- const int A[] = {1, 2, 3, 4, 5};
- const int B[] = {K, K, K, K, K};
- const int N = sizeof(A) / sizeof(int);
- const int M = sizeof(B) / sizeof(int);
-
- std::list<int> list0101(A, A + N);
- std::list<int> list0102(B, B + M);
- std::list<int>::iterator p = list0101.begin();
-
- VERIFY(list0101.size() == N);
- VERIFY(list0102.size() == M);
-
- ++p;
- list0101.splice(p, list0102); // [1 K K K K K 2 3 4 5]
- VERIFY(list0101.size() == N + M);
- VERIFY(list0102.size() == 0);
-
- // remove range from middle
- list0101.remove(K);
- VERIFY(list0101.size() == N);
-
- // remove first element
- list0101.remove(1);
- VERIFY(list0101.size() == N - 1);
-
- // remove last element
- list0101.remove(5);
- VERIFY(list0101.size() == N - 2);
-
- // reverse
- list0101.reverse();
- p = list0101.begin();
- VERIFY(*p == 4); ++p;
- VERIFY(*p == 3); ++p;
- VERIFY(*p == 2); ++p;
- VERIFY(p == list0101.end());
-}
-
-// splice(p, x, i) + remove_if + operator==
-void
-test02()
-{
- const int A[] = {1, 2, 3, 4, 5};
- const int B[] = {2, 1, 3, 4, 5};
- const int C[] = {1, 3, 4, 5, 2};
- const int N = sizeof(A) / sizeof(int);
- std::list<int> list0201(A, A + N);
- std::list<int> list0202(A, A + N);
- std::list<int> list0203(B, B + N);
- std::list<int> list0204(C, C + N);
- std::list<int>::iterator i = list0201.begin();
-
- // result should be unchanged
- list0201.splice(list0201.begin(), list0201, i);
- VERIFY(list0201 == list0202);
-
- // result should be [2 1 3 4 5]
- ++i;
- list0201.splice(list0201.begin(), list0201, i);
- VERIFY(list0201 != list0202);
- VERIFY(list0201 == list0203);
-
- // result should be [1 3 4 5 2]
- list0201.splice(list0201.end(), list0201, i);
- VERIFY(list0201 == list0204);
-}
-
-// splice(p, x, f, l) + sort + merge + unique
-void
-test03()
-{
- const int A[] = {103, 203, 603, 303, 403, 503};
- const int B[] = {417, 417, 417, 417, 417};
- const int E[] = {103, 417, 417, 203, 603, 303, 403, 503};
- const int F[] = {103, 203, 303, 403, 417, 417, 503, 603};
- const int C[] = {103, 203, 303, 403, 417, 417, 417, 417, 417, 503, 603};
- const int D[] = {103, 203, 303, 403, 417, 503, 603};
- const int N = sizeof(A) / sizeof(int);
- const int M = sizeof(B) / sizeof(int);
- const int P = sizeof(C) / sizeof(int);
- const int Q = sizeof(D) / sizeof(int);
- const int R = sizeof(E) / sizeof(int);
-
- std::list<int> list0301(A, A + N);
- std::list<int> list0302(B, B + M);
- std::list<int> list0303(C, C + P);
- std::list<int> list0304(D, D + Q);
- std::list<int> list0305(E, E + R);
- std::list<int> list0306(F, F + R);
- std::list<int>::iterator p = list0301.begin();
- std::list<int>::iterator q = list0302.begin();
-
- ++p; ++q; ++q;
- list0301.splice(p, list0302, list0302.begin(), q);
- VERIFY(list0301 == list0305);
- VERIFY(list0301.size() == N + 2);
- VERIFY(list0302.size() == M - 2);
-
- list0301.sort();
- VERIFY(list0301 == list0306);
-
- list0301.merge(list0302);
- VERIFY(list0301.size() == N + M);
- VERIFY(list0302.size() == 0);
- VERIFY(list0301 == list0303);
-
- list0301.unique();
- VERIFY(list0301 == list0304);
-}
-
-// A comparison predicate to order by rightmost digit. Tracks call counts for
-// performance checks.
-struct CompLastLt
-{
- bool operator()(const int x, const int y) { ++itsCount; return x % 10 < y % 10; }
- static int count() { return itsCount; }
- static void reset() { itsCount = 0; }
- static int itsCount;
-};
-
-int CompLastLt::itsCount;
-
-struct CompLastEq
-{
- bool operator()(const int x, const int y) { ++itsCount; return x % 10 == y % 10; }
- static int count() { return itsCount; }
- static void reset() { itsCount = 0; }
- static int itsCount;
-};
-
-int CompLastEq::itsCount;
-
-// sort(pred) + merge(pred) + unique(pred)
-// also checks performance requirements
-void
-test04()
-{
- const int A[] = {1, 2, 3, 4, 5, 6};
- const int B[] = {12, 15, 13, 14, 11};
- const int C[] = {11, 12, 13, 14, 15};
- const int D[] = {1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6};
- const int N = sizeof(A) / sizeof(int);
- const int M = sizeof(B) / sizeof(int);
- const int Q = sizeof(D) / sizeof(int);
-
- std::list<int> list0401(A, A + N);
- std::list<int> list0402(B, B + M);
- std::list<int> list0403(C, C + M);
- std::list<int> list0404(D, D + Q);
- std::list<int> list0405(A, A + N);
-
- // sort B
- CompLastLt lt;
-
- CompLastLt::reset();
- list0402.sort(lt);
- VERIFY(list0402 == list0403);
-
- CompLastLt::reset();
- list0401.merge(list0402, lt);
- VERIFY(list0401 == list0404);
- VERIFY(lt.count() <= (N + M - 1));
-
- CompLastEq eq;
-
- CompLastEq::reset();
- list0401.unique(eq);
- VERIFY(list0401 == list0405);
- VERIFY(eq.count() == (N + M - 1));
-}
-
-main(int argc, char* argv[])
-{
- test01();
- test02();
- test03();
- test04();
-
- return !test;
-}
-// vi:set sw=2 ts=2:
diff --git a/libstdc++-v3/testsuite/23_containers/map_insert.cc b/libstdc++-v3/testsuite/23_containers/map_insert.cc
deleted file mode 100644
index 67c838f993a..00000000000
--- a/libstdc++-v3/testsuite/23_containers/map_insert.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// 2001-08-23 pme & Sylvain.Pion@sophia.inria.fr
-
-// 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.
-
-// 23.3.1.2, table 69 -- map::insert(p,t)
-
-#include <map>
-#include <testsuite_hooks.h>
-
-// { dg-do run }
-
-// libstdc++/3349 and
-// http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01375.html
-void test01()
-{
- bool test = true;
- typedef std::map<int, int> Map;
- Map M;
- Map::iterator hint;
-
- hint = M.insert(Map::value_type(7, 0)).first;
-
- M.insert(hint, Map::value_type(8, 1));
- M.insert(M.begin(), Map::value_type(9, 2));
-
-#if 0
- // The tree's __rb_verify() member must be exposed in map<> before this
- // will even compile. It's good test to see that "missing" entries are
- // in fact present in the {map,tree}, but in the wrong place.
- if (0)
- {
- Map::iterator i = M.begin();
- while (i != M.end()) {
- std::cerr << '(' << i->first << ',' << i->second << ")\n";
- ++i;
- }
- std::cerr << "tree internal verify: "
- << std::boolalpha << M.__rb_verify() << "\n";
- }
-#endif
-
- VERIFY ( M.find(7) != M.end() );
- VERIFY ( M.find(8) != M.end() );
- VERIFY ( M.find(9) != M.end() );
-}
-
-
-int main()
-{
- test01();
-
- return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/23_containers/map_operators_neg.cc b/libstdc++-v3/testsuite/23_containers/map_operators_neg.cc
deleted file mode 100644
index 75b604c80c2..00000000000
--- a/libstdc++-v3/testsuite/23_containers/map_operators_neg.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// 2000-09-07 bgarcia@laurelnetworks.com
-
-// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.3.4 template class multiset negative tests
-
-#include <map>
-#include <string>
-
-// { dg-do compile }
-
-// libstdc++/86: map & set iterator comparisons are not type-safe
-void test01()
-{
- bool test = true;
- std::map<unsigned int, int> mapByIndex;
- std::map<std::string, unsigned> mapByName;
-
- mapByIndex.insert(std::pair<unsigned, int>(0, 1));
- mapByIndex.insert(std::pair<unsigned, int>(6, 5));
-
- std::map<unsigned, int>::iterator itr(mapByIndex.begin());
-
- // NB: notice, it's not mapByIndex!!
- test &= itr != mapByName.end(); // { dg-error "no" }
- test &= itr == mapByName.end(); // { dg-error "no" }
-}
-
-int main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/multiset.cc b/libstdc++-v3/testsuite/23_containers/multiset.cc
deleted file mode 100644
index b82612f5c7f..00000000000
--- a/libstdc++-v3/testsuite/23_containers/multiset.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// 1999-06-24 bkoz
-
-// Copyright (C) 1999 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.3.4 template class multiset
-
-#include <iostream>
-#include <iterator>
-#include <set>
-#include <algorithm>
-
-namespace std
-{
- std::ostream&
- operator<<(std::ostream& os, std::pair<int, int> const& p)
- { return os << p.first << ' ' << p.second; }
-}
-
-bool
-operator<(std::pair<int, int> const& lhs, std::pair<int, int> const& rhs)
-{ return lhs.first < rhs.first; }
-
-int main ()
-{
- typedef std::multiset<std::pair<int, int> >::iterator iterator;
- std::pair<int, int> p(69, 0);
- std::multiset<std::pair<int, int> > s;
-
- for (p.second = 0; p.second < 5; ++p.second)
- s.insert(p);
- for (iterator it = s.begin(); it != s.end(); ++it)
- if (it->second < 5)
- {
- s.insert(it, p);
- ++p.second;
- }
-
- // XXX need to use debug-assert here and get this working with an
- // ostrinsrtream, that way we can just check the strings for
- // equivalance.
- std::copy(s.begin(), s.end(),
- std::ostream_iterator<std::pair<int, int> >(std::cout, "\n"));
-
- return 0;
-}
-
-/* output:
-69 5
-69 0
-69 6
-69 1
-69 7
-69 2
-69 8
-69 3
-69 9
-69 4
-*/
diff --git a/libstdc++-v3/testsuite/23_containers/vector_capacity.cc b/libstdc++-v3/testsuite/23_containers/vector_capacity.cc
deleted file mode 100644
index b6e347de309..00000000000
--- a/libstdc++-v3/testsuite/23_containers/vector_capacity.cc
+++ /dev/null
@@ -1,178 +0,0 @@
-// 1999-05-07
-// bkoz
-
-// Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.4.2 vector capacity
-
-#include <vector>
-#include <stdexcept>
-#include <testsuite_allocator.h>
-#include <testsuite_hooks.h>
-
-using __gnu_cxx_test::copy_tracker;
-using __gnu_cxx_test::allocation_tracker;
-using __gnu_cxx_test::tracker_alloc;
-using __gnu_cxx_test::copy_constructor;
-using __gnu_cxx_test::assignment_operator;
-using __gnu_cxx_test::destructor;
-
-template<typename T>
- struct A { };
-
-struct B { };
-
-void test01()
-{
- // non POD types
- bool test = true;
- std::vector< A<B> > vec01;
- typedef std::vector< A<B> >::size_type size_type;
-
- size_type sz01 = vec01.capacity();
- vec01.reserve(100);
- size_type sz02 = vec01.capacity();
- VERIFY( sz02 >= sz01 );
-
- sz01 = vec01.size() + 5;
- vec01.resize(sz01);
- sz02 = vec01.size();
- VERIFY( sz01 == sz02 );
-
- sz01 = vec01.size() - 5;
- vec01.resize(sz01);
- sz02 = vec01.size();
- VERIFY( sz01 == sz02 );
-}
-
-// libstdc++/8230
-void test02()
-{
- bool test = true;
- {
- std::vector<int> array;
- const std::size_t size = array.max_size();
- try
- {
- array.reserve(size);
- }
- catch (const std::length_error& error)
- {
- test &= false;
- }
- catch (const std::bad_alloc& error)
- {
- test &= true;
- }
- catch (...)
- {
- test &= false;
- }
- VERIFY( test );
- }
-
- {
- std::vector<int> array;
- const std::size_t size = array.max_size() + 1;
- try
- {
- array.reserve(size);
- }
- catch (const std::length_error& error)
- {
- test &= true;
- }
- catch (...)
- {
- test &= false;
- }
- VERIFY( test );
- }
-}
-
-// Verifies basic functionality of reserve() with forced reallocation.
-void
-test_reserve()
-{
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(3);
- const X::size_type old_size = a.size();
- const X::size_type old_capacity = a.capacity();
- const X::size_type new_capacity = old_capacity + 10;
- T::reset();
-
- a.reserve(new_capacity);
-
- // [23.2.4.1 (2)]
- VERIFY(new_capacity <= a.capacity());
- // [23.2.4.1 (3)]
- VERIFY(old_size == a.size());
- VERIFY(copy_constructor::count() <= old_size);
- VERIFY(destructor::count() <= old_size);
- }
- // check for memory leaks
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-}
-
-// Verifies that reserve() with reallocation offers the strong
-// exception guarantee.
-void
-test_reserve_exception_guarantee()
-{
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(7);
- const X::size_type old_size = a.size();
- const X::size_type old_capacity = a.capacity();
- const X::size_type new_capacity = old_capacity + 10;
- T::reset();
- copy_constructor::throw_on(3);
-
- try
- {
- a.reserve(new_capacity);
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
-
- VERIFY(old_capacity == a.capacity());
- VERIFY(copy_constructor::count() == destructor::count()+1);
- }
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-}
-
-int main()
-{
- test01();
- test02();
- test_reserve();
- test_reserve_exception_guarantee();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc b/libstdc++-v3/testsuite/23_containers/vector_ctor.cc
deleted file mode 100644
index 8b93207606e..00000000000
--- a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc
+++ /dev/null
@@ -1,664 +0,0 @@
-// 1999-06-29 bkoz
-
-// Copyright (C) 1999-2001, 2002, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.4.1 vector constructors, copy, and assignment
-
-#include <vector>
-#include <string>
-#include <testsuite_allocator.h>
-#include <testsuite_hooks.h>
-
-using __gnu_cxx_test::copy_tracker;
-using __gnu_cxx_test::allocation_tracker;
-using __gnu_cxx_test::tracker_alloc;
-using __gnu_cxx_test::copy_constructor;
-using __gnu_cxx_test::assignment_operator;
-
-template<typename T>
- struct A { };
-
-struct B { };
-
-void test01()
-{
- // 1
- bool test = true;
- std::vector< A<B> > vec01;
- std::vector< A<B> > vec02(5);
- typedef std::vector< A<B> >::size_type size_type;
-
- vec01 = vec02;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-}
-
-// 2
-template class std::vector<double>;
-template class std::vector< A<B> >;
-
-
-// libstdc++/102
-void test02()
-{
- std::vector<int> v1;
- std::vector<int> v2 (v1);
-}
-
-// test range constructors and range-fill constructor
-void
-test03()
-{
- bool test = true;
- const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
- const int B[] = {7, 7, 7, 7, 7};
- const int N = sizeof(A) / sizeof(int);
- const int M = sizeof(B) / sizeof(int);
-
- std::vector<int> v3(A, A + N);
- VERIFY(std::equal(v3.begin(), v3.end(), A));
-
- std::vector<int> v4(v3.begin(), v3.end());
- VERIFY(std::equal(v4.begin(), v4.end(), A));
-
- std::vector<int> v5(M, 7);
- VERIFY(std::equal(v5.begin(), v5.end(), B));
- VERIFY(std::equal(B, B + M, v5.begin()));
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-}
-
-// libstdc++/6513
-void test04()
-{
- bool test = true;
- const char* c_strings[5] = { "1", "2", "3", "4", "5" };
- std::vector<std::string> strings(c_strings, c_strings + 5);
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-}
-
-
-// @fn test_default_ctor_exception_gurantee This test verifies that if
-// one of the vector's contained objects throws an exception from its
-// constructor while the vector is being constructed and filled with
-// default values, all memory is returned to the allocator whence it
-// came.
-void
-test_default_ctor_exception_gurantee()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- copy_tracker::reset();
- copy_constructor::throw_on(3);
- allocation_tracker::resetCounts();
-
- // run test
- try
- {
- X a(7);
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
-
- // assert postconditions
- VERIFY(("memory leak detected:",
- allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal()));
-
- // teardown
-}
-
-// @fn test_copy_ctor_exception_gurantee This test verifies that if
-// one of the vector's contained objects throws an exception from its
-// constructor while the vector is being copy constructed, all memory
-// is returned to the allocator whence it came.
-void
-test_copy_ctor_exception_gurantee()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(7);
- copy_tracker::reset();
- copy_constructor::throw_on(3);
-
- // run test
- try
- {
- X u(a);
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
- }
-
- // assert postconditions
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-// operator=()
-//
-// case 1: lhs.size() > rhs.size()
-// case 2: lhs.size() < rhs.size() < lhs.capacity()
-// case 3: lhs.capacity() < rhs.size()
-//
-void
-test_assignment_operator_1()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- X r(9);
- X a(r.size() - 2);
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-
- // preconditions
- VERIFY(r.size() > a.size());
-
- // run test
- r = a;
-
- // assert postconditions
- VERIFY(r == a);
- VERIFY(allocation_tracker::allocationTotal() == 0);
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_assignment_operator_2()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- X r(1);
- r.reserve(17);
- X a(r.size() + 7);
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-
- // preconditions
- VERIFY(r.size() < a.size());
- VERIFY(a.size() < r.capacity());
-
- // run test
- r = a;
-
- // assert postconditions
- VERIFY(r == a);
- VERIFY(allocation_tracker::allocationTotal() == 0);
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_assignment_operator_3()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X r(1);
- X a(r.capacity() + 7);
- copy_tracker::reset();
-
- // preconditions
- VERIFY(r.capacity() < a.size());
-
- // run test
- r = a;
-
- // assert postconditions
- VERIFY(r == a);
- }
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_assignment_operator_3_exception_guarantee()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X r(1);
- X a(r.capacity() + 7);
- copy_tracker::reset();
- copy_constructor::throw_on(3);
-
- // preconditions
- VERIFY(r.capacity() < a.size());
-
- // run test
- try
- {
- r = a;
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
- }
-
- // assert postconditions
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-// fill assign()
-//
-// case 1: [23.2.4.1 (3)] n <= size()
-// case 2: [23.2.4.1 (3)] size() < n <= capacity()
-// case 3: [23.2.4.1 (3)] n > capacity()
-// case 4: [23.2.4.1 (3)] n > capacity(), exception guarantees
-// case 5: [23.1.1 (9)] fill assign disguised as a range assign
-//
-void
-test_fill_assign_1()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- X a(7);
- X::size_type old_size = a.size();
- X::size_type new_size = old_size - 2;
- const T t;
-
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-
- // run test
- a.assign(new_size, t);
-
- // assert postconditions
- VERIFY(a.size() == new_size);
- VERIFY(allocation_tracker::allocationTotal() == 0);
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_fill_assign_2()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- X a(7);
- a.reserve(11);
- X::size_type old_size = a.size();
- X::size_type old_capacity = a.capacity();
- X::size_type new_size = old_size + 2;
- const T t;
-
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-
- // assert preconditions
- VERIFY(old_size < new_size);
- VERIFY(new_size <= old_capacity);
-
- // run test
- a.assign(new_size, t);
-
- // assert postconditions
- VERIFY(a.size() == new_size);
- VERIFY(allocation_tracker::allocationTotal() == 0);
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_fill_assign_3()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(7);
- X::size_type old_size = a.size();
- X::size_type old_capacity = a.capacity();
- X::size_type new_size = old_capacity + 4;
- const T t;
-
- copy_tracker::reset();
-
- // assert preconditions
- VERIFY(new_size > old_capacity);
-
- // run test
- a.assign(new_size, t);
-
- // assert postconditions
- VERIFY(a.size() == new_size);
- }
-
- VERIFY(allocation_tracker::allocationTotal() > 0);
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_fill_assign_3_exception_guarantee()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(7);
- X::size_type old_size = a.size();
- X::size_type old_capacity = a.capacity();
- X::size_type new_size = old_capacity + 4;
- const T t;
-
- copy_tracker::reset();
- copy_constructor::throw_on(3);
-
- // assert preconditions
- VERIFY(new_size > old_capacity);
-
- // run test
- try
- {
- a.assign(new_size, t);
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
-
- // assert postconditions
- VERIFY(a.size() == old_size);
- VERIFY(a.capacity() == old_capacity);
- }
-
- VERIFY(allocation_tracker::allocationTotal() > 0);
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_fill_assign_4()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- X a(7);
- X::size_type old_size = a.size();
- X::size_type new_size = old_size - 2;
- X::size_type new_value = 117;
-
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-
- // run test
- a.assign(new_size, new_value);
-
- // assert postconditions
- VERIFY(a.size() == new_size);
- VERIFY(allocation_tracker::allocationTotal() == 0);
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-// range assign()
-//
-// case 1: [23.2.4.1 (2)] input iterator
-// case 2: [23.2.4.1 (2)] forward iterator, distance(first, last) <= size()
-// case 3: [23.2.4.1 (2)]
-// forward iterator, size() < distance(first, last) <= capacity()
-// case 4: [23.2.4.1 (2)] forward iterator, distance(first, last) > capacity()
-// case 5: [23.2.4.1 (2)]
-// forward iterator, distance(first, last) > capacity(),
-// exception guarantees
-void
-test_range_assign_1()
-{
- // @TODO
-}
-
-void
-test_range_assign_2()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- X a(7);
- X b(3);
- X::size_type old_size = a.size();
-
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-
- // assert preconditions
- VERIFY(b.size() < a.capacity());
-
- // run test
- a.assign(b.begin(), b.end());
-
- // assert postconditions
- VERIFY(a.size() == b.size());
- VERIFY(a == b);
- VERIFY(allocation_tracker::allocationTotal() == 0);
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_range_assign_3()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- X a(7);
- a.reserve(a.size() + 7);
- X b(a.size() + 3);
- X::size_type old_size = a.size();
-
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-
- // assert preconditions
- VERIFY(a.size() < b.size());
- VERIFY(b.size() < a.capacity());
-
- // run test
- a.assign(b.begin(), b.end());
-
- // assert postconditions
- VERIFY(a.size() == b.size());
- VERIFY(a == b);
- VERIFY(allocation_tracker::allocationTotal() == 0);
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_range_assign_4()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(7);
- X b(a.capacity() + 7);
- X::size_type old_size = a.size();
-
- copy_tracker::reset();
-
- // assert preconditions
- VERIFY(b.size() > a.capacity());
-
- // run test
- a.assign(b.begin(), b.end());
-
- // assert postconditions
- VERIFY(a.size() == b.size());
- VERIFY(a == b);
- }
- VERIFY(allocation_tracker::allocationTotal() > 0);
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-void
-test_range_assign_4_exception_guarantee()
-{
- // setup
- bool test = true;
- typedef copy_tracker T;
- typedef std::vector<T, tracker_alloc<T> > X;
-
- allocation_tracker::resetCounts();
- {
- X a(7);
- X b(a.capacity() + 7);
- X::size_type old_size = a.size();
-
- copy_tracker::reset();
- copy_constructor::throw_on(3);
-
- // assert preconditions
- VERIFY(b.size() > a.capacity());
-
- // run test
- try
- {
- a.assign(b.begin(), b.end());
- VERIFY(("no exception thrown", false));
- }
- catch (...)
- {
- }
- }
-
- // assert postconditions
- VERIFY(allocation_tracker::allocationTotal() > 0);
- VERIFY(allocation_tracker::allocationTotal() == allocation_tracker::deallocationTotal());
-
- // teardown
- copy_tracker::reset();
- allocation_tracker::resetCounts();
-}
-
-
-int main()
-{
- test01();
- test02();
- test03();
- test04();
- test_default_ctor_exception_gurantee();
- test_copy_ctor_exception_gurantee();
- test_assignment_operator_1();
- test_assignment_operator_2();
- test_assignment_operator_3();
- test_assignment_operator_3_exception_guarantee();
- test_fill_assign_1();
- test_fill_assign_2();
- test_fill_assign_3();
- test_fill_assign_3_exception_guarantee();
- test_fill_assign_4();
- test_range_assign_1();
- test_range_assign_2();
- test_range_assign_3();
- test_range_assign_4();
- test_range_assign_4_exception_guarantee();
-
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc b/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc
deleted file mode 100644
index 1f0b338c3b7..00000000000
--- a/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// 1999-11-09 bkoz
-
-// Copyright (C) 1999, 2001 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 23.2.4.3 vector modifiers
-
-#include <vector>
-#include "testsuite_hooks.h"
-
-bool test = true;
-
-template<typename T>
- struct A { };
-
-struct B { };
-
-// vector::insert(iterator, inputiterator first, inputiterator last)
-void
-test01()
-{
- // POD types
- typedef std::vector<int> vec_POD;
- vec_POD vec01;
- int i01 = 5;
- int* pi01 = &i01;
- vec01.insert(vec01.begin(), pi01, pi01 + 1);
-
- // non POD types
- typedef std::vector< A<B> > vec_nonPOD;
- vec_nonPOD vec02;
- A<B> np01;
- A<B>* pnp01 = &np01;
- vec02.insert(vec02.begin(), pnp01, pnp01 + 1);
-}
-
-// test the assign() function
-void
-test03()
-{
- const int K = 417;
- const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
- const int B[] = {K, K, K, K, K};
- const int N = sizeof(A) / sizeof(int);
- const int M = sizeof(B) / sizeof(int);
- bool test = true;
-
- // assign from pointer range
- std::vector<int> v3;
- v3.assign(A, A + N);
- VERIFY(std::equal(v3.begin(), v3.end(), A));
- VERIFY(v3.size() == N);
-
- // assign from iterator range
- std::vector<int> v4;
- v4.assign(v3.begin(), v3.end());
- VERIFY(std::equal(v4.begin(), v4.end(), A));
- VERIFY(std::equal(A, A + N, v4.begin()));
-
- // assign from initializer range with resize
- v4.assign(M, K);
- VERIFY(std::equal(v4.begin(), v4.end(), B));
- VERIFY(std::equal(B, B + M, v4.begin()));
- VERIFY((v4.size() == M) && (M != N));
-}
-
-int main()
-{
- test01();
- test03();
-
- return !test;
-}
diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
index 72758eed308..2f97f8973cf 100644
--- a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
+++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
@@ -1,6 +1,6 @@
// 1999-06-28 bkoz
-// Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+// 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
@@ -133,11 +133,6 @@ bool test02(void)
c = *++istrb_it28;
VERIFY( c == slit01[++i] );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/24_iterators/iterator.cc b/libstdc++-v3/testsuite/24_iterators/iterator.cc
index 7acd1ec26e1..db8b63369a5 100644
--- a/libstdc++-v3/testsuite/24_iterators/iterator.cc
+++ b/libstdc++-v3/testsuite/24_iterators/iterator.cc
@@ -2,7 +2,7 @@
// 24.3.1 Iterator traits
// (basic_string and vector implementations)
//
-// Copyright (C) 1999 Philip Martin
+// Copyright (C) 1999, 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 of the License, or
@@ -603,9 +603,6 @@ main(int argc, char **argv)
failures += test6642();
-#ifdef DEBUG_ASSERT
- assert (failures == 0);
-#endif
-
+ VERIFY(failures == 0);
return 0;
}
diff --git a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
index 23ddee57c9f..6fbfe6d5144 100644
--- a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
+++ b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
@@ -1,6 +1,6 @@
// 2001-04-30 Benjamin Kosnik <bkoz@redhat.com>
-// 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
@@ -106,11 +106,6 @@ bool test02(void)
tmp = ostrs00.str();
VERIFY ( tmp != str01 );
VERIFY ( tmp != str02 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc
index f6bf336597c..a3a23050165 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// { dg-do compile }
+// Copyright (C) 2000, 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
@@ -29,17 +30,3 @@ void bar(foo* a, foo* b, foo& x)
{
foo* c = std::lower_bound(a, b, x);
}
-
-void test01()
-{
- bool test = true;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-}
-
-int main()
-{
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc b/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc
index d304aa47b38..f285fb70fec 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc
@@ -1,7 +1,7 @@
// 2000-02-10
// Petter Urkedal <petter@matfys.lth.se>
-// Copyright (C) 2000 Free Software Foundation
+// Copyright (C) 2000, 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
@@ -47,10 +47,6 @@ test_good(std::string str, R x, R y)
VERIFY( flteq(z.real(), x) );
VERIFY( flteq(z.imag(), y) );
VERIFY( ch == '#' );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return 0;
}
@@ -58,12 +54,11 @@ template<typename R>
int
test_fail(std::string str)
{
+ bool test = true;
std::complex<R> z;
std::istringstream iss(str);
iss >> z;
-#ifdef DEBUG_ASSERT
- assert(iss.fail() && !iss.bad());
-#endif
+ VERIFY( iss.fail() && !iss.bad() );
return 0;
}
@@ -113,8 +108,8 @@ void test02()
bool test = true;
// Construct locale with specialized facets.
- typedef gnu_sstream::__numput_type numput_type;
- typedef gnu_sstream::__numget_type numget_type;
+ typedef gnu_sstream::__num_put_type numput_type;
+ typedef gnu_sstream::__num_get_type numget_type;
std::locale loc_c = std::locale::classic();
std::locale loc_1(loc_c, new numput_type);
std::locale loc_2(loc_1, new numget_type);
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc
index af92af0ff11..5005c17f4b4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc
@@ -33,7 +33,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_filebuf<type_t, char_traits<type_t> >;
template class basic_filebuf<pod_char, char_traits<pod_char> >;
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 de6e1339a0e..434f1e2312d 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
@@ -42,7 +42,7 @@ void test02()
VERIFY( p != bad);
// 1 "if file is not positioned at its beginning" fails...
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc
index 5a43a2a4a2f..efe8cbbeea0 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc
@@ -34,10 +34,10 @@ void test07()
std::filebuf ob;
VERIFY( ob.getloc() == loc );
- locale::global(__gnu_cxx_test::try_named_locale("en_US"));
+ locale::global(__gnu_test::try_named_locale("en_US"));
VERIFY( ob.getloc() == loc );
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc_de );
VERIFY( ret == loc );
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 4acff8123e7..7fe0d4cc65b 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
@@ -42,7 +42,7 @@ void test02()
VERIFY( p != bad);
// 1 "if file is not positioned at its beginning" fails...
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc
index 1b083fd023a..8a76a997c9a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc
@@ -34,10 +34,10 @@ void test07()
std::wfilebuf ob;
VERIFY( ob.getloc() == loc );
- locale::global(__gnu_cxx_test::try_named_locale("en_US"));
+ locale::global(__gnu_test::try_named_locale("en_US"));
VERIFY( ob.getloc() == loc );
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc_de );
VERIFY( ret == loc );
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 185fb1ed658..fc96a047fdf 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
@@ -28,7 +28,7 @@ void test01()
bool test = true;
wfilebuf fb;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fb.pubimbue(loc);
fb.pubsetbuf(0, 0);
fb.open("tmp_11305-1", ios_base::out);
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 f50f59218cd..2415a2edcfb 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
@@ -28,7 +28,7 @@ void test02()
bool test = true;
wfilebuf fb;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fb.pubimbue(loc);
fb.pubsetbuf(0, 0);
fb.open("tmp_11305-2", ios_base::out);
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 86153ea1ff0..fc0092df09c 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
@@ -28,7 +28,7 @@ void test03()
bool test = true;
wfilebuf fb;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ 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');
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 b923a8a9e70..1886f8e630f 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
@@ -28,7 +28,7 @@ void test04()
bool test = true;
wfilebuf fb;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ 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');
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc
index e03da5f2064..f1b30d8de1a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
index 451518c1f23..f649ef87dc6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
@@ -33,7 +33,7 @@ const char name_03[] = "tmp_sbumpc_1io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
index 69559a9a69c..1a43f327dca 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
@@ -32,7 +32,7 @@ const char name_02[] = "tmp_sbumpc_1out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc
index d0f256ee10c..e06e0625efb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc
index ef1f28f786e..54a3047ad00 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc
@@ -33,7 +33,7 @@ const char name_03[] = "tmp_sbumpc_2io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
index 1d8df086bcc..a650e8eab96 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
@@ -32,7 +32,7 @@ const char name_02[] = "tmp_sbumpc_2out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc
index 62173d0c843..2da27f13dcd 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekoff.txt";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc
index 00872f4117d..a655fd81ab7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekoff-1io.tst";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc
index 39abdac89d3..40c62aafe25 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekoff-1out.tst";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc
index 0dc97ded28a..a1adf32b8be 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekoff.txt";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc
index 8be6f5e7adf..fd30a33007d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekoff-2io.tst";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc
index 4a39a2164f3..786fb245a16 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekoff-2out.tst";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc
new file mode 100644
index 00000000000..f3f3cc712d4
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc
@@ -0,0 +1,136 @@
+// 2003-09-08 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.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Check that basic_filebuf::seekoff handles UTF-8 when open for input.
+void test01()
+{
+ using namespace std;
+ typedef wfilebuf::pos_type pos_type;
+ typedef wfilebuf::int_type int_type;
+
+ bool test = true;
+ const char name[] = "tmp_seekoff-1.tst";
+ const int_type eof = wfilebuf::traits_type::eof();
+
+ const char cstr[] =
+ "\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf\x10\x11\x12\x13"
+ "\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&"
+ "'()*+,-./0123456789:;<=>?@}~\x7f\xc2\x80\xc2\x81\xc2\x82\xc2"
+ "\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a"
+ "\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2"
+ "\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99"
+ "\xc2\x9a\xc2\x9b\xc2\x9c\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3"
+ "\xbe\xc3\xbf\xc4\x80\xc4\x81\xc4\x82\xc4\x83\xc4\x84\xc4\x85"
+ "\xc4\x86\xc4\x87\xc4\x88\xc4\x89\xc4\x8a\xc4\x8b\xc4\x8c\xc4"
+ "\x8d\xc4\x8e\xc4\x8f\xc4\x90\xc4\x91\xc4\x92\xc4\x93\xc4\x94"
+ "\xc4\x95\xc4\x96\xc4\x97\xc4\x98\xc4\x99\xdf\xb8\xdf\xb9\xdf"
+ "\xba\xdf\xbb\xdf\xbc\xdf\xbd\xdf\xbe\xdf\xbf\xe0\xa0\x80\xe0"
+ "\xa0\x81\xe0\xa0\x82\xe0\xa0\x83\xe0\xa0\x84\xe0\xa0\x85\xe0"
+ "\xa0\x86\xe0\xa0\x87\xe0\xa0\x88\xe0\xa0\x89\xe0\xa0\x8a\xe0"
+ "\xa0\x8b\xe0\xa0\x8c\xe0\xa0\x8d\xe0\xa0\x8e\xe0\xa0\x8f\xe0"
+ "\xa0\x90\xe0\xa0\x91\xe0\xa0\x92\xe0\xa0\x93\xe0\xa0\x94\xe0"
+ "\xa0\x95\xe0\xa0\x96\xe0\xa0\x97\x1\x2\x4\x8\x10\x20@\xc2\x80"
+ "\xc4\x80\xc8\x80\xd0\x80\xe0\xa0\x80\xe1\x80\x80\xe2\x80\x80"
+ "\xe4\x80\x80\xe8\x80\x80\xf0\x90\x80\x80\xf0\xa0\x80\x80\xf1"
+ "\x80\x80\x80\xf2\x80\x80\x80\xf4\x80\x80\x80\xf8\x88\x80\x80"
+ "\x80\xf8\x90\x80\x80\x80\xf8\xa0\x80\x80\x80\xf9\x80\x80\x80"
+ "\x80\xfa\x80\x80\x80\x80\xfc\x84\x80\x80\x80\x80\xfc\x88\x80"
+ "\x80\x80\x80\xfc\x90\x80\x80\x80\x80\xfc\xa0\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80";
+
+ const wchar_t wstr[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, L'!',
+ L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+',
+ L',', L'-', L'.', L'/', L'0', L'1', L'2', L'3', L'4', L'5',
+ L'6', L'7', L'8', L'9', L':', L';', L'<', L'=', L'>', L'?',
+ L'@', L'}', L'~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
+ 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112,
+ 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x7f8, 0x7f9,
+ 0x7fa, 0x7fb, 0x7fc, 0x7fd, 0x7fe, 0x7ff, 0x800, 0x801, 0x802,
+ 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b,
+ 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814,
+ 0x815, 0x816, 0x817, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, L'@',
+ 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000,
+ 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
+ 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
+ 0x20000000, 0x40000000, 0x0
+ };
+
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ const int loops = 2 * BUFSIZ / wlen;
+ locale loc = __gnu_test::try_named_locale("se_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ for (int i = 0; i < loops; ++i)
+ fwrite(cstr, 1, clen, file);
+ fclose(file);
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+ fb.open(name, ios_base::in);
+
+ pos_type p1 = fb.pubseekoff(0, ios_base::cur);
+ pos_type end = fb.pubseekoff(0, ios_base::end);
+ pos_type beg = fb.pubseekoff(0, ios_base::beg);
+ VERIFY( p1 == beg );
+
+ const size_t limit = wlen * loops;
+ for (size_t index = 0; index < limit; ++index)
+ {
+ // Call seekoff at pseudo-random intervals.
+ if (index % 5 == 0 || index % 7 == 0)
+ {
+ pos_type p2 = fb.pubseekoff(0, ios_base::cur);
+ VERIFY( p2 != pos_type(-1) );
+ }
+ int_type c1 = fb.sbumpc();
+ VERIFY( c1 != eof );
+ VERIFY( c1 == wstr[index % wlen] );
+ }
+
+ pos_type p3 = fb.pubseekoff(0, ios_base::cur);
+ VERIFY( p3 == end );
+
+ int_type c2 = fb.sbumpc();
+ VERIFY( c2 == eof );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc
new file mode 100644
index 00000000000..9ad978bee9f
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc
@@ -0,0 +1,89 @@
+// 2003-09-08 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.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Check that basic_filebuf::seekoff handles UTF-8 when open for input and
+// output.
+void test02()
+{
+ using namespace std;
+ typedef wfilebuf::int_type int_type;
+ bool test = true;
+ const char name[] = "tmp_seekoff-2.tst";
+
+ locale loc = __gnu_test::try_named_locale("se_NO.UTF-8");
+
+ const size_t size = 10;
+ wchar_t buf[size];
+ streamsize n;
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+ fb.open(name, ios_base::in | ios_base::out | ios_base::trunc);
+
+ n = fb.sputn(L"\xa0st", 3);
+ VERIFY( n == 3 );
+
+ fb.pubseekoff(0, ios_base::beg);
+ n = fb.sgetn(buf, 2);
+ VERIFY( n == 2 );
+ VERIFY( !wmemcmp(buf, L"\xa0s", 2) );
+
+ fb.pubseekoff(0, ios_base::cur);
+ n = fb.sputn(L"\xb2R", 2);
+ VERIFY( n == 2 );
+
+ fb.pubseekoff(0, ios_base::beg);
+ n = fb.sgetn(buf, size);
+ VERIFY( n == 4 );
+ VERIFY( !wmemcmp(buf, L"\xa0s\xb2R", 4) );
+
+ fb.pubseekoff(0, ios_base::beg);
+ n = fb.sputn(L"\x90m\x92n\x94", 5);
+ VERIFY( n == 5 );
+
+ fb.pubseekoff(0, ios_base::beg);
+ n = fb.sgetn(buf, 2);
+ VERIFY( n == 2 );
+ VERIFY( !wmemcmp(buf, L"\x90m", 2) );
+
+ fb.pubseekoff(0, ios_base::end);
+ n = fb.sputn(L"I\xbfJ", 3);
+ VERIFY( n == 3 );
+
+ fb.pubseekoff(0, ios_base::beg);
+ n = fb.sgetn(buf, size);
+ VERIFY( n == 8 );
+ VERIFY( !wmemcmp(buf, L"\x90m\x92n\x94I\xbfJ", 8) );
+
+ fb.close();
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc
index 9464eefc1d3..3230e121ed2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekpos.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
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 009886032aa..ecaa19fb2d8 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
@@ -32,7 +32,7 @@ const char name_01[] = "seekpos-1io.tst"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
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 b0008f3cb43..e3c9ac3f3f3 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
@@ -32,7 +32,7 @@ const char name_01[] = "seekpos-1out.tst"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc
index ec1dca5abb8..2fde41aed9e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekpos.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc
index f883cf9ef3a..71fb68bf3ff 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekpos-2io.tst"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc
index 9531e01c609..ee8c65f5154 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc
@@ -32,7 +32,7 @@ const char name_01[] = "seekpos-2out.tst"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::pos_type pos_type;
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 2927991c060..f7a65870df4 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
@@ -34,7 +34,9 @@ void test02()
filebuf fbuf01;
fbuf01.open("tmp", ios_base::out);
- fbuf01.pubsetbuf(buf, strlitsize);
+ // NB: +2 otherwise sputn is optimized to a direct write,
+ // bypassing the buffer.
+ fbuf01.pubsetbuf(buf, strlitsize + 2);
fbuf01.sputn(strlit, strlitsize);
VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc
index 7ae7cdccee4..2a1012d812e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc
@@ -33,7 +33,7 @@ const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
index 7a754768002..ca92295456e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
@@ -34,7 +34,7 @@ const char name_03[] = "tmp_sgetc_1io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
index 41e18e435e4..cdd9bf47051 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
@@ -33,7 +33,7 @@ const char name_02[] = "tmp_sgetc_1out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc
index 979a3fd3845..3c539de1840 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc
@@ -33,7 +33,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc
index e12ef3455cd..09b6e8a7f0a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc
@@ -34,7 +34,7 @@ const char name_03[] = "tmp_sgetc_2io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
index 491c028c281..1db40febda2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
@@ -33,7 +33,7 @@ const char name_02[] = "tmp_sgetc_2out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
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 0f17624c58c..523bdeac34b 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
@@ -33,7 +33,7 @@ const char name_01[] = "sgetn.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
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 e1d9a38f75e..9942a822b26 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
@@ -34,7 +34,7 @@ const char name_03[] = "tmp_sgetn_1io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
index eb710f2d056..1039c397303 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
@@ -33,7 +33,7 @@ const char name_02[] = "tmp_sgetn_1out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
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 62c5a0f93f0..451e6dcfee3 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
@@ -33,7 +33,7 @@ const char name_01[] = "sgetn.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
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 30ccee29f2e..a3fd754e36d 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
@@ -34,7 +34,7 @@ const char name_03[] = "tmp_sgetn_2io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
index 99a907493d4..c0e6be07443 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
@@ -33,7 +33,7 @@ const char name_02[] = "tmp_sgetn_2out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc
index 437a7fb6535..d2d9d3b1c55 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc
@@ -34,7 +34,7 @@ const char name_03[] = "tmp_snextc_1io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
index aa5000d987a..973d89b41f3 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
@@ -34,7 +34,7 @@ const char name_03[] = "tmp_snextc_1io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
index 118383a978e..fd7124a1448 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
@@ -34,7 +34,7 @@ const char name_03[] = "tmp_snextc_1io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc
index 8c563ad41e8..fc89dd5e644 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc
index a044c6d4f41..8c2c0e868e5 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc
@@ -33,7 +33,7 @@ const char name_03[] = "tmp_snextc_2io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
index 8af126337f6..816c3f85406 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
@@ -32,7 +32,7 @@ const char name_02[] = "tmp_snextc_2out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc
index bd6e2055eff..1d216e8ec20 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc
@@ -33,7 +33,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
index f43191cc730..d867e5b87a2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
@@ -32,7 +32,7 @@ const char name_01[] = "tmp_sputbackc_1io.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
index 83d57e2fc61..5b5dbb557c1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
@@ -33,7 +33,7 @@ const char name_01[] = "tmp_sputbackc_1out.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc
index 5deafbc7da7..a9267cf0034 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc
@@ -33,7 +33,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
index 093c663db3a..e7166106d59 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
@@ -32,7 +32,7 @@ const char name_01[] = "tmp_sputbackc_2io.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
index 52f041d8af9..2ff9a6c5aad 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
@@ -33,7 +33,7 @@ const char name_01[] = "tmp_sputbackc_2out.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc
index 25d9ee0ce8d..31b176bcbf6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
index 72350c0a8b8..275def18397 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
@@ -33,7 +33,7 @@ const char name_03[] = "tmp_sputc_1io.tst";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
index f4b5b73f0e7..09086b07d60 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
@@ -32,7 +32,7 @@ const char name_02[] = "tmp_sputc_1out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc
index 85ab4efbeff..680e058a904 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc
index 373a6a8cba5..abbdea55fbd 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc
@@ -33,7 +33,7 @@ const char name_03[] = "tmp_sputc_2io.tst";
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
index 96e12954a97..78e2b4eb3d6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
@@ -32,7 +32,7 @@ const char name_02[] = "tmp_sputc_2out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc
index 235fce07e22..4888f23bb16 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
index 9ec3d259ca8..7f32662d315 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
@@ -33,7 +33,7 @@ const char name_03[] = "tmp_sputn_1io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
index f98bcd745b1..d17db7abf3b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
@@ -32,7 +32,7 @@ const char name_02[] = "tmp_sputn_1out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc
index 8972b5efcb8..a9f188cf410 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc
@@ -32,7 +32,7 @@ const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
index c6109c2f100..2dc0204c94e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
@@ -33,7 +33,7 @@ const char name_03[] = "tmp_sputn_2io.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
index 81cd506aba1..26046b17a35 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
@@ -32,7 +32,7 @@ const char name_02[] = "tmp_sputn_2out.tst"; // empty file, need to create
void test05()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc
index bf753cabcb6..7e3b9c07621 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc
@@ -33,7 +33,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
index 78464834bec..5cbaf1b8db2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
@@ -32,7 +32,7 @@ const char name_01[] = "tmp_sungetc_1io.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
index 99cf7ed383c..daefb70b997 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
@@ -33,7 +33,7 @@ const char name_01[] = "tmp_sungetc_1out.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc
index e0814fdddc0..d35a3f2ae8b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc
@@ -33,7 +33,7 @@ const char name_01[] = "sgetc.txt"; // file with data in it
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
index 24d015c90e7..b45ba2676bf 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
@@ -32,7 +32,7 @@ const char name_01[] = "tmp_sungetc_2io.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
index d6cd79f5c6e..f08df15e7b8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
@@ -33,7 +33,7 @@ const char name_01[] = "tmp_sungetc_2out.tst"; // empty file, need to create
void test01()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
typedef std::filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc
new file mode 100644
index 00000000000..d55b89c90ac
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc
@@ -0,0 +1,110 @@
+// 2003-09-04 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.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Test handing of UTF-8 in basic_filebuf::underflow
+void test01()
+{
+ using namespace std;
+ bool test = true;
+ const char name[] = "tmp_underflow-1.tst";
+
+ const char cstr[] =
+ "\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf\x10\x11\x12\x13"
+ "\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&"
+ "'()*+,-./0123456789:;<=>?@}~\x7f\xc2\x80\xc2\x81\xc2\x82\xc2"
+ "\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a"
+ "\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2"
+ "\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99"
+ "\xc2\x9a\xc2\x9b\xc2\x9c\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3"
+ "\xbe\xc3\xbf\xc4\x80\xc4\x81\xc4\x82\xc4\x83\xc4\x84\xc4\x85"
+ "\xc4\x86\xc4\x87\xc4\x88\xc4\x89\xc4\x8a\xc4\x8b\xc4\x8c\xc4"
+ "\x8d\xc4\x8e\xc4\x8f\xc4\x90\xc4\x91\xc4\x92\xc4\x93\xc4\x94"
+ "\xc4\x95\xc4\x96\xc4\x97\xc4\x98\xc4\x99\xdf\xb8\xdf\xb9\xdf"
+ "\xba\xdf\xbb\xdf\xbc\xdf\xbd\xdf\xbe\xdf\xbf\xe0\xa0\x80\xe0"
+ "\xa0\x81\xe0\xa0\x82\xe0\xa0\x83\xe0\xa0\x84\xe0\xa0\x85\xe0"
+ "\xa0\x86\xe0\xa0\x87\xe0\xa0\x88\xe0\xa0\x89\xe0\xa0\x8a\xe0"
+ "\xa0\x8b\xe0\xa0\x8c\xe0\xa0\x8d\xe0\xa0\x8e\xe0\xa0\x8f\xe0"
+ "\xa0\x90\xe0\xa0\x91\xe0\xa0\x92\xe0\xa0\x93\xe0\xa0\x94\xe0"
+ "\xa0\x95\xe0\xa0\x96\xe0\xa0\x97\x1\x2\x4\x8\x10\x20@\xc2\x80"
+ "\xc4\x80\xc8\x80\xd0\x80\xe0\xa0\x80\xe1\x80\x80\xe2\x80\x80"
+ "\xe4\x80\x80\xe8\x80\x80\xf0\x90\x80\x80\xf0\xa0\x80\x80\xf1"
+ "\x80\x80\x80\xf2\x80\x80\x80\xf4\x80\x80\x80\xf8\x88\x80\x80"
+ "\x80\xf8\x90\x80\x80\x80\xf8\xa0\x80\x80\x80\xf9\x80\x80\x80"
+ "\x80\xfa\x80\x80\x80\x80\xfc\x84\x80\x80\x80\x80\xfc\x88\x80"
+ "\x80\x80\x80\xfc\x90\x80\x80\x80\x80\xfc\xa0\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80";
+
+ const wchar_t wstr[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, L'!',
+ L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+',
+ L',', L'-', L'.', L'/', L'0', L'1', L'2', L'3', L'4', L'5',
+ L'6', L'7', L'8', L'9', L':', L';', L'<', L'=', L'>', L'?',
+ L'@', L'}', L'~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
+ 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112,
+ 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x7f8, 0x7f9,
+ 0x7fa, 0x7fb, 0x7fc, 0x7fd, 0x7fe, 0x7ff, 0x800, 0x801, 0x802,
+ 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b,
+ 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814,
+ 0x815, 0x816, 0x817, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, L'@',
+ 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000,
+ 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
+ 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
+ 0x20000000, 0x40000000, 0x0
+ };
+
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ locale loc = __gnu_test::try_named_locale("se_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ fwrite(cstr, 1, clen, file);
+ fclose(file);
+
+ wchar_t wbuf[wlen + 1];
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+ fb.open(name, ios_base::in);
+ streamsize n = fb.sgetn(wbuf, wlen + 1);
+ fb.close();
+
+ VERIFY( n == wlen );
+ VERIFY( !wmemcmp(wbuf, wstr, wlen) );
+}
+
+int main ()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-1.cc
index c4866ef3d97..d0753650d12 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-1.cc
@@ -34,7 +34,7 @@ void test01()
fbout.close();
wfilebuf fbin;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fbin.pubimbue(loc);
fbin.open(name_01, ios_base::in);
VERIFY( fbin.sbumpc() == L'a' );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-2.cc
index 90dfb8fd1fd..1717f2a5aeb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-2.cc
@@ -35,7 +35,7 @@ void test02()
fbout.close();
wfilebuf fbin;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fbin.pubimbue(loc);
fbin.open(name_02, ios_base::in);
VERIFY( fbin.sbumpc() == L'a' );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-3.cc
index c4b48597919..c23cb56f26b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-3.cc
@@ -34,7 +34,7 @@ void test03()
fbout.close();
wfilebuf fbin;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fbin.pubimbue(loc);
fbin.pubsetbuf(0, 0);
fbin.open(name_03, ios_base::in);
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-4.cc
index 00d1edc2f05..ec2f0f89245 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-4.cc
@@ -35,7 +35,7 @@ void test04()
fbout.close();
wfilebuf fbin;
- locale loc(__gnu_cxx_test::try_named_locale("en_US.UTF-8"));
+ locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fbin.pubimbue(loc);
fbin.pubsetbuf(0, 0);
fbin.open(name_04, ios_base::in);
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc
new file mode 100644
index 00000000000..77616ed5d91
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc
@@ -0,0 +1,111 @@
+// 2003-09-04 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.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Test handing of UTF-8 in unbuffered basic_filebuf::underflow
+void test02()
+{
+ using namespace std;
+ bool test = true;
+ const char name[] = "tmp_underflow-2.tst";
+
+ const char cstr[] =
+ "\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf\x10\x11\x12\x13"
+ "\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&"
+ "'()*+,-./0123456789:;<=>?@}~\x7f\xc2\x80\xc2\x81\xc2\x82\xc2"
+ "\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a"
+ "\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2"
+ "\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99"
+ "\xc2\x9a\xc2\x9b\xc2\x9c\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3"
+ "\xbe\xc3\xbf\xc4\x80\xc4\x81\xc4\x82\xc4\x83\xc4\x84\xc4\x85"
+ "\xc4\x86\xc4\x87\xc4\x88\xc4\x89\xc4\x8a\xc4\x8b\xc4\x8c\xc4"
+ "\x8d\xc4\x8e\xc4\x8f\xc4\x90\xc4\x91\xc4\x92\xc4\x93\xc4\x94"
+ "\xc4\x95\xc4\x96\xc4\x97\xc4\x98\xc4\x99\xdf\xb8\xdf\xb9\xdf"
+ "\xba\xdf\xbb\xdf\xbc\xdf\xbd\xdf\xbe\xdf\xbf\xe0\xa0\x80\xe0"
+ "\xa0\x81\xe0\xa0\x82\xe0\xa0\x83\xe0\xa0\x84\xe0\xa0\x85\xe0"
+ "\xa0\x86\xe0\xa0\x87\xe0\xa0\x88\xe0\xa0\x89\xe0\xa0\x8a\xe0"
+ "\xa0\x8b\xe0\xa0\x8c\xe0\xa0\x8d\xe0\xa0\x8e\xe0\xa0\x8f\xe0"
+ "\xa0\x90\xe0\xa0\x91\xe0\xa0\x92\xe0\xa0\x93\xe0\xa0\x94\xe0"
+ "\xa0\x95\xe0\xa0\x96\xe0\xa0\x97\x1\x2\x4\x8\x10\x20@\xc2\x80"
+ "\xc4\x80\xc8\x80\xd0\x80\xe0\xa0\x80\xe1\x80\x80\xe2\x80\x80"
+ "\xe4\x80\x80\xe8\x80\x80\xf0\x90\x80\x80\xf0\xa0\x80\x80\xf1"
+ "\x80\x80\x80\xf2\x80\x80\x80\xf4\x80\x80\x80\xf8\x88\x80\x80"
+ "\x80\xf8\x90\x80\x80\x80\xf8\xa0\x80\x80\x80\xf9\x80\x80\x80"
+ "\x80\xfa\x80\x80\x80\x80\xfc\x84\x80\x80\x80\x80\xfc\x88\x80"
+ "\x80\x80\x80\xfc\x90\x80\x80\x80\x80\xfc\xa0\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80";
+
+ const wchar_t wstr[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, L'!',
+ L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+',
+ L',', L'-', L'.', L'/', L'0', L'1', L'2', L'3', L'4', L'5',
+ L'6', L'7', L'8', L'9', L':', L';', L'<', L'=', L'>', L'?',
+ L'@', L'}', L'~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
+ 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112,
+ 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x7f8, 0x7f9,
+ 0x7fa, 0x7fb, 0x7fc, 0x7fd, 0x7fe, 0x7ff, 0x800, 0x801, 0x802,
+ 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b,
+ 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814,
+ 0x815, 0x816, 0x817, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, L'@',
+ 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000,
+ 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
+ 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
+ 0x20000000, 0x40000000, 0x0
+ };
+
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ locale loc = __gnu_test::try_named_locale("se_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ fwrite(cstr, 1, clen, file);
+ fclose(file);
+
+ wchar_t wbuf[wlen + 1];
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+ fb.pubsetbuf(0, 0);
+ fb.open(name, ios_base::in);
+ streamsize n = fb.sgetn(wbuf, wlen + 1);
+ fb.close();
+
+ VERIFY( n == wlen );
+ VERIFY( !wmemcmp(wbuf, wstr, wlen) );
+}
+
+int main ()
+{
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc
new file mode 100644
index 00000000000..169d3ebfa25
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc
@@ -0,0 +1,116 @@
+// 2003-09-04 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.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Test handing of UTF-8 in basic_filebuf::underflow
+void test03()
+{
+ using namespace std;
+ bool test = true;
+ const char name[] = "tmp_underflow-3.tst";
+
+ const char cstr[] =
+ "\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf\x10\x11\x12\x13"
+ "\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&"
+ "'()*+,-./0123456789:;<=>?@}~\x7f\xc2\x80\xc2\x81\xc2\x82\xc2"
+ "\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a"
+ "\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2"
+ "\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99"
+ "\xc2\x9a\xc2\x9b\xc2\x9c\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3"
+ "\xbe\xc3\xbf\xc4\x80\xc4\x81\xc4\x82\xc4\x83\xc4\x84\xc4\x85"
+ "\xc4\x86\xc4\x87\xc4\x88\xc4\x89\xc4\x8a\xc4\x8b\xc4\x8c\xc4"
+ "\x8d\xc4\x8e\xc4\x8f\xc4\x90\xc4\x91\xc4\x92\xc4\x93\xc4\x94"
+ "\xc4\x95\xc4\x96\xc4\x97\xc4\x98\xc4\x99\xdf\xb8\xdf\xb9\xdf"
+ "\xba\xdf\xbb\xdf\xbc\xdf\xbd\xdf\xbe\xdf\xbf\xe0\xa0\x80\xe0"
+ "\xa0\x81\xe0\xa0\x82\xe0\xa0\x83\xe0\xa0\x84\xe0\xa0\x85\xe0"
+ "\xa0\x86\xe0\xa0\x87\xe0\xa0\x88\xe0\xa0\x89\xe0\xa0\x8a\xe0"
+ "\xa0\x8b\xe0\xa0\x8c\xe0\xa0\x8d\xe0\xa0\x8e\xe0\xa0\x8f\xe0"
+ "\xa0\x90\xe0\xa0\x91\xe0\xa0\x92\xe0\xa0\x93\xe0\xa0\x94\xe0"
+ "\xa0\x95\xe0\xa0\x96\xe0\xa0\x97\x1\x2\x4\x8\x10\x20@\xc2\x80"
+ "\xc4\x80\xc8\x80\xd0\x80\xe0\xa0\x80\xe1\x80\x80\xe2\x80\x80"
+ "\xe4\x80\x80\xe8\x80\x80\xf0\x90\x80\x80\xf0\xa0\x80\x80\xf1"
+ "\x80\x80\x80\xf2\x80\x80\x80\xf4\x80\x80\x80\xf8\x88\x80\x80"
+ "\x80\xf8\x90\x80\x80\x80\xf8\xa0\x80\x80\x80\xf9\x80\x80\x80"
+ "\x80\xfa\x80\x80\x80\x80\xfc\x84\x80\x80\x80\x80\xfc\x88\x80"
+ "\x80\x80\x80\xfc\x90\x80\x80\x80\x80\xfc\xa0\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80";
+
+ const wchar_t wstr[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, L'!',
+ L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+',
+ L',', L'-', L'.', L'/', L'0', L'1', L'2', L'3', L'4', L'5',
+ L'6', L'7', L'8', L'9', L':', L';', L'<', L'=', L'>', L'?',
+ L'@', L'}', L'~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
+ 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112,
+ 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x7f8, 0x7f9,
+ 0x7fa, 0x7fb, 0x7fc, 0x7fd, 0x7fe, 0x7ff, 0x800, 0x801, 0x802,
+ 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b,
+ 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814,
+ 0x815, 0x816, 0x817, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, L'@',
+ 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000,
+ 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
+ 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
+ 0x20000000, 0x40000000, 0x0
+ };
+
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ const int loops = 2 * BUFSIZ / wlen;
+ locale loc = __gnu_test::try_named_locale("se_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ for (int i = 0; i < loops; ++i)
+ fwrite(cstr, 1, clen, file);
+ fclose(file);
+
+ wchar_t wbuf[wlen];
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+ fb.open(name, ios_base::in);
+ for (int i = 0; i < loops; ++i)
+ {
+ streamsize n = fb.sgetn(wbuf, wlen);
+ VERIFY( n == wlen );
+ VERIFY( !wmemcmp(wbuf, wstr, wlen) );
+ }
+
+ VERIFY( fb.sgetc() == wfilebuf::traits_type::eof() );
+ fb.close();
+}
+
+int main ()
+{
+ test03();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector_element_access.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc
index 5f5b5d231de..00fb3774489 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_element_access.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc
@@ -1,7 +1,7 @@
-// 2000-09-06
-// bkoz
+// 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+// Adapted from 27_io/basic_filebuf/underflow/char/2.cc
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// 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
@@ -19,50 +19,36 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 23.2.4 vector
+// 27.8.1.4 Overridden virtual functions
-#include <vector>
-#include <stdexcept>
+#include <fstream>
+#include <locale>
#include <testsuite_hooks.h>
-template<typename T>
-struct A { };
-
-struct B { };
-
-// http://gcc.gnu.org/ml/libstdc++/2000-09/msg00002.html
-bool test01()
+void test01()
{
bool test = true;
- std::vector< A<B> > vec01;
- std::vector< A<B> > vec02(5);
- typedef std::vector< A<B> >::size_type size_type;
- typedef std::vector< A<B> >::reference reference;
-
- try
- {
- reference r01 = vec01.at(6);
- VERIFY( false ); // Should not get here, as exception thrown.
- }
- catch(std::out_of_range& err)
- {
- VERIFY( true );
- }
- catch(...)
- {
- VERIFY( false );
- }
+ using namespace std;
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
+ locale loc (__gnu_test::try_named_locale("se_NO.UTF-8"));
+ wfilebuf fb_out, fb_in_out;
+ fb_out.pubimbue(loc);
+ fb_in_out.pubimbue(loc);
- return test;
+ fb_out.open("tmp_underflow.tst", ios::out);
+ fb_out.sputc(L'S');
+ fb_out.sputc(L'T');
+ fb_out.close();
+
+ fb_in_out.open("tmp_underflow.tst", ios::in | ios::out);
+ while (fb_in_out.sbumpc() != filebuf::traits_type::eof());
+
+ VERIFY( fb_in_out.sputc(L'x') == L'x' );
+ fb_in_out.close();
}
int main()
{
test01();
-
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc
new file mode 100644
index 00000000000..f8636b0cc30
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc
@@ -0,0 +1,73 @@
+// 2003-09-04 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.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Test that unbuffered really means unbuffered for UTF-8
+void test05()
+{
+ using namespace std;
+ bool test = true;
+ const char* name = "tmp_underflow-5";
+
+ wfilebuf fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(__gnu_test::try_named_locale("se_NO.UTF-8"));
+
+ FILE* file = fopen(name, "w");
+ setvbuf(file, 0, _IONBF, 0);
+ fputs("abcde", file);
+
+ fb.open(name, ios_base::in);
+ VERIFY( fb.sbumpc() == L'a' );
+
+ fseek(file, 1, SEEK_SET);
+ fputc('0', file);
+
+ VERIFY( fb.sbumpc() == L'0' );
+ VERIFY( fb.sbumpc() == L'c' );
+
+ fputc('1', file);
+ fputc('2', file);
+
+ VERIFY( fb.sbumpc() == L'2' );
+ VERIFY( fb.sbumpc() == L'e' );
+ VERIFY( fb.sbumpc() == WEOF );
+
+ fputc('3', file);
+ fputc('4', file);
+
+ VERIFY( fb.sbumpc() == L'4' );
+ VERIFY( fb.sbumpc() == WEOF );
+
+ fb.close();
+ fclose(file);
+}
+
+int main()
+{
+ test05();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc
index a764bb2b5de..5bd831378d7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc
@@ -35,7 +35,7 @@ void test01()
putc(static_cast<unsigned char>(i), file);
fclose(file);
- locale loc (__gnu_cxx_test::try_named_locale("de_DE.ISO-8859-15@euro"));
+ locale loc (__gnu_test::try_named_locale("de_DE.ISO-8859-15@euro"));
wchar_t buf[1];
wfilebuf fb;
fb.pubimbue(loc);
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/2.cc
index 3faf03f4dcf..861a6044f9e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_fstream/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_fstream/2.cc
@@ -38,7 +38,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_fstream<type_t, char_traits<type_t> >;
template class basic_fstream<pod_char, char_traits<pod_char> >;
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc
index 6daa4e02c5e..3286411eb62 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc
@@ -43,7 +43,7 @@ void test03()
typedef std::ios_base::fmtflags fmtflags;
typedef std::ios_base::iostate iostate;
locale loc_c = locale::classic();
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
std::ios ios_01(NULL);
std::ios ios_02(NULL);
ios_01.imbue(loc_c);
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/2.cc
index 40ec332923d..7676f6a094e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/2.cc
@@ -38,7 +38,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_istream<type_t, char_traits<type_t> >;
template class basic_istream<pod_char, char_traits<pod_char> >;
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc
index b2fdd2691e7..9c3b3605cb8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc
@@ -119,11 +119,6 @@ bool test01() {
ss_01 >> pi;
std::printf ("%x %x\n", pi, po);
VERIFY( po == pi );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc
index 374fbd8e0c7..94136d2e168 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc
@@ -56,11 +56,6 @@ bool test02() {
VERIFY( n == 20000 );
char c = is.peek();
VERIFY( c == 65 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc
index 869d828b091..65306c4d6e3 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc
@@ -55,11 +55,6 @@ bool test03()
istr >> l01; // _M_in_end set completely incorrectly here.
VERIFY( l01 == 12220101 );
VERIFY( istr.rdstate() == std::ios_base::eofbit );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc
index de92bcd52cb..206c81e506b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc
@@ -70,10 +70,6 @@ void test06()
is >> c; // EOF
VERIFY( c == ',' );
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc
index 118668ea1d9..6167471ba49 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc
@@ -156,10 +156,6 @@ void test07()
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
is.clear();
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc
index f8491612ddf..2a2c3cc1ff7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc
@@ -79,11 +79,6 @@ void test08()
is >> h2;
VERIFY( h2 == 2212322 );
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
-
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc
index 37e175e6f7c..67d98d53de8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc
@@ -58,10 +58,6 @@ bool test09()
test = f1 == 2456;
VERIFY( f2 == 0.00567 );
VERIFY( c == '-' );
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
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 bc67190533f..de7bbf9ada8 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
@@ -139,11 +139,6 @@ bool test10() {
is_05.ignore();
is_05 >> n;
VERIFY( n == 16 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc
index 9d59395bde4..157084167f5 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc
@@ -39,7 +39,7 @@
void test02()
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
basic_stringstream<pod_char, char_traits<pod_char> > sstr;
// 1
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc
index 99dd0b09bc1..27e1e3667ff 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-fstream.cc
@@ -30,6 +30,7 @@
// 27.4.2.1.6 class ios_base::init
#include <fstream>
+#include <typeinfo>
#include <testsuite_hooks.h>
// char_traits specialization
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc
index 6f51df5850d..4e928fad62b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc
@@ -30,6 +30,7 @@
// 27.4.2.1.6 class ios_base::init
#include <sstream>
+#include <typeinfo>
#include <testsuite_hooks.h>
// char_traits specialization
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/2.cc
index 8c672b1f076..3910aa7bd34 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/2.cc
@@ -38,7 +38,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_ostream<type_t, char_traits<type_t> >;
template class basic_ostream<pod_char, char_traits<pod_char> >;
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc
index 8a81b964fd1..f49f60405f8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc
@@ -30,7 +30,7 @@
using namespace std;
-#ifndef DEBUG_ASSERT
+#ifndef _GLIBCXX_ASSERT
# define TEST_NUMPUT_VERBOSE 1
#endif
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc
index 92180927f6f..2cf4021108f 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc
@@ -43,7 +43,7 @@ test02()
os2.setf(ios::fixed);
// Check it can be done in a locale with grouping on.
- locale loc2 = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc2 = __gnu_test::try_named_locale("de_DE");
os2.imbue(loc2);
os2 << fixed << setprecision(3) << val2 << endl;
os2 << endl;
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc
index a439c9e78ab..484e66b8c15 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc
@@ -30,7 +30,7 @@
using namespace std;
-#ifndef DEBUG_ASSERT
+#ifndef _GLIBCXX_ASSERT
# define TEST_NUMPUT_VERBOSE 1
#endif
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc
index 3cdf3b83310..2c8f6c67463 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc
@@ -30,6 +30,7 @@
// 27.4.2.1.6 class ios_base::init
#include <fstream>
+#include <typeinfo>
#include <testsuite_hooks.h>
// char_traits specialization
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc
index 5f68c585ad5..141548ad10a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/3983-sstream.cc
@@ -30,6 +30,7 @@
// 27.4.2.1.6 class ios_base::init
#include <sstream>
+#include <typeinfo>
#include <testsuite_hooks.h>
// char_traits specialization
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc
index b3a48269bf4..71da9a59349 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc
@@ -38,7 +38,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_streambuf<type_t, char_traits<type_t> >;
template class basic_streambuf<pod_char, char_traits<pod_char> >;
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc
index fee82668f9d..7dbfdc75562 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc
@@ -53,10 +53,10 @@ void test08()
testbuf ob;
VERIFY( ob.getloc() == loc );
- locale::global(__gnu_cxx_test::try_named_locale("en_US"));
+ locale::global(__gnu_test::try_named_locale("en_US"));
VERIFY( ob.getloc() == loc );
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc_de );
VERIFY( ret == loc );
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc
index a91deab2f1d..7841f3275c5 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc
@@ -50,7 +50,7 @@ void test01()
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_stringbuf<type_t, char_traits<type_t> >;
template class basic_stringbuf<pod_char, char_traits<pod_char> >;
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc
index f40868a179f..940aa7a852a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc
@@ -33,7 +33,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_stringbuf<type_t, char_traits<type_t> >;
template class basic_stringbuf<pod_char, char_traits<pod_char> >;
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc
index cd4c4311c6a..fd2ddbd6acc 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc
@@ -30,8 +30,8 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
- typedef __gnu_cxx_test::tracker_alloc<char> alloc_type;
+ using __gnu_test::pod_char;
+ typedef __gnu_test::tracker_alloc<char> alloc_type;
template class basic_stringbuf<char, char_traits<char>, alloc_type>;
} // test
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc
index 7006dda094a..549e59ef841 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc
@@ -33,10 +33,10 @@ void test03()
std::stringbuf ob;
VERIFY( ob.getloc() == loc );
- locale::global(__gnu_cxx_test::try_named_locale("en_US"));
+ locale::global(__gnu_test::try_named_locale("en_US"));
VERIFY( ob.getloc() == loc );
- locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc_de );
VERIFY( ret == loc );
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc
index abadf8271e6..5cd55f1d30b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc
@@ -38,7 +38,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class basic_stringstream<type_t, char_traits<type_t> >;
template class basic_stringstream<pod_char, char_traits<pod_char> >;
diff --git a/libstdc++-v3/testsuite/27_io/fpos/1.cc b/libstdc++-v3/testsuite/27_io/fpos/1.cc
index 5d074c1e270..8d927dc51e1 100644
--- a/libstdc++-v3/testsuite/27_io/fpos/1.cc
+++ b/libstdc++-v3/testsuite/27_io/fpos/1.cc
@@ -28,7 +28,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ using __gnu_test::pod_char;
typedef short type_t;
template class fpos<type_t>;
template class fpos<pod_char>;
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 e6f9921b368..f0baf752ef7 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 *-*-* } 696 }
+// { dg-error "is private" "" { target *-*-* } 748 }
// { 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 5d77444b342..08865db583e 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 *-*-* } 693 }
+// { dg-error "is private" "" { target *-*-* } 745 }
// { 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 dac74cd35da..ee27d44788c 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc
@@ -48,7 +48,7 @@ void test01()
int main(void)
{
- __gnu_cxx_test::set_memory_limits();
+ __gnu_test::set_memory_limits();
test01();
return 0;
}
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 751b6be2583..7df7eb965b4 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc
@@ -123,7 +123,7 @@ void test02()
int main(void)
{
- __gnu_cxx_test::set_memory_limits();
+ __gnu_test::set_memory_limits();
test02();
return 0;
}
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 2c9816a397e..ea5e13a422a 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc
@@ -46,7 +46,7 @@ void test03()
int main(void)
{
- __gnu_cxx_test::set_memory_limits();
+ __gnu_test::set_memory_limits();
test03();
return 0;
}
diff --git a/libstdc++-v3/testsuite/23_containers/set_operators_neg.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
index c3c23741e2e..7ad336dafe6 100644
--- a/libstdc++-v3/testsuite/23_containers/set_operators_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
@@ -1,6 +1,7 @@
-// 2000-09-07 bgarcia@laurelnetworks.com
+// Derived from libstdc++/12048 by LJR <ljrittle@acm.org> with
+// reminder from Petur Runolfsson <peturr02@ru.is>.
-// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+// 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
@@ -18,26 +19,25 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 23.3.4 template class multiset negative tests
+#include <iostream>
+#include <testsuite_hooks.h>
-#include <set>
-#include <string>
-
-// { dg-do compile }
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ char c1;
+ char c2;
+ std::cin.get(c1);
+ std::cin.unget();
+ std::cin.get(c2);
+ VERIFY( std::cin.good() );
+ VERIFY( c1 == c2 );
+}
-// libstdc++/86: map & set iterator comparisons are not type-safe
int main(void)
{
- bool test = true;
-
- std::set<unsigned int> setByIndex;
- std::set<std::string> setByName;
-
- std::set<unsigned int>::iterator itr(setByIndex.begin());
-
- // NB: it's not setByIndex!!
- test &= itr != setByName.end(); // { dg-error "no" }
- test &= itr == setByName.end(); // { dg-error "no" }
-
+ test01();
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc
new file mode 100644
index 00000000000..d544d644065
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc
@@ -0,0 +1,41 @@
+// 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 <iostream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ char c1;
+ int c2;
+ std::cin.get(c1);
+ std::cin.unget();
+ VERIFY( std::cin.good() );
+ c2 = std::fgetc(stdin);
+ VERIFY( c2 == std::char_traits<char>::to_int_type(c1) );
+}
+
+int main(void)
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
new file mode 100644
index 00000000000..2f69b072233
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
@@ -0,0 +1,39 @@
+// 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 <iostream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ char buf[2];
+ VERIFY( std::cin.rdbuf()->sgetn(buf, 2) == 2 );
+ int c1 = std::cin.rdbuf()->sungetc();
+ int c2 = std::cin.rdbuf()->sbumpc();
+ VERIFY( c1 == std::char_traits<char>::to_int_type(buf[1]) );
+ VERIFY( c2 == c1 );
+}
+
+int main(void)
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc
new file mode 100644
index 00000000000..6c0b28fe4db
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc
@@ -0,0 +1,40 @@
+// 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 <iostream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ char buf[2];
+ VERIFY( std::cin.rdbuf()->sgetn(buf, 2) == 2 );
+ int c1 = std::cin.rdbuf()->sungetc();
+ int c2 = std::fgetc(stdin);
+ VERIFY( c1 == std::char_traits<char>::to_int_type(buf[1]) );
+ VERIFY( c2 == c1 );
+}
+
+int main(void)
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc
new file mode 100644
index 00000000000..884f49e9010
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc
@@ -0,0 +1,55 @@
+// Derived from libstdc++/12048 by LJR <ljrittle@acm.org> with
+// reminder from 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.
+
+// DR 49 states that cin.rdbuf()->sbumpc() and fgetc(stdin) should be
+// equivalent and interchangable. Currently however, cin.rdbuf()->sungetc()
+// only returns characters that were read with cin.rdbuf()->sbumpc()
+
+// { dg-do run { xfail *-*-* } }
+
+#include <iostream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ char c1;
+ int c2;
+ char c3;
+ std::cin.get(c1);
+ c2 = std::fgetc(stdin);
+ std::cin.unget();
+ if (std::cin.good())
+ {
+ std::cin.get(c3);
+ VERIFY( std::cin.good() );
+ VERIFY( c3 == std::char_traits<char>::to_char_type(c2) );
+ }
+}
+
+int main(void)
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc
index f0a7868ba4f..f797380836f 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc
@@ -22,7 +22,7 @@
#include <cstdio>
#include <testsuite_hooks.h>
-// Test handling of UTF-8 in wcin and wcout
+// Test handling of UTF-8 in wcin
void test10()
{
using namespace std;
@@ -30,7 +30,7 @@ void test10()
bool test = true;
const char* name = "tmp_10";
- locale loc(__gnu_cxx_test::try_named_locale("se_NO.UTF-8"));
+ locale loc(__gnu_test::try_named_locale("se_NO.UTF-8"));
locale::global(loc);
wcin.imbue(loc);
wcout.imbue(loc);
@@ -87,18 +87,9 @@ void test10()
};
size_t i_size = wcslen(i_lit);
- freopen(name, "w", stdout);
-
- wcout.write(i_lit, i_size);
- wcout.flush();
- VERIFY( wcout.good() );
-
- FILE* file = fopen(name, "r");
- char* buf = new char[e_size + 10];
- size_t n = fread(buf, 1, e_size + 10, file);
+ FILE* file = fopen(name, "w");
+ size_t n = fwrite(e_lit, 1, e_size, file);
VERIFY( n == e_size );
- VERIFY( !memcmp(buf, e_lit, e_size) );
- delete[] buf;
fclose(file);
freopen(name, "r", stdin);
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc
new file mode 100644
index 00000000000..d538612a60d
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc
@@ -0,0 +1,109 @@
+// 2003-05-01 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.
+
+#include <iostream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Test handling of UTF-8 in wcout
+void test11()
+{
+ using namespace std;
+
+ bool test = true;
+ const char* name = "tmp_11";
+
+ locale loc(__gnu_test::try_named_locale("se_NO.UTF-8"));
+ locale::global(loc);
+ wcin.imbue(loc);
+ wcout.imbue(loc);
+
+ const char* e_lit =
+ "\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf\x10\x11\x12\x13"
+ "\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&"
+ "'()*+,-./0123456789:;<=>?@}~\x7f\xc2\x80\xc2\x81\xc2\x82\xc2"
+ "\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a"
+ "\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2"
+ "\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99"
+ "\xc2\x9a\xc2\x9b\xc2\x9c\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3"
+ "\xbe\xc3\xbf\xc4\x80\xc4\x81\xc4\x82\xc4\x83\xc4\x84\xc4\x85"
+ "\xc4\x86\xc4\x87\xc4\x88\xc4\x89\xc4\x8a\xc4\x8b\xc4\x8c\xc4"
+ "\x8d\xc4\x8e\xc4\x8f\xc4\x90\xc4\x91\xc4\x92\xc4\x93\xc4\x94"
+ "\xc4\x95\xc4\x96\xc4\x97\xc4\x98\xc4\x99\xdf\xb8\xdf\xb9\xdf"
+ "\xba\xdf\xbb\xdf\xbc\xdf\xbd\xdf\xbe\xdf\xbf\xe0\xa0\x80\xe0"
+ "\xa0\x81\xe0\xa0\x82\xe0\xa0\x83\xe0\xa0\x84\xe0\xa0\x85\xe0"
+ "\xa0\x86\xe0\xa0\x87\xe0\xa0\x88\xe0\xa0\x89\xe0\xa0\x8a\xe0"
+ "\xa0\x8b\xe0\xa0\x8c\xe0\xa0\x8d\xe0\xa0\x8e\xe0\xa0\x8f\xe0"
+ "\xa0\x90\xe0\xa0\x91\xe0\xa0\x92\xe0\xa0\x93\xe0\xa0\x94\xe0"
+ "\xa0\x95\xe0\xa0\x96\xe0\xa0\x97\x1\x2\x4\x8\x10\x20@\xc2\x80"
+ "\xc4\x80\xc8\x80\xd0\x80\xe0\xa0\x80\xe1\x80\x80\xe2\x80\x80"
+ "\xe4\x80\x80\xe8\x80\x80\xf0\x90\x80\x80\xf0\xa0\x80\x80\xf1"
+ "\x80\x80\x80\xf2\x80\x80\x80\xf4\x80\x80\x80\xf8\x88\x80\x80"
+ "\x80\xf8\x90\x80\x80\x80\xf8\xa0\x80\x80\x80\xf9\x80\x80\x80"
+ "\x80\xfa\x80\x80\x80\x80\xfc\x84\x80\x80\x80\x80\xfc\x88\x80"
+ "\x80\x80\x80\xfc\x90\x80\x80\x80\x80\xfc\xa0\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80";
+ size_t e_size = strlen(e_lit);
+
+ const wchar_t i_lit[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, L'!',
+ L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+',
+ L',', L'-', L'.', L'/', L'0', L'1', L'2', L'3', L'4', L'5',
+ L'6', L'7', L'8', L'9', L':', L';', L'<', L'=', L'>', L'?',
+ L'@', L'}', L'~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
+ 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112,
+ 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x7f8, 0x7f9,
+ 0x7fa, 0x7fb, 0x7fc, 0x7fd, 0x7fe, 0x7ff, 0x800, 0x801, 0x802,
+ 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b,
+ 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814,
+ 0x815, 0x816, 0x817, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, L'@',
+ 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000,
+ 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
+ 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
+ 0x20000000, 0x40000000, 0x0
+ };
+ size_t i_size = wcslen(i_lit);
+
+ freopen(name, "w", stdout);
+
+ wcout.write(i_lit, i_size);
+ wcout.flush();
+ VERIFY( wcout.good() );
+
+ FILE* file = fopen(name, "r");
+ char* buf = new char[e_size + 10];
+ size_t n = fread(buf, 1, e_size + 10, file);
+ VERIFY( n == e_size );
+ VERIFY( !memcmp(buf, e_lit, e_size) );
+ delete[] buf;
+ fclose(file);
+}
+
+int main()
+{
+ test11();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc
new file mode 100644
index 00000000000..50e4e78cd8c
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc
@@ -0,0 +1,119 @@
+// 2003-09-04 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.
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <iostream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Test handling of UTF-8 in wcout
+void test12()
+{
+ using namespace std;
+
+ bool test = true;
+ const char* name = "tmp_12";
+
+ locale loc(__gnu_test::try_named_locale("se_NO.UTF-8"));
+ locale::global(loc);
+ std::ios_base::sync_with_stdio(false);
+ wcout.imbue(loc);
+
+ const char cstr[] =
+ "\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf\x10\x11\x12\x13"
+ "\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&"
+ "'()*+,-./0123456789:;<=>?@}~\x7f\xc2\x80\xc2\x81\xc2\x82\xc2"
+ "\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a"
+ "\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2"
+ "\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99"
+ "\xc2\x9a\xc2\x9b\xc2\x9c\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3"
+ "\xbe\xc3\xbf\xc4\x80\xc4\x81\xc4\x82\xc4\x83\xc4\x84\xc4\x85"
+ "\xc4\x86\xc4\x87\xc4\x88\xc4\x89\xc4\x8a\xc4\x8b\xc4\x8c\xc4"
+ "\x8d\xc4\x8e\xc4\x8f\xc4\x90\xc4\x91\xc4\x92\xc4\x93\xc4\x94"
+ "\xc4\x95\xc4\x96\xc4\x97\xc4\x98\xc4\x99\xdf\xb8\xdf\xb9\xdf"
+ "\xba\xdf\xbb\xdf\xbc\xdf\xbd\xdf\xbe\xdf\xbf\xe0\xa0\x80\xe0"
+ "\xa0\x81\xe0\xa0\x82\xe0\xa0\x83\xe0\xa0\x84\xe0\xa0\x85\xe0"
+ "\xa0\x86\xe0\xa0\x87\xe0\xa0\x88\xe0\xa0\x89\xe0\xa0\x8a\xe0"
+ "\xa0\x8b\xe0\xa0\x8c\xe0\xa0\x8d\xe0\xa0\x8e\xe0\xa0\x8f\xe0"
+ "\xa0\x90\xe0\xa0\x91\xe0\xa0\x92\xe0\xa0\x93\xe0\xa0\x94\xe0"
+ "\xa0\x95\xe0\xa0\x96\xe0\xa0\x97\x1\x2\x4\x8\x10\x20@\xc2\x80"
+ "\xc4\x80\xc8\x80\xd0\x80\xe0\xa0\x80\xe1\x80\x80\xe2\x80\x80"
+ "\xe4\x80\x80\xe8\x80\x80\xf0\x90\x80\x80\xf0\xa0\x80\x80\xf1"
+ "\x80\x80\x80\xf2\x80\x80\x80\xf4\x80\x80\x80\xf8\x88\x80\x80"
+ "\x80\xf8\x90\x80\x80\x80\xf8\xa0\x80\x80\x80\xf9\x80\x80\x80"
+ "\x80\xfa\x80\x80\x80\x80\xfc\x84\x80\x80\x80\x80\xfc\x88\x80"
+ "\x80\x80\x80\xfc\x90\x80\x80\x80\x80\xfc\xa0\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80";
+
+ const wchar_t wstr[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, L'!',
+ L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+',
+ L',', L'-', L'.', L'/', L'0', L'1', L'2', L'3', L'4', L'5',
+ L'6', L'7', L'8', L'9', L':', L';', L'<', L'=', L'>', L'?',
+ L'@', L'}', L'~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
+ 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112,
+ 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x7f8, 0x7f9,
+ 0x7fa, 0x7fb, 0x7fc, 0x7fd, 0x7fe, 0x7ff, 0x800, 0x801, 0x802,
+ 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b,
+ 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814,
+ 0x815, 0x816, 0x817, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, L'@',
+ 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000,
+ 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
+ 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
+ 0x20000000, 0x40000000, 0x0
+ };
+
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ int fd = open(name,
+ O_WRONLY | O_CREAT | O_TRUNC,
+ 0666);
+ VERIFY( fd != -1 );
+ VERIFY( dup2(fd, 1) == 1 );
+ close(fd);
+
+ wcout.write(wstr, wlen);
+ wcout.flush();
+ VERIFY( wcout.good() );
+
+ FILE* file = fopen(name, "r");
+ char buf[clen + 10];
+ size_t n = fread(buf, 1, clen + 10, file);
+ VERIFY( n == clen );
+ VERIFY( !memcmp(buf, cstr, clen) );
+ fclose(file);
+}
+
+int main()
+{
+ test12();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/map_operators.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
index 47604deb4a8..dbdf1d12f7e 100644
--- a/libstdc++-v3/testsuite/23_containers/map_operators.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
@@ -1,6 +1,7 @@
-// 2000-09-07 bgarcia@laurelnetworks.com
+// Derived from libstdc++/12048 by LJR <ljrittle@acm.org> with
+// reminder from Petur Runolfsson <peturr02@ru.is>.
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// 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
@@ -18,32 +19,25 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 23.3.4 template class multiset
-
-#include <map>
-#include <string>
#include <iostream>
+#include <testsuite_hooks.h>
-// libstdc++/737
-// http://gcc.gnu.org/ml/libstdc++/2000-11/msg00093.html
-void test02()
+void
+test01()
{
- typedef std::map<int,const int> MapInt;
-
- MapInt m;
-
- for (unsigned i=0;i<10;++i)
- m.insert(MapInt::value_type(i,i));
-
- for (MapInt::const_iterator i = m.begin(); i != m.end(); ++i)
- std::cerr << i->second << ' ';
-
- for (MapInt::const_iterator i = m.begin(); m.end() != i; ++i)
- std::cerr << i->second << ' ';
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ wchar_t c1;
+ wchar_t c2;
+ std::wcin.get(c1);
+ std::wcin.unget();
+ std::wcin.get(c2);
+ VERIFY( std::wcin.good() );
+ VERIFY( c1 == c2 );
}
-int main()
+int main(void)
{
- test02();
+ test01();
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc
new file mode 100644
index 00000000000..f96302ad292
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc
@@ -0,0 +1,42 @@
+// 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 <iostream>
+#include <cstdio>
+#include <cwchar>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ wchar_t c1;
+ std::wint_t c2;
+ std::wcin.get(c1);
+ std::wcin.unget();
+ VERIFY( std::wcin.good() );
+ c2 = std::fgetwc(stdin);
+ VERIFY( c2 == std::char_traits<wchar_t>::to_int_type(c1) );
+}
+
+int main(void)
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/adaptors.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
index e0bd8618300..568b6a1409a 100644
--- a/libstdc++-v3/testsuite/23_containers/adaptors.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
@@ -1,6 +1,7 @@
-// 2002-06-28 pme
+// Derived from libstdc++/12048 by LJR <ljrittle@acm.org> with
+// reminder from Petur Runolfsson <peturr02@ru.is>.
-// Copyright (C) 2002 Free Software Foundation, Inc.
+// 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
@@ -18,62 +19,25 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 23.2.3 container adaptros
-
-#include <queue>
-#include <stack>
+#include <iostream>
+#include <cwchar>
#include <testsuite_hooks.h>
-// libstdc++/7157
void
test01()
{
- std::queue<int> q;
-
- q.push(1);
- q.front();
- q.pop();
-}
-
-
-// libstdc++/7158
-void
-test02()
-{
- std::stack<int> st;
-
- st.push(1);
- st.top() = 42;
- st.pop();
-}
-
-
-// libstdc++/7161
-void
-test03()
-{
- int data[] = {1, 2, 3};
- std::priority_queue<int> pq;
- std::size_t size = pq.size();
-
- for (int i = 0; i < 3; ++i)
- pq.push(data[i]);
-
- size = pq.size();
- pq.top();
- for (int i = 0; i < 2; ++i)
- pq.pop();
-
- while (!pq.empty())
- pq.pop();
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ wchar_t buf[2];
+ VERIFY( std::wcin.rdbuf()->sgetn(buf, 2) == 2 );
+ std::wint_t c1 = std::wcin.rdbuf()->sungetc();
+ std::wint_t c2 = std::wcin.rdbuf()->sbumpc();
+ VERIFY( c1 == std::char_traits<wchar_t>::to_int_type(buf[1]) );
+ VERIFY( c2 == c1 );
}
-
-int main()
+int main(void)
{
test01();
- test02();
- test03();
-
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc
new file mode 100644
index 00000000000..5096cd055e3
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc
@@ -0,0 +1,41 @@
+// 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 <iostream>
+#include <cstdio>
+#include <cwchar>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ wchar_t buf[2];
+ VERIFY( std::wcin.rdbuf()->sgetn(buf, 2) == 2 );
+ wint_t c1 = std::wcin.rdbuf()->sungetc();
+ wint_t c2 = std::fgetwc(stdin);
+ VERIFY( c1 == std::char_traits<wchar_t>::to_int_type(buf[1]) );
+ VERIFY( c2 == c1 );
+}
+
+int main(void)
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc
new file mode 100644
index 00000000000..bc965fd35f9
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc
@@ -0,0 +1,53 @@
+// 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.
+
+// DR 49 states that cin.rdbuf()->sbumpc() and fgetc(stdin) should be
+// equivalent and interchangable. Currently however, cin.rdbuf()->sungetc()
+// only returns characters that were read with cin.rdbuf()->sbumpc()
+
+// { dg-do run { xfail *-*-* } }
+
+#include <iostream>
+#include <cstdio>
+#include <cwchar>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::freopen("cin_unget-1.txt", "r", stdin);
+
+ wchar_t c1;
+ std::wint_t c2;
+ wchar_t c3;
+ std::wcin.get(c1);
+ c2 = std::fgetwc(stdin);
+ std::wcin.unget();
+ if (std::wcin.good())
+ {
+ std::wcin.get(c3);
+ VERIFY( std::wcin.good() );
+ VERIFY( c3 == std::char_traits<wchar_t>::to_char_type(c2) );
+ }
+}
+
+int main(void)
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc
new file mode 100644
index 00000000000..b974b4afb85
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc
@@ -0,0 +1,118 @@
+// 2003-09-04 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.
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <iostream>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+// Test handling of UTF-8 in wcin
+void test13()
+{
+ using namespace std;
+
+ bool test = true;
+ const char* name = "tmp_13";
+
+ locale loc(__gnu_test::try_named_locale("se_NO.UTF-8"));
+ locale::global(loc);
+ std::ios_base::sync_with_stdio(false);
+ wcin.imbue(loc);
+
+ const char cstr[] =
+ "\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf\x10\x11\x12\x13"
+ "\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20!\"#$%&"
+ "'()*+,-./0123456789:;<=>?@}~\x7f\xc2\x80\xc2\x81\xc2\x82\xc2"
+ "\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a"
+ "\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2"
+ "\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99"
+ "\xc2\x9a\xc2\x9b\xc2\x9c\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3"
+ "\xbe\xc3\xbf\xc4\x80\xc4\x81\xc4\x82\xc4\x83\xc4\x84\xc4\x85"
+ "\xc4\x86\xc4\x87\xc4\x88\xc4\x89\xc4\x8a\xc4\x8b\xc4\x8c\xc4"
+ "\x8d\xc4\x8e\xc4\x8f\xc4\x90\xc4\x91\xc4\x92\xc4\x93\xc4\x94"
+ "\xc4\x95\xc4\x96\xc4\x97\xc4\x98\xc4\x99\xdf\xb8\xdf\xb9\xdf"
+ "\xba\xdf\xbb\xdf\xbc\xdf\xbd\xdf\xbe\xdf\xbf\xe0\xa0\x80\xe0"
+ "\xa0\x81\xe0\xa0\x82\xe0\xa0\x83\xe0\xa0\x84\xe0\xa0\x85\xe0"
+ "\xa0\x86\xe0\xa0\x87\xe0\xa0\x88\xe0\xa0\x89\xe0\xa0\x8a\xe0"
+ "\xa0\x8b\xe0\xa0\x8c\xe0\xa0\x8d\xe0\xa0\x8e\xe0\xa0\x8f\xe0"
+ "\xa0\x90\xe0\xa0\x91\xe0\xa0\x92\xe0\xa0\x93\xe0\xa0\x94\xe0"
+ "\xa0\x95\xe0\xa0\x96\xe0\xa0\x97\x1\x2\x4\x8\x10\x20@\xc2\x80"
+ "\xc4\x80\xc8\x80\xd0\x80\xe0\xa0\x80\xe1\x80\x80\xe2\x80\x80"
+ "\xe4\x80\x80\xe8\x80\x80\xf0\x90\x80\x80\xf0\xa0\x80\x80\xf1"
+ "\x80\x80\x80\xf2\x80\x80\x80\xf4\x80\x80\x80\xf8\x88\x80\x80"
+ "\x80\xf8\x90\x80\x80\x80\xf8\xa0\x80\x80\x80\xf9\x80\x80\x80"
+ "\x80\xfa\x80\x80\x80\x80\xfc\x84\x80\x80\x80\x80\xfc\x88\x80"
+ "\x80\x80\x80\xfc\x90\x80\x80\x80\x80\xfc\xa0\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80";
+
+ const wchar_t wstr[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, L'!',
+ L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+',
+ L',', L'-', L'.', L'/', L'0', L'1', L'2', L'3', L'4', L'5',
+ L'6', L'7', L'8', L'9', L':', L';', L'<', L'=', L'>', L'?',
+ L'@', L'}', L'~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
+ 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100,
+ 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112,
+ 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x7f8, 0x7f9,
+ 0x7fa, 0x7fb, 0x7fc, 0x7fd, 0x7fe, 0x7ff, 0x800, 0x801, 0x802,
+ 0x803, 0x804, 0x805, 0x806, 0x807, 0x808, 0x809, 0x80a, 0x80b,
+ 0x80c, 0x80d, 0x80e, 0x80f, 0x810, 0x811, 0x812, 0x813, 0x814,
+ 0x815, 0x816, 0x817, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, L'@',
+ 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000,
+ 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
+ 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
+ 0x20000000, 0x40000000, 0x0
+ };
+
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ FILE* file = fopen(name, "w");
+ fwrite(cstr, 1, clen, file);
+ fclose(file);
+
+ int fd = open(name, O_RDONLY);
+ dup2(fd, 0);
+ close(fd);
+
+ wchar_t wbuf[wlen + 10];
+ wcin.read(wbuf, wlen + 10);
+ streamsize n = wcin.gcount();
+ VERIFY( n == wlen );
+ VERIFY( !wmemcmp(wbuf, wstr, wlen) );
+ VERIFY( wcin.eof() );
+ VERIFY( wcin.fail() );
+ VERIFY( !wcin.bad() );
+}
+
+int main()
+{
+ test13();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc
index 835282fe449..79d087840c5 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc
@@ -34,7 +34,7 @@ void test01()
putc(static_cast<unsigned char>(i), file);
fclose(file);
- locale loc (__gnu_cxx_test::try_named_locale("de_DE.ISO-8859-15@euro"));
+ locale loc (__gnu_test::try_named_locale("de_DE.ISO-8859-15@euro"));
locale::global(loc); // Set locale for stdin
freopen(name, "r", stdin);
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am
index bbe1fe5f45b..3a03189b7b8 100644
--- a/libstdc++-v3/testsuite/Makefile.am
+++ b/libstdc++-v3/testsuite/Makefile.am
@@ -21,28 +21,14 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-AUTOMAKE_OPTIONS = cygnus dejagnu
+AUTOMAKE_OPTIONS = dejagnu
-mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
-
-DEJATOOL = libstdc++-v3
-
-EXPECT = `if [ -f @glibcxx_builddir@/../../expect/expect ] ; then \
- echo @glibcxx_builddir@/../../expect/expect ; \
- else echo expect ; fi`
-
-RUNTEST = `if [ -f @glibcxx_srcdir@/../dejagnu/runtest ] ; then \
- echo @glibcxx_srcdir@/../dejagnu/runtest ; \
- else echo runtest; fi`
+include $(top_srcdir)/fragment.am
AM_MAKEFLAGS = -j1
AM_RUNTESTFLAGS =
-RUNTESTFLAGS =
-PWD_COMMAND = $${PWDCMD-pwd}
## CXX is actually a "C" compiler. These are real C++ programs.
-glibcxx_srcdir=@glibcxx_srcdir@
-glibcxx_builddir=@glibcxx_builddir@
testsuite_flags_script=${glibcxx_builddir}/scripts/testsuite_flags
CXX=`${testsuite_flags_script} --build-cxx`
@@ -51,13 +37,6 @@ CXXLINK = \
$(LIBTOOL) --tag=CXX --mode=link $(CXX) \
$(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-INCLUDES = \
- -nostdinc++ \
- @GLIBCXX_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@
-
# Generated lists of files to run. All of these names are valid make
# targets, if you wish to generate a list manually.
lists_of_files = \
@@ -73,7 +52,7 @@ libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
if GLIBCXX_TEST_ABI
noinst_PROGRAMS = abi_check
else
-noinst_PROGRAMS =
+noinst_PROGRAMS =
endif
abi_check_SOURCES = abi_check.cc
@@ -90,9 +69,8 @@ endif
# This is automatically run after the generated check-DEJAGNU rule.
check-local: check-abi
-baseline_dir = @baseline_dir@
baseline_file = ${baseline_dir}/baseline_symbols.txt
-extract_symvers = @glibcxx_srcdir@/scripts/extract_symvers
+extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
-@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
@@ -105,7 +83,7 @@ baseline_symbols:
exit 1; \
fi; true)
-new-abi-baseline:
+new-abi-baseline:
-@$(mkinstalldirs) ${baseline_dir}
-@(output=${baseline_file}; \
if test -f $${output}; then \
@@ -120,11 +98,11 @@ if GLIBCXX_TEST_ABI
# 'check-abi' to test for changes against that file.
check-abi: abi_check baseline_symbols current_symbols.txt
-@(./abi_check --check ./current_symbols.txt ${baseline_file} \
- 2>&1 | tee libstdc++-v3-abi.sum)
+ 2>&1 | tee libstdc++-abi.sum)
-check-abi-verbose: abi_check baseline_symbols current_symbols.txt
+check-abi-verbose: abi_check baseline_symbols current_symbols.txt
-@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
- 2>&1 | tee libstdc++-v3-abi.sum)
+ 2>&1 | tee libstdc++-abi.sum)
else
check-abi:
@@ -147,7 +125,7 @@ check-script-install: ${survey_script}
${survey_script} 0)
-# Runs the testsuite/performance tests.
+# Runs the testsuite/performance tests.
# Some of these tests create large (~75MB) files, allocate huge
# ammounts of memory, or otherwise tie up machine resources. Thus,
# running this is off by default.
@@ -168,4 +146,4 @@ check-script check-script-install check-performance
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
- testsuite_* site.exp abi_check baseline_symbols
+ testsuite_* site.exp abi_check baseline_symbols
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index 1752949b542..c44c29428d5 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/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,62 +12,40 @@
# 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 = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASIC_FILE_CC = @BASIC_FILE_CC@
BASIC_FILE_H = @BASIC_FILE_H@
@@ -74,6 +54,7 @@ CCODECVT_CC = @CCODECVT_CC@
CCODECVT_H = @CCODECVT_H@
CCOLLATE_CC = @CCOLLATE_CC@
CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
CLOCALE_CC = @CLOCALE_CC@
CLOCALE_H = @CLOCALE_H@
CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
@@ -82,106 +63,192 @@ CMESSAGES_H = @CMESSAGES_H@
CMONEY_CC = @CMONEY_CC@
CNUMERIC_CC = @CNUMERIC_CC@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CSTDIO_H = @CSTDIO_H@
CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
+CXX = `${testsuite_flags_script} --build-cxx`
CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FPOS_H = @FPOS_H@
FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
-GLIBCXX_IS_CROSS_COMPILING = @GLIBCXX_IS_CROSS_COMPILING@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE = @GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE@
+GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE = @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
+GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
+GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@
+GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@
+GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@
+GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBMATHOBJS = @LIBMATHOBJS@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
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@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
OS_INC_SRCDIR = @OS_INC_SRCDIR@
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@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+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_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
+baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
check_msgfmt = @check_msgfmt@
+datadir = @datadir@
enable_shared = @enable_shared@
enable_static = @enable_static@
-glibcxx_CXX = @glibcxx_CXX@
+exec_prefix = @exec_prefix@
glibcxx_MOFILES = @glibcxx_MOFILES@
glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
glibcxx_POFILES = @glibcxx_POFILES@
-glibcxx_basedir = @glibcxx_basedir@
+glibcxx_builddir = @glibcxx_builddir@
glibcxx_localedir = @glibcxx_localedir@
glibcxx_prefixdir = @glibcxx_prefixdir@
+glibcxx_srcdir = @glibcxx_srcdir@
glibcxx_thread_h = @glibcxx_thread_h@
glibcxx_toolexecdir = @glibcxx_toolexecdir@
glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
-ifGNUmake = @ifGNUmake@
+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@
libtool_VERSION = @libtool_VERSION@
+localstatedir = @localstatedir@
+mandir = @mandir@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
toplevel_srcdir = @toplevel_srcdir@
-AUTOMAKE_OPTIONS = cygnus dejagnu
+AUTOMAKE_OPTIONS = dejagnu
+
+MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
-DEJATOOL = libstdc++-v3
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
-EXPECT = `if [ -f @glibcxx_builddir@/../../expect/expect ] ; then echo @glibcxx_builddir@/../../expect/expect ; else echo expect ; fi`
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
+CONFIG_CXXFLAGS = \
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
+WARN_CXXFLAGS = \
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
-RUNTEST = `if [ -f @glibcxx_srcdir@/../dejagnu/runtest ] ; then echo @glibcxx_srcdir@/../dejagnu/runtest ; else echo runtest; fi`
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
AM_MAKEFLAGS = -j1
AM_RUNTESTFLAGS =
-RUNTESTFLAGS =
-PWD_COMMAND = $${PWDCMD-pwd}
-glibcxx_srcdir = @glibcxx_srcdir@
-glibcxx_builddir = @glibcxx_builddir@
testsuite_flags_script = ${glibcxx_builddir}/scripts/testsuite_flags
-CXX = `${testsuite_flags_script} --build-cxx`
-
-CXXLINK = LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcxx_builddir}/src/.libs $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
-
-GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-INCLUDES = -nostdinc++ @GLIBCXX_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@
+CXXLINK = \
+ LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcxx_builddir}/src/.libs\
+ $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
+ $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
# Generated lists of files to run. All of these names are valid make
# targets, if you wish to generate a list manually.
-lists_of_files = testsuite_files testsuite_files_interactive testsuite_files_performance
+lists_of_files = \
+ testsuite_files \
+ testsuite_files_interactive \
+ testsuite_files_performance
noinst_LIBRARIES = libv3test.a
libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
-@GLIBCXX_TEST_ABI_TRUE@noinst_PROGRAMS = abi_check
@GLIBCXX_TEST_ABI_FALSE@noinst_PROGRAMS =
+
+@GLIBCXX_TEST_ABI_TRUE@noinst_PROGRAMS = abi_check
abi_check_SOURCES = abi_check.cc
-baseline_dir = @baseline_dir@
baseline_file = ${baseline_dir}/baseline_symbols.txt
-extract_symvers = @glibcxx_srcdir@/scripts/extract_symvers
+extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
# These two special 'check-script' rules use the bash script
# 'check_survey' to do testing. This script is not as portable as the
@@ -190,101 +257,91 @@ extract_symvers = @glibcxx_srcdir@/scripts/extract_symvers
# items like compile time, execution time, and binary size.
survey_script = ${glibcxx_builddir}/scripts/check_survey
-# Runs the testsuite/performance tests.
+# Runs the testsuite/performance tests.
# Some of these tests create large (~75MB) files, allocate huge
# ammounts of memory, or otherwise tie up machine resources. Thus,
# running this is off by default.
performance_script = ${glibcxx_srcdir}/scripts/check_performance
# By adding these files here, automake will remove them for 'make clean'
-CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum testsuite_* site.exp abi_check baseline_symbols
+CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
+ testsuite_* site.exp abi_check baseline_symbols
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-libv3test_a_LIBADD =
-libv3test_a_OBJECTS = testsuite_hooks.$(OBJEXT) \
-testsuite_allocator.$(OBJEXT)
-@GLIBCXX_TEST_ABI_TRUE@noinst_PROGRAMS = abi_check$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-
-abi_check_OBJECTS = abi_check.$(OBJEXT)
+subdir = testsuite
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+libv3test_a_AR = $(AR) cru
+libv3test_a_LIBADD =
+am_libv3test_a_OBJECTS = testsuite_hooks.$(OBJEXT) \
+ testsuite_allocator.$(OBJEXT)
+libv3test_a_OBJECTS = $(am_libv3test_a_OBJECTS)
+@GLIBCXX_TEST_ABI_TRUE@noinst_PROGRAMS = abi_check$(EXEEXT)
+@GLIBCXX_TEST_ABI_FALSE@noinst_PROGRAMS =
+PROGRAMS = $(noinst_PROGRAMS)
+
+am_abi_check_OBJECTS = abi_check.$(OBJEXT)
+abi_check_OBJECTS = $(am_abi_check_OBJECTS)
abi_check_LDADD = $(LDADD)
-abi_check_DEPENDENCIES =
-abi_check_LDFLAGS =
-CXXFLAGS = @CXXFLAGS@
-CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+abi_check_DEPENDENCIES =
+abi_check_LDFLAGS =
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
-DIST_COMMON = Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP_ENV = --best
+DIST_SOURCES = $(libv3test_a_SOURCES) $(abi_check_SOURCES)
+DIST_COMMON = $(top_srcdir)/fragment.am Makefile.am Makefile.in
SOURCES = $(libv3test_a_SOURCES) $(abi_check_SOURCES)
-OBJECTS = $(libv3test_a_OBJECTS) $(abi_check_OBJECTS)
-
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .S .c .cc .lo .o .obj .s
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus testsuite/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+all: all-am
-mostlyclean-noinstLIBRARIES:
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/fragment.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign testsuite/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libv3test.a: $(libv3test_a_OBJECTS) $(libv3test_a_DEPENDENCIES)
+ -rm -f libv3test.a
+ $(libv3test_a_AR) libv3test.a $(libv3test_a_OBJECTS) $(libv3test_a_LIBADD)
+ $(RANLIB) libv3test.a
-distclean-noinstLIBRARIES:
-
-maintainer-clean-noinstLIBRARIES:
-
-.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 $<
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+abi_check$(EXEEXT): $(abi_check_OBJECTS) $(abi_check_DEPENDENCIES)
+ @rm -f abi_check$(EXEEXT)
+ $(CXXLINK) $(abi_check_LDFLAGS) $(abi_check_OBJECTS) $(abi_check_LDADD) $(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 $<
+.cc.o:
+ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.cc.obj:
+ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-.S.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.cc.lo:
+ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
mostlyclean-libtool:
-rm -f *.lo
@@ -293,140 +350,156 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
-maintainer-clean-libtool:
-
-libv3test.a: $(libv3test_a_OBJECTS) $(libv3test_a_DEPENDENCIES)
- -rm -f libv3test.a
- $(AR) cru libv3test.a $(libv3test_a_OBJECTS) $(libv3test_a_LIBADD)
- $(RANLIB) libv3test.a
-
-mostlyclean-noinstPROGRAMS:
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-distclean-noinstPROGRAMS:
-
-maintainer-clean-noinstPROGRAMS:
+ETAGS = etags
+ETAGSFLAGS =
-abi_check$(EXEEXT): $(abi_check_OBJECTS) $(abi_check_DEPENDENCIES)
- @rm -f abi_check$(EXEEXT)
- $(CXXLINK) $(abi_check_LDFLAGS) $(abi_check_OBJECTS) $(abi_check_LDADD) $(LIBS)
-.cc.o:
- $(CXXCOMPILE) -c $<
-.cc.obj:
- $(CXXCOMPILE) -c `cygpath -w $<`
-.cc.lo:
- $(LTCXXCOMPILE) -c $<
+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) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(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) $(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)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
-mostlyclean-tags:
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ 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; }'`; \
+ 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:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = testsuite
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
-
-RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+RUNTESTFLAGS =
+DEJATOOL = $(PACKAGE)
+RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
+EXPECT = expect
+RUNTEST = runtest
check-DEJAGNU: site.exp
- srcdir=`cd $(srcdir) && pwd`; export srcdir; \
+ srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
EXPECT=$(EXPECT); export EXPECT; \
- if [ -f $(top_builddir)/../expect/expect ]; then \
- TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
- export TCL_LIBRARY; \
- fi; \
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
- $$runtest $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+ l='$(DEJATOOL)'; for tool in $$l; do \
+ $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+ done; \
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
fi
site.exp: Makefile
@echo 'Making a new site.exp file...'
- @test ! -f site.bak || rm -f site.bak
- @echo '## these variables are automatically generated by make ##' > $@-t
- @echo '# Do not edit here. If you wish to override these values' >> $@-t
- @echo '# edit the last section' >> $@-t
- @echo 'set tool $(DEJATOOL)' >> $@-t
- @echo 'set srcdir $(srcdir)' >> $@-t
- @echo 'set objdir' `pwd` >> $@-t
- @echo 'set host_alias $(host_alias)' >> $@-t
- @echo 'set host_triplet $(host_triplet)' >> $@-t
- @echo 'set target_alias $(target_alias)' >> $@-t
- @echo 'set target_triplet $(target_triplet)' >> $@-t
- @echo 'set build_alias $(build_alias)' >> $@-t
- @echo 'set build_triplet $(build_triplet)' >> $@-t
- @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
- @test ! -f $(srcdir)/site.exp || sed '1,/^## All variables above are.*##/ d' $(srcdir)/site.exp >> $@-t
+ @echo '## these variables are automatically generated by make ##' >site.tmp
+ @echo '# Do not edit here. If you wish to override these values' >>site.tmp
+ @echo '# edit the last section' >>site.tmp
+ @echo 'set srcdir $(srcdir)' >>site.tmp
+ @echo "set objdir `pwd`" >>site.tmp
+ @echo 'set build_alias "$(build_alias)"' >>site.tmp
+ @echo 'set build_triplet $(build_triplet)' >>site.tmp
+ @echo 'set host_alias "$(host_alias)"' >>site.tmp
+ @echo 'set host_triplet $(host_triplet)' >>site.tmp
+ @echo 'set target_alias "$(target_alias)"' >>site.tmp
+ @echo 'set target_triplet $(target_triplet)' >>site.tmp
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
+ @test ! -f site.exp || \
+ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
+ @-rm -f site.bak
@test ! -f site.exp || mv site.exp site.bak
- @mv $@-t site.exp
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
-check-am:
+ @mv site.tmp site.exp
+
+distclean-DEJAGNU:
+ -rm -f site.exp site.bak
+ -l='$(DEJATOOL)'; for tool in $$l; do \
+ rm -f $$tool.sum $$tool.log; \
+ done
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ $(mkinstalldirs) $(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
+check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check-local
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
-install-exec-am:
-install-exec: install-exec-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) all-local
-install-data-am:
+installdirs:
+install: install-am
+install-exec: install-exec-am
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: uninstall-am
-all-am: Makefile $(LIBRARIES) $(PROGRAMS) all-local
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-
+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:
@@ -434,51 +507,69 @@ 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-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-libtool mostlyclean-noinstPROGRAMS \
- 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-libtool clean-noinstLIBRARIES \
+ clean-noinstPROGRAMS mostlyclean-am
-clean-am: clean-noinstLIBRARIES clean-compile clean-libtool \
- clean-noinstPROGRAMS clean-tags clean-generic \
- mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-DEJAGNU distclean-compile \
+ distclean-generic distclean-libtool distclean-tags
-distclean-am: distclean-noinstLIBRARIES distclean-compile \
- distclean-libtool distclean-noinstPROGRAMS \
- distclean-tags distclean-generic clean-am
- -rm -f libtool
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
- maintainer-clean-compile maintainer-clean-libtool \
- maintainer-clean-noinstPROGRAMS 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-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
-.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
-clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool mostlyclean-noinstPROGRAMS \
-distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir check-DEJAGNU info-am info \
-dvi-am dvi check-local check check-am installcheck-am installcheck \
-install-info-am install-info install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-local all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+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-info-am
+
+.PHONY: CTAGS GTAGS all all-am all-local check check-DEJAGNU check-am \
+ check-local clean clean-generic clean-libtool \
+ clean-noinstLIBRARIES clean-noinstPROGRAMS ctags distclean \
+ distclean-DEJAGNU distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am info \
+ info-am install install-am install-data install-data-am \
+ install-exec install-exec-am install-info install-info-am \
+ 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-info-am
all-local: stamp_wchar testsuite_files
@@ -502,7 +593,7 @@ baseline_symbols:
exit 1; \
fi; true)
-new-abi-baseline:
+new-abi-baseline:
-@$(mkinstalldirs) ${baseline_dir}
-@(output=${baseline_file}; \
if test -f $${output}; then \
@@ -516,11 +607,11 @@ new-abi-baseline:
# 'check-abi' to test for changes against that file.
@GLIBCXX_TEST_ABI_TRUE@check-abi: abi_check baseline_symbols current_symbols.txt
@GLIBCXX_TEST_ABI_TRUE@ -@(./abi_check --check ./current_symbols.txt ${baseline_file} \
-@GLIBCXX_TEST_ABI_TRUE@ 2>&1 | tee libstdc++-v3-abi.sum)
+@GLIBCXX_TEST_ABI_TRUE@ 2>&1 | tee libstdc++-abi.sum)
-@GLIBCXX_TEST_ABI_TRUE@check-abi-verbose: abi_check baseline_symbols current_symbols.txt
+@GLIBCXX_TEST_ABI_TRUE@check-abi-verbose: abi_check baseline_symbols current_symbols.txt
@GLIBCXX_TEST_ABI_TRUE@ -@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
-@GLIBCXX_TEST_ABI_TRUE@ 2>&1 | tee libstdc++-v3-abi.sum)
+@GLIBCXX_TEST_ABI_TRUE@ 2>&1 | tee libstdc++-abi.sum)
@GLIBCXX_TEST_ABI_FALSE@check-abi:
@GLIBCXX_TEST_ABI_FALSE@check-abi-verbose:
@@ -542,7 +633,6 @@ ${lists_of_files}:
.PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
check-script check-script-install check-performance
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libstdc++-v3/testsuite/data/cin_unget-1.txt b/libstdc++-v3/testsuite/data/cin_unget-1.txt
new file mode 100644
index 00000000000..81c545efebe
--- /dev/null
+++ b/libstdc++-v3/testsuite/data/cin_unget-1.txt
@@ -0,0 +1 @@
+1234
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/01.cc b/libstdc++-v3/testsuite/demangle/abi_examples/01.cc
index 8ce9ee3da4c..585cfe0435c 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/01.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/01.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// extern "C" function
// extern "C" float f(void) { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/02.cc b/libstdc++-v3/testsuite/demangle/abi_examples/02.cc
index 44558e1faed..ce33e53894a 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/02.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/02.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// or variable "f"
// int f;
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/03.cc b/libstdc++-v3/testsuite/demangle/abi_examples/03.cc
index f807189fb09..a33fe48e4f9 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/03.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/03.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// or a global namespace variable "f"
/*
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/04.cc b/libstdc++-v3/testsuite/demangle/abi_examples/04.cc
index 7705d8d7117..0c8e9da6cc9 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/04.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/04.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// void f() { };
// int f() { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/05.cc b/libstdc++-v3/testsuite/demangle/abi_examples/05.cc
index 927b7e11d49..673a773d115 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/05.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/05.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// void f(int) { };
// int f(int) { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/06.cc b/libstdc++-v3/testsuite/demangle/abi_examples/06.cc
index 47f07a3096f..a016170a866 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/06.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/06.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// class bar { };
// void foo(bar) { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/07.cc b/libstdc++-v3/testsuite/demangle/abi_examples/07.cc
index e73c3dd5b93..b6943f222c3 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/07.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/07.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// class X { };
// int operator%(X, X) { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/08.cc b/libstdc++-v3/testsuite/demangle/abi_examples/08.cc
index 74394dc00bd..66b8dcb3e1c 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/08.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/08.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// int operator+(X&, X&) { };
verify_demangle("_ZplR1XS0_", "operator+(X&, X&)"); // XXX
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/09.cc b/libstdc++-v3/testsuite/demangle/abi_examples/09.cc
index 8e56b104ab2..c014936f3ca 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/09.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/09.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// int operator<< (X const&, X const&) { };
verify_demangle("_ZlsRK1XS1_", "operator<<(X const&, X const&)");
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/10.cc b/libstdc++-v3/testsuite/demangle/abi_examples/10.cc
index 597e83bbae8..fc422a7cd04 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/10.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/10.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
template<typename T>
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/11.cc b/libstdc++-v3/testsuite/demangle/abi_examples/11.cc
index 7201afbee55..abf547cc7bb 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/11.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/11.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// template<typename T> void f(int) { }
// template void f<int>(int);
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/12.cc b/libstdc++-v3/testsuite/demangle/abi_examples/12.cc
index c0c31a21f59..f0460fa4096 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/12.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/12.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
class Duo { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/13.cc b/libstdc++-v3/testsuite/demangle/abi_examples/13.cc
index 43aae1f34b3..79240561a1c 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/13.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/13.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
class Duo { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/14.cc b/libstdc++-v3/testsuite/demangle/abi_examples/14.cc
index 4bb70f643e0..26cf382374f 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/14.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/14.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
typedef void fun(double);
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/15.cc b/libstdc++-v3/testsuite/demangle/abi_examples/15.cc
index b79f1cc859e..0adb9a20a23 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/15.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/15.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
namespace N
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/16.cc b/libstdc++-v3/testsuite/demangle/abi_examples/16.cc
index 5afc643a304..c13cf6cbc05 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/16.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/16.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
namespace System
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/17.cc b/libstdc++-v3/testsuite/demangle/abi_examples/17.cc
index e9ce1058673..dd9bc7815f2 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/17.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/17.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
namespace Arena
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/18.cc b/libstdc++-v3/testsuite/demangle/abi_examples/18.cc
index 847568ca89c..3989da573b6 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/18.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/18.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
template<typename T1, typename T2> struct Stack
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/19.cc b/libstdc++-v3/testsuite/demangle/abi_examples/19.cc
index f70a389f5bc..21d18342bf3 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/19.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/19.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_Z1fI1XEvPVN1AIT_E1TE", "void f<X>(A<X>::T volatile*)");
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/20.cc b/libstdc++-v3/testsuite/demangle/abi_examples/20.cc
index 99517157437..a528b4318a6 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/20.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/20.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_ZngILi42EEvN1AIXplT_Li2EEE1TE",
"void operator-<42>(A<(42) + (2)>::T)");
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/21.cc b/libstdc++-v3/testsuite/demangle/abi_examples/21.cc
index debeb790fd2..ad186115596 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/21.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/21.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_Z4makeI7FactoryiET_IT0_Ev",
"Factory<int> make<Factory, int>()");
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/22.cc b/libstdc++-v3/testsuite/demangle/abi_examples/22.cc
index debeb790fd2..ad186115596 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/22.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/22.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_Z4makeI7FactoryiET_IT0_Ev",
"Factory<int> make<Factory, int>()");
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/23.cc b/libstdc++-v3/testsuite/demangle/abi_examples/23.cc
index 02f55a8cffc..4e3961afd08 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/23.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/23.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_Z3foo5Hello5WorldS0_S_",
"foo(Hello, World, World, Hello)");
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/24.cc b/libstdc++-v3/testsuite/demangle/abi_examples/24.cc
index e200574e873..888d5eb1729 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/24.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/24.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_Z3fooPM2ABi", "foo(int AB::**)");
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/25.cc b/libstdc++-v3/testsuite/demangle/abi_examples/25.cc
index 04ba05bad96..3bb2b3f19fe 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/25.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/25.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// Equivalent
// uncompressed, cp-dem
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/26.cc b/libstdc++-v3/testsuite/demangle/abi_examples/26.cc
index 075a80515cb..6f7f83e589c 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/26.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/26.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_ZTI7a_class", "typeinfo for a_class");
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/01.cc b/libstdc++-v3/testsuite/demangle/abi_text/01.cc
index f26ec7c615e..33cfd01ac0b 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/01.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/01.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// 5.1.5 Type encodings.
// int* volatile const restrict _far p;
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/02.cc b/libstdc++-v3/testsuite/demangle/abi_text/02.cc
index 210ad98e687..aedf031c6b9 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/02.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/02.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// template<int I> void foo (int (&)[I + 1]) { };
// template void foo<2> (int (&)[3]);
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/03.cc b/libstdc++-v3/testsuite/demangle/abi_text/03.cc
index 678fd287244..c880ae12b50 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/03.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/03.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// struct A;
// void f (void (A::*)() const) {}
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/04.cc b/libstdc++-v3/testsuite/demangle/abi_text/04.cc
index 66f739fffc2..2a7c8f6a2be 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/04.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/04.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// void foo(char);
verify_demangle("_Z3fooc", "foo(char)");
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/05.cc b/libstdc++-v3/testsuite/demangle/abi_text/05.cc
index ddada2cdbb3..4dec5d3b8eb 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/05.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/05.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// void foo(char);
// template<void (&)(char)> struct CB { };
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/06.cc b/libstdc++-v3/testsuite/demangle/abi_text/06.cc
index 01b09b407c6..1dc2d4f804c 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/06.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/06.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// extern "C" bool IsEmpty(char *);
// template<void (&)(char *)> struct CB;
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/07.cc b/libstdc++-v3/testsuite/demangle/abi_text/07.cc
index 2005dde6baf..3502e2ea629 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/07.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/07.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// 5.1.6 Scope Encoding
/*
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/08.cc b/libstdc++-v3/testsuite/demangle/abi_text/08.cc
index f85ef438429..00398478fb2 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/08.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/08.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// encoding of N::f::"Itanium C++ ABI" (no discriminator)
verify_demangle("_ZZN1N1fEiEs", "N::f(int)::string literal");
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/09.cc b/libstdc++-v3/testsuite/demangle/abi_text/09.cc
index 66f03076f2a..97b2c64a286 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/09.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/09.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// encoding of N::f::X::g()
// (third local mangled entity used as a class-qualifier)
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/10.cc b/libstdc++-v3/testsuite/demangle/abi_text/10.cc
index 82f7392b23e..de44769d85f 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/10.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/10.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_ZNZN1N1fEiE1X1gEv",
"error code = -2: invalid mangled name");
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/11.cc b/libstdc++-v3/testsuite/demangle/abi_text/11.cc
index 7eed78762bf..aa349f578c8 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/11.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/11.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// 5.1.7 Compression.
// typedef void T();
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/12.cc b/libstdc++-v3/testsuite/demangle/abi_text/12.cc
index 25c92c54daf..d19317ce03a 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/12.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/12.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// N::T<int, int>::mf(N::T<double, double>)
verify_demangle("_ZN1N1TIiiE2mfES0_IddE",
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/13.cc b/libstdc++-v3/testsuite/demangle/abi_text/13.cc
index 63a64e0d47d..da765f078c0 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/13.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/13.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// std::state
verify_demangle("_ZSt5state", "std::state");
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/14.cc b/libstdc++-v3/testsuite/demangle/abi_text/14.cc
index 358c6e1a633..9cd854a8771 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/14.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/14.cc
@@ -26,7 +26,7 @@
// http://www.codesourcery.com/cxx-abi/abi.html#mangling
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// std::_In::ward
verify_demangle("_ZNSt3_In4wardE", "std::_In::ward");
diff --git a/libstdc++-v3/testsuite/demangle/regression/3111-1.cc b/libstdc++-v3/testsuite/demangle/regression/3111-1.cc
index 6e7d702c289..38a27ece499 100644
--- a/libstdc++-v3/testsuite/demangle/regression/3111-1.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/3111-1.cc
@@ -25,7 +25,7 @@
// c++/3111
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_Z1fKPFiiE", "f(int (* const)(int))");
diff --git a/libstdc++-v3/testsuite/demangle/regression/3111-2.cc b/libstdc++-v3/testsuite/demangle/regression/3111-2.cc
index fe6ceb3abed..8897c5069a1 100644
--- a/libstdc++-v3/testsuite/demangle/regression/3111-2.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/3111-2.cc
@@ -25,7 +25,7 @@
// c++/3111
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
// icc FAIL
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-01.cc b/libstdc++-v3/testsuite/demangle/regression/7986-01.cc
index f05f097fe2f..e864957db39 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-01.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-01.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z1fA37_iPS_", "f(int[37], int (*) [37])");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-02.cc b/libstdc++-v3/testsuite/demangle/regression/7986-02.cc
index ae9d945cb01..7a10b0fd982 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-02.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-02.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// Equivalent, but formatting difference in void argument.
// verify_demangle("_Z1fM1AFivEPS0_", "f(int (A::*)(void), int (*)(void))");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-03.cc b/libstdc++-v3/testsuite/demangle/regression/7986-03.cc
index 2596f9aa161..02fc75b3e74 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-03.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-03.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z1fPFPA1_ivE", "f(int (*(*)()) [1])");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-04.cc b/libstdc++-v3/testsuite/demangle/regression/7986-04.cc
index 23d1f1f9cd6..5c4acbf1b22 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-04.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-04.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z1fPKM1AFivE", "f(int (A::* const*)())");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-05.cc b/libstdc++-v3/testsuite/demangle/regression/7986-05.cc
index b3393c903ff..e1216fc6376 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-05.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-05.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z1jM1AFivEPS1_", "j(int (A::*)(), int (A::**)())");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-06.cc b/libstdc++-v3/testsuite/demangle/regression/7986-06.cc
index 360c70c1cfe..12c0d8b08e6 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-06.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-06.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z1sPA37_iPS0_", "s(int (*) [37], int (**) [37])");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-07.cc b/libstdc++-v3/testsuite/demangle/regression/7986-07.cc
index 933c4c61e42..6a4dfb05024 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-07.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-07.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z3fooA30_A_i", "foo(int[30][])");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-08.cc b/libstdc++-v3/testsuite/demangle/regression/7986-08.cc
index 20800856518..a6a01cc32d5 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-08.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-08.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z3kooPA28_A30_i", "koo(int (*) [28][30])");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-09.cc b/libstdc++-v3/testsuite/demangle/regression/7986-09.cc
index 18a18b35c54..aef3ae2f6df 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-09.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-09.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
// Equivalent as considered order-insensitive?
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-10.cc b/libstdc++-v3/testsuite/demangle/regression/7986-10.cc
index ff7fa4c3a6c..9833b7233db 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-10.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-10.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("_ZlsRKU3fooU4bart1XS2_",
"operator<<(X bart foo const&, X bart foo const)");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-11.cc b/libstdc++-v3/testsuite/demangle/regression/7986-11.cc
index 49114d2c8ac..d2076ac58e3 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-11.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-11.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z1fM1AKFivE", "f(int (A::*)() const)");
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-12.cc b/libstdc++-v3/testsuite/demangle/regression/7986-12.cc
index 64a400f781f..97e76cc9af7 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-12.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-12.cc
@@ -25,7 +25,7 @@
// libstdc++/7986
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// ICE on figmative float template parameters?
/*
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986.cc b/libstdc++-v3/testsuite/demangle/regression/7986.cc
index 05fa6a71c29..42f2139089b 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
return 0;
diff --git a/libstdc++-v3/testsuite/demangle/regression/8897.cc b/libstdc++-v3/testsuite/demangle/regression/8897.cc
index f40b90f30f6..ed68f33314d 100644
--- a/libstdc++-v3/testsuite/demangle/regression/8897.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/8897.cc
@@ -25,7 +25,7 @@
// c++/8897
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
template<typename T1>
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-01.cc b/libstdc++-v3/testsuite/demangle/regression/cw-01.cc
index cda35f6a808..3a8dbc2e8e0 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-01.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-01.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
class libcw_app_ct {
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-02.cc b/libstdc++-v3/testsuite/demangle/regression/cw-02.cc
index 7c0d613bee3..51f3807b186 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-02.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-02.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
namespace libcw {
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-03.cc b/libstdc++-v3/testsuite/demangle/regression/cw-03.cc
index 0ab62327e4e..ca846b9bc7e 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-03.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-03.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
namespace libcw {
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-04.cc b/libstdc++-v3/testsuite/demangle/regression/cw-04.cc
index d2a7c09cdbc..27eb55854af 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-04.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-04.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-05.cc b/libstdc++-v3/testsuite/demangle/regression/cw-05.cc
index e56c834aeb5..5c9e25f4a50 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-05.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-05.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
struct memory_block_st { };
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-06.cc b/libstdc++-v3/testsuite/demangle/regression/cw-06.cc
index 5c22d177d9b..943a7163732 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-06.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-06.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
struct option { };
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-07.cc b/libstdc++-v3/testsuite/demangle/regression/cw-07.cc
index 25f3661fe50..a34e6f87ffe 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-07.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-07.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-08.cc b/libstdc++-v3/testsuite/demangle/regression/cw-08.cc
index 25280a5151c..5bd2cf2892a 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-08.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-08.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
class A { };
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-09.cc b/libstdc++-v3/testsuite/demangle/regression/cw-09.cc
index 0ad38f1d291..3da7fe861c0 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-09.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-09.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-10.cc b/libstdc++-v3/testsuite/demangle/regression/cw-10.cc
index ab0da2af05f..c4efcd30bf1 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-10.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-10.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-11.cc b/libstdc++-v3/testsuite/demangle/regression/cw-11.cc
index d763e8c56af..e5405b2f6e9 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-11.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-11.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem CORE
verify_demangle("_X11TransParseAddress", "_X11TransParseAddress");
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-12.cc b/libstdc++-v3/testsuite/demangle/regression/cw-12.cc
index cb6a40ee548..8838a8a1c2b 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-12.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-12.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
namespace std {
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-13.cc b/libstdc++-v3/testsuite/demangle/regression/cw-13.cc
index 8fe07fd44a6..ec883be1de3 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-13.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-13.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
// cplus-dem CORE
verify_demangle("_GLOBAL__I__Z2fnv", "global constructors keyed to fn()");
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-14.cc b/libstdc++-v3/testsuite/demangle/regression/cw-14.cc
index 613c0c8b32c..84b6532d372 100644
--- a/libstdc++-v3/testsuite/demangle/regression/cw-14.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-14.cc
@@ -25,7 +25,7 @@
// libcwd tests
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
/*
struct G {
diff --git a/libstdc++-v3/testsuite/demangle/regression/old.cc b/libstdc++-v3/testsuite/demangle/regression/old.cc
index 7bb8484d78c..d9313f9fd45 100644
--- a/libstdc++-v3/testsuite/demangle/regression/old.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/old.cc
@@ -25,7 +25,7 @@
// old libiberty tests for gnu-v3
int main()
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
verify_demangle("St9bad_alloc", "std::bad_alloc");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/pod_char_traits.cc b/libstdc++-v3/testsuite/ext/pod_char_traits.cc
index c3c4eee2594..0a6934830d7 100644
--- a/libstdc++-v3/testsuite/ext/pod_char_traits.cc
+++ b/libstdc++-v3/testsuite/ext/pod_char_traits.cc
@@ -34,13 +34,12 @@
int main()
{
- using namespace std;
using namespace __gnu_cxx;
typedef unsigned short value_type;
typedef unsigned int int_type;
typedef character<value_type, int_type> char_type;
- typedef char_traits<char_type> traits_type;
+ typedef std::char_traits<char_type> traits_type;
bool test = true;
@@ -55,7 +54,7 @@ int main()
test = traits_type::eq(c1, c2);
// 3 basic_string<char_type>
- typedef basic_string<char_type> string_type;
+ typedef std::basic_string<char_type> string_type;
string_type str;
char_type c3 = { value_type('b') };
char_type c4 = { value_type('o') };
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf.cc
index ec3481562a0..8b313b3f31f 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_filebuf.cc
@@ -29,7 +29,7 @@
namespace test
{
using namespace std;
- using __gnu_cxx_test::pod_char;
+ 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> >;
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc
index cffcf37590f..095829621fb 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc
@@ -52,13 +52,89 @@ void test01()
VERIFY( sbuf.sgetn(buf, 5) == 5 );
VERIFY( !memcmp(buf, c_lit + 3, 5) );
VERIFY( getc(fin) == c_lit[8] );
- VERIFY( sbuf.sungetc() == EOF );
fclose(fin);
}
+// libstdc++/12048
+void test02()
+{
+ bool test = 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 = 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 = 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 = 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
index a8cde4abda1..25276a2d677 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc
@@ -53,13 +53,89 @@ void test01()
VERIFY( wsbuf.sgetn(buf, 5) == 5 );
VERIFY( !wmemcmp(buf, w_lit + 3, 5) );
VERIFY( getwc(fin) == w_lit[8] );
- VERIFY( wsbuf.sungetc() == WEOF );
fclose(fin);
}
+// libstdc++/12048
+void test02()
+{
+ bool test = 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 = 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 = 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 = 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++-v3-dg.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index c7e2a9b909d..133acec63b2 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -14,30 +14,30 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# Define libstdc++-v3 callbacks for dg.exp.
+# Define callbacks for dg.exp. This file is loaded early.
load_lib dg.exp
load_lib libgloss.exp
load_lib prune.exp
-# Called once, by libstdc++-v3-init below. "Static" to this file.
-proc libstdc++-v3-copy-files {srcfiles dstdir} {
+# Called by v3-init below. "Static" to this file.
+proc v3-copy-files {srcfiles dstdir} {
foreach f $srcfiles {
- if { [catch { set symlink [file readlink $f] } x] } then {
- file copy -force $f $dstdir
- } else {
- if { [regexp "^/" "$symlink"] } then {
- file copy -force $symlink $dstdir
- } else {
- set dirname [file dirname $f]
- file copy -force $dirname/$symlink $dstdir
- }
- }
+ if { [catch { set symlink [file readlink $f] } x] } then {
+ file copy -force $f $dstdir
+ } else {
+ if { [regexp "^/" "$symlink"] } then {
+ file copy -force $symlink $dstdir
+ } else {
+ set dirname [file dirname $f]
+ file copy -force $dirname/$symlink $dstdir
+ }
+ }
}
}
-# Called once, from libstdc++-v3.dg/dg.exp.
-proc libstdc++-v3-init { args } {
+# Called once, from libstdc++/dg.exp.
+proc v3-init { args } {
global srcdir
global outdir
global blddir
@@ -56,15 +56,15 @@ proc libstdc++-v3-init { args } {
set dg-do-what-default run
# Copy any required data files.
- libstdc++-v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"] $outdir
- libstdc++-v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"] $outdir
+ 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
# SHLIB_EXT on different platforms
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} {
- set gccdir [file dirname $gccdir]
+ set gccdir [file dirname $gccdir]
}
set ld_library_path "."
@@ -72,15 +72,15 @@ proc libstdc++-v3-init { args } {
set compiler ${gccdir}/g++
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
- set mldir ""
- regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
- set mldir [string trimright $mldir "\;@"]
- if { "$mldir" == "." } {
- continue
- }
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] == 1 } {
- append ld_library_path ":${gccdir}/${mldir}"
- }
+ set mldir ""
+ regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
+ set mldir [string trimright $mldir "\;@"]
+ if { "$mldir" == "." } {
+ continue
+ }
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] == 1 } {
+ append ld_library_path ":${gccdir}/${mldir}"
+ }
}
}
append ld_library_path ":${blddir}/src/.libs"
@@ -107,7 +107,7 @@ proc libstdc++-v3-init { args } {
return "untested"
}
set cxx [transform "g++"]
- set cxxflags "-ggdb3 -DDEBUG_ASSERT"
+ set cxxflags "-ggdb3 -D_GLIBCXX_ASSERT"
set includes "-I./"
} else {
# If we find a testsuite_flags file, we're testing in the build dir.
@@ -118,7 +118,7 @@ proc libstdc++-v3-init { args } {
set includes [exec sh $flags_file --build-includes]
} else {
set cxx [transform "g++"]
- set cxxflags "-ggdb3 -DDEBUG_ASSERT"
+ set cxxflags "-ggdb3 -D_GLIBCXX_ASSERT"
set includes "-I${srcdir}"
}
}
@@ -137,55 +137,55 @@ proc libstdc++-v3-init { args } {
}
# Callback from system dg-test.
-proc libstdc++-v3-dg-test { prog do_what extra_tool_flags } {
+proc libstdc++-dg-test { prog do_what extra_tool_flags } {
# Set up the compiler flags, based on what we're going to do.
switch $do_what {
- "preprocess" {
- set compile_type "preprocess"
- set output_file "[file rootname [file tail $prog]].i"
- }
- "compile" {
- set compile_type "assembly"
- set output_file "[file rootname [file tail $prog]].s"
- }
- "assemble" {
- set compile_type "object"
- set output_file "[file rootname [file tail $prog]].o"
- }
- "link" {
- set compile_type "executable"
- set output_file "./[file rootname [file tail $prog]].exe"
- }
- "run" {
- set compile_type "executable"
- # FIXME: "./" is to cope with "." not being in $PATH.
- # Should this be handled elsewhere?
- # YES.
- set output_file "./[file rootname [file tail $prog]].exe"
- # This is the only place where we care if an executable was
- # created or not. If it was, dg.exp will try to run it.
- remote_file build delete $output_file;
- }
- default {
- perror "$do_what: not a valid dg-do keyword"
- return ""
- }
+ "preprocess" {
+ set compile_type "preprocess"
+ set output_file "[file rootname [file tail $prog]].i"
+ }
+ "compile" {
+ set compile_type "assembly"
+ set output_file "[file rootname [file tail $prog]].s"
+ }
+ "assemble" {
+ set compile_type "object"
+ set output_file "[file rootname [file tail $prog]].o"
+ }
+ "link" {
+ set compile_type "executable"
+ set output_file "./[file rootname [file tail $prog]].exe"
+ }
+ "run" {
+ set compile_type "executable"
+ # FIXME: "./" is to cope with "." not being in $PATH.
+ # Should this be handled elsewhere?
+ # YES.
+ set output_file "./[file rootname [file tail $prog]].exe"
+ # This is the only place where we care if an executable was
+ # created or not. If it was, dg.exp will try to run it.
+ remote_file build delete $output_file;
+ }
+ default {
+ perror "$do_what: not a valid dg-do keyword"
+ return ""
+ }
}
set options ""
if { $extra_tool_flags != "" } {
- lappend options "additional_flags=$extra_tool_flags"
+ lappend options "additional_flags=$extra_tool_flags"
}
- set comp_output [libstdc++-v3_target_compile "$prog" "$output_file" "$compile_type" $options];
+ set comp_output [v3_target_compile "$prog" "$output_file" "$compile_type" $options];
set comp_output [ prune_g++_output $comp_output ];
return [list $comp_output $output_file]
}
-# Called from libstdc++-v3-dg-test above. Calls back into system's
+# Called from libstdc++-dg-test above. Calls back into system's
# target_compile to actually do the work.
-proc libstdc++-v3_target_compile { source dest type options } {
+proc v3_target_compile { source dest type options } {
global gluefile
global wrap_flags
global cxx
@@ -194,8 +194,8 @@ proc libstdc++-v3_target_compile { source dest type options } {
global blddir
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
- lappend options "libs=${gluefile}"
- lappend options "ldflags=${wrap_flags}"
+ lappend options "libs=${gluefile}"
+ lappend options "ldflags=${wrap_flags}"
}
set cxx_final $cxx
@@ -215,7 +215,7 @@ proc libstdc++-v3_target_compile { source dest type options } {
}
-# Called once, from libstdc++-v3.dg/dg.exp.
+# Called once, from libstdc++*/dg.exp.
proc v3-list-tests { filename } {
global srcdir
global outdir
@@ -225,16 +225,16 @@ proc v3-list-tests { filename } {
# If there is a testsuite_file, use it.
if { [file exists $tests_file] } {
- set f [open $tests_file]
- while { ! [eof $f] } {
- set t [gets $f]
- if { [string length "$t"] != 0 } {
- lappend sfiles ${srcdir}/${t}
- }
- }
- close $f
+ set f [open $tests_file]
+ while { ! [eof $f] } {
+ set t [gets $f]
+ if { [string length "$t"] != 0 } {
+ lappend sfiles ${srcdir}/${t}
+ }
+ }
+ close $f
} else {
- verbose "cannot open $tests_file"
+ verbose "cannot open $tests_file"
}
return $sfiles
}
diff --git a/libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp b/libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp
deleted file mode 100644
index 00420992093..00000000000
--- a/libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp
+++ /dev/null
@@ -1,37 +0,0 @@
-# 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 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# libstdc++-v3 testsuite that uses the 'dg.exp' driver.
-
-# Load support procs.
-load_lib libstdc++-v3-dg.exp
-
-# If a testcase doesn't have special options, use these.
-global DEFAULT_CXXFLAGS
-if ![info exists DEFAULT_CXXFLAGS] then {
- set DEFAULT_CXXFLAGS "-DDEBUG_ASSERT"
-}
-
-# Initialize 'dg' last or dejagnu exits with an error...
-dg-init
-libstdc++-v3-init
-
-# Main loop.
-dg-runtest [v3-list-tests testsuite_files] "" $DEFAULT_CXXFLAGS
-#dg-runtest [v3-list-tests testsuite_files_interactive] "" $DEFAULT_CXXFLAGS
-
-# All done.
-dg-finish
diff --git a/libstdc++-v3/testsuite/performance/allocator.cc b/libstdc++-v3/testsuite/performance/allocator.cc
index 42997e952ca..4cd615e1a83 100644
--- a/libstdc++-v3/testsuite/performance/allocator.cc
+++ b/libstdc++-v3/testsuite/performance/allocator.cc
@@ -189,7 +189,7 @@ test_ints_mt_alloc(int iterations)
// http://gcc.gnu.org/ml/libstdc++/2003-05/msg00231.html
int main(void)
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/complex_norm.cc b/libstdc++-v3/testsuite/performance/complex_norm.cc
index 952e727ba56..6ed280c306a 100644
--- a/libstdc++-v3/testsuite/performance/complex_norm.cc
+++ b/libstdc++-v3/testsuite/performance/complex_norm.cc
@@ -32,7 +32,7 @@
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/cout_insert_int.cc b/libstdc++-v3/testsuite/performance/cout_insert_int.cc
index 66f15df032b..87b1871a7b1 100644
--- a/libstdc++-v3/testsuite/performance/cout_insert_int.cc
+++ b/libstdc++-v3/testsuite/performance/cout_insert_int.cc
@@ -32,7 +32,7 @@
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/filebuf_copy.cc b/libstdc++-v3/testsuite/performance/filebuf_copy.cc
index f393b92c0a3..608ca2933fa 100644
--- a/libstdc++-v3/testsuite/performance/filebuf_copy.cc
+++ b/libstdc++-v3/testsuite/performance/filebuf_copy.cc
@@ -32,7 +32,7 @@
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/filebuf_sputc.cc b/libstdc++-v3/testsuite/performance/filebuf_sputc.cc
index cdf030d0fba..c286da0202d 100644
--- a/libstdc++-v3/testsuite/performance/filebuf_sputc.cc
+++ b/libstdc++-v3/testsuite/performance/filebuf_sputc.cc
@@ -33,7 +33,7 @@
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/fstream_seek_write.cc b/libstdc++-v3/testsuite/performance/fstream_seek_write.cc
index 6c56c27a76b..838eae40245 100644
--- a/libstdc++-v3/testsuite/performance/fstream_seek_write.cc
+++ b/libstdc++-v3/testsuite/performance/fstream_seek_write.cc
@@ -32,7 +32,7 @@
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/ifstream_getline.cc b/libstdc++-v3/testsuite/performance/ifstream_getline.cc
index b7ca9976078..5f745732a18 100644
--- a/libstdc++-v3/testsuite/performance/ifstream_getline.cc
+++ b/libstdc++-v3/testsuite/performance/ifstream_getline.cc
@@ -32,7 +32,7 @@
int main ()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc b/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc
index 6b3afa5e6cd..ee3ff3369d6 100644
--- a/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc
+++ b/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc
@@ -39,7 +39,7 @@ static void create_and_fill_and_sort(const unsigned int n)
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/map_create_fill.cc b/libstdc++-v3/testsuite/performance/map_create_fill.cc
index 5c3698ba383..b2f52554143 100644
--- a/libstdc++-v3/testsuite/performance/map_create_fill.cc
+++ b/libstdc++-v3/testsuite/performance/map_create_fill.cc
@@ -37,7 +37,7 @@ static void create_and_fill(const unsigned int n)
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc b/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc
index 910291a4e01..6e510416602 100644
--- a/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc
+++ b/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc
@@ -32,7 +32,7 @@
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc b/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc
index c2e591a0f22..83fbeb835b0 100644
--- a/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc
+++ b/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc
@@ -32,7 +32,7 @@
int main()
{
using namespace std;
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
diff --git a/libstdc++-v3/testsuite/performance/string_append.cc b/libstdc++-v3/testsuite/performance/string_append.cc
index c07c3af0699..846d424c65c 100644
--- a/libstdc++-v3/testsuite/performance/string_append.cc
+++ b/libstdc++-v3/testsuite/performance/string_append.cc
@@ -52,7 +52,7 @@ test_append_string(int how_much)
void
run_benchmark1(int how_much)
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
start_counters(time, resource);
@@ -64,7 +64,7 @@ run_benchmark1(int how_much)
void
run_benchmark2(int how_much)
{
- using namespace __gnu_cxx_test;
+ using namespace __gnu_test;
time_counter time;
resource_counter resource;
start_counters(time, resource);
diff --git a/libstdc++-v3/testsuite/testsuite_allocator.cc b/libstdc++-v3/testsuite/testsuite_allocator.cc
index 775b2535026..a98e38884d3 100644
--- a/libstdc++-v3/testsuite/testsuite_allocator.cc
+++ b/libstdc++-v3/testsuite/testsuite_allocator.cc
@@ -30,7 +30,7 @@
#include <testsuite_allocator.h>
-namespace __gnu_cxx_test
+namespace __gnu_test
{
allocation_tracker::size_type allocation_tracker::allocationTotal_ = 0;
allocation_tracker::size_type allocation_tracker::deallocationTotal_ = 0;
diff --git a/libstdc++-v3/testsuite/testsuite_allocator.h b/libstdc++-v3/testsuite/testsuite_allocator.h
index 675830eca97..866fe7cce18 100644
--- a/libstdc++-v3/testsuite/testsuite_allocator.h
+++ b/libstdc++-v3/testsuite/testsuite_allocator.h
@@ -38,7 +38,7 @@
#include <cstddef>
#include <limits>
-namespace __gnu_cxx_test
+namespace __gnu_test
{
class allocation_tracker
{
@@ -169,7 +169,7 @@ namespace __gnu_cxx_test
bool
operator!=(const tracker_alloc<T1>&, const tracker_alloc<T2>&) throw()
{ return false; }
-}; // namespace __gnu_cxx_test
+}; // namespace __gnu_test
#endif // _GLIBCXX_TESTSUITE_ALLOCATOR_H
diff --git a/libstdc++-v3/testsuite/testsuite_hooks.cc b/libstdc++-v3/testsuite/testsuite_hooks.cc
index 793c1dc6354..a2ace1156e4 100644
--- a/libstdc++-v3/testsuite/testsuite_hooks.cc
+++ b/libstdc++-v3/testsuite/testsuite_hooks.cc
@@ -42,7 +42,7 @@
#include <locale>
#include <cxxabi.h>
-namespace __gnu_cxx_test
+namespace __gnu_test
{
#ifdef _GLIBCXX_MEM_LIMITS
void
@@ -155,8 +155,9 @@ namespace __gnu_cxx_test
if (res != NULL)
{
string preLC_ALL = res;
- for (func_callback::const_iterator i = l.begin(); i != l.end(); ++i)
- (*i)();
+ const func_callback::test_type* tests = l.tests();
+ for (int i = 0; i < l.size(); ++i)
+ (*tests[i])();
string postLC_ALL= setlocale(LC_ALL, NULL);
VERIFY( preLC_ALL == postLC_ALL );
}
@@ -180,8 +181,9 @@ namespace __gnu_cxx_test
const char* oldENV = getenv(env);
if (!setenv(env, name, 1))
{
- for (func_callback::const_iterator i = l.begin(); i != l.end(); ++i)
- (*i)();
+ const func_callback::test_type* tests = l.tests();
+ for (int i = 0; i < l.size(); ++i)
+ (*tests[i])();
setenv(env, oldENV ? oldENV : "", 1);
}
else
diff --git a/libstdc++-v3/testsuite/testsuite_hooks.h b/libstdc++-v3/testsuite/testsuite_hooks.h
index 896bf1cbcae..698433582cf 100644
--- a/libstdc++-v3/testsuite/testsuite_hooks.h
+++ b/libstdc++-v3/testsuite/testsuite_hooks.h
@@ -30,7 +30,7 @@
// This file provides the following:
//
-// 1) VERIFY(), via DEBUG_ASSERT, from Brent Verner <brent@rcfile.org>.
+// 1) VERIFY(), via _GLIBCXX_ASSERT, from Brent Verner <brent@rcfile.org>.
// This file is included in the various testsuite programs to provide
// #define(able) assert() behavior for debugging/testing. It may be
// a suitable location for other furry woodland creatures as well.
@@ -61,13 +61,12 @@
#include <bits/c++config.h>
#include <bits/functexcept.h>
#include <cstddef>
-#ifdef DEBUG_ASSERT
+#ifdef _GLIBCXX_ASSERT
# include <cassert>
# define VERIFY(fn) assert(fn)
#else
# define VERIFY(fn) test &= (fn)
#endif
-#include <list>
#include <locale>
#ifdef _GLIBCXX_HAVE_UNISTD_H
# include <unistd.h>
@@ -75,7 +74,7 @@
# define unlink(x)
#endif
-namespace __gnu_cxx_test
+namespace __gnu_test
{
// All macros are defined in GLIBCXX_CONFIGURE_TESTSUITE and imported
// from c++config.h
@@ -100,8 +99,32 @@ namespace __gnu_cxx_test
// Simple callback structure for variable numbers of tests (all with
// same signature). Assume all unit tests are of the signature
// void test01();
- typedef void (*test_func) (void);
- typedef std::list<test_func> func_callback;
+ class func_callback
+ {
+ public:
+ typedef void (*test_type) (void);
+
+ private:
+ int _M_size;
+ test_type _M_tests[15];
+
+ public:
+ func_callback(): _M_size(0) { };
+
+ int
+ size() const { return _M_size; }
+
+ const test_type*
+ tests() const { return _M_tests; }
+
+ void
+ push_back(test_type test)
+ {
+ _M_tests[_M_size] = test;
+ ++_M_size;
+ }
+ };
+
// Run select unit tests after setting global locale.
void
@@ -127,16 +150,6 @@ namespace __gnu_cxx_test
int i;
};
- struct pod_unsigned_int
- {
- unsigned int i;
- };
-
- struct pod_long
- {
- unsigned long i;
- };
-
struct state
{
unsigned long l;
@@ -157,7 +170,7 @@ namespace __gnu_cxx_test
~counter() { --count; }
};
-#define assert_count(n) VERIFY(__gnu_cxx_test::counter::count == n)
+#define assert_count(n) VERIFY(__gnu_test::counter::count == n)
// A (static) class for counting copy constructors and possibly throwing an
// exception on a desired count.
@@ -310,7 +323,7 @@ namespace __gnu_cxx_test
inline bool
operator==(const copy_tracker& lhs, const copy_tracker& rhs)
{ return lhs.id() == rhs.id(); }
-} // namespace __gnu_cxx_test
+} // namespace __gnu_test
namespace std
{
@@ -319,13 +332,13 @@ namespace std
// char_traits specialization
template<>
- struct char_traits<__gnu_cxx_test::pod_char>
+ struct char_traits<__gnu_test::pod_char>
{
- typedef __gnu_cxx_test::pod_char char_type;
- typedef __gnu_cxx_test::pod_int int_type;
+ typedef __gnu_test::pod_char char_type;
+ typedef __gnu_test::pod_int int_type;
typedef long pos_type;
typedef unsigned long off_type;
- typedef __gnu_cxx_test::state state_type;
+ typedef __gnu_test::state state_type;
static void
assign(char_type& __c1, const char_type& __c2);
diff --git a/libstdc++-v3/testsuite/testsuite_io.h b/libstdc++-v3/testsuite/testsuite_io.h
index 6d8c24975a5..a499f9fedc4 100644
--- a/libstdc++-v3/testsuite/testsuite_io.h
+++ b/libstdc++-v3/testsuite/testsuite_io.h
@@ -33,7 +33,7 @@
#include <fstream>
-namespace __gnu_cxx_test
+namespace __gnu_test
{
// Used to verify the constraints/requirements on get and put areas
// as defined in
@@ -73,7 +73,7 @@ namespace __gnu_cxx_test
}
};
-}; // namespace __gnu_cxx_test
+}; // namespace __gnu_test
#endif // _GLIBCXX_TESTSUITE_IO_H
diff --git a/libstdc++-v3/testsuite/testsuite_performance.h b/libstdc++-v3/testsuite/testsuite_performance.h
index 0e82137c614..9ec2f865191 100644
--- a/libstdc++-v3/testsuite/testsuite_performance.h
+++ b/libstdc++-v3/testsuite/testsuite_performance.h
@@ -40,6 +40,13 @@
#ifdef __linux__
#include <malloc.h>
+#elif defined (__FreeBSD__)
+extern "C"
+{
+ struct mallinfo { int uordblks; };
+ struct mallinfo mallinfo(void)
+ { struct mallinfo m = { (((size_t) sbrk (0) + 1023) / 1024) }; return m; }
+}
#else
extern "C"
{
@@ -49,7 +56,7 @@ extern "C"
}
#endif
-namespace __gnu_cxx_test
+namespace __gnu_test
{
class time_counter
{
@@ -170,7 +177,7 @@ namespace __gnu_cxx_test
{
const char space = ' ';
const char tab = '\t';
- const char* name = "libstdc++-v3-performance.sum";
+ const char* name = "libstdc++-performance.sum";
std::string::const_iterator i = file.begin() + file.find_last_of('/') + 1;
std::string testname(i, file.end());
@@ -190,7 +197,7 @@ namespace __gnu_cxx_test
out << std::endl;
out.close();
}
-}; // namespace __gnu_cxx_test
+}; // namespace __gnu_test
#endif // _GLIBCXX_PERFORMANCE_H
diff --git a/libstdc++-v3/testsuite/thread/pthread1.cc b/libstdc++-v3/testsuite/thread/pthread1.cc
index 2ea52ca975a..1283a75119a 100644
--- a/libstdc++-v3/testsuite/thread/pthread1.cc
+++ b/libstdc++-v3/testsuite/thread/pthread1.cc
@@ -18,8 +18,8 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
// This multi-threading C++/STL/POSIX code adheres to rules outlined here:
diff --git a/libstdc++-v3/testsuite/thread/pthread2.cc b/libstdc++-v3/testsuite/thread/pthread2.cc
index 2ce17b72ba9..7fbdfc03aeb 100644
--- a/libstdc++-v3/testsuite/thread/pthread2.cc
+++ b/libstdc++-v3/testsuite/thread/pthread2.cc
@@ -19,8 +19,8 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <fstream>
diff --git a/libstdc++-v3/testsuite/thread/pthread3.cc b/libstdc++-v3/testsuite/thread/pthread3.cc
index 70fd9ead58a..ca8f77147e7 100644
--- a/libstdc++-v3/testsuite/thread/pthread3.cc
+++ b/libstdc++-v3/testsuite/thread/pthread3.cc
@@ -19,8 +19,8 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <sstream>
diff --git a/libstdc++-v3/testsuite/thread/pthread4.cc b/libstdc++-v3/testsuite/thread/pthread4.cc
index d4d03b3867c..f95671dcb5b 100644
--- a/libstdc++-v3/testsuite/thread/pthread4.cc
+++ b/libstdc++-v3/testsuite/thread/pthread4.cc
@@ -20,8 +20,8 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <string>
diff --git a/libstdc++-v3/testsuite/thread/pthread5.cc b/libstdc++-v3/testsuite/thread/pthread5.cc
index b92ab8d4067..cc556046d4d 100644
--- a/libstdc++-v3/testsuite/thread/pthread5.cc
+++ b/libstdc++-v3/testsuite/thread/pthread5.cc
@@ -20,8 +20,8 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <vector>
diff --git a/libstdc++-v3/testsuite/thread/pthread6.cc b/libstdc++-v3/testsuite/thread/pthread6.cc
index e5ea0f98617..d88f77e77e1 100644
--- a/libstdc++-v3/testsuite/thread/pthread6.cc
+++ b/libstdc++-v3/testsuite/thread/pthread6.cc
@@ -19,8 +19,8 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <string>
diff --git a/libstdc++-v3/testsuite/thread/pthread7-rope.cc b/libstdc++-v3/testsuite/thread/pthread7-rope.cc
index 12e71efa285..716ba00ccab 100644
--- a/libstdc++-v3/testsuite/thread/pthread7-rope.cc
+++ b/libstdc++-v3/testsuite/thread/pthread7-rope.cc
@@ -18,9 +18,9 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-DDEBUG_ASSERT -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
-// { dg-options "-DDEBUG_ASSERT -pthreads" { target *-*-solaris* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-D_GLIBCXX_ASSERT -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
+// { dg-options "-D_GLIBCXX_ASSERT -pthreads" { target *-*-solaris* } }
#include <ext/rope>
#include <cstring>
diff --git a/libtool.m4 b/libtool.m4
index 9e3314cdec6..3a6ec825645 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -199,7 +199,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index 5546f66cdb2..077582422f1 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,7 +1,61 @@
+2003-09-22 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * gcc_release (announce_snapshot): Restructure processing
+ of snapshot-README and snapshot-index.html and add a new
+ substitution for @EXPORT@.
+
+2003-08-24 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * gcc_release (build_sources): Create/update the LAST_UPDATED file
+ in the source directory with information how sources were obtained.
+
+2003-08-16 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * gcc_release (build_sources): Use two new variables EXPORTTAG and
+ EXPORTDATE to make the extraction of sources more transparent and
+ also allow snapshots (off mainline) without a tag.
+
+2003-08-08 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_release: Correct logic for updating version.c. Put
+ prereleases into a subdirectory.
+
+2003-07-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * crontab: Update invocation of gcc_release according to the
+ previous changes there. Add automatic 3.4 snapshots from mainline.
+
+2003-07-23 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release (usage): Document that -s now takes symbolic name
+ and branch of the snapshot as parameters.
+ Implement this as part of command-line processing.
+ (BRANCH): Remove default initialization for snapshots.
+ (CVSBRANCH): Ditto.
+ Do not lay down a CVS tag if generating a snapshot from mainline.
+
+2003-07-19 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release (announce_snapshot): Use ${RELEASE} instead
+ of ${BRANCH}-${DATE} to refer to the snapshot directory.
+ Put README file into the snapshot directory.
+
+ (RELEASE): Define as ${BRANCH}-${DATE} for snapshots.
+ (FTP_PATH): Use ${RELEASE} in case of snapshots.
+ (TAG): Ditto.
+ (OLD_TARS): Adjust to new directory scheme for snapshots.
+
+2003-07-14 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release (announce_snapshot): Add substitution of @RELEASE@
+ for README and index.html.
+ * snapshot-README: Use it.
+ * snapshot-index.html: Ditto.
+
2003-07-09 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
- * gcc_release (announce_snapshot): Add substitution of @BRANCH
- for README and index.html. Remove substitution of @LONG_DATE.
+ * gcc_release (announce_snapshot): Add substitution of @BRANCH@
+ for README and index.html. Remove substitution of @LONG_DATE@.
Put index.html into the respective snapshot directory.
Adjust subject of the notification mail to the new naming scheme
for CVS tags.
diff --git a/maintainer-scripts/crontab b/maintainer-scripts/crontab
index 4c7079bed7d..17ab4277805 100644
--- a/maintainer-scripts/crontab
+++ b/maintainer-scripts/crontab
@@ -1,4 +1,5 @@
16 0 * * * sh /home/gccadmin/scripts/update_version
50 0 * * * sh /home/gccadmin/scripts/update_web_docs
55 0 * * * sh /home/gccadmin/scripts/update_web_docs_libstdcxx
-40 16 * * 1 sh /home/gccadmin/scripts/gcc_release -s -l -d /sourceware/snapshot-tmp all
+40 16 * * 1 sh /home/gccadmin/scripts/gcc_release -s 3.3:gcc-3_3-branch -l -d /sourceware/snapshot-tmp all
+42 16 * * 3 sh /home/gccadmin/scripts/gcc_release -s 3.4:HEAD -l -d /sourceware/snapshot-tmp all
diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release
index e9d3437ea40..f9494657cda 100755
--- a/maintainer-scripts/gcc_release
+++ b/maintainer-scripts/gcc_release
@@ -64,13 +64,13 @@ inform() {
usage() {
cat <<EOF
-gcc_release -r release [further options]
-gcc_release -s [further options]
+gcc_release -r release [-f] [further options]
+gcc_release -s name:cvsbranch [further options]
Options:
-r release Version of the form X.Y or X.Y.Z.
- -s Create a snapshot, not a real release.
+ -s name:cvsbranch Create a snapshot, not a real release.
-d destination Local working directory where we will build the release
(default=${HOME}).
@@ -144,7 +144,7 @@ EOF
for x in gcc/version.c; do
y=`basename ${x}`
(changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
- sed -e 's|= \".*\"|= \"'${RELEASE}'\"|g' < ${y} > ${y}.new && \
+ sed -e 's|version_string\[\] = \".*\"|version_string\[\] = \"'${RELEASE}'\"|g' < ${y} > ${y}.new && \
mv ${y}.new ${y} && \
${CVS} ci -m 'Update version' ${y}) || \
error "Could not update ${x}"
@@ -161,19 +161,38 @@ EOF
inform "Tagging sources as ${TAG}"
${CVS} rtag -r ${CVSBRANCH} -F ${TAG} gcc || \
error "Could not tag sources"
- CVSBRANCH=$TAG
+ EXPORTTAG="-r${TAG}"
+ EXPORTDATE=""
+ else
+ if [ ${CVSBRANCH} != "HEAD" ]; then
+ EXPORTTAG="-r${CVSBRANCH}"
+ else
+ # HEAD is the default branch, no need to specify it.
+ EXPORTTAG=""
+ fi
+ EXPORTDATE="-D`date -u +"%Y-%m-%d %H:%M"` UTC"
fi
# Export the current sources.
- inform "Retrieving release sources"
- ${CVS} \
- export -d "`basename ${SOURCE_DIRECTORY}`" \
- -r ${CVSBRANCH} gcc || \
- error "Could not retrieve release sources"
+ inform "Retrieving sources (cvs export ${EXPORTTAG} ${EXPORTDATE} gcc)"
+
+ if [ -z "${EXPORTTAG}" ]; then
+ ${CVS} export -d "`basename ${SOURCE_DIRECTORY}`" \
+ "${EXPORTDATE}" gcc || \
+ error "Could not retrieve sources"
+ elif [ -z "${EXPORTDATE}" ]; then
+ ${CVS} export -d "`basename ${SOURCE_DIRECTORY}`" \
+ "${EXPORTTAG}" gcc || \
+ error "Could not retrieve sources"
+ else
+ error "Cannot specify -r and -D at the same time"
+ fi
- # Run gcc_update on them to set up the timestamps nicely.
+ # Run gcc_update on them to set up the timestamps nicely, and (re)write
+ # the LAST_UPDATED file containing the CVS tag/date used.
changedir "gcc-${RELEASE}"
contrib/gcc_update --touch
+ echo "Obtained from CVS: ${EXPORTTAG} ${EXPORTDATE}" > LAST_UPDATED
# Obtain some documentation files from the wwwdocs module.
inform "Retrieving HTML documentation"
@@ -377,14 +396,22 @@ announce_snapshot() {
TEXT_DATE=`date --date=$DATE +%B\ %d,\ %Y`
cd ~ftp/pub/gcc/snapshots
- sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \
+ sed -e "s%@DATE@%$DATE%g" \
+ -e "s%@TEXT_DATE@%$TEXT_DATE%g" \
+ -e "s%@LAST_DATE@%$LAST_DATE%g" \
-e "s%@BRANCH@%${BRANCH}%g" \
- -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-README > $$
- mv $$ README
- sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \
+ -e "s%@RELEASE@%${RELEASE}%g" \
+ -e "s%@EXPORT@%${EXPORTTAG} ${EXPORTDATE}%g" \
+ ~/scripts/snapshot-README > $$
+ mv $$ ${RELEASE}/README
+ sed -e "s%@DATE@%$DATE%g" \
+ -e "s%@TEXT_DATE@%$TEXT_DATE%g" \
+ -e "s%@LAST_DATE@%$LAST_DATE%g" \
-e "s%@BRANCH@%${BRANCH}%g" \
- -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-index.html > $$
- mv $$ ${BRANCH}-${DATE}/index.html
+ -e "s%@RELEASE@%${RELEASE}%g" \
+ -e "s%@EXPORT@%${EXPORTTAG} ${EXPORTDATE}%g" \
+ ~/scripts/snapshot-index.html > $$
+ mv $$ ${RELEASE}/index.html
touch LATEST-IS-${BRANCH}-${DATE}
rm -f LATEST-IS-${BRANCH}-${LAST_DATE}
@@ -392,7 +419,7 @@ announce_snapshot() {
inform "Sending mail"
export QMAILHOST=gcc.gnu.org
- mail -s "gcc-ss-${BRANCH}-${DATE} is now available" gccadmin@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README
+ mail -s "gcc-ss-${RELEASE} is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/${RELEASE}/README
}
########################################################################
@@ -499,14 +526,17 @@ TAR="${TAR:-tar}"
########################################################################
# Parse the options.
-while getopts "d:fr:u:t:p:sl" ARG; do
+while getopts "d:fr:u:t:p:s:l" ARG; do
case $ARG in
d) DESTINATION="${OPTARG}";;
r) RELEASE="${OPTARG}";;
t) TAG="${OPTARG}";;
u) CVS_USERNAME="${OPTARG}";;
f) FINAL=1;;
- s) SNAPSHOT=1;;
+ s) SNAPSHOT=1
+ BRANCH=${OPTARG%:*}
+ CVSBRANCH=${OPTARG#*:}
+ ;;
l) LOCAL=1
SCP=cp
FTP_PATH=~ftp/pub/gcc
@@ -576,24 +606,23 @@ if [ $SNAPSHOT -eq 0 ]; then
# If this is not a final release, set various parameters acordingly.
if [ ${FINAL} -ne 1 ]; then
RELEASE="${RELEASE}-${DATE}"
- FTP_PATH="${FTP_PATH}/snapshots/"
+ FTP_PATH="${FTP_PATH}/prerelease-${RELEASE}/"
else
FTP_PATH="${FTP_PATH}/releases/gcc-${RELEASE}/"
fi
else
- RELEASE=$DATE
- # For now snapshots come from the 3.3 branch.
- BRANCH="3.3"
- CVSBRANCH=gcc-3_3-branch
- FTP_PATH="${FTP_PATH}/snapshots/${BRANCH}-${DATE}"
- TAG=gcc-ss-`echo ${BRANCH} | tr '.' '_'`-${DATE}
+ RELEASE=${BRANCH}-${DATE}
+ FTP_PATH="${FTP_PATH}/snapshots/${RELEASE}"
+ if [ ${CVSBRANCH} != "HEAD" ]; then
+ TAG=gcc-ss-`echo ${RELEASE} | tr '.' '_'`
+ fi
# Building locally on gcc.gnu.org, we know what the last snapshot date
# was.
if [ $MODE_DIFFS -ne 0 ] && [ $LOCAL -ne 0 ]; then
LAST_DATE=`cat ~/.snapshot_date-${BRANCH}`
LAST_DIR=~ftp/pub/gcc/snapshots/${BRANCH}-${LAST_DATE}
- OLD_TARS=${LAST_DIR}/gcc-${LAST_DATE}.tar.bz2
+ OLD_TARS=${LAST_DIR}/gcc-${BRANCH}-${LAST_DATE}.tar.bz2
fi
fi
diff --git a/maintainer-scripts/snapshot-README b/maintainer-scripts/snapshot-README
index 7fd96efc2b2..66359e5e3d9 100644
--- a/maintainer-scripts/snapshot-README
+++ b/maintainer-scripts/snapshot-README
@@ -1,27 +1,27 @@
-gcc-ss-@BRANCH@-@DATE@ is now available on
- ftp://gcc.gnu.org/pub/gcc/snapshots/@BRANCH@-@DATE@
+gcc-ss-@RELEASE@ is now available on
+ ftp://gcc.gnu.org/pub/gcc/snapshots/@RELEASE@/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
This snapshot has been generated from the GCC CVS @BRANCH@ branch.
You'll find:
- gcc-@DATE@.tar.bz2 The full GCC snapshot, including all
- languages and runtime libraries.
+ gcc-@RELEASE@.tar.bz2 The full GCC snapshot, including all
+ languages and runtime libraries.
- gcc-core-@DATE@.tar.bz2 Just the C front end and core compiler.
+ gcc-core-@RELEASE@.tar.bz2 Just the C front end and core compiler.
- gcc-testsuite-@DATE@.tar.bz2 The GCC testsuite.
+ gcc-testsuite-@RELEASE@.tar.bz2 The GCC testsuite.
- gcc-ada-@DATE@.tar.bz2 The Ada language and runtime.
+ gcc-ada-@RELEASE@.tar.bz2 The Ada language and runtime.
- gcc-g++-@DATE@.tar.bz2 The C++ front end and runtime.
+ gcc-g++-@RELEASE@.tar.bz2 The C++ front end and runtime.
- gcc-g77-@DATE@.tar.bz2 The F77 front end and runtime.
+ gcc-g77-@RELEASE@.tar.bz2 The F77 front end and runtime.
- gcc-objc-@DATE@.tar.bz2 The Objective-C front end and runtime.
+ gcc-objc-@RELEASE@.tar.bz2 The Objective-C front end and runtime.
- gcc-java-@DATE@.tar.bz2 The Java front end and runtime.
+ gcc-java-@RELEASE@.tar.bz2 The Java front end and runtime.
Diffs from @BRANCH@-@LAST_DATE@ are available in the diffs/ subdirectory.
diff --git a/maintainer-scripts/snapshot-index.html b/maintainer-scripts/snapshot-index.html
index b39072f435b..3155872480f 100644
--- a/maintainer-scripts/snapshot-index.html
+++ b/maintainer-scripts/snapshot-index.html
@@ -1,11 +1,11 @@
<html>
<head>
-<title>GCC @BRANCH@-@DATE@ Snapshot</title>
+<title>GCC @RELEASE@ Snapshot</title>
</head>
<body>
-<h1>GCC @BRANCH@-@DATE@ Snapshot</h1>
+<h1>GCC @RELEASE@ Snapshot</h1>
<p>The <a href ="http://gcc.gnu.org/">GCC Project</a> makes
periodic snapshots of the GCC source tree available to the public
@@ -17,30 +17,30 @@ how to sign up can be found on the GCC project home page.</p>
<blockquote>
- <p> <a href="gcc-@DATE@.tar.bz2">
+ <p> <a href="gcc-@RELEASE@.tar.bz2">
gcc</a> @TEXT_DATE@ snapshot, includes all languages.
- <p> <a href="gcc-core-@DATE@.tar.bz2">
+ <p> <a href="gcc-core-@RELEASE@.tar.bz2">
gcc-core</a> @TEXT_DATE@ snapshot, includes just the C front
end and core compiler.
- <p> <a href="gcc-g++-@DATE@.tar.bz2">
+ <p> <a href="gcc-g++-@RELEASE@.tar.bz2">
gcc-g++</a> @TEXT_DATE@ snapshot, includes just the C++ front
end and runtime.
- <p> <a href="gcc-g77-@DATE@.tar.bz2">
+ <p> <a href="gcc-g77-@RELEASE@.tar.bz2">
gcc-g77</a> @TEXT_DATE@ snapshot, includes just the F77 front
end and runtime.
- <p> <a href="gcc-java-@DATE@.tar.bz2">
+ <p> <a href="gcc-java-@RELEASE@.tar.bz2">
gcc-java</a> @TEXT_DATE@ snapshot, includes just the Java
front end and runtime.
- <p> <a href="gcc-objc-@DATE@.tar.bz2">
+ <p> <a href="gcc-objc-@RELEASE@.tar.bz2">
gcc-objc</a> @TEXT_DATE@ snapshot, includes just the Objective-C
front end and runtime.
- <p> <a href="gcc-ada-@DATE@.tar.bz2">
+ <p> <a href="gcc-ada-@RELEASE@.tar.bz2">
gcc-ada</a> @TEXT_DATE@ snapshot, includes just the Ada
front end and runtime.
diff --git a/missing b/missing
index 7789652e877..25c96676def 100755
--- a/missing
+++ b/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 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,6 +282,45 @@ 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
diff --git a/mkinstalldirs b/mkinstalldirs
index cc8783edce3..d2d5f21b611 100755
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -2,35 +2,110 @@
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
-# Last modified: 1994-03-25
# Public domain
errstatus=0
+dirmode=""
-for file in ${1+"$@"} ; do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
- pathcomp=
- for d in ${1+"$@"} ; do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
+# 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
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ 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
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ 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
- echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
- fi
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
- pathcomp="$pathcomp/"
- done
+ pathcomp="$pathcomp/"
+ done
done
exit $errstatus
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
# mkinstalldirs ends here
diff --git a/symlink-tree b/symlink-tree
index 5b18cab9238..22132c76afd 100755
--- a/symlink-tree
+++ b/symlink-tree
@@ -1,6 +1,31 @@
#!/bin/sh
# Create a symlink tree.
#
+# Copyright (C) 1995, 2000, 2003 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 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 report bugs to <gcc-bugs@gnu.org>
+# and send patches to <gcc-patches@gnu.org>.
+
# Syntax: symlink-tree srcdir "ignore1 ignore2 ..."
#
# where srcdir is the directory to create a symlink tree to,
diff --git a/zlib/ChangeLog.gcj b/zlib/ChangeLog.gcj
index 6eea9b3e45f..c9b78e5aa00 100644
--- a/zlib/ChangeLog.gcj
+++ b/zlib/ChangeLog.gcj
@@ -1,3 +1,17 @@
+2003-09-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2003-07-11 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR bootstrap/7126
+ * configure.in: Correct zlib version number.
+ * configure: Regenerate.
+
+2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README: Note that zlib is not part of GCC.
+
2003-03-12 Andreas Schwab <schwab@suse.de>
* configure.in: Avoid trailing /. in toolexeclibdir.
diff --git a/zlib/README b/zlib/README
index 29d67146a9b..d3f96909a6b 100644
--- a/zlib/README
+++ b/zlib/README
@@ -1,3 +1,6 @@
+This directory contains the zlib package, which is not part of GCC but
+shipped with GCC as convenience.
+
zlib 1.1.4 is a general purpose data compression library. All the code
is thread safe. The data format used by the zlib library
is described by RFCs (Request for Comments) 1950 to 1952 in the files
diff --git a/zlib/configure b/zlib/configure
index f4a04306f5a..fce43735abd 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -852,7 +852,7 @@ fi
PACKAGE=zlib
-VERSION=1.1.3
+VERSION=1.1.4
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; }
@@ -1215,7 +1215,7 @@ else
if { (eval echo configure:1216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.$ac_ext | *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -2035,7 +2035,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*)
+ ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -2317,7 +2317,7 @@ EOF
# We ignore --with-system-zlib in this case.
target_all=libzgcj.la
else
- for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+ 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
@@ -2449,24 +2449,11 @@ else
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -2574,7 +2561,7 @@ main()
}
EOF
-if { (eval echo configure:2578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2565: \"$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
@@ -2599,12 +2586,12 @@ fi
for ac_func in memcpy strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2603: checking for $ac_func" >&5
+echo "configure:2590: 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 2608 "configure"
+#line 2595 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2627,7 +2614,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2618: \"$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
@@ -2654,7 +2641,7 @@ done
if test "$with_system_zlib" = yes; then
echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:2658: checking for deflate in -lz" >&5
+echo "configure:2645: 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
@@ -2662,7 +2649,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2666 "configure"
+#line 2653 "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
@@ -2673,7 +2660,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:2677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2664: \"$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
@@ -2705,17 +2692,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:2709: checking for $ac_hdr" >&5
+echo "configure:2696: 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 2714 "configure"
+#line 2701 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2706: \"$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*
@@ -2844,34 +2831,15 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
-t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
# Without the "./", some shells look in PATH for config.status.
diff --git a/zlib/configure.in b/zlib/configure.in
index 0d5588d71a3..a125164749a 100644
--- a/zlib/configure.in
+++ b/zlib/configure.in
@@ -35,7 +35,7 @@ AC_CANONICAL_SYSTEM
mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
AC_SUBST(mkinstalldirs)
-AM_INIT_AUTOMAKE(zlib, 1.1.3)
+AM_INIT_AUTOMAKE(zlib, 1.1.4)
AM_MAINTAINER_MODE